From b642d879f3a562c418066129038d0e101929fec7 Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Sun, 15 May 2022 03:10:32 +0200 Subject: [PATCH 001/751] Add missing Sender field in RepositoryVulnerabilityAlertEvent (#2365) --- github/event_types.go | 7 +++++-- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 7 +++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/github/event_types.go b/github/event_types.go index 7cfba9abbdb..52fc1408ab1 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -1058,14 +1058,17 @@ type RepositoryVulnerabilityAlertEvent struct { // Action is the action that was performed. Possible values are: "create", "dismiss", "resolve". Action *string `json:"action,omitempty"` - //The security alert of the vulnerable dependency. + // The security alert of the vulnerable dependency. Alert *RepositoryVulnerabilityAlert `json:"alert,omitempty"` - //The repository of the vulnerable dependency. + // The repository of the vulnerable dependency. Repository *Repository `json:"repository,omitempty"` // The following fields are only populated by Webhook events. Installation *Installation `json:"installation,omitempty"` + + // The user that triggered the event. + Sender *User `json:"sender,omitempty"` } // RepositoryVulnerabilityAlert represents a repository security alert. diff --git a/github/github-accessors.go b/github/github-accessors.go index 0144466378c..873b9753e71 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -15622,6 +15622,14 @@ func (r *RepositoryVulnerabilityAlertEvent) GetRepository() *Repository { return r.Repository } +// GetSender returns the Sender field. +func (r *RepositoryVulnerabilityAlertEvent) GetSender() *User { + if r == nil { + return nil + } + return r.Sender +} + // GetForkRepos returns the ForkRepos field if it's non-nil, zero value otherwise. func (r *RepoStats) GetForkRepos() int { if r == nil || r.ForkRepos == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 8fdb12e59c9..71fd7323c77 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -18223,6 +18223,13 @@ func TestRepositoryVulnerabilityAlertEvent_GetRepository(tt *testing.T) { r.GetRepository() } +func TestRepositoryVulnerabilityAlertEvent_GetSender(tt *testing.T) { + r := &RepositoryVulnerabilityAlertEvent{} + r.GetSender() + r = nil + r.GetSender() +} + func TestRepoStats_GetForkRepos(tt *testing.T) { var zeroValue int r := &RepoStats{ForkRepos: &zeroValue} From 78c231a0831576bea7f9170e003122a737a2c6c6 Mon Sep 17 00:00:00 2001 From: Tingluo Huang Date: Mon, 16 May 2022 09:35:44 -0400 Subject: [PATCH 002/751] Support query parameter `visible_to_repository` in ListOrganizationRunnerGroups (#2329) Fixes: #2328. --- github/actions_runner_groups.go | 10 +++++- github/actions_runner_groups_test.go | 46 +++++++++++++++++++++++++++- 2 files changed, 54 insertions(+), 2 deletions(-) diff --git a/github/actions_runner_groups.go b/github/actions_runner_groups.go index 2d6a15463e9..da3ca0c7519 100644 --- a/github/actions_runner_groups.go +++ b/github/actions_runner_groups.go @@ -61,10 +61,18 @@ type SetRunnerGroupRunnersRequest struct { Runners []int64 `json:"runners"` } +// ListOrgRunnerGroupOptions extend ListOptions to have the optional parameters VisibleToRepository. +type ListOrgRunnerGroupOptions struct { + ListOptions + + // Only return runner groups that are allowed to be used by this repository. + VisibleToRepository string `url:"visible_to_repository,omitempty"` +} + // ListOrganizationRunnerGroups lists all self-hosted runner groups configured in an organization. // // GitHub API docs: https://docs.github.com/en/rest/reference/actions#list-self-hosted-runner-groups-for-an-organization -func (s *ActionsService) ListOrganizationRunnerGroups(ctx context.Context, org string, opts *ListOptions) (*RunnerGroups, *Response, error) { +func (s *ActionsService) ListOrganizationRunnerGroups(ctx context.Context, org string, opts *ListOrgRunnerGroupOptions) (*RunnerGroups, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups", org) u, err := addOptions(u, opts) if err != nil { diff --git a/github/actions_runner_groups_test.go b/github/actions_runner_groups_test.go index 1ec958a1bb7..fc8b2480027 100644 --- a/github/actions_runner_groups_test.go +++ b/github/actions_runner_groups_test.go @@ -24,7 +24,51 @@ func TestActionsService_ListOrganizationRunnerGroups(t *testing.T) { fmt.Fprint(w, `{"total_count":3,"runner_groups":[{"id":1,"name":"Default","visibility":"all","default":true,"runners_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/1/runners","inherited":false,"allows_public_repositories":true},{"id":2,"name":"octo-runner-group","visibility":"selected","default":false,"selected_repositories_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories","runners_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners","inherited":true,"allows_public_repositories":true},{"id":3,"name":"expensive-hardware","visibility":"private","default":false,"runners_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/3/runners","inherited":false,"allows_public_repositories":true}]}`) }) - opts := &ListOptions{Page: 2, PerPage: 2} + opts := &ListOrgRunnerGroupOptions{ListOptions: ListOptions{Page: 2, PerPage: 2}} + ctx := context.Background() + groups, _, err := client.Actions.ListOrganizationRunnerGroups(ctx, "o", opts) + if err != nil { + t.Errorf("Actions.ListOrganizationRunnerGroups returned error: %v", err) + } + + want := &RunnerGroups{ + TotalCount: 3, + RunnerGroups: []*RunnerGroup{ + {ID: Int64(1), Name: String("Default"), Visibility: String("all"), Default: Bool(true), RunnersURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/1/runners"), Inherited: Bool(false), AllowsPublicRepositories: Bool(true)}, + {ID: Int64(2), Name: String("octo-runner-group"), Visibility: String("selected"), Default: Bool(false), SelectedRepositoriesURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories"), RunnersURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners"), Inherited: Bool(true), AllowsPublicRepositories: Bool(true)}, + {ID: Int64(3), Name: String("expensive-hardware"), Visibility: String("private"), Default: Bool(false), RunnersURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/3/runners"), Inherited: Bool(false), AllowsPublicRepositories: Bool(true)}, + }, + } + if !cmp.Equal(groups, want) { + t.Errorf("Actions.ListOrganizationRunnerGroups returned %+v, want %+v", groups, want) + } + + const methodName = "ListOrganizationRunnerGroups" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.ListOrganizationRunnerGroups(ctx, "\n", opts) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.ListOrganizationRunnerGroups(ctx, "o", opts) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_ListOrganizationRunnerGroupsVisibleToRepo(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/actions/runner-groups", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{"per_page": "2", "page": "2", "visible_to_repository": "github"}) + fmt.Fprint(w, `{"total_count":3,"runner_groups":[{"id":1,"name":"Default","visibility":"all","default":true,"runners_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/1/runners","inherited":false,"allows_public_repositories":true},{"id":2,"name":"octo-runner-group","visibility":"selected","default":false,"selected_repositories_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories","runners_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners","inherited":true,"allows_public_repositories":true},{"id":3,"name":"expensive-hardware","visibility":"private","default":false,"runners_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/3/runners","inherited":false,"allows_public_repositories":true}]}`) + }) + + opts := &ListOrgRunnerGroupOptions{ListOptions: ListOptions{Page: 2, PerPage: 2}, VisibleToRepository: "github"} ctx := context.Background() groups, _, err := client.Actions.ListOrganizationRunnerGroups(ctx, "o", opts) if err != nil { From 11817b601b3d46ba60640565e232f54283edd8e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=AD=E5=BC=80=E7=AE=B1?= Date: Mon, 16 May 2022 21:57:02 +0800 Subject: [PATCH 003/751] Add support to sync fork branch with upstream repo (#2337) Fixes: #2335 --- github/github-accessors.go | 32 +++++++++++++++++++++++ github/github-accessors_test.go | 40 ++++++++++++++++++++++++++++ github/repos_merging.go | 34 ++++++++++++++++++++++++ github/repos_merging_test.go | 46 +++++++++++++++++++++++++++++++++ 4 files changed, 152 insertions(+) diff --git a/github/github-accessors.go b/github/github-accessors.go index 873b9753e71..f482d36bad9 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -13910,6 +13910,38 @@ func (r *RenameOrgResponse) GetURL() string { return *r.URL } +// GetBranch returns the Branch field if it's non-nil, zero value otherwise. +func (r *RepoMergeUpstreamRequest) GetBranch() string { + if r == nil || r.Branch == nil { + return "" + } + return *r.Branch +} + +// GetBaseBranch returns the BaseBranch field if it's non-nil, zero value otherwise. +func (r *RepoMergeUpstreamResult) GetBaseBranch() string { + if r == nil || r.BaseBranch == nil { + return "" + } + return *r.BaseBranch +} + +// GetMergeType returns the MergeType field if it's non-nil, zero value otherwise. +func (r *RepoMergeUpstreamResult) GetMergeType() string { + if r == nil || r.MergeType == nil { + return "" + } + return *r.MergeType +} + +// GetMessage returns the Message field if it's non-nil, zero value otherwise. +func (r *RepoMergeUpstreamResult) GetMessage() string { + if r == nil || r.Message == nil { + return "" + } + return *r.Message +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (r *RepoName) GetFrom() string { if r == nil || r.From == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 71fd7323c77..2643c23fa78 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -16194,6 +16194,46 @@ func TestRenameOrgResponse_GetURL(tt *testing.T) { r.GetURL() } +func TestRepoMergeUpstreamRequest_GetBranch(tt *testing.T) { + var zeroValue string + r := &RepoMergeUpstreamRequest{Branch: &zeroValue} + r.GetBranch() + r = &RepoMergeUpstreamRequest{} + r.GetBranch() + r = nil + r.GetBranch() +} + +func TestRepoMergeUpstreamResult_GetBaseBranch(tt *testing.T) { + var zeroValue string + r := &RepoMergeUpstreamResult{BaseBranch: &zeroValue} + r.GetBaseBranch() + r = &RepoMergeUpstreamResult{} + r.GetBaseBranch() + r = nil + r.GetBaseBranch() +} + +func TestRepoMergeUpstreamResult_GetMergeType(tt *testing.T) { + var zeroValue string + r := &RepoMergeUpstreamResult{MergeType: &zeroValue} + r.GetMergeType() + r = &RepoMergeUpstreamResult{} + r.GetMergeType() + r = nil + r.GetMergeType() +} + +func TestRepoMergeUpstreamResult_GetMessage(tt *testing.T) { + var zeroValue string + r := &RepoMergeUpstreamResult{Message: &zeroValue} + r.GetMessage() + r = &RepoMergeUpstreamResult{} + r.GetMessage() + r = nil + r.GetMessage() +} + func TestRepoName_GetFrom(tt *testing.T) { var zeroValue string r := &RepoName{From: &zeroValue} diff --git a/github/repos_merging.go b/github/repos_merging.go index 7edda3efff9..a8d860742c8 100644 --- a/github/repos_merging.go +++ b/github/repos_merging.go @@ -18,6 +18,20 @@ type RepositoryMergeRequest struct { CommitMessage *string `json:"commit_message,omitempty"` } +// RepoMergeUpstreamRequest represents a request to sync a branch of +// a forked repository to keep it up-to-date with the upstream repository. +type RepoMergeUpstreamRequest struct { + Branch *string `json:"branch,omitempty"` +} + +// RepoMergeUpstreamResult represents the result of syncing a branch of +// a forked repository with the upstream repository. +type RepoMergeUpstreamResult struct { + Message *string `json:"message,omitempty"` + MergeType *string `json:"merge_type,omitempty"` + BaseBranch *string `json:"base_branch,omitempty"` +} + // Merge a branch in the specified repository. // // GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#merge-a-branch @@ -36,3 +50,23 @@ func (s *RepositoriesService) Merge(ctx context.Context, owner, repo string, req return commit, resp, nil } + +// MergeUpstream syncs a branch of a forked repository to keep it up-to-date +// with the upstream repository. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/branches#sync-a-fork-branch-with-the-upstream-repository +func (s *RepositoriesService) MergeUpstream(ctx context.Context, owner, repo string, request *RepoMergeUpstreamRequest) (*RepoMergeUpstreamResult, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/merge-upstream", owner, repo) + req, err := s.client.NewRequest("POST", u, request) + if err != nil { + return nil, nil, err + } + + result := new(RepoMergeUpstreamResult) + resp, err := s.client.Do(ctx, req, result) + if err != nil { + return nil, resp, err + } + + return result, resp, nil +} diff --git a/github/repos_merging_test.go b/github/repos_merging_test.go index 052631000af..0275915b9bf 100644 --- a/github/repos_merging_test.go +++ b/github/repos_merging_test.go @@ -80,3 +80,49 @@ func TestRepositoryMergeRequest_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestRepositoriesService_MergeUpstream(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + input := &RepoMergeUpstreamRequest{ + Branch: String("b"), + } + + mux.HandleFunc("/repos/o/r/merge-upstream", func(w http.ResponseWriter, r *http.Request) { + v := new(RepoMergeUpstreamRequest) + 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, `{"merge_type":"m"}`) + }) + + ctx := context.Background() + result, _, err := client.Repositories.MergeUpstream(ctx, "o", "r", input) + if err != nil { + t.Errorf("Repositories.MergeUpstream returned error: %v", err) + } + + want := &RepoMergeUpstreamResult{MergeType: String("m")} + if !cmp.Equal(result, want) { + t.Errorf("Repositories.MergeUpstream returned %+v, want %+v", result, want) + } + + const methodName = "MergeUpstream" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.MergeUpstream(ctx, "\n", "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.MergeUpstream(ctx, "o", "r", input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} From a58d5f0adf74ef73aadaac476f7285afc77a3b43 Mon Sep 17 00:00:00 2001 From: Sho Okada Date: Mon, 16 May 2022 23:17:43 +0900 Subject: [PATCH 004/751] Add fields to RateLimits struct (#2340) Fixes: #2339 --- github/github-accessors.go | 48 ++++++++++++ github/github-accessors_test.go | 42 +++++++++++ github/github.go | 39 +++++++++- github/github_test.go | 130 ++++++++++++++++++++++++++++++-- 4 files changed, 252 insertions(+), 7 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index f482d36bad9..d3e42617790 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -13542,6 +13542,22 @@ func (p *PushEventRepository) GetWatchersCount() int { return *p.WatchersCount } +// GetActionsRunnerRegistration returns the ActionsRunnerRegistration field. +func (r *RateLimits) GetActionsRunnerRegistration() *Rate { + if r == nil { + return nil + } + return r.ActionsRunnerRegistration +} + +// GetCodeScanningUpload returns the CodeScanningUpload field. +func (r *RateLimits) GetCodeScanningUpload() *Rate { + if r == nil { + return nil + } + return r.CodeScanningUpload +} + // GetCore returns the Core field. func (r *RateLimits) GetCore() *Rate { if r == nil { @@ -13550,6 +13566,30 @@ func (r *RateLimits) GetCore() *Rate { return r.Core } +// GetGraphQL returns the GraphQL field. +func (r *RateLimits) GetGraphQL() *Rate { + if r == nil { + return nil + } + return r.GraphQL +} + +// GetIntegrationManifest returns the IntegrationManifest field. +func (r *RateLimits) GetIntegrationManifest() *Rate { + if r == nil { + return nil + } + return r.IntegrationManifest +} + +// GetSCIM returns the SCIM field. +func (r *RateLimits) GetSCIM() *Rate { + if r == nil { + return nil + } + return r.SCIM +} + // GetSearch returns the Search field. func (r *RateLimits) GetSearch() *Rate { if r == nil { @@ -13558,6 +13598,14 @@ func (r *RateLimits) GetSearch() *Rate { return r.Search } +// GetSourceImport returns the SourceImport field. +func (r *RateLimits) GetSourceImport() *Rate { + if r == nil { + return nil + } + return r.SourceImport +} + // GetContent returns the Content field if it's non-nil, zero value otherwise. func (r *Reaction) GetContent() string { if r == nil || r.Content == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 2643c23fa78..aadfab90d47 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -15761,6 +15761,20 @@ func TestPushEventRepository_GetWatchersCount(tt *testing.T) { p.GetWatchersCount() } +func TestRateLimits_GetActionsRunnerRegistration(tt *testing.T) { + r := &RateLimits{} + r.GetActionsRunnerRegistration() + r = nil + r.GetActionsRunnerRegistration() +} + +func TestRateLimits_GetCodeScanningUpload(tt *testing.T) { + r := &RateLimits{} + r.GetCodeScanningUpload() + r = nil + r.GetCodeScanningUpload() +} + func TestRateLimits_GetCore(tt *testing.T) { r := &RateLimits{} r.GetCore() @@ -15768,6 +15782,27 @@ func TestRateLimits_GetCore(tt *testing.T) { r.GetCore() } +func TestRateLimits_GetGraphQL(tt *testing.T) { + r := &RateLimits{} + r.GetGraphQL() + r = nil + r.GetGraphQL() +} + +func TestRateLimits_GetIntegrationManifest(tt *testing.T) { + r := &RateLimits{} + r.GetIntegrationManifest() + r = nil + r.GetIntegrationManifest() +} + +func TestRateLimits_GetSCIM(tt *testing.T) { + r := &RateLimits{} + r.GetSCIM() + r = nil + r.GetSCIM() +} + func TestRateLimits_GetSearch(tt *testing.T) { r := &RateLimits{} r.GetSearch() @@ -15775,6 +15810,13 @@ func TestRateLimits_GetSearch(tt *testing.T) { r.GetSearch() } +func TestRateLimits_GetSourceImport(tt *testing.T) { + r := &RateLimits{} + r.GetSourceImport() + r = nil + r.GetSourceImport() +} + func TestReaction_GetContent(tt *testing.T) { var zeroValue string r := &Reaction{Content: &zeroValue} diff --git a/github/github.go b/github/github.go index 080a8794dd3..f51f9d88ca7 100644 --- a/github/github.go +++ b/github/github.go @@ -1082,15 +1082,26 @@ type RateLimits struct { // requests are limited to 60 per hour. Authenticated requests are // limited to 5,000 per hour. // - // GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/#rate-limiting + // GitHub API docs: https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting Core *Rate `json:"core"` // The rate limit for search API requests. Unauthenticated requests // are limited to 10 requests per minutes. Authenticated requests are // limited to 30 per minute. // - // GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/search/#rate-limit + // GitHub API docs: https://docs.github.com/en/rest/search#rate-limit Search *Rate `json:"search"` + + // GitHub API docs: https://docs.github.com/en/graphql/overview/resource-limitations#rate-limit + GraphQL *Rate `json:"graphql"` + + // GitHub API dos: https://docs.github.com/en/rest/rate-limit + IntegrationManifest *Rate `json:"integration_manifest"` + + SourceImport *Rate `json:"source_import"` + CodeScanningUpload *Rate `json:"code_scanning_upload"` + ActionsRunnerRegistration *Rate `json:"actions_runner_registration"` + SCIM *Rate `json:"scim"` } func (r RateLimits) String() string { @@ -1102,6 +1113,12 @@ type rateLimitCategory uint8 const ( coreCategory rateLimitCategory = iota searchCategory + graphqlCategory + integrationManifestCategory + sourceImportCategory + codeScanningUploadCategory + actionsRunnerRegistrationCategory + scimCategory categories // An array of this length will be able to contain all rate limit categories. ) @@ -1142,6 +1159,24 @@ func (c *Client) RateLimits(ctx context.Context) (*RateLimits, *Response, error) if response.Resources.Search != nil { c.rateLimits[searchCategory] = *response.Resources.Search } + if response.Resources.GraphQL != nil { + c.rateLimits[graphqlCategory] = *response.Resources.GraphQL + } + if response.Resources.IntegrationManifest != nil { + c.rateLimits[integrationManifestCategory] = *response.Resources.IntegrationManifest + } + if response.Resources.SourceImport != nil { + c.rateLimits[sourceImportCategory] = *response.Resources.SourceImport + } + if response.Resources.CodeScanningUpload != nil { + c.rateLimits[codeScanningUploadCategory] = *response.Resources.CodeScanningUpload + } + if response.Resources.ActionsRunnerRegistration != nil { + c.rateLimits[actionsRunnerRegistrationCategory] = *response.Resources.ActionsRunnerRegistration + } + if response.Resources.SCIM != nil { + c.rateLimits[scimCategory] = *response.Resources.SCIM + } c.rateMu.Unlock() } diff --git a/github/github_test.go b/github/github_test.go index 475eb9d8205..93698718721 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -474,10 +474,16 @@ func TestClient_rateLimits(t *testing.T) { func TestRateLimits_String(t *testing.T) { v := RateLimits{ - Core: &Rate{}, - Search: &Rate{}, - } - want := `github.RateLimits{Core:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, Search:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}}` + Core: &Rate{}, + Search: &Rate{}, + GraphQL: &Rate{}, + IntegrationManifest: &Rate{}, + SourceImport: &Rate{}, + CodeScanningUpload: &Rate{}, + ActionsRunnerRegistration: &Rate{}, + SCIM: &Rate{}, + } + want := `github.RateLimits{Core:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, Search:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, GraphQL:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, IntegrationManifest:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, SourceImport:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, CodeScanningUpload:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, ActionsRunnerRegistration:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, SCIM:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}}` if got := v.String(); got != want { t.Errorf("RateLimits.String = %v, want %v", got, want) } @@ -1862,7 +1868,13 @@ func TestRateLimits(t *testing.T) { testMethod(t, r, "GET") fmt.Fprint(w, `{"resources":{ "core": {"limit":2,"remaining":1,"reset":1372700873}, - "search": {"limit":3,"remaining":2,"reset":1372700874} + "search": {"limit":3,"remaining":2,"reset":1372700874}, + "graphql": {"limit":4,"remaining":3,"reset":1372700875}, + "integration_manifest": {"limit":5,"remaining":4,"reset":1372700876}, + "source_import": {"limit":6,"remaining":5,"reset":1372700877}, + "code_scanning_upload": {"limit":7,"remaining":6,"reset":1372700878}, + "actions_runner_registration": {"limit":8,"remaining":7,"reset":1372700879}, + "scim": {"limit":9,"remaining":8,"reset":1372700880} }}`) }) @@ -1883,6 +1895,36 @@ func TestRateLimits(t *testing.T) { Remaining: 2, Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 54, 0, time.UTC).Local()}, }, + GraphQL: &Rate{ + Limit: 4, + Remaining: 3, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 55, 0, time.UTC).Local()}, + }, + IntegrationManifest: &Rate{ + Limit: 5, + Remaining: 4, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 56, 0, time.UTC).Local()}, + }, + SourceImport: &Rate{ + Limit: 6, + Remaining: 5, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 57, 0, time.UTC).Local()}, + }, + CodeScanningUpload: &Rate{ + Limit: 7, + Remaining: 6, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 58, 0, time.UTC).Local()}, + }, + ActionsRunnerRegistration: &Rate{ + Limit: 8, + Remaining: 7, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 59, 0, time.UTC).Local()}, + }, + SCIM: &Rate{ + Limit: 9, + Remaining: 8, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 48, 00, 0, time.UTC).Local()}, + }, } if !cmp.Equal(rate, want) { t.Errorf("RateLimits returned %+v, want %+v", rate, want) @@ -1894,6 +1936,24 @@ func TestRateLimits(t *testing.T) { if got, want := client.rateLimits[searchCategory], *want.Search; got != want { t.Errorf("client.rateLimits[searchCategory] is %+v, want %+v", got, want) } + if got, want := client.rateLimits[graphqlCategory], *want.GraphQL; got != want { + t.Errorf("client.rateLimits[graphqlCategory] is %+v, want %+v", got, want) + } + if got, want := client.rateLimits[integrationManifestCategory], *want.IntegrationManifest; got != want { + t.Errorf("client.rateLimits[integrationManifestCategory] is %+v, want %+v", got, want) + } + if got, want := client.rateLimits[sourceImportCategory], *want.SourceImport; got != want { + t.Errorf("client.rateLimits[sourceImportCategory] is %+v, want %+v", got, want) + } + if got, want := client.rateLimits[codeScanningUploadCategory], *want.CodeScanningUpload; got != want { + t.Errorf("client.rateLimits[codeScanningUploadCategory] is %+v, want %+v", got, want) + } + if got, want := client.rateLimits[actionsRunnerRegistrationCategory], *want.ActionsRunnerRegistration; got != want { + t.Errorf("client.rateLimits[actionsRunnerRegistrationCategory] is %+v, want %+v", got, want) + } + if got, want := client.rateLimits[scimCategory], *want.SCIM; got != want { + t.Errorf("client.rateLimits[scimCategory] is %+v, want %+v", got, want) + } } func TestRateLimits_coverage(t *testing.T) { @@ -2394,6 +2454,36 @@ func TestRateLimits_Marshal(t *testing.T) { Remaining: 1, Reset: Timestamp{referenceTime}, }, + GraphQL: &Rate{ + Limit: 1, + Remaining: 1, + Reset: Timestamp{referenceTime}, + }, + IntegrationManifest: &Rate{ + Limit: 1, + Remaining: 1, + Reset: Timestamp{referenceTime}, + }, + SourceImport: &Rate{ + Limit: 1, + Remaining: 1, + Reset: Timestamp{referenceTime}, + }, + CodeScanningUpload: &Rate{ + Limit: 1, + Remaining: 1, + Reset: Timestamp{referenceTime}, + }, + ActionsRunnerRegistration: &Rate{ + Limit: 1, + Remaining: 1, + Reset: Timestamp{referenceTime}, + }, + SCIM: &Rate{ + Limit: 1, + Remaining: 1, + Reset: Timestamp{referenceTime}, + }, } want := `{ @@ -2406,6 +2496,36 @@ func TestRateLimits_Marshal(t *testing.T) { "limit": 1, "remaining": 1, "reset": ` + referenceTimeStr + ` + }, + "graphql": { + "limit": 1, + "remaining": 1, + "reset": ` + referenceTimeStr + ` + }, + "integration_manifest": { + "limit": 1, + "remaining": 1, + "reset": ` + referenceTimeStr + ` + }, + "source_import": { + "limit": 1, + "remaining": 1, + "reset": ` + referenceTimeStr + ` + }, + "code_scanning_upload": { + "limit": 1, + "remaining": 1, + "reset": ` + referenceTimeStr + ` + }, + "actions_runner_registration": { + "limit": 1, + "remaining": 1, + "reset": ` + referenceTimeStr + ` + }, + "scim": { + "limit": 1, + "remaining": 1, + "reset": ` + referenceTimeStr + ` } }` From ce366511988348cc7e51e77d8bfb1ca95650e27c Mon Sep 17 00:00:00 2001 From: Leon Pham <81973057+leonpham0@users.noreply.github.com> Date: Mon, 16 May 2022 07:20:53 -0700 Subject: [PATCH 005/751] Add ReRequestCheckRun (#2358) Fixes: #2357 --- github/checks.go | 16 ++++++++++++++++ github/checks_test.go | 25 +++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/github/checks.go b/github/checks.go index 8e388e86759..b4819fc9459 100644 --- a/github/checks.go +++ b/github/checks.go @@ -307,6 +307,22 @@ func (s *ChecksService) ListCheckRunsCheckSuite(ctx context.Context, owner, repo return checkRunResults, resp, nil } +// ReRequestCheckRun triggers GitHub to rerequest an existing check run. +// +// GitHub API docs: https://docs.github.com/en/rest/checks/runs#rerequest-a-check-run +func (s *ChecksService) ReRequestCheckRun(ctx context.Context, owner, repo string, checkRunID int64) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/check-runs/%v/rerequest", owner, repo, checkRunID) + + req, err := s.client.NewRequest("POST", u, nil) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", mediaTypeCheckRunsPreview) + + return s.client.Do(ctx, req, nil) +} + // ListCheckSuiteOptions represents parameters to list check suites. type ListCheckSuiteOptions struct { CheckName *string `url:"check_name,omitempty"` // Filters checks suites by the name of the check run. diff --git a/github/checks_test.go b/github/checks_test.go index d3c01cdd201..2fdd2476e56 100644 --- a/github/checks_test.go +++ b/github/checks_test.go @@ -1718,3 +1718,28 @@ func TestCheckSuitePreferenceResults_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestChecksService_ReRequestCheckRun(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/check-runs/1/rerequest", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + testHeader(t, r, "Accept", mediaTypeCheckRunsPreview) + w.WriteHeader(http.StatusCreated) + }) + ctx := context.Background() + resp, err := client.Checks.ReRequestCheckRun(ctx, "o", "r", 1) + if err != nil { + t.Errorf("Checks.ReRequestCheckRun return error: %v", err) + } + if got, want := resp.StatusCode, http.StatusCreated; got != want { + t.Errorf("Checks.ReRequestCheckRun = %v, want %v", got, want) + } + + const methodName = "ReRequestCheckRun" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Checks.ReRequestCheckRun(ctx, "\n", "\n", 1) + return err + }) +} From 15b20d32927c5a59a0924e2cfa26818838e584c0 Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Mon, 16 May 2022 16:28:58 +0200 Subject: [PATCH 006/751] Add 'repository_import' event (#2364) --- github/event.go | 2 + github/event_types.go | 15 ++++- github/event_types_test.go | 86 +++++++++++++++++++++++++++ github/github-accessors.go | 32 ++++++++++ github/github-accessors_test.go | 31 ++++++++++ github/messages.go | 1 + github/messages_test.go | 4 ++ github/repos_hooks_deliveries_test.go | 1 + 8 files changed, 170 insertions(+), 2 deletions(-) diff --git a/github/event.go b/github/event.go index 5c10365970f..5a052de09c1 100644 --- a/github/event.go +++ b/github/event.go @@ -114,6 +114,8 @@ func (e *Event) ParsePayload() (payload interface{}, err error) { payload = &RepositoryEvent{} case "RepositoryDispatchEvent": payload = &RepositoryDispatchEvent{} + case "RepositoryImportEvent": + payload = &RepositoryImportEvent{} case "RepositoryVulnerabilityAlertEvent": payload = &RepositoryVulnerabilityAlertEvent{} case "SecretScanningAlertEvent": diff --git a/github/event_types.go b/github/event_types.go index 52fc1408ab1..7ce312d2105 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -945,8 +945,8 @@ type HeadCommit struct { Modified []string `json:"modified,omitempty"` } -func (p HeadCommit) String() string { - return Stringify(p) +func (h HeadCommit) String() string { + return Stringify(h) } // PushEventRepository represents the repo object in a PushEvent payload. @@ -1051,6 +1051,17 @@ type RepositoryDispatchEvent struct { Installation *Installation `json:"installation,omitempty"` } +// RepositoryImportEvent represents the activity related to a repository being imported to GitHub. +// +// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#repository_import +type RepositoryImportEvent struct { + // Status represents the final state of the import. This can be one of "success", "cancelled", or "failure". + Status *string `json:"status,omitempty"` + Repo *Repository `json:"repository,omitempty"` + Org *Organization `json:"organization,omitempty"` + Sender *User `json:"sender,omitempty"` +} + // RepositoryVulnerabilityAlertEvent is triggered when a security alert is created, dismissed, or resolved. // // GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#repository_vulnerability_alert diff --git a/github/event_types_test.go b/github/event_types_test.go index 5d82e3f4da8..e74adb30724 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -6745,6 +6745,92 @@ func TestRepositoryDispatchEvent_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } +func TestRepositoryImportEvent_Marshal(t *testing.T) { + testJSONMarshal(t, &RepositoryImportEvent{}, "{}") + + u := &RepositoryImportEvent{ + Status: String("success"), + Repo: &Repository{ + ID: Int64(1), + URL: String("s"), + Name: String("n"), + }, + Org: &Organization{ + BillingEmail: String("be"), + Blog: String("b"), + Company: String("c"), + Email: String("e"), + TwitterUsername: String("tu"), + Location: String("loc"), + Name: String("n"), + Description: String("d"), + IsVerified: Bool(true), + HasOrganizationProjects: Bool(true), + HasRepositoryProjects: Bool(true), + DefaultRepoPermission: String("drp"), + MembersCanCreateRepos: Bool(true), + MembersCanCreateInternalRepos: Bool(true), + MembersCanCreatePrivateRepos: Bool(true), + MembersCanCreatePublicRepos: Bool(false), + MembersAllowedRepositoryCreationType: String("marct"), + MembersCanCreatePages: Bool(true), + MembersCanCreatePublicPages: Bool(false), + MembersCanCreatePrivatePages: Bool(true), + }, + Sender: &User{ + Login: String("l"), + ID: Int64(1), + NodeID: String("n"), + URL: String("u"), + ReposURL: String("r"), + EventsURL: String("e"), + AvatarURL: String("a"), + }, + } + + want := `{ + "status": "success", + "repository": { + "id": 1, + "name": "n", + "url": "s" + }, + "organization": { + "name": "n", + "company": "c", + "blog": "b", + "location": "loc", + "email": "e", + "twitter_username": "tu", + "description": "d", + "billing_email": "be", + "is_verified": true, + "has_organization_projects": true, + "has_repository_projects": true, + "default_repository_permission": "drp", + "members_can_create_repositories": true, + "members_can_create_public_repositories": false, + "members_can_create_private_repositories": true, + "members_can_create_internal_repositories": true, + "members_allowed_repository_creation_type": "marct", + "members_can_create_pages": true, + "members_can_create_public_pages": false, + "members_can_create_private_pages": true + }, + "sender": { + "login": "l", + "id": 1, + "node_id": "n", + "avatar_url": "a", + "url": "u", + "events_url": "e", + "repos_url": "r" + } + }` + + testJSONMarshal(t, u, want) +} + func TestRepositoryEvent_Marshal(t *testing.T) { testJSONMarshal(t, &RepositoryEvent{}, "{}") diff --git a/github/github-accessors.go b/github/github-accessors.go index d3e42617790..6da489c2cd1 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -15190,6 +15190,38 @@ func (r *RepositoryEvent) GetSender() *User { return r.Sender } +// GetOrg returns the Org field. +func (r *RepositoryImportEvent) GetOrg() *Organization { + if r == nil { + return nil + } + return r.Org +} + +// GetRepo returns the Repo field. +func (r *RepositoryImportEvent) GetRepo() *Repository { + if r == nil { + return nil + } + return r.Repo +} + +// GetSender returns the Sender field. +func (r *RepositoryImportEvent) GetSender() *User { + if r == nil { + return nil + } + return r.Sender +} + +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (r *RepositoryImportEvent) GetStatus() string { + if r == nil || r.Status == nil { + return "" + } + return *r.Status +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (r *RepositoryInvitation) GetCreatedAt() Timestamp { if r == nil || r.CreatedAt == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index aadfab90d47..ff018424cad 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -17698,6 +17698,37 @@ func TestRepositoryEvent_GetSender(tt *testing.T) { r.GetSender() } +func TestRepositoryImportEvent_GetOrg(tt *testing.T) { + r := &RepositoryImportEvent{} + r.GetOrg() + r = nil + r.GetOrg() +} + +func TestRepositoryImportEvent_GetRepo(tt *testing.T) { + r := &RepositoryImportEvent{} + r.GetRepo() + r = nil + r.GetRepo() +} + +func TestRepositoryImportEvent_GetSender(tt *testing.T) { + r := &RepositoryImportEvent{} + r.GetSender() + r = nil + r.GetSender() +} + +func TestRepositoryImportEvent_GetStatus(tt *testing.T) { + var zeroValue string + r := &RepositoryImportEvent{Status: &zeroValue} + r.GetStatus() + r = &RepositoryImportEvent{} + r.GetStatus() + r = nil + r.GetStatus() +} + func TestRepositoryInvitation_GetCreatedAt(tt *testing.T) { var zeroValue Timestamp r := &RepositoryInvitation{CreatedAt: &zeroValue} diff --git a/github/messages.go b/github/messages.go index 324d3b80ccc..44477ddb0de 100644 --- a/github/messages.go +++ b/github/messages.go @@ -86,6 +86,7 @@ var ( "push": "PushEvent", "repository": "RepositoryEvent", "repository_dispatch": "RepositoryDispatchEvent", + "repository_import": "RepositoryImportEvent", "repository_vulnerability_alert": "RepositoryVulnerabilityAlertEvent", "release": "ReleaseEvent", "secret_scanning_alert": "SecretScanningAlertEvent", diff --git a/github/messages_test.go b/github/messages_test.go index 1d9b7f63a81..1d999c964af 100644 --- a/github/messages_test.go +++ b/github/messages_test.go @@ -457,6 +457,10 @@ func TestParseWebHook(t *testing.T) { payload: &WatchEvent{}, messageType: "watch", }, + { + payload: &RepositoryImportEvent{}, + messageType: "repository_import", + }, { payload: &RepositoryDispatchEvent{}, messageType: "repository_dispatch", diff --git a/github/repos_hooks_deliveries_test.go b/github/repos_hooks_deliveries_test.go index eea17386a04..f136639b2c4 100644 --- a/github/repos_hooks_deliveries_test.go +++ b/github/repos_hooks_deliveries_test.go @@ -184,6 +184,7 @@ var hookDeliveryPayloadTypeToStruct = map[string]interface{}{ "release": &ReleaseEvent{}, "repository": &RepositoryEvent{}, "repository_dispatch": &RepositoryDispatchEvent{}, + "repository_import": &RepositoryImportEvent{}, "repository_vulnerability_alert": &RepositoryVulnerabilityAlertEvent{}, "secret_scanning_alert": &SecretScanningAlertEvent{}, "star": &StarEvent{}, From 40c497f795cfdd0273b15556d28ac931e6175811 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 May 2022 15:21:37 -0400 Subject: [PATCH 007/751] Bump golangci/golangci-lint-action from 3.1.0 to 3.2.0 (#2366) --- .github/workflows/linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 77b306fe322..b3003f1e8d7 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -26,7 +26,7 @@ jobs: - uses: actions/checkout@v3 - name: golangci-lint ${{ matrix.working-directory }} - uses: golangci/golangci-lint-action@b517f99ae23d86ecc4c0dec08dcf48d2336abc29 #v2.5.2 + uses: golangci/golangci-lint-action@537aa1903e5d359d0b27dbc19ddd22c5087f3fbc #v3.2.0 with: version: v1.44.0 working-directory: ${{ matrix.working-directory}} From 2d872b40760dcf7080786ece0a4735509ff071f4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 May 2022 15:22:35 -0400 Subject: [PATCH 008/751] Bump github.com/google/go-github/v44 from 44.0.0 to 44.1.0 in /scrape (#2367) --- scrape/go.mod | 2 +- scrape/go.sum | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 49dcb71b3ad..b428c8fbdff 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/v44 v44.0.0 + github.com/google/go-github/v44 v44.1.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 518ed6247d2..e064129d49a 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -5,11 +5,10 @@ github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEq github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= 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/v44 v44.0.0 h1:1Lfk2mhM7pTWqwGC6Ft16S3c2LBw8DLcw9TOhYoQ9zE= -github.com/google/go-github/v44 v44.0.0/go.mod h1:CqZYQRxOcb81M+ufZB7duWNS0lFfas/r7cEAKpLBYww= +github.com/google/go-github/v44 v44.1.0 h1:shWPaufgdhr+Ad4eo/pZv9ORTxFpsxPEPEuuXAKIQGA= +github.com/google/go-github/v44 v44.1.0/go.mod h1:iWn00mWcP6PRWHhXm0zuFJ8wbEjE5AGO5D5HXYM4zgw= 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= From 0cf45d2ddf33aff226f01c89f8930f7de718f8fc Mon Sep 17 00:00:00 2001 From: AyushiN <36621150+ANaphade@users.noreply.github.com> Date: Mon, 23 May 2022 16:16:59 +0530 Subject: [PATCH 009/751] update-urls: update sidebar child articles links (#2369) --- update-urls/activity-events_test.go | 70 ++++++++++++++--------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/update-urls/activity-events_test.go b/update-urls/activity-events_test.go index d29dcf59527..2e06c551817 100644 --- a/update-urls/activity-events_test.go +++ b/update-urls/activity-events_test.go @@ -340,152 +340,152 @@ var activityEventsTestWebPage = `
  • - Actions + Actions
  • - Activity + Activity
  • - Apps + Apps
  • - Billing + Billing
  • - Checks + Checks
  • - Code Scanning + Code Scanning
  • - Codes of conduct + Codes of conduct
  • - Emojis + Emojis
  • - GitHub Enterprise administration + GitHub Enterprise administration
  • - Gists + Gists
  • - Git database + Git database
  • - Gitignore + Gitignore
  • - Interactions + Interactions
  • - Issues + Issues
  • - Licenses + Licenses
  • - Markdown + Markdown
  • - Meta + Meta
  • - Migrations + Migrations
  • - OAuth Authorizations + OAuth Authorizations
  • - Organizations + Organizations
  • - Projects + Projects
  • - Pulls + Pulls
  • - Rate limit + Rate limit
  • - Reactions + Reactions
  • - Repositories + Repositories
  • - SCIM + SCIM
  • - Search + Search
  • - Teams + Teams
  • - Users + Users
  • - Permissions required for GitHub Apps + Permissions required for GitHub Apps
  • @@ -701,7 +701,7 @@ var activityEventsTestWebPage = ` @@ -713,7 +713,7 @@ var activityEventsTestWebPage = ` @@ -725,7 +725,7 @@ var activityEventsTestWebPage = ` @@ -737,7 +737,7 @@ var activityEventsTestWebPage = ` @@ -749,7 +749,7 @@ var activityEventsTestWebPage = ` From 6931fad1bba0d6a311d99a34e9e3aa61619d9512 Mon Sep 17 00:00:00 2001 From: joshuahancox <67631498+joshuahancox@users.noreply.github.com> Date: Mon, 23 May 2022 13:29:11 +0100 Subject: [PATCH 010/751] Fix endpoints for orgs custom roles (#2370) --- github/{org_custom_roles.go => orgs_custom_roles.go} | 2 +- github/{org_custom_roles_test.go => orgs_custom_roles_test.go} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename github/{org_custom_roles.go => orgs_custom_roles.go} (96%) rename github/{org_custom_roles_test.go => orgs_custom_roles_test.go} (93%) diff --git a/github/org_custom_roles.go b/github/orgs_custom_roles.go similarity index 96% rename from github/org_custom_roles.go rename to github/orgs_custom_roles.go index 7c60fea07b6..d320a905147 100644 --- a/github/org_custom_roles.go +++ b/github/orgs_custom_roles.go @@ -29,7 +29,7 @@ type CustomRepoRoles struct { // // GitHub API docs: https://docs.github.com/en/rest/orgs/custom-roles func (s *OrganizationsService) ListCustomRepoRoles(ctx context.Context, org string) (*OrganizationCustomRepoRoles, *Response, error) { - u := fmt.Sprintf("organizations/%v/custom_roles", org) + u := fmt.Sprintf("orgs/%v/custom_roles", org) req, err := s.client.NewRequest("GET", u, nil) if err != nil { diff --git a/github/org_custom_roles_test.go b/github/orgs_custom_roles_test.go similarity index 93% rename from github/org_custom_roles_test.go rename to github/orgs_custom_roles_test.go index cfcb02611ae..7042a5ec829 100644 --- a/github/org_custom_roles_test.go +++ b/github/orgs_custom_roles_test.go @@ -18,7 +18,7 @@ func TestOrganizationsService_ListCustomRepoRoles(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - mux.HandleFunc("/organizations/o/custom_roles", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/custom_roles", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `{"total_count": 1, "custom_roles": [{ "id": 1, "name": "Developer"}]}`) }) From 7a7a7f0943f3fcffc4b8f30feaaed7333b035a99 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Tue, 24 May 2022 08:43:48 -0400 Subject: [PATCH 011/751] Update URLs (#2373) Fixes: #2360. --- CONTRIBUTING.md | 4 +- README.md | 6 +- github/actions.go | 2 +- github/actions_artifacts.go | 14 +- github/actions_runner_groups.go | 26 +- github/actions_runners.go | 32 +- github/actions_secrets.go | 38 +- github/actions_workflow_jobs.go | 6 +- github/actions_workflow_runs.go | 26 +- github/actions_workflows.go | 22 +- github/activity.go | 2 +- github/activity_events.go | 20 +- github/activity_notifications.go | 20 +- github/activity_star.go | 12 +- github/activity_watching.go | 12 +- github/admin.go | 6 +- github/admin_stats.go | 2 +- github/admin_users_test.go | 4 +- github/apps.go | 32 +- github/apps_hooks.go | 4 +- github/apps_hooks_deliveries.go | 6 +- github/apps_installation.go | 10 +- github/apps_manifest.go | 2 +- github/apps_marketplace.go | 14 +- github/authorizations.go | 14 +- github/billing.go | 16 +- github/checks.go | 24 +- github/code-scanning.go | 20 +- github/dependabot.go | 2 +- github/dependabot_secrets.go | 28 +- github/doc.go | 6 +- github/enterprise.go | 2 +- github/enterprise_actions_runners.go | 6 +- github/enterprise_audit_log.go | 2 +- github/event_types.go | 2 +- github/gists.go | 32 +- github/gists_comments.go | 10 +- github/git.go | 2 +- github/git_blobs.go | 6 +- github/git_commits.go | 4 +- github/git_refs.go | 10 +- github/git_tags.go | 4 +- github/git_trees.go | 4 +- github/github.go | 14 +- github/github_test.go | 14 +- github/gitignore.go | 6 +- github/interactions.go | 2 +- github/interactions_orgs.go | 6 +- github/interactions_repos.go | 6 +- github/issues.go | 26 +- github/issues_assignees.go | 8 +- github/issues_comments.go | 12 +- github/issues_events.go | 6 +- github/issues_labels.go | 22 +- github/issues_milestones.go | 10 +- github/issues_timeline.go | 2 +- github/licenses.go | 6 +- github/migrations.go | 14 +- github/migrations_source_import.go | 20 +- github/migrations_user.go | 12 +- github/misc.go | 10 +- github/orgs.go | 14 +- github/orgs_actions_allowed.go | 6 +- github/orgs_actions_permissions.go | 6 +- github/orgs_audit_log.go | 2 +- github/orgs_custom_roles.go | 2 +- github/orgs_hooks.go | 12 +- github/orgs_hooks_deliveries.go | 6 +- github/orgs_members.go | 34 +- github/orgs_outside_collaborators.go | 6 +- github/orgs_packages.go | 16 +- github/orgs_projects.go | 4 +- github/orgs_users_blocking.go | 8 +- github/projects.go | 44 +- github/pulls.go | 24 +- github/pulls_comments.go | 14 +- github/pulls_reviewers.go | 6 +- github/pulls_reviews.go | 16 +- github/reactions.go | 52 +- github/repos.go | 116 +- github/repos_actions_allowed.go | 8 +- github/repos_actions_permissions.go | 6 +- github/repos_autolinks.go | 8 +- github/repos_collaborators.go | 13 +- github/repos_comments.go | 12 +- github/repos_commits.go | 16 +- github/repos_community_health.go | 2 +- github/repos_contents.go | 14 +- github/repos_deployments.go | 14 +- github/repos_environments.go | 8 +- github/repos_forks.go | 4 +- github/repos_hooks.go | 14 +- github/repos_hooks_deliveries.go | 10 +- github/repos_invitations.go | 6 +- github/repos_keys.go | 8 +- github/repos_merging.go | 4 +- github/repos_pages.go | 16 +- github/repos_projects.go | 4 +- github/repos_releases.go | 30 +- github/repos_stats.go | 10 +- github/repos_statuses.go | 6 +- github/repos_test.go | 18 +- github/repos_traffic.go | 8 +- github/scim.go | 20 +- github/search.go | 16 +- github/secret_scanning.go | 14 +- github/teams.go | 74 +- github/teams_discussion_comments.go | 20 +- github/teams_discussions.go | 20 +- github/teams_members.go | 20 +- github/users.go | 20 +- github/users_blocking.go | 8 +- github/users_emails.go | 6 +- github/users_followers.go | 16 +- github/users_gpg_keys.go | 10 +- github/users_keys.go | 10 +- github/users_packages.go | 32 +- github/users_projects.go | 4 +- update-urls/activity-events_test.go | 6103 +-------------- update-urls/main.go | 225 +- update-urls/main_test.go | 58 +- update-urls/reactions_test.go | 6695 +---------------- update-urls/testdata/activity-events.html | 5686 ++++++++++++++ .../testdata/activity_events-original.go | 196 + update-urls/testdata/activity_events-want.go | 196 + update-urls/testdata/reactions-original.go | 490 ++ update-urls/testdata/reactions-want.go | 490 ++ update-urls/testdata/reactions.html | 5690 ++++++++++++++ 128 files changed, 13804 insertions(+), 13654 deletions(-) create mode 100644 update-urls/testdata/activity-events.html create mode 100644 update-urls/testdata/activity_events-original.go create mode 100644 update-urls/testdata/activity_events-want.go create mode 100644 update-urls/testdata/reactions-original.go create mode 100644 update-urls/testdata/reactions-want.go create mode 100644 update-urls/testdata/reactions.html diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ab4a7d7d760..ef94c683a8a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -87,10 +87,10 @@ where to put new methods. Code is organized in files also based pretty closely on the GitHub API documentation, following the format `{service}_{api}.go`. For example, methods -defined at live in +defined at live in [repos_hooks.go][]. -[GitHub API documentation]: https://docs.github.com/en/free-pro-team@latest/rest/reference/ +[GitHub API documentation]: https://docs.github.com/en/rest [repos_hooks.go]: https://github.com/google/go-github/blob/master/github/repos_hooks.go diff --git a/README.md b/README.md index 903f33624d3..c88f407ab5b 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ repos, _, err := client.Repositories.ListByOrg(context.Background(), "github", o The services of a client divide the API into logical chunks and correspond to the structure of the GitHub API documentation at -https://docs.github.com/en/free-pro-team@latest/rest/reference/. +https://docs.github.com/en/rest . NOTE: Using the [context](https://godoc.org/context) package, one can easily pass cancelation signals and deadlines to various services of the client for @@ -168,7 +168,7 @@ if _, ok := err.(*github.RateLimitError); ok { ``` Learn more about GitHub rate limiting at -https://docs.github.com/en/free-pro-team@latest/rest/reference/rate-limit. +https://docs.github.com/en/rest/rate-limit . ### Accepted Status ### @@ -196,7 +196,7 @@ instead designed to work with a caching `http.Transport`. We recommend using https://github.com/gregjones/httpcache for that. Learn more about GitHub conditional requests at -https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#conditional-requests. +https://docs.github.com/en/rest/overview/resources-in-the-rest-api#conditional-requests. ### Creating and Updating Resources ### diff --git a/github/actions.go b/github/actions.go index ce15d95fae1..8d552f2d0db 100644 --- a/github/actions.go +++ b/github/actions.go @@ -8,5 +8,5 @@ package github // ActionsService handles communication with the actions related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/ +// GitHub API docs: https://docs.github.com/en/rest/actions/ type ActionsService service diff --git a/github/actions_artifacts.go b/github/actions_artifacts.go index 2925921208d..3b9c83c490d 100644 --- a/github/actions_artifacts.go +++ b/github/actions_artifacts.go @@ -16,7 +16,7 @@ import ( // data between jobs in a workflow and provide storage for data // once a workflow is complete. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#artifacts +// GitHub API docs: https://docs.github.com/en/rest/actions/artifacts type Artifact struct { ID *int64 `json:"id,omitempty"` NodeID *string `json:"node_id,omitempty"` @@ -30,7 +30,7 @@ type Artifact struct { // ArtifactList represents a list of GitHub artifacts. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#artifacts +// GitHub API docs: https://docs.github.com/en/rest/actions/artifacts#artifacts type ArtifactList struct { TotalCount *int64 `json:"total_count,omitempty"` Artifacts []*Artifact `json:"artifacts,omitempty"` @@ -38,7 +38,7 @@ type ArtifactList struct { // ListArtifacts lists all artifacts that belong to a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#list-artifacts-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/actions/artifacts#list-artifacts-for-a-repository func (s *ActionsService) ListArtifacts(ctx context.Context, owner, repo string, opts *ListOptions) (*ArtifactList, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/artifacts", owner, repo) u, err := addOptions(u, opts) @@ -62,7 +62,7 @@ func (s *ActionsService) ListArtifacts(ctx context.Context, owner, repo string, // ListWorkflowRunArtifacts lists all artifacts that belong to a workflow run. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#list-workflow-run-artifacts +// GitHub API docs: https://docs.github.com/en/rest/actions/artifacts#list-workflow-run-artifacts func (s *ActionsService) ListWorkflowRunArtifacts(ctx context.Context, owner, repo string, runID int64, opts *ListOptions) (*ArtifactList, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/artifacts", owner, repo, runID) u, err := addOptions(u, opts) @@ -86,7 +86,7 @@ func (s *ActionsService) ListWorkflowRunArtifacts(ctx context.Context, owner, re // GetArtifact gets a specific artifact for a workflow run. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#get-an-artifact +// GitHub API docs: https://docs.github.com/en/rest/actions/artifacts#get-an-artifact func (s *ActionsService) GetArtifact(ctx context.Context, owner, repo string, artifactID int64) (*Artifact, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/artifacts/%v", owner, repo, artifactID) @@ -106,7 +106,7 @@ func (s *ActionsService) GetArtifact(ctx context.Context, owner, repo string, ar // DownloadArtifact gets a redirect URL to download an archive for a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#download-an-artifact +// GitHub API docs: https://docs.github.com/en/rest/actions/artifacts#download-an-artifact func (s *ActionsService) DownloadArtifact(ctx context.Context, owner, repo string, artifactID int64, followRedirects bool) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/artifacts/%v/zip", owner, repo, artifactID) @@ -126,7 +126,7 @@ func (s *ActionsService) DownloadArtifact(ctx context.Context, owner, repo strin // DeleteArtifact deletes a workflow run artifact. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#delete-an-artifact +// GitHub API docs: https://docs.github.com/en/rest/actions/artifacts#delete-an-artifact func (s *ActionsService) DeleteArtifact(ctx context.Context, owner, repo string, artifactID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/artifacts/%v", owner, repo, artifactID) diff --git a/github/actions_runner_groups.go b/github/actions_runner_groups.go index da3ca0c7519..6d89249150c 100644 --- a/github/actions_runner_groups.go +++ b/github/actions_runner_groups.go @@ -71,7 +71,7 @@ type ListOrgRunnerGroupOptions struct { // ListOrganizationRunnerGroups lists all self-hosted runner groups configured in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#list-self-hosted-runner-groups-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-organization func (s *ActionsService) ListOrganizationRunnerGroups(ctx context.Context, org string, opts *ListOrgRunnerGroupOptions) (*RunnerGroups, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups", org) u, err := addOptions(u, opts) @@ -95,7 +95,7 @@ func (s *ActionsService) ListOrganizationRunnerGroups(ctx context.Context, org s // GetOrganizationRunnerGroup gets a specific self-hosted runner group for an organization using its RunnerGroup ID. // -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#get-a-self-hosted-runner-group-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-organization func (s *ActionsService) GetOrganizationRunnerGroup(ctx context.Context, org string, groupID int64) (*RunnerGroup, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v", org, groupID) req, err := s.client.NewRequest("GET", u, nil) @@ -114,7 +114,7 @@ func (s *ActionsService) GetOrganizationRunnerGroup(ctx context.Context, org str // DeleteOrganizationRunnerGroup deletes a self-hosted runner group from an organization. // -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#delete-a-self-hosted-runner-group-from-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-organization func (s *ActionsService) DeleteOrganizationRunnerGroup(ctx context.Context, org string, groupID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v", org, groupID) @@ -128,7 +128,7 @@ func (s *ActionsService) DeleteOrganizationRunnerGroup(ctx context.Context, org // CreateOrganizationRunnerGroup creates a new self-hosted runner group for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#create-a-self-hosted-runner-group-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-organization func (s *ActionsService) CreateOrganizationRunnerGroup(ctx context.Context, org string, createReq CreateRunnerGroupRequest) (*RunnerGroup, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups", org) req, err := s.client.NewRequest("POST", u, createReq) @@ -147,7 +147,7 @@ func (s *ActionsService) CreateOrganizationRunnerGroup(ctx context.Context, org // UpdateOrganizationRunnerGroup updates a self-hosted runner group for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#update-a-self-hosted-runner-group-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-organization func (s *ActionsService) UpdateOrganizationRunnerGroup(ctx context.Context, org string, groupID int64, updateReq UpdateRunnerGroupRequest) (*RunnerGroup, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v", org, groupID) req, err := s.client.NewRequest("PATCH", u, updateReq) @@ -166,7 +166,7 @@ func (s *ActionsService) UpdateOrganizationRunnerGroup(ctx context.Context, org // ListRepositoryAccessRunnerGroup lists the repositories with access to a self-hosted runner group configured in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#list-repository-access-to-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#list-repository-access-to-a-self-hosted-runner-group-in-an-organization func (s *ActionsService) ListRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID int64, opts *ListOptions) (*ListRepositories, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/repositories", org, groupID) u, err := addOptions(u, opts) @@ -191,7 +191,7 @@ func (s *ActionsService) ListRepositoryAccessRunnerGroup(ctx context.Context, or // SetRepositoryAccessRunnerGroup replaces the list of repositories that have access to a self-hosted runner group configured in an organization // with a new List of repositories. // -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#set-repository-access-for-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#set-repository-access-for-a-self-hosted-runner-group-in-an-organization func (s *ActionsService) SetRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID int64, ids SetRepoAccessRunnerGroupRequest) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/repositories", org, groupID) @@ -206,7 +206,7 @@ func (s *ActionsService) SetRepositoryAccessRunnerGroup(ctx context.Context, org // AddRepositoryAccessRunnerGroup adds a repository to the list of selected repositories that can access a self-hosted runner group. // The runner group must have visibility set to 'selected'. // -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#add-repository-access-to-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#add-repository-access-to-a-self-hosted-runner-group-in-an-organization func (s *ActionsService) AddRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID, repoID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/repositories/%v", org, groupID, repoID) @@ -221,7 +221,7 @@ func (s *ActionsService) AddRepositoryAccessRunnerGroup(ctx context.Context, org // RemoveRepositoryAccessRunnerGroup removes a repository from the list of selected repositories that can access a self-hosted runner group. // The runner group must have visibility set to 'selected'. // -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization func (s *ActionsService) RemoveRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID, repoID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/repositories/%v", org, groupID, repoID) @@ -235,7 +235,7 @@ func (s *ActionsService) RemoveRepositoryAccessRunnerGroup(ctx context.Context, // ListRunnerGroupRunners lists self-hosted runners that are in a specific organization group. // -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#list-self-hosted-runners-in-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-organization func (s *ActionsService) ListRunnerGroupRunners(ctx context.Context, org string, groupID int64, opts *ListOptions) (*Runners, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/runners", org, groupID) u, err := addOptions(u, opts) @@ -260,7 +260,7 @@ func (s *ActionsService) ListRunnerGroupRunners(ctx context.Context, org string, // SetRunnerGroupRunners replaces the list of self-hosted runners that are part of an organization runner group // with a new list of runners. // -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#set-self-hosted-runners-in-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-organization func (s *ActionsService) SetRunnerGroupRunners(ctx context.Context, org string, groupID int64, ids SetRunnerGroupRunnersRequest) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/runners", org, groupID) @@ -274,7 +274,7 @@ func (s *ActionsService) SetRunnerGroupRunners(ctx context.Context, org string, // AddRunnerGroupRunners adds a self-hosted runner to a runner group configured in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#add-a-self-hosted-runner-to-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-organization func (s *ActionsService) AddRunnerGroupRunners(ctx context.Context, org string, groupID, runnerID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/runners/%v", org, groupID, runnerID) @@ -289,7 +289,7 @@ func (s *ActionsService) AddRunnerGroupRunners(ctx context.Context, org string, // RemoveRunnerGroupRunners removes a self-hosted runner from a group configured in an organization. // The runner is then returned to the default group. // -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#remove-a-self-hosted-runner-from-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-organization func (s *ActionsService) RemoveRunnerGroupRunners(ctx context.Context, org string, groupID, runnerID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/runners/%v", org, groupID, runnerID) diff --git a/github/actions_runners.go b/github/actions_runners.go index f37e1aa419e..40c6be3a92c 100644 --- a/github/actions_runners.go +++ b/github/actions_runners.go @@ -28,7 +28,7 @@ type ActionsEnabledOnOrgRepos struct { // ListRunnerApplicationDownloads lists self-hosted runner application binaries that can be downloaded and run. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#list-runner-applications-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#list-runner-applications-for-a-repository func (s *ActionsService) ListRunnerApplicationDownloads(ctx context.Context, owner, repo string) ([]*RunnerApplicationDownload, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners/downloads", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -53,7 +53,7 @@ type RegistrationToken struct { // CreateRegistrationToken creates a token that can be used to add a self-hosted runner. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#create-a-registration-token-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-registration-token-for-a-repository func (s *ActionsService) CreateRegistrationToken(ctx context.Context, owner, repo string) (*RegistrationToken, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners/registration-token", owner, repo) @@ -96,7 +96,7 @@ type Runners struct { // ListRunners lists all the self-hosted runners for a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#list-self-hosted-runners-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#list-self-hosted-runners-for-a-repository func (s *ActionsService) ListRunners(ctx context.Context, owner, repo string, opts *ListOptions) (*Runners, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners", owner, repo) u, err := addOptions(u, opts) @@ -120,7 +120,7 @@ func (s *ActionsService) ListRunners(ctx context.Context, owner, repo string, op // GetRunner gets a specific self-hosted runner for a repository using its runner ID. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#get-a-self-hosted-runner-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-a-repository func (s *ActionsService) GetRunner(ctx context.Context, owner, repo string, runnerID int64) (*Runner, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners/%v", owner, repo, runnerID) req, err := s.client.NewRequest("GET", u, nil) @@ -145,7 +145,7 @@ type RemoveToken struct { // CreateRemoveToken creates a token that can be used to remove a self-hosted runner from a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#create-a-remove-token-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-remove-token-for-a-repository func (s *ActionsService) CreateRemoveToken(ctx context.Context, owner, repo string) (*RemoveToken, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners/remove-token", owner, repo) @@ -165,7 +165,7 @@ func (s *ActionsService) CreateRemoveToken(ctx context.Context, owner, repo stri // RemoveRunner forces the removal of a self-hosted runner in a repository using the runner id. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#delete-a-self-hosted-runner-from-a-repository +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-a-repository func (s *ActionsService) RemoveRunner(ctx context.Context, owner, repo string, runnerID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners/%v", owner, repo, runnerID) @@ -179,7 +179,7 @@ func (s *ActionsService) RemoveRunner(ctx context.Context, owner, repo string, r // ListOrganizationRunnerApplicationDownloads lists self-hosted runner application binaries that can be downloaded and run. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#list-runner-applications-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#list-runner-applications-for-an-organization func (s *ActionsService) ListOrganizationRunnerApplicationDownloads(ctx context.Context, owner string) ([]*RunnerApplicationDownload, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners/downloads", owner) req, err := s.client.NewRequest("GET", u, nil) @@ -198,7 +198,7 @@ func (s *ActionsService) ListOrganizationRunnerApplicationDownloads(ctx context. // CreateOrganizationRegistrationToken creates a token that can be used to add a self-hosted runner to an organization. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#create-a-registration-token-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-registration-token-for-an-organization func (s *ActionsService) CreateOrganizationRegistrationToken(ctx context.Context, owner string) (*RegistrationToken, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners/registration-token", owner) @@ -218,7 +218,7 @@ func (s *ActionsService) CreateOrganizationRegistrationToken(ctx context.Context // ListOrganizationRunners lists all the self-hosted runners for an organization. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#list-self-hosted-runners-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-organization func (s *ActionsService) ListOrganizationRunners(ctx context.Context, owner string, opts *ListOptions) (*Runners, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners", owner) u, err := addOptions(u, opts) @@ -242,7 +242,7 @@ func (s *ActionsService) ListOrganizationRunners(ctx context.Context, owner stri // ListEnabledReposInOrg lists the selected repositories that are enabled for GitHub Actions in an organization. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#list-selected-repositories-enabled-for-github-actions-in-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#list-selected-repositories-enabled-for-github-actions-in-an-organization func (s *ActionsService) ListEnabledReposInOrg(ctx context.Context, owner string, opts *ListOptions) (*ActionsEnabledOnOrgRepos, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/repositories", owner) u, err := addOptions(u, opts) @@ -266,7 +266,7 @@ func (s *ActionsService) ListEnabledReposInOrg(ctx context.Context, owner string // SetEnabledReposInOrg replaces the list of selected repositories that are enabled for GitHub Actions in an organization.. // -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#set-selected-repositories-enabled-for-github-actions-in-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-selected-repositories-enabled-for-github-actions-in-an-organization func (s *ActionsService) SetEnabledReposInOrg(ctx context.Context, owner string, repositoryIDs []int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/repositories", owner) @@ -287,7 +287,7 @@ func (s *ActionsService) SetEnabledReposInOrg(ctx context.Context, owner string, // AddEnabledReposInOrg adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#enable-a-selected-repository-for-github-actions-in-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#enable-a-selected-repository-for-github-actions-in-an-organization func (s *ActionsService) AddEnabledReposInOrg(ctx context.Context, owner string, repositoryID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/repositories/%v", owner, repositoryID) @@ -306,7 +306,7 @@ func (s *ActionsService) AddEnabledReposInOrg(ctx context.Context, owner string, // RemoveEnabledRepoInOrg removes a single repository from the list of enabled repos for GitHub Actions in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#disable-a-selected-repository-for-github-actions-in-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#disable-a-selected-repository-for-github-actions-in-an-organization func (s *ActionsService) RemoveEnabledRepoInOrg(ctx context.Context, owner string, repositoryID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/repositories/%v", owner, repositoryID) @@ -325,7 +325,7 @@ func (s *ActionsService) RemoveEnabledRepoInOrg(ctx context.Context, owner strin // GetOrganizationRunner gets a specific self-hosted runner for an organization using its runner ID. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#get-a-self-hosted-runner-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-organization func (s *ActionsService) GetOrganizationRunner(ctx context.Context, owner string, runnerID int64) (*Runner, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners/%v", owner, runnerID) req, err := s.client.NewRequest("GET", u, nil) @@ -344,7 +344,7 @@ func (s *ActionsService) GetOrganizationRunner(ctx context.Context, owner string // CreateOrganizationRemoveToken creates a token that can be used to remove a self-hosted runner from an organization. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#create-a-remove-token-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-remove-token-for-an-organization func (s *ActionsService) CreateOrganizationRemoveToken(ctx context.Context, owner string) (*RemoveToken, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners/remove-token", owner) @@ -364,7 +364,7 @@ func (s *ActionsService) CreateOrganizationRemoveToken(ctx context.Context, owne // RemoveOrganizationRunner forces the removal of a self-hosted runner from an organization using the runner id. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#delete-a-self-hosted-runner-from-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-organization func (s *ActionsService) RemoveOrganizationRunner(ctx context.Context, owner string, runnerID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners/%v", owner, runnerID) diff --git a/github/actions_secrets.go b/github/actions_secrets.go index 29f70a1a166..dc057edba21 100644 --- a/github/actions_secrets.go +++ b/github/actions_secrets.go @@ -64,7 +64,7 @@ func (s *ActionsService) getPublicKey(ctx context.Context, url string) (*PublicK // GetRepoPublicKey gets a public key that should be used for secret encryption. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#get-a-repository-public-key +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#get-a-repository-public-key func (s *ActionsService) GetRepoPublicKey(ctx context.Context, owner, repo string) (*PublicKey, *Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/secrets/public-key", owner, repo) return s.getPublicKey(ctx, url) @@ -72,7 +72,7 @@ func (s *ActionsService) GetRepoPublicKey(ctx context.Context, owner, repo strin // GetOrgPublicKey gets a public key that should be used for secret encryption. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#get-an-organization-public-key +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#get-an-organization-public-key func (s *ActionsService) GetOrgPublicKey(ctx context.Context, org string) (*PublicKey, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/public-key", org) return s.getPublicKey(ctx, url) @@ -80,7 +80,7 @@ func (s *ActionsService) GetOrgPublicKey(ctx context.Context, org string) (*Publ // GetEnvPublicKey gets a public key that should be used for secret encryption. // -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#get-an-environment-public-key +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#get-an-environment-public-key func (s *ActionsService) GetEnvPublicKey(ctx context.Context, repoID int, env string) (*PublicKey, *Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/secrets/public-key", repoID, env) return s.getPublicKey(ctx, url) @@ -124,7 +124,7 @@ func (s *ActionsService) listSecrets(ctx context.Context, url string, opts *List // ListRepoSecrets lists all secrets available in a repository // without revealing their encrypted values. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#list-repository-secrets +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#list-repository-secrets func (s *ActionsService) ListRepoSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/secrets", owner, repo) return s.listSecrets(ctx, url, opts) @@ -133,7 +133,7 @@ func (s *ActionsService) ListRepoSecrets(ctx context.Context, owner, repo string // ListOrgSecrets lists all secrets available in an organization // without revealing their encrypted values. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#list-organization-secrets +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#list-organization-secrets func (s *ActionsService) ListOrgSecrets(ctx context.Context, org string, opts *ListOptions) (*Secrets, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets", org) return s.listSecrets(ctx, url, opts) @@ -141,7 +141,7 @@ func (s *ActionsService) ListOrgSecrets(ctx context.Context, org string, opts *L // ListEnvSecrets lists all secrets available in an environment. // -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#list-environment-secrets +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#list-environment-secrets func (s *ActionsService) ListEnvSecrets(ctx context.Context, repoID int, env string, opts *ListOptions) (*Secrets, *Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/secrets", repoID, env) return s.listSecrets(ctx, url, opts) @@ -164,7 +164,7 @@ func (s *ActionsService) getSecret(ctx context.Context, url string) (*Secret, *R // GetRepoSecret gets a single repository secret without revealing its encrypted value. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#get-a-repository-secret +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#get-a-repository-secret func (s *ActionsService) GetRepoSecret(ctx context.Context, owner, repo, name string) (*Secret, *Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/secrets/%v", owner, repo, name) return s.getSecret(ctx, url) @@ -172,7 +172,7 @@ func (s *ActionsService) GetRepoSecret(ctx context.Context, owner, repo, name st // GetOrgSecret gets a single organization secret without revealing its encrypted value. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#get-an-organization-secret +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#get-an-organization-secret func (s *ActionsService) GetOrgSecret(ctx context.Context, org, name string) (*Secret, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/%v", org, name) return s.getSecret(ctx, url) @@ -180,7 +180,7 @@ func (s *ActionsService) GetOrgSecret(ctx context.Context, org, name string) (*S // GetEnvSecret gets a single environment secret without revealing its encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#list-environment-secrets +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#get-an-environment-secret func (s *ActionsService) GetEnvSecret(ctx context.Context, repoID int, env, secretName string) (*Secret, *Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/secrets/%v", repoID, env, secretName) return s.getSecret(ctx, url) @@ -213,7 +213,7 @@ func (s *ActionsService) putSecret(ctx context.Context, url string, eSecret *Enc // CreateOrUpdateRepoSecret creates or updates a repository secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#create-or-update-a-repository-secret +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#create-or-update-a-repository-secret func (s *ActionsService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *EncryptedSecret) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/secrets/%v", owner, repo, eSecret.Name) return s.putSecret(ctx, url, eSecret) @@ -221,7 +221,7 @@ func (s *ActionsService) CreateOrUpdateRepoSecret(ctx context.Context, owner, re // CreateOrUpdateOrgSecret creates or updates an organization secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#create-or-update-an-organization-secret +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#create-or-update-an-organization-secret func (s *ActionsService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *EncryptedSecret) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/%v", org, eSecret.Name) return s.putSecret(ctx, url, eSecret) @@ -229,7 +229,7 @@ func (s *ActionsService) CreateOrUpdateOrgSecret(ctx context.Context, org string // CreateOrUpdateEnvSecret creates or updates a single environment secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#create-or-update-an-environment-secret +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#create-or-update-an-environment-secret func (s *ActionsService) CreateOrUpdateEnvSecret(ctx context.Context, repoID int, env string, eSecret *EncryptedSecret) (*Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/secrets/%v", repoID, env, eSecret.Name) return s.putSecret(ctx, url, eSecret) @@ -246,7 +246,7 @@ func (s *ActionsService) deleteSecret(ctx context.Context, url string) (*Respons // DeleteRepoSecret deletes a secret in a repository using the secret name. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#delete-a-repository-secret +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#delete-a-repository-secret func (s *ActionsService) DeleteRepoSecret(ctx context.Context, owner, repo, name string) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/secrets/%v", owner, repo, name) return s.deleteSecret(ctx, url) @@ -254,7 +254,7 @@ func (s *ActionsService) DeleteRepoSecret(ctx context.Context, owner, repo, name // DeleteOrgSecret deletes a secret in an organization using the secret name. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#delete-an-organization-secret +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#delete-an-organization-secret func (s *ActionsService) DeleteOrgSecret(ctx context.Context, org, name string) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/%v", org, name) return s.deleteSecret(ctx, url) @@ -262,7 +262,7 @@ func (s *ActionsService) DeleteOrgSecret(ctx context.Context, org, name string) // DeleteEnvSecret deletes a secret in an environment using the secret name. // -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#delete-an-environment-secret +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#delete-an-environment-secret func (s *ActionsService) DeleteEnvSecret(ctx context.Context, repoID int, env, secretName string) (*Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/secrets/%v", repoID, env, secretName) return s.deleteSecret(ctx, url) @@ -296,7 +296,7 @@ func (s *ActionsService) listSelectedReposForSecret(ctx context.Context, url str // ListSelectedReposForOrgSecret lists all repositories that have access to a secret. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#list-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#list-selected-repositories-for-an-organization-secret func (s *ActionsService) ListSelectedReposForOrgSecret(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/%v/repositories", org, name) return s.listSelectedReposForSecret(ctx, url, opts) @@ -317,7 +317,7 @@ func (s *ActionsService) setSelectedReposForSecret(ctx context.Context, url stri // SetSelectedReposForOrgSecret sets the repositories that have access to a secret. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#set-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#set-selected-repositories-for-an-organization-secret func (s *ActionsService) SetSelectedReposForOrgSecret(ctx context.Context, org, name string, ids SelectedRepoIDs) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/%v/repositories", org, name) return s.setSelectedReposForSecret(ctx, url, ids) @@ -334,7 +334,7 @@ func (s *ActionsService) addSelectedRepoToSecret(ctx context.Context, url string // AddSelectedRepoToOrgSecret adds a repository to an organization secret. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#add-selected-repository-to-an-organization-secret +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#add-selected-repository-to-an-organization-secret func (s *ActionsService) AddSelectedRepoToOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/%v/repositories/%v", org, name, *repo.ID) return s.addSelectedRepoToSecret(ctx, url) @@ -351,7 +351,7 @@ func (s *ActionsService) removeSelectedRepoFromSecret(ctx context.Context, url s // RemoveSelectedRepoFromOrgSecret removes a repository from an organization secret. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#remove-selected-repository-from-an-organization-secret +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#remove-selected-repository-from-an-organization-secret func (s *ActionsService) RemoveSelectedRepoFromOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/%v/repositories/%v", org, name, *repo.ID) return s.removeSelectedRepoFromSecret(ctx, url) diff --git a/github/actions_workflow_jobs.go b/github/actions_workflow_jobs.go index ad0e7b6e2a5..2867e82af07 100644 --- a/github/actions_workflow_jobs.go +++ b/github/actions_workflow_jobs.go @@ -66,7 +66,7 @@ type ListWorkflowJobsOptions struct { // ListWorkflowJobs lists all jobs for a workflow run. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#list-jobs-for-a-workflow-run +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run func (s *ActionsService) ListWorkflowJobs(ctx context.Context, owner, repo string, runID int64, opts *ListWorkflowJobsOptions) (*Jobs, *Response, error) { u := fmt.Sprintf("repos/%s/%s/actions/runs/%v/jobs", owner, repo, runID) u, err := addOptions(u, opts) @@ -90,7 +90,7 @@ func (s *ActionsService) ListWorkflowJobs(ctx context.Context, owner, repo strin // GetWorkflowJobByID gets a specific job in a workflow run by ID. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#get-a-job-for-a-workflow-run +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-jobs#get-a-job-for-a-workflow-run func (s *ActionsService) GetWorkflowJobByID(ctx context.Context, owner, repo string, jobID int64) (*WorkflowJob, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/jobs/%v", owner, repo, jobID) @@ -110,7 +110,7 @@ func (s *ActionsService) GetWorkflowJobByID(ctx context.Context, owner, repo str // GetWorkflowJobLogs gets a redirect URL to download a plain text file of logs for a workflow job. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#download-job-logs-for-a-workflow-run +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-jobs#download-job-logs-for-a-workflow-run func (s *ActionsService) GetWorkflowJobLogs(ctx context.Context, owner, repo string, jobID int64, followRedirects bool) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/jobs/%v/logs", owner, repo, jobID) diff --git a/github/actions_workflow_runs.go b/github/actions_workflow_runs.go index 470f0f073b3..de1e6c277ac 100644 --- a/github/actions_workflow_runs.go +++ b/github/actions_workflow_runs.go @@ -115,7 +115,7 @@ func (s *ActionsService) listWorkflowRuns(ctx context.Context, endpoint string, // ListWorkflowRunsByID lists all workflow runs by workflow ID. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#list-workflow-runs +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#list-workflow-runs func (s *ActionsService) ListWorkflowRunsByID(ctx context.Context, owner, repo string, workflowID int64, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) { u := fmt.Sprintf("repos/%s/%s/actions/workflows/%v/runs", owner, repo, workflowID) return s.listWorkflowRuns(ctx, u, opts) @@ -123,7 +123,7 @@ func (s *ActionsService) ListWorkflowRunsByID(ctx context.Context, owner, repo s // ListWorkflowRunsByFileName lists all workflow runs by workflow file name. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#list-workflow-runs +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#list-workflow-runs func (s *ActionsService) ListWorkflowRunsByFileName(ctx context.Context, owner, repo, workflowFileName string, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) { u := fmt.Sprintf("repos/%s/%s/actions/workflows/%v/runs", owner, repo, workflowFileName) return s.listWorkflowRuns(ctx, u, opts) @@ -131,7 +131,7 @@ func (s *ActionsService) ListWorkflowRunsByFileName(ctx context.Context, owner, // ListRepositoryWorkflowRuns lists all workflow runs for a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#list-workflow-runs-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#list-workflow-runs-for-a-repository func (s *ActionsService) ListRepositoryWorkflowRuns(ctx context.Context, owner, repo string, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) { u := fmt.Sprintf("repos/%s/%s/actions/runs", owner, repo) u, err := addOptions(u, opts) @@ -155,7 +155,7 @@ func (s *ActionsService) ListRepositoryWorkflowRuns(ctx context.Context, owner, // GetWorkflowRunByID gets a specific workflow run by ID. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#get-a-workflow-run +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#get-a-workflow-run func (s *ActionsService) GetWorkflowRunByID(ctx context.Context, owner, repo string, runID int64) (*WorkflowRun, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v", owner, repo, runID) @@ -175,7 +175,7 @@ func (s *ActionsService) GetWorkflowRunByID(ctx context.Context, owner, repo str // GetWorkflowRunAttempt gets a specific workflow run attempt. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#get-a-workflow-run-attempt +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#get-a-workflow-run-attempt func (s *ActionsService) GetWorkflowRunAttempt(ctx context.Context, owner, repo string, runID int64, attemptNumber int, opts *WorkflowRunAttemptOptions) (*WorkflowRun, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/attempts/%v", owner, repo, runID, attemptNumber) u, err := addOptions(u, opts) @@ -199,7 +199,7 @@ func (s *ActionsService) GetWorkflowRunAttempt(ctx context.Context, owner, repo // RerunWorkflowByID re-runs a workflow by ID. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#re-run-a-workflow +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#re-run-a-workflow func (s *ActionsService) RerunWorkflowByID(ctx context.Context, owner, repo string, runID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/rerun", owner, repo, runID) @@ -213,7 +213,7 @@ func (s *ActionsService) RerunWorkflowByID(ctx context.Context, owner, repo stri // RerunFailedJobsByID re-runs all of the failed jobs and their dependent jobs in a workflow run by ID. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/actions/workflow-runs#re-run-failed-jobs-from-a-workflow-run +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#re-run-failed-jobs-from-a-workflow-run func (s *ActionsService) RerunFailedJobsByID(ctx context.Context, owner, repo string, runID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/rerun-failed-jobs", owner, repo, runID) @@ -227,7 +227,7 @@ func (s *ActionsService) RerunFailedJobsByID(ctx context.Context, owner, repo st // RerunJobByID re-runs a job and its dependent jobs in a workflow run by ID. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run func (s *ActionsService) RerunJobByID(ctx context.Context, owner, repo string, jobID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/jobs/%v/rerun", owner, repo, jobID) @@ -241,7 +241,7 @@ func (s *ActionsService) RerunJobByID(ctx context.Context, owner, repo string, j // CancelWorkflowRunByID cancels a workflow run by ID. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#cancel-a-workflow-run +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#cancel-a-workflow-run func (s *ActionsService) CancelWorkflowRunByID(ctx context.Context, owner, repo string, runID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/cancel", owner, repo, runID) @@ -255,7 +255,7 @@ func (s *ActionsService) CancelWorkflowRunByID(ctx context.Context, owner, repo // GetWorkflowRunLogs gets a redirect URL to download a plain text file of logs for a workflow run. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#download-workflow-run-logs +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#download-workflow-run-logs func (s *ActionsService) GetWorkflowRunLogs(ctx context.Context, owner, repo string, runID int64, followRedirects bool) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/logs", owner, repo, runID) @@ -275,7 +275,7 @@ func (s *ActionsService) GetWorkflowRunLogs(ctx context.Context, owner, repo str // DeleteWorkflowRun deletes a workflow run by ID. // -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#delete-a-workflow-run +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#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) @@ -289,7 +289,7 @@ func (s *ActionsService) DeleteWorkflowRun(ctx context.Context, owner, repo stri // 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 +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#delete-workflow-run-logs func (s *ActionsService) DeleteWorkflowRunLogs(ctx context.Context, owner, repo string, runID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/logs", owner, repo, runID) @@ -303,7 +303,7 @@ func (s *ActionsService) DeleteWorkflowRunLogs(ctx context.Context, owner, repo // GetWorkflowRunUsageByID gets a specific workflow usage run by run ID in the unit of billable milliseconds. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#get-workflow-run-usage +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#get-workflow-run-usage func (s *ActionsService) GetWorkflowRunUsageByID(ctx context.Context, owner, repo string, runID int64) (*WorkflowRunUsage, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/timing", owner, repo, runID) diff --git a/github/actions_workflows.go b/github/actions_workflows.go index e0568462e87..9973a5d3f35 100644 --- a/github/actions_workflows.go +++ b/github/actions_workflows.go @@ -61,7 +61,7 @@ type CreateWorkflowDispatchEventRequest struct { // ListWorkflows lists all workflows in a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#list-repository-workflows +// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#list-repository-workflows func (s *ActionsService) ListWorkflows(ctx context.Context, owner, repo string, opts *ListOptions) (*Workflows, *Response, error) { u := fmt.Sprintf("repos/%s/%s/actions/workflows", owner, repo) u, err := addOptions(u, opts) @@ -85,7 +85,7 @@ func (s *ActionsService) ListWorkflows(ctx context.Context, owner, repo string, // GetWorkflowByID gets a specific workflow by ID. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#get-a-workflow +// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#get-a-workflow func (s *ActionsService) GetWorkflowByID(ctx context.Context, owner, repo string, workflowID int64) (*Workflow, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v", owner, repo, workflowID) @@ -94,7 +94,7 @@ func (s *ActionsService) GetWorkflowByID(ctx context.Context, owner, repo string // GetWorkflowByFileName gets a specific workflow by file name. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#get-a-workflow +// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#get-a-workflow func (s *ActionsService) GetWorkflowByFileName(ctx context.Context, owner, repo, workflowFileName string) (*Workflow, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v", owner, repo, workflowFileName) @@ -118,7 +118,7 @@ func (s *ActionsService) getWorkflow(ctx context.Context, url string) (*Workflow // GetWorkflowUsageByID gets a specific workflow usage by ID in the unit of billable milliseconds. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#get-workflow-usage +// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#get-workflow-usage func (s *ActionsService) GetWorkflowUsageByID(ctx context.Context, owner, repo string, workflowID int64) (*WorkflowUsage, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/timing", owner, repo, workflowID) @@ -127,7 +127,7 @@ func (s *ActionsService) GetWorkflowUsageByID(ctx context.Context, owner, repo s // GetWorkflowUsageByFileName gets a specific workflow usage by file name in the unit of billable milliseconds. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#get-workflow-usage +// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#get-workflow-usage func (s *ActionsService) GetWorkflowUsageByFileName(ctx context.Context, owner, repo, workflowFileName string) (*WorkflowUsage, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/timing", owner, repo, workflowFileName) @@ -151,7 +151,7 @@ func (s *ActionsService) getWorkflowUsage(ctx context.Context, url string) (*Wor // CreateWorkflowDispatchEventByID manually triggers a GitHub Actions workflow run. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#create-a-workflow-dispatch-event +// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#create-a-workflow-dispatch-event func (s *ActionsService) CreateWorkflowDispatchEventByID(ctx context.Context, owner, repo string, workflowID int64, event CreateWorkflowDispatchEventRequest) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/dispatches", owner, repo, workflowID) @@ -160,7 +160,7 @@ func (s *ActionsService) CreateWorkflowDispatchEventByID(ctx context.Context, ow // CreateWorkflowDispatchEventByFileName manually triggers a GitHub Actions workflow run. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#create-a-workflow-dispatch-event +// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#create-a-workflow-dispatch-event func (s *ActionsService) CreateWorkflowDispatchEventByFileName(ctx context.Context, owner, repo, workflowFileName string, event CreateWorkflowDispatchEventRequest) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/dispatches", owner, repo, workflowFileName) @@ -178,7 +178,7 @@ func (s *ActionsService) createWorkflowDispatchEvent(ctx context.Context, url st // EnableWorkflowByID enables a workflow and sets the state of the workflow to "active". // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#enable-a-workflow +// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#enable-a-workflow func (s *ActionsService) EnableWorkflowByID(ctx context.Context, owner, repo string, workflowID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/enable", owner, repo, workflowID) return s.doNewPutRequest(ctx, u) @@ -186,7 +186,7 @@ func (s *ActionsService) EnableWorkflowByID(ctx context.Context, owner, repo str // EnableWorkflowByFileName enables a workflow and sets the state of the workflow to "active". // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#enable-a-workflow +// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#enable-a-workflow func (s *ActionsService) EnableWorkflowByFileName(ctx context.Context, owner, repo, workflowFileName string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/enable", owner, repo, workflowFileName) return s.doNewPutRequest(ctx, u) @@ -194,7 +194,7 @@ func (s *ActionsService) EnableWorkflowByFileName(ctx context.Context, owner, re // DisableWorkflowByID disables a workflow and sets the state of the workflow to "disabled_manually". // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#disable-a-workflow +// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#disable-a-workflow func (s *ActionsService) DisableWorkflowByID(ctx context.Context, owner, repo string, workflowID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/disable", owner, repo, workflowID) return s.doNewPutRequest(ctx, u) @@ -202,7 +202,7 @@ func (s *ActionsService) DisableWorkflowByID(ctx context.Context, owner, repo st // DisableWorkflowByFileName disables a workflow and sets the state of the workflow to "disabled_manually". // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#disable-a-workflow +// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#disable-a-workflow func (s *ActionsService) DisableWorkflowByFileName(ctx context.Context, owner, repo, workflowFileName string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/disable", owner, repo, workflowFileName) return s.doNewPutRequest(ctx, u) diff --git a/github/activity.go b/github/activity.go index e683afb99b9..f99ecfcdffa 100644 --- a/github/activity.go +++ b/github/activity.go @@ -10,7 +10,7 @@ import "context" // ActivityService handles communication with the activity related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/ +// GitHub API docs: https://docs.github.com/en/rest/activity/ type ActivityService service // FeedLink represents a link to a related resource. diff --git a/github/activity_events.go b/github/activity_events.go index 19dc15cfe64..d6f0f043b08 100644 --- a/github/activity_events.go +++ b/github/activity_events.go @@ -12,7 +12,7 @@ import ( // ListEvents drinks from the firehose of all public events across GitHub. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/#list-public-events +// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-public-events func (s *ActivityService) ListEvents(ctx context.Context, opts *ListOptions) ([]*Event, *Response, error) { u, err := addOptions("events", opts) if err != nil { @@ -35,7 +35,7 @@ func (s *ActivityService) ListEvents(ctx context.Context, opts *ListOptions) ([] // ListRepositoryEvents lists events for a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/#list-repository-events +// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-repository-events func (s *ActivityService) ListRepositoryEvents(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Event, *Response, error) { u := fmt.Sprintf("repos/%v/%v/events", owner, repo) u, err := addOptions(u, opts) @@ -59,7 +59,7 @@ func (s *ActivityService) ListRepositoryEvents(ctx context.Context, owner, repo // ListIssueEventsForRepository lists issue events for a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#list-issue-events-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/issues/events#list-issue-events-for-a-repository func (s *ActivityService) ListIssueEventsForRepository(ctx context.Context, owner, repo string, opts *ListOptions) ([]*IssueEvent, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/events", owner, repo) u, err := addOptions(u, opts) @@ -83,7 +83,7 @@ func (s *ActivityService) ListIssueEventsForRepository(ctx context.Context, owne // ListEventsForRepoNetwork lists public events for a network of repositories. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/#list-public-events-for-a-network-of-repositories +// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-public-events-for-a-network-of-repositories func (s *ActivityService) ListEventsForRepoNetwork(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Event, *Response, error) { u := fmt.Sprintf("networks/%v/%v/events", owner, repo) u, err := addOptions(u, opts) @@ -107,7 +107,7 @@ func (s *ActivityService) ListEventsForRepoNetwork(ctx context.Context, owner, r // ListEventsForOrganization lists public events for an organization. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/#list-public-organization-events +// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-public-organization-events func (s *ActivityService) ListEventsForOrganization(ctx context.Context, org string, opts *ListOptions) ([]*Event, *Response, error) { u := fmt.Sprintf("orgs/%v/events", org) u, err := addOptions(u, opts) @@ -132,8 +132,8 @@ func (s *ActivityService) ListEventsForOrganization(ctx context.Context, org str // ListEventsPerformedByUser lists the events performed by a user. If publicOnly is // true, only public events will be returned. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/#list-events-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/#list-public-events-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-events-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-public-events-for-a-user func (s *ActivityService) ListEventsPerformedByUser(ctx context.Context, user string, publicOnly bool, opts *ListOptions) ([]*Event, *Response, error) { var u string if publicOnly { @@ -163,8 +163,8 @@ func (s *ActivityService) ListEventsPerformedByUser(ctx context.Context, user st // ListEventsReceivedByUser lists the events received by a user. If publicOnly is // true, only public events will be returned. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/#list-events-received-by-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/#list-public-events-received-by-a-user +// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-events-received-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-public-events-received-by-a-user func (s *ActivityService) ListEventsReceivedByUser(ctx context.Context, user string, publicOnly bool, opts *ListOptions) ([]*Event, *Response, error) { var u string if publicOnly { @@ -194,7 +194,7 @@ func (s *ActivityService) ListEventsReceivedByUser(ctx context.Context, user str // ListUserEventsForOrganization provides the user’s organization dashboard. You // must be authenticated as the user to view this. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/#list-organization-events-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-organization-events-for-the-authenticated-user func (s *ActivityService) ListUserEventsForOrganization(ctx context.Context, org, user string, opts *ListOptions) ([]*Event, *Response, error) { u := fmt.Sprintf("users/%v/events/orgs/%v", user, org) u, err := addOptions(u, opts) diff --git a/github/activity_notifications.go b/github/activity_notifications.go index 009cc5e32a8..38a3184536a 100644 --- a/github/activity_notifications.go +++ b/github/activity_notifications.go @@ -19,7 +19,7 @@ type Notification struct { // Reason identifies the event that triggered the notification. // - // GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity#notification-reasons + // GitHub API docs: https://docs.github.com/en/rest/activity#notification-reasons Reason *string `json:"reason,omitempty"` Unread *bool `json:"unread,omitempty"` @@ -49,7 +49,7 @@ type NotificationListOptions struct { // ListNotifications lists all notifications for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/#list-notifications-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#list-notifications-for-the-authenticated-user func (s *ActivityService) ListNotifications(ctx context.Context, opts *NotificationListOptions) ([]*Notification, *Response, error) { u := "notifications" u, err := addOptions(u, opts) @@ -74,7 +74,7 @@ func (s *ActivityService) ListNotifications(ctx context.Context, opts *Notificat // ListRepositoryNotifications lists all notifications in a given repository // for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/#list-repository-notifications-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user func (s *ActivityService) ListRepositoryNotifications(ctx context.Context, owner, repo string, opts *NotificationListOptions) ([]*Notification, *Response, error) { u := fmt.Sprintf("repos/%v/%v/notifications", owner, repo) u, err := addOptions(u, opts) @@ -102,7 +102,7 @@ type markReadOptions struct { // MarkNotificationsRead marks all notifications up to lastRead as read. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity#mark-as-read +// GitHub API docs: https://docs.github.com/en/rest/activity#mark-as-read func (s *ActivityService) MarkNotificationsRead(ctx context.Context, lastRead time.Time) (*Response, error) { opts := &markReadOptions{ LastReadAt: lastRead, @@ -118,7 +118,7 @@ func (s *ActivityService) MarkNotificationsRead(ctx context.Context, lastRead ti // MarkRepositoryNotificationsRead marks all notifications up to lastRead in // the specified repository as read. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/#mark-repository-notifications-as-read +// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#mark-repository-notifications-as-read func (s *ActivityService) MarkRepositoryNotificationsRead(ctx context.Context, owner, repo string, lastRead time.Time) (*Response, error) { opts := &markReadOptions{ LastReadAt: lastRead, @@ -134,7 +134,7 @@ func (s *ActivityService) MarkRepositoryNotificationsRead(ctx context.Context, o // GetThread gets the specified notification thread. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/#get-a-thread +// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#get-a-thread func (s *ActivityService) GetThread(ctx context.Context, id string) (*Notification, *Response, error) { u := fmt.Sprintf("notifications/threads/%v", id) @@ -154,7 +154,7 @@ func (s *ActivityService) GetThread(ctx context.Context, id string) (*Notificati // MarkThreadRead marks the specified thread as read. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/#mark-a-thread-as-read +// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#mark-a-thread-as-read func (s *ActivityService) MarkThreadRead(ctx context.Context, id string) (*Response, error) { u := fmt.Sprintf("notifications/threads/%v", id) @@ -169,7 +169,7 @@ func (s *ActivityService) MarkThreadRead(ctx context.Context, id string) (*Respo // GetThreadSubscription checks to see if the authenticated user is subscribed // to a thread. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/#get-a-thread-subscription-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#get-a-thread-subscription-for-the-authenticated-user func (s *ActivityService) GetThreadSubscription(ctx context.Context, id string) (*Subscription, *Response, error) { u := fmt.Sprintf("notifications/threads/%v/subscription", id) @@ -190,7 +190,7 @@ func (s *ActivityService) GetThreadSubscription(ctx context.Context, id string) // SetThreadSubscription sets the subscription for the specified thread for the // authenticated user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/#set-a-thread-subscription +// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#set-a-thread-subscription func (s *ActivityService) SetThreadSubscription(ctx context.Context, id string, subscription *Subscription) (*Subscription, *Response, error) { u := fmt.Sprintf("notifications/threads/%v/subscription", id) @@ -211,7 +211,7 @@ func (s *ActivityService) SetThreadSubscription(ctx context.Context, id string, // DeleteThreadSubscription deletes the subscription for the specified thread // for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/#delete-a-thread-subscription +// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#delete-a-thread-subscription func (s *ActivityService) DeleteThreadSubscription(ctx context.Context, id string) (*Response, error) { u := fmt.Sprintf("notifications/threads/%v/subscription", id) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/activity_star.go b/github/activity_star.go index d17ea9c3f23..65a316f5325 100644 --- a/github/activity_star.go +++ b/github/activity_star.go @@ -25,7 +25,7 @@ type Stargazer struct { // ListStargazers lists people who have starred the specified repo. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/#list-stargazers +// GitHub API docs: https://docs.github.com/en/rest/activity/starring#list-stargazers func (s *ActivityService) ListStargazers(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Stargazer, *Response, error) { u := fmt.Sprintf("repos/%s/%s/stargazers", owner, repo) u, err := addOptions(u, opts) @@ -67,8 +67,8 @@ type ActivityListStarredOptions struct { // ListStarred lists all the repos starred by a user. Passing the empty string // will list the starred repositories for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/#list-repositories-starred-by-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/#list-repositories-starred-by-a-user +// GitHub API docs: https://docs.github.com/en/rest/activity/starring#list-repositories-starred-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/activity/starring#list-repositories-starred-by-a-user func (s *ActivityService) ListStarred(ctx context.Context, user string, opts *ActivityListStarredOptions) ([]*StarredRepository, *Response, error) { var u string if user != "" { @@ -101,7 +101,7 @@ func (s *ActivityService) ListStarred(ctx context.Context, user string, opts *Ac // IsStarred checks if a repository is starred by authenticated user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/#check-if-a-repository-is-starred-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/activity/starring#check-if-a-repository-is-starred-by-the-authenticated-user func (s *ActivityService) IsStarred(ctx context.Context, owner, repo string) (bool, *Response, error) { u := fmt.Sprintf("user/starred/%v/%v", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -116,7 +116,7 @@ func (s *ActivityService) IsStarred(ctx context.Context, owner, repo string) (bo // Star a repository as the authenticated user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/#star-a-repository-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/activity/starring#star-a-repository-for-the-authenticated-user func (s *ActivityService) Star(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("user/starred/%v/%v", owner, repo) req, err := s.client.NewRequest("PUT", u, nil) @@ -129,7 +129,7 @@ func (s *ActivityService) Star(ctx context.Context, owner, repo string) (*Respon // Unstar a repository as the authenticated user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/#unstar-a-repository-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/activity/starring#unstar-a-repository-for-the-authenticated-user func (s *ActivityService) Unstar(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("user/starred/%v/%v", owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/activity_watching.go b/github/activity_watching.go index 16cceb53e5a..2d6fafcc793 100644 --- a/github/activity_watching.go +++ b/github/activity_watching.go @@ -27,7 +27,7 @@ type Subscription struct { // ListWatchers lists watchers of a particular repo. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/#list-watchers +// GitHub API docs: https://docs.github.com/en/rest/activity/watching#list-watchers func (s *ActivityService) ListWatchers(ctx context.Context, owner, repo string, opts *ListOptions) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%s/%s/subscribers", owner, repo) u, err := addOptions(u, opts) @@ -52,8 +52,8 @@ func (s *ActivityService) ListWatchers(ctx context.Context, owner, repo string, // ListWatched lists the repositories the specified user is watching. Passing // the empty string will fetch watched repos for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/#list-repositories-watched-by-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/#list-repositories-watched-by-a-user +// GitHub API docs: https://docs.github.com/en/rest/activity/watching#list-repositories-watched-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/activity/watching#list-repositories-watched-by-a-user func (s *ActivityService) ListWatched(ctx context.Context, user string, opts *ListOptions) ([]*Repository, *Response, error) { var u string if user != "" { @@ -84,7 +84,7 @@ func (s *ActivityService) ListWatched(ctx context.Context, user string, opts *Li // repository for the authenticated user. If the authenticated user is not // watching the repository, a nil Subscription is returned. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/#get-a-repository-subscription +// GitHub API docs: https://docs.github.com/en/rest/activity/watching#get-a-repository-subscription func (s *ActivityService) GetRepositorySubscription(ctx context.Context, owner, repo string) (*Subscription, *Response, error) { u := fmt.Sprintf("repos/%s/%s/subscription", owner, repo) @@ -111,7 +111,7 @@ func (s *ActivityService) GetRepositorySubscription(ctx context.Context, owner, // To ignore notifications made within a repository, set subscription.Ignored to true. // To stop watching a repository, use DeleteRepositorySubscription. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/#set-a-repository-subscription +// GitHub API docs: https://docs.github.com/en/rest/activity/watching#set-a-repository-subscription func (s *ActivityService) SetRepositorySubscription(ctx context.Context, owner, repo string, subscription *Subscription) (*Subscription, *Response, error) { u := fmt.Sprintf("repos/%s/%s/subscription", owner, repo) @@ -135,7 +135,7 @@ func (s *ActivityService) SetRepositorySubscription(ctx context.Context, owner, // This is used to stop watching a repository. To control whether or not to // receive notifications from a repository, use SetRepositorySubscription. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/#delete-a-repository-subscription +// GitHub API docs: https://docs.github.com/en/rest/activity/watching#delete-a-repository-subscription func (s *ActivityService) DeleteRepositorySubscription(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%s/%s/subscription", owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/admin.go b/github/admin.go index 7bf0f22b134..1b28ef64c7d 100644 --- a/github/admin.go +++ b/github/admin.go @@ -14,7 +14,7 @@ import ( // GitHub API. These API routes are normally only accessible for GitHub // Enterprise installations. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/enterprise/ +// GitHub API docs: https://docs.github.com/en/rest/enterprise-admin type AdminService service // TeamLDAPMapping represents the mapping between a GitHub team and an LDAP group. @@ -82,7 +82,7 @@ func (m Enterprise) String() string { // UpdateUserLDAPMapping updates the mapping between a GitHub user and an LDAP user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/enterprise/ldap/#update-ldap-mapping-for-a-user +// GitHub API docs: https://docs.github.com/en/enterprise-server/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user func (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, mapping *UserLDAPMapping) (*UserLDAPMapping, *Response, error) { u := fmt.Sprintf("admin/ldap/users/%v/mapping", user) req, err := s.client.NewRequest("PATCH", u, mapping) @@ -101,7 +101,7 @@ func (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, m // UpdateTeamLDAPMapping updates the mapping between a GitHub team and an LDAP group. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/enterprise/ldap/#update-ldap-mapping-for-a-team +// GitHub API docs: https://docs.github.com/en/rest/enterprise/ldap/#update-ldap-mapping-for-a-team func (s *AdminService) UpdateTeamLDAPMapping(ctx context.Context, team int64, mapping *TeamLDAPMapping) (*TeamLDAPMapping, *Response, error) { u := fmt.Sprintf("admin/ldap/teams/%v/mapping", team) req, err := s.client.NewRequest("PATCH", u, mapping) diff --git a/github/admin_stats.go b/github/admin_stats.go index 0744ffa4153..ef294f44791 100644 --- a/github/admin_stats.go +++ b/github/admin_stats.go @@ -153,7 +153,7 @@ func (s RepoStats) String() string { // Please note that this is only available to site administrators, // otherwise it will error with a 404 not found (instead of 401 or 403). // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/enterprise-admin/admin_stats/ +// GitHub API docs: https://docs.github.com/en/rest/enterprise-admin/admin_stats/ func (s *AdminService) GetAdminStats(ctx context.Context) (*AdminStats, *Response, error) { u := fmt.Sprintf("enterprise/stats/all") req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/admin_users_test.go b/github/admin_users_test.go index cd008c37532..354943d50a2 100644 --- a/github/admin_users_test.go +++ b/github/admin_users_test.go @@ -90,7 +90,7 @@ func TestUserImpersonation_Create(t *testing.T) { "url": "https://git.company.com/api/v3/authorizations/1234", "app": { "name": "GitHub Site Administrator", - "url": "https://docs.github.com/en/free-pro-team@latest/rest/reference/enterprise/users/", + "url": "https://docs.github.com/en/rest/enterprise/users/", "client_id": "1234" }, "token": "1234", @@ -119,7 +119,7 @@ func TestUserImpersonation_Create(t *testing.T) { URL: String("https://git.company.com/api/v3/authorizations/1234"), App: &OAuthAPP{ Name: String("GitHub Site Administrator"), - URL: String("https://docs.github.com/en/free-pro-team@latest/rest/reference/enterprise/users/"), + URL: String("https://docs.github.com/en/rest/enterprise/users/"), ClientID: String("1234"), }, Token: String("1234"), diff --git a/github/apps.go b/github/apps.go index 3823a121969..dff9b210f2c 100644 --- a/github/apps.go +++ b/github/apps.go @@ -14,7 +14,7 @@ import ( // AppsService provides access to the installation related functions // in the GitHub API. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/apps/ +// GitHub API docs: https://docs.github.com/en/rest/apps/ type AppsService service // App represents a GitHub App. @@ -59,8 +59,8 @@ type InstallationTokenOptions struct { // InstallationPermissions lists the repository and organization permissions for an installation. // // Permission names taken from: -// https://docs.github.com/en/enterprise-server@3.0/rest/reference/apps#create-an-installation-access-token-for-an-app -// https://docs.github.com/en/rest/reference/apps#create-an-installation-access-token-for-an-app +// https://docs.github.com/en/enterprise-server@3.0/rest/apps#create-an-installation-access-token-for-an-app +// https://docs.github.com/en/rest/apps#create-an-installation-access-token-for-an-app type InstallationPermissions struct { Actions *string `json:"actions,omitempty"` Administration *string `json:"administration,omitempty"` @@ -148,8 +148,8 @@ func (i Installation) String() string { // You can find this on the settings page for your GitHub App // (e.g., https://github.com/settings/apps/:app_slug). // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/apps/#get-the-authenticated-app -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/apps/#get-an-app +// GitHub API docs: https://docs.github.com/en/rest/apps/apps#get-the-authenticated-app +// GitHub API docs: https://docs.github.com/en/rest/apps/apps#get-an-app func (s *AppsService) Get(ctx context.Context, appSlug string) (*App, *Response, error) { var u string if appSlug != "" { @@ -174,7 +174,7 @@ func (s *AppsService) Get(ctx context.Context, appSlug string) (*App, *Response, // ListInstallations lists the installations that the current GitHub App has. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/apps/#list-installations-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/en/rest/apps/apps#list-installations-for-the-authenticated-app func (s *AppsService) ListInstallations(ctx context.Context, opts *ListOptions) ([]*Installation, *Response, error) { u, err := addOptions("app/installations", opts) if err != nil { @@ -197,14 +197,14 @@ func (s *AppsService) ListInstallations(ctx context.Context, opts *ListOptions) // GetInstallation returns the specified installation. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/apps/#get-an-installation-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/en/rest/apps/apps#get-an-installation-for-the-authenticated-app func (s *AppsService) GetInstallation(ctx context.Context, id int64) (*Installation, *Response, error) { return s.getInstallation(ctx, fmt.Sprintf("app/installations/%v", id)) } // ListUserInstallations lists installations that are accessible to the authenticated user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/apps/#list-app-installations-accessible-to-the-user-access-token +// GitHub API docs: https://docs.github.com/en/rest/apps/installations#list-app-installations-accessible-to-the-user-access-token func (s *AppsService) ListUserInstallations(ctx context.Context, opts *ListOptions) ([]*Installation, *Response, error) { u, err := addOptions("user/installations", opts) if err != nil { @@ -229,7 +229,7 @@ func (s *AppsService) ListUserInstallations(ctx context.Context, opts *ListOptio // SuspendInstallation suspends the specified installation. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/apps/#suspend-an-app-installation +// GitHub API docs: https://docs.github.com/en/rest/apps/apps#suspend-an-app-installation func (s *AppsService) SuspendInstallation(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("app/installations/%v/suspended", id) @@ -243,7 +243,7 @@ func (s *AppsService) SuspendInstallation(ctx context.Context, id int64) (*Respo // UnsuspendInstallation unsuspends the specified installation. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/apps/#unsuspend-an-app-installation +// GitHub API docs: https://docs.github.com/en/rest/apps/apps#unsuspend-an-app-installation func (s *AppsService) UnsuspendInstallation(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("app/installations/%v/suspended", id) @@ -257,7 +257,7 @@ func (s *AppsService) UnsuspendInstallation(ctx context.Context, id int64) (*Res // DeleteInstallation deletes the specified installation. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/apps/#delete-an-installation-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/en/rest/apps/apps#delete-an-installation-for-the-authenticated-app func (s *AppsService) DeleteInstallation(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("app/installations/%v", id) @@ -271,7 +271,7 @@ func (s *AppsService) DeleteInstallation(ctx context.Context, id int64) (*Respon // CreateInstallationToken creates a new installation token. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/apps/#create-an-installation-access-token-for-an-app +// GitHub API docs: https://docs.github.com/en/rest/apps/apps#create-an-installation-access-token-for-an-app func (s *AppsService) CreateInstallationToken(ctx context.Context, id int64, opts *InstallationTokenOptions) (*InstallationToken, *Response, error) { u := fmt.Sprintf("app/installations/%v/access_tokens", id) @@ -291,7 +291,7 @@ func (s *AppsService) CreateInstallationToken(ctx context.Context, id int64, opt // CreateAttachment creates a new attachment on user comment containing a url. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/apps/#create-a-content-attachment +// TODO: Find GitHub API docs. func (s *AppsService) CreateAttachment(ctx context.Context, contentReferenceID int64, title, body string) (*Attachment, *Response, error) { u := fmt.Sprintf("content_references/%v/attachments", contentReferenceID) payload := &Attachment{Title: String(title), Body: String(body)} @@ -314,14 +314,14 @@ func (s *AppsService) CreateAttachment(ctx context.Context, contentReferenceID i // FindOrganizationInstallation finds the organization's installation information. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/apps/#get-an-organization-installation-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/en/rest/apps/apps#get-an-organization-installation-for-the-authenticated-app func (s *AppsService) FindOrganizationInstallation(ctx context.Context, org string) (*Installation, *Response, error) { return s.getInstallation(ctx, fmt.Sprintf("orgs/%v/installation", org)) } // FindRepositoryInstallation finds the repository's installation information. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/apps/#get-a-repository-installation-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/en/rest/apps/apps#get-a-repository-installation-for-the-authenticated-app func (s *AppsService) FindRepositoryInstallation(ctx context.Context, owner, repo string) (*Installation, *Response, error) { return s.getInstallation(ctx, fmt.Sprintf("repos/%v/%v/installation", owner, repo)) } @@ -335,7 +335,7 @@ func (s *AppsService) FindRepositoryInstallationByID(ctx context.Context, id int // FindUserInstallation finds the user's installation information. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/apps/#get-a-user-installation-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/en/rest/apps/apps#get-a-user-installation-for-the-authenticated-app func (s *AppsService) FindUserInstallation(ctx context.Context, user string) (*Installation, *Response, error) { return s.getInstallation(ctx, fmt.Sprintf("users/%v/installation", user)) } diff --git a/github/apps_hooks.go b/github/apps_hooks.go index ed8396f4425..e3bd2afc032 100644 --- a/github/apps_hooks.go +++ b/github/apps_hooks.go @@ -12,7 +12,7 @@ import ( // GetHookConfig returns the webhook configuration for a GitHub App. // The underlying transport must be authenticated as an app. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/apps#get-a-webhook-configuration-for-an-app +// GitHub API docs: https://docs.github.com/en/rest/apps#get-a-webhook-configuration-for-an-app func (s *AppsService) GetHookConfig(ctx context.Context) (*HookConfig, *Response, error) { req, err := s.client.NewRequest("GET", "app/hook/config", nil) if err != nil { @@ -31,7 +31,7 @@ func (s *AppsService) GetHookConfig(ctx context.Context) (*HookConfig, *Response // UpdateHookConfig updates the webhook configuration for a GitHub App. // The underlying transport must be authenticated as an app. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/apps#update-a-webhook-configuration-for-an-app +// GitHub API docs: https://docs.github.com/en/rest/apps#update-a-webhook-configuration-for-an-app func (s *AppsService) UpdateHookConfig(ctx context.Context, config *HookConfig) (*HookConfig, *Response, error) { req, err := s.client.NewRequest("PATCH", "app/hook/config", config) if err != nil { diff --git a/github/apps_hooks_deliveries.go b/github/apps_hooks_deliveries.go index 0b631b80e8c..33102f36d2b 100644 --- a/github/apps_hooks_deliveries.go +++ b/github/apps_hooks_deliveries.go @@ -12,7 +12,7 @@ import ( // ListHookDeliveries lists deliveries of an App webhook. // -// GitHub API docs: https://docs.github.com/en/rest/reference/apps#list-deliveries-for-an-app-webhook +// GitHub API docs: https://docs.github.com/en/rest/apps/webhooks#list-deliveries-for-an-app-webhook func (s *AppsService) ListHookDeliveries(ctx context.Context, opts *ListCursorOptions) ([]*HookDelivery, *Response, error) { u, err := addOptions("app/hook/deliveries", opts) if err != nil { @@ -35,7 +35,7 @@ func (s *AppsService) ListHookDeliveries(ctx context.Context, opts *ListCursorOp // GetHookDelivery returns the App webhook delivery with the specified ID. // -// GitHub API docs: https://docs.github.com/en/rest/reference/apps#get-a-delivery-for-an-app-webhook +// GitHub API docs: https://docs.github.com/en/rest/apps/webhooks#get-a-delivery-for-an-app-webhook func (s *AppsService) GetHookDelivery(ctx context.Context, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("app/hook/deliveries/%v", deliveryID) req, err := s.client.NewRequest("GET", u, nil) @@ -54,7 +54,7 @@ func (s *AppsService) GetHookDelivery(ctx context.Context, deliveryID int64) (*H // RedeliverHookDelivery redelivers a delivery for an App webhook. // -// GitHub API docs: https://docs.github.com/en/rest/reference/apps#redeliver-a-delivery-for-an-app-webhook +// GitHub API docs: https://docs.github.com/en/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook func (s *AppsService) RedeliverHookDelivery(ctx context.Context, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("app/hook/deliveries/%v/attempts", deliveryID) req, err := s.client.NewRequest("POST", u, nil) diff --git a/github/apps_installation.go b/github/apps_installation.go index 521860d6ebd..b619080713f 100644 --- a/github/apps_installation.go +++ b/github/apps_installation.go @@ -19,7 +19,7 @@ type ListRepositories struct { // ListRepos lists the repositories that are accessible to the authenticated installation. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/apps/#list-repositories-accessible-to-the-app-installation +// GitHub API docs: https://docs.github.com/en/rest/apps/installations#list-repositories-accessible-to-the-app-installation func (s *AppsService) ListRepos(ctx context.Context, opts *ListOptions) (*ListRepositories, *Response, error) { u, err := addOptions("installation/repositories", opts) if err != nil { @@ -52,7 +52,7 @@ func (s *AppsService) ListRepos(ctx context.Context, opts *ListOptions) (*ListRe // ListUserRepos lists repositories that are accessible // to the authenticated user for an installation. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/apps/#list-repositories-accessible-to-the-user-access-token +// GitHub API docs: https://docs.github.com/en/rest/apps/installations#list-repositories-accessible-to-the-user-access-token func (s *AppsService) ListUserRepos(ctx context.Context, id int64, opts *ListOptions) (*ListRepositories, *Response, error) { u := fmt.Sprintf("user/installations/%v/repositories", id) u, err := addOptions(u, opts) @@ -84,7 +84,7 @@ func (s *AppsService) ListUserRepos(ctx context.Context, id int64, opts *ListOpt // AddRepository adds a single repository to an installation. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/apps/#add-a-repository-to-an-app-installation +// GitHub API docs: https://docs.github.com/en/rest/apps/installations#add-a-repository-to-an-app-installation func (s *AppsService) AddRepository(ctx context.Context, instID, repoID int64) (*Repository, *Response, error) { u := fmt.Sprintf("user/installations/%v/repositories/%v", instID, repoID) req, err := s.client.NewRequest("PUT", u, nil) @@ -103,7 +103,7 @@ func (s *AppsService) AddRepository(ctx context.Context, instID, repoID int64) ( // RemoveRepository removes a single repository from an installation. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/apps/#remove-a-repository-from-an-app-installation +// GitHub API docs: https://docs.github.com/en/rest/apps/installations#remove-a-repository-from-an-app-installation func (s *AppsService) RemoveRepository(ctx context.Context, instID, repoID int64) (*Response, error) { u := fmt.Sprintf("user/installations/%v/repositories/%v", instID, repoID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -116,7 +116,7 @@ func (s *AppsService) RemoveRepository(ctx context.Context, instID, repoID int64 // RevokeInstallationToken revokes an installation token. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/apps/#revoke-an-installation-access-token +// GitHub API docs: https://docs.github.com/en/rest/apps/installations#revoke-an-installation-access-token func (s *AppsService) RevokeInstallationToken(ctx context.Context) (*Response, error) { u := "installation/token" req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/apps_manifest.go b/github/apps_manifest.go index 164f4939995..fa4c85379ca 100644 --- a/github/apps_manifest.go +++ b/github/apps_manifest.go @@ -31,7 +31,7 @@ type AppConfig struct { // CompleteAppManifest completes the App manifest handshake flow for the given // code. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/apps/#create-a-github-app-from-a-manifest +// GitHub API docs: https://docs.github.com/en/rest/apps/apps#create-a-github-app-from-a-manifest func (s *AppsService) CompleteAppManifest(ctx context.Context, code string) (*AppConfig, *Response, error) { u := fmt.Sprintf("app-manifests/%s/conversions", code) req, err := s.client.NewRequest("POST", u, nil) diff --git a/github/apps_marketplace.go b/github/apps_marketplace.go index 13d09f2efba..82530136842 100644 --- a/github/apps_marketplace.go +++ b/github/apps_marketplace.go @@ -13,7 +13,7 @@ import ( // MarketplaceService handles communication with the marketplace related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/apps#marketplace +// GitHub API docs: https://docs.github.com/en/rest/apps#marketplace type MarketplaceService struct { client *Client // Stubbed controls whether endpoints that return stubbed data are used @@ -21,7 +21,7 @@ type MarketplaceService struct { // for testing your GitHub Apps. Stubbed data is hard-coded and will not // change based on actual subscriptions. // - // GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/apps#testing-with-stubbed-endpoints + // GitHub API docs: https://docs.github.com/en/rest/apps#testing-with-stubbed-endpoints Stubbed bool } @@ -77,7 +77,7 @@ type MarketplacePlanAccount struct { // ListPlans lists all plans for your Marketplace listing. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/apps#list-plans +// GitHub API docs: https://docs.github.com/en/rest/apps#list-plans func (s *MarketplaceService) ListPlans(ctx context.Context, opts *ListOptions) ([]*MarketplacePlan, *Response, error) { uri := s.marketplaceURI("plans") u, err := addOptions(uri, opts) @@ -101,7 +101,7 @@ func (s *MarketplaceService) ListPlans(ctx context.Context, opts *ListOptions) ( // ListPlanAccountsForPlan lists all GitHub accounts (user or organization) on a specific plan. // -// GitHub API docs: https://docs.github.com/en/rest/reference/apps#list-accounts-for-a-plan +// GitHub API docs: https://docs.github.com/en/rest/apps#list-accounts-for-a-plan func (s *MarketplaceService) ListPlanAccountsForPlan(ctx context.Context, planID int64, opts *ListOptions) ([]*MarketplacePlanAccount, *Response, error) { uri := s.marketplaceURI(fmt.Sprintf("plans/%v/accounts", planID)) u, err := addOptions(uri, opts) @@ -125,7 +125,7 @@ func (s *MarketplaceService) ListPlanAccountsForPlan(ctx context.Context, planID // GetPlanAccountForAccount get GitHub account (user or organization) associated with an account. // -// GitHub API docs: https://docs.github.com/en/rest/reference/apps#get-a-subscription-plan-for-an-account +// GitHub API docs: https://docs.github.com/en/rest/apps#get-a-subscription-plan-for-an-account func (s *MarketplaceService) GetPlanAccountForAccount(ctx context.Context, accountID int64) (*MarketplacePlanAccount, *Response, error) { uri := s.marketplaceURI(fmt.Sprintf("accounts/%v", accountID)) @@ -145,8 +145,8 @@ func (s *MarketplaceService) GetPlanAccountForAccount(ctx context.Context, accou // ListMarketplacePurchasesForUser lists all GitHub marketplace purchases made by a user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/apps/#list-subscriptions-for-the-authenticated-user-stubbed -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/apps/#list-subscriptions-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user-stubbed +// GitHub API docs: https://docs.github.com/en/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user func (s *MarketplaceService) ListMarketplacePurchasesForUser(ctx context.Context, opts *ListOptions) ([]*MarketplacePurchase, *Response, error) { uri := "user/marketplace_purchases" if s.Stubbed { diff --git a/github/authorizations.go b/github/authorizations.go index 76a14c3db10..ea0897e3627 100644 --- a/github/authorizations.go +++ b/github/authorizations.go @@ -12,7 +12,7 @@ import ( // Scope models a GitHub authorization scope. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/oauth/#scopes +// GitHub API docs: https://docs.github.com/en/rest/oauth/#scopes type Scope string // This is the set of scopes for GitHub API V3 @@ -50,7 +50,7 @@ const ( // This service requires HTTP Basic Authentication; it cannot be accessed using // an OAuth token. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/oauth_authorizations/ +// GitHub API docs: https://docs.github.com/en/rest/oauth-authorizations type AuthorizationsService service // Authorization represents an individual GitHub authorization. @@ -121,7 +121,7 @@ func (a AuthorizationRequest) String() string { // fields. That is, you may provide only one of "Scopes", or "AddScopes", or // "RemoveScopes". // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/oauth_authorizations/#update-an-existing-authorization +// GitHub API docs: https://docs.github.com/en/rest/oauth-authorizations#update-an-existing-authorization type AuthorizationUpdateRequest struct { Scopes []string `json:"scopes,omitempty"` AddScopes []string `json:"add_scopes,omitempty"` @@ -143,7 +143,7 @@ func (a AuthorizationUpdateRequest) String() string { // // The returned Authorization.User field will be populated. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/apps/#check-a-token +// GitHub API docs: https://docs.github.com/en/rest/apps/oauth-applications#check-a-token func (s *AuthorizationsService) Check(ctx context.Context, clientID, accessToken string) (*Authorization, *Response, error) { u := fmt.Sprintf("applications/%v/token", clientID) @@ -176,7 +176,7 @@ func (s *AuthorizationsService) Check(ctx context.Context, clientID, accessToken // // The returned Authorization.User field will be populated. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/apps/#reset-a-token +// GitHub API docs: https://docs.github.com/en/rest/apps/oauth-applications#reset-a-token func (s *AuthorizationsService) Reset(ctx context.Context, clientID, accessToken string) (*Authorization, *Response, error) { u := fmt.Sprintf("applications/%v/token", clientID) @@ -205,7 +205,7 @@ func (s *AuthorizationsService) Reset(ctx context.Context, clientID, accessToken // username is the OAuth application clientID, and the password is its // clientSecret. Invalid tokens will return a 404 Not Found. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/apps/#delete-an-app-token +// GitHub API docs: https://docs.github.com/en/rest/apps/oauth-applications#delete-an-app-token func (s *AuthorizationsService) Revoke(ctx context.Context, clientID, accessToken string) (*Response, error) { u := fmt.Sprintf("applications/%v/token", clientID) @@ -226,7 +226,7 @@ func (s *AuthorizationsService) Revoke(ctx context.Context, clientID, accessToke // grant will also delete all OAuth tokens associated with the application for // the user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/apps/#delete-an-app-authorization +// GitHub API docs: https://docs.github.com/en/rest/apps/oauth-applications#delete-an-app-authorization func (s *AuthorizationsService) DeleteGrant(ctx context.Context, clientID, accessToken string) (*Response, error) { u := fmt.Sprintf("applications/%v/grant", clientID) diff --git a/github/billing.go b/github/billing.go index dea4677beb0..d516cd0c298 100644 --- a/github/billing.go +++ b/github/billing.go @@ -13,7 +13,7 @@ import ( // BillingService provides access to the billing related functions // in the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/reference/billing +// GitHub API docs: https://docs.github.com/en/rest/billing type BillingService service // ActionBilling represents a GitHub Action billing. @@ -65,7 +65,7 @@ type AdvancedSecurityCommittersBreakdown struct { // 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 +// GitHub API docs: https://docs.github.com/en/rest/billing#get-github-actions-billing-for-an-organization func (s *BillingService) GetActionsBillingOrg(ctx context.Context, org string) (*ActionBilling, *Response, error) { u := fmt.Sprintf("orgs/%v/settings/billing/actions", org) req, err := s.client.NewRequest("GET", u, nil) @@ -84,7 +84,7 @@ func (s *BillingService) GetActionsBillingOrg(ctx context.Context, org string) ( // GetPackagesBillingOrg returns the free and paid storage used for GitHub Packages in gigabytes for an Org. // -// GitHub API docs: https://docs.github.com/en/rest/reference/billing#get-github-packages-billing-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/billing#get-github-packages-billing-for-an-organization func (s *BillingService) GetPackagesBillingOrg(ctx context.Context, org string) (*PackageBilling, *Response, error) { u := fmt.Sprintf("orgs/%v/settings/billing/packages", org) req, err := s.client.NewRequest("GET", u, nil) @@ -104,7 +104,7 @@ func (s *BillingService) GetPackagesBillingOrg(ctx context.Context, org string) // GetStorageBillingOrg returns the estimated paid and estimated total storage used for GitHub Actions // and GitHub Packages in gigabytes for an Org. // -// GitHub API docs: https://docs.github.com/en/rest/reference/billing#get-shared-storage-billing-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/billing#get-shared-storage-billing-for-an-organization func (s *BillingService) GetStorageBillingOrg(ctx context.Context, org string) (*StorageBilling, *Response, error) { u := fmt.Sprintf("orgs/%v/settings/billing/shared-storage", org) req, err := s.client.NewRequest("GET", u, nil) @@ -123,7 +123,7 @@ func (s *BillingService) GetStorageBillingOrg(ctx context.Context, org string) ( // 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 +// GitHub API docs: https://docs.github.com/en/rest/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) @@ -142,7 +142,7 @@ func (s *BillingService) GetAdvancedSecurityActiveCommittersOrg(ctx context.Cont // 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 +// GitHub API docs: https://docs.github.com/en/rest/billing#get-github-actions-billing-for-a-user func (s *BillingService) GetActionsBillingUser(ctx context.Context, user string) (*ActionBilling, *Response, error) { u := fmt.Sprintf("users/%v/settings/billing/actions", user) req, err := s.client.NewRequest("GET", u, nil) @@ -161,7 +161,7 @@ func (s *BillingService) GetActionsBillingUser(ctx context.Context, user string) // GetPackagesBillingUser returns the free and paid storage used for GitHub Packages in gigabytes for a user. // -// GitHub API docs: https://docs.github.com/en/rest/reference/billing#get-github-packages-billing-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/billing#get-github-packages-billing-for-a-user func (s *BillingService) GetPackagesBillingUser(ctx context.Context, user string) (*PackageBilling, *Response, error) { u := fmt.Sprintf("users/%v/settings/billing/packages", user) req, err := s.client.NewRequest("GET", u, nil) @@ -181,7 +181,7 @@ func (s *BillingService) GetPackagesBillingUser(ctx context.Context, user string // GetStorageBillingUser returns the estimated paid and estimated total storage used for GitHub Actions // and GitHub Packages in gigabytes for a user. // -// GitHub API docs: https://docs.github.com/en/rest/reference/billing#get-shared-storage-billing-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/billing#get-shared-storage-billing-for-a-user func (s *BillingService) GetStorageBillingUser(ctx context.Context, user string) (*StorageBilling, *Response, error) { u := fmt.Sprintf("users/%v/settings/billing/shared-storage", user) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/checks.go b/github/checks.go index b4819fc9459..12d08530ca0 100644 --- a/github/checks.go +++ b/github/checks.go @@ -13,7 +13,7 @@ import ( // ChecksService provides access to the Checks API in the // GitHub API. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/checks/ +// GitHub API docs: https://docs.github.com/en/rest/checks/ type ChecksService service // CheckRun represents a GitHub check run on a repository associated with a GitHub app. @@ -98,7 +98,7 @@ func (c CheckSuite) String() string { // GetCheckRun gets a check-run for a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/checks/#get-a-check-run +// GitHub API docs: https://docs.github.com/en/rest/checks/runs#get-a-check-run func (s *ChecksService) GetCheckRun(ctx context.Context, owner, repo string, checkRunID int64) (*CheckRun, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-runs/%v", owner, repo, checkRunID) req, err := s.client.NewRequest("GET", u, nil) @@ -119,7 +119,7 @@ func (s *ChecksService) GetCheckRun(ctx context.Context, owner, repo string, che // GetCheckSuite gets a single check suite. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/checks/#get-a-check-suite +// GitHub API docs: https://docs.github.com/en/rest/checks/suites#get-a-check-suite func (s *ChecksService) GetCheckSuite(ctx context.Context, owner, repo string, checkSuiteID int64) (*CheckSuite, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-suites/%v", owner, repo, checkSuiteID) req, err := s.client.NewRequest("GET", u, nil) @@ -161,7 +161,7 @@ type CheckRunAction struct { // CreateCheckRun creates a check run for repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/checks/#create-a-check-run +// GitHub API docs: https://docs.github.com/en/rest/checks/runs#create-a-check-run func (s *ChecksService) CreateCheckRun(ctx context.Context, owner, repo string, opts CreateCheckRunOptions) (*CheckRun, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-runs", owner, repo) req, err := s.client.NewRequest("POST", u, opts) @@ -194,7 +194,7 @@ type UpdateCheckRunOptions struct { // UpdateCheckRun updates a check run for a specific commit in a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/checks/#update-a-check-run +// GitHub API docs: https://docs.github.com/en/rest/checks/runs#update-a-check-run func (s *ChecksService) UpdateCheckRun(ctx context.Context, owner, repo string, checkRunID int64, opts UpdateCheckRunOptions) (*CheckRun, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-runs/%v", owner, repo, checkRunID) req, err := s.client.NewRequest("PATCH", u, opts) @@ -215,7 +215,7 @@ func (s *ChecksService) UpdateCheckRun(ctx context.Context, owner, repo string, // ListCheckRunAnnotations lists the annotations for a check run. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/checks/#list-check-run-annotations +// GitHub API docs: https://docs.github.com/en/rest/checks/runs#list-check-run-annotations func (s *ChecksService) ListCheckRunAnnotations(ctx context.Context, owner, repo string, checkRunID int64, opts *ListOptions) ([]*CheckRunAnnotation, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-runs/%v/annotations", owner, repo, checkRunID) u, err := addOptions(u, opts) @@ -257,7 +257,7 @@ type ListCheckRunsResults struct { // ListCheckRunsForRef lists check runs for a specific ref. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/checks/#list-check-runs-for-a-git-reference +// GitHub API docs: https://docs.github.com/en/rest/checks/runs#list-check-runs-for-a-git-reference func (s *ChecksService) ListCheckRunsForRef(ctx context.Context, owner, repo, ref string, opts *ListCheckRunsOptions) (*ListCheckRunsResults, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/check-runs", owner, repo, refURLEscape(ref)) u, err := addOptions(u, opts) @@ -283,7 +283,7 @@ func (s *ChecksService) ListCheckRunsForRef(ctx context.Context, owner, repo, re // ListCheckRunsCheckSuite lists check runs for a check suite. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/checks/#list-check-runs-in-a-check-suite +// GitHub API docs: https://docs.github.com/en/rest/checks/runs#list-check-runs-in-a-check-suite func (s *ChecksService) ListCheckRunsCheckSuite(ctx context.Context, owner, repo string, checkSuiteID int64, opts *ListCheckRunsOptions) (*ListCheckRunsResults, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-suites/%v/check-runs", owner, repo, checkSuiteID) u, err := addOptions(u, opts) @@ -339,7 +339,7 @@ type ListCheckSuiteResults struct { // ListCheckSuitesForRef lists check suite for a specific ref. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/checks/#list-check-suites-for-a-git-reference +// GitHub API docs: https://docs.github.com/en/rest/checks/suites#list-check-suites-for-a-git-reference func (s *ChecksService) ListCheckSuitesForRef(ctx context.Context, owner, repo, ref string, opts *ListCheckSuiteOptions) (*ListCheckSuiteResults, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/check-suites", owner, repo, refURLEscape(ref)) u, err := addOptions(u, opts) @@ -387,7 +387,7 @@ type PreferenceList struct { // SetCheckSuitePreferences changes the default automatic flow when creating check suites. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/checks/#update-repository-preferences-for-check-suites +// GitHub API docs: https://docs.github.com/en/rest/checks/suites#update-repository-preferences-for-check-suites func (s *ChecksService) SetCheckSuitePreferences(ctx context.Context, owner, repo string, opts CheckSuitePreferenceOptions) (*CheckSuitePreferenceResults, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-suites/preferences", owner, repo) req, err := s.client.NewRequest("PATCH", u, opts) @@ -414,7 +414,7 @@ type CreateCheckSuiteOptions struct { // CreateCheckSuite manually creates a check suite for a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/checks/#create-a-check-suite +// GitHub API docs: https://docs.github.com/en/rest/checks/suites#create-a-check-suite func (s *ChecksService) CreateCheckSuite(ctx context.Context, owner, repo string, opts CreateCheckSuiteOptions) (*CheckSuite, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-suites", owner, repo) req, err := s.client.NewRequest("POST", u, opts) @@ -435,7 +435,7 @@ func (s *ChecksService) CreateCheckSuite(ctx context.Context, owner, repo string // ReRequestCheckSuite triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/checks/#rerequest-a-check-suite +// GitHub API docs: https://docs.github.com/en/rest/checks/suites#rerequest-a-check-suite func (s *ChecksService) ReRequestCheckSuite(ctx context.Context, owner, repo string, checkSuiteID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/check-suites/%v/rerequest", owner, repo, checkSuiteID) diff --git a/github/code-scanning.go b/github/code-scanning.go index 48d7295230c..df8ed86b51d 100644 --- a/github/code-scanning.go +++ b/github/code-scanning.go @@ -15,7 +15,7 @@ import ( // CodeScanningService handles communication with the code scanning related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/code-scanning/ +// GitHub API docs: https://docs.github.com/en/rest/code-scanning type CodeScanningService service // Rule represents the complete details of GitHub Code Scanning alert type. @@ -65,7 +65,7 @@ type Tool struct { // Alert represents an individual GitHub Code Scanning Alert on a single repository. // -// GitHub API docs: https://docs.github.com/en/rest/reference/code-scanning#list-code-scanning-alerts-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/code-scanning type Alert struct { Number *int `json:"number,omitempty"` Repository *Repository `json:"repository,omitempty"` @@ -137,7 +137,7 @@ type AnalysesListOptions struct { // ScanningAnalysis represents an individual GitHub Code Scanning ScanningAnalysis on a single repository. // -// GitHub API docs: https://docs.github.com/en/rest/reference/code-scanning#list-code-scanning-analyses-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/code-scanning type ScanningAnalysis struct { ID *int64 `json:"id,omitempty"` Ref *string `json:"ref,omitempty"` @@ -158,7 +158,7 @@ type ScanningAnalysis struct { // SarifAnalysis specifies the results of a code scanning job. // -// GitHub API docs: https://docs.github.com/en/rest/reference/code-scanning#upload-an-analysis-as-sarif-data +// GitHub API docs: https://docs.github.com/en/rest/code-scanning type SarifAnalysis struct { CommitSHA *string `json:"commit_sha,omitempty"` Ref *string `json:"ref,omitempty"` @@ -170,7 +170,7 @@ type SarifAnalysis struct { // SarifID identifies a sarif analysis upload. // -// GitHub API docs: https://docs.github.com/en/rest/reference/code-scanning#upload-an-analysis-as-sarif-data +// GitHub API docs: https://docs.github.com/en/rest/code-scanning type SarifID struct { ID *string `json:"id,omitempty"` URL *string `json:"url,omitempty"` @@ -209,7 +209,7 @@ func (s *CodeScanningService) ListAlertsForOrg(ctx context.Context, org string, // You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events // read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/code-scanning/#list-code-scanning-alerts-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/code-scanning#list-code-scanning-alerts-for-a-repository func (s *CodeScanningService) ListAlertsForRepo(ctx context.Context, owner, repo string, opts *AlertListOptions) ([]*Alert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/alerts", owner, repo) u, err := addOptions(u, opts) @@ -238,7 +238,7 @@ func (s *CodeScanningService) ListAlertsForRepo(ctx context.Context, owner, repo // // The security alert_id is the number at the end of the security alert's URL. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/code-scanning/#get-a-code-scanning-alert +// GitHub API docs: https://docs.github.com/en/rest/code-scanning#get-a-code-scanning-alert func (s *CodeScanningService) GetAlert(ctx context.Context, owner, repo string, id int64) (*Alert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/alerts/%v", owner, repo, id) @@ -262,7 +262,7 @@ func (s *CodeScanningService) GetAlert(ctx context.Context, owner, repo string, // You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events // write permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/reference/code-scanning#upload-an-analysis-as-sarif-data +// GitHub API docs: https://docs.github.com/en/rest/code-scanning#upload-an-analysis-as-sarif-data func (s *CodeScanningService) UploadSarif(ctx context.Context, owner, repo string, sarif *SarifAnalysis) (*SarifID, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/sarifs", owner, repo) @@ -286,7 +286,7 @@ func (s *CodeScanningService) UploadSarif(ctx context.Context, owner, repo strin // You must use an access token with the security_events scope to use this endpoint. // GitHub Apps must have the security_events read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/reference/code-scanning#list-code-scanning-analyses-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/code-scanning#list-code-scanning-analyses-for-a-repository func (s *CodeScanningService) ListAnalysesForRepo(ctx context.Context, owner, repo string, opts *AnalysesListOptions) ([]*ScanningAnalysis, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/analyses", owner, repo) u, err := addOptions(u, opts) @@ -315,7 +315,7 @@ func (s *CodeScanningService) ListAnalysesForRepo(ctx context.Context, owner, re // // The security analysis_id is the ID of the analysis, as returned from the ListAnalysesForRepo operation. // -// GitHub API docs: https://docs.github.com/en/rest/reference/code-scanning#get-a-code-scanning-analysis-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/code-scanning#get-a-code-scanning-analysis-for-a-repository func (s *CodeScanningService) GetAnalysis(ctx context.Context, owner, repo string, id int64) (*ScanningAnalysis, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/analyses/%v", owner, repo, id) diff --git a/github/dependabot.go b/github/dependabot.go index 8ee0c0c7d8d..07e68b506af 100644 --- a/github/dependabot.go +++ b/github/dependabot.go @@ -8,5 +8,5 @@ package github // DependabotService handles communication with the Dependabot related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/dependabot/ +// GitHub API docs: https://docs.github.com/en/rest/dependabot/ type DependabotService service diff --git a/github/dependabot_secrets.go b/github/dependabot_secrets.go index a6645339cc2..f51f3396bdc 100644 --- a/github/dependabot_secrets.go +++ b/github/dependabot_secrets.go @@ -27,7 +27,7 @@ func (s *DependabotService) getPublicKey(ctx context.Context, url string) (*Publ // GetRepoPublicKey gets a public key that should be used for Dependabot secret encryption. // -// GitHub API docs: https://docs.github.com/en/rest/reference/dependabot#get-a-repository-public-key +// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#get-a-repository-public-key func (s *DependabotService) GetRepoPublicKey(ctx context.Context, owner, repo string) (*PublicKey, *Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/secrets/public-key", owner, repo) return s.getPublicKey(ctx, url) @@ -35,7 +35,7 @@ func (s *DependabotService) GetRepoPublicKey(ctx context.Context, owner, repo st // GetOrgPublicKey gets a public key that should be used for Dependabot secret encryption. // -// GitHub API docs: https://docs.github.com/en/rest/reference/dependabot#get-an-organization-public-key +// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#get-an-organization-public-key func (s *DependabotService) GetOrgPublicKey(ctx context.Context, org string) (*PublicKey, *Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/public-key", org) return s.getPublicKey(ctx, url) @@ -64,7 +64,7 @@ func (s *DependabotService) listSecrets(ctx context.Context, url string, opts *L // ListRepoSecrets lists all Dependabot secrets available in a repository // without revealing their encrypted values. // -// GitHub API docs: https://docs.github.com/en/rest/reference/dependabot#list-repository-secrets +// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#list-repository-secrets func (s *DependabotService) ListRepoSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/secrets", owner, repo) return s.listSecrets(ctx, url, opts) @@ -73,7 +73,7 @@ func (s *DependabotService) ListRepoSecrets(ctx context.Context, owner, repo str // ListOrgSecrets lists all Dependabot secrets available in an organization // without revealing their encrypted values. // -// GitHub API docs: https://docs.github.com/en/rest/reference/dependabot#list-organization-secrets +// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#list-organization-secrets func (s *DependabotService) ListOrgSecrets(ctx context.Context, org string, opts *ListOptions) (*Secrets, *Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets", org) return s.listSecrets(ctx, url, opts) @@ -96,7 +96,7 @@ func (s *DependabotService) getSecret(ctx context.Context, url string) (*Secret, // GetRepoSecret gets a single repository Dependabot secret without revealing its encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/reference/dependabot#get-a-repository-secret +// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#get-a-repository-secret func (s *DependabotService) GetRepoSecret(ctx context.Context, owner, repo, name string) (*Secret, *Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/secrets/%v", owner, repo, name) return s.getSecret(ctx, url) @@ -104,7 +104,7 @@ func (s *DependabotService) GetRepoSecret(ctx context.Context, owner, repo, name // GetOrgSecret gets a single organization Dependabot secret without revealing its encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/reference/dependabot#get-an-organization-secret +// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#get-an-organization-secret func (s *DependabotService) GetOrgSecret(ctx context.Context, org, name string) (*Secret, *Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v", org, name) return s.getSecret(ctx, url) @@ -121,7 +121,7 @@ func (s *DependabotService) putSecret(ctx context.Context, url string, eSecret * // CreateOrUpdateRepoSecret creates or updates a repository Dependabot secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/reference/dependabot#create-or-update-a-repository-secret +// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#create-or-update-a-repository-secret func (s *DependabotService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *EncryptedSecret) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/secrets/%v", owner, repo, eSecret.Name) return s.putSecret(ctx, url, eSecret) @@ -129,7 +129,7 @@ func (s *DependabotService) CreateOrUpdateRepoSecret(ctx context.Context, owner, // CreateOrUpdateOrgSecret creates or updates an organization Dependabot secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/reference/dependabot#create-or-update-an-organization-secret +// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#create-or-update-an-organization-secret func (s *DependabotService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *EncryptedSecret) (*Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v", org, eSecret.Name) return s.putSecret(ctx, url, eSecret) @@ -146,7 +146,7 @@ func (s *DependabotService) deleteSecret(ctx context.Context, url string) (*Resp // DeleteRepoSecret deletes a Dependabot secret in a repository using the secret name. // -// GitHub API docs: https://docs.github.com/en/rest/reference/dependabot#delete-a-repository-secret +// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#delete-a-repository-secret func (s *DependabotService) DeleteRepoSecret(ctx context.Context, owner, repo, name string) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/secrets/%v", owner, repo, name) return s.deleteSecret(ctx, url) @@ -154,7 +154,7 @@ func (s *DependabotService) DeleteRepoSecret(ctx context.Context, owner, repo, n // DeleteOrgSecret deletes a Dependabot secret in an organization using the secret name. // -// GitHub API docs: https://docs.github.com/en/rest/reference/dependabot#delete-an-organization-secret +// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#delete-an-organization-secret func (s *DependabotService) DeleteOrgSecret(ctx context.Context, org, name string) (*Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v", org, name) return s.deleteSecret(ctx, url) @@ -162,7 +162,7 @@ func (s *DependabotService) DeleteOrgSecret(ctx context.Context, org, name strin // ListSelectedReposForOrgSecret lists all repositories that have access to a Dependabot secret. // -// GitHub API docs: https://docs.github.com/en/rest/reference/dependabot#list-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret func (s *DependabotService) ListSelectedReposForOrgSecret(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v/repositories", org, name) u, err := addOptions(url, opts) @@ -186,7 +186,7 @@ func (s *DependabotService) ListSelectedReposForOrgSecret(ctx context.Context, o // SetSelectedReposForOrgSecret sets the repositories that have access to a Dependabot secret. // -// GitHub API docs: https://docs.github.com/en/rest/reference/dependabot#set-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret func (s *DependabotService) SetSelectedReposForOrgSecret(ctx context.Context, org, name string, ids SelectedRepoIDs) (*Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v/repositories", org, name) type repoIDs struct { @@ -203,7 +203,7 @@ func (s *DependabotService) SetSelectedReposForOrgSecret(ctx context.Context, or // AddSelectedRepoToOrgSecret adds a repository to an organization Dependabot secret. // -// GitHub API docs: https://docs.github.com/en/rest/reference/dependabot#add-selected-repository-to-an-organization-secret +// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#add-selected-repository-to-an-organization-secret func (s *DependabotService) AddSelectedRepoToOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v/repositories/%v", org, name, *repo.ID) req, err := s.client.NewRequest("PUT", url, nil) @@ -216,7 +216,7 @@ func (s *DependabotService) AddSelectedRepoToOrgSecret(ctx context.Context, org, // RemoveSelectedRepoFromOrgSecret removes a repository from an organization Dependabot secret. // -// GitHub API docs: https://docs.github.com/en/rest/reference/dependabot#remove-selected-repository-from-an-organization-secret +// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret func (s *DependabotService) RemoveSelectedRepoFromOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v/repositories/%v", org, name, *repo.ID) req, err := s.client.NewRequest("DELETE", url, nil) diff --git a/github/doc.go b/github/doc.go index e91d7081082..49991e2f56f 100644 --- a/github/doc.go +++ b/github/doc.go @@ -29,7 +29,7 @@ Some API methods have optional parameters that can be passed. For example: The services of a client divide the API into logical chunks and correspond to the structure of the GitHub API documentation at -https://docs.github.com/en/free-pro-team@latest/rest/reference/. +https://docs.github.com/en/rest . NOTE: Using the https://godoc.org/context package, one can easily pass cancelation signals and deadlines to various services of the client for @@ -137,7 +137,7 @@ For secondary rate limits, you can check if its type is *github.AbuseRateLimitEr } Learn more about GitHub rate limiting at -https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#rate-limiting. +https://docs.github.com/en/rest/rate-limit . Accepted Status @@ -163,7 +163,7 @@ instead designed to work with a caching http.Transport. We recommend using https://github.com/gregjones/httpcache for that. Learn more about GitHub conditional requests at -https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#conditional-requests. +https://docs.github.com/en/rest/overview/resources-in-the-rest-api#conditional-requests. Creating and Updating Resources diff --git a/github/enterprise.go b/github/enterprise.go index f6a5af83903..1c9b0695669 100644 --- a/github/enterprise.go +++ b/github/enterprise.go @@ -8,5 +8,5 @@ package github // EnterpriseService provides access to the enterprise related functions // in the GitHub API. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/enterprise-admin/ +// GitHub API docs: https://docs.github.com/en/rest/enterprise-admin/ type EnterpriseService service diff --git a/github/enterprise_actions_runners.go b/github/enterprise_actions_runners.go index d2758fe8381..f2ba166360a 100644 --- a/github/enterprise_actions_runners.go +++ b/github/enterprise_actions_runners.go @@ -12,7 +12,7 @@ import ( // CreateRegistrationToken creates a token that can be used to add a self-hosted runner. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/enterprise-admin/#create-a-registration-token-for-an-enterprise +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-registration-token-for-an-enterprise func (s *EnterpriseService) CreateRegistrationToken(ctx context.Context, enterprise string) (*RegistrationToken, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runners/registration-token", enterprise) @@ -32,7 +32,7 @@ func (s *EnterpriseService) CreateRegistrationToken(ctx context.Context, enterpr // ListRunners lists all the self-hosted runners for a enterprise. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/enterprise-admin/#list-self-hosted-runners-for-an-enterprise +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-enterprise func (s *EnterpriseService) ListRunners(ctx context.Context, enterprise string, opts *ListOptions) (*Runners, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runners", enterprise) u, err := addOptions(u, opts) @@ -56,7 +56,7 @@ func (s *EnterpriseService) ListRunners(ctx context.Context, enterprise string, // RemoveRunner forces the removal of a self-hosted runner from an enterprise using the runner id. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/enterprise-admin/#delete-a-self-hosted-runner-from-an-enterprise +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-enterprise func (s *EnterpriseService) RemoveRunner(ctx context.Context, enterprise string, runnerID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runners/%v", enterprise, runnerID) diff --git a/github/enterprise_audit_log.go b/github/enterprise_audit_log.go index b889a7e570c..40648673385 100644 --- a/github/enterprise_audit_log.go +++ b/github/enterprise_audit_log.go @@ -12,7 +12,7 @@ import ( // GetAuditLog gets the audit-log entries for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/reference/enterprise-admin#get-the-audit-log-for-an-enterprise +// GitHub API docs: https://docs.github.com/en/rest/enterprise-admin/audit-log#get-the-audit-log-for-an-enterprise func (s *EnterpriseService) GetAuditLog(ctx context.Context, enterprise string, opts *GetAuditLogOptions) ([]*AuditEntry, *Response, error) { u := fmt.Sprintf("enterprises/%v/audit-log", enterprise) u, err := addOptions(u, opts) diff --git a/github/event_types.go b/github/event_types.go index 7ce312d2105..c80a835f6b8 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -853,7 +853,7 @@ type PullRequestReviewThreadEvent struct { // locked, unlocked, a pull request review is requested, or a review request is removed. // The Webhook event name is "pull_request_target". // -// GitHub API docs: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request_target +// GitHub API docs: https://docs.github.com/en/actions/events-that-trigger-workflows#pull_request_target type PullRequestTargetEvent struct { // Action is the action that was performed. Possible values are: // "assigned", "unassigned", "labeled", "unlabeled", "opened", "edited", "closed", "reopened", diff --git a/github/gists.go b/github/gists.go index 40a4aaf5810..ecdc6f27260 100644 --- a/github/gists.go +++ b/github/gists.go @@ -14,7 +14,7 @@ import ( // GistsService handles communication with the Gist related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/gists/ +// GitHub API docs: https://docs.github.com/en/rest/gists type GistsService service // Gist represents a GitHub's gist. @@ -96,8 +96,8 @@ type GistListOptions struct { // is authenticated, it will returns all gists for the authenticated // user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/gists/#list-gists-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/gists/#list-gists-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/gists/gists#list-gists-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/gists/gists#list-gists-for-a-user func (s *GistsService) List(ctx context.Context, user string, opts *GistListOptions) ([]*Gist, *Response, error) { var u string if user != "" { @@ -126,7 +126,7 @@ func (s *GistsService) List(ctx context.Context, user string, opts *GistListOpti // ListAll lists all public gists. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/gists/#list-public-gists +// GitHub API docs: https://docs.github.com/en/rest/gists/gists#list-public-gists func (s *GistsService) ListAll(ctx context.Context, opts *GistListOptions) ([]*Gist, *Response, error) { u, err := addOptions("gists/public", opts) if err != nil { @@ -149,7 +149,7 @@ func (s *GistsService) ListAll(ctx context.Context, opts *GistListOptions) ([]*G // ListStarred lists starred gists of authenticated user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/gists/#list-starred-gists +// GitHub API docs: https://docs.github.com/en/rest/gists/gists#list-starred-gists func (s *GistsService) ListStarred(ctx context.Context, opts *GistListOptions) ([]*Gist, *Response, error) { u, err := addOptions("gists/starred", opts) if err != nil { @@ -172,7 +172,7 @@ func (s *GistsService) ListStarred(ctx context.Context, opts *GistListOptions) ( // Get a single gist. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/gists/#get-a-gist +// GitHub API docs: https://docs.github.com/en/rest/gists/gists#get-a-gist func (s *GistsService) Get(ctx context.Context, id string) (*Gist, *Response, error) { u := fmt.Sprintf("gists/%v", id) req, err := s.client.NewRequest("GET", u, nil) @@ -191,7 +191,7 @@ func (s *GistsService) Get(ctx context.Context, id string) (*Gist, *Response, er // GetRevision gets a specific revision of a gist. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/gists/#get-a-gist-revision +// GitHub API docs: https://docs.github.com/en/rest/gists/gists#get-a-gist-revision func (s *GistsService) GetRevision(ctx context.Context, id, sha string) (*Gist, *Response, error) { u := fmt.Sprintf("gists/%v/%v", id, sha) req, err := s.client.NewRequest("GET", u, nil) @@ -210,7 +210,7 @@ func (s *GistsService) GetRevision(ctx context.Context, id, sha string) (*Gist, // Create a gist for authenticated user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/gists/#create-a-gist +// GitHub API docs: https://docs.github.com/en/rest/gists/gists#create-a-gist func (s *GistsService) Create(ctx context.Context, gist *Gist) (*Gist, *Response, error) { u := "gists" req, err := s.client.NewRequest("POST", u, gist) @@ -229,7 +229,7 @@ func (s *GistsService) Create(ctx context.Context, gist *Gist) (*Gist, *Response // Edit a gist. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/gists/#update-a-gist +// GitHub API docs: https://docs.github.com/en/rest/gists/gists#update-a-gist func (s *GistsService) Edit(ctx context.Context, id string, gist *Gist) (*Gist, *Response, error) { u := fmt.Sprintf("gists/%v", id) req, err := s.client.NewRequest("PATCH", u, gist) @@ -248,7 +248,7 @@ func (s *GistsService) Edit(ctx context.Context, id string, gist *Gist) (*Gist, // ListCommits lists commits of a gist. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/gists/#list-gist-commits +// GitHub API docs: https://docs.github.com/en/rest/gists/gists#list-gist-commits func (s *GistsService) ListCommits(ctx context.Context, id string, opts *ListOptions) ([]*GistCommit, *Response, error) { u := fmt.Sprintf("gists/%v/commits", id) u, err := addOptions(u, opts) @@ -272,7 +272,7 @@ func (s *GistsService) ListCommits(ctx context.Context, id string, opts *ListOpt // Delete a gist. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/gists/#delete-a-gist +// GitHub API docs: https://docs.github.com/en/rest/gists/gists#delete-a-gist func (s *GistsService) Delete(ctx context.Context, id string) (*Response, error) { u := fmt.Sprintf("gists/%v", id) req, err := s.client.NewRequest("DELETE", u, nil) @@ -285,7 +285,7 @@ func (s *GistsService) Delete(ctx context.Context, id string) (*Response, error) // Star a gist on behalf of authenticated user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/gists/#star-a-gist +// GitHub API docs: https://docs.github.com/en/rest/gists/gists#star-a-gist func (s *GistsService) Star(ctx context.Context, id string) (*Response, error) { u := fmt.Sprintf("gists/%v/star", id) req, err := s.client.NewRequest("PUT", u, nil) @@ -298,7 +298,7 @@ func (s *GistsService) Star(ctx context.Context, id string) (*Response, error) { // Unstar a gist on a behalf of authenticated user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/gists/#unstar-a-gist +// GitHub API docs: https://docs.github.com/en/rest/gists/gists#unstar-a-gist func (s *GistsService) Unstar(ctx context.Context, id string) (*Response, error) { u := fmt.Sprintf("gists/%v/star", id) req, err := s.client.NewRequest("DELETE", u, nil) @@ -311,7 +311,7 @@ func (s *GistsService) Unstar(ctx context.Context, id string) (*Response, error) // IsStarred checks if a gist is starred by authenticated user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/gists/#check-if-a-gist-is-starred +// GitHub API docs: https://docs.github.com/en/rest/gists/gists#check-if-a-gist-is-starred func (s *GistsService) IsStarred(ctx context.Context, id string) (bool, *Response, error) { u := fmt.Sprintf("gists/%v/star", id) req, err := s.client.NewRequest("GET", u, nil) @@ -326,7 +326,7 @@ func (s *GistsService) IsStarred(ctx context.Context, id string) (bool, *Respons // Fork a gist. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/gists/#fork-a-gist +// GitHub API docs: https://docs.github.com/en/rest/gists/gists#fork-a-gist func (s *GistsService) Fork(ctx context.Context, id string) (*Gist, *Response, error) { u := fmt.Sprintf("gists/%v/forks", id) req, err := s.client.NewRequest("POST", u, nil) @@ -345,7 +345,7 @@ func (s *GistsService) Fork(ctx context.Context, id string) (*Gist, *Response, e // ListForks lists forks of a gist. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/gists/#list-gist-forks +// GitHub API docs: https://docs.github.com/en/rest/gists/gists#list-gist-forks func (s *GistsService) ListForks(ctx context.Context, id string, opts *ListOptions) ([]*GistFork, *Response, error) { u := fmt.Sprintf("gists/%v/forks", id) u, err := addOptions(u, opts) diff --git a/github/gists_comments.go b/github/gists_comments.go index a9452c96412..d551e9a11d4 100644 --- a/github/gists_comments.go +++ b/github/gists_comments.go @@ -26,7 +26,7 @@ func (g GistComment) String() string { // ListComments lists all comments for a gist. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/gists/#list-gist-comments +// GitHub API docs: https://docs.github.com/en/rest/gists/comments#list-gist-comments func (s *GistsService) ListComments(ctx context.Context, gistID string, opts *ListOptions) ([]*GistComment, *Response, error) { u := fmt.Sprintf("gists/%v/comments", gistID) u, err := addOptions(u, opts) @@ -50,7 +50,7 @@ func (s *GistsService) ListComments(ctx context.Context, gistID string, opts *Li // GetComment retrieves a single comment from a gist. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/gists/#get-a-gist-comment +// GitHub API docs: https://docs.github.com/en/rest/gists/comments#get-a-gist-comment func (s *GistsService) GetComment(ctx context.Context, gistID string, commentID int64) (*GistComment, *Response, error) { u := fmt.Sprintf("gists/%v/comments/%v", gistID, commentID) req, err := s.client.NewRequest("GET", u, nil) @@ -69,7 +69,7 @@ func (s *GistsService) GetComment(ctx context.Context, gistID string, commentID // CreateComment creates a comment for a gist. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/gists/#create-a-gist-comment +// GitHub API docs: https://docs.github.com/en/rest/gists/comments#create-a-gist-comment func (s *GistsService) CreateComment(ctx context.Context, gistID string, comment *GistComment) (*GistComment, *Response, error) { u := fmt.Sprintf("gists/%v/comments", gistID) req, err := s.client.NewRequest("POST", u, comment) @@ -88,7 +88,7 @@ func (s *GistsService) CreateComment(ctx context.Context, gistID string, comment // EditComment edits an existing gist comment. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/gists/#update-a-gist-comment +// GitHub API docs: https://docs.github.com/en/rest/gists/comments#update-a-gist-comment func (s *GistsService) EditComment(ctx context.Context, gistID string, commentID int64, comment *GistComment) (*GistComment, *Response, error) { u := fmt.Sprintf("gists/%v/comments/%v", gistID, commentID) req, err := s.client.NewRequest("PATCH", u, comment) @@ -107,7 +107,7 @@ func (s *GistsService) EditComment(ctx context.Context, gistID string, commentID // DeleteComment deletes a gist comment. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/gists/#delete-a-gist-comment +// GitHub API docs: https://docs.github.com/en/rest/gists/comments#delete-a-gist-comment func (s *GistsService) DeleteComment(ctx context.Context, gistID string, commentID int64) (*Response, error) { u := fmt.Sprintf("gists/%v/comments/%v", gistID, commentID) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/git.go b/github/git.go index 36b33f5e056..8960de7b14a 100644 --- a/github/git.go +++ b/github/git.go @@ -8,5 +8,5 @@ package github // GitService handles communication with the git data related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/git/ +// GitHub API docs: https://docs.github.com/en/rest/git/ type GitService service diff --git a/github/git_blobs.go b/github/git_blobs.go index 7cbd411ca71..da0485ccbe2 100644 --- a/github/git_blobs.go +++ b/github/git_blobs.go @@ -23,7 +23,7 @@ type Blob struct { // GetBlob fetches a blob from a repo given a SHA. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/git/#get-a-blob +// GitHub API docs: https://docs.github.com/en/rest/git/blobs#get-a-blob func (s *GitService) GetBlob(ctx context.Context, owner string, repo string, sha string) (*Blob, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/blobs/%v", owner, repo, sha) req, err := s.client.NewRequest("GET", u, nil) @@ -43,7 +43,7 @@ func (s *GitService) GetBlob(ctx context.Context, owner string, repo string, sha // GetBlobRaw fetches a blob's contents from a repo. // Unlike GetBlob, it returns the raw bytes rather than the base64-encoded data. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/git/#get-a-blob +// GitHub API docs: https://docs.github.com/en/rest/git/blobs#get-a-blob func (s *GitService) GetBlobRaw(ctx context.Context, owner, repo, sha string) ([]byte, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/blobs/%v", owner, repo, sha) req, err := s.client.NewRequest("GET", u, nil) @@ -64,7 +64,7 @@ func (s *GitService) GetBlobRaw(ctx context.Context, owner, repo, sha string) ([ // CreateBlob creates a blob object. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/git/#create-a-blob +// GitHub API docs: https://docs.github.com/en/rest/git/blobs#create-a-blob func (s *GitService) CreateBlob(ctx context.Context, owner string, repo string, blob *Blob) (*Blob, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/blobs", owner, repo) req, err := s.client.NewRequest("POST", u, blob) diff --git a/github/git_commits.go b/github/git_commits.go index 7a728bee179..baedb3d6868 100644 --- a/github/git_commits.go +++ b/github/git_commits.go @@ -70,7 +70,7 @@ func (c CommitAuthor) String() string { // GetCommit fetches the Commit object for a given SHA. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/git/#get-a-commit +// GitHub API docs: https://docs.github.com/en/rest/git/commits#get-a-commit func (s *GitService) GetCommit(ctx context.Context, owner string, repo string, sha string) (*Commit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/commits/%v", owner, repo, sha) req, err := s.client.NewRequest("GET", u, nil) @@ -104,7 +104,7 @@ type createCommit struct { // data if omitted. If the commit.Author is omitted, it will be filled in with // the authenticated user’s information and the current date. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/git/#create-a-commit +// GitHub API docs: https://docs.github.com/en/rest/git/commits#create-a-commit func (s *GitService) CreateCommit(ctx context.Context, owner string, repo string, commit *Commit) (*Commit, *Response, error) { if commit == nil { return nil, nil, fmt.Errorf("commit must be provided") diff --git a/github/git_refs.go b/github/git_refs.go index 259f27fadad..883975cc0fe 100644 --- a/github/git_refs.go +++ b/github/git_refs.go @@ -49,7 +49,7 @@ type updateRefRequest struct { // GetRef fetches a single reference in a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/git/#get-a-reference +// GitHub API docs: https://docs.github.com/en/rest/git/refs#get-a-reference func (s *GitService) GetRef(ctx context.Context, owner string, repo string, ref string) (*Reference, *Response, error) { ref = strings.TrimPrefix(ref, "refs/") u := fmt.Sprintf("repos/%v/%v/git/ref/%v", owner, repo, refURLEscape(ref)) @@ -88,7 +88,7 @@ type ReferenceListOptions struct { // ListMatchingRefs lists references in a repository that match a supplied ref. // Use an empty ref to list all references. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/git/#list-matching-references +// GitHub API docs: https://docs.github.com/en/rest/git/refs#list-matching-references func (s *GitService) ListMatchingRefs(ctx context.Context, owner, repo string, opts *ReferenceListOptions) ([]*Reference, *Response, error) { var ref string if opts != nil { @@ -116,7 +116,7 @@ func (s *GitService) ListMatchingRefs(ctx context.Context, owner, repo string, o // CreateRef creates a new ref in a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/git/#create-a-reference +// GitHub API docs: https://docs.github.com/en/rest/git/refs#create-a-reference func (s *GitService) CreateRef(ctx context.Context, owner string, repo string, ref *Reference) (*Reference, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/refs", owner, repo) req, err := s.client.NewRequest("POST", u, &createRefRequest{ @@ -139,7 +139,7 @@ func (s *GitService) CreateRef(ctx context.Context, owner string, repo string, r // UpdateRef updates an existing ref in a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/git/#update-a-reference +// GitHub API docs: https://docs.github.com/en/rest/git/refs#update-a-reference func (s *GitService) UpdateRef(ctx context.Context, owner string, repo string, ref *Reference, force bool) (*Reference, *Response, error) { refPath := strings.TrimPrefix(*ref.Ref, "refs/") u := fmt.Sprintf("repos/%v/%v/git/refs/%v", owner, repo, refPath) @@ -162,7 +162,7 @@ func (s *GitService) UpdateRef(ctx context.Context, owner string, repo string, r // DeleteRef deletes a ref from a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/git/#delete-a-reference +// GitHub API docs: https://docs.github.com/en/rest/git/refs#delete-a-reference func (s *GitService) DeleteRef(ctx context.Context, owner string, repo string, ref string) (*Response, error) { ref = strings.TrimPrefix(ref, "refs/") u := fmt.Sprintf("repos/%v/%v/git/refs/%v", owner, repo, refURLEscape(ref)) diff --git a/github/git_tags.go b/github/git_tags.go index 12cfc1b3ef7..30d7b2c2d23 100644 --- a/github/git_tags.go +++ b/github/git_tags.go @@ -35,7 +35,7 @@ type createTagRequest struct { // GetTag fetches a tag from a repo given a SHA. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/git/#get-a-tag +// GitHub API docs: https://docs.github.com/en/rest/git/tags#get-a-tag func (s *GitService) GetTag(ctx context.Context, owner string, repo string, sha string) (*Tag, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/tags/%v", owner, repo, sha) req, err := s.client.NewRequest("GET", u, nil) @@ -54,7 +54,7 @@ func (s *GitService) GetTag(ctx context.Context, owner string, repo string, sha // CreateTag creates a tag object. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/git/#create-a-tag-object +// GitHub API docs: https://docs.github.com/en/rest/git/tags#create-a-tag-object func (s *GitService) CreateTag(ctx context.Context, owner string, repo string, tag *Tag) (*Tag, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/tags", owner, repo) diff --git a/github/git_trees.go b/github/git_trees.go index e655e93a0b7..db28976e032 100644 --- a/github/git_trees.go +++ b/github/git_trees.go @@ -93,7 +93,7 @@ func (t *TreeEntry) MarshalJSON() ([]byte, error) { // GetTree fetches the Tree object for a given sha hash from a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/git/#get-a-tree +// GitHub API docs: https://docs.github.com/en/rest/git/trees#get-a-tree func (s *GitService) GetTree(ctx context.Context, owner string, repo string, sha string, recursive bool) (*Tree, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/trees/%v", owner, repo, sha) if recursive { @@ -124,7 +124,7 @@ type createTree struct { // path modifying that tree are specified, it will overwrite the contents of // that tree with the new path contents and write a new tree out. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/git/#create-a-tree +// GitHub API docs: https://docs.github.com/en/rest/git/trees#create-a-tree func (s *GitService) CreateTree(ctx context.Context, owner string, repo string, baseTree string, entries []*TreeEntry) (*Tree, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/trees", owner, repo) diff --git a/github/github.go b/github/github.go index f51f9d88ca7..08b7db8e55b 100644 --- a/github/github.go +++ b/github/github.go @@ -130,10 +130,10 @@ const ( // https://developer.github.com/changes/2019-04-11-pulls-branches-for-commit/ mediaTypeListPullsOrBranchesForCommitPreview = "application/vnd.github.groot-preview+json" - // https://docs.github.com/en/free-pro-team@latest/rest/reference/previews/#repository-creation-permissions + // https://docs.github.com/en/rest/previews/#repository-creation-permissions mediaTypeMemberAllowedRepoCreationTypePreview = "application/vnd.github.surtur-preview+json" - // https://docs.github.com/en/free-pro-team@latest/rest/reference/previews/#create-and-use-repository-templates + // https://docs.github.com/en/rest/previews/#create-and-use-repository-templates mediaTypeRepositoryTemplatePreview = "application/vnd.github.baptiste-preview+json" // https://developer.github.com/changes/2019-10-03-multi-line-comments/ @@ -770,7 +770,7 @@ func compareHTTPResponse(r1, r2 *http.Response) bool { /* An ErrorResponse reports one or more errors caused by an API request. -GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/#client-errors +GitHub API docs: https://docs.github.com/en/rest/#client-errors */ type ErrorResponse struct { Response *http.Response // HTTP response that caused this error @@ -780,7 +780,7 @@ type ErrorResponse struct { Block *ErrorBlock `json:"block,omitempty"` // Most errors will also include a documentation_url field pointing // to some content that might help you resolve the error, see - // https://docs.github.com/en/free-pro-team@latest/rest/reference/#client-errors + // https://docs.github.com/en/rest/#client-errors DocumentationURL string `json:"documentation_url,omitempty"` } @@ -900,7 +900,7 @@ func (ae *AcceptedError) Is(target error) bool { } // AbuseRateLimitError occurs when GitHub returns 403 Forbidden response with the -// "documentation_url" field value equal to "https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#secondary-rate-limits". +// "documentation_url" field value equal to "https://docs.github.com/en/rest/overview/resources-in-the-rest-api#secondary-rate-limits". type AbuseRateLimitError struct { Response *http.Response // HTTP response that caused this error Message string `json:"message"` // error message @@ -963,7 +963,7 @@ GitHub error responses structure are often undocumented and inconsistent. Sometimes error is just a simple string (Issue #540). In such cases, Message represents an error message as a workaround. -GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/#client-errors +GitHub API docs: https://docs.github.com/en/rest/#client-errors */ type Error struct { Resource string `json:"resource"` // resource on which the error occurred @@ -1214,7 +1214,7 @@ that need to use a higher rate limit associated with your OAuth application. This will add the client id and secret as a base64-encoded string in the format ClientID:ClientSecret and apply it as an "Authorization": "Basic" header. -See https://docs.github.com/en/free-pro-team@latest/rest/reference/#unauthenticated-rate-limited-requests for +See https://docs.github.com/en/rest/#unauthenticated-rate-limited-requests for more information. */ type UnauthenticatedRateLimitedTransport struct { diff --git a/github/github_test.go b/github/github_test.go index 93698718721..0a28ced93c6 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -1046,7 +1046,7 @@ func TestDo_rateLimit_rateLimitError(t *testing.T) { w.WriteHeader(http.StatusForbidden) fmt.Fprintln(w, `{ "message": "API rate limit exceeded for xxx.xxx.xxx.xxx. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)", - "documentation_url": "https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#abuse-rate-limits" + "documentation_url": "https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits" }`) }) @@ -1088,7 +1088,7 @@ func TestDo_rateLimit_noNetworkCall(t *testing.T) { w.WriteHeader(http.StatusForbidden) fmt.Fprintln(w, `{ "message": "API rate limit exceeded for xxx.xxx.xxx.xxx. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)", - "documentation_url": "https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#abuse-rate-limits" + "documentation_url": "https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits" }`) }) @@ -1145,7 +1145,7 @@ func TestDo_rateLimit_ignoredFromCache(t *testing.T) { w.WriteHeader(http.StatusForbidden) fmt.Fprintln(w, `{ "message": "API rate limit exceeded for xxx.xxx.xxx.xxx. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)", - "documentation_url": "https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#abuse-rate-limits" + "documentation_url": "https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits" }`) }) @@ -1184,7 +1184,7 @@ func TestDo_rateLimit_abuseRateLimitError(t *testing.T) { // there is no "Retry-After" header. fmt.Fprintln(w, `{ "message": "You have triggered an abuse detection mechanism and have been temporarily blocked from content creation. Please retry your request again later.", - "documentation_url": "https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#abuse-rate-limits" + "documentation_url": "https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits" }`) }) @@ -1219,7 +1219,7 @@ func TestDo_rateLimit_abuseRateLimitErrorEnterprise(t *testing.T) { // url changes between versions but follows roughly the same format. fmt.Fprintln(w, `{ "message": "You have triggered an abuse detection mechanism and have been temporarily blocked from content creation. Please retry your request again later.", - "documentation_url": "https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#abuse-rate-limits" + "documentation_url": "https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits" }`) }) @@ -1250,7 +1250,7 @@ func TestDo_rateLimit_abuseRateLimitError_retryAfter(t *testing.T) { w.WriteHeader(http.StatusForbidden) fmt.Fprintln(w, `{ "message": "You have triggered an abuse detection mechanism ...", - "documentation_url": "https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#abuse-rate-limits" + "documentation_url": "https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits" }`) }) @@ -1371,7 +1371,7 @@ func TestCheckResponse_AbuseRateLimit(t *testing.T) { Request: &http.Request{}, StatusCode: http.StatusForbidden, Body: ioutil.NopCloser(strings.NewReader(`{"message":"m", - "documentation_url": "docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#abuse-rate-limits"}`)), + "documentation_url": "docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits"}`)), } err := CheckResponse(res).(*AbuseRateLimitError) diff --git a/github/gitignore.go b/github/gitignore.go index 2f9d0bcfb54..a20a868b44a 100644 --- a/github/gitignore.go +++ b/github/gitignore.go @@ -13,7 +13,7 @@ import ( // GitignoresService provides access to the gitignore related functions in the // GitHub API. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/gitignore/ +// GitHub API docs: https://docs.github.com/en/rest/gitignore/ type GitignoresService service // Gitignore represents a .gitignore file as returned by the GitHub API. @@ -28,7 +28,7 @@ func (g Gitignore) String() string { // List all available Gitignore templates. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/gitignore/#listing-available-templates +// GitHub API docs: https://docs.github.com/en/rest/gitignore/#listing-available-templates func (s *GitignoresService) List(ctx context.Context) ([]string, *Response, error) { req, err := s.client.NewRequest("GET", "gitignore/templates", nil) if err != nil { @@ -46,7 +46,7 @@ func (s *GitignoresService) List(ctx context.Context) ([]string, *Response, erro // Get a Gitignore by name. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/gitignore/#get-a-gitignore-template +// GitHub API docs: https://docs.github.com/en/rest/gitignore#get-a-gitignore-template func (s *GitignoresService) Get(ctx context.Context, name string) (*Gitignore, *Response, error) { u := fmt.Sprintf("gitignore/templates/%v", name) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/interactions.go b/github/interactions.go index 3b00d3c0d4d..a690f61268f 100644 --- a/github/interactions.go +++ b/github/interactions.go @@ -8,7 +8,7 @@ package github // InteractionsService handles communication with the repository and organization related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/interactions/ +// GitHub API docs: https://docs.github.com/en/rest/interactions/ type InteractionsService service // InteractionRestriction represents the interaction restrictions for repository and organization. diff --git a/github/interactions_orgs.go b/github/interactions_orgs.go index d22a9e748d7..5c7663f583d 100644 --- a/github/interactions_orgs.go +++ b/github/interactions_orgs.go @@ -12,7 +12,7 @@ import ( // GetRestrictionsForOrg fetches the interaction restrictions for an organization. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/interactions/#get-interaction-restrictions-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/interactions/orgs#get-interaction-restrictions-for-an-organization func (s *InteractionsService) GetRestrictionsForOrg(ctx context.Context, organization string) (*InteractionRestriction, *Response, error) { u := fmt.Sprintf("orgs/%v/interaction-limits", organization) req, err := s.client.NewRequest("GET", u, nil) @@ -39,7 +39,7 @@ func (s *InteractionsService) GetRestrictionsForOrg(ctx context.Context, organiz // in public repositories for the given organization. // Possible values are: "existing_users", "contributors_only", "collaborators_only". // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/interactions/#set-interaction-restrictions-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/interactions/orgs#set-interaction-restrictions-for-an-organization func (s *InteractionsService) UpdateRestrictionsForOrg(ctx context.Context, organization, limit string) (*InteractionRestriction, *Response, error) { u := fmt.Sprintf("orgs/%v/interaction-limits", organization) @@ -65,7 +65,7 @@ func (s *InteractionsService) UpdateRestrictionsForOrg(ctx context.Context, orga // RemoveRestrictionsFromOrg removes the interaction restrictions for an organization. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/interactions/#remove-interaction-restrictions-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/interactions/orgs#remove-interaction-restrictions-for-an-organization func (s *InteractionsService) RemoveRestrictionsFromOrg(ctx context.Context, organization string) (*Response, error) { u := fmt.Sprintf("orgs/%v/interaction-limits", organization) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/interactions_repos.go b/github/interactions_repos.go index 13fffd64c0a..41e6c5319d0 100644 --- a/github/interactions_repos.go +++ b/github/interactions_repos.go @@ -12,7 +12,7 @@ import ( // GetRestrictionsForRepo fetches the interaction restrictions for a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/interactions/#get-interaction-restrictions-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/interactions/repos#get-interaction-restrictions-for-a-repository func (s *InteractionsService) GetRestrictionsForRepo(ctx context.Context, owner, repo string) (*InteractionRestriction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/interaction-limits", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -39,7 +39,7 @@ func (s *InteractionsService) GetRestrictionsForRepo(ctx context.Context, owner, // for the given repository. // Possible values are: "existing_users", "contributors_only", "collaborators_only". // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/interactions/#set-interaction-restrictions-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/interactions/repos#set-interaction-restrictions-for-a-repository func (s *InteractionsService) UpdateRestrictionsForRepo(ctx context.Context, owner, repo, limit string) (*InteractionRestriction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/interaction-limits", owner, repo) @@ -65,7 +65,7 @@ func (s *InteractionsService) UpdateRestrictionsForRepo(ctx context.Context, own // RemoveRestrictionsFromRepo removes the interaction restrictions for a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/interactions/#remove-interaction-restrictions-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/interactions/repos#remove-interaction-restrictions-for-a-repository func (s *InteractionsService) RemoveRestrictionsFromRepo(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/interaction-limits", owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/issues.go b/github/issues.go index f35f2b566ae..12488f9815e 100644 --- a/github/issues.go +++ b/github/issues.go @@ -14,7 +14,7 @@ import ( // IssuesService handles communication with the issue related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/ +// GitHub API docs: https://docs.github.com/en/rest/issues/ type IssuesService service // Issue represents a GitHub issue on a repository. @@ -54,7 +54,7 @@ type Issue struct { NodeID *string `json:"node_id,omitempty"` // TextMatches is only populated from search results that request text matches - // See: search.go and https://docs.github.com/en/free-pro-team@latest/rest/reference/search/#text-match-metadata + // See: search.go and https://docs.github.com/en/rest/search/#text-match-metadata TextMatches []*TextMatch `json:"text_matches,omitempty"` // ActiveLockReason is populated only when LockReason is provided while locking the issue. @@ -128,8 +128,8 @@ type PullRequestLinks struct { // organization repositories; if false, list only owned and member // repositories. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#list-user-account-issues-assigned-to-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#list-issues-assigned-to-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/issues/issues#list-user-account-issues-assigned-to-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/issues/issues#list-issues-assigned-to-the-authenticated-user func (s *IssuesService) List(ctx context.Context, all bool, opts *IssueListOptions) ([]*Issue, *Response, error) { var u string if all { @@ -143,7 +143,7 @@ func (s *IssuesService) List(ctx context.Context, all bool, opts *IssueListOptio // ListByOrg fetches the issues in the specified organization for the // authenticated user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#list-organization-issues-assigned-to-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/issues/issues#list-organization-issues-assigned-to-the-authenticated-user func (s *IssuesService) ListByOrg(ctx context.Context, org string, opts *IssueListOptions) ([]*Issue, *Response, error) { u := fmt.Sprintf("orgs/%v/issues", org) return s.listIssues(ctx, u, opts) @@ -214,7 +214,7 @@ type IssueListByRepoOptions struct { // ListByRepo lists the issues for the specified repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#list-repository-issues +// GitHub API docs: https://docs.github.com/en/rest/issues/issues#list-repository-issues func (s *IssuesService) ListByRepo(ctx context.Context, owner string, repo string, opts *IssueListByRepoOptions) ([]*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues", owner, repo) u, err := addOptions(u, opts) @@ -241,7 +241,7 @@ func (s *IssuesService) ListByRepo(ctx context.Context, owner string, repo strin // Get a single issue. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#get-an-issue +// GitHub API docs: https://docs.github.com/en/rest/issues/issues#get-an-issue func (s *IssuesService) Get(ctx context.Context, owner string, repo string, number int) (*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d", owner, repo, number) req, err := s.client.NewRequest("GET", u, nil) @@ -263,7 +263,7 @@ func (s *IssuesService) Get(ctx context.Context, owner string, repo string, numb // Create a new issue on the specified repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#create-an-issue +// GitHub API docs: https://docs.github.com/en/rest/issues/issues#create-an-issue func (s *IssuesService) Create(ctx context.Context, owner string, repo string, issue *IssueRequest) (*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues", owner, repo) req, err := s.client.NewRequest("POST", u, issue) @@ -280,9 +280,9 @@ func (s *IssuesService) Create(ctx context.Context, owner string, repo string, i return i, resp, nil } -// Edit an issue. +// Edit (update) an issue. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#update-an-issue +// GitHub API docs: https://docs.github.com/en/rest/issues/issues#update-an-issue func (s *IssuesService) Edit(ctx context.Context, owner string, repo string, number int, issue *IssueRequest) (*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d", owner, repo, number) req, err := s.client.NewRequest("PATCH", u, issue) @@ -303,7 +303,7 @@ func (s *IssuesService) Edit(ctx context.Context, owner string, repo string, num // // This is a helper method to explicitly update an issue with a `null` milestone, thereby removing it. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#update-an-issue +// GitHub API docs: https://docs.github.com/en/rest/issues/issues#update-an-issue func (s *IssuesService) RemoveMilestone(ctx context.Context, owner, repo string, issueNumber int) (*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v", owner, repo, issueNumber) req, err := s.client.NewRequest("PATCH", u, &struct { @@ -333,7 +333,7 @@ type LockIssueOptions struct { // Lock an issue's conversation. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#lock-an-issue +// GitHub API docs: https://docs.github.com/en/rest/issues/issues#lock-an-issue func (s *IssuesService) Lock(ctx context.Context, owner string, repo string, number int, opts *LockIssueOptions) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/lock", owner, repo, number) req, err := s.client.NewRequest("PUT", u, opts) @@ -346,7 +346,7 @@ func (s *IssuesService) Lock(ctx context.Context, owner string, repo string, num // Unlock an issue's conversation. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#unlock-an-issue +// GitHub API docs: https://docs.github.com/en/rest/issues/issues#unlock-an-issue func (s *IssuesService) Unlock(ctx context.Context, owner string, repo string, number int) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/lock", owner, repo, number) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/issues_assignees.go b/github/issues_assignees.go index 34e0bb506f2..b7f2e802437 100644 --- a/github/issues_assignees.go +++ b/github/issues_assignees.go @@ -13,7 +13,7 @@ import ( // ListAssignees fetches all available assignees (owners and collaborators) to // which issues may be assigned. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#list-assignees +// GitHub API docs: https://docs.github.com/en/rest/issues/assignees#list-assignees func (s *IssuesService) ListAssignees(ctx context.Context, owner, repo string, opts *ListOptions) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%v/%v/assignees", owner, repo) u, err := addOptions(u, opts) @@ -37,7 +37,7 @@ func (s *IssuesService) ListAssignees(ctx context.Context, owner, repo string, o // IsAssignee checks if a user is an assignee for the specified repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#check-if-a-user-can-be-assigned +// GitHub API docs: https://docs.github.com/en/rest/issues/assignees#check-if-a-user-can-be-assigned func (s *IssuesService) IsAssignee(ctx context.Context, owner, repo, user string) (bool, *Response, error) { u := fmt.Sprintf("repos/%v/%v/assignees/%v", owner, repo, user) req, err := s.client.NewRequest("GET", u, nil) @@ -52,7 +52,7 @@ func (s *IssuesService) IsAssignee(ctx context.Context, owner, repo, user string // AddAssignees adds the provided GitHub users as assignees to the issue. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#add-assignees-to-an-issue +// GitHub API docs: https://docs.github.com/en/rest/issues/assignees#add-assignees-to-an-issue func (s *IssuesService) AddAssignees(ctx context.Context, owner, repo string, number int, assignees []string) (*Issue, *Response, error) { users := &struct { Assignees []string `json:"assignees,omitempty"` @@ -74,7 +74,7 @@ func (s *IssuesService) AddAssignees(ctx context.Context, owner, repo string, nu // RemoveAssignees removes the provided GitHub users as assignees from the issue. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#remove-assignees-from-an-issue +// GitHub API docs: https://docs.github.com/en/rest/issues/assignees#remove-assignees-from-an-issue func (s *IssuesService) RemoveAssignees(ctx context.Context, owner, repo string, number int, assignees []string) (*Issue, *Response, error) { users := &struct { Assignees []string `json:"assignees,omitempty"` diff --git a/github/issues_comments.go b/github/issues_comments.go index 6dd6d13287c..361ee49a690 100644 --- a/github/issues_comments.go +++ b/github/issues_comments.go @@ -50,8 +50,8 @@ type IssueListCommentsOptions struct { // ListComments lists all comments on the specified issue. Specifying an issue // number of 0 will return all comments on all issues for the repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#list-issue-comments -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#list-issue-comments-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/issues/comments#list-issue-comments +// GitHub API docs: https://docs.github.com/en/rest/issues/comments#list-issue-comments-for-a-repository func (s *IssuesService) ListComments(ctx context.Context, owner string, repo string, number int, opts *IssueListCommentsOptions) ([]*IssueComment, *Response, error) { var u string if number == 0 { @@ -83,7 +83,7 @@ func (s *IssuesService) ListComments(ctx context.Context, owner string, repo str // GetComment fetches the specified issue comment. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#get-an-issue-comment +// GitHub API docs: https://docs.github.com/en/rest/issues/comments#get-an-issue-comment func (s *IssuesService) GetComment(ctx context.Context, owner string, repo string, commentID int64) (*IssueComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%d", owner, repo, commentID) @@ -106,7 +106,7 @@ func (s *IssuesService) GetComment(ctx context.Context, owner string, repo strin // CreateComment creates a new comment on the specified issue. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#create-an-issue-comment +// GitHub API docs: https://docs.github.com/en/rest/issues/comments#create-an-issue-comment func (s *IssuesService) CreateComment(ctx context.Context, owner string, repo string, number int, comment *IssueComment) (*IssueComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/comments", owner, repo, number) req, err := s.client.NewRequest("POST", u, comment) @@ -125,7 +125,7 @@ func (s *IssuesService) CreateComment(ctx context.Context, owner string, repo st // EditComment updates an issue comment. // A non-nil comment.Body must be provided. Other comment fields should be left nil. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#update-an-issue-comment +// GitHub API docs: https://docs.github.com/en/rest/issues/comments#update-an-issue-comment func (s *IssuesService) EditComment(ctx context.Context, owner string, repo string, commentID int64, comment *IssueComment) (*IssueComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%d", owner, repo, commentID) req, err := s.client.NewRequest("PATCH", u, comment) @@ -143,7 +143,7 @@ func (s *IssuesService) EditComment(ctx context.Context, owner string, repo stri // DeleteComment deletes an issue comment. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#delete-an-issue-comment +// GitHub API docs: https://docs.github.com/en/rest/issues/comments#delete-an-issue-comment func (s *IssuesService) DeleteComment(ctx context.Context, owner string, repo string, commentID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%d", owner, repo, commentID) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/issues_events.go b/github/issues_events.go index 384779cfed8..d8ffc0b5420 100644 --- a/github/issues_events.go +++ b/github/issues_events.go @@ -100,7 +100,7 @@ type DismissedReview struct { // ListIssueEvents lists events for the specified issue. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#list-issue-events +// GitHub API docs: https://docs.github.com/en/rest/issues/events#list-issue-events func (s *IssuesService) ListIssueEvents(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*IssueEvent, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/events", owner, repo, number) u, err := addOptions(u, opts) @@ -126,7 +126,7 @@ func (s *IssuesService) ListIssueEvents(ctx context.Context, owner, repo string, // ListRepositoryEvents lists events for the specified repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#list-issue-events-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/issues/events#list-issue-events-for-a-repository func (s *IssuesService) ListRepositoryEvents(ctx context.Context, owner, repo string, opts *ListOptions) ([]*IssueEvent, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/events", owner, repo) u, err := addOptions(u, opts) @@ -150,7 +150,7 @@ func (s *IssuesService) ListRepositoryEvents(ctx context.Context, owner, repo st // GetEvent returns the specified issue event. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#get-an-issue-event +// GitHub API docs: https://docs.github.com/en/rest/issues/events#get-an-issue-event func (s *IssuesService) GetEvent(ctx context.Context, owner, repo string, id int64) (*IssueEvent, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/events/%v", owner, repo, id) diff --git a/github/issues_labels.go b/github/issues_labels.go index 40f069a9d1c..d0f865c03f1 100644 --- a/github/issues_labels.go +++ b/github/issues_labels.go @@ -27,7 +27,7 @@ func (l Label) String() string { // ListLabels lists all labels for a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#list-labels-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/issues/labels#list-labels-for-a-repository func (s *IssuesService) ListLabels(ctx context.Context, owner string, repo string, opts *ListOptions) ([]*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/labels", owner, repo) u, err := addOptions(u, opts) @@ -51,7 +51,7 @@ func (s *IssuesService) ListLabels(ctx context.Context, owner string, repo strin // GetLabel gets a single label. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#get-a-label +// GitHub API docs: https://docs.github.com/en/rest/issues/labels#get-a-label func (s *IssuesService) GetLabel(ctx context.Context, owner string, repo string, name string) (*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/labels/%v", owner, repo, name) req, err := s.client.NewRequest("GET", u, nil) @@ -70,7 +70,7 @@ func (s *IssuesService) GetLabel(ctx context.Context, owner string, repo string, // CreateLabel creates a new label on the specified repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#create-a-label +// GitHub API docs: https://docs.github.com/en/rest/issues/labels#create-a-label func (s *IssuesService) CreateLabel(ctx context.Context, owner string, repo string, label *Label) (*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/labels", owner, repo) req, err := s.client.NewRequest("POST", u, label) @@ -89,7 +89,7 @@ func (s *IssuesService) CreateLabel(ctx context.Context, owner string, repo stri // EditLabel edits a label. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#update-a-label +// GitHub API docs: https://docs.github.com/en/rest/issues/labels#update-a-label func (s *IssuesService) EditLabel(ctx context.Context, owner string, repo string, name string, label *Label) (*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/labels/%v", owner, repo, name) req, err := s.client.NewRequest("PATCH", u, label) @@ -108,7 +108,7 @@ func (s *IssuesService) EditLabel(ctx context.Context, owner string, repo string // DeleteLabel deletes a label. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#delete-a-label +// GitHub API docs: https://docs.github.com/en/rest/issues/labels#delete-a-label func (s *IssuesService) DeleteLabel(ctx context.Context, owner string, repo string, name string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/labels/%v", owner, repo, name) req, err := s.client.NewRequest("DELETE", u, nil) @@ -120,7 +120,7 @@ func (s *IssuesService) DeleteLabel(ctx context.Context, owner string, repo stri // ListLabelsByIssue lists all labels for an issue. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#list-labels-for-an-issue +// GitHub API docs: https://docs.github.com/en/rest/issues/labels#list-labels-for-an-issue func (s *IssuesService) ListLabelsByIssue(ctx context.Context, owner string, repo string, number int, opts *ListOptions) ([]*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/labels", owner, repo, number) u, err := addOptions(u, opts) @@ -144,7 +144,7 @@ func (s *IssuesService) ListLabelsByIssue(ctx context.Context, owner string, rep // AddLabelsToIssue adds labels to an issue. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#add-labels-to-an-issue +// GitHub API docs: https://docs.github.com/en/rest/issues/labels#add-labels-to-an-issue func (s *IssuesService) AddLabelsToIssue(ctx context.Context, owner string, repo string, number int, labels []string) ([]*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/labels", owner, repo, number) req, err := s.client.NewRequest("POST", u, labels) @@ -163,7 +163,7 @@ func (s *IssuesService) AddLabelsToIssue(ctx context.Context, owner string, repo // RemoveLabelForIssue removes a label for an issue. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#remove-a-label-from-an-issue +// GitHub API docs: https://docs.github.com/en/rest/issues/labels#remove-a-label-from-an-issue func (s *IssuesService) RemoveLabelForIssue(ctx context.Context, owner string, repo string, number int, label string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/labels/%v", owner, repo, number, label) req, err := s.client.NewRequest("DELETE", u, nil) @@ -176,7 +176,7 @@ func (s *IssuesService) RemoveLabelForIssue(ctx context.Context, owner string, r // ReplaceLabelsForIssue replaces all labels for an issue. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#set-labels-for-an-issue +// GitHub API docs: https://docs.github.com/en/rest/issues/labels#set-labels-for-an-issue func (s *IssuesService) ReplaceLabelsForIssue(ctx context.Context, owner string, repo string, number int, labels []string) ([]*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/labels", owner, repo, number) req, err := s.client.NewRequest("PUT", u, labels) @@ -195,7 +195,7 @@ func (s *IssuesService) ReplaceLabelsForIssue(ctx context.Context, owner string, // RemoveLabelsForIssue removes all labels for an issue. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#remove-all-labels-from-an-issue +// GitHub API docs: https://docs.github.com/en/rest/issues/labels#remove-all-labels-from-an-issue func (s *IssuesService) RemoveLabelsForIssue(ctx context.Context, owner string, repo string, number int) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/labels", owner, repo, number) req, err := s.client.NewRequest("DELETE", u, nil) @@ -208,7 +208,7 @@ func (s *IssuesService) RemoveLabelsForIssue(ctx context.Context, owner string, // ListLabelsForMilestone lists labels for every issue in a milestone. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#list-labels-for-issues-in-a-milestone +// GitHub API docs: https://docs.github.com/en/rest/issues/labels#list-labels-for-issues-in-a-milestone func (s *IssuesService) ListLabelsForMilestone(ctx context.Context, owner string, repo string, number int, opts *ListOptions) ([]*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones/%d/labels", owner, repo, number) u, err := addOptions(u, opts) diff --git a/github/issues_milestones.go b/github/issues_milestones.go index f9b1f19335a..3c9be2407ee 100644 --- a/github/issues_milestones.go +++ b/github/issues_milestones.go @@ -55,7 +55,7 @@ type MilestoneListOptions struct { // ListMilestones lists all milestones for a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#list-milestones +// GitHub API docs: https://docs.github.com/en/rest/issues/milestones#list-milestones func (s *IssuesService) ListMilestones(ctx context.Context, owner string, repo string, opts *MilestoneListOptions) ([]*Milestone, *Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones", owner, repo) u, err := addOptions(u, opts) @@ -79,7 +79,7 @@ func (s *IssuesService) ListMilestones(ctx context.Context, owner string, repo s // GetMilestone gets a single milestone. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#get-a-milestone +// GitHub API docs: https://docs.github.com/en/rest/issues/milestones#get-a-milestone func (s *IssuesService) GetMilestone(ctx context.Context, owner string, repo string, number int) (*Milestone, *Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones/%d", owner, repo, number) req, err := s.client.NewRequest("GET", u, nil) @@ -98,7 +98,7 @@ func (s *IssuesService) GetMilestone(ctx context.Context, owner string, repo str // CreateMilestone creates a new milestone on the specified repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#create-a-milestone +// GitHub API docs: https://docs.github.com/en/rest/issues/milestones#create-a-milestone func (s *IssuesService) CreateMilestone(ctx context.Context, owner string, repo string, milestone *Milestone) (*Milestone, *Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones", owner, repo) req, err := s.client.NewRequest("POST", u, milestone) @@ -117,7 +117,7 @@ func (s *IssuesService) CreateMilestone(ctx context.Context, owner string, repo // EditMilestone edits a milestone. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#update-a-milestone +// GitHub API docs: https://docs.github.com/en/rest/issues/milestones#update-a-milestone func (s *IssuesService) EditMilestone(ctx context.Context, owner string, repo string, number int, milestone *Milestone) (*Milestone, *Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones/%d", owner, repo, number) req, err := s.client.NewRequest("PATCH", u, milestone) @@ -136,7 +136,7 @@ func (s *IssuesService) EditMilestone(ctx context.Context, owner string, repo st // DeleteMilestone deletes a milestone. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#delete-a-milestone +// GitHub API docs: https://docs.github.com/en/rest/issues/milestones#delete-a-milestone func (s *IssuesService) DeleteMilestone(ctx context.Context, owner string, repo string, number int) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones/%d", owner, repo, number) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/issues_timeline.go b/github/issues_timeline.go index d0ee0a78f2e..9ec498e45cc 100644 --- a/github/issues_timeline.go +++ b/github/issues_timeline.go @@ -161,7 +161,7 @@ type Source struct { // ListIssueTimeline lists events for the specified issue. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#list-timeline-events-for-an-issue +// GitHub API docs: https://docs.github.com/en/rest/issues/timeline#list-timeline-events-for-an-issue func (s *IssuesService) ListIssueTimeline(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*Timeline, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/timeline", owner, repo, number) u, err := addOptions(u, opts) diff --git a/github/licenses.go b/github/licenses.go index 85e36266174..0877b6d1831 100644 --- a/github/licenses.go +++ b/github/licenses.go @@ -13,7 +13,7 @@ import ( // LicensesService handles communication with the license related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/licenses/ +// GitHub API docs: https://docs.github.com/en/rest/licenses/ type LicensesService service // RepositoryLicense represents the license for a repository. @@ -60,7 +60,7 @@ func (l License) String() string { // List popular open source licenses. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/licenses/#list-all-licenses +// GitHub API docs: https://docs.github.com/en/rest/licenses/#list-all-licenses func (s *LicensesService) List(ctx context.Context) ([]*License, *Response, error) { req, err := s.client.NewRequest("GET", "licenses", nil) if err != nil { @@ -78,7 +78,7 @@ func (s *LicensesService) List(ctx context.Context) ([]*License, *Response, erro // Get extended metadata for one license. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/licenses/#get-a-license +// GitHub API docs: https://docs.github.com/en/rest/licenses#get-a-license func (s *LicensesService) Get(ctx context.Context, licenseName string) (*License, *Response, error) { u := fmt.Sprintf("licenses/%s", licenseName) diff --git a/github/migrations.go b/github/migrations.go index 7694021f1fb..67989c0789f 100644 --- a/github/migrations.go +++ b/github/migrations.go @@ -16,7 +16,7 @@ import ( // MigrationService provides access to the migration related functions // in the GitHub API. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/migration/ +// GitHub API docs: https://docs.github.com/en/rest/migration/ type MigrationService service // Migration represents a GitHub migration (archival). @@ -74,7 +74,7 @@ type startMigration struct { // StartMigration starts the generation of a migration archive. // repos is a slice of repository names to migrate. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/migrations/#start-an-organization-migration +// GitHub API docs: https://docs.github.com/en/rest/migrations/orgs#start-an-organization-migration func (s *MigrationService) StartMigration(ctx context.Context, org string, repos []string, opts *MigrationOptions) (*Migration, *Response, error) { u := fmt.Sprintf("orgs/%v/migrations", org) @@ -103,7 +103,7 @@ func (s *MigrationService) StartMigration(ctx context.Context, org string, repos // ListMigrations lists the most recent migrations. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/migrations/#list-organization-migrations +// GitHub API docs: https://docs.github.com/en/rest/migrations/orgs#list-organization-migrations func (s *MigrationService) ListMigrations(ctx context.Context, org string, opts *ListOptions) ([]*Migration, *Response, error) { u := fmt.Sprintf("orgs/%v/migrations", org) u, err := addOptions(u, opts) @@ -131,7 +131,7 @@ func (s *MigrationService) ListMigrations(ctx context.Context, org string, opts // MigrationStatus gets the status of a specific migration archive. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/migrations/#get-an-organization-migration-status +// GitHub API docs: https://docs.github.com/en/rest/migrations/orgs#get-an-organization-migration-status func (s *MigrationService) MigrationStatus(ctx context.Context, org string, id int64) (*Migration, *Response, error) { u := fmt.Sprintf("orgs/%v/migrations/%v", org, id) @@ -155,7 +155,7 @@ func (s *MigrationService) MigrationStatus(ctx context.Context, org string, id i // MigrationArchiveURL fetches a migration archive URL. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/migrations/#download-an-organization-migration-archive +// GitHub API docs: https://docs.github.com/en/rest/migrations/orgs#download-an-organization-migration-archive func (s *MigrationService) MigrationArchiveURL(ctx context.Context, org string, id int64) (url string, err error) { u := fmt.Sprintf("orgs/%v/migrations/%v/archive", org, id) @@ -192,7 +192,7 @@ func (s *MigrationService) MigrationArchiveURL(ctx context.Context, org string, // DeleteMigration deletes a previous migration archive. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/migrations/#delete-an-organization-migration-archive +// GitHub API docs: https://docs.github.com/en/rest/migrations/orgs#delete-an-organization-migration-archive func (s *MigrationService) DeleteMigration(ctx context.Context, org string, id int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/migrations/%v/archive", org, id) @@ -212,7 +212,7 @@ func (s *MigrationService) DeleteMigration(ctx context.Context, org string, id i // You should unlock each migrated repository and delete them when the migration // is complete and you no longer need the source data. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/migrations/#unlock-an-organization-repository +// GitHub API docs: https://docs.github.com/en/rest/migrations/orgs#unlock-an-organization-repository func (s *MigrationService) UnlockRepo(ctx context.Context, org string, id int64, repo string) (*Response, error) { u := fmt.Sprintf("orgs/%v/migrations/%v/repos/%v/lock", org, id, repo) diff --git a/github/migrations_source_import.go b/github/migrations_source_import.go index e34b3acdac9..74a04b22a4e 100644 --- a/github/migrations_source_import.go +++ b/github/migrations_source_import.go @@ -115,7 +115,7 @@ func (i Import) String() string { // SourceImportAuthor identifies an author imported from a source repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/migration/source_imports/#get-commit-authors +// GitHub API docs: https://docs.github.com/en/rest/migration/source_imports/#get-commit-authors type SourceImportAuthor struct { ID *int64 `json:"id,omitempty"` RemoteID *string `json:"remote_id,omitempty"` @@ -132,7 +132,7 @@ func (a SourceImportAuthor) String() string { // LargeFile identifies a file larger than 100MB found during a repository import. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/migration/source_imports/#get-large-files +// GitHub API docs: https://docs.github.com/en/rest/migration/source_imports/#get-large-files type LargeFile struct { RefName *string `json:"ref_name,omitempty"` Path *string `json:"path,omitempty"` @@ -146,7 +146,7 @@ func (f LargeFile) String() string { // StartImport initiates a repository import. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/migrations/#start-an-import +// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#start-an-import func (s *MigrationService) StartImport(ctx context.Context, owner, repo string, in *Import) (*Import, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import", owner, repo) req, err := s.client.NewRequest("PUT", u, in) @@ -165,7 +165,7 @@ func (s *MigrationService) StartImport(ctx context.Context, owner, repo string, // ImportProgress queries for the status and progress of an ongoing repository import. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/migrations/#get-an-import-status +// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#get-an-import-status func (s *MigrationService) ImportProgress(ctx context.Context, owner, repo string) (*Import, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -184,7 +184,7 @@ func (s *MigrationService) ImportProgress(ctx context.Context, owner, repo strin // UpdateImport initiates a repository import. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/migrations/#update-an-import +// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#update-an-import func (s *MigrationService) UpdateImport(ctx context.Context, owner, repo string, in *Import) (*Import, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import", owner, repo) req, err := s.client.NewRequest("PATCH", u, in) @@ -213,7 +213,7 @@ func (s *MigrationService) UpdateImport(ctx context.Context, owner, repo string, // This method and MapCommitAuthor allow you to provide correct Git author // information. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/migrations/#get-commit-authors +// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#get-commit-authors func (s *MigrationService) CommitAuthors(ctx context.Context, owner, repo string) ([]*SourceImportAuthor, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/authors", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -234,7 +234,7 @@ func (s *MigrationService) CommitAuthors(ctx context.Context, owner, repo string // application can continue updating authors any time before you push new // commits to the repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/migrations/#map-a-commit-author +// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#map-a-commit-author func (s *MigrationService) MapCommitAuthor(ctx context.Context, owner, repo string, id int64, author *SourceImportAuthor) (*SourceImportAuthor, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/authors/%v", owner, repo, id) req, err := s.client.NewRequest("PATCH", u, author) @@ -255,7 +255,7 @@ func (s *MigrationService) MapCommitAuthor(ctx context.Context, owner, repo stri // files larger than 100MB. Only the UseLFS field on the provided Import is // used. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/migrations/#update-git-lfs-preference +// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#update-git-lfs-preference func (s *MigrationService) SetLFSPreference(ctx context.Context, owner, repo string, in *Import) (*Import, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/lfs", owner, repo) req, err := s.client.NewRequest("PATCH", u, in) @@ -274,7 +274,7 @@ func (s *MigrationService) SetLFSPreference(ctx context.Context, owner, repo str // LargeFiles lists files larger than 100MB found during the import. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/migrations/#get-large-files +// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#get-large-files func (s *MigrationService) LargeFiles(ctx context.Context, owner, repo string) ([]*LargeFile, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/large_files", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -293,7 +293,7 @@ func (s *MigrationService) LargeFiles(ctx context.Context, owner, repo string) ( // CancelImport stops an import for a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/migrations/#cancel-an-import +// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#cancel-an-import func (s *MigrationService) CancelImport(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/import", owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/migrations_user.go b/github/migrations_user.go index 5e8aaec5aa5..b8a0d608d63 100644 --- a/github/migrations_user.go +++ b/github/migrations_user.go @@ -67,7 +67,7 @@ type startUserMigration struct { // StartUserMigration starts the generation of a migration archive. // repos is a slice of repository names to migrate. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/migrations/#start-a-user-migration +// GitHub API docs: https://docs.github.com/en/rest/migrations/users#start-a-user-migration func (s *MigrationService) StartUserMigration(ctx context.Context, repos []string, opts *UserMigrationOptions) (*UserMigration, *Response, error) { u := "user/migrations" @@ -96,7 +96,7 @@ func (s *MigrationService) StartUserMigration(ctx context.Context, repos []strin // ListUserMigrations lists the most recent migrations. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/migrations/#list-user-migrations +// GitHub API docs: https://docs.github.com/en/rest/migrations/users#list-user-migrations func (s *MigrationService) ListUserMigrations(ctx context.Context) ([]*UserMigration, *Response, error) { u := "user/migrations" @@ -120,7 +120,7 @@ func (s *MigrationService) ListUserMigrations(ctx context.Context) ([]*UserMigra // UserMigrationStatus gets the status of a specific migration archive. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/migrations/#get-a-user-migration-status +// GitHub API docs: https://docs.github.com/en/rest/migrations/users#get-a-user-migration-status func (s *MigrationService) UserMigrationStatus(ctx context.Context, id int64) (*UserMigration, *Response, error) { u := fmt.Sprintf("user/migrations/%v", id) @@ -144,7 +144,7 @@ func (s *MigrationService) UserMigrationStatus(ctx context.Context, id int64) (* // UserMigrationArchiveURL gets the URL for a specific migration archive. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/migrations/#download-a-user-migration-archive +// GitHub API docs: https://docs.github.com/en/rest/migrations/users#download-a-user-migration-archive func (s *MigrationService) UserMigrationArchiveURL(ctx context.Context, id int64) (string, error) { url := fmt.Sprintf("user/migrations/%v/archive", id) @@ -178,7 +178,7 @@ func (s *MigrationService) UserMigrationArchiveURL(ctx context.Context, id int64 // DeleteUserMigration will delete a previous migration archive. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/migrations/#delete-a-user-migration-archive +// GitHub API docs: https://docs.github.com/en/rest/migrations/users#delete-a-user-migration-archive func (s *MigrationService) DeleteUserMigration(ctx context.Context, id int64) (*Response, error) { url := fmt.Sprintf("user/migrations/%v/archive", id) @@ -198,7 +198,7 @@ func (s *MigrationService) DeleteUserMigration(ctx context.Context, id int64) (* // You should unlock each migrated repository and delete them when the migration // is complete and you no longer need the source data. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/migrations/#unlock-a-user-repository +// GitHub API docs: https://docs.github.com/en/rest/migrations/users#unlock-a-user-repository func (s *MigrationService) UnlockUserRepo(ctx context.Context, id int64, repo string) (*Response, error) { url := fmt.Sprintf("user/migrations/%v/repos/%v/lock", id, repo) diff --git a/github/misc.go b/github/misc.go index 7672e08acc8..412d1e2b95d 100644 --- a/github/misc.go +++ b/github/misc.go @@ -39,7 +39,7 @@ type markdownRequest struct { // Markdown renders an arbitrary Markdown document. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/markdown/ +// GitHub API docs: https://docs.github.com/en/rest/markdown/ func (c *Client) Markdown(ctx context.Context, text string, opts *MarkdownOptions) (string, *Response, error) { request := &markdownRequest{Text: String(text)} if opts != nil { @@ -67,7 +67,7 @@ func (c *Client) Markdown(ctx context.Context, text string, opts *MarkdownOption // ListEmojis returns the emojis available to use on GitHub. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/emojis/ +// GitHub API docs: https://docs.github.com/en/rest/emojis/ func (c *Client) ListEmojis(ctx context.Context) (map[string]string, *Response, error) { req, err := c.NewRequest("GET", "emojis", nil) if err != nil { @@ -97,7 +97,7 @@ func (c *CodeOfConduct) String() string { // ListCodesOfConduct returns all codes of conduct. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/codes_of_conduct/#list-all-codes-of-conduct +// GitHub API docs: https://docs.github.com/en/rest/codes_of_conduct/#list-all-codes-of-conduct func (c *Client) ListCodesOfConduct(ctx context.Context) ([]*CodeOfConduct, *Response, error) { req, err := c.NewRequest("GET", "codes_of_conduct", nil) if err != nil { @@ -118,7 +118,7 @@ func (c *Client) ListCodesOfConduct(ctx context.Context) ([]*CodeOfConduct, *Res // GetCodeOfConduct returns an individual code of conduct. // -// https://docs.github.com/en/free-pro-team@latest/rest/reference/codes_of_conduct/#get-an-individual-code-of-conduct +// https://docs.github.com/en/rest/codes_of_conduct/#get-an-individual-code-of-conduct func (c *Client) GetCodeOfConduct(ctx context.Context, key string) (*CodeOfConduct, *Response, error) { u := fmt.Sprintf("codes_of_conduct/%s", key) req, err := c.NewRequest("GET", u, nil) @@ -182,7 +182,7 @@ type APIMeta struct { // this endpoint on your organization’s GitHub Enterprise installation, this // endpoint provides information about that installation. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/meta#get-github-meta-information +// GitHub API docs: https://docs.github.com/en/rest/meta#get-github-meta-information func (c *Client) APIMeta(ctx context.Context) (*APIMeta, *Response, error) { req, err := c.NewRequest("GET", "meta", nil) if err != nil { diff --git a/github/orgs.go b/github/orgs.go index 62f6ed241ca..80979db350c 100644 --- a/github/orgs.go +++ b/github/orgs.go @@ -14,7 +14,7 @@ import ( // OrganizationsService provides access to the organization related functions // in the GitHub API. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/ +// GitHub API docs: https://docs.github.com/en/rest/orgs/ type OrganizationsService service // Organization represents a GitHub organization account. @@ -132,7 +132,7 @@ type OrganizationsListOptions struct { // listing the next set of organizations, use the ID of the last-returned organization // as the opts.Since parameter for the next call. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/#list-organizations +// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#list-organizations func (s *OrganizationsService) ListAll(ctx context.Context, opts *OrganizationsListOptions) ([]*Organization, *Response, error) { u, err := addOptions("organizations", opts) if err != nil { @@ -155,8 +155,8 @@ func (s *OrganizationsService) ListAll(ctx context.Context, opts *OrganizationsL // List the organizations for a user. Passing the empty string will list // organizations for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/#list-organizations-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/#list-organizations-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#list-organizations-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#list-organizations-for-a-user func (s *OrganizationsService) List(ctx context.Context, user string, opts *ListOptions) ([]*Organization, *Response, error) { var u string if user != "" { @@ -185,7 +185,7 @@ func (s *OrganizationsService) List(ctx context.Context, user string, opts *List // Get fetches an organization by name. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/#get-an-organization +// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#get-an-organization func (s *OrganizationsService) Get(ctx context.Context, org string) (*Organization, *Response, error) { u := fmt.Sprintf("orgs/%v", org) req, err := s.client.NewRequest("GET", u, nil) @@ -226,7 +226,7 @@ func (s *OrganizationsService) GetByID(ctx context.Context, id int64) (*Organiza // Edit an organization. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/#update-an-organization +// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#update-an-organization func (s *OrganizationsService) Edit(ctx context.Context, name string, org *Organization) (*Organization, *Response, error) { u := fmt.Sprintf("orgs/%v", name) req, err := s.client.NewRequest("PATCH", u, org) @@ -248,7 +248,7 @@ func (s *OrganizationsService) Edit(ctx context.Context, name string, org *Organ // ListInstallations lists installations for an organization. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/#list-app-installations-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#list-app-installations-for-an-organization func (s *OrganizationsService) ListInstallations(ctx context.Context, org string, opts *ListOptions) (*OrganizationInstallations, *Response, error) { u := fmt.Sprintf("orgs/%v/installations", org) diff --git a/github/orgs_actions_allowed.go b/github/orgs_actions_allowed.go index 49bcb00f947..e3b35b1df1f 100644 --- a/github/orgs_actions_allowed.go +++ b/github/orgs_actions_allowed.go @@ -12,7 +12,7 @@ import ( // ActionsAllowed represents selected actions that are allowed. // -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#set-allowed-actions-and-workflows-for-an-organization--parameters +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions type ActionsAllowed struct { GithubOwnedAllowed *bool `json:"github_owned_allowed,omitempty"` VerifiedAllowed *bool `json:"verified_allowed,omitempty"` @@ -25,7 +25,7 @@ func (a ActionsAllowed) String() string { // GetActionsAllowed gets the actions that are allowed in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#get-allowed-actions-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization func (s *OrganizationsService) GetActionsAllowed(ctx context.Context, org string) (*ActionsAllowed, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/selected-actions", org) @@ -45,7 +45,7 @@ func (s *OrganizationsService) GetActionsAllowed(ctx context.Context, org string // EditActionsAllowed sets the actions that are allowed in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#set-allowed-actions-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-organization func (s *OrganizationsService) EditActionsAllowed(ctx context.Context, org string, actionsAllowed ActionsAllowed) (*ActionsAllowed, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/selected-actions", org) req, err := s.client.NewRequest("PUT", u, actionsAllowed) diff --git a/github/orgs_actions_permissions.go b/github/orgs_actions_permissions.go index fc1fe313612..6d1db2ee0a3 100644 --- a/github/orgs_actions_permissions.go +++ b/github/orgs_actions_permissions.go @@ -12,7 +12,7 @@ import ( // ActionsPermissions represents a policy for repositories and allowed actions in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#permissions +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions type ActionsPermissions struct { EnabledRepositories *string `json:"enabled_repositories,omitempty"` AllowedActions *string `json:"allowed_actions,omitempty"` @@ -25,7 +25,7 @@ func (a ActionsPermissions) String() string { // GetActionsPermissions gets the GitHub Actions permissions policy for repositories and allowed actions in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#get-github-actions-permissions-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#get-github-actions-permissions-for-an-organization func (s *OrganizationsService) GetActionsPermissions(ctx context.Context, org string) (*ActionsPermissions, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions", org) @@ -45,7 +45,7 @@ func (s *OrganizationsService) GetActionsPermissions(ctx context.Context, org st // EditActionsPermissions sets the permissions policy for repositories and allowed actions in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#set-github-actions-permissions-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-github-actions-permissions-for-an-organization func (s *OrganizationsService) EditActionsPermissions(ctx context.Context, org string, actionsPermissions ActionsPermissions) (*ActionsPermissions, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions", org) req, err := s.client.NewRequest("PUT", u, actionsPermissions) diff --git a/github/orgs_audit_log.go b/github/orgs_audit_log.go index ade57f54113..52bacfed9a2 100644 --- a/github/orgs_audit_log.go +++ b/github/orgs_audit_log.go @@ -93,7 +93,7 @@ type AuditEntry struct { // GetAuditLog gets the audit-log entries for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/reference/orgs#get-the-audit-log-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#get-the-audit-log-for-an-organization func (s *OrganizationsService) GetAuditLog(ctx context.Context, org string, opts *GetAuditLogOptions) ([]*AuditEntry, *Response, error) { u := fmt.Sprintf("orgs/%v/audit-log", org) u, err := addOptions(u, opts) diff --git a/github/orgs_custom_roles.go b/github/orgs_custom_roles.go index d320a905147..9904685b948 100644 --- a/github/orgs_custom_roles.go +++ b/github/orgs_custom_roles.go @@ -27,7 +27,7 @@ type CustomRepoRoles struct { // ListCustomRepoRoles lists the custom repository roles available in this organization. // In order to see custom repository roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/custom-roles +// GitHub API docs: https://docs.github.com/en/rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization func (s *OrganizationsService) ListCustomRepoRoles(ctx context.Context, org string) (*OrganizationCustomRepoRoles, *Response, error) { u := fmt.Sprintf("orgs/%v/custom_roles", org) diff --git a/github/orgs_hooks.go b/github/orgs_hooks.go index 26687e565bc..c0dd51e24e3 100644 --- a/github/orgs_hooks.go +++ b/github/orgs_hooks.go @@ -12,7 +12,7 @@ import ( // ListHooks lists all Hooks for the specified organization. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/#list-organization-webhooks +// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#list-organization-webhooks func (s *OrganizationsService) ListHooks(ctx context.Context, org string, opts *ListOptions) ([]*Hook, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks", org) u, err := addOptions(u, opts) @@ -36,7 +36,7 @@ func (s *OrganizationsService) ListHooks(ctx context.Context, org string, opts * // GetHook returns a single specified Hook. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/#get-an-organization-webhook +// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#get-an-organization-webhook func (s *OrganizationsService) GetHook(ctx context.Context, org string, id int64) (*Hook, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%d", org, id) req, err := s.client.NewRequest("GET", u, nil) @@ -59,7 +59,7 @@ func (s *OrganizationsService) GetHook(ctx context.Context, org string, id int64 // Note that only a subset of the hook fields are used and hook must // not be nil. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/#create-an-organization-webhook +// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#create-an-organization-webhook func (s *OrganizationsService) CreateHook(ctx context.Context, org string, hook *Hook) (*Hook, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks", org) @@ -86,7 +86,7 @@ func (s *OrganizationsService) CreateHook(ctx context.Context, org string, hook // EditHook updates a specified Hook. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/#update-an-organization-webhook +// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#update-an-organization-webhook func (s *OrganizationsService) EditHook(ctx context.Context, org string, id int64, hook *Hook) (*Hook, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%d", org, id) req, err := s.client.NewRequest("PATCH", u, hook) @@ -105,7 +105,7 @@ func (s *OrganizationsService) EditHook(ctx context.Context, org string, id int6 // PingHook triggers a 'ping' event to be sent to the Hook. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/#ping-an-organization-webhook +// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#ping-an-organization-webhook func (s *OrganizationsService) PingHook(ctx context.Context, org string, id int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%d/pings", org, id) req, err := s.client.NewRequest("POST", u, nil) @@ -118,7 +118,7 @@ func (s *OrganizationsService) PingHook(ctx context.Context, org string, id int6 // DeleteHook deletes a specified Hook. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/#delete-an-organization-webhook +// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#delete-an-organization-webhook func (s *OrganizationsService) DeleteHook(ctx context.Context, org string, id int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%d", org, id) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/orgs_hooks_deliveries.go b/github/orgs_hooks_deliveries.go index d1fb5c832a0..1bfad409ea5 100644 --- a/github/orgs_hooks_deliveries.go +++ b/github/orgs_hooks_deliveries.go @@ -12,7 +12,7 @@ import ( // ListHookDeliveries lists webhook deliveries for a webhook configured in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/reference/orgs#list-deliveries-for-an-organization-webhook +// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#list-deliveries-for-an-organization-webhook func (s *OrganizationsService) ListHookDeliveries(ctx context.Context, org string, id int64, opts *ListCursorOptions) ([]*HookDelivery, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%v/deliveries", org, id) u, err := addOptions(u, opts) @@ -36,7 +36,7 @@ func (s *OrganizationsService) ListHookDeliveries(ctx context.Context, org strin // GetHookDelivery returns a delivery for a webhook configured in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/reference/orgs#get-a-webhook-delivery-for-an-organization-webhook +// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#get-a-webhook-delivery-for-an-organization-webhook func (s *OrganizationsService) GetHookDelivery(ctx context.Context, owner string, hookID, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%v/deliveries/%v", owner, hookID, deliveryID) req, err := s.client.NewRequest("GET", u, nil) @@ -55,7 +55,7 @@ func (s *OrganizationsService) GetHookDelivery(ctx context.Context, owner string // RedeliverHookDelivery redelivers a delivery for a webhook configured in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/reference/orgs#redeliver-a-delivery-for-an-organization-webhook +// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#redeliver-a-delivery-for-an-organization-webhook func (s *OrganizationsService) RedeliverHookDelivery(ctx context.Context, owner string, hookID, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%v/deliveries/%v/attempts", owner, hookID, deliveryID) req, err := s.client.NewRequest("POST", u, nil) diff --git a/github/orgs_members.go b/github/orgs_members.go index dd4845441ff..38f43bad5a7 100644 --- a/github/orgs_members.go +++ b/github/orgs_members.go @@ -71,8 +71,8 @@ type ListMembersOptions struct { // user is an owner of the organization, this will return both concealed and // public members, otherwise it will only return public members. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/#list-organization-members -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/#list-public-organization-members +// GitHub API docs: https://docs.github.com/en/rest/orgs/members#list-organization-members +// GitHub API docs: https://docs.github.com/en/rest/orgs/members#list-public-organization-members func (s *OrganizationsService) ListMembers(ctx context.Context, org string, opts *ListMembersOptions) ([]*User, *Response, error) { var u string if opts != nil && opts.PublicOnly { @@ -101,7 +101,7 @@ func (s *OrganizationsService) ListMembers(ctx context.Context, org string, opts // IsMember checks if a user is a member of an organization. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/#check-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/orgs/members#check-organization-membership-for-a-user func (s *OrganizationsService) IsMember(ctx context.Context, org, user string) (bool, *Response, error) { u := fmt.Sprintf("orgs/%v/members/%v", org, user) req, err := s.client.NewRequest("GET", u, nil) @@ -116,7 +116,7 @@ func (s *OrganizationsService) IsMember(ctx context.Context, org, user string) ( // IsPublicMember checks if a user is a public member of an organization. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/#check-public-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/orgs/members#check-public-organization-membership-for-a-user func (s *OrganizationsService) IsPublicMember(ctx context.Context, org, user string) (bool, *Response, error) { u := fmt.Sprintf("orgs/%v/public_members/%v", org, user) req, err := s.client.NewRequest("GET", u, nil) @@ -131,7 +131,7 @@ func (s *OrganizationsService) IsPublicMember(ctx context.Context, org, user str // RemoveMember removes a user from all teams of an organization. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/#remove-an-organization-member +// GitHub API docs: https://docs.github.com/en/rest/orgs/members#remove-an-organization-member func (s *OrganizationsService) RemoveMember(ctx context.Context, org, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/members/%v", org, user) req, err := s.client.NewRequest("DELETE", u, nil) @@ -145,7 +145,7 @@ func (s *OrganizationsService) RemoveMember(ctx context.Context, org, user strin // PublicizeMembership publicizes a user's membership in an organization. (A // user cannot publicize the membership for another user.) // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/#set-public-organization-membership-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/orgs/members#set-public-organization-membership-for-the-authenticated-user func (s *OrganizationsService) PublicizeMembership(ctx context.Context, org, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/public_members/%v", org, user) req, err := s.client.NewRequest("PUT", u, nil) @@ -158,7 +158,7 @@ func (s *OrganizationsService) PublicizeMembership(ctx context.Context, org, use // ConcealMembership conceals a user's membership in an organization. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/#remove-public-organization-membership-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/orgs/members#remove-public-organization-membership-for-the-authenticated-user func (s *OrganizationsService) ConcealMembership(ctx context.Context, org, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/public_members/%v", org, user) req, err := s.client.NewRequest("DELETE", u, nil) @@ -181,7 +181,7 @@ type ListOrgMembershipsOptions struct { // ListOrgMemberships lists the organization memberships for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/#list-organization-memberships-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/orgs/members#list-organization-memberships-for-the-authenticated-user func (s *OrganizationsService) ListOrgMemberships(ctx context.Context, opts *ListOrgMembershipsOptions) ([]*Membership, *Response, error) { u := "user/memberships/orgs" u, err := addOptions(u, opts) @@ -207,8 +207,8 @@ func (s *OrganizationsService) ListOrgMemberships(ctx context.Context, opts *Lis // Passing an empty string for user will get the membership for the // authenticated user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/#get-an-organization-membership-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/#get-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/orgs/members#get-an-organization-membership-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/orgs/members#get-organization-membership-for-a-user func (s *OrganizationsService) GetOrgMembership(ctx context.Context, user, org string) (*Membership, *Response, error) { var u string if user != "" { @@ -235,8 +235,8 @@ func (s *OrganizationsService) GetOrgMembership(ctx context.Context, user, org s // Passing an empty string for user will edit the membership for the // authenticated user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/#update-an-organization-membership-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/#set-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/orgs/members#update-an-organization-membership-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/orgs/members#set-organization-membership-for-a-user func (s *OrganizationsService) EditOrgMembership(ctx context.Context, user, org string, membership *Membership) (*Membership, *Response, error) { var u, method string if user != "" { @@ -264,7 +264,7 @@ func (s *OrganizationsService) EditOrgMembership(ctx context.Context, user, org // RemoveOrgMembership removes user from the specified organization. If the // user has been invited to the organization, this will cancel their invitation. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/#remove-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/orgs/members#remove-organization-membership-for-a-user func (s *OrganizationsService) RemoveOrgMembership(ctx context.Context, user, org string) (*Response, error) { u := fmt.Sprintf("orgs/%v/memberships/%v", org, user) req, err := s.client.NewRequest("DELETE", u, nil) @@ -277,7 +277,7 @@ func (s *OrganizationsService) RemoveOrgMembership(ctx context.Context, user, or // ListPendingOrgInvitations returns a list of pending invitations. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/#list-pending-organization-invitations +// GitHub API docs: https://docs.github.com/en/rest/orgs/members#list-pending-organization-invitations func (s *OrganizationsService) ListPendingOrgInvitations(ctx context.Context, org string, opts *ListOptions) ([]*Invitation, *Response, error) { u := fmt.Sprintf("orgs/%v/invitations", org) u, err := addOptions(u, opts) @@ -323,7 +323,7 @@ type CreateOrgInvitationOptions struct { // In order to create invitations in an organization, // the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/#create-an-organization-invitation +// GitHub API docs: https://docs.github.com/en/rest/orgs/members#create-an-organization-invitation func (s *OrganizationsService) CreateOrgInvitation(ctx context.Context, org string, opts *CreateOrgInvitationOptions) (*Invitation, *Response, error) { u := fmt.Sprintf("orgs/%v/invitations", org) @@ -344,7 +344,7 @@ func (s *OrganizationsService) CreateOrgInvitation(ctx context.Context, org stri // ListOrgInvitationTeams lists all teams associated with an invitation. In order to see invitations in an organization, // the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/#list-organization-invitation-teams +// GitHub API docs: https://docs.github.com/en/rest/orgs/members#list-organization-invitation-teams func (s *OrganizationsService) ListOrgInvitationTeams(ctx context.Context, org, invitationID string, opts *ListOptions) ([]*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/invitations/%v/teams", org, invitationID) u, err := addOptions(u, opts) @@ -368,7 +368,7 @@ func (s *OrganizationsService) ListOrgInvitationTeams(ctx context.Context, org, // ListFailedOrgInvitations returns a list of failed inviatations. // -// GitHub API docs: https://docs.github.com/en/rest/reference/orgs#list-failed-organization-invitations +// GitHub API docs: https://docs.github.com/en/rest/orgs/members#list-failed-organization-invitations func (s *OrganizationsService) ListFailedOrgInvitations(ctx context.Context, org string, opts *ListOptions) ([]*Invitation, *Response, error) { u := fmt.Sprintf("orgs/%v/failed_invitations", org) u, err := addOptions(u, opts) diff --git a/github/orgs_outside_collaborators.go b/github/orgs_outside_collaborators.go index d9ffd25a5fd..506a4946034 100644 --- a/github/orgs_outside_collaborators.go +++ b/github/orgs_outside_collaborators.go @@ -27,7 +27,7 @@ type ListOutsideCollaboratorsOptions struct { // Warning: The API may change without advance notice during the preview period. // Preview features are not supported for production use. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/#list-outside-collaborators-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/orgs/outside-collaborators#list-outside-collaborators-for-an-organization func (s *OrganizationsService) ListOutsideCollaborators(ctx context.Context, org string, opts *ListOutsideCollaboratorsOptions) ([]*User, *Response, error) { u := fmt.Sprintf("orgs/%v/outside_collaborators", org) u, err := addOptions(u, opts) @@ -52,7 +52,7 @@ func (s *OrganizationsService) ListOutsideCollaborators(ctx context.Context, org // RemoveOutsideCollaborator removes a user from the list of outside collaborators; // consequently, removing them from all the organization's repositories. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/#remove-outside-collaborator-from-an-organization +// GitHub API docs: https://docs.github.com/en/rest/orgs/outside-collaborators#remove-outside-collaborator-from-an-organization func (s *OrganizationsService) RemoveOutsideCollaborator(ctx context.Context, org string, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/outside_collaborators/%v", org, user) req, err := s.client.NewRequest("DELETE", u, nil) @@ -69,7 +69,7 @@ func (s *OrganizationsService) RemoveOutsideCollaborator(ctx context.Context, or // Responses for converting a non-member or the last owner to an outside collaborator // are listed in GitHub API docs. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/#convert-an-organization-member-to-outside-collaborator +// GitHub API docs: https://docs.github.com/en/rest/orgs/outside-collaborators#convert-an-organization-member-to-outside-collaborator func (s *OrganizationsService) ConvertMemberToOutsideCollaborator(ctx context.Context, org string, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/outside_collaborators/%v", org, user) req, err := s.client.NewRequest("PUT", u, nil) diff --git a/github/orgs_packages.go b/github/orgs_packages.go index 0c36f21cae2..9fb11308b8c 100644 --- a/github/orgs_packages.go +++ b/github/orgs_packages.go @@ -12,7 +12,7 @@ import ( // List the packages for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/reference/packages#list-packages-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/packages#list-packages-for-an-organization func (s *OrganizationsService) ListPackages(ctx context.Context, org string, opts *PackageListOptions) ([]*Package, *Response, error) { u := fmt.Sprintf("orgs/%v/packages", org) u, err := addOptions(u, opts) @@ -36,7 +36,7 @@ func (s *OrganizationsService) ListPackages(ctx context.Context, org string, opt // Get a package by name from an organization. // -// GitHub API docs: https://docs.github.com/en/rest/reference/packages#get-a-package-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/packages#get-a-package-for-an-organization func (s *OrganizationsService) GetPackage(ctx context.Context, org, packageType, packageName string) (*Package, *Response, error) { u := fmt.Sprintf("orgs/%v/packages/%v/%v", org, packageType, packageName) req, err := s.client.NewRequest("GET", u, nil) @@ -55,7 +55,7 @@ func (s *OrganizationsService) GetPackage(ctx context.Context, org, packageType, // Delete a package from an organization. // -// GitHub API docs: https://docs.github.com/en/rest/reference/packages#delete-a-package-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/packages#delete-a-package-for-an-organization func (s *OrganizationsService) DeletePackage(ctx context.Context, org, packageType, packageName string) (*Response, error) { u := fmt.Sprintf("orgs/%v/packages/%v/%v", org, packageType, packageName) req, err := s.client.NewRequest("DELETE", u, nil) @@ -68,7 +68,7 @@ func (s *OrganizationsService) DeletePackage(ctx context.Context, org, packageTy // Restore a package to an organization. // -// GitHub API docs: https://docs.github.com/en/rest/reference/packages#restore-a-package-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/packages#restore-a-package-for-an-organization func (s *OrganizationsService) RestorePackage(ctx context.Context, org, packageType, packageName string) (*Response, error) { u := fmt.Sprintf("orgs/%v/packages/%v/%v/restore", org, packageType, packageName) req, err := s.client.NewRequest("POST", u, nil) @@ -81,7 +81,7 @@ func (s *OrganizationsService) RestorePackage(ctx context.Context, org, packageT // Get all versions of a package in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/reference/packages#get-all-package-versions-for-a-package-owned-by-an-organization +// GitHub API docs: https://docs.github.com/en/rest/packages#get-all-package-versions-for-a-package-owned-by-an-organization func (s *OrganizationsService) PackageGetAllVersions(ctx context.Context, org, packageType, packageName string, opts *PackageListOptions) ([]*PackageVersion, *Response, error) { u := fmt.Sprintf("orgs/%v/packages/%v/%v/versions", org, packageType, packageName) u, err := addOptions(u, opts) @@ -105,7 +105,7 @@ func (s *OrganizationsService) PackageGetAllVersions(ctx context.Context, org, p // Get a specific version of a package in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/reference/packages#get-a-package-version-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/packages#get-a-package-version-for-an-organization func (s *OrganizationsService) PackageGetVersion(ctx context.Context, org, packageType, packageName string, packageVersionID int64) (*PackageVersion, *Response, error) { u := fmt.Sprintf("orgs/%v/packages/%v/%v/versions/%v", org, packageType, packageName, packageVersionID) req, err := s.client.NewRequest("GET", u, nil) @@ -124,7 +124,7 @@ func (s *OrganizationsService) PackageGetVersion(ctx context.Context, org, packa // Delete a package version from an organization. // -// GitHub API docs: https://docs.github.com/en/rest/reference/packages#delete-package-version-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/packages#delete-package-version-for-an-organization func (s *OrganizationsService) PackageDeleteVersion(ctx context.Context, org, packageType, packageName string, packageVersionID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/packages/%v/%v/versions/%v", org, packageType, packageName, packageVersionID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -137,7 +137,7 @@ func (s *OrganizationsService) PackageDeleteVersion(ctx context.Context, org, pa // Restore a package version to an organization. // -// GitHub API docs: https://docs.github.com/en/rest/reference/packages#restore-package-version-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/packages#restore-package-version-for-an-organization func (s *OrganizationsService) PackageRestoreVersion(ctx context.Context, org, packageType, packageName string, packageVersionID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/packages/%v/%v/versions/%v/restore", org, packageType, packageName, packageVersionID) req, err := s.client.NewRequest("POST", u, nil) diff --git a/github/orgs_projects.go b/github/orgs_projects.go index b0c60ecb9e4..d49eae54dce 100644 --- a/github/orgs_projects.go +++ b/github/orgs_projects.go @@ -12,7 +12,7 @@ import ( // ListProjects lists the projects for an organization. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/projects/#list-organization-projects +// GitHub API docs: https://docs.github.com/en/rest/projects/projects#list-organization-projects func (s *OrganizationsService) ListProjects(ctx context.Context, org string, opts *ProjectListOptions) ([]*Project, *Response, error) { u := fmt.Sprintf("orgs/%v/projects", org) u, err := addOptions(u, opts) @@ -39,7 +39,7 @@ func (s *OrganizationsService) ListProjects(ctx context.Context, org string, opt // CreateProject creates a GitHub Project for the specified organization. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/projects/#create-an-organization-project +// GitHub API docs: https://docs.github.com/en/rest/projects/projects#create-an-organization-project func (s *OrganizationsService) CreateProject(ctx context.Context, org string, opts *ProjectOptions) (*Project, *Response, error) { u := fmt.Sprintf("orgs/%v/projects", org) req, err := s.client.NewRequest("POST", u, opts) diff --git a/github/orgs_users_blocking.go b/github/orgs_users_blocking.go index 2773344c9f3..9c6cf60269e 100644 --- a/github/orgs_users_blocking.go +++ b/github/orgs_users_blocking.go @@ -12,7 +12,7 @@ import ( // ListBlockedUsers lists all the users blocked by an organization. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/#list-users-blocked-by-an-organization +// GitHub API docs: https://docs.github.com/en/rest/orgs/blocking#list-users-blocked-by-an-organization func (s *OrganizationsService) ListBlockedUsers(ctx context.Context, org string, opts *ListOptions) ([]*User, *Response, error) { u := fmt.Sprintf("orgs/%v/blocks", org) u, err := addOptions(u, opts) @@ -39,7 +39,7 @@ func (s *OrganizationsService) ListBlockedUsers(ctx context.Context, org string, // IsBlocked reports whether specified user is blocked from an organization. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/#check-if-a-user-is-blocked-by-an-organization +// GitHub API docs: https://docs.github.com/en/rest/orgs/blocking#check-if-a-user-is-blocked-by-an-organization func (s *OrganizationsService) IsBlocked(ctx context.Context, org string, user string) (bool, *Response, error) { u := fmt.Sprintf("orgs/%v/blocks/%v", org, user) @@ -58,7 +58,7 @@ func (s *OrganizationsService) IsBlocked(ctx context.Context, org string, user s // BlockUser blocks specified user from an organization. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/#block-a-user-from-an-organization +// GitHub API docs: https://docs.github.com/en/rest/orgs/blocking#block-a-user-from-an-organization func (s *OrganizationsService) BlockUser(ctx context.Context, org string, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/blocks/%v", org, user) @@ -75,7 +75,7 @@ func (s *OrganizationsService) BlockUser(ctx context.Context, org string, user s // UnblockUser unblocks specified user from an organization. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs/#unblock-a-user-from-an-organization +// GitHub API docs: https://docs.github.com/en/rest/orgs/blocking#unblock-a-user-from-an-organization func (s *OrganizationsService) UnblockUser(ctx context.Context, org string, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/blocks/%v", org, user) diff --git a/github/projects.go b/github/projects.go index 2886c3a3b04..df7ad6cd97e 100644 --- a/github/projects.go +++ b/github/projects.go @@ -13,7 +13,7 @@ import ( // ProjectsService provides access to the projects functions in the // GitHub API. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/projects/ +// GitHub API docs: https://docs.github.com/en/rest/projects type ProjectsService service // Project represents a GitHub Project. @@ -43,7 +43,7 @@ func (p Project) String() string { // GetProject gets a GitHub Project for a repo. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/projects/#get-a-project +// GitHub API docs: https://docs.github.com/en/rest/projects/projects#get-a-project func (s *ProjectsService) GetProject(ctx context.Context, id int64) (*Project, *Response, error) { u := fmt.Sprintf("projects/%v", id) req, err := s.client.NewRequest("GET", u, nil) @@ -90,7 +90,7 @@ type ProjectOptions struct { // UpdateProject updates a repository project. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/projects/#update-a-project +// GitHub API docs: https://docs.github.com/en/rest/projects/projects#update-a-project func (s *ProjectsService) UpdateProject(ctx context.Context, id int64, opts *ProjectOptions) (*Project, *Response, error) { u := fmt.Sprintf("projects/%v", id) req, err := s.client.NewRequest("PATCH", u, opts) @@ -112,7 +112,7 @@ func (s *ProjectsService) UpdateProject(ctx context.Context, id int64, opts *Pro // DeleteProject deletes a GitHub Project from a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/projects/#delete-a-project +// GitHub API docs: https://docs.github.com/en/rest/projects/projects#delete-a-project func (s *ProjectsService) DeleteProject(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("projects/%v", id) req, err := s.client.NewRequest("DELETE", u, nil) @@ -128,7 +128,7 @@ func (s *ProjectsService) DeleteProject(ctx context.Context, id int64) (*Respons // ProjectColumn represents a column of a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/projects/ +// GitHub API docs: https://docs.github.com/en/rest/repos/projects/ type ProjectColumn struct { ID *int64 `json:"id,omitempty"` Name *string `json:"name,omitempty"` @@ -142,7 +142,7 @@ type ProjectColumn struct { // ListProjectColumns lists the columns of a GitHub Project for a repo. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/projects/#list-project-columns +// GitHub API docs: https://docs.github.com/en/rest/projects/columns#list-project-columns func (s *ProjectsService) ListProjectColumns(ctx context.Context, projectID int64, opts *ListOptions) ([]*ProjectColumn, *Response, error) { u := fmt.Sprintf("projects/%v/columns", projectID) u, err := addOptions(u, opts) @@ -169,7 +169,7 @@ func (s *ProjectsService) ListProjectColumns(ctx context.Context, projectID int6 // GetProjectColumn gets a column of a GitHub Project for a repo. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/projects/#get-a-project-column +// GitHub API docs: https://docs.github.com/en/rest/projects/columns#get-a-project-column func (s *ProjectsService) GetProjectColumn(ctx context.Context, id int64) (*ProjectColumn, *Response, error) { u := fmt.Sprintf("projects/columns/%v", id) req, err := s.client.NewRequest("GET", u, nil) @@ -199,7 +199,7 @@ type ProjectColumnOptions struct { // CreateProjectColumn creates a column for the specified (by number) project. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/projects/#create-a-project-column +// GitHub API docs: https://docs.github.com/en/rest/projects/columns#create-a-project-column func (s *ProjectsService) CreateProjectColumn(ctx context.Context, projectID int64, opts *ProjectColumnOptions) (*ProjectColumn, *Response, error) { u := fmt.Sprintf("projects/%v/columns", projectID) req, err := s.client.NewRequest("POST", u, opts) @@ -221,7 +221,7 @@ func (s *ProjectsService) CreateProjectColumn(ctx context.Context, projectID int // UpdateProjectColumn updates a column of a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/projects/#update-an-existing-project-column +// GitHub API docs: https://docs.github.com/en/rest/projects/columns#update-an-existing-project-column func (s *ProjectsService) UpdateProjectColumn(ctx context.Context, columnID int64, opts *ProjectColumnOptions) (*ProjectColumn, *Response, error) { u := fmt.Sprintf("projects/columns/%v", columnID) req, err := s.client.NewRequest("PATCH", u, opts) @@ -243,7 +243,7 @@ func (s *ProjectsService) UpdateProjectColumn(ctx context.Context, columnID int6 // DeleteProjectColumn deletes a column from a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/projects/#delete-a-project-column +// GitHub API docs: https://docs.github.com/en/rest/projects/columns#delete-a-project-column func (s *ProjectsService) DeleteProjectColumn(ctx context.Context, columnID int64) (*Response, error) { u := fmt.Sprintf("projects/columns/%v", columnID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -267,7 +267,7 @@ type ProjectColumnMoveOptions struct { // MoveProjectColumn moves a column within a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/projects/#move-a-project-column +// GitHub API docs: https://docs.github.com/en/rest/projects/columns#move-a-project-column func (s *ProjectsService) MoveProjectColumn(ctx context.Context, columnID int64, opts *ProjectColumnMoveOptions) (*Response, error) { u := fmt.Sprintf("projects/columns/%v/moves", columnID) req, err := s.client.NewRequest("POST", u, opts) @@ -283,7 +283,7 @@ func (s *ProjectsService) MoveProjectColumn(ctx context.Context, columnID int64, // ProjectCard represents a card in a column of a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/projects/cards/#get-a-project-card +// GitHub API docs: https://docs.github.com/en/rest/projects/cards/#get-a-project-card type ProjectCard struct { URL *string `json:"url,omitempty"` ColumnURL *string `json:"column_url,omitempty"` @@ -318,7 +318,7 @@ type ProjectCardListOptions struct { // ListProjectCards lists the cards in a column of a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/projects/#list-project-cards +// GitHub API docs: https://docs.github.com/en/rest/projects/cards#list-project-cards func (s *ProjectsService) ListProjectCards(ctx context.Context, columnID int64, opts *ProjectCardListOptions) ([]*ProjectCard, *Response, error) { u := fmt.Sprintf("projects/columns/%v/cards", columnID) u, err := addOptions(u, opts) @@ -345,7 +345,7 @@ func (s *ProjectsService) ListProjectCards(ctx context.Context, columnID int64, // GetProjectCard gets a card in a column of a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/projects/#get-a-project-card +// GitHub API docs: https://docs.github.com/en/rest/projects/cards#get-a-project-card func (s *ProjectsService) GetProjectCard(ctx context.Context, cardID int64) (*ProjectCard, *Response, error) { u := fmt.Sprintf("projects/columns/cards/%v", cardID) req, err := s.client.NewRequest("GET", u, nil) @@ -383,7 +383,7 @@ type ProjectCardOptions struct { // CreateProjectCard creates a card in the specified column of a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/projects/#create-a-project-card +// GitHub API docs: https://docs.github.com/en/rest/projects/cards#create-a-project-card func (s *ProjectsService) CreateProjectCard(ctx context.Context, columnID int64, opts *ProjectCardOptions) (*ProjectCard, *Response, error) { u := fmt.Sprintf("projects/columns/%v/cards", columnID) req, err := s.client.NewRequest("POST", u, opts) @@ -405,7 +405,7 @@ func (s *ProjectsService) CreateProjectCard(ctx context.Context, columnID int64, // UpdateProjectCard updates a card of a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/projects/#update-an-existing-project-card +// GitHub API docs: https://docs.github.com/en/rest/projects/cards#update-an-existing-project-card func (s *ProjectsService) UpdateProjectCard(ctx context.Context, cardID int64, opts *ProjectCardOptions) (*ProjectCard, *Response, error) { u := fmt.Sprintf("projects/columns/cards/%v", cardID) req, err := s.client.NewRequest("PATCH", u, opts) @@ -427,7 +427,7 @@ func (s *ProjectsService) UpdateProjectCard(ctx context.Context, cardID int64, o // DeleteProjectCard deletes a card from a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/projects/#delete-a-project-card +// GitHub API docs: https://docs.github.com/en/rest/projects/cards#delete-a-project-card func (s *ProjectsService) DeleteProjectCard(ctx context.Context, cardID int64) (*Response, error) { u := fmt.Sprintf("projects/columns/cards/%v", cardID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -455,7 +455,7 @@ type ProjectCardMoveOptions struct { // MoveProjectCard moves a card within a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/projects/#move-a-project-card +// GitHub API docs: https://docs.github.com/en/rest/projects/cards#move-a-project-card func (s *ProjectsService) MoveProjectCard(ctx context.Context, cardID int64, opts *ProjectCardMoveOptions) (*Response, error) { u := fmt.Sprintf("projects/columns/cards/%v/moves", cardID) req, err := s.client.NewRequest("POST", u, opts) @@ -485,7 +485,7 @@ type ProjectCollaboratorOptions struct { // AddProjectCollaborator adds a collaborator to an organization project and sets // their permission level. You must be an organization owner or a project admin to add a collaborator. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/projects/#add-project-collaborator +// GitHub API docs: https://docs.github.com/en/rest/projects/collaborators#add-project-collaborator func (s *ProjectsService) AddProjectCollaborator(ctx context.Context, id int64, username string, opts *ProjectCollaboratorOptions) (*Response, error) { u := fmt.Sprintf("projects/%v/collaborators/%v", id, username) req, err := s.client.NewRequest("PUT", u, opts) @@ -502,7 +502,7 @@ func (s *ProjectsService) AddProjectCollaborator(ctx context.Context, id int64, // RemoveProjectCollaborator removes a collaborator from an organization project. // You must be an organization owner or a project admin to remove a collaborator. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/projects/#remove-user-as-a-collaborator +// GitHub API docs: https://docs.github.com/en/rest/projects/collaborators#remove-user-as-a-collaborator func (s *ProjectsService) RemoveProjectCollaborator(ctx context.Context, id int64, username string) (*Response, error) { u := fmt.Sprintf("projects/%v/collaborators/%v", id, username) req, err := s.client.NewRequest("DELETE", u, nil) @@ -538,7 +538,7 @@ type ListCollaboratorOptions struct { // with access through default organization permissions, and organization owners. You must be an // organization owner or a project admin to list collaborators. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/projects/#list-project-collaborators +// GitHub API docs: https://docs.github.com/en/rest/projects/collaborators#list-project-collaborators func (s *ProjectsService) ListProjectCollaborators(ctx context.Context, id int64, opts *ListCollaboratorOptions) ([]*User, *Response, error) { u := fmt.Sprintf("projects/%v/collaborators", id) u, err := addOptions(u, opts) @@ -576,7 +576,7 @@ type ProjectPermissionLevel struct { // project. Possible values for the permission key: "admin", "write", "read", "none". // You must be an organization owner or a project admin to review a user's permission level. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/projects/#get-project-permission-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/projects/collaborators#get-project-permission-for-a-user func (s *ProjectsService) ReviewProjectCollaboratorPermission(ctx context.Context, id int64, username string) (*ProjectPermissionLevel, *Response, error) { u := fmt.Sprintf("projects/%v/collaborators/%v/permission", id, username) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/pulls.go b/github/pulls.go index 37fb7413a4c..120a1d6f18a 100644 --- a/github/pulls.go +++ b/github/pulls.go @@ -15,7 +15,7 @@ import ( // PullRequestsService handles communication with the pull request related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/ +// GitHub API docs: https://docs.github.com/en/rest/pulls/ type PullRequestsService service // PullRequestAutoMerge represents the "auto_merge" response for a PullRequest. @@ -143,7 +143,7 @@ type PullRequestListOptions struct { // List the pull requests for the specified repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/#list-pull-requests +// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#list-pull-requests func (s *PullRequestsService) List(ctx context.Context, owner string, repo string, opts *PullRequestListOptions) ([]*PullRequest, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls", owner, repo) u, err := addOptions(u, opts) @@ -170,7 +170,7 @@ func (s *PullRequestsService) List(ctx context.Context, owner string, repo strin // The results may include open and closed pull requests. // By default, the PullRequestListOptions State filters for "open". // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/commits/#list-pull-requests-associated-with-a-commit +// GitHub API docs: https://docs.github.com/en/rest/commits/commits#list-pull-requests-associated-with-a-commit func (s *PullRequestsService) ListPullRequestsWithCommit(ctx context.Context, owner, repo, sha string, opts *PullRequestListOptions) ([]*PullRequest, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/pulls", owner, repo, sha) u, err := addOptions(u, opts) @@ -196,7 +196,7 @@ func (s *PullRequestsService) ListPullRequestsWithCommit(ctx context.Context, ow // Get a single pull request. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/#get-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#get-a-pull-request func (s *PullRequestsService) Get(ctx context.Context, owner string, repo string, number int) (*PullRequest, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d", owner, repo, number) req, err := s.client.NewRequest("GET", u, nil) @@ -215,7 +215,7 @@ func (s *PullRequestsService) Get(ctx context.Context, owner string, repo string // GetRaw gets a single pull request in raw (diff or patch) format. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/#get-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#get-a-pull-request func (s *PullRequestsService) GetRaw(ctx context.Context, owner string, repo string, number int, opts RawOptions) (string, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d", owner, repo, number) req, err := s.client.NewRequest("GET", u, nil) @@ -254,7 +254,7 @@ type NewPullRequest struct { // Create a new pull request on the specified repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/#create-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#create-a-pull-request func (s *PullRequestsService) Create(ctx context.Context, owner string, repo string, pull *NewPullRequest) (*PullRequest, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls", owner, repo) req, err := s.client.NewRequest("POST", u, pull) @@ -293,7 +293,7 @@ type PullRequestBranchUpdateResponse struct { // A follow up request, after a delay of a second or so, should result // in a successful request. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/#update-a-pull-request-branch +// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#update-a-pull-request-branch func (s *PullRequestsService) UpdateBranch(ctx context.Context, owner, repo string, number int, opts *PullRequestBranchUpdateOptions) (*PullRequestBranchUpdateResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/update-branch", owner, repo, number) @@ -328,7 +328,7 @@ type pullRequestUpdate struct { // The following fields are editable: Title, Body, State, Base.Ref and MaintainerCanModify. // Base.Ref updates the base branch of the pull request. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/#update-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#update-a-pull-request func (s *PullRequestsService) Edit(ctx context.Context, owner string, repo string, number int, pull *PullRequest) (*PullRequest, *Response, error) { if pull == nil { return nil, nil, fmt.Errorf("pull must be provided") @@ -365,7 +365,7 @@ func (s *PullRequestsService) Edit(ctx context.Context, owner string, repo strin // ListCommits lists the commits in a pull request. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/#list-commits-on-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#list-commits-on-a-pull-request func (s *PullRequestsService) ListCommits(ctx context.Context, owner string, repo string, number int, opts *ListOptions) ([]*RepositoryCommit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/commits", owner, repo, number) u, err := addOptions(u, opts) @@ -389,7 +389,7 @@ func (s *PullRequestsService) ListCommits(ctx context.Context, owner string, rep // ListFiles lists the files in a pull request. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/#list-pull-requests-files +// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#list-pull-requests-files func (s *PullRequestsService) ListFiles(ctx context.Context, owner string, repo string, number int, opts *ListOptions) ([]*CommitFile, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/files", owner, repo, number) u, err := addOptions(u, opts) @@ -413,7 +413,7 @@ func (s *PullRequestsService) ListFiles(ctx context.Context, owner string, repo // IsMerged checks if a pull request has been merged. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/#check-if-a-pull-request-has-been-merged +// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#check-if-a-pull-request-has-been-merged func (s *PullRequestsService) IsMerged(ctx context.Context, owner string, repo string, number int) (bool, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/merge", owner, repo, number) req, err := s.client.NewRequest("GET", u, nil) @@ -455,7 +455,7 @@ type pullRequestMergeRequest struct { // Merge a pull request. // commitMessage is an extra detail to append to automatic commit message. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/#merge-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#merge-a-pull-request func (s *PullRequestsService) Merge(ctx context.Context, owner string, repo string, number int, commitMessage string, options *PullRequestOptions) (*PullRequestMergeResult, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/merge", owner, repo, number) diff --git a/github/pulls_comments.go b/github/pulls_comments.go index 5078bab1d04..83e7881e518 100644 --- a/github/pulls_comments.go +++ b/github/pulls_comments.go @@ -66,8 +66,8 @@ type PullRequestListCommentsOptions struct { // pull request number of 0 will return all comments on all pull requests for // the repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/#list-review-comments-on-a-pull-request -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/#list-review-comments-in-a-repository +// GitHub API docs: https://docs.github.com/en/rest/pulls/comments#list-review-comments-on-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/comments#list-review-comments-in-a-repository func (s *PullRequestsService) ListComments(ctx context.Context, owner, repo string, number int, opts *PullRequestListCommentsOptions) ([]*PullRequestComment, *Response, error) { var u string if number == 0 { @@ -100,7 +100,7 @@ func (s *PullRequestsService) ListComments(ctx context.Context, owner, repo stri // GetComment fetches the specified pull request comment. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/#get-a-review-comment-for-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/comments#get-a-review-comment-for-a-pull-request func (s *PullRequestsService) GetComment(ctx context.Context, owner, repo string, commentID int64) (*PullRequestComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%d", owner, repo, commentID) req, err := s.client.NewRequest("GET", u, nil) @@ -123,7 +123,7 @@ func (s *PullRequestsService) GetComment(ctx context.Context, owner, repo string // CreateComment creates a new comment on the specified pull request. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/#create-a-review-comment-for-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/comments#create-a-review-comment-for-a-pull-request func (s *PullRequestsService) CreateComment(ctx context.Context, owner, repo string, number int, comment *PullRequestComment) (*PullRequestComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/comments", owner, repo, number) req, err := s.client.NewRequest("POST", u, comment) @@ -145,7 +145,7 @@ func (s *PullRequestsService) CreateComment(ctx context.Context, owner, repo str // CreateCommentInReplyTo creates a new comment as a reply to an existing pull request comment. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/#create-a-review-comment-for-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/comments#create-a-review-comment-for-a-pull-request func (s *PullRequestsService) CreateCommentInReplyTo(ctx context.Context, owner, repo string, number int, body string, commentID int64) (*PullRequestComment, *Response, error) { comment := &struct { Body string `json:"body,omitempty"` @@ -172,7 +172,7 @@ func (s *PullRequestsService) CreateCommentInReplyTo(ctx context.Context, owner, // EditComment updates a pull request comment. // A non-nil comment.Body must be provided. Other comment fields should be left nil. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/#update-a-review-comment-for-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/comments#update-a-review-comment-for-a-pull-request func (s *PullRequestsService) EditComment(ctx context.Context, owner, repo string, commentID int64, comment *PullRequestComment) (*PullRequestComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%d", owner, repo, commentID) req, err := s.client.NewRequest("PATCH", u, comment) @@ -191,7 +191,7 @@ func (s *PullRequestsService) EditComment(ctx context.Context, owner, repo strin // DeleteComment deletes a pull request comment. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/#delete-a-review-comment-for-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/comments#delete-a-review-comment-for-a-pull-request func (s *PullRequestsService) DeleteComment(ctx context.Context, owner, repo string, commentID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%d", owner, repo, commentID) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/pulls_reviewers.go b/github/pulls_reviewers.go index f901c2e8a26..1c336540b81 100644 --- a/github/pulls_reviewers.go +++ b/github/pulls_reviewers.go @@ -25,7 +25,7 @@ type Reviewers struct { // RequestReviewers creates a review request for the provided reviewers for the specified pull request. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/#request-reviewers-for-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/review-requests#request-reviewers-for-a-pull-request func (s *PullRequestsService) RequestReviewers(ctx context.Context, owner, repo string, number int, reviewers ReviewersRequest) (*PullRequest, *Response, error) { u := fmt.Sprintf("repos/%s/%s/pulls/%d/requested_reviewers", owner, repo, number) req, err := s.client.NewRequest("POST", u, &reviewers) @@ -44,7 +44,7 @@ func (s *PullRequestsService) RequestReviewers(ctx context.Context, owner, repo // ListReviewers lists reviewers whose reviews have been requested on the specified pull request. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/#list-requested-reviewers-for-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/review-requests#list-requested-reviewers-for-a-pull-request func (s *PullRequestsService) ListReviewers(ctx context.Context, owner, repo string, number int, opts *ListOptions) (*Reviewers, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/requested_reviewers", owner, repo, number) u, err := addOptions(u, opts) @@ -68,7 +68,7 @@ func (s *PullRequestsService) ListReviewers(ctx context.Context, owner, repo str // RemoveReviewers removes the review request for the provided reviewers for the specified pull request. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/#remove-requested-reviewers-from-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/review-requests#remove-requested-reviewers-from-a-pull-request func (s *PullRequestsService) RemoveReviewers(ctx context.Context, owner, repo string, number int, reviewers ReviewersRequest) (*Response, error) { u := fmt.Sprintf("repos/%s/%s/pulls/%d/requested_reviewers", owner, repo, number) req, err := s.client.NewRequest("DELETE", u, &reviewers) diff --git a/github/pulls_reviews.go b/github/pulls_reviews.go index 437b0937be6..14e20322aec 100644 --- a/github/pulls_reviews.go +++ b/github/pulls_reviews.go @@ -101,7 +101,7 @@ func (r PullRequestReviewDismissalRequest) String() string { // ListReviews lists all reviews on the specified pull request. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/#list-reviews-for-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#list-reviews-for-a-pull-request func (s *PullRequestsService) ListReviews(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews", owner, repo, number) u, err := addOptions(u, opts) @@ -125,7 +125,7 @@ func (s *PullRequestsService) ListReviews(ctx context.Context, owner, repo strin // GetReview fetches the specified pull request review. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/#get-a-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#get-a-review-for-a-pull-request func (s *PullRequestsService) GetReview(ctx context.Context, owner, repo string, number int, reviewID int64) (*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d", owner, repo, number, reviewID) @@ -145,7 +145,7 @@ func (s *PullRequestsService) GetReview(ctx context.Context, owner, repo string, // DeletePendingReview deletes the specified pull request pending review. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/#delete-a-pending-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#delete-a-pending-review-for-a-pull-request func (s *PullRequestsService) DeletePendingReview(ctx context.Context, owner, repo string, number int, reviewID int64) (*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d", owner, repo, number, reviewID) @@ -165,7 +165,7 @@ func (s *PullRequestsService) DeletePendingReview(ctx context.Context, owner, re // ListReviewComments lists all the comments for the specified review. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/#list-comments-for-a-pull-request-review +// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#list-comments-for-a-pull-request-review func (s *PullRequestsService) ListReviewComments(ctx context.Context, owner, repo string, number int, reviewID int64, opts *ListOptions) ([]*PullRequestComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d/comments", owner, repo, number, reviewID) u, err := addOptions(u, opts) @@ -189,7 +189,7 @@ func (s *PullRequestsService) ListReviewComments(ctx context.Context, owner, rep // CreateReview creates a new review on the specified pull request. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/#create-a-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#create-a-review-for-a-pull-request // // In order to use multi-line comments, you must use the "comfort fade" preview. // This replaces the use of the "Position" field in comments with 4 new fields: @@ -250,7 +250,7 @@ func (s *PullRequestsService) CreateReview(ctx context.Context, owner, repo stri // UpdateReview updates the review summary on the specified pull request. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/#update-a-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#update-a-review-for-a-pull-request func (s *PullRequestsService) UpdateReview(ctx context.Context, owner, repo string, number int, reviewID int64, body string) (*PullRequestReview, *Response, error) { opts := &struct { Body string `json:"body"` @@ -273,7 +273,7 @@ func (s *PullRequestsService) UpdateReview(ctx context.Context, owner, repo stri // SubmitReview submits a specified review on the specified pull request. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/#submit-a-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#submit-a-review-for-a-pull-request func (s *PullRequestsService) SubmitReview(ctx context.Context, owner, repo string, number int, reviewID int64, review *PullRequestReviewRequest) (*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d/events", owner, repo, number, reviewID) @@ -293,7 +293,7 @@ func (s *PullRequestsService) SubmitReview(ctx context.Context, owner, repo stri // DismissReview dismisses a specified review on the specified pull request. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/#dismiss-a-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#dismiss-a-review-for-a-pull-request func (s *PullRequestsService) DismissReview(ctx context.Context, owner, repo string, number int, reviewID int64, review *PullRequestReviewDismissalRequest) (*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d/dismissals", owner, repo, number, reviewID) diff --git a/github/reactions.go b/github/reactions.go index ecfcf2e9458..14d193ae887 100644 --- a/github/reactions.go +++ b/github/reactions.go @@ -14,7 +14,7 @@ import ( // ReactionsService provides access to the reactions-related functions in the // GitHub API. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/ +// GitHub API docs: https://docs.github.com/en/rest/reactions type ReactionsService service // Reaction represents a GitHub reaction. @@ -60,7 +60,7 @@ type ListCommentReactionOptions struct { // ListCommentReactions lists the reactions for a commit comment. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#list-reactions-for-a-commit-comment +// GitHub API docs: https://docs.github.com/en/rest/reactions#list-reactions-for-a-commit-comment func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListCommentReactionOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) u, err := addOptions(u, opts) @@ -90,7 +90,7 @@ func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo // previously created reaction will be returned with Status: 200 OK. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#create-reaction-for-a-commit-comment +// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-a-commit-comment func (s *ReactionsService) CreateCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) @@ -114,7 +114,7 @@ func (s *ReactionsService) CreateCommentReaction(ctx context.Context, owner, rep // DeleteCommentReaction deletes the reaction for a commit comment. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-a-commit-comment-reaction +// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-a-commit-comment-reaction func (s *ReactionsService) DeleteCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions/%v", owner, repo, commentID, reactionID) @@ -123,7 +123,7 @@ func (s *ReactionsService) DeleteCommentReaction(ctx context.Context, owner, rep // DeleteCommentReactionByID deletes the reaction for a commit comment by repository ID. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-a-commit-comment-reaction +// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-a-commit-comment-reaction func (s *ReactionsService) DeleteCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { u := fmt.Sprintf("repositories/%v/comments/%v/reactions/%v", repoID, commentID, reactionID) @@ -132,7 +132,7 @@ func (s *ReactionsService) DeleteCommentReactionByID(ctx context.Context, repoID // ListIssueReactions lists the reactions for an issue. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#list-reactions-for-an-issue +// GitHub API docs: https://docs.github.com/en/rest/reactions#list-reactions-for-an-issue func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) u, err := addOptions(u, opts) @@ -162,7 +162,7 @@ func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo s // previously created reaction will be returned with Status: 200 OK. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#create-reaction-for-an-issue +// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-an-issue func (s *ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo string, number int, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) @@ -186,7 +186,7 @@ func (s *ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo // DeleteIssueReaction deletes the reaction to an issue. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-an-issue-reaction +// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-an-issue-reaction func (s *ReactionsService) DeleteIssueReaction(ctx context.Context, owner, repo string, issueNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/issues/%v/reactions/%v", owner, repo, issueNumber, reactionID) @@ -195,7 +195,7 @@ func (s *ReactionsService) DeleteIssueReaction(ctx context.Context, owner, repo // DeleteIssueReactionByID deletes the reaction to an issue by repository ID. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-an-issue-reaction +// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-an-issue-reaction func (s *ReactionsService) DeleteIssueReactionByID(ctx context.Context, repoID, issueNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("repositories/%v/issues/%v/reactions/%v", repoID, issueNumber, reactionID) @@ -204,7 +204,7 @@ func (s *ReactionsService) DeleteIssueReactionByID(ctx context.Context, repoID, // ListIssueCommentReactions lists the reactions for an issue comment. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#list-reactions-for-an-issue-comment +// GitHub API docs: https://docs.github.com/en/rest/reactions#list-reactions-for-an-issue-comment func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) u, err := addOptions(u, opts) @@ -234,7 +234,7 @@ func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, // previously created reaction will be returned with Status: 200 OK. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#create-reaction-for-an-issue-comment +// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-an-issue-comment func (s *ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) @@ -258,7 +258,7 @@ func (s *ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner // DeleteIssueCommentReaction deletes the reaction to an issue comment. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-an-issue-comment-reaction +// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-an-issue-comment-reaction func (s *ReactionsService) DeleteIssueCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions/%v", owner, repo, commentID, reactionID) @@ -267,7 +267,7 @@ func (s *ReactionsService) DeleteIssueCommentReaction(ctx context.Context, owner // DeleteIssueCommentReactionByID deletes the reaction to an issue comment by repository ID. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-an-issue-comment-reaction +// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-an-issue-comment-reaction func (s *ReactionsService) DeleteIssueCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { url := fmt.Sprintf("repositories/%v/issues/comments/%v/reactions/%v", repoID, commentID, reactionID) @@ -276,7 +276,7 @@ func (s *ReactionsService) DeleteIssueCommentReactionByID(ctx context.Context, r // ListPullRequestCommentReactions lists the reactions for a pull request review comment. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#list-reactions-for-a-pull-request-review-comment +// GitHub API docs: https://docs.github.com/en/rest/reactions#list-reactions-for-a-pull-request-review-comment func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) u, err := addOptions(u, opts) @@ -306,7 +306,7 @@ func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, // previously created reaction will be returned with Status: 200 OK. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#create-reaction-for-a-pull-request-review-comment +// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-a-pull-request-review-comment func (s *ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) @@ -330,7 +330,7 @@ func (s *ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, // DeletePullRequestCommentReaction deletes the reaction to a pull request review comment. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-a-pull-request-comment-reaction +// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-a-pull-request-comment-reaction func (s *ReactionsService) DeletePullRequestCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions/%v", owner, repo, commentID, reactionID) @@ -339,7 +339,7 @@ func (s *ReactionsService) DeletePullRequestCommentReaction(ctx context.Context, // DeletePullRequestCommentReactionByID deletes the reaction to a pull request review comment by repository ID. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-a-pull-request-comment-reaction +// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-a-pull-request-comment-reaction func (s *ReactionsService) DeletePullRequestCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { url := fmt.Sprintf("repositories/%v/pulls/comments/%v/reactions/%v", repoID, commentID, reactionID) @@ -348,7 +348,7 @@ func (s *ReactionsService) DeletePullRequestCommentReactionByID(ctx context.Cont // ListTeamDiscussionReactions lists the reactions for a team discussion. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#list-reactions-for-a-team-discussion-legacy +// GitHub API docs: https://docs.github.com/en/rest/reactions#list-reactions-for-a-team-discussion-legacy func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, teamID int64, discussionNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) u, err := addOptions(u, opts) @@ -375,7 +375,7 @@ func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, team // CreateTeamDiscussionReaction creates a reaction for a team discussion. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#create-reaction-for-a-team-discussion-legacy +// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-a-team-discussion-legacy func (s *ReactionsService) CreateTeamDiscussionReaction(ctx context.Context, teamID int64, discussionNumber int, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) @@ -398,7 +398,7 @@ func (s *ReactionsService) CreateTeamDiscussionReaction(ctx context.Context, tea // DeleteTeamDiscussionReaction deletes the reaction to a team discussion. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-team-discussion-reaction +// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-team-discussion-reaction func (s *ReactionsService) DeleteTeamDiscussionReaction(ctx context.Context, org, teamSlug string, discussionNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/reactions/%v", org, teamSlug, discussionNumber, reactionID) @@ -407,7 +407,7 @@ func (s *ReactionsService) DeleteTeamDiscussionReaction(ctx context.Context, org // DeleteTeamDiscussionReactionByOrgIDAndTeamID deletes the reaction to a team discussion by organization ID and team ID. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-team-discussion-reaction +// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-a-team-discussion func (s *ReactionsService) DeleteTeamDiscussionReactionByOrgIDAndTeamID(ctx context.Context, orgID, teamID, discussionNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/reactions/%v", orgID, teamID, discussionNumber, reactionID) @@ -416,7 +416,7 @@ func (s *ReactionsService) DeleteTeamDiscussionReactionByOrgIDAndTeamID(ctx cont // ListTeamDiscussionCommentReactions lists the reactions for a team discussion comment. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#list-reactions-for-a-team-discussion-comment-legacy +// GitHub API docs: https://docs.github.com/en/rest/reactions#list-reactions-for-a-team-discussion-comment-legacy func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Context, teamID int64, discussionNumber, commentNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) u, err := addOptions(u, opts) @@ -442,7 +442,7 @@ func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Contex // CreateTeamDiscussionCommentReaction creates a reaction for a team discussion comment. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#create-reaction-for-a-team-discussion-comment-legacy +// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-a-team-discussion-comment-legacy func (s *ReactionsService) CreateTeamDiscussionCommentReaction(ctx context.Context, teamID int64, discussionNumber, commentNumber int, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) @@ -465,7 +465,7 @@ func (s *ReactionsService) CreateTeamDiscussionCommentReaction(ctx context.Conte // DeleteTeamDiscussionCommentReaction deletes the reaction to a team discussion comment. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-team-discussion-comment-reaction +// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-team-discussion-comment-reaction func (s *ReactionsService) DeleteTeamDiscussionCommentReaction(ctx context.Context, org, teamSlug string, discussionNumber, commentNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v/reactions/%v", org, teamSlug, discussionNumber, commentNumber, reactionID) @@ -474,7 +474,7 @@ func (s *ReactionsService) DeleteTeamDiscussionCommentReaction(ctx context.Conte // DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID deletes the reaction to a team discussion comment by organization ID and team ID. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-team-discussion-comment-reaction +// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-a-team-discussion-comment func (s *ReactionsService) DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID(ctx context.Context, orgID, teamID, discussionNumber, commentNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v/reactions/%v", orgID, teamID, discussionNumber, commentNumber, reactionID) @@ -498,7 +498,7 @@ func (s *ReactionsService) deleteReaction(ctx context.Context, url string) (*Res // added the reaction type to this release. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#create-reaction-for-a-release +// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-a-release func (s *ReactionsService) CreateReleaseReaction(ctx context.Context, owner, repo string, releaseID int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/releases/%v/reactions", owner, repo, releaseID) diff --git a/github/repos.go b/github/repos.go index 49a64ee730e..13e0887ea7c 100644 --- a/github/repos.go +++ b/github/repos.go @@ -21,7 +21,7 @@ var ErrBranchNotProtected = errors.New("branch is not protected") // RepositoriesService handles communication with the repository related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/ +// GitHub API docs: https://docs.github.com/en/rest/repos/ type RepositoriesService service // Repository represents a GitHub repository. @@ -133,7 +133,7 @@ type Repository struct { TeamsURL *string `json:"teams_url,omitempty"` // TextMatches is only populated from search results that request text matches - // See: search.go and https://docs.github.com/en/free-pro-team@latest/rest/reference/search/#text-match-metadata + // See: search.go and https://docs.github.com/en/rest/search/#text-match-metadata TextMatches []*TextMatch `json:"text_matches,omitempty"` // Visibility is only used for Create and Edit endpoints. The visibility field @@ -229,8 +229,8 @@ func (s SecretScanning) String() string { // List the repositories for a user. Passing the empty string will list // repositories for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#list-repositories-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#list-repositories-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-repositories-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-repositories-for-a-user func (s *RepositoriesService) List(ctx context.Context, user string, opts *RepositoryListOptions) ([]*Repository, *Response, error) { var u string if user != "" { @@ -281,7 +281,7 @@ type RepositoryListByOrgOptions struct { // ListByOrg lists the repositories for an organization. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#list-organization-repositories +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-organization-repositories func (s *RepositoriesService) ListByOrg(ctx context.Context, org string, opts *RepositoryListByOrgOptions) ([]*Repository, *Response, error) { u := fmt.Sprintf("orgs/%v/repos", org) u, err := addOptions(u, opts) @@ -316,7 +316,7 @@ type RepositoryListAllOptions struct { // ListAll lists all GitHub repositories in the order that they were created. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#list-public-repositories +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-public-repositories func (s *RepositoriesService) ListAll(ctx context.Context, opts *RepositoryListAllOptions) ([]*Repository, *Response, error) { u, err := addOptions("repositories", opts) if err != nil { @@ -382,8 +382,8 @@ type createRepoRequest struct { // changes propagate throughout its servers. You may set up a loop with // exponential back-off to verify repository's creation. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#create-a-repository-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#create-an-organization-repository +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#create-a-repository-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#create-an-organization-repository func (s *RepositoriesService) Create(ctx context.Context, org string, repo *Repository) (*Repository, *Response, error) { var u string if org != "" { @@ -444,7 +444,7 @@ type TemplateRepoRequest struct { // CreateFromTemplate generates a repository from a template. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#create-a-repository-using-a-template +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#create-a-repository-using-a-template func (s *RepositoriesService) CreateFromTemplate(ctx context.Context, templateOwner, templateRepo string, templateRepoReq *TemplateRepoRequest) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/generate", templateOwner, templateRepo) @@ -465,7 +465,7 @@ func (s *RepositoriesService) CreateFromTemplate(ctx context.Context, templateOw // Get fetches a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-a-repository +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#update-a-repository func (s *RepositoriesService) Get(ctx context.Context, owner, repo string) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -474,7 +474,7 @@ func (s *RepositoriesService) Get(ctx context.Context, owner, repo string) (*Rep } // TODO: remove custom Accept header when the license support fully launches - // https://docs.github.com/en/free-pro-team@latest/rest/reference/licenses/#get-a-repositorys-license + // https://docs.github.com/en/rest/licenses/#get-a-repositorys-license acceptHeaders := []string{ mediaTypeCodesOfConductPreview, mediaTypeTopicsPreview, @@ -493,10 +493,12 @@ func (s *RepositoriesService) Get(ctx context.Context, owner, repo string) (*Rep } // GetCodeOfConduct gets the contents of a repository's code of conduct. +// Note that https://docs.github.com/en/rest/codes-of-conduct#about-the-codes-of-conduct-api +// says to use the GET /repos/{owner}/{repo} endpoint. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/codes-of-conduct/#get-the-code-of-conduct-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#update-a-repository func (s *RepositoriesService) GetCodeOfConduct(ctx context.Context, owner, repo string) (*CodeOfConduct, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/community/code_of_conduct", owner, repo) + u := fmt.Sprintf("repos/%v/%v", owner, repo) req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err @@ -505,13 +507,13 @@ func (s *RepositoriesService) GetCodeOfConduct(ctx context.Context, owner, repo // TODO: remove custom Accept header when this API fully launches. req.Header.Set("Accept", mediaTypeCodesOfConductPreview) - coc := new(CodeOfConduct) - resp, err := s.client.Do(ctx, req, coc) + r := new(Repository) + resp, err := s.client.Do(ctx, req, r) if err != nil { return nil, resp, err } - return coc, resp, nil + return r.GetCodeOfConduct(), resp, nil } // GetByID fetches a repository. @@ -535,7 +537,7 @@ func (s *RepositoriesService) GetByID(ctx context.Context, id int64) (*Repositor // Edit updates a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#update-a-repository +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#update-a-repository func (s *RepositoriesService) Edit(ctx context.Context, owner, repo string, repository *Repository) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v", owner, repo) req, err := s.client.NewRequest("PATCH", u, repository) @@ -556,7 +558,7 @@ func (s *RepositoriesService) Edit(ctx context.Context, owner, repo string, repo // Delete a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#delete-a-repository +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#delete-a-repository func (s *RepositoriesService) Delete(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v", owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) @@ -603,7 +605,7 @@ type ListContributorsOptions struct { // GetVulnerabilityAlerts checks if vulnerability alerts are enabled for a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#check-if-vulnerability-alerts-are-enabled-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#check-if-vulnerability-alerts-are-enabled-for-a-repository func (s *RepositoriesService) GetVulnerabilityAlerts(ctx context.Context, owner, repository string) (bool, *Response, error) { u := fmt.Sprintf("repos/%v/%v/vulnerability-alerts", owner, repository) @@ -622,7 +624,7 @@ func (s *RepositoriesService) GetVulnerabilityAlerts(ctx context.Context, owner, // EnableVulnerabilityAlerts enables vulnerability alerts and the dependency graph for a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#enable-vulnerability-alerts +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#enable-vulnerability-alerts func (s *RepositoriesService) EnableVulnerabilityAlerts(ctx context.Context, owner, repository string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/vulnerability-alerts", owner, repository) @@ -639,7 +641,7 @@ func (s *RepositoriesService) EnableVulnerabilityAlerts(ctx context.Context, own // DisableVulnerabilityAlerts disables vulnerability alerts and the dependency graph for a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#disable-vulnerability-alerts +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#disable-vulnerability-alerts func (s *RepositoriesService) DisableVulnerabilityAlerts(ctx context.Context, owner, repository string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/vulnerability-alerts", owner, repository) @@ -656,7 +658,7 @@ func (s *RepositoriesService) DisableVulnerabilityAlerts(ctx context.Context, ow // EnableAutomatedSecurityFixes enables the automated security fixes for a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#enable-automated-security-fixes +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#enable-automated-security-fixes func (s *RepositoriesService) EnableAutomatedSecurityFixes(ctx context.Context, owner, repository string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/automated-security-fixes", owner, repository) @@ -673,7 +675,7 @@ func (s *RepositoriesService) EnableAutomatedSecurityFixes(ctx context.Context, // DisableAutomatedSecurityFixes disables vulnerability alerts and the dependency graph for a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#disable-automated-security-fixes +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#disable-automated-security-fixes func (s *RepositoriesService) DisableAutomatedSecurityFixes(ctx context.Context, owner, repository string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/automated-security-fixes", owner, repository) @@ -690,7 +692,7 @@ func (s *RepositoriesService) DisableAutomatedSecurityFixes(ctx context.Context, // ListContributors lists contributors for a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#list-repository-contributors +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-repository-contributors func (s *RepositoriesService) ListContributors(ctx context.Context, owner string, repository string, opts *ListContributorsOptions) ([]*Contributor, *Response, error) { u := fmt.Sprintf("repos/%v/%v/contributors", owner, repository) u, err := addOptions(u, opts) @@ -721,7 +723,7 @@ func (s *RepositoriesService) ListContributors(ctx context.Context, owner string // "Python": 7769 // } // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#list-repository-languages +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-repository-languages func (s *RepositoriesService) ListLanguages(ctx context.Context, owner string, repo string) (map[string]int, *Response, error) { u := fmt.Sprintf("repos/%v/%v/languages", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -740,7 +742,7 @@ func (s *RepositoriesService) ListLanguages(ctx context.Context, owner string, r // ListTeams lists the teams for the specified repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#list-repository-teams +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-repository-teams func (s *RepositoriesService) ListTeams(ctx context.Context, owner string, repo string, opts *ListOptions) ([]*Team, *Response, error) { u := fmt.Sprintf("repos/%v/%v/teams", owner, repo) u, err := addOptions(u, opts) @@ -772,7 +774,7 @@ type RepositoryTag struct { // ListTags lists tags for the specified repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#list-repository-tags +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-repository-tags func (s *RepositoriesService) ListTags(ctx context.Context, owner string, repo string, opts *ListOptions) ([]*RepositoryTag, *Response, error) { u := fmt.Sprintf("repos/%v/%v/tags", owner, repo) u, err := addOptions(u, opts) @@ -1032,7 +1034,7 @@ type SignaturesProtectedBranch struct { // ListBranches lists branches for the specified repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#list-branches +// GitHub API docs: https://docs.github.com/en/rest/branches/branches#list-branches func (s *RepositoriesService) ListBranches(ctx context.Context, owner string, repo string, opts *BranchListOptions) ([]*Branch, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches", owner, repo) u, err := addOptions(u, opts) @@ -1056,7 +1058,7 @@ func (s *RepositoriesService) ListBranches(ctx context.Context, owner string, re // GetBranch gets the specified branch for a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-a-branch +// GitHub API docs: https://docs.github.com/en/rest/branches/branches#get-a-branch func (s *RepositoriesService) GetBranch(ctx context.Context, owner, repo, branch string, followRedirects bool) (*Branch, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v", owner, repo, branch) @@ -1085,7 +1087,7 @@ type renameBranchRequest struct { // To rename a non-default branch: Users must have push access. GitHub Apps must have the `contents:write` repository permission. // To rename the default branch: Users must have admin or owner permissions. GitHub Apps must have the `administration:write` repository permission. // -// GitHub API docs: https://docs.github.com/en/rest/reference/repos#rename-a-branch +// GitHub API docs: https://docs.github.com/en/rest/branches/branches#rename-a-branch func (s *RepositoriesService) RenameBranch(ctx context.Context, owner, repo, branch, newName string) (*Branch, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/rename", owner, repo, branch) r := &renameBranchRequest{NewName: newName} @@ -1105,7 +1107,7 @@ func (s *RepositoriesService) RenameBranch(ctx context.Context, owner, repo, bra // GetBranchProtection gets the protection of a given branch. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-branch-protection +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-branch-protection func (s *RepositoriesService) GetBranchProtection(ctx context.Context, owner, repo, branch string) (*Protection, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection", owner, repo, branch) req, err := s.client.NewRequest("GET", u, nil) @@ -1130,7 +1132,7 @@ func (s *RepositoriesService) GetBranchProtection(ctx context.Context, owner, re // GetRequiredStatusChecks gets the required status checks for a given protected branch. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-status-checks-protection +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-status-checks-protection func (s *RepositoriesService) GetRequiredStatusChecks(ctx context.Context, owner, repo, branch string) (*RequiredStatusChecks, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_status_checks", owner, repo, branch) req, err := s.client.NewRequest("GET", u, nil) @@ -1152,7 +1154,7 @@ func (s *RepositoriesService) GetRequiredStatusChecks(ctx context.Context, owner // ListRequiredStatusChecksContexts lists the required status checks contexts for a given protected branch. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-all-status-check-contexts +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-all-status-check-contexts func (s *RepositoriesService) ListRequiredStatusChecksContexts(ctx context.Context, owner, repo, branch string) (contexts []string, resp *Response, err error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_status_checks/contexts", owner, repo, branch) req, err := s.client.NewRequest("GET", u, nil) @@ -1173,7 +1175,7 @@ func (s *RepositoriesService) ListRequiredStatusChecksContexts(ctx context.Conte // UpdateBranchProtection updates the protection of a given branch. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#update-branch-protection +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#update-branch-protection func (s *RepositoriesService) UpdateBranchProtection(ctx context.Context, owner, repo, branch string, preq *ProtectionRequest) (*Protection, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection", owner, repo, branch) req, err := s.client.NewRequest("PUT", u, preq) @@ -1195,7 +1197,7 @@ func (s *RepositoriesService) UpdateBranchProtection(ctx context.Context, owner, // RemoveBranchProtection removes the protection of a given branch. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#delete-branch-protection +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#delete-branch-protection func (s *RepositoriesService) RemoveBranchProtection(ctx context.Context, owner, repo, branch string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection", owner, repo, branch) req, err := s.client.NewRequest("DELETE", u, nil) @@ -1208,7 +1210,7 @@ func (s *RepositoriesService) RemoveBranchProtection(ctx context.Context, owner, // GetSignaturesProtectedBranch gets required signatures of protected branch. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-commit-signature-protection +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-commit-signature-protection func (s *RepositoriesService) GetSignaturesProtectedBranch(ctx context.Context, owner, repo, branch string) (*SignaturesProtectedBranch, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_signatures", owner, repo, branch) req, err := s.client.NewRequest("GET", u, nil) @@ -1231,7 +1233,7 @@ func (s *RepositoriesService) GetSignaturesProtectedBranch(ctx context.Context, // RequireSignaturesOnProtectedBranch makes signed commits required on a protected branch. // It requires admin access and branch protection to be enabled. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#create-commit-signature-protection +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#create-commit-signature-protection func (s *RepositoriesService) RequireSignaturesOnProtectedBranch(ctx context.Context, owner, repo, branch string) (*SignaturesProtectedBranch, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_signatures", owner, repo, branch) req, err := s.client.NewRequest("POST", u, nil) @@ -1253,7 +1255,7 @@ func (s *RepositoriesService) RequireSignaturesOnProtectedBranch(ctx context.Con // OptionalSignaturesOnProtectedBranch removes required signed commits on a given branch. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#delete-commit-signature-protection +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#delete-commit-signature-protection func (s *RepositoriesService) OptionalSignaturesOnProtectedBranch(ctx context.Context, owner, repo, branch string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_signatures", owner, repo, branch) req, err := s.client.NewRequest("DELETE", u, nil) @@ -1269,7 +1271,7 @@ func (s *RepositoriesService) OptionalSignaturesOnProtectedBranch(ctx context.Co // UpdateRequiredStatusChecks updates the required status checks for a given protected branch. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#update-status-check-protection +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#update-status-check-protection func (s *RepositoriesService) UpdateRequiredStatusChecks(ctx context.Context, owner, repo, branch string, sreq *RequiredStatusChecksRequest) (*RequiredStatusChecks, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_status_checks", owner, repo, branch) req, err := s.client.NewRequest("PATCH", u, sreq) @@ -1288,7 +1290,7 @@ func (s *RepositoriesService) UpdateRequiredStatusChecks(ctx context.Context, ow // RemoveRequiredStatusChecks removes the required status checks for a given protected branch. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos#remove-status-check-protection +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#remove-status-check-protection func (s *RepositoriesService) RemoveRequiredStatusChecks(ctx context.Context, owner, repo, branch string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_status_checks", owner, repo, branch) req, err := s.client.NewRequest("DELETE", u, nil) @@ -1301,7 +1303,7 @@ func (s *RepositoriesService) RemoveRequiredStatusChecks(ctx context.Context, ow // License gets the contents of a repository's license if one is detected. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/licenses/#get-the-license-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/licenses#get-the-license-for-a-repository func (s *RepositoriesService) License(ctx context.Context, owner, repo string) (*RepositoryLicense, *Response, error) { u := fmt.Sprintf("repos/%v/%v/license", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -1320,7 +1322,7 @@ func (s *RepositoriesService) License(ctx context.Context, owner, repo string) ( // GetPullRequestReviewEnforcement gets pull request review enforcement of a protected branch. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-pull-request-review-protection +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-pull-request-review-protection func (s *RepositoriesService) GetPullRequestReviewEnforcement(ctx context.Context, owner, repo, branch string) (*PullRequestReviewsEnforcement, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_pull_request_reviews", owner, repo, branch) req, err := s.client.NewRequest("GET", u, nil) @@ -1343,7 +1345,7 @@ func (s *RepositoriesService) GetPullRequestReviewEnforcement(ctx context.Contex // UpdatePullRequestReviewEnforcement patches pull request review enforcement of a protected branch. // It requires admin access and branch protection to be enabled. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#update-pull-request-review-protection +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#update-pull-request-review-protection func (s *RepositoriesService) UpdatePullRequestReviewEnforcement(ctx context.Context, owner, repo, branch string, patch *PullRequestReviewsEnforcementUpdate) (*PullRequestReviewsEnforcement, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_pull_request_reviews", owner, repo, branch) req, err := s.client.NewRequest("PATCH", u, patch) @@ -1366,7 +1368,7 @@ func (s *RepositoriesService) UpdatePullRequestReviewEnforcement(ctx context.Con // DisableDismissalRestrictions disables dismissal restrictions of a protected branch. // It requires admin access and branch protection to be enabled. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#update-pull-request-review-protection +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#update-pull-request-review-protection func (s *RepositoriesService) DisableDismissalRestrictions(ctx context.Context, owner, repo, branch string) (*PullRequestReviewsEnforcement, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_pull_request_reviews", owner, repo, branch) @@ -1393,7 +1395,7 @@ func (s *RepositoriesService) DisableDismissalRestrictions(ctx context.Context, // RemovePullRequestReviewEnforcement removes pull request enforcement of a protected branch. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#delete-pull-request-review-protection +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#delete-pull-request-review-protection func (s *RepositoriesService) RemovePullRequestReviewEnforcement(ctx context.Context, owner, repo, branch string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_pull_request_reviews", owner, repo, branch) req, err := s.client.NewRequest("DELETE", u, nil) @@ -1406,7 +1408,7 @@ func (s *RepositoriesService) RemovePullRequestReviewEnforcement(ctx context.Con // GetAdminEnforcement gets admin enforcement information of a protected branch. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-admin-branch-protection +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-admin-branch-protection func (s *RepositoriesService) GetAdminEnforcement(ctx context.Context, owner, repo, branch string) (*AdminEnforcement, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/enforce_admins", owner, repo, branch) req, err := s.client.NewRequest("GET", u, nil) @@ -1426,7 +1428,7 @@ func (s *RepositoriesService) GetAdminEnforcement(ctx context.Context, owner, re // AddAdminEnforcement adds admin enforcement to a protected branch. // It requires admin access and branch protection to be enabled. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#set-admin-branch-protection +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#set-admin-branch-protection func (s *RepositoriesService) AddAdminEnforcement(ctx context.Context, owner, repo, branch string) (*AdminEnforcement, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/enforce_admins", owner, repo, branch) req, err := s.client.NewRequest("POST", u, nil) @@ -1445,7 +1447,7 @@ func (s *RepositoriesService) AddAdminEnforcement(ctx context.Context, owner, re // RemoveAdminEnforcement removes admin enforcement from a protected branch. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#delete-admin-branch-protection +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#delete-admin-branch-protection func (s *RepositoriesService) RemoveAdminEnforcement(ctx context.Context, owner, repo, branch string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/enforce_admins", owner, repo, branch) req, err := s.client.NewRequest("DELETE", u, nil) @@ -1463,7 +1465,7 @@ type repositoryTopics struct { // ListAllTopics lists topics for a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-all-repository-topics +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#get-all-repository-topics func (s *RepositoriesService) ListAllTopics(ctx context.Context, owner, repo string) ([]string, *Response, error) { u := fmt.Sprintf("repos/%v/%v/topics", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -1483,9 +1485,9 @@ func (s *RepositoriesService) ListAllTopics(ctx context.Context, owner, repo str return topics.Names, resp, nil } -// ReplaceAllTopics replaces topics for a repository. +// ReplaceAllTopics replaces all repository topics. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#replace-all-repository-topics +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#replace-all-repository-topics func (s *RepositoriesService) ReplaceAllTopics(ctx context.Context, owner, repo string, topics []string) ([]string, *Response, error) { u := fmt.Sprintf("repos/%v/%v/topics", owner, repo) t := &repositoryTopics{ @@ -1514,7 +1516,7 @@ func (s *RepositoriesService) ReplaceAllTopics(ctx context.Context, owner, repo // ListApps lists the GitHub apps that have push access to a given protected branch. // It requires the GitHub apps to have `write` access to the `content` permission. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-apps-with-access-to-the-protected-branch +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch func (s *RepositoriesService) ListApps(ctx context.Context, owner, repo, branch string) ([]*App, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, branch) req, err := s.client.NewRequest("GET", u, nil) @@ -1537,7 +1539,7 @@ func (s *RepositoriesService) ListApps(ctx context.Context, owner, repo, branch // // Note: The list of users, apps, and teams in total is limited to 100 items. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#set-app-access-restrictions +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#set-app-access-restrictions func (s *RepositoriesService) ReplaceAppRestrictions(ctx context.Context, owner, repo, branch string, slug []string) ([]*App, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, branch) req, err := s.client.NewRequest("PUT", u, slug) @@ -1559,7 +1561,7 @@ func (s *RepositoriesService) ReplaceAppRestrictions(ctx context.Context, owner, // // Note: The list of users, apps, and teams in total is limited to 100 items. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#add-app-access-restrictions +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#add-app-access-restrictions func (s *RepositoriesService) AddAppRestrictions(ctx context.Context, owner, repo, branch string, slug []string) ([]*App, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, branch) req, err := s.client.NewRequest("POST", u, slug) @@ -1581,7 +1583,7 @@ func (s *RepositoriesService) AddAppRestrictions(ctx context.Context, owner, rep // // Note: The list of users, apps, and teams in total is limited to 100 items. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#remove-app-access-restrictions +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#remove-app-access-restrictions func (s *RepositoriesService) RemoveAppRestrictions(ctx context.Context, owner, repo, branch string, slug []string) ([]*App, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, branch) req, err := s.client.NewRequest("DELETE", u, slug) @@ -1612,7 +1614,7 @@ type TransferRequest struct { // A follow up request, after a delay of a second or so, should result // in a successful request. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#transfer-a-repository +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#transfer-a-repository func (s *RepositoriesService) Transfer(ctx context.Context, owner, repo string, transfer TransferRequest) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/transfer", owner, repo) @@ -1641,7 +1643,7 @@ type DispatchRequestOptions struct { // Dispatch triggers a repository_dispatch event in a GitHub Actions workflow. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#create-a-repository-dispatch-event +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#create-a-repository-dispatch-event func (s *RepositoriesService) Dispatch(ctx context.Context, owner, repo string, opts DispatchRequestOptions) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/dispatches", owner, repo) diff --git a/github/repos_actions_allowed.go b/github/repos_actions_allowed.go index 2770fcccf67..25a46905839 100644 --- a/github/repos_actions_allowed.go +++ b/github/repos_actions_allowed.go @@ -10,9 +10,9 @@ import ( "fmt" ) -// GetActionsAllowed gets the actions that are allowed in a repository. +// GetActionsAllowed gets the allowed actions and reusable workflows for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#get-allowed-actions-and-workflows-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-a-repository func (s *RepositoriesService) GetActionsAllowed(ctx context.Context, org, repo string) (*ActionsAllowed, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions/selected-actions", org, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -29,9 +29,9 @@ func (s *RepositoriesService) GetActionsAllowed(ctx context.Context, org, repo s return actionsAllowed, resp, nil } -// EditActionsAllowed sets the actions that are allowed in a repository. +// EditActionsAllowed sets the allowed actions and reusable workflows for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#set-allowed-actions-and-workflows-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-a-repository func (s *RepositoriesService) EditActionsAllowed(ctx context.Context, org, repo string, actionsAllowed ActionsAllowed) (*ActionsAllowed, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions/selected-actions", org, repo) req, err := s.client.NewRequest("PUT", u, actionsAllowed) diff --git a/github/repos_actions_permissions.go b/github/repos_actions_permissions.go index bff8c2f5ab4..45f844cec02 100644 --- a/github/repos_actions_permissions.go +++ b/github/repos_actions_permissions.go @@ -12,7 +12,7 @@ import ( // ActionsPermissionsRepository represents a policy for repositories and allowed actions in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#set-github-actions-permissions-for-a-repository--parameters +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions type ActionsPermissionsRepository struct { Enabled *bool `json:"enabled,omitempty"` AllowedActions *string `json:"allowed_actions,omitempty"` @@ -25,7 +25,7 @@ func (a ActionsPermissionsRepository) String() string { // GetActionsPermissions gets the GitHub Actions permissions policy for repositories and allowed actions in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#get-github-actions-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#get-github-actions-permissions-for-a-repository func (s *RepositoriesService) GetActionsPermissions(ctx context.Context, owner, repo string) (*ActionsPermissionsRepository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -44,7 +44,7 @@ func (s *RepositoriesService) GetActionsPermissions(ctx context.Context, owner, // EditActionsPermissions sets the permissions policy for repositories and allowed actions in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#set-github-actions-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-github-actions-permissions-for-a-repository func (s *RepositoriesService) EditActionsPermissions(ctx context.Context, owner, repo string, actionsPermissionsRepository ActionsPermissionsRepository) (*ActionsPermissionsRepository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions", owner, repo) req, err := s.client.NewRequest("PUT", u, actionsPermissionsRepository) diff --git a/github/repos_autolinks.go b/github/repos_autolinks.go index b6404783eb7..8fa916eac2c 100644 --- a/github/repos_autolinks.go +++ b/github/repos_autolinks.go @@ -26,7 +26,7 @@ type Autolink struct { // ListAutolinks returns a list of autolinks configured for the given repository. // Information about autolinks are only available to repository administrators. // -// GitHub API docs: https://docs.github.com/en/rest/reference/repos#list-all-autolinks-of-a-repository +// GitHub API docs: https://docs.github.com/en/rest/repos/autolinks#list-all-autolinks-of-a-repository func (s *RepositoriesService) ListAutolinks(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Autolink, *Response, error) { u := fmt.Sprintf("repos/%v/%v/autolinks", owner, repo) u, err := addOptions(u, opts) @@ -51,7 +51,7 @@ func (s *RepositoriesService) ListAutolinks(ctx context.Context, owner, repo str // AddAutolink creates an autolink reference for a repository. // Users with admin access to the repository can create an autolink. // -// GitHub API docs: https://docs.github.com/en/rest/reference/repos#create-an-autolink-reference-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/repos/autolinks#create-an-autolink-reference-for-a-repository func (s *RepositoriesService) AddAutolink(ctx context.Context, owner, repo string, opts *AutolinkOptions) (*Autolink, *Response, error) { u := fmt.Sprintf("repos/%v/%v/autolinks", owner, repo) req, err := s.client.NewRequest("POST", u, opts) @@ -70,7 +70,7 @@ func (s *RepositoriesService) AddAutolink(ctx context.Context, owner, repo strin // GetAutolink returns a single autolink reference by ID that was configured for the given repository. // Information about autolinks are only available to repository administrators. // -// GitHub API docs: https://docs.github.com/en/rest/reference/repos#get-an-autolink-reference-of-a-repository +// GitHub API docs: https://docs.github.com/en/rest/repos/autolinks#get-an-autolink-reference-of-a-repository func (s *RepositoriesService) GetAutolink(ctx context.Context, owner, repo string, id int64) (*Autolink, *Response, error) { u := fmt.Sprintf("repos/%v/%v/autolinks/%v", owner, repo, id) @@ -91,7 +91,7 @@ func (s *RepositoriesService) GetAutolink(ctx context.Context, owner, repo strin // DeleteAutolink deletes a single autolink reference by ID that was configured for the given repository. // Information about autolinks are only available to repository administrators. // -// GitHub API docs: https://docs.github.com/en/rest/reference/repos#delete-an-autolink-reference-from-a-repository +// GitHub API docs: https://docs.github.com/en/rest/repos/autolinks#delete-an-autolink-reference-from-a-repository func (s *RepositoriesService) DeleteAutolink(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/autolinks/%v", owner, repo, id) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/repos_collaborators.go b/github/repos_collaborators.go index dcb97b5ed23..abc4161c3bb 100644 --- a/github/repos_collaborators.go +++ b/github/repos_collaborators.go @@ -27,7 +27,7 @@ type ListCollaboratorsOptions struct { } // CollaboratorInvitation represents an invitation created when adding a collaborator. -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/collaborators/#response-when-a-new-invitation-is-created +// GitHub API docs: https://docs.github.com/en/rest/repos/collaborators/#response-when-a-new-invitation-is-created type CollaboratorInvitation struct { ID *int64 `json:"id,omitempty"` Repo *Repository `json:"repository,omitempty"` @@ -41,7 +41,7 @@ type CollaboratorInvitation struct { // ListCollaborators lists the GitHub users that have access to the repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#list-repository-collaborators +// GitHub API docs: https://docs.github.com/en/rest/collaborators/collaborators#list-repository-collaborators func (s *RepositoriesService) ListCollaborators(ctx context.Context, owner, repo string, opts *ListCollaboratorsOptions) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%v/%v/collaborators", owner, repo) u, err := addOptions(u, opts) @@ -68,7 +68,7 @@ func (s *RepositoriesService) ListCollaborators(ctx context.Context, owner, repo // Note: This will return false if the user is not a collaborator OR the user // is not a GitHub user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#check-if-a-user-is-a-repository-collaborator +// GitHub API docs: https://docs.github.com/en/rest/collaborators/collaborators#check-if-a-user-is-a-repository-collaborator func (s *RepositoriesService) IsCollaborator(ctx context.Context, owner, repo, user string) (bool, *Response, error) { u := fmt.Sprintf("repos/%v/%v/collaborators/%v", owner, repo, user) req, err := s.client.NewRequest("GET", u, nil) @@ -91,7 +91,8 @@ type RepositoryPermissionLevel struct { } // GetPermissionLevel retrieves the specific permission level a collaborator has for a given repository. -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-repository-permissions-for-a-user +// +// GitHub API docs: https://docs.github.com/en/rest/collaborators/collaborators#get-repository-permissions-for-a-user func (s *RepositoriesService) GetPermissionLevel(ctx context.Context, owner, repo, user string) (*RepositoryPermissionLevel, *Response, error) { u := fmt.Sprintf("repos/%v/%v/collaborators/%v/permission", owner, repo, user) req, err := s.client.NewRequest("GET", u, nil) @@ -126,7 +127,7 @@ type RepositoryAddCollaboratorOptions struct { // AddCollaborator sends an invitation to the specified GitHub user // to become a collaborator to the given repo. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#add-a-repository-collaborator +// GitHub API docs: https://docs.github.com/en/rest/collaborators/collaborators#add-a-repository-collaborator func (s *RepositoriesService) AddCollaborator(ctx context.Context, owner, repo, user string, opts *RepositoryAddCollaboratorOptions) (*CollaboratorInvitation, *Response, error) { u := fmt.Sprintf("repos/%v/%v/collaborators/%v", owner, repo, user) req, err := s.client.NewRequest("PUT", u, opts) @@ -146,7 +147,7 @@ func (s *RepositoriesService) AddCollaborator(ctx context.Context, owner, repo, // RemoveCollaborator removes the specified GitHub user as collaborator from the given repo. // Note: Does not return error if a valid user that is not a collaborator is removed. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#remove-a-repository-collaborator +// GitHub API docs: https://docs.github.com/en/rest/collaborators/collaborators#remove-a-repository-collaborator func (s *RepositoriesService) RemoveCollaborator(ctx context.Context, owner, repo, user string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/collaborators/%v", owner, repo, user) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/repos_comments.go b/github/repos_comments.go index 912eeba3fb2..55a88d1f5e9 100644 --- a/github/repos_comments.go +++ b/github/repos_comments.go @@ -36,7 +36,7 @@ func (r RepositoryComment) String() string { // ListComments lists all the comments for the repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#list-commit-comments-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/commits/comments#list-commit-comments-for-a-repository func (s *RepositoriesService) ListComments(ctx context.Context, owner, repo string, opts *ListOptions) ([]*RepositoryComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments", owner, repo) u, err := addOptions(u, opts) @@ -63,7 +63,7 @@ func (s *RepositoriesService) ListComments(ctx context.Context, owner, repo stri // ListCommitComments lists all the comments for a given commit SHA. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#list-commit-comments +// GitHub API docs: https://docs.github.com/en/rest/commits/comments#list-commit-comments func (s *RepositoriesService) ListCommitComments(ctx context.Context, owner, repo, sha string, opts *ListOptions) ([]*RepositoryComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/comments", owner, repo, sha) u, err := addOptions(u, opts) @@ -91,7 +91,7 @@ func (s *RepositoriesService) ListCommitComments(ctx context.Context, owner, rep // CreateComment creates a comment for the given commit. // Note: GitHub allows for comments to be created for non-existing files and positions. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#create-a-commit-comment +// GitHub API docs: https://docs.github.com/en/rest/commits/comments#create-a-commit-comment func (s *RepositoriesService) CreateComment(ctx context.Context, owner, repo, sha string, comment *RepositoryComment) (*RepositoryComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/comments", owner, repo, sha) req, err := s.client.NewRequest("POST", u, comment) @@ -110,7 +110,7 @@ func (s *RepositoriesService) CreateComment(ctx context.Context, owner, repo, sh // GetComment gets a single comment from a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-a-commit-comment +// GitHub API docs: https://docs.github.com/en/rest/commits/comments#get-a-commit-comment func (s *RepositoriesService) GetComment(ctx context.Context, owner, repo string, id int64) (*RepositoryComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v", owner, repo, id) req, err := s.client.NewRequest("GET", u, nil) @@ -132,7 +132,7 @@ func (s *RepositoriesService) GetComment(ctx context.Context, owner, repo string // UpdateComment updates the body of a single comment. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#update-a-commit-comment +// GitHub API docs: https://docs.github.com/en/rest/commits/comments#update-a-commit-comment func (s *RepositoriesService) UpdateComment(ctx context.Context, owner, repo string, id int64, comment *RepositoryComment) (*RepositoryComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v", owner, repo, id) req, err := s.client.NewRequest("PATCH", u, comment) @@ -151,7 +151,7 @@ func (s *RepositoriesService) UpdateComment(ctx context.Context, owner, repo str // DeleteComment deletes a single comment from a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#delete-a-commit-comment +// GitHub API docs: https://docs.github.com/en/rest/commits/comments#delete-a-commit-comment func (s *RepositoriesService) DeleteComment(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v", owner, repo, id) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/repos_commits.go b/github/repos_commits.go index ce3b48e3c53..d1fb577c61c 100644 --- a/github/repos_commits.go +++ b/github/repos_commits.go @@ -124,7 +124,7 @@ type BranchCommit struct { // ListCommits lists the commits of a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#list-commits +// GitHub API docs: https://docs.github.com/en/rest/commits/commits#list-commits func (s *RepositoriesService) ListCommits(ctx context.Context, owner, repo string, opts *CommitsListOptions) ([]*RepositoryCommit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits", owner, repo) u, err := addOptions(u, opts) @@ -148,8 +148,8 @@ func (s *RepositoriesService) ListCommits(ctx context.Context, owner, repo strin // GetCommit fetches the specified commit, including all details about it. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-a-single-commit -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-a-commit +// GitHub API docs: https://docs.github.com/en/rest/commits/commits#get-a-single-commit +// GitHub API docs: https://docs.github.com/en/rest/commits/commits#get-a-commit func (s *RepositoriesService) GetCommit(ctx context.Context, owner, repo, sha string, opts *ListOptions) (*RepositoryCommit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v", owner, repo, sha) u, err := addOptions(u, opts) @@ -173,7 +173,7 @@ func (s *RepositoriesService) GetCommit(ctx context.Context, owner, repo, sha st // GetCommitRaw fetches the specified commit in raw (diff or patch) format. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-a-commit +// GitHub API docs: https://docs.github.com/en/rest/commits/commits#get-a-commit func (s *RepositoriesService) GetCommitRaw(ctx context.Context, owner string, repo string, sha string, opts RawOptions) (string, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v", owner, repo, sha) req, err := s.client.NewRequest("GET", u, nil) @@ -202,7 +202,7 @@ func (s *RepositoriesService) GetCommitRaw(ctx context.Context, owner string, re // GetCommitSHA1 gets the SHA-1 of a commit reference. If a last-known SHA1 is // supplied and no new commits have occurred, a 304 Unmodified response is returned. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-a-commit +// GitHub API docs: https://docs.github.com/en/rest/commits/commits#get-a-commit func (s *RepositoriesService) GetCommitSHA1(ctx context.Context, owner, repo, ref, lastSHA string) (string, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v", owner, repo, refURLEscape(ref)) @@ -227,7 +227,7 @@ func (s *RepositoriesService) GetCommitSHA1(ctx context.Context, owner, repo, re // CompareCommits compares a range of commits with each other. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#compare-two-commits +// GitHub API docs: https://docs.github.com/en/rest/commits/commits#compare-two-commits func (s *RepositoriesService) CompareCommits(ctx context.Context, owner, repo string, base, head string, opts *ListOptions) (*CommitsComparison, *Response, error) { escapedBase := url.QueryEscape(base) escapedHead := url.QueryEscape(head) @@ -258,7 +258,7 @@ func (s *RepositoriesService) CompareCommits(ctx context.Context, owner, repo st // To compare branches across other repositories in the same network as "repo", // use the format ":branch". // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#compare-two-commits +// GitHub API docs: https://docs.github.com/en/rest/commits/commits#compare-two-commits func (s *RepositoriesService) CompareCommitsRaw(ctx context.Context, owner, repo, base, head string, opts RawOptions) (string, *Response, error) { escapedBase := url.QueryEscape(base) escapedHead := url.QueryEscape(head) @@ -291,7 +291,7 @@ func (s *RepositoriesService) CompareCommitsRaw(ctx context.Context, owner, repo // ListBranchesHeadCommit gets all branches where the given commit SHA is the HEAD, // or latest commit for the branch. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#list-branches-for-head-commit +// GitHub API docs: https://docs.github.com/en/rest/commits/commits#list-branches-for-head-commit func (s *RepositoriesService) ListBranchesHeadCommit(ctx context.Context, owner, repo, sha string) ([]*BranchCommit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/branches-where-head", owner, repo, sha) diff --git a/github/repos_community_health.go b/github/repos_community_health.go index 92e4d082ce6..9de438b6259 100644 --- a/github/repos_community_health.go +++ b/github/repos_community_health.go @@ -44,7 +44,7 @@ type CommunityHealthMetrics struct { // GetCommunityHealthMetrics retrieves all the community health metrics for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/reference/repos#get-community-profile-metrics +// GitHub API docs: https://docs.github.com/en/rest/metrics/community#get-community-profile-metrics func (s *RepositoriesService) GetCommunityHealthMetrics(ctx context.Context, owner, repo string) (*CommunityHealthMetrics, *Response, error) { u := fmt.Sprintf("repos/%v/%v/community/profile", owner, repo) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/repos_contents.go b/github/repos_contents.go index 31751372508..d6f2dd9d74f 100644 --- a/github/repos_contents.go +++ b/github/repos_contents.go @@ -4,7 +4,7 @@ // license that can be found in the LICENSE file. // Repository contents API methods. -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/contents/ +// GitHub API docs: https://docs.github.com/en/rest/repos/contents/ package github @@ -95,7 +95,7 @@ func (r *RepositoryContent) GetContent() (string, error) { // GetReadme gets the Readme file for the repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-a-repository-readme +// GitHub API docs: https://docs.github.com/en/rest/repos/contents#get-a-repository-readme func (s *RepositoriesService) GetReadme(ctx context.Context, owner, repo string, opts *RepositoryContentGetOptions) (*RepositoryContent, *Response, error) { u := fmt.Sprintf("repos/%v/%v/readme", owner, repo) u, err := addOptions(u, opts) @@ -192,7 +192,7 @@ func (s *RepositoriesService) DownloadContentsWithMeta(ctx context.Context, owne // as possible, both result types will be returned but only one will contain a // value and the other will be nil. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-repository-content +// GitHub API docs: https://docs.github.com/en/rest/repos/contents#get-repository-content func (s *RepositoriesService) GetContents(ctx context.Context, owner, repo, path string, opts *RepositoryContentGetOptions) (fileContent *RepositoryContent, directoryContent []*RepositoryContent, resp *Response, err error) { escapedPath := (&url.URL{Path: strings.TrimSuffix(path, "/")}).String() u := fmt.Sprintf("repos/%s/%s/contents/%s", owner, repo, escapedPath) @@ -228,7 +228,7 @@ func (s *RepositoriesService) GetContents(ctx context.Context, owner, repo, path // CreateFile creates a new file in a repository at the given path and returns // the commit and file metadata. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#create-or-update-file-contents +// GitHub API docs: https://docs.github.com/en/rest/repos/contents#create-or-update-file-contents func (s *RepositoriesService) CreateFile(ctx context.Context, owner, repo, path string, opts *RepositoryContentFileOptions) (*RepositoryContentResponse, *Response, error) { u := fmt.Sprintf("repos/%s/%s/contents/%s", owner, repo, path) req, err := s.client.NewRequest("PUT", u, opts) @@ -248,7 +248,7 @@ func (s *RepositoriesService) CreateFile(ctx context.Context, owner, repo, path // UpdateFile updates a file in a repository at the given path and returns the // commit and file metadata. Requires the blob SHA of the file being updated. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#create-or-update-file-contents +// GitHub API docs: https://docs.github.com/en/rest/repos/contents#create-or-update-file-contents func (s *RepositoriesService) UpdateFile(ctx context.Context, owner, repo, path string, opts *RepositoryContentFileOptions) (*RepositoryContentResponse, *Response, error) { u := fmt.Sprintf("repos/%s/%s/contents/%s", owner, repo, path) req, err := s.client.NewRequest("PUT", u, opts) @@ -268,7 +268,7 @@ func (s *RepositoriesService) UpdateFile(ctx context.Context, owner, repo, path // DeleteFile deletes a file from a repository and returns the commit. // Requires the blob SHA of the file to be deleted. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#delete-a-file +// GitHub API docs: https://docs.github.com/en/rest/repos/contents#delete-a-file func (s *RepositoriesService) DeleteFile(ctx context.Context, owner, repo, path string, opts *RepositoryContentFileOptions) (*RepositoryContentResponse, *Response, error) { u := fmt.Sprintf("repos/%s/%s/contents/%s", owner, repo, path) req, err := s.client.NewRequest("DELETE", u, opts) @@ -300,7 +300,7 @@ const ( // repository. The archiveFormat can be specified by either the github.Tarball // or github.Zipball constant. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/contents/#get-archive-link +// GitHub API docs: https://docs.github.com/en/rest/repos/contents/#get-archive-link func (s *RepositoriesService) GetArchiveLink(ctx context.Context, owner, repo string, archiveformat ArchiveFormat, opts *RepositoryContentGetOptions, followRedirects bool) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%s/%s/%s", owner, repo, archiveformat) if opts != nil && opts.Ref != "" { diff --git a/github/repos_deployments.go b/github/repos_deployments.go index 7308bcebe5a..36445f895e2 100644 --- a/github/repos_deployments.go +++ b/github/repos_deployments.go @@ -63,7 +63,7 @@ type DeploymentsListOptions struct { // ListDeployments lists the deployments of a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#list-deployments +// GitHub API docs: https://docs.github.com/en/rest/deployments/deployments#list-deployments func (s *RepositoriesService) ListDeployments(ctx context.Context, owner, repo string, opts *DeploymentsListOptions) ([]*Deployment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments", owner, repo) u, err := addOptions(u, opts) @@ -87,7 +87,7 @@ func (s *RepositoriesService) ListDeployments(ctx context.Context, owner, repo s // GetDeployment returns a single deployment of a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-a-deployment +// GitHub API docs: https://docs.github.com/en/rest/deployments/deployments#get-a-deployment func (s *RepositoriesService) GetDeployment(ctx context.Context, owner, repo string, deploymentID int64) (*Deployment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments/%v", owner, repo, deploymentID) @@ -107,7 +107,7 @@ func (s *RepositoriesService) GetDeployment(ctx context.Context, owner, repo str // CreateDeployment creates a new deployment for a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#create-a-deployment +// GitHub API docs: https://docs.github.com/en/rest/deployments/deployments#create-a-deployment func (s *RepositoriesService) CreateDeployment(ctx context.Context, owner, repo string, request *DeploymentRequest) (*Deployment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments", owner, repo) @@ -131,7 +131,7 @@ func (s *RepositoriesService) CreateDeployment(ctx context.Context, owner, repo // DeleteDeployment deletes an existing deployment for a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#delete-a-deployment +// GitHub API docs: https://docs.github.com/en/rest/deployments/deployments#delete-a-deployment func (s *RepositoriesService) DeleteDeployment(ctx context.Context, owner, repo string, deploymentID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments/%v", owner, repo, deploymentID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -175,7 +175,7 @@ type DeploymentStatusRequest struct { // ListDeploymentStatuses lists the statuses of a given deployment of a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#list-deployment-statuses +// GitHub API docs: https://docs.github.com/en/rest/deployments/statuses#list-deployment-statuses func (s *RepositoriesService) ListDeploymentStatuses(ctx context.Context, owner, repo string, deployment int64, opts *ListOptions) ([]*DeploymentStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments/%v/statuses", owner, repo, deployment) u, err := addOptions(u, opts) @@ -203,7 +203,7 @@ func (s *RepositoriesService) ListDeploymentStatuses(ctx context.Context, owner, // GetDeploymentStatus returns a single deployment status of a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-a-deployment-status +// GitHub API docs: https://docs.github.com/en/rest/deployments/statuses#get-a-deployment-status func (s *RepositoriesService) GetDeploymentStatus(ctx context.Context, owner, repo string, deploymentID, deploymentStatusID int64) (*DeploymentStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments/%v/statuses/%v", owner, repo, deploymentID, deploymentStatusID) @@ -227,7 +227,7 @@ func (s *RepositoriesService) GetDeploymentStatus(ctx context.Context, owner, re // CreateDeploymentStatus creates a new status for a deployment. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#create-a-deployment-status +// GitHub API docs: https://docs.github.com/en/rest/deployments/statuses#create-a-deployment-status func (s *RepositoriesService) CreateDeploymentStatus(ctx context.Context, owner, repo string, deployment int64, request *DeploymentStatusRequest) (*DeploymentStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments/%v/statuses", owner, repo, deployment) diff --git a/github/repos_environments.go b/github/repos_environments.go index 5dd454289c3..365f8d92022 100644 --- a/github/repos_environments.go +++ b/github/repos_environments.go @@ -104,7 +104,7 @@ func (r *RequiredReviewer) UnmarshalJSON(data []byte) error { // ListEnvironments lists all environments for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/reference/repos#get-all-environments +// GitHub API docs: https://docs.github.com/en/rest/deployments/environments#get-all-environments func (s *RepositoriesService) ListEnvironments(ctx context.Context, owner, repo string, opts *EnvironmentListOptions) (*EnvResponse, *Response, error) { u := fmt.Sprintf("repos/%s/%s/environments", owner, repo) u, err := addOptions(u, opts) @@ -127,7 +127,7 @@ func (s *RepositoriesService) ListEnvironments(ctx context.Context, owner, repo // GetEnvironment get a single environment for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/reference/repos#get-an-environment +// GitHub API docs: https://docs.github.com/en/rest/deployments/environments#get-an-environment func (s *RepositoriesService) GetEnvironment(ctx context.Context, owner, repo, name string) (*Environment, *Response, error) { u := fmt.Sprintf("repos/%s/%s/environments/%s", owner, repo, name) @@ -170,7 +170,7 @@ type CreateUpdateEnvironment struct { // CreateUpdateEnvironment create or update a new environment for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/reference/repos#create-or-update-an-environment +// GitHub API docs: https://docs.github.com/en/rest/deployments/environments#create-or-update-an-environment func (s *RepositoriesService) CreateUpdateEnvironment(ctx context.Context, owner, repo, name string, environment *CreateUpdateEnvironment) (*Environment, *Response, error) { u := fmt.Sprintf("repos/%s/%s/environments/%s", owner, repo, name) @@ -189,7 +189,7 @@ func (s *RepositoriesService) CreateUpdateEnvironment(ctx context.Context, owner // DeleteEnvironment delete an environment from a repository. // -// GitHub API docs: https://docs.github.com/en/rest/reference/repos#delete-an-environment +// GitHub API docs: https://docs.github.com/en/rest/deployments/environments#delete-an-environment func (s *RepositoriesService) DeleteEnvironment(ctx context.Context, owner, repo, name string) (*Response, error) { u := fmt.Sprintf("repos/%s/%s/environments/%s", owner, repo, name) diff --git a/github/repos_forks.go b/github/repos_forks.go index 74b9b445ea6..97bb328ffb4 100644 --- a/github/repos_forks.go +++ b/github/repos_forks.go @@ -24,7 +24,7 @@ type RepositoryListForksOptions struct { // ListForks lists the forks of the specified repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#list-forks +// GitHub API docs: https://docs.github.com/en/rest/repos/forks#list-forks func (s *RepositoriesService) ListForks(ctx context.Context, owner, repo string, opts *RepositoryListForksOptions) ([]*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/forks", owner, repo) u, err := addOptions(u, opts) @@ -65,7 +65,7 @@ type RepositoryCreateForkOptions struct { // A follow up request, after a delay of a second or so, should result // in a successful request. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#create-a-fork +// GitHub API docs: https://docs.github.com/en/rest/repos/forks#create-a-fork func (s *RepositoriesService) CreateFork(ctx context.Context, owner, repo string, opts *RepositoryCreateForkOptions) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/forks", owner, repo) u, err := addOptions(u, opts) diff --git a/github/repos_hooks.go b/github/repos_hooks.go index 61c85219935..4e738cfe8ce 100644 --- a/github/repos_hooks.go +++ b/github/repos_hooks.go @@ -77,7 +77,7 @@ type createHookRequest struct { // Note that only a subset of the hook fields are used and hook must // not be nil. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#create-a-repository-webhook +// GitHub API docs: https://docs.github.com/en/rest/webhooks/repos#create-a-repository-webhook func (s *RepositoriesService) CreateHook(ctx context.Context, owner, repo string, hook *Hook) (*Hook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks", owner, repo) @@ -104,7 +104,7 @@ func (s *RepositoriesService) CreateHook(ctx context.Context, owner, repo string // ListHooks lists all Hooks for the specified repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#list-repository-webhooks +// GitHub API docs: https://docs.github.com/en/rest/webhooks/repos#list-repository-webhooks func (s *RepositoriesService) ListHooks(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Hook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks", owner, repo) u, err := addOptions(u, opts) @@ -128,7 +128,7 @@ func (s *RepositoriesService) ListHooks(ctx context.Context, owner, repo string, // GetHook returns a single specified Hook. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-a-repository-webhook +// GitHub API docs: https://docs.github.com/en/rest/webhooks/repos#get-a-repository-webhook func (s *RepositoriesService) GetHook(ctx context.Context, owner, repo string, id int64) (*Hook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%d", owner, repo, id) req, err := s.client.NewRequest("GET", u, nil) @@ -146,7 +146,7 @@ func (s *RepositoriesService) GetHook(ctx context.Context, owner, repo string, i // EditHook updates a specified Hook. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#update-a-repository-webhook +// GitHub API docs: https://docs.github.com/en/rest/webhooks/repos#update-a-repository-webhook func (s *RepositoriesService) EditHook(ctx context.Context, owner, repo string, id int64, hook *Hook) (*Hook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%d", owner, repo, id) req, err := s.client.NewRequest("PATCH", u, hook) @@ -164,7 +164,7 @@ func (s *RepositoriesService) EditHook(ctx context.Context, owner, repo string, // DeleteHook deletes a specified Hook. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#delete-a-repository-webhook +// GitHub API docs: https://docs.github.com/en/rest/webhooks/repos#delete-a-repository-webhook func (s *RepositoriesService) DeleteHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%d", owner, repo, id) req, err := s.client.NewRequest("DELETE", u, nil) @@ -176,7 +176,7 @@ func (s *RepositoriesService) DeleteHook(ctx context.Context, owner, repo string // PingHook triggers a 'ping' event to be sent to the Hook. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#ping-a-repository-webhook +// GitHub API docs: https://docs.github.com/en/rest/webhooks/repos#ping-a-repository-webhook func (s *RepositoriesService) PingHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%d/pings", owner, repo, id) req, err := s.client.NewRequest("POST", u, nil) @@ -188,7 +188,7 @@ func (s *RepositoriesService) PingHook(ctx context.Context, owner, repo string, // TestHook triggers a test Hook by github. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#test-the-push-repository-webhook +// GitHub API docs: https://docs.github.com/en/rest/webhooks/repos#test-the-push-repository-webhook func (s *RepositoriesService) TestHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%d/tests", owner, repo, id) req, err := s.client.NewRequest("POST", u, nil) diff --git a/github/repos_hooks_deliveries.go b/github/repos_hooks_deliveries.go index 7420b59e7c3..cbd2d3819a1 100644 --- a/github/repos_hooks_deliveries.go +++ b/github/repos_hooks_deliveries.go @@ -14,8 +14,8 @@ import ( // HookDelivery represents the data that is received from GitHub's Webhook Delivery API // // GitHub API docs: -// - https://docs.github.com/en/rest/reference/repos#list-deliveries-for-a-repository-webhook -// - https://docs.github.com/en/rest/reference/repos#get-a-delivery-for-a-repository-webhook +// - https://docs.github.com/en/rest/webhooks/repo-deliveries#list-deliveries-for-a-repository-webhook +// - https://docs.github.com/en/rest/webhooks/repo-deliveries#get-a-delivery-for-a-repository-webhook type HookDelivery struct { ID *int64 `json:"id,omitempty"` GUID *string `json:"guid,omitempty"` @@ -63,7 +63,7 @@ func (r HookResponse) String() string { // ListHookDeliveries lists webhook deliveries for a webhook configured in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/reference/repos#list-deliveries-for-a-repository-webhook +// GitHub API docs: https://docs.github.com/en/rest/webhooks/repo-deliveries#list-deliveries-for-a-repository-webhook func (s *RepositoriesService) ListHookDeliveries(ctx context.Context, owner, repo string, id int64, opts *ListCursorOptions) ([]*HookDelivery, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%v/deliveries", owner, repo, id) u, err := addOptions(u, opts) @@ -87,7 +87,7 @@ func (s *RepositoriesService) ListHookDeliveries(ctx context.Context, owner, rep // GetHookDelivery returns a delivery for a webhook configured in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/reference/repos#get-a-delivery-for-a-repository-webhook +// GitHub API docs: https://docs.github.com/en/rest/webhooks/repo-deliveries#get-a-delivery-for-a-repository-webhook func (s *RepositoriesService) GetHookDelivery(ctx context.Context, owner, repo string, hookID, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%v/deliveries/%v", owner, repo, hookID, deliveryID) req, err := s.client.NewRequest("GET", u, nil) @@ -106,7 +106,7 @@ func (s *RepositoriesService) GetHookDelivery(ctx context.Context, owner, repo s // RedeliverHookDelivery redelivers a delivery for a webhook configured in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/reference/webhooks#redeliver-a-delivery-for-a-repository-webhook +// GitHub API docs: https://docs.github.com/en/rest/webhooks/repo-deliveries#redeliver-a-delivery-for-a-repository-webhook func (s *RepositoriesService) RedeliverHookDelivery(ctx context.Context, owner, repo string, hookID, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%v/deliveries/%v/attempts", owner, repo, hookID, deliveryID) req, err := s.client.NewRequest("POST", u, nil) diff --git a/github/repos_invitations.go b/github/repos_invitations.go index 79dd57889b3..81956cd49c9 100644 --- a/github/repos_invitations.go +++ b/github/repos_invitations.go @@ -27,7 +27,7 @@ type RepositoryInvitation struct { // ListInvitations lists all currently-open repository invitations. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#list-repository-invitations +// GitHub API docs: https://docs.github.com/en/rest/collaborators/invitations#list-repository-invitations func (s *RepositoriesService) ListInvitations(ctx context.Context, owner, repo string, opts *ListOptions) ([]*RepositoryInvitation, *Response, error) { u := fmt.Sprintf("repos/%v/%v/invitations", owner, repo) u, err := addOptions(u, opts) @@ -51,7 +51,7 @@ func (s *RepositoriesService) ListInvitations(ctx context.Context, owner, repo s // DeleteInvitation deletes a repository invitation. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#delete-a-repository-invitation +// GitHub API docs: https://docs.github.com/en/rest/collaborators/invitations#delete-a-repository-invitation func (s *RepositoriesService) DeleteInvitation(ctx context.Context, owner, repo string, invitationID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/invitations/%v", owner, repo, invitationID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -68,7 +68,7 @@ func (s *RepositoriesService) DeleteInvitation(ctx context.Context, owner, repo // permissions represents the permissions that the associated user will have // on the repository. Possible values are: "read", "write", "admin". // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#update-a-repository-invitation +// GitHub API docs: https://docs.github.com/en/rest/collaborators/invitations#update-a-repository-invitation func (s *RepositoriesService) UpdateInvitation(ctx context.Context, owner, repo string, invitationID int64, permissions string) (*RepositoryInvitation, *Response, error) { opts := &struct { Permissions string `json:"permissions"` diff --git a/github/repos_keys.go b/github/repos_keys.go index 3e127ae4350..42c5de49709 100644 --- a/github/repos_keys.go +++ b/github/repos_keys.go @@ -14,7 +14,7 @@ import ( // ListKeys lists the deploy keys for a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#list-deploy-keys +// GitHub API docs: https://docs.github.com/en/rest/deploy-keys#list-deploy-keys func (s *RepositoriesService) ListKeys(ctx context.Context, owner string, repo string, opts *ListOptions) ([]*Key, *Response, error) { u := fmt.Sprintf("repos/%v/%v/keys", owner, repo) u, err := addOptions(u, opts) @@ -38,7 +38,7 @@ func (s *RepositoriesService) ListKeys(ctx context.Context, owner string, repo s // GetKey fetches a single deploy key. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-a-deploy-key +// GitHub API docs: https://docs.github.com/en/rest/deploy-keys#get-a-deploy-key func (s *RepositoriesService) GetKey(ctx context.Context, owner string, repo string, id int64) (*Key, *Response, error) { u := fmt.Sprintf("repos/%v/%v/keys/%v", owner, repo, id) @@ -58,7 +58,7 @@ func (s *RepositoriesService) GetKey(ctx context.Context, owner string, repo str // CreateKey adds a deploy key for a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#create-a-deploy-key +// GitHub API docs: https://docs.github.com/en/rest/deploy-keys#create-a-deploy-key func (s *RepositoriesService) CreateKey(ctx context.Context, owner string, repo string, key *Key) (*Key, *Response, error) { u := fmt.Sprintf("repos/%v/%v/keys", owner, repo) @@ -78,7 +78,7 @@ func (s *RepositoriesService) CreateKey(ctx context.Context, owner string, repo // DeleteKey deletes a deploy key. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#delete-a-deploy-key +// GitHub API docs: https://docs.github.com/en/rest/deploy-keys#delete-a-deploy-key func (s *RepositoriesService) DeleteKey(ctx context.Context, owner string, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/keys/%v", owner, repo, id) diff --git a/github/repos_merging.go b/github/repos_merging.go index a8d860742c8..66e88452e86 100644 --- a/github/repos_merging.go +++ b/github/repos_merging.go @@ -34,7 +34,7 @@ type RepoMergeUpstreamResult struct { // Merge a branch in the specified repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#merge-a-branch +// GitHub API docs: https://docs.github.com/en/rest/branches/branches#merge-a-branch func (s *RepositoriesService) Merge(ctx context.Context, owner, repo string, request *RepositoryMergeRequest) (*RepositoryCommit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/merges", owner, repo) req, err := s.client.NewRequest("POST", u, request) @@ -54,7 +54,7 @@ func (s *RepositoriesService) Merge(ctx context.Context, owner, repo string, req // MergeUpstream syncs a branch of a forked repository to keep it up-to-date // with the upstream repository. // -// GitHub API docs: https://docs.github.com/en/rest/reference/branches#sync-a-fork-branch-with-the-upstream-repository +// GitHub API docs: https://docs.github.com/en/rest/branches/branches#sync-a-fork-branch-with-the-upstream-repository func (s *RepositoriesService) MergeUpstream(ctx context.Context, owner, repo string, request *RepoMergeUpstreamRequest) (*RepoMergeUpstreamResult, *Response, error) { u := fmt.Sprintf("repos/%v/%v/merge-upstream", owner, repo) req, err := s.client.NewRequest("POST", u, request) diff --git a/github/repos_pages.go b/github/repos_pages.go index 60a756b647e..9b864eb090c 100644 --- a/github/repos_pages.go +++ b/github/repos_pages.go @@ -63,7 +63,7 @@ type createPagesRequest struct { // EnablePages enables GitHub Pages for the named repo. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#create-a-github-pages-site +// GitHub API docs: https://docs.github.com/en/rest/pages#create-a-github-pages-site func (s *RepositoriesService) EnablePages(ctx context.Context, owner, repo string, pages *Pages) (*Pages, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages", owner, repo) @@ -106,7 +106,7 @@ type PagesUpdate struct { // UpdatePages updates GitHub Pages for the named repo. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#update-information-about-a-github-pages-site +// GitHub API docs: https://docs.github.com/en/rest/pages#update-information-about-a-github-pages-site func (s *RepositoriesService) UpdatePages(ctx context.Context, owner, repo string, opts *PagesUpdate) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/pages", owner, repo) @@ -125,7 +125,7 @@ func (s *RepositoriesService) UpdatePages(ctx context.Context, owner, repo strin // DisablePages disables GitHub Pages for the named repo. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#delete-a-github-pages-site +// GitHub API docs: https://docs.github.com/en/rest/pages#delete-a-github-pages-site func (s *RepositoriesService) DisablePages(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/pages", owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) @@ -141,7 +141,7 @@ func (s *RepositoriesService) DisablePages(ctx context.Context, owner, repo stri // GetPagesInfo fetches information about a GitHub Pages site. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-a-github-pages-site +// GitHub API docs: https://docs.github.com/en/rest/pages#get-a-github-pages-site func (s *RepositoriesService) GetPagesInfo(ctx context.Context, owner, repo string) (*Pages, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -160,7 +160,7 @@ func (s *RepositoriesService) GetPagesInfo(ctx context.Context, owner, repo stri // ListPagesBuilds lists the builds for a GitHub Pages site. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#list-github-pages-builds +// GitHub API docs: https://docs.github.com/en/rest/pages#list-github-pages-builds func (s *RepositoriesService) ListPagesBuilds(ctx context.Context, owner, repo string, opts *ListOptions) ([]*PagesBuild, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages/builds", owner, repo) u, err := addOptions(u, opts) @@ -184,7 +184,7 @@ func (s *RepositoriesService) ListPagesBuilds(ctx context.Context, owner, repo s // GetLatestPagesBuild fetches the latest build information for a GitHub pages site. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-latest-pages-build +// GitHub API docs: https://docs.github.com/en/rest/pages#get-latest-pages-build func (s *RepositoriesService) GetLatestPagesBuild(ctx context.Context, owner, repo string) (*PagesBuild, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages/builds/latest", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -203,7 +203,7 @@ func (s *RepositoriesService) GetLatestPagesBuild(ctx context.Context, owner, re // GetPageBuild fetches the specific build information for a GitHub pages site. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-github-pages-build +// GitHub API docs: https://docs.github.com/en/rest/pages#get-github-pages-build func (s *RepositoriesService) GetPageBuild(ctx context.Context, owner, repo string, id int64) (*PagesBuild, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages/builds/%v", owner, repo, id) req, err := s.client.NewRequest("GET", u, nil) @@ -222,7 +222,7 @@ func (s *RepositoriesService) GetPageBuild(ctx context.Context, owner, repo stri // RequestPageBuild requests a build of a GitHub Pages site without needing to push new commit. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#request-a-github-pages-build +// GitHub API docs: https://docs.github.com/en/rest/pages#request-a-github-pages-build func (s *RepositoriesService) RequestPageBuild(ctx context.Context, owner, repo string) (*PagesBuild, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages/builds", owner, repo) req, err := s.client.NewRequest("POST", u, nil) diff --git a/github/repos_projects.go b/github/repos_projects.go index 1938d51b9bf..a3001dee988 100644 --- a/github/repos_projects.go +++ b/github/repos_projects.go @@ -21,7 +21,7 @@ type ProjectListOptions struct { // ListProjects lists the projects for a repo. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/projects/#list-repository-projects +// GitHub API docs: https://docs.github.com/en/rest/projects/projects#list-repository-projects func (s *RepositoriesService) ListProjects(ctx context.Context, owner, repo string, opts *ProjectListOptions) ([]*Project, *Response, error) { u := fmt.Sprintf("repos/%v/%v/projects", owner, repo) u, err := addOptions(u, opts) @@ -48,7 +48,7 @@ func (s *RepositoriesService) ListProjects(ctx context.Context, owner, repo stri // CreateProject creates a GitHub Project for the specified repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/projects/#create-a-repository-project +// GitHub API docs: https://docs.github.com/en/rest/projects/projects#create-a-repository-project func (s *RepositoriesService) CreateProject(ctx context.Context, owner, repo string, opts *ProjectOptions) (*Project, *Response, error) { u := fmt.Sprintf("repos/%v/%v/projects", owner, repo) req, err := s.client.NewRequest("POST", u, opts) diff --git a/github/repos_releases.go b/github/repos_releases.go index 1cd2fae6691..f1ab65c185f 100644 --- a/github/repos_releases.go +++ b/github/repos_releases.go @@ -83,7 +83,7 @@ func (r ReleaseAsset) String() string { // ListReleases lists the releases for a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#list-releases +// GitHub API docs: https://docs.github.com/en/rest/releases/releases#list-releases func (s *RepositoriesService) ListReleases(ctx context.Context, owner, repo string, opts *ListOptions) ([]*RepositoryRelease, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases", owner, repo) u, err := addOptions(u, opts) @@ -106,7 +106,7 @@ func (s *RepositoriesService) ListReleases(ctx context.Context, owner, repo stri // GetRelease fetches a single release. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-a-release +// GitHub API docs: https://docs.github.com/en/rest/releases/releases#get-a-release func (s *RepositoriesService) GetRelease(ctx context.Context, owner, repo string, id int64) (*RepositoryRelease, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/%d", owner, repo, id) return s.getSingleRelease(ctx, u) @@ -114,7 +114,7 @@ func (s *RepositoriesService) GetRelease(ctx context.Context, owner, repo string // GetLatestRelease fetches the latest published release for the repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-the-latest-release +// GitHub API docs: https://docs.github.com/en/rest/releases/releases#get-the-latest-release func (s *RepositoriesService) GetLatestRelease(ctx context.Context, owner, repo string) (*RepositoryRelease, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/latest", owner, repo) return s.getSingleRelease(ctx, u) @@ -122,15 +122,15 @@ func (s *RepositoriesService) GetLatestRelease(ctx context.Context, owner, repo // GetReleaseByTag fetches a release with the specified tag. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-a-release-by-tag-name +// GitHub API docs: https://docs.github.com/en/rest/releases/releases#get-a-release-by-tag-name func (s *RepositoriesService) GetReleaseByTag(ctx context.Context, owner, repo, tag string) (*RepositoryRelease, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/tags/%s", owner, repo, tag) return s.getSingleRelease(ctx, u) } // GenerateReleaseNotes generates the release notes for the given tag. -// TODO: api docs -// GitHub API docs: +// +// GitHub API docs: https://docs.github.com/en/rest/releases/releases#generate-release-notes-content-for-a-release func (s *RepositoriesService) GenerateReleaseNotes(ctx context.Context, owner, repo string, opts *GenerateNotesOptions) (*RepositoryReleaseNotes, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/generate-notes", owner, repo) req, err := s.client.NewRequest("POST", u, opts) @@ -183,7 +183,7 @@ type repositoryReleaseRequest struct { // Note that only a subset of the release fields are used. // See RepositoryRelease for more information. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#create-a-release +// GitHub API docs: https://docs.github.com/en/rest/releases/releases#create-a-release func (s *RepositoriesService) CreateRelease(ctx context.Context, owner, repo string, release *RepositoryRelease) (*RepositoryRelease, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases", owner, repo) @@ -216,7 +216,7 @@ func (s *RepositoriesService) CreateRelease(ctx context.Context, owner, repo str // Note that only a subset of the release fields are used. // See RepositoryRelease for more information. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#update-a-release +// GitHub API docs: https://docs.github.com/en/rest/releases/releases#update-a-release func (s *RepositoriesService) EditRelease(ctx context.Context, owner, repo string, id int64, release *RepositoryRelease) (*RepositoryRelease, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/%d", owner, repo, id) @@ -246,7 +246,7 @@ func (s *RepositoriesService) EditRelease(ctx context.Context, owner, repo strin // DeleteRelease delete a single release from a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#delete-a-release +// GitHub API docs: https://docs.github.com/en/rest/releases/releases#delete-a-release func (s *RepositoriesService) DeleteRelease(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/%d", owner, repo, id) @@ -259,7 +259,7 @@ func (s *RepositoriesService) DeleteRelease(ctx context.Context, owner, repo str // ListReleaseAssets lists the release's assets. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#list-release-assets +// GitHub API docs: https://docs.github.com/en/rest/releases/assets#list-release-assets func (s *RepositoriesService) ListReleaseAssets(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*ReleaseAsset, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/%d/assets", owner, repo, id) u, err := addOptions(u, opts) @@ -282,7 +282,7 @@ func (s *RepositoriesService) ListReleaseAssets(ctx context.Context, owner, repo // GetReleaseAsset fetches a single release asset. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-a-release-asset +// GitHub API docs: https://docs.github.com/en/rest/releases/assets#get-a-release-asset func (s *RepositoriesService) GetReleaseAsset(ctx context.Context, owner, repo string, id int64) (*ReleaseAsset, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/assets/%d", owner, repo, id) @@ -311,7 +311,7 @@ func (s *RepositoriesService) GetReleaseAsset(ctx context.Context, owner, repo s // exist, but it's possible to pass any http.Client. If nil is passed the // redirectURL will be returned instead. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-a-release-asset +// GitHub API docs: https://docs.github.com/en/rest/releases/assets#get-a-release-asset func (s *RepositoriesService) DownloadReleaseAsset(ctx context.Context, owner, repo string, id int64, followRedirectsClient *http.Client) (rc io.ReadCloser, redirectURL string, err error) { u := fmt.Sprintf("repos/%s/%s/releases/assets/%d", owner, repo, id) @@ -373,7 +373,7 @@ func (s *RepositoriesService) downloadReleaseAssetFromURL(ctx context.Context, f // EditReleaseAsset edits a repository release asset. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#update-a-release-asset +// GitHub API docs: https://docs.github.com/en/rest/releases/assets#update-a-release-asset func (s *RepositoriesService) EditReleaseAsset(ctx context.Context, owner, repo string, id int64, release *ReleaseAsset) (*ReleaseAsset, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/assets/%d", owner, repo, id) @@ -392,7 +392,7 @@ func (s *RepositoriesService) EditReleaseAsset(ctx context.Context, owner, repo // DeleteReleaseAsset delete a single release asset from a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#delete-a-release-asset +// GitHub API docs: https://docs.github.com/en/rest/releases/assets#delete-a-release-asset func (s *RepositoriesService) DeleteReleaseAsset(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/assets/%d", owner, repo, id) @@ -406,7 +406,7 @@ func (s *RepositoriesService) DeleteReleaseAsset(ctx context.Context, owner, rep // UploadReleaseAsset creates an asset by uploading a file into a release repository. // To upload assets that cannot be represented by an os.File, call NewUploadRequest directly. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#upload-a-release-asset +// GitHub API docs: https://docs.github.com/en/rest/releases/assets#upload-a-release-asset func (s *RepositoriesService) UploadReleaseAsset(ctx context.Context, owner, repo string, id int64, opts *UploadOptions, file *os.File) (*ReleaseAsset, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/%d/assets", owner, repo, id) u, err := addOptions(u, opts) diff --git a/github/repos_stats.go b/github/repos_stats.go index 756dbc21b64..3df0a8f6deb 100644 --- a/github/repos_stats.go +++ b/github/repos_stats.go @@ -45,7 +45,7 @@ func (w WeeklyStats) String() string { // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-all-contributor-commit-activity +// GitHub API docs: https://docs.github.com/en/rest/metrics/statistics#get-all-contributor-commit-activity func (s *RepositoriesService) ListContributorsStats(ctx context.Context, owner, repo string) ([]*ContributorStats, *Response, error) { u := fmt.Sprintf("repos/%v/%v/stats/contributors", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -84,7 +84,7 @@ func (w WeeklyCommitActivity) String() string { // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-the-last-year-of-commit-activity +// GitHub API docs: https://docs.github.com/en/rest/metrics/statistics#get-the-last-year-of-commit-activity func (s *RepositoriesService) ListCommitActivity(ctx context.Context, owner, repo string) ([]*WeeklyCommitActivity, *Response, error) { u := fmt.Sprintf("repos/%v/%v/stats/commit_activity", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -111,7 +111,7 @@ func (s *RepositoriesService) ListCommitActivity(ctx context.Context, owner, rep // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-the-weekly-commit-activity +// GitHub API docs: https://docs.github.com/en/rest/metrics/statistics#get-the-weekly-commit-activity func (s *RepositoriesService) ListCodeFrequency(ctx context.Context, owner, repo string) ([]*WeeklyStats, *Response, error) { u := fmt.Sprintf("repos/%v/%v/stats/code_frequency", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -167,7 +167,7 @@ func (r RepositoryParticipation) String() string { // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-the-weekly-commit-count +// GitHub API docs: https://docs.github.com/en/rest/metrics/statistics#get-the-weekly-commit-count func (s *RepositoriesService) ListParticipation(ctx context.Context, owner, repo string) (*RepositoryParticipation, *Response, error) { u := fmt.Sprintf("repos/%v/%v/stats/participation", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -200,7 +200,7 @@ type PunchCard struct { // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-the-hourly-commit-count-for-each-day +// GitHub API docs: https://docs.github.com/en/rest/metrics/statistics#get-the-hourly-commit-count-for-each-day func (s *RepositoriesService) ListPunchCard(ctx context.Context, owner, repo string) ([]*PunchCard, *Response, error) { u := fmt.Sprintf("repos/%v/%v/stats/punch_card", owner, repo) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/repos_statuses.go b/github/repos_statuses.go index 347d856ae2c..42238f3c9d9 100644 --- a/github/repos_statuses.go +++ b/github/repos_statuses.go @@ -46,7 +46,7 @@ func (r RepoStatus) String() string { // ListStatuses lists the statuses of a repository at the specified // reference. ref can be a SHA, a branch name, or a tag name. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#list-commit-statuses-for-a-reference +// GitHub API docs: https://docs.github.com/en/rest/commits/statuses#list-commit-statuses-for-a-reference func (s *RepositoriesService) ListStatuses(ctx context.Context, owner, repo, ref string, opts *ListOptions) ([]*RepoStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/statuses", owner, repo, refURLEscape(ref)) u, err := addOptions(u, opts) @@ -71,7 +71,7 @@ func (s *RepositoriesService) ListStatuses(ctx context.Context, owner, repo, ref // CreateStatus creates a new status for a repository at the specified // reference. Ref can be a SHA, a branch name, or a tag name. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#create-a-commit-status +// GitHub API docs: https://docs.github.com/en/rest/commits/statuses#create-a-commit-status func (s *RepositoriesService) CreateStatus(ctx context.Context, owner, repo, ref string, status *RepoStatus) (*RepoStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/statuses/%v", owner, repo, refURLEscape(ref)) req, err := s.client.NewRequest("POST", u, status) @@ -110,7 +110,7 @@ func (s CombinedStatus) String() string { // GetCombinedStatus returns the combined status of a repository at the specified // reference. ref can be a SHA, a branch name, or a tag name. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-the-combined-status-for-a-specific-reference +// GitHub API docs: https://docs.github.com/en/rest/commits/statuses#get-the-combined-status-for-a-specific-reference func (s *RepositoriesService) GetCombinedStatus(ctx context.Context, owner, repo, ref string, opts *ListOptions) (*CombinedStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/status", owner, repo, refURLEscape(ref)) u, err := addOptions(u, opts) diff --git a/github/repos_test.go b/github/repos_test.go index cbf56a2f7c7..0bf228ebafe 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -393,14 +393,16 @@ func TestRepositoriesService_GetCodeOfConduct(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - mux.HandleFunc("/repos/o/r/community/code_of_conduct", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") testHeader(t, r, "Accept", mediaTypeCodesOfConductPreview) fmt.Fprint(w, `{ - "key": "key", - "name": "name", - "url": "url", - "body": "body"}`, + "code_of_conduct": { + "key": "key", + "name": "name", + "url": "url", + "body": "body" + }}`, ) }) @@ -1241,7 +1243,7 @@ func TestRepositoriesService_GetBranchProtection_branchNotProtected(t *testing.T w.WriteHeader(http.StatusBadRequest) fmt.Fprintf(w, `{ "message": %q, - "documentation_url": "https://docs.github.com/rest/reference/repos#get-branch-protection" + "documentation_url": "https://docs.github.com/rest/repos#get-branch-protection" }`, githubBranchNotProtected) }) @@ -1659,7 +1661,7 @@ func TestRepositoriesService_GetRequiredStatusChecks_branchNotProtected(t *testi w.WriteHeader(http.StatusBadRequest) fmt.Fprintf(w, `{ "message": %q, - "documentation_url": "https://docs.github.com/rest/reference/repos#get-branch-protection" + "documentation_url": "https://docs.github.com/rest/repos#get-branch-protection" }`, githubBranchNotProtected) }) @@ -1893,7 +1895,7 @@ func TestRepositoriesService_ListRequiredStatusChecksContexts_branchNotProtected w.WriteHeader(http.StatusBadRequest) fmt.Fprintf(w, `{ "message": %q, - "documentation_url": "https://docs.github.com/rest/reference/repos#get-branch-protection" + "documentation_url": "https://docs.github.com/rest/repos#get-branch-protection" }`, githubBranchNotProtected) }) diff --git a/github/repos_traffic.go b/github/repos_traffic.go index e372fb5a7fe..bf093c03ea7 100644 --- a/github/repos_traffic.go +++ b/github/repos_traffic.go @@ -54,7 +54,7 @@ type TrafficBreakdownOptions struct { // ListTrafficReferrers list the top 10 referrers over the last 14 days. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-top-referral-sources +// GitHub API docs: https://docs.github.com/en/rest/metrics/traffic#get-top-referral-sources func (s *RepositoriesService) ListTrafficReferrers(ctx context.Context, owner, repo string) ([]*TrafficReferrer, *Response, error) { u := fmt.Sprintf("repos/%v/%v/traffic/popular/referrers", owner, repo) @@ -74,7 +74,7 @@ func (s *RepositoriesService) ListTrafficReferrers(ctx context.Context, owner, r // ListTrafficPaths list the top 10 popular content over the last 14 days. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-top-referral-paths +// GitHub API docs: https://docs.github.com/en/rest/metrics/traffic#get-top-referral-paths func (s *RepositoriesService) ListTrafficPaths(ctx context.Context, owner, repo string) ([]*TrafficPath, *Response, error) { u := fmt.Sprintf("repos/%v/%v/traffic/popular/paths", owner, repo) @@ -94,7 +94,7 @@ func (s *RepositoriesService) ListTrafficPaths(ctx context.Context, owner, repo // ListTrafficViews get total number of views for the last 14 days and breaks it down either per day or week. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-page-views +// GitHub API docs: https://docs.github.com/en/rest/metrics/traffic#get-page-views func (s *RepositoriesService) ListTrafficViews(ctx context.Context, owner, repo string, opts *TrafficBreakdownOptions) (*TrafficViews, *Response, error) { u := fmt.Sprintf("repos/%v/%v/traffic/views", owner, repo) u, err := addOptions(u, opts) @@ -118,7 +118,7 @@ func (s *RepositoriesService) ListTrafficViews(ctx context.Context, owner, repo // ListTrafficClones get total number of clones for the last 14 days and breaks it down either per day or week for the last 14 days. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-repository-clones +// GitHub API docs: https://docs.github.com/en/rest/metrics/traffic#get-repository-clones func (s *RepositoriesService) ListTrafficClones(ctx context.Context, owner, repo string, opts *TrafficBreakdownOptions) (*TrafficClones, *Response, error) { u := fmt.Sprintf("repos/%v/%v/traffic/clones", owner, repo) u, err := addOptions(u, opts) diff --git a/github/scim.go b/github/scim.go index 7a12d85b883..c4abb9ab3e8 100644 --- a/github/scim.go +++ b/github/scim.go @@ -14,12 +14,12 @@ import ( // SCIMService provides access to SCIM related functions in the // GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/reference/scim +// GitHub API docs: https://docs.github.com/en/rest/scim type SCIMService service // SCIMUserAttributes represents supported SCIM User attributes. // -// GitHub API docs: https://docs.github.com/en/rest/reference/scim#supported-scim-user-attributes +// GitHub API docs: https://docs.github.com/en/rest/scim#supported-scim-user-attributes type SCIMUserAttributes struct { UserName string `json:"userName"` // Configured by the admin. Could be an email, login, or username. (Required.) Name SCIMUserName `json:"name"` // (Required.) @@ -47,7 +47,7 @@ type SCIMUserEmail struct { // ListSCIMProvisionedIdentitiesOptions represents options for ListSCIMProvisionedIdentities. // -// Github API docs: https://docs.github.com/en/rest/reference/scim#list-scim-provisioned-identities--parameters +// Github API docs: https://docs.github.com/en/rest/scim#list-scim-provisioned-identities--parameters type ListSCIMProvisionedIdentitiesOptions struct { StartIndex *int `json:"startIndex,omitempty"` // Used for pagination: the index of the first result to return. (Optional.) Count *int `json:"count,omitempty"` // Used for pagination: the number of results to return. (Optional.) @@ -61,7 +61,7 @@ type ListSCIMProvisionedIdentitiesOptions struct { // ListSCIMProvisionedIdentities lists SCIM provisioned identities. // -// GitHub API docs: https://docs.github.com/en/rest/reference/scim#list-scim-provisioned-identities +// GitHub API docs: https://docs.github.com/en/rest/scim#list-scim-provisioned-identities func (s *SCIMService) ListSCIMProvisionedIdentities(ctx context.Context, org string, opts *ListSCIMProvisionedIdentitiesOptions) (*Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users", org) u, err := addOptions(u, opts) @@ -77,7 +77,7 @@ func (s *SCIMService) ListSCIMProvisionedIdentities(ctx context.Context, org str // ProvisionAndInviteSCIMUser provisions organization membership for a user, and sends an activation email to the email address. // -// GitHub API docs: https://docs.github.com/en/rest/reference/scim#provision-and-invite-a-scim-user +// GitHub API docs: https://docs.github.com/en/rest/scim#provision-and-invite-a-scim-user func (s *SCIMService) ProvisionAndInviteSCIMUser(ctx context.Context, org string, opts *SCIMUserAttributes) (*Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users", org) u, err := addOptions(u, opts) @@ -93,7 +93,7 @@ func (s *SCIMService) ProvisionAndInviteSCIMUser(ctx context.Context, org string // GetSCIMProvisioningInfoForUser returns SCIM provisioning information for a user. // -// GitHub API docs: https://docs.github.com/en/rest/reference/scim#get-scim-provisioning-information-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/scim#supported-scim-user-attributes func (s *SCIMService) GetSCIMProvisioningInfoForUser(ctx context.Context, org, scimUserID string) (*Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users/%v", org, scimUserID) req, err := s.client.NewRequest("GET", u, nil) @@ -105,7 +105,7 @@ func (s *SCIMService) GetSCIMProvisioningInfoForUser(ctx context.Context, org, s // UpdateProvisionedOrgMembership updates a provisioned organization membership. // -// GitHub API docs: https://docs.github.com/en/rest/reference/scim#update-a-provisioned-organization-membership +// GitHub API docs: https://docs.github.com/en/rest/scim#update-a-provisioned-organization-membership func (s *SCIMService) UpdateProvisionedOrgMembership(ctx context.Context, org, scimUserID string, opts *SCIMUserAttributes) (*Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users/%v", org, scimUserID) u, err := addOptions(u, opts) @@ -121,7 +121,7 @@ func (s *SCIMService) UpdateProvisionedOrgMembership(ctx context.Context, org, s // UpdateAttributeForSCIMUserOptions represents options for UpdateAttributeForSCIMUser. // -// GitHub API docs: https://docs.github.com/en/rest/reference/scim#update-an-attribute-for-a-scim-user--parameters +// GitHub API docs: https://docs.github.com/en/rest/scim#update-an-attribute-for-a-scim-user--parameters type UpdateAttributeForSCIMUserOptions struct { Schemas []string `json:"schemas,omitempty"` // (Optional.) Operations UpdateAttributeForSCIMUserOperations `json:"operations"` // Set of operations to be performed. (Required.) @@ -136,7 +136,7 @@ type UpdateAttributeForSCIMUserOperations struct { // UpdateAttributeForSCIMUser updates an attribute for an SCIM user. // -// GitHub API docs: https://docs.github.com/en/rest/reference/scim#update-an-attribute-for-a-scim-user +// GitHub API docs: https://docs.github.com/en/rest/scim#update-an-attribute-for-a-scim-user func (s *SCIMService) UpdateAttributeForSCIMUser(ctx context.Context, org, scimUserID string, opts *UpdateAttributeForSCIMUserOptions) (*Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users/%v", org, scimUserID) u, err := addOptions(u, opts) @@ -152,7 +152,7 @@ func (s *SCIMService) UpdateAttributeForSCIMUser(ctx context.Context, org, scimU // DeleteSCIMUserFromOrg deletes SCIM user from an organization. // -// GitHub API docs: https://docs.github.com/en/rest/reference/scim#delete-a-scim-user-from-an-organization +// GitHub API docs: https://docs.github.com/en/rest/scim#delete-a-scim-user-from-an-organization func (s *SCIMService) DeleteSCIMUserFromOrg(ctx context.Context, org, scimUserID string) (*Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users/%v", org, scimUserID) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/search.go b/github/search.go index a3da304c519..344f1bb9855 100644 --- a/github/search.go +++ b/github/search.go @@ -29,7 +29,7 @@ import ( // For example, querying with "language:c++" and "leveldb", then query should be // "language:c++ leveldb" but not "language:c+++leveldb". // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/search/ +// GitHub API docs: https://docs.github.com/en/rest/search/ type SearchService service // SearchOptions specifies optional parameters to the SearchService methods. @@ -69,7 +69,7 @@ type RepositoriesSearchResult struct { // Repositories searches repositories via various criteria. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/search/#search-repositories +// GitHub API docs: https://docs.github.com/en/rest/search#search-repositories func (s *SearchService) Repositories(ctx context.Context, query string, opts *SearchOptions) (*RepositoriesSearchResult, *Response, error) { result := new(RepositoriesSearchResult) resp, err := s.search(ctx, "repositories", &searchParameters{Query: query}, opts, result) @@ -104,7 +104,7 @@ type TopicResult struct { // Please see https://help.github.com/en/articles/searching-topics for more // information about search qualifiers. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/search/#search-topics +// GitHub API docs: https://docs.github.com/en/rest/search#search-topics func (s *SearchService) Topics(ctx context.Context, query string, opts *SearchOptions) (*TopicsSearchResult, *Response, error) { result := new(TopicsSearchResult) resp, err := s.search(ctx, "topics", &searchParameters{Query: query}, opts, result) @@ -139,7 +139,7 @@ type CommitResult struct { // Commits searches commits via various criteria. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/search/#search-commits +// GitHub API docs: https://docs.github.com/en/rest/search#search-commits func (s *SearchService) Commits(ctx context.Context, query string, opts *SearchOptions) (*CommitsSearchResult, *Response, error) { result := new(CommitsSearchResult) resp, err := s.search(ctx, "commits", &searchParameters{Query: query}, opts, result) @@ -159,7 +159,7 @@ type IssuesSearchResult struct { // Issues searches issues via various criteria. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/search/#search-issues-and-pull-requests +// GitHub API docs: https://docs.github.com/en/rest/search#search-issues-and-pull-requests func (s *SearchService) Issues(ctx context.Context, query string, opts *SearchOptions) (*IssuesSearchResult, *Response, error) { result := new(IssuesSearchResult) resp, err := s.search(ctx, "issues", &searchParameters{Query: query}, opts, result) @@ -179,7 +179,7 @@ type UsersSearchResult struct { // Users searches users via various criteria. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/search/#search-users +// GitHub API docs: https://docs.github.com/en/rest/search#search-users func (s *SearchService) Users(ctx context.Context, query string, opts *SearchOptions) (*UsersSearchResult, *Response, error) { result := new(UsersSearchResult) resp, err := s.search(ctx, "users", &searchParameters{Query: query}, opts, result) @@ -232,7 +232,7 @@ func (c CodeResult) String() string { // Code searches code via various criteria. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/search/#search-code +// GitHub API docs: https://docs.github.com/en/rest/search#search-code func (s *SearchService) Code(ctx context.Context, query string, opts *SearchOptions) (*CodeSearchResult, *Response, error) { result := new(CodeSearchResult) resp, err := s.search(ctx, "code", &searchParameters{Query: query}, opts, result) @@ -267,7 +267,7 @@ func (l LabelResult) String() string { // Labels searches labels in the repository with ID repoID via various criteria. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/search/#search-labels +// GitHub API docs: https://docs.github.com/en/rest/search#search-labels func (s *SearchService) Labels(ctx context.Context, repoID int64, query string, opts *SearchOptions) (*LabelsSearchResult, *Response, error) { result := new(LabelsSearchResult) resp, err := s.search(ctx, "labels", &searchParameters{RepositoryID: &repoID, Query: query}, opts, result) diff --git a/github/secret_scanning.go b/github/secret_scanning.go index f5061f3b925..ec64950a67f 100644 --- a/github/secret_scanning.go +++ b/github/secret_scanning.go @@ -12,8 +12,6 @@ import ( // SecretScanningService handles communication with the secret scanning related // methods of the GitHub API. -// -// GitHub API docs: https://docs.github.com/en/rest/reference/secret-scanning type SecretScanningService service // SecretScanningAlert represents a GitHub secret scanning alert. @@ -84,7 +82,7 @@ type SecretScanningAlertUpdateOptions struct { // To use this endpoint, you must be a member of the enterprise, and you must use an access token with the repo scope or // security_events scope. Alerts are only returned for organizations in the enterprise for which you are an organization owner or a security manager. // -// GitHub API docs: https://docs.github.com/en/rest/reference/secret-scanning#list-secret-scanning-alerts-for-an-enterprise +// GitHub API docs: https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#list-secret-scanning-alerts-for-an-enterprise func (s *SecretScanningService) ListAlertsForEnterprise(ctx context.Context, enterprise string, opts *SecretScanningAlertListOptions) ([]*SecretScanningAlert, *Response, error) { u := fmt.Sprintf("enterprises/%v/secret-scanning/alerts", enterprise) u, err := addOptions(u, opts) @@ -111,7 +109,7 @@ func (s *SecretScanningService) ListAlertsForEnterprise(ctx context.Context, ent // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/en/rest/reference/secret-scanning#list-secret-scanning-alerts-for-an-organization +// GitHub API docs: https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#list-secret-scanning-alerts-for-an-organization func (s *SecretScanningService) ListAlertsForOrg(ctx context.Context, org string, opts *SecretScanningAlertListOptions) ([]*SecretScanningAlert, *Response, error) { u := fmt.Sprintf("orgs/%v/secret-scanning/alerts", org) u, err := addOptions(u, opts) @@ -138,7 +136,7 @@ func (s *SecretScanningService) ListAlertsForOrg(ctx context.Context, org string // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/en/rest/reference/secret-scanning#list-secret-scanning-alerts-for-a-repository +// GitHub API docs: https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#list-secret-scanning-alerts-for-a-repository func (s *SecretScanningService) ListAlertsForRepo(ctx context.Context, owner, repo string, opts *SecretScanningAlertListOptions) ([]*SecretScanningAlert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/secret-scanning/alerts", owner, repo) u, err := addOptions(u, opts) @@ -165,7 +163,7 @@ func (s *SecretScanningService) ListAlertsForRepo(ctx context.Context, owner, re // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/en/rest/reference/secret-scanning#get-a-secret-scanning-alert +// GitHub API docs: https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#get-a-secret-scanning-alert func (s *SecretScanningService) GetAlert(ctx context.Context, owner, repo string, number int64) (*SecretScanningAlert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/secret-scanning/alerts/%v", owner, repo, number) @@ -188,7 +186,7 @@ func (s *SecretScanningService) GetAlert(ctx context.Context, owner, repo string // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/en/rest/reference/secret-scanning#update-a-secret-scanning-alert +// GitHub API docs: https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#update-a-secret-scanning-alert func (s *SecretScanningService) UpdateAlert(ctx context.Context, owner, repo string, number int64, opts *SecretScanningAlertUpdateOptions) (*SecretScanningAlert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/secret-scanning/alerts/%v", owner, repo, number) @@ -211,7 +209,7 @@ func (s *SecretScanningService) UpdateAlert(ctx context.Context, owner, repo str // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/en/rest/reference/secret-scanning#list-locations-for-a-secret-scanning-alert +// GitHub API docs: https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#list-locations-for-a-secret-scanning-alert func (s *SecretScanningService) ListLocationsForAlert(ctx context.Context, owner, repo string, number int64, opts *ListOptions) ([]*SecretScanningAlertLocation, *Response, error) { u := fmt.Sprintf("repos/%v/%v/secret-scanning/alerts/%v/locations", owner, repo, number) u, err := addOptions(u, opts) diff --git a/github/teams.go b/github/teams.go index 5b1096ea292..77b38dd6dd1 100644 --- a/github/teams.go +++ b/github/teams.go @@ -16,7 +16,7 @@ import ( // TeamsService provides access to the team-related functions // in the GitHub API. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/ +// GitHub API docs: https://docs.github.com/en/rest/teams/ type TeamsService service // Team represents a team within a GitHub organization. Teams are used to @@ -82,7 +82,7 @@ func (i Invitation) String() string { // ListTeams lists all of the teams for an organization. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#list-teams +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-teams func (s *TeamsService) ListTeams(ctx context.Context, org string, opts *ListOptions) ([]*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/teams", org) u, err := addOptions(u, opts) @@ -106,7 +106,7 @@ func (s *TeamsService) ListTeams(ctx context.Context, org string, opts *ListOpti // GetTeamByID fetches a team, given a specified organization ID, by ID. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#get-a-team-by-name +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#get-a-team-by-name func (s *TeamsService) GetTeamByID(ctx context.Context, orgID, teamID int64) (*Team, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v", orgID, teamID) req, err := s.client.NewRequest("GET", u, nil) @@ -125,7 +125,7 @@ func (s *TeamsService) GetTeamByID(ctx context.Context, orgID, teamID int64) (*T // GetTeamBySlug fetches a team, given a specified organization name, by slug. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#get-a-team-by-name +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#get-a-team-by-name func (s *TeamsService) GetTeamBySlug(ctx context.Context, org, slug string) (*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v", org, slug) req, err := s.client.NewRequest("GET", u, nil) @@ -175,7 +175,7 @@ func (s NewTeam) String() string { // CreateTeam creates a new team within an organization. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#create-a-team +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#create-a-team func (s *TeamsService) CreateTeam(ctx context.Context, org string, team NewTeam) (*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/teams", org) req, err := s.client.NewRequest("POST", u, team) @@ -221,7 +221,7 @@ func copyNewTeamWithoutParent(team *NewTeam) *newTeamNoParent { // EditTeamByID edits a team, given an organization ID, selected by ID. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#update-a-team +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#update-a-team func (s *TeamsService) EditTeamByID(ctx context.Context, orgID, teamID int64, team NewTeam, removeParent bool) (*Team, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v", orgID, teamID) @@ -248,7 +248,7 @@ func (s *TeamsService) EditTeamByID(ctx context.Context, orgID, teamID int64, te // EditTeamBySlug edits a team, given an organization name, by slug. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#update-a-team +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#update-a-team func (s *TeamsService) EditTeamBySlug(ctx context.Context, org, slug string, team NewTeam, removeParent bool) (*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v", org, slug) @@ -275,7 +275,7 @@ func (s *TeamsService) EditTeamBySlug(ctx context.Context, org, slug string, tea // DeleteTeamByID deletes a team referenced by ID. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#delete-a-team +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#delete-a-team func (s *TeamsService) DeleteTeamByID(ctx context.Context, orgID, teamID int64) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v", orgID, teamID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -288,7 +288,7 @@ func (s *TeamsService) DeleteTeamByID(ctx context.Context, orgID, teamID int64) // DeleteTeamBySlug deletes a team reference by slug. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#delete-a-team +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#delete-a-team func (s *TeamsService) DeleteTeamBySlug(ctx context.Context, org, slug string) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v", org, slug) req, err := s.client.NewRequest("DELETE", u, nil) @@ -301,7 +301,7 @@ func (s *TeamsService) DeleteTeamBySlug(ctx context.Context, org, slug string) ( // ListChildTeamsByParentID lists child teams for a parent team given parent ID. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#list-child-teams +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-child-teams func (s *TeamsService) ListChildTeamsByParentID(ctx context.Context, orgID, teamID int64, opts *ListOptions) ([]*Team, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/teams", orgID, teamID) u, err := addOptions(u, opts) @@ -325,7 +325,7 @@ func (s *TeamsService) ListChildTeamsByParentID(ctx context.Context, orgID, team // ListChildTeamsByParentSlug lists child teams for a parent team given parent slug. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#list-child-teams +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-child-teams func (s *TeamsService) ListChildTeamsByParentSlug(ctx context.Context, org, slug string, opts *ListOptions) ([]*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/teams", org, slug) u, err := addOptions(u, opts) @@ -349,7 +349,7 @@ func (s *TeamsService) ListChildTeamsByParentSlug(ctx context.Context, org, slug // ListTeamReposByID lists the repositories given a team ID that the specified team has access to. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#list-team-repositories +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-team-repositories func (s *TeamsService) ListTeamReposByID(ctx context.Context, orgID, teamID int64, opts *ListOptions) ([]*Repository, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/repos", orgID, teamID) u, err := addOptions(u, opts) @@ -377,7 +377,7 @@ func (s *TeamsService) ListTeamReposByID(ctx context.Context, orgID, teamID int6 // ListTeamReposBySlug lists the repositories given a team slug that the specified team has access to. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#list-team-repositories +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-team-repositories func (s *TeamsService) ListTeamReposBySlug(ctx context.Context, org, slug string, opts *ListOptions) ([]*Repository, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/repos", org, slug) u, err := addOptions(u, opts) @@ -407,7 +407,7 @@ func (s *TeamsService) ListTeamReposBySlug(ctx context.Context, org, slug string // repository is managed by team, a Repository is returned which includes the // permissions team has for that repo. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#check-team-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#check-team-permissions-for-a-repository func (s *TeamsService) IsTeamRepoByID(ctx context.Context, orgID, teamID int64, owner, repo string) (*Repository, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/repos/%v/%v", orgID, teamID, owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -431,7 +431,7 @@ func (s *TeamsService) IsTeamRepoByID(ctx context.Context, orgID, teamID int64, // repository is managed by team, a Repository is returned which includes the // permissions team has for that repo. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#check-team-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#check-team-permissions-for-a-repository func (s *TeamsService) IsTeamRepoBySlug(ctx context.Context, org, slug, owner, repo string) (*Repository, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/repos/%v/%v", org, slug, owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -470,7 +470,7 @@ type TeamAddTeamRepoOptions struct { // The specified repository must be owned by the organization to which the team // belongs, or a direct fork of a repository owned by the organization. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#add-or-update-team-repository-permissions +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#add-or-update-team-repository-permissions func (s *TeamsService) AddTeamRepoByID(ctx context.Context, orgID, teamID int64, owner, repo string, opts *TeamAddTeamRepoOptions) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/repos/%v/%v", orgID, teamID, owner, repo) req, err := s.client.NewRequest("PUT", u, opts) @@ -485,7 +485,7 @@ func (s *TeamsService) AddTeamRepoByID(ctx context.Context, orgID, teamID int64, // The specified repository must be owned by the organization to which the team // belongs, or a direct fork of a repository owned by the organization. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#add-or-update-team-repository-permissions +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#add-or-update-team-repository-permissions func (s *TeamsService) AddTeamRepoBySlug(ctx context.Context, org, slug, owner, repo string, opts *TeamAddTeamRepoOptions) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/repos/%v/%v", org, slug, owner, repo) req, err := s.client.NewRequest("PUT", u, opts) @@ -500,7 +500,7 @@ func (s *TeamsService) AddTeamRepoBySlug(ctx context.Context, org, slug, owner, // team given the team ID. Note that this does not delete the repository, it // just removes it from the team. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#remove-a-repository-from-a-team +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#remove-a-repository-from-a-team func (s *TeamsService) RemoveTeamRepoByID(ctx context.Context, orgID, teamID int64, owner, repo string) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/repos/%v/%v", orgID, teamID, owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) @@ -515,7 +515,7 @@ func (s *TeamsService) RemoveTeamRepoByID(ctx context.Context, orgID, teamID int // team given the team slug. Note that this does not delete the repository, it // just removes it from the team. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#remove-a-repository-from-a-team +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#remove-a-repository-from-a-team func (s *TeamsService) RemoveTeamRepoBySlug(ctx context.Context, org, slug, owner, repo string) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/repos/%v/%v", org, slug, owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) @@ -527,7 +527,7 @@ func (s *TeamsService) RemoveTeamRepoBySlug(ctx context.Context, org, slug, owne } // ListUserTeams lists a user's teams -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#list-teams-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-teams-for-the-authenticated-user func (s *TeamsService) ListUserTeams(ctx context.Context, opts *ListOptions) ([]*Team, *Response, error) { u := "user/teams" u, err := addOptions(u, opts) @@ -551,7 +551,7 @@ func (s *TeamsService) ListUserTeams(ctx context.Context, opts *ListOptions) ([] // ListTeamProjectsByID lists the organization projects for a team given the team ID. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#list-team-projects +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-team-projects func (s *TeamsService) ListTeamProjectsByID(ctx context.Context, orgID, teamID int64) ([]*Project, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/projects", orgID, teamID) @@ -575,7 +575,7 @@ func (s *TeamsService) ListTeamProjectsByID(ctx context.Context, orgID, teamID i // ListTeamProjectsBySlug lists the organization projects for a team given the team slug. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#list-team-projects +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-team-projects func (s *TeamsService) ListTeamProjectsBySlug(ctx context.Context, org, slug string) ([]*Project, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/projects", org, slug) @@ -600,7 +600,7 @@ func (s *TeamsService) ListTeamProjectsBySlug(ctx context.Context, org, slug str // ReviewTeamProjectsByID checks whether a team, given its ID, has read, write, or admin // permissions for an organization project. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#check-team-permissions-for-a-project +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#check-team-permissions-for-a-project func (s *TeamsService) ReviewTeamProjectsByID(ctx context.Context, orgID, teamID, projectID int64) (*Project, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/projects/%v", orgID, teamID, projectID) req, err := s.client.NewRequest("GET", u, nil) @@ -624,7 +624,7 @@ func (s *TeamsService) ReviewTeamProjectsByID(ctx context.Context, orgID, teamID // ReviewTeamProjectsBySlug checks whether a team, given its slug, has read, write, or admin // permissions for an organization project. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#check-team-permissions-for-a-project +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#check-team-permissions-for-a-project func (s *TeamsService) ReviewTeamProjectsBySlug(ctx context.Context, org, slug string, projectID int64) (*Project, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/projects/%v", org, slug, projectID) req, err := s.client.NewRequest("GET", u, nil) @@ -661,7 +661,7 @@ type TeamProjectOptions struct { // To add a project to a team or update the team's permission on a project, the // authenticated user must have admin permissions for the project. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#add-or-update-team-project-permissions +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#add-or-update-team-project-permissions func (s *TeamsService) AddTeamProjectByID(ctx context.Context, orgID, teamID, projectID int64, opts *TeamProjectOptions) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/projects/%v", orgID, teamID, projectID) req, err := s.client.NewRequest("PUT", u, opts) @@ -680,7 +680,7 @@ func (s *TeamsService) AddTeamProjectByID(ctx context.Context, orgID, teamID, pr // To add a project to a team or update the team's permission on a project, the // authenticated user must have admin permissions for the project. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#add-or-update-team-project-permissions +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#add-or-update-team-project-permissions func (s *TeamsService) AddTeamProjectBySlug(ctx context.Context, org, slug string, projectID int64, opts *TeamProjectOptions) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/projects/%v", org, slug, projectID) req, err := s.client.NewRequest("PUT", u, opts) @@ -702,7 +702,7 @@ func (s *TeamsService) AddTeamProjectBySlug(ctx context.Context, org, slug strin // or project. // Note: This endpoint removes the project from the team, but does not delete it. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#remove-a-project-from-a-team +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#remove-a-project-from-a-team func (s *TeamsService) RemoveTeamProjectByID(ctx context.Context, orgID, teamID, projectID int64) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/projects/%v", orgID, teamID, projectID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -724,7 +724,7 @@ func (s *TeamsService) RemoveTeamProjectByID(ctx context.Context, orgID, teamID, // or project. // Note: This endpoint removes the project from the team, but does not delete it. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#remove-a-project-from-a-team +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#remove-a-project-from-a-team func (s *TeamsService) RemoveTeamProjectBySlug(ctx context.Context, org, slug string, projectID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/projects/%v", org, slug, projectID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -753,7 +753,7 @@ type IDPGroup struct { // ListIDPGroupsInOrganization lists IDP groups available in an organization. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#list-idp-groups-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/teams/team-sync#list-idp-groups-for-an-organization func (s *TeamsService) ListIDPGroupsInOrganization(ctx context.Context, org string, opts *ListCursorOptions) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("orgs/%v/team-sync/groups", org) u, err := addOptions(u, opts) @@ -778,7 +778,7 @@ func (s *TeamsService) ListIDPGroupsInOrganization(ctx context.Context, org stri // ListIDPGroupsForTeamByID lists IDP groups connected to a team on GitHub // given organization and team IDs. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#list-idp-groups-for-a-team +// GitHub API docs: https://docs.github.com/en/rest/teams/team-sync#list-idp-groups-for-a-team func (s *TeamsService) ListIDPGroupsForTeamByID(ctx context.Context, orgID, teamID int64) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/team-sync/group-mappings", orgID, teamID) @@ -799,7 +799,7 @@ func (s *TeamsService) ListIDPGroupsForTeamByID(ctx context.Context, orgID, team // ListIDPGroupsForTeamBySlug lists IDP groups connected to a team on GitHub // given organization name and team slug. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#list-idp-groups-for-a-team +// GitHub API docs: https://docs.github.com/en/rest/teams/team-sync#list-idp-groups-for-a-team func (s *TeamsService) ListIDPGroupsForTeamBySlug(ctx context.Context, org, slug string) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/team-sync/group-mappings", org, slug) @@ -820,7 +820,7 @@ func (s *TeamsService) ListIDPGroupsForTeamBySlug(ctx context.Context, org, slug // CreateOrUpdateIDPGroupConnectionsByID creates, updates, or removes a connection // between a team and an IDP group given organization and team IDs. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#create-or-update-idp-group-connections +// GitHub API docs: https://docs.github.com/en/rest/teams/team-sync#create-or-update-idp-group-connections func (s *TeamsService) CreateOrUpdateIDPGroupConnectionsByID(ctx context.Context, orgID, teamID int64, opts IDPGroupList) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/team-sync/group-mappings", orgID, teamID) @@ -841,7 +841,7 @@ func (s *TeamsService) CreateOrUpdateIDPGroupConnectionsByID(ctx context.Context // CreateOrUpdateIDPGroupConnectionsBySlug creates, updates, or removes a connection // between a team and an IDP group given organization name and team slug. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#create-or-update-idp-group-connections +// GitHub API docs: https://docs.github.com/en/rest/teams/team-sync#create-or-update-idp-group-connections func (s *TeamsService) CreateOrUpdateIDPGroupConnectionsBySlug(ctx context.Context, org, slug string, opts IDPGroupList) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/team-sync/group-mappings", org, slug) @@ -889,7 +889,7 @@ type ExternalGroupList struct { // GetExternalGroup fetches an external group. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/reference/teams#get-an-external-group +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/teams/external-groups#get-an-external-group func (s *TeamsService) GetExternalGroup(ctx context.Context, org string, groupID int64) (*ExternalGroup, *Response, error) { u := fmt.Sprintf("orgs/%v/external-group/%v", org, groupID) req, err := s.client.NewRequest("GET", u, nil) @@ -916,7 +916,7 @@ type ListExternalGroupsOptions struct { // ListExternalGroups lists external groups connected to a team on GitHub. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/reference/teams#list-external-groups-in-an-organization +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/teams/external-groups#list-external-groups-in-an-organization func (s *TeamsService) ListExternalGroups(ctx context.Context, org string, opts *ListExternalGroupsOptions) (*ExternalGroupList, *Response, error) { u := fmt.Sprintf("orgs/%v/external-groups", org) u, err := addOptions(u, opts) @@ -940,7 +940,7 @@ func (s *TeamsService) ListExternalGroups(ctx context.Context, org string, opts // UpdateConnectedExternalGroup updates the connection between an external group and a team. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/reference/teams#update-the-connection-between-an-external-group-and-a-team +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/teams/external-groups#update-the-connection-between-an-external-group-and-a-team func (s *TeamsService) UpdateConnectedExternalGroup(ctx context.Context, org, slug string, eg *ExternalGroup) (*ExternalGroup, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/external-groups", org, slug) @@ -960,7 +960,7 @@ func (s *TeamsService) UpdateConnectedExternalGroup(ctx context.Context, org, sl // RemoveConnectedExternalGroup removes the connection between an external group and a team. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/reference/teams#remove-the-connection-between-an-external-group-and-a-team +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/teams/external-groups#remove-the-connection-between-an-external-group-and-a-team func (s *TeamsService) RemoveConnectedExternalGroup(ctx context.Context, org, slug string) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/external-groups", org, slug) diff --git a/github/teams_discussion_comments.go b/github/teams_discussion_comments.go index b6c7e178451..f3a1cc4dc00 100644 --- a/github/teams_discussion_comments.go +++ b/github/teams_discussion_comments.go @@ -43,7 +43,7 @@ type DiscussionCommentListOptions struct { // ListCommentsByID lists all comments on a team discussion by team ID. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#list-discussion-comments +// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#list-discussion-comments func (s *TeamsService) ListCommentsByID(ctx context.Context, orgID, teamID int64, discussionNumber int, options *DiscussionCommentListOptions) ([]*DiscussionComment, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments", orgID, teamID, discussionNumber) u, err := addOptions(u, options) @@ -68,7 +68,7 @@ func (s *TeamsService) ListCommentsByID(ctx context.Context, orgID, teamID int64 // ListCommentsBySlug lists all comments on a team discussion by team slug. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#list-discussion-comments +// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#list-discussion-comments func (s *TeamsService) ListCommentsBySlug(ctx context.Context, org, slug string, discussionNumber int, options *DiscussionCommentListOptions) ([]*DiscussionComment, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments", org, slug, discussionNumber) u, err := addOptions(u, options) @@ -93,7 +93,7 @@ func (s *TeamsService) ListCommentsBySlug(ctx context.Context, org, slug string, // GetCommentByID gets a specific comment on a team discussion by team ID. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#get-a-discussion-comment +// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#get-a-discussion-comment func (s *TeamsService) GetCommentByID(ctx context.Context, orgID, teamID int64, discussionNumber, commentNumber int) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v", orgID, teamID, discussionNumber, commentNumber) req, err := s.client.NewRequest("GET", u, nil) @@ -113,7 +113,7 @@ func (s *TeamsService) GetCommentByID(ctx context.Context, orgID, teamID int64, // GetCommentBySlug gets a specific comment on a team discussion by team slug. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#get-a-discussion-comment +// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#get-a-discussion-comment func (s *TeamsService) GetCommentBySlug(ctx context.Context, org, slug string, discussionNumber, commentNumber int) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v", org, slug, discussionNumber, commentNumber) @@ -134,7 +134,7 @@ func (s *TeamsService) GetCommentBySlug(ctx context.Context, org, slug string, d // CreateCommentByID creates a new comment on a team discussion by team ID. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#create-a-discussion-comment +// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#create-a-discussion-comment func (s *TeamsService) CreateCommentByID(ctx context.Context, orgID, teamID int64, discsusionNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments", orgID, teamID, discsusionNumber) req, err := s.client.NewRequest("POST", u, comment) @@ -154,7 +154,7 @@ func (s *TeamsService) CreateCommentByID(ctx context.Context, orgID, teamID int6 // CreateCommentBySlug creates a new comment on a team discussion by team slug. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#create-a-discussion-comment +// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#create-a-discussion-comment func (s *TeamsService) CreateCommentBySlug(ctx context.Context, org, slug string, discsusionNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments", org, slug, discsusionNumber) req, err := s.client.NewRequest("POST", u, comment) @@ -175,7 +175,7 @@ func (s *TeamsService) CreateCommentBySlug(ctx context.Context, org, slug string // Authenticated user must grant write:discussion scope. // User is allowed to edit body of a comment only. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#update-a-discussion-comment +// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#update-a-discussion-comment func (s *TeamsService) EditCommentByID(ctx context.Context, orgID, teamID int64, discussionNumber, commentNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v", orgID, teamID, discussionNumber, commentNumber) req, err := s.client.NewRequest("PATCH", u, comment) @@ -196,7 +196,7 @@ func (s *TeamsService) EditCommentByID(ctx context.Context, orgID, teamID int64, // Authenticated user must grant write:discussion scope. // User is allowed to edit body of a comment only. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#update-a-discussion-comment +// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#update-a-discussion-comment func (s *TeamsService) EditCommentBySlug(ctx context.Context, org, slug string, discussionNumber, commentNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v", org, slug, discussionNumber, commentNumber) req, err := s.client.NewRequest("PATCH", u, comment) @@ -216,7 +216,7 @@ func (s *TeamsService) EditCommentBySlug(ctx context.Context, org, slug string, // DeleteCommentByID deletes a comment on a team discussion by team ID. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#delete-a-discussion-comment +// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#delete-a-discussion-comment func (s *TeamsService) DeleteCommentByID(ctx context.Context, orgID, teamID int64, discussionNumber, commentNumber int) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v", orgID, teamID, discussionNumber, commentNumber) req, err := s.client.NewRequest("DELETE", u, nil) @@ -230,7 +230,7 @@ func (s *TeamsService) DeleteCommentByID(ctx context.Context, orgID, teamID int6 // DeleteCommentBySlug deletes a comment on a team discussion by team slug. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#delete-a-discussion-comment +// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#delete-a-discussion-comment func (s *TeamsService) DeleteCommentBySlug(ctx context.Context, org, slug string, discussionNumber, commentNumber int) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v", org, slug, discussionNumber, commentNumber) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/teams_discussions.go b/github/teams_discussions.go index 5678548e9ba..69a3ebd51ff 100644 --- a/github/teams_discussions.go +++ b/github/teams_discussions.go @@ -49,7 +49,7 @@ type DiscussionListOptions struct { // ListDiscussionsByID lists all discussions on team's page given Organization and Team ID. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#list-discussions +// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#list-discussions func (s *TeamsService) ListDiscussionsByID(ctx context.Context, orgID, teamID int64, opts *DiscussionListOptions) ([]*TeamDiscussion, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions", orgID, teamID) u, err := addOptions(u, opts) @@ -74,7 +74,7 @@ func (s *TeamsService) ListDiscussionsByID(ctx context.Context, orgID, teamID in // ListDiscussionsBySlug lists all discussions on team's page given Organization name and Team's slug. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#list-discussions +// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#list-discussions func (s *TeamsService) ListDiscussionsBySlug(ctx context.Context, org, slug string, opts *DiscussionListOptions) ([]*TeamDiscussion, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions", org, slug) u, err := addOptions(u, opts) @@ -99,7 +99,7 @@ func (s *TeamsService) ListDiscussionsBySlug(ctx context.Context, org, slug stri // GetDiscussionByID gets a specific discussion on a team's page given Organization and Team ID. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#get-a-discussion +// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#get-a-discussion func (s *TeamsService) GetDiscussionByID(ctx context.Context, orgID, teamID int64, discussionNumber int) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v", orgID, teamID, discussionNumber) req, err := s.client.NewRequest("GET", u, nil) @@ -119,7 +119,7 @@ func (s *TeamsService) GetDiscussionByID(ctx context.Context, orgID, teamID int6 // GetDiscussionBySlug gets a specific discussion on a team's page given Organization name and Team's slug. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#get-a-discussion +// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#get-a-discussion func (s *TeamsService) GetDiscussionBySlug(ctx context.Context, org, slug string, discussionNumber int) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v", org, slug, discussionNumber) req, err := s.client.NewRequest("GET", u, nil) @@ -139,7 +139,7 @@ func (s *TeamsService) GetDiscussionBySlug(ctx context.Context, org, slug string // CreateDiscussionByID creates a new discussion post on a team's page given Organization and Team ID. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#create-a-discussion +// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#create-a-discussion func (s *TeamsService) CreateDiscussionByID(ctx context.Context, orgID, teamID int64, discussion TeamDiscussion) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions", orgID, teamID) req, err := s.client.NewRequest("POST", u, discussion) @@ -159,7 +159,7 @@ func (s *TeamsService) CreateDiscussionByID(ctx context.Context, orgID, teamID i // CreateDiscussionBySlug creates a new discussion post on a team's page given Organization name and Team's slug. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#create-a-discussion +// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#create-a-discussion func (s *TeamsService) CreateDiscussionBySlug(ctx context.Context, org, slug string, discussion TeamDiscussion) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions", org, slug) req, err := s.client.NewRequest("POST", u, discussion) @@ -180,7 +180,7 @@ func (s *TeamsService) CreateDiscussionBySlug(ctx context.Context, org, slug str // Authenticated user must grant write:discussion scope. // User is allowed to change Title and Body of a discussion only. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#update-a-discussion +// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#update-a-discussion func (s *TeamsService) EditDiscussionByID(ctx context.Context, orgID, teamID int64, discussionNumber int, discussion TeamDiscussion) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v", orgID, teamID, discussionNumber) req, err := s.client.NewRequest("PATCH", u, discussion) @@ -201,7 +201,7 @@ func (s *TeamsService) EditDiscussionByID(ctx context.Context, orgID, teamID int // Authenticated user must grant write:discussion scope. // User is allowed to change Title and Body of a discussion only. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#update-a-discussion +// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#update-a-discussion func (s *TeamsService) EditDiscussionBySlug(ctx context.Context, org, slug string, discussionNumber int, discussion TeamDiscussion) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v", org, slug, discussionNumber) req, err := s.client.NewRequest("PATCH", u, discussion) @@ -221,7 +221,7 @@ func (s *TeamsService) EditDiscussionBySlug(ctx context.Context, org, slug strin // DeleteDiscussionByID deletes a discussion from team's page given Organization and Team ID. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#delete-a-discussion +// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#delete-a-discussion func (s *TeamsService) DeleteDiscussionByID(ctx context.Context, orgID, teamID int64, discussionNumber int) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v", orgID, teamID, discussionNumber) req, err := s.client.NewRequest("DELETE", u, nil) @@ -235,7 +235,7 @@ func (s *TeamsService) DeleteDiscussionByID(ctx context.Context, orgID, teamID i // DeleteDiscussionBySlug deletes a discussion from team's page given Organization name and Team's slug. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#delete-a-discussion +// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#delete-a-discussion func (s *TeamsService) DeleteDiscussionBySlug(ctx context.Context, org, slug string, discussionNumber int) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v", org, slug, discussionNumber) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/teams_members.go b/github/teams_members.go index e6ad448b0e3..58cb79744e1 100644 --- a/github/teams_members.go +++ b/github/teams_members.go @@ -23,7 +23,7 @@ type TeamListTeamMembersOptions struct { // ListTeamMembersByID lists all of the users who are members of a team, given a specified // organization ID, by team ID. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#list-team-members +// GitHub API docs: https://docs.github.com/en/rest/teams/members#list-team-members func (s *TeamsService) ListTeamMembersByID(ctx context.Context, orgID, teamID int64, opts *TeamListTeamMembersOptions) ([]*User, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/members", orgID, teamID) u, err := addOptions(u, opts) @@ -48,7 +48,7 @@ func (s *TeamsService) ListTeamMembersByID(ctx context.Context, orgID, teamID in // ListTeamMembersBySlug lists all of the users who are members of a team, given a specified // organization name, by team slug. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#list-team-members +// GitHub API docs: https://docs.github.com/en/rest/teams/members#list-team-members func (s *TeamsService) ListTeamMembersBySlug(ctx context.Context, org, slug string, opts *TeamListTeamMembersOptions) ([]*User, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/members", org, slug) u, err := addOptions(u, opts) @@ -73,7 +73,7 @@ func (s *TeamsService) ListTeamMembersBySlug(ctx context.Context, org, slug stri // GetTeamMembershipByID returns the membership status for a user in a team, given a specified // organization ID, by team ID. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#get-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/teams/members#list-team-members func (s *TeamsService) GetTeamMembershipByID(ctx context.Context, orgID, teamID int64, user string) (*Membership, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/memberships/%v", orgID, teamID, user) req, err := s.client.NewRequest("GET", u, nil) @@ -93,7 +93,7 @@ func (s *TeamsService) GetTeamMembershipByID(ctx context.Context, orgID, teamID // GetTeamMembershipBySlug returns the membership status for a user in a team, given a specified // organization name, by team slug. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#get-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/teams/members#get-team-membership-for-a-user func (s *TeamsService) GetTeamMembershipBySlug(ctx context.Context, org, slug, user string) (*Membership, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/memberships/%v", org, slug, user) req, err := s.client.NewRequest("GET", u, nil) @@ -127,7 +127,7 @@ type TeamAddTeamMembershipOptions struct { // AddTeamMembershipByID adds or invites a user to a team, given a specified // organization ID, by team ID. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#add-or-update-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/teams/members#add-or-update-team-membership-for-a-user func (s *TeamsService) AddTeamMembershipByID(ctx context.Context, orgID, teamID int64, user string, opts *TeamAddTeamMembershipOptions) (*Membership, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/memberships/%v", orgID, teamID, user) req, err := s.client.NewRequest("PUT", u, opts) @@ -147,7 +147,7 @@ func (s *TeamsService) AddTeamMembershipByID(ctx context.Context, orgID, teamID // AddTeamMembershipBySlug adds or invites a user to a team, given a specified // organization name, by team slug. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#add-or-update-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/teams/members#add-or-update-team-membership-for-a-user func (s *TeamsService) AddTeamMembershipBySlug(ctx context.Context, org, slug, user string, opts *TeamAddTeamMembershipOptions) (*Membership, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/memberships/%v", org, slug, user) req, err := s.client.NewRequest("PUT", u, opts) @@ -167,7 +167,7 @@ func (s *TeamsService) AddTeamMembershipBySlug(ctx context.Context, org, slug, u // RemoveTeamMembershipByID removes a user from a team, given a specified // organization ID, by team ID. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#remove-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/teams/members#remove-team-membership-for-a-user func (s *TeamsService) RemoveTeamMembershipByID(ctx context.Context, orgID, teamID int64, user string) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/memberships/%v", orgID, teamID, user) req, err := s.client.NewRequest("DELETE", u, nil) @@ -181,7 +181,7 @@ func (s *TeamsService) RemoveTeamMembershipByID(ctx context.Context, orgID, team // RemoveTeamMembershipBySlug removes a user from a team, given a specified // organization name, by team slug. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#remove-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/teams/members#remove-team-membership-for-a-user func (s *TeamsService) RemoveTeamMembershipBySlug(ctx context.Context, org, slug, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/memberships/%v", org, slug, user) req, err := s.client.NewRequest("DELETE", u, nil) @@ -195,7 +195,7 @@ func (s *TeamsService) RemoveTeamMembershipBySlug(ctx context.Context, org, slug // ListPendingTeamInvitationsByID gets pending invitation list of a team, given a specified // organization ID, by team ID. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#list-pending-team-invitations +// GitHub API docs: https://docs.github.com/en/rest/teams/members#list-pending-team-invitations func (s *TeamsService) ListPendingTeamInvitationsByID(ctx context.Context, orgID, teamID int64, opts *ListOptions) ([]*Invitation, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/invitations", orgID, teamID) u, err := addOptions(u, opts) @@ -220,7 +220,7 @@ func (s *TeamsService) ListPendingTeamInvitationsByID(ctx context.Context, orgID // ListPendingTeamInvitationsBySlug get pending invitation list of a team, given a specified // organization name, by team slug. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/teams/#list-pending-team-invitations +// GitHub API docs: https://docs.github.com/en/rest/teams/members#list-pending-team-invitations func (s *TeamsService) ListPendingTeamInvitationsBySlug(ctx context.Context, org, slug string, opts *ListOptions) ([]*Invitation, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/invitations", org, slug) u, err := addOptions(u, opts) diff --git a/github/users.go b/github/users.go index f45b1f6711b..e694e05416c 100644 --- a/github/users.go +++ b/github/users.go @@ -13,7 +13,7 @@ import ( // UsersService handles communication with the user related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/users/ +// GitHub API docs: https://docs.github.com/en/rest/users/ type UsersService service // User represents a GitHub user. @@ -63,7 +63,7 @@ type User struct { SubscriptionsURL *string `json:"subscriptions_url,omitempty"` // TextMatches is only populated from search results that request text matches - // See: search.go and https://docs.github.com/en/free-pro-team@latest/rest/reference/search/#text-match-metadata + // See: search.go and https://docs.github.com/en/rest/search/#text-match-metadata TextMatches []*TextMatch `json:"text_matches,omitempty"` // Permissions identifies the permissions that a user has on a given @@ -78,8 +78,8 @@ func (u User) String() string { // Get fetches a user. Passing the empty string will fetch the authenticated // user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/users/#get-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/users/#get-a-user +// GitHub API docs: https://docs.github.com/en/rest/users/users#get-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/users#get-a-user func (s *UsersService) Get(ctx context.Context, user string) (*User, *Response, error) { var u string if user != "" { @@ -122,7 +122,7 @@ func (s *UsersService) GetByID(ctx context.Context, id int64) (*User, *Response, // Edit the authenticated user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/users/#update-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/users#update-the-authenticated-user func (s *UsersService) Edit(ctx context.Context, user *User) (*User, *Response, error) { u := "user" req, err := s.client.NewRequest("PATCH", u, user) @@ -164,7 +164,7 @@ type UserContext struct { // GetHovercard fetches contextual information about user. It requires authentication // via Basic Auth or via OAuth with the repo scope. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/users/#get-contextual-information-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/users/users#get-contextual-information-for-a-user func (s *UsersService) GetHovercard(ctx context.Context, user string, opts *HovercardOptions) (*Hovercard, *Response, error) { u := fmt.Sprintf("users/%v/hovercard", user) u, err := addOptions(u, opts) @@ -202,7 +202,7 @@ type UserListOptions struct { // // To paginate through all users, populate 'Since' with the ID of the last user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/users/#list-users +// GitHub API docs: https://docs.github.com/en/rest/users/users#list-users func (s *UsersService) ListAll(ctx context.Context, opts *UserListOptions) ([]*User, *Response, error) { u, err := addOptions("users", opts) if err != nil { @@ -226,7 +226,7 @@ func (s *UsersService) ListAll(ctx context.Context, opts *UserListOptions) ([]*U // ListInvitations lists all currently-open repository invitations for the // authenticated user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#list-repository-invitations-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/collaborators/invitations#list-repository-invitations-for-the-authenticated-user func (s *UsersService) ListInvitations(ctx context.Context, opts *ListOptions) ([]*RepositoryInvitation, *Response, error) { u, err := addOptions("user/repository_invitations", opts) if err != nil { @@ -250,7 +250,7 @@ func (s *UsersService) ListInvitations(ctx context.Context, opts *ListOptions) ( // AcceptInvitation accepts the currently-open repository invitation for the // authenticated user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#accept-a-repository-invitation +// GitHub API docs: https://docs.github.com/en/rest/collaborators/invitations#accept-a-repository-invitation func (s *UsersService) AcceptInvitation(ctx context.Context, invitationID int64) (*Response, error) { u := fmt.Sprintf("user/repository_invitations/%v", invitationID) req, err := s.client.NewRequest("PATCH", u, nil) @@ -264,7 +264,7 @@ func (s *UsersService) AcceptInvitation(ctx context.Context, invitationID int64) // DeclineInvitation declines the currently-open repository invitation for the // authenticated user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#decline-a-repository-invitation +// GitHub API docs: https://docs.github.com/en/rest/collaborators/invitations#decline-a-repository-invitation func (s *UsersService) DeclineInvitation(ctx context.Context, invitationID int64) (*Response, error) { u := fmt.Sprintf("user/repository_invitations/%v", invitationID) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/users_blocking.go b/github/users_blocking.go index cdbc2c25326..3d38d947898 100644 --- a/github/users_blocking.go +++ b/github/users_blocking.go @@ -12,7 +12,7 @@ import ( // ListBlockedUsers lists all the blocked users by the authenticated user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/users/#list-users-blocked-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/blocking#list-users-blocked-by-the-authenticated-user func (s *UsersService) ListBlockedUsers(ctx context.Context, opts *ListOptions) ([]*User, *Response, error) { u := "user/blocks" u, err := addOptions(u, opts) @@ -39,7 +39,7 @@ func (s *UsersService) ListBlockedUsers(ctx context.Context, opts *ListOptions) // IsBlocked reports whether specified user is blocked by the authenticated user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/users/#check-if-a-user-is-blocked-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/blocking#check-if-a-user-is-blocked-by-the-authenticated-user func (s *UsersService) IsBlocked(ctx context.Context, user string) (bool, *Response, error) { u := fmt.Sprintf("user/blocks/%v", user) @@ -58,7 +58,7 @@ func (s *UsersService) IsBlocked(ctx context.Context, user string) (bool, *Respo // BlockUser blocks specified user for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/users/#block-a-user +// GitHub API docs: https://docs.github.com/en/rest/users/blocking#block-a-user func (s *UsersService) BlockUser(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("user/blocks/%v", user) @@ -75,7 +75,7 @@ func (s *UsersService) BlockUser(ctx context.Context, user string) (*Response, e // UnblockUser unblocks specified user for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/users/#unblock-a-user +// GitHub API docs: https://docs.github.com/en/rest/users/blocking#unblock-a-user func (s *UsersService) UnblockUser(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("user/blocks/%v", user) diff --git a/github/users_emails.go b/github/users_emails.go index 94e7fb81a6f..be7e0f819ec 100644 --- a/github/users_emails.go +++ b/github/users_emails.go @@ -17,7 +17,7 @@ type UserEmail struct { // ListEmails lists all email addresses for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/users/#list-email-addresses-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/emails#list-email-addresses-for-the-authenticated-user func (s *UsersService) ListEmails(ctx context.Context, opts *ListOptions) ([]*UserEmail, *Response, error) { u := "user/emails" u, err := addOptions(u, opts) @@ -41,7 +41,7 @@ func (s *UsersService) ListEmails(ctx context.Context, opts *ListOptions) ([]*Us // AddEmails adds email addresses of the authenticated user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/users/#add-an-email-address-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/emails#add-an-email-address-for-the-authenticated-user func (s *UsersService) AddEmails(ctx context.Context, emails []string) ([]*UserEmail, *Response, error) { u := "user/emails" req, err := s.client.NewRequest("POST", u, emails) @@ -60,7 +60,7 @@ func (s *UsersService) AddEmails(ctx context.Context, emails []string) ([]*UserE // DeleteEmails deletes email addresses from authenticated user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/users/#delete-an-email-address-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/emails#delete-an-email-address-for-the-authenticated-user func (s *UsersService) DeleteEmails(ctx context.Context, emails []string) (*Response, error) { u := "user/emails" req, err := s.client.NewRequest("DELETE", u, emails) diff --git a/github/users_followers.go b/github/users_followers.go index f26392b6e22..1266e0e9ee3 100644 --- a/github/users_followers.go +++ b/github/users_followers.go @@ -13,8 +13,8 @@ import ( // ListFollowers lists the followers for a user. Passing the empty string will // fetch followers for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/users/#list-followers-of-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/users/#list-followers-of-a-user +// GitHub API docs: https://docs.github.com/en/rest/users/followers#list-followers-of-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/followers#list-followers-of-a-user func (s *UsersService) ListFollowers(ctx context.Context, user string, opts *ListOptions) ([]*User, *Response, error) { var u string if user != "" { @@ -44,8 +44,8 @@ func (s *UsersService) ListFollowers(ctx context.Context, user string, opts *Lis // ListFollowing lists the people that a user is following. Passing the empty // string will list people the authenticated user is following. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/users/#list-the-people-the-authenticated-user-follows -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/users/#list-the-people-a-user-follows +// GitHub API docs: https://docs.github.com/en/rest/users/followers#list-the-people-the-authenticated-user-follows +// GitHub API docs: https://docs.github.com/en/rest/users/followers#list-the-people-a-user-follows func (s *UsersService) ListFollowing(ctx context.Context, user string, opts *ListOptions) ([]*User, *Response, error) { var u string if user != "" { @@ -75,8 +75,8 @@ func (s *UsersService) ListFollowing(ctx context.Context, user string, opts *Lis // IsFollowing checks if "user" is following "target". Passing the empty // string for "user" will check if the authenticated user is following "target". // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/users/#check-if-a-person-is-followed-by-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/users/#check-if-a-user-follows-another-user +// GitHub API docs: https://docs.github.com/en/rest/users/followers#check-if-a-person-is-followed-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/followers#check-if-a-user-follows-another-user func (s *UsersService) IsFollowing(ctx context.Context, user, target string) (bool, *Response, error) { var u string if user != "" { @@ -97,7 +97,7 @@ func (s *UsersService) IsFollowing(ctx context.Context, user, target string) (bo // Follow will cause the authenticated user to follow the specified user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/users/#follow-a-user +// GitHub API docs: https://docs.github.com/en/rest/users/followers#follow-a-user func (s *UsersService) Follow(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("user/following/%v", user) req, err := s.client.NewRequest("PUT", u, nil) @@ -110,7 +110,7 @@ func (s *UsersService) Follow(ctx context.Context, user string) (*Response, erro // Unfollow will cause the authenticated user to unfollow the specified user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/users/#unfollow-a-user +// GitHub API docs: https://docs.github.com/en/rest/users/followers#unfollow-a-user func (s *UsersService) Unfollow(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("user/following/%v", user) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/users_gpg_keys.go b/github/users_gpg_keys.go index 387cc9b038b..e9ce62221c7 100644 --- a/github/users_gpg_keys.go +++ b/github/users_gpg_keys.go @@ -45,8 +45,8 @@ type GPGEmail struct { // string will fetch keys for the authenticated user. It requires authentication // via Basic Auth or via OAuth with at least read:gpg_key scope. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/users/#list-gpg-keys-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/users/#list-gpg-keys-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/users/gpg-keys#list-gpg-keys-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/gpg-keys#list-gpg-keys-for-a-user func (s *UsersService) ListGPGKeys(ctx context.Context, user string, opts *ListOptions) ([]*GPGKey, *Response, error) { var u string if user != "" { @@ -76,7 +76,7 @@ func (s *UsersService) ListGPGKeys(ctx context.Context, user string, opts *ListO // GetGPGKey gets extended details for a single GPG key. It requires authentication // via Basic Auth or via OAuth with at least read:gpg_key scope. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/users/#get-a-gpg-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/gpg-keys#get-a-gpg-key-for-the-authenticated-user func (s *UsersService) GetGPGKey(ctx context.Context, id int64) (*GPGKey, *Response, error) { u := fmt.Sprintf("user/gpg_keys/%v", id) req, err := s.client.NewRequest("GET", u, nil) @@ -96,7 +96,7 @@ func (s *UsersService) GetGPGKey(ctx context.Context, id int64) (*GPGKey, *Respo // CreateGPGKey creates a GPG key. It requires authenticatation via Basic Auth // or OAuth with at least write:gpg_key scope. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/users/#create-a-gpg-key +// GitHub API docs: https://docs.github.com/en/rest/users/gpg-keys#create-a-gpg-key func (s *UsersService) CreateGPGKey(ctx context.Context, armoredPublicKey string) (*GPGKey, *Response, error) { gpgKey := &struct { ArmoredPublicKey string `json:"armored_public_key"` @@ -118,7 +118,7 @@ func (s *UsersService) CreateGPGKey(ctx context.Context, armoredPublicKey string // DeleteGPGKey deletes a GPG key. It requires authentication via Basic Auth or // via OAuth with at least admin:gpg_key scope. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/users/#delete-a-gpg-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/gpg-keys#delete-a-gpg-key-for-the-authenticated-user func (s *UsersService) DeleteGPGKey(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("user/gpg_keys/%v", id) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/users_keys.go b/github/users_keys.go index b5d4f79dfb5..59d26cdefa9 100644 --- a/github/users_keys.go +++ b/github/users_keys.go @@ -28,8 +28,8 @@ func (k Key) String() string { // ListKeys lists the verified public keys for a user. Passing the empty // string will fetch keys for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/users/#list-public-ssh-keys-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/users/#list-public-keys-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/users/keys#list-public-ssh-keys-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/keys#list-public-keys-for-a-user func (s *UsersService) ListKeys(ctx context.Context, user string, opts *ListOptions) ([]*Key, *Response, error) { var u string if user != "" { @@ -58,7 +58,7 @@ func (s *UsersService) ListKeys(ctx context.Context, user string, opts *ListOpti // GetKey fetches a single public key. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/users/#get-a-public-ssh-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/keys#get-a-public-ssh-key-for-the-authenticated-user func (s *UsersService) GetKey(ctx context.Context, id int64) (*Key, *Response, error) { u := fmt.Sprintf("user/keys/%v", id) @@ -78,7 +78,7 @@ func (s *UsersService) GetKey(ctx context.Context, id int64) (*Key, *Response, e // CreateKey adds a public key for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/users/#create-a-public-ssh-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/keys#create-a-public-ssh-key-for-the-authenticated-user func (s *UsersService) CreateKey(ctx context.Context, key *Key) (*Key, *Response, error) { u := "user/keys" @@ -98,7 +98,7 @@ func (s *UsersService) CreateKey(ctx context.Context, key *Key) (*Key, *Response // DeleteKey deletes a public key. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/users/#delete-a-public-ssh-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/keys#delete-a-public-ssh-key-for-the-authenticated-user func (s *UsersService) DeleteKey(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("user/keys/%v", id) diff --git a/github/users_packages.go b/github/users_packages.go index cd20f8c1894..da04919eccd 100644 --- a/github/users_packages.go +++ b/github/users_packages.go @@ -13,8 +13,8 @@ import ( // List the packages for a user. Passing the empty string for "user" will // list packages for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/reference/packages#list-packages-for-the-authenticated-users-namespace -// GitHub API docs: https://docs.github.com/en/rest/reference/packages#list-packages-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/packages#list-packages-for-the-authenticated-users-namespace +// GitHub API docs: https://docs.github.com/en/rest/packages#list-packages-for-a-user func (s *UsersService) ListPackages(ctx context.Context, user string, opts *PackageListOptions) ([]*Package, *Response, error) { var u string if user != "" { @@ -44,8 +44,8 @@ func (s *UsersService) ListPackages(ctx context.Context, user string, opts *Pack // Get a package by name for a user. Passing the empty string for "user" will // get the package for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/reference/packages#get-a-package-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/reference/packages#get-a-package-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/packages#get-a-package-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/packages#get-a-package-for-a-user func (s *UsersService) GetPackage(ctx context.Context, user, packageType, packageName string) (*Package, *Response, error) { var u string if user != "" { @@ -71,8 +71,8 @@ func (s *UsersService) GetPackage(ctx context.Context, user, packageType, packag // Delete a package from a user. Passing the empty string for "user" will // delete the package for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/reference/packages#delete-a-package-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/reference/packages#delete-a-package-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/packages#delete-a-package-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/packages#delete-a-package-for-a-user func (s *UsersService) DeletePackage(ctx context.Context, user, packageType, packageName string) (*Response, error) { var u string if user != "" { @@ -92,8 +92,8 @@ func (s *UsersService) DeletePackage(ctx context.Context, user, packageType, pac // Restore a package to a user. Passing the empty string for "user" will // restore the package for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/reference/packages#restore-a-package-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/reference/packages#restore-a-package-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/packages#restore-a-package-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/packages#restore-a-package-for-a-user func (s *UsersService) RestorePackage(ctx context.Context, user, packageType, packageName string) (*Response, error) { var u string if user != "" { @@ -113,8 +113,8 @@ func (s *UsersService) RestorePackage(ctx context.Context, user, packageType, pa // Get all versions of a package for a user. Passing the empty string for "user" will // get versions for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/reference/packages#get-all-package-versions-for-a-package-owned-by-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/reference/users#delete-an-email-address-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/packages#get-all-package-versions-for-a-package-owned-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/packages#get-all-package-versions-for-a-package-owned-by-a-user func (s *UsersService) PackageGetAllVersions(ctx context.Context, user, packageType, packageName string, opts *PackageListOptions) ([]*PackageVersion, *Response, error) { var u string if user != "" { @@ -144,8 +144,8 @@ func (s *UsersService) PackageGetAllVersions(ctx context.Context, user, packageT // Get a specific version of a package for a user. Passing the empty string for "user" will // get the version for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/reference/packages#get-a-package-version-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/reference/packages#get-a-package-version-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/packages#get-a-package-version-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/packages#get-a-package-version-for-a-user func (s *UsersService) PackageGetVersion(ctx context.Context, user, packageType, packageName string, packageVersionID int64) (*PackageVersion, *Response, error) { var u string if user != "" { @@ -171,8 +171,8 @@ func (s *UsersService) PackageGetVersion(ctx context.Context, user, packageType, // Delete a package version for a user. Passing the empty string for "user" will // delete the version for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/reference/packages#delete-a-package-version-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/reference/packages#delete-package-version-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/packages#delete-a-package-version-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/packages#delete-package-version-for-a-user func (s *UsersService) PackageDeleteVersion(ctx context.Context, user, packageType, packageName string, packageVersionID int64) (*Response, error) { var u string if user != "" { @@ -192,8 +192,8 @@ func (s *UsersService) PackageDeleteVersion(ctx context.Context, user, packageTy // Restore a package version to a user. Passing the empty string for "user" will // restore the version for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/reference/packages#restore-a-package-version-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/reference/packages#restore-package-version-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/packages#restore-a-package-version-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/packages#restore-package-version-for-a-user func (s *UsersService) PackageRestoreVersion(ctx context.Context, user, packageType, packageName string, packageVersionID int64) (*Response, error) { var u string if user != "" { diff --git a/github/users_projects.go b/github/users_projects.go index dd9ceaf2f88..0cbd61f923c 100644 --- a/github/users_projects.go +++ b/github/users_projects.go @@ -12,7 +12,7 @@ import ( // ListProjects lists the projects for the specified user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/projects/#list-user-projects +// GitHub API docs: https://docs.github.com/en/rest/projects/projects#list-user-projects func (s *UsersService) ListProjects(ctx context.Context, user string, opts *ProjectListOptions) ([]*Project, *Response, error) { u := fmt.Sprintf("users/%v/projects", user) u, err := addOptions(u, opts) @@ -47,7 +47,7 @@ type CreateUserProjectOptions struct { // CreateProject creates a GitHub Project for the current user. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/projects/#create-a-user-project +// GitHub API docs: https://docs.github.com/en/rest/projects/projects#create-a-user-project func (s *UsersService) CreateProject(ctx context.Context, opts *CreateUserProjectOptions) (*Project, *Response, error) { u := "user/projects" req, err := s.client.NewRequest("POST", u, opts) diff --git a/update-urls/activity-events_test.go b/update-urls/activity-events_test.go index 2e06c551817..9c5b3415dfa 100644 --- a/update-urls/activity-events_test.go +++ b/update-urls/activity-events_test.go @@ -6,17 +6,19 @@ package main import ( + _ "embed" + "strings" "testing" ) func newActivitiesEventsPipeline() *pipelineSetup { return &pipelineSetup{ - baseURL: "https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/events/", + baseURL: "https://docs.github.com/en/rest/activity/events/", endpointsFromWebsite: activityEventsWant, filename: "activity_events.go", serviceName: "ActivityService", - originalGoSource: activityEventsGoFileOriginal, - wantGoSource: activityEventsGoFileWant, + originalGoSource: strings.ReplaceAll(activityEventsGoFileOriginal, "\r", ""), + wantGoSource: strings.ReplaceAll(activityEventsGoFileWant, "\r", ""), wantNumEndpoints: 7, } } @@ -46,8 +48,11 @@ func TestPipeline_ActivityEvents_FirstStripAllURLsAndDestroyReceivers(t *testing } func TestParseWebPageEndpoints_ActivityEvents(t *testing.T) { - got, want := parseWebPageEndpoints(activityEventsTestWebPage), activityEventsWant - testWebPageHelper(t, got, want) + got, err := parseWebPageEndpoints(activityEventsTestWebPage) + if err != nil { + t.Fatal(err) + } + testWebPageHelper(t, got, activityEventsWant) } var activityEventsWant = endpointsByFragmentID{ @@ -178,6087 +183,11 @@ var activityEventsWant = endpointsByFragmentID{ }, } -var activityEventsTestWebPage = ` - - - Activity - GitHub Docs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - -
    -
    - - - -
    -
    - -
    - - - Article version: GitHub.com - - - - -
    - - -
    -
    - - -
    -
    - -
    - -
    -
    -

    Activity

    -
    - -
    -
    - - - - - - - - -
    -
    -
    - -

    In this article

    - - -
    - -
    -

    - Did this doc help you? -

    -

    - - - - -

    - - - - - -

    - - -

    - - -
    - -
    -
    -
    -
    - -

    Events

    -

    The Events API is a read-only API to the GitHub events. These events power the various activity streams on the site.

    -

    The Events API can return different types of events triggered by activity on GitHub. For more information about the specific events that you can receive from the Events API, see "GitHub Event types." An events API for repository issues is also available. For more information, see the "Issue Events API."

    -

    Events are optimized for polling with the "ETag" header. If no new events have been triggered, you will see a "304 Not Modified" response, and your current rate limit will be untouched. There is also an "X-Poll-Interval" header that specifies how often (in seconds) you are allowed to poll. In times of high server load, the time may increase. Please obey the header.

    -
    $ curl -I https://api.github.com/users/tater/events
    -> HTTP/1.1 200 OK
    -> X-Poll-Interval: 60
    -> ETag: "a18c3bded88eb5dbb5c849a489412bf3"
    -
    -# The quotes around the ETag value are important
    -$ curl -I https://api.github.com/users/tater/events \
    -$    -H 'If-None-Match: "a18c3bded88eb5dbb5c849a489412bf3"'
    -> HTTP/1.1 304 Not Modified
    -> X-Poll-Interval: 60
    -

    Events support pagination, however the per_page option is unsupported. The fixed page size is 30 items. Fetching up to ten pages is supported, for a total of 300 events. For information, see "Traversing with pagination."

    -

    Only events created within the past 90 days will be included in timelines. Events older than 90 days will not be included (even if the total number of events in the timeline is less than 300).

    -
    -
    -

    - List public events -

    -

    We delay the public events feed by five minutes, which means the most recent event returned by the public events API actually occurred at least five minutes ago.

    -
    -
    get /events
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/events
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /events')
    -
    - - - - -

    Response

    -
    Status: 200 OK
    -
    - - -

    Notes

    - - - -
    -
    -
    -
    - -
    get /networks/{owner}/{repo}/events
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    ownerstringpath - - -
    repostringpath - - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/networks/octocat/hello-world/events
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /networks/{owner}/{repo}/events', {
    -  owner: 'octocat',
    -  repo: 'hello-world'
    -})
    -
    - - - - -

    Response

    -
    Status: 200 OK
    -
    - - -

    Notes

    - - - -
    -
    -
    -
    - -
    get /orgs/{org}/events
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    orgstringpath - - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/orgs/ORG/events
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /orgs/{org}/events', {
    -  org: 'org'
    -})
    -
    - - - - -

    Response

    -
    Status: 200 OK
    -
    - - -

    Notes

    - - - -
    -
    -
    -
    - -
    get /repos/{owner}/{repo}/events
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    ownerstringpath - - -
    repostringpath - - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/repos/octocat/hello-world/events
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /repos/{owner}/{repo}/events', {
    -  owner: 'octocat',
    -  repo: 'hello-world'
    -})
    -
    - - - - -

    Response

    -
    Status: 200 OK
    -
    - - -

    Notes

    - - - -
    -
    -
    -
    -
    -

    - List events for the authenticated user -

    -

    If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events.

    -
    -
    get /users/{username}/events
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    usernamestringpath - - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/users/USERNAME/events
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /users/{username}/events', {
    -  username: 'username'
    -})
    -
    - - - - -

    Response

    -
    Status: 200 OK
    -
    - - -

    Notes

    - - - -
    -
    -
    -
    -
    -

    - List organization events for the authenticated user -

    -

    This is the user's organization dashboard. You must be authenticated as the user to view this.

    -
    -
    get /users/{username}/events/orgs/{org}
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    usernamestringpath - - -
    orgstringpath - - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/users/USERNAME/events/orgs/ORG
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /users/{username}/events/orgs/{org}', {
    -  username: 'username',
    -  org: 'org'
    -})
    -
    - - - - -

    Response

    -
    Status: 200 OK
    -
    - - - -
    -
    -
    -
    - -
    get /users/{username}/events/public
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    usernamestringpath - - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/users/USERNAME/events/public
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /users/{username}/events/public', {
    -  username: 'username'
    -})
    -
    - - - - -

    Response

    -
    Status: 200 OK
    -
    - - -

    Notes

    - - - -
    -
    -
    -
    -
    -

    - List events received by the authenticated user -

    -

    These are events that you've received by watching repos and following users. If you are authenticated as the given user, you will see private events. Otherwise, you'll only see public events.

    -
    -
    get /users/{username}/received_events
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    usernamestringpath - - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/users/USERNAME/received_events
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /users/{username}/received_events', {
    -  username: 'username'
    -})
    -
    - - - - -

    Response

    -
    Status: 200 OK
    -
    - - -

    Notes

    - - - -
    -
    -
    -
    - -
    get /users/{username}/received_events/public
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    usernamestringpath - - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/users/USERNAME/received_events/public
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /users/{username}/received_events/public', {
    -  username: 'username'
    -})
    -
    - - - - -

    Response

    -
    Status: 200 OK
    -
    - - -

    Notes

    - - - -
    -
    -
    -

    Feeds

    -
    -
    -

    - Get feeds -

    -

    GitHub provides several timeline resources in Atom format. The Feeds API lists all the feeds available to the authenticated user:

    -
      -
    • Timeline: The GitHub global public timeline
    • -
    • User: The public timeline for any user, using URI template
    • -
    • Current user public: The public timeline for the authenticated user
    • -
    • Current user: The private timeline for the authenticated user
    • -
    • Current user actor: The private timeline for activity created by the authenticated user
    • -
    • Current user organizations: The private timeline for the organizations the authenticated user is a member of.
    • -
    • Security advisories: A collection of public announcements that provide information about security-related vulnerabilities in software on GitHub.
    • -
    -

    Note: Private feeds are only returned when authenticating via Basic Auth since current feed URIs use the older, non revocable auth tokens.

    -
    -
    get /feeds
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/feeds
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /feeds')
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    {
    -  "timeline_url": "https://github.com/timeline",
    -  "user_url": "https://github.com/{user}",
    -  "current_user_public_url": "https://github.com/octocat",
    -  "current_user_url": "https://github.com/octocat.private?token=abc123",
    -  "current_user_actor_url": "https://github.com/octocat.private.actor?token=abc123",
    -  "current_user_organization_url": "",
    -  "current_user_organization_urls": [
    -    "https://github.com/organizations/github/octocat.private.atom?token=abc123"
    -  ],
    -  "security_advisories_url": "https://github.com/security-advisories",
    -  "_links": {
    -    "timeline": {
    -      "href": "https://github.com/timeline",
    -      "type": "application/atom+xml"
    -    },
    -    "user": {
    -      "href": "https://github.com/{user}",
    -      "type": "application/atom+xml"
    -    },
    -    "current_user_public": {
    -      "href": "https://github.com/octocat",
    -      "type": "application/atom+xml"
    -    },
    -    "current_user": {
    -      "href": "https://github.com/octocat.private?token=abc123",
    -      "type": "application/atom+xml"
    -    },
    -    "current_user_actor": {
    -      "href": "https://github.com/octocat.private.actor?token=abc123",
    -      "type": "application/atom+xml"
    -    },
    -    "current_user_organization": {
    -      "href": "",
    -      "type": ""
    -    },
    -    "current_user_organizations": [
    -      {
    -        "href": "https://github.com/organizations/github/octocat.private.atom?token=abc123",
    -        "type": "application/atom+xml"
    -      }
    -    ],
    -    "security_advisories": {
    -      "href": "https://github.com/security-advisories",
    -      "type": "application/atom+xml"
    -    }
    -  }
    -}
    -
    - - -

    Notes

    - - - -
    -
    -
    -

    Example of getting an Atom feed

    -

    To get a feed in Atom format, you must specify the application/atom+xml type in the Accept header. For example, to get the Atom feed for GitHub security advisories:

    -
    curl -H "Accept: application/atom+xml" https://github.com/security-advisories
    -
    -

    Response

    -
    Status: 200 OK
    -
    <?xml version="1.0" encoding="UTF-8"?>
    -<feed xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xml:lang="en-US">
    -  <id>tag:github.com,2008:/security-advisories</id>
    -  <link rel="self" type="application/atom+xml" href="https://github.com/security-advisories.atom"/>
    -  <title>GitHub Security Advisory Feed</title>
    -  <author>
    -    <name>GitHub</name>
    -  </author>
    -  <updated>2019-01-14T19:34:52Z</updated>
    -     <entry>
    -      <id>tag:github.com,2008:GHSA-abcd-12ab-23cd</id>
    -      <published>2018-07-26T15:14:52Z</published>
    -      <updated>2019-01-14T19:34:52Z</updated>
    -      <title type="html">[GHSA-abcd-12ab-23cd] Moderate severity vulnerability that affects Octoapp</title>
    -        <category term="NPM"/>
    -      <content type="html">
    -        &lt;p&gt;Octoapp node module before 4.17.5 suffers from a Modification of Assumed-Immutable Data (MAID) vulnerability via defaultsDeep, merge, and mergeWith functions, which allows a malicious user to modify the prototype of &quot;Object&quot; via &lt;strong&gt;proto&lt;/strong&gt;, causing the addition or modification of an existing property that will exist on all objects.&lt;/p&gt;
    -          &lt;p&gt;&lt;strong&gt;Affected Packages&lt;/strong&gt;&lt;/p&gt;
    -
    -  &lt;dl&gt;
    -      &lt;dt&gt;Octoapp&lt;/dt&gt;
    -      &lt;dd&gt;Ecosystem: npm&lt;/dd&gt;
    -      &lt;dd&gt;Severity: moderate&lt;/dd&gt;
    -      &lt;dd&gt;Versions: &amp;lt; 4.17.5&lt;/dd&gt;
    -        &lt;dd&gt;Fixed in: 4.17.5&lt;/dd&gt;
    -  &lt;/dl&gt;
    -
    -          &lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;
    -
    -  &lt;ul&gt;
    -      &lt;li&gt;https://nvd.nist.gov/vuln/detail/CVE-2018-123&lt;/li&gt;
    -  &lt;/ul&gt;
    -
    -      </content>
    -    </entry>
    -</feed>
    -
    -

    Notifications

    -

    Users receive notifications for conversations in repositories they watch including:

    -
      -
    • Issues and their comments
    • -
    • Pull Requests and their comments
    • -
    • Comments on any commits
    • -
    -

    Notifications are also sent for conversations in unwatched repositories when the user is involved including:

    -
      -
    • @mentions
    • -
    • Issue assignments
    • -
    • Commits the user authors or commits
    • -
    • Any discussion in which the user actively participates
    • -
    -

    All Notification API calls require the notifications or repo API scopes. Doing this will give read-only access to some issue and commit content. You will still need the repo scope to access issues and commits from their respective endpoints.

    -

    Notifications come back as "threads". A thread contains information about the current discussion of an issue, pull request, or commit.

    -

    Notifications are optimized for polling with the Last-Modified header. If there are no new notifications, you will see a 304 Not Modified response, leaving your current rate limit untouched. There is an X-Poll-Interval header that specifies how often (in seconds) you are allowed to poll. In times of high server load, the time may increase. Please obey the header.

    -
    # Add authentication to your requests
    -$ curl -I https://api.github.com/notifications
    -HTTP/1.1 200 OK
    -Last-Modified: Thu, 25 Oct 2012 15:16:27 GMT
    -X-Poll-Interval: 60
    -
    -# Pass the Last-Modified header exactly
    -$ curl -I https://api.github.com/notifications
    -$    -H "If-Modified-Since: Thu, 25 Oct 2012 15:16:27 GMT"
    -> HTTP/1.1 304 Not Modified
    -> X-Poll-Interval: 60
    -

    Notification reasons

    -

    When retrieving responses from the Notifications API, each payload has a key titled reason. These correspond to events that trigger a notification.

    -

    Here's a list of potential reasons for receiving a notification:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Reason NameDescription
    assignYou were assigned to the issue.
    authorYou created the thread.
    commentYou commented on the thread.
    invitationYou accepted an invitation to contribute to the repository.
    manualYou subscribed to the thread (via an issue or pull request).
    mentionYou were specifically @mentioned in the content.
    review_requestedYou, or a team you're a member of, were requested to review a pull request.
    security_alertGitHub discovered a security vulnerability in your repository.
    state_changeYou changed the thread state (for example, closing an issue or merging a pull request).
    subscribedYou're watching the repository.
    team_mentionYou were on a team that was mentioned.
    -

    Note that the reason is modified on a per-thread basis, and can change, if the reason on a later notification is different.

    -

    For example, if you are the author of an issue, subsequent notifications on that issue will have a reason of author. If you're then @mentioned on the same issue, the notifications you fetch thereafter will have a reason of mention. The reason remains as mention, regardless of whether you're ever mentioned again.

    -
    -
    -

    - List notifications for the authenticated user -

    -

    List all notifications for the current user, sorted by most recently updated.

    -
    -
    get /notifications
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    allbooleanquery -

    If true, show notifications marked as read.

    - -
    participatingbooleanquery -

    If true, only shows notifications in which the user is directly participating or mentioned.

    - -
    sincestringquery -

    Only show notifications updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

    - -
    beforestringquery -

    Only show notifications updated before the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

    - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/notifications
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /notifications')
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    [
    -  {
    -    "id": "1",
    -    "repository": {
    -      "id": 1296269,
    -      "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
    -      "name": "Hello-World",
    -      "full_name": "octocat/Hello-World",
    -      "owner": {
    -        "login": "octocat",
    -        "id": 1,
    -        "node_id": "MDQ6VXNlcjE=",
    -        "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -        "gravatar_id": "",
    -        "url": "https://api.github.com/users/octocat",
    -        "html_url": "https://github.com/octocat",
    -        "followers_url": "https://api.github.com/users/octocat/followers",
    -        "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -        "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -        "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -        "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -        "organizations_url": "https://api.github.com/users/octocat/orgs",
    -        "repos_url": "https://api.github.com/users/octocat/repos",
    -        "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -        "received_events_url": "https://api.github.com/users/octocat/received_events",
    -        "type": "User",
    -        "site_admin": false
    -      },
    -      "private": false,
    -      "html_url": "https://github.com/octocat/Hello-World",
    -      "description": "This your first repo!",
    -      "fork": false,
    -      "url": "https://api.github.com/repos/octocat/Hello-World",
    -      "archive_url": "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
    -      "assignees_url": "http://api.github.com/repos/octocat/Hello-World/assignees{/user}",
    -      "blobs_url": "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
    -      "branches_url": "http://api.github.com/repos/octocat/Hello-World/branches{/branch}",
    -      "collaborators_url": "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
    -      "comments_url": "http://api.github.com/repos/octocat/Hello-World/comments{/number}",
    -      "commits_url": "http://api.github.com/repos/octocat/Hello-World/commits{/sha}",
    -      "compare_url": "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
    -      "contents_url": "http://api.github.com/repos/octocat/Hello-World/contents/{+path}",
    -      "contributors_url": "http://api.github.com/repos/octocat/Hello-World/contributors",
    -      "deployments_url": "http://api.github.com/repos/octocat/Hello-World/deployments",
    -      "downloads_url": "http://api.github.com/repos/octocat/Hello-World/downloads",
    -      "events_url": "http://api.github.com/repos/octocat/Hello-World/events",
    -      "forks_url": "http://api.github.com/repos/octocat/Hello-World/forks",
    -      "git_commits_url": "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
    -      "git_refs_url": "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
    -      "git_tags_url": "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
    -      "git_url": "git:github.com/octocat/Hello-World.git",
    -      "issue_comment_url": "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
    -      "issue_events_url": "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
    -      "issues_url": "http://api.github.com/repos/octocat/Hello-World/issues{/number}",
    -      "keys_url": "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
    -      "labels_url": "http://api.github.com/repos/octocat/Hello-World/labels{/name}",
    -      "languages_url": "http://api.github.com/repos/octocat/Hello-World/languages",
    -      "merges_url": "http://api.github.com/repos/octocat/Hello-World/merges",
    -      "milestones_url": "http://api.github.com/repos/octocat/Hello-World/milestones{/number}",
    -      "notifications_url": "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
    -      "pulls_url": "http://api.github.com/repos/octocat/Hello-World/pulls{/number}",
    -      "releases_url": "http://api.github.com/repos/octocat/Hello-World/releases{/id}",
    -      "ssh_url": "git@github.com:octocat/Hello-World.git",
    -      "stargazers_url": "http://api.github.com/repos/octocat/Hello-World/stargazers",
    -      "statuses_url": "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
    -      "subscribers_url": "http://api.github.com/repos/octocat/Hello-World/subscribers",
    -      "subscription_url": "http://api.github.com/repos/octocat/Hello-World/subscription",
    -      "tags_url": "http://api.github.com/repos/octocat/Hello-World/tags",
    -      "teams_url": "http://api.github.com/repos/octocat/Hello-World/teams",
    -      "trees_url": "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}"
    -    },
    -    "subject": {
    -      "title": "Greetings",
    -      "url": "https://api.github.com/repos/octokit/octokit.rb/issues/123",
    -      "latest_comment_url": "https://api.github.com/repos/octokit/octokit.rb/issues/comments/123",
    -      "type": "Issue"
    -    },
    -    "reason": "subscribed",
    -    "unread": true,
    -    "updated_at": "2014-11-07T22:01:45Z",
    -    "last_read_at": "2014-11-07T22:01:45Z",
    -    "url": "https://api.github.com/notifications/threads/1"
    -  }
    -]
    -
    - - - -
    -
    -
    -
    -
    -

    - Mark notifications as read -

    -

    Marks all notifications as "read" removes it from the default view on GitHub. If the number of notifications is too large to complete in one request, you will receive a 202 Accepted status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the List notifications for the authenticated user endpoint and pass the query parameter all=false.

    -
    -
    put /notifications
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    last_read_atstringbody -

    Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. Default: The current timestamp.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X PUT \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/notifications \
    -  -d '{"last_read_at":"last_read_at"}'
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('PUT /notifications', {
    -  last_read_at: 'last_read_at'
    -})
    -
    - - - - -

    Response

    -
    Status: 205 Reset Content
    -
    - - - -
    -
    -
    -
    -
    -

    - Get a thread -

    - -
    -
    get /notifications/threads/{thread_id}
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    thread_idintegerpath - - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/notifications/threads/42
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /notifications/threads/{thread_id}', {
    -  thread_id: 42
    -})
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    {
    -  "id": "1",
    -  "repository": {
    -    "id": 1296269,
    -    "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
    -    "name": "Hello-World",
    -    "full_name": "octocat/Hello-World",
    -    "owner": {
    -      "login": "octocat",
    -      "id": 1,
    -      "node_id": "MDQ6VXNlcjE=",
    -      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -      "gravatar_id": "",
    -      "url": "https://api.github.com/users/octocat",
    -      "html_url": "https://github.com/octocat",
    -      "followers_url": "https://api.github.com/users/octocat/followers",
    -      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -      "organizations_url": "https://api.github.com/users/octocat/orgs",
    -      "repos_url": "https://api.github.com/users/octocat/repos",
    -      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -      "received_events_url": "https://api.github.com/users/octocat/received_events",
    -      "type": "User",
    -      "site_admin": false
    -    },
    -    "private": false,
    -    "html_url": "https://github.com/octocat/Hello-World",
    -    "description": "This your first repo!",
    -    "fork": false,
    -    "url": "https://api.github.com/repos/octocat/Hello-World",
    -    "archive_url": "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
    -    "assignees_url": "http://api.github.com/repos/octocat/Hello-World/assignees{/user}",
    -    "blobs_url": "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
    -    "branches_url": "http://api.github.com/repos/octocat/Hello-World/branches{/branch}",
    -    "collaborators_url": "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
    -    "comments_url": "http://api.github.com/repos/octocat/Hello-World/comments{/number}",
    -    "commits_url": "http://api.github.com/repos/octocat/Hello-World/commits{/sha}",
    -    "compare_url": "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
    -    "contents_url": "http://api.github.com/repos/octocat/Hello-World/contents/{+path}",
    -    "contributors_url": "http://api.github.com/repos/octocat/Hello-World/contributors",
    -    "deployments_url": "http://api.github.com/repos/octocat/Hello-World/deployments",
    -    "downloads_url": "http://api.github.com/repos/octocat/Hello-World/downloads",
    -    "events_url": "http://api.github.com/repos/octocat/Hello-World/events",
    -    "forks_url": "http://api.github.com/repos/octocat/Hello-World/forks",
    -    "git_commits_url": "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
    -    "git_refs_url": "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
    -    "git_tags_url": "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
    -    "git_url": "git:github.com/octocat/Hello-World.git",
    -    "issue_comment_url": "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
    -    "issue_events_url": "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
    -    "issues_url": "http://api.github.com/repos/octocat/Hello-World/issues{/number}",
    -    "keys_url": "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
    -    "labels_url": "http://api.github.com/repos/octocat/Hello-World/labels{/name}",
    -    "languages_url": "http://api.github.com/repos/octocat/Hello-World/languages",
    -    "merges_url": "http://api.github.com/repos/octocat/Hello-World/merges",
    -    "milestones_url": "http://api.github.com/repos/octocat/Hello-World/milestones{/number}",
    -    "notifications_url": "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
    -    "pulls_url": "http://api.github.com/repos/octocat/Hello-World/pulls{/number}",
    -    "releases_url": "http://api.github.com/repos/octocat/Hello-World/releases{/id}",
    -    "ssh_url": "git@github.com:octocat/Hello-World.git",
    -    "stargazers_url": "http://api.github.com/repos/octocat/Hello-World/stargazers",
    -    "statuses_url": "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
    -    "subscribers_url": "http://api.github.com/repos/octocat/Hello-World/subscribers",
    -    "subscription_url": "http://api.github.com/repos/octocat/Hello-World/subscription",
    -    "tags_url": "http://api.github.com/repos/octocat/Hello-World/tags",
    -    "teams_url": "http://api.github.com/repos/octocat/Hello-World/teams",
    -    "trees_url": "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}"
    -  },
    -  "subject": {
    -    "title": "Greetings",
    -    "url": "https://api.github.com/repos/octokit/octokit.rb/issues/123",
    -    "latest_comment_url": "https://api.github.com/repos/octokit/octokit.rb/issues/comments/123",
    -    "type": "Issue"
    -  },
    -  "reason": "subscribed",
    -  "unread": true,
    -  "updated_at": "2014-11-07T22:01:45Z",
    -  "last_read_at": "2014-11-07T22:01:45Z",
    -  "url": "https://api.github.com/notifications/threads/1"
    -}
    -
    - - - -
    -
    -
    -
    - -
    patch /notifications/threads/{thread_id}
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    thread_idintegerpath - - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X PATCH \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/notifications/threads/42
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('PATCH /notifications/threads/{thread_id}', {
    -  thread_id: 42
    -})
    -
    - - - - -

    Response

    -
    Status: 205 Reset Content
    -
    - - - -
    -
    -
    -
    -
    -

    - Get a thread subscription for the authenticated user -

    -

    This checks to see if the current user is subscribed to a thread. You can also get a repository subscription.

    -

    Note that subscriptions are only generated if a user is participating in a conversation--for example, they've replied to the thread, were @mentioned, or manually subscribe to a thread.

    -
    -
    get /notifications/threads/{thread_id}/subscription
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    thread_idintegerpath - - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/notifications/threads/42/subscription
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /notifications/threads/{thread_id}/subscription', {
    -  thread_id: 42
    -})
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    {
    -  "subscribed": true,
    -  "ignored": false,
    -  "reason": null,
    -  "created_at": "2012-10-06T21:34:12Z",
    -  "url": "https://api.github.com/notifications/threads/1/subscription",
    -  "thread_url": "https://api.github.com/notifications/threads/1"
    -}
    -
    - - - -
    -
    -
    -
    -
    -

    - Set a thread subscription -

    -

    If you are watching a repository, you receive notifications for all threads by default. Use this endpoint to ignore future notifications for threads until you comment on the thread or get an @mention.

    -

    You can also use this endpoint to subscribe to threads that you are currently not receiving notifications for or to subscribed to threads that you have previously ignored.

    -

    Unsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the Delete a thread subscription endpoint.

    -
    -
    put /notifications/threads/{thread_id}/subscription
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    thread_idintegerpath - - -
    ignoredbooleanbody -

    Unsubscribes and subscribes you to a conversation. Set ignored to true to block all notifications from this thread.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X PUT \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/notifications/threads/42/subscription \
    -  -d '{"ignored":true}'
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('PUT /notifications/threads/{thread_id}/subscription', {
    -  thread_id: 42,
    -  ignored: true
    -})
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    {
    -  "subscribed": true,
    -  "ignored": false,
    -  "reason": null,
    -  "created_at": "2012-10-06T21:34:12Z",
    -  "url": "https://api.github.com/notifications/threads/1/subscription",
    -  "thread_url": "https://api.github.com/notifications/threads/1"
    -}
    -
    - - - -
    -
    -
    -
    -
    -

    - Delete a thread subscription -

    -

    Mutes all future notifications for a conversation until you comment on the thread or get an @mention. If you are watching the repository of the thread, you will still receive notifications. To ignore future notifications for a repository you are watching, use the Set a thread subscription endpoint and set ignore to true.

    -
    -
    delete /notifications/threads/{thread_id}/subscription
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    thread_idintegerpath - - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X DELETE \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/notifications/threads/42/subscription
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('DELETE /notifications/threads/{thread_id}/subscription', {
    -  thread_id: 42
    -})
    -
    - - - - -

    Default Response

    -
    Status: 204 No Content
    -
    - - - -
    -
    -
    -
    -
    -

    - List repository notifications for the authenticated user -

    -

    List all notifications for the current user.

    -
    -
    get /repos/{owner}/{repo}/notifications
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    ownerstringpath - - -
    repostringpath - - -
    allbooleanquery -

    If true, show notifications marked as read.

    - -
    participatingbooleanquery -

    If true, only shows notifications in which the user is directly participating or mentioned.

    - -
    sincestringquery -

    Only show notifications updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

    - -
    beforestringquery -

    Only show notifications updated before the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

    - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/repos/octocat/hello-world/notifications
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /repos/{owner}/{repo}/notifications', {
    -  owner: 'octocat',
    -  repo: 'hello-world'
    -})
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    [
    -  {
    -    "id": "1",
    -    "repository": {
    -      "id": 1296269,
    -      "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
    -      "name": "Hello-World",
    -      "full_name": "octocat/Hello-World",
    -      "owner": {
    -        "login": "octocat",
    -        "id": 1,
    -        "node_id": "MDQ6VXNlcjE=",
    -        "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -        "gravatar_id": "",
    -        "url": "https://api.github.com/users/octocat",
    -        "html_url": "https://github.com/octocat",
    -        "followers_url": "https://api.github.com/users/octocat/followers",
    -        "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -        "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -        "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -        "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -        "organizations_url": "https://api.github.com/users/octocat/orgs",
    -        "repos_url": "https://api.github.com/users/octocat/repos",
    -        "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -        "received_events_url": "https://api.github.com/users/octocat/received_events",
    -        "type": "User",
    -        "site_admin": false
    -      },
    -      "private": false,
    -      "html_url": "https://github.com/octocat/Hello-World",
    -      "description": "This your first repo!",
    -      "fork": false,
    -      "url": "https://api.github.com/repos/octocat/Hello-World",
    -      "archive_url": "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
    -      "assignees_url": "http://api.github.com/repos/octocat/Hello-World/assignees{/user}",
    -      "blobs_url": "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
    -      "branches_url": "http://api.github.com/repos/octocat/Hello-World/branches{/branch}",
    -      "collaborators_url": "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
    -      "comments_url": "http://api.github.com/repos/octocat/Hello-World/comments{/number}",
    -      "commits_url": "http://api.github.com/repos/octocat/Hello-World/commits{/sha}",
    -      "compare_url": "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
    -      "contents_url": "http://api.github.com/repos/octocat/Hello-World/contents/{+path}",
    -      "contributors_url": "http://api.github.com/repos/octocat/Hello-World/contributors",
    -      "deployments_url": "http://api.github.com/repos/octocat/Hello-World/deployments",
    -      "downloads_url": "http://api.github.com/repos/octocat/Hello-World/downloads",
    -      "events_url": "http://api.github.com/repos/octocat/Hello-World/events",
    -      "forks_url": "http://api.github.com/repos/octocat/Hello-World/forks",
    -      "git_commits_url": "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
    -      "git_refs_url": "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
    -      "git_tags_url": "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
    -      "git_url": "git:github.com/octocat/Hello-World.git",
    -      "issue_comment_url": "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
    -      "issue_events_url": "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
    -      "issues_url": "http://api.github.com/repos/octocat/Hello-World/issues{/number}",
    -      "keys_url": "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
    -      "labels_url": "http://api.github.com/repos/octocat/Hello-World/labels{/name}",
    -      "languages_url": "http://api.github.com/repos/octocat/Hello-World/languages",
    -      "merges_url": "http://api.github.com/repos/octocat/Hello-World/merges",
    -      "milestones_url": "http://api.github.com/repos/octocat/Hello-World/milestones{/number}",
    -      "notifications_url": "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
    -      "pulls_url": "http://api.github.com/repos/octocat/Hello-World/pulls{/number}",
    -      "releases_url": "http://api.github.com/repos/octocat/Hello-World/releases{/id}",
    -      "ssh_url": "git@github.com:octocat/Hello-World.git",
    -      "stargazers_url": "http://api.github.com/repos/octocat/Hello-World/stargazers",
    -      "statuses_url": "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
    -      "subscribers_url": "http://api.github.com/repos/octocat/Hello-World/subscribers",
    -      "subscription_url": "http://api.github.com/repos/octocat/Hello-World/subscription",
    -      "tags_url": "http://api.github.com/repos/octocat/Hello-World/tags",
    -      "teams_url": "http://api.github.com/repos/octocat/Hello-World/teams",
    -      "trees_url": "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}"
    -    },
    -    "subject": {
    -      "title": "Greetings",
    -      "url": "https://api.github.com/repos/octokit/octokit.rb/issues/123",
    -      "latest_comment_url": "https://api.github.com/repos/octokit/octokit.rb/issues/comments/123",
    -      "type": "Issue"
    -    },
    -    "reason": "subscribed",
    -    "unread": true,
    -    "updated_at": "2014-11-07T22:01:45Z",
    -    "last_read_at": "2014-11-07T22:01:45Z",
    -    "url": "https://api.github.com/notifications/threads/1"
    -  }
    -]
    -
    - - - -
    -
    -
    -
    -
    -

    - Mark repository notifications as read -

    -

    Marks all notifications in a repository as "read" removes them from the default view on GitHub. If the number of notifications is too large to complete in one request, you will receive a 202 Accepted status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the List repository notifications for the authenticated user endpoint and pass the query parameter all=false.

    -
    -
    put /repos/{owner}/{repo}/notifications
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    ownerstringpath - - -
    repostringpath - - -
    last_read_atstringbody -

    Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. Default: The current timestamp.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X PUT \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/repos/octocat/hello-world/notifications \
    -  -d '{"last_read_at":"last_read_at"}'
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('PUT /repos/{owner}/{repo}/notifications', {
    -  owner: 'octocat',
    -  repo: 'hello-world',
    -  last_read_at: 'last_read_at'
    -})
    -
    - - - - -

    Response

    -
    Status: 205 Reset Content
    -
    - - - -
    -
    -
    -

    Starring

    -

    Repository starring is a feature that lets users bookmark repositories. Stars are shown next to repositories to show an approximate level of interest. Stars have no effect on notifications or the activity feed.

    -

    Starring vs. Watching

    -

    In August 2012, we changed the way watching -works on GitHub. Many API -client applications may be using the original "watcher" endpoints for accessing -this data. You can now start using the "star" endpoints instead (described -below). For more information, see the Watcher API Change post and the "Repository Watching API."

    -

    Custom media types for starring

    -

    There is one supported custom media type for the Starring REST API. When you use this custom media type, you will receive a response with the starred_at timestamp property that indicates the time the star was created. The response also has a second property that includes the resource that is returned when the custom media type is not included. The property that contains the resource will be either user or repo.

    -
    application/vnd.github.v3.star+json
    -
    -

    For more information about media types, see "Custom media types."

    -
    -
    -

    - List stargazers -

    -

    Lists the people that have starred the repository.

    -

    You can also find out when stars were created by passing the following custom media type via the Accept header:

    -
    -
    get /repos/{owner}/{repo}/stargazers
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    ownerstringpath - - -
    repostringpath - - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/repos/octocat/hello-world/stargazers
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /repos/{owner}/{repo}/stargazers', {
    -  owner: 'octocat',
    -  repo: 'hello-world'
    -})
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    [
    -  {
    -    "login": "octocat",
    -    "id": 1,
    -    "node_id": "MDQ6VXNlcjE=",
    -    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -    "gravatar_id": "",
    -    "url": "https://api.github.com/users/octocat",
    -    "html_url": "https://github.com/octocat",
    -    "followers_url": "https://api.github.com/users/octocat/followers",
    -    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -    "organizations_url": "https://api.github.com/users/octocat/orgs",
    -    "repos_url": "https://api.github.com/users/octocat/repos",
    -    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -    "received_events_url": "https://api.github.com/users/octocat/received_events",
    -    "type": "User",
    -    "site_admin": false
    -  }
    -]
    -
    - - -

    Notes

    - - - -
    -
    -
    -
    -
    -

    - List repositories starred by the authenticated user -

    -

    Lists repositories the authenticated user has starred.

    -

    You can also find out when stars were created by passing the following custom media type via the Accept header:

    -
    -
    get /user/starred
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    sortstringquery -

    One of created (when the repository was starred) or updated (when it was last pushed to).

    - -
    directionstringquery -

    One of asc (ascending) or desc (descending).

    - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/user/starred
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /user/starred')
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    [
    -  {
    -    "id": 1296269,
    -    "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
    -    "name": "Hello-World",
    -    "full_name": "octocat/Hello-World",
    -    "owner": {
    -      "login": "octocat",
    -      "id": 1,
    -      "node_id": "MDQ6VXNlcjE=",
    -      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -      "gravatar_id": "",
    -      "url": "https://api.github.com/users/octocat",
    -      "html_url": "https://github.com/octocat",
    -      "followers_url": "https://api.github.com/users/octocat/followers",
    -      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -      "organizations_url": "https://api.github.com/users/octocat/orgs",
    -      "repos_url": "https://api.github.com/users/octocat/repos",
    -      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -      "received_events_url": "https://api.github.com/users/octocat/received_events",
    -      "type": "User",
    -      "site_admin": false
    -    },
    -    "private": false,
    -    "html_url": "https://github.com/octocat/Hello-World",
    -    "description": "This your first repo!",
    -    "fork": false,
    -    "url": "https://api.github.com/repos/octocat/Hello-World",
    -    "archive_url": "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
    -    "assignees_url": "http://api.github.com/repos/octocat/Hello-World/assignees{/user}",
    -    "blobs_url": "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
    -    "branches_url": "http://api.github.com/repos/octocat/Hello-World/branches{/branch}",
    -    "collaborators_url": "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
    -    "comments_url": "http://api.github.com/repos/octocat/Hello-World/comments{/number}",
    -    "commits_url": "http://api.github.com/repos/octocat/Hello-World/commits{/sha}",
    -    "compare_url": "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
    -    "contents_url": "http://api.github.com/repos/octocat/Hello-World/contents/{+path}",
    -    "contributors_url": "http://api.github.com/repos/octocat/Hello-World/contributors",
    -    "deployments_url": "http://api.github.com/repos/octocat/Hello-World/deployments",
    -    "downloads_url": "http://api.github.com/repos/octocat/Hello-World/downloads",
    -    "events_url": "http://api.github.com/repos/octocat/Hello-World/events",
    -    "forks_url": "http://api.github.com/repos/octocat/Hello-World/forks",
    -    "git_commits_url": "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
    -    "git_refs_url": "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
    -    "git_tags_url": "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
    -    "git_url": "git:github.com/octocat/Hello-World.git",
    -    "issue_comment_url": "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
    -    "issue_events_url": "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
    -    "issues_url": "http://api.github.com/repos/octocat/Hello-World/issues{/number}",
    -    "keys_url": "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
    -    "labels_url": "http://api.github.com/repos/octocat/Hello-World/labels{/name}",
    -    "languages_url": "http://api.github.com/repos/octocat/Hello-World/languages",
    -    "merges_url": "http://api.github.com/repos/octocat/Hello-World/merges",
    -    "milestones_url": "http://api.github.com/repos/octocat/Hello-World/milestones{/number}",
    -    "notifications_url": "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
    -    "pulls_url": "http://api.github.com/repos/octocat/Hello-World/pulls{/number}",
    -    "releases_url": "http://api.github.com/repos/octocat/Hello-World/releases{/id}",
    -    "ssh_url": "git@github.com:octocat/Hello-World.git",
    -    "stargazers_url": "http://api.github.com/repos/octocat/Hello-World/stargazers",
    -    "statuses_url": "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
    -    "subscribers_url": "http://api.github.com/repos/octocat/Hello-World/subscribers",
    -    "subscription_url": "http://api.github.com/repos/octocat/Hello-World/subscription",
    -    "tags_url": "http://api.github.com/repos/octocat/Hello-World/tags",
    -    "teams_url": "http://api.github.com/repos/octocat/Hello-World/teams",
    -    "trees_url": "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
    -    "clone_url": "https://github.com/octocat/Hello-World.git",
    -    "mirror_url": "git:git.example.com/octocat/Hello-World",
    -    "hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks",
    -    "svn_url": "https://svn.github.com/octocat/Hello-World",
    -    "homepage": "https://github.com",
    -    "language": null,
    -    "forks_count": 9,
    -    "stargazers_count": 80,
    -    "watchers_count": 80,
    -    "size": 108,
    -    "default_branch": "master",
    -    "open_issues_count": 0,
    -    "is_template": true,
    -    "topics": [
    -      "octocat",
    -      "atom",
    -      "electron",
    -      "api"
    -    ],
    -    "has_issues": true,
    -    "has_projects": true,
    -    "has_wiki": true,
    -    "has_pages": false,
    -    "has_downloads": true,
    -    "archived": false,
    -    "disabled": false,
    -    "visibility": "public",
    -    "pushed_at": "2011-01-26T19:06:43Z",
    -    "created_at": "2011-01-26T19:01:12Z",
    -    "updated_at": "2011-01-26T19:14:43Z",
    -    "permissions": {
    -      "admin": false,
    -      "push": false,
    -      "pull": true
    -    },
    -    "allow_rebase_merge": true,
    -    "template_repository": null,
    -    "temp_clone_token": "ABTLWHOULUVAXGTRYU7OC2876QJ2O",
    -    "allow_squash_merge": true,
    -    "delete_branch_on_merge": true,
    -    "allow_merge_commit": true,
    -    "subscribers_count": 42,
    -    "network_count": 0
    -  }
    -]
    -
    - - - -
    -
    -
    -
    - -
    get /user/starred/{owner}/{repo}
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    ownerstringpath - - -
    repostringpath - - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/user/starred/octocat/hello-world
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /user/starred/{owner}/{repo}', {
    -  owner: 'octocat',
    -  repo: 'hello-world'
    -})
    -
    - - - - -

    Response if this repository is starred by you

    -
    Status: 204 No Content
    -
    - -

    Response if this repository is not starred by you

    -
    Status: 404 Not Found
    -
    - - - -
    -
    -
    -
    -
    -

    - Star a repository for the authenticated user -

    -

    Note that you'll need to set Content-Length to zero when calling out to this endpoint. For more information, see "HTTP verbs."

    -
    -
    put /user/starred/{owner}/{repo}
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    ownerstringpath - - -
    repostringpath - - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X PUT \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/user/starred/octocat/hello-world
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('PUT /user/starred/{owner}/{repo}', {
    -  owner: 'octocat',
    -  repo: 'hello-world'
    -})
    -
    - - - - -

    Default Response

    -
    Status: 204 No Content
    -
    - - - -
    -
    -
    -
    - -
    delete /user/starred/{owner}/{repo}
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    ownerstringpath - - -
    repostringpath - - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X DELETE \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/user/starred/octocat/hello-world
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('DELETE /user/starred/{owner}/{repo}', {
    -  owner: 'octocat',
    -  repo: 'hello-world'
    -})
    -
    - - - - -

    Default Response

    -
    Status: 204 No Content
    -
    - - - -
    -
    -
    -
    -
    -

    - List repositories starred by a user -

    -

    Lists repositories a user has starred.

    -

    You can also find out when stars were created by passing the following custom media type via the Accept header:

    -
    -
    get /users/{username}/starred
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    usernamestringpath - - -
    sortstringquery -

    One of created (when the repository was starred) or updated (when it was last pushed to).

    - -
    directionstringquery -

    One of asc (ascending) or desc (descending).

    - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/users/USERNAME/starred
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /users/{username}/starred', {
    -  username: 'username'
    -})
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    [
    -  {
    -    "id": 1296269,
    -    "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
    -    "name": "Hello-World",
    -    "full_name": "octocat/Hello-World",
    -    "owner": {
    -      "login": "octocat",
    -      "id": 1,
    -      "node_id": "MDQ6VXNlcjE=",
    -      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -      "gravatar_id": "",
    -      "url": "https://api.github.com/users/octocat",
    -      "html_url": "https://github.com/octocat",
    -      "followers_url": "https://api.github.com/users/octocat/followers",
    -      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -      "organizations_url": "https://api.github.com/users/octocat/orgs",
    -      "repos_url": "https://api.github.com/users/octocat/repos",
    -      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -      "received_events_url": "https://api.github.com/users/octocat/received_events",
    -      "type": "User",
    -      "site_admin": false
    -    },
    -    "private": false,
    -    "html_url": "https://github.com/octocat/Hello-World",
    -    "description": "This your first repo!",
    -    "fork": false,
    -    "url": "https://api.github.com/repos/octocat/Hello-World",
    -    "archive_url": "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
    -    "assignees_url": "http://api.github.com/repos/octocat/Hello-World/assignees{/user}",
    -    "blobs_url": "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
    -    "branches_url": "http://api.github.com/repos/octocat/Hello-World/branches{/branch}",
    -    "collaborators_url": "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
    -    "comments_url": "http://api.github.com/repos/octocat/Hello-World/comments{/number}",
    -    "commits_url": "http://api.github.com/repos/octocat/Hello-World/commits{/sha}",
    -    "compare_url": "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
    -    "contents_url": "http://api.github.com/repos/octocat/Hello-World/contents/{+path}",
    -    "contributors_url": "http://api.github.com/repos/octocat/Hello-World/contributors",
    -    "deployments_url": "http://api.github.com/repos/octocat/Hello-World/deployments",
    -    "downloads_url": "http://api.github.com/repos/octocat/Hello-World/downloads",
    -    "events_url": "http://api.github.com/repos/octocat/Hello-World/events",
    -    "forks_url": "http://api.github.com/repos/octocat/Hello-World/forks",
    -    "git_commits_url": "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
    -    "git_refs_url": "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
    -    "git_tags_url": "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
    -    "git_url": "git:github.com/octocat/Hello-World.git",
    -    "issue_comment_url": "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
    -    "issue_events_url": "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
    -    "issues_url": "http://api.github.com/repos/octocat/Hello-World/issues{/number}",
    -    "keys_url": "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
    -    "labels_url": "http://api.github.com/repos/octocat/Hello-World/labels{/name}",
    -    "languages_url": "http://api.github.com/repos/octocat/Hello-World/languages",
    -    "merges_url": "http://api.github.com/repos/octocat/Hello-World/merges",
    -    "milestones_url": "http://api.github.com/repos/octocat/Hello-World/milestones{/number}",
    -    "notifications_url": "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
    -    "pulls_url": "http://api.github.com/repos/octocat/Hello-World/pulls{/number}",
    -    "releases_url": "http://api.github.com/repos/octocat/Hello-World/releases{/id}",
    -    "ssh_url": "git@github.com:octocat/Hello-World.git",
    -    "stargazers_url": "http://api.github.com/repos/octocat/Hello-World/stargazers",
    -    "statuses_url": "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
    -    "subscribers_url": "http://api.github.com/repos/octocat/Hello-World/subscribers",
    -    "subscription_url": "http://api.github.com/repos/octocat/Hello-World/subscription",
    -    "tags_url": "http://api.github.com/repos/octocat/Hello-World/tags",
    -    "teams_url": "http://api.github.com/repos/octocat/Hello-World/teams",
    -    "trees_url": "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
    -    "clone_url": "https://github.com/octocat/Hello-World.git",
    -    "mirror_url": "git:git.example.com/octocat/Hello-World",
    -    "hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks",
    -    "svn_url": "https://svn.github.com/octocat/Hello-World",
    -    "homepage": "https://github.com",
    -    "language": null,
    -    "forks_count": 9,
    -    "stargazers_count": 80,
    -    "watchers_count": 80,
    -    "size": 108,
    -    "default_branch": "master",
    -    "open_issues_count": 0,
    -    "is_template": true,
    -    "topics": [
    -      "octocat",
    -      "atom",
    -      "electron",
    -      "api"
    -    ],
    -    "has_issues": true,
    -    "has_projects": true,
    -    "has_wiki": true,
    -    "has_pages": false,
    -    "has_downloads": true,
    -    "archived": false,
    -    "disabled": false,
    -    "visibility": "public",
    -    "pushed_at": "2011-01-26T19:06:43Z",
    -    "created_at": "2011-01-26T19:01:12Z",
    -    "updated_at": "2011-01-26T19:14:43Z",
    -    "permissions": {
    -      "admin": false,
    -      "push": false,
    -      "pull": true
    -    },
    -    "allow_rebase_merge": true,
    -    "template_repository": null,
    -    "temp_clone_token": "ABTLWHOULUVAXGTRYU7OC2876QJ2O",
    -    "allow_squash_merge": true,
    -    "delete_branch_on_merge": true,
    -    "allow_merge_commit": true,
    -    "subscribers_count": 42,
    -    "network_count": 0
    -  }
    -]
    -
    - - -

    Notes

    - - - -
    -
    -
    -

    Watching

    -

    Watching a repository registers the user to receive notifications on new discussions, as well as events in the user's activity feed. For simple repository bookmarks, see "Repository starring."

    -
    -
    -

    - List watchers -

    -

    Lists the people watching the specified repository.

    -
    -
    get /repos/{owner}/{repo}/subscribers
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    ownerstringpath - - -
    repostringpath - - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/repos/octocat/hello-world/subscribers
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /repos/{owner}/{repo}/subscribers', {
    -  owner: 'octocat',
    -  repo: 'hello-world'
    -})
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    [
    -  {
    -    "login": "octocat",
    -    "id": 1,
    -    "node_id": "MDQ6VXNlcjE=",
    -    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -    "gravatar_id": "",
    -    "url": "https://api.github.com/users/octocat",
    -    "html_url": "https://github.com/octocat",
    -    "followers_url": "https://api.github.com/users/octocat/followers",
    -    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -    "organizations_url": "https://api.github.com/users/octocat/orgs",
    -    "repos_url": "https://api.github.com/users/octocat/repos",
    -    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -    "received_events_url": "https://api.github.com/users/octocat/received_events",
    -    "type": "User",
    -    "site_admin": false
    -  }
    -]
    -
    - - -

    Notes

    - - - -
    -
    -
    -
    - -
    get /repos/{owner}/{repo}/subscription
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    ownerstringpath - - -
    repostringpath - - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/repos/octocat/hello-world/subscription
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /repos/{owner}/{repo}/subscription', {
    -  owner: 'octocat',
    -  repo: 'hello-world'
    -})
    -
    - - - - -

    Response if you subscribe to the repository

    -
    Status: 200 OK
    -
    {
    -  "subscribed": true,
    -  "ignored": false,
    -  "reason": null,
    -  "created_at": "2012-10-06T21:34:12Z",
    -  "url": "https://api.github.com/repos/octocat/example/subscription",
    -  "repository_url": "https://api.github.com/repos/octocat/example"
    -}
    -
    - -

    Response if you don t subscribe to the repository

    -
    Status: 404 Not Found
    -
    - - - -
    -
    -
    -
    -
    -

    - Set a repository subscription -

    -

    If you would like to watch a repository, set subscribed to true. If you would like to ignore notifications made within a repository, set ignored to true. If you would like to stop watching a repository, delete the repository's subscription completely.

    -
    -
    put /repos/{owner}/{repo}/subscription
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    ownerstringpath - - -
    repostringpath - - -
    subscribedbooleanbody -

    Determines if notifications should be received from this repository.

    - -
    ignoredbooleanbody -

    Determines if all notifications should be blocked from this repository.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X PUT \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/repos/octocat/hello-world/subscription \
    -  -d '{"subscribed":true}'
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('PUT /repos/{owner}/{repo}/subscription', {
    -  owner: 'octocat',
    -  repo: 'hello-world',
    -  subscribed: true
    -})
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    {
    -  "subscribed": true,
    -  "ignored": false,
    -  "reason": null,
    -  "created_at": "2012-10-06T21:34:12Z",
    -  "url": "https://api.github.com/repos/octocat/example/subscription",
    -  "repository_url": "https://api.github.com/repos/octocat/example"
    -}
    -
    - - - -
    -
    -
    -
    -
    -

    - Delete a repository subscription -

    -

    This endpoint should only be used to stop watching a repository. To control whether or not you wish to receive notifications from a repository, set the repository's subscription manually.

    -
    -
    delete /repos/{owner}/{repo}/subscription
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    ownerstringpath - - -
    repostringpath - - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X DELETE \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/repos/octocat/hello-world/subscription
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('DELETE /repos/{owner}/{repo}/subscription', {
    -  owner: 'octocat',
    -  repo: 'hello-world'
    -})
    -
    - - - - -

    Default Response

    -
    Status: 204 No Content
    -
    - - - -
    -
    -
    -
    -
    -

    - List repositories watched by the authenticated user -

    -

    Lists repositories the authenticated user is watching.

    -
    -
    get /user/subscriptions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/user/subscriptions
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /user/subscriptions')
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    [
    -  {
    -    "id": 1296269,
    -    "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
    -    "name": "Hello-World",
    -    "full_name": "octocat/Hello-World",
    -    "owner": {
    -      "login": "octocat",
    -      "id": 1,
    -      "node_id": "MDQ6VXNlcjE=",
    -      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -      "gravatar_id": "",
    -      "url": "https://api.github.com/users/octocat",
    -      "html_url": "https://github.com/octocat",
    -      "followers_url": "https://api.github.com/users/octocat/followers",
    -      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -      "organizations_url": "https://api.github.com/users/octocat/orgs",
    -      "repos_url": "https://api.github.com/users/octocat/repos",
    -      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -      "received_events_url": "https://api.github.com/users/octocat/received_events",
    -      "type": "User",
    -      "site_admin": false
    -    },
    -    "private": false,
    -    "html_url": "https://github.com/octocat/Hello-World",
    -    "description": "This your first repo!",
    -    "fork": false,
    -    "url": "https://api.github.com/repos/octocat/Hello-World",
    -    "archive_url": "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
    -    "assignees_url": "http://api.github.com/repos/octocat/Hello-World/assignees{/user}",
    -    "blobs_url": "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
    -    "branches_url": "http://api.github.com/repos/octocat/Hello-World/branches{/branch}",
    -    "collaborators_url": "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
    -    "comments_url": "http://api.github.com/repos/octocat/Hello-World/comments{/number}",
    -    "commits_url": "http://api.github.com/repos/octocat/Hello-World/commits{/sha}",
    -    "compare_url": "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
    -    "contents_url": "http://api.github.com/repos/octocat/Hello-World/contents/{+path}",
    -    "contributors_url": "http://api.github.com/repos/octocat/Hello-World/contributors",
    -    "deployments_url": "http://api.github.com/repos/octocat/Hello-World/deployments",
    -    "downloads_url": "http://api.github.com/repos/octocat/Hello-World/downloads",
    -    "events_url": "http://api.github.com/repos/octocat/Hello-World/events",
    -    "forks_url": "http://api.github.com/repos/octocat/Hello-World/forks",
    -    "git_commits_url": "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
    -    "git_refs_url": "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
    -    "git_tags_url": "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
    -    "git_url": "git:github.com/octocat/Hello-World.git",
    -    "issue_comment_url": "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
    -    "issue_events_url": "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
    -    "issues_url": "http://api.github.com/repos/octocat/Hello-World/issues{/number}",
    -    "keys_url": "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
    -    "labels_url": "http://api.github.com/repos/octocat/Hello-World/labels{/name}",
    -    "languages_url": "http://api.github.com/repos/octocat/Hello-World/languages",
    -    "merges_url": "http://api.github.com/repos/octocat/Hello-World/merges",
    -    "milestones_url": "http://api.github.com/repos/octocat/Hello-World/milestones{/number}",
    -    "notifications_url": "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
    -    "pulls_url": "http://api.github.com/repos/octocat/Hello-World/pulls{/number}",
    -    "releases_url": "http://api.github.com/repos/octocat/Hello-World/releases{/id}",
    -    "ssh_url": "git@github.com:octocat/Hello-World.git",
    -    "stargazers_url": "http://api.github.com/repos/octocat/Hello-World/stargazers",
    -    "statuses_url": "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
    -    "subscribers_url": "http://api.github.com/repos/octocat/Hello-World/subscribers",
    -    "subscription_url": "http://api.github.com/repos/octocat/Hello-World/subscription",
    -    "tags_url": "http://api.github.com/repos/octocat/Hello-World/tags",
    -    "teams_url": "http://api.github.com/repos/octocat/Hello-World/teams",
    -    "trees_url": "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
    -    "clone_url": "https://github.com/octocat/Hello-World.git",
    -    "mirror_url": "git:git.example.com/octocat/Hello-World",
    -    "hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks",
    -    "svn_url": "https://svn.github.com/octocat/Hello-World",
    -    "homepage": "https://github.com",
    -    "language": null,
    -    "forks_count": 9,
    -    "stargazers_count": 80,
    -    "watchers_count": 80,
    -    "size": 108,
    -    "default_branch": "master",
    -    "open_issues_count": 0,
    -    "is_template": true,
    -    "topics": [
    -      "octocat",
    -      "atom",
    -      "electron",
    -      "api"
    -    ],
    -    "has_issues": true,
    -    "has_projects": true,
    -    "has_wiki": true,
    -    "has_pages": false,
    -    "has_downloads": true,
    -    "archived": false,
    -    "disabled": false,
    -    "visibility": "public",
    -    "pushed_at": "2011-01-26T19:06:43Z",
    -    "created_at": "2011-01-26T19:01:12Z",
    -    "updated_at": "2011-01-26T19:14:43Z",
    -    "permissions": {
    -      "admin": false,
    -      "push": false,
    -      "pull": true
    -    },
    -    "template_repository": null,
    -    "temp_clone_token": "ABTLWHOULUVAXGTRYU7OC2876QJ2O",
    -    "delete_branch_on_merge": true,
    -    "subscribers_count": 42,
    -    "network_count": 0,
    -    "license": {
    -      "key": "mit",
    -      "name": "MIT License",
    -      "spdx_id": "MIT",
    -      "url": "https://api.github.com/licenses/mit",
    -      "node_id": "MDc6TGljZW5zZW1pdA=="
    -    }
    -  }
    -]
    -
    - - - -
    -
    -
    -
    -
    -

    - List repositories watched by a user -

    -

    Lists repositories a user is watching.

    -
    -
    get /users/{username}/subscriptions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    usernamestringpath - - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/users/USERNAME/subscriptions
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /users/{username}/subscriptions', {
    -  username: 'username'
    -})
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    [
    -  {
    -    "id": 1296269,
    -    "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
    -    "name": "Hello-World",
    -    "full_name": "octocat/Hello-World",
    -    "owner": {
    -      "login": "octocat",
    -      "id": 1,
    -      "node_id": "MDQ6VXNlcjE=",
    -      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -      "gravatar_id": "",
    -      "url": "https://api.github.com/users/octocat",
    -      "html_url": "https://github.com/octocat",
    -      "followers_url": "https://api.github.com/users/octocat/followers",
    -      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -      "organizations_url": "https://api.github.com/users/octocat/orgs",
    -      "repos_url": "https://api.github.com/users/octocat/repos",
    -      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -      "received_events_url": "https://api.github.com/users/octocat/received_events",
    -      "type": "User",
    -      "site_admin": false
    -    },
    -    "private": false,
    -    "html_url": "https://github.com/octocat/Hello-World",
    -    "description": "This your first repo!",
    -    "fork": false,
    -    "url": "https://api.github.com/repos/octocat/Hello-World",
    -    "archive_url": "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
    -    "assignees_url": "http://api.github.com/repos/octocat/Hello-World/assignees{/user}",
    -    "blobs_url": "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
    -    "branches_url": "http://api.github.com/repos/octocat/Hello-World/branches{/branch}",
    -    "collaborators_url": "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
    -    "comments_url": "http://api.github.com/repos/octocat/Hello-World/comments{/number}",
    -    "commits_url": "http://api.github.com/repos/octocat/Hello-World/commits{/sha}",
    -    "compare_url": "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
    -    "contents_url": "http://api.github.com/repos/octocat/Hello-World/contents/{+path}",
    -    "contributors_url": "http://api.github.com/repos/octocat/Hello-World/contributors",
    -    "deployments_url": "http://api.github.com/repos/octocat/Hello-World/deployments",
    -    "downloads_url": "http://api.github.com/repos/octocat/Hello-World/downloads",
    -    "events_url": "http://api.github.com/repos/octocat/Hello-World/events",
    -    "forks_url": "http://api.github.com/repos/octocat/Hello-World/forks",
    -    "git_commits_url": "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
    -    "git_refs_url": "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
    -    "git_tags_url": "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
    -    "git_url": "git:github.com/octocat/Hello-World.git",
    -    "issue_comment_url": "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
    -    "issue_events_url": "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
    -    "issues_url": "http://api.github.com/repos/octocat/Hello-World/issues{/number}",
    -    "keys_url": "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
    -    "labels_url": "http://api.github.com/repos/octocat/Hello-World/labels{/name}",
    -    "languages_url": "http://api.github.com/repos/octocat/Hello-World/languages",
    -    "merges_url": "http://api.github.com/repos/octocat/Hello-World/merges",
    -    "milestones_url": "http://api.github.com/repos/octocat/Hello-World/milestones{/number}",
    -    "notifications_url": "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
    -    "pulls_url": "http://api.github.com/repos/octocat/Hello-World/pulls{/number}",
    -    "releases_url": "http://api.github.com/repos/octocat/Hello-World/releases{/id}",
    -    "ssh_url": "git@github.com:octocat/Hello-World.git",
    -    "stargazers_url": "http://api.github.com/repos/octocat/Hello-World/stargazers",
    -    "statuses_url": "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
    -    "subscribers_url": "http://api.github.com/repos/octocat/Hello-World/subscribers",
    -    "subscription_url": "http://api.github.com/repos/octocat/Hello-World/subscription",
    -    "tags_url": "http://api.github.com/repos/octocat/Hello-World/tags",
    -    "teams_url": "http://api.github.com/repos/octocat/Hello-World/teams",
    -    "trees_url": "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
    -    "clone_url": "https://github.com/octocat/Hello-World.git",
    -    "mirror_url": "git:git.example.com/octocat/Hello-World",
    -    "hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks",
    -    "svn_url": "https://svn.github.com/octocat/Hello-World",
    -    "homepage": "https://github.com",
    -    "language": null,
    -    "forks_count": 9,
    -    "stargazers_count": 80,
    -    "watchers_count": 80,
    -    "size": 108,
    -    "default_branch": "master",
    -    "open_issues_count": 0,
    -    "is_template": true,
    -    "topics": [
    -      "octocat",
    -      "atom",
    -      "electron",
    -      "api"
    -    ],
    -    "has_issues": true,
    -    "has_projects": true,
    -    "has_wiki": true,
    -    "has_pages": false,
    -    "has_downloads": true,
    -    "archived": false,
    -    "disabled": false,
    -    "visibility": "public",
    -    "pushed_at": "2011-01-26T19:06:43Z",
    -    "created_at": "2011-01-26T19:01:12Z",
    -    "updated_at": "2011-01-26T19:14:43Z",
    -    "permissions": {
    -      "admin": false,
    -      "push": false,
    -      "pull": true
    -    },
    -    "template_repository": null,
    -    "temp_clone_token": "ABTLWHOULUVAXGTRYU7OC2876QJ2O",
    -    "delete_branch_on_merge": true,
    -    "subscribers_count": 42,
    -    "network_count": 0,
    -    "license": {
    -      "key": "mit",
    -      "name": "MIT License",
    -      "spdx_id": "MIT",
    -      "url": "https://api.github.com/licenses/mit",
    -      "node_id": "MDc6TGljZW5zZW1pdA=="
    -    }
    -  }
    -]
    -
    - - -

    Notes

    - - - -
    -
    -
    -
    -
    -
    -
    - -
    -

    - Did this doc help you? -

    -

    - - - - -

    - - - - - -

    - - -

    - - -
    - -
    -
    - - - -
    -
    -
    -
    -

    Ask a human

    -

    Can't find what you're looking for?

    - Contact us -
    -
    - -
    -
    -
    -
    - - - - - -
    - - -` - -var activityEventsGoFileOriginal = `// Copyright 2013 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" -) - -// ListEvents drinks from the firehose of all public events across GitHub. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/events/#list-public-events -func (s *ActivityService) ListEvents(ctx context.Context, opts *ListOptions) ([]*Event, *Response, error) { - u, err := addOptions("events", opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// ListRepositoryEvents lists events for a repository. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/events/#list-repository-events -func (s *ActivityService) ListRepositoryEvents(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Event, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/events", owner, repo) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// Note that ActivityService.ListIssueEventsForRepository was moved to: -// IssuesService.ListRepositoryEvents. - -// ListEventsForRepoNetwork lists public events for a network of repositories. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/events/#list-public-events-for-a-network-of-repositories -func (s *ActivityService) ListEventsForRepoNetwork(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Event, *Response, error) { - u := fmt.Sprintf("networks/%v/%v/events", owner, repo) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// ListEventsForOrganization lists public events for an organization. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/events/#list-public-events-for-an-organization -func (s *ActivityService) ListEventsForOrganization(ctx context.Context, org string, opts *ListOptions) ([]*Event, *Response, error) { - u := fmt.Sprintf("orgs/%v/events", org) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// ListEventsPerformedByUser lists the events performed by a user. If publicOnly is -// true, only public events will be returned. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/events/#list-events-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/events/#list-public-events-for-a-user -func (s *ActivityService) ListEventsPerformedByUser(ctx context.Context, user string, publicOnly bool, opts *ListOptions) ([]*Event, *Response, error) { - var u string - if publicOnly { - u = fmt.Sprintf("users/%v/events/public", user) - } else { - u = fmt.Sprintf("users/%v/events", user) - } - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// ListEventsReceivedByUser lists the events received by a user. If publicOnly is -// true, only public events will be returned. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/events/#list-events-received-by-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/events/#list-public-events-received-by-a-user -func (s *ActivityService) ListEventsReceivedByUser(ctx context.Context, user string, publicOnly bool, opts *ListOptions) ([]*Event, *Response, error) { - var u string - if publicOnly { - u = fmt.Sprintf("users/%v/received_events/public", user) - } else { - u = fmt.Sprintf("users/%v/received_events", user) - } - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// ListUserEventsForOrganization provides the user’s organization dashboard. You -// must be authenticated as the user to view this. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/events/#list-events-for-an-organization -func (s *ActivityService) ListUserEventsForOrganization(ctx context.Context, org, user string, opts *ListOptions) ([]*Event, *Response, error) { - u := fmt.Sprintf("users/%v/events/orgs/%v", user, org) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} -` - -var activityEventsGoFileWant = `// Copyright 2013 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 +//go:embed testdata/activity-events.html +var activityEventsTestWebPage string -import ( - "context" - "fmt" -) +//go:embed testdata/activity_events-original.go +var activityEventsGoFileOriginal string -// ListEvents drinks from the firehose of all public events across GitHub. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/events/#list-public-events -func (s *ActivityService) ListEvents(ctx context.Context, opts *ListOptions) ([]*Event, *Response, error) { - u, err := addOptions("events", opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// ListRepositoryEvents lists events for a repository. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/events/#list-repository-events -func (s *ActivityService) ListRepositoryEvents(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Event, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/events", owner, repo) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// Note that ActivityService.ListIssueEventsForRepository was moved to: -// IssuesService.ListRepositoryEvents. - -// ListEventsForRepoNetwork lists public events for a network of repositories. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/events/#list-public-events-for-a-network-of-repositories -func (s *ActivityService) ListEventsForRepoNetwork(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Event, *Response, error) { - u := fmt.Sprintf("networks/%v/%v/events", owner, repo) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// ListEventsForOrganization lists public events for an organization. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/events/#list-public-organization-events -func (s *ActivityService) ListEventsForOrganization(ctx context.Context, org string, opts *ListOptions) ([]*Event, *Response, error) { - u := fmt.Sprintf("orgs/%v/events", org) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// ListEventsPerformedByUser lists the events performed by a user. If publicOnly is -// true, only public events will be returned. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/events/#list-events-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/events/#list-public-events-for-a-user -func (s *ActivityService) ListEventsPerformedByUser(ctx context.Context, user string, publicOnly bool, opts *ListOptions) ([]*Event, *Response, error) { - var u string - if publicOnly { - u = fmt.Sprintf("users/%v/events/public", user) - } else { - u = fmt.Sprintf("users/%v/events", user) - } - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// ListEventsReceivedByUser lists the events received by a user. If publicOnly is -// true, only public events will be returned. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/events/#list-events-received-by-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/events/#list-public-events-received-by-a-user -func (s *ActivityService) ListEventsReceivedByUser(ctx context.Context, user string, publicOnly bool, opts *ListOptions) ([]*Event, *Response, error) { - var u string - if publicOnly { - u = fmt.Sprintf("users/%v/received_events/public", user) - } else { - u = fmt.Sprintf("users/%v/received_events", user) - } - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// ListUserEventsForOrganization provides the user’s organization dashboard. You -// must be authenticated as the user to view this. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/events/#list-organization-events-for-the-authenticated-user -func (s *ActivityService) ListUserEventsForOrganization(ctx context.Context, org, user string, opts *ListOptions) ([]*Event, *Response, error) { - u := fmt.Sprintf("users/%v/events/orgs/%v", user, org) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} -` +//go:embed testdata/activity_events-want.go +var activityEventsGoFileWant string diff --git a/update-urls/main.go b/update-urls/main.go index 0e3f1eb0798..41533ca4695 100644 --- a/update-urls/main.go +++ b/update-urls/main.go @@ -33,12 +33,14 @@ import ( "regexp" "sort" "strings" + "time" + + "github.com/google/go-cmp/cmp" ) const ( codeLegacySplitString = `` codeSplitString = `await octokit.request('` - fragmentIDString = `

    ]*id="`) + stripHTMLRE = regexp.MustCompile(`<\/?[^>]+\/?>`) + condenseWhitespaceRE = regexp.MustCompile(`\s+`) + // skipMethods holds methods which are skipped because they do not have GitHub v3 // API URLs or are otherwise problematic in parsing, discovering, and/or fixing. skipMethods = map[string]bool{ @@ -65,6 +73,7 @@ var ( "AdminService.RenameOrgByName": true, "AdminService.UpdateTeamLDAPMapping": true, "AdminService.UpdateUserLDAPMapping": true, + "AppsService.CreateAttachment": true, "AppsService.FindRepositoryInstallationByID": true, "AuthorizationsService.CreateImpersonation": true, "AuthorizationsService.DeleteImpersonation": true, @@ -72,7 +81,10 @@ var ( "IssueImportService.CheckStatusSince": true, "IssueImportService.Create": true, "MarketplaceService.marketplaceURI": true, + "MigrationService.UserMigrationArchiveURL": true, "OrganizationsService.GetByID": true, + "RepositoriesService.CompareCommits": true, + "RepositoriesService.CompareCommitsRaw": true, "RepositoriesService.DeletePreReceiveHook": true, "RepositoriesService.DownloadContents": true, "RepositoriesService.DownloadContentsWithMeta": true, @@ -148,7 +160,7 @@ func main() { // Step 3 - resolve all missing httpMethods from helperMethods. // Additionally, use existing URLs as hints to pre-cache all apiDocs. - docCache := &documentCache{} + docCache := &documentCache{positioner: iter} usedHelpers, endpointsByFilename := resolveHelpersAndCacheDocs(endpoints, docCache) // Step 4 - validate and rewrite all URLs, skipping used helper methods. @@ -496,6 +508,7 @@ func findAllServiceEndpoints(iter astFileIterator, services servicesMap) (endpoi } func resolveHelpersAndCacheDocs(endpoints endpointsMap, docCache documentCacheWriter) (usedHelpers usedHelpersMap, endpointsByFilename endpointsByFilenameMap) { + logf("Step 3 - resolving helpers and cache docs ...") usedHelpers = usedHelpersMap{} endpointsByFilename = endpointsByFilenameMap{} for k, v := range endpoints { @@ -505,10 +518,10 @@ func resolveHelpersAndCacheDocs(endpoints endpointsMap, docCache documentCacheWr endpointsByFilename[v.filename] = append(endpointsByFilename[v.filename], v) for _, cmt := range v.enterpriseRefLines { - docCache.CacheDocFromInternet(cmt.Text, v.filename) + docCache.CacheDocFromInternet(cmt.Text, v.filename, docCache.Position(cmt.Pos())) } for _, cmt := range v.stdRefLines { - docCache.CacheDocFromInternet(cmt.Text, v.filename) + docCache.CacheDocFromInternet(cmt.Text, v.filename, docCache.Position(cmt.Pos())) } if v.httpMethod == "" && v.helperMethod != "" { @@ -533,13 +546,19 @@ type documentCacheReader interface { } type documentCacheWriter interface { - CacheDocFromInternet(urlWithFragmentID, filename string) + CacheDocFromInternet(urlWithFragmentID, filename string, pos token.Position) + Position(token.Pos) token.Position +} + +type positioner interface { + Position(token.Pos) token.Position } // documentCache implements documentCacheReader and documentCachWriter. type documentCache struct { apiDocs map[string]map[string][]*Endpoint // cached by URL, then mapped by web fragment identifier. urlByMethodAndPath map[string]string + positioner positioner } func (dc *documentCache) URLByMethodAndPath(methodAndPath string) (string, bool) { @@ -547,32 +566,42 @@ func (dc *documentCache) URLByMethodAndPath(methodAndPath string) (string, bool) return url, ok } -func (dc *documentCache) CacheDocFromInternet(urlWithID, filename string) { +func (dc *documentCache) CacheDocFromInternet(urlWithID, filename string, pos token.Position) { if dc.apiDocs == nil { dc.apiDocs = map[string]map[string][]*Endpoint{} // cached by URL, then mapped by web fragment identifier. dc.urlByMethodAndPath = map[string]string{} } - url := getURL(urlWithID) - if _, ok := dc.apiDocs[url]; ok { + baseURL, fullURL := getURL(urlWithID) + if _, ok := dc.apiDocs[baseURL]; ok { return // already cached } - logf("GET %q ...", url) - resp, err := http.Get(url) - check("Unable to get URL: %v: %v", url, err) - if resp.StatusCode != http.StatusOK { - log.Fatalf("filename: %v - url %v - StatusCode=%v", filename, url, resp.StatusCode) + logf("GET %q ...", fullURL) + time.Sleep(httpGetDelay) + resp, err := http.Get(fullURL) + check("Unable to get URL: %v: %v", fullURL, err) + switch resp.StatusCode { + case http.StatusTooManyRequests, http.StatusServiceUnavailable: + logf("Sleeping 60 seconds and trying again...") + time.Sleep(60 * time.Second) + resp, err = http.Get(fullURL) + check("Unable to get URL: %v: %v", fullURL, err) + case http.StatusOK: + default: + log.Fatalf("url %v - StatusCode=%v\ngithub/%v:%v:%v %v", fullURL, resp.StatusCode, filename, pos.Line, pos.Column, urlWithID) } finalURL := resp.Request.URL.String() - url = getURL(finalURL) - logf("The final URL is: %v; url=%v\n", finalURL, url) + baseURL, fullURL = getURL(finalURL) + url := baseURL + logf("urlWithID: %v ; finalURL: %v ; baseURL: %v, fullURL: %v", urlWithID, finalURL, baseURL, fullURL) b, err := ioutil.ReadAll(resp.Body) check("Unable to read body of URL: %v, %v", url, err) check("Unable to close body of URL: %v, %v", url, resp.Body.Close()) - dc.apiDocs[url] = parseWebPageEndpoints(string(b)) + dc.apiDocs[url], err = parseWebPageEndpoints(string(b)) + check("Unable to parse web page endpoints: url: %v, filename: %v, err: %v", url, filename, err) logf("Found %v web page fragment identifiers.", len(dc.apiDocs[url])) if len(dc.apiDocs[url]) == 0 { logf("webage text: %s", b) @@ -585,13 +614,17 @@ func (dc *documentCache) CacheDocFromInternet(urlWithID, filename string) { logf("For fragID=%q, endpoint=%q, found %v paths.", fragID, endpoint, len(endpoint.urlFormats)) for _, path := range endpoint.urlFormats { methodAndPath := fmt.Sprintf("%v %v", endpoint.httpMethod, path) - dc.urlByMethodAndPath[methodAndPath] = fmt.Sprintf("%v#%v", url, fragID) + dc.urlByMethodAndPath[methodAndPath] = fmt.Sprintf("%v#%v", strings.TrimRight(url, "/"), fragID) logf("urlByMethodAndPath[%q] = %q", methodAndPath, dc.urlByMethodAndPath[methodAndPath]) } } } } +func (dc *documentCache) Position(pos token.Pos) token.Position { + return dc.positioner.Position(pos) +} + // FileEdit represents an edit that needs to be performed on a file. type FileEdit struct { pos token.Position @@ -599,21 +632,26 @@ type FileEdit struct { toText string } -func getURL(s string) string { +func getURL(s string) (baseURL, fullURL string) { i := strings.Index(s, "http") if i < 0 { - return "" + return "", "" } j := strings.Index(s, "#") if j < i { - s = s[i:] + if !strings.HasSuffix(s, "/") { // Prevent unnecessary redirects if possible. + s += "/" + } + baseURL = s[i:] + fullURL = s[i:] } else { - s = s[i:j] - } - if !strings.HasSuffix(s, "/") { // Prevent unnecessary redirects if possible. - s += "/" + fullURL = s[i:] + baseURL = s[i:j] + if !strings.HasSuffix(baseURL, "/") { // Prevent unnecessary redirects if possible. + baseURL += "/" + } } - return s + return baseURL, fullURL } // Service represents a go-github service. @@ -637,10 +675,19 @@ type Endpoint struct { // String helps with debugging by providing an easy-to-read summary of the endpoint. func (e *Endpoint) String() string { + if e == nil { + return "Endpoint{nil}" + } var b strings.Builder - b.WriteString(fmt.Sprintf(" filename: %v\n", e.filename)) - b.WriteString(fmt.Sprintf(" serviceName: %v\n", e.serviceName)) - b.WriteString(fmt.Sprintf(" endpointName: %v\n", e.endpointName)) + if e.filename != "" { + b.WriteString(fmt.Sprintf(" filename: %v\n", e.filename)) + } + if e.serviceName != "" { + b.WriteString(fmt.Sprintf(" serviceName: %v\n", e.serviceName)) + } + if e.endpointName != "" { + b.WriteString(fmt.Sprintf(" endpointName: %v\n", e.endpointName)) + } b.WriteString(fmt.Sprintf(" httpMethod: %v\n", e.httpMethod)) if e.helperMethod != "" { b.WriteString(fmt.Sprintf(" helperMethod: %v\n", e.helperMethod)) @@ -751,7 +798,7 @@ func processAST(filename string, f *ast.File, services servicesMap, endpoints en endpoints[fullName] = ep logf("endpoints[%q] = %#v", fullName, endpoints[fullName]) if ep.httpMethod == "" && (ep.helperMethod == "" || len(ep.urlFormats) == 0) { - return fmt.Errorf("could not find body info: %#v", *ep) + return fmt.Errorf("filename=%q, endpoint=%q: could not find body info: %#v", filename, fullName, *ep) } case *ast.GenDecl: default: @@ -825,9 +872,9 @@ func (b *bodyData) parseBody(body *ast.BlockStmt) error { case *ast.ReturnStmt: // Return Results logf("*ast.ReturnStmt: %#v", *stmt) if len(stmt.Results) > 0 { - ce, ok := stmt.Results[0].(*ast.CallExpr) - if ok { - recv, funcName, args := processCallExpr(ce) + switch rslt0 := stmt.Results[0].(type) { + case *ast.CallExpr: + recv, funcName, args := processCallExpr(rslt0) logf("return CallExpr: recv=%q, funcName=%q, args=%#v", recv, funcName, args) // If the httpMethod has not been found at this point, but // this method is calling a helper function, then see if @@ -840,18 +887,32 @@ func (b *bodyData) parseBody(body *ast.BlockStmt) error { if len(b.assignments) == 0 && len(b.urlFormats) == 0 { b.urlFormats = append(b.urlFormats, strings.Trim(args[1], `"`)) b.helperMethod = funcName - logf("found urlFormat: %v and helper method: %v", b.urlFormats[0], b.helperMethod) + switch b.helperMethod { + case "deleteReaction": + b.httpMethod = "DELETE" + default: + logf("WARNING: helper method %q not found", b.helperMethod) + } + logf("found urlFormat: %v and helper method: %v, httpMethod: %v", b.urlFormats[0], b.helperMethod, b.httpMethod) } else { for _, lr := range b.assignments { if lr.lhs == args[1] { // Multiple matches are possible. Loop over all assignments. b.urlVarName = args[1] b.urlFormats = append(b.urlFormats, lr.rhs) b.helperMethod = funcName - logf("found urlFormat: %v and helper method: %v", lr.rhs, b.helperMethod) + switch b.helperMethod { + case "deleteReaction": + b.httpMethod = "DELETE" + default: + logf("WARNING: helper method %q not found", b.helperMethod) + } + logf("found urlFormat: %v and helper method: %v, httpMethod: %v", lr.rhs, b.helperMethod, b.httpMethod) } } } } + default: + logf("WARNING: stmt.Results[0] unhandled type = %T = %#v", stmt.Results[0], stmt.Results[0]) } } case *ast.SwitchStmt: @@ -866,18 +927,18 @@ func (b *bodyData) parseBody(body *ast.BlockStmt) error { } func (b *bodyData) parseIf(stmt *ast.IfStmt) error { - logf("*ast.IfStmt: %#v", *stmt) + logf("parseIf: *ast.IfStmt: %#v", *stmt) if err := b.parseBody(stmt.Body); err != nil { return err } - logf("if body: b=%#v", *b) + logf("parseIf: if body: b=%#v", *b) if stmt.Else != nil { switch els := stmt.Else.(type) { case *ast.BlockStmt: if err := b.parseBody(els); err != nil { return err } - logf("if else: b=%#v", *b) + logf("parseIf: if else: b=%#v", *b) case *ast.IfStmt: if err := b.parseIf(els); err != nil { return err @@ -940,6 +1001,11 @@ func processAssignStmt(receiverName string, stmt *ast.AssignStmt) (httpMethod, u case "NewUploadRequest": httpMethod = "POST" urlVarName = args[0] + case "roundTripWithOptionalFollowRedirect": + httpMethod = "GET" + urlVarName = args[1] + default: + logf("WARNING: processAssignStmt: unhandled CallExpr: recv=%q, funcName=%q, args=%#v", recv, funcName, args) } if recv == receiverName && len(args) > 1 && args[0] == "ctx" { // This might be a helper method. fullName := fmt.Sprintf("%v.%v", recv, funcName) @@ -1116,9 +1182,19 @@ func check(fmtStr string, args ...interface{}) { } } +func endpointsEqual(a, b *Endpoint) bool { + if a == nil || b == nil { + return false + } + if a.httpMethod != b.httpMethod { + return false + } + return cmp.Equal(a.urlFormats, b.urlFormats) +} + // parseWebPageEndpoints returns endpoint information, mapped by // web page fragment identifier. -func parseWebPageEndpoints(buf string) map[string][]*Endpoint { +func parseWebPageEndpoints(buf string) (map[string][]*Endpoint, error) { result := map[string][]*Endpoint{} // The GitHub v3 API web pages do not appear to be auto-generated @@ -1134,28 +1210,61 @@ func parseWebPageEndpoints(buf string) map[string][]*Endpoint { parts := splitHTML(buf) var lastFragmentID string - for _, part := range parts { + + addDedup := func(endpoint *Endpoint) { + for _, v := range result[lastFragmentID] { + if endpointsEqual(v, endpoint) { + return + } + } + result[lastFragmentID] = append(result[lastFragmentID], endpoint) + } + + for i, part := range parts { + noHTML := stripHTML(part) + + m := fragmentIDStringRE.FindAllStringSubmatch(part, -1) + if len(m) > 0 { + fragmentIDString := m[len(m)-1][0] + if i := strings.LastIndex(part, fragmentIDString); i >= 0 { + b := part[i+len(fragmentIDString):] + i = strings.Index(b, `"`) + if i >= 0 { + lastFragmentID = b[:i] + if j := strings.Index(lastFragmentID, "--"); j > 0 { + lastFragmentID = lastFragmentID[:j] // chop off trailing "--code-samples" for example. + } + logf("Found lastFragmentID: %v", lastFragmentID) + } + } + } + for _, method := range httpMethods { if strings.HasPrefix(part, method) { - endpoint := parseEndpoint(part, method) if lastFragmentID == "" { - log.Fatalf("parseWebPageEndpoints: empty lastFragmentID") + logf("WARNING: ignoring empty lastFragmentID: part #%v: noHTML=\n%v", i+1, noHTML) + continue } - result[lastFragmentID] = append(result[lastFragmentID], endpoint) + endpoint := parseEndpoint(part, method) + addDedup(endpoint) + continue } - } - if i := strings.LastIndex(part, fragmentIDString); i >= 0 { - b := part[i+len(fragmentIDString):] - i = strings.Index(b, `"`) - if i >= 0 { - lastFragmentID = b[:i] - logf("Found lastFragmentID: %v", lastFragmentID) + if endpoint := parseNewfangledEndpoint(noHTML, method); endpoint != nil && lastFragmentID != "" { + logf("part #%v: adding newfangled endpoint: %#v", i+1, endpoint) + addDedup(endpoint) } } } - return result + return result, nil +} + +func stripHTML(s string) string { + s = strings.ReplaceAll(s, "", "") + s = strings.ReplaceAll(s, "", "") + s = stripHTMLRE.ReplaceAllString(s, " ") + return condenseWhitespaceRE.ReplaceAllString(s, " ") } func splitHTML(buf string) []string { @@ -1167,12 +1276,15 @@ func splitHTML(buf string) []string { case i < 0 && j < 0: result = append(result, buf) buf = "" + logf("splitHTML region #%v (%v bytes): case 1: i=%v, j=%v", len(result), len(result[len(result)-1]), i, j) case j < 0, i >= 0 && j >= 0 && i < j: result = append(result, buf[:i]) buf = buf[i+len(codeLegacySplitString):] + logf("splitHTML region #%v (%v bytes): case 2: i=%v, j=%v", len(result), len(result[len(result)-1]), i, j) case i < 0, i >= 0 && j >= 0 && j < i: result = append(result, buf[:j]) buf = buf[j+len(codeSplitString):] + logf("splitHTML region #%v (%v bytes): case 3: i=%v, j=%v", len(result), len(result[len(result)-1]), i, j) default: log.Fatalf("splitHTML: i=%v, j=%v", i, j) } @@ -1180,6 +1292,19 @@ func splitHTML(buf string) []string { return result } +func parseNewfangledEndpoint(s, method string) *Endpoint { + parts := strings.Split(s, " ") + if len(parts) < 2 { + return nil + } + for i, part := range parts[:len(parts)-1] { + if strings.EqualFold(part, method) && strings.HasPrefix(parts[i+1], "/") { + return parseEndpoint(method+" "+parts[i+1], method) + } + } + return nil +} + func parseEndpoint(s, method string) *Endpoint { eol := strings.Index(s, "\n") if eol < 0 { diff --git a/update-urls/main_test.go b/update-urls/main_test.go index 49f165fd9dc..d4696e1e967 100644 --- a/update-urls/main_test.go +++ b/update-urls/main_test.go @@ -251,7 +251,8 @@ func (f *fakeDocCache) URLByMethodAndPath(methodAndPath string) (string, bool) { return "", false } -func (f *fakeDocCache) CacheDocFromInternet(url, filename string) {} // no-op +func (f *fakeDocCache) CacheDocFromInternet(url, filename string, pos token.Position) {} // no-op +func (f *fakeDocCache) Position(pos token.Pos) token.Position { return token.Position{} } // no-op // fakeFileRewriter implements FileRewriter. type fakeFileRewriter struct { @@ -509,45 +510,49 @@ func TestPerformBufferEdits(t *testing.T) { func TestGitURL(t *testing.T) { tests := []struct { - name string - s string - want string + name string + s string + wantBase string + wantFull string }{ {name: "empty string"}, {name: "non-http", s: "howdy"}, { - name: "normal URL, no slash", - s: "https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/events", - want: "https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/events/", + name: "normal URL, no slash", + s: "https://docs.github.com/en/rest/activity/events", + wantBase: "https://docs.github.com/en/rest/activity/events/", + wantFull: "https://docs.github.com/en/rest/activity/events/", }, { - name: "normal URL, with slash", - s: "https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/events/", - want: "https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/events/", + name: "normal URL, with slash", + s: "https://docs.github.com/en/rest/activity/events/", + wantBase: "https://docs.github.com/en/rest/activity/events/", + wantFull: "https://docs.github.com/en/rest/activity/events/", }, { - name: "normal URL, with fragment identifier", - s: "https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/events/#list-public-events", - want: "https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/events/", + name: "normal URL, with fragment identifier", + s: "https://docs.github.com/en/rest/activity/events/#list-public-events", + wantBase: "https://docs.github.com/en/rest/activity/events/", + wantFull: "https://docs.github.com/en/rest/activity/events/#list-public-events", }, } for i, tt := range tests { t.Run(fmt.Sprintf("test #%v: %v", i, tt.name), func(t *testing.T) { - got := getURL(tt.s) - if got != tt.want { - t.Errorf("getURL = %v ; want %v", got, tt.want) + gotBase, gotFull := getURL(tt.s) + + if gotBase != tt.wantBase { + t.Errorf("getURL base = %v ; want %v", gotBase, tt.wantBase) + } + + if gotFull != tt.wantFull { + t.Errorf("getURL full = %v ; want %v", gotFull, tt.wantFull) } }) } } -var endpointEqual = cmp.Comparer(func(a, b *Endpoint) bool { - if a.httpMethod != b.httpMethod { - return false - } - return cmp.Equal(a.urlFormats, b.urlFormats) -}) +var endpointsEqualCmp = cmp.Comparer(endpointsEqual) func testWebPageHelper(t *testing.T, got, want map[string][]*Endpoint) { t.Helper() @@ -557,16 +562,19 @@ func testWebPageHelper(t *testing.T, got, want map[string][]*Endpoint) { if len(got[k]) != len(w) { t.Errorf("len(got[%q]) = %v, len(want[%q]) = %v", k, len(got[k]), k, len(w)) } + for i := 0; i < len(got[k]); i++ { var wantEndpoint *Endpoint if ok && i < len(w) { wantEndpoint = w[i] } - if !cmp.Equal(got[k][i], wantEndpoint, endpointEqual) { - t.Errorf("got[%q][%v] =\n%#v\nwant[%q][%v]:\n%#v", k, i, got[k][i], k, i, wantEndpoint) + + if diff := cmp.Diff(wantEndpoint, got[k][i], endpointsEqualCmp); diff != "" { + t.Errorf("endpoint %q i=%v mismatch (-want +got):\n%v", k, i, diff) } } } + for k := range want { if _, ok := got[k]; !ok { t.Errorf("got[%q] = nil\nwant[%q]:\n%#v", k, k, want[k]) @@ -601,7 +609,7 @@ func TestParseEndpoint(t *testing.T) { t.Run(fmt.Sprintf("test #%v: %v", i, tt.name), func(t *testing.T) { got := parseEndpoint(tt.s, tt.method) - if !cmp.Equal(got, tt.want, endpointEqual) { + if !cmp.Equal(got, tt.want, endpointsEqualCmp) { t.Errorf("parseEndpoint = %#v, want %#v", got, tt.want) } }) diff --git a/update-urls/reactions_test.go b/update-urls/reactions_test.go index 7422a5951cc..a3071966b9e 100644 --- a/update-urls/reactions_test.go +++ b/update-urls/reactions_test.go @@ -6,17 +6,19 @@ package main import ( + _ "embed" + "strings" "testing" ) func newReactionsPipeline() *pipelineSetup { return &pipelineSetup{ - baseURL: "https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/", + baseURL: "https://docs.github.com/en/rest/reactions/", endpointsFromWebsite: reactionsWant, filename: "reactions.go", serviceName: "ReactionsService", - originalGoSource: reactionsGoFileOriginal, - wantGoSource: reactionsGoFileWant, + originalGoSource: strings.ReplaceAll(reactionsGoFileOriginal, "\r", ""), + wantGoSource: strings.ReplaceAll(reactionsGoFileWant, "\r", ""), wantNumEndpoints: 25, } } @@ -46,8 +48,11 @@ func TestPipeline_Reactions_FirstStripAllURLsAndDestroyReceivers(t *testing.T) { } func TestParseWebPageEndpoints_Reactions(t *testing.T) { - got, want := parseWebPageEndpoints(reactionsTestWebPage), reactionsWant - testWebPageHelper(t, got, want) + got, err := parseWebPageEndpoints(reactionsTestWebPage) + if err != nil { + t.Fatal(err) + } + testWebPageHelper(t, got, reactionsWant) } var reactionsWant = endpointsByFragmentID{ @@ -128,6679 +133,11 @@ var reactionsWant = endpointsByFragmentID{ "list-reactions-for-a-team-discussion-legacy": []*Endpoint{{urlFormats: []string{"teams/%v/discussions/%v/reactions"}, httpMethod: "GET"}}, } -var reactionsTestWebPage = ` - - - Reactions - GitHub Docs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - -
    -
    - - - -
    -
    - -
    - - - Article version: GitHub.com - - - - -
    - - -
    -
    - - -
    -
    - -
    - -
    -
    -

    Reactions

    -
    - -
    -
    - - - - - - - - -
    -
    -
    - -

    In this article

    - - -
    - -
    -

    - Did this doc help you? -

    -

    - - - - -

    - - - - - -

    - - -

    - - -
    - -
    -
    -
    -
    - -

    Reaction types

    -

    When creating a reaction, the allowed values for the content parameter are as follows (with the corresponding emoji for reference):

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    contentemoji
    +1👍
    -1👎
    laugh😄
    confused😕
    heart❤️
    hooray🎉
    rocket🚀
    eyes👀
    -
    -
    -

    - List reactions for a team discussion comment -

    -

    List the reactions to a team discussion comment. OAuth access tokens require the read:discussion scope.

    -

    Note: You can also specify a team by org_id and team_id using the route GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions.

    -
    -
    get /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    orgstringpath - - -
    team_slugstringpath - - -
    discussion_numberintegerpath - - -
    comment_numberintegerpath - - -
    contentstringquery -

    Returns a single reaction type. Omit this parameter to list all reactions to a team discussion comment.

    - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/discussions/42/comments/42/reactions
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions', {
    -  org: 'org',
    -  team_slug: 'team_slug',
    -  discussion_number: 42,
    -  comment_number: 42,
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    [
    -  {
    -    "id": 1,
    -    "node_id": "MDg6UmVhY3Rpb24x",
    -    "user": {
    -      "login": "octocat",
    -      "id": 1,
    -      "node_id": "MDQ6VXNlcjE=",
    -      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -      "gravatar_id": "",
    -      "url": "https://api.github.com/users/octocat",
    -      "html_url": "https://github.com/octocat",
    -      "followers_url": "https://api.github.com/users/octocat/followers",
    -      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -      "organizations_url": "https://api.github.com/users/octocat/orgs",
    -      "repos_url": "https://api.github.com/users/octocat/repos",
    -      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -      "received_events_url": "https://api.github.com/users/octocat/received_events",
    -      "type": "User",
    -      "site_admin": false
    -    },
    -    "content": "heart",
    -    "created_at": "2016-05-20T20:09:31Z"
    -  }
    -]
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - Create reaction for a team discussion comment -

    -

    Create a reaction to a team discussion comment. OAuth access tokens require the write:discussion scope. A response with a Status: 200 OK means that you already added the reaction type to this team discussion comment.

    -

    Note: You can also specify a team by org_id and team_id using the route POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions.

    -
    -
    post /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    orgstringpath - - -
    team_slugstringpath - - -
    discussion_numberintegerpath - - -
    comment_numberintegerpath - - -
    contentstringbody -

    Required. The reaction type to add to the team discussion comment.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X POST \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/discussions/42/comments/42/reactions \
    -  -d '{"content":"content"}'
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions', {
    -  org: 'org',
    -  team_slug: 'team_slug',
    -  discussion_number: 42,
    -  comment_number: 42,
    -  content: 'content',
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default response

    -
    Status: 201 Created
    -
    {
    -  "id": 1,
    -  "node_id": "MDg6UmVhY3Rpb24x",
    -  "user": {
    -    "login": "octocat",
    -    "id": 1,
    -    "node_id": "MDQ6VXNlcjE=",
    -    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -    "gravatar_id": "",
    -    "url": "https://api.github.com/users/octocat",
    -    "html_url": "https://github.com/octocat",
    -    "followers_url": "https://api.github.com/users/octocat/followers",
    -    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -    "organizations_url": "https://api.github.com/users/octocat/orgs",
    -    "repos_url": "https://api.github.com/users/octocat/repos",
    -    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -    "received_events_url": "https://api.github.com/users/octocat/received_events",
    -    "type": "User",
    -    "site_admin": false
    -  },
    -  "content": "heart",
    -  "created_at": "2016-05-20T20:09:31Z"
    -}
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - Delete team discussion comment reaction -

    -

    Note: You can also specify a team or organization with team_id and org_id using the route DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id.

    -

    Delete a reaction to a team discussion comment. OAuth access tokens require the write:discussion scope.

    -
    -
    delete /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    orgstringpath - - -
    team_slugstringpath - - -
    discussion_numberintegerpath - - -
    comment_numberintegerpath - - -
    reaction_idintegerpath - - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X DELETE \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/discussions/42/comments/42/reactions/42
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}', {
    -  org: 'org',
    -  team_slug: 'team_slug',
    -  discussion_number: 42,
    -  comment_number: 42,
    -  reaction_id: 42,
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default Response

    -
    Status: 204 No Content
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - List reactions for a team discussion -

    -

    List the reactions to a team discussion. OAuth access tokens require the read:discussion scope.

    -

    Note: You can also specify a team by org_id and team_id using the route GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions.

    -
    -
    get /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    orgstringpath - - -
    team_slugstringpath - - -
    discussion_numberintegerpath - - -
    contentstringquery -

    Returns a single reaction type. Omit this parameter to list all reactions to a team discussion.

    - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/discussions/42/reactions
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions', {
    -  org: 'org',
    -  team_slug: 'team_slug',
    -  discussion_number: 42,
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    [
    -  {
    -    "id": 1,
    -    "node_id": "MDg6UmVhY3Rpb24x",
    -    "user": {
    -      "login": "octocat",
    -      "id": 1,
    -      "node_id": "MDQ6VXNlcjE=",
    -      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -      "gravatar_id": "",
    -      "url": "https://api.github.com/users/octocat",
    -      "html_url": "https://github.com/octocat",
    -      "followers_url": "https://api.github.com/users/octocat/followers",
    -      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -      "organizations_url": "https://api.github.com/users/octocat/orgs",
    -      "repos_url": "https://api.github.com/users/octocat/repos",
    -      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -      "received_events_url": "https://api.github.com/users/octocat/received_events",
    -      "type": "User",
    -      "site_admin": false
    -    },
    -    "content": "heart",
    -    "created_at": "2016-05-20T20:09:31Z"
    -  }
    -]
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - Create reaction for a team discussion -

    -

    Create a reaction to a team discussion. OAuth access tokens require the write:discussion scope. A response with a Status: 200 OK means that you already added the reaction type to this team discussion.

    -

    Note: You can also specify a team by org_id and team_id using the route POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions.

    -
    -
    post /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    orgstringpath - - -
    team_slugstringpath - - -
    discussion_numberintegerpath - - -
    contentstringbody -

    Required. The reaction type to add to the team discussion.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X POST \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/discussions/42/reactions \
    -  -d '{"content":"content"}'
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions', {
    -  org: 'org',
    -  team_slug: 'team_slug',
    -  discussion_number: 42,
    -  content: 'content',
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default response

    -
    Status: 201 Created
    -
    {
    -  "id": 1,
    -  "node_id": "MDg6UmVhY3Rpb24x",
    -  "user": {
    -    "login": "octocat",
    -    "id": 1,
    -    "node_id": "MDQ6VXNlcjE=",
    -    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -    "gravatar_id": "",
    -    "url": "https://api.github.com/users/octocat",
    -    "html_url": "https://github.com/octocat",
    -    "followers_url": "https://api.github.com/users/octocat/followers",
    -    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -    "organizations_url": "https://api.github.com/users/octocat/orgs",
    -    "repos_url": "https://api.github.com/users/octocat/repos",
    -    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -    "received_events_url": "https://api.github.com/users/octocat/received_events",
    -    "type": "User",
    -    "site_admin": false
    -  },
    -  "content": "heart",
    -  "created_at": "2016-05-20T20:09:31Z"
    -}
    -
    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - Delete team discussion reaction -

    -

    Note: You can also specify a team or organization with team_id and org_id using the route DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions/:reaction_id.

    -

    Delete a reaction to a team discussion. OAuth access tokens require the write:discussion scope.

    -
    -
    delete /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    orgstringpath - - -
    team_slugstringpath - - -
    discussion_numberintegerpath - - -
    reaction_idintegerpath - - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X DELETE \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/discussions/42/reactions/42
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}', {
    -  org: 'org',
    -  team_slug: 'team_slug',
    -  discussion_number: 42,
    -  reaction_id: 42,
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default Response

    -
    Status: 204 No Content
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - Delete a reaction (Legacy) -

    -

    Deprecation Notice: This endpoint route is deprecated and will be removed from the Reactions API. We recommend migrating your existing code to use the new delete reactions endpoints. For more information, see this blog post.

    -

    OAuth access tokens require the write:discussion scope, when deleting a team discussion or team discussion comment.

    -
    -
    delete /reactions/{reaction_id}
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    reaction_idintegerpath - - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X DELETE \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/reactions/42
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('DELETE /reactions/{reaction_id}', {
    -  reaction_id: 42,
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default Response

    -
    Status: 204 No Content
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - List reactions for a commit comment -

    -

    List the reactions to a commit comment.

    -
    -
    get /repos/{owner}/{repo}/comments/{comment_id}/reactions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    ownerstringpath - - -
    repostringpath - - -
    comment_idintegerpath - - -
    contentstringquery -

    Returns a single reaction type. Omit this parameter to list all reactions to a commit comment.

    - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/repos/octocat/hello-world/comments/42/reactions
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /repos/{owner}/{repo}/comments/{comment_id}/reactions', {
    -  owner: 'octocat',
    -  repo: 'hello-world',
    -  comment_id: 42,
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    [
    -  {
    -    "id": 1,
    -    "node_id": "MDg6UmVhY3Rpb24x",
    -    "user": {
    -      "login": "octocat",
    -      "id": 1,
    -      "node_id": "MDQ6VXNlcjE=",
    -      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -      "gravatar_id": "",
    -      "url": "https://api.github.com/users/octocat",
    -      "html_url": "https://github.com/octocat",
    -      "followers_url": "https://api.github.com/users/octocat/followers",
    -      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -      "organizations_url": "https://api.github.com/users/octocat/orgs",
    -      "repos_url": "https://api.github.com/users/octocat/repos",
    -      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -      "received_events_url": "https://api.github.com/users/octocat/received_events",
    -      "type": "User",
    -      "site_admin": false
    -    },
    -    "content": "heart",
    -    "created_at": "2016-05-20T20:09:31Z"
    -  }
    -]
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - Create reaction for a commit comment -

    -

    Create a reaction to a commit comment. A response with a Status: 200 OK means that you already added the reaction type to this commit comment.

    -
    -
    post /repos/{owner}/{repo}/comments/{comment_id}/reactions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    ownerstringpath - - -
    repostringpath - - -
    comment_idintegerpath - - -
    contentstringbody -

    Required. The reaction type to add to the commit comment.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X POST \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/repos/octocat/hello-world/comments/42/reactions \
    -  -d '{"content":"content"}'
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('POST /repos/{owner}/{repo}/comments/{comment_id}/reactions', {
    -  owner: 'octocat',
    -  repo: 'hello-world',
    -  comment_id: 42,
    -  content: 'content',
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default response

    -
    Status: 201 Created
    -
    {
    -  "id": 1,
    -  "node_id": "MDg6UmVhY3Rpb24x",
    -  "user": {
    -    "login": "octocat",
    -    "id": 1,
    -    "node_id": "MDQ6VXNlcjE=",
    -    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -    "gravatar_id": "",
    -    "url": "https://api.github.com/users/octocat",
    -    "html_url": "https://github.com/octocat",
    -    "followers_url": "https://api.github.com/users/octocat/followers",
    -    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -    "organizations_url": "https://api.github.com/users/octocat/orgs",
    -    "repos_url": "https://api.github.com/users/octocat/repos",
    -    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -    "received_events_url": "https://api.github.com/users/octocat/received_events",
    -    "type": "User",
    -    "site_admin": false
    -  },
    -  "content": "heart",
    -  "created_at": "2016-05-20T20:09:31Z"
    -}
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - Delete a commit comment reaction -

    -

    Note: You can also specify a repository by repository_id using the route DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id.

    -

    Delete a reaction to a commit comment.

    -
    -
    delete /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    ownerstringpath - - -
    repostringpath - - -
    comment_idintegerpath - - -
    reaction_idintegerpath - - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X DELETE \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/repos/octocat/hello-world/comments/42/reactions/42
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}', {
    -  owner: 'octocat',
    -  repo: 'hello-world',
    -  comment_id: 42,
    -  reaction_id: 42,
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default Response

    -
    Status: 204 No Content
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - List reactions for an issue comment -

    -

    List the reactions to an issue comment.

    -
    -
    get /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    ownerstringpath - - -
    repostringpath - - -
    comment_idintegerpath - - -
    contentstringquery -

    Returns a single reaction type. Omit this parameter to list all reactions to an issue comment.

    - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/repos/octocat/hello-world/issues/comments/42/reactions
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions', {
    -  owner: 'octocat',
    -  repo: 'hello-world',
    -  comment_id: 42,
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    [
    -  {
    -    "id": 1,
    -    "node_id": "MDg6UmVhY3Rpb24x",
    -    "user": {
    -      "login": "octocat",
    -      "id": 1,
    -      "node_id": "MDQ6VXNlcjE=",
    -      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -      "gravatar_id": "",
    -      "url": "https://api.github.com/users/octocat",
    -      "html_url": "https://github.com/octocat",
    -      "followers_url": "https://api.github.com/users/octocat/followers",
    -      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -      "organizations_url": "https://api.github.com/users/octocat/orgs",
    -      "repos_url": "https://api.github.com/users/octocat/repos",
    -      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -      "received_events_url": "https://api.github.com/users/octocat/received_events",
    -      "type": "User",
    -      "site_admin": false
    -    },
    -    "content": "heart",
    -    "created_at": "2016-05-20T20:09:31Z"
    -  }
    -]
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - Create reaction for an issue comment -

    -

    Create a reaction to an issue comment. A response with a Status: 200 OK means that you already added the reaction type to this issue comment.

    -
    -
    post /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    ownerstringpath - - -
    repostringpath - - -
    comment_idintegerpath - - -
    contentstringbody -

    Required. The reaction type to add to the issue comment.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X POST \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/repos/octocat/hello-world/issues/comments/42/reactions \
    -  -d '{"content":"content"}'
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions', {
    -  owner: 'octocat',
    -  repo: 'hello-world',
    -  comment_id: 42,
    -  content: 'content',
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default response

    -
    Status: 201 Created
    -
    {
    -  "id": 1,
    -  "node_id": "MDg6UmVhY3Rpb24x",
    -  "user": {
    -    "login": "octocat",
    -    "id": 1,
    -    "node_id": "MDQ6VXNlcjE=",
    -    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -    "gravatar_id": "",
    -    "url": "https://api.github.com/users/octocat",
    -    "html_url": "https://github.com/octocat",
    -    "followers_url": "https://api.github.com/users/octocat/followers",
    -    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -    "organizations_url": "https://api.github.com/users/octocat/orgs",
    -    "repos_url": "https://api.github.com/users/octocat/repos",
    -    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -    "received_events_url": "https://api.github.com/users/octocat/received_events",
    -    "type": "User",
    -    "site_admin": false
    -  },
    -  "content": "heart",
    -  "created_at": "2016-05-20T20:09:31Z"
    -}
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - Delete an issue comment reaction -

    -

    Note: You can also specify a repository by repository_id using the route DELETE delete /repositories/:repository_id/issues/comments/:comment_id/reactions/:reaction_id.

    -

    Delete a reaction to an issue comment.

    -
    -
    delete /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    ownerstringpath - - -
    repostringpath - - -
    comment_idintegerpath - - -
    reaction_idintegerpath - - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X DELETE \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/repos/octocat/hello-world/issues/comments/42/reactions/42
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}', {
    -  owner: 'octocat',
    -  repo: 'hello-world',
    -  comment_id: 42,
    -  reaction_id: 42,
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default Response

    -
    Status: 204 No Content
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - List reactions for an issue -

    -

    List the reactions to an issue.

    -
    -
    get /repos/{owner}/{repo}/issues/{issue_number}/reactions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    ownerstringpath - - -
    repostringpath - - -
    issue_numberintegerpath - - -
    contentstringquery -

    Returns a single reaction type. Omit this parameter to list all reactions to an issue.

    - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/repos/octocat/hello-world/issues/42/reactions
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /repos/{owner}/{repo}/issues/{issue_number}/reactions', {
    -  owner: 'octocat',
    -  repo: 'hello-world',
    -  issue_number: 42,
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    [
    -  {
    -    "id": 1,
    -    "node_id": "MDg6UmVhY3Rpb24x",
    -    "user": {
    -      "login": "octocat",
    -      "id": 1,
    -      "node_id": "MDQ6VXNlcjE=",
    -      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -      "gravatar_id": "",
    -      "url": "https://api.github.com/users/octocat",
    -      "html_url": "https://github.com/octocat",
    -      "followers_url": "https://api.github.com/users/octocat/followers",
    -      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -      "organizations_url": "https://api.github.com/users/octocat/orgs",
    -      "repos_url": "https://api.github.com/users/octocat/repos",
    -      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -      "received_events_url": "https://api.github.com/users/octocat/received_events",
    -      "type": "User",
    -      "site_admin": false
    -    },
    -    "content": "heart",
    -    "created_at": "2016-05-20T20:09:31Z"
    -  }
    -]
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - Create reaction for an issue -

    -

    Create a reaction to an issue. A response with a Status: 200 OK means that you already added the reaction type to this issue.

    -
    -
    post /repos/{owner}/{repo}/issues/{issue_number}/reactions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    ownerstringpath - - -
    repostringpath - - -
    issue_numberintegerpath - - -
    contentstringbody -

    Required. The reaction type to add to the issue.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X POST \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/repos/octocat/hello-world/issues/42/reactions \
    -  -d '{"content":"content"}'
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('POST /repos/{owner}/{repo}/issues/{issue_number}/reactions', {
    -  owner: 'octocat',
    -  repo: 'hello-world',
    -  issue_number: 42,
    -  content: 'content',
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default response

    -
    Status: 201 Created
    -
    {
    -  "id": 1,
    -  "node_id": "MDg6UmVhY3Rpb24x",
    -  "user": {
    -    "login": "octocat",
    -    "id": 1,
    -    "node_id": "MDQ6VXNlcjE=",
    -    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -    "gravatar_id": "",
    -    "url": "https://api.github.com/users/octocat",
    -    "html_url": "https://github.com/octocat",
    -    "followers_url": "https://api.github.com/users/octocat/followers",
    -    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -    "organizations_url": "https://api.github.com/users/octocat/orgs",
    -    "repos_url": "https://api.github.com/users/octocat/repos",
    -    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -    "received_events_url": "https://api.github.com/users/octocat/received_events",
    -    "type": "User",
    -    "site_admin": false
    -  },
    -  "content": "heart",
    -  "created_at": "2016-05-20T20:09:31Z"
    -}
    -
    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - Delete an issue reaction -

    -

    Note: You can also specify a repository by repository_id using the route DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id.

    -

    Delete a reaction to an issue.

    -
    -
    delete /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    ownerstringpath - - -
    repostringpath - - -
    issue_numberintegerpath - - -
    reaction_idintegerpath - - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X DELETE \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/repos/octocat/hello-world/issues/42/reactions/42
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}', {
    -  owner: 'octocat',
    -  repo: 'hello-world',
    -  issue_number: 42,
    -  reaction_id: 42,
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default Response

    -
    Status: 204 No Content
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    - -
    get /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    ownerstringpath - - -
    repostringpath - - -
    comment_idintegerpath - - -
    contentstringquery -

    Returns a single reaction type. Omit this parameter to list all reactions to a pull request review comment.

    - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/repos/octocat/hello-world/pulls/comments/42/reactions
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions', {
    -  owner: 'octocat',
    -  repo: 'hello-world',
    -  comment_id: 42,
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    [
    -  {
    -    "id": 1,
    -    "node_id": "MDg6UmVhY3Rpb24x",
    -    "user": {
    -      "login": "octocat",
    -      "id": 1,
    -      "node_id": "MDQ6VXNlcjE=",
    -      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -      "gravatar_id": "",
    -      "url": "https://api.github.com/users/octocat",
    -      "html_url": "https://github.com/octocat",
    -      "followers_url": "https://api.github.com/users/octocat/followers",
    -      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -      "organizations_url": "https://api.github.com/users/octocat/orgs",
    -      "repos_url": "https://api.github.com/users/octocat/repos",
    -      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -      "received_events_url": "https://api.github.com/users/octocat/received_events",
    -      "type": "User",
    -      "site_admin": false
    -    },
    -    "content": "heart",
    -    "created_at": "2016-05-20T20:09:31Z"
    -  }
    -]
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - Create reaction for a pull request review comment -

    -

    Create a reaction to a pull request review comment. A response with a Status: 200 OK means that you already added the reaction type to this pull request review comment.

    -
    -
    post /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    ownerstringpath - - -
    repostringpath - - -
    comment_idintegerpath - - -
    contentstringbody -

    Required. The reaction type to add to the pull request review comment.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X POST \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/repos/octocat/hello-world/pulls/comments/42/reactions \
    -  -d '{"content":"content"}'
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions', {
    -  owner: 'octocat',
    -  repo: 'hello-world',
    -  comment_id: 42,
    -  content: 'content',
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default response

    -
    Status: 201 Created
    -
    {
    -  "id": 1,
    -  "node_id": "MDg6UmVhY3Rpb24x",
    -  "user": {
    -    "login": "octocat",
    -    "id": 1,
    -    "node_id": "MDQ6VXNlcjE=",
    -    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -    "gravatar_id": "",
    -    "url": "https://api.github.com/users/octocat",
    -    "html_url": "https://github.com/octocat",
    -    "followers_url": "https://api.github.com/users/octocat/followers",
    -    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -    "organizations_url": "https://api.github.com/users/octocat/orgs",
    -    "repos_url": "https://api.github.com/users/octocat/repos",
    -    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -    "received_events_url": "https://api.github.com/users/octocat/received_events",
    -    "type": "User",
    -    "site_admin": false
    -  },
    -  "content": "heart",
    -  "created_at": "2016-05-20T20:09:31Z"
    -}
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - Delete a pull request comment reaction -

    -

    Note: You can also specify a repository by repository_id using the route DELETE /repositories/:repository_id/pulls/comments/:comment_id/reactions/:reaction_id.

    -

    Delete a reaction to a pull request review comment.

    -
    -
    delete /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    ownerstringpath - - -
    repostringpath - - -
    comment_idintegerpath - - -
    reaction_idintegerpath - - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X DELETE \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/repos/octocat/hello-world/pulls/comments/42/reactions/42
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}', {
    -  owner: 'octocat',
    -  repo: 'hello-world',
    -  comment_id: 42,
    -  reaction_id: 42,
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default Response

    -
    Status: 204 No Content
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - List reactions for a team discussion comment (Legacy) -

    -

    Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new List reactions for a team discussion comment endpoint.

    -

    List the reactions to a team discussion comment. OAuth access tokens require the read:discussion scope.

    -
    -
    get /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    team_idintegerpath - - -
    discussion_numberintegerpath - - -
    comment_numberintegerpath - - -
    contentstringquery -

    Returns a single reaction type. Omit this parameter to list all reactions to a team discussion comment.

    - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/teams/42/discussions/42/comments/42/reactions
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions', {
    -  team_id: 42,
    -  discussion_number: 42,
    -  comment_number: 42,
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    [
    -  {
    -    "id": 1,
    -    "node_id": "MDg6UmVhY3Rpb24x",
    -    "user": {
    -      "login": "octocat",
    -      "id": 1,
    -      "node_id": "MDQ6VXNlcjE=",
    -      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -      "gravatar_id": "",
    -      "url": "https://api.github.com/users/octocat",
    -      "html_url": "https://github.com/octocat",
    -      "followers_url": "https://api.github.com/users/octocat/followers",
    -      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -      "organizations_url": "https://api.github.com/users/octocat/orgs",
    -      "repos_url": "https://api.github.com/users/octocat/repos",
    -      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -      "received_events_url": "https://api.github.com/users/octocat/received_events",
    -      "type": "User",
    -      "site_admin": false
    -    },
    -    "content": "heart",
    -    "created_at": "2016-05-20T20:09:31Z"
    -  }
    -]
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - Create reaction for a team discussion comment (Legacy) -

    -

    Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Create reaction for a team discussion comment endpoint.

    -

    Create a reaction to a team discussion comment. OAuth access tokens require the write:discussion scope. A response with a Status: 200 OK means that you already added the reaction type to this team discussion comment.

    -
    -
    post /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    team_idintegerpath - - -
    discussion_numberintegerpath - - -
    comment_numberintegerpath - - -
    contentstringbody -

    Required. The reaction type to add to the team discussion comment.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X POST \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/teams/42/discussions/42/comments/42/reactions \
    -  -d '{"content":"content"}'
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('POST /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions', {
    -  team_id: 42,
    -  discussion_number: 42,
    -  comment_number: 42,
    -  content: 'content',
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default response

    -
    Status: 201 Created
    -
    {
    -  "id": 1,
    -  "node_id": "MDg6UmVhY3Rpb24x",
    -  "user": {
    -    "login": "octocat",
    -    "id": 1,
    -    "node_id": "MDQ6VXNlcjE=",
    -    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -    "gravatar_id": "",
    -    "url": "https://api.github.com/users/octocat",
    -    "html_url": "https://github.com/octocat",
    -    "followers_url": "https://api.github.com/users/octocat/followers",
    -    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -    "organizations_url": "https://api.github.com/users/octocat/orgs",
    -    "repos_url": "https://api.github.com/users/octocat/repos",
    -    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -    "received_events_url": "https://api.github.com/users/octocat/received_events",
    -    "type": "User",
    -    "site_admin": false
    -  },
    -  "content": "heart",
    -  "created_at": "2016-05-20T20:09:31Z"
    -}
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - List reactions for a team discussion (Legacy) -

    -

    Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new List reactions for a team discussion endpoint.

    -

    List the reactions to a team discussion. OAuth access tokens require the read:discussion scope.

    -
    -
    get /teams/{team_id}/discussions/{discussion_number}/reactions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    team_idintegerpath - - -
    discussion_numberintegerpath - - -
    contentstringquery -

    Returns a single reaction type. Omit this parameter to list all reactions to a team discussion.

    - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/teams/42/discussions/42/reactions
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /teams/{team_id}/discussions/{discussion_number}/reactions', {
    -  team_id: 42,
    -  discussion_number: 42,
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    [
    -  {
    -    "id": 1,
    -    "node_id": "MDg6UmVhY3Rpb24x",
    -    "user": {
    -      "login": "octocat",
    -      "id": 1,
    -      "node_id": "MDQ6VXNlcjE=",
    -      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -      "gravatar_id": "",
    -      "url": "https://api.github.com/users/octocat",
    -      "html_url": "https://github.com/octocat",
    -      "followers_url": "https://api.github.com/users/octocat/followers",
    -      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -      "organizations_url": "https://api.github.com/users/octocat/orgs",
    -      "repos_url": "https://api.github.com/users/octocat/repos",
    -      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -      "received_events_url": "https://api.github.com/users/octocat/received_events",
    -      "type": "User",
    -      "site_admin": false
    -    },
    -    "content": "heart",
    -    "created_at": "2016-05-20T20:09:31Z"
    -  }
    -]
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - Create reaction for a team discussion (Legacy) -

    -

    Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Create reaction for a team discussion endpoint.

    -

    Create a reaction to a team discussion. OAuth access tokens require the write:discussion scope. A response with a Status: 200 OK means that you already added the reaction type to this team discussion.

    -
    -
    post /teams/{team_id}/discussions/{discussion_number}/reactions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    team_idintegerpath - - -
    discussion_numberintegerpath - - -
    contentstringbody -

    Required. The reaction type to add to the team discussion.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X POST \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/teams/42/discussions/42/reactions \
    -  -d '{"content":"content"}'
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('POST /teams/{team_id}/discussions/{discussion_number}/reactions', {
    -  team_id: 42,
    -  discussion_number: 42,
    -  content: 'content',
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default response

    -
    Status: 201 Created
    -
    {
    -  "id": 1,
    -  "node_id": "MDg6UmVhY3Rpb24x",
    -  "user": {
    -    "login": "octocat",
    -    "id": 1,
    -    "node_id": "MDQ6VXNlcjE=",
    -    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -    "gravatar_id": "",
    -    "url": "https://api.github.com/users/octocat",
    -    "html_url": "https://github.com/octocat",
    -    "followers_url": "https://api.github.com/users/octocat/followers",
    -    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -    "organizations_url": "https://api.github.com/users/octocat/orgs",
    -    "repos_url": "https://api.github.com/users/octocat/repos",
    -    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -    "received_events_url": "https://api.github.com/users/octocat/received_events",
    -    "type": "User",
    -    "site_admin": false
    -  },
    -  "content": "heart",
    -  "created_at": "2016-05-20T20:09:31Z"
    -}
    -
    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -
    -
    - -
    -

    - Did this doc help you? -

    -

    - - - - -

    - - - - - -

    - - -

    - - -
    - -
    -
    - - - -
    -
    -
    -
    -

    Ask a human

    -

    Can't find what you're looking for?

    - Contact us -
    -
    - -
    -
    -
    -
    - - - - - -
    - - -` - -var reactionsGoFileOriginal = `// Copyright 2016 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" -) - -// ReactionsService provides access to the reactions-related functions in the -// GitHub API. -type ReactionsService service - -// Reaction represents a GitHub reaction. -type Reaction struct { - // ID is the Reaction ID. - ID *int64 ` + "`" + `json:"id,omitempty"` + "`" + ` - User *User ` + "`" + `json:"user,omitempty"` + "`" + ` - NodeID *string ` + "`" + `json:"node_id,omitempty"` + "`" + ` - // Content is the type of reaction. - // Possible values are: - // "+1", "-1", "laugh", "confused", "heart", "hooray". - Content *string ` + "`" + `json:"content,omitempty"` + "`" + ` -} - -// Reactions represents a summary of GitHub reactions. -type Reactions struct { - TotalCount *int ` + "`" + `json:"total_count,omitempty"` + "`" + ` - PlusOne *int ` + "`" + `json:"+1,omitempty"` + "`" + ` - MinusOne *int ` + "`" + `json:"-1,omitempty"` + "`" + ` - Laugh *int ` + "`" + `json:"laugh,omitempty"` + "`" + ` - Confused *int ` + "`" + `json:"confused,omitempty"` + "`" + ` - Heart *int ` + "`" + `json:"heart,omitempty"` + "`" + ` - Hooray *int ` + "`" + `json:"hooray,omitempty"` + "`" + ` - URL *string ` + "`" + `json:"url,omitempty"` + "`" + ` -} - -func (r Reaction) String() string { - return Stringify(r) -} - -// ListCommentReactionOptions specifies the optional parameters to the -// ReactionsService.ListCommentReactions method. -type ListCommentReactionOptions struct { - // Content restricts the returned comment reactions to only those with the given type. - // Omit this parameter to list all reactions to a commit comment. - // Possible values are: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". - Content string ` + "`" + `url:"content,omitempty"` + "`" + ` - - ListOptions -} - -// ListCommentReactions lists the reactions for a commit comment. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#list-reactions-for-a-commit-comment -func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListCommentReactionOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// CreateCommentReaction creates a reaction for a commit comment. -// Note that if you have already created a reaction of type content, the -// previously created reaction will be returned with Status: 200 OK. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#create-reaction-for-a-commit-comment -func (s *ReactionsService) CreateCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// DeleteCommentReaction deletes the reaction for a commit comment. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-a-commit-comment-reaction -func (s *ReactionsService) DeleteCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { - u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions/%v", owner, repo, commentID, reactionID) - - return s.deleteReaction(ctx, u) -} - -// DeleteCommentReactionByID deletes the reaction for a commit comment by repository ID. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-a-commit-comment-reaction -func (s *ReactionsService) DeleteCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { - u := fmt.Sprintf("repositories/%v/comments/%v/reactions/%v", repoID, commentID, reactionID) - - return s.deleteReaction(ctx, u) -} - -// ListIssueReactions lists the reactions for an issue. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#list-reactions-for-an-issue -func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// CreateIssueReaction creates a reaction for an issue. -// Note that if you have already created a reaction of type content, the -// previously created reaction will be returned with Status: 200 OK. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#create-reaction-for-an-issue -func (s *ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo string, number int, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// DeleteIssueReaction deletes the reaction to an issue. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-an-issue-reaction -func (s *ReactionsService) DeleteIssueReaction(ctx context.Context, owner, repo string, issueNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repos/%v/%v/issues/%v/reactions/%v", owner, repo, issueNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -// DeleteIssueReactionByID deletes the reaction to an issue by repository ID. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-an-issue-reaction -func (s *ReactionsService) DeleteIssueReactionByID(ctx context.Context, repoID, issueNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repositories/%v/issues/%v/reactions/%v", repoID, issueNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -// ListIssueCommentReactions lists the reactions for an issue comment. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#list-reactions-for-an-issue-comment -func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// CreateIssueCommentReaction creates a reaction for an issue comment. -// Note that if you have already created a reaction of type content, the -// previously created reaction will be returned with Status: 200 OK. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#create-reaction-for-an-issue-comment -func (s *ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// DeleteIssueCommentReaction deletes the reaction to an issue comment. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-an-issue-comment-reaction -func (s *ReactionsService) DeleteIssueCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions/%v", owner, repo, commentID, reactionID) - - return s.deleteReaction(ctx, url) -} - -// DeleteIssueCommentReactionByID deletes the reaction to an issue comment by repository ID. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-an-issue-comment-reaction -func (s *ReactionsService) DeleteIssueCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repositories/%v/issues/comments/%v/reactions/%v", repoID, commentID, reactionID) - - return s.deleteReaction(ctx, url) -} - -// ListPullRequestCommentReactions lists the reactions for a pull request review comment. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#list-reactions-for-an-issue-comment -func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// CreatePullRequestCommentReaction creates a reaction for a pull request review comment. -// Note that if you have already created a reaction of type content, the -// previously created reaction will be returned with Status: 200 OK. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#create-reaction-for-an-issue-comment -func (s *ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) +//go:embed testdata/reactions.html +var reactionsTestWebPage string - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } +//go:embed testdata/reactions-original.go +var reactionsGoFileOriginal string - return m, resp, nil -} - -// DeletePullRequestCommentReaction deletes the reaction to a pull request review comment. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-a-pull-request-comment-reaction -func (s *ReactionsService) DeletePullRequestCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions/%v", owner, repo, commentID, reactionID) - - return s.deleteReaction(ctx, url) -} - -// DeletePullRequestCommentReactionByID deletes the reaction to a pull request review comment by repository ID. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-a-pull-request-comment-reaction -func (s *ReactionsService) DeletePullRequestCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repositories/%v/pulls/comments/%v/reactions/%v", repoID, commentID, reactionID) - - return s.deleteReaction(ctx, url) -} - -// ListTeamDiscussionReactions lists the reactions for a team discussion. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#list-reactions-for-a-team-discussion -func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, teamID int64, discussionNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// CreateTeamDiscussionReaction creates a reaction for a team discussion. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#create-reaction-for-a-team-discussion -func (s *ReactionsService) CreateTeamDiscussionReaction(ctx context.Context, teamID int64, discussionNumber int, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - req.Header.Set("Accept", mediaTypeReactionsPreview) - - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// DeleteTeamDiscussionReaction deletes the reaction to a team discussion. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-team-discussion-reaction -func (s *ReactionsService) DeleteTeamDiscussionReaction(ctx context.Context, org, teamSlug string, discussionNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/reactions/%v", org, teamSlug, discussionNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -// DeleteTeamDiscussionReactionByOrgIDAndTeamID deletes the reaction to a team discussion by organization ID and team ID. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-team-discussion-reaction -func (s *ReactionsService) DeleteTeamDiscussionReactionByOrgIDAndTeamID(ctx context.Context, orgID, teamID, discussionNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/reactions/%v", orgID, teamID, discussionNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -// ListTeamDiscussionCommentReactions lists the reactions for a team discussion comment. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#list-reactions-for-a-team-discussion-comment -func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Context, teamID int64, discussionNumber, commentNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, nil, err - } - return m, resp, nil -} - -// CreateTeamDiscussionCommentReaction creates a reaction for a team discussion comment. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#create-reaction-for-a-team-discussion-comment -func (s *ReactionsService) CreateTeamDiscussionCommentReaction(ctx context.Context, teamID int64, discussionNumber, commentNumber int, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - req.Header.Set("Accept", mediaTypeReactionsPreview) - - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// DeleteTeamDiscussionCommentReaction deletes the reaction to a team discussion comment. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-team-discussion-comment-reaction -func (s *ReactionsService) DeleteTeamDiscussionCommentReaction(ctx context.Context, org, teamSlug string, discussionNumber, commentNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v/reactions/%v", org, teamSlug, discussionNumber, commentNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -// DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID deletes the reaction to a team discussion comment by organization ID and team ID. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-team-discussion-comment-reaction -func (s *ReactionsService) DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID(ctx context.Context, orgID, teamID, discussionNumber, commentNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v/reactions/%v", orgID, teamID, discussionNumber, commentNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -func (s *ReactionsService) deleteReaction(ctx context.Context, url string) (*Response, error) { - req, err := s.client.NewRequest(http.MethodDelete, url, nil) - if err != nil { - return nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - return s.client.Do(ctx, req, nil) -} -` - -var reactionsGoFileWant = `// Copyright 2016 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" -) - -// ReactionsService provides access to the reactions-related functions in the -// GitHub API. -type ReactionsService service - -// Reaction represents a GitHub reaction. -type Reaction struct { - // ID is the Reaction ID. - ID *int64 ` + "`" + `json:"id,omitempty"` + "`" + ` - User *User ` + "`" + `json:"user,omitempty"` + "`" + ` - NodeID *string ` + "`" + `json:"node_id,omitempty"` + "`" + ` - // Content is the type of reaction. - // Possible values are: - // "+1", "-1", "laugh", "confused", "heart", "hooray". - Content *string ` + "`" + `json:"content,omitempty"` + "`" + ` -} - -// Reactions represents a summary of GitHub reactions. -type Reactions struct { - TotalCount *int ` + "`" + `json:"total_count,omitempty"` + "`" + ` - PlusOne *int ` + "`" + `json:"+1,omitempty"` + "`" + ` - MinusOne *int ` + "`" + `json:"-1,omitempty"` + "`" + ` - Laugh *int ` + "`" + `json:"laugh,omitempty"` + "`" + ` - Confused *int ` + "`" + `json:"confused,omitempty"` + "`" + ` - Heart *int ` + "`" + `json:"heart,omitempty"` + "`" + ` - Hooray *int ` + "`" + `json:"hooray,omitempty"` + "`" + ` - URL *string ` + "`" + `json:"url,omitempty"` + "`" + ` -} - -func (r Reaction) String() string { - return Stringify(r) -} - -// ListCommentReactionOptions specifies the optional parameters to the -// ReactionsService.ListCommentReactions method. -type ListCommentReactionOptions struct { - // Content restricts the returned comment reactions to only those with the given type. - // Omit this parameter to list all reactions to a commit comment. - // Possible values are: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". - Content string ` + "`" + `url:"content,omitempty"` + "`" + ` - - ListOptions -} - -// ListCommentReactions lists the reactions for a commit comment. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#list-reactions-for-a-commit-comment -func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListCommentReactionOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// CreateCommentReaction creates a reaction for a commit comment. -// Note that if you have already created a reaction of type content, the -// previously created reaction will be returned with Status: 200 OK. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#create-reaction-for-a-commit-comment -func (s *ReactionsService) CreateCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// DeleteCommentReaction deletes the reaction for a commit comment. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-a-commit-comment-reaction -func (s *ReactionsService) DeleteCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { - u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions/%v", owner, repo, commentID, reactionID) - - return s.deleteReaction(ctx, u) -} - -// DeleteCommentReactionByID deletes the reaction for a commit comment by repository ID. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-a-commit-comment-reaction -func (s *ReactionsService) DeleteCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { - u := fmt.Sprintf("repositories/%v/comments/%v/reactions/%v", repoID, commentID, reactionID) - - return s.deleteReaction(ctx, u) -} - -// ListIssueReactions lists the reactions for an issue. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#list-reactions-for-an-issue -func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// CreateIssueReaction creates a reaction for an issue. -// Note that if you have already created a reaction of type content, the -// previously created reaction will be returned with Status: 200 OK. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#create-reaction-for-an-issue -func (s *ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo string, number int, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// DeleteIssueReaction deletes the reaction to an issue. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-an-issue-reaction -func (s *ReactionsService) DeleteIssueReaction(ctx context.Context, owner, repo string, issueNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repos/%v/%v/issues/%v/reactions/%v", owner, repo, issueNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -// DeleteIssueReactionByID deletes the reaction to an issue by repository ID. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-an-issue-reaction -func (s *ReactionsService) DeleteIssueReactionByID(ctx context.Context, repoID, issueNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repositories/%v/issues/%v/reactions/%v", repoID, issueNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -// ListIssueCommentReactions lists the reactions for an issue comment. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#list-reactions-for-an-issue-comment -func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// CreateIssueCommentReaction creates a reaction for an issue comment. -// Note that if you have already created a reaction of type content, the -// previously created reaction will be returned with Status: 200 OK. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#create-reaction-for-an-issue-comment -func (s *ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// DeleteIssueCommentReaction deletes the reaction to an issue comment. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-an-issue-comment-reaction -func (s *ReactionsService) DeleteIssueCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions/%v", owner, repo, commentID, reactionID) - - return s.deleteReaction(ctx, url) -} - -// DeleteIssueCommentReactionByID deletes the reaction to an issue comment by repository ID. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-an-issue-comment-reaction -func (s *ReactionsService) DeleteIssueCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repositories/%v/issues/comments/%v/reactions/%v", repoID, commentID, reactionID) - - return s.deleteReaction(ctx, url) -} - -// ListPullRequestCommentReactions lists the reactions for a pull request review comment. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#list-reactions-for-a-pull-request-review-comment -func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// CreatePullRequestCommentReaction creates a reaction for a pull request review comment. -// Note that if you have already created a reaction of type content, the -// previously created reaction will be returned with Status: 200 OK. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#create-reaction-for-a-pull-request-review-comment -func (s *ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// DeletePullRequestCommentReaction deletes the reaction to a pull request review comment. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-a-pull-request-comment-reaction -func (s *ReactionsService) DeletePullRequestCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions/%v", owner, repo, commentID, reactionID) - - return s.deleteReaction(ctx, url) -} - -// DeletePullRequestCommentReactionByID deletes the reaction to a pull request review comment by repository ID. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-a-pull-request-comment-reaction -func (s *ReactionsService) DeletePullRequestCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repositories/%v/pulls/comments/%v/reactions/%v", repoID, commentID, reactionID) - - return s.deleteReaction(ctx, url) -} - -// ListTeamDiscussionReactions lists the reactions for a team discussion. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#list-reactions-for-a-team-discussion-legacy -func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, teamID int64, discussionNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// CreateTeamDiscussionReaction creates a reaction for a team discussion. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#create-reaction-for-a-team-discussion-legacy -func (s *ReactionsService) CreateTeamDiscussionReaction(ctx context.Context, teamID int64, discussionNumber int, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - req.Header.Set("Accept", mediaTypeReactionsPreview) - - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// DeleteTeamDiscussionReaction deletes the reaction to a team discussion. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-team-discussion-reaction -func (s *ReactionsService) DeleteTeamDiscussionReaction(ctx context.Context, org, teamSlug string, discussionNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/reactions/%v", org, teamSlug, discussionNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -// DeleteTeamDiscussionReactionByOrgIDAndTeamID deletes the reaction to a team discussion by organization ID and team ID. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-team-discussion-reaction -func (s *ReactionsService) DeleteTeamDiscussionReactionByOrgIDAndTeamID(ctx context.Context, orgID, teamID, discussionNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/reactions/%v", orgID, teamID, discussionNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -// ListTeamDiscussionCommentReactions lists the reactions for a team discussion comment. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#list-reactions-for-a-team-discussion-comment-legacy -func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Context, teamID int64, discussionNumber, commentNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, nil, err - } - return m, resp, nil -} - -// CreateTeamDiscussionCommentReaction creates a reaction for a team discussion comment. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#create-reaction-for-a-team-discussion-comment-legacy -func (s *ReactionsService) CreateTeamDiscussionCommentReaction(ctx context.Context, teamID int64, discussionNumber, commentNumber int, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - req.Header.Set("Accept", mediaTypeReactionsPreview) - - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// DeleteTeamDiscussionCommentReaction deletes the reaction to a team discussion comment. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-team-discussion-comment-reaction -func (s *ReactionsService) DeleteTeamDiscussionCommentReaction(ctx context.Context, org, teamSlug string, discussionNumber, commentNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v/reactions/%v", org, teamSlug, discussionNumber, commentNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -// DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID deletes the reaction to a team discussion comment by organization ID and team ID. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#delete-team-discussion-comment-reaction -func (s *ReactionsService) DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID(ctx context.Context, orgID, teamID, discussionNumber, commentNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v/reactions/%v", orgID, teamID, discussionNumber, commentNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -func (s *ReactionsService) deleteReaction(ctx context.Context, url string) (*Response, error) { - req, err := s.client.NewRequest(http.MethodDelete, url, nil) - if err != nil { - return nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - return s.client.Do(ctx, req, nil) -} -` +//go:embed testdata/reactions-want.go +var reactionsGoFileWant string diff --git a/update-urls/testdata/activity-events.html b/update-urls/testdata/activity-events.html new file mode 100644 index 00000000000..90eac2f59ff --- /dev/null +++ b/update-urls/testdata/activity-events.html @@ -0,0 +1,5686 @@ + + + Activity - GitHub Docs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    +
    + + + +
    +
    + +
    + + + Article version: GitHub.com + + + + +
    + + +
    +
    + + +
    +
    + +
    + +
    +
    +

    Activity

    +
    + +
    +
    + + + + + + + + +
    +
    +
    + +

    In this article

    + + +
    + +
    +

    + Did this doc help you? +

    +

    + + + + +

    + + + + + +

    + + +

    + + +
    + +
    +
    +
    +
    + +

    Events

    +

    The Events API is a read-only API to the GitHub events. These events power the various activity streams on the site.

    +

    The Events API can return different types of events triggered by activity on GitHub. For more information about the specific events that you can receive from the Events API, see "GitHub Event types." An events API for repository issues is also available. For more information, see the "Issue Events API."

    +

    Events are optimized for polling with the "ETag" header. If no new events have been triggered, you will see a "304 Not Modified" response, and your current rate limit will be untouched. There is also an "X-Poll-Interval" header that specifies how often (in seconds) you are allowed to poll. In times of high server load, the time may increase. Please obey the header.

    +
    $ curl -I https://api.github.com/users/tater/events
    +> HTTP/1.1 200 OK
    +> X-Poll-Interval: 60
    +> ETag: "a18c3bded88eb5dbb5c849a489412bf3"
    +
    +# The quotes around the ETag value are important
    +$ curl -I https://api.github.com/users/tater/events \
    +$    -H 'If-None-Match: "a18c3bded88eb5dbb5c849a489412bf3"'
    +> HTTP/1.1 304 Not Modified
    +> X-Poll-Interval: 60
    +

    Events support pagination, however the per_page option is unsupported. The fixed page size is 30 items. Fetching up to ten pages is supported, for a total of 300 events. For information, see "Traversing with pagination."

    +

    Only events created within the past 90 days will be included in timelines. Events older than 90 days will not be included (even if the total number of events in the timeline is less than 300).

    +
    +
    +

    + List public events +

    +

    We delay the public events feed by five minutes, which means the most recent event returned by the public events API actually occurred at least five minutes ago.

    +
    +
    get /events
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    Setting to application/vnd.github.v3+json is recommended

    + +
    per_pageintegerquery +

    Results per page (max 100)

    + +
    pageintegerquery +

    Page number of the results to fetch.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -H "Accept: application/vnd.github.v3+json" \
    +  https://api.github.com/events
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('GET /events')
    +
    + + + + +

    Response

    +
    Status: 200 OK
    +
    + + +

    Notes

    + + + +
    +
    +
    +
    + +
    get /networks/{owner}/{repo}/events
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    Setting to application/vnd.github.v3+json is recommended

    + +
    ownerstringpath + + +
    repostringpath + + +
    per_pageintegerquery +

    Results per page (max 100)

    + +
    pageintegerquery +

    Page number of the results to fetch.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -H "Accept: application/vnd.github.v3+json" \
    +  https://api.github.com/networks/octocat/hello-world/events
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('GET /networks/{owner}/{repo}/events', {
    +  owner: 'octocat',
    +  repo: 'hello-world'
    +})
    +
    + + + + +

    Response

    +
    Status: 200 OK
    +
    + + +

    Notes

    + + + +
    +
    +
    +
    + +
    get /orgs/{org}/events
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    Setting to application/vnd.github.v3+json is recommended

    + +
    orgstringpath + + +
    per_pageintegerquery +

    Results per page (max 100)

    + +
    pageintegerquery +

    Page number of the results to fetch.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -H "Accept: application/vnd.github.v3+json" \
    +  https://api.github.com/orgs/ORG/events
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('GET /orgs/{org}/events', {
    +  org: 'org'
    +})
    +
    + + + + +

    Response

    +
    Status: 200 OK
    +
    + + +

    Notes

    + + + +
    +
    +
    +
    + +
    get /repos/{owner}/{repo}/events
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    Setting to application/vnd.github.v3+json is recommended

    + +
    ownerstringpath + + +
    repostringpath + + +
    per_pageintegerquery +

    Results per page (max 100)

    + +
    pageintegerquery +

    Page number of the results to fetch.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -H "Accept: application/vnd.github.v3+json" \
    +  https://api.github.com/repos/octocat/hello-world/events
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('GET /repos/{owner}/{repo}/events', {
    +  owner: 'octocat',
    +  repo: 'hello-world'
    +})
    +
    + + + + +

    Response

    +
    Status: 200 OK
    +
    + + +

    Notes

    + + + +
    +
    +
    +
    +
    +

    + List events for the authenticated user +

    +

    If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events.

    +
    +
    get /users/{username}/events
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    Setting to application/vnd.github.v3+json is recommended

    + +
    usernamestringpath + + +
    per_pageintegerquery +

    Results per page (max 100)

    + +
    pageintegerquery +

    Page number of the results to fetch.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -H "Accept: application/vnd.github.v3+json" \
    +  https://api.github.com/users/USERNAME/events
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('GET /users/{username}/events', {
    +  username: 'username'
    +})
    +
    + + + + +

    Response

    +
    Status: 200 OK
    +
    + + +

    Notes

    + + + +
    +
    +
    +
    +
    +

    + List organization events for the authenticated user +

    +

    This is the user's organization dashboard. You must be authenticated as the user to view this.

    +
    +
    get /users/{username}/events/orgs/{org}
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    Setting to application/vnd.github.v3+json is recommended

    + +
    usernamestringpath + + +
    orgstringpath + + +
    per_pageintegerquery +

    Results per page (max 100)

    + +
    pageintegerquery +

    Page number of the results to fetch.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -H "Accept: application/vnd.github.v3+json" \
    +  https://api.github.com/users/USERNAME/events/orgs/ORG
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('GET /users/{username}/events/orgs/{org}', {
    +  username: 'username',
    +  org: 'org'
    +})
    +
    + + + + +

    Response

    +
    Status: 200 OK
    +
    + + + +
    +
    +
    +
    + +
    get /users/{username}/events/public
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    Setting to application/vnd.github.v3+json is recommended

    + +
    usernamestringpath + + +
    per_pageintegerquery +

    Results per page (max 100)

    + +
    pageintegerquery +

    Page number of the results to fetch.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -H "Accept: application/vnd.github.v3+json" \
    +  https://api.github.com/users/USERNAME/events/public
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('GET /users/{username}/events/public', {
    +  username: 'username'
    +})
    +
    + + + + +

    Response

    +
    Status: 200 OK
    +
    + + +

    Notes

    + + + +
    +
    +
    +
    +
    +

    + List events received by the authenticated user +

    +

    These are events that you've received by watching repos and following users. If you are authenticated as the given user, you will see private events. Otherwise, you'll only see public events.

    +
    +
    get /users/{username}/received_events
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    Setting to application/vnd.github.v3+json is recommended

    + +
    usernamestringpath + + +
    per_pageintegerquery +

    Results per page (max 100)

    + +
    pageintegerquery +

    Page number of the results to fetch.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -H "Accept: application/vnd.github.v3+json" \
    +  https://api.github.com/users/USERNAME/received_events
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('GET /users/{username}/received_events', {
    +  username: 'username'
    +})
    +
    + + + + +

    Response

    +
    Status: 200 OK
    +
    + + +

    Notes

    + + + +
    +
    +
    +
    + +
    get /users/{username}/received_events/public
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    Setting to application/vnd.github.v3+json is recommended

    + +
    usernamestringpath + + +
    per_pageintegerquery +

    Results per page (max 100)

    + +
    pageintegerquery +

    Page number of the results to fetch.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -H "Accept: application/vnd.github.v3+json" \
    +  https://api.github.com/users/USERNAME/received_events/public
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('GET /users/{username}/received_events/public', {
    +  username: 'username'
    +})
    +
    + + + + +

    Response

    +
    Status: 200 OK
    +
    + + +

    Notes

    + + + +
    +
    +
    +

    Feeds

    +
    +
    +

    + Get feeds +

    +

    GitHub provides several timeline resources in Atom format. The Feeds API lists all the feeds available to the authenticated user:

    +
      +
    • Timeline: The GitHub global public timeline
    • +
    • User: The public timeline for any user, using URI template
    • +
    • Current user public: The public timeline for the authenticated user
    • +
    • Current user: The private timeline for the authenticated user
    • +
    • Current user actor: The private timeline for activity created by the authenticated user
    • +
    • Current user organizations: The private timeline for the organizations the authenticated user is a member of.
    • +
    • Security advisories: A collection of public announcements that provide information about security-related vulnerabilities in software on GitHub.
    • +
    +

    Note: Private feeds are only returned when authenticating via Basic Auth since current feed URIs use the older, non revocable auth tokens.

    +
    +
    get /feeds
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    Setting to application/vnd.github.v3+json is recommended

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -H "Accept: application/vnd.github.v3+json" \
    +  https://api.github.com/feeds
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('GET /feeds')
    +
    + + + + +

    Default response

    +
    Status: 200 OK
    +
    {
    +  "timeline_url": "https://github.com/timeline",
    +  "user_url": "https://github.com/{user}",
    +  "current_user_public_url": "https://github.com/octocat",
    +  "current_user_url": "https://github.com/octocat.private?token=abc123",
    +  "current_user_actor_url": "https://github.com/octocat.private.actor?token=abc123",
    +  "current_user_organization_url": "",
    +  "current_user_organization_urls": [
    +    "https://github.com/organizations/github/octocat.private.atom?token=abc123"
    +  ],
    +  "security_advisories_url": "https://github.com/security-advisories",
    +  "_links": {
    +    "timeline": {
    +      "href": "https://github.com/timeline",
    +      "type": "application/atom+xml"
    +    },
    +    "user": {
    +      "href": "https://github.com/{user}",
    +      "type": "application/atom+xml"
    +    },
    +    "current_user_public": {
    +      "href": "https://github.com/octocat",
    +      "type": "application/atom+xml"
    +    },
    +    "current_user": {
    +      "href": "https://github.com/octocat.private?token=abc123",
    +      "type": "application/atom+xml"
    +    },
    +    "current_user_actor": {
    +      "href": "https://github.com/octocat.private.actor?token=abc123",
    +      "type": "application/atom+xml"
    +    },
    +    "current_user_organization": {
    +      "href": "",
    +      "type": ""
    +    },
    +    "current_user_organizations": [
    +      {
    +        "href": "https://github.com/organizations/github/octocat.private.atom?token=abc123",
    +        "type": "application/atom+xml"
    +      }
    +    ],
    +    "security_advisories": {
    +      "href": "https://github.com/security-advisories",
    +      "type": "application/atom+xml"
    +    }
    +  }
    +}
    +
    + + +

    Notes

    + + + +
    +
    +
    +

    Example of getting an Atom feed

    +

    To get a feed in Atom format, you must specify the application/atom+xml type in the Accept header. For example, to get the Atom feed for GitHub security advisories:

    +
    curl -H "Accept: application/atom+xml" https://github.com/security-advisories
    +
    +

    Response

    +
    Status: 200 OK
    +
    <?xml version="1.0" encoding="UTF-8"?>
    +<feed xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xml:lang="en-US">
    +  <id>tag:github.com,2008:/security-advisories</id>
    +  <link rel="self" type="application/atom+xml" href="https://github.com/security-advisories.atom"/>
    +  <title>GitHub Security Advisory Feed</title>
    +  <author>
    +    <name>GitHub</name>
    +  </author>
    +  <updated>2019-01-14T19:34:52Z</updated>
    +     <entry>
    +      <id>tag:github.com,2008:GHSA-abcd-12ab-23cd</id>
    +      <published>2018-07-26T15:14:52Z</published>
    +      <updated>2019-01-14T19:34:52Z</updated>
    +      <title type="html">[GHSA-abcd-12ab-23cd] Moderate severity vulnerability that affects Octoapp</title>
    +        <category term="NPM"/>
    +      <content type="html">
    +        &lt;p&gt;Octoapp node module before 4.17.5 suffers from a Modification of Assumed-Immutable Data (MAID) vulnerability via defaultsDeep, merge, and mergeWith functions, which allows a malicious user to modify the prototype of &quot;Object&quot; via &lt;strong&gt;proto&lt;/strong&gt;, causing the addition or modification of an existing property that will exist on all objects.&lt;/p&gt;
    +          &lt;p&gt;&lt;strong&gt;Affected Packages&lt;/strong&gt;&lt;/p&gt;
    +
    +  &lt;dl&gt;
    +      &lt;dt&gt;Octoapp&lt;/dt&gt;
    +      &lt;dd&gt;Ecosystem: npm&lt;/dd&gt;
    +      &lt;dd&gt;Severity: moderate&lt;/dd&gt;
    +      &lt;dd&gt;Versions: &amp;lt; 4.17.5&lt;/dd&gt;
    +        &lt;dd&gt;Fixed in: 4.17.5&lt;/dd&gt;
    +  &lt;/dl&gt;
    +
    +          &lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;
    +
    +  &lt;ul&gt;
    +      &lt;li&gt;https://nvd.nist.gov/vuln/detail/CVE-2018-123&lt;/li&gt;
    +  &lt;/ul&gt;
    +
    +      </content>
    +    </entry>
    +</feed>
    +
    +

    Notifications

    +

    Users receive notifications for conversations in repositories they watch including:

    +
      +
    • Issues and their comments
    • +
    • Pull Requests and their comments
    • +
    • Comments on any commits
    • +
    +

    Notifications are also sent for conversations in unwatched repositories when the user is involved including:

    +
      +
    • @mentions
    • +
    • Issue assignments
    • +
    • Commits the user authors or commits
    • +
    • Any discussion in which the user actively participates
    • +
    +

    All Notification API calls require the notifications or repo API scopes. Doing this will give read-only access to some issue and commit content. You will still need the repo scope to access issues and commits from their respective endpoints.

    +

    Notifications come back as "threads". A thread contains information about the current discussion of an issue, pull request, or commit.

    +

    Notifications are optimized for polling with the Last-Modified header. If there are no new notifications, you will see a 304 Not Modified response, leaving your current rate limit untouched. There is an X-Poll-Interval header that specifies how often (in seconds) you are allowed to poll. In times of high server load, the time may increase. Please obey the header.

    +
    # Add authentication to your requests
    +$ curl -I https://api.github.com/notifications
    +HTTP/1.1 200 OK
    +Last-Modified: Thu, 25 Oct 2012 15:16:27 GMT
    +X-Poll-Interval: 60
    +
    +# Pass the Last-Modified header exactly
    +$ curl -I https://api.github.com/notifications
    +$    -H "If-Modified-Since: Thu, 25 Oct 2012 15:16:27 GMT"
    +> HTTP/1.1 304 Not Modified
    +> X-Poll-Interval: 60
    +

    Notification reasons

    +

    When retrieving responses from the Notifications API, each payload has a key titled reason. These correspond to events that trigger a notification.

    +

    Here's a list of potential reasons for receiving a notification:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Reason NameDescription
    assignYou were assigned to the issue.
    authorYou created the thread.
    commentYou commented on the thread.
    invitationYou accepted an invitation to contribute to the repository.
    manualYou subscribed to the thread (via an issue or pull request).
    mentionYou were specifically @mentioned in the content.
    review_requestedYou, or a team you're a member of, were requested to review a pull request.
    security_alertGitHub discovered a security vulnerability in your repository.
    state_changeYou changed the thread state (for example, closing an issue or merging a pull request).
    subscribedYou're watching the repository.
    team_mentionYou were on a team that was mentioned.
    +

    Note that the reason is modified on a per-thread basis, and can change, if the reason on a later notification is different.

    +

    For example, if you are the author of an issue, subsequent notifications on that issue will have a reason of author. If you're then @mentioned on the same issue, the notifications you fetch thereafter will have a reason of mention. The reason remains as mention, regardless of whether you're ever mentioned again.

    +
    +
    +

    + List notifications for the authenticated user +

    +

    List all notifications for the current user, sorted by most recently updated.

    +
    +
    get /notifications
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    Setting to application/vnd.github.v3+json is recommended

    + +
    allbooleanquery +

    If true, show notifications marked as read.

    + +
    participatingbooleanquery +

    If true, only shows notifications in which the user is directly participating or mentioned.

    + +
    sincestringquery +

    Only show notifications updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

    + +
    beforestringquery +

    Only show notifications updated before the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

    + +
    per_pageintegerquery +

    Results per page (max 100)

    + +
    pageintegerquery +

    Page number of the results to fetch.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -H "Accept: application/vnd.github.v3+json" \
    +  https://api.github.com/notifications
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('GET /notifications')
    +
    + + + + +

    Default response

    +
    Status: 200 OK
    +
    [
    +  {
    +    "id": "1",
    +    "repository": {
    +      "id": 1296269,
    +      "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
    +      "name": "Hello-World",
    +      "full_name": "octocat/Hello-World",
    +      "owner": {
    +        "login": "octocat",
    +        "id": 1,
    +        "node_id": "MDQ6VXNlcjE=",
    +        "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    +        "gravatar_id": "",
    +        "url": "https://api.github.com/users/octocat",
    +        "html_url": "https://github.com/octocat",
    +        "followers_url": "https://api.github.com/users/octocat/followers",
    +        "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    +        "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    +        "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    +        "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    +        "organizations_url": "https://api.github.com/users/octocat/orgs",
    +        "repos_url": "https://api.github.com/users/octocat/repos",
    +        "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    +        "received_events_url": "https://api.github.com/users/octocat/received_events",
    +        "type": "User",
    +        "site_admin": false
    +      },
    +      "private": false,
    +      "html_url": "https://github.com/octocat/Hello-World",
    +      "description": "This your first repo!",
    +      "fork": false,
    +      "url": "https://api.github.com/repos/octocat/Hello-World",
    +      "archive_url": "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
    +      "assignees_url": "http://api.github.com/repos/octocat/Hello-World/assignees{/user}",
    +      "blobs_url": "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
    +      "branches_url": "http://api.github.com/repos/octocat/Hello-World/branches{/branch}",
    +      "collaborators_url": "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
    +      "comments_url": "http://api.github.com/repos/octocat/Hello-World/comments{/number}",
    +      "commits_url": "http://api.github.com/repos/octocat/Hello-World/commits{/sha}",
    +      "compare_url": "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
    +      "contents_url": "http://api.github.com/repos/octocat/Hello-World/contents/{+path}",
    +      "contributors_url": "http://api.github.com/repos/octocat/Hello-World/contributors",
    +      "deployments_url": "http://api.github.com/repos/octocat/Hello-World/deployments",
    +      "downloads_url": "http://api.github.com/repos/octocat/Hello-World/downloads",
    +      "events_url": "http://api.github.com/repos/octocat/Hello-World/events",
    +      "forks_url": "http://api.github.com/repos/octocat/Hello-World/forks",
    +      "git_commits_url": "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
    +      "git_refs_url": "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
    +      "git_tags_url": "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
    +      "git_url": "git:github.com/octocat/Hello-World.git",
    +      "issue_comment_url": "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
    +      "issue_events_url": "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
    +      "issues_url": "http://api.github.com/repos/octocat/Hello-World/issues{/number}",
    +      "keys_url": "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
    +      "labels_url": "http://api.github.com/repos/octocat/Hello-World/labels{/name}",
    +      "languages_url": "http://api.github.com/repos/octocat/Hello-World/languages",
    +      "merges_url": "http://api.github.com/repos/octocat/Hello-World/merges",
    +      "milestones_url": "http://api.github.com/repos/octocat/Hello-World/milestones{/number}",
    +      "notifications_url": "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
    +      "pulls_url": "http://api.github.com/repos/octocat/Hello-World/pulls{/number}",
    +      "releases_url": "http://api.github.com/repos/octocat/Hello-World/releases{/id}",
    +      "ssh_url": "git@github.com:octocat/Hello-World.git",
    +      "stargazers_url": "http://api.github.com/repos/octocat/Hello-World/stargazers",
    +      "statuses_url": "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
    +      "subscribers_url": "http://api.github.com/repos/octocat/Hello-World/subscribers",
    +      "subscription_url": "http://api.github.com/repos/octocat/Hello-World/subscription",
    +      "tags_url": "http://api.github.com/repos/octocat/Hello-World/tags",
    +      "teams_url": "http://api.github.com/repos/octocat/Hello-World/teams",
    +      "trees_url": "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}"
    +    },
    +    "subject": {
    +      "title": "Greetings",
    +      "url": "https://api.github.com/repos/octokit/octokit.rb/issues/123",
    +      "latest_comment_url": "https://api.github.com/repos/octokit/octokit.rb/issues/comments/123",
    +      "type": "Issue"
    +    },
    +    "reason": "subscribed",
    +    "unread": true,
    +    "updated_at": "2014-11-07T22:01:45Z",
    +    "last_read_at": "2014-11-07T22:01:45Z",
    +    "url": "https://api.github.com/notifications/threads/1"
    +  }
    +]
    +
    + + + +
    +
    +
    +
    +
    +

    + Mark notifications as read +

    +

    Marks all notifications as "read" removes it from the default view on GitHub. If the number of notifications is too large to complete in one request, you will receive a 202 Accepted status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the List notifications for the authenticated user endpoint and pass the query parameter all=false.

    +
    +
    put /notifications
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    Setting to application/vnd.github.v3+json is recommended

    + +
    last_read_atstringbody +

    Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. Default: The current timestamp.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -X PUT \
    +  -H "Accept: application/vnd.github.v3+json" \
    +  https://api.github.com/notifications \
    +  -d '{"last_read_at":"last_read_at"}'
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('PUT /notifications', {
    +  last_read_at: 'last_read_at'
    +})
    +
    + + + + +

    Response

    +
    Status: 205 Reset Content
    +
    + + + +
    +
    +
    +
    +
    +

    + Get a thread +

    + +
    +
    get /notifications/threads/{thread_id}
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    Setting to application/vnd.github.v3+json is recommended

    + +
    thread_idintegerpath + + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -H "Accept: application/vnd.github.v3+json" \
    +  https://api.github.com/notifications/threads/42
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('GET /notifications/threads/{thread_id}', {
    +  thread_id: 42
    +})
    +
    + + + + +

    Default response

    +
    Status: 200 OK
    +
    {
    +  "id": "1",
    +  "repository": {
    +    "id": 1296269,
    +    "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
    +    "name": "Hello-World",
    +    "full_name": "octocat/Hello-World",
    +    "owner": {
    +      "login": "octocat",
    +      "id": 1,
    +      "node_id": "MDQ6VXNlcjE=",
    +      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    +      "gravatar_id": "",
    +      "url": "https://api.github.com/users/octocat",
    +      "html_url": "https://github.com/octocat",
    +      "followers_url": "https://api.github.com/users/octocat/followers",
    +      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    +      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    +      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    +      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    +      "organizations_url": "https://api.github.com/users/octocat/orgs",
    +      "repos_url": "https://api.github.com/users/octocat/repos",
    +      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    +      "received_events_url": "https://api.github.com/users/octocat/received_events",
    +      "type": "User",
    +      "site_admin": false
    +    },
    +    "private": false,
    +    "html_url": "https://github.com/octocat/Hello-World",
    +    "description": "This your first repo!",
    +    "fork": false,
    +    "url": "https://api.github.com/repos/octocat/Hello-World",
    +    "archive_url": "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
    +    "assignees_url": "http://api.github.com/repos/octocat/Hello-World/assignees{/user}",
    +    "blobs_url": "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
    +    "branches_url": "http://api.github.com/repos/octocat/Hello-World/branches{/branch}",
    +    "collaborators_url": "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
    +    "comments_url": "http://api.github.com/repos/octocat/Hello-World/comments{/number}",
    +    "commits_url": "http://api.github.com/repos/octocat/Hello-World/commits{/sha}",
    +    "compare_url": "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
    +    "contents_url": "http://api.github.com/repos/octocat/Hello-World/contents/{+path}",
    +    "contributors_url": "http://api.github.com/repos/octocat/Hello-World/contributors",
    +    "deployments_url": "http://api.github.com/repos/octocat/Hello-World/deployments",
    +    "downloads_url": "http://api.github.com/repos/octocat/Hello-World/downloads",
    +    "events_url": "http://api.github.com/repos/octocat/Hello-World/events",
    +    "forks_url": "http://api.github.com/repos/octocat/Hello-World/forks",
    +    "git_commits_url": "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
    +    "git_refs_url": "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
    +    "git_tags_url": "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
    +    "git_url": "git:github.com/octocat/Hello-World.git",
    +    "issue_comment_url": "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
    +    "issue_events_url": "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
    +    "issues_url": "http://api.github.com/repos/octocat/Hello-World/issues{/number}",
    +    "keys_url": "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
    +    "labels_url": "http://api.github.com/repos/octocat/Hello-World/labels{/name}",
    +    "languages_url": "http://api.github.com/repos/octocat/Hello-World/languages",
    +    "merges_url": "http://api.github.com/repos/octocat/Hello-World/merges",
    +    "milestones_url": "http://api.github.com/repos/octocat/Hello-World/milestones{/number}",
    +    "notifications_url": "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
    +    "pulls_url": "http://api.github.com/repos/octocat/Hello-World/pulls{/number}",
    +    "releases_url": "http://api.github.com/repos/octocat/Hello-World/releases{/id}",
    +    "ssh_url": "git@github.com:octocat/Hello-World.git",
    +    "stargazers_url": "http://api.github.com/repos/octocat/Hello-World/stargazers",
    +    "statuses_url": "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
    +    "subscribers_url": "http://api.github.com/repos/octocat/Hello-World/subscribers",
    +    "subscription_url": "http://api.github.com/repos/octocat/Hello-World/subscription",
    +    "tags_url": "http://api.github.com/repos/octocat/Hello-World/tags",
    +    "teams_url": "http://api.github.com/repos/octocat/Hello-World/teams",
    +    "trees_url": "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}"
    +  },
    +  "subject": {
    +    "title": "Greetings",
    +    "url": "https://api.github.com/repos/octokit/octokit.rb/issues/123",
    +    "latest_comment_url": "https://api.github.com/repos/octokit/octokit.rb/issues/comments/123",
    +    "type": "Issue"
    +  },
    +  "reason": "subscribed",
    +  "unread": true,
    +  "updated_at": "2014-11-07T22:01:45Z",
    +  "last_read_at": "2014-11-07T22:01:45Z",
    +  "url": "https://api.github.com/notifications/threads/1"
    +}
    +
    + + + +
    +
    +
    +
    + +
    patch /notifications/threads/{thread_id}
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    Setting to application/vnd.github.v3+json is recommended

    + +
    thread_idintegerpath + + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -X PATCH \
    +  -H "Accept: application/vnd.github.v3+json" \
    +  https://api.github.com/notifications/threads/42
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('PATCH /notifications/threads/{thread_id}', {
    +  thread_id: 42
    +})
    +
    + + + + +

    Response

    +
    Status: 205 Reset Content
    +
    + + + +
    +
    +
    +
    +
    +

    + Get a thread subscription for the authenticated user +

    +

    This checks to see if the current user is subscribed to a thread. You can also get a repository subscription.

    +

    Note that subscriptions are only generated if a user is participating in a conversation--for example, they've replied to the thread, were @mentioned, or manually subscribe to a thread.

    +
    +
    get /notifications/threads/{thread_id}/subscription
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    Setting to application/vnd.github.v3+json is recommended

    + +
    thread_idintegerpath + + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -H "Accept: application/vnd.github.v3+json" \
    +  https://api.github.com/notifications/threads/42/subscription
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('GET /notifications/threads/{thread_id}/subscription', {
    +  thread_id: 42
    +})
    +
    + + + + +

    Default response

    +
    Status: 200 OK
    +
    {
    +  "subscribed": true,
    +  "ignored": false,
    +  "reason": null,
    +  "created_at": "2012-10-06T21:34:12Z",
    +  "url": "https://api.github.com/notifications/threads/1/subscription",
    +  "thread_url": "https://api.github.com/notifications/threads/1"
    +}
    +
    + + + +
    +
    +
    +
    +
    +

    + Set a thread subscription +

    +

    If you are watching a repository, you receive notifications for all threads by default. Use this endpoint to ignore future notifications for threads until you comment on the thread or get an @mention.

    +

    You can also use this endpoint to subscribe to threads that you are currently not receiving notifications for or to subscribed to threads that you have previously ignored.

    +

    Unsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the Delete a thread subscription endpoint.

    +
    +
    put /notifications/threads/{thread_id}/subscription
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    Setting to application/vnd.github.v3+json is recommended

    + +
    thread_idintegerpath + + +
    ignoredbooleanbody +

    Unsubscribes and subscribes you to a conversation. Set ignored to true to block all notifications from this thread.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -X PUT \
    +  -H "Accept: application/vnd.github.v3+json" \
    +  https://api.github.com/notifications/threads/42/subscription \
    +  -d '{"ignored":true}'
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('PUT /notifications/threads/{thread_id}/subscription', {
    +  thread_id: 42,
    +  ignored: true
    +})
    +
    + + + + +

    Default response

    +
    Status: 200 OK
    +
    {
    +  "subscribed": true,
    +  "ignored": false,
    +  "reason": null,
    +  "created_at": "2012-10-06T21:34:12Z",
    +  "url": "https://api.github.com/notifications/threads/1/subscription",
    +  "thread_url": "https://api.github.com/notifications/threads/1"
    +}
    +
    + + + +
    +
    +
    +
    +
    +

    + Delete a thread subscription +

    +

    Mutes all future notifications for a conversation until you comment on the thread or get an @mention. If you are watching the repository of the thread, you will still receive notifications. To ignore future notifications for a repository you are watching, use the Set a thread subscription endpoint and set ignore to true.

    +
    +
    delete /notifications/threads/{thread_id}/subscription
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    Setting to application/vnd.github.v3+json is recommended

    + +
    thread_idintegerpath + + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -X DELETE \
    +  -H "Accept: application/vnd.github.v3+json" \
    +  https://api.github.com/notifications/threads/42/subscription
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('DELETE /notifications/threads/{thread_id}/subscription', {
    +  thread_id: 42
    +})
    +
    + + + + +

    Default Response

    +
    Status: 204 No Content
    +
    + + + +
    +
    +
    +
    +
    +

    + List repository notifications for the authenticated user +

    +

    List all notifications for the current user.

    +
    +
    get /repos/{owner}/{repo}/notifications
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    Setting to application/vnd.github.v3+json is recommended

    + +
    ownerstringpath + + +
    repostringpath + + +
    allbooleanquery +

    If true, show notifications marked as read.

    + +
    participatingbooleanquery +

    If true, only shows notifications in which the user is directly participating or mentioned.

    + +
    sincestringquery +

    Only show notifications updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

    + +
    beforestringquery +

    Only show notifications updated before the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

    + +
    per_pageintegerquery +

    Results per page (max 100)

    + +
    pageintegerquery +

    Page number of the results to fetch.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -H "Accept: application/vnd.github.v3+json" \
    +  https://api.github.com/repos/octocat/hello-world/notifications
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('GET /repos/{owner}/{repo}/notifications', {
    +  owner: 'octocat',
    +  repo: 'hello-world'
    +})
    +
    + + + + +

    Default response

    +
    Status: 200 OK
    +
    [
    +  {
    +    "id": "1",
    +    "repository": {
    +      "id": 1296269,
    +      "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
    +      "name": "Hello-World",
    +      "full_name": "octocat/Hello-World",
    +      "owner": {
    +        "login": "octocat",
    +        "id": 1,
    +        "node_id": "MDQ6VXNlcjE=",
    +        "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    +        "gravatar_id": "",
    +        "url": "https://api.github.com/users/octocat",
    +        "html_url": "https://github.com/octocat",
    +        "followers_url": "https://api.github.com/users/octocat/followers",
    +        "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    +        "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    +        "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    +        "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    +        "organizations_url": "https://api.github.com/users/octocat/orgs",
    +        "repos_url": "https://api.github.com/users/octocat/repos",
    +        "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    +        "received_events_url": "https://api.github.com/users/octocat/received_events",
    +        "type": "User",
    +        "site_admin": false
    +      },
    +      "private": false,
    +      "html_url": "https://github.com/octocat/Hello-World",
    +      "description": "This your first repo!",
    +      "fork": false,
    +      "url": "https://api.github.com/repos/octocat/Hello-World",
    +      "archive_url": "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
    +      "assignees_url": "http://api.github.com/repos/octocat/Hello-World/assignees{/user}",
    +      "blobs_url": "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
    +      "branches_url": "http://api.github.com/repos/octocat/Hello-World/branches{/branch}",
    +      "collaborators_url": "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
    +      "comments_url": "http://api.github.com/repos/octocat/Hello-World/comments{/number}",
    +      "commits_url": "http://api.github.com/repos/octocat/Hello-World/commits{/sha}",
    +      "compare_url": "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
    +      "contents_url": "http://api.github.com/repos/octocat/Hello-World/contents/{+path}",
    +      "contributors_url": "http://api.github.com/repos/octocat/Hello-World/contributors",
    +      "deployments_url": "http://api.github.com/repos/octocat/Hello-World/deployments",
    +      "downloads_url": "http://api.github.com/repos/octocat/Hello-World/downloads",
    +      "events_url": "http://api.github.com/repos/octocat/Hello-World/events",
    +      "forks_url": "http://api.github.com/repos/octocat/Hello-World/forks",
    +      "git_commits_url": "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
    +      "git_refs_url": "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
    +      "git_tags_url": "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
    +      "git_url": "git:github.com/octocat/Hello-World.git",
    +      "issue_comment_url": "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
    +      "issue_events_url": "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
    +      "issues_url": "http://api.github.com/repos/octocat/Hello-World/issues{/number}",
    +      "keys_url": "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
    +      "labels_url": "http://api.github.com/repos/octocat/Hello-World/labels{/name}",
    +      "languages_url": "http://api.github.com/repos/octocat/Hello-World/languages",
    +      "merges_url": "http://api.github.com/repos/octocat/Hello-World/merges",
    +      "milestones_url": "http://api.github.com/repos/octocat/Hello-World/milestones{/number}",
    +      "notifications_url": "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
    +      "pulls_url": "http://api.github.com/repos/octocat/Hello-World/pulls{/number}",
    +      "releases_url": "http://api.github.com/repos/octocat/Hello-World/releases{/id}",
    +      "ssh_url": "git@github.com:octocat/Hello-World.git",
    +      "stargazers_url": "http://api.github.com/repos/octocat/Hello-World/stargazers",
    +      "statuses_url": "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
    +      "subscribers_url": "http://api.github.com/repos/octocat/Hello-World/subscribers",
    +      "subscription_url": "http://api.github.com/repos/octocat/Hello-World/subscription",
    +      "tags_url": "http://api.github.com/repos/octocat/Hello-World/tags",
    +      "teams_url": "http://api.github.com/repos/octocat/Hello-World/teams",
    +      "trees_url": "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}"
    +    },
    +    "subject": {
    +      "title": "Greetings",
    +      "url": "https://api.github.com/repos/octokit/octokit.rb/issues/123",
    +      "latest_comment_url": "https://api.github.com/repos/octokit/octokit.rb/issues/comments/123",
    +      "type": "Issue"
    +    },
    +    "reason": "subscribed",
    +    "unread": true,
    +    "updated_at": "2014-11-07T22:01:45Z",
    +    "last_read_at": "2014-11-07T22:01:45Z",
    +    "url": "https://api.github.com/notifications/threads/1"
    +  }
    +]
    +
    + + + +
    +
    +
    +
    +
    +

    + Mark repository notifications as read +

    +

    Marks all notifications in a repository as "read" removes them from the default view on GitHub. If the number of notifications is too large to complete in one request, you will receive a 202 Accepted status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the List repository notifications for the authenticated user endpoint and pass the query parameter all=false.

    +
    +
    put /repos/{owner}/{repo}/notifications
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    Setting to application/vnd.github.v3+json is recommended

    + +
    ownerstringpath + + +
    repostringpath + + +
    last_read_atstringbody +

    Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. Default: The current timestamp.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -X PUT \
    +  -H "Accept: application/vnd.github.v3+json" \
    +  https://api.github.com/repos/octocat/hello-world/notifications \
    +  -d '{"last_read_at":"last_read_at"}'
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('PUT /repos/{owner}/{repo}/notifications', {
    +  owner: 'octocat',
    +  repo: 'hello-world',
    +  last_read_at: 'last_read_at'
    +})
    +
    + + + + +

    Response

    +
    Status: 205 Reset Content
    +
    + + + +
    +
    +
    +

    Starring

    +

    Repository starring is a feature that lets users bookmark repositories. Stars are shown next to repositories to show an approximate level of interest. Stars have no effect on notifications or the activity feed.

    +

    Starring vs. Watching

    +

    In August 2012, we changed the way watching +works on GitHub. Many API +client applications may be using the original "watcher" endpoints for accessing +this data. You can now start using the "star" endpoints instead (described +below). For more information, see the Watcher API Change post and the "Repository Watching API."

    +

    Custom media types for starring

    +

    There is one supported custom media type for the Starring REST API. When you use this custom media type, you will receive a response with the starred_at timestamp property that indicates the time the star was created. The response also has a second property that includes the resource that is returned when the custom media type is not included. The property that contains the resource will be either user or repo.

    +
    application/vnd.github.v3.star+json
    +
    +

    For more information about media types, see "Custom media types."

    +
    +
    +

    + List stargazers +

    +

    Lists the people that have starred the repository.

    +

    You can also find out when stars were created by passing the following custom media type via the Accept header:

    +
    +
    get /repos/{owner}/{repo}/stargazers
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    Setting to application/vnd.github.v3+json is recommended

    + +
    ownerstringpath + + +
    repostringpath + + +
    per_pageintegerquery +

    Results per page (max 100)

    + +
    pageintegerquery +

    Page number of the results to fetch.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -H "Accept: application/vnd.github.v3+json" \
    +  https://api.github.com/repos/octocat/hello-world/stargazers
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('GET /repos/{owner}/{repo}/stargazers', {
    +  owner: 'octocat',
    +  repo: 'hello-world'
    +})
    +
    + + + + +

    Default response

    +
    Status: 200 OK
    +
    [
    +  {
    +    "login": "octocat",
    +    "id": 1,
    +    "node_id": "MDQ6VXNlcjE=",
    +    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    +    "gravatar_id": "",
    +    "url": "https://api.github.com/users/octocat",
    +    "html_url": "https://github.com/octocat",
    +    "followers_url": "https://api.github.com/users/octocat/followers",
    +    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    +    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    +    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    +    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    +    "organizations_url": "https://api.github.com/users/octocat/orgs",
    +    "repos_url": "https://api.github.com/users/octocat/repos",
    +    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    +    "received_events_url": "https://api.github.com/users/octocat/received_events",
    +    "type": "User",
    +    "site_admin": false
    +  }
    +]
    +
    + + +

    Notes

    + + + +
    +
    +
    +
    +
    +

    + List repositories starred by the authenticated user +

    +

    Lists repositories the authenticated user has starred.

    +

    You can also find out when stars were created by passing the following custom media type via the Accept header:

    +
    +
    get /user/starred
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    Setting to application/vnd.github.v3+json is recommended

    + +
    sortstringquery +

    One of created (when the repository was starred) or updated (when it was last pushed to).

    + +
    directionstringquery +

    One of asc (ascending) or desc (descending).

    + +
    per_pageintegerquery +

    Results per page (max 100)

    + +
    pageintegerquery +

    Page number of the results to fetch.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -H "Accept: application/vnd.github.v3+json" \
    +  https://api.github.com/user/starred
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('GET /user/starred')
    +
    + + + + +

    Default response

    +
    Status: 200 OK
    +
    [
    +  {
    +    "id": 1296269,
    +    "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
    +    "name": "Hello-World",
    +    "full_name": "octocat/Hello-World",
    +    "owner": {
    +      "login": "octocat",
    +      "id": 1,
    +      "node_id": "MDQ6VXNlcjE=",
    +      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    +      "gravatar_id": "",
    +      "url": "https://api.github.com/users/octocat",
    +      "html_url": "https://github.com/octocat",
    +      "followers_url": "https://api.github.com/users/octocat/followers",
    +      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    +      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    +      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    +      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    +      "organizations_url": "https://api.github.com/users/octocat/orgs",
    +      "repos_url": "https://api.github.com/users/octocat/repos",
    +      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    +      "received_events_url": "https://api.github.com/users/octocat/received_events",
    +      "type": "User",
    +      "site_admin": false
    +    },
    +    "private": false,
    +    "html_url": "https://github.com/octocat/Hello-World",
    +    "description": "This your first repo!",
    +    "fork": false,
    +    "url": "https://api.github.com/repos/octocat/Hello-World",
    +    "archive_url": "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
    +    "assignees_url": "http://api.github.com/repos/octocat/Hello-World/assignees{/user}",
    +    "blobs_url": "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
    +    "branches_url": "http://api.github.com/repos/octocat/Hello-World/branches{/branch}",
    +    "collaborators_url": "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
    +    "comments_url": "http://api.github.com/repos/octocat/Hello-World/comments{/number}",
    +    "commits_url": "http://api.github.com/repos/octocat/Hello-World/commits{/sha}",
    +    "compare_url": "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
    +    "contents_url": "http://api.github.com/repos/octocat/Hello-World/contents/{+path}",
    +    "contributors_url": "http://api.github.com/repos/octocat/Hello-World/contributors",
    +    "deployments_url": "http://api.github.com/repos/octocat/Hello-World/deployments",
    +    "downloads_url": "http://api.github.com/repos/octocat/Hello-World/downloads",
    +    "events_url": "http://api.github.com/repos/octocat/Hello-World/events",
    +    "forks_url": "http://api.github.com/repos/octocat/Hello-World/forks",
    +    "git_commits_url": "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
    +    "git_refs_url": "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
    +    "git_tags_url": "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
    +    "git_url": "git:github.com/octocat/Hello-World.git",
    +    "issue_comment_url": "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
    +    "issue_events_url": "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
    +    "issues_url": "http://api.github.com/repos/octocat/Hello-World/issues{/number}",
    +    "keys_url": "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
    +    "labels_url": "http://api.github.com/repos/octocat/Hello-World/labels{/name}",
    +    "languages_url": "http://api.github.com/repos/octocat/Hello-World/languages",
    +    "merges_url": "http://api.github.com/repos/octocat/Hello-World/merges",
    +    "milestones_url": "http://api.github.com/repos/octocat/Hello-World/milestones{/number}",
    +    "notifications_url": "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
    +    "pulls_url": "http://api.github.com/repos/octocat/Hello-World/pulls{/number}",
    +    "releases_url": "http://api.github.com/repos/octocat/Hello-World/releases{/id}",
    +    "ssh_url": "git@github.com:octocat/Hello-World.git",
    +    "stargazers_url": "http://api.github.com/repos/octocat/Hello-World/stargazers",
    +    "statuses_url": "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
    +    "subscribers_url": "http://api.github.com/repos/octocat/Hello-World/subscribers",
    +    "subscription_url": "http://api.github.com/repos/octocat/Hello-World/subscription",
    +    "tags_url": "http://api.github.com/repos/octocat/Hello-World/tags",
    +    "teams_url": "http://api.github.com/repos/octocat/Hello-World/teams",
    +    "trees_url": "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
    +    "clone_url": "https://github.com/octocat/Hello-World.git",
    +    "mirror_url": "git:git.example.com/octocat/Hello-World",
    +    "hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks",
    +    "svn_url": "https://svn.github.com/octocat/Hello-World",
    +    "homepage": "https://github.com",
    +    "language": null,
    +    "forks_count": 9,
    +    "stargazers_count": 80,
    +    "watchers_count": 80,
    +    "size": 108,
    +    "default_branch": "master",
    +    "open_issues_count": 0,
    +    "is_template": true,
    +    "topics": [
    +      "octocat",
    +      "atom",
    +      "electron",
    +      "api"
    +    ],
    +    "has_issues": true,
    +    "has_projects": true,
    +    "has_wiki": true,
    +    "has_pages": false,
    +    "has_downloads": true,
    +    "archived": false,
    +    "disabled": false,
    +    "visibility": "public",
    +    "pushed_at": "2011-01-26T19:06:43Z",
    +    "created_at": "2011-01-26T19:01:12Z",
    +    "updated_at": "2011-01-26T19:14:43Z",
    +    "permissions": {
    +      "admin": false,
    +      "push": false,
    +      "pull": true
    +    },
    +    "allow_rebase_merge": true,
    +    "template_repository": null,
    +    "temp_clone_token": "ABTLWHOULUVAXGTRYU7OC2876QJ2O",
    +    "allow_squash_merge": true,
    +    "delete_branch_on_merge": true,
    +    "allow_merge_commit": true,
    +    "subscribers_count": 42,
    +    "network_count": 0
    +  }
    +]
    +
    + + + +
    +
    +
    +
    + +
    get /user/starred/{owner}/{repo}
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    Setting to application/vnd.github.v3+json is recommended

    + +
    ownerstringpath + + +
    repostringpath + + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -H "Accept: application/vnd.github.v3+json" \
    +  https://api.github.com/user/starred/octocat/hello-world
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('GET /user/starred/{owner}/{repo}', {
    +  owner: 'octocat',
    +  repo: 'hello-world'
    +})
    +
    + + + + +

    Response if this repository is starred by you

    +
    Status: 204 No Content
    +
    + +

    Response if this repository is not starred by you

    +
    Status: 404 Not Found
    +
    + + + +
    +
    +
    +
    +
    +

    + Star a repository for the authenticated user +

    +

    Note that you'll need to set Content-Length to zero when calling out to this endpoint. For more information, see "HTTP verbs."

    +
    +
    put /user/starred/{owner}/{repo}
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    Setting to application/vnd.github.v3+json is recommended

    + +
    ownerstringpath + + +
    repostringpath + + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -X PUT \
    +  -H "Accept: application/vnd.github.v3+json" \
    +  https://api.github.com/user/starred/octocat/hello-world
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('PUT /user/starred/{owner}/{repo}', {
    +  owner: 'octocat',
    +  repo: 'hello-world'
    +})
    +
    + + + + +

    Default Response

    +
    Status: 204 No Content
    +
    + + + +
    +
    +
    +
    + +
    delete /user/starred/{owner}/{repo}
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    Setting to application/vnd.github.v3+json is recommended

    + +
    ownerstringpath + + +
    repostringpath + + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -X DELETE \
    +  -H "Accept: application/vnd.github.v3+json" \
    +  https://api.github.com/user/starred/octocat/hello-world
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('DELETE /user/starred/{owner}/{repo}', {
    +  owner: 'octocat',
    +  repo: 'hello-world'
    +})
    +
    + + + + +

    Default Response

    +
    Status: 204 No Content
    +
    + + + +
    +
    +
    +
    +
    +

    + List repositories starred by a user +

    +

    Lists repositories a user has starred.

    +

    You can also find out when stars were created by passing the following custom media type via the Accept header:

    +
    +
    get /users/{username}/starred
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    Setting to application/vnd.github.v3+json is recommended

    + +
    usernamestringpath + + +
    sortstringquery +

    One of created (when the repository was starred) or updated (when it was last pushed to).

    + +
    directionstringquery +

    One of asc (ascending) or desc (descending).

    + +
    per_pageintegerquery +

    Results per page (max 100)

    + +
    pageintegerquery +

    Page number of the results to fetch.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -H "Accept: application/vnd.github.v3+json" \
    +  https://api.github.com/users/USERNAME/starred
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('GET /users/{username}/starred', {
    +  username: 'username'
    +})
    +
    + + + + +

    Default response

    +
    Status: 200 OK
    +
    [
    +  {
    +    "id": 1296269,
    +    "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
    +    "name": "Hello-World",
    +    "full_name": "octocat/Hello-World",
    +    "owner": {
    +      "login": "octocat",
    +      "id": 1,
    +      "node_id": "MDQ6VXNlcjE=",
    +      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    +      "gravatar_id": "",
    +      "url": "https://api.github.com/users/octocat",
    +      "html_url": "https://github.com/octocat",
    +      "followers_url": "https://api.github.com/users/octocat/followers",
    +      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    +      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    +      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    +      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    +      "organizations_url": "https://api.github.com/users/octocat/orgs",
    +      "repos_url": "https://api.github.com/users/octocat/repos",
    +      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    +      "received_events_url": "https://api.github.com/users/octocat/received_events",
    +      "type": "User",
    +      "site_admin": false
    +    },
    +    "private": false,
    +    "html_url": "https://github.com/octocat/Hello-World",
    +    "description": "This your first repo!",
    +    "fork": false,
    +    "url": "https://api.github.com/repos/octocat/Hello-World",
    +    "archive_url": "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
    +    "assignees_url": "http://api.github.com/repos/octocat/Hello-World/assignees{/user}",
    +    "blobs_url": "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
    +    "branches_url": "http://api.github.com/repos/octocat/Hello-World/branches{/branch}",
    +    "collaborators_url": "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
    +    "comments_url": "http://api.github.com/repos/octocat/Hello-World/comments{/number}",
    +    "commits_url": "http://api.github.com/repos/octocat/Hello-World/commits{/sha}",
    +    "compare_url": "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
    +    "contents_url": "http://api.github.com/repos/octocat/Hello-World/contents/{+path}",
    +    "contributors_url": "http://api.github.com/repos/octocat/Hello-World/contributors",
    +    "deployments_url": "http://api.github.com/repos/octocat/Hello-World/deployments",
    +    "downloads_url": "http://api.github.com/repos/octocat/Hello-World/downloads",
    +    "events_url": "http://api.github.com/repos/octocat/Hello-World/events",
    +    "forks_url": "http://api.github.com/repos/octocat/Hello-World/forks",
    +    "git_commits_url": "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
    +    "git_refs_url": "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
    +    "git_tags_url": "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
    +    "git_url": "git:github.com/octocat/Hello-World.git",
    +    "issue_comment_url": "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
    +    "issue_events_url": "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
    +    "issues_url": "http://api.github.com/repos/octocat/Hello-World/issues{/number}",
    +    "keys_url": "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
    +    "labels_url": "http://api.github.com/repos/octocat/Hello-World/labels{/name}",
    +    "languages_url": "http://api.github.com/repos/octocat/Hello-World/languages",
    +    "merges_url": "http://api.github.com/repos/octocat/Hello-World/merges",
    +    "milestones_url": "http://api.github.com/repos/octocat/Hello-World/milestones{/number}",
    +    "notifications_url": "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
    +    "pulls_url": "http://api.github.com/repos/octocat/Hello-World/pulls{/number}",
    +    "releases_url": "http://api.github.com/repos/octocat/Hello-World/releases{/id}",
    +    "ssh_url": "git@github.com:octocat/Hello-World.git",
    +    "stargazers_url": "http://api.github.com/repos/octocat/Hello-World/stargazers",
    +    "statuses_url": "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
    +    "subscribers_url": "http://api.github.com/repos/octocat/Hello-World/subscribers",
    +    "subscription_url": "http://api.github.com/repos/octocat/Hello-World/subscription",
    +    "tags_url": "http://api.github.com/repos/octocat/Hello-World/tags",
    +    "teams_url": "http://api.github.com/repos/octocat/Hello-World/teams",
    +    "trees_url": "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
    +    "clone_url": "https://github.com/octocat/Hello-World.git",
    +    "mirror_url": "git:git.example.com/octocat/Hello-World",
    +    "hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks",
    +    "svn_url": "https://svn.github.com/octocat/Hello-World",
    +    "homepage": "https://github.com",
    +    "language": null,
    +    "forks_count": 9,
    +    "stargazers_count": 80,
    +    "watchers_count": 80,
    +    "size": 108,
    +    "default_branch": "master",
    +    "open_issues_count": 0,
    +    "is_template": true,
    +    "topics": [
    +      "octocat",
    +      "atom",
    +      "electron",
    +      "api"
    +    ],
    +    "has_issues": true,
    +    "has_projects": true,
    +    "has_wiki": true,
    +    "has_pages": false,
    +    "has_downloads": true,
    +    "archived": false,
    +    "disabled": false,
    +    "visibility": "public",
    +    "pushed_at": "2011-01-26T19:06:43Z",
    +    "created_at": "2011-01-26T19:01:12Z",
    +    "updated_at": "2011-01-26T19:14:43Z",
    +    "permissions": {
    +      "admin": false,
    +      "push": false,
    +      "pull": true
    +    },
    +    "allow_rebase_merge": true,
    +    "template_repository": null,
    +    "temp_clone_token": "ABTLWHOULUVAXGTRYU7OC2876QJ2O",
    +    "allow_squash_merge": true,
    +    "delete_branch_on_merge": true,
    +    "allow_merge_commit": true,
    +    "subscribers_count": 42,
    +    "network_count": 0
    +  }
    +]
    +
    + + +

    Notes

    + + + +
    +
    +
    +

    Watching

    +

    Watching a repository registers the user to receive notifications on new discussions, as well as events in the user's activity feed. For simple repository bookmarks, see "Repository starring."

    +
    +
    +

    + List watchers +

    +

    Lists the people watching the specified repository.

    +
    +
    get /repos/{owner}/{repo}/subscribers
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    Setting to application/vnd.github.v3+json is recommended

    + +
    ownerstringpath + + +
    repostringpath + + +
    per_pageintegerquery +

    Results per page (max 100)

    + +
    pageintegerquery +

    Page number of the results to fetch.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -H "Accept: application/vnd.github.v3+json" \
    +  https://api.github.com/repos/octocat/hello-world/subscribers
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('GET /repos/{owner}/{repo}/subscribers', {
    +  owner: 'octocat',
    +  repo: 'hello-world'
    +})
    +
    + + + + +

    Default response

    +
    Status: 200 OK
    +
    [
    +  {
    +    "login": "octocat",
    +    "id": 1,
    +    "node_id": "MDQ6VXNlcjE=",
    +    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    +    "gravatar_id": "",
    +    "url": "https://api.github.com/users/octocat",
    +    "html_url": "https://github.com/octocat",
    +    "followers_url": "https://api.github.com/users/octocat/followers",
    +    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    +    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    +    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    +    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    +    "organizations_url": "https://api.github.com/users/octocat/orgs",
    +    "repos_url": "https://api.github.com/users/octocat/repos",
    +    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    +    "received_events_url": "https://api.github.com/users/octocat/received_events",
    +    "type": "User",
    +    "site_admin": false
    +  }
    +]
    +
    + + +

    Notes

    + + + +
    +
    +
    +
    + +
    get /repos/{owner}/{repo}/subscription
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    Setting to application/vnd.github.v3+json is recommended

    + +
    ownerstringpath + + +
    repostringpath + + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -H "Accept: application/vnd.github.v3+json" \
    +  https://api.github.com/repos/octocat/hello-world/subscription
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('GET /repos/{owner}/{repo}/subscription', {
    +  owner: 'octocat',
    +  repo: 'hello-world'
    +})
    +
    + + + + +

    Response if you subscribe to the repository

    +
    Status: 200 OK
    +
    {
    +  "subscribed": true,
    +  "ignored": false,
    +  "reason": null,
    +  "created_at": "2012-10-06T21:34:12Z",
    +  "url": "https://api.github.com/repos/octocat/example/subscription",
    +  "repository_url": "https://api.github.com/repos/octocat/example"
    +}
    +
    + +

    Response if you don t subscribe to the repository

    +
    Status: 404 Not Found
    +
    + + + +
    +
    +
    +
    +
    +

    + Set a repository subscription +

    +

    If you would like to watch a repository, set subscribed to true. If you would like to ignore notifications made within a repository, set ignored to true. If you would like to stop watching a repository, delete the repository's subscription completely.

    +
    +
    put /repos/{owner}/{repo}/subscription
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    Setting to application/vnd.github.v3+json is recommended

    + +
    ownerstringpath + + +
    repostringpath + + +
    subscribedbooleanbody +

    Determines if notifications should be received from this repository.

    + +
    ignoredbooleanbody +

    Determines if all notifications should be blocked from this repository.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -X PUT \
    +  -H "Accept: application/vnd.github.v3+json" \
    +  https://api.github.com/repos/octocat/hello-world/subscription \
    +  -d '{"subscribed":true}'
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('PUT /repos/{owner}/{repo}/subscription', {
    +  owner: 'octocat',
    +  repo: 'hello-world',
    +  subscribed: true
    +})
    +
    + + + + +

    Default response

    +
    Status: 200 OK
    +
    {
    +  "subscribed": true,
    +  "ignored": false,
    +  "reason": null,
    +  "created_at": "2012-10-06T21:34:12Z",
    +  "url": "https://api.github.com/repos/octocat/example/subscription",
    +  "repository_url": "https://api.github.com/repos/octocat/example"
    +}
    +
    + + + +
    +
    +
    +
    +
    +

    + Delete a repository subscription +

    +

    This endpoint should only be used to stop watching a repository. To control whether or not you wish to receive notifications from a repository, set the repository's subscription manually.

    +
    +
    delete /repos/{owner}/{repo}/subscription
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    Setting to application/vnd.github.v3+json is recommended

    + +
    ownerstringpath + + +
    repostringpath + + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -X DELETE \
    +  -H "Accept: application/vnd.github.v3+json" \
    +  https://api.github.com/repos/octocat/hello-world/subscription
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('DELETE /repos/{owner}/{repo}/subscription', {
    +  owner: 'octocat',
    +  repo: 'hello-world'
    +})
    +
    + + + + +

    Default Response

    +
    Status: 204 No Content
    +
    + + + +
    +
    +
    +
    +
    +

    + List repositories watched by the authenticated user +

    +

    Lists repositories the authenticated user is watching.

    +
    +
    get /user/subscriptions
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    Setting to application/vnd.github.v3+json is recommended

    + +
    per_pageintegerquery +

    Results per page (max 100)

    + +
    pageintegerquery +

    Page number of the results to fetch.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -H "Accept: application/vnd.github.v3+json" \
    +  https://api.github.com/user/subscriptions
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('GET /user/subscriptions')
    +
    + + + + +

    Default response

    +
    Status: 200 OK
    +
    [
    +  {
    +    "id": 1296269,
    +    "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
    +    "name": "Hello-World",
    +    "full_name": "octocat/Hello-World",
    +    "owner": {
    +      "login": "octocat",
    +      "id": 1,
    +      "node_id": "MDQ6VXNlcjE=",
    +      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    +      "gravatar_id": "",
    +      "url": "https://api.github.com/users/octocat",
    +      "html_url": "https://github.com/octocat",
    +      "followers_url": "https://api.github.com/users/octocat/followers",
    +      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    +      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    +      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    +      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    +      "organizations_url": "https://api.github.com/users/octocat/orgs",
    +      "repos_url": "https://api.github.com/users/octocat/repos",
    +      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    +      "received_events_url": "https://api.github.com/users/octocat/received_events",
    +      "type": "User",
    +      "site_admin": false
    +    },
    +    "private": false,
    +    "html_url": "https://github.com/octocat/Hello-World",
    +    "description": "This your first repo!",
    +    "fork": false,
    +    "url": "https://api.github.com/repos/octocat/Hello-World",
    +    "archive_url": "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
    +    "assignees_url": "http://api.github.com/repos/octocat/Hello-World/assignees{/user}",
    +    "blobs_url": "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
    +    "branches_url": "http://api.github.com/repos/octocat/Hello-World/branches{/branch}",
    +    "collaborators_url": "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
    +    "comments_url": "http://api.github.com/repos/octocat/Hello-World/comments{/number}",
    +    "commits_url": "http://api.github.com/repos/octocat/Hello-World/commits{/sha}",
    +    "compare_url": "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
    +    "contents_url": "http://api.github.com/repos/octocat/Hello-World/contents/{+path}",
    +    "contributors_url": "http://api.github.com/repos/octocat/Hello-World/contributors",
    +    "deployments_url": "http://api.github.com/repos/octocat/Hello-World/deployments",
    +    "downloads_url": "http://api.github.com/repos/octocat/Hello-World/downloads",
    +    "events_url": "http://api.github.com/repos/octocat/Hello-World/events",
    +    "forks_url": "http://api.github.com/repos/octocat/Hello-World/forks",
    +    "git_commits_url": "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
    +    "git_refs_url": "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
    +    "git_tags_url": "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
    +    "git_url": "git:github.com/octocat/Hello-World.git",
    +    "issue_comment_url": "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
    +    "issue_events_url": "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
    +    "issues_url": "http://api.github.com/repos/octocat/Hello-World/issues{/number}",
    +    "keys_url": "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
    +    "labels_url": "http://api.github.com/repos/octocat/Hello-World/labels{/name}",
    +    "languages_url": "http://api.github.com/repos/octocat/Hello-World/languages",
    +    "merges_url": "http://api.github.com/repos/octocat/Hello-World/merges",
    +    "milestones_url": "http://api.github.com/repos/octocat/Hello-World/milestones{/number}",
    +    "notifications_url": "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
    +    "pulls_url": "http://api.github.com/repos/octocat/Hello-World/pulls{/number}",
    +    "releases_url": "http://api.github.com/repos/octocat/Hello-World/releases{/id}",
    +    "ssh_url": "git@github.com:octocat/Hello-World.git",
    +    "stargazers_url": "http://api.github.com/repos/octocat/Hello-World/stargazers",
    +    "statuses_url": "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
    +    "subscribers_url": "http://api.github.com/repos/octocat/Hello-World/subscribers",
    +    "subscription_url": "http://api.github.com/repos/octocat/Hello-World/subscription",
    +    "tags_url": "http://api.github.com/repos/octocat/Hello-World/tags",
    +    "teams_url": "http://api.github.com/repos/octocat/Hello-World/teams",
    +    "trees_url": "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
    +    "clone_url": "https://github.com/octocat/Hello-World.git",
    +    "mirror_url": "git:git.example.com/octocat/Hello-World",
    +    "hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks",
    +    "svn_url": "https://svn.github.com/octocat/Hello-World",
    +    "homepage": "https://github.com",
    +    "language": null,
    +    "forks_count": 9,
    +    "stargazers_count": 80,
    +    "watchers_count": 80,
    +    "size": 108,
    +    "default_branch": "master",
    +    "open_issues_count": 0,
    +    "is_template": true,
    +    "topics": [
    +      "octocat",
    +      "atom",
    +      "electron",
    +      "api"
    +    ],
    +    "has_issues": true,
    +    "has_projects": true,
    +    "has_wiki": true,
    +    "has_pages": false,
    +    "has_downloads": true,
    +    "archived": false,
    +    "disabled": false,
    +    "visibility": "public",
    +    "pushed_at": "2011-01-26T19:06:43Z",
    +    "created_at": "2011-01-26T19:01:12Z",
    +    "updated_at": "2011-01-26T19:14:43Z",
    +    "permissions": {
    +      "admin": false,
    +      "push": false,
    +      "pull": true
    +    },
    +    "template_repository": null,
    +    "temp_clone_token": "ABTLWHOULUVAXGTRYU7OC2876QJ2O",
    +    "delete_branch_on_merge": true,
    +    "subscribers_count": 42,
    +    "network_count": 0,
    +    "license": {
    +      "key": "mit",
    +      "name": "MIT License",
    +      "spdx_id": "MIT",
    +      "url": "https://api.github.com/licenses/mit",
    +      "node_id": "MDc6TGljZW5zZW1pdA=="
    +    }
    +  }
    +]
    +
    + + + +
    +
    +
    +
    +
    +

    + List repositories watched by a user +

    +

    Lists repositories a user is watching.

    +
    +
    get /users/{username}/subscriptions
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    Setting to application/vnd.github.v3+json is recommended

    + +
    usernamestringpath + + +
    per_pageintegerquery +

    Results per page (max 100)

    + +
    pageintegerquery +

    Page number of the results to fetch.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -H "Accept: application/vnd.github.v3+json" \
    +  https://api.github.com/users/USERNAME/subscriptions
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('GET /users/{username}/subscriptions', {
    +  username: 'username'
    +})
    +
    + + + + +

    Default response

    +
    Status: 200 OK
    +
    [
    +  {
    +    "id": 1296269,
    +    "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
    +    "name": "Hello-World",
    +    "full_name": "octocat/Hello-World",
    +    "owner": {
    +      "login": "octocat",
    +      "id": 1,
    +      "node_id": "MDQ6VXNlcjE=",
    +      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    +      "gravatar_id": "",
    +      "url": "https://api.github.com/users/octocat",
    +      "html_url": "https://github.com/octocat",
    +      "followers_url": "https://api.github.com/users/octocat/followers",
    +      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    +      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    +      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    +      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    +      "organizations_url": "https://api.github.com/users/octocat/orgs",
    +      "repos_url": "https://api.github.com/users/octocat/repos",
    +      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    +      "received_events_url": "https://api.github.com/users/octocat/received_events",
    +      "type": "User",
    +      "site_admin": false
    +    },
    +    "private": false,
    +    "html_url": "https://github.com/octocat/Hello-World",
    +    "description": "This your first repo!",
    +    "fork": false,
    +    "url": "https://api.github.com/repos/octocat/Hello-World",
    +    "archive_url": "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
    +    "assignees_url": "http://api.github.com/repos/octocat/Hello-World/assignees{/user}",
    +    "blobs_url": "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
    +    "branches_url": "http://api.github.com/repos/octocat/Hello-World/branches{/branch}",
    +    "collaborators_url": "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
    +    "comments_url": "http://api.github.com/repos/octocat/Hello-World/comments{/number}",
    +    "commits_url": "http://api.github.com/repos/octocat/Hello-World/commits{/sha}",
    +    "compare_url": "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
    +    "contents_url": "http://api.github.com/repos/octocat/Hello-World/contents/{+path}",
    +    "contributors_url": "http://api.github.com/repos/octocat/Hello-World/contributors",
    +    "deployments_url": "http://api.github.com/repos/octocat/Hello-World/deployments",
    +    "downloads_url": "http://api.github.com/repos/octocat/Hello-World/downloads",
    +    "events_url": "http://api.github.com/repos/octocat/Hello-World/events",
    +    "forks_url": "http://api.github.com/repos/octocat/Hello-World/forks",
    +    "git_commits_url": "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
    +    "git_refs_url": "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
    +    "git_tags_url": "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
    +    "git_url": "git:github.com/octocat/Hello-World.git",
    +    "issue_comment_url": "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
    +    "issue_events_url": "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
    +    "issues_url": "http://api.github.com/repos/octocat/Hello-World/issues{/number}",
    +    "keys_url": "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
    +    "labels_url": "http://api.github.com/repos/octocat/Hello-World/labels{/name}",
    +    "languages_url": "http://api.github.com/repos/octocat/Hello-World/languages",
    +    "merges_url": "http://api.github.com/repos/octocat/Hello-World/merges",
    +    "milestones_url": "http://api.github.com/repos/octocat/Hello-World/milestones{/number}",
    +    "notifications_url": "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
    +    "pulls_url": "http://api.github.com/repos/octocat/Hello-World/pulls{/number}",
    +    "releases_url": "http://api.github.com/repos/octocat/Hello-World/releases{/id}",
    +    "ssh_url": "git@github.com:octocat/Hello-World.git",
    +    "stargazers_url": "http://api.github.com/repos/octocat/Hello-World/stargazers",
    +    "statuses_url": "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
    +    "subscribers_url": "http://api.github.com/repos/octocat/Hello-World/subscribers",
    +    "subscription_url": "http://api.github.com/repos/octocat/Hello-World/subscription",
    +    "tags_url": "http://api.github.com/repos/octocat/Hello-World/tags",
    +    "teams_url": "http://api.github.com/repos/octocat/Hello-World/teams",
    +    "trees_url": "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
    +    "clone_url": "https://github.com/octocat/Hello-World.git",
    +    "mirror_url": "git:git.example.com/octocat/Hello-World",
    +    "hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks",
    +    "svn_url": "https://svn.github.com/octocat/Hello-World",
    +    "homepage": "https://github.com",
    +    "language": null,
    +    "forks_count": 9,
    +    "stargazers_count": 80,
    +    "watchers_count": 80,
    +    "size": 108,
    +    "default_branch": "master",
    +    "open_issues_count": 0,
    +    "is_template": true,
    +    "topics": [
    +      "octocat",
    +      "atom",
    +      "electron",
    +      "api"
    +    ],
    +    "has_issues": true,
    +    "has_projects": true,
    +    "has_wiki": true,
    +    "has_pages": false,
    +    "has_downloads": true,
    +    "archived": false,
    +    "disabled": false,
    +    "visibility": "public",
    +    "pushed_at": "2011-01-26T19:06:43Z",
    +    "created_at": "2011-01-26T19:01:12Z",
    +    "updated_at": "2011-01-26T19:14:43Z",
    +    "permissions": {
    +      "admin": false,
    +      "push": false,
    +      "pull": true
    +    },
    +    "template_repository": null,
    +    "temp_clone_token": "ABTLWHOULUVAXGTRYU7OC2876QJ2O",
    +    "delete_branch_on_merge": true,
    +    "subscribers_count": 42,
    +    "network_count": 0,
    +    "license": {
    +      "key": "mit",
    +      "name": "MIT License",
    +      "spdx_id": "MIT",
    +      "url": "https://api.github.com/licenses/mit",
    +      "node_id": "MDc6TGljZW5zZW1pdA=="
    +    }
    +  }
    +]
    +
    + + +

    Notes

    + + + +
    +
    +
    +
    +
    +
    +
    + +
    +

    + Did this doc help you? +

    +

    + + + + +

    + + + + + +

    + + +

    + + +
    + +
    +
    + + + +
    +
    +
    +
    +

    Ask a human

    +

    Can't find what you're looking for?

    + Contact us +
    +
    + +
    +
    +
    +
    + + + + + +
    + + diff --git a/update-urls/testdata/activity_events-original.go b/update-urls/testdata/activity_events-original.go new file mode 100644 index 00000000000..eec0f956de7 --- /dev/null +++ b/update-urls/testdata/activity_events-original.go @@ -0,0 +1,196 @@ +// Copyright 2013 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" +) + +// ListEvents drinks from the firehose of all public events across GitHub. +// +// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-public-events +func (s *ActivityService) ListEvents(ctx context.Context, opts *ListOptions) ([]*Event, *Response, error) { + u, err := addOptions("events", opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var events []*Event + resp, err := s.client.Do(ctx, req, &events) + if err != nil { + return nil, resp, err + } + + return events, resp, nil +} + +// ListRepositoryEvents lists events for a repository. +// +// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-repository-events +func (s *ActivityService) ListRepositoryEvents(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Event, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/events", owner, repo) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var events []*Event + resp, err := s.client.Do(ctx, req, &events) + if err != nil { + return nil, resp, err + } + + return events, resp, nil +} + +// Note that ActivityService.ListIssueEventsForRepository was moved to: +// IssuesService.ListRepositoryEvents. + +// ListEventsForRepoNetwork lists public events for a network of repositories. +// +// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-public-events-for-a-network-of-repositories +func (s *ActivityService) ListEventsForRepoNetwork(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Event, *Response, error) { + u := fmt.Sprintf("networks/%v/%v/events", owner, repo) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var events []*Event + resp, err := s.client.Do(ctx, req, &events) + if err != nil { + return nil, resp, err + } + + return events, resp, nil +} + +// ListEventsForOrganization lists public events for an organization. +// +// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-public-events-for-an-organization +func (s *ActivityService) ListEventsForOrganization(ctx context.Context, org string, opts *ListOptions) ([]*Event, *Response, error) { + u := fmt.Sprintf("orgs/%v/events", org) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var events []*Event + resp, err := s.client.Do(ctx, req, &events) + if err != nil { + return nil, resp, err + } + + return events, resp, nil +} + +// ListEventsPerformedByUser lists the events performed by a user. If publicOnly is +// true, only public events will be returned. +// +// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-events-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-public-events-for-a-user +func (s *ActivityService) ListEventsPerformedByUser(ctx context.Context, user string, publicOnly bool, opts *ListOptions) ([]*Event, *Response, error) { + var u string + if publicOnly { + u = fmt.Sprintf("users/%v/events/public", user) + } else { + u = fmt.Sprintf("users/%v/events", user) + } + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var events []*Event + resp, err := s.client.Do(ctx, req, &events) + if err != nil { + return nil, resp, err + } + + return events, resp, nil +} + +// ListEventsReceivedByUser lists the events received by a user. If publicOnly is +// true, only public events will be returned. +// +// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-events-received-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-public-events-received-by-a-user +func (s *ActivityService) ListEventsReceivedByUser(ctx context.Context, user string, publicOnly bool, opts *ListOptions) ([]*Event, *Response, error) { + var u string + if publicOnly { + u = fmt.Sprintf("users/%v/received_events/public", user) + } else { + u = fmt.Sprintf("users/%v/received_events", user) + } + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var events []*Event + resp, err := s.client.Do(ctx, req, &events) + if err != nil { + return nil, resp, err + } + + return events, resp, nil +} + +// ListUserEventsForOrganization provides the user’s organization dashboard. You +// must be authenticated as the user to view this. +// +// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-events-for-an-organization +func (s *ActivityService) ListUserEventsForOrganization(ctx context.Context, org, user string, opts *ListOptions) ([]*Event, *Response, error) { + u := fmt.Sprintf("users/%v/events/orgs/%v", user, org) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var events []*Event + resp, err := s.client.Do(ctx, req, &events) + if err != nil { + return nil, resp, err + } + + return events, resp, nil +} diff --git a/update-urls/testdata/activity_events-want.go b/update-urls/testdata/activity_events-want.go new file mode 100644 index 00000000000..760793e6985 --- /dev/null +++ b/update-urls/testdata/activity_events-want.go @@ -0,0 +1,196 @@ +// Copyright 2013 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" +) + +// ListEvents drinks from the firehose of all public events across GitHub. +// +// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-public-events +func (s *ActivityService) ListEvents(ctx context.Context, opts *ListOptions) ([]*Event, *Response, error) { + u, err := addOptions("events", opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var events []*Event + resp, err := s.client.Do(ctx, req, &events) + if err != nil { + return nil, resp, err + } + + return events, resp, nil +} + +// ListRepositoryEvents lists events for a repository. +// +// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-repository-events +func (s *ActivityService) ListRepositoryEvents(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Event, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/events", owner, repo) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var events []*Event + resp, err := s.client.Do(ctx, req, &events) + if err != nil { + return nil, resp, err + } + + return events, resp, nil +} + +// Note that ActivityService.ListIssueEventsForRepository was moved to: +// IssuesService.ListRepositoryEvents. + +// ListEventsForRepoNetwork lists public events for a network of repositories. +// +// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-public-events-for-a-network-of-repositories +func (s *ActivityService) ListEventsForRepoNetwork(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Event, *Response, error) { + u := fmt.Sprintf("networks/%v/%v/events", owner, repo) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var events []*Event + resp, err := s.client.Do(ctx, req, &events) + if err != nil { + return nil, resp, err + } + + return events, resp, nil +} + +// ListEventsForOrganization lists public events for an organization. +// +// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-public-organization-events +func (s *ActivityService) ListEventsForOrganization(ctx context.Context, org string, opts *ListOptions) ([]*Event, *Response, error) { + u := fmt.Sprintf("orgs/%v/events", org) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var events []*Event + resp, err := s.client.Do(ctx, req, &events) + if err != nil { + return nil, resp, err + } + + return events, resp, nil +} + +// ListEventsPerformedByUser lists the events performed by a user. If publicOnly is +// true, only public events will be returned. +// +// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-events-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-public-events-for-a-user +func (s *ActivityService) ListEventsPerformedByUser(ctx context.Context, user string, publicOnly bool, opts *ListOptions) ([]*Event, *Response, error) { + var u string + if publicOnly { + u = fmt.Sprintf("users/%v/events/public", user) + } else { + u = fmt.Sprintf("users/%v/events", user) + } + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var events []*Event + resp, err := s.client.Do(ctx, req, &events) + if err != nil { + return nil, resp, err + } + + return events, resp, nil +} + +// ListEventsReceivedByUser lists the events received by a user. If publicOnly is +// true, only public events will be returned. +// +// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-events-received-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-public-events-received-by-a-user +func (s *ActivityService) ListEventsReceivedByUser(ctx context.Context, user string, publicOnly bool, opts *ListOptions) ([]*Event, *Response, error) { + var u string + if publicOnly { + u = fmt.Sprintf("users/%v/received_events/public", user) + } else { + u = fmt.Sprintf("users/%v/received_events", user) + } + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var events []*Event + resp, err := s.client.Do(ctx, req, &events) + if err != nil { + return nil, resp, err + } + + return events, resp, nil +} + +// ListUserEventsForOrganization provides the user’s organization dashboard. You +// must be authenticated as the user to view this. +// +// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-organization-events-for-the-authenticated-user +func (s *ActivityService) ListUserEventsForOrganization(ctx context.Context, org, user string, opts *ListOptions) ([]*Event, *Response, error) { + u := fmt.Sprintf("users/%v/events/orgs/%v", user, org) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var events []*Event + resp, err := s.client.Do(ctx, req, &events) + if err != nil { + return nil, resp, err + } + + return events, resp, nil +} diff --git a/update-urls/testdata/reactions-original.go b/update-urls/testdata/reactions-original.go new file mode 100644 index 00000000000..d3e57bdb819 --- /dev/null +++ b/update-urls/testdata/reactions-original.go @@ -0,0 +1,490 @@ +// Copyright 2016 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" +) + +// ReactionsService provides access to the reactions-related functions in the +// GitHub API. +type ReactionsService service + +// Reaction represents a GitHub reaction. +type Reaction struct { + // ID is the Reaction ID. + ID *int64 `json:"id,omitempty"` + User *User `json:"user,omitempty"` + NodeID *string `json:"node_id,omitempty"` + // Content is the type of reaction. + // Possible values are: + // "+1", "-1", "laugh", "confused", "heart", "hooray". + Content *string `json:"content,omitempty"` +} + +// Reactions represents a summary of GitHub reactions. +type Reactions struct { + TotalCount *int `json:"total_count,omitempty"` + PlusOne *int `json:"+1,omitempty"` + MinusOne *int `json:"-1,omitempty"` + Laugh *int `json:"laugh,omitempty"` + Confused *int `json:"confused,omitempty"` + Heart *int `json:"heart,omitempty"` + Hooray *int `json:"hooray,omitempty"` + URL *string `json:"url,omitempty"` +} + +func (r Reaction) String() string { + return Stringify(r) +} + +// ListCommentReactionOptions specifies the optional parameters to the +// ReactionsService.ListCommentReactions method. +type ListCommentReactionOptions struct { + // Content restricts the returned comment reactions to only those with the given type. + // Omit this parameter to list all reactions to a commit comment. + // Possible values are: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". + Content string `url:"content,omitempty"` + + ListOptions +} + +// ListCommentReactions lists the reactions for a commit comment. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-a-commit-comment +func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListCommentReactionOptions) ([]*Reaction, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept headers when APIs fully launch. + req.Header.Set("Accept", mediaTypeReactionsPreview) + + var m []*Reaction + resp, err := s.client.Do(ctx, req, &m) + if err != nil { + return nil, resp, err + } + + return m, resp, nil +} + +// CreateCommentReaction creates a reaction for a commit comment. +// Note that if you have already created a reaction of type content, the +// previously created reaction will be returned with Status: 200 OK. +// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-a-commit-comment +func (s *ReactionsService) CreateCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) + + body := &Reaction{Content: String(content)} + req, err := s.client.NewRequest("POST", u, body) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept headers when APIs fully launch. + req.Header.Set("Accept", mediaTypeReactionsPreview) + + m := &Reaction{} + resp, err := s.client.Do(ctx, req, m) + if err != nil { + return nil, resp, err + } + + return m, resp, nil +} + +// DeleteCommentReaction deletes the reaction for a commit comment. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-a-commit-comment-reaction +func (s *ReactionsService) DeleteCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions/%v", owner, repo, commentID, reactionID) + + return s.deleteReaction(ctx, u) +} + +// DeleteCommentReactionByID deletes the reaction for a commit comment by repository ID. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-a-commit-comment-reaction +func (s *ReactionsService) DeleteCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { + u := fmt.Sprintf("repositories/%v/comments/%v/reactions/%v", repoID, commentID, reactionID) + + return s.deleteReaction(ctx, u) +} + +// ListIssueReactions lists the reactions for an issue. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-an-issue +func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*Reaction, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept headers when APIs fully launch. + req.Header.Set("Accept", mediaTypeReactionsPreview) + + var m []*Reaction + resp, err := s.client.Do(ctx, req, &m) + if err != nil { + return nil, resp, err + } + + return m, resp, nil +} + +// CreateIssueReaction creates a reaction for an issue. +// Note that if you have already created a reaction of type content, the +// previously created reaction will be returned with Status: 200 OK. +// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-an-issue +func (s *ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo string, number int, content string) (*Reaction, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) + + body := &Reaction{Content: String(content)} + req, err := s.client.NewRequest("POST", u, body) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept headers when APIs fully launch. + req.Header.Set("Accept", mediaTypeReactionsPreview) + + m := &Reaction{} + resp, err := s.client.Do(ctx, req, m) + if err != nil { + return nil, resp, err + } + + return m, resp, nil +} + +// DeleteIssueReaction deletes the reaction to an issue. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-an-issue-reaction +func (s *ReactionsService) DeleteIssueReaction(ctx context.Context, owner, repo string, issueNumber int, reactionID int64) (*Response, error) { + url := fmt.Sprintf("repos/%v/%v/issues/%v/reactions/%v", owner, repo, issueNumber, reactionID) + + return s.deleteReaction(ctx, url) +} + +// DeleteIssueReactionByID deletes the reaction to an issue by repository ID. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-an-issue-reaction +func (s *ReactionsService) DeleteIssueReactionByID(ctx context.Context, repoID, issueNumber int, reactionID int64) (*Response, error) { + url := fmt.Sprintf("repositories/%v/issues/%v/reactions/%v", repoID, issueNumber, reactionID) + + return s.deleteReaction(ctx, url) +} + +// ListIssueCommentReactions lists the reactions for an issue comment. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-an-issue-comment +func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*Reaction, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept headers when APIs fully launch. + req.Header.Set("Accept", mediaTypeReactionsPreview) + + var m []*Reaction + resp, err := s.client.Do(ctx, req, &m) + if err != nil { + return nil, resp, err + } + + return m, resp, nil +} + +// CreateIssueCommentReaction creates a reaction for an issue comment. +// Note that if you have already created a reaction of type content, the +// previously created reaction will be returned with Status: 200 OK. +// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-an-issue-comment +func (s *ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) + + body := &Reaction{Content: String(content)} + req, err := s.client.NewRequest("POST", u, body) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept headers when APIs fully launch. + req.Header.Set("Accept", mediaTypeReactionsPreview) + + m := &Reaction{} + resp, err := s.client.Do(ctx, req, m) + if err != nil { + return nil, resp, err + } + + return m, resp, nil +} + +// DeleteIssueCommentReaction deletes the reaction to an issue comment. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-an-issue-comment-reaction +func (s *ReactionsService) DeleteIssueCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { + url := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions/%v", owner, repo, commentID, reactionID) + + return s.deleteReaction(ctx, url) +} + +// DeleteIssueCommentReactionByID deletes the reaction to an issue comment by repository ID. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-an-issue-comment-reaction +func (s *ReactionsService) DeleteIssueCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { + url := fmt.Sprintf("repositories/%v/issues/comments/%v/reactions/%v", repoID, commentID, reactionID) + + return s.deleteReaction(ctx, url) +} + +// ListPullRequestCommentReactions lists the reactions for a pull request review comment. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-an-issue-comment +func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*Reaction, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept headers when APIs fully launch. + req.Header.Set("Accept", mediaTypeReactionsPreview) + + var m []*Reaction + resp, err := s.client.Do(ctx, req, &m) + if err != nil { + return nil, resp, err + } + + return m, resp, nil +} + +// CreatePullRequestCommentReaction creates a reaction for a pull request review comment. +// Note that if you have already created a reaction of type content, the +// previously created reaction will be returned with Status: 200 OK. +// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-an-issue-comment +func (s *ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) + + body := &Reaction{Content: String(content)} + req, err := s.client.NewRequest("POST", u, body) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept headers when APIs fully launch. + req.Header.Set("Accept", mediaTypeReactionsPreview) + + m := &Reaction{} + resp, err := s.client.Do(ctx, req, m) + if err != nil { + return nil, resp, err + } + + return m, resp, nil +} + +// DeletePullRequestCommentReaction deletes the reaction to a pull request review comment. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-a-pull-request-comment-reaction +func (s *ReactionsService) DeletePullRequestCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { + url := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions/%v", owner, repo, commentID, reactionID) + + return s.deleteReaction(ctx, url) +} + +// DeletePullRequestCommentReactionByID deletes the reaction to a pull request review comment by repository ID. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-a-pull-request-comment-reaction +func (s *ReactionsService) DeletePullRequestCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { + url := fmt.Sprintf("repositories/%v/pulls/comments/%v/reactions/%v", repoID, commentID, reactionID) + + return s.deleteReaction(ctx, url) +} + +// ListTeamDiscussionReactions lists the reactions for a team discussion. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-a-team-discussion +func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, teamID int64, discussionNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { + u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + req.Header.Set("Accept", mediaTypeReactionsPreview) + + var m []*Reaction + resp, err := s.client.Do(ctx, req, &m) + if err != nil { + return nil, resp, err + } + + return m, resp, nil +} + +// CreateTeamDiscussionReaction creates a reaction for a team discussion. +// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-a-team-discussion +func (s *ReactionsService) CreateTeamDiscussionReaction(ctx context.Context, teamID int64, discussionNumber int, content string) (*Reaction, *Response, error) { + u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) + + body := &Reaction{Content: String(content)} + req, err := s.client.NewRequest("POST", u, body) + if err != nil { + return nil, nil, err + } + + req.Header.Set("Accept", mediaTypeReactionsPreview) + + m := &Reaction{} + resp, err := s.client.Do(ctx, req, m) + if err != nil { + return nil, resp, err + } + + return m, resp, nil +} + +// DeleteTeamDiscussionReaction deletes the reaction to a team discussion. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-team-discussion-reaction +func (s *ReactionsService) DeleteTeamDiscussionReaction(ctx context.Context, org, teamSlug string, discussionNumber int, reactionID int64) (*Response, error) { + url := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/reactions/%v", org, teamSlug, discussionNumber, reactionID) + + return s.deleteReaction(ctx, url) +} + +// DeleteTeamDiscussionReactionByOrgIDAndTeamID deletes the reaction to a team discussion by organization ID and team ID. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-team-discussion-reaction +func (s *ReactionsService) DeleteTeamDiscussionReactionByOrgIDAndTeamID(ctx context.Context, orgID, teamID, discussionNumber int, reactionID int64) (*Response, error) { + url := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/reactions/%v", orgID, teamID, discussionNumber, reactionID) + + return s.deleteReaction(ctx, url) +} + +// ListTeamDiscussionCommentReactions lists the reactions for a team discussion comment. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-a-team-discussion-comment +func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Context, teamID int64, discussionNumber, commentNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { + u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + req.Header.Set("Accept", mediaTypeReactionsPreview) + + var m []*Reaction + resp, err := s.client.Do(ctx, req, &m) + if err != nil { + return nil, nil, err + } + return m, resp, nil +} + +// CreateTeamDiscussionCommentReaction creates a reaction for a team discussion comment. +// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-a-team-discussion-comment +func (s *ReactionsService) CreateTeamDiscussionCommentReaction(ctx context.Context, teamID int64, discussionNumber, commentNumber int, content string) (*Reaction, *Response, error) { + u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) + + body := &Reaction{Content: String(content)} + req, err := s.client.NewRequest("POST", u, body) + if err != nil { + return nil, nil, err + } + + req.Header.Set("Accept", mediaTypeReactionsPreview) + + m := &Reaction{} + resp, err := s.client.Do(ctx, req, m) + if err != nil { + return nil, resp, err + } + + return m, resp, nil +} + +// DeleteTeamDiscussionCommentReaction deletes the reaction to a team discussion comment. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-team-discussion-comment-reaction +func (s *ReactionsService) DeleteTeamDiscussionCommentReaction(ctx context.Context, org, teamSlug string, discussionNumber, commentNumber int, reactionID int64) (*Response, error) { + url := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v/reactions/%v", org, teamSlug, discussionNumber, commentNumber, reactionID) + + return s.deleteReaction(ctx, url) +} + +// DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID deletes the reaction to a team discussion comment by organization ID and team ID. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-team-discussion-comment-reaction +func (s *ReactionsService) DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID(ctx context.Context, orgID, teamID, discussionNumber, commentNumber int, reactionID int64) (*Response, error) { + url := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v/reactions/%v", orgID, teamID, discussionNumber, commentNumber, reactionID) + + return s.deleteReaction(ctx, url) +} + +func (s *ReactionsService) deleteReaction(ctx context.Context, url string) (*Response, error) { + req, err := s.client.NewRequest(http.MethodDelete, url, nil) + if err != nil { + return nil, err + } + + // TODO: remove custom Accept headers when APIs fully launch. + req.Header.Set("Accept", mediaTypeReactionsPreview) + + return s.client.Do(ctx, req, nil) +} diff --git a/update-urls/testdata/reactions-want.go b/update-urls/testdata/reactions-want.go new file mode 100644 index 00000000000..4e70c458706 --- /dev/null +++ b/update-urls/testdata/reactions-want.go @@ -0,0 +1,490 @@ +// Copyright 2016 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" +) + +// ReactionsService provides access to the reactions-related functions in the +// GitHub API. +type ReactionsService service + +// Reaction represents a GitHub reaction. +type Reaction struct { + // ID is the Reaction ID. + ID *int64 `json:"id,omitempty"` + User *User `json:"user,omitempty"` + NodeID *string `json:"node_id,omitempty"` + // Content is the type of reaction. + // Possible values are: + // "+1", "-1", "laugh", "confused", "heart", "hooray". + Content *string `json:"content,omitempty"` +} + +// Reactions represents a summary of GitHub reactions. +type Reactions struct { + TotalCount *int `json:"total_count,omitempty"` + PlusOne *int `json:"+1,omitempty"` + MinusOne *int `json:"-1,omitempty"` + Laugh *int `json:"laugh,omitempty"` + Confused *int `json:"confused,omitempty"` + Heart *int `json:"heart,omitempty"` + Hooray *int `json:"hooray,omitempty"` + URL *string `json:"url,omitempty"` +} + +func (r Reaction) String() string { + return Stringify(r) +} + +// ListCommentReactionOptions specifies the optional parameters to the +// ReactionsService.ListCommentReactions method. +type ListCommentReactionOptions struct { + // Content restricts the returned comment reactions to only those with the given type. + // Omit this parameter to list all reactions to a commit comment. + // Possible values are: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". + Content string `url:"content,omitempty"` + + ListOptions +} + +// ListCommentReactions lists the reactions for a commit comment. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-a-commit-comment +func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListCommentReactionOptions) ([]*Reaction, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept headers when APIs fully launch. + req.Header.Set("Accept", mediaTypeReactionsPreview) + + var m []*Reaction + resp, err := s.client.Do(ctx, req, &m) + if err != nil { + return nil, resp, err + } + + return m, resp, nil +} + +// CreateCommentReaction creates a reaction for a commit comment. +// Note that if you have already created a reaction of type content, the +// previously created reaction will be returned with Status: 200 OK. +// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-a-commit-comment +func (s *ReactionsService) CreateCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) + + body := &Reaction{Content: String(content)} + req, err := s.client.NewRequest("POST", u, body) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept headers when APIs fully launch. + req.Header.Set("Accept", mediaTypeReactionsPreview) + + m := &Reaction{} + resp, err := s.client.Do(ctx, req, m) + if err != nil { + return nil, resp, err + } + + return m, resp, nil +} + +// DeleteCommentReaction deletes the reaction for a commit comment. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-a-commit-comment-reaction +func (s *ReactionsService) DeleteCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions/%v", owner, repo, commentID, reactionID) + + return s.deleteReaction(ctx, u) +} + +// DeleteCommentReactionByID deletes the reaction for a commit comment by repository ID. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-a-commit-comment-reaction +func (s *ReactionsService) DeleteCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { + u := fmt.Sprintf("repositories/%v/comments/%v/reactions/%v", repoID, commentID, reactionID) + + return s.deleteReaction(ctx, u) +} + +// ListIssueReactions lists the reactions for an issue. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-an-issue +func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*Reaction, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept headers when APIs fully launch. + req.Header.Set("Accept", mediaTypeReactionsPreview) + + var m []*Reaction + resp, err := s.client.Do(ctx, req, &m) + if err != nil { + return nil, resp, err + } + + return m, resp, nil +} + +// CreateIssueReaction creates a reaction for an issue. +// Note that if you have already created a reaction of type content, the +// previously created reaction will be returned with Status: 200 OK. +// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-an-issue +func (s *ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo string, number int, content string) (*Reaction, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) + + body := &Reaction{Content: String(content)} + req, err := s.client.NewRequest("POST", u, body) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept headers when APIs fully launch. + req.Header.Set("Accept", mediaTypeReactionsPreview) + + m := &Reaction{} + resp, err := s.client.Do(ctx, req, m) + if err != nil { + return nil, resp, err + } + + return m, resp, nil +} + +// DeleteIssueReaction deletes the reaction to an issue. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-an-issue-reaction +func (s *ReactionsService) DeleteIssueReaction(ctx context.Context, owner, repo string, issueNumber int, reactionID int64) (*Response, error) { + url := fmt.Sprintf("repos/%v/%v/issues/%v/reactions/%v", owner, repo, issueNumber, reactionID) + + return s.deleteReaction(ctx, url) +} + +// DeleteIssueReactionByID deletes the reaction to an issue by repository ID. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-an-issue-reaction +func (s *ReactionsService) DeleteIssueReactionByID(ctx context.Context, repoID, issueNumber int, reactionID int64) (*Response, error) { + url := fmt.Sprintf("repositories/%v/issues/%v/reactions/%v", repoID, issueNumber, reactionID) + + return s.deleteReaction(ctx, url) +} + +// ListIssueCommentReactions lists the reactions for an issue comment. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-an-issue-comment +func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*Reaction, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept headers when APIs fully launch. + req.Header.Set("Accept", mediaTypeReactionsPreview) + + var m []*Reaction + resp, err := s.client.Do(ctx, req, &m) + if err != nil { + return nil, resp, err + } + + return m, resp, nil +} + +// CreateIssueCommentReaction creates a reaction for an issue comment. +// Note that if you have already created a reaction of type content, the +// previously created reaction will be returned with Status: 200 OK. +// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-an-issue-comment +func (s *ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) + + body := &Reaction{Content: String(content)} + req, err := s.client.NewRequest("POST", u, body) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept headers when APIs fully launch. + req.Header.Set("Accept", mediaTypeReactionsPreview) + + m := &Reaction{} + resp, err := s.client.Do(ctx, req, m) + if err != nil { + return nil, resp, err + } + + return m, resp, nil +} + +// DeleteIssueCommentReaction deletes the reaction to an issue comment. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-an-issue-comment-reaction +func (s *ReactionsService) DeleteIssueCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { + url := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions/%v", owner, repo, commentID, reactionID) + + return s.deleteReaction(ctx, url) +} + +// DeleteIssueCommentReactionByID deletes the reaction to an issue comment by repository ID. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-an-issue-comment-reaction +func (s *ReactionsService) DeleteIssueCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { + url := fmt.Sprintf("repositories/%v/issues/comments/%v/reactions/%v", repoID, commentID, reactionID) + + return s.deleteReaction(ctx, url) +} + +// ListPullRequestCommentReactions lists the reactions for a pull request review comment. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-a-pull-request-review-comment +func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*Reaction, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept headers when APIs fully launch. + req.Header.Set("Accept", mediaTypeReactionsPreview) + + var m []*Reaction + resp, err := s.client.Do(ctx, req, &m) + if err != nil { + return nil, resp, err + } + + return m, resp, nil +} + +// CreatePullRequestCommentReaction creates a reaction for a pull request review comment. +// Note that if you have already created a reaction of type content, the +// previously created reaction will be returned with Status: 200 OK. +// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-a-pull-request-review-comment +func (s *ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) + + body := &Reaction{Content: String(content)} + req, err := s.client.NewRequest("POST", u, body) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept headers when APIs fully launch. + req.Header.Set("Accept", mediaTypeReactionsPreview) + + m := &Reaction{} + resp, err := s.client.Do(ctx, req, m) + if err != nil { + return nil, resp, err + } + + return m, resp, nil +} + +// DeletePullRequestCommentReaction deletes the reaction to a pull request review comment. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-a-pull-request-comment-reaction +func (s *ReactionsService) DeletePullRequestCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { + url := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions/%v", owner, repo, commentID, reactionID) + + return s.deleteReaction(ctx, url) +} + +// DeletePullRequestCommentReactionByID deletes the reaction to a pull request review comment by repository ID. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-a-pull-request-comment-reaction +func (s *ReactionsService) DeletePullRequestCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { + url := fmt.Sprintf("repositories/%v/pulls/comments/%v/reactions/%v", repoID, commentID, reactionID) + + return s.deleteReaction(ctx, url) +} + +// ListTeamDiscussionReactions lists the reactions for a team discussion. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-a-team-discussion-legacy +func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, teamID int64, discussionNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { + u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + req.Header.Set("Accept", mediaTypeReactionsPreview) + + var m []*Reaction + resp, err := s.client.Do(ctx, req, &m) + if err != nil { + return nil, resp, err + } + + return m, resp, nil +} + +// CreateTeamDiscussionReaction creates a reaction for a team discussion. +// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-a-team-discussion-legacy +func (s *ReactionsService) CreateTeamDiscussionReaction(ctx context.Context, teamID int64, discussionNumber int, content string) (*Reaction, *Response, error) { + u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) + + body := &Reaction{Content: String(content)} + req, err := s.client.NewRequest("POST", u, body) + if err != nil { + return nil, nil, err + } + + req.Header.Set("Accept", mediaTypeReactionsPreview) + + m := &Reaction{} + resp, err := s.client.Do(ctx, req, m) + if err != nil { + return nil, resp, err + } + + return m, resp, nil +} + +// DeleteTeamDiscussionReaction deletes the reaction to a team discussion. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-team-discussion-reaction +func (s *ReactionsService) DeleteTeamDiscussionReaction(ctx context.Context, org, teamSlug string, discussionNumber int, reactionID int64) (*Response, error) { + url := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/reactions/%v", org, teamSlug, discussionNumber, reactionID) + + return s.deleteReaction(ctx, url) +} + +// DeleteTeamDiscussionReactionByOrgIDAndTeamID deletes the reaction to a team discussion by organization ID and team ID. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-team-discussion-reaction +func (s *ReactionsService) DeleteTeamDiscussionReactionByOrgIDAndTeamID(ctx context.Context, orgID, teamID, discussionNumber int, reactionID int64) (*Response, error) { + url := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/reactions/%v", orgID, teamID, discussionNumber, reactionID) + + return s.deleteReaction(ctx, url) +} + +// ListTeamDiscussionCommentReactions lists the reactions for a team discussion comment. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-a-team-discussion-comment-legacy +func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Context, teamID int64, discussionNumber, commentNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { + u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + req.Header.Set("Accept", mediaTypeReactionsPreview) + + var m []*Reaction + resp, err := s.client.Do(ctx, req, &m) + if err != nil { + return nil, nil, err + } + return m, resp, nil +} + +// CreateTeamDiscussionCommentReaction creates a reaction for a team discussion comment. +// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-a-team-discussion-comment-legacy +func (s *ReactionsService) CreateTeamDiscussionCommentReaction(ctx context.Context, teamID int64, discussionNumber, commentNumber int, content string) (*Reaction, *Response, error) { + u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) + + body := &Reaction{Content: String(content)} + req, err := s.client.NewRequest("POST", u, body) + if err != nil { + return nil, nil, err + } + + req.Header.Set("Accept", mediaTypeReactionsPreview) + + m := &Reaction{} + resp, err := s.client.Do(ctx, req, m) + if err != nil { + return nil, resp, err + } + + return m, resp, nil +} + +// DeleteTeamDiscussionCommentReaction deletes the reaction to a team discussion comment. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-team-discussion-comment-reaction +func (s *ReactionsService) DeleteTeamDiscussionCommentReaction(ctx context.Context, org, teamSlug string, discussionNumber, commentNumber int, reactionID int64) (*Response, error) { + url := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v/reactions/%v", org, teamSlug, discussionNumber, commentNumber, reactionID) + + return s.deleteReaction(ctx, url) +} + +// DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID deletes the reaction to a team discussion comment by organization ID and team ID. +// +// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-team-discussion-comment-reaction +func (s *ReactionsService) DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID(ctx context.Context, orgID, teamID, discussionNumber, commentNumber int, reactionID int64) (*Response, error) { + url := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v/reactions/%v", orgID, teamID, discussionNumber, commentNumber, reactionID) + + return s.deleteReaction(ctx, url) +} + +func (s *ReactionsService) deleteReaction(ctx context.Context, url string) (*Response, error) { + req, err := s.client.NewRequest(http.MethodDelete, url, nil) + if err != nil { + return nil, err + } + + // TODO: remove custom Accept headers when APIs fully launch. + req.Header.Set("Accept", mediaTypeReactionsPreview) + + return s.client.Do(ctx, req, nil) +} diff --git a/update-urls/testdata/reactions.html b/update-urls/testdata/reactions.html new file mode 100644 index 00000000000..2669f856c09 --- /dev/null +++ b/update-urls/testdata/reactions.html @@ -0,0 +1,5690 @@ + + + Reactions - GitHub Docs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    +
    + + + +
    +
    + +
    + + + Article version: GitHub.com + + + + +
    + + +
    +
    + + +
    +
    + +
    + +
    +
    +

    Reactions

    +
    + +
    +
    + + + + + + + + +
    +
    +
    + +

    In this article

    + + +
    + +
    +

    + Did this doc help you? +

    +

    + + + + +

    + + + + + +

    + + +

    + + +
    + +
    +
    +
    +
    + +

    Reaction types

    +

    When creating a reaction, the allowed values for the content parameter are as follows (with the corresponding emoji for reference):

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    contentemoji
    +1👍
    -1👎
    laugh😄
    confused😕
    heart❤️
    hooray🎉
    rocket🚀
    eyes👀
    +
    +
    +

    + List reactions for a team discussion comment +

    +

    List the reactions to a team discussion comment. OAuth access tokens require the read:discussion scope.

    +

    Note: You can also specify a team by org_id and team_id using the route GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions.

    +
    +
    get /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    This API is under preview and subject to change.

    + + + + See preview notice. + + +
    orgstringpath + + +
    team_slugstringpath + + +
    discussion_numberintegerpath + + +
    comment_numberintegerpath + + +
    contentstringquery +

    Returns a single reaction type. Omit this parameter to list all reactions to a team discussion comment.

    + +
    per_pageintegerquery +

    Results per page (max 100)

    + +
    pageintegerquery +

    Page number of the results to fetch.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    +  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/discussions/42/comments/42/reactions
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions', {
    +  org: 'org',
    +  team_slug: 'team_slug',
    +  discussion_number: 42,
    +  comment_number: 42,
    +  mediaType: {
    +    previews: [
    +      'squirrel-girl'
    +    ]
    +  }
    +})
    +
    + + + + +

    Default response

    +
    Status: 200 OK
    +
    [
    +  {
    +    "id": 1,
    +    "node_id": "MDg6UmVhY3Rpb24x",
    +    "user": {
    +      "login": "octocat",
    +      "id": 1,
    +      "node_id": "MDQ6VXNlcjE=",
    +      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    +      "gravatar_id": "",
    +      "url": "https://api.github.com/users/octocat",
    +      "html_url": "https://github.com/octocat",
    +      "followers_url": "https://api.github.com/users/octocat/followers",
    +      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    +      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    +      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    +      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    +      "organizations_url": "https://api.github.com/users/octocat/orgs",
    +      "repos_url": "https://api.github.com/users/octocat/repos",
    +      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    +      "received_events_url": "https://api.github.com/users/octocat/received_events",
    +      "type": "User",
    +      "site_admin": false
    +    },
    +    "content": "heart",
    +    "created_at": "2016-05-20T20:09:31Z"
    +  }
    +]
    +
    + + +

    Notes

    + + + +

    + + Preview notice + +

    + +
    +

    An additional reactions object in the issue comment payload is currently available for developers to preview. During +the preview period, the APIs may change without advance notice. Please see the blog +post for full details.

    +

    To access the API you must provide a custom media type in the Accept header:

    +
    application/vnd.github.squirrel-girl-preview
    +
    +

    The reactions key will have the following payload where url can be used to construct the API location for listing +and creating reactions.

    +
    {
    +  "total_count": 5,
    +  "+1": 3,
    +  "-1": 1,
    +  "laugh": 0,
    +  "confused": 0,
    +  "heart": 1,
    +  "hooray": 0,
    +  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    +}
    +
    + ☝️ This header is required. +
    + + +
    +
    +
    +
    +
    +

    + Create reaction for a team discussion comment +

    +

    Create a reaction to a team discussion comment. OAuth access tokens require the write:discussion scope. A response with a Status: 200 OK means that you already added the reaction type to this team discussion comment.

    +

    Note: You can also specify a team by org_id and team_id using the route POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions.

    +
    +
    post /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    This API is under preview and subject to change.

    + + + + See preview notice. + + +
    orgstringpath + + +
    team_slugstringpath + + +
    discussion_numberintegerpath + + +
    comment_numberintegerpath + + +
    contentstringbody +

    Required. The reaction type to add to the team discussion comment.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -X POST \
    +  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    +  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/discussions/42/comments/42/reactions \
    +  -d '{"content":"content"}'
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions', {
    +  org: 'org',
    +  team_slug: 'team_slug',
    +  discussion_number: 42,
    +  comment_number: 42,
    +  content: 'content',
    +  mediaType: {
    +    previews: [
    +      'squirrel-girl'
    +    ]
    +  }
    +})
    +
    + + + + +

    Default response

    +
    Status: 201 Created
    +
    {
    +  "id": 1,
    +  "node_id": "MDg6UmVhY3Rpb24x",
    +  "user": {
    +    "login": "octocat",
    +    "id": 1,
    +    "node_id": "MDQ6VXNlcjE=",
    +    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    +    "gravatar_id": "",
    +    "url": "https://api.github.com/users/octocat",
    +    "html_url": "https://github.com/octocat",
    +    "followers_url": "https://api.github.com/users/octocat/followers",
    +    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    +    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    +    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    +    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    +    "organizations_url": "https://api.github.com/users/octocat/orgs",
    +    "repos_url": "https://api.github.com/users/octocat/repos",
    +    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    +    "received_events_url": "https://api.github.com/users/octocat/received_events",
    +    "type": "User",
    +    "site_admin": false
    +  },
    +  "content": "heart",
    +  "created_at": "2016-05-20T20:09:31Z"
    +}
    +
    + + +

    Notes

    + + + +

    + + Preview notice + +

    + +
    +

    An additional reactions object in the issue comment payload is currently available for developers to preview. During +the preview period, the APIs may change without advance notice. Please see the blog +post for full details.

    +

    To access the API you must provide a custom media type in the Accept header:

    +
    application/vnd.github.squirrel-girl-preview
    +
    +

    The reactions key will have the following payload where url can be used to construct the API location for listing +and creating reactions.

    +
    {
    +  "total_count": 5,
    +  "+1": 3,
    +  "-1": 1,
    +  "laugh": 0,
    +  "confused": 0,
    +  "heart": 1,
    +  "hooray": 0,
    +  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    +}
    +
    + ☝️ This header is required. +
    + + +
    +
    +
    +
    +
    +

    + Delete team discussion comment reaction +

    +

    Note: You can also specify a team or organization with team_id and org_id using the route DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id.

    +

    Delete a reaction to a team discussion comment. OAuth access tokens require the write:discussion scope.

    +
    +
    delete /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    This API is under preview and subject to change.

    + + + + See preview notice. + + +
    orgstringpath + + +
    team_slugstringpath + + +
    discussion_numberintegerpath + + +
    comment_numberintegerpath + + +
    reaction_idintegerpath + + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -X DELETE \
    +  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    +  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/discussions/42/comments/42/reactions/42
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}', {
    +  org: 'org',
    +  team_slug: 'team_slug',
    +  discussion_number: 42,
    +  comment_number: 42,
    +  reaction_id: 42,
    +  mediaType: {
    +    previews: [
    +      'squirrel-girl'
    +    ]
    +  }
    +})
    +
    + + + + +

    Default Response

    +
    Status: 204 No Content
    +
    + + +

    Notes

    + + + +

    + + Preview notice + +

    + +
    +

    An additional reactions object in the issue comment payload is currently available for developers to preview. During +the preview period, the APIs may change without advance notice. Please see the blog +post for full details.

    +

    To access the API you must provide a custom media type in the Accept header:

    +
    application/vnd.github.squirrel-girl-preview
    +
    +

    The reactions key will have the following payload where url can be used to construct the API location for listing +and creating reactions.

    +
    {
    +  "total_count": 5,
    +  "+1": 3,
    +  "-1": 1,
    +  "laugh": 0,
    +  "confused": 0,
    +  "heart": 1,
    +  "hooray": 0,
    +  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    +}
    +
    + ☝️ This header is required. +
    + + +
    +
    +
    +
    +
    +

    + List reactions for a team discussion +

    +

    List the reactions to a team discussion. OAuth access tokens require the read:discussion scope.

    +

    Note: You can also specify a team by org_id and team_id using the route GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions.

    +
    +
    get /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    This API is under preview and subject to change.

    + + + + See preview notice. + + +
    orgstringpath + + +
    team_slugstringpath + + +
    discussion_numberintegerpath + + +
    contentstringquery +

    Returns a single reaction type. Omit this parameter to list all reactions to a team discussion.

    + +
    per_pageintegerquery +

    Results per page (max 100)

    + +
    pageintegerquery +

    Page number of the results to fetch.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    +  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/discussions/42/reactions
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions', {
    +  org: 'org',
    +  team_slug: 'team_slug',
    +  discussion_number: 42,
    +  mediaType: {
    +    previews: [
    +      'squirrel-girl'
    +    ]
    +  }
    +})
    +
    + + + + +

    Default response

    +
    Status: 200 OK
    +
    [
    +  {
    +    "id": 1,
    +    "node_id": "MDg6UmVhY3Rpb24x",
    +    "user": {
    +      "login": "octocat",
    +      "id": 1,
    +      "node_id": "MDQ6VXNlcjE=",
    +      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    +      "gravatar_id": "",
    +      "url": "https://api.github.com/users/octocat",
    +      "html_url": "https://github.com/octocat",
    +      "followers_url": "https://api.github.com/users/octocat/followers",
    +      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    +      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    +      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    +      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    +      "organizations_url": "https://api.github.com/users/octocat/orgs",
    +      "repos_url": "https://api.github.com/users/octocat/repos",
    +      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    +      "received_events_url": "https://api.github.com/users/octocat/received_events",
    +      "type": "User",
    +      "site_admin": false
    +    },
    +    "content": "heart",
    +    "created_at": "2016-05-20T20:09:31Z"
    +  }
    +]
    +
    + + +

    Notes

    + + + +

    + + Preview notice + +

    + +
    +

    An additional reactions object in the issue comment payload is currently available for developers to preview. During +the preview period, the APIs may change without advance notice. Please see the blog +post for full details.

    +

    To access the API you must provide a custom media type in the Accept header:

    +
    application/vnd.github.squirrel-girl-preview
    +
    +

    The reactions key will have the following payload where url can be used to construct the API location for listing +and creating reactions.

    +
    {
    +  "total_count": 5,
    +  "+1": 3,
    +  "-1": 1,
    +  "laugh": 0,
    +  "confused": 0,
    +  "heart": 1,
    +  "hooray": 0,
    +  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    +}
    +
    + ☝️ This header is required. +
    + + +
    +
    +
    +
    +
    +

    + Create reaction for a team discussion +

    +

    Create a reaction to a team discussion. OAuth access tokens require the write:discussion scope. A response with a Status: 200 OK means that you already added the reaction type to this team discussion.

    +

    Note: You can also specify a team by org_id and team_id using the route POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions.

    +
    +
    post /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    This API is under preview and subject to change.

    + + + + See preview notice. + + +
    orgstringpath + + +
    team_slugstringpath + + +
    discussion_numberintegerpath + + +
    contentstringbody +

    Required. The reaction type to add to the team discussion.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -X POST \
    +  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    +  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/discussions/42/reactions \
    +  -d '{"content":"content"}'
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions', {
    +  org: 'org',
    +  team_slug: 'team_slug',
    +  discussion_number: 42,
    +  content: 'content',
    +  mediaType: {
    +    previews: [
    +      'squirrel-girl'
    +    ]
    +  }
    +})
    +
    + + + + +

    Default response

    +
    Status: 201 Created
    +
    {
    +  "id": 1,
    +  "node_id": "MDg6UmVhY3Rpb24x",
    +  "user": {
    +    "login": "octocat",
    +    "id": 1,
    +    "node_id": "MDQ6VXNlcjE=",
    +    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    +    "gravatar_id": "",
    +    "url": "https://api.github.com/users/octocat",
    +    "html_url": "https://github.com/octocat",
    +    "followers_url": "https://api.github.com/users/octocat/followers",
    +    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    +    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    +    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    +    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    +    "organizations_url": "https://api.github.com/users/octocat/orgs",
    +    "repos_url": "https://api.github.com/users/octocat/repos",
    +    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    +    "received_events_url": "https://api.github.com/users/octocat/received_events",
    +    "type": "User",
    +    "site_admin": false
    +  },
    +  "content": "heart",
    +  "created_at": "2016-05-20T20:09:31Z"
    +}
    +
    + + + +

    + + Preview notice + +

    + +
    +

    An additional reactions object in the issue comment payload is currently available for developers to preview. During +the preview period, the APIs may change without advance notice. Please see the blog +post for full details.

    +

    To access the API you must provide a custom media type in the Accept header:

    +
    application/vnd.github.squirrel-girl-preview
    +
    +

    The reactions key will have the following payload where url can be used to construct the API location for listing +and creating reactions.

    +
    {
    +  "total_count": 5,
    +  "+1": 3,
    +  "-1": 1,
    +  "laugh": 0,
    +  "confused": 0,
    +  "heart": 1,
    +  "hooray": 0,
    +  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    +}
    +
    + ☝️ This header is required. +
    + + +
    +
    +
    +
    +
    +

    + Delete team discussion reaction +

    +

    Note: You can also specify a team or organization with team_id and org_id using the route DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions/:reaction_id.

    +

    Delete a reaction to a team discussion. OAuth access tokens require the write:discussion scope.

    +
    +
    delete /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    This API is under preview and subject to change.

    + + + + See preview notice. + + +
    orgstringpath + + +
    team_slugstringpath + + +
    discussion_numberintegerpath + + +
    reaction_idintegerpath + + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -X DELETE \
    +  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    +  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/discussions/42/reactions/42
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}', {
    +  org: 'org',
    +  team_slug: 'team_slug',
    +  discussion_number: 42,
    +  reaction_id: 42,
    +  mediaType: {
    +    previews: [
    +      'squirrel-girl'
    +    ]
    +  }
    +})
    +
    + + + + +

    Default Response

    +
    Status: 204 No Content
    +
    + + +

    Notes

    + + + +

    + + Preview notice + +

    + +
    +

    An additional reactions object in the issue comment payload is currently available for developers to preview. During +the preview period, the APIs may change without advance notice. Please see the blog +post for full details.

    +

    To access the API you must provide a custom media type in the Accept header:

    +
    application/vnd.github.squirrel-girl-preview
    +
    +

    The reactions key will have the following payload where url can be used to construct the API location for listing +and creating reactions.

    +
    {
    +  "total_count": 5,
    +  "+1": 3,
    +  "-1": 1,
    +  "laugh": 0,
    +  "confused": 0,
    +  "heart": 1,
    +  "hooray": 0,
    +  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    +}
    +
    + ☝️ This header is required. +
    + + +
    +
    +
    +
    +
    +

    + Delete a reaction (Legacy) +

    +

    Deprecation Notice: This endpoint route is deprecated and will be removed from the Reactions API. We recommend migrating your existing code to use the new delete reactions endpoints. For more information, see this blog post.

    +

    OAuth access tokens require the write:discussion scope, when deleting a team discussion or team discussion comment.

    +
    +
    delete /reactions/{reaction_id}
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    This API is under preview and subject to change.

    + + + + See preview notice. + + +
    reaction_idintegerpath + + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -X DELETE \
    +  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    +  https://api.github.com/reactions/42
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('DELETE /reactions/{reaction_id}', {
    +  reaction_id: 42,
    +  mediaType: {
    +    previews: [
    +      'squirrel-girl'
    +    ]
    +  }
    +})
    +
    + + + + +

    Default Response

    +
    Status: 204 No Content
    +
    + + +

    Notes

    + + + +

    + + Preview notice + +

    + +
    +

    An additional reactions object in the issue comment payload is currently available for developers to preview. During +the preview period, the APIs may change without advance notice. Please see the blog +post for full details.

    +

    To access the API you must provide a custom media type in the Accept header:

    +
    application/vnd.github.squirrel-girl-preview
    +
    +

    The reactions key will have the following payload where url can be used to construct the API location for listing +and creating reactions.

    +
    {
    +  "total_count": 5,
    +  "+1": 3,
    +  "-1": 1,
    +  "laugh": 0,
    +  "confused": 0,
    +  "heart": 1,
    +  "hooray": 0,
    +  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    +}
    +
    + ☝️ This header is required. +
    + + +
    +
    +
    +
    +
    +

    + List reactions for a commit comment +

    +

    List the reactions to a commit comment.

    +
    +
    get /repos/{owner}/{repo}/comments/{comment_id}/reactions
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    This API is under preview and subject to change.

    + + + + See preview notice. + + +
    ownerstringpath + + +
    repostringpath + + +
    comment_idintegerpath + + +
    contentstringquery +

    Returns a single reaction type. Omit this parameter to list all reactions to a commit comment.

    + +
    per_pageintegerquery +

    Results per page (max 100)

    + +
    pageintegerquery +

    Page number of the results to fetch.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    +  https://api.github.com/repos/octocat/hello-world/comments/42/reactions
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('GET /repos/{owner}/{repo}/comments/{comment_id}/reactions', {
    +  owner: 'octocat',
    +  repo: 'hello-world',
    +  comment_id: 42,
    +  mediaType: {
    +    previews: [
    +      'squirrel-girl'
    +    ]
    +  }
    +})
    +
    + + + + +

    Default response

    +
    Status: 200 OK
    +
    [
    +  {
    +    "id": 1,
    +    "node_id": "MDg6UmVhY3Rpb24x",
    +    "user": {
    +      "login": "octocat",
    +      "id": 1,
    +      "node_id": "MDQ6VXNlcjE=",
    +      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    +      "gravatar_id": "",
    +      "url": "https://api.github.com/users/octocat",
    +      "html_url": "https://github.com/octocat",
    +      "followers_url": "https://api.github.com/users/octocat/followers",
    +      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    +      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    +      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    +      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    +      "organizations_url": "https://api.github.com/users/octocat/orgs",
    +      "repos_url": "https://api.github.com/users/octocat/repos",
    +      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    +      "received_events_url": "https://api.github.com/users/octocat/received_events",
    +      "type": "User",
    +      "site_admin": false
    +    },
    +    "content": "heart",
    +    "created_at": "2016-05-20T20:09:31Z"
    +  }
    +]
    +
    + + +

    Notes

    + + + +

    + + Preview notice + +

    + +
    +

    An additional reactions object in the issue comment payload is currently available for developers to preview. During +the preview period, the APIs may change without advance notice. Please see the blog +post for full details.

    +

    To access the API you must provide a custom media type in the Accept header:

    +
    application/vnd.github.squirrel-girl-preview
    +
    +

    The reactions key will have the following payload where url can be used to construct the API location for listing +and creating reactions.

    +
    {
    +  "total_count": 5,
    +  "+1": 3,
    +  "-1": 1,
    +  "laugh": 0,
    +  "confused": 0,
    +  "heart": 1,
    +  "hooray": 0,
    +  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    +}
    +
    + ☝️ This header is required. +
    + + +
    +
    +
    +
    +
    +

    + Create reaction for a commit comment +

    +

    Create a reaction to a commit comment. A response with a Status: 200 OK means that you already added the reaction type to this commit comment.

    +
    +
    post /repos/{owner}/{repo}/comments/{comment_id}/reactions
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    This API is under preview and subject to change.

    + + + + See preview notice. + + +
    ownerstringpath + + +
    repostringpath + + +
    comment_idintegerpath + + +
    contentstringbody +

    Required. The reaction type to add to the commit comment.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -X POST \
    +  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    +  https://api.github.com/repos/octocat/hello-world/comments/42/reactions \
    +  -d '{"content":"content"}'
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('POST /repos/{owner}/{repo}/comments/{comment_id}/reactions', {
    +  owner: 'octocat',
    +  repo: 'hello-world',
    +  comment_id: 42,
    +  content: 'content',
    +  mediaType: {
    +    previews: [
    +      'squirrel-girl'
    +    ]
    +  }
    +})
    +
    + + + + +

    Default response

    +
    Status: 201 Created
    +
    {
    +  "id": 1,
    +  "node_id": "MDg6UmVhY3Rpb24x",
    +  "user": {
    +    "login": "octocat",
    +    "id": 1,
    +    "node_id": "MDQ6VXNlcjE=",
    +    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    +    "gravatar_id": "",
    +    "url": "https://api.github.com/users/octocat",
    +    "html_url": "https://github.com/octocat",
    +    "followers_url": "https://api.github.com/users/octocat/followers",
    +    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    +    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    +    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    +    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    +    "organizations_url": "https://api.github.com/users/octocat/orgs",
    +    "repos_url": "https://api.github.com/users/octocat/repos",
    +    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    +    "received_events_url": "https://api.github.com/users/octocat/received_events",
    +    "type": "User",
    +    "site_admin": false
    +  },
    +  "content": "heart",
    +  "created_at": "2016-05-20T20:09:31Z"
    +}
    +
    + + +

    Notes

    + + + +

    + + Preview notice + +

    + +
    +

    An additional reactions object in the issue comment payload is currently available for developers to preview. During +the preview period, the APIs may change without advance notice. Please see the blog +post for full details.

    +

    To access the API you must provide a custom media type in the Accept header:

    +
    application/vnd.github.squirrel-girl-preview
    +
    +

    The reactions key will have the following payload where url can be used to construct the API location for listing +and creating reactions.

    +
    {
    +  "total_count": 5,
    +  "+1": 3,
    +  "-1": 1,
    +  "laugh": 0,
    +  "confused": 0,
    +  "heart": 1,
    +  "hooray": 0,
    +  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    +}
    +
    + ☝️ This header is required. +
    + + +
    +
    +
    +
    +
    +

    + Delete a commit comment reaction +

    +

    Note: You can also specify a repository by repository_id using the route DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id.

    +

    Delete a reaction to a commit comment.

    +
    +
    delete /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    This API is under preview and subject to change.

    + + + + See preview notice. + + +
    ownerstringpath + + +
    repostringpath + + +
    comment_idintegerpath + + +
    reaction_idintegerpath + + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -X DELETE \
    +  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    +  https://api.github.com/repos/octocat/hello-world/comments/42/reactions/42
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}', {
    +  owner: 'octocat',
    +  repo: 'hello-world',
    +  comment_id: 42,
    +  reaction_id: 42,
    +  mediaType: {
    +    previews: [
    +      'squirrel-girl'
    +    ]
    +  }
    +})
    +
    + + + + +

    Default Response

    +
    Status: 204 No Content
    +
    + + +

    Notes

    + + + +

    + + Preview notice + +

    + +
    +

    An additional reactions object in the issue comment payload is currently available for developers to preview. During +the preview period, the APIs may change without advance notice. Please see the blog +post for full details.

    +

    To access the API you must provide a custom media type in the Accept header:

    +
    application/vnd.github.squirrel-girl-preview
    +
    +

    The reactions key will have the following payload where url can be used to construct the API location for listing +and creating reactions.

    +
    {
    +  "total_count": 5,
    +  "+1": 3,
    +  "-1": 1,
    +  "laugh": 0,
    +  "confused": 0,
    +  "heart": 1,
    +  "hooray": 0,
    +  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    +}
    +
    + ☝️ This header is required. +
    + + +
    +
    +
    +
    +
    +

    + List reactions for an issue comment +

    +

    List the reactions to an issue comment.

    +
    +
    get /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    This API is under preview and subject to change.

    + + + + See preview notice. + + +
    ownerstringpath + + +
    repostringpath + + +
    comment_idintegerpath + + +
    contentstringquery +

    Returns a single reaction type. Omit this parameter to list all reactions to an issue comment.

    + +
    per_pageintegerquery +

    Results per page (max 100)

    + +
    pageintegerquery +

    Page number of the results to fetch.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    +  https://api.github.com/repos/octocat/hello-world/issues/comments/42/reactions
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions', {
    +  owner: 'octocat',
    +  repo: 'hello-world',
    +  comment_id: 42,
    +  mediaType: {
    +    previews: [
    +      'squirrel-girl'
    +    ]
    +  }
    +})
    +
    + + + + +

    Default response

    +
    Status: 200 OK
    +
    [
    +  {
    +    "id": 1,
    +    "node_id": "MDg6UmVhY3Rpb24x",
    +    "user": {
    +      "login": "octocat",
    +      "id": 1,
    +      "node_id": "MDQ6VXNlcjE=",
    +      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    +      "gravatar_id": "",
    +      "url": "https://api.github.com/users/octocat",
    +      "html_url": "https://github.com/octocat",
    +      "followers_url": "https://api.github.com/users/octocat/followers",
    +      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    +      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    +      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    +      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    +      "organizations_url": "https://api.github.com/users/octocat/orgs",
    +      "repos_url": "https://api.github.com/users/octocat/repos",
    +      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    +      "received_events_url": "https://api.github.com/users/octocat/received_events",
    +      "type": "User",
    +      "site_admin": false
    +    },
    +    "content": "heart",
    +    "created_at": "2016-05-20T20:09:31Z"
    +  }
    +]
    +
    + + +

    Notes

    + + + +

    + + Preview notice + +

    + +
    +

    An additional reactions object in the issue comment payload is currently available for developers to preview. During +the preview period, the APIs may change without advance notice. Please see the blog +post for full details.

    +

    To access the API you must provide a custom media type in the Accept header:

    +
    application/vnd.github.squirrel-girl-preview
    +
    +

    The reactions key will have the following payload where url can be used to construct the API location for listing +and creating reactions.

    +
    {
    +  "total_count": 5,
    +  "+1": 3,
    +  "-1": 1,
    +  "laugh": 0,
    +  "confused": 0,
    +  "heart": 1,
    +  "hooray": 0,
    +  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    +}
    +
    + ☝️ This header is required. +
    + + +
    +
    +
    +
    +
    +

    + Create reaction for an issue comment +

    +

    Create a reaction to an issue comment. A response with a Status: 200 OK means that you already added the reaction type to this issue comment.

    +
    +
    post /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    This API is under preview and subject to change.

    + + + + See preview notice. + + +
    ownerstringpath + + +
    repostringpath + + +
    comment_idintegerpath + + +
    contentstringbody +

    Required. The reaction type to add to the issue comment.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -X POST \
    +  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    +  https://api.github.com/repos/octocat/hello-world/issues/comments/42/reactions \
    +  -d '{"content":"content"}'
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions', {
    +  owner: 'octocat',
    +  repo: 'hello-world',
    +  comment_id: 42,
    +  content: 'content',
    +  mediaType: {
    +    previews: [
    +      'squirrel-girl'
    +    ]
    +  }
    +})
    +
    + + + + +

    Default response

    +
    Status: 201 Created
    +
    {
    +  "id": 1,
    +  "node_id": "MDg6UmVhY3Rpb24x",
    +  "user": {
    +    "login": "octocat",
    +    "id": 1,
    +    "node_id": "MDQ6VXNlcjE=",
    +    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    +    "gravatar_id": "",
    +    "url": "https://api.github.com/users/octocat",
    +    "html_url": "https://github.com/octocat",
    +    "followers_url": "https://api.github.com/users/octocat/followers",
    +    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    +    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    +    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    +    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    +    "organizations_url": "https://api.github.com/users/octocat/orgs",
    +    "repos_url": "https://api.github.com/users/octocat/repos",
    +    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    +    "received_events_url": "https://api.github.com/users/octocat/received_events",
    +    "type": "User",
    +    "site_admin": false
    +  },
    +  "content": "heart",
    +  "created_at": "2016-05-20T20:09:31Z"
    +}
    +
    + + +

    Notes

    + + + +

    + + Preview notice + +

    + +
    +

    An additional reactions object in the issue comment payload is currently available for developers to preview. During +the preview period, the APIs may change without advance notice. Please see the blog +post for full details.

    +

    To access the API you must provide a custom media type in the Accept header:

    +
    application/vnd.github.squirrel-girl-preview
    +
    +

    The reactions key will have the following payload where url can be used to construct the API location for listing +and creating reactions.

    +
    {
    +  "total_count": 5,
    +  "+1": 3,
    +  "-1": 1,
    +  "laugh": 0,
    +  "confused": 0,
    +  "heart": 1,
    +  "hooray": 0,
    +  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    +}
    +
    + ☝️ This header is required. +
    + + +
    +
    +
    +
    +
    +

    + Delete an issue comment reaction +

    +

    Note: You can also specify a repository by repository_id using the route DELETE delete /repositories/:repository_id/issues/comments/:comment_id/reactions/:reaction_id.

    +

    Delete a reaction to an issue comment.

    +
    +
    delete /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    This API is under preview and subject to change.

    + + + + See preview notice. + + +
    ownerstringpath + + +
    repostringpath + + +
    comment_idintegerpath + + +
    reaction_idintegerpath + + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -X DELETE \
    +  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    +  https://api.github.com/repos/octocat/hello-world/issues/comments/42/reactions/42
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}', {
    +  owner: 'octocat',
    +  repo: 'hello-world',
    +  comment_id: 42,
    +  reaction_id: 42,
    +  mediaType: {
    +    previews: [
    +      'squirrel-girl'
    +    ]
    +  }
    +})
    +
    + + + + +

    Default Response

    +
    Status: 204 No Content
    +
    + + +

    Notes

    + + + +

    + + Preview notice + +

    + +
    +

    An additional reactions object in the issue comment payload is currently available for developers to preview. During +the preview period, the APIs may change without advance notice. Please see the blog +post for full details.

    +

    To access the API you must provide a custom media type in the Accept header:

    +
    application/vnd.github.squirrel-girl-preview
    +
    +

    The reactions key will have the following payload where url can be used to construct the API location for listing +and creating reactions.

    +
    {
    +  "total_count": 5,
    +  "+1": 3,
    +  "-1": 1,
    +  "laugh": 0,
    +  "confused": 0,
    +  "heart": 1,
    +  "hooray": 0,
    +  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    +}
    +
    + ☝️ This header is required. +
    + + +
    +
    +
    +
    +
    +

    + List reactions for an issue +

    +

    List the reactions to an issue.

    +
    +
    get /repos/{owner}/{repo}/issues/{issue_number}/reactions
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    This API is under preview and subject to change.

    + + + + See preview notice. + + +
    ownerstringpath + + +
    repostringpath + + +
    issue_numberintegerpath + + +
    contentstringquery +

    Returns a single reaction type. Omit this parameter to list all reactions to an issue.

    + +
    per_pageintegerquery +

    Results per page (max 100)

    + +
    pageintegerquery +

    Page number of the results to fetch.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    +  https://api.github.com/repos/octocat/hello-world/issues/42/reactions
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('GET /repos/{owner}/{repo}/issues/{issue_number}/reactions', {
    +  owner: 'octocat',
    +  repo: 'hello-world',
    +  issue_number: 42,
    +  mediaType: {
    +    previews: [
    +      'squirrel-girl'
    +    ]
    +  }
    +})
    +
    + + + + +

    Default response

    +
    Status: 200 OK
    +
    [
    +  {
    +    "id": 1,
    +    "node_id": "MDg6UmVhY3Rpb24x",
    +    "user": {
    +      "login": "octocat",
    +      "id": 1,
    +      "node_id": "MDQ6VXNlcjE=",
    +      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    +      "gravatar_id": "",
    +      "url": "https://api.github.com/users/octocat",
    +      "html_url": "https://github.com/octocat",
    +      "followers_url": "https://api.github.com/users/octocat/followers",
    +      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    +      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    +      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    +      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    +      "organizations_url": "https://api.github.com/users/octocat/orgs",
    +      "repos_url": "https://api.github.com/users/octocat/repos",
    +      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    +      "received_events_url": "https://api.github.com/users/octocat/received_events",
    +      "type": "User",
    +      "site_admin": false
    +    },
    +    "content": "heart",
    +    "created_at": "2016-05-20T20:09:31Z"
    +  }
    +]
    +
    + + +

    Notes

    + + + +

    + + Preview notice + +

    + +
    +

    An additional reactions object in the issue comment payload is currently available for developers to preview. During +the preview period, the APIs may change without advance notice. Please see the blog +post for full details.

    +

    To access the API you must provide a custom media type in the Accept header:

    +
    application/vnd.github.squirrel-girl-preview
    +
    +

    The reactions key will have the following payload where url can be used to construct the API location for listing +and creating reactions.

    +
    {
    +  "total_count": 5,
    +  "+1": 3,
    +  "-1": 1,
    +  "laugh": 0,
    +  "confused": 0,
    +  "heart": 1,
    +  "hooray": 0,
    +  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    +}
    +
    + ☝️ This header is required. +
    + + +
    +
    +
    +
    +
    +

    + Create reaction for an issue +

    +

    Create a reaction to an issue. A response with a Status: 200 OK means that you already added the reaction type to this issue.

    +
    +
    post /repos/{owner}/{repo}/issues/{issue_number}/reactions
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    This API is under preview and subject to change.

    + + + + See preview notice. + + +
    ownerstringpath + + +
    repostringpath + + +
    issue_numberintegerpath + + +
    contentstringbody +

    Required. The reaction type to add to the issue.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -X POST \
    +  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    +  https://api.github.com/repos/octocat/hello-world/issues/42/reactions \
    +  -d '{"content":"content"}'
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('POST /repos/{owner}/{repo}/issues/{issue_number}/reactions', {
    +  owner: 'octocat',
    +  repo: 'hello-world',
    +  issue_number: 42,
    +  content: 'content',
    +  mediaType: {
    +    previews: [
    +      'squirrel-girl'
    +    ]
    +  }
    +})
    +
    + + + + +

    Default response

    +
    Status: 201 Created
    +
    {
    +  "id": 1,
    +  "node_id": "MDg6UmVhY3Rpb24x",
    +  "user": {
    +    "login": "octocat",
    +    "id": 1,
    +    "node_id": "MDQ6VXNlcjE=",
    +    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    +    "gravatar_id": "",
    +    "url": "https://api.github.com/users/octocat",
    +    "html_url": "https://github.com/octocat",
    +    "followers_url": "https://api.github.com/users/octocat/followers",
    +    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    +    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    +    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    +    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    +    "organizations_url": "https://api.github.com/users/octocat/orgs",
    +    "repos_url": "https://api.github.com/users/octocat/repos",
    +    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    +    "received_events_url": "https://api.github.com/users/octocat/received_events",
    +    "type": "User",
    +    "site_admin": false
    +  },
    +  "content": "heart",
    +  "created_at": "2016-05-20T20:09:31Z"
    +}
    +
    + + + +

    + + Preview notice + +

    + +
    +

    An additional reactions object in the issue comment payload is currently available for developers to preview. During +the preview period, the APIs may change without advance notice. Please see the blog +post for full details.

    +

    To access the API you must provide a custom media type in the Accept header:

    +
    application/vnd.github.squirrel-girl-preview
    +
    +

    The reactions key will have the following payload where url can be used to construct the API location for listing +and creating reactions.

    +
    {
    +  "total_count": 5,
    +  "+1": 3,
    +  "-1": 1,
    +  "laugh": 0,
    +  "confused": 0,
    +  "heart": 1,
    +  "hooray": 0,
    +  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    +}
    +
    + ☝️ This header is required. +
    + + +
    +
    +
    +
    +
    +

    + Delete an issue reaction +

    +

    Note: You can also specify a repository by repository_id using the route DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id.

    +

    Delete a reaction to an issue.

    +
    +
    delete /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    This API is under preview and subject to change.

    + + + + See preview notice. + + +
    ownerstringpath + + +
    repostringpath + + +
    issue_numberintegerpath + + +
    reaction_idintegerpath + + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -X DELETE \
    +  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    +  https://api.github.com/repos/octocat/hello-world/issues/42/reactions/42
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}', {
    +  owner: 'octocat',
    +  repo: 'hello-world',
    +  issue_number: 42,
    +  reaction_id: 42,
    +  mediaType: {
    +    previews: [
    +      'squirrel-girl'
    +    ]
    +  }
    +})
    +
    + + + + +

    Default Response

    +
    Status: 204 No Content
    +
    + + +

    Notes

    + + + +

    + + Preview notice + +

    + +
    +

    An additional reactions object in the issue comment payload is currently available for developers to preview. During +the preview period, the APIs may change without advance notice. Please see the blog +post for full details.

    +

    To access the API you must provide a custom media type in the Accept header:

    +
    application/vnd.github.squirrel-girl-preview
    +
    +

    The reactions key will have the following payload where url can be used to construct the API location for listing +and creating reactions.

    +
    {
    +  "total_count": 5,
    +  "+1": 3,
    +  "-1": 1,
    +  "laugh": 0,
    +  "confused": 0,
    +  "heart": 1,
    +  "hooray": 0,
    +  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    +}
    +
    + ☝️ This header is required. +
    + + +
    +
    +
    +
    + +
    get /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    This API is under preview and subject to change.

    + + + + See preview notice. + + +
    ownerstringpath + + +
    repostringpath + + +
    comment_idintegerpath + + +
    contentstringquery +

    Returns a single reaction type. Omit this parameter to list all reactions to a pull request review comment.

    + +
    per_pageintegerquery +

    Results per page (max 100)

    + +
    pageintegerquery +

    Page number of the results to fetch.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    +  https://api.github.com/repos/octocat/hello-world/pulls/comments/42/reactions
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions', {
    +  owner: 'octocat',
    +  repo: 'hello-world',
    +  comment_id: 42,
    +  mediaType: {
    +    previews: [
    +      'squirrel-girl'
    +    ]
    +  }
    +})
    +
    + + + + +

    Default response

    +
    Status: 200 OK
    +
    [
    +  {
    +    "id": 1,
    +    "node_id": "MDg6UmVhY3Rpb24x",
    +    "user": {
    +      "login": "octocat",
    +      "id": 1,
    +      "node_id": "MDQ6VXNlcjE=",
    +      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    +      "gravatar_id": "",
    +      "url": "https://api.github.com/users/octocat",
    +      "html_url": "https://github.com/octocat",
    +      "followers_url": "https://api.github.com/users/octocat/followers",
    +      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    +      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    +      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    +      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    +      "organizations_url": "https://api.github.com/users/octocat/orgs",
    +      "repos_url": "https://api.github.com/users/octocat/repos",
    +      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    +      "received_events_url": "https://api.github.com/users/octocat/received_events",
    +      "type": "User",
    +      "site_admin": false
    +    },
    +    "content": "heart",
    +    "created_at": "2016-05-20T20:09:31Z"
    +  }
    +]
    +
    + + +

    Notes

    + + + +

    + + Preview notice + +

    + +
    +

    An additional reactions object in the issue comment payload is currently available for developers to preview. During +the preview period, the APIs may change without advance notice. Please see the blog +post for full details.

    +

    To access the API you must provide a custom media type in the Accept header:

    +
    application/vnd.github.squirrel-girl-preview
    +
    +

    The reactions key will have the following payload where url can be used to construct the API location for listing +and creating reactions.

    +
    {
    +  "total_count": 5,
    +  "+1": 3,
    +  "-1": 1,
    +  "laugh": 0,
    +  "confused": 0,
    +  "heart": 1,
    +  "hooray": 0,
    +  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    +}
    +
    + ☝️ This header is required. +
    + + +
    +
    +
    +
    +
    +

    + Create reaction for a pull request review comment +

    +

    Create a reaction to a pull request review comment. A response with a Status: 200 OK means that you already added the reaction type to this pull request review comment.

    +
    +
    post /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    This API is under preview and subject to change.

    + + + + See preview notice. + + +
    ownerstringpath + + +
    repostringpath + + +
    comment_idintegerpath + + +
    contentstringbody +

    Required. The reaction type to add to the pull request review comment.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -X POST \
    +  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    +  https://api.github.com/repos/octocat/hello-world/pulls/comments/42/reactions \
    +  -d '{"content":"content"}'
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions', {
    +  owner: 'octocat',
    +  repo: 'hello-world',
    +  comment_id: 42,
    +  content: 'content',
    +  mediaType: {
    +    previews: [
    +      'squirrel-girl'
    +    ]
    +  }
    +})
    +
    + + + + +

    Default response

    +
    Status: 201 Created
    +
    {
    +  "id": 1,
    +  "node_id": "MDg6UmVhY3Rpb24x",
    +  "user": {
    +    "login": "octocat",
    +    "id": 1,
    +    "node_id": "MDQ6VXNlcjE=",
    +    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    +    "gravatar_id": "",
    +    "url": "https://api.github.com/users/octocat",
    +    "html_url": "https://github.com/octocat",
    +    "followers_url": "https://api.github.com/users/octocat/followers",
    +    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    +    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    +    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    +    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    +    "organizations_url": "https://api.github.com/users/octocat/orgs",
    +    "repos_url": "https://api.github.com/users/octocat/repos",
    +    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    +    "received_events_url": "https://api.github.com/users/octocat/received_events",
    +    "type": "User",
    +    "site_admin": false
    +  },
    +  "content": "heart",
    +  "created_at": "2016-05-20T20:09:31Z"
    +}
    +
    + + +

    Notes

    + + + +

    + + Preview notice + +

    + +
    +

    An additional reactions object in the issue comment payload is currently available for developers to preview. During +the preview period, the APIs may change without advance notice. Please see the blog +post for full details.

    +

    To access the API you must provide a custom media type in the Accept header:

    +
    application/vnd.github.squirrel-girl-preview
    +
    +

    The reactions key will have the following payload where url can be used to construct the API location for listing +and creating reactions.

    +
    {
    +  "total_count": 5,
    +  "+1": 3,
    +  "-1": 1,
    +  "laugh": 0,
    +  "confused": 0,
    +  "heart": 1,
    +  "hooray": 0,
    +  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    +}
    +
    + ☝️ This header is required. +
    + + +
    +
    +
    +
    +
    +

    + Delete a pull request comment reaction +

    +

    Note: You can also specify a repository by repository_id using the route DELETE /repositories/:repository_id/pulls/comments/:comment_id/reactions/:reaction_id.

    +

    Delete a reaction to a pull request review comment.

    +
    +
    delete /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    This API is under preview and subject to change.

    + + + + See preview notice. + + +
    ownerstringpath + + +
    repostringpath + + +
    comment_idintegerpath + + +
    reaction_idintegerpath + + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -X DELETE \
    +  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    +  https://api.github.com/repos/octocat/hello-world/pulls/comments/42/reactions/42
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}', {
    +  owner: 'octocat',
    +  repo: 'hello-world',
    +  comment_id: 42,
    +  reaction_id: 42,
    +  mediaType: {
    +    previews: [
    +      'squirrel-girl'
    +    ]
    +  }
    +})
    +
    + + + + +

    Default Response

    +
    Status: 204 No Content
    +
    + + +

    Notes

    + + + +

    + + Preview notice + +

    + +
    +

    An additional reactions object in the issue comment payload is currently available for developers to preview. During +the preview period, the APIs may change without advance notice. Please see the blog +post for full details.

    +

    To access the API you must provide a custom media type in the Accept header:

    +
    application/vnd.github.squirrel-girl-preview
    +
    +

    The reactions key will have the following payload where url can be used to construct the API location for listing +and creating reactions.

    +
    {
    +  "total_count": 5,
    +  "+1": 3,
    +  "-1": 1,
    +  "laugh": 0,
    +  "confused": 0,
    +  "heart": 1,
    +  "hooray": 0,
    +  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    +}
    +
    + ☝️ This header is required. +
    + + +
    +
    +
    +
    +
    +

    + List reactions for a team discussion comment (Legacy) +

    +

    Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new List reactions for a team discussion comment endpoint.

    +

    List the reactions to a team discussion comment. OAuth access tokens require the read:discussion scope.

    +
    +
    get /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    This API is under preview and subject to change.

    + + + + See preview notice. + + +
    team_idintegerpath + + +
    discussion_numberintegerpath + + +
    comment_numberintegerpath + + +
    contentstringquery +

    Returns a single reaction type. Omit this parameter to list all reactions to a team discussion comment.

    + +
    per_pageintegerquery +

    Results per page (max 100)

    + +
    pageintegerquery +

    Page number of the results to fetch.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    +  https://api.github.com/teams/42/discussions/42/comments/42/reactions
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions', {
    +  team_id: 42,
    +  discussion_number: 42,
    +  comment_number: 42,
    +  mediaType: {
    +    previews: [
    +      'squirrel-girl'
    +    ]
    +  }
    +})
    +
    + + + + +

    Default response

    +
    Status: 200 OK
    +
    [
    +  {
    +    "id": 1,
    +    "node_id": "MDg6UmVhY3Rpb24x",
    +    "user": {
    +      "login": "octocat",
    +      "id": 1,
    +      "node_id": "MDQ6VXNlcjE=",
    +      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    +      "gravatar_id": "",
    +      "url": "https://api.github.com/users/octocat",
    +      "html_url": "https://github.com/octocat",
    +      "followers_url": "https://api.github.com/users/octocat/followers",
    +      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    +      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    +      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    +      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    +      "organizations_url": "https://api.github.com/users/octocat/orgs",
    +      "repos_url": "https://api.github.com/users/octocat/repos",
    +      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    +      "received_events_url": "https://api.github.com/users/octocat/received_events",
    +      "type": "User",
    +      "site_admin": false
    +    },
    +    "content": "heart",
    +    "created_at": "2016-05-20T20:09:31Z"
    +  }
    +]
    +
    + + +

    Notes

    + + + +

    + + Preview notice + +

    + +
    +

    An additional reactions object in the issue comment payload is currently available for developers to preview. During +the preview period, the APIs may change without advance notice. Please see the blog +post for full details.

    +

    To access the API you must provide a custom media type in the Accept header:

    +
    application/vnd.github.squirrel-girl-preview
    +
    +

    The reactions key will have the following payload where url can be used to construct the API location for listing +and creating reactions.

    +
    {
    +  "total_count": 5,
    +  "+1": 3,
    +  "-1": 1,
    +  "laugh": 0,
    +  "confused": 0,
    +  "heart": 1,
    +  "hooray": 0,
    +  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    +}
    +
    + ☝️ This header is required. +
    + + +
    +
    +
    +
    +
    +

    + Create reaction for a team discussion comment (Legacy) +

    +

    Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Create reaction for a team discussion comment endpoint.

    +

    Create a reaction to a team discussion comment. OAuth access tokens require the write:discussion scope. A response with a Status: 200 OK means that you already added the reaction type to this team discussion comment.

    +
    +
    post /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    This API is under preview and subject to change.

    + + + + See preview notice. + + +
    team_idintegerpath + + +
    discussion_numberintegerpath + + +
    comment_numberintegerpath + + +
    contentstringbody +

    Required. The reaction type to add to the team discussion comment.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -X POST \
    +  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    +  https://api.github.com/teams/42/discussions/42/comments/42/reactions \
    +  -d '{"content":"content"}'
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('POST /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions', {
    +  team_id: 42,
    +  discussion_number: 42,
    +  comment_number: 42,
    +  content: 'content',
    +  mediaType: {
    +    previews: [
    +      'squirrel-girl'
    +    ]
    +  }
    +})
    +
    + + + + +

    Default response

    +
    Status: 201 Created
    +
    {
    +  "id": 1,
    +  "node_id": "MDg6UmVhY3Rpb24x",
    +  "user": {
    +    "login": "octocat",
    +    "id": 1,
    +    "node_id": "MDQ6VXNlcjE=",
    +    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    +    "gravatar_id": "",
    +    "url": "https://api.github.com/users/octocat",
    +    "html_url": "https://github.com/octocat",
    +    "followers_url": "https://api.github.com/users/octocat/followers",
    +    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    +    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    +    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    +    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    +    "organizations_url": "https://api.github.com/users/octocat/orgs",
    +    "repos_url": "https://api.github.com/users/octocat/repos",
    +    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    +    "received_events_url": "https://api.github.com/users/octocat/received_events",
    +    "type": "User",
    +    "site_admin": false
    +  },
    +  "content": "heart",
    +  "created_at": "2016-05-20T20:09:31Z"
    +}
    +
    + + +

    Notes

    + + + +

    + + Preview notice + +

    + +
    +

    An additional reactions object in the issue comment payload is currently available for developers to preview. During +the preview period, the APIs may change without advance notice. Please see the blog +post for full details.

    +

    To access the API you must provide a custom media type in the Accept header:

    +
    application/vnd.github.squirrel-girl-preview
    +
    +

    The reactions key will have the following payload where url can be used to construct the API location for listing +and creating reactions.

    +
    {
    +  "total_count": 5,
    +  "+1": 3,
    +  "-1": 1,
    +  "laugh": 0,
    +  "confused": 0,
    +  "heart": 1,
    +  "hooray": 0,
    +  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    +}
    +
    + ☝️ This header is required. +
    + + +
    +
    +
    +
    +
    +

    + List reactions for a team discussion (Legacy) +

    +

    Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new List reactions for a team discussion endpoint.

    +

    List the reactions to a team discussion. OAuth access tokens require the read:discussion scope.

    +
    +
    get /teams/{team_id}/discussions/{discussion_number}/reactions
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    This API is under preview and subject to change.

    + + + + See preview notice. + + +
    team_idintegerpath + + +
    discussion_numberintegerpath + + +
    contentstringquery +

    Returns a single reaction type. Omit this parameter to list all reactions to a team discussion.

    + +
    per_pageintegerquery +

    Results per page (max 100)

    + +
    pageintegerquery +

    Page number of the results to fetch.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    +  https://api.github.com/teams/42/discussions/42/reactions
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('GET /teams/{team_id}/discussions/{discussion_number}/reactions', {
    +  team_id: 42,
    +  discussion_number: 42,
    +  mediaType: {
    +    previews: [
    +      'squirrel-girl'
    +    ]
    +  }
    +})
    +
    + + + + +

    Default response

    +
    Status: 200 OK
    +
    [
    +  {
    +    "id": 1,
    +    "node_id": "MDg6UmVhY3Rpb24x",
    +    "user": {
    +      "login": "octocat",
    +      "id": 1,
    +      "node_id": "MDQ6VXNlcjE=",
    +      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    +      "gravatar_id": "",
    +      "url": "https://api.github.com/users/octocat",
    +      "html_url": "https://github.com/octocat",
    +      "followers_url": "https://api.github.com/users/octocat/followers",
    +      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    +      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    +      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    +      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    +      "organizations_url": "https://api.github.com/users/octocat/orgs",
    +      "repos_url": "https://api.github.com/users/octocat/repos",
    +      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    +      "received_events_url": "https://api.github.com/users/octocat/received_events",
    +      "type": "User",
    +      "site_admin": false
    +    },
    +    "content": "heart",
    +    "created_at": "2016-05-20T20:09:31Z"
    +  }
    +]
    +
    + + +

    Notes

    + + + +

    + + Preview notice + +

    + +
    +

    An additional reactions object in the issue comment payload is currently available for developers to preview. During +the preview period, the APIs may change without advance notice. Please see the blog +post for full details.

    +

    To access the API you must provide a custom media type in the Accept header:

    +
    application/vnd.github.squirrel-girl-preview
    +
    +

    The reactions key will have the following payload where url can be used to construct the API location for listing +and creating reactions.

    +
    {
    +  "total_count": 5,
    +  "+1": 3,
    +  "-1": 1,
    +  "laugh": 0,
    +  "confused": 0,
    +  "heart": 1,
    +  "hooray": 0,
    +  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    +}
    +
    + ☝️ This header is required. +
    + + +
    +
    +
    +
    +
    +

    + Create reaction for a team discussion (Legacy) +

    +

    Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Create reaction for a team discussion endpoint.

    +

    Create a reaction to a team discussion. OAuth access tokens require the write:discussion scope. A response with a Status: 200 OK means that you already added the reaction type to this team discussion.

    +
    +
    post /teams/{team_id}/discussions/{discussion_number}/reactions
    +
    + +

    + Parameters +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeInDescription
    acceptstringheader +

    This API is under preview and subject to change.

    + + + + See preview notice. + + +
    team_idintegerpath + + +
    discussion_numberintegerpath + + +
    contentstringbody +

    Required. The reaction type to add to the team discussion.

    + +
    + + +

    + Code samples +

    + + +
    + + Shell + +
    +
    curl \
    +  -X POST \
    +  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    +  https://api.github.com/teams/42/discussions/42/reactions \
    +  -d '{"content":"content"}'
    +
    + + + +
    + + JavaScript (@octokit/core.js) + +
    +
    await octokit.request('POST /teams/{team_id}/discussions/{discussion_number}/reactions', {
    +  team_id: 42,
    +  discussion_number: 42,
    +  content: 'content',
    +  mediaType: {
    +    previews: [
    +      'squirrel-girl'
    +    ]
    +  }
    +})
    +
    + + + + +

    Default response

    +
    Status: 201 Created
    +
    {
    +  "id": 1,
    +  "node_id": "MDg6UmVhY3Rpb24x",
    +  "user": {
    +    "login": "octocat",
    +    "id": 1,
    +    "node_id": "MDQ6VXNlcjE=",
    +    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    +    "gravatar_id": "",
    +    "url": "https://api.github.com/users/octocat",
    +    "html_url": "https://github.com/octocat",
    +    "followers_url": "https://api.github.com/users/octocat/followers",
    +    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    +    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    +    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    +    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    +    "organizations_url": "https://api.github.com/users/octocat/orgs",
    +    "repos_url": "https://api.github.com/users/octocat/repos",
    +    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    +    "received_events_url": "https://api.github.com/users/octocat/received_events",
    +    "type": "User",
    +    "site_admin": false
    +  },
    +  "content": "heart",
    +  "created_at": "2016-05-20T20:09:31Z"
    +}
    +
    + + + +

    + + Preview notice + +

    + +
    +

    An additional reactions object in the issue comment payload is currently available for developers to preview. During +the preview period, the APIs may change without advance notice. Please see the blog +post for full details.

    +

    To access the API you must provide a custom media type in the Accept header:

    +
    application/vnd.github.squirrel-girl-preview
    +
    +

    The reactions key will have the following payload where url can be used to construct the API location for listing +and creating reactions.

    +
    {
    +  "total_count": 5,
    +  "+1": 3,
    +  "-1": 1,
    +  "laugh": 0,
    +  "confused": 0,
    +  "heart": 1,
    +  "hooray": 0,
    +  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    +}
    +
    + ☝️ This header is required. +
    + + +
    +
    +
    +
    +
    +
    +
    + +
    +

    + Did this doc help you? +

    +

    + + + + +

    + + + + + +

    + + +

    + + +
    + +
    +
    + + + +
    +
    +
    +
    +

    Ask a human

    +

    Can't find what you're looking for?

    + Contact us +
    +
    + +
    +
    +
    +
    + + + + + +
    + + From 090264eb663fa2436f28782bc33f1c6826f2c044 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Wed, 25 May 2022 10:50:39 -0400 Subject: [PATCH 012/751] Bump version of go-github library to v45 (#2374) --- README.md | 14 +++++++------- example/actionpermissions/main.go | 2 +- example/appengine/app.go | 2 +- example/basicauth/main.go | 2 +- example/commitpr/main.go | 2 +- example/go.mod | 4 ++-- example/listenvironments/main.go | 2 +- example/migrations/main.go | 2 +- example/newfilewithappauth/main.go | 2 +- example/newrepo/main.go | 2 +- example/newreposecretwithlibsodium/go.mod | 2 +- example/newreposecretwithlibsodium/go.sum | 4 ++-- example/newreposecretwithlibsodium/main.go | 2 +- example/newreposecretwithxcrypto/main.go | 2 +- example/simple/main.go | 2 +- example/tokenauth/main.go | 2 +- example/topics/main.go | 2 +- github/doc.go | 2 +- github/examples_test.go | 2 +- go.mod | 2 +- test/fields/fields.go | 2 +- test/integration/activity_test.go | 2 +- test/integration/authorizations_test.go | 2 +- test/integration/github_test.go | 2 +- test/integration/repos_test.go | 2 +- test/integration/users_test.go | 2 +- 26 files changed, 34 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index c88f407ab5b..2b70743a85f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-github # [![go-github release (latest SemVer)](https://img.shields.io/github/v/release/google/go-github?sort=semver)](https://github.com/google/go-github/releases) -[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v44/github) +[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v45/github) [![Test Status](https://github.com/google/go-github/workflows/tests/badge.svg)](https://github.com/google/go-github/actions?query=workflow%3Atests) [![Test Coverage](https://codecov.io/gh/google/go-github/branch/master/graph/badge.svg)](https://codecov.io/gh/google/go-github) [![Discuss at go-github@googlegroups.com](https://img.shields.io/badge/discuss-go--github%40googlegroups.com-blue.svg)](https://groups.google.com/group/go-github) @@ -24,7 +24,7 @@ If you're interested in using the [GraphQL API v4][], the recommended library is go-github is compatible with modern Go releases in module mode, with Go installed: ```bash -go get github.com/google/go-github/v44 +go get github.com/google/go-github/v45 ``` will resolve and add the package to the current development module, along with its dependencies. @@ -32,7 +32,7 @@ will resolve and add the package to the current development module, along with i Alternatively the same can be achieved if you use import in a package: ```go -import "github.com/google/go-github/v44/github" +import "github.com/google/go-github/v45/github" ``` and run `go get` without parameters. @@ -40,13 +40,13 @@ and run `go get` without parameters. Finally, to use the top-of-trunk version of this repo, use the following command: ```bash -go get github.com/google/go-github/v44@master +go get github.com/google/go-github/v45@master ``` ## Usage ## ```go -import "github.com/google/go-github/v44/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) +import "github.com/google/go-github/v45/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled ``` @@ -123,7 +123,7 @@ package. ```go import ( "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v44/github" + "github.com/google/go-github/v45/github" ) func main() { @@ -274,7 +274,7 @@ For complete usage of go-github, see the full [package docs][]. [oauth2]: https://github.com/golang/oauth2 [oauth2 docs]: https://godoc.org/golang.org/x/oauth2 [personal API token]: https://github.com/blog/1509-personal-api-tokens -[package docs]: https://pkg.go.dev/github.com/google/go-github/v44/github +[package docs]: https://pkg.go.dev/github.com/google/go-github/v45/github [GraphQL API v4]: https://developer.github.com/v4/ [shurcooL/githubv4]: https://github.com/shurcooL/githubv4 [GitHub webhook events]: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads diff --git a/example/actionpermissions/main.go b/example/actionpermissions/main.go index 026a136a4ed..13969c8012d 100644 --- a/example/actionpermissions/main.go +++ b/example/actionpermissions/main.go @@ -14,7 +14,7 @@ import ( "log" "os" - "github.com/google/go-github/v44/github" + "github.com/google/go-github/v45/github" "golang.org/x/oauth2" ) diff --git a/example/appengine/app.go b/example/appengine/app.go index 09894ad0522..06b8e538b06 100644 --- a/example/appengine/app.go +++ b/example/appengine/app.go @@ -12,7 +12,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v44/github" + "github.com/google/go-github/v45/github" "golang.org/x/oauth2" "google.golang.org/appengine" "google.golang.org/appengine/log" diff --git a/example/basicauth/main.go b/example/basicauth/main.go index 8fabef010cb..5adb2887ee5 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -22,7 +22,7 @@ import ( "strings" "syscall" - "github.com/google/go-github/v44/github" + "github.com/google/go-github/v45/github" "golang.org/x/crypto/ssh/terminal" ) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index 5dd70c19d9c..4832770379a 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -31,7 +31,7 @@ import ( "strings" "time" - "github.com/google/go-github/v44/github" + "github.com/google/go-github/v45/github" "golang.org/x/oauth2" ) diff --git a/example/go.mod b/example/go.mod index f97d75bc980..600e85a2534 100644 --- a/example/go.mod +++ b/example/go.mod @@ -4,7 +4,7 @@ go 1.17 require ( github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 - github.com/google/go-github/v44 v44.0.0 + github.com/google/go-github/v45 v45.0.0 golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be google.golang.org/appengine v1.6.7 @@ -21,4 +21,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v44 => ../ +replace github.com/google/go-github/v45 => ../ diff --git a/example/listenvironments/main.go b/example/listenvironments/main.go index 095d2d6c782..a49bd2e000f 100644 --- a/example/listenvironments/main.go +++ b/example/listenvironments/main.go @@ -17,7 +17,7 @@ import ( "log" "os" - "github.com/google/go-github/v44/github" + "github.com/google/go-github/v45/github" "golang.org/x/oauth2" ) diff --git a/example/migrations/main.go b/example/migrations/main.go index 3ed36b65e86..60db180d2d9 100644 --- a/example/migrations/main.go +++ b/example/migrations/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v44/github" + "github.com/google/go-github/v45/github" "golang.org/x/oauth2" ) diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index 1f5e3162b18..d2be0a3adca 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -16,7 +16,7 @@ import ( "time" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v44/github" + "github.com/google/go-github/v45/github" "golang.org/x/oauth2" ) diff --git a/example/newrepo/main.go b/example/newrepo/main.go index 1aee6e55df3..58685b70820 100644 --- a/example/newrepo/main.go +++ b/example/newrepo/main.go @@ -16,7 +16,7 @@ import ( "log" "os" - "github.com/google/go-github/v44/github" + "github.com/google/go-github/v45/github" "golang.org/x/oauth2" ) diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index 480e23a124f..ee8d656d5c4 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -4,6 +4,6 @@ go 1.15 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb - github.com/google/go-github/v44 v44.0.0 + github.com/google/go-github/v45 v45.0.0 golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 ) diff --git a/example/newreposecretwithlibsodium/go.sum b/example/newreposecretwithlibsodium/go.sum index a2e90d13ccd..89a25a5c991 100644 --- a/example/newreposecretwithlibsodium/go.sum +++ b/example/newreposecretwithlibsodium/go.sum @@ -90,8 +90,8 @@ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-github/v41 v41.0.0/go.mod h1:XgmCA5H323A9rtgExdTcnDkcqp6S30AVACCBDOonIxg= -github.com/google/go-github/v44 v44.0.0 h1:y+GL7LIsAIF2NZlJ46ZoC/D1W1ivZasT0lnWHMYPZ+U= -github.com/google/go-github/v44 v44.0.0/go.mod h1:ZkTvvmCXBvsfPpTHXnH/d2hP9Y0cTbvN9kr5xqyXOIc= +github.com/google/go-github/v45 v45.0.0 h1:y+GL7LIsAIF2NZlJ46ZoC/D1W1ivZasT0lnWHMYPZ+U= +github.com/google/go-github/v45 v45.0.0/go.mod h1:ZkTvvmCXBvsfPpTHXnH/d2hP9Y0cTbvN9kr5xqyXOIc= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index f8f7655f895..7063ac5fab2 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -34,7 +34,7 @@ import ( "os" sodium "github.com/GoKillers/libsodium-go/cryptobox" - "github.com/google/go-github/v44/github" + "github.com/google/go-github/v45/github" "golang.org/x/oauth2" ) diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index 39c15ecbb25..eb96700dea9 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -34,7 +34,7 @@ import ( "log" "os" - "github.com/google/go-github/v44/github" + "github.com/google/go-github/v45/github" "golang.org/x/crypto/nacl/box" "golang.org/x/oauth2" ) diff --git a/example/simple/main.go b/example/simple/main.go index 721f78edfe1..e0ee92af4d2 100644 --- a/example/simple/main.go +++ b/example/simple/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v44/github" + "github.com/google/go-github/v45/github" ) // Fetch all the public organizations' membership of a user. diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index 303cfe73630..9b866a9709e 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -14,7 +14,7 @@ import ( "log" "syscall" - "github.com/google/go-github/v44/github" + "github.com/google/go-github/v45/github" "golang.org/x/crypto/ssh/terminal" "golang.org/x/oauth2" ) diff --git a/example/topics/main.go b/example/topics/main.go index e46bd3c2c2f..0fdab80c8cb 100644 --- a/example/topics/main.go +++ b/example/topics/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v44/github" + "github.com/google/go-github/v45/github" ) // Fetch and lists all the public topics associated with the specified GitHub topic diff --git a/github/doc.go b/github/doc.go index 49991e2f56f..38cda12b2b3 100644 --- a/github/doc.go +++ b/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v44/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v45/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to diff --git a/github/examples_test.go b/github/examples_test.go index 8981ca1291a..231b218c673 100644 --- a/github/examples_test.go +++ b/github/examples_test.go @@ -12,7 +12,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v44/github" + "github.com/google/go-github/v45/github" ) func ExampleClient_Markdown() { diff --git a/go.mod b/go.mod index a8a8d1a5c32..4c29e19843b 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v44 +module github.com/google/go-github/v45 require ( github.com/google/go-cmp v0.5.8 diff --git a/test/fields/fields.go b/test/fields/fields.go index 830cd272c75..170e5c9d77f 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -25,7 +25,7 @@ import ( "reflect" "strings" - "github.com/google/go-github/v44/github" + "github.com/google/go-github/v45/github" "golang.org/x/oauth2" ) diff --git a/test/integration/activity_test.go b/test/integration/activity_test.go index 2ca118f787a..ba1a5fd850a 100644 --- a/test/integration/activity_test.go +++ b/test/integration/activity_test.go @@ -12,7 +12,7 @@ import ( "context" "testing" - "github.com/google/go-github/v44/github" + "github.com/google/go-github/v45/github" ) const ( diff --git a/test/integration/authorizations_test.go b/test/integration/authorizations_test.go index a5283f9e224..3774a470f6b 100644 --- a/test/integration/authorizations_test.go +++ b/test/integration/authorizations_test.go @@ -17,7 +17,7 @@ import ( "testing" "time" - "github.com/google/go-github/v44/github" + "github.com/google/go-github/v45/github" ) const msgEnvMissing = "Skipping test because the required environment variable (%v) is not present." diff --git a/test/integration/github_test.go b/test/integration/github_test.go index d3f3f02a947..06690e8e32d 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -15,7 +15,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v44/github" + "github.com/google/go-github/v45/github" "golang.org/x/oauth2" ) diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index d2d3fe006f3..a3f017bd8fa 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -16,7 +16,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v44/github" + "github.com/google/go-github/v45/github" ) func TestRepositories_CRUD(t *testing.T) { diff --git a/test/integration/users_test.go b/test/integration/users_test.go index 1d1c2f9ddb9..aad2f05001d 100644 --- a/test/integration/users_test.go +++ b/test/integration/users_test.go @@ -14,7 +14,7 @@ import ( "math/rand" "testing" - "github.com/google/go-github/v44/github" + "github.com/google/go-github/v45/github" ) func TestUsers_Get(t *testing.T) { From 4ca1d673b251343ef62793d2d2a925c23adc5755 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Wed, 25 May 2022 11:04:16 -0400 Subject: [PATCH 013/751] Update scrape dependency to v45 (#2375) --- scrape/apps.go | 2 +- scrape/apps_test.go | 2 +- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scrape/apps.go b/scrape/apps.go index 2134e45289e..dd113c7ca46 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -17,7 +17,7 @@ import ( "strings" "github.com/PuerkitoBio/goquery" - "github.com/google/go-github/v44/github" + "github.com/google/go-github/v45/github" ) // AppRestrictionsEnabled returns whether the specified organization has diff --git a/scrape/apps_test.go b/scrape/apps_test.go index bfa628b8f6d..24fef52c44e 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v44/github" + "github.com/google/go-github/v45/github" ) func Test_AppRestrictionsEnabled(t *testing.T) { diff --git a/scrape/go.mod b/scrape/go.mod index b428c8fbdff..0767d1e70fc 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/v44 v44.1.0 + github.com/google/go-github/v45 v45.0.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 e064129d49a..f14a5b1628c 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/v44 v44.1.0 h1:shWPaufgdhr+Ad4eo/pZv9ORTxFpsxPEPEuuXAKIQGA= -github.com/google/go-github/v44 v44.1.0/go.mod h1:iWn00mWcP6PRWHhXm0zuFJ8wbEjE5AGO5D5HXYM4zgw= +github.com/google/go-github/v45 v45.0.0 h1:LU0WBjYidxIVyx7PZeWb+FP4JZJ3Wh3FQgdumnGqiLs= +github.com/google/go-github/v45 v45.0.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= From 0b5813fe43cc374cacb2e7492861af7d12199377 Mon Sep 17 00:00:00 2001 From: joshuahancox <67631498+joshuahancox@users.noreply.github.com> Date: Tue, 7 Jun 2022 14:39:55 +0100 Subject: [PATCH 014/751] Include RoleName field in Repository struct (#2379) Fixes: #2378 --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ github/github-stringify_test.go | 3 ++- github/repos.go | 4 ++++ 4 files changed, 24 insertions(+), 1 deletion(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 6da489c2cd1..774dc0bf0cc 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -14606,6 +14606,14 @@ func (r *Repository) GetReleasesURL() string { return *r.ReleasesURL } +// GetRoleName returns the RoleName field if it's non-nil, zero value otherwise. +func (r *Repository) GetRoleName() string { + if r == nil || r.RoleName == nil { + return "" + } + return *r.RoleName +} + // GetSecurityAndAnalysis returns the SecurityAndAnalysis field. func (r *Repository) GetSecurityAndAnalysis() *SecurityAndAnalysis { if r == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index ff018424cad..f07c21b8650 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -17031,6 +17031,16 @@ func TestRepository_GetReleasesURL(tt *testing.T) { r.GetReleasesURL() } +func TestRepository_GetRoleName(tt *testing.T) { + var zeroValue string + r := &Repository{RoleName: &zeroValue} + r.GetRoleName() + r = &Repository{} + r.GetRoleName() + r = nil + r.GetRoleName() +} + func TestRepository_GetSecurityAndAnalysis(tt *testing.T) { r := &Repository{} r.GetSecurityAndAnalysis() diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index f3934ec0df1..9c9e3a0a4b0 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -1575,8 +1575,9 @@ func TestRepository_String(t *testing.T) { 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:""}` + 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:""}` if got := v.String(); got != want { t.Errorf("Repository.String = %v, want %v", got, want) } diff --git a/github/repos.go b/github/repos.go index 13e0887ea7c..c9bbe5a7da2 100644 --- a/github/repos.go +++ b/github/repos.go @@ -140,6 +140,10 @@ type Repository struct { // overrides the field parameter when both are used. // Can be one of public, private or internal. Visibility *string `json:"visibility,omitempty"` + + // RoleName is only returned by the API 'check team permissions for a repository'. + // See: teams.go (IsTeamRepoByID) https://docs.github.com/en/rest/teams/teams#check-team-permissions-for-a-repository + RoleName *string `json:"role_name,omitempty"` } func (r Repository) String() string { From 6042406da470701c91cdb97c6d1b1e616e8001f2 Mon Sep 17 00:00:00 2001 From: Atsushi Nakagawa <49147168+46158n@users.noreply.github.com> Date: Mon, 13 Jun 2022 20:03:12 +0900 Subject: [PATCH 015/751] Add Actor field to WorkflowRun (#2381) --- github/actions_workflow_runs.go | 1 + github/actions_workflow_runs_test.go | 82 +++++++++++++++++++++++++++- github/github-accessors.go | 8 +++ github/github-accessors_test.go | 7 +++ 4 files changed, 97 insertions(+), 1 deletion(-) diff --git a/github/actions_workflow_runs.go b/github/actions_workflow_runs.go index de1e6c277ac..18fdd57d6a2 100644 --- a/github/actions_workflow_runs.go +++ b/github/actions_workflow_runs.go @@ -44,6 +44,7 @@ type WorkflowRun struct { WorkflowURL *string `json:"workflow_url,omitempty"` Repository *Repository `json:"repository,omitempty"` HeadRepository *Repository `json:"head_repository,omitempty"` + Actor *User `json:"actor,omitempty"` } // WorkflowRuns represents a slice of repository action workflow run. diff --git a/github/actions_workflow_runs_test.go b/github/actions_workflow_runs_test.go index 12f508054f6..d22b8a52e84 100644 --- a/github/actions_workflow_runs_test.go +++ b/github/actions_workflow_runs_test.go @@ -638,6 +638,26 @@ func TestWorkflowRun_Marshal(t *testing.T) { URL: String("u"), Name: String("n"), }, + Actor: &User{ + Login: String("l"), + ID: Int64(1), + AvatarURL: String("a"), + GravatarID: String("g"), + Name: String("n"), + Company: String("c"), + Blog: String("b"), + Location: String("l"), + Email: String("e"), + Hireable: Bool(true), + Bio: String("b"), + TwitterUsername: String("t"), + PublicRepos: Int(1), + Followers: Int(1), + Following: Int(1), + CreatedAt: &Timestamp{referenceTime}, + SuspendedAt: &Timestamp{referenceTime}, + URL: String("u"), + }, } want := `{ @@ -718,6 +738,26 @@ func TestWorkflowRun_Marshal(t *testing.T) { "id": 1, "url": "u", "name": "n" + }, + "actor": { + "login": "l", + "id": 1, + "avatar_url": "a", + "gravatar_id": "g", + "name": "n", + "company": "c", + "blog": "b", + "location": "l", + "email": "e", + "hireable": true, + "bio": "b", + "twitter_username": "t", + "public_repos": 1, + "followers": 1, + "following": 1, + "created_at": ` + referenceTimeStr + `, + "suspended_at": ` + referenceTimeStr + `, + "url": "u" } }` @@ -809,6 +849,26 @@ func TestWorkflowRuns_Marshal(t *testing.T) { URL: String("u"), Name: String("n"), }, + Actor: &User{ + Login: String("l"), + ID: Int64(1), + AvatarURL: String("a"), + GravatarID: String("g"), + Name: String("n"), + Company: String("c"), + Blog: String("b"), + Location: String("l"), + Email: String("e"), + Hireable: Bool(true), + Bio: String("b"), + TwitterUsername: String("t"), + PublicRepos: Int(1), + Followers: Int(1), + Following: Int(1), + CreatedAt: &Timestamp{referenceTime}, + SuspendedAt: &Timestamp{referenceTime}, + URL: String("u"), + }, }, }, } @@ -894,7 +954,27 @@ func TestWorkflowRuns_Marshal(t *testing.T) { "id": 1, "url": "u", "name": "n" - } + }, + "actor": { + "login": "l", + "id": 1, + "avatar_url": "a", + "gravatar_id": "g", + "name": "n", + "company": "c", + "blog": "b", + "location": "l", + "email": "e", + "hireable": true, + "bio": "b", + "twitter_username": "t", + "public_repos": 1, + "followers": 1, + "following": 1, + "created_at": ` + referenceTimeStr + `, + "suspended_at": ` + referenceTimeStr + `, + "url": "u" + } } ] }` diff --git a/github/github-accessors.go b/github/github-accessors.go index 774dc0bf0cc..c1cb0d1f4df 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -19654,6 +19654,14 @@ func (w *WorkflowJobEvent) GetWorkflowJob() *WorkflowJob { return w.WorkflowJob } +// GetActor returns the Actor field. +func (w *WorkflowRun) GetActor() *User { + if w == nil { + return nil + } + return w.Actor +} + // GetArtifactsURL returns the ArtifactsURL field if it's non-nil, zero value otherwise. func (w *WorkflowRun) GetArtifactsURL() string { if w == nil || w.ArtifactsURL == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index f07c21b8650..80134620170 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -22978,6 +22978,13 @@ func TestWorkflowJobEvent_GetWorkflowJob(tt *testing.T) { w.GetWorkflowJob() } +func TestWorkflowRun_GetActor(tt *testing.T) { + w := &WorkflowRun{} + w.GetActor() + w = nil + w.GetActor() +} + func TestWorkflowRun_GetArtifactsURL(tt *testing.T) { var zeroValue string w := &WorkflowRun{ArtifactsURL: &zeroValue} From 096a96b98e3e776334ed7c2124d3d678bb184d11 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Jun 2022 15:16:01 -0400 Subject: [PATCH 016/751] Bump github.com/google/go-github/v45 from 45.0.0 to 45.1.0 in /scrape (#2382) --- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 0767d1e70fc..f45b2178597 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.0.0 + github.com/google/go-github/v45 v45.1.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 f14a5b1628c..0a6015df8dd 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.0.0 h1:LU0WBjYidxIVyx7PZeWb+FP4JZJ3Wh3FQgdumnGqiLs= -github.com/google/go-github/v45 v45.0.0/go.mod h1:FObaZJEDSTa/WGCzZ2Z3eoCDXWJKMenWWTrd8jrta28= +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-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= From 3072c0afc8f37b55692ccc00ce978d1bc102a652 Mon Sep 17 00:00:00 2001 From: David Xia Date: Mon, 13 Jun 2022 12:34:06 -0700 Subject: [PATCH 017/751] docs fix: correct a comment (#2383) --- github/teams.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/teams.go b/github/teams.go index 77b38dd6dd1..38845e0953f 100644 --- a/github/teams.go +++ b/github/teams.go @@ -452,7 +452,7 @@ func (s *TeamsService) IsTeamRepoBySlug(ctx context.Context, org, slug, owner, r } // TeamAddTeamRepoOptions specifies the optional parameters to the -// TeamsService.AddTeamRepo method. +// TeamsService.AddTeamRepoByID and TeamsService.AddTeamRepoBySlug methods. type TeamAddTeamRepoOptions struct { // Permission specifies the permission to grant the team on this repository. // Possible values are: From 74c45994d78744a7e202b477c2b26bf5ca47bd52 Mon Sep 17 00:00:00 2001 From: Billy Lynch Date: Wed, 15 Jun 2022 15:50:58 -0400 Subject: [PATCH 018/751] Add missing common event fields (#2384) Closes: #1154 . --- github/event_types.go | 20 ++++++++--- github/github-accessors.go | 64 +++++++++++++++++++++++++++++++++ github/github-accessors_test.go | 56 +++++++++++++++++++++++++++++ 3 files changed, 135 insertions(+), 5 deletions(-) diff --git a/github/event_types.go b/github/event_types.go index c80a835f6b8..b550361848c 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -106,10 +106,11 @@ type CreateEvent struct { RefType *string `json:"ref_type,omitempty"` MasterBranch *string `json:"master_branch,omitempty"` Description *string `json:"description,omitempty"` + PusherType *string `json:"pusher_type,omitempty"` // The following fields are only populated by Webhook events. - PusherType *string `json:"pusher_type,omitempty"` Repo *Repository `json:"repository,omitempty"` + Org *Organization `json:"organization,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` } @@ -493,13 +494,14 @@ type IssuesEvent struct { type LabelEvent struct { // Action is the action that was performed. Possible values are: // "created", "edited", "deleted" - Action *string `json:"action,omitempty"` - Label *Label `json:"label,omitempty"` + Action *string `json:"action,omitempty"` + Label *Label `json:"label,omitempty"` + Changes *EditChange `json:"changes,omitempty"` // The following fields are only populated by Webhook events. - Changes *EditChange `json:"changes,omitempty"` Repo *Repository `json:"repository,omitempty"` Org *Organization `json:"organization,omitempty"` + Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` } @@ -574,6 +576,9 @@ type MetaEvent struct { Hook *Hook `json:"hook,omitempty"` // The following fields are only populated by Webhook events. + Repo *Repository `json:"repository,omitempty"` + Org *Organization `json:"organization,omitempty"` + Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` } @@ -682,7 +687,12 @@ type PingEvent struct { // The ID of the webhook that triggered the ping. HookID *int64 `json:"hook_id,omitempty"` // The webhook configuration. - Hook *Hook `json:"hook,omitempty"` + Hook *Hook `json:"hook,omitempty"` + + // The following fields are only populated by Webhook events. + Repo *Repository `json:"repository,omitempty"` + Org *Organization `json:"organization,omitempty"` + Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` } diff --git a/github/github-accessors.go b/github/github-accessors.go index c1cb0d1f4df..01fc3ceb8cb 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -3438,6 +3438,14 @@ func (c *CreateEvent) GetMasterBranch() string { return *c.MasterBranch } +// GetOrg returns the Org field. +func (c *CreateEvent) GetOrg() *Organization { + if c == nil { + return nil + } + return c.Org +} + // GetPusherType returns the PusherType field if it's non-nil, zero value otherwise. func (c *CreateEvent) GetPusherType() string { if c == nil || c.PusherType == nil { @@ -7902,6 +7910,14 @@ func (l *LabelEvent) GetRepo() *Repository { return l.Repo } +// GetSender returns the Sender field. +func (l *LabelEvent) GetSender() *User { + if l == nil { + return nil + } + return l.Sender +} + // GetColor returns the Color field if it's non-nil, zero value otherwise. func (l *LabelResult) GetColor() string { if l == nil || l.Color == nil { @@ -8742,6 +8758,30 @@ func (m *MetaEvent) GetInstallation() *Installation { return m.Installation } +// GetOrg returns the Org field. +func (m *MetaEvent) GetOrg() *Organization { + if m == nil { + return nil + } + return m.Org +} + +// GetRepo returns the Repo field. +func (m *MetaEvent) GetRepo() *Repository { + if m == nil { + return nil + } + return m.Repo +} + +// GetSender returns the Sender field. +func (m *MetaEvent) GetSender() *User { + if m == nil { + return nil + } + return m.Sender +} + // GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. func (m *Metric) GetHTMLURL() string { if m == nil || m.HTMLURL == nil { @@ -10766,6 +10806,30 @@ func (p *PingEvent) GetInstallation() *Installation { return p.Installation } +// GetOrg returns the Org field. +func (p *PingEvent) GetOrg() *Organization { + if p == nil { + return nil + } + return p.Org +} + +// GetRepo returns the Repo field. +func (p *PingEvent) GetRepo() *Repository { + if p == nil { + return nil + } + return p.Repo +} + +// GetSender returns the Sender field. +func (p *PingEvent) GetSender() *User { + if p == nil { + return nil + } + return p.Sender +} + // GetZen returns the Zen field if it's non-nil, zero value otherwise. func (p *PingEvent) GetZen() string { if p == nil || p.Zen == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 80134620170..dc827e65bb1 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -4022,6 +4022,13 @@ func TestCreateEvent_GetMasterBranch(tt *testing.T) { c.GetMasterBranch() } +func TestCreateEvent_GetOrg(tt *testing.T) { + c := &CreateEvent{} + c.GetOrg() + c = nil + c.GetOrg() +} + func TestCreateEvent_GetPusherType(tt *testing.T) { var zeroValue string c := &CreateEvent{PusherType: &zeroValue} @@ -9245,6 +9252,13 @@ func TestLabelEvent_GetRepo(tt *testing.T) { l.GetRepo() } +func TestLabelEvent_GetSender(tt *testing.T) { + l := &LabelEvent{} + l.GetSender() + l = nil + l.GetSender() +} + func TestLabelResult_GetColor(tt *testing.T) { var zeroValue string l := &LabelResult{Color: &zeroValue} @@ -10229,6 +10243,27 @@ func TestMetaEvent_GetInstallation(tt *testing.T) { m.GetInstallation() } +func TestMetaEvent_GetOrg(tt *testing.T) { + m := &MetaEvent{} + m.GetOrg() + m = nil + m.GetOrg() +} + +func TestMetaEvent_GetRepo(tt *testing.T) { + m := &MetaEvent{} + m.GetRepo() + m = nil + m.GetRepo() +} + +func TestMetaEvent_GetSender(tt *testing.T) { + m := &MetaEvent{} + m.GetSender() + m = nil + m.GetSender() +} + func TestMetric_GetHTMLURL(tt *testing.T) { var zeroValue string m := &Metric{HTMLURL: &zeroValue} @@ -12621,6 +12656,27 @@ func TestPingEvent_GetInstallation(tt *testing.T) { p.GetInstallation() } +func TestPingEvent_GetOrg(tt *testing.T) { + p := &PingEvent{} + p.GetOrg() + p = nil + p.GetOrg() +} + +func TestPingEvent_GetRepo(tt *testing.T) { + p := &PingEvent{} + p.GetRepo() + p = nil + p.GetRepo() +} + +func TestPingEvent_GetSender(tt *testing.T) { + p := &PingEvent{} + p.GetSender() + p = nil + p.GetSender() +} + func TestPingEvent_GetZen(tt *testing.T) { var zeroValue string p := &PingEvent{Zen: &zeroValue} From 697804fa0c8abebdfaa79ae8e7393d03de6ab86f Mon Sep 17 00:00:00 2001 From: Joshua Hancox <67631498+joshua-hancox@users.noreply.github.com> Date: Thu, 16 Jun 2022 17:45:18 +0100 Subject: [PATCH 019/751] Add RoleName field to User struct (#2386) --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ github/github-stringify_test.go | 3 ++- github/users.go | 5 +++-- 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 01fc3ceb8cb..6131fad9b8e 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -18774,6 +18774,14 @@ func (u *User) GetReposURL() string { return *u.ReposURL } +// GetRoleName returns the RoleName field if it's non-nil, zero value otherwise. +func (u *User) GetRoleName() string { + if u == nil || u.RoleName == nil { + return "" + } + return *u.RoleName +} + // GetSiteAdmin returns the SiteAdmin field if it's non-nil, zero value otherwise. func (u *User) GetSiteAdmin() bool { if u == nil || u.SiteAdmin == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index dc827e65bb1..27ad0c8133b 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -21914,6 +21914,16 @@ func TestUser_GetReposURL(tt *testing.T) { u.GetReposURL() } +func TestUser_GetRoleName(tt *testing.T) { + var zeroValue string + u := &User{RoleName: &zeroValue} + u.GetRoleName() + u = &User{} + u.GetRoleName() + u = nil + u.GetRoleName() +} + func TestUser_GetSiteAdmin(tt *testing.T) { var zeroValue bool u := &User{SiteAdmin: &zeroValue} diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index 9c9e3a0a4b0..fa7599d3590 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -1904,8 +1904,9 @@ func TestUser_String(t *testing.T) { ReposURL: String(""), StarredURL: String(""), SubscriptionsURL: String(""), + RoleName: String(""), } - want := `github.User{Login:"", ID:0, NodeID:"", AvatarURL:"", HTMLURL:"", GravatarID:"", Name:"", Company:"", Blog:"", Location:"", Email:"", Hireable:false, Bio:"", TwitterUsername:"", PublicRepos:0, PublicGists:0, Followers:0, Following:0, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, SuspendedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Type:"", SiteAdmin:false, TotalPrivateRepos:0, OwnedPrivateRepos:0, PrivateGists:0, DiskUsage:0, Collaborators:0, TwoFactorAuthentication:false, Plan:github.Plan{}, LdapDn:"", URL:"", EventsURL:"", FollowingURL:"", FollowersURL:"", GistsURL:"", OrganizationsURL:"", ReceivedEventsURL:"", ReposURL:"", StarredURL:"", SubscriptionsURL:""}` + want := `github.User{Login:"", ID:0, NodeID:"", AvatarURL:"", HTMLURL:"", GravatarID:"", Name:"", Company:"", Blog:"", Location:"", Email:"", Hireable:false, Bio:"", TwitterUsername:"", PublicRepos:0, PublicGists:0, Followers:0, Following:0, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, SuspendedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Type:"", SiteAdmin:false, TotalPrivateRepos:0, OwnedPrivateRepos:0, PrivateGists:0, DiskUsage:0, Collaborators:0, TwoFactorAuthentication:false, Plan:github.Plan{}, LdapDn:"", URL:"", EventsURL:"", FollowingURL:"", FollowersURL:"", GistsURL:"", OrganizationsURL:"", ReceivedEventsURL:"", ReposURL:"", StarredURL:"", SubscriptionsURL:"", RoleName:""}` if got := v.String(); got != want { t.Errorf("User.String = %v, want %v", got, want) } diff --git a/github/users.go b/github/users.go index e694e05416c..d40d23e90fe 100644 --- a/github/users.go +++ b/github/users.go @@ -66,9 +66,10 @@ type User struct { // See: search.go and https://docs.github.com/en/rest/search/#text-match-metadata TextMatches []*TextMatch `json:"text_matches,omitempty"` - // Permissions identifies the permissions that a user has on a given - // repository. This is only populated when calling Repositories.ListCollaborators. + // Permissions and RoleName identify the permissions and role that a user has on a given + // repository. These are only populated when calling Repositories.ListCollaborators. Permissions map[string]bool `json:"permissions,omitempty"` + RoleName *string `json:"role_name,omitempty"` } func (u User) String() string { From b1cb42ad816a29148e3df31c8a494603059dc6b0 Mon Sep 17 00:00:00 2001 From: Garrett Date: Sun, 19 Jun 2022 09:38:15 -0400 Subject: [PATCH 020/751] Add support for repo setting `use_squash_pr_title_as_default` (#2390) --- github/github-accessors.go | 8 ++ github/github-accessors_test.go | 10 ++ github/github-stringify_test.go | 197 ++++++++++++++++---------------- github/repos.go | 155 +++++++++++++------------ 4 files changed, 196 insertions(+), 174 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 6131fad9b8e..7fa5a093b9e 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -14822,6 +14822,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 { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 27ad0c8133b..baf47a710da 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -17268,6 +17268,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} diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index fa7599d3590..bc54a879993 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -1480,104 +1480,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/repos.go b/github/repos.go index c9bbe5a7da2..a5f7fc6cf81 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) From 8309da114464ce3686f71058945ff561a6189b24 Mon Sep 17 00:00:00 2001 From: Takashi Yoneuchi Date: Mon, 20 Jun 2022 19:54:32 +0900 Subject: [PATCH 021/751] Add MembersCanForkPrivateRepositories field to Organization struct (#2389) --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ github/github-stringify_test.go | 3 ++- github/orgs.go | 3 +++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 7fa5a093b9e..0092c588407 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -9622,6 +9622,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 { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index baf47a710da..bf5008f53a2 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -11281,6 +11281,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} diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index bc54a879993..d056c680918 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) } diff --git a/github/orgs.go b/github/orgs.go index 80979db350c..26b55c62d03 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". // From 404bf94e5de6efefc412607efca24747f0db6ebc Mon Sep 17 00:00:00 2001 From: Parker Moore <237985+parkr@users.noreply.github.com> Date: Thu, 23 Jun 2022 19:53:08 -0700 Subject: [PATCH 022/751] Add state_reason to IssuesService.Edit (#2395) Fixes: #2393. --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ github/issues.go | 16 +++++++++------- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 0092c588407..da146bcbf23 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -7630,6 +7630,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 { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index bf5008f53a2..5d30ec960a3 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -8938,6 +8938,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} diff --git a/github/issues.go b/github/issues.go index 12488f9815e..351ec09cc4f 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 From 68c844835da37a9ea839bb79bd0644fb22a5d9dd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Jun 2022 16:26:40 -0400 Subject: [PATCH 023/751] Bump github.com/google/go-github/v45 from 45.1.0 to 45.2.0 in /scrape (#2399) --- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index f45b2178597..e2c02f00a2c 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 0a6015df8dd..3c105db4a75 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= From fd22ee93382e50d36592170f63c6a08d7c35ed8d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Jun 2022 16:35:01 -0400 Subject: [PATCH 024/751] Bump styfle/cancel-workflow-action from 0.9.1 to 0.10.0 (#2398) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c43bda3815d..b62f175b7c7 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 }} From 848f7e4097f8537b964c0e0664d9b40292288c60 Mon Sep 17 00:00:00 2001 From: Tobias Gesellchen Date: Tue, 12 Jul 2022 14:47:10 +0200 Subject: [PATCH 025/751] Support PagesSource as struct for update pages API (#2407) Fixes: #2406. --- github/github-accessors.go | 10 +++++----- github/github-accessors_test.go | 5 +---- github/repos_pages.go | 6 ++++-- github/repos_pages_test.go | 16 ++++++++-------- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index da146bcbf23..2efe1d43e34 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -10790,12 +10790,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. diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 5d30ec960a3..ac370a0f1dd 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -12643,10 +12643,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() diff --git a/github/repos_pages.go b/github/repos_pages.go index 9b864eb090c..737cec0f22a 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_pages_test.go b/github/repos_pages_test.go index 46bffcff591..ed17e735204 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) From 645b457b1d1a182ef7230e61ea0b264dc32dca40 Mon Sep 17 00:00:00 2001 From: Atsushi Nakagawa <49147168+46158n@users.noreply.github.com> Date: Thu, 14 Jul 2022 21:52:35 +0900 Subject: [PATCH 026/751] Add RunAttempt field to AuditEntry (#2411) Fixes: #2410 . --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ github/orgs_audit_log.go | 1 + github/orgs_audit_log_test.go | 2 ++ 4 files changed, 21 insertions(+) diff --git a/github/github-accessors.go b/github/github-accessors.go index 2efe1d43e34..2a176a9b7d1 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 { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index ac370a0f1dd..0441389391e 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} diff --git a/github/orgs_audit_log.go b/github/orgs_audit_log.go index 52bacfed9a2..be5fd24d6ed 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/orgs_audit_log_test.go b/github/orgs_audit_log_test.go index c2beca2bdd6..1f060072452 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, From 3a432d62bf0318c14b2d1d7415bf94ea1a884342 Mon Sep 17 00:00:00 2001 From: Christian Bargmann Date: Sun, 17 Jul 2022 01:11:47 +0200 Subject: [PATCH 027/751] Add GetCodeownersErrors to RepositoriesService (#2408) Fixes: #2405 . --- github/github-accessors.go | 8 +++ github/github-accessors_test.go | 10 +++ github/repos_codeowners.go | 46 +++++++++++++ github/repos_codeowners_test.go | 110 ++++++++++++++++++++++++++++++++ 4 files changed, 174 insertions(+) create mode 100644 github/repos_codeowners.go create mode 100644 github/repos_codeowners_test.go diff --git a/github/github-accessors.go b/github/github-accessors.go index 2a176a9b7d1..334ff395100 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -2294,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 { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 0441389391e..4339a879f65 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -2709,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} diff --git a/github/repos_codeowners.go b/github/repos_codeowners.go new file mode 100644 index 00000000000..835d56e164c --- /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_codeowners_test.go b/github/repos_codeowners_test.go new file mode 100644 index 00000000000..62c58c5b192 --- /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) +} From aff6c4b70d083d485dda760dda68d093f624973a Mon Sep 17 00:00:00 2001 From: Ash Ranjan <49772172+Ashvin-Ranjan@users.noreply.github.com> Date: Tue, 2 Aug 2022 16:45:25 -0700 Subject: [PATCH 028/751] Remove omitempty from Content field of RepositoryContentFileOptions (#2430) Fixes: #2427 --- github/repos_contents.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/repos_contents.go b/github/repos_contents.go index d6f2dd9d74f..431d4b12dc2 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"` From 6212c6739a4c246a50c1ffc034f964bb7e0bd311 Mon Sep 17 00:00:00 2001 From: Brandon Butler Date: Sat, 13 Aug 2022 14:28:40 -0700 Subject: [PATCH 029/751] Add BypassPullRequestAllowances field (#2432) Fixes: #2431 --- github/github-accessors.go | 24 +++++++++++++++++ github/github-accessors_test.go | 21 +++++++++++++++ github/repos.go | 29 +++++++++++++++++++++ github/repos_test.go | 46 +++++++++++++++++++++++++++++++-- 4 files changed, 118 insertions(+), 2 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 334ff395100..d84f5697b56 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -12910,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 { @@ -12918,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 { @@ -12926,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 { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 4339a879f65..d8c4024c82e 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -15019,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() @@ -15026,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() @@ -15033,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() diff --git a/github/repos.go b/github/repos.go index a5f7fc6cf81..d5ac51126b2 100644 --- a/github/repos.go +++ b/github/repos.go @@ -919,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. @@ -934,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. @@ -951,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. @@ -1012,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_test.go b/github/repos_test.go index 0bf228ebafe..6b8cbbd22ba 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{ From 56a9096b517f4d043ad08e8618c0b56c81e2134b Mon Sep 17 00:00:00 2001 From: David Gamba Date: Sat, 13 Aug 2022 15:31:04 -0600 Subject: [PATCH 030/751] Add 'pending_deployments' endpoint support (#2422) Fixes: #2421 --- github/actions_workflow_runs.go | 28 +++++++++++++++++ github/actions_workflow_runs_test.go | 45 ++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) diff --git a/github/actions_workflow_runs.go b/github/actions_workflow_runs.go index 18fdd57d6a2..9fd01c4a563 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/actions_workflow_runs_test.go b/github/actions_workflow_runs_test.go index d22b8a52e84..2705363ba64 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 + }) +} From 7a7c657f42c88138cb656d17bf04e1cd00269e48 Mon Sep 17 00:00:00 2001 From: Damian <96030739+dsm-kb@users.noreply.github.com> Date: Sun, 14 Aug 2022 09:32:51 +1200 Subject: [PATCH 031/751] Add git LFS - large file storage - control (#2429) --- github/repos_lfs.go | 49 ++++++++++++++++++++++++++++++ github/repos_lfs_test.go | 64 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 113 insertions(+) create mode 100644 github/repos_lfs.go create mode 100644 github/repos_lfs_test.go diff --git a/github/repos_lfs.go b/github/repos_lfs.go new file mode 100644 index 00000000000..6ac2e5a8778 --- /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_lfs_test.go b/github/repos_lfs_test.go new file mode 100644 index 00000000000..f171b6e36af --- /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") + }) +} From aa96e8d5f31770edf79a574b34954616a4d51a27 Mon Sep 17 00:00:00 2001 From: Jianyu Feng <106984157+jfengupgrade@users.noreply.github.com> Date: Sat, 13 Aug 2022 18:15:57 -0400 Subject: [PATCH 032/751] Add tag protection (#2424) --- example/tagprotection/main.go | 76 ++++++++++++++++++ github/github-accessors.go | 16 ++++ github/github-accessors_test.go | 20 +++++ github/repos_tags.go | 76 ++++++++++++++++++ github/repos_tags_test.go | 132 ++++++++++++++++++++++++++++++++ 5 files changed, 320 insertions(+) create mode 100644 example/tagprotection/main.go create mode 100644 github/repos_tags.go create mode 100644 github/repos_tags_test.go diff --git a/example/tagprotection/main.go b/example/tagprotection/main.go new file mode 100644 index 00000000000..6f347b97ed6 --- /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/github-accessors.go b/github/github-accessors.go index d84f5697b56..013780bff9c 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -17326,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/github-accessors_test.go b/github/github-accessors_test.go index d8c4024c82e..984a69b77d8 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -20203,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/repos_tags.go b/github/repos_tags.go new file mode 100644 index 00000000000..ff46d90c731 --- /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/repos_tags_test.go b/github/repos_tags_test.go new file mode 100644 index 00000000000..e5e15a693c0 --- /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) + }) +} From 744a645ee7cce5aa35693d4c4e7b72a0de5bc77d Mon Sep 17 00:00:00 2001 From: DarkMatterV <90494331+DarkMatterV@users.noreply.github.com> Date: Sun, 14 Aug 2022 06:18:19 +0800 Subject: [PATCH 033/751] Add TextMatch custom header to other search type custom headers (#2388) Fixes: #2385. --- github/search.go | 22 +++++++----- github/search_test.go | 80 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+), 9 deletions(-) diff --git a/github/search.go b/github/search.go index 344f1bb9855..4d166640586 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/github/search_test.go b/github/search_test.go index 4562fcf51ec..0d49b36c190 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() From 388289c9ef204fc070ff6e50f1c80407e9919982 Mon Sep 17 00:00:00 2001 From: Emil V Date: Sun, 14 Aug 2022 00:19:27 +0200 Subject: [PATCH 034/751] Add support for parsing code_scanning_alerts in webhooks (#2392) Fixes: #2391. --- github/event.go | 2 ++ github/messages.go | 1 + github/messages_test.go | 4 ++++ github/repos_hooks_deliveries_test.go | 1 + 4 files changed, 8 insertions(+) diff --git a/github/event.go b/github/event.go index 5a052de09c1..4cacf0a83f7 100644 --- a/github/event.go +++ b/github/event.go @@ -36,6 +36,8 @@ func (e *Event) ParsePayload() (payload interface{}, err error) { payload = &CheckRunEvent{} case "CheckSuiteEvent": payload = &CheckSuiteEvent{} + case "CodeScanningAlertEvent": + payload = &CodeScanningAlertEvent{} case "CommitCommentEvent": payload = &CommitCommentEvent{} case "ContentReferenceEvent": diff --git a/github/messages.go b/github/messages.go index 44477ddb0de..05cffb4b49a 100644 --- a/github/messages.go +++ b/github/messages.go @@ -48,6 +48,7 @@ var ( "branch_protection_rule": "BranchProtectionRuleEvent", "check_run": "CheckRunEvent", "check_suite": "CheckSuiteEvent", + "code_scanning_alert": "CodeScanningAlertEvent", "commit_comment": "CommitCommentEvent", "content_reference": "ContentReferenceEvent", "create": "CreateEvent", diff --git a/github/messages_test.go b/github/messages_test.go index 1d999c964af..083cec9a413 100644 --- a/github/messages_test.go +++ b/github/messages_test.go @@ -273,6 +273,10 @@ func TestParseWebHook(t *testing.T) { payload: &CheckSuiteEvent{}, messageType: "check_suite", }, + { + payload: &CodeScanningAlertEvent{}, + messageType: "code_scanning_alert", + }, { payload: &CommitCommentEvent{}, messageType: "commit_comment", diff --git a/github/repos_hooks_deliveries_test.go b/github/repos_hooks_deliveries_test.go index f136639b2c4..44b0f89abb6 100644 --- a/github/repos_hooks_deliveries_test.go +++ b/github/repos_hooks_deliveries_test.go @@ -145,6 +145,7 @@ func TestRepositoriesService_RedeliverHookDelivery(t *testing.T) { var hookDeliveryPayloadTypeToStruct = map[string]interface{}{ "check_run": &CheckRunEvent{}, "check_suite": &CheckSuiteEvent{}, + "code_scanning_alert": &CodeScanningAlertEvent{}, "commit_comment": &CommitCommentEvent{}, "content_reference": &ContentReferenceEvent{}, "create": &CreateEvent{}, From ce1f6b9329d7bd161376995de0e7616585bc9105 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Sat, 13 Aug 2022 18:20:47 -0400 Subject: [PATCH 035/751] Change DependabotSecretsSelectedRepoIDs to []string (#2401) Fixes #2400. --- github/actions_secrets.go | 2 +- github/dependabot_secrets.go | 26 +++++++++++++++++++++----- github/dependabot_secrets_test.go | 16 ++++++++-------- 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/github/actions_secrets.go b/github/actions_secrets.go index dc057edba21..316badb70d6 100644 --- a/github/actions_secrets.go +++ b/github/actions_secrets.go @@ -186,7 +186,7 @@ func (s *ActionsService) GetEnvSecret(ctx context.Context, repoID int, env, secr return s.getSecret(ctx, url) } -// SelectedRepoIDs are the repository IDs that have access to the secret. +// SelectedRepoIDs are the repository IDs that have access to the actions secrets. type SelectedRepoIDs []int64 // EncryptedSecret represents a secret that is encrypted using a public key. diff --git a/github/dependabot_secrets.go b/github/dependabot_secrets.go index f51f3396bdc..8318cd812cf 100644 --- a/github/dependabot_secrets.go +++ b/github/dependabot_secrets.go @@ -110,7 +110,20 @@ func (s *DependabotService) GetOrgSecret(ctx context.Context, org, name string) return s.getSecret(ctx, url) } -func (s *DependabotService) putSecret(ctx context.Context, url string, eSecret *EncryptedSecret) (*Response, error) { +// DependabotEncryptedSecret represents a secret that is encrypted using a public key for Dependabot. +// +// The value of EncryptedValue must be your secret, encrypted with +// LibSodium (see documentation here: https://libsodium.gitbook.io/doc/bindings_for_other_languages) +// using the public key retrieved using the GetPublicKey method. +type DependabotEncryptedSecret struct { + Name string `json:"-"` + KeyID string `json:"key_id"` + EncryptedValue string `json:"encrypted_value"` + Visibility string `json:"visibility,omitempty"` + SelectedRepositoryIDs DependabotSecretsSelectedRepoIDs `json:"selected_repository_ids,omitempty"` +} + +func (s *DependabotService) putSecret(ctx context.Context, url string, eSecret *DependabotEncryptedSecret) (*Response, error) { req, err := s.client.NewRequest("PUT", url, eSecret) if err != nil { return nil, err @@ -122,7 +135,7 @@ func (s *DependabotService) putSecret(ctx context.Context, url string, eSecret * // CreateOrUpdateRepoSecret creates or updates a repository Dependabot secret with an encrypted value. // // GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#create-or-update-a-repository-secret -func (s *DependabotService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *EncryptedSecret) (*Response, error) { +func (s *DependabotService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *DependabotEncryptedSecret) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/secrets/%v", owner, repo, eSecret.Name) return s.putSecret(ctx, url, eSecret) } @@ -130,7 +143,7 @@ func (s *DependabotService) CreateOrUpdateRepoSecret(ctx context.Context, owner, // CreateOrUpdateOrgSecret creates or updates an organization Dependabot secret with an encrypted value. // // GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#create-or-update-an-organization-secret -func (s *DependabotService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *EncryptedSecret) (*Response, error) { +func (s *DependabotService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *DependabotEncryptedSecret) (*Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v", org, eSecret.Name) return s.putSecret(ctx, url, eSecret) } @@ -184,13 +197,16 @@ func (s *DependabotService) ListSelectedReposForOrgSecret(ctx context.Context, o return result, resp, nil } +// DependabotSecretsSelectedRepoIDs are the repository IDs that have access to the dependabot secrets. +type DependabotSecretsSelectedRepoIDs []string + // SetSelectedReposForOrgSecret sets the repositories that have access to a Dependabot secret. // // GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret -func (s *DependabotService) SetSelectedReposForOrgSecret(ctx context.Context, org, name string, ids SelectedRepoIDs) (*Response, error) { +func (s *DependabotService) SetSelectedReposForOrgSecret(ctx context.Context, org, name string, ids DependabotSecretsSelectedRepoIDs) (*Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v/repositories", org, name) type repoIDs struct { - SelectedIDs SelectedRepoIDs `json:"selected_repository_ids"` + SelectedIDs DependabotSecretsSelectedRepoIDs `json:"selected_repository_ids"` } req, err := s.client.NewRequest("PUT", url, repoIDs{SelectedIDs: ids}) diff --git a/github/dependabot_secrets_test.go b/github/dependabot_secrets_test.go index 49b93e760cf..49ddaab61e2 100644 --- a/github/dependabot_secrets_test.go +++ b/github/dependabot_secrets_test.go @@ -178,7 +178,7 @@ func TestDependabotService_CreateOrUpdateRepoSecret(t *testing.T) { w.WriteHeader(http.StatusCreated) }) - input := &EncryptedSecret{ + input := &DependabotEncryptedSecret{ Name: "NAME", EncryptedValue: "QIv=", KeyID: "1234", @@ -352,16 +352,16 @@ func TestDependabotService_CreateOrUpdateOrgSecret(t *testing.T) { mux.HandleFunc("/orgs/o/dependabot/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") testHeader(t, r, "Content-Type", "application/json") - testBody(t, r, `{"key_id":"1234","encrypted_value":"QIv=","visibility":"selected","selected_repository_ids":[1296269,1269280]}`+"\n") + testBody(t, r, `{"key_id":"1234","encrypted_value":"QIv=","visibility":"selected","selected_repository_ids":["1296269","1269280"]}`+"\n") w.WriteHeader(http.StatusCreated) }) - input := &EncryptedSecret{ + input := &DependabotEncryptedSecret{ Name: "NAME", EncryptedValue: "QIv=", KeyID: "1234", Visibility: "selected", - SelectedRepositoryIDs: SelectedRepoIDs{1296269, 1269280}, + SelectedRepositoryIDs: DependabotSecretsSelectedRepoIDs{"1296269", "1269280"}, } ctx := context.Background() _, err := client.Dependabot.CreateOrUpdateOrgSecret(ctx, "o", input) @@ -428,23 +428,23 @@ func TestDependabotService_SetSelectedReposForOrgSecret(t *testing.T) { mux.HandleFunc("/orgs/o/dependabot/secrets/NAME/repositories", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") testHeader(t, r, "Content-Type", "application/json") - testBody(t, r, `{"selected_repository_ids":[64780797]}`+"\n") + testBody(t, r, `{"selected_repository_ids":["64780797"]}`+"\n") }) ctx := context.Background() - _, err := client.Dependabot.SetSelectedReposForOrgSecret(ctx, "o", "NAME", SelectedRepoIDs{64780797}) + _, err := client.Dependabot.SetSelectedReposForOrgSecret(ctx, "o", "NAME", DependabotSecretsSelectedRepoIDs{"64780797"}) if err != nil { t.Errorf("Dependabot.SetSelectedReposForOrgSecret returned error: %v", err) } const methodName = "SetSelectedReposForOrgSecret" testBadOptions(t, methodName, func() (err error) { - _, err = client.Dependabot.SetSelectedReposForOrgSecret(ctx, "\n", "\n", SelectedRepoIDs{64780797}) + _, err = client.Dependabot.SetSelectedReposForOrgSecret(ctx, "\n", "\n", DependabotSecretsSelectedRepoIDs{"64780797"}) return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Dependabot.SetSelectedReposForOrgSecret(ctx, "o", "NAME", SelectedRepoIDs{64780797}) + return client.Dependabot.SetSelectedReposForOrgSecret(ctx, "o", "NAME", DependabotSecretsSelectedRepoIDs{"64780797"}) }) } From f2d99f17ead8dd906d8598ac43f99996b647a614 Mon Sep 17 00:00:00 2001 From: Tim Rogers Date: Sat, 13 Aug 2022 23:22:20 +0100 Subject: [PATCH 036/751] Include the version of `go-github` in `User-Agent` headers sent to the GitHub API (#2403) --- CONTRIBUTING.md | 2 ++ github/github.go | 10 ++++++---- github/github_test.go | 10 ++++++++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ef94c683a8a..25d455b8f77 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -127,3 +127,5 @@ this][modified-comment]. [git-aliases]: https://github.com/willnorris/dotfiles/blob/d640d010c23b1116bdb3d4dc12088ed26120d87d/git/.gitconfig#L13-L15 [rebase-comment]: https://github.com/google/go-github/pull/277#issuecomment-183035491 [modified-comment]: https://github.com/google/go-github/pull/280#issuecomment-184859046 + +**When creating a release, don't forget to update the `Version` constant in `github.go`.** This is used to send the version in the `User-Agent` header to identify clients to the GitHub API. diff --git a/github/github.go b/github/github.go index 08b7db8e55b..fe346f5ab72 100644 --- a/github/github.go +++ b/github/github.go @@ -28,9 +28,11 @@ import ( ) const ( - defaultBaseURL = "https://api.github.com/" - uploadBaseURL = "https://uploads.github.com/" - userAgent = "go-github" + Version = "45.2.0" + + defaultBaseURL = "https://api.github.com/" + defaultUserAgent = "go-github" + "/" + Version + uploadBaseURL = "https://uploads.github.com/" headerRateLimit = "X-RateLimit-Limit" headerRateRemaining = "X-RateLimit-Remaining" @@ -301,7 +303,7 @@ func NewClient(httpClient *http.Client) *Client { baseURL, _ := url.Parse(defaultBaseURL) uploadURL, _ := url.Parse(uploadBaseURL) - c := &Client{client: httpClient, BaseURL: baseURL, UserAgent: userAgent, UploadURL: uploadURL} + c := &Client{client: httpClient, BaseURL: baseURL, UserAgent: defaultUserAgent, UploadURL: uploadURL} c.common.client = c c.Actions = (*ActionsService)(&c.common) c.Activity = (*ActivityService)(&c.common) diff --git a/github/github_test.go b/github/github_test.go index 0a28ced93c6..3fa5b4412a4 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -248,7 +248,7 @@ func TestNewClient(t *testing.T) { if got, want := c.BaseURL.String(), defaultBaseURL; got != want { t.Errorf("NewClient BaseURL is %v, want %v", got, want) } - if got, want := c.UserAgent, userAgent; got != want { + if got, want := c.UserAgent, defaultUserAgent; got != want { t.Errorf("NewClient UserAgent is %v, want %v", got, want) } @@ -507,10 +507,16 @@ func TestNewRequest(t *testing.T) { t.Errorf("NewRequest(%q) Body is %v, want %v", inBody, got, want) } + userAgent := req.Header.Get("User-Agent") + // test that default user-agent is attached to the request - if got, want := req.Header.Get("User-Agent"), c.UserAgent; got != want { + if got, want := userAgent, c.UserAgent; got != want { t.Errorf("NewRequest() User-Agent is %v, want %v", got, want) } + + if !strings.Contains(userAgent, Version) { + t.Errorf("NewRequest() User-Agent should contain %v, found %v", Version, userAgent) + } } func TestNewRequest_invalidJSON(t *testing.T) { From acca0b62de36d60755085628907f4f6febdbaba1 Mon Sep 17 00:00:00 2001 From: Kevin Wang Date: Sat, 13 Aug 2022 18:28:28 -0400 Subject: [PATCH 037/751] Update README.md with additional auth use case (#2434) --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 2b70743a85f..d6a98dfe1de 100644 --- a/README.md +++ b/README.md @@ -117,11 +117,23 @@ See the [oauth2 docs][] for complete instructions on using that library. For API methods that require HTTP Basic Authentication, use the [`BasicAuthTransport`](https://godoc.org/github.com/google/go-github/github#BasicAuthTransport). +#### As a GitHub App #### + GitHub Apps authentication can be provided by the [ghinstallation](https://github.com/bradleyfalzon/ghinstallation) package. +> **Note**: Most endpoints (ex. [`GET /rate_limit`]) require access token authentication +> while a few others (ex. [`GET /app/hook/deliverires`]) require [JWT] authentication. + +[`GET /rate_limit`]: https://docs.github.com/en/rest/rate-limit#get-rate-limit-status-for-the-authenticated-user +[`GET /app/hook/deliverires`]: https://docs.github.com/en/rest/apps/webhooks#list-deliveries-for-an-app-webhook +[JWT]: https://docs.github.com/en/developers/apps/building-github-apps/authenticating-with-github-apps#authenticating-as-a-github-app + + ```go import ( + "net/http" + "github.com/bradleyfalzon/ghinstallation/v2" "github.com/google/go-github/v45/github" ) @@ -129,6 +141,10 @@ import ( func main() { // Wrap the shared transport for use with the integration ID 1 authenticating with installation ID 99. itr, err := ghinstallation.NewKeyFromFile(http.DefaultTransport, 1, 99, "2016-10-19.private-key.pem") + + // Or for endpoints that require JWT authentication + // itr, err := ghinstallation.NewAppsTransportKeyFromFile(http.DefaultTransport, 1, "2016-10-19.private-key.pem") + if err != nil { // Handle error. } From 903be146349e5f7350c01c6b99778a6d82316ba0 Mon Sep 17 00:00:00 2001 From: Jamie West Date: Thu, 18 Aug 2022 13:20:45 +0100 Subject: [PATCH 038/751] Add API and Web to meta api endpoint (#2435) --- github/misc.go | 8 ++++++++ github/misc_test.go | 10 ++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/github/misc.go b/github/misc.go index 412d1e2b95d..89615241570 100644 --- a/github/misc.go +++ b/github/misc.go @@ -176,6 +176,14 @@ type APIMeta struct { // An array of SSH keys. SSHKeys []string `json:"ssh_keys,omitempty"` + + // An array of IP addresses in CIDR format specifying the addresses + // which serve GitHub websites. + Web []string `json:"web,omitempty"` + + // An array of IP addresses in CIDR format specifying the addresses + // which serve GitHub APIs. + API []string `json:"api,omitempty"` } // APIMeta returns information about GitHub.com, the service. Or, if you access diff --git a/github/misc_test.go b/github/misc_test.go index fc91d712948..4e88ec54529 100644 --- a/github/misc_test.go +++ b/github/misc_test.go @@ -190,6 +190,8 @@ func TestAPIMeta_Marshal(t *testing.T) { Dependabot: []string{"d"}, SSHKeyFingerprints: map[string]string{"a": "f"}, SSHKeys: []string{"k"}, + API: []string{"a"}, + Web: []string{"w"}, } want := `{ "hooks":["h"], @@ -200,7 +202,9 @@ func TestAPIMeta_Marshal(t *testing.T) { "actions":["a"], "dependabot":["d"], "ssh_key_fingerprints":{"a":"f"}, - "ssh_keys":["k"] + "ssh_keys":["k"], + "api":["a"], + "web":["w"] }` testJSONMarshal(t, a, want) @@ -212,7 +216,7 @@ func TestAPIMeta(t *testing.T) { mux.HandleFunc("/meta", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - fmt.Fprint(w, `{"hooks":["h"], "git":["g"], "pages":["p"], "importer":["i"], "actions":["a"], "dependabot":["d"], "verifiable_password_authentication": true}`) + fmt.Fprint(w, `{"web":["w"],"api":["a"],"hooks":["h"], "git":["g"], "pages":["p"], "importer":["i"], "actions":["a"], "dependabot":["d"], "verifiable_password_authentication": true}`) }) ctx := context.Background() @@ -228,6 +232,8 @@ func TestAPIMeta(t *testing.T) { Importer: []string{"i"}, Actions: []string{"a"}, Dependabot: []string{"d"}, + API: []string{"a"}, + Web: []string{"w"}, VerifiablePasswordAuthentication: Bool(true), } From f6bffcf431f8ab7e3b5a65fdf624bad91195c0b9 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Fri, 19 Aug 2022 10:22:28 -0400 Subject: [PATCH 039/751] Bump version of go-github library to v46 (#2437) --- README.md | 14 +++--- example/actionpermissions/main.go | 2 +- example/appengine/app.go | 2 +- example/basicauth/main.go | 2 +- example/commitpr/main.go | 2 +- example/go.mod | 6 +-- example/go.sum | 4 +- example/listenvironments/main.go | 11 ++--- example/migrations/main.go | 2 +- example/newfilewithappauth/main.go | 2 +- example/newrepo/main.go | 2 +- example/newreposecretwithlibsodium/go.sum | 13 ++---- example/newreposecretwithlibsodium/main.go | 2 + example/newreposecretwithxcrypto/main.go | 4 +- example/simple/main.go | 3 +- example/tagprotection/main.go | 2 +- example/tokenauth/main.go | 2 +- example/topics/main.go | 2 +- github/activity.go | 17 +++---- github/apps.go | 5 ++- github/doc.go | 15 +++---- github/examples_test.go | 2 +- github/github.go | 24 +++++----- github/messages.go | 52 +++++++++++----------- github/pulls_reviews.go | 32 ++++++------- github/repos.go | 8 ++-- github/scim.go | 2 +- github/search.go | 6 ++- go.mod | 2 +- test/fields/fields.go | 2 +- test/integration/activity_test.go | 2 +- test/integration/authorizations_test.go | 2 +- test/integration/github_test.go | 2 +- test/integration/repos_test.go | 2 +- test/integration/users_test.go | 2 +- update-urls/go.mod | 2 +- update-urls/main.go | 12 ++--- 37 files changed, 136 insertions(+), 132 deletions(-) diff --git a/README.md b/README.md index d6a98dfe1de..448279b63fd 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-github # [![go-github release (latest SemVer)](https://img.shields.io/github/v/release/google/go-github?sort=semver)](https://github.com/google/go-github/releases) -[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v45/github) +[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v46/github) [![Test Status](https://github.com/google/go-github/workflows/tests/badge.svg)](https://github.com/google/go-github/actions?query=workflow%3Atests) [![Test Coverage](https://codecov.io/gh/google/go-github/branch/master/graph/badge.svg)](https://codecov.io/gh/google/go-github) [![Discuss at go-github@googlegroups.com](https://img.shields.io/badge/discuss-go--github%40googlegroups.com-blue.svg)](https://groups.google.com/group/go-github) @@ -24,7 +24,7 @@ If you're interested in using the [GraphQL API v4][], the recommended library is go-github is compatible with modern Go releases in module mode, with Go installed: ```bash -go get github.com/google/go-github/v45 +go get github.com/google/go-github/v46 ``` will resolve and add the package to the current development module, along with its dependencies. @@ -32,7 +32,7 @@ will resolve and add the package to the current development module, along with i Alternatively the same can be achieved if you use import in a package: ```go -import "github.com/google/go-github/v45/github" +import "github.com/google/go-github/v46/github" ``` and run `go get` without parameters. @@ -40,13 +40,13 @@ and run `go get` without parameters. Finally, to use the top-of-trunk version of this repo, use the following command: ```bash -go get github.com/google/go-github/v45@master +go get github.com/google/go-github/v46@master ``` ## Usage ## ```go -import "github.com/google/go-github/v45/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) +import "github.com/google/go-github/v46/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled ``` @@ -135,7 +135,7 @@ import ( "net/http" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" ) func main() { @@ -290,7 +290,7 @@ For complete usage of go-github, see the full [package docs][]. [oauth2]: https://github.com/golang/oauth2 [oauth2 docs]: https://godoc.org/golang.org/x/oauth2 [personal API token]: https://github.com/blog/1509-personal-api-tokens -[package docs]: https://pkg.go.dev/github.com/google/go-github/v45/github +[package docs]: https://pkg.go.dev/github.com/google/go-github/v46/github [GraphQL API v4]: https://developer.github.com/v4/ [shurcooL/githubv4]: https://github.com/shurcooL/githubv4 [GitHub webhook events]: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads diff --git a/example/actionpermissions/main.go b/example/actionpermissions/main.go index 13969c8012d..af2f28735db 100644 --- a/example/actionpermissions/main.go +++ b/example/actionpermissions/main.go @@ -14,7 +14,7 @@ import ( "log" "os" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" "golang.org/x/oauth2" ) diff --git a/example/appengine/app.go b/example/appengine/app.go index 06b8e538b06..df85f83cc2a 100644 --- a/example/appengine/app.go +++ b/example/appengine/app.go @@ -12,7 +12,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" "golang.org/x/oauth2" "google.golang.org/appengine" "google.golang.org/appengine/log" diff --git a/example/basicauth/main.go b/example/basicauth/main.go index 5adb2887ee5..ee51bab74de 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -22,7 +22,7 @@ import ( "strings" "syscall" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" "golang.org/x/crypto/ssh/terminal" ) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index 4832770379a..f1310acb218 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -31,7 +31,7 @@ import ( "strings" "time" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" "golang.org/x/oauth2" ) diff --git a/example/go.mod b/example/go.mod index 600e85a2534..17a20a763f5 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,10 +1,10 @@ -module github.com/google/go-github/example +module github.com/google/go-github/v46/example go 1.17 require ( github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 - github.com/google/go-github/v45 v45.0.0 + github.com/google/go-github/v46 v46.0.0 golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be google.golang.org/appengine v1.6.7 @@ -21,4 +21,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v45 => ../ +replace github.com/google/go-github/v46 => ../ diff --git a/example/go.sum b/example/go.sum index 22a2225807a..a3c96e95f22 100644 --- a/example/go.sum +++ b/example/go.sum @@ -7,8 +7,8 @@ github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +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/v41 v41.0.0 h1:HseJrM2JFf2vfiZJ8anY2hqBjdfY1Vlj/K27ueww4gg= github.com/google/go-github/v41 v41.0.0/go.mod h1:XgmCA5H323A9rtgExdTcnDkcqp6S30AVACCBDOonIxg= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= diff --git a/example/listenvironments/main.go b/example/listenvironments/main.go index a49bd2e000f..657334b7d65 100644 --- a/example/listenvironments/main.go +++ b/example/listenvironments/main.go @@ -5,10 +5,11 @@ // listenvironments is an example of how to use ListEnvironments method with EnvironmentListOptions. // It's runnable with the following command: -// export GITHUB_TOKEN=your_token -// export GITHUB_REPOSITORY_OWNER=your_owner -// export GITHUB_REPOSITORY_NAME=your_repo -// go run . +// +// export GITHUB_TOKEN=your_token +// export GITHUB_REPOSITORY_OWNER=your_owner +// export GITHUB_REPOSITORY_NAME=your_repo +// go run . package main import ( @@ -17,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" "golang.org/x/oauth2" ) diff --git a/example/migrations/main.go b/example/migrations/main.go index 60db180d2d9..ff7d3976e7d 100644 --- a/example/migrations/main.go +++ b/example/migrations/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" "golang.org/x/oauth2" ) diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index d2be0a3adca..4915d00420b 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -16,7 +16,7 @@ import ( "time" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" "golang.org/x/oauth2" ) diff --git a/example/newrepo/main.go b/example/newrepo/main.go index 58685b70820..bb1b4b096e4 100644 --- a/example/newrepo/main.go +++ b/example/newrepo/main.go @@ -16,7 +16,7 @@ import ( "log" "os" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" "golang.org/x/oauth2" ) diff --git a/example/newreposecretwithlibsodium/go.sum b/example/newreposecretwithlibsodium/go.sum index 89a25a5c991..04acc6db2af 100644 --- a/example/newreposecretwithlibsodium/go.sum +++ b/example/newreposecretwithlibsodium/go.sum @@ -35,7 +35,6 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb h1:ilqSFSbR1fq6x88heeHrvAqlg+ES+tZk2ZcaCmiH1gI= github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb/go.mod h1:72TQeEkiDH9QMXZa5nJJvZre0UjqqO67X2QEIoOwCRU= -github.com/bradleyfalzon/ghinstallation/v2 v2.0.4/go.mod h1:B40qPqJxWE0jDZgOR1JmaMy+4AY1eBP+IByOvqyAKp0= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= @@ -50,7 +49,6 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -86,12 +84,10 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/go-github/v41 v41.0.0/go.mod h1:XgmCA5H323A9rtgExdTcnDkcqp6S30AVACCBDOonIxg= -github.com/google/go-github/v45 v45.0.0 h1:y+GL7LIsAIF2NZlJ46ZoC/D1W1ivZasT0lnWHMYPZ+U= -github.com/google/go-github/v45 v45.0.0/go.mod h1:ZkTvvmCXBvsfPpTHXnH/d2hP9Y0cTbvN9kr5xqyXOIc= +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.0.0 h1:LU0WBjYidxIVyx7PZeWb+FP4JZJ3Wh3FQgdumnGqiLs= +github.com/google/go-github/v45 v45.0.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/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= @@ -287,7 +283,6 @@ golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index 7063ac5fab2..20be0fa6d11 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -14,11 +14,13 @@ // To verify the new secret, navigate to GitHub Repository > Settings > left side options bar > Secrets. // // Usage: +// // export GITHUB_AUTH_TOKEN= // export SECRET_VARIABLE= // go run main.go -owner -repo SECRET_VARIABLE // // Example: +// // export GITHUB_AUTH_TOKEN=0000000000000000 // export SECRET_VARIABLE="my-secret" // go run main.go -owner google -repo go-github SECRET_VARIABLE diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index eb96700dea9..89f62023a7d 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -15,11 +15,13 @@ // To verify the new secret, navigate to GitHub Repository > Settings > left side options bar > Secrets. // // Usage: +// // export GITHUB_AUTH_TOKEN= // export SECRET_VARIABLE= // go run main.go -owner -repo SECRET_VARIABLE // // Example: +// // export GITHUB_AUTH_TOKEN=0000000000000000 // export SECRET_VARIABLE="my-secret" // go run main.go -owner google -repo go-github SECRET_VARIABLE @@ -34,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" "golang.org/x/crypto/nacl/box" "golang.org/x/oauth2" ) diff --git a/example/simple/main.go b/example/simple/main.go index e0ee92af4d2..c4dfbc5f951 100644 --- a/example/simple/main.go +++ b/example/simple/main.go @@ -12,11 +12,10 @@ import ( "context" "fmt" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" ) // Fetch all the public organizations' membership of a user. -// func fetchOrganizations(username string) ([]*github.Organization, error) { client := github.NewClient(nil) orgs, _, err := client.Organizations.List(context.Background(), username, nil) diff --git a/example/tagprotection/main.go b/example/tagprotection/main.go index 6f347b97ed6..821b6c95f88 100644 --- a/example/tagprotection/main.go +++ b/example/tagprotection/main.go @@ -19,7 +19,7 @@ import ( "strings" "syscall" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" "golang.org/x/crypto/ssh/terminal" "golang.org/x/oauth2" ) diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index 9b866a9709e..2773ecac59b 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -14,7 +14,7 @@ import ( "log" "syscall" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" "golang.org/x/crypto/ssh/terminal" "golang.org/x/oauth2" ) diff --git a/example/topics/main.go b/example/topics/main.go index 0fdab80c8cb..d6a20e757db 100644 --- a/example/topics/main.go +++ b/example/topics/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" ) // Fetch and lists all the public topics associated with the specified GitHub topic diff --git a/github/activity.go b/github/activity.go index f99ecfcdffa..9cd9f9b71d7 100644 --- a/github/activity.go +++ b/github/activity.go @@ -45,14 +45,15 @@ type FeedLinks struct { // ListFeeds lists all the feeds available to the authenticated user. // // GitHub provides several timeline resources in Atom format: -// Timeline: The GitHub global public timeline -// User: The public timeline for any user, using URI template -// Current user public: The public timeline for the authenticated user -// Current user: The private timeline for the authenticated user -// Current user actor: The private timeline for activity created by the -// authenticated user -// Current user organizations: The private timeline for the organizations -// the authenticated user is a member of. +// +// Timeline: The GitHub global public timeline +// User: The public timeline for any user, using URI template +// Current user public: The public timeline for the authenticated user +// Current user: The private timeline for the authenticated user +// Current user actor: The private timeline for activity created by the +// authenticated user +// Current user organizations: The private timeline for the organizations +// the authenticated user is a member of. // // Note: Private feeds are only returned when authenticating via Basic Auth // since current feed URIs use the older, non revocable auth tokens. diff --git a/github/apps.go b/github/apps.go index dff9b210f2c..0e92f7b719f 100644 --- a/github/apps.go +++ b/github/apps.go @@ -59,8 +59,9 @@ type InstallationTokenOptions struct { // InstallationPermissions lists the repository and organization permissions for an installation. // // Permission names taken from: -// https://docs.github.com/en/enterprise-server@3.0/rest/apps#create-an-installation-access-token-for-an-app -// https://docs.github.com/en/rest/apps#create-an-installation-access-token-for-an-app +// +// https://docs.github.com/en/enterprise-server@3.0/rest/apps#create-an-installation-access-token-for-an-app +// https://docs.github.com/en/rest/apps#create-an-installation-access-token-for-an-app type InstallationPermissions struct { Actions *string `json:"actions,omitempty"` Administration *string `json:"administration,omitempty"` diff --git a/github/doc.go b/github/doc.go index 38cda12b2b3..e6f1a56398a 100644 --- a/github/doc.go +++ b/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v45/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v46/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to @@ -38,7 +38,7 @@ can be used as a starting point. For more sample code snippets, head over to the https://github.com/google/go-github/tree/master/example directory. -Authentication +# Authentication The go-github library does not directly handle authentication. Instead, when creating a new client, pass an http.Client that can handle authentication for @@ -110,7 +110,7 @@ To authenticate as an app, using a JWT: // Use client... } -Rate Limiting +# Rate Limiting GitHub imposes a rate limit on all API clients. Unauthenticated clients are limited to 60 requests per hour, while authenticated clients can make up to @@ -139,7 +139,7 @@ For secondary rate limits, you can check if its type is *github.AbuseRateLimitEr Learn more about GitHub rate limiting at https://docs.github.com/en/rest/rate-limit . -Accepted Status +# Accepted Status Some endpoints may return a 202 Accepted status code, meaning that the information required is not yet ready and was scheduled to be gathered on @@ -154,7 +154,7 @@ To detect this condition of error, you can check if its type is log.Println("scheduled on GitHub side") } -Conditional Requests +# Conditional Requests The GitHub API has good support for conditional requests which will help prevent you from burning through your rate limit, as well as help speed up your @@ -165,7 +165,7 @@ https://github.com/gregjones/httpcache for that. Learn more about GitHub conditional requests at https://docs.github.com/en/rest/overview/resources-in-the-rest-api#conditional-requests. -Creating and Updating Resources +# Creating and Updating Resources All structs for GitHub resources use pointer values for all non-repeated fields. This allows distinguishing between unset fields and those set to a zero-value. @@ -181,7 +181,7 @@ bool, and int values. For example: Users who have worked with protocol buffers should find this pattern familiar. -Pagination +# Pagination All requests for resource collections (repos, pull requests, issues, etc.) support pagination. Pagination options are described in the @@ -208,6 +208,5 @@ github.Response struct. } opt.Page = resp.NextPage } - */ package github diff --git a/github/examples_test.go b/github/examples_test.go index 231b218c673..af973f487ca 100644 --- a/github/examples_test.go +++ b/github/examples_test.go @@ -12,7 +12,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" ) func ExampleClient_Markdown() { diff --git a/github/github.go b/github/github.go index fe346f5ab72..985a8a43747 100644 --- a/github/github.go +++ b/github/github.go @@ -28,7 +28,7 @@ import ( ) const ( - Version = "45.2.0" + Version = "46.0.0" defaultBaseURL = "https://api.github.com/" defaultUserAgent = "go-github" + "/" + Version @@ -949,17 +949,17 @@ func sanitizeURL(uri *url.URL) *url.URL { An Error reports more details on an individual error in an ErrorResponse. These are the possible validation error codes: - missing: - resource does not exist - missing_field: - a required field on a resource has not been set - invalid: - the formatting of a field is invalid - already_exists: - another resource has the same valid as this field - custom: - some resources return this (e.g. github.User.CreateKey()), additional - information is set in the Message field of the Error + missing: + resource does not exist + missing_field: + a required field on a resource has not been set + invalid: + the formatting of a field is invalid + already_exists: + another resource has the same valid as this field + custom: + some resources return this (e.g. github.User.CreateKey()), additional + information is set in the Message field of the Error GitHub error responses structure are often undocumented and inconsistent. Sometimes error is just a simple string (Issue #540). diff --git a/github/messages.go b/github/messages.go index 05cffb4b49a..320bd734226 100644 --- a/github/messages.go +++ b/github/messages.go @@ -157,13 +157,13 @@ func messageMAC(signature string) ([]byte, func() hash.Hash, error) { // // Example usage: // -// func (s *GitHubEventMonitor) ServeHTTP(w http.ResponseWriter, r *http.Request) { -// // read signature from request -// signature := "" -// payload, err := github.ValidatePayloadFromBody(r.Header.Get("Content-Type"), r.Body, signature, s.webhookSecretKey) -// if err != nil { ... } -// // Process payload... -// } +// func (s *GitHubEventMonitor) ServeHTTP(w http.ResponseWriter, r *http.Request) { +// // read signature from request +// signature := "" +// payload, err := github.ValidatePayloadFromBody(r.Header.Get("Content-Type"), r.Body, signature, s.webhookSecretKey) +// if err != nil { ... } +// // Process payload... +// } func ValidatePayloadFromBody(contentType string, readable io.Reader, signature string, secretToken []byte) (payload []byte, err error) { var body []byte // Raw body that GitHub uses to calculate the signature. @@ -221,12 +221,11 @@ func ValidatePayloadFromBody(contentType string, readable io.Reader, signature s // // Example usage: // -// func (s *GitHubEventMonitor) ServeHTTP(w http.ResponseWriter, r *http.Request) { -// payload, err := github.ValidatePayload(r, s.webhookSecretKey) -// if err != nil { ... } -// // Process payload... -// } -// +// func (s *GitHubEventMonitor) ServeHTTP(w http.ResponseWriter, r *http.Request) { +// payload, err := github.ValidatePayload(r, s.webhookSecretKey) +// if err != nil { ... } +// // Process payload... +// } func ValidatePayload(r *http.Request, secretToken []byte) (payload []byte, err error) { signature := r.Header.Get(SHA256SignatureHeader) if signature == "" { @@ -279,20 +278,19 @@ func DeliveryID(r *http.Request) string { // // Example usage: // -// func (s *GitHubEventMonitor) ServeHTTP(w http.ResponseWriter, r *http.Request) { -// payload, err := github.ValidatePayload(r, s.webhookSecretKey) -// if err != nil { ... } -// event, err := github.ParseWebHook(github.WebHookType(r), payload) -// if err != nil { ... } -// switch event := event.(type) { -// case *github.CommitCommentEvent: -// processCommitCommentEvent(event) -// case *github.CreateEvent: -// processCreateEvent(event) -// ... -// } -// } -// +// func (s *GitHubEventMonitor) ServeHTTP(w http.ResponseWriter, r *http.Request) { +// payload, err := github.ValidatePayload(r, s.webhookSecretKey) +// if err != nil { ... } +// event, err := github.ParseWebHook(github.WebHookType(r), payload) +// if err != nil { ... } +// switch event := event.(type) { +// case *github.CommitCommentEvent: +// processCommitCommentEvent(event) +// case *github.CreateEvent: +// processCreateEvent(event) +// ... +// } +// } func ParseWebHook(messageType string, payload []byte) (interface{}, error) { eventType, ok := eventTypeMapping[messageType] if !ok { diff --git a/github/pulls_reviews.go b/github/pulls_reviews.go index 14e20322aec..77bf60ce2d4 100644 --- a/github/pulls_reviews.go +++ b/github/pulls_reviews.go @@ -193,35 +193,37 @@ func (s *PullRequestsService) ListReviewComments(ctx context.Context, owner, rep // // In order to use multi-line comments, you must use the "comfort fade" preview. // This replaces the use of the "Position" field in comments with 4 new fields: -// [Start]Side, and [Start]Line. +// +// [Start]Side, and [Start]Line. +// // These new fields must be used for ALL comments (including single-line), // with the following restrictions (empirically observed, so subject to change). // // For single-line "comfort fade" comments, you must use: // -// Path: &path, // as before -// Body: &body, // as before -// Side: &"RIGHT" (or "LEFT") -// Line: &123, // NOT THE SAME AS POSITION, this is an actual line number. +// Path: &path, // as before +// Body: &body, // as before +// Side: &"RIGHT" (or "LEFT") +// Line: &123, // NOT THE SAME AS POSITION, this is an actual line number. // // If StartSide or StartLine is used with single-line comments, a 422 is returned. // // For multi-line "comfort fade" comments, you must use: // -// Path: &path, // as before -// Body: &body, // as before -// StartSide: &"RIGHT" (or "LEFT") -// Side: &"RIGHT" (or "LEFT") -// StartLine: &120, -// Line: &125, +// Path: &path, // as before +// Body: &body, // as before +// StartSide: &"RIGHT" (or "LEFT") +// Side: &"RIGHT" (or "LEFT") +// StartLine: &120, +// Line: &125, // // Suggested edits are made by commenting on the lines to replace, and including the // suggested edit in a block like this (it may be surrounded in non-suggestion markdown): // -// ```suggestion -// Use this instead. -// It is waaaaaay better. -// ``` +// ```suggestion +// Use this instead. +// It is waaaaaay better. +// ``` func (s *PullRequestsService) CreateReview(ctx context.Context, owner, repo string, number int, review *PullRequestReviewRequest) (*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews", owner, repo, number) diff --git a/github/repos.go b/github/repos.go index d5ac51126b2..6ad88b3e2b3 100644 --- a/github/repos.go +++ b/github/repos.go @@ -725,10 +725,10 @@ func (s *RepositoriesService) ListContributors(ctx context.Context, owner string // specifies the languages and the number of bytes of code written in that // language. For example: // -// { -// "C": 78769, -// "Python": 7769 -// } +// { +// "C": 78769, +// "Python": 7769 +// } // // GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-repository-languages func (s *RepositoriesService) ListLanguages(ctx context.Context, owner string, repo string) (map[string]int, *Response, error) { diff --git a/github/scim.go b/github/scim.go index c4abb9ab3e8..9462fb6ba65 100644 --- a/github/scim.go +++ b/github/scim.go @@ -38,7 +38,7 @@ type SCIMUserName struct { Formatted *string `json:"formatted,omitempty"` // (Optional.) } -//SCIMUserEmail represents SCIM user email. +// SCIMUserEmail represents SCIM user email. type SCIMUserEmail struct { Value string `json:"value"` // (Required.) Primary *bool `json:"primary,omitempty"` // (Optional.) diff --git a/github/search.go b/github/search.go index 4d166640586..adb832d0d8f 100644 --- a/github/search.go +++ b/github/search.go @@ -20,8 +20,10 @@ import ( // Each method takes a query string defining the search keywords and any search qualifiers. // For example, when searching issues, the query "gopher is:issue language:go" will search // for issues containing the word "gopher" in Go repositories. The method call -// opts := &github.SearchOptions{Sort: "created", Order: "asc"} -// cl.Search.Issues(ctx, "gopher is:issue language:go", opts) +// +// opts := &github.SearchOptions{Sort: "created", Order: "asc"} +// cl.Search.Issues(ctx, "gopher is:issue language:go", opts) +// // will search for such issues, sorting by creation date in ascending order // (i.e., oldest first). // diff --git a/go.mod b/go.mod index 4c29e19843b..d6d8bd6e810 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v45 +module github.com/google/go-github/v46 require ( github.com/google/go-cmp v0.5.8 diff --git a/test/fields/fields.go b/test/fields/fields.go index 170e5c9d77f..efcc85a7a13 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -25,7 +25,7 @@ import ( "reflect" "strings" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" "golang.org/x/oauth2" ) diff --git a/test/integration/activity_test.go b/test/integration/activity_test.go index ba1a5fd850a..3cb03630e95 100644 --- a/test/integration/activity_test.go +++ b/test/integration/activity_test.go @@ -12,7 +12,7 @@ import ( "context" "testing" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" ) const ( diff --git a/test/integration/authorizations_test.go b/test/integration/authorizations_test.go index 3774a470f6b..83f81376f57 100644 --- a/test/integration/authorizations_test.go +++ b/test/integration/authorizations_test.go @@ -17,7 +17,7 @@ import ( "testing" "time" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" ) const msgEnvMissing = "Skipping test because the required environment variable (%v) is not present." diff --git a/test/integration/github_test.go b/test/integration/github_test.go index 06690e8e32d..100f9d4e94a 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -15,7 +15,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" "golang.org/x/oauth2" ) diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index a3f017bd8fa..b5715b2bb18 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -16,7 +16,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" ) func TestRepositories_CRUD(t *testing.T) { diff --git a/test/integration/users_test.go b/test/integration/users_test.go index aad2f05001d..e75729fdd33 100644 --- a/test/integration/users_test.go +++ b/test/integration/users_test.go @@ -14,7 +14,7 @@ import ( "math/rand" "testing" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" ) func TestUsers_Get(t *testing.T) { diff --git a/update-urls/go.mod b/update-urls/go.mod index 6b8689d3744..a63248394b7 100644 --- a/update-urls/go.mod +++ b/update-urls/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/update-urls +module github.com/google/go-github/v46/update-urls go 1.16 diff --git a/update-urls/main.go b/update-urls/main.go index 41533ca4695..e704a5cf66d 100644 --- a/update-urls/main.go +++ b/update-urls/main.go @@ -9,14 +9,16 @@ // to update stale GitHub Developer v3 API documentation URLs. // // Usage (from go-github directory): -// go run ./update-urls/main.go -// go generate ./... -// go test ./... -// go vet ./... +// +// go run ./update-urls/main.go +// go generate ./... +// go test ./... +// go vet ./... // // When confronted with "PLEASE CHECK MANUALLY AND FIX", the problematic // URL needs to be debugged. To debug a specific file, run like this: -// go run ./update-urls/main.go -v -d enterprise_actions_runners.go +// +// go run ./update-urls/main.go -v -d enterprise_actions_runners.go package main import ( From 351dae90e69d53c513806bcabaa981bcc0619fcc Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Fri, 19 Aug 2022 10:33:49 -0400 Subject: [PATCH 040/751] Update scrape dependency to v46 (#2438) --- example/newreposecretwithlibsodium/go.mod | 2 +- example/newreposecretwithlibsodium/go.sum | 4 ++-- example/newreposecretwithlibsodium/main.go | 2 +- scrape/apps.go | 2 +- scrape/apps_test.go | 2 +- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index ee8d656d5c4..77aac553825 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -4,6 +4,6 @@ go 1.15 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb - github.com/google/go-github/v45 v45.0.0 + github.com/google/go-github/v46 v46.0.0 golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 ) diff --git a/example/newreposecretwithlibsodium/go.sum b/example/newreposecretwithlibsodium/go.sum index 04acc6db2af..77b3d34690c 100644 --- a/example/newreposecretwithlibsodium/go.sum +++ b/example/newreposecretwithlibsodium/go.sum @@ -86,8 +86,8 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ 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.0.0 h1:LU0WBjYidxIVyx7PZeWb+FP4JZJ3Wh3FQgdumnGqiLs= -github.com/google/go-github/v45 v45.0.0/go.mod h1:FObaZJEDSTa/WGCzZ2Z3eoCDXWJKMenWWTrd8jrta28= +github.com/google/go-github/v46 v46.0.0 h1:5TZiEw0Is5D9CPld0TSLPjShGr42L7PoyhUSl6KPMKM= +github.com/google/go-github/v46 v46.0.0/go.mod h1:l+/Ml209okuXUAjbvFnGZ2ntokVAhTtXvYWP8Di7OpU= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index 20be0fa6d11..e7dc4f1f555 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -36,7 +36,7 @@ import ( "os" sodium "github.com/GoKillers/libsodium-go/cryptobox" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" "golang.org/x/oauth2" ) diff --git a/scrape/apps.go b/scrape/apps.go index dd113c7ca46..61e851f5dde 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -17,7 +17,7 @@ import ( "strings" "github.com/PuerkitoBio/goquery" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" ) // AppRestrictionsEnabled returns whether the specified organization has diff --git a/scrape/apps_test.go b/scrape/apps_test.go index 24fef52c44e..25fecec6028 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" ) func Test_AppRestrictionsEnabled(t *testing.T) { diff --git a/scrape/go.mod b/scrape/go.mod index e2c02f00a2c..09533741008 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.2.0 + github.com/google/go-github/v46 v46.0.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 3c105db4a75..8a95631be77 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.2.0 h1:5oRLszbrkvxDDqBCNj2hjDZMKmvexaZ1xw/FCD+K3FI= -github.com/google/go-github/v45 v45.2.0/go.mod h1:FObaZJEDSTa/WGCzZ2Z3eoCDXWJKMenWWTrd8jrta28= +github.com/google/go-github/v46 v46.0.0 h1:5TZiEw0Is5D9CPld0TSLPjShGr42L7PoyhUSl6KPMKM= +github.com/google/go-github/v46 v46.0.0/go.mod h1:l+/Ml209okuXUAjbvFnGZ2ntokVAhTtXvYWP8Di7OpU= 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= From 2eccd8c268f2a2ce816d3ff0b46d91dc267acd97 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Fri, 19 Aug 2022 13:41:49 -0400 Subject: [PATCH 041/751] Fix go.mod for example (#2439) --- example/newreposecretwithlibsodium/go.mod | 3 +++ example/newreposecretwithlibsodium/go.sum | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index 77aac553825..62b9c01ed6a 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -7,3 +7,6 @@ require ( github.com/google/go-github/v46 v46.0.0 golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 ) + +// Use version at HEAD, not the latest published. +replace github.com/google/go-github/v46 => ../.. diff --git a/example/newreposecretwithlibsodium/go.sum b/example/newreposecretwithlibsodium/go.sum index 77b3d34690c..abc73624ad6 100644 --- a/example/newreposecretwithlibsodium/go.sum +++ b/example/newreposecretwithlibsodium/go.sum @@ -86,8 +86,6 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ 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/v46 v46.0.0 h1:5TZiEw0Is5D9CPld0TSLPjShGr42L7PoyhUSl6KPMKM= -github.com/google/go-github/v46 v46.0.0/go.mod h1:l+/Ml209okuXUAjbvFnGZ2ntokVAhTtXvYWP8Di7OpU= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= From e5e45dad2108d05a15d473607c325ef7d47b8500 Mon Sep 17 00:00:00 2001 From: aboy Date: Mon, 22 Aug 2022 06:31:23 +0900 Subject: [PATCH 042/751] Add hooks support for WebSub (formerly PubSubHubbub) protocol (#2397) Fixes: #1265. --- github/github.go | 27 +++++++++++++ github/github_test.go | 78 ++++++++++++++++++++++++++++++++++++++ github/repos_hooks.go | 55 +++++++++++++++++++++++++++ github/repos_hooks_test.go | 66 ++++++++++++++++++++++++++++++++ 4 files changed, 226 insertions(+) diff --git a/github/github.go b/github/github.go index 985a8a43747..27c8b72f61d 100644 --- a/github/github.go +++ b/github/github.go @@ -426,6 +426,33 @@ func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Requ return req, nil } +// NewFormRequest creates an API request. A relative URL can be provided in urlStr, +// in which case it is resolved relative to the BaseURL of the Client. +// Relative URLs should always be specified without a preceding slash. +// Body is sent with Content-Type: application/x-www-form-urlencoded. +func (c *Client) NewFormRequest(urlStr string, body io.Reader) (*http.Request, error) { + if !strings.HasSuffix(c.BaseURL.Path, "/") { + return nil, fmt.Errorf("BaseURL must have a trailing slash, but %q does not", c.BaseURL) + } + + u, err := c.BaseURL.Parse(urlStr) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, u.String(), body) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Type", "application/x-www-form-urlencoded") + req.Header.Set("Accept", mediaTypeV3) + if c.UserAgent != "" { + req.Header.Set("User-Agent", c.UserAgent) + } + return req, nil +} + // NewUploadRequest creates an upload request. A relative URL can be provided in // urlStr, in which case it is resolved relative to the UploadURL of the Client. // Relative URLs should always be specified without a preceding slash. diff --git a/github/github_test.go b/github/github_test.go index 3fa5b4412a4..d8b6a74d19d 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -602,6 +602,84 @@ func TestNewRequest_errorForNoTrailingSlash(t *testing.T) { } } +func TestNewFormRequest(t *testing.T) { + c := NewClient(nil) + + inURL, outURL := "/foo", defaultBaseURL+"foo" + form := url.Values{} + form.Add("login", "l") + inBody, outBody := strings.NewReader(form.Encode()), "login=l" + req, _ := c.NewFormRequest(inURL, inBody) + + // test that relative URL was expanded + if got, want := req.URL.String(), outURL; got != want { + t.Errorf("NewFormRequest(%q) URL is %v, want %v", inURL, got, want) + } + + // test that body was form encoded + body, _ := ioutil.ReadAll(req.Body) + if got, want := string(body), outBody; got != want { + t.Errorf("NewFormRequest(%q) Body is %v, want %v", inBody, got, want) + } + + // test that default user-agent is attached to the request + if got, want := req.Header.Get("User-Agent"), c.UserAgent; got != want { + t.Errorf("NewFormRequest() User-Agent is %v, want %v", got, want) + } +} + +func TestNewFormRequest_badURL(t *testing.T) { + c := NewClient(nil) + _, err := c.NewFormRequest(":", nil) + testURLParseError(t, err) +} + +func TestNewFormRequest_emptyUserAgent(t *testing.T) { + c := NewClient(nil) + c.UserAgent = "" + req, err := c.NewFormRequest(".", nil) + if err != nil { + t.Fatalf("NewFormRequest returned unexpected error: %v", err) + } + if _, ok := req.Header["User-Agent"]; ok { + t.Fatal("constructed request contains unexpected User-Agent header") + } +} + +func TestNewFormRequest_emptyBody(t *testing.T) { + c := NewClient(nil) + req, err := c.NewFormRequest(".", nil) + if err != nil { + t.Fatalf("NewFormRequest returned unexpected error: %v", err) + } + if req.Body != nil { + t.Fatalf("constructed request contains a non-nil Body") + } +} + +func TestNewFormRequest_errorForNoTrailingSlash(t *testing.T) { + tests := []struct { + rawURL string + wantError bool + }{ + {rawURL: "https://example.com/api/v3", wantError: true}, + {rawURL: "https://example.com/api/v3/", wantError: false}, + } + c := NewClient(nil) + for _, test := range tests { + u, err := url.Parse(test.rawURL) + if err != nil { + t.Fatalf("url.Parse returned unexpected error: %v.", err) + } + c.BaseURL = u + if _, err := c.NewFormRequest("test", nil); test.wantError && err == nil { + t.Fatalf("Expected error to be returned.") + } else if !test.wantError && err != nil { + t.Fatalf("NewFormRequest returned unexpected error: %v.", err) + } + } +} + func TestNewUploadRequest_badURL(t *testing.T) { c := NewClient(nil) _, err := c.NewUploadRequest(":", nil, 0, "") diff --git a/github/repos_hooks.go b/github/repos_hooks.go index 4e738cfe8ce..44eac8a4014 100644 --- a/github/repos_hooks.go +++ b/github/repos_hooks.go @@ -8,6 +8,9 @@ package github import ( "context" "fmt" + "net/http" + "net/url" + "strings" "time" ) @@ -197,3 +200,55 @@ func (s *RepositoriesService) TestHook(ctx context.Context, owner, repo string, } return s.client.Do(ctx, req, nil) } + +// Subscribe lets servers register to receive updates when a topic is updated. +// +// GitHub API docs: https://docs.github.com/en/rest/webhooks#pubsubhubbub +func (s *RepositoriesService) Subscribe(ctx context.Context, owner, repo, event, callback string, secret []byte) (*Response, error) { + req, err := s.createWebSubRequest("subscribe", owner, repo, event, callback, secret) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// Unsubscribe lets servers unregister to no longer receive updates when a topic is updated. +// +// GitHub API docs: https://docs.github.com/en/rest/webhooks#pubsubhubbub +func (s *RepositoriesService) Unsubscribe(ctx context.Context, owner, repo, event, callback string, secret []byte) (*Response, error) { + req, err := s.createWebSubRequest("unsubscribe", owner, repo, event, callback, secret) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// createWebSubRequest returns a subscribe/unsubscribe request that implements +// the WebSub (formerly PubSubHubbub) protocol. +// +// See: https://www.w3.org/TR/websub/#subscriber-sends-subscription-request +func (s *RepositoriesService) createWebSubRequest(hubMode, owner, repo, event, callback string, secret []byte) (*http.Request, error) { + topic := fmt.Sprintf( + "https://github.com/%s/%s/events/%s", + owner, + repo, + event, + ) + form := url.Values{} + form.Add("hub.mode", hubMode) + form.Add("hub.topic", topic) + form.Add("hub.callback", callback) + if secret != nil { + form.Add("hub.secret", string(secret)) + } + body := strings.NewReader(form.Encode()) + + req, err := s.client.NewFormRequest("hub", body) + if err != nil { + return nil, err + } + + return req, nil +} diff --git a/github/repos_hooks_test.go b/github/repos_hooks_test.go index 50dad9c236c..3c6ee6fa169 100644 --- a/github/repos_hooks_test.go +++ b/github/repos_hooks_test.go @@ -564,3 +564,69 @@ func TestBranchHook_Marshal(t *testing.T) { testJSONMarshal(t, v, want) } + +func TestRepositoriesService_Subscribe(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/hub", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, http.MethodPost) + testHeader(t, r, "Content-Type", "application/x-www-form-urlencoded") + testFormValues(t, r, values{ + "hub.mode": "subscribe", + "hub.topic": "https://github.com/o/r/events/push", + "hub.callback": "http://postbin.org/123", + "hub.secret": "test secret", + }) + }) + + ctx := context.Background() + _, err := client.Repositories.Subscribe( + ctx, + "o", + "r", + "push", + "http://postbin.org/123", + []byte("test secret"), + ) + if err != nil { + t.Errorf("Repositories.Subscribe returned error: %v", err) + } + + testNewRequestAndDoFailure(t, "Subscribe", client, func() (*Response, error) { + return client.Repositories.Subscribe(ctx, "o", "r", "push", "http://postbin.org/123", nil) + }) +} + +func TestRepositoriesService_Unsubscribe(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/hub", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, http.MethodPost) + testHeader(t, r, "Content-Type", "application/x-www-form-urlencoded") + testFormValues(t, r, values{ + "hub.mode": "unsubscribe", + "hub.topic": "https://github.com/o/r/events/push", + "hub.callback": "http://postbin.org/123", + "hub.secret": "test secret", + }) + }) + + ctx := context.Background() + _, err := client.Repositories.Unsubscribe( + ctx, + "o", + "r", + "push", + "http://postbin.org/123", + []byte("test secret"), + ) + if err != nil { + t.Errorf("Repositories.Unsubscribe returned error: %v", err) + } + + testNewRequestAndDoFailure(t, "Unsubscribe", client, func() (*Response, error) { + return client.Repositories.Unsubscribe(ctx, "o", "r", "push", "http://postbin.org/123", nil) + }) +} From 01c8febbdeeec1ab1554defa81eb7d0955f20faa Mon Sep 17 00:00:00 2001 From: Garrett Date: Sun, 21 Aug 2022 17:33:17 -0400 Subject: [PATCH 043/751] Add parameters to configure merge commit messages to repo (#2440) --- github/github-accessors.go | 32 ++++++++++++++++++++++++++ github/github-accessors_test.go | 40 +++++++++++++++++++++++++++++++++ github/github-stringify_test.go | 6 ++++- github/repos.go | 12 ++++++++++ 4 files changed, 89 insertions(+), 1 deletion(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 013780bff9c..1b1c9d9511e 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -14590,6 +14590,22 @@ func (r *Repository) GetMasterBranch() string { return *r.MasterBranch } +// GetMergeCommitMessage returns the MergeCommitMessage field if it's non-nil, zero value otherwise. +func (r *Repository) GetMergeCommitMessage() string { + if r == nil || r.MergeCommitMessage == nil { + return "" + } + return *r.MergeCommitMessage +} + +// GetMergeCommitTitle returns the MergeCommitTitle field if it's non-nil, zero value otherwise. +func (r *Repository) GetMergeCommitTitle() string { + if r == nil || r.MergeCommitTitle == nil { + return "" + } + return *r.MergeCommitTitle +} + // GetMergesURL returns the MergesURL field if it's non-nil, zero value otherwise. func (r *Repository) GetMergesURL() string { if r == nil || r.MergesURL == nil { @@ -14758,6 +14774,22 @@ func (r *Repository) GetSource() *Repository { return r.Source } +// GetSquashMergeCommitMessage returns the SquashMergeCommitMessage field if it's non-nil, zero value otherwise. +func (r *Repository) GetSquashMergeCommitMessage() string { + if r == nil || r.SquashMergeCommitMessage == nil { + return "" + } + return *r.SquashMergeCommitMessage +} + +// GetSquashMergeCommitTitle returns the SquashMergeCommitTitle field if it's non-nil, zero value otherwise. +func (r *Repository) GetSquashMergeCommitTitle() string { + if r == nil || r.SquashMergeCommitTitle == nil { + return "" + } + return *r.SquashMergeCommitTitle +} + // GetSSHURL returns the SSHURL field if it's non-nil, zero value otherwise. func (r *Repository) GetSSHURL() string { if r == nil || r.SSHURL == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 984a69b77d8..45744693cee 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -16984,6 +16984,26 @@ func TestRepository_GetMasterBranch(tt *testing.T) { r.GetMasterBranch() } +func TestRepository_GetMergeCommitMessage(tt *testing.T) { + var zeroValue string + r := &Repository{MergeCommitMessage: &zeroValue} + r.GetMergeCommitMessage() + r = &Repository{} + r.GetMergeCommitMessage() + r = nil + r.GetMergeCommitMessage() +} + +func TestRepository_GetMergeCommitTitle(tt *testing.T) { + var zeroValue string + r := &Repository{MergeCommitTitle: &zeroValue} + r.GetMergeCommitTitle() + r = &Repository{} + r.GetMergeCommitTitle() + r = nil + r.GetMergeCommitTitle() +} + func TestRepository_GetMergesURL(tt *testing.T) { var zeroValue string r := &Repository{MergesURL: &zeroValue} @@ -17179,6 +17199,26 @@ func TestRepository_GetSource(tt *testing.T) { r.GetSource() } +func TestRepository_GetSquashMergeCommitMessage(tt *testing.T) { + var zeroValue string + r := &Repository{SquashMergeCommitMessage: &zeroValue} + r.GetSquashMergeCommitMessage() + r = &Repository{} + r.GetSquashMergeCommitMessage() + r = nil + r.GetSquashMergeCommitMessage() +} + +func TestRepository_GetSquashMergeCommitTitle(tt *testing.T) { + var zeroValue string + r := &Repository{SquashMergeCommitTitle: &zeroValue} + r.GetSquashMergeCommitTitle() + r = &Repository{} + r.GetSquashMergeCommitTitle() + r = nil + r.GetSquashMergeCommitTitle() +} + func TestRepository_GetSSHURL(tt *testing.T) { var zeroValue string r := &Repository{SSHURL: &zeroValue} diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index d056c680918..572686884c0 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -1524,6 +1524,10 @@ func TestRepository_String(t *testing.T) { AllowForking: Bool(false), DeleteBranchOnMerge: Bool(false), UseSquashPRTitleAsDefault: Bool(false), + SquashMergeCommitTitle: String(""), + SquashMergeCommitMessage: String(""), + MergeCommitTitle: String(""), + MergeCommitMessage: String(""), Topics: []string{""}, Archived: Bool(false), Disabled: Bool(false), @@ -1579,7 +1583,7 @@ func TestRepository_String(t *testing.T) { 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:""}` + 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, SquashMergeCommitTitle:"", SquashMergeCommitMessage:"", MergeCommitTitle:"", MergeCommitMessage:"", 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/repos.go b/github/repos.go index 6ad88b3e2b3..499ed677866 100644 --- a/github/repos.go +++ b/github/repos.go @@ -70,6 +70,10 @@ type Repository struct { AllowForking *bool `json:"allow_forking,omitempty"` DeleteBranchOnMerge *bool `json:"delete_branch_on_merge,omitempty"` UseSquashPRTitleAsDefault *bool `json:"use_squash_pr_title_as_default,omitempty"` + SquashMergeCommitTitle *string `json:"squash_merge_commit_title,omitempty"` // Can be one of: "PR_TITLE", "COMMIT_OR_PR_TITLE" + SquashMergeCommitMessage *string `json:"squash_merge_commit_message,omitempty"` // Can be one of: "PR_BODY", "COMMIT_MESSAGES", "BLANK" + MergeCommitTitle *string `json:"merge_commit_title,omitempty"` // Can be one of: "PR_TITLE", "MERGE_MESSAGE" + MergeCommitMessage *string `json:"merge_commit_message,omitempty"` // Can be one of: "PR_BODY", "PR_TITLE", "BLANK" Topics []string `json:"topics,omitempty"` Archived *bool `json:"archived,omitempty"` Disabled *bool `json:"disabled,omitempty"` @@ -374,6 +378,10 @@ type createRepoRequest struct { AllowForking *bool `json:"allow_forking,omitempty"` DeleteBranchOnMerge *bool `json:"delete_branch_on_merge,omitempty"` UseSquashPRTitleAsDefault *bool `json:"use_squash_pr_title_as_default,omitempty"` + SquashMergeCommitTitle *string `json:"squash_merge_commit_title,omitempty"` + SquashMergeCommitMessage *string `json:"squash_merge_commit_message,omitempty"` + MergeCommitTitle *string `json:"merge_commit_title,omitempty"` + MergeCommitMessage *string `json:"merge_commit_message,omitempty"` } // Create a new repository. If an organization is specified, the new @@ -420,6 +428,10 @@ func (s *RepositoriesService) Create(ctx context.Context, org string, repo *Repo AllowForking: repo.AllowForking, DeleteBranchOnMerge: repo.DeleteBranchOnMerge, UseSquashPRTitleAsDefault: repo.UseSquashPRTitleAsDefault, + SquashMergeCommitTitle: repo.SquashMergeCommitTitle, + SquashMergeCommitMessage: repo.SquashMergeCommitMessage, + MergeCommitTitle: repo.MergeCommitTitle, + MergeCommitMessage: repo.MergeCommitMessage, } req, err := s.client.NewRequest("POST", u, repoReq) From dd22b731accd45520c08f1363fb91b4b553b51b7 Mon Sep 17 00:00:00 2001 From: "echorand (Amit Saha)" Date: Tue, 23 Aug 2022 08:36:25 +1000 Subject: [PATCH 044/751] Add ListOptions for listing user migrations (#2417) Fixes: #2416. --- example/migrations/main.go | 2 +- github/migrations_user.go | 6 +++++- github/migrations_user_test.go | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/example/migrations/main.go b/example/migrations/main.go index ff7d3976e7d..ae098f99903 100644 --- a/example/migrations/main.go +++ b/example/migrations/main.go @@ -24,7 +24,7 @@ func fetchAllUserMigrations() ([]*github.UserMigration, error) { tc := oauth2.NewClient(ctx, ts) client := github.NewClient(tc) - migrations, _, err := client.Migrations.ListUserMigrations(ctx) + migrations, _, err := client.Migrations.ListUserMigrations(ctx, &github.ListOptions{Page: 1}) return migrations, err } diff --git a/github/migrations_user.go b/github/migrations_user.go index b8a0d608d63..6586fdb2d3f 100644 --- a/github/migrations_user.go +++ b/github/migrations_user.go @@ -97,8 +97,12 @@ func (s *MigrationService) StartUserMigration(ctx context.Context, repos []strin // ListUserMigrations lists the most recent migrations. // // GitHub API docs: https://docs.github.com/en/rest/migrations/users#list-user-migrations -func (s *MigrationService) ListUserMigrations(ctx context.Context) ([]*UserMigration, *Response, error) { +func (s *MigrationService) ListUserMigrations(ctx context.Context, opts *ListOptions) ([]*UserMigration, *Response, error) { u := "user/migrations" + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } req, err := s.client.NewRequest("GET", u, nil) if err != nil { diff --git a/github/migrations_user_test.go b/github/migrations_user_test.go index 5a8905cd116..358bb9bdcf3 100644 --- a/github/migrations_user_test.go +++ b/github/migrations_user_test.go @@ -66,7 +66,7 @@ func TestMigrationService_ListUserMigrations(t *testing.T) { }) ctx := context.Background() - got, _, err := client.Migrations.ListUserMigrations(ctx) + got, _, err := client.Migrations.ListUserMigrations(ctx, &ListOptions{Page: 1, PerPage: 2}) if err != nil { t.Errorf("ListUserMigrations returned error %v", err) } @@ -78,7 +78,7 @@ func TestMigrationService_ListUserMigrations(t *testing.T) { const methodName = "ListUserMigrations" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Migrations.ListUserMigrations(ctx) + got, resp, err := client.Migrations.ListUserMigrations(ctx, &ListOptions{Page: 1, PerPage: 2}) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } From a6fe97486ba64a345d2c10408fdbddd826a8080f Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Mon, 22 Aug 2022 18:48:21 -0400 Subject: [PATCH 045/751] Bump version of go-github library to v47 (#2441) --- README.md | 14 +++++++------- example/actionpermissions/main.go | 2 +- example/appengine/app.go | 2 +- example/basicauth/main.go | 2 +- example/commitpr/main.go | 2 +- example/go.mod | 6 +++--- example/listenvironments/main.go | 2 +- example/migrations/main.go | 2 +- example/newfilewithappauth/main.go | 2 +- example/newrepo/main.go | 2 +- example/newreposecretwithlibsodium/go.mod | 4 ++-- example/newreposecretwithlibsodium/main.go | 2 +- example/newreposecretwithxcrypto/main.go | 2 +- example/simple/main.go | 2 +- example/tagprotection/main.go | 2 +- example/tokenauth/main.go | 2 +- example/topics/main.go | 2 +- github/doc.go | 2 +- github/examples_test.go | 2 +- github/github.go | 2 +- go.mod | 2 +- test/fields/fields.go | 2 +- test/integration/activity_test.go | 2 +- test/integration/authorizations_test.go | 2 +- test/integration/github_test.go | 2 +- test/integration/repos_test.go | 2 +- test/integration/users_test.go | 2 +- update-urls/go.mod | 2 +- 28 files changed, 37 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 448279b63fd..c7b6e9adac4 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-github # [![go-github release (latest SemVer)](https://img.shields.io/github/v/release/google/go-github?sort=semver)](https://github.com/google/go-github/releases) -[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v46/github) +[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v47/github) [![Test Status](https://github.com/google/go-github/workflows/tests/badge.svg)](https://github.com/google/go-github/actions?query=workflow%3Atests) [![Test Coverage](https://codecov.io/gh/google/go-github/branch/master/graph/badge.svg)](https://codecov.io/gh/google/go-github) [![Discuss at go-github@googlegroups.com](https://img.shields.io/badge/discuss-go--github%40googlegroups.com-blue.svg)](https://groups.google.com/group/go-github) @@ -24,7 +24,7 @@ If you're interested in using the [GraphQL API v4][], the recommended library is go-github is compatible with modern Go releases in module mode, with Go installed: ```bash -go get github.com/google/go-github/v46 +go get github.com/google/go-github/v47 ``` will resolve and add the package to the current development module, along with its dependencies. @@ -32,7 +32,7 @@ will resolve and add the package to the current development module, along with i Alternatively the same can be achieved if you use import in a package: ```go -import "github.com/google/go-github/v46/github" +import "github.com/google/go-github/v47/github" ``` and run `go get` without parameters. @@ -40,13 +40,13 @@ and run `go get` without parameters. Finally, to use the top-of-trunk version of this repo, use the following command: ```bash -go get github.com/google/go-github/v46@master +go get github.com/google/go-github/v47@master ``` ## Usage ## ```go -import "github.com/google/go-github/v46/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) +import "github.com/google/go-github/v47/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled ``` @@ -135,7 +135,7 @@ import ( "net/http" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v46/github" + "github.com/google/go-github/v47/github" ) func main() { @@ -290,7 +290,7 @@ For complete usage of go-github, see the full [package docs][]. [oauth2]: https://github.com/golang/oauth2 [oauth2 docs]: https://godoc.org/golang.org/x/oauth2 [personal API token]: https://github.com/blog/1509-personal-api-tokens -[package docs]: https://pkg.go.dev/github.com/google/go-github/v46/github +[package docs]: https://pkg.go.dev/github.com/google/go-github/v47/github [GraphQL API v4]: https://developer.github.com/v4/ [shurcooL/githubv4]: https://github.com/shurcooL/githubv4 [GitHub webhook events]: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads diff --git a/example/actionpermissions/main.go b/example/actionpermissions/main.go index af2f28735db..77ef08be375 100644 --- a/example/actionpermissions/main.go +++ b/example/actionpermissions/main.go @@ -14,7 +14,7 @@ import ( "log" "os" - "github.com/google/go-github/v46/github" + "github.com/google/go-github/v47/github" "golang.org/x/oauth2" ) diff --git a/example/appengine/app.go b/example/appengine/app.go index df85f83cc2a..fa654c38668 100644 --- a/example/appengine/app.go +++ b/example/appengine/app.go @@ -12,7 +12,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v46/github" + "github.com/google/go-github/v47/github" "golang.org/x/oauth2" "google.golang.org/appengine" "google.golang.org/appengine/log" diff --git a/example/basicauth/main.go b/example/basicauth/main.go index ee51bab74de..b04290d6f92 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -22,7 +22,7 @@ import ( "strings" "syscall" - "github.com/google/go-github/v46/github" + "github.com/google/go-github/v47/github" "golang.org/x/crypto/ssh/terminal" ) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index f1310acb218..f4021c3efc7 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -31,7 +31,7 @@ import ( "strings" "time" - "github.com/google/go-github/v46/github" + "github.com/google/go-github/v47/github" "golang.org/x/oauth2" ) diff --git a/example/go.mod b/example/go.mod index 17a20a763f5..12b674cc9de 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,10 +1,10 @@ -module github.com/google/go-github/v46/example +module github.com/google/go-github/v47/example go 1.17 require ( github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 - github.com/google/go-github/v46 v46.0.0 + github.com/google/go-github/v47 v47.0.0 golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be google.golang.org/appengine v1.6.7 @@ -21,4 +21,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v46 => ../ +replace github.com/google/go-github/v47 => ../ diff --git a/example/listenvironments/main.go b/example/listenvironments/main.go index 657334b7d65..bc06caaacb9 100644 --- a/example/listenvironments/main.go +++ b/example/listenvironments/main.go @@ -18,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v46/github" + "github.com/google/go-github/v47/github" "golang.org/x/oauth2" ) diff --git a/example/migrations/main.go b/example/migrations/main.go index ae098f99903..7ec2473d8be 100644 --- a/example/migrations/main.go +++ b/example/migrations/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v46/github" + "github.com/google/go-github/v47/github" "golang.org/x/oauth2" ) diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index 4915d00420b..059f7cda8d3 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -16,7 +16,7 @@ import ( "time" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v46/github" + "github.com/google/go-github/v47/github" "golang.org/x/oauth2" ) diff --git a/example/newrepo/main.go b/example/newrepo/main.go index bb1b4b096e4..e7b24d13d96 100644 --- a/example/newrepo/main.go +++ b/example/newrepo/main.go @@ -16,7 +16,7 @@ import ( "log" "os" - "github.com/google/go-github/v46/github" + "github.com/google/go-github/v47/github" "golang.org/x/oauth2" ) diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index 62b9c01ed6a..5688f67c75c 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -4,9 +4,9 @@ go 1.15 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb - github.com/google/go-github/v46 v46.0.0 + github.com/google/go-github/v47 v47.0.0 golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v46 => ../.. +replace github.com/google/go-github/v47 => ../.. diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index e7dc4f1f555..c7f0c441230 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -36,7 +36,7 @@ import ( "os" sodium "github.com/GoKillers/libsodium-go/cryptobox" - "github.com/google/go-github/v46/github" + "github.com/google/go-github/v47/github" "golang.org/x/oauth2" ) diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index 89f62023a7d..96e64eccca9 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -36,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v46/github" + "github.com/google/go-github/v47/github" "golang.org/x/crypto/nacl/box" "golang.org/x/oauth2" ) diff --git a/example/simple/main.go b/example/simple/main.go index c4dfbc5f951..fe26c74753b 100644 --- a/example/simple/main.go +++ b/example/simple/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v46/github" + "github.com/google/go-github/v47/github" ) // Fetch all the public organizations' membership of a user. diff --git a/example/tagprotection/main.go b/example/tagprotection/main.go index 821b6c95f88..433612c48bc 100644 --- a/example/tagprotection/main.go +++ b/example/tagprotection/main.go @@ -19,7 +19,7 @@ import ( "strings" "syscall" - "github.com/google/go-github/v46/github" + "github.com/google/go-github/v47/github" "golang.org/x/crypto/ssh/terminal" "golang.org/x/oauth2" ) diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index 2773ecac59b..58754382923 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -14,7 +14,7 @@ import ( "log" "syscall" - "github.com/google/go-github/v46/github" + "github.com/google/go-github/v47/github" "golang.org/x/crypto/ssh/terminal" "golang.org/x/oauth2" ) diff --git a/example/topics/main.go b/example/topics/main.go index d6a20e757db..7549feec757 100644 --- a/example/topics/main.go +++ b/example/topics/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v46/github" + "github.com/google/go-github/v47/github" ) // Fetch and lists all the public topics associated with the specified GitHub topic diff --git a/github/doc.go b/github/doc.go index e6f1a56398a..9ab7f558758 100644 --- a/github/doc.go +++ b/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v46/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v47/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to diff --git a/github/examples_test.go b/github/examples_test.go index af973f487ca..2f8c87d78ea 100644 --- a/github/examples_test.go +++ b/github/examples_test.go @@ -12,7 +12,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v46/github" + "github.com/google/go-github/v47/github" ) func ExampleClient_Markdown() { diff --git a/github/github.go b/github/github.go index 27c8b72f61d..da923dbbb38 100644 --- a/github/github.go +++ b/github/github.go @@ -28,7 +28,7 @@ import ( ) const ( - Version = "46.0.0" + Version = "v47.0.0" defaultBaseURL = "https://api.github.com/" defaultUserAgent = "go-github" + "/" + Version diff --git a/go.mod b/go.mod index d6d8bd6e810..b2327d9151b 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v46 +module github.com/google/go-github/v47 require ( github.com/google/go-cmp v0.5.8 diff --git a/test/fields/fields.go b/test/fields/fields.go index efcc85a7a13..07e12441283 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -25,7 +25,7 @@ import ( "reflect" "strings" - "github.com/google/go-github/v46/github" + "github.com/google/go-github/v47/github" "golang.org/x/oauth2" ) diff --git a/test/integration/activity_test.go b/test/integration/activity_test.go index 3cb03630e95..fd57c3841c3 100644 --- a/test/integration/activity_test.go +++ b/test/integration/activity_test.go @@ -12,7 +12,7 @@ import ( "context" "testing" - "github.com/google/go-github/v46/github" + "github.com/google/go-github/v47/github" ) const ( diff --git a/test/integration/authorizations_test.go b/test/integration/authorizations_test.go index 83f81376f57..28e60ec9363 100644 --- a/test/integration/authorizations_test.go +++ b/test/integration/authorizations_test.go @@ -17,7 +17,7 @@ import ( "testing" "time" - "github.com/google/go-github/v46/github" + "github.com/google/go-github/v47/github" ) const msgEnvMissing = "Skipping test because the required environment variable (%v) is not present." diff --git a/test/integration/github_test.go b/test/integration/github_test.go index 100f9d4e94a..cbaa1d1c92c 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -15,7 +15,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v46/github" + "github.com/google/go-github/v47/github" "golang.org/x/oauth2" ) diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index b5715b2bb18..627d28dbf61 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -16,7 +16,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v46/github" + "github.com/google/go-github/v47/github" ) func TestRepositories_CRUD(t *testing.T) { diff --git a/test/integration/users_test.go b/test/integration/users_test.go index e75729fdd33..8553e258117 100644 --- a/test/integration/users_test.go +++ b/test/integration/users_test.go @@ -14,7 +14,7 @@ import ( "math/rand" "testing" - "github.com/google/go-github/v46/github" + "github.com/google/go-github/v47/github" ) func TestUsers_Get(t *testing.T) { diff --git a/update-urls/go.mod b/update-urls/go.mod index a63248394b7..a1d8c8e9443 100644 --- a/update-urls/go.mod +++ b/update-urls/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v46/update-urls +module github.com/google/go-github/v47/update-urls go 1.16 From 243bda850b1f78957ba0d50fb62ecdb4fbe977d5 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Mon, 22 Aug 2022 18:54:27 -0400 Subject: [PATCH 046/751] Update scrape dependency to v47 (#2442) --- scrape/apps.go | 2 +- scrape/apps_test.go | 2 +- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scrape/apps.go b/scrape/apps.go index 61e851f5dde..e8d810db273 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -17,7 +17,7 @@ import ( "strings" "github.com/PuerkitoBio/goquery" - "github.com/google/go-github/v46/github" + "github.com/google/go-github/v47/github" ) // AppRestrictionsEnabled returns whether the specified organization has diff --git a/scrape/apps_test.go b/scrape/apps_test.go index 25fecec6028..029b019b139 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v46/github" + "github.com/google/go-github/v47/github" ) func Test_AppRestrictionsEnabled(t *testing.T) { diff --git a/scrape/go.mod b/scrape/go.mod index 09533741008..37f3d97ed09 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/v46 v46.0.0 + github.com/google/go-github/v47 v47.0.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 8a95631be77..f17c5ece9a6 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/v46 v46.0.0 h1:5TZiEw0Is5D9CPld0TSLPjShGr42L7PoyhUSl6KPMKM= -github.com/google/go-github/v46 v46.0.0/go.mod h1:l+/Ml209okuXUAjbvFnGZ2ntokVAhTtXvYWP8Di7OpU= +github.com/google/go-github/v47 v47.0.0 h1:eQap5bIRZibukP0VhngWgpuM0zhY4xntqOzn6DhdkE4= +github.com/google/go-github/v47 v47.0.0/go.mod h1:DRjdvizXE876j0YOZwInB1ESpOcU/xFBClNiQLSdorE= 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= From 10669e6c6bcb6923f024b40ca2614a2f3129a26b Mon Sep 17 00:00:00 2001 From: Takuma Kajikawa Date: Thu, 1 Sep 2022 08:58:16 +0900 Subject: [PATCH 047/751] Additional options name, default_branch_only for create a fork (#2448) Fixes: #2447. --- github/repos_forks.go | 4 +++- github/repos_forks_test.go | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/github/repos_forks.go b/github/repos_forks.go index 97bb328ffb4..5c7d5dbd785 100644 --- a/github/repos_forks.go +++ b/github/repos_forks.go @@ -53,7 +53,9 @@ func (s *RepositoriesService) ListForks(ctx context.Context, owner, repo string, // RepositoriesService.CreateFork method. type RepositoryCreateForkOptions struct { // The organization to fork the repository into. - Organization string `url:"organization,omitempty"` + Organization string `url:"organization,omitempty"` + Name string `url:"name,omitempty"` + DefaultBranchOnly bool `url:"default_branch_only,omitempty"` } // CreateFork creates a fork of the specified repository. diff --git a/github/repos_forks_test.go b/github/repos_forks_test.go index 83b7a827812..07be423bc35 100644 --- a/github/repos_forks_test.go +++ b/github/repos_forks_test.go @@ -73,11 +73,11 @@ func TestRepositoriesService_CreateFork(t *testing.T) { mux.HandleFunc("/repos/o/r/forks", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") - testFormValues(t, r, values{"organization": "o"}) + testFormValues(t, r, values{"organization": "o", "name": "n", "default_branch_only": "true"}) fmt.Fprint(w, `{"id":1}`) }) - opt := &RepositoryCreateForkOptions{Organization: "o"} + opt := &RepositoryCreateForkOptions{Organization: "o", Name: "n", DefaultBranchOnly: true} ctx := context.Background() repo, _, err := client.Repositories.CreateFork(ctx, "o", "r", opt) if err != nil { @@ -110,13 +110,13 @@ func TestRepositoriesService_CreateFork_deferred(t *testing.T) { mux.HandleFunc("/repos/o/r/forks", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") - testFormValues(t, r, values{"organization": "o"}) + testFormValues(t, r, values{"organization": "o", "name": "n", "default_branch_only": "true"}) // This response indicates the fork will happen asynchronously. w.WriteHeader(http.StatusAccepted) fmt.Fprint(w, `{"id":1}`) }) - opt := &RepositoryCreateForkOptions{Organization: "o"} + opt := &RepositoryCreateForkOptions{Organization: "o", Name: "n", DefaultBranchOnly: true} ctx := context.Background() repo, _, err := client.Repositories.CreateFork(ctx, "o", "r", opt) if _, ok := err.(*AcceptedError); !ok { From af69917d404934f24ae81ffaf83fbc1db074967d Mon Sep 17 00:00:00 2001 From: Mustafa Abban Date: Thu, 1 Sep 2022 15:58:19 -0500 Subject: [PATCH 048/751] List Secret Scan Alerts with index-based pagination (#2446) --- github/secret_scanning.go | 8 ++++ github/secret_scanning_test.go | 67 ++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) diff --git a/github/secret_scanning.go b/github/secret_scanning.go index ec64950a67f..d512560d9fe 100644 --- a/github/secret_scanning.go +++ b/github/secret_scanning.go @@ -61,6 +61,14 @@ type SecretScanningAlertListOptions struct { Resolution string `url:"resolution,omitempty"` ListCursorOptions + + // List options can vary on the Enterprise type. + // On Enterprise Cloud, Secret Scan alerts support requesting by page number + // along with providing a cursor for an "after" param. + // See: https://docs.github.com/en/enterprise-cloud@latest/rest/secret-scanning#list-secret-scanning-alerts-for-an-organization + // Whereas on Enterprise Server, pagination is by index. + // See: https://docs.github.com/en/enterprise-server@3.6/rest/secret-scanning#list-secret-scanning-alerts-for-an-organization + ListOptions } // SecretScanningAlertUpdateOptions specifies optional parameters to the SecretScanningService.UpdateAlert method. diff --git a/github/secret_scanning_test.go b/github/secret_scanning_test.go index afe6144e7c5..af70fc80877 100644 --- a/github/secret_scanning_test.go +++ b/github/secret_scanning_test.go @@ -146,6 +146,73 @@ func TestSecretScanningService_ListAlertsForOrg(t *testing.T) { }) } +func TestSecretScanningService_ListAlertsForOrgListOptions(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/secret-scanning/alerts", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{"state": "open", "secret_type": "mailchimp_api_key", "per_page": "1", "page": "1"}) + + fmt.Fprint(w, `[{ + "number": 1, + "created_at": "1996-06-20T00:00:00Z", + "url": "https://api.github.com/repos/o/r/secret-scanning/alerts/1", + "html_url": "https://github.com/o/r/security/secret-scanning/1", + "locations_url": "https://api.github.com/repos/o/r/secret-scanning/alerts/1/locations", + "state": "open", + "resolution": null, + "resolved_at": null, + "resolved_by": null, + "secret_type": "mailchimp_api_key", + "secret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2" + }]`) + }) + + ctx := context.Background() + + // Testing pagination by index + opts := &SecretScanningAlertListOptions{State: "open", SecretType: "mailchimp_api_key", ListOptions: ListOptions{Page: 1, PerPage: 1}} + + alerts, _, err := client.SecretScanning.ListAlertsForOrg(ctx, "o", opts) + if err != nil { + t.Errorf("SecretScanning.ListAlertsForOrg returned error: %v", err) + } + + date := Timestamp{time.Date(1996, time.June, 20, 00, 00, 00, 0, time.UTC)} + want := []*SecretScanningAlert{ + { + Number: Int(1), + CreatedAt: &date, + URL: String("https://api.github.com/repos/o/r/secret-scanning/alerts/1"), + HTMLURL: String("https://github.com/o/r/security/secret-scanning/1"), + LocationsURL: String("https://api.github.com/repos/o/r/secret-scanning/alerts/1/locations"), + State: String("open"), + Resolution: nil, + ResolvedAt: nil, + ResolvedBy: nil, + SecretType: String("mailchimp_api_key"), + Secret: String("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2"), + }, + } + + if !cmp.Equal(alerts, want) { + t.Errorf("SecretScanning.ListAlertsForOrg returned %+v, want %+v", alerts, want) + } + + const methodName = "ListAlertsForOrg" + + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.SecretScanning.ListAlertsForOrg(ctx, "\n", opts) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + _, resp, err := client.SecretScanning.ListAlertsForOrg(ctx, "o", opts) + return resp, err + }) +} + func TestSecretScanningService_ListAlertsForRepo(t *testing.T) { client, mux, _, teardown := setup() defer teardown() From 6e951266a4824d26034b8ba7d1f2e7711cd3f684 Mon Sep 17 00:00:00 2001 From: Doug Ayers <4142577+douglascayers@users.noreply.github.com> Date: Mon, 5 Sep 2022 03:22:59 -0500 Subject: [PATCH 049/751] Add alphanumeric param to AutolinkOptions (#2450) Fixes: #2449. --- github/github-accessors.go | 16 ++++++++++ github/github-accessors_test.go | 20 +++++++++++++ github/repos_autolinks.go | 12 ++++---- github/repos_autolinks_test.go | 37 ++++++++++++++++------- test/README.md | 4 +++ test/integration/github_test.go | 32 ++++++++++++-------- test/integration/repos_test.go | 52 ++++++++++++++++++++++++--------- 7 files changed, 131 insertions(+), 42 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 1b1c9d9511e..e30f5beab65 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -1374,6 +1374,14 @@ func (a *Autolink) GetID() int64 { return *a.ID } +// GetIsAlphanumeric returns the IsAlphanumeric field if it's non-nil, zero value otherwise. +func (a *Autolink) GetIsAlphanumeric() bool { + if a == nil || a.IsAlphanumeric == nil { + return false + } + return *a.IsAlphanumeric +} + // GetKeyPrefix returns the KeyPrefix field if it's non-nil, zero value otherwise. func (a *Autolink) GetKeyPrefix() string { if a == nil || a.KeyPrefix == nil { @@ -1390,6 +1398,14 @@ func (a *Autolink) GetURLTemplate() string { return *a.URLTemplate } +// GetIsAlphanumeric returns the IsAlphanumeric field if it's non-nil, zero value otherwise. +func (a *AutolinkOptions) GetIsAlphanumeric() bool { + if a == nil || a.IsAlphanumeric == nil { + return false + } + return *a.IsAlphanumeric +} + // GetKeyPrefix returns the KeyPrefix field if it's non-nil, zero value otherwise. func (a *AutolinkOptions) GetKeyPrefix() string { if a == nil || a.KeyPrefix == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 45744693cee..a48ca939161 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -1640,6 +1640,16 @@ func TestAutolink_GetID(tt *testing.T) { a.GetID() } +func TestAutolink_GetIsAlphanumeric(tt *testing.T) { + var zeroValue bool + a := &Autolink{IsAlphanumeric: &zeroValue} + a.GetIsAlphanumeric() + a = &Autolink{} + a.GetIsAlphanumeric() + a = nil + a.GetIsAlphanumeric() +} + func TestAutolink_GetKeyPrefix(tt *testing.T) { var zeroValue string a := &Autolink{KeyPrefix: &zeroValue} @@ -1660,6 +1670,16 @@ func TestAutolink_GetURLTemplate(tt *testing.T) { a.GetURLTemplate() } +func TestAutolinkOptions_GetIsAlphanumeric(tt *testing.T) { + var zeroValue bool + a := &AutolinkOptions{IsAlphanumeric: &zeroValue} + a.GetIsAlphanumeric() + a = &AutolinkOptions{} + a.GetIsAlphanumeric() + a = nil + a.GetIsAlphanumeric() +} + func TestAutolinkOptions_GetKeyPrefix(tt *testing.T) { var zeroValue string a := &AutolinkOptions{KeyPrefix: &zeroValue} diff --git a/github/repos_autolinks.go b/github/repos_autolinks.go index 8fa916eac2c..0d2cec618f0 100644 --- a/github/repos_autolinks.go +++ b/github/repos_autolinks.go @@ -12,15 +12,17 @@ import ( // AutolinkOptions specifies parameters for RepositoriesService.AddAutolink method. type AutolinkOptions struct { - KeyPrefix *string `json:"key_prefix,omitempty"` - URLTemplate *string `json:"url_template,omitempty"` + KeyPrefix *string `json:"key_prefix,omitempty"` + URLTemplate *string `json:"url_template,omitempty"` + IsAlphanumeric *bool `json:"is_alphanumeric,omitempty"` } // Autolink represents autolinks to external resources like JIRA issues and Zendesk tickets. type Autolink struct { - ID *int64 `json:"id,omitempty"` - KeyPrefix *string `json:"key_prefix,omitempty"` - URLTemplate *string `json:"url_template,omitempty"` + ID *int64 `json:"id,omitempty"` + KeyPrefix *string `json:"key_prefix,omitempty"` + URLTemplate *string `json:"url_template,omitempty"` + IsAlphanumeric *bool `json:"is_alphanumeric,omitempty"` } // ListAutolinks returns a list of autolinks configured for the given repository. diff --git a/github/repos_autolinks_test.go b/github/repos_autolinks_test.go index 930be7f5de6..a666dbf3ac7 100644 --- a/github/repos_autolinks_test.go +++ b/github/repos_autolinks_test.go @@ -62,7 +62,11 @@ func TestRepositoriesService_AddAutolink(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - opt := &AutolinkOptions{KeyPrefix: String("TICKET-"), URLTemplate: String("https://example.com/TICKET?query=")} + opt := &AutolinkOptions{ + KeyPrefix: String("TICKET-"), + URLTemplate: String("https://example.com/TICKET?query="), + IsAlphanumeric: Bool(true), + } mux.HandleFunc("/repos/o/r/autolinks", func(w http.ResponseWriter, r *http.Request) { v := new(AutolinkOptions) json.NewDecoder(r.Body).Decode(v) @@ -71,7 +75,13 @@ func TestRepositoriesService_AddAutolink(t *testing.T) { t.Errorf("Request body = %+v, want %+v", v, opt) } w.WriteHeader(http.StatusOK) - w.Write([]byte(`{"key_prefix": "TICKET-","url_template": "https://example.com/TICKET?query="}`)) + w.Write([]byte(` + { + "key_prefix": "TICKET-", + "url_template": "https://example.com/TICKET?query=", + "is_alphanumeric": true + } + `)) }) ctx := context.Background() autolink, _, err := client.Repositories.AddAutolink(ctx, "o", "r", opt) @@ -79,8 +89,9 @@ func TestRepositoriesService_AddAutolink(t *testing.T) { t.Errorf("Repositories.AddAutolink returned error: %v", err) } want := &Autolink{ - KeyPrefix: String("TICKET-"), - URLTemplate: String("https://example.com/TICKET?query="), + KeyPrefix: String("TICKET-"), + URLTemplate: String("https://example.com/TICKET?query="), + IsAlphanumeric: Bool(true), } if !cmp.Equal(autolink, want) { @@ -157,13 +168,15 @@ func TestAutolinkOptions_Marshal(t *testing.T) { testJSONMarshal(t, &AutolinkOptions{}, "{}") r := &AutolinkOptions{ - KeyPrefix: String("kp"), - URLTemplate: String("URLT"), + KeyPrefix: String("kp"), + URLTemplate: String("URLT"), + IsAlphanumeric: Bool(true), } want := `{ "key_prefix": "kp", - "url_template": "URLT" + "url_template": "URLT", + "is_alphanumeric": true }` testJSONMarshal(t, r, want) @@ -173,15 +186,17 @@ func TestAutolink_Marshal(t *testing.T) { testJSONMarshal(t, &Autolink{}, "{}") r := &Autolink{ - ID: Int64(1), - KeyPrefix: String("kp"), - URLTemplate: String("URLT"), + ID: Int64(1), + KeyPrefix: String("kp"), + URLTemplate: String("URLT"), + IsAlphanumeric: Bool(true), } want := `{ "id": 1, "key_prefix": "kp", - "url_template": "URLT" + "url_template": "URLT", + "is_alphanumeric": true }` testJSONMarshal(t, r, want) diff --git a/test/README.md b/test/README.md index 455795a7b80..45ca3220062 100644 --- a/test/README.md +++ b/test/README.md @@ -31,6 +31,10 @@ Run tests using: GITHUB_AUTH_TOKEN=XXX go test -v -tags=integration ./integration +Some tests create repositories. By default, the new repositories will be owned +by the user identified by the OAuth token. Set the `GITHUB_OWNER=''` +environment variable to specify a different owner, such as an organization. + Additionally there are a set of integration tests for the Authorizations API. These tests require a GitHub user (username and password), and also that a [GitHub Application](https://github.com/settings/applications/new) (with diff --git a/test/integration/github_test.go b/test/integration/github_test.go index cbaa1d1c92c..790754b32e1 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -39,17 +39,6 @@ func init() { client = github.NewClient(tc) auth = true } - - // Environment variables required for Authorization integration tests - vars := []string{envKeyGitHubUsername, envKeyGitHubPassword, envKeyClientID, envKeyClientSecret} - - for _, v := range vars { - value := os.Getenv(v) - if value == "" { - print("!!! " + fmt.Sprintf(msgEnvMissing, v) + " !!!\n\n") - } - } - } func checkAuth(name string) bool { @@ -60,6 +49,18 @@ func checkAuth(name string) bool { } func createRandomTestRepository(owner string, autoinit bool) (*github.Repository, error) { + // determine the owner to use if one wasn't specified + if owner == "" { + owner = os.Getenv("GITHUB_OWNER") + if owner == "" { + me, _, err := client.Users.Get(context.Background(), "") + if err != nil { + return nil, err + } + owner = *me.Login + } + } + // create random repo name that does not currently exist var repoName string for { @@ -76,7 +77,14 @@ func createRandomTestRepository(owner string, autoinit bool) (*github.Repository } // create the repository - repo, _, err := client.Repositories.Create(context.Background(), "", &github.Repository{Name: github.String(repoName), AutoInit: github.Bool(autoinit)}) + repo, _, err := client.Repositories.Create( + context.Background(), + owner, + &github.Repository{ + Name: github.String(repoName), + AutoInit: github.Bool(autoinit), + }, + ) if err != nil { return nil, err } diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index 627d28dbf61..21b786e724e 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -24,13 +24,8 @@ func TestRepositories_CRUD(t *testing.T) { return } - // get authenticated user - me, _, err := client.Users.Get(context.Background(), "") - if err != nil { - t.Fatalf("Users.Get('') returned error: %v", err) - } - - repo, err := createRandomTestRepository(*me.Login, false) + // create a random repository + repo, err := createRandomTestRepository("", true) if err != nil { t.Fatalf("createRandomTestRepository returned error: %v", err) } @@ -91,13 +86,8 @@ func TestRepositories_EditBranches(t *testing.T) { return } - // get authenticated user - me, _, err := client.Users.Get(context.Background(), "") - if err != nil { - t.Fatalf("Users.Get('') returned error: %v", err) - } - - repo, err := createRandomTestRepository(*me.Login, true) + // create a random repository + repo, err := createRandomTestRepository("", true) if err != nil { t.Fatalf("createRandomTestRepository returned error: %v", err) } @@ -198,3 +188,37 @@ func TestRepositories_DownloadReleaseAsset(t *testing.T) { t.Fatalf("Repositories.DownloadReleaseAsset(andersjanmyr, goose, 484892, true) returned error: %v", err) } } + +func TestRepositories_Autolinks(t *testing.T) { + if !checkAuth("TestRepositories_Autolinks") { + return + } + + // create a random repository + repo, err := createRandomTestRepository("", true) + if err != nil { + t.Fatalf("createRandomTestRepository returned error: %v", err) + } + + opts := &github.AutolinkOptions{ + KeyPrefix: github.String("TICKET-"), + URLTemplate: github.String("https://example.com/TICKET?query="), + IsAlphanumeric: github.Bool(false), + } + + actionlink, _, err := client.Repositories.AddAutolink(context.Background(), *repo.Owner.Login, *repo.Name, opts) + if err != nil { + t.Fatalf("Repositories.AddAutolink() returned error: %v", err) + } + + if !cmp.Equal(actionlink.KeyPrefix, opts.KeyPrefix) || + !cmp.Equal(actionlink.URLTemplate, opts.URLTemplate) || + !cmp.Equal(actionlink.IsAlphanumeric, opts.IsAlphanumeric) { + t.Errorf("Repositories.AddAutolink() returned %+v, want %+v", actionlink, opts) + } + + _, err = client.Repositories.Delete(context.Background(), *repo.Owner.Login, *repo.Name) + if err != nil { + t.Fatalf("Repositories.Delete() returned error: %v", err) + } +} From e8cac35caf11500112c6a67c302de07dfd5ef112 Mon Sep 17 00:00:00 2001 From: Connor Rogers <23215294+coro@users.noreply.github.com> Date: Mon, 5 Sep 2022 09:25:02 +0100 Subject: [PATCH 050/751] Remove GenerateReleaseNotes from RepositoriesService.EditRelease (#2445) Fixes: #2444. --- github/repos_releases.go | 5 +++-- github/repos_releases_test.go | 27 +++++++++++++-------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/github/repos_releases.go b/github/repos_releases.go index f1ab65c185f..c030f04d9a9 100644 --- a/github/repos_releases.go +++ b/github/repos_releases.go @@ -26,7 +26,9 @@ type RepositoryRelease struct { Draft *bool `json:"draft,omitempty"` Prerelease *bool `json:"prerelease,omitempty"` DiscussionCategoryName *string `json:"discussion_category_name,omitempty"` - GenerateReleaseNotes *bool `json:"generate_release_notes,omitempty"` + + // The following fields are not used in EditRelease: + GenerateReleaseNotes *bool `json:"generate_release_notes,omitempty"` // The following fields are not used in CreateRelease or EditRelease: ID *int64 `json:"id,omitempty"` @@ -228,7 +230,6 @@ func (s *RepositoriesService) EditRelease(ctx context.Context, owner, repo strin Draft: release.Draft, Prerelease: release.Prerelease, DiscussionCategoryName: release.DiscussionCategoryName, - GenerateReleaseNotes: release.GenerateReleaseNotes, } req, err := s.client.NewRequest("PATCH", u, releaseReq) diff --git a/github/repos_releases_test.go b/github/repos_releases_test.go index bebbc0ed459..ddd7d44e93f 100644 --- a/github/repos_releases_test.go +++ b/github/repos_releases_test.go @@ -273,20 +273,20 @@ func TestRepositoriesService_EditRelease(t *testing.T) { input := &RepositoryRelease{ Name: String("n"), DiscussionCategoryName: String("General"), - GenerateReleaseNotes: Bool(true), // Fields to be removed: - ID: Int64(2), - CreatedAt: &Timestamp{referenceTime}, - PublishedAt: &Timestamp{referenceTime}, - URL: String("http://url/"), - HTMLURL: String("http://htmlurl/"), - AssetsURL: String("http://assetsurl/"), - Assets: []*ReleaseAsset{{ID: Int64(5)}}, - UploadURL: String("http://uploadurl/"), - ZipballURL: String("http://zipballurl/"), - TarballURL: String("http://tarballurl/"), - Author: &User{Name: String("octocat")}, - NodeID: String("nodeid"), + GenerateReleaseNotes: Bool(true), + ID: Int64(2), + CreatedAt: &Timestamp{referenceTime}, + PublishedAt: &Timestamp{referenceTime}, + URL: String("http://url/"), + HTMLURL: String("http://htmlurl/"), + AssetsURL: String("http://assetsurl/"), + Assets: []*ReleaseAsset{{ID: Int64(5)}}, + UploadURL: String("http://uploadurl/"), + ZipballURL: String("http://zipballurl/"), + TarballURL: String("http://tarballurl/"), + Author: &User{Name: String("octocat")}, + NodeID: String("nodeid"), } mux.HandleFunc("/repos/o/r/releases/1", func(w http.ResponseWriter, r *http.Request) { @@ -297,7 +297,6 @@ func TestRepositoriesService_EditRelease(t *testing.T) { want := &repositoryReleaseRequest{ Name: String("n"), DiscussionCategoryName: String("General"), - GenerateReleaseNotes: Bool(true), } if !cmp.Equal(v, want) { t.Errorf("Request body = %+v, want %+v", v, want) From 52cc49edb35592cae8f6e4a2b9225270e3039835 Mon Sep 17 00:00:00 2001 From: Pete Wagner <1559510+thepwagner@users.noreply.github.com> Date: Tue, 6 Sep 2022 21:01:46 -0400 Subject: [PATCH 051/751] Add org permissions to InstallationPermissions (#2452) --- github/apps.go | 2 ++ github/apps_test.go | 4 ++++ github/github-accessors.go | 16 ++++++++++++++++ github/github-accessors_test.go | 20 ++++++++++++++++++++ 4 files changed, 42 insertions(+) diff --git a/github/apps.go b/github/apps.go index 0e92f7b719f..98d8a6fda3e 100644 --- a/github/apps.go +++ b/github/apps.go @@ -77,7 +77,9 @@ type InstallationPermissions struct { Metadata *string `json:"metadata,omitempty"` Members *string `json:"members,omitempty"` OrganizationAdministration *string `json:"organization_administration,omitempty"` + OrganizationCustomRoles *string `json:"organization_custom_roles,omitempty"` OrganizationHooks *string `json:"organization_hooks,omitempty"` + OrganizationPackages *string `json:"organization_packages,omitempty"` OrganizationPlan *string `json:"organization_plan,omitempty"` OrganizationPreReceiveHooks *string `json:"organization_pre_receive_hooks,omitempty"` OrganizationProjects *string `json:"organization_projects,omitempty"` diff --git a/github/apps_test.go b/github/apps_test.go index e003e27886f..494f1031bb5 100644 --- a/github/apps_test.go +++ b/github/apps_test.go @@ -99,7 +99,9 @@ func TestAppsService_ListInstallations(t *testing.T) { "metadata": "read", "members": "read", "organization_administration": "write", + "organization_custom_roles": "write", "organization_hooks": "write", + "organization_packages": "write", "organization_plan": "read", "organization_pre_receive_hooks": "write", "organization_projects": "read", @@ -159,7 +161,9 @@ func TestAppsService_ListInstallations(t *testing.T) { Metadata: String("read"), Members: String("read"), OrganizationAdministration: String("write"), + OrganizationCustomRoles: String("write"), OrganizationHooks: String("write"), + OrganizationPackages: String("write"), OrganizationPlan: String("read"), OrganizationPreReceiveHooks: String("write"), OrganizationProjects: String("read"), diff --git a/github/github-accessors.go b/github/github-accessors.go index e30f5beab65..32074e27543 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -6590,6 +6590,14 @@ func (i *InstallationPermissions) GetOrganizationAdministration() string { return *i.OrganizationAdministration } +// GetOrganizationCustomRoles returns the OrganizationCustomRoles field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetOrganizationCustomRoles() string { + if i == nil || i.OrganizationCustomRoles == nil { + return "" + } + return *i.OrganizationCustomRoles +} + // GetOrganizationHooks returns the OrganizationHooks field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetOrganizationHooks() string { if i == nil || i.OrganizationHooks == nil { @@ -6598,6 +6606,14 @@ func (i *InstallationPermissions) GetOrganizationHooks() string { return *i.OrganizationHooks } +// GetOrganizationPackages returns the OrganizationPackages field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetOrganizationPackages() string { + if i == nil || i.OrganizationPackages == nil { + return "" + } + return *i.OrganizationPackages +} + // GetOrganizationPlan returns the OrganizationPlan field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetOrganizationPlan() string { if i == nil || i.OrganizationPlan == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index a48ca939161..5296ee963a2 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -7734,6 +7734,16 @@ func TestInstallationPermissions_GetOrganizationAdministration(tt *testing.T) { i.GetOrganizationAdministration() } +func TestInstallationPermissions_GetOrganizationCustomRoles(tt *testing.T) { + var zeroValue string + i := &InstallationPermissions{OrganizationCustomRoles: &zeroValue} + i.GetOrganizationCustomRoles() + i = &InstallationPermissions{} + i.GetOrganizationCustomRoles() + i = nil + i.GetOrganizationCustomRoles() +} + func TestInstallationPermissions_GetOrganizationHooks(tt *testing.T) { var zeroValue string i := &InstallationPermissions{OrganizationHooks: &zeroValue} @@ -7744,6 +7754,16 @@ func TestInstallationPermissions_GetOrganizationHooks(tt *testing.T) { i.GetOrganizationHooks() } +func TestInstallationPermissions_GetOrganizationPackages(tt *testing.T) { + var zeroValue string + i := &InstallationPermissions{OrganizationPackages: &zeroValue} + i.GetOrganizationPackages() + i = &InstallationPermissions{} + i.GetOrganizationPackages() + i = nil + i.GetOrganizationPackages() +} + func TestInstallationPermissions_GetOrganizationPlan(tt *testing.T) { var zeroValue string i := &InstallationPermissions{OrganizationPlan: &zeroValue} From ae774d0751d40497e72d1ef2e3b98160adffd93e Mon Sep 17 00:00:00 2001 From: Shravan Konduru <42595673+shravan1k@users.noreply.github.com> Date: Mon, 12 Sep 2022 05:49:09 -0700 Subject: [PATCH 052/751] Escape special characters in ref name for update ref (#2454) Fixes: #2453. --- github/git_refs.go | 2 +- github/git_refs_test.go | 52 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/github/git_refs.go b/github/git_refs.go index 883975cc0fe..e839c30f667 100644 --- a/github/git_refs.go +++ b/github/git_refs.go @@ -142,7 +142,7 @@ func (s *GitService) CreateRef(ctx context.Context, owner string, repo string, r // GitHub API docs: https://docs.github.com/en/rest/git/refs#update-a-reference func (s *GitService) UpdateRef(ctx context.Context, owner string, repo string, ref *Reference, force bool) (*Reference, *Response, error) { refPath := strings.TrimPrefix(*ref.Ref, "refs/") - u := fmt.Sprintf("repos/%v/%v/git/refs/%v", owner, repo, refPath) + u := fmt.Sprintf("repos/%v/%v/git/refs/%v", owner, repo, refURLEscape(refPath)) req, err := s.client.NewRequest("PATCH", u, &updateRefRequest{ SHA: ref.Object.SHA, Force: &force, diff --git a/github/git_refs_test.go b/github/git_refs_test.go index 834748a232f..d37504945d1 100644 --- a/github/git_refs_test.go +++ b/github/git_refs_test.go @@ -624,6 +624,58 @@ func TestGitService_GetRef_pathEscape(t *testing.T) { }) } +func TestGitService_UpdateRef_pathEscape(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + args := &updateRefRequest{ + SHA: String("aa218f56b14c9653891f9e74264a383fa43fefbd"), + Force: Bool(true), + } + + mux.HandleFunc("/repos/o/r/git/refs/heads/b#1", func(w http.ResponseWriter, r *http.Request) { + v := new(updateRefRequest) + json.NewDecoder(r.Body).Decode(v) + + testMethod(t, r, "PATCH") + if !cmp.Equal(v, args) { + t.Errorf("Request body = %+v, want %+v", v, args) + } + fmt.Fprint(w, ` + { + "ref": "refs/heads/b#1", + "url": "https://api.github.com/repos/o/r/git/refs/heads/b%231", + "object": { + "type": "commit", + "sha": "aa218f56b14c9653891f9e74264a383fa43fefbd", + "url": "https://api.github.com/repos/o/r/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd" + } + }`) + }) + + ctx := context.Background() + ref, _, err := client.Git.UpdateRef(ctx, "o", "r", &Reference{ + Ref: String("refs/heads/b#1"), + Object: &GitObject{SHA: String("aa218f56b14c9653891f9e74264a383fa43fefbd")}, + }, true) + if err != nil { + t.Errorf("Git.UpdateRef returned error: %v", err) + } + + want := &Reference{ + Ref: String("refs/heads/b#1"), + URL: String("https://api.github.com/repos/o/r/git/refs/heads/b%231"), + Object: &GitObject{ + Type: String("commit"), + SHA: String("aa218f56b14c9653891f9e74264a383fa43fefbd"), + URL: String("https://api.github.com/repos/o/r/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd"), + }, + } + if !cmp.Equal(ref, want) { + t.Errorf("Git.UpdateRef returned %+v, want %+v", ref, want) + } +} + func TestReference_Marshal(t *testing.T) { testJSONMarshal(t, &Reference{}, "{}") From f452c622352039a1c8eba9efd06c3148fcc3a71a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Sep 2022 15:19:02 -0400 Subject: [PATCH 053/751] Bump github.com/google/go-cmp from 0.5.8 to 0.5.9 (#2457) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index b2327d9151b..bebe4027f5e 100644 --- a/go.mod +++ b/go.mod @@ -1,7 +1,7 @@ module github.com/google/go-github/v47 require ( - github.com/google/go-cmp v0.5.8 + github.com/google/go-cmp v0.5.9 github.com/google/go-querystring v1.1.0 golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be diff --git a/go.sum b/go.sum index de54fe0a5c5..fc6f776acef 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= From af7f4ae9298c4db5a87f1d5cd9944c717d92bbee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Sep 2022 15:20:03 -0400 Subject: [PATCH 054/751] Bump github.com/google/go-cmp from 0.5.8 to 0.5.9 in /scrape (#2458) --- scrape/go.mod | 2 +- scrape/go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 37f3d97ed09..4bd2130453e 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -4,7 +4,7 @@ go 1.13 require ( github.com/PuerkitoBio/goquery v1.8.0 - github.com/google/go-cmp v0.5.8 + github.com/google/go-cmp v0.5.9 github.com/google/go-github/v47 v47.0.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 f17c5ece9a6..ba862349b57 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -5,8 +5,9 @@ github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEq github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github/v47 v47.0.0 h1:eQap5bIRZibukP0VhngWgpuM0zhY4xntqOzn6DhdkE4= github.com/google/go-github/v47 v47.0.0/go.mod h1:DRjdvizXE876j0YOZwInB1ESpOcU/xFBClNiQLSdorE= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= From e2f737955018ce736e06dc1c61b267ef61923eea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Sep 2022 15:30:05 -0400 Subject: [PATCH 055/751] Bump github.com/google/go-cmp from 0.5.8 to 0.5.9 in /update-urls (#2459) --- update-urls/go.mod | 2 +- update-urls/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/update-urls/go.mod b/update-urls/go.mod index a1d8c8e9443..af987764985 100644 --- a/update-urls/go.mod +++ b/update-urls/go.mod @@ -3,6 +3,6 @@ module github.com/google/go-github/v47/update-urls go 1.16 require ( - github.com/google/go-cmp v0.5.8 + github.com/google/go-cmp v0.5.9 github.com/pmezard/go-difflib v1.0.0 ) diff --git a/update-urls/go.sum b/update-urls/go.sum index 1a64a0529b0..915dea3a949 100644 --- a/update-urls/go.sum +++ b/update-urls/go.sum @@ -1,4 +1,4 @@ -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-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= From d6115619cf61ccadd1925403243a8d1eb0f06966 Mon Sep 17 00:00:00 2001 From: Moein Halvaei <50274938+mo1ein@users.noreply.github.com> Date: Fri, 16 Sep 2022 00:03:16 +0430 Subject: [PATCH 056/751] Fix unhandled error in actions_artifacts.go (#2460) --- github/actions_artifacts.go | 4 ++++ github/actions_artifacts_test.go | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/github/actions_artifacts.go b/github/actions_artifacts.go index 3b9c83c490d..99329d989d9 100644 --- a/github/actions_artifacts.go +++ b/github/actions_artifacts.go @@ -121,6 +121,10 @@ func (s *ActionsService) DownloadArtifact(ctx context.Context, owner, repo strin } parsedURL, err := url.Parse(resp.Header.Get("Location")) + if err != nil { + return nil, newResponse(resp), err + } + return parsedURL, newResponse(resp), nil } diff --git a/github/actions_artifacts_test.go b/github/actions_artifacts_test.go index e35a873bc0a..345a0875348 100644 --- a/github/actions_artifacts_test.go +++ b/github/actions_artifacts_test.go @@ -368,6 +368,23 @@ func TestActionsService_DownloadArtifact_StatusMovedPermanently_followRedirects( } } +func TestActionsService_DownloadArtifact_invalidLocationHeader(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/actions/artifacts/1/zip", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + ctlChar := 0x7f + badURL := "https://google.com" + string(byte(ctlChar)) + w.Header().Add("Location", badURL) + w.WriteHeader(http.StatusFound) + }) + + ctx := context.Background() + _, _, err := client.Actions.DownloadArtifact(ctx, "o", "r", 1, false) + testURLParseError(t, err) +} + func TestActionsService_DeleteArtifact(t *testing.T) { client, mux, _, teardown := setup() defer teardown() From 30d14315cf48ffc2d2b4657231b4e6caa36af645 Mon Sep 17 00:00:00 2001 From: Moein Halvaei <50274938+mo1ein@users.noreply.github.com> Date: Sat, 17 Sep 2022 23:11:32 +0430 Subject: [PATCH 057/751] Add explicit error return (#2469) --- github/repos_contents.go | 6 +++++- github/repos_contents_test.go | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/github/repos_contents.go b/github/repos_contents.go index 431d4b12dc2..be58fd52f66 100644 --- a/github/repos_contents.go +++ b/github/repos_contents.go @@ -317,5 +317,9 @@ func (s *RepositoriesService) GetArchiveLink(ctx context.Context, owner, repo st } parsedURL, err := url.Parse(resp.Header.Get("Location")) - return parsedURL, newResponse(resp), err + if err != nil { + return nil, newResponse(resp), err + } + + return parsedURL, newResponse(resp), nil } diff --git a/github/repos_contents_test.go b/github/repos_contents_test.go index e0465e93d03..1cfa100df31 100644 --- a/github/repos_contents_test.go +++ b/github/repos_contents_test.go @@ -744,6 +744,23 @@ func TestRepositoriesService_GetArchiveLink_StatusMovedPermanently_followRedirec } } +func TestRepositoriesService_GetArchiveLink_invalidLocationHeader(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/tarball", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + ctlChar := 0x7f + badURL := "https://google.com" + string(byte(ctlChar)) + w.Header().Add("Location", badURL) + w.WriteHeader(http.StatusFound) + }) + + ctx := context.Background() + _, _, err := client.Repositories.GetArchiveLink(ctx, "o", "r", Tarball, &RepositoryContentGetOptions{}, false) + testURLParseError(t, err) +} + func TestRepositoriesService_GetContents_NoTrailingSlashInDirectoryApiPath(t *testing.T) { client, mux, _, teardown := setup() defer teardown() From 642c34392de75e4ff892a9f1252745b0dca12537 Mon Sep 17 00:00:00 2001 From: Brett Kuhlman Date: Sat, 17 Sep 2022 23:06:47 -0400 Subject: [PATCH 058/751] Add org struct fields (#2471) Fixes: #2470 --- github/github-accessors.go | 56 ++++++++++++++++++++++++++ github/github-accessors_test.go | 70 +++++++++++++++++++++++++++++++++ github/github-stringify_test.go | 25 +++++++----- github/orgs.go | 14 +++++++ 4 files changed, 156 insertions(+), 9 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 32074e27543..398ed7a3b41 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -9430,6 +9430,14 @@ func (o *OAuthAPP) GetURL() string { return *o.URL } +// GetAdvancedSecurityEnabledForNewRepos returns the AdvancedSecurityEnabledForNewRepos field if it's non-nil, zero value otherwise. +func (o *Organization) GetAdvancedSecurityEnabledForNewRepos() bool { + if o == nil || o.AdvancedSecurityEnabledForNewRepos == nil { + return false + } + return *o.AdvancedSecurityEnabledForNewRepos +} + // GetAvatarURL returns the AvatarURL field if it's non-nil, zero value otherwise. func (o *Organization) GetAvatarURL() string { if o == nil || o.AvatarURL == nil { @@ -9494,6 +9502,30 @@ func (o *Organization) GetDefaultRepoSettings() string { return *o.DefaultRepoSettings } +// GetDependabotAlertsEnabledForNewRepos returns the DependabotAlertsEnabledForNewRepos field if it's non-nil, zero value otherwise. +func (o *Organization) GetDependabotAlertsEnabledForNewRepos() bool { + if o == nil || o.DependabotAlertsEnabledForNewRepos == nil { + return false + } + return *o.DependabotAlertsEnabledForNewRepos +} + +// GetDependabotSecurityUpdatesEnabledForNewRepos returns the DependabotSecurityUpdatesEnabledForNewRepos field if it's non-nil, zero value otherwise. +func (o *Organization) GetDependabotSecurityUpdatesEnabledForNewRepos() bool { + if o == nil || o.DependabotSecurityUpdatesEnabledForNewRepos == nil { + return false + } + return *o.DependabotSecurityUpdatesEnabledForNewRepos +} + +// GetDependencyGraphEnabledForNewRepos returns the DependencyGraphEnabledForNewRepos field if it's non-nil, zero value otherwise. +func (o *Organization) GetDependencyGraphEnabledForNewRepos() bool { + if o == nil || o.DependencyGraphEnabledForNewRepos == nil { + return false + } + return *o.DependencyGraphEnabledForNewRepos +} + // GetDescription returns the Description field if it's non-nil, zero value otherwise. func (o *Organization) GetDescription() string { if o == nil || o.Description == nil { @@ -9766,6 +9798,22 @@ func (o *Organization) GetReposURL() string { return *o.ReposURL } +// GetSecretScanningEnabledForNewRepos returns the SecretScanningEnabledForNewRepos field if it's non-nil, zero value otherwise. +func (o *Organization) GetSecretScanningEnabledForNewRepos() bool { + if o == nil || o.SecretScanningEnabledForNewRepos == nil { + return false + } + return *o.SecretScanningEnabledForNewRepos +} + +// GetSecretScanningPushProtectionEnabledForNewRepos returns the SecretScanningPushProtectionEnabledForNewRepos field if it's non-nil, zero value otherwise. +func (o *Organization) GetSecretScanningPushProtectionEnabledForNewRepos() bool { + if o == nil || o.SecretScanningPushProtectionEnabledForNewRepos == nil { + return false + } + return *o.SecretScanningPushProtectionEnabledForNewRepos +} + // GetTotalPrivateRepos returns the TotalPrivateRepos field if it's non-nil, zero value otherwise. func (o *Organization) GetTotalPrivateRepos() int { if o == nil || o.TotalPrivateRepos == nil { @@ -9814,6 +9862,14 @@ func (o *Organization) GetURL() string { return *o.URL } +// GetWebCommitSignoffRequired returns the WebCommitSignoffRequired field if it's non-nil, zero value otherwise. +func (o *Organization) GetWebCommitSignoffRequired() bool { + if o == nil || o.WebCommitSignoffRequired == nil { + return false + } + return *o.WebCommitSignoffRequired +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (o *OrganizationCustomRepoRoles) GetTotalCount() int { if o == nil || o.TotalCount == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 5296ee963a2..e3d565b8ccd 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -11041,6 +11041,16 @@ func TestOAuthAPP_GetURL(tt *testing.T) { o.GetURL() } +func TestOrganization_GetAdvancedSecurityEnabledForNewRepos(tt *testing.T) { + var zeroValue bool + o := &Organization{AdvancedSecurityEnabledForNewRepos: &zeroValue} + o.GetAdvancedSecurityEnabledForNewRepos() + o = &Organization{} + o.GetAdvancedSecurityEnabledForNewRepos() + o = nil + o.GetAdvancedSecurityEnabledForNewRepos() +} + func TestOrganization_GetAvatarURL(tt *testing.T) { var zeroValue string o := &Organization{AvatarURL: &zeroValue} @@ -11121,6 +11131,36 @@ func TestOrganization_GetDefaultRepoSettings(tt *testing.T) { o.GetDefaultRepoSettings() } +func TestOrganization_GetDependabotAlertsEnabledForNewRepos(tt *testing.T) { + var zeroValue bool + o := &Organization{DependabotAlertsEnabledForNewRepos: &zeroValue} + o.GetDependabotAlertsEnabledForNewRepos() + o = &Organization{} + o.GetDependabotAlertsEnabledForNewRepos() + o = nil + o.GetDependabotAlertsEnabledForNewRepos() +} + +func TestOrganization_GetDependabotSecurityUpdatesEnabledForNewRepos(tt *testing.T) { + var zeroValue bool + o := &Organization{DependabotSecurityUpdatesEnabledForNewRepos: &zeroValue} + o.GetDependabotSecurityUpdatesEnabledForNewRepos() + o = &Organization{} + o.GetDependabotSecurityUpdatesEnabledForNewRepos() + o = nil + o.GetDependabotSecurityUpdatesEnabledForNewRepos() +} + +func TestOrganization_GetDependencyGraphEnabledForNewRepos(tt *testing.T) { + var zeroValue bool + o := &Organization{DependencyGraphEnabledForNewRepos: &zeroValue} + o.GetDependencyGraphEnabledForNewRepos() + o = &Organization{} + o.GetDependencyGraphEnabledForNewRepos() + o = nil + o.GetDependencyGraphEnabledForNewRepos() +} + func TestOrganization_GetDescription(tt *testing.T) { var zeroValue string o := &Organization{Description: &zeroValue} @@ -11458,6 +11498,26 @@ func TestOrganization_GetReposURL(tt *testing.T) { o.GetReposURL() } +func TestOrganization_GetSecretScanningEnabledForNewRepos(tt *testing.T) { + var zeroValue bool + o := &Organization{SecretScanningEnabledForNewRepos: &zeroValue} + o.GetSecretScanningEnabledForNewRepos() + o = &Organization{} + o.GetSecretScanningEnabledForNewRepos() + o = nil + o.GetSecretScanningEnabledForNewRepos() +} + +func TestOrganization_GetSecretScanningPushProtectionEnabledForNewRepos(tt *testing.T) { + var zeroValue bool + o := &Organization{SecretScanningPushProtectionEnabledForNewRepos: &zeroValue} + o.GetSecretScanningPushProtectionEnabledForNewRepos() + o = &Organization{} + o.GetSecretScanningPushProtectionEnabledForNewRepos() + o = nil + o.GetSecretScanningPushProtectionEnabledForNewRepos() +} + func TestOrganization_GetTotalPrivateRepos(tt *testing.T) { var zeroValue int o := &Organization{TotalPrivateRepos: &zeroValue} @@ -11518,6 +11578,16 @@ func TestOrganization_GetURL(tt *testing.T) { o.GetURL() } +func TestOrganization_GetWebCommitSignoffRequired(tt *testing.T) { + var zeroValue bool + o := &Organization{WebCommitSignoffRequired: &zeroValue} + o.GetWebCommitSignoffRequired() + o = &Organization{} + o.GetWebCommitSignoffRequired() + o = nil + o.GetWebCommitSignoffRequired() +} + func TestOrganizationCustomRepoRoles_GetTotalCount(tt *testing.T) { var zeroValue int o := &OrganizationCustomRepoRoles{TotalCount: &zeroValue} diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index 572686884c0..a2cdc9be883 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -997,15 +997,22 @@ func TestOrganization_String(t *testing.T) { MembersCanCreatePages: Bool(false), MembersCanCreatePublicPages: Bool(false), MembersCanCreatePrivatePages: Bool(false), - URL: String(""), - EventsURL: String(""), - HooksURL: String(""), - IssuesURL: String(""), - MembersURL: String(""), - 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, MembersCanForkPrivateRepos:false, MembersAllowedRepositoryCreationType:"", MembersCanCreatePages:false, MembersCanCreatePublicPages:false, MembersCanCreatePrivatePages:false, URL:"", EventsURL:"", HooksURL:"", IssuesURL:"", MembersURL:"", PublicMembersURL:"", ReposURL:""}` + WebCommitSignoffRequired: Bool(false), + AdvancedSecurityEnabledForNewRepos: Bool(false), + DependabotAlertsEnabledForNewRepos: Bool(false), + DependabotSecurityUpdatesEnabledForNewRepos: Bool(false), + DependencyGraphEnabledForNewRepos: Bool(false), + SecretScanningEnabledForNewRepos: Bool(false), + SecretScanningPushProtectionEnabledForNewRepos: Bool(false), + URL: String(""), + EventsURL: String(""), + HooksURL: String(""), + IssuesURL: String(""), + MembersURL: String(""), + 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, MembersCanForkPrivateRepos:false, MembersAllowedRepositoryCreationType:"", MembersCanCreatePages:false, MembersCanCreatePublicPages:false, MembersCanCreatePrivatePages:false, WebCommitSignoffRequired:false, AdvancedSecurityEnabledForNewRepos:false, DependabotAlertsEnabledForNewRepos:false, DependabotSecurityUpdatesEnabledForNewRepos:false, DependencyGraphEnabledForNewRepos:false, SecretScanningEnabledForNewRepos:false, SecretScanningPushProtectionEnabledForNewRepos:false, URL:"", EventsURL:"", HooksURL:"", IssuesURL:"", MembersURL:"", PublicMembersURL:"", ReposURL:""}` if got := v.String(); got != want { t.Errorf("Organization.String = %v, want %v", got, want) } diff --git a/github/orgs.go b/github/orgs.go index 26b55c62d03..8105afad38f 100644 --- a/github/orgs.go +++ b/github/orgs.go @@ -82,6 +82,20 @@ type Organization struct { MembersCanCreatePublicPages *bool `json:"members_can_create_public_pages,omitempty"` // MembersCanCreatePrivatePages toggles whether organization members can create private GitHub Pages sites. MembersCanCreatePrivatePages *bool `json:"members_can_create_private_pages,omitempty"` + // WebCommitSignoffRequire toggles + WebCommitSignoffRequired *bool `json:"web_commit_signoff_required,omitempty"` + // AdvancedSecurityAuditLogEnabled toggles whether the advanced security audit log is enabled. + AdvancedSecurityEnabledForNewRepos *bool `json:"advanced_security_enabled_for_new_repositories,omitempty"` + // DependabotAlertsEnabled toggles whether dependabot alerts are enabled. + DependabotAlertsEnabledForNewRepos *bool `json:"dependabot_alerts_enabled_for_new_repositories,omitempty"` + // DependabotSecurityUpdatesEnabled toggles whether dependabot security updates are enabled. + DependabotSecurityUpdatesEnabledForNewRepos *bool `json:"dependabot_security_updates_enabled_for_new_repositories,omitempty"` + // DependabotGraphEnabledForNewRepos toggles whether dependabot graph is enabled on new repositories. + DependencyGraphEnabledForNewRepos *bool `json:"dependency_graph_enabled_for_new_repositories,omitempty"` + // SecretScanningEnabled toggles whether secret scanning is enabled on new repositories. + SecretScanningEnabledForNewRepos *bool `json:"secret_scanning_enabled_for_new_repositories,omitempty"` + // SecretScanningPushProtectionEnabledForNewRepos toggles whether secret scanning push protection is enabled on new repositories. + SecretScanningPushProtectionEnabledForNewRepos *bool `json:"secret_scanning_push_protection_enabled_for_new_repositories,omitempty"` // API URLs URL *string `json:"url,omitempty"` From 23a2636cfa918c26a5ce2e7656ebeb982334a850 Mon Sep 17 00:00:00 2001 From: Luis Davim Date: Mon, 19 Sep 2022 11:38:15 +0100 Subject: [PATCH 059/751] Always send 'checks' field when creating branch protection (#2468) Fixes: #2467 --- github/repos.go | 2 +- github/repos_test.go | 124 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 125 insertions(+), 1 deletion(-) diff --git a/github/repos.go b/github/repos.go index 499ed677866..45fd1888d59 100644 --- a/github/repos.go +++ b/github/repos.go @@ -905,7 +905,7 @@ type RequiredStatusChecks struct { Contexts []string `json:"contexts,omitempty"` // The list of status checks to require in order to merge into this // branch. - Checks []*RequiredStatusCheck `json:"checks,omitempty"` + Checks []*RequiredStatusCheck `json:"checks"` } // RequiredStatusChecksRequest represents a request to edit a protected branch's status checks. diff --git a/github/repos_test.go b/github/repos_test.go index 6b8cbbd22ba..95920155a33 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -1543,6 +1543,130 @@ func TestRepositoriesService_UpdateBranchProtection_Checks(t *testing.T) { } } +func TestRepositoriesService_UpdateBranchProtection_StrictNoChecks(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + input := &ProtectionRequest{ + RequiredStatusChecks: &RequiredStatusChecks{ + Strict: true, + Checks: []*RequiredStatusCheck{}, + }, + RequiredPullRequestReviews: &PullRequestReviewsEnforcementRequest{ + DismissStaleReviews: true, + DismissalRestrictionsRequest: &DismissalRestrictionsRequest{ + Users: &[]string{"uu"}, + Teams: &[]string{"tt"}, + }, + BypassPullRequestAllowancesRequest: &BypassPullRequestAllowancesRequest{ + Users: []string{"uuu"}, + Teams: []string{"ttt"}, + Apps: []string{"aaa"}, + }, + }, + Restrictions: &BranchRestrictionsRequest{ + Users: []string{"u"}, + Teams: []string{"t"}, + Apps: []string{"a"}, + }, + } + + mux.HandleFunc("/repos/o/r/branches/b/protection", func(w http.ResponseWriter, r *http.Request) { + v := new(ProtectionRequest) + json.NewDecoder(r.Body).Decode(v) + + testMethod(t, r, "PUT") + if !cmp.Equal(v, input) { + t.Errorf("Request body = %+v, want %+v", v, input) + } + + // TODO: remove custom Accept header when this API fully launches + testHeader(t, r, "Accept", mediaTypeRequiredApprovingReviewsPreview) + fmt.Fprintf(w, `{ + "required_status_checks":{ + "strict":true, + "contexts":[], + "checks": [] + }, + "required_pull_request_reviews":{ + "dismissal_restrictions":{ + "users":[{ + "id":3, + "login":"uu" + }], + "teams":[{ + "id":4, + "slug":"tt" + }] + }, + "dismiss_stale_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"}], + "teams":[{"id":2,"slug":"t"}], + "apps":[{"id":3,"slug":"a"}] + } + }`) + }) + + ctx := context.Background() + protection, _, err := client.Repositories.UpdateBranchProtection(ctx, "o", "r", "b", input) + if err != nil { + t.Errorf("Repositories.UpdateBranchProtection returned error: %v", err) + } + + want := &Protection{ + RequiredStatusChecks: &RequiredStatusChecks{ + Strict: true, + Contexts: []string{}, + Checks: []*RequiredStatusCheck{}, + }, + RequiredPullRequestReviews: &PullRequestReviewsEnforcement{ + DismissStaleReviews: true, + DismissalRestrictions: &DismissalRestrictions{ + Users: []*User{ + {Login: String("uu"), ID: Int64(3)}, + }, + Teams: []*Team{ + {Slug: String("tt"), ID: Int64(4)}, + }, + }, + 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{ + {Login: String("u"), ID: Int64(1)}, + }, + Teams: []*Team{ + {Slug: String("t"), ID: Int64(2)}, + }, + Apps: []*App{ + {Slug: String("a"), ID: Int64(3)}, + }, + }, + } + if !cmp.Equal(protection, want) { + t.Errorf("Repositories.UpdateBranchProtection returned %+v, want %+v", protection, want) + } +} + func TestRepositoriesService_RemoveBranchProtection(t *testing.T) { client, mux, _, teardown := setup() defer teardown() From 9597e96e2d180649991e1c2bb809367fcb8c3f7c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Sep 2022 15:51:03 -0400 Subject: [PATCH 060/751] Bump github.com/google/go-github/v47 from 47.0.0 to 47.1.0 in /scrape (#2473) --- scrape/go.mod | 2 +- scrape/go.sum | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 4bd2130453e..aceca979ff7 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.9 - github.com/google/go-github/v47 v47.0.0 + github.com/google/go-github/v47 v47.1.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 ba862349b57..cf979d2ffcc 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -5,11 +5,10 @@ github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEq github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v47 v47.0.0 h1:eQap5bIRZibukP0VhngWgpuM0zhY4xntqOzn6DhdkE4= -github.com/google/go-github/v47 v47.0.0/go.mod h1:DRjdvizXE876j0YOZwInB1ESpOcU/xFBClNiQLSdorE= +github.com/google/go-github/v47 v47.1.0 h1:Cacm/WxQBOa9lF0FT0EMjZ2BWMetQ1TQfyurn4yF1z8= +github.com/google/go-github/v47 v47.1.0/go.mod h1:VPZBXNbFSJGjyjFRUKo9vZGawTajnWzC/YjGw/oFKi0= 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= From 182338c7045a79434039ac77f1a104cb7d0d433b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Sep 2022 15:58:28 -0400 Subject: [PATCH 061/751] Bump codecov/codecov-action from 3.1.0 to 3.1.1 (#2472) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b62f175b7c7..c528b9500d9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -78,7 +78,7 @@ jobs: - name: Upload coverage to Codecov if: ${{ matrix.update-coverage }} - uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 #v3.1.0 + uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 #v3.1.1 - name: Ensure go generate produces a zero diff for update-urls shell: bash From 8a4bdb5e400fef2e8d783d35d8f4cfd1bc79c01e Mon Sep 17 00:00:00 2001 From: Brett Kuhlman Date: Thu, 22 Sep 2022 14:38:08 -0400 Subject: [PATCH 062/751] Add SecretScanningPushProtection field to SecurityAndAnalysis struct (#2476) Fixes: #2475. --- github/github-accessors.go | 16 ++++++++++++++++ github/github-accessors_test.go | 17 +++++++++++++++++ github/github-stringify_test.go | 7 ++++--- github/repos.go | 12 ++++++++++-- github/repos_test.go | 4 ++-- 5 files changed, 49 insertions(+), 7 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 398ed7a3b41..7b670cb9b12 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -16894,6 +16894,14 @@ func (s *SecretScanningAlertUpdateOptions) GetState() string { return *s.State } +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (s *SecretScanningPushProtection) GetStatus() string { + if s == nil || s.Status == nil { + return "" + } + return *s.Status +} + // GetDescription returns the Description field if it's non-nil, zero value otherwise. func (s *SecurityAdvisory) GetDescription() string { if s == nil || s.Description == nil { @@ -16982,6 +16990,14 @@ func (s *SecurityAndAnalysis) GetSecretScanning() *SecretScanning { return s.SecretScanning } +// GetSecretScanningPushProtection returns the SecretScanningPushProtection field. +func (s *SecurityAndAnalysis) GetSecretScanningPushProtection() *SecretScanningPushProtection { + if s == nil { + return nil + } + return s.SecretScanningPushProtection +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (s *SelectedReposList) GetTotalCount() int { if s == nil || s.TotalCount == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index e3d565b8ccd..e51ccba767b 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -19717,6 +19717,16 @@ func TestSecretScanningAlertUpdateOptions_GetState(tt *testing.T) { s.GetState() } +func TestSecretScanningPushProtection_GetStatus(tt *testing.T) { + var zeroValue string + s := &SecretScanningPushProtection{Status: &zeroValue} + s.GetStatus() + s = &SecretScanningPushProtection{} + s.GetStatus() + s = nil + s.GetStatus() +} + func TestSecurityAdvisory_GetDescription(tt *testing.T) { var zeroValue string s := &SecurityAdvisory{Description: &zeroValue} @@ -19818,6 +19828,13 @@ func TestSecurityAndAnalysis_GetSecretScanning(tt *testing.T) { s.GetSecretScanning() } +func TestSecurityAndAnalysis_GetSecretScanningPushProtection(tt *testing.T) { + s := &SecurityAndAnalysis{} + s.GetSecretScanningPushProtection() + s = nil + s.GetSecretScanningPushProtection() +} + func TestSelectedReposList_GetTotalCount(tt *testing.T) { var zeroValue int s := &SelectedReposList{TotalCount: &zeroValue} diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index a2cdc9be883..09a6888e1f3 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -1726,10 +1726,11 @@ func TestSecretScanning_String(t *testing.T) { func TestSecurityAndAnalysis_String(t *testing.T) { v := SecurityAndAnalysis{ - AdvancedSecurity: &AdvancedSecurity{}, - SecretScanning: &SecretScanning{}, + AdvancedSecurity: &AdvancedSecurity{}, + SecretScanning: &SecretScanning{}, + SecretScanningPushProtection: &SecretScanningPushProtection{}, } - want := `github.SecurityAndAnalysis{AdvancedSecurity:github.AdvancedSecurity{}, SecretScanning:github.SecretScanning{}}` + want := `github.SecurityAndAnalysis{AdvancedSecurity:github.AdvancedSecurity{}, SecretScanning:github.SecretScanning{}, SecretScanningPushProtection:github.SecretScanningPushProtection{}}` if got := v.String(); got != want { t.Errorf("SecurityAndAnalysis.String = %v, want %v", got, want) } diff --git a/github/repos.go b/github/repos.go index 45fd1888d59..309e4430506 100644 --- a/github/repos.go +++ b/github/repos.go @@ -205,8 +205,9 @@ type RepositoryListOptions struct { // SecurityAndAnalysis specifies the optional advanced security features // that are enabled on a given repository. type SecurityAndAnalysis struct { - AdvancedSecurity *AdvancedSecurity `json:"advanced_security,omitempty"` - SecretScanning *SecretScanning `json:"secret_scanning,omitempty"` + AdvancedSecurity *AdvancedSecurity `json:"advanced_security,omitempty"` + SecretScanning *SecretScanning `json:"secret_scanning,omitempty"` + SecretScanningPushProtection *SecretScanningPushProtection `json:"secret_scanning_push_protection,omitempty"` } func (s SecurityAndAnalysis) String() string { @@ -235,6 +236,13 @@ func (s SecretScanning) String() string { return Stringify(s) } +// SecretScanningPushProtection specifies the state of secret scanning push protection on a repository. +// +// GitHub API docs: https://docs.github.com/en/code-security/secret-scanning/about-secret-scanning#about-secret-scanning-for-partner-patterns +type SecretScanningPushProtection struct { + Status *string `json:"status,omitempty"` +} + // List the repositories for a user. Passing the empty string will list // repositories for the authenticated user. // diff --git a/github/repos_test.go b/github/repos_test.go index 95920155a33..f7ee58b2313 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -360,7 +360,7 @@ func TestRepositoriesService_Get(t *testing.T) { mux.HandleFunc("/repos/o/r", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) - fmt.Fprint(w, `{"id":1,"name":"n","description":"d","owner":{"login":"l"},"license":{"key":"mit"},"security_and_analysis":{"advanced_security":{"status":"enabled"},"secret_scanning":{"status":"enabled"}}}`) + fmt.Fprint(w, `{"id":1,"name":"n","description":"d","owner":{"login":"l"},"license":{"key":"mit"},"security_and_analysis":{"advanced_security":{"status":"enabled"},"secret_scanning":{"status":"enabled"},"secret_scanning_push_protection":{"status":"enabled"}}}`) }) ctx := context.Background() @@ -369,7 +369,7 @@ func TestRepositoriesService_Get(t *testing.T) { t.Errorf("Repositories.Get returned error: %v", err) } - want := &Repository{ID: Int64(1), Name: String("n"), Description: String("d"), Owner: &User{Login: String("l")}, License: &License{Key: String("mit")}, SecurityAndAnalysis: &SecurityAndAnalysis{AdvancedSecurity: &AdvancedSecurity{Status: String("enabled")}, SecretScanning: &SecretScanning{String("enabled")}}} + want := &Repository{ID: Int64(1), Name: String("n"), Description: String("d"), Owner: &User{Login: String("l")}, License: &License{Key: String("mit")}, SecurityAndAnalysis: &SecurityAndAnalysis{AdvancedSecurity: &AdvancedSecurity{Status: String("enabled")}, SecretScanning: &SecretScanning{String("enabled")}, SecretScanningPushProtection: &SecretScanningPushProtection{String("enabled")}}} if !cmp.Equal(got, want) { t.Errorf("Repositories.Get returned %+v, want %+v", got, want) } From 0c3cd12a1e6d42b3f14385771a4dca28a2fe6a5f Mon Sep 17 00:00:00 2001 From: tenyo Date: Tue, 27 Sep 2022 16:27:16 -0400 Subject: [PATCH 063/751] Return proper responses for SCIM-provisioned identities (#2474) --- github/github-accessors.go | 72 ++++++++++++++ github/github-accessors_test.go | 87 +++++++++++++++++ github/scim.go | 56 +++++++++-- github/scim_test.go | 161 ++++++++++++++++++++++++++++++-- 4 files changed, 363 insertions(+), 13 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 7b670cb9b12..0c87a56eeb1 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -16582,6 +16582,62 @@ func (s *ScanningAnalysis) GetWarning() string { return *s.Warning } +// GetCreated returns the Created field if it's non-nil, zero value otherwise. +func (s *SCIMMeta) GetCreated() Timestamp { + if s == nil || s.Created == nil { + return Timestamp{} + } + return *s.Created +} + +// GetLastModified returns the LastModified field if it's non-nil, zero value otherwise. +func (s *SCIMMeta) GetLastModified() Timestamp { + if s == nil || s.LastModified == nil { + return Timestamp{} + } + return *s.LastModified +} + +// GetLocation returns the Location field if it's non-nil, zero value otherwise. +func (s *SCIMMeta) GetLocation() string { + if s == nil || s.Location == nil { + return "" + } + return *s.Location +} + +// GetResourceType returns the ResourceType field if it's non-nil, zero value otherwise. +func (s *SCIMMeta) GetResourceType() string { + if s == nil || s.ResourceType == nil { + return "" + } + return *s.ResourceType +} + +// GetItemsPerPage returns the ItemsPerPage field if it's non-nil, zero value otherwise. +func (s *SCIMProvisionedIdentities) GetItemsPerPage() int { + if s == nil || s.ItemsPerPage == nil { + return 0 + } + return *s.ItemsPerPage +} + +// GetStartIndex returns the StartIndex field if it's non-nil, zero value otherwise. +func (s *SCIMProvisionedIdentities) GetStartIndex() int { + if s == nil || s.StartIndex == nil { + return 0 + } + return *s.StartIndex +} + +// GetTotalResults returns the TotalResults field if it's non-nil, zero value otherwise. +func (s *SCIMProvisionedIdentities) GetTotalResults() int { + if s == nil || s.TotalResults == nil { + return 0 + } + return *s.TotalResults +} + // GetActive returns the Active field if it's non-nil, zero value otherwise. func (s *SCIMUserAttributes) GetActive() bool { if s == nil || s.Active == nil { @@ -16606,6 +16662,22 @@ func (s *SCIMUserAttributes) GetExternalID() string { return *s.ExternalID } +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (s *SCIMUserAttributes) GetID() string { + if s == nil || s.ID == nil { + return "" + } + return *s.ID +} + +// GetMeta returns the Meta field. +func (s *SCIMUserAttributes) GetMeta() *SCIMMeta { + if s == nil { + return nil + } + return s.Meta +} + // GetPrimary returns the Primary field if it's non-nil, zero value otherwise. func (s *SCIMUserEmail) GetPrimary() bool { if s == nil || s.Primary == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index e51ccba767b..086db726750 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -19351,6 +19351,76 @@ func TestScanningAnalysis_GetWarning(tt *testing.T) { s.GetWarning() } +func TestSCIMMeta_GetCreated(tt *testing.T) { + var zeroValue Timestamp + s := &SCIMMeta{Created: &zeroValue} + s.GetCreated() + s = &SCIMMeta{} + s.GetCreated() + s = nil + s.GetCreated() +} + +func TestSCIMMeta_GetLastModified(tt *testing.T) { + var zeroValue Timestamp + s := &SCIMMeta{LastModified: &zeroValue} + s.GetLastModified() + s = &SCIMMeta{} + s.GetLastModified() + s = nil + s.GetLastModified() +} + +func TestSCIMMeta_GetLocation(tt *testing.T) { + var zeroValue string + s := &SCIMMeta{Location: &zeroValue} + s.GetLocation() + s = &SCIMMeta{} + s.GetLocation() + s = nil + s.GetLocation() +} + +func TestSCIMMeta_GetResourceType(tt *testing.T) { + var zeroValue string + s := &SCIMMeta{ResourceType: &zeroValue} + s.GetResourceType() + s = &SCIMMeta{} + s.GetResourceType() + s = nil + s.GetResourceType() +} + +func TestSCIMProvisionedIdentities_GetItemsPerPage(tt *testing.T) { + var zeroValue int + s := &SCIMProvisionedIdentities{ItemsPerPage: &zeroValue} + s.GetItemsPerPage() + s = &SCIMProvisionedIdentities{} + s.GetItemsPerPage() + s = nil + s.GetItemsPerPage() +} + +func TestSCIMProvisionedIdentities_GetStartIndex(tt *testing.T) { + var zeroValue int + s := &SCIMProvisionedIdentities{StartIndex: &zeroValue} + s.GetStartIndex() + s = &SCIMProvisionedIdentities{} + s.GetStartIndex() + s = nil + s.GetStartIndex() +} + +func TestSCIMProvisionedIdentities_GetTotalResults(tt *testing.T) { + var zeroValue int + s := &SCIMProvisionedIdentities{TotalResults: &zeroValue} + s.GetTotalResults() + s = &SCIMProvisionedIdentities{} + s.GetTotalResults() + s = nil + s.GetTotalResults() +} + func TestSCIMUserAttributes_GetActive(tt *testing.T) { var zeroValue bool s := &SCIMUserAttributes{Active: &zeroValue} @@ -19381,6 +19451,23 @@ func TestSCIMUserAttributes_GetExternalID(tt *testing.T) { s.GetExternalID() } +func TestSCIMUserAttributes_GetID(tt *testing.T) { + var zeroValue string + s := &SCIMUserAttributes{ID: &zeroValue} + s.GetID() + s = &SCIMUserAttributes{} + s.GetID() + s = nil + s.GetID() +} + +func TestSCIMUserAttributes_GetMeta(tt *testing.T) { + s := &SCIMUserAttributes{} + s.GetMeta() + s = nil + s.GetMeta() +} + func TestSCIMUserEmail_GetPrimary(tt *testing.T) { var zeroValue bool s := &SCIMUserEmail{Primary: &zeroValue} diff --git a/github/scim.go b/github/scim.go index 9462fb6ba65..70f81ed14e6 100644 --- a/github/scim.go +++ b/github/scim.go @@ -29,6 +29,9 @@ type SCIMUserAttributes struct { ExternalID *string `json:"externalId,omitempty"` // (Optional.) Groups []string `json:"groups,omitempty"` // (Optional.) Active *bool `json:"active,omitempty"` // (Optional.) + // Only populated as a result of calling ListSCIMProvisionedIdentitiesOptions or GetSCIMProvisioningInfoForUser: + ID *string `json:"id,omitempty"` + Meta *SCIMMeta `json:"meta,omitempty"` } // SCIMUserName represents SCIM user information. @@ -45,6 +48,23 @@ type SCIMUserEmail struct { Type *string `json:"type,omitempty"` // (Optional.) } +// SCIMMeta represents metadata about the SCIM resource. +type SCIMMeta struct { + ResourceType *string `json:"resourceType,omitempty"` + Created *Timestamp `json:"created,omitempty"` + LastModified *Timestamp `json:"lastModified,omitempty"` + Location *string `json:"location,omitempty"` +} + +// SCIMProvisionedIdentities represents the result of calling ListSCIMProvisionedIdentities. +type SCIMProvisionedIdentities struct { + Schemas []string `json:"schemas,omitempty"` + TotalResults *int `json:"totalResults,omitempty"` + ItemsPerPage *int `json:"itemsPerPage,omitempty"` + StartIndex *int `json:"startIndex,omitempty"` + Resources []*SCIMUserAttributes `json:"Resources,omitempty"` +} + // ListSCIMProvisionedIdentitiesOptions represents options for ListSCIMProvisionedIdentities. // // Github API docs: https://docs.github.com/en/rest/scim#list-scim-provisioned-identities--parameters @@ -62,17 +82,25 @@ type ListSCIMProvisionedIdentitiesOptions struct { // ListSCIMProvisionedIdentities lists SCIM provisioned identities. // // GitHub API docs: https://docs.github.com/en/rest/scim#list-scim-provisioned-identities -func (s *SCIMService) ListSCIMProvisionedIdentities(ctx context.Context, org string, opts *ListSCIMProvisionedIdentitiesOptions) (*Response, error) { +func (s *SCIMService) ListSCIMProvisionedIdentities(ctx context.Context, org string, opts *ListSCIMProvisionedIdentitiesOptions) (*SCIMProvisionedIdentities, *Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users", org) u, err := addOptions(u, opts) if err != nil { - return nil, err + return nil, nil, err } + req, err := s.client.NewRequest("GET", u, nil) if err != nil { - return nil, err + return nil, nil, err } - return s.client.Do(ctx, req, nil) + + identities := new(SCIMProvisionedIdentities) + resp, err := s.client.Do(ctx, req, identities) + if err != nil { + return nil, resp, err + } + + return identities, resp, nil } // ProvisionAndInviteSCIMUser provisions organization membership for a user, and sends an activation email to the email address. @@ -84,23 +112,32 @@ func (s *SCIMService) ProvisionAndInviteSCIMUser(ctx context.Context, org string if err != nil { return nil, err } + req, err := s.client.NewRequest("POST", u, nil) if err != nil { return nil, err } + return s.client.Do(ctx, req, nil) } // GetSCIMProvisioningInfoForUser returns SCIM provisioning information for a user. // // GitHub API docs: https://docs.github.com/en/rest/scim#supported-scim-user-attributes -func (s *SCIMService) GetSCIMProvisioningInfoForUser(ctx context.Context, org, scimUserID string) (*Response, error) { +func (s *SCIMService) GetSCIMProvisioningInfoForUser(ctx context.Context, org, scimUserID string) (*SCIMUserAttributes, *Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users/%v", org, scimUserID) req, err := s.client.NewRequest("GET", u, nil) if err != nil { - return nil, err + return nil, nil, err } - return s.client.Do(ctx, req, nil) + + user := new(SCIMUserAttributes) + resp, err := s.client.Do(ctx, req, &user) + if err != nil { + return nil, resp, err + } + + return user, resp, nil } // UpdateProvisionedOrgMembership updates a provisioned organization membership. @@ -112,10 +149,12 @@ func (s *SCIMService) UpdateProvisionedOrgMembership(ctx context.Context, org, s if err != nil { return nil, err } + req, err := s.client.NewRequest("PUT", u, nil) if err != nil { return nil, err } + return s.client.Do(ctx, req, nil) } @@ -143,10 +182,12 @@ func (s *SCIMService) UpdateAttributeForSCIMUser(ctx context.Context, org, scimU if err != nil { return nil, err } + req, err := s.client.NewRequest("PATCH", u, nil) if err != nil { return nil, err } + return s.client.Do(ctx, req, nil) } @@ -159,5 +200,6 @@ func (s *SCIMService) DeleteSCIMUserFromOrg(ctx context.Context, org, scimUserID if err != nil { return nil, err } + return s.client.Do(ctx, req, nil) } diff --git a/github/scim_test.go b/github/scim_test.go index 328bc209742..7c6e14078b2 100644 --- a/github/scim_test.go +++ b/github/scim_test.go @@ -9,6 +9,9 @@ import ( "context" "net/http" "testing" + "time" + + "github.com/google/go-cmp/cmp" ) func TestSCIMService_ListSCIMProvisionedIdentities(t *testing.T) { @@ -18,23 +21,102 @@ func TestSCIMService_ListSCIMProvisionedIdentities(t *testing.T) { mux.HandleFunc("/scim/v2/organizations/o/Users", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") w.WriteHeader(http.StatusOK) + _, _ = w.Write([]byte(`{ + "schemas": [ + "urn:ietf:params:scim:api:messages:2.0:ListResponse" + ], + "totalResults": 1, + "itemsPerPage": 1, + "startIndex": 1, + "Resources": [ + { + "schemas": [ + "urn:ietf:params:scim:schemas:core:2.0:User" + ], + "id": "5fc0c238-1112-11e8-8e45-920c87bdbd75", + "externalId": "00u1dhhb1fkIGP7RL1d8", + "userName": "octocat@github.com", + "displayName": "Mona Octocat", + "name": { + "givenName": "Mona", + "familyName": "Octocat", + "formatted": "Mona Octocat" + }, + "emails": [ + { + "value": "octocat@github.com", + "primary": true + } + ], + "active": true, + "meta": { + "resourceType": "User", + "created": "2018-02-13T15:05:24.000-00:00", + "lastModified": "2018-02-13T15:05:24.000-00:00", + "location": "https://api.github.com/scim/v2/organizations/octo-org/Users/5fc0c238-1112-11e8-8e45-920c87bdbd75" + } + } + ] + }`)) }) ctx := context.Background() opts := &ListSCIMProvisionedIdentitiesOptions{} - _, err := client.SCIM.ListSCIMProvisionedIdentities(ctx, "o", opts) + identities, _, err := client.SCIM.ListSCIMProvisionedIdentities(ctx, "o", opts) if err != nil { t.Errorf("SCIM.ListSCIMProvisionedIdentities returned error: %v", err) } + date := Timestamp{time.Date(2018, time.February, 13, 15, 5, 24, 0, time.UTC)} + want := SCIMProvisionedIdentities{ + Schemas: []string{"urn:ietf:params:scim:api:messages:2.0:ListResponse"}, + TotalResults: Int(1), + ItemsPerPage: Int(1), + StartIndex: Int(1), + Resources: []*SCIMUserAttributes{ + { + ID: String("5fc0c238-1112-11e8-8e45-920c87bdbd75"), + Meta: &SCIMMeta{ + ResourceType: String("User"), + Created: &date, + LastModified: &date, + Location: String("https://api.github.com/scim/v2/organizations/octo-org/Users/5fc0c238-1112-11e8-8e45-920c87bdbd75"), + }, + UserName: "octocat@github.com", + Name: SCIMUserName{ + GivenName: "Mona", + FamilyName: "Octocat", + Formatted: String("Mona Octocat"), + }, + DisplayName: String("Mona Octocat"), + Emails: []*SCIMUserEmail{ + { + Value: "octocat@github.com", + Primary: Bool(true), + }, + }, + Schemas: []string{"urn:ietf:params:scim:schemas:core:2.0:User"}, + ExternalID: String("00u1dhhb1fkIGP7RL1d8"), + Groups: nil, + Active: Bool(true), + }, + }, + } + + if !cmp.Equal(identities, &want) { + diff := cmp.Diff(identities, want) + t.Errorf("SCIM.ListSCIMProvisionedIdentities returned %+v, want %+v: diff %+v", identities, want, diff) + } + const methodName = "ListSCIMProvisionedIdentities" testBadOptions(t, methodName, func() (err error) { - _, err = client.SCIM.ListSCIMProvisionedIdentities(ctx, "\n", opts) + _, _, err = client.SCIM.ListSCIMProvisionedIdentities(ctx, "\n", opts) return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.SCIM.ListSCIMProvisionedIdentities(ctx, "o", opts) + _, r, err := client.SCIM.ListSCIMProvisionedIdentities(ctx, "o", opts) + return r, err }) } @@ -83,22 +165,89 @@ func TestSCIMService_GetSCIMProvisioningInfoForUser(t *testing.T) { mux.HandleFunc("/scim/v2/organizations/o/Users/123", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") w.WriteHeader(http.StatusOK) + _, _ = w.Write([]byte(`{ + "schemas": [ + "urn:ietf:params:scim:schemas:core:2.0:User" + ], + "id": "edefdfedf-050c-11e7-8d32", + "externalId": "a7d0f98382", + "userName": "mona.octocat@okta.example.com", + "displayName": "Mona Octocat", + "name": { + "givenName": "Mona", + "familyName": "Octocat", + "formatted": "Mona Octocat" + }, + "emails": [ + { + "value": "mona.octocat@okta.example.com", + "primary": true + }, + { + "value": "mona@octocat.github.com" + } + ], + "active": true, + "meta": { + "resourceType": "User", + "created": "2017-03-09T16:11:13-00:00", + "lastModified": "2017-03-09T16:11:13-00:00", + "location": "https://api.github.com/scim/v2/organizations/octo-org/Users/edefdfedf-050c-11e7-8d32" + } + }`)) }) ctx := context.Background() - _, err := client.SCIM.GetSCIMProvisioningInfoForUser(ctx, "o", "123") + user, _, err := client.SCIM.GetSCIMProvisioningInfoForUser(ctx, "o", "123") if err != nil { t.Errorf("SCIM.GetSCIMProvisioningInfoForUser returned error: %v", err) } + date := Timestamp{time.Date(2017, time.March, 9, 16, 11, 13, 0, time.UTC)} + want := SCIMUserAttributes{ + ID: String("edefdfedf-050c-11e7-8d32"), + Meta: &SCIMMeta{ + ResourceType: String("User"), + Created: &date, + LastModified: &date, + Location: String("https://api.github.com/scim/v2/organizations/octo-org/Users/edefdfedf-050c-11e7-8d32"), + }, + UserName: "mona.octocat@okta.example.com", + Name: SCIMUserName{ + GivenName: "Mona", + FamilyName: "Octocat", + Formatted: String("Mona Octocat"), + }, + DisplayName: String("Mona Octocat"), + Emails: []*SCIMUserEmail{ + { + Value: "mona.octocat@okta.example.com", + Primary: Bool(true), + }, + { + Value: "mona@octocat.github.com", + }, + }, + Schemas: []string{"urn:ietf:params:scim:schemas:core:2.0:User"}, + ExternalID: String("a7d0f98382"), + Groups: nil, + Active: Bool(true), + } + + if !cmp.Equal(user, &want) { + diff := cmp.Diff(user, want) + t.Errorf("SCIM.ListSCIMProvisionedIdentities returned %+v, want %+v: diff %+v", user, want, diff) + } + const methodName = "GetSCIMProvisioningInfoForUser" testBadOptions(t, methodName, func() error { - _, err := client.SCIM.GetSCIMProvisioningInfoForUser(ctx, "\n", "123") + _, _, err := client.SCIM.GetSCIMProvisioningInfoForUser(ctx, "\n", "123") return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.SCIM.GetSCIMProvisioningInfoForUser(ctx, "o", "123") + _, r, err := client.SCIM.GetSCIMProvisioningInfoForUser(ctx, "o", "123") + return r, err }) } From 08819b7a10547663d219c00d6dcefce516d4f661 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Oct 2022 15:21:23 -0400 Subject: [PATCH 064/751] Bump styfle/cancel-workflow-action from 0.10.0 to 0.10.1 (#2484) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c528b9500d9..f392c707082 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@bb6001c4ea612bf59c3abfc4756fbceee4f870c7 #0.10.0 + uses: styfle/cancel-workflow-action@9f10b1b9fa56e99e4c5d12c2a085c8a0c37ab0ac #0.10.1 with: access_token: ${{ github.token }} From 330d92d1f4ef9e2771eebc3b125bffb79887f801 Mon Sep 17 00:00:00 2001 From: Eric Olson <11235171+eolso@users.noreply.github.com> Date: Tue, 4 Oct 2022 15:49:42 -0700 Subject: [PATCH 065/751] Update ProtectionChanges to contain the remaining possible return values (#2486) Fixes: #2485 . --- github/github-accessors.go | 200 ++++++++++++++++++++++++++++++ github/github-accessors_test.go | 211 ++++++++++++++++++++++++++++++++ github/repos.go | 84 ++++++++++++- 3 files changed, 492 insertions(+), 3 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 0c87a56eeb1..c03df750fc7 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -86,6 +86,14 @@ func (a *ActionsPermissionsRepository) GetSelectedActionsURL() string { return *a.SelectedActionsURL } +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (a *AdminEnforcedChanges) GetFrom() bool { + if a == nil || a.From == nil { + return false + } + return *a.From +} + // GetURL returns the URL field if it's non-nil, zero value otherwise. func (a *AdminEnforcement) GetURL() string { if a == nil || a.URL == nil { @@ -414,6 +422,14 @@ func (a *Alert) GetURL() string { return *a.URL } +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (a *AllowDeletionsEnforcementLevelChanges) GetFrom() string { + if a == nil || a.From == nil { + return "" + } + return *a.From +} + // GetRef returns the Ref field if it's non-nil, zero value otherwise. func (a *AnalysesListOptions) GetRef() string { if a == nil || a.Ref == nil { @@ -1366,6 +1382,14 @@ func (a *AuthorizedActorsOnly) GetFrom() bool { return *a.From } +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (a *AuthorizedDismissalActorsOnlyChanges) GetFrom() bool { + if a == nil || a.From == nil { + return false + } + return *a.From +} + // GetID returns the ID field if it's non-nil, zero value otherwise. func (a *Autolink) GetID() int64 { if a == nil || a.ID == nil { @@ -3542,6 +3566,14 @@ func (c *CreateOrgInvitationOptions) GetRole() string { return *c.Role } +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (c *CreateProtectedChanges) GetFrom() bool { + if c == nil || c.From == nil { + return false + } + return *c.From +} + // GetAllowsPublicRepositories returns the AllowsPublicRepositories field if it's non-nil, zero value otherwise. func (c *CreateRunnerGroupRequest) GetAllowsPublicRepositories() bool { if c == nil || c.AllowsPublicRepositories == nil { @@ -4534,6 +4566,14 @@ func (d *DismissedReview) GetState() string { return *d.State } +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (d *DismissStaleReviewsOnPushChanges) GetFrom() bool { + if d == nil || d.From == nil { + return false + } + return *d.From +} + // GetClientPayload returns the ClientPayload field if it's non-nil, zero value otherwise. func (d *DispatchRequestOptions) GetClientPayload() json.RawMessage { if d == nil || d.ClientPayload == nil { @@ -8174,6 +8214,14 @@ func (l *License) GetURL() string { return *l.URL } +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (l *LinearHistoryRequirementEnforcementLevelChanges) GetFrom() string { + if l == nil || l.From == nil { + return "" + } + return *l.From +} + // GetAppID returns the AppID field if it's non-nil, zero value otherwise. func (l *ListCheckRunsOptions) GetAppID() int64 { if l == nil || l.AppID == nil { @@ -11806,6 +11854,22 @@ func (p *Protection) GetRestrictions() *BranchRestrictions { return p.Restrictions } +// GetAdminEnforced returns the AdminEnforced field. +func (p *ProtectionChanges) GetAdminEnforced() *AdminEnforcedChanges { + if p == nil { + return nil + } + return p.AdminEnforced +} + +// GetAllowDeletionsEnforcementLevel returns the AllowDeletionsEnforcementLevel field. +func (p *ProtectionChanges) GetAllowDeletionsEnforcementLevel() *AllowDeletionsEnforcementLevelChanges { + if p == nil { + return nil + } + return p.AllowDeletionsEnforcementLevel +} + // GetAuthorizedActorNames returns the AuthorizedActorNames field. func (p *ProtectionChanges) GetAuthorizedActorNames() *AuthorizedActorNames { if p == nil { @@ -11822,6 +11886,94 @@ func (p *ProtectionChanges) GetAuthorizedActorsOnly() *AuthorizedActorsOnly { return p.AuthorizedActorsOnly } +// GetAuthorizedDismissalActorsOnly returns the AuthorizedDismissalActorsOnly field. +func (p *ProtectionChanges) GetAuthorizedDismissalActorsOnly() *AuthorizedDismissalActorsOnlyChanges { + if p == nil { + return nil + } + return p.AuthorizedDismissalActorsOnly +} + +// GetCreateProtected returns the CreateProtected field. +func (p *ProtectionChanges) GetCreateProtected() *CreateProtectedChanges { + if p == nil { + return nil + } + return p.CreateProtected +} + +// GetDismissStaleReviewsOnPush returns the DismissStaleReviewsOnPush field. +func (p *ProtectionChanges) GetDismissStaleReviewsOnPush() *DismissStaleReviewsOnPushChanges { + if p == nil { + return nil + } + return p.DismissStaleReviewsOnPush +} + +// GetLinearHistoryRequirementEnforcementLevel returns the LinearHistoryRequirementEnforcementLevel field. +func (p *ProtectionChanges) GetLinearHistoryRequirementEnforcementLevel() *LinearHistoryRequirementEnforcementLevelChanges { + if p == nil { + return nil + } + return p.LinearHistoryRequirementEnforcementLevel +} + +// GetPullRequestReviewsEnforcementLevel returns the PullRequestReviewsEnforcementLevel field. +func (p *ProtectionChanges) GetPullRequestReviewsEnforcementLevel() *PullRequestReviewsEnforcementLevelChanges { + if p == nil { + return nil + } + return p.PullRequestReviewsEnforcementLevel +} + +// GetRequireCodeOwnerReview returns the RequireCodeOwnerReview field. +func (p *ProtectionChanges) GetRequireCodeOwnerReview() *RequireCodeOwnerReviewChanges { + if p == nil { + return nil + } + return p.RequireCodeOwnerReview +} + +// GetRequiredConversationResolutionLevel returns the RequiredConversationResolutionLevel field. +func (p *ProtectionChanges) GetRequiredConversationResolutionLevel() *RequiredConversationResolutionLevelChanges { + if p == nil { + return nil + } + return p.RequiredConversationResolutionLevel +} + +// GetRequiredDeploymentsEnforcementLevel returns the RequiredDeploymentsEnforcementLevel field. +func (p *ProtectionChanges) GetRequiredDeploymentsEnforcementLevel() *RequiredDeploymentsEnforcementLevelChanges { + if p == nil { + return nil + } + return p.RequiredDeploymentsEnforcementLevel +} + +// GetRequiredStatusChecks returns the RequiredStatusChecks field. +func (p *ProtectionChanges) GetRequiredStatusChecks() *RequiredStatusChecksChanges { + if p == nil { + return nil + } + return p.RequiredStatusChecks +} + +// GetRequiredStatusChecksEnforcementLevel returns the RequiredStatusChecksEnforcementLevel field. +func (p *ProtectionChanges) GetRequiredStatusChecksEnforcementLevel() *RequiredStatusChecksEnforcementLevelChanges { + if p == nil { + return nil + } + return p.RequiredStatusChecksEnforcementLevel +} + +// GetSignatureRequirementEnforcementLevel returns the SignatureRequirementEnforcementLevel field. +func (p *ProtectionChanges) GetSignatureRequirementEnforcementLevel() *SignatureRequirementEnforcementLevelChanges { + if p == nil { + return nil + } + return p.SignatureRequirementEnforcementLevel +} + // GetAllowDeletions returns the AllowDeletions field if it's non-nil, zero value otherwise. func (p *ProtectionRequest) GetAllowDeletions() bool { if p == nil || p.AllowDeletions == nil { @@ -13014,6 +13166,14 @@ func (p *PullRequestReviewsEnforcement) GetDismissalRestrictions() *DismissalRes return p.DismissalRestrictions } +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (p *PullRequestReviewsEnforcementLevelChanges) GetFrom() string { + if p == nil || p.From == nil { + return "" + } + return *p.From +} + // GetBypassPullRequestAllowancesRequest returns the BypassPullRequestAllowancesRequest field. func (p *PullRequestReviewsEnforcementRequest) GetBypassPullRequestAllowancesRequest() *BypassPullRequestAllowancesRequest { if p == nil { @@ -16134,6 +16294,30 @@ func (r *RepoStatus) GetURL() string { return *r.URL } +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (r *RequireCodeOwnerReviewChanges) GetFrom() bool { + if r == nil || r.From == nil { + return false + } + return *r.From +} + +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (r *RequiredConversationResolutionLevelChanges) GetFrom() string { + if r == nil || r.From == nil { + return "" + } + return *r.From +} + +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (r *RequiredDeploymentsEnforcementLevelChanges) GetFrom() string { + if r == nil || r.From == nil { + return "" + } + return *r.From +} + // GetType returns the Type field if it's non-nil, zero value otherwise. func (r *RequiredReviewer) GetType() string { if r == nil || r.Type == nil { @@ -16150,6 +16334,14 @@ func (r *RequiredStatusCheck) GetAppID() int64 { return *r.AppID } +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (r *RequiredStatusChecksEnforcementLevelChanges) GetFrom() string { + if r == nil || r.From == nil { + return "" + } + return *r.From +} + // GetStrict returns the Strict field if it's non-nil, zero value otherwise. func (r *RequiredStatusChecksRequest) GetStrict() bool { if r == nil || r.Strict == nil { @@ -17086,6 +17278,14 @@ func (s *ServiceHook) GetName() string { return *s.Name } +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (s *SignatureRequirementEnforcementLevelChanges) GetFrom() string { + if s == nil || s.From == nil { + return "" + } + return *s.From +} + // GetEnabled returns the Enabled field if it's non-nil, zero value otherwise. func (s *SignaturesProtectedBranch) GetEnabled() bool { if s == nil || s.Enabled == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 086db726750..5cb6f0463b1 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -105,6 +105,16 @@ func TestActionsPermissionsRepository_GetSelectedActionsURL(tt *testing.T) { a.GetSelectedActionsURL() } +func TestAdminEnforcedChanges_GetFrom(tt *testing.T) { + var zeroValue bool + a := &AdminEnforcedChanges{From: &zeroValue} + a.GetFrom() + a = &AdminEnforcedChanges{} + a.GetFrom() + a = nil + a.GetFrom() +} + func TestAdminEnforcement_GetURL(tt *testing.T) { var zeroValue string a := &AdminEnforcement{URL: &zeroValue} @@ -461,6 +471,16 @@ func TestAlert_GetURL(tt *testing.T) { a.GetURL() } +func TestAllowDeletionsEnforcementLevelChanges_GetFrom(tt *testing.T) { + var zeroValue string + a := &AllowDeletionsEnforcementLevelChanges{From: &zeroValue} + a.GetFrom() + a = &AllowDeletionsEnforcementLevelChanges{} + a.GetFrom() + a = nil + a.GetFrom() +} + func TestAnalysesListOptions_GetRef(tt *testing.T) { var zeroValue string a := &AnalysesListOptions{Ref: &zeroValue} @@ -1630,6 +1650,16 @@ func TestAuthorizedActorsOnly_GetFrom(tt *testing.T) { a.GetFrom() } +func TestAuthorizedDismissalActorsOnlyChanges_GetFrom(tt *testing.T) { + var zeroValue bool + a := &AuthorizedDismissalActorsOnlyChanges{From: &zeroValue} + a.GetFrom() + a = &AuthorizedDismissalActorsOnlyChanges{} + a.GetFrom() + a = nil + a.GetFrom() +} + func TestAutolink_GetID(tt *testing.T) { var zeroValue int64 a := &Autolink{ID: &zeroValue} @@ -4143,6 +4173,16 @@ func TestCreateOrgInvitationOptions_GetRole(tt *testing.T) { c.GetRole() } +func TestCreateProtectedChanges_GetFrom(tt *testing.T) { + var zeroValue bool + c := &CreateProtectedChanges{From: &zeroValue} + c.GetFrom() + c = &CreateProtectedChanges{} + c.GetFrom() + c = nil + c.GetFrom() +} + func TestCreateRunnerGroupRequest_GetAllowsPublicRepositories(tt *testing.T) { var zeroValue bool c := &CreateRunnerGroupRequest{AllowsPublicRepositories: &zeroValue} @@ -5296,6 +5336,16 @@ func TestDismissedReview_GetState(tt *testing.T) { d.GetState() } +func TestDismissStaleReviewsOnPushChanges_GetFrom(tt *testing.T) { + var zeroValue bool + d := &DismissStaleReviewsOnPushChanges{From: &zeroValue} + d.GetFrom() + d = &DismissStaleReviewsOnPushChanges{} + d.GetFrom() + d = nil + d.GetFrom() +} + func TestDispatchRequestOptions_GetClientPayload(tt *testing.T) { var zeroValue json.RawMessage d := &DispatchRequestOptions{ClientPayload: &zeroValue} @@ -9576,6 +9626,16 @@ func TestLicense_GetURL(tt *testing.T) { l.GetURL() } +func TestLinearHistoryRequirementEnforcementLevelChanges_GetFrom(tt *testing.T) { + var zeroValue string + l := &LinearHistoryRequirementEnforcementLevelChanges{From: &zeroValue} + l.GetFrom() + l = &LinearHistoryRequirementEnforcementLevelChanges{} + l.GetFrom() + l = nil + l.GetFrom() +} + func TestListCheckRunsOptions_GetAppID(tt *testing.T) { var zeroValue int64 l := &ListCheckRunsOptions{AppID: &zeroValue} @@ -13771,6 +13831,20 @@ func TestProtection_GetRestrictions(tt *testing.T) { p.GetRestrictions() } +func TestProtectionChanges_GetAdminEnforced(tt *testing.T) { + p := &ProtectionChanges{} + p.GetAdminEnforced() + p = nil + p.GetAdminEnforced() +} + +func TestProtectionChanges_GetAllowDeletionsEnforcementLevel(tt *testing.T) { + p := &ProtectionChanges{} + p.GetAllowDeletionsEnforcementLevel() + p = nil + p.GetAllowDeletionsEnforcementLevel() +} + func TestProtectionChanges_GetAuthorizedActorNames(tt *testing.T) { p := &ProtectionChanges{} p.GetAuthorizedActorNames() @@ -13785,6 +13859,83 @@ func TestProtectionChanges_GetAuthorizedActorsOnly(tt *testing.T) { p.GetAuthorizedActorsOnly() } +func TestProtectionChanges_GetAuthorizedDismissalActorsOnly(tt *testing.T) { + p := &ProtectionChanges{} + p.GetAuthorizedDismissalActorsOnly() + p = nil + p.GetAuthorizedDismissalActorsOnly() +} + +func TestProtectionChanges_GetCreateProtected(tt *testing.T) { + p := &ProtectionChanges{} + p.GetCreateProtected() + p = nil + p.GetCreateProtected() +} + +func TestProtectionChanges_GetDismissStaleReviewsOnPush(tt *testing.T) { + p := &ProtectionChanges{} + p.GetDismissStaleReviewsOnPush() + p = nil + p.GetDismissStaleReviewsOnPush() +} + +func TestProtectionChanges_GetLinearHistoryRequirementEnforcementLevel(tt *testing.T) { + p := &ProtectionChanges{} + p.GetLinearHistoryRequirementEnforcementLevel() + p = nil + p.GetLinearHistoryRequirementEnforcementLevel() +} + +func TestProtectionChanges_GetPullRequestReviewsEnforcementLevel(tt *testing.T) { + p := &ProtectionChanges{} + p.GetPullRequestReviewsEnforcementLevel() + p = nil + p.GetPullRequestReviewsEnforcementLevel() +} + +func TestProtectionChanges_GetRequireCodeOwnerReview(tt *testing.T) { + p := &ProtectionChanges{} + p.GetRequireCodeOwnerReview() + p = nil + p.GetRequireCodeOwnerReview() +} + +func TestProtectionChanges_GetRequiredConversationResolutionLevel(tt *testing.T) { + p := &ProtectionChanges{} + p.GetRequiredConversationResolutionLevel() + p = nil + p.GetRequiredConversationResolutionLevel() +} + +func TestProtectionChanges_GetRequiredDeploymentsEnforcementLevel(tt *testing.T) { + p := &ProtectionChanges{} + p.GetRequiredDeploymentsEnforcementLevel() + p = nil + p.GetRequiredDeploymentsEnforcementLevel() +} + +func TestProtectionChanges_GetRequiredStatusChecks(tt *testing.T) { + p := &ProtectionChanges{} + p.GetRequiredStatusChecks() + p = nil + p.GetRequiredStatusChecks() +} + +func TestProtectionChanges_GetRequiredStatusChecksEnforcementLevel(tt *testing.T) { + p := &ProtectionChanges{} + p.GetRequiredStatusChecksEnforcementLevel() + p = nil + p.GetRequiredStatusChecksEnforcementLevel() +} + +func TestProtectionChanges_GetSignatureRequirementEnforcementLevel(tt *testing.T) { + p := &ProtectionChanges{} + p.GetSignatureRequirementEnforcementLevel() + p = nil + p.GetSignatureRequirementEnforcementLevel() +} + func TestProtectionRequest_GetAllowDeletions(tt *testing.T) { var zeroValue bool p := &ProtectionRequest{AllowDeletions: &zeroValue} @@ -15143,6 +15294,16 @@ func TestPullRequestReviewsEnforcement_GetDismissalRestrictions(tt *testing.T) { p.GetDismissalRestrictions() } +func TestPullRequestReviewsEnforcementLevelChanges_GetFrom(tt *testing.T) { + var zeroValue string + p := &PullRequestReviewsEnforcementLevelChanges{From: &zeroValue} + p.GetFrom() + p = &PullRequestReviewsEnforcementLevelChanges{} + p.GetFrom() + p = nil + p.GetFrom() +} + func TestPullRequestReviewsEnforcementRequest_GetBypassPullRequestAllowancesRequest(tt *testing.T) { p := &PullRequestReviewsEnforcementRequest{} p.GetBypassPullRequestAllowancesRequest() @@ -18794,6 +18955,36 @@ func TestRepoStatus_GetURL(tt *testing.T) { r.GetURL() } +func TestRequireCodeOwnerReviewChanges_GetFrom(tt *testing.T) { + var zeroValue bool + r := &RequireCodeOwnerReviewChanges{From: &zeroValue} + r.GetFrom() + r = &RequireCodeOwnerReviewChanges{} + r.GetFrom() + r = nil + r.GetFrom() +} + +func TestRequiredConversationResolutionLevelChanges_GetFrom(tt *testing.T) { + var zeroValue string + r := &RequiredConversationResolutionLevelChanges{From: &zeroValue} + r.GetFrom() + r = &RequiredConversationResolutionLevelChanges{} + r.GetFrom() + r = nil + r.GetFrom() +} + +func TestRequiredDeploymentsEnforcementLevelChanges_GetFrom(tt *testing.T) { + var zeroValue string + r := &RequiredDeploymentsEnforcementLevelChanges{From: &zeroValue} + r.GetFrom() + r = &RequiredDeploymentsEnforcementLevelChanges{} + r.GetFrom() + r = nil + r.GetFrom() +} + func TestRequiredReviewer_GetType(tt *testing.T) { var zeroValue string r := &RequiredReviewer{Type: &zeroValue} @@ -18814,6 +19005,16 @@ func TestRequiredStatusCheck_GetAppID(tt *testing.T) { r.GetAppID() } +func TestRequiredStatusChecksEnforcementLevelChanges_GetFrom(tt *testing.T) { + var zeroValue string + r := &RequiredStatusChecksEnforcementLevelChanges{From: &zeroValue} + r.GetFrom() + r = &RequiredStatusChecksEnforcementLevelChanges{} + r.GetFrom() + r = nil + r.GetFrom() +} + func TestRequiredStatusChecksRequest_GetStrict(tt *testing.T) { var zeroValue bool r := &RequiredStatusChecksRequest{Strict: &zeroValue} @@ -19942,6 +20143,16 @@ func TestServiceHook_GetName(tt *testing.T) { s.GetName() } +func TestSignatureRequirementEnforcementLevelChanges_GetFrom(tt *testing.T) { + var zeroValue string + s := &SignatureRequirementEnforcementLevelChanges{From: &zeroValue} + s.GetFrom() + s = &SignatureRequirementEnforcementLevelChanges{} + s.GetFrom() + s = nil + s.GetFrom() +} + func TestSignaturesProtectedBranch_GetEnabled(tt *testing.T) { var zeroValue bool s := &SignaturesProtectedBranch{Enabled: &zeroValue} diff --git a/github/repos.go b/github/repos.go index 309e4430506..8f5bbea9d44 100644 --- a/github/repos.go +++ b/github/repos.go @@ -872,8 +872,31 @@ type BranchProtectionRule struct { // ProtectionChanges represents the changes to the rule if the BranchProtection was edited. type ProtectionChanges struct { - AuthorizedActorsOnly *AuthorizedActorsOnly `json:"authorized_actors_only,omitempty"` - AuthorizedActorNames *AuthorizedActorNames `json:"authorized_actor_names,omitempty"` + AdminEnforced *AdminEnforcedChanges `json:"admin_enforced,omitempty"` + AllowDeletionsEnforcementLevel *AllowDeletionsEnforcementLevelChanges `json:"allow_deletions_enforcement_level,omitempty"` + AuthorizedActorNames *AuthorizedActorNames `json:"authorized_actor_names,omitempty"` + AuthorizedActorsOnly *AuthorizedActorsOnly `json:"authorized_actors_only,omitempty"` + AuthorizedDismissalActorsOnly *AuthorizedDismissalActorsOnlyChanges `json:"authorized_dismissal_actors_only,omitempty"` + CreateProtected *CreateProtectedChanges `json:"create_protected,omitempty"` + DismissStaleReviewsOnPush *DismissStaleReviewsOnPushChanges `json:"dismiss_stale_reviews_on_push,omitempty"` + LinearHistoryRequirementEnforcementLevel *LinearHistoryRequirementEnforcementLevelChanges `json:"linear_history_requirement_enforcement_level,omitempty"` + PullRequestReviewsEnforcementLevel *PullRequestReviewsEnforcementLevelChanges `json:"pull_request_reviews_enforcement_level,omitempty"` + RequireCodeOwnerReview *RequireCodeOwnerReviewChanges `json:"require_code_owner_review,omitempty"` + RequiredConversationResolutionLevel *RequiredConversationResolutionLevelChanges `json:"required_conversation_resolution_level,omitempty"` + RequiredDeploymentsEnforcementLevel *RequiredDeploymentsEnforcementLevelChanges `json:"required_deployments_enforcement_level,omitempty"` + RequiredStatusChecks *RequiredStatusChecksChanges `json:"required_status_checks,omitempty"` + RequiredStatusChecksEnforcementLevel *RequiredStatusChecksEnforcementLevelChanges `json:"required_status_checks_enforcement_level,omitempty"` + SignatureRequirementEnforcementLevel *SignatureRequirementEnforcementLevelChanges `json:"signature_requirement_enforcement_level,omitempty"` +} + +// AdminEnforcedChanges represents the changes made to the AdminEnforced policy. +type AdminEnforcedChanges struct { + From *bool `json:"from,omitempty"` +} + +// AllowDeletionsEnforcementLevelChanges represents the changes made to the AllowDeletionsEnforcementLevel policy. +type AllowDeletionsEnforcementLevelChanges struct { + From *string `json:"from,omitempty"` } // AuthorizedActorNames represents who are authorized to edit the branch protection rules. @@ -881,11 +904,66 @@ type AuthorizedActorNames struct { From []string `json:"from,omitempty"` } -// AuthorizedActorsOnly represents if the branche rule can be edited by authorized actors only. +// AuthorizedActorsOnly represents if the branch rule can be edited by authorized actors only. type AuthorizedActorsOnly struct { From *bool `json:"from,omitempty"` } +// AuthorizedDismissalActorsOnlyChanges represents the changes made to the AuthorizedDismissalActorsOnly policy. +type AuthorizedDismissalActorsOnlyChanges struct { + From *bool `json:"from,omitempty"` +} + +// CreateProtectedChanges represents the changes made to the CreateProtected policy. +type CreateProtectedChanges struct { + From *bool `json:"from,omitempty"` +} + +// DismissStaleReviewsOnPushChanges represents the changes made to the DismissStaleReviewsOnPushChanges policy. +type DismissStaleReviewsOnPushChanges struct { + From *bool `json:"from,omitempty"` +} + +// LinearHistoryRequirementEnforcementLevelChanges represents the changes made to the LinearHistoryRequirementEnforcementLevel policy. +type LinearHistoryRequirementEnforcementLevelChanges struct { + From *string `json:"from,omitempty"` +} + +// PullRequestReviewsEnforcementLevelChanges represents the changes made to the PullRequestReviewsEnforcementLevel policy. +type PullRequestReviewsEnforcementLevelChanges struct { + From *string `json:"from,omitempty"` +} + +// RequireCodeOwnerReviewChanges represents the changes made to the RequireCodeOwnerReview policy. +type RequireCodeOwnerReviewChanges struct { + From *bool `json:"from,omitempty"` +} + +// RequiredConversationResolutionLevelChanges represents the changes made to the RequiredConversationResolutionLevel policy. +type RequiredConversationResolutionLevelChanges struct { + From *string `json:"from,omitempty"` +} + +// RequiredDeploymentsEnforcementLevelChanges represents the changes made to the RequiredDeploymentsEnforcementLevel policy. +type RequiredDeploymentsEnforcementLevelChanges struct { + From *string `json:"from,omitempty"` +} + +// RequiredStatusChecksChanges represents the changes made to the RequiredStatusChecks policy. +type RequiredStatusChecksChanges struct { + From []string `json:"from,omitempty"` +} + +// RequiredStatusChecksEnforcementLevelChanges represents the changes made to the RequiredStatusChecksEnforcementLevel policy. +type RequiredStatusChecksEnforcementLevelChanges struct { + From *string `json:"from,omitempty"` +} + +// SignatureRequirementEnforcementLevelChanges represents the changes made to the SignatureRequirementEnforcementLevel policy. +type SignatureRequirementEnforcementLevelChanges struct { + From *string `json:"from,omitempty"` +} + // ProtectionRequest represents a request to create/edit a branch's protection. type ProtectionRequest struct { RequiredStatusChecks *RequiredStatusChecks `json:"required_status_checks"` From 765af9b366ed26b6e1adf79c29f5c530d858c864 Mon Sep 17 00:00:00 2001 From: Theofilos Petsios Date: Sat, 8 Oct 2022 05:36:49 -0400 Subject: [PATCH 066/751] Rename 'whitelist' to 'allowlist' in oauth class selectors (#2488) --- scrape/apps.go | 4 ++-- scrape/testdata/access-restrictions-disabled.html | 2 +- scrape/testdata/access-restrictions-enabled.html | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scrape/apps.go b/scrape/apps.go index e8d810db273..0ac16c750aa 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -28,7 +28,7 @@ func (c *Client) AppRestrictionsEnabled(org string) (bool, error) { return false, err } - s := doc.Find(".oauth-application-whitelist svg").First() + s := doc.Find(".oauth-application-allowlist svg").First() if s.Length() == 0 { return false, errors.New("unable to find expected markup") } @@ -52,7 +52,7 @@ func (c *Client) ListOAuthApps(org string) ([]OAuthApp, error) { } var apps []OAuthApp - doc.Find(".oauth-application-whitelist ul > li").Each(func(i int, s *goquery.Selection) { + doc.Find(".oauth-application-allowlist ul > li").Each(func(i int, s *goquery.Selection) { var app OAuthApp app.Name = s.Find(".request-info strong").First().Text() app.Description = s.Find(".request-info .application-description").Text() diff --git a/scrape/testdata/access-restrictions-disabled.html b/scrape/testdata/access-restrictions-disabled.html index a5fbe34cabd..e5431e14c60 100644 --- a/scrape/testdata/access-restrictions-disabled.html +++ b/scrape/testdata/access-restrictions-disabled.html @@ -12,7 +12,7 @@
    -
    +

    Third-party application access policy

    diff --git a/scrape/testdata/access-restrictions-enabled.html b/scrape/testdata/access-restrictions-enabled.html index 4b8d1db816c..d5b869c79d1 100644 --- a/scrape/testdata/access-restrictions-enabled.html +++ b/scrape/testdata/access-restrictions-enabled.html @@ -14,7 +14,7 @@

    -
    +

    Third-party application access policy

    From 10f65abb7dcef16e451df1ec1e2c9f23052805c6 Mon Sep 17 00:00:00 2001 From: Bjorn Neergaard Date: Wed, 12 Oct 2022 05:47:04 -0600 Subject: [PATCH 067/751] Add support for User SSH signing keys (#2482) --- AUTHORS | 1 + github/github-accessors.go | 32 ++++ github/github-accessors_test.go | 40 +++++ github/github-stringify_test.go | 13 ++ github/users_keys_test.go | 4 +- github/users_ssh_signing_keys.go | 108 ++++++++++++++ github/users_ssh_signing_keys_test.go | 202 ++++++++++++++++++++++++++ 7 files changed, 398 insertions(+), 2 deletions(-) create mode 100644 github/users_ssh_signing_keys.go create mode 100644 github/users_ssh_signing_keys_test.go diff --git a/AUTHORS b/AUTHORS index 80bd26dd4f5..1ee400fe206 100644 --- a/AUTHORS +++ b/AUTHORS @@ -59,6 +59,7 @@ Beyang Liu Billy Keyes Billy Lynch Björn Häuser +Bjorn Neergaard boljen Brad Harris Brad Moylan diff --git a/github/github-accessors.go b/github/github-accessors.go index c03df750fc7..e410c695d1b 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -17430,6 +17430,38 @@ func (s *SourceImportAuthor) GetURL() string { return *s.URL } +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (s *SSHSigningKey) GetCreatedAt() Timestamp { + if s == nil || s.CreatedAt == nil { + return Timestamp{} + } + return *s.CreatedAt +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (s *SSHSigningKey) GetID() int64 { + if s == nil || s.ID == nil { + return 0 + } + return *s.ID +} + +// GetKey returns the Key field if it's non-nil, zero value otherwise. +func (s *SSHSigningKey) GetKey() string { + if s == nil || s.Key == nil { + return "" + } + return *s.Key +} + +// GetTitle returns the Title field if it's non-nil, zero value otherwise. +func (s *SSHSigningKey) GetTitle() string { + if s == nil || s.Title == nil { + return "" + } + return *s.Title +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (s *StarEvent) GetAction() string { if s == nil || s.Action == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 5cb6f0463b1..506db4238b7 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -20327,6 +20327,46 @@ func TestSourceImportAuthor_GetURL(tt *testing.T) { s.GetURL() } +func TestSSHSigningKey_GetCreatedAt(tt *testing.T) { + var zeroValue Timestamp + s := &SSHSigningKey{CreatedAt: &zeroValue} + s.GetCreatedAt() + s = &SSHSigningKey{} + s.GetCreatedAt() + s = nil + s.GetCreatedAt() +} + +func TestSSHSigningKey_GetID(tt *testing.T) { + var zeroValue int64 + s := &SSHSigningKey{ID: &zeroValue} + s.GetID() + s = &SSHSigningKey{} + s.GetID() + s = nil + s.GetID() +} + +func TestSSHSigningKey_GetKey(tt *testing.T) { + var zeroValue string + s := &SSHSigningKey{Key: &zeroValue} + s.GetKey() + s = &SSHSigningKey{} + s.GetKey() + s = nil + s.GetKey() +} + +func TestSSHSigningKey_GetTitle(tt *testing.T) { + var zeroValue string + s := &SSHSigningKey{Title: &zeroValue} + s.GetTitle() + s = &SSHSigningKey{} + s.GetTitle() + s = nil + s.GetTitle() +} + func TestStarEvent_GetAction(tt *testing.T) { var zeroValue string s := &StarEvent{Action: &zeroValue} diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index 09a6888e1f3..b83ff2373d6 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -1714,6 +1714,19 @@ func TestRepositoryRelease_String(t *testing.T) { } } +func TestSSHSigningKey_String(t *testing.T) { + v := SSHSigningKey{ + ID: Int64(0), + Key: String(""), + Title: String(""), + CreatedAt: &Timestamp{}, + } + want := `github.SSHSigningKey{ID:0, Key:"", Title:"", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}` + if got := v.String(); got != want { + t.Errorf("SSHSigningKey.String = %v, want %v", got, want) + } +} + func TestSecretScanning_String(t *testing.T) { v := SecretScanning{ Status: String(""), diff --git a/github/users_keys_test.go b/github/users_keys_test.go index b3e5fc9e7a3..ac5c10d0335 100644 --- a/github/users_keys_test.go +++ b/github/users_keys_test.go @@ -138,12 +138,12 @@ func TestUsersService_CreateKey(t *testing.T) { ctx := context.Background() key, _, err := client.Users.CreateKey(ctx, input) if err != nil { - t.Errorf("Users.GetKey returned error: %v", err) + t.Errorf("Users.CreateKey returned error: %v", err) } want := &Key{ID: Int64(1)} if !cmp.Equal(key, want) { - t.Errorf("Users.GetKey returned %+v, want %+v", key, want) + t.Errorf("Users.CreateKey returned %+v, want %+v", key, want) } const methodName = "CreateKey" diff --git a/github/users_ssh_signing_keys.go b/github/users_ssh_signing_keys.go new file mode 100644 index 00000000000..567623f8875 --- /dev/null +++ b/github/users_ssh_signing_keys.go @@ -0,0 +1,108 @@ +// 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" +) + +// SSHSigningKey represents a public SSH key used to sign git commits. +type SSHSigningKey struct { + ID *int64 `json:"id,omitempty"` + Key *string `json:"key,omitempty"` + Title *string `json:"title,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` +} + +func (k SSHSigningKey) String() string { + return Stringify(k) +} + +// ListSSHSigningKeys lists the SSH signing keys for a user. Passing an empty +// username string will fetch SSH signing keys for the authenticated user. +// +// GitHub API docs: https://docs.github.com/en/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-a-user +func (s *UsersService) ListSSHSigningKeys(ctx context.Context, user string, opts *ListOptions) ([]*SSHSigningKey, *Response, error) { + var u string + if user != "" { + u = fmt.Sprintf("users/%v/ssh_signing_keys", user) + } else { + u = "user/ssh_signing_keys" + } + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var keys []*SSHSigningKey + resp, err := s.client.Do(ctx, req, &keys) + if err != nil { + return nil, resp, err + } + + return keys, resp, nil +} + +// GetSSHSigningKey fetches a single SSH signing key for the authenticated user. +// +// GitHub API docs: https://docs.github.com/en/rest/users/ssh-signing-keys#get-an-ssh-signing-key-for-the-authenticated-user +func (s *UsersService) GetSSHSigningKey(ctx context.Context, id int64) (*SSHSigningKey, *Response, error) { + u := fmt.Sprintf("user/ssh_signing_keys/%v", id) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + key := new(SSHSigningKey) + resp, err := s.client.Do(ctx, req, key) + if err != nil { + return nil, resp, err + } + + return key, resp, nil +} + +// CreateSSHSigningKey adds a SSH signing key for the authenticated user. +// +// GitHub API docs: https://docs.github.com/en/rest/users/ssh-signing-keys#create-a-ssh-signing-key-for-the-authenticated-user +func (s *UsersService) CreateSSHSigningKey(ctx context.Context, key *Key) (*SSHSigningKey, *Response, error) { + u := "user/ssh_signing_keys" + + req, err := s.client.NewRequest("POST", u, key) + if err != nil { + return nil, nil, err + } + + k := new(SSHSigningKey) + resp, err := s.client.Do(ctx, req, k) + if err != nil { + return nil, resp, err + } + + return k, resp, nil +} + +// DeleteKey deletes a SSH signing key for the authenticated user. +// +// GitHub API docs: https://docs.github.com/en/rest/users/ssh-signing-keys#delete-an-ssh-signing-key-for-the-authenticated-user +func (s *UsersService) DeleteSSHSigningKey(ctx context.Context, id int64) (*Response, error) { + u := fmt.Sprintf("user/ssh_signing_keys/%v", id) + + 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/users_ssh_signing_keys_test.go b/github/users_ssh_signing_keys_test.go new file mode 100644 index 00000000000..3bf59e108db --- /dev/null +++ b/github/users_ssh_signing_keys_test.go @@ -0,0 +1,202 @@ +// 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 TestUsersService_ListSSHSigningKeys_authenticatedUser(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/user/ssh_signing_keys", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{"page": "2"}) + fmt.Fprint(w, `[{"id":1}]`) + }) + + opt := &ListOptions{Page: 2} + ctx := context.Background() + keys, _, err := client.Users.ListSSHSigningKeys(ctx, "", opt) + if err != nil { + t.Errorf("Users.ListSSHSigningKeys returned error: %v", err) + } + + want := []*SSHSigningKey{{ID: Int64(1)}} + if !cmp.Equal(keys, want) { + t.Errorf("Users.ListSSHSigningKeys returned %+v, want %+v", keys, want) + } + + const methodName = "ListSSHSigningKeys" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Users.ListSSHSigningKeys(ctx, "\n", opt) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Users.ListSSHSigningKeys(ctx, "", opt) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestUsersService_ListSSHSigningKeys_specifiedUser(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/users/u/ssh_signing_keys", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `[{"id":1}]`) + }) + + ctx := context.Background() + keys, _, err := client.Users.ListSSHSigningKeys(ctx, "u", nil) + if err != nil { + t.Errorf("Users.ListSSHSigningKeys returned error: %v", err) + } + + want := []*SSHSigningKey{{ID: Int64(1)}} + if !cmp.Equal(keys, want) { + t.Errorf("Users.ListSSHSigningKeys returned %+v, want %+v", keys, want) + } +} + +func TestUsersService_ListSSHSigningKeys_invalidUser(t *testing.T) { + client, _, _, teardown := setup() + defer teardown() + + ctx := context.Background() + _, _, err := client.Users.ListSSHSigningKeys(ctx, "%", nil) + testURLParseError(t, err) +} + +func TestUsersService_GetSSHSigningKey(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/user/ssh_signing_keys/1", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"id":1}`) + }) + + ctx := context.Background() + key, _, err := client.Users.GetSSHSigningKey(ctx, 1) + if err != nil { + t.Errorf("Users.GetSSHSigningKey returned error: %v", err) + } + + want := &SSHSigningKey{ID: Int64(1)} + if !cmp.Equal(key, want) { + t.Errorf("Users.GetSSHSigningKey returned %+v, want %+v", key, want) + } + + const methodName = "GetSSHSigningKey" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Users.GetSSHSigningKey(ctx, -1) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Users.GetSSHSigningKey(ctx, 1) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestUsersService_CreateSSHSigningKey(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + input := &Key{Key: String("k"), Title: String("t")} + + mux.HandleFunc("/user/ssh_signing_keys", func(w http.ResponseWriter, r *http.Request) { + v := new(Key) + 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}`) + }) + + ctx := context.Background() + key, _, err := client.Users.CreateSSHSigningKey(ctx, input) + if err != nil { + t.Errorf("Users.CreateSSHSigningKey returned error: %v", err) + } + + want := &SSHSigningKey{ID: Int64(1)} + if !cmp.Equal(key, want) { + t.Errorf("Users.CreateSSHSigningKey returned %+v, want %+v", key, want) + } + + const methodName = "CreateKey" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Users.CreateKey(ctx, input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestUsersService_DeleteSSHSigningKey(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/user/ssh_signing_keys/1", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + }) + + ctx := context.Background() + _, err := client.Users.DeleteSSHSigningKey(ctx, 1) + if err != nil { + t.Errorf("Users.DeleteSSHSigningKey returned error: %v", err) + } + + const methodName = "DeleteSSHSigningKey" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Users.DeleteSSHSigningKey(ctx, -1) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Users.DeleteSSHSigningKey(ctx, 1) + }) +} + +func TestSSHSigningKey_Marshal(t *testing.T) { + testJSONMarshal(t, &SSHSigningKey{}, "{}") + + u := &Key{ + ID: Int64(1), + Key: String("abc"), + Title: String("title"), + CreatedAt: &Timestamp{referenceTime}, + } + + want := `{ + "id": 1, + "key": "abc", + "title": "title", + "created_at": ` + referenceTimeStr + ` + }` + + testJSONMarshal(t, u, want) +} From 33444123bc7eaf03bdfe548dea7ce9ab04fc1008 Mon Sep 17 00:00:00 2001 From: k1rnt Date: Thu, 13 Oct 2022 01:55:08 +0900 Subject: [PATCH 068/751] Fix use GITHUB_OUTPUT from deprecated set-output (#2492) Fixes: #2491. --- .github/workflows/tests.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f392c707082..f08c217a43b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -48,8 +48,9 @@ jobs: # Get values for cache paths to be used in later steps - id: cache-paths run: | - echo "::set-output name=go-cache::$(go env GOCACHE)" - echo "::set-output name=go-mod-cache::$(go env GOMODCACHE)" + echo "go-cache=$(go env GOCACHE)" >> $GITHUB_OUTPUT + echo "go-mod-cache=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT + shell: bash - name: Cache go modules uses: actions/cache@v3 From 38d7b16d53c396178eeb836b7cb287304dab66ae Mon Sep 17 00:00:00 2001 From: Gabriel Date: Sun, 16 Oct 2022 19:51:34 +0300 Subject: [PATCH 069/751] Add enterprise list runner applications download (#2496) Fixes: #2495 . --- github/enterprise_actions_runners.go | 19 +++++++++++ github/enterprise_actions_runners_test.go | 41 +++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/github/enterprise_actions_runners.go b/github/enterprise_actions_runners.go index f2ba166360a..daafc5e6285 100644 --- a/github/enterprise_actions_runners.go +++ b/github/enterprise_actions_runners.go @@ -10,6 +10,25 @@ import ( "fmt" ) +// ListRunnerApplicationDownloads lists self-hosted runner application binaries that can be downloaded and run. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#list-runner-applications-for-an-enterprise +func (s *EnterpriseService) ListRunnerApplicationDownloads(ctx context.Context, enterprise string) ([]*RunnerApplicationDownload, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/runners/downloads", enterprise) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var rads []*RunnerApplicationDownload + resp, err := s.client.Do(ctx, req, &rads) + if err != nil { + return nil, resp, err + } + + return rads, resp, nil +} + // CreateRegistrationToken creates a token that can be used to add a self-hosted runner. // // GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-registration-token-for-an-enterprise diff --git a/github/enterprise_actions_runners_test.go b/github/enterprise_actions_runners_test.go index a854b482ec1..b7c3f78b2d3 100644 --- a/github/enterprise_actions_runners_test.go +++ b/github/enterprise_actions_runners_test.go @@ -119,3 +119,44 @@ func TestEnterpriseService_RemoveRunner(t *testing.T) { return client.Enterprise.RemoveRunner(ctx, "o", 21) }) } + +func TestEnterpriseService_ListRunnerApplicationDownloads(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/enterprises/o/actions/runners/downloads", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `[{"os":"osx","architecture":"x64","download_url":"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-osx-x64-2.164.0.tar.gz","filename":"actions-runner-osx-x64-2.164.0.tar.gz"},{"os":"linux","architecture":"x64","download_url":"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-x64-2.164.0.tar.gz","filename":"actions-runner-linux-x64-2.164.0.tar.gz"},{"os": "linux","architecture":"arm","download_url":"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm-2.164.0.tar.gz","filename":"actions-runner-linux-arm-2.164.0.tar.gz"},{"os":"win","architecture":"x64","download_url":"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-win-x64-2.164.0.zip","filename":"actions-runner-win-x64-2.164.0.zip"},{"os":"linux","architecture":"arm64","download_url":"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm64-2.164.0.tar.gz","filename":"actions-runner-linux-arm64-2.164.0.tar.gz"}]`) + }) + + ctx := context.Background() + downloads, _, err := client.Enterprise.ListRunnerApplicationDownloads(ctx, "o") + if err != nil { + t.Errorf("Enterprise.ListRunnerApplicationDownloads returned error: %v", err) + } + + want := []*RunnerApplicationDownload{ + {OS: String("osx"), Architecture: String("x64"), DownloadURL: String("https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-osx-x64-2.164.0.tar.gz"), Filename: String("actions-runner-osx-x64-2.164.0.tar.gz")}, + {OS: String("linux"), Architecture: String("x64"), DownloadURL: String("https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-x64-2.164.0.tar.gz"), Filename: String("actions-runner-linux-x64-2.164.0.tar.gz")}, + {OS: String("linux"), Architecture: String("arm"), DownloadURL: String("https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm-2.164.0.tar.gz"), Filename: String("actions-runner-linux-arm-2.164.0.tar.gz")}, + {OS: String("win"), Architecture: String("x64"), DownloadURL: String("https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-win-x64-2.164.0.zip"), Filename: String("actions-runner-win-x64-2.164.0.zip")}, + {OS: String("linux"), Architecture: String("arm64"), DownloadURL: String("https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm64-2.164.0.tar.gz"), Filename: String("actions-runner-linux-arm64-2.164.0.tar.gz")}, + } + if !cmp.Equal(downloads, want) { + t.Errorf("Enterprise.ListRunnerApplicationDownloads returned %+v, want %+v", downloads, want) + } + + const methodName = "ListRunnerApplicationDownloads" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Enterprise.ListRunnerApplicationDownloads(ctx, "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.ListRunnerApplicationDownloads(ctx, "o") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} From 861fd9adff938f6dcca152ab1a676113b498585c Mon Sep 17 00:00:00 2001 From: Mohammed AlDujaili Date: Tue, 18 Oct 2022 02:47:20 +1100 Subject: [PATCH 070/751] Create custom role APIs (#2494) Fixes: #2493. --- github/github-accessors.go | 40 +++++++++++ github/github-accessors_test.go | 50 ++++++++++++++ github/orgs_custom_roles.go | 78 ++++++++++++++++++++- github/orgs_custom_roles_test.go | 115 ++++++++++++++++++++++++++++++- 4 files changed, 279 insertions(+), 4 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index e410c695d1b..42b1abc8020 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -3566,6 +3566,30 @@ func (c *CreateOrgInvitationOptions) GetRole() string { return *c.Role } +// GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise. +func (c *CreateOrUpdateCustomRoleOptions) GetBaseRole() string { + if c == nil || c.BaseRole == nil { + return "" + } + return *c.BaseRole +} + +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (c *CreateOrUpdateCustomRoleOptions) GetDescription() string { + if c == nil || c.Description == nil { + return "" + } + return *c.Description +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (c *CreateOrUpdateCustomRoleOptions) GetName() string { + if c == nil || c.Name == nil { + return "" + } + return *c.Name +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (c *CreateProtectedChanges) GetFrom() bool { if c == nil || c.From == nil { @@ -3622,6 +3646,22 @@ func (c *CreateUserProjectOptions) GetBody() string { return *c.Body } +// GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise. +func (c *CustomRepoRoles) GetBaseRole() string { + if c == nil || c.BaseRole == nil { + return "" + } + return *c.BaseRole +} + +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (c *CustomRepoRoles) GetDescription() string { + if c == nil || c.Description == nil { + return "" + } + return *c.Description +} + // GetID returns the ID field if it's non-nil, zero value otherwise. func (c *CustomRepoRoles) GetID() int64 { if c == nil || c.ID == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 506db4238b7..c65c98d2d24 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -4173,6 +4173,36 @@ func TestCreateOrgInvitationOptions_GetRole(tt *testing.T) { c.GetRole() } +func TestCreateOrUpdateCustomRoleOptions_GetBaseRole(tt *testing.T) { + var zeroValue string + c := &CreateOrUpdateCustomRoleOptions{BaseRole: &zeroValue} + c.GetBaseRole() + c = &CreateOrUpdateCustomRoleOptions{} + c.GetBaseRole() + c = nil + c.GetBaseRole() +} + +func TestCreateOrUpdateCustomRoleOptions_GetDescription(tt *testing.T) { + var zeroValue string + c := &CreateOrUpdateCustomRoleOptions{Description: &zeroValue} + c.GetDescription() + c = &CreateOrUpdateCustomRoleOptions{} + c.GetDescription() + c = nil + c.GetDescription() +} + +func TestCreateOrUpdateCustomRoleOptions_GetName(tt *testing.T) { + var zeroValue string + c := &CreateOrUpdateCustomRoleOptions{Name: &zeroValue} + c.GetName() + c = &CreateOrUpdateCustomRoleOptions{} + c.GetName() + c = nil + c.GetName() +} + func TestCreateProtectedChanges_GetFrom(tt *testing.T) { var zeroValue bool c := &CreateProtectedChanges{From: &zeroValue} @@ -4240,6 +4270,26 @@ func TestCreateUserProjectOptions_GetBody(tt *testing.T) { c.GetBody() } +func TestCustomRepoRoles_GetBaseRole(tt *testing.T) { + var zeroValue string + c := &CustomRepoRoles{BaseRole: &zeroValue} + c.GetBaseRole() + c = &CustomRepoRoles{} + c.GetBaseRole() + c = nil + c.GetBaseRole() +} + +func TestCustomRepoRoles_GetDescription(tt *testing.T) { + var zeroValue string + c := &CustomRepoRoles{Description: &zeroValue} + c.GetDescription() + c = &CustomRepoRoles{} + c.GetDescription() + c = nil + c.GetDescription() +} + func TestCustomRepoRoles_GetID(tt *testing.T) { var zeroValue int64 c := &CustomRepoRoles{ID: &zeroValue} diff --git a/github/orgs_custom_roles.go b/github/orgs_custom_roles.go index 9904685b948..41270b32215 100644 --- a/github/orgs_custom_roles.go +++ b/github/orgs_custom_roles.go @@ -20,8 +20,11 @@ type OrganizationCustomRepoRoles struct { // See https://docs.github.com/en/enterprise-cloud@latest/organizations/managing-peoples-access-to-your-organization-with-roles/managing-custom-repository-roles-for-an-organization // for more information. type CustomRepoRoles struct { - ID *int64 `json:"id,omitempty"` - Name *string `json:"name,omitempty"` + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + BaseRole *string `json:"base_role,omitempty"` + Permissions []string `json:"permissions,omitempty"` } // ListCustomRepoRoles lists the custom repository roles available in this organization. @@ -44,3 +47,74 @@ func (s *OrganizationsService) ListCustomRepoRoles(ctx context.Context, org stri return customRepoRoles, resp, nil } + +// CreateOrUpdateCustomRoleOptions represents options required to create or update a custom repository role. +type CreateOrUpdateCustomRoleOptions struct { + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + BaseRole *string `json:"base_role,omitempty"` + Permissions []string `json:"permissions,omitempty"` +} + +// CreateCustomRepoRole creates a custom repository role in this organization. +// In order to create custom repository roles in an organization, the authenticated user must be an organization owner. +// +// GitHub API docs: https://docs.github.com/en/rest/orgs/custom-roles#create-a-custom-role +func (s *OrganizationsService) CreateCustomRepoRole(ctx context.Context, org string, opts *CreateOrUpdateCustomRoleOptions) (*CustomRepoRoles, *Response, error) { + u := fmt.Sprintf("orgs/%v/custom_roles", org) + + req, err := s.client.NewRequest("POST", u, opts) + if err != nil { + return nil, nil, err + } + + resultingRole := new(CustomRepoRoles) + resp, err := s.client.Do(ctx, req, resultingRole) + if err != nil { + return nil, resp, err + } + + return resultingRole, resp, err +} + +// UpdateCustomRepoRole updates a custom repository role in this organization. +// In order to update custom repository roles in an organization, the authenticated user must be an organization owner. +// +// GitHub API docs: https://docs.github.com/en/rest/orgs/custom-roles#update-a-custom-role +func (s *OrganizationsService) UpdateCustomRepoRole(ctx context.Context, org, roleID string, opts *CreateOrUpdateCustomRoleOptions) (*CustomRepoRoles, *Response, error) { + u := fmt.Sprintf("orgs/%v/custom_roles/%v", org, roleID) + + req, err := s.client.NewRequest("PATCH", u, opts) + if err != nil { + return nil, nil, err + } + + resultingRole := new(CustomRepoRoles) + resp, err := s.client.Do(ctx, req, resultingRole) + if err != nil { + return nil, resp, err + } + + return resultingRole, resp, err +} + +// DeleteCustomRepoRole deletes an existing custom repository role in this organization. +// In order to delete custom repository roles in an organization, the authenticated user must be an organization owner. +// +// GitHub API docs: https://docs.github.com/en/rest/orgs/custom-roles#delete-a-custom-role +func (s *OrganizationsService) DeleteCustomRepoRole(ctx context.Context, org, roleID string) (*Response, error) { + u := fmt.Sprintf("orgs/%v/custom_roles/%v", org, roleID) + + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + resultingRole := new(CustomRepoRoles) + resp, err := s.client.Do(ctx, req, resultingRole) + if err != nil { + return resp, err + } + + return resp, nil +} diff --git a/github/orgs_custom_roles_test.go b/github/orgs_custom_roles_test.go index 7042a5ec829..720190c2886 100644 --- a/github/orgs_custom_roles_test.go +++ b/github/orgs_custom_roles_test.go @@ -20,7 +20,7 @@ func TestOrganizationsService_ListCustomRepoRoles(t *testing.T) { mux.HandleFunc("/orgs/o/custom_roles", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - fmt.Fprint(w, `{"total_count": 1, "custom_roles": [{ "id": 1, "name": "Developer"}]}`) + fmt.Fprint(w, `{"total_count": 1, "custom_roles": [{ "id": 1, "name": "Developer", "base_role": "write", "permissions": ["delete_alerts_code_scanning"]}]}`) }) ctx := context.Background() @@ -29,7 +29,7 @@ func TestOrganizationsService_ListCustomRepoRoles(t *testing.T) { t.Errorf("Organizations.ListCustomRepoRoles returned error: %v", err) } - want := &OrganizationCustomRepoRoles{TotalCount: Int(1), CustomRepoRoles: []*CustomRepoRoles{{ID: Int64(1), Name: String("Developer")}}} + want := &OrganizationCustomRepoRoles{TotalCount: Int(1), CustomRepoRoles: []*CustomRepoRoles{{ID: Int64(1), Name: String("Developer"), BaseRole: String("write"), Permissions: []string{"delete_alerts_code_scanning"}}}} if !cmp.Equal(apps, want) { t.Errorf("Organizations.ListCustomRepoRoles returned %+v, want %+v", apps, want) } @@ -48,3 +48,114 @@ func TestOrganizationsService_ListCustomRepoRoles(t *testing.T) { return resp, err }) } + +func TestOrganizationsService_CreateCustomRepoRole(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/custom_roles", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + fmt.Fprint(w, `{"id":8030,"name":"Labeler","description":"A role for issue and PR labelers","base_role":"read","permissions":["add_label"]}`) + }) + + ctx := context.Background() + + opts := &CreateOrUpdateCustomRoleOptions{ + Name: String("Labeler"), + Description: String("A role for issue and PR labelers"), + BaseRole: String("read"), + Permissions: []string{"add_label"}, + } + apps, _, err := client.Organizations.CreateCustomRepoRole(ctx, "o", opts) + if err != nil { + t.Errorf("Organizations.CreateCustomRepoRole returned error: %v", err) + } + + want := &CustomRepoRoles{ID: Int64(8030), Name: String("Labeler"), BaseRole: String("read"), Permissions: []string{"add_label"}, Description: String("A role for issue and PR labelers")} + + if !cmp.Equal(apps, want) { + t.Errorf("Organizations.CreateCustomRepoRole returned %+v, want %+v", apps, want) + } + + const methodName = "CreateCustomRepoRole" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.CreateCustomRepoRole(ctx, "\no", nil) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.CreateCustomRepoRole(ctx, "o", nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_UpdateCustomRepoRole(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/custom_roles/8030", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PATCH") + fmt.Fprint(w, `{"id":8030,"name":"Updated Name","description":"Updated Description","base_role":"read","permissions":["add_label"]}`) + }) + + ctx := context.Background() + + opts := &CreateOrUpdateCustomRoleOptions{ + Name: String("Updated Name"), + Description: String("Updated Description"), + } + apps, _, err := client.Organizations.UpdateCustomRepoRole(ctx, "o", "8030", opts) + if err != nil { + t.Errorf("Organizations.UpdateCustomRepoRole returned error: %v", err) + } + + want := &CustomRepoRoles{ID: Int64(8030), Name: String("Updated Name"), BaseRole: String("read"), Permissions: []string{"add_label"}, Description: String("Updated Description")} + + if !cmp.Equal(apps, want) { + t.Errorf("Organizations.UpdateCustomRepoRole returned %+v, want %+v", apps, want) + } + + const methodName = "UpdateCustomRepoRole" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.UpdateCustomRepoRole(ctx, "\no", "8030", nil) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.UpdateCustomRepoRole(ctx, "o", "8030", nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_DeleteCustomRepoRole(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/custom_roles/8030", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + w.WriteHeader(http.StatusNoContent) + }) + + ctx := context.Background() + + resp, err := client.Organizations.DeleteCustomRepoRole(ctx, "o", "8030") + if err != nil { + t.Errorf("Organizations.DeleteCustomRepoRole returned error: %v", err) + } + + if !cmp.Equal(resp.StatusCode, 204) { + t.Errorf("Organizations.DeleteCustomRepoRole returned status code %+v, want %+v", resp.StatusCode, "204") + } + + const methodName = "DeleteCustomRepoRole" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Organizations.DeleteCustomRepoRole(ctx, "\no", "8030") + return err + }) +} From 686f3dd7a393550afa3120f5d3140b159a0eb4b0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Oct 2022 15:21:21 -0400 Subject: [PATCH 071/751] Bump styfle/cancel-workflow-action from 0.10.1 to 0.11.0 (#2498) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f08c217a43b..0b2038712fa 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@9f10b1b9fa56e99e4c5d12c2a085c8a0c37ab0ac #0.10.1 + uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 #0.11.0 with: access_token: ${{ github.token }} From 6fe3a66cfa43c9e2c7b4c9d6bcfbec709839ed82 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Mon, 17 Oct 2022 20:30:47 -0400 Subject: [PATCH 072/751] Bump version of go-github to v48 (#2501) --- README.md | 14 +++++++------- example/actionpermissions/main.go | 2 +- example/appengine/app.go | 2 +- example/basicauth/main.go | 2 +- example/commitpr/main.go | 2 +- example/go.mod | 6 +++--- example/listenvironments/main.go | 2 +- example/migrations/main.go | 2 +- example/newfilewithappauth/main.go | 2 +- example/newrepo/main.go | 2 +- example/newreposecretwithlibsodium/go.mod | 4 ++-- example/newreposecretwithlibsodium/main.go | 2 +- example/newreposecretwithxcrypto/main.go | 2 +- example/simple/main.go | 2 +- example/tagprotection/main.go | 2 +- example/tokenauth/main.go | 2 +- example/topics/main.go | 2 +- github/doc.go | 2 +- github/examples_test.go | 2 +- github/github.go | 2 +- go.mod | 2 +- test/fields/fields.go | 2 +- test/integration/activity_test.go | 2 +- test/integration/authorizations_test.go | 2 +- test/integration/github_test.go | 2 +- test/integration/repos_test.go | 2 +- test/integration/users_test.go | 2 +- update-urls/go.mod | 2 +- 28 files changed, 37 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index c7b6e9adac4..376d068662a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-github # [![go-github release (latest SemVer)](https://img.shields.io/github/v/release/google/go-github?sort=semver)](https://github.com/google/go-github/releases) -[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v47/github) +[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v48/github) [![Test Status](https://github.com/google/go-github/workflows/tests/badge.svg)](https://github.com/google/go-github/actions?query=workflow%3Atests) [![Test Coverage](https://codecov.io/gh/google/go-github/branch/master/graph/badge.svg)](https://codecov.io/gh/google/go-github) [![Discuss at go-github@googlegroups.com](https://img.shields.io/badge/discuss-go--github%40googlegroups.com-blue.svg)](https://groups.google.com/group/go-github) @@ -24,7 +24,7 @@ If you're interested in using the [GraphQL API v4][], the recommended library is go-github is compatible with modern Go releases in module mode, with Go installed: ```bash -go get github.com/google/go-github/v47 +go get github.com/google/go-github/v48 ``` will resolve and add the package to the current development module, along with its dependencies. @@ -32,7 +32,7 @@ will resolve and add the package to the current development module, along with i Alternatively the same can be achieved if you use import in a package: ```go -import "github.com/google/go-github/v47/github" +import "github.com/google/go-github/v48/github" ``` and run `go get` without parameters. @@ -40,13 +40,13 @@ and run `go get` without parameters. Finally, to use the top-of-trunk version of this repo, use the following command: ```bash -go get github.com/google/go-github/v47@master +go get github.com/google/go-github/v48@master ``` ## Usage ## ```go -import "github.com/google/go-github/v47/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) +import "github.com/google/go-github/v48/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled ``` @@ -135,7 +135,7 @@ import ( "net/http" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v47/github" + "github.com/google/go-github/v48/github" ) func main() { @@ -290,7 +290,7 @@ For complete usage of go-github, see the full [package docs][]. [oauth2]: https://github.com/golang/oauth2 [oauth2 docs]: https://godoc.org/golang.org/x/oauth2 [personal API token]: https://github.com/blog/1509-personal-api-tokens -[package docs]: https://pkg.go.dev/github.com/google/go-github/v47/github +[package docs]: https://pkg.go.dev/github.com/google/go-github/v48/github [GraphQL API v4]: https://developer.github.com/v4/ [shurcooL/githubv4]: https://github.com/shurcooL/githubv4 [GitHub webhook events]: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads diff --git a/example/actionpermissions/main.go b/example/actionpermissions/main.go index 77ef08be375..c568d572553 100644 --- a/example/actionpermissions/main.go +++ b/example/actionpermissions/main.go @@ -14,7 +14,7 @@ import ( "log" "os" - "github.com/google/go-github/v47/github" + "github.com/google/go-github/v48/github" "golang.org/x/oauth2" ) diff --git a/example/appengine/app.go b/example/appengine/app.go index fa654c38668..e4ba5d96123 100644 --- a/example/appengine/app.go +++ b/example/appengine/app.go @@ -12,7 +12,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v47/github" + "github.com/google/go-github/v48/github" "golang.org/x/oauth2" "google.golang.org/appengine" "google.golang.org/appengine/log" diff --git a/example/basicauth/main.go b/example/basicauth/main.go index b04290d6f92..43604434e2a 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -22,7 +22,7 @@ import ( "strings" "syscall" - "github.com/google/go-github/v47/github" + "github.com/google/go-github/v48/github" "golang.org/x/crypto/ssh/terminal" ) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index f4021c3efc7..0a86414dd56 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -31,7 +31,7 @@ import ( "strings" "time" - "github.com/google/go-github/v47/github" + "github.com/google/go-github/v48/github" "golang.org/x/oauth2" ) diff --git a/example/go.mod b/example/go.mod index 12b674cc9de..9d989505354 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,10 +1,10 @@ -module github.com/google/go-github/v47/example +module github.com/google/go-github/v48/example go 1.17 require ( github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 - github.com/google/go-github/v47 v47.0.0 + github.com/google/go-github/v48 v48.0.0 golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be google.golang.org/appengine v1.6.7 @@ -21,4 +21,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v47 => ../ +replace github.com/google/go-github/v48 => ../ diff --git a/example/listenvironments/main.go b/example/listenvironments/main.go index bc06caaacb9..ddee688d806 100644 --- a/example/listenvironments/main.go +++ b/example/listenvironments/main.go @@ -18,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v47/github" + "github.com/google/go-github/v48/github" "golang.org/x/oauth2" ) diff --git a/example/migrations/main.go b/example/migrations/main.go index 7ec2473d8be..096085ce88d 100644 --- a/example/migrations/main.go +++ b/example/migrations/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v47/github" + "github.com/google/go-github/v48/github" "golang.org/x/oauth2" ) diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index 059f7cda8d3..f6e9c572e5b 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -16,7 +16,7 @@ import ( "time" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v47/github" + "github.com/google/go-github/v48/github" "golang.org/x/oauth2" ) diff --git a/example/newrepo/main.go b/example/newrepo/main.go index e7b24d13d96..46378f9853c 100644 --- a/example/newrepo/main.go +++ b/example/newrepo/main.go @@ -16,7 +16,7 @@ import ( "log" "os" - "github.com/google/go-github/v47/github" + "github.com/google/go-github/v48/github" "golang.org/x/oauth2" ) diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index 5688f67c75c..4519c051e4c 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -4,9 +4,9 @@ go 1.15 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb - github.com/google/go-github/v47 v47.0.0 + github.com/google/go-github/v48 v48.0.0 golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v47 => ../.. +replace github.com/google/go-github/v48 => ../.. diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index c7f0c441230..fb66df83685 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -36,7 +36,7 @@ import ( "os" sodium "github.com/GoKillers/libsodium-go/cryptobox" - "github.com/google/go-github/v47/github" + "github.com/google/go-github/v48/github" "golang.org/x/oauth2" ) diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index 96e64eccca9..c4f38f34ecd 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -36,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v47/github" + "github.com/google/go-github/v48/github" "golang.org/x/crypto/nacl/box" "golang.org/x/oauth2" ) diff --git a/example/simple/main.go b/example/simple/main.go index fe26c74753b..ed68b4eeada 100644 --- a/example/simple/main.go +++ b/example/simple/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v47/github" + "github.com/google/go-github/v48/github" ) // Fetch all the public organizations' membership of a user. diff --git a/example/tagprotection/main.go b/example/tagprotection/main.go index 433612c48bc..09ae4dcfb64 100644 --- a/example/tagprotection/main.go +++ b/example/tagprotection/main.go @@ -19,7 +19,7 @@ import ( "strings" "syscall" - "github.com/google/go-github/v47/github" + "github.com/google/go-github/v48/github" "golang.org/x/crypto/ssh/terminal" "golang.org/x/oauth2" ) diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index 58754382923..c6ef3cd464a 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -14,7 +14,7 @@ import ( "log" "syscall" - "github.com/google/go-github/v47/github" + "github.com/google/go-github/v48/github" "golang.org/x/crypto/ssh/terminal" "golang.org/x/oauth2" ) diff --git a/example/topics/main.go b/example/topics/main.go index 7549feec757..1033c27648d 100644 --- a/example/topics/main.go +++ b/example/topics/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v47/github" + "github.com/google/go-github/v48/github" ) // Fetch and lists all the public topics associated with the specified GitHub topic diff --git a/github/doc.go b/github/doc.go index 9ab7f558758..0c4afaa3d69 100644 --- a/github/doc.go +++ b/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v47/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v48/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to diff --git a/github/examples_test.go b/github/examples_test.go index 2f8c87d78ea..79c226fc48e 100644 --- a/github/examples_test.go +++ b/github/examples_test.go @@ -12,7 +12,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v47/github" + "github.com/google/go-github/v48/github" ) func ExampleClient_Markdown() { diff --git a/github/github.go b/github/github.go index da923dbbb38..2883c380503 100644 --- a/github/github.go +++ b/github/github.go @@ -28,7 +28,7 @@ import ( ) const ( - Version = "v47.0.0" + Version = "v48.0.0" defaultBaseURL = "https://api.github.com/" defaultUserAgent = "go-github" + "/" + Version diff --git a/go.mod b/go.mod index bebe4027f5e..656bb7543e6 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v47 +module github.com/google/go-github/v48 require ( github.com/google/go-cmp v0.5.9 diff --git a/test/fields/fields.go b/test/fields/fields.go index 07e12441283..3d42b7c43b8 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -25,7 +25,7 @@ import ( "reflect" "strings" - "github.com/google/go-github/v47/github" + "github.com/google/go-github/v48/github" "golang.org/x/oauth2" ) diff --git a/test/integration/activity_test.go b/test/integration/activity_test.go index fd57c3841c3..5d2f231bd7e 100644 --- a/test/integration/activity_test.go +++ b/test/integration/activity_test.go @@ -12,7 +12,7 @@ import ( "context" "testing" - "github.com/google/go-github/v47/github" + "github.com/google/go-github/v48/github" ) const ( diff --git a/test/integration/authorizations_test.go b/test/integration/authorizations_test.go index 28e60ec9363..50d38e0cc0f 100644 --- a/test/integration/authorizations_test.go +++ b/test/integration/authorizations_test.go @@ -17,7 +17,7 @@ import ( "testing" "time" - "github.com/google/go-github/v47/github" + "github.com/google/go-github/v48/github" ) const msgEnvMissing = "Skipping test because the required environment variable (%v) is not present." diff --git a/test/integration/github_test.go b/test/integration/github_test.go index 790754b32e1..aabada850c3 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -15,7 +15,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v47/github" + "github.com/google/go-github/v48/github" "golang.org/x/oauth2" ) diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index 21b786e724e..ff39f715dfc 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -16,7 +16,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v47/github" + "github.com/google/go-github/v48/github" ) func TestRepositories_CRUD(t *testing.T) { diff --git a/test/integration/users_test.go b/test/integration/users_test.go index 8553e258117..cd7797b696c 100644 --- a/test/integration/users_test.go +++ b/test/integration/users_test.go @@ -14,7 +14,7 @@ import ( "math/rand" "testing" - "github.com/google/go-github/v47/github" + "github.com/google/go-github/v48/github" ) func TestUsers_Get(t *testing.T) { diff --git a/update-urls/go.mod b/update-urls/go.mod index af987764985..2fed223a35d 100644 --- a/update-urls/go.mod +++ b/update-urls/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v47/update-urls +module github.com/google/go-github/v48/update-urls go 1.16 From c8abab66f37aa7ab970a981f808f8aa607360767 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Mon, 17 Oct 2022 20:43:07 -0400 Subject: [PATCH 073/751] Update scrape dependency to v48 (#2502) --- scrape/apps.go | 2 +- scrape/apps_test.go | 2 +- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scrape/apps.go b/scrape/apps.go index 0ac16c750aa..55afeb6cc8c 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -17,7 +17,7 @@ import ( "strings" "github.com/PuerkitoBio/goquery" - "github.com/google/go-github/v47/github" + "github.com/google/go-github/v48/github" ) // AppRestrictionsEnabled returns whether the specified organization has diff --git a/scrape/apps_test.go b/scrape/apps_test.go index 029b019b139..972656290a9 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v47/github" + "github.com/google/go-github/v48/github" ) func Test_AppRestrictionsEnabled(t *testing.T) { diff --git a/scrape/go.mod b/scrape/go.mod index aceca979ff7..3adfb078eef 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.9 - github.com/google/go-github/v47 v47.1.0 + github.com/google/go-github/v48 v48.0.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 cf979d2ffcc..d1f7cb56d53 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.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v47 v47.1.0 h1:Cacm/WxQBOa9lF0FT0EMjZ2BWMetQ1TQfyurn4yF1z8= -github.com/google/go-github/v47 v47.1.0/go.mod h1:VPZBXNbFSJGjyjFRUKo9vZGawTajnWzC/YjGw/oFKi0= +github.com/google/go-github/v48 v48.0.0 h1:9H5fWVXFK6ZsRriyPbjtnFAkJnoj0WKFtTYfpCRrTm8= +github.com/google/go-github/v48 v48.0.0/go.mod h1:dDlehKBDo850ZPvCTK0sEqTCVWcrGl2LcDiajkYi89Y= 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= From 3dcfcf60818af09b0d3fa670947fc3c53b1e2d57 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Mon, 17 Oct 2022 20:54:59 -0400 Subject: [PATCH 074/751] Update AUTHORS for v48 (#2503) --- AUTHORS | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 71 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index 1ee400fe206..47e85bdb780 100644 --- a/AUTHORS +++ b/AUTHORS @@ -11,7 +11,10 @@ 178inaba 2BFL 413x +Abed Kibbe Abhinav Gupta +Abhishek Veeramalla +aboy adrienzieba afdesk Ahmed Hagy @@ -24,15 +27,18 @@ Alec Thomas Aleks Clark Alex Bramley Alex Orr +Alex Su Alex Unger Alexander Harkness Alexis Gauthiez Ali Farooq +Allan Guwatudde Allen Sun Amey Sakhadeo Anders Janmyr Andreas Garnæs Andrew Ryabchun +Andrew Svoboda Andy Grunwald Andy Hume Andy Lindeman @@ -58,21 +64,26 @@ Beshr Kayali Beyang Liu Billy Keyes Billy Lynch -Björn Häuser Bjorn Neergaard +Björn Häuser boljen +Bracken Brad Harris Brad Moylan Bradley Falzon Bradley McAllister +Brandon Butler Brandon Cook +Brett Kuhlman Brett Logan Brian Egizi Bryan Boreham +Bryan Peterson Cami Diez Carl Johnson Carlos Alexandro Becker Carlos Tadeu Panato Junior +ChandanChainani chandresh-pancholi Charles Fenwick Elliott Charlie Yan @@ -83,12 +94,17 @@ Chris Raborg Chris Roche Chris Schaefer chrisforrette +Christian Bargmann Christian Muehlhaeuser Christoph Sassenberg +CI Monk Colin Misare +Craig Gumbley Craig Peterson Cristian Maglie +Cyb3r Jak3 Daehyeok Mun +Dalton Hubble Daniel Lanner Daniel Leavitt Daniel Nilsson @@ -98,6 +114,7 @@ Dave Henderson Dave Perrett Dave Protasowski David Deng +David Gamba David J. M. Karlsen David Jannotta David Ji @@ -105,6 +122,7 @@ David Lopez Reyes Davide Zipeto Dennis Webb Derek Jobst +DeviousLab Dhi Aurrahman Diego Lapiduz Dmitri Shuralyov @@ -117,6 +135,8 @@ Eivind Eli Uriegas Elliott Beach Emerson Wood +Emil V +Eng Zer Jun eperm Erick Fejta Erik Nobel @@ -124,13 +144,16 @@ erwinvaneyk Evan Elias Fabian Holler Fabrice +Fatema-Moaiyadi Felix Geisendörfer Filippo Valsorda Florian Forster +Florian Wagner Francesc Gil Francis Francisco Guimarães Fredrik Jönsson +Gabriel Garrett Squire George Kontridze Georgy Buranov @@ -144,11 +167,15 @@ Guz Alexander Guðmundur Bjarni Ólafsson Hanno Hecker Hari haran +Harikesh00 haya14busa haya14busa +Hiroki Ito +Hubot Jr Huy Tr huydx i2bskn +Iain Steers Ikko Ashimine Ioannis Georgoulas Isao Jonas @@ -158,8 +185,10 @@ Jacob Valdemar Jake Krammer Jake White Jameel Haffejee +James Bowes James Cockbain James Loh +Jamie West Jan Kosecki Jan Švábík Javier Campanini @@ -169,15 +198,18 @@ Jeremy Morris Jesse Haka Jesse Newland Jihoon Chung +Jille Timmermans Jimmi Dyson Joan Saum Joe Tsai John Barton John Engelman +John Jones John Liu Jordan Brockopp Jordan Sussman Joshua Bezaleel Abednego +João Cerqueira JP Phillips jpbelanger-mtl Juan @@ -186,25 +218,34 @@ Julien Garcia Gonzalez Julien Rostand Junya Kono Justin Abrahms +Justin Toh Jusung Lee jzhoucliqr +k1rnt kadern0 Katrina Owen Kautilya Tripathi Keita Urashima Kevin Burke +Kevin Wang +Kevin Zhao Kirill Konrad Malawski Kookheon Kwon +Krishna Indani Krzysztof Kowalczyk Kshitij Saraogi Kumar Saurabh +Kyle Kurz kyokomi Laurent Verdoïa +leopoldwang Liam Galvin +Lluis Campos Lovro Mažgon Luca Campese Lucas Alcantara +Luis Davim Luke Evers Luke Kysow Luke Roberts @@ -227,12 +268,16 @@ Matt Gaunt Matt Landis Matt Moore Maxime Bury +Michael Meng Michael Spiegel Michael Tiller Michał Glapa Michelangelo Morrillo +Miguel Elias dos Santos +Mohammed AlDujaili Mukundan Senthil Munia Balayil +Mustafa Abban Nadav Kaner Nathan VanBenschoten Navaneeth Suresh @@ -242,6 +287,7 @@ Nick Platt Nick Spragg Nikhita Raghunath Nilesh Singh +Noah Hanjun Lee Noah Zoschke ns-cweber Ole Orhagen @@ -252,13 +298,16 @@ Pablo Pérez Schröder Palash Nigam Panagiotis Moustafellos Parham Alvani +pari-27 Parker Moore parkhyukjun89 +Pat Alwell Patrick DeVivo Patrick Marabeas Pavel Shtanko Pete Wagner Petr Shevtsov +Pierce McEntagart Pierre Carrier Piotr Zurek Piyush Chugh @@ -272,18 +321,23 @@ Radek Simko Radliński Ignacy Rajat Jindal Rajendra arora +Rajkumar Ranbir Singh Ravi Shekhar Jethani RaviTeja Pothana rc1140 Red Hat, Inc. Reetuparna Mukherjee +reeves122 Reinier Timmer Renjith R Ricco Førgaard +Richard de Vries Rob Figueiredo Rohit Upadhyay +Rojan Dinc Ronak Jain +Ronan Pelliard Ross Gustafson Ruben Vereecken Russell Boley @@ -299,7 +353,9 @@ Sandeep Sukhani Sander Knape Sander van Harmelen Sanket Payghan +Sarah Funkhouser Sarasa Kisaragi +Sasha Melentyev Sean Wang Sebastian Mandrean Sebastian Mæland Pedersen @@ -312,6 +368,7 @@ shakeelrao Shawn Catanzarite Shawn Smith Shibasis Patel +Sho Okada Shrikrishna Singh Simon Davis sona-tar @@ -322,17 +379,25 @@ Stefan Sedich Steve Teuber Stian Eikeland Suhaib Mujahid +sushmita wable Szymon Kodrebski Søren Hansen +Takashi Yoneuchi Takayuki Watanabe Taketoshi Fujiwara Taketoshi Fujiwara +Takuma Kajikawa Tasya Aditya Rukmana Theo Henson +Theofilos Petsios Thomas Aidan Curran Thomas Bruyelle +Tim Rogers Timothée Peignier +Tingluo Huang tkhandel +Tobias Gesellchen +Tom Payne Trey Tacon ttacon Vaibhav Singh @@ -347,12 +412,16 @@ Will Maier Willem D'Haeseleer William Bailey William Cooke +Xabi xibz Yann Malet Yannick Utard Yicheng Qin Yosuke Akatsuka Yumikiyo Osanai +Yusef Mohamadi Yusuke Kuoka Zach Latta -zhouhaibing089 \ No newline at end of file +zhouhaibing089 +六开箱 +缘生 From fce403041dc3f5683ccaddaa2ba27d8b24b2e291 Mon Sep 17 00:00:00 2001 From: Jarek Porzucek <17789797+jporzucek@users.noreply.github.com> Date: Thu, 20 Oct 2022 16:57:41 +0200 Subject: [PATCH 075/751] Add apps to restriction rules in branch protection (#2509) Fixes: #2506. --- github/github-accessors.go | 8 +++++ github/github-accessors_test.go | 10 +++++++ github/repos.go | 16 ++++++---- github/repos_test.go | 53 ++++++++++++++++++++++++++++++--- 4 files changed, 77 insertions(+), 10 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 42b1abc8020..f91f9a93ba4 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -4558,6 +4558,14 @@ func (d *DiscussionEvent) GetSender() *User { return d.Sender } +// GetApps returns the Apps field if it's non-nil, zero value otherwise. +func (d *DismissalRestrictionsRequest) GetApps() []string { + if d == nil || d.Apps == nil { + return nil + } + return *d.Apps +} + // GetTeams returns the Teams field if it's non-nil, zero value otherwise. func (d *DismissalRestrictionsRequest) GetTeams() []string { if d == nil || d.Teams == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index c65c98d2d24..3fee246979d 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -5326,6 +5326,16 @@ func TestDiscussionEvent_GetSender(tt *testing.T) { d.GetSender() } +func TestDismissalRestrictionsRequest_GetApps(tt *testing.T) { + var zeroValue []string + d := &DismissalRestrictionsRequest{Apps: &zeroValue} + d.GetApps() + d = &DismissalRestrictionsRequest{} + d.GetApps() + d = nil + d.GetApps() +} + func TestDismissalRestrictionsRequest_GetTeams(tt *testing.T) { var zeroValue []string d := &DismissalRestrictionsRequest{Teams: &zeroValue} diff --git a/github/repos.go b/github/repos.go index 8f5bbea9d44..e12cff08377 100644 --- a/github/repos.go +++ b/github/repos.go @@ -1019,7 +1019,7 @@ type RequiredStatusCheck struct { 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. + // Specifies which users, teams and apps can dismiss pull request reviews. DismissalRestrictions *DismissalRestrictions `json:"dismissal_restrictions,omitempty"` // Specifies if approved reviews are dismissed automatically, when a new commit is pushed. DismissStaleReviews bool `json:"dismiss_stale_reviews"` @@ -1036,8 +1036,8 @@ type PullRequestReviewsEnforcement struct { 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 + // Specifies which users, teams and apps should be allowed to dismiss pull request reviews. + // User, team and app dismissal restrictions are only available for // organization-owned repositories. Must be nil for personal repositories. DismissalRestrictionsRequest *DismissalRestrictionsRequest `json:"dismissal_restrictions,omitempty"` // Specifies if approved reviews can be dismissed automatically, when a new commit is pushed. (Required) @@ -1055,7 +1055,7 @@ type PullRequestReviewsEnforcementRequest struct { 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. + // Specifies which users, teams and apps 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. DismissStaleReviews *bool `json:"dismiss_stale_reviews,omitempty"` @@ -1113,7 +1113,7 @@ type BranchRestrictionsRequest struct { // The list of team slugs with push access. (Required; use []string{} instead of nil for empty list.) Teams []string `json:"teams"` // The list of app slugs with push access. - Apps []string `json:"apps,omitempty"` + Apps []string `json:"apps"` } // BypassPullRequestAllowances represents the people, teams, or apps who are allowed to bypass required pull requests. @@ -1145,10 +1145,12 @@ type DismissalRestrictions struct { Users []*User `json:"users"` // The list of teams which can dismiss pull request reviews. Teams []*Team `json:"teams"` + // The list of apps which can dismiss pull request reviews. + Apps []*App `json:"apps"` } // DismissalRestrictionsRequest represents the request to create/edit the -// restriction to allows only specific users or teams to dimiss pull request reviews. It is +// restriction to allows only specific users, teams or apps to dimiss pull request reviews. It is // separate from DismissalRestrictions above because the request structure is // different from the response structure. // Note: Both Users and Teams must be nil, or both must be non-nil. @@ -1157,6 +1159,8 @@ type DismissalRestrictionsRequest struct { Users *[]string `json:"users,omitempty"` // The list of team slugs which can dismiss pull request reviews. (Required; use nil to disable dismissal_restrictions or &[]string{} otherwise.) Teams *[]string `json:"teams,omitempty"` + // The list of apps which can dismiss pull request reviews. (Required; use nil to disable dismissal_restrictions or &[]string{} otherwise.) + Apps *[]string `json:"apps,omitempty"` } // SignaturesProtectedBranch represents the protection status of an individual branch. diff --git a/github/repos_test.go b/github/repos_test.go index f7ee58b2313..ec32b5d578d 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -1074,6 +1074,10 @@ func TestRepositoriesService_GetBranchProtection(t *testing.T) { "teams":[{ "id":4, "slug":"t" + }], + "apps":[{ + "id":5, + "slug":"a" }] }, "dismiss_stale_reviews":true, @@ -1086,7 +1090,8 @@ func TestRepositoriesService_GetBranchProtection(t *testing.T) { }, "restrictions":{ "users":[{"id":1,"login":"u"}], - "teams":[{"id":2,"slug":"t"}] + "teams":[{"id":2,"slug":"t"}], + "apps":[{"id":3,"slug":"a"}] }, "required_conversation_resolution": { "enabled": true @@ -1119,6 +1124,9 @@ func TestRepositoriesService_GetBranchProtection(t *testing.T) { Teams: []*Team{ {Slug: String("t"), ID: Int64(4)}, }, + Apps: []*App{ + {Slug: String("a"), ID: Int64(5)}, + }, }, RequireCodeOwnerReviews: true, RequiredApprovingReviewCount: 1, @@ -1134,6 +1142,9 @@ func TestRepositoriesService_GetBranchProtection(t *testing.T) { Teams: []*Team{ {Slug: String("t"), ID: Int64(2)}, }, + Apps: []*App{ + {Slug: String("a"), ID: Int64(3)}, + }, }, RequiredConversationResolution: &RequiredConversationResolution{ Enabled: true, @@ -1273,6 +1284,7 @@ func TestRepositoriesService_UpdateBranchProtection_Contexts(t *testing.T) { DismissalRestrictionsRequest: &DismissalRestrictionsRequest{ Users: &[]string{"uu"}, Teams: &[]string{"tt"}, + Apps: &[]string{"aa"}, }, BypassPullRequestAllowancesRequest: &BypassPullRequestAllowancesRequest{ Users: []string{"uuu"}, @@ -1318,6 +1330,10 @@ func TestRepositoriesService_UpdateBranchProtection_Contexts(t *testing.T) { "teams":[{ "id":4, "slug":"tt" + }], + "apps":[{ + "id":5, + "slug":"aa" }] }, "dismiss_stale_reviews":true, @@ -1361,6 +1377,9 @@ func TestRepositoriesService_UpdateBranchProtection_Contexts(t *testing.T) { Teams: []*Team{ {Slug: String("tt"), ID: Int64(4)}, }, + Apps: []*App{ + {Slug: String("aa"), ID: Int64(5)}, + }, }, RequireCodeOwnerReviews: true, BypassPullRequestAllowances: &BypassPullRequestAllowances{ @@ -1424,6 +1443,7 @@ func TestRepositoriesService_UpdateBranchProtection_Checks(t *testing.T) { DismissalRestrictionsRequest: &DismissalRestrictionsRequest{ Users: &[]string{"uu"}, Teams: &[]string{"tt"}, + Apps: &[]string{"aa"}, }, BypassPullRequestAllowancesRequest: &BypassPullRequestAllowancesRequest{ Users: []string{"uuu"}, @@ -1469,6 +1489,10 @@ func TestRepositoriesService_UpdateBranchProtection_Checks(t *testing.T) { "teams":[{ "id":4, "slug":"tt" + }], + "apps":[{ + "id":5, + "slug":"aa" }] }, "dismiss_stale_reviews":true, @@ -1512,6 +1536,9 @@ func TestRepositoriesService_UpdateBranchProtection_Checks(t *testing.T) { Teams: []*Team{ {Slug: String("tt"), ID: Int64(4)}, }, + Apps: []*App{ + {Slug: String("aa"), ID: Int64(5)}, + }, }, RequireCodeOwnerReviews: true, BypassPullRequestAllowances: &BypassPullRequestAllowances{ @@ -1557,6 +1584,7 @@ func TestRepositoriesService_UpdateBranchProtection_StrictNoChecks(t *testing.T) DismissalRestrictionsRequest: &DismissalRestrictionsRequest{ Users: &[]string{"uu"}, Teams: &[]string{"tt"}, + Apps: &[]string{"aa"}, }, BypassPullRequestAllowancesRequest: &BypassPullRequestAllowancesRequest{ Users: []string{"uuu"}, @@ -1597,6 +1625,10 @@ func TestRepositoriesService_UpdateBranchProtection_StrictNoChecks(t *testing.T) "teams":[{ "id":4, "slug":"tt" + }], + "apps":[{ + "id":5, + "slug":"aa" }] }, "dismiss_stale_reviews":true, @@ -1636,6 +1668,9 @@ func TestRepositoriesService_UpdateBranchProtection_StrictNoChecks(t *testing.T) Teams: []*Team{ {Slug: String("tt"), ID: Int64(4)}, }, + Apps: []*App{ + {Slug: String("aa"), ID: Int64(5)}, + }, }, RequireCodeOwnerReviews: true, BypassPullRequestAllowances: &BypassPullRequestAllowances{ @@ -2088,7 +2123,8 @@ func TestRepositoriesService_GetPullRequestReviewEnforcement(t *testing.T) { fmt.Fprintf(w, `{ "dismissal_restrictions":{ "users":[{"id":1,"login":"u"}], - "teams":[{"id":2,"slug":"t"}] + "teams":[{"id":2,"slug":"t"}], + "apps":[{"id":3,"slug":"a"}] }, "dismiss_stale_reviews":true, "require_code_owner_reviews":true, @@ -2111,6 +2147,9 @@ func TestRepositoriesService_GetPullRequestReviewEnforcement(t *testing.T) { Teams: []*Team{ {Slug: String("t"), ID: Int64(2)}, }, + Apps: []*App{ + {Slug: String("a"), ID: Int64(3)}, + }, }, RequireCodeOwnerReviews: true, RequiredApprovingReviewCount: 1, @@ -2143,6 +2182,7 @@ func TestRepositoriesService_UpdatePullRequestReviewEnforcement(t *testing.T) { DismissalRestrictionsRequest: &DismissalRestrictionsRequest{ Users: &[]string{"u"}, Teams: &[]string{"t"}, + Apps: &[]string{"a"}, }, } @@ -2159,7 +2199,8 @@ func TestRepositoriesService_UpdatePullRequestReviewEnforcement(t *testing.T) { fmt.Fprintf(w, `{ "dismissal_restrictions":{ "users":[{"id":1,"login":"u"}], - "teams":[{"id":2,"slug":"t"}] + "teams":[{"id":2,"slug":"t"}], + "apps":[{"id":3,"slug":"a"}] }, "dismiss_stale_reviews":true, "require_code_owner_reviews":true, @@ -2182,6 +2223,9 @@ func TestRepositoriesService_UpdatePullRequestReviewEnforcement(t *testing.T) { Teams: []*Team{ {Slug: String("t"), ID: Int64(2)}, }, + Apps: []*App{ + {Slug: String("a"), ID: Int64(3)}, + }, }, RequireCodeOwnerReviews: true, RequiredApprovingReviewCount: 3, @@ -2515,6 +2559,7 @@ func TestPullRequestReviewsEnforcementRequest_MarshalJSON_nilDismissalRestirctio DismissalRestrictionsRequest: &DismissalRestrictionsRequest{ Users: &[]string{}, Teams: &[]string{}, + Apps: &[]string{}, }, } @@ -2523,7 +2568,7 @@ func TestPullRequestReviewsEnforcementRequest_MarshalJSON_nilDismissalRestirctio t.Errorf("PullRequestReviewsEnforcementRequest.MarshalJSON returned error: %v", err) } - want = `{"dismissal_restrictions":{"users":[],"teams":[]},"dismiss_stale_reviews":false,"require_code_owner_reviews":false,"required_approving_review_count":0}` + want = `{"dismissal_restrictions":{"users":[],"teams":[],"apps":[]},"dismiss_stale_reviews":false,"require_code_owner_reviews":false,"required_approving_review_count":0}` if want != string(got) { t.Errorf("PullRequestReviewsEnforcementRequest.MarshalJSON returned %+v, want %+v", string(got), want) } From 672fd67d04f674dced2f10ca79ab4d33bd64ae08 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Oct 2022 15:31:29 -0400 Subject: [PATCH 076/751] Bump golangci/golangci-lint-action from 3.2.0 to 3.3.0 (#2515) --- .github/workflows/linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index b3003f1e8d7..b44fdcc6011 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -26,7 +26,7 @@ jobs: - uses: actions/checkout@v3 - name: golangci-lint ${{ matrix.working-directory }} - uses: golangci/golangci-lint-action@537aa1903e5d359d0b27dbc19ddd22c5087f3fbc #v3.2.0 + uses: golangci/golangci-lint-action@07db5389c99593f11ad7b44463c2d4233066a9b1 #v3.3.0 with: version: v1.44.0 working-directory: ${{ matrix.working-directory}} From 914d25e91cbf8e274759d0f3d3daa36ca4e0d3ad Mon Sep 17 00:00:00 2001 From: Akshay <48827972+akshaypatil3096@users.noreply.github.com> Date: Tue, 25 Oct 2022 18:43:00 +0530 Subject: [PATCH 077/751] Add test case for JSON resource marshaling (#2517) --- github/teams_test.go | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/github/teams_test.go b/github/teams_test.go index 83f559beff8..cee6ff433ef 100644 --- a/github/teams_test.go +++ b/github/teams_test.go @@ -2098,3 +2098,39 @@ func TestTeamsService_RemoveConnectedExternalGroup_notFound(t *testing.T) { t.Errorf("Teams.GetExternalGroup returned status %d, want %d", got, want) } } + +func TestIDPGroupList_Marshal(t *testing.T) { + testJSONMarshal(t, &IDPGroupList{}, "{}") + + u := &IDPGroupList{ + Groups: []*IDPGroup{ + { + GroupID: String("abc1"), + GroupName: String("test group"), + GroupDescription: String("test group descripation"), + }, + { + GroupID: String("abc2"), + GroupName: String("test group2"), + GroupDescription: String("test group descripation2"), + }, + }, + } + + want := `{ + "groups": [ + { + "group_id": "abc1", + "group_name": "test group", + "group_description": "test group descripation" + }, + { + "group_id": "abc2", + "group_name": "test group2", + "group_description": "test group descripation2" + } + ] + }` + + testJSONMarshal(t, u, want) +} From d17bf218b92feaa0ba0f874f2e71190c607495d8 Mon Sep 17 00:00:00 2001 From: vaibhavgholap23 <91172267+vaibhavgholap23@users.noreply.github.com> Date: Tue, 25 Oct 2022 19:18:47 +0530 Subject: [PATCH 078/751] Add test case for JSON resource marshaling (#2526) --- github/scim_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/github/scim_test.go b/github/scim_test.go index 7c6e14078b2..d00377a9725 100644 --- a/github/scim_test.go +++ b/github/scim_test.go @@ -389,3 +389,23 @@ func TestSCIMUserAttributes_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestSCIMUserName_Marshal(t *testing.T) { + testJSONMarshal(t, &SCIMUserName{}, `{ + "givenName":"","familyName":"" + }`) + + u := &SCIMUserName{ + GivenName: "Name1", + FamilyName: "Fname", + Formatted: String("formatted name"), + } + + want := `{ + "givenName": "Name1", + "familyName": "Fname", + "formatted": "formatted name" + }` + + testJSONMarshal(t, u, want) +} From 4d7bb518dfbd29416d9cdbc2adb6974f81b005ef Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Tue, 25 Oct 2022 10:15:28 -0400 Subject: [PATCH 079/751] Fix typo in README URL (#2514) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 376d068662a..0f99698d17d 100644 --- a/README.md +++ b/README.md @@ -123,10 +123,10 @@ GitHub Apps authentication can be provided by the [ghinstallation](https://githu package. > **Note**: Most endpoints (ex. [`GET /rate_limit`]) require access token authentication -> while a few others (ex. [`GET /app/hook/deliverires`]) require [JWT] authentication. +> while a few others (ex. [`GET /app/hook/deliveries`]) require [JWT] authentication. [`GET /rate_limit`]: https://docs.github.com/en/rest/rate-limit#get-rate-limit-status-for-the-authenticated-user -[`GET /app/hook/deliverires`]: https://docs.github.com/en/rest/apps/webhooks#list-deliveries-for-an-app-webhook +[`GET /app/hook/deliveries`]: https://docs.github.com/en/rest/apps/webhooks#list-deliveries-for-an-app-webhook [JWT]: https://docs.github.com/en/developers/apps/building-github-apps/authenticating-with-github-apps#authenticating-as-a-github-app From 3cb9c667eba88ff50b3e467dd2249909c6cf31d4 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Tue, 25 Oct 2022 10:16:10 -0400 Subject: [PATCH 080/751] Update workflow to use Go 1.19 and Go 1.18 (#2525) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0b2038712fa..3a0366d42e9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,7 +20,7 @@ jobs: contents: read # for actions/checkout to fetch code strategy: matrix: - go-version: [1.x, 1.17.x] + go-version: [1.x, 1.18.x] platform: [ubuntu-latest] include: # include windows, but only with the latest Go version, since there From 33c3e88462f67857fba341a499b14c4ad3e8a133 Mon Sep 17 00:00:00 2001 From: Sayali Deshmukh <85864673+sayalideshmukh10@users.noreply.github.com> Date: Tue, 25 Oct 2022 10:54:51 -0400 Subject: [PATCH 081/751] Add test cases for JSON resource marshaling (#2524) --- github/scim_test.go | 57 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/github/scim_test.go b/github/scim_test.go index d00377a9725..7665bb2b12b 100644 --- a/github/scim_test.go +++ b/github/scim_test.go @@ -390,6 +390,62 @@ func TestSCIMUserAttributes_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } +func TestUpdateAttributeForSCIMUserOperations_Marshal(t *testing.T) { + testJSONMarshal(t, &UpdateAttributeForSCIMUserOperations{}, `{}`) + + u := &UpdateAttributeForSCIMUserOperations{ + Op: "TestOp", + Path: String("path"), + } + + want := `{ + "op": "TestOp", + "path": "path" + }` + + testJSONMarshal(t, u, want) +} + +func TestUpdateAttributeForSCIMUserOptions_Marshal(t *testing.T) { + testJSONMarshal(t, &UpdateAttributeForSCIMUserOptions{}, `{}`) + + u := &UpdateAttributeForSCIMUserOptions{ + Schemas: []string{"test", "schema"}, + Operations: UpdateAttributeForSCIMUserOperations{ + Op: "TestOp", + Path: String("path"), + }, + } + + want := `{ + "schemas": ["test", "schema"], + "operations": { + "op": "TestOp", + "path": "path" + } + }` + + testJSONMarshal(t, u, want) +} + +func TestListSCIMProvisionedIdentitiesOptions_Marshal(t *testing.T) { + testJSONMarshal(t, &ListSCIMProvisionedIdentitiesOptions{}, `{}`) + + u := &ListSCIMProvisionedIdentitiesOptions{ + StartIndex: Int(1), + Count: Int(10), + Filter: String("test"), + } + + want := `{ + "startIndex": 1, + "count": 10, + "filter": "test" + }` + + testJSONMarshal(t, u, want) +} + func TestSCIMUserName_Marshal(t *testing.T) { testJSONMarshal(t, &SCIMUserName{}, `{ "givenName":"","familyName":"" @@ -406,6 +462,5 @@ func TestSCIMUserName_Marshal(t *testing.T) { "familyName": "Fname", "formatted": "formatted name" }` - testJSONMarshal(t, u, want) } From dfd77372fd5af085c06f6711d5b2cae6a5a1f8ed Mon Sep 17 00:00:00 2001 From: Sayali Deshmukh <85864673+sayalideshmukh10@users.noreply.github.com> Date: Tue, 25 Oct 2022 14:25:56 -0400 Subject: [PATCH 082/751] Add test cases for JSON resource marshaling (#2527) --- github/scim_test.go | 76 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/github/scim_test.go b/github/scim_test.go index 7665bb2b12b..c2663bb776c 100644 --- a/github/scim_test.go +++ b/github/scim_test.go @@ -464,3 +464,79 @@ func TestSCIMUserName_Marshal(t *testing.T) { }` testJSONMarshal(t, u, want) } + +func TestSCIMMeta_Marshal(t *testing.T) { + testJSONMarshal(t, &SCIMMeta{}, `{}`) + + u := &SCIMMeta{ + ResourceType: String("test"), + Location: String("test"), + } + + want := `{ + "resourceType": "test", + "location": "test" + }` + + testJSONMarshal(t, u, want) +} + +func TestSCIMProvisionedIdentities_Marshal(t *testing.T) { + testJSONMarshal(t, &SCIMProvisionedIdentities{}, `{}`) + + u := &SCIMProvisionedIdentities{ + Schemas: []string{"test", "schema"}, + TotalResults: Int(1), + ItemsPerPage: Int(2), + StartIndex: Int(1), + Resources: []*SCIMUserAttributes{ + { + UserName: "SCIM", + Name: SCIMUserName{ + GivenName: "scim", + FamilyName: "test", + Formatted: String("SCIM"), + }, + DisplayName: String("Test SCIM"), + Emails: []*SCIMUserEmail{ + { + Value: "test", + Primary: Bool(true), + Type: String("test"), + }, + }, + Schemas: []string{"schema1"}, + ExternalID: String("id"), + Groups: []string{"group1"}, + Active: Bool(true), + }, + }, + } + + want := `{ + "schemas": ["test", "schema"], + "totalResults": 1, + "itemsPerPage": 2, + "startIndex": 1, + "Resources": [{ + "userName": "SCIM", + "name": { + "givenName": "scim", + "familyName": "test", + "formatted": "SCIM" + }, + "displayName": "Test SCIM", + "emails": [{ + "value": "test", + "primary": true, + "type": "test" + }], + "schemas": ["schema1"], + "externalId": "id", + "groups": ["group1"], + "active": true + }] + }` + + testJSONMarshal(t, u, want) +} From 2e864650397abd972ca7092ae8fe5b18c4b3718c Mon Sep 17 00:00:00 2001 From: Harikesh00 Date: Wed, 26 Oct 2022 00:04:34 +0530 Subject: [PATCH 083/751] Add test case for JSON resource marshaling (#2521) --- github/users_test.go | 83 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/github/users_test.go b/github/users_test.go index 8acd529caa3..204b31e1719 100644 --- a/github/users_test.go +++ b/github/users_test.go @@ -59,6 +59,89 @@ func TestUser_Marshal(t *testing.T) { "url": "u" }` testJSONMarshal(t, u, want) + + u2 := &User{ + Login: String("testLogin"), + ID: Int64(1), + NodeID: String("testNode123"), + AvatarURL: String("https://www.my-avatar.com"), + HTMLURL: String("https://www.test-url.com"), + GravatarID: String("testGravatar123"), + Name: String("myName"), + Company: String("testCompany"), + Blog: String("test Blog"), + Location: String("test location"), + Email: String("test@test.com"), + Hireable: Bool(true), + Bio: String("my good bio"), + TwitterUsername: String("https://www.twitter.com/test"), + PublicRepos: Int(1), + PublicGists: Int(2), + Followers: Int(100), + Following: Int(29), + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + SuspendedAt: &Timestamp{referenceTime}, + Type: String("test type"), + SiteAdmin: Bool(false), + TotalPrivateRepos: Int(2), + OwnedPrivateRepos: Int(1), + PrivateGists: Int(1), + DiskUsage: Int(1), + Collaborators: Int(1), + TwoFactorAuthentication: Bool(false), + Plan: &Plan{ + Name: String("silver"), + Space: Int(1024), + Collaborators: Int(10), + PrivateRepos: Int(4), + FilledSeats: Int(24), + Seats: Int(1), + }, + LdapDn: String("test ldap"), + } + + want2 := `{ + "login": "testLogin", + "id": 1, + "node_id":"testNode123", + "avatar_url": "https://www.my-avatar.com", + "html_url":"https://www.test-url.com", + "gravatar_id": "testGravatar123", + "name": "myName", + "company": "testCompany", + "blog": "test Blog", + "location": "test location", + "email": "test@test.com", + "hireable": true, + "bio": "my good bio", + "twitter_username": "https://www.twitter.com/test", + "public_repos": 1, + "public_gists":2, + "followers": 100, + "following": 29, + "created_at": ` + referenceTimeStr + `, + "suspended_at": ` + referenceTimeStr + `, + "updated_at": ` + referenceTimeStr + `, + "type": "test type", + "site_admin": false, + "total_private_repos": 2, + "owned_private_repos": 1, + "private_gists": 1, + "disk_usage": 1, + "collaborators": 1, + "two_factor_authentication": false, + "plan": { + "name": "silver", + "space": 1024, + "collaborators": 10, + "private_repos": 4, + "filled_seats": 24, + "seats": 1 + }, + "ldap_dn": "test ldap" + }` + testJSONMarshal(t, u2, want2) } func TestUsersService_Get_authenticatedUser(t *testing.T) { From 9b60dfb8c3cc51aedcdf8f32704f688d251f3a55 Mon Sep 17 00:00:00 2001 From: vaibhavgholap23 <91172267+vaibhavgholap23@users.noreply.github.com> Date: Wed, 26 Oct 2022 06:06:07 +0530 Subject: [PATCH 084/751] Add test case for JSON resource marshaling (#2528) --- github/repos_merging_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/github/repos_merging_test.go b/github/repos_merging_test.go index 0275915b9bf..09a03a19a61 100644 --- a/github/repos_merging_test.go +++ b/github/repos_merging_test.go @@ -126,3 +126,21 @@ func TestRepositoriesService_MergeUpstream(t *testing.T) { return resp, err }) } + +func TestRepoMergeUpstreamResult_Marshal(t *testing.T) { + testJSONMarshal(t, &RepoMergeUpstreamResult{}, "{}") + + u := &RepoMergeUpstreamResult{ + Message: String("message"), + MergeType: String("merge_type"), + BaseBranch: String("base_branch"), + } + + want := `{ + "message": "message", + "merge_type": "merge_type", + "base_branch": "base_branch" + }` + + testJSONMarshal(t, u, want) +} From f9d2c6b6e7c2fe294b36071a407bdbd26022d96f Mon Sep 17 00:00:00 2001 From: Harikesh00 Date: Wed, 26 Oct 2022 19:15:28 +0530 Subject: [PATCH 085/751] Add test cases for JSON resource marshaling (#2520) --- github/repos_test.go | 81 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/github/repos_test.go b/github/repos_test.go index ec32b5d578d..0fdc4b27d9f 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -3002,3 +3002,84 @@ func TestAuthorizedActorsOnly_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestDispatchRequestOptions_Marshal(t *testing.T) { + testJSONMarshal(t, &DispatchRequestOptions{}, "{}") + + cp := json.RawMessage(`{"testKey":"testValue"}`) + u := &DispatchRequestOptions{ + EventType: "test_event_type", + ClientPayload: &cp, + } + + want := `{ + "event_type": "test_event_type", + "client_payload": { + "testKey": "testValue" + } + }` + + testJSONMarshal(t, u, want) +} + +func TestTransferRequest_Marshal(t *testing.T) { + testJSONMarshal(t, &TransferRequest{}, "{}") + + u := &TransferRequest{ + NewOwner: "testOwner", + TeamID: []int64{1, 2}, + } + + want := `{ + "new_owner": "testOwner", + "team_ids": [1,2] + }` + + testJSONMarshal(t, u, want) +} + +func TestSignaturesProtectedBranch_Marshal(t *testing.T) { + testJSONMarshal(t, &SignaturesProtectedBranch{}, "{}") + + u := &SignaturesProtectedBranch{ + URL: String("https://www.testURL.in"), + Enabled: Bool(false), + } + + want := `{ + "url": "https://www.testURL.in", + "enabled": false + }` + + testJSONMarshal(t, u, want) + + u2 := &SignaturesProtectedBranch{ + URL: String("testURL"), + Enabled: Bool(true), + } + + want2 := `{ + "url": "testURL", + "enabled": true + }` + + testJSONMarshal(t, u2, want2) +} + +func TestDismissalRestrictionsRequest_Marshal(t *testing.T) { + testJSONMarshal(t, &DismissalRestrictionsRequest{}, "{}") + + u := &DismissalRestrictionsRequest{ + Users: &[]string{"user1", "user2"}, + Teams: &[]string{"team1", "team2"}, + Apps: &[]string{"app1", "app2"}, + } + + want := `{ + "users": ["user1","user2"], + "teams": ["team1","team2"], + "apps": ["app1","app2"] + }` + + testJSONMarshal(t, u, want) +} From c86868e53eb24d37b2da7d6a1204a89906b0b5e8 Mon Sep 17 00:00:00 2001 From: Sayali Deshmukh <85864673+sayalideshmukh10@users.noreply.github.com> Date: Wed, 26 Oct 2022 09:47:43 -0400 Subject: [PATCH 086/751] Add test cases for JSON resource marshaling (#2531) --- github/secret_scanning_test.go | 110 +++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) diff --git a/github/secret_scanning_test.go b/github/secret_scanning_test.go index af70fc80877..69cd7d3fefe 100644 --- a/github/secret_scanning_test.go +++ b/github/secret_scanning_test.go @@ -475,3 +475,113 @@ func TestSecretScanningService_ListLocationsForAlert(t *testing.T) { return resp, err }) } + +func TestSecretScanningAlert_Marshal(t *testing.T) { + testJSONMarshal(t, &SecretScanningAlert{}, `{}`) + + u := &SecretScanningAlert{ + Number: Int(1), + CreatedAt: &Timestamp{referenceTime}, + URL: String("https://api.github.com/teams/2/discussions/3/comments"), + HTMLURL: String("https://api.github.com/teams/2/discussions/3/comments"), + LocationsURL: String("https://api.github.com/teams/2/discussions/3/comments"), + State: String("test_state"), + Resolution: String("test_resolution"), + ResolvedAt: &Timestamp{referenceTime}, + ResolvedBy: &User{ + Login: String("test"), + ID: Int64(10), + NodeID: String("A123"), + AvatarURL: String("https://api.github.com/teams/2/discussions/3/comments"), + }, + SecretType: String("test"), + Secret: String("test"), + } + + want := `{ + "number": 1, + "created_at": ` + referenceTimeStr + `, + "url": "https://api.github.com/teams/2/discussions/3/comments", + "html_url": "https://api.github.com/teams/2/discussions/3/comments", + "locations_url": "https://api.github.com/teams/2/discussions/3/comments", + "state": "test_state", + "resolution": "test_resolution", + "resolved_at": ` + referenceTimeStr + `, + "resolved_by": { + "login": "test", + "id": 10, + "node_id": "A123", + "avatar_url": "https://api.github.com/teams/2/discussions/3/comments" + }, + "secret_type": "test", + "secret": "test" + }` + + testJSONMarshal(t, u, want) +} + +func TestSecretScanningAlertLocation_Marshal(t *testing.T) { + testJSONMarshal(t, &SecretScanningAlertLocation{}, `{}`) + + u := &SecretScanningAlertLocation{ + Type: String("test"), + Details: &SecretScanningAlertLocationDetails{ + Path: String("test_path"), + Startline: Int(10), + EndLine: Int(20), + StartColumn: Int(30), + EndColumn: Int(40), + BlobSHA: String("test_sha"), + BlobURL: String("https://api.github.com/repos/o/r/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b"), + CommitSHA: String("test_sha"), + CommitURL: String("https://api.github.com/repos/o/r/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b"), + }, + } + + want := `{ + "type": "test", + "details": { + "path": "test_path", + "start_line": 10, + "end_line": 20, + "start_column": 30, + "end_column": 40, + "blob_sha": "test_sha", + "blob_url": "https://api.github.com/repos/o/r/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b", + "commit_sha": "test_sha", + "commit_url": "https://api.github.com/repos/o/r/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b" + } + }` + + testJSONMarshal(t, u, want) +} + +func TestSecretScanningAlertLocationDetails_Marshal(t *testing.T) { + testJSONMarshal(t, &SecretScanningAlertLocationDetails{}, `{}`) + + u := &SecretScanningAlertLocationDetails{ + Path: String("test_path"), + Startline: Int(10), + EndLine: Int(20), + StartColumn: Int(30), + EndColumn: Int(40), + BlobSHA: String("test_sha"), + BlobURL: String("https://api.github.com/repos/o/r/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b"), + CommitSHA: String("test_sha"), + CommitURL: String("https://api.github.com/repos/o/r/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b"), + } + + want := `{ + "path": "test_path", + "start_line": 10, + "end_line": 20, + "start_column": 30, + "end_column": 40, + "blob_sha": "test_sha", + "blob_url": "https://api.github.com/repos/o/r/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b", + "commit_sha": "test_sha", + "commit_url": "https://api.github.com/repos/o/r/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b" + }` + + testJSONMarshal(t, u, want) +} From fc230a222984a70e520927b73a7d6c98a1e0acd8 Mon Sep 17 00:00:00 2001 From: Sayali Deshmukh <85864673+sayalideshmukh10@users.noreply.github.com> Date: Wed, 26 Oct 2022 09:49:55 -0400 Subject: [PATCH 087/751] Add test cases for JSON resource marshaling (#2532) --- github/teams_discussions_test.go | 44 +++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/github/teams_discussions_test.go b/github/teams_discussions_test.go index 06328acb335..0e73751964a 100644 --- a/github/teams_discussions_test.go +++ b/github/teams_discussions_test.go @@ -562,6 +562,27 @@ func TestTeamDiscussion_Marshal(t *testing.T) { CommentsURL: String("https://api.github.com/teams/2/discussions/3/comments"), CreatedAt: &Timestamp{referenceTime}, LastEditedAt: &Timestamp{referenceTime}, + HTMLURL: String("https://api.github.com/teams/2/discussions/3/comments"), + NodeID: String("A123"), + Number: Int(10), + Pinned: Bool(true), + Private: Bool(false), + TeamURL: String("https://api.github.com/teams/2/discussions/3/comments"), + Title: String("Test"), + UpdatedAt: &Timestamp{referenceTime}, + URL: String("https://api.github.com/teams/2/discussions/3/comments"), + Reactions: &Reactions{ + TotalCount: Int(1), + PlusOne: Int(2), + MinusOne: Int(-3), + Laugh: Int(4), + Confused: Int(5), + Heart: Int(6), + Hooray: Int(7), + Rocket: Int(8), + Eyes: Int(9), + URL: String("https://api.github.com/teams/2/discussions/3/comments"), + }, } want := `{ @@ -580,7 +601,28 @@ func TestTeamDiscussion_Marshal(t *testing.T) { "comments_count": 1, "comments_url": "https://api.github.com/teams/2/discussions/3/comments", "created_at": ` + referenceTimeStr + `, - "last_edited_at": ` + referenceTimeStr + ` + "last_edited_at": ` + referenceTimeStr + `, + "html_url": "https://api.github.com/teams/2/discussions/3/comments", + "node_id": "A123", + "number": 10, + "pinned": true, + "private": false, + "team_url": "https://api.github.com/teams/2/discussions/3/comments", + "title": "Test", + "updated_at": ` + referenceTimeStr + `, + "url": "https://api.github.com/teams/2/discussions/3/comments", + "reactions": { + "total_count": 1, + "+1": 2, + "-1": -3, + "laugh": 4, + "confused": 5, + "heart": 6, + "hooray": 7, + "rocket": 8, + "eyes": 9, + "url": "https://api.github.com/teams/2/discussions/3/comments" + } }` testJSONMarshal(t, u, want) From f659408d356700d3ad4d54213751a403e9cdae76 Mon Sep 17 00:00:00 2001 From: Harikesh00 Date: Wed, 26 Oct 2022 19:21:49 +0530 Subject: [PATCH 088/751] Add test for resource JSON marshaling (#2533) --- github/search_test.go | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/github/search_test.go b/github/search_test.go index 0d49b36c190..c69c490445d 100644 --- a/github/search_test.go +++ b/github/search_test.go @@ -876,3 +876,41 @@ func TestIssuesSearchResult_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestLabelsSearchResult_Marshal(t *testing.T) { + testJSONMarshal(t, &LabelsSearchResult{}, "{}") + + u := &LabelsSearchResult{ + Total: Int(5), + IncompleteResults: Bool(false), + Labels: []*LabelResult{ + { + ID: Int64(1), + URL: String("https://www.test-url.com"), + Name: String("test name"), + Color: String("green"), + Default: Bool(true), + Description: String("testDescription"), + Score: Float64(1), + }, + }, + } + + want := `{ + "total_count": 5, + "incomplete_results": false, + "items": [ + { + "id": 1, + "url": "https://www.test-url.com", + "name": "test name", + "color": "green", + "default": true, + "description": "testDescription", + "score": 1 + } + ] + }` + + testJSONMarshal(t, u, want) +} From cb4df26015be71d29baa5cb3c0c07f0a608b3922 Mon Sep 17 00:00:00 2001 From: Harikesh00 Date: Thu, 27 Oct 2022 20:11:02 +0530 Subject: [PATCH 089/751] Add tests for resource JSON marshaling (#2536) --- github/repos_test.go | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/github/repos_test.go b/github/repos_test.go index 0fdc4b27d9f..0d0633eee7b 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -3083,3 +3083,47 @@ func TestDismissalRestrictionsRequest_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestAdminEnforcement_Marshal(t *testing.T) { + testJSONMarshal(t, &AdminEnforcement{}, "{}") + + u := &AdminEnforcement{ + URL: String("https://www.test-url.in"), + Enabled: false, + } + + want := `{ + "url": "https://www.test-url.in", + "enabled": false + }` + + testJSONMarshal(t, u, want) +} + +func TestPullRequestReviewsEnforcementUpdate_Marshal(t *testing.T) { + testJSONMarshal(t, &PullRequestReviewsEnforcementUpdate{}, "{}") + + u := &PullRequestReviewsEnforcementUpdate{ + BypassPullRequestAllowancesRequest: &BypassPullRequestAllowancesRequest{ + Users: []string{"user1", "user2"}, + Teams: []string{"team1", "team2"}, + Apps: []string{"app1", "app2"}, + }, + DismissStaleReviews: Bool(false), + RequireCodeOwnerReviews: Bool(true), + RequiredApprovingReviewCount: 2, + } + + want := `{ + "bypass_pull_request_allowances": { + "users": ["user1","user2"], + "teams": ["team1","team2"], + "apps": ["app1","app2"] + }, + "dismiss_stale_reviews": false, + "require_code_owner_reviews": true, + "required_approving_review_count": 2 + }` + + testJSONMarshal(t, u, want) +} From f550bc861f075e66cce94aa0250944d4a4d4fdcc Mon Sep 17 00:00:00 2001 From: Akshay <48827972+akshaypatil3096@users.noreply.github.com> Date: Thu, 27 Oct 2022 23:05:18 +0530 Subject: [PATCH 090/751] Add test case for JSON resource marshaling (#2537) --- github/teams_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/github/teams_test.go b/github/teams_test.go index cee6ff433ef..9a74630dfdb 100644 --- a/github/teams_test.go +++ b/github/teams_test.go @@ -2134,3 +2134,23 @@ func TestIDPGroupList_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestExternalGroupMember_Marshal(t *testing.T) { + testJSONMarshal(t, &ExternalGroupMember{}, "{}") + + u := &ExternalGroupMember{ + MemberID: Int64(1), + MemberLogin: String("test member"), + MemberName: String("test member name"), + MemberEmail: String("test member email"), + } + + want := `{ + "member_id": 1, + "member_login": "test member", + "member_name":"test member name", + "member_email":"test member email" + }` + + testJSONMarshal(t, u, want) +} From fd784dbb4209590cc20d2739088e3d88d6df7977 Mon Sep 17 00:00:00 2001 From: tsbkw Date: Fri, 28 Oct 2022 21:48:28 +0900 Subject: [PATCH 091/751] Add test for resource JSON marshaling (#2538) --- github/repos_traffic_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/github/repos_traffic_test.go b/github/repos_traffic_test.go index 88046b7ba85..e63f9181994 100644 --- a/github/repos_traffic_test.go +++ b/github/repos_traffic_test.go @@ -308,3 +308,17 @@ func TestTrafficData_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestTrafficBreakdownOptions_Marshal(t *testing.T) { + testJSONMarshal(t, &TrafficBreakdownOptions{}, "{}") + + u := &TrafficBreakdownOptions{ + Per: "day", + } + + want := `{ + "per": "day" + }` + + testJSONMarshal(t, u, want) +} From 2ac6fb828f50f82f26fc6930c062a8c80c15dc63 Mon Sep 17 00:00:00 2001 From: vaibhavgholap23 <91172267+vaibhavgholap23@users.noreply.github.com> Date: Fri, 28 Oct 2022 20:11:56 +0530 Subject: [PATCH 092/751] Add test case for JSON resource marshaling (#2539) --- github/repos_environments_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/github/repos_environments_test.go b/github/repos_environments_test.go index 59b3f8b4688..93d0fc25ebc 100644 --- a/github/repos_environments_test.go +++ b/github/repos_environments_test.go @@ -426,3 +426,19 @@ func TestEnvironment_Marshal(t *testing.T) { testJSONMarshal(t, repoEnv, want) } + +func TestBranchPolicy_Marshal(t *testing.T) { + testJSONMarshal(t, &BranchPolicy{}, "{}") + + bp := &BranchPolicy{ + ProtectedBranches: Bool(false), + CustomBranchPolicies: Bool(false), + } + + want := `{ + "protected_branches": false, + "custom_branch_policies": false + }` + + testJSONMarshal(t, bp, want) +} From cb9253a7ebd8982fc0cf6c272dd229e2707a2bbd Mon Sep 17 00:00:00 2001 From: Rahul Karmore <42960205+rahulkarmore@users.noreply.github.com> Date: Fri, 28 Oct 2022 20:47:28 +0530 Subject: [PATCH 093/751] Add test case for JSON resource marshaling (#2542) --- github/teams_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/github/teams_test.go b/github/teams_test.go index 9a74630dfdb..e7427b0efed 100644 --- a/github/teams_test.go +++ b/github/teams_test.go @@ -2154,3 +2154,19 @@ func TestExternalGroupMember_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestExternalGroupTeam_Marshal(t *testing.T) { + testJSONMarshal(t, &ExternalGroupTeam{}, "{}") + + u := &ExternalGroupTeam{ + TeamID: Int64(123), + TeamName: String("test"), + } + + want := `{ + "team_id": 123, + "team_name": "test" + }` + + testJSONMarshal(t, u, want) +} From 81b88b0486ada3fef936e6c4e4dcb1e226e12860 Mon Sep 17 00:00:00 2001 From: Rahul Karmore <42960205+rahulkarmore@users.noreply.github.com> Date: Fri, 28 Oct 2022 22:37:11 +0530 Subject: [PATCH 094/751] Add test case for JSON resource marshaling (#2541) --- github/teams_test.go | 54 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/github/teams_test.go b/github/teams_test.go index e7427b0efed..a82fd60e0a4 100644 --- a/github/teams_test.go +++ b/github/teams_test.go @@ -2155,6 +2155,60 @@ func TestExternalGroupMember_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } +func TestExternalGroup_Marshal(t *testing.T) { + testJSONMarshal(t, &ExternalGroup{}, "{}") + + u := &ExternalGroup{ + GroupID: Int64(123), + GroupName: String("group1"), + UpdatedAt: &Timestamp{referenceTime}, + Teams: []*ExternalGroupTeam{ + { + TeamID: Int64(1), + TeamName: String("team-test"), + }, + { + TeamID: Int64(2), + TeamName: String("team-test2"), + }, + }, + Members: []*ExternalGroupMember{ + { + MemberID: Int64(1), + MemberLogin: String("test"), + MemberName: String("test"), + MemberEmail: String("test@github.com"), + }, + }, + } + + want := `{ + "group_id": 123, + "group_name": "group1", + "updated_at": ` + referenceTimeStr + `, + "teams": [ + { + "team_id": 1, + "team_name": "team-test" + }, + { + "team_id": 2, + "team_name": "team-test2" + } + ], + "members": [ + { + "member_id": 1, + "member_login": "test", + "member_name": "test", + "member_email": "test@github.com" + } + ] + }` + + testJSONMarshal(t, u, want) +} + func TestExternalGroupTeam_Marshal(t *testing.T) { testJSONMarshal(t, &ExternalGroupTeam{}, "{}") From 288abdc0cc3f3365cc59315e2db363c7e0450f00 Mon Sep 17 00:00:00 2001 From: Akshay <48827972+akshaypatil3096@users.noreply.github.com> Date: Sat, 29 Oct 2022 01:09:24 +0530 Subject: [PATCH 095/751] Add test case for JSON resource marshaling (#2544) --- github/teams_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/github/teams_test.go b/github/teams_test.go index a82fd60e0a4..523e1bcd594 100644 --- a/github/teams_test.go +++ b/github/teams_test.go @@ -2224,3 +2224,23 @@ func TestExternalGroupTeam_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestListExternalGroupsOptions_Marshal(t *testing.T) { + testJSONMarshal(t, &ListExternalGroupsOptions{}, "{}") + + u := &ListExternalGroupsOptions{ + DisplayName: String("test"), + ListOptions: ListOptions{ + Page: 1, + PerPage: 2, + }, + } + + want := `{ + "DisplayName": "test", + "page": 1, + "PerPage": 2 + }` + + testJSONMarshal(t, u, want) +} From 9473fc99d1ad7de8147aa83c373cfa43912f7086 Mon Sep 17 00:00:00 2001 From: Rahul Karmore <42960205+rahulkarmore@users.noreply.github.com> Date: Sat, 29 Oct 2022 04:00:50 +0530 Subject: [PATCH 096/751] Add test case for JSON resource marshaling (#2543) --- github/search_test.go | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/github/search_test.go b/github/search_test.go index c69c490445d..b1973921cd7 100644 --- a/github/search_test.go +++ b/github/search_test.go @@ -914,3 +914,42 @@ func TestLabelsSearchResult_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestCommitResult_Marshal(t *testing.T) { + testJSONMarshal(t, &CommitResult{}, "{}") + + c := &CommitResult{ + SHA: String("test"), + HTMLURL: String("hurl"), + CommentsURL: String("curl"), + URL: String("url"), + Repository: &Repository{ID: Int64(1)}, + Score: Float64(123), + Commit: &Commit{SHA: String("test")}, + Author: &User{ID: Int64(1)}, + Committer: &User{ID: Int64(1)}, + Parents: []*Commit{}, + } + + want := `{ + "sha": "test", + "commit": { + "sha": "test" + }, + "author": { + "id": 1 + }, + "committer": { + "id": 1 + }, + "html_url": "hurl", + "url": "url", + "comments_url": "curl", + "repository": { + "id": 1 + }, + "score": 123 + }` + + testJSONMarshal(t, c, want) +} From 43edea6a5df60596c9eca2f69d4a85b2394180f4 Mon Sep 17 00:00:00 2001 From: Rahul Karmore <42960205+rahulkarmore@users.noreply.github.com> Date: Sat, 29 Oct 2022 15:56:30 +0530 Subject: [PATCH 097/751] Add test case for JSON resource marshaling (#2545) --- github/search_test.go | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/github/search_test.go b/github/search_test.go index b1973921cd7..bb62aa64d94 100644 --- a/github/search_test.go +++ b/github/search_test.go @@ -953,3 +953,39 @@ func TestCommitResult_Marshal(t *testing.T) { testJSONMarshal(t, c, want) } + +func TestUsersSearchResult_Marshal(t *testing.T) { + testJSONMarshal(t, &UsersSearchResult{}, "{}") + + u := &UsersSearchResult{ + Total: Int(2), + IncompleteResults: Bool(false), + Users: []*User{{ + Login: String("loginTest"), + ID: Int64(1), + NodeID: String("NodeTest"), + AvatarURL: String("AvatarURLTest"), + HTMLURL: String("Hurl"), + GravatarID: String("gravatarIDTest"), + Name: String("nameTest"), + }}, + } + + want := `{ + "total_count": 2, + "incomplete_results": false, + "items": [ + { + "login": "loginTest", + "id": 1, + "node_id": "NodeTest", + "avatar_url": "AvatarURLTest", + "html_url": "Hurl", + "gravatar_id": "gravatarIDTest", + "name": "nameTest" + } + ] + }` + + testJSONMarshal(t, u, want) +} From 282a391a7fa3706035c4b2c17ccb8f4451e5452b Mon Sep 17 00:00:00 2001 From: Akshay <48827972+akshaypatil3096@users.noreply.github.com> Date: Mon, 31 Oct 2022 01:27:47 +0530 Subject: [PATCH 098/751] Add test case for JSON resource marshaling (#2546) --- github/teams_members_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/github/teams_members_test.go b/github/teams_members_test.go index 61944567faf..5ef17351600 100644 --- a/github/teams_members_test.go +++ b/github/teams_members_test.go @@ -803,3 +803,23 @@ func TestTeamAddTeamMembershipOptions_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestTeamListTeamMembersOptions_Marshal(t *testing.T) { + testJSONMarshal(t, &TeamListTeamMembersOptions{}, "{}") + + u := &TeamListTeamMembersOptions{ + Role: "role", + ListOptions: ListOptions{ + Page: 1, + PerPage: 2, + }, + } + + want := `{ + "role": "role", + "Page": 1, + "PerPage": 2 + }` + + testJSONMarshal(t, u, want) +} From 5d388bdc7848131b4f840bf329cacb7f7172fb00 Mon Sep 17 00:00:00 2001 From: vaibhavgholap23 <91172267+vaibhavgholap23@users.noreply.github.com> Date: Tue, 1 Nov 2022 00:54:24 +0530 Subject: [PATCH 099/751] Add test case for JSON resource marshaling (#2548) --- github/users_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/github/users_test.go b/github/users_test.go index 204b31e1719..96b2e926f18 100644 --- a/github/users_test.go +++ b/github/users_test.go @@ -510,3 +510,19 @@ func TestUserListOptions_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestHovercardOptions_Marshal(t *testing.T) { + testJSONMarshal(t, &HovercardOptions{}, "{}") + + u := &HovercardOptions{ + SubjectType: "subjectType", + SubjectID: "subjectID", + } + + want := `{ + "SubjectType" : "subjectType", + "SubjectID" : "subjectID" + }` + + testJSONMarshal(t, u, want) +} From 434b1d888a22febd131a97de0ecf07e733093bc3 Mon Sep 17 00:00:00 2001 From: Sagar Sonwane <44731466+sagar23sj@users.noreply.github.com> Date: Tue, 1 Nov 2022 00:56:24 +0530 Subject: [PATCH 100/751] Add test case for JSON resource marshaling (#2549) --- github/repos_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/github/repos_test.go b/github/repos_test.go index 0d0633eee7b..bcaa7d3d615 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -3127,3 +3127,19 @@ func TestPullRequestReviewsEnforcementUpdate_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestRequiredStatusCheck_Marshal(t *testing.T) { + testJSONMarshal(t, &RequiredStatusCheck{}, "{}") + + u := &RequiredStatusCheck{ + Context: "ctx", + AppID: Int64(1), + } + + want := `{ + "context": "ctx", + "app_id": 1 + }` + + testJSONMarshal(t, u, want) +} From 377f63f222a54c8439be7c88d3bc3af9961ac454 Mon Sep 17 00:00:00 2001 From: Sagar Sonwane <44731466+sagar23sj@users.noreply.github.com> Date: Tue, 1 Nov 2022 00:57:51 +0530 Subject: [PATCH 101/751] Add test cases for JSON resource marshaling (#2550) --- github/search_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/github/search_test.go b/github/search_test.go index bb62aa64d94..8998681eaa6 100644 --- a/github/search_test.go +++ b/github/search_test.go @@ -989,3 +989,21 @@ func TestUsersSearchResult_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestCodeSearchResult_Marshal(t *testing.T) { + testJSONMarshal(t, &CodeSearchResult{}, "{}") + + u := &CodeSearchResult{ + Total: Int(4), + IncompleteResults: Bool(false), + CodeResults: []*CodeResult{{Name: String("n")}}, + } + + want := `{ + "total_count" : 4, + "incomplete_results" : false, + "items" : [{"name": "n"}] + }` + + testJSONMarshal(t, u, want) +} From 4e394ef01b1d0b287b147b26b7b4b98f79b434fa Mon Sep 17 00:00:00 2001 From: Sagar Sonwane <44731466+sagar23sj@users.noreply.github.com> Date: Tue, 1 Nov 2022 00:59:17 +0530 Subject: [PATCH 102/751] Add test case for JSON resource marshaling (#2551) --- github/teams_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/github/teams_test.go b/github/teams_test.go index 523e1bcd594..d267846ecba 100644 --- a/github/teams_test.go +++ b/github/teams_test.go @@ -2244,3 +2244,17 @@ func TestListExternalGroupsOptions_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestTeamAddTeamRepoOptions_Marshal(t *testing.T) { + testJSONMarshal(t, &TeamAddTeamRepoOptions{}, "{}") + + u := &TeamAddTeamRepoOptions{ + Permission: "a", + } + + want := `{ + "permission": "a" + }` + + testJSONMarshal(t, u, want) +} From 66a053ae547afd9a5495a6d6bd6a292ec55c1c1c Mon Sep 17 00:00:00 2001 From: Sagar Sonwane <44731466+sagar23sj@users.noreply.github.com> Date: Tue, 1 Nov 2022 01:00:32 +0530 Subject: [PATCH 103/751] Add test case for JSON resource marshaling (#2552) --- github/repos_tags_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/github/repos_tags_test.go b/github/repos_tags_test.go index e5e15a693c0..d1eb8aa90ae 100644 --- a/github/repos_tags_test.go +++ b/github/repos_tags_test.go @@ -130,3 +130,19 @@ func TestRepositoriesService_DeleteTagProtection(t *testing.T) { return client.Repositories.DeleteTagProtection(ctx, "o", "r", 1) }) } + +func TestTagProtection_Marshal(t *testing.T) { + testJSONMarshal(t, &TagProtection{}, "{}") + + u := &TagProtection{ + ID: Int64(1), + Pattern: String("pattern"), + } + + want := `{ + "id": 1, + "pattern": "pattern" + }` + + testJSONMarshal(t, u, want) +} From 3bfe921b88f23a981b4d6ec4771ffc19b6951b31 Mon Sep 17 00:00:00 2001 From: Jeremy Hayes Date: Tue, 1 Nov 2022 15:41:48 -0400 Subject: [PATCH 104/751] Add support for security manager endpoints (#2530) Fixes: #2529. --- github/orgs_security_managers.go | 57 ++++++++++ github/orgs_security_managers_test.go | 145 ++++++++++++++++++++++++++ 2 files changed, 202 insertions(+) create mode 100644 github/orgs_security_managers.go create mode 100644 github/orgs_security_managers_test.go diff --git a/github/orgs_security_managers.go b/github/orgs_security_managers.go new file mode 100644 index 00000000000..a3f002e0e1c --- /dev/null +++ b/github/orgs_security_managers.go @@ -0,0 +1,57 @@ +// 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" +) + +// ListSecurityManagerTeams lists all security manager teams for an organization. +// +// GitHub API docs: https://docs.github.com/en/rest/orgs/security-managers#list-security-manager-teams +func (s *OrganizationsService) ListSecurityManagerTeams(ctx context.Context, org string) ([]*Team, *Response, error) { + u := fmt.Sprintf("orgs/%v/security-managers", org) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var teams []*Team + resp, err := s.client.Do(ctx, req, &teams) + if err != nil { + return nil, resp, err + } + + return teams, resp, nil +} + +// AddSecurityManagerTeam adds a team to the list of security managers for an organization. +// +// GitHub API docs: https://docs.github.com/en/rest/orgs/security-managers#add-a-security-manager-team +func (s *OrganizationsService) AddSecurityManagerTeam(ctx context.Context, org, team string) (*Response, error) { + u := fmt.Sprintf("orgs/%v/security-managers/teams/%v", org, team) + req, err := s.client.NewRequest("PUT", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// RemoveSecurityManagerTeam removes a team from the list of security managers for an organization. +// +// GitHub API docs: https://docs.github.com/en/rest/orgs/security-managers#remove-a-security-manager-team +func (s *OrganizationsService) RemoveSecurityManagerTeam(ctx context.Context, org, team string) (*Response, error) { + u := fmt.Sprintf("orgs/%v/security-managers/teams/%v", org, team) + 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/orgs_security_managers_test.go b/github/orgs_security_managers_test.go new file mode 100644 index 00000000000..87fd9c69aa8 --- /dev/null +++ b/github/orgs_security_managers_test.go @@ -0,0 +1,145 @@ +// 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 TestOrganizationsService_ListSecurityManagerTeams(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/security-managers", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `[{"id":1}]`) + }) + + ctx := context.Background() + teams, _, err := client.Organizations.ListSecurityManagerTeams(ctx, "o") + if err != nil { + t.Errorf("Organizations.ListSecurityManagerTeams returned error: %v", err) + } + + want := []*Team{{ID: Int64(1)}} + if !cmp.Equal(teams, want) { + t.Errorf("Organizations.ListSecurityManagerTeams returned %+v, want %+v", teams, want) + } + + const methodName = "ListSecurityManagerTeams" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.ListSecurityManagerTeams(ctx, "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.ListSecurityManagerTeams(ctx, "o") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_ListSecurityManagerTeams_invalidOrg(t *testing.T) { + client, _, _, teardown := setup() + defer teardown() + + ctx := context.Background() + _, _, err := client.Organizations.ListSecurityManagerTeams(ctx, "%") + testURLParseError(t, err) +} + +func TestOrganizationsService_AddSecurityManagerTeam(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/security-managers/teams/t", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + }) + + ctx := context.Background() + _, err := client.Organizations.AddSecurityManagerTeam(ctx, "o", "t") + if err != nil { + t.Errorf("Organizations.AddSecurityManagerTeam returned error: %v", err) + } + + const methodName = "AddSecurityManagerTeam" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Organizations.AddSecurityManagerTeam(ctx, "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Organizations.AddSecurityManagerTeam(ctx, "o", "t") + }) +} + +func TestOrganizationsService_AddSecurityManagerTeam_invalidOrg(t *testing.T) { + client, _, _, teardown := setup() + defer teardown() + + ctx := context.Background() + _, err := client.Organizations.AddSecurityManagerTeam(ctx, "%", "t") + testURLParseError(t, err) +} + +func TestOrganizationsService_AddSecurityManagerTeam_invalidTeam(t *testing.T) { + client, _, _, teardown := setup() + defer teardown() + + ctx := context.Background() + _, err := client.Organizations.AddSecurityManagerTeam(ctx, "%", "t") + testURLParseError(t, err) +} + +func TestOrganizationsService_RemoveSecurityManagerTeam(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/security-managers/teams/t", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + }) + + ctx := context.Background() + _, err := client.Organizations.RemoveSecurityManagerTeam(ctx, "o", "t") + if err != nil { + t.Errorf("Organizations.RemoveSecurityManagerTeam returned error: %v", err) + } + + const methodName = "RemoveSecurityManagerTeam" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Organizations.RemoveSecurityManagerTeam(ctx, "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Organizations.RemoveSecurityManagerTeam(ctx, "o", "t") + }) +} + +func TestOrganizationsService_RemoveSecurityManagerTeam_invalidOrg(t *testing.T) { + client, _, _, teardown := setup() + defer teardown() + + ctx := context.Background() + _, err := client.Organizations.RemoveSecurityManagerTeam(ctx, "%", "t") + testURLParseError(t, err) +} + +func TestOrganizationsService_RemoveSecurityManagerTeam_invalidTeam(t *testing.T) { + client, _, _, teardown := setup() + defer teardown() + + ctx := context.Background() + _, err := client.Organizations.RemoveSecurityManagerTeam(ctx, "%", "t") + testURLParseError(t, err) +} From 020d9ae4fb06fdaf547786a0334584822ce15b59 Mon Sep 17 00:00:00 2001 From: Jarek Porzucek <17789797+jporzucek@users.noreply.github.com> Date: Fri, 4 Nov 2022 12:54:49 +0100 Subject: [PATCH 105/751] Add support for cursor pagination in AlertListOptions (#2512) Fixes: #2511. --- github/code-scanning.go | 4 ++ github/code-scanning_test.go | 126 +++++++++++++++++++++++++++++++++++ 2 files changed, 130 insertions(+) diff --git a/github/code-scanning.go b/github/code-scanning.go index df8ed86b51d..f05420829ea 100644 --- a/github/code-scanning.go +++ b/github/code-scanning.go @@ -121,6 +121,10 @@ type AlertListOptions struct { // Return code scanning alerts for a specific branch reference. The ref must be formatted as heads/. Ref string `url:"ref,omitempty"` + ListCursorOptions + + // Add ListOptions so offset pagination with integer type "page" query parameter is accepted + // since ListCursorOptions accepts "page" as string only. ListOptions } diff --git a/github/code-scanning_test.go b/github/code-scanning_test.go index 6e3fc6bb1ab..c8cf35cfbaf 100644 --- a/github/code-scanning_test.go +++ b/github/code-scanning_test.go @@ -293,6 +293,132 @@ func TestCodeScanningService_ListAlertsForOrg(t *testing.T) { }) } +func TestCodeScanningService_ListAlertsForOrgLisCursorOptions(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/code-scanning/alerts", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{"state": "open", "ref": "heads/master", "per_page": "1", "before": "deadbeefb", "after": "deadbeefa"}) + fmt.Fprint(w, `[{ + "repository": { + "id": 1, + "name": "n", + "url": "url" + }, + "rule_id":"js/trivial-conditional", + "rule_severity":"warning", + "rule_description":"Useless conditional", + "tool": { + "name": "CodeQL", + "guid": null, + "version": "1.4.0" + }, + "rule": { + "id": "js/trivial-conditional", + "severity": "warning", + "description": "Useless conditional", + "name": "js/trivial-conditional", + "full_description": "Expression has no effect", + "help": "Expression has no effect" + }, + "most_recent_instance": { + "ref": "refs/heads/main", + "state": "open", + "commit_sha": "abcdefg12345", + "message": { + "text": "This path depends on a user-provided value." + }, + "location": { + "path": "spec-main/api-session-spec.ts", + "start_line": 917, + "end_line": 917, + "start_column": 7, + "end_column": 18 + }, + "classifications": [ + "test" + ] + }, + "created_at":"2020-05-06T12:00:00Z", + "state":"open", + "closed_by":null, + "closed_at":null, + "url":"https://api.github.com/repos/o/r/code-scanning/alerts/25", + "html_url":"https://github.com/o/r/security/code-scanning/25" + }]`) + }) + + opts := &AlertListOptions{State: "open", Ref: "heads/master", ListCursorOptions: ListCursorOptions{PerPage: 1, Before: "deadbeefb", After: "deadbeefa"}} + ctx := context.Background() + alerts, _, err := client.CodeScanning.ListAlertsForOrg(ctx, "o", opts) + if err != nil { + t.Errorf("CodeScanning.ListAlertsForOrg returned error: %v", err) + } + + date := Timestamp{time.Date(2020, time.May, 06, 12, 00, 00, 0, time.UTC)} + want := []*Alert{ + { + Repository: &Repository{ + ID: Int64(1), + URL: String("url"), + Name: String("n"), + }, + RuleID: String("js/trivial-conditional"), + RuleSeverity: String("warning"), + RuleDescription: String("Useless conditional"), + Tool: &Tool{Name: String("CodeQL"), GUID: nil, Version: String("1.4.0")}, + Rule: &Rule{ + ID: String("js/trivial-conditional"), + Severity: String("warning"), + Description: String("Useless conditional"), + Name: String("js/trivial-conditional"), + FullDescription: String("Expression has no effect"), + Help: String("Expression has no effect"), + }, + CreatedAt: &date, + State: String("open"), + ClosedBy: nil, + ClosedAt: nil, + URL: String("https://api.github.com/repos/o/r/code-scanning/alerts/25"), + HTMLURL: String("https://github.com/o/r/security/code-scanning/25"), + MostRecentInstance: &MostRecentInstance{ + Ref: String("refs/heads/main"), + State: String("open"), + CommitSHA: String("abcdefg12345"), + Message: &Message{ + Text: String("This path depends on a user-provided value."), + }, + Location: &Location{ + Path: String("spec-main/api-session-spec.ts"), + StartLine: Int(917), + EndLine: Int(917), + StartColumn: Int(7), + EndColumn: Int(18), + }, + Classifications: []string{"test"}, + }, + }, + } + if !cmp.Equal(alerts, want) { + t.Errorf("CodeScanning.ListAlertsForOrg returned %+v, want %+v", *&alerts, *&want) + } + + const methodName = "ListAlertsForOrg" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.CodeScanning.ListAlertsForOrg(ctx, "\n", opts) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.CodeScanning.ListAlertsForOrg(ctx, "o", opts) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + func TestCodeScanningService_ListAlertsForRepo(t *testing.T) { client, mux, _, teardown := setup() defer teardown() From 16cdd7dcf40e59238cc1012982bda052d68812bf Mon Sep 17 00:00:00 2001 From: Luke Young <91491244+lyoung-confluent@users.noreply.github.com> Date: Fri, 4 Nov 2022 23:56:00 -0700 Subject: [PATCH 106/751] Add merge_group webhook event via MergeGroupEvent and MergeGroup structs (#2556) --- github/event.go | 2 + github/event_types.go | 31 ++++ github/event_types_test.go | 292 ++++++++++++++++++++++++++++++++ github/github-accessors.go | 88 ++++++++++ github/github-accessors_test.go | 92 ++++++++++ github/messages.go | 1 + github/messages_test.go | 4 + 7 files changed, 510 insertions(+) diff --git a/github/event.go b/github/event.go index 4cacf0a83f7..5b2312fb354 100644 --- a/github/event.go +++ b/github/event.go @@ -76,6 +76,8 @@ func (e *Event) ParsePayload() (payload interface{}, err error) { payload = &MemberEvent{} case "MembershipEvent": payload = &MembershipEvent{} + case "MergeGroupEvent": + payload = &MergeGroupEvent{} case "MetaEvent": payload = &MetaEvent{} case "MilestoneEvent": diff --git a/github/event_types.go b/github/event_types.go index b550361848c..6c59b7b5323 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -559,6 +559,37 @@ type MembershipEvent struct { Installation *Installation `json:"installation,omitempty"` } +// MergeGroup represents the merge group in a merge queue. +type MergeGroup struct { + // The SHA of the merge group. + HeadSHA *string `json:"head_sha,omitempty"` + // The full ref of the merge group. + HeadRef *string `json:"head_ref,omitempty"` + // The SHA of the merge group's parent commit. + BaseSHA *string `json:"base_sha,omitempty"` + // The full ref of the branch the merge group will be merged into. + BaseRef *string `json:"base_ref,omitempty"` + // An expanded representation of the head_sha commit. + HeadCommit *Commit `json:"head_commit,omitempty"` +} + +// MergeGroupEvent represents activity related to merge groups in a merge queue. The type of activity is specified +// in the action property of the payload object. +// +// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#merge_group +type MergeGroupEvent struct { + // The action that was performed. Currently, can only be checks_requested. + Action *string `json:"action,omitempty"` + // The merge group. + MergeGroup *MergeGroup `json:"merge_group,omitempty"` + + // The following fields are only populated by Webhook events. + Repo *Repository `json:"repository,omitempty"` + Org *Organization `json:"organization,omitempty"` + Installation *Installation `json:"installation,omitempty"` + Sender *User `json:"sender,omitempty"` +} + // MetaEvent is triggered when the webhook that this event is configured on is deleted. // This event will only listen for changes to the particular hook the event is installed on. // Therefore, it must be selected for each hook that you'd like to receive meta events for. diff --git a/github/event_types_test.go b/github/event_types_test.go index e74adb30724..8cd08688368 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -8233,6 +8233,298 @@ func TestMembershipEvent_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } +func TestMergeGroupEvent_Marshal(t *testing.T) { + testJSONMarshal(t, &MergeGroupEvent{}, "{}") + + u := &MergeGroupEvent{ + Action: String("a"), + MergeGroup: &MergeGroup{ + HeadSHA: String("hs"), + HeadRef: String("hr"), + BaseSHA: String("bs"), + BaseRef: String("br"), + HeadCommit: &Commit{NodeID: String("nid")}, + }, + Repo: &Repository{ + ID: Int64(1), + URL: String("s"), + Name: String("n"), + }, + Org: &Organization{ + BillingEmail: String("be"), + Blog: String("b"), + Company: String("c"), + Email: String("e"), + TwitterUsername: String("tu"), + Location: String("loc"), + Name: String("n"), + Description: String("d"), + IsVerified: Bool(true), + HasOrganizationProjects: Bool(true), + HasRepositoryProjects: Bool(true), + DefaultRepoPermission: String("drp"), + MembersCanCreateRepos: Bool(true), + MembersCanCreateInternalRepos: Bool(true), + MembersCanCreatePrivateRepos: Bool(true), + MembersCanCreatePublicRepos: Bool(false), + MembersAllowedRepositoryCreationType: String("marct"), + MembersCanCreatePages: Bool(true), + MembersCanCreatePublicPages: Bool(false), + MembersCanCreatePrivatePages: Bool(true), + }, + Sender: &User{ + Login: String("l"), + ID: Int64(1), + NodeID: String("n"), + URL: String("u"), + ReposURL: String("r"), + EventsURL: String("e"), + AvatarURL: String("a"), + }, + Installation: &Installation{ + ID: Int64(1), + NodeID: String("nid"), + AppID: Int64(1), + AppSlug: String("as"), + TargetID: Int64(1), + Account: &User{ + Login: String("l"), + ID: Int64(1), + URL: String("u"), + AvatarURL: String("a"), + GravatarID: String("g"), + Name: String("n"), + Company: String("c"), + Blog: String("b"), + Location: String("l"), + Email: String("e"), + Hireable: Bool(true), + Bio: String("b"), + TwitterUsername: String("t"), + PublicRepos: Int(1), + Followers: Int(1), + Following: Int(1), + CreatedAt: &Timestamp{referenceTime}, + SuspendedAt: &Timestamp{referenceTime}, + }, + AccessTokensURL: String("atu"), + RepositoriesURL: String("ru"), + HTMLURL: String("hu"), + TargetType: String("tt"), + SingleFileName: String("sfn"), + RepositorySelection: String("rs"), + Events: []string{"e"}, + SingleFilePaths: []string{"s"}, + Permissions: &InstallationPermissions{ + Actions: String("a"), + Administration: String("ad"), + Checks: String("c"), + Contents: String("co"), + ContentReferences: String("cr"), + Deployments: String("d"), + Environments: String("e"), + Issues: String("i"), + Metadata: String("md"), + Members: String("m"), + OrganizationAdministration: String("oa"), + OrganizationHooks: String("oh"), + OrganizationPlan: String("op"), + OrganizationPreReceiveHooks: String("opr"), + OrganizationProjects: String("op"), + OrganizationSecrets: String("os"), + OrganizationSelfHostedRunners: String("osh"), + OrganizationUserBlocking: String("oub"), + Packages: String("pkg"), + Pages: String("pg"), + PullRequests: String("pr"), + RepositoryHooks: String("rh"), + RepositoryProjects: String("rp"), + RepositoryPreReceiveHooks: String("rprh"), + Secrets: String("s"), + SecretScanningAlerts: String("ssa"), + SecurityEvents: String("se"), + SingleFile: String("sf"), + Statuses: String("s"), + TeamDiscussions: String("td"), + VulnerabilityAlerts: String("va"), + Workflows: String("w"), + }, + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + HasMultipleSingleFiles: Bool(false), + SuspendedBy: &User{ + Login: String("l"), + ID: Int64(1), + URL: String("u"), + AvatarURL: String("a"), + GravatarID: String("g"), + Name: String("n"), + Company: String("c"), + Blog: String("b"), + Location: String("l"), + Email: String("e"), + Hireable: Bool(true), + Bio: String("b"), + TwitterUsername: String("t"), + PublicRepos: Int(1), + Followers: Int(1), + Following: Int(1), + CreatedAt: &Timestamp{referenceTime}, + SuspendedAt: &Timestamp{referenceTime}, + }, + SuspendedAt: &Timestamp{referenceTime}, + }, + } + + want := `{ + "action": "a", + "merge_group": { + "head_sha": "hs", + "head_ref": "hr", + "base_sha": "bs", + "base_ref": "br", + "head_commit": { + "node_id": "nid" + } + }, + "repository": { + "id": 1, + "name": "n", + "url": "s" + }, + "organization": { + "name": "n", + "company": "c", + "blog": "b", + "location": "loc", + "email": "e", + "twitter_username": "tu", + "description": "d", + "billing_email": "be", + "is_verified": true, + "has_organization_projects": true, + "has_repository_projects": true, + "default_repository_permission": "drp", + "members_can_create_repositories": true, + "members_can_create_public_repositories": false, + "members_can_create_private_repositories": true, + "members_can_create_internal_repositories": true, + "members_allowed_repository_creation_type": "marct", + "members_can_create_pages": true, + "members_can_create_public_pages": false, + "members_can_create_private_pages": true + }, + "sender": { + "login": "l", + "id": 1, + "node_id": "n", + "avatar_url": "a", + "url": "u", + "events_url": "e", + "repos_url": "r" + }, + "installation": { + "id": 1, + "node_id": "nid", + "app_id": 1, + "app_slug": "as", + "target_id": 1, + "account": { + "login": "l", + "id": 1, + "avatar_url": "a", + "gravatar_id": "g", + "name": "n", + "company": "c", + "blog": "b", + "location": "l", + "email": "e", + "hireable": true, + "bio": "b", + "twitter_username": "t", + "public_repos": 1, + "followers": 1, + "following": 1, + "created_at": ` + referenceTimeStr + `, + "suspended_at": ` + referenceTimeStr + `, + "url": "u" + }, + "access_tokens_url": "atu", + "repositories_url": "ru", + "html_url": "hu", + "target_type": "tt", + "single_file_name": "sfn", + "repository_selection": "rs", + "events": [ + "e" + ], + "single_file_paths": [ + "s" + ], + "permissions": { + "actions": "a", + "administration": "ad", + "checks": "c", + "contents": "co", + "content_references": "cr", + "deployments": "d", + "environments": "e", + "issues": "i", + "metadata": "md", + "members": "m", + "organization_administration": "oa", + "organization_hooks": "oh", + "organization_plan": "op", + "organization_pre_receive_hooks": "opr", + "organization_projects": "op", + "organization_secrets": "os", + "organization_self_hosted_runners": "osh", + "organization_user_blocking": "oub", + "packages": "pkg", + "pages": "pg", + "pull_requests": "pr", + "repository_hooks": "rh", + "repository_projects": "rp", + "repository_pre_receive_hooks": "rprh", + "secrets": "s", + "secret_scanning_alerts": "ssa", + "security_events": "se", + "single_file": "sf", + "statuses": "s", + "team_discussions": "td", + "vulnerability_alerts": "va", + "workflows": "w" + }, + "created_at": ` + referenceTimeStr + `, + "updated_at": ` + referenceTimeStr + `, + "has_multiple_single_files": false, + "suspended_by": { + "login": "l", + "id": 1, + "avatar_url": "a", + "gravatar_id": "g", + "name": "n", + "company": "c", + "blog": "b", + "location": "l", + "email": "e", + "hireable": true, + "bio": "b", + "twitter_username": "t", + "public_repos": 1, + "followers": 1, + "following": 1, + "created_at": ` + referenceTimeStr + `, + "suspended_at": ` + referenceTimeStr + `, + "url": "u" + }, + "suspended_at": ` + referenceTimeStr + ` + } + }` + + testJSONMarshal(t, u, want) +} + func TestOrgBlockEvent_Marshal(t *testing.T) { testJSONMarshal(t, &OrgBlockEvent{}, "{}") diff --git a/github/github-accessors.go b/github/github-accessors.go index f91f9a93ba4..3f510b9ec12 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -8870,6 +8870,94 @@ func (m *MembershipEvent) GetTeam() *Team { return m.Team } +// GetBaseRef returns the BaseRef field if it's non-nil, zero value otherwise. +func (m *MergeGroup) GetBaseRef() string { + if m == nil || m.BaseRef == nil { + return "" + } + return *m.BaseRef +} + +// GetBaseSHA returns the BaseSHA field if it's non-nil, zero value otherwise. +func (m *MergeGroup) GetBaseSHA() string { + if m == nil || m.BaseSHA == nil { + return "" + } + return *m.BaseSHA +} + +// GetHeadCommit returns the HeadCommit field. +func (m *MergeGroup) GetHeadCommit() *Commit { + if m == nil { + return nil + } + return m.HeadCommit +} + +// GetHeadRef returns the HeadRef field if it's non-nil, zero value otherwise. +func (m *MergeGroup) GetHeadRef() string { + if m == nil || m.HeadRef == nil { + return "" + } + return *m.HeadRef +} + +// GetHeadSHA returns the HeadSHA field if it's non-nil, zero value otherwise. +func (m *MergeGroup) GetHeadSHA() string { + if m == nil || m.HeadSHA == nil { + return "" + } + return *m.HeadSHA +} + +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (m *MergeGroupEvent) GetAction() string { + if m == nil || m.Action == nil { + return "" + } + return *m.Action +} + +// GetInstallation returns the Installation field. +func (m *MergeGroupEvent) GetInstallation() *Installation { + if m == nil { + return nil + } + return m.Installation +} + +// GetMergeGroup returns the MergeGroup field. +func (m *MergeGroupEvent) GetMergeGroup() *MergeGroup { + if m == nil { + return nil + } + return m.MergeGroup +} + +// GetOrg returns the Org field. +func (m *MergeGroupEvent) GetOrg() *Organization { + if m == nil { + return nil + } + return m.Org +} + +// GetRepo returns the Repo field. +func (m *MergeGroupEvent) GetRepo() *Repository { + if m == nil { + return nil + } + return m.Repo +} + +// GetSender returns the Sender field. +func (m *MergeGroupEvent) GetSender() *User { + if m == nil { + return nil + } + return m.Sender +} + // GetText returns the Text field if it's non-nil, zero value otherwise. func (m *Message) GetText() string { if m == nil || m.Text == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 3fee246979d..0a3d0ed18bc 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -10389,6 +10389,98 @@ func TestMembershipEvent_GetTeam(tt *testing.T) { m.GetTeam() } +func TestMergeGroup_GetBaseRef(tt *testing.T) { + var zeroValue string + m := &MergeGroup{BaseRef: &zeroValue} + m.GetBaseRef() + m = &MergeGroup{} + m.GetBaseRef() + m = nil + m.GetBaseRef() +} + +func TestMergeGroup_GetBaseSHA(tt *testing.T) { + var zeroValue string + m := &MergeGroup{BaseSHA: &zeroValue} + m.GetBaseSHA() + m = &MergeGroup{} + m.GetBaseSHA() + m = nil + m.GetBaseSHA() +} + +func TestMergeGroup_GetHeadCommit(tt *testing.T) { + m := &MergeGroup{} + m.GetHeadCommit() + m = nil + m.GetHeadCommit() +} + +func TestMergeGroup_GetHeadRef(tt *testing.T) { + var zeroValue string + m := &MergeGroup{HeadRef: &zeroValue} + m.GetHeadRef() + m = &MergeGroup{} + m.GetHeadRef() + m = nil + m.GetHeadRef() +} + +func TestMergeGroup_GetHeadSHA(tt *testing.T) { + var zeroValue string + m := &MergeGroup{HeadSHA: &zeroValue} + m.GetHeadSHA() + m = &MergeGroup{} + m.GetHeadSHA() + m = nil + m.GetHeadSHA() +} + +func TestMergeGroupEvent_GetAction(tt *testing.T) { + var zeroValue string + m := &MergeGroupEvent{Action: &zeroValue} + m.GetAction() + m = &MergeGroupEvent{} + m.GetAction() + m = nil + m.GetAction() +} + +func TestMergeGroupEvent_GetInstallation(tt *testing.T) { + m := &MergeGroupEvent{} + m.GetInstallation() + m = nil + m.GetInstallation() +} + +func TestMergeGroupEvent_GetMergeGroup(tt *testing.T) { + m := &MergeGroupEvent{} + m.GetMergeGroup() + m = nil + m.GetMergeGroup() +} + +func TestMergeGroupEvent_GetOrg(tt *testing.T) { + m := &MergeGroupEvent{} + m.GetOrg() + m = nil + m.GetOrg() +} + +func TestMergeGroupEvent_GetRepo(tt *testing.T) { + m := &MergeGroupEvent{} + m.GetRepo() + m = nil + m.GetRepo() +} + +func TestMergeGroupEvent_GetSender(tt *testing.T) { + m := &MergeGroupEvent{} + m.GetSender() + m = nil + m.GetSender() +} + func TestMessage_GetText(tt *testing.T) { var zeroValue string m := &Message{Text: &zeroValue} diff --git a/github/messages.go b/github/messages.go index 320bd734226..e26b13e7b6f 100644 --- a/github/messages.go +++ b/github/messages.go @@ -68,6 +68,7 @@ var ( "marketplace_purchase": "MarketplacePurchaseEvent", "member": "MemberEvent", "membership": "MembershipEvent", + "merge_group": "MergeGroupEvent", "meta": "MetaEvent", "milestone": "MilestoneEvent", "organization": "OrganizationEvent", diff --git a/github/messages_test.go b/github/messages_test.go index 083cec9a413..9819ddbe616 100644 --- a/github/messages_test.go +++ b/github/messages_test.go @@ -353,6 +353,10 @@ func TestParseWebHook(t *testing.T) { payload: &MembershipEvent{}, messageType: "membership", }, + { + payload: &MergeGroupEvent{}, + messageType: "merge_group", + }, { payload: &MetaEvent{}, messageType: "meta", From 331265b611a992d9ef2560446983f225cc9603c6 Mon Sep 17 00:00:00 2001 From: ganeshkumarsv <53483484+ganeshkumarsv@users.noreply.github.com> Date: Sun, 6 Nov 2022 22:35:11 -0500 Subject: [PATCH 107/751] Code Scanning: add new field for dismissed comment (#2557) --- github/code-scanning.go | 1 + github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ 3 files changed, 19 insertions(+) diff --git a/github/code-scanning.go b/github/code-scanning.go index f05420829ea..53200fa3eeb 100644 --- a/github/code-scanning.go +++ b/github/code-scanning.go @@ -87,6 +87,7 @@ type Alert struct { DismissedBy *User `json:"dismissed_by,omitempty"` DismissedAt *Timestamp `json:"dismissed_at,omitempty"` DismissedReason *string `json:"dismissed_reason,omitempty"` + DismissedComment *string `json:"dismissed_comment,omitempty"` InstancesURL *string `json:"instances_url,omitempty"` } diff --git a/github/github-accessors.go b/github/github-accessors.go index 3f510b9ec12..ca558f63951 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -302,6 +302,14 @@ func (a *Alert) GetDismissedBy() *User { return a.DismissedBy } +// GetDismissedComment returns the DismissedComment field if it's non-nil, zero value otherwise. +func (a *Alert) GetDismissedComment() string { + if a == nil || a.DismissedComment == nil { + return "" + } + return *a.DismissedComment +} + // GetDismissedReason returns the DismissedReason field if it's non-nil, zero value otherwise. func (a *Alert) GetDismissedReason() string { if a == nil || a.DismissedReason == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 0a3d0ed18bc..7cc7834acb0 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -333,6 +333,16 @@ func TestAlert_GetDismissedBy(tt *testing.T) { a.GetDismissedBy() } +func TestAlert_GetDismissedComment(tt *testing.T) { + var zeroValue string + a := &Alert{DismissedComment: &zeroValue} + a.GetDismissedComment() + a = &Alert{} + a.GetDismissedComment() + a = nil + a.GetDismissedComment() +} + func TestAlert_GetDismissedReason(tt *testing.T) { var zeroValue string a := &Alert{DismissedReason: &zeroValue} From 959861361f1d87d4e034f4a06b907a92d053ab24 Mon Sep 17 00:00:00 2001 From: Austin Vazquez <55906459+austinvazquez@users.noreply.github.com> Date: Mon, 7 Nov 2022 10:41:12 -0600 Subject: [PATCH 108/751] Remove references to io/ioutil package (#2547) --- example/commitpr/main.go | 3 +-- example/newfilewithappauth/main.go | 4 ++-- github/gen-accessors.go | 3 +-- github/gen-stringify-test.go | 3 +-- github/git_trees_test.go | 8 ++++---- github/github.go | 9 ++++----- github/github_test.go | 26 +++++++++++++------------- github/messages.go | 5 ++--- github/repos_contents_test.go | 10 +++++----- github/repos_pages_test.go | 4 ++-- github/repos_releases_test.go | 6 +++--- github/teams_test.go | 6 +++--- test/integration/repos_test.go | 3 +-- update-urls/main.go | 8 ++++---- 14 files changed, 46 insertions(+), 52 deletions(-) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index 0a86414dd56..1d60625d1c8 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -25,7 +25,6 @@ import ( "errors" "flag" "fmt" - "io/ioutil" "log" "os" "strings" @@ -118,7 +117,7 @@ func getFileContent(fileArg string) (targetName string, b []byte, err error) { targetName = files[1] } - b, err = ioutil.ReadFile(localFile) + b, err = os.ReadFile(localFile) return targetName, b, err } diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index f6e9c572e5b..a448a056f53 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -10,9 +10,9 @@ package main import ( "context" - "io/ioutil" "log" "net/http" + "os" "time" "github.com/bradleyfalzon/ghinstallation/v2" @@ -23,7 +23,7 @@ import ( func main() { const gitHost = "https://git.api.com" - privatePem, err := ioutil.ReadFile("path/to/pem") + privatePem, err := os.ReadFile("path/to/pem") if err != nil { log.Fatalf("failed to read pem: %v", err) } diff --git a/github/gen-accessors.go b/github/gen-accessors.go index d8136d2c5c2..b222465f39f 100644 --- a/github/gen-accessors.go +++ b/github/gen-accessors.go @@ -21,7 +21,6 @@ import ( "go/format" "go/parser" "go/token" - "io/ioutil" "log" "os" "sort" @@ -190,7 +189,7 @@ func (t *templateData) dump() error { return fmt.Errorf("os.Chmod(%q, 0644): %v", filename, err) } - if err := ioutil.WriteFile(filename, clean, 0444); err != nil { + if err := os.WriteFile(filename, clean, 0444); err != nil { return err } diff --git a/github/gen-stringify-test.go b/github/gen-stringify-test.go index 71783fe5781..5a42082b93d 100644 --- a/github/gen-stringify-test.go +++ b/github/gen-stringify-test.go @@ -24,7 +24,6 @@ import ( "go/format" "go/parser" "go/token" - "io/ioutil" "log" "os" "strings" @@ -356,7 +355,7 @@ func (t *templateData) dump() error { return fmt.Errorf("os.Chmod(%q, 0644): %v", t.filename, err) } - if err := ioutil.WriteFile(t.filename, clean, 0444); err != nil { + if err := os.WriteFile(t.filename, clean, 0444); err != nil { return err } diff --git a/github/git_trees_test.go b/github/git_trees_test.go index 692272f9df5..25e5f2aeec6 100644 --- a/github/git_trees_test.go +++ b/github/git_trees_test.go @@ -9,7 +9,7 @@ import ( "bytes" "context" "fmt" - "io/ioutil" + "io" "net/http" "testing" @@ -106,7 +106,7 @@ func TestGitService_CreateTree(t *testing.T) { } mux.HandleFunc("/repos/o/r/git/trees", func(w http.ResponseWriter, r *http.Request) { - got, err := ioutil.ReadAll(r.Body) + got, err := io.ReadAll(r.Body) if err != nil { t.Fatalf("unable to read body: %v", err) } @@ -184,7 +184,7 @@ func TestGitService_CreateTree_Content(t *testing.T) { } mux.HandleFunc("/repos/o/r/git/trees", func(w http.ResponseWriter, r *http.Request) { - got, err := ioutil.ReadAll(r.Body) + got, err := io.ReadAll(r.Body) if err != nil { t.Fatalf("unable to read body: %v", err) } @@ -264,7 +264,7 @@ func TestGitService_CreateTree_Delete(t *testing.T) { } mux.HandleFunc("/repos/o/r/git/trees", func(w http.ResponseWriter, r *http.Request) { - got, err := ioutil.ReadAll(r.Body) + got, err := io.ReadAll(r.Body) if err != nil { t.Fatalf("unable to read body: %v", err) } diff --git a/github/github.go b/github/github.go index 2883c380503..9f8fd530169 100644 --- a/github/github.go +++ b/github/github.go @@ -15,7 +15,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "net/http" "net/url" "reflect" @@ -710,7 +709,7 @@ func (c *Client) BareDo(ctx context.Context, req *http.Request) (*Response, erro // Issue #1022 aerr, ok := err.(*AcceptedError) if ok { - b, readErr := ioutil.ReadAll(resp.Body) + b, readErr := io.ReadAll(resp.Body) if readErr != nil { return response, readErr } @@ -770,7 +769,7 @@ func (c *Client) checkRateLimitBeforeDo(req *http.Request, rateLimitCategory rat StatusCode: http.StatusForbidden, Request: req, Header: make(http.Header), - Body: ioutil.NopCloser(strings.NewReader("")), + Body: io.NopCloser(strings.NewReader("")), } return &RateLimitError{ Rate: rate, @@ -1032,14 +1031,14 @@ func CheckResponse(r *http.Response) error { } errorResponse := &ErrorResponse{Response: r} - data, err := ioutil.ReadAll(r.Body) + data, err := io.ReadAll(r.Body) if err == nil && data != nil { json.Unmarshal(data, errorResponse) } // Re-populate error response body because GitHub error responses are often // undocumented and inconsistent. // Issue #1136, #540. - r.Body = ioutil.NopCloser(bytes.NewBuffer(data)) + r.Body = io.NopCloser(bytes.NewBuffer(data)) switch { case r.StatusCode == http.StatusUnauthorized && strings.HasPrefix(r.Header.Get(headerOTP), "required"): return (*TwoFactorAuthError)(errorResponse) diff --git a/github/github_test.go b/github/github_test.go index d8b6a74d19d..c4ceb89bb54 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -10,7 +10,7 @@ import ( "encoding/json" "errors" "fmt" - "io/ioutil" + "io" "net/http" "net/http/httptest" "net/url" @@ -70,7 +70,7 @@ func setup() (client *Client, mux *http.ServeMux, serverURL string, teardown fun // directory, and create the file in that directory. It is the caller's // responsibility to remove the directory and its contents when no longer needed. func openTestFile(name, content string) (file *os.File, dir string, err error) { - dir, err = ioutil.TempDir("", "go-github") + dir, err = os.MkdirTemp("", "go-github") if err != nil { return nil, dir, err } @@ -133,7 +133,7 @@ func testURLParseError(t *testing.T, err error) { func testBody(t *testing.T, r *http.Request, want string) { t.Helper() - b, err := ioutil.ReadAll(r.Body) + b, err := io.ReadAll(r.Body) if err != nil { t.Errorf("Error reading request body: %v", err) } @@ -502,7 +502,7 @@ func TestNewRequest(t *testing.T) { } // test that body was JSON encoded - body, _ := ioutil.ReadAll(req.Body) + body, _ := io.ReadAll(req.Body) if got, want := string(body), outBody; got != want { t.Errorf("NewRequest(%q) Body is %v, want %v", inBody, got, want) } @@ -617,7 +617,7 @@ func TestNewFormRequest(t *testing.T) { } // test that body was form encoded - body, _ := ioutil.ReadAll(req.Body) + body, _ := io.ReadAll(req.Body) if got, want := string(body), outBody; got != want { t.Errorf("NewFormRequest(%q) Body is %v, want %v", inBody, got, want) } @@ -1398,7 +1398,7 @@ func TestCheckResponse(t *testing.T) { res := &http.Response{ Request: &http.Request{}, StatusCode: http.StatusBadRequest, - Body: ioutil.NopCloser(strings.NewReader(`{"message":"m", + Body: io.NopCloser(strings.NewReader(`{"message":"m", "errors": [{"resource": "r", "field": "f", "code": "c"}], "block": {"reason": "dmca", "created_at": "2016-03-17T15:39:46Z"}}`)), } @@ -1427,7 +1427,7 @@ func TestCheckResponse_RateLimit(t *testing.T) { Request: &http.Request{}, StatusCode: http.StatusForbidden, Header: http.Header{}, - Body: ioutil.NopCloser(strings.NewReader(`{"message":"m", + Body: io.NopCloser(strings.NewReader(`{"message":"m", "documentation_url": "url"}`)), } res.Header.Set(headerRateLimit, "60") @@ -1454,7 +1454,7 @@ func TestCheckResponse_AbuseRateLimit(t *testing.T) { res := &http.Response{ Request: &http.Request{}, StatusCode: http.StatusForbidden, - Body: ioutil.NopCloser(strings.NewReader(`{"message":"m", + Body: io.NopCloser(strings.NewReader(`{"message":"m", "documentation_url": "docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits"}`)), } err := CheckResponse(res).(*AbuseRateLimitError) @@ -1847,7 +1847,7 @@ func TestCheckResponse_noBody(t *testing.T) { res := &http.Response{ Request: &http.Request{}, StatusCode: http.StatusBadRequest, - Body: ioutil.NopCloser(strings.NewReader("")), + Body: io.NopCloser(strings.NewReader("")), } err := CheckResponse(res).(*ErrorResponse) @@ -1868,7 +1868,7 @@ func TestCheckResponse_unexpectedErrorStructure(t *testing.T) { res := &http.Response{ Request: &http.Request{}, StatusCode: http.StatusBadRequest, - Body: ioutil.NopCloser(strings.NewReader(httpBody)), + Body: io.NopCloser(strings.NewReader(httpBody)), } err := CheckResponse(res).(*ErrorResponse) @@ -1884,7 +1884,7 @@ func TestCheckResponse_unexpectedErrorStructure(t *testing.T) { if !errors.Is(err, want) { t.Errorf("Error = %#v, want %#v", err, want) } - data, err2 := ioutil.ReadAll(err.Response.Body) + data, err2 := io.ReadAll(err.Response.Body) if err2 != nil { t.Fatalf("failed to read response body: %v", err) } @@ -2373,9 +2373,9 @@ func TestBareDo_returnsOpenBody(t *testing.T) { t.Fatalf("client.BareDo returned error: %v", err) } - got, err := ioutil.ReadAll(resp.Body) + got, err := io.ReadAll(resp.Body) if err != nil { - t.Fatalf("ioutil.ReadAll returned error: %v", err) + t.Fatalf("io.ReadAll returned error: %v", err) } if string(got) != expectedBody { t.Fatalf("Expected %q, got %q", expectedBody, string(got)) diff --git a/github/messages.go b/github/messages.go index e26b13e7b6f..ceac6d9bc40 100644 --- a/github/messages.go +++ b/github/messages.go @@ -19,7 +19,6 @@ import ( "fmt" "hash" "io" - "io/ioutil" "mime" "net/http" "net/url" @@ -171,7 +170,7 @@ func ValidatePayloadFromBody(contentType string, readable io.Reader, signature s switch contentType { case "application/json": var err error - if body, err = ioutil.ReadAll(readable); err != nil { + if body, err = io.ReadAll(readable); err != nil { return nil, err } @@ -185,7 +184,7 @@ func ValidatePayloadFromBody(contentType string, readable io.Reader, signature s const payloadFormParam = "payload" var err error - if body, err = ioutil.ReadAll(readable); err != nil { + if body, err = io.ReadAll(readable); err != nil { return nil, err } diff --git a/github/repos_contents_test.go b/github/repos_contents_test.go index 1cfa100df31..f5de5570aff 100644 --- a/github/repos_contents_test.go +++ b/github/repos_contents_test.go @@ -9,7 +9,7 @@ import ( "context" "errors" "fmt" - "io/ioutil" + "io" "net/http" "net/url" "testing" @@ -146,7 +146,7 @@ func TestRepositoriesService_DownloadContents_Success(t *testing.T) { t.Errorf("Repositories.DownloadContents returned status code %v, want %v", got, want) } - bytes, err := ioutil.ReadAll(r) + bytes, err := io.ReadAll(r) if err != nil { t.Errorf("Error reading response body: %v", err) } @@ -198,7 +198,7 @@ func TestRepositoriesService_DownloadContents_FailedResponse(t *testing.T) { t.Errorf("Repositories.DownloadContents returned status code %v, want %v", got, want) } - bytes, err := ioutil.ReadAll(r) + bytes, err := io.ReadAll(r) if err != nil { t.Errorf("Error reading response body: %v", err) } @@ -276,7 +276,7 @@ func TestRepositoriesService_DownloadContentsWithMeta_Success(t *testing.T) { t.Errorf("Repositories.DownloadContentsWithMeta returned status code %v, want %v", got, want) } - bytes, err := ioutil.ReadAll(r) + bytes, err := io.ReadAll(r) if err != nil { t.Errorf("Error reading response body: %v", err) } @@ -339,7 +339,7 @@ func TestRepositoriesService_DownloadContentsWithMeta_FailedResponse(t *testing. t.Errorf("Repositories.DownloadContentsWithMeta returned status code %v, want %v", got, want) } - bytes, err := ioutil.ReadAll(r) + bytes, err := io.ReadAll(r) if err != nil { t.Errorf("Error reading response body: %v", err) } diff --git a/github/repos_pages_test.go b/github/repos_pages_test.go index ed17e735204..75d6ccb2bf4 100644 --- a/github/repos_pages_test.go +++ b/github/repos_pages_test.go @@ -10,7 +10,7 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" + "io" "net/http" "testing" @@ -118,7 +118,7 @@ func TestRepositoriesService_UpdatePages_NullCNAME(t *testing.T) { } mux.HandleFunc("/repos/o/r/pages", func(w http.ResponseWriter, r *http.Request) { - got, err := ioutil.ReadAll(r.Body) + got, err := io.ReadAll(r.Body) if err != nil { t.Fatalf("unable to read body: %v", err) } diff --git a/github/repos_releases_test.go b/github/repos_releases_test.go index ddd7d44e93f..77a20ffe951 100644 --- a/github/repos_releases_test.go +++ b/github/repos_releases_test.go @@ -10,7 +10,7 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" + "io" "net/http" "os" "strings" @@ -442,7 +442,7 @@ func TestRepositoriesService_DownloadReleaseAsset_Stream(t *testing.T) { t.Errorf("Repositories.DownloadReleaseAsset returned error: %v", err) } want := []byte("Hello World") - content, err := ioutil.ReadAll(reader) + content, err := io.ReadAll(reader) if err != nil { t.Errorf("Repositories.DownloadReleaseAsset returned bad reader: %v", err) } @@ -498,7 +498,7 @@ func TestRepositoriesService_DownloadReleaseAsset_FollowRedirect(t *testing.T) { ctx := context.Background() reader, _, err := client.Repositories.DownloadReleaseAsset(ctx, "o", "r", 1, http.DefaultClient) - content, err := ioutil.ReadAll(reader) + content, err := io.ReadAll(reader) if err != nil { t.Errorf("Repositories.DownloadReleaseAsset returned error: %v", err) } diff --git a/github/teams_test.go b/github/teams_test.go index d267846ecba..6085eac13e2 100644 --- a/github/teams_test.go +++ b/github/teams_test.go @@ -10,7 +10,7 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" + "io" "net/http" "strings" "testing" @@ -293,7 +293,7 @@ func TestTeamsService_EditTeamByID_RemoveParent(t *testing.T) { mux.HandleFunc("/organizations/1/team/1", func(w http.ResponseWriter, r *http.Request) { v := new(NewTeam) - buf, err := ioutil.ReadAll(r.Body) + buf, err := io.ReadAll(r.Body) if err != nil { t.Errorf("Unable to read body: %v", err) } @@ -377,7 +377,7 @@ func TestTeamsService_EditTeamBySlug_RemoveParent(t *testing.T) { mux.HandleFunc("/orgs/o/teams/s", func(w http.ResponseWriter, r *http.Request) { v := new(NewTeam) - buf, err := ioutil.ReadAll(r.Body) + buf, err := io.ReadAll(r.Body) if err != nil { t.Errorf("Unable to read body: %v", err) } diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index ff39f715dfc..49ff98f0dad 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -11,7 +11,6 @@ package integration import ( "context" "io" - "io/ioutil" "net/http" "testing" @@ -183,7 +182,7 @@ func TestRepositories_DownloadReleaseAsset(t *testing.T) { t.Fatalf("Repositories.DownloadReleaseAsset(andersjanmyr, goose, 484892, true) returned error: %v", err) } defer func() { _ = rc.Close() }() - _, err = io.Copy(ioutil.Discard, rc) + _, err = io.Copy(io.Discard, rc) if err != nil { t.Fatalf("Repositories.DownloadReleaseAsset(andersjanmyr, goose, 484892, true) returned error: %v", err) } diff --git a/update-urls/main.go b/update-urls/main.go index e704a5cf66d..0a3c53c24d8 100644 --- a/update-urls/main.go +++ b/update-urls/main.go @@ -28,7 +28,7 @@ import ( "go/ast" "go/parser" "go/token" - "io/ioutil" + "io" "log" "net/http" "os" @@ -189,10 +189,10 @@ type liveFileRewriter struct { func (lfr *liveFileRewriter) Position(pos token.Pos) token.Position { return lfr.fset.Position(pos) } func (lfr *liveFileRewriter) ReadFile(filename string) ([]byte, error) { - return ioutil.ReadFile(filename) + return os.ReadFile(filename) } func (lfr *liveFileRewriter) WriteFile(filename string, buf []byte, mode os.FileMode) error { - return ioutil.WriteFile(filename, buf, mode) + return os.WriteFile(filename, buf, mode) } func validateRewriteURLs(usedHelpers usedHelpersMap, endpointsByFilename endpointsByFilenameMap, docCache documentCacheReader, fileRewriter FileRewriter) { @@ -599,7 +599,7 @@ func (dc *documentCache) CacheDocFromInternet(urlWithID, filename string, pos to url := baseURL logf("urlWithID: %v ; finalURL: %v ; baseURL: %v, fullURL: %v", urlWithID, finalURL, baseURL, fullURL) - b, err := ioutil.ReadAll(resp.Body) + b, err := io.ReadAll(resp.Body) check("Unable to read body of URL: %v, %v", url, err) check("Unable to close body of URL: %v, %v", url, resp.Body.Close()) dc.apiDocs[url], err = parseWebPageEndpoints(string(b)) From 3b3cbf13d0a5fd2d2d893ff8d5faf5eef4106c50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20de=20Metz?= Date: Tue, 8 Nov 2022 00:49:11 +0100 Subject: [PATCH 109/751] Add support for Dependabot alert endpoints (#2554) --- github/dependabot_alerts.go | 134 ++++++++++++ github/dependabot_alerts_test.go | 133 ++++++++++++ github/github-accessors.go | 296 ++++++++++++++++++++++++++ github/github-accessors_test.go | 349 +++++++++++++++++++++++++++++++ github/github.go | 8 + 5 files changed, 920 insertions(+) create mode 100644 github/dependabot_alerts.go create mode 100644 github/dependabot_alerts_test.go diff --git a/github/dependabot_alerts.go b/github/dependabot_alerts.go new file mode 100644 index 00000000000..e00aebc804f --- /dev/null +++ b/github/dependabot_alerts.go @@ -0,0 +1,134 @@ +// 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" +) + +// Dependency reprensents the vulnerable dependency. +type Dependency struct { + Package *VulnerabilityPackage `json:"package,omitempty"` + ManifestPath *string `json:"manifest_path,omitempty"` + Scope *string `json:"scope,omitempty"` +} + +// AdvisoryCVSs represents the advisory pertaining to the Common Vulnerability Scoring System. +type AdvisoryCVSs struct { + Score *float64 `json:"score,omitempty"` + VectorString *string `json:"vector_string,omitempty"` +} + +// AdvisoryCWEs reprensent the advisory pertaining to Common Weakness Enumeration. +type AdvisoryCWEs struct { + CWEID *string `json:"cwe_id,omitempty"` + Name *string `json:"name,omitempty"` +} + +// DependabotSecurityAdvisory represents the GitHub Security Advisory. +type DependabotSecurityAdvisory struct { + GHSAID *string `json:"ghsa_id,omitempty"` + CVEID *string `json:"cve_id,omitempty"` + Summary *string `json:"summary,omitempty"` + Description *string `json:"description,omitempty"` + Vulnerabilities []*AdvisoryVulnerability `json:"vulnerabilities,omitempty"` + Severity *string `json:"severity,omitempty"` + CVSs *AdvisoryCVSs `json:"cvss,omitempty"` + CWEs []*AdvisoryCWEs `json:"cwes,omitempty"` + Identifiers []*AdvisoryIdentifier `json:"identifiers,omitempty"` + References []*AdvisoryReference `json:"references,omitempty"` + PublishedAt *Timestamp `json:"published_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + WithdrawnAt *Timestamp `json:"withdrawn_at,omitempty"` +} + +// DependabotAlert represents a Dependabot alert. +type DependabotAlert struct { + Number *int `json:"number,omitempty"` + State *string `json:"state,omitempty"` + Dependency *Dependency `json:"dependency,omitempty"` + SecurityAdvisory *DependabotSecurityAdvisory `json:"security_advisory,omitempty"` + SecurityVulnerability *AdvisoryVulnerability `json:"security_vulnerability,omitempty"` + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + DismissedAt *Timestamp `json:"dismissed_at,omitempty"` + DismissedBy *User `json:"dismissed_by,omitempty"` + DismissedReason *string `json:"dismissed_reason,omitempty"` + DismissedComment *string `json:"dismissed_comment,omitempty"` + FixedAt *Timestamp `json:"fixed_at,omitempty"` +} + +// ListAlertsOptions specifies the optional parameters to the DependabotService.ListRepoAlerts +// and DependabotService.ListOrgAlerts methods. +type ListAlertsOptions struct { + State *string `url:"state,omitempty"` + Severity *string `url:"severity,omitempty"` + Ecosystem *string `url:"ecosystem,omitempty"` + Package *string `url:"package,omitempty"` + Scope *string `url:"scope,omitempty"` + Sort *string `url:"sort,omitempty"` + Direction *string `url:"direction,omitempty"` + + ListCursorOptions +} + +func (s *DependabotService) listAlerts(ctx context.Context, url string, opts *ListAlertsOptions) ([]*DependabotAlert, *Response, error) { + u, err := addOptions(url, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var alerts []*DependabotAlert + resp, err := s.client.Do(ctx, req, &alerts) + if err != nil { + return nil, resp, err + } + + return alerts, resp, nil +} + +// ListRepoAlerts lists all Dependabot alerts of a repository. +// +// GitHub API docs: https://docs.github.com/en/rest/dependabot/alerts#list-dependabot-alerts-for-a-repository +func (s *DependabotService) ListRepoAlerts(ctx context.Context, owner, repo string, opts *ListAlertsOptions) ([]*DependabotAlert, *Response, error) { + url := fmt.Sprintf("repos/%v/%v/dependabot/alerts", owner, repo) + return s.listAlerts(ctx, url, opts) +} + +// ListOrgAlerts lists all Dependabot alerts of an organization. +// +// GitHub API docs: https://docs.github.com/en/rest/dependabot/alerts#list-dependabot-alerts-for-an-organization +func (s *DependabotService) ListOrgAlerts(ctx context.Context, org string, opts *ListAlertsOptions) ([]*DependabotAlert, *Response, error) { + url := fmt.Sprintf("orgs/%v/dependabot/alerts", org) + return s.listAlerts(ctx, url, opts) +} + +// GetRepoAlert gets a single repository Dependabot alert. +// +// GitHub API docs: https://docs.github.com/en/rest/dependabot/alerts#get-a-dependabot-alert +func (s *DependabotService) GetRepoAlert(ctx context.Context, owner, repo string, number int) (*DependabotAlert, *Response, error) { + url := fmt.Sprintf("repos/%v/%v/dependabot/alerts/%v", owner, repo, number) + req, err := s.client.NewRequest("GET", url, nil) + if err != nil { + return nil, nil, err + } + + alert := new(DependabotAlert) + resp, err := s.client.Do(ctx, req, alert) + if err != nil { + return nil, resp, err + } + + return alert, resp, nil +} diff --git a/github/dependabot_alerts_test.go b/github/dependabot_alerts_test.go new file mode 100644 index 00000000000..a7c3b14788b --- /dev/null +++ b/github/dependabot_alerts_test.go @@ -0,0 +1,133 @@ +// 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 TestDependabotService_ListRepoAlerts(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/dependabot/alerts", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{"state": "open"}) + fmt.Fprint(w, `[{"number":1,"state":"open"},{"number":42,"state":"fixed"}]`) + }) + + opts := &ListAlertsOptions{State: String("open")} + ctx := context.Background() + alerts, _, err := client.Dependabot.ListRepoAlerts(ctx, "o", "r", opts) + if err != nil { + t.Errorf("Dependabot.ListRepoAlerts returned error: %v", err) + } + + want := []*DependabotAlert{ + {Number: Int(1), State: String("open")}, + {Number: Int(42), State: String("fixed")}, + } + if !cmp.Equal(alerts, want) { + t.Errorf("Dependabot.ListRepoAlerts returned %+v, want %+v", alerts, want) + } + + const methodName = "ListRepoAlerts" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Dependabot.ListRepoAlerts(ctx, "\n", "\n", opts) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Dependabot.ListRepoAlerts(ctx, "o", "r", opts) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestDependabotService_GetRepoAlert(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/dependabot/alerts/42", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"number":42,"state":"fixed"}`) + }) + + ctx := context.Background() + alert, _, err := client.Dependabot.GetRepoAlert(ctx, "o", "r", 42) + if err != nil { + t.Errorf("Dependabot.GetRepoAlert returned error: %v", err) + } + + want := &DependabotAlert{ + Number: Int(42), + State: String("fixed"), + } + if !cmp.Equal(alert, want) { + t.Errorf("Dependabot.GetRepoAlert returned %+v, want %+v", alert, want) + } + + const methodName = "GetRepoAlert" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Dependabot.GetRepoAlert(ctx, "\n", "\n", 0) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Dependabot.GetRepoAlert(ctx, "o", "r", 42) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestDependabotService_ListOrgAlerts(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/dependabot/alerts", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{"state": "open"}) + fmt.Fprint(w, `[{"number":1,"state":"open"},{"number":42,"state":"fixed"}]`) + }) + + opts := &ListAlertsOptions{State: String("open")} + ctx := context.Background() + alerts, _, err := client.Dependabot.ListOrgAlerts(ctx, "o", opts) + if err != nil { + t.Errorf("Dependabot.ListOrgAlerts returned error: %v", err) + } + + want := []*DependabotAlert{ + {Number: Int(1), State: String("open")}, + {Number: Int(42), State: String("fixed")}, + } + if !cmp.Equal(alerts, want) { + t.Errorf("Dependabot.ListOrgAlerts returned %+v, want %+v", alerts, want) + } + + const methodName = "ListOrgAlerts" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Dependabot.ListOrgAlerts(ctx, "\n", opts) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Dependabot.ListOrgAlerts(ctx, "o", opts) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} diff --git a/github/github-accessors.go b/github/github-accessors.go index ca558f63951..de2e0daee16 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -206,6 +206,38 @@ func (a *AdvancedSecurityCommittersBreakdown) GetUserLogin() string { return *a.UserLogin } +// GetScore returns the Score field. +func (a *AdvisoryCVSs) GetScore() *float64 { + if a == nil { + return nil + } + return a.Score +} + +// GetVectorString returns the VectorString field if it's non-nil, zero value otherwise. +func (a *AdvisoryCVSs) GetVectorString() string { + if a == nil || a.VectorString == nil { + return "" + } + return *a.VectorString +} + +// GetCWEID returns the CWEID field if it's non-nil, zero value otherwise. +func (a *AdvisoryCWEs) GetCWEID() string { + if a == nil || a.CWEID == nil { + return "" + } + return *a.CWEID +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (a *AdvisoryCWEs) GetName() string { + if a == nil || a.Name == nil { + return "" + } + return *a.Name +} + // GetType returns the Type field if it's non-nil, zero value otherwise. func (a *AdvisoryIdentifier) GetType() string { if a == nil || a.Type == nil { @@ -3734,6 +3766,214 @@ func (d *DeleteEvent) GetSender() *User { return d.Sender } +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (d *DependabotAlert) GetCreatedAt() Timestamp { + if d == nil || d.CreatedAt == nil { + return Timestamp{} + } + return *d.CreatedAt +} + +// GetDependency returns the Dependency field. +func (d *DependabotAlert) GetDependency() *Dependency { + if d == nil { + return nil + } + return d.Dependency +} + +// GetDismissedAt returns the DismissedAt field if it's non-nil, zero value otherwise. +func (d *DependabotAlert) GetDismissedAt() Timestamp { + if d == nil || d.DismissedAt == nil { + return Timestamp{} + } + return *d.DismissedAt +} + +// GetDismissedBy returns the DismissedBy field. +func (d *DependabotAlert) GetDismissedBy() *User { + if d == nil { + return nil + } + return d.DismissedBy +} + +// GetDismissedComment returns the DismissedComment field if it's non-nil, zero value otherwise. +func (d *DependabotAlert) GetDismissedComment() string { + if d == nil || d.DismissedComment == nil { + return "" + } + return *d.DismissedComment +} + +// GetDismissedReason returns the DismissedReason field if it's non-nil, zero value otherwise. +func (d *DependabotAlert) GetDismissedReason() string { + if d == nil || d.DismissedReason == nil { + return "" + } + return *d.DismissedReason +} + +// GetFixedAt returns the FixedAt field if it's non-nil, zero value otherwise. +func (d *DependabotAlert) GetFixedAt() Timestamp { + if d == nil || d.FixedAt == nil { + return Timestamp{} + } + return *d.FixedAt +} + +// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. +func (d *DependabotAlert) GetHTMLURL() string { + if d == nil || d.HTMLURL == nil { + return "" + } + return *d.HTMLURL +} + +// GetNumber returns the Number field if it's non-nil, zero value otherwise. +func (d *DependabotAlert) GetNumber() int { + if d == nil || d.Number == nil { + return 0 + } + return *d.Number +} + +// GetSecurityAdvisory returns the SecurityAdvisory field. +func (d *DependabotAlert) GetSecurityAdvisory() *DependabotSecurityAdvisory { + if d == nil { + return nil + } + return d.SecurityAdvisory +} + +// GetSecurityVulnerability returns the SecurityVulnerability field. +func (d *DependabotAlert) GetSecurityVulnerability() *AdvisoryVulnerability { + if d == nil { + return nil + } + return d.SecurityVulnerability +} + +// GetState returns the State field if it's non-nil, zero value otherwise. +func (d *DependabotAlert) GetState() string { + if d == nil || d.State == nil { + return "" + } + return *d.State +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (d *DependabotAlert) GetUpdatedAt() Timestamp { + if d == nil || d.UpdatedAt == nil { + return Timestamp{} + } + return *d.UpdatedAt +} + +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (d *DependabotAlert) GetURL() string { + if d == nil || d.URL == nil { + return "" + } + return *d.URL +} + +// GetCVEID returns the CVEID field if it's non-nil, zero value otherwise. +func (d *DependabotSecurityAdvisory) GetCVEID() string { + if d == nil || d.CVEID == nil { + return "" + } + return *d.CVEID +} + +// GetCVSs returns the CVSs field. +func (d *DependabotSecurityAdvisory) GetCVSs() *AdvisoryCVSs { + if d == nil { + return nil + } + return d.CVSs +} + +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (d *DependabotSecurityAdvisory) GetDescription() string { + if d == nil || d.Description == nil { + return "" + } + return *d.Description +} + +// GetGHSAID returns the GHSAID field if it's non-nil, zero value otherwise. +func (d *DependabotSecurityAdvisory) GetGHSAID() string { + if d == nil || d.GHSAID == nil { + return "" + } + return *d.GHSAID +} + +// GetPublishedAt returns the PublishedAt field if it's non-nil, zero value otherwise. +func (d *DependabotSecurityAdvisory) GetPublishedAt() Timestamp { + if d == nil || d.PublishedAt == nil { + return Timestamp{} + } + return *d.PublishedAt +} + +// GetSeverity returns the Severity field if it's non-nil, zero value otherwise. +func (d *DependabotSecurityAdvisory) GetSeverity() string { + if d == nil || d.Severity == nil { + return "" + } + return *d.Severity +} + +// GetSummary returns the Summary field if it's non-nil, zero value otherwise. +func (d *DependabotSecurityAdvisory) GetSummary() string { + if d == nil || d.Summary == nil { + return "" + } + return *d.Summary +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (d *DependabotSecurityAdvisory) GetUpdatedAt() Timestamp { + if d == nil || d.UpdatedAt == nil { + return Timestamp{} + } + return *d.UpdatedAt +} + +// GetWithdrawnAt returns the WithdrawnAt field if it's non-nil, zero value otherwise. +func (d *DependabotSecurityAdvisory) GetWithdrawnAt() Timestamp { + if d == nil || d.WithdrawnAt == nil { + return Timestamp{} + } + return *d.WithdrawnAt +} + +// GetManifestPath returns the ManifestPath field if it's non-nil, zero value otherwise. +func (d *Dependency) GetManifestPath() string { + if d == nil || d.ManifestPath == nil { + return "" + } + return *d.ManifestPath +} + +// GetPackage returns the Package field. +func (d *Dependency) GetPackage() *VulnerabilityPackage { + if d == nil { + return nil + } + return d.Package +} + +// GetScope returns the Scope field if it's non-nil, zero value otherwise. +func (d *Dependency) GetScope() string { + if d == nil || d.Scope == nil { + return "" + } + return *d.Scope +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (d *DeployKeyEvent) GetAction() string { if d == nil || d.Action == nil { @@ -8278,6 +8518,62 @@ func (l *LinearHistoryRequirementEnforcementLevelChanges) GetFrom() string { return *l.From } +// GetDirection returns the Direction field if it's non-nil, zero value otherwise. +func (l *ListAlertsOptions) GetDirection() string { + if l == nil || l.Direction == nil { + return "" + } + return *l.Direction +} + +// GetEcosystem returns the Ecosystem field if it's non-nil, zero value otherwise. +func (l *ListAlertsOptions) GetEcosystem() string { + if l == nil || l.Ecosystem == nil { + return "" + } + return *l.Ecosystem +} + +// GetPackage returns the Package field if it's non-nil, zero value otherwise. +func (l *ListAlertsOptions) GetPackage() string { + if l == nil || l.Package == nil { + return "" + } + return *l.Package +} + +// GetScope returns the Scope field if it's non-nil, zero value otherwise. +func (l *ListAlertsOptions) GetScope() string { + if l == nil || l.Scope == nil { + return "" + } + return *l.Scope +} + +// GetSeverity returns the Severity field if it's non-nil, zero value otherwise. +func (l *ListAlertsOptions) GetSeverity() string { + if l == nil || l.Severity == nil { + return "" + } + return *l.Severity +} + +// GetSort returns the Sort field if it's non-nil, zero value otherwise. +func (l *ListAlertsOptions) GetSort() string { + if l == nil || l.Sort == nil { + return "" + } + return *l.Sort +} + +// GetState returns the State field if it's non-nil, zero value otherwise. +func (l *ListAlertsOptions) GetState() string { + if l == nil || l.State == nil { + return "" + } + return *l.State +} + // GetAppID returns the AppID field if it's non-nil, zero value otherwise. func (l *ListCheckRunsOptions) GetAppID() int64 { if l == nil || l.AppID == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 7cc7834acb0..c967119b3d6 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -225,6 +225,43 @@ func TestAdvancedSecurityCommittersBreakdown_GetUserLogin(tt *testing.T) { a.GetUserLogin() } +func TestAdvisoryCVSs_GetScore(tt *testing.T) { + a := &AdvisoryCVSs{} + a.GetScore() + a = nil + a.GetScore() +} + +func TestAdvisoryCVSs_GetVectorString(tt *testing.T) { + var zeroValue string + a := &AdvisoryCVSs{VectorString: &zeroValue} + a.GetVectorString() + a = &AdvisoryCVSs{} + a.GetVectorString() + a = nil + a.GetVectorString() +} + +func TestAdvisoryCWEs_GetCWEID(tt *testing.T) { + var zeroValue string + a := &AdvisoryCWEs{CWEID: &zeroValue} + a.GetCWEID() + a = &AdvisoryCWEs{} + a.GetCWEID() + a = nil + a.GetCWEID() +} + +func TestAdvisoryCWEs_GetName(tt *testing.T) { + var zeroValue string + a := &AdvisoryCWEs{Name: &zeroValue} + a.GetName() + a = &AdvisoryCWEs{} + a.GetName() + a = nil + a.GetName() +} + func TestAdvisoryIdentifier_GetType(tt *testing.T) { var zeroValue string a := &AdvisoryIdentifier{Type: &zeroValue} @@ -4371,6 +4408,248 @@ func TestDeleteEvent_GetSender(tt *testing.T) { d.GetSender() } +func TestDependabotAlert_GetCreatedAt(tt *testing.T) { + var zeroValue Timestamp + d := &DependabotAlert{CreatedAt: &zeroValue} + d.GetCreatedAt() + d = &DependabotAlert{} + d.GetCreatedAt() + d = nil + d.GetCreatedAt() +} + +func TestDependabotAlert_GetDependency(tt *testing.T) { + d := &DependabotAlert{} + d.GetDependency() + d = nil + d.GetDependency() +} + +func TestDependabotAlert_GetDismissedAt(tt *testing.T) { + var zeroValue Timestamp + d := &DependabotAlert{DismissedAt: &zeroValue} + d.GetDismissedAt() + d = &DependabotAlert{} + d.GetDismissedAt() + d = nil + d.GetDismissedAt() +} + +func TestDependabotAlert_GetDismissedBy(tt *testing.T) { + d := &DependabotAlert{} + d.GetDismissedBy() + d = nil + d.GetDismissedBy() +} + +func TestDependabotAlert_GetDismissedComment(tt *testing.T) { + var zeroValue string + d := &DependabotAlert{DismissedComment: &zeroValue} + d.GetDismissedComment() + d = &DependabotAlert{} + d.GetDismissedComment() + d = nil + d.GetDismissedComment() +} + +func TestDependabotAlert_GetDismissedReason(tt *testing.T) { + var zeroValue string + d := &DependabotAlert{DismissedReason: &zeroValue} + d.GetDismissedReason() + d = &DependabotAlert{} + d.GetDismissedReason() + d = nil + d.GetDismissedReason() +} + +func TestDependabotAlert_GetFixedAt(tt *testing.T) { + var zeroValue Timestamp + d := &DependabotAlert{FixedAt: &zeroValue} + d.GetFixedAt() + d = &DependabotAlert{} + d.GetFixedAt() + d = nil + d.GetFixedAt() +} + +func TestDependabotAlert_GetHTMLURL(tt *testing.T) { + var zeroValue string + d := &DependabotAlert{HTMLURL: &zeroValue} + d.GetHTMLURL() + d = &DependabotAlert{} + d.GetHTMLURL() + d = nil + d.GetHTMLURL() +} + +func TestDependabotAlert_GetNumber(tt *testing.T) { + var zeroValue int + d := &DependabotAlert{Number: &zeroValue} + d.GetNumber() + d = &DependabotAlert{} + d.GetNumber() + d = nil + d.GetNumber() +} + +func TestDependabotAlert_GetSecurityAdvisory(tt *testing.T) { + d := &DependabotAlert{} + d.GetSecurityAdvisory() + d = nil + d.GetSecurityAdvisory() +} + +func TestDependabotAlert_GetSecurityVulnerability(tt *testing.T) { + d := &DependabotAlert{} + d.GetSecurityVulnerability() + d = nil + d.GetSecurityVulnerability() +} + +func TestDependabotAlert_GetState(tt *testing.T) { + var zeroValue string + d := &DependabotAlert{State: &zeroValue} + d.GetState() + d = &DependabotAlert{} + d.GetState() + d = nil + d.GetState() +} + +func TestDependabotAlert_GetUpdatedAt(tt *testing.T) { + var zeroValue Timestamp + d := &DependabotAlert{UpdatedAt: &zeroValue} + d.GetUpdatedAt() + d = &DependabotAlert{} + d.GetUpdatedAt() + d = nil + d.GetUpdatedAt() +} + +func TestDependabotAlert_GetURL(tt *testing.T) { + var zeroValue string + d := &DependabotAlert{URL: &zeroValue} + d.GetURL() + d = &DependabotAlert{} + d.GetURL() + d = nil + d.GetURL() +} + +func TestDependabotSecurityAdvisory_GetCVEID(tt *testing.T) { + var zeroValue string + d := &DependabotSecurityAdvisory{CVEID: &zeroValue} + d.GetCVEID() + d = &DependabotSecurityAdvisory{} + d.GetCVEID() + d = nil + d.GetCVEID() +} + +func TestDependabotSecurityAdvisory_GetCVSs(tt *testing.T) { + d := &DependabotSecurityAdvisory{} + d.GetCVSs() + d = nil + d.GetCVSs() +} + +func TestDependabotSecurityAdvisory_GetDescription(tt *testing.T) { + var zeroValue string + d := &DependabotSecurityAdvisory{Description: &zeroValue} + d.GetDescription() + d = &DependabotSecurityAdvisory{} + d.GetDescription() + d = nil + d.GetDescription() +} + +func TestDependabotSecurityAdvisory_GetGHSAID(tt *testing.T) { + var zeroValue string + d := &DependabotSecurityAdvisory{GHSAID: &zeroValue} + d.GetGHSAID() + d = &DependabotSecurityAdvisory{} + d.GetGHSAID() + d = nil + d.GetGHSAID() +} + +func TestDependabotSecurityAdvisory_GetPublishedAt(tt *testing.T) { + var zeroValue Timestamp + d := &DependabotSecurityAdvisory{PublishedAt: &zeroValue} + d.GetPublishedAt() + d = &DependabotSecurityAdvisory{} + d.GetPublishedAt() + d = nil + d.GetPublishedAt() +} + +func TestDependabotSecurityAdvisory_GetSeverity(tt *testing.T) { + var zeroValue string + d := &DependabotSecurityAdvisory{Severity: &zeroValue} + d.GetSeverity() + d = &DependabotSecurityAdvisory{} + d.GetSeverity() + d = nil + d.GetSeverity() +} + +func TestDependabotSecurityAdvisory_GetSummary(tt *testing.T) { + var zeroValue string + d := &DependabotSecurityAdvisory{Summary: &zeroValue} + d.GetSummary() + d = &DependabotSecurityAdvisory{} + d.GetSummary() + d = nil + d.GetSummary() +} + +func TestDependabotSecurityAdvisory_GetUpdatedAt(tt *testing.T) { + var zeroValue Timestamp + d := &DependabotSecurityAdvisory{UpdatedAt: &zeroValue} + d.GetUpdatedAt() + d = &DependabotSecurityAdvisory{} + d.GetUpdatedAt() + d = nil + d.GetUpdatedAt() +} + +func TestDependabotSecurityAdvisory_GetWithdrawnAt(tt *testing.T) { + var zeroValue Timestamp + d := &DependabotSecurityAdvisory{WithdrawnAt: &zeroValue} + d.GetWithdrawnAt() + d = &DependabotSecurityAdvisory{} + d.GetWithdrawnAt() + d = nil + d.GetWithdrawnAt() +} + +func TestDependency_GetManifestPath(tt *testing.T) { + var zeroValue string + d := &Dependency{ManifestPath: &zeroValue} + d.GetManifestPath() + d = &Dependency{} + d.GetManifestPath() + d = nil + d.GetManifestPath() +} + +func TestDependency_GetPackage(tt *testing.T) { + d := &Dependency{} + d.GetPackage() + d = nil + d.GetPackage() +} + +func TestDependency_GetScope(tt *testing.T) { + var zeroValue string + d := &Dependency{Scope: &zeroValue} + d.GetScope() + d = &Dependency{} + d.GetScope() + d = nil + d.GetScope() +} + func TestDeployKeyEvent_GetAction(tt *testing.T) { var zeroValue string d := &DeployKeyEvent{Action: &zeroValue} @@ -9706,6 +9985,76 @@ func TestLinearHistoryRequirementEnforcementLevelChanges_GetFrom(tt *testing.T) l.GetFrom() } +func TestListAlertsOptions_GetDirection(tt *testing.T) { + var zeroValue string + l := &ListAlertsOptions{Direction: &zeroValue} + l.GetDirection() + l = &ListAlertsOptions{} + l.GetDirection() + l = nil + l.GetDirection() +} + +func TestListAlertsOptions_GetEcosystem(tt *testing.T) { + var zeroValue string + l := &ListAlertsOptions{Ecosystem: &zeroValue} + l.GetEcosystem() + l = &ListAlertsOptions{} + l.GetEcosystem() + l = nil + l.GetEcosystem() +} + +func TestListAlertsOptions_GetPackage(tt *testing.T) { + var zeroValue string + l := &ListAlertsOptions{Package: &zeroValue} + l.GetPackage() + l = &ListAlertsOptions{} + l.GetPackage() + l = nil + l.GetPackage() +} + +func TestListAlertsOptions_GetScope(tt *testing.T) { + var zeroValue string + l := &ListAlertsOptions{Scope: &zeroValue} + l.GetScope() + l = &ListAlertsOptions{} + l.GetScope() + l = nil + l.GetScope() +} + +func TestListAlertsOptions_GetSeverity(tt *testing.T) { + var zeroValue string + l := &ListAlertsOptions{Severity: &zeroValue} + l.GetSeverity() + l = &ListAlertsOptions{} + l.GetSeverity() + l = nil + l.GetSeverity() +} + +func TestListAlertsOptions_GetSort(tt *testing.T) { + var zeroValue string + l := &ListAlertsOptions{Sort: &zeroValue} + l.GetSort() + l = &ListAlertsOptions{} + l.GetSort() + l = nil + l.GetSort() +} + +func TestListAlertsOptions_GetState(tt *testing.T) { + var zeroValue string + l := &ListAlertsOptions{State: &zeroValue} + l.GetState() + l = &ListAlertsOptions{} + l.GetState() + l = nil + l.GetState() +} + func TestListCheckRunsOptions_GetAppID(tt *testing.T) { var zeroValue int64 l := &ListCheckRunsOptions{AppID: &zeroValue} diff --git a/github/github.go b/github/github.go index 9f8fd530169..38a5bcd29b4 100644 --- a/github/github.go +++ b/github/github.go @@ -236,6 +236,14 @@ type ListCursorOptions struct { // For paginated result sets, the number of results to include per page. PerPage int `url:"per_page,omitempty"` + // For paginated result sets, the number of results per page (max 100), starting from the first matching result. + // This parameter must not be used in combination with last. + First int `url:"first,omitempty"` + + // For paginated result sets, the number of results per page (max 100), starting from the last matching result. + // This parameter must not be used in combination with first. + Last int `url:"last,omitempty"` + // A cursor, as given in the Link header. If specified, the query only searches for events after this cursor. After string `url:"after,omitempty"` From db32fc6d79d6d282b09849020650928e8b16f24b Mon Sep 17 00:00:00 2001 From: Mike Chen Date: Wed, 9 Nov 2022 06:49:46 -0800 Subject: [PATCH 110/751] Support workflow restrictions in actions_runner_groups (#2559) Fixes: #2558. --- github/actions_runner_groups.go | 31 +++++++++------ github/actions_runner_groups_test.go | 56 ++++++++++++++++++++-------- github/github-accessors.go | 32 ++++++++++++++++ github/github-accessors_test.go | 40 ++++++++++++++++++++ 4 files changed, 133 insertions(+), 26 deletions(-) diff --git a/github/actions_runner_groups.go b/github/actions_runner_groups.go index 6d89249150c..00b9b6ce091 100644 --- a/github/actions_runner_groups.go +++ b/github/actions_runner_groups.go @@ -12,14 +12,17 @@ import ( // RunnerGroup represents a self-hosted runner group configured in an organization. type RunnerGroup struct { - ID *int64 `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Visibility *string `json:"visibility,omitempty"` - Default *bool `json:"default,omitempty"` - SelectedRepositoriesURL *string `json:"selected_repositories_url,omitempty"` - RunnersURL *string `json:"runners_url,omitempty"` - Inherited *bool `json:"inherited,omitempty"` - AllowsPublicRepositories *bool `json:"allows_public_repositories,omitempty"` + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Visibility *string `json:"visibility,omitempty"` + Default *bool `json:"default,omitempty"` + SelectedRepositoriesURL *string `json:"selected_repositories_url,omitempty"` + RunnersURL *string `json:"runners_url,omitempty"` + Inherited *bool `json:"inherited,omitempty"` + AllowsPublicRepositories *bool `json:"allows_public_repositories,omitempty"` + RestrictedToWorkflows *bool `json:"restricted_to_workflows,omitempty"` + SelectedWorkflows []string `json:"selected_workflows,omitempty"` + WorkflowRestrictionsReadOnly *bool `json:"workflow_restrictions_read_only,omitempty"` } // RunnerGroups represents a collection of self-hosted runner groups configured for an organization. @@ -38,13 +41,19 @@ type CreateRunnerGroupRequest struct { Runners []int64 `json:"runners,omitempty"` // If set to True, public repos can use this runner group AllowsPublicRepositories *bool `json:"allows_public_repositories,omitempty"` + // If true, the runner group will be restricted to running only the workflows specified in the SelectedWorkflows slice. + RestrictedToWorkflows *bool `json:"restricted_to_workflows,omitempty"` + // List of workflows the runner group should be allowed to run. This setting will be ignored unless RestrictedToWorkflows is set to true. + SelectedWorkflows []string `json:"selected_workflows,omitempty"` } // UpdateRunnerGroupRequest represents a request to update a Runner group for an organization. type UpdateRunnerGroupRequest struct { - Name *string `json:"name,omitempty"` - Visibility *string `json:"visibility,omitempty"` - AllowsPublicRepositories *bool `json:"allows_public_repositories,omitempty"` + Name *string `json:"name,omitempty"` + Visibility *string `json:"visibility,omitempty"` + AllowsPublicRepositories *bool `json:"allows_public_repositories,omitempty"` + RestrictedToWorkflows *bool `json:"restricted_to_workflows,omitempty"` + SelectedWorkflows []string `json:"selected_workflows,omitempty"` } // SetRepoAccessRunnerGroupRequest represents a request to replace the list of repositories diff --git a/github/actions_runner_groups_test.go b/github/actions_runner_groups_test.go index fc8b2480027..16d92ed7c64 100644 --- a/github/actions_runner_groups_test.go +++ b/github/actions_runner_groups_test.go @@ -21,7 +21,7 @@ func TestActionsService_ListOrganizationRunnerGroups(t *testing.T) { mux.HandleFunc("/orgs/o/actions/runner-groups", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") testFormValues(t, r, values{"per_page": "2", "page": "2"}) - fmt.Fprint(w, `{"total_count":3,"runner_groups":[{"id":1,"name":"Default","visibility":"all","default":true,"runners_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/1/runners","inherited":false,"allows_public_repositories":true},{"id":2,"name":"octo-runner-group","visibility":"selected","default":false,"selected_repositories_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories","runners_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners","inherited":true,"allows_public_repositories":true},{"id":3,"name":"expensive-hardware","visibility":"private","default":false,"runners_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/3/runners","inherited":false,"allows_public_repositories":true}]}`) + fmt.Fprint(w, `{"total_count":3,"runner_groups":[{"id":1,"name":"Default","visibility":"all","default":true,"runners_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/1/runners","inherited":false,"allows_public_repositories":true,"restricted_to_workflows":true,"selected_workflows":["a","b"]},{"id":2,"name":"octo-runner-group","visibility":"selected","default":false,"selected_repositories_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories","runners_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners","inherited":true,"allows_public_repositories":true,"restricted_to_workflows":false,"selected_workflows":[]},{"id":3,"name":"expensive-hardware","visibility":"private","default":false,"runners_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/3/runners","inherited":false,"allows_public_repositories":true,"restricted_to_workflows":false,"selected_workflows":[]}]}`) }) opts := &ListOrgRunnerGroupOptions{ListOptions: ListOptions{Page: 2, PerPage: 2}} @@ -34,9 +34,9 @@ func TestActionsService_ListOrganizationRunnerGroups(t *testing.T) { want := &RunnerGroups{ TotalCount: 3, RunnerGroups: []*RunnerGroup{ - {ID: Int64(1), Name: String("Default"), Visibility: String("all"), Default: Bool(true), RunnersURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/1/runners"), Inherited: Bool(false), AllowsPublicRepositories: Bool(true)}, - {ID: Int64(2), Name: String("octo-runner-group"), Visibility: String("selected"), Default: Bool(false), SelectedRepositoriesURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories"), RunnersURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners"), Inherited: Bool(true), AllowsPublicRepositories: Bool(true)}, - {ID: Int64(3), Name: String("expensive-hardware"), Visibility: String("private"), Default: Bool(false), RunnersURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/3/runners"), Inherited: Bool(false), AllowsPublicRepositories: Bool(true)}, + {ID: Int64(1), Name: String("Default"), Visibility: String("all"), Default: Bool(true), RunnersURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/1/runners"), Inherited: Bool(false), AllowsPublicRepositories: Bool(true), RestrictedToWorkflows: Bool(true), SelectedWorkflows: []string{"a", "b"}}, + {ID: Int64(2), Name: String("octo-runner-group"), Visibility: String("selected"), Default: Bool(false), SelectedRepositoriesURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories"), RunnersURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners"), Inherited: Bool(true), AllowsPublicRepositories: Bool(true), RestrictedToWorkflows: Bool(false), SelectedWorkflows: []string{}}, + {ID: Int64(3), Name: String("expensive-hardware"), Visibility: String("private"), Default: Bool(false), RunnersURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/3/runners"), Inherited: Bool(false), AllowsPublicRepositories: Bool(true), RestrictedToWorkflows: Bool(false), SelectedWorkflows: []string{}}, }, } if !cmp.Equal(groups, want) { @@ -65,7 +65,7 @@ func TestActionsService_ListOrganizationRunnerGroupsVisibleToRepo(t *testing.T) mux.HandleFunc("/orgs/o/actions/runner-groups", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") testFormValues(t, r, values{"per_page": "2", "page": "2", "visible_to_repository": "github"}) - fmt.Fprint(w, `{"total_count":3,"runner_groups":[{"id":1,"name":"Default","visibility":"all","default":true,"runners_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/1/runners","inherited":false,"allows_public_repositories":true},{"id":2,"name":"octo-runner-group","visibility":"selected","default":false,"selected_repositories_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories","runners_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners","inherited":true,"allows_public_repositories":true},{"id":3,"name":"expensive-hardware","visibility":"private","default":false,"runners_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/3/runners","inherited":false,"allows_public_repositories":true}]}`) + fmt.Fprint(w, `{"total_count":3,"runner_groups":[{"id":1,"name":"Default","visibility":"all","default":true,"runners_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/1/runners","inherited":false,"allows_public_repositories":true,"restricted_to_workflows":false,"selected_workflows":[]},{"id":2,"name":"octo-runner-group","visibility":"selected","default":false,"selected_repositories_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories","runners_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners","inherited":true,"allows_public_repositories":true,"restricted_to_workflows":false,"selected_workflows":[]},{"id":3,"name":"expensive-hardware","visibility":"private","default":false,"runners_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/3/runners","inherited":false,"allows_public_repositories":true,"restricted_to_workflows":false,"selected_workflows":[]}]}`) }) opts := &ListOrgRunnerGroupOptions{ListOptions: ListOptions{Page: 2, PerPage: 2}, VisibleToRepository: "github"} @@ -78,9 +78,9 @@ func TestActionsService_ListOrganizationRunnerGroupsVisibleToRepo(t *testing.T) want := &RunnerGroups{ TotalCount: 3, RunnerGroups: []*RunnerGroup{ - {ID: Int64(1), Name: String("Default"), Visibility: String("all"), Default: Bool(true), RunnersURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/1/runners"), Inherited: Bool(false), AllowsPublicRepositories: Bool(true)}, - {ID: Int64(2), Name: String("octo-runner-group"), Visibility: String("selected"), Default: Bool(false), SelectedRepositoriesURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories"), RunnersURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners"), Inherited: Bool(true), AllowsPublicRepositories: Bool(true)}, - {ID: Int64(3), Name: String("expensive-hardware"), Visibility: String("private"), Default: Bool(false), RunnersURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/3/runners"), Inherited: Bool(false), AllowsPublicRepositories: Bool(true)}, + {ID: Int64(1), Name: String("Default"), Visibility: String("all"), Default: Bool(true), RunnersURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/1/runners"), Inherited: Bool(false), AllowsPublicRepositories: Bool(true), RestrictedToWorkflows: Bool(false), SelectedWorkflows: []string{}}, + {ID: Int64(2), Name: String("octo-runner-group"), Visibility: String("selected"), Default: Bool(false), SelectedRepositoriesURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories"), RunnersURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners"), Inherited: Bool(true), AllowsPublicRepositories: Bool(true), RestrictedToWorkflows: Bool(false), SelectedWorkflows: []string{}}, + {ID: Int64(3), Name: String("expensive-hardware"), Visibility: String("private"), Default: Bool(false), RunnersURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/3/runners"), Inherited: Bool(false), AllowsPublicRepositories: Bool(true), RestrictedToWorkflows: Bool(false), SelectedWorkflows: []string{}}, }, } if !cmp.Equal(groups, want) { @@ -108,7 +108,7 @@ func TestActionsService_GetOrganizationRunnerGroup(t *testing.T) { mux.HandleFunc("/orgs/o/actions/runner-groups/2", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - fmt.Fprint(w, `{"id":2,"name":"octo-runner-group","visibility":"selected","default":false,"selected_repositories_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories","runners_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners","inherited":false,"allows_public_repositories":true}`) + fmt.Fprint(w, `{"id":2,"name":"octo-runner-group","visibility":"selected","default":false,"selected_repositories_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories","runners_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners","inherited":false,"allows_public_repositories":true,"restricted_to_workflows":false,"selected_workflows":[]}`) }) ctx := context.Background() @@ -126,6 +126,8 @@ func TestActionsService_GetOrganizationRunnerGroup(t *testing.T) { RunnersURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners"), Inherited: Bool(false), AllowsPublicRepositories: Bool(true), + RestrictedToWorkflows: Bool(false), + SelectedWorkflows: []string{}, } if !cmp.Equal(group, want) { @@ -178,7 +180,7 @@ func TestActionsService_CreateOrganizationRunnerGroup(t *testing.T) { mux.HandleFunc("/orgs/o/actions/runner-groups", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") - fmt.Fprint(w, `{"id":2,"name":"octo-runner-group","visibility":"selected","default":false,"selected_repositories_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories","runners_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners","inherited":false,"allows_public_repositories":true}`) + fmt.Fprint(w, `{"id":2,"name":"octo-runner-group","visibility":"selected","default":false,"selected_repositories_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories","runners_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners","inherited":false,"allows_public_repositories":true,"restricted_to_workflows":false,"selected_workflows":[]}`) }) ctx := context.Background() @@ -186,6 +188,8 @@ func TestActionsService_CreateOrganizationRunnerGroup(t *testing.T) { Name: String("octo-runner-group"), Visibility: String("selected"), AllowsPublicRepositories: Bool(true), + RestrictedToWorkflows: Bool(false), + SelectedWorkflows: []string{}, } group, _, err := client.Actions.CreateOrganizationRunnerGroup(ctx, "o", req) if err != nil { @@ -201,6 +205,8 @@ func TestActionsService_CreateOrganizationRunnerGroup(t *testing.T) { RunnersURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners"), Inherited: Bool(false), AllowsPublicRepositories: Bool(true), + RestrictedToWorkflows: Bool(false), + SelectedWorkflows: []string{}, } if !cmp.Equal(group, want) { @@ -228,7 +234,7 @@ func TestActionsService_UpdateOrganizationRunnerGroup(t *testing.T) { mux.HandleFunc("/orgs/o/actions/runner-groups/2", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") - fmt.Fprint(w, `{"id":2,"name":"octo-runner-group","visibility":"selected","default":false,"selected_repositories_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories","runners_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners","inherited":false,"allows_public_repositories":true}`) + fmt.Fprint(w, `{"id":2,"name":"octo-runner-group","visibility":"selected","default":false,"selected_repositories_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories","runners_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners","inherited":false,"allows_public_repositories":true,"restricted_to_workflows":false,"selected_workflows":[]}`) }) ctx := context.Background() @@ -236,6 +242,8 @@ func TestActionsService_UpdateOrganizationRunnerGroup(t *testing.T) { Name: String("octo-runner-group"), Visibility: String("selected"), AllowsPublicRepositories: Bool(true), + RestrictedToWorkflows: Bool(false), + SelectedWorkflows: []string{}, } group, _, err := client.Actions.UpdateOrganizationRunnerGroup(ctx, "o", 2, req) if err != nil { @@ -251,6 +259,8 @@ func TestActionsService_UpdateOrganizationRunnerGroup(t *testing.T) { RunnersURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners"), Inherited: Bool(false), AllowsPublicRepositories: Bool(true), + RestrictedToWorkflows: Bool(false), + SelectedWorkflows: []string{}, } if !cmp.Equal(group, want) { @@ -533,6 +543,8 @@ func TestRunnerGroup_Marshal(t *testing.T) { RunnersURL: String("r"), Inherited: Bool(true), AllowsPublicRepositories: Bool(true), + RestrictedToWorkflows: Bool(false), + SelectedWorkflows: []string{}, } want := `{ @@ -543,7 +555,9 @@ func TestRunnerGroup_Marshal(t *testing.T) { "selected_repositories_url": "s", "runners_url": "r", "inherited": true, - "allows_public_repositories": true + "allows_public_repositories": true, + "restricted_to_workflows": false, + "selected_workflows": [] }` testJSONMarshal(t, u, want) @@ -564,6 +578,8 @@ func TestRunnerGroups_Marshal(t *testing.T) { RunnersURL: String("r"), Inherited: Bool(true), AllowsPublicRepositories: Bool(true), + RestrictedToWorkflows: Bool(false), + SelectedWorkflows: []string{}, }, }, } @@ -578,7 +594,9 @@ func TestRunnerGroups_Marshal(t *testing.T) { "selected_repositories_url": "s", "runners_url": "r", "inherited": true, - "allows_public_repositories": true + "allows_public_repositories": true, + "restricted_to_workflows": false, + "selected_workflows": [] }] }` @@ -594,6 +612,8 @@ func TestCreateRunnerGroupRequest_Marshal(t *testing.T) { SelectedRepositoryIDs: []int64{1}, Runners: []int64{1}, AllowsPublicRepositories: Bool(true), + RestrictedToWorkflows: Bool(true), + SelectedWorkflows: []string{"a", "b"}, } want := `{ @@ -601,7 +621,9 @@ func TestCreateRunnerGroupRequest_Marshal(t *testing.T) { "visibility": "v", "selected_repository_ids": [1], "runners": [1], - "allows_public_repositories": true + "allows_public_repositories": true, + "restricted_to_workflows": true, + "selected_workflows": ["a","b"] }` testJSONMarshal(t, u, want) @@ -614,12 +636,16 @@ func TestUpdateRunnerGroupRequest_Marshal(t *testing.T) { Name: String("n"), Visibility: String("v"), AllowsPublicRepositories: Bool(true), + RestrictedToWorkflows: Bool(false), + SelectedWorkflows: []string{}, } want := `{ "name": "n", "visibility": "v", - "allows_public_repositories": true + "allows_public_repositories": true, + "restricted_to_workflows": false, + "selected_workflows": [] }` testJSONMarshal(t, u, want) diff --git a/github/github-accessors.go b/github/github-accessors.go index de2e0daee16..a01036de23c 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -3654,6 +3654,14 @@ func (c *CreateRunnerGroupRequest) GetName() string { return *c.Name } +// GetRestrictedToWorkflows returns the RestrictedToWorkflows field if it's non-nil, zero value otherwise. +func (c *CreateRunnerGroupRequest) GetRestrictedToWorkflows() bool { + if c == nil || c.RestrictedToWorkflows == nil { + return false + } + return *c.RestrictedToWorkflows +} + // GetVisibility returns the Visibility field if it's non-nil, zero value otherwise. func (c *CreateRunnerGroupRequest) GetVisibility() string { if c == nil || c.Visibility == nil { @@ -16982,6 +16990,14 @@ func (r *RunnerGroup) GetName() string { return *r.Name } +// GetRestrictedToWorkflows returns the RestrictedToWorkflows field if it's non-nil, zero value otherwise. +func (r *RunnerGroup) GetRestrictedToWorkflows() bool { + if r == nil || r.RestrictedToWorkflows == nil { + return false + } + return *r.RestrictedToWorkflows +} + // GetRunnersURL returns the RunnersURL field if it's non-nil, zero value otherwise. func (r *RunnerGroup) GetRunnersURL() string { if r == nil || r.RunnersURL == nil { @@ -17006,6 +17022,14 @@ func (r *RunnerGroup) GetVisibility() string { return *r.Visibility } +// GetWorkflowRestrictionsReadOnly returns the WorkflowRestrictionsReadOnly field if it's non-nil, zero value otherwise. +func (r *RunnerGroup) GetWorkflowRestrictionsReadOnly() bool { + if r == nil || r.WorkflowRestrictionsReadOnly == nil { + return false + } + return *r.WorkflowRestrictionsReadOnly +} + // GetID returns the ID field if it's non-nil, zero value otherwise. func (r *RunnerLabels) GetID() int64 { if r == nil || r.ID == nil { @@ -19470,6 +19494,14 @@ func (u *UpdateRunnerGroupRequest) GetName() string { return *u.Name } +// GetRestrictedToWorkflows returns the RestrictedToWorkflows field if it's non-nil, zero value otherwise. +func (u *UpdateRunnerGroupRequest) GetRestrictedToWorkflows() bool { + if u == nil || u.RestrictedToWorkflows == nil { + return false + } + return *u.RestrictedToWorkflows +} + // GetVisibility returns the Visibility field if it's non-nil, zero value otherwise. func (u *UpdateRunnerGroupRequest) GetVisibility() string { if u == nil || u.Visibility == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index c967119b3d6..78e862892f5 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -4280,6 +4280,16 @@ func TestCreateRunnerGroupRequest_GetName(tt *testing.T) { c.GetName() } +func TestCreateRunnerGroupRequest_GetRestrictedToWorkflows(tt *testing.T) { + var zeroValue bool + c := &CreateRunnerGroupRequest{RestrictedToWorkflows: &zeroValue} + c.GetRestrictedToWorkflows() + c = &CreateRunnerGroupRequest{} + c.GetRestrictedToWorkflows() + c = nil + c.GetRestrictedToWorkflows() +} + func TestCreateRunnerGroupRequest_GetVisibility(tt *testing.T) { var zeroValue string c := &CreateRunnerGroupRequest{Visibility: &zeroValue} @@ -19776,6 +19786,16 @@ func TestRunnerGroup_GetName(tt *testing.T) { r.GetName() } +func TestRunnerGroup_GetRestrictedToWorkflows(tt *testing.T) { + var zeroValue bool + r := &RunnerGroup{RestrictedToWorkflows: &zeroValue} + r.GetRestrictedToWorkflows() + r = &RunnerGroup{} + r.GetRestrictedToWorkflows() + r = nil + r.GetRestrictedToWorkflows() +} + func TestRunnerGroup_GetRunnersURL(tt *testing.T) { var zeroValue string r := &RunnerGroup{RunnersURL: &zeroValue} @@ -19806,6 +19826,16 @@ func TestRunnerGroup_GetVisibility(tt *testing.T) { r.GetVisibility() } +func TestRunnerGroup_GetWorkflowRestrictionsReadOnly(tt *testing.T) { + var zeroValue bool + r := &RunnerGroup{WorkflowRestrictionsReadOnly: &zeroValue} + r.GetWorkflowRestrictionsReadOnly() + r = &RunnerGroup{} + r.GetWorkflowRestrictionsReadOnly() + r = nil + r.GetWorkflowRestrictionsReadOnly() +} + func TestRunnerLabels_GetID(tt *testing.T) { var zeroValue int64 r := &RunnerLabels{ID: &zeroValue} @@ -22691,6 +22721,16 @@ func TestUpdateRunnerGroupRequest_GetName(tt *testing.T) { u.GetName() } +func TestUpdateRunnerGroupRequest_GetRestrictedToWorkflows(tt *testing.T) { + var zeroValue bool + u := &UpdateRunnerGroupRequest{RestrictedToWorkflows: &zeroValue} + u.GetRestrictedToWorkflows() + u = &UpdateRunnerGroupRequest{} + u.GetRestrictedToWorkflows() + u = nil + u.GetRestrictedToWorkflows() +} + func TestUpdateRunnerGroupRequest_GetVisibility(tt *testing.T) { var zeroValue string u := &UpdateRunnerGroupRequest{Visibility: &zeroValue} From ddfa307d7f5762b01417c05ecd684db2d078b1ff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Nov 2022 21:26:36 -0500 Subject: [PATCH 111/751] Bump golangci/golangci-lint-action from 3.3.0 to 3.3.1 (#2564) --- .github/workflows/linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index b44fdcc6011..c035aa6b4d1 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -26,7 +26,7 @@ jobs: - uses: actions/checkout@v3 - name: golangci-lint ${{ matrix.working-directory }} - uses: golangci/golangci-lint-action@07db5389c99593f11ad7b44463c2d4233066a9b1 #v3.3.0 + uses: golangci/golangci-lint-action@0ad9a0988b3973e851ab0a07adf248ec2e100376 #v3.3.1 with: version: v1.44.0 working-directory: ${{ matrix.working-directory}} From 155b546bc0c3ae6eed3a644960dddf79b86d9ad6 Mon Sep 17 00:00:00 2001 From: Luke Young <91491244+lyoung-confluent@users.noreply.github.com> Date: Tue, 15 Nov 2022 05:11:05 -0800 Subject: [PATCH 112/751] Add parents field to timeline events (#2566) --- github/issues_timeline.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/github/issues_timeline.go b/github/issues_timeline.go index 9ec498e45cc..7b9068acc58 100644 --- a/github/issues_timeline.go +++ b/github/issues_timeline.go @@ -35,6 +35,8 @@ type Timeline struct { SHA *string `json:"sha,omitempty"` // The commit message. Message *string `json:"message,omitempty"` + // A list of parent commits. + Parents []*Commit `json:"parents,omitempty"` // Event identifies the actual type of Event that occurred. Possible values // are: From cbfb001e1bebbdba128fb47509e41b212212b0fb Mon Sep 17 00:00:00 2001 From: "Philip K. Warren" Date: Wed, 16 Nov 2022 15:51:56 -0600 Subject: [PATCH 113/751] Update doc URL for PackageGetAllVersions (#2568) --- github/orgs_packages.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/orgs_packages.go b/github/orgs_packages.go index 9fb11308b8c..0ae68aaa369 100644 --- a/github/orgs_packages.go +++ b/github/orgs_packages.go @@ -81,7 +81,7 @@ func (s *OrganizationsService) RestorePackage(ctx context.Context, org, packageT // Get all versions of a package in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/packages#get-all-package-versions-for-a-package-owned-by-an-organization +// GitHub API docs: https://docs.github.com/en/rest/packages#list-package-versions-for-a-package-owned-by-an-organization func (s *OrganizationsService) PackageGetAllVersions(ctx context.Context, org, packageType, packageName string, opts *PackageListOptions) ([]*PackageVersion, *Response, error) { u := fmt.Sprintf("orgs/%v/packages/%v/%v/versions", org, packageType, packageName) u, err := addOptions(u, opts) From cb24cabfacd4bff06727d5b3acea48ba56e5f690 Mon Sep 17 00:00:00 2001 From: noamd-legit <74864790+noamd-legit@users.noreply.github.com> Date: Thu, 17 Nov 2022 16:01:26 +0200 Subject: [PATCH 114/751] Add the 'require_last_push_approval' field (#2567) --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ github/repos.go | 4 ++++ 3 files changed, 22 insertions(+) diff --git a/github/github-accessors.go b/github/github-accessors.go index a01036de23c..0d9db6ff896 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -13670,6 +13670,14 @@ func (p *PullRequestReviewsEnforcementUpdate) GetRequireCodeOwnerReviews() bool return *p.RequireCodeOwnerReviews } +// GetRequireLastPushApproval returns the RequireLastPushApproval field if it's non-nil, zero value otherwise. +func (p *PullRequestReviewsEnforcementUpdate) GetRequireLastPushApproval() bool { + if p == nil || p.RequireLastPushApproval == nil { + return false + } + return *p.RequireLastPushApproval +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (p *PullRequestReviewThreadEvent) GetAction() string { if p == nil || p.Action == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 78e862892f5..bd2b95dea8b 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -15873,6 +15873,16 @@ func TestPullRequestReviewsEnforcementUpdate_GetRequireCodeOwnerReviews(tt *test p.GetRequireCodeOwnerReviews() } +func TestPullRequestReviewsEnforcementUpdate_GetRequireLastPushApproval(tt *testing.T) { + var zeroValue bool + p := &PullRequestReviewsEnforcementUpdate{RequireLastPushApproval: &zeroValue} + p.GetRequireLastPushApproval() + p = &PullRequestReviewsEnforcementUpdate{} + p.GetRequireLastPushApproval() + p = nil + p.GetRequireLastPushApproval() +} + func TestPullRequestReviewThreadEvent_GetAction(tt *testing.T) { var zeroValue string p := &PullRequestReviewThreadEvent{Action: &zeroValue} diff --git a/github/repos.go b/github/repos.go index e12cff08377..9364e8d69f7 100644 --- a/github/repos.go +++ b/github/repos.go @@ -1028,6 +1028,8 @@ type PullRequestReviewsEnforcement struct { // RequiredApprovingReviewCount specifies the number of approvals required before the pull request can be merged. // Valid values are 1-6. RequiredApprovingReviewCount int `json:"required_approving_review_count"` + // RequireLastPushApproval specifies whether the last pusher to a pull request branch can approve it. + RequireLastPushApproval bool `json:"require_last_push_approval"` } // PullRequestReviewsEnforcementRequest represents request to set the pull request review @@ -1064,6 +1066,8 @@ type PullRequestReviewsEnforcementUpdate struct { // RequiredApprovingReviewCount specifies the number of approvals required before the pull request can be merged. // Valid values are 1 - 6 or 0 to not require reviewers. RequiredApprovingReviewCount int `json:"required_approving_review_count"` + // RequireLastPushApproval specifies whether the last pusher to a pull request branch can approve it. + RequireLastPushApproval *bool `json:"require_last_push_approval,omitempty"` } // RequireLinearHistory represents the configuration to enforce branches with no merge commit. From ac285d13b1b4a14df9ae55afc91751f30d914ca8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Nov 2022 15:56:51 -0500 Subject: [PATCH 115/751] Bump github.com/google/go-github/v48 from 48.0.0 to 48.1.0 in /scrape (#2573) --- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 3adfb078eef..0b4c3e55e8b 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.9 - github.com/google/go-github/v48 v48.0.0 + github.com/google/go-github/v48 v48.1.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 d1f7cb56d53..3aebb2384d2 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.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v48 v48.0.0 h1:9H5fWVXFK6ZsRriyPbjtnFAkJnoj0WKFtTYfpCRrTm8= -github.com/google/go-github/v48 v48.0.0/go.mod h1:dDlehKBDo850ZPvCTK0sEqTCVWcrGl2LcDiajkYi89Y= +github.com/google/go-github/v48 v48.1.0 h1:nqPqq+0oRY2AMR/SRskGrrP4nnewPB7e/m2+kbT/UvM= +github.com/google/go-github/v48 v48.1.0/go.mod h1:dDlehKBDo850ZPvCTK0sEqTCVWcrGl2LcDiajkYi89Y= 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= From 593e21e9c2610f24ac82b1a8363a4a14255eb74b Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Thu, 24 Nov 2022 13:11:47 -0500 Subject: [PATCH 116/751] Bump golangci-lint version to 1.50.1 (#2576) --- .github/workflows/linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index c035aa6b4d1..c303f234680 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -28,6 +28,6 @@ jobs: - name: golangci-lint ${{ matrix.working-directory }} uses: golangci/golangci-lint-action@0ad9a0988b3973e851ab0a07adf248ec2e100376 #v3.3.1 with: - version: v1.44.0 + version: v1.50.1 working-directory: ${{ matrix.working-directory}} args: --verbose From 621c4ba7155bee18761f308a86fa71fddf3476b4 Mon Sep 17 00:00:00 2001 From: Pavel Dvoinos Date: Fri, 25 Nov 2022 04:23:16 +0200 Subject: [PATCH 117/751] Add RunAttempt field for WorkflowJob (#2562) --- github/actions_workflow_jobs.go | 1 + github/actions_workflow_jobs_test.go | 4 +++- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/github/actions_workflow_jobs.go b/github/actions_workflow_jobs.go index 2867e82af07..1422fd471c9 100644 --- a/github/actions_workflow_jobs.go +++ b/github/actions_workflow_jobs.go @@ -44,6 +44,7 @@ type WorkflowJob struct { RunnerName *string `json:"runner_name,omitempty"` RunnerGroupID *int64 `json:"runner_group_id,omitempty"` RunnerGroupName *string `json:"runner_group_name,omitempty"` + RunAttempt *int64 `json:"run_attempt,omitempty"` } // Jobs represents a slice of repository action workflow job. diff --git a/github/actions_workflow_jobs_test.go b/github/actions_workflow_jobs_test.go index 49315a03ba4..204f0014092 100644 --- a/github/actions_workflow_jobs_test.go +++ b/github/actions_workflow_jobs_test.go @@ -324,6 +324,7 @@ func TestJobs_Marshal(t *testing.T) { }, }, CheckRunURL: String("c"), + RunAttempt: Int64(2), }, }, } @@ -351,7 +352,8 @@ func TestJobs_Marshal(t *testing.T) { "started_at": ` + referenceTimeStr + `, "completed_at": ` + referenceTimeStr + ` }], - "check_run_url": "c" + "check_run_url": "c", + "run_attempt": 2 }] }` diff --git a/github/github-accessors.go b/github/github-accessors.go index 0d9db6ff896..2cc8ce0d561 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -20606,6 +20606,14 @@ func (w *WorkflowJob) GetNodeID() string { return *w.NodeID } +// GetRunAttempt returns the RunAttempt field if it's non-nil, zero value otherwise. +func (w *WorkflowJob) GetRunAttempt() int64 { + if w == nil || w.RunAttempt == nil { + return 0 + } + return *w.RunAttempt +} + // GetRunID returns the RunID field if it's non-nil, zero value otherwise. func (w *WorkflowJob) GetRunID() int64 { if w == nil || w.RunID == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index bd2b95dea8b..c0565725961 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -24063,6 +24063,16 @@ func TestWorkflowJob_GetNodeID(tt *testing.T) { w.GetNodeID() } +func TestWorkflowJob_GetRunAttempt(tt *testing.T) { + var zeroValue int64 + w := &WorkflowJob{RunAttempt: &zeroValue} + w.GetRunAttempt() + w = &WorkflowJob{} + w.GetRunAttempt() + w = nil + w.GetRunAttempt() +} + func TestWorkflowJob_GetRunID(tt *testing.T) { var zeroValue int64 w := &WorkflowJob{RunID: &zeroValue} From 18cd63d0e2bda56f9018d7f85bf11f81e6ce2dd2 Mon Sep 17 00:00:00 2001 From: Jaime Andres Torres B <69700780+XaurDesu@users.noreply.github.com> Date: Mon, 28 Nov 2022 11:58:59 -0500 Subject: [PATCH 118/751] Add LockBranch and AllowForkSyncing to repos.go (#2577) Fixes: #2574. --- github/github-accessors.go | 16 ++++++++++++++++ github/github-accessors_test.go | 20 ++++++++++++++++++++ github/repos.go | 4 ++++ 3 files changed, 40 insertions(+) diff --git a/github/github-accessors.go b/github/github-accessors.go index 2cc8ce0d561..33de4b7e6a0 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -12254,6 +12254,14 @@ func (p *Protection) GetAllowForcePushes() *AllowForcePushes { return p.AllowForcePushes } +// GetAllowForkSyncing returns the AllowForkSyncing field if it's non-nil, zero value otherwise. +func (p *Protection) GetAllowForkSyncing() bool { + if p == nil || p.AllowForkSyncing == nil { + return false + } + return *p.AllowForkSyncing +} + // GetEnforceAdmins returns the EnforceAdmins field. func (p *Protection) GetEnforceAdmins() *AdminEnforcement { if p == nil { @@ -12262,6 +12270,14 @@ func (p *Protection) GetEnforceAdmins() *AdminEnforcement { return p.EnforceAdmins } +// GetLockBranch returns the LockBranch field if it's non-nil, zero value otherwise. +func (p *Protection) GetLockBranch() bool { + if p == nil || p.LockBranch == nil { + return false + } + return *p.LockBranch +} + // GetRequiredConversationResolution returns the RequiredConversationResolution field. func (p *Protection) GetRequiredConversationResolution() *RequiredConversationResolution { if p == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index c0565725961..ecc0d7611bb 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -14310,6 +14310,16 @@ func TestProtection_GetAllowForcePushes(tt *testing.T) { p.GetAllowForcePushes() } +func TestProtection_GetAllowForkSyncing(tt *testing.T) { + var zeroValue bool + p := &Protection{AllowForkSyncing: &zeroValue} + p.GetAllowForkSyncing() + p = &Protection{} + p.GetAllowForkSyncing() + p = nil + p.GetAllowForkSyncing() +} + func TestProtection_GetEnforceAdmins(tt *testing.T) { p := &Protection{} p.GetEnforceAdmins() @@ -14317,6 +14327,16 @@ func TestProtection_GetEnforceAdmins(tt *testing.T) { p.GetEnforceAdmins() } +func TestProtection_GetLockBranch(tt *testing.T) { + var zeroValue bool + p := &Protection{LockBranch: &zeroValue} + p.GetLockBranch() + p = &Protection{} + p.GetLockBranch() + p = nil + p.GetLockBranch() +} + func TestProtection_GetRequiredConversationResolution(tt *testing.T) { p := &Protection{} p.GetRequiredConversationResolution() diff --git a/github/repos.go b/github/repos.go index 9364e8d69f7..2b1a263f0f0 100644 --- a/github/repos.go +++ b/github/repos.go @@ -840,6 +840,10 @@ type Protection struct { AllowForcePushes *AllowForcePushes `json:"allow_force_pushes"` AllowDeletions *AllowDeletions `json:"allow_deletions"` RequiredConversationResolution *RequiredConversationResolution `json:"required_conversation_resolution"` + // LockBranch represents if the branch is marked as read-only. If this is true, users will not be able to push to the branch. + LockBranch *bool `json:"lock_branch,omitempty"` + // AllowForkSyncing represents whether users can pull changes from upstream when the branch is locked. + AllowForkSyncing *bool `json:"allow_fork_syncing,omitempty"` } // BranchProtectionRule represents the rule applied to a repositories branch. From 6c430acced309db64330fb879a5bbbe242bcda8c Mon Sep 17 00:00:00 2001 From: ganeshkumarsv <53483484+ganeshkumarsv@users.noreply.github.com> Date: Tue, 29 Nov 2022 15:19:24 -0500 Subject: [PATCH 119/751] Add new field for issue state reason (#2583) --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ github/github-stringify_test.go | 3 ++- github/issues.go | 8 +++++--- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 33de4b7e6a0..c348e1a3b52 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -7470,6 +7470,14 @@ func (i *Issue) GetState() string { return *i.State } +// GetStateReason returns the StateReason field if it's non-nil, zero value otherwise. +func (i *Issue) 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 *Issue) GetTitle() string { if i == nil || i.Title == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index ecc0d7611bb..05fa1961a16 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -8780,6 +8780,16 @@ func TestIssue_GetState(tt *testing.T) { i.GetState() } +func TestIssue_GetStateReason(tt *testing.T) { + var zeroValue string + i := &Issue{StateReason: &zeroValue} + i.GetStateReason() + i = &Issue{} + i.GetStateReason() + i = nil + i.GetStateReason() +} + func TestIssue_GetTitle(tt *testing.T) { var zeroValue string i := &Issue{Title: &zeroValue} diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index b83ff2373d6..d4093a0921f 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -713,6 +713,7 @@ func TestIssue_String(t *testing.T) { ID: Int64(0), Number: Int(0), State: String(""), + StateReason: String(""), Locked: Bool(false), Title: String(""), Body: String(""), @@ -734,7 +735,7 @@ func TestIssue_String(t *testing.T) { NodeID: String(""), ActiveLockReason: String(""), } - want := `github.Issue{ID:0, Number:0, State:"", Locked:false, Title:"", Body:"", AuthorAssociation:"", User:github.User{}, Assignee:github.User{}, Comments:0, ClosedBy:github.User{}, URL:"", HTMLURL:"", CommentsURL:"", EventsURL:"", LabelsURL:"", RepositoryURL:"", Milestone:github.Milestone{}, PullRequestLinks:github.PullRequestLinks{}, Repository:github.Repository{}, Reactions:github.Reactions{}, NodeID:"", ActiveLockReason:""}` + want := `github.Issue{ID:0, Number:0, State:"", StateReason:"", Locked:false, Title:"", Body:"", AuthorAssociation:"", User:github.User{}, Assignee:github.User{}, Comments:0, ClosedBy:github.User{}, URL:"", HTMLURL:"", CommentsURL:"", EventsURL:"", LabelsURL:"", RepositoryURL:"", Milestone:github.Milestone{}, PullRequestLinks:github.PullRequestLinks{}, Repository:github.Repository{}, Reactions:github.Reactions{}, NodeID:"", ActiveLockReason:""}` if got := v.String(); got != want { t.Errorf("Issue.String = %v, want %v", got, want) } diff --git a/github/issues.go b/github/issues.go index 351ec09cc4f..571a721170c 100644 --- a/github/issues.go +++ b/github/issues.go @@ -25,9 +25,11 @@ type IssuesService service // this is an issue, and if PullRequestLinks is not nil, this is a pull request. // The IsPullRequest helper method can be used to check that. type Issue struct { - ID *int64 `json:"id,omitempty"` - Number *int `json:"number,omitempty"` - State *string `json:"state,omitempty"` + ID *int64 `json:"id,omitempty"` + Number *int `json:"number,omitempty"` + State *string `json:"state,omitempty"` + // StateReason can be one of: "completed", "not_planned", "reopened". + StateReason *string `json:"state_reason,omitempty"` Locked *bool `json:"locked,omitempty"` Title *string `json:"title,omitempty"` Body *string `json:"body,omitempty"` From 0621dee41764e68d3dd7505b5e29c7db094f08cb Mon Sep 17 00:00:00 2001 From: Sanjito Kurniawan Date: Thu, 1 Dec 2022 23:52:45 +0100 Subject: [PATCH 120/751] Add support for repository actions access level / permission (#2578) Fixes: #2575. --- github/github-accessors.go | 8 +++ github/github-accessors_test.go | 10 +++ github/repos_actions_access.go | 55 ++++++++++++++++ github/repos_actions_access_test.go | 98 +++++++++++++++++++++++++++++ 4 files changed, 171 insertions(+) create mode 100644 github/repos_actions_access.go create mode 100644 github/repos_actions_access_test.go diff --git a/github/github-accessors.go b/github/github-accessors.go index c348e1a3b52..6db890f64aa 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -15670,6 +15670,14 @@ func (r *Repository) GetWatchersCount() int { return *r.WatchersCount } +// GetAccessLevel returns the AccessLevel field if it's non-nil, zero value otherwise. +func (r *RepositoryActionsAccessLevel) GetAccessLevel() string { + if r == nil || r.AccessLevel == nil { + return "" + } + return *r.AccessLevel +} + // GetAdvancedSecurityCommitters returns the AdvancedSecurityCommitters field if it's non-nil, zero value otherwise. func (r *RepositoryActiveCommitters) GetAdvancedSecurityCommitters() int { if r == nil || r.AdvancedSecurityCommitters == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 05fa1961a16..8fca6fd0cc8 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -18238,6 +18238,16 @@ func TestRepository_GetWatchersCount(tt *testing.T) { r.GetWatchersCount() } +func TestRepositoryActionsAccessLevel_GetAccessLevel(tt *testing.T) { + var zeroValue string + r := &RepositoryActionsAccessLevel{AccessLevel: &zeroValue} + r.GetAccessLevel() + r = &RepositoryActionsAccessLevel{} + r.GetAccessLevel() + r = nil + r.GetAccessLevel() +} + func TestRepositoryActiveCommitters_GetAdvancedSecurityCommitters(tt *testing.T) { var zeroValue int r := &RepositoryActiveCommitters{AdvancedSecurityCommitters: &zeroValue} diff --git a/github/repos_actions_access.go b/github/repos_actions_access.go new file mode 100644 index 00000000000..55761eeb7ee --- /dev/null +++ b/github/repos_actions_access.go @@ -0,0 +1,55 @@ +// 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" +) + +// RepositoryActionsAccessLevel represents the repository actions access level. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-the-level-of-access-for-workflows-outside-of-the-repository +type RepositoryActionsAccessLevel struct { + // AccessLevel specifies the level of access that workflows outside of the repository have + // to actions and reusable workflows within the repository. + // Possible values are: "none", "organization" "enterprise". + AccessLevel *string `json:"access_level,omitempty"` +} + +// GetActionsAccessLevel gets the level of access that workflows outside of the repository have +// to actions and reusable workflows in the repository. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#get-the-level-of-access-for-workflows-outside-of-the-repository +func (s *RepositoriesService) GetActionsAccessLevel(ctx context.Context, owner, repo string) (*RepositoryActionsAccessLevel, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/permissions/access", owner, repo) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + raal := new(RepositoryActionsAccessLevel) + resp, err := s.client.Do(ctx, req, raal) + if err != nil { + return nil, resp, err + } + + return raal, resp, nil +} + +// EditActionsAccessLevel sets the level of access that workflows outside of the repository have +// to actions and reusable workflows in the repository. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-the-level-of-access-for-workflows-outside-of-the-repository +func (s *RepositoriesService) EditActionsAccessLevel(ctx context.Context, owner, repo string, repositoryActionsAccessLevel RepositoryActionsAccessLevel) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/permissions/access", owner, repo) + req, err := s.client.NewRequest("PUT", u, repositoryActionsAccessLevel) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} diff --git a/github/repos_actions_access_test.go b/github/repos_actions_access_test.go new file mode 100644 index 00000000000..7085ac7d5c7 --- /dev/null +++ b/github/repos_actions_access_test.go @@ -0,0 +1,98 @@ +// 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_GetActionsAccessLevel(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/actions/permissions/access", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprintf(w, `{"access_level": "none"}`) + }) + + ctx := context.Background() + org, _, err := client.Repositories.GetActionsAccessLevel(ctx, "o", "r") + if err != nil { + t.Errorf("Repositories.GetActionsAccessLevel returned error: %v", err) + } + want := &RepositoryActionsAccessLevel{AccessLevel: String("none")} + if !cmp.Equal(org, want) { + t.Errorf("Repositories.GetActionsAccessLevel returned %+v, want %+v", org, want) + } + + const methodName = "GetActionsAccessLevel" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.GetActionsAccessLevel(ctx, "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.GetActionsAccessLevel(ctx, "o", "r") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestRepositoriesService_EditActionsAccessLevel(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + input := &RepositoryActionsAccessLevel{AccessLevel: String("organization")} + + mux.HandleFunc("/repos/o/r/actions/permissions/access", func(w http.ResponseWriter, r *http.Request) { + v := new(RepositoryActionsAccessLevel) + json.NewDecoder(r.Body).Decode(v) + + testMethod(t, r, "PUT") + if !cmp.Equal(v, input) { + t.Errorf("Request body = %+v, want %+v", v, input) + } + }) + + ctx := context.Background() + _, err := client.Repositories.EditActionsAccessLevel(ctx, "o", "r", *input) + if err != nil { + t.Errorf("Repositories.EditActionsAccessLevel returned error: %v", err) + } + + const methodName = "EditActionsAccessLevel" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Repositories.EditActionsAccessLevel(ctx, "\n", "\n", *input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + resp, err := client.Repositories.EditActionsAccessLevel(ctx, "o", "r", *input) + return resp, err + }) +} + +func TestRepositoryActionsAccessLevel_Marshal(t *testing.T) { + testJSONMarshal(t, &ActionsPermissions{}, "{}") + + u := &RepositoryActionsAccessLevel{ + AccessLevel: String("enterprise"), + } + + want := `{ + "access_level": "enterprise" + }` + + testJSONMarshal(t, u, want) +} From 1cb3b4d18dee0f536ddc926ae0b7fead99d9addc Mon Sep 17 00:00:00 2001 From: Matija Horvat Date: Sun, 4 Dec 2022 18:32:09 +0100 Subject: [PATCH 121/751] Add has_discussions field to repository (#2589) Fixes: #2586. --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ github/github-stringify_test.go | 3 ++- github/repos.go | 15 +++++++++------ 4 files changed, 29 insertions(+), 7 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 6db890f64aa..5842fd00624 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -15158,6 +15158,14 @@ func (r *Repository) GetGitURL() string { return *r.GitURL } +// GetHasDiscussions returns the HasDiscussions field if it's non-nil, zero value otherwise. +func (r *Repository) GetHasDiscussions() bool { + if r == nil || r.HasDiscussions == nil { + return false + } + return *r.HasDiscussions +} + // GetHasDownloads returns the HasDownloads field if it's non-nil, zero value otherwise. func (r *Repository) GetHasDownloads() bool { if r == nil || r.HasDownloads == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 8fca6fd0cc8..77fafc4e381 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -17619,6 +17619,16 @@ func TestRepository_GetGitURL(tt *testing.T) { r.GetGitURL() } +func TestRepository_GetHasDiscussions(tt *testing.T) { + var zeroValue bool + r := &Repository{HasDiscussions: &zeroValue} + r.GetHasDiscussions() + r = &Repository{} + r.GetHasDiscussions() + r = nil + r.GetHasDiscussions() +} + func TestRepository_GetHasDownloads(tt *testing.T) { var zeroValue bool r := &Repository{HasDownloads: &zeroValue} diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index d4093a0921f..7c1372cc404 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -1546,6 +1546,7 @@ func TestRepository_String(t *testing.T) { HasPages: Bool(false), HasProjects: Bool(false), HasDownloads: Bool(false), + HasDiscussions: Bool(false), IsTemplate: Bool(false), LicenseTemplate: String(""), GitignoreTemplate: String(""), @@ -1591,7 +1592,7 @@ func TestRepository_String(t *testing.T) { 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, SquashMergeCommitTitle:"", SquashMergeCommitMessage:"", MergeCommitTitle:"", MergeCommitMessage:"", 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:""}` + 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, SquashMergeCommitTitle:"", SquashMergeCommitMessage:"", MergeCommitTitle:"", MergeCommitMessage:"", Topics:[""], Archived:false, Disabled:false, License:github.License{}, Private:false, HasIssues:false, HasWiki:false, HasPages:false, HasProjects:false, HasDownloads:false, HasDiscussions: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/repos.go b/github/repos.go index 2b1a263f0f0..fa4b4ae1a2c 100644 --- a/github/repos.go +++ b/github/repos.go @@ -88,6 +88,7 @@ type Repository struct { HasPages *bool `json:"has_pages,omitempty"` HasProjects *bool `json:"has_projects,omitempty"` HasDownloads *bool `json:"has_downloads,omitempty"` + HasDiscussions *bool `json:"has_discussions,omitempty"` IsTemplate *bool `json:"is_template,omitempty"` LicenseTemplate *string `json:"license_template,omitempty"` GitignoreTemplate *string `json:"gitignore_template,omitempty"` @@ -365,12 +366,13 @@ type createRepoRequest struct { Description *string `json:"description,omitempty"` Homepage *string `json:"homepage,omitempty"` - Private *bool `json:"private,omitempty"` - Visibility *string `json:"visibility,omitempty"` - HasIssues *bool `json:"has_issues,omitempty"` - HasProjects *bool `json:"has_projects,omitempty"` - HasWiki *bool `json:"has_wiki,omitempty"` - IsTemplate *bool `json:"is_template,omitempty"` + Private *bool `json:"private,omitempty"` + Visibility *string `json:"visibility,omitempty"` + HasIssues *bool `json:"has_issues,omitempty"` + HasProjects *bool `json:"has_projects,omitempty"` + HasWiki *bool `json:"has_wiki,omitempty"` + HasDiscussions *bool `json:"has_discussions,omitempty"` + IsTemplate *bool `json:"is_template,omitempty"` // Creating an organization repository. Required for non-owners. TeamID *int64 `json:"team_id,omitempty"` @@ -423,6 +425,7 @@ func (s *RepositoriesService) Create(ctx context.Context, org string, repo *Repo HasIssues: repo.HasIssues, HasProjects: repo.HasProjects, HasWiki: repo.HasWiki, + HasDiscussions: repo.HasDiscussions, IsTemplate: repo.IsTemplate, TeamID: repo.TeamID, AutoInit: repo.AutoInit, From 153bbc2620f5693e42fb1ae5b80d86c611bc6727 Mon Sep 17 00:00:00 2001 From: Sergei Popinevskii Date: Tue, 6 Dec 2022 16:21:19 +0300 Subject: [PATCH 122/751] Use 'concurrency' instead of 'styfle/cancel-workflow-action' in GitHub Actions (#2591) Fixes: #2590. --- .github/workflows/tests.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3a0366d42e9..d4a197746b8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,3 +1,7 @@ +concurrency: + group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + on: push: branches: @@ -15,9 +19,6 @@ permissions: jobs: test: - permissions: - actions: write # for styfle/cancel-workflow-action to cancel/stop running workflows - contents: read # for actions/checkout to fetch code strategy: matrix: go-version: [1.x, 1.18.x] @@ -35,11 +36,6 @@ jobs: runs-on: ${{ matrix.platform }} steps: - - name: Cancel previous - uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 #0.11.0 - with: - access_token: ${{ github.token }} - - uses: actions/setup-go@v3 with: go-version: ${{ matrix.go-version }} From 44d91eb972fe2eb6977a0ce5c8f7ef30a6c59d2f Mon Sep 17 00:00:00 2001 From: Chris Grau <99276511+chrisgrautealium@users.noreply.github.com> Date: Wed, 7 Dec 2022 16:10:37 -0800 Subject: [PATCH 123/751] Add MakeLatest parameter to support explicitly setting latest release (#2594) Fixes: #2593 . --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ github/github-stringify_test.go | 3 ++- github/repos_releases.go | 17 +++++++++++------ github/repos_releases_test.go | 4 ++++ 5 files changed, 35 insertions(+), 7 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 5842fd00624..f2cb16ff42c 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -16406,6 +16406,14 @@ func (r *RepositoryRelease) GetID() int64 { return *r.ID } +// GetMakeLatest returns the MakeLatest field if it's non-nil, zero value otherwise. +func (r *RepositoryRelease) GetMakeLatest() string { + if r == nil || r.MakeLatest == nil { + return "" + } + return *r.MakeLatest +} + // GetName returns the Name field if it's non-nil, zero value otherwise. func (r *RepositoryRelease) GetName() string { if r == nil || r.Name == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 77fafc4e381..71fc6c1f88d 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -19077,6 +19077,16 @@ func TestRepositoryRelease_GetID(tt *testing.T) { r.GetID() } +func TestRepositoryRelease_GetMakeLatest(tt *testing.T) { + var zeroValue string + r := &RepositoryRelease{MakeLatest: &zeroValue} + r.GetMakeLatest() + r = &RepositoryRelease{} + r.GetMakeLatest() + r = nil + r.GetMakeLatest() +} + func TestRepositoryRelease_GetName(tt *testing.T) { var zeroValue string r := &RepositoryRelease{Name: &zeroValue} diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index 7c1372cc404..b60fd0ad247 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -1696,6 +1696,7 @@ func TestRepositoryRelease_String(t *testing.T) { Body: String(""), Draft: Bool(false), Prerelease: Bool(false), + MakeLatest: String(""), DiscussionCategoryName: String(""), GenerateReleaseNotes: Bool(false), ID: Int64(0), @@ -1710,7 +1711,7 @@ func TestRepositoryRelease_String(t *testing.T) { Author: &User{}, NodeID: String(""), } - want := `github.RepositoryRelease{TagName:"", TargetCommitish:"", Name:"", Body:"", Draft:false, Prerelease:false, DiscussionCategoryName:"", GenerateReleaseNotes:false, ID:0, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, PublishedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, URL:"", HTMLURL:"", AssetsURL:"", UploadURL:"", ZipballURL:"", TarballURL:"", Author:github.User{}, NodeID:""}` + want := `github.RepositoryRelease{TagName:"", TargetCommitish:"", Name:"", Body:"", Draft:false, Prerelease:false, MakeLatest:"", DiscussionCategoryName:"", GenerateReleaseNotes:false, ID:0, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, PublishedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, URL:"", HTMLURL:"", AssetsURL:"", UploadURL:"", ZipballURL:"", TarballURL:"", Author:github.User{}, NodeID:""}` if got := v.String(); got != want { t.Errorf("RepositoryRelease.String = %v, want %v", got, want) } diff --git a/github/repos_releases.go b/github/repos_releases.go index c030f04d9a9..464c2ee1e2b 100644 --- a/github/repos_releases.go +++ b/github/repos_releases.go @@ -19,12 +19,14 @@ import ( // RepositoryRelease represents a GitHub release in a repository. type RepositoryRelease struct { - TagName *string `json:"tag_name,omitempty"` - TargetCommitish *string `json:"target_commitish,omitempty"` - Name *string `json:"name,omitempty"` - Body *string `json:"body,omitempty"` - Draft *bool `json:"draft,omitempty"` - Prerelease *bool `json:"prerelease,omitempty"` + TagName *string `json:"tag_name,omitempty"` + TargetCommitish *string `json:"target_commitish,omitempty"` + Name *string `json:"name,omitempty"` + Body *string `json:"body,omitempty"` + Draft *bool `json:"draft,omitempty"` + Prerelease *bool `json:"prerelease,omitempty"` + // MakeLatest can be one of: "true", "false", or "legacy". + MakeLatest *string `json:"make_latest,omitempty"` DiscussionCategoryName *string `json:"discussion_category_name,omitempty"` // The following fields are not used in EditRelease: @@ -176,6 +178,7 @@ type repositoryReleaseRequest struct { Body *string `json:"body,omitempty"` Draft *bool `json:"draft,omitempty"` Prerelease *bool `json:"prerelease,omitempty"` + MakeLatest *string `json:"make_latest,omitempty"` GenerateReleaseNotes *bool `json:"generate_release_notes,omitempty"` DiscussionCategoryName *string `json:"discussion_category_name,omitempty"` } @@ -196,6 +199,7 @@ func (s *RepositoriesService) CreateRelease(ctx context.Context, owner, repo str Body: release.Body, Draft: release.Draft, Prerelease: release.Prerelease, + MakeLatest: release.MakeLatest, DiscussionCategoryName: release.DiscussionCategoryName, GenerateReleaseNotes: release.GenerateReleaseNotes, } @@ -229,6 +233,7 @@ func (s *RepositoriesService) EditRelease(ctx context.Context, owner, repo strin Body: release.Body, Draft: release.Draft, Prerelease: release.Prerelease, + MakeLatest: release.MakeLatest, DiscussionCategoryName: release.DiscussionCategoryName, } diff --git a/github/repos_releases_test.go b/github/repos_releases_test.go index 77a20ffe951..73a9f3a530d 100644 --- a/github/repos_releases_test.go +++ b/github/repos_releases_test.go @@ -708,6 +708,7 @@ func TestRepositoryReleaseRequest_Marshal(t *testing.T) { Body: String("body"), Draft: Bool(false), Prerelease: Bool(false), + MakeLatest: String("legacy"), DiscussionCategoryName: String("dcn"), } @@ -718,6 +719,7 @@ func TestRepositoryReleaseRequest_Marshal(t *testing.T) { "body": "body", "draft": false, "prerelease": false, + "make_latest": "legacy", "discussion_category_name": "dcn" }` @@ -774,6 +776,7 @@ func TestRepositoryRelease_Marshal(t *testing.T) { Body: String("body"), Draft: Bool(false), Prerelease: Bool(false), + MakeLatest: String("legacy"), DiscussionCategoryName: String("dcn"), ID: Int64(1), CreatedAt: &Timestamp{referenceTime}, @@ -796,6 +799,7 @@ func TestRepositoryRelease_Marshal(t *testing.T) { "body": "body", "draft": false, "prerelease": false, + "make_latest": "legacy", "discussion_category_name": "dcn", "id": 1, "created_at": ` + referenceTimeStr + `, From 3e3f03c6b36d8ff6fb07ecc87c365e855710d14d Mon Sep 17 00:00:00 2001 From: Takuma Kajikawa Date: Sat, 10 Dec 2022 01:20:55 +0900 Subject: [PATCH 124/751] Change create fork options from url param to body param (#2490) Fixes: #2489. --- github/repos_forks.go | 15 +++++---------- github/repos_forks_test.go | 4 ++-- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/github/repos_forks.go b/github/repos_forks.go index 5c7d5dbd785..f175dfe3b03 100644 --- a/github/repos_forks.go +++ b/github/repos_forks.go @@ -7,9 +7,8 @@ package github import ( "context" - "fmt" - "encoding/json" + "fmt" ) // RepositoryListForksOptions specifies the optional parameters to the @@ -53,9 +52,9 @@ func (s *RepositoriesService) ListForks(ctx context.Context, owner, repo string, // RepositoriesService.CreateFork method. type RepositoryCreateForkOptions struct { // The organization to fork the repository into. - Organization string `url:"organization,omitempty"` - Name string `url:"name,omitempty"` - DefaultBranchOnly bool `url:"default_branch_only,omitempty"` + Organization string `json:"organization,omitempty"` + Name string `json:"name,omitempty"` + DefaultBranchOnly bool `json:"default_branch_only,omitempty"` } // CreateFork creates a fork of the specified repository. @@ -70,12 +69,8 @@ type RepositoryCreateForkOptions struct { // GitHub API docs: https://docs.github.com/en/rest/repos/forks#create-a-fork func (s *RepositoriesService) CreateFork(ctx context.Context, owner, repo string, opts *RepositoryCreateForkOptions) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/forks", owner, repo) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - req, err := s.client.NewRequest("POST", u, nil) + req, err := s.client.NewRequest("POST", u, opts) if err != nil { return nil, nil, err } diff --git a/github/repos_forks_test.go b/github/repos_forks_test.go index 07be423bc35..d1a17f62d1b 100644 --- a/github/repos_forks_test.go +++ b/github/repos_forks_test.go @@ -73,7 +73,7 @@ func TestRepositoriesService_CreateFork(t *testing.T) { mux.HandleFunc("/repos/o/r/forks", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") - testFormValues(t, r, values{"organization": "o", "name": "n", "default_branch_only": "true"}) + testBody(t, r, `{"organization":"o","name":"n","default_branch_only":true}`+"\n") fmt.Fprint(w, `{"id":1}`) }) @@ -110,7 +110,7 @@ func TestRepositoriesService_CreateFork_deferred(t *testing.T) { mux.HandleFunc("/repos/o/r/forks", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") - testFormValues(t, r, values{"organization": "o", "name": "n", "default_branch_only": "true"}) + testBody(t, r, `{"organization":"o","name":"n","default_branch_only":true}`+"\n") // This response indicates the fork will happen asynchronously. w.WriteHeader(http.StatusAccepted) fmt.Fprint(w, `{"id":1}`) From 9d020d70e37aa5e0cd9d68a127a4a3e07a25d6aa Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Fri, 9 Dec 2022 11:22:41 -0500 Subject: [PATCH 125/751] Support new GitHub v3 API calendar-based versioning (#2581) Fixes: #2580. --- README.md | 34 ++++++++++++++++++++++++++++ github/github.go | 52 ++++++++++++++++++++++++++++++++++--------- github/github_test.go | 38 +++++++++++++++++++++++++++++++ 3 files changed, 114 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 0f99698d17d..9406f76e086 100644 --- a/README.md +++ b/README.md @@ -332,6 +332,40 @@ Preview functionality may take the form of entire methods or simply additional data returned from an otherwise non-preview method. Refer to the GitHub API documentation for details on preview functionality. +### Calendar Versioning ### + +As of 2022-11-28, GitHub [has announced](https://github.blog/2022-11-28-to-infinity-and-beyond-enabling-the-future-of-githubs-rest-api-with-api-versioning/) +that they are starting to version their v3 API based on "calendar-versioning". + +In practice, our goal is to make per-method version overrides (at +least in the core library) rare and temporary. + +Our understanding of the GitHub docs is that they will be revving the +entire API to each new date-based version, even if only a few methods +have breaking changes. Other methods will accept the new version with +their existing functionality. So when a new date-based version of the +GitHub API is released, we (the repo maintainers) plan to: + +* update each method that had breaking changes, overriding their + per-method API version header. This may happen in one or multiple + commits and PRs, and is all done in the main branch. + +* once all of the methods with breaking changes have been updated, + have a final commit that bumps the default API version, and remove + all of the per-method overrides. That would now get a major version + bump when the next go-github release is made. + +### Version Compatibility Table ### + +The following table identifies which version of the GitHub API is +supported by this (and past) versions of this repo (go-github). +Versions prior to 48.2.0 are not listed. + +| go-github Version | GitHub v3 API Version | +| ----------------- | --------------------- | +| 48.2.0 | 2022-11-28 | + + ## License ## This library is distributed under the BSD-style license found in the [LICENSE](./LICENSE) diff --git a/github/github.go b/github/github.go index 38a5bcd29b4..3599a88d090 100644 --- a/github/github.go +++ b/github/github.go @@ -27,12 +27,14 @@ import ( ) const ( - Version = "v48.0.0" + Version = "v48.2.0" - defaultBaseURL = "https://api.github.com/" - defaultUserAgent = "go-github" + "/" + Version - uploadBaseURL = "https://uploads.github.com/" + defaultAPIVersion = "2022-11-28" + defaultBaseURL = "https://api.github.com/" + defaultUserAgent = "go-github" + "/" + Version + uploadBaseURL = "https://uploads.github.com/" + headerAPIVersion = "X-GitHub-Api-Version" headerRateLimit = "X-RateLimit-Limit" headerRateRemaining = "X-RateLimit-Remaining" headerRateReset = "X-RateLimit-Reset" @@ -392,12 +394,24 @@ func NewEnterpriseClient(baseURL, uploadURL string, httpClient *http.Client) (*C return c, nil } +// RequestOption represents an option that can modify an http.Request. +type RequestOption func(req *http.Request) + +// WithVersion overrides the GitHub v3 API version for this individual request. +// For more information, see: +// https://github.blog/2022-11-28-to-infinity-and-beyond-enabling-the-future-of-githubs-rest-api-with-api-versioning/ +func WithVersion(version string) RequestOption { + return func(req *http.Request) { + req.Header.Set(headerAPIVersion, version) + } +} + // NewRequest creates an API request. A relative URL can be provided in urlStr, // in which case it is resolved relative to the BaseURL of the Client. // Relative URLs should always be specified without a preceding slash. If // specified, the value pointed to by body is JSON encoded and included as the // request body. -func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error) { +func (c *Client) NewRequest(method, urlStr string, body interface{}, opts ...RequestOption) (*http.Request, error) { if !strings.HasSuffix(c.BaseURL.Path, "/") { return nil, fmt.Errorf("BaseURL must have a trailing slash, but %q does not", c.BaseURL) } @@ -430,6 +444,12 @@ func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Requ if c.UserAgent != "" { req.Header.Set("User-Agent", c.UserAgent) } + req.Header.Set(headerAPIVersion, defaultAPIVersion) + + for _, opt := range opts { + opt(req) + } + return req, nil } @@ -437,7 +457,7 @@ func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Requ // in which case it is resolved relative to the BaseURL of the Client. // Relative URLs should always be specified without a preceding slash. // Body is sent with Content-Type: application/x-www-form-urlencoded. -func (c *Client) NewFormRequest(urlStr string, body io.Reader) (*http.Request, error) { +func (c *Client) NewFormRequest(urlStr string, body io.Reader, opts ...RequestOption) (*http.Request, error) { if !strings.HasSuffix(c.BaseURL.Path, "/") { return nil, fmt.Errorf("BaseURL must have a trailing slash, but %q does not", c.BaseURL) } @@ -457,13 +477,19 @@ func (c *Client) NewFormRequest(urlStr string, body io.Reader) (*http.Request, e if c.UserAgent != "" { req.Header.Set("User-Agent", c.UserAgent) } + req.Header.Set(headerAPIVersion, defaultAPIVersion) + + for _, opt := range opts { + opt(req) + } + return req, nil } // NewUploadRequest creates an upload request. A relative URL can be provided in // urlStr, in which case it is resolved relative to the UploadURL of the Client. // Relative URLs should always be specified without a preceding slash. -func (c *Client) NewUploadRequest(urlStr string, reader io.Reader, size int64, mediaType string) (*http.Request, error) { +func (c *Client) NewUploadRequest(urlStr string, reader io.Reader, size int64, mediaType string, opts ...RequestOption) (*http.Request, error) { if !strings.HasSuffix(c.UploadURL.Path, "/") { return nil, fmt.Errorf("UploadURL must have a trailing slash, but %q does not", c.UploadURL) } @@ -485,6 +511,12 @@ func (c *Client) NewUploadRequest(urlStr string, reader io.Reader, size int64, m req.Header.Set("Content-Type", mediaType) req.Header.Set("Accept", mediaTypeV3) req.Header.Set("User-Agent", c.UserAgent) + req.Header.Set(headerAPIVersion, defaultAPIVersion) + + for _, opt := range opts { + opt(req) + } + return req, nil } @@ -1358,8 +1390,8 @@ func formatRateReset(d time.Duration) string { // When using roundTripWithOptionalFollowRedirect, note that it // is the responsibility of the caller to close the response body. -func (c *Client) roundTripWithOptionalFollowRedirect(ctx context.Context, u string, followRedirects bool) (*http.Response, error) { - req, err := c.NewRequest("GET", u, nil) +func (c *Client) roundTripWithOptionalFollowRedirect(ctx context.Context, u string, followRedirects bool, opts ...RequestOption) (*http.Response, error) { + req, err := c.NewRequest("GET", u, nil, opts...) if err != nil { return nil, err } @@ -1380,7 +1412,7 @@ func (c *Client) roundTripWithOptionalFollowRedirect(ctx context.Context, u stri if followRedirects && resp.StatusCode == http.StatusMovedPermanently { resp.Body.Close() u = resp.Header.Get("Location") - resp, err = c.roundTripWithOptionalFollowRedirect(ctx, u, false) + resp, err = c.roundTripWithOptionalFollowRedirect(ctx, u, false, opts...) } return resp, err } diff --git a/github/github_test.go b/github/github_test.go index c4ceb89bb54..53809399fac 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -517,6 +517,17 @@ func TestNewRequest(t *testing.T) { if !strings.Contains(userAgent, Version) { t.Errorf("NewRequest() User-Agent should contain %v, found %v", Version, userAgent) } + + apiVersion := req.Header.Get(headerAPIVersion) + if got, want := apiVersion, defaultAPIVersion; got != want { + t.Errorf("NewRequest() %v header is %v, want %v", headerAPIVersion, got, want) + } + + req, _ = c.NewRequest("GET", inURL, inBody, WithVersion("2022-11-29")) + apiVersion = req.Header.Get(headerAPIVersion) + if got, want := apiVersion, "2022-11-29"; got != want { + t.Errorf("NewRequest() %v header is %v, want %v", headerAPIVersion, got, want) + } } func TestNewRequest_invalidJSON(t *testing.T) { @@ -626,6 +637,17 @@ func TestNewFormRequest(t *testing.T) { if got, want := req.Header.Get("User-Agent"), c.UserAgent; got != want { t.Errorf("NewFormRequest() User-Agent is %v, want %v", got, want) } + + apiVersion := req.Header.Get(headerAPIVersion) + if got, want := apiVersion, defaultAPIVersion; got != want { + t.Errorf("NewRequest() %v header is %v, want %v", headerAPIVersion, got, want) + } + + req, _ = c.NewFormRequest(inURL, inBody, WithVersion("2022-11-29")) + apiVersion = req.Header.Get(headerAPIVersion) + if got, want := apiVersion, "2022-11-29"; got != want { + t.Errorf("NewRequest() %v header is %v, want %v", headerAPIVersion, got, want) + } } func TestNewFormRequest_badURL(t *testing.T) { @@ -680,6 +702,22 @@ func TestNewFormRequest_errorForNoTrailingSlash(t *testing.T) { } } +func TestNewUploadRequest_WithVersion(t *testing.T) { + c := NewClient(nil) + req, _ := c.NewUploadRequest("https://example.com/", nil, 0, "") + + apiVersion := req.Header.Get(headerAPIVersion) + if got, want := apiVersion, defaultAPIVersion; got != want { + t.Errorf("NewRequest() %v header is %v, want %v", headerAPIVersion, got, want) + } + + req, _ = c.NewUploadRequest("https://example.com/", nil, 0, "", WithVersion("2022-11-29")) + apiVersion = req.Header.Get(headerAPIVersion) + if got, want := apiVersion, "2022-11-29"; got != want { + t.Errorf("NewRequest() %v header is %v, want %v", headerAPIVersion, got, want) + } +} + func TestNewUploadRequest_badURL(t *testing.T) { c := NewClient(nil) _, err := c.NewUploadRequest(":", nil, 0, "") From ae4fda8be3e02ebf8a8c5307b39d36691bffddbc Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Fri, 9 Dec 2022 11:28:21 -0500 Subject: [PATCH 126/751] Update AUTHORS for v48.2.0 Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> --- AUTHORS | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/AUTHORS b/AUTHORS index 47e85bdb780..5e40cd1f38e 100644 --- a/AUTHORS +++ b/AUTHORS @@ -152,6 +152,7 @@ Florian Wagner Francesc Gil Francis Francisco Guimarães +François de Metz Fredrik Jönsson Gabriel Garrett Squire @@ -261,6 +262,7 @@ Martins Sipenko Marwan Sulaiman Masayuki Izumi Mat Geist +Matija Horvat Matin Rahmanian Matt Matt Brender @@ -274,6 +276,7 @@ Michael Tiller Michał Glapa Michelangelo Morrillo Miguel Elias dos Santos +Mike Chen Mohammed AlDujaili Mukundan Senthil Munia Balayil @@ -304,6 +307,7 @@ parkhyukjun89 Pat Alwell Patrick DeVivo Patrick Marabeas +Pavel Dvoinos Pavel Shtanko Pete Wagner Petr Shevtsov @@ -359,6 +363,7 @@ Sasha Melentyev Sean Wang Sebastian Mandrean Sebastian Mæland Pedersen +Sergei Popinevskii Sergey Romanov Sergio Garcia Seth Vargo @@ -399,6 +404,7 @@ tkhandel Tobias Gesellchen Tom Payne Trey Tacon +tsbkw ttacon Vaibhav Singh Varadarajan Aravamudhan From 6216f64645a30b782856f32e176c70d62a554e70 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Fri, 9 Dec 2022 15:35:39 -0500 Subject: [PATCH 127/751] Bump scrape and examples to use v48.2.0 (#2596) --- example/go.mod | 2 +- example/go.sum | 4 ++-- example/newreposecretwithlibsodium/go.mod | 2 +- example/newreposecretwithlibsodium/go.sum | 4 ++-- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/example/go.mod b/example/go.mod index 9d989505354..f10419073fc 100644 --- a/example/go.mod +++ b/example/go.mod @@ -4,7 +4,7 @@ go 1.17 require ( github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 - github.com/google/go-github/v48 v48.0.0 + github.com/google/go-github/v48 v48.2.0 golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be google.golang.org/appengine v1.6.7 diff --git a/example/go.sum b/example/go.sum index a3c96e95f22..663dff29860 100644 --- a/example/go.sum +++ b/example/go.sum @@ -7,8 +7,8 @@ github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/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-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github/v41 v41.0.0 h1:HseJrM2JFf2vfiZJ8anY2hqBjdfY1Vlj/K27ueww4gg= github.com/google/go-github/v41 v41.0.0/go.mod h1:XgmCA5H323A9rtgExdTcnDkcqp6S30AVACCBDOonIxg= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index 4519c051e4c..a190c0a8a41 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -4,7 +4,7 @@ go 1.15 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb - github.com/google/go-github/v48 v48.0.0 + github.com/google/go-github/v48 v48.2.0 golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 ) diff --git a/example/newreposecretwithlibsodium/go.sum b/example/newreposecretwithlibsodium/go.sum index abc73624ad6..dfbf7641b99 100644 --- a/example/newreposecretwithlibsodium/go.sum +++ b/example/newreposecretwithlibsodium/go.sum @@ -84,8 +84,8 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= diff --git a/scrape/go.mod b/scrape/go.mod index 0b4c3e55e8b..65e2b6ebde0 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.9 - github.com/google/go-github/v48 v48.1.0 + github.com/google/go-github/v48 v48.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 3aebb2384d2..ce4b6dc2991 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.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v48 v48.1.0 h1:nqPqq+0oRY2AMR/SRskGrrP4nnewPB7e/m2+kbT/UvM= -github.com/google/go-github/v48 v48.1.0/go.mod h1:dDlehKBDo850ZPvCTK0sEqTCVWcrGl2LcDiajkYi89Y= +github.com/google/go-github/v48 v48.2.0 h1:68puzySE6WqUY9KWmpOsDEQfDZsso98rT6pZcz9HqcE= +github.com/google/go-github/v48 v48.2.0/go.mod h1:dDlehKBDo850ZPvCTK0sEqTCVWcrGl2LcDiajkYi89Y= 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= From 2b4d59656c6908765328c51d32e63e0ef8a0fa6b Mon Sep 17 00:00:00 2001 From: Marcelo Sousa <601882+marcelosousa@users.noreply.github.com> Date: Fri, 16 Dec 2022 15:13:07 +0000 Subject: [PATCH 128/751] Fix GitHub docs URL for get repository API (#2600) --- github/repos.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/repos.go b/github/repos.go index fa4b4ae1a2c..bd413fe60d4 100644 --- a/github/repos.go +++ b/github/repos.go @@ -495,7 +495,7 @@ func (s *RepositoriesService) CreateFromTemplate(ctx context.Context, templateOw // Get fetches a repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#update-a-repository +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#get-a-repository func (s *RepositoriesService) Get(ctx context.Context, owner, repo string) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v", owner, repo) req, err := s.client.NewRequest("GET", u, nil) From c5d656af46ef8724479b04f70eb53b409f50189b Mon Sep 17 00:00:00 2001 From: Jason Field Date: Mon, 26 Dec 2022 20:35:48 +0800 Subject: [PATCH 129/751] Fix JSON protection unmarshal error (#2606) --- github/github-accessors.go | 36 ++++++++++++++++++++++++--------- github/github-accessors_test.go | 30 +++++++++++++++++++-------- github/repos.go | 16 +++++++++++---- 3 files changed, 60 insertions(+), 22 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index f2cb16ff42c..e78684ca1cc 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -470,6 +470,14 @@ func (a *AllowDeletionsEnforcementLevelChanges) GetFrom() string { return *a.From } +// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise. +func (a *AllowForkSyncing) GetEnabled() bool { + if a == nil || a.Enabled == nil { + return false + } + return *a.Enabled +} + // GetRef returns the Ref field if it's non-nil, zero value otherwise. func (a *AnalysesListOptions) GetRef() string { if a == nil || a.Ref == nil { @@ -8742,6 +8750,14 @@ func (l *Location) GetStartLine() int { return *l.StartLine } +// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise. +func (l *LockBranch) GetEnabled() bool { + if l == nil || l.Enabled == nil { + return false + } + return *l.Enabled +} + // GetEffectiveDate returns the EffectiveDate field if it's non-nil, zero value otherwise. func (m *MarketplacePendingChange) GetEffectiveDate() Timestamp { if m == nil || m.EffectiveDate == nil { @@ -12262,12 +12278,12 @@ func (p *Protection) GetAllowForcePushes() *AllowForcePushes { return p.AllowForcePushes } -// GetAllowForkSyncing returns the AllowForkSyncing field if it's non-nil, zero value otherwise. -func (p *Protection) GetAllowForkSyncing() bool { - if p == nil || p.AllowForkSyncing == nil { - return false +// GetAllowForkSyncing returns the AllowForkSyncing field. +func (p *Protection) GetAllowForkSyncing() *AllowForkSyncing { + if p == nil { + return nil } - return *p.AllowForkSyncing + return p.AllowForkSyncing } // GetEnforceAdmins returns the EnforceAdmins field. @@ -12278,12 +12294,12 @@ func (p *Protection) GetEnforceAdmins() *AdminEnforcement { return p.EnforceAdmins } -// GetLockBranch returns the LockBranch field if it's non-nil, zero value otherwise. -func (p *Protection) GetLockBranch() bool { - if p == nil || p.LockBranch == nil { - return false +// GetLockBranch returns the LockBranch field. +func (p *Protection) GetLockBranch() *LockBranch { + if p == nil { + return nil } - return *p.LockBranch + return p.LockBranch } // GetRequiredConversationResolution returns the RequiredConversationResolution field. diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 71fc6c1f88d..52425ded181 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -528,6 +528,16 @@ func TestAllowDeletionsEnforcementLevelChanges_GetFrom(tt *testing.T) { a.GetFrom() } +func TestAllowForkSyncing_GetEnabled(tt *testing.T) { + var zeroValue bool + a := &AllowForkSyncing{Enabled: &zeroValue} + a.GetEnabled() + a = &AllowForkSyncing{} + a.GetEnabled() + a = nil + a.GetEnabled() +} + func TestAnalysesListOptions_GetRef(tt *testing.T) { var zeroValue string a := &AnalysesListOptions{Ref: &zeroValue} @@ -10265,6 +10275,16 @@ func TestLocation_GetStartLine(tt *testing.T) { l.GetStartLine() } +func TestLockBranch_GetEnabled(tt *testing.T) { + var zeroValue bool + l := &LockBranch{Enabled: &zeroValue} + l.GetEnabled() + l = &LockBranch{} + l.GetEnabled() + l = nil + l.GetEnabled() +} + func TestMarketplacePendingChange_GetEffectiveDate(tt *testing.T) { var zeroValue Timestamp m := &MarketplacePendingChange{EffectiveDate: &zeroValue} @@ -14321,10 +14341,7 @@ func TestProtection_GetAllowForcePushes(tt *testing.T) { } func TestProtection_GetAllowForkSyncing(tt *testing.T) { - var zeroValue bool - p := &Protection{AllowForkSyncing: &zeroValue} - p.GetAllowForkSyncing() - p = &Protection{} + p := &Protection{} p.GetAllowForkSyncing() p = nil p.GetAllowForkSyncing() @@ -14338,10 +14355,7 @@ func TestProtection_GetEnforceAdmins(tt *testing.T) { } func TestProtection_GetLockBranch(tt *testing.T) { - var zeroValue bool - p := &Protection{LockBranch: &zeroValue} - p.GetLockBranch() - p = &Protection{} + p := &Protection{} p.GetLockBranch() p = nil p.GetLockBranch() diff --git a/github/repos.go b/github/repos.go index bd413fe60d4..bef81b3d89c 100644 --- a/github/repos.go +++ b/github/repos.go @@ -843,10 +843,18 @@ type Protection struct { AllowForcePushes *AllowForcePushes `json:"allow_force_pushes"` AllowDeletions *AllowDeletions `json:"allow_deletions"` RequiredConversationResolution *RequiredConversationResolution `json:"required_conversation_resolution"` - // LockBranch represents if the branch is marked as read-only. If this is true, users will not be able to push to the branch. - LockBranch *bool `json:"lock_branch,omitempty"` - // AllowForkSyncing represents whether users can pull changes from upstream when the branch is locked. - AllowForkSyncing *bool `json:"allow_fork_syncing,omitempty"` + LockBranch *LockBranch `json:"lock_branch,omitempty"` + AllowForkSyncing *AllowForkSyncing `json:"allow_fork_syncing,omitempty"` +} + +// LockBranch represents if the branch is marked as read-only. If this is true, users will not be able to push to the branch. +type LockBranch struct { + Enabled *bool `json:"enabled,omitempty"` +} + +// AllowForkSyncing represents whether users can pull changes from upstream when the branch is locked. +type AllowForkSyncing struct { + Enabled *bool `json:"enabled,omitempty"` } // BranchProtectionRule represents the rule applied to a repositories branch. From 84cc7d50b18ae20b63e23fe86c7b7690e6c3063e Mon Sep 17 00:00:00 2001 From: James Turley Date: Mon, 26 Dec 2022 12:37:39 +0000 Subject: [PATCH 130/751] Change actions billing structs to maps (#2597) Fixes: #2595. --- github/actions_workflow_runs.go | 13 +++---- github/actions_workflow_runs_test.go | 31 ++++++++--------- github/actions_workflows.go | 11 +++--- github/actions_workflows_test.go | 36 +++++++++---------- github/billing.go | 7 ++-- github/billing_test.go | 24 ++++++------- github/github-accessors.go | 52 ++-------------------------- github/github-accessors_test.go | 42 ---------------------- 8 files changed, 58 insertions(+), 158 deletions(-) diff --git a/github/actions_workflow_runs.go b/github/actions_workflow_runs.go index 9fd01c4a563..6241dc629fc 100644 --- a/github/actions_workflow_runs.go +++ b/github/actions_workflow_runs.go @@ -65,16 +65,13 @@ type ListWorkflowRunsOptions struct { // WorkflowRunUsage represents a usage of a specific workflow run. type WorkflowRunUsage struct { - Billable *WorkflowRunEnvironment `json:"billable,omitempty"` - RunDurationMS *int64 `json:"run_duration_ms,omitempty"` + Billable *WorkflowRunBillMap `json:"billable,omitempty"` + RunDurationMS *int64 `json:"run_duration_ms,omitempty"` } -// WorkflowRunEnvironment represents different runner environments available for a workflow run. -type WorkflowRunEnvironment struct { - Ubuntu *WorkflowRunBill `json:"UBUNTU,omitempty"` - MacOS *WorkflowRunBill `json:"MACOS,omitempty"` - Windows *WorkflowRunBill `json:"WINDOWS,omitempty"` -} +// WorkflowRunBillMap represents different runner environments available for a workflow run. +// Its key is the name of its environment, e.g. "UBUNTU", "MACOS", "WINDOWS", etc. +type WorkflowRunBillMap map[string]*WorkflowRunBill // WorkflowRunBill specifies billable time for a specific environment in a workflow run. type WorkflowRunBill struct { diff --git a/github/actions_workflow_runs_test.go b/github/actions_workflow_runs_test.go index 2705363ba64..641c4d739b7 100644 --- a/github/actions_workflow_runs_test.go +++ b/github/actions_workflow_runs_test.go @@ -403,7 +403,6 @@ func TestActionService_ListRepositoryWorkflowRuns(t *testing.T) { opts := &ListWorkflowRunsOptions{ListOptions: ListOptions{Page: 2, PerPage: 2}} ctx := context.Background() runs, _, err := client.Actions.ListRepositoryWorkflowRuns(ctx, "o", "r", opts) - if err != nil { t.Errorf("Actions.ListRepositoryWorkflowRuns returned error: %v", err) } @@ -505,8 +504,8 @@ func TestActionsService_GetWorkflowRunUsageByID(t *testing.T) { } want := &WorkflowRunUsage{ - Billable: &WorkflowRunEnvironment{ - Ubuntu: &WorkflowRunBill{ + Billable: &WorkflowRunBillMap{ + "UBUNTU": &WorkflowRunBill{ TotalMS: Int64(180000), Jobs: Int(1), JobRuns: []*WorkflowRunJobRun{ @@ -516,7 +515,7 @@ func TestActionsService_GetWorkflowRunUsageByID(t *testing.T) { }, }, }, - MacOS: &WorkflowRunBill{ + "MACOS": &WorkflowRunBill{ TotalMS: Int64(240000), Jobs: Int(2), JobRuns: []*WorkflowRunJobRun{ @@ -530,7 +529,7 @@ func TestActionsService_GetWorkflowRunUsageByID(t *testing.T) { }, }, }, - Windows: &WorkflowRunBill{ + "WINDOWS": &WorkflowRunBill{ TotalMS: Int64(300000), Jobs: Int(2), }, @@ -975,7 +974,7 @@ func TestWorkflowRuns_Marshal(t *testing.T) { "created_at": ` + referenceTimeStr + `, "suspended_at": ` + referenceTimeStr + `, "url": "u" - } + } } ] }` @@ -999,19 +998,19 @@ func TestWorkflowRunBill_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } -func TestWorkflowRunEnvironment_Marshal(t *testing.T) { - testJSONMarshal(t, &WorkflowRunEnvironment{}, "{}") +func TestWorkflowRunBillMap_Marshal(t *testing.T) { + testJSONMarshal(t, &WorkflowRunBillMap{}, "{}") - u := &WorkflowRunEnvironment{ - Ubuntu: &WorkflowRunBill{ + u := &WorkflowRunBillMap{ + "UBUNTU": &WorkflowRunBill{ TotalMS: Int64(1), Jobs: Int(1), }, - MacOS: &WorkflowRunBill{ + "MACOS": &WorkflowRunBill{ TotalMS: Int64(1), Jobs: Int(1), }, - Windows: &WorkflowRunBill{ + "WINDOWS": &WorkflowRunBill{ TotalMS: Int64(1), Jobs: Int(1), }, @@ -1039,16 +1038,16 @@ func TestWorkflowRunUsage_Marshal(t *testing.T) { testJSONMarshal(t, &WorkflowRunUsage{}, "{}") u := &WorkflowRunUsage{ - Billable: &WorkflowRunEnvironment{ - Ubuntu: &WorkflowRunBill{ + Billable: &WorkflowRunBillMap{ + "UBUNTU": &WorkflowRunBill{ TotalMS: Int64(1), Jobs: Int(1), }, - MacOS: &WorkflowRunBill{ + "MACOS": &WorkflowRunBill{ TotalMS: Int64(1), Jobs: Int(1), }, - Windows: &WorkflowRunBill{ + "WINDOWS": &WorkflowRunBill{ TotalMS: Int64(1), Jobs: Int(1), }, diff --git a/github/actions_workflows.go b/github/actions_workflows.go index 9973a5d3f35..c9b47ed4be4 100644 --- a/github/actions_workflows.go +++ b/github/actions_workflows.go @@ -32,15 +32,12 @@ type Workflows struct { // WorkflowUsage represents a usage of a specific workflow. type WorkflowUsage struct { - Billable *WorkflowEnvironment `json:"billable,omitempty"` + Billable *WorkflowBillMap `json:"billable,omitempty"` } -// WorkflowEnvironment represents different runner environments available for a workflow. -type WorkflowEnvironment struct { - Ubuntu *WorkflowBill `json:"UBUNTU,omitempty"` - MacOS *WorkflowBill `json:"MACOS,omitempty"` - Windows *WorkflowBill `json:"WINDOWS,omitempty"` -} +// WorkflowBillMap represents different runner environments available for a workflow. +// Its key is the name of its environment, e.g. "UBUNTU", "MACOS", "WINDOWS", etc. +type WorkflowBillMap map[string]*WorkflowBill // WorkflowBill specifies billable time for a specific environment in a workflow. type WorkflowBill struct { diff --git a/github/actions_workflows_test.go b/github/actions_workflows_test.go index 60a9d91b371..5e0dbbc9c13 100644 --- a/github/actions_workflows_test.go +++ b/github/actions_workflows_test.go @@ -153,14 +153,14 @@ func TestActionsService_GetWorkflowUsageByID(t *testing.T) { } want := &WorkflowUsage{ - Billable: &WorkflowEnvironment{ - Ubuntu: &WorkflowBill{ + Billable: &WorkflowBillMap{ + "UBUNTU": &WorkflowBill{ TotalMS: Int64(180000), }, - MacOS: &WorkflowBill{ + "MACOS": &WorkflowBill{ TotalMS: Int64(240000), }, - Windows: &WorkflowBill{ + "WINDOWS": &WorkflowBill{ TotalMS: Int64(300000), }, }, @@ -200,14 +200,14 @@ func TestActionsService_GetWorkflowUsageByFileName(t *testing.T) { } want := &WorkflowUsage{ - Billable: &WorkflowEnvironment{ - Ubuntu: &WorkflowBill{ + Billable: &WorkflowBillMap{ + "UBUNTU": &WorkflowBill{ TotalMS: Int64(180000), }, - MacOS: &WorkflowBill{ + "MACOS": &WorkflowBill{ TotalMS: Int64(240000), }, - Windows: &WorkflowBill{ + "WINDOWS": &WorkflowBill{ TotalMS: Int64(300000), }, }, @@ -545,17 +545,17 @@ func TestWorkflowBill_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } -func TestWorkflowEnvironment_Marshal(t *testing.T) { - testJSONMarshal(t, &WorkflowEnvironment{}, "{}") +func TestWorkflowBillMap_Marshal(t *testing.T) { + testJSONMarshal(t, &WorkflowBillMap{}, "{}") - u := &WorkflowEnvironment{ - Ubuntu: &WorkflowBill{ + u := &WorkflowBillMap{ + "UBUNTU": &WorkflowBill{ TotalMS: Int64(1), }, - MacOS: &WorkflowBill{ + "MACOS": &WorkflowBill{ TotalMS: Int64(1), }, - Windows: &WorkflowBill{ + "WINDOWS": &WorkflowBill{ TotalMS: Int64(1), }, } @@ -579,14 +579,14 @@ func TestWorkflowUsage_Marshal(t *testing.T) { testJSONMarshal(t, &WorkflowUsage{}, "{}") u := &WorkflowUsage{ - Billable: &WorkflowEnvironment{ - Ubuntu: &WorkflowBill{ + Billable: &WorkflowBillMap{ + "UBUNTU": &WorkflowBill{ TotalMS: Int64(1), }, - MacOS: &WorkflowBill{ + "MACOS": &WorkflowBill{ TotalMS: Int64(1), }, - Windows: &WorkflowBill{ + "WINDOWS": &WorkflowBill{ TotalMS: Int64(1), }, }, diff --git a/github/billing.go b/github/billing.go index d516cd0c298..2f5861ce808 100644 --- a/github/billing.go +++ b/github/billing.go @@ -24,11 +24,8 @@ type ActionBilling struct { MinutesUsedBreakdown MinutesUsedBreakdown `json:"minutes_used_breakdown"` } -type MinutesUsedBreakdown struct { - Ubuntu int `json:"UBUNTU"` - MacOS int `json:"MACOS"` - Windows int `json:"WINDOWS"` -} +// MinutesUsedBreakdown counts the actions minutes used by machine type (e.g. UBUNTU, WINDOWS, MACOS). +type MinutesUsedBreakdown = map[string]int // PackageBilling represents a GitHub Package billing. type PackageBilling struct { diff --git a/github/billing_test.go b/github/billing_test.go index 2df9a0e97fb..6a85cd22df6 100644 --- a/github/billing_test.go +++ b/github/billing_test.go @@ -43,9 +43,9 @@ func TestBillingService_GetActionsBillingOrg(t *testing.T) { TotalPaidMinutesUsed: 0, IncludedMinutes: 3000, MinutesUsedBreakdown: MinutesUsedBreakdown{ - Ubuntu: 205, - MacOS: 10, - Windows: 90, + "UBUNTU": 205, + "MACOS": 10, + "WINDOWS": 90, }, } if !cmp.Equal(hook, want) { @@ -209,9 +209,9 @@ func TestBillingService_GetActionsBillingUser(t *testing.T) { TotalPaidMinutesUsed: 0, IncludedMinutes: 3000, MinutesUsedBreakdown: MinutesUsedBreakdown{ - Ubuntu: 205, - MacOS: 10, - Windows: 90, + "UBUNTU": 205, + "MACOS": 10, + "WINDOWS": 90, }, } if !cmp.Equal(hook, want) { @@ -350,9 +350,9 @@ func TestMinutesUsedBreakdown_Marshal(t *testing.T) { testJSONMarshal(t, &MinutesUsedBreakdown{}, "{}") u := &MinutesUsedBreakdown{ - Ubuntu: 1, - MacOS: 1, - Windows: 1, + "UBUNTU": 1, + "MACOS": 1, + "WINDOWS": 1, } want := `{ @@ -372,9 +372,9 @@ func TestActionBilling_Marshal(t *testing.T) { TotalPaidMinutesUsed: 1, IncludedMinutes: 1, MinutesUsedBreakdown: MinutesUsedBreakdown{ - Ubuntu: 1, - MacOS: 1, - Windows: 1, + "UBUNTU": 1, + "MACOS": 1, + "WINDOWS": 1, }, } diff --git a/github/github-accessors.go b/github/github-accessors.go index e78684ca1cc..e49872ead21 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -20582,30 +20582,6 @@ func (w *WorkflowDispatchEvent) GetWorkflow() string { return *w.Workflow } -// GetMacOS returns the MacOS field. -func (w *WorkflowEnvironment) GetMacOS() *WorkflowBill { - if w == nil { - return nil - } - return w.MacOS -} - -// GetUbuntu returns the Ubuntu field. -func (w *WorkflowEnvironment) GetUbuntu() *WorkflowBill { - if w == nil { - return nil - } - return w.Ubuntu -} - -// GetWindows returns the Windows field. -func (w *WorkflowEnvironment) GetWindows() *WorkflowBill { - if w == nil { - return nil - } - return w.Windows -} - // GetCheckRunURL returns the CheckRunURL field if it's non-nil, zero value otherwise. func (w *WorkflowJob) GetCheckRunURL() string { if w == nil || w.CheckRunURL == nil { @@ -21062,30 +21038,6 @@ func (w *WorkflowRunBill) GetTotalMS() int64 { return *w.TotalMS } -// GetMacOS returns the MacOS field. -func (w *WorkflowRunEnvironment) GetMacOS() *WorkflowRunBill { - if w == nil { - return nil - } - return w.MacOS -} - -// GetUbuntu returns the Ubuntu field. -func (w *WorkflowRunEnvironment) GetUbuntu() *WorkflowRunBill { - if w == nil { - return nil - } - return w.Ubuntu -} - -// GetWindows returns the Windows field. -func (w *WorkflowRunEnvironment) GetWindows() *WorkflowRunBill { - if w == nil { - return nil - } - return w.Windows -} - // GetAction returns the Action field if it's non-nil, zero value otherwise. func (w *WorkflowRunEvent) GetAction() string { if w == nil || w.Action == nil { @@ -21167,7 +21119,7 @@ func (w *WorkflowRuns) GetTotalCount() int { } // GetBillable returns the Billable field. -func (w *WorkflowRunUsage) GetBillable() *WorkflowRunEnvironment { +func (w *WorkflowRunUsage) GetBillable() *WorkflowRunBillMap { if w == nil { return nil } @@ -21191,7 +21143,7 @@ func (w *Workflows) GetTotalCount() int { } // GetBillable returns the Billable field. -func (w *WorkflowUsage) GetBillable() *WorkflowEnvironment { +func (w *WorkflowUsage) GetBillable() *WorkflowBillMap { if w == nil { return nil } diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 52425ded181..1985dcd72f8 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -24036,27 +24036,6 @@ func TestWorkflowDispatchEvent_GetWorkflow(tt *testing.T) { w.GetWorkflow() } -func TestWorkflowEnvironment_GetMacOS(tt *testing.T) { - w := &WorkflowEnvironment{} - w.GetMacOS() - w = nil - w.GetMacOS() -} - -func TestWorkflowEnvironment_GetUbuntu(tt *testing.T) { - w := &WorkflowEnvironment{} - w.GetUbuntu() - w = nil - w.GetUbuntu() -} - -func TestWorkflowEnvironment_GetWindows(tt *testing.T) { - w := &WorkflowEnvironment{} - w.GetWindows() - w = nil - w.GetWindows() -} - func TestWorkflowJob_GetCheckRunURL(tt *testing.T) { var zeroValue string w := &WorkflowJob{CheckRunURL: &zeroValue} @@ -24600,27 +24579,6 @@ func TestWorkflowRunBill_GetTotalMS(tt *testing.T) { w.GetTotalMS() } -func TestWorkflowRunEnvironment_GetMacOS(tt *testing.T) { - w := &WorkflowRunEnvironment{} - w.GetMacOS() - w = nil - w.GetMacOS() -} - -func TestWorkflowRunEnvironment_GetUbuntu(tt *testing.T) { - w := &WorkflowRunEnvironment{} - w.GetUbuntu() - w = nil - w.GetUbuntu() -} - -func TestWorkflowRunEnvironment_GetWindows(tt *testing.T) { - w := &WorkflowRunEnvironment{} - w.GetWindows() - w = nil - w.GetWindows() -} - func TestWorkflowRunEvent_GetAction(tt *testing.T) { var zeroValue string w := &WorkflowRunEvent{Action: &zeroValue} From 4a5aa8c9b7f52fba3731eea8be5502b1deb1810f Mon Sep 17 00:00:00 2001 From: VenuManikanta <43684059+VenuManikanta@users.noreply.github.com> Date: Mon, 26 Dec 2022 22:23:53 +0530 Subject: [PATCH 131/751] Enable secret scanning with the enterprise-level REST API (#2607) Fixes: #2599. --- .../enterprise_code_security_and_analysis.go | 78 +++++++++++ ...erprise_code_security_and_analysis_test.go | 132 ++++++++++++++++++ github/github-accessors.go | 32 +++++ github/github-accessors_test.go | 40 ++++++ 4 files changed, 282 insertions(+) create mode 100644 github/enterprise_code_security_and_analysis.go create mode 100644 github/enterprise_code_security_and_analysis_test.go diff --git a/github/enterprise_code_security_and_analysis.go b/github/enterprise_code_security_and_analysis.go new file mode 100644 index 00000000000..3980a86aa4b --- /dev/null +++ b/github/enterprise_code_security_and_analysis.go @@ -0,0 +1,78 @@ +// 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" +) + +// EnterpriseSecurityAnalysisSettings represents security analysis settings for an enterprise. +type EnterpriseSecurityAnalysisSettings struct { + AdvancedSecurityEnabledForNewRepositories *bool `json:"advanced_security_enabled_for_new_repositories,omitempty"` + SecretScanningEnabledForNewRepositories *bool `json:"secret_scanning_enabled_for_new_repositories,omitempty"` + SecretScanningPushProtectionEnabledForNewRepositories *bool `json:"secret_scanning_push_protection_enabled_for_new_repositories,omitempty"` + SecretScanningPushProtectionCustomLink *string `json:"secret_scanning_push_protection_custom_link,omitempty"` +} + +// GetCodeSecurityAndAnalysis gets code security and analysis features for an enterprise. +// +// GitHub API docs: https://docs.github.com/en/rest/enterprise-admin/code-security-and-analysis?apiVersion=2022-11-28#get-code-security-and-analysis-features-for-an-enterprise +func (s *EnterpriseService) GetCodeSecurityAndAnalysis(ctx context.Context, enterprise string) (*EnterpriseSecurityAnalysisSettings, *Response, error) { + u := fmt.Sprintf("enterprises/%v/code_security_and_analysis", enterprise) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + settings := new(EnterpriseSecurityAnalysisSettings) + resp, err := s.client.Do(ctx, req, settings) + if err != nil { + return nil, resp, err + } + + return settings, resp, nil +} + +// UpdateCodeSecurityAndAnalysis updates code security and analysis features for new repositories in an enterprise. +// +// GitHub API docs: https://docs.github.com/en/rest/enterprise-admin/code-security-and-analysis?apiVersion=2022-11-28#update-code-security-and-analysis-features-for-an-enterprise +func (s *EnterpriseService) UpdateCodeSecurityAndAnalysis(ctx context.Context, enterprise string, settings *EnterpriseSecurityAnalysisSettings) (*Response, error) { + u := fmt.Sprintf("enterprises/%v/code_security_and_analysis", enterprise) + req, err := s.client.NewRequest("PATCH", u, settings) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req, nil) + if err != nil { + return resp, err + } + + return resp, nil +} + +// EnableDisableSecurityFeature enables or disables a security feature for all repositories in an enterprise. +// +// Valid values for securityProduct: "advanced_security", "secret_scanning", "secret_scanning_push_protection". +// Valid values for enablement: "enable_all", "disable_all". +// +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/enterprise-admin/code-security-and-analysis?apiVersion=2022-11-28#enable-or-disable-a-security-feature +func (s *EnterpriseService) EnableDisableSecurityFeature(ctx context.Context, enterprise, securityProduct, enablement string) (*Response, error) { + u := fmt.Sprintf("enterprises/%v/%v/%v", enterprise, securityProduct, enablement) + req, err := s.client.NewRequest("POST", 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/enterprise_code_security_and_analysis_test.go b/github/enterprise_code_security_and_analysis_test.go new file mode 100644 index 00000000000..24bf89c51e3 --- /dev/null +++ b/github/enterprise_code_security_and_analysis_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 TestEnterpriseService_GetCodeSecurityAndAnalysis(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/enterprises/e/code_security_and_analysis", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + + fmt.Fprint(w, ` + { + "advanced_security_enabled_for_new_repositories": true, + "secret_scanning_enabled_for_new_repositories": true, + "secret_scanning_push_protection_enabled_for_new_repositories": true, + "secret_scanning_push_protection_custom_link": "https://github.com/test-org/test-repo/blob/main/README.md" + }`) + }) + + ctx := context.Background() + + const methodName = "GetCodeSecurityAndAnalysis" + + settings, _, err := client.Enterprise.GetCodeSecurityAndAnalysis(ctx, "e") + if err != nil { + t.Errorf("Enterprise.%v returned error: %v", methodName, err) + } + want := &EnterpriseSecurityAnalysisSettings{ + AdvancedSecurityEnabledForNewRepositories: Bool(true), + SecretScanningEnabledForNewRepositories: Bool(true), + SecretScanningPushProtectionEnabledForNewRepositories: Bool(true), + SecretScanningPushProtectionCustomLink: String("https://github.com/test-org/test-repo/blob/main/README.md"), + } + + if !cmp.Equal(settings, want) { + t.Errorf("Enterprise.%v return \ngot: %+v,\nwant:%+v", methodName, settings, want) + } + + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Enterprise.GetCodeSecurityAndAnalysis(ctx, "o") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.GetCodeSecurityAndAnalysis(ctx, "e") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_UpdateCodeSecurityAndAnalysis(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + input := &EnterpriseSecurityAnalysisSettings{ + AdvancedSecurityEnabledForNewRepositories: Bool(true), + SecretScanningEnabledForNewRepositories: Bool(true), + SecretScanningPushProtectionEnabledForNewRepositories: Bool(true), + SecretScanningPushProtectionCustomLink: String("https://github.com/test-org/test-repo/blob/main/README.md"), + } + + mux.HandleFunc("/enterprises/e/code_security_and_analysis", func(w http.ResponseWriter, r *http.Request) { + v := new(EnterpriseSecurityAnalysisSettings) + json.NewDecoder(r.Body).Decode(v) + + testMethod(t, r, "PATCH") + if !cmp.Equal(v, input) { + t.Errorf("Request body = %+v, want %+v", v, input) + } + }) + + ctx := context.Background() + + const methodName = "UpdateCodeSecurityAndAnalysis" + + _, err := client.Enterprise.UpdateCodeSecurityAndAnalysis(ctx, "e", input) + if err != nil { + t.Errorf("Enterprise.%v returned error: %v", methodName, err) + } + + testBadOptions(t, methodName, func() (err error) { + _, err = client.Enterprise.UpdateCodeSecurityAndAnalysis(ctx, "o", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Enterprise.UpdateCodeSecurityAndAnalysis(ctx, "e", input) + }) +} + +func TestEnterpriseService_EnableAdvancedSecurity(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/enterprises/e/advanced_security/enable_all", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + }) + + ctx := context.Background() + + const methodName = "EnableDisableSecurityFeature" + + _, err := client.Enterprise.EnableDisableSecurityFeature(ctx, "e", "advanced_security", "enable_all") + if err != nil { + t.Errorf("Enterprise.%v returned error: %v", methodName, err) + } + + testBadOptions(t, methodName, func() (err error) { + _, err = client.Enterprise.EnableDisableSecurityFeature(ctx, "o", "advanced_security", "enable_all") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Enterprise.EnableDisableSecurityFeature(ctx, "e", "advanced_security", "enable_all") + }) +} diff --git a/github/github-accessors.go b/github/github-accessors.go index e49872ead21..8a7a5996702 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -5118,6 +5118,38 @@ func (e *Enterprise) GetWebsiteURL() string { return *e.WebsiteURL } +// GetAdvancedSecurityEnabledForNewRepositories returns the AdvancedSecurityEnabledForNewRepositories field if it's non-nil, zero value otherwise. +func (e *EnterpriseSecurityAnalysisSettings) GetAdvancedSecurityEnabledForNewRepositories() bool { + if e == nil || e.AdvancedSecurityEnabledForNewRepositories == nil { + return false + } + return *e.AdvancedSecurityEnabledForNewRepositories +} + +// GetSecretScanningEnabledForNewRepositories returns the SecretScanningEnabledForNewRepositories field if it's non-nil, zero value otherwise. +func (e *EnterpriseSecurityAnalysisSettings) GetSecretScanningEnabledForNewRepositories() bool { + if e == nil || e.SecretScanningEnabledForNewRepositories == nil { + return false + } + return *e.SecretScanningEnabledForNewRepositories +} + +// GetSecretScanningPushProtectionCustomLink returns the SecretScanningPushProtectionCustomLink field if it's non-nil, zero value otherwise. +func (e *EnterpriseSecurityAnalysisSettings) GetSecretScanningPushProtectionCustomLink() string { + if e == nil || e.SecretScanningPushProtectionCustomLink == nil { + return "" + } + return *e.SecretScanningPushProtectionCustomLink +} + +// GetSecretScanningPushProtectionEnabledForNewRepositories returns the SecretScanningPushProtectionEnabledForNewRepositories field if it's non-nil, zero value otherwise. +func (e *EnterpriseSecurityAnalysisSettings) GetSecretScanningPushProtectionEnabledForNewRepositories() bool { + if e == nil || e.SecretScanningPushProtectionEnabledForNewRepositories == nil { + return false + } + return *e.SecretScanningPushProtectionEnabledForNewRepositories +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (e *Environment) GetCreatedAt() Timestamp { if e == nil || e.CreatedAt == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 1985dcd72f8..deb33dc9fee 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -5984,6 +5984,46 @@ func TestEnterprise_GetWebsiteURL(tt *testing.T) { e.GetWebsiteURL() } +func TestEnterpriseSecurityAnalysisSettings_GetAdvancedSecurityEnabledForNewRepositories(tt *testing.T) { + var zeroValue bool + e := &EnterpriseSecurityAnalysisSettings{AdvancedSecurityEnabledForNewRepositories: &zeroValue} + e.GetAdvancedSecurityEnabledForNewRepositories() + e = &EnterpriseSecurityAnalysisSettings{} + e.GetAdvancedSecurityEnabledForNewRepositories() + e = nil + e.GetAdvancedSecurityEnabledForNewRepositories() +} + +func TestEnterpriseSecurityAnalysisSettings_GetSecretScanningEnabledForNewRepositories(tt *testing.T) { + var zeroValue bool + e := &EnterpriseSecurityAnalysisSettings{SecretScanningEnabledForNewRepositories: &zeroValue} + e.GetSecretScanningEnabledForNewRepositories() + e = &EnterpriseSecurityAnalysisSettings{} + e.GetSecretScanningEnabledForNewRepositories() + e = nil + e.GetSecretScanningEnabledForNewRepositories() +} + +func TestEnterpriseSecurityAnalysisSettings_GetSecretScanningPushProtectionCustomLink(tt *testing.T) { + var zeroValue string + e := &EnterpriseSecurityAnalysisSettings{SecretScanningPushProtectionCustomLink: &zeroValue} + e.GetSecretScanningPushProtectionCustomLink() + e = &EnterpriseSecurityAnalysisSettings{} + e.GetSecretScanningPushProtectionCustomLink() + e = nil + e.GetSecretScanningPushProtectionCustomLink() +} + +func TestEnterpriseSecurityAnalysisSettings_GetSecretScanningPushProtectionEnabledForNewRepositories(tt *testing.T) { + var zeroValue bool + e := &EnterpriseSecurityAnalysisSettings{SecretScanningPushProtectionEnabledForNewRepositories: &zeroValue} + e.GetSecretScanningPushProtectionEnabledForNewRepositories() + e = &EnterpriseSecurityAnalysisSettings{} + e.GetSecretScanningPushProtectionEnabledForNewRepositories() + e = nil + e.GetSecretScanningPushProtectionEnabledForNewRepositories() +} + func TestEnvironment_GetCreatedAt(tt *testing.T) { var zeroValue Timestamp e := &Environment{CreatedAt: &zeroValue} From c5583e771c6cf97aa86a86b9164129f59b949363 Mon Sep 17 00:00:00 2001 From: Bingtan Lu Date: Wed, 28 Dec 2022 22:07:51 +0800 Subject: [PATCH 132/751] Add installation to CodeScanningAlertEvent type (#2609) Fixes: #2608. --- github/event_types.go | 2 ++ github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 7 +++++++ 3 files changed, 17 insertions(+) diff --git a/github/event_types.go b/github/event_types.go index 6c59b7b5323..8330353a3c1 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -1389,4 +1389,6 @@ type CodeScanningAlertEvent struct { Repo *Repository `json:"repository,omitempty"` Org *Organization `json:"organization,omitempty"` Sender *User `json:"sender,omitempty"` + + Installation *Installation `json:"installation,omitempty"` } diff --git a/github/github-accessors.go b/github/github-accessors.go index 8a7a5996702..422d8bc0d3b 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -2454,6 +2454,14 @@ func (c *CodeScanningAlertEvent) GetCommitOID() string { return *c.CommitOID } +// GetInstallation returns the Installation field. +func (c *CodeScanningAlertEvent) GetInstallation() *Installation { + if c == nil { + return nil + } + return c.Installation +} + // GetOrg returns the Org field. func (c *CodeScanningAlertEvent) GetOrg() *Organization { if c == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index deb33dc9fee..efa66e7875a 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -2900,6 +2900,13 @@ func TestCodeScanningAlertEvent_GetCommitOID(tt *testing.T) { c.GetCommitOID() } +func TestCodeScanningAlertEvent_GetInstallation(tt *testing.T) { + c := &CodeScanningAlertEvent{} + c.GetInstallation() + c = nil + c.GetInstallation() +} + func TestCodeScanningAlertEvent_GetOrg(tt *testing.T) { c := &CodeScanningAlertEvent{} c.GetOrg() From eaa75597cd219c376a2354948d85aa34a98bf4a0 Mon Sep 17 00:00:00 2001 From: AnitaErnszt <56001200+AnitaErnszt@users.noreply.github.com> Date: Wed, 4 Jan 2023 05:18:56 +0100 Subject: [PATCH 133/751] Add support for GitHub Environments for Pro/Teams pricing plans (#2611) Fixes: #2602. --- github/repos_environments.go | 35 ++++++++++ github/repos_environments_test.go | 104 ++++++++++++++++++++++++++++++ 2 files changed, 139 insertions(+) diff --git a/github/repos_environments.go b/github/repos_environments.go index 365f8d92022..2e85fdf99c0 100644 --- a/github/repos_environments.go +++ b/github/repos_environments.go @@ -9,6 +9,7 @@ import ( "context" "encoding/json" "fmt" + "net/http" ) // Environment represents a single environment in a repository. @@ -168,6 +169,13 @@ type CreateUpdateEnvironment struct { DeploymentBranchPolicy *BranchPolicy `json:"deployment_branch_policy"` } +// createUpdateEnvironmentNoEnterprise represents the fields accepted for Pro/Teams private repos. +// Ref: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment +// See https://github.com/google/go-github/issues/2602 for more information. +type createUpdateEnvironmentNoEnterprise struct { + DeploymentBranchPolicy *BranchPolicy `json:"deployment_branch_policy"` +} + // CreateUpdateEnvironment create or update a new environment for a repository. // // GitHub API docs: https://docs.github.com/en/rest/deployments/environments#create-or-update-an-environment @@ -179,6 +187,33 @@ func (s *RepositoriesService) CreateUpdateEnvironment(ctx context.Context, owner return nil, nil, err } + e := new(Environment) + resp, err := s.client.Do(ctx, req, e) + if err != nil { + // The API returns 422 when the pricing plan doesn't support all the fields sent. + // This path will be executed for Pro/Teams private repos. + // For public repos, regardless of the pricing plan, all fields supported. + // For Free plan private repos the returned error code is 404. + // We are checking that the user didn't try to send a value for unsupported fields, + // and return an error if they did. + if resp != nil && resp.StatusCode == http.StatusUnprocessableEntity && environment != nil && len(environment.Reviewers) == 0 && environment.GetWaitTimer() == 0 { + return s.createNewEnvNoEnterprise(ctx, u, environment) + } + return nil, resp, err + } + return e, resp, nil +} + +// createNewEnvNoEnterprise is an internal function for cases where the original call returned 422. +// Currently only the `deployment_branch_policy` parameter is supported for Pro/Team private repos. +func (s *RepositoriesService) createNewEnvNoEnterprise(ctx context.Context, u string, environment *CreateUpdateEnvironment) (*Environment, *Response, error) { + req, err := s.client.NewRequest("PUT", u, &createUpdateEnvironmentNoEnterprise{ + DeploymentBranchPolicy: environment.DeploymentBranchPolicy, + }) + if err != nil { + return nil, nil, err + } + e := new(Environment) resp, err := s.client.Do(ctx, req, e) if err != nil { diff --git a/github/repos_environments_test.go b/github/repos_environments_test.go index 93d0fc25ebc..0b27da933d7 100644 --- a/github/repos_environments_test.go +++ b/github/repos_environments_test.go @@ -220,6 +220,110 @@ func TestRepositoriesService_CreateEnvironment(t *testing.T) { }) } +func TestRepositoriesService_CreateEnvironment_noEnterprise(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + input := &CreateUpdateEnvironment{} + callCount := 0 + + mux.HandleFunc("/repos/o/r/environments/e", func(w http.ResponseWriter, r *http.Request) { + v := new(CreateUpdateEnvironment) + json.NewDecoder(r.Body).Decode(v) + + testMethod(t, r, "PUT") + if callCount == 0 { + w.WriteHeader(http.StatusUnprocessableEntity) + callCount++ + } else { + want := &CreateUpdateEnvironment{} + if !cmp.Equal(v, want) { + t.Errorf("Request body = %+v, want %+v", v, want) + } + fmt.Fprint(w, `{"id": 1, "name": "staging", "protection_rules": []}`) + } + }) + + ctx := context.Background() + release, _, err := client.Repositories.CreateUpdateEnvironment(ctx, "o", "r", "e", input) + if err != nil { + t.Errorf("Repositories.CreateUpdateEnvironment returned error: %v", err) + } + + want := &Environment{ID: Int64(1), Name: String("staging"), ProtectionRules: []*ProtectionRule{}} + if !cmp.Equal(release, want) { + t.Errorf("Repositories.CreateUpdateEnvironment returned %+v, want %+v", release, want) + } +} + +func TestRepositoriesService_createNewEnvNoEnterprise(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + input := &CreateUpdateEnvironment{ + DeploymentBranchPolicy: &BranchPolicy{ + ProtectedBranches: Bool(true), + CustomBranchPolicies: Bool(false), + }, + } + + mux.HandleFunc("/repos/o/r/environments/e", func(w http.ResponseWriter, r *http.Request) { + v := new(createUpdateEnvironmentNoEnterprise) + json.NewDecoder(r.Body).Decode(v) + + testMethod(t, r, "PUT") + want := &createUpdateEnvironmentNoEnterprise{ + DeploymentBranchPolicy: &BranchPolicy{ + ProtectedBranches: Bool(true), + CustomBranchPolicies: Bool(false), + }, + } + if !cmp.Equal(v, want) { + t.Errorf("Request body = %+v, want %+v", v, want) + } + fmt.Fprint(w, `{"id": 1, "name": "staging", "protection_rules": [{"id": 1, "node_id": "id", "type": "branch_policy"}], "deployment_branch_policy": {"protected_branches": true, "custom_branch_policies": false}}`) + }) + + ctx := context.Background() + release, _, err := client.Repositories.createNewEnvNoEnterprise(ctx, "repos/o/r/environments/e", input) + if err != nil { + t.Errorf("Repositories.createNewEnvNoEnterprise returned error: %v", err) + } + + want := &Environment{ + ID: Int64(1), + Name: String("staging"), + ProtectionRules: []*ProtectionRule{ + { + ID: Int64(1), + NodeID: String("id"), + Type: String("branch_policy"), + }, + }, + DeploymentBranchPolicy: &BranchPolicy{ + ProtectedBranches: Bool(true), + CustomBranchPolicies: Bool(false), + }, + } + if !cmp.Equal(release, want) { + t.Errorf("Repositories.createNewEnvNoEnterprise returned %+v, want %+v", release, want) + } + + const methodName = "createNewEnvNoEnterprise" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.createNewEnvNoEnterprise(ctx, "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.createNewEnvNoEnterprise(ctx, "repos/o/r/environments/e", input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + func TestRepositoriesService_DeleteEnvironment(t *testing.T) { client, mux, _, teardown := setup() defer teardown() From 3f0f3716e9cf06465fa6a45b1953c302e370935c Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Tue, 3 Jan 2023 23:43:37 -0500 Subject: [PATCH 134/751] Bump version of go-github to v49 (#2616) --- README.md | 16 ++++++++-------- example/actionpermissions/main.go | 2 +- example/appengine/app.go | 2 +- example/basicauth/main.go | 2 +- example/commitpr/main.go | 2 +- example/go.mod | 6 +++--- example/listenvironments/main.go | 2 +- example/migrations/main.go | 2 +- example/newfilewithappauth/main.go | 2 +- example/newrepo/main.go | 2 +- example/newreposecretwithlibsodium/go.mod | 4 ++-- example/newreposecretwithlibsodium/main.go | 2 +- example/newreposecretwithxcrypto/main.go | 2 +- example/simple/main.go | 2 +- example/tagprotection/main.go | 2 +- example/tokenauth/main.go | 2 +- example/topics/main.go | 2 +- github/doc.go | 2 +- github/examples_test.go | 2 +- github/github.go | 2 +- go.mod | 2 +- test/fields/fields.go | 2 +- test/integration/activity_test.go | 2 +- test/integration/authorizations_test.go | 2 +- test/integration/github_test.go | 2 +- test/integration/repos_test.go | 2 +- test/integration/users_test.go | 2 +- update-urls/go.mod | 2 +- 28 files changed, 38 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 9406f76e086..030fd090d9a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-github # [![go-github release (latest SemVer)](https://img.shields.io/github/v/release/google/go-github?sort=semver)](https://github.com/google/go-github/releases) -[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v48/github) +[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v49/github) [![Test Status](https://github.com/google/go-github/workflows/tests/badge.svg)](https://github.com/google/go-github/actions?query=workflow%3Atests) [![Test Coverage](https://codecov.io/gh/google/go-github/branch/master/graph/badge.svg)](https://codecov.io/gh/google/go-github) [![Discuss at go-github@googlegroups.com](https://img.shields.io/badge/discuss-go--github%40googlegroups.com-blue.svg)](https://groups.google.com/group/go-github) @@ -24,7 +24,7 @@ If you're interested in using the [GraphQL API v4][], the recommended library is go-github is compatible with modern Go releases in module mode, with Go installed: ```bash -go get github.com/google/go-github/v48 +go get github.com/google/go-github/v49 ``` will resolve and add the package to the current development module, along with its dependencies. @@ -32,7 +32,7 @@ will resolve and add the package to the current development module, along with i Alternatively the same can be achieved if you use import in a package: ```go -import "github.com/google/go-github/v48/github" +import "github.com/google/go-github/v49/github" ``` and run `go get` without parameters. @@ -40,13 +40,13 @@ and run `go get` without parameters. Finally, to use the top-of-trunk version of this repo, use the following command: ```bash -go get github.com/google/go-github/v48@master +go get github.com/google/go-github/v49@master ``` ## Usage ## ```go -import "github.com/google/go-github/v48/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) +import "github.com/google/go-github/v49/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled ``` @@ -135,7 +135,7 @@ import ( "net/http" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v48/github" + "github.com/google/go-github/v49/github" ) func main() { @@ -290,7 +290,7 @@ For complete usage of go-github, see the full [package docs][]. [oauth2]: https://github.com/golang/oauth2 [oauth2 docs]: https://godoc.org/golang.org/x/oauth2 [personal API token]: https://github.com/blog/1509-personal-api-tokens -[package docs]: https://pkg.go.dev/github.com/google/go-github/v48/github +[package docs]: https://pkg.go.dev/github.com/google/go-github/v49/github [GraphQL API v4]: https://developer.github.com/v4/ [shurcooL/githubv4]: https://github.com/shurcooL/githubv4 [GitHub webhook events]: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads @@ -363,9 +363,9 @@ Versions prior to 48.2.0 are not listed. | go-github Version | GitHub v3 API Version | | ----------------- | --------------------- | +| 49.0.0 | 2022-11-28 | | 48.2.0 | 2022-11-28 | - ## License ## This library is distributed under the BSD-style license found in the [LICENSE](./LICENSE) diff --git a/example/actionpermissions/main.go b/example/actionpermissions/main.go index c568d572553..4c9912d9d6f 100644 --- a/example/actionpermissions/main.go +++ b/example/actionpermissions/main.go @@ -14,7 +14,7 @@ import ( "log" "os" - "github.com/google/go-github/v48/github" + "github.com/google/go-github/v49/github" "golang.org/x/oauth2" ) diff --git a/example/appengine/app.go b/example/appengine/app.go index e4ba5d96123..3ad9f122be4 100644 --- a/example/appengine/app.go +++ b/example/appengine/app.go @@ -12,7 +12,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v48/github" + "github.com/google/go-github/v49/github" "golang.org/x/oauth2" "google.golang.org/appengine" "google.golang.org/appengine/log" diff --git a/example/basicauth/main.go b/example/basicauth/main.go index 43604434e2a..bfb9c6811ef 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -22,7 +22,7 @@ import ( "strings" "syscall" - "github.com/google/go-github/v48/github" + "github.com/google/go-github/v49/github" "golang.org/x/crypto/ssh/terminal" ) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index 1d60625d1c8..ca6ffc85a16 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -30,7 +30,7 @@ import ( "strings" "time" - "github.com/google/go-github/v48/github" + "github.com/google/go-github/v49/github" "golang.org/x/oauth2" ) diff --git a/example/go.mod b/example/go.mod index f10419073fc..a28bcb85fdc 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,10 +1,10 @@ -module github.com/google/go-github/v48/example +module github.com/google/go-github/v49/example go 1.17 require ( github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 - github.com/google/go-github/v48 v48.2.0 + github.com/google/go-github/v49 v49.0.0 golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be google.golang.org/appengine v1.6.7 @@ -21,4 +21,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v48 => ../ +replace github.com/google/go-github/v49 => ../ diff --git a/example/listenvironments/main.go b/example/listenvironments/main.go index ddee688d806..f86b1a2d772 100644 --- a/example/listenvironments/main.go +++ b/example/listenvironments/main.go @@ -18,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v48/github" + "github.com/google/go-github/v49/github" "golang.org/x/oauth2" ) diff --git a/example/migrations/main.go b/example/migrations/main.go index 096085ce88d..015e18e2a94 100644 --- a/example/migrations/main.go +++ b/example/migrations/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v48/github" + "github.com/google/go-github/v49/github" "golang.org/x/oauth2" ) diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index a448a056f53..0e64d93d999 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -16,7 +16,7 @@ import ( "time" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v48/github" + "github.com/google/go-github/v49/github" "golang.org/x/oauth2" ) diff --git a/example/newrepo/main.go b/example/newrepo/main.go index 46378f9853c..5f796d33702 100644 --- a/example/newrepo/main.go +++ b/example/newrepo/main.go @@ -16,7 +16,7 @@ import ( "log" "os" - "github.com/google/go-github/v48/github" + "github.com/google/go-github/v49/github" "golang.org/x/oauth2" ) diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index a190c0a8a41..04ff0c1604b 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -4,9 +4,9 @@ go 1.15 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb - github.com/google/go-github/v48 v48.2.0 + github.com/google/go-github/v49 v49.0.0 golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v48 => ../.. +replace github.com/google/go-github/v49 => ../.. diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index fb66df83685..3e932c5eee8 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -36,7 +36,7 @@ import ( "os" sodium "github.com/GoKillers/libsodium-go/cryptobox" - "github.com/google/go-github/v48/github" + "github.com/google/go-github/v49/github" "golang.org/x/oauth2" ) diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index c4f38f34ecd..bb688372994 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -36,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v48/github" + "github.com/google/go-github/v49/github" "golang.org/x/crypto/nacl/box" "golang.org/x/oauth2" ) diff --git a/example/simple/main.go b/example/simple/main.go index ed68b4eeada..29b22ecce62 100644 --- a/example/simple/main.go +++ b/example/simple/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v48/github" + "github.com/google/go-github/v49/github" ) // Fetch all the public organizations' membership of a user. diff --git a/example/tagprotection/main.go b/example/tagprotection/main.go index 09ae4dcfb64..12ec91a6685 100644 --- a/example/tagprotection/main.go +++ b/example/tagprotection/main.go @@ -19,7 +19,7 @@ import ( "strings" "syscall" - "github.com/google/go-github/v48/github" + "github.com/google/go-github/v49/github" "golang.org/x/crypto/ssh/terminal" "golang.org/x/oauth2" ) diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index c6ef3cd464a..ed489d720e3 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -14,7 +14,7 @@ import ( "log" "syscall" - "github.com/google/go-github/v48/github" + "github.com/google/go-github/v49/github" "golang.org/x/crypto/ssh/terminal" "golang.org/x/oauth2" ) diff --git a/example/topics/main.go b/example/topics/main.go index 1033c27648d..489b9c71635 100644 --- a/example/topics/main.go +++ b/example/topics/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v48/github" + "github.com/google/go-github/v49/github" ) // Fetch and lists all the public topics associated with the specified GitHub topic diff --git a/github/doc.go b/github/doc.go index 0c4afaa3d69..1401f07fb6e 100644 --- a/github/doc.go +++ b/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v48/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v49/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to diff --git a/github/examples_test.go b/github/examples_test.go index 79c226fc48e..efd4f024917 100644 --- a/github/examples_test.go +++ b/github/examples_test.go @@ -12,7 +12,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v48/github" + "github.com/google/go-github/v49/github" ) func ExampleClient_Markdown() { diff --git a/github/github.go b/github/github.go index 3599a88d090..d5aa1c68702 100644 --- a/github/github.go +++ b/github/github.go @@ -27,7 +27,7 @@ import ( ) const ( - Version = "v48.2.0" + Version = "v49.0.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" diff --git a/go.mod b/go.mod index 656bb7543e6..4f7880fd8ba 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v48 +module github.com/google/go-github/v49 require ( github.com/google/go-cmp v0.5.9 diff --git a/test/fields/fields.go b/test/fields/fields.go index 3d42b7c43b8..61e422f78ff 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -25,7 +25,7 @@ import ( "reflect" "strings" - "github.com/google/go-github/v48/github" + "github.com/google/go-github/v49/github" "golang.org/x/oauth2" ) diff --git a/test/integration/activity_test.go b/test/integration/activity_test.go index 5d2f231bd7e..c89cf2480d6 100644 --- a/test/integration/activity_test.go +++ b/test/integration/activity_test.go @@ -12,7 +12,7 @@ import ( "context" "testing" - "github.com/google/go-github/v48/github" + "github.com/google/go-github/v49/github" ) const ( diff --git a/test/integration/authorizations_test.go b/test/integration/authorizations_test.go index 50d38e0cc0f..b2b313f8eec 100644 --- a/test/integration/authorizations_test.go +++ b/test/integration/authorizations_test.go @@ -17,7 +17,7 @@ import ( "testing" "time" - "github.com/google/go-github/v48/github" + "github.com/google/go-github/v49/github" ) const msgEnvMissing = "Skipping test because the required environment variable (%v) is not present." diff --git a/test/integration/github_test.go b/test/integration/github_test.go index aabada850c3..b65f9626944 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -15,7 +15,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v48/github" + "github.com/google/go-github/v49/github" "golang.org/x/oauth2" ) diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index 49ff98f0dad..e4ccfce2619 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -15,7 +15,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v48/github" + "github.com/google/go-github/v49/github" ) func TestRepositories_CRUD(t *testing.T) { diff --git a/test/integration/users_test.go b/test/integration/users_test.go index cd7797b696c..0be9cce2ddb 100644 --- a/test/integration/users_test.go +++ b/test/integration/users_test.go @@ -14,7 +14,7 @@ import ( "math/rand" "testing" - "github.com/google/go-github/v48/github" + "github.com/google/go-github/v49/github" ) func TestUsers_Get(t *testing.T) { diff --git a/update-urls/go.mod b/update-urls/go.mod index 2fed223a35d..d01d8de96c6 100644 --- a/update-urls/go.mod +++ b/update-urls/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v48/update-urls +module github.com/google/go-github/v49/update-urls go 1.16 From 08cce784f69e41c7949d2b6762966a0a2f878159 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Tue, 3 Jan 2023 23:52:05 -0500 Subject: [PATCH 135/751] Update scrape dependency to v49 (#2617) --- scrape/apps.go | 2 +- scrape/apps_test.go | 2 +- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scrape/apps.go b/scrape/apps.go index 55afeb6cc8c..693addeb33d 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -17,7 +17,7 @@ import ( "strings" "github.com/PuerkitoBio/goquery" - "github.com/google/go-github/v48/github" + "github.com/google/go-github/v49/github" ) // AppRestrictionsEnabled returns whether the specified organization has diff --git a/scrape/apps_test.go b/scrape/apps_test.go index 972656290a9..6750f807392 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v48/github" + "github.com/google/go-github/v49/github" ) func Test_AppRestrictionsEnabled(t *testing.T) { diff --git a/scrape/go.mod b/scrape/go.mod index 65e2b6ebde0..01a68390409 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.9 - github.com/google/go-github/v48 v48.2.0 + github.com/google/go-github/v49 v49.0.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 ce4b6dc2991..f32e7440562 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.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v48 v48.2.0 h1:68puzySE6WqUY9KWmpOsDEQfDZsso98rT6pZcz9HqcE= -github.com/google/go-github/v48 v48.2.0/go.mod h1:dDlehKBDo850ZPvCTK0sEqTCVWcrGl2LcDiajkYi89Y= +github.com/google/go-github/v49 v49.0.0 h1:vSz1fnOeGztFxDe48q0RCOrd8Cg4o8INcZBPVpGPNaY= +github.com/google/go-github/v49 v49.0.0/go.mod h1:MUUzHPrhGniB6vUKa27y37likpipzG+BXXJbG04J334= 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= From 8ec1e49a02f967da3b7c5d4d34571adf5ec7ceaa Mon Sep 17 00:00:00 2001 From: mohammad ali <2018cs92@student.uet.edu.pk> Date: Thu, 5 Jan 2023 17:06:01 +0500 Subject: [PATCH 136/751] Add support for GitHub Actions cache API (#2604) Fixes: #2584. --- github/actions_cache.go | 235 +++++++++++++++ github/actions_cache_test.go | 517 ++++++++++++++++++++++++++++++++ github/github-accessors.go | 88 ++++++ github/github-accessors_test.go | 110 +++++++ 4 files changed, 950 insertions(+) create mode 100644 github/actions_cache.go create mode 100644 github/actions_cache_test.go diff --git a/github/actions_cache.go b/github/actions_cache.go new file mode 100644 index 00000000000..9592d9ab62f --- /dev/null +++ b/github/actions_cache.go @@ -0,0 +1,235 @@ +// 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" +) + +// ActionsCache represents a GitHub action cache. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#about-the-cache-api +type ActionsCache struct { + ID *int64 `json:"id,omitempty" url:"-"` + Ref *string `json:"ref,omitempty" url:"ref"` + Key *string `json:"key,omitempty" url:"key"` + Version *string `json:"version,omitempty" url:"-"` + LastAccessedAt *Timestamp `json:"last_accessed_at,omitempty" url:"-"` + CreatedAt *Timestamp `json:"created_at,omitempty" url:"-"` + SizeInBytes *int64 `json:"size_in_bytes,omitempty" url:"-"` +} + +// ActionsCacheList represents a list of GitHub actions Cache. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#list-github-actions-caches-for-a-repository +type ActionsCacheList struct { + TotalCount int `json:"total_count"` + ActionsCaches []*ActionsCache `json:"actions_caches,omitempty"` +} + +// ActionsCacheUsage represents a GitHub Actions Cache Usage object. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-a-repository +type ActionsCacheUsage struct { + FullName string `json:"full_name"` + ActiveCachesSizeInBytes int64 `json:"active_caches_size_in_bytes"` + ActiveCachesCount int `json:"active_caches_count"` +} + +// ActionsCacheUsageList represents a list of repositories with GitHub Actions cache usage for an organization. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-a-repository +type ActionsCacheUsageList struct { + TotalCount int `json:"total_count"` + RepoCacheUsage []*ActionsCacheUsage `json:"repository_cache_usages,omitempty"` +} + +// TotalCacheUsage represents total GitHub actions cache usage of an organization or enterprise. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-an-enterprise +type TotalCacheUsage struct { + TotalActiveCachesUsageSizeInBytes int64 `json:"total_active_caches_size_in_bytes"` + TotalActiveCachesCount int `json:"total_active_caches_count"` +} + +// ActionsCacheListOptions represents a list of all possible optional Query parameters for ListCaches method. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#list-github-actions-caches-for-a-repository +type ActionsCacheListOptions struct { + ListOptions + // The Git reference for the results you want to list. + // The ref for a branch can be formatted either as refs/heads/ + // or simply . To reference a pull request use refs/pull//merge + Ref *string `url:"ref,omitempty"` + Key *string `url:"key,omitempty"` + // Can be one of: "created_at", "last_accessed_at", "size_in_bytes". Default: "last_accessed_at" + Sort *string `url:"sort,omitempty"` + // Can be one of: "asc", "desc" Default: desc + Direction *string `url:"direction,omitempty"` +} + +// ListCaches lists the GitHub Actions caches for a repository. +// You must authenticate using an access token with the repo scope to use this endpoint. +// +// Permissions: must have the actions:read permission to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#list-github-actions-caches-for-a-repository +func (s *ActionsService) ListCaches(ctx context.Context, owner, repo string, opts *ActionsCacheListOptions) (*ActionsCacheList, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/caches", owner, repo) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + actionCacheList := new(ActionsCacheList) + resp, err := s.client.Do(ctx, req, actionCacheList) + if err != nil { + return nil, resp, err + } + + return actionCacheList, resp, nil +} + +// DeleteCachesByKey deletes one or more GitHub Actions caches for a repository, using a complete cache key. +// By default, all caches that match the provided key are deleted, but you can optionally provide +// a Git ref to restrict deletions to caches that match both the provided key and the Git ref. +// The ref for a branch can be formatted either as "refs/heads/" or simply "". +// To reference a pull request use "refs/pull//merge". If you don't want to use ref just pass nil in parameter. +// +// Permissions: You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#delete-github-actions-caches-for-a-repository-using-a-cache-key +func (s *ActionsService) DeleteCachesByKey(ctx context.Context, owner, repo, key string, ref *string) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/caches", owner, repo) + u, err := addOptions(u, ActionsCache{Key: &key, Ref: ref}) + if err != nil { + return nil, err + } + + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// DeleteCachesByID deletes a GitHub Actions cache for a repository, using a cache ID. +// +// Permissions: You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#delete-a-github-actions-cache-for-a-repository-using-a-cache-id +func (s *ActionsService) DeleteCachesByID(ctx context.Context, owner, repo string, cacheID int64) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/caches/%v", owner, repo, cacheID) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// GetCacheUsageForRepo gets GitHub Actions cache usage for a repository. The data fetched using this API is refreshed approximately every 5 minutes, +// so values returned from this endpoint may take at least 5 minutes to get updated. +// +// Permissions: Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an +// access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-a-repository +func (s *ActionsService) GetCacheUsageForRepo(ctx context.Context, owner, repo string) (*ActionsCacheUsage, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/cache/usage", owner, repo) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + cacheUsage := new(ActionsCacheUsage) + res, err := s.client.Do(ctx, req, cacheUsage) + if err != nil { + return nil, res, err + } + + return cacheUsage, res, err +} + +// ListCacheUsageByRepoForOrg lists repositories and their GitHub Actions cache usage for an organization. The data fetched using this API is +// refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated. +// +// Permissions: You must authenticate using an access token with the read:org scope to use this endpoint. +// GitHub Apps must have the organization_admistration:read permission to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#list-repositories-with-github-actions-cache-usage-for-an-organization +func (s *ActionsService) ListCacheUsageByRepoForOrg(ctx context.Context, org string, opts *ListOptions) (*ActionsCacheUsageList, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/cache/usage-by-repository", org) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + cacheUsage := new(ActionsCacheUsageList) + res, err := s.client.Do(ctx, req, cacheUsage) + if err != nil { + return nil, res, err + } + + return cacheUsage, res, err +} + +// GetTotalCacheUsageForOrg gets the total GitHub Actions cache usage for an organization. The data fetched using this API is refreshed approximately every +// 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated. +// +// Permissions: You must authenticate using an access token with the read:org scope to use this endpoint. +// GitHub Apps must have the organization_admistration:read permission to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-an-organization +func (s *ActionsService) GetTotalCacheUsageForOrg(ctx context.Context, org string) (*TotalCacheUsage, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/cache/usage", org) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + cacheUsage := new(TotalCacheUsage) + res, err := s.client.Do(ctx, req, cacheUsage) + if err != nil { + return nil, res, err + } + + return cacheUsage, res, err +} + +// GetTotalCacheUsageForEnterprise gets the total GitHub Actions cache usage for an enterprise. The data fetched using this API is refreshed approximately every 5 minutes, +// so values returned from this endpoint may take at least 5 minutes to get updated. +// +// Permissions: You must authenticate using an access token with the "admin:enterprise" scope to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-an-enterprise +func (s *ActionsService) GetTotalCacheUsageForEnterprise(ctx context.Context, enterprise string) (*TotalCacheUsage, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/cache/usage", enterprise) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + cacheUsage := new(TotalCacheUsage) + res, err := s.client.Do(ctx, req, cacheUsage) + if err != nil { + return nil, res, err + } + + return cacheUsage, res, err +} diff --git a/github/actions_cache_test.go b/github/actions_cache_test.go new file mode 100644 index 00000000000..b72d5cb8284 --- /dev/null +++ b/github/actions_cache_test.go @@ -0,0 +1,517 @@ +// 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 TestActionsService_ListCaches(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/actions/caches", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{"page": "2"}) + fmt.Fprint(w, + `{ + "total_count":1, + "actions_caches":[{"id":1}] + }`, + ) + }) + + opts := &ActionsCacheListOptions{ListOptions: ListOptions{Page: 2}} + ctx := context.Background() + cacheList, _, err := client.Actions.ListCaches(ctx, "o", "r", opts) + if err != nil { + t.Errorf("Actions.ListCaches returned error: %v", err) + } + + want := &ActionsCacheList{TotalCount: 1, ActionsCaches: []*ActionsCache{{ID: Int64(1)}}} + if !cmp.Equal(cacheList, want) { + t.Errorf("Actions.ListCaches returned %+v, want %+v", cacheList, want) + } + + const methodName = "ListCaches" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.ListCaches(ctx, "\n", "\n", opts) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.ListCaches(ctx, "o", "r", opts) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_ListCaches_invalidOwner(t *testing.T) { + client, _, _, teardown := setup() + defer teardown() + + ctx := context.Background() + _, _, err := client.Actions.ListCaches(ctx, "%", "r", nil) + testURLParseError(t, err) +} + +func TestActionsService_ListCaches_invalidRepo(t *testing.T) { + client, _, _, teardown := setup() + defer teardown() + + ctx := context.Background() + _, _, err := client.Actions.ListCaches(ctx, "o", "%", nil) + testURLParseError(t, err) +} + +func TestActionsService_ListCaches_notFound(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/actions/caches", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + w.WriteHeader(http.StatusNotFound) + }) + + ctx := context.Background() + caches, resp, err := client.Actions.ListCaches(ctx, "o", "r", nil) + if err == nil { + t.Errorf("Expected HTTP 404 response") + } + if got, want := resp.Response.StatusCode, http.StatusNotFound; got != want { + t.Errorf("Actions.ListCaches return status %d, want %d", got, want) + } + if caches != nil { + t.Errorf("Actions.ListCaches return %+v, want nil", caches) + } +} + +func TestActionsService_DeleteCachesByKey(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/actions/caches", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + testFormValues(t, r, values{"key": "1", "ref": "main"}) + }) + + ctx := context.Background() + _, err := client.Actions.DeleteCachesByKey(ctx, "o", "r", "1", String("main")) + if err != nil { + t.Errorf("Actions.DeleteCachesByKey return error: %v", err) + } + + const methodName = "DeleteCachesByKey" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Actions.DeleteCachesByKey(ctx, "\n", "\n", "\n", String("\n")) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Actions.DeleteCachesByKey(ctx, "o", "r", "1", String("main")) + }) +} + +func TestActionsService_DeleteCachesByKey_invalidOwner(t *testing.T) { + client, _, _, teardown := setup() + defer teardown() + + ctx := context.Background() + _, err := client.Actions.DeleteCachesByKey(ctx, "%", "r", "1", String("main")) + testURLParseError(t, err) +} + +func TestActionsService_DeleteCachesByKey_invalidRepo(t *testing.T) { + client, _, _, teardown := setup() + defer teardown() + + ctx := context.Background() + _, err := client.Actions.DeleteCachesByKey(ctx, "o", "%", "1", String("main")) + testURLParseError(t, err) +} +func TestActionsService_DeleteCachesByKey_notFound(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/actions/artifacts/1", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + w.WriteHeader(http.StatusNotFound) + }) + + ctx := context.Background() + resp, err := client.Actions.DeleteCachesByKey(ctx, "o", "r", "1", String("main")) + if err == nil { + t.Errorf("Expected HTTP 404 response") + } + if got, want := resp.Response.StatusCode, http.StatusNotFound; got != want { + t.Errorf("Actions.DeleteCachesByKey return status %d, want %d", got, want) + } +} + +func TestActionsService_DeleteCachesByID(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/actions/caches/1", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + }) + + ctx := context.Background() + _, err := client.Actions.DeleteCachesByID(ctx, "o", "r", 1) + if err != nil { + t.Errorf("Actions.DeleteCachesByID return error: %v", err) + } + + const methodName = "DeleteCachesByID" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Actions.DeleteCachesByID(ctx, "\n", "\n", 0) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Actions.DeleteCachesByID(ctx, "o", "r", 1) + }) +} + +func TestActionsService_DeleteCachesByID_invalidOwner(t *testing.T) { + client, _, _, teardown := setup() + defer teardown() + + ctx := context.Background() + _, err := client.Actions.DeleteCachesByID(ctx, "%", "r", 1) + testURLParseError(t, err) +} + +func TestActionsService_DeleteCachesByID_invalidRepo(t *testing.T) { + client, _, _, teardown := setup() + defer teardown() + + ctx := context.Background() + _, err := client.Actions.DeleteCachesByID(ctx, "o", "%", 1) + testURLParseError(t, err) +} + +func TestActionsService_DeleteCachesByID_notFound(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("repos/o/r/actions/caches/1", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + w.WriteHeader(http.StatusNotFound) + }) + + ctx := context.Background() + resp, err := client.Actions.DeleteCachesByID(ctx, "o", "r", 1) + if err == nil { + t.Errorf("Expected HTTP 404 response") + } + if got, want := resp.Response.StatusCode, http.StatusNotFound; got != want { + t.Errorf("Actions.DeleteCachesByID return status %d, want %d", got, want) + } +} + +func TestActionsService_GetCacheUsageForRepo(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/actions/cache/usage", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, + `{ + "full_name":"test-cache", + "active_caches_size_in_bytes":1000, + "active_caches_count":1 + }`, + ) + }) + + ctx := context.Background() + cacheUse, _, err := client.Actions.GetCacheUsageForRepo(ctx, "o", "r") + if err != nil { + t.Errorf("Actions.GetCacheUsageForRepo returned error: %v", err) + } + + want := &ActionsCacheUsage{FullName: "test-cache", ActiveCachesSizeInBytes: 1000, ActiveCachesCount: 1} + if !cmp.Equal(cacheUse, want) { + t.Errorf("Actions.GetCacheUsageForRepo returned %+v, want %+v", cacheUse, want) + } + + const methodName = "GetCacheUsageForRepo" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.GetCacheUsageForRepo(ctx, "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.GetCacheUsageForRepo(ctx, "o", "r") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_GetCacheUsageForRepo_invalidOwner(t *testing.T) { + client, _, _, teardown := setup() + defer teardown() + + ctx := context.Background() + _, _, err := client.Actions.GetCacheUsageForRepo(ctx, "%", "r") + testURLParseError(t, err) +} + +func TestActionsService_GetCacheUsageForRepo_invalidRepo(t *testing.T) { + client, _, _, teardown := setup() + defer teardown() + + ctx := context.Background() + _, _, err := client.Actions.GetCacheUsageForRepo(ctx, "o", "%") + testURLParseError(t, err) +} + +func TestActionsService_GetCacheUsageForRepo_notFound(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/actions/cache/usage", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + w.WriteHeader(http.StatusNotFound) + }) + + ctx := context.Background() + caches, resp, err := client.Actions.GetCacheUsageForRepo(ctx, "o", "r") + if err == nil { + t.Errorf("Expected HTTP 404 response") + } + if got, want := resp.Response.StatusCode, http.StatusNotFound; got != want { + t.Errorf("Actions.GetCacheUsageForRepo return status %d, want %d", got, want) + } + if caches != nil { + t.Errorf("Actions.GetCacheUsageForRepo return %+v, want nil", caches) + } +} + +func TestActionsService_ListCacheUsageByRepoForOrg(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/actions/cache/usage-by-repository", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{"page": "2", "per_page": "1"}) + fmt.Fprint(w, + `{ + "total_count":1, + "repository_cache_usages":[{"full_name":"test-cache","active_caches_size_in_bytes":1000,"active_caches_count":1}] + }`, + ) + }) + + opts := &ListOptions{PerPage: 1, Page: 2} + ctx := context.Background() + cacheList, _, err := client.Actions.ListCacheUsageByRepoForOrg(ctx, "o", opts) + if err != nil { + t.Errorf("Actions.ListCacheUsageByRepoForOrg returned error: %v", err) + } + + want := &ActionsCacheUsageList{TotalCount: 1, RepoCacheUsage: []*ActionsCacheUsage{{FullName: "test-cache", ActiveCachesSizeInBytes: 1000, ActiveCachesCount: 1}}} + if !cmp.Equal(cacheList, want) { + t.Errorf("Actions.ListCacheUsageByRepoForOrg returned %+v, want %+v", cacheList, want) + } + + const methodName = "ListCacheUsageByRepoForOrg" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.ListCacheUsageByRepoForOrg(ctx, "\n", opts) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.ListCacheUsageByRepoForOrg(ctx, "o", opts) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_ListCacheUsageByRepoForOrg_invalidOrganization(t *testing.T) { + client, _, _, teardown := setup() + defer teardown() + + ctx := context.Background() + _, _, err := client.Actions.ListCacheUsageByRepoForOrg(ctx, "%", nil) + testURLParseError(t, err) +} + +func TestActionsService_ListCacheUsageByRepoForOrg_notFound(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/actions/cache/usage-by-repository", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + w.WriteHeader(http.StatusNotFound) + }) + + ctx := context.Background() + caches, resp, err := client.Actions.ListCacheUsageByRepoForOrg(ctx, "o", nil) + if err == nil { + t.Errorf("Expected HTTP 404 response") + } + if got, want := resp.Response.StatusCode, http.StatusNotFound; got != want { + t.Errorf("Actions.ListCacheUsageByRepoForOrg return status %d, want %d", got, want) + } + if caches != nil { + t.Errorf("Actions.ListCacheUsageByRepoForOrg return %+v, want nil", caches) + } +} + +func TestActionsService_GetCacheUsageForOrg(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/actions/cache/usage", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, + `{ + "total_active_caches_size_in_bytes":1000, + "total_active_caches_count":1 + }`, + ) + }) + + ctx := context.Background() + cache, _, err := client.Actions.GetTotalCacheUsageForOrg(ctx, "o") + if err != nil { + t.Errorf("Actions.GetTotalCacheUsageForOrg returned error: %v", err) + } + + want := &TotalCacheUsage{TotalActiveCachesUsageSizeInBytes: 1000, TotalActiveCachesCount: 1} + if !cmp.Equal(cache, want) { + t.Errorf("Actions.GetTotalCacheUsageForOrg returned %+v, want %+v", cache, want) + } + + const methodName = "GetTotalCacheUsageForOrg" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.GetTotalCacheUsageForOrg(ctx, "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.GetTotalCacheUsageForOrg(ctx, "o") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_GetCacheUsageForOrg_invalidOrganization(t *testing.T) { + client, _, _, teardown := setup() + defer teardown() + + ctx := context.Background() + _, _, err := client.Actions.GetTotalCacheUsageForOrg(ctx, "%") + testURLParseError(t, err) +} + +func TestActionsService_GetCacheUsageForOrg_notFound(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/actions/cache/usage", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + w.WriteHeader(http.StatusNotFound) + }) + + ctx := context.Background() + caches, resp, err := client.Actions.GetTotalCacheUsageForOrg(ctx, "o") + if err == nil { + t.Errorf("Expected HTTP 404 response") + } + if got, want := resp.Response.StatusCode, http.StatusNotFound; got != want { + t.Errorf("Actions.GetTotalCacheUsageForOrg return status %d, want %d", got, want) + } + if caches != nil { + t.Errorf("Actions.GetTotalCacheUsageForOrg return %+v, want nil", caches) + } +} + +func TestActionsService_GetCacheUsageForEnterprise(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/enterprises/e/actions/cache/usage", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, + `{ + "total_active_caches_size_in_bytes":1000, + "total_active_caches_count":1 + }`, + ) + }) + + ctx := context.Background() + cache, _, err := client.Actions.GetTotalCacheUsageForEnterprise(ctx, "e") + if err != nil { + t.Errorf("Actions.GetTotalCacheUsageForEnterprise returned error: %v", err) + } + + want := &TotalCacheUsage{TotalActiveCachesUsageSizeInBytes: 1000, TotalActiveCachesCount: 1} + if !cmp.Equal(cache, want) { + t.Errorf("Actions.GetTotalCacheUsageForEnterprise returned %+v, want %+v", cache, want) + } + + const methodName = "GetTotalCacheUsageForEnterprise" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.GetTotalCacheUsageForEnterprise(ctx, "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.GetTotalCacheUsageForEnterprise(ctx, "e") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_GetCacheUsageForEnterprise_invalidEnterprise(t *testing.T) { + client, _, _, teardown := setup() + defer teardown() + + ctx := context.Background() + _, _, err := client.Actions.GetTotalCacheUsageForEnterprise(ctx, "%") + testURLParseError(t, err) +} + +func TestActionsService_GetCacheUsageForEnterprise_notFound(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/enterprises/e/actions/cache/usage", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + w.WriteHeader(http.StatusNotFound) + }) + + ctx := context.Background() + caches, resp, err := client.Actions.GetTotalCacheUsageForEnterprise(ctx, "o") + if err == nil { + t.Errorf("Expected HTTP 404 response") + } + if got, want := resp.Response.StatusCode, http.StatusNotFound; got != want { + t.Errorf("Actions.GetTotalCacheUsageForEnterprise return status %d, want %d", got, want) + } + if caches != nil { + t.Errorf("Actions.GetTotalCacheUsageForEnterprise return %+v, want nil", caches) + } +} diff --git a/github/github-accessors.go b/github/github-accessors.go index 422d8bc0d3b..9ed960fb773 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -38,6 +38,94 @@ func (a *ActionsAllowed) GetVerifiedAllowed() bool { return *a.VerifiedAllowed } +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (a *ActionsCache) GetCreatedAt() Timestamp { + if a == nil || a.CreatedAt == nil { + return Timestamp{} + } + return *a.CreatedAt +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (a *ActionsCache) GetID() int64 { + if a == nil || a.ID == nil { + return 0 + } + return *a.ID +} + +// GetKey returns the Key field if it's non-nil, zero value otherwise. +func (a *ActionsCache) GetKey() string { + if a == nil || a.Key == nil { + return "" + } + return *a.Key +} + +// GetLastAccessedAt returns the LastAccessedAt field if it's non-nil, zero value otherwise. +func (a *ActionsCache) GetLastAccessedAt() Timestamp { + if a == nil || a.LastAccessedAt == nil { + return Timestamp{} + } + return *a.LastAccessedAt +} + +// GetRef returns the Ref field if it's non-nil, zero value otherwise. +func (a *ActionsCache) GetRef() string { + if a == nil || a.Ref == nil { + return "" + } + return *a.Ref +} + +// GetSizeInBytes returns the SizeInBytes field if it's non-nil, zero value otherwise. +func (a *ActionsCache) GetSizeInBytes() int64 { + if a == nil || a.SizeInBytes == nil { + return 0 + } + return *a.SizeInBytes +} + +// GetVersion returns the Version field if it's non-nil, zero value otherwise. +func (a *ActionsCache) GetVersion() string { + if a == nil || a.Version == nil { + return "" + } + return *a.Version +} + +// GetDirection returns the Direction field if it's non-nil, zero value otherwise. +func (a *ActionsCacheListOptions) GetDirection() string { + if a == nil || a.Direction == nil { + return "" + } + return *a.Direction +} + +// GetKey returns the Key field if it's non-nil, zero value otherwise. +func (a *ActionsCacheListOptions) GetKey() string { + if a == nil || a.Key == nil { + return "" + } + return *a.Key +} + +// GetRef returns the Ref field if it's non-nil, zero value otherwise. +func (a *ActionsCacheListOptions) GetRef() string { + if a == nil || a.Ref == nil { + return "" + } + return *a.Ref +} + +// GetSort returns the Sort field if it's non-nil, zero value otherwise. +func (a *ActionsCacheListOptions) GetSort() string { + if a == nil || a.Sort == nil { + return "" + } + return *a.Sort +} + // GetAllowedActions returns the AllowedActions field if it's non-nil, zero value otherwise. func (a *ActionsPermissions) GetAllowedActions() string { if a == nil || a.AllowedActions == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index efa66e7875a..17d8504ae7a 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -45,6 +45,116 @@ func TestActionsAllowed_GetVerifiedAllowed(tt *testing.T) { a.GetVerifiedAllowed() } +func TestActionsCache_GetCreatedAt(tt *testing.T) { + var zeroValue Timestamp + a := &ActionsCache{CreatedAt: &zeroValue} + a.GetCreatedAt() + a = &ActionsCache{} + a.GetCreatedAt() + a = nil + a.GetCreatedAt() +} + +func TestActionsCache_GetID(tt *testing.T) { + var zeroValue int64 + a := &ActionsCache{ID: &zeroValue} + a.GetID() + a = &ActionsCache{} + a.GetID() + a = nil + a.GetID() +} + +func TestActionsCache_GetKey(tt *testing.T) { + var zeroValue string + a := &ActionsCache{Key: &zeroValue} + a.GetKey() + a = &ActionsCache{} + a.GetKey() + a = nil + a.GetKey() +} + +func TestActionsCache_GetLastAccessedAt(tt *testing.T) { + var zeroValue Timestamp + a := &ActionsCache{LastAccessedAt: &zeroValue} + a.GetLastAccessedAt() + a = &ActionsCache{} + a.GetLastAccessedAt() + a = nil + a.GetLastAccessedAt() +} + +func TestActionsCache_GetRef(tt *testing.T) { + var zeroValue string + a := &ActionsCache{Ref: &zeroValue} + a.GetRef() + a = &ActionsCache{} + a.GetRef() + a = nil + a.GetRef() +} + +func TestActionsCache_GetSizeInBytes(tt *testing.T) { + var zeroValue int64 + a := &ActionsCache{SizeInBytes: &zeroValue} + a.GetSizeInBytes() + a = &ActionsCache{} + a.GetSizeInBytes() + a = nil + a.GetSizeInBytes() +} + +func TestActionsCache_GetVersion(tt *testing.T) { + var zeroValue string + a := &ActionsCache{Version: &zeroValue} + a.GetVersion() + a = &ActionsCache{} + a.GetVersion() + a = nil + a.GetVersion() +} + +func TestActionsCacheListOptions_GetDirection(tt *testing.T) { + var zeroValue string + a := &ActionsCacheListOptions{Direction: &zeroValue} + a.GetDirection() + a = &ActionsCacheListOptions{} + a.GetDirection() + a = nil + a.GetDirection() +} + +func TestActionsCacheListOptions_GetKey(tt *testing.T) { + var zeroValue string + a := &ActionsCacheListOptions{Key: &zeroValue} + a.GetKey() + a = &ActionsCacheListOptions{} + a.GetKey() + a = nil + a.GetKey() +} + +func TestActionsCacheListOptions_GetRef(tt *testing.T) { + var zeroValue string + a := &ActionsCacheListOptions{Ref: &zeroValue} + a.GetRef() + a = &ActionsCacheListOptions{} + a.GetRef() + a = nil + a.GetRef() +} + +func TestActionsCacheListOptions_GetSort(tt *testing.T) { + var zeroValue string + a := &ActionsCacheListOptions{Sort: &zeroValue} + a.GetSort() + a = &ActionsCacheListOptions{} + a.GetSort() + a = nil + a.GetSort() +} + func TestActionsPermissions_GetAllowedActions(tt *testing.T) { var zeroValue string a := &ActionsPermissions{AllowedActions: &zeroValue} From 93166f499694cf079d03543bc007f9c0065f6e16 Mon Sep 17 00:00:00 2001 From: Francis Chuang <2263040+F21@users.noreply.github.com> Date: Thu, 5 Jan 2023 23:53:46 +1100 Subject: [PATCH 137/751] Support OIDC subject claim customization templates for actions (#2615) Fixes: #2614. --- github/actions_oidc.go | 73 ++++++++++++++++ github/actions_oidc_test.go | 150 ++++++++++++++++++++++++++++++++ github/github-accessors.go | 8 ++ github/github-accessors_test.go | 10 +++ 4 files changed, 241 insertions(+) create mode 100644 github/actions_oidc.go create mode 100644 github/actions_oidc_test.go diff --git a/github/actions_oidc.go b/github/actions_oidc.go new file mode 100644 index 00000000000..5132ad3a3fb --- /dev/null +++ b/github/actions_oidc.go @@ -0,0 +1,73 @@ +// Copyright 2023 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" +) + +// OIDCSubjectClaimCustomTemplate represents an OIDC subject claim customization template. +type OIDCSubjectClaimCustomTemplate struct { + UseDefault *bool `json:"use_default,omitempty"` + IncludeClaimKeys []string `json:"include_claim_keys"` +} + +// GetOrgOIDCSubjectClaimCustomTemplate gets the subject claim customization template for an organization. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-an-organization +func (s *ActionsService) GetOrgOIDCSubjectClaimCustomTemplate(ctx context.Context, org string) (*OIDCSubjectClaimCustomTemplate, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/oidc/customization/sub", org) + return s.getOIDCSubjectClaimCustomTemplate(ctx, u) +} + +// GetRepoOIDCSubjectClaimCustomTemplate gets the subject claim customization template for a repository. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-a-repository +func (s *ActionsService) GetRepoOIDCSubjectClaimCustomTemplate(ctx context.Context, owner, repo string) (*OIDCSubjectClaimCustomTemplate, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/oidc/customization/sub", owner, repo) + return s.getOIDCSubjectClaimCustomTemplate(ctx, u) +} + +func (s *ActionsService) getOIDCSubjectClaimCustomTemplate(ctx context.Context, url string) (*OIDCSubjectClaimCustomTemplate, *Response, error) { + req, err := s.client.NewRequest("GET", url, nil) + if err != nil { + return nil, nil, err + } + + tmpl := new(OIDCSubjectClaimCustomTemplate) + resp, err := s.client.Do(ctx, req, tmpl) + if err != nil { + return nil, resp, err + } + + return tmpl, resp, nil +} + +// SetOrgOIDCSubjectClaimCustomTemplate sets the subject claim customization for an organization. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-an-organization +func (s *ActionsService) SetOrgOIDCSubjectClaimCustomTemplate(ctx context.Context, org string, template *OIDCSubjectClaimCustomTemplate) (*Response, error) { + u := fmt.Sprintf("orgs/%v/actions/oidc/customization/sub", org) + return s.setOIDCSubjectClaimCustomTemplate(ctx, u, template) +} + +// SetRepoOIDCSubjectClaimCustomTemplate sets the subject claim customization for a repository. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-a-repository +func (s *ActionsService) SetRepoOIDCSubjectClaimCustomTemplate(ctx context.Context, owner, repo string, template *OIDCSubjectClaimCustomTemplate) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/oidc/customization/sub", owner, repo) + return s.setOIDCSubjectClaimCustomTemplate(ctx, u, template) +} + +func (s *ActionsService) setOIDCSubjectClaimCustomTemplate(ctx context.Context, url string, template *OIDCSubjectClaimCustomTemplate) (*Response, error) { + req, err := s.client.NewRequest("PUT", url, template) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} diff --git a/github/actions_oidc_test.go b/github/actions_oidc_test.go new file mode 100644 index 00000000000..99a9a5b3b6d --- /dev/null +++ b/github/actions_oidc_test.go @@ -0,0 +1,150 @@ +// Copyright 2023 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 TestActionsService_GetOrgOIDCSubjectClaimCustomTemplate(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/actions/oidc/customization/sub", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"include_claim_keys":["repo","context"]}`) + }) + + ctx := context.Background() + template, _, err := client.Actions.GetOrgOIDCSubjectClaimCustomTemplate(ctx, "o") + if err != nil { + t.Errorf("Actions.GetOrgOIDCSubjectClaimCustomTemplate returned error: %v", err) + } + + want := &OIDCSubjectClaimCustomTemplate{IncludeClaimKeys: []string{"repo", "context"}} + if !cmp.Equal(template, want) { + t.Errorf("Actions.GetOrgOIDCSubjectClaimCustomTemplate returned %+v, want %+v", template, want) + } + + const methodName = "GetOrgOIDCSubjectClaimCustomTemplate" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.GetOrgOIDCSubjectClaimCustomTemplate(ctx, "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.GetOrgOIDCSubjectClaimCustomTemplate(ctx, "o") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_GetRepoOIDCSubjectClaimCustomTemplate(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/actions/oidc/customization/sub", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"use_default":false,"include_claim_keys":["repo","context"]}`) + }) + + ctx := context.Background() + template, _, err := client.Actions.GetRepoOIDCSubjectClaimCustomTemplate(ctx, "o", "r") + if err != nil { + t.Errorf("Actions.GetRepoOIDCSubjectClaimCustomTemplate returned error: %v", err) + } + + want := &OIDCSubjectClaimCustomTemplate{UseDefault: Bool(false), IncludeClaimKeys: []string{"repo", "context"}} + if !cmp.Equal(template, want) { + t.Errorf("Actions.GetOrgOIDCSubjectClaimCustomTemplate returned %+v, want %+v", template, want) + } + + const methodName = "GetRepoOIDCSubjectClaimCustomTemplate" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.GetRepoOIDCSubjectClaimCustomTemplate(ctx, "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.GetRepoOIDCSubjectClaimCustomTemplate(ctx, "o", "r") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_SetOrgOIDCSubjectClaimCustomTemplate(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/actions/oidc/customization/sub", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + testHeader(t, r, "Content-Type", "application/json") + testBody(t, r, `{"include_claim_keys":["repo","context"]}`+"\n") + w.WriteHeader(http.StatusCreated) + }) + + input := &OIDCSubjectClaimCustomTemplate{ + IncludeClaimKeys: []string{"repo", "context"}, + } + ctx := context.Background() + _, err := client.Actions.SetOrgOIDCSubjectClaimCustomTemplate(ctx, "o", input) + if err != nil { + t.Errorf("Actions.SetOrgOIDCSubjectClaimCustomTemplate returned error: %v", err) + } + + const methodName = "SetOrgOIDCSubjectClaimCustomTemplate" + + testBadOptions(t, methodName, func() (err error) { + _, err = client.Actions.SetOrgOIDCSubjectClaimCustomTemplate(ctx, "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Actions.SetOrgOIDCSubjectClaimCustomTemplate(ctx, "o", input) + }) +} + +func TestActionsService_SetRepoOIDCSubjectClaimCustomTemplate(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/actions/oidc/customization/sub", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + testHeader(t, r, "Content-Type", "application/json") + testBody(t, r, `{"use_default":false,"include_claim_keys":["repo","context"]}`+"\n") + w.WriteHeader(http.StatusCreated) + }) + + input := &OIDCSubjectClaimCustomTemplate{ + UseDefault: Bool(false), + IncludeClaimKeys: []string{"repo", "context"}, + } + ctx := context.Background() + _, err := client.Actions.SetRepoOIDCSubjectClaimCustomTemplate(ctx, "o", "r", input) + if err != nil { + t.Errorf("Actions.SetRepoOIDCSubjectClaimCustomTemplate returned error: %v", err) + } + + const methodName = "SetRepoOIDCSubjectClaimCustomTemplate" + + testBadOptions(t, methodName, func() (err error) { + _, err = client.Actions.SetRepoOIDCSubjectClaimCustomTemplate(ctx, "\n", "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Actions.SetRepoOIDCSubjectClaimCustomTemplate(ctx, "o", "r", input) + }) +} diff --git a/github/github-accessors.go b/github/github-accessors.go index 9ed960fb773..1813988b56c 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -10078,6 +10078,14 @@ func (o *OAuthAPP) GetURL() string { return *o.URL } +// GetUseDefault returns the UseDefault field if it's non-nil, zero value otherwise. +func (o *OIDCSubjectClaimCustomTemplate) GetUseDefault() bool { + if o == nil || o.UseDefault == nil { + return false + } + return *o.UseDefault +} + // GetAdvancedSecurityEnabledForNewRepos returns the AdvancedSecurityEnabledForNewRepos field if it's non-nil, zero value otherwise. func (o *Organization) GetAdvancedSecurityEnabledForNewRepos() bool { if o == nil || o.AdvancedSecurityEnabledForNewRepos == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 17d8504ae7a..3fba51544d7 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -11809,6 +11809,16 @@ func TestOAuthAPP_GetURL(tt *testing.T) { o.GetURL() } +func TestOIDCSubjectClaimCustomTemplate_GetUseDefault(tt *testing.T) { + var zeroValue bool + o := &OIDCSubjectClaimCustomTemplate{UseDefault: &zeroValue} + o.GetUseDefault() + o = &OIDCSubjectClaimCustomTemplate{} + o.GetUseDefault() + o = nil + o.GetUseDefault() +} + func TestOrganization_GetAdvancedSecurityEnabledForNewRepos(tt *testing.T) { var zeroValue bool o := &Organization{AdvancedSecurityEnabledForNewRepos: &zeroValue} From e4ff2a27f7699954c87d81d723012c1c3f0de0f1 Mon Sep 17 00:00:00 2001 From: Francis Chuang <2263040+F21@users.noreply.github.com> Date: Tue, 10 Jan 2023 14:57:59 +1100 Subject: [PATCH 138/751] Omit OpenID Connect customization template claims when none are set (#2620) --- github/actions_oidc.go | 2 +- github/actions_oidc_test.go | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/github/actions_oidc.go b/github/actions_oidc.go index 5132ad3a3fb..b7f2d26ae9c 100644 --- a/github/actions_oidc.go +++ b/github/actions_oidc.go @@ -13,7 +13,7 @@ import ( // OIDCSubjectClaimCustomTemplate represents an OIDC subject claim customization template. type OIDCSubjectClaimCustomTemplate struct { UseDefault *bool `json:"use_default,omitempty"` - IncludeClaimKeys []string `json:"include_claim_keys"` + IncludeClaimKeys []string `json:"include_claim_keys,omitempty"` } // GetOrgOIDCSubjectClaimCustomTemplate gets the subject claim customization template for an organization. diff --git a/github/actions_oidc_test.go b/github/actions_oidc_test.go index 99a9a5b3b6d..c56dfef3d9d 100644 --- a/github/actions_oidc_test.go +++ b/github/actions_oidc_test.go @@ -148,3 +148,34 @@ func TestActionsService_SetRepoOIDCSubjectClaimCustomTemplate(t *testing.T) { return client.Actions.SetRepoOIDCSubjectClaimCustomTemplate(ctx, "o", "r", input) }) } + +func TestActionService_SetRepoOIDCSubjectClaimCustomTemplateToDefault(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/actions/oidc/customization/sub", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + testHeader(t, r, "Content-Type", "application/json") + testBody(t, r, `{"use_default":true}`+"\n") + w.WriteHeader(http.StatusCreated) + }) + + input := &OIDCSubjectClaimCustomTemplate{ + UseDefault: Bool(true), + } + ctx := context.Background() + _, err := client.Actions.SetRepoOIDCSubjectClaimCustomTemplate(ctx, "o", "r", input) + if err != nil { + t.Errorf("Actions.SetRepoOIDCSubjectClaimCustomTemplate returned error: %v", err) + } + + const methodName = "SetRepoOIDCSubjectClaimCustomTemplate" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Actions.SetRepoOIDCSubjectClaimCustomTemplate(ctx, "\n", "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Actions.SetRepoOIDCSubjectClaimCustomTemplate(ctx, "o", "r", input) + }) +} From 838d2238a6da019b49b571e8d8ebc5a6b12f8844 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Tue, 10 Jan 2023 19:57:24 -0500 Subject: [PATCH 139/751] Update minor version to v49.1.0 (#2623) --- github/github.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/github.go b/github/github.go index d5aa1c68702..e97e31f2f5d 100644 --- a/github/github.go +++ b/github/github.go @@ -27,7 +27,7 @@ import ( ) const ( - Version = "v49.0.0" + Version = "v49.1.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" From ced4abd274f3b2bf83ef9d958c005df4b73bcd93 Mon Sep 17 00:00:00 2001 From: sisma <56427420+Ismael-Moreno@users.noreply.github.com> Date: Wed, 11 Jan 2023 13:31:43 +0100 Subject: [PATCH 140/751] Add new DeploymentBranchPolicies endpoints (#2621) Fixes: #2610. --- github/github-accessors.go | 40 +++++ github/github-accessors_test.go | 50 ++++++ github/repos_deployment_branch_policies.go | 123 ++++++++++++++ .../repos_deployment_branch_policies_test.go | 158 ++++++++++++++++++ 4 files changed, 371 insertions(+) create mode 100644 github/repos_deployment_branch_policies.go create mode 100644 github/repos_deployment_branch_policies_test.go diff --git a/github/github-accessors.go b/github/github-accessors.go index 1813988b56c..299e686a275 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -4238,6 +4238,46 @@ func (d *Deployment) GetURL() string { return *d.URL } +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (d *DeploymentBranchPolicy) GetID() int64 { + if d == nil || d.ID == nil { + return 0 + } + return *d.ID +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (d *DeploymentBranchPolicy) GetName() string { + if d == nil || d.Name == nil { + return "" + } + return *d.Name +} + +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (d *DeploymentBranchPolicy) GetNodeID() string { + if d == nil || d.NodeID == nil { + return "" + } + return *d.NodeID +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (d *DeploymentBranchPolicyRequest) GetName() string { + if d == nil || d.Name == nil { + return "" + } + return *d.Name +} + +// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. +func (d *DeploymentBranchPolicyResponse) GetTotalCount() int { + if d == nil || d.TotalCount == nil { + return 0 + } + return *d.TotalCount +} + // GetDeployment returns the Deployment field. func (d *DeploymentEvent) GetDeployment() *Deployment { if d == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 3fba51544d7..12cbdfa1fb4 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -4959,6 +4959,56 @@ func TestDeployment_GetURL(tt *testing.T) { d.GetURL() } +func TestDeploymentBranchPolicy_GetID(tt *testing.T) { + var zeroValue int64 + d := &DeploymentBranchPolicy{ID: &zeroValue} + d.GetID() + d = &DeploymentBranchPolicy{} + d.GetID() + d = nil + d.GetID() +} + +func TestDeploymentBranchPolicy_GetName(tt *testing.T) { + var zeroValue string + d := &DeploymentBranchPolicy{Name: &zeroValue} + d.GetName() + d = &DeploymentBranchPolicy{} + d.GetName() + d = nil + d.GetName() +} + +func TestDeploymentBranchPolicy_GetNodeID(tt *testing.T) { + var zeroValue string + d := &DeploymentBranchPolicy{NodeID: &zeroValue} + d.GetNodeID() + d = &DeploymentBranchPolicy{} + d.GetNodeID() + d = nil + d.GetNodeID() +} + +func TestDeploymentBranchPolicyRequest_GetName(tt *testing.T) { + var zeroValue string + d := &DeploymentBranchPolicyRequest{Name: &zeroValue} + d.GetName() + d = &DeploymentBranchPolicyRequest{} + d.GetName() + d = nil + d.GetName() +} + +func TestDeploymentBranchPolicyResponse_GetTotalCount(tt *testing.T) { + var zeroValue int + d := &DeploymentBranchPolicyResponse{TotalCount: &zeroValue} + d.GetTotalCount() + d = &DeploymentBranchPolicyResponse{} + d.GetTotalCount() + d = nil + d.GetTotalCount() +} + func TestDeploymentEvent_GetDeployment(tt *testing.T) { d := &DeploymentEvent{} d.GetDeployment() diff --git a/github/repos_deployment_branch_policies.go b/github/repos_deployment_branch_policies.go new file mode 100644 index 00000000000..8c4628b39bc --- /dev/null +++ b/github/repos_deployment_branch_policies.go @@ -0,0 +1,123 @@ +// Copyright 2023 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" +) + +// DeploymentBranchPolicy represents a single deployment branch policy for an environment. +type DeploymentBranchPolicy struct { + Name *string `json:"name,omitempty"` + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` +} + +// DeploymentBranchPolicyResponse represents the slightly different format of response that comes back when you list deployment branch policies. +type DeploymentBranchPolicyResponse struct { + TotalCount *int `json:"total_count,omitempty"` + BranchPolicies []*DeploymentBranchPolicy `json:"branch_policies,omitempty"` +} + +// DeploymentBranchPolicyRequest represents a deployment branch policy request. +type DeploymentBranchPolicyRequest struct { + Name *string `json:"name,omitempty"` +} + +// ListDeploymentBranchPolicies lists the deployment branch policies for an environment. +// +// GitHub API docs: https://docs.github.com/en/rest/deployments/branch-policies#list-deployment-branch-policies +func (s *RepositoriesService) ListDeploymentBranchPolicies(ctx context.Context, owner, repo, environment string) (*DeploymentBranchPolicyResponse, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment-branch-policies", owner, repo, environment) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var list *DeploymentBranchPolicyResponse + resp, err := s.client.Do(ctx, req, &list) + if err != nil { + return nil, resp, err + } + + return list, resp, nil +} + +// GetDeploymentBranchPolicy gets a deployment branch policy for an environment. +// +// GitHub API docs: https://docs.github.com/en/rest/deployments/branch-policies#get-a-deployment-branch-policy +func (s *RepositoriesService) GetDeploymentBranchPolicy(ctx context.Context, owner, repo, environment string, branchPolicyID int64) (*DeploymentBranchPolicy, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment-branch-policies/%v", owner, repo, environment, branchPolicyID) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var policy *DeploymentBranchPolicy + resp, err := s.client.Do(ctx, req, &policy) + if err != nil { + return nil, resp, err + } + + return policy, resp, nil +} + +// CreateDeploymentBranchPolicy creates a deployment branch policy for an environment. +// +// GitHub API docs: https://docs.github.com/en/rest/deployments/branch-policies#create-a-deployment-branch-policy +func (s *RepositoriesService) CreateDeploymentBranchPolicy(ctx context.Context, owner, repo, environment string, request *DeploymentBranchPolicyRequest) (*DeploymentBranchPolicy, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment-branch-policies", owner, repo, environment) + + req, err := s.client.NewRequest("POST", u, request) + if err != nil { + return nil, nil, err + } + + var policy *DeploymentBranchPolicy + resp, err := s.client.Do(ctx, req, &policy) + if err != nil { + return nil, resp, err + } + + return policy, resp, nil +} + +// UpdateDeploymentBranchPolicy updates a deployment branch policy for an environment. +// +// GitHub API docs: https://docs.github.com/en/rest/deployments/branch-policies#update-a-deployment-branch-policy +func (s *RepositoriesService) UpdateDeploymentBranchPolicy(ctx context.Context, owner, repo, environment string, branchPolicyID int64, request *DeploymentBranchPolicyRequest) (*DeploymentBranchPolicy, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment-branch-policies/%v", owner, repo, environment, branchPolicyID) + + req, err := s.client.NewRequest("PUT", u, request) + if err != nil { + return nil, nil, err + } + + var policy *DeploymentBranchPolicy + resp, err := s.client.Do(ctx, req, &policy) + if err != nil { + return nil, resp, err + } + + return policy, resp, nil +} + +// DeleteDeploymentBranchPolicy deletes a deployment branch policy for an environment. +// +// GitHub API docs: https://docs.github.com/en/rest/deployments/branch-policies#delete-a-deployment-branch-policy +func (s *RepositoriesService) DeleteDeploymentBranchPolicy(ctx context.Context, owner, repo, environment string, branchPolicyID int64) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment-branch-policies/%v", owner, repo, environment, branchPolicyID) + + 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/repos_deployment_branch_policies_test.go b/github/repos_deployment_branch_policies_test.go new file mode 100644 index 00000000000..69bffac86ed --- /dev/null +++ b/github/repos_deployment_branch_policies_test.go @@ -0,0 +1,158 @@ +// Copyright 2023 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" + "reflect" + "testing" +) + +func TestRepositoriesService_ListDeploymentBranchPolicies(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/environments/e/deployment-branch-policies", func(w http.ResponseWriter, r *http.Request) { + fmt.Fprint(w, `{"total_count":2, "branch_policies":[{"id":1}, {"id": 2}]}`) + }) + + ctx := context.Background() + got, _, err := client.Repositories.ListDeploymentBranchPolicies(ctx, "o", "r", "e") + if err != nil { + t.Errorf("Repositories.ListDeploymentBranchPolicies returned error: %v", err) + } + + want := &DeploymentBranchPolicyResponse{ + BranchPolicies: []*DeploymentBranchPolicy{ + {ID: Int64(1)}, + {ID: Int64(2)}, + }, + TotalCount: Int(2), + } + if !reflect.DeepEqual(got, want) { + t.Errorf("Repositories.ListDeploymentBranchPolicies = %+v, want %+v", got, want) + } + + const methodName = "ListDeploymentBranchPolicies" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.ListDeploymentBranchPolicies(ctx, "o", "r", "e") + if got != nil { + t.Errorf("got non-nil Repositories.ListDeploymentBranchPolicies response: %+v", got) + } + return resp, err + }) +} + +func TestRepositoriesService_GetDeploymentBranchPolicy(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/environments/e/deployment-branch-policies/1", func(w http.ResponseWriter, r *http.Request) { + fmt.Fprint(w, `{"id":1}`) + }) + + ctx := context.Background() + got, _, err := client.Repositories.GetDeploymentBranchPolicy(ctx, "o", "r", "e", 1) + if err != nil { + t.Errorf("Repositories.GetDeploymentBranchPolicy returned error: %v", err) + } + + want := &DeploymentBranchPolicy{ID: Int64(1)} + if !reflect.DeepEqual(got, want) { + t.Errorf("Repositories.GetDeploymentBranchPolicy = %+v, want %+v", got, want) + } + + const methodName = "GetDeploymentBranchPolicy" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.GetDeploymentBranchPolicy(ctx, "o", "r", "e", 1) + if got != nil { + t.Errorf("got non-nil Repositories.GetDeploymentBranchPolicy response: %+v", got) + } + return resp, err + }) +} + +func TestRepositoriesService_CreateDeploymentBranchPolicy(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/environments/e/deployment-branch-policies", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + fmt.Fprint(w, `{"id":1}`) + }) + + ctx := context.Background() + got, _, err := client.Repositories.CreateDeploymentBranchPolicy(ctx, "o", "r", "e", &DeploymentBranchPolicyRequest{Name: String("n")}) + if err != nil { + t.Errorf("Repositories.CreateDeploymentBranchPolicy returned error: %v", err) + } + + want := &DeploymentBranchPolicy{ID: Int64(1)} + if !reflect.DeepEqual(got, want) { + t.Errorf("Repositories.CreateDeploymentBranchPolicy = %+v, want %+v", got, want) + } + + const methodName = "CreateDeploymentBranchPolicy" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.CreateDeploymentBranchPolicy(ctx, "o", "r", "e", &DeploymentBranchPolicyRequest{Name: String("n")}) + if got != nil { + t.Errorf("got non-nil Repositories.CreateDeploymentBranchPolicy response: %+v", got) + } + return resp, err + }) +} + +func TestRepositoriesService_UpdateDeploymentBranchPolicy(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/environments/e/deployment-branch-policies/1", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + fmt.Fprint(w, `{"id":1}`) + }) + + ctx := context.Background() + got, _, err := client.Repositories.UpdateDeploymentBranchPolicy(ctx, "o", "r", "e", 1, &DeploymentBranchPolicyRequest{Name: String("n")}) + if err != nil { + t.Errorf("Repositories.UpdateDeploymentBranchPolicy returned error: %v", err) + } + + want := &DeploymentBranchPolicy{ID: Int64(1)} + if !reflect.DeepEqual(got, want) { + t.Errorf("Repositories.UpdateDeploymentBranchPolicy = %+v, want %+v", got, want) + } + + const methodName = "UpdateDeploymentBranchPolicy" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.UpdateDeploymentBranchPolicy(ctx, "o", "r", "e", 1, &DeploymentBranchPolicyRequest{Name: String("n")}) + if got != nil { + t.Errorf("got non-nil Repositories.UpdateDeploymentBranchPolicy response: %+v", got) + } + return resp, err + }) +} + +func TestRepositoriesService_DeleteDeploymentBranchPolicy(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/environments/e/deployment-branch-policies/1", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + }) + + ctx := context.Background() + _, err := client.Repositories.DeleteDeploymentBranchPolicy(ctx, "o", "r", "e", 1) + if err != nil { + t.Errorf("Repositories.DeleteDeploymentBranchPolicy returned error: %v", err) + } + + const methodName = "DeleteDeploymentBranchPolicy" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Repositories.DeleteDeploymentBranchPolicy(ctx, "o", "r", "e", 1) + }) +} From ea25803a8490a2b065395a36b9fca59ea3ac12f2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Jan 2023 16:48:52 -0500 Subject: [PATCH 141/751] Bump github.com/google/go-github/v49 from 49.0.0 to 49.1.0 in /scrape (#2627) --- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 01a68390409..3facac41259 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.9 - github.com/google/go-github/v49 v49.0.0 + github.com/google/go-github/v49 v49.1.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 f32e7440562..024869e76a4 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.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v49 v49.0.0 h1:vSz1fnOeGztFxDe48q0RCOrd8Cg4o8INcZBPVpGPNaY= -github.com/google/go-github/v49 v49.0.0/go.mod h1:MUUzHPrhGniB6vUKa27y37likpipzG+BXXJbG04J334= +github.com/google/go-github/v49 v49.1.0 h1:LFkMgawGQ8dfzWLH/rNE0b3u1D3n6/dw7ZmrN3b+YFY= +github.com/google/go-github/v49 v49.1.0/go.mod h1:MUUzHPrhGniB6vUKa27y37likpipzG+BXXJbG04J334= 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= From 9708994fd6da01ae131c202a0db44f62cbb5ec52 Mon Sep 17 00:00:00 2001 From: Daniel Liao <10663736+liaodaniel@users.noreply.github.com> Date: Tue, 17 Jan 2023 12:25:34 +1100 Subject: [PATCH 142/751] Add RequireLastPushApproval field to UpdateBranchProtection (#2629) Fixes: #2628. --- github/github-accessors.go | 8 ++++++ github/github-accessors_test.go | 10 +++++++ github/repos.go | 2 ++ github/repos_test.go | 48 ++++++++++++++++++++++++++++++++- 4 files changed, 67 insertions(+), 1 deletion(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 299e686a275..9017783e189 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -13854,6 +13854,14 @@ func (p *PullRequestReviewsEnforcementRequest) GetDismissalRestrictionsRequest() return p.DismissalRestrictionsRequest } +// GetRequireLastPushApproval returns the RequireLastPushApproval field if it's non-nil, zero value otherwise. +func (p *PullRequestReviewsEnforcementRequest) GetRequireLastPushApproval() bool { + if p == nil || p.RequireLastPushApproval == nil { + return false + } + return *p.RequireLastPushApproval +} + // GetBypassPullRequestAllowancesRequest returns the BypassPullRequestAllowancesRequest field. func (p *PullRequestReviewsEnforcementUpdate) GetBypassPullRequestAllowancesRequest() *BypassPullRequestAllowancesRequest { if p == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 12cbdfa1fb4..da69e2632e4 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -16100,6 +16100,16 @@ func TestPullRequestReviewsEnforcementRequest_GetDismissalRestrictionsRequest(tt p.GetDismissalRestrictionsRequest() } +func TestPullRequestReviewsEnforcementRequest_GetRequireLastPushApproval(tt *testing.T) { + var zeroValue bool + p := &PullRequestReviewsEnforcementRequest{RequireLastPushApproval: &zeroValue} + p.GetRequireLastPushApproval() + p = &PullRequestReviewsEnforcementRequest{} + p.GetRequireLastPushApproval() + p = nil + p.GetRequireLastPushApproval() +} + func TestPullRequestReviewsEnforcementUpdate_GetBypassPullRequestAllowancesRequest(tt *testing.T) { p := &PullRequestReviewsEnforcementUpdate{} p.GetBypassPullRequestAllowancesRequest() diff --git a/github/repos.go b/github/repos.go index bef81b3d89c..f27444b7277 100644 --- a/github/repos.go +++ b/github/repos.go @@ -1064,6 +1064,8 @@ type PullRequestReviewsEnforcementRequest struct { // RequiredApprovingReviewCount specifies the number of approvals required before the pull request can be merged. // Valid values are 1-6. RequiredApprovingReviewCount int `json:"required_approving_review_count"` + // RequireLastPushApproval specifies whether the last pusher to a pull request branch can approve it. + RequireLastPushApproval *bool `json:"require_last_push_approval,omitempty"` } // PullRequestReviewsEnforcementUpdate represents request to patch the pull request review diff --git a/github/repos_test.go b/github/repos_test.go index bcaa7d3d615..4a3f4f59866 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -1082,6 +1082,7 @@ func TestRepositoriesService_GetBranchProtection(t *testing.T) { }, "dismiss_stale_reviews":true, "require_code_owner_reviews":true, + "require_last_push_approval":false, "required_approving_review_count":1 }, "enforce_admins":{ @@ -1130,6 +1131,7 @@ func TestRepositoriesService_GetBranchProtection(t *testing.T) { }, RequireCodeOwnerReviews: true, RequiredApprovingReviewCount: 1, + RequireLastPushApproval: false, }, EnforceAdmins: &AdminEnforcement{ URL: String("/repos/o/r/branches/b/protection/enforce_admins"), @@ -1633,6 +1635,7 @@ func TestRepositoriesService_UpdateBranchProtection_StrictNoChecks(t *testing.T) }, "dismiss_stale_reviews":true, "require_code_owner_reviews":true, + "require_last_push_approval":false, "bypass_pull_request_allowances": { "users":[{"id":10,"login":"uuu"}], "teams":[{"id":20,"slug":"ttt"}], @@ -1702,6 +1705,48 @@ func TestRepositoriesService_UpdateBranchProtection_StrictNoChecks(t *testing.T) } } +func TestRepositoriesService_UpdateBranchProtection_RequireLastPushApproval(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + input := &ProtectionRequest{ + RequiredPullRequestReviews: &PullRequestReviewsEnforcementRequest{ + RequireLastPushApproval: Bool(true), + }, + } + + mux.HandleFunc("/repos/o/r/branches/b/protection", func(w http.ResponseWriter, r *http.Request) { + v := new(ProtectionRequest) + json.NewDecoder(r.Body).Decode(v) + + testMethod(t, r, "PUT") + if !cmp.Equal(v, input) { + t.Errorf("Request body = %+v, want %+v", v, input) + } + + fmt.Fprintf(w, `{ + "required_pull_request_reviews":{ + "require_last_push_approval":true + } + }`) + }) + + ctx := context.Background() + protection, _, err := client.Repositories.UpdateBranchProtection(ctx, "o", "r", "b", input) + if err != nil { + t.Errorf("Repositories.UpdateBranchProtection returned error: %v", err) + } + + want := &Protection{ + RequiredPullRequestReviews: &PullRequestReviewsEnforcement{ + RequireLastPushApproval: true, + }, + } + if !cmp.Equal(protection, want) { + t.Errorf("Repositories.UpdateBranchProtection returned %+v, want %+v", protection, want) + } +} + func TestRepositoriesService_RemoveBranchProtection(t *testing.T) { client, mux, _, teardown := setup() defer teardown() @@ -2561,6 +2606,7 @@ func TestPullRequestReviewsEnforcementRequest_MarshalJSON_nilDismissalRestirctio Teams: &[]string{}, Apps: &[]string{}, }, + RequireLastPushApproval: Bool(true), } got, err = json.Marshal(req) @@ -2568,7 +2614,7 @@ func TestPullRequestReviewsEnforcementRequest_MarshalJSON_nilDismissalRestirctio t.Errorf("PullRequestReviewsEnforcementRequest.MarshalJSON returned error: %v", err) } - want = `{"dismissal_restrictions":{"users":[],"teams":[],"apps":[]},"dismiss_stale_reviews":false,"require_code_owner_reviews":false,"required_approving_review_count":0}` + want = `{"dismissal_restrictions":{"users":[],"teams":[],"apps":[]},"dismiss_stale_reviews":false,"require_code_owner_reviews":false,"required_approving_review_count":0,"require_last_push_approval":true}` if want != string(got) { t.Errorf("PullRequestReviewsEnforcementRequest.MarshalJSON returned %+v, want %+v", string(got), want) } From 34cc7b4a47c49f893bfa9d451883f752d13e73ed Mon Sep 17 00:00:00 2001 From: Adam Kohring Date: Tue, 17 Jan 2023 09:22:41 -0500 Subject: [PATCH 143/751] Add workflow_name to WorkflowJob struct (#2630) --- github/actions_workflow_jobs.go | 1 + github/actions_workflow_jobs_test.go | 14 +++++++++----- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ 4 files changed, 28 insertions(+), 5 deletions(-) diff --git a/github/actions_workflow_jobs.go b/github/actions_workflow_jobs.go index 1422fd471c9..b55f9aa7f8d 100644 --- a/github/actions_workflow_jobs.go +++ b/github/actions_workflow_jobs.go @@ -45,6 +45,7 @@ type WorkflowJob struct { RunnerGroupID *int64 `json:"runner_group_id,omitempty"` RunnerGroupName *string `json:"runner_group_name,omitempty"` RunAttempt *int64 `json:"run_attempt,omitempty"` + WorkflowName *string `json:"workflow_name,omitempty"` } // Jobs represents a slice of repository action workflow job. diff --git a/github/actions_workflow_jobs_test.go b/github/actions_workflow_jobs_test.go index 204f0014092..da52619a195 100644 --- a/github/actions_workflow_jobs_test.go +++ b/github/actions_workflow_jobs_test.go @@ -264,7 +264,8 @@ func TestWorkflowJob_Marshal(t *testing.T) { CompletedAt: &Timestamp{referenceTime}, }, }, - CheckRunURL: String("c"), + CheckRunURL: String("c"), + WorkflowName: String("w"), } want := `{ @@ -288,7 +289,8 @@ func TestWorkflowJob_Marshal(t *testing.T) { "started_at": ` + referenceTimeStr + `, "completed_at": ` + referenceTimeStr + ` }], - "check_run_url": "c" + "check_run_url": "c", + "workflow_name": "w" }` testJSONMarshal(t, u, want) @@ -323,8 +325,9 @@ func TestJobs_Marshal(t *testing.T) { CompletedAt: &Timestamp{referenceTime}, }, }, - CheckRunURL: String("c"), - RunAttempt: Int64(2), + CheckRunURL: String("c"), + RunAttempt: Int64(2), + WorkflowName: String("w"), }, }, } @@ -353,7 +356,8 @@ func TestJobs_Marshal(t *testing.T) { "completed_at": ` + referenceTimeStr + ` }], "check_run_url": "c", - "run_attempt": 2 + "run_attempt": 2, + "workflow_name": "w" }] }` diff --git a/github/github-accessors.go b/github/github-accessors.go index 9017783e189..400bde8c3c3 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -20910,6 +20910,14 @@ func (w *WorkflowJob) GetURL() string { return *w.URL } +// GetWorkflowName returns the WorkflowName field if it's non-nil, zero value otherwise. +func (w *WorkflowJob) GetWorkflowName() string { + if w == nil || w.WorkflowName == nil { + return "" + } + return *w.WorkflowName +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (w *WorkflowJobEvent) GetAction() string { if w == nil || w.Action == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index da69e2632e4..3e4b469463e 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -24443,6 +24443,16 @@ func TestWorkflowJob_GetURL(tt *testing.T) { w.GetURL() } +func TestWorkflowJob_GetWorkflowName(tt *testing.T) { + var zeroValue string + w := &WorkflowJob{WorkflowName: &zeroValue} + w.GetWorkflowName() + w = &WorkflowJob{} + w.GetWorkflowName() + w = nil + w.GetWorkflowName() +} + func TestWorkflowJobEvent_GetAction(tt *testing.T) { var zeroValue string w := &WorkflowJobEvent{Action: &zeroValue} From d7134b7a337520b2eead44cc838b512c51cfe80d Mon Sep 17 00:00:00 2001 From: Jarek Porzucek <17789797+jporzucek@users.noreply.github.com> Date: Wed, 18 Jan 2023 19:31:48 +0100 Subject: [PATCH 144/751] Support users and teams in branch protection access restrictions (#2561) Fixes: #2560. --- github/repos.go | 220 +++++++++++++++++++++++++++++--- github/repos_test.go | 290 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 487 insertions(+), 23 deletions(-) diff --git a/github/repos.go b/github/repos.go index f27444b7277..1f6a3181ea6 100644 --- a/github/repos.go +++ b/github/repos.go @@ -1180,7 +1180,7 @@ type DismissalRestrictionsRequest struct { Users *[]string `json:"users,omitempty"` // The list of team slugs which can dismiss pull request reviews. (Required; use nil to disable dismissal_restrictions or &[]string{} otherwise.) Teams *[]string `json:"teams,omitempty"` - // The list of apps which can dismiss pull request reviews. (Required; use nil to disable dismissal_restrictions or &[]string{} otherwise.) + // The list of app slugs which can dismiss pull request reviews. (Required; use nil to disable dismissal_restrictions or &[]string{} otherwise.) Apps *[]string `json:"apps,omitempty"` } @@ -1676,6 +1676,8 @@ func (s *RepositoriesService) ReplaceAllTopics(ctx context.Context, owner, repo // It requires the GitHub apps to have `write` access to the `content` permission. // // GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch +// +// Deprecated: Please use ListAppRestrictions instead. func (s *RepositoriesService) ListApps(ctx context.Context, owner, repo, branch string) ([]*App, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, branch) req, err := s.client.NewRequest("GET", u, nil) @@ -1692,6 +1694,16 @@ func (s *RepositoriesService) ListApps(ctx context.Context, owner, repo, branch return apps, resp, nil } +// ListAppRestrictions lists the GitHub apps that have push access to a given protected branch. +// It requires the GitHub apps to have `write` access to the `content` permission. +// +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch +// +// Note: This is a wrapper around ListApps so a naming convention with ListUserRestrictions and ListTeamRestrictions is preserved. +func (s *RepositoriesService) ListAppRestrictions(ctx context.Context, owner, repo, branch string) ([]*App, *Response, error) { + return s.ListApps(ctx, owner, repo, branch) +} + // ReplaceAppRestrictions replaces the apps that have push access to a given protected branch. // It removes all apps that previously had push access and grants push access to the new list of apps. // It requires the GitHub apps to have `write` access to the `content` permission. @@ -1699,20 +1711,20 @@ func (s *RepositoriesService) ListApps(ctx context.Context, owner, repo, branch // Note: The list of users, apps, and teams in total is limited to 100 items. // // GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#set-app-access-restrictions -func (s *RepositoriesService) ReplaceAppRestrictions(ctx context.Context, owner, repo, branch string, slug []string) ([]*App, *Response, error) { +func (s *RepositoriesService) ReplaceAppRestrictions(ctx context.Context, owner, repo, branch string, apps []string) ([]*App, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, branch) - req, err := s.client.NewRequest("PUT", u, slug) + req, err := s.client.NewRequest("PUT", u, apps) if err != nil { return nil, nil, err } - var apps []*App - resp, err := s.client.Do(ctx, req, &apps) + var newApps []*App + resp, err := s.client.Do(ctx, req, &newApps) if err != nil { return nil, resp, err } - return apps, resp, nil + return newApps, resp, nil } // AddAppRestrictions grants the specified apps push access to a given protected branch. @@ -1721,42 +1733,216 @@ func (s *RepositoriesService) ReplaceAppRestrictions(ctx context.Context, owner, // Note: The list of users, apps, and teams in total is limited to 100 items. // // GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#add-app-access-restrictions -func (s *RepositoriesService) AddAppRestrictions(ctx context.Context, owner, repo, branch string, slug []string) ([]*App, *Response, error) { +func (s *RepositoriesService) AddAppRestrictions(ctx context.Context, owner, repo, branch string, apps []string) ([]*App, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, branch) - req, err := s.client.NewRequest("POST", u, slug) + req, err := s.client.NewRequest("POST", u, apps) if err != nil { return nil, nil, err } - var apps []*App - resp, err := s.client.Do(ctx, req, &apps) + var newApps []*App + resp, err := s.client.Do(ctx, req, &newApps) if err != nil { return nil, resp, err } - return apps, resp, nil + return newApps, resp, nil } -// RemoveAppRestrictions removes the ability of an app to push to this branch. +// RemoveAppRestrictions removes the restrictions of an app from pushing to this branch. // It requires the GitHub apps to have `write` access to the `content` permission. // // Note: The list of users, apps, and teams in total is limited to 100 items. // // GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#remove-app-access-restrictions -func (s *RepositoriesService) RemoveAppRestrictions(ctx context.Context, owner, repo, branch string, slug []string) ([]*App, *Response, error) { +func (s *RepositoriesService) RemoveAppRestrictions(ctx context.Context, owner, repo, branch string, apps []string) ([]*App, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, branch) - req, err := s.client.NewRequest("DELETE", u, slug) + req, err := s.client.NewRequest("DELETE", u, apps) if err != nil { return nil, nil, err } - var apps []*App - resp, err := s.client.Do(ctx, req, &apps) + var newApps []*App + resp, err := s.client.Do(ctx, req, &newApps) if err != nil { return nil, resp, err } - return apps, resp, nil + return newApps, resp, nil +} + +// ListTeamRestrictions lists the GitHub teams that have push access to a given protected branch. +// It requires the GitHub teams to have `write` access to the `content` permission. +// +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-teams-with-access-to-the-protected-branch +func (s *RepositoriesService) ListTeamRestrictions(ctx context.Context, owner, repo, branch string) ([]*Team, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/teams", owner, repo, branch) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var teams []*Team + resp, err := s.client.Do(ctx, req, &teams) + if err != nil { + return nil, resp, err + } + + return teams, resp, nil +} + +// ReplaceTeamRestrictions replaces the team that have push access to a given protected branch. +// This removes all teams that previously had push access and grants push access to the new list of teams. +// It requires the GitHub teams to have `write` access to the `content` permission. +// +// Note: The list of users, apps, and teams in total is limited to 100 items. +// +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#set-team-access-restrictions +func (s *RepositoriesService) ReplaceTeamRestrictions(ctx context.Context, owner, repo, branch string, teams []string) ([]*Team, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/teams", owner, repo, branch) + req, err := s.client.NewRequest("PUT", u, teams) + if err != nil { + return nil, nil, err + } + + var newTeams []*Team + resp, err := s.client.Do(ctx, req, &newTeams) + if err != nil { + return nil, resp, err + } + + return newTeams, resp, nil +} + +// AddTeamRestrictions grants the specified teams push access to a given protected branch. +// It requires the GitHub teams to have `write` access to the `content` permission. +// +// Note: The list of users, apps, and teams in total is limited to 100 items. +// +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#add-team-access-restrictions +func (s *RepositoriesService) AddTeamRestrictions(ctx context.Context, owner, repo, branch string, teams []string) ([]*Team, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/teams", owner, repo, branch) + req, err := s.client.NewRequest("POST", u, teams) + if err != nil { + return nil, nil, err + } + + var newTeams []*Team + resp, err := s.client.Do(ctx, req, &newTeams) + if err != nil { + return nil, resp, err + } + + return newTeams, resp, nil +} + +// RemoveTeamRestrictions removes the restrictions of a team from pushing to this branch. +// It requires the GitHub teams to have `write` access to the `content` permission. +// +// Note: The list of users, apps, and teams in total is limited to 100 items. +// +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#remove-team-access-restrictions +func (s *RepositoriesService) RemoveTeamRestrictions(ctx context.Context, owner, repo, branch string, teams []string) ([]*Team, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/teams", owner, repo, branch) + req, err := s.client.NewRequest("DELETE", u, teams) + if err != nil { + return nil, nil, err + } + + var newTeams []*Team + resp, err := s.client.Do(ctx, req, &newTeams) + if err != nil { + return nil, resp, err + } + + return newTeams, resp, nil +} + +// ListUserRestrictions lists the GitHub users that have push access to a given protected branch. +// It requires the GitHub users to have `write` access to the `content` permission. +// +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-users-with-access-to-the-protected-branch +func (s *RepositoriesService) ListUserRestrictions(ctx context.Context, owner, repo, branch string) ([]*User, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/users", owner, repo, branch) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var users []*User + resp, err := s.client.Do(ctx, req, &users) + if err != nil { + return nil, resp, err + } + + return users, resp, nil +} + +// ReplaceUserRestrictions replaces the user that have push access to a given protected branch. +// It removes all users that previously had push access and grants push access to the new list of users. +// It requires the GitHub users to have `write` access to the `content` permission. +// +// Note: The list of users, apps, and teams in total is limited to 100 items. +// +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#set-team-access-restrictions +func (s *RepositoriesService) ReplaceUserRestrictions(ctx context.Context, owner, repo, branch string, users []string) ([]*User, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/users", owner, repo, branch) + req, err := s.client.NewRequest("PUT", u, users) + if err != nil { + return nil, nil, err + } + + var newUsers []*User + resp, err := s.client.Do(ctx, req, &newUsers) + if err != nil { + return nil, resp, err + } + + return newUsers, resp, nil +} + +// AddUserRestrictions grants the specified users push access to a given protected branch. +// It requires the GitHub users to have `write` access to the `content` permission. +// +// Note: The list of users, apps, and teams in total is limited to 100 items. +// +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#add-team-access-restrictions +func (s *RepositoriesService) AddUserRestrictions(ctx context.Context, owner, repo, branch string, users []string) ([]*User, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/users", owner, repo, branch) + req, err := s.client.NewRequest("POST", u, users) + if err != nil { + return nil, nil, err + } + + var newUsers []*User + resp, err := s.client.Do(ctx, req, &newUsers) + if err != nil { + return nil, resp, err + } + + return newUsers, resp, nil +} + +// RemoveUserRestrictions removes the restrictions of a user from pushing to this branch. +// It requires the GitHub users to have `write` access to the `content` permission. +// +// Note: The list of users, apps, and teams in total is limited to 100 items. +// +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#remove-team-access-restrictions +func (s *RepositoriesService) RemoveUserRestrictions(ctx context.Context, owner, repo, branch string, users []string) ([]*User, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/users", owner, repo, branch) + req, err := s.client.NewRequest("DELETE", u, users) + if err != nil { + return nil, nil, err + } + + var newUsers []*User + resp, err := s.client.Do(ctx, req, &newUsers) + if err != nil { + return nil, resp, err + } + + return newUsers, resp, nil } // TransferRequest represents a request to transfer a repository. diff --git a/github/repos_test.go b/github/repos_test.go index 4a3f4f59866..5f59216b2b9 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -2760,7 +2760,7 @@ func TestRepositoriesService_ReplaceAllTopics_emptySlice(t *testing.T) { } } -func TestRepositoriesService_ListApps(t *testing.T) { +func TestRepositoriesService_ListAppRestrictions(t *testing.T) { client, mux, _, teardown := setup() defer teardown() @@ -2769,19 +2769,19 @@ func TestRepositoriesService_ListApps(t *testing.T) { }) ctx := context.Background() - _, _, err := client.Repositories.ListApps(ctx, "o", "r", "b") + _, _, err := client.Repositories.ListAppRestrictions(ctx, "o", "r", "b") if err != nil { - t.Errorf("Repositories.ListApps returned error: %v", err) + t.Errorf("Repositories.ListAppRestrictions returned error: %v", err) } - const methodName = "ListApps" + const methodName = "ListAppRestrictions" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.ListApps(ctx, "\n", "\n", "\n") + _, _, err = client.Repositories.ListAppRestrictions(ctx, "\n", "\n", "\n") return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.ListApps(ctx, "o", "r", "b") + got, resp, err := client.Repositories.ListAppRestrictions(ctx, "o", "r", "b") if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -2899,6 +2899,284 @@ func TestRepositoriesService_RemoveAppRestrictions(t *testing.T) { }) } +func TestRepositoriesService_ListTeamRestrictions(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/branches/b/protection/restrictions/teams", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + }) + + ctx := context.Background() + _, _, err := client.Repositories.ListTeamRestrictions(ctx, "o", "r", "b") + if err != nil { + t.Errorf("Repositories.ListTeamRestrictions returned error: %v", err) + } + + const methodName = "ListTeamRestrictions" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.ListTeamRestrictions(ctx, "\n", "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.ListTeamRestrictions(ctx, "o", "r", "b") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestRepositoriesService_ReplaceTeamRestrictions(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/branches/b/protection/restrictions/teams", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + fmt.Fprint(w, `[{ + "name": "octocat" + }]`) + }) + input := []string{"octocat"} + ctx := context.Background() + got, _, err := client.Repositories.ReplaceTeamRestrictions(ctx, "o", "r", "b", input) + if err != nil { + t.Errorf("Repositories.ReplaceTeamRestrictions returned error: %v", err) + } + want := []*Team{ + {Name: String("octocat")}, + } + if !cmp.Equal(got, want) { + t.Errorf("Repositories.ReplaceTeamRestrictions returned %+v, want %+v", got, want) + } + + const methodName = "ReplaceTeamRestrictions" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.ReplaceTeamRestrictions(ctx, "\n", "\n", "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.ReplaceTeamRestrictions(ctx, "o", "r", "b", input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestRepositoriesService_AddTeamRestrictions(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/branches/b/protection/restrictions/teams", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + fmt.Fprint(w, `[{ + "name": "octocat" + }]`) + }) + input := []string{"octocat"} + ctx := context.Background() + got, _, err := client.Repositories.AddTeamRestrictions(ctx, "o", "r", "b", input) + if err != nil { + t.Errorf("Repositories.AddTeamRestrictions returned error: %v", err) + } + want := []*Team{ + {Name: String("octocat")}, + } + if !cmp.Equal(got, want) { + t.Errorf("Repositories.AddTeamRestrictions returned %+v, want %+v", got, want) + } + + const methodName = "AddTeamRestrictions" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.AddTeamRestrictions(ctx, "\n", "\n", "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.AddTeamRestrictions(ctx, "o", "r", "b", input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestRepositoriesService_RemoveTeamRestrictions(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/branches/b/protection/restrictions/teams", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + fmt.Fprint(w, `[]`) + }) + input := []string{"octocat"} + ctx := context.Background() + got, _, err := client.Repositories.RemoveTeamRestrictions(ctx, "o", "r", "b", input) + if err != nil { + t.Errorf("Repositories.RemoveTeamRestrictions returned error: %v", err) + } + want := []*Team{} + if !cmp.Equal(got, want) { + t.Errorf("Repositories.RemoveTeamRestrictions returned %+v, want %+v", got, want) + } + + const methodName = "RemoveTeamRestrictions" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.RemoveTeamRestrictions(ctx, "\n", "\n", "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.RemoveTeamRestrictions(ctx, "o", "r", "b", input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestRepositoriesService_ListUserRestrictions(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/branches/b/protection/restrictions/users", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + }) + + ctx := context.Background() + _, _, err := client.Repositories.ListUserRestrictions(ctx, "o", "r", "b") + if err != nil { + t.Errorf("Repositories.ListUserRestrictions returned error: %v", err) + } + + const methodName = "ListUserRestrictions" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.ListUserRestrictions(ctx, "\n", "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.ListUserRestrictions(ctx, "o", "r", "b") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestRepositoriesService_ReplaceUserRestrictions(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/branches/b/protection/restrictions/users", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + fmt.Fprint(w, `[{ + "name": "octocat" + }]`) + }) + input := []string{"octocat"} + ctx := context.Background() + got, _, err := client.Repositories.ReplaceUserRestrictions(ctx, "o", "r", "b", input) + if err != nil { + t.Errorf("Repositories.ReplaceUserRestrictions returned error: %v", err) + } + want := []*User{ + {Name: String("octocat")}, + } + if !cmp.Equal(got, want) { + t.Errorf("Repositories.ReplaceUserRestrictions returned %+v, want %+v", got, want) + } + + const methodName = "ReplaceUserRestrictions" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.ReplaceUserRestrictions(ctx, "\n", "\n", "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.ReplaceUserRestrictions(ctx, "o", "r", "b", input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestRepositoriesService_AddUserRestrictions(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/branches/b/protection/restrictions/users", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + fmt.Fprint(w, `[{ + "name": "octocat" + }]`) + }) + input := []string{"octocat"} + ctx := context.Background() + got, _, err := client.Repositories.AddUserRestrictions(ctx, "o", "r", "b", input) + if err != nil { + t.Errorf("Repositories.AddUserRestrictions returned error: %v", err) + } + want := []*User{ + {Name: String("octocat")}, + } + if !cmp.Equal(got, want) { + t.Errorf("Repositories.AddUserRestrictions returned %+v, want %+v", got, want) + } + + const methodName = "AddUserRestrictions" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.AddUserRestrictions(ctx, "\n", "\n", "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.AddUserRestrictions(ctx, "o", "r", "b", input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestRepositoriesService_RemoveUserRestrictions(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/branches/b/protection/restrictions/users", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + fmt.Fprint(w, `[]`) + }) + input := []string{"octocat"} + ctx := context.Background() + got, _, err := client.Repositories.RemoveUserRestrictions(ctx, "o", "r", "b", input) + if err != nil { + t.Errorf("Repositories.RemoveUserRestrictions returned error: %v", err) + } + want := []*User{} + if !cmp.Equal(got, want) { + t.Errorf("Repositories.RemoveUserRestrictions returned %+v, want %+v", got, want) + } + + const methodName = "RemoveUserRestrictions" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.RemoveUserRestrictions(ctx, "\n", "\n", "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.RemoveUserRestrictions(ctx, "o", "r", "b", input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + func TestRepositoriesService_Transfer(t *testing.T) { client, mux, _, teardown := setup() defer teardown() From ab8b241add175a45ea24db294e035f2580e55853 Mon Sep 17 00:00:00 2001 From: Neal Caffery Date: Thu, 19 Jan 2023 02:32:26 +0800 Subject: [PATCH 145/751] Add httpcache code example to README.md (#2632) --- README.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 030fd090d9a..744b11b4ac9 100644 --- a/README.md +++ b/README.md @@ -209,7 +209,22 @@ The GitHub API has good support for conditional requests which will help prevent you from burning through your rate limit, as well as help speed up your application. `go-github` does not handle conditional requests directly, but is instead designed to work with a caching `http.Transport`. We recommend using -https://github.com/gregjones/httpcache for that. +https://github.com/gregjones/httpcache for that. For example: + +```go +import "github.com/gregjones/httpcache" + + ts := oauth2.StaticTokenSource( + &oauth2.Token{AccessToken: os.Getenv("GITHUB_TOKEN")}, + ) + tc := &http.Client{ + Transport: &oauth2.Transport{ + Base: httpcache.NewMemoryCacheTransport(), + Source: ts, + }, + } + client := github.NewClient(tc) +``` Learn more about GitHub conditional requests at https://docs.github.com/en/rest/overview/resources-in-the-rest-api#conditional-requests. From 2561c07393f1a665976919fe051d7f2e0cc660b4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Jan 2023 14:15:29 -0500 Subject: [PATCH 146/751] Bump golangci/golangci-lint-action from 3.3.1 to 3.4.0 (#2638) --- .github/workflows/linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index c303f234680..cf4edcb6ad3 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -26,7 +26,7 @@ jobs: - uses: actions/checkout@v3 - name: golangci-lint ${{ matrix.working-directory }} - uses: golangci/golangci-lint-action@0ad9a0988b3973e851ab0a07adf248ec2e100376 #v3.3.1 + uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5 #v3.4.0 with: version: v1.50.1 working-directory: ${{ matrix.working-directory}} From 36c47d1622e2a6f1544bddf0a9f62d4eafd3afa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFs=20Postula?= Date: Wed, 25 Jan 2023 16:12:07 +0100 Subject: [PATCH 147/751] Change total_minutes_used and included_minutes from int to float64 (#2643) Fixes: #2642. --- github/billing.go | 12 ++++++------ github/billing_test.go | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/github/billing.go b/github/billing.go index 2f5861ce808..2900a01670a 100644 --- a/github/billing.go +++ b/github/billing.go @@ -18,9 +18,9 @@ type BillingService service // ActionBilling represents a GitHub Action billing. type ActionBilling struct { - TotalMinutesUsed int `json:"total_minutes_used"` + TotalMinutesUsed float64 `json:"total_minutes_used"` TotalPaidMinutesUsed float64 `json:"total_paid_minutes_used"` - IncludedMinutes int `json:"included_minutes"` + IncludedMinutes float64 `json:"included_minutes"` MinutesUsedBreakdown MinutesUsedBreakdown `json:"minutes_used_breakdown"` } @@ -29,16 +29,16 @@ type MinutesUsedBreakdown = map[string]int // PackageBilling represents a GitHub Package billing. type PackageBilling struct { - TotalGigabytesBandwidthUsed int `json:"total_gigabytes_bandwidth_used"` - TotalPaidGigabytesBandwidthUsed int `json:"total_paid_gigabytes_bandwidth_used"` - IncludedGigabytesBandwidth int `json:"included_gigabytes_bandwidth"` + TotalGigabytesBandwidthUsed int `json:"total_gigabytes_bandwidth_used"` + TotalPaidGigabytesBandwidthUsed int `json:"total_paid_gigabytes_bandwidth_used"` + IncludedGigabytesBandwidth float64 `json:"included_gigabytes_bandwidth"` } // StorageBilling represents a GitHub Storage billing. type StorageBilling struct { DaysLeftInBillingCycle int `json:"days_left_in_billing_cycle"` EstimatedPaidStorageForMonth float64 `json:"estimated_paid_storage_for_month"` - EstimatedStorageForMonth int `json:"estimated_storage_for_month"` + EstimatedStorageForMonth float64 `json:"estimated_storage_for_month"` } // ActiveCommitters represents the total active committers across all repositories in an Organization. diff --git a/github/billing_test.go b/github/billing_test.go index 6a85cd22df6..52b338b8347 100644 --- a/github/billing_test.go +++ b/github/billing_test.go @@ -21,9 +21,9 @@ func TestBillingService_GetActionsBillingOrg(t *testing.T) { mux.HandleFunc("/orgs/o/settings/billing/actions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `{ - "total_minutes_used": 305, + "total_minutes_used": 305.0, "total_paid_minutes_used": 0.0, - "included_minutes": 3000, + "included_minutes": 3000.0, "minutes_used_breakdown": { "UBUNTU": 205, "MACOS": 10, @@ -39,9 +39,9 @@ func TestBillingService_GetActionsBillingOrg(t *testing.T) { } want := &ActionBilling{ - TotalMinutesUsed: 305, - TotalPaidMinutesUsed: 0, - IncludedMinutes: 3000, + TotalMinutesUsed: 305.0, + TotalPaidMinutesUsed: 0.0, + IncludedMinutes: 3000.0, MinutesUsedBreakdown: MinutesUsedBreakdown{ "UBUNTU": 205, "MACOS": 10, From 63c1dee2ddd7b1bc29ebfd52fb40980bca989a6c Mon Sep 17 00:00:00 2001 From: Ilia Choly Date: Wed, 25 Jan 2023 10:17:13 -0500 Subject: [PATCH 148/751] Add NewTokenClient (#2637) Fixes: #2636. --- github/github.go | 6 ++++++ github/github_test.go | 14 ++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/github/github.go b/github/github.go index e97e31f2f5d..7d915dfa72e 100644 --- a/github/github.go +++ b/github/github.go @@ -24,6 +24,7 @@ import ( "time" "github.com/google/go-querystring/query" + "golang.org/x/oauth2" ) const ( @@ -346,6 +347,11 @@ func NewClient(httpClient *http.Client) *Client { return c } +// NewTokenClient returns a new GitHub API client authenticated with the provided token. +func NewTokenClient(ctx context.Context, token string) *Client { + return NewClient(oauth2.NewClient(ctx, oauth2.StaticTokenSource(&oauth2.Token{AccessToken: token}))) +} + // NewEnterpriseClient returns a new GitHub API client with provided // base URL and upload URL (often is your GitHub Enterprise hostname). // If the base URL does not have the suffix "/api/v3/", it will be added automatically. diff --git a/github/github_test.go b/github/github_test.go index 53809399fac..50ecd5435bc 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -22,6 +22,7 @@ import ( "time" "github.com/google/go-cmp/cmp" + "golang.org/x/oauth2" ) const ( @@ -266,6 +267,19 @@ func TestClient(t *testing.T) { } } +func TestNewTokenClient(t *testing.T) { + token := "gh_test_token" + ctx := context.Background() + c := NewTokenClient(ctx, token) + tr, ok := c.Client().Transport.(*oauth2.Transport) + if !ok { + t.Error("Client transport is not oauth2.Transport") + } + if tok, err := tr.Source.Token(); err != nil || tok.AccessToken != token { + t.Errorf("Client not using correct token") + } +} + func TestNewEnterpriseClient(t *testing.T) { baseURL := "https://custom-url/api/v3/" uploadURL := "https://custom-upload-url/api/uploads/" From ef40760630aeb3d534a51281e3169efc9a4cdbf1 Mon Sep 17 00:00:00 2001 From: ganeshkumarsv <53483484+ganeshkumarsv@users.noreply.github.com> Date: Thu, 26 Jan 2023 16:33:37 -0500 Subject: [PATCH 149/751] Add method to update codescanning alert (#2639) --- github/code-scanning.go | 41 +++++++++++ github/code-scanning_test.go | 117 ++++++++++++++++++++++++++++++++ github/github-accessors.go | 16 +++++ github/github-accessors_test.go | 20 ++++++ 4 files changed, 194 insertions(+) diff --git a/github/code-scanning.go b/github/code-scanning.go index 53200fa3eeb..6717348ed73 100644 --- a/github/code-scanning.go +++ b/github/code-scanning.go @@ -173,6 +173,22 @@ type SarifAnalysis struct { ToolName *string `json:"tool_name,omitempty"` } +// CodeScanningAlertState specifies the state of a code scanning alert. +// +// GitHub API docs: https://docs.github.com/en/rest/code-scanning +type CodeScanningAlertState struct { + // State sets the state of the code scanning alert and is a required field. + // You must also provide DismissedReason when you set the state to "dismissed". + // State can be one of: "open", "dismissed". + State string `json:"state"` + // DismissedReason represents the reason for dismissing or closing the alert. + // It is required when the state is "dismissed". + // It can be one of: "false positive", "won't fix", "used in tests". + DismissedReason *string `json:"dismissed_reason,omitempty"` + // DismissedComment is associated with the dismissal of the alert. + DismissedComment *string `json:"dismissed_comment,omitempty"` +} + // SarifID identifies a sarif analysis upload. // // GitHub API docs: https://docs.github.com/en/rest/code-scanning @@ -261,6 +277,31 @@ func (s *CodeScanningService) GetAlert(ctx context.Context, owner, repo string, return a, resp, nil } +// UpdateAlert updates the state of a single code scanning alert for a repository. +// +// You must use an access token with the security_events scope to use this endpoint. +// GitHub Apps must have the security_events read permission to use this endpoint. +// +// The security alert_id is the number at the end of the security alert's URL. +// +// GitHub API docs: https://docs.github.com/en/rest/code-scanning?apiVersion=2022-11-28#update-a-code-scanning-alert +func (s *CodeScanningService) UpdateAlert(ctx context.Context, owner, repo string, id int64, stateInfo *CodeScanningAlertState) (*Alert, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/code-scanning/alerts/%v", owner, repo, id) + + req, err := s.client.NewRequest("PATCH", u, stateInfo) + if err != nil { + return nil, nil, err + } + + a := new(Alert) + resp, err := s.client.Do(ctx, req, a) + if err != nil { + return nil, resp, err + } + + return a, resp, nil +} + // UploadSarif uploads the result of code scanning job to GitHub. // // For the parameter sarif, you must first compress your SARIF file using gzip and then translate the contents of the file into a Base64 encoding string. diff --git a/github/code-scanning_test.go b/github/code-scanning_test.go index c8cf35cfbaf..1ae05096d3f 100644 --- a/github/code-scanning_test.go +++ b/github/code-scanning_test.go @@ -613,6 +613,123 @@ func TestCodeScanningService_ListAlertsForRepo(t *testing.T) { }) } +func TestCodeScanningService_UpdateAlert(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + mux.HandleFunc("/repos/o/r/code-scanning/alerts/88", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PATCH") + fmt.Fprint(w, `{"rule_id":"js/useless-expression", + "rule_severity":"warning", + "rule_description":"Expression has no effect", + "tool": { + "name": "CodeQL", + "guid": null, + "version": "1.4.0" + }, + "rule": { + "id": "useless expression", + "severity": "warning", + "description": "Expression has no effect", + "name": "useless expression", + "full_description": "Expression has no effect", + "help": "Expression has no effect" + }, + "most_recent_instance": { + "ref": "refs/heads/main", + "state": "dismissed", + "commit_sha": "abcdefg12345", + "message": { + "text": "This path depends on a user-provided value." + }, + "location": { + "path": "spec-main/api-session-spec.ts", + "start_line": 917, + "end_line": 917, + "start_column": 7, + "end_column": 18 + }, + "classifications": [ + "test" + ] + }, + "created_at":"2019-01-02T15:04:05Z", + "state":"dismissed", + "dismissed_reason": "false positive", + "dismissed_comment": "This alert is not actually correct as sanitizer is used", + "closed_by":null, + "closed_at":null, + "url":"https://api.github.com/repos/o/r/code-scanning/alerts/88", + "html_url":"https://github.com/o/r/security/code-scanning/88"}`) + }) + + ctx := context.Background() + dismissedComment := String("This alert is not actually correct as sanitizer is used") + dismissedReason := String("false positive") + state := String("dismissed") + stateInfo := &CodeScanningAlertState{State: *state, DismissedReason: dismissedReason, DismissedComment: dismissedComment} + alert, _, err := client.CodeScanning.UpdateAlert(ctx, "o", "r", 88, stateInfo) + if err != nil { + t.Errorf("CodeScanning.UpdateAlert returned error: %v", err) + } + + date := Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)} + want := &Alert{ + RuleID: String("js/useless-expression"), + RuleSeverity: String("warning"), + RuleDescription: String("Expression has no effect"), + Tool: &Tool{Name: String("CodeQL"), GUID: nil, Version: String("1.4.0")}, + Rule: &Rule{ + ID: String("useless expression"), + Severity: String("warning"), + Description: String("Expression has no effect"), + Name: String("useless expression"), + FullDescription: String("Expression has no effect"), + Help: String("Expression has no effect"), + }, + CreatedAt: &date, + State: state, + DismissedReason: dismissedReason, + DismissedComment: dismissedComment, + ClosedBy: nil, + ClosedAt: nil, + URL: String("https://api.github.com/repos/o/r/code-scanning/alerts/88"), + HTMLURL: String("https://github.com/o/r/security/code-scanning/88"), + MostRecentInstance: &MostRecentInstance{ + Ref: String("refs/heads/main"), + State: String("dismissed"), + CommitSHA: String("abcdefg12345"), + Message: &Message{ + Text: String("This path depends on a user-provided value."), + }, + Location: &Location{ + Path: String("spec-main/api-session-spec.ts"), + StartLine: Int(917), + EndLine: Int(917), + StartColumn: Int(7), + EndColumn: Int(18), + }, + Classifications: []string{"test"}, + }, + } + if !cmp.Equal(alert, want) { + t.Errorf("CodeScanning.UpdateAlert returned %+v, want %+v", alert, want) + } + + const methodName = "UpdateAlert" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.CodeScanning.UpdateAlert(ctx, "\n", "\n", -88, stateInfo) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.CodeScanning.UpdateAlert(ctx, "o", "r", 88, stateInfo) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + func TestCodeScanningService_GetAlert(t *testing.T) { client, mux, _, teardown := setup() defer teardown() diff --git a/github/github-accessors.go b/github/github-accessors.go index 400bde8c3c3..1290696d52b 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -2582,6 +2582,22 @@ func (c *CodeScanningAlertEvent) GetSender() *User { return c.Sender } +// GetDismissedComment returns the DismissedComment field if it's non-nil, zero value otherwise. +func (c *CodeScanningAlertState) GetDismissedComment() string { + if c == nil || c.DismissedComment == nil { + return "" + } + return *c.DismissedComment +} + +// GetDismissedReason returns the DismissedReason field if it's non-nil, zero value otherwise. +func (c *CodeScanningAlertState) GetDismissedReason() string { + if c == nil || c.DismissedReason == nil { + return "" + } + return *c.DismissedReason +} + // GetIncompleteResults returns the IncompleteResults field if it's non-nil, zero value otherwise. func (c *CodeSearchResult) GetIncompleteResults() bool { if c == nil || c.IncompleteResults == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 3e4b469463e..6babd83ef19 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -3048,6 +3048,26 @@ func TestCodeScanningAlertEvent_GetSender(tt *testing.T) { c.GetSender() } +func TestCodeScanningAlertState_GetDismissedComment(tt *testing.T) { + var zeroValue string + c := &CodeScanningAlertState{DismissedComment: &zeroValue} + c.GetDismissedComment() + c = &CodeScanningAlertState{} + c.GetDismissedComment() + c = nil + c.GetDismissedComment() +} + +func TestCodeScanningAlertState_GetDismissedReason(tt *testing.T) { + var zeroValue string + c := &CodeScanningAlertState{DismissedReason: &zeroValue} + c.GetDismissedReason() + c = &CodeScanningAlertState{} + c.GetDismissedReason() + c = nil + c.GetDismissedReason() +} + func TestCodeSearchResult_GetIncompleteResults(tt *testing.T) { var zeroValue bool c := &CodeSearchResult{IncompleteResults: &zeroValue} From d386e490be9454f13e95f31da4f9cdcb7f157ec1 Mon Sep 17 00:00:00 2001 From: Miguel Elias dos Santos Date: Fri, 27 Jan 2023 08:38:36 +1100 Subject: [PATCH 150/751] Add JSON tag for ErrorResponse (#2641) Fixes: #2640. --- github/github.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/github.go b/github/github.go index 7d915dfa72e..aebfaf7bed5 100644 --- a/github/github.go +++ b/github/github.go @@ -847,7 +847,7 @@ An ErrorResponse reports one or more errors caused by an API request. GitHub API docs: https://docs.github.com/en/rest/#client-errors */ type ErrorResponse struct { - Response *http.Response // HTTP response that caused this error + Response *http.Response `json:"-"` // HTTP response that caused this error Message string `json:"message"` // error message Errors []Error `json:"errors"` // more detail on individual errors // Block is only populated on certain types of errors such as code 451. From cdecead48570af6be5b3d27ebaca02ae8ec87bff Mon Sep 17 00:00:00 2001 From: Victory Osikwemhe Date: Thu, 26 Jan 2023 22:39:42 +0100 Subject: [PATCH 151/751] Change all fields from time.Time to github.Timestamp (#2646) --- .golangci.yml | 4 +- example/commitpr/main.go | 2 +- github/activity_notifications.go | 10 +- github/activity_notifications_test.go | 16 +-- github/apps.go | 3 +- github/apps_test.go | 2 +- github/event.go | 3 +- github/event_test.go | 2 +- github/event_types_test.go | 16 +-- github/gists.go | 4 +- github/gists_comments.go | 3 +- github/gists_comments_test.go | 2 +- github/gists_test.go | 4 +- github/git_commits.go | 3 +- github/git_commits_test.go | 24 ++-- github/git_tags_test.go | 4 +- github/github-accessors.go | 180 +++++++++++++------------- github/github-accessors_test.go | 90 ++++++------- github/github-stringify_test.go | 100 +++++++++----- github/issue_import.go | 15 +-- github/issue_import_test.go | 34 ++--- github/issues.go | 6 +- github/issues_comments.go | 4 +- github/issues_comments_test.go | 4 +- github/issues_events.go | 3 +- github/issues_events_test.go | 2 +- github/issues_milestones.go | 9 +- github/issues_milestones_test.go | 8 +- github/issues_test.go | 6 +- github/issues_timeline.go | 5 +- github/issues_timeline_test.go | 2 +- github/orgs.go | 5 +- github/orgs_hooks_test.go | 2 +- github/orgs_members_test.go | 4 +- github/pulls.go | 9 +- github/pulls_comments.go | 4 +- github/pulls_comments_test.go | 4 +- github/pulls_reviews.go | 3 +- github/pulls_reviews_test.go | 2 +- github/pulls_test.go | 8 +- github/pulls_threads_test.go | 4 +- github/repos_comments.go | 5 +- github/repos_comments_test.go | 4 +- github/repos_commits_test.go | 4 +- github/repos_community_health.go | 3 +- github/repos_community_health_test.go | 4 +- github/repos_contents_test.go | 8 +- github/repos_hooks.go | 5 +- github/repos_hooks_test.go | 6 +- github/repos_statuses.go | 5 +- github/repos_statuses_test.go | 8 +- github/search_test.go | 6 +- github/teams.go | 3 +- github/teams_test.go | 2 +- github/users_gpg_keys.go | 5 +- github/users_gpg_keys_test.go | 3 +- 56 files changed, 351 insertions(+), 335 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index db9a4d7117f..4d3fc17813b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -21,7 +21,9 @@ linters: - staticcheck - ineffassign - unused -issues: +issues: + exclude: + - composites exclude-rules: - linters: - dogsled diff --git a/example/commitpr/main.go b/example/commitpr/main.go index ca6ffc85a16..5913ec0668d 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -133,7 +133,7 @@ func pushCommit(ref *github.Reference, tree *github.Tree) (err error) { // Create the commit using the tree. date := time.Now() - author := &github.CommitAuthor{Date: &date, Name: authorName, Email: authorEmail} + author := &github.CommitAuthor{Date: &github.Timestamp{date}, Name: authorName, Email: authorEmail} commit := &github.Commit{Author: author, Message: commitMessage, Tree: tree, Parents: []*github.Commit{parent.Commit}} newCommit, _, err := client.Git.CreateCommit(ctx, *sourceOwner, *sourceRepo, commit) if err != nil { diff --git a/github/activity_notifications.go b/github/activity_notifications.go index 38a3184536a..03476c2e2c3 100644 --- a/github/activity_notifications.go +++ b/github/activity_notifications.go @@ -23,8 +23,8 @@ type Notification struct { Reason *string `json:"reason,omitempty"` Unread *bool `json:"unread,omitempty"` - UpdatedAt *time.Time `json:"updated_at,omitempty"` - LastReadAt *time.Time `json:"last_read_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + LastReadAt *Timestamp `json:"last_read_at,omitempty"` URL *string `json:"url,omitempty"` } @@ -97,13 +97,13 @@ func (s *ActivityService) ListRepositoryNotifications(ctx context.Context, owner } type markReadOptions struct { - LastReadAt time.Time `json:"last_read_at,omitempty"` + LastReadAt Timestamp `json:"last_read_at,omitempty"` } // MarkNotificationsRead marks all notifications up to lastRead as read. // // GitHub API docs: https://docs.github.com/en/rest/activity#mark-as-read -func (s *ActivityService) MarkNotificationsRead(ctx context.Context, lastRead time.Time) (*Response, error) { +func (s *ActivityService) MarkNotificationsRead(ctx context.Context, lastRead Timestamp) (*Response, error) { opts := &markReadOptions{ LastReadAt: lastRead, } @@ -119,7 +119,7 @@ func (s *ActivityService) MarkNotificationsRead(ctx context.Context, lastRead ti // the specified repository as read. // // GitHub API docs: https://docs.github.com/en/rest/activity/notifications#mark-repository-notifications-as-read -func (s *ActivityService) MarkRepositoryNotificationsRead(ctx context.Context, owner, repo string, lastRead time.Time) (*Response, error) { +func (s *ActivityService) MarkRepositoryNotificationsRead(ctx context.Context, owner, repo string, lastRead Timestamp) (*Response, error) { opts := &markReadOptions{ LastReadAt: lastRead, } diff --git a/github/activity_notifications_test.go b/github/activity_notifications_test.go index fcd1cc3adcc..830c8b10cf8 100644 --- a/github/activity_notifications_test.go +++ b/github/activity_notifications_test.go @@ -107,14 +107,14 @@ func TestActivityService_MarkNotificationsRead(t *testing.T) { }) ctx := context.Background() - _, err := client.Activity.MarkNotificationsRead(ctx, time.Date(2006, time.January, 02, 15, 04, 05, 0, time.UTC)) + _, err := client.Activity.MarkNotificationsRead(ctx, Timestamp{time.Date(2006, time.January, 02, 15, 04, 05, 0, time.UTC)}) if err != nil { t.Errorf("Activity.MarkNotificationsRead returned error: %v", err) } const methodName = "MarkNotificationsRead" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Activity.MarkNotificationsRead(ctx, time.Date(2006, time.January, 02, 15, 04, 05, 0, time.UTC)) + return client.Activity.MarkNotificationsRead(ctx, Timestamp{time.Date(2006, time.January, 02, 15, 04, 05, 0, time.UTC)}) }) } @@ -131,19 +131,19 @@ func TestActivityService_MarkRepositoryNotificationsRead(t *testing.T) { }) ctx := context.Background() - _, err := client.Activity.MarkRepositoryNotificationsRead(ctx, "o", "r", time.Date(2006, time.January, 02, 15, 04, 05, 0, time.UTC)) + _, err := client.Activity.MarkRepositoryNotificationsRead(ctx, "o", "r", Timestamp{time.Date(2006, time.January, 02, 15, 04, 05, 0, time.UTC)}) if err != nil { t.Errorf("Activity.MarkRepositoryNotificationsRead returned error: %v", err) } const methodName = "MarkRepositoryNotificationsRead" testBadOptions(t, methodName, func() (err error) { - _, err = client.Activity.MarkRepositoryNotificationsRead(ctx, "\n", "\n", time.Date(2006, time.January, 02, 15, 04, 05, 0, time.UTC)) + _, err = client.Activity.MarkRepositoryNotificationsRead(ctx, "\n", "\n", Timestamp{time.Date(2006, time.January, 02, 15, 04, 05, 0, time.UTC)}) return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Activity.MarkRepositoryNotificationsRead(ctx, "o", "r", time.Date(2006, time.January, 02, 15, 04, 05, 0, time.UTC)) + return client.Activity.MarkRepositoryNotificationsRead(ctx, "o", "r", Timestamp{time.Date(2006, time.January, 02, 15, 04, 05, 0, time.UTC)}) }) } @@ -331,8 +331,8 @@ func TestNotification_Marshal(t *testing.T) { }, Reason: String("r"), Unread: Bool(true), - UpdatedAt: &referenceTime, - LastReadAt: &referenceTime, + UpdatedAt: &Timestamp{referenceTime}, + LastReadAt: &Timestamp{referenceTime}, URL: String("u"), } @@ -383,7 +383,7 @@ func TestMarkReadOptions_Marshal(t *testing.T) { testJSONMarshal(t, &markReadOptions{}, "{}") u := &markReadOptions{ - LastReadAt: referenceTime, + LastReadAt: Timestamp{referenceTime}, } want := `{ diff --git a/github/apps.go b/github/apps.go index 98d8a6fda3e..e1d9aadaf5d 100644 --- a/github/apps.go +++ b/github/apps.go @@ -8,7 +8,6 @@ package github import ( "context" "fmt" - "time" ) // AppsService provides access to the installation related functions @@ -36,7 +35,7 @@ type App struct { // InstallationToken represents an installation token. type InstallationToken struct { Token *string `json:"token,omitempty"` - ExpiresAt *time.Time `json:"expires_at,omitempty"` + ExpiresAt *Timestamp `json:"expires_at,omitempty"` Permissions *InstallationPermissions `json:"permissions,omitempty"` Repositories []*Repository `json:"repositories,omitempty"` } diff --git a/github/apps_test.go b/github/apps_test.go index 494f1031bb5..d3e7c434233 100644 --- a/github/apps_test.go +++ b/github/apps_test.go @@ -997,7 +997,7 @@ func TestInstallationToken_Marshal(t *testing.T) { u := &InstallationToken{ Token: String("t"), - ExpiresAt: &referenceTime, + ExpiresAt: &Timestamp{referenceTime}, Permissions: &InstallationPermissions{ Actions: String("a"), Administration: String("ad"), diff --git a/github/event.go b/github/event.go index 5b2312fb354..44c5f46f9b0 100644 --- a/github/event.go +++ b/github/event.go @@ -7,7 +7,6 @@ package github import ( "encoding/json" - "time" ) // Event represents a GitHub event. @@ -18,7 +17,7 @@ type Event struct { Repo *Repository `json:"repo,omitempty"` Actor *User `json:"actor,omitempty"` Org *Organization `json:"org,omitempty"` - CreatedAt *time.Time `json:"created_at,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` ID *string `json:"id,omitempty"` } diff --git a/github/event_test.go b/github/event_test.go index 713f3b1ed7f..6d20582c2f7 100644 --- a/github/event_test.go +++ b/github/event_test.go @@ -78,7 +78,7 @@ func TestEvent_Marshal(t *testing.T) { MembersCanCreatePublicPages: Bool(false), MembersCanCreatePrivatePages: Bool(true), }, - CreatedAt: &referenceTime, + CreatedAt: &Timestamp{referenceTime}, ID: String("id"), } diff --git a/github/event_types_test.go b/github/event_types_test.go index 8cd08688368..fdc0809e694 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -4855,8 +4855,8 @@ func TestCommitCommentEvent_Marshal(t *testing.T) { Eyes: Int(1), URL: String("url"), }, - CreatedAt: &referenceTime, - UpdatedAt: &referenceTime, + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, Body: String("b"), Path: String("path"), Position: Int(1), @@ -6224,8 +6224,8 @@ func TestPingEvent_Marshal(t *testing.T) { Zen: String("z"), HookID: Int64(1), Hook: &Hook{ - CreatedAt: &referenceTime, - UpdatedAt: &referenceTime, + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, URL: String("url"), ID: Int64(1), Type: String("t"), @@ -10698,8 +10698,8 @@ func TestMetaEvent_Marshal(t *testing.T) { Action: String("a"), HookID: Int64(1), Hook: &Hook{ - CreatedAt: &referenceTime, - UpdatedAt: &referenceTime, + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, URL: String("u"), ID: Int64(1), Type: String("t"), @@ -11745,7 +11745,7 @@ func TestHeadCommit_Marshal(t *testing.T) { u := &HeadCommit{ Message: String("m"), Author: &CommitAuthor{ - Date: &referenceTime, + Date: &Timestamp{referenceTime}, Name: String("n"), Email: String("e"), Login: String("u"), @@ -11757,7 +11757,7 @@ func TestHeadCommit_Marshal(t *testing.T) { TreeID: String("tid"), Timestamp: &Timestamp{referenceTime}, Committer: &CommitAuthor{ - Date: &referenceTime, + Date: &Timestamp{referenceTime}, Name: String("n"), Email: String("e"), Login: String("u"), diff --git a/github/gists.go b/github/gists.go index ecdc6f27260..80961fcb908 100644 --- a/github/gists.go +++ b/github/gists.go @@ -28,8 +28,8 @@ type Gist struct { HTMLURL *string `json:"html_url,omitempty"` GitPullURL *string `json:"git_pull_url,omitempty"` GitPushURL *string `json:"git_push_url,omitempty"` - CreatedAt *time.Time `json:"created_at,omitempty"` - UpdatedAt *time.Time `json:"updated_at,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` NodeID *string `json:"node_id,omitempty"` } diff --git a/github/gists_comments.go b/github/gists_comments.go index d551e9a11d4..ee0fbfa45f8 100644 --- a/github/gists_comments.go +++ b/github/gists_comments.go @@ -8,7 +8,6 @@ package github import ( "context" "fmt" - "time" ) // GistComment represents a Gist comment. @@ -17,7 +16,7 @@ type GistComment struct { URL *string `json:"url,omitempty"` Body *string `json:"body,omitempty"` User *User `json:"user,omitempty"` - CreatedAt *time.Time `json:"created_at,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` } func (g GistComment) String() string { diff --git a/github/gists_comments_test.go b/github/gists_comments_test.go index 0b3cb73a859..c9c97068979 100644 --- a/github/gists_comments_test.go +++ b/github/gists_comments_test.go @@ -42,7 +42,7 @@ func TestGistComments_Marshal(t *testing.T) { CreatedAt: &Timestamp{referenceTime}, URL: String("u"), }, - CreatedAt: &createdAt, + CreatedAt: &Timestamp{createdAt}, } want := `{ diff --git a/github/gists_test.go b/github/gists_test.go index 06a1c43f722..3066d585a25 100644 --- a/github/gists_test.go +++ b/github/gists_test.go @@ -57,8 +57,8 @@ func TestGist_Marshal(t *testing.T) { HTMLURL: String("html-url"), GitPullURL: String("gitpull-url"), GitPushURL: String("gitpush-url"), - CreatedAt: &createdAt, - UpdatedAt: &updatedAt, + CreatedAt: &Timestamp{createdAt}, + UpdatedAt: &Timestamp{updatedAt}, NodeID: String("node"), } diff --git a/github/git_commits.go b/github/git_commits.go index baedb3d6868..81994c6e50a 100644 --- a/github/git_commits.go +++ b/github/git_commits.go @@ -11,7 +11,6 @@ import ( "errors" "fmt" "strings" - "time" "golang.org/x/crypto/openpgp" ) @@ -56,7 +55,7 @@ func (c Commit) String() string { // CommitAuthor represents the author or committer of a commit. The commit // author may not correspond to a GitHub User. type CommitAuthor struct { - Date *time.Time `json:"date,omitempty"` + Date *Timestamp `json:"date,omitempty"` Name *string `json:"name,omitempty"` Email *string `json:"email,omitempty"` diff --git a/github/git_commits_test.go b/github/git_commits_test.go index cc9cc3fcbda..1fbfa0d2e1d 100644 --- a/github/git_commits_test.go +++ b/github/git_commits_test.go @@ -24,13 +24,13 @@ func TestCommit_Marshal(t *testing.T) { u := &Commit{ SHA: String("s"), Author: &CommitAuthor{ - Date: &referenceTime, + Date: &Timestamp{referenceTime}, Name: String("n"), Email: String("e"), Login: String("u"), }, Committer: &CommitAuthor{ - Date: &referenceTime, + Date: &Timestamp{referenceTime}, Name: String("n"), Email: String("e"), Login: String("u"), @@ -313,7 +313,7 @@ func TestGitService_CreateSignedCommitWithKey(t *testing.T) { author := CommitAuthor{ Name: String("go-github"), Email: String("go-github@github.com"), - Date: &date, + Date: &Timestamp{date}, } input := &Commit{ Message: String("Commit Message."), @@ -417,7 +417,7 @@ func TestGitService_createSignature_invalidKey(t *testing.T) { Author: &CommitAuthor{ Name: String("go-github"), Email: String("go-github@github.com"), - Date: &date, + Date: &Timestamp{date}, }, }) @@ -442,7 +442,7 @@ func TestGitService_createSignatureMessage_nilMessage(t *testing.T) { Author: &CommitAuthor{ Name: String("go-github"), Email: String("go-github@github.com"), - Date: &date, + Date: &Timestamp{date}, }, }) if err == nil { @@ -459,7 +459,7 @@ func TestGitService_createSignatureMessage_emptyMessage(t *testing.T) { Author: &CommitAuthor{ Name: String("go-github"), Email: String("go-github@github.com"), - Date: &date, + Date: &Timestamp{date}, }, }) if err == nil { @@ -487,7 +487,7 @@ func TestGitService_createSignatureMessage_withoutTree(t *testing.T) { Author: &CommitAuthor{ Name: String("go-github"), Email: String("go-github@github.com"), - Date: &date, + Date: &Timestamp{date}, }, }) expected := `parent p @@ -509,12 +509,12 @@ func TestGitService_createSignatureMessage_withoutCommitter(t *testing.T) { Author: &CommitAuthor{ Name: String("go-github"), Email: String("go-github@github.com"), - Date: &date, + Date: &Timestamp{date}, }, Committer: &CommitAuthor{ Name: String("foo"), Email: String("foo@bar.com"), - Date: &date, + Date: &Timestamp{date}, }, }) expected := `parent p @@ -619,7 +619,7 @@ func TestCommitAuthor_Marshal(t *testing.T) { testJSONMarshal(t, &CommitAuthor{}, "{}") u := &CommitAuthor{ - Date: &referenceTime, + Date: &Timestamp{referenceTime}, Name: String("name"), Email: String("email"), Login: String("login"), @@ -640,13 +640,13 @@ func TestCreateCommit_Marshal(t *testing.T) { u := &createCommit{ Author: &CommitAuthor{ - Date: &referenceTime, + Date: &Timestamp{referenceTime}, Name: String("name"), Email: String("email"), Login: String("login"), }, Committer: &CommitAuthor{ - Date: &referenceTime, + Date: &Timestamp{referenceTime}, Name: String("name"), Email: String("email"), Login: String("login"), diff --git a/github/git_tags_test.go b/github/git_tags_test.go index 2d13722abaa..0d45ee26893 100644 --- a/github/git_tags_test.go +++ b/github/git_tags_test.go @@ -107,7 +107,7 @@ func TestTag_Marshal(t *testing.T) { URL: String("url"), Message: String("msg"), Tagger: &CommitAuthor{ - Date: &referenceTime, + Date: &Timestamp{referenceTime}, Name: String("name"), Email: String("email"), Login: String("login"), @@ -163,7 +163,7 @@ func TestCreateTagRequest_Marshal(t *testing.T) { Object: String("obj"), Type: String("type"), Tagger: &CommitAuthor{ - Date: &referenceTime, + Date: &Timestamp{referenceTime}, Name: String("name"), Email: String("email"), Login: String("login"), diff --git a/github/github-accessors.go b/github/github-accessors.go index 1290696d52b..e2d0d7f8357 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -2727,9 +2727,9 @@ func (c *CombinedStatus) GetTotalCount() int { } // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (c *Comment) GetCreatedAt() time.Time { +func (c *Comment) GetCreatedAt() Timestamp { if c == nil || c.CreatedAt == nil { - return time.Time{} + return Timestamp{} } return *c.CreatedAt } @@ -2855,9 +2855,9 @@ func (c *Commit) GetVerification() *SignatureVerification { } // GetDate returns the Date field if it's non-nil, zero value otherwise. -func (c *CommitAuthor) GetDate() time.Time { +func (c *CommitAuthor) GetDate() Timestamp { if c == nil || c.Date == nil { - return time.Time{} + return Timestamp{} } return *c.Date } @@ -3311,9 +3311,9 @@ func (c *CommunityHealthMetrics) GetHealthPercentage() int { } // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (c *CommunityHealthMetrics) GetUpdatedAt() time.Time { +func (c *CommunityHealthMetrics) GetUpdatedAt() Timestamp { if c == nil || c.UpdatedAt == nil { - return time.Time{} + return Timestamp{} } return *c.UpdatedAt } @@ -5447,9 +5447,9 @@ func (e *Event) GetActor() *User { } // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (e *Event) GetCreatedAt() time.Time { +func (e *Event) GetCreatedAt() Timestamp { if e == nil || e.CreatedAt == nil { - return time.Time{} + return Timestamp{} } return *e.CreatedAt } @@ -5783,9 +5783,9 @@ func (g *Gist) GetComments() int { } // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (g *Gist) GetCreatedAt() time.Time { +func (g *Gist) GetCreatedAt() Timestamp { if g == nil || g.CreatedAt == nil { - return time.Time{} + return Timestamp{} } return *g.CreatedAt } @@ -5863,9 +5863,9 @@ func (g *Gist) GetPublic() bool { } // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (g *Gist) GetUpdatedAt() time.Time { +func (g *Gist) GetUpdatedAt() Timestamp { if g == nil || g.UpdatedAt == nil { - return time.Time{} + return Timestamp{} } return *g.UpdatedAt } @@ -5879,9 +5879,9 @@ func (g *GistComment) GetBody() string { } // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (g *GistComment) GetCreatedAt() time.Time { +func (g *GistComment) GetCreatedAt() Timestamp { if g == nil || g.CreatedAt == nil { - return time.Time{} + return Timestamp{} } return *g.CreatedAt } @@ -6215,17 +6215,17 @@ func (g *GPGKey) GetCanSign() bool { } // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (g *GPGKey) GetCreatedAt() time.Time { +func (g *GPGKey) GetCreatedAt() Timestamp { if g == nil || g.CreatedAt == nil { - return time.Time{} + return Timestamp{} } return *g.CreatedAt } // GetExpiresAt returns the ExpiresAt field if it's non-nil, zero value otherwise. -func (g *GPGKey) GetExpiresAt() time.Time { +func (g *GPGKey) GetExpiresAt() Timestamp { if g == nil || g.ExpiresAt == nil { - return time.Time{} + return Timestamp{} } return *g.ExpiresAt } @@ -6391,9 +6391,9 @@ func (h *Hook) GetActive() bool { } // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (h *Hook) GetCreatedAt() time.Time { +func (h *Hook) GetCreatedAt() Timestamp { if h == nil || h.CreatedAt == nil { - return time.Time{} + return Timestamp{} } return *h.CreatedAt } @@ -6439,9 +6439,9 @@ func (h *Hook) GetType() string { } // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (h *Hook) GetUpdatedAt() time.Time { +func (h *Hook) GetUpdatedAt() Timestamp { if h == nil || h.UpdatedAt == nil { - return time.Time{} + return Timestamp{} } return *h.UpdatedAt } @@ -7343,9 +7343,9 @@ func (i *InstallationRepositoriesEvent) GetSender() *User { } // GetExpiresAt returns the ExpiresAt field if it's non-nil, zero value otherwise. -func (i *InstallationToken) GetExpiresAt() time.Time { +func (i *InstallationToken) GetExpiresAt() Timestamp { if i == nil || i.ExpiresAt == nil { - return time.Time{} + return Timestamp{} } return *i.ExpiresAt } @@ -7399,9 +7399,9 @@ func (i *InteractionRestriction) GetOrigin() string { } // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (i *Invitation) GetCreatedAt() time.Time { +func (i *Invitation) GetCreatedAt() Timestamp { if i == nil || i.CreatedAt == nil { - return time.Time{} + return Timestamp{} } return *i.CreatedAt } @@ -7519,9 +7519,9 @@ func (i *Issue) GetBody() string { } // GetClosedAt returns the ClosedAt field if it's non-nil, zero value otherwise. -func (i *Issue) GetClosedAt() time.Time { +func (i *Issue) GetClosedAt() Timestamp { if i == nil || i.ClosedAt == nil { - return time.Time{} + return Timestamp{} } return *i.ClosedAt } @@ -7551,9 +7551,9 @@ func (i *Issue) GetCommentsURL() string { } // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (i *Issue) GetCreatedAt() time.Time { +func (i *Issue) GetCreatedAt() Timestamp { if i == nil || i.CreatedAt == nil { - return time.Time{} + return Timestamp{} } return *i.CreatedAt } @@ -7679,9 +7679,9 @@ func (i *Issue) GetTitle() string { } // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (i *Issue) GetUpdatedAt() time.Time { +func (i *Issue) GetUpdatedAt() Timestamp { if i == nil || i.UpdatedAt == nil { - return time.Time{} + return Timestamp{} } return *i.UpdatedAt } @@ -7719,9 +7719,9 @@ func (i *IssueComment) GetBody() string { } // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (i *IssueComment) GetCreatedAt() time.Time { +func (i *IssueComment) GetCreatedAt() Timestamp { if i == nil || i.CreatedAt == nil { - return time.Time{} + return Timestamp{} } return *i.CreatedAt } @@ -7767,9 +7767,9 @@ func (i *IssueComment) GetReactions() *Reactions { } // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (i *IssueComment) GetUpdatedAt() time.Time { +func (i *IssueComment) GetUpdatedAt() Timestamp { if i == nil || i.UpdatedAt == nil { - return time.Time{} + return Timestamp{} } return *i.UpdatedAt } @@ -7887,9 +7887,9 @@ func (i *IssueEvent) GetCommitID() string { } // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (i *IssueEvent) GetCreatedAt() time.Time { +func (i *IssueEvent) GetCreatedAt() Timestamp { if i == nil || i.CreatedAt == nil { - return time.Time{} + return Timestamp{} } return *i.CreatedAt } @@ -8007,17 +8007,17 @@ func (i *IssueImport) GetClosed() bool { } // GetClosedAt returns the ClosedAt field if it's non-nil, zero value otherwise. -func (i *IssueImport) GetClosedAt() time.Time { +func (i *IssueImport) GetClosedAt() Timestamp { if i == nil || i.ClosedAt == nil { - return time.Time{} + return Timestamp{} } return *i.ClosedAt } // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (i *IssueImport) GetCreatedAt() time.Time { +func (i *IssueImport) GetCreatedAt() Timestamp { if i == nil || i.CreatedAt == nil { - return time.Time{} + return Timestamp{} } return *i.CreatedAt } @@ -8031,9 +8031,9 @@ func (i *IssueImport) GetMilestone() int { } // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (i *IssueImport) GetUpdatedAt() time.Time { +func (i *IssueImport) GetUpdatedAt() Timestamp { if i == nil || i.UpdatedAt == nil { - return time.Time{} + return Timestamp{} } return *i.UpdatedAt } @@ -8079,9 +8079,9 @@ func (i *IssueImportError) GetValue() string { } // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (i *IssueImportResponse) GetCreatedAt() time.Time { +func (i *IssueImportResponse) GetCreatedAt() Timestamp { if i == nil || i.CreatedAt == nil { - return time.Time{} + return Timestamp{} } return *i.CreatedAt } @@ -8135,9 +8135,9 @@ func (i *IssueImportResponse) GetStatus() string { } // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (i *IssueImportResponse) GetUpdatedAt() time.Time { +func (i *IssueImportResponse) GetUpdatedAt() Timestamp { if i == nil || i.UpdatedAt == nil { - return time.Time{} + return Timestamp{} } return *i.UpdatedAt } @@ -9655,9 +9655,9 @@ func (m *Migration) GetURL() string { } // GetClosedAt returns the ClosedAt field if it's non-nil, zero value otherwise. -func (m *Milestone) GetClosedAt() time.Time { +func (m *Milestone) GetClosedAt() Timestamp { if m == nil || m.ClosedAt == nil { - return time.Time{} + return Timestamp{} } return *m.ClosedAt } @@ -9671,9 +9671,9 @@ func (m *Milestone) GetClosedIssues() int { } // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (m *Milestone) GetCreatedAt() time.Time { +func (m *Milestone) GetCreatedAt() Timestamp { if m == nil || m.CreatedAt == nil { - return time.Time{} + return Timestamp{} } return *m.CreatedAt } @@ -9695,9 +9695,9 @@ func (m *Milestone) GetDescription() string { } // GetDueOn returns the DueOn field if it's non-nil, zero value otherwise. -func (m *Milestone) GetDueOn() time.Time { +func (m *Milestone) GetDueOn() Timestamp { if m == nil || m.DueOn == nil { - return time.Time{} + return Timestamp{} } return *m.DueOn } @@ -9767,9 +9767,9 @@ func (m *Milestone) GetTitle() string { } // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (m *Milestone) GetUpdatedAt() time.Time { +func (m *Milestone) GetUpdatedAt() Timestamp { if m == nil || m.UpdatedAt == nil { - return time.Time{} + return Timestamp{} } return *m.UpdatedAt } @@ -10023,9 +10023,9 @@ func (n *Notification) GetID() string { } // GetLastReadAt returns the LastReadAt field if it's non-nil, zero value otherwise. -func (n *Notification) GetLastReadAt() time.Time { +func (n *Notification) GetLastReadAt() Timestamp { if n == nil || n.LastReadAt == nil { - return time.Time{} + return Timestamp{} } return *n.LastReadAt } @@ -10063,9 +10063,9 @@ func (n *Notification) GetUnread() bool { } // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (n *Notification) GetUpdatedAt() time.Time { +func (n *Notification) GetUpdatedAt() Timestamp { if n == nil || n.UpdatedAt == nil { - return time.Time{} + return Timestamp{} } return *n.UpdatedAt } @@ -10191,9 +10191,9 @@ func (o *Organization) GetCompany() string { } // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (o *Organization) GetCreatedAt() time.Time { +func (o *Organization) GetCreatedAt() Timestamp { if o == nil || o.CreatedAt == nil { - return time.Time{} + return Timestamp{} } return *o.CreatedAt } @@ -10559,9 +10559,9 @@ func (o *Organization) GetType() string { } // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (o *Organization) GetUpdatedAt() time.Time { +func (o *Organization) GetUpdatedAt() Timestamp { if o == nil || o.UpdatedAt == nil { - return time.Time{} + return Timestamp{} } return *o.UpdatedAt } @@ -12847,9 +12847,9 @@ func (p *PullRequest) GetChangedFiles() int { } // GetClosedAt returns the ClosedAt field if it's non-nil, zero value otherwise. -func (p *PullRequest) GetClosedAt() time.Time { +func (p *PullRequest) GetClosedAt() Timestamp { if p == nil || p.ClosedAt == nil { - return time.Time{} + return Timestamp{} } return *p.ClosedAt } @@ -12887,9 +12887,9 @@ func (p *PullRequest) GetCommitsURL() string { } // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (p *PullRequest) GetCreatedAt() time.Time { +func (p *PullRequest) GetCreatedAt() Timestamp { if p == nil || p.CreatedAt == nil { - return time.Time{} + return Timestamp{} } return *p.CreatedAt } @@ -13007,9 +13007,9 @@ func (p *PullRequest) GetMerged() bool { } // GetMergedAt returns the MergedAt field if it's non-nil, zero value otherwise. -func (p *PullRequest) GetMergedAt() time.Time { +func (p *PullRequest) GetMergedAt() Timestamp { if p == nil || p.MergedAt == nil { - return time.Time{} + return Timestamp{} } return *p.MergedAt } @@ -13111,9 +13111,9 @@ func (p *PullRequest) GetTitle() string { } // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (p *PullRequest) GetUpdatedAt() time.Time { +func (p *PullRequest) GetUpdatedAt() Timestamp { if p == nil || p.UpdatedAt == nil { - return time.Time{} + return Timestamp{} } return *p.UpdatedAt } @@ -13255,9 +13255,9 @@ func (p *PullRequestComment) GetCommitID() string { } // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (p *PullRequestComment) GetCreatedAt() time.Time { +func (p *PullRequestComment) GetCreatedAt() Timestamp { if p == nil || p.CreatedAt == nil { - return time.Time{} + return Timestamp{} } return *p.CreatedAt } @@ -13407,9 +13407,9 @@ func (p *PullRequestComment) GetStartSide() string { } // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (p *PullRequestComment) GetUpdatedAt() time.Time { +func (p *PullRequestComment) GetUpdatedAt() Timestamp { if p == nil || p.UpdatedAt == nil { - return time.Time{} + return Timestamp{} } return *p.UpdatedAt } @@ -13663,9 +13663,9 @@ func (p *PullRequestReview) GetState() string { } // GetSubmittedAt returns the SubmittedAt field if it's non-nil, zero value otherwise. -func (p *PullRequestReview) GetSubmittedAt() time.Time { +func (p *PullRequestReview) GetSubmittedAt() Timestamp { if p == nil || p.SubmittedAt == nil { - return time.Time{} + return Timestamp{} } return *p.SubmittedAt } @@ -15935,9 +15935,9 @@ func (r *RepositoryComment) GetCommitID() string { } // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (r *RepositoryComment) GetCreatedAt() time.Time { +func (r *RepositoryComment) GetCreatedAt() Timestamp { if r == nil || r.CreatedAt == nil { - return time.Time{} + return Timestamp{} } return *r.CreatedAt } @@ -15991,9 +15991,9 @@ func (r *RepositoryComment) GetReactions() *Reactions { } // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (r *RepositoryComment) GetUpdatedAt() time.Time { +func (r *RepositoryComment) GetUpdatedAt() Timestamp { if r == nil || r.UpdatedAt == nil { - return time.Time{} + return Timestamp{} } return *r.UpdatedAt } @@ -16943,9 +16943,9 @@ func (r *RepoStatus) GetContext() string { } // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (r *RepoStatus) GetCreatedAt() time.Time { +func (r *RepoStatus) GetCreatedAt() Timestamp { if r == nil || r.CreatedAt == nil { - return time.Time{} + return Timestamp{} } return *r.CreatedAt } @@ -16999,9 +16999,9 @@ func (r *RepoStatus) GetTargetURL() string { } // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (r *RepoStatus) GetUpdatedAt() time.Time { +func (r *RepoStatus) GetUpdatedAt() Timestamp { if r == nil || r.UpdatedAt == nil { - return time.Time{} + return Timestamp{} } return *r.UpdatedAt } @@ -19263,9 +19263,9 @@ func (t *Timeline) GetCommitURL() string { } // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (t *Timeline) GetCreatedAt() time.Time { +func (t *Timeline) GetCreatedAt() Timestamp { if t == nil || t.CreatedAt == nil { - return time.Time{} + return Timestamp{} } return *t.CreatedAt } @@ -19367,9 +19367,9 @@ func (t *Timeline) GetState() string { } // GetSubmittedAt returns the SubmittedAt field if it's non-nil, zero value otherwise. -func (t *Timeline) GetSubmittedAt() time.Time { +func (t *Timeline) GetSubmittedAt() Timestamp { if t == nil || t.SubmittedAt == nil { - return time.Time{} + return Timestamp{} } return *t.SubmittedAt } diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 6babd83ef19..24e0a758264 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -3220,7 +3220,7 @@ func TestCombinedStatus_GetTotalCount(tt *testing.T) { } func TestComment_GetCreatedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp c := &Comment{CreatedAt: &zeroValue} c.GetCreatedAt() c = &Comment{} @@ -3365,7 +3365,7 @@ func TestCommit_GetVerification(tt *testing.T) { } func TestCommitAuthor_GetDate(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp c := &CommitAuthor{Date: &zeroValue} c.GetDate() c = &CommitAuthor{} @@ -3878,7 +3878,7 @@ func TestCommunityHealthMetrics_GetHealthPercentage(tt *testing.T) { } func TestCommunityHealthMetrics_GetUpdatedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp c := &CommunityHealthMetrics{UpdatedAt: &zeroValue} c.GetUpdatedAt() c = &CommunityHealthMetrics{} @@ -6383,7 +6383,7 @@ func TestEvent_GetActor(tt *testing.T) { } func TestEvent_GetCreatedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp e := &Event{CreatedAt: &zeroValue} e.GetCreatedAt() e = &Event{} @@ -6764,7 +6764,7 @@ func TestGist_GetComments(tt *testing.T) { } func TestGist_GetCreatedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp g := &Gist{CreatedAt: &zeroValue} g.GetCreatedAt() g = &Gist{} @@ -6861,7 +6861,7 @@ func TestGist_GetPublic(tt *testing.T) { } func TestGist_GetUpdatedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp g := &Gist{UpdatedAt: &zeroValue} g.GetUpdatedAt() g = &Gist{} @@ -6881,7 +6881,7 @@ func TestGistComment_GetBody(tt *testing.T) { } func TestGistComment_GetCreatedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp g := &GistComment{CreatedAt: &zeroValue} g.GetCreatedAt() g = &GistComment{} @@ -7274,7 +7274,7 @@ func TestGPGKey_GetCanSign(tt *testing.T) { } func TestGPGKey_GetCreatedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp g := &GPGKey{CreatedAt: &zeroValue} g.GetCreatedAt() g = &GPGKey{} @@ -7284,7 +7284,7 @@ func TestGPGKey_GetCreatedAt(tt *testing.T) { } func TestGPGKey_GetExpiresAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp g := &GPGKey{ExpiresAt: &zeroValue} g.GetExpiresAt() g = &GPGKey{} @@ -7485,7 +7485,7 @@ func TestHook_GetActive(tt *testing.T) { } func TestHook_GetCreatedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp h := &Hook{CreatedAt: &zeroValue} h.GetCreatedAt() h = &Hook{} @@ -7545,7 +7545,7 @@ func TestHook_GetType(tt *testing.T) { } func TestHook_GetUpdatedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp h := &Hook{UpdatedAt: &zeroValue} h.GetUpdatedAt() h = &Hook{} @@ -8645,7 +8645,7 @@ func TestInstallationRepositoriesEvent_GetSender(tt *testing.T) { } func TestInstallationToken_GetExpiresAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp i := &InstallationToken{ExpiresAt: &zeroValue} i.GetExpiresAt() i = &InstallationToken{} @@ -8709,7 +8709,7 @@ func TestInteractionRestriction_GetOrigin(tt *testing.T) { } func TestInvitation_GetCreatedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp i := &Invitation{CreatedAt: &zeroValue} i.GetCreatedAt() i = &Invitation{} @@ -8853,7 +8853,7 @@ func TestIssue_GetBody(tt *testing.T) { } func TestIssue_GetClosedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp i := &Issue{ClosedAt: &zeroValue} i.GetClosedAt() i = &Issue{} @@ -8890,7 +8890,7 @@ func TestIssue_GetCommentsURL(tt *testing.T) { } func TestIssue_GetCreatedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp i := &Issue{CreatedAt: &zeroValue} i.GetCreatedAt() i = &Issue{} @@ -9038,7 +9038,7 @@ func TestIssue_GetTitle(tt *testing.T) { } func TestIssue_GetUpdatedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp i := &Issue{UpdatedAt: &zeroValue} i.GetUpdatedAt() i = &Issue{} @@ -9085,7 +9085,7 @@ func TestIssueComment_GetBody(tt *testing.T) { } func TestIssueComment_GetCreatedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp i := &IssueComment{CreatedAt: &zeroValue} i.GetCreatedAt() i = &IssueComment{} @@ -9142,7 +9142,7 @@ func TestIssueComment_GetReactions(tt *testing.T) { } func TestIssueComment_GetUpdatedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp i := &IssueComment{UpdatedAt: &zeroValue} i.GetUpdatedAt() i = &IssueComment{} @@ -9259,7 +9259,7 @@ func TestIssueEvent_GetCommitID(tt *testing.T) { } func TestIssueEvent_GetCreatedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp i := &IssueEvent{CreatedAt: &zeroValue} i.GetCreatedAt() i = &IssueEvent{} @@ -9385,7 +9385,7 @@ func TestIssueImport_GetClosed(tt *testing.T) { } func TestIssueImport_GetClosedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp i := &IssueImport{ClosedAt: &zeroValue} i.GetClosedAt() i = &IssueImport{} @@ -9395,7 +9395,7 @@ func TestIssueImport_GetClosedAt(tt *testing.T) { } func TestIssueImport_GetCreatedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp i := &IssueImport{CreatedAt: &zeroValue} i.GetCreatedAt() i = &IssueImport{} @@ -9415,7 +9415,7 @@ func TestIssueImport_GetMilestone(tt *testing.T) { } func TestIssueImport_GetUpdatedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp i := &IssueImport{UpdatedAt: &zeroValue} i.GetUpdatedAt() i = &IssueImport{} @@ -9475,7 +9475,7 @@ func TestIssueImportError_GetValue(tt *testing.T) { } func TestIssueImportResponse_GetCreatedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp i := &IssueImportResponse{CreatedAt: &zeroValue} i.GetCreatedAt() i = &IssueImportResponse{} @@ -9545,7 +9545,7 @@ func TestIssueImportResponse_GetStatus(tt *testing.T) { } func TestIssueImportResponse_GetUpdatedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp i := &IssueImportResponse{UpdatedAt: &zeroValue} i.GetUpdatedAt() i = &IssueImportResponse{} @@ -11313,7 +11313,7 @@ func TestMigration_GetURL(tt *testing.T) { } func TestMilestone_GetClosedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp m := &Milestone{ClosedAt: &zeroValue} m.GetClosedAt() m = &Milestone{} @@ -11333,7 +11333,7 @@ func TestMilestone_GetClosedIssues(tt *testing.T) { } func TestMilestone_GetCreatedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp m := &Milestone{CreatedAt: &zeroValue} m.GetCreatedAt() m = &Milestone{} @@ -11360,7 +11360,7 @@ func TestMilestone_GetDescription(tt *testing.T) { } func TestMilestone_GetDueOn(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp m := &Milestone{DueOn: &zeroValue} m.GetDueOn() m = &Milestone{} @@ -11450,7 +11450,7 @@ func TestMilestone_GetTitle(tt *testing.T) { } func TestMilestone_GetUpdatedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp m := &Milestone{UpdatedAt: &zeroValue} m.GetUpdatedAt() m = &Milestone{} @@ -11746,7 +11746,7 @@ func TestNotification_GetID(tt *testing.T) { } func TestNotification_GetLastReadAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp n := &Notification{LastReadAt: &zeroValue} n.GetLastReadAt() n = &Notification{} @@ -11790,7 +11790,7 @@ func TestNotification_GetUnread(tt *testing.T) { } func TestNotification_GetUpdatedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp n := &Notification{UpdatedAt: &zeroValue} n.GetUpdatedAt() n = &Notification{} @@ -11950,7 +11950,7 @@ func TestOrganization_GetCompany(tt *testing.T) { } func TestOrganization_GetCreatedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp o := &Organization{CreatedAt: &zeroValue} o.GetCreatedAt() o = &Organization{} @@ -12407,7 +12407,7 @@ func TestOrganization_GetType(tt *testing.T) { } func TestOrganization_GetUpdatedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp o := &Organization{UpdatedAt: &zeroValue} o.GetUpdatedAt() o = &Organization{} @@ -14952,7 +14952,7 @@ func TestPullRequest_GetChangedFiles(tt *testing.T) { } func TestPullRequest_GetClosedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp p := &PullRequest{ClosedAt: &zeroValue} p.GetClosedAt() p = &PullRequest{} @@ -15002,7 +15002,7 @@ func TestPullRequest_GetCommitsURL(tt *testing.T) { } func TestPullRequest_GetCreatedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp p := &PullRequest{CreatedAt: &zeroValue} p.GetCreatedAt() p = &PullRequest{} @@ -15146,7 +15146,7 @@ func TestPullRequest_GetMerged(tt *testing.T) { } func TestPullRequest_GetMergedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp p := &PullRequest{MergedAt: &zeroValue} p.GetMergedAt() p = &PullRequest{} @@ -15270,7 +15270,7 @@ func TestPullRequest_GetTitle(tt *testing.T) { } func TestPullRequest_GetUpdatedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp p := &PullRequest{UpdatedAt: &zeroValue} p.GetUpdatedAt() p = &PullRequest{} @@ -15438,7 +15438,7 @@ func TestPullRequestComment_GetCommitID(tt *testing.T) { } func TestPullRequestComment_GetCreatedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp p := &PullRequestComment{CreatedAt: &zeroValue} p.GetCreatedAt() p = &PullRequestComment{} @@ -15625,7 +15625,7 @@ func TestPullRequestComment_GetStartSide(tt *testing.T) { } func TestPullRequestComment_GetUpdatedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp p := &PullRequestComment{UpdatedAt: &zeroValue} p.GetUpdatedAt() p = &PullRequestComment{} @@ -15912,7 +15912,7 @@ func TestPullRequestReview_GetState(tt *testing.T) { } func TestPullRequestReview_GetSubmittedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp p := &PullRequestReview{SubmittedAt: &zeroValue} p.GetSubmittedAt() p = &PullRequestReview{} @@ -18560,7 +18560,7 @@ func TestRepositoryComment_GetCommitID(tt *testing.T) { } func TestRepositoryComment_GetCreatedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp r := &RepositoryComment{CreatedAt: &zeroValue} r.GetCreatedAt() r = &RepositoryComment{} @@ -18627,7 +18627,7 @@ func TestRepositoryComment_GetReactions(tt *testing.T) { } func TestRepositoryComment_GetUpdatedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp r := &RepositoryComment{UpdatedAt: &zeroValue} r.GetUpdatedAt() r = &RepositoryComment{} @@ -19721,7 +19721,7 @@ func TestRepoStatus_GetContext(tt *testing.T) { } func TestRepoStatus_GetCreatedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp r := &RepoStatus{CreatedAt: &zeroValue} r.GetCreatedAt() r = &RepoStatus{} @@ -19788,7 +19788,7 @@ func TestRepoStatus_GetTargetURL(tt *testing.T) { } func TestRepoStatus_GetUpdatedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp r := &RepoStatus{UpdatedAt: &zeroValue} r.GetUpdatedAt() r = &RepoStatus{} @@ -22453,7 +22453,7 @@ func TestTimeline_GetCommitURL(tt *testing.T) { } func TestTimeline_GetCreatedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp t := &Timeline{CreatedAt: &zeroValue} t.GetCreatedAt() t = &Timeline{} @@ -22562,7 +22562,7 @@ func TestTimeline_GetState(tt *testing.T) { } func TestTimeline_GetSubmittedAt(tt *testing.T) { - var zeroValue time.Time + var zeroValue Timestamp t := &Timeline{SubmittedAt: &zeroValue} t.GetSubmittedAt() t = &Timeline{} diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index b60fd0ad247..e2ec62b2838 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -268,11 +268,12 @@ func TestCommit_String(t *testing.T) { func TestCommitAuthor_String(t *testing.T) { v := CommitAuthor{ + Date: &Timestamp{}, Name: String(""), Email: String(""), Login: String(""), } - want := `github.CommitAuthor{Name:"", Email:"", Login:""}` + want := `github.CommitAuthor{Date:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Name:"", Email:"", Login:""}` if got := v.String(); got != want { t.Errorf("CommitAuthor.String = %v, want %v", got, want) } @@ -400,14 +401,15 @@ func TestEnterprise_String(t *testing.T) { func TestEvent_String(t *testing.T) { v := Event{ - Type: String(""), - Public: Bool(false), - Repo: &Repository{}, - Actor: &User{}, - Org: &Organization{}, - ID: String(""), + Type: String(""), + Public: Bool(false), + Repo: &Repository{}, + Actor: &User{}, + Org: &Organization{}, + CreatedAt: &Timestamp{}, + ID: String(""), } - want := `github.Event{Type:"", Public:false, Repo:github.Repository{}, Actor:github.User{}, Org:github.Organization{}, ID:""}` + want := `github.Event{Type:"", Public:false, Repo:github.Repository{}, Actor:github.User{}, Org:github.Organization{}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, ID:""}` if got := v.String(); got != want { t.Errorf("Event.String = %v, want %v", got, want) } @@ -424,8 +426,10 @@ func TestGPGKey_String(t *testing.T) { CanEncryptComms: Bool(false), CanEncryptStorage: Bool(false), CanCertify: Bool(false), + CreatedAt: &Timestamp{}, + ExpiresAt: &Timestamp{}, } - want := `github.GPGKey{ID:0, PrimaryKeyID:0, KeyID:"", RawKey:"", PublicKey:"", CanSign:false, CanEncryptComms:false, CanEncryptStorage:false, CanCertify:false}` + want := `github.GPGKey{ID:0, PrimaryKeyID:0, KeyID:"", RawKey:"", PublicKey:"", CanSign:false, CanEncryptComms:false, CanEncryptStorage:false, CanCertify:false, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, ExpiresAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}` if got := v.String(); got != want { t.Errorf("GPGKey.String = %v, want %v", got, want) } @@ -441,9 +445,11 @@ func TestGist_String(t *testing.T) { HTMLURL: String(""), GitPullURL: String(""), GitPushURL: String(""), + CreatedAt: &Timestamp{}, + UpdatedAt: &Timestamp{}, NodeID: String(""), } - want := `github.Gist{ID:"", Description:"", Public:false, Owner:github.User{}, Comments:0, HTMLURL:"", GitPullURL:"", GitPushURL:"", NodeID:""}` + want := `github.Gist{ID:"", Description:"", Public:false, Owner:github.User{}, Comments:0, HTMLURL:"", GitPullURL:"", GitPushURL:"", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, NodeID:""}` if got := v.String(); got != want { t.Errorf("Gist.String = %v, want %v", got, want) } @@ -451,12 +457,13 @@ func TestGist_String(t *testing.T) { func TestGistComment_String(t *testing.T) { v := GistComment{ - ID: Int64(0), - URL: String(""), - Body: String(""), - User: &User{}, + ID: Int64(0), + URL: String(""), + Body: String(""), + User: &User{}, + CreatedAt: &Timestamp{}, } - want := `github.GistComment{ID:0, URL:"", Body:"", User:github.User{}}` + want := `github.GistComment{ID:0, URL:"", Body:"", User:github.User{}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}` if got := v.String(); got != want { t.Errorf("GistComment.String = %v, want %v", got, want) } @@ -580,16 +587,18 @@ func TestHeadCommit_String(t *testing.T) { func TestHook_String(t *testing.T) { v := Hook{ - URL: String(""), - ID: Int64(0), - Type: String(""), - Name: String(""), - TestURL: String(""), - PingURL: String(""), - Events: []string{""}, - Active: Bool(false), + CreatedAt: &Timestamp{}, + UpdatedAt: &Timestamp{}, + URL: String(""), + ID: Int64(0), + Type: String(""), + Name: String(""), + TestURL: String(""), + PingURL: String(""), + Events: []string{""}, + Active: Bool(false), } - want := `github.Hook{URL:"", ID:0, Type:"", Name:"", TestURL:"", PingURL:"", Events:[""], Active:false}` + want := `github.Hook{CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, URL:"", ID:0, Type:"", Name:"", TestURL:"", PingURL:"", Events:[""], Active:false}` if got := v.String(); got != want { t.Errorf("Hook.String = %v, want %v", got, want) } @@ -696,13 +705,14 @@ func TestInvitation_String(t *testing.T) { Login: String(""), Email: String(""), Role: String(""), + CreatedAt: &Timestamp{}, Inviter: &User{}, TeamCount: Int(0), InvitationTeamURL: String(""), FailedAt: &Timestamp{}, FailedReason: String(""), } - want := `github.Invitation{ID:0, NodeID:"", Login:"", Email:"", Role:"", Inviter:github.User{}, TeamCount:0, InvitationTeamURL:"", FailedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, FailedReason:""}` + want := `github.Invitation{ID:0, NodeID:"", Login:"", Email:"", Role:"", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Inviter:github.User{}, TeamCount:0, InvitationTeamURL:"", FailedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, FailedReason:""}` if got := v.String(); got != want { t.Errorf("Invitation.String = %v, want %v", got, want) } @@ -721,6 +731,9 @@ func TestIssue_String(t *testing.T) { User: &User{}, Assignee: &User{}, Comments: Int(0), + ClosedAt: &Timestamp{}, + CreatedAt: &Timestamp{}, + UpdatedAt: &Timestamp{}, ClosedBy: &User{}, URL: String(""), HTMLURL: String(""), @@ -735,7 +748,7 @@ func TestIssue_String(t *testing.T) { NodeID: String(""), ActiveLockReason: String(""), } - want := `github.Issue{ID:0, Number:0, State:"", StateReason:"", Locked:false, Title:"", Body:"", AuthorAssociation:"", User:github.User{}, Assignee:github.User{}, Comments:0, ClosedBy:github.User{}, URL:"", HTMLURL:"", CommentsURL:"", EventsURL:"", LabelsURL:"", RepositoryURL:"", Milestone:github.Milestone{}, PullRequestLinks:github.PullRequestLinks{}, Repository:github.Repository{}, Reactions:github.Reactions{}, NodeID:"", ActiveLockReason:""}` + want := `github.Issue{ID:0, Number:0, State:"", StateReason:"", Locked:false, Title:"", Body:"", AuthorAssociation:"", User:github.User{}, Assignee:github.User{}, Comments:0, ClosedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, ClosedBy:github.User{}, URL:"", HTMLURL:"", CommentsURL:"", EventsURL:"", LabelsURL:"", RepositoryURL:"", Milestone:github.Milestone{}, PullRequestLinks:github.PullRequestLinks{}, Repository:github.Repository{}, Reactions:github.Reactions{}, NodeID:"", ActiveLockReason:""}` if got := v.String(); got != want { t.Errorf("Issue.String = %v, want %v", got, want) } @@ -748,12 +761,14 @@ func TestIssueComment_String(t *testing.T) { Body: String(""), User: &User{}, Reactions: &Reactions{}, + CreatedAt: &Timestamp{}, + UpdatedAt: &Timestamp{}, AuthorAssociation: String(""), URL: String(""), HTMLURL: String(""), IssueURL: String(""), } - want := `github.IssueComment{ID:0, NodeID:"", Body:"", User:github.User{}, Reactions:github.Reactions{}, AuthorAssociation:"", URL:"", HTMLURL:"", IssueURL:""}` + want := `github.IssueComment{ID:0, NodeID:"", Body:"", User:github.User{}, Reactions:github.Reactions{}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, AuthorAssociation:"", URL:"", HTMLURL:"", IssueURL:""}` if got := v.String(); got != want { t.Errorf("IssueComment.String = %v, want %v", got, want) } @@ -895,9 +910,13 @@ func TestMilestone_String(t *testing.T) { Creator: &User{}, OpenIssues: Int(0), ClosedIssues: Int(0), + CreatedAt: &Timestamp{}, + UpdatedAt: &Timestamp{}, + ClosedAt: &Timestamp{}, + DueOn: &Timestamp{}, NodeID: String(""), } - want := `github.Milestone{URL:"", HTMLURL:"", LabelsURL:"", ID:0, Number:0, State:"", Title:"", Description:"", Creator:github.User{}, OpenIssues:0, ClosedIssues:0, NodeID:""}` + want := `github.Milestone{URL:"", HTMLURL:"", LabelsURL:"", ID:0, Number:0, State:"", Title:"", Description:"", Creator:github.User{}, OpenIssues:0, ClosedIssues:0, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, ClosedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, DueOn:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, NodeID:""}` if got := v.String(); got != want { t.Errorf("Milestone.String = %v, want %v", got, want) } @@ -975,6 +994,8 @@ func TestOrganization_String(t *testing.T) { PublicGists: Int(0), Followers: Int(0), Following: Int(0), + CreatedAt: &Timestamp{}, + UpdatedAt: &Timestamp{}, TotalPrivateRepos: Int(0), OwnedPrivateRepos: Int(0), PrivateGists: Int(0), @@ -1013,7 +1034,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, MembersCanForkPrivateRepos:false, MembersAllowedRepositoryCreationType:"", MembersCanCreatePages:false, MembersCanCreatePublicPages:false, MembersCanCreatePrivatePages:false, WebCommitSignoffRequired:false, AdvancedSecurityEnabledForNewRepos:false, DependabotAlertsEnabledForNewRepos:false, DependabotSecurityUpdatesEnabledForNewRepos:false, DependencyGraphEnabledForNewRepos:false, SecretScanningEnabledForNewRepos:false, SecretScanningPushProtectionEnabledForNewRepos: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, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, 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, WebCommitSignoffRequired:false, AdvancedSecurityEnabledForNewRepos:false, DependabotAlertsEnabledForNewRepos:false, DependabotSecurityUpdatesEnabledForNewRepos:false, DependencyGraphEnabledForNewRepos:false, SecretScanningEnabledForNewRepos:false, SecretScanningPushProtectionEnabledForNewRepos:false, URL:"", EventsURL:"", HooksURL:"", IssuesURL:"", MembersURL:"", PublicMembersURL:"", ReposURL:""}` if got := v.String(); got != want { t.Errorf("Organization.String = %v, want %v", got, want) } @@ -1217,6 +1238,10 @@ func TestPullRequest_String(t *testing.T) { Locked: Bool(false), Title: String(""), Body: String(""), + CreatedAt: &Timestamp{}, + UpdatedAt: &Timestamp{}, + ClosedAt: &Timestamp{}, + MergedAt: &Timestamp{}, User: &User{}, Draft: Bool(false), Merged: Bool(false), @@ -1252,7 +1277,7 @@ func TestPullRequest_String(t *testing.T) { Base: &PullRequestBranch{}, ActiveLockReason: String(""), } - want := `github.PullRequest{ID:0, Number:0, State:"", Locked:false, Title:"", Body:"", User:github.User{}, Draft:false, Merged:false, Mergeable:false, MergeableState:"", MergedBy:github.User{}, MergeCommitSHA:"", Rebaseable:false, Comments:0, Commits:0, Additions:0, Deletions:0, ChangedFiles:0, URL:"", HTMLURL:"", IssueURL:"", StatusesURL:"", DiffURL:"", PatchURL:"", CommitsURL:"", CommentsURL:"", ReviewCommentsURL:"", ReviewCommentURL:"", ReviewComments:0, Assignee:github.User{}, Milestone:github.Milestone{}, MaintainerCanModify:false, AuthorAssociation:"", NodeID:"", AutoMerge:github.PullRequestAutoMerge{}, Links:github.PRLinks{}, Head:github.PullRequestBranch{}, Base:github.PullRequestBranch{}, ActiveLockReason:""}` + want := `github.PullRequest{ID:0, Number:0, State:"", Locked:false, Title:"", Body:"", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, ClosedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, MergedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, User:github.User{}, Draft:false, Merged:false, Mergeable:false, MergeableState:"", MergedBy:github.User{}, MergeCommitSHA:"", Rebaseable:false, Comments:0, Commits:0, Additions:0, Deletions:0, ChangedFiles:0, URL:"", HTMLURL:"", IssueURL:"", StatusesURL:"", DiffURL:"", PatchURL:"", CommitsURL:"", CommentsURL:"", ReviewCommentsURL:"", ReviewCommentURL:"", ReviewComments:0, Assignee:github.User{}, Milestone:github.Milestone{}, MaintainerCanModify:false, AuthorAssociation:"", NodeID:"", AutoMerge:github.PullRequestAutoMerge{}, Links:github.PRLinks{}, Head:github.PullRequestBranch{}, Base:github.PullRequestBranch{}, ActiveLockReason:""}` if got := v.String(); got != want { t.Errorf("PullRequest.String = %v, want %v", got, want) } @@ -1279,12 +1304,14 @@ func TestPullRequestComment_String(t *testing.T) { OriginalCommitID: String(""), User: &User{}, Reactions: &Reactions{}, + CreatedAt: &Timestamp{}, + UpdatedAt: &Timestamp{}, AuthorAssociation: String(""), URL: String(""), HTMLURL: String(""), PullRequestURL: String(""), } - want := `github.PullRequestComment{ID:0, NodeID:"", InReplyTo:0, Body:"", Path:"", DiffHunk:"", PullRequestReviewID:0, Position:0, OriginalPosition:0, StartLine:0, Line:0, OriginalLine:0, OriginalStartLine:0, Side:"", StartSide:"", CommitID:"", OriginalCommitID:"", User:github.User{}, Reactions:github.Reactions{}, AuthorAssociation:"", URL:"", HTMLURL:"", PullRequestURL:""}` + want := `github.PullRequestComment{ID:0, NodeID:"", InReplyTo:0, Body:"", Path:"", DiffHunk:"", PullRequestReviewID:0, Position:0, OriginalPosition:0, StartLine:0, Line:0, OriginalLine:0, OriginalStartLine:0, Side:"", StartSide:"", CommitID:"", OriginalCommitID:"", User:github.User{}, Reactions:github.Reactions{}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, AuthorAssociation:"", URL:"", HTMLURL:"", PullRequestURL:""}` if got := v.String(); got != want { t.Errorf("PullRequestComment.String = %v, want %v", got, want) } @@ -1296,13 +1323,14 @@ func TestPullRequestReview_String(t *testing.T) { NodeID: String(""), User: &User{}, Body: String(""), + SubmittedAt: &Timestamp{}, CommitID: String(""), HTMLURL: String(""), PullRequestURL: String(""), State: String(""), AuthorAssociation: String(""), } - want := `github.PullRequestReview{ID:0, NodeID:"", User:github.User{}, Body:"", CommitID:"", HTMLURL:"", PullRequestURL:"", State:"", AuthorAssociation:""}` + want := `github.PullRequestReview{ID:0, NodeID:"", User:github.User{}, Body:"", SubmittedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, CommitID:"", HTMLURL:"", PullRequestURL:"", State:"", AuthorAssociation:""}` if got := v.String(); got != want { t.Errorf("PullRequestReview.String = %v, want %v", got, want) } @@ -1480,8 +1508,10 @@ func TestRepoStatus_String(t *testing.T) { Context: String(""), AvatarURL: String(""), Creator: &User{}, + CreatedAt: &Timestamp{}, + UpdatedAt: &Timestamp{}, } - want := `github.RepoStatus{ID:0, NodeID:"", URL:"", State:"", TargetURL:"", Description:"", Context:"", AvatarURL:"", Creator:github.User{}}` + want := `github.RepoStatus{ID:0, NodeID:"", URL:"", State:"", TargetURL:"", Description:"", Context:"", AvatarURL:"", Creator:github.User{}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}` if got := v.String(); got != want { t.Errorf("RepoStatus.String = %v, want %v", got, want) } @@ -1607,11 +1637,13 @@ func TestRepositoryComment_String(t *testing.T) { CommitID: String(""), User: &User{}, Reactions: &Reactions{}, + CreatedAt: &Timestamp{}, + UpdatedAt: &Timestamp{}, Body: String(""), Path: String(""), Position: Int(0), } - want := `github.RepositoryComment{HTMLURL:"", URL:"", ID:0, NodeID:"", CommitID:"", User:github.User{}, Reactions:github.Reactions{}, Body:"", Path:"", Position:0}` + want := `github.RepositoryComment{HTMLURL:"", URL:"", ID:0, NodeID:"", CommitID:"", User:github.User{}, Reactions:github.Reactions{}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Body:"", Path:"", Position:0}` if got := v.String(); got != want { t.Errorf("RepositoryComment.String = %v, want %v", got, want) } diff --git a/github/issue_import.go b/github/issue_import.go index a9810407cc8..4bc8d5f1d23 100644 --- a/github/issue_import.go +++ b/github/issue_import.go @@ -10,7 +10,6 @@ import ( "context" "encoding/json" "fmt" - "time" ) // IssueImportService handles communication with the issue import related @@ -29,9 +28,9 @@ type IssueImportRequest struct { type IssueImport struct { Title string `json:"title"` Body string `json:"body"` - CreatedAt *time.Time `json:"created_at,omitempty"` - ClosedAt *time.Time `json:"closed_at,omitempty"` - UpdatedAt *time.Time `json:"updated_at,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + ClosedAt *Timestamp `json:"closed_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` Assignee *string `json:"assignee,omitempty"` Milestone *int `json:"milestone,omitempty"` Closed *bool `json:"closed,omitempty"` @@ -40,7 +39,7 @@ type IssueImport struct { // Comment represents comments of issue to import. type Comment struct { - CreatedAt *time.Time `json:"created_at,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` Body string `json:"body"` } @@ -53,8 +52,8 @@ type IssueImportResponse struct { URL *string `json:"url,omitempty"` ImportIssuesURL *string `json:"import_issues_url,omitempty"` RepositoryURL *string `json:"repository_url,omitempty"` - CreatedAt *time.Time `json:"created_at,omitempty"` - UpdatedAt *time.Time `json:"updated_at,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` Message *string `json:"message,omitempty"` DocumentationURL *string `json:"documentation_url,omitempty"` Errors []*IssueImportError `json:"errors,omitempty"` @@ -126,7 +125,7 @@ func (s *IssueImportService) CheckStatus(ctx context.Context, owner, repo string // CheckStatusSince checks the status of multiple imported issues since a given date. // // https://gist.github.com/jonmagic/5282384165e0f86ef105#check-status-of-multiple-issues -func (s *IssueImportService) CheckStatusSince(ctx context.Context, owner, repo string, since time.Time) ([]*IssueImportResponse, *Response, error) { +func (s *IssueImportService) CheckStatusSince(ctx context.Context, owner, repo string, since Timestamp) ([]*IssueImportResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/issues?since=%v", owner, repo, since.Format("2006-01-02")) req, err := s.client.NewRequest("GET", u, nil) if err != nil { diff --git a/github/issue_import_test.go b/github/issue_import_test.go index 3533b3ab4bb..a86ead898b4 100644 --- a/github/issue_import_test.go +++ b/github/issue_import_test.go @@ -25,13 +25,13 @@ func TestIssueImportService_Create(t *testing.T) { IssueImport: IssueImport{ Assignee: String("developer"), Body: "Dummy description", - CreatedAt: &createdAt, + CreatedAt: &Timestamp{createdAt}, Labels: []string{"l1", "l2"}, Milestone: Int(1), Title: "Dummy Issue", }, Comments: []*Comment{{ - CreatedAt: &createdAt, + CreatedAt: &Timestamp{createdAt}, Body: "Comment body", }}, } @@ -142,7 +142,7 @@ func TestIssueImportService_CheckStatusSince(t *testing.T) { }) ctx := context.Background() - got, _, err := client.IssueImport.CheckStatusSince(ctx, "o", "r", time.Now()) + got, _, err := client.IssueImport.CheckStatusSince(ctx, "o", "r", Timestamp{time.Now()}) if err != nil { t.Errorf("CheckStatusSince returned error: %v", err) } @@ -154,12 +154,12 @@ func TestIssueImportService_CheckStatusSince(t *testing.T) { const methodName = "CheckStatusSince" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.IssueImport.CheckStatusSince(ctx, "\n", "\n", time.Now()) + _, _, err = client.IssueImport.CheckStatusSince(ctx, "\n", "\n", Timestamp{time.Now()}) return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.IssueImport.CheckStatusSince(ctx, "o", "r", time.Now()) + got, resp, err := client.IssueImport.CheckStatusSince(ctx, "o", "r", Timestamp{time.Now()}) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -179,7 +179,7 @@ func TestIssueImportService_CheckStatusSince_badResponse(t *testing.T) { }) ctx := context.Background() - if _, _, err := client.IssueImport.CheckStatusSince(ctx, "o", "r", time.Now()); err == nil { + if _, _, err := client.IssueImport.CheckStatusSince(ctx, "o", "r", Timestamp{time.Now()}); err == nil { t.Errorf("CheckStatusSince returned no error, want JSON err") } } @@ -189,7 +189,7 @@ func TestIssueImportService_CheckStatusSince_invalidOwner(t *testing.T) { defer teardown() ctx := context.Background() - _, _, err := client.IssueImport.CheckStatusSince(ctx, "%", "r", time.Now()) + _, _, err := client.IssueImport.CheckStatusSince(ctx, "%", "r", Timestamp{time.Now()}) testURLParseError(t, err) } @@ -240,8 +240,8 @@ func TestIssueImportResponse_Marshal(t *testing.T) { URL: String("url"), ImportIssuesURL: String("iiu"), RepositoryURL: String("ru"), - CreatedAt: &referenceTime, - UpdatedAt: &referenceTime, + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, Message: String("msg"), DocumentationURL: String("durl"), Errors: []*IssueImportError{ @@ -283,7 +283,7 @@ func TestComment_Marshal(t *testing.T) { testJSONMarshal(t, &Comment{}, "{}") u := &Comment{ - CreatedAt: &referenceTime, + CreatedAt: &Timestamp{referenceTime}, Body: "body", } @@ -301,9 +301,9 @@ func TestIssueImport_Marshal(t *testing.T) { u := &IssueImport{ Title: "title", Body: "body", - CreatedAt: &referenceTime, - ClosedAt: &referenceTime, - UpdatedAt: &referenceTime, + CreatedAt: &Timestamp{referenceTime}, + ClosedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, Assignee: String("a"), Milestone: Int(1), Closed: Bool(false), @@ -334,9 +334,9 @@ func TestIssueImportRequest_Marshal(t *testing.T) { IssueImport: IssueImport{ Title: "title", Body: "body", - CreatedAt: &referenceTime, - ClosedAt: &referenceTime, - UpdatedAt: &referenceTime, + CreatedAt: &Timestamp{referenceTime}, + ClosedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, Assignee: String("a"), Milestone: Int(1), Closed: Bool(false), @@ -344,7 +344,7 @@ func TestIssueImportRequest_Marshal(t *testing.T) { }, Comments: []*Comment{ { - CreatedAt: &referenceTime, + CreatedAt: &Timestamp{referenceTime}, Body: "body", }, }, diff --git a/github/issues.go b/github/issues.go index 571a721170c..42e58a17a8a 100644 --- a/github/issues.go +++ b/github/issues.go @@ -38,9 +38,9 @@ type Issue struct { Labels []*Label `json:"labels,omitempty"` Assignee *User `json:"assignee,omitempty"` Comments *int `json:"comments,omitempty"` - ClosedAt *time.Time `json:"closed_at,omitempty"` - CreatedAt *time.Time `json:"created_at,omitempty"` - UpdatedAt *time.Time `json:"updated_at,omitempty"` + ClosedAt *Timestamp `json:"closed_at,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` ClosedBy *User `json:"closed_by,omitempty"` URL *string `json:"url,omitempty"` HTMLURL *string `json:"html_url,omitempty"` diff --git a/github/issues_comments.go b/github/issues_comments.go index 361ee49a690..17881c093dc 100644 --- a/github/issues_comments.go +++ b/github/issues_comments.go @@ -18,8 +18,8 @@ type IssueComment struct { Body *string `json:"body,omitempty"` User *User `json:"user,omitempty"` Reactions *Reactions `json:"reactions,omitempty"` - CreatedAt *time.Time `json:"created_at,omitempty"` - UpdatedAt *time.Time `json:"updated_at,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` // AuthorAssociation is the comment author's relationship to the issue's repository. // Possible values are "COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MEMBER", "OWNER", or "NONE". AuthorAssociation *string `json:"author_association,omitempty"` diff --git a/github/issues_comments_test.go b/github/issues_comments_test.go index 7780676f086..d35deedaf17 100644 --- a/github/issues_comments_test.go +++ b/github/issues_comments_test.go @@ -323,8 +323,8 @@ func TestIssueComment_Marshal(t *testing.T) { SuspendedAt: &Timestamp{referenceTime}, }, Reactions: &Reactions{TotalCount: Int(1)}, - CreatedAt: &referenceTime, - UpdatedAt: &referenceTime, + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, AuthorAssociation: String("aa"), URL: String("url"), HTMLURL: String("hurl"), diff --git a/github/issues_events.go b/github/issues_events.go index d8ffc0b5420..ed076591701 100644 --- a/github/issues_events.go +++ b/github/issues_events.go @@ -8,7 +8,6 @@ package github import ( "context" "fmt" - "time" ) // IssueEvent represents an event that occurred around an Issue or Pull Request. @@ -71,7 +70,7 @@ type IssueEvent struct { // Event *string `json:"event,omitempty"` - CreatedAt *time.Time `json:"created_at,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` Issue *Issue `json:"issue,omitempty"` // Only present on certain events; see above. diff --git a/github/issues_events_test.go b/github/issues_events_test.go index ba21565f2e8..1d8d3233d19 100644 --- a/github/issues_events_test.go +++ b/github/issues_events_test.go @@ -193,7 +193,7 @@ func TestIssueEvent_Marshal(t *testing.T) { SuspendedAt: &Timestamp{referenceTime}, }, Event: String("event"), - CreatedAt: &referenceTime, + CreatedAt: &Timestamp{referenceTime}, Issue: &Issue{ID: Int64(1)}, Assignee: &User{ Login: String("l"), diff --git a/github/issues_milestones.go b/github/issues_milestones.go index 3c9be2407ee..897c7c0b6da 100644 --- a/github/issues_milestones.go +++ b/github/issues_milestones.go @@ -8,7 +8,6 @@ package github import ( "context" "fmt" - "time" ) // Milestone represents a GitHub repository milestone. @@ -24,10 +23,10 @@ type Milestone struct { Creator *User `json:"creator,omitempty"` OpenIssues *int `json:"open_issues,omitempty"` ClosedIssues *int `json:"closed_issues,omitempty"` - CreatedAt *time.Time `json:"created_at,omitempty"` - UpdatedAt *time.Time `json:"updated_at,omitempty"` - ClosedAt *time.Time `json:"closed_at,omitempty"` - DueOn *time.Time `json:"due_on,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + ClosedAt *Timestamp `json:"closed_at,omitempty"` + DueOn *Timestamp `json:"due_on,omitempty"` NodeID *string `json:"node_id,omitempty"` } diff --git a/github/issues_milestones_test.go b/github/issues_milestones_test.go index 86d1bddcef9..b6472f34688 100644 --- a/github/issues_milestones_test.go +++ b/github/issues_milestones_test.go @@ -284,10 +284,10 @@ func TestMilestone_Marshal(t *testing.T) { }, OpenIssues: Int(1), ClosedIssues: Int(1), - CreatedAt: &referenceTime, - UpdatedAt: &referenceTime, - ClosedAt: &referenceTime, - DueOn: &referenceTime, + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + ClosedAt: &Timestamp{referenceTime}, + DueOn: &Timestamp{referenceTime}, NodeID: String("nid"), } diff --git a/github/issues_test.go b/github/issues_test.go index e2cf063914d..37b2c2ad0f7 100644 --- a/github/issues_test.go +++ b/github/issues_test.go @@ -556,9 +556,9 @@ func TestIssue_Marshal(t *testing.T) { Labels: []*Label{{ID: Int64(1)}}, Assignee: &User{ID: Int64(1)}, Comments: Int(1), - ClosedAt: &referenceTime, - CreatedAt: &referenceTime, - UpdatedAt: &referenceTime, + ClosedAt: &Timestamp{referenceTime}, + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, ClosedBy: &User{ID: Int64(1)}, URL: String("url"), HTMLURL: String("hurl"), diff --git a/github/issues_timeline.go b/github/issues_timeline.go index 7b9068acc58..2f049aff56f 100644 --- a/github/issues_timeline.go +++ b/github/issues_timeline.go @@ -9,7 +9,6 @@ import ( "context" "fmt" "strings" - "time" ) // Timeline represents an event that occurred around an Issue or Pull Request. @@ -118,7 +117,7 @@ type Timeline struct { // The string SHA of a commit that referenced this Issue or Pull Request. CommitID *string `json:"commit_id,omitempty"` // The timestamp indicating when the event occurred. - CreatedAt *time.Time `json:"created_at,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` // The Label object including `name` and `color` attributes. Only provided for // 'labeled' and 'unlabeled' events. Label *Label `json:"label,omitempty"` @@ -149,7 +148,7 @@ type Timeline struct { // The review summary text. Body *string `json:"body,omitempty"` - SubmittedAt *time.Time `json:"submitted_at,omitempty"` + SubmittedAt *Timestamp `json:"submitted_at,omitempty"` } // Source represents a reference's source. diff --git a/github/issues_timeline_test.go b/github/issues_timeline_test.go index 17ae6187beb..27c7c115e7b 100644 --- a/github/issues_timeline_test.go +++ b/github/issues_timeline_test.go @@ -126,7 +126,7 @@ func TestTimeline_Marshal(t *testing.T) { }, Event: String("event"), CommitID: String("cid"), - CreatedAt: &referenceTime, + CreatedAt: &Timestamp{referenceTime}, Label: &Label{ID: Int64(1)}, Assignee: &User{ Login: String("l"), diff --git a/github/orgs.go b/github/orgs.go index 8105afad38f..487405778f1 100644 --- a/github/orgs.go +++ b/github/orgs.go @@ -8,7 +8,6 @@ package github import ( "context" "fmt" - "time" ) // OrganizationsService provides access to the organization related functions @@ -35,8 +34,8 @@ type Organization struct { PublicGists *int `json:"public_gists,omitempty"` Followers *int `json:"followers,omitempty"` Following *int `json:"following,omitempty"` - CreatedAt *time.Time `json:"created_at,omitempty"` - UpdatedAt *time.Time `json:"updated_at,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` TotalPrivateRepos *int `json:"total_private_repos,omitempty"` OwnedPrivateRepos *int `json:"owned_private_repos,omitempty"` PrivateGists *int `json:"private_gists,omitempty"` diff --git a/github/orgs_hooks_test.go b/github/orgs_hooks_test.go index d4d4c54ebb9..0fe45565b9c 100644 --- a/github/orgs_hooks_test.go +++ b/github/orgs_hooks_test.go @@ -66,7 +66,7 @@ func TestOrganizationsService_CreateHook(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - input := &Hook{CreatedAt: &referenceTime} + input := &Hook{CreatedAt: &Timestamp{referenceTime}} mux.HandleFunc("/orgs/o/hooks", func(w http.ResponseWriter, r *http.Request) { v := new(createHookRequest) diff --git a/github/orgs_members_test.go b/github/orgs_members_test.go index adc14f5b008..0b5068e55e5 100644 --- a/github/orgs_members_test.go +++ b/github/orgs_members_test.go @@ -590,7 +590,7 @@ func TestOrganizationsService_ListPendingOrgInvitations(t *testing.T) { Login: String("monalisa"), Email: String("octocat@github.com"), Role: String("direct_member"), - CreatedAt: &createdAt, + CreatedAt: &Timestamp{createdAt}, Inviter: &User{ Login: String("other_user"), ID: Int64(1), @@ -805,7 +805,7 @@ func TestOrganizationsService_ListFailedOrgInvitations(t *testing.T) { Role: String("direct_member"), FailedAt: &Timestamp{time.Date(2017, time.January, 2, 1, 10, 0, 0, time.UTC)}, FailedReason: String("the reason"), - CreatedAt: &createdAt, + CreatedAt: &Timestamp{createdAt}, Inviter: &User{ Login: String("other_user"), ID: Int64(1), diff --git a/github/pulls.go b/github/pulls.go index 120a1d6f18a..6e49eba2f91 100644 --- a/github/pulls.go +++ b/github/pulls.go @@ -9,7 +9,6 @@ import ( "bytes" "context" "fmt" - "time" ) // PullRequestsService handles communication with the pull request related @@ -34,10 +33,10 @@ type PullRequest struct { Locked *bool `json:"locked,omitempty"` Title *string `json:"title,omitempty"` Body *string `json:"body,omitempty"` - CreatedAt *time.Time `json:"created_at,omitempty"` - UpdatedAt *time.Time `json:"updated_at,omitempty"` - ClosedAt *time.Time `json:"closed_at,omitempty"` - MergedAt *time.Time `json:"merged_at,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + ClosedAt *Timestamp `json:"closed_at,omitempty"` + MergedAt *Timestamp `json:"merged_at,omitempty"` Labels []*Label `json:"labels,omitempty"` User *User `json:"user,omitempty"` Draft *bool `json:"draft,omitempty"` diff --git a/github/pulls_comments.go b/github/pulls_comments.go index 83e7881e518..1f6b726d85f 100644 --- a/github/pulls_comments.go +++ b/github/pulls_comments.go @@ -33,8 +33,8 @@ type PullRequestComment struct { OriginalCommitID *string `json:"original_commit_id,omitempty"` User *User `json:"user,omitempty"` Reactions *Reactions `json:"reactions,omitempty"` - CreatedAt *time.Time `json:"created_at,omitempty"` - UpdatedAt *time.Time `json:"updated_at,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` // AuthorAssociation is the comment author's relationship to the pull request's repository. // Possible values are "COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MEMBER", "OWNER", or "NONE". AuthorAssociation *string `json:"author_association,omitempty"` diff --git a/github/pulls_comments_test.go b/github/pulls_comments_test.go index cd6f19c12c8..47d08d2b779 100644 --- a/github/pulls_comments_test.go +++ b/github/pulls_comments_test.go @@ -20,8 +20,8 @@ import ( func TestPullComments_Marshal(t *testing.T) { testJSONMarshal(t, &PullRequestComment{}, "{}") - createdAt := time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC) - updatedAt := time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC) + createdAt := Timestamp{time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC)} + updatedAt := Timestamp{time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC)} reactions := &Reactions{ TotalCount: Int(1), PlusOne: Int(1), diff --git a/github/pulls_reviews.go b/github/pulls_reviews.go index 77bf60ce2d4..addcce46834 100644 --- a/github/pulls_reviews.go +++ b/github/pulls_reviews.go @@ -9,7 +9,6 @@ import ( "context" "errors" "fmt" - "time" ) var ErrMixedCommentStyles = errors.New("cannot use both position and side/line form comments") @@ -20,7 +19,7 @@ type PullRequestReview struct { NodeID *string `json:"node_id,omitempty"` User *User `json:"user,omitempty"` Body *string `json:"body,omitempty"` - SubmittedAt *time.Time `json:"submitted_at,omitempty"` + SubmittedAt *Timestamp `json:"submitted_at,omitempty"` CommitID *string `json:"commit_id,omitempty"` HTMLURL *string `json:"html_url,omitempty"` PullRequestURL *string `json:"pull_request_url,omitempty"` diff --git a/github/pulls_reviews_test.go b/github/pulls_reviews_test.go index aacc036888f..7931ba05140 100644 --- a/github/pulls_reviews_test.go +++ b/github/pulls_reviews_test.go @@ -739,7 +739,7 @@ func TestPullRequestReview_Marshal(t *testing.T) { SuspendedAt: &Timestamp{referenceTime}, }, Body: String("body"), - SubmittedAt: &referenceTime, + SubmittedAt: &Timestamp{referenceTime}, CommitID: String("cid"), HTMLURL: String("hurl"), PullRequestURL: String("prurl"), diff --git a/github/pulls_test.go b/github/pulls_test.go index b498193817d..590483fadb3 100644 --- a/github/pulls_test.go +++ b/github/pulls_test.go @@ -1162,10 +1162,10 @@ func TestPullRequest_Marshal(t *testing.T) { Locked: Bool(false), Title: String("title"), Body: String("body"), - CreatedAt: &referenceTime, - UpdatedAt: &referenceTime, - ClosedAt: &referenceTime, - MergedAt: &referenceTime, + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + ClosedAt: &Timestamp{referenceTime}, + MergedAt: &Timestamp{referenceTime}, Labels: []*Label{{ID: Int64(1)}}, User: &User{ Login: String("l"), diff --git a/github/pulls_threads_test.go b/github/pulls_threads_test.go index 6df28404031..7c3c8619968 100644 --- a/github/pulls_threads_test.go +++ b/github/pulls_threads_test.go @@ -13,8 +13,8 @@ import ( func TestPullRequestThread_Marshal(t *testing.T) { testJSONMarshal(t, &PullRequestThread{}, "{}") - createdAt := time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC) - updatedAt := time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC) + createdAt := Timestamp{time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC)} + updatedAt := Timestamp{time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC)} reactions := &Reactions{ TotalCount: Int(1), PlusOne: Int(1), diff --git a/github/repos_comments.go b/github/repos_comments.go index 55a88d1f5e9..e282374e9e5 100644 --- a/github/repos_comments.go +++ b/github/repos_comments.go @@ -8,7 +8,6 @@ package github import ( "context" "fmt" - "time" ) // RepositoryComment represents a comment for a commit, file, or line in a repository. @@ -20,8 +19,8 @@ type RepositoryComment struct { CommitID *string `json:"commit_id,omitempty"` User *User `json:"user,omitempty"` Reactions *Reactions `json:"reactions,omitempty"` - CreatedAt *time.Time `json:"created_at,omitempty"` - UpdatedAt *time.Time `json:"updated_at,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` // User-mutable fields Body *string `json:"body"` diff --git a/github/repos_comments_test.go b/github/repos_comments_test.go index 3dbc10cb474..b3579bf5a80 100644 --- a/github/repos_comments_test.go +++ b/github/repos_comments_test.go @@ -335,8 +335,8 @@ func TestRepositoryComment_Marshal(t *testing.T) { Eyes: Int(1), URL: String("u"), }, - CreatedAt: &referenceTime, - UpdatedAt: &referenceTime, + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, Body: String("body"), Path: String("path"), Position: Int(1), diff --git a/github/repos_commits_test.go b/github/repos_commits_test.go index 1ce068c6596..c5c132786c0 100644 --- a/github/repos_commits_test.go +++ b/github/repos_commits_test.go @@ -672,13 +672,13 @@ func TestBranchCommit_Marshal(t *testing.T) { Commit: &Commit{ SHA: String("s"), Author: &CommitAuthor{ - Date: &referenceTime, + Date: &Timestamp{referenceTime}, Name: String("n"), Email: String("e"), Login: String("u"), }, Committer: &CommitAuthor{ - Date: &referenceTime, + Date: &Timestamp{referenceTime}, Name: String("n"), Email: String("e"), Login: String("u"), diff --git a/github/repos_community_health.go b/github/repos_community_health.go index 9de438b6259..750ee158270 100644 --- a/github/repos_community_health.go +++ b/github/repos_community_health.go @@ -8,7 +8,6 @@ package github import ( "context" "fmt" - "time" ) // Metric represents the different fields for one file in community health files. @@ -38,7 +37,7 @@ type CommunityHealthMetrics struct { Description *string `json:"description"` Documentation *string `json:"documentation"` Files *CommunityHealthFiles `json:"files"` - UpdatedAt *time.Time `json:"updated_at"` + UpdatedAt *Timestamp `json:"updated_at"` ContentReportsEnabled *bool `json:"content_reports_enabled"` } diff --git a/github/repos_community_health_test.go b/github/repos_community_health_test.go index 0031cdb7d83..6ff88bda5aa 100644 --- a/github/repos_community_health_test.go +++ b/github/repos_community_health_test.go @@ -76,7 +76,7 @@ func TestRepositoriesService_GetCommunityHealthMetrics(t *testing.T) { want := &CommunityHealthMetrics{ HealthPercentage: Int(100), Description: String("My first repository on GitHub!"), - UpdatedAt: &updatedAt, + UpdatedAt: &Timestamp{updatedAt}, ContentReportsEnabled: Bool(true), Files: &CommunityHealthFiles{ CodeOfConduct: &Metric{ @@ -310,7 +310,7 @@ func TestCommunityHealthMetrics_Marshal(t *testing.T) { HTMLURL: String("hurl"), }, }, - UpdatedAt: &referenceTime, + UpdatedAt: &Timestamp{referenceTime}, ContentReportsEnabled: Bool(true), } diff --git a/github/repos_contents_test.go b/github/repos_contents_test.go index f5de5570aff..db3efb91c60 100644 --- a/github/repos_contents_test.go +++ b/github/repos_contents_test.go @@ -838,13 +838,13 @@ func TestRepositoryContentResponse_Marshal(t *testing.T) { Commit: Commit{ SHA: String("s"), Author: &CommitAuthor{ - Date: &referenceTime, + Date: &Timestamp{referenceTime}, Name: String("n"), Email: String("e"), Login: String("u"), }, Committer: &CommitAuthor{ - Date: &referenceTime, + Date: &Timestamp{referenceTime}, Name: String("n"), Email: String("e"), Login: String("u"), @@ -958,13 +958,13 @@ func TestRepositoryContentFileOptions_Marshal(t *testing.T) { SHA: String("type"), Branch: String("type"), Author: &CommitAuthor{ - Date: &referenceTime, + Date: &Timestamp{referenceTime}, Name: String("name"), Email: String("email"), Login: String("login"), }, Committer: &CommitAuthor{ - Date: &referenceTime, + Date: &Timestamp{referenceTime}, Name: String("name"), Email: String("email"), Login: String("login"), diff --git a/github/repos_hooks.go b/github/repos_hooks.go index 44eac8a4014..ba229e7bca8 100644 --- a/github/repos_hooks.go +++ b/github/repos_hooks.go @@ -11,7 +11,6 @@ import ( "net/http" "net/url" "strings" - "time" ) // WebHookPayload represents the data that is received from GitHub when a push @@ -40,8 +39,8 @@ type WebHookAuthor = CommitAuthor // Hook represents a GitHub (web and service) hook for a repository. type Hook struct { - CreatedAt *time.Time `json:"created_at,omitempty"` - UpdatedAt *time.Time `json:"updated_at,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` URL *string `json:"url,omitempty"` ID *int64 `json:"id,omitempty"` Type *string `json:"type,omitempty"` diff --git a/github/repos_hooks_test.go b/github/repos_hooks_test.go index 3c6ee6fa169..82e8b554d64 100644 --- a/github/repos_hooks_test.go +++ b/github/repos_hooks_test.go @@ -19,7 +19,7 @@ func TestRepositoriesService_CreateHook(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - input := &Hook{CreatedAt: &referenceTime} + input := &Hook{CreatedAt: &Timestamp{referenceTime}} mux.HandleFunc("/repos/o/r/hooks", func(w http.ResponseWriter, r *http.Request) { v := new(createHookRequest) @@ -525,8 +525,8 @@ func TestBranchHook_Marshal(t *testing.T) { testJSONMarshal(t, &Hook{}, "{}") v := &Hook{ - CreatedAt: &referenceTime, - UpdatedAt: &referenceTime, + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, URL: String("url"), ID: Int64(1), Type: String("type"), diff --git a/github/repos_statuses.go b/github/repos_statuses.go index 42238f3c9d9..ea3d166c753 100644 --- a/github/repos_statuses.go +++ b/github/repos_statuses.go @@ -8,7 +8,6 @@ package github import ( "context" "fmt" - "time" ) // RepoStatus represents the status of a repository at a particular reference. @@ -35,8 +34,8 @@ type RepoStatus struct { AvatarURL *string `json:"avatar_url,omitempty"` Creator *User `json:"creator,omitempty"` - CreatedAt *time.Time `json:"created_at,omitempty"` - UpdatedAt *time.Time `json:"updated_at,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` } func (r RepoStatus) String() string { diff --git a/github/repos_statuses_test.go b/github/repos_statuses_test.go index 62fe3336f3a..c9e03acb8de 100644 --- a/github/repos_statuses_test.go +++ b/github/repos_statuses_test.go @@ -163,8 +163,8 @@ func TestRepoStatus_Marshal(t *testing.T) { Context: String("ctx"), AvatarURL: String("aurl"), Creator: &User{ID: Int64(1)}, - CreatedAt: &referenceTime, - UpdatedAt: &referenceTime, + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, } want := `{ @@ -205,8 +205,8 @@ func TestCombinedStatus_Marshal(t *testing.T) { Context: String("ctx"), AvatarURL: String("aurl"), Creator: &User{ID: Int64(1)}, - CreatedAt: &referenceTime, - UpdatedAt: &referenceTime, + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, }, }, CommitURL: String("curl"), diff --git a/github/search_test.go b/github/search_test.go index 8998681eaa6..b7461753605 100644 --- a/github/search_test.go +++ b/github/search_test.go @@ -788,9 +788,9 @@ func TestIssuesSearchResult_Marshal(t *testing.T) { Labels: []*Label{{ID: Int64(1)}}, Assignee: &User{ID: Int64(1)}, Comments: Int(1), - ClosedAt: &referenceTime, - CreatedAt: &referenceTime, - UpdatedAt: &referenceTime, + ClosedAt: &Timestamp{referenceTime}, + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, ClosedBy: &User{ID: Int64(1)}, URL: String("url"), HTMLURL: String("hurl"), diff --git a/github/teams.go b/github/teams.go index 38845e0953f..963a69b3d91 100644 --- a/github/teams.go +++ b/github/teams.go @@ -10,7 +10,6 @@ import ( "fmt" "net/http" "strings" - "time" ) // TeamsService provides access to the team-related functions @@ -68,7 +67,7 @@ type Invitation struct { Email *string `json:"email,omitempty"` // Role can be one of the values - 'direct_member', 'admin', 'billing_manager', 'hiring_manager', or 'reinstate'. Role *string `json:"role,omitempty"` - CreatedAt *time.Time `json:"created_at,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` Inviter *User `json:"inviter,omitempty"` TeamCount *int `json:"team_count,omitempty"` InvitationTeamURL *string `json:"invitation_team_url,omitempty"` diff --git a/github/teams_test.go b/github/teams_test.go index 6085eac13e2..93e658af096 100644 --- a/github/teams_test.go +++ b/github/teams_test.go @@ -1709,7 +1709,7 @@ func TestInvitation_Marshal(t *testing.T) { Login: String("login123"), Email: String("go@github.com"), Role: String("developer"), - CreatedAt: &referenceTime, + CreatedAt: &Timestamp{referenceTime}, TeamCount: Int(99), InvitationTeamURL: String("url"), } diff --git a/github/users_gpg_keys.go b/github/users_gpg_keys.go index e9ce62221c7..54189b83077 100644 --- a/github/users_gpg_keys.go +++ b/github/users_gpg_keys.go @@ -8,7 +8,6 @@ package github import ( "context" "fmt" - "time" ) // GPGKey represents a GitHub user's public GPG key used to verify GPG signed commits and tags. @@ -26,8 +25,8 @@ type GPGKey struct { CanEncryptComms *bool `json:"can_encrypt_comms,omitempty"` CanEncryptStorage *bool `json:"can_encrypt_storage,omitempty"` CanCertify *bool `json:"can_certify,omitempty"` - CreatedAt *time.Time `json:"created_at,omitempty"` - ExpiresAt *time.Time `json:"expires_at,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + ExpiresAt *Timestamp `json:"expires_at,omitempty"` } // String stringifies a GPGKey. diff --git a/github/users_gpg_keys_test.go b/github/users_gpg_keys_test.go index 2cef75228b9..79ebd2d6f40 100644 --- a/github/users_gpg_keys_test.go +++ b/github/users_gpg_keys_test.go @@ -11,7 +11,6 @@ import ( "fmt" "net/http" "testing" - "time" "github.com/google/go-cmp/cmp" ) @@ -210,7 +209,7 @@ func TestGPGEmail_Marshal(t *testing.T) { func TestGPGKey_Marshal(t *testing.T) { testJSONMarshal(t, &GPGKey{}, "{}") - ti := &time.Time{} + ti := &Timestamp{} g := &GPGKey{ ID: Int64(1), From aa2c143bd174a236a7f9a578332ec091bd616691 Mon Sep 17 00:00:00 2001 From: Ilia Choly Date: Thu, 26 Jan 2023 16:45:46 -0500 Subject: [PATCH 152/751] Use NewTokenClient in tests and examples (#2644) --- example/actionpermissions/main.go | 5 +---- example/appengine/app.go | 7 +------ example/commitpr/main.go | 5 +---- example/listenvironments/main.go | 6 +----- example/migrations/main.go | 7 +------ example/newrepo/main.go | 5 +---- example/newreposecretwithlibsodium/main.go | 16 ++-------------- example/newreposecretwithxcrypto/main.go | 19 ++----------------- example/tagprotection/main.go | 8 +------- example/tokenauth/main.go | 8 +------- test/fields/fields.go | 6 +----- test/integration/github_test.go | 6 +----- 12 files changed, 14 insertions(+), 84 deletions(-) diff --git a/example/actionpermissions/main.go b/example/actionpermissions/main.go index 4c9912d9d6f..1d0bc7c7d9f 100644 --- a/example/actionpermissions/main.go +++ b/example/actionpermissions/main.go @@ -15,7 +15,6 @@ import ( "os" "github.com/google/go-github/v49/github" - "golang.org/x/oauth2" ) var ( @@ -36,9 +35,7 @@ func main() { log.Fatal("No owner: owner of repo must be given") } ctx := context.Background() - ts := oauth2.StaticTokenSource(&oauth2.Token{AccessToken: token}) - tc := oauth2.NewClient(ctx, ts) - client := github.NewClient(tc) + client := github.NewTokenClient(ctx, token) actionsPermissionsRepository, _, err := client.Repositories.GetActionsPermissions(ctx, *owner, *name) if err != nil { diff --git a/example/appengine/app.go b/example/appengine/app.go index 3ad9f122be4..03a020ca752 100644 --- a/example/appengine/app.go +++ b/example/appengine/app.go @@ -13,7 +13,6 @@ import ( "os" "github.com/google/go-github/v49/github" - "golang.org/x/oauth2" "google.golang.org/appengine" "google.golang.org/appengine/log" ) @@ -29,11 +28,7 @@ func handler(w http.ResponseWriter, r *http.Request) { } ctx := appengine.NewContext(r) - ts := oauth2.StaticTokenSource( - &oauth2.Token{AccessToken: os.Getenv("GITHUB_AUTH_TOKEN")}, - ) - tc := oauth2.NewClient(ctx, ts) - client := github.NewClient(tc) + client := github.NewTokenClient(ctx, os.Getenv("GITHUB_AUTH_TOKEN")) commits, _, err := client.Repositories.ListCommits(ctx, "google", "go-github", nil) if err != nil { diff --git a/example/commitpr/main.go b/example/commitpr/main.go index 5913ec0668d..7dbf703c9a2 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -31,7 +31,6 @@ import ( "time" "github.com/google/go-github/v49/github" - "golang.org/x/oauth2" ) var ( @@ -188,9 +187,7 @@ func main() { if *sourceOwner == "" || *sourceRepo == "" || *commitBranch == "" || *sourceFiles == "" || *authorName == "" || *authorEmail == "" { log.Fatal("You need to specify a non-empty value for the flags `-source-owner`, `-source-repo`, `-commit-branch`, `-files`, `-author-name` and `-author-email`") } - ts := oauth2.StaticTokenSource(&oauth2.Token{AccessToken: token}) - tc := oauth2.NewClient(ctx, ts) - client = github.NewClient(tc) + client = github.NewTokenClient(ctx, token) ref, err := getRef() if err != nil { diff --git a/example/listenvironments/main.go b/example/listenvironments/main.go index f86b1a2d772..674efc92715 100644 --- a/example/listenvironments/main.go +++ b/example/listenvironments/main.go @@ -19,7 +19,6 @@ import ( "os" "github.com/google/go-github/v49/github" - "golang.org/x/oauth2" ) func main() { @@ -31,11 +30,8 @@ func main() { log.Fatal("Unauthorized: No token present") } - ts := oauth2.StaticTokenSource(&oauth2.Token{AccessToken: token}) - ctx := context.Background() - tc := oauth2.NewClient(ctx, ts) - client := github.NewClient(tc) + client := github.NewTokenClient(ctx, token) expectedPageSize := 2 diff --git a/example/migrations/main.go b/example/migrations/main.go index 015e18e2a94..f9f54398956 100644 --- a/example/migrations/main.go +++ b/example/migrations/main.go @@ -13,16 +13,11 @@ import ( "fmt" "github.com/google/go-github/v49/github" - "golang.org/x/oauth2" ) func fetchAllUserMigrations() ([]*github.UserMigration, error) { ctx := context.Background() - ts := oauth2.StaticTokenSource( - &oauth2.Token{AccessToken: ""}, - ) - tc := oauth2.NewClient(ctx, ts) - client := github.NewClient(tc) + client := github.NewTokenClient(ctx, "") migrations, _, err := client.Migrations.ListUserMigrations(ctx, &github.ListOptions{Page: 1}) return migrations, err diff --git a/example/newrepo/main.go b/example/newrepo/main.go index 5f796d33702..bfea5d45eca 100644 --- a/example/newrepo/main.go +++ b/example/newrepo/main.go @@ -17,7 +17,6 @@ import ( "os" "github.com/google/go-github/v49/github" - "golang.org/x/oauth2" ) var ( @@ -37,9 +36,7 @@ func main() { log.Fatal("No name: New repos must be given a name") } ctx := context.Background() - ts := oauth2.StaticTokenSource(&oauth2.Token{AccessToken: token}) - tc := oauth2.NewClient(ctx, ts) - client := github.NewClient(tc) + client := github.NewTokenClient(ctx, token) r := &github.Repository{Name: name, Private: private, Description: description, AutoInit: autoInit} repo, _, err := client.Repositories.Create(ctx, "", r) diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index 3e932c5eee8..6c9a7cfb6dd 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -37,7 +37,6 @@ import ( sodium "github.com/GoKillers/libsodium-go/cryptobox" "github.com/google/go-github/v49/github" - "golang.org/x/oauth2" ) var ( @@ -71,7 +70,8 @@ func main() { log.Fatal(err) } - ctx, client, err := githubAuth(token) + ctx := context.Background() + client := github.NewTokenClient(ctx, token) if err != nil { log.Fatalf("unable to authorize using env GITHUB_AUTH_TOKEN: %v", err) } @@ -99,18 +99,6 @@ func getSecretValue(secretName string) (string, error) { return secretValue, nil } -// githubAuth returns a GitHub client and context. -func githubAuth(token string) (context.Context, *github.Client, error) { - ctx := context.Background() - ts := oauth2.StaticTokenSource( - &oauth2.Token{AccessToken: token}, - ) - tc := oauth2.NewClient(ctx, ts) - - client := github.NewClient(tc) - return ctx, client, nil -} - // addRepoSecret will add a secret to a GitHub repo for use in GitHub Actions. // // Finally, the secretName and secretValue will determine the name of the secret added and it's corresponding value. diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index bb688372994..b6ec1c0bdb4 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -38,7 +38,6 @@ import ( "github.com/google/go-github/v49/github" "golang.org/x/crypto/nacl/box" - "golang.org/x/oauth2" ) var ( @@ -72,10 +71,8 @@ func main() { log.Fatal(err) } - ctx, client, err := githubAuth(token) - if err != nil { - log.Fatalf("unable to authorize using env GITHUB_AUTH_TOKEN: %v", err) - } + ctx := context.Background() + client := github.NewTokenClient(ctx, token) if err := addRepoSecret(ctx, client, *owner, *repo, secretName, secretValue); err != nil { log.Fatal(err) @@ -100,18 +97,6 @@ func getSecretValue(secretName string) (string, error) { return secretValue, nil } -// githubAuth returns a GitHub client and context. -func githubAuth(token string) (context.Context, *github.Client, error) { - ctx := context.Background() - ts := oauth2.StaticTokenSource( - &oauth2.Token{AccessToken: token}, - ) - tc := oauth2.NewClient(ctx, ts) - - client := github.NewClient(tc) - return ctx, client, nil -} - // addRepoSecret will add a secret to a GitHub repo for use in GitHub Actions. // // Finally, the secretName and secretValue will determine the name of the secret added and it's corresponding value. diff --git a/example/tagprotection/main.go b/example/tagprotection/main.go index 12ec91a6685..e0e765806f8 100644 --- a/example/tagprotection/main.go +++ b/example/tagprotection/main.go @@ -21,7 +21,6 @@ import ( "github.com/google/go-github/v49/github" "golang.org/x/crypto/ssh/terminal" - "golang.org/x/oauth2" ) func main() { @@ -45,12 +44,7 @@ func main() { token := string(byteToken) ctx := context.Background() - ts := oauth2.StaticTokenSource( - &oauth2.Token{AccessToken: token}, - ) - tc := oauth2.NewClient(ctx, ts) - - client := github.NewClient(tc) + client := github.NewTokenClient(ctx, token) // create new tag protection if pattern != "" { diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index ed489d720e3..b14447c73c6 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -16,7 +16,6 @@ import ( "github.com/google/go-github/v49/github" "golang.org/x/crypto/ssh/terminal" - "golang.org/x/oauth2" ) func main() { @@ -26,12 +25,7 @@ func main() { token := string(byteToken) ctx := context.Background() - ts := oauth2.StaticTokenSource( - &oauth2.Token{AccessToken: token}, - ) - tc := oauth2.NewClient(ctx, ts) - - client := github.NewClient(tc) + client := github.NewTokenClient(ctx, token) user, resp, err := client.Users.Get(ctx, "") if err != nil { diff --git a/test/fields/fields.go b/test/fields/fields.go index 61e422f78ff..0af31648987 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -26,7 +26,6 @@ import ( "strings" "github.com/google/go-github/v49/github" - "golang.org/x/oauth2" ) var ( @@ -47,10 +46,7 @@ func main() { print("!!! No OAuth token. Some tests won't run. !!!\n\n") client = github.NewClient(nil) } else { - tc := oauth2.NewClient(context.Background(), oauth2.StaticTokenSource( - &oauth2.Token{AccessToken: token}, - )) - client = github.NewClient(tc) + client = github.NewTokenClient(context.Background(), token) auth = true } diff --git a/test/integration/github_test.go b/test/integration/github_test.go index b65f9626944..15ecbf01a6a 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -16,7 +16,6 @@ import ( "os" "github.com/google/go-github/v49/github" - "golang.org/x/oauth2" ) var ( @@ -33,10 +32,7 @@ func init() { print("!!! No OAuth token. Some tests won't run. !!!\n\n") client = github.NewClient(nil) } else { - tc := oauth2.NewClient(context.Background(), oauth2.StaticTokenSource( - &oauth2.Token{AccessToken: token}, - )) - client = github.NewClient(tc) + client = github.NewTokenClient(context.Background(), token) auth = true } } From b811c42b7982e91b4b1503b459c66a1088ba9922 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Thu, 26 Jan 2023 17:03:04 -0500 Subject: [PATCH 153/751] Bump version of go-github to v50 (#2647) --- README.md | 16 +++++++++------- example/actionpermissions/main.go | 2 +- example/appengine/app.go | 2 +- example/basicauth/main.go | 2 +- example/commitpr/main.go | 2 +- example/go.mod | 6 +++--- example/listenvironments/main.go | 2 +- example/migrations/main.go | 2 +- example/newfilewithappauth/main.go | 2 +- example/newrepo/main.go | 2 +- example/newreposecretwithlibsodium/go.mod | 4 ++-- example/newreposecretwithlibsodium/main.go | 2 +- example/newreposecretwithxcrypto/main.go | 2 +- example/simple/main.go | 2 +- example/tagprotection/main.go | 2 +- example/tokenauth/main.go | 2 +- example/topics/main.go | 2 +- github/doc.go | 2 +- github/examples_test.go | 2 +- github/github.go | 2 +- go.mod | 2 +- test/fields/fields.go | 2 +- test/integration/activity_test.go | 2 +- test/integration/authorizations_test.go | 2 +- test/integration/github_test.go | 2 +- test/integration/repos_test.go | 2 +- test/integration/users_test.go | 2 +- update-urls/go.mod | 2 +- 28 files changed, 39 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 744b11b4ac9..0e76752c82b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-github # [![go-github release (latest SemVer)](https://img.shields.io/github/v/release/google/go-github?sort=semver)](https://github.com/google/go-github/releases) -[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v49/github) +[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v50/github) [![Test Status](https://github.com/google/go-github/workflows/tests/badge.svg)](https://github.com/google/go-github/actions?query=workflow%3Atests) [![Test Coverage](https://codecov.io/gh/google/go-github/branch/master/graph/badge.svg)](https://codecov.io/gh/google/go-github) [![Discuss at go-github@googlegroups.com](https://img.shields.io/badge/discuss-go--github%40googlegroups.com-blue.svg)](https://groups.google.com/group/go-github) @@ -24,7 +24,7 @@ If you're interested in using the [GraphQL API v4][], the recommended library is go-github is compatible with modern Go releases in module mode, with Go installed: ```bash -go get github.com/google/go-github/v49 +go get github.com/google/go-github/v50 ``` will resolve and add the package to the current development module, along with its dependencies. @@ -32,7 +32,7 @@ will resolve and add the package to the current development module, along with i Alternatively the same can be achieved if you use import in a package: ```go -import "github.com/google/go-github/v49/github" +import "github.com/google/go-github/v50/github" ``` and run `go get` without parameters. @@ -40,13 +40,13 @@ and run `go get` without parameters. Finally, to use the top-of-trunk version of this repo, use the following command: ```bash -go get github.com/google/go-github/v49@master +go get github.com/google/go-github/v50@master ``` ## Usage ## ```go -import "github.com/google/go-github/v49/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) +import "github.com/google/go-github/v50/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled ``` @@ -135,7 +135,7 @@ import ( "net/http" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v49/github" + "github.com/google/go-github/v50/github" ) func main() { @@ -305,7 +305,7 @@ For complete usage of go-github, see the full [package docs][]. [oauth2]: https://github.com/golang/oauth2 [oauth2 docs]: https://godoc.org/golang.org/x/oauth2 [personal API token]: https://github.com/blog/1509-personal-api-tokens -[package docs]: https://pkg.go.dev/github.com/google/go-github/v49/github +[package docs]: https://pkg.go.dev/github.com/google/go-github/v50/github [GraphQL API v4]: https://developer.github.com/v4/ [shurcooL/githubv4]: https://github.com/shurcooL/githubv4 [GitHub webhook events]: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads @@ -378,6 +378,8 @@ Versions prior to 48.2.0 are not listed. | go-github Version | GitHub v3 API Version | | ----------------- | --------------------- | +| 50.0.0 | 2022-11-28 | +| 49.1.0 | 2022-11-28 | | 49.0.0 | 2022-11-28 | | 48.2.0 | 2022-11-28 | diff --git a/example/actionpermissions/main.go b/example/actionpermissions/main.go index 1d0bc7c7d9f..5227fd0205c 100644 --- a/example/actionpermissions/main.go +++ b/example/actionpermissions/main.go @@ -14,7 +14,7 @@ import ( "log" "os" - "github.com/google/go-github/v49/github" + "github.com/google/go-github/v50/github" ) var ( diff --git a/example/appengine/app.go b/example/appengine/app.go index 03a020ca752..21260af3f32 100644 --- a/example/appengine/app.go +++ b/example/appengine/app.go @@ -12,7 +12,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v49/github" + "github.com/google/go-github/v50/github" "google.golang.org/appengine" "google.golang.org/appengine/log" ) diff --git a/example/basicauth/main.go b/example/basicauth/main.go index bfb9c6811ef..3624b272fe2 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -22,7 +22,7 @@ import ( "strings" "syscall" - "github.com/google/go-github/v49/github" + "github.com/google/go-github/v50/github" "golang.org/x/crypto/ssh/terminal" ) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index 7dbf703c9a2..ad57d69a461 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -30,7 +30,7 @@ import ( "strings" "time" - "github.com/google/go-github/v49/github" + "github.com/google/go-github/v50/github" ) var ( diff --git a/example/go.mod b/example/go.mod index a28bcb85fdc..85db0c81f3b 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,10 +1,10 @@ -module github.com/google/go-github/v49/example +module github.com/google/go-github/v50/example go 1.17 require ( github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 - github.com/google/go-github/v49 v49.0.0 + github.com/google/go-github/v50 v50.0.0 golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be google.golang.org/appengine v1.6.7 @@ -21,4 +21,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v49 => ../ +replace github.com/google/go-github/v50 => ../ diff --git a/example/listenvironments/main.go b/example/listenvironments/main.go index 674efc92715..655341e0ce3 100644 --- a/example/listenvironments/main.go +++ b/example/listenvironments/main.go @@ -18,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v49/github" + "github.com/google/go-github/v50/github" ) func main() { diff --git a/example/migrations/main.go b/example/migrations/main.go index f9f54398956..daa90d3c085 100644 --- a/example/migrations/main.go +++ b/example/migrations/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v49/github" + "github.com/google/go-github/v50/github" ) func fetchAllUserMigrations() ([]*github.UserMigration, error) { diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index 0e64d93d999..f67bbe9a96a 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -16,7 +16,7 @@ import ( "time" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v49/github" + "github.com/google/go-github/v50/github" "golang.org/x/oauth2" ) diff --git a/example/newrepo/main.go b/example/newrepo/main.go index bfea5d45eca..65a35739245 100644 --- a/example/newrepo/main.go +++ b/example/newrepo/main.go @@ -16,7 +16,7 @@ import ( "log" "os" - "github.com/google/go-github/v49/github" + "github.com/google/go-github/v50/github" ) var ( diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index 04ff0c1604b..8f2bcfcdbca 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -4,9 +4,9 @@ go 1.15 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb - github.com/google/go-github/v49 v49.0.0 + github.com/google/go-github/v50 v50.0.0 golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v49 => ../.. +replace github.com/google/go-github/v50 => ../.. diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index 6c9a7cfb6dd..8d3b17aafd1 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -36,7 +36,7 @@ import ( "os" sodium "github.com/GoKillers/libsodium-go/cryptobox" - "github.com/google/go-github/v49/github" + "github.com/google/go-github/v50/github" ) var ( diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index b6ec1c0bdb4..a0b850b9359 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -36,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v49/github" + "github.com/google/go-github/v50/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/simple/main.go b/example/simple/main.go index 29b22ecce62..19405859507 100644 --- a/example/simple/main.go +++ b/example/simple/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v49/github" + "github.com/google/go-github/v50/github" ) // Fetch all the public organizations' membership of a user. diff --git a/example/tagprotection/main.go b/example/tagprotection/main.go index e0e765806f8..41b605e28f1 100644 --- a/example/tagprotection/main.go +++ b/example/tagprotection/main.go @@ -19,7 +19,7 @@ import ( "strings" "syscall" - "github.com/google/go-github/v49/github" + "github.com/google/go-github/v50/github" "golang.org/x/crypto/ssh/terminal" ) diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index b14447c73c6..1cff2c7879a 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -14,7 +14,7 @@ import ( "log" "syscall" - "github.com/google/go-github/v49/github" + "github.com/google/go-github/v50/github" "golang.org/x/crypto/ssh/terminal" ) diff --git a/example/topics/main.go b/example/topics/main.go index 489b9c71635..d8237da53e4 100644 --- a/example/topics/main.go +++ b/example/topics/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v49/github" + "github.com/google/go-github/v50/github" ) // Fetch and lists all the public topics associated with the specified GitHub topic diff --git a/github/doc.go b/github/doc.go index 1401f07fb6e..9adfea8fe97 100644 --- a/github/doc.go +++ b/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v49/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v50/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to diff --git a/github/examples_test.go b/github/examples_test.go index efd4f024917..40a96b94f4f 100644 --- a/github/examples_test.go +++ b/github/examples_test.go @@ -12,7 +12,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v49/github" + "github.com/google/go-github/v50/github" ) func ExampleClient_Markdown() { diff --git a/github/github.go b/github/github.go index aebfaf7bed5..629218165c7 100644 --- a/github/github.go +++ b/github/github.go @@ -28,7 +28,7 @@ import ( ) const ( - Version = "v49.1.0" + Version = "v50.0.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" diff --git a/go.mod b/go.mod index 4f7880fd8ba..ceb9aff090e 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v49 +module github.com/google/go-github/v50 require ( github.com/google/go-cmp v0.5.9 diff --git a/test/fields/fields.go b/test/fields/fields.go index 0af31648987..dd21cc8ccc8 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -25,7 +25,7 @@ import ( "reflect" "strings" - "github.com/google/go-github/v49/github" + "github.com/google/go-github/v50/github" ) var ( diff --git a/test/integration/activity_test.go b/test/integration/activity_test.go index c89cf2480d6..669d775d319 100644 --- a/test/integration/activity_test.go +++ b/test/integration/activity_test.go @@ -12,7 +12,7 @@ import ( "context" "testing" - "github.com/google/go-github/v49/github" + "github.com/google/go-github/v50/github" ) const ( diff --git a/test/integration/authorizations_test.go b/test/integration/authorizations_test.go index b2b313f8eec..d94a7506671 100644 --- a/test/integration/authorizations_test.go +++ b/test/integration/authorizations_test.go @@ -17,7 +17,7 @@ import ( "testing" "time" - "github.com/google/go-github/v49/github" + "github.com/google/go-github/v50/github" ) const msgEnvMissing = "Skipping test because the required environment variable (%v) is not present." diff --git a/test/integration/github_test.go b/test/integration/github_test.go index 15ecbf01a6a..892a7178c49 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -15,7 +15,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v49/github" + "github.com/google/go-github/v50/github" ) var ( diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index e4ccfce2619..8efed472da5 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -15,7 +15,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v49/github" + "github.com/google/go-github/v50/github" ) func TestRepositories_CRUD(t *testing.T) { diff --git a/test/integration/users_test.go b/test/integration/users_test.go index 0be9cce2ddb..d8448965808 100644 --- a/test/integration/users_test.go +++ b/test/integration/users_test.go @@ -14,7 +14,7 @@ import ( "math/rand" "testing" - "github.com/google/go-github/v49/github" + "github.com/google/go-github/v50/github" ) func TestUsers_Get(t *testing.T) { diff --git a/update-urls/go.mod b/update-urls/go.mod index d01d8de96c6..d7419e28129 100644 --- a/update-urls/go.mod +++ b/update-urls/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v49/update-urls +module github.com/google/go-github/v50/update-urls go 1.16 From a67a565df73791b204864b289dc9fa4b4a566384 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Thu, 26 Jan 2023 19:17:19 -0500 Subject: [PATCH 154/751] Update scrape dependency to v50 (#2648) --- scrape/apps.go | 2 +- scrape/apps_test.go | 2 +- scrape/go.mod | 2 +- scrape/go.sum | 7 +++++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/scrape/apps.go b/scrape/apps.go index 693addeb33d..48480a3d807 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -17,7 +17,7 @@ import ( "strings" "github.com/PuerkitoBio/goquery" - "github.com/google/go-github/v49/github" + "github.com/google/go-github/v50/github" ) // AppRestrictionsEnabled returns whether the specified organization has diff --git a/scrape/apps_test.go b/scrape/apps_test.go index 6750f807392..779ffdbbd33 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v49/github" + "github.com/google/go-github/v50/github" ) func Test_AppRestrictionsEnabled(t *testing.T) { diff --git a/scrape/go.mod b/scrape/go.mod index 3facac41259..67b1fa9f7ae 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.9 - github.com/google/go-github/v49 v49.1.0 + github.com/google/go-github/v50 v50.0.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 024869e76a4..824ec0544b9 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -3,12 +3,13 @@ github.com/PuerkitoBio/goquery v1.8.0/go.mod h1:ypIiRMtY7COPGk+I/YbZLbxsxn9g5ejn github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c= github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v49 v49.1.0 h1:LFkMgawGQ8dfzWLH/rNE0b3u1D3n6/dw7ZmrN3b+YFY= -github.com/google/go-github/v49 v49.1.0/go.mod h1:MUUzHPrhGniB6vUKa27y37likpipzG+BXXJbG04J334= +github.com/google/go-github/v50 v50.0.0 h1:gdO1AeuSZZK4iYWwVbjni7zg8PIQhp7QfmPunr016Jk= +github.com/google/go-github/v50 v50.0.0/go.mod h1:Ev4Tre8QoKiolvbpOSG3FIi4Mlon3S2Nt9W5JYqKiwA= 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= @@ -20,6 +21,7 @@ golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210916014120-12bc252f5db8 h1:/6y1LfuqNuQdHAm0jjtPtgRcxIxjVZgm5OTu8/QhZvk= golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -32,4 +34,5 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= From da244a46bd86e17b8f103b6ded6833359821d8e9 Mon Sep 17 00:00:00 2001 From: "Gal Ofri @ Legit Security" Date: Mon, 30 Jan 2023 15:31:33 +0200 Subject: [PATCH 155/751] Add secondary rate limit handling (prevent remote requests) and fix primary rate limit categories (#2635) Fixes: #2633. --- README.md | 18 +++ example/go.mod | 1 + example/go.sum | 2 + example/ratelimit/main.go | 42 +++++++ github/code-scanning_test.go | 2 +- github/github.go | 77 +++++++++++- github/github_test.go | 233 ++++++++++++++++++++++++++++++----- 7 files changed, 340 insertions(+), 35 deletions(-) create mode 100644 example/ratelimit/main.go diff --git a/README.md b/README.md index 0e76752c82b..461ae4d02da 100644 --- a/README.md +++ b/README.md @@ -186,6 +186,24 @@ if _, ok := err.(*github.RateLimitError); ok { Learn more about GitHub rate limiting at https://docs.github.com/en/rest/rate-limit . +In addition to these rate limits, GitHub imposes a secondary rate limit on all API clients. +This rate limit prevents clients from making too many concurrent requests. + +To detect an API secondary rate limit error, you can check if its type is `*github.AbuseRateLimitError`: + +```go +repos, _, err := client.Repositories.List(ctx, "", nil) +if _, ok := err.(*github.AbuseRateLimitError); ok { + log.Println("hit secondary rate limit") +} +``` + +You can use [go-github-ratelimit](https://github.com/gofri/go-github-ratelimit) to handle +secondary rate limit sleep-and-retry for you. + +Learn more about GitHub secondary rate limiting at +https://docs.github.com/en/rest/overview/resources-in-the-rest-api#secondary-rate-limits . + ### Accepted Status ### Some endpoints may return a 202 Accepted status code, meaning that the diff --git a/example/go.mod b/example/go.mod index 85db0c81f3b..e268c7ad626 100644 --- a/example/go.mod +++ b/example/go.mod @@ -4,6 +4,7 @@ go 1.17 require ( github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 + github.com/gofri/go-github-ratelimit v1.0.1 github.com/google/go-github/v50 v50.0.0 golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be diff --git a/example/go.sum b/example/go.sum index 663dff29860..1043059ffa2 100644 --- a/example/go.sum +++ b/example/go.sum @@ -1,5 +1,7 @@ github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 h1:tXKVfhE7FcSkhkv0UwkLvPDeZ4kz6OXd0PKPlFqf81M= github.com/bradleyfalzon/ghinstallation/v2 v2.0.4/go.mod h1:B40qPqJxWE0jDZgOR1JmaMy+4AY1eBP+IByOvqyAKp0= +github.com/gofri/go-github-ratelimit v1.0.1 h1:sgefSzxhnvwZ+wR9uZ4l9TnjgLuNiwipJVzJL4YLj9A= +github.com/gofri/go-github-ratelimit v1.0.1/go.mod h1:OnCi5gV+hAG/LMR7llGhU7yHt44se9sYgKPnafoL7RY= github.com/golang-jwt/jwt/v4 v4.0.0 h1:RAqyYixv1p7uEnocuy8P1nru5wprCh/MH2BIlW5z5/o= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= diff --git a/example/ratelimit/main.go b/example/ratelimit/main.go new file mode 100644 index 00000000000..228099faa9f --- /dev/null +++ b/example/ratelimit/main.go @@ -0,0 +1,42 @@ +// Copyright 2023 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 ratelimit command demonstrates using the github_ratelimit.SecondaryRateLimitWaiter. +// By using the waiter, the client automatically sleeps and retry requests +// when it hits secondary rate limits. +package main + +import ( + "context" + "fmt" + + "github.com/gofri/go-github-ratelimit/github_ratelimit" + "github.com/google/go-github/v50/github" +) + +func main() { + var username string + fmt.Print("Enter GitHub username: ") + fmt.Scanf("%s", &username) + + rateLimiter, err := github_ratelimit.NewRateLimitWaiterClient(nil) + if err != nil { + fmt.Printf("Error: %v\n", err) + return + } + + client := github.NewClient(rateLimiter) + + // arbitrary usage of the client + organizations, _, err := client.Organizations.List(context.Background(), username, nil) + if err != nil { + fmt.Printf("Error: %v\n", err) + return + } + + for i, organization := range organizations { + fmt.Printf("%v. %v\n", i+1, organization.GetLogin()) + } +} diff --git a/github/code-scanning_test.go b/github/code-scanning_test.go index 1ae05096d3f..7911fca6360 100644 --- a/github/code-scanning_test.go +++ b/github/code-scanning_test.go @@ -83,7 +83,7 @@ func TestCodeScanningService_UploadSarif(t *testing.T) { return err }) - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + testNewRequestAndDoFailureCategory(t, methodName, client, codeScanningUploadCategory, func() (*Response, error) { _, resp, err := client.CodeScanning.UploadSarif(ctx, "o", "r", sarifAnalysis) return resp, err }) diff --git a/github/github.go b/github/github.go index 629218165c7..6b37f082cf6 100644 --- a/github/github.go +++ b/github/github.go @@ -171,8 +171,9 @@ type Client struct { // User agent used when communicating with the GitHub API. UserAgent string - rateMu sync.Mutex - rateLimits [categories]Rate // Rate limits for the client as determined by the most recent API calls. + rateMu sync.Mutex + rateLimits [categories]Rate // Rate limits for the client as determined by the most recent API calls. + secondaryRateLimitReset time.Time // Secondary rate limit reset for the client as determined by the most recent API calls. common service // Reuse a single struct instead of allocating one for each service on the heap. @@ -702,7 +703,7 @@ func (c *Client) BareDo(ctx context.Context, req *http.Request) (*Response, erro req = withContext(ctx, req) - rateLimitCategory := category(req.URL.Path) + rateLimitCategory := category(req.Method, req.URL.Path) if bypass := ctx.Value(bypassRateLimitCheck); bypass == nil { // If we've hit rate limit, don't make further requests before Reset time. @@ -712,6 +713,12 @@ func (c *Client) BareDo(ctx context.Context, req *http.Request) (*Response, erro Rate: err.Rate, }, err } + // If we've hit a secondary rate limit, don't make further requests before Retry After. + if err := c.checkSecondaryRateLimitBeforeDo(ctx, req); err != nil { + return &Response{ + Response: err.Response, + }, err + } } resp, err := c.client.Do(req) @@ -763,6 +770,14 @@ func (c *Client) BareDo(ctx context.Context, req *http.Request) (*Response, erro aerr.Raw = b err = aerr } + + // Update the secondary rate limit if we hit it. + rerr, ok := err.(*AbuseRateLimitError) + if ok && rerr.RetryAfter != nil { + c.rateMu.Lock() + c.secondaryRateLimitReset = time.Now().Add(*rerr.RetryAfter) + c.rateMu.Unlock() + } } return response, err } @@ -827,6 +842,35 @@ func (c *Client) checkRateLimitBeforeDo(req *http.Request, rateLimitCategory rat return nil } +// checkSecondaryRateLimitBeforeDo does not make any network calls, but uses existing knowledge from +// current client state in order to quickly check if *AbuseRateLimitError can be immediately returned +// from Client.Do, and if so, returns it so that Client.Do can skip making a network API call unnecessarily. +// Otherwise it returns nil, and Client.Do should proceed normally. +func (c *Client) checkSecondaryRateLimitBeforeDo(ctx context.Context, req *http.Request) *AbuseRateLimitError { + c.rateMu.Lock() + secondary := c.secondaryRateLimitReset + c.rateMu.Unlock() + if !secondary.IsZero() && time.Now().Before(secondary) { + // Create a fake response. + resp := &http.Response{ + Status: http.StatusText(http.StatusForbidden), + StatusCode: http.StatusForbidden, + Request: req, + Header: make(http.Header), + Body: io.NopCloser(strings.NewReader("")), + } + + retryAfter := time.Until(secondary) + return &AbuseRateLimitError{ + Response: resp, + Message: fmt.Sprintf("API secondary rate limit exceeded until %v, not making remote request.", secondary), + RetryAfter: &retryAfter, + } + } + + return nil +} + // compareHTTPResponse returns whether two http.Response objects are equal or not. // Currently, only StatusCode is checked. This function is used when implementing the // Is(error) bool interface for the custom error types in this package. @@ -1197,13 +1241,36 @@ const ( categories // An array of this length will be able to contain all rate limit categories. ) -// category returns the rate limit category of the endpoint, determined by Request.URL.Path. -func category(path string) rateLimitCategory { +// category returns the rate limit category of the endpoint, determined by HTTP method and Request.URL.Path. +func category(method, path string) rateLimitCategory { switch { + // https://docs.github.com/en/rest/rate-limit#about-rate-limits default: + // NOTE: coreCategory is returned for actionsRunnerRegistrationCategory too, + // because no API found for this category. return coreCategory case strings.HasPrefix(path, "/search/"): return searchCategory + case path == "/graphql": + return graphqlCategory + case strings.HasPrefix(path, "/app-manifests/") && + strings.HasSuffix(path, "/conversions") && + method == http.MethodPost: + return integrationManifestCategory + + // https://docs.github.com/en/rest/migrations/source-imports#start-an-import + case strings.HasPrefix(path, "/repos/") && + strings.HasSuffix(path, "/import") && + method == http.MethodPut: + return sourceImportCategory + + // https://docs.github.com/en/rest/code-scanning#upload-an-analysis-as-sarif-data + case strings.HasSuffix(path, "/code-scanning/sarifs"): + return codeScanningUploadCategory + + // https://docs.github.com/en/enterprise-cloud@latest/rest/scim + case strings.HasPrefix(path, "/scim/"): + return scimCategory } } diff --git a/github/github_test.go b/github/github_test.go index 50ecd5435bc..7342e2dfd79 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -185,6 +185,11 @@ func testBadOptions(t *testing.T, methodName string, f func() error) { // Method f should be a regular call that would normally succeed, but // should return an error when NewRequest or s.client.Do fails. func testNewRequestAndDoFailure(t *testing.T, methodName string, client *Client, f func() (*Response, error)) { + testNewRequestAndDoFailureCategory(t, methodName, client, coreCategory, f) +} + +// testNewRequestAndDoFailureCategory works Like testNewRequestAndDoFailure, but allows setting the category +func testNewRequestAndDoFailureCategory(t *testing.T, methodName string, client *Client, category rateLimitCategory, f func() (*Response, error)) { t.Helper() if methodName == "" { t.Error("testNewRequestAndDoFailure: must supply method methodName") @@ -200,7 +205,7 @@ func testNewRequestAndDoFailure(t *testing.T, methodName string, client *Client, } client.BaseURL.Path = "/api-v3/" - client.rateLimits[0].Reset.Time = time.Now().Add(10 * time.Minute) + client.rateLimits[category].Reset.Time = time.Now().Add(10 * time.Minute) resp, err = f() if bypass := resp.Request.Context().Value(bypassRateLimitCheck); bypass != nil { return @@ -1136,6 +1141,67 @@ func TestDo_rateLimit(t *testing.T) { } } +func TestDo_rateLimitCategory(t *testing.T) { + tests := []struct { + method string + url string + category rateLimitCategory + }{ + { + method: http.MethodGet, + url: "/", + category: coreCategory, + }, + { + method: http.MethodGet, + url: "/search/issues?q=rate", + category: searchCategory, + }, + { + method: http.MethodGet, + url: "/graphql", + category: graphqlCategory, + }, + { + method: http.MethodPost, + url: "/app-manifests/code/conversions", + category: integrationManifestCategory, + }, + { + method: http.MethodGet, + url: "/app-manifests/code/conversions", + category: coreCategory, // only POST requests are in the integration manifest category + }, + { + method: http.MethodPut, + url: "/repos/google/go-github/import", + category: sourceImportCategory, + }, + { + method: http.MethodGet, + url: "/repos/google/go-github/import", + category: coreCategory, // only PUT requests are in the source import category + }, + { + method: http.MethodPost, + url: "/repos/google/go-github/code-scanning/sarifs", + category: codeScanningUploadCategory, + }, + { + method: http.MethodGet, + url: "/scim/v2/organizations/ORG/Users", + category: scimCategory, + }, + // missing a check for actionsRunnerRegistrationCategory: API not found + } + + for _, tt := range tests { + if got, want := category(tt.method, tt.url), tt.category; got != want { + t.Errorf("expecting category %v, found %v", got, want) + } + } +} + // ensure rate limit is still parsed, even for error responses func TestDo_rateLimit_errorResponse(t *testing.T) { client, mux, _, teardown := setup() @@ -1407,6 +1473,25 @@ func TestDo_rateLimit_abuseRateLimitError_retryAfter(t *testing.T) { if got, want := *abuseRateLimitErr.RetryAfter, 123*time.Second; got != want { t.Errorf("abuseRateLimitErr RetryAfter = %v, want %v", got, want) } + + // expect prevention of a following request + if _, err = client.Do(ctx, req, nil); err == nil { + t.Error("Expected error to be returned.") + } + abuseRateLimitErr, ok = err.(*AbuseRateLimitError) + if !ok { + t.Fatalf("Expected a *AbuseRateLimitError error; got %#v.", err) + } + if abuseRateLimitErr.RetryAfter == nil { + t.Fatalf("abuseRateLimitErr RetryAfter is nil, expected not-nil") + } + // the saved duration might be a bit smaller than Retry-After because the duration is calculated from the expected end-of-cooldown time + if got, want := *abuseRateLimitErr.RetryAfter, 123*time.Second; want-got > 1*time.Second { + t.Errorf("abuseRateLimitErr RetryAfter = %v, want %v", got, want) + } + if got, wantSuffix := abuseRateLimitErr.Message, "not making remote request."; !strings.HasSuffix(got, wantSuffix) { + t.Errorf("Expected request to be prevented because of secondary rate limit, got: %v.", got) + } } func TestDo_noContent(t *testing.T) { @@ -2065,30 +2150,48 @@ func TestRateLimits(t *testing.T) { if !cmp.Equal(rate, want) { t.Errorf("RateLimits returned %+v, want %+v", rate, want) } - - if got, want := client.rateLimits[coreCategory], *want.Core; got != want { - t.Errorf("client.rateLimits[coreCategory] is %+v, want %+v", got, want) - } - if got, want := client.rateLimits[searchCategory], *want.Search; got != want { - t.Errorf("client.rateLimits[searchCategory] is %+v, want %+v", got, want) - } - if got, want := client.rateLimits[graphqlCategory], *want.GraphQL; got != want { - t.Errorf("client.rateLimits[graphqlCategory] is %+v, want %+v", got, want) - } - if got, want := client.rateLimits[integrationManifestCategory], *want.IntegrationManifest; got != want { - t.Errorf("client.rateLimits[integrationManifestCategory] is %+v, want %+v", got, want) - } - if got, want := client.rateLimits[sourceImportCategory], *want.SourceImport; got != want { - t.Errorf("client.rateLimits[sourceImportCategory] is %+v, want %+v", got, want) - } - if got, want := client.rateLimits[codeScanningUploadCategory], *want.CodeScanningUpload; got != want { - t.Errorf("client.rateLimits[codeScanningUploadCategory] is %+v, want %+v", got, want) - } - if got, want := client.rateLimits[actionsRunnerRegistrationCategory], *want.ActionsRunnerRegistration; got != want { - t.Errorf("client.rateLimits[actionsRunnerRegistrationCategory] is %+v, want %+v", got, want) + tests := []struct { + category rateLimitCategory + rate *Rate + }{ + { + category: coreCategory, + rate: want.Core, + }, + { + category: searchCategory, + rate: want.Search, + }, + { + category: graphqlCategory, + rate: want.GraphQL, + }, + { + category: integrationManifestCategory, + rate: want.IntegrationManifest, + }, + { + category: sourceImportCategory, + rate: want.SourceImport, + }, + { + category: codeScanningUploadCategory, + rate: want.CodeScanningUpload, + }, + { + category: actionsRunnerRegistrationCategory, + rate: want.ActionsRunnerRegistration, + }, + { + category: scimCategory, + rate: want.SCIM, + }, } - if got, want := client.rateLimits[scimCategory], *want.SCIM; got != want { - t.Errorf("client.rateLimits[scimCategory] is %+v, want %+v", got, want) + + for _, tt := range tests { + if got, want := client.rateLimits[tt.category], *tt.rate; got != want { + t.Errorf("client.rateLimits[%v] is %+v, want %+v", tt.category, got, want) + } } } @@ -2117,7 +2220,13 @@ func TestRateLimits_overQuota(t *testing.T) { mux.HandleFunc("/rate_limit", func(w http.ResponseWriter, r *http.Request) { fmt.Fprint(w, `{"resources":{ "core": {"limit":2,"remaining":1,"reset":1372700873}, - "search": {"limit":3,"remaining":2,"reset":1372700874} + "search": {"limit":3,"remaining":2,"reset":1372700874}, + "graphql": {"limit":4,"remaining":3,"reset":1372700875}, + "integration_manifest": {"limit":5,"remaining":4,"reset":1372700876}, + "source_import": {"limit":6,"remaining":5,"reset":1372700877}, + "code_scanning_upload": {"limit":7,"remaining":6,"reset":1372700878}, + "actions_runner_registration": {"limit":8,"remaining":7,"reset":1372700879}, + "scim": {"limit":9,"remaining":8,"reset":1372700880} }}`) }) @@ -2138,16 +2247,82 @@ func TestRateLimits_overQuota(t *testing.T) { Remaining: 2, Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 54, 0, time.UTC).Local()}, }, + GraphQL: &Rate{ + Limit: 4, + Remaining: 3, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 55, 0, time.UTC).Local()}, + }, + IntegrationManifest: &Rate{ + Limit: 5, + Remaining: 4, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 56, 0, time.UTC).Local()}, + }, + SourceImport: &Rate{ + Limit: 6, + Remaining: 5, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 57, 0, time.UTC).Local()}, + }, + CodeScanningUpload: &Rate{ + Limit: 7, + Remaining: 6, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 58, 0, time.UTC).Local()}, + }, + ActionsRunnerRegistration: &Rate{ + Limit: 8, + Remaining: 7, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 59, 0, time.UTC).Local()}, + }, + SCIM: &Rate{ + Limit: 9, + Remaining: 8, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 48, 00, 0, time.UTC).Local()}, + }, } if !cmp.Equal(rate, want) { t.Errorf("RateLimits returned %+v, want %+v", rate, want) } - if got, want := client.rateLimits[coreCategory], *want.Core; got != want { - t.Errorf("client.rateLimits[coreCategory] is %+v, want %+v", got, want) + tests := []struct { + category rateLimitCategory + rate *Rate + }{ + { + category: coreCategory, + rate: want.Core, + }, + { + category: searchCategory, + rate: want.Search, + }, + { + category: graphqlCategory, + rate: want.GraphQL, + }, + { + category: integrationManifestCategory, + rate: want.IntegrationManifest, + }, + { + category: sourceImportCategory, + rate: want.SourceImport, + }, + { + category: codeScanningUploadCategory, + rate: want.CodeScanningUpload, + }, + { + category: actionsRunnerRegistrationCategory, + rate: want.ActionsRunnerRegistration, + }, + { + category: scimCategory, + rate: want.SCIM, + }, } - if got, want := client.rateLimits[searchCategory], *want.Search; got != want { - t.Errorf("client.rateLimits[searchCategory] is %+v, want %+v", got, want) + for _, tt := range tests { + if got, want := client.rateLimits[tt.category], *tt.rate; got != want { + t.Errorf("client.rateLimits[%v] is %+v, want %+v", tt.category, got, want) + } } } From 8eac70f648ac7538924c026bc2104cc6a51eaf76 Mon Sep 17 00:00:00 2001 From: Christoph Jerolimov Date: Wed, 1 Feb 2023 03:51:43 +0100 Subject: [PATCH 156/751] Fix parse token expiration (#2650) Fixes: #2649 . --- github/github.go | 16 +++++++++++----- github/github_test.go | 12 +++++++++++- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/github/github.go b/github/github.go index 6b37f082cf6..a24d39dee4e 100644 --- a/github/github.go +++ b/github/github.go @@ -571,7 +571,8 @@ type Response struct { // propagate to Response. Rate Rate - // token's expiration date + // token's expiration date. Timestamp is 0001-01-01 when token doesn't expire. + // So it is valid for TokenExpiration.Equal(Timestamp{}) or TokenExpiration.Time.After(time.Now()) TokenExpiration Timestamp } @@ -672,14 +673,19 @@ func parseRate(r *http.Response) Rate { } // parseTokenExpiration parses the TokenExpiration related headers. +// Returns 0001-01-01 if the header is not defined or could not be parsed. func parseTokenExpiration(r *http.Response) Timestamp { - var exp Timestamp if v := r.Header.Get(headerTokenExpiration); v != "" { - if t, err := time.Parse("2006-01-02 03:04:05 MST", v); err == nil { - exp = Timestamp{t.Local()} + if t, err := time.Parse("2006-01-02 15:04:05 MST", v); err == nil { + return Timestamp{t.Local()} + } + // Some tokens include the timezone offset instead of the timezone. + // https://github.com/google/go-github/issues/2649 + if t, err := time.Parse("2006-01-02 15:04:05 -0700", v); err == nil { + return Timestamp{t.Local()} } } - return exp + return Timestamp{} // 0001-01-01 00:00:00 } type requestContext uint8 diff --git a/github/github_test.go b/github/github_test.go index 7342e2dfd79..0c969404341 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -2860,6 +2860,16 @@ func TestParseTokenExpiration(t *testing.T) { header: "2021-09-03 02:34:04 UTC", want: Timestamp{time.Date(2021, time.September, 3, 2, 34, 4, 0, time.UTC)}, }, + { + header: "2021-09-03 14:34:04 UTC", + want: Timestamp{time.Date(2021, time.September, 3, 14, 34, 4, 0, time.UTC)}, + }, + // Some tokens include the timezone offset instead of the timezone. + // https://github.com/google/go-github/issues/2649 + { + header: "2023-04-26 20:23:26 +0200", + want: Timestamp{time.Date(2023, time.April, 26, 18, 23, 26, 0, time.UTC)}, + }, } for _, tt := range tests { @@ -2871,7 +2881,7 @@ func TestParseTokenExpiration(t *testing.T) { res.Header.Set(headerTokenExpiration, tt.header) exp := parseTokenExpiration(res) if !exp.Equal(tt.want) { - t.Errorf("parseTokenExpiration returned %#v, want %#v", exp, tt.want) + t.Errorf("parseTokenExpiration of %q\nreturned %#v\n want %#v", tt.header, exp, tt.want) } } } From 72dd8ad734d4c10072d88321bfa91a6dea76181c Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Wed, 1 Feb 2023 16:15:28 +0100 Subject: [PATCH 157/751] Add support for actions variables (#2652) Fixes: #2624. --- github/actions_variables.go | 293 ++++++++++++++ github/actions_variables_test.go | 659 +++++++++++++++++++++++++++++++ github/github-accessors.go | 40 ++ github/github-accessors_test.go | 47 +++ 4 files changed, 1039 insertions(+) create mode 100644 github/actions_variables.go create mode 100644 github/actions_variables_test.go diff --git a/github/actions_variables.go b/github/actions_variables.go new file mode 100644 index 00000000000..29445edd042 --- /dev/null +++ b/github/actions_variables.go @@ -0,0 +1,293 @@ +// Copyright 2023 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" +) + +// ActionsVariable represents a repository action variable. +type ActionsVariable struct { + Name string `json:"name"` + Value string `json:"value"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + Visibility *string `json:"visibility,omitempty"` + // Used by ListOrgVariables and GetOrgVariables + SelectedRepositoriesURL *string `json:"selected_repositories_url,omitempty"` + // Used by UpdateOrgVariable and CreateOrgVariable + SelectedRepositoryIDs *SelectedRepoIDs `json:"selected_repository_ids,omitempty"` +} + +// ActionsVariables represents one item from the ListVariables response. +type ActionsVariables struct { + TotalCount int `json:"total_count"` + Variables []*ActionsVariable `json:"variables"` +} + +func (s *ActionsService) listVariables(ctx context.Context, url string, opts *ListOptions) (*ActionsVariables, *Response, error) { + u, err := addOptions(url, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + variables := new(ActionsVariables) + resp, err := s.client.Do(ctx, req, &variables) + if err != nil { + return nil, resp, err + } + + return variables, resp, nil +} + +// ListRepoVariables lists all variables available in a repository. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#list-repository-variables +func (s *ActionsService) ListRepoVariables(ctx context.Context, owner, repo string, opts *ListOptions) (*ActionsVariables, *Response, error) { + url := fmt.Sprintf("repos/%v/%v/actions/variables", owner, repo) + return s.listVariables(ctx, url, opts) +} + +// ListOrgVariables lists all variables available in an organization. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#list-organization-variables +func (s *ActionsService) ListOrgVariables(ctx context.Context, org string, opts *ListOptions) (*ActionsVariables, *Response, error) { + url := fmt.Sprintf("orgs/%v/actions/variables", org) + return s.listVariables(ctx, url, opts) +} + +// ListEnvVariables lists all variables available in an environment. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#list-environment-variables +func (s *ActionsService) ListEnvVariables(ctx context.Context, repoID int, env string, opts *ListOptions) (*ActionsVariables, *Response, error) { + url := fmt.Sprintf("repositories/%v/environments/%v/variables", repoID, env) + return s.listVariables(ctx, url, opts) +} + +func (s *ActionsService) getVariable(ctx context.Context, url string) (*ActionsVariable, *Response, error) { + req, err := s.client.NewRequest("GET", url, nil) + if err != nil { + return nil, nil, err + } + + variable := new(ActionsVariable) + resp, err := s.client.Do(ctx, req, variable) + if err != nil { + return nil, resp, err + } + + return variable, resp, nil +} + +// GetRepoVariable gets a single repository variable. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#get-a-repository-variable +func (s *ActionsService) GetRepoVariable(ctx context.Context, owner, repo, name string) (*ActionsVariable, *Response, error) { + url := fmt.Sprintf("repos/%v/%v/actions/variables/%v", owner, repo, name) + return s.getVariable(ctx, url) +} + +// GetOrgVariable gets a single organization variable. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#get-an-organization-variable +func (s *ActionsService) GetOrgVariable(ctx context.Context, org, name string) (*ActionsVariable, *Response, error) { + url := fmt.Sprintf("orgs/%v/actions/variables/%v", org, name) + return s.getVariable(ctx, url) +} + +// GetEnvVariable gets a single environment variable. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#get-an-environment-variable +func (s *ActionsService) GetEnvVariable(ctx context.Context, repoID int, env, variableName string) (*ActionsVariable, *Response, error) { + url := fmt.Sprintf("repositories/%v/environments/%v/variables/%v", repoID, env, variableName) + return s.getVariable(ctx, url) +} + +func (s *ActionsService) postVariable(ctx context.Context, url string, variable *ActionsVariable) (*Response, error) { + req, err := s.client.NewRequest("POST", url, variable) + if err != nil { + return nil, err + } + return s.client.Do(ctx, req, nil) +} + +// CreateRepoVariable creates a repository variable. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#create-a-repository-variable +func (s *ActionsService) CreateRepoVariable(ctx context.Context, owner, repo string, variable *ActionsVariable) (*Response, error) { + url := fmt.Sprintf("repos/%v/%v/actions/variables", owner, repo) + return s.postVariable(ctx, url, variable) +} + +// CreateOrgVariable creates an organization variable. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#create-an-organization-variable +func (s *ActionsService) CreateOrgVariable(ctx context.Context, org string, variable *ActionsVariable) (*Response, error) { + url := fmt.Sprintf("orgs/%v/actions/variables", org) + return s.postVariable(ctx, url, variable) +} + +// CreateEnvVariable creates an environment variable. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#create-an-environment-variable +func (s *ActionsService) CreateEnvVariable(ctx context.Context, repoID int, env string, variable *ActionsVariable) (*Response, error) { + url := fmt.Sprintf("repositories/%v/environments/%v/variables", repoID, env) + return s.postVariable(ctx, url, variable) +} + +func (s *ActionsService) patchVariable(ctx context.Context, url string, variable *ActionsVariable) (*Response, error) { + req, err := s.client.NewRequest("PATCH", url, variable) + if err != nil { + return nil, err + } + return s.client.Do(ctx, req, nil) +} + +// UpdateRepoVariable updates a repository variable. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#update-a-repository-variable +func (s *ActionsService) UpdateRepoVariable(ctx context.Context, owner, repo string, variable *ActionsVariable) (*Response, error) { + url := fmt.Sprintf("repos/%v/%v/actions/variables/%v", owner, repo, variable.Name) + return s.patchVariable(ctx, url, variable) +} + +// UpdateOrgVariable updates an organization variable. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#update-an-organization-variable +func (s *ActionsService) UpdateOrgVariable(ctx context.Context, org string, variable *ActionsVariable) (*Response, error) { + url := fmt.Sprintf("orgs/%v/actions/variables/%v", org, variable.Name) + return s.patchVariable(ctx, url, variable) +} + +// UpdateEnvVariable updates an environment variable. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#create-an-environment-variable +func (s *ActionsService) UpdateEnvVariable(ctx context.Context, repoID int, env string, variable *ActionsVariable) (*Response, error) { + url := fmt.Sprintf("repositories/%v/environments/%v/variables/%v", repoID, env, variable.Name) + return s.patchVariable(ctx, url, variable) +} + +func (s *ActionsService) deleteVariable(ctx context.Context, url string) (*Response, error) { + req, err := s.client.NewRequest("DELETE", url, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// DeleteRepoVariable deletes a variable in a repository. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#delete-a-repository-variable +func (s *ActionsService) DeleteRepoVariable(ctx context.Context, owner, repo, name string) (*Response, error) { + url := fmt.Sprintf("repos/%v/%v/actions/variables/%v", owner, repo, name) + return s.deleteVariable(ctx, url) +} + +// DeleteOrgVariable deletes a variable in an organization. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#delete-an-organization-variable +func (s *ActionsService) DeleteOrgVariable(ctx context.Context, org, name string) (*Response, error) { + url := fmt.Sprintf("orgs/%v/actions/variables/%v", org, name) + return s.deleteVariable(ctx, url) +} + +// DeleteEnvVariable deletes a variable in an environment. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#delete-an-environment-variable +func (s *ActionsService) DeleteEnvVariable(ctx context.Context, repoID int, env, variableName string) (*Response, error) { + url := fmt.Sprintf("repositories/%v/environments/%v/variables/%v", repoID, env, variableName) + return s.deleteVariable(ctx, url) +} + +func (s *ActionsService) listSelectedReposForVariable(ctx context.Context, url string, opts *ListOptions) (*SelectedReposList, *Response, error) { + u, err := addOptions(url, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + result := new(SelectedReposList) + resp, err := s.client.Do(ctx, req, result) + if err != nil { + return nil, resp, err + } + + return result, resp, nil +} + +// ListSelectedReposForOrgVariable lists all repositories that have access to a variable. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#list-selected-repositories-for-an-organization-variable +func (s *ActionsService) ListSelectedReposForOrgVariable(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { + url := fmt.Sprintf("orgs/%v/actions/variables/%v/repositories", org, name) + return s.listSelectedReposForVariable(ctx, url, opts) +} + +func (s *ActionsService) setSelectedReposForVariable(ctx context.Context, url string, ids SelectedRepoIDs) (*Response, error) { + type repoIDs struct { + SelectedIDs SelectedRepoIDs `json:"selected_repository_ids"` + } + + req, err := s.client.NewRequest("PUT", url, repoIDs{SelectedIDs: ids}) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// SetSelectedReposForOrgVariable sets the repositories that have access to a variable. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#set-selected-repositories-for-an-organization-variable +func (s *ActionsService) SetSelectedReposForOrgVariable(ctx context.Context, org, name string, ids SelectedRepoIDs) (*Response, error) { + url := fmt.Sprintf("orgs/%v/actions/variables/%v/repositories", org, name) + return s.setSelectedReposForVariable(ctx, url, ids) +} + +func (s *ActionsService) addSelectedRepoToVariable(ctx context.Context, url string) (*Response, error) { + req, err := s.client.NewRequest("PUT", url, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// AddSelectedRepoToOrgVariable adds a repository to an organization variable. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#add-selected-repository-to-an-organization-variable +func (s *ActionsService) AddSelectedRepoToOrgVariable(ctx context.Context, org, name string, repo *Repository) (*Response, error) { + url := fmt.Sprintf("orgs/%v/actions/variables/%v/repositories/%v", org, name, *repo.ID) + return s.addSelectedRepoToVariable(ctx, url) +} + +func (s *ActionsService) removeSelectedRepoFromVariable(ctx context.Context, url string) (*Response, error) { + req, err := s.client.NewRequest("DELETE", url, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// RemoveSelectedRepoFromOrgVariable removes a repository from an organization variable. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#remove-selected-repository-from-an-organization-variable +func (s *ActionsService) RemoveSelectedRepoFromOrgVariable(ctx context.Context, org, name string, repo *Repository) (*Response, error) { + url := fmt.Sprintf("orgs/%v/actions/variables/%v/repositories/%v", org, name, *repo.ID) + return s.removeSelectedRepoFromVariable(ctx, url) +} diff --git a/github/actions_variables_test.go b/github/actions_variables_test.go new file mode 100644 index 00000000000..646da92b1e8 --- /dev/null +++ b/github/actions_variables_test.go @@ -0,0 +1,659 @@ +// Copyright 2023 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" + "time" + + "github.com/google/go-cmp/cmp" +) + +func TestActionsService_ListRepoVariables(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/actions/variables", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{"per_page": "2", "page": "2"}) + fmt.Fprint(w, `{"total_count":4,"variables":[{"name":"A","value":"AA","created_at":"2019-01-02T15:04:05Z","updated_at":"2020-01-02T15:04:05Z"},{"name":"B","value":"BB","created_at":"2019-01-02T15:04:05Z","updated_at":"2020-01-02T15:04:05Z"}]}`) + }) + + opts := &ListOptions{Page: 2, PerPage: 2} + ctx := context.Background() + variables, _, err := client.Actions.ListRepoVariables(ctx, "o", "r", opts) + if err != nil { + t.Errorf("Actions.ListRepoVariables returned error: %v", err) + } + + want := &ActionsVariables{ + TotalCount: 4, + Variables: []*ActionsVariable{ + {Name: "A", Value: "AA", CreatedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}}, + {Name: "B", Value: "BB", CreatedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}}, + }, + } + if !cmp.Equal(variables, want) { + t.Errorf("Actions.ListRepoVariables returned %+v, want %+v", variables, want) + } + + const methodName = "ListRepoVariables" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.ListRepoVariables(ctx, "\n", "\n", opts) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.ListRepoVariables(ctx, "o", "r", opts) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_GetRepoVariable(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/actions/variables/NAME", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"name":"NAME","value":"VALUE","created_at":"2019-01-02T15:04:05Z","updated_at":"2020-01-02T15:04:05Z"}`) + }) + + ctx := context.Background() + variable, _, err := client.Actions.GetRepoVariable(ctx, "o", "r", "NAME") + if err != nil { + t.Errorf("Actions.GetRepoVariable returned error: %v", err) + } + + want := &ActionsVariable{ + Name: "NAME", + Value: "VALUE", + CreatedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, + UpdatedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}, + } + if !cmp.Equal(variable, want) { + t.Errorf("Actions.GetRepoVariable returned %+v, want %+v", variable, want) + } + + const methodName = "GetRepoVariable" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.GetRepoVariable(ctx, "\n", "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.GetRepoVariable(ctx, "o", "r", "NAME") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_CreateRepoVariable(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/actions/variables", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + testHeader(t, r, "Content-Type", "application/json") + testBody(t, r, `{"name":"NAME","value":"VALUE"}`+"\n") + w.WriteHeader(http.StatusCreated) + }) + + input := &ActionsVariable{ + Name: "NAME", + Value: "VALUE", + } + ctx := context.Background() + _, err := client.Actions.CreateRepoVariable(ctx, "o", "r", input) + if err != nil { + t.Errorf("Actions.CreateRepoVariable returned error: %v", err) + } + + const methodName = "CreateRepoVariable" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Actions.CreateRepoVariable(ctx, "\n", "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Actions.CreateRepoVariable(ctx, "o", "r", input) + }) +} + +func TestActionsService_UpdateRepoVariable(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/actions/variables/NAME", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PATCH") + testHeader(t, r, "Content-Type", "application/json") + testBody(t, r, `{"name":"NAME","value":"VALUE"}`+"\n") + w.WriteHeader(http.StatusNoContent) + }) + + input := &ActionsVariable{ + Name: "NAME", + Value: "VALUE", + } + ctx := context.Background() + _, err := client.Actions.UpdateRepoVariable(ctx, "o", "r", input) + if err != nil { + t.Errorf("Actions.UpdateRepoVariable returned error: %v", err) + } + + const methodName = "UpdateRepoVariable" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Actions.UpdateRepoVariable(ctx, "\n", "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Actions.UpdateRepoVariable(ctx, "o", "r", input) + }) +} + +func TestActionsService_DeleteRepoVariable(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/actions/variables/NAME", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + }) + + ctx := context.Background() + _, err := client.Actions.DeleteRepoVariable(ctx, "o", "r", "NAME") + if err != nil { + t.Errorf("Actions.( returned error: %v", err) + } + + const methodName = "DeleteRepoVariable" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Actions.DeleteRepoVariable(ctx, "\n", "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Actions.DeleteRepoVariable(ctx, "o", "r", "NAME") + }) +} + +func TestActionsService_ListOrgVariables(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/actions/variables", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{"per_page": "2", "page": "2"}) + fmt.Fprint(w, `{"total_count":3,"variables":[{"name":"A","value":"AA","created_at":"2019-08-10T14:59:22Z","updated_at":"2020-01-10T14:59:22Z","visibility":"private"},{"name":"B","value":"BB","created_at":"2019-08-10T14:59:22Z","updated_at":"2020-01-10T14:59:22Z","visibility":"all"},{"name":"C","value":"CC","created_at":"2019-08-10T14:59:22Z","updated_at":"2020-01-10T14:59:22Z","visibility":"selected","selected_repositories_url":"https://api.github.com/orgs/octo-org/actions/variables/VAR/repositories"}]}`) + }) + + opts := &ListOptions{Page: 2, PerPage: 2} + ctx := context.Background() + variables, _, err := client.Actions.ListOrgVariables(ctx, "o", opts) + if err != nil { + t.Errorf("Actions.ListOrgVariables returned error: %v", err) + } + + want := &ActionsVariables{ + TotalCount: 3, + Variables: []*ActionsVariable{ + {Name: "A", Value: "AA", CreatedAt: &Timestamp{time.Date(2019, time.August, 10, 14, 59, 22, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 10, 14, 59, 22, 0, time.UTC)}, Visibility: String("private")}, + {Name: "B", Value: "BB", CreatedAt: &Timestamp{time.Date(2019, time.August, 10, 14, 59, 22, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 10, 14, 59, 22, 0, time.UTC)}, Visibility: String("all")}, + {Name: "C", Value: "CC", CreatedAt: &Timestamp{time.Date(2019, time.August, 10, 14, 59, 22, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 10, 14, 59, 22, 0, time.UTC)}, Visibility: String("selected"), SelectedRepositoriesURL: String("https://api.github.com/orgs/octo-org/actions/variables/VAR/repositories")}, + }, + } + if !cmp.Equal(variables, want) { + t.Errorf("Actions.ListOrgVariables returned %+v, want %+v", variables, want) + } + + const methodName = "ListOrgVariables" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.ListOrgVariables(ctx, "\n", opts) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.ListOrgVariables(ctx, "o", opts) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_GetOrgVariable(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/actions/variables/NAME", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"name":"NAME","value":"VALUE","created_at":"2019-01-02T15:04:05Z","updated_at":"2020-01-02T15:04:05Z","visibility":"selected","selected_repositories_url":"https://api.github.com/orgs/octo-org/actions/variables/VAR/repositories"}`) + }) + + ctx := context.Background() + variable, _, err := client.Actions.GetOrgVariable(ctx, "o", "NAME") + if err != nil { + t.Errorf("Actions.GetOrgVariable returned error: %v", err) + } + + want := &ActionsVariable{ + Name: "NAME", + Value: "VALUE", + CreatedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, + UpdatedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}, + Visibility: String("selected"), + SelectedRepositoriesURL: String("https://api.github.com/orgs/octo-org/actions/variables/VAR/repositories"), + } + if !cmp.Equal(variable, want) { + t.Errorf("Actions.GetOrgVariable returned %+v, want %+v", variable, want) + } + + const methodName = "GetOrgVariable" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.GetOrgVariable(ctx, "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.GetOrgVariable(ctx, "o", "NAME") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_CreateOrgVariable(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/actions/variables", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + testHeader(t, r, "Content-Type", "application/json") + testBody(t, r, `{"name":"NAME","value":"VALUE","visibility":"selected","selected_repository_ids":[1296269,1269280]}`+"\n") + w.WriteHeader(http.StatusCreated) + }) + + input := &ActionsVariable{ + Name: "NAME", + Value: "VALUE", + Visibility: String("selected"), + SelectedRepositoryIDs: &SelectedRepoIDs{1296269, 1269280}, + } + ctx := context.Background() + _, err := client.Actions.CreateOrgVariable(ctx, "o", input) + if err != nil { + t.Errorf("Actions.CreateOrgVariable returned error: %v", err) + } + + const methodName = "CreateOrgVariable" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Actions.CreateOrgVariable(ctx, "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Actions.CreateOrgVariable(ctx, "o", input) + }) +} + +func TestActionsService_UpdateOrgVariable(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/actions/variables/NAME", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PATCH") + testHeader(t, r, "Content-Type", "application/json") + testBody(t, r, `{"name":"NAME","value":"VALUE","visibility":"selected","selected_repository_ids":[1296269,1269280]}`+"\n") + w.WriteHeader(http.StatusNoContent) + }) + + input := &ActionsVariable{ + Name: "NAME", + Value: "VALUE", + Visibility: String("selected"), + SelectedRepositoryIDs: &SelectedRepoIDs{1296269, 1269280}, + } + ctx := context.Background() + _, err := client.Actions.UpdateOrgVariable(ctx, "o", input) + if err != nil { + t.Errorf("Actions.UpdateOrgVariable returned error: %v", err) + } + + const methodName = "UpdateOrgVariable" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Actions.UpdateOrgVariable(ctx, "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Actions.UpdateOrgVariable(ctx, "o", input) + }) +} + +func TestActionsService_ListSelectedReposForOrgVariable(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/actions/variables/NAME/repositories", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprintf(w, `{"total_count":1,"repositories":[{"id":1}]}`) + }) + + opts := &ListOptions{Page: 2, PerPage: 2} + ctx := context.Background() + repos, _, err := client.Actions.ListSelectedReposForOrgVariable(ctx, "o", "NAME", opts) + if err != nil { + t.Errorf("Actions.( returned error: %v", err) + } + + want := &SelectedReposList{ + TotalCount: Int(1), + Repositories: []*Repository{ + {ID: Int64(1)}, + }, + } + if !cmp.Equal(repos, want) { + t.Errorf("Actions.( returned %+v, want %+v", repos, want) + } + + const methodName = "ListSelectedReposForOrgVariable" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.ListSelectedReposForOrgVariable(ctx, "\n", "\n", opts) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.ListSelectedReposForOrgVariable(ctx, "o", "NAME", opts) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_SetSelectedReposForOrgSVariable(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/actions/variables/NAME/repositories", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + testHeader(t, r, "Content-Type", "application/json") + testBody(t, r, `{"selected_repository_ids":[64780797]}`+"\n") + }) + + ctx := context.Background() + _, err := client.Actions.SetSelectedReposForOrgVariable(ctx, "o", "NAME", SelectedRepoIDs{64780797}) + if err != nil { + t.Errorf("Actions.( returned error: %v", err) + } + + const methodName = "SetSelectedReposForOrgVariable" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Actions.SetSelectedReposForOrgVariable(ctx, "\n", "\n", SelectedRepoIDs{64780797}) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Actions.SetSelectedReposForOrgVariable(ctx, "o", "NAME", SelectedRepoIDs{64780797}) + }) +} + +func TestActionsService_AddSelectedRepoToOrgVariable(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/actions/variables/NAME/repositories/1234", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + }) + + repo := &Repository{ID: Int64(1234)} + ctx := context.Background() + _, err := client.Actions.AddSelectedRepoToOrgVariable(ctx, "o", "NAME", repo) + if err != nil { + t.Errorf("Actions.AddSelectedRepoToOrgVariable returned error: %v", err) + } + + const methodName = "AddSelectedRepoToOrgVariable" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Actions.AddSelectedRepoToOrgVariable(ctx, "\n", "\n", repo) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Actions.AddSelectedRepoToOrgVariable(ctx, "o", "NAME", repo) + }) +} + +func TestActionsService_RemoveSelectedRepoFromOrgVariable(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/actions/variables/NAME/repositories/1234", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + }) + + repo := &Repository{ID: Int64(1234)} + ctx := context.Background() + _, err := client.Actions.RemoveSelectedRepoFromOrgVariable(ctx, "o", "NAME", repo) + if err != nil { + t.Errorf("Actions.RemoveSelectedRepoFromOrgVariable returned error: %v", err) + } + + const methodName = "RemoveSelectedRepoFromOrgVariable" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Actions.RemoveSelectedRepoFromOrgVariable(ctx, "\n", "\n", repo) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Actions.RemoveSelectedRepoFromOrgVariable(ctx, "o", "NAME", repo) + }) +} + +func TestActionsService_DeleteOrgVariable(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/actions/variables/NAME", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + }) + + ctx := context.Background() + _, err := client.Actions.DeleteOrgVariable(ctx, "o", "NAME") + if err != nil { + t.Errorf("Actions.DeleteOrgVariable returned error: %v", err) + } + + const methodName = "DeleteOrgVariable" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Actions.DeleteOrgVariable(ctx, "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Actions.DeleteOrgVariable(ctx, "o", "NAME") + }) +} + +func TestActionsService_ListEnvVariables(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repositories/1/environments/e/variables", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{"per_page": "2", "page": "2"}) + fmt.Fprint(w, `{"total_count":4,"variables":[{"name":"A","value":"AA","created_at":"2019-01-02T15:04:05Z","updated_at":"2020-01-02T15:04:05Z"},{"name":"B","value":"BB","created_at":"2019-01-02T15:04:05Z","updated_at":"2020-01-02T15:04:05Z"}]}`) + }) + + opts := &ListOptions{Page: 2, PerPage: 2} + ctx := context.Background() + variables, _, err := client.Actions.ListEnvVariables(ctx, 1, "e", opts) + if err != nil { + t.Errorf("Actions.ListEnvVariables returned error: %v", err) + } + + want := &ActionsVariables{ + TotalCount: 4, + Variables: []*ActionsVariable{ + {Name: "A", Value: "AA", CreatedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}}, + {Name: "B", Value: "BB", CreatedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}}, + }, + } + if !cmp.Equal(variables, want) { + t.Errorf("Actions.ListEnvVariables returned %+v, want %+v", variables, want) + } + + const methodName = "ListEnvVariables" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.ListEnvVariables(ctx, 0.0, "\n", opts) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.ListEnvVariables(ctx, 1, "e", opts) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_GetEnvVariable(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repositories/1/environments/e/variables/variable", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"name":"variable","value":"VAR","created_at":"2019-01-02T15:04:05Z","updated_at":"2020-01-02T15:04:05Z"}`) + }) + + ctx := context.Background() + variable, _, err := client.Actions.GetEnvVariable(ctx, 1, "e", "variable") + if err != nil { + t.Errorf("Actions.GetEnvVariable returned error: %v", err) + } + + want := &ActionsVariable{ + Name: "variable", + Value: "VAR", + CreatedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, + UpdatedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}, + } + if !cmp.Equal(variable, want) { + t.Errorf("Actions.GetEnvVariable returned %+v, want %+v", variable, want) + } + + const methodName = "GetEnvVariable" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.GetEnvVariable(ctx, 0.0, "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.GetEnvVariable(ctx, 1, "e", "variable") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_CreateEnvVariable(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repositories/1/environments/e/variables", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + testHeader(t, r, "Content-Type", "application/json") + testBody(t, r, `{"name":"variable","value":"VAR"}`+"\n") + w.WriteHeader(http.StatusCreated) + }) + + input := &ActionsVariable{ + Name: "variable", + Value: "VAR", + } + ctx := context.Background() + _, err := client.Actions.CreateEnvVariable(ctx, 1, "e", input) + if err != nil { + t.Errorf("Actions.CreateEnvVariable returned error: %v", err) + } + + const methodName = "CreateEnvVariable" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Actions.CreateEnvVariable(ctx, 0.0, "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Actions.CreateEnvVariable(ctx, 1, "e", input) + }) +} + +func TestActionsService_UpdateEnvVariable(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repositories/1/environments/e/variables/variable", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PATCH") + testHeader(t, r, "Content-Type", "application/json") + testBody(t, r, `{"name":"variable","value":"VAR"}`+"\n") + w.WriteHeader(http.StatusNoContent) + }) + + input := &ActionsVariable{ + Name: "variable", + Value: "VAR", + } + ctx := context.Background() + _, err := client.Actions.UpdateEnvVariable(ctx, 1, "e", input) + if err != nil { + t.Errorf("Actions.UpdateEnvVariable returned error: %v", err) + } + + const methodName = "UpdateEnvVariable" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Actions.UpdateEnvVariable(ctx, 0.0, "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Actions.UpdateEnvVariable(ctx, 1, "e", input) + }) +} + +func TestActionsService_DeleteEnvVariable(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repositories/1/environments/e/variables/variable", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + }) + + ctx := context.Background() + _, err := client.Actions.DeleteEnvVariable(ctx, 1, "e", "variable") + if err != nil { + t.Errorf("Actions.DeleteEnvVariable returned error: %v", err) + } + + const methodName = "DeleteEnvVariable" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Actions.DeleteEnvVariable(ctx, 0.0, "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Actions.DeleteEnvVariable(ctx, 1, "r", "variable") + }) +} diff --git a/github/github-accessors.go b/github/github-accessors.go index e2d0d7f8357..3110d8132d8 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -174,6 +174,46 @@ func (a *ActionsPermissionsRepository) GetSelectedActionsURL() string { return *a.SelectedActionsURL } +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (a *ActionsVariable) GetCreatedAt() Timestamp { + if a == nil || a.CreatedAt == nil { + return Timestamp{} + } + return *a.CreatedAt +} + +// GetSelectedRepositoriesURL returns the SelectedRepositoriesURL field if it's non-nil, zero value otherwise. +func (a *ActionsVariable) GetSelectedRepositoriesURL() string { + if a == nil || a.SelectedRepositoriesURL == nil { + return "" + } + return *a.SelectedRepositoriesURL +} + +// GetSelectedRepositoryIDs returns the SelectedRepositoryIDs field. +func (a *ActionsVariable) GetSelectedRepositoryIDs() *SelectedRepoIDs { + if a == nil { + return nil + } + return a.SelectedRepositoryIDs +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (a *ActionsVariable) GetUpdatedAt() Timestamp { + if a == nil || a.UpdatedAt == nil { + return Timestamp{} + } + return *a.UpdatedAt +} + +// GetVisibility returns the Visibility field if it's non-nil, zero value otherwise. +func (a *ActionsVariable) GetVisibility() string { + if a == nil || a.Visibility == nil { + return "" + } + return *a.Visibility +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (a *AdminEnforcedChanges) GetFrom() bool { if a == nil || a.From == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 24e0a758264..9457df769ea 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -215,6 +215,53 @@ func TestActionsPermissionsRepository_GetSelectedActionsURL(tt *testing.T) { a.GetSelectedActionsURL() } +func TestActionsVariable_GetCreatedAt(tt *testing.T) { + var zeroValue Timestamp + a := &ActionsVariable{CreatedAt: &zeroValue} + a.GetCreatedAt() + a = &ActionsVariable{} + a.GetCreatedAt() + a = nil + a.GetCreatedAt() +} + +func TestActionsVariable_GetSelectedRepositoriesURL(tt *testing.T) { + var zeroValue string + a := &ActionsVariable{SelectedRepositoriesURL: &zeroValue} + a.GetSelectedRepositoriesURL() + a = &ActionsVariable{} + a.GetSelectedRepositoriesURL() + a = nil + a.GetSelectedRepositoriesURL() +} + +func TestActionsVariable_GetSelectedRepositoryIDs(tt *testing.T) { + a := &ActionsVariable{} + a.GetSelectedRepositoryIDs() + a = nil + a.GetSelectedRepositoryIDs() +} + +func TestActionsVariable_GetUpdatedAt(tt *testing.T) { + var zeroValue Timestamp + a := &ActionsVariable{UpdatedAt: &zeroValue} + a.GetUpdatedAt() + a = &ActionsVariable{} + a.GetUpdatedAt() + a = nil + a.GetUpdatedAt() +} + +func TestActionsVariable_GetVisibility(tt *testing.T) { + var zeroValue string + a := &ActionsVariable{Visibility: &zeroValue} + a.GetVisibility() + a = &ActionsVariable{} + a.GetVisibility() + a = nil + a.GetVisibility() +} + func TestAdminEnforcedChanges_GetFrom(tt *testing.T) { var zeroValue bool a := &AdminEnforcedChanges{From: &zeroValue} From ef6c7a6dc8a3c9820b4702355f7e2a05e7abfaca Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Thu, 2 Feb 2023 06:57:20 -0500 Subject: [PATCH 158/751] Remove failing unit tests for Go 1.20 (#2656) Fixes: #2654. --- github/actions_artifacts_test.go | 17 ----------------- github/repos_contents_test.go | 17 ----------------- 2 files changed, 34 deletions(-) diff --git a/github/actions_artifacts_test.go b/github/actions_artifacts_test.go index 345a0875348..e35a873bc0a 100644 --- a/github/actions_artifacts_test.go +++ b/github/actions_artifacts_test.go @@ -368,23 +368,6 @@ func TestActionsService_DownloadArtifact_StatusMovedPermanently_followRedirects( } } -func TestActionsService_DownloadArtifact_invalidLocationHeader(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - mux.HandleFunc("/repos/o/r/actions/artifacts/1/zip", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - ctlChar := 0x7f - badURL := "https://google.com" + string(byte(ctlChar)) - w.Header().Add("Location", badURL) - w.WriteHeader(http.StatusFound) - }) - - ctx := context.Background() - _, _, err := client.Actions.DownloadArtifact(ctx, "o", "r", 1, false) - testURLParseError(t, err) -} - func TestActionsService_DeleteArtifact(t *testing.T) { client, mux, _, teardown := setup() defer teardown() diff --git a/github/repos_contents_test.go b/github/repos_contents_test.go index db3efb91c60..6616e5af0c0 100644 --- a/github/repos_contents_test.go +++ b/github/repos_contents_test.go @@ -744,23 +744,6 @@ func TestRepositoriesService_GetArchiveLink_StatusMovedPermanently_followRedirec } } -func TestRepositoriesService_GetArchiveLink_invalidLocationHeader(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - mux.HandleFunc("/repos/o/r/tarball", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - ctlChar := 0x7f - badURL := "https://google.com" + string(byte(ctlChar)) - w.Header().Add("Location", badURL) - w.WriteHeader(http.StatusFound) - }) - - ctx := context.Background() - _, _, err := client.Repositories.GetArchiveLink(ctx, "o", "r", Tarball, &RepositoryContentGetOptions{}, false) - testURLParseError(t, err) -} - func TestRepositoriesService_GetContents_NoTrailingSlashInDirectoryApiPath(t *testing.T) { client, mux, _, teardown := setup() defer teardown() From b2fef5dfd6376b7c99d8dc88cecf7098e5bf4427 Mon Sep 17 00:00:00 2001 From: Sairaviteja27 <44663543+Sairaviteja27@users.noreply.github.com> Date: Thu, 2 Feb 2023 17:33:05 +0530 Subject: [PATCH 159/751] Add permission filter for list collaborators (#2653) Fixes #2651. --- github/repos_collaborators.go | 7 ++++++ github/repos_collaborators_test.go | 40 ++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/github/repos_collaborators.go b/github/repos_collaborators.go index abc4161c3bb..c2396872f2e 100644 --- a/github/repos_collaborators.go +++ b/github/repos_collaborators.go @@ -23,6 +23,13 @@ type ListCollaboratorsOptions struct { // Default value is "all". Affiliation string `url:"affiliation,omitempty"` + // Permission specifies how collaborators should be filtered by the permissions they have on the repository. + // Possible values are: + // "pull", "triage", "push", "maintain", "admin" + // + // If not specified, all collaborators will be returned. + Permission string `url:"permission,omitempty"` + ListOptions } diff --git a/github/repos_collaborators_test.go b/github/repos_collaborators_test.go index 8bb6c15cf1a..8953d36bccf 100644 --- a/github/repos_collaborators_test.go +++ b/github/repos_collaborators_test.go @@ -94,6 +94,46 @@ func TestRepositoriesService_ListCollaborators_withAffiliation(t *testing.T) { }) } +func TestRepositoriesService_ListCollaborators_withPermission(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/collaborators", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{"permission": "pull", "page": "2"}) + fmt.Fprintf(w, `[{"id":1}, {"id":2}]`) + }) + + opt := &ListCollaboratorsOptions{ + ListOptions: ListOptions{Page: 2}, + Permission: "pull", + } + ctx := context.Background() + users, _, err := client.Repositories.ListCollaborators(ctx, "o", "r", opt) + if err != nil { + t.Errorf("Repositories.ListCollaborators returned error: %v", err) + } + + want := []*User{{ID: Int64(1)}, {ID: Int64(2)}} + if !cmp.Equal(users, want) { + t.Errorf("Repositories.ListCollaborators returned %+v, want %+v", users, want) + } + + const methodName = "ListCollaborators" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.ListCollaborators(ctx, "\n", "\n", opt) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.ListCollaborators(ctx, "o", "r", opt) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + func TestRepositoriesService_ListCollaborators_invalidOwner(t *testing.T) { client, _, _, teardown := setup() defer teardown() From 2094f991592201d301feec818d413c136537732c Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Thu, 2 Feb 2023 07:18:53 -0500 Subject: [PATCH 160/751] Update workflow to use Go 1.20 and 1.19 (#2657) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d4a197746b8..c35dbc1b438 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,7 +21,7 @@ jobs: test: strategy: matrix: - go-version: [1.x, 1.18.x] + go-version: [1.x, 1.19.x] platform: [ubuntu-latest] include: # include windows, but only with the latest Go version, since there From 0af462f06fbd5fd466073b1718ace1c7e78b9283 Mon Sep 17 00:00:00 2001 From: Patrick O'Brien <51363872+lyspj@users.noreply.github.com> Date: Mon, 6 Feb 2023 12:26:05 +0100 Subject: [PATCH 161/751] Add Account field to MarketplacePurchase struct (#2659) Fixes: #2658. --- github/apps_marketplace.go | 12 +++++ github/github-accessors.go | 64 +++++++++++++++++++++++++++ github/github-accessors_test.go | 77 +++++++++++++++++++++++++++++++++ 3 files changed, 153 insertions(+) diff --git a/github/apps_marketplace.go b/github/apps_marketplace.go index 82530136842..32889abd240 100644 --- a/github/apps_marketplace.go +++ b/github/apps_marketplace.go @@ -46,6 +46,7 @@ type MarketplacePlan struct { // MarketplacePurchase represents a GitHub Apps Marketplace Purchase. type MarketplacePurchase struct { + Account *MarketplacePurchaseAccount `json:"account,omitempty"` // BillingCycle can be one of the values "yearly", "monthly" or nil. BillingCycle *string `json:"billing_cycle,omitempty"` NextBillingDate *Timestamp `json:"next_billing_date,omitempty"` @@ -75,6 +76,17 @@ type MarketplacePlanAccount struct { MarketplacePendingChange *MarketplacePendingChange `json:"marketplace_pending_change,omitempty"` } +// MarketplacePurchaseAccount represents a GitHub Account (user or organization) for a Purchase. +type MarketplacePurchaseAccount struct { + URL *string `json:"url,omitempty"` + Type *string `json:"type,omitempty"` + ID *int64 `json:"id,omitempty"` + Login *string `json:"login,omitempty"` + OrganizationBillingEmail *string `json:"organization_billing_email,omitempty"` + Email *string `json:"email,omitempty"` + NodeID *string `json:"node_id,omitempty"` +} + // ListPlans lists all plans for your Marketplace listing. // // GitHub API docs: https://docs.github.com/en/rest/apps#list-plans diff --git a/github/github-accessors.go b/github/github-accessors.go index 3110d8132d8..433d16f3037 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -9174,6 +9174,14 @@ func (m *MarketplacePlanAccount) GetURL() string { return *m.URL } +// GetAccount returns the Account field. +func (m *MarketplacePurchase) GetAccount() *MarketplacePurchaseAccount { + if m == nil { + return nil + } + return m.Account +} + // GetBillingCycle returns the BillingCycle field if it's non-nil, zero value otherwise. func (m *MarketplacePurchase) GetBillingCycle() string { if m == nil || m.BillingCycle == nil { @@ -9230,6 +9238,62 @@ func (m *MarketplacePurchase) GetUpdatedAt() Timestamp { return *m.UpdatedAt } +// GetEmail returns the Email field if it's non-nil, zero value otherwise. +func (m *MarketplacePurchaseAccount) GetEmail() string { + if m == nil || m.Email == nil { + return "" + } + return *m.Email +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (m *MarketplacePurchaseAccount) GetID() int64 { + if m == nil || m.ID == nil { + return 0 + } + return *m.ID +} + +// GetLogin returns the Login field if it's non-nil, zero value otherwise. +func (m *MarketplacePurchaseAccount) GetLogin() string { + if m == nil || m.Login == nil { + return "" + } + return *m.Login +} + +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (m *MarketplacePurchaseAccount) GetNodeID() string { + if m == nil || m.NodeID == nil { + return "" + } + return *m.NodeID +} + +// GetOrganizationBillingEmail returns the OrganizationBillingEmail field if it's non-nil, zero value otherwise. +func (m *MarketplacePurchaseAccount) GetOrganizationBillingEmail() string { + if m == nil || m.OrganizationBillingEmail == nil { + return "" + } + return *m.OrganizationBillingEmail +} + +// GetType returns the Type field if it's non-nil, zero value otherwise. +func (m *MarketplacePurchaseAccount) GetType() string { + if m == nil || m.Type == nil { + return "" + } + return *m.Type +} + +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (m *MarketplacePurchaseAccount) GetURL() string { + if m == nil || m.URL == nil { + return "" + } + return *m.URL +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (m *MarketplacePurchaseEvent) GetAction() string { if m == nil || m.Action == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 9457df769ea..dbe7a8e9084 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -10790,6 +10790,13 @@ func TestMarketplacePlanAccount_GetURL(tt *testing.T) { m.GetURL() } +func TestMarketplacePurchase_GetAccount(tt *testing.T) { + m := &MarketplacePurchase{} + m.GetAccount() + m = nil + m.GetAccount() +} + func TestMarketplacePurchase_GetBillingCycle(tt *testing.T) { var zeroValue string m := &MarketplacePurchase{BillingCycle: &zeroValue} @@ -10857,6 +10864,76 @@ func TestMarketplacePurchase_GetUpdatedAt(tt *testing.T) { m.GetUpdatedAt() } +func TestMarketplacePurchaseAccount_GetEmail(tt *testing.T) { + var zeroValue string + m := &MarketplacePurchaseAccount{Email: &zeroValue} + m.GetEmail() + m = &MarketplacePurchaseAccount{} + m.GetEmail() + m = nil + m.GetEmail() +} + +func TestMarketplacePurchaseAccount_GetID(tt *testing.T) { + var zeroValue int64 + m := &MarketplacePurchaseAccount{ID: &zeroValue} + m.GetID() + m = &MarketplacePurchaseAccount{} + m.GetID() + m = nil + m.GetID() +} + +func TestMarketplacePurchaseAccount_GetLogin(tt *testing.T) { + var zeroValue string + m := &MarketplacePurchaseAccount{Login: &zeroValue} + m.GetLogin() + m = &MarketplacePurchaseAccount{} + m.GetLogin() + m = nil + m.GetLogin() +} + +func TestMarketplacePurchaseAccount_GetNodeID(tt *testing.T) { + var zeroValue string + m := &MarketplacePurchaseAccount{NodeID: &zeroValue} + m.GetNodeID() + m = &MarketplacePurchaseAccount{} + m.GetNodeID() + m = nil + m.GetNodeID() +} + +func TestMarketplacePurchaseAccount_GetOrganizationBillingEmail(tt *testing.T) { + var zeroValue string + m := &MarketplacePurchaseAccount{OrganizationBillingEmail: &zeroValue} + m.GetOrganizationBillingEmail() + m = &MarketplacePurchaseAccount{} + m.GetOrganizationBillingEmail() + m = nil + m.GetOrganizationBillingEmail() +} + +func TestMarketplacePurchaseAccount_GetType(tt *testing.T) { + var zeroValue string + m := &MarketplacePurchaseAccount{Type: &zeroValue} + m.GetType() + m = &MarketplacePurchaseAccount{} + m.GetType() + m = nil + m.GetType() +} + +func TestMarketplacePurchaseAccount_GetURL(tt *testing.T) { + var zeroValue string + m := &MarketplacePurchaseAccount{URL: &zeroValue} + m.GetURL() + m = &MarketplacePurchaseAccount{} + m.GetURL() + m = nil + m.GetURL() +} + func TestMarketplacePurchaseEvent_GetAction(tt *testing.T) { var zeroValue string m := &MarketplacePurchaseEvent{Action: &zeroValue} From c855eb5fc7dcc46ab35fd5c5dda387dd0a3e0eb1 Mon Sep 17 00:00:00 2001 From: Bryan Callahan Date: Mon, 6 Feb 2023 06:28:57 -0800 Subject: [PATCH 162/751] Add URL, UpdateAt, and WorkflowRun fields to Artifacts (#2660) --- github/actions_artifacts.go | 32 +++++++++---- github/actions_artifacts_test.go | 40 ++++++++++++++++- github/github-accessors.go | 64 ++++++++++++++++++++++++++ github/github-accessors_test.go | 77 ++++++++++++++++++++++++++++++++ 4 files changed, 202 insertions(+), 11 deletions(-) diff --git a/github/actions_artifacts.go b/github/actions_artifacts.go index 99329d989d9..441a53910e3 100644 --- a/github/actions_artifacts.go +++ b/github/actions_artifacts.go @@ -12,20 +12,34 @@ import ( "net/url" ) -// Artifact reprents a GitHub artifact. Artifacts allow sharing +// ArtifactWorkflowRun represents a GitHub artifact's workflow run. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/artifacts +type ArtifactWorkflowRun struct { + ID *int64 `json:"id,omitempty"` + RepositoryID *int64 `json:"repository_id,omitempty"` + HeadRepositoryID *int64 `json:"head_repository_id,omitempty"` + HeadBranch *string `json:"head_branch,omitempty"` + HeadSHA *string `json:"head_sha,omitempty"` +} + +// Artifact represents a GitHub artifact. Artifacts allow sharing // data between jobs in a workflow and provide storage for data // once a workflow is complete. // // GitHub API docs: https://docs.github.com/en/rest/actions/artifacts type Artifact struct { - ID *int64 `json:"id,omitempty"` - NodeID *string `json:"node_id,omitempty"` - Name *string `json:"name,omitempty"` - SizeInBytes *int64 `json:"size_in_bytes,omitempty"` - ArchiveDownloadURL *string `json:"archive_download_url,omitempty"` - Expired *bool `json:"expired,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - ExpiresAt *Timestamp `json:"expires_at,omitempty"` + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Name *string `json:"name,omitempty"` + SizeInBytes *int64 `json:"size_in_bytes,omitempty"` + URL *string `json:"url,omitempty"` + ArchiveDownloadURL *string `json:"archive_download_url,omitempty"` + Expired *bool `json:"expired,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + ExpiresAt *Timestamp `json:"expires_at,omitempty"` + WorkflowRun *ArtifactWorkflowRun `json:"workflow_run,omitempty"` } // ArtifactList represents a list of GitHub artifacts. diff --git a/github/actions_artifacts_test.go b/github/actions_artifacts_test.go index e35a873bc0a..de07c14f847 100644 --- a/github/actions_artifacts_test.go +++ b/github/actions_artifacts_test.go @@ -438,10 +438,19 @@ func TestArtifact_Marshal(t *testing.T) { NodeID: String("nid"), Name: String("n"), SizeInBytes: Int64(1), + URL: String("u"), ArchiveDownloadURL: String("a"), Expired: Bool(false), CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, ExpiresAt: &Timestamp{referenceTime}, + WorkflowRun: &ArtifactWorkflowRun{ + ID: Int64(1), + RepositoryID: Int64(1), + HeadRepositoryID: Int64(1), + HeadBranch: String("b"), + HeadSHA: String("s"), + }, } want := `{ @@ -449,10 +458,19 @@ func TestArtifact_Marshal(t *testing.T) { "node_id": "nid", "name": "n", "size_in_bytes": 1, + "url": "u", "archive_download_url": "a", "expired": false, "created_at": ` + referenceTimeStr + `, - "expires_at": ` + referenceTimeStr + ` + "updated_at": ` + referenceTimeStr + `, + "expires_at": ` + referenceTimeStr + `, + "workflow_run": { + "id": 1, + "repository_id": 1, + "head_repository_id": 1, + "head_branch": "b", + "head_sha": "s" + } }` testJSONMarshal(t, u, want) @@ -469,10 +487,19 @@ func TestArtifactList_Marshal(t *testing.T) { NodeID: String("nid"), Name: String("n"), SizeInBytes: Int64(1), + URL: String("u"), ArchiveDownloadURL: String("a"), Expired: Bool(false), CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, ExpiresAt: &Timestamp{referenceTime}, + WorkflowRun: &ArtifactWorkflowRun{ + ID: Int64(1), + RepositoryID: Int64(1), + HeadRepositoryID: Int64(1), + HeadBranch: String("b"), + HeadSHA: String("s"), + }, }, }, } @@ -484,10 +511,19 @@ func TestArtifactList_Marshal(t *testing.T) { "node_id": "nid", "name": "n", "size_in_bytes": 1, + "url": "u", "archive_download_url": "a", "expired": false, "created_at": ` + referenceTimeStr + `, - "expires_at": ` + referenceTimeStr + ` + "updated_at": ` + referenceTimeStr + `, + "expires_at": ` + referenceTimeStr + `, + "workflow_run": { + "id": 1, + "repository_id": 1, + "head_repository_id": 1, + "head_branch": "b", + "head_sha": "s" + } }] }` diff --git a/github/github-accessors.go b/github/github-accessors.go index 433d16f3037..63b1079cdfd 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -902,6 +902,30 @@ func (a *Artifact) GetSizeInBytes() int64 { return *a.SizeInBytes } +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (a *Artifact) GetUpdatedAt() Timestamp { + if a == nil || a.UpdatedAt == nil { + return Timestamp{} + } + return *a.UpdatedAt +} + +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (a *Artifact) GetURL() string { + if a == nil || a.URL == nil { + return "" + } + return *a.URL +} + +// GetWorkflowRun returns the WorkflowRun field. +func (a *Artifact) GetWorkflowRun() *ArtifactWorkflowRun { + if a == nil { + return nil + } + return a.WorkflowRun +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (a *ArtifactList) GetTotalCount() int64 { if a == nil || a.TotalCount == nil { @@ -910,6 +934,46 @@ func (a *ArtifactList) GetTotalCount() int64 { return *a.TotalCount } +// GetHeadBranch returns the HeadBranch field if it's non-nil, zero value otherwise. +func (a *ArtifactWorkflowRun) GetHeadBranch() string { + if a == nil || a.HeadBranch == nil { + return "" + } + return *a.HeadBranch +} + +// GetHeadRepositoryID returns the HeadRepositoryID field if it's non-nil, zero value otherwise. +func (a *ArtifactWorkflowRun) GetHeadRepositoryID() int64 { + if a == nil || a.HeadRepositoryID == nil { + return 0 + } + return *a.HeadRepositoryID +} + +// GetHeadSHA returns the HeadSHA field if it's non-nil, zero value otherwise. +func (a *ArtifactWorkflowRun) GetHeadSHA() string { + if a == nil || a.HeadSHA == nil { + return "" + } + return *a.HeadSHA +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (a *ArtifactWorkflowRun) GetID() int64 { + if a == nil || a.ID == nil { + return 0 + } + return *a.ID +} + +// GetRepositoryID returns the RepositoryID field if it's non-nil, zero value otherwise. +func (a *ArtifactWorkflowRun) GetRepositoryID() int64 { + if a == nil || a.RepositoryID == nil { + return 0 + } + return *a.RepositoryID +} + // GetBody returns the Body field if it's non-nil, zero value otherwise. func (a *Attachment) GetBody() string { if a == nil || a.Body == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index dbe7a8e9084..961eba82888 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -1056,6 +1056,33 @@ func TestArtifact_GetSizeInBytes(tt *testing.T) { a.GetSizeInBytes() } +func TestArtifact_GetUpdatedAt(tt *testing.T) { + var zeroValue Timestamp + a := &Artifact{UpdatedAt: &zeroValue} + a.GetUpdatedAt() + a = &Artifact{} + a.GetUpdatedAt() + a = nil + a.GetUpdatedAt() +} + +func TestArtifact_GetURL(tt *testing.T) { + var zeroValue string + a := &Artifact{URL: &zeroValue} + a.GetURL() + a = &Artifact{} + a.GetURL() + a = nil + a.GetURL() +} + +func TestArtifact_GetWorkflowRun(tt *testing.T) { + a := &Artifact{} + a.GetWorkflowRun() + a = nil + a.GetWorkflowRun() +} + func TestArtifactList_GetTotalCount(tt *testing.T) { var zeroValue int64 a := &ArtifactList{TotalCount: &zeroValue} @@ -1066,6 +1093,56 @@ func TestArtifactList_GetTotalCount(tt *testing.T) { a.GetTotalCount() } +func TestArtifactWorkflowRun_GetHeadBranch(tt *testing.T) { + var zeroValue string + a := &ArtifactWorkflowRun{HeadBranch: &zeroValue} + a.GetHeadBranch() + a = &ArtifactWorkflowRun{} + a.GetHeadBranch() + a = nil + a.GetHeadBranch() +} + +func TestArtifactWorkflowRun_GetHeadRepositoryID(tt *testing.T) { + var zeroValue int64 + a := &ArtifactWorkflowRun{HeadRepositoryID: &zeroValue} + a.GetHeadRepositoryID() + a = &ArtifactWorkflowRun{} + a.GetHeadRepositoryID() + a = nil + a.GetHeadRepositoryID() +} + +func TestArtifactWorkflowRun_GetHeadSHA(tt *testing.T) { + var zeroValue string + a := &ArtifactWorkflowRun{HeadSHA: &zeroValue} + a.GetHeadSHA() + a = &ArtifactWorkflowRun{} + a.GetHeadSHA() + a = nil + a.GetHeadSHA() +} + +func TestArtifactWorkflowRun_GetID(tt *testing.T) { + var zeroValue int64 + a := &ArtifactWorkflowRun{ID: &zeroValue} + a.GetID() + a = &ArtifactWorkflowRun{} + a.GetID() + a = nil + a.GetID() +} + +func TestArtifactWorkflowRun_GetRepositoryID(tt *testing.T) { + var zeroValue int64 + a := &ArtifactWorkflowRun{RepositoryID: &zeroValue} + a.GetRepositoryID() + a = &ArtifactWorkflowRun{} + a.GetRepositoryID() + a = nil + a.GetRepositoryID() +} + func TestAttachment_GetBody(tt *testing.T) { var zeroValue string a := &Attachment{Body: &zeroValue} From e26cdd7bcbdf63ab02a3ed925bd5023999ef9198 Mon Sep 17 00:00:00 2001 From: Matt Simons Date: Thu, 9 Feb 2023 15:47:27 +0000 Subject: [PATCH 163/751] Add milestone field to IssuesEvent (#2663) Fixes: #2662. --- github/event_types.go | 1 + github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 7 +++++++ 3 files changed, 16 insertions(+) diff --git a/github/event_types.go b/github/event_types.go index 8330353a3c1..50c7b567bcf 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -485,6 +485,7 @@ type IssuesEvent struct { Repo *Repository `json:"repository,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + Milestone *Milestone `json:"milestone,omitempty"` } // LabelEvent is triggered when a repository's label is created, edited, or deleted. diff --git a/github/github-accessors.go b/github/github-accessors.go index 63b1079cdfd..f502995ef16 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -8390,6 +8390,14 @@ func (i *IssuesEvent) GetLabel() *Label { return i.Label } +// GetMilestone returns the Milestone field. +func (i *IssuesEvent) GetMilestone() *Milestone { + if i == nil { + return nil + } + return i.Milestone +} + // GetRepo returns the Repo field. func (i *IssuesEvent) GetRepo() *Repository { if i == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 961eba82888..8fea0bb5fd9 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -9843,6 +9843,13 @@ func TestIssuesEvent_GetLabel(tt *testing.T) { i.GetLabel() } +func TestIssuesEvent_GetMilestone(tt *testing.T) { + i := &IssuesEvent{} + i.GetMilestone() + i = nil + i.GetMilestone() +} + func TestIssuesEvent_GetRepo(tt *testing.T) { i := &IssuesEvent{} i.GetRepo() From 175f3bf4a3791c35b60dc71d3b87c39c08d23b2e Mon Sep 17 00:00:00 2001 From: Jaime Andres Torres Bermejo <69700780+XaurDesu@users.noreply.github.com> Date: Mon, 13 Feb 2023 18:22:25 -0500 Subject: [PATCH 164/751] Add go generate mention to CONTRIBUTING.md (#2587) Fixes: #2579. --- CONTRIBUTING.md | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 25d455b8f77..fb3660461fc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -44,9 +44,8 @@ are more sensitive, emailed to . 1. Go makes it very simple to ensure properly formatted code, so always run `go fmt` on your code before committing it. You should also run - [golint][] over your code. As noted in the [golint readme][], it's not - strictly necessary that your code be completely "lint-free", but this will - help you find common style issues. + [go vet][] over your code. this will help you find common style issues + within your code and will keep styling consistent within the project. 1. Any significant changes should almost always be accompanied by tests. The project already has good test coverage, so look at some of the existing @@ -59,18 +58,35 @@ are more sensitive, emailed to . * `go test github.com/google/go-github/...` * `go vet github.com/google/go-github/...` + The `go generate ./...` command will update or generate certain files, and the + resulting changes should be included in your pull request. + + The `go test ./...` command will run tests inside your code. This will help you + spot places where code might be faulty before committing. + + And finally, the `go vet ./...` command will check linting and styling over your + code, keeping the project consistent formatting-wise. + + In any case, it is always a good idea to read [official Go documentation][] when working + on this project, as the definition of tools and commands of the Go programming + language is described in further detail there. + 1. Do your best to have [well-formed commit messages][] for each change. This provides consistency throughout the project, and ensures that commit messages are able to be formatted properly by various git tools. 1. Finally, push the commits to your fork and submit a [pull request][]. + Before pushing commits, it is highly advised to check for generated files + that were either created or modified for the sake of your commit. Running + `go generate -x ./...` should return a log of modified generated files that should + be included alongside the manually written code in the commit. **NOTE:** Please do not use force-push on PRs in this repo, as it makes it more difficult for reviewers to see what has changed since the last code review. +[official Go documentation]: https://pkg.go.dev/std [forking]: https://help.github.com/articles/fork-a-repo -[golint]: https://github.com/golang/lint -[golint readme]: https://github.com/golang/lint/blob/master/README.md +[go vet]: https://pkg.go.dev/cmd/vet [gocov]: https://github.com/axw/gocov [gocov-html]: https://github.com/matm/gocov-html [well-formed commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html @@ -128,4 +144,5 @@ this][modified-comment]. [rebase-comment]: https://github.com/google/go-github/pull/277#issuecomment-183035491 [modified-comment]: https://github.com/google/go-github/pull/280#issuecomment-184859046 -**When creating a release, don't forget to update the `Version` constant in `github.go`.** This is used to send the version in the `User-Agent` header to identify clients to the GitHub API. +**When creating a release, don't forget to update the `Version` constant in `github.go`.** This is used to +send the version in the `User-Agent` header to identify clients to the GitHub API. From 0730976bf48f4d1051a94c58e7bff1ad9781b684 Mon Sep 17 00:00:00 2001 From: Jeff Wenzbauer Date: Thu, 16 Feb 2023 15:39:37 -0700 Subject: [PATCH 165/751] Add RequestedTeam to issues Timeline type (#2665) Fixes: #2664. --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 7 +++++++ github/issues_timeline.go | 2 ++ 3 files changed, 17 insertions(+) diff --git a/github/github-accessors.go b/github/github-accessors.go index f502995ef16..7036a9a6afc 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -19502,6 +19502,14 @@ func (t *Timeline) GetRename() *Rename { return t.Rename } +// GetRequestedTeam returns the RequestedTeam field. +func (t *Timeline) GetRequestedTeam() *Team { + if t == nil { + return nil + } + return t.RequestedTeam +} + // GetRequester returns the Requester field. func (t *Timeline) GetRequester() *User { if t == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 8fea0bb5fd9..6590ff99efa 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -22728,6 +22728,13 @@ func TestTimeline_GetRename(tt *testing.T) { t.GetRename() } +func TestTimeline_GetRequestedTeam(tt *testing.T) { + t := &Timeline{} + t.GetRequestedTeam() + t = nil + t.GetRequestedTeam() +} + func TestTimeline_GetRequester(tt *testing.T) { t := &Timeline{} t.GetRequester() diff --git a/github/issues_timeline.go b/github/issues_timeline.go index 2f049aff56f..9c73e6176d1 100644 --- a/github/issues_timeline.go +++ b/github/issues_timeline.go @@ -143,6 +143,8 @@ type Timeline struct { // The person requested to review the pull request. Reviewer *User `json:"requested_reviewer,omitempty"` + // RequestedTeam contains the team requested to review the pull request. + RequestedTeam *Team `json:"requested_team,omitempty"` // The person who requested a review. Requester *User `json:"review_requester,omitempty"` From b9cb801b8aa1f2e928a13e579e8a58fc0667a053 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Feb 2023 17:41:51 -0500 Subject: [PATCH 166/751] Bump github.com/PuerkitoBio/goquery from 1.8.0 to 1.8.1 in /scrape (#2667) --- scrape/go.mod | 4 ++-- scrape/go.sum | 26 ++++++++++++++++++++++---- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 67b1fa9f7ae..3aa019c51dc 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -3,9 +3,9 @@ module github.com/google/go-github/scrape go 1.13 require ( - github.com/PuerkitoBio/goquery v1.8.0 + github.com/PuerkitoBio/goquery v1.8.1 github.com/google/go-cmp v0.5.9 github.com/google/go-github/v50 v50.0.0 github.com/xlzd/gotp v0.0.0-20181030022105-c8557ba2c119 - golang.org/x/net v0.0.0-20210916014120-12bc252f5db8 + golang.org/x/net v0.7.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index 824ec0544b9..a67b43953bf 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -1,5 +1,5 @@ -github.com/PuerkitoBio/goquery v1.8.0 h1:PJTF7AmFCFKk1N6V6jmKfrNH9tV5pNE6lZMkG0gta/U= -github.com/PuerkitoBio/goquery v1.8.0/go.mod h1:ypIiRMtY7COPGk+I/YbZLbxsxn9g5ejnI2HSMtkjZvI= +github.com/PuerkitoBio/goquery v1.8.1 h1:uQxhNlArOIdbrH1tr0UXwdVFgDcZDrZVdcpygAcwmWM= +github.com/PuerkitoBio/goquery v1.8.1/go.mod h1:Q8ICL1kNUJ2sXGoAhPGUdYDJvgQgHzJsnnd3H7Ho5jQ= github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c= github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -14,25 +14,43 @@ github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/xlzd/gotp v0.0.0-20181030022105-c8557ba2c119 h1:YyPWX3jLOtYKulBR6AScGIs74lLrJcgeKRwcbAuQOG4= github.com/xlzd/gotp v0.0.0-20181030022105-c8557ba2c119/go.mod h1:/nuTSlK+okRfR/vnIPqR89fFKonnWPiZymN5ydRJkX8= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210916014120-12bc252f5db8 h1:/6y1LfuqNuQdHAm0jjtPtgRcxIxjVZgm5OTu8/QhZvk= golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= From e7e7149cd202a9ef5f05fd983a15984bab2577e4 Mon Sep 17 00:00:00 2001 From: Evan Lee Date: Wed, 22 Feb 2023 13:43:01 -0700 Subject: [PATCH 167/751] Add Permission, OldPermission to AuditEntry type (#2670) Fixes: #2669. --- github/github-accessors.go | 16 ++++++++++++++++ github/github-accessors_test.go | 20 ++++++++++++++++++++ github/orgs_audit_log.go | 2 ++ github/orgs_audit_log_test.go | 8 ++++++++ 4 files changed, 46 insertions(+) diff --git a/github/github-accessors.go b/github/github-accessors.go index 7036a9a6afc..59a59a4edb3 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -1222,6 +1222,14 @@ func (a *AuditEntry) GetName() string { return *a.Name } +// GetOldPermission returns the OldPermission field if it's non-nil, zero value otherwise. +func (a *AuditEntry) GetOldPermission() string { + if a == nil || a.OldPermission == nil { + return "" + } + return *a.OldPermission +} + // GetOldUser returns the OldUser field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetOldUser() string { if a == nil || a.OldUser == nil { @@ -1246,6 +1254,14 @@ func (a *AuditEntry) GetOrg() string { return *a.Org } +// GetPermission returns the Permission field if it's non-nil, zero value otherwise. +func (a *AuditEntry) GetPermission() string { + if a == nil || a.Permission == nil { + return "" + } + return *a.Permission +} + // GetPreviousVisibility returns the PreviousVisibility field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetPreviousVisibility() string { if a == nil || a.PreviousVisibility == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 6590ff99efa..7239698a308 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -1447,6 +1447,16 @@ func TestAuditEntry_GetName(tt *testing.T) { a.GetName() } +func TestAuditEntry_GetOldPermission(tt *testing.T) { + var zeroValue string + a := &AuditEntry{OldPermission: &zeroValue} + a.GetOldPermission() + a = &AuditEntry{} + a.GetOldPermission() + a = nil + a.GetOldPermission() +} + func TestAuditEntry_GetOldUser(tt *testing.T) { var zeroValue string a := &AuditEntry{OldUser: &zeroValue} @@ -1477,6 +1487,16 @@ func TestAuditEntry_GetOrg(tt *testing.T) { a.GetOrg() } +func TestAuditEntry_GetPermission(tt *testing.T) { + var zeroValue string + a := &AuditEntry{Permission: &zeroValue} + a.GetPermission() + a = &AuditEntry{} + a.GetPermission() + a = nil + a.GetPermission() +} + func TestAuditEntry_GetPreviousVisibility(tt *testing.T) { var zeroValue string a := &AuditEntry{PreviousVisibility: &zeroValue} diff --git a/github/orgs_audit_log.go b/github/orgs_audit_log.go index be5fd24d6ed..700c233c803 100644 --- a/github/orgs_audit_log.go +++ b/github/orgs_audit_log.go @@ -63,8 +63,10 @@ type AuditEntry struct { Message *string `json:"message,omitempty"` Name *string `json:"name,omitempty"` OldUser *string `json:"old_user,omitempty"` + OldPermission *string `json:"old_permission,omitempty"` // The permission level for membership changes, for example `admin` or `read`. OpenSSHPublicKey *string `json:"openssh_public_key,omitempty"` Org *string `json:"org,omitempty"` + Permission *string `json:"permission,omitempty"` // The permission level for membership changes, for example `admin` or `read`. PreviousVisibility *string `json:"previous_visibility,omitempty"` ReadOnly *string `json:"read_only,omitempty"` Repo *string `json:"repo,omitempty"` diff --git a/github/orgs_audit_log_test.go b/github/orgs_audit_log_test.go index 1f060072452..be6361560f9 100644 --- a/github/orgs_audit_log_test.go +++ b/github/orgs_audit_log_test.go @@ -34,6 +34,8 @@ func TestOrganizationService_GetAuditLog(t *testing.T) { "created_at": 1615077308538, "head_sha": "5acdeadbeef64d1a62388e901e5cdc9358644b37", "conclusion": "success", + "old_permission": "read", + "permission": "admin", "actor": "testactor", "completed_at": "2021-03-07T00:35:08.000Z", "@timestamp": 1615077308538, @@ -80,7 +82,9 @@ func TestOrganizationService_GetAuditLog(t *testing.T) { HeadBranch: String("master"), HeadSHA: String("5acdeadbeef64d1a62388e901e5cdc9358644b37"), Name: String("Code scanning - action"), + OldPermission: String("read"), Org: String("o"), + Permission: String("admin"), Repo: String("o/blue-crayon-1"), StartedAt: &Timestamp{startedAt}, WorkflowID: Int64(123456), @@ -199,9 +203,11 @@ func TestAuditEntry_Marshal(t *testing.T) { LimitedAvailability: Bool(false), Message: String("m"), Name: String("n"), + OldPermission: String("op"), OldUser: String("ou"), OpenSSHPublicKey: String("osshpk"), Org: String("o"), + Permission: String("p"), PreviousVisibility: String("pv"), ReadOnly: String("ro"), Repo: String("r"), @@ -268,9 +274,11 @@ func TestAuditEntry_Marshal(t *testing.T) { "limited_availability": false, "message": "m", "name": "n", + "old_permission": "op", "old_user": "ou", "openssh_public_key": "osshpk", "org": "o", + "permission": "p", "previous_visibility": "pv", "read_only": "ro", "repo": "r", From 1f3c5a52d715da4f84f0a677df9a68526f2ca36a Mon Sep 17 00:00:00 2001 From: Dustin Lish Date: Thu, 23 Feb 2023 14:10:50 -0700 Subject: [PATCH 168/751] Add created_at to WorkflowJob struct (#2671) --- github/actions_workflow_jobs.go | 1 + github/actions_workflow_jobs_test.go | 4 ++++ github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ 4 files changed, 23 insertions(+) diff --git a/github/actions_workflow_jobs.go b/github/actions_workflow_jobs.go index b55f9aa7f8d..b7130916fe5 100644 --- a/github/actions_workflow_jobs.go +++ b/github/actions_workflow_jobs.go @@ -33,6 +33,7 @@ type WorkflowJob struct { HTMLURL *string `json:"html_url,omitempty"` Status *string `json:"status,omitempty"` Conclusion *string `json:"conclusion,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` StartedAt *Timestamp `json:"started_at,omitempty"` CompletedAt *Timestamp `json:"completed_at,omitempty"` Name *string `json:"name,omitempty"` diff --git a/github/actions_workflow_jobs_test.go b/github/actions_workflow_jobs_test.go index da52619a195..521e401102b 100644 --- a/github/actions_workflow_jobs_test.go +++ b/github/actions_workflow_jobs_test.go @@ -251,6 +251,7 @@ func TestWorkflowJob_Marshal(t *testing.T) { HTMLURL: String("h"), Status: String("s"), Conclusion: String("c"), + CreatedAt: &Timestamp{referenceTime}, StartedAt: &Timestamp{referenceTime}, CompletedAt: &Timestamp{referenceTime}, Name: String("n"), @@ -278,6 +279,7 @@ func TestWorkflowJob_Marshal(t *testing.T) { "html_url": "h", "status": "s", "conclusion": "c", + "created_at": ` + referenceTimeStr + `, "started_at": ` + referenceTimeStr + `, "completed_at": ` + referenceTimeStr + `, "name": "n", @@ -312,6 +314,7 @@ func TestJobs_Marshal(t *testing.T) { HTMLURL: String("h"), Status: String("s"), Conclusion: String("c"), + CreatedAt: &Timestamp{referenceTime}, StartedAt: &Timestamp{referenceTime}, CompletedAt: &Timestamp{referenceTime}, Name: String("n"), @@ -344,6 +347,7 @@ func TestJobs_Marshal(t *testing.T) { "html_url": "h", "status": "s", "conclusion": "c", + "created_at": ` + referenceTimeStr + `, "started_at": ` + referenceTimeStr + `, "completed_at": ` + referenceTimeStr + `, "name": "n", diff --git a/github/github-accessors.go b/github/github-accessors.go index 59a59a4edb3..a7d800e20a9 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -21006,6 +21006,14 @@ func (w *WorkflowJob) GetConclusion() string { return *w.Conclusion } +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (w *WorkflowJob) GetCreatedAt() Timestamp { + if w == nil || w.CreatedAt == nil { + return Timestamp{} + } + return *w.CreatedAt +} + // GetHeadSHA returns the HeadSHA field if it's non-nil, zero value otherwise. func (w *WorkflowJob) GetHeadSHA() string { if w == nil || w.HeadSHA == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 7239698a308..2bd40a94be4 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -24548,6 +24548,16 @@ func TestWorkflowJob_GetConclusion(tt *testing.T) { w.GetConclusion() } +func TestWorkflowJob_GetCreatedAt(tt *testing.T) { + var zeroValue Timestamp + w := &WorkflowJob{CreatedAt: &zeroValue} + w.GetCreatedAt() + w = &WorkflowJob{} + w.GetCreatedAt() + w = nil + w.GetCreatedAt() +} + func TestWorkflowJob_GetHeadSHA(tt *testing.T) { var zeroValue string w := &WorkflowJob{HeadSHA: &zeroValue} From 4814a50d3876239c88772c10bcd470e3a7ebe4ee Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Thu, 23 Feb 2023 20:01:13 -0500 Subject: [PATCH 169/751] Bump version of go-github to v50.1.0 (#2673) --- README.md | 1 + github/github.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 461ae4d02da..37b373ceecf 100644 --- a/README.md +++ b/README.md @@ -396,6 +396,7 @@ Versions prior to 48.2.0 are not listed. | go-github Version | GitHub v3 API Version | | ----------------- | --------------------- | +| 50.1.0 | 2022-11-28 | | 50.0.0 | 2022-11-28 | | 49.1.0 | 2022-11-28 | | 49.0.0 | 2022-11-28 | diff --git a/github/github.go b/github/github.go index a24d39dee4e..4e0d2f47e8f 100644 --- a/github/github.go +++ b/github/github.go @@ -28,7 +28,7 @@ import ( ) const ( - Version = "v50.0.0" + Version = "v50.1.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" From 099fae4bf5d6700d159c0b4d12f23ad1194ad713 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 25 Feb 2023 07:47:55 -0500 Subject: [PATCH 170/751] Bump golang.org/x/sys from 0.0.0-20210615035016-665e8c7367d1 to 0.1.0 in /example (#2676) --- example/go.mod | 2 +- example/go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/example/go.mod b/example/go.mod index e268c7ad626..6138d931161 100644 --- a/example/go.mod +++ b/example/go.mod @@ -17,7 +17,7 @@ require ( github.com/google/go-github/v41 v41.0.0 // indirect github.com/google/go-querystring v1.1.0 // indirect golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 // indirect - golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 // indirect + golang.org/x/sys v0.1.0 // indirect golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect ) diff --git a/example/go.sum b/example/go.sum index 1043059ffa2..9b12b78db2f 100644 --- a/example/go.sum +++ b/example/go.sum @@ -25,8 +25,9 @@ golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+ golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 h1:SrN+KX8Art/Sf4HNj6Zcz06G7VEz+7w9tdXTPOZ7+l4= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= From 1520a3d52d24f67102f78e5af76ab00872dc0ee8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Mar 2023 11:21:12 -0500 Subject: [PATCH 171/751] Bump github.com/xlzd/gotp from 0.0.0-20181030022105-c8557ba2c119 to 0.1.0 in /scrape (#2684) --- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 3aa019c51dc..97c793d0f66 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -6,6 +6,6 @@ require ( github.com/PuerkitoBio/goquery v1.8.1 github.com/google/go-cmp v0.5.9 github.com/google/go-github/v50 v50.0.0 - github.com/xlzd/gotp v0.0.0-20181030022105-c8557ba2c119 + github.com/xlzd/gotp v0.1.0 golang.org/x/net v0.7.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index a67b43953bf..2ac0d30ecb7 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -12,8 +12,8 @@ github.com/google/go-github/v50 v50.0.0 h1:gdO1AeuSZZK4iYWwVbjni7zg8PIQhp7QfmPun github.com/google/go-github/v50 v50.0.0/go.mod h1:Ev4Tre8QoKiolvbpOSG3FIi4Mlon3S2Nt9W5JYqKiwA= 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= -github.com/xlzd/gotp v0.0.0-20181030022105-c8557ba2c119/go.mod h1:/nuTSlK+okRfR/vnIPqR89fFKonnWPiZymN5ydRJkX8= +github.com/xlzd/gotp v0.1.0 h1:37blvlKCh38s+fkem+fFh7sMnceltoIEBYTVXyoa5Po= +github.com/xlzd/gotp v0.1.0/go.mod h1:ndLJ3JKzi3xLmUProq4LLxCuECL93dG9WASNLpHz8qg= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= From 8b5397f161639ee76ad6976bdc5f7b3fa0d8ca5d Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Mon, 6 Mar 2023 11:39:02 -0500 Subject: [PATCH 172/751] Update golangci-lint-action (#2694) --- .github/workflows/linter.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index cf4edcb6ad3..d57bb7f48e8 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -26,8 +26,8 @@ jobs: - uses: actions/checkout@v3 - name: golangci-lint ${{ matrix.working-directory }} - uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5 #v3.4.0 + uses: golangci/golangci-lint-action@v3 with: - version: v1.50.1 + version: latest working-directory: ${{ matrix.working-directory}} args: --verbose From 62e81bcbd286e6a1348b4a39860df96de91384d1 Mon Sep 17 00:00:00 2001 From: Matt Dainty Date: Mon, 6 Mar 2023 16:58:16 +0000 Subject: [PATCH 173/751] Add ListExternalGroupsForTeamBySlug to Teams API (#2674) --- github/teams.go | 22 ++++++++++++- github/teams_test.go | 73 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+), 1 deletion(-) diff --git a/github/teams.go b/github/teams.go index 963a69b3d91..0ee7c200792 100644 --- a/github/teams.go +++ b/github/teams.go @@ -913,7 +913,7 @@ type ListExternalGroupsOptions struct { ListOptions } -// ListExternalGroups lists external groups connected to a team on GitHub. +// ListExternalGroups lists external groups in an organization on GitHub. // // GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/teams/external-groups#list-external-groups-in-an-organization func (s *TeamsService) ListExternalGroups(ctx context.Context, org string, opts *ListExternalGroupsOptions) (*ExternalGroupList, *Response, error) { @@ -937,6 +937,26 @@ func (s *TeamsService) ListExternalGroups(ctx context.Context, org string, opts return externalGroups, resp, nil } +// ListExternalGroupsForTeamBySlug lists external groups connected to a team on GitHub. +// +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/teams/external-groups#list-a-connection-between-an-external-group-and-a-team +func (s *TeamsService) ListExternalGroupsForTeamBySlug(ctx context.Context, org, slug string) (*ExternalGroupList, *Response, error) { + u := fmt.Sprintf("orgs/%v/teams/%v/external-groups", org, slug) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + externalGroups := new(ExternalGroupList) + resp, err := s.client.Do(ctx, req, externalGroups) + if err != nil { + return nil, resp, err + } + + return externalGroups, resp, nil +} + // UpdateConnectedExternalGroup updates the connection between an external group and a team. // // GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/teams/external-groups#update-the-connection-between-an-external-group-and-a-team diff --git a/github/teams_test.go b/github/teams_test.go index 93e658af096..d86fab7fd6b 100644 --- a/github/teams_test.go +++ b/github/teams_test.go @@ -1935,6 +1935,79 @@ func TestTeamsService_ListExternalGroups_notFound(t *testing.T) { } } +func TestTeamsService_ListExternalGroupsForTeamBySlug(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/teams/t/external-groups", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "groups": [ + { + "group_id": 123, + "group_name": "Octocat admins", + "updated_at": "2006-01-02T15:04:05Z" + } + ] + }`) + }) + + ctx := context.Background() + list, _, err := client.Teams.ListExternalGroupsForTeamBySlug(ctx, "o", "t") + if err != nil { + t.Errorf("Teams.ListExternalGroupsForTeamBySlug returned error: %v", err) + } + + want := &ExternalGroupList{ + Groups: []*ExternalGroup{ + { + GroupID: Int64(123), + GroupName: String("Octocat admins"), + UpdatedAt: &Timestamp{Time: referenceTime}, + }, + }, + } + if !cmp.Equal(list, want) { + t.Errorf("Teams.ListExternalGroupsForTeamBySlug returned %+v, want %+v", list, want) + } + + const methodName = "ListExternalGroupsForTeamBySlug" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Teams.ListExternalGroupsForTeamBySlug(ctx, "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Teams.ListExternalGroupsForTeamBySlug(ctx, "o", "t") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestTeamsService_ListExternalGroupsForTeamBySlug_notFound(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/teams/t/external-groups", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + w.WriteHeader(http.StatusNotFound) + }) + + ctx := context.Background() + eg, resp, err := client.Teams.ListExternalGroupsForTeamBySlug(ctx, "o", "t") + if err == nil { + t.Errorf("Expected HTTP 404 response") + } + if got, want := resp.Response.StatusCode, http.StatusNotFound; got != want { + t.Errorf("Teams.ListExternalGroupsForTeamBySlug returned status %d, want %d", got, want) + } + if eg != nil { + t.Errorf("Teams.ListExternalGroupsForTeamBySlug returned %+v, want nil", eg) + } +} + func TestTeamsService_UpdateConnectedExternalGroup(t *testing.T) { client, mux, _, teardown := setup() defer teardown() From 03a78093fbf85504d756cce23dd1877ba21eb96b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Mar 2023 11:59:33 -0500 Subject: [PATCH 174/751] Bump github.com/google/go-github/v50 from 50.0.0 to 50.1.0 in /scrape (#2683) --- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 97c793d0f66..653f279ffd5 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -5,7 +5,7 @@ go 1.13 require ( github.com/PuerkitoBio/goquery v1.8.1 github.com/google/go-cmp v0.5.9 - github.com/google/go-github/v50 v50.0.0 + github.com/google/go-github/v50 v50.1.0 github.com/xlzd/gotp v0.1.0 golang.org/x/net v0.7.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index 2ac0d30ecb7..496eb3f6ab8 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -8,8 +8,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.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v50 v50.0.0 h1:gdO1AeuSZZK4iYWwVbjni7zg8PIQhp7QfmPunr016Jk= -github.com/google/go-github/v50 v50.0.0/go.mod h1:Ev4Tre8QoKiolvbpOSG3FIi4Mlon3S2Nt9W5JYqKiwA= +github.com/google/go-github/v50 v50.1.0 h1:hMUpkZjklC5GJ+c3GquSqOP/T4BNsB7XohaPhtMOzRk= +github.com/google/go-github/v50 v50.1.0/go.mod h1:Ev4Tre8QoKiolvbpOSG3FIi4Mlon3S2Nt9W5JYqKiwA= 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.1.0 h1:37blvlKCh38s+fkem+fFh7sMnceltoIEBYTVXyoa5Po= From f20fca28387d6f2fca42b7d52009860320fdd564 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Mar 2023 12:09:38 -0500 Subject: [PATCH 175/751] Bump golang.org/x/crypto from 0.0.0-20210817164053-32db794688a5 to 0.1.0 in /example (#2689) --- example/go.mod | 6 +++--- example/go.sum | 24 +++++++++++++++++++++--- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/example/go.mod b/example/go.mod index 6138d931161..9ff03b1cdb3 100644 --- a/example/go.mod +++ b/example/go.mod @@ -6,7 +6,7 @@ require ( github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-ratelimit v1.0.1 github.com/google/go-github/v50 v50.0.0 - golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 + golang.org/x/crypto v0.1.0 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be google.golang.org/appengine v1.6.7 ) @@ -16,9 +16,9 @@ require ( github.com/golang/protobuf v1.3.2 // indirect github.com/google/go-github/v41 v41.0.0 // indirect github.com/google/go-querystring v1.1.0 // indirect - golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 // indirect + golang.org/x/net v0.1.0 // indirect golang.org/x/sys v0.1.0 // indirect - golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect + golang.org/x/term v0.1.0 // indirect ) // Use version at HEAD, not the latest published. diff --git a/example/go.sum b/example/go.sum index 9b12b78db2f..1c33b977474 100644 --- a/example/go.sum +++ b/example/go.sum @@ -15,25 +15,43 @@ github.com/google/go-github/v41 v41.0.0 h1:HseJrM2JFf2vfiZJ8anY2hqBjdfY1Vlj/K27u github.com/google/go-github/v41 v41.0.0/go.mod h1:XgmCA5H323A9rtgExdTcnDkcqp6S30AVACCBDOonIxg= 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/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU= +golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 h1:qWPm9rbaAMKs8Bq/9LRpbMqxWRVUAQwMI9fVrssnTfw= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0= +golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.1.0 h1:g6Z6vPFA9dYBAF7DWcH6sCcOntplXsDKcliusYijMlw= +golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= From 0802498bc24c117e2a692fff9167feb4f0391655 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Mar 2023 12:21:16 -0500 Subject: [PATCH 176/751] Bump golang.org/x/net from 0.0.0-20210226172049-e18ecbb05110 to 0.7.0 in /example (#2691) --- example/go.mod | 6 +++--- example/go.sum | 10 +++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/example/go.mod b/example/go.mod index 9ff03b1cdb3..a2f2ec9cd91 100644 --- a/example/go.mod +++ b/example/go.mod @@ -16,9 +16,9 @@ require ( github.com/golang/protobuf v1.3.2 // indirect github.com/google/go-github/v41 v41.0.0 // indirect github.com/google/go-querystring v1.1.0 // indirect - golang.org/x/net v0.1.0 // indirect - golang.org/x/sys v0.1.0 // indirect - golang.org/x/term v0.1.0 // indirect + golang.org/x/net v0.7.0 // indirect + golang.org/x/sys v0.5.0 // indirect + golang.org/x/term v0.5.0 // indirect ) // Use version at HEAD, not the latest published. diff --git a/example/go.sum b/example/go.sum index 1c33b977474..71e7a992a3a 100644 --- a/example/go.sum +++ b/example/go.sum @@ -26,8 +26,9 @@ golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= +golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -37,17 +38,20 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.1.0 h1:g6Z6vPFA9dYBAF7DWcH6sCcOntplXsDKcliusYijMlw= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= From 54b88f83aea6da1320c6d788b914ae8e551c8f1b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Mar 2023 12:32:58 -0500 Subject: [PATCH 177/751] Bump golang.org/x/net from 0.0.0-20210226172049-e18ecbb05110 to 0.7.0 (#2692) --- go.mod | 2 +- go.sum | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index ceb9aff090e..a62e4f55057 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( require ( github.com/golang/protobuf v1.3.2 // indirect - golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 // indirect + golang.org/x/net v0.7.0 // indirect google.golang.org/appengine v1.6.7 // indirect ) diff --git a/go.sum b/go.sum index fc6f776acef..e7977858d1f 100644 --- a/go.sum +++ b/go.sum @@ -6,22 +6,41 @@ github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= 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/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 h1:qWPm9rbaAMKs8Bq/9LRpbMqxWRVUAQwMI9fVrssnTfw= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= From a2087c78065ee0879234e06731d111e78bd5b788 Mon Sep 17 00:00:00 2001 From: apurwaj2 Date: Mon, 6 Mar 2023 09:43:30 -0800 Subject: [PATCH 178/751] Add DicussionCommentEvent Webhook (#2678) Fixes: #2497. --- github/event.go | 2 + github/event_types.go | 33 ++ github/event_types_test.go | 414 ++++++++++++++++++++++++++ github/github-accessors.go | 160 ++++++++++ github/github-accessors_test.go | 176 +++++++++++ github/messages.go | 1 + github/messages_test.go | 4 + github/repos_hooks_deliveries_test.go | 1 + 8 files changed, 791 insertions(+) diff --git a/github/event.go b/github/event.go index 44c5f46f9b0..1aabf13bade 100644 --- a/github/event.go +++ b/github/event.go @@ -53,6 +53,8 @@ func (e *Event) ParsePayload() (payload interface{}, err error) { payload = &DeploymentStatusEvent{} case "DiscussionEvent": payload = &DiscussionEvent{} + case "DiscussionCommentEvent": + payload = &DiscussionCommentEvent{} case "ForkEvent": payload = &ForkEvent{} case "GitHubAppAuthorizationEvent": diff --git a/github/event_types.go b/github/event_types.go index 50c7b567bcf..598d98d48c3 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -189,6 +189,39 @@ type DeploymentStatusEvent struct { Installation *Installation `json:"installation,omitempty"` } +// DiscussionCommentEvent represents a webhook event for a comment on discussion. +// The Webhook event name is "discussion_comment". +// +// GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#discussion_comment +type DiscussionCommentEvent struct { + // Action is the action that was performed on the comment. + // Possible values are: "created", "edited", "deleted". ** check what all can be added + Action *string `json:"action,omitempty"` + Discussion *Discussion `json:"discussion,omitempty"` + Comment *CommentDiscussion `json:"comment,omitempty"` + Repo *Repository `json:"repository,omitempty"` + Org *Organization `json:"organization,omitempty"` + Sender *User `json:"sender,omitempty"` + Installation *Installation `json:"installation,omitempty"` +} + +// CommentDiscussion represents a comment in a GitHub DiscussionCommentEvent. +type CommentDiscussion struct { + AuthorAssociation *string `json:"author_association,omitempty"` + Body *string `json:"body,omitempty"` + ChildCommentCount *int `json:"child_comment_count,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + DiscussionID *int64 `json:"discussion_id,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + ParentID *int64 `json:"parent_id,omitempty"` + Reactions *Reactions `json:"reactions,omitempty"` + RepositoryURL *string `json:"repository_url,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + User *User `json:"user,omitempty"` +} + // DiscussionEvent represents a webhook event for a discussion. // The Webhook event name is "discussion". // diff --git a/github/event_types_test.go b/github/event_types_test.go index fdc0809e694..7c84146f460 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -5740,6 +5740,420 @@ func TestDeploymentStatusEvent_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } +func TestDiscussionCommentEvent_Marshal(t *testing.T) { + testJSONMarshal(t, &DiscussionCommentEvent{}, "{}") + + u := &DiscussionCommentEvent{ + Comment: &CommentDiscussion{ + AuthorAssociation: String("aa"), + Body: String("bo"), + ChildCommentCount: Int(1), + CreatedAt: &Timestamp{referenceTime}, + DiscussionID: Int64(1), + HTMLURL: String("hurl"), + ID: Int64(1), + NodeID: String("nid"), + ParentID: Int64(1), + Reactions: &Reactions{ + TotalCount: Int(1), + PlusOne: Int(1), + MinusOne: Int(1), + Laugh: Int(1), + Confused: Int(1), + Heart: Int(1), + Hooray: Int(1), + Rocket: Int(1), + Eyes: Int(1), + URL: String("url"), + }, + RepositoryURL: String("rurl"), + UpdatedAt: &Timestamp{referenceTime}, + User: &User{ + Login: String("l"), + ID: Int64(1), + NodeID: String("n"), + URL: String("u"), + ReposURL: String("r"), + EventsURL: String("e"), + AvatarURL: String("a"), + }, + }, + Discussion: &Discussion{ + RepositoryURL: String("rurl"), + DiscussionCategory: &DiscussionCategory{ + ID: Int64(1), + NodeID: String("nid"), + RepositoryID: Int64(1), + Emoji: String("emoji"), + Name: String("name"), + Description: String("description"), + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + Slug: String("slug"), + IsAnswerable: Bool(false), + }, + HTMLURL: String("hurl"), + ID: Int64(1), + NodeID: String("nurl"), + Number: Int(1), + Title: String("title"), + User: &User{ + Login: String("l"), + ID: Int64(1), + NodeID: String("n"), + URL: String("u"), + ReposURL: String("r"), + EventsURL: String("e"), + AvatarURL: String("a"), + }, + State: String("st"), + Locked: Bool(false), + Comments: Int(1), + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + AuthorAssociation: String("aa"), + Body: String("bo"), + }, + Repo: &Repository{ + ID: Int64(1), + URL: String("s"), + Name: String("n"), + }, + Org: &Organization{ + BillingEmail: String("be"), + Blog: String("b"), + Company: String("c"), + Email: String("e"), + TwitterUsername: String("tu"), + Location: String("loc"), + Name: String("n"), + Description: String("d"), + IsVerified: Bool(true), + HasOrganizationProjects: Bool(true), + HasRepositoryProjects: Bool(true), + DefaultRepoPermission: String("drp"), + MembersCanCreateRepos: Bool(true), + MembersCanCreateInternalRepos: Bool(true), + MembersCanCreatePrivateRepos: Bool(true), + MembersCanCreatePublicRepos: Bool(false), + MembersAllowedRepositoryCreationType: String("marct"), + MembersCanCreatePages: Bool(true), + MembersCanCreatePublicPages: Bool(false), + MembersCanCreatePrivatePages: Bool(true), + }, + Sender: &User{ + Login: String("l"), + ID: Int64(1), + NodeID: String("n"), + URL: String("u"), + ReposURL: String("r"), + EventsURL: String("e"), + AvatarURL: String("a"), + }, + Installation: &Installation{ + ID: Int64(1), + NodeID: String("nid"), + AppID: Int64(1), + AppSlug: String("as"), + TargetID: Int64(1), + Account: &User{ + Login: String("l"), + ID: Int64(1), + URL: String("u"), + AvatarURL: String("a"), + GravatarID: String("g"), + Name: String("n"), + Company: String("c"), + Blog: String("b"), + Location: String("l"), + Email: String("e"), + Hireable: Bool(true), + Bio: String("b"), + TwitterUsername: String("t"), + PublicRepos: Int(1), + Followers: Int(1), + Following: Int(1), + CreatedAt: &Timestamp{referenceTime}, + SuspendedAt: &Timestamp{referenceTime}, + }, + AccessTokensURL: String("atu"), + RepositoriesURL: String("ru"), + HTMLURL: String("hu"), + TargetType: String("tt"), + SingleFileName: String("sfn"), + RepositorySelection: String("rs"), + Events: []string{"e"}, + SingleFilePaths: []string{"s"}, + Permissions: &InstallationPermissions{ + Actions: String("a"), + Administration: String("ad"), + Checks: String("c"), + Contents: String("co"), + ContentReferences: String("cr"), + Deployments: String("d"), + Environments: String("e"), + Issues: String("i"), + Metadata: String("md"), + Members: String("m"), + OrganizationAdministration: String("oa"), + OrganizationHooks: String("oh"), + OrganizationPlan: String("op"), + OrganizationPreReceiveHooks: String("opr"), + OrganizationProjects: String("op"), + OrganizationSecrets: String("os"), + OrganizationSelfHostedRunners: String("osh"), + OrganizationUserBlocking: String("oub"), + Packages: String("pkg"), + Pages: String("pg"), + PullRequests: String("pr"), + RepositoryHooks: String("rh"), + RepositoryProjects: String("rp"), + RepositoryPreReceiveHooks: String("rprh"), + Secrets: String("s"), + SecretScanningAlerts: String("ssa"), + SecurityEvents: String("se"), + SingleFile: String("sf"), + Statuses: String("s"), + TeamDiscussions: String("td"), + VulnerabilityAlerts: String("va"), + Workflows: String("w"), + }, + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + HasMultipleSingleFiles: Bool(false), + SuspendedBy: &User{ + Login: String("l"), + ID: Int64(1), + URL: String("u"), + AvatarURL: String("a"), + GravatarID: String("g"), + Name: String("n"), + Company: String("c"), + Blog: String("b"), + Location: String("l"), + Email: String("e"), + Hireable: Bool(true), + Bio: String("b"), + TwitterUsername: String("t"), + PublicRepos: Int(1), + Followers: Int(1), + Following: Int(1), + CreatedAt: &Timestamp{referenceTime}, + SuspendedAt: &Timestamp{referenceTime}, + }, + SuspendedAt: &Timestamp{referenceTime}, + }, + } + + want := `{ + "comment": { + "author_association": "aa", + "body": "bo", + "child_comment_count": 1, + "created_at": ` + referenceTimeStr + `, + "discussion_id": 1, + "html_url": "hurl", + "id": 1, + "node_id": "nid", + "parent_id": 1, + "reactions": { + "total_count": 1, + "+1": 1, + "-1": 1, + "laugh": 1, + "confused": 1, + "heart": 1, + "hooray": 1, + "rocket": 1, + "eyes": 1, + "url": "url" + }, + "repository_url": "rurl", + "updated_at": ` + referenceTimeStr + `, + "user": { + "login": "l", + "id": 1, + "node_id": "n", + "avatar_url": "a", + "url": "u", + "events_url": "e", + "repos_url": "r" + } + }, + "discussion": { + "repository_url": "rurl", + "category": { + "id": 1, + "node_id": "nid", + "repository_id": 1, + "emoji": "emoji", + "name": "name", + "description": "description", + "created_at": ` + referenceTimeStr + `, + "updated_at": ` + referenceTimeStr + `, + "slug": "slug", + "is_answerable": false + }, + "html_url": "hurl", + "id": 1, + "node_id": "nurl", + "number": 1, + "title": "title", + "user": { + "login": "l", + "id": 1, + "node_id": "n", + "avatar_url": "a", + "url": "u", + "events_url": "e", + "repos_url": "r" + }, + "state": "st", + "locked": false, + "comments": 1, + "created_at": ` + referenceTimeStr + `, + "updated_at": ` + referenceTimeStr + `, + "author_association": "aa", + "body": "bo" + }, + "repository": { + "id": 1, + "name": "n", + "url": "s" + }, + "organization": { + "name": "n", + "company": "c", + "blog": "b", + "location": "loc", + "email": "e", + "twitter_username": "tu", + "description": "d", + "billing_email": "be", + "is_verified": true, + "has_organization_projects": true, + "has_repository_projects": true, + "default_repository_permission": "drp", + "members_can_create_repositories": true, + "members_can_create_public_repositories": false, + "members_can_create_private_repositories": true, + "members_can_create_internal_repositories": true, + "members_allowed_repository_creation_type": "marct", + "members_can_create_pages": true, + "members_can_create_public_pages": false, + "members_can_create_private_pages": true + }, + "sender": { + "login": "l", + "id": 1, + "node_id": "n", + "avatar_url": "a", + "url": "u", + "events_url": "e", + "repos_url": "r" + }, + "installation": { + "id": 1, + "node_id": "nid", + "app_id": 1, + "app_slug": "as", + "target_id": 1, + "account": { + "login": "l", + "id": 1, + "avatar_url": "a", + "gravatar_id": "g", + "name": "n", + "company": "c", + "blog": "b", + "location": "l", + "email": "e", + "hireable": true, + "bio": "b", + "twitter_username": "t", + "public_repos": 1, + "followers": 1, + "following": 1, + "created_at": ` + referenceTimeStr + `, + "suspended_at": ` + referenceTimeStr + `, + "url": "u" + }, + "access_tokens_url": "atu", + "repositories_url": "ru", + "html_url": "hu", + "target_type": "tt", + "single_file_name": "sfn", + "repository_selection": "rs", + "events": [ + "e" + ], + "single_file_paths": [ + "s" + ], + "permissions": { + "actions": "a", + "administration": "ad", + "checks": "c", + "contents": "co", + "content_references": "cr", + "deployments": "d", + "environments": "e", + "issues": "i", + "metadata": "md", + "members": "m", + "organization_administration": "oa", + "organization_hooks": "oh", + "organization_plan": "op", + "organization_pre_receive_hooks": "opr", + "organization_projects": "op", + "organization_secrets": "os", + "organization_self_hosted_runners": "osh", + "organization_user_blocking": "oub", + "packages": "pkg", + "pages": "pg", + "pull_requests": "pr", + "repository_hooks": "rh", + "repository_projects": "rp", + "repository_pre_receive_hooks": "rprh", + "secrets": "s", + "secret_scanning_alerts": "ssa", + "security_events": "se", + "single_file": "sf", + "statuses": "s", + "team_discussions": "td", + "vulnerability_alerts": "va", + "workflows": "w" + }, + "created_at": ` + referenceTimeStr + `, + "updated_at": ` + referenceTimeStr + `, + "has_multiple_single_files": false, + "suspended_by": { + "login": "l", + "id": 1, + "avatar_url": "a", + "gravatar_id": "g", + "name": "n", + "company": "c", + "blog": "b", + "location": "l", + "email": "e", + "hireable": true, + "bio": "b", + "twitter_username": "t", + "public_repos": 1, + "followers": 1, + "following": 1, + "created_at": ` + referenceTimeStr + `, + "suspended_at": ` + referenceTimeStr + `, + "url": "u" + }, + "suspended_at": ` + referenceTimeStr + ` + } + }` + + testJSONMarshal(t, u, want) +} + func TestDiscussionEvent_Marshal(t *testing.T) { testJSONMarshal(t, &DiscussionEvent{}, "{}") diff --git a/github/github-accessors.go b/github/github-accessors.go index a7d800e20a9..eba1036f6c2 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -2854,6 +2854,110 @@ func (c *Comment) GetCreatedAt() Timestamp { return *c.CreatedAt } +// GetAuthorAssociation returns the AuthorAssociation field if it's non-nil, zero value otherwise. +func (c *CommentDiscussion) GetAuthorAssociation() string { + if c == nil || c.AuthorAssociation == nil { + return "" + } + return *c.AuthorAssociation +} + +// GetBody returns the Body field if it's non-nil, zero value otherwise. +func (c *CommentDiscussion) GetBody() string { + if c == nil || c.Body == nil { + return "" + } + return *c.Body +} + +// GetChildCommentCount returns the ChildCommentCount field if it's non-nil, zero value otherwise. +func (c *CommentDiscussion) GetChildCommentCount() int { + if c == nil || c.ChildCommentCount == nil { + return 0 + } + return *c.ChildCommentCount +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (c *CommentDiscussion) GetCreatedAt() Timestamp { + if c == nil || c.CreatedAt == nil { + return Timestamp{} + } + return *c.CreatedAt +} + +// GetDiscussionID returns the DiscussionID field if it's non-nil, zero value otherwise. +func (c *CommentDiscussion) GetDiscussionID() int64 { + if c == nil || c.DiscussionID == nil { + return 0 + } + return *c.DiscussionID +} + +// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. +func (c *CommentDiscussion) GetHTMLURL() string { + if c == nil || c.HTMLURL == nil { + return "" + } + return *c.HTMLURL +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (c *CommentDiscussion) GetID() int64 { + if c == nil || c.ID == nil { + return 0 + } + return *c.ID +} + +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (c *CommentDiscussion) GetNodeID() string { + if c == nil || c.NodeID == nil { + return "" + } + return *c.NodeID +} + +// GetParentID returns the ParentID field if it's non-nil, zero value otherwise. +func (c *CommentDiscussion) GetParentID() int64 { + if c == nil || c.ParentID == nil { + return 0 + } + return *c.ParentID +} + +// GetReactions returns the Reactions field. +func (c *CommentDiscussion) GetReactions() *Reactions { + if c == nil { + return nil + } + return c.Reactions +} + +// GetRepositoryURL returns the RepositoryURL field if it's non-nil, zero value otherwise. +func (c *CommentDiscussion) GetRepositoryURL() string { + if c == nil || c.RepositoryURL == nil { + return "" + } + return *c.RepositoryURL +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (c *CommentDiscussion) GetUpdatedAt() Timestamp { + if c == nil || c.UpdatedAt == nil { + return Timestamp{} + } + return *c.UpdatedAt +} + +// GetUser returns the User field. +func (c *CommentDiscussion) GetUser() *User { + if c == nil { + return nil + } + return c.User +} + // GetTotalCommitComments returns the TotalCommitComments field if it's non-nil, zero value otherwise. func (c *CommentStats) GetTotalCommitComments() int { if c == nil || c.TotalCommitComments == nil { @@ -5046,6 +5150,62 @@ func (d *DiscussionComment) GetURL() string { return *d.URL } +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (d *DiscussionCommentEvent) GetAction() string { + if d == nil || d.Action == nil { + return "" + } + return *d.Action +} + +// GetComment returns the Comment field. +func (d *DiscussionCommentEvent) GetComment() *CommentDiscussion { + if d == nil { + return nil + } + return d.Comment +} + +// GetDiscussion returns the Discussion field. +func (d *DiscussionCommentEvent) GetDiscussion() *Discussion { + if d == nil { + return nil + } + return d.Discussion +} + +// GetInstallation returns the Installation field. +func (d *DiscussionCommentEvent) GetInstallation() *Installation { + if d == nil { + return nil + } + return d.Installation +} + +// GetOrg returns the Org field. +func (d *DiscussionCommentEvent) GetOrg() *Organization { + if d == nil { + return nil + } + return d.Org +} + +// GetRepo returns the Repo field. +func (d *DiscussionCommentEvent) GetRepo() *Repository { + if d == nil { + return nil + } + return d.Repo +} + +// GetSender returns the Sender field. +func (d *DiscussionCommentEvent) GetSender() *User { + if d == nil { + return nil + } + return d.Sender +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (d *DiscussionEvent) GetAction() string { if d == nil || d.Action == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 2bd40a94be4..044a45bd486 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -3373,6 +3373,130 @@ func TestComment_GetCreatedAt(tt *testing.T) { c.GetCreatedAt() } +func TestCommentDiscussion_GetAuthorAssociation(tt *testing.T) { + var zeroValue string + c := &CommentDiscussion{AuthorAssociation: &zeroValue} + c.GetAuthorAssociation() + c = &CommentDiscussion{} + c.GetAuthorAssociation() + c = nil + c.GetAuthorAssociation() +} + +func TestCommentDiscussion_GetBody(tt *testing.T) { + var zeroValue string + c := &CommentDiscussion{Body: &zeroValue} + c.GetBody() + c = &CommentDiscussion{} + c.GetBody() + c = nil + c.GetBody() +} + +func TestCommentDiscussion_GetChildCommentCount(tt *testing.T) { + var zeroValue int + c := &CommentDiscussion{ChildCommentCount: &zeroValue} + c.GetChildCommentCount() + c = &CommentDiscussion{} + c.GetChildCommentCount() + c = nil + c.GetChildCommentCount() +} + +func TestCommentDiscussion_GetCreatedAt(tt *testing.T) { + var zeroValue Timestamp + c := &CommentDiscussion{CreatedAt: &zeroValue} + c.GetCreatedAt() + c = &CommentDiscussion{} + c.GetCreatedAt() + c = nil + c.GetCreatedAt() +} + +func TestCommentDiscussion_GetDiscussionID(tt *testing.T) { + var zeroValue int64 + c := &CommentDiscussion{DiscussionID: &zeroValue} + c.GetDiscussionID() + c = &CommentDiscussion{} + c.GetDiscussionID() + c = nil + c.GetDiscussionID() +} + +func TestCommentDiscussion_GetHTMLURL(tt *testing.T) { + var zeroValue string + c := &CommentDiscussion{HTMLURL: &zeroValue} + c.GetHTMLURL() + c = &CommentDiscussion{} + c.GetHTMLURL() + c = nil + c.GetHTMLURL() +} + +func TestCommentDiscussion_GetID(tt *testing.T) { + var zeroValue int64 + c := &CommentDiscussion{ID: &zeroValue} + c.GetID() + c = &CommentDiscussion{} + c.GetID() + c = nil + c.GetID() +} + +func TestCommentDiscussion_GetNodeID(tt *testing.T) { + var zeroValue string + c := &CommentDiscussion{NodeID: &zeroValue} + c.GetNodeID() + c = &CommentDiscussion{} + c.GetNodeID() + c = nil + c.GetNodeID() +} + +func TestCommentDiscussion_GetParentID(tt *testing.T) { + var zeroValue int64 + c := &CommentDiscussion{ParentID: &zeroValue} + c.GetParentID() + c = &CommentDiscussion{} + c.GetParentID() + c = nil + c.GetParentID() +} + +func TestCommentDiscussion_GetReactions(tt *testing.T) { + c := &CommentDiscussion{} + c.GetReactions() + c = nil + c.GetReactions() +} + +func TestCommentDiscussion_GetRepositoryURL(tt *testing.T) { + var zeroValue string + c := &CommentDiscussion{RepositoryURL: &zeroValue} + c.GetRepositoryURL() + c = &CommentDiscussion{} + c.GetRepositoryURL() + c = nil + c.GetRepositoryURL() +} + +func TestCommentDiscussion_GetUpdatedAt(tt *testing.T) { + var zeroValue Timestamp + c := &CommentDiscussion{UpdatedAt: &zeroValue} + c.GetUpdatedAt() + c = &CommentDiscussion{} + c.GetUpdatedAt() + c = nil + c.GetUpdatedAt() +} + +func TestCommentDiscussion_GetUser(tt *testing.T) { + c := &CommentDiscussion{} + c.GetUser() + c = nil + c.GetUser() +} + func TestCommentStats_GetTotalCommitComments(tt *testing.T) { var zeroValue int c := &CommentStats{TotalCommitComments: &zeroValue} @@ -5921,6 +6045,58 @@ func TestDiscussionComment_GetURL(tt *testing.T) { d.GetURL() } +func TestDiscussionCommentEvent_GetAction(tt *testing.T) { + var zeroValue string + d := &DiscussionCommentEvent{Action: &zeroValue} + d.GetAction() + d = &DiscussionCommentEvent{} + d.GetAction() + d = nil + d.GetAction() +} + +func TestDiscussionCommentEvent_GetComment(tt *testing.T) { + d := &DiscussionCommentEvent{} + d.GetComment() + d = nil + d.GetComment() +} + +func TestDiscussionCommentEvent_GetDiscussion(tt *testing.T) { + d := &DiscussionCommentEvent{} + d.GetDiscussion() + d = nil + d.GetDiscussion() +} + +func TestDiscussionCommentEvent_GetInstallation(tt *testing.T) { + d := &DiscussionCommentEvent{} + d.GetInstallation() + d = nil + d.GetInstallation() +} + +func TestDiscussionCommentEvent_GetOrg(tt *testing.T) { + d := &DiscussionCommentEvent{} + d.GetOrg() + d = nil + d.GetOrg() +} + +func TestDiscussionCommentEvent_GetRepo(tt *testing.T) { + d := &DiscussionCommentEvent{} + d.GetRepo() + d = nil + d.GetRepo() +} + +func TestDiscussionCommentEvent_GetSender(tt *testing.T) { + d := &DiscussionCommentEvent{} + d.GetSender() + d = nil + d.GetSender() +} + func TestDiscussionEvent_GetAction(tt *testing.T) { var zeroValue string d := &DiscussionEvent{Action: &zeroValue} diff --git a/github/messages.go b/github/messages.go index ceac6d9bc40..0943b9e9870 100644 --- a/github/messages.go +++ b/github/messages.go @@ -56,6 +56,7 @@ var ( "deployment": "DeploymentEvent", "deployment_status": "DeploymentStatusEvent", "discussion": "DiscussionEvent", + "discussion_comment": "DiscussionCommentEvent", "fork": "ForkEvent", "github_app_authorization": "GitHubAppAuthorizationEvent", "gollum": "GollumEvent", diff --git a/github/messages_test.go b/github/messages_test.go index 9819ddbe616..ee374104ce0 100644 --- a/github/messages_test.go +++ b/github/messages_test.go @@ -305,6 +305,10 @@ func TestParseWebHook(t *testing.T) { payload: &DeploymentStatusEvent{}, messageType: "deployment_status", }, + { + payload: &DiscussionCommentEvent{}, + messageType: "discussion_comment", + }, { payload: &DiscussionEvent{}, messageType: "discussion", diff --git a/github/repos_hooks_deliveries_test.go b/github/repos_hooks_deliveries_test.go index 44b0f89abb6..ef453996a90 100644 --- a/github/repos_hooks_deliveries_test.go +++ b/github/repos_hooks_deliveries_test.go @@ -153,6 +153,7 @@ var hookDeliveryPayloadTypeToStruct = map[string]interface{}{ "deploy_key": &DeployKeyEvent{}, "deployment": &DeploymentEvent{}, "deployment_status": &DeploymentStatusEvent{}, + "discussion_comment": &DiscussionCommentEvent{}, "discussion": &DiscussionEvent{}, "fork": &ForkEvent{}, "github_app_authorization": &GitHubAppAuthorizationEvent{}, From 5cae080969b4dead34c15db8e64798bc20d8084b Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Mon, 6 Mar 2023 12:54:25 -0500 Subject: [PATCH 179/751] Run go mod tidy -compat=1.17 (#2696) --- go.sum | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/go.sum b/go.sum index e7977858d1f..fd4736f1f98 100644 --- a/go.sum +++ b/go.sum @@ -6,41 +6,18 @@ github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= 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/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= From 9065cc90c8bb87aeed08b3a4458b5873bdc9cf58 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Mon, 6 Mar 2023 13:15:13 -0500 Subject: [PATCH 180/751] Fix golangci-lint (#2697) --- .github/workflows/linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index d57bb7f48e8..5c5658e00df 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -30,4 +30,4 @@ jobs: with: version: latest working-directory: ${{ matrix.working-directory}} - args: --verbose + args: --verbose ./... From 106bd1bf6be637610837d89bfb6aab78e8a3a091 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Mar 2023 13:27:18 -0500 Subject: [PATCH 181/751] Bump golang.org/x/crypto from 0.0.0-20210817164053-32db794688a5 to 0.7.0 (#2693) --- go.mod | 4 ++-- go.sum | 37 +++++++++++++++++++++++++++++++++---- 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index a62e4f55057..725e6c962bc 100644 --- a/go.mod +++ b/go.mod @@ -3,13 +3,13 @@ module github.com/google/go-github/v50 require ( github.com/google/go-cmp v0.5.9 github.com/google/go-querystring v1.1.0 - golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 + golang.org/x/crypto v0.7.0 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be ) require ( github.com/golang/protobuf v1.3.2 // indirect - golang.org/x/net v0.7.0 // indirect + golang.org/x/net v0.8.0 // indirect google.golang.org/appengine v1.6.7 // indirect ) diff --git a/go.sum b/go.sum index fd4736f1f98..d05b24f79a9 100644 --- a/go.sum +++ b/go.sum @@ -6,18 +6,47 @@ github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= 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/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ= -golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= +golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= From 572b301ba1c020968d022e1e105e5006cacd9c9b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Mar 2023 13:30:46 -0500 Subject: [PATCH 182/751] Bump golang.org/x/oauth2 from 0.0.0-20180821212333-d2e6202438be to 0.6.0 (#2695) --- go.mod | 5 +++-- go.sum | 16 ++++++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 725e6c962bc..b2cb66a2463 100644 --- a/go.mod +++ b/go.mod @@ -4,13 +4,14 @@ require ( github.com/google/go-cmp v0.5.9 github.com/google/go-querystring v1.1.0 golang.org/x/crypto v0.7.0 - golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be + golang.org/x/oauth2 v0.6.0 ) require ( - github.com/golang/protobuf v1.3.2 // indirect + github.com/golang/protobuf v1.5.2 // indirect golang.org/x/net v0.8.0 // indirect google.golang.org/appengine v1.6.7 // indirect + google.golang.org/protobuf v1.28.0 // indirect ) go 1.17 diff --git a/go.sum b/go.sum index d05b24f79a9..1e11cc4ce8c 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,11 @@ +cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= @@ -20,8 +24,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.6.0 h1:Lh8GPgSKBfWSwFvtuWOfeI3aAAnbXTSutYxJiOJFgIw= +golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -50,3 +54,7 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= From bfc1fbbd3224ea77a8883cf28a2ab55224842c4d Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Tue, 7 Mar 2023 14:09:30 -0500 Subject: [PATCH 183/751] Remove example subdirs in GitHub Actions linter workflow (#2701) --- .github/workflows/linter.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 5c5658e00df..a494d8fb779 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -17,7 +17,7 @@ jobs: # since that needs libsodium to run. working-directory: - "" - - example + # - example # Fails with "no go files to analyze" - scrape - update-urls runs-on: ${{ matrix.platform }} @@ -30,4 +30,4 @@ jobs: with: version: latest working-directory: ${{ matrix.working-directory}} - args: --verbose ./... + args: --verbose From 862134b723195e0976b39addab03a695a21be840 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Mar 2023 14:16:48 -0500 Subject: [PATCH 184/751] Bump golang.org/x/net from 0.7.0 to 0.8.0 in /scrape (#2698) --- scrape/go.mod | 2 +- scrape/go.sum | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 653f279ffd5..1cab9dd6a3c 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -7,5 +7,5 @@ require ( github.com/google/go-cmp v0.5.9 github.com/google/go-github/v50 v50.1.0 github.com/xlzd/gotp v0.1.0 - golang.org/x/net v0.7.0 + golang.org/x/net v0.8.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index 496eb3f6ab8..50ed7004bef 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -20,17 +20,21 @@ golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -38,18 +42,22 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= From 73075b9392f55369744241511f3c7dd0a9d694e3 Mon Sep 17 00:00:00 2001 From: Alex Ellis Date: Wed, 8 Mar 2023 12:58:51 +0000 Subject: [PATCH 185/751] Add head_sha for ListWorkflowRunsOptions (#2703) Fixes: #2687. --- github/actions_workflow_runs.go | 1 + 1 file changed, 1 insertion(+) diff --git a/github/actions_workflow_runs.go b/github/actions_workflow_runs.go index 6241dc629fc..0cda90d41b2 100644 --- a/github/actions_workflow_runs.go +++ b/github/actions_workflow_runs.go @@ -60,6 +60,7 @@ type ListWorkflowRunsOptions struct { Event string `url:"event,omitempty"` Status string `url:"status,omitempty"` Created string `url:"created,omitempty"` + HeadSHA string `url:"head_sha,omitempty"` ListOptions } From 14bb610698fc2f9013cad5db79b2d5fe4d53e13c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=92=8B=E8=88=AA?= Date: Thu, 9 Mar 2023 02:23:40 +0800 Subject: [PATCH 186/751] Support HTTP Proxy from environment (#2686) --- github/github.go | 5 +++++ github/github_test.go | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/github/github.go b/github/github.go index 4e0d2f47e8f..58715b11c6f 100644 --- a/github/github.go +++ b/github/github.go @@ -348,6 +348,11 @@ func NewClient(httpClient *http.Client) *Client { return c } +// NewClientWithEnvProxy enhances NewClient with the HttpProxy env. +func NewClientWithEnvProxy() *Client { + return NewClient(&http.Client{Transport: &http.Transport{Proxy: http.ProxyFromEnvironment}}) +} + // NewTokenClient returns a new GitHub API client authenticated with the provided token. func NewTokenClient(ctx context.Context, token string) *Client { return NewClient(oauth2.NewClient(ctx, oauth2.StaticTokenSource(&oauth2.Token{AccessToken: token}))) diff --git a/github/github_test.go b/github/github_test.go index 0c969404341..4a70649d61d 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -264,6 +264,13 @@ func TestNewClient(t *testing.T) { } } +func TestNewClientWithEnvProxy(t *testing.T) { + client := NewClientWithEnvProxy() + if got, want := client.BaseURL.String(), defaultBaseURL; got != want { + t.Errorf("NewClient BaseURL is %v, want %v", got, want) + } +} + func TestClient(t *testing.T) { c := NewClient(nil) c2 := c.Client() From e0bb5351e0e6f0808385f59e668071ade10a2358 Mon Sep 17 00:00:00 2001 From: Geraldo Castro <6025018+exageraldo@users.noreply.github.com> Date: Wed, 8 Mar 2023 15:26:51 -0300 Subject: [PATCH 187/751] Update custom repo roles URL (#2702) Fixes: #2700. --- github/orgs_custom_roles.go | 14 +++++++------- github/orgs_custom_roles_test.go | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/github/orgs_custom_roles.go b/github/orgs_custom_roles.go index 41270b32215..7c1b2d6292d 100644 --- a/github/orgs_custom_roles.go +++ b/github/orgs_custom_roles.go @@ -32,7 +32,7 @@ type CustomRepoRoles struct { // // GitHub API docs: https://docs.github.com/en/rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization func (s *OrganizationsService) ListCustomRepoRoles(ctx context.Context, org string) (*OrganizationCustomRepoRoles, *Response, error) { - u := fmt.Sprintf("orgs/%v/custom_roles", org) + u := fmt.Sprintf("orgs/%v/custom-repository-roles", org) req, err := s.client.NewRequest("GET", u, nil) if err != nil { @@ -59,9 +59,9 @@ type CreateOrUpdateCustomRoleOptions struct { // CreateCustomRepoRole creates a custom repository role in this organization. // In order to create custom repository roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/custom-roles#create-a-custom-role +// GitHub API docs: https://docs.github.com/en/rest/orgs/custom-roles#create-a-custom-repository-role func (s *OrganizationsService) CreateCustomRepoRole(ctx context.Context, org string, opts *CreateOrUpdateCustomRoleOptions) (*CustomRepoRoles, *Response, error) { - u := fmt.Sprintf("orgs/%v/custom_roles", org) + u := fmt.Sprintf("orgs/%v/custom-repository-roles", org) req, err := s.client.NewRequest("POST", u, opts) if err != nil { @@ -80,9 +80,9 @@ func (s *OrganizationsService) CreateCustomRepoRole(ctx context.Context, org str // UpdateCustomRepoRole updates a custom repository role in this organization. // In order to update custom repository roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/custom-roles#update-a-custom-role +// GitHub API docs: https://docs.github.com/en/rest/orgs/custom-roles#update-a-custom-repository-role func (s *OrganizationsService) UpdateCustomRepoRole(ctx context.Context, org, roleID string, opts *CreateOrUpdateCustomRoleOptions) (*CustomRepoRoles, *Response, error) { - u := fmt.Sprintf("orgs/%v/custom_roles/%v", org, roleID) + u := fmt.Sprintf("orgs/%v/custom-repository-roles/%v", org, roleID) req, err := s.client.NewRequest("PATCH", u, opts) if err != nil { @@ -101,9 +101,9 @@ func (s *OrganizationsService) UpdateCustomRepoRole(ctx context.Context, org, ro // DeleteCustomRepoRole deletes an existing custom repository role in this organization. // In order to delete custom repository roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/custom-roles#delete-a-custom-role +// GitHub API docs: https://docs.github.com/en/rest/orgs/custom-roles#delete-a-custom-repository-role func (s *OrganizationsService) DeleteCustomRepoRole(ctx context.Context, org, roleID string) (*Response, error) { - u := fmt.Sprintf("orgs/%v/custom_roles/%v", org, roleID) + u := fmt.Sprintf("orgs/%v/custom-repository-roles/%v", org, roleID) req, err := s.client.NewRequest("DELETE", u, nil) if err != nil { diff --git a/github/orgs_custom_roles_test.go b/github/orgs_custom_roles_test.go index 720190c2886..08810909a06 100644 --- a/github/orgs_custom_roles_test.go +++ b/github/orgs_custom_roles_test.go @@ -18,7 +18,7 @@ func TestOrganizationsService_ListCustomRepoRoles(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - mux.HandleFunc("/orgs/o/custom_roles", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/custom-repository-roles", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `{"total_count": 1, "custom_roles": [{ "id": 1, "name": "Developer", "base_role": "write", "permissions": ["delete_alerts_code_scanning"]}]}`) }) @@ -53,7 +53,7 @@ func TestOrganizationsService_CreateCustomRepoRole(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - mux.HandleFunc("/orgs/o/custom_roles", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/custom-repository-roles", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") fmt.Fprint(w, `{"id":8030,"name":"Labeler","description":"A role for issue and PR labelers","base_role":"read","permissions":["add_label"]}`) }) @@ -96,7 +96,7 @@ func TestOrganizationsService_UpdateCustomRepoRole(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - mux.HandleFunc("/orgs/o/custom_roles/8030", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/custom-repository-roles/8030", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") fmt.Fprint(w, `{"id":8030,"name":"Updated Name","description":"Updated Description","base_role":"read","permissions":["add_label"]}`) }) @@ -137,7 +137,7 @@ func TestOrganizationsService_DeleteCustomRepoRole(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - mux.HandleFunc("/orgs/o/custom_roles/8030", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/custom-repository-roles/8030", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") w.WriteHeader(http.StatusNoContent) }) From 8e34527de863ba367210ce0e848af5bedbf1168c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juli=C3=A1n=20Crespo?= <21377494+komod0@users.noreply.github.com> Date: Wed, 8 Mar 2023 18:03:04 -0300 Subject: [PATCH 188/751] Move to Protonmail PGP (#2666) Fixes: #2317. --- github/git_commits.go | 2 +- github/git_commits_test.go | 14 +++++++++++--- github/repos_commits_test.go | 2 +- github/repos_contents_test.go | 2 +- go.mod | 5 ++++- go.sum | 31 +++++++------------------------ 6 files changed, 25 insertions(+), 31 deletions(-) diff --git a/github/git_commits.go b/github/git_commits.go index 81994c6e50a..862837c0d59 100644 --- a/github/git_commits.go +++ b/github/git_commits.go @@ -12,7 +12,7 @@ import ( "fmt" "strings" - "golang.org/x/crypto/openpgp" + "github.com/ProtonMail/go-crypto/openpgp" ) // SignatureVerification represents GPG signature verification. diff --git a/github/git_commits_test.go b/github/git_commits_test.go index 1fbfa0d2e1d..efdb0a27dc8 100644 --- a/github/git_commits_test.go +++ b/github/git_commits_test.go @@ -14,8 +14,8 @@ import ( "testing" "time" + "github.com/ProtonMail/go-crypto/openpgp" "github.com/google/go-cmp/cmp" - "golang.org/x/crypto/openpgp" ) func TestCommit_Marshal(t *testing.T) { @@ -309,6 +309,9 @@ func TestGitService_CreateSignedCommitWithKey(t *testing.T) { t.Errorf("Error reading keyring: %+v", err) } + // Set the key lifetime to nil so we don't care about the example key expiring and making tests fail + keyring[0].Identities["go-github "].SelfSignature.KeyLifetimeSecs = nil + date, _ := time.Parse("Mon Jan 02 15:04:05 2006 -0700", "Thu May 04 00:03:43 2017 +0200") author := CommitAuthor{ Name: String("go-github"), @@ -344,7 +347,7 @@ Commit Message.`) } sigReader := strings.NewReader(*v.Signature) - signer, err := openpgp.CheckArmoredDetachedSignature(keyring, messageReader, sigReader) + signer, err := openpgp.CheckArmoredDetachedSignature(keyring, messageReader, sigReader, nil) if err != nil { t.Errorf("Error verifying signature: %+v", err) } @@ -409,8 +412,13 @@ func TestGitService_createSignature_noAuthor(t *testing.T) { func TestGitService_createSignature_invalidKey(t *testing.T) { date, _ := time.Parse("Mon Jan 02 15:04:05 2006 -0700", "Thu May 04 00:03:43 2017 +0200") + authorName := "go-github" + authorEmail := "go-github@github.com" + + signKey, _ := openpgp.NewEntity(authorName, "", authorEmail, nil) + _ = signKey.RevokeKey(0, "Invalidate key", nil) - _, err := createSignature(&openpgp.Entity{}, &createCommit{ + _, err := createSignature(signKey, &createCommit{ Message: String("Commit Message."), Tree: String("t"), Parents: []string{"p"}, diff --git a/github/repos_commits_test.go b/github/repos_commits_test.go index c5c132786c0..5840e677880 100644 --- a/github/repos_commits_test.go +++ b/github/repos_commits_test.go @@ -14,8 +14,8 @@ import ( "testing" "time" + "github.com/ProtonMail/go-crypto/openpgp" "github.com/google/go-cmp/cmp" - "golang.org/x/crypto/openpgp" ) func TestRepositoriesService_ListCommits(t *testing.T) { diff --git a/github/repos_contents_test.go b/github/repos_contents_test.go index 6616e5af0c0..29262ce2db1 100644 --- a/github/repos_contents_test.go +++ b/github/repos_contents_test.go @@ -14,8 +14,8 @@ import ( "net/url" "testing" + "github.com/ProtonMail/go-crypto/openpgp" "github.com/google/go-cmp/cmp" - "golang.org/x/crypto/openpgp" ) func TestRepositoryContent_GetContent(t *testing.T) { diff --git a/go.mod b/go.mod index b2cb66a2463..032ba17da7d 100644 --- a/go.mod +++ b/go.mod @@ -1,15 +1,18 @@ module github.com/google/go-github/v50 require ( + github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 github.com/google/go-cmp v0.5.9 github.com/google/go-querystring v1.1.0 - golang.org/x/crypto v0.7.0 golang.org/x/oauth2 v0.6.0 ) require ( + github.com/cloudflare/circl v1.1.0 // indirect github.com/golang/protobuf v1.5.2 // indirect + golang.org/x/crypto v0.7.0 // indirect golang.org/x/net v0.8.0 // indirect + golang.org/x/sys v0.6.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.28.0 // indirect ) diff --git a/go.sum b/go.sum index 1e11cc4ce8c..098145c5d9a 100644 --- a/go.sum +++ b/go.sum @@ -1,56 +1,39 @@ -cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= +github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= +github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= +github.com/cloudflare/circl v1.1.0 h1:bZgT/A+cikZnKIwn7xL2OBj012Bmvho/o6RpRvv3GKY= +github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= 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/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/oauth2 v0.6.0 h1:Lh8GPgSKBfWSwFvtuWOfeI3aAAnbXTSutYxJiOJFgIw= golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= From 9bfbc0063c544ba14ebd5298242f4ba9bdbe8c6f Mon Sep 17 00:00:00 2001 From: Geraldo Castro <6025018+exageraldo@users.noreply.github.com> Date: Wed, 8 Mar 2023 22:54:57 -0300 Subject: [PATCH 189/751] Fix SCIM query params (#2680) Fixes: #2679. --- github/github_test.go | 27 +++++++++++++++++++++++++++ github/scim.go | 6 +++--- github/scim_test.go | 42 +++++++++++++++++++++++++++++------------- 3 files changed, 59 insertions(+), 16 deletions(-) diff --git a/github/github_test.go b/github/github_test.go index 4a70649d61d..9c40728f4d6 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -169,6 +169,33 @@ func testJSONMarshal(t *testing.T, v interface{}, want string) { } } +// Test whether the v fields have the url tag and the parsing of v +// produces query parameters that corresponds to the want string. +func testAddURLOptions(t *testing.T, url string, v interface{}, want string) { + t.Helper() + + vt := reflect.Indirect(reflect.ValueOf(v)).Type() + for i := 0; i < vt.NumField(); i++ { + field := vt.Field(i) + if alias, ok := field.Tag.Lookup("url"); ok { + if alias == "" { + t.Errorf("The field %+v has a blank url tag", field) + } + } else { + t.Errorf("The field %+v has no url tag specified", field) + } + } + + got, err := addOptions(url, v) + if err != nil { + t.Errorf("Unable to add %#v as query parameters", v) + } + + if got != want { + t.Errorf("addOptions(%q, %#v) returned %v, want %v", url, v, got, want) + } +} + // Test how bad options are handled. Method f under test should // return an error. func testBadOptions(t *testing.T, methodName string, f func() error) { diff --git a/github/scim.go b/github/scim.go index 70f81ed14e6..7deee6be4b5 100644 --- a/github/scim.go +++ b/github/scim.go @@ -69,14 +69,14 @@ type SCIMProvisionedIdentities struct { // // Github API docs: https://docs.github.com/en/rest/scim#list-scim-provisioned-identities--parameters type ListSCIMProvisionedIdentitiesOptions struct { - StartIndex *int `json:"startIndex,omitempty"` // Used for pagination: the index of the first result to return. (Optional.) - Count *int `json:"count,omitempty"` // Used for pagination: the number of results to return. (Optional.) + StartIndex *int `url:"startIndex,omitempty"` // Used for pagination: the index of the first result to return. (Optional.) + Count *int `url:"count,omitempty"` // Used for pagination: the number of results to return. (Optional.) // Filter results using the equals query parameter operator (eq). // You can filter results that are equal to id, userName, emails, and external_id. // For example, to search for an identity with the userName Octocat, you would use this query: ?filter=userName%20eq%20\"Octocat\". // To filter results for the identity with the email octocat@github.com, you would use this query: ?filter=emails%20eq%20\"octocat@github.com\". // (Optional.) - Filter *string `json:"filter,omitempty"` + Filter *string `url:"filter,omitempty"` } // ListSCIMProvisionedIdentities lists SCIM provisioned identities. diff --git a/github/scim_test.go b/github/scim_test.go index c2663bb776c..9e5274766aa 100644 --- a/github/scim_test.go +++ b/github/scim_test.go @@ -7,6 +7,7 @@ package github import ( "context" + "fmt" "net/http" "testing" "time" @@ -428,22 +429,37 @@ func TestUpdateAttributeForSCIMUserOptions_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } -func TestListSCIMProvisionedIdentitiesOptions_Marshal(t *testing.T) { - testJSONMarshal(t, &ListSCIMProvisionedIdentitiesOptions{}, `{}`) +func TestListSCIMProvisionedIdentitiesOptions_addOptions(t *testing.T) { + testJSONMarshal(t, &ListSCIMProvisionedIdentitiesOptions{}, `{ + "StartIndex": null, + "Count": null, + "Filter": null + }`) - u := &ListSCIMProvisionedIdentitiesOptions{ - StartIndex: Int(1), - Count: Int(10), - Filter: String("test"), - } + url := "some/path" - want := `{ - "startIndex": 1, - "count": 10, - "filter": "test" - }` + testAddURLOptions(t, url, &ListSCIMProvisionedIdentitiesOptions{}, url) - testJSONMarshal(t, u, want) + testAddURLOptions( + t, + url, + &ListSCIMProvisionedIdentitiesOptions{ + StartIndex: Int(1), + Count: Int(10), + }, + fmt.Sprintf("%s?count=10&startIndex=1", url), + ) + + testAddURLOptions( + t, + url, + &ListSCIMProvisionedIdentitiesOptions{ + StartIndex: Int(1), + Count: Int(10), + Filter: String("test"), + }, + fmt.Sprintf("%s?count=10&filter=test&startIndex=1", url), + ) } func TestSCIMUserName_Marshal(t *testing.T) { From 9e4a1fd8ad788a54992b1524b898df22eeb91699 Mon Sep 17 00:00:00 2001 From: Mike Verbanic Date: Fri, 17 Mar 2023 12:13:57 -0400 Subject: [PATCH 190/751] Add fields to update repository API and create branch protection API to match GitHub APIs (#2709) --- github/github-accessors.go | 48 +++++++++++++++++++++++++++ github/github-accessors_test.go | 57 +++++++++++++++++++++++++++++++++ github/github-stringify_test.go | 3 +- github/repos.go | 17 ++++++++++ github/repos_test.go | 39 ++++++++++++++++++++++ test/integration/repos_test.go | 14 +++++++- 6 files changed, 176 insertions(+), 2 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index eba1036f6c2..beeb2defce6 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -1766,6 +1766,14 @@ func (b *Blob) GetURL() string { return *b.URL } +// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise. +func (b *BlockCreations) GetEnabled() bool { + if b == nil || b.Enabled == nil { + return false + } + return *b.Enabled +} + // GetCommit returns the Commit field. func (b *Branch) GetCommit() *RepositoryCommit { if b == nil { @@ -12830,6 +12838,14 @@ func (p *Protection) GetAllowForkSyncing() *AllowForkSyncing { return p.AllowForkSyncing } +// GetBlockCreations returns the BlockCreations field. +func (p *Protection) GetBlockCreations() *BlockCreations { + if p == nil { + return nil + } + return p.BlockCreations +} + // GetEnforceAdmins returns the EnforceAdmins field. func (p *Protection) GetEnforceAdmins() *AdminEnforcement { if p == nil { @@ -13022,6 +13038,30 @@ func (p *ProtectionRequest) GetAllowForcePushes() bool { return *p.AllowForcePushes } +// GetAllowForkSyncing returns the AllowForkSyncing field if it's non-nil, zero value otherwise. +func (p *ProtectionRequest) GetAllowForkSyncing() bool { + if p == nil || p.AllowForkSyncing == nil { + return false + } + return *p.AllowForkSyncing +} + +// GetBlockCreations returns the BlockCreations field if it's non-nil, zero value otherwise. +func (p *ProtectionRequest) GetBlockCreations() bool { + if p == nil || p.BlockCreations == nil { + return false + } + return *p.BlockCreations +} + +// GetLockBranch returns the LockBranch field if it's non-nil, zero value otherwise. +func (p *ProtectionRequest) GetLockBranch() bool { + if p == nil || p.LockBranch == nil { + return false + } + return *p.LockBranch +} + // GetRequiredConversationResolution returns the RequiredConversationResolution field if it's non-nil, zero value otherwise. func (p *ProtectionRequest) GetRequiredConversationResolution() bool { if p == nil || p.RequiredConversationResolution == nil { @@ -16246,6 +16286,14 @@ func (r *Repository) GetWatchersCount() int { return *r.WatchersCount } +// GetWebCommitSignoffRequired returns the WebCommitSignoffRequired field if it's non-nil, zero value otherwise. +func (r *Repository) GetWebCommitSignoffRequired() bool { + if r == nil || r.WebCommitSignoffRequired == nil { + return false + } + return *r.WebCommitSignoffRequired +} + // GetAccessLevel returns the AccessLevel field if it's non-nil, zero value otherwise. func (r *RepositoryActionsAccessLevel) GetAccessLevel() string { if r == nil || r.AccessLevel == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 044a45bd486..3cc4001ed4a 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -2121,6 +2121,16 @@ func TestBlob_GetURL(tt *testing.T) { b.GetURL() } +func TestBlockCreations_GetEnabled(tt *testing.T) { + var zeroValue bool + b := &BlockCreations{Enabled: &zeroValue} + b.GetEnabled() + b = &BlockCreations{} + b.GetEnabled() + b = nil + b.GetEnabled() +} + func TestBranch_GetCommit(tt *testing.T) { b := &Branch{} b.GetCommit() @@ -14988,6 +14998,13 @@ func TestProtection_GetAllowForkSyncing(tt *testing.T) { p.GetAllowForkSyncing() } +func TestProtection_GetBlockCreations(tt *testing.T) { + p := &Protection{} + p.GetBlockCreations() + p = nil + p.GetBlockCreations() +} + func TestProtection_GetEnforceAdmins(tt *testing.T) { p := &Protection{} p.GetEnforceAdmins() @@ -15162,6 +15179,36 @@ func TestProtectionRequest_GetAllowForcePushes(tt *testing.T) { p.GetAllowForcePushes() } +func TestProtectionRequest_GetAllowForkSyncing(tt *testing.T) { + var zeroValue bool + p := &ProtectionRequest{AllowForkSyncing: &zeroValue} + p.GetAllowForkSyncing() + p = &ProtectionRequest{} + p.GetAllowForkSyncing() + p = nil + p.GetAllowForkSyncing() +} + +func TestProtectionRequest_GetBlockCreations(tt *testing.T) { + var zeroValue bool + p := &ProtectionRequest{BlockCreations: &zeroValue} + p.GetBlockCreations() + p = &ProtectionRequest{} + p.GetBlockCreations() + p = nil + p.GetBlockCreations() +} + +func TestProtectionRequest_GetLockBranch(tt *testing.T) { + var zeroValue bool + p := &ProtectionRequest{LockBranch: &zeroValue} + p.GetLockBranch() + p = &ProtectionRequest{} + p.GetLockBranch() + p = nil + p.GetLockBranch() +} + func TestProtectionRequest_GetRequiredConversationResolution(tt *testing.T) { var zeroValue bool p := &ProtectionRequest{RequiredConversationResolution: &zeroValue} @@ -18913,6 +18960,16 @@ func TestRepository_GetWatchersCount(tt *testing.T) { r.GetWatchersCount() } +func TestRepository_GetWebCommitSignoffRequired(tt *testing.T) { + var zeroValue bool + r := &Repository{WebCommitSignoffRequired: &zeroValue} + r.GetWebCommitSignoffRequired() + r = &Repository{} + r.GetWebCommitSignoffRequired() + r = nil + r.GetWebCommitSignoffRequired() +} + func TestRepositoryActionsAccessLevel_GetAccessLevel(tt *testing.T) { var zeroValue string r := &RepositoryActionsAccessLevel{AccessLevel: &zeroValue} diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index e2ec62b2838..f83ce4ced81 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -1560,6 +1560,7 @@ func TestRepository_String(t *testing.T) { AllowMergeCommit: Bool(false), AllowAutoMerge: Bool(false), AllowForking: Bool(false), + WebCommitSignoffRequired: Bool(false), DeleteBranchOnMerge: Bool(false), UseSquashPRTitleAsDefault: Bool(false), SquashMergeCommitTitle: String(""), @@ -1622,7 +1623,7 @@ func TestRepository_String(t *testing.T) { 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, SquashMergeCommitTitle:"", SquashMergeCommitMessage:"", MergeCommitTitle:"", MergeCommitMessage:"", Topics:[""], Archived:false, Disabled:false, License:github.License{}, Private:false, HasIssues:false, HasWiki:false, HasPages:false, HasProjects:false, HasDownloads:false, HasDiscussions: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:""}` + 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, WebCommitSignoffRequired:false, DeleteBranchOnMerge:false, UseSquashPRTitleAsDefault:false, SquashMergeCommitTitle:"", SquashMergeCommitMessage:"", MergeCommitTitle:"", MergeCommitMessage:"", Topics:[""], Archived:false, Disabled:false, License:github.License{}, Private:false, HasIssues:false, HasWiki:false, HasPages:false, HasProjects:false, HasDownloads:false, HasDiscussions: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/repos.go b/github/repos.go index 1f6a3181ea6..fad152e22f2 100644 --- a/github/repos.go +++ b/github/repos.go @@ -68,6 +68,7 @@ type Repository struct { AllowMergeCommit *bool `json:"allow_merge_commit,omitempty"` AllowAutoMerge *bool `json:"allow_auto_merge,omitempty"` AllowForking *bool `json:"allow_forking,omitempty"` + WebCommitSignoffRequired *bool `json:"web_commit_signoff_required,omitempty"` DeleteBranchOnMerge *bool `json:"delete_branch_on_merge,omitempty"` UseSquashPRTitleAsDefault *bool `json:"use_squash_pr_title_as_default,omitempty"` SquashMergeCommitTitle *string `json:"squash_merge_commit_title,omitempty"` // Can be one of: "PR_TITLE", "COMMIT_OR_PR_TITLE" @@ -843,10 +844,18 @@ type Protection struct { AllowForcePushes *AllowForcePushes `json:"allow_force_pushes"` AllowDeletions *AllowDeletions `json:"allow_deletions"` RequiredConversationResolution *RequiredConversationResolution `json:"required_conversation_resolution"` + BlockCreations *BlockCreations `json:"block_creations,omitempty"` LockBranch *LockBranch `json:"lock_branch,omitempty"` AllowForkSyncing *AllowForkSyncing `json:"allow_fork_syncing,omitempty"` } +// BlockCreations represents whether users can push changes that create branches. If this is true, this +// setting blocks pushes that create new branches, unless the push is initiated by a user, team, or app +// which has the ability to push. +type BlockCreations struct { + Enabled *bool `json:"enabled,omitempty"` +} + // LockBranch represents if the branch is marked as read-only. If this is true, users will not be able to push to the branch. type LockBranch struct { Enabled *bool `json:"enabled,omitempty"` @@ -994,6 +1003,14 @@ type ProtectionRequest struct { // RequiredConversationResolution, if set to true, requires all comments // on the pull request to be resolved before it can be merged to a protected branch. RequiredConversationResolution *bool `json:"required_conversation_resolution,omitempty"` + // BlockCreations, if set to true, will cause the restrictions setting to also block pushes + // which create new branches, unless initiated by a user, team, app with the ability to push. + BlockCreations *bool `json:"block_creations,omitempty"` + // LockBranch, if set to true, will prevent users from pushing to the branch. + LockBranch *bool `json:"lock_branch,omitempty"` + // AllowForkSyncing, if set to true, will allow users to pull changes from upstream + // when the branch is locked. + AllowForkSyncing *bool `json:"allow_fork_syncing,omitempty"` } // RequiredStatusChecks represents the protection status of a individual branch. diff --git a/github/repos_test.go b/github/repos_test.go index 5f59216b2b9..e86d80796f8 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -1096,6 +1096,15 @@ func TestRepositoriesService_GetBranchProtection(t *testing.T) { }, "required_conversation_resolution": { "enabled": true + }, + "block_creations": { + "enabled": false + }, + "lock_branch": { + "enabled": false + }, + "allow_fork_syncing": { + "enabled": false } }`) }) @@ -1151,6 +1160,15 @@ func TestRepositoriesService_GetBranchProtection(t *testing.T) { RequiredConversationResolution: &RequiredConversationResolution{ Enabled: true, }, + BlockCreations: &BlockCreations{ + Enabled: Bool(false), + }, + LockBranch: &LockBranch{ + Enabled: Bool(false), + }, + AllowForkSyncing: &AllowForkSyncing{ + Enabled: Bool(false), + }, } if !cmp.Equal(protection, want) { t.Errorf("Repositories.GetBranchProtection returned %+v, want %+v", protection, want) @@ -1299,6 +1317,9 @@ func TestRepositoriesService_UpdateBranchProtection_Contexts(t *testing.T) { Teams: []string{"t"}, Apps: []string{"a"}, }, + BlockCreations: Bool(true), + LockBranch: Bool(true), + AllowForkSyncing: Bool(true), } mux.HandleFunc("/repos/o/r/branches/b/protection", func(w http.ResponseWriter, r *http.Request) { @@ -1350,6 +1371,15 @@ func TestRepositoriesService_UpdateBranchProtection_Contexts(t *testing.T) { "users":[{"id":1,"login":"u"}], "teams":[{"id":2,"slug":"t"}], "apps":[{"id":3,"slug":"a"}] + }, + "block_creations": { + "enabled": true + }, + "lock_branch": { + "enabled": true + }, + "allow_fork_syncing": { + "enabled": true } }`) }) @@ -1407,6 +1437,15 @@ func TestRepositoriesService_UpdateBranchProtection_Contexts(t *testing.T) { {Slug: String("a"), ID: Int64(3)}, }, }, + BlockCreations: &BlockCreations{ + Enabled: Bool(true), + }, + LockBranch: &LockBranch{ + Enabled: Bool(true), + }, + AllowForkSyncing: &AllowForkSyncing{ + Enabled: Bool(true), + }, } if !cmp.Equal(protection, want) { t.Errorf("Repositories.UpdateBranchProtection returned %+v, want %+v", protection, want) diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index 8efed472da5..124e00551a9 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -112,7 +112,10 @@ func TestRepositories_EditBranches(t *testing.T) { // TODO: Only organization repositories can have users and team restrictions. // In order to be able to test these Restrictions, need to add support // for creating temporary organization repositories. - Restrictions: nil, + Restrictions: nil, + BlockCreations: github.Bool(false), + LockBranch: github.Bool(false), + AllowForkSyncing: github.Bool(false), } protection, _, err := client.Repositories.UpdateBranchProtection(context.Background(), *repo.Owner.Login, *repo.Name, "master", protectionRequest) @@ -134,6 +137,15 @@ func TestRepositories_EditBranches(t *testing.T) { Enabled: true, }, Restrictions: nil, + BlockCreations: &github.BlockCreations{ + Enabled: github.Bool(false), + }, + LockBranch: &github.LockBranch{ + Enabled: github.Bool(false), + }, + AllowForkSyncing: &github.AllowForkSyncing{ + Enabled: github.Bool(false), + }, } if !cmp.Equal(protection, want) { t.Errorf("Repositories.UpdateBranchProtection() returned %+v, want %+v", protection, want) From cac943ec5bf3a67a6a773a93ffff05da98947d8b Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Fri, 17 Mar 2023 13:58:47 -0400 Subject: [PATCH 191/751] Bump version of go-github to v50.2.0 (#2710) --- README.md | 1 + github/github.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 37b373ceecf..d73d1eae4ab 100644 --- a/README.md +++ b/README.md @@ -396,6 +396,7 @@ Versions prior to 48.2.0 are not listed. | go-github Version | GitHub v3 API Version | | ----------------- | --------------------- | +| 50.2.0 | 2022-11-28 | | 50.1.0 | 2022-11-28 | | 50.0.0 | 2022-11-28 | | 49.1.0 | 2022-11-28 | diff --git a/github/github.go b/github/github.go index 58715b11c6f..4c4827e53cb 100644 --- a/github/github.go +++ b/github/github.go @@ -28,7 +28,7 @@ import ( ) const ( - Version = "v50.1.0" + Version = "v50.2.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" From f125abf90fa8ed2c7eb8ef56d6ec36f7ffd12e95 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Mar 2023 16:13:31 -0400 Subject: [PATCH 192/751] Bump actions/setup-go from 3 to 4 (#2713) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c35dbc1b438..023dc9f1edc 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -36,7 +36,7 @@ jobs: runs-on: ${{ matrix.platform }} steps: - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v4 with: go-version: ${{ matrix.go-version }} - uses: actions/checkout@v3 From 31350112a17a67bdc672f2a73865a2985b15fd60 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Mar 2023 16:13:53 -0400 Subject: [PATCH 193/751] Bump github.com/google/go-github/v50 from 50.1.0 to 50.2.0 in /scrape (#2714) --- scrape/go.mod | 2 +- scrape/go.sum | 31 +++++++++++++++++++++++-------- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 1cab9dd6a3c..d65e3da336f 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -5,7 +5,7 @@ go 1.13 require ( github.com/PuerkitoBio/goquery v1.8.1 github.com/google/go-cmp v0.5.9 - github.com/google/go-github/v50 v50.1.0 + github.com/google/go-github/v50 v50.2.0 github.com/xlzd/gotp v0.1.0 golang.org/x/net v0.8.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index 50ed7004bef..83f86faca1f 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -1,24 +1,33 @@ +cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= +github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= github.com/PuerkitoBio/goquery v1.8.1 h1:uQxhNlArOIdbrH1tr0UXwdVFgDcZDrZVdcpygAcwmWM= github.com/PuerkitoBio/goquery v1.8.1/go.mod h1:Q8ICL1kNUJ2sXGoAhPGUdYDJvgQgHzJsnnd3H7Ho5jQ= github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c= github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA= +github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= +github.com/cloudflare/circl v1.1.0 h1:bZgT/A+cikZnKIwn7xL2OBj012Bmvho/o6RpRvv3GKY= +github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v50 v50.1.0 h1:hMUpkZjklC5GJ+c3GquSqOP/T4BNsB7XohaPhtMOzRk= -github.com/google/go-github/v50 v50.1.0/go.mod h1:Ev4Tre8QoKiolvbpOSG3FIi4Mlon3S2Nt9W5JYqKiwA= +github.com/google/go-github/v50 v50.2.0 h1:j2FyongEHlO9nxXLc+LP3wuBSVU9mVxfpdYUexMpIfk= +github.com/google/go-github/v50 v50.2.0/go.mod h1:VBY8FB6yPIjrtKhozXv4FQupxKLS6H4m6xFZlT43q8Q= 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.1.0 h1:37blvlKCh38s+fkem+fFh7sMnceltoIEBYTVXyoa5Po= github.com/xlzd/gotp v0.1.0/go.mod h1:ndLJ3JKzi3xLmUProq4LLxCuECL93dG9WASNLpHz8qg= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= +golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= @@ -30,8 +39,8 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.6.0 h1:Lh8GPgSKBfWSwFvtuWOfeI3aAAnbXTSutYxJiOJFgIw= +golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -39,9 +48,11 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -62,3 +73,7 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= From 795005a1afb72bb9f539eb7f05b843fe318b1a69 Mon Sep 17 00:00:00 2001 From: Nicolas Chapurlat Date: Mon, 27 Mar 2023 20:01:56 +0200 Subject: [PATCH 194/751] Add added_by and last_used fields to keys (#2718) Fixes: #2717. --- github/github-accessors.go | 16 ++++++++++++++++ github/github-accessors_test.go | 20 ++++++++++++++++++++ github/github-stringify_test.go | 4 +++- github/users_keys.go | 2 ++ 4 files changed, 41 insertions(+), 1 deletion(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index beeb2defce6..3d42907b96c 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -8646,6 +8646,14 @@ func (j *Jobs) GetTotalCount() int { return *j.TotalCount } +// GetAddedBy returns the AddedBy field if it's non-nil, zero value otherwise. +func (k *Key) GetAddedBy() string { + if k == nil || k.AddedBy == nil { + return "" + } + return *k.AddedBy +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (k *Key) GetCreatedAt() Timestamp { if k == nil || k.CreatedAt == nil { @@ -8670,6 +8678,14 @@ func (k *Key) GetKey() string { return *k.Key } +// GetLastUsed returns the LastUsed field if it's non-nil, zero value otherwise. +func (k *Key) GetLastUsed() Timestamp { + if k == nil || k.LastUsed == nil { + return Timestamp{} + } + return *k.LastUsed +} + // GetReadOnly returns the ReadOnly field if it's non-nil, zero value otherwise. func (k *Key) GetReadOnly() bool { if k == nil || k.ReadOnly == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 3cc4001ed4a..20ba7425d7a 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -10130,6 +10130,16 @@ func TestJobs_GetTotalCount(tt *testing.T) { j.GetTotalCount() } +func TestKey_GetAddedBy(tt *testing.T) { + var zeroValue string + k := &Key{AddedBy: &zeroValue} + k.GetAddedBy() + k = &Key{} + k.GetAddedBy() + k = nil + k.GetAddedBy() +} + func TestKey_GetCreatedAt(tt *testing.T) { var zeroValue Timestamp k := &Key{CreatedAt: &zeroValue} @@ -10160,6 +10170,16 @@ func TestKey_GetKey(tt *testing.T) { k.GetKey() } +func TestKey_GetLastUsed(tt *testing.T) { + var zeroValue Timestamp + k := &Key{LastUsed: &zeroValue} + k.GetLastUsed() + k = &Key{} + k.GetLastUsed() + k = nil + k.GetLastUsed() +} + func TestKey_GetReadOnly(tt *testing.T) { var zeroValue bool k := &Key{ReadOnly: &zeroValue} diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index f83ce4ced81..60052554970 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -795,8 +795,10 @@ func TestKey_String(t *testing.T) { ReadOnly: Bool(false), Verified: Bool(false), CreatedAt: &Timestamp{}, + AddedBy: String(""), + LastUsed: &Timestamp{}, } - want := `github.Key{ID:0, Key:"", URL:"", Title:"", ReadOnly:false, Verified:false, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}` + want := `github.Key{ID:0, Key:"", URL:"", Title:"", ReadOnly:false, Verified:false, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, AddedBy:"", LastUsed:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}` if got := v.String(); got != want { t.Errorf("Key.String = %v, want %v", got, want) } diff --git a/github/users_keys.go b/github/users_keys.go index 59d26cdefa9..b49b8e4b4ef 100644 --- a/github/users_keys.go +++ b/github/users_keys.go @@ -19,6 +19,8 @@ type Key struct { ReadOnly *bool `json:"read_only,omitempty"` Verified *bool `json:"verified,omitempty"` CreatedAt *Timestamp `json:"created_at,omitempty"` + AddedBy *string `json:"added_by,omitempty"` + LastUsed *Timestamp `json:"last_used,omitempty"` } func (k Key) String() string { From a934ccc39e1f3f6449c8177774ae06df376dbc6f Mon Sep 17 00:00:00 2001 From: James Maguire Date: Tue, 28 Mar 2023 15:29:50 +0200 Subject: [PATCH 195/751] Add CanAdminsBypass to Environment (#2721) Fixes: #2722. --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ github/repos_environments.go | 1 + github/repos_environments_test.go | 4 ++-- 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 3d42907b96c..9c435048aec 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -5590,6 +5590,14 @@ func (e *EnterpriseSecurityAnalysisSettings) GetSecretScanningPushProtectionEnab return *e.SecretScanningPushProtectionEnabledForNewRepositories } +// GetCanAdminsBypass returns the CanAdminsBypass field if it's non-nil, zero value otherwise. +func (e *Environment) GetCanAdminsBypass() bool { + if e == nil || e.CanAdminsBypass == nil { + return false + } + return *e.CanAdminsBypass +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (e *Environment) GetCreatedAt() Timestamp { if e == nil || e.CreatedAt == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 20ba7425d7a..5091cc46c90 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -6541,6 +6541,16 @@ func TestEnterpriseSecurityAnalysisSettings_GetSecretScanningPushProtectionEnabl e.GetSecretScanningPushProtectionEnabledForNewRepositories() } +func TestEnvironment_GetCanAdminsBypass(tt *testing.T) { + var zeroValue bool + e := &Environment{CanAdminsBypass: &zeroValue} + e.GetCanAdminsBypass() + e = &Environment{} + e.GetCanAdminsBypass() + e = nil + e.GetCanAdminsBypass() +} + func TestEnvironment_GetCreatedAt(tt *testing.T) { var zeroValue Timestamp e := &Environment{CreatedAt: &zeroValue} diff --git a/github/repos_environments.go b/github/repos_environments.go index 2e85fdf99c0..7f01be6277f 100644 --- a/github/repos_environments.go +++ b/github/repos_environments.go @@ -28,6 +28,7 @@ type Environment struct { HTMLURL *string `json:"html_url,omitempty"` CreatedAt *Timestamp `json:"created_at,omitempty"` UpdatedAt *Timestamp `json:"updated_at,omitempty"` + CanAdminsBypass *bool `json:"can_admins_bypass,omitempty"` ProtectionRules []*ProtectionRule `json:"protection_rules,omitempty"` } diff --git a/github/repos_environments_test.go b/github/repos_environments_test.go index 0b27da933d7..a688b221fc2 100644 --- a/github/repos_environments_test.go +++ b/github/repos_environments_test.go @@ -145,7 +145,7 @@ func TestRepositoriesService_GetEnvironment(t *testing.T) { mux.HandleFunc("/repos/o/r/environments/e", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - fmt.Fprint(w, `{"id": 1,"name": "staging", "deployment_branch_policy": {"protected_branches": true, "custom_branch_policies": false}}`) + fmt.Fprint(w, `{"id": 1,"name": "staging", "deployment_branch_policy": {"protected_branches": true, "custom_branch_policies": false}, "can_admins_bypass": false}`) }) ctx := context.Background() @@ -154,7 +154,7 @@ func TestRepositoriesService_GetEnvironment(t *testing.T) { t.Errorf("Repositories.GetEnvironment returned error: %v\n%v", err, resp.Body) } - want := &Environment{ID: Int64(1), Name: String("staging"), DeploymentBranchPolicy: &BranchPolicy{ProtectedBranches: Bool(true), CustomBranchPolicies: Bool(false)}} + want := &Environment{ID: Int64(1), Name: String("staging"), DeploymentBranchPolicy: &BranchPolicy{ProtectedBranches: Bool(true), CustomBranchPolicies: Bool(false)}, CanAdminsBypass: Bool(false)} if !cmp.Equal(release, want) { t.Errorf("Repositories.GetEnvironment returned %+v, want %+v", release, want) } From 6bba7a494dc244384cd631f5884520696df53b93 Mon Sep 17 00:00:00 2001 From: ganeshkumarsv <53483484+ganeshkumarsv@users.noreply.github.com> Date: Tue, 28 Mar 2023 16:49:42 -0400 Subject: [PATCH 196/751] Add ListOptions to GetAdvancedSecurityActiveCommittersOrg (#2720) --- github/billing.go | 9 +++++++-- github/billing_test.go | 9 +++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/github/billing.go b/github/billing.go index 2900a01670a..7a76bf86fda 100644 --- a/github/billing.go +++ b/github/billing.go @@ -120,9 +120,14 @@ func (s *BillingService) GetStorageBillingOrg(ctx context.Context, org string) ( // GetAdvancedSecurityActiveCommittersOrg returns the GitHub Advanced Security active committers for an organization per repository. // -// GitHub API docs: https://docs.github.com/en/rest/billing#get-github-advanced-security-active-committers-for-an-organization -func (s *BillingService) GetAdvancedSecurityActiveCommittersOrg(ctx context.Context, org string) (*ActiveCommitters, *Response, error) { +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/billing?apiVersion=2022-11-28#get-github-advanced-security-active-committers-for-an-organization +func (s *BillingService) GetAdvancedSecurityActiveCommittersOrg(ctx context.Context, org string, opts *ListOptions) (*ActiveCommitters, *Response, error) { u := fmt.Sprintf("orgs/%v/settings/billing/advanced-security", org) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err diff --git a/github/billing_test.go b/github/billing_test.go index 52b338b8347..d7adcb09f72 100644 --- a/github/billing_test.go +++ b/github/billing_test.go @@ -452,7 +452,8 @@ func TestBillingService_GetAdvancedSecurityActiveCommittersOrg(t *testing.T) { }) ctx := context.Background() - hook, _, err := client.Billing.GetAdvancedSecurityActiveCommittersOrg(ctx, "o") + opts := &ListOptions{Page: 2, PerPage: 50} + hook, _, err := client.Billing.GetAdvancedSecurityActiveCommittersOrg(ctx, "o", opts) if err != nil { t.Errorf("Billing.GetAdvancedSecurityActiveCommittersOrg returned error: %v", err) } @@ -478,12 +479,12 @@ func TestBillingService_GetAdvancedSecurityActiveCommittersOrg(t *testing.T) { const methodName = "GetAdvancedSecurityActiveCommittersOrg" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Billing.GetAdvancedSecurityActiveCommittersOrg(ctx, "\n") + _, _, err = client.Billing.GetAdvancedSecurityActiveCommittersOrg(ctx, "\n", nil) return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Billing.GetAdvancedSecurityActiveCommittersOrg(ctx, "o") + got, resp, err := client.Billing.GetAdvancedSecurityActiveCommittersOrg(ctx, "o", nil) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -496,6 +497,6 @@ func TestBillingService_GetAdvancedSecurityActiveCommittersOrg_invalidOrg(t *tes defer teardown() ctx := context.Background() - _, _, err := client.Billing.GetAdvancedSecurityActiveCommittersOrg(ctx, "%") + _, _, err := client.Billing.GetAdvancedSecurityActiveCommittersOrg(ctx, "%", nil) testURLParseError(t, err) } From 983285f0541c36645722c6ce36bfc60a1cf631ea Mon Sep 17 00:00:00 2001 From: Berkay Tacyildiz Date: Thu, 30 Mar 2023 00:20:29 +0200 Subject: [PATCH 197/751] Add download capability for workflow run attempt logs (#2716) Fixes: #2715. --- github/actions_workflow_runs.go | 20 +++++++ github/actions_workflow_runs_test.go | 83 ++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+) diff --git a/github/actions_workflow_runs.go b/github/actions_workflow_runs.go index 0cda90d41b2..b37a9f317b1 100644 --- a/github/actions_workflow_runs.go +++ b/github/actions_workflow_runs.go @@ -204,6 +204,26 @@ func (s *ActionsService) GetWorkflowRunAttempt(ctx context.Context, owner, repo return run, resp, nil } +// GetWorkflowRunAttemptLogs gets a redirect URL to download a plain text file of logs for a workflow run for attempt number. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#download-workflow-run-attempt-logs +func (s *ActionsService) GetWorkflowRunAttemptLogs(ctx context.Context, owner, repo string, runID int64, attemptNumber int, followRedirects bool) (*url.URL, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/attempts/%v/logs", owner, repo, runID, attemptNumber) + + resp, err := s.client.roundTripWithOptionalFollowRedirect(ctx, u, followRedirects) + if err != nil { + return nil, nil, err + } + defer resp.Body.Close() + + if resp.StatusCode != http.StatusFound { + return nil, newResponse(resp), fmt.Errorf("unexpected status code: %s", resp.Status) + } + + parsedURL, err := url.Parse(resp.Header.Get("Location")) + return parsedURL, newResponse(resp), err +} + // RerunWorkflowByID re-runs a workflow by ID. // // GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#re-run-a-workflow diff --git a/github/actions_workflow_runs_test.go b/github/actions_workflow_runs_test.go index 641c4d739b7..74b5bdd0d5f 100644 --- a/github/actions_workflow_runs_test.go +++ b/github/actions_workflow_runs_test.go @@ -188,6 +188,89 @@ func TestActionsService_GetWorkflowRunAttempt(t *testing.T) { }) } +func TestActionsService_GetWorkflowRunAttemptLogs(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/actions/runs/399444496/attempts/2/logs", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + http.Redirect(w, r, "http://github.com/a", http.StatusFound) + }) + + ctx := context.Background() + url, resp, err := client.Actions.GetWorkflowRunAttemptLogs(ctx, "o", "r", 399444496, 2, true) + if err != nil { + t.Errorf("Actions.GetWorkflowRunAttemptLogs returned error: %v", err) + } + if resp.StatusCode != http.StatusFound { + t.Errorf("Actions.GetWorkflowRunAttemptLogs returned status: %d, want %d", resp.StatusCode, http.StatusFound) + } + want := "http://github.com/a" + if url.String() != want { + t.Errorf("Actions.GetWorkflowRunAttemptLogs returned %+v, want %+v", url.String(), want) + } + + const methodName = "GetWorkflowRunAttemptLogs" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.GetWorkflowRunAttemptLogs(ctx, "\n", "\n", 399444496, 2, true) + return err + }) +} + +func TestActionsService_GetWorkflowRunAttemptLogs_StatusMovedPermanently_dontFollowRedirects(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/actions/runs/399444496/attempts/2/logs", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + http.Redirect(w, r, "http://github.com/a", http.StatusMovedPermanently) + }) + + ctx := context.Background() + _, resp, _ := client.Actions.GetWorkflowRunAttemptLogs(ctx, "o", "r", 399444496, 2, false) + if resp.StatusCode != http.StatusMovedPermanently { + t.Errorf("Actions.GetWorkflowRunAttemptLogs returned status: %d, want %d", resp.StatusCode, http.StatusMovedPermanently) + } +} + +func TestActionsService_GetWorkflowRunAttemptLogs_StatusMovedPermanently_followRedirects(t *testing.T) { + client, mux, serverURL, teardown := setup() + defer teardown() + + // Mock a redirect link, which leads to an archive link + mux.HandleFunc("/repos/o/r/actions/runs/399444496/attempts/2/logs", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + redirectURL, _ := url.Parse(serverURL + baseURLPath + "/redirect") + http.Redirect(w, r, redirectURL.String(), http.StatusMovedPermanently) + }) + + mux.HandleFunc("/redirect", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + http.Redirect(w, r, "http://github.com/a", http.StatusFound) + }) + + ctx := context.Background() + url, resp, err := client.Actions.GetWorkflowRunAttemptLogs(ctx, "o", "r", 399444496, 2, true) + if err != nil { + t.Errorf("Actions.GetWorkflowRunAttemptLogs returned error: %v", err) + } + + if resp.StatusCode != http.StatusFound { + t.Errorf("Actions.GetWorkflowRunAttemptLogs returned status: %d, want %d", resp.StatusCode, http.StatusFound) + } + + want := "http://github.com/a" + if url.String() != want { + t.Errorf("Actions.GetWorkflowRunAttemptLogs returned %+v, want %+v", url.String(), want) + } + + const methodName = "GetWorkflowRunAttemptLogs" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.GetWorkflowRunAttemptLogs(ctx, "\n", "\n", 399444496, 2, true) + return err + }) +} + func TestActionsService_RerunWorkflowRunByID(t *testing.T) { client, mux, _, teardown := setup() defer teardown() From 78c5d004fa91ef9026075335c4505cb1cca42270 Mon Sep 17 00:00:00 2001 From: James Maguire Date: Thu, 30 Mar 2023 15:24:41 +0200 Subject: [PATCH 198/751] Add CanAdminsBypass to CreateUpdateEnvironment (#2727) Fixes: #2725. --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ github/repos_environments.go | 5 +++++ github/repos_environments_test.go | 4 ++-- 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 9c435048aec..1a9f32ef052 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -4022,6 +4022,14 @@ func (c *CreateRunnerGroupRequest) GetVisibility() string { return *c.Visibility } +// GetCanAdminsBypass returns the CanAdminsBypass field if it's non-nil, zero value otherwise. +func (c *CreateUpdateEnvironment) GetCanAdminsBypass() bool { + if c == nil || c.CanAdminsBypass == nil { + return false + } + return *c.CanAdminsBypass +} + // GetDeploymentBranchPolicy returns the DeploymentBranchPolicy field. func (c *CreateUpdateEnvironment) GetDeploymentBranchPolicy() *BranchPolicy { if c == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 5091cc46c90..039c3e17b07 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -4725,6 +4725,16 @@ func TestCreateRunnerGroupRequest_GetVisibility(tt *testing.T) { c.GetVisibility() } +func TestCreateUpdateEnvironment_GetCanAdminsBypass(tt *testing.T) { + var zeroValue bool + c := &CreateUpdateEnvironment{CanAdminsBypass: &zeroValue} + c.GetCanAdminsBypass() + c = &CreateUpdateEnvironment{} + c.GetCanAdminsBypass() + c = nil + c.GetCanAdminsBypass() +} + func TestCreateUpdateEnvironment_GetDeploymentBranchPolicy(tt *testing.T) { c := &CreateUpdateEnvironment{} c.GetDeploymentBranchPolicy() diff --git a/github/repos_environments.go b/github/repos_environments.go index 7f01be6277f..2399a42c746 100644 --- a/github/repos_environments.go +++ b/github/repos_environments.go @@ -148,11 +148,15 @@ func (s *RepositoriesService) GetEnvironment(ctx context.Context, owner, repo, n // MarshalJSON implements the json.Marshaler interface. // As the only way to clear a WaitTimer is to set it to 0, a missing WaitTimer object should default to 0, not null. +// As the default value for CanAdminsBypass is true, a nil value here marshals to true. func (c *CreateUpdateEnvironment) MarshalJSON() ([]byte, error) { type Alias CreateUpdateEnvironment if c.WaitTimer == nil { c.WaitTimer = Int(0) } + if c.CanAdminsBypass == nil { + c.CanAdminsBypass = Bool(true) + } return json.Marshal(&struct { *Alias }{ @@ -167,6 +171,7 @@ func (c *CreateUpdateEnvironment) MarshalJSON() ([]byte, error) { type CreateUpdateEnvironment struct { WaitTimer *int `json:"wait_timer"` Reviewers []*EnvReviewers `json:"reviewers"` + CanAdminsBypass *bool `json:"can_admins_bypass"` DeploymentBranchPolicy *BranchPolicy `json:"deployment_branch_policy"` } diff --git a/github/repos_environments_test.go b/github/repos_environments_test.go index a688b221fc2..0f93d290882 100644 --- a/github/repos_environments_test.go +++ b/github/repos_environments_test.go @@ -93,7 +93,7 @@ func TestCreateUpdateEnvironment_MarshalJSON(t *testing.T) { t.Errorf("MarshalJSON: %v", err) } - want := `{"wait_timer":0,"reviewers":null,"deployment_branch_policy":null}` + want := `{"wait_timer":0,"reviewers":null,"can_admins_bypass":true,"deployment_branch_policy":null}` if string(got) != want { t.Errorf("MarshalJSON = %s, want %v", got, want) } @@ -187,7 +187,7 @@ func TestRepositoriesService_CreateEnvironment(t *testing.T) { json.NewDecoder(r.Body).Decode(v) testMethod(t, r, "PUT") - want := &CreateUpdateEnvironment{WaitTimer: Int(30)} + want := &CreateUpdateEnvironment{WaitTimer: Int(30), CanAdminsBypass: Bool(true)} if !cmp.Equal(v, want) { t.Errorf("Request body = %+v, want %+v", v, want) } From bd31be8a49d8484e163493f1aa229f16ffb90077 Mon Sep 17 00:00:00 2001 From: Brandon Stubbs Date: Thu, 30 Mar 2023 13:41:06 -0400 Subject: [PATCH 199/751] Add BuildType to GitHub Repo Pages (#2724) Fixes: #2723. --- github/github-accessors.go | 16 +++++ github/github-accessors_test.go | 20 ++++++ github/repos_pages.go | 11 +++- github/repos_pages_test.go | 109 +++++++++++++++++++++++++++++--- 4 files changed, 145 insertions(+), 11 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 1a9f32ef052..b814fd8df12 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -11782,6 +11782,14 @@ func (p *PageBuildEvent) GetSender() *User { return p.Sender } +// GetBuildType returns the BuildType field if it's non-nil, zero value otherwise. +func (p *Pages) GetBuildType() string { + if p == nil || p.BuildType == nil { + return "" + } + return *p.BuildType +} + // GetCNAME returns the CNAME field if it's non-nil, zero value otherwise. func (p *Pages) GetCNAME() string { if p == nil || p.CNAME == nil { @@ -11974,6 +11982,14 @@ func (p *PageStats) GetTotalPages() int { return *p.TotalPages } +// GetBuildType returns the BuildType field if it's non-nil, zero value otherwise. +func (p *PagesUpdate) GetBuildType() string { + if p == nil || p.BuildType == nil { + return "" + } + return *p.BuildType +} + // GetCNAME returns the CNAME field if it's non-nil, zero value otherwise. func (p *PagesUpdate) GetCNAME() string { if p == nil || p.CNAME == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 039c3e17b07..efdc3f648a2 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -13816,6 +13816,16 @@ func TestPageBuildEvent_GetSender(tt *testing.T) { p.GetSender() } +func TestPages_GetBuildType(tt *testing.T) { + var zeroValue string + p := &Pages{BuildType: &zeroValue} + p.GetBuildType() + p = &Pages{} + p.GetBuildType() + p = nil + p.GetBuildType() +} + func TestPages_GetCNAME(tt *testing.T) { var zeroValue string p := &Pages{CNAME: &zeroValue} @@ -14044,6 +14054,16 @@ func TestPageStats_GetTotalPages(tt *testing.T) { p.GetTotalPages() } +func TestPagesUpdate_GetBuildType(tt *testing.T) { + var zeroValue string + p := &PagesUpdate{BuildType: &zeroValue} + p.GetBuildType() + p = &PagesUpdate{} + p.GetBuildType() + p = nil + p.GetBuildType() +} + func TestPagesUpdate_GetCNAME(tt *testing.T) { var zeroValue string p := &PagesUpdate{CNAME: &zeroValue} diff --git a/github/repos_pages.go b/github/repos_pages.go index 737cec0f22a..845de8a0dba 100644 --- a/github/repos_pages.go +++ b/github/repos_pages.go @@ -17,6 +17,7 @@ type Pages struct { CNAME *string `json:"cname,omitempty"` Custom404 *bool `json:"custom_404,omitempty"` HTMLURL *string `json:"html_url,omitempty"` + BuildType *string `json:"build_type,omitempty"` Source *PagesSource `json:"source,omitempty"` Public *bool `json:"public,omitempty"` HTTPSCertificate *PagesHTTPSCertificate `json:"https_certificate,omitempty"` @@ -58,7 +59,8 @@ type PagesHTTPSCertificate struct { // createPagesRequest is a subset of Pages and is used internally // by EnablePages to pass only the known fields for the endpoint. type createPagesRequest struct { - Source *PagesSource `json:"source,omitempty"` + BuildType *string `json:"build_type,omitempty"` + Source *PagesSource `json:"source,omitempty"` } // EnablePages enables GitHub Pages for the named repo. @@ -68,7 +70,8 @@ func (s *RepositoriesService) EnablePages(ctx context.Context, owner, repo strin u := fmt.Sprintf("repos/%v/%v/pages", owner, repo) pagesReq := &createPagesRequest{ - Source: pages.Source, + BuildType: pages.BuildType, + Source: pages.Source, } req, err := s.client.NewRequest("POST", u, pagesReq) @@ -92,6 +95,10 @@ type PagesUpdate struct { // CNAME represents a custom domain for the repository. // Leaving CNAME empty will remove the custom domain. CNAME *string `json:"cname"` + // BuildType is optional and can either be "legacy" or "workflow". + // "workflow" - You are using a github workflow to build your pages. + // "legacy" - You are deploying from a branch. + BuildType *string `json:"build_type,omitempty"` // Source must include the branch name, and may optionally specify the subdirectory "/docs". // Possible values for Source.Branch are usually "gh-pages", "main", and "master", // or any other existing branch name. diff --git a/github/repos_pages_test.go b/github/repos_pages_test.go index 75d6ccb2bf4..6245aac256f 100644 --- a/github/repos_pages_test.go +++ b/github/repos_pages_test.go @@ -17,11 +17,12 @@ import ( "github.com/google/go-cmp/cmp" ) -func TestRepositoriesService_EnablePages(t *testing.T) { +func TestRepositoriesService_EnablePagesLegacy(t *testing.T) { client, mux, _, teardown := setup() defer teardown() input := &Pages{ + BuildType: String("legacy"), Source: &PagesSource{ Branch: String("master"), Path: String("/"), @@ -35,12 +36,12 @@ func TestRepositoriesService_EnablePages(t *testing.T) { testMethod(t, r, "POST") testHeader(t, r, "Accept", mediaTypeEnablePagesAPIPreview) - want := &createPagesRequest{Source: &PagesSource{Branch: String("master"), Path: String("/")}} + want := &createPagesRequest{BuildType: String("legacy"), Source: &PagesSource{Branch: String("master"), Path: String("/")}} if !cmp.Equal(v, want) { t.Errorf("Request body = %+v, want %+v", v, want) } - fmt.Fprint(w, `{"url":"u","status":"s","cname":"c","custom_404":false,"html_url":"h", "source": {"branch":"master", "path":"/"}}`) + fmt.Fprint(w, `{"url":"u","status":"s","cname":"c","custom_404":false,"html_url":"h","build_type": "legacy","source": {"branch":"master", "path":"/"}}`) }) ctx := context.Background() @@ -49,7 +50,7 @@ func TestRepositoriesService_EnablePages(t *testing.T) { t.Errorf("Repositories.EnablePages returned error: %v", err) } - want := &Pages{URL: String("u"), Status: String("s"), CNAME: String("c"), Custom404: Bool(false), HTMLURL: String("h"), Source: &PagesSource{Branch: String("master"), Path: String("/")}} + want := &Pages{URL: String("u"), Status: String("s"), CNAME: String("c"), Custom404: Bool(false), HTMLURL: String("h"), BuildType: String("legacy"), Source: &PagesSource{Branch: String("master"), Path: String("/")}} if !cmp.Equal(page, want) { t.Errorf("Repositories.EnablePages returned %v, want %v", page, want) @@ -70,13 +71,103 @@ func TestRepositoriesService_EnablePages(t *testing.T) { }) } -func TestRepositoriesService_UpdatePages(t *testing.T) { +func TestRepositoriesService_EnablePagesWorkflow(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + input := &Pages{ + BuildType: String("workflow"), + CNAME: String("www.my-domain.com"), // not passed along. + } + + mux.HandleFunc("/repos/o/r/pages", func(w http.ResponseWriter, r *http.Request) { + v := new(createPagesRequest) + json.NewDecoder(r.Body).Decode(v) + + testMethod(t, r, "POST") + testHeader(t, r, "Accept", mediaTypeEnablePagesAPIPreview) + want := &createPagesRequest{BuildType: String("workflow")} + if !cmp.Equal(v, want) { + t.Errorf("Request body = %+v, want %+v", v, want) + } + + fmt.Fprint(w, `{"url":"u","status":"s","cname":"c","custom_404":false,"html_url":"h","build_type": "workflow"}`) + }) + + ctx := context.Background() + page, _, err := client.Repositories.EnablePages(ctx, "o", "r", input) + if err != nil { + t.Errorf("Repositories.EnablePages returned error: %v", err) + } + + want := &Pages{URL: String("u"), Status: String("s"), CNAME: String("c"), Custom404: Bool(false), HTMLURL: String("h"), BuildType: String("workflow")} + + if !cmp.Equal(page, want) { + t.Errorf("Repositories.EnablePages returned %v, want %v", page, want) + } + + const methodName = "EnablePages" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.EnablePages(ctx, "\n", "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.EnablePages(ctx, "o", "r", input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestRepositoriesService_UpdatePagesLegacy(t *testing.T) { client, mux, _, teardown := setup() defer teardown() input := &PagesUpdate{ - CNAME: String("www.my-domain.com"), - Source: &PagesSource{Branch: String("gh-pages")}, + CNAME: String("www.my-domain.com"), + BuildType: String("legacy"), + Source: &PagesSource{Branch: String("gh-pages")}, + } + + mux.HandleFunc("/repos/o/r/pages", func(w http.ResponseWriter, r *http.Request) { + v := new(PagesUpdate) + json.NewDecoder(r.Body).Decode(v) + + testMethod(t, r, "PUT") + want := &PagesUpdate{CNAME: String("www.my-domain.com"), BuildType: String("legacy"), 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","build_type":"legacy","source":{"branch":"gh-pages"}}`) + }) + + ctx := context.Background() + _, err := client.Repositories.UpdatePages(ctx, "o", "r", input) + if err != nil { + t.Errorf("Repositories.UpdatePages returned error: %v", err) + } + + const methodName = "UpdatePages" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Repositories.UpdatePages(ctx, "\n", "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Repositories.UpdatePages(ctx, "o", "r", input) + }) +} + +func TestRepositoriesService_UpdatePagesWorkflow(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + input := &PagesUpdate{ + CNAME: String("www.my-domain.com"), + BuildType: String("workflow"), } mux.HandleFunc("/repos/o/r/pages", func(w http.ResponseWriter, r *http.Request) { @@ -84,12 +175,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: &PagesSource{Branch: String("gh-pages")}} + want := &PagesUpdate{CNAME: String("www.my-domain.com"), BuildType: String("workflow")} if !cmp.Equal(v, want) { t.Errorf("Request body = %+v, want %+v", v, want) } - fmt.Fprint(w, `{"cname":"www.my-domain.com","source":{"branch":"gh-pages"}}`) + fmt.Fprint(w, `{"cname":"www.my-domain.com","build_type":"workflow"}`) }) ctx := context.Background() From a29e30c8c27fe6f43450b0aa688c3820e449b7c8 Mon Sep 17 00:00:00 2001 From: Sai Ravi Teja Chintakrindi Date: Fri, 31 Mar 2023 19:09:46 +0530 Subject: [PATCH 200/751] Set authenticated user's email visibility (#2711) Fixes: #2688. --- github/users_emails.go | 25 +++++++++++++++++++++ github/users_emails_test.go | 44 +++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) diff --git a/github/users_emails.go b/github/users_emails.go index be7e0f819ec..67bd210e8d5 100644 --- a/github/users_emails.go +++ b/github/users_emails.go @@ -70,3 +70,28 @@ func (s *UsersService) DeleteEmails(ctx context.Context, emails []string) (*Resp return s.client.Do(ctx, req, nil) } + +// SetEmailVisibility sets the visibility for the primary email address of the authenticated user. +// `visibility` can be "private" or "public". +// +// GitHub API docs: https://docs.github.com/en/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user +func (s *UsersService) SetEmailVisibility(ctx context.Context, visibility string) ([]*UserEmail, *Response, error) { + u := "user/email/visibility" + + updateVisiblilityReq := &UserEmail{ + Visibility: &visibility, + } + + req, err := s.client.NewRequest("PATCH", u, updateVisiblilityReq) + if err != nil { + return nil, nil, err + } + + var e []*UserEmail + resp, err := s.client.Do(ctx, req, &e) + if err != nil { + return nil, resp, err + } + + return e, resp, nil +} diff --git a/github/users_emails_test.go b/github/users_emails_test.go index d40356d8732..ad9d32e9491 100644 --- a/github/users_emails_test.go +++ b/github/users_emails_test.go @@ -140,3 +140,47 @@ func TestUserEmail_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestUsersService_SetEmailVisibility(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + input := &UserEmail{Visibility: String("private")} + + mux.HandleFunc("/user/email/visibility", func(w http.ResponseWriter, r *http.Request) { + v := new(UserEmail) + json.NewDecoder(r.Body).Decode(&v) + + testMethod(t, r, "PATCH") + if !cmp.Equal(v, input) { + t.Errorf("Request body = %+v, want %+v", v, input) + } + + fmt.Fprint(w, `[{ + "email": "user@example.com", + "verified": false, + "primary": true, + "visibility": "private" + }]`) + }) + + ctx := context.Background() + emails, _, err := client.Users.SetEmailVisibility(ctx, "private") + if err != nil { + t.Errorf("Users.SetEmailVisibility returned error: %v", err) + } + + want := []*UserEmail{{Email: String("user@example.com"), Verified: Bool(false), Primary: Bool(true), Visibility: String("private")}} + if !cmp.Equal(emails, want) { + t.Errorf("Users.SetEmailVisibility returned %+v, want %+v", emails, want) + } + + const methodName = "SetEmailVisibility" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Users.SetEmailVisibility(ctx, "private") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} From 388d921556cf438dde967f0e86658b8a7af9c53b Mon Sep 17 00:00:00 2001 From: "T.J. Corrigan" Date: Fri, 31 Mar 2023 08:41:01 -0500 Subject: [PATCH 201/751] Add support for deleting an org (#2728) Fixes: #2726. --- github/orgs.go | 13 +++++++++++++ github/orgs_test.go | 25 +++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/github/orgs.go b/github/orgs.go index 487405778f1..837dda89e0e 100644 --- a/github/orgs.go +++ b/github/orgs.go @@ -262,6 +262,19 @@ func (s *OrganizationsService) Edit(ctx context.Context, name string, org *Organ return o, resp, nil } +// Delete an organization by name. +// +// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#delete-an-organization +func (s *OrganizationsService) Delete(ctx context.Context, org string) (*Response, error) { + u := fmt.Sprintf("orgs/%v", org) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + // ListInstallations lists installations for an organization. // // GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#list-app-installations-for-an-organization diff --git a/github/orgs_test.go b/github/orgs_test.go index b30c48f1bce..1205ad00046 100644 --- a/github/orgs_test.go +++ b/github/orgs_test.go @@ -315,6 +315,31 @@ func TestOrganizationsService_Edit_invalidOrg(t *testing.T) { testURLParseError(t, err) } +func TestOrganizationsService_Delete(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + }) + + ctx := context.Background() + _, err := client.Organizations.Delete(ctx, "o") + if err != nil { + t.Errorf("Organizations.Delete returned error: %v", err) + } + + const methodName = "Delete" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Organizations.Delete(ctx, "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Organizations.Delete(ctx, "o") + }) +} + func TestOrganizationsService_ListInstallations(t *testing.T) { client, mux, _, teardown := setup() defer teardown() From b1c53f808b2218b2572fa7f8a8b4b4401a02ca96 Mon Sep 17 00:00:00 2001 From: Will Norris Date: Sat, 1 Apr 2023 10:16:19 -0700 Subject: [PATCH 202/751] verify payload signature if present (#2732) Fixes: #2731. --- github/messages.go | 11 +++++------ github/messages_test.go | 35 +++++++++++++---------------------- 2 files changed, 18 insertions(+), 28 deletions(-) diff --git a/github/messages.go b/github/messages.go index 0943b9e9870..925e73e9a67 100644 --- a/github/messages.go +++ b/github/messages.go @@ -148,13 +148,13 @@ func messageMAC(signature string) ([]byte, func() hash.Hash, error) { return buf, hashFunc, nil } -// ValidatePayload validates an incoming GitHub Webhook event request body +// ValidatePayloadFromBody validates an incoming GitHub Webhook event request body // and returns the (JSON) payload. // The Content-Type header of the payload can be "application/json" or "application/x-www-form-urlencoded". // If the Content-Type is neither then an error is returned. // secretToken is the GitHub Webhook secret token. -// If your webhook does not contain a secret token, you can pass nil or an empty slice. -// This is intended for local development purposes only and all webhooks should ideally set up a secret token. +// If your webhook does not contain a secret token, you can pass an empty secretToken. +// Webhooks without a secret token are not secure and should be avoided. // // Example usage: // @@ -201,9 +201,8 @@ func ValidatePayloadFromBody(contentType string, readable io.Reader, signature s return nil, fmt.Errorf("webhook request has unsupported Content-Type %q", contentType) } - // Only validate the signature if a secret token exists. This is intended for - // local development only and all webhooks should ideally set up a secret token. - if len(secretToken) > 0 { + // Validate the signature if present or if one is expected (secretToken is non-empty). + if len(secretToken) > 0 || len(signature) > 0 { if err := ValidateSignature(signature, body, secretToken); err != nil { return nil, err } diff --git a/github/messages_test.go b/github/messages_test.go index ee374104ce0..04f29420402 100644 --- a/github/messages_test.go +++ b/github/messages_test.go @@ -30,51 +30,42 @@ func TestValidatePayload(t *testing.T) { const defaultSignature = "sha1=126f2c800419c60137ce748d7672e77b65cf16d6" secretKey := []byte("0123456789abcdef") tests := []struct { + secretKey []byte signature string signatureHeader string - eventID string - event string - wantEventID string - wantEvent string wantPayload string }{ // The following tests generate expected errors: - {}, // Missing signature - {signature: "yo"}, // Missing signature prefix - {signature: "sha1=yo"}, // Signature not hex string - {signature: "sha1=012345"}, // Invalid signature + {secretKey: secretKey}, // Missing signature + {secretKey: secretKey, signature: "yo"}, // Missing signature prefix + {secretKey: secretKey, signature: "sha1=yo"}, // Signature not hex string + {secretKey: secretKey, signature: "sha1=012345"}, // Invalid signature + {signature: defaultSignature}, // signature without secretKey + // The following tests expect err=nil: { - signature: defaultSignature, - eventID: "dead-beef", - event: "ping", - wantEventID: "dead-beef", - wantEvent: "ping", + // no secretKey and no signature still passes validation wantPayload: defaultBody, }, { + secretKey: secretKey, signature: defaultSignature, - event: "ping", - wantEvent: "ping", wantPayload: defaultBody, }, { + secretKey: secretKey, signature: "sha256=b1f8020f5b4cd42042f807dd939015c4a418bc1ff7f604dd55b0a19b5d953d9b", - event: "ping", - wantEvent: "ping", wantPayload: defaultBody, }, { + secretKey: secretKey, signature: "sha256=b1f8020f5b4cd42042f807dd939015c4a418bc1ff7f604dd55b0a19b5d953d9b", signatureHeader: SHA256SignatureHeader, - event: "ping", - wantEvent: "ping", wantPayload: defaultBody, }, { + secretKey: secretKey, signature: "sha512=8456767023c1195682e182a23b3f5d19150ecea598fde8cb85918f7281b16079471b1329f92b912c4d8bd7455cb159777db8f29608b20c7c87323ba65ae62e1f", - event: "ping", - wantEvent: "ping", wantPayload: defaultBody, }, } @@ -94,7 +85,7 @@ func TestValidatePayload(t *testing.T) { } req.Header.Set("Content-Type", "application/json") - got, err := ValidatePayload(req, secretKey) + got, err := ValidatePayload(req, test.secretKey) if err != nil { if test.wantPayload != "" { t.Errorf("ValidatePayload(%#v): err = %v, want nil", test, err) From 8b1caacfab615d2727189e763aec256f94d2fc12 Mon Sep 17 00:00:00 2001 From: Vivek Date: Tue, 4 Apr 2023 19:12:00 +0530 Subject: [PATCH 203/751] Implement the actions required workflows APIs (#2730) Fixes: #2729. --- github/actions_required_workflows.go | 233 +++++++++++++ github/actions_required_workflows_test.go | 403 ++++++++++++++++++++++ github/github-accessors.go | 224 ++++++++++++ github/github-accessors_test.go | 271 +++++++++++++++ 4 files changed, 1131 insertions(+) create mode 100644 github/actions_required_workflows.go create mode 100644 github/actions_required_workflows_test.go diff --git a/github/actions_required_workflows.go b/github/actions_required_workflows.go new file mode 100644 index 00000000000..73a4c77facb --- /dev/null +++ b/github/actions_required_workflows.go @@ -0,0 +1,233 @@ +// Copyright 2023 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" +) + +// OrgRequiredWorkflow represents a required workflow object at the org level. +type OrgRequiredWorkflow struct { + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Path *string `json:"path,omitempty"` + Scope *string `json:"scope,omitempty"` + Ref *string `json:"ref,omitempty"` + State *string `json:"state,omitempty"` + SelectedRepositoriesURL *string `json:"selected_repositories_url,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + Repository *Repository `json:"repository,omitempty"` +} + +// OrgRequiredWorkflows represents the required workflows for the org. +type OrgRequiredWorkflows struct { + TotalCount *int `json:"total_count,omitempty"` + RequiredWorkflows []*OrgRequiredWorkflow `json:"required_workflows,omitempty"` +} + +// CreateUpdateRequiredWorkflowOptions represents the input object used to create or update required workflows. +type CreateUpdateRequiredWorkflowOptions struct { + WorkflowFilePath *string `json:"workflow_file_path,omitempty"` + RepositoryID *int64 `json:"repository_id,omitempty"` + Scope *string `json:"scope,omitempty"` + SelectedRepositoryIDs *SelectedRepoIDs `json:"selected_repository_ids,omitempty"` +} + +// RequiredWorkflowSelectedRepos represents the repos that a required workflow is applied to. +type RequiredWorkflowSelectedRepos struct { + TotalCount *int `json:"total_count,omitempty"` + Repositories []*Repository `json:"repositories,omitempty"` +} + +// RepoRequiredWorkflow represents a required workflow object at the repo level. +type RepoRequiredWorkflow struct { + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Name *string `json:"name,omitempty"` + Path *string `json:"path,omitempty"` + State *string `json:"state,omitempty"` + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + BadgeURL *string `json:"badge_url,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + SourceRepository *Repository `json:"source_repository,omitempty"` +} + +// RepoRequiredWorkflows represents the required workflows for a repo. +type RepoRequiredWorkflows struct { + TotalCount *int `json:"total_count,omitempty"` + RequiredWorkflows []*RepoRequiredWorkflow `json:"required_workflows,omitempty"` +} + +// ListOrgRequiredWorkflows lists the RequiredWorkflows for an org. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#list-required-workflows +func (s *ActionsService) ListOrgRequiredWorkflows(ctx context.Context, org string, opts *ListOptions) (*OrgRequiredWorkflows, *Response, error) { + url := fmt.Sprintf("orgs/%v/actions/required_workflows", org) + u, err := addOptions(url, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + requiredWorkflows := new(OrgRequiredWorkflows) + resp, err := s.client.Do(ctx, req, &requiredWorkflows) + if err != nil { + return nil, resp, err + } + + return requiredWorkflows, resp, nil +} + +// CreateRequiredWorkflow creates the required workflow in an org. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#create-a-required-workflow +func (s *ActionsService) CreateRequiredWorkflow(ctx context.Context, org string, createRequiredWorkflowOptions *CreateUpdateRequiredWorkflowOptions) (*Response, error) { + url := fmt.Sprintf("orgs/%v/actions/required_workflows", org) + req, err := s.client.NewRequest("PUT", url, createRequiredWorkflowOptions) + if err != nil { + return nil, err + } + return s.client.Do(ctx, req, nil) +} + +// GetRequiredWorkflowByID get the RequiredWorkflows for an org by its ID. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#list-required-workflows +func (s *ActionsService) GetRequiredWorkflowByID(ctx context.Context, owner string, requiredWorkflowID int64) (*OrgRequiredWorkflow, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/required_workflows/%v", owner, requiredWorkflowID) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + requiredWorkflow := new(OrgRequiredWorkflow) + resp, err := s.client.Do(ctx, req, &requiredWorkflow) + if err != nil { + return nil, resp, err + } + + return requiredWorkflow, resp, nil +} + +// UpdateRequiredWorkflow updates a required workflow in an org. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#update-a-required-workflow +func (s *ActionsService) UpdateRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID int64, updateRequiredWorkflowOptions *CreateUpdateRequiredWorkflowOptions) (*Response, error) { + url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v", org, requiredWorkflowID) + req, err := s.client.NewRequest("PATCH", url, updateRequiredWorkflowOptions) + if err != nil { + return nil, err + } + return s.client.Do(ctx, req, nil) +} + +// DeleteRequiredWorkflow deletes a required workflow in an org. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#update-a-required-workflow +func (s *ActionsService) DeleteRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID int64) (*Response, error) { + url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v", org, requiredWorkflowID) + req, err := s.client.NewRequest("DELETE", url, nil) + if err != nil { + return nil, err + } + return s.client.Do(ctx, req, nil) +} + +// ListRequiredWorkflowSelectedRepos lists the Repositories selected for a workflow. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#list-selected-repositories-for-a-required-workflow +func (s *ActionsService) ListRequiredWorkflowSelectedRepos(ctx context.Context, org string, requiredWorkflowID int64, opts *ListOptions) (*RequiredWorkflowSelectedRepos, *Response, error) { + url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories", org, requiredWorkflowID) + u, err := addOptions(url, opts) + if err != nil { + return nil, nil, err + } + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + requiredWorkflowRepos := new(RequiredWorkflowSelectedRepos) + resp, err := s.client.Do(ctx, req, &requiredWorkflowRepos) + if err != nil { + return nil, resp, err + } + + return requiredWorkflowRepos, resp, nil +} + +// SetRequiredWorkflowSelectedRepos sets the Repositories selected for a workflow. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#sets-repositories-for-a-required-workflow +func (s *ActionsService) SetRequiredWorkflowSelectedRepos(ctx context.Context, org string, requiredWorkflowID int64, ids SelectedRepoIDs) (*Response, error) { + type repoIDs struct { + SelectedIDs SelectedRepoIDs `json:"selected_repository_ids"` + } + url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories", org, requiredWorkflowID) + req, err := s.client.NewRequest("PUT", url, repoIDs{SelectedIDs: ids}) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// AddRepoToRequiredWorkflow adds the Repository to a required workflow. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#add-a-repository-to-a-required-workflow +func (s *ActionsService) AddRepoToRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID, repoID int64) (*Response, error) { + url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories/%v", org, requiredWorkflowID, repoID) + req, err := s.client.NewRequest("PUT", url, nil) + if err != nil { + return nil, err + } + return s.client.Do(ctx, req, nil) +} + +// RemoveRepoFromRequiredWorkflow removes the Repository from a required workflow. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#add-a-repository-to-a-required-workflow +func (s *ActionsService) RemoveRepoFromRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID, repoID int64) (*Response, error) { + url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories/%v", org, requiredWorkflowID, repoID) + req, err := s.client.NewRequest("DELETE", url, nil) + if err != nil { + return nil, err + } + return s.client.Do(ctx, req, nil) +} + +// ListRepoRequiredWorkflows lists the RequiredWorkflows for a repo. +// +// Github API docs:https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#list-repository-required-workflows +func (s *ActionsService) ListRepoRequiredWorkflows(ctx context.Context, owner, repo string, opts *ListOptions) (*RepoRequiredWorkflows, *Response, error) { + url := fmt.Sprintf("repos/%v/%v/actions/required_workflows", owner, repo) + u, err := addOptions(url, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + requiredWorkflows := new(RepoRequiredWorkflows) + resp, err := s.client.Do(ctx, req, &requiredWorkflows) + if err != nil { + return nil, resp, err + } + + return requiredWorkflows, resp, nil +} diff --git a/github/actions_required_workflows_test.go b/github/actions_required_workflows_test.go new file mode 100644 index 00000000000..a560d7e995e --- /dev/null +++ b/github/actions_required_workflows_test.go @@ -0,0 +1,403 @@ +// Copyright 2023 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" + "time" + + "github.com/google/go-cmp/cmp" +) + +func TestActionsService_ListOrgRequiredWorkflows(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + mux.HandleFunc("/orgs/o/actions/required_workflows", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{"per_page": "2", "page": "2"}) + fmt.Fprint(w, `{"total_count":4,"required_workflows": [ + { + "id": 30433642, + "name": "Required CI", + "path": ".github/workflows/ci.yml", + "scope": "selected", + "ref": "refs/head/main", + "state": "active", + "selected_repositories_url": "https://api.github.com/organizations/org/actions/required_workflows/1/repositories", + "created_at": "2020-01-22T19:33:08Z", + "updated_at": "2020-01-22T19:33:08Z" + }, + { + "id": 30433643, + "name": "Required Linter", + "path": ".github/workflows/lint.yml", + "scope": "all", + "ref": "refs/head/main", + "state": "active", + "created_at": "2020-01-22T19:33:08Z", + "updated_at": "2020-01-22T19:33:08Z" + } + ] + }`) + }) + opts := &ListOptions{Page: 2, PerPage: 2} + ctx := context.Background() + jobs, _, err := client.Actions.ListOrgRequiredWorkflows(ctx, "o", opts) + + if err != nil { + t.Errorf("Actions.ListOrgRequiredWorkflows returned error: %v", err) + } + + want := &OrgRequiredWorkflows{ + TotalCount: Int(4), + RequiredWorkflows: []*OrgRequiredWorkflow{ + {ID: Int64(30433642), Name: String("Required CI"), Path: String(".github/workflows/ci.yml"), Scope: String("selected"), Ref: String("refs/head/main"), State: String("active"), SelectedRepositoriesURL: String("https://api.github.com/organizations/org/actions/required_workflows/1/repositories"), CreatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}}, + {ID: Int64(30433643), Name: String("Required Linter"), Path: String(".github/workflows/lint.yml"), Scope: String("all"), Ref: String("refs/head/main"), State: String("active"), CreatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}}, + }, + } + if !cmp.Equal(jobs, want) { + t.Errorf("Actions.ListOrgRequiredWorkflows returned %+v, want %+v", jobs, want) + } + const methodName = "ListOrgRequiredWorkflows" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.ListOrgRequiredWorkflows(ctx, "\n", opts) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.ListOrgRequiredWorkflows(ctx, "o", opts) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_CreateRequiredWorkflow(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + mux.HandleFunc("/orgs/o/actions/required_workflows", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + testHeader(t, r, "Content-Type", "application/json") + testBody(t, r, `{"workflow_file_path":".github/workflows/ci.yaml","repository_id":53,"scope":"selected","selected_repository_ids":[32,91]}`+"\n") + w.WriteHeader(http.StatusCreated) + }) + input := &CreateUpdateRequiredWorkflowOptions{ + WorkflowFilePath: String(".github/workflows/ci.yaml"), + RepositoryID: Int64(53), + Scope: String("selected"), + SelectedRepositoryIDs: &SelectedRepoIDs{32, 91}, + } + ctx := context.Background() + _, err := client.Actions.CreateRequiredWorkflow(ctx, "o", input) + + if err != nil { + t.Errorf("Actions.CreateRequiredWorkflow returned error: %v", err) + } + + const methodName = "CreateRequiredWorkflow" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Actions.CreateRequiredWorkflow(ctx, "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Actions.CreateRequiredWorkflow(ctx, "o", input) + }) +} + +func TestActionsService_GetRequiredWorkflowByID(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + mux.HandleFunc("/orgs/o/actions/required_workflows/12345", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "id": 12345, + "name": "Required CI", + "path": ".github/workflows/ci.yml", + "scope": "selected", + "ref": "refs/head/main", + "state": "active", + "selected_repositories_url": "https://api.github.com/orgs/o/actions/required_workflows/12345/repositories", + "created_at": "2020-01-22T19:33:08Z", + "updated_at": "2020-01-22T19:33:08Z", + "repository":{ + "id": 1296269, + "url": "https://api.github.com/repos/o/Hello-World", + "name": "Hello-World" + } + }`) + }) + ctx := context.Background() + jobs, _, err := client.Actions.GetRequiredWorkflowByID(ctx, "o", 12345) + + if err != nil { + t.Errorf("Actions.GetRequiredWorkflowByID returned error: %v", err) + } + + want := &OrgRequiredWorkflow{ + ID: Int64(12345), Name: String("Required CI"), Path: String(".github/workflows/ci.yml"), Scope: String("selected"), Ref: String("refs/head/main"), State: String("active"), SelectedRepositoriesURL: String("https://api.github.com/orgs/o/actions/required_workflows/12345/repositories"), CreatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, Repository: &Repository{ID: Int64(1296269), URL: String("https://api.github.com/repos/o/Hello-World"), Name: String("Hello-World")}, + } + if !cmp.Equal(jobs, want) { + t.Errorf("Actions.GetRequiredWorkflowByID returned %+v, want %+v", jobs, want) + } + const methodName = "GetRequiredWorkflowByID" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.GetRequiredWorkflowByID(ctx, "\n", 1) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.GetRequiredWorkflowByID(ctx, "o", 12345) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_UpdateRequiredWorkflow(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + mux.HandleFunc("/orgs/o/actions/required_workflows/12345", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PATCH") + testHeader(t, r, "Content-Type", "application/json") + testBody(t, r, `{"workflow_file_path":".github/workflows/ci.yaml","repository_id":53,"scope":"selected","selected_repository_ids":[32,91]}`+"\n") + w.WriteHeader(http.StatusOK) + }) + input := &CreateUpdateRequiredWorkflowOptions{ + WorkflowFilePath: String(".github/workflows/ci.yaml"), + RepositoryID: Int64(53), + Scope: String("selected"), + SelectedRepositoryIDs: &SelectedRepoIDs{32, 91}, + } + ctx := context.Background() + _, err := client.Actions.UpdateRequiredWorkflow(ctx, "o", 12345, input) + + if err != nil { + t.Errorf("Actions.UpdateRequiredWorkflow returned error: %v", err) + } + + const methodName = "UpdateRequiredWorkflow" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Actions.UpdateRequiredWorkflow(ctx, "\n", 12345, input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Actions.UpdateRequiredWorkflow(ctx, "o", 12345, input) + }) +} + +func TestActionsService_DeleteRequiredWorkflow(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + mux.HandleFunc("/orgs/o/actions/required_workflows/12345", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + w.WriteHeader(http.StatusNoContent) + }) + ctx := context.Background() + _, err := client.Actions.DeleteRequiredWorkflow(ctx, "o", 12345) + + if err != nil { + t.Errorf("Actions.DeleteRequiredWorkflow returned error: %v", err) + } + + const methodName = "DeleteRequiredWorkflow" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Actions.DeleteRequiredWorkflow(ctx, "\n", 12345) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Actions.DeleteRequiredWorkflow(ctx, "o", 12345) + }) +} + +func TestActionsService_ListRequiredWorkflowSelectedRepos(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + mux.HandleFunc("/orgs/o/actions/required_workflows/12345/repositories", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{"per_page": "2", "page": "2"}) + fmt.Fprint(w, `{"total_count":1, + "repositories": [{ + "id": 1296269, + "url": "https://api.github.com/repos/o/Hello-World", + "name": "Hello-World" + }] + }`) + }) + opts := &ListOptions{Page: 2, PerPage: 2} + ctx := context.Background() + jobs, _, err := client.Actions.ListRequiredWorkflowSelectedRepos(ctx, "o", 12345, opts) + + if err != nil { + t.Errorf("Actions.ListRequiredWorkflowSelectedRepositories returned error: %v", err) + } + + want := &RequiredWorkflowSelectedRepos{ + TotalCount: Int(1), + Repositories: []*Repository{ + {ID: Int64(1296269), URL: String("https://api.github.com/repos/o/Hello-World"), Name: String("Hello-World")}, + }, + } + if !cmp.Equal(jobs, want) { + t.Errorf("Actions.ListRequiredWorkflowSelectedRepositories returned %+v, want %+v", jobs, want) + } + const methodName = "ListRequiredWorkflowSelectedRepositories" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.ListRequiredWorkflowSelectedRepos(ctx, "\n", 12345, opts) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.ListRequiredWorkflowSelectedRepos(ctx, "o", 12345, opts) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_SetRequiredWorkflowSelectedRepos(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + mux.HandleFunc("/orgs/o/actions/required_workflows/12345/repositories", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + testHeader(t, r, "Content-Type", "application/json") + testBody(t, r, `{"selected_repository_ids":[32,91]}`+"\n") + w.WriteHeader(http.StatusNoContent) + }) + ctx := context.Background() + _, err := client.Actions.SetRequiredWorkflowSelectedRepos(ctx, "o", 12345, SelectedRepoIDs{32, 91}) + + if err != nil { + t.Errorf("Actions.SetRequiredWorkflowSelectedRepositories returned error: %v", err) + } + + const methodName = "SetRequiredWorkflowSelectedRepositories" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Actions.SetRequiredWorkflowSelectedRepos(ctx, "\n", 12345, SelectedRepoIDs{32, 91}) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Actions.SetRequiredWorkflowSelectedRepos(ctx, "o", 12345, SelectedRepoIDs{32, 91}) + }) +} + +func TestActionsService_AddRepoToRequiredWorkflow(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + mux.HandleFunc("/orgs/o/actions/required_workflows/12345/repositories/32", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + w.WriteHeader(http.StatusNoContent) + }) + ctx := context.Background() + _, err := client.Actions.AddRepoToRequiredWorkflow(ctx, "o", 12345, 32) + + if err != nil { + t.Errorf("Actions.AddRepoToRequiredWorkflow returned error: %v", err) + } + + const methodName = "AddRepoToRequiredWorkflow" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Actions.AddRepoToRequiredWorkflow(ctx, "\n", 12345, 32) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Actions.AddRepoToRequiredWorkflow(ctx, "o", 12345, 32) + }) +} + +func TestActionsService_RemoveRepoFromRequiredWorkflow(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + mux.HandleFunc("/orgs/o/actions/required_workflows/12345/repositories/32", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + w.WriteHeader(http.StatusNoContent) + }) + ctx := context.Background() + _, err := client.Actions.RemoveRepoFromRequiredWorkflow(ctx, "o", 12345, 32) + + if err != nil { + t.Errorf("Actions.RemoveRepoFromRequiredWorkflow returned error: %v", err) + } + + const methodName = "RemoveRepoFromRequiredWorkflow" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Actions.RemoveRepoFromRequiredWorkflow(ctx, "\n", 12345, 32) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Actions.RemoveRepoFromRequiredWorkflow(ctx, "o", 12345, 32) + }) +} + +func TestActionsService_ListRepoRequiredWorkflows(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + mux.HandleFunc("/repos/o/r/actions/required_workflows", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{"per_page": "2", "page": "2"}) + fmt.Fprint(w, `{"total_count":1,"required_workflows": [ + { + "id": 30433642, + "node_id": "MDg6V29ya2Zsb3cxNjEzMzU=", + "name": "Required CI", + "path": ".github/workflows/ci.yml", + "state": "active", + "created_at": "2020-01-22T19:33:08Z", + "updated_at": "2020-01-22T19:33:08Z", + "url": "https://api.github.com/repos/o/r/actions/required_workflows/161335", + "html_url": "https://github.com/o/r/blob/master/o/hello-world/.github/workflows/required_ci.yaml", + "badge_url": "https://github.com/o/r/workflows/required/o/hello-world/.github/workflows/required_ci.yaml/badge.svg", + "source_repository":{ + "id": 1296269, + "url": "https://api.github.com/repos/o/Hello-World", + "name": "Hello-World" + } + } + ] + }`) + }) + opts := &ListOptions{Page: 2, PerPage: 2} + ctx := context.Background() + jobs, _, err := client.Actions.ListRepoRequiredWorkflows(ctx, "o", "r", opts) + + if err != nil { + t.Errorf("Actions.ListRepoRequiredWorkflows returned error: %v", err) + } + + want := &RepoRequiredWorkflows{ + TotalCount: Int(1), + RequiredWorkflows: []*RepoRequiredWorkflow{ + {ID: Int64(30433642), NodeID: String("MDg6V29ya2Zsb3cxNjEzMzU="), Name: String("Required CI"), Path: String(".github/workflows/ci.yml"), State: String("active"), CreatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, URL: String("https://api.github.com/repos/o/r/actions/required_workflows/161335"), BadgeURL: String("https://github.com/o/r/workflows/required/o/hello-world/.github/workflows/required_ci.yaml/badge.svg"), HTMLURL: String("https://github.com/o/r/blob/master/o/hello-world/.github/workflows/required_ci.yaml"), SourceRepository: &Repository{ID: Int64(1296269), URL: String("https://api.github.com/repos/o/Hello-World"), Name: String("Hello-World")}}, + }, + } + if !cmp.Equal(jobs, want) { + t.Errorf("Actions.ListRepoRequiredWorkflows returned %+v, want %+v", jobs, want) + } + const methodName = "ListRepoRequiredWorkflows" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.ListRepoRequiredWorkflows(ctx, "\n", "\n", opts) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.ListRepoRequiredWorkflows(ctx, "o", "r", opts) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} diff --git a/github/github-accessors.go b/github/github-accessors.go index b814fd8df12..ca5cda6c283 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -4046,6 +4046,38 @@ func (c *CreateUpdateEnvironment) GetWaitTimer() int { return *c.WaitTimer } +// GetRepositoryID returns the RepositoryID field if it's non-nil, zero value otherwise. +func (c *CreateUpdateRequiredWorkflowOptions) GetRepositoryID() int64 { + if c == nil || c.RepositoryID == nil { + return 0 + } + return *c.RepositoryID +} + +// GetScope returns the Scope field if it's non-nil, zero value otherwise. +func (c *CreateUpdateRequiredWorkflowOptions) GetScope() string { + if c == nil || c.Scope == nil { + return "" + } + return *c.Scope +} + +// GetSelectedRepositoryIDs returns the SelectedRepositoryIDs field. +func (c *CreateUpdateRequiredWorkflowOptions) GetSelectedRepositoryIDs() *SelectedRepoIDs { + if c == nil { + return nil + } + return c.SelectedRepositoryIDs +} + +// GetWorkflowFilePath returns the WorkflowFilePath field if it's non-nil, zero value otherwise. +func (c *CreateUpdateRequiredWorkflowOptions) GetWorkflowFilePath() string { + if c == nil || c.WorkflowFilePath == nil { + return "" + } + return *c.WorkflowFilePath +} + // GetBody returns the Body field if it's non-nil, zero value otherwise. func (c *CreateUserProjectOptions) GetBody() string { if c == nil || c.Body == nil { @@ -11078,6 +11110,94 @@ func (o *OrgBlockEvent) GetSender() *User { return o.Sender } +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (o *OrgRequiredWorkflow) GetCreatedAt() Timestamp { + if o == nil || o.CreatedAt == nil { + return Timestamp{} + } + return *o.CreatedAt +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (o *OrgRequiredWorkflow) GetID() int64 { + if o == nil || o.ID == nil { + return 0 + } + return *o.ID +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (o *OrgRequiredWorkflow) GetName() string { + if o == nil || o.Name == nil { + return "" + } + return *o.Name +} + +// GetPath returns the Path field if it's non-nil, zero value otherwise. +func (o *OrgRequiredWorkflow) GetPath() string { + if o == nil || o.Path == nil { + return "" + } + return *o.Path +} + +// GetRef returns the Ref field if it's non-nil, zero value otherwise. +func (o *OrgRequiredWorkflow) GetRef() string { + if o == nil || o.Ref == nil { + return "" + } + return *o.Ref +} + +// GetRepository returns the Repository field. +func (o *OrgRequiredWorkflow) GetRepository() *Repository { + if o == nil { + return nil + } + return o.Repository +} + +// GetScope returns the Scope field if it's non-nil, zero value otherwise. +func (o *OrgRequiredWorkflow) GetScope() string { + if o == nil || o.Scope == nil { + return "" + } + return *o.Scope +} + +// GetSelectedRepositoriesURL returns the SelectedRepositoriesURL field if it's non-nil, zero value otherwise. +func (o *OrgRequiredWorkflow) GetSelectedRepositoriesURL() string { + if o == nil || o.SelectedRepositoriesURL == nil { + return "" + } + return *o.SelectedRepositoriesURL +} + +// GetState returns the State field if it's non-nil, zero value otherwise. +func (o *OrgRequiredWorkflow) GetState() string { + if o == nil || o.State == nil { + return "" + } + return *o.State +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (o *OrgRequiredWorkflow) GetUpdatedAt() Timestamp { + if o == nil || o.UpdatedAt == nil { + return Timestamp{} + } + return *o.UpdatedAt +} + +// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. +func (o *OrgRequiredWorkflows) GetTotalCount() int { + if o == nil || o.TotalCount == nil { + return 0 + } + return *o.TotalCount +} + // GetDisabledOrgs returns the DisabledOrgs field if it's non-nil, zero value otherwise. func (o *OrgStats) GetDisabledOrgs() int { if o == nil || o.DisabledOrgs == nil { @@ -15502,6 +15622,102 @@ func (r *RepoName) GetFrom() string { return *r.From } +// GetBadgeURL returns the BadgeURL field if it's non-nil, zero value otherwise. +func (r *RepoRequiredWorkflow) GetBadgeURL() string { + if r == nil || r.BadgeURL == nil { + return "" + } + return *r.BadgeURL +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (r *RepoRequiredWorkflow) GetCreatedAt() Timestamp { + if r == nil || r.CreatedAt == nil { + return Timestamp{} + } + return *r.CreatedAt +} + +// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. +func (r *RepoRequiredWorkflow) GetHTMLURL() string { + if r == nil || r.HTMLURL == nil { + return "" + } + return *r.HTMLURL +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (r *RepoRequiredWorkflow) GetID() int64 { + if r == nil || r.ID == nil { + return 0 + } + return *r.ID +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (r *RepoRequiredWorkflow) GetName() string { + if r == nil || r.Name == nil { + return "" + } + return *r.Name +} + +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (r *RepoRequiredWorkflow) GetNodeID() string { + if r == nil || r.NodeID == nil { + return "" + } + return *r.NodeID +} + +// GetPath returns the Path field if it's non-nil, zero value otherwise. +func (r *RepoRequiredWorkflow) GetPath() string { + if r == nil || r.Path == nil { + return "" + } + return *r.Path +} + +// GetSourceRepository returns the SourceRepository field. +func (r *RepoRequiredWorkflow) GetSourceRepository() *Repository { + if r == nil { + return nil + } + return r.SourceRepository +} + +// GetState returns the State field if it's non-nil, zero value otherwise. +func (r *RepoRequiredWorkflow) GetState() string { + if r == nil || r.State == nil { + return "" + } + return *r.State +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (r *RepoRequiredWorkflow) GetUpdatedAt() Timestamp { + if r == nil || r.UpdatedAt == nil { + return Timestamp{} + } + return *r.UpdatedAt +} + +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (r *RepoRequiredWorkflow) GetURL() string { + if r == nil || r.URL == nil { + return "" + } + return *r.URL +} + +// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. +func (r *RepoRequiredWorkflows) GetTotalCount() int { + if r == nil || r.TotalCount == nil { + return 0 + } + return *r.TotalCount +} + // GetIncompleteResults returns the IncompleteResults field if it's non-nil, zero value otherwise. func (r *RepositoriesSearchResult) GetIncompleteResults() bool { if r == nil || r.IncompleteResults == nil { @@ -17518,6 +17734,14 @@ func (r *RequiredStatusChecksRequest) GetStrict() bool { return *r.Strict } +// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. +func (r *RequiredWorkflowSelectedRepos) GetTotalCount() int { + if r == nil || r.TotalCount == nil { + return 0 + } + return *r.TotalCount +} + // GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. func (r *ReviewersRequest) GetNodeID() string { if r == nil || r.NodeID == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index efdc3f648a2..bcf8ee1f766 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -4752,6 +4752,43 @@ func TestCreateUpdateEnvironment_GetWaitTimer(tt *testing.T) { c.GetWaitTimer() } +func TestCreateUpdateRequiredWorkflowOptions_GetRepositoryID(tt *testing.T) { + var zeroValue int64 + c := &CreateUpdateRequiredWorkflowOptions{RepositoryID: &zeroValue} + c.GetRepositoryID() + c = &CreateUpdateRequiredWorkflowOptions{} + c.GetRepositoryID() + c = nil + c.GetRepositoryID() +} + +func TestCreateUpdateRequiredWorkflowOptions_GetScope(tt *testing.T) { + var zeroValue string + c := &CreateUpdateRequiredWorkflowOptions{Scope: &zeroValue} + c.GetScope() + c = &CreateUpdateRequiredWorkflowOptions{} + c.GetScope() + c = nil + c.GetScope() +} + +func TestCreateUpdateRequiredWorkflowOptions_GetSelectedRepositoryIDs(tt *testing.T) { + c := &CreateUpdateRequiredWorkflowOptions{} + c.GetSelectedRepositoryIDs() + c = nil + c.GetSelectedRepositoryIDs() +} + +func TestCreateUpdateRequiredWorkflowOptions_GetWorkflowFilePath(tt *testing.T) { + var zeroValue string + c := &CreateUpdateRequiredWorkflowOptions{WorkflowFilePath: &zeroValue} + c.GetWorkflowFilePath() + c = &CreateUpdateRequiredWorkflowOptions{} + c.GetWorkflowFilePath() + c = nil + c.GetWorkflowFilePath() +} + func TestCreateUserProjectOptions_GetBody(tt *testing.T) { var zeroValue string c := &CreateUserProjectOptions{Body: &zeroValue} @@ -12993,6 +13030,113 @@ func TestOrgBlockEvent_GetSender(tt *testing.T) { o.GetSender() } +func TestOrgRequiredWorkflow_GetCreatedAt(tt *testing.T) { + var zeroValue Timestamp + o := &OrgRequiredWorkflow{CreatedAt: &zeroValue} + o.GetCreatedAt() + o = &OrgRequiredWorkflow{} + o.GetCreatedAt() + o = nil + o.GetCreatedAt() +} + +func TestOrgRequiredWorkflow_GetID(tt *testing.T) { + var zeroValue int64 + o := &OrgRequiredWorkflow{ID: &zeroValue} + o.GetID() + o = &OrgRequiredWorkflow{} + o.GetID() + o = nil + o.GetID() +} + +func TestOrgRequiredWorkflow_GetName(tt *testing.T) { + var zeroValue string + o := &OrgRequiredWorkflow{Name: &zeroValue} + o.GetName() + o = &OrgRequiredWorkflow{} + o.GetName() + o = nil + o.GetName() +} + +func TestOrgRequiredWorkflow_GetPath(tt *testing.T) { + var zeroValue string + o := &OrgRequiredWorkflow{Path: &zeroValue} + o.GetPath() + o = &OrgRequiredWorkflow{} + o.GetPath() + o = nil + o.GetPath() +} + +func TestOrgRequiredWorkflow_GetRef(tt *testing.T) { + var zeroValue string + o := &OrgRequiredWorkflow{Ref: &zeroValue} + o.GetRef() + o = &OrgRequiredWorkflow{} + o.GetRef() + o = nil + o.GetRef() +} + +func TestOrgRequiredWorkflow_GetRepository(tt *testing.T) { + o := &OrgRequiredWorkflow{} + o.GetRepository() + o = nil + o.GetRepository() +} + +func TestOrgRequiredWorkflow_GetScope(tt *testing.T) { + var zeroValue string + o := &OrgRequiredWorkflow{Scope: &zeroValue} + o.GetScope() + o = &OrgRequiredWorkflow{} + o.GetScope() + o = nil + o.GetScope() +} + +func TestOrgRequiredWorkflow_GetSelectedRepositoriesURL(tt *testing.T) { + var zeroValue string + o := &OrgRequiredWorkflow{SelectedRepositoriesURL: &zeroValue} + o.GetSelectedRepositoriesURL() + o = &OrgRequiredWorkflow{} + o.GetSelectedRepositoriesURL() + o = nil + o.GetSelectedRepositoriesURL() +} + +func TestOrgRequiredWorkflow_GetState(tt *testing.T) { + var zeroValue string + o := &OrgRequiredWorkflow{State: &zeroValue} + o.GetState() + o = &OrgRequiredWorkflow{} + o.GetState() + o = nil + o.GetState() +} + +func TestOrgRequiredWorkflow_GetUpdatedAt(tt *testing.T) { + var zeroValue Timestamp + o := &OrgRequiredWorkflow{UpdatedAt: &zeroValue} + o.GetUpdatedAt() + o = &OrgRequiredWorkflow{} + o.GetUpdatedAt() + o = nil + o.GetUpdatedAt() +} + +func TestOrgRequiredWorkflows_GetTotalCount(tt *testing.T) { + var zeroValue int + o := &OrgRequiredWorkflows{TotalCount: &zeroValue} + o.GetTotalCount() + o = &OrgRequiredWorkflows{} + o.GetTotalCount() + o = nil + o.GetTotalCount() +} + func TestOrgStats_GetDisabledOrgs(tt *testing.T) { var zeroValue int o := &OrgStats{DisabledOrgs: &zeroValue} @@ -18004,6 +18148,123 @@ func TestRepoName_GetFrom(tt *testing.T) { r.GetFrom() } +func TestRepoRequiredWorkflow_GetBadgeURL(tt *testing.T) { + var zeroValue string + r := &RepoRequiredWorkflow{BadgeURL: &zeroValue} + r.GetBadgeURL() + r = &RepoRequiredWorkflow{} + r.GetBadgeURL() + r = nil + r.GetBadgeURL() +} + +func TestRepoRequiredWorkflow_GetCreatedAt(tt *testing.T) { + var zeroValue Timestamp + r := &RepoRequiredWorkflow{CreatedAt: &zeroValue} + r.GetCreatedAt() + r = &RepoRequiredWorkflow{} + r.GetCreatedAt() + r = nil + r.GetCreatedAt() +} + +func TestRepoRequiredWorkflow_GetHTMLURL(tt *testing.T) { + var zeroValue string + r := &RepoRequiredWorkflow{HTMLURL: &zeroValue} + r.GetHTMLURL() + r = &RepoRequiredWorkflow{} + r.GetHTMLURL() + r = nil + r.GetHTMLURL() +} + +func TestRepoRequiredWorkflow_GetID(tt *testing.T) { + var zeroValue int64 + r := &RepoRequiredWorkflow{ID: &zeroValue} + r.GetID() + r = &RepoRequiredWorkflow{} + r.GetID() + r = nil + r.GetID() +} + +func TestRepoRequiredWorkflow_GetName(tt *testing.T) { + var zeroValue string + r := &RepoRequiredWorkflow{Name: &zeroValue} + r.GetName() + r = &RepoRequiredWorkflow{} + r.GetName() + r = nil + r.GetName() +} + +func TestRepoRequiredWorkflow_GetNodeID(tt *testing.T) { + var zeroValue string + r := &RepoRequiredWorkflow{NodeID: &zeroValue} + r.GetNodeID() + r = &RepoRequiredWorkflow{} + r.GetNodeID() + r = nil + r.GetNodeID() +} + +func TestRepoRequiredWorkflow_GetPath(tt *testing.T) { + var zeroValue string + r := &RepoRequiredWorkflow{Path: &zeroValue} + r.GetPath() + r = &RepoRequiredWorkflow{} + r.GetPath() + r = nil + r.GetPath() +} + +func TestRepoRequiredWorkflow_GetSourceRepository(tt *testing.T) { + r := &RepoRequiredWorkflow{} + r.GetSourceRepository() + r = nil + r.GetSourceRepository() +} + +func TestRepoRequiredWorkflow_GetState(tt *testing.T) { + var zeroValue string + r := &RepoRequiredWorkflow{State: &zeroValue} + r.GetState() + r = &RepoRequiredWorkflow{} + r.GetState() + r = nil + r.GetState() +} + +func TestRepoRequiredWorkflow_GetUpdatedAt(tt *testing.T) { + var zeroValue Timestamp + r := &RepoRequiredWorkflow{UpdatedAt: &zeroValue} + r.GetUpdatedAt() + r = &RepoRequiredWorkflow{} + r.GetUpdatedAt() + r = nil + r.GetUpdatedAt() +} + +func TestRepoRequiredWorkflow_GetURL(tt *testing.T) { + var zeroValue string + r := &RepoRequiredWorkflow{URL: &zeroValue} + r.GetURL() + r = &RepoRequiredWorkflow{} + r.GetURL() + r = nil + r.GetURL() +} + +func TestRepoRequiredWorkflows_GetTotalCount(tt *testing.T) { + var zeroValue int + r := &RepoRequiredWorkflows{TotalCount: &zeroValue} + r.GetTotalCount() + r = &RepoRequiredWorkflows{} + r.GetTotalCount() + r = nil + r.GetTotalCount() +} + func TestRepositoriesSearchResult_GetIncompleteResults(tt *testing.T) { var zeroValue bool r := &RepositoriesSearchResult{IncompleteResults: &zeroValue} @@ -20398,6 +20659,16 @@ func TestRequiredStatusChecksRequest_GetStrict(tt *testing.T) { r.GetStrict() } +func TestRequiredWorkflowSelectedRepos_GetTotalCount(tt *testing.T) { + var zeroValue int + r := &RequiredWorkflowSelectedRepos{TotalCount: &zeroValue} + r.GetTotalCount() + r = &RequiredWorkflowSelectedRepos{} + r.GetTotalCount() + r = nil + r.GetTotalCount() +} + func TestReviewersRequest_GetNodeID(tt *testing.T) { var zeroValue string r := &ReviewersRequest{NodeID: &zeroValue} From 5090d28a91592765a0471ce9c72821b7d97e03f5 Mon Sep 17 00:00:00 2001 From: Naoki Kanatani Date: Tue, 4 Apr 2023 22:49:18 +0900 Subject: [PATCH 204/751] Add options for listing workflow runs (#2735) --- github/actions_workflow_runs.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/github/actions_workflow_runs.go b/github/actions_workflow_runs.go index b37a9f317b1..704048774e6 100644 --- a/github/actions_workflow_runs.go +++ b/github/actions_workflow_runs.go @@ -55,12 +55,14 @@ type WorkflowRuns struct { // ListWorkflowRunsOptions specifies optional parameters to ListWorkflowRuns. type ListWorkflowRunsOptions struct { - Actor string `url:"actor,omitempty"` - Branch string `url:"branch,omitempty"` - Event string `url:"event,omitempty"` - Status string `url:"status,omitempty"` - Created string `url:"created,omitempty"` - HeadSHA string `url:"head_sha,omitempty"` + Actor string `url:"actor,omitempty"` + Branch string `url:"branch,omitempty"` + Event string `url:"event,omitempty"` + Status string `url:"status,omitempty"` + Created string `url:"created,omitempty"` + HeadSHA string `url:"head_sha,omitempty"` + ExcludePullRequests bool `url:"exclude_pull_requests,omitempty"` + CheckSuiteID int64 `url:"check_suite_id,omitempty"` ListOptions } From 7b27977c44bf3b59dcc714a25276923c6c71d387 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Wed, 5 Apr 2023 13:10:17 -0400 Subject: [PATCH 205/751] Change PrivateRepos from int to int64 (#2738) Fixes: #2736. --- github/github-accessors.go | 10 +++++----- github/github-accessors_test.go | 10 +++++----- github/github-stringify_test.go | 10 +++++----- github/orgs.go | 6 +++--- github/orgs_test.go | 2 +- github/users.go | 4 ++-- github/users_test.go | 6 +++--- 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index ca5cda6c283..92a952efb33 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -10879,7 +10879,7 @@ func (o *Organization) GetNodeID() string { } // GetOwnedPrivateRepos returns the OwnedPrivateRepos field if it's non-nil, zero value otherwise. -func (o *Organization) GetOwnedPrivateRepos() int { +func (o *Organization) GetOwnedPrivateRepos() int64 { if o == nil || o.OwnedPrivateRepos == nil { return 0 } @@ -10951,7 +10951,7 @@ func (o *Organization) GetSecretScanningPushProtectionEnabledForNewRepos() bool } // GetTotalPrivateRepos returns the TotalPrivateRepos field if it's non-nil, zero value otherwise. -func (o *Organization) GetTotalPrivateRepos() int { +func (o *Organization) GetTotalPrivateRepos() int64 { if o == nil || o.TotalPrivateRepos == nil { return 0 } @@ -12223,7 +12223,7 @@ func (p *Plan) GetName() string { } // GetPrivateRepos returns the PrivateRepos field if it's non-nil, zero value otherwise. -func (p *Plan) GetPrivateRepos() int { +func (p *Plan) GetPrivateRepos() int64 { if p == nil || p.PrivateRepos == nil { return 0 } @@ -20655,7 +20655,7 @@ func (u *User) GetOrganizationsURL() string { } // GetOwnedPrivateRepos returns the OwnedPrivateRepos field if it's non-nil, zero value otherwise. -func (u *User) GetOwnedPrivateRepos() int { +func (u *User) GetOwnedPrivateRepos() int64 { if u == nil || u.OwnedPrivateRepos == nil { return 0 } @@ -20759,7 +20759,7 @@ func (u *User) GetSuspendedAt() Timestamp { } // GetTotalPrivateRepos returns the TotalPrivateRepos field if it's non-nil, zero value otherwise. -func (u *User) GetTotalPrivateRepos() int { +func (u *User) GetTotalPrivateRepos() int64 { if u == nil || u.TotalPrivateRepos == nil { return 0 } diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index bcf8ee1f766..fae13c0ef97 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -12771,7 +12771,7 @@ func TestOrganization_GetNodeID(tt *testing.T) { } func TestOrganization_GetOwnedPrivateRepos(tt *testing.T) { - var zeroValue int + var zeroValue int64 o := &Organization{OwnedPrivateRepos: &zeroValue} o.GetOwnedPrivateRepos() o = &Organization{} @@ -12858,7 +12858,7 @@ func TestOrganization_GetSecretScanningPushProtectionEnabledForNewRepos(tt *test } func TestOrganization_GetTotalPrivateRepos(tt *testing.T) { - var zeroValue int + var zeroValue int64 o := &Organization{TotalPrivateRepos: &zeroValue} o.GetTotalPrivateRepos() o = &Organization{} @@ -14331,7 +14331,7 @@ func TestPlan_GetName(tt *testing.T) { } func TestPlan_GetPrivateRepos(tt *testing.T) { - var zeroValue int + var zeroValue int64 p := &Plan{PrivateRepos: &zeroValue} p.GetPrivateRepos() p = &Plan{} @@ -24112,7 +24112,7 @@ func TestUser_GetOrganizationsURL(tt *testing.T) { } func TestUser_GetOwnedPrivateRepos(tt *testing.T) { - var zeroValue int + var zeroValue int64 u := &User{OwnedPrivateRepos: &zeroValue} u.GetOwnedPrivateRepos() u = &User{} @@ -24239,7 +24239,7 @@ func TestUser_GetSuspendedAt(tt *testing.T) { } func TestUser_GetTotalPrivateRepos(tt *testing.T) { - var zeroValue int + var zeroValue int64 u := &User{TotalPrivateRepos: &zeroValue} u.GetTotalPrivateRepos() u = &User{} diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index 60052554970..8a78fb02429 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -998,8 +998,8 @@ func TestOrganization_String(t *testing.T) { Following: Int(0), CreatedAt: &Timestamp{}, UpdatedAt: &Timestamp{}, - TotalPrivateRepos: Int(0), - OwnedPrivateRepos: Int(0), + TotalPrivateRepos: Int64(0), + OwnedPrivateRepos: Int64(0), PrivateGists: Int(0), DiskUsage: Int(0), Collaborators: Int(0), @@ -1185,7 +1185,7 @@ func TestPlan_String(t *testing.T) { Name: String(""), Space: Int(0), Collaborators: Int(0), - PrivateRepos: Int(0), + PrivateRepos: Int64(0), FilledSeats: Int(0), Seats: Int(0), } @@ -1951,8 +1951,8 @@ func TestUser_String(t *testing.T) { SuspendedAt: &Timestamp{}, Type: String(""), SiteAdmin: Bool(false), - TotalPrivateRepos: Int(0), - OwnedPrivateRepos: Int(0), + TotalPrivateRepos: Int64(0), + OwnedPrivateRepos: Int64(0), PrivateGists: Int(0), DiskUsage: Int(0), Collaborators: Int(0), diff --git a/github/orgs.go b/github/orgs.go index 837dda89e0e..0c7e361b3fc 100644 --- a/github/orgs.go +++ b/github/orgs.go @@ -36,8 +36,8 @@ type Organization struct { Following *int `json:"following,omitempty"` CreatedAt *Timestamp `json:"created_at,omitempty"` UpdatedAt *Timestamp `json:"updated_at,omitempty"` - TotalPrivateRepos *int `json:"total_private_repos,omitempty"` - OwnedPrivateRepos *int `json:"owned_private_repos,omitempty"` + TotalPrivateRepos *int64 `json:"total_private_repos,omitempty"` + OwnedPrivateRepos *int64 `json:"owned_private_repos,omitempty"` PrivateGists *int `json:"private_gists,omitempty"` DiskUsage *int `json:"disk_usage,omitempty"` Collaborators *int `json:"collaborators,omitempty"` @@ -121,7 +121,7 @@ type Plan struct { Name *string `json:"name,omitempty"` Space *int `json:"space,omitempty"` Collaborators *int `json:"collaborators,omitempty"` - PrivateRepos *int `json:"private_repos,omitempty"` + PrivateRepos *int64 `json:"private_repos,omitempty"` FilledSeats *int `json:"filled_seats,omitempty"` Seats *int `json:"seats,omitempty"` } diff --git a/github/orgs_test.go b/github/orgs_test.go index 1205ad00046..ca85af25b71 100644 --- a/github/orgs_test.go +++ b/github/orgs_test.go @@ -452,7 +452,7 @@ func TestPlan_Marshal(t *testing.T) { Name: String("name"), Space: Int(1), Collaborators: Int(1), - PrivateRepos: Int(1), + PrivateRepos: Int64(1), FilledSeats: Int(1), Seats: Int(1), } diff --git a/github/users.go b/github/users.go index d40d23e90fe..1b0670103b3 100644 --- a/github/users.go +++ b/github/users.go @@ -41,8 +41,8 @@ type User struct { SuspendedAt *Timestamp `json:"suspended_at,omitempty"` Type *string `json:"type,omitempty"` SiteAdmin *bool `json:"site_admin,omitempty"` - TotalPrivateRepos *int `json:"total_private_repos,omitempty"` - OwnedPrivateRepos *int `json:"owned_private_repos,omitempty"` + TotalPrivateRepos *int64 `json:"total_private_repos,omitempty"` + OwnedPrivateRepos *int64 `json:"owned_private_repos,omitempty"` PrivateGists *int `json:"private_gists,omitempty"` DiskUsage *int `json:"disk_usage,omitempty"` Collaborators *int `json:"collaborators,omitempty"` diff --git a/github/users_test.go b/github/users_test.go index 96b2e926f18..f71df5cfd9e 100644 --- a/github/users_test.go +++ b/github/users_test.go @@ -84,8 +84,8 @@ func TestUser_Marshal(t *testing.T) { SuspendedAt: &Timestamp{referenceTime}, Type: String("test type"), SiteAdmin: Bool(false), - TotalPrivateRepos: Int(2), - OwnedPrivateRepos: Int(1), + TotalPrivateRepos: Int64(2), + OwnedPrivateRepos: Int64(1), PrivateGists: Int(1), DiskUsage: Int(1), Collaborators: Int(1), @@ -94,7 +94,7 @@ func TestUser_Marshal(t *testing.T) { Name: String("silver"), Space: Int(1024), Collaborators: Int(10), - PrivateRepos: Int(4), + PrivateRepos: Int64(4), FilledSeats: Int(24), Seats: Int(1), }, From 2317ed881692a63a67cf60961fe8ffe2f16217b0 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Wed, 5 Apr 2023 13:26:36 -0400 Subject: [PATCH 206/751] Bump version of go-github to v51.0.0 (#2739) --- README.md | 15 ++++++++------- example/actionpermissions/main.go | 2 +- example/appengine/app.go | 2 +- example/basicauth/main.go | 2 +- example/commitpr/main.go | 2 +- example/go.mod | 6 +++--- example/listenvironments/main.go | 2 +- example/migrations/main.go | 2 +- example/newfilewithappauth/main.go | 2 +- example/newrepo/main.go | 2 +- example/newreposecretwithlibsodium/go.mod | 4 ++-- example/newreposecretwithlibsodium/main.go | 2 +- example/newreposecretwithxcrypto/main.go | 2 +- example/ratelimit/main.go | 2 +- example/simple/main.go | 2 +- example/tagprotection/main.go | 2 +- example/tokenauth/main.go | 2 +- example/topics/main.go | 2 +- github/doc.go | 2 +- github/examples_test.go | 2 +- github/github.go | 2 +- go.mod | 2 +- test/fields/fields.go | 2 +- test/integration/activity_test.go | 2 +- test/integration/authorizations_test.go | 2 +- test/integration/github_test.go | 2 +- test/integration/repos_test.go | 2 +- test/integration/users_test.go | 2 +- update-urls/go.mod | 2 +- 29 files changed, 39 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index d73d1eae4ab..4b32469dc74 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-github # [![go-github release (latest SemVer)](https://img.shields.io/github/v/release/google/go-github?sort=semver)](https://github.com/google/go-github/releases) -[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v50/github) +[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v51/github) [![Test Status](https://github.com/google/go-github/workflows/tests/badge.svg)](https://github.com/google/go-github/actions?query=workflow%3Atests) [![Test Coverage](https://codecov.io/gh/google/go-github/branch/master/graph/badge.svg)](https://codecov.io/gh/google/go-github) [![Discuss at go-github@googlegroups.com](https://img.shields.io/badge/discuss-go--github%40googlegroups.com-blue.svg)](https://groups.google.com/group/go-github) @@ -24,7 +24,7 @@ If you're interested in using the [GraphQL API v4][], the recommended library is go-github is compatible with modern Go releases in module mode, with Go installed: ```bash -go get github.com/google/go-github/v50 +go get github.com/google/go-github/v51 ``` will resolve and add the package to the current development module, along with its dependencies. @@ -32,7 +32,7 @@ will resolve and add the package to the current development module, along with i Alternatively the same can be achieved if you use import in a package: ```go -import "github.com/google/go-github/v50/github" +import "github.com/google/go-github/v51/github" ``` and run `go get` without parameters. @@ -40,13 +40,13 @@ and run `go get` without parameters. Finally, to use the top-of-trunk version of this repo, use the following command: ```bash -go get github.com/google/go-github/v50@master +go get github.com/google/go-github/v51@master ``` ## Usage ## ```go -import "github.com/google/go-github/v50/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) +import "github.com/google/go-github/v51/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled ``` @@ -135,7 +135,7 @@ import ( "net/http" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v50/github" + "github.com/google/go-github/v51/github" ) func main() { @@ -323,7 +323,7 @@ For complete usage of go-github, see the full [package docs][]. [oauth2]: https://github.com/golang/oauth2 [oauth2 docs]: https://godoc.org/golang.org/x/oauth2 [personal API token]: https://github.com/blog/1509-personal-api-tokens -[package docs]: https://pkg.go.dev/github.com/google/go-github/v50/github +[package docs]: https://pkg.go.dev/github.com/google/go-github/v51/github [GraphQL API v4]: https://developer.github.com/v4/ [shurcooL/githubv4]: https://github.com/shurcooL/githubv4 [GitHub webhook events]: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads @@ -396,6 +396,7 @@ Versions prior to 48.2.0 are not listed. | go-github Version | GitHub v3 API Version | | ----------------- | --------------------- | +| 51.0.0 | 2022-11-28 | | 50.2.0 | 2022-11-28 | | 50.1.0 | 2022-11-28 | | 50.0.0 | 2022-11-28 | diff --git a/example/actionpermissions/main.go b/example/actionpermissions/main.go index 5227fd0205c..04abed7f166 100644 --- a/example/actionpermissions/main.go +++ b/example/actionpermissions/main.go @@ -14,7 +14,7 @@ import ( "log" "os" - "github.com/google/go-github/v50/github" + "github.com/google/go-github/v51/github" ) var ( diff --git a/example/appengine/app.go b/example/appengine/app.go index 21260af3f32..24873f7ac98 100644 --- a/example/appengine/app.go +++ b/example/appengine/app.go @@ -12,7 +12,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v50/github" + "github.com/google/go-github/v51/github" "google.golang.org/appengine" "google.golang.org/appengine/log" ) diff --git a/example/basicauth/main.go b/example/basicauth/main.go index 3624b272fe2..5336356b967 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -22,7 +22,7 @@ import ( "strings" "syscall" - "github.com/google/go-github/v50/github" + "github.com/google/go-github/v51/github" "golang.org/x/crypto/ssh/terminal" ) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index ad57d69a461..39d4e72a62f 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -30,7 +30,7 @@ import ( "strings" "time" - "github.com/google/go-github/v50/github" + "github.com/google/go-github/v51/github" ) var ( diff --git a/example/go.mod b/example/go.mod index a2f2ec9cd91..bb2b6d55313 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,11 +1,11 @@ -module github.com/google/go-github/v50/example +module github.com/google/go-github/v51/example go 1.17 require ( github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-ratelimit v1.0.1 - github.com/google/go-github/v50 v50.0.0 + github.com/google/go-github/v51 v51.0.0 golang.org/x/crypto v0.1.0 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be google.golang.org/appengine v1.6.7 @@ -22,4 +22,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v50 => ../ +replace github.com/google/go-github/v51 => ../ diff --git a/example/listenvironments/main.go b/example/listenvironments/main.go index 655341e0ce3..9fcbc08b1b3 100644 --- a/example/listenvironments/main.go +++ b/example/listenvironments/main.go @@ -18,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v50/github" + "github.com/google/go-github/v51/github" ) func main() { diff --git a/example/migrations/main.go b/example/migrations/main.go index daa90d3c085..5ca3e1cbe3d 100644 --- a/example/migrations/main.go +++ b/example/migrations/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v50/github" + "github.com/google/go-github/v51/github" ) func fetchAllUserMigrations() ([]*github.UserMigration, error) { diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index f67bbe9a96a..cf1236867ce 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -16,7 +16,7 @@ import ( "time" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v50/github" + "github.com/google/go-github/v51/github" "golang.org/x/oauth2" ) diff --git a/example/newrepo/main.go b/example/newrepo/main.go index 65a35739245..b055b0f60b4 100644 --- a/example/newrepo/main.go +++ b/example/newrepo/main.go @@ -16,7 +16,7 @@ import ( "log" "os" - "github.com/google/go-github/v50/github" + "github.com/google/go-github/v51/github" ) var ( diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index 8f2bcfcdbca..2ef642b6886 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -4,9 +4,9 @@ go 1.15 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb - github.com/google/go-github/v50 v50.0.0 + github.com/google/go-github/v51 v51.0.0 golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v50 => ../.. +replace github.com/google/go-github/v51 => ../.. diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index 8d3b17aafd1..68acc3df1de 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -36,7 +36,7 @@ import ( "os" sodium "github.com/GoKillers/libsodium-go/cryptobox" - "github.com/google/go-github/v50/github" + "github.com/google/go-github/v51/github" ) var ( diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index a0b850b9359..f94993c01c3 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -36,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v50/github" + "github.com/google/go-github/v51/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/ratelimit/main.go b/example/ratelimit/main.go index 228099faa9f..7f5fc792e70 100644 --- a/example/ratelimit/main.go +++ b/example/ratelimit/main.go @@ -13,7 +13,7 @@ import ( "fmt" "github.com/gofri/go-github-ratelimit/github_ratelimit" - "github.com/google/go-github/v50/github" + "github.com/google/go-github/v51/github" ) func main() { diff --git a/example/simple/main.go b/example/simple/main.go index 19405859507..20ac83dba0c 100644 --- a/example/simple/main.go +++ b/example/simple/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v50/github" + "github.com/google/go-github/v51/github" ) // Fetch all the public organizations' membership of a user. diff --git a/example/tagprotection/main.go b/example/tagprotection/main.go index 41b605e28f1..2a050188877 100644 --- a/example/tagprotection/main.go +++ b/example/tagprotection/main.go @@ -19,7 +19,7 @@ import ( "strings" "syscall" - "github.com/google/go-github/v50/github" + "github.com/google/go-github/v51/github" "golang.org/x/crypto/ssh/terminal" ) diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index 1cff2c7879a..9c58089bd0d 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -14,7 +14,7 @@ import ( "log" "syscall" - "github.com/google/go-github/v50/github" + "github.com/google/go-github/v51/github" "golang.org/x/crypto/ssh/terminal" ) diff --git a/example/topics/main.go b/example/topics/main.go index d8237da53e4..038cc2eb212 100644 --- a/example/topics/main.go +++ b/example/topics/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v50/github" + "github.com/google/go-github/v51/github" ) // Fetch and lists all the public topics associated with the specified GitHub topic diff --git a/github/doc.go b/github/doc.go index 9adfea8fe97..4c76f0e0ff6 100644 --- a/github/doc.go +++ b/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v50/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v51/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to diff --git a/github/examples_test.go b/github/examples_test.go index 40a96b94f4f..ae732ded16e 100644 --- a/github/examples_test.go +++ b/github/examples_test.go @@ -12,7 +12,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v50/github" + "github.com/google/go-github/v51/github" ) func ExampleClient_Markdown() { diff --git a/github/github.go b/github/github.go index 4c4827e53cb..324e155e22a 100644 --- a/github/github.go +++ b/github/github.go @@ -28,7 +28,7 @@ import ( ) const ( - Version = "v50.2.0" + Version = "v51.0.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" diff --git a/go.mod b/go.mod index 032ba17da7d..c4d156bc03f 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v50 +module github.com/google/go-github/v51 require ( github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 diff --git a/test/fields/fields.go b/test/fields/fields.go index dd21cc8ccc8..634e372901b 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -25,7 +25,7 @@ import ( "reflect" "strings" - "github.com/google/go-github/v50/github" + "github.com/google/go-github/v51/github" ) var ( diff --git a/test/integration/activity_test.go b/test/integration/activity_test.go index 669d775d319..1d92e06b41b 100644 --- a/test/integration/activity_test.go +++ b/test/integration/activity_test.go @@ -12,7 +12,7 @@ import ( "context" "testing" - "github.com/google/go-github/v50/github" + "github.com/google/go-github/v51/github" ) const ( diff --git a/test/integration/authorizations_test.go b/test/integration/authorizations_test.go index d94a7506671..f7f67cc8038 100644 --- a/test/integration/authorizations_test.go +++ b/test/integration/authorizations_test.go @@ -17,7 +17,7 @@ import ( "testing" "time" - "github.com/google/go-github/v50/github" + "github.com/google/go-github/v51/github" ) const msgEnvMissing = "Skipping test because the required environment variable (%v) is not present." diff --git a/test/integration/github_test.go b/test/integration/github_test.go index 892a7178c49..6a68c885f25 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -15,7 +15,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v50/github" + "github.com/google/go-github/v51/github" ) var ( diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index 124e00551a9..0c27c8e6d63 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -15,7 +15,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v50/github" + "github.com/google/go-github/v51/github" ) func TestRepositories_CRUD(t *testing.T) { diff --git a/test/integration/users_test.go b/test/integration/users_test.go index d8448965808..10a536eac12 100644 --- a/test/integration/users_test.go +++ b/test/integration/users_test.go @@ -14,7 +14,7 @@ import ( "math/rand" "testing" - "github.com/google/go-github/v50/github" + "github.com/google/go-github/v51/github" ) func TestUsers_Get(t *testing.T) { diff --git a/update-urls/go.mod b/update-urls/go.mod index d7419e28129..226193f0e3e 100644 --- a/update-urls/go.mod +++ b/update-urls/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v50/update-urls +module github.com/google/go-github/v51/update-urls go 1.16 From c96ba417f7b022bee92bc04d831e89fd9fc70edc Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Wed, 5 Apr 2023 13:44:02 -0400 Subject: [PATCH 207/751] Bump go-github from 50.2.0 to 51.0.0 in /scrape (#2740) --- scrape/apps.go | 2 +- scrape/apps_test.go | 2 +- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scrape/apps.go b/scrape/apps.go index 48480a3d807..59a58c1a6e5 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -17,7 +17,7 @@ import ( "strings" "github.com/PuerkitoBio/goquery" - "github.com/google/go-github/v50/github" + "github.com/google/go-github/v51/github" ) // AppRestrictionsEnabled returns whether the specified organization has diff --git a/scrape/apps_test.go b/scrape/apps_test.go index 779ffdbbd33..913588b57cf 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v50/github" + "github.com/google/go-github/v51/github" ) func Test_AppRestrictionsEnabled(t *testing.T) { diff --git a/scrape/go.mod b/scrape/go.mod index d65e3da336f..5c7b9dae811 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -5,7 +5,7 @@ go 1.13 require ( github.com/PuerkitoBio/goquery v1.8.1 github.com/google/go-cmp v0.5.9 - github.com/google/go-github/v50 v50.2.0 + github.com/google/go-github/v51 v51.0.0 github.com/xlzd/gotp v0.1.0 golang.org/x/net v0.8.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index 83f86faca1f..cf80c6f48a5 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -17,8 +17,8 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v50 v50.2.0 h1:j2FyongEHlO9nxXLc+LP3wuBSVU9mVxfpdYUexMpIfk= -github.com/google/go-github/v50 v50.2.0/go.mod h1:VBY8FB6yPIjrtKhozXv4FQupxKLS6H4m6xFZlT43q8Q= +github.com/google/go-github/v51 v51.0.0 h1:KCjsbgPV28VoRftdP+K2mQL16jniUsLAJknsOVKwHyU= +github.com/google/go-github/v51 v51.0.0/go.mod h1:kZj/rn/c1lSUbr/PFWl2hhusPV7a5XNYKcwPrd5L3Us= 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.1.0 h1:37blvlKCh38s+fkem+fFh7sMnceltoIEBYTVXyoa5Po= From 4fec23d72f617c085ce35204eb9bd484bf4a2b93 Mon Sep 17 00:00:00 2001 From: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Date: Fri, 7 Apr 2023 18:24:53 -0600 Subject: [PATCH 208/751] Add Topics to PushEventRepository (#2742) Fixes: #2741. --- github/event_types.go | 1 + github/event_types_test.go | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/github/event_types.go b/github/event_types.go index 598d98d48c3..71dfd2d0a02 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -1062,6 +1062,7 @@ type PushEventRepository struct { SSHURL *string `json:"ssh_url,omitempty"` CloneURL *string `json:"clone_url,omitempty"` SVNURL *string `json:"svn_url,omitempty"` + Topics []string `json:"topics,omitempty"` } // PushEventRepoOwner is a basic representation of user/org in a PushEvent payload. diff --git a/github/event_types_test.go b/github/event_types_test.go index 7c84146f460..a2628b85378 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -12271,6 +12271,7 @@ func TestPushEventRepository_Marshal(t *testing.T) { SSHURL: String("s"), CloneURL: String("c"), SVNURL: String("s"), + Topics: []string{"octocat", "api"}, } want := `{ @@ -12325,8 +12326,9 @@ func TestPushEventRepository_Marshal(t *testing.T) { "git_url": "g", "ssh_url": "s", "clone_url": "c", - "svn_url": "s" - }` + "svn_url": "s", + "topics": ["octocat","api"] + }` testJSONMarshal(t, u, want) } From 4caa1d6d12a652a6656bb72c1985393bfe6203d9 Mon Sep 17 00:00:00 2001 From: Yarden Shoham Date: Sun, 9 Apr 2023 22:36:03 +0300 Subject: [PATCH 209/751] Add fields to Branch Protection endpoint (#2744) Fixes: #2719. --- github/github-accessors.go | 32 ++++++++++++++++++++++++++++ github/github-accessors_test.go | 37 +++++++++++++++++++++++++++++++++ github/repos.go | 6 +++++- 3 files changed, 74 insertions(+), 1 deletion(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 92a952efb33..ae6e2867259 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -13046,6 +13046,14 @@ func (p *Protection) GetRequiredPullRequestReviews() *PullRequestReviewsEnforcem return p.RequiredPullRequestReviews } +// GetRequiredSignatures returns the RequiredSignatures field. +func (p *Protection) GetRequiredSignatures() *SignaturesProtectedBranch { + if p == nil { + return nil + } + return p.RequiredSignatures +} + // GetRequiredStatusChecks returns the RequiredStatusChecks field. func (p *Protection) GetRequiredStatusChecks() *RequiredStatusChecks { if p == nil { @@ -13070,6 +13078,14 @@ func (p *Protection) GetRestrictions() *BranchRestrictions { return p.Restrictions } +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (p *Protection) GetURL() string { + if p == nil || p.URL == nil { + return "" + } + return *p.URL +} + // GetAdminEnforced returns the AdminEnforced field. func (p *ProtectionChanges) GetAdminEnforced() *AdminEnforcedChanges { if p == nil { @@ -17718,6 +17734,22 @@ func (r *RequiredStatusCheck) GetAppID() int64 { return *r.AppID } +// GetContextsURL returns the ContextsURL field if it's non-nil, zero value otherwise. +func (r *RequiredStatusChecks) GetContextsURL() string { + if r == nil || r.ContextsURL == nil { + return "" + } + return *r.ContextsURL +} + +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (r *RequiredStatusChecks) GetURL() string { + if r == nil || r.URL == nil { + return "" + } + return *r.URL +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (r *RequiredStatusChecksEnforcementLevelChanges) GetFrom() string { if r == nil || r.From == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index fae13c0ef97..487104fb0d1 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -15237,6 +15237,13 @@ func TestProtection_GetRequiredPullRequestReviews(tt *testing.T) { p.GetRequiredPullRequestReviews() } +func TestProtection_GetRequiredSignatures(tt *testing.T) { + p := &Protection{} + p.GetRequiredSignatures() + p = nil + p.GetRequiredSignatures() +} + func TestProtection_GetRequiredStatusChecks(tt *testing.T) { p := &Protection{} p.GetRequiredStatusChecks() @@ -15258,6 +15265,16 @@ func TestProtection_GetRestrictions(tt *testing.T) { p.GetRestrictions() } +func TestProtection_GetURL(tt *testing.T) { + var zeroValue string + p := &Protection{URL: &zeroValue} + p.GetURL() + p = &Protection{} + p.GetURL() + p = nil + p.GetURL() +} + func TestProtectionChanges_GetAdminEnforced(tt *testing.T) { p := &ProtectionChanges{} p.GetAdminEnforced() @@ -20639,6 +20656,26 @@ func TestRequiredStatusCheck_GetAppID(tt *testing.T) { r.GetAppID() } +func TestRequiredStatusChecks_GetContextsURL(tt *testing.T) { + var zeroValue string + r := &RequiredStatusChecks{ContextsURL: &zeroValue} + r.GetContextsURL() + r = &RequiredStatusChecks{} + r.GetContextsURL() + r = nil + r.GetContextsURL() +} + +func TestRequiredStatusChecks_GetURL(tt *testing.T) { + var zeroValue string + r := &RequiredStatusChecks{URL: &zeroValue} + r.GetURL() + r = &RequiredStatusChecks{} + r.GetURL() + r = nil + r.GetURL() +} + func TestRequiredStatusChecksEnforcementLevelChanges_GetFrom(tt *testing.T) { var zeroValue string r := &RequiredStatusChecksEnforcementLevelChanges{From: &zeroValue} diff --git a/github/repos.go b/github/repos.go index fad152e22f2..9c9c7506309 100644 --- a/github/repos.go +++ b/github/repos.go @@ -847,6 +847,8 @@ type Protection struct { BlockCreations *BlockCreations `json:"block_creations,omitempty"` LockBranch *LockBranch `json:"lock_branch,omitempty"` AllowForkSyncing *AllowForkSyncing `json:"allow_fork_syncing,omitempty"` + RequiredSignatures *SignaturesProtectedBranch `json:"required_signatures,omitempty"` + URL *string `json:"url,omitempty"` } // BlockCreations represents whether users can push changes that create branches. If this is true, this @@ -1023,7 +1025,9 @@ type RequiredStatusChecks struct { Contexts []string `json:"contexts,omitempty"` // The list of status checks to require in order to merge into this // branch. - Checks []*RequiredStatusCheck `json:"checks"` + Checks []*RequiredStatusCheck `json:"checks"` + ContextsURL *string `json:"contexts_url,omitempty"` + URL *string `json:"url,omitempty"` } // RequiredStatusChecksRequest represents a request to edit a protected branch's status checks. From 521fd0d1f06050e4fe370eb5eaa02a10d9e50baa Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 9 Apr 2023 21:46:19 +0200 Subject: [PATCH 210/751] Add GetTime method to Timestamp (#2743) --- github/timestamp.go | 8 ++++++++ github/timestamp_test.go | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/github/timestamp.go b/github/timestamp.go index 1061a55e68e..00c1235e9d3 100644 --- a/github/timestamp.go +++ b/github/timestamp.go @@ -22,6 +22,14 @@ func (t Timestamp) String() string { return t.Time.String() } +// GetTime returns std time.Time. +func (t *Timestamp) GetTime() *time.Time { + if t == nil { + return nil + } + return &t.Time +} + // UnmarshalJSON implements the json.Unmarshaler interface. // Time is expected in RFC3339 or Unix format. func (t *Timestamp) UnmarshalJSON(data []byte) (err error) { diff --git a/github/timestamp_test.go b/github/timestamp_test.go index 097249519d4..69245b60d73 100644 --- a/github/timestamp_test.go +++ b/github/timestamp_test.go @@ -169,6 +169,17 @@ func TestWrappedTimestamp_Unmarshal(t *testing.T) { } } +func TestTimestamp_GetTime(t *testing.T) { + var t1 *Timestamp + if t1.GetTime() != nil { + t.Errorf("nil timestamp should return nil, got: %v", t1.GetTime()) + } + t1 = &Timestamp{referenceTime} + if !t1.GetTime().Equal(referenceTime) { + t.Errorf("want reference time, got: %s", t1.GetTime().String()) + } +} + func TestWrappedTimestamp_MarshalReflexivity(t *testing.T) { testCases := []struct { desc string From 22baf73d0fd68908e351594b1a09eb6437fa0b9a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Apr 2023 16:52:28 -0400 Subject: [PATCH 211/751] Bump golang.org/x/net from 0.8.0 to 0.9.0 in /scrape (#2748) --- scrape/go.mod | 2 +- scrape/go.sum | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 5c7b9dae811..296956c9d17 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -7,5 +7,5 @@ require ( github.com/google/go-cmp v0.5.9 github.com/google/go-github/v51 v51.0.0 github.com/xlzd/gotp v0.1.0 - golang.org/x/net v0.8.0 + golang.org/x/net v0.9.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index cf80c6f48a5..e32b45f6a95 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -37,8 +37,9 @@ golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= +golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/oauth2 v0.6.0 h1:Lh8GPgSKBfWSwFvtuWOfeI3aAAnbXTSutYxJiOJFgIw= golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -52,12 +53,14 @@ golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= +golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -65,6 +68,7 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= From 4806e1db75a11944b74c87be74e4bfacc71c21f0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Apr 2023 17:12:28 -0400 Subject: [PATCH 212/751] Bump golang.org/x/oauth2 from 0.6.0 to 0.7.0 (#2747) --- go.mod | 6 +++--- go.sum | 36 ++++++++++++++++++++++++++++++++---- 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index c4d156bc03f..16e5bea0185 100644 --- a/go.mod +++ b/go.mod @@ -4,15 +4,15 @@ require ( github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 github.com/google/go-cmp v0.5.9 github.com/google/go-querystring v1.1.0 - golang.org/x/oauth2 v0.6.0 + golang.org/x/oauth2 v0.7.0 ) require ( github.com/cloudflare/circl v1.1.0 // indirect github.com/golang/protobuf v1.5.2 // indirect golang.org/x/crypto v0.7.0 // indirect - golang.org/x/net v0.8.0 // indirect - golang.org/x/sys v0.6.0 // indirect + golang.org/x/net v0.9.0 // indirect + golang.org/x/sys v0.7.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.28.0 // indirect ) diff --git a/go.sum b/go.sum index 098145c5d9a..f5dd2eff36d 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,4 @@ +cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= @@ -9,31 +10,58 @@ github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= 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/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/oauth2 v0.6.0 h1:Lh8GPgSKBfWSwFvtuWOfeI3aAAnbXTSutYxJiOJFgIw= -golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= +golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= +golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= +golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= +golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= +golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= From 683c2d7d7d40e2018285d356d0a45abaa5a9c286 Mon Sep 17 00:00:00 2001 From: oslowalk Date: Wed, 12 Apr 2023 14:56:58 +0200 Subject: [PATCH 213/751] Add DNS health checks support for GitHub Pages (#2746) Fixes: #2745. --- github/github-accessors.go | 240 ++++++++++++++++++++++++++ github/github-accessors_test.go | 294 ++++++++++++++++++++++++++++++++ github/repos_pages.go | 57 +++++++ github/repos_pages_test.go | 132 ++++++++++++++ 4 files changed, 723 insertions(+) diff --git a/github/github-accessors.go b/github/github-accessors.go index ae6e2867259..1473c56f5ca 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -12046,6 +12046,230 @@ func (p *PagesBuild) GetURL() string { return *p.URL } +// GetCAAError returns the CAAError field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetCAAError() string { + if p == nil || p.CAAError == nil { + return "" + } + return *p.CAAError +} + +// GetDNSResolves returns the DNSResolves field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetDNSResolves() bool { + if p == nil || p.DNSResolves == nil { + return false + } + return *p.DNSResolves +} + +// GetEnforcesHTTPS returns the EnforcesHTTPS field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetEnforcesHTTPS() bool { + if p == nil || p.EnforcesHTTPS == nil { + return false + } + return *p.EnforcesHTTPS +} + +// GetHasCNAMERecord returns the HasCNAMERecord field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetHasCNAMERecord() bool { + if p == nil || p.HasCNAMERecord == nil { + return false + } + return *p.HasCNAMERecord +} + +// GetHasMXRecordsPresent returns the HasMXRecordsPresent field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetHasMXRecordsPresent() bool { + if p == nil || p.HasMXRecordsPresent == nil { + return false + } + return *p.HasMXRecordsPresent +} + +// GetHost returns the Host field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetHost() string { + if p == nil || p.Host == nil { + return "" + } + return *p.Host +} + +// GetHTTPSError returns the HTTPSError field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetHTTPSError() string { + if p == nil || p.HTTPSError == nil { + return "" + } + return *p.HTTPSError +} + +// GetIsApexDomain returns the IsApexDomain field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetIsApexDomain() bool { + if p == nil || p.IsApexDomain == nil { + return false + } + return *p.IsApexDomain +} + +// GetIsARecord returns the IsARecord field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetIsARecord() bool { + if p == nil || p.IsARecord == nil { + return false + } + return *p.IsARecord +} + +// GetIsCloudflareIP returns the IsCloudflareIP field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetIsCloudflareIP() bool { + if p == nil || p.IsCloudflareIP == nil { + return false + } + return *p.IsCloudflareIP +} + +// GetIsCNAMEToFastly returns the IsCNAMEToFastly field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetIsCNAMEToFastly() bool { + if p == nil || p.IsCNAMEToFastly == nil { + return false + } + return *p.IsCNAMEToFastly +} + +// GetIsCNAMEToGithubUserDomain returns the IsCNAMEToGithubUserDomain field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetIsCNAMEToGithubUserDomain() bool { + if p == nil || p.IsCNAMEToGithubUserDomain == nil { + return false + } + return *p.IsCNAMEToGithubUserDomain +} + +// GetIsCNAMEToPagesDotGithubDotCom returns the IsCNAMEToPagesDotGithubDotCom field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetIsCNAMEToPagesDotGithubDotCom() bool { + if p == nil || p.IsCNAMEToPagesDotGithubDotCom == nil { + return false + } + return *p.IsCNAMEToPagesDotGithubDotCom +} + +// GetIsFastlyIP returns the IsFastlyIP field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetIsFastlyIP() bool { + if p == nil || p.IsFastlyIP == nil { + return false + } + return *p.IsFastlyIP +} + +// GetIsHTTPSEligible returns the IsHTTPSEligible field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetIsHTTPSEligible() bool { + if p == nil || p.IsHTTPSEligible == nil { + return false + } + return *p.IsHTTPSEligible +} + +// GetIsNonGithubPagesIPPresent returns the IsNonGithubPagesIPPresent field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetIsNonGithubPagesIPPresent() bool { + if p == nil || p.IsNonGithubPagesIPPresent == nil { + return false + } + return *p.IsNonGithubPagesIPPresent +} + +// GetIsOldIPAddress returns the IsOldIPAddress field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetIsOldIPAddress() bool { + if p == nil || p.IsOldIPAddress == nil { + return false + } + return *p.IsOldIPAddress +} + +// GetIsPagesDomain returns the IsPagesDomain field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetIsPagesDomain() bool { + if p == nil || p.IsPagesDomain == nil { + return false + } + return *p.IsPagesDomain +} + +// GetIsPointedToGithubPagesIP returns the IsPointedToGithubPagesIP field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetIsPointedToGithubPagesIP() bool { + if p == nil || p.IsPointedToGithubPagesIP == nil { + return false + } + return *p.IsPointedToGithubPagesIP +} + +// GetIsProxied returns the IsProxied field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetIsProxied() bool { + if p == nil || p.IsProxied == nil { + return false + } + return *p.IsProxied +} + +// GetIsServedByPages returns the IsServedByPages field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetIsServedByPages() bool { + if p == nil || p.IsServedByPages == nil { + return false + } + return *p.IsServedByPages +} + +// GetIsValid returns the IsValid field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetIsValid() bool { + if p == nil || p.IsValid == nil { + return false + } + return *p.IsValid +} + +// GetIsValidDomain returns the IsValidDomain field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetIsValidDomain() bool { + if p == nil || p.IsValidDomain == nil { + return false + } + return *p.IsValidDomain +} + +// GetNameservers returns the Nameservers field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetNameservers() string { + if p == nil || p.Nameservers == nil { + return "" + } + return *p.Nameservers +} + +// GetReason returns the Reason field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetReason() string { + if p == nil || p.Reason == nil { + return "" + } + return *p.Reason +} + +// GetRespondsToHTTPS returns the RespondsToHTTPS field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetRespondsToHTTPS() bool { + if p == nil || p.RespondsToHTTPS == nil { + return false + } + return *p.RespondsToHTTPS +} + +// GetShouldBeARecord returns the ShouldBeARecord field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetShouldBeARecord() bool { + if p == nil || p.ShouldBeARecord == nil { + return false + } + return *p.ShouldBeARecord +} + +// GetURI returns the URI field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetURI() string { + if p == nil || p.URI == nil { + return "" + } + return *p.URI +} + // GetMessage returns the Message field if it's non-nil, zero value otherwise. func (p *PagesError) GetMessage() string { if p == nil || p.Message == nil { @@ -12054,6 +12278,22 @@ func (p *PagesError) GetMessage() string { return *p.Message } +// GetAltDomain returns the AltDomain field. +func (p *PagesHealthCheckResponse) GetAltDomain() *PagesDomain { + if p == nil { + return nil + } + return p.AltDomain +} + +// GetDomain returns the Domain field. +func (p *PagesHealthCheckResponse) GetDomain() *PagesDomain { + if p == nil { + return nil + } + return p.Domain +} + // GetDescription returns the Description field if it's non-nil, zero value otherwise. func (p *PagesHTTPSCertificate) GetDescription() string { if p == nil || p.Description == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 487104fb0d1..52a0e5b9020 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -14128,6 +14128,286 @@ func TestPagesBuild_GetURL(tt *testing.T) { p.GetURL() } +func TestPagesDomain_GetCAAError(tt *testing.T) { + var zeroValue string + p := &PagesDomain{CAAError: &zeroValue} + p.GetCAAError() + p = &PagesDomain{} + p.GetCAAError() + p = nil + p.GetCAAError() +} + +func TestPagesDomain_GetDNSResolves(tt *testing.T) { + var zeroValue bool + p := &PagesDomain{DNSResolves: &zeroValue} + p.GetDNSResolves() + p = &PagesDomain{} + p.GetDNSResolves() + p = nil + p.GetDNSResolves() +} + +func TestPagesDomain_GetEnforcesHTTPS(tt *testing.T) { + var zeroValue bool + p := &PagesDomain{EnforcesHTTPS: &zeroValue} + p.GetEnforcesHTTPS() + p = &PagesDomain{} + p.GetEnforcesHTTPS() + p = nil + p.GetEnforcesHTTPS() +} + +func TestPagesDomain_GetHasCNAMERecord(tt *testing.T) { + var zeroValue bool + p := &PagesDomain{HasCNAMERecord: &zeroValue} + p.GetHasCNAMERecord() + p = &PagesDomain{} + p.GetHasCNAMERecord() + p = nil + p.GetHasCNAMERecord() +} + +func TestPagesDomain_GetHasMXRecordsPresent(tt *testing.T) { + var zeroValue bool + p := &PagesDomain{HasMXRecordsPresent: &zeroValue} + p.GetHasMXRecordsPresent() + p = &PagesDomain{} + p.GetHasMXRecordsPresent() + p = nil + p.GetHasMXRecordsPresent() +} + +func TestPagesDomain_GetHost(tt *testing.T) { + var zeroValue string + p := &PagesDomain{Host: &zeroValue} + p.GetHost() + p = &PagesDomain{} + p.GetHost() + p = nil + p.GetHost() +} + +func TestPagesDomain_GetHTTPSError(tt *testing.T) { + var zeroValue string + p := &PagesDomain{HTTPSError: &zeroValue} + p.GetHTTPSError() + p = &PagesDomain{} + p.GetHTTPSError() + p = nil + p.GetHTTPSError() +} + +func TestPagesDomain_GetIsApexDomain(tt *testing.T) { + var zeroValue bool + p := &PagesDomain{IsApexDomain: &zeroValue} + p.GetIsApexDomain() + p = &PagesDomain{} + p.GetIsApexDomain() + p = nil + p.GetIsApexDomain() +} + +func TestPagesDomain_GetIsARecord(tt *testing.T) { + var zeroValue bool + p := &PagesDomain{IsARecord: &zeroValue} + p.GetIsARecord() + p = &PagesDomain{} + p.GetIsARecord() + p = nil + p.GetIsARecord() +} + +func TestPagesDomain_GetIsCloudflareIP(tt *testing.T) { + var zeroValue bool + p := &PagesDomain{IsCloudflareIP: &zeroValue} + p.GetIsCloudflareIP() + p = &PagesDomain{} + p.GetIsCloudflareIP() + p = nil + p.GetIsCloudflareIP() +} + +func TestPagesDomain_GetIsCNAMEToFastly(tt *testing.T) { + var zeroValue bool + p := &PagesDomain{IsCNAMEToFastly: &zeroValue} + p.GetIsCNAMEToFastly() + p = &PagesDomain{} + p.GetIsCNAMEToFastly() + p = nil + p.GetIsCNAMEToFastly() +} + +func TestPagesDomain_GetIsCNAMEToGithubUserDomain(tt *testing.T) { + var zeroValue bool + p := &PagesDomain{IsCNAMEToGithubUserDomain: &zeroValue} + p.GetIsCNAMEToGithubUserDomain() + p = &PagesDomain{} + p.GetIsCNAMEToGithubUserDomain() + p = nil + p.GetIsCNAMEToGithubUserDomain() +} + +func TestPagesDomain_GetIsCNAMEToPagesDotGithubDotCom(tt *testing.T) { + var zeroValue bool + p := &PagesDomain{IsCNAMEToPagesDotGithubDotCom: &zeroValue} + p.GetIsCNAMEToPagesDotGithubDotCom() + p = &PagesDomain{} + p.GetIsCNAMEToPagesDotGithubDotCom() + p = nil + p.GetIsCNAMEToPagesDotGithubDotCom() +} + +func TestPagesDomain_GetIsFastlyIP(tt *testing.T) { + var zeroValue bool + p := &PagesDomain{IsFastlyIP: &zeroValue} + p.GetIsFastlyIP() + p = &PagesDomain{} + p.GetIsFastlyIP() + p = nil + p.GetIsFastlyIP() +} + +func TestPagesDomain_GetIsHTTPSEligible(tt *testing.T) { + var zeroValue bool + p := &PagesDomain{IsHTTPSEligible: &zeroValue} + p.GetIsHTTPSEligible() + p = &PagesDomain{} + p.GetIsHTTPSEligible() + p = nil + p.GetIsHTTPSEligible() +} + +func TestPagesDomain_GetIsNonGithubPagesIPPresent(tt *testing.T) { + var zeroValue bool + p := &PagesDomain{IsNonGithubPagesIPPresent: &zeroValue} + p.GetIsNonGithubPagesIPPresent() + p = &PagesDomain{} + p.GetIsNonGithubPagesIPPresent() + p = nil + p.GetIsNonGithubPagesIPPresent() +} + +func TestPagesDomain_GetIsOldIPAddress(tt *testing.T) { + var zeroValue bool + p := &PagesDomain{IsOldIPAddress: &zeroValue} + p.GetIsOldIPAddress() + p = &PagesDomain{} + p.GetIsOldIPAddress() + p = nil + p.GetIsOldIPAddress() +} + +func TestPagesDomain_GetIsPagesDomain(tt *testing.T) { + var zeroValue bool + p := &PagesDomain{IsPagesDomain: &zeroValue} + p.GetIsPagesDomain() + p = &PagesDomain{} + p.GetIsPagesDomain() + p = nil + p.GetIsPagesDomain() +} + +func TestPagesDomain_GetIsPointedToGithubPagesIP(tt *testing.T) { + var zeroValue bool + p := &PagesDomain{IsPointedToGithubPagesIP: &zeroValue} + p.GetIsPointedToGithubPagesIP() + p = &PagesDomain{} + p.GetIsPointedToGithubPagesIP() + p = nil + p.GetIsPointedToGithubPagesIP() +} + +func TestPagesDomain_GetIsProxied(tt *testing.T) { + var zeroValue bool + p := &PagesDomain{IsProxied: &zeroValue} + p.GetIsProxied() + p = &PagesDomain{} + p.GetIsProxied() + p = nil + p.GetIsProxied() +} + +func TestPagesDomain_GetIsServedByPages(tt *testing.T) { + var zeroValue bool + p := &PagesDomain{IsServedByPages: &zeroValue} + p.GetIsServedByPages() + p = &PagesDomain{} + p.GetIsServedByPages() + p = nil + p.GetIsServedByPages() +} + +func TestPagesDomain_GetIsValid(tt *testing.T) { + var zeroValue bool + p := &PagesDomain{IsValid: &zeroValue} + p.GetIsValid() + p = &PagesDomain{} + p.GetIsValid() + p = nil + p.GetIsValid() +} + +func TestPagesDomain_GetIsValidDomain(tt *testing.T) { + var zeroValue bool + p := &PagesDomain{IsValidDomain: &zeroValue} + p.GetIsValidDomain() + p = &PagesDomain{} + p.GetIsValidDomain() + p = nil + p.GetIsValidDomain() +} + +func TestPagesDomain_GetNameservers(tt *testing.T) { + var zeroValue string + p := &PagesDomain{Nameservers: &zeroValue} + p.GetNameservers() + p = &PagesDomain{} + p.GetNameservers() + p = nil + p.GetNameservers() +} + +func TestPagesDomain_GetReason(tt *testing.T) { + var zeroValue string + p := &PagesDomain{Reason: &zeroValue} + p.GetReason() + p = &PagesDomain{} + p.GetReason() + p = nil + p.GetReason() +} + +func TestPagesDomain_GetRespondsToHTTPS(tt *testing.T) { + var zeroValue bool + p := &PagesDomain{RespondsToHTTPS: &zeroValue} + p.GetRespondsToHTTPS() + p = &PagesDomain{} + p.GetRespondsToHTTPS() + p = nil + p.GetRespondsToHTTPS() +} + +func TestPagesDomain_GetShouldBeARecord(tt *testing.T) { + var zeroValue bool + p := &PagesDomain{ShouldBeARecord: &zeroValue} + p.GetShouldBeARecord() + p = &PagesDomain{} + p.GetShouldBeARecord() + p = nil + p.GetShouldBeARecord() +} + +func TestPagesDomain_GetURI(tt *testing.T) { + var zeroValue string + p := &PagesDomain{URI: &zeroValue} + p.GetURI() + p = &PagesDomain{} + p.GetURI() + p = nil + p.GetURI() +} + func TestPagesError_GetMessage(tt *testing.T) { var zeroValue string p := &PagesError{Message: &zeroValue} @@ -14138,6 +14418,20 @@ func TestPagesError_GetMessage(tt *testing.T) { p.GetMessage() } +func TestPagesHealthCheckResponse_GetAltDomain(tt *testing.T) { + p := &PagesHealthCheckResponse{} + p.GetAltDomain() + p = nil + p.GetAltDomain() +} + +func TestPagesHealthCheckResponse_GetDomain(tt *testing.T) { + p := &PagesHealthCheckResponse{} + p.GetDomain() + p = nil + p.GetDomain() +} + func TestPagesHTTPSCertificate_GetDescription(tt *testing.T) { var zeroValue string p := &PagesHTTPSCertificate{Description: &zeroValue} diff --git a/github/repos_pages.go b/github/repos_pages.go index 845de8a0dba..83075dbdd23 100644 --- a/github/repos_pages.go +++ b/github/repos_pages.go @@ -47,6 +47,44 @@ type PagesBuild struct { UpdatedAt *Timestamp `json:"updated_at,omitempty"` } +// PagesDomain represents a domain associated with a GitHub Pages site. +type PagesDomain struct { + Host *string `json:"host,omitempty"` + URI *string `json:"uri,omitempty"` + Nameservers *string `json:"nameservers,omitempty"` + DNSResolves *bool `json:"dns_resolves,omitempty"` + IsProxied *bool `json:"is_proxied,omitempty"` + IsCloudflareIP *bool `json:"is_cloudflare_ip,omitempty"` + IsFastlyIP *bool `json:"is_fastly_ip,omitempty"` + IsOldIPAddress *bool `json:"is_old_ip_address,omitempty"` + IsARecord *bool `json:"is_a_record,omitempty"` + HasCNAMERecord *bool `json:"has_cname_record,omitempty"` + HasMXRecordsPresent *bool `json:"has_mx_records_present,omitempty"` + IsValidDomain *bool `json:"is_valid_domain,omitempty"` + IsApexDomain *bool `json:"is_apex_domain,omitempty"` + ShouldBeARecord *bool `json:"should_be_a_record,omitempty"` + IsCNAMEToGithubUserDomain *bool `json:"is_cname_to_github_user_domain,omitempty"` + IsCNAMEToPagesDotGithubDotCom *bool `json:"is_cname_to_pages_dot_github_dot_com,omitempty"` + IsCNAMEToFastly *bool `json:"is_cname_to_fastly,omitempty"` + IsPointedToGithubPagesIP *bool `json:"is_pointed_to_github_pages_ip,omitempty"` + IsNonGithubPagesIPPresent *bool `json:"is_non_github_pages_ip_present,omitempty"` + IsPagesDomain *bool `json:"is_pages_domain,omitempty"` + IsServedByPages *bool `json:"is_served_by_pages,omitempty"` + IsValid *bool `json:"is_valid,omitempty"` + Reason *string `json:"reason,omitempty"` + RespondsToHTTPS *bool `json:"responds_to_https,omitempty"` + EnforcesHTTPS *bool `json:"enforces_https,omitempty"` + HTTPSError *string `json:"https_error,omitempty"` + IsHTTPSEligible *bool `json:"is_https_eligible,omitempty"` + CAAError *string `json:"caa_error,omitempty"` +} + +// PagesHealthCheckResponse represents the response given for the health check of a GitHub Pages site. +type PagesHealthCheckResponse struct { + Domain *PagesDomain `json:"domain,omitempty"` + AltDomain *PagesDomain `json:"alt_domain,omitempty"` +} + // PagesHTTPSCertificate represents the HTTPS Certificate information for a GitHub Pages site. type PagesHTTPSCertificate struct { State *string `json:"state,omitempty"` @@ -247,3 +285,22 @@ func (s *RepositoriesService) RequestPageBuild(ctx context.Context, owner, repo return build, resp, nil } + +// GetPagesHealthCheck gets a DNS health check for the CNAME record configured for a repository's GitHub Pages. +// +// GitHub API docs: https://docs.github.com/en/rest/pages#get-a-dns-health-check-for-github-pages +func (s *RepositoriesService) GetPageHealthCheck(ctx context.Context, owner, repo string) (*PagesHealthCheckResponse, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/pages/health", owner, repo) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + healthCheckResponse := new(PagesHealthCheckResponse) + resp, err := s.client.Do(ctx, req, healthCheckResponse) + if err != nil { + return nil, resp, err + } + + return healthCheckResponse, resp, nil +} diff --git a/github/repos_pages_test.go b/github/repos_pages_test.go index 6245aac256f..21ffb18127f 100644 --- a/github/repos_pages_test.go +++ b/github/repos_pages_test.go @@ -449,6 +449,54 @@ func TestRepositoriesService_RequestPageBuild(t *testing.T) { }) } +func TestRepositoriesService_GetPageHealthCheck(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/pages/health", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"domain":{"host":"example.com","uri":"http://example.com/","nameservers":"default","dns_resolves":true},"alt_domain":{"host":"www.example.com","uri":"http://www.example.com/","nameservers":"default","dns_resolves":true}}`) + }) + + ctx := context.Background() + healthCheckResponse, _, err := client.Repositories.GetPageHealthCheck(ctx, "o", "r") + if err != nil { + t.Errorf("Repositories.GetPageHealthCheck returned error: %v", err) + } + + want := &PagesHealthCheckResponse{ + Domain: &PagesDomain{ + Host: String("example.com"), + URI: String("http://example.com/"), + Nameservers: String("default"), + DNSResolves: Bool(true), + }, + AltDomain: &PagesDomain{ + Host: String("www.example.com"), + URI: String("http://www.example.com/"), + Nameservers: String("default"), + DNSResolves: Bool(true), + }, + } + if !cmp.Equal(healthCheckResponse, want) { + t.Errorf("Repositories.GetPageHealthCheck returned %+v, want %+v", healthCheckResponse, want) + } + + const methodName = "GetPageHealthCheck" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.GetPageHealthCheck(ctx, "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.GetPageHealthCheck(ctx, "o", "r") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + func TestPagesSource_Marshal(t *testing.T) { testJSONMarshal(t, &PagesSource{}, "{}") @@ -559,6 +607,90 @@ func TestPagesBuild_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } +func TestPagesHealthCheckResponse_Marshal(t *testing.T) { + testJSONMarshal(t, &PagesHealthCheckResponse{}, "{}") + + u := &PagesHealthCheckResponse{ + Domain: &PagesDomain{ + Host: String("example.com"), + URI: String("http://example.com/"), + Nameservers: String("default"), + DNSResolves: Bool(true), + IsProxied: Bool(false), + IsCloudflareIP: Bool(false), + IsFastlyIP: Bool(false), + IsOldIPAddress: Bool(false), + IsARecord: Bool(true), + HasCNAMERecord: Bool(false), + HasMXRecordsPresent: Bool(false), + IsValidDomain: Bool(true), + IsApexDomain: Bool(true), + ShouldBeARecord: Bool(true), + IsCNAMEToGithubUserDomain: Bool(false), + IsCNAMEToPagesDotGithubDotCom: Bool(false), + IsCNAMEToFastly: Bool(false), + IsPointedToGithubPagesIP: Bool(true), + IsNonGithubPagesIPPresent: Bool(false), + IsPagesDomain: Bool(false), + IsServedByPages: Bool(true), + IsValid: Bool(true), + Reason: String("some reason"), + RespondsToHTTPS: Bool(true), + EnforcesHTTPS: Bool(true), + HTTPSError: String("some error"), + IsHTTPSEligible: Bool(true), + CAAError: String("some error"), + }, + AltDomain: &PagesDomain{ + Host: String("www.example.com"), + URI: String("http://www.example.com/"), + Nameservers: String("default"), + DNSResolves: Bool(true), + }, + } + + want := `{ + "domain": { + "host": "example.com", + "uri": "http://example.com/", + "nameservers": "default", + "dns_resolves": true, + "is_proxied": false, + "is_cloudflare_ip": false, + "is_fastly_ip": false, + "is_old_ip_address": false, + "is_a_record": true, + "has_cname_record": false, + "has_mx_records_present": false, + "is_valid_domain": true, + "is_apex_domain": true, + "should_be_a_record": true, + "is_cname_to_github_user_domain": false, + "is_cname_to_pages_dot_github_dot_com": false, + "is_cname_to_fastly": false, + "is_pointed_to_github_pages_ip": true, + "is_non_github_pages_ip_present": false, + "is_pages_domain": false, + "is_served_by_pages": true, + "is_valid": true, + "reason": "some reason", + "responds_to_https": true, + "enforces_https": true, + "https_error": "some error", + "is_https_eligible": true, + "caa_error": "some error" + }, + "alt_domain": { + "host": "www.example.com", + "uri": "http://www.example.com/", + "nameservers": "default", + "dns_resolves": true + } + }` + + testJSONMarshal(t, u, want) +} + func TestCreatePagesRequest_Marshal(t *testing.T) { testJSONMarshal(t, &createPagesRequest{}, "{}") From 6d92e3022b4732e77c0ca1424974f384f0537c32 Mon Sep 17 00:00:00 2001 From: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Date: Wed, 12 Apr 2023 15:40:46 -0600 Subject: [PATCH 214/751] Add `Owner` to `EditChange` struct (#2750) Fixes: #2749. --- github/event_types.go | 12 ++++++ github/event_types_test.go | 76 +++++++++++++++++++++++++++++++++ github/github-accessors.go | 32 ++++++++++++++ github/github-accessors_test.go | 28 ++++++++++++ 4 files changed, 148 insertions(+) diff --git a/github/event_types.go b/github/event_types.go index 71dfd2d0a02..2340a60156f 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -332,6 +332,7 @@ type EditChange struct { Body *EditBody `json:"body,omitempty"` Base *EditBase `json:"base,omitempty"` Repo *EditRepo `json:"repository,omitempty"` + Owner *EditOwner `json:"owner,omitempty"` } // EditTitle represents a pull-request title change. @@ -360,6 +361,17 @@ type EditRepo struct { Name *RepoName `json:"name,omitempty"` } +// EditOwner represents a change of repository ownership. +type EditOwner struct { + OwnerInfo *OwnerInfo `json:"from,omitempty"` +} + +// OwnerInfo represents the account info of the owner of the repo (could be User or Organization but both are User structs). +type OwnerInfo struct { + User *User `json:"user,omitempty"` + Org *User `json:"organization,omitempty"` +} + // RepoName represents a change of repository name. type RepoName struct { From *string `json:"from,omitempty"` diff --git a/github/event_types_test.go b/github/event_types_test.go index a2628b85378..cdbaee5542b 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -104,6 +104,82 @@ func TestEditChange_Marshal_Repo(t *testing.T) { testJSONMarshal(t, u, want) } +func TestEditChange_Marshal_TransferFromUser(t *testing.T) { + testJSONMarshal(t, &EditChange{}, "{}") + + u := &EditChange{ + Owner: &EditOwner{ + OwnerInfo: &OwnerInfo{ + User: &User{ + Login: String("l"), + ID: Int64(1), + NodeID: String("n"), + URL: String("u"), + ReposURL: String("r"), + EventsURL: String("e"), + AvatarURL: String("a"), + }, + }, + }, + } + + want := `{ + "owner": { + "from": { + "user": { + "login": "l", + "id": 1, + "node_id": "n", + "avatar_url": "a", + "url": "u", + "repos_url": "r", + "events_url": "e" + } + } + } + }` + + testJSONMarshal(t, u, want) +} + +func TestEditChange_Marshal_TransferFromOrg(t *testing.T) { + testJSONMarshal(t, &EditChange{}, "{}") + + u := &EditChange{ + Owner: &EditOwner{ + OwnerInfo: &OwnerInfo{ + Org: &User{ + Login: String("l"), + ID: Int64(1), + NodeID: String("n"), + URL: String("u"), + ReposURL: String("r"), + EventsURL: String("e"), + AvatarURL: String("a"), + }, + }, + }, + } + + want := `{ + "owner": { + "from": { + "organization": { + "login": "l", + "id": 1, + "node_id": "n", + "avatar_url": "a", + "url": "u", + "repos_url": "r", + "events_url": "e" + } + } + } + }` + + testJSONMarshal(t, u, want) +} + func TestProjectChange_Marshal_NameChange(t *testing.T) { testJSONMarshal(t, &ProjectChange{}, "{}") diff --git a/github/github-accessors.go b/github/github-accessors.go index 1473c56f5ca..eea7518cbab 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -5470,6 +5470,14 @@ func (e *EditChange) GetBody() *EditBody { return e.Body } +// GetOwner returns the Owner field. +func (e *EditChange) GetOwner() *EditOwner { + if e == nil { + return nil + } + return e.Owner +} + // GetRepo returns the Repo field. func (e *EditChange) GetRepo() *EditRepo { if e == nil { @@ -5486,6 +5494,14 @@ func (e *EditChange) GetTitle() *EditTitle { return e.Title } +// GetOwnerInfo returns the OwnerInfo field. +func (e *EditOwner) GetOwnerInfo() *OwnerInfo { + if e == nil { + return nil + } + return e.OwnerInfo +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (e *EditRef) GetFrom() string { if e == nil || e.From == nil { @@ -11230,6 +11246,22 @@ func (o *OrgStats) GetTotalTeams() int { return *o.TotalTeams } +// GetOrg returns the Org field. +func (o *OwnerInfo) GetOrg() *User { + if o == nil { + return nil + } + return o.Org +} + +// GetUser returns the User field. +func (o *OwnerInfo) GetUser() *User { + if o == nil { + return nil + } + return o.User +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (p *Package) GetCreatedAt() Timestamp { if p == nil || p.CreatedAt == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 52a0e5b9020..5b2054bfeb4 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -6397,6 +6397,13 @@ func TestEditChange_GetBody(tt *testing.T) { e.GetBody() } +func TestEditChange_GetOwner(tt *testing.T) { + e := &EditChange{} + e.GetOwner() + e = nil + e.GetOwner() +} + func TestEditChange_GetRepo(tt *testing.T) { e := &EditChange{} e.GetRepo() @@ -6411,6 +6418,13 @@ func TestEditChange_GetTitle(tt *testing.T) { e.GetTitle() } +func TestEditOwner_GetOwnerInfo(tt *testing.T) { + e := &EditOwner{} + e.GetOwnerInfo() + e = nil + e.GetOwnerInfo() +} + func TestEditRef_GetFrom(tt *testing.T) { var zeroValue string e := &EditRef{From: &zeroValue} @@ -13177,6 +13191,20 @@ func TestOrgStats_GetTotalTeams(tt *testing.T) { o.GetTotalTeams() } +func TestOwnerInfo_GetOrg(tt *testing.T) { + o := &OwnerInfo{} + o.GetOrg() + o = nil + o.GetOrg() +} + +func TestOwnerInfo_GetUser(tt *testing.T) { + o := &OwnerInfo{} + o.GetUser() + o = nil + o.GetUser() +} + func TestPackage_GetCreatedAt(tt *testing.T) { var zeroValue Timestamp p := &Package{CreatedAt: &zeroValue} From ff89f869743da22dbb3d783b7cd7ca4b52852b81 Mon Sep 17 00:00:00 2001 From: Vivek Date: Mon, 17 Apr 2023 21:44:45 +1000 Subject: [PATCH 215/751] Update Create/Update methods to return the workflow (#2759) Fixes: #2756. --- github/actions_required_workflows.go | 26 +++++-- github/actions_required_workflows_test.go | 84 ++++++++++++++++++++--- 2 files changed, 95 insertions(+), 15 deletions(-) diff --git a/github/actions_required_workflows.go b/github/actions_required_workflows.go index 73a4c77facb..11b96f60e4c 100644 --- a/github/actions_required_workflows.go +++ b/github/actions_required_workflows.go @@ -92,13 +92,20 @@ func (s *ActionsService) ListOrgRequiredWorkflows(ctx context.Context, org strin // CreateRequiredWorkflow creates the required workflow in an org. // // GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#create-a-required-workflow -func (s *ActionsService) CreateRequiredWorkflow(ctx context.Context, org string, createRequiredWorkflowOptions *CreateUpdateRequiredWorkflowOptions) (*Response, error) { +func (s *ActionsService) CreateRequiredWorkflow(ctx context.Context, org string, createRequiredWorkflowOptions *CreateUpdateRequiredWorkflowOptions) (*OrgRequiredWorkflow, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows", org) req, err := s.client.NewRequest("PUT", url, createRequiredWorkflowOptions) if err != nil { - return nil, err + return nil, nil, err } - return s.client.Do(ctx, req, nil) + + orgRequiredWorkflow := new(OrgRequiredWorkflow) + resp, err := s.client.Do(ctx, req, orgRequiredWorkflow) + if err != nil { + return nil, resp, err + } + + return orgRequiredWorkflow, resp, nil } // GetRequiredWorkflowByID get the RequiredWorkflows for an org by its ID. @@ -124,13 +131,20 @@ func (s *ActionsService) GetRequiredWorkflowByID(ctx context.Context, owner stri // UpdateRequiredWorkflow updates a required workflow in an org. // // GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#update-a-required-workflow -func (s *ActionsService) UpdateRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID int64, updateRequiredWorkflowOptions *CreateUpdateRequiredWorkflowOptions) (*Response, error) { +func (s *ActionsService) UpdateRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID int64, updateRequiredWorkflowOptions *CreateUpdateRequiredWorkflowOptions) (*OrgRequiredWorkflow, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v", org, requiredWorkflowID) req, err := s.client.NewRequest("PATCH", url, updateRequiredWorkflowOptions) if err != nil { - return nil, err + return nil, nil, err } - return s.client.Do(ctx, req, nil) + + orgRequiredWorkflow := new(OrgRequiredWorkflow) + resp, err := s.client.Do(ctx, req, orgRequiredWorkflow) + if err != nil { + return nil, resp, err + } + + return orgRequiredWorkflow, resp, nil } // DeleteRequiredWorkflow deletes a required workflow in an org. diff --git a/github/actions_required_workflows_test.go b/github/actions_required_workflows_test.go index a560d7e995e..4298caa0095 100644 --- a/github/actions_required_workflows_test.go +++ b/github/actions_required_workflows_test.go @@ -86,7 +86,20 @@ func TestActionsService_CreateRequiredWorkflow(t *testing.T) { testMethod(t, r, "PUT") testHeader(t, r, "Content-Type", "application/json") testBody(t, r, `{"workflow_file_path":".github/workflows/ci.yaml","repository_id":53,"scope":"selected","selected_repository_ids":[32,91]}`+"\n") - w.WriteHeader(http.StatusCreated) + fmt.Fprint(w, `{ + "id": 2, + "name": "Required CI", + "path": ".github/workflows/ci.yml", + "scope": "selected", + "ref": "refs/head/main", + "state": "active", + "selected_repositories_url": "https://api.github.com/orgs/octo-org/actions/required_workflows/2/repositories", + "created_at": "2020-01-22T19:33:08Z", + "updated_at": "2020-01-22T19:33:08Z", + "repository": { + "id": 53, + "name": "Hello-World", + "url": "https://api.github.com/repos/o/Hello-World"}}`) }) input := &CreateUpdateRequiredWorkflowOptions{ WorkflowFilePath: String(".github/workflows/ci.yaml"), @@ -95,20 +108,39 @@ func TestActionsService_CreateRequiredWorkflow(t *testing.T) { SelectedRepositoryIDs: &SelectedRepoIDs{32, 91}, } ctx := context.Background() - _, err := client.Actions.CreateRequiredWorkflow(ctx, "o", input) - + requiredWokflow, _, err := client.Actions.CreateRequiredWorkflow(ctx, "o", input) if err != nil { t.Errorf("Actions.CreateRequiredWorkflow returned error: %v", err) } + want := &OrgRequiredWorkflow{ + ID: Int64(2), + Name: String("Required CI"), + Path: String(".github/workflows/ci.yml"), + Scope: String("selected"), + Ref: String("refs/head/main"), + State: String("active"), + SelectedRepositoriesURL: String("https://api.github.com/orgs/octo-org/actions/required_workflows/2/repositories"), + CreatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, + UpdatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, + Repository: &Repository{ID: Int64(53), URL: String("https://api.github.com/repos/o/Hello-World"), Name: String("Hello-World")}, + } + + if !cmp.Equal(requiredWokflow, want) { + t.Errorf("Actions.CreateRequiredWorkflow returned %+v, want %+v", requiredWokflow, want) + } const methodName = "CreateRequiredWorkflow" testBadOptions(t, methodName, func() (err error) { - _, err = client.Actions.CreateRequiredWorkflow(ctx, "\n", input) + _, _, err = client.Actions.CreateRequiredWorkflow(ctx, "\n", input) return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Actions.CreateRequiredWorkflow(ctx, "o", input) + got, resp, err := client.Actions.CreateRequiredWorkflow(ctx, "o", input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err }) } @@ -169,7 +201,20 @@ func TestActionsService_UpdateRequiredWorkflow(t *testing.T) { testMethod(t, r, "PATCH") testHeader(t, r, "Content-Type", "application/json") testBody(t, r, `{"workflow_file_path":".github/workflows/ci.yaml","repository_id":53,"scope":"selected","selected_repository_ids":[32,91]}`+"\n") - w.WriteHeader(http.StatusOK) + fmt.Fprint(w, `{ + "id": 12345, + "name": "Required CI", + "path": ".github/workflows/ci.yml", + "scope": "selected", + "ref": "refs/head/main", + "state": "active", + "selected_repositories_url": "https://api.github.com/orgs/octo-org/actions/required_workflows/12345/repositories", + "created_at": "2020-01-22T19:33:08Z", + "updated_at": "2020-01-22T19:33:08Z", + "repository": { + "id": 53, + "name": "Hello-World", + "url": "https://api.github.com/repos/o/Hello-World"}}`) }) input := &CreateUpdateRequiredWorkflowOptions{ WorkflowFilePath: String(".github/workflows/ci.yaml"), @@ -178,20 +223,41 @@ func TestActionsService_UpdateRequiredWorkflow(t *testing.T) { SelectedRepositoryIDs: &SelectedRepoIDs{32, 91}, } ctx := context.Background() - _, err := client.Actions.UpdateRequiredWorkflow(ctx, "o", 12345, input) + + requiredWokflow, _, err := client.Actions.UpdateRequiredWorkflow(ctx, "o", 12345, input) if err != nil { t.Errorf("Actions.UpdateRequiredWorkflow returned error: %v", err) } + want := &OrgRequiredWorkflow{ + ID: Int64(12345), + Name: String("Required CI"), + Path: String(".github/workflows/ci.yml"), + Scope: String("selected"), + Ref: String("refs/head/main"), + State: String("active"), + SelectedRepositoriesURL: String("https://api.github.com/orgs/octo-org/actions/required_workflows/12345/repositories"), + CreatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, + UpdatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, + Repository: &Repository{ID: Int64(53), URL: String("https://api.github.com/repos/o/Hello-World"), Name: String("Hello-World")}, + } + + if !cmp.Equal(requiredWokflow, want) { + t.Errorf("Actions.UpdateRequiredWorkflow returned %+v, want %+v", requiredWokflow, want) + } const methodName = "UpdateRequiredWorkflow" testBadOptions(t, methodName, func() (err error) { - _, err = client.Actions.UpdateRequiredWorkflow(ctx, "\n", 12345, input) + _, _, err = client.Actions.UpdateRequiredWorkflow(ctx, "\n", 12345, input) return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Actions.UpdateRequiredWorkflow(ctx, "o", 12345, input) + got, resp, err := client.Actions.UpdateRequiredWorkflow(ctx, "o", 12345, input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err }) } From a888f0ce6a3ded0f042787812ea94b13c79ffd3a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Apr 2023 16:10:51 -0400 Subject: [PATCH 216/751] Bump codecov/codecov-action from 3.1.1 to 3.1.2 (#2761) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 023dc9f1edc..3c9c97ab6b9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -75,7 +75,7 @@ jobs: - name: Upload coverage to Codecov if: ${{ matrix.update-coverage }} - uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 #v3.1.1 + uses: codecov/codecov-action@40a12dcee2df644d47232dde008099a3e9e4f865 #v3.1.2 - name: Ensure go generate produces a zero diff for update-urls shell: bash From 9385ab02991f311db7d6be6a67717d0ff50fc84f Mon Sep 17 00:00:00 2001 From: Karoly Kamaras <73882027+kkaresz-tw@users.noreply.github.com> Date: Tue, 18 Apr 2023 14:04:06 +0200 Subject: [PATCH 217/751] Add HeadBranch field to WorkflowJob (#2764) Fixes: #2762. --- github/actions_workflow_jobs.go | 1 + github/actions_workflow_jobs_test.go | 4 ++++ github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ 4 files changed, 23 insertions(+) diff --git a/github/actions_workflow_jobs.go b/github/actions_workflow_jobs.go index b7130916fe5..1f018b3e48e 100644 --- a/github/actions_workflow_jobs.go +++ b/github/actions_workflow_jobs.go @@ -28,6 +28,7 @@ type WorkflowJob struct { RunID *int64 `json:"run_id,omitempty"` RunURL *string `json:"run_url,omitempty"` NodeID *string `json:"node_id,omitempty"` + HeadBranch *string `json:"head_branch,omitempty"` HeadSHA *string `json:"head_sha,omitempty"` URL *string `json:"url,omitempty"` HTMLURL *string `json:"html_url,omitempty"` diff --git a/github/actions_workflow_jobs_test.go b/github/actions_workflow_jobs_test.go index 521e401102b..8cea9545003 100644 --- a/github/actions_workflow_jobs_test.go +++ b/github/actions_workflow_jobs_test.go @@ -246,6 +246,7 @@ func TestWorkflowJob_Marshal(t *testing.T) { RunID: Int64(1), RunURL: String("r"), NodeID: String("n"), + HeadBranch: String("b"), HeadSHA: String("h"), URL: String("u"), HTMLURL: String("h"), @@ -274,6 +275,7 @@ func TestWorkflowJob_Marshal(t *testing.T) { "run_id": 1, "run_url": "r", "node_id": "n", + "head_branch": "b", "head_sha": "h", "url": "u", "html_url": "h", @@ -309,6 +311,7 @@ func TestJobs_Marshal(t *testing.T) { RunID: Int64(1), RunURL: String("r"), NodeID: String("n"), + HeadBranch: String("b"), HeadSHA: String("h"), URL: String("u"), HTMLURL: String("h"), @@ -342,6 +345,7 @@ func TestJobs_Marshal(t *testing.T) { "run_id": 1, "run_url": "r", "node_id": "n", + "head_branch": "b", "head_sha": "h", "url": "u", "html_url": "h", diff --git a/github/github-accessors.go b/github/github-accessors.go index eea7518cbab..0e25c7e812e 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -21798,6 +21798,14 @@ func (w *WorkflowJob) GetCreatedAt() Timestamp { return *w.CreatedAt } +// GetHeadBranch returns the HeadBranch field if it's non-nil, zero value otherwise. +func (w *WorkflowJob) GetHeadBranch() string { + if w == nil || w.HeadBranch == nil { + return "" + } + return *w.HeadBranch +} + // GetHeadSHA returns the HeadSHA field if it's non-nil, zero value otherwise. func (w *WorkflowJob) GetHeadSHA() string { if w == nil || w.HeadSHA == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 5b2054bfeb4..8560b2769e3 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -25481,6 +25481,16 @@ func TestWorkflowJob_GetCreatedAt(tt *testing.T) { w.GetCreatedAt() } +func TestWorkflowJob_GetHeadBranch(tt *testing.T) { + var zeroValue string + w := &WorkflowJob{HeadBranch: &zeroValue} + w.GetHeadBranch() + w = &WorkflowJob{} + w.GetHeadBranch() + w = nil + w.GetHeadBranch() +} + func TestWorkflowJob_GetHeadSHA(tt *testing.T) { var zeroValue string w := &WorkflowJob{HeadSHA: &zeroValue} From 693ddffe1aa1033b6de421130ac3a0423f27c0de Mon Sep 17 00:00:00 2001 From: Marcelo Sousa <601882+marcelosousa@users.noreply.github.com> Date: Tue, 18 Apr 2023 14:59:17 +0100 Subject: [PATCH 218/751] Add requester to InstallationEvent (#2763) --- github/event_types.go | 2 +- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 7 +++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/github/event_types.go b/github/event_types.go index 2340a60156f..685e46f0287 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -469,7 +469,7 @@ type InstallationEvent struct { Repositories []*Repository `json:"repositories,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` - // TODO key "requester" is not covered + Requester *User `json:"requester,omitempty"` } // InstallationRepositoriesEvent is triggered when a repository is added or diff --git a/github/github-accessors.go b/github/github-accessors.go index 0e25c7e812e..763579453b5 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -7358,6 +7358,14 @@ func (i *InstallationEvent) GetInstallation() *Installation { return i.Installation } +// GetRequester returns the Requester field. +func (i *InstallationEvent) GetRequester() *User { + if i == nil { + return nil + } + return i.Requester +} + // GetSender returns the Sender field. func (i *InstallationEvent) GetSender() *User { if i == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 8560b2769e3..ad885a4c2ff 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -8634,6 +8634,13 @@ func TestInstallationEvent_GetInstallation(tt *testing.T) { i.GetInstallation() } +func TestInstallationEvent_GetRequester(tt *testing.T) { + i := &InstallationEvent{} + i.GetRequester() + i = nil + i.GetRequester() +} + func TestInstallationEvent_GetSender(tt *testing.T) { i := &InstallationEvent{} i.GetSender() From 848d85f758104cbd87a18a99e0c2921c493c102a Mon Sep 17 00:00:00 2001 From: Chmouel Boudjnah Date: Wed, 19 Apr 2023 18:33:22 +0200 Subject: [PATCH 219/751] Add InstallationsCount to App (#2765) --- github/apps.go | 25 +++++++++++++------------ github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ 3 files changed, 31 insertions(+), 12 deletions(-) diff --git a/github/apps.go b/github/apps.go index e1d9aadaf5d..ab83d59ab2f 100644 --- a/github/apps.go +++ b/github/apps.go @@ -18,18 +18,19 @@ type AppsService service // App represents a GitHub App. type App struct { - ID *int64 `json:"id,omitempty"` - Slug *string `json:"slug,omitempty"` - NodeID *string `json:"node_id,omitempty"` - Owner *User `json:"owner,omitempty"` - Name *string `json:"name,omitempty"` - Description *string `json:"description,omitempty"` - ExternalURL *string `json:"external_url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - Permissions *InstallationPermissions `json:"permissions,omitempty"` - Events []string `json:"events,omitempty"` + ID *int64 `json:"id,omitempty"` + Slug *string `json:"slug,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Owner *User `json:"owner,omitempty"` + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + ExternalURL *string `json:"external_url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + Permissions *InstallationPermissions `json:"permissions,omitempty"` + Events []string `json:"events,omitempty"` + InstallationsCount *int `json:"installations_count,omitempty"` } // InstallationToken represents an installation token. diff --git a/github/github-accessors.go b/github/github-accessors.go index 763579453b5..2f40756f258 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -678,6 +678,14 @@ func (a *App) GetID() int64 { return *a.ID } +// GetInstallationsCount returns the InstallationsCount field if it's non-nil, zero value otherwise. +func (a *App) GetInstallationsCount() int { + if a == nil || a.InstallationsCount == nil { + return 0 + } + return *a.InstallationsCount +} + // GetName returns the Name field if it's non-nil, zero value otherwise. func (a *App) GetName() string { if a == nil || a.Name == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index ad885a4c2ff..0a5d3a6e69c 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -785,6 +785,16 @@ func TestApp_GetID(tt *testing.T) { a.GetID() } +func TestApp_GetInstallationsCount(tt *testing.T) { + var zeroValue int + a := &App{InstallationsCount: &zeroValue} + a.GetInstallationsCount() + a = &App{} + a.GetInstallationsCount() + a = nil + a.GetInstallationsCount() +} + func TestApp_GetName(tt *testing.T) { var zeroValue string a := &App{Name: &zeroValue} From 0a6474043f9f14c77ba6fa77d1b377a7538a4c8c Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Fri, 21 Apr 2023 09:53:36 -0400 Subject: [PATCH 220/751] Bump version of go-github to v52.0.0 (#2766) --- README.md | 15 ++++++------ example/actionpermissions/main.go | 2 +- example/appengine/app.go | 2 +- example/basicauth/main.go | 2 +- example/commitpr/main.go | 2 +- example/go.mod | 6 ++--- example/listenvironments/main.go | 2 +- example/migrations/main.go | 2 +- example/newfilewithappauth/main.go | 2 +- example/newrepo/main.go | 2 +- example/newreposecretwithlibsodium/go.mod | 4 ++-- example/newreposecretwithlibsodium/main.go | 2 +- example/newreposecretwithxcrypto/main.go | 2 +- example/ratelimit/main.go | 2 +- example/simple/main.go | 2 +- example/tagprotection/main.go | 2 +- example/tokenauth/main.go | 2 +- example/topics/main.go | 2 +- github/doc.go | 2 +- github/examples_test.go | 2 +- github/github.go | 2 +- go.mod | 2 +- go.sum | 28 ---------------------- test/fields/fields.go | 2 +- test/integration/activity_test.go | 2 +- test/integration/authorizations_test.go | 2 +- test/integration/github_test.go | 2 +- test/integration/repos_test.go | 2 +- test/integration/users_test.go | 2 +- update-urls/go.mod | 2 +- 30 files changed, 39 insertions(+), 66 deletions(-) diff --git a/README.md b/README.md index 4b32469dc74..33f33fe947a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-github # [![go-github release (latest SemVer)](https://img.shields.io/github/v/release/google/go-github?sort=semver)](https://github.com/google/go-github/releases) -[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v51/github) +[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v52/github) [![Test Status](https://github.com/google/go-github/workflows/tests/badge.svg)](https://github.com/google/go-github/actions?query=workflow%3Atests) [![Test Coverage](https://codecov.io/gh/google/go-github/branch/master/graph/badge.svg)](https://codecov.io/gh/google/go-github) [![Discuss at go-github@googlegroups.com](https://img.shields.io/badge/discuss-go--github%40googlegroups.com-blue.svg)](https://groups.google.com/group/go-github) @@ -24,7 +24,7 @@ If you're interested in using the [GraphQL API v4][], the recommended library is go-github is compatible with modern Go releases in module mode, with Go installed: ```bash -go get github.com/google/go-github/v51 +go get github.com/google/go-github/v52 ``` will resolve and add the package to the current development module, along with its dependencies. @@ -32,7 +32,7 @@ will resolve and add the package to the current development module, along with i Alternatively the same can be achieved if you use import in a package: ```go -import "github.com/google/go-github/v51/github" +import "github.com/google/go-github/v52/github" ``` and run `go get` without parameters. @@ -40,13 +40,13 @@ and run `go get` without parameters. Finally, to use the top-of-trunk version of this repo, use the following command: ```bash -go get github.com/google/go-github/v51@master +go get github.com/google/go-github/v52@master ``` ## Usage ## ```go -import "github.com/google/go-github/v51/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) +import "github.com/google/go-github/v52/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled ``` @@ -135,7 +135,7 @@ import ( "net/http" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v51/github" + "github.com/google/go-github/v52/github" ) func main() { @@ -323,7 +323,7 @@ For complete usage of go-github, see the full [package docs][]. [oauth2]: https://github.com/golang/oauth2 [oauth2 docs]: https://godoc.org/golang.org/x/oauth2 [personal API token]: https://github.com/blog/1509-personal-api-tokens -[package docs]: https://pkg.go.dev/github.com/google/go-github/v51/github +[package docs]: https://pkg.go.dev/github.com/google/go-github/v52/github [GraphQL API v4]: https://developer.github.com/v4/ [shurcooL/githubv4]: https://github.com/shurcooL/githubv4 [GitHub webhook events]: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads @@ -396,6 +396,7 @@ Versions prior to 48.2.0 are not listed. | go-github Version | GitHub v3 API Version | | ----------------- | --------------------- | +| 52.0.0 | 2022-11-28 | | 51.0.0 | 2022-11-28 | | 50.2.0 | 2022-11-28 | | 50.1.0 | 2022-11-28 | diff --git a/example/actionpermissions/main.go b/example/actionpermissions/main.go index 04abed7f166..34b7d6967d5 100644 --- a/example/actionpermissions/main.go +++ b/example/actionpermissions/main.go @@ -14,7 +14,7 @@ import ( "log" "os" - "github.com/google/go-github/v51/github" + "github.com/google/go-github/v52/github" ) var ( diff --git a/example/appengine/app.go b/example/appengine/app.go index 24873f7ac98..e2f2a5fc846 100644 --- a/example/appengine/app.go +++ b/example/appengine/app.go @@ -12,7 +12,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v51/github" + "github.com/google/go-github/v52/github" "google.golang.org/appengine" "google.golang.org/appengine/log" ) diff --git a/example/basicauth/main.go b/example/basicauth/main.go index 5336356b967..c432db85c6c 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -22,7 +22,7 @@ import ( "strings" "syscall" - "github.com/google/go-github/v51/github" + "github.com/google/go-github/v52/github" "golang.org/x/crypto/ssh/terminal" ) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index 39d4e72a62f..55fa03f620f 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -30,7 +30,7 @@ import ( "strings" "time" - "github.com/google/go-github/v51/github" + "github.com/google/go-github/v52/github" ) var ( diff --git a/example/go.mod b/example/go.mod index bb2b6d55313..144f51b5e40 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,11 +1,11 @@ -module github.com/google/go-github/v51/example +module github.com/google/go-github/v52/example go 1.17 require ( github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-ratelimit v1.0.1 - github.com/google/go-github/v51 v51.0.0 + github.com/google/go-github/v52 v52.0.0 golang.org/x/crypto v0.1.0 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be google.golang.org/appengine v1.6.7 @@ -22,4 +22,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v51 => ../ +replace github.com/google/go-github/v52 => ../ diff --git a/example/listenvironments/main.go b/example/listenvironments/main.go index 9fcbc08b1b3..9324ecf6759 100644 --- a/example/listenvironments/main.go +++ b/example/listenvironments/main.go @@ -18,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v51/github" + "github.com/google/go-github/v52/github" ) func main() { diff --git a/example/migrations/main.go b/example/migrations/main.go index 5ca3e1cbe3d..1708a76d799 100644 --- a/example/migrations/main.go +++ b/example/migrations/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v51/github" + "github.com/google/go-github/v52/github" ) func fetchAllUserMigrations() ([]*github.UserMigration, error) { diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index cf1236867ce..71688eef3c5 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -16,7 +16,7 @@ import ( "time" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v51/github" + "github.com/google/go-github/v52/github" "golang.org/x/oauth2" ) diff --git a/example/newrepo/main.go b/example/newrepo/main.go index b055b0f60b4..fccf471f4ca 100644 --- a/example/newrepo/main.go +++ b/example/newrepo/main.go @@ -16,7 +16,7 @@ import ( "log" "os" - "github.com/google/go-github/v51/github" + "github.com/google/go-github/v52/github" ) var ( diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index 2ef642b6886..8f3cd790fa5 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -4,9 +4,9 @@ go 1.15 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb - github.com/google/go-github/v51 v51.0.0 + github.com/google/go-github/v52 v52.0.0 golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v51 => ../.. +replace github.com/google/go-github/v52 => ../.. diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index 68acc3df1de..238943b262b 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -36,7 +36,7 @@ import ( "os" sodium "github.com/GoKillers/libsodium-go/cryptobox" - "github.com/google/go-github/v51/github" + "github.com/google/go-github/v52/github" ) var ( diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index f94993c01c3..b55ecc2fe7b 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -36,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v51/github" + "github.com/google/go-github/v52/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/ratelimit/main.go b/example/ratelimit/main.go index 7f5fc792e70..f8740680500 100644 --- a/example/ratelimit/main.go +++ b/example/ratelimit/main.go @@ -13,7 +13,7 @@ import ( "fmt" "github.com/gofri/go-github-ratelimit/github_ratelimit" - "github.com/google/go-github/v51/github" + "github.com/google/go-github/v52/github" ) func main() { diff --git a/example/simple/main.go b/example/simple/main.go index 20ac83dba0c..438097c8eab 100644 --- a/example/simple/main.go +++ b/example/simple/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v51/github" + "github.com/google/go-github/v52/github" ) // Fetch all the public organizations' membership of a user. diff --git a/example/tagprotection/main.go b/example/tagprotection/main.go index 2a050188877..c78f34f7622 100644 --- a/example/tagprotection/main.go +++ b/example/tagprotection/main.go @@ -19,7 +19,7 @@ import ( "strings" "syscall" - "github.com/google/go-github/v51/github" + "github.com/google/go-github/v52/github" "golang.org/x/crypto/ssh/terminal" ) diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index 9c58089bd0d..f0ae2f79a5e 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -14,7 +14,7 @@ import ( "log" "syscall" - "github.com/google/go-github/v51/github" + "github.com/google/go-github/v52/github" "golang.org/x/crypto/ssh/terminal" ) diff --git a/example/topics/main.go b/example/topics/main.go index 038cc2eb212..cdab7a56309 100644 --- a/example/topics/main.go +++ b/example/topics/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v51/github" + "github.com/google/go-github/v52/github" ) // Fetch and lists all the public topics associated with the specified GitHub topic diff --git a/github/doc.go b/github/doc.go index 4c76f0e0ff6..1acf8d5a8d0 100644 --- a/github/doc.go +++ b/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v51/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v52/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to diff --git a/github/examples_test.go b/github/examples_test.go index ae732ded16e..4628b38c4ef 100644 --- a/github/examples_test.go +++ b/github/examples_test.go @@ -12,7 +12,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v51/github" + "github.com/google/go-github/v52/github" ) func ExampleClient_Markdown() { diff --git a/github/github.go b/github/github.go index 324e155e22a..2127a527acb 100644 --- a/github/github.go +++ b/github/github.go @@ -28,7 +28,7 @@ import ( ) const ( - Version = "v51.0.0" + Version = "v52.0.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" diff --git a/go.mod b/go.mod index 16e5bea0185..e67d5b47d69 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v51 +module github.com/google/go-github/v52 require ( github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 diff --git a/go.sum b/go.sum index f5dd2eff36d..4692d98b853 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,3 @@ -cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= @@ -10,58 +9,31 @@ github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= 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/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= diff --git a/test/fields/fields.go b/test/fields/fields.go index 634e372901b..bebd0a3f87f 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -25,7 +25,7 @@ import ( "reflect" "strings" - "github.com/google/go-github/v51/github" + "github.com/google/go-github/v52/github" ) var ( diff --git a/test/integration/activity_test.go b/test/integration/activity_test.go index 1d92e06b41b..59f17951246 100644 --- a/test/integration/activity_test.go +++ b/test/integration/activity_test.go @@ -12,7 +12,7 @@ import ( "context" "testing" - "github.com/google/go-github/v51/github" + "github.com/google/go-github/v52/github" ) const ( diff --git a/test/integration/authorizations_test.go b/test/integration/authorizations_test.go index f7f67cc8038..3a7310ec1d9 100644 --- a/test/integration/authorizations_test.go +++ b/test/integration/authorizations_test.go @@ -17,7 +17,7 @@ import ( "testing" "time" - "github.com/google/go-github/v51/github" + "github.com/google/go-github/v52/github" ) const msgEnvMissing = "Skipping test because the required environment variable (%v) is not present." diff --git a/test/integration/github_test.go b/test/integration/github_test.go index 6a68c885f25..365b2c2b8b9 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -15,7 +15,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v51/github" + "github.com/google/go-github/v52/github" ) var ( diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index 0c27c8e6d63..01c1ad4a6db 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -15,7 +15,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v51/github" + "github.com/google/go-github/v52/github" ) func TestRepositories_CRUD(t *testing.T) { diff --git a/test/integration/users_test.go b/test/integration/users_test.go index 10a536eac12..88a358b59b0 100644 --- a/test/integration/users_test.go +++ b/test/integration/users_test.go @@ -14,7 +14,7 @@ import ( "math/rand" "testing" - "github.com/google/go-github/v51/github" + "github.com/google/go-github/v52/github" ) func TestUsers_Get(t *testing.T) { diff --git a/update-urls/go.mod b/update-urls/go.mod index 226193f0e3e..7ac2c08939a 100644 --- a/update-urls/go.mod +++ b/update-urls/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v51/update-urls +module github.com/google/go-github/v52/update-urls go 1.16 From 18c061c64100aba3b05723b692bf4299691aec23 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Fri, 21 Apr 2023 10:37:44 -0400 Subject: [PATCH 221/751] Bump go-github from v51.0.0 to v52.0.0 in /scrape (#2767) --- scrape/apps.go | 2 +- scrape/apps_test.go | 2 +- scrape/go.mod | 2 +- scrape/go.sum | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scrape/apps.go b/scrape/apps.go index 59a58c1a6e5..adbc2f48896 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -17,7 +17,7 @@ import ( "strings" "github.com/PuerkitoBio/goquery" - "github.com/google/go-github/v51/github" + "github.com/google/go-github/v52/github" ) // AppRestrictionsEnabled returns whether the specified organization has diff --git a/scrape/apps_test.go b/scrape/apps_test.go index 913588b57cf..ed5b7e4df66 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v51/github" + "github.com/google/go-github/v52/github" ) func Test_AppRestrictionsEnabled(t *testing.T) { diff --git a/scrape/go.mod b/scrape/go.mod index 296956c9d17..23cbb252b7e 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -5,7 +5,7 @@ go 1.13 require ( github.com/PuerkitoBio/goquery v1.8.1 github.com/google/go-cmp v0.5.9 - github.com/google/go-github/v51 v51.0.0 + github.com/google/go-github/v52 v52.0.0 github.com/xlzd/gotp v0.1.0 golang.org/x/net v0.9.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index e32b45f6a95..8f37dfe0efa 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -17,8 +17,8 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v51 v51.0.0 h1:KCjsbgPV28VoRftdP+K2mQL16jniUsLAJknsOVKwHyU= -github.com/google/go-github/v51 v51.0.0/go.mod h1:kZj/rn/c1lSUbr/PFWl2hhusPV7a5XNYKcwPrd5L3Us= +github.com/google/go-github/v52 v52.0.0 h1:uyGWOY+jMQ8GVGSX8dkSwCzlehU3WfdxQ7GweO/JP7M= +github.com/google/go-github/v52 v52.0.0/go.mod h1:WJV6VEEUPuMo5pXqqa2ZCZEdbQqua4zAk2MZTIo+m+4= 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.1.0 h1:37blvlKCh38s+fkem+fFh7sMnceltoIEBYTVXyoa5Po= @@ -40,8 +40,8 @@ golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= -golang.org/x/oauth2 v0.6.0 h1:Lh8GPgSKBfWSwFvtuWOfeI3aAAnbXTSutYxJiOJFgIw= -golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= +golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= +golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= From 85b986d5bbd691956749ecc81d4483252d9f2c46 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Apr 2023 17:29:16 -0400 Subject: [PATCH 222/751] Bump codecov/codecov-action from 3.1.2 to 3.1.3 (#2768) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3c9c97ab6b9..700cea12fdd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -75,7 +75,7 @@ jobs: - name: Upload coverage to Codecov if: ${{ matrix.update-coverage }} - uses: codecov/codecov-action@40a12dcee2df644d47232dde008099a3e9e4f865 #v3.1.2 + uses: codecov/codecov-action@894ff025c7b54547a9a2a1e9f228beae737ad3c2 #v3.1.3 - name: Ensure go generate produces a zero diff for update-urls shell: bash From daa96df75b7cd073beac60ebd619343fe7d4491f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20G=C3=B3mez=20Reus?= Date: Tue, 25 Apr 2023 20:02:49 -0600 Subject: [PATCH 223/751] Change the CreateRequiredWorkflow method from PUT to POST (#2771) Fixes: #2770. --- github/actions_required_workflows.go | 2 +- github/actions_required_workflows_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/github/actions_required_workflows.go b/github/actions_required_workflows.go index 11b96f60e4c..3566eb9d207 100644 --- a/github/actions_required_workflows.go +++ b/github/actions_required_workflows.go @@ -94,7 +94,7 @@ func (s *ActionsService) ListOrgRequiredWorkflows(ctx context.Context, org strin // GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#create-a-required-workflow func (s *ActionsService) CreateRequiredWorkflow(ctx context.Context, org string, createRequiredWorkflowOptions *CreateUpdateRequiredWorkflowOptions) (*OrgRequiredWorkflow, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows", org) - req, err := s.client.NewRequest("PUT", url, createRequiredWorkflowOptions) + req, err := s.client.NewRequest("POST", url, createRequiredWorkflowOptions) if err != nil { return nil, nil, err } diff --git a/github/actions_required_workflows_test.go b/github/actions_required_workflows_test.go index 4298caa0095..a9d63603af9 100644 --- a/github/actions_required_workflows_test.go +++ b/github/actions_required_workflows_test.go @@ -83,7 +83,7 @@ func TestActionsService_CreateRequiredWorkflow(t *testing.T) { client, mux, _, teardown := setup() defer teardown() mux.HandleFunc("/orgs/o/actions/required_workflows", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "PUT") + testMethod(t, r, "POST") testHeader(t, r, "Content-Type", "application/json") testBody(t, r, `{"workflow_file_path":".github/workflows/ci.yaml","repository_id":53,"scope":"selected","selected_repository_ids":[32,91]}`+"\n") fmt.Fprint(w, `{ From a938017469a86219f8772b0d2341ccde9e2650d4 Mon Sep 17 00:00:00 2001 From: Aurimas Salamachinas Date: Thu, 27 Apr 2023 15:02:17 +0300 Subject: [PATCH 224/751] Add Repository field to DependabotAlert (#2772) Fixes: #2769. --- github/dependabot_alerts.go | 1 + github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 7 +++++++ 3 files changed, 16 insertions(+) diff --git a/github/dependabot_alerts.go b/github/dependabot_alerts.go index e00aebc804f..7b5d53b3939 100644 --- a/github/dependabot_alerts.go +++ b/github/dependabot_alerts.go @@ -62,6 +62,7 @@ type DependabotAlert struct { DismissedReason *string `json:"dismissed_reason,omitempty"` DismissedComment *string `json:"dismissed_comment,omitempty"` FixedAt *Timestamp `json:"fixed_at,omitempty"` + Repository *Repository `json:"repository,omitempty"` } // ListAlertsOptions specifies the optional parameters to the DependabotService.ListRepoAlerts diff --git a/github/github-accessors.go b/github/github-accessors.go index 2f40756f258..91743340536 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -4246,6 +4246,14 @@ func (d *DependabotAlert) GetNumber() int { return *d.Number } +// GetRepository returns the Repository field. +func (d *DependabotAlert) GetRepository() *Repository { + if d == nil { + return nil + } + return d.Repository +} + // GetSecurityAdvisory returns the SecurityAdvisory field. func (d *DependabotAlert) GetSecurityAdvisory() *DependabotSecurityAdvisory { if d == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 0a5d3a6e69c..8f7292d7b04 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -4984,6 +4984,13 @@ func TestDependabotAlert_GetNumber(tt *testing.T) { d.GetNumber() } +func TestDependabotAlert_GetRepository(tt *testing.T) { + d := &DependabotAlert{} + d.GetRepository() + d = nil + d.GetRepository() +} + func TestDependabotAlert_GetSecurityAdvisory(tt *testing.T) { d := &DependabotAlert{} d.GetSecurityAdvisory() From 1b6f3a38bfe4ec346f64f5fc66cba5e4f254e94a Mon Sep 17 00:00:00 2001 From: James Maguire Date: Tue, 2 May 2023 15:37:53 +0200 Subject: [PATCH 225/751] Add omitempty to CreateOrgInvitationOptions fields (#2778) Fixes: #2777. --- github/orgs_members.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/github/orgs_members.go b/github/orgs_members.go index 38f43bad5a7..79f8a653333 100644 --- a/github/orgs_members.go +++ b/github/orgs_members.go @@ -315,8 +315,8 @@ type CreateOrgInvitationOptions struct { // * billing_manager - Non-owner organization members with ability to // manage the billing settings of your organization. // Default is "direct_member". - Role *string `json:"role"` - TeamID []int64 `json:"team_ids"` + Role *string `json:"role,omitempty"` + TeamID []int64 `json:"team_ids,omitempty"` } // CreateOrgInvitation invites people to an organization by using their GitHub user ID or their email address. From 0b2f91c92505430099a1ce6a64bcba32a6f33a59 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 May 2023 16:51:21 -0400 Subject: [PATCH 226/751] Bump golang.org/x/net from 0.9.0 to 0.10.0 in /scrape (#2779) --- scrape/go.mod | 2 +- scrape/go.sum | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 23cbb252b7e..bf06bfa0eb9 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -7,5 +7,5 @@ require ( github.com/google/go-cmp v0.5.9 github.com/google/go-github/v52 v52.0.0 github.com/xlzd/gotp v0.1.0 - golang.org/x/net v0.9.0 + golang.org/x/net v0.10.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index 8f37dfe0efa..1739f99b0ee 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -38,8 +38,9 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= +golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -54,13 +55,15 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= From 279eacf9c3d6182f03ba87bf8c888ccfe9b03bef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 May 2023 16:48:57 -0400 Subject: [PATCH 227/751] Bump github.com/cloudflare/circl from 1.1.0 to 1.3.3 (#2780) --- go.mod | 2 +- go.sum | 38 +++++++++++++++++++++++++++++++++++++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index e67d5b47d69..e6d69dd71f8 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( ) require ( - github.com/cloudflare/circl v1.1.0 // indirect + github.com/cloudflare/circl v1.3.3 // indirect github.com/golang/protobuf v1.5.2 // indirect golang.org/x/crypto v0.7.0 // indirect golang.org/x/net v0.9.0 // indirect diff --git a/go.sum b/go.sum index 4692d98b853..a03fa6550d3 100644 --- a/go.sum +++ b/go.sum @@ -1,39 +1,75 @@ +cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/cloudflare/circl v1.1.0 h1:bZgT/A+cikZnKIwn7xL2OBj012Bmvho/o6RpRvv3GKY= +github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= +github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= +github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= 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/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= From 53cecba74977e731450e47e64fae459021570b73 Mon Sep 17 00:00:00 2001 From: Gal Ofri Date: Sun, 14 May 2023 14:34:50 +0300 Subject: [PATCH 228/751] Support x-ratelimit-reset handling for secondary rate limits (#2775) --- example/go.mod | 14 +++++----- example/go.sum | 12 +++++++++ github/github.go | 34 ++++++++++++++++++----- github/github_test.go | 63 +++++++++++++++++++++++++++++++++++++++++-- 4 files changed, 107 insertions(+), 16 deletions(-) diff --git a/example/go.mod b/example/go.mod index 144f51b5e40..d5a970e67a0 100644 --- a/example/go.mod +++ b/example/go.mod @@ -4,21 +4,21 @@ go 1.17 require ( github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 - github.com/gofri/go-github-ratelimit v1.0.1 + github.com/gofri/go-github-ratelimit v1.0.3 github.com/google/go-github/v52 v52.0.0 - golang.org/x/crypto v0.1.0 - golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be + golang.org/x/crypto v0.7.0 + golang.org/x/oauth2 v0.7.0 google.golang.org/appengine v1.6.7 ) require ( github.com/golang-jwt/jwt/v4 v4.0.0 // indirect - github.com/golang/protobuf v1.3.2 // indirect + github.com/golang/protobuf v1.5.2 // indirect github.com/google/go-github/v41 v41.0.0 // indirect github.com/google/go-querystring v1.1.0 // indirect - golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/term v0.5.0 // indirect + golang.org/x/net v0.9.0 // indirect + golang.org/x/sys v0.7.0 // indirect + golang.org/x/term v0.7.0 // indirect ) // Use version at HEAD, not the latest published. diff --git a/example/go.sum b/example/go.sum index 71e7a992a3a..f231e169888 100644 --- a/example/go.sum +++ b/example/go.sum @@ -2,12 +2,17 @@ github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 h1:tXKVfhE7FcSkhkv0UwkLvPDeZ4k github.com/bradleyfalzon/ghinstallation/v2 v2.0.4/go.mod h1:B40qPqJxWE0jDZgOR1JmaMy+4AY1eBP+IByOvqyAKp0= github.com/gofri/go-github-ratelimit v1.0.1 h1:sgefSzxhnvwZ+wR9uZ4l9TnjgLuNiwipJVzJL4YLj9A= github.com/gofri/go-github-ratelimit v1.0.1/go.mod h1:OnCi5gV+hAG/LMR7llGhU7yHt44se9sYgKPnafoL7RY= +github.com/gofri/go-github-ratelimit v1.0.3 h1:Ocs2jaYokZDzgvqaajX+g04dqFyVqL0JQzoO7d2wmlk= +github.com/gofri/go-github-ratelimit v1.0.3/go.mod h1:OnCi5gV+hAG/LMR7llGhU7yHt44se9sYgKPnafoL7RY= github.com/golang-jwt/jwt/v4 v4.0.0 h1:RAqyYixv1p7uEnocuy8P1nru5wprCh/MH2BIlW5z5/o= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -21,6 +26,7 @@ golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= +golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -29,8 +35,10 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -41,11 +49,13 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -59,3 +69,5 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= diff --git a/github/github.go b/github/github.go index 2127a527acb..4170719a387 100644 --- a/github/github.go +++ b/github/github.go @@ -40,6 +40,7 @@ const ( headerRateRemaining = "X-RateLimit-Remaining" headerRateReset = "X-RateLimit-Reset" headerOTP = "X-GitHub-OTP" + headerRetryAfter = "Retry-After" headerTokenExpiration = "GitHub-Authentication-Token-Expiration" @@ -677,6 +678,30 @@ func parseRate(r *http.Response) Rate { return rate } +// parseSecondaryRate parses the secondary rate related headers, +// and returns the time to retry after. +func parseSecondaryRate(r *http.Response) *time.Duration { + // According to GitHub support, the "Retry-After" header value will be + // an integer which represents the number of seconds that one should + // wait before resuming making requests. + if v := r.Header.Get(headerRetryAfter); v != "" { + retryAfterSeconds, _ := strconv.ParseInt(v, 10, 64) // Error handling is noop. + retryAfter := time.Duration(retryAfterSeconds) * time.Second + return &retryAfter + } + + // According to GitHub support, endpoints might return x-ratelimit-reset instead, + // as an integer which represents the number of seconds since epoch UTC, + // represting the time to resume making requests. + if v := r.Header.Get(headerRateReset); v != "" { + secondsSinceEpoch, _ := strconv.ParseInt(v, 10, 64) // Error handling is noop. + retryAfter := time.Until(time.Unix(secondsSinceEpoch, 0)) + return &retryAfter + } + + return nil +} + // parseTokenExpiration parses the TokenExpiration related headers. // Returns 0001-01-01 if the header is not defined or could not be parsed. func parseTokenExpiration(r *http.Response) Timestamp { @@ -1156,13 +1181,8 @@ func CheckResponse(r *http.Response) error { Response: errorResponse.Response, Message: errorResponse.Message, } - if v := r.Header["Retry-After"]; len(v) > 0 { - // According to GitHub support, the "Retry-After" header value will be - // an integer which represents the number of seconds that one should - // wait before resuming making requests. - retryAfterSeconds, _ := strconv.ParseInt(v[0], 10, 64) // Error handling is noop. - retryAfter := time.Duration(retryAfterSeconds) * time.Second - abuseRateLimitError.RetryAfter = &retryAfter + if retryAfter := parseSecondaryRate(r); retryAfter != nil { + abuseRateLimitError.RetryAfter = retryAfter } return abuseRateLimitError default: diff --git a/github/github_test.go b/github/github_test.go index 9c40728f4d6..2f92d3baa07 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -17,6 +17,7 @@ import ( "os" "path" "reflect" + "strconv" "strings" "testing" "time" @@ -1475,14 +1476,14 @@ func TestDo_rateLimit_abuseRateLimitErrorEnterprise(t *testing.T) { } } -// Ensure *AbuseRateLimitError.RetryAfter is parsed correctly. +// Ensure *AbuseRateLimitError.RetryAfter is parsed correctly for the Retry-After header. func TestDo_rateLimit_abuseRateLimitError_retryAfter(t *testing.T) { client, mux, _, teardown := setup() defer teardown() mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=utf-8") - w.Header().Set("Retry-After", "123") // Retry after value of 123 seconds. + w.Header().Set(headerRetryAfter, "123") // Retry after value of 123 seconds. w.WriteHeader(http.StatusForbidden) fmt.Fprintln(w, `{ "message": "You have triggered an abuse detection mechanism ...", @@ -1528,6 +1529,64 @@ func TestDo_rateLimit_abuseRateLimitError_retryAfter(t *testing.T) { } } +// Ensure *AbuseRateLimitError.RetryAfter is parsed correctly for the x-ratelimit-reset header. +func TestDo_rateLimit_abuseRateLimitError_xRateLimitReset(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + // x-ratelimit-reset value of 123 seconds into the future. + blockUntil := time.Now().Add(time.Duration(123) * time.Second).Unix() + + mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=utf-8") + w.Header().Set(headerRateReset, strconv.Itoa(int(blockUntil))) + w.Header().Set(headerRateRemaining, "1") // set remaining to a value > 0 to distinct from a primary rate limit + w.WriteHeader(http.StatusForbidden) + fmt.Fprintln(w, `{ + "message": "You have triggered an abuse detection mechanism ...", + "documentation_url": "https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits" +}`) + }) + + req, _ := client.NewRequest("GET", ".", nil) + ctx := context.Background() + _, err := client.Do(ctx, req, nil) + + if err == nil { + t.Error("Expected error to be returned.") + } + abuseRateLimitErr, ok := err.(*AbuseRateLimitError) + if !ok { + t.Fatalf("Expected a *AbuseRateLimitError error; got %#v.", err) + } + if abuseRateLimitErr.RetryAfter == nil { + t.Fatalf("abuseRateLimitErr RetryAfter is nil, expected not-nil") + } + // the retry after value might be a bit smaller than the original duration because the duration is calculated from the expected end-of-cooldown time + if got, want := *abuseRateLimitErr.RetryAfter, 123*time.Second; want-got > 1*time.Second { + t.Errorf("abuseRateLimitErr RetryAfter = %v, want %v", got, want) + } + + // expect prevention of a following request + if _, err = client.Do(ctx, req, nil); err == nil { + t.Error("Expected error to be returned.") + } + abuseRateLimitErr, ok = err.(*AbuseRateLimitError) + if !ok { + t.Fatalf("Expected a *AbuseRateLimitError error; got %#v.", err) + } + if abuseRateLimitErr.RetryAfter == nil { + t.Fatalf("abuseRateLimitErr RetryAfter is nil, expected not-nil") + } + // the saved duration might be a bit smaller than Retry-After because the duration is calculated from the expected end-of-cooldown time + if got, want := *abuseRateLimitErr.RetryAfter, 123*time.Second; want-got > 1*time.Second { + t.Errorf("abuseRateLimitErr RetryAfter = %v, want %v", got, want) + } + if got, wantSuffix := abuseRateLimitErr.Message, "not making remote request."; !strings.HasSuffix(got, wantSuffix) { + t.Errorf("Expected request to be prevented because of secondary rate limit, got: %v.", got) + } +} + func TestDo_noContent(t *testing.T) { client, mux, _, teardown := setup() defer teardown() From 21df6e0800e5c8f075472c3ec3236dd509112198 Mon Sep 17 00:00:00 2001 From: Bo Huang Date: Sun, 14 May 2023 07:36:26 -0400 Subject: [PATCH 229/751] Support deployment protection rule event type (#2773) Fixes: #2774. --- github/event.go | 2 + github/event_types.go | 19 ++ github/event_types_test.go | 385 ++++++++++++++++++++++++++++++++ github/github-accessors.go | 72 ++++++ github/github-accessors_test.go | 75 +++++++ github/messages.go | 1 + github/messages_test.go | 4 + 7 files changed, 558 insertions(+) diff --git a/github/event.go b/github/event.go index 1aabf13bade..20907a99321 100644 --- a/github/event.go +++ b/github/event.go @@ -49,6 +49,8 @@ func (e *Event) ParsePayload() (payload interface{}, err error) { payload = &DeployKeyEvent{} case "DeploymentEvent": payload = &DeploymentEvent{} + case "DeploymentProtectionRuleEvent": + payload = &DeploymentProtectionRuleEvent{} case "DeploymentStatusEvent": payload = &DeploymentStatusEvent{} case "DiscussionEvent": diff --git a/github/event_types.go b/github/event_types.go index 685e46f0287..6a13b286bd2 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -173,6 +173,25 @@ type DeploymentEvent struct { Installation *Installation `json:"installation,omitempty"` } +// DeploymentProtectionRuleEvent represents a deployment protection rule event. +// The Webhook event name is "deployment_protection_rule". +// +// GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#deployment_protection_rule +type DeploymentProtectionRuleEvent struct { + Action *string `json:"action,omitempty"` + Environment *string `json:"environment,omitempty"` + Event *string `json:"event,omitempty"` + + // The URL Github provides for a third-party to use in order to pass/fail a deployment gate + DeploymentCallbackURL *string `json:"deployment_callback_url,omitempty"` + Deployment *Deployment `json:"deployment,omitempty"` + Repo *Repository `json:"repository,omitempty"` + Organization *Organization `json:"organization,omitempty"` + PullRequests []*PullRequest `json:"pull_requests,omitempty"` + Sender *User `json:"sender,omitempty"` + Installation *Installation `json:"installation,omitempty"` +} + // DeploymentStatusEvent represents a deployment status. // The Webhook event name is "deployment_status". // diff --git a/github/event_types_test.go b/github/event_types_test.go index cdbaee5542b..db284036e3f 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -5483,6 +5483,391 @@ func TestDeploymentEvent_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } +func TestDeploymentProtectionRuleEvent_Marshal(t *testing.T) { + testJSONMarshal(t, &DeploymentProtectionRuleEvent{}, "{}") + + l := make(map[string]interface{}) + l["key"] = "value" + + jsonMsg, _ := json.Marshal(&l) + + u := &DeploymentProtectionRuleEvent{ + Action: String("a"), + Environment: String("e"), + DeploymentCallbackURL: String("b"), + Deployment: &Deployment{ + URL: String("url"), + ID: Int64(1), + SHA: String("sha"), + Ref: String("ref"), + Task: String("t"), + Payload: jsonMsg, + Environment: String("e"), + Description: String("d"), + Creator: &User{ + Login: String("l"), + ID: Int64(1), + NodeID: String("n"), + URL: String("u"), + ReposURL: String("r"), + EventsURL: String("e"), + AvatarURL: String("a"), + }, + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + StatusesURL: String("surl"), + RepositoryURL: String("rurl"), + NodeID: String("nid"), + }, + Repo: &Repository{ + ID: Int64(1), + URL: String("s"), + Name: String("n"), + }, + Organization: &Organization{ + BillingEmail: String("be"), + Blog: String("b"), + Company: String("c"), + Email: String("e"), + TwitterUsername: String("tu"), + Location: String("loc"), + Name: String("n"), + Description: String("d"), + IsVerified: Bool(true), + HasOrganizationProjects: Bool(true), + HasRepositoryProjects: Bool(true), + DefaultRepoPermission: String("drp"), + MembersCanCreateRepos: Bool(true), + MembersCanCreateInternalRepos: Bool(true), + MembersCanCreatePrivateRepos: Bool(true), + MembersCanCreatePublicRepos: Bool(false), + MembersAllowedRepositoryCreationType: String("marct"), + MembersCanCreatePages: Bool(true), + MembersCanCreatePublicPages: Bool(false), + MembersCanCreatePrivatePages: Bool(true), + }, + PullRequests: []*PullRequest{ + { + URL: String("u"), + ID: Int64(1), + Number: Int(1), + Head: &PullRequestBranch{ + Ref: String("r"), + SHA: String("s"), + Repo: &Repository{ + ID: Int64(1), + URL: String("s"), + Name: String("n"), + }, + }, + Base: &PullRequestBranch{ + Ref: String("r"), + SHA: String("s"), + Repo: &Repository{ + ID: Int64(1), + URL: String("u"), + Name: String("n"), + }, + }, + }, + }, + Sender: &User{ + Login: String("l"), + ID: Int64(1), + NodeID: String("n"), + URL: String("u"), + ReposURL: String("r"), + EventsURL: String("e"), + AvatarURL: String("a"), + }, + Installation: &Installation{ + ID: Int64(1), + NodeID: String("nid"), + AppID: Int64(1), + AppSlug: String("as"), + TargetID: Int64(1), + Account: &User{ + Login: String("l"), + ID: Int64(1), + URL: String("u"), + AvatarURL: String("a"), + GravatarID: String("g"), + Name: String("n"), + Company: String("c"), + Blog: String("b"), + Location: String("l"), + Email: String("e"), + Hireable: Bool(true), + Bio: String("b"), + TwitterUsername: String("t"), + PublicRepos: Int(1), + Followers: Int(1), + Following: Int(1), + CreatedAt: &Timestamp{referenceTime}, + SuspendedAt: &Timestamp{referenceTime}, + }, + AccessTokensURL: String("atu"), + RepositoriesURL: String("ru"), + HTMLURL: String("hu"), + TargetType: String("tt"), + SingleFileName: String("sfn"), + RepositorySelection: String("rs"), + Events: []string{"e"}, + SingleFilePaths: []string{"s"}, + Permissions: &InstallationPermissions{ + Actions: String("a"), + Administration: String("ad"), + Checks: String("c"), + Contents: String("co"), + ContentReferences: String("cr"), + Deployments: String("d"), + Environments: String("e"), + Issues: String("i"), + Metadata: String("md"), + Members: String("m"), + OrganizationAdministration: String("oa"), + OrganizationHooks: String("oh"), + OrganizationPlan: String("op"), + OrganizationPreReceiveHooks: String("opr"), + OrganizationProjects: String("op"), + OrganizationSecrets: String("os"), + OrganizationSelfHostedRunners: String("osh"), + OrganizationUserBlocking: String("oub"), + Packages: String("pkg"), + Pages: String("pg"), + PullRequests: String("pr"), + RepositoryHooks: String("rh"), + RepositoryProjects: String("rp"), + RepositoryPreReceiveHooks: String("rprh"), + Secrets: String("s"), + SecretScanningAlerts: String("ssa"), + SecurityEvents: String("se"), + SingleFile: String("sf"), + Statuses: String("s"), + TeamDiscussions: String("td"), + VulnerabilityAlerts: String("va"), + Workflows: String("w"), + }, + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + HasMultipleSingleFiles: Bool(false), + SuspendedBy: &User{ + Login: String("l"), + ID: Int64(1), + URL: String("u"), + AvatarURL: String("a"), + GravatarID: String("g"), + Name: String("n"), + Company: String("c"), + Blog: String("b"), + Location: String("l"), + Email: String("e"), + Hireable: Bool(true), + Bio: String("b"), + TwitterUsername: String("t"), + PublicRepos: Int(1), + Followers: Int(1), + Following: Int(1), + CreatedAt: &Timestamp{referenceTime}, + SuspendedAt: &Timestamp{referenceTime}, + }, + SuspendedAt: &Timestamp{referenceTime}, + }, + } + + want := `{ + "action": "a", + "environment": "e", + "deployment_callback_url": "b", + "deployment": { + "url": "url", + "id": 1, + "sha": "sha", + "ref": "ref", + "task": "t", + "payload": { + "key": "value" + }, + "environment": "e", + "description": "d", + "creator": { + "login": "l", + "id": 1, + "node_id": "n", + "avatar_url": "a", + "url": "u", + "events_url": "e", + "repos_url": "r" + }, + "created_at": ` + referenceTimeStr + `, + "updated_at": ` + referenceTimeStr + `, + "statuses_url": "surl", + "repository_url": "rurl", + "node_id": "nid" + }, + "repository": { + "id": 1, + "name": "n", + "url": "s" + }, + "organization": { + "name": "n", + "company": "c", + "blog": "b", + "location": "loc", + "email": "e", + "twitter_username": "tu", + "description": "d", + "billing_email": "be", + "is_verified": true, + "has_organization_projects": true, + "has_repository_projects": true, + "default_repository_permission": "drp", + "members_can_create_repositories": true, + "members_can_create_public_repositories": false, + "members_can_create_private_repositories": true, + "members_can_create_internal_repositories": true, + "members_allowed_repository_creation_type": "marct", + "members_can_create_pages": true, + "members_can_create_public_pages": false, + "members_can_create_private_pages": true + }, + "pull_requests": [ + { + "id": 1, + "number": 1, + "url": "u", + "head": { + "ref": "r", + "sha": "s", + "repo": { + "id": 1, + "name": "n", + "url": "s" + } + }, + "base": { + "ref": "r", + "sha": "s", + "repo": { + "id": 1, + "name": "n", + "url": "u" + } + } + } + ], + "sender": { + "login": "l", + "id": 1, + "node_id": "n", + "avatar_url": "a", + "url": "u", + "events_url": "e", + "repos_url": "r" + }, + "installation": { + "id": 1, + "node_id": "nid", + "app_id": 1, + "app_slug": "as", + "target_id": 1, + "account": { + "login": "l", + "id": 1, + "avatar_url": "a", + "gravatar_id": "g", + "name": "n", + "company": "c", + "blog": "b", + "location": "l", + "email": "e", + "hireable": true, + "bio": "b", + "twitter_username": "t", + "public_repos": 1, + "followers": 1, + "following": 1, + "created_at": ` + referenceTimeStr + `, + "suspended_at": ` + referenceTimeStr + `, + "url": "u" + }, + "access_tokens_url": "atu", + "repositories_url": "ru", + "html_url": "hu", + "target_type": "tt", + "single_file_name": "sfn", + "repository_selection": "rs", + "events": [ + "e" + ], + "single_file_paths": [ + "s" + ], + "permissions": { + "actions": "a", + "administration": "ad", + "checks": "c", + "contents": "co", + "content_references": "cr", + "deployments": "d", + "environments": "e", + "issues": "i", + "metadata": "md", + "members": "m", + "organization_administration": "oa", + "organization_hooks": "oh", + "organization_plan": "op", + "organization_pre_receive_hooks": "opr", + "organization_projects": "op", + "organization_secrets": "os", + "organization_self_hosted_runners": "osh", + "organization_user_blocking": "oub", + "packages": "pkg", + "pages": "pg", + "pull_requests": "pr", + "repository_hooks": "rh", + "repository_projects": "rp", + "repository_pre_receive_hooks": "rprh", + "secrets": "s", + "secret_scanning_alerts": "ssa", + "security_events": "se", + "single_file": "sf", + "statuses": "s", + "team_discussions": "td", + "vulnerability_alerts": "va", + "workflows": "w" + }, + "created_at": ` + referenceTimeStr + `, + "updated_at": ` + referenceTimeStr + `, + "has_multiple_single_files": false, + "suspended_by": { + "login": "l", + "id": 1, + "avatar_url": "a", + "gravatar_id": "g", + "name": "n", + "company": "c", + "blog": "b", + "location": "l", + "email": "e", + "hireable": true, + "bio": "b", + "twitter_username": "t", + "public_repos": 1, + "followers": 1, + "following": 1, + "created_at": ` + referenceTimeStr + `, + "suspended_at": ` + referenceTimeStr + `, + "url": "u" + }, + "suspended_at": ` + referenceTimeStr + ` + } + }` + + testJSONMarshal(t, u, want) +} + func TestDeploymentStatusEvent_Marshal(t *testing.T) { testJSONMarshal(t, &DeploymentStatusEvent{}, "{}") diff --git a/github/github-accessors.go b/github/github-accessors.go index 91743340536..7fa63d8f4b0 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -4614,6 +4614,78 @@ func (d *DeploymentEvent) GetSender() *User { return d.Sender } +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (d *DeploymentProtectionRuleEvent) GetAction() string { + if d == nil || d.Action == nil { + return "" + } + return *d.Action +} + +// GetDeployment returns the Deployment field. +func (d *DeploymentProtectionRuleEvent) GetDeployment() *Deployment { + if d == nil { + return nil + } + return d.Deployment +} + +// GetDeploymentCallbackURL returns the DeploymentCallbackURL field if it's non-nil, zero value otherwise. +func (d *DeploymentProtectionRuleEvent) GetDeploymentCallbackURL() string { + if d == nil || d.DeploymentCallbackURL == nil { + return "" + } + return *d.DeploymentCallbackURL +} + +// GetEnvironment returns the Environment field if it's non-nil, zero value otherwise. +func (d *DeploymentProtectionRuleEvent) GetEnvironment() string { + if d == nil || d.Environment == nil { + return "" + } + return *d.Environment +} + +// GetEvent returns the Event field if it's non-nil, zero value otherwise. +func (d *DeploymentProtectionRuleEvent) GetEvent() string { + if d == nil || d.Event == nil { + return "" + } + return *d.Event +} + +// GetInstallation returns the Installation field. +func (d *DeploymentProtectionRuleEvent) GetInstallation() *Installation { + if d == nil { + return nil + } + return d.Installation +} + +// GetOrganization returns the Organization field. +func (d *DeploymentProtectionRuleEvent) GetOrganization() *Organization { + if d == nil { + return nil + } + return d.Organization +} + +// GetRepo returns the Repo field. +func (d *DeploymentProtectionRuleEvent) GetRepo() *Repository { + if d == nil { + return nil + } + return d.Repo +} + +// GetSender returns the Sender field. +func (d *DeploymentProtectionRuleEvent) GetSender() *User { + if d == nil { + return nil + } + return d.Sender +} + // GetAutoMerge returns the AutoMerge field if it's non-nil, zero value otherwise. func (d *DeploymentRequest) GetAutoMerge() bool { if d == nil || d.AutoMerge == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 8f7292d7b04..d64b9fa3969 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -5399,6 +5399,81 @@ func TestDeploymentEvent_GetSender(tt *testing.T) { d.GetSender() } +func TestDeploymentProtectionRuleEvent_GetAction(tt *testing.T) { + var zeroValue string + d := &DeploymentProtectionRuleEvent{Action: &zeroValue} + d.GetAction() + d = &DeploymentProtectionRuleEvent{} + d.GetAction() + d = nil + d.GetAction() +} + +func TestDeploymentProtectionRuleEvent_GetDeployment(tt *testing.T) { + d := &DeploymentProtectionRuleEvent{} + d.GetDeployment() + d = nil + d.GetDeployment() +} + +func TestDeploymentProtectionRuleEvent_GetDeploymentCallbackURL(tt *testing.T) { + var zeroValue string + d := &DeploymentProtectionRuleEvent{DeploymentCallbackURL: &zeroValue} + d.GetDeploymentCallbackURL() + d = &DeploymentProtectionRuleEvent{} + d.GetDeploymentCallbackURL() + d = nil + d.GetDeploymentCallbackURL() +} + +func TestDeploymentProtectionRuleEvent_GetEnvironment(tt *testing.T) { + var zeroValue string + d := &DeploymentProtectionRuleEvent{Environment: &zeroValue} + d.GetEnvironment() + d = &DeploymentProtectionRuleEvent{} + d.GetEnvironment() + d = nil + d.GetEnvironment() +} + +func TestDeploymentProtectionRuleEvent_GetEvent(tt *testing.T) { + var zeroValue string + d := &DeploymentProtectionRuleEvent{Event: &zeroValue} + d.GetEvent() + d = &DeploymentProtectionRuleEvent{} + d.GetEvent() + d = nil + d.GetEvent() +} + +func TestDeploymentProtectionRuleEvent_GetInstallation(tt *testing.T) { + d := &DeploymentProtectionRuleEvent{} + d.GetInstallation() + d = nil + d.GetInstallation() +} + +func TestDeploymentProtectionRuleEvent_GetOrganization(tt *testing.T) { + d := &DeploymentProtectionRuleEvent{} + d.GetOrganization() + d = nil + d.GetOrganization() +} + +func TestDeploymentProtectionRuleEvent_GetRepo(tt *testing.T) { + d := &DeploymentProtectionRuleEvent{} + d.GetRepo() + d = nil + d.GetRepo() +} + +func TestDeploymentProtectionRuleEvent_GetSender(tt *testing.T) { + d := &DeploymentProtectionRuleEvent{} + d.GetSender() + d = nil + d.GetSender() +} + func TestDeploymentRequest_GetAutoMerge(tt *testing.T) { var zeroValue bool d := &DeploymentRequest{AutoMerge: &zeroValue} diff --git a/github/messages.go b/github/messages.go index 925e73e9a67..8547b8810f8 100644 --- a/github/messages.go +++ b/github/messages.go @@ -55,6 +55,7 @@ var ( "deploy_key": "DeployKeyEvent", "deployment": "DeploymentEvent", "deployment_status": "DeploymentStatusEvent", + "deployment_protection_rule": "DeploymentProtectionRuleEvent", "discussion": "DiscussionEvent", "discussion_comment": "DiscussionCommentEvent", "fork": "ForkEvent", diff --git a/github/messages_test.go b/github/messages_test.go index 04f29420402..8dbb0fdf996 100644 --- a/github/messages_test.go +++ b/github/messages_test.go @@ -292,6 +292,10 @@ func TestParseWebHook(t *testing.T) { payload: &DeploymentEvent{}, messageType: "deployment", }, + { + payload: &DeploymentProtectionRuleEvent{}, + messageType: "deployment_protection_rule", + }, { payload: &DeploymentStatusEvent{}, messageType: "deployment_status", From 60429b4ba0ba8b8477afee6e82e12d809bd9196f Mon Sep 17 00:00:00 2001 From: keita ogawa <47840908+olibaa@users.noreply.github.com> Date: Sun, 14 May 2023 20:36:59 +0900 Subject: [PATCH 230/751] Support array type in go generate with whitelist (#2776) Fixes: #2425. --- github/gen-accessors.go | 33 +++++++++++++++++++++++++++------ github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ 3 files changed, 45 insertions(+), 6 deletions(-) diff --git a/github/gen-accessors.go b/github/gen-accessors.go index b222465f39f..4bc22acdc15 100644 --- a/github/gen-accessors.go +++ b/github/gen-accessors.go @@ -51,6 +51,11 @@ var ( skipStructs = map[string]bool{ "Client": true, } + + // whitelistSliceGetters lists "struct.field" to add getter method + whitelistSliceGetters = map[string]bool{ + "PushEvent.Commits": true, + } ) func logf(fmt string, args ...interface{}) { @@ -137,6 +142,12 @@ func (t *templateData) processAST(f *ast.File) error { case *ast.MapType: t.addMapType(x, ts.Name.String(), fieldName.String(), false) continue + case *ast.ArrayType: + if key := fmt.Sprintf("%v.%v", ts.Name, fieldName); whitelistSliceGetters[key] { + logf("Method %v is whitelist; adding getter method.", key) + t.addArrayType(x, ts.Name.String(), fieldName.String(), false) + continue + } } logf("Skipping field type %T, fieldName=%v", field.Type, fieldName) @@ -145,7 +156,7 @@ func (t *templateData) processAST(f *ast.File) error { switch x := se.X.(type) { case *ast.ArrayType: - t.addArrayType(x, ts.Name.String(), fieldName.String()) + t.addArrayType(x, ts.Name.String(), fieldName.String(), true) case *ast.Ident: t.addIdent(x, ts.Name.String(), fieldName.String()) case *ast.MapType: @@ -218,17 +229,26 @@ func newGetter(receiverType, fieldName, fieldType, zeroValue string, namedStruct } } -func (t *templateData) addArrayType(x *ast.ArrayType, receiverType, fieldName string) { +func (t *templateData) addArrayType(x *ast.ArrayType, receiverType, fieldName string, isAPointer bool) { var eltType string + var ng *getter switch elt := x.Elt.(type) { case *ast.Ident: eltType = elt.String() + ng = newGetter(receiverType, fieldName, "[]"+eltType, "nil", false) + case *ast.StarExpr: + ident, ok := elt.X.(*ast.Ident) + if !ok { + return + } + ng = newGetter(receiverType, fieldName, "[]*"+ident.String(), "nil", false) default: logf("addArrayType: type %q, field %q: unknown elt type: %T %+v; skipping.", receiverType, fieldName, elt, elt) return } - t.Getters = append(t.Getters, newGetter(receiverType, fieldName, "[]"+eltType, "nil", false)) + ng.ArrayType = !isAPointer + t.Getters = append(t.Getters, ng) } func (t *templateData) addIdent(x *ast.Ident, receiverType, fieldName string) { @@ -322,6 +342,7 @@ type getter struct { ZeroValue string NamedStruct bool // Getter for named struct. MapType bool + ArrayType bool } type byName []*getter @@ -356,8 +377,8 @@ func ({{.ReceiverVar}} *{{.ReceiverType}}) Get{{.FieldName}}() *{{.FieldType}} { } return {{.ReceiverVar}}.{{.FieldName}} } -{{else if .MapType}} -// Get{{.FieldName}} returns the {{.FieldName}} map if it's non-nil, an empty map otherwise. +{{else if or .MapType .ArrayType }} +// Get{{.FieldName}} returns the {{.FieldName}} {{if .MapType}}map{{else if .ArrayType }}slice{{end}} if it's non-nil, {{if .MapType}}an empty map{{else if .ArrayType }}nil{{end}} otherwise. func ({{.ReceiverVar}} *{{.ReceiverType}}) Get{{.FieldName}}() {{.FieldType}} { if {{.ReceiverVar}} == nil || {{.ReceiverVar}}.{{.FieldName}} == nil { return {{.ZeroValue}} @@ -402,7 +423,7 @@ func Test{{.ReceiverType}}_Get{{.FieldName}}(tt *testing.T) { {{.ReceiverVar}} = nil {{.ReceiverVar}}.Get{{.FieldName}}() } -{{else if .MapType}} +{{else if or .MapType .ArrayType}} func Test{{.ReceiverType}}_Get{{.FieldName}}(tt *testing.T) { zeroValue := {{.FieldType}}{} {{.ReceiverVar}} := &{{.ReceiverType}}{ {{.FieldName}}: zeroValue } diff --git a/github/github-accessors.go b/github/github-accessors.go index 7fa63d8f4b0..6e5a089c9fd 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -15126,6 +15126,14 @@ func (p *PushEvent) GetBefore() string { return *p.Before } +// GetCommits returns the Commits slice if it's non-nil, nil otherwise. +func (p *PushEvent) GetCommits() []*HeadCommit { + if p == nil || p.Commits == nil { + return nil + } + return p.Commits +} + // GetCompare returns the Compare field if it's non-nil, zero value otherwise. func (p *PushEvent) GetCompare() string { if p == nil || p.Compare == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index d64b9fa3969..8d6c6a4d82c 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -17552,6 +17552,16 @@ func TestPushEvent_GetBefore(tt *testing.T) { p.GetBefore() } +func TestPushEvent_GetCommits(tt *testing.T) { + zeroValue := []*HeadCommit{} + p := &PushEvent{Commits: zeroValue} + p.GetCommits() + p = &PushEvent{} + p.GetCommits() + p = nil + p.GetCommits() +} + func TestPushEvent_GetCompare(tt *testing.T) { var zeroValue string p := &PushEvent{Compare: &zeroValue} From da7dd5edcbdaaf1af81a8970f13c306a88e3d0f8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 May 2023 16:05:38 -0400 Subject: [PATCH 231/751] Bump golang.org/x/oauth2 from 0.7.0 to 0.8.0 (#2781) --- go.mod | 6 +++--- go.sum | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index e6d69dd71f8..a214a4bae29 100644 --- a/go.mod +++ b/go.mod @@ -4,15 +4,15 @@ require ( github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 github.com/google/go-cmp v0.5.9 github.com/google/go-querystring v1.1.0 - golang.org/x/oauth2 v0.7.0 + golang.org/x/oauth2 v0.8.0 ) require ( github.com/cloudflare/circl v1.3.3 // indirect github.com/golang/protobuf v1.5.2 // indirect golang.org/x/crypto v0.7.0 // indirect - golang.org/x/net v0.9.0 // indirect - golang.org/x/sys v0.7.0 // indirect + golang.org/x/net v0.10.0 // indirect + golang.org/x/sys v0.8.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.28.0 // indirect ) diff --git a/go.sum b/go.sum index a03fa6550d3..4acfb42fa06 100644 --- a/go.sum +++ b/go.sum @@ -32,10 +32,10 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= -golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= -golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= -golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= +golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8= +golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -49,14 +49,14 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= From dff9dcc41c9c60c776df318d0938c1ad3dc2d2e4 Mon Sep 17 00:00:00 2001 From: Nikolai Kolodziej <7687617+kldzj@users.noreply.github.com> Date: Thu, 18 May 2023 01:50:40 +0200 Subject: [PATCH 232/751] Add test for resource JSON marshaling (#2783) Relates to: #55. --- github/repos_test.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/github/repos_test.go b/github/repos_test.go index e86d80796f8..992ec418749 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -3506,3 +3506,29 @@ func TestRequiredStatusCheck_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestRepositoryTag_Marshal(t *testing.T) { + testJSONMarshal(t, &RepositoryTag{}, "{}") + + u := &RepositoryTag{ + Name: String("v0.1"), + Commit: &Commit{ + SHA: String("sha"), + URL: String("url"), + }, + ZipballURL: String("zball"), + TarballURL: String("tball"), + } + + want := `{ + "name": "v0.1", + "commit": { + "sha": "sha", + "url": "url" + }, + "zipball_url": "zball", + "tarball_url": "tball" + }` + + testJSONMarshal(t, u, want) +} From f96b64ece988554ba6444cb305e6db1132a61454 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 May 2023 16:07:42 -0400 Subject: [PATCH 233/751] Bump codecov/codecov-action from 3.1.3 to 3.1.4 (#2784) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 700cea12fdd..e6a94006958 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -75,7 +75,7 @@ jobs: - name: Upload coverage to Codecov if: ${{ matrix.update-coverage }} - uses: codecov/codecov-action@894ff025c7b54547a9a2a1e9f228beae737ad3c2 #v3.1.3 + uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d #v3.1.4 - name: Ensure go generate produces a zero diff for update-urls shell: bash From f19d239c80bdcfec97da65f4e53d06e8ce5e1a40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrik=20Nordl=C3=A9n?= Date: Wed, 24 May 2023 16:57:55 +0200 Subject: [PATCH 234/751] Add missing fields to AuditEntry (#2786) Fixes: #2785. --- github/github-accessors.go | 152 ++++++++++++++++++++++++++ github/github-accessors_test.go | 187 ++++++++++++++++++++++++++++++++ github/orgs_audit_log.go | 149 +++++++++++++++---------- github/orgs_audit_log_test.go | 186 ++++++++++++++++++++++--------- 4 files changed, 563 insertions(+), 111 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 6e5a089c9fd..f310e42a01e 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -214,6 +214,14 @@ func (a *ActionsVariable) GetVisibility() string { return *a.Visibility } +// GetCountryCode returns the CountryCode field if it's non-nil, zero value otherwise. +func (a *ActorLocation) GetCountryCode() string { + if a == nil || a.CountryCode == nil { + return "" + } + return *a.CountryCode +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (a *AdminEnforcedChanges) GetFrom() bool { if a == nil || a.From == nil { @@ -1038,6 +1046,22 @@ func (a *AuditEntry) GetActor() string { return *a.Actor } +// GetActorIP returns the ActorIP field if it's non-nil, zero value otherwise. +func (a *AuditEntry) GetActorIP() string { + if a == nil || a.ActorIP == nil { + return "" + } + return *a.ActorIP +} + +// GetActorLocation returns the ActorLocation field. +func (a *AuditEntry) GetActorLocation() *ActorLocation { + if a == nil { + return nil + } + return a.ActorLocation +} + // GetBlockedUser returns the BlockedUser field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetBlockedUser() string { if a == nil || a.BlockedUser == nil { @@ -1166,6 +1190,14 @@ func (a *AuditEntry) GetFingerprint() string { return *a.Fingerprint } +// GetHashedToken returns the HashedToken field if it's non-nil, zero value otherwise. +func (a *AuditEntry) GetHashedToken() string { + if a == nil || a.HashedToken == nil { + return "" + } + return *a.HashedToken +} + // GetHeadBranch returns the HeadBranch field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetHeadBranch() string { if a == nil || a.HeadBranch == nil { @@ -1206,6 +1238,14 @@ func (a *AuditEntry) GetJobName() string { return *a.JobName } +// GetJobWorkflowRef returns the JobWorkflowRef field if it's non-nil, zero value otherwise. +func (a *AuditEntry) GetJobWorkflowRef() string { + if a == nil || a.JobWorkflowRef == nil { + return "" + } + return *a.JobWorkflowRef +} + // GetLimitedAvailability returns the LimitedAvailability field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetLimitedAvailability() bool { if a == nil || a.LimitedAvailability == nil { @@ -1230,6 +1270,14 @@ func (a *AuditEntry) GetName() string { return *a.Name } +// GetOAuthApplicationID returns the OAuthApplicationID field if it's non-nil, zero value otherwise. +func (a *AuditEntry) GetOAuthApplicationID() int64 { + if a == nil || a.OAuthApplicationID == nil { + return 0 + } + return *a.OAuthApplicationID +} + // GetOldPermission returns the OldPermission field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetOldPermission() string { if a == nil || a.OldPermission == nil { @@ -1254,6 +1302,14 @@ func (a *AuditEntry) GetOpenSSHPublicKey() string { return *a.OpenSSHPublicKey } +// GetOperationType returns the OperationType field if it's non-nil, zero value otherwise. +func (a *AuditEntry) GetOperationType() string { + if a == nil || a.OperationType == nil { + return "" + } + return *a.OperationType +} + // GetOrg returns the Org field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetOrg() string { if a == nil || a.Org == nil { @@ -1262,6 +1318,14 @@ func (a *AuditEntry) GetOrg() string { return *a.Org } +// GetOrgID returns the OrgID field if it's non-nil, zero value otherwise. +func (a *AuditEntry) GetOrgID() int64 { + if a == nil || a.OrgID == nil { + return 0 + } + return *a.OrgID +} + // GetPermission returns the Permission field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetPermission() string { if a == nil || a.Permission == nil { @@ -1278,6 +1342,38 @@ func (a *AuditEntry) GetPreviousVisibility() string { return *a.PreviousVisibility } +// GetProgrammaticAccessType returns the ProgrammaticAccessType field if it's non-nil, zero value otherwise. +func (a *AuditEntry) GetProgrammaticAccessType() string { + if a == nil || a.ProgrammaticAccessType == nil { + return "" + } + return *a.ProgrammaticAccessType +} + +// GetPullRequestID returns the PullRequestID field if it's non-nil, zero value otherwise. +func (a *AuditEntry) GetPullRequestID() int64 { + if a == nil || a.PullRequestID == nil { + return 0 + } + return *a.PullRequestID +} + +// GetPullRequestTitle returns the PullRequestTitle field if it's non-nil, zero value otherwise. +func (a *AuditEntry) GetPullRequestTitle() string { + if a == nil || a.PullRequestTitle == nil { + return "" + } + return *a.PullRequestTitle +} + +// GetPullRequestURL returns the PullRequestURL field if it's non-nil, zero value otherwise. +func (a *AuditEntry) GetPullRequestURL() string { + if a == nil || a.PullRequestURL == nil { + return "" + } + return *a.PullRequestURL +} + // GetReadOnly returns the ReadOnly field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetReadOnly() string { if a == nil || a.ReadOnly == nil { @@ -1350,6 +1446,14 @@ func (a *AuditEntry) GetRunnerName() string { return *a.RunnerName } +// GetRunNumber returns the RunNumber field if it's non-nil, zero value otherwise. +func (a *AuditEntry) GetRunNumber() int64 { + if a == nil || a.RunNumber == nil { + return 0 + } + return *a.RunNumber +} + // GetSourceVersion returns the SourceVersion field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetSourceVersion() string { if a == nil || a.SourceVersion == nil { @@ -1398,6 +1502,30 @@ func (a *AuditEntry) GetTimestamp() Timestamp { return *a.Timestamp } +// GetTokenID returns the TokenID field if it's non-nil, zero value otherwise. +func (a *AuditEntry) GetTokenID() int64 { + if a == nil || a.TokenID == nil { + return 0 + } + return *a.TokenID +} + +// GetTokenScopes returns the TokenScopes field if it's non-nil, zero value otherwise. +func (a *AuditEntry) GetTokenScopes() string { + if a == nil || a.TokenScopes == nil { + return "" + } + return *a.TokenScopes +} + +// GetTopic returns the Topic field if it's non-nil, zero value otherwise. +func (a *AuditEntry) GetTopic() string { + if a == nil || a.Topic == nil { + return "" + } + return *a.Topic +} + // GetTransportProtocol returns the TransportProtocol field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetTransportProtocol() int { if a == nil || a.TransportProtocol == nil { @@ -1430,6 +1558,14 @@ func (a *AuditEntry) GetUser() string { return *a.User } +// GetUserAgent returns the UserAgent field if it's non-nil, zero value otherwise. +func (a *AuditEntry) GetUserAgent() string { + if a == nil || a.UserAgent == nil { + return "" + } + return *a.UserAgent +} + // GetVisibility returns the Visibility field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetVisibility() string { if a == nil || a.Visibility == nil { @@ -12614,6 +12750,22 @@ func (p *Plan) GetSpace() int { return *p.Space } +// GetCode returns the Code field if it's non-nil, zero value otherwise. +func (p *PolicyOverrideReason) GetCode() string { + if p == nil || p.Code == nil { + return "" + } + return *p.Code +} + +// GetMessage returns the Message field if it's non-nil, zero value otherwise. +func (p *PolicyOverrideReason) GetMessage() string { + if p == nil || p.Message == nil { + return "" + } + return *p.Message +} + // GetConfigURL returns the ConfigURL field if it's non-nil, zero value otherwise. func (p *PreReceiveHook) GetConfigURL() string { if p == nil || p.ConfigURL == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 8d6c6a4d82c..97f3994fc43 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -262,6 +262,16 @@ func TestActionsVariable_GetVisibility(tt *testing.T) { a.GetVisibility() } +func TestActorLocation_GetCountryCode(tt *testing.T) { + var zeroValue string + a := &ActorLocation{CountryCode: &zeroValue} + a.GetCountryCode() + a = &ActorLocation{} + a.GetCountryCode() + a = nil + a.GetCountryCode() +} + func TestAdminEnforcedChanges_GetFrom(tt *testing.T) { var zeroValue bool a := &AdminEnforcedChanges{From: &zeroValue} @@ -1223,6 +1233,23 @@ func TestAuditEntry_GetActor(tt *testing.T) { a.GetActor() } +func TestAuditEntry_GetActorIP(tt *testing.T) { + var zeroValue string + a := &AuditEntry{ActorIP: &zeroValue} + a.GetActorIP() + a = &AuditEntry{} + a.GetActorIP() + a = nil + a.GetActorIP() +} + +func TestAuditEntry_GetActorLocation(tt *testing.T) { + a := &AuditEntry{} + a.GetActorLocation() + a = nil + a.GetActorLocation() +} + func TestAuditEntry_GetBlockedUser(tt *testing.T) { var zeroValue string a := &AuditEntry{BlockedUser: &zeroValue} @@ -1377,6 +1404,16 @@ func TestAuditEntry_GetFingerprint(tt *testing.T) { a.GetFingerprint() } +func TestAuditEntry_GetHashedToken(tt *testing.T) { + var zeroValue string + a := &AuditEntry{HashedToken: &zeroValue} + a.GetHashedToken() + a = &AuditEntry{} + a.GetHashedToken() + a = nil + a.GetHashedToken() +} + func TestAuditEntry_GetHeadBranch(tt *testing.T) { var zeroValue string a := &AuditEntry{HeadBranch: &zeroValue} @@ -1427,6 +1464,16 @@ func TestAuditEntry_GetJobName(tt *testing.T) { a.GetJobName() } +func TestAuditEntry_GetJobWorkflowRef(tt *testing.T) { + var zeroValue string + a := &AuditEntry{JobWorkflowRef: &zeroValue} + a.GetJobWorkflowRef() + a = &AuditEntry{} + a.GetJobWorkflowRef() + a = nil + a.GetJobWorkflowRef() +} + func TestAuditEntry_GetLimitedAvailability(tt *testing.T) { var zeroValue bool a := &AuditEntry{LimitedAvailability: &zeroValue} @@ -1457,6 +1504,16 @@ func TestAuditEntry_GetName(tt *testing.T) { a.GetName() } +func TestAuditEntry_GetOAuthApplicationID(tt *testing.T) { + var zeroValue int64 + a := &AuditEntry{OAuthApplicationID: &zeroValue} + a.GetOAuthApplicationID() + a = &AuditEntry{} + a.GetOAuthApplicationID() + a = nil + a.GetOAuthApplicationID() +} + func TestAuditEntry_GetOldPermission(tt *testing.T) { var zeroValue string a := &AuditEntry{OldPermission: &zeroValue} @@ -1487,6 +1544,16 @@ func TestAuditEntry_GetOpenSSHPublicKey(tt *testing.T) { a.GetOpenSSHPublicKey() } +func TestAuditEntry_GetOperationType(tt *testing.T) { + var zeroValue string + a := &AuditEntry{OperationType: &zeroValue} + a.GetOperationType() + a = &AuditEntry{} + a.GetOperationType() + a = nil + a.GetOperationType() +} + func TestAuditEntry_GetOrg(tt *testing.T) { var zeroValue string a := &AuditEntry{Org: &zeroValue} @@ -1497,6 +1564,16 @@ func TestAuditEntry_GetOrg(tt *testing.T) { a.GetOrg() } +func TestAuditEntry_GetOrgID(tt *testing.T) { + var zeroValue int64 + a := &AuditEntry{OrgID: &zeroValue} + a.GetOrgID() + a = &AuditEntry{} + a.GetOrgID() + a = nil + a.GetOrgID() +} + func TestAuditEntry_GetPermission(tt *testing.T) { var zeroValue string a := &AuditEntry{Permission: &zeroValue} @@ -1517,6 +1594,46 @@ func TestAuditEntry_GetPreviousVisibility(tt *testing.T) { a.GetPreviousVisibility() } +func TestAuditEntry_GetProgrammaticAccessType(tt *testing.T) { + var zeroValue string + a := &AuditEntry{ProgrammaticAccessType: &zeroValue} + a.GetProgrammaticAccessType() + a = &AuditEntry{} + a.GetProgrammaticAccessType() + a = nil + a.GetProgrammaticAccessType() +} + +func TestAuditEntry_GetPullRequestID(tt *testing.T) { + var zeroValue int64 + a := &AuditEntry{PullRequestID: &zeroValue} + a.GetPullRequestID() + a = &AuditEntry{} + a.GetPullRequestID() + a = nil + a.GetPullRequestID() +} + +func TestAuditEntry_GetPullRequestTitle(tt *testing.T) { + var zeroValue string + a := &AuditEntry{PullRequestTitle: &zeroValue} + a.GetPullRequestTitle() + a = &AuditEntry{} + a.GetPullRequestTitle() + a = nil + a.GetPullRequestTitle() +} + +func TestAuditEntry_GetPullRequestURL(tt *testing.T) { + var zeroValue string + a := &AuditEntry{PullRequestURL: &zeroValue} + a.GetPullRequestURL() + a = &AuditEntry{} + a.GetPullRequestURL() + a = nil + a.GetPullRequestURL() +} + func TestAuditEntry_GetReadOnly(tt *testing.T) { var zeroValue string a := &AuditEntry{ReadOnly: &zeroValue} @@ -1607,6 +1724,16 @@ func TestAuditEntry_GetRunnerName(tt *testing.T) { a.GetRunnerName() } +func TestAuditEntry_GetRunNumber(tt *testing.T) { + var zeroValue int64 + a := &AuditEntry{RunNumber: &zeroValue} + a.GetRunNumber() + a = &AuditEntry{} + a.GetRunNumber() + a = nil + a.GetRunNumber() +} + func TestAuditEntry_GetSourceVersion(tt *testing.T) { var zeroValue string a := &AuditEntry{SourceVersion: &zeroValue} @@ -1667,6 +1794,36 @@ func TestAuditEntry_GetTimestamp(tt *testing.T) { a.GetTimestamp() } +func TestAuditEntry_GetTokenID(tt *testing.T) { + var zeroValue int64 + a := &AuditEntry{TokenID: &zeroValue} + a.GetTokenID() + a = &AuditEntry{} + a.GetTokenID() + a = nil + a.GetTokenID() +} + +func TestAuditEntry_GetTokenScopes(tt *testing.T) { + var zeroValue string + a := &AuditEntry{TokenScopes: &zeroValue} + a.GetTokenScopes() + a = &AuditEntry{} + a.GetTokenScopes() + a = nil + a.GetTokenScopes() +} + +func TestAuditEntry_GetTopic(tt *testing.T) { + var zeroValue string + a := &AuditEntry{Topic: &zeroValue} + a.GetTopic() + a = &AuditEntry{} + a.GetTopic() + a = nil + a.GetTopic() +} + func TestAuditEntry_GetTransportProtocol(tt *testing.T) { var zeroValue int a := &AuditEntry{TransportProtocol: &zeroValue} @@ -1707,6 +1864,16 @@ func TestAuditEntry_GetUser(tt *testing.T) { a.GetUser() } +func TestAuditEntry_GetUserAgent(tt *testing.T) { + var zeroValue string + a := &AuditEntry{UserAgent: &zeroValue} + a.GetUserAgent() + a = &AuditEntry{} + a.GetUserAgent() + a = nil + a.GetUserAgent() +} + func TestAuditEntry_GetVisibility(tt *testing.T) { var zeroValue string a := &AuditEntry{Visibility: &zeroValue} @@ -14781,6 +14948,26 @@ func TestPlan_GetSpace(tt *testing.T) { p.GetSpace() } +func TestPolicyOverrideReason_GetCode(tt *testing.T) { + var zeroValue string + p := &PolicyOverrideReason{Code: &zeroValue} + p.GetCode() + p = &PolicyOverrideReason{} + p.GetCode() + p = nil + p.GetCode() +} + +func TestPolicyOverrideReason_GetMessage(tt *testing.T) { + var zeroValue string + p := &PolicyOverrideReason{Message: &zeroValue} + p.GetMessage() + p = &PolicyOverrideReason{} + p.GetMessage() + p = nil + p.GetMessage() +} + func TestPreReceiveHook_GetConfigURL(tt *testing.T) { var zeroValue string p := &PreReceiveHook{ConfigURL: &zeroValue} diff --git a/github/orgs_audit_log.go b/github/orgs_audit_log.go index 700c233c803..e2e4692e570 100644 --- a/github/orgs_audit_log.go +++ b/github/orgs_audit_log.go @@ -29,69 +29,98 @@ type HookConfig struct { Secret *string `json:"secret,omitempty"` } +// ActorLocation contains information about reported location for an actor. +type ActorLocation struct { + CountryCode *string `json:"country_code,omitempty"` +} + +// PolicyOverrideReason contains user-supplied information about why a policy was overridden. +type PolicyOverrideReason struct { + Code *string `json:"code,omitempty"` + Message *string `json:"message,omitempty"` +} + // AuditEntry describes the fields that may be represented by various audit-log "action" entries. // For a list of actions see - https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization#audit-log-actions type AuditEntry struct { - Action *string `json:"action,omitempty"` // The name of the action that was performed, for example `user.login` or `repo.create`. - Active *bool `json:"active,omitempty"` - ActiveWas *bool `json:"active_was,omitempty"` - Actor *string `json:"actor,omitempty"` // The actor who performed the action. - BlockedUser *string `json:"blocked_user,omitempty"` - Business *string `json:"business,omitempty"` - CancelledAt *Timestamp `json:"cancelled_at,omitempty"` - CompletedAt *Timestamp `json:"completed_at,omitempty"` - Conclusion *string `json:"conclusion,omitempty"` - Config *HookConfig `json:"config,omitempty"` - ConfigWas *HookConfig `json:"config_was,omitempty"` - ContentType *string `json:"content_type,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - DeployKeyFingerprint *string `json:"deploy_key_fingerprint,omitempty"` - DocumentID *string `json:"_document_id,omitempty"` - Emoji *string `json:"emoji,omitempty"` - EnvironmentName *string `json:"environment_name,omitempty"` - Event *string `json:"event,omitempty"` - Events []string `json:"events,omitempty"` - EventsWere []string `json:"events_were,omitempty"` - Explanation *string `json:"explanation,omitempty"` - Fingerprint *string `json:"fingerprint,omitempty"` - HeadBranch *string `json:"head_branch,omitempty"` - HeadSHA *string `json:"head_sha,omitempty"` - HookID *int64 `json:"hook_id,omitempty"` - IsHostedRunner *bool `json:"is_hosted_runner,omitempty"` - JobName *string `json:"job_name,omitempty"` - LimitedAvailability *bool `json:"limited_availability,omitempty"` - Message *string `json:"message,omitempty"` - Name *string `json:"name,omitempty"` - OldUser *string `json:"old_user,omitempty"` - OldPermission *string `json:"old_permission,omitempty"` // The permission level for membership changes, for example `admin` or `read`. - OpenSSHPublicKey *string `json:"openssh_public_key,omitempty"` - Org *string `json:"org,omitempty"` - Permission *string `json:"permission,omitempty"` // The permission level for membership changes, for example `admin` or `read`. - PreviousVisibility *string `json:"previous_visibility,omitempty"` - ReadOnly *string `json:"read_only,omitempty"` - 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"` - RunnerLabels []string `json:"runner_labels,omitempty"` - RunnerName *string `json:"runner_name,omitempty"` - SecretsPassed []string `json:"secrets_passed,omitempty"` - SourceVersion *string `json:"source_version,omitempty"` - StartedAt *Timestamp `json:"started_at,omitempty"` - TargetLogin *string `json:"target_login,omitempty"` - TargetVersion *string `json:"target_version,omitempty"` - Team *string `json:"team,omitempty"` - Timestamp *Timestamp `json:"@timestamp,omitempty"` // The time the audit log event occurred, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). - TransportProtocolName *string `json:"transport_protocol_name,omitempty"` // A human readable name for the protocol (for example, HTTP or SSH) used to transfer Git data. - TransportProtocol *int `json:"transport_protocol,omitempty"` // The type of protocol (for example, HTTP=1 or SSH=2) used to transfer Git data. - TriggerID *int64 `json:"trigger_id,omitempty"` - User *string `json:"user,omitempty"` // The user that was affected by the action performed (if available). - Visibility *string `json:"visibility,omitempty"` // The repository visibility, for example `public` or `private`. - WorkflowID *int64 `json:"workflow_id,omitempty"` - WorkflowRunID *int64 `json:"workflow_run_id,omitempty"` + ActorIP *string `json:"actor_ip,omitempty"` + Action *string `json:"action,omitempty"` // The name of the action that was performed, for example `user.login` or `repo.create`. + Active *bool `json:"active,omitempty"` + ActiveWas *bool `json:"active_was,omitempty"` + Actor *string `json:"actor,omitempty"` // The actor who performed the action. + ActorLocation *ActorLocation `json:"actor_location,omitempty"` + BlockedUser *string `json:"blocked_user,omitempty"` + Business *string `json:"business,omitempty"` + CancelledAt *Timestamp `json:"cancelled_at,omitempty"` + CompletedAt *Timestamp `json:"completed_at,omitempty"` + Conclusion *string `json:"conclusion,omitempty"` + Config *HookConfig `json:"config,omitempty"` + ConfigWas *HookConfig `json:"config_was,omitempty"` + ContentType *string `json:"content_type,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + DeployKeyFingerprint *string `json:"deploy_key_fingerprint,omitempty"` + DocumentID *string `json:"_document_id,omitempty"` + Emoji *string `json:"emoji,omitempty"` + EnvironmentName *string `json:"environment_name,omitempty"` + Event *string `json:"event,omitempty"` + Events []string `json:"events,omitempty"` + EventsWere []string `json:"events_were,omitempty"` + Explanation *string `json:"explanation,omitempty"` + Fingerprint *string `json:"fingerprint,omitempty"` + HashedToken *string `json:"hashed_token,omitempty"` + HeadBranch *string `json:"head_branch,omitempty"` + HeadSHA *string `json:"head_sha,omitempty"` + HookID *int64 `json:"hook_id,omitempty"` + IsHostedRunner *bool `json:"is_hosted_runner,omitempty"` + JobName *string `json:"job_name,omitempty"` + JobWorkflowRef *string `json:"job_workflow_ref,omitempty"` + LimitedAvailability *bool `json:"limited_availability,omitempty"` + Message *string `json:"message,omitempty"` + Name *string `json:"name,omitempty"` + OAuthApplicationID *int64 `json:"oauth_application_id,omitempty"` + OldUser *string `json:"old_user,omitempty"` + OldPermission *string `json:"old_permission,omitempty"` // The permission level for membership changes, for example `admin` or `read`. + OpenSSHPublicKey *string `json:"openssh_public_key,omitempty"` + OperationType *string `json:"operation_type,omitempty"` + Org *string `json:"org,omitempty"` + OrgID *int64 `json:"org_id,omitempty"` + OverriddenCodes []string `json:"overridden_codes,omitempty"` + Permission *string `json:"permission,omitempty"` // The permission level for membership changes, for example `admin` or `read`. + PreviousVisibility *string `json:"previous_visibility,omitempty"` + ProgrammaticAccessType *string `json:"programmatic_access_type,omitempty"` + PullRequestID *int64 `json:"pull_request_id,omitempty"` + PullRequestTitle *string `json:"pull_request_title,omitempty"` + PullRequestURL *string `json:"pull_request_url,omitempty"` + ReadOnly *string `json:"read_only,omitempty"` + Reasons []*PolicyOverrideReason `json:"reasons,omitempty"` + 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"` + RunnerLabels []string `json:"runner_labels,omitempty"` + RunnerName *string `json:"runner_name,omitempty"` + RunNumber *int64 `json:"run_number,omitempty"` + SecretsPassed []string `json:"secrets_passed,omitempty"` + SourceVersion *string `json:"source_version,omitempty"` + StartedAt *Timestamp `json:"started_at,omitempty"` + TargetLogin *string `json:"target_login,omitempty"` + TargetVersion *string `json:"target_version,omitempty"` + Team *string `json:"team,omitempty"` + Timestamp *Timestamp `json:"@timestamp,omitempty"` // The time the audit log event occurred, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). + TokenID *int64 `json:"token_id,omitempty"` + TokenScopes *string `json:"token_scopes,omitempty"` + Topic *string `json:"topic,omitempty"` + TransportProtocolName *string `json:"transport_protocol_name,omitempty"` // A human readable name for the protocol (for example, HTTP or SSH) used to transfer Git data. + TransportProtocol *int `json:"transport_protocol,omitempty"` // The type of protocol (for example, HTTP=1 or SSH=2) used to transfer Git data. + TriggerID *int64 `json:"trigger_id,omitempty"` + User *string `json:"user,omitempty"` // The user that was affected by the action performed (if available). + UserAgent *string `json:"user_agent,omitempty"` + Visibility *string `json:"visibility,omitempty"` // The repository visibility, for example `public` or `private`. + WorkflowID *int64 `json:"workflow_id,omitempty"` + WorkflowRunID *int64 `json:"workflow_run_id,omitempty"` } // GetAuditLog gets the audit-log entries for an organization. diff --git a/github/orgs_audit_log_test.go b/github/orgs_audit_log_test.go index be6361560f9..8d33a986a17 100644 --- a/github/orgs_audit_log_test.go +++ b/github/orgs_audit_log_test.go @@ -25,6 +25,10 @@ func TestOrganizationService_GetAuditLog(t *testing.T) { fmt.Fprint(w, `[ { + "actor_ip": "10.0.0.1", + "actor_location": { + "country_code": "US" + }, "active": true, "workflow_id": 123456, "head_branch": "master", @@ -32,6 +36,7 @@ func TestOrganizationService_GetAuditLog(t *testing.T) { "trigger_id": null, "repo": "o/blue-crayon-1", "created_at": 1615077308538, + "hashed_token": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=", "head_sha": "5acdeadbeef64d1a62388e901e5cdc9358644b37", "conclusion": "success", "old_permission": "read", @@ -45,6 +50,28 @@ func TestOrganizationService_GetAuditLog(t *testing.T) { "event": "schedule", "workflow_run_id": 628312345, "_document_id": "beeZYapIUe-wKg5-beadb33", + "run_attempt": 1, + "run_number": 1, + "token_id": 1, + "token_scopes": "gist,repo:read", + "topic": "cp1-iad.ingest.github.actions.v0.WorkflowUpdate", + "job_workflow_ref": "testorg/testrepo/.github/workflows/testjob.yml@refs/pull/1/merge", + "oauth_application_id": 1, + "org_id": 1, + "pull_request_id": 1, + "pull_request_title": "a pr title", + "pull_request_url": "https://github.com/testorg/testrepo/pull/1", + "overridden_codes": [ + "review_policy_not_satisfied" + ], + "reasons": [ + { + "code": "a code", + "message": "a message" + } + ], + "programmatic_access_type": "GitHub App server-to-server token", + "user_agent": "a user agent", "config": { "content_type": "json", "insecure_ssl": "0", @@ -70,23 +97,46 @@ func TestOrganizationService_GetAuditLog(t *testing.T) { want := []*AuditEntry{ { - Timestamp: &Timestamp{timestamp}, - DocumentID: String("beeZYapIUe-wKg5-beadb33"), - Action: String("workflows.completed_workflow_run"), - Actor: String("testactor"), - Active: Bool(true), - CompletedAt: &Timestamp{completedAt}, - Conclusion: String("success"), - CreatedAt: &Timestamp{timestamp}, - Event: String("schedule"), - HeadBranch: String("master"), - HeadSHA: String("5acdeadbeef64d1a62388e901e5cdc9358644b37"), - Name: String("Code scanning - action"), - OldPermission: String("read"), - Org: String("o"), - Permission: String("admin"), + Timestamp: &Timestamp{timestamp}, + DocumentID: String("beeZYapIUe-wKg5-beadb33"), + Action: String("workflows.completed_workflow_run"), + Actor: String("testactor"), + ActorIP: String("10.0.0.1"), + ActorLocation: &ActorLocation{ + CountryCode: String("US"), + }, + Active: Bool(true), + CompletedAt: &Timestamp{completedAt}, + Conclusion: String("success"), + CreatedAt: &Timestamp{timestamp}, + Event: String("schedule"), + HashedToken: String("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="), + HeadBranch: String("master"), + HeadSHA: String("5acdeadbeef64d1a62388e901e5cdc9358644b37"), + JobWorkflowRef: String("testorg/testrepo/.github/workflows/testjob.yml@refs/pull/1/merge"), + Name: String("Code scanning - action"), + OAuthApplicationID: Int64(1), + OldPermission: String("read"), + Org: String("o"), + OrgID: Int64(1), + OverriddenCodes: []string{"review_policy_not_satisfied"}, + Permission: String("admin"), + ProgrammaticAccessType: String("GitHub App server-to-server token"), + PullRequestID: Int64(1), + PullRequestTitle: String("a pr title"), + PullRequestURL: String("https://github.com/testorg/testrepo/pull/1"), + Reasons: []*PolicyOverrideReason{{ + Code: String("a code"), + Message: String("a message"), + }}, Repo: String("o/blue-crayon-1"), + RunAttempt: Int64(1), + RunNumber: Int64(1), StartedAt: &Timestamp{startedAt}, + TokenID: Int64(1), + TokenScopes: String("gist,repo:read"), + Topic: String("cp1-iad.ingest.github.actions.v0.WorkflowUpdate"), + UserAgent: String("a user agent"), WorkflowID: Int64(123456), WorkflowRunID: Int64(628312345), Events: []string{"code_scanning_alert"}, @@ -173,42 +223,54 @@ func TestAuditEntry_Marshal(t *testing.T) { testJSONMarshal(t, &AuditEntry{}, "{}") u := &AuditEntry{ - Action: String("a"), - Active: Bool(false), - ActiveWas: Bool(false), - Actor: String("ac"), - BlockedUser: String("bu"), - Business: String("b"), - CancelledAt: &Timestamp{referenceTime}, - CompletedAt: &Timestamp{referenceTime}, - Conclusion: String("c"), - Config: &HookConfig{URL: String("s")}, - ConfigWas: &HookConfig{URL: String("s")}, - ContentType: String("ct"), - CreatedAt: &Timestamp{referenceTime}, - DeployKeyFingerprint: String("dkf"), - DocumentID: String("did"), - Emoji: String("e"), - EnvironmentName: String("en"), - Event: String("e"), - Events: []string{"s"}, - EventsWere: []string{"s"}, - Explanation: String("e"), - Fingerprint: String("f"), - HeadBranch: String("hb"), - HeadSHA: String("hsha"), - HookID: Int64(1), - IsHostedRunner: Bool(false), - JobName: String("jn"), - LimitedAvailability: Bool(false), - Message: String("m"), - Name: String("n"), - OldPermission: String("op"), - OldUser: String("ou"), - OpenSSHPublicKey: String("osshpk"), - Org: String("o"), - Permission: String("p"), - PreviousVisibility: String("pv"), + Action: String("a"), + Active: Bool(false), + ActiveWas: Bool(false), + Actor: String("ac"), + ActorIP: String("aip"), + ActorLocation: &ActorLocation{CountryCode: String("alcc")}, + BlockedUser: String("bu"), + Business: String("b"), + CancelledAt: &Timestamp{referenceTime}, + CompletedAt: &Timestamp{referenceTime}, + Conclusion: String("c"), + Config: &HookConfig{URL: String("s")}, + ConfigWas: &HookConfig{URL: String("s")}, + ContentType: String("ct"), + CreatedAt: &Timestamp{referenceTime}, + DeployKeyFingerprint: String("dkf"), + DocumentID: String("did"), + Emoji: String("e"), + EnvironmentName: String("en"), + Event: String("e"), + Events: []string{"s"}, + EventsWere: []string{"s"}, + Explanation: String("e"), + Fingerprint: String("f"), + HashedToken: String("ht"), + HeadBranch: String("hb"), + HeadSHA: String("hsha"), + HookID: Int64(1), + IsHostedRunner: Bool(false), + JobName: String("jn"), + LimitedAvailability: Bool(false), + Message: String("m"), + Name: String("n"), + OldPermission: String("op"), + OldUser: String("ou"), + OpenSSHPublicKey: String("osshpk"), + Org: String("o"), + OrgID: Int64(1), + Permission: String("p"), + PreviousVisibility: String("pv"), + ProgrammaticAccessType: String("pat"), + PullRequestID: Int64(1), + PullRequestTitle: String("prt"), + PullRequestURL: String("pru"), + Reasons: []*PolicyOverrideReason{{ + Code: String("c"), + Message: String("m"), + }}, ReadOnly: String("ro"), Repo: String("r"), Repository: String("repo"), @@ -226,10 +288,14 @@ func TestAuditEntry_Marshal(t *testing.T) { TargetVersion: String("tv"), Team: String("t"), Timestamp: &Timestamp{referenceTime}, + TokenID: Int64(1), + TokenScopes: String("ts"), + Topic: String("tp"), TransportProtocolName: String("tpn"), TransportProtocol: Int(1), TriggerID: Int64(1), User: String("u"), + UserAgent: String("ua"), Visibility: String("v"), WorkflowID: Int64(1), WorkflowRunID: Int64(1), @@ -240,6 +306,10 @@ func TestAuditEntry_Marshal(t *testing.T) { "active": false, "active_was": false, "actor": "ac", + "actor_ip": "aip", + "actor_location": { + "country_code": "alcc" + }, "blocked_user": "bu", "business": "b", "cancelled_at": ` + referenceTimeStr + `, @@ -266,6 +336,7 @@ func TestAuditEntry_Marshal(t *testing.T) { ], "explanation": "e", "fingerprint": "f", + "hashed_token": "ht", "head_branch": "hb", "head_sha": "hsha", "hook_id": 1, @@ -278,8 +349,17 @@ func TestAuditEntry_Marshal(t *testing.T) { "old_user": "ou", "openssh_public_key": "osshpk", "org": "o", + "org_id": 1, "permission": "p", "previous_visibility": "pv", + "programmatic_access_type": "pat", + "pull_request_id": 1, + "pull_request_title": "prt", + "pull_request_url": "pru", + "reasons": [{ + "code": "c", + "message": "m" + }], "read_only": "ro", "repo": "r", "repository": "repo", @@ -301,10 +381,14 @@ func TestAuditEntry_Marshal(t *testing.T) { "target_version": "tv", "team": "t", "@timestamp": ` + referenceTimeStr + `, + "token_id": 1, + "token_scopes": "ts", + "topic": "tp", "transport_protocol_name": "tpn", "transport_protocol": 1, "trigger_id": 1, "user": "u", + "user_agent": "ua", "visibility": "v", "workflow_id": 1, "workflow_run_id": 1 From 9e4ce880cd4db6c8f8459806a8c1276a14db3983 Mon Sep 17 00:00:00 2001 From: kgalli Date: Fri, 26 May 2023 14:24:26 +0200 Subject: [PATCH 235/751] Add "new_name" parameter to repo transfer request (#2787) (#2788) Fixes: #2787. --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ github/repos.go | 1 + github/repos_test.go | 4 +++- 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index f310e42a01e..c2d9061c174 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -20862,6 +20862,14 @@ func (t *TrafficViews) GetUniques() int { return *t.Uniques } +// GetNewName returns the NewName field if it's non-nil, zero value otherwise. +func (t *TransferRequest) GetNewName() string { + if t == nil || t.NewName == nil { + return "" + } + return *t.NewName +} + // GetSHA returns the SHA field if it's non-nil, zero value otherwise. func (t *Tree) GetSHA() string { if t == nil || t.SHA == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 97f3994fc43..eb0a0db42c6 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -24329,6 +24329,16 @@ func TestTrafficViews_GetUniques(tt *testing.T) { t.GetUniques() } +func TestTransferRequest_GetNewName(tt *testing.T) { + var zeroValue string + t := &TransferRequest{NewName: &zeroValue} + t.GetNewName() + t = &TransferRequest{} + t.GetNewName() + t = nil + t.GetNewName() +} + func TestTree_GetSHA(tt *testing.T) { var zeroValue string t := &Tree{SHA: &zeroValue} diff --git a/github/repos.go b/github/repos.go index 9c9c7506309..5ffad6dd3c4 100644 --- a/github/repos.go +++ b/github/repos.go @@ -1969,6 +1969,7 @@ func (s *RepositoriesService) RemoveUserRestrictions(ctx context.Context, owner, // TransferRequest represents a request to transfer a repository. type TransferRequest struct { NewOwner string `json:"new_owner"` + NewName *string `json:"new_name,omitempty"` TeamID []int64 `json:"team_ids,omitempty"` } diff --git a/github/repos_test.go b/github/repos_test.go index 992ec418749..b35f44ddc30 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -3220,7 +3220,7 @@ func TestRepositoriesService_Transfer(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - input := TransferRequest{NewOwner: "a", TeamID: []int64{123}} + input := TransferRequest{NewOwner: "a", NewName: String("b"), TeamID: []int64{123}} mux.HandleFunc("/repos/o/r/transfer", func(w http.ResponseWriter, r *http.Request) { var v TransferRequest @@ -3390,11 +3390,13 @@ func TestTransferRequest_Marshal(t *testing.T) { u := &TransferRequest{ NewOwner: "testOwner", + NewName: String("testName"), TeamID: []int64{1, 2}, } want := `{ "new_owner": "testOwner", + "new_name": "testName", "team_ids": [1,2] }` From d6880db28be3f950bff2298cd4dbff47a48d1196 Mon Sep 17 00:00:00 2001 From: Wheeler Law Date: Thu, 1 Jun 2023 09:22:09 -0500 Subject: [PATCH 236/751] Add workflow run display title (#2792) Fixes: #2791. --- github/actions_workflow_runs.go | 1 + github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ 3 files changed, 19 insertions(+) diff --git a/github/actions_workflow_runs.go b/github/actions_workflow_runs.go index 704048774e6..61f736be4fb 100644 --- a/github/actions_workflow_runs.go +++ b/github/actions_workflow_runs.go @@ -22,6 +22,7 @@ type WorkflowRun struct { RunNumber *int `json:"run_number,omitempty"` RunAttempt *int `json:"run_attempt,omitempty"` Event *string `json:"event,omitempty"` + DisplayTitle *string `json:"display_title,omitempty"` Status *string `json:"status,omitempty"` Conclusion *string `json:"conclusion,omitempty"` WorkflowID *int64 `json:"workflow_id,omitempty"` diff --git a/github/github-accessors.go b/github/github-accessors.go index c2d9061c174..a9aaee814ab 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -22310,6 +22310,14 @@ func (w *WorkflowRun) GetCreatedAt() Timestamp { return *w.CreatedAt } +// GetDisplayTitle returns the DisplayTitle field if it's non-nil, zero value otherwise. +func (w *WorkflowRun) GetDisplayTitle() string { + if w == nil || w.DisplayTitle == nil { + return "" + } + return *w.DisplayTitle +} + // GetEvent returns the Event field if it's non-nil, zero value otherwise. func (w *WorkflowRun) GetEvent() string { if w == nil || w.Event == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index eb0a0db42c6..a29baa0f0c4 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -26079,6 +26079,16 @@ func TestWorkflowRun_GetCreatedAt(tt *testing.T) { w.GetCreatedAt() } +func TestWorkflowRun_GetDisplayTitle(tt *testing.T) { + var zeroValue string + w := &WorkflowRun{DisplayTitle: &zeroValue} + w.GetDisplayTitle() + w = &WorkflowRun{} + w.GetDisplayTitle() + w = nil + w.GetDisplayTitle() +} + func TestWorkflowRun_GetEvent(tt *testing.T) { var zeroValue string w := &WorkflowRun{Event: &zeroValue} From bc019caa8be14ec99ce522f9d7dbbbdbde6d2ab3 Mon Sep 17 00:00:00 2001 From: Jordan Burandt Date: Mon, 5 Jun 2023 06:06:22 -0400 Subject: [PATCH 237/751] Update DependabotSecretsSelectedRepoIDs type to []int64 (#2794) --- github/dependabot_secrets.go | 2 +- github/dependabot_secrets_test.go | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/github/dependabot_secrets.go b/github/dependabot_secrets.go index 8318cd812cf..f87ab42c396 100644 --- a/github/dependabot_secrets.go +++ b/github/dependabot_secrets.go @@ -198,7 +198,7 @@ func (s *DependabotService) ListSelectedReposForOrgSecret(ctx context.Context, o } // DependabotSecretsSelectedRepoIDs are the repository IDs that have access to the dependabot secrets. -type DependabotSecretsSelectedRepoIDs []string +type DependabotSecretsSelectedRepoIDs []int64 // SetSelectedReposForOrgSecret sets the repositories that have access to a Dependabot secret. // diff --git a/github/dependabot_secrets_test.go b/github/dependabot_secrets_test.go index 49ddaab61e2..13eac69efe7 100644 --- a/github/dependabot_secrets_test.go +++ b/github/dependabot_secrets_test.go @@ -352,7 +352,7 @@ func TestDependabotService_CreateOrUpdateOrgSecret(t *testing.T) { mux.HandleFunc("/orgs/o/dependabot/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") testHeader(t, r, "Content-Type", "application/json") - testBody(t, r, `{"key_id":"1234","encrypted_value":"QIv=","visibility":"selected","selected_repository_ids":["1296269","1269280"]}`+"\n") + testBody(t, r, `{"key_id":"1234","encrypted_value":"QIv=","visibility":"selected","selected_repository_ids":[1296269,1269280]}`+"\n") w.WriteHeader(http.StatusCreated) }) @@ -361,7 +361,7 @@ func TestDependabotService_CreateOrUpdateOrgSecret(t *testing.T) { EncryptedValue: "QIv=", KeyID: "1234", Visibility: "selected", - SelectedRepositoryIDs: DependabotSecretsSelectedRepoIDs{"1296269", "1269280"}, + SelectedRepositoryIDs: DependabotSecretsSelectedRepoIDs{1296269, 1269280}, } ctx := context.Background() _, err := client.Dependabot.CreateOrUpdateOrgSecret(ctx, "o", input) @@ -428,23 +428,23 @@ func TestDependabotService_SetSelectedReposForOrgSecret(t *testing.T) { mux.HandleFunc("/orgs/o/dependabot/secrets/NAME/repositories", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") testHeader(t, r, "Content-Type", "application/json") - testBody(t, r, `{"selected_repository_ids":["64780797"]}`+"\n") + testBody(t, r, `{"selected_repository_ids":[64780797]}`+"\n") }) ctx := context.Background() - _, err := client.Dependabot.SetSelectedReposForOrgSecret(ctx, "o", "NAME", DependabotSecretsSelectedRepoIDs{"64780797"}) + _, err := client.Dependabot.SetSelectedReposForOrgSecret(ctx, "o", "NAME", DependabotSecretsSelectedRepoIDs{64780797}) if err != nil { t.Errorf("Dependabot.SetSelectedReposForOrgSecret returned error: %v", err) } const methodName = "SetSelectedReposForOrgSecret" testBadOptions(t, methodName, func() (err error) { - _, err = client.Dependabot.SetSelectedReposForOrgSecret(ctx, "\n", "\n", DependabotSecretsSelectedRepoIDs{"64780797"}) + _, err = client.Dependabot.SetSelectedReposForOrgSecret(ctx, "\n", "\n", DependabotSecretsSelectedRepoIDs{64780797}) return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Dependabot.SetSelectedReposForOrgSecret(ctx, "o", "NAME", DependabotSecretsSelectedRepoIDs{"64780797"}) + return client.Dependabot.SetSelectedReposForOrgSecret(ctx, "o", "NAME", DependabotSecretsSelectedRepoIDs{64780797}) }) } From 3efdd2c7b3f7931e171d6e77e133ccd6e24ae0c5 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Tue, 6 Jun 2023 10:37:04 -0400 Subject: [PATCH 238/751] Bump version of go-github to v53.0.0 (#2797) --- README.md | 15 +++++----- example/actionpermissions/main.go | 2 +- example/appengine/app.go | 2 +- example/basicauth/main.go | 2 +- example/commitpr/main.go | 2 +- example/go.mod | 6 ++-- example/listenvironments/main.go | 2 +- example/migrations/main.go | 2 +- example/newfilewithappauth/main.go | 2 +- example/newrepo/main.go | 2 +- example/newreposecretwithlibsodium/go.mod | 4 +-- example/newreposecretwithlibsodium/main.go | 2 +- example/newreposecretwithxcrypto/main.go | 2 +- example/ratelimit/main.go | 2 +- example/simple/main.go | 2 +- example/tagprotection/main.go | 2 +- example/tokenauth/main.go | 2 +- example/topics/main.go | 2 +- github/doc.go | 2 +- github/examples_test.go | 2 +- github/github.go | 2 +- go.mod | 2 +- go.sum | 35 ---------------------- test/fields/fields.go | 2 +- test/integration/activity_test.go | 2 +- test/integration/authorizations_test.go | 2 +- test/integration/github_test.go | 2 +- test/integration/repos_test.go | 2 +- test/integration/users_test.go | 2 +- update-urls/go.mod | 2 +- 30 files changed, 39 insertions(+), 73 deletions(-) diff --git a/README.md b/README.md index 33f33fe947a..6858fd1aee1 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-github # [![go-github release (latest SemVer)](https://img.shields.io/github/v/release/google/go-github?sort=semver)](https://github.com/google/go-github/releases) -[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v52/github) +[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v53/github) [![Test Status](https://github.com/google/go-github/workflows/tests/badge.svg)](https://github.com/google/go-github/actions?query=workflow%3Atests) [![Test Coverage](https://codecov.io/gh/google/go-github/branch/master/graph/badge.svg)](https://codecov.io/gh/google/go-github) [![Discuss at go-github@googlegroups.com](https://img.shields.io/badge/discuss-go--github%40googlegroups.com-blue.svg)](https://groups.google.com/group/go-github) @@ -24,7 +24,7 @@ If you're interested in using the [GraphQL API v4][], the recommended library is go-github is compatible with modern Go releases in module mode, with Go installed: ```bash -go get github.com/google/go-github/v52 +go get github.com/google/go-github/v53 ``` will resolve and add the package to the current development module, along with its dependencies. @@ -32,7 +32,7 @@ will resolve and add the package to the current development module, along with i Alternatively the same can be achieved if you use import in a package: ```go -import "github.com/google/go-github/v52/github" +import "github.com/google/go-github/v53/github" ``` and run `go get` without parameters. @@ -40,13 +40,13 @@ and run `go get` without parameters. Finally, to use the top-of-trunk version of this repo, use the following command: ```bash -go get github.com/google/go-github/v52@master +go get github.com/google/go-github/v53@master ``` ## Usage ## ```go -import "github.com/google/go-github/v52/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) +import "github.com/google/go-github/v53/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled ``` @@ -135,7 +135,7 @@ import ( "net/http" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v52/github" + "github.com/google/go-github/v53/github" ) func main() { @@ -323,7 +323,7 @@ For complete usage of go-github, see the full [package docs][]. [oauth2]: https://github.com/golang/oauth2 [oauth2 docs]: https://godoc.org/golang.org/x/oauth2 [personal API token]: https://github.com/blog/1509-personal-api-tokens -[package docs]: https://pkg.go.dev/github.com/google/go-github/v52/github +[package docs]: https://pkg.go.dev/github.com/google/go-github/v53/github [GraphQL API v4]: https://developer.github.com/v4/ [shurcooL/githubv4]: https://github.com/shurcooL/githubv4 [GitHub webhook events]: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads @@ -396,6 +396,7 @@ Versions prior to 48.2.0 are not listed. | go-github Version | GitHub v3 API Version | | ----------------- | --------------------- | +| 53.0.0 | 2022-11-28 | | 52.0.0 | 2022-11-28 | | 51.0.0 | 2022-11-28 | | 50.2.0 | 2022-11-28 | diff --git a/example/actionpermissions/main.go b/example/actionpermissions/main.go index 34b7d6967d5..7ed63b171c4 100644 --- a/example/actionpermissions/main.go +++ b/example/actionpermissions/main.go @@ -14,7 +14,7 @@ import ( "log" "os" - "github.com/google/go-github/v52/github" + "github.com/google/go-github/v53/github" ) var ( diff --git a/example/appengine/app.go b/example/appengine/app.go index e2f2a5fc846..1ad511227f2 100644 --- a/example/appengine/app.go +++ b/example/appengine/app.go @@ -12,7 +12,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v52/github" + "github.com/google/go-github/v53/github" "google.golang.org/appengine" "google.golang.org/appengine/log" ) diff --git a/example/basicauth/main.go b/example/basicauth/main.go index c432db85c6c..edee49b8910 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -22,7 +22,7 @@ import ( "strings" "syscall" - "github.com/google/go-github/v52/github" + "github.com/google/go-github/v53/github" "golang.org/x/crypto/ssh/terminal" ) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index 55fa03f620f..2977928cc66 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -30,7 +30,7 @@ import ( "strings" "time" - "github.com/google/go-github/v52/github" + "github.com/google/go-github/v53/github" ) var ( diff --git a/example/go.mod b/example/go.mod index d5a970e67a0..8dc82fb8ddd 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,11 +1,11 @@ -module github.com/google/go-github/v52/example +module github.com/google/go-github/v53/example go 1.17 require ( github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-ratelimit v1.0.3 - github.com/google/go-github/v52 v52.0.0 + github.com/google/go-github/v53 v53.0.0 golang.org/x/crypto v0.7.0 golang.org/x/oauth2 v0.7.0 google.golang.org/appengine v1.6.7 @@ -22,4 +22,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v52 => ../ +replace github.com/google/go-github/v53 => ../ diff --git a/example/listenvironments/main.go b/example/listenvironments/main.go index 9324ecf6759..1c8bb634fdf 100644 --- a/example/listenvironments/main.go +++ b/example/listenvironments/main.go @@ -18,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v52/github" + "github.com/google/go-github/v53/github" ) func main() { diff --git a/example/migrations/main.go b/example/migrations/main.go index 1708a76d799..07f12287448 100644 --- a/example/migrations/main.go +++ b/example/migrations/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v52/github" + "github.com/google/go-github/v53/github" ) func fetchAllUserMigrations() ([]*github.UserMigration, error) { diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index 71688eef3c5..ccdaaf3b0eb 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -16,7 +16,7 @@ import ( "time" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v52/github" + "github.com/google/go-github/v53/github" "golang.org/x/oauth2" ) diff --git a/example/newrepo/main.go b/example/newrepo/main.go index fccf471f4ca..443778bc6dc 100644 --- a/example/newrepo/main.go +++ b/example/newrepo/main.go @@ -16,7 +16,7 @@ import ( "log" "os" - "github.com/google/go-github/v52/github" + "github.com/google/go-github/v53/github" ) var ( diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index 8f3cd790fa5..ca17e055dea 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -4,9 +4,9 @@ go 1.15 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb - github.com/google/go-github/v52 v52.0.0 + github.com/google/go-github/v53 v53.0.0 golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v52 => ../.. +replace github.com/google/go-github/v53 => ../.. diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index 238943b262b..b33c851b877 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -36,7 +36,7 @@ import ( "os" sodium "github.com/GoKillers/libsodium-go/cryptobox" - "github.com/google/go-github/v52/github" + "github.com/google/go-github/v53/github" ) var ( diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index b55ecc2fe7b..d6e329295bf 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -36,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v52/github" + "github.com/google/go-github/v53/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/ratelimit/main.go b/example/ratelimit/main.go index f8740680500..6ece9768982 100644 --- a/example/ratelimit/main.go +++ b/example/ratelimit/main.go @@ -13,7 +13,7 @@ import ( "fmt" "github.com/gofri/go-github-ratelimit/github_ratelimit" - "github.com/google/go-github/v52/github" + "github.com/google/go-github/v53/github" ) func main() { diff --git a/example/simple/main.go b/example/simple/main.go index 438097c8eab..fbb9c0d7907 100644 --- a/example/simple/main.go +++ b/example/simple/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v52/github" + "github.com/google/go-github/v53/github" ) // Fetch all the public organizations' membership of a user. diff --git a/example/tagprotection/main.go b/example/tagprotection/main.go index c78f34f7622..e68b9c300eb 100644 --- a/example/tagprotection/main.go +++ b/example/tagprotection/main.go @@ -19,7 +19,7 @@ import ( "strings" "syscall" - "github.com/google/go-github/v52/github" + "github.com/google/go-github/v53/github" "golang.org/x/crypto/ssh/terminal" ) diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index f0ae2f79a5e..03ae076d7b8 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -14,7 +14,7 @@ import ( "log" "syscall" - "github.com/google/go-github/v52/github" + "github.com/google/go-github/v53/github" "golang.org/x/crypto/ssh/terminal" ) diff --git a/example/topics/main.go b/example/topics/main.go index cdab7a56309..bbe91a22872 100644 --- a/example/topics/main.go +++ b/example/topics/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v52/github" + "github.com/google/go-github/v53/github" ) // Fetch and lists all the public topics associated with the specified GitHub topic diff --git a/github/doc.go b/github/doc.go index 1acf8d5a8d0..af2847111a3 100644 --- a/github/doc.go +++ b/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v52/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v53/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to diff --git a/github/examples_test.go b/github/examples_test.go index 4628b38c4ef..ad0e94d2760 100644 --- a/github/examples_test.go +++ b/github/examples_test.go @@ -12,7 +12,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v52/github" + "github.com/google/go-github/v53/github" ) func ExampleClient_Markdown() { diff --git a/github/github.go b/github/github.go index 4170719a387..7d8aef53022 100644 --- a/github/github.go +++ b/github/github.go @@ -28,7 +28,7 @@ import ( ) const ( - Version = "v52.0.0" + Version = "v53.0.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" diff --git a/go.mod b/go.mod index a214a4bae29..01c3374411b 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v52 +module github.com/google/go-github/v53 require ( github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 diff --git a/go.sum b/go.sum index 4acfb42fa06..99e4709f7bd 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,6 @@ -cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= @@ -12,64 +10,31 @@ github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= 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/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8= golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= diff --git a/test/fields/fields.go b/test/fields/fields.go index bebd0a3f87f..85d4b8a024e 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -25,7 +25,7 @@ import ( "reflect" "strings" - "github.com/google/go-github/v52/github" + "github.com/google/go-github/v53/github" ) var ( diff --git a/test/integration/activity_test.go b/test/integration/activity_test.go index 59f17951246..f7145ae2c23 100644 --- a/test/integration/activity_test.go +++ b/test/integration/activity_test.go @@ -12,7 +12,7 @@ import ( "context" "testing" - "github.com/google/go-github/v52/github" + "github.com/google/go-github/v53/github" ) const ( diff --git a/test/integration/authorizations_test.go b/test/integration/authorizations_test.go index 3a7310ec1d9..cd968a63a91 100644 --- a/test/integration/authorizations_test.go +++ b/test/integration/authorizations_test.go @@ -17,7 +17,7 @@ import ( "testing" "time" - "github.com/google/go-github/v52/github" + "github.com/google/go-github/v53/github" ) const msgEnvMissing = "Skipping test because the required environment variable (%v) is not present." diff --git a/test/integration/github_test.go b/test/integration/github_test.go index 365b2c2b8b9..934fb02580e 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -15,7 +15,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v52/github" + "github.com/google/go-github/v53/github" ) var ( diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index 01c1ad4a6db..410468ad96b 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -15,7 +15,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v52/github" + "github.com/google/go-github/v53/github" ) func TestRepositories_CRUD(t *testing.T) { diff --git a/test/integration/users_test.go b/test/integration/users_test.go index 88a358b59b0..80324a180f6 100644 --- a/test/integration/users_test.go +++ b/test/integration/users_test.go @@ -14,7 +14,7 @@ import ( "math/rand" "testing" - "github.com/google/go-github/v52/github" + "github.com/google/go-github/v53/github" ) func TestUsers_Get(t *testing.T) { diff --git a/update-urls/go.mod b/update-urls/go.mod index 7ac2c08939a..2d744e632cd 100644 --- a/update-urls/go.mod +++ b/update-urls/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v52/update-urls +module github.com/google/go-github/v53/update-urls go 1.16 From 78b84dfc4727f66a5c7c54b97817abec9cc74651 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Tue, 6 Jun 2023 10:51:24 -0400 Subject: [PATCH 239/751] Bump go-github from v52.0.0 to v53.0.0 in /scrape (#2800) --- scrape/apps.go | 2 +- scrape/apps_test.go | 2 +- scrape/go.mod | 2 +- scrape/go.sum | 21 +++++++++++++-------- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/scrape/apps.go b/scrape/apps.go index adbc2f48896..290390c9f1b 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -17,7 +17,7 @@ import ( "strings" "github.com/PuerkitoBio/goquery" - "github.com/google/go-github/v52/github" + "github.com/google/go-github/v53/github" ) // AppRestrictionsEnabled returns whether the specified organization has diff --git a/scrape/apps_test.go b/scrape/apps_test.go index ed5b7e4df66..a4c2ce9057d 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v52/github" + "github.com/google/go-github/v53/github" ) func Test_AppRestrictionsEnabled(t *testing.T) { diff --git a/scrape/go.mod b/scrape/go.mod index bf06bfa0eb9..1aff12bb184 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -5,7 +5,7 @@ go 1.13 require ( github.com/PuerkitoBio/goquery v1.8.1 github.com/google/go-cmp v0.5.9 - github.com/google/go-github/v52 v52.0.0 + github.com/google/go-github/v53 v53.0.0 github.com/xlzd/gotp v0.1.0 golang.org/x/net v0.10.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index 1739f99b0ee..57c51fd9b17 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -6,8 +6,10 @@ github.com/PuerkitoBio/goquery v1.8.1/go.mod h1:Q8ICL1kNUJ2sXGoAhPGUdYDJvgQgHzJs github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c= github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA= github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/cloudflare/circl v1.1.0 h1:bZgT/A+cikZnKIwn7xL2OBj012Bmvho/o6RpRvv3GKY= +github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= +github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= +github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= @@ -17,8 +19,8 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v52 v52.0.0 h1:uyGWOY+jMQ8GVGSX8dkSwCzlehU3WfdxQ7GweO/JP7M= -github.com/google/go-github/v52 v52.0.0/go.mod h1:WJV6VEEUPuMo5pXqqa2ZCZEdbQqua4zAk2MZTIo+m+4= +github.com/google/go-github/v53 v53.0.0 h1:T1RyHbSnpHYnoF0ZYKiIPSgPtuJ8G6vgc0MKodXsQDQ= +github.com/google/go-github/v53 v53.0.0/go.mod h1:XhFRObz+m/l+UCm9b7KSIC3lT3NWSXGt7mOsAWEloao= 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.1.0 h1:37blvlKCh38s+fkem+fFh7sMnceltoIEBYTVXyoa5Po= @@ -26,6 +28,7 @@ github.com/xlzd/gotp v0.1.0/go.mod h1:ndLJ3JKzi3xLmUProq4LLxCuECL93dG9WASNLpHz8q github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= @@ -35,14 +38,14 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= -golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= +golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8= +golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -53,22 +56,24 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= From 5a9f8f7d92f20e3a16770640ce9f15694f5c03ff Mon Sep 17 00:00:00 2001 From: Luke Hinds Date: Tue, 6 Jun 2023 16:57:59 +0100 Subject: [PATCH 240/751] Add GitHub App event security_advisory (#2799) Fixes: #2798. --- github/event.go | 2 ++ github/messages.go | 1 + github/messages_test.go | 4 ++++ github/repos_hooks_deliveries_test.go | 1 + 4 files changed, 8 insertions(+) diff --git a/github/event.go b/github/event.go index 20907a99321..4ee25603a83 100644 --- a/github/event.go +++ b/github/event.go @@ -127,6 +127,8 @@ func (e *Event) ParsePayload() (payload interface{}, err error) { payload = &RepositoryVulnerabilityAlertEvent{} case "SecretScanningAlertEvent": payload = &SecretScanningAlertEvent{} + case "SecurityAdvisoryEvent": + payload = &SecurityAdvisoryEvent{} case "StarEvent": payload = &StarEvent{} case "StatusEvent": diff --git a/github/messages.go b/github/messages.go index 8547b8810f8..bb5ae3f3895 100644 --- a/github/messages.go +++ b/github/messages.go @@ -93,6 +93,7 @@ var ( "repository_vulnerability_alert": "RepositoryVulnerabilityAlertEvent", "release": "ReleaseEvent", "secret_scanning_alert": "SecretScanningAlertEvent", + "security_advisory": "SecurityAdvisoryEvent", "star": "StarEvent", "status": "StatusEvent", "team": "TeamEvent", diff --git a/github/messages_test.go b/github/messages_test.go index 8dbb0fdf996..80fb3e5ff54 100644 --- a/github/messages_test.go +++ b/github/messages_test.go @@ -440,6 +440,10 @@ func TestParseWebHook(t *testing.T) { payload: &SecretScanningAlertEvent{}, messageType: "secret_scanning_alert", }, + { + payload: &SecurityAdvisoryEvent{}, + messageType: "security_advisory", + }, { payload: &StarEvent{}, messageType: "star", diff --git a/github/repos_hooks_deliveries_test.go b/github/repos_hooks_deliveries_test.go index ef453996a90..d1dda365194 100644 --- a/github/repos_hooks_deliveries_test.go +++ b/github/repos_hooks_deliveries_test.go @@ -189,6 +189,7 @@ var hookDeliveryPayloadTypeToStruct = map[string]interface{}{ "repository_import": &RepositoryImportEvent{}, "repository_vulnerability_alert": &RepositoryVulnerabilityAlertEvent{}, "secret_scanning_alert": &SecretScanningAlertEvent{}, + "security_advisory": &SecurityAdvisoryEvent{}, "star": &StarEvent{}, "status": &StatusEvent{}, "team": &TeamEvent{}, From a23606b3399729d73e8c54c0a63b7ceeace19be9 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Mon, 12 Jun 2023 19:39:50 -0400 Subject: [PATCH 241/751] Fix auth vulnerability (#2805) --- github/repos_contents.go | 7 +++++++ github/repos_contents_test.go | 14 ++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/github/repos_contents.go b/github/repos_contents.go index be58fd52f66..874a3277283 100644 --- a/github/repos_contents.go +++ b/github/repos_contents.go @@ -192,8 +192,15 @@ func (s *RepositoriesService) DownloadContentsWithMeta(ctx context.Context, owne // as possible, both result types will be returned but only one will contain a // value and the other will be nil. // +// Due to an auth vulnerability issue in the GitHub v3 API, ".." is not allowed +// to appear anywhere in the "path" or this method will return an error. +// // GitHub API docs: https://docs.github.com/en/rest/repos/contents#get-repository-content func (s *RepositoriesService) GetContents(ctx context.Context, owner, repo, path string, opts *RepositoryContentGetOptions) (fileContent *RepositoryContent, directoryContent []*RepositoryContent, resp *Response, err error) { + if strings.Contains(path, "..") { + return nil, nil, nil, errors.New("path must not contain '..' due to auth vulnerability issue") + } + escapedPath := (&url.URL{Path: strings.TrimSuffix(path, "/")}).String() u := fmt.Sprintf("repos/%s/%s/contents/%s", owner, repo, escapedPath) u, err = addOptions(u, opts) diff --git a/github/repos_contents_test.go b/github/repos_contents_test.go index 29262ce2db1..295c21684cd 100644 --- a/github/repos_contents_test.go +++ b/github/repos_contents_test.go @@ -465,6 +465,20 @@ func TestRepositoriesService_GetContents_DirectoryWithSpaces(t *testing.T) { } } +func TestRepositoriesService_GetContents_PathWithParent(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + mux.HandleFunc("/repos/o/r/contents/some/../directory/file.go", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{}`) + }) + ctx := context.Background() + _, _, _, err := client.Repositories.GetContents(ctx, "o", "r", "some/../directory/file.go", &RepositoryContentGetOptions{}) + if err == nil { + t.Fatal("Repositories.GetContents expected error but got none") + } +} + func TestRepositoriesService_GetContents_DirectoryWithPlusChars(t *testing.T) { client, mux, _, teardown := setup() defer teardown() From 8c7625e6a26563e0e031916cc44231912fc52e49 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Mon, 12 Jun 2023 19:45:56 -0400 Subject: [PATCH 242/751] Bump version of go-github to v53.1.0 (#2806) --- README.md | 1 + github/github.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6858fd1aee1..9a5386c2dcf 100644 --- a/README.md +++ b/README.md @@ -396,6 +396,7 @@ Versions prior to 48.2.0 are not listed. | go-github Version | GitHub v3 API Version | | ----------------- | --------------------- | +| 53.1.0 | 2022-11-28 | | 53.0.0 | 2022-11-28 | | 52.0.0 | 2022-11-28 | | 51.0.0 | 2022-11-28 | diff --git a/github/github.go b/github/github.go index 7d8aef53022..db623ffd7bf 100644 --- a/github/github.go +++ b/github/github.go @@ -28,7 +28,7 @@ import ( ) const ( - Version = "v53.0.0" + Version = "v53.1.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" From 6a57598c53efe533b2e183be626d7f72a2fd04a8 Mon Sep 17 00:00:00 2001 From: Daniel Liao <10663736+liaodaniel@users.noreply.github.com> Date: Sat, 17 Jun 2023 22:36:24 +1000 Subject: [PATCH 243/751] Implement rulesets (#2795) Fixes: #2789. --- github/github-accessors.go | 136 +++++++ github/github-accessors_test.go | 155 ++++++++ github/orgs_rules.go | 105 ++++++ github/orgs_rules_test.go | 628 ++++++++++++++++++++++++++++++++ github/repos_rules.go | 447 +++++++++++++++++++++++ github/repos_rules_test.go | 510 ++++++++++++++++++++++++++ 6 files changed, 1981 insertions(+) create mode 100644 github/orgs_rules.go create mode 100644 github/orgs_rules_test.go create mode 100644 github/repos_rules.go create mode 100644 github/repos_rules_test.go diff --git a/github/github-accessors.go b/github/github-accessors.go index a9aaee814ab..2d2e6423829 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -2222,6 +2222,22 @@ func (b *BranchProtectionRuleEvent) GetSender() *User { return b.Sender } +// GetActorID returns the ActorID field if it's non-nil, zero value otherwise. +func (b *BypassActor) GetActorID() int64 { + if b == nil || b.ActorID == nil { + return 0 + } + return *b.ActorID +} + +// GetActorType returns the ActorType field if it's non-nil, zero value otherwise. +func (b *BypassActor) GetActorType() string { + if b == nil || b.ActorType == nil { + return "" + } + return *b.ActorType +} + // GetApp returns the App field. func (c *CheckRun) GetApp() *App { if c == nil { @@ -17918,6 +17934,14 @@ func (r *RepositoryRelease) GetZipballURL() string { return *r.ZipballURL } +// GetParameters returns the Parameters field if it's non-nil, zero value otherwise. +func (r *RepositoryRule) GetParameters() json.RawMessage { + if r == nil || r.Parameters == nil { + return json.RawMessage{} + } + return *r.Parameters +} + // GetCommit returns the Commit field. func (r *RepositoryTag) GetCommit() *Commit { if r == nil { @@ -18366,6 +18390,118 @@ func (r *Rule) GetSeverity() string { return *r.Severity } +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (r *RulePatternParameters) GetName() string { + if r == nil || r.Name == nil { + return "" + } + return *r.Name +} + +// GetNegate returns the Negate field if it's non-nil, zero value otherwise. +func (r *RulePatternParameters) GetNegate() bool { + if r == nil || r.Negate == nil { + return false + } + return *r.Negate +} + +// GetIntegrationID returns the IntegrationID field if it's non-nil, zero value otherwise. +func (r *RuleRequiredStatusChecks) GetIntegrationID() int64 { + if r == nil || r.IntegrationID == nil { + return 0 + } + return *r.IntegrationID +} + +// GetBypassMode returns the BypassMode field if it's non-nil, zero value otherwise. +func (r *Ruleset) GetBypassMode() string { + if r == nil || r.BypassMode == nil { + return "" + } + return *r.BypassMode +} + +// GetConditions returns the Conditions field. +func (r *Ruleset) GetConditions() *RulesetConditions { + if r == nil { + return nil + } + return r.Conditions +} + +// GetLinks returns the Links field. +func (r *Ruleset) GetLinks() *RulesetLinks { + if r == nil { + return nil + } + return r.Links +} + +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (r *Ruleset) GetNodeID() string { + if r == nil || r.NodeID == nil { + return "" + } + return *r.NodeID +} + +// GetSourceType returns the SourceType field if it's non-nil, zero value otherwise. +func (r *Ruleset) GetSourceType() string { + if r == nil || r.SourceType == nil { + return "" + } + return *r.SourceType +} + +// GetTarget returns the Target field if it's non-nil, zero value otherwise. +func (r *Ruleset) GetTarget() string { + if r == nil || r.Target == nil { + return "" + } + return *r.Target +} + +// GetRefName returns the RefName field. +func (r *RulesetConditions) GetRefName() *RulesetRefConditionParameters { + if r == nil { + return nil + } + return r.RefName +} + +// GetRepositoryName returns the RepositoryName field. +func (r *RulesetConditions) GetRepositoryName() *RulesetRepositoryConditionParameters { + if r == nil { + return nil + } + return r.RepositoryName +} + +// GetHRef returns the HRef field if it's non-nil, zero value otherwise. +func (r *RulesetLink) GetHRef() string { + if r == nil || r.HRef == nil { + return "" + } + return *r.HRef +} + +// GetSelf returns the Self field. +func (r *RulesetLinks) GetSelf() *RulesetLink { + if r == nil { + return nil + } + return r.Self +} + +// GetProtected returns the Protected field if it's non-nil, zero value otherwise. +func (r *RulesetRepositoryConditionParameters) GetProtected() bool { + if r == nil || r.Protected == nil { + return false + } + return *r.Protected +} + // GetBusy returns the Busy field if it's non-nil, zero value otherwise. func (r *Runner) GetBusy() bool { if r == nil || r.Busy == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index a29baa0f0c4..15485393bbb 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -2664,6 +2664,26 @@ func TestBranchProtectionRuleEvent_GetSender(tt *testing.T) { b.GetSender() } +func TestBypassActor_GetActorID(tt *testing.T) { + var zeroValue int64 + b := &BypassActor{ActorID: &zeroValue} + b.GetActorID() + b = &BypassActor{} + b.GetActorID() + b = nil + b.GetActorID() +} + +func TestBypassActor_GetActorType(tt *testing.T) { + var zeroValue string + b := &BypassActor{ActorType: &zeroValue} + b.GetActorType() + b = &BypassActor{} + b.GetActorType() + b = nil + b.GetActorType() +} + func TestCheckRun_GetApp(tt *testing.T) { c := &CheckRun{} c.GetApp() @@ -20865,6 +20885,16 @@ func TestRepositoryRelease_GetZipballURL(tt *testing.T) { r.GetZipballURL() } +func TestRepositoryRule_GetParameters(tt *testing.T) { + var zeroValue json.RawMessage + r := &RepositoryRule{Parameters: &zeroValue} + r.GetParameters() + r = &RepositoryRule{} + r.GetParameters() + r = nil + r.GetParameters() +} + func TestRepositoryTag_GetCommit(tt *testing.T) { r := &RepositoryTag{} r.GetCommit() @@ -21404,6 +21434,131 @@ func TestRule_GetSeverity(tt *testing.T) { r.GetSeverity() } +func TestRulePatternParameters_GetName(tt *testing.T) { + var zeroValue string + r := &RulePatternParameters{Name: &zeroValue} + r.GetName() + r = &RulePatternParameters{} + r.GetName() + r = nil + r.GetName() +} + +func TestRulePatternParameters_GetNegate(tt *testing.T) { + var zeroValue bool + r := &RulePatternParameters{Negate: &zeroValue} + r.GetNegate() + r = &RulePatternParameters{} + r.GetNegate() + r = nil + r.GetNegate() +} + +func TestRuleRequiredStatusChecks_GetIntegrationID(tt *testing.T) { + var zeroValue int64 + r := &RuleRequiredStatusChecks{IntegrationID: &zeroValue} + r.GetIntegrationID() + r = &RuleRequiredStatusChecks{} + r.GetIntegrationID() + r = nil + r.GetIntegrationID() +} + +func TestRuleset_GetBypassMode(tt *testing.T) { + var zeroValue string + r := &Ruleset{BypassMode: &zeroValue} + r.GetBypassMode() + r = &Ruleset{} + r.GetBypassMode() + r = nil + r.GetBypassMode() +} + +func TestRuleset_GetConditions(tt *testing.T) { + r := &Ruleset{} + r.GetConditions() + r = nil + r.GetConditions() +} + +func TestRuleset_GetLinks(tt *testing.T) { + r := &Ruleset{} + r.GetLinks() + r = nil + r.GetLinks() +} + +func TestRuleset_GetNodeID(tt *testing.T) { + var zeroValue string + r := &Ruleset{NodeID: &zeroValue} + r.GetNodeID() + r = &Ruleset{} + r.GetNodeID() + r = nil + r.GetNodeID() +} + +func TestRuleset_GetSourceType(tt *testing.T) { + var zeroValue string + r := &Ruleset{SourceType: &zeroValue} + r.GetSourceType() + r = &Ruleset{} + r.GetSourceType() + r = nil + r.GetSourceType() +} + +func TestRuleset_GetTarget(tt *testing.T) { + var zeroValue string + r := &Ruleset{Target: &zeroValue} + r.GetTarget() + r = &Ruleset{} + r.GetTarget() + r = nil + r.GetTarget() +} + +func TestRulesetConditions_GetRefName(tt *testing.T) { + r := &RulesetConditions{} + r.GetRefName() + r = nil + r.GetRefName() +} + +func TestRulesetConditions_GetRepositoryName(tt *testing.T) { + r := &RulesetConditions{} + r.GetRepositoryName() + r = nil + r.GetRepositoryName() +} + +func TestRulesetLink_GetHRef(tt *testing.T) { + var zeroValue string + r := &RulesetLink{HRef: &zeroValue} + r.GetHRef() + r = &RulesetLink{} + r.GetHRef() + r = nil + r.GetHRef() +} + +func TestRulesetLinks_GetSelf(tt *testing.T) { + r := &RulesetLinks{} + r.GetSelf() + r = nil + r.GetSelf() +} + +func TestRulesetRepositoryConditionParameters_GetProtected(tt *testing.T) { + var zeroValue bool + r := &RulesetRepositoryConditionParameters{Protected: &zeroValue} + r.GetProtected() + r = &RulesetRepositoryConditionParameters{} + r.GetProtected() + r = nil + r.GetProtected() +} + func TestRunner_GetBusy(tt *testing.T) { var zeroValue bool r := &Runner{Busy: &zeroValue} diff --git a/github/orgs_rules.go b/github/orgs_rules.go new file mode 100644 index 00000000000..a3905af8fb3 --- /dev/null +++ b/github/orgs_rules.go @@ -0,0 +1,105 @@ +// Copyright 2023 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" +) + +// GetAllOrganizationRulesets gets all the rulesets for the specified organization. +// +// GitHub API docs: https://docs.github.com/en/rest/orgs/rules#get-all-organization-repository-rulesets +func (s *OrganizationsService) GetAllOrganizationRulesets(ctx context.Context, org string) ([]*Ruleset, *Response, error) { + u := fmt.Sprintf("orgs/%v/rulesets", org) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var rulesets []*Ruleset + resp, err := s.client.Do(ctx, req, &rulesets) + if err != nil { + return nil, resp, err + } + + return rulesets, resp, nil +} + +// CreateOrganizationRuleset creates a ruleset for the specified organization. +// +// GitHub API docs: https://docs.github.com/en/rest/orgs/rules#create-an-organization-repository-ruleset +func (s *OrganizationsService) CreateOrganizationRuleset(ctx context.Context, org string, rs *Ruleset) (*Ruleset, *Response, error) { + u := fmt.Sprintf("orgs/%v/rulesets", org) + + req, err := s.client.NewRequest("POST", u, rs) + if err != nil { + return nil, nil, err + } + + var ruleset *Ruleset + resp, err := s.client.Do(ctx, req, &ruleset) + if err != nil { + return nil, resp, err + } + + return ruleset, resp, nil +} + +// GetOrganizationRuleset gets a ruleset from the specified organization. +// +// GitHub API docs: https://docs.github.com/en/rest/orgs/rules#get-an-organization-repository-ruleset +func (s *OrganizationsService) GetOrganizationRuleset(ctx context.Context, org string, rulesetID int64) (*Ruleset, *Response, error) { + u := fmt.Sprintf("orgs/%v/rulesets/%v", org, rulesetID) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var ruleset *Ruleset + resp, err := s.client.Do(ctx, req, &ruleset) + if err != nil { + return nil, resp, err + } + + return ruleset, resp, nil +} + +// UpdateOrganizationRuleset updates a ruleset from the specified organization. +// +// GitHub API docs: https://docs.github.com/en/rest/orgs/rules#update-an-organization-repository-ruleset +func (s *OrganizationsService) UpdateOrganizationRuleset(ctx context.Context, org string, rulesetID int64, rs *Ruleset) (*Ruleset, *Response, error) { + u := fmt.Sprintf("orgs/%v/rulesets/%v", org, rulesetID) + + req, err := s.client.NewRequest("PUT", u, rs) + if err != nil { + return nil, nil, err + } + + var ruleset *Ruleset + resp, err := s.client.Do(ctx, req, &ruleset) + if err != nil { + return nil, resp, err + } + + return ruleset, resp, nil +} + +// DeleteOrganizationRuleset deletes a ruleset from the specified organization. +// +// GitHub API docs: https://docs.github.com/en/rest/orgs/rules#delete-an-organization-repository-ruleset +func (s *OrganizationsService) DeleteOrganizationRuleset(ctx context.Context, org string, rulesetID int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/rulesets/%v", org, rulesetID) + + 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/orgs_rules_test.go b/github/orgs_rules_test.go new file mode 100644 index 00000000000..7719e142fb5 --- /dev/null +++ b/github/orgs_rules_test.go @@ -0,0 +1,628 @@ +// Copyright 2023 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 TestOrganizationsService_GetAllOrganizationRulesets(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/rulesets", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `[{ + "id": 26110, + "name": "test ruleset", + "target": "branch", + "source_type": "Organization", + "source": "o", + "enforcement": "active", + "bypass_mode": "none", + "node_id": "nid", + "_links": { + "self": { + "href": "https://api.github.com/orgs/o/rulesets/26110" + } + } + }]`) + }) + + ctx := context.Background() + rulesets, _, err := client.Organizations.GetAllOrganizationRulesets(ctx, "o") + if err != nil { + t.Errorf("Organizations.GetAllOrganizationRulesets returned error: %v", err) + } + + want := []*Ruleset{{ + ID: 26110, + Name: "test ruleset", + Target: String("branch"), + SourceType: String("Organization"), + Source: "o", + Enforcement: "active", + BypassMode: String("none"), + NodeID: String("nid"), + Links: &RulesetLinks{ + Self: &RulesetLink{HRef: String("https://api.github.com/orgs/o/rulesets/26110")}, + }, + }} + if !cmp.Equal(rulesets, want) { + t.Errorf("Organizations.GetAllOrganizationRulesets returned %+v, want %+v", rulesets, want) + } + + const methodName = "GetAllOrganizationRulesets" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.GetAllOrganizationRulesets(ctx, "o") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_CreateOrganizationRuleset(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/rulesets", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + fmt.Fprint(w, `{ + "id": 21, + "name": "ruleset", + "target": "branch", + "source_type": "Organization", + "source": "o", + "enforcement": "active", + "bypass_actors": [ + { + "actor_id": 234, + "actor_type": "Team" + } + ], + "conditions": { + "ref_name": { + "include": [ + "refs/heads/main", + "refs/heads/master" + ], + "exclude": [ + "refs/heads/dev*" + ] + }, + "repository_name": { + "include": [ + "important_repository", + "another_important_repository" + ], + "exclude": [ + "unimportant_repository" + ], + "protected": true + } + }, + "rules": [ + { + "type": "creation" + }, + { + "type": "update", + "parameters": { + "update_allows_fetch_and_merge": true + } + }, + { + "type": "deletion" + }, + { + "type": "required_linear_history" + }, + { + "type": "required_deployments", + "parameters": { + "required_deployment_environments": ["test"] + } + }, + { + "type": "required_signatures" + }, + { + "type": "pull_request", + "parameters": { + "dismiss_stale_reviews_on_push": true, + "require_code_owner_review": true, + "require_last_push_approval": true, + "required_approving_review_count": 1, + "required_review_thread_resolution": true + } + }, + { + "type": "required_status_checks", + "parameters": { + "required_status_checks": [ + { + "context": "test", + "integration_id": 1 + } + ], + "strict_required_status_checks_policy": true + } + }, + { + "type": "non_fast_forward" + }, + { + "type": "commit_message_pattern", + "parameters": { + "name": "avoid test commits", + "negate": true, + "operator": "starts_with", + "pattern": "[test]" + } + }, + { + "type": "commit_author_email_pattern", + "parameters": { + "operator": "contains", + "pattern": "github" + } + }, + { + "type": "committer_email_pattern", + "parameters": { + "name": "avoid commit emails", + "negate": true, + "operator": "ends_with", + "pattern": "abc" + } + }, + { + "type": "branch_name_pattern", + "parameters": { + "name": "avoid branch names", + "negate": true, + "operator": "regex", + "pattern": "github$" + } + }, + { + "type": "tag_name_pattern", + "parameters": { + "name": "avoid tag names", + "negate": true, + "operator": "contains", + "pattern": "github" + } + } + ] + }`) + }) + + ctx := context.Background() + ruleset, _, err := client.Organizations.CreateOrganizationRuleset(ctx, "o", &Ruleset{ + ID: 21, + Name: "ruleset", + Target: String("branch"), + SourceType: String("Organization"), + Source: "o", + Enforcement: "active", + BypassActors: []*BypassActor{ + { + ActorID: Int64(234), + ActorType: String("Team"), + }, + }, + Conditions: &RulesetConditions{ + RefName: &RulesetRefConditionParameters{ + Include: []string{"refs/heads/main", "refs/heads/master"}, + Exclude: []string{"refs/heads/dev*"}, + }, + RepositoryName: &RulesetRepositoryConditionParameters{ + Include: []string{"important_repository", "another_important_repository"}, + Exclude: []string{"unimportant_repository"}, + Protected: Bool(true), + }, + }, + Rules: []*RepositoryRule{ + NewCreationRule(), + NewUpdateRule(&UpdateAllowsFetchAndMergeRuleParameters{ + UpdateAllowsFetchAndMerge: true, + }), + NewDeletionRule(), + NewRequiredLinearHistoryRule(), + NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ + RequiredDeploymentEnvironments: []string{"test"}, + }), + NewRequiredSignaturesRule(), + NewPullRequestRule(&PullRequestRuleParameters{ + RequireCodeOwnerReview: true, + RequireLastPushApproval: true, + RequiredApprovingReviewCount: 1, + RequiredReviewThreadResolution: true, + DismissStaleReviewsOnPush: true, + }), + NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ + RequiredStatusChecks: []RuleRequiredStatusChecks{ + { + Context: "test", + IntegrationID: Int64(1), + }, + }, + StrictRequiredStatusChecksPolicy: true, + }), + NewNonFastForwardRule(), + NewCommitMessagePatternRule(&RulePatternParameters{ + Name: String("avoid test commits"), + Negate: Bool(true), + Operator: "starts_with", + Pattern: "[test]", + }), + NewCommitAuthorEmailPatternRule(&RulePatternParameters{ + Operator: "contains", + Pattern: "github", + }), + NewCommitterEmailPatternRule(&RulePatternParameters{ + Name: String("avoid commit emails"), + Negate: Bool(true), + Operator: "ends_with", + Pattern: "abc", + }), + NewBranchNamePatternRule(&RulePatternParameters{ + Name: String("avoid branch names"), + Negate: Bool(true), + Operator: "regex", + Pattern: "github$", + }), + NewTagNamePatternRule(&RulePatternParameters{ + Name: String("avoid tag names"), + Negate: Bool(true), + Operator: "contains", + Pattern: "github", + }), + }, + }) + if err != nil { + t.Errorf("Organizations.CreateOrganizationRuleset returned error: %v", err) + } + + want := &Ruleset{ + ID: 21, + Name: "ruleset", + Target: String("branch"), + SourceType: String("Organization"), + Source: "o", + Enforcement: "active", + BypassActors: []*BypassActor{ + { + ActorID: Int64(234), + ActorType: String("Team"), + }, + }, + Conditions: &RulesetConditions{ + RefName: &RulesetRefConditionParameters{ + Include: []string{"refs/heads/main", "refs/heads/master"}, + Exclude: []string{"refs/heads/dev*"}, + }, + RepositoryName: &RulesetRepositoryConditionParameters{ + Include: []string{"important_repository", "another_important_repository"}, + Exclude: []string{"unimportant_repository"}, + Protected: Bool(true), + }, + }, + Rules: []*RepositoryRule{ + NewCreationRule(), + NewUpdateRule(&UpdateAllowsFetchAndMergeRuleParameters{ + UpdateAllowsFetchAndMerge: true, + }), + NewDeletionRule(), + NewRequiredLinearHistoryRule(), + NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ + RequiredDeploymentEnvironments: []string{"test"}, + }), + NewRequiredSignaturesRule(), + NewPullRequestRule(&PullRequestRuleParameters{ + RequireCodeOwnerReview: true, + RequireLastPushApproval: true, + RequiredApprovingReviewCount: 1, + RequiredReviewThreadResolution: true, + DismissStaleReviewsOnPush: true, + }), + NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ + RequiredStatusChecks: []RuleRequiredStatusChecks{ + { + Context: "test", + IntegrationID: Int64(1), + }, + }, + StrictRequiredStatusChecksPolicy: true, + }), + NewNonFastForwardRule(), + NewCommitMessagePatternRule(&RulePatternParameters{ + Name: String("avoid test commits"), + Negate: Bool(true), + Operator: "starts_with", + Pattern: "[test]", + }), + NewCommitAuthorEmailPatternRule(&RulePatternParameters{ + Operator: "contains", + Pattern: "github", + }), + NewCommitterEmailPatternRule(&RulePatternParameters{ + Name: String("avoid commit emails"), + Negate: Bool(true), + Operator: "ends_with", + Pattern: "abc", + }), + NewBranchNamePatternRule(&RulePatternParameters{ + Name: String("avoid branch names"), + Negate: Bool(true), + Operator: "regex", + Pattern: "github$", + }), + NewTagNamePatternRule(&RulePatternParameters{ + Name: String("avoid tag names"), + Negate: Bool(true), + Operator: "contains", + Pattern: "github", + }), + }, + } + if !cmp.Equal(ruleset, want) { + t.Errorf("Organizations.CreateOrganizationRuleset returned %+v, want %+v", ruleset, want) + } + + const methodName = "CreateOrganizationRuleset" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.CreateOrganizationRuleset(ctx, "o", nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_GetOrganizationRuleset(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/rulesets/26110", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "id": 26110, + "name": "test ruleset", + "target": "branch", + "source_type": "Organization", + "source": "o", + "enforcement": "active", + "bypass_mode": "none", + "node_id": "nid", + "_links": { + "self": { + "href": "https://api.github.com/orgs/o/rulesets/26110" + } + }, + "conditions": { + "ref_name": { + "include": [ + "refs/heads/main", + "refs/heads/master" + ], + "exclude": [ + "refs/heads/dev*" + ] + }, + "repository_name": { + "include": [ + "important_repository", + "another_important_repository" + ], + "exclude": [ + "unimportant_repository" + ], + "protected": true + } + }, + "rules": [ + { + "type": "creation" + } + ] + }`) + }) + + ctx := context.Background() + rulesets, _, err := client.Organizations.GetOrganizationRuleset(ctx, "o", 26110) + if err != nil { + t.Errorf("Organizations.GetOrganizationRepositoryRuleset returned error: %v", err) + } + + want := &Ruleset{ + ID: 26110, + Name: "test ruleset", + Target: String("branch"), + SourceType: String("Organization"), + Source: "o", + Enforcement: "active", + BypassMode: String("none"), + NodeID: String("nid"), + Links: &RulesetLinks{ + Self: &RulesetLink{HRef: String("https://api.github.com/orgs/o/rulesets/26110")}, + }, + Conditions: &RulesetConditions{ + RefName: &RulesetRefConditionParameters{ + Include: []string{"refs/heads/main", "refs/heads/master"}, + Exclude: []string{"refs/heads/dev*"}, + }, + RepositoryName: &RulesetRepositoryConditionParameters{ + Include: []string{"important_repository", "another_important_repository"}, + Exclude: []string{"unimportant_repository"}, + Protected: Bool(true), + }, + }, + Rules: []*RepositoryRule{ + NewCreationRule(), + }, + } + if !cmp.Equal(rulesets, want) { + t.Errorf("Organizations.GetOrganizationRuleset returned %+v, want %+v", rulesets, want) + } + + const methodName = "GetOrganizationRuleset" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.GetOrganizationRuleset(ctx, "o", 26110) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_UpdateOrganizationRuleset(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/rulesets/26110", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + fmt.Fprint(w, `{ + "id": 26110, + "name": "test ruleset", + "target": "branch", + "source_type": "Organization", + "source": "o", + "enforcement": "active", + "bypass_mode": "none", + "node_id": "nid", + "_links": { + "self": { + "href": "https://api.github.com/orgs/o/rulesets/26110" + } + }, + "conditions": { + "ref_name": { + "include": [ + "refs/heads/main", + "refs/heads/master" + ], + "exclude": [ + "refs/heads/dev*" + ] + }, + "repository_name": { + "include": [ + "important_repository", + "another_important_repository" + ], + "exclude": [ + "unimportant_repository" + ], + "protected": true + } + }, + "rules": [ + { + "type": "creation" + } + ] + }`) + }) + + ctx := context.Background() + rulesets, _, err := client.Organizations.UpdateOrganizationRuleset(ctx, "o", 26110, &Ruleset{ + Name: "test ruleset", + Target: String("branch"), + Enforcement: "active", + BypassMode: String("none"), + Conditions: &RulesetConditions{ + RefName: &RulesetRefConditionParameters{ + Include: []string{"refs/heads/main", "refs/heads/master"}, + Exclude: []string{"refs/heads/dev*"}, + }, + RepositoryName: &RulesetRepositoryConditionParameters{ + Include: []string{"important_repository", "another_important_repository"}, + Exclude: []string{"unimportant_repository"}, + Protected: Bool(true), + }, + }, + Rules: []*RepositoryRule{ + NewCreationRule(), + }, + }) + + if err != nil { + t.Errorf("Organizations.UpdateOrganizationRuleset returned error: %v", err) + } + + want := &Ruleset{ + ID: 26110, + Name: "test ruleset", + Target: String("branch"), + SourceType: String("Organization"), + Source: "o", + Enforcement: "active", + BypassMode: String("none"), + NodeID: String("nid"), + Links: &RulesetLinks{ + Self: &RulesetLink{HRef: String("https://api.github.com/orgs/o/rulesets/26110")}, + }, + Conditions: &RulesetConditions{ + RefName: &RulesetRefConditionParameters{ + Include: []string{"refs/heads/main", "refs/heads/master"}, + Exclude: []string{"refs/heads/dev*"}, + }, + RepositoryName: &RulesetRepositoryConditionParameters{ + Include: []string{"important_repository", "another_important_repository"}, + Exclude: []string{"unimportant_repository"}, + Protected: Bool(true), + }, + }, + Rules: []*RepositoryRule{ + NewCreationRule(), + }, + } + if !cmp.Equal(rulesets, want) { + t.Errorf("Organizations.UpdateOrganizationRuleset returned %+v, want %+v", rulesets, want) + } + + const methodName = "UpdateOrganizationRuleset" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.UpdateOrganizationRuleset(ctx, "o", 26110, nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_DeleteOrganizationRuleset(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/rulesets/26110", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + }) + + ctx := context.Background() + _, err := client.Organizations.DeleteOrganizationRuleset(ctx, "o", 26110) + if err != nil { + t.Errorf("Organizations.DeleteOrganizationRuleset returned error: %v", err) + } + + const methodName = "DeleteOrganizationRuleset" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Organizations.DeleteOrganizationRuleset(ctx, "0", 26110) + }) +} diff --git a/github/repos_rules.go b/github/repos_rules.go new file mode 100644 index 00000000000..64e7c9ca6df --- /dev/null +++ b/github/repos_rules.go @@ -0,0 +1,447 @@ +// Copyright 2023 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" +) + +// BypassActor represents the bypass actors from a ruleset. +type BypassActor struct { + ActorID *int64 `json:"actor_id,omitempty"` + // Possible values for ActorType are: Team, Integration + ActorType *string `json:"actor_type,omitempty"` +} + +// RulesetLink represents a single link object from GitHub ruleset request _links. +type RulesetLink struct { + HRef *string `json:"href,omitempty"` +} + +// RulesetLinks represents the "_links" object in a Ruleset. +type RulesetLinks struct { + Self *RulesetLink `json:"self,omitempty"` +} + +// RulesetRefConditionParameters represents the conditions object for ref_names. +type RulesetRefConditionParameters struct { + Include []string `json:"include,omitempty"` + Exclude []string `json:"exclude,omitempty"` +} + +// RulesetRepositoryConditionParameters represents the conditions object for repository_names. +type RulesetRepositoryConditionParameters struct { + Include []string `json:"include,omitempty"` + Exclude []string `json:"exclude,omitempty"` + Protected *bool `json:"protected,omitempty"` +} + +// RulesetCondition represents the conditions object in a ruleset. +type RulesetConditions struct { + RefName *RulesetRefConditionParameters `json:"ref_name,omitempty"` + RepositoryName *RulesetRepositoryConditionParameters `json:"repository_name,omitempty"` +} + +// RulePatternParameters represents the rule pattern parameters. +type RulePatternParameters struct { + Name *string `json:"name,omitempty"` + // If Negate is true, the rule will fail if the pattern matches. + Negate *bool `json:"negate,omitempty"` + // Possible values for Operator are: starts_with, ends_with, contains, regex + Operator string `json:"operator"` + Pattern string `json:"pattern"` +} + +// UpdateAllowsFetchAndMergeRuleParameters represents the update rule parameters. +type UpdateAllowsFetchAndMergeRuleParameters struct { + UpdateAllowsFetchAndMerge bool `json:"update_allows_fetch_and_merge"` +} + +// RequiredDeploymentEnvironmentsRuleParameters represents the required_deployments rule parameters. +type RequiredDeploymentEnvironmentsRuleParameters struct { + RequiredDeploymentEnvironments []string `json:"required_deployment_environments"` +} + +// PullRequestRuleParameters represents the pull_request rule parameters. +type PullRequestRuleParameters struct { + DismissStaleReviewsOnPush bool `json:"dismiss_stale_reviews_on_push"` + RequireCodeOwnerReview bool `json:"require_code_owner_review"` + RequireLastPushApproval bool `json:"require_last_push_approval"` + RequiredApprovingReviewCount int `json:"required_approving_review_count"` + RequiredReviewThreadResolution bool `json:"required_review_thread_resolution"` +} + +// RuleRequiredStatusChecks represents the RequiredStatusChecks for the RequiredStatusChecksRuleParameters object. +type RuleRequiredStatusChecks struct { + Context string `json:"context"` + IntegrationID *int64 `json:"integration_id,omitempty"` +} + +// RequiredStatusChecksRuleParameters represents the required_status_checks rule parameters. +type RequiredStatusChecksRuleParameters struct { + RequiredStatusChecks []RuleRequiredStatusChecks `json:"required_status_checks"` + StrictRequiredStatusChecksPolicy bool `json:"strict_required_status_checks_policy"` +} + +// RepositoryRule represents a GitHub Rule. +type RepositoryRule struct { + Type string `json:"type"` + Parameters *json.RawMessage `json:"parameters,omitempty"` +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +// This helps us handle the fact that RepositoryRule parameter field can be of numerous types. +func (r *RepositoryRule) UnmarshalJSON(data []byte) error { + type rule RepositoryRule + var RepositoryRule rule + if err := json.Unmarshal(data, &RepositoryRule); err != nil { + return err + } + + r.Type = RepositoryRule.Type + + switch RepositoryRule.Type { + case "creation", "deletion", "required_linear_history", "required_signatures", "non_fast_forward": + r.Parameters = nil + case "update": + params := UpdateAllowsFetchAndMergeRuleParameters{} + if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { + return err + } + + bytes, _ := json.Marshal(params) + rawParams := json.RawMessage(bytes) + + r.Parameters = &rawParams + case "required_deployments": + params := RequiredDeploymentEnvironmentsRuleParameters{} + if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { + return err + } + + bytes, _ := json.Marshal(params) + rawParams := json.RawMessage(bytes) + + r.Parameters = &rawParams + case "commit_message_pattern", "commit_author_email_pattern", "committer_email_pattern", "branch_name_pattern", "tag_name_pattern": + params := RulePatternParameters{} + if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { + return err + } + + bytes, _ := json.Marshal(params) + rawParams := json.RawMessage(bytes) + + r.Parameters = &rawParams + case "pull_request": + params := PullRequestRuleParameters{} + if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { + return err + } + + bytes, _ := json.Marshal(params) + rawParams := json.RawMessage(bytes) + + r.Parameters = &rawParams + case "required_status_checks": + params := RequiredStatusChecksRuleParameters{} + if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { + return err + } + + bytes, _ := json.Marshal(params) + rawParams := json.RawMessage(bytes) + + r.Parameters = &rawParams + default: + r.Type = "" + r.Parameters = nil + return fmt.Errorf("RepositoryRule.Type %T is not yet implemented, unable to unmarshal", RepositoryRule.Type) + } + + return nil +} + +// NewCreationRule creates a rule to only allow users with bypass permission to create matching refs. +func NewCreationRule() (rule *RepositoryRule) { + return &RepositoryRule{ + Type: "creation", + } +} + +// NewUpdateRule creates a rule to only allow users with bypass permission to update matching refs. +func NewUpdateRule(params *UpdateAllowsFetchAndMergeRuleParameters) (rule *RepositoryRule) { + bytes, _ := json.Marshal(params) + + rawParams := json.RawMessage(bytes) + + return &RepositoryRule{ + Type: "update", + Parameters: &rawParams, + } +} + +// NewDeletionRule creates a rule to only allow users with bypass permissions to delete matching refs. +func NewDeletionRule() (rule *RepositoryRule) { + return &RepositoryRule{ + Type: "deletion", + } +} + +// NewRequiredLinearHistoryRule creates a rule to prevent merge commits from being pushed to matching branches. +func NewRequiredLinearHistoryRule() (rule *RepositoryRule) { + return &RepositoryRule{ + Type: "required_linear_history", + } +} + +// NewRequiredDeploymentsRule creates a rule to require environments to be successfully deployed before they can be merged into the matching branches. +func NewRequiredDeploymentsRule(params *RequiredDeploymentEnvironmentsRuleParameters) (rule *RepositoryRule) { + bytes, _ := json.Marshal(params) + + rawParams := json.RawMessage(bytes) + + return &RepositoryRule{ + Type: "required_deployments", + Parameters: &rawParams, + } +} + +// NewRequiredSignaturesRule creates a rule a to require commits pushed to matching branches to have verified signatures. +func NewRequiredSignaturesRule() (rule *RepositoryRule) { + return &RepositoryRule{ + Type: "required_signatures", + } +} + +// NewPullRequestRule creates a rule to require all commits be made to a non-target branch and submitted via a pull request before they can be merged. +func NewPullRequestRule(params *PullRequestRuleParameters) (rule *RepositoryRule) { + bytes, _ := json.Marshal(params) + + rawParams := json.RawMessage(bytes) + + return &RepositoryRule{ + Type: "pull_request", + Parameters: &rawParams, + } +} + +// NewRequiredStatusChecksRule creates a rule to require which status checks must pass before branches can be merged into a branch rule. +func NewRequiredStatusChecksRule(params *RequiredStatusChecksRuleParameters) (rule *RepositoryRule) { + bytes, _ := json.Marshal(params) + + rawParams := json.RawMessage(bytes) + + return &RepositoryRule{ + Type: "required_status_checks", + Parameters: &rawParams, + } +} + +// NewNonFastForwardRule creates a rule as part to prevent users with push access from force pushing to matching branches. +func NewNonFastForwardRule() (rule *RepositoryRule) { + return &RepositoryRule{ + Type: "non_fast_forward", + } +} + +// NewCommitMessagePatternRule creates a rule to restrict commit message patterns being pushed to matching branches. +func NewCommitMessagePatternRule(params *RulePatternParameters) (rule *RepositoryRule) { + bytes, _ := json.Marshal(params) + + rawParams := json.RawMessage(bytes) + + return &RepositoryRule{ + Type: "commit_message_pattern", + Parameters: &rawParams, + } +} + +// NewCommitAuthorEmailPatternRule creates a rule to restrict commits with author email patterns being merged into matching branches. +func NewCommitAuthorEmailPatternRule(params *RulePatternParameters) (rule *RepositoryRule) { + bytes, _ := json.Marshal(params) + + rawParams := json.RawMessage(bytes) + + return &RepositoryRule{ + Type: "commit_author_email_pattern", + Parameters: &rawParams, + } +} + +// NewCommitterEmailPatternRule creates a rule to restrict commits with committer email patterns being merged into matching branches. +func NewCommitterEmailPatternRule(params *RulePatternParameters) (rule *RepositoryRule) { + bytes, _ := json.Marshal(params) + + rawParams := json.RawMessage(bytes) + + return &RepositoryRule{ + Type: "committer_email_pattern", + Parameters: &rawParams, + } +} + +// NewBranchNamePatternRule creates a rule to restrict branch patterns from being merged into matching branches. +func NewBranchNamePatternRule(params *RulePatternParameters) (rule *RepositoryRule) { + bytes, _ := json.Marshal(params) + + rawParams := json.RawMessage(bytes) + + return &RepositoryRule{ + Type: "branch_name_pattern", + Parameters: &rawParams, + } +} + +// NewTagNamePatternRule creates a rule to restrict tag patterns contained in non-target branches from being merged into matching branches. +func NewTagNamePatternRule(params *RulePatternParameters) (rule *RepositoryRule) { + bytes, _ := json.Marshal(params) + + rawParams := json.RawMessage(bytes) + + return &RepositoryRule{ + Type: "tag_name_pattern", + Parameters: &rawParams, + } +} + +// Ruleset represents a GitHub ruleset object. +type Ruleset struct { + ID int64 `json:"id"` + Name string `json:"name"` + // Possible values for Target are branch, tag + Target *string `json:"target,omitempty"` + // Possible values for SourceType are: Repository, Organization + SourceType *string `json:"source_type,omitempty"` + Source string `json:"source"` + // Possible values for Enforcement are: disabled, active, evaluate + Enforcement string `json:"enforcement"` + // Possible values for BypassMode are: none, repository, organization + BypassMode *string `json:"bypass_mode,omitempty"` + BypassActors []*BypassActor `json:"bypass_actors,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Links *RulesetLinks `json:"_links,omitempty"` + Conditions *RulesetConditions `json:"conditions,omitempty"` + Rules []*RepositoryRule `json:"rules,omitempty"` +} + +// GetRulesForBranch gets all the rules that apply to the specified branch. +// +// GitHub API docs: https://docs.github.com/en/rest/repos/rules#get-rules-for-a-branch +func (s *RepositoriesService) GetRulesForBranch(ctx context.Context, owner, repo, branch string) ([]*RepositoryRule, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/rules/branches/%v", owner, repo, branch) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var rules []*RepositoryRule + resp, err := s.client.Do(ctx, req, &rules) + if err != nil { + return nil, resp, err + } + + return rules, resp, nil +} + +// GetAllRulesets gets all the rules that apply to the specified repository. +// If includesParents is true, rulesets configured at the organization level that apply to the repository will be returned. +// +// GitHub API docs: https://docs.github.com/en/rest/repos/rules#get-all-repository-rulesets +func (s *RepositoriesService) GetAllRulesets(ctx context.Context, owner, repo string, includesParents bool) ([]*Ruleset, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/rulesets?includes_parents=%v", owner, repo, includesParents) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var ruleset []*Ruleset + resp, err := s.client.Do(ctx, req, &ruleset) + if err != nil { + return nil, resp, err + } + + return ruleset, resp, nil +} + +// CreateRuleset creates a ruleset for the specified repository. +// +// GitHub API docs: https://docs.github.com/en/rest/repos/rules#create-a-repository-ruleset +func (s *RepositoriesService) CreateRuleset(ctx context.Context, owner, repo string, rs *Ruleset) (*Ruleset, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/rulesets", owner, repo) + + req, err := s.client.NewRequest("POST", u, rs) + if err != nil { + return nil, nil, err + } + + var ruleset *Ruleset + resp, err := s.client.Do(ctx, req, &ruleset) + if err != nil { + return nil, resp, err + } + + return ruleset, resp, nil +} + +// GetRuleset gets a ruleset for the specified repository. +// If includesParents is true, rulesets configured at the organization level that apply to the repository will be returned. +// +// GitHub API docs: https://docs.github.com/en/rest/repos/rules#get-a-repository-ruleset +func (s *RepositoriesService) GetRuleset(ctx context.Context, owner, repo string, rulesetID int64, includesParents bool) (*Ruleset, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/rulesets/%v?includes_parents=%v", owner, repo, rulesetID, includesParents) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var ruleset *Ruleset + resp, err := s.client.Do(ctx, req, &ruleset) + if err != nil { + return nil, resp, err + } + + return ruleset, resp, nil +} + +// UpdateRuleset updates a ruleset for the specified repository. +// +// GitHub API docs: https://docs.github.com/en/rest/repos/rules#update-a-repository-ruleset +func (s *RepositoriesService) UpdateRuleset(ctx context.Context, owner, repo string, rulesetID int64, rs *Ruleset) (*Ruleset, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/rulesets/%v", owner, repo, rulesetID) + + req, err := s.client.NewRequest("PUT", u, rs) + if err != nil { + return nil, nil, err + } + + var ruleset *Ruleset + resp, err := s.client.Do(ctx, req, &ruleset) + if err != nil { + return nil, resp, err + } + + return ruleset, resp, nil +} + +// DeleteRuleset deletes a ruleset for the specified repository. +// +// GitHub API docs: https://docs.github.com/en/rest/repos/rules#delete-a-repository-ruleset +func (s *RepositoriesService) DeleteRuleset(ctx context.Context, owner, repo string, rulesetID int64) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/rulesets/%v", owner, repo, rulesetID) + + 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/repos_rules_test.go b/github/repos_rules_test.go new file mode 100644 index 00000000000..42c7a6e2ec2 --- /dev/null +++ b/github/repos_rules_test.go @@ -0,0 +1,510 @@ +// Copyright 2023 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 TestRepositoryRule_UnmarshalJSON(t *testing.T) { + tests := map[string]struct { + data string + want *RepositoryRule + wantErr bool + }{ + "Invalid JSON": { + data: `{`, + want: &RepositoryRule{ + Type: "", + Parameters: nil, + }, + wantErr: true, + }, + "Valid creation": { + data: `{"type":"creation"}`, + want: NewCreationRule(), + }, + "Valid deletion": { + data: `{"type":"deletion"}`, + want: &RepositoryRule{ + Type: "deletion", + Parameters: nil, + }, + }, + "Valid required_linear_history": { + data: `{"type":"required_linear_history"}`, + want: &RepositoryRule{ + Type: "required_linear_history", + Parameters: nil, + }, + }, + "Valid required_signatures": { + data: `{"type":"required_signatures"}`, + want: &RepositoryRule{ + Type: "required_signatures", + Parameters: nil, + }, + }, + "Valid non_fast_forward": { + data: `{"type":"non_fast_forward"}`, + want: &RepositoryRule{ + Type: "non_fast_forward", + Parameters: nil, + }, + }, + "Valid update params": { + data: `{"type":"update","parameters":{"update_allows_fetch_and_merge":true}}`, + want: NewUpdateRule(&UpdateAllowsFetchAndMergeRuleParameters{UpdateAllowsFetchAndMerge: true}), + }, + "Invalid update params": { + data: `{"type":"update","parameters":{"update_allows_fetch_and_merge":"true"}}`, + want: &RepositoryRule{ + Type: "update", + Parameters: nil, + }, + wantErr: true, + }, + "Valid required_deployments params": { + data: `{"type":"required_deployments","parameters":{"required_deployment_environments":["test"]}}`, + want: NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ + RequiredDeploymentEnvironments: []string{"test"}, + }), + }, + "Invalid required_deployments params": { + data: `{"type":"required_deployments","parameters":{"required_deployment_environments":true}}`, + want: &RepositoryRule{ + Type: "required_deployments", + Parameters: nil, + }, + wantErr: true, + }, + "Valid commit_message_pattern params": { + data: `{"type":"commit_message_pattern","parameters":{"operator":"starts_with","pattern":"github"}}`, + want: NewCommitMessagePatternRule(&RulePatternParameters{ + Operator: "starts_with", + Pattern: "github", + }), + }, + "Invalid commit_message_pattern params": { + data: `{"type":"commit_message_pattern","parameters":{"operator":"starts_with","pattern":1}}`, + want: &RepositoryRule{ + Type: "commit_message_pattern", + Parameters: nil, + }, + wantErr: true, + }, + "Valid commit_author_email_pattern params": { + data: `{"type":"commit_author_email_pattern","parameters":{"operator":"starts_with","pattern":"github"}}`, + want: NewCommitAuthorEmailPatternRule(&RulePatternParameters{ + Operator: "starts_with", + Pattern: "github", + }), + }, + "Invalid commit_author_email_pattern params": { + data: `{"type":"commit_author_email_pattern","parameters":{"operator":"starts_with","pattern":1}}`, + want: &RepositoryRule{ + Type: "commit_author_email_pattern", + Parameters: nil, + }, + wantErr: true, + }, + "Valid committer_email_pattern params": { + data: `{"type":"committer_email_pattern","parameters":{"operator":"starts_with","pattern":"github"}}`, + want: NewCommitterEmailPatternRule(&RulePatternParameters{ + Operator: "starts_with", + Pattern: "github", + }), + }, + "Invalid committer_email_pattern params": { + data: `{"type":"committer_email_pattern","parameters":{"operator":"starts_with","pattern":1}}`, + want: &RepositoryRule{ + Type: "committer_email_pattern", + Parameters: nil, + }, + wantErr: true, + }, + "Valid branch_name_pattern params": { + data: `{"type":"branch_name_pattern","parameters":{"operator":"starts_with","pattern":"github"}}`, + want: NewBranchNamePatternRule(&RulePatternParameters{ + Operator: "starts_with", + Pattern: "github", + }), + }, + "Invalid branch_name_pattern params": { + data: `{"type":"branch_name_pattern","parameters":{"operator":"starts_with","pattern":1}}`, + want: &RepositoryRule{ + Type: "branch_name_pattern", + Parameters: nil, + }, + wantErr: true, + }, + "Valid tag_name_pattern params": { + data: `{"type":"tag_name_pattern","parameters":{"operator":"starts_with","pattern":"github"}}`, + want: NewTagNamePatternRule(&RulePatternParameters{ + Operator: "starts_with", + Pattern: "github", + }), + }, + "Invalid tag_name_pattern params": { + data: `{"type":"tag_name_pattern","parameters":{"operator":"starts_with","pattern":1}}`, + want: &RepositoryRule{ + Type: "tag_name_pattern", + Parameters: nil, + }, + wantErr: true, + }, + "Valid pull_request params": { + data: `{ + "type":"pull_request", + "parameters":{ + "dismiss_stale_reviews_on_push": true, + "require_code_owner_review": true, + "require_last_push_approval": true, + "required_approving_review_count": 1, + "required_review_thread_resolution":true + } + }`, + want: NewPullRequestRule(&PullRequestRuleParameters{ + DismissStaleReviewsOnPush: true, + RequireCodeOwnerReview: true, + RequireLastPushApproval: true, + RequiredApprovingReviewCount: 1, + RequiredReviewThreadResolution: true, + }), + }, + "Invalid pull_request params": { + data: `{"type":"pull_request","parameters": {"dismiss_stale_reviews_on_push":"true"}}`, + want: &RepositoryRule{ + Type: "pull_request", + Parameters: nil, + }, + wantErr: true, + }, + "Valid required_status_checks params": { + data: `{"type":"required_status_checks","parameters":{"required_status_checks":[{"context":"test","integration_id":1}],"strict_required_status_checks_policy":true}}`, + want: NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ + RequiredStatusChecks: []RuleRequiredStatusChecks{ + { + Context: "test", + IntegrationID: Int64(1), + }, + }, + StrictRequiredStatusChecksPolicy: true, + }), + }, + "Invalid required_status_checks params": { + data: `{"type":"required_status_checks", + "parameters": { + "required_status_checks": [ + { + "context": 1 + } + ] + }}`, + want: &RepositoryRule{ + Type: "required_status_checks", + Parameters: nil, + }, + wantErr: true, + }, + "Invalid type": { + data: `{"type":"unknown"}`, + want: &RepositoryRule{ + Type: "", + Parameters: nil, + }, + wantErr: true, + }, + } + + for name, tc := range tests { + rule := &RepositoryRule{} + + t.Run(name, func(t *testing.T) { + err := rule.UnmarshalJSON([]byte(tc.data)) + if err == nil && tc.wantErr { + t.Errorf("RepositoryRule.UnmarshalJSON returned nil instead of an error") + } + if err != nil && !tc.wantErr { + t.Errorf("RepositoryRule.UnmarshalJSON returned an unexpected error: %+v", err) + } + if !cmp.Equal(tc.want, rule) { + t.Errorf("RepositoryRule.UnmarshalJSON expected rule %+v, got %+v", tc.want, rule) + } + }) + } +} + +func TestRepositoriesService_GetRulesForBranch(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/repo/rules/branches/branch", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `[ + { + "type": "creation" + }, + { + "type": "update", + "parameters": { + "update_allows_fetch_and_merge": true + } + } + ]`) + }) + + ctx := context.Background() + rules, _, err := client.Repositories.GetRulesForBranch(ctx, "o", "repo", "branch") + if err != nil { + t.Errorf("Repositories.GetRulesForBranch returned error: %v", err) + } + + creationRule := NewCreationRule() + updateRule := NewUpdateRule(&UpdateAllowsFetchAndMergeRuleParameters{ + UpdateAllowsFetchAndMerge: true, + }) + + want := []*RepositoryRule{ + creationRule, + updateRule, + } + if !cmp.Equal(rules, want) { + t.Errorf("Repositories.GetRulesForBranch returned %+v, want %+v", rules, want) + } + + const methodName = "GetRulesForBranch" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.GetRulesForBranch(ctx, "o", "repo", "branch") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestRepositoriesService_GetAllRulesets(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/repo/rulesets", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `[ + { + "id": 42, + "name": "ruleset", + "source_type": "Repository", + "source": "o/repo", + "enforcement": "enabled" + }, + { + "id": 314, + "name": "Another ruleset", + "source_type": "Repository", + "source": "o/repo", + "enforcement": "enabled" + } + ]`) + }) + + ctx := context.Background() + ruleSet, _, err := client.Repositories.GetAllRulesets(ctx, "o", "repo", false) + if err != nil { + t.Errorf("Repositories.GetAllRulesets returned error: %v", err) + } + + want := []*Ruleset{ + { + ID: 42, + Name: "ruleset", + SourceType: String("Repository"), + Source: "o/repo", + Enforcement: "enabled", + }, + { + ID: 314, + Name: "Another ruleset", + SourceType: String("Repository"), + Source: "o/repo", + Enforcement: "enabled", + }, + } + if !cmp.Equal(ruleSet, want) { + t.Errorf("Repositories.GetAllRulesets returned %+v, want %+v", ruleSet, want) + } + + const methodName = "GetAllRulesets" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.GetAllRulesets(ctx, "o", "repo", false) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestRepositoriesService_CreateRuleset(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/repo/rulesets", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + fmt.Fprint(w, `{ + "id": 42, + "name": "ruleset", + "source_type": "Repository", + "source": "o/repo", + "enforcement": "enabled" + }`) + }) + + ctx := context.Background() + ruleSet, _, err := client.Repositories.CreateRuleset(ctx, "o", "repo", &Ruleset{ + Name: "ruleset", + Enforcement: "enabled", + }) + if err != nil { + t.Errorf("Repositories.CreateRuleset returned error: %v", err) + } + + want := &Ruleset{ + ID: 42, + Name: "ruleset", + SourceType: String("Repository"), + Source: "o/repo", + Enforcement: "enabled", + } + if !cmp.Equal(ruleSet, want) { + t.Errorf("Repositories.CreateRuleset returned %+v, want %+v", ruleSet, want) + } + + const methodName = "CreateRuleset" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.CreateRuleset(ctx, "o", "repo", &Ruleset{}) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestRepositoriesService_GetRuleset(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/repo/rulesets/42", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "id": 42, + "name": "ruleset", + "source_type": "Organization", + "source": "o", + "enforcement": "enabled" + }`) + }) + + ctx := context.Background() + ruleSet, _, err := client.Repositories.GetRuleset(ctx, "o", "repo", 42, true) + if err != nil { + t.Errorf("Repositories.GetRuleset returned error: %v", err) + } + + want := &Ruleset{ + ID: 42, + Name: "ruleset", + SourceType: String("Organization"), + Source: "o", + Enforcement: "enabled", + } + if !cmp.Equal(ruleSet, want) { + t.Errorf("Repositories.GetRuleset returned %+v, want %+v", ruleSet, want) + } + + const methodName = "GetRuleset" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.GetRuleset(ctx, "o", "repo", 42, true) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestRepositoriesService_UpdateRuleset(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/repo/rulesets/42", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + fmt.Fprint(w, `{ + "id": 42, + "name": "ruleset", + "source_type": "Repository", + "source": "o/repo", + "enforcement": "enabled" + }`) + }) + + ctx := context.Background() + ruleSet, _, err := client.Repositories.UpdateRuleset(ctx, "o", "repo", 42, &Ruleset{ + Name: "ruleset", + Enforcement: "enabled", + }) + if err != nil { + t.Errorf("Repositories.UpdateRuleset returned error: %v", err) + } + + want := &Ruleset{ + ID: 42, + Name: "ruleset", + SourceType: String("Repository"), + Source: "o/repo", + Enforcement: "enabled", + } + if !cmp.Equal(ruleSet, want) { + t.Errorf("Repositories.UpdateRuleset returned %+v, want %+v", ruleSet, want) + } + + const methodName = "UpdateRuleset" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.UpdateRuleset(ctx, "o", "repo", 42, nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestRepositoriesService_DeleteRuleset(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/repo/rulesets/42", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + }) + + ctx := context.Background() + _, err := client.Repositories.DeleteRuleset(ctx, "o", "repo", 42) + if err != nil { + t.Errorf("Repositories.DeleteRuleset returned error: %v", err) + } + + const methodName = "DeleteRuleset" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Repositories.DeleteRuleset(ctx, "o", "repo", 42) + }) +} From b2ae94a9fb964db89f9fc2675f895be720d10731 Mon Sep 17 00:00:00 2001 From: aboy Date: Mon, 19 Jun 2023 20:58:13 +0900 Subject: [PATCH 244/751] Support code scanning default setup configuration (#2808) Fixes: #2751 . --- github/code-scanning.go | 73 +++++++++++++++++++++++ github/code-scanning_test.go | 102 ++++++++++++++++++++++++++++++++ github/github-accessors.go | 48 +++++++++++++++ github/github-accessors_test.go | 60 +++++++++++++++++++ 4 files changed, 283 insertions(+) diff --git a/github/code-scanning.go b/github/code-scanning.go index 6717348ed73..e4a6abeba37 100644 --- a/github/code-scanning.go +++ b/github/code-scanning.go @@ -378,3 +378,76 @@ func (s *CodeScanningService) GetAnalysis(ctx context.Context, owner, repo strin return analysis, resp, nil } + +// DefaultSetupConfiguration represents a code scanning default setup configuration. +type DefaultSetupConfiguration struct { + State *string `json:"state,omitempty"` + Languages []string `json:"languages,omitempty"` + QuerySuite *string `json:"query_suite,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` +} + +// GetDefaultSetupConfiguration gets a code scanning default setup configuration. +// +// You must use an access token with the repo scope to use this +// endpoint with private repos or the public_repo scope for public repos. GitHub Apps must have the repo write +// permission to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/code-scanning#get-a-code-scanning-default-setup-configuration +func (s *CodeScanningService) GetDefaultSetupConfiguration(ctx context.Context, owner, repo string) (*DefaultSetupConfiguration, *Response, error) { + u := fmt.Sprintf("repos/%s/%s/code-scanning/default-setup", owner, repo) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + cfg := new(DefaultSetupConfiguration) + resp, err := s.client.Do(ctx, req, cfg) + if err != nil { + return nil, resp, err + } + + return cfg, resp, nil +} + +// UpdateDefaultSetupConfigurationOptions specifies parameters to the CodeScanningService.UpdateDefaultSetupConfiguration +// method. +type UpdateDefaultSetupConfigurationOptions struct { + State string `json:"state"` + QuerySuite *string `json:"query_suite,omitempty"` + Languages []string `json:"languages,omitempty"` +} + +// UpdateDefaultSetupConfigurationResponse represents a response from updating a code scanning default setup configuration. +type UpdateDefaultSetupConfigurationResponse struct { + RunID *int64 `json:"run_id,omitempty"` + RunURL *string `json:"run_url,omitempty"` +} + +// UpdateDefaultSetupConfiguration updates a code scanning default setup configuration. +// +// You must use an access token with the repo scope to use this +// endpoint with private repos or the public_repo scope for public repos. GitHub Apps must have the repo write +// permission to use this endpoint. +// +// This method might return an AcceptedError and a status code of 202. This is because this is the status that GitHub +// returns to signify that it has now scheduled the update of the pull request branch in a background task. +// +// GitHub API docs: https://docs.github.com/en/rest/code-scanning#update-a-code-scanning-default-setup-configuration +func (s *CodeScanningService) UpdateDefaultSetupConfiguration(ctx context.Context, owner, repo string, options *UpdateDefaultSetupConfigurationOptions) (*UpdateDefaultSetupConfigurationResponse, *Response, error) { + u := fmt.Sprintf("repos/%s/%s/code-scanning/default-setup", owner, repo) + + req, err := s.client.NewRequest("PATCH", u, options) + if err != nil { + return nil, nil, err + } + + a := new(UpdateDefaultSetupConfigurationResponse) + resp, err := s.client.Do(ctx, req, a) + if err != nil { + return nil, resp, err + } + + return a, resp, nil +} diff --git a/github/code-scanning_test.go b/github/code-scanning_test.go index 7911fca6360..29c0b617b84 100644 --- a/github/code-scanning_test.go +++ b/github/code-scanning_test.go @@ -1177,3 +1177,105 @@ func TestCodeScanningService_GetAnalysis(t *testing.T) { return resp, err }) } + +func TestCodeScanningService_GetDefaultSetupConfiguration(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/code-scanning/default-setup", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + _, err := fmt.Fprint(w, `{ + "state": "configured", + "languages": [ + "javascript", + "javascript-typescript", + "typescript" + ], + "query_suite": "default", + "updated_at": "2006-01-02T15:04:05Z" + }`) + if err != nil { + t.Fatal(err) + } + }) + + ctx := context.Background() + cfg, _, err := client.CodeScanning.GetDefaultSetupConfiguration(ctx, "o", "r") + if err != nil { + t.Errorf("CodeScanning.GetDefaultSetupConfiguration returned error: %v", err) + } + + date := &Timestamp{time.Date(2006, time.January, 02, 15, 04, 05, 0, time.UTC)} + want := &DefaultSetupConfiguration{ + State: String("configured"), + Languages: []string{"javascript", "javascript-typescript", "typescript"}, + QuerySuite: String("default"), + UpdatedAt: date, + } + if !cmp.Equal(cfg, want) { + t.Errorf("CodeScanning.GetDefaultSetupConfiguration returned %+v, want %+v", cfg, want) + } + + const methodName = "GetDefaultSetupConfiguration" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.CodeScanning.GetDefaultSetupConfiguration(ctx, "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.CodeScanning.GetDefaultSetupConfiguration(ctx, "o", "r") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestCodeScanningService_UpdateDefaultSetupConfiguration(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/code-scanning/default-setup", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PATCH") + _, err := fmt.Fprint(w, `{ + "run_id": 5301214200, + "run_url": "https://api.github.com/repos/o/r/actions/runs/5301214200" + }`) + if err != nil { + t.Fatal(err) + } + }) + + ctx := context.Background() + options := &UpdateDefaultSetupConfigurationOptions{ + State: "configured", + Languages: []string{"go"}, + QuerySuite: String("default"), + } + got, _, err := client.CodeScanning.UpdateDefaultSetupConfiguration(ctx, "o", "r", options) + if err != nil { + t.Errorf("CodeScanning.UpdateDefaultSetupConfiguration returned error: %v", err) + } + + want := &UpdateDefaultSetupConfigurationResponse{ + RunID: Int64(5301214200), + RunURL: String("https://api.github.com/repos/o/r/actions/runs/5301214200"), + } + if !cmp.Equal(got, want) { + t.Errorf("CodeScanning.UpdateDefaultSetupConfiguration returned %+v, want %+v", got, want) + } + + const methodName = "UpdateDefaultSetupConfiguration" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.CodeScanning.UpdateDefaultSetupConfiguration(ctx, "\n", "\n", nil) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.CodeScanning.UpdateDefaultSetupConfiguration(ctx, "o", "r", nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} diff --git a/github/github-accessors.go b/github/github-accessors.go index 2d2e6423829..3504a87514f 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -4278,6 +4278,30 @@ func (c *CustomRepoRoles) GetName() string { return *c.Name } +// GetQuerySuite returns the QuerySuite field if it's non-nil, zero value otherwise. +func (d *DefaultSetupConfiguration) GetQuerySuite() string { + if d == nil || d.QuerySuite == nil { + return "" + } + return *d.QuerySuite +} + +// GetState returns the State field if it's non-nil, zero value otherwise. +func (d *DefaultSetupConfiguration) GetState() string { + if d == nil || d.State == nil { + return "" + } + return *d.State +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (d *DefaultSetupConfiguration) GetUpdatedAt() Timestamp { + if d == nil || d.UpdatedAt == nil { + return Timestamp{} + } + return *d.UpdatedAt +} + // GetInstallation returns the Installation field. func (d *DeleteEvent) GetInstallation() *Installation { if d == nil { @@ -21134,6 +21158,30 @@ func (u *UpdateCheckRunOptions) GetStatus() string { return *u.Status } +// GetQuerySuite returns the QuerySuite field if it's non-nil, zero value otherwise. +func (u *UpdateDefaultSetupConfigurationOptions) GetQuerySuite() string { + if u == nil || u.QuerySuite == nil { + return "" + } + return *u.QuerySuite +} + +// GetRunID returns the RunID field if it's non-nil, zero value otherwise. +func (u *UpdateDefaultSetupConfigurationResponse) GetRunID() int64 { + if u == nil || u.RunID == nil { + return 0 + } + return *u.RunID +} + +// GetRunURL returns the RunURL field if it's non-nil, zero value otherwise. +func (u *UpdateDefaultSetupConfigurationResponse) GetRunURL() string { + if u == nil || u.RunURL == nil { + return "" + } + return *u.RunURL +} + // GetAllowsPublicRepositories returns the AllowsPublicRepositories field if it's non-nil, zero value otherwise. func (u *UpdateRunnerGroupRequest) GetAllowsPublicRepositories() bool { if u == nil || u.AllowsPublicRepositories == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 15485393bbb..f9950350fe2 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -5036,6 +5036,36 @@ func TestCustomRepoRoles_GetName(tt *testing.T) { c.GetName() } +func TestDefaultSetupConfiguration_GetQuerySuite(tt *testing.T) { + var zeroValue string + d := &DefaultSetupConfiguration{QuerySuite: &zeroValue} + d.GetQuerySuite() + d = &DefaultSetupConfiguration{} + d.GetQuerySuite() + d = nil + d.GetQuerySuite() +} + +func TestDefaultSetupConfiguration_GetState(tt *testing.T) { + var zeroValue string + d := &DefaultSetupConfiguration{State: &zeroValue} + d.GetState() + d = &DefaultSetupConfiguration{} + d.GetState() + d = nil + d.GetState() +} + +func TestDefaultSetupConfiguration_GetUpdatedAt(tt *testing.T) { + var zeroValue Timestamp + d := &DefaultSetupConfiguration{UpdatedAt: &zeroValue} + d.GetUpdatedAt() + d = &DefaultSetupConfiguration{} + d.GetUpdatedAt() + d = nil + d.GetUpdatedAt() +} + func TestDeleteEvent_GetInstallation(tt *testing.T) { d := &DeleteEvent{} d.GetInstallation() @@ -24651,6 +24681,36 @@ func TestUpdateCheckRunOptions_GetStatus(tt *testing.T) { u.GetStatus() } +func TestUpdateDefaultSetupConfigurationOptions_GetQuerySuite(tt *testing.T) { + var zeroValue string + u := &UpdateDefaultSetupConfigurationOptions{QuerySuite: &zeroValue} + u.GetQuerySuite() + u = &UpdateDefaultSetupConfigurationOptions{} + u.GetQuerySuite() + u = nil + u.GetQuerySuite() +} + +func TestUpdateDefaultSetupConfigurationResponse_GetRunID(tt *testing.T) { + var zeroValue int64 + u := &UpdateDefaultSetupConfigurationResponse{RunID: &zeroValue} + u.GetRunID() + u = &UpdateDefaultSetupConfigurationResponse{} + u.GetRunID() + u = nil + u.GetRunID() +} + +func TestUpdateDefaultSetupConfigurationResponse_GetRunURL(tt *testing.T) { + var zeroValue string + u := &UpdateDefaultSetupConfigurationResponse{RunURL: &zeroValue} + u.GetRunURL() + u = &UpdateDefaultSetupConfigurationResponse{} + u.GetRunURL() + u = nil + u.GetRunURL() +} + func TestUpdateRunnerGroupRequest_GetAllowsPublicRepositories(tt *testing.T) { var zeroValue bool u := &UpdateRunnerGroupRequest{AllowsPublicRepositories: &zeroValue} From 4f74d0cd59cc0e5a3b1d64dd10a9cc90336a3699 Mon Sep 17 00:00:00 2001 From: Magnus Kulke Date: Mon, 19 Jun 2023 13:59:59 +0200 Subject: [PATCH 245/751] Add generate-jitconfig API for self-hosted runners (#2801) --- github/actions_runners.go | 54 ++++++++++++++++++++ github/actions_runners_test.go | 89 +++++++++++++++++++++++++++++++++ github/github-accessors.go | 16 ++++++ github/github-accessors_test.go | 20 ++++++++ 4 files changed, 179 insertions(+) diff --git a/github/actions_runners.go b/github/actions_runners.go index 40c6be3a92c..3990a5a90f7 100644 --- a/github/actions_runners.go +++ b/github/actions_runners.go @@ -45,6 +45,60 @@ func (s *ActionsService) ListRunnerApplicationDownloads(ctx context.Context, own return rads, resp, nil } +// GenerateJITConfigRequest specifies body parameters to GenerateRepoJITConfig. +type GenerateJITConfigRequest struct { + Name string `json:"name"` + RunnerGroupID int64 `json:"runner_group_id"` + WorkFolder *string `json:"work_folder,omitempty"` + + // Labels represents the names of the custom labels to add to the runner. + // Minimum items: 1. Maximum items: 100. + Labels []string `json:"labels"` +} + +// JITRunnerConfig represents encoded JIT configuration that can be used to bootstrap a self-hosted runner. +type JITRunnerConfig struct { + EncodedJITConfig *string `json:"encoded_jit_config,omitempty"` +} + +// GenerateOrgJITConfig generate a just-in-time configuration for an organization. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-configuration-for-a-just-in-time-runner-for-an-organization +func (s *ActionsService) GenerateOrgJITConfig(ctx context.Context, owner string, request *GenerateJITConfigRequest) (*JITRunnerConfig, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/runners/generate-jitconfig", owner) + req, err := s.client.NewRequest("POST", u, request) + if err != nil { + return nil, nil, err + } + + jitConfig := new(JITRunnerConfig) + resp, err := s.client.Do(ctx, req, jitConfig) + if err != nil { + return nil, resp, err + } + + return jitConfig, resp, nil +} + +// GenerateRepoJITConfig generates a just-in-time configuration for a repository. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-configuration-for-a-just-in-time-runner-for-a-repository +func (s *ActionsService) GenerateRepoJITConfig(ctx context.Context, owner, repo string, request *GenerateJITConfigRequest) (*JITRunnerConfig, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/runners/generate-jitconfig", owner, repo) + req, err := s.client.NewRequest("POST", u, request) + if err != nil { + return nil, nil, err + } + + jitConfig := new(JITRunnerConfig) + resp, err := s.client.Do(ctx, req, jitConfig) + if err != nil { + return nil, resp, err + } + + return jitConfig, resp, nil +} + // RegistrationToken represents a token that can be used to add a self-hosted runner to a repository. type RegistrationToken struct { Token *string `json:"token,omitempty"` diff --git a/github/actions_runners_test.go b/github/actions_runners_test.go index 9b338641eae..8063152f93a 100644 --- a/github/actions_runners_test.go +++ b/github/actions_runners_test.go @@ -7,6 +7,7 @@ package github import ( "context" + "encoding/json" "fmt" "net/http" "testing" @@ -56,6 +57,94 @@ func TestActionsService_ListRunnerApplicationDownloads(t *testing.T) { }) } +func TestActionsService_GenerateOrgJITConfig(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + input := &GenerateJITConfigRequest{Name: "test", RunnerGroupID: 1, Labels: []string{"one", "two"}} + + mux.HandleFunc("/orgs/o/actions/runners/generate-jitconfig", func(w http.ResponseWriter, r *http.Request) { + v := new(GenerateJITConfigRequest) + 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, `{"encoded_jit_config":"foo"}`) + }) + + ctx := context.Background() + jitConfig, _, err := client.Actions.GenerateOrgJITConfig(ctx, "o", input) + if err != nil { + t.Errorf("Actions.GenerateOrgJITConfig returned error: %v", err) + } + + want := &JITRunnerConfig{EncodedJITConfig: String("foo")} + if !cmp.Equal(jitConfig, want) { + t.Errorf("Actions.GenerateOrgJITConfig returned %+v, want %+v", jitConfig, want) + } + + const methodName = "GenerateOrgJITConfig" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.GenerateOrgJITConfig(ctx, "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.GenerateOrgJITConfig(ctx, "o", input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_GenerateRepoJITConfig(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + input := &GenerateJITConfigRequest{Name: "test", RunnerGroupID: 1, Labels: []string{"one", "two"}} + + mux.HandleFunc("/repos/o/r/actions/runners/generate-jitconfig", func(w http.ResponseWriter, r *http.Request) { + v := new(GenerateJITConfigRequest) + 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, `{"encoded_jit_config":"foo"}`) + }) + + ctx := context.Background() + jitConfig, _, err := client.Actions.GenerateRepoJITConfig(ctx, "o", "r", input) + if err != nil { + t.Errorf("Actions.GenerateRepoJITConfig returned error: %v", err) + } + + want := &JITRunnerConfig{EncodedJITConfig: String("foo")} + if !cmp.Equal(jitConfig, want) { + t.Errorf("Actions.GenerateRepoJITConfig returned %+v, want %+v", jitConfig, want) + } + + const methodName = "GenerateRepoJITConfig" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.GenerateRepoJITConfig(ctx, "\n", "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.GenerateRepoJITConfig(ctx, "o", "r", input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + func TestActionsService_CreateRegistrationToken(t *testing.T) { client, mux, _, teardown := setup() defer teardown() diff --git a/github/github-accessors.go b/github/github-accessors.go index 3504a87514f..2f35ed7a902 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -6350,6 +6350,14 @@ func (f *ForkEvent) GetSender() *User { return f.Sender } +// GetWorkFolder returns the WorkFolder field if it's non-nil, zero value otherwise. +func (g *GenerateJITConfigRequest) GetWorkFolder() string { + if g == nil || g.WorkFolder == nil { + return "" + } + return *g.WorkFolder +} + // GetPreviousTagName returns the PreviousTagName field if it's non-nil, zero value otherwise. func (g *GenerateNotesOptions) GetPreviousTagName() string { if g == nil || g.PreviousTagName == nil { @@ -8974,6 +8982,14 @@ func (i *IssueStats) GetTotalIssues() int { return *i.TotalIssues } +// GetEncodedJITConfig returns the EncodedJITConfig field if it's non-nil, zero value otherwise. +func (j *JITRunnerConfig) GetEncodedJITConfig() string { + if j == nil || j.EncodedJITConfig == nil { + return "" + } + return *j.EncodedJITConfig +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (j *Jobs) GetTotalCount() int { if j == nil || j.TotalCount == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index f9950350fe2..f83f47381fa 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -7413,6 +7413,16 @@ func TestForkEvent_GetSender(tt *testing.T) { f.GetSender() } +func TestGenerateJITConfigRequest_GetWorkFolder(tt *testing.T) { + var zeroValue string + g := &GenerateJITConfigRequest{WorkFolder: &zeroValue} + g.GetWorkFolder() + g = &GenerateJITConfigRequest{} + g.GetWorkFolder() + g = nil + g.GetWorkFolder() +} + func TestGenerateNotesOptions_GetPreviousTagName(tt *testing.T) { var zeroValue string g := &GenerateNotesOptions{PreviousTagName: &zeroValue} @@ -10507,6 +10517,16 @@ func TestIssueStats_GetTotalIssues(tt *testing.T) { i.GetTotalIssues() } +func TestJITRunnerConfig_GetEncodedJITConfig(tt *testing.T) { + var zeroValue string + j := &JITRunnerConfig{EncodedJITConfig: &zeroValue} + j.GetEncodedJITConfig() + j = &JITRunnerConfig{} + j.GetEncodedJITConfig() + j = nil + j.GetEncodedJITConfig() +} + func TestJobs_GetTotalCount(tt *testing.T) { var zeroValue int j := &Jobs{TotalCount: &zeroValue} From 56c2c3bff959e5ab9818a73bd4489d876f04d184 Mon Sep 17 00:00:00 2001 From: Aidan Date: Mon, 19 Jun 2023 05:04:47 -0700 Subject: [PATCH 246/751] Initial implementation of codespaces API (#2803) --- .../newreposecretwithxcrypto/main.go | 164 ++++ .../newusersecretwithxcrypto/main.go | 171 ++++ example/newreposecretwithxcrypto/main.go | 4 +- github/codespaces.go | 254 ++++++ github/codespaces_secrets.go | 405 +++++++++ github/codespaces_secrets_test.go | 803 ++++++++++++++++++ github/codespaces_test.go | 291 +++++++ github/github-accessors.go | 424 +++++++++ github/github-accessors_test.go | 512 +++++++++++ github/github.go | 2 + 10 files changed, 3028 insertions(+), 2 deletions(-) create mode 100644 example/codespaces/newreposecretwithxcrypto/main.go create mode 100644 example/codespaces/newusersecretwithxcrypto/main.go create mode 100644 github/codespaces.go create mode 100644 github/codespaces_secrets.go create mode 100644 github/codespaces_secrets_test.go create mode 100644 github/codespaces_test.go diff --git a/example/codespaces/newreposecretwithxcrypto/main.go b/example/codespaces/newreposecretwithxcrypto/main.go new file mode 100644 index 00000000000..fcc547b3a43 --- /dev/null +++ b/example/codespaces/newreposecretwithxcrypto/main.go @@ -0,0 +1,164 @@ +// Copyright 2023 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. + +// newreposecretwithxcrypto creates a new secret in GitHub for a given owner/repo. +// newreposecretwithxcrypto uses x/crypto/nacl/box instead of sodium. +// It does not depend on any native libraries and is easier to cross-compile for different platforms. +// Quite possibly there is a performance penalty due to this. +// +// newreposecretwithxcrypto has two required flags for owner and repo, and takes in one argument for the name of the secret to add. +// The secret value is pulled from an environment variable based on the secret name. +// To authenticate with GitHub, provide your token via an environment variable GITHUB_AUTH_TOKEN. +// +// To verify the new secret, navigate to GitHub Repository > Settings > left side options bar > Secrets. +// +// Usage: +// +// export GITHUB_AUTH_TOKEN= +// export SECRET_VARIABLE= +// go run main.go -owner -repo SECRET_VARIABLE +// +// Example: +// +// export GITHUB_AUTH_TOKEN=0000000000000000 +// export SECRET_VARIABLE="my-secret" +// go run main.go -owner google -repo go-github SECRET_VARIABLE +package main + +import ( + "context" + crypto_rand "crypto/rand" + "encoding/base64" + "flag" + "fmt" + "log" + "os" + + "github.com/google/go-github/v53/github" + "golang.org/x/crypto/nacl/box" +) + +var ( + repo = flag.String("repo", "", "The repo that the secret should be added to, ex. go-github") + owner = flag.String("owner", "", "The owner of there repo this should be added to, ex. google") +) + +func main() { + flag.Parse() + + token := os.Getenv("GITHUB_AUTH_TOKEN") + if token == "" { + log.Fatal("please provide a GitHub API token via env variable GITHUB_AUTH_TOKEN") + } + + if *repo == "" { + log.Fatal("please provide required flag --repo to specify GitHub repository ") + } + + if *owner == "" { + log.Fatal("please provide required flag --owner to specify GitHub user/org owner") + } + + secretName, err := getSecretName() + if err != nil { + log.Fatal(err) + } + + secretValue, err := getSecretValue(secretName) + if err != nil { + log.Fatal(err) + } + + ctx := context.Background() + client := github.NewTokenClient(ctx, token) + + if err := addRepoSecret(ctx, client, *owner, *repo, secretName, secretValue); err != nil { + log.Fatal(err) + } + + fmt.Printf("Added secret %q to the repo %v/%v\n", secretName, *owner, *repo) +} + +func getSecretName() (string, error) { + secretName := flag.Arg(0) + if secretName == "" { + return "", fmt.Errorf("missing argument secret name") + } + return secretName, nil +} + +func getSecretValue(secretName string) (string, error) { + secretValue := os.Getenv(secretName) + if secretValue == "" { + return "", fmt.Errorf("secret value not found under env variable %q", secretName) + } + return secretValue, nil +} + +// addRepoSecret will add a secret to a GitHub repo for use in GitHub Codespaces. +// +// The secretName and secretValue will determine the name of the secret added and it's corresponding value. +// +// The actual transmission of the secret value to GitHub using the api requires that the secret value is encrypted +// using the public key of the target repo. This encryption is done using x/crypto/nacl/box. +// +// First, the public key of the repo is retrieved. The public key comes base64 +// encoded, so it must be decoded prior to use. +// +// Second, the decode key is converted into a fixed size byte array. +// +// Third, the secret value is converted into a slice of bytes. +// +// Fourth, the secret is encrypted with box.SealAnonymous using the repo's decoded public key. +// +// Fifth, the encrypted secret is encoded as a base64 string to be used in a github.EncodedSecret type. +// +// Sixth, The other two properties of the github.EncodedSecret type are determined. The name of the secret to be added +// (string not base64), and the KeyID of the public key used to encrypt the secret. +// This can be retrieved via the public key's GetKeyID method. +// +// Finally, the github.EncodedSecret is passed into the GitHub client.Codespaces.CreateOrUpdateRepoSecret method to +// populate the secret in the GitHub repo. +func addRepoSecret(ctx context.Context, client *github.Client, owner string, repo, secretName string, secretValue string) error { + publicKey, _, err := client.Codespaces.GetRepoPublicKey(ctx, owner, repo) + if err != nil { + return err + } + + encryptedSecret, err := encryptSecretWithPublicKey(publicKey, secretName, secretValue) + if err != nil { + return err + } + + if _, err := client.Codespaces.CreateOrUpdateRepoSecret(ctx, owner, repo, encryptedSecret); err != nil { + return fmt.Errorf("Codespaces.CreateOrUpdateRepoSecret returned error: %v", err) + } + + return nil +} + +func encryptSecretWithPublicKey(publicKey *github.PublicKey, secretName string, secretValue string) (*github.EncryptedSecret, error) { + decodedPublicKey, err := base64.StdEncoding.DecodeString(publicKey.GetKey()) + if err != nil { + return nil, fmt.Errorf("base64.StdEncoding.DecodeString was unable to decode public key: %v", err) + } + + var boxKey [32]byte + copy(boxKey[:], decodedPublicKey) + secretBytes := []byte(secretValue) + encryptedBytes, err := box.SealAnonymous([]byte{}, secretBytes, &boxKey, crypto_rand.Reader) + if err != nil { + return nil, fmt.Errorf("box.SealAnonymous failed with error %w", err) + } + + encryptedString := base64.StdEncoding.EncodeToString(encryptedBytes) + keyID := publicKey.GetKeyID() + encryptedSecret := &github.EncryptedSecret{ + Name: secretName, + KeyID: keyID, + EncryptedValue: encryptedString, + } + return encryptedSecret, nil +} diff --git a/example/codespaces/newusersecretwithxcrypto/main.go b/example/codespaces/newusersecretwithxcrypto/main.go new file mode 100644 index 00000000000..dd230c1da0c --- /dev/null +++ b/example/codespaces/newusersecretwithxcrypto/main.go @@ -0,0 +1,171 @@ +// Copyright 2023 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. + +// newusersecretwithxcrypto creates a new secret in GitHub for a given user. +// newusersecretwithxcrypto uses x/crypto/nacl/box instead of sodium. +// It does not depend on any native libraries and is easier to cross-compile for different platforms. +// Quite possibly there is a performance penalty due to this. +// +// newusersecretwithxcrypto takes in one argument for the name of the secret to add, and 2 flags owner, repo. +// If owner/repo are defined then it adds the secret to that repository +// The secret value is pulled from an environment variable based on the secret name. +// To authenticate with GitHub, provide your token via an environment variable GITHUB_AUTH_TOKEN. +// +// To verify the new secret, navigate to GitHub User > Settings > left side options bar > Codespaces > Secrets. +// +// Usage: +// +// export GITHUB_AUTH_TOKEN= +// export SECRET_VARIABLE= +// go run main.go SECRET_VARIABLE +// +// Example: +// +// export GITHUB_AUTH_TOKEN=0000000000000000 +// export SECRET_VARIABLE="my-secret" +// go run main.go SECRET_VARIABLE +package main + +import ( + "context" + crypto_rand "crypto/rand" + "encoding/base64" + "flag" + "fmt" + "log" + "os" + + "github.com/google/go-github/v53/github" + "golang.org/x/crypto/nacl/box" +) + +var ( + repo = flag.String("repo", "", "The repo that the secret should be added to, ex. go-github") + owner = flag.String("owner", "", "The owner of there repo this should be added to, ex. google") +) + +func main() { + flag.Parse() + + token := os.Getenv("GITHUB_AUTH_TOKEN") + if token == "" { + log.Fatal("please provide a GitHub API token via env variable GITHUB_AUTH_TOKEN") + } + + secretName, err := getSecretName() + if err != nil { + log.Fatal(err) + } + + secretValue, err := getSecretValue(secretName) + if err != nil { + log.Fatal(err) + } + + ctx := context.Background() + client := github.NewTokenClient(ctx, token) + + if err := addUserSecret(ctx, client, secretName, secretValue, *owner, *repo); err != nil { + log.Fatal(err) + } + + fmt.Printf("Added secret %q to the authenticated user\n", secretName) +} + +func getSecretName() (string, error) { + secretName := flag.Arg(0) + if secretName == "" { + return "", fmt.Errorf("missing argument secret name") + } + return secretName, nil +} + +func getSecretValue(secretName string) (string, error) { + secretValue := os.Getenv(secretName) + if secretValue == "" { + return "", fmt.Errorf("secret value not found under env variable %q", secretName) + } + return secretValue, nil +} + +// addUserSecret will add a secret to a GitHub user for use in GitHub Codespaces. +// +// The secretName and secretValue will determine the name of the secret added and it's corresponding value. +// +// The actual transmission of the secret value to GitHub using the api requires that the secret value is encrypted +// using the public key of the target user. This encryption is done using x/crypto/nacl/box. +// +// First, the public key of the user is retrieved. The public key comes base64 +// encoded, so it must be decoded prior to use. +// +// Second, the decode key is converted into a fixed size byte array. +// +// Third, the secret value is converted into a slice of bytes. +// +// Fourth, the secret is encrypted with box.SealAnonymous using the user's decoded public key. +// +// Fifth, the encrypted secret is encoded as a base64 string to be used in a github.EncodedSecret type. +// +// Sixth, The other two properties of the github.EncodedSecret type are determined. The name of the secret to be added +// (string not base64), and the KeyID of the public key used to encrypt the secret. +// This can be retrieved via the public key's GetKeyID method. +// +// Seventh, the github.EncodedSecret is passed into the GitHub client.Codespaces.CreateOrUpdateUserSecret method to +// populate the secret in the GitHub user. +// +// Finally, if a repo and owner are passed in, it adds the repo to the user secret. +func addUserSecret(ctx context.Context, client *github.Client, secretName, secretValue, owner, repo string) error { + publicKey, _, err := client.Codespaces.GetUserPublicKey(ctx) + if err != nil { + return err + } + + encryptedSecret, err := encryptSecretWithPublicKey(publicKey, secretName, secretValue) + if err != nil { + return err + } + + if _, err := client.Codespaces.CreateOrUpdateUserSecret(ctx, encryptedSecret); err != nil { + return fmt.Errorf("Codespaces.CreateOrUpdateUserSecret returned error: %v", err) + } + + if owner != "" && repo != "" { + r, _, err := client.Repositories.Get(ctx, owner, repo) + if err != nil { + return fmt.Errorf("Repositories.Get returned error: %v", err) + } + _, err = client.Codespaces.AddSelectedRepoToUserSecret(ctx, encryptedSecret.Name, r) + if err != nil { + return fmt.Errorf("Codespaces.AddSelectedRepoToUserSecret returned error: %v", err) + } + fmt.Printf("Added secret %q to %v/%v\n", secretName, owner, repo) + } + + return nil +} + +func encryptSecretWithPublicKey(publicKey *github.PublicKey, secretName string, secretValue string) (*github.EncryptedSecret, error) { + decodedPublicKey, err := base64.StdEncoding.DecodeString(publicKey.GetKey()) + if err != nil { + return nil, fmt.Errorf("base64.StdEncoding.DecodeString was unable to decode public key: %v", err) + } + + var boxKey [32]byte + copy(boxKey[:], decodedPublicKey) + secretBytes := []byte(secretValue) + encryptedBytes, err := box.SealAnonymous([]byte{}, secretBytes, &boxKey, crypto_rand.Reader) + if err != nil { + return nil, fmt.Errorf("box.SealAnonymous failed with error %w", err) + } + + encryptedString := base64.StdEncoding.EncodeToString(encryptedBytes) + keyID := publicKey.GetKeyID() + encryptedSecret := &github.EncryptedSecret{ + Name: secretName, + KeyID: keyID, + EncryptedValue: encryptedString, + } + return encryptedSecret, nil +} diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index d6e329295bf..564fc069593 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -99,7 +99,7 @@ func getSecretValue(secretName string) (string, error) { // addRepoSecret will add a secret to a GitHub repo for use in GitHub Actions. // -// Finally, the secretName and secretValue will determine the name of the secret added and it's corresponding value. +// The secretName and secretValue will determine the name of the secret added and it's corresponding value. // // The actual transmission of the secret value to GitHub using the api requires that the secret value is encrypted // using the public key of the target repo. This encryption is done using x/crypto/nacl/box. @@ -115,7 +115,7 @@ func getSecretValue(secretName string) (string, error) { // // Fifth, the encrypted secret is encoded as a base64 string to be used in a github.EncodedSecret type. // -// Sixt, The other two properties of the github.EncodedSecret type are determined. The name of the secret to be added +// Sixth, The other two properties of the github.EncodedSecret type are determined. The name of the secret to be added // (string not base64), and the KeyID of the public key used to encrypt the secret. // This can be retrieved via the public key's GetKeyID method. // diff --git a/github/codespaces.go b/github/codespaces.go new file mode 100644 index 00000000000..a260c227de7 --- /dev/null +++ b/github/codespaces.go @@ -0,0 +1,254 @@ +// Copyright 2023 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" +) + +// CodespacesService handles communication with the Codespaces related +// methods of the GitHub API. +// +// GitHub API docs: https://docs.github.com/en/rest/codespaces/ +type CodespacesService service + +// Codespace represents a codespace. +// +// GitHub API docs: https://docs.github.com/en/rest/codespaces +type Codespace struct { + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + DisplayName *string `json:"display_name,omitempty"` + EnvironmentID *string `json:"environment_id,omitempty"` + Owner *User `json:"owner,omitempty"` + BillableOwner *User `json:"billable_owner,omitempty"` + Repository *Repository `json:"repository,omitempty"` + Machine *CodespacesMachine `json:"machine,omitempty"` + DevcontainerPath *string `json:"devcontainer_path,omitempty"` + Prebuild *bool `json:"prebuild,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + LastUsedAt *Timestamp `json:"last_used_at,omitempty"` + State *string `json:"state,omitempty"` + URL *string `json:"url,omitempty"` + GitStatus *CodespacesGitStatus `json:"git_status,omitempty"` + Location *string `json:"location,omitempty"` + IdleTimeoutMinutes *int `json:"idle_timeout_minutes,omitempty"` + WebURL *string `json:"web_url,omitempty"` + MachinesURL *string `json:"machines_url,omitempty"` + StartURL *string `json:"start_url,omitempty"` + StopURL *string `json:"stop_url,omitempty"` + PullsURL *string `json:"pulls_url,omitempty"` + RecentFolders []string `json:"recent_folders,omitempty"` + RuntimeConstraints *CodespacesRuntimeConstraints `json:"runtime_constraints,omitempty"` + PendingOperation *bool `json:"pending_operation,omitempty"` + PendingOperationDisabledReason *string `json:"pending_operation_disabled_reason,omitempty"` + IdleTimeoutNotice *string `json:"idle_timeout_notice,omitempty"` + RetentionPeriodMinutes *int `json:"retention_period_minutes,omitempty"` + RetentionExpiresAt *Timestamp `json:"retention_expires_at,omitempty"` + LastKnownStopNotice *string `json:"last_known_stop_notice,omitempty"` +} + +// CodespacesGitStatus represents the git status of a codespace. +type CodespacesGitStatus struct { + Ahead *int `json:"ahead,omitempty"` + Behind *int `json:"behind,omitempty"` + HasUnpushedChanges *bool `json:"has_unpushed_changes,omitempty"` + HasUncommittedChanges *bool `json:"has_uncommitted_changes,omitempty"` + Ref *string `json:"ref,omitempty"` +} + +// CodespacesMachine represents the machine type of a codespace. +type CodespacesMachine struct { + Name *string `json:"name,omitempty"` + DisplayName *string `json:"display_name,omitempty"` + OperatingSystem *string `json:"operating_system,omitempty"` + StorageInBytes *int64 `json:"storage_in_bytes,omitempty"` + MemoryInBytes *int64 `json:"memory_in_bytes,omitempty"` + CPUs *int `json:"cpus,omitempty"` + PrebuildAvailability *string `json:"prebuild_availability,omitempty"` +} + +// CodespacesRuntimeConstraints represents the runtime constraints of a codespace. +type CodespacesRuntimeConstraints struct { + AllowedPortPrivacySettings []string `json:"allowed_port_privacy_settings,omitempty"` +} + +// ListCodespaces represents the response from the list codespaces endpoints. +type ListCodespaces struct { + TotalCount *int `json:"total_count,omitempty"` + Codespaces []*Codespace `json:"codespaces"` +} + +// ListInRepo lists codespaces for a user in a repository. +// +// Lists the codespaces associated with a specified repository and the authenticated user. +// You must authenticate using an access token with the codespace scope to use this endpoint. +// GitHub Apps must have read access to the codespaces repository permission to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/codespaces/codespaces?apiVersion=2022-11-28#list-codespaces-in-a-repository-for-the-authenticated-user +func (s *CodespacesService) ListInRepo(ctx context.Context, owner, repo string, opts *ListOptions) (*ListCodespaces, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/codespaces", owner, repo) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var codespaces *ListCodespaces + resp, err := s.client.Do(ctx, req, &codespaces) + if err != nil { + return nil, resp, err + } + + return codespaces, resp, nil +} + +// ListOptions represents the options for listing codespaces for a user. +type ListCodespacesOptions struct { + ListOptions + RepositoryID int64 `url:"repository_id,omitempty"` +} + +// List lists codespaces for an authenticated user. +// +// Lists the authenticated user's codespaces. +// You must authenticate using an access token with the codespace scope to use this endpoint. +// GitHub Apps must have read access to the codespaces repository permission to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/codespaces/codespaces?apiVersion=2022-11-28#list-codespaces-for-the-authenticated-user +func (s *CodespacesService) List(ctx context.Context, opts *ListCodespacesOptions) (*ListCodespaces, *Response, error) { + u := fmt.Sprint("user/codespaces") + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var codespaces *ListCodespaces + resp, err := s.client.Do(ctx, req, &codespaces) + if err != nil { + return nil, resp, err + } + + return codespaces, resp, nil +} + +// CreateCodespaceOptions represents options for the creation of a codespace in a repository. +type CreateCodespaceOptions struct { + Ref *string `json:"ref,omitempty"` + // Geo represents the geographic area for this codespace. + // If not specified, the value is assigned by IP. + // This property replaces location, which is being deprecated. + // Geo can be one of: `EuropeWest`, `SoutheastAsia`, `UsEast`, `UsWest`. + Geo *string `json:"geo,omitempty"` + ClientIP *string `json:"client_ip,omitempty"` + Machine *string `json:"machine,omitempty"` + DevcontainerPath *string `json:"devcontainer_path,omitempty"` + MultiRepoPermissionsOptOut *bool `json:"multi_repo_permissions_opt_out,omitempty"` + WorkingDirectory *string `json:"working_directory,omitempty"` + IdleTimeoutMinutes *int `json:"idle_timeout_minutes,omitempty"` + DisplayName *string `json:"display_name,omitempty"` + // RetentionPeriodMinutes represents the duration in minutes after codespace has gone idle in which it will be deleted. + // Must be integer minutes between 0 and 43200 (30 days). + RetentionPeriodMinutes *int `json:"retention_period_minutes,omitempty"` +} + +// CreateInRepo creates a codespace in a repository. +// +// Creates a codespace owned by the authenticated user in the specified repository. +// You must authenticate using an access token with the codespace scope to use this endpoint. +// GitHub Apps must have write access to the codespaces repository permission to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/codespaces/codespaces?apiVersion=2022-11-28#create-a-codespace-in-a-repository +func (s *CodespacesService) CreateInRepo(ctx context.Context, owner, repo string, request *CreateCodespaceOptions) (*Codespace, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/codespaces", owner, repo) + + req, err := s.client.NewRequest("POST", u, request) + if err != nil { + return nil, nil, err + } + + var codespace *Codespace + resp, err := s.client.Do(ctx, req, &codespace) + if err != nil { + return nil, resp, err + } + + return codespace, resp, nil +} + +// Start starts a codespace. +// +// You must authenticate using an access token with the codespace scope to use this endpoint. +// GitHub Apps must have write access to the codespaces_lifecycle_admin repository permission to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/codespaces/codespaces?apiVersion=2022-11-28#start-a-codespace-for-the-authenticated-user +func (s *CodespacesService) Start(ctx context.Context, codespaceName string) (*Codespace, *Response, error) { + u := fmt.Sprintf("user/codespaces/%v/start", codespaceName) + + req, err := s.client.NewRequest("POST", u, nil) + if err != nil { + return nil, nil, err + } + + var codespace *Codespace + resp, err := s.client.Do(ctx, req, &codespace) + if err != nil { + return nil, resp, err + } + + return codespace, resp, nil +} + +// Stop stops a codespace. +// +// You must authenticate using an access token with the codespace scope to use this endpoint. +// GitHub Apps must have write access to the codespaces_lifecycle_admin repository permission to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/codespaces/codespaces?apiVersion=2022-11-28#stop-a-codespace-for-the-authenticated-user +func (s *CodespacesService) Stop(ctx context.Context, codespaceName string) (*Codespace, *Response, error) { + u := fmt.Sprintf("user/codespaces/%v/stop", codespaceName) + + req, err := s.client.NewRequest("POST", u, nil) + if err != nil { + return nil, nil, err + } + + var codespace *Codespace + resp, err := s.client.Do(ctx, req, &codespace) + if err != nil { + return nil, resp, err + } + + return codespace, resp, nil +} + +// Delete deletes a codespace. +// +// You must authenticate using an access token with the codespace scope to use this endpoint. +// GitHub Apps must have write access to the codespaces repository permission to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/codespaces/codespaces?apiVersion=2022-11-28#delete-a-codespace-for-the-authenticated-user +func (s *CodespacesService) Delete(ctx context.Context, codespaceName string) (*Response, error) { + u := fmt.Sprintf("user/codespaces/%v", codespaceName) + + 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/codespaces_secrets.go b/github/codespaces_secrets.go new file mode 100644 index 00000000000..e11c679c668 --- /dev/null +++ b/github/codespaces_secrets.go @@ -0,0 +1,405 @@ +// Copyright 2023 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" +) + +// ListUserSecrets list all secrets available for a users codespace +// +// Lists all secrets available for a user's Codespaces without revealing their encrypted values +// You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint +// GitHub Apps must have read access to the codespaces_user_secrets user permission to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#list-secrets-for-the-authenticated-user +func (s *CodespacesService) ListUserSecrets(ctx context.Context, opts *ListOptions) (*Secrets, *Response, error) { + u, err := addOptions("user/codespaces/secrets", opts) + if err != nil { + return nil, nil, err + } + return s.listSecrets(ctx, u) +} + +// ListOrgSecrets list all secrets available to an org +// +// Lists all Codespaces secrets available at the organization-level without revealing their encrypted values. You must authenticate using an access token with the admin:org scope to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#list-organization-secrets +func (s *CodespacesService) ListOrgSecrets(ctx context.Context, org string, opts *ListOptions) (*Secrets, *Response, error) { + u := fmt.Sprintf("orgs/%v/codespaces/secrets", org) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + return s.listSecrets(ctx, u) +} + +// ListRepoSecrets list all secrets available to a repo +// +// Lists all secrets available in a repository without revealing their encrypted values. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/codespaces/repository-secrets?apiVersion=2022-11-28#list-repository-secrets +func (s *CodespacesService) ListRepoSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/codespaces/secrets", owner, repo) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + return s.listSecrets(ctx, u) +} + +func (s *CodespacesService) listSecrets(ctx context.Context, url string) (*Secrets, *Response, error) { + req, err := s.client.NewRequest("GET", url, nil) + if err != nil { + return nil, nil, err + } + + var secrets *Secrets + resp, err := s.client.Do(ctx, req, &secrets) + if err != nil { + return nil, resp, err + } + + return secrets, resp, nil +} + +// GetUserPublicKey gets the users public key for encrypting codespace secrets +// +// Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. +// You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. +// GitHub Apps must have read access to the codespaces_user_secrets user permission to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#get-public-key-for-the-authenticated-user +func (s *CodespacesService) GetUserPublicKey(ctx context.Context) (*PublicKey, *Response, error) { + return s.getPublicKey(ctx, "user/codespaces/secrets/public-key") +} + +// GetOrgPublicKey gets the org public key for encrypting codespace secrets +// +// Gets a public key for an organization, which is required in order to encrypt secrets. You need to encrypt the value of a secret before you can create or update secrets. You must authenticate using an access token with the admin:org scope to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#get-an-organization-public-key +func (s *CodespacesService) GetOrgPublicKey(ctx context.Context, org string) (*PublicKey, *Response, error) { + return s.getPublicKey(ctx, fmt.Sprintf("orgs/%v/codespaces/secrets/public-key", org)) +} + +// GetRepoPublicKey gets the repo public key for encrypting codespace secrets +// +// Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/codespaces/repository-secrets?apiVersion=2022-11-28#get-a-repository-public-key +func (s *CodespacesService) GetRepoPublicKey(ctx context.Context, owner, repo string) (*PublicKey, *Response, error) { + return s.getPublicKey(ctx, fmt.Sprintf("repos/%v/%v/codespaces/secrets/public-key", owner, repo)) +} + +func (s *CodespacesService) getPublicKey(ctx context.Context, url string) (*PublicKey, *Response, error) { + req, err := s.client.NewRequest("GET", url, nil) + if err != nil { + return nil, nil, err + } + + var publicKey *PublicKey + resp, err := s.client.Do(ctx, req, &publicKey) + if err != nil { + return nil, resp, err + } + + return publicKey, resp, nil +} + +// GetUserSecret gets a users codespace secret +// +// Gets a secret available to a user's codespaces without revealing its encrypted value. +// You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. +// GitHub Apps must have read access to the codespaces_user_secrets user permission to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#get-a-secret-for-the-authenticated-user +func (s *CodespacesService) GetUserSecret(ctx context.Context, name string) (*Secret, *Response, error) { + u := fmt.Sprintf("user/codespaces/secrets/%v", name) + return s.getSecret(ctx, u) +} + +// GetOrgSecret gets an org codespace secret +// +// Gets an organization secret without revealing its encrypted value. You must authenticate using an access token with the admin:org scope to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#get-an-organization-secret +func (s *CodespacesService) GetOrgSecret(ctx context.Context, org, name string) (*Secret, *Response, error) { + u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v", org, name) + return s.getSecret(ctx, u) +} + +// GetRepoSecret gets a repo codespace secret +// +// Gets a single repository secret without revealing its encrypted value. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/codespaces/repository-secrets?apiVersion=2022-11-28#get-a-repository-secret +func (s *CodespacesService) GetRepoSecret(ctx context.Context, owner, repo, name string) (*Secret, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/codespaces/secrets/%v", owner, repo, name) + return s.getSecret(ctx, u) +} + +func (s *CodespacesService) getSecret(ctx context.Context, url string) (*Secret, *Response, error) { + req, err := s.client.NewRequest("GET", url, nil) + if err != nil { + return nil, nil, err + } + + var secret *Secret + resp, err := s.client.Do(ctx, req, &secret) + if err != nil { + return nil, resp, err + } + + return secret, resp, nil +} + +// CreateOrUpdateUserSecret creates or updates a users codespace secret +// +// Creates or updates a secret for a user's codespace with an encrypted value. Encrypt your secret using LibSodium. +// You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must also have Codespaces access to use this endpoint. +// GitHub Apps must have write access to the codespaces_user_secrets user permission and codespaces_secrets repository permission on all referenced repositories to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#create-or-update-a-secret-for-the-authenticated-user +func (s *CodespacesService) CreateOrUpdateUserSecret(ctx context.Context, eSecret *EncryptedSecret) (*Response, error) { + u := fmt.Sprintf("user/codespaces/secrets/%v", eSecret.Name) + return s.createOrUpdateSecret(ctx, u, eSecret) +} + +// CreateOrUpdateOrgSecret creates or updates an orgs codespace secret +// +// Creates or updates an organization secret with an encrypted value. Encrypt your secret using LibSodium. You must authenticate using an access token with the admin:org scope to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#create-or-update-an-organization-secret +func (s *CodespacesService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *EncryptedSecret) (*Response, error) { + u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v", org, eSecret.Name) + return s.createOrUpdateSecret(ctx, u, eSecret) +} + +// CreateOrUpdateRepoSecret creates or updates a repos codespace secret +// +// Creates or updates a repository secret with an encrypted value. Encrypt your secret using LibSodium. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/codespaces/repository-secrets?apiVersion=2022-11-28#create-or-update-a-repository-secret +func (s *CodespacesService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *EncryptedSecret) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/codespaces/secrets/%v", owner, repo, eSecret.Name) + return s.createOrUpdateSecret(ctx, u, eSecret) +} + +func (s *CodespacesService) createOrUpdateSecret(ctx context.Context, url string, eSecret *EncryptedSecret) (*Response, error) { + req, err := s.client.NewRequest("PUT", url, eSecret) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req, nil) + if err != nil { + return resp, err + } + + return resp, nil +} + +// DeleteUserSecret deletes a users codespace secret +// +// Deletes a secret from a user's codespaces using the secret name. Deleting the secret will remove access from all codespaces that were allowed to access the secret. +// You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. +// GitHub Apps must have write access to the codespaces_user_secrets user permission to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#delete-a-secret-for-the-authenticated-user +func (s *CodespacesService) DeleteUserSecret(ctx context.Context, name string) (*Response, error) { + u := fmt.Sprintf("user/codespaces/secrets/%v", name) + return s.deleteSecret(ctx, u) +} + +// DeleteOrgSecret deletes an orgs codespace secret +// +// Deletes an organization secret using the secret name. You must authenticate using an access token with the admin:org scope to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#delete-an-organization-secret +func (s *CodespacesService) DeleteOrgSecret(ctx context.Context, org, name string) (*Response, error) { + u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v", org, name) + return s.deleteSecret(ctx, u) +} + +// DeleteRepoSecret deletes a repos codespace secret +// +// Deletes a secret in a repository using the secret name. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/codespaces/repository-secrets?apiVersion=2022-11-28#delete-a-repository-secret +func (s *CodespacesService) DeleteRepoSecret(ctx context.Context, owner, repo, name string) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/codespaces/secrets/%v", owner, repo, name) + return s.deleteSecret(ctx, u) +} + +func (s *CodespacesService) deleteSecret(ctx context.Context, url string) (*Response, error) { + req, err := s.client.NewRequest("DELETE", url, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req, nil) + if err != nil { + return resp, err + } + + return resp, nil +} + +// ListSelectedReposForUserSecret lists the repositories that have been granted the ability to use a user's codespace secret. +// +// You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. +// GitHub Apps must have read access to the codespaces_user_secrets user permission and write access to the codespaces_secrets repository permission on all referenced repositories to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#list-selected-repositories-for-a-user-secret +func (s *CodespacesService) ListSelectedReposForUserSecret(ctx context.Context, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { + u := fmt.Sprintf("user/codespaces/secrets/%v/repositories", name) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + return s.listSelectedReposForSecret(ctx, u) +} + +// ListSelectedReposForOrgSecret lists the repositories that have been granted the ability to use an organization's codespace secret. +// +// Lists all repositories that have been selected when the visibility for repository access to a secret is set to selected. You must authenticate using an access token with the admin:org scope to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#list-selected-repositories-for-an-organization-secret +func (s *CodespacesService) ListSelectedReposForOrgSecret(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { + u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v/repositories", org, name) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + return s.listSelectedReposForSecret(ctx, u) +} + +func (s *CodespacesService) listSelectedReposForSecret(ctx context.Context, url string) (*SelectedReposList, *Response, error) { + req, err := s.client.NewRequest("GET", url, nil) + if err != nil { + return nil, nil, err + } + + var repositories *SelectedReposList + resp, err := s.client.Do(ctx, req, &repositories) + if err != nil { + return nil, resp, err + } + + return repositories, resp, nil +} + +// SetSelectedReposForUserSecret sets the repositories that have been granted the ability to use a user's codespace secret. +// +// You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. +// GitHub Apps must have write access to the codespaces_user_secrets user permission and write access to the codespaces_secrets repository permission on all referenced repositories to use this endpoint. +// +// Github API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#set-selected-repositories-for-a-user-secret +func (s *CodespacesService) SetSelectedReposForUserSecret(ctx context.Context, name string, ids SelectedRepoIDs) (*Response, error) { + u := fmt.Sprintf("user/codespaces/secrets/%v/repositories", name) + return s.setSelectedRepoForSecret(ctx, u, ids) +} + +// SetSelectedReposForOrgSecret sets the repositories that have been granted the ability to use a user's codespace secret. +// +// Replaces all repositories for an organization secret when the visibility for repository access is set to selected. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org scope to use this endpoint. +// +// Github API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#set-selected-repositories-for-a-user-secret +func (s *CodespacesService) SetSelectedReposForOrgSecret(ctx context.Context, org, name string, ids SelectedRepoIDs) (*Response, error) { + u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v/repositories", org, name) + return s.setSelectedRepoForSecret(ctx, u, ids) +} + +func (s *CodespacesService) setSelectedRepoForSecret(ctx context.Context, url string, ids SelectedRepoIDs) (*Response, error) { + type repoIDs struct { + SelectedIDs SelectedRepoIDs `json:"selected_repository_ids"` + } + + req, err := s.client.NewRequest("PUT", url, repoIDs{SelectedIDs: ids}) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req, nil) + if err != nil { + return resp, err + } + + return resp, nil +} + +// AddSelectedRepoToUserSecret adds a repository to the list of repositories that have been granted the ability to use a user's codespace secret. +// +// Adds a repository to the selected repositories for a user's codespace secret. You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. GitHub Apps must have write access to the codespaces_user_secrets user permission and write access to the codespaces_secrets repository permission on the referenced repository to use this endpoint. +// +// Github API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#add-a-selected-repository-to-a-user-secret +func (s *CodespacesService) AddSelectedRepoToUserSecret(ctx context.Context, name string, repo *Repository) (*Response, error) { + u := fmt.Sprintf("user/codespaces/secrets/%v/repositories/%v", name, *repo.ID) + return s.addSelectedRepoToSecret(ctx, u) +} + +// AddSelectedRepoToOrgSecret adds a repository to the list of repositories that have been granted the ability to use an organization's codespace secret. +// +// Adds a repository to an organization secret when the visibility for repository access is set to selected. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org scope to use this endpoint. +// +// Github API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#add-selected-repository-to-an-organization-secret +func (s *CodespacesService) AddSelectedRepoToOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { + u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v/repositories/%v", org, name, *repo.ID) + return s.addSelectedRepoToSecret(ctx, u) +} + +func (s *CodespacesService) addSelectedRepoToSecret(ctx context.Context, url string) (*Response, error) { + req, err := s.client.NewRequest("PUT", url, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req, nil) + if err != nil { + return resp, err + } + + return resp, nil +} + +// RemoveSelectedRepoFromUserSecret removes a repository from the list of repositories that have been granted the ability to use a user's codespace secret. +// +// Removes a repository from the selected repositories for a user's codespace secret. You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. GitHub Apps must have write access to the codespaces_user_secrets user permission to use this endpoint. +// +// Github API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#remove-a-selected-repository-from-a-user-secret +func (s *CodespacesService) RemoveSelectedRepoFromUserSecret(ctx context.Context, name string, repo *Repository) (*Response, error) { + u := fmt.Sprintf("user/codespaces/secrets/%v/repositories/%v", name, *repo.ID) + return s.removeSelectedRepoFromSecret(ctx, u) +} + +// RemoveSelectedRepoFromOrgSecret removes a repository from the list of repositories that have been granted the ability to use an organization's codespace secret. +// +// Removes a repository from an organization secret when the visibility for repository access is set to selected. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org scope to use this endpoint. +// +// Github API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#remove-selected-repository-from-an-organization-secret +func (s *CodespacesService) RemoveSelectedRepoFromOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { + u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v/repositories/%v", org, name, *repo.ID) + return s.removeSelectedRepoFromSecret(ctx, u) +} + +func (s *CodespacesService) removeSelectedRepoFromSecret(ctx context.Context, url string) (*Response, error) { + req, err := s.client.NewRequest("DELETE", url, 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/codespaces_secrets_test.go b/github/codespaces_secrets_test.go new file mode 100644 index 00000000000..33c0ad99c81 --- /dev/null +++ b/github/codespaces_secrets_test.go @@ -0,0 +1,803 @@ +// Copyright 2023 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" + "time" + + "github.com/google/go-cmp/cmp" +) + +func TestCodespacesService_ListSecrets(t *testing.T) { + type test struct { + name string + handleFunc func(*http.ServeMux) + call func(context.Context, *Client) (*Secrets, *Response, error) + badCall func(context.Context, *Client) (*Secrets, *Response, error) + methodName string + } + opts := &ListOptions{Page: 2, PerPage: 2} + tests := []test{ + { + name: "User", + handleFunc: func(mux *http.ServeMux) { + mux.HandleFunc("/user/codespaces/secrets", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{"per_page": "2", "page": "2"}) + fmt.Fprint(w, `{"total_count":4,"secrets":[{"name":"A","created_at":"2019-01-02T15:04:05Z","updated_at":"2020-01-02T15:04:05Z"},{"name":"B","created_at":"2019-01-02T15:04:05Z","updated_at":"2020-01-02T15:04:05Z"}]}`) + }) + }, + call: func(ctx context.Context, client *Client) (*Secrets, *Response, error) { + return client.Codespaces.ListUserSecrets(ctx, opts) + }, + methodName: "ListUserSecrets", + }, + { + name: "Org", + handleFunc: func(mux *http.ServeMux) { + mux.HandleFunc("/orgs/o/codespaces/secrets", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{"per_page": "2", "page": "2"}) + fmt.Fprint(w, `{"total_count":4,"secrets":[{"name":"A","created_at":"2019-01-02T15:04:05Z","updated_at":"2020-01-02T15:04:05Z"},{"name":"B","created_at":"2019-01-02T15:04:05Z","updated_at":"2020-01-02T15:04:05Z"}]}`) + }) + }, + call: func(ctx context.Context, client *Client) (*Secrets, *Response, error) { + return client.Codespaces.ListOrgSecrets(ctx, "o", opts) + }, + badCall: func(ctx context.Context, client *Client) (*Secrets, *Response, error) { + return client.Codespaces.ListOrgSecrets(ctx, "\n", opts) + }, + methodName: "ListOrgSecrets", + }, + { + name: "Repo", + handleFunc: func(mux *http.ServeMux) { + mux.HandleFunc("/repos/o/r/codespaces/secrets", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{"per_page": "2", "page": "2"}) + fmt.Fprint(w, `{"total_count":4,"secrets":[{"name":"A","created_at":"2019-01-02T15:04:05Z","updated_at":"2020-01-02T15:04:05Z"},{"name":"B","created_at":"2019-01-02T15:04:05Z","updated_at":"2020-01-02T15:04:05Z"}]}`) + }) + }, + call: func(ctx context.Context, client *Client) (*Secrets, *Response, error) { + return client.Codespaces.ListRepoSecrets(ctx, "o", "r", opts) + }, + badCall: func(ctx context.Context, client *Client) (*Secrets, *Response, error) { + return client.Codespaces.ListRepoSecrets(ctx, "\n", "\n", opts) + }, + methodName: "ListRepoSecrets", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + tt.handleFunc(mux) + + ctx := context.Background() + secrets, _, err := tt.call(ctx, client) + if err != nil { + t.Errorf("Codespaces.%v returned error: %v", tt.methodName, err) + } + + want := &Secrets{ + TotalCount: 4, + Secrets: []*Secret{ + {Name: "A", CreatedAt: Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, UpdatedAt: Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}}, + {Name: "B", CreatedAt: Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, UpdatedAt: Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}}, + }, + } + if !cmp.Equal(secrets, want) { + t.Errorf("Codespaces.%v returned %+v, want %+v", tt.methodName, secrets, want) + } + + if tt.badCall != nil { + testBadOptions(t, tt.methodName, func() (err error) { + _, _, err = tt.badCall(ctx, client) + return err + }) + } + + testNewRequestAndDoFailure(t, tt.methodName, client, func() (*Response, error) { + got, resp, err := tt.call(ctx, client) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", tt.methodName, got) + } + return resp, err + }) + }) + } +} + +func TestCodespacesService_GetSecret(t *testing.T) { + type test struct { + name string + handleFunc func(*http.ServeMux) + call func(context.Context, *Client) (*Secret, *Response, error) + badCall func(context.Context, *Client) (*Secret, *Response, error) + methodName string + } + tests := []test{ + { + name: "User", + handleFunc: func(mux *http.ServeMux) { + mux.HandleFunc("/user/codespaces/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"name":"A","created_at":"2019-01-02T15:04:05Z","updated_at":"2020-01-02T15:04:05Z"}`) + }) + }, + call: func(ctx context.Context, client *Client) (*Secret, *Response, error) { + return client.Codespaces.GetUserSecret(ctx, "NAME") + }, + methodName: "GetUserSecret", + }, + { + name: "Org", + handleFunc: func(mux *http.ServeMux) { + mux.HandleFunc("/orgs/o/codespaces/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"name":"A","created_at":"2019-01-02T15:04:05Z","updated_at":"2020-01-02T15:04:05Z"}`) + }) + }, + call: func(ctx context.Context, client *Client) (*Secret, *Response, error) { + return client.Codespaces.GetOrgSecret(ctx, "o", "NAME") + }, + badCall: func(ctx context.Context, client *Client) (*Secret, *Response, error) { + return client.Codespaces.GetOrgSecret(ctx, "\n", "\n") + }, + methodName: "GetOrgSecret", + }, + { + name: "Repo", + handleFunc: func(mux *http.ServeMux) { + mux.HandleFunc("/repos/o/r/codespaces/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"name":"A","created_at":"2019-01-02T15:04:05Z","updated_at":"2020-01-02T15:04:05Z"}`) + }) + }, + call: func(ctx context.Context, client *Client) (*Secret, *Response, error) { + return client.Codespaces.GetRepoSecret(ctx, "o", "r", "NAME") + }, + badCall: func(ctx context.Context, client *Client) (*Secret, *Response, error) { + return client.Codespaces.GetRepoSecret(ctx, "\n", "\n", "\n") + }, + methodName: "GetRepoSecret", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + tt.handleFunc(mux) + + ctx := context.Background() + secret, _, err := tt.call(ctx, client) + if err != nil { + t.Errorf("Codespaces.%v returned error: %v", tt.methodName, err) + } + + want := &Secret{Name: "A", CreatedAt: Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, UpdatedAt: Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}} + if !cmp.Equal(secret, want) { + t.Errorf("Codespaces.%v returned %+v, want %+v", tt.methodName, secret, want) + } + + if tt.badCall != nil { + testBadOptions(t, tt.methodName, func() (err error) { + _, _, err = tt.badCall(ctx, client) + return err + }) + } + + testNewRequestAndDoFailure(t, tt.methodName, client, func() (*Response, error) { + got, resp, err := tt.call(ctx, client) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", tt.methodName, got) + } + return resp, err + }) + }) + } +} + +func TestCodespacesService_CreateOrUpdateSecret(t *testing.T) { + type test struct { + name string + handleFunc func(*http.ServeMux) + call func(context.Context, *Client, *EncryptedSecret) (*Response, error) + badCall func(context.Context, *Client, *EncryptedSecret) (*Response, error) + methodName string + } + tests := []test{ + { + name: "User", + handleFunc: func(mux *http.ServeMux) { + mux.HandleFunc("/user/codespaces/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + testHeader(t, r, "Content-Type", "application/json") + testBody(t, r, `{"key_id":"1234","encrypted_value":"QIv="}`+"\n") + w.WriteHeader(http.StatusCreated) + }) + }, + call: func(ctx context.Context, client *Client, e *EncryptedSecret) (*Response, error) { + return client.Codespaces.CreateOrUpdateUserSecret(ctx, e) + }, + methodName: "CreateOrUpdateUserSecret", + }, + { + name: "Org", + handleFunc: func(mux *http.ServeMux) { + mux.HandleFunc("/orgs/o/codespaces/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + testHeader(t, r, "Content-Type", "application/json") + testBody(t, r, `{"key_id":"1234","encrypted_value":"QIv="}`+"\n") + w.WriteHeader(http.StatusCreated) + }) + }, + call: func(ctx context.Context, client *Client, e *EncryptedSecret) (*Response, error) { + return client.Codespaces.CreateOrUpdateOrgSecret(ctx, "o", e) + }, + badCall: func(ctx context.Context, client *Client, e *EncryptedSecret) (*Response, error) { + return client.Codespaces.CreateOrUpdateOrgSecret(ctx, "\n", e) + }, + methodName: "CreateOrUpdateOrgSecret", + }, + { + name: "Repo", + handleFunc: func(mux *http.ServeMux) { + mux.HandleFunc("/repos/o/r/codespaces/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + testHeader(t, r, "Content-Type", "application/json") + testBody(t, r, `{"key_id":"1234","encrypted_value":"QIv="}`+"\n") + w.WriteHeader(http.StatusCreated) + }) + }, + call: func(ctx context.Context, client *Client, e *EncryptedSecret) (*Response, error) { + return client.Codespaces.CreateOrUpdateRepoSecret(ctx, "o", "r", e) + }, + badCall: func(ctx context.Context, client *Client, e *EncryptedSecret) (*Response, error) { + return client.Codespaces.CreateOrUpdateRepoSecret(ctx, "\n", "\n", e) + }, + methodName: "CreateOrUpdateRepoSecret", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + tt.handleFunc(mux) + + input := &EncryptedSecret{ + Name: "NAME", + EncryptedValue: "QIv=", + KeyID: "1234", + } + ctx := context.Background() + _, err := tt.call(ctx, client, input) + if err != nil { + t.Errorf("Codespaces.%v returned error: %v", tt.methodName, err) + } + + if tt.badCall != nil { + testBadOptions(t, tt.methodName, func() (err error) { + _, err = tt.badCall(ctx, client, input) + return err + }) + } + + testNewRequestAndDoFailure(t, tt.methodName, client, func() (*Response, error) { + return tt.call(ctx, client, input) + }) + }) + } +} + +func TestCodespacesService_DeleteSecret(t *testing.T) { + type test struct { + name string + handleFunc func(*http.ServeMux) + call func(context.Context, *Client) (*Response, error) + badCall func(context.Context, *Client) (*Response, error) + methodName string + } + tests := []test{ + { + name: "User", + handleFunc: func(mux *http.ServeMux) { + mux.HandleFunc("/user/codespaces/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + }) + }, + call: func(ctx context.Context, client *Client) (*Response, error) { + return client.Codespaces.DeleteUserSecret(ctx, "NAME") + }, + methodName: "DeleteUserSecret", + }, + { + name: "Org", + handleFunc: func(mux *http.ServeMux) { + mux.HandleFunc("/orgs/o/codespaces/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + }) + }, + call: func(ctx context.Context, client *Client) (*Response, error) { + return client.Codespaces.DeleteOrgSecret(ctx, "o", "NAME") + }, + badCall: func(ctx context.Context, client *Client) (*Response, error) { + return client.Codespaces.DeleteOrgSecret(ctx, "\n", "\n") + }, + methodName: "DeleteOrgSecret", + }, + { + name: "Repo", + handleFunc: func(mux *http.ServeMux) { + mux.HandleFunc("/repos/o/r/codespaces/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + }) + }, + call: func(ctx context.Context, client *Client) (*Response, error) { + return client.Codespaces.DeleteRepoSecret(ctx, "o", "r", "NAME") + }, + badCall: func(ctx context.Context, client *Client) (*Response, error) { + return client.Codespaces.DeleteRepoSecret(ctx, "\n", "\n", "\n") + }, + methodName: "DeleteRepoSecret", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + tt.handleFunc(mux) + + ctx := context.Background() + _, err := tt.call(ctx, client) + if err != nil { + t.Errorf("Codespaces.%v returned error: %v", tt.methodName, err) + } + + if tt.badCall != nil { + testBadOptions(t, tt.methodName, func() (err error) { + _, err = tt.badCall(ctx, client) + return err + }) + } + + testNewRequestAndDoFailure(t, tt.methodName, client, func() (*Response, error) { + return tt.call(ctx, client) + }) + }) + } +} + +func TestCodespacesService_GetPublicKey(t *testing.T) { + type test struct { + name string + handleFunc func(*http.ServeMux) + call func(context.Context, *Client) (*PublicKey, *Response, error) + badCall func(context.Context, *Client) (*PublicKey, *Response, error) + methodName string + } + + tests := []test{ + { + name: "User", + handleFunc: func(mux *http.ServeMux) { + mux.HandleFunc("/user/codespaces/secrets/public-key", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"key_id":"1234","key":"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234"}`) + }) + }, + call: func(ctx context.Context, client *Client) (*PublicKey, *Response, error) { + return client.Codespaces.GetUserPublicKey(ctx) + }, + methodName: "GetUserPublicKey", + }, + { + name: "Org", + handleFunc: func(mux *http.ServeMux) { + mux.HandleFunc("/orgs/o/codespaces/secrets/public-key", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"key_id":"1234","key":"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234"}`) + }) + }, + call: func(ctx context.Context, client *Client) (*PublicKey, *Response, error) { + return client.Codespaces.GetOrgPublicKey(ctx, "o") + }, + badCall: func(ctx context.Context, client *Client) (*PublicKey, *Response, error) { + return client.Codespaces.GetOrgPublicKey(ctx, "\n") + }, + methodName: "GetOrgPublicKey", + }, + { + name: "Repo", + handleFunc: func(mux *http.ServeMux) { + mux.HandleFunc("/repos/o/r/codespaces/secrets/public-key", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"key_id":"1234","key":"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234"}`) + }) + }, + call: func(ctx context.Context, client *Client) (*PublicKey, *Response, error) { + return client.Codespaces.GetRepoPublicKey(ctx, "o", "r") + }, + badCall: func(ctx context.Context, client *Client) (*PublicKey, *Response, error) { + return client.Codespaces.GetRepoPublicKey(ctx, "\n", "\n") + }, + methodName: "GetRepoPublicKey", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + tt.handleFunc(mux) + + ctx := context.Background() + key, _, err := tt.call(ctx, client) + if err != nil { + t.Errorf("Codespaces.%v returned error: %v", tt.methodName, err) + } + + want := &PublicKey{KeyID: String("1234"), Key: String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234")} + if !cmp.Equal(key, want) { + t.Errorf("Codespaces.%v returned %+v, want %+v", tt.methodName, key, want) + } + + if tt.badCall != nil { + testBadOptions(t, tt.methodName, func() (err error) { + _, _, err = tt.badCall(ctx, client) + return err + }) + } + + testNewRequestAndDoFailure(t, tt.methodName, client, func() (*Response, error) { + got, resp, err := tt.call(ctx, client) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", tt.methodName, got) + } + return resp, err + }) + }) + } +} + +func TestCodespacesService_ListSelectedReposForSecret(t *testing.T) { + type test struct { + name string + handleFunc func(*http.ServeMux) + call func(context.Context, *Client) (*SelectedReposList, *Response, error) + badCall func(context.Context, *Client) (*SelectedReposList, *Response, error) + methodName string + } + opts := &ListOptions{Page: 2, PerPage: 2} + tests := []test{ + { + name: "User", + handleFunc: func(mux *http.ServeMux) { + mux.HandleFunc("/user/codespaces/secrets/NAME/repositories", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprintf(w, `{"total_count":1,"repositories":[{"id":1}]}`) + }) + }, + call: func(ctx context.Context, client *Client) (*SelectedReposList, *Response, error) { + return client.Codespaces.ListSelectedReposForUserSecret(ctx, "NAME", opts) + }, + methodName: "ListSelectedReposForUserSecret", + }, + { + name: "Org", + handleFunc: func(mux *http.ServeMux) { + mux.HandleFunc("/orgs/o/codespaces/secrets/NAME/repositories", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprintf(w, `{"total_count":1,"repositories":[{"id":1}]}`) + }) + }, + call: func(ctx context.Context, client *Client) (*SelectedReposList, *Response, error) { + return client.Codespaces.ListSelectedReposForOrgSecret(ctx, "o", "NAME", opts) + }, + badCall: func(ctx context.Context, client *Client) (*SelectedReposList, *Response, error) { + return client.Codespaces.ListSelectedReposForOrgSecret(ctx, "\n", "\n", opts) + }, + methodName: "ListSelectedReposForOrgSecret", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + tt.handleFunc(mux) + + ctx := context.Background() + repos, _, err := tt.call(ctx, client) + if err != nil { + t.Errorf("Codespaces.%v returned error: %v", tt.methodName, err) + } + + want := &SelectedReposList{ + TotalCount: Int(1), + Repositories: []*Repository{ + {ID: Int64(1)}, + }, + } + + if !cmp.Equal(repos, want) { + t.Errorf("Codespaces.%v returned %+v, want %+v", tt.methodName, repos, want) + } + + if tt.badCall != nil { + testBadOptions(t, tt.methodName, func() (err error) { + _, _, err = tt.badCall(ctx, client) + return err + }) + } + + testNewRequestAndDoFailure(t, tt.methodName, client, func() (*Response, error) { + got, resp, err := tt.call(ctx, client) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", tt.methodName, got) + } + return resp, err + }) + }) + } +} + +func TestCodespacesService_SetSelectedReposForSecret(t *testing.T) { + type test struct { + name string + handleFunc func(*http.ServeMux) + call func(context.Context, *Client) (*Response, error) + badCall func(context.Context, *Client) (*Response, error) + methodName string + } + ids := SelectedRepoIDs{64780797} + tests := []test{ + { + name: "User", + handleFunc: func(mux *http.ServeMux) { + mux.HandleFunc("/user/codespaces/secrets/NAME/repositories", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + testHeader(t, r, "Content-Type", "application/json") + testBody(t, r, `{"selected_repository_ids":[64780797]}`+"\n") + }) + }, + call: func(ctx context.Context, client *Client) (*Response, error) { + return client.Codespaces.SetSelectedReposForUserSecret(ctx, "NAME", ids) + }, + methodName: "SetSelectedReposForUserSecret", + }, + { + name: "Org", + handleFunc: func(mux *http.ServeMux) { + mux.HandleFunc("/orgs/o/codespaces/secrets/NAME/repositories", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + testHeader(t, r, "Content-Type", "application/json") + testBody(t, r, `{"selected_repository_ids":[64780797]}`+"\n") + }) + }, + call: func(ctx context.Context, client *Client) (*Response, error) { + return client.Codespaces.SetSelectedReposForOrgSecret(ctx, "o", "NAME", ids) + }, + badCall: func(ctx context.Context, client *Client) (*Response, error) { + return client.Codespaces.SetSelectedReposForOrgSecret(ctx, "\n", "\n", ids) + }, + methodName: "SetSelectedReposForOrgSecret", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + tt.handleFunc(mux) + + ctx := context.Background() + _, err := tt.call(ctx, client) + if err != nil { + t.Errorf("Codespaces.%v returned error: %v", tt.methodName, err) + } + + if tt.badCall != nil { + testBadOptions(t, tt.methodName, func() (err error) { + _, err = tt.badCall(ctx, client) + return err + }) + } + + testNewRequestAndDoFailure(t, tt.methodName, client, func() (*Response, error) { + return tt.call(ctx, client) + }) + }) + } +} + +func TestCodespacesService_AddSelectedReposForSecret(t *testing.T) { + type test struct { + name string + handleFunc func(*http.ServeMux) + call func(context.Context, *Client) (*Response, error) + badCall func(context.Context, *Client) (*Response, error) + methodName string + } + repo := &Repository{ID: Int64(1234)} + tests := []test{ + { + name: "User", + handleFunc: func(mux *http.ServeMux) { + mux.HandleFunc("/user/codespaces/secrets/NAME/repositories/1234", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + }) + }, + call: func(ctx context.Context, client *Client) (*Response, error) { + return client.Codespaces.AddSelectedRepoToUserSecret(ctx, "NAME", repo) + }, + methodName: "AddSelectedRepoToUserSecret", + }, + { + name: "Org", + handleFunc: func(mux *http.ServeMux) { + mux.HandleFunc("/orgs/o/codespaces/secrets/NAME/repositories/1234", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + }) + }, + call: func(ctx context.Context, client *Client) (*Response, error) { + return client.Codespaces.AddSelectedRepoToOrgSecret(ctx, "o", "NAME", repo) + }, + badCall: func(ctx context.Context, client *Client) (*Response, error) { + return client.Codespaces.AddSelectedRepoToOrgSecret(ctx, "\n", "\n", repo) + }, + methodName: "AddSelectedRepoToOrgSecret", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + tt.handleFunc(mux) + + ctx := context.Background() + _, err := tt.call(ctx, client) + if err != nil { + t.Errorf("Codespaces.%v returned error: %v", tt.methodName, err) + } + + if tt.badCall != nil { + testBadOptions(t, tt.methodName, func() (err error) { + _, err = tt.badCall(ctx, client) + return err + }) + } + + testNewRequestAndDoFailure(t, tt.methodName, client, func() (*Response, error) { + return tt.call(ctx, client) + }) + }) + } +} + +func TestCodespacesService_RemoveSelectedReposFromSecret(t *testing.T) { + type test struct { + name string + handleFunc func(*http.ServeMux) + call func(context.Context, *Client) (*Response, error) + badCall func(context.Context, *Client) (*Response, error) + methodName string + } + repo := &Repository{ID: Int64(1234)} + tests := []test{ + { + name: "User", + handleFunc: func(mux *http.ServeMux) { + mux.HandleFunc("/user/codespaces/secrets/NAME/repositories/1234", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + }) + }, + call: func(ctx context.Context, client *Client) (*Response, error) { + return client.Codespaces.RemoveSelectedRepoFromUserSecret(ctx, "NAME", repo) + }, + methodName: "RemoveSelectedRepoFromUserSecret", + }, + { + name: "Org", + handleFunc: func(mux *http.ServeMux) { + mux.HandleFunc("/orgs/o/codespaces/secrets/NAME/repositories/1234", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + }) + }, + call: func(ctx context.Context, client *Client) (*Response, error) { + return client.Codespaces.RemoveSelectedRepoFromOrgSecret(ctx, "o", "NAME", repo) + }, + badCall: func(ctx context.Context, client *Client) (*Response, error) { + return client.Codespaces.RemoveSelectedRepoFromOrgSecret(ctx, "\n", "\n", repo) + }, + methodName: "RemoveSelectedRepoFromOrgSecret", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + tt.handleFunc(mux) + + ctx := context.Background() + _, err := tt.call(ctx, client) + if err != nil { + t.Errorf("Codespaces.%v returned error: %v", tt.methodName, err) + } + + if tt.badCall != nil { + testBadOptions(t, tt.methodName, func() (err error) { + _, err = tt.badCall(ctx, client) + return err + }) + } + + testNewRequestAndDoFailure(t, tt.methodName, client, func() (*Response, error) { + return tt.call(ctx, client) + }) + }) + } +} + +// func TestActionsService_ListSelectedReposForOrgSecret(t *testing.T) { +// client, mux, _, teardown := setup() +// defer teardown() + +// mux.HandleFunc("/orgs/o/actions/secrets/NAME/repositories", func(w http.ResponseWriter, r *http.Request) { +// testMethod(t, r, "GET") +// fmt.Fprintf(w, `{"total_count":1,"repositories":[{"id":1}]}`) +// }) + +// opts := &ListOptions{Page: 2, PerPage: 2} +// ctx := context.Background() +// repos, _, err := client.Actions.ListSelectedReposForOrgSecret(ctx, "o", "NAME", opts) +// if err != nil { +// t.Errorf("Actions.ListSelectedReposForOrgSecret returned error: %v", err) +// } + +// want := &SelectedReposList{ +// TotalCount: Int(1), +// Repositories: []*Repository{ +// {ID: Int64(1)}, +// }, +// } +// if !cmp.Equal(repos, want) { +// t.Errorf("Actions.ListSelectedReposForOrgSecret returned %+v, want %+v", repos, want) +// } + +// const methodName = "ListSelectedReposForOrgSecret" +// testBadOptions(t, methodName, func() (err error) { +// _, _, err = client.Actions.ListSelectedReposForOrgSecret(ctx, "\n", "\n", opts) +// return err +// }) + +// testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { +// got, resp, err := client.Actions.ListSelectedReposForOrgSecret(ctx, "o", "NAME", opts) +// if got != nil { +// t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) +// } +// return resp, err +// }) +// } diff --git a/github/codespaces_test.go b/github/codespaces_test.go new file mode 100644 index 00000000000..8b75731be6c --- /dev/null +++ b/github/codespaces_test.go @@ -0,0 +1,291 @@ +// Copyright 2023 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" + "time" + + "github.com/google/go-cmp/cmp" +) + +func TestCodespacesService_ListInRepo(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/owner/repo/codespaces", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{ + "page": "1", + "per_page": "2", + }) + fmt.Fprint(w, `{"total_count":2,"codespaces":[{"id":1,"name":"monalisa-octocat-hello-world-g4wpq6h95q","environment_id":"26a7c758-7299-4a73-b978-5a92a7ae98a0","owner":{"login":"octocat"},"billable_owner":{"login":"octocat"},"repository":{"id":1296269},"machine":{"name":"standardLinux","display_name":"4 cores, 8 GB RAM, 64 GB storage","operating_system":"linux","storage_in_bytes":68719476736,"memory_in_bytes":8589934592,"cpus":4},"prebuild":false,"devcontainer_path":".devcontainer/devcontainer.json","created_at":"2021-10-14T00:53:30-06:00","updated_at":"2021-10-14T00:53:32-06:00","last_used_at":"2021-10-14T00:53:30-06:00","state":"Available","url":"https://api.github.com/user/codespaces/monalisa-octocat-hello-world-g4wpq6h95q","git_status":{"ahead":0,"behind":0,"has_unpushed_changes":false,"has_uncommitted_changes":false,"ref":"main"},"location":"WestUs2","idle_timeout_minutes":60,"web_url":"https://monalisa-octocat-hello-world-g4wpq6h95q.github.dev","machines_url":"https://api.github.com/user/codespaces/monalisa-octocat-hello-world-g4wpq6h95q/machines","start_url":"https://api.github.com/user/codespaces/monalisa-octocat-hello-world-g4wpq6h95q/start","stop_url":"https://api.github.com/user/codespaces/monalisa-octocat-hello-world-g4wpq6h95q/stop","recent_folders":["testfolder1","testfolder2"]},{"id":2}]}`) + }) + + opt := &ListOptions{Page: 1, PerPage: 2} + ctx := context.Background() + codespaces, _, err := client.Codespaces.ListInRepo(ctx, "owner", "repo", opt) + if err != nil { + t.Errorf("Codespaces.ListInRepo returned error: %v", err) + } + + want := &ListCodespaces{TotalCount: Int(2), Codespaces: []*Codespace{ + { + ID: Int64(1), + Name: String("monalisa-octocat-hello-world-g4wpq6h95q"), + EnvironmentID: String("26a7c758-7299-4a73-b978-5a92a7ae98a0"), + Owner: &User{ + Login: String("octocat"), + }, + BillableOwner: &User{ + Login: String("octocat"), + }, + Repository: &Repository{ + ID: Int64(1296269), + }, + Machine: &CodespacesMachine{ + Name: String("standardLinux"), + DisplayName: String("4 cores, 8 GB RAM, 64 GB storage"), + OperatingSystem: String("linux"), + StorageInBytes: Int64(68719476736), + MemoryInBytes: Int64(8589934592), + CPUs: Int(4), + }, + Prebuild: Bool(false), + DevcontainerPath: String(".devcontainer/devcontainer.json"), + CreatedAt: &Timestamp{time.Date(2021, 10, 14, 0, 53, 30, 0, time.FixedZone("", -6*60*60))}, + UpdatedAt: &Timestamp{time.Date(2021, 10, 14, 0, 53, 32, 0, time.FixedZone("", -6*60*60))}, + LastUsedAt: &Timestamp{time.Date(2021, 10, 14, 0, 53, 30, 0, time.FixedZone("", -6*60*60))}, + State: String("Available"), + URL: String("https://api.github.com/user/codespaces/monalisa-octocat-hello-world-g4wpq6h95q"), + GitStatus: &CodespacesGitStatus{ + Ahead: Int(0), + Behind: Int(0), + HasUnpushedChanges: Bool(false), + HasUncommittedChanges: Bool(false), + Ref: String("main"), + }, + Location: String("WestUs2"), + IdleTimeoutMinutes: Int(60), + WebURL: String("https://monalisa-octocat-hello-world-g4wpq6h95q.github.dev"), + MachinesURL: String("https://api.github.com/user/codespaces/monalisa-octocat-hello-world-g4wpq6h95q/machines"), + StartURL: String("https://api.github.com/user/codespaces/monalisa-octocat-hello-world-g4wpq6h95q/start"), + StopURL: String("https://api.github.com/user/codespaces/monalisa-octocat-hello-world-g4wpq6h95q/stop"), + RecentFolders: []string{ + "testfolder1", + "testfolder2", + }, + }, + { + ID: Int64(2), + }, + }} + if !cmp.Equal(codespaces, want) { + t.Errorf("Codespaces.ListInRepo returned %+v, want %+v", codespaces, want) + } + + const methodName = "ListInRepo" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Codespaces.ListInRepo(ctx, "", "", nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestCodespacesService_List(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/user/codespaces", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{ + "page": "1", + "per_page": "2", + "repository_id": "1296269", + }) + fmt.Fprint(w, `{"total_count":1,"codespaces":[{"id":1, "repository": {"id": 1296269}}]}`) + }) + + opt := &ListCodespacesOptions{ListOptions: ListOptions{Page: 1, PerPage: 2}, RepositoryID: 1296269} + ctx := context.Background() + codespaces, _, err := client.Codespaces.List(ctx, opt) + if err != nil { + t.Errorf("Codespaces.List returned error: %v", err) + } + + want := &ListCodespaces{TotalCount: Int(1), Codespaces: []*Codespace{ + { + ID: Int64(1), + Repository: &Repository{ + ID: Int64(1296269), + }, + }, + }} + if !cmp.Equal(codespaces, want) { + t.Errorf("Codespaces.ListInRepo returned %+v, want %+v", codespaces, want) + } + + const methodName = "List" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Codespaces.List(ctx, nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestCodespacesService_CreateInRepo(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + mux.HandleFunc("/repos/owner/repo/codespaces", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + testHeader(t, r, "Content-Type", "application/json") + testBody(t, r, `{"ref":"main","geo":"WestUs2","machine":"standardLinux","idle_timeout_minutes":60}`+"\n") + fmt.Fprint(w, `{"id":1, "repository": {"id": 1296269}}`) + }) + input := &CreateCodespaceOptions{ + Ref: String("main"), + Geo: String("WestUs2"), + Machine: String("standardLinux"), + IdleTimeoutMinutes: Int(60), + } + ctx := context.Background() + codespace, _, err := client.Codespaces.CreateInRepo(ctx, "owner", "repo", input) + if err != nil { + t.Errorf("Codespaces.CreateInRepo returned error: %v", err) + } + want := &Codespace{ + ID: Int64(1), + Repository: &Repository{ + ID: Int64(1296269), + }, + } + + if !cmp.Equal(codespace, want) { + t.Errorf("Codespaces.CreateInRepo returned %+v, want %+v", codespace, want) + } + + const methodName = "CreateInRepo" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Codespaces.CreateInRepo(ctx, "\n", "", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Codespaces.CreateInRepo(ctx, "o", "r", input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestCodespacesService_Start(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + mux.HandleFunc("/user/codespaces/codespace_1/start", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + fmt.Fprint(w, `{"id":1, "repository": {"id": 1296269}}`) + }) + ctx := context.Background() + codespace, _, err := client.Codespaces.Start(ctx, "codespace_1") + if err != nil { + t.Errorf("Codespaces.Start returned error: %v", err) + } + want := &Codespace{ + ID: Int64(1), + Repository: &Repository{ + ID: Int64(1296269), + }, + } + + if !cmp.Equal(codespace, want) { + t.Errorf("Codespaces.Start returned %+v, want %+v", codespace, want) + } + + const methodName = "Start" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Codespaces.Start(ctx, "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Codespaces.Start(ctx, "o") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestCodespacesService_Stop(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + mux.HandleFunc("/user/codespaces/codespace_1/stop", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + fmt.Fprint(w, `{"id":1, "repository": {"id": 1296269}}`) + }) + ctx := context.Background() + codespace, _, err := client.Codespaces.Stop(ctx, "codespace_1") + if err != nil { + t.Errorf("Codespaces.Stop returned error: %v", err) + } + want := &Codespace{ + ID: Int64(1), + Repository: &Repository{ + ID: Int64(1296269), + }, + } + + if !cmp.Equal(codespace, want) { + t.Errorf("Codespaces.Stop returned %+v, want %+v", codespace, want) + } + + const methodName = "Stop" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Codespaces.Stop(ctx, "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Codespaces.Stop(ctx, "o") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestCodespacesService_Delete(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/user/codespaces/codespace_1", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + }) + + ctx := context.Background() + _, err := client.Codespaces.Delete(ctx, "codespace_1") + if err != nil { + t.Errorf("Codespaces.Delete return error: %v", err) + } + + const methodName = "Delete" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Codespaces.Delete(ctx, "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Codespaces.Delete(ctx, "codespace_1") + }) +} diff --git a/github/github-accessors.go b/github/github-accessors.go index 2f35ed7a902..8acb72b0420 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -2902,6 +2902,342 @@ func (c *CodeSearchResult) GetTotal() int { return *c.Total } +// GetBillableOwner returns the BillableOwner field. +func (c *Codespace) GetBillableOwner() *User { + if c == nil { + return nil + } + return c.BillableOwner +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (c *Codespace) GetCreatedAt() Timestamp { + if c == nil || c.CreatedAt == nil { + return Timestamp{} + } + return *c.CreatedAt +} + +// GetDevcontainerPath returns the DevcontainerPath field if it's non-nil, zero value otherwise. +func (c *Codespace) GetDevcontainerPath() string { + if c == nil || c.DevcontainerPath == nil { + return "" + } + return *c.DevcontainerPath +} + +// GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise. +func (c *Codespace) GetDisplayName() string { + if c == nil || c.DisplayName == nil { + return "" + } + return *c.DisplayName +} + +// GetEnvironmentID returns the EnvironmentID field if it's non-nil, zero value otherwise. +func (c *Codespace) GetEnvironmentID() string { + if c == nil || c.EnvironmentID == nil { + return "" + } + return *c.EnvironmentID +} + +// GetGitStatus returns the GitStatus field. +func (c *Codespace) GetGitStatus() *CodespacesGitStatus { + if c == nil { + return nil + } + return c.GitStatus +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (c *Codespace) GetID() int64 { + if c == nil || c.ID == nil { + return 0 + } + return *c.ID +} + +// GetIdleTimeoutMinutes returns the IdleTimeoutMinutes field if it's non-nil, zero value otherwise. +func (c *Codespace) GetIdleTimeoutMinutes() int { + if c == nil || c.IdleTimeoutMinutes == nil { + return 0 + } + return *c.IdleTimeoutMinutes +} + +// GetIdleTimeoutNotice returns the IdleTimeoutNotice field if it's non-nil, zero value otherwise. +func (c *Codespace) GetIdleTimeoutNotice() string { + if c == nil || c.IdleTimeoutNotice == nil { + return "" + } + return *c.IdleTimeoutNotice +} + +// GetLastKnownStopNotice returns the LastKnownStopNotice field if it's non-nil, zero value otherwise. +func (c *Codespace) GetLastKnownStopNotice() string { + if c == nil || c.LastKnownStopNotice == nil { + return "" + } + return *c.LastKnownStopNotice +} + +// GetLastUsedAt returns the LastUsedAt field if it's non-nil, zero value otherwise. +func (c *Codespace) GetLastUsedAt() Timestamp { + if c == nil || c.LastUsedAt == nil { + return Timestamp{} + } + return *c.LastUsedAt +} + +// GetLocation returns the Location field if it's non-nil, zero value otherwise. +func (c *Codespace) GetLocation() string { + if c == nil || c.Location == nil { + return "" + } + return *c.Location +} + +// GetMachine returns the Machine field. +func (c *Codespace) GetMachine() *CodespacesMachine { + if c == nil { + return nil + } + return c.Machine +} + +// GetMachinesURL returns the MachinesURL field if it's non-nil, zero value otherwise. +func (c *Codespace) GetMachinesURL() string { + if c == nil || c.MachinesURL == nil { + return "" + } + return *c.MachinesURL +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (c *Codespace) GetName() string { + if c == nil || c.Name == nil { + return "" + } + return *c.Name +} + +// GetOwner returns the Owner field. +func (c *Codespace) GetOwner() *User { + if c == nil { + return nil + } + return c.Owner +} + +// GetPendingOperation returns the PendingOperation field if it's non-nil, zero value otherwise. +func (c *Codespace) GetPendingOperation() bool { + if c == nil || c.PendingOperation == nil { + return false + } + return *c.PendingOperation +} + +// GetPendingOperationDisabledReason returns the PendingOperationDisabledReason field if it's non-nil, zero value otherwise. +func (c *Codespace) GetPendingOperationDisabledReason() string { + if c == nil || c.PendingOperationDisabledReason == nil { + return "" + } + return *c.PendingOperationDisabledReason +} + +// GetPrebuild returns the Prebuild field if it's non-nil, zero value otherwise. +func (c *Codespace) GetPrebuild() bool { + if c == nil || c.Prebuild == nil { + return false + } + return *c.Prebuild +} + +// GetPullsURL returns the PullsURL field if it's non-nil, zero value otherwise. +func (c *Codespace) GetPullsURL() string { + if c == nil || c.PullsURL == nil { + return "" + } + return *c.PullsURL +} + +// GetRepository returns the Repository field. +func (c *Codespace) GetRepository() *Repository { + if c == nil { + return nil + } + return c.Repository +} + +// GetRetentionExpiresAt returns the RetentionExpiresAt field if it's non-nil, zero value otherwise. +func (c *Codespace) GetRetentionExpiresAt() Timestamp { + if c == nil || c.RetentionExpiresAt == nil { + return Timestamp{} + } + return *c.RetentionExpiresAt +} + +// GetRetentionPeriodMinutes returns the RetentionPeriodMinutes field if it's non-nil, zero value otherwise. +func (c *Codespace) GetRetentionPeriodMinutes() int { + if c == nil || c.RetentionPeriodMinutes == nil { + return 0 + } + return *c.RetentionPeriodMinutes +} + +// GetRuntimeConstraints returns the RuntimeConstraints field. +func (c *Codespace) GetRuntimeConstraints() *CodespacesRuntimeConstraints { + if c == nil { + return nil + } + return c.RuntimeConstraints +} + +// GetStartURL returns the StartURL field if it's non-nil, zero value otherwise. +func (c *Codespace) GetStartURL() string { + if c == nil || c.StartURL == nil { + return "" + } + return *c.StartURL +} + +// GetState returns the State field if it's non-nil, zero value otherwise. +func (c *Codespace) GetState() string { + if c == nil || c.State == nil { + return "" + } + return *c.State +} + +// GetStopURL returns the StopURL field if it's non-nil, zero value otherwise. +func (c *Codespace) GetStopURL() string { + if c == nil || c.StopURL == nil { + return "" + } + return *c.StopURL +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (c *Codespace) GetUpdatedAt() Timestamp { + if c == nil || c.UpdatedAt == nil { + return Timestamp{} + } + return *c.UpdatedAt +} + +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (c *Codespace) GetURL() string { + if c == nil || c.URL == nil { + return "" + } + return *c.URL +} + +// GetWebURL returns the WebURL field if it's non-nil, zero value otherwise. +func (c *Codespace) GetWebURL() string { + if c == nil || c.WebURL == nil { + return "" + } + return *c.WebURL +} + +// GetAhead returns the Ahead field if it's non-nil, zero value otherwise. +func (c *CodespacesGitStatus) GetAhead() int { + if c == nil || c.Ahead == nil { + return 0 + } + return *c.Ahead +} + +// GetBehind returns the Behind field if it's non-nil, zero value otherwise. +func (c *CodespacesGitStatus) GetBehind() int { + if c == nil || c.Behind == nil { + return 0 + } + return *c.Behind +} + +// GetHasUncommittedChanges returns the HasUncommittedChanges field if it's non-nil, zero value otherwise. +func (c *CodespacesGitStatus) GetHasUncommittedChanges() bool { + if c == nil || c.HasUncommittedChanges == nil { + return false + } + return *c.HasUncommittedChanges +} + +// GetHasUnpushedChanges returns the HasUnpushedChanges field if it's non-nil, zero value otherwise. +func (c *CodespacesGitStatus) GetHasUnpushedChanges() bool { + if c == nil || c.HasUnpushedChanges == nil { + return false + } + return *c.HasUnpushedChanges +} + +// GetRef returns the Ref field if it's non-nil, zero value otherwise. +func (c *CodespacesGitStatus) GetRef() string { + if c == nil || c.Ref == nil { + return "" + } + return *c.Ref +} + +// GetCPUs returns the CPUs field if it's non-nil, zero value otherwise. +func (c *CodespacesMachine) GetCPUs() int { + if c == nil || c.CPUs == nil { + return 0 + } + return *c.CPUs +} + +// GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise. +func (c *CodespacesMachine) GetDisplayName() string { + if c == nil || c.DisplayName == nil { + return "" + } + return *c.DisplayName +} + +// GetMemoryInBytes returns the MemoryInBytes field if it's non-nil, zero value otherwise. +func (c *CodespacesMachine) GetMemoryInBytes() int64 { + if c == nil || c.MemoryInBytes == nil { + return 0 + } + return *c.MemoryInBytes +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (c *CodespacesMachine) GetName() string { + if c == nil || c.Name == nil { + return "" + } + return *c.Name +} + +// GetOperatingSystem returns the OperatingSystem field if it's non-nil, zero value otherwise. +func (c *CodespacesMachine) GetOperatingSystem() string { + if c == nil || c.OperatingSystem == nil { + return "" + } + return *c.OperatingSystem +} + +// GetPrebuildAvailability returns the PrebuildAvailability field if it's non-nil, zero value otherwise. +func (c *CodespacesMachine) GetPrebuildAvailability() string { + if c == nil || c.PrebuildAvailability == nil { + return "" + } + return *c.PrebuildAvailability +} + +// GetStorageInBytes returns the StorageInBytes field if it's non-nil, zero value otherwise. +func (c *CodespacesMachine) GetStorageInBytes() int64 { + if c == nil || c.StorageInBytes == nil { + return 0 + } + return *c.StorageInBytes +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (c *CollaboratorInvitation) GetCreatedAt() Timestamp { if c == nil || c.CreatedAt == nil { @@ -4022,6 +4358,86 @@ func (c *CreateCheckSuiteOptions) GetHeadBranch() string { return *c.HeadBranch } +// GetClientIP returns the ClientIP field if it's non-nil, zero value otherwise. +func (c *CreateCodespaceOptions) GetClientIP() string { + if c == nil || c.ClientIP == nil { + return "" + } + return *c.ClientIP +} + +// GetDevcontainerPath returns the DevcontainerPath field if it's non-nil, zero value otherwise. +func (c *CreateCodespaceOptions) GetDevcontainerPath() string { + if c == nil || c.DevcontainerPath == nil { + return "" + } + return *c.DevcontainerPath +} + +// GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise. +func (c *CreateCodespaceOptions) GetDisplayName() string { + if c == nil || c.DisplayName == nil { + return "" + } + return *c.DisplayName +} + +// GetGeo returns the Geo field if it's non-nil, zero value otherwise. +func (c *CreateCodespaceOptions) GetGeo() string { + if c == nil || c.Geo == nil { + return "" + } + return *c.Geo +} + +// GetIdleTimeoutMinutes returns the IdleTimeoutMinutes field if it's non-nil, zero value otherwise. +func (c *CreateCodespaceOptions) GetIdleTimeoutMinutes() int { + if c == nil || c.IdleTimeoutMinutes == nil { + return 0 + } + return *c.IdleTimeoutMinutes +} + +// GetMachine returns the Machine field if it's non-nil, zero value otherwise. +func (c *CreateCodespaceOptions) GetMachine() string { + if c == nil || c.Machine == nil { + return "" + } + return *c.Machine +} + +// GetMultiRepoPermissionsOptOut returns the MultiRepoPermissionsOptOut field if it's non-nil, zero value otherwise. +func (c *CreateCodespaceOptions) GetMultiRepoPermissionsOptOut() bool { + if c == nil || c.MultiRepoPermissionsOptOut == nil { + return false + } + return *c.MultiRepoPermissionsOptOut +} + +// GetRef returns the Ref field if it's non-nil, zero value otherwise. +func (c *CreateCodespaceOptions) GetRef() string { + if c == nil || c.Ref == nil { + return "" + } + return *c.Ref +} + +// GetRetentionPeriodMinutes returns the RetentionPeriodMinutes field if it's non-nil, zero value otherwise. +func (c *CreateCodespaceOptions) GetRetentionPeriodMinutes() int { + if c == nil || c.RetentionPeriodMinutes == nil { + return 0 + } + return *c.RetentionPeriodMinutes +} + +// GetWorkingDirectory returns the WorkingDirectory field if it's non-nil, zero value otherwise. +func (c *CreateCodespaceOptions) GetWorkingDirectory() string { + if c == nil || c.WorkingDirectory == nil { + return "" + } + return *c.WorkingDirectory +} + // GetDescription returns the Description field if it's non-nil, zero value otherwise. func (c *CreateEvent) GetDescription() string { if c == nil || c.Description == nil { @@ -9510,6 +9926,14 @@ func (l *ListCheckSuiteResults) GetTotal() int { return *l.Total } +// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. +func (l *ListCodespaces) GetTotalCount() int { + if l == nil || l.TotalCount == nil { + return 0 + } + return *l.TotalCount +} + // GetAffiliation returns the Affiliation field if it's non-nil, zero value otherwise. func (l *ListCollaboratorOptions) GetAffiliation() string { if l == nil || l.Affiliation == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index f83f47381fa..3f39d9c1a95 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -3439,6 +3439,408 @@ func TestCodeSearchResult_GetTotal(tt *testing.T) { c.GetTotal() } +func TestCodespace_GetBillableOwner(tt *testing.T) { + c := &Codespace{} + c.GetBillableOwner() + c = nil + c.GetBillableOwner() +} + +func TestCodespace_GetCreatedAt(tt *testing.T) { + var zeroValue Timestamp + c := &Codespace{CreatedAt: &zeroValue} + c.GetCreatedAt() + c = &Codespace{} + c.GetCreatedAt() + c = nil + c.GetCreatedAt() +} + +func TestCodespace_GetDevcontainerPath(tt *testing.T) { + var zeroValue string + c := &Codespace{DevcontainerPath: &zeroValue} + c.GetDevcontainerPath() + c = &Codespace{} + c.GetDevcontainerPath() + c = nil + c.GetDevcontainerPath() +} + +func TestCodespace_GetDisplayName(tt *testing.T) { + var zeroValue string + c := &Codespace{DisplayName: &zeroValue} + c.GetDisplayName() + c = &Codespace{} + c.GetDisplayName() + c = nil + c.GetDisplayName() +} + +func TestCodespace_GetEnvironmentID(tt *testing.T) { + var zeroValue string + c := &Codespace{EnvironmentID: &zeroValue} + c.GetEnvironmentID() + c = &Codespace{} + c.GetEnvironmentID() + c = nil + c.GetEnvironmentID() +} + +func TestCodespace_GetGitStatus(tt *testing.T) { + c := &Codespace{} + c.GetGitStatus() + c = nil + c.GetGitStatus() +} + +func TestCodespace_GetID(tt *testing.T) { + var zeroValue int64 + c := &Codespace{ID: &zeroValue} + c.GetID() + c = &Codespace{} + c.GetID() + c = nil + c.GetID() +} + +func TestCodespace_GetIdleTimeoutMinutes(tt *testing.T) { + var zeroValue int + c := &Codespace{IdleTimeoutMinutes: &zeroValue} + c.GetIdleTimeoutMinutes() + c = &Codespace{} + c.GetIdleTimeoutMinutes() + c = nil + c.GetIdleTimeoutMinutes() +} + +func TestCodespace_GetIdleTimeoutNotice(tt *testing.T) { + var zeroValue string + c := &Codespace{IdleTimeoutNotice: &zeroValue} + c.GetIdleTimeoutNotice() + c = &Codespace{} + c.GetIdleTimeoutNotice() + c = nil + c.GetIdleTimeoutNotice() +} + +func TestCodespace_GetLastKnownStopNotice(tt *testing.T) { + var zeroValue string + c := &Codespace{LastKnownStopNotice: &zeroValue} + c.GetLastKnownStopNotice() + c = &Codespace{} + c.GetLastKnownStopNotice() + c = nil + c.GetLastKnownStopNotice() +} + +func TestCodespace_GetLastUsedAt(tt *testing.T) { + var zeroValue Timestamp + c := &Codespace{LastUsedAt: &zeroValue} + c.GetLastUsedAt() + c = &Codespace{} + c.GetLastUsedAt() + c = nil + c.GetLastUsedAt() +} + +func TestCodespace_GetLocation(tt *testing.T) { + var zeroValue string + c := &Codespace{Location: &zeroValue} + c.GetLocation() + c = &Codespace{} + c.GetLocation() + c = nil + c.GetLocation() +} + +func TestCodespace_GetMachine(tt *testing.T) { + c := &Codespace{} + c.GetMachine() + c = nil + c.GetMachine() +} + +func TestCodespace_GetMachinesURL(tt *testing.T) { + var zeroValue string + c := &Codespace{MachinesURL: &zeroValue} + c.GetMachinesURL() + c = &Codespace{} + c.GetMachinesURL() + c = nil + c.GetMachinesURL() +} + +func TestCodespace_GetName(tt *testing.T) { + var zeroValue string + c := &Codespace{Name: &zeroValue} + c.GetName() + c = &Codespace{} + c.GetName() + c = nil + c.GetName() +} + +func TestCodespace_GetOwner(tt *testing.T) { + c := &Codespace{} + c.GetOwner() + c = nil + c.GetOwner() +} + +func TestCodespace_GetPendingOperation(tt *testing.T) { + var zeroValue bool + c := &Codespace{PendingOperation: &zeroValue} + c.GetPendingOperation() + c = &Codespace{} + c.GetPendingOperation() + c = nil + c.GetPendingOperation() +} + +func TestCodespace_GetPendingOperationDisabledReason(tt *testing.T) { + var zeroValue string + c := &Codespace{PendingOperationDisabledReason: &zeroValue} + c.GetPendingOperationDisabledReason() + c = &Codespace{} + c.GetPendingOperationDisabledReason() + c = nil + c.GetPendingOperationDisabledReason() +} + +func TestCodespace_GetPrebuild(tt *testing.T) { + var zeroValue bool + c := &Codespace{Prebuild: &zeroValue} + c.GetPrebuild() + c = &Codespace{} + c.GetPrebuild() + c = nil + c.GetPrebuild() +} + +func TestCodespace_GetPullsURL(tt *testing.T) { + var zeroValue string + c := &Codespace{PullsURL: &zeroValue} + c.GetPullsURL() + c = &Codespace{} + c.GetPullsURL() + c = nil + c.GetPullsURL() +} + +func TestCodespace_GetRepository(tt *testing.T) { + c := &Codespace{} + c.GetRepository() + c = nil + c.GetRepository() +} + +func TestCodespace_GetRetentionExpiresAt(tt *testing.T) { + var zeroValue Timestamp + c := &Codespace{RetentionExpiresAt: &zeroValue} + c.GetRetentionExpiresAt() + c = &Codespace{} + c.GetRetentionExpiresAt() + c = nil + c.GetRetentionExpiresAt() +} + +func TestCodespace_GetRetentionPeriodMinutes(tt *testing.T) { + var zeroValue int + c := &Codespace{RetentionPeriodMinutes: &zeroValue} + c.GetRetentionPeriodMinutes() + c = &Codespace{} + c.GetRetentionPeriodMinutes() + c = nil + c.GetRetentionPeriodMinutes() +} + +func TestCodespace_GetRuntimeConstraints(tt *testing.T) { + c := &Codespace{} + c.GetRuntimeConstraints() + c = nil + c.GetRuntimeConstraints() +} + +func TestCodespace_GetStartURL(tt *testing.T) { + var zeroValue string + c := &Codespace{StartURL: &zeroValue} + c.GetStartURL() + c = &Codespace{} + c.GetStartURL() + c = nil + c.GetStartURL() +} + +func TestCodespace_GetState(tt *testing.T) { + var zeroValue string + c := &Codespace{State: &zeroValue} + c.GetState() + c = &Codespace{} + c.GetState() + c = nil + c.GetState() +} + +func TestCodespace_GetStopURL(tt *testing.T) { + var zeroValue string + c := &Codespace{StopURL: &zeroValue} + c.GetStopURL() + c = &Codespace{} + c.GetStopURL() + c = nil + c.GetStopURL() +} + +func TestCodespace_GetUpdatedAt(tt *testing.T) { + var zeroValue Timestamp + c := &Codespace{UpdatedAt: &zeroValue} + c.GetUpdatedAt() + c = &Codespace{} + c.GetUpdatedAt() + c = nil + c.GetUpdatedAt() +} + +func TestCodespace_GetURL(tt *testing.T) { + var zeroValue string + c := &Codespace{URL: &zeroValue} + c.GetURL() + c = &Codespace{} + c.GetURL() + c = nil + c.GetURL() +} + +func TestCodespace_GetWebURL(tt *testing.T) { + var zeroValue string + c := &Codespace{WebURL: &zeroValue} + c.GetWebURL() + c = &Codespace{} + c.GetWebURL() + c = nil + c.GetWebURL() +} + +func TestCodespacesGitStatus_GetAhead(tt *testing.T) { + var zeroValue int + c := &CodespacesGitStatus{Ahead: &zeroValue} + c.GetAhead() + c = &CodespacesGitStatus{} + c.GetAhead() + c = nil + c.GetAhead() +} + +func TestCodespacesGitStatus_GetBehind(tt *testing.T) { + var zeroValue int + c := &CodespacesGitStatus{Behind: &zeroValue} + c.GetBehind() + c = &CodespacesGitStatus{} + c.GetBehind() + c = nil + c.GetBehind() +} + +func TestCodespacesGitStatus_GetHasUncommittedChanges(tt *testing.T) { + var zeroValue bool + c := &CodespacesGitStatus{HasUncommittedChanges: &zeroValue} + c.GetHasUncommittedChanges() + c = &CodespacesGitStatus{} + c.GetHasUncommittedChanges() + c = nil + c.GetHasUncommittedChanges() +} + +func TestCodespacesGitStatus_GetHasUnpushedChanges(tt *testing.T) { + var zeroValue bool + c := &CodespacesGitStatus{HasUnpushedChanges: &zeroValue} + c.GetHasUnpushedChanges() + c = &CodespacesGitStatus{} + c.GetHasUnpushedChanges() + c = nil + c.GetHasUnpushedChanges() +} + +func TestCodespacesGitStatus_GetRef(tt *testing.T) { + var zeroValue string + c := &CodespacesGitStatus{Ref: &zeroValue} + c.GetRef() + c = &CodespacesGitStatus{} + c.GetRef() + c = nil + c.GetRef() +} + +func TestCodespacesMachine_GetCPUs(tt *testing.T) { + var zeroValue int + c := &CodespacesMachine{CPUs: &zeroValue} + c.GetCPUs() + c = &CodespacesMachine{} + c.GetCPUs() + c = nil + c.GetCPUs() +} + +func TestCodespacesMachine_GetDisplayName(tt *testing.T) { + var zeroValue string + c := &CodespacesMachine{DisplayName: &zeroValue} + c.GetDisplayName() + c = &CodespacesMachine{} + c.GetDisplayName() + c = nil + c.GetDisplayName() +} + +func TestCodespacesMachine_GetMemoryInBytes(tt *testing.T) { + var zeroValue int64 + c := &CodespacesMachine{MemoryInBytes: &zeroValue} + c.GetMemoryInBytes() + c = &CodespacesMachine{} + c.GetMemoryInBytes() + c = nil + c.GetMemoryInBytes() +} + +func TestCodespacesMachine_GetName(tt *testing.T) { + var zeroValue string + c := &CodespacesMachine{Name: &zeroValue} + c.GetName() + c = &CodespacesMachine{} + c.GetName() + c = nil + c.GetName() +} + +func TestCodespacesMachine_GetOperatingSystem(tt *testing.T) { + var zeroValue string + c := &CodespacesMachine{OperatingSystem: &zeroValue} + c.GetOperatingSystem() + c = &CodespacesMachine{} + c.GetOperatingSystem() + c = nil + c.GetOperatingSystem() +} + +func TestCodespacesMachine_GetPrebuildAvailability(tt *testing.T) { + var zeroValue string + c := &CodespacesMachine{PrebuildAvailability: &zeroValue} + c.GetPrebuildAvailability() + c = &CodespacesMachine{} + c.GetPrebuildAvailability() + c = nil + c.GetPrebuildAvailability() +} + +func TestCodespacesMachine_GetStorageInBytes(tt *testing.T) { + var zeroValue int64 + c := &CodespacesMachine{StorageInBytes: &zeroValue} + c.GetStorageInBytes() + c = &CodespacesMachine{} + c.GetStorageInBytes() + c = nil + c.GetStorageInBytes() +} + func TestCollaboratorInvitation_GetCreatedAt(tt *testing.T) { var zeroValue Timestamp c := &CollaboratorInvitation{CreatedAt: &zeroValue} @@ -4734,6 +5136,106 @@ func TestCreateCheckSuiteOptions_GetHeadBranch(tt *testing.T) { c.GetHeadBranch() } +func TestCreateCodespaceOptions_GetClientIP(tt *testing.T) { + var zeroValue string + c := &CreateCodespaceOptions{ClientIP: &zeroValue} + c.GetClientIP() + c = &CreateCodespaceOptions{} + c.GetClientIP() + c = nil + c.GetClientIP() +} + +func TestCreateCodespaceOptions_GetDevcontainerPath(tt *testing.T) { + var zeroValue string + c := &CreateCodespaceOptions{DevcontainerPath: &zeroValue} + c.GetDevcontainerPath() + c = &CreateCodespaceOptions{} + c.GetDevcontainerPath() + c = nil + c.GetDevcontainerPath() +} + +func TestCreateCodespaceOptions_GetDisplayName(tt *testing.T) { + var zeroValue string + c := &CreateCodespaceOptions{DisplayName: &zeroValue} + c.GetDisplayName() + c = &CreateCodespaceOptions{} + c.GetDisplayName() + c = nil + c.GetDisplayName() +} + +func TestCreateCodespaceOptions_GetGeo(tt *testing.T) { + var zeroValue string + c := &CreateCodespaceOptions{Geo: &zeroValue} + c.GetGeo() + c = &CreateCodespaceOptions{} + c.GetGeo() + c = nil + c.GetGeo() +} + +func TestCreateCodespaceOptions_GetIdleTimeoutMinutes(tt *testing.T) { + var zeroValue int + c := &CreateCodespaceOptions{IdleTimeoutMinutes: &zeroValue} + c.GetIdleTimeoutMinutes() + c = &CreateCodespaceOptions{} + c.GetIdleTimeoutMinutes() + c = nil + c.GetIdleTimeoutMinutes() +} + +func TestCreateCodespaceOptions_GetMachine(tt *testing.T) { + var zeroValue string + c := &CreateCodespaceOptions{Machine: &zeroValue} + c.GetMachine() + c = &CreateCodespaceOptions{} + c.GetMachine() + c = nil + c.GetMachine() +} + +func TestCreateCodespaceOptions_GetMultiRepoPermissionsOptOut(tt *testing.T) { + var zeroValue bool + c := &CreateCodespaceOptions{MultiRepoPermissionsOptOut: &zeroValue} + c.GetMultiRepoPermissionsOptOut() + c = &CreateCodespaceOptions{} + c.GetMultiRepoPermissionsOptOut() + c = nil + c.GetMultiRepoPermissionsOptOut() +} + +func TestCreateCodespaceOptions_GetRef(tt *testing.T) { + var zeroValue string + c := &CreateCodespaceOptions{Ref: &zeroValue} + c.GetRef() + c = &CreateCodespaceOptions{} + c.GetRef() + c = nil + c.GetRef() +} + +func TestCreateCodespaceOptions_GetRetentionPeriodMinutes(tt *testing.T) { + var zeroValue int + c := &CreateCodespaceOptions{RetentionPeriodMinutes: &zeroValue} + c.GetRetentionPeriodMinutes() + c = &CreateCodespaceOptions{} + c.GetRetentionPeriodMinutes() + c = nil + c.GetRetentionPeriodMinutes() +} + +func TestCreateCodespaceOptions_GetWorkingDirectory(tt *testing.T) { + var zeroValue string + c := &CreateCodespaceOptions{WorkingDirectory: &zeroValue} + c.GetWorkingDirectory() + c = &CreateCodespaceOptions{} + c.GetWorkingDirectory() + c = nil + c.GetWorkingDirectory() +} + func TestCreateEvent_GetDescription(tt *testing.T) { var zeroValue string c := &CreateEvent{Description: &zeroValue} @@ -11156,6 +11658,16 @@ func TestListCheckSuiteResults_GetTotal(tt *testing.T) { l.GetTotal() } +func TestListCodespaces_GetTotalCount(tt *testing.T) { + var zeroValue int + l := &ListCodespaces{TotalCount: &zeroValue} + l.GetTotalCount() + l = &ListCodespaces{} + l.GetTotalCount() + l = nil + l.GetTotalCount() +} + func TestListCollaboratorOptions_GetAffiliation(tt *testing.T) { var zeroValue string l := &ListCollaboratorOptions{Affiliation: &zeroValue} diff --git a/github/github.go b/github/github.go index db623ffd7bf..2c062dc3f24 100644 --- a/github/github.go +++ b/github/github.go @@ -187,6 +187,7 @@ type Client struct { Billing *BillingService Checks *ChecksService CodeScanning *CodeScanningService + Codespaces *CodespacesService Dependabot *DependabotService Enterprise *EnterpriseService Gists *GistsService @@ -325,6 +326,7 @@ func NewClient(httpClient *http.Client) *Client { c.Billing = (*BillingService)(&c.common) c.Checks = (*ChecksService)(&c.common) c.CodeScanning = (*CodeScanningService)(&c.common) + c.Codespaces = (*CodespacesService)(&c.common) c.Dependabot = (*DependabotService)(&c.common) c.Enterprise = (*EnterpriseService)(&c.common) c.Gists = (*GistsService)(&c.common) From 487c80d31df99b02e685e118685edbcef8e81a3e Mon Sep 17 00:00:00 2001 From: danztran <33027899+danztran@users.noreply.github.com> Date: Mon, 19 Jun 2023 19:20:13 +0700 Subject: [PATCH 247/751] Fix missing Include, Exclude fields in RulesetRefConditionParameters (#2810) Fixes: #2809. --- github/repos_rules.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/github/repos_rules.go b/github/repos_rules.go index 64e7c9ca6df..9299d3e7f3d 100644 --- a/github/repos_rules.go +++ b/github/repos_rules.go @@ -30,8 +30,8 @@ type RulesetLinks struct { // RulesetRefConditionParameters represents the conditions object for ref_names. type RulesetRefConditionParameters struct { - Include []string `json:"include,omitempty"` - Exclude []string `json:"exclude,omitempty"` + Include []string `json:"include"` + Exclude []string `json:"exclude"` } // RulesetRepositoryConditionParameters represents the conditions object for repository_names. From 3afe4dba249c5bbe0dbd25344fdba46212566cf0 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Mon, 19 Jun 2023 08:26:45 -0400 Subject: [PATCH 248/751] Bump version of go-github to v53.2.0 (#2811) --- README.md | 1 + github/github.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9a5386c2dcf..4e954e15756 100644 --- a/README.md +++ b/README.md @@ -396,6 +396,7 @@ Versions prior to 48.2.0 are not listed. | go-github Version | GitHub v3 API Version | | ----------------- | --------------------- | +| 53.2.0 | 2022-11-28 | | 53.1.0 | 2022-11-28 | | 53.0.0 | 2022-11-28 | | 52.0.0 | 2022-11-28 | diff --git a/github/github.go b/github/github.go index 2c062dc3f24..34a27282f0f 100644 --- a/github/github.go +++ b/github/github.go @@ -28,7 +28,7 @@ import ( ) const ( - Version = "v53.1.0" + Version = "v53.2.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" From 3220fa010cf242cff2f2bf0f850e928e4c911e24 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Jun 2023 08:04:44 -0400 Subject: [PATCH 249/751] Bump golang.org/x/net from 0.10.0 to 0.11.0 in /scrape (#2814) --- scrape/go.mod | 2 +- scrape/go.sum | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 1aff12bb184..6d52acb4e47 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -7,5 +7,5 @@ require ( github.com/google/go-cmp v0.5.9 github.com/google/go-github/v53 v53.0.0 github.com/xlzd/gotp v0.1.0 - golang.org/x/net v0.10.0 + golang.org/x/net v0.11.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index 57c51fd9b17..9b06b93ba8e 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -29,8 +29,9 @@ github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5t golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= +golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= @@ -42,8 +43,9 @@ golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU= +golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8= golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -60,14 +62,16 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= +golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -77,6 +81,7 @@ golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= From b09a7696ff2519d659dd49bc75999220cc52673c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Jun 2023 08:11:16 -0400 Subject: [PATCH 250/751] Bump golang.org/x/oauth2 from 0.8.0 to 0.9.0 (#2812) --- go.mod | 8 ++++---- go.sum | 47 +++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 45 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 01c3374411b..c70219a69c9 100644 --- a/go.mod +++ b/go.mod @@ -4,15 +4,15 @@ require ( github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 github.com/google/go-cmp v0.5.9 github.com/google/go-querystring v1.1.0 - golang.org/x/oauth2 v0.8.0 + golang.org/x/oauth2 v0.9.0 ) require ( github.com/cloudflare/circl v1.3.3 // indirect github.com/golang/protobuf v1.5.2 // indirect - golang.org/x/crypto v0.7.0 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/sys v0.8.0 // indirect + golang.org/x/crypto v0.10.0 // indirect + golang.org/x/net v0.11.0 // indirect + golang.org/x/sys v0.9.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.28.0 // indirect ) diff --git a/go.sum b/go.sum index 99e4709f7bd..5572c596bc4 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,8 @@ +cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= +github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= @@ -10,31 +12,64 @@ github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= 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/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= +golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= +golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8= -golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= +golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU= +golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= +golang.org/x/oauth2 v0.9.0 h1:BPpt2kU7oMRq3kCHAA1tbSEshXRw1LpG2ztgDwrzuAs= +golang.org/x/oauth2 v0.9.0/go.mod h1:qYgFZaFiu6Wg24azG8bdV52QJXJGbZzIIsRCdVKzbLw= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= +golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= From 187e6e3e922c5c6d68c9bc1b964ca8d69fcdd1f4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Jun 2023 08:12:25 -0400 Subject: [PATCH 251/751] Bump github.com/google/go-github/v53 from 53.0.0 to 53.2.0 in /scrape (#2813) --- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 6d52acb4e47..5ec934b7097 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -5,7 +5,7 @@ go 1.13 require ( github.com/PuerkitoBio/goquery v1.8.1 github.com/google/go-cmp v0.5.9 - github.com/google/go-github/v53 v53.0.0 + github.com/google/go-github/v53 v53.2.0 github.com/xlzd/gotp v0.1.0 golang.org/x/net v0.11.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index 9b06b93ba8e..825ab769b9f 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -19,8 +19,8 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v53 v53.0.0 h1:T1RyHbSnpHYnoF0ZYKiIPSgPtuJ8G6vgc0MKodXsQDQ= -github.com/google/go-github/v53 v53.0.0/go.mod h1:XhFRObz+m/l+UCm9b7KSIC3lT3NWSXGt7mOsAWEloao= +github.com/google/go-github/v53 v53.2.0 h1:wvz3FyF53v4BK+AsnvCmeNhf8AkTaeh2SoYu/XUvTtI= +github.com/google/go-github/v53 v53.2.0/go.mod h1:XhFRObz+m/l+UCm9b7KSIC3lT3NWSXGt7mOsAWEloao= 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.1.0 h1:37blvlKCh38s+fkem+fFh7sMnceltoIEBYTVXyoa5Po= From 1e7c68570282cc336f2e6cd4445d096d9cada858 Mon Sep 17 00:00:00 2001 From: Ahmad Nurus S Date: Sat, 24 Jun 2023 02:38:29 +0700 Subject: [PATCH 252/751] Add Runner to generate-jitconfig method (#2818) --- github/actions_runners.go | 1 + github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 7 +++++++ 3 files changed, 16 insertions(+) diff --git a/github/actions_runners.go b/github/actions_runners.go index 3990a5a90f7..7427451ccfa 100644 --- a/github/actions_runners.go +++ b/github/actions_runners.go @@ -58,6 +58,7 @@ type GenerateJITConfigRequest struct { // JITRunnerConfig represents encoded JIT configuration that can be used to bootstrap a self-hosted runner. type JITRunnerConfig struct { + Runner *Runner `json:"runner,omitempty"` EncodedJITConfig *string `json:"encoded_jit_config,omitempty"` } diff --git a/github/github-accessors.go b/github/github-accessors.go index 8acb72b0420..01b5796fecd 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -9406,6 +9406,14 @@ func (j *JITRunnerConfig) GetEncodedJITConfig() string { return *j.EncodedJITConfig } +// GetRunner returns the Runner field. +func (j *JITRunnerConfig) GetRunner() *Runner { + if j == nil { + return nil + } + return j.Runner +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (j *Jobs) GetTotalCount() int { if j == nil || j.TotalCount == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 3f39d9c1a95..959edc4deb1 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -11029,6 +11029,13 @@ func TestJITRunnerConfig_GetEncodedJITConfig(tt *testing.T) { j.GetEncodedJITConfig() } +func TestJITRunnerConfig_GetRunner(tt *testing.T) { + j := &JITRunnerConfig{} + j.GetRunner() + j = nil + j.GetRunner() +} + func TestJobs_GetTotalCount(tt *testing.T) { var zeroValue int j := &Jobs{TotalCount: &zeroValue} From bed40d130eb595c853f4ee71e125b95b4ee0d227 Mon Sep 17 00:00:00 2001 From: guangwu Date: Mon, 26 Jun 2023 19:37:17 +0800 Subject: [PATCH 253/751] Remove unnecessary use of fmt.Sprintf (#2819) --- github/admin_stats.go | 3 +-- github/codespaces.go | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/github/admin_stats.go b/github/admin_stats.go index ef294f44791..17e568f62b2 100644 --- a/github/admin_stats.go +++ b/github/admin_stats.go @@ -7,7 +7,6 @@ package github import ( "context" - "fmt" ) // AdminStats represents a variety of stats of a GitHub Enterprise @@ -155,7 +154,7 @@ func (s RepoStats) String() string { // // GitHub API docs: https://docs.github.com/en/rest/enterprise-admin/admin_stats/ func (s *AdminService) GetAdminStats(ctx context.Context) (*AdminStats, *Response, error) { - u := fmt.Sprintf("enterprise/stats/all") + u := "enterprise/stats/all" req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err diff --git a/github/codespaces.go b/github/codespaces.go index a260c227de7..cd8b0e5bee5 100644 --- a/github/codespaces.go +++ b/github/codespaces.go @@ -126,7 +126,7 @@ type ListCodespacesOptions struct { // // GitHub API docs: https://docs.github.com/en/rest/codespaces/codespaces?apiVersion=2022-11-28#list-codespaces-for-the-authenticated-user func (s *CodespacesService) List(ctx context.Context, opts *ListCodespacesOptions) (*ListCodespaces, *Response, error) { - u := fmt.Sprint("user/codespaces") + u := "user/codespaces" u, err := addOptions(u, opts) if err != nil { return nil, nil, err From cd0f4b96e5d8dee05eaae0bd4336baf27de1ace8 Mon Sep 17 00:00:00 2001 From: guangwu Date: Mon, 26 Jun 2023 19:39:17 +0800 Subject: [PATCH 254/751] Use bytes.Equal instead of bytes.Compare (#2820) --- github/github.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/github.go b/github/github.go index 34a27282f0f..1b41ffdc0ef 100644 --- a/github/github.go +++ b/github/github.go @@ -1052,7 +1052,7 @@ func (ae *AcceptedError) Is(target error) bool { if !ok { return false } - return bytes.Compare(ae.Raw, v.Raw) == 0 + return bytes.Equal(ae.Raw, v.Raw) } // AbuseRateLimitError occurs when GitHub returns 403 Forbidden response with the From 96726d8192f34c0d46e7b64b3c400962e8e64898 Mon Sep 17 00:00:00 2001 From: Franky W Date: Tue, 27 Jun 2023 14:25:07 +0200 Subject: [PATCH 255/751] Fix `CreateOrUpdateOrgSecret` regression introduced in v53 (#2817) Fixes: #2816. --- github/dependabot_secrets.go | 19 ++++++++++++++++++- github/dependabot_secrets_test.go | 2 +- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/github/dependabot_secrets.go b/github/dependabot_secrets.go index f87ab42c396..685f7bea8ea 100644 --- a/github/dependabot_secrets.go +++ b/github/dependabot_secrets.go @@ -144,8 +144,25 @@ func (s *DependabotService) CreateOrUpdateRepoSecret(ctx context.Context, owner, // // GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#create-or-update-an-organization-secret func (s *DependabotService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *DependabotEncryptedSecret) (*Response, error) { + repoIDs := make([]string, len(eSecret.SelectedRepositoryIDs)) + for i, secret := range eSecret.SelectedRepositoryIDs { + repoIDs[i] = fmt.Sprintf("%v", secret) + } + params := struct { + *DependabotEncryptedSecret + SelectedRepositoryIDs []string `json:"selected_repository_ids,omitempty"` + }{ + DependabotEncryptedSecret: eSecret, + SelectedRepositoryIDs: repoIDs, + } + url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v", org, eSecret.Name) - return s.putSecret(ctx, url, eSecret) + req, err := s.client.NewRequest("PUT", url, params) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) } func (s *DependabotService) deleteSecret(ctx context.Context, url string) (*Response, error) { diff --git a/github/dependabot_secrets_test.go b/github/dependabot_secrets_test.go index 13eac69efe7..d48328846c8 100644 --- a/github/dependabot_secrets_test.go +++ b/github/dependabot_secrets_test.go @@ -352,7 +352,7 @@ func TestDependabotService_CreateOrUpdateOrgSecret(t *testing.T) { mux.HandleFunc("/orgs/o/dependabot/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") testHeader(t, r, "Content-Type", "application/json") - testBody(t, r, `{"key_id":"1234","encrypted_value":"QIv=","visibility":"selected","selected_repository_ids":[1296269,1269280]}`+"\n") + testBody(t, r, `{"key_id":"1234","encrypted_value":"QIv=","visibility":"selected","selected_repository_ids":["1296269","1269280"]}`+"\n") w.WriteHeader(http.StatusCreated) }) From 7a8ab98954c2fe735a4a57b344cbfa242029f1b3 Mon Sep 17 00:00:00 2001 From: Emil V Date: Wed, 28 Jun 2023 23:13:03 +0200 Subject: [PATCH 256/751] Add Repository struct to SecretScanningAlert (#2823) --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 7 +++++++ github/secret_scanning.go | 23 ++++++++++++----------- github/secret_scanning_test.go | 12 +++++++++++- 4 files changed, 38 insertions(+), 12 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 01b5796fecd..41cd582c1a1 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -19510,6 +19510,14 @@ func (s *SecretScanningAlert) GetNumber() int { return *s.Number } +// GetRepository returns the Repository field. +func (s *SecretScanningAlert) GetRepository() *Repository { + if s == nil { + return nil + } + return s.Repository +} + // GetResolution returns the Resolution field if it's non-nil, zero value otherwise. func (s *SecretScanningAlert) GetResolution() string { if s == nil || s.Resolution == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 959edc4deb1..993a12484b9 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -22792,6 +22792,13 @@ func TestSecretScanningAlert_GetNumber(tt *testing.T) { s.GetNumber() } +func TestSecretScanningAlert_GetRepository(tt *testing.T) { + s := &SecretScanningAlert{} + s.GetRepository() + s = nil + s.GetRepository() +} + func TestSecretScanningAlert_GetResolution(tt *testing.T) { var zeroValue string s := &SecretScanningAlert{Resolution: &zeroValue} diff --git a/github/secret_scanning.go b/github/secret_scanning.go index d512560d9fe..36ad555377e 100644 --- a/github/secret_scanning.go +++ b/github/secret_scanning.go @@ -16,17 +16,18 @@ type SecretScanningService service // SecretScanningAlert represents a GitHub secret scanning alert. type SecretScanningAlert struct { - Number *int `json:"number,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - URL *string `json:"url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - LocationsURL *string `json:"locations_url,omitempty"` - State *string `json:"state,omitempty"` - Resolution *string `json:"resolution,omitempty"` - ResolvedAt *Timestamp `json:"resolved_at,omitempty"` - ResolvedBy *User `json:"resolved_by,omitempty"` - SecretType *string `json:"secret_type,omitempty"` - Secret *string `json:"secret,omitempty"` + Number *int `json:"number,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + LocationsURL *string `json:"locations_url,omitempty"` + State *string `json:"state,omitempty"` + Resolution *string `json:"resolution,omitempty"` + ResolvedAt *Timestamp `json:"resolved_at,omitempty"` + ResolvedBy *User `json:"resolved_by,omitempty"` + SecretType *string `json:"secret_type,omitempty"` + Secret *string `json:"secret,omitempty"` + Repository *Repository `json:"repository,omitempty"` } // SecretScanningAlertLocation represents the location for a secret scanning alert. diff --git a/github/secret_scanning_test.go b/github/secret_scanning_test.go index 69cd7d3fefe..75275913385 100644 --- a/github/secret_scanning_test.go +++ b/github/secret_scanning_test.go @@ -35,7 +35,12 @@ func TestSecretScanningService_ListAlertsForEnterprise(t *testing.T) { "resolved_at": null, "resolved_by": null, "secret_type": "mailchimp_api_key", - "secret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2" + "secret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2", + "repository": { + "id": 1, + "name": "n", + "url": "url" + } }]`) }) @@ -61,6 +66,11 @@ func TestSecretScanningService_ListAlertsForEnterprise(t *testing.T) { ResolvedBy: nil, SecretType: String("mailchimp_api_key"), Secret: String("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2"), + Repository: &Repository{ + ID: Int64(1), + URL: String("url"), + Name: String("n"), + }, }, } From 9f7124cc0903ad531ba469d2f1403fb3e39645cf Mon Sep 17 00:00:00 2001 From: nxya Date: Mon, 3 Jul 2023 09:25:52 -0400 Subject: [PATCH 257/751] Fix ListPullRequestsWithCommit option type (#2822) Fixes: #2815. --- github/pulls.go | 2 +- github/pulls_test.go | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/github/pulls.go b/github/pulls.go index 6e49eba2f91..533e86b5f0a 100644 --- a/github/pulls.go +++ b/github/pulls.go @@ -170,7 +170,7 @@ func (s *PullRequestsService) List(ctx context.Context, owner string, repo strin // By default, the PullRequestListOptions State filters for "open". // // GitHub API docs: https://docs.github.com/en/rest/commits/commits#list-pull-requests-associated-with-a-commit -func (s *PullRequestsService) ListPullRequestsWithCommit(ctx context.Context, owner, repo, sha string, opts *PullRequestListOptions) ([]*PullRequest, *Response, error) { +func (s *PullRequestsService) ListPullRequestsWithCommit(ctx context.Context, owner, repo, sha string, opts *ListOptions) ([]*PullRequest, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/pulls", owner, repo, sha) u, err := addOptions(u, opts) if err != nil { diff --git a/github/pulls_test.go b/github/pulls_test.go index 590483fadb3..87f6f41cfb8 100644 --- a/github/pulls_test.go +++ b/github/pulls_test.go @@ -69,17 +69,12 @@ func TestPullRequestsService_ListPullRequestsWithCommit(t *testing.T) { testMethod(t, r, "GET") testHeader(t, r, "Accept", mediaTypeListPullsOrBranchesForCommitPreview) testFormValues(t, r, values{ - "state": "closed", - "head": "h", - "base": "b", - "sort": "created", - "direction": "desc", - "page": "2", + "page": "2", }) fmt.Fprint(w, `[{"number":1}]`) }) - opts := &PullRequestListOptions{"closed", "h", "b", "created", "desc", ListOptions{Page: 2}} + opts := &ListOptions{Page: 2} ctx := context.Background() pulls, _, err := client.PullRequests.ListPullRequestsWithCommit(ctx, "o", "r", "sha", opts) if err != nil { From cd438623e5e65bad6f444d55956d5959cf98b58a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Penteado?= <4219131+joaopenteado@users.noreply.github.com> Date: Mon, 10 Jul 2023 12:38:18 +0900 Subject: [PATCH 258/751] Add support for personal access tokens request review API (#2827) --- github/github-accessors.go | 8 +++ github/github-accessors_test.go | 10 +++ github/orgs_personal_access_tokens.go | 34 ++++++++++ github/orgs_personal_access_tokens_test.go | 73 ++++++++++++++++++++++ 4 files changed, 125 insertions(+) create mode 100644 github/orgs_personal_access_tokens.go create mode 100644 github/orgs_personal_access_tokens_test.go diff --git a/github/github-accessors.go b/github/github-accessors.go index 41cd582c1a1..c7089951a34 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -18806,6 +18806,14 @@ func (r *ReviewersRequest) GetNodeID() string { return *r.NodeID } +// GetReason returns the Reason field if it's non-nil, zero value otherwise. +func (r *ReviewPersonalAccessTokenRequestOptions) GetReason() string { + if r == nil || r.Reason == nil { + return "" + } + return *r.Reason +} + // GetDescription returns the Description field if it's non-nil, zero value otherwise. func (r *Rule) GetDescription() string { if r == nil || r.Description == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 993a12484b9..7d151331cbb 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -21933,6 +21933,16 @@ func TestReviewersRequest_GetNodeID(tt *testing.T) { r.GetNodeID() } +func TestReviewPersonalAccessTokenRequestOptions_GetReason(tt *testing.T) { + var zeroValue string + r := &ReviewPersonalAccessTokenRequestOptions{Reason: &zeroValue} + r.GetReason() + r = &ReviewPersonalAccessTokenRequestOptions{} + r.GetReason() + r = nil + r.GetReason() +} + func TestRule_GetDescription(tt *testing.T) { var zeroValue string r := &Rule{Description: &zeroValue} diff --git a/github/orgs_personal_access_tokens.go b/github/orgs_personal_access_tokens.go new file mode 100644 index 00000000000..c30ff2843ee --- /dev/null +++ b/github/orgs_personal_access_tokens.go @@ -0,0 +1,34 @@ +// Copyright 2023 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" +) + +// ReviewPersonalAccessTokenRequestOptions specifies the parameters to the ReviewPersonalAccessTokenRequest method. +type ReviewPersonalAccessTokenRequestOptions struct { + Action string `json:"action"` + Reason *string `json:"reason,omitempty"` +} + +// ReviewPersonalAccessTokenRequest approves or denies a pending request to access organization resources via a fine-grained personal access token. +// Only GitHub Apps can call this API, using the `organization_personal_access_token_requests: write` permission. +// `action` can be one of `approve` or `deny`. +// +// GitHub API docs: https://docs.github.com/en/rest/orgs/personal-access-tokens?apiVersion=2022-11-28#review-a-request-to-access-organization-resources-with-a-fine-grained-personal-access-token +func (s *OrganizationsService) ReviewPersonalAccessTokenRequest(ctx context.Context, org string, requestID int64, opts ReviewPersonalAccessTokenRequestOptions) (*Response, error) { + u := fmt.Sprintf("orgs/%v/personal-access-token-requests/%v", org, requestID) + + req, err := s.client.NewRequest(http.MethodPost, u, &opts) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} diff --git a/github/orgs_personal_access_tokens_test.go b/github/orgs_personal_access_tokens_test.go new file mode 100644 index 00000000000..93ee1b3db93 --- /dev/null +++ b/github/orgs_personal_access_tokens_test.go @@ -0,0 +1,73 @@ +// Copyright 2023 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" + "net/http" + "testing" + + "github.com/google/go-cmp/cmp" +) + +func TestOrganizationsService_ReviewPersonalAccessTokenRequest(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + input := ReviewPersonalAccessTokenRequestOptions{ + Action: "a", + Reason: String("r"), + } + + mux.HandleFunc("/orgs/o/personal-access-token-requests/1", func(w http.ResponseWriter, r *http.Request) { + v := new(ReviewPersonalAccessTokenRequestOptions) + json.NewDecoder(r.Body).Decode(v) + + testMethod(t, r, http.MethodPost) + if !cmp.Equal(v, &input) { + t.Errorf("Request body = %+v, want %+v", v, input) + } + + w.WriteHeader(http.StatusNoContent) + }) + + ctx := context.Background() + res, err := client.Organizations.ReviewPersonalAccessTokenRequest(ctx, "o", 1, input) + if err != nil { + t.Errorf("Organizations.ReviewPersonalAccessTokenRequest returned error: %v", err) + } + + if res.StatusCode != http.StatusNoContent { + t.Errorf("Organizations.ReviewPersonalAccessTokenRequest returned %v, want %v", res.StatusCode, http.StatusNoContent) + } + + const methodName = "ReviewPersonalAccessTokenRequest" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Organizations.ReviewPersonalAccessTokenRequest(ctx, "\n", 0, input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Organizations.ReviewPersonalAccessTokenRequest(ctx, "o", 1, input) + }) +} + +func TestReviewPersonalAccessTokenRequestOptions_Marshal(t *testing.T) { + testJSONMarshal(t, &ReviewPersonalAccessTokenRequestOptions{}, "{}") + + u := &ReviewPersonalAccessTokenRequestOptions{ + Action: "a", + Reason: String("r"), + } + + want := `{ + "action": "a", + "reason": "r" + }` + + testJSONMarshal(t, u, want) +} From 43ffb6abe3135d3a167d2f79ad2830638c7f5752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Penteado?= <4219131+joaopenteado@users.noreply.github.com> Date: Sat, 15 Jul 2023 21:03:32 +0900 Subject: [PATCH 259/751] Add support for `personal_access_token_request` webhook event type (#2826) --- github/event.go | 2 + github/event_types.go | 68 +++++++++++++ github/event_types_test.go | 74 ++++++++++++++ github/github-accessors.go | 152 +++++++++++++++++++++++++++++ github/github-accessors_test.go | 166 ++++++++++++++++++++++++++++++++ github/messages.go | 1 + github/messages_test.go | 4 + 7 files changed, 467 insertions(+) diff --git a/github/event.go b/github/event.go index 4ee25603a83..4ee60e339cf 100644 --- a/github/event.go +++ b/github/event.go @@ -93,6 +93,8 @@ func (e *Event) ParsePayload() (payload interface{}, err error) { payload = &PackageEvent{} case "PageBuildEvent": payload = &PageBuildEvent{} + case "PersonalAccessTokenRequestEvent": + payload = &PersonalAccessTokenRequestEvent{} case "PingEvent": payload = &PingEvent{} case "ProjectEvent": diff --git a/github/event_types.go b/github/event_types.go index 6a13b286bd2..fca897af93e 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -774,6 +774,74 @@ type PageBuildEvent struct { Installation *Installation `json:"installation,omitempty"` } +// PersonalAccessTokenRequestEvent occurs when there is activity relating to a +// request for a fine-grained personal access token to access resources that +// belong to a resource owner that requires approval for token access. +// The webhook event name is "personal_access_token_request". +// +// GitHub API docs: https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#personal_access_token_request +type PersonalAccessTokenRequestEvent struct { + // Action is the action that was performed. Possible values are: + // "approved", "cancelled", "created" or "denied" + Action *string `json:"action,omitempty"` + PersonalAccessTokenRequest *PersonalAccessTokenRequest `json:"personal_access_token_request,omitempty"` + Org *Organization `json:"organization,omitempty"` + Sender *User `json:"sender,omitempty"` + Installation *Installation `json:"installation,omitempty"` +} + +// PersonalAccessTokenRequest contains the details of a PersonalAccessTokenRequestEvent. +type PersonalAccessTokenRequest struct { + // Unique identifier of the request for access via fine-grained personal + // access token. Used as the pat_request_id parameter in the list and review + // API calls. + ID *int64 `json:"id,omitempty"` + Owner *User `json:"owner,omitempty"` + + // New requested permissions, categorized by type of permission. + PermissionsAdded *PersonalAccessTokenPermissions `json:"permissions_added,omitempty"` + + // Requested permissions that elevate access for a previously approved + // request for access, categorized by type of permission. + PermissionsUpgraded *PersonalAccessTokenPermissions `json:"permissions_upgraded,omitempty"` + + // Permissions requested, categorized by type of permission. + // This field incorporates permissions_added and permissions_upgraded. + PermissionsResult *PersonalAccessTokenPermissions `json:"permissions_result,omitempty"` + + // Type of repository selection requested. Possible values are: + // "none", "all" or "subset" + RepositorySelection *string `json:"repository_selection,omitempty"` + + // The number of repositories the token is requesting access to. + // This field is only populated when repository_selection is subset. + RepositoryCount *int64 `json:"repository_count,omitempty"` + + // An array of repository objects the token is requesting access to. + // This field is only populated when repository_selection is subset. + Repositories []*Repository `json:"repositories,omitempty"` + + // Date and time when the request for access was created. + CreatedAt *Timestamp `json:"created_at,omitempty"` + + // Whether the associated fine-grained personal access token has expired. + TokenExpired *bool `json:"token_expired,omitempty"` + + // Date and time when the associated fine-grained personal access token expires. + TokenExpiresAt *Timestamp `json:"token_expires_at,omitempty"` + + // Date and time when the associated fine-grained personal access token was last used for authentication. + TokenLastUsedAt *Timestamp `json:"token_last_used_at,omitempty"` +} + +// PersonalAccessTokenPermissions represents the original or newly requested +// scope of permissions for a fine-grained personal access token within a PersonalAccessTokenRequest. +type PersonalAccessTokenPermissions struct { + Org map[string]string `json:"organization,omitempty"` + Repo map[string]string `json:"repository,omitempty"` + Other map[string]string `json:"other,omitempty"` +} + // PingEvent is triggered when a Webhook is added to GitHub. // // GitHub API docs: https://developer.github.com/webhooks/#ping-event diff --git a/github/event_types_test.go b/github/event_types_test.go index db284036e3f..298477fe14d 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -7089,6 +7089,80 @@ func TestPackageEvent_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } +func TestPersonalAccessTokenRequestEvent_Marshal(t *testing.T) { + testJSONMarshal(t, &PersonalAccessTokenRequestEvent{}, "{}") + + event := &PersonalAccessTokenRequestEvent{ + Action: String("a"), + PersonalAccessTokenRequest: &PersonalAccessTokenRequest{ + ID: Int64(1), + Owner: &User{Login: String("l")}, + PermissionsAdded: &PersonalAccessTokenPermissions{ + Org: map[string]string{"organization_events": "read"}, + Repo: map[string]string{"security_events": "write"}, + }, + CreatedAt: &Timestamp{referenceTime}, + TokenExpired: Bool(false), + TokenExpiresAt: &Timestamp{referenceTime}, + TokenLastUsedAt: &Timestamp{referenceTime}, + RepositoryCount: Int64(1), + RepositorySelection: String("rs"), + Repositories: []*Repository{ + { + Name: String("n"), + }, + }, + }, + Org: &Organization{Name: String("n")}, + Sender: &User{ + Login: String("l"), + }, + Installation: &Installation{ + ID: Int64(1), + }, + } + + want := `{ + "action": "a", + "personal_access_token_request": { + "id": 1, + "owner": { + "login": "l" + }, + "permissions_added": { + "organization": { + "organization_events": "read" + }, + "repository": { + "security_events": "write" + } + }, + "created_at": ` + referenceTimeStr + `, + "token_expired": false, + "token_expires_at": ` + referenceTimeStr + `, + "token_last_used_at": ` + referenceTimeStr + `, + "repository_count": 1, + "repository_selection": "rs", + "repositories": [ + { + "name": "n" + } + ] + }, + "organization": { + "name": "n" + }, + "sender": { + "login": "l" + }, + "installation": { + "id": 1 + } + }` + + testJSONMarshal(t, event, want) +} + func TestPingEvent_Marshal(t *testing.T) { testJSONMarshal(t, &PingEvent{}, "{}") diff --git a/github/github-accessors.go b/github/github-accessors.go index c7089951a34..19d7bd47117 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -13134,6 +13134,158 @@ func (p *PagesUpdate) GetSource() *PagesSource { return p.Source } +// GetOrg returns the Org map if it's non-nil, an empty map otherwise. +func (p *PersonalAccessTokenPermissions) GetOrg() map[string]string { + if p == nil || p.Org == nil { + return map[string]string{} + } + return p.Org +} + +// GetOther returns the Other map if it's non-nil, an empty map otherwise. +func (p *PersonalAccessTokenPermissions) GetOther() map[string]string { + if p == nil || p.Other == nil { + return map[string]string{} + } + return p.Other +} + +// GetRepo returns the Repo map if it's non-nil, an empty map otherwise. +func (p *PersonalAccessTokenPermissions) GetRepo() map[string]string { + if p == nil || p.Repo == nil { + return map[string]string{} + } + return p.Repo +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (p *PersonalAccessTokenRequest) GetCreatedAt() Timestamp { + if p == nil || p.CreatedAt == nil { + return Timestamp{} + } + return *p.CreatedAt +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (p *PersonalAccessTokenRequest) GetID() int64 { + if p == nil || p.ID == nil { + return 0 + } + return *p.ID +} + +// GetOwner returns the Owner field. +func (p *PersonalAccessTokenRequest) GetOwner() *User { + if p == nil { + return nil + } + return p.Owner +} + +// GetPermissionsAdded returns the PermissionsAdded field. +func (p *PersonalAccessTokenRequest) GetPermissionsAdded() *PersonalAccessTokenPermissions { + if p == nil { + return nil + } + return p.PermissionsAdded +} + +// GetPermissionsResult returns the PermissionsResult field. +func (p *PersonalAccessTokenRequest) GetPermissionsResult() *PersonalAccessTokenPermissions { + if p == nil { + return nil + } + return p.PermissionsResult +} + +// GetPermissionsUpgraded returns the PermissionsUpgraded field. +func (p *PersonalAccessTokenRequest) GetPermissionsUpgraded() *PersonalAccessTokenPermissions { + if p == nil { + return nil + } + return p.PermissionsUpgraded +} + +// GetRepositoryCount returns the RepositoryCount field if it's non-nil, zero value otherwise. +func (p *PersonalAccessTokenRequest) GetRepositoryCount() int64 { + if p == nil || p.RepositoryCount == nil { + return 0 + } + return *p.RepositoryCount +} + +// GetRepositorySelection returns the RepositorySelection field if it's non-nil, zero value otherwise. +func (p *PersonalAccessTokenRequest) GetRepositorySelection() string { + if p == nil || p.RepositorySelection == nil { + return "" + } + return *p.RepositorySelection +} + +// GetTokenExpired returns the TokenExpired field if it's non-nil, zero value otherwise. +func (p *PersonalAccessTokenRequest) GetTokenExpired() bool { + if p == nil || p.TokenExpired == nil { + return false + } + return *p.TokenExpired +} + +// GetTokenExpiresAt returns the TokenExpiresAt field if it's non-nil, zero value otherwise. +func (p *PersonalAccessTokenRequest) GetTokenExpiresAt() Timestamp { + if p == nil || p.TokenExpiresAt == nil { + return Timestamp{} + } + return *p.TokenExpiresAt +} + +// GetTokenLastUsedAt returns the TokenLastUsedAt field if it's non-nil, zero value otherwise. +func (p *PersonalAccessTokenRequest) GetTokenLastUsedAt() Timestamp { + if p == nil || p.TokenLastUsedAt == nil { + return Timestamp{} + } + return *p.TokenLastUsedAt +} + +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (p *PersonalAccessTokenRequestEvent) GetAction() string { + if p == nil || p.Action == nil { + return "" + } + return *p.Action +} + +// GetInstallation returns the Installation field. +func (p *PersonalAccessTokenRequestEvent) GetInstallation() *Installation { + if p == nil { + return nil + } + return p.Installation +} + +// GetOrg returns the Org field. +func (p *PersonalAccessTokenRequestEvent) GetOrg() *Organization { + if p == nil { + return nil + } + return p.Org +} + +// GetPersonalAccessTokenRequest returns the PersonalAccessTokenRequest field. +func (p *PersonalAccessTokenRequestEvent) GetPersonalAccessTokenRequest() *PersonalAccessTokenRequest { + if p == nil { + return nil + } + return p.PersonalAccessTokenRequest +} + +// GetSender returns the Sender field. +func (p *PersonalAccessTokenRequestEvent) GetSender() *User { + if p == nil { + return nil + } + return p.Sender +} + // GetHook returns the Hook field. func (p *PingEvent) GetHook() *Hook { if p == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 7d151331cbb..5cdf5ff592c 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -15422,6 +15422,172 @@ func TestPagesUpdate_GetSource(tt *testing.T) { p.GetSource() } +func TestPersonalAccessTokenPermissions_GetOrg(tt *testing.T) { + zeroValue := map[string]string{} + p := &PersonalAccessTokenPermissions{Org: zeroValue} + p.GetOrg() + p = &PersonalAccessTokenPermissions{} + p.GetOrg() + p = nil + p.GetOrg() +} + +func TestPersonalAccessTokenPermissions_GetOther(tt *testing.T) { + zeroValue := map[string]string{} + p := &PersonalAccessTokenPermissions{Other: zeroValue} + p.GetOther() + p = &PersonalAccessTokenPermissions{} + p.GetOther() + p = nil + p.GetOther() +} + +func TestPersonalAccessTokenPermissions_GetRepo(tt *testing.T) { + zeroValue := map[string]string{} + p := &PersonalAccessTokenPermissions{Repo: zeroValue} + p.GetRepo() + p = &PersonalAccessTokenPermissions{} + p.GetRepo() + p = nil + p.GetRepo() +} + +func TestPersonalAccessTokenRequest_GetCreatedAt(tt *testing.T) { + var zeroValue Timestamp + p := &PersonalAccessTokenRequest{CreatedAt: &zeroValue} + p.GetCreatedAt() + p = &PersonalAccessTokenRequest{} + p.GetCreatedAt() + p = nil + p.GetCreatedAt() +} + +func TestPersonalAccessTokenRequest_GetID(tt *testing.T) { + var zeroValue int64 + p := &PersonalAccessTokenRequest{ID: &zeroValue} + p.GetID() + p = &PersonalAccessTokenRequest{} + p.GetID() + p = nil + p.GetID() +} + +func TestPersonalAccessTokenRequest_GetOwner(tt *testing.T) { + p := &PersonalAccessTokenRequest{} + p.GetOwner() + p = nil + p.GetOwner() +} + +func TestPersonalAccessTokenRequest_GetPermissionsAdded(tt *testing.T) { + p := &PersonalAccessTokenRequest{} + p.GetPermissionsAdded() + p = nil + p.GetPermissionsAdded() +} + +func TestPersonalAccessTokenRequest_GetPermissionsResult(tt *testing.T) { + p := &PersonalAccessTokenRequest{} + p.GetPermissionsResult() + p = nil + p.GetPermissionsResult() +} + +func TestPersonalAccessTokenRequest_GetPermissionsUpgraded(tt *testing.T) { + p := &PersonalAccessTokenRequest{} + p.GetPermissionsUpgraded() + p = nil + p.GetPermissionsUpgraded() +} + +func TestPersonalAccessTokenRequest_GetRepositoryCount(tt *testing.T) { + var zeroValue int64 + p := &PersonalAccessTokenRequest{RepositoryCount: &zeroValue} + p.GetRepositoryCount() + p = &PersonalAccessTokenRequest{} + p.GetRepositoryCount() + p = nil + p.GetRepositoryCount() +} + +func TestPersonalAccessTokenRequest_GetRepositorySelection(tt *testing.T) { + var zeroValue string + p := &PersonalAccessTokenRequest{RepositorySelection: &zeroValue} + p.GetRepositorySelection() + p = &PersonalAccessTokenRequest{} + p.GetRepositorySelection() + p = nil + p.GetRepositorySelection() +} + +func TestPersonalAccessTokenRequest_GetTokenExpired(tt *testing.T) { + var zeroValue bool + p := &PersonalAccessTokenRequest{TokenExpired: &zeroValue} + p.GetTokenExpired() + p = &PersonalAccessTokenRequest{} + p.GetTokenExpired() + p = nil + p.GetTokenExpired() +} + +func TestPersonalAccessTokenRequest_GetTokenExpiresAt(tt *testing.T) { + var zeroValue Timestamp + p := &PersonalAccessTokenRequest{TokenExpiresAt: &zeroValue} + p.GetTokenExpiresAt() + p = &PersonalAccessTokenRequest{} + p.GetTokenExpiresAt() + p = nil + p.GetTokenExpiresAt() +} + +func TestPersonalAccessTokenRequest_GetTokenLastUsedAt(tt *testing.T) { + var zeroValue Timestamp + p := &PersonalAccessTokenRequest{TokenLastUsedAt: &zeroValue} + p.GetTokenLastUsedAt() + p = &PersonalAccessTokenRequest{} + p.GetTokenLastUsedAt() + p = nil + p.GetTokenLastUsedAt() +} + +func TestPersonalAccessTokenRequestEvent_GetAction(tt *testing.T) { + var zeroValue string + p := &PersonalAccessTokenRequestEvent{Action: &zeroValue} + p.GetAction() + p = &PersonalAccessTokenRequestEvent{} + p.GetAction() + p = nil + p.GetAction() +} + +func TestPersonalAccessTokenRequestEvent_GetInstallation(tt *testing.T) { + p := &PersonalAccessTokenRequestEvent{} + p.GetInstallation() + p = nil + p.GetInstallation() +} + +func TestPersonalAccessTokenRequestEvent_GetOrg(tt *testing.T) { + p := &PersonalAccessTokenRequestEvent{} + p.GetOrg() + p = nil + p.GetOrg() +} + +func TestPersonalAccessTokenRequestEvent_GetPersonalAccessTokenRequest(tt *testing.T) { + p := &PersonalAccessTokenRequestEvent{} + p.GetPersonalAccessTokenRequest() + p = nil + p.GetPersonalAccessTokenRequest() +} + +func TestPersonalAccessTokenRequestEvent_GetSender(tt *testing.T) { + p := &PersonalAccessTokenRequestEvent{} + p.GetSender() + p = nil + p.GetSender() +} + func TestPingEvent_GetHook(tt *testing.T) { p := &PingEvent{} p.GetHook() diff --git a/github/messages.go b/github/messages.go index bb5ae3f3895..e61ef1c07b6 100644 --- a/github/messages.go +++ b/github/messages.go @@ -76,6 +76,7 @@ var ( "org_block": "OrgBlockEvent", "package": "PackageEvent", "page_build": "PageBuildEvent", + "personal_access_token_request": "PersonalAccessTokenRequestEvent", "ping": "PingEvent", "project": "ProjectEvent", "project_card": "ProjectCardEvent", diff --git a/github/messages_test.go b/github/messages_test.go index 80fb3e5ff54..5230b87a61c 100644 --- a/github/messages_test.go +++ b/github/messages_test.go @@ -380,6 +380,10 @@ func TestParseWebHook(t *testing.T) { payload: &PageBuildEvent{}, messageType: "page_build", }, + { + payload: &PersonalAccessTokenRequestEvent{}, + messageType: "personal_access_token_request", + }, { payload: &PingEvent{}, messageType: "ping", From bedd4e33eba4068a2686b4299bfce71064500f73 Mon Sep 17 00:00:00 2001 From: Yurii Soldak Date: Sat, 15 Jul 2023 14:06:08 +0200 Subject: [PATCH 260/751] Support repository_id in org ruleset conditions (#2825) --- github/github-accessors.go | 12 +- github/github-accessors_test.go | 13 +- github/orgs_rules_test.go | 322 +++++++++++++++++++++++++++++++- github/repos_rules.go | 15 +- 4 files changed, 347 insertions(+), 15 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 19d7bd47117..009b1bebef2 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -19102,8 +19102,16 @@ func (r *RulesetConditions) GetRefName() *RulesetRefConditionParameters { return r.RefName } +// GetRepositoryID returns the RepositoryID field. +func (r *RulesetConditions) GetRepositoryID() *RulesetRepositoryIDsConditionParameters { + if r == nil { + return nil + } + return r.RepositoryID +} + // GetRepositoryName returns the RepositoryName field. -func (r *RulesetConditions) GetRepositoryName() *RulesetRepositoryConditionParameters { +func (r *RulesetConditions) GetRepositoryName() *RulesetRepositoryNamesConditionParameters { if r == nil { return nil } @@ -19127,7 +19135,7 @@ func (r *RulesetLinks) GetSelf() *RulesetLink { } // GetProtected returns the Protected field if it's non-nil, zero value otherwise. -func (r *RulesetRepositoryConditionParameters) GetProtected() bool { +func (r *RulesetRepositoryNamesConditionParameters) GetProtected() bool { if r == nil || r.Protected == nil { return false } diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 5cdf5ff592c..4671670ce0a 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -22270,6 +22270,13 @@ func TestRulesetConditions_GetRefName(tt *testing.T) { r.GetRefName() } +func TestRulesetConditions_GetRepositoryID(tt *testing.T) { + r := &RulesetConditions{} + r.GetRepositoryID() + r = nil + r.GetRepositoryID() +} + func TestRulesetConditions_GetRepositoryName(tt *testing.T) { r := &RulesetConditions{} r.GetRepositoryName() @@ -22294,11 +22301,11 @@ func TestRulesetLinks_GetSelf(tt *testing.T) { r.GetSelf() } -func TestRulesetRepositoryConditionParameters_GetProtected(tt *testing.T) { +func TestRulesetRepositoryNamesConditionParameters_GetProtected(tt *testing.T) { var zeroValue bool - r := &RulesetRepositoryConditionParameters{Protected: &zeroValue} + r := &RulesetRepositoryNamesConditionParameters{Protected: &zeroValue} r.GetProtected() - r = &RulesetRepositoryConditionParameters{} + r = &RulesetRepositoryNamesConditionParameters{} r.GetProtected() r = nil r.GetProtected() diff --git a/github/orgs_rules_test.go b/github/orgs_rules_test.go index 7719e142fb5..48c6c5e2bd1 100644 --- a/github/orgs_rules_test.go +++ b/github/orgs_rules_test.go @@ -71,7 +71,7 @@ func TestOrganizationsService_GetAllOrganizationRulesets(t *testing.T) { }) } -func TestOrganizationsService_CreateOrganizationRuleset(t *testing.T) { +func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) { client, mux, _, teardown := setup() defer teardown() @@ -227,7 +227,7 @@ func TestOrganizationsService_CreateOrganizationRuleset(t *testing.T) { Include: []string{"refs/heads/main", "refs/heads/master"}, Exclude: []string{"refs/heads/dev*"}, }, - RepositoryName: &RulesetRepositoryConditionParameters{ + RepositoryName: &RulesetRepositoryNamesConditionParameters{ Include: []string{"important_repository", "another_important_repository"}, Exclude: []string{"unimportant_repository"}, Protected: Bool(true), @@ -313,7 +313,7 @@ func TestOrganizationsService_CreateOrganizationRuleset(t *testing.T) { Include: []string{"refs/heads/main", "refs/heads/master"}, Exclude: []string{"refs/heads/dev*"}, }, - RepositoryName: &RulesetRepositoryConditionParameters{ + RepositoryName: &RulesetRepositoryNamesConditionParameters{ Include: []string{"important_repository", "another_important_repository"}, Exclude: []string{"unimportant_repository"}, Protected: Bool(true), @@ -392,6 +392,316 @@ func TestOrganizationsService_CreateOrganizationRuleset(t *testing.T) { }) } +func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/rulesets", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + fmt.Fprint(w, `{ + "id": 21, + "name": "ruleset", + "target": "branch", + "source_type": "Organization", + "source": "o", + "enforcement": "active", + "bypass_actors": [ + { + "actor_id": 234, + "actor_type": "Team" + } + ], + "conditions": { + "ref_name": { + "include": [ + "refs/heads/main", + "refs/heads/master" + ], + "exclude": [ + "refs/heads/dev*" + ] + }, + "repository_id": { + "repository_ids": [ 123, 456 ] + } + }, + "rules": [ + { + "type": "creation" + }, + { + "type": "update", + "parameters": { + "update_allows_fetch_and_merge": true + } + }, + { + "type": "deletion" + }, + { + "type": "required_linear_history" + }, + { + "type": "required_deployments", + "parameters": { + "required_deployment_environments": ["test"] + } + }, + { + "type": "required_signatures" + }, + { + "type": "pull_request", + "parameters": { + "dismiss_stale_reviews_on_push": true, + "require_code_owner_review": true, + "require_last_push_approval": true, + "required_approving_review_count": 1, + "required_review_thread_resolution": true + } + }, + { + "type": "required_status_checks", + "parameters": { + "required_status_checks": [ + { + "context": "test", + "integration_id": 1 + } + ], + "strict_required_status_checks_policy": true + } + }, + { + "type": "non_fast_forward" + }, + { + "type": "commit_message_pattern", + "parameters": { + "name": "avoid test commits", + "negate": true, + "operator": "starts_with", + "pattern": "[test]" + } + }, + { + "type": "commit_author_email_pattern", + "parameters": { + "operator": "contains", + "pattern": "github" + } + }, + { + "type": "committer_email_pattern", + "parameters": { + "name": "avoid commit emails", + "negate": true, + "operator": "ends_with", + "pattern": "abc" + } + }, + { + "type": "branch_name_pattern", + "parameters": { + "name": "avoid branch names", + "negate": true, + "operator": "regex", + "pattern": "github$" + } + }, + { + "type": "tag_name_pattern", + "parameters": { + "name": "avoid tag names", + "negate": true, + "operator": "contains", + "pattern": "github" + } + } + ] + }`) + }) + + ctx := context.Background() + ruleset, _, err := client.Organizations.CreateOrganizationRuleset(ctx, "o", &Ruleset{ + ID: 21, + Name: "ruleset", + Target: String("branch"), + SourceType: String("Organization"), + Source: "o", + Enforcement: "active", + BypassActors: []*BypassActor{ + { + ActorID: Int64(234), + ActorType: String("Team"), + }, + }, + Conditions: &RulesetConditions{ + RefName: &RulesetRefConditionParameters{ + Include: []string{"refs/heads/main", "refs/heads/master"}, + Exclude: []string{"refs/heads/dev*"}, + }, + RepositoryID: &RulesetRepositoryIDsConditionParameters{ + RepositoryIDs: []int64{123, 456}, + }, + }, + Rules: []*RepositoryRule{ + NewCreationRule(), + NewUpdateRule(&UpdateAllowsFetchAndMergeRuleParameters{ + UpdateAllowsFetchAndMerge: true, + }), + NewDeletionRule(), + NewRequiredLinearHistoryRule(), + NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ + RequiredDeploymentEnvironments: []string{"test"}, + }), + NewRequiredSignaturesRule(), + NewPullRequestRule(&PullRequestRuleParameters{ + RequireCodeOwnerReview: true, + RequireLastPushApproval: true, + RequiredApprovingReviewCount: 1, + RequiredReviewThreadResolution: true, + DismissStaleReviewsOnPush: true, + }), + NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ + RequiredStatusChecks: []RuleRequiredStatusChecks{ + { + Context: "test", + IntegrationID: Int64(1), + }, + }, + StrictRequiredStatusChecksPolicy: true, + }), + NewNonFastForwardRule(), + NewCommitMessagePatternRule(&RulePatternParameters{ + Name: String("avoid test commits"), + Negate: Bool(true), + Operator: "starts_with", + Pattern: "[test]", + }), + NewCommitAuthorEmailPatternRule(&RulePatternParameters{ + Operator: "contains", + Pattern: "github", + }), + NewCommitterEmailPatternRule(&RulePatternParameters{ + Name: String("avoid commit emails"), + Negate: Bool(true), + Operator: "ends_with", + Pattern: "abc", + }), + NewBranchNamePatternRule(&RulePatternParameters{ + Name: String("avoid branch names"), + Negate: Bool(true), + Operator: "regex", + Pattern: "github$", + }), + NewTagNamePatternRule(&RulePatternParameters{ + Name: String("avoid tag names"), + Negate: Bool(true), + Operator: "contains", + Pattern: "github", + }), + }, + }) + if err != nil { + t.Errorf("Organizations.CreateOrganizationRuleset returned error: %v", err) + } + + want := &Ruleset{ + ID: 21, + Name: "ruleset", + Target: String("branch"), + SourceType: String("Organization"), + Source: "o", + Enforcement: "active", + BypassActors: []*BypassActor{ + { + ActorID: Int64(234), + ActorType: String("Team"), + }, + }, + Conditions: &RulesetConditions{ + RefName: &RulesetRefConditionParameters{ + Include: []string{"refs/heads/main", "refs/heads/master"}, + Exclude: []string{"refs/heads/dev*"}, + }, + RepositoryID: &RulesetRepositoryIDsConditionParameters{ + RepositoryIDs: []int64{123, 456}, + }, + }, + Rules: []*RepositoryRule{ + NewCreationRule(), + NewUpdateRule(&UpdateAllowsFetchAndMergeRuleParameters{ + UpdateAllowsFetchAndMerge: true, + }), + NewDeletionRule(), + NewRequiredLinearHistoryRule(), + NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ + RequiredDeploymentEnvironments: []string{"test"}, + }), + NewRequiredSignaturesRule(), + NewPullRequestRule(&PullRequestRuleParameters{ + RequireCodeOwnerReview: true, + RequireLastPushApproval: true, + RequiredApprovingReviewCount: 1, + RequiredReviewThreadResolution: true, + DismissStaleReviewsOnPush: true, + }), + NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ + RequiredStatusChecks: []RuleRequiredStatusChecks{ + { + Context: "test", + IntegrationID: Int64(1), + }, + }, + StrictRequiredStatusChecksPolicy: true, + }), + NewNonFastForwardRule(), + NewCommitMessagePatternRule(&RulePatternParameters{ + Name: String("avoid test commits"), + Negate: Bool(true), + Operator: "starts_with", + Pattern: "[test]", + }), + NewCommitAuthorEmailPatternRule(&RulePatternParameters{ + Operator: "contains", + Pattern: "github", + }), + NewCommitterEmailPatternRule(&RulePatternParameters{ + Name: String("avoid commit emails"), + Negate: Bool(true), + Operator: "ends_with", + Pattern: "abc", + }), + NewBranchNamePatternRule(&RulePatternParameters{ + Name: String("avoid branch names"), + Negate: Bool(true), + Operator: "regex", + Pattern: "github$", + }), + NewTagNamePatternRule(&RulePatternParameters{ + Name: String("avoid tag names"), + Negate: Bool(true), + Operator: "contains", + Pattern: "github", + }), + }, + } + if !cmp.Equal(ruleset, want) { + t.Errorf("Organizations.CreateOrganizationRuleset returned %+v, want %+v", ruleset, want) + } + + const methodName = "CreateOrganizationRuleset" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.CreateOrganizationRuleset(ctx, "o", nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + func TestOrganizationsService_GetOrganizationRuleset(t *testing.T) { client, mux, _, teardown := setup() defer teardown() @@ -464,7 +774,7 @@ func TestOrganizationsService_GetOrganizationRuleset(t *testing.T) { Include: []string{"refs/heads/main", "refs/heads/master"}, Exclude: []string{"refs/heads/dev*"}, }, - RepositoryName: &RulesetRepositoryConditionParameters{ + RepositoryName: &RulesetRepositoryNamesConditionParameters{ Include: []string{"important_repository", "another_important_repository"}, Exclude: []string{"unimportant_repository"}, Protected: Bool(true), @@ -549,7 +859,7 @@ func TestOrganizationsService_UpdateOrganizationRuleset(t *testing.T) { Include: []string{"refs/heads/main", "refs/heads/master"}, Exclude: []string{"refs/heads/dev*"}, }, - RepositoryName: &RulesetRepositoryConditionParameters{ + RepositoryName: &RulesetRepositoryNamesConditionParameters{ Include: []string{"important_repository", "another_important_repository"}, Exclude: []string{"unimportant_repository"}, Protected: Bool(true), @@ -581,7 +891,7 @@ func TestOrganizationsService_UpdateOrganizationRuleset(t *testing.T) { Include: []string{"refs/heads/main", "refs/heads/master"}, Exclude: []string{"refs/heads/dev*"}, }, - RepositoryName: &RulesetRepositoryConditionParameters{ + RepositoryName: &RulesetRepositoryNamesConditionParameters{ Include: []string{"important_repository", "another_important_repository"}, Exclude: []string{"unimportant_repository"}, Protected: Bool(true), diff --git a/github/repos_rules.go b/github/repos_rules.go index 9299d3e7f3d..ee9c82e7145 100644 --- a/github/repos_rules.go +++ b/github/repos_rules.go @@ -34,17 +34,24 @@ type RulesetRefConditionParameters struct { Exclude []string `json:"exclude"` } -// RulesetRepositoryConditionParameters represents the conditions object for repository_names. -type RulesetRepositoryConditionParameters struct { +// RulesetRepositoryNamesConditionParameters represents the conditions object for repository_names. +type RulesetRepositoryNamesConditionParameters struct { Include []string `json:"include,omitempty"` Exclude []string `json:"exclude,omitempty"` Protected *bool `json:"protected,omitempty"` } +// RulesetRepositoryIDsConditionParameters represents the conditions object for repository_ids. +type RulesetRepositoryIDsConditionParameters struct { + RepositoryIDs []int64 `json:"repository_ids,omitempty"` +} + // RulesetCondition represents the conditions object in a ruleset. +// Set either RepositoryName or RepositoryID, not both. type RulesetConditions struct { - RefName *RulesetRefConditionParameters `json:"ref_name,omitempty"` - RepositoryName *RulesetRepositoryConditionParameters `json:"repository_name,omitempty"` + RefName *RulesetRefConditionParameters `json:"ref_name,omitempty"` + RepositoryName *RulesetRepositoryNamesConditionParameters `json:"repository_name,omitempty"` + RepositoryID *RulesetRepositoryIDsConditionParameters `json:"repository_id,omitempty"` } // RulePatternParameters represents the rule pattern parameters. From 6c1dedd9664a2f1f260f1d4e3ebfa0e123ce7dd1 Mon Sep 17 00:00:00 2001 From: Osama Faqhruldin Date: Tue, 18 Jul 2023 08:01:04 -0400 Subject: [PATCH 261/751] Fix repo rules bypass settings (#2831) --- github/github-accessors.go | 24 ++++++++++++++++-------- github/github-accessors_test.go | 30 ++++++++++++++++++++---------- github/orgs_rules_test.go | 18 +++++++----------- github/repos_rules.go | 10 +++++----- github/repos_rules_test.go | 10 +++++----- 5 files changed, 53 insertions(+), 39 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 009b1bebef2..1be9493a37c 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -2238,6 +2238,14 @@ func (b *BypassActor) GetActorType() string { return *b.ActorType } +// GetBypassMode returns the BypassMode field if it's non-nil, zero value otherwise. +func (b *BypassActor) GetBypassMode() string { + if b == nil || b.BypassMode == nil { + return "" + } + return *b.BypassMode +} + // GetApp returns the App field. func (c *CheckRun) GetApp() *App { if c == nil { @@ -19046,14 +19054,6 @@ func (r *RuleRequiredStatusChecks) GetIntegrationID() int64 { return *r.IntegrationID } -// GetBypassMode returns the BypassMode field if it's non-nil, zero value otherwise. -func (r *Ruleset) GetBypassMode() string { - if r == nil || r.BypassMode == nil { - return "" - } - return *r.BypassMode -} - // GetConditions returns the Conditions field. func (r *Ruleset) GetConditions() *RulesetConditions { if r == nil { @@ -19062,6 +19062,14 @@ func (r *Ruleset) GetConditions() *RulesetConditions { return r.Conditions } +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (r *Ruleset) GetID() int64 { + if r == nil || r.ID == nil { + return 0 + } + return *r.ID +} + // GetLinks returns the Links field. func (r *Ruleset) GetLinks() *RulesetLinks { if r == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 4671670ce0a..2235cc5e131 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -2684,6 +2684,16 @@ func TestBypassActor_GetActorType(tt *testing.T) { b.GetActorType() } +func TestBypassActor_GetBypassMode(tt *testing.T) { + var zeroValue string + b := &BypassActor{BypassMode: &zeroValue} + b.GetBypassMode() + b = &BypassActor{} + b.GetBypassMode() + b = nil + b.GetBypassMode() +} + func TestCheckRun_GetApp(tt *testing.T) { c := &CheckRun{} c.GetApp() @@ -22209,16 +22219,6 @@ func TestRuleRequiredStatusChecks_GetIntegrationID(tt *testing.T) { r.GetIntegrationID() } -func TestRuleset_GetBypassMode(tt *testing.T) { - var zeroValue string - r := &Ruleset{BypassMode: &zeroValue} - r.GetBypassMode() - r = &Ruleset{} - r.GetBypassMode() - r = nil - r.GetBypassMode() -} - func TestRuleset_GetConditions(tt *testing.T) { r := &Ruleset{} r.GetConditions() @@ -22226,6 +22226,16 @@ func TestRuleset_GetConditions(tt *testing.T) { r.GetConditions() } +func TestRuleset_GetID(tt *testing.T) { + var zeroValue int64 + r := &Ruleset{ID: &zeroValue} + r.GetID() + r = &Ruleset{} + r.GetID() + r = nil + r.GetID() +} + func TestRuleset_GetLinks(tt *testing.T) { r := &Ruleset{} r.GetLinks() diff --git a/github/orgs_rules_test.go b/github/orgs_rules_test.go index 48c6c5e2bd1..50ba4e20c01 100644 --- a/github/orgs_rules_test.go +++ b/github/orgs_rules_test.go @@ -44,13 +44,12 @@ func TestOrganizationsService_GetAllOrganizationRulesets(t *testing.T) { } want := []*Ruleset{{ - ID: 26110, + ID: Int64(26110), Name: "test ruleset", Target: String("branch"), SourceType: String("Organization"), Source: "o", Enforcement: "active", - BypassMode: String("none"), NodeID: String("nid"), Links: &RulesetLinks{ Self: &RulesetLink{HRef: String("https://api.github.com/orgs/o/rulesets/26110")}, @@ -210,7 +209,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) ctx := context.Background() ruleset, _, err := client.Organizations.CreateOrganizationRuleset(ctx, "o", &Ruleset{ - ID: 21, + ID: Int64(21), Name: "ruleset", Target: String("branch"), SourceType: String("Organization"), @@ -296,7 +295,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) } want := &Ruleset{ - ID: 21, + ID: Int64(21), Name: "ruleset", Target: String("branch"), SourceType: String("Organization"), @@ -524,7 +523,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { ctx := context.Background() ruleset, _, err := client.Organizations.CreateOrganizationRuleset(ctx, "o", &Ruleset{ - ID: 21, + ID: Int64(21), Name: "ruleset", Target: String("branch"), SourceType: String("Organization"), @@ -608,7 +607,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { } want := &Ruleset{ - ID: 21, + ID: Int64(21), Name: "ruleset", Target: String("branch"), SourceType: String("Organization"), @@ -758,13 +757,12 @@ func TestOrganizationsService_GetOrganizationRuleset(t *testing.T) { } want := &Ruleset{ - ID: 26110, + ID: Int64(26110), Name: "test ruleset", Target: String("branch"), SourceType: String("Organization"), Source: "o", Enforcement: "active", - BypassMode: String("none"), NodeID: String("nid"), Links: &RulesetLinks{ Self: &RulesetLink{HRef: String("https://api.github.com/orgs/o/rulesets/26110")}, @@ -853,7 +851,6 @@ func TestOrganizationsService_UpdateOrganizationRuleset(t *testing.T) { Name: "test ruleset", Target: String("branch"), Enforcement: "active", - BypassMode: String("none"), Conditions: &RulesetConditions{ RefName: &RulesetRefConditionParameters{ Include: []string{"refs/heads/main", "refs/heads/master"}, @@ -875,13 +872,12 @@ func TestOrganizationsService_UpdateOrganizationRuleset(t *testing.T) { } want := &Ruleset{ - ID: 26110, + ID: Int64(26110), Name: "test ruleset", Target: String("branch"), SourceType: String("Organization"), Source: "o", Enforcement: "active", - BypassMode: String("none"), NodeID: String("nid"), Links: &RulesetLinks{ Self: &RulesetLink{HRef: String("https://api.github.com/orgs/o/rulesets/26110")}, diff --git a/github/repos_rules.go b/github/repos_rules.go index ee9c82e7145..4e6f5f13474 100644 --- a/github/repos_rules.go +++ b/github/repos_rules.go @@ -14,8 +14,10 @@ import ( // BypassActor represents the bypass actors from a ruleset. type BypassActor struct { ActorID *int64 `json:"actor_id,omitempty"` - // Possible values for ActorType are: Team, Integration + // Possible values for ActorType are: RepositoryRole, Team, Integration, OrganizationAdmin ActorType *string `json:"actor_type,omitempty"` + // Possible values for BypassMode are: always, pull_request + BypassMode *string `json:"bypass_mode,omitempty"` } // RulesetLink represents a single link object from GitHub ruleset request _links. @@ -319,7 +321,7 @@ func NewTagNamePatternRule(params *RulePatternParameters) (rule *RepositoryRule) // Ruleset represents a GitHub ruleset object. type Ruleset struct { - ID int64 `json:"id"` + ID *int64 `json:"id,omitempty"` Name string `json:"name"` // Possible values for Target are branch, tag Target *string `json:"target,omitempty"` @@ -327,9 +329,7 @@ type Ruleset struct { SourceType *string `json:"source_type,omitempty"` Source string `json:"source"` // Possible values for Enforcement are: disabled, active, evaluate - Enforcement string `json:"enforcement"` - // Possible values for BypassMode are: none, repository, organization - BypassMode *string `json:"bypass_mode,omitempty"` + Enforcement string `json:"enforcement"` BypassActors []*BypassActor `json:"bypass_actors,omitempty"` NodeID *string `json:"node_id,omitempty"` Links *RulesetLinks `json:"_links,omitempty"` diff --git a/github/repos_rules_test.go b/github/repos_rules_test.go index 42c7a6e2ec2..582ec89245b 100644 --- a/github/repos_rules_test.go +++ b/github/repos_rules_test.go @@ -324,14 +324,14 @@ func TestRepositoriesService_GetAllRulesets(t *testing.T) { want := []*Ruleset{ { - ID: 42, + ID: Int64(42), Name: "ruleset", SourceType: String("Repository"), Source: "o/repo", Enforcement: "enabled", }, { - ID: 314, + ID: Int64(314), Name: "Another ruleset", SourceType: String("Repository"), Source: "o/repo", @@ -378,7 +378,7 @@ func TestRepositoriesService_CreateRuleset(t *testing.T) { } want := &Ruleset{ - ID: 42, + ID: Int64(42), Name: "ruleset", SourceType: String("Repository"), Source: "o/repo", @@ -421,7 +421,7 @@ func TestRepositoriesService_GetRuleset(t *testing.T) { } want := &Ruleset{ - ID: 42, + ID: Int64(42), Name: "ruleset", SourceType: String("Organization"), Source: "o", @@ -467,7 +467,7 @@ func TestRepositoriesService_UpdateRuleset(t *testing.T) { } want := &Ruleset{ - ID: 42, + ID: Int64(42), Name: "ruleset", SourceType: String("Repository"), Source: "o/repo", From d783bb1b52fc3c54ace4b3afcb5fd7eedf44d3c4 Mon Sep 17 00:00:00 2001 From: Karthik Sundari Date: Tue, 18 Jul 2023 23:00:06 +0530 Subject: [PATCH 262/751] Support line comments on PRs (#2833) Fixes: #2832 . --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ github/github-stringify_test.go | 3 ++- github/pulls_comments.go | 2 ++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 1be9493a37c..43bb7d0c687 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -15150,6 +15150,14 @@ func (p *PullRequestComment) GetStartSide() string { return *p.StartSide } +// GetSubjectType returns the SubjectType field if it's non-nil, zero value otherwise. +func (p *PullRequestComment) GetSubjectType() string { + if p == nil || p.SubjectType == nil { + return "" + } + return *p.SubjectType +} + // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. func (p *PullRequestComment) GetUpdatedAt() Timestamp { if p == nil || p.UpdatedAt == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 2235cc5e131..09c402ed73e 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -17669,6 +17669,16 @@ func TestPullRequestComment_GetStartSide(tt *testing.T) { p.GetStartSide() } +func TestPullRequestComment_GetSubjectType(tt *testing.T) { + var zeroValue string + p := &PullRequestComment{SubjectType: &zeroValue} + p.GetSubjectType() + p = &PullRequestComment{} + p.GetSubjectType() + p = nil + p.GetSubjectType() +} + func TestPullRequestComment_GetUpdatedAt(tt *testing.T) { var zeroValue Timestamp p := &PullRequestComment{UpdatedAt: &zeroValue} diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index 8a78fb02429..0ad7eefa342 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -1312,8 +1312,9 @@ func TestPullRequestComment_String(t *testing.T) { URL: String(""), HTMLURL: String(""), PullRequestURL: String(""), + SubjectType: String(""), } - want := `github.PullRequestComment{ID:0, NodeID:"", InReplyTo:0, Body:"", Path:"", DiffHunk:"", PullRequestReviewID:0, Position:0, OriginalPosition:0, StartLine:0, Line:0, OriginalLine:0, OriginalStartLine:0, Side:"", StartSide:"", CommitID:"", OriginalCommitID:"", User:github.User{}, Reactions:github.Reactions{}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, AuthorAssociation:"", URL:"", HTMLURL:"", PullRequestURL:""}` + want := `github.PullRequestComment{ID:0, NodeID:"", InReplyTo:0, Body:"", Path:"", DiffHunk:"", PullRequestReviewID:0, Position:0, OriginalPosition:0, StartLine:0, Line:0, OriginalLine:0, OriginalStartLine:0, Side:"", StartSide:"", CommitID:"", OriginalCommitID:"", User:github.User{}, Reactions:github.Reactions{}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, AuthorAssociation:"", URL:"", HTMLURL:"", PullRequestURL:"", SubjectType:""}` if got := v.String(); got != want { t.Errorf("PullRequestComment.String = %v, want %v", got, want) } diff --git a/github/pulls_comments.go b/github/pulls_comments.go index 1f6b726d85f..ea1cf45d1e8 100644 --- a/github/pulls_comments.go +++ b/github/pulls_comments.go @@ -41,6 +41,8 @@ type PullRequestComment struct { URL *string `json:"url,omitempty"` HTMLURL *string `json:"html_url,omitempty"` PullRequestURL *string `json:"pull_request_url,omitempty"` + // Can be one of: LINE, FILE from https://docs.github.com/en/rest/pulls/comments?apiVersion=2022-11-28#create-a-review-comment-for-a-pull-request + SubjectType *string `json:"subject_type,omitempty"` } func (p PullRequestComment) String() string { From 461d3876720168970777700eb8d27e58a0b85a1e Mon Sep 17 00:00:00 2001 From: nxya Date: Wed, 19 Jul 2023 08:57:34 -0400 Subject: [PATCH 263/751] Implement installation_target webhook event type (#2829) --- github/event.go | 2 + github/event_types.go | 32 +++ github/event_types_test.go | 336 ++++++++++++++++++++++++++++++++ github/github-accessors.go | 104 ++++++++++ github/github-accessors_test.go | 103 ++++++++++ github/messages.go | 1 + github/messages_test.go | 4 + 7 files changed, 582 insertions(+) diff --git a/github/event.go b/github/event.go index 4ee60e339cf..2349cb77600 100644 --- a/github/event.go +++ b/github/event.go @@ -67,6 +67,8 @@ func (e *Event) ParsePayload() (payload interface{}, err error) { payload = &InstallationEvent{} case "InstallationRepositoriesEvent": payload = &InstallationRepositoriesEvent{} + case "InstallationTargetEvent": + payload = &InstallationTargetEvent{} case "IssueCommentEvent": payload = &IssueCommentEvent{} case "IssuesEvent": diff --git a/github/event_types.go b/github/event_types.go index fca897af93e..a24134479c0 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -505,6 +505,38 @@ type InstallationRepositoriesEvent struct { Installation *Installation `json:"installation,omitempty"` } +// InstallationLoginChange represents a change in login on an installation. +type InstallationLoginChange struct { + From *string `json:"from,omitempty"` +} + +// InstallationSlugChange represents a change in slug on an installation. +type InstallationSlugChange struct { + From *string `json:"from,omitempty"` +} + +// InstallationChanges represents a change in slug or login on an installation. +type InstallationChanges struct { + Login *InstallationLoginChange `json:"login,omitempty"` + Slug *InstallationSlugChange `json:"slug,omitempty"` +} + +// InstallationTargetEvent is triggered when there is activity on an installation from a user or organization account. +// The Webhook event name is "installation_target". +// +// GitHub API docs: https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#installation_target +type InstallationTargetEvent struct { + Account *User `json:"account,omitempty"` + Action *string `json:"action,omitempty"` + Changes *InstallationChanges `json:"changes,omitempty"` + Enterprise *Enterprise `json:"enterprise,omitempty"` + Installation *Installation `json:"installation,omitempty"` + Organization *Organization `json:"organization,omitempty"` + Repository *Repository `json:"repository,omitempty"` + Sender *User `json:"sender,omitempty"` + TargetType *string `json:"target_type,omitempty"` +} + // IssueCommentEvent is triggered when an issue comment is created on an issue // or pull request. // The Webhook event name is "issue_comment". diff --git a/github/event_types_test.go b/github/event_types_test.go index 298477fe14d..8d6a8b95b16 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -1332,6 +1332,342 @@ func TestInstallationRepositoriesEvent_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } +func TestInstallationTargetEvent_Marshal(t *testing.T) { + testJSONMarshal(t, &InstallationTargetEvent{}, "{}") + + u := &InstallationTargetEvent{ + Account: &User{ + Login: String("u"), + ID: Int64(1), + NodeID: String("n"), + URL: String("u"), + ReposURL: String("r"), + EventsURL: String("e"), + AvatarURL: String("l"), + }, + Action: String("a"), + Changes: &InstallationChanges{ + Login: &InstallationLoginChange{ + From: String("p"), + }, + Slug: &InstallationSlugChange{ + From: String("j"), + }, + }, + Enterprise: &Enterprise{ + ID: Int(1), + Slug: String("s"), + Name: String("n"), + NodeID: String("nid"), + AvatarURL: String("au"), + Description: String("d"), + WebsiteURL: String("wu"), + HTMLURL: String("hu"), + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + }, + Installation: &Installation{ + ID: Int64(1), + NodeID: String("nid"), + AppID: Int64(1), + AppSlug: String("as"), + TargetID: Int64(1), + Account: &User{ + Login: String("l"), + ID: Int64(1), + URL: String("u"), + AvatarURL: String("a"), + GravatarID: String("g"), + Name: String("n"), + Company: String("c"), + Blog: String("b"), + Location: String("l"), + Email: String("e"), + Hireable: Bool(true), + Bio: String("b"), + TwitterUsername: String("t"), + PublicRepos: Int(1), + Followers: Int(1), + Following: Int(1), + CreatedAt: &Timestamp{referenceTime}, + SuspendedAt: &Timestamp{referenceTime}, + }, + AccessTokensURL: String("atu"), + RepositoriesURL: String("ru"), + HTMLURL: String("hu"), + TargetType: String("tt"), + SingleFileName: String("sfn"), + RepositorySelection: String("rs"), + Events: []string{"e"}, + SingleFilePaths: []string{"s"}, + Permissions: &InstallationPermissions{ + Actions: String("a"), + Administration: String("ad"), + Checks: String("c"), + Contents: String("co"), + ContentReferences: String("cr"), + Deployments: String("d"), + Environments: String("e"), + Issues: String("i"), + Metadata: String("md"), + Members: String("m"), + OrganizationAdministration: String("oa"), + OrganizationHooks: String("oh"), + OrganizationPlan: String("op"), + OrganizationPreReceiveHooks: String("opr"), + OrganizationProjects: String("op"), + OrganizationSecrets: String("os"), + OrganizationSelfHostedRunners: String("osh"), + OrganizationUserBlocking: String("oub"), + Packages: String("pkg"), + Pages: String("pg"), + PullRequests: String("pr"), + RepositoryHooks: String("rh"), + RepositoryProjects: String("rp"), + RepositoryPreReceiveHooks: String("rprh"), + Secrets: String("s"), + SecretScanningAlerts: String("ssa"), + SecurityEvents: String("se"), + SingleFile: String("sf"), + Statuses: String("s"), + TeamDiscussions: String("td"), + VulnerabilityAlerts: String("va"), + Workflows: String("w"), + }, + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + HasMultipleSingleFiles: Bool(false), + SuspendedBy: &User{ + Login: String("l"), + ID: Int64(1), + URL: String("u"), + AvatarURL: String("a"), + GravatarID: String("g"), + Name: String("n"), + Company: String("c"), + Blog: String("b"), + Location: String("l"), + Email: String("e"), + Hireable: Bool(true), + Bio: String("b"), + TwitterUsername: String("t"), + PublicRepos: Int(1), + Followers: Int(1), + Following: Int(1), + CreatedAt: &Timestamp{referenceTime}, + SuspendedAt: &Timestamp{referenceTime}, + }, + SuspendedAt: &Timestamp{referenceTime}, + }, + Organization: &Organization{ + BillingEmail: String("be"), + Blog: String("b"), + Company: String("c"), + Email: String("e"), + TwitterUsername: String("tu"), + Location: String("loc"), + Name: String("n"), + Description: String("d"), + IsVerified: Bool(true), + HasOrganizationProjects: Bool(true), + HasRepositoryProjects: Bool(true), + DefaultRepoPermission: String("drp"), + MembersCanCreateRepos: Bool(true), + MembersCanCreateInternalRepos: Bool(true), + MembersCanCreatePrivateRepos: Bool(true), + MembersCanCreatePublicRepos: Bool(false), + MembersAllowedRepositoryCreationType: String("marct"), + MembersCanCreatePages: Bool(true), + MembersCanCreatePublicPages: Bool(false), + MembersCanCreatePrivatePages: Bool(true), + }, + Repository: &Repository{ + ID: Int64(1), + URL: String("s"), + Name: String("n"), + }, + Sender: &User{ + Login: String("l"), + ID: Int64(1), + NodeID: String("n"), + URL: String("u"), + ReposURL: String("r"), + EventsURL: String("e"), + AvatarURL: String("a"), + }, + TargetType: String("running"), + } + + want := `{ + "account": { + "login": "u", + "id": 1, + "node_id": "n", + "avatar_url": "l", + "url": "u", + "events_url": "e", + "repos_url": "r" + }, + "action": "a", + "changes": { + "login": { + "from": "p" + }, + "slug": { + "from": "j" + } + }, + "enterprise": { + "id": 1, + "slug": "s", + "name": "n", + "node_id": "nid", + "avatar_url": "au", + "description": "d", + "website_url": "wu", + "html_url": "hu", + "created_at": ` + referenceTimeStr + `, + "updated_at": ` + referenceTimeStr + ` + }, + "installation": { + "id": 1, + "node_id": "nid", + "app_id": 1, + "app_slug": "as", + "target_id": 1, + "account": { + "login": "l", + "id": 1, + "avatar_url": "a", + "gravatar_id": "g", + "name": "n", + "company": "c", + "blog": "b", + "location": "l", + "email": "e", + "hireable": true, + "bio": "b", + "twitter_username": "t", + "public_repos": 1, + "followers": 1, + "following": 1, + "created_at": ` + referenceTimeStr + `, + "suspended_at": ` + referenceTimeStr + `, + "url": "u" + }, + "access_tokens_url": "atu", + "repositories_url": "ru", + "html_url": "hu", + "target_type": "tt", + "single_file_name": "sfn", + "repository_selection": "rs", + "events": [ + "e" + ], + "single_file_paths": [ + "s" + ], + "permissions": { + "actions": "a", + "administration": "ad", + "checks": "c", + "contents": "co", + "content_references": "cr", + "deployments": "d", + "environments": "e", + "issues": "i", + "metadata": "md", + "members": "m", + "organization_administration": "oa", + "organization_hooks": "oh", + "organization_plan": "op", + "organization_pre_receive_hooks": "opr", + "organization_projects": "op", + "organization_secrets": "os", + "organization_self_hosted_runners": "osh", + "organization_user_blocking": "oub", + "packages": "pkg", + "pages": "pg", + "pull_requests": "pr", + "repository_hooks": "rh", + "repository_projects": "rp", + "repository_pre_receive_hooks": "rprh", + "secrets": "s", + "secret_scanning_alerts": "ssa", + "security_events": "se", + "single_file": "sf", + "statuses": "s", + "team_discussions": "td", + "vulnerability_alerts": "va", + "workflows": "w" + }, + "created_at": ` + referenceTimeStr + `, + "updated_at": ` + referenceTimeStr + `, + "has_multiple_single_files": false, + "suspended_by": { + "login": "l", + "id": 1, + "avatar_url": "a", + "gravatar_id": "g", + "name": "n", + "company": "c", + "blog": "b", + "location": "l", + "email": "e", + "hireable": true, + "bio": "b", + "twitter_username": "t", + "public_repos": 1, + "followers": 1, + "following": 1, + "created_at": ` + referenceTimeStr + `, + "suspended_at": ` + referenceTimeStr + `, + "url": "u" + }, + "suspended_at": ` + referenceTimeStr + ` + }, + "organization": { + "name": "n", + "company": "c", + "blog": "b", + "location": "loc", + "email": "e", + "twitter_username": "tu", + "description": "d", + "billing_email": "be", + "is_verified": true, + "has_organization_projects": true, + "has_repository_projects": true, + "default_repository_permission": "drp", + "members_can_create_repositories": true, + "members_can_create_public_repositories": false, + "members_can_create_private_repositories": true, + "members_can_create_internal_repositories": true, + "members_allowed_repository_creation_type": "marct", + "members_can_create_pages": true, + "members_can_create_public_pages": false, + "members_can_create_private_pages": true + }, + "repository": { + "id": 1, + "url": "s", + "name": "n" + }, + "sender": { + "login": "l", + "id": 1, + "node_id": "n", + "avatar_url": "a", + "url": "u", + "events_url": "e", + "repos_url": "r" + }, + "target_type": "running" + }` + + testJSONMarshal(t, u, want) +} + func TestEditTitle_Marshal(t *testing.T) { testJSONMarshal(t, &EditTitle{}, "{}") diff --git a/github/github-accessors.go b/github/github-accessors.go index 43bb7d0c687..cff3c9c1b4e 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -8038,6 +8038,22 @@ func (i *Installation) GetUpdatedAt() Timestamp { return *i.UpdatedAt } +// GetLogin returns the Login field. +func (i *InstallationChanges) GetLogin() *InstallationLoginChange { + if i == nil { + return nil + } + return i.Login +} + +// GetSlug returns the Slug field. +func (i *InstallationChanges) GetSlug() *InstallationSlugChange { + if i == nil { + return nil + } + return i.Slug +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (i *InstallationEvent) GetAction() string { if i == nil || i.Action == nil { @@ -8070,6 +8086,14 @@ func (i *InstallationEvent) GetSender() *User { return i.Sender } +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (i *InstallationLoginChange) GetFrom() string { + if i == nil || i.From == nil { + return "" + } + return *i.From +} + // GetActions returns the Actions field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetActions() string { if i == nil || i.Actions == nil { @@ -8398,6 +8422,86 @@ func (i *InstallationRepositoriesEvent) GetSender() *User { return i.Sender } +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (i *InstallationSlugChange) GetFrom() string { + if i == nil || i.From == nil { + return "" + } + return *i.From +} + +// GetAccount returns the Account field. +func (i *InstallationTargetEvent) GetAccount() *User { + if i == nil { + return nil + } + return i.Account +} + +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (i *InstallationTargetEvent) GetAction() string { + if i == nil || i.Action == nil { + return "" + } + return *i.Action +} + +// GetChanges returns the Changes field. +func (i *InstallationTargetEvent) GetChanges() *InstallationChanges { + if i == nil { + return nil + } + return i.Changes +} + +// GetEnterprise returns the Enterprise field. +func (i *InstallationTargetEvent) GetEnterprise() *Enterprise { + if i == nil { + return nil + } + return i.Enterprise +} + +// GetInstallation returns the Installation field. +func (i *InstallationTargetEvent) GetInstallation() *Installation { + if i == nil { + return nil + } + return i.Installation +} + +// GetOrganization returns the Organization field. +func (i *InstallationTargetEvent) GetOrganization() *Organization { + if i == nil { + return nil + } + return i.Organization +} + +// GetRepository returns the Repository field. +func (i *InstallationTargetEvent) GetRepository() *Repository { + if i == nil { + return nil + } + return i.Repository +} + +// GetSender returns the Sender field. +func (i *InstallationTargetEvent) GetSender() *User { + if i == nil { + return nil + } + return i.Sender +} + +// GetTargetType returns the TargetType field if it's non-nil, zero value otherwise. +func (i *InstallationTargetEvent) GetTargetType() string { + if i == nil || i.TargetType == nil { + return "" + } + return *i.TargetType +} + // GetExpiresAt returns the ExpiresAt field if it's non-nil, zero value otherwise. func (i *InstallationToken) GetExpiresAt() Timestamp { if i == nil || i.ExpiresAt == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 09c402ed73e..1ea06998a2e 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -9448,6 +9448,20 @@ func TestInstallation_GetUpdatedAt(tt *testing.T) { i.GetUpdatedAt() } +func TestInstallationChanges_GetLogin(tt *testing.T) { + i := &InstallationChanges{} + i.GetLogin() + i = nil + i.GetLogin() +} + +func TestInstallationChanges_GetSlug(tt *testing.T) { + i := &InstallationChanges{} + i.GetSlug() + i = nil + i.GetSlug() +} + func TestInstallationEvent_GetAction(tt *testing.T) { var zeroValue string i := &InstallationEvent{Action: &zeroValue} @@ -9479,6 +9493,16 @@ func TestInstallationEvent_GetSender(tt *testing.T) { i.GetSender() } +func TestInstallationLoginChange_GetFrom(tt *testing.T) { + var zeroValue string + i := &InstallationLoginChange{From: &zeroValue} + i.GetFrom() + i = &InstallationLoginChange{} + i.GetFrom() + i = nil + i.GetFrom() +} + func TestInstallationPermissions_GetActions(tt *testing.T) { var zeroValue string i := &InstallationPermissions{Actions: &zeroValue} @@ -9883,6 +9907,85 @@ func TestInstallationRepositoriesEvent_GetSender(tt *testing.T) { i.GetSender() } +func TestInstallationSlugChange_GetFrom(tt *testing.T) { + var zeroValue string + i := &InstallationSlugChange{From: &zeroValue} + i.GetFrom() + i = &InstallationSlugChange{} + i.GetFrom() + i = nil + i.GetFrom() +} + +func TestInstallationTargetEvent_GetAccount(tt *testing.T) { + i := &InstallationTargetEvent{} + i.GetAccount() + i = nil + i.GetAccount() +} + +func TestInstallationTargetEvent_GetAction(tt *testing.T) { + var zeroValue string + i := &InstallationTargetEvent{Action: &zeroValue} + i.GetAction() + i = &InstallationTargetEvent{} + i.GetAction() + i = nil + i.GetAction() +} + +func TestInstallationTargetEvent_GetChanges(tt *testing.T) { + i := &InstallationTargetEvent{} + i.GetChanges() + i = nil + i.GetChanges() +} + +func TestInstallationTargetEvent_GetEnterprise(tt *testing.T) { + i := &InstallationTargetEvent{} + i.GetEnterprise() + i = nil + i.GetEnterprise() +} + +func TestInstallationTargetEvent_GetInstallation(tt *testing.T) { + i := &InstallationTargetEvent{} + i.GetInstallation() + i = nil + i.GetInstallation() +} + +func TestInstallationTargetEvent_GetOrganization(tt *testing.T) { + i := &InstallationTargetEvent{} + i.GetOrganization() + i = nil + i.GetOrganization() +} + +func TestInstallationTargetEvent_GetRepository(tt *testing.T) { + i := &InstallationTargetEvent{} + i.GetRepository() + i = nil + i.GetRepository() +} + +func TestInstallationTargetEvent_GetSender(tt *testing.T) { + i := &InstallationTargetEvent{} + i.GetSender() + i = nil + i.GetSender() +} + +func TestInstallationTargetEvent_GetTargetType(tt *testing.T) { + var zeroValue string + i := &InstallationTargetEvent{TargetType: &zeroValue} + i.GetTargetType() + i = &InstallationTargetEvent{} + i.GetTargetType() + i = nil + i.GetTargetType() +} + func TestInstallationToken_GetExpiresAt(tt *testing.T) { var zeroValue Timestamp i := &InstallationToken{ExpiresAt: &zeroValue} diff --git a/github/messages.go b/github/messages.go index e61ef1c07b6..929587d337f 100644 --- a/github/messages.go +++ b/github/messages.go @@ -63,6 +63,7 @@ var ( "gollum": "GollumEvent", "installation": "InstallationEvent", "installation_repositories": "InstallationRepositoriesEvent", + "installation_target": "InstallationTargetEvent", "issue_comment": "IssueCommentEvent", "issues": "IssuesEvent", "label": "LabelEvent", diff --git a/github/messages_test.go b/github/messages_test.go index 5230b87a61c..8ee38eb346b 100644 --- a/github/messages_test.go +++ b/github/messages_test.go @@ -328,6 +328,10 @@ func TestParseWebHook(t *testing.T) { payload: &InstallationRepositoriesEvent{}, messageType: "installation_repositories", }, + { + payload: &InstallationTargetEvent{}, + messageType: "installation_target", + }, { payload: &IssueCommentEvent{}, messageType: "issue_comment", From b02bb75f811c9b236c846b64af235809617bc5a2 Mon Sep 17 00:00:00 2001 From: Aurimas Salamachinas Date: Thu, 20 Jul 2023 15:11:24 +0300 Subject: [PATCH 264/751] Add secret type display to secret scanning alert (#2834) --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ github/secret_scanning.go | 25 +++++++++++++------------ 3 files changed, 31 insertions(+), 12 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index cff3c9c1b4e..35e61043ab8 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -19846,6 +19846,14 @@ func (s *SecretScanningAlert) GetSecretType() string { return *s.SecretType } +// GetSecretTypeDisplayName returns the SecretTypeDisplayName field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetSecretTypeDisplayName() string { + if s == nil || s.SecretTypeDisplayName == nil { + return "" + } + return *s.SecretTypeDisplayName +} + // GetState returns the State field if it's non-nil, zero value otherwise. func (s *SecretScanningAlert) GetState() string { if s == nil || s.State == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 1ea06998a2e..29d1fd4f1a5 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -23152,6 +23152,16 @@ func TestSecretScanningAlert_GetSecretType(tt *testing.T) { s.GetSecretType() } +func TestSecretScanningAlert_GetSecretTypeDisplayName(tt *testing.T) { + var zeroValue string + s := &SecretScanningAlert{SecretTypeDisplayName: &zeroValue} + s.GetSecretTypeDisplayName() + s = &SecretScanningAlert{} + s.GetSecretTypeDisplayName() + s = nil + s.GetSecretTypeDisplayName() +} + func TestSecretScanningAlert_GetState(tt *testing.T) { var zeroValue string s := &SecretScanningAlert{State: &zeroValue} diff --git a/github/secret_scanning.go b/github/secret_scanning.go index 36ad555377e..b8295cbf791 100644 --- a/github/secret_scanning.go +++ b/github/secret_scanning.go @@ -16,18 +16,19 @@ type SecretScanningService service // SecretScanningAlert represents a GitHub secret scanning alert. type SecretScanningAlert struct { - Number *int `json:"number,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - URL *string `json:"url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - LocationsURL *string `json:"locations_url,omitempty"` - State *string `json:"state,omitempty"` - Resolution *string `json:"resolution,omitempty"` - ResolvedAt *Timestamp `json:"resolved_at,omitempty"` - ResolvedBy *User `json:"resolved_by,omitempty"` - SecretType *string `json:"secret_type,omitempty"` - Secret *string `json:"secret,omitempty"` - Repository *Repository `json:"repository,omitempty"` + Number *int `json:"number,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + LocationsURL *string `json:"locations_url,omitempty"` + State *string `json:"state,omitempty"` + Resolution *string `json:"resolution,omitempty"` + ResolvedAt *Timestamp `json:"resolved_at,omitempty"` + ResolvedBy *User `json:"resolved_by,omitempty"` + SecretType *string `json:"secret_type,omitempty"` + SecretTypeDisplayName *string `json:"secret_type_display_name,omitempty"` + Secret *string `json:"secret,omitempty"` + Repository *Repository `json:"repository,omitempty"` } // SecretScanningAlertLocation represents the location for a secret scanning alert. From c030d43bc8e3003715a3de91972b1a594039d262 Mon Sep 17 00:00:00 2001 From: k0ral Date: Fri, 21 Jul 2023 15:13:42 +0200 Subject: [PATCH 265/751] Use a sentinel error when blocking paths for `RepositoriesServices.GetContents` (#2837) --- github/repos_contents.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/github/repos_contents.go b/github/repos_contents.go index 874a3277283..e859a4ddca4 100644 --- a/github/repos_contents.go +++ b/github/repos_contents.go @@ -21,6 +21,8 @@ import ( "strings" ) +var ErrPathForbidden = errors.New("path must not contain '..' due to auth vulnerability issue") + // RepositoryContent represents a file or directory in a github repository. type RepositoryContent struct { Type *string `json:"type,omitempty"` @@ -198,7 +200,7 @@ func (s *RepositoriesService) DownloadContentsWithMeta(ctx context.Context, owne // GitHub API docs: https://docs.github.com/en/rest/repos/contents#get-repository-content func (s *RepositoriesService) GetContents(ctx context.Context, owner, repo, path string, opts *RepositoryContentGetOptions) (fileContent *RepositoryContent, directoryContent []*RepositoryContent, resp *Response, err error) { if strings.Contains(path, "..") { - return nil, nil, nil, errors.New("path must not contain '..' due to auth vulnerability issue") + return nil, nil, nil, ErrPathForbidden } escapedPath := (&url.URL{Path: strings.TrimSuffix(path, "/")}).String() From a3dc9cbcdd0f95652894a9338e49b269d80e1433 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Penteado?= <4219131+joaopenteado@users.noreply.github.com> Date: Mon, 24 Jul 2023 23:59:36 +0900 Subject: [PATCH 266/751] Add support for SAML SSO authorization APIs (#2835) --- github/github-accessors.go | 88 ++++++++++++++ github/github-accessors_test.go | 110 ++++++++++++++++++ github/orgs_credential_authorizations.go | 95 +++++++++++++++ github/orgs_credential_authorizations_test.go | 99 ++++++++++++++++ 4 files changed, 392 insertions(+) create mode 100644 github/orgs_credential_authorizations.go create mode 100644 github/orgs_credential_authorizations_test.go diff --git a/github/github-accessors.go b/github/github-accessors.go index 35e61043ab8..4dd5529a3a3 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -4670,6 +4670,94 @@ func (c *CreateUserProjectOptions) GetBody() string { return *c.Body } +// GetAuthorizedCredentialExpiresAt returns the AuthorizedCredentialExpiresAt field if it's non-nil, zero value otherwise. +func (c *CredentialAuthorization) GetAuthorizedCredentialExpiresAt() Timestamp { + if c == nil || c.AuthorizedCredentialExpiresAt == nil { + return Timestamp{} + } + return *c.AuthorizedCredentialExpiresAt +} + +// GetAuthorizedCredentialID returns the AuthorizedCredentialID field if it's non-nil, zero value otherwise. +func (c *CredentialAuthorization) GetAuthorizedCredentialID() int64 { + if c == nil || c.AuthorizedCredentialID == nil { + return 0 + } + return *c.AuthorizedCredentialID +} + +// GetAuthorizedCredentialNote returns the AuthorizedCredentialNote field if it's non-nil, zero value otherwise. +func (c *CredentialAuthorization) GetAuthorizedCredentialNote() string { + if c == nil || c.AuthorizedCredentialNote == nil { + return "" + } + return *c.AuthorizedCredentialNote +} + +// GetAuthorizedCredentialTitle returns the AuthorizedCredentialTitle field if it's non-nil, zero value otherwise. +func (c *CredentialAuthorization) GetAuthorizedCredentialTitle() string { + if c == nil || c.AuthorizedCredentialTitle == nil { + return "" + } + return *c.AuthorizedCredentialTitle +} + +// GetCredentialAccessedAt returns the CredentialAccessedAt field if it's non-nil, zero value otherwise. +func (c *CredentialAuthorization) GetCredentialAccessedAt() Timestamp { + if c == nil || c.CredentialAccessedAt == nil { + return Timestamp{} + } + return *c.CredentialAccessedAt +} + +// GetCredentialAuthorizedAt returns the CredentialAuthorizedAt field if it's non-nil, zero value otherwise. +func (c *CredentialAuthorization) GetCredentialAuthorizedAt() Timestamp { + if c == nil || c.CredentialAuthorizedAt == nil { + return Timestamp{} + } + return *c.CredentialAuthorizedAt +} + +// GetCredentialID returns the CredentialID field if it's non-nil, zero value otherwise. +func (c *CredentialAuthorization) GetCredentialID() int64 { + if c == nil || c.CredentialID == nil { + return 0 + } + return *c.CredentialID +} + +// GetCredentialType returns the CredentialType field if it's non-nil, zero value otherwise. +func (c *CredentialAuthorization) GetCredentialType() string { + if c == nil || c.CredentialType == nil { + return "" + } + return *c.CredentialType +} + +// GetFingerprint returns the Fingerprint field if it's non-nil, zero value otherwise. +func (c *CredentialAuthorization) GetFingerprint() string { + if c == nil || c.Fingerprint == nil { + return "" + } + return *c.Fingerprint +} + +// GetLogin returns the Login field if it's non-nil, zero value otherwise. +func (c *CredentialAuthorization) GetLogin() string { + if c == nil || c.Login == nil { + return "" + } + return *c.Login +} + +// GetTokenLastEight returns the TokenLastEight field if it's non-nil, zero value otherwise. +func (c *CredentialAuthorization) GetTokenLastEight() string { + if c == nil || c.TokenLastEight == nil { + return "" + } + return *c.TokenLastEight +} + // GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise. func (c *CustomRepoRoles) GetBaseRole() string { if c == nil || c.BaseRole == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 29d1fd4f1a5..75148227d3b 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -5508,6 +5508,116 @@ func TestCreateUserProjectOptions_GetBody(tt *testing.T) { c.GetBody() } +func TestCredentialAuthorization_GetAuthorizedCredentialExpiresAt(tt *testing.T) { + var zeroValue Timestamp + c := &CredentialAuthorization{AuthorizedCredentialExpiresAt: &zeroValue} + c.GetAuthorizedCredentialExpiresAt() + c = &CredentialAuthorization{} + c.GetAuthorizedCredentialExpiresAt() + c = nil + c.GetAuthorizedCredentialExpiresAt() +} + +func TestCredentialAuthorization_GetAuthorizedCredentialID(tt *testing.T) { + var zeroValue int64 + c := &CredentialAuthorization{AuthorizedCredentialID: &zeroValue} + c.GetAuthorizedCredentialID() + c = &CredentialAuthorization{} + c.GetAuthorizedCredentialID() + c = nil + c.GetAuthorizedCredentialID() +} + +func TestCredentialAuthorization_GetAuthorizedCredentialNote(tt *testing.T) { + var zeroValue string + c := &CredentialAuthorization{AuthorizedCredentialNote: &zeroValue} + c.GetAuthorizedCredentialNote() + c = &CredentialAuthorization{} + c.GetAuthorizedCredentialNote() + c = nil + c.GetAuthorizedCredentialNote() +} + +func TestCredentialAuthorization_GetAuthorizedCredentialTitle(tt *testing.T) { + var zeroValue string + c := &CredentialAuthorization{AuthorizedCredentialTitle: &zeroValue} + c.GetAuthorizedCredentialTitle() + c = &CredentialAuthorization{} + c.GetAuthorizedCredentialTitle() + c = nil + c.GetAuthorizedCredentialTitle() +} + +func TestCredentialAuthorization_GetCredentialAccessedAt(tt *testing.T) { + var zeroValue Timestamp + c := &CredentialAuthorization{CredentialAccessedAt: &zeroValue} + c.GetCredentialAccessedAt() + c = &CredentialAuthorization{} + c.GetCredentialAccessedAt() + c = nil + c.GetCredentialAccessedAt() +} + +func TestCredentialAuthorization_GetCredentialAuthorizedAt(tt *testing.T) { + var zeroValue Timestamp + c := &CredentialAuthorization{CredentialAuthorizedAt: &zeroValue} + c.GetCredentialAuthorizedAt() + c = &CredentialAuthorization{} + c.GetCredentialAuthorizedAt() + c = nil + c.GetCredentialAuthorizedAt() +} + +func TestCredentialAuthorization_GetCredentialID(tt *testing.T) { + var zeroValue int64 + c := &CredentialAuthorization{CredentialID: &zeroValue} + c.GetCredentialID() + c = &CredentialAuthorization{} + c.GetCredentialID() + c = nil + c.GetCredentialID() +} + +func TestCredentialAuthorization_GetCredentialType(tt *testing.T) { + var zeroValue string + c := &CredentialAuthorization{CredentialType: &zeroValue} + c.GetCredentialType() + c = &CredentialAuthorization{} + c.GetCredentialType() + c = nil + c.GetCredentialType() +} + +func TestCredentialAuthorization_GetFingerprint(tt *testing.T) { + var zeroValue string + c := &CredentialAuthorization{Fingerprint: &zeroValue} + c.GetFingerprint() + c = &CredentialAuthorization{} + c.GetFingerprint() + c = nil + c.GetFingerprint() +} + +func TestCredentialAuthorization_GetLogin(tt *testing.T) { + var zeroValue string + c := &CredentialAuthorization{Login: &zeroValue} + c.GetLogin() + c = &CredentialAuthorization{} + c.GetLogin() + c = nil + c.GetLogin() +} + +func TestCredentialAuthorization_GetTokenLastEight(tt *testing.T) { + var zeroValue string + c := &CredentialAuthorization{TokenLastEight: &zeroValue} + c.GetTokenLastEight() + c = &CredentialAuthorization{} + c.GetTokenLastEight() + c = nil + c.GetTokenLastEight() +} + func TestCustomRepoRoles_GetBaseRole(tt *testing.T) { var zeroValue string c := &CustomRepoRoles{BaseRole: &zeroValue} diff --git a/github/orgs_credential_authorizations.go b/github/orgs_credential_authorizations.go new file mode 100644 index 00000000000..6d56fe8f79a --- /dev/null +++ b/github/orgs_credential_authorizations.go @@ -0,0 +1,95 @@ +// Copyright 2023 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" +) + +// CredentialAuthorization represents a credential authorized through SAML SSO. +type CredentialAuthorization struct { + // User login that owns the underlying credential. + Login *string `json:"login,omitempty"` + + // Unique identifier for the credential. + CredentialID *int64 `json:"credential_id,omitempty"` + + // Human-readable description of the credential type. + CredentialType *string `json:"credential_type,omitempty"` + + // Last eight characters of the credential. + // Only included in responses with credential_type of personal access token. + TokenLastEight *string `json:"token_last_eight,omitempty"` + + // Date when the credential was authorized for use. + CredentialAuthorizedAt *Timestamp `json:"credential_authorized_at,omitempty"` + + // Date when the credential was last accessed. + // May be null if it was never accessed. + CredentialAccessedAt *Timestamp `json:"credential_accessed_at,omitempty"` + + // List of oauth scopes the token has been granted. + Scopes []string `json:"scopes,omitempty"` + + // Unique string to distinguish the credential. + // Only included in responses with credential_type of SSH Key. + Fingerprint *string `json:"fingerprint,omitempty"` + + AuthorizedCredentialID *int64 `json:"authorized_credential_id,omitempty"` + + // The title given to the ssh key. + // This will only be present when the credential is an ssh key. + AuthorizedCredentialTitle *string `json:"authorized_credential_title,omitempty"` + + // The note given to the token. + // This will only be present when the credential is a token. + AuthorizedCredentialNote *string `json:"authorized_credential_note,omitempty"` + + // The expiry for the token. + // This will only be present when the credential is a token. + AuthorizedCredentialExpiresAt *Timestamp `json:"authorized_credential_expires_at,omitempty"` +} + +// ListCredentialAuthorizations lists credentials authorized through SAML SSO +// for a given organization. Only available with GitHub Enterprise Cloud. +// +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/orgs?apiVersion=2022-11-28#list-saml-sso-authorizations-for-an-organization +func (s *OrganizationsService) ListCredentialAuthorizations(ctx context.Context, org string, opts *ListOptions) ([]*CredentialAuthorization, *Response, error) { + u := fmt.Sprintf("orgs/%v/credential-authorizations", org) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest(http.MethodGet, u, nil) + if err != nil { + return nil, nil, err + } + + var creds []*CredentialAuthorization + resp, err := s.client.Do(ctx, req, &creds) + if err != nil { + return nil, resp, err + } + + return creds, resp, nil +} + +// RemoveCredentialAuthorization revokes the SAML SSO authorization for a given +// credential within an organization. Only available with GitHub Enterprise Cloud. +// +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/orgs?apiVersion=2022-11-28#remove-a-saml-sso-authorization-for-an-organization +func (s *OrganizationsService) RemoveCredentialAuthorization(ctx context.Context, org string, credentialID int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/credential-authorizations/%v", org, credentialID) + req, err := s.client.NewRequest(http.MethodDelete, u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} diff --git a/github/orgs_credential_authorizations_test.go b/github/orgs_credential_authorizations_test.go new file mode 100644 index 00000000000..e3986eb5ca2 --- /dev/null +++ b/github/orgs_credential_authorizations_test.go @@ -0,0 +1,99 @@ +// Copyright 2023 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" + "time" + + "github.com/google/go-cmp/cmp" +) + +func TestOrganizationsService_ListCredentialAuthorizations(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/credential-authorizations", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, http.MethodGet) + testFormValues(t, r, values{"per_page": "2", "page": "2"}) + fmt.Fprint(w, `[ + { + "login": "l", + "credential_id": 1, + "credential_type": "t", + "credential_authorized_at": "2017-01-21T00:00:00Z", + "credential_accessed_at": "2017-01-21T00:00:00Z", + "authorized_credential_id": 1 + } + ]`) + }) + + opts := &ListOptions{Page: 2, PerPage: 2} + ctx := context.Background() + creds, _, err := client.Organizations.ListCredentialAuthorizations(ctx, "o", opts) + if err != nil { + t.Errorf("Organizations.ListCredentialAuthorizations returned error: %v", err) + } + + ts := time.Date(2017, time.January, 21, 0, 0, 0, 0, time.UTC) + want := []*CredentialAuthorization{ + { + Login: String("l"), + CredentialID: Int64(1), + CredentialType: String("t"), + CredentialAuthorizedAt: &Timestamp{ts}, + CredentialAccessedAt: &Timestamp{ts}, + AuthorizedCredentialID: Int64(1), + }, + } + if !cmp.Equal(creds, want) { + t.Errorf("Organizations.ListCredentialAuthorizations returned %+v, want %+v", creds, want) + } + + const methodName = "ListCredentialAuthorizations" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.ListCredentialAuthorizations(ctx, "\n", opts) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + _, resp, err := client.Organizations.ListCredentialAuthorizations(ctx, "o", opts) + return resp, err + }) +} + +func TestOrganizationsService_RemoveCredentialAuthorization(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/credential-authorizations/1", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, http.MethodDelete) + w.WriteHeader(http.StatusNoContent) + }) + + ctx := context.Background() + resp, err := client.Organizations.RemoveCredentialAuthorization(ctx, "o", 1) + if err != nil { + t.Errorf("Organizations.RemoveCredentialAuthorization returned error: %v", err) + } + + if resp.StatusCode != http.StatusNoContent { + t.Errorf("Organizations.RemoveCredentialAuthorization returned %v, want %v", resp.StatusCode, http.StatusNoContent) + } + + const methodName = "RemoveCredentialAuthorization" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Organizations.RemoveCredentialAuthorization(ctx, "\n", 0) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Organizations.RemoveCredentialAuthorization(ctx, "o", 1) + }) +} From eacffdd7953336e448f838cf534bab2272fab3d9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Jul 2023 15:23:16 -0400 Subject: [PATCH 267/751] Bump golang.org/x/net from 0.11.0 to 0.12.0 in /scrape (#2839) --- scrape/go.mod | 2 +- scrape/go.sum | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 5ec934b7097..ff0f49cf2b1 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -7,5 +7,5 @@ require ( github.com/google/go-cmp v0.5.9 github.com/google/go-github/v53 v53.2.0 github.com/xlzd/gotp v0.1.0 - golang.org/x/net v0.11.0 + golang.org/x/net v0.12.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index 825ab769b9f..bdd49a250ff 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -30,8 +30,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= -golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= +golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= +golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= @@ -44,8 +44,8 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU= -golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= +golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= +golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8= golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -63,15 +63,15 @@ golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= -golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= +golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo= +golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -81,7 +81,7 @@ golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= From 4074b7c3a0a8c0da1663fe490ccfc6f20abed5b2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Jul 2023 16:14:46 -0400 Subject: [PATCH 268/751] Bump golang.org/x/oauth2 from 0.9.0 to 0.10.0 (#2840) --- go.mod | 12 +- go.sum | 1522 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 1516 insertions(+), 18 deletions(-) diff --git a/go.mod b/go.mod index c70219a69c9..541c608cffc 100644 --- a/go.mod +++ b/go.mod @@ -4,17 +4,17 @@ require ( github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 github.com/google/go-cmp v0.5.9 github.com/google/go-querystring v1.1.0 - golang.org/x/oauth2 v0.9.0 + golang.org/x/oauth2 v0.10.0 ) require ( github.com/cloudflare/circl v1.3.3 // indirect - github.com/golang/protobuf v1.5.2 // indirect - golang.org/x/crypto v0.10.0 // indirect - golang.org/x/net v0.11.0 // indirect - golang.org/x/sys v0.9.0 // indirect + github.com/golang/protobuf v1.5.3 // indirect + golang.org/x/crypto v0.11.0 // indirect + golang.org/x/net v0.12.0 // indirect + golang.org/x/sys v0.10.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/protobuf v1.28.0 // indirect + google.golang.org/protobuf v1.31.0 // indirect ) go 1.17 diff --git a/go.sum b/go.sum index 5572c596bc4..3528d0fcf92 100644 --- a/go.sum +++ b/go.sum @@ -1,79 +1,1577 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= +cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= +cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= +cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= +cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= +cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= +cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= +cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= +cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= +cloud.google.com/go v0.100.1/go.mod h1:fs4QogzfH5n2pBXBP9vRiU+eCny7lD2vmFZy79Iuw1U= +cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= +cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= +cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= +cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= +cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM= +cloud.google.com/go v0.107.0/go.mod h1:wpc2eNrD7hXUTy8EKS10jkxpZBjASrORK7goS+3YX2I= +cloud.google.com/go v0.110.0/go.mod h1:SJnCLqQ0FCFGSZMUNUf84MV3Aia54kn7pi8st7tMzaY= +cloud.google.com/go v0.110.2/go.mod h1:k04UEeEtb6ZBRTv3dZz4CeJC3jKGxyhl0sAiVVquxiw= +cloud.google.com/go/accessapproval v1.4.0/go.mod h1:zybIuC3KpDOvotz59lFe5qxRZx6C75OtwbisN56xYB4= +cloud.google.com/go/accessapproval v1.5.0/go.mod h1:HFy3tuiGvMdcd/u+Cu5b9NkO1pEICJ46IR82PoUdplw= +cloud.google.com/go/accessapproval v1.6.0/go.mod h1:R0EiYnwV5fsRFiKZkPHr6mwyk2wxUJ30nL4j2pcFY2E= +cloud.google.com/go/accesscontextmanager v1.3.0/go.mod h1:TgCBehyr5gNMz7ZaH9xubp+CE8dkrszb4oK9CWyvD4o= +cloud.google.com/go/accesscontextmanager v1.4.0/go.mod h1:/Kjh7BBu/Gh83sv+K60vN9QE5NJcd80sU33vIe2IFPE= +cloud.google.com/go/accesscontextmanager v1.6.0/go.mod h1:8XCvZWfYw3K/ji0iVnp+6pu7huxoQTLmxAbVjbloTtM= +cloud.google.com/go/accesscontextmanager v1.7.0/go.mod h1:CEGLewx8dwa33aDAZQujl7Dx+uYhS0eay198wB/VumQ= +cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= +cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= +cloud.google.com/go/aiplatform v1.27.0/go.mod h1:Bvxqtl40l0WImSb04d0hXFU7gDOiq9jQmorivIiWcKg= +cloud.google.com/go/aiplatform v1.35.0/go.mod h1:7MFT/vCaOyZT/4IIFfxH4ErVg/4ku6lKv3w0+tFTgXQ= +cloud.google.com/go/aiplatform v1.36.1/go.mod h1:WTm12vJRPARNvJ+v6P52RDHCNe4AhvjcIZ/9/RRHy/k= +cloud.google.com/go/aiplatform v1.37.0/go.mod h1:IU2Cv29Lv9oCn/9LkFiiuKfwrRTq+QQMbW+hPCxJGZw= +cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= +cloud.google.com/go/analytics v0.12.0/go.mod h1:gkfj9h6XRf9+TS4bmuhPEShsh3hH8PAZzm/41OOhQd4= +cloud.google.com/go/analytics v0.17.0/go.mod h1:WXFa3WSym4IZ+JiKmavYdJwGG/CvpqiqczmL59bTD9M= +cloud.google.com/go/analytics v0.18.0/go.mod h1:ZkeHGQlcIPkw0R/GW+boWHhCOR43xz9RN/jn7WcqfIE= +cloud.google.com/go/analytics v0.19.0/go.mod h1:k8liqf5/HCnOUkbawNtrWWc+UAzyDlW89doe8TtoDsE= +cloud.google.com/go/apigateway v1.3.0/go.mod h1:89Z8Bhpmxu6AmUxuVRg/ECRGReEdiP3vQtk4Z1J9rJk= +cloud.google.com/go/apigateway v1.4.0/go.mod h1:pHVY9MKGaH9PQ3pJ4YLzoj6U5FUDeDFBllIz7WmzJoc= +cloud.google.com/go/apigateway v1.5.0/go.mod h1:GpnZR3Q4rR7LVu5951qfXPJCHquZt02jf7xQx7kpqN8= +cloud.google.com/go/apigeeconnect v1.3.0/go.mod h1:G/AwXFAKo0gIXkPTVfZDd2qA1TxBXJ3MgMRBQkIi9jc= +cloud.google.com/go/apigeeconnect v1.4.0/go.mod h1:kV4NwOKqjvt2JYR0AoIWo2QGfoRtn/pkS3QlHp0Ni04= +cloud.google.com/go/apigeeconnect v1.5.0/go.mod h1:KFaCqvBRU6idyhSNyn3vlHXc8VMDJdRmwDF6JyFRqZ8= +cloud.google.com/go/apigeeregistry v0.4.0/go.mod h1:EUG4PGcsZvxOXAdyEghIdXwAEi/4MEaoqLMLDMIwKXY= +cloud.google.com/go/apigeeregistry v0.5.0/go.mod h1:YR5+s0BVNZfVOUkMa5pAR2xGd0A473vA5M7j247o1wM= +cloud.google.com/go/apigeeregistry v0.6.0/go.mod h1:BFNzW7yQVLZ3yj0TKcwzb8n25CFBri51GVGOEUcgQsc= +cloud.google.com/go/apikeys v0.4.0/go.mod h1:XATS/yqZbaBK0HOssf+ALHp8jAlNHUgyfprvNcBIszU= +cloud.google.com/go/apikeys v0.5.0/go.mod h1:5aQfwY4D+ewMMWScd3hm2en3hCj+BROlyrt3ytS7KLI= +cloud.google.com/go/apikeys v0.6.0/go.mod h1:kbpXu5upyiAlGkKrJgQl8A0rKNNJ7dQ377pdroRSSi8= +cloud.google.com/go/appengine v1.4.0/go.mod h1:CS2NhuBuDXM9f+qscZ6V86m1MIIqPj3WC/UoEuR1Sno= +cloud.google.com/go/appengine v1.5.0/go.mod h1:TfasSozdkFI0zeoxW3PTBLiNqRmzraodCWatWI9Dmak= +cloud.google.com/go/appengine v1.6.0/go.mod h1:hg6i0J/BD2cKmDJbaFSYHFyZkgBEfQrDg/X0V5fJn84= +cloud.google.com/go/appengine v1.7.0/go.mod h1:eZqpbHFCqRGa2aCdope7eC0SWLV1j0neb/QnMJVWx6A= +cloud.google.com/go/appengine v1.7.1/go.mod h1:IHLToyb/3fKutRysUlFO0BPt5j7RiQ45nrzEJmKTo6E= +cloud.google.com/go/area120 v0.5.0/go.mod h1:DE/n4mp+iqVyvxHN41Vf1CR602GiHQjFPusMFW6bGR4= +cloud.google.com/go/area120 v0.6.0/go.mod h1:39yFJqWVgm0UZqWTOdqkLhjoC7uFfgXRC8g/ZegeAh0= +cloud.google.com/go/area120 v0.7.0/go.mod h1:a3+8EUD1SX5RUcCs3MY5YasiO1z6yLiNLRiFrykbynY= +cloud.google.com/go/area120 v0.7.1/go.mod h1:j84i4E1RboTWjKtZVWXPqvK5VHQFJRF2c1Nm69pWm9k= +cloud.google.com/go/artifactregistry v1.6.0/go.mod h1:IYt0oBPSAGYj/kprzsBjZ/4LnG/zOcHyFHjWPCi6SAQ= +cloud.google.com/go/artifactregistry v1.7.0/go.mod h1:mqTOFOnGZx8EtSqK/ZWcsm/4U8B77rbcLP6ruDU2Ixk= +cloud.google.com/go/artifactregistry v1.8.0/go.mod h1:w3GQXkJX8hiKN0v+at4b0qotwijQbYUqF2GWkZzAhC0= +cloud.google.com/go/artifactregistry v1.9.0/go.mod h1:2K2RqvA2CYvAeARHRkLDhMDJ3OXy26h3XW+3/Jh2uYc= +cloud.google.com/go/artifactregistry v1.11.1/go.mod h1:lLYghw+Itq9SONbCa1YWBoWs1nOucMH0pwXN1rOBZFI= +cloud.google.com/go/artifactregistry v1.11.2/go.mod h1:nLZns771ZGAwVLzTX/7Al6R9ehma4WUEhZGWV6CeQNQ= +cloud.google.com/go/artifactregistry v1.12.0/go.mod h1:o6P3MIvtzTOnmvGagO9v/rOjjA0HmhJ+/6KAXrmYDCI= +cloud.google.com/go/artifactregistry v1.13.0/go.mod h1:uy/LNfoOIivepGhooAUpL1i30Hgee3Cu0l4VTWHUC08= +cloud.google.com/go/asset v1.5.0/go.mod h1:5mfs8UvcM5wHhqtSv8J1CtxxaQq3AdBxxQi2jGW/K4o= +cloud.google.com/go/asset v1.7.0/go.mod h1:YbENsRK4+xTiL+Ofoj5Ckf+O17kJtgp3Y3nn4uzZz5s= +cloud.google.com/go/asset v1.8.0/go.mod h1:mUNGKhiqIdbr8X7KNayoYvyc4HbbFO9URsjbytpUaW0= +cloud.google.com/go/asset v1.9.0/go.mod h1:83MOE6jEJBMqFKadM9NLRcs80Gdw76qGuHn8m3h8oHQ= +cloud.google.com/go/asset v1.10.0/go.mod h1:pLz7uokL80qKhzKr4xXGvBQXnzHn5evJAEAtZiIb0wY= +cloud.google.com/go/asset v1.11.1/go.mod h1:fSwLhbRvC9p9CXQHJ3BgFeQNM4c9x10lqlrdEUYXlJo= +cloud.google.com/go/asset v1.12.0/go.mod h1:h9/sFOa4eDIyKmH6QMpm4eUK3pDojWnUhTgJlk762Hg= +cloud.google.com/go/asset v1.13.0/go.mod h1:WQAMyYek/b7NBpYq/K4KJWcRqzoalEsxz/t/dTk4THw= +cloud.google.com/go/assuredworkloads v1.5.0/go.mod h1:n8HOZ6pff6re5KYfBXcFvSViQjDwxFkAkmUFffJRbbY= +cloud.google.com/go/assuredworkloads v1.6.0/go.mod h1:yo2YOk37Yc89Rsd5QMVECvjaMKymF9OP+QXWlKXUkXw= +cloud.google.com/go/assuredworkloads v1.7.0/go.mod h1:z/736/oNmtGAyU47reJgGN+KVoYoxeLBoj4XkKYscNI= +cloud.google.com/go/assuredworkloads v1.8.0/go.mod h1:AsX2cqyNCOvEQC8RMPnoc0yEarXQk6WEKkxYfL6kGIo= +cloud.google.com/go/assuredworkloads v1.9.0/go.mod h1:kFuI1P78bplYtT77Tb1hi0FMxM0vVpRC7VVoJC3ZoT0= +cloud.google.com/go/assuredworkloads v1.10.0/go.mod h1:kwdUQuXcedVdsIaKgKTp9t0UJkE5+PAVNhdQm4ZVq2E= +cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0= +cloud.google.com/go/automl v1.6.0/go.mod h1:ugf8a6Fx+zP0D59WLhqgTDsQI9w07o64uf/Is3Nh5p8= +cloud.google.com/go/automl v1.7.0/go.mod h1:RL9MYCCsJEOmt0Wf3z9uzG0a7adTT1fe+aObgSpkCt8= +cloud.google.com/go/automl v1.8.0/go.mod h1:xWx7G/aPEe/NP+qzYXktoBSDfjO+vnKMGgsApGJJquM= +cloud.google.com/go/automl v1.12.0/go.mod h1:tWDcHDp86aMIuHmyvjuKeeHEGq76lD7ZqfGLN6B0NuU= +cloud.google.com/go/baremetalsolution v0.3.0/go.mod h1:XOrocE+pvK1xFfleEnShBlNAXf+j5blPPxrhjKgnIFc= +cloud.google.com/go/baremetalsolution v0.4.0/go.mod h1:BymplhAadOO/eBa7KewQ0Ppg4A4Wplbn+PsFKRLo0uI= +cloud.google.com/go/baremetalsolution v0.5.0/go.mod h1:dXGxEkmR9BMwxhzBhV0AioD0ULBmuLZI8CdwalUxuss= +cloud.google.com/go/batch v0.3.0/go.mod h1:TR18ZoAekj1GuirsUsR1ZTKN3FC/4UDnScjT8NXImFE= +cloud.google.com/go/batch v0.4.0/go.mod h1:WZkHnP43R/QCGQsZ+0JyG4i79ranE2u8xvjq/9+STPE= +cloud.google.com/go/batch v0.7.0/go.mod h1:vLZN95s6teRUqRQ4s3RLDsH8PvboqBK+rn1oevL159g= +cloud.google.com/go/beyondcorp v0.2.0/go.mod h1:TB7Bd+EEtcw9PCPQhCJtJGjk/7TC6ckmnSFS+xwTfm4= +cloud.google.com/go/beyondcorp v0.3.0/go.mod h1:E5U5lcrcXMsCuoDNyGrpyTm/hn7ne941Jz2vmksAxW8= +cloud.google.com/go/beyondcorp v0.4.0/go.mod h1:3ApA0mbhHx6YImmuubf5pyW8srKnCEPON32/5hj+RmM= +cloud.google.com/go/beyondcorp v0.5.0/go.mod h1:uFqj9X+dSfrheVp7ssLTaRHd2EHqSL4QZmH4e8WXGGU= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/bigquery v1.42.0/go.mod h1:8dRTJxhtG+vwBKzE5OseQn/hiydoQN3EedCaOdYmxRA= +cloud.google.com/go/bigquery v1.43.0/go.mod h1:ZMQcXHsl+xmU1z36G2jNGZmKp9zNY5BUua5wDgmNCfw= +cloud.google.com/go/bigquery v1.44.0/go.mod h1:0Y33VqXTEsbamHJvJHdFmtqHvMIY28aK1+dFsvaChGc= +cloud.google.com/go/bigquery v1.47.0/go.mod h1:sA9XOgy0A8vQK9+MWhEQTY6Tix87M/ZurWFIxmF9I/E= +cloud.google.com/go/bigquery v1.48.0/go.mod h1:QAwSz+ipNgfL5jxiaK7weyOhzdoAy1zFm0Nf1fysJac= +cloud.google.com/go/bigquery v1.49.0/go.mod h1:Sv8hMmTFFYBlt/ftw2uN6dFdQPzBlREY9yBh7Oy7/4Q= +cloud.google.com/go/bigquery v1.50.0/go.mod h1:YrleYEh2pSEbgTBZYMJ5SuSr0ML3ypjRB1zgf7pvQLU= +cloud.google.com/go/billing v1.4.0/go.mod h1:g9IdKBEFlItS8bTtlrZdVLWSSdSyFUZKXNS02zKMOZY= +cloud.google.com/go/billing v1.5.0/go.mod h1:mztb1tBc3QekhjSgmpf/CV4LzWXLzCArwpLmP2Gm88s= +cloud.google.com/go/billing v1.6.0/go.mod h1:WoXzguj+BeHXPbKfNWkqVtDdzORazmCjraY+vrxcyvI= +cloud.google.com/go/billing v1.7.0/go.mod h1:q457N3Hbj9lYwwRbnlD7vUpyjq6u5U1RAOArInEiD5Y= +cloud.google.com/go/billing v1.12.0/go.mod h1:yKrZio/eu+okO/2McZEbch17O5CB5NpZhhXG6Z766ss= +cloud.google.com/go/billing v1.13.0/go.mod h1:7kB2W9Xf98hP9Sr12KfECgfGclsH3CQR0R08tnRlRbc= +cloud.google.com/go/binaryauthorization v1.1.0/go.mod h1:xwnoWu3Y84jbuHa0zd526MJYmtnVXn0syOjaJgy4+dM= +cloud.google.com/go/binaryauthorization v1.2.0/go.mod h1:86WKkJHtRcv5ViNABtYMhhNWRrD1Vpi//uKEy7aYEfI= +cloud.google.com/go/binaryauthorization v1.3.0/go.mod h1:lRZbKgjDIIQvzYQS1p99A7/U1JqvqeZg0wiI5tp6tg0= +cloud.google.com/go/binaryauthorization v1.4.0/go.mod h1:tsSPQrBd77VLplV70GUhBf/Zm3FsKmgSqgm4UmiDItk= +cloud.google.com/go/binaryauthorization v1.5.0/go.mod h1:OSe4OU1nN/VswXKRBmciKpo9LulY41gch5c68htf3/Q= +cloud.google.com/go/certificatemanager v1.3.0/go.mod h1:n6twGDvcUBFu9uBgt4eYvvf3sQ6My8jADcOVwHmzadg= +cloud.google.com/go/certificatemanager v1.4.0/go.mod h1:vowpercVFyqs8ABSmrdV+GiFf2H/ch3KyudYQEMM590= +cloud.google.com/go/certificatemanager v1.6.0/go.mod h1:3Hh64rCKjRAX8dXgRAyOcY5vQ/fE1sh8o+Mdd6KPgY8= +cloud.google.com/go/channel v1.8.0/go.mod h1:W5SwCXDJsq/rg3tn3oG0LOxpAo6IMxNa09ngphpSlnk= +cloud.google.com/go/channel v1.9.0/go.mod h1:jcu05W0my9Vx4mt3/rEHpfxc9eKi9XwsdDL8yBMbKUk= +cloud.google.com/go/channel v1.11.0/go.mod h1:IdtI0uWGqhEeatSB62VOoJ8FSUhJ9/+iGkJVqp74CGE= +cloud.google.com/go/channel v1.12.0/go.mod h1:VkxCGKASi4Cq7TbXxlaBezonAYpp1GCnKMY6tnMQnLU= +cloud.google.com/go/cloudbuild v1.3.0/go.mod h1:WequR4ULxlqvMsjDEEEFnOG5ZSRSgWOywXYDb1vPE6U= +cloud.google.com/go/cloudbuild v1.4.0/go.mod h1:5Qwa40LHiOXmz3386FrjrYM93rM/hdRr7b53sySrTqA= +cloud.google.com/go/cloudbuild v1.6.0/go.mod h1:UIbc/w9QCbH12xX+ezUsgblrWv+Cv4Tw83GiSMHOn9M= +cloud.google.com/go/cloudbuild v1.7.0/go.mod h1:zb5tWh2XI6lR9zQmsm1VRA+7OCuve5d8S+zJUul8KTg= +cloud.google.com/go/cloudbuild v1.9.0/go.mod h1:qK1d7s4QlO0VwfYn5YuClDGg2hfmLZEb4wQGAbIgL1s= +cloud.google.com/go/clouddms v1.3.0/go.mod h1:oK6XsCDdW4Ib3jCCBugx+gVjevp2TMXFtgxvPSee3OM= +cloud.google.com/go/clouddms v1.4.0/go.mod h1:Eh7sUGCC+aKry14O1NRljhjyrr0NFC0G2cjwX0cByRk= +cloud.google.com/go/clouddms v1.5.0/go.mod h1:QSxQnhikCLUw13iAbffF2CZxAER3xDGNHjsTAkQJcQA= +cloud.google.com/go/cloudtasks v1.5.0/go.mod h1:fD92REy1x5woxkKEkLdvavGnPJGEn8Uic9nWuLzqCpY= +cloud.google.com/go/cloudtasks v1.6.0/go.mod h1:C6Io+sxuke9/KNRkbQpihnW93SWDU3uXt92nu85HkYI= +cloud.google.com/go/cloudtasks v1.7.0/go.mod h1:ImsfdYWwlWNJbdgPIIGJWC+gemEGTBK/SunNQQNCAb4= +cloud.google.com/go/cloudtasks v1.8.0/go.mod h1:gQXUIwCSOI4yPVK7DgTVFiiP0ZW/eQkydWzwVMdHxrI= +cloud.google.com/go/cloudtasks v1.9.0/go.mod h1:w+EyLsVkLWHcOaqNEyvcKAsWp9p29dL6uL9Nst1cI7Y= +cloud.google.com/go/cloudtasks v1.10.0/go.mod h1:NDSoTLkZ3+vExFEWu2UJV1arUyzVDAiZtdWcsUyNwBs= +cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= +cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= +cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= +cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= +cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= +cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= +cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= +cloud.google.com/go/compute v1.12.0/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= +cloud.google.com/go/compute v1.12.1/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= +cloud.google.com/go/compute v1.13.0/go.mod h1:5aPTS0cUNMIc1CE546K+Th6weJUNQErARyZtRXDJ8GE= +cloud.google.com/go/compute v1.14.0/go.mod h1:YfLtxrj9sU4Yxv+sXzZkyPjEyPBZfXHUvjxega5vAdo= +cloud.google.com/go/compute v1.15.1/go.mod h1:bjjoF/NtFUrkD/urWfdHaKuOPDR5nWIs63rR+SXhcpA= +cloud.google.com/go/compute v1.18.0/go.mod h1:1X7yHxec2Ga+Ss6jPyjxRxpu2uu7PLgsOVXvgU0yacs= +cloud.google.com/go/compute v1.19.0/go.mod h1:rikpw2y+UMidAe9tISo04EHNOIf42RLYF/q8Bs93scU= +cloud.google.com/go/compute v1.19.3/go.mod h1:qxvISKp/gYnXkSAD1ppcSOveRAmzxicEv/JlizULFrI= +cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= +cloud.google.com/go/compute/metadata v0.1.0/go.mod h1:Z1VN+bulIf6bt4P/C37K4DyZYZEXYonfTBHHFPO/4UU= cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= +cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +cloud.google.com/go/contactcenterinsights v1.3.0/go.mod h1:Eu2oemoePuEFc/xKFPjbTuPSj0fYJcPls9TFlPNnHHY= +cloud.google.com/go/contactcenterinsights v1.4.0/go.mod h1:L2YzkGbPsv+vMQMCADxJoT9YiTTnSEd6fEvCeHTYVck= +cloud.google.com/go/contactcenterinsights v1.6.0/go.mod h1:IIDlT6CLcDoyv79kDv8iWxMSTZhLxSCofVV5W6YFM/w= +cloud.google.com/go/container v1.6.0/go.mod h1:Xazp7GjJSeUYo688S+6J5V+n/t+G5sKBTFkKNudGRxg= +cloud.google.com/go/container v1.7.0/go.mod h1:Dp5AHtmothHGX3DwwIHPgq45Y8KmNsgN3amoYfxVkLo= +cloud.google.com/go/container v1.13.1/go.mod h1:6wgbMPeQRw9rSnKBCAJXnds3Pzj03C4JHamr8asWKy4= +cloud.google.com/go/container v1.14.0/go.mod h1:3AoJMPhHfLDxLvrlVWaK57IXzaPnLaZq63WX59aQBfM= +cloud.google.com/go/container v1.15.0/go.mod h1:ft+9S0WGjAyjDggg5S06DXj+fHJICWg8L7isCQe9pQA= +cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= +cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= +cloud.google.com/go/containeranalysis v0.7.0/go.mod h1:9aUL+/vZ55P2CXfuZjS4UjQ9AgXoSw8Ts6lemfmxBxI= +cloud.google.com/go/containeranalysis v0.9.0/go.mod h1:orbOANbwk5Ejoom+s+DUCTTJ7IBdBQJDcSylAx/on9s= +cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= +cloud.google.com/go/datacatalog v1.5.0/go.mod h1:M7GPLNQeLfWqeIm3iuiruhPzkt65+Bx8dAKvScX8jvs= +cloud.google.com/go/datacatalog v1.6.0/go.mod h1:+aEyF8JKg+uXcIdAmmaMUmZ3q1b/lKLtXCmXdnc0lbc= +cloud.google.com/go/datacatalog v1.7.0/go.mod h1:9mEl4AuDYWw81UGc41HonIHH7/sn52H0/tc8f8ZbZIE= +cloud.google.com/go/datacatalog v1.8.0/go.mod h1:KYuoVOv9BM8EYz/4eMFxrr4DUKhGIOXxZoKYF5wdISM= +cloud.google.com/go/datacatalog v1.8.1/go.mod h1:RJ58z4rMp3gvETA465Vg+ag8BGgBdnRPEMMSTr5Uv+M= +cloud.google.com/go/datacatalog v1.12.0/go.mod h1:CWae8rFkfp6LzLumKOnmVh4+Zle4A3NXLzVJ1d1mRm0= +cloud.google.com/go/datacatalog v1.13.0/go.mod h1:E4Rj9a5ZtAxcQJlEBTLgMTphfP11/lNaAshpoBgemX8= +cloud.google.com/go/dataflow v0.6.0/go.mod h1:9QwV89cGoxjjSR9/r7eFDqqjtvbKxAK2BaYU6PVk9UM= +cloud.google.com/go/dataflow v0.7.0/go.mod h1:PX526vb4ijFMesO1o202EaUmouZKBpjHsTlCtB4parQ= +cloud.google.com/go/dataflow v0.8.0/go.mod h1:Rcf5YgTKPtQyYz8bLYhFoIV/vP39eL7fWNcSOyFfLJE= +cloud.google.com/go/dataform v0.3.0/go.mod h1:cj8uNliRlHpa6L3yVhDOBrUXH+BPAO1+KFMQQNSThKo= +cloud.google.com/go/dataform v0.4.0/go.mod h1:fwV6Y4Ty2yIFL89huYlEkwUPtS7YZinZbzzj5S9FzCE= +cloud.google.com/go/dataform v0.5.0/go.mod h1:GFUYRe8IBa2hcomWplodVmUx/iTL0FrsauObOM3Ipr0= +cloud.google.com/go/dataform v0.6.0/go.mod h1:QPflImQy33e29VuapFdf19oPbE4aYTJxr31OAPV+ulA= +cloud.google.com/go/dataform v0.7.0/go.mod h1:7NulqnVozfHvWUBpMDfKMUESr+85aJsC/2O0o3jWPDE= +cloud.google.com/go/datafusion v1.4.0/go.mod h1:1Zb6VN+W6ALo85cXnM1IKiPw+yQMKMhB9TsTSRDo/38= +cloud.google.com/go/datafusion v1.5.0/go.mod h1:Kz+l1FGHB0J+4XF2fud96WMmRiq/wj8N9u007vyXZ2w= +cloud.google.com/go/datafusion v1.6.0/go.mod h1:WBsMF8F1RhSXvVM8rCV3AeyWVxcC2xY6vith3iw3S+8= +cloud.google.com/go/datalabeling v0.5.0/go.mod h1:TGcJ0G2NzcsXSE/97yWjIZO0bXj0KbVlINXMG9ud42I= +cloud.google.com/go/datalabeling v0.6.0/go.mod h1:WqdISuk/+WIGeMkpw/1q7bK/tFEZxsrFJOJdY2bXvTQ= +cloud.google.com/go/datalabeling v0.7.0/go.mod h1:WPQb1y08RJbmpM3ww0CSUAGweL0SxByuW2E+FU+wXcM= +cloud.google.com/go/dataplex v1.3.0/go.mod h1:hQuRtDg+fCiFgC8j0zV222HvzFQdRd+SVX8gdmFcZzA= +cloud.google.com/go/dataplex v1.4.0/go.mod h1:X51GfLXEMVJ6UN47ESVqvlsRplbLhcsAt0kZCCKsU0A= +cloud.google.com/go/dataplex v1.5.2/go.mod h1:cVMgQHsmfRoI5KFYq4JtIBEUbYwc3c7tXmIDhRmNNVQ= +cloud.google.com/go/dataplex v1.6.0/go.mod h1:bMsomC/aEJOSpHXdFKFGQ1b0TDPIeL28nJObeO1ppRs= +cloud.google.com/go/dataproc v1.7.0/go.mod h1:CKAlMjII9H90RXaMpSxQ8EU6dQx6iAYNPcYPOkSbi8s= +cloud.google.com/go/dataproc v1.8.0/go.mod h1:5OW+zNAH0pMpw14JVrPONsxMQYMBqJuzORhIBfBn9uI= +cloud.google.com/go/dataproc v1.12.0/go.mod h1:zrF3aX0uV3ikkMz6z4uBbIKyhRITnxvr4i3IjKsKrw4= +cloud.google.com/go/dataqna v0.5.0/go.mod h1:90Hyk596ft3zUQ8NkFfvICSIfHFh1Bc7C4cK3vbhkeo= +cloud.google.com/go/dataqna v0.6.0/go.mod h1:1lqNpM7rqNLVgWBJyk5NF6Uen2PHym0jtVJonplVsDA= +cloud.google.com/go/dataqna v0.7.0/go.mod h1:Lx9OcIIeqCrw1a6KdO3/5KMP1wAmTc0slZWwP12Qq3c= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/datastore v1.10.0/go.mod h1:PC5UzAmDEkAmkfaknstTYbNpgE49HAgW2J1gcgUfmdM= +cloud.google.com/go/datastore v1.11.0/go.mod h1:TvGxBIHCS50u8jzG+AW/ppf87v1of8nwzFNgEZU1D3c= +cloud.google.com/go/datastream v1.2.0/go.mod h1:i/uTP8/fZwgATHS/XFu0TcNUhuA0twZxxQ3EyCUQMwo= +cloud.google.com/go/datastream v1.3.0/go.mod h1:cqlOX8xlyYF/uxhiKn6Hbv6WjwPPuI9W2M9SAXwaLLQ= +cloud.google.com/go/datastream v1.4.0/go.mod h1:h9dpzScPhDTs5noEMQVWP8Wx8AFBRyS0s8KWPx/9r0g= +cloud.google.com/go/datastream v1.5.0/go.mod h1:6TZMMNPwjUqZHBKPQ1wwXpb0d5VDVPl2/XoS5yi88q4= +cloud.google.com/go/datastream v1.6.0/go.mod h1:6LQSuswqLa7S4rPAOZFVjHIG3wJIjZcZrw8JDEDJuIs= +cloud.google.com/go/datastream v1.7.0/go.mod h1:uxVRMm2elUSPuh65IbZpzJNMbuzkcvu5CjMqVIUHrww= +cloud.google.com/go/deploy v1.4.0/go.mod h1:5Xghikd4VrmMLNaF6FiRFDlHb59VM59YoDQnOUdsH/c= +cloud.google.com/go/deploy v1.5.0/go.mod h1:ffgdD0B89tToyW/U/D2eL0jN2+IEV/3EMuXHA0l4r+s= +cloud.google.com/go/deploy v1.6.0/go.mod h1:f9PTHehG/DjCom3QH0cntOVRm93uGBDt2vKzAPwpXQI= +cloud.google.com/go/deploy v1.8.0/go.mod h1:z3myEJnA/2wnB4sgjqdMfgxCA0EqC3RBTNcVPs93mtQ= +cloud.google.com/go/dialogflow v1.15.0/go.mod h1:HbHDWs33WOGJgn6rfzBW1Kv807BE3O1+xGbn59zZWI4= +cloud.google.com/go/dialogflow v1.16.1/go.mod h1:po6LlzGfK+smoSmTBnbkIZY2w8ffjz/RcGSS+sh1el0= +cloud.google.com/go/dialogflow v1.17.0/go.mod h1:YNP09C/kXA1aZdBgC/VtXX74G/TKn7XVCcVumTflA+8= +cloud.google.com/go/dialogflow v1.18.0/go.mod h1:trO7Zu5YdyEuR+BhSNOqJezyFQ3aUzz0njv7sMx/iek= +cloud.google.com/go/dialogflow v1.19.0/go.mod h1:JVmlG1TwykZDtxtTXujec4tQ+D8SBFMoosgy+6Gn0s0= +cloud.google.com/go/dialogflow v1.29.0/go.mod h1:b+2bzMe+k1s9V+F2jbJwpHPzrnIyHihAdRFMtn2WXuM= +cloud.google.com/go/dialogflow v1.31.0/go.mod h1:cuoUccuL1Z+HADhyIA7dci3N5zUssgpBJmCzI6fNRB4= +cloud.google.com/go/dialogflow v1.32.0/go.mod h1:jG9TRJl8CKrDhMEcvfcfFkkpp8ZhgPz3sBGmAUYJ2qE= +cloud.google.com/go/dlp v1.6.0/go.mod h1:9eyB2xIhpU0sVwUixfBubDoRwP+GjeUoxxeueZmqvmM= +cloud.google.com/go/dlp v1.7.0/go.mod h1:68ak9vCiMBjbasxeVD17hVPxDEck+ExiHavX8kiHG+Q= +cloud.google.com/go/dlp v1.9.0/go.mod h1:qdgmqgTyReTz5/YNSSuueR8pl7hO0o9bQ39ZhtgkWp4= +cloud.google.com/go/documentai v1.7.0/go.mod h1:lJvftZB5NRiFSX4moiye1SMxHx0Bc3x1+p9e/RfXYiU= +cloud.google.com/go/documentai v1.8.0/go.mod h1:xGHNEB7CtsnySCNrCFdCyyMz44RhFEEX2Q7UD0c5IhU= +cloud.google.com/go/documentai v1.9.0/go.mod h1:FS5485S8R00U10GhgBC0aNGrJxBP8ZVpEeJ7PQDZd6k= +cloud.google.com/go/documentai v1.10.0/go.mod h1:vod47hKQIPeCfN2QS/jULIvQTugbmdc0ZvxxfQY1bg4= +cloud.google.com/go/documentai v1.16.0/go.mod h1:o0o0DLTEZ+YnJZ+J4wNfTxmDVyrkzFvttBXXtYRMHkM= +cloud.google.com/go/documentai v1.18.0/go.mod h1:F6CK6iUH8J81FehpskRmhLq/3VlwQvb7TvwOceQ2tbs= +cloud.google.com/go/domains v0.6.0/go.mod h1:T9Rz3GasrpYk6mEGHh4rymIhjlnIuB4ofT1wTxDeT4Y= +cloud.google.com/go/domains v0.7.0/go.mod h1:PtZeqS1xjnXuRPKE/88Iru/LdfoRyEHYA9nFQf4UKpg= +cloud.google.com/go/domains v0.8.0/go.mod h1:M9i3MMDzGFXsydri9/vW+EWz9sWb4I6WyHqdlAk0idE= +cloud.google.com/go/edgecontainer v0.1.0/go.mod h1:WgkZ9tp10bFxqO8BLPqv2LlfmQF1X8lZqwW4r1BTajk= +cloud.google.com/go/edgecontainer v0.2.0/go.mod h1:RTmLijy+lGpQ7BXuTDa4C4ssxyXT34NIuHIgKuP4s5w= +cloud.google.com/go/edgecontainer v0.3.0/go.mod h1:FLDpP4nykgwwIfcLt6zInhprzw0lEi2P1fjO6Ie0qbc= +cloud.google.com/go/edgecontainer v1.0.0/go.mod h1:cttArqZpBB2q58W/upSG++ooo6EsblxDIolxa3jSjbY= +cloud.google.com/go/errorreporting v0.3.0/go.mod h1:xsP2yaAp+OAW4OIm60An2bbLpqIhKXdWR/tawvl7QzU= +cloud.google.com/go/essentialcontacts v1.3.0/go.mod h1:r+OnHa5jfj90qIfZDO/VztSFqbQan7HV75p8sA+mdGI= +cloud.google.com/go/essentialcontacts v1.4.0/go.mod h1:8tRldvHYsmnBCHdFpvU+GL75oWiBKl80BiqlFh9tp+8= +cloud.google.com/go/essentialcontacts v1.5.0/go.mod h1:ay29Z4zODTuwliK7SnX8E86aUF2CTzdNtvv42niCX0M= +cloud.google.com/go/eventarc v1.7.0/go.mod h1:6ctpF3zTnaQCxUjHUdcfgcA1A2T309+omHZth7gDfmc= +cloud.google.com/go/eventarc v1.8.0/go.mod h1:imbzxkyAU4ubfsaKYdQg04WS1NvncblHEup4kvF+4gw= +cloud.google.com/go/eventarc v1.10.0/go.mod h1:u3R35tmZ9HvswGRBnF48IlYgYeBcPUCjkr4BTdem2Kw= +cloud.google.com/go/eventarc v1.11.0/go.mod h1:PyUjsUKPWoRBCHeOxZd/lbOOjahV41icXyUY5kSTvVY= +cloud.google.com/go/filestore v1.3.0/go.mod h1:+qbvHGvXU1HaKX2nD0WEPo92TP/8AQuCVEBXNY9z0+w= +cloud.google.com/go/filestore v1.4.0/go.mod h1:PaG5oDfo9r224f8OYXURtAsY+Fbyq/bLYoINEK8XQAI= +cloud.google.com/go/filestore v1.5.0/go.mod h1:FqBXDWBp4YLHqRnVGveOkHDf8svj9r5+mUDLupOWEDs= +cloud.google.com/go/filestore v1.6.0/go.mod h1:di5unNuss/qfZTw2U9nhFqo8/ZDSc466dre85Kydllg= +cloud.google.com/go/firestore v1.9.0/go.mod h1:HMkjKHNTtRyZNiMzu7YAsLr9K3X2udY2AMwDaMEQiiE= +cloud.google.com/go/functions v1.6.0/go.mod h1:3H1UA3qiIPRWD7PeZKLvHZ9SaQhR26XIJcC0A5GbvAk= +cloud.google.com/go/functions v1.7.0/go.mod h1:+d+QBcWM+RsrgZfV9xo6KfA1GlzJfxcfZcRPEhDDfzg= +cloud.google.com/go/functions v1.8.0/go.mod h1:RTZ4/HsQjIqIYP9a9YPbU+QFoQsAlYgrwOXJWHn1POY= +cloud.google.com/go/functions v1.9.0/go.mod h1:Y+Dz8yGguzO3PpIjhLTbnqV1CWmgQ5UwtlpzoyquQ08= +cloud.google.com/go/functions v1.10.0/go.mod h1:0D3hEOe3DbEvCXtYOZHQZmD+SzYsi1YbI7dGvHfldXw= +cloud.google.com/go/functions v1.12.0/go.mod h1:AXWGrF3e2C/5ehvwYo/GH6O5s09tOPksiKhz+hH8WkA= +cloud.google.com/go/functions v1.13.0/go.mod h1:EU4O007sQm6Ef/PwRsI8N2umygGqPBS/IZQKBQBcJ3c= +cloud.google.com/go/gaming v1.5.0/go.mod h1:ol7rGcxP/qHTRQE/RO4bxkXq+Fix0j6D4LFPzYTIrDM= +cloud.google.com/go/gaming v1.6.0/go.mod h1:YMU1GEvA39Qt3zWGyAVA9bpYz/yAhTvaQ1t2sK4KPUA= +cloud.google.com/go/gaming v1.7.0/go.mod h1:LrB8U7MHdGgFG851iHAfqUdLcKBdQ55hzXy9xBJz0+w= +cloud.google.com/go/gaming v1.8.0/go.mod h1:xAqjS8b7jAVW0KFYeRUxngo9My3f33kFmua++Pi+ggM= +cloud.google.com/go/gaming v1.9.0/go.mod h1:Fc7kEmCObylSWLO334NcO+O9QMDyz+TKC4v1D7X+Bc0= +cloud.google.com/go/gkebackup v0.2.0/go.mod h1:XKvv/4LfG829/B8B7xRkk8zRrOEbKtEam6yNfuQNH60= +cloud.google.com/go/gkebackup v0.3.0/go.mod h1:n/E671i1aOQvUxT541aTkCwExO/bTer2HDlj4TsBRAo= +cloud.google.com/go/gkebackup v0.4.0/go.mod h1:byAyBGUwYGEEww7xsbnUTBHIYcOPy/PgUWUtOeRm9Vg= +cloud.google.com/go/gkeconnect v0.5.0/go.mod h1:c5lsNAg5EwAy7fkqX/+goqFsU1Da/jQFqArp+wGNr/o= +cloud.google.com/go/gkeconnect v0.6.0/go.mod h1:Mln67KyU/sHJEBY8kFZ0xTeyPtzbq9StAVvEULYK16A= +cloud.google.com/go/gkeconnect v0.7.0/go.mod h1:SNfmVqPkaEi3bF/B3CNZOAYPYdg7sU+obZ+QTky2Myw= +cloud.google.com/go/gkehub v0.9.0/go.mod h1:WYHN6WG8w9bXU0hqNxt8rm5uxnk8IH+lPY9J2TV7BK0= +cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y977wO+hBH0= +cloud.google.com/go/gkehub v0.11.0/go.mod h1:JOWHlmN+GHyIbuWQPl47/C2RFhnFKH38jH9Ascu3n0E= +cloud.google.com/go/gkehub v0.12.0/go.mod h1:djiIwwzTTBrF5NaXCGv3mf7klpEMcST17VBTVVDcuaw= +cloud.google.com/go/gkemulticloud v0.3.0/go.mod h1:7orzy7O0S+5kq95e4Hpn7RysVA7dPs8W/GgfUtsPbrA= +cloud.google.com/go/gkemulticloud v0.4.0/go.mod h1:E9gxVBnseLWCk24ch+P9+B2CoDFJZTyIgLKSalC7tuI= +cloud.google.com/go/gkemulticloud v0.5.0/go.mod h1:W0JDkiyi3Tqh0TJr//y19wyb1yf8llHVto2Htf2Ja3Y= +cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= +cloud.google.com/go/gsuiteaddons v1.3.0/go.mod h1:EUNK/J1lZEZO8yPtykKxLXI6JSVN2rg9bN8SXOa0bgM= +cloud.google.com/go/gsuiteaddons v1.4.0/go.mod h1:rZK5I8hht7u7HxFQcFei0+AtfS9uSushomRlg+3ua1o= +cloud.google.com/go/gsuiteaddons v1.5.0/go.mod h1:TFCClYLd64Eaa12sFVmUyG62tk4mdIsI7pAnSXRkcFo= +cloud.google.com/go/iam v0.1.0/go.mod h1:vcUNEa0pEm0qRVpmWepWaFMIAI8/hjB9mO8rNCJtF6c= +cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= +cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= +cloud.google.com/go/iam v0.6.0/go.mod h1:+1AH33ueBne5MzYccyMHtEKqLE4/kJOibtffMHDMFMc= +cloud.google.com/go/iam v0.7.0/go.mod h1:H5Br8wRaDGNc8XP3keLc4unfUUZeyH3Sfl9XpQEYOeg= +cloud.google.com/go/iam v0.8.0/go.mod h1:lga0/y3iH6CX7sYqypWJ33hf7kkfXJag67naqGESjkE= +cloud.google.com/go/iam v0.11.0/go.mod h1:9PiLDanza5D+oWFZiH1uG+RnRCfEGKoyl6yo4cgWZGY= +cloud.google.com/go/iam v0.12.0/go.mod h1:knyHGviacl11zrtZUoDuYpDgLjvr28sLQaG0YB2GYAY= +cloud.google.com/go/iam v0.13.0/go.mod h1:ljOg+rcNfzZ5d6f1nAUJ8ZIxOaZUVoS14bKCtaLZ/D0= +cloud.google.com/go/iap v1.4.0/go.mod h1:RGFwRJdihTINIe4wZ2iCP0zF/qu18ZwyKxrhMhygBEc= +cloud.google.com/go/iap v1.5.0/go.mod h1:UH/CGgKd4KyohZL5Pt0jSKE4m3FR51qg6FKQ/z/Ix9A= +cloud.google.com/go/iap v1.6.0/go.mod h1:NSuvI9C/j7UdjGjIde7t7HBz+QTwBcapPE07+sSRcLk= +cloud.google.com/go/iap v1.7.0/go.mod h1:beqQx56T9O1G1yNPph+spKpNibDlYIiIixiqsQXxLIo= +cloud.google.com/go/iap v1.7.1/go.mod h1:WapEwPc7ZxGt2jFGB/C/bm+hP0Y6NXzOYGjpPnmMS74= +cloud.google.com/go/ids v1.1.0/go.mod h1:WIuwCaYVOzHIj2OhN9HAwvW+DBdmUAdcWlFxRl+KubM= +cloud.google.com/go/ids v1.2.0/go.mod h1:5WXvp4n25S0rA/mQWAg1YEEBBq6/s+7ml1RDCW1IrcY= +cloud.google.com/go/ids v1.3.0/go.mod h1:JBdTYwANikFKaDP6LtW5JAi4gubs57SVNQjemdt6xV4= +cloud.google.com/go/iot v1.3.0/go.mod h1:r7RGh2B61+B8oz0AGE+J72AhA0G7tdXItODWsaA2oLs= +cloud.google.com/go/iot v1.4.0/go.mod h1:dIDxPOn0UvNDUMD8Ger7FIaTuvMkj+aGk94RPP0iV+g= +cloud.google.com/go/iot v1.5.0/go.mod h1:mpz5259PDl3XJthEmh9+ap0affn/MqNSP4My77Qql9o= +cloud.google.com/go/iot v1.6.0/go.mod h1:IqdAsmE2cTYYNO1Fvjfzo9po179rAtJeVGUvkLN3rLE= +cloud.google.com/go/kms v1.4.0/go.mod h1:fajBHndQ+6ubNw6Ss2sSd+SWvjL26RNo/dr7uxsnnOA= +cloud.google.com/go/kms v1.5.0/go.mod h1:QJS2YY0eJGBg3mnDfuaCyLauWwBJiHRboYxJ++1xJNg= +cloud.google.com/go/kms v1.6.0/go.mod h1:Jjy850yySiasBUDi6KFUwUv2n1+o7QZFyuUJg6OgjA0= +cloud.google.com/go/kms v1.8.0/go.mod h1:4xFEhYFqvW+4VMELtZyxomGSYtSQKzM178ylFW4jMAg= +cloud.google.com/go/kms v1.9.0/go.mod h1:qb1tPTgfF9RQP8e1wq4cLFErVuTJv7UsSC915J8dh3w= +cloud.google.com/go/kms v1.10.0/go.mod h1:ng3KTUtQQU9bPX3+QGLsflZIHlkbn8amFAMY63m8d24= +cloud.google.com/go/kms v1.10.1/go.mod h1:rIWk/TryCkR59GMC3YtHtXeLzd634lBbKenvyySAyYI= +cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= +cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= +cloud.google.com/go/language v1.7.0/go.mod h1:DJ6dYN/W+SQOjF8e1hLQXMF21AkH2w9wiPzPCJa2MIE= +cloud.google.com/go/language v1.8.0/go.mod h1:qYPVHf7SPoNNiCL2Dr0FfEFNil1qi3pQEyygwpgVKB8= +cloud.google.com/go/language v1.9.0/go.mod h1:Ns15WooPM5Ad/5no/0n81yUetis74g3zrbeJBE+ptUY= +cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= +cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08= +cloud.google.com/go/lifesciences v0.8.0/go.mod h1:lFxiEOMqII6XggGbOnKiyZ7IBwoIqA84ClvoezaA/bo= +cloud.google.com/go/logging v1.6.1/go.mod h1:5ZO0mHHbvm8gEmeEUHrmDlTDSu5imF6MUP9OfilNXBw= +cloud.google.com/go/logging v1.7.0/go.mod h1:3xjP2CjkM3ZkO73aj4ASA5wRPGGCRrPIAeNqVNkzY8M= +cloud.google.com/go/longrunning v0.1.1/go.mod h1:UUFxuDWkv22EuY93jjmDMFT5GPQKeFVJBIF6QlTqdsE= +cloud.google.com/go/longrunning v0.3.0/go.mod h1:qth9Y41RRSUE69rDcOn6DdK3HfQfsUI0YSmW3iIlLJc= +cloud.google.com/go/longrunning v0.4.1/go.mod h1:4iWDqhBZ70CvZ6BfETbvam3T8FMvLK+eFj0E6AaRQTo= +cloud.google.com/go/managedidentities v1.3.0/go.mod h1:UzlW3cBOiPrzucO5qWkNkh0w33KFtBJU281hacNvsdE= +cloud.google.com/go/managedidentities v1.4.0/go.mod h1:NWSBYbEMgqmbZsLIyKvxrYbtqOsxY1ZrGM+9RgDqInM= +cloud.google.com/go/managedidentities v1.5.0/go.mod h1:+dWcZ0JlUmpuxpIDfyP5pP5y0bLdRwOS4Lp7gMni/LA= +cloud.google.com/go/maps v0.1.0/go.mod h1:BQM97WGyfw9FWEmQMpZ5T6cpovXXSd1cGmFma94eubI= +cloud.google.com/go/maps v0.6.0/go.mod h1:o6DAMMfb+aINHz/p/jbcY+mYeXBoZoxTfdSQ8VAJaCw= +cloud.google.com/go/maps v0.7.0/go.mod h1:3GnvVl3cqeSvgMcpRlQidXsPYuDGQ8naBis7MVzpXsY= +cloud.google.com/go/mediatranslation v0.5.0/go.mod h1:jGPUhGTybqsPQn91pNXw0xVHfuJ3leR1wj37oU3y1f4= +cloud.google.com/go/mediatranslation v0.6.0/go.mod h1:hHdBCTYNigsBxshbznuIMFNe5QXEowAuNmmC7h8pu5w= +cloud.google.com/go/mediatranslation v0.7.0/go.mod h1:LCnB/gZr90ONOIQLgSXagp8XUW1ODs2UmUMvcgMfI2I= +cloud.google.com/go/memcache v1.4.0/go.mod h1:rTOfiGZtJX1AaFUrOgsMHX5kAzaTQ8azHiuDoTPzNsE= +cloud.google.com/go/memcache v1.5.0/go.mod h1:dk3fCK7dVo0cUU2c36jKb4VqKPS22BTkf81Xq617aWM= +cloud.google.com/go/memcache v1.6.0/go.mod h1:XS5xB0eQZdHtTuTF9Hf8eJkKtR3pVRCcvJwtm68T3rA= +cloud.google.com/go/memcache v1.7.0/go.mod h1:ywMKfjWhNtkQTxrWxCkCFkoPjLHPW6A7WOTVI8xy3LY= +cloud.google.com/go/memcache v1.9.0/go.mod h1:8oEyzXCu+zo9RzlEaEjHl4KkgjlNDaXbCQeQWlzNFJM= +cloud.google.com/go/metastore v1.5.0/go.mod h1:2ZNrDcQwghfdtCwJ33nM0+GrBGlVuh8rakL3vdPY3XY= +cloud.google.com/go/metastore v1.6.0/go.mod h1:6cyQTls8CWXzk45G55x57DVQ9gWg7RiH65+YgPsNh9s= +cloud.google.com/go/metastore v1.7.0/go.mod h1:s45D0B4IlsINu87/AsWiEVYbLaIMeUSoxlKKDqBGFS8= +cloud.google.com/go/metastore v1.8.0/go.mod h1:zHiMc4ZUpBiM7twCIFQmJ9JMEkDSyZS9U12uf7wHqSI= +cloud.google.com/go/metastore v1.10.0/go.mod h1:fPEnH3g4JJAk+gMRnrAnoqyv2lpUCqJPWOodSaf45Eo= +cloud.google.com/go/monitoring v1.7.0/go.mod h1:HpYse6kkGo//7p6sT0wsIC6IBDET0RhIsnmlA53dvEk= +cloud.google.com/go/monitoring v1.8.0/go.mod h1:E7PtoMJ1kQXWxPjB6mv2fhC5/15jInuulFdYYtlcvT4= +cloud.google.com/go/monitoring v1.12.0/go.mod h1:yx8Jj2fZNEkL/GYZyTLS4ZtZEZN8WtDEiEqG4kLK50w= +cloud.google.com/go/monitoring v1.13.0/go.mod h1:k2yMBAB1H9JT/QETjNkgdCGD9bPF712XiLTVr+cBrpw= +cloud.google.com/go/networkconnectivity v1.4.0/go.mod h1:nOl7YL8odKyAOtzNX73/M5/mGZgqqMeryi6UPZTk/rA= +cloud.google.com/go/networkconnectivity v1.5.0/go.mod h1:3GzqJx7uhtlM3kln0+x5wyFvuVH1pIBJjhCpjzSt75o= +cloud.google.com/go/networkconnectivity v1.6.0/go.mod h1:OJOoEXW+0LAxHh89nXd64uGG+FbQoeH8DtxCHVOMlaM= +cloud.google.com/go/networkconnectivity v1.7.0/go.mod h1:RMuSbkdbPwNMQjB5HBWD5MpTBnNm39iAVpC3TmsExt8= +cloud.google.com/go/networkconnectivity v1.10.0/go.mod h1:UP4O4sWXJG13AqrTdQCD9TnLGEbtNRqjuaaA7bNjF5E= +cloud.google.com/go/networkconnectivity v1.11.0/go.mod h1:iWmDD4QF16VCDLXUqvyspJjIEtBR/4zq5hwnY2X3scM= +cloud.google.com/go/networkmanagement v1.4.0/go.mod h1:Q9mdLLRn60AsOrPc8rs8iNV6OHXaGcDdsIQe1ohekq8= +cloud.google.com/go/networkmanagement v1.5.0/go.mod h1:ZnOeZ/evzUdUsnvRt792H0uYEnHQEMaz+REhhzJRcf4= +cloud.google.com/go/networkmanagement v1.6.0/go.mod h1:5pKPqyXjB/sgtvB5xqOemumoQNB7y95Q7S+4rjSOPYY= +cloud.google.com/go/networksecurity v0.5.0/go.mod h1:xS6fOCoqpVC5zx15Z/MqkfDwH4+m/61A3ODiDV1xmiQ= +cloud.google.com/go/networksecurity v0.6.0/go.mod h1:Q5fjhTr9WMI5mbpRYEbiexTzROf7ZbDzvzCrNl14nyU= +cloud.google.com/go/networksecurity v0.7.0/go.mod h1:mAnzoxx/8TBSyXEeESMy9OOYwo1v+gZ5eMRnsT5bC8k= +cloud.google.com/go/networksecurity v0.8.0/go.mod h1:B78DkqsxFG5zRSVuwYFRZ9Xz8IcQ5iECsNrPn74hKHU= +cloud.google.com/go/notebooks v1.2.0/go.mod h1:9+wtppMfVPUeJ8fIWPOq1UnATHISkGXGqTkxeieQ6UY= +cloud.google.com/go/notebooks v1.3.0/go.mod h1:bFR5lj07DtCPC7YAAJ//vHskFBxA5JzYlH68kXVdk34= +cloud.google.com/go/notebooks v1.4.0/go.mod h1:4QPMngcwmgb6uw7Po99B2xv5ufVoIQ7nOGDyL4P8AgA= +cloud.google.com/go/notebooks v1.5.0/go.mod h1:q8mwhnP9aR8Hpfnrc5iN5IBhrXUy8S2vuYs+kBJ/gu0= +cloud.google.com/go/notebooks v1.7.0/go.mod h1:PVlaDGfJgj1fl1S3dUwhFMXFgfYGhYQt2164xOMONmE= +cloud.google.com/go/notebooks v1.8.0/go.mod h1:Lq6dYKOYOWUCTvw5t2q1gp1lAp0zxAxRycayS0iJcqQ= +cloud.google.com/go/optimization v1.1.0/go.mod h1:5po+wfvX5AQlPznyVEZjGJTMr4+CAkJf2XSTQOOl9l4= +cloud.google.com/go/optimization v1.2.0/go.mod h1:Lr7SOHdRDENsh+WXVmQhQTrzdu9ybg0NecjHidBq6xs= +cloud.google.com/go/optimization v1.3.1/go.mod h1:IvUSefKiwd1a5p0RgHDbWCIbDFgKuEdB+fPPuP0IDLI= +cloud.google.com/go/orchestration v1.3.0/go.mod h1:Sj5tq/JpWiB//X/q3Ngwdl5K7B7Y0KZ7bfv0wL6fqVA= +cloud.google.com/go/orchestration v1.4.0/go.mod h1:6W5NLFWs2TlniBphAViZEVhrXRSMgUGDfW7vrWKvsBk= +cloud.google.com/go/orchestration v1.6.0/go.mod h1:M62Bevp7pkxStDfFfTuCOaXgaaqRAga1yKyoMtEoWPQ= +cloud.google.com/go/orgpolicy v1.4.0/go.mod h1:xrSLIV4RePWmP9P3tBl8S93lTmlAxjm06NSm2UTmKvE= +cloud.google.com/go/orgpolicy v1.5.0/go.mod h1:hZEc5q3wzwXJaKrsx5+Ewg0u1LxJ51nNFlext7Tanwc= +cloud.google.com/go/orgpolicy v1.10.0/go.mod h1:w1fo8b7rRqlXlIJbVhOMPrwVljyuW5mqssvBtU18ONc= +cloud.google.com/go/osconfig v1.7.0/go.mod h1:oVHeCeZELfJP7XLxcBGTMBvRO+1nQ5tFG9VQTmYS2Fs= +cloud.google.com/go/osconfig v1.8.0/go.mod h1:EQqZLu5w5XA7eKizepumcvWx+m8mJUhEwiPqWiZeEdg= +cloud.google.com/go/osconfig v1.9.0/go.mod h1:Yx+IeIZJ3bdWmzbQU4fxNl8xsZ4amB+dygAwFPlvnNo= +cloud.google.com/go/osconfig v1.10.0/go.mod h1:uMhCzqC5I8zfD9zDEAfvgVhDS8oIjySWh+l4WK6GnWw= +cloud.google.com/go/osconfig v1.11.0/go.mod h1:aDICxrur2ogRd9zY5ytBLV89KEgT2MKB2L/n6x1ooPw= +cloud.google.com/go/oslogin v1.4.0/go.mod h1:YdgMXWRaElXz/lDk1Na6Fh5orF7gvmJ0FGLIs9LId4E= +cloud.google.com/go/oslogin v1.5.0/go.mod h1:D260Qj11W2qx/HVF29zBg+0fd6YCSjSqLUkY/qEenQU= +cloud.google.com/go/oslogin v1.6.0/go.mod h1:zOJ1O3+dTU8WPlGEkFSh7qeHPPSoxrcMbbK1Nm2iX70= +cloud.google.com/go/oslogin v1.7.0/go.mod h1:e04SN0xO1UNJ1M5GP0vzVBFicIe4O53FOfcixIqTyXo= +cloud.google.com/go/oslogin v1.9.0/go.mod h1:HNavntnH8nzrn8JCTT5fj18FuJLFJc4NaZJtBnQtKFs= +cloud.google.com/go/phishingprotection v0.5.0/go.mod h1:Y3HZknsK9bc9dMi+oE8Bim0lczMU6hrX0UpADuMefr0= +cloud.google.com/go/phishingprotection v0.6.0/go.mod h1:9Y3LBLgy0kDTcYET8ZH3bq/7qni15yVUoAxiFxnlSUA= +cloud.google.com/go/phishingprotection v0.7.0/go.mod h1:8qJI4QKHoda/sb/7/YmMQ2omRLSLYSu9bU0EKCNI+Lk= +cloud.google.com/go/policytroubleshooter v1.3.0/go.mod h1:qy0+VwANja+kKrjlQuOzmlvscn4RNsAc0e15GGqfMxg= +cloud.google.com/go/policytroubleshooter v1.4.0/go.mod h1:DZT4BcRw3QoO8ota9xw/LKtPa8lKeCByYeKTIf/vxdE= +cloud.google.com/go/policytroubleshooter v1.5.0/go.mod h1:Rz1WfV+1oIpPdN2VvvuboLVRsB1Hclg3CKQ53j9l8vw= +cloud.google.com/go/policytroubleshooter v1.6.0/go.mod h1:zYqaPTsmfvpjm5ULxAyD/lINQxJ0DDsnWOP/GZ7xzBc= +cloud.google.com/go/privatecatalog v0.5.0/go.mod h1:XgosMUvvPyxDjAVNDYxJ7wBW8//hLDDYmnsNcMGq1K0= +cloud.google.com/go/privatecatalog v0.6.0/go.mod h1:i/fbkZR0hLN29eEWiiwue8Pb+GforiEIBnV9yrRUOKI= +cloud.google.com/go/privatecatalog v0.7.0/go.mod h1:2s5ssIFO69F5csTXcwBP7NPFTZvps26xGzvQ2PQaBYg= +cloud.google.com/go/privatecatalog v0.8.0/go.mod h1:nQ6pfaegeDAq/Q5lrfCQzQLhubPiZhSaNhIgfJlnIXs= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/pubsub v1.26.0/go.mod h1:QgBH3U/jdJy/ftjPhTkyXNj543Tin1pRYcdcPRnFIRI= +cloud.google.com/go/pubsub v1.27.1/go.mod h1:hQN39ymbV9geqBnfQq6Xf63yNhUAhv9CZhzp5O6qsW0= +cloud.google.com/go/pubsub v1.28.0/go.mod h1:vuXFpwaVoIPQMGXqRyUQigu/AX1S3IWugR9xznmcXX8= +cloud.google.com/go/pubsub v1.30.0/go.mod h1:qWi1OPS0B+b5L+Sg6Gmc9zD1Y+HaM0MdUr7LsupY1P4= +cloud.google.com/go/pubsublite v1.5.0/go.mod h1:xapqNQ1CuLfGi23Yda/9l4bBCKz/wC3KIJ5gKcxveZg= +cloud.google.com/go/pubsublite v1.6.0/go.mod h1:1eFCS0U11xlOuMFV/0iBqw3zP12kddMeCbj/F3FSj9k= +cloud.google.com/go/pubsublite v1.7.0/go.mod h1:8hVMwRXfDfvGm3fahVbtDbiLePT3gpoiJYJY+vxWxVM= +cloud.google.com/go/recaptchaenterprise v1.3.1/go.mod h1:OdD+q+y4XGeAlxRaMn1Y7/GveP6zmq76byL6tjPE7d4= +cloud.google.com/go/recaptchaenterprise/v2 v2.1.0/go.mod h1:w9yVqajwroDNTfGuhmOjPDN//rZGySaf6PtFVcSCa7o= +cloud.google.com/go/recaptchaenterprise/v2 v2.2.0/go.mod h1:/Zu5jisWGeERrd5HnlS3EUGb/D335f9k51B/FVil0jk= +cloud.google.com/go/recaptchaenterprise/v2 v2.3.0/go.mod h1:O9LwGCjrhGHBQET5CA7dd5NwwNQUErSgEDit1DLNTdo= +cloud.google.com/go/recaptchaenterprise/v2 v2.4.0/go.mod h1:Am3LHfOuBstrLrNCBrlI5sbwx9LBg3te2N6hGvHn2mE= +cloud.google.com/go/recaptchaenterprise/v2 v2.5.0/go.mod h1:O8LzcHXN3rz0j+LBC91jrwI3R+1ZSZEWrfL7XHgNo9U= +cloud.google.com/go/recaptchaenterprise/v2 v2.6.0/go.mod h1:RPauz9jeLtB3JVzg6nCbe12qNoaa8pXc4d/YukAmcnA= +cloud.google.com/go/recaptchaenterprise/v2 v2.7.0/go.mod h1:19wVj/fs5RtYtynAPJdDTb69oW0vNHYDBTbB4NvMD9c= +cloud.google.com/go/recommendationengine v0.5.0/go.mod h1:E5756pJcVFeVgaQv3WNpImkFP8a+RptV6dDLGPILjvg= +cloud.google.com/go/recommendationengine v0.6.0/go.mod h1:08mq2umu9oIqc7tDy8sx+MNJdLG0fUi3vaSVbztHgJ4= +cloud.google.com/go/recommendationengine v0.7.0/go.mod h1:1reUcE3GIu6MeBz/h5xZJqNLuuVjNg1lmWMPyjatzac= +cloud.google.com/go/recommender v1.5.0/go.mod h1:jdoeiBIVrJe9gQjwd759ecLJbxCDED4A6p+mqoqDvTg= +cloud.google.com/go/recommender v1.6.0/go.mod h1:+yETpm25mcoiECKh9DEScGzIRyDKpZ0cEhWGo+8bo+c= +cloud.google.com/go/recommender v1.7.0/go.mod h1:XLHs/W+T8olwlGOgfQenXBTbIseGclClff6lhFVe9Bs= +cloud.google.com/go/recommender v1.8.0/go.mod h1:PkjXrTT05BFKwxaUxQmtIlrtj0kph108r02ZZQ5FE70= +cloud.google.com/go/recommender v1.9.0/go.mod h1:PnSsnZY7q+VL1uax2JWkt/UegHssxjUVVCrX52CuEmQ= +cloud.google.com/go/redis v1.7.0/go.mod h1:V3x5Jq1jzUcg+UNsRvdmsfuFnit1cfe3Z/PGyq/lm4Y= +cloud.google.com/go/redis v1.8.0/go.mod h1:Fm2szCDavWzBk2cDKxrkmWBqoCiL1+Ctwq7EyqBCA/A= +cloud.google.com/go/redis v1.9.0/go.mod h1:HMYQuajvb2D0LvMgZmLDZW8V5aOC/WxstZHiy4g8OiA= +cloud.google.com/go/redis v1.10.0/go.mod h1:ThJf3mMBQtW18JzGgh41/Wld6vnDDc/F/F35UolRZPM= +cloud.google.com/go/redis v1.11.0/go.mod h1:/X6eicana+BWcUda5PpwZC48o37SiFVTFSs0fWAJ7uQ= +cloud.google.com/go/resourcemanager v1.3.0/go.mod h1:bAtrTjZQFJkiWTPDb1WBjzvc6/kifjj4QBYuKCCoqKA= +cloud.google.com/go/resourcemanager v1.4.0/go.mod h1:MwxuzkumyTX7/a3n37gmsT3py7LIXwrShilPh3P1tR0= +cloud.google.com/go/resourcemanager v1.5.0/go.mod h1:eQoXNAiAvCf5PXxWxXjhKQoTMaUSNrEfg+6qdf/wots= +cloud.google.com/go/resourcemanager v1.6.0/go.mod h1:YcpXGRs8fDzcUl1Xw8uOVmI8JEadvhRIkoXXUNVYcVo= +cloud.google.com/go/resourcemanager v1.7.0/go.mod h1:HlD3m6+bwhzj9XCouqmeiGuni95NTrExfhoSrkC/3EI= +cloud.google.com/go/resourcesettings v1.3.0/go.mod h1:lzew8VfESA5DQ8gdlHwMrqZs1S9V87v3oCnKCWoOuQU= +cloud.google.com/go/resourcesettings v1.4.0/go.mod h1:ldiH9IJpcrlC3VSuCGvjR5of/ezRrOxFtpJoJo5SmXg= +cloud.google.com/go/resourcesettings v1.5.0/go.mod h1:+xJF7QSG6undsQDfsCJyqWXyBwUoJLhetkRMDRnIoXA= +cloud.google.com/go/retail v1.8.0/go.mod h1:QblKS8waDmNUhghY2TI9O3JLlFk8jybHeV4BF19FrE4= +cloud.google.com/go/retail v1.9.0/go.mod h1:g6jb6mKuCS1QKnH/dpu7isX253absFl6iE92nHwlBUY= +cloud.google.com/go/retail v1.10.0/go.mod h1:2gDk9HsL4HMS4oZwz6daui2/jmKvqShXKQuB2RZ+cCc= +cloud.google.com/go/retail v1.11.0/go.mod h1:MBLk1NaWPmh6iVFSz9MeKG/Psyd7TAgm6y/9L2B4x9Y= +cloud.google.com/go/retail v1.12.0/go.mod h1:UMkelN/0Z8XvKymXFbD4EhFJlYKRx1FGhQkVPU5kF14= +cloud.google.com/go/run v0.2.0/go.mod h1:CNtKsTA1sDcnqqIFR3Pb5Tq0usWxJJvsWOCPldRU3Do= +cloud.google.com/go/run v0.3.0/go.mod h1:TuyY1+taHxTjrD0ZFk2iAR+xyOXEA0ztb7U3UNA0zBo= +cloud.google.com/go/run v0.8.0/go.mod h1:VniEnuBwqjigv0A7ONfQUaEItaiCRVujlMqerPPiktM= +cloud.google.com/go/run v0.9.0/go.mod h1:Wwu+/vvg8Y+JUApMwEDfVfhetv30hCG4ZwDR/IXl2Qg= +cloud.google.com/go/scheduler v1.4.0/go.mod h1:drcJBmxF3aqZJRhmkHQ9b3uSSpQoltBPGPxGAWROx6s= +cloud.google.com/go/scheduler v1.5.0/go.mod h1:ri073ym49NW3AfT6DZi21vLZrG07GXr5p3H1KxN5QlI= +cloud.google.com/go/scheduler v1.6.0/go.mod h1:SgeKVM7MIwPn3BqtcBntpLyrIJftQISRrYB5ZtT+KOk= +cloud.google.com/go/scheduler v1.7.0/go.mod h1:jyCiBqWW956uBjjPMMuX09n3x37mtyPJegEWKxRsn44= +cloud.google.com/go/scheduler v1.8.0/go.mod h1:TCET+Y5Gp1YgHT8py4nlg2Sew8nUHMqcpousDgXJVQc= +cloud.google.com/go/scheduler v1.9.0/go.mod h1:yexg5t+KSmqu+njTIh3b7oYPheFtBWGcbVUYF1GGMIc= +cloud.google.com/go/secretmanager v1.6.0/go.mod h1:awVa/OXF6IiyaU1wQ34inzQNc4ISIDIrId8qE5QGgKA= +cloud.google.com/go/secretmanager v1.8.0/go.mod h1:hnVgi/bN5MYHd3Gt0SPuTPPp5ENina1/LxM+2W9U9J4= +cloud.google.com/go/secretmanager v1.9.0/go.mod h1:b71qH2l1yHmWQHt9LC80akm86mX8AL6X1MA01dW8ht4= +cloud.google.com/go/secretmanager v1.10.0/go.mod h1:MfnrdvKMPNra9aZtQFvBcvRU54hbPD8/HayQdlUgJpU= +cloud.google.com/go/security v1.5.0/go.mod h1:lgxGdyOKKjHL4YG3/YwIL2zLqMFCKs0UbQwgyZmfJl4= +cloud.google.com/go/security v1.7.0/go.mod h1:mZklORHl6Bg7CNnnjLH//0UlAlaXqiG7Lb9PsPXLfD0= +cloud.google.com/go/security v1.8.0/go.mod h1:hAQOwgmaHhztFhiQ41CjDODdWP0+AE1B3sX4OFlq+GU= +cloud.google.com/go/security v1.9.0/go.mod h1:6Ta1bO8LXI89nZnmnsZGp9lVoVWXqsVbIq/t9dzI+2Q= +cloud.google.com/go/security v1.10.0/go.mod h1:QtOMZByJVlibUT2h9afNDWRZ1G96gVywH8T5GUSb9IA= +cloud.google.com/go/security v1.12.0/go.mod h1:rV6EhrpbNHrrxqlvW0BWAIawFWq3X90SduMJdFwtLB8= +cloud.google.com/go/security v1.13.0/go.mod h1:Q1Nvxl1PAgmeW0y3HTt54JYIvUdtcpYKVfIB8AOMZ+0= +cloud.google.com/go/securitycenter v1.13.0/go.mod h1:cv5qNAqjY84FCN6Y9z28WlkKXyWsgLO832YiWwkCWcU= +cloud.google.com/go/securitycenter v1.14.0/go.mod h1:gZLAhtyKv85n52XYWt6RmeBdydyxfPeTrpToDPw4Auc= +cloud.google.com/go/securitycenter v1.15.0/go.mod h1:PeKJ0t8MoFmmXLXWm41JidyzI3PJjd8sXWaVqg43WWk= +cloud.google.com/go/securitycenter v1.16.0/go.mod h1:Q9GMaLQFUD+5ZTabrbujNWLtSLZIZF7SAR0wWECrjdk= +cloud.google.com/go/securitycenter v1.18.1/go.mod h1:0/25gAzCM/9OL9vVx4ChPeM/+DlfGQJDwBy/UC8AKK0= +cloud.google.com/go/securitycenter v1.19.0/go.mod h1:LVLmSg8ZkkyaNy4u7HCIshAngSQ8EcIRREP3xBnyfag= +cloud.google.com/go/servicecontrol v1.4.0/go.mod h1:o0hUSJ1TXJAmi/7fLJAedOovnujSEvjKCAFNXPQ1RaU= +cloud.google.com/go/servicecontrol v1.5.0/go.mod h1:qM0CnXHhyqKVuiZnGKrIurvVImCs8gmqWsDoqe9sU1s= +cloud.google.com/go/servicecontrol v1.10.0/go.mod h1:pQvyvSRh7YzUF2efw7H87V92mxU8FnFDawMClGCNuAA= +cloud.google.com/go/servicecontrol v1.11.0/go.mod h1:kFmTzYzTUIuZs0ycVqRHNaNhgR+UMUpw9n02l/pY+mc= +cloud.google.com/go/servicecontrol v1.11.1/go.mod h1:aSnNNlwEFBY+PWGQ2DoM0JJ/QUXqV5/ZD9DOLB7SnUk= +cloud.google.com/go/servicedirectory v1.4.0/go.mod h1:gH1MUaZCgtP7qQiI+F+A+OpeKF/HQWgtAddhTbhL2bs= +cloud.google.com/go/servicedirectory v1.5.0/go.mod h1:QMKFL0NUySbpZJ1UZs3oFAmdvVxhhxB6eJ/Vlp73dfg= +cloud.google.com/go/servicedirectory v1.6.0/go.mod h1:pUlbnWsLH9c13yGkxCmfumWEPjsRs1RlmJ4pqiNjVL4= +cloud.google.com/go/servicedirectory v1.7.0/go.mod h1:5p/U5oyvgYGYejufvxhgwjL8UVXjkuw7q5XcG10wx1U= +cloud.google.com/go/servicedirectory v1.8.0/go.mod h1:srXodfhY1GFIPvltunswqXpVxFPpZjf8nkKQT7XcXaY= +cloud.google.com/go/servicedirectory v1.9.0/go.mod h1:29je5JjiygNYlmsGz8k6o+OZ8vd4f//bQLtvzkPPT/s= +cloud.google.com/go/servicemanagement v1.4.0/go.mod h1:d8t8MDbezI7Z2R1O/wu8oTggo3BI2GKYbdG4y/SJTco= +cloud.google.com/go/servicemanagement v1.5.0/go.mod h1:XGaCRe57kfqu4+lRxaFEAuqmjzF0r+gWHjWqKqBvKFo= +cloud.google.com/go/servicemanagement v1.6.0/go.mod h1:aWns7EeeCOtGEX4OvZUWCCJONRZeFKiptqKf1D0l/Jc= +cloud.google.com/go/servicemanagement v1.8.0/go.mod h1:MSS2TDlIEQD/fzsSGfCdJItQveu9NXnUniTrq/L8LK4= +cloud.google.com/go/serviceusage v1.3.0/go.mod h1:Hya1cozXM4SeSKTAgGXgj97GlqUvF5JaoXacR1JTP/E= +cloud.google.com/go/serviceusage v1.4.0/go.mod h1:SB4yxXSaYVuUBYUml6qklyONXNLt83U0Rb+CXyhjEeU= +cloud.google.com/go/serviceusage v1.5.0/go.mod h1:w8U1JvqUqwJNPEOTQjrMHkw3IaIFLoLsPLvsE3xueec= +cloud.google.com/go/serviceusage v1.6.0/go.mod h1:R5wwQcbOWsyuOfbP9tGdAnCAc6B9DRwPG1xtWMDeuPA= +cloud.google.com/go/shell v1.3.0/go.mod h1:VZ9HmRjZBsjLGXusm7K5Q5lzzByZmJHf1d0IWHEN5X4= +cloud.google.com/go/shell v1.4.0/go.mod h1:HDxPzZf3GkDdhExzD/gs8Grqk+dmYcEjGShZgYa9URw= +cloud.google.com/go/shell v1.6.0/go.mod h1:oHO8QACS90luWgxP3N9iZVuEiSF84zNyLytb+qE2f9A= +cloud.google.com/go/spanner v1.41.0/go.mod h1:MLYDBJR/dY4Wt7ZaMIQ7rXOTLjYrmxLE/5ve9vFfWos= +cloud.google.com/go/spanner v1.44.0/go.mod h1:G8XIgYdOK+Fbcpbs7p2fiprDw4CaZX63whnSMLVBxjk= +cloud.google.com/go/spanner v1.45.0/go.mod h1:FIws5LowYz8YAE1J8fOS7DJup8ff7xJeetWEo5REA2M= +cloud.google.com/go/speech v1.6.0/go.mod h1:79tcr4FHCimOp56lwC01xnt/WPJZc4v3gzyT7FoBkCM= +cloud.google.com/go/speech v1.7.0/go.mod h1:KptqL+BAQIhMsj1kOP2la5DSEEerPDuOP/2mmkhHhZQ= +cloud.google.com/go/speech v1.8.0/go.mod h1:9bYIl1/tjsAnMgKGHKmBZzXKEkGgtU+MpdDPTE9f7y0= +cloud.google.com/go/speech v1.9.0/go.mod h1:xQ0jTcmnRFFM2RfX/U+rk6FQNUF6DQlydUSyoooSpco= +cloud.google.com/go/speech v1.14.1/go.mod h1:gEosVRPJ9waG7zqqnsHpYTOoAS4KouMRLDFMekpJ0J0= +cloud.google.com/go/speech v1.15.0/go.mod h1:y6oH7GhqCaZANH7+Oe0BhgIogsNInLlz542tg3VqeYI= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= +cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= +cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= +cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= +cloud.google.com/go/storage v1.28.1/go.mod h1:Qnisd4CqDdo6BGs2AD5LLnEsmSQ80wQ5ogcBBKhU86Y= +cloud.google.com/go/storage v1.29.0/go.mod h1:4puEjyTKnku6gfKoTfNOU/W+a9JyuVNxjpS5GBrB8h4= +cloud.google.com/go/storagetransfer v1.5.0/go.mod h1:dxNzUopWy7RQevYFHewchb29POFv3/AaBgnhqzqiK0w= +cloud.google.com/go/storagetransfer v1.6.0/go.mod h1:y77xm4CQV/ZhFZH75PLEXY0ROiS7Gh6pSKrM8dJyg6I= +cloud.google.com/go/storagetransfer v1.7.0/go.mod h1:8Giuj1QNb1kfLAiWM1bN6dHzfdlDAVC9rv9abHot2W4= +cloud.google.com/go/storagetransfer v1.8.0/go.mod h1:JpegsHHU1eXg7lMHkvf+KE5XDJ7EQu0GwNJbbVGanEw= +cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= +cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= +cloud.google.com/go/talent v1.3.0/go.mod h1:CmcxwJ/PKfRgd1pBjQgU6W3YBwiewmUzQYH5HHmSCmM= +cloud.google.com/go/talent v1.4.0/go.mod h1:ezFtAgVuRf8jRsvyE6EwmbTK5LKciD4KVnHuDEFmOOA= +cloud.google.com/go/talent v1.5.0/go.mod h1:G+ODMj9bsasAEJkQSzO2uHQWXHHXUomArjWQQYkqK6c= +cloud.google.com/go/texttospeech v1.4.0/go.mod h1:FX8HQHA6sEpJ7rCMSfXuzBcysDAuWusNNNvN9FELDd8= +cloud.google.com/go/texttospeech v1.5.0/go.mod h1:oKPLhR4n4ZdQqWKURdwxMy0uiTS1xU161C8W57Wkea4= +cloud.google.com/go/texttospeech v1.6.0/go.mod h1:YmwmFT8pj1aBblQOI3TfKmwibnsfvhIBzPXcW4EBovc= +cloud.google.com/go/tpu v1.3.0/go.mod h1:aJIManG0o20tfDQlRIej44FcwGGl/cD0oiRyMKG19IQ= +cloud.google.com/go/tpu v1.4.0/go.mod h1:mjZaX8p0VBgllCzF6wcU2ovUXN9TONFLd7iz227X2Xg= +cloud.google.com/go/tpu v1.5.0/go.mod h1:8zVo1rYDFuW2l4yZVY0R0fb/v44xLh3llq7RuV61fPM= +cloud.google.com/go/trace v1.3.0/go.mod h1:FFUE83d9Ca57C+K8rDl/Ih8LwOzWIV1krKgxg6N0G28= +cloud.google.com/go/trace v1.4.0/go.mod h1:UG0v8UBqzusp+z63o7FK74SdFE+AXpCLdFb1rshXG+Y= +cloud.google.com/go/trace v1.8.0/go.mod h1:zH7vcsbAhklH8hWFig58HvxcxyQbaIqMarMg9hn5ECA= +cloud.google.com/go/trace v1.9.0/go.mod h1:lOQqpE5IaWY0Ixg7/r2SjixMuc6lfTFeO4QGM4dQWOk= +cloud.google.com/go/translate v1.3.0/go.mod h1:gzMUwRjvOqj5i69y/LYLd8RrNQk+hOmIXTi9+nb3Djs= +cloud.google.com/go/translate v1.4.0/go.mod h1:06Dn/ppvLD6WvA5Rhdp029IX2Mi3Mn7fpMRLPvXT5Wg= +cloud.google.com/go/translate v1.5.0/go.mod h1:29YDSYveqqpA1CQFD7NQuP49xymq17RXNaUDdc0mNu0= +cloud.google.com/go/translate v1.6.0/go.mod h1:lMGRudH1pu7I3n3PETiOB2507gf3HnfLV8qlkHZEyos= +cloud.google.com/go/translate v1.7.0/go.mod h1:lMGRudH1pu7I3n3PETiOB2507gf3HnfLV8qlkHZEyos= +cloud.google.com/go/video v1.8.0/go.mod h1:sTzKFc0bUSByE8Yoh8X0mn8bMymItVGPfTuUBUyRgxk= +cloud.google.com/go/video v1.9.0/go.mod h1:0RhNKFRF5v92f8dQt0yhaHrEuH95m068JYOvLZYnJSw= +cloud.google.com/go/video v1.12.0/go.mod h1:MLQew95eTuaNDEGriQdcYn0dTwf9oWiA4uYebxM5kdg= +cloud.google.com/go/video v1.13.0/go.mod h1:ulzkYlYgCp15N2AokzKjy7MQ9ejuynOJdf1tR5lGthk= +cloud.google.com/go/video v1.14.0/go.mod h1:SkgaXwT+lIIAKqWAJfktHT/RbgjSuY6DobxEp0C5yTQ= +cloud.google.com/go/video v1.15.0/go.mod h1:SkgaXwT+lIIAKqWAJfktHT/RbgjSuY6DobxEp0C5yTQ= +cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= +cloud.google.com/go/videointelligence v1.7.0/go.mod h1:k8pI/1wAhjznARtVT9U1llUaFNPh7muw8QyOUpavru4= +cloud.google.com/go/videointelligence v1.8.0/go.mod h1:dIcCn4gVDdS7yte/w+koiXn5dWVplOZkE+xwG9FgK+M= +cloud.google.com/go/videointelligence v1.9.0/go.mod h1:29lVRMPDYHikk3v8EdPSaL8Ku+eMzDljjuvRs105XoU= +cloud.google.com/go/videointelligence v1.10.0/go.mod h1:LHZngX1liVtUhZvi2uNS0VQuOzNi2TkY1OakiuoUOjU= +cloud.google.com/go/vision v1.2.0/go.mod h1:SmNwgObm5DpFBme2xpyOyasvBc1aPdjvMk2bBk0tKD0= +cloud.google.com/go/vision/v2 v2.2.0/go.mod h1:uCdV4PpN1S0jyCyq8sIM42v2Y6zOLkZs+4R9LrGYwFo= +cloud.google.com/go/vision/v2 v2.3.0/go.mod h1:UO61abBx9QRMFkNBbf1D8B1LXdS2cGiiCRx0vSpZoUo= +cloud.google.com/go/vision/v2 v2.4.0/go.mod h1:VtI579ll9RpVTrdKdkMzckdnwMyX2JILb+MhPqRbPsY= +cloud.google.com/go/vision/v2 v2.5.0/go.mod h1:MmaezXOOE+IWa+cS7OhRRLK2cNv1ZL98zhqFFZaaH2E= +cloud.google.com/go/vision/v2 v2.6.0/go.mod h1:158Hes0MvOS9Z/bDMSFpjwsUrZ5fPrdwuyyvKSGAGMY= +cloud.google.com/go/vision/v2 v2.7.0/go.mod h1:H89VysHy21avemp6xcf9b9JvZHVehWbET0uT/bcuY/0= +cloud.google.com/go/vmmigration v1.2.0/go.mod h1:IRf0o7myyWFSmVR1ItrBSFLFD/rJkfDCUTO4vLlJvsE= +cloud.google.com/go/vmmigration v1.3.0/go.mod h1:oGJ6ZgGPQOFdjHuocGcLqX4lc98YQ7Ygq8YQwHh9A7g= +cloud.google.com/go/vmmigration v1.5.0/go.mod h1:E4YQ8q7/4W9gobHjQg4JJSgXXSgY21nA5r8swQV+Xxc= +cloud.google.com/go/vmmigration v1.6.0/go.mod h1:bopQ/g4z+8qXzichC7GW1w2MjbErL54rk3/C843CjfY= +cloud.google.com/go/vmwareengine v0.1.0/go.mod h1:RsdNEf/8UDvKllXhMz5J40XxDrNJNN4sagiox+OI208= +cloud.google.com/go/vmwareengine v0.2.2/go.mod h1:sKdctNJxb3KLZkE/6Oui94iw/xs9PRNC2wnNLXsHvH8= +cloud.google.com/go/vmwareengine v0.3.0/go.mod h1:wvoyMvNWdIzxMYSpH/R7y2h5h3WFkx6d+1TIsP39WGY= +cloud.google.com/go/vpcaccess v1.4.0/go.mod h1:aQHVbTWDYUR1EbTApSVvMq1EnT57ppDmQzZ3imqIk4w= +cloud.google.com/go/vpcaccess v1.5.0/go.mod h1:drmg4HLk9NkZpGfCmZ3Tz0Bwnm2+DKqViEpeEpOq0m8= +cloud.google.com/go/vpcaccess v1.6.0/go.mod h1:wX2ILaNhe7TlVa4vC5xce1bCnqE3AeH27RV31lnmZes= +cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xXZmFiHmGE= +cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= +cloud.google.com/go/webrisk v1.6.0/go.mod h1:65sW9V9rOosnc9ZY7A7jsy1zoHS5W9IAXv6dGqhMQMc= +cloud.google.com/go/webrisk v1.7.0/go.mod h1:mVMHgEYH0r337nmt1JyLthzMr6YxwN1aAIEc2fTcq7A= +cloud.google.com/go/webrisk v1.8.0/go.mod h1:oJPDuamzHXgUc+b8SiHRcVInZQuybnvEW72PqTc7sSg= +cloud.google.com/go/websecurityscanner v1.3.0/go.mod h1:uImdKm2wyeXQevQJXeh8Uun/Ym1VqworNDlBXQevGMo= +cloud.google.com/go/websecurityscanner v1.4.0/go.mod h1:ebit/Fp0a+FWu5j4JOmJEV8S8CzdTkAS77oDsiSqYWQ= +cloud.google.com/go/websecurityscanner v1.5.0/go.mod h1:Y6xdCPy81yi0SQnDY1xdNTNpfY1oAgXUlcfN3B3eSng= +cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= +cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= +cloud.google.com/go/workflows v1.8.0/go.mod h1:ysGhmEajwZxGn1OhGOGKsTXc5PyxOc0vfKf5Af+to4M= +cloud.google.com/go/workflows v1.9.0/go.mod h1:ZGkj1aFIOd9c8Gerkjjq7OW7I5+l6cSvT3ujaO/WwSA= +cloud.google.com/go/workflows v1.10.0/go.mod h1:fZ8LmRmZQWacon9UCX1r/g/DfAXx5VcPALq2CxzdePw= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8= +git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= +github.com/ajstarks/deck v0.0.0-20200831202436-30c9fc6549a9/go.mod h1:JynElWSGnm/4RlzPXRlREEwqTHAN3T56Bv2ITsFT3gY= +github.com/ajstarks/deck/generate v0.0.0-20210309230005-c3f852c02e19/go.mod h1:T13YZdzov6OU0A1+RfKZiZN9ca6VeKdBdyDV+BY97Tk= +github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= +github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM= +github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/apache/arrow/go/v10 v10.0.1/go.mod h1:YvhnlEePVnBS4+0z3fhPfUy7W1Ikj0Ih0vcRo/gZ1M0= +github.com/apache/arrow/go/v11 v11.0.0/go.mod h1:Eg5OsL5H+e299f7u5ssuXsuHQVEGC4xei5aX110hRiI= +github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU= +github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= +github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20230310173818-32f1caf87195/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= +github.com/envoyproxy/go-control-plane v0.10.3/go.mod h1:fJJn/j26vwOu972OllsvAgJJM//w9BV6Fxbg2LuVd34= +github.com/envoyproxy/go-control-plane v0.11.0/go.mod h1:VnHyVMpzcLvCFt9yUz1UnCwHLhwx1WguiVDV7pTG/tI= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo= +github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0++PMirau2/yoOwVac3AbF2w= +github.com/envoyproxy/protoc-gen-validate v0.10.0/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss= +github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= +github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g= +github.com/go-fonts/latin-modern v0.2.0/go.mod h1:rQVLdDMK+mK1xscDwsqM5J8U2jrRa3T0ecnM9pNujks= +github.com/go-fonts/liberation v0.1.1/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= +github.com/go-fonts/liberation v0.2.0/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= +github.com/go-fonts/stix v0.1.0/go.mod h1:w/c1f0ldAUlJmLBvlbkvVXLAD+tAMqobIIQpmnUIzUY= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2CSIqUrmQPqA0gdRIlnLEY0gK5JGjh37zN5U= +github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81/go.mod h1:SX0U8uGpxhq9o2S/CELCSUxEWWAuoCUcVCQWv7G2OCk= +github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= +github.com/go-pdf/fpdf v0.6.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= +github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= +github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/s2a-go v0.1.0/go.mod h1:OJpEgntRZo8ugHpF9hkoLJbS5dSI20XZeXJ9JVywLlM= +github.com/google/s2a-go v0.1.3/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= +github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= +github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= +github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= +github.com/googleapis/enterprise-certificate-proxy v0.2.1/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= +github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= +github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= +github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= +github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= +github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= +github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= +github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= +github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57QpBWsYpwqHJx8= +github.com/googleapis/gax-go/v2 v2.7.1/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= +github.com/googleapis/gax-go/v2 v2.8.0/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= +github.com/googleapis/gax-go/v2 v2.10.0/go.mod h1:4UOEnMCrxsSqQ940WnTiD6qJ63le2ev3xfyagutxiPw= +github.com/googleapis/gax-go/v2 v2.11.0/go.mod h1:DxmR61SGKkGLa2xigwuZIQpkCI2S5iydzRfb3peWZJI= +github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= +github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= +github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= +github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= +github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= +github.com/lyft/protoc-gen-star v0.6.1/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= +github.com/lyft/protoc-gen-star/v2 v2.0.1/go.mod h1:RcCdONR2ScXaYnQC5tUzxzlpA3WVYF7/opLeUgcQs/o= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-sqlite3 v1.14.14/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= +github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY= +github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE= +github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2dXMnm1mY= +github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= +github.com/phpdave11/gofpdi v1.0.13/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= +github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= +github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= +github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= +github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= +github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= +github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= +go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= -golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= +golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= +golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= +golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= +golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3/go.mod h1:NOZ3BPKG0ec/BKJQgnvsSFpcKLM5xXVWnvZS97DWHgE= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20220827204233-334a2380cb91/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= +golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20210216034530-4410531fe030/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= +golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= +golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= +golang.org/x/image v0.0.0-20220302094943-723b81ca9867/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.0.0-20221012135044-0b7e1fb9d458/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= +golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU= -golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= -golang.org/x/oauth2 v0.9.0 h1:BPpt2kU7oMRq3kCHAA1tbSEshXRw1LpG2ztgDwrzuAs= -golang.org/x/oauth2 v0.9.0/go.mod h1:qYgFZaFiu6Wg24azG8bdV52QJXJGbZzIIsRCdVKzbLw= +golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= +golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec= +golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I= +golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= +golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= +golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= +golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8= +golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= -golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= +golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= +golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo= +golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20220922220347-f3bd1da661af/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= +gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= +gonum.org/v1/gonum v0.9.3/go.mod h1:TZumC3NeyVQskjXqmyWt4S3bINhy7B4eYwW69EbyX+0= +gonum.org/v1/gonum v0.11.0/go.mod h1:fSG4YDCxxUZQJ7rKsQrj0gMOg00Il0Z96/qMA4bVQhA= +gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= +gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= +gonum.org/v1/plot v0.9.0/go.mod h1:3Pcqqmp6RHvJI72kgb8fThyUnav364FOsdDo2aGW5lY= +gonum.org/v1/plot v0.10.1/go.mod h1:VZW5OlhkL1mysU9vaqNHnsy86inf6Ot+jB3r+BczCEo= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= +google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= +google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= +google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= +google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= +google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= +google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= +google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= +google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= +google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= +google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= +google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= +google.golang.org/api v0.77.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= +google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= +google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= +google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= +google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g= +google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.93.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.95.0/go.mod h1:eADj+UBuxkh5zlrSntJghuNeg8HwQ1w5lTKkuqaETEI= +google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= +google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= +google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= +google.golang.org/api v0.99.0/go.mod h1:1YOf74vkVndF7pG6hIHuINsM7eWwpVTAfNMNiL91A08= +google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= +google.golang.org/api v0.102.0/go.mod h1:3VFl6/fzoA+qNuS1N1/VfXY4LjoXN/wzeIp7TweWwGo= +google.golang.org/api v0.103.0/go.mod h1:hGtW6nK1AC+d9si/UBhw8Xli+QMOf6xyNAyJw4qU9w0= +google.golang.org/api v0.106.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= +google.golang.org/api v0.107.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= +google.golang.org/api v0.108.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= +google.golang.org/api v0.110.0/go.mod h1:7FC4Vvx1Mooxh8C5HWjzZHcavuS2f6pmJpZx60ca7iI= +google.golang.org/api v0.111.0/go.mod h1:qtFHvU9mhgTJegR31csQ+rwxyUTHOKFqCKWp1J0fdw0= +google.golang.org/api v0.114.0/go.mod h1:ifYI2ZsFK6/uGddGfAD5BMxlnkBqCmqHSDUVi45N5Yg= +google.golang.org/api v0.118.0/go.mod h1:76TtD3vkgmZ66zZzp72bUUklpmQmKlhh6sYtIjYK+5E= +google.golang.org/api v0.122.0/go.mod h1:gcitW0lvnyWjSp9nKxAbdHKIZ6vF4aajGueeslZOyms= +google.golang.org/api v0.124.0/go.mod h1:xu2HQurE5gi/3t1aFCvhPD781p0a3p11sdunTJ2BlP4= +google.golang.org/api v0.126.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= +google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= +google.golang.org/genproto v0.0.0-20220329172620-7be39ac1afc7/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220628213854-d9e0b6570c03/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220722212130-b98a9ff5e252/go.mod h1:GkXuJDJ6aQ7lnJcRF+SJVgFdQhypqgl3LB1C9vabdRE= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= +google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220817144833-d7fd3f11b9b1/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220829144015-23454907ede3/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220829175752-36a9c930ecbf/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220913154956-18f8339a66a5/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220914142337-ca0e39ece12f/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220916172020-2692e8806bfa/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220919141832-68c03719ef51/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220920201722-2b89144ce006/go.mod h1:ht8XFiar2npT/g4vkk7O0WYS1sHOHbdujxbEp7CJWbw= +google.golang.org/genproto v0.0.0-20220926165614-551eb538f295/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI= +google.golang.org/genproto v0.0.0-20220926220553-6981cbe3cfce/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI= +google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqwhZAwq4wsRUaVG555sVgsNmIjRtO7t/JH29U= +google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= +google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= +google.golang.org/genproto v0.0.0-20221024153911-1573dae28c9c/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= +google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= +google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c/go.mod h1:CGI5F/G+E5bKwmfYo09AXuVN4dD894kIKUFmVbP2/Fo= +google.golang.org/genproto v0.0.0-20221109142239-94d6d90a7d66/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221114212237-e4508ebdbee1/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221117204609-8f9c96812029/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221201164419-0e50fba7f41c/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221201204527-e3fa12d562f3/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd/go.mod h1:cTsE614GARnxrLsqKREzmNYJACSWWpAWdNMwnD7c2BE= +google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230112194545-e10362b5ecf9/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230113154510-dbe35b8444a5/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230123190316-2c411cf9d197/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230124163310-31e0e69b6fc2/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230125152338-dcaf20b6aeaa/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230127162408-596548ed4efa/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230209215440-0dfe4f8abfcc/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230216225411-c8e22ba71e44/go.mod h1:8B0gmkoRebU8ukX6HP+4wrVQUY1+6PkQ44BSyIlflHA= +google.golang.org/genproto v0.0.0-20230222225845-10f96fb3dbec/go.mod h1:3Dl5ZL0q0isWJt+FVcfpQyirqemEuLAK/iFvg1UP1Hw= +google.golang.org/genproto v0.0.0-20230223222841-637eb2293923/go.mod h1:3Dl5ZL0q0isWJt+FVcfpQyirqemEuLAK/iFvg1UP1Hw= +google.golang.org/genproto v0.0.0-20230303212802-e74f57abe488/go.mod h1:TvhZT5f700eVlTNwND1xoEZQeWTB2RY/65kplwl/bFA= +google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= +google.golang.org/genproto v0.0.0-20230320184635-7606e756e683/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= +google.golang.org/genproto v0.0.0-20230323212658-478b75c54725/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= +google.golang.org/genproto v0.0.0-20230330154414-c0448cd141ea/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= +google.golang.org/genproto v0.0.0-20230331144136-dcfb400f0633/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= +google.golang.org/genproto v0.0.0-20230403163135-c38d8f061ccd/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= +google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= +google.golang.org/genproto v0.0.0-20230525234025-438c736192d0/go.mod h1:9ExIQyXL5hZrHzQceCwuSYwZZ5QZBazOcprJ5rgs3lY= +google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64= +google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a/go.mod h1:ts19tUU+Z0ZShN1y3aPyq2+O3d5FUNNgT6FtOzmrNn8= +google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= +google.golang.org/genproto/googleapis/api v0.0.0-20230526203410-71b5a4ffd15e/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= +google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= +google.golang.org/genproto/googleapis/bytestream v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:ylj+BE99M198VPbBh6A8d9n3w8fChvyLK3wwBOjXBFA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234015-3fc162c6f38a/go.mod h1:xURIpW9ES5+/GZhnV6beoEtxQrnkRGIfP5VQG2tCBLc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230526203410-71b5a4ffd15e/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= +google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= +google.golang.org/grpc v1.52.0/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= +google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= +google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= +google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= +lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= +lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= +modernc.org/cc/v3 v3.36.0/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= +modernc.org/cc/v3 v3.36.2/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= +modernc.org/cc/v3 v3.36.3/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= +modernc.org/ccgo/v3 v3.0.0-20220428102840-41399a37e894/go.mod h1:eI31LL8EwEBKPpNpA4bU1/i+sKOwOrQy8D87zWUcRZc= +modernc.org/ccgo/v3 v3.0.0-20220430103911-bc99d88307be/go.mod h1:bwdAnOoaIt8Ax9YdWGjxWsdkPcZyRPHqrOvJxaKAKGw= +modernc.org/ccgo/v3 v3.16.4/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ= +modernc.org/ccgo/v3 v3.16.6/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ= +modernc.org/ccgo/v3 v3.16.8/go.mod h1:zNjwkizS+fIFDrDjIAgBSCLkWbJuHF+ar3QRn+Z9aws= +modernc.org/ccgo/v3 v3.16.9/go.mod h1:zNMzC9A9xeNUepy6KuZBbugn3c0Mc9TeiJO4lgvkJDo= +modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= +modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= +modernc.org/libc v0.0.0-20220428101251-2d5f3daf273b/go.mod h1:p7Mg4+koNjc8jkqwcoFBJx7tXkpj00G77X7A72jXPXA= +modernc.org/libc v1.16.0/go.mod h1:N4LD6DBE9cf+Dzf9buBlzVJndKr/iJHG97vGLHYnb5A= +modernc.org/libc v1.16.1/go.mod h1:JjJE0eu4yeK7tab2n4S1w8tlWd9MxXLRzheaRnAKymU= +modernc.org/libc v1.16.17/go.mod h1:hYIV5VZczAmGZAnG15Vdngn5HSF5cSkbvfz2B7GRuVU= +modernc.org/libc v1.16.19/go.mod h1:p7Mg4+koNjc8jkqwcoFBJx7tXkpj00G77X7A72jXPXA= +modernc.org/libc v1.17.0/go.mod h1:XsgLldpP4aWlPlsjqKRdHPqCxCjISdHfM/yeWC5GyW0= +modernc.org/libc v1.17.1/go.mod h1:FZ23b+8LjxZs7XtFMbSzL/EhPxNbfZbErxEHc7cbD9s= +modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/mathutil v1.4.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/memory v1.1.1/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= +modernc.org/memory v1.2.0/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= +modernc.org/memory v1.2.1/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= +modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/sqlite v1.18.1/go.mod h1:6ho+Gow7oX5V+OiOQ6Tr4xeqbx13UZ6t+Fw9IRUG4d4= +modernc.org/strutil v1.1.1/go.mod h1:DE+MQQ/hjKBZS2zNInV5hhcipt5rLPWkmpbGeW5mmdw= +modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= +modernc.org/tcl v1.13.1/go.mod h1:XOLfOwzhkljL4itZkK6T72ckMgvj0BDsnKNdZVUOecw= +modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= +modernc.org/z v1.5.1/go.mod h1:eWFB510QWW5Th9YGZT81s+LwvaAs3Q2yr4sP0rmLkv8= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= From 7e3bb17f55bfb162bf77a3d42f5476ba23194dfb Mon Sep 17 00:00:00 2001 From: Jarek Porzucek <17789797+jporzucek@users.noreply.github.com> Date: Wed, 26 Jul 2023 17:05:44 +0200 Subject: [PATCH 269/751] Add Dependabot field in security_and_analysis (#2846) Fixes: #2845. --- github/github-accessors.go | 16 ++++++++++++++++ github/github-accessors_test.go | 17 +++++++++++++++++ github/github-stringify_test.go | 23 ++++++++++++++++++++++- github/repos.go | 16 ++++++++++++++++ github/repos_test.go | 4 ++-- 5 files changed, 73 insertions(+), 3 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 4dd5529a3a3..e8d4e1ac4c1 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -5054,6 +5054,14 @@ func (d *DependabotSecurityAdvisory) GetWithdrawnAt() Timestamp { return *d.WithdrawnAt } +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (d *DependabotSecurityUpdates) GetStatus() string { + if d == nil || d.Status == nil { + return "" + } + return *d.Status +} + // GetManifestPath returns the ManifestPath field if it's non-nil, zero value otherwise. func (d *Dependency) GetManifestPath() string { if d == nil || d.ManifestPath == nil { @@ -20214,6 +20222,14 @@ func (s *SecurityAndAnalysis) GetAdvancedSecurity() *AdvancedSecurity { return s.AdvancedSecurity } +// GetDependabotSecurityUpdates returns the DependabotSecurityUpdates field. +func (s *SecurityAndAnalysis) GetDependabotSecurityUpdates() *DependabotSecurityUpdates { + if s == nil { + return nil + } + return s.DependabotSecurityUpdates +} + // GetSecretScanning returns the SecretScanning field. func (s *SecurityAndAnalysis) GetSecretScanning() *SecretScanning { if s == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 75148227d3b..2385aeb08ba 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -5961,6 +5961,16 @@ func TestDependabotSecurityAdvisory_GetWithdrawnAt(tt *testing.T) { d.GetWithdrawnAt() } +func TestDependabotSecurityUpdates_GetStatus(tt *testing.T) { + var zeroValue string + d := &DependabotSecurityUpdates{Status: &zeroValue} + d.GetStatus() + d = &DependabotSecurityUpdates{} + d.GetStatus() + d = nil + d.GetStatus() +} + func TestDependency_GetManifestPath(tt *testing.T) { var zeroValue string d := &Dependency{ManifestPath: &zeroValue} @@ -23585,6 +23595,13 @@ func TestSecurityAndAnalysis_GetAdvancedSecurity(tt *testing.T) { s.GetAdvancedSecurity() } +func TestSecurityAndAnalysis_GetDependabotSecurityUpdates(tt *testing.T) { + s := &SecurityAndAnalysis{} + s.GetDependabotSecurityUpdates() + s = nil + s.GetDependabotSecurityUpdates() +} + func TestSecurityAndAnalysis_GetSecretScanning(tt *testing.T) { s := &SecurityAndAnalysis{} s.GetSecretScanning() diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index 0ad7eefa342..a8a7b6f0b14 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -342,6 +342,16 @@ func TestContributorStats_String(t *testing.T) { } } +func TestDependabotSecurityUpdates_String(t *testing.T) { + v := DependabotSecurityUpdates{ + Status: String(""), + } + want := `github.DependabotSecurityUpdates{Status:""}` + if got := v.String(); got != want { + t.Errorf("DependabotSecurityUpdates.String = %v, want %v", got, want) + } +} + func TestDiscussionComment_String(t *testing.T) { v := DiscussionComment{ Author: &User{}, @@ -1776,13 +1786,24 @@ func TestSecretScanning_String(t *testing.T) { } } +func TestSecretScanningPushProtection_String(t *testing.T) { + v := SecretScanningPushProtection{ + Status: String(""), + } + want := `github.SecretScanningPushProtection{Status:""}` + if got := v.String(); got != want { + t.Errorf("SecretScanningPushProtection.String = %v, want %v", got, want) + } +} + func TestSecurityAndAnalysis_String(t *testing.T) { v := SecurityAndAnalysis{ AdvancedSecurity: &AdvancedSecurity{}, SecretScanning: &SecretScanning{}, SecretScanningPushProtection: &SecretScanningPushProtection{}, + DependabotSecurityUpdates: &DependabotSecurityUpdates{}, } - want := `github.SecurityAndAnalysis{AdvancedSecurity:github.AdvancedSecurity{}, SecretScanning:github.SecretScanning{}, SecretScanningPushProtection:github.SecretScanningPushProtection{}}` + want := `github.SecurityAndAnalysis{AdvancedSecurity:github.AdvancedSecurity{}, SecretScanning:github.SecretScanning{}, SecretScanningPushProtection:github.SecretScanningPushProtection{}, DependabotSecurityUpdates:github.DependabotSecurityUpdates{}}` if got := v.String(); got != want { t.Errorf("SecurityAndAnalysis.String = %v, want %v", got, want) } diff --git a/github/repos.go b/github/repos.go index 5ffad6dd3c4..2451ed43689 100644 --- a/github/repos.go +++ b/github/repos.go @@ -210,6 +210,7 @@ type SecurityAndAnalysis struct { AdvancedSecurity *AdvancedSecurity `json:"advanced_security,omitempty"` SecretScanning *SecretScanning `json:"secret_scanning,omitempty"` SecretScanningPushProtection *SecretScanningPushProtection `json:"secret_scanning_push_protection,omitempty"` + DependabotSecurityUpdates *DependabotSecurityUpdates `json:"dependabot_security_updates,omitempty"` } func (s SecurityAndAnalysis) String() string { @@ -245,6 +246,21 @@ type SecretScanningPushProtection struct { Status *string `json:"status,omitempty"` } +func (s SecretScanningPushProtection) String() string { + return Stringify(s) +} + +// DependabotSecurityUpdates specifies the state of Dependabot security updates on a repository. +// +// GitHub API docs: https://docs.github.com/en/code-security/dependabot/dependabot-security-updates/about-dependabot-security-updates +type DependabotSecurityUpdates struct { + Status *string `json:"status,omitempty"` +} + +func (d DependabotSecurityUpdates) String() string { + return Stringify(d) +} + // List the repositories for a user. Passing the empty string will list // repositories for the authenticated user. // diff --git a/github/repos_test.go b/github/repos_test.go index b35f44ddc30..70321fd7c1c 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -360,7 +360,7 @@ func TestRepositoriesService_Get(t *testing.T) { mux.HandleFunc("/repos/o/r", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) - fmt.Fprint(w, `{"id":1,"name":"n","description":"d","owner":{"login":"l"},"license":{"key":"mit"},"security_and_analysis":{"advanced_security":{"status":"enabled"},"secret_scanning":{"status":"enabled"},"secret_scanning_push_protection":{"status":"enabled"}}}`) + fmt.Fprint(w, `{"id":1,"name":"n","description":"d","owner":{"login":"l"},"license":{"key":"mit"},"security_and_analysis":{"advanced_security":{"status":"enabled"},"secret_scanning":{"status":"enabled"},"secret_scanning_push_protection":{"status":"enabled"},"dependabot_security_updates":{"status": "enabled"}}}`) }) ctx := context.Background() @@ -369,7 +369,7 @@ func TestRepositoriesService_Get(t *testing.T) { t.Errorf("Repositories.Get returned error: %v", err) } - want := &Repository{ID: Int64(1), Name: String("n"), Description: String("d"), Owner: &User{Login: String("l")}, License: &License{Key: String("mit")}, SecurityAndAnalysis: &SecurityAndAnalysis{AdvancedSecurity: &AdvancedSecurity{Status: String("enabled")}, SecretScanning: &SecretScanning{String("enabled")}, SecretScanningPushProtection: &SecretScanningPushProtection{String("enabled")}}} + want := &Repository{ID: Int64(1), Name: String("n"), Description: String("d"), Owner: &User{Login: String("l")}, License: &License{Key: String("mit")}, SecurityAndAnalysis: &SecurityAndAnalysis{AdvancedSecurity: &AdvancedSecurity{Status: String("enabled")}, SecretScanning: &SecretScanning{String("enabled")}, SecretScanningPushProtection: &SecretScanningPushProtection{String("enabled")}, DependabotSecurityUpdates: &DependabotSecurityUpdates{String("enabled")}}} if !cmp.Equal(got, want) { t.Errorf("Repositories.Get returned %+v, want %+v", got, want) } From 098e69804783260aace0a4819c5f5c0c923a7fbd Mon Sep 17 00:00:00 2001 From: Jarek Porzucek <17789797+jporzucek@users.noreply.github.com> Date: Thu, 27 Jul 2023 14:02:26 +0200 Subject: [PATCH 270/751] Add new query params for AlertListOptions (#2848) Fixes: #2847. --- github/code-scanning.go | 6 ++++++ github/code-scanning_test.go | 12 ++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/github/code-scanning.go b/github/code-scanning.go index e4a6abeba37..09c03647876 100644 --- a/github/code-scanning.go +++ b/github/code-scanning.go @@ -122,6 +122,12 @@ type AlertListOptions struct { // Return code scanning alerts for a specific branch reference. The ref must be formatted as heads/. Ref string `url:"ref,omitempty"` + // If specified, only code scanning alerts with this severity will be returned. Possible values are: critical, high, medium, low, warning, note, error. + Severity string `url:"severity,omitempty"` + + // The name of a code scanning tool. Only results by this tool will be listed. + ToolName string `url:"tool_name,omitempty"` + ListCursorOptions // Add ListOptions so offset pagination with integer type "page" query parameter is accepted diff --git a/github/code-scanning_test.go b/github/code-scanning_test.go index 29c0b617b84..20d4817d3f1 100644 --- a/github/code-scanning_test.go +++ b/github/code-scanning_test.go @@ -95,7 +95,7 @@ func TestCodeScanningService_ListAlertsForOrg(t *testing.T) { mux.HandleFunc("/orgs/o/code-scanning/alerts", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testFormValues(t, r, values{"state": "open", "ref": "heads/master"}) + testFormValues(t, r, values{"state": "open", "ref": "heads/master", "severity": "warning", "tool_name": "CodeQL"}) fmt.Fprint(w, `[{ "repository": { "id": 1, @@ -187,7 +187,7 @@ func TestCodeScanningService_ListAlertsForOrg(t *testing.T) { }]`) }) - opts := &AlertListOptions{State: "open", Ref: "heads/master"} + opts := &AlertListOptions{State: "open", Ref: "heads/master", Severity: "warning", ToolName: "CodeQL"} ctx := context.Background() alerts, _, err := client.CodeScanning.ListAlertsForOrg(ctx, "o", opts) if err != nil { @@ -299,7 +299,7 @@ func TestCodeScanningService_ListAlertsForOrgLisCursorOptions(t *testing.T) { mux.HandleFunc("/orgs/o/code-scanning/alerts", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testFormValues(t, r, values{"state": "open", "ref": "heads/master", "per_page": "1", "before": "deadbeefb", "after": "deadbeefa"}) + testFormValues(t, r, values{"state": "open", "ref": "heads/master", "severity": "warning", "tool_name": "CodeQL", "per_page": "1", "before": "deadbeefb", "after": "deadbeefa"}) fmt.Fprint(w, `[{ "repository": { "id": 1, @@ -349,7 +349,7 @@ func TestCodeScanningService_ListAlertsForOrgLisCursorOptions(t *testing.T) { }]`) }) - opts := &AlertListOptions{State: "open", Ref: "heads/master", ListCursorOptions: ListCursorOptions{PerPage: 1, Before: "deadbeefb", After: "deadbeefa"}} + opts := &AlertListOptions{State: "open", Ref: "heads/master", Severity: "warning", ToolName: "CodeQL", ListCursorOptions: ListCursorOptions{PerPage: 1, Before: "deadbeefb", After: "deadbeefa"}} ctx := context.Background() alerts, _, err := client.CodeScanning.ListAlertsForOrg(ctx, "o", opts) if err != nil { @@ -425,7 +425,7 @@ func TestCodeScanningService_ListAlertsForRepo(t *testing.T) { mux.HandleFunc("/repos/o/r/code-scanning/alerts", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testFormValues(t, r, values{"state": "open", "ref": "heads/master"}) + testFormValues(t, r, values{"state": "open", "ref": "heads/master", "severity": "warning", "tool_name": "CodeQL"}) fmt.Fprint(w, `[{ "rule_id":"js/trivial-conditional", "rule_severity":"warning", @@ -512,7 +512,7 @@ func TestCodeScanningService_ListAlertsForRepo(t *testing.T) { }]`) }) - opts := &AlertListOptions{State: "open", Ref: "heads/master"} + opts := &AlertListOptions{State: "open", Ref: "heads/master", Severity: "warning", ToolName: "CodeQL"} ctx := context.Background() alerts, _, err := client.CodeScanning.ListAlertsForRepo(ctx, "o", "r", opts) if err != nil { From c8c34d01f65e98954a092333edf4ecdf3120c36e Mon Sep 17 00:00:00 2001 From: Lucas Martin-King Date: Thu, 27 Jul 2023 22:12:20 +1000 Subject: [PATCH 271/751] Add `old_name` field to `AuditEntry` (#2843) Fixes: #2844. --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ github/orgs_audit_log.go | 1 + github/orgs_audit_log_test.go | 2 ++ 4 files changed, 21 insertions(+) diff --git a/github/github-accessors.go b/github/github-accessors.go index e8d4e1ac4c1..942ec6a96bd 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -1278,6 +1278,14 @@ func (a *AuditEntry) GetOAuthApplicationID() int64 { return *a.OAuthApplicationID } +// GetOldName returns the OldName field if it's non-nil, zero value otherwise. +func (a *AuditEntry) GetOldName() string { + if a == nil || a.OldName == nil { + return "" + } + return *a.OldName +} + // GetOldPermission returns the OldPermission field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetOldPermission() string { if a == nil || a.OldPermission == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 2385aeb08ba..4eafaf25229 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -1514,6 +1514,16 @@ func TestAuditEntry_GetOAuthApplicationID(tt *testing.T) { a.GetOAuthApplicationID() } +func TestAuditEntry_GetOldName(tt *testing.T) { + var zeroValue string + a := &AuditEntry{OldName: &zeroValue} + a.GetOldName() + a = &AuditEntry{} + a.GetOldName() + a = nil + a.GetOldName() +} + func TestAuditEntry_GetOldPermission(tt *testing.T) { var zeroValue string a := &AuditEntry{OldPermission: &zeroValue} diff --git a/github/orgs_audit_log.go b/github/orgs_audit_log.go index e2e4692e570..a86910533b1 100644 --- a/github/orgs_audit_log.go +++ b/github/orgs_audit_log.go @@ -78,6 +78,7 @@ type AuditEntry struct { Message *string `json:"message,omitempty"` Name *string `json:"name,omitempty"` OAuthApplicationID *int64 `json:"oauth_application_id,omitempty"` + OldName *string `json:"old_name,omitempty"` // The previous name of the repository, for a name change OldUser *string `json:"old_user,omitempty"` OldPermission *string `json:"old_permission,omitempty"` // The permission level for membership changes, for example `admin` or `read`. OpenSSHPublicKey *string `json:"openssh_public_key,omitempty"` diff --git a/github/orgs_audit_log_test.go b/github/orgs_audit_log_test.go index 8d33a986a17..a5873ee4d38 100644 --- a/github/orgs_audit_log_test.go +++ b/github/orgs_audit_log_test.go @@ -256,6 +256,7 @@ func TestAuditEntry_Marshal(t *testing.T) { LimitedAvailability: Bool(false), Message: String("m"), Name: String("n"), + OldName: String("on"), OldPermission: String("op"), OldUser: String("ou"), OpenSSHPublicKey: String("osshpk"), @@ -345,6 +346,7 @@ func TestAuditEntry_Marshal(t *testing.T) { "limited_availability": false, "message": "m", "name": "n", + "old_name": "on", "old_permission": "op", "old_user": "ou", "openssh_public_key": "osshpk", From 44d09ce8535d46374219085c906f322998416632 Mon Sep 17 00:00:00 2001 From: Lucas Martin-King Date: Sat, 29 Jul 2023 00:22:46 +1000 Subject: [PATCH 272/751] Fix `old_name` field in `AuditEntry` (#2849) Relates to: #2843. --- github/github-accessors.go | 24 ++++++++++++++++-------- github/github-accessors_test.go | 27 +++++++++++++++++---------- github/orgs_audit_log.go | 8 +++++++- github/orgs_audit_log_test.go | 10 +++++++--- 4 files changed, 47 insertions(+), 22 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 942ec6a96bd..356487e0e1e 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -1134,6 +1134,14 @@ func (a *AuditEntry) GetCreatedAt() Timestamp { return *a.CreatedAt } +// GetData returns the Data field. +func (a *AuditEntry) GetData() *AuditEntryData { + if a == nil { + return nil + } + return a.Data +} + // GetDeployKeyFingerprint returns the DeployKeyFingerprint field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetDeployKeyFingerprint() string { if a == nil || a.DeployKeyFingerprint == nil { @@ -1278,14 +1286,6 @@ func (a *AuditEntry) GetOAuthApplicationID() int64 { return *a.OAuthApplicationID } -// GetOldName returns the OldName field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetOldName() string { - if a == nil || a.OldName == nil { - return "" - } - return *a.OldName -} - // GetOldPermission returns the OldPermission field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetOldPermission() string { if a == nil || a.OldPermission == nil { @@ -1598,6 +1598,14 @@ func (a *AuditEntry) GetWorkflowRunID() int64 { return *a.WorkflowRunID } +// GetOldName returns the OldName field if it's non-nil, zero value otherwise. +func (a *AuditEntryData) GetOldName() string { + if a == nil || a.OldName == nil { + return "" + } + return *a.OldName +} + // GetApp returns the App field. func (a *Authorization) GetApp() *AuthorizationApp { if a == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 4eafaf25229..40942da40b3 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -1334,6 +1334,13 @@ func TestAuditEntry_GetCreatedAt(tt *testing.T) { a.GetCreatedAt() } +func TestAuditEntry_GetData(tt *testing.T) { + a := &AuditEntry{} + a.GetData() + a = nil + a.GetData() +} + func TestAuditEntry_GetDeployKeyFingerprint(tt *testing.T) { var zeroValue string a := &AuditEntry{DeployKeyFingerprint: &zeroValue} @@ -1514,16 +1521,6 @@ func TestAuditEntry_GetOAuthApplicationID(tt *testing.T) { a.GetOAuthApplicationID() } -func TestAuditEntry_GetOldName(tt *testing.T) { - var zeroValue string - a := &AuditEntry{OldName: &zeroValue} - a.GetOldName() - a = &AuditEntry{} - a.GetOldName() - a = nil - a.GetOldName() -} - func TestAuditEntry_GetOldPermission(tt *testing.T) { var zeroValue string a := &AuditEntry{OldPermission: &zeroValue} @@ -1914,6 +1911,16 @@ func TestAuditEntry_GetWorkflowRunID(tt *testing.T) { a.GetWorkflowRunID() } +func TestAuditEntryData_GetOldName(tt *testing.T) { + var zeroValue string + a := &AuditEntryData{OldName: &zeroValue} + a.GetOldName() + a = &AuditEntryData{} + a.GetOldName() + a = nil + a.GetOldName() +} + func TestAuthorization_GetApp(tt *testing.T) { a := &Authorization{} a.GetApp() diff --git a/github/orgs_audit_log.go b/github/orgs_audit_log.go index a86910533b1..d7de77127c5 100644 --- a/github/orgs_audit_log.go +++ b/github/orgs_audit_log.go @@ -78,7 +78,6 @@ type AuditEntry struct { Message *string `json:"message,omitempty"` Name *string `json:"name,omitempty"` OAuthApplicationID *int64 `json:"oauth_application_id,omitempty"` - OldName *string `json:"old_name,omitempty"` // The previous name of the repository, for a name change OldUser *string `json:"old_user,omitempty"` OldPermission *string `json:"old_permission,omitempty"` // The permission level for membership changes, for example `admin` or `read`. OpenSSHPublicKey *string `json:"openssh_public_key,omitempty"` @@ -122,6 +121,13 @@ type AuditEntry struct { Visibility *string `json:"visibility,omitempty"` // The repository visibility, for example `public` or `private`. WorkflowID *int64 `json:"workflow_id,omitempty"` WorkflowRunID *int64 `json:"workflow_run_id,omitempty"` + + Data *AuditEntryData `json:"data,omitempty"` +} + +// AuditEntryData represents additional information stuffed into a `data` field. +type AuditEntryData struct { + OldName *string `json:"old_name,omitempty"` // The previous name of the repository, for a name change } // GetAuditLog gets the audit-log entries for an organization. diff --git a/github/orgs_audit_log_test.go b/github/orgs_audit_log_test.go index a5873ee4d38..2995de5023c 100644 --- a/github/orgs_audit_log_test.go +++ b/github/orgs_audit_log_test.go @@ -256,7 +256,6 @@ func TestAuditEntry_Marshal(t *testing.T) { LimitedAvailability: Bool(false), Message: String("m"), Name: String("n"), - OldName: String("on"), OldPermission: String("op"), OldUser: String("ou"), OpenSSHPublicKey: String("osshpk"), @@ -300,6 +299,9 @@ func TestAuditEntry_Marshal(t *testing.T) { Visibility: String("v"), WorkflowID: Int64(1), WorkflowRunID: Int64(1), + Data: &AuditEntryData{ + OldName: String("on"), + }, } want := `{ @@ -346,7 +348,6 @@ func TestAuditEntry_Marshal(t *testing.T) { "limited_availability": false, "message": "m", "name": "n", - "old_name": "on", "old_permission": "op", "old_user": "ou", "openssh_public_key": "osshpk", @@ -393,7 +394,10 @@ func TestAuditEntry_Marshal(t *testing.T) { "user_agent": "ua", "visibility": "v", "workflow_id": 1, - "workflow_run_id": 1 + "workflow_run_id": 1, + "data": { + "old_name": "on" + } }` testJSONMarshal(t, u, want) From f897b2c720ec1bf5b3a2e9524cb36ebdc86050a1 Mon Sep 17 00:00:00 2001 From: Lucas Martin-King Date: Sat, 29 Jul 2023 02:13:30 +1000 Subject: [PATCH 273/751] Add `OldLogin` field to `AuditEntryData` (#2850) Relates to: #2843. --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ github/orgs_audit_log.go | 3 ++- github/orgs_audit_log_test.go | 6 ++++-- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 356487e0e1e..3f665ede5cb 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -1598,6 +1598,14 @@ func (a *AuditEntry) GetWorkflowRunID() int64 { return *a.WorkflowRunID } +// GetOldLogin returns the OldLogin field if it's non-nil, zero value otherwise. +func (a *AuditEntryData) GetOldLogin() string { + if a == nil || a.OldLogin == nil { + return "" + } + return *a.OldLogin +} + // GetOldName returns the OldName field if it's non-nil, zero value otherwise. func (a *AuditEntryData) GetOldName() string { if a == nil || a.OldName == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 40942da40b3..712d8fc94dd 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -1911,6 +1911,16 @@ func TestAuditEntry_GetWorkflowRunID(tt *testing.T) { a.GetWorkflowRunID() } +func TestAuditEntryData_GetOldLogin(tt *testing.T) { + var zeroValue string + a := &AuditEntryData{OldLogin: &zeroValue} + a.GetOldLogin() + a = &AuditEntryData{} + a.GetOldLogin() + a = nil + a.GetOldLogin() +} + func TestAuditEntryData_GetOldName(tt *testing.T) { var zeroValue string a := &AuditEntryData{OldName: &zeroValue} diff --git a/github/orgs_audit_log.go b/github/orgs_audit_log.go index d7de77127c5..4c34445fa1b 100644 --- a/github/orgs_audit_log.go +++ b/github/orgs_audit_log.go @@ -127,7 +127,8 @@ type AuditEntry struct { // AuditEntryData represents additional information stuffed into a `data` field. type AuditEntryData struct { - OldName *string `json:"old_name,omitempty"` // The previous name of the repository, for a name change + OldName *string `json:"old_name,omitempty"` // The previous name of the repository, for a name change + OldLogin *string `json:"old_login,omitempty"` // The previous name of the organization, for a name change } // GetAuditLog gets the audit-log entries for an organization. diff --git a/github/orgs_audit_log_test.go b/github/orgs_audit_log_test.go index 2995de5023c..89cdf46242e 100644 --- a/github/orgs_audit_log_test.go +++ b/github/orgs_audit_log_test.go @@ -300,7 +300,8 @@ func TestAuditEntry_Marshal(t *testing.T) { WorkflowID: Int64(1), WorkflowRunID: Int64(1), Data: &AuditEntryData{ - OldName: String("on"), + OldName: String("on"), + OldLogin: String("ol"), }, } @@ -396,7 +397,8 @@ func TestAuditEntry_Marshal(t *testing.T) { "workflow_id": 1, "workflow_run_id": 1, "data": { - "old_name": "on" + "old_name": "on", + "old_login": "ol" } }` From a8da03b06966f3dae0b1476b7d7fe14bacc0ba47 Mon Sep 17 00:00:00 2001 From: Osama Faqhruldin Date: Thu, 3 Aug 2023 01:56:57 -0400 Subject: [PATCH 274/751] Check for nil pointer in update rule parameters (#2854) --- github/repos_rules.go | 18 ++++++++++++++---- github/repos_rules_test.go | 39 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 4 deletions(-) diff --git a/github/repos_rules.go b/github/repos_rules.go index 4e6f5f13474..38d4255a9aa 100644 --- a/github/repos_rules.go +++ b/github/repos_rules.go @@ -118,6 +118,10 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { case "creation", "deletion", "required_linear_history", "required_signatures", "non_fast_forward": r.Parameters = nil case "update": + if RepositoryRule.Parameters == nil { + r.Parameters = nil + return nil + } params := UpdateAllowsFetchAndMergeRuleParameters{} if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { return err @@ -127,6 +131,7 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { rawParams := json.RawMessage(bytes) r.Parameters = &rawParams + case "required_deployments": params := RequiredDeploymentEnvironmentsRuleParameters{} if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { @@ -185,13 +190,18 @@ func NewCreationRule() (rule *RepositoryRule) { // NewUpdateRule creates a rule to only allow users with bypass permission to update matching refs. func NewUpdateRule(params *UpdateAllowsFetchAndMergeRuleParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) + if params != nil { + bytes, _ := json.Marshal(params) - rawParams := json.RawMessage(bytes) + rawParams := json.RawMessage(bytes) + return &RepositoryRule{ + Type: "update", + Parameters: &rawParams, + } + } return &RepositoryRule{ - Type: "update", - Parameters: &rawParams, + Type: "update", } } diff --git a/github/repos_rules_test.go b/github/repos_rules_test.go index 582ec89245b..a57137c688d 100644 --- a/github/repos_rules_test.go +++ b/github/repos_rules_test.go @@ -292,6 +292,45 @@ func TestRepositoriesService_GetRulesForBranch(t *testing.T) { }) } +func TestRepositoriesService_GetRulesForBranchEmptyUpdateRule(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/repo/rules/branches/branch", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `[ + { + "type": "update" + } + ]`) + }) + + ctx := context.Background() + rules, _, err := client.Repositories.GetRulesForBranch(ctx, "o", "repo", "branch") + if err != nil { + t.Errorf("Repositories.GetRulesForBranch returned error: %v", err) + } + + updateRule := NewUpdateRule(nil) + + want := []*RepositoryRule{ + updateRule, + } + if !cmp.Equal(rules, want) { + t.Errorf("Repositories.GetRulesForBranch returned %+v, want %+v", Stringify(rules), Stringify(want)) + } + + const methodName = "GetRulesForBranch" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.GetRulesForBranch(ctx, "o", "repo", "branch") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + func TestRepositoriesService_GetAllRulesets(t *testing.T) { client, mux, _, teardown := setup() defer teardown() From d24bbc2cd0d0df9612ffa4cc4ddb41b5f8cb8b31 Mon Sep 17 00:00:00 2001 From: Lars Lehtonen Date: Mon, 7 Aug 2023 08:45:14 -0700 Subject: [PATCH 275/751] Fix dropped test error (#2858) --- github/repos_releases_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/github/repos_releases_test.go b/github/repos_releases_test.go index 73a9f3a530d..fa33a64cd11 100644 --- a/github/repos_releases_test.go +++ b/github/repos_releases_test.go @@ -498,10 +498,13 @@ func TestRepositoriesService_DownloadReleaseAsset_FollowRedirect(t *testing.T) { ctx := context.Background() reader, _, err := client.Repositories.DownloadReleaseAsset(ctx, "o", "r", 1, http.DefaultClient) - content, err := io.ReadAll(reader) if err != nil { t.Errorf("Repositories.DownloadReleaseAsset returned error: %v", err) } + content, err := io.ReadAll(reader) + if err != nil { + t.Errorf("Reading Repositories.DownloadReleaseAsset returned error: %v", err) + } reader.Close() want := []byte("Hello World") if !bytes.Equal(want, content) { From 868d6dff80b6b7a5edb29c9d6767d98454e3c2c6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Aug 2023 15:50:59 -0400 Subject: [PATCH 276/751] Bump golang.org/x/oauth2 from 0.10.0 to 0.11.0 (#2859) --- go.mod | 8 ++++---- go.sum | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index 541c608cffc..57bbbdc4bce 100644 --- a/go.mod +++ b/go.mod @@ -4,15 +4,15 @@ require ( github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 github.com/google/go-cmp v0.5.9 github.com/google/go-querystring v1.1.0 - golang.org/x/oauth2 v0.10.0 + golang.org/x/oauth2 v0.11.0 ) require ( github.com/cloudflare/circl v1.3.3 // indirect github.com/golang/protobuf v1.5.3 // indirect - golang.org/x/crypto v0.11.0 // indirect - golang.org/x/net v0.12.0 // indirect - golang.org/x/sys v0.10.0 // indirect + golang.org/x/crypto v0.12.0 // indirect + golang.org/x/net v0.14.0 // indirect + golang.org/x/sys v0.11.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.31.0 // indirect ) diff --git a/go.sum b/go.sum index 3528d0fcf92..da61e80b940 100644 --- a/go.sum +++ b/go.sum @@ -885,8 +885,8 @@ golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= -golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= -golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= +golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= +golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1004,8 +1004,8 @@ golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= -golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= +golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= +golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1036,8 +1036,8 @@ golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= -golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8= -golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= +golang.org/x/oauth2 v0.11.0 h1:vPL4xzxBM4niKCW6g9whtaWVXTJf1U5e4aZxxFx/gbU= +golang.org/x/oauth2 v0.11.0/go.mod h1:LdF7O/8bLR/qWK9DrpXmbHLTouvRHK0SgJl0GmDBchk= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1134,8 +1134,8 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= -golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1146,7 +1146,7 @@ golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= +golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1163,7 +1163,7 @@ golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= From b989bf48fdc56b8652bcf0399ca4923eab71ee9d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Aug 2023 15:56:00 -0400 Subject: [PATCH 277/751] Bump golang.org/x/net from 0.12.0 to 0.14.0 in /scrape (#2860) --- scrape/go.mod | 2 +- scrape/go.sum | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index ff0f49cf2b1..35297ea0dee 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -7,5 +7,5 @@ require ( github.com/google/go-cmp v0.5.9 github.com/google/go-github/v53 v53.2.0 github.com/xlzd/gotp v0.1.0 - golang.org/x/net v0.12.0 + golang.org/x/net v0.14.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index bdd49a250ff..304493ef01b 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -30,8 +30,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= -golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= +golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= +golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= @@ -44,8 +44,8 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= -golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= +golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= +golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8= golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -63,15 +63,15 @@ golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= -golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= +golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -81,7 +81,7 @@ golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= From 899235e0a9d750d6fecf9048a676046d50f9d4a3 Mon Sep 17 00:00:00 2001 From: Jarek Porzucek <17789797+jporzucek@users.noreply.github.com> Date: Tue, 8 Aug 2023 14:35:06 +0200 Subject: [PATCH 278/751] Add ListOptions pagination for Dependabot alerts (#2853) Fixes: #2852. --- github/dependabot_alerts.go | 1 + 1 file changed, 1 insertion(+) diff --git a/github/dependabot_alerts.go b/github/dependabot_alerts.go index 7b5d53b3939..a55f540f1be 100644 --- a/github/dependabot_alerts.go +++ b/github/dependabot_alerts.go @@ -76,6 +76,7 @@ type ListAlertsOptions struct { Sort *string `url:"sort,omitempty"` Direction *string `url:"direction,omitempty"` + ListOptions ListCursorOptions } From f36dfa5a8d7e8aa737542a54c4798bcdbc24cf0a Mon Sep 17 00:00:00 2001 From: Diogo Vilela Date: Sun, 13 Aug 2023 17:22:50 +0200 Subject: [PATCH 279/751] Add support for Security Advisories Request CVE endpoint (#2857) Fixes: #2855. --- AUTHORS | 1 + github/github.go | 62 +++++++++++++++--------------- github/security_advisories.go | 37 ++++++++++++++++++ github/security_advisories_test.go | 52 +++++++++++++++++++++++++ 4 files changed, 122 insertions(+), 30 deletions(-) create mode 100644 github/security_advisories.go create mode 100644 github/security_advisories_test.go diff --git a/AUTHORS b/AUTHORS index 5e40cd1f38e..a833043b0fc 100644 --- a/AUTHORS +++ b/AUTHORS @@ -125,6 +125,7 @@ Derek Jobst DeviousLab Dhi Aurrahman Diego Lapiduz +Diogo Vilela Dmitri Shuralyov dmnlk Don Petersen diff --git a/github/github.go b/github/github.go index 1b41ffdc0ef..799608359be 100644 --- a/github/github.go +++ b/github/github.go @@ -179,36 +179,37 @@ type Client struct { common service // Reuse a single struct instead of allocating one for each service on the heap. // Services used for talking to different parts of the GitHub API. - Actions *ActionsService - Activity *ActivityService - Admin *AdminService - Apps *AppsService - Authorizations *AuthorizationsService - Billing *BillingService - Checks *ChecksService - CodeScanning *CodeScanningService - Codespaces *CodespacesService - Dependabot *DependabotService - Enterprise *EnterpriseService - Gists *GistsService - Git *GitService - Gitignores *GitignoresService - Interactions *InteractionsService - IssueImport *IssueImportService - Issues *IssuesService - Licenses *LicensesService - Marketplace *MarketplaceService - Migrations *MigrationService - Organizations *OrganizationsService - Projects *ProjectsService - PullRequests *PullRequestsService - Reactions *ReactionsService - Repositories *RepositoriesService - SCIM *SCIMService - Search *SearchService - SecretScanning *SecretScanningService - Teams *TeamsService - Users *UsersService + Actions *ActionsService + Activity *ActivityService + Admin *AdminService + Apps *AppsService + Authorizations *AuthorizationsService + Billing *BillingService + Checks *ChecksService + CodeScanning *CodeScanningService + Codespaces *CodespacesService + Dependabot *DependabotService + Enterprise *EnterpriseService + Gists *GistsService + Git *GitService + Gitignores *GitignoresService + Interactions *InteractionsService + IssueImport *IssueImportService + Issues *IssuesService + Licenses *LicensesService + Marketplace *MarketplaceService + Migrations *MigrationService + Organizations *OrganizationsService + Projects *ProjectsService + PullRequests *PullRequestsService + Reactions *ReactionsService + Repositories *RepositoriesService + SCIM *SCIMService + Search *SearchService + SecretScanning *SecretScanningService + SecurityAdvisories *SecurityAdvisoriesService + Teams *TeamsService + Users *UsersService } type service struct { @@ -346,6 +347,7 @@ func NewClient(httpClient *http.Client) *Client { c.SCIM = (*SCIMService)(&c.common) c.Search = (*SearchService)(&c.common) c.SecretScanning = (*SecretScanningService)(&c.common) + c.SecurityAdvisories = (*SecurityAdvisoriesService)(&c.common) c.Teams = (*TeamsService)(&c.common) c.Users = (*UsersService)(&c.common) return c diff --git a/github/security_advisories.go b/github/security_advisories.go new file mode 100644 index 00000000000..a75fce54d95 --- /dev/null +++ b/github/security_advisories.go @@ -0,0 +1,37 @@ +// Copyright 2023 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" +) + +type SecurityAdvisoriesService service + +// RequestCVE requests a Common Vulnerabilities and Exposures (CVE) for a repository security advisory. +// The ghsaID is the GitHub Security Advisory identifier of the advisory. +// +// GitHub API docs: https://docs.github.com/en/rest/security-advisories/repository-advisories#request-a-cve-for-a-repository-security-advisory +func (s *SecurityAdvisoriesService) RequestCVE(ctx context.Context, owner, repo, ghsaID string) (*Response, error) { + url := fmt.Sprintf("repos/%v/%v/security-advisories/%v/cve", owner, repo, ghsaID) + + req, err := s.client.NewRequest("POST", url, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req, nil) + if err != nil { + if _, ok := err.(*AcceptedError); ok { + return resp, nil + } + + return resp, err + } + + return resp, nil +} diff --git a/github/security_advisories_test.go b/github/security_advisories_test.go new file mode 100644 index 00000000000..e4a6fbd7c14 --- /dev/null +++ b/github/security_advisories_test.go @@ -0,0 +1,52 @@ +// Copyright 2023 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 TestSecurityAdvisoriesService_RequestCVE(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/security-advisories/ghsa_id_ok/cve", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + w.WriteHeader(http.StatusOK) + }) + + mux.HandleFunc("/repos/o/r/security-advisories/ghsa_id_accepted/cve", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + w.WriteHeader(http.StatusAccepted) + }) + + ctx := context.Background() + _, err := client.SecurityAdvisories.RequestCVE(ctx, "o", "r", "ghsa_id_ok") + if err != nil { + t.Errorf("SecurityAdvisoriesService.RequestCVE returned error: %v", err) + } + + _, err = client.SecurityAdvisories.RequestCVE(ctx, "o", "r", "ghsa_id_accepted") + if err != nil { + t.Errorf("SecurityAdvisoriesService.RequestCVE returned error: %v", err) + } + + const methodName = "RequestCVE" + testBadOptions(t, methodName, func() (err error) { + _, err = client.SecurityAdvisories.RequestCVE(ctx, "\n", "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + resp, err := client.SecurityAdvisories.RequestCVE(ctx, "o", "r", "ghsa_id") + if err == nil { + t.Errorf("testNewRequestAndDoFailure %v should have return err", methodName) + } + return resp, err + }) +} From 5ac6057667d1ca54b78f8677cde8a481abe50d70 Mon Sep 17 00:00:00 2001 From: Byron Wolfman Date: Mon, 14 Aug 2023 11:58:50 -0300 Subject: [PATCH 280/751] Add support for the security and analysis webhook event (#2862) Fixes: #2861. --- github/event.go | 2 + github/event_types.go | 25 ++ github/event_types_test.go | 335 ++++++++++++++++++++++++++ github/github-accessors.go | 64 +++++ github/github-accessors_test.go | 56 +++++ github/messages.go | 1 + github/messages_test.go | 4 + github/repos_hooks_deliveries_test.go | 1 + 8 files changed, 488 insertions(+) diff --git a/github/event.go b/github/event.go index 2349cb77600..b5f39ac7b90 100644 --- a/github/event.go +++ b/github/event.go @@ -133,6 +133,8 @@ func (e *Event) ParsePayload() (payload interface{}, err error) { payload = &SecretScanningAlertEvent{} case "SecurityAdvisoryEvent": payload = &SecurityAdvisoryEvent{} + case "SecurityAndAnalysisEvent": + payload = &SecurityAndAnalysisEvent{} case "StarEvent": payload = &StarEvent{} case "StatusEvent": diff --git a/github/event_types.go b/github/event_types.go index a24134479c0..edbe8f53330 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -1325,6 +1325,31 @@ type SecretScanningAlertEvent struct { Installation *Installation `json:"installation,omitempty"` } +// SecurityAndAnalysisEvent is triggered when code security and analysis features +// are enabled or disabled for a repository. +// +// GitHub API docs: https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#security_and_analysis +type SecurityAndAnalysisEvent struct { + Changes *SecurityAndAnalysisChange `json:"changes,omitempty"` + Enterprise *Enterprise `json:"enterprise,omitempty"` + Installation *Installation `json:"installation,omitempty"` + Organization *Organization `json:"organization,omitempty"` + Repository *Repository `json:"repository,omitempty"` + Sender *User `json:"sender,omitempty"` +} + +// SecurityAndAnalysisChange represents the changes when security and analysis +// features are enabled or disabled for a repository. +type SecurityAndAnalysisChange struct { + From *SecurityAndAnalysisChangeFrom `json:"from,omitempty"` +} + +// SecurityAndAnalysisChangeFrom represents which change was made when security +// and analysis features are enabled or disabled for a repository. +type SecurityAndAnalysisChangeFrom struct { + SecurityAndAnalysis *SecurityAndAnalysis `json:"security_and_analysis,omitempty"` +} + // StarEvent is triggered when a star is added or removed from a repository. // The Webhook event name is "star". // diff --git a/github/event_types_test.go b/github/event_types_test.go index 8d6a8b95b16..3703d454af8 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -15808,6 +15808,341 @@ func TestSecurityAdvisoryEvent_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } +func TestSecurityAndAnalysisEvent_Marshal(t *testing.T) { + testJSONMarshal(t, &SecurityAndAnalysisEvent{}, "{}") + + u := &SecurityAndAnalysisEvent{ + Changes: &SecurityAndAnalysisChange{ + From: &SecurityAndAnalysisChangeFrom{ + SecurityAndAnalysis: &SecurityAndAnalysis{ + AdvancedSecurity: &AdvancedSecurity{ + Status: String("enabled"), + }, + SecretScanning: &SecretScanning{ + Status: String("enabled"), + }, + SecretScanningPushProtection: &SecretScanningPushProtection{ + Status: String("enabled"), + }, + DependabotSecurityUpdates: &DependabotSecurityUpdates{ + Status: String("enabled"), + }, + }, + }, + }, + Enterprise: &Enterprise{ + ID: Int(1), + Slug: String("s"), + Name: String("n"), + NodeID: String("nid"), + AvatarURL: String("au"), + Description: String("d"), + WebsiteURL: String("wu"), + HTMLURL: String("hu"), + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + }, + Installation: &Installation{ + ID: Int64(1), + NodeID: String("nid"), + AppID: Int64(1), + AppSlug: String("as"), + TargetID: Int64(1), + Account: &User{ + Login: String("l"), + ID: Int64(1), + URL: String("u"), + AvatarURL: String("a"), + GravatarID: String("g"), + Name: String("n"), + Company: String("c"), + Blog: String("b"), + Location: String("l"), + Email: String("e"), + Hireable: Bool(true), + Bio: String("b"), + TwitterUsername: String("t"), + PublicRepos: Int(1), + Followers: Int(1), + Following: Int(1), + CreatedAt: &Timestamp{referenceTime}, + SuspendedAt: &Timestamp{referenceTime}, + }, + AccessTokensURL: String("atu"), + RepositoriesURL: String("ru"), + HTMLURL: String("hu"), + TargetType: String("tt"), + SingleFileName: String("sfn"), + RepositorySelection: String("rs"), + Events: []string{"e"}, + SingleFilePaths: []string{"s"}, + Permissions: &InstallationPermissions{ + Actions: String("a"), + Administration: String("ad"), + Checks: String("c"), + Contents: String("co"), + ContentReferences: String("cr"), + Deployments: String("d"), + Environments: String("e"), + Issues: String("i"), + Metadata: String("md"), + Members: String("m"), + OrganizationAdministration: String("oa"), + OrganizationHooks: String("oh"), + OrganizationPlan: String("op"), + OrganizationPreReceiveHooks: String("opr"), + OrganizationProjects: String("op"), + OrganizationSecrets: String("os"), + OrganizationSelfHostedRunners: String("osh"), + OrganizationUserBlocking: String("oub"), + Packages: String("pkg"), + Pages: String("pg"), + PullRequests: String("pr"), + RepositoryHooks: String("rh"), + RepositoryProjects: String("rp"), + RepositoryPreReceiveHooks: String("rprh"), + Secrets: String("s"), + SecretScanningAlerts: String("ssa"), + SecurityEvents: String("se"), + SingleFile: String("sf"), + Statuses: String("s"), + TeamDiscussions: String("td"), + VulnerabilityAlerts: String("va"), + Workflows: String("w"), + }, + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + HasMultipleSingleFiles: Bool(false), + SuspendedBy: &User{ + Login: String("l"), + ID: Int64(1), + URL: String("u"), + AvatarURL: String("a"), + GravatarID: String("g"), + Name: String("n"), + Company: String("c"), + Blog: String("b"), + Location: String("l"), + Email: String("e"), + Hireable: Bool(true), + Bio: String("b"), + TwitterUsername: String("t"), + PublicRepos: Int(1), + Followers: Int(1), + Following: Int(1), + CreatedAt: &Timestamp{referenceTime}, + SuspendedAt: &Timestamp{referenceTime}, + }, + SuspendedAt: &Timestamp{referenceTime}, + }, + Organization: &Organization{ + BillingEmail: String("be"), + Blog: String("b"), + Company: String("c"), + Email: String("e"), + TwitterUsername: String("tu"), + Location: String("loc"), + Name: String("n"), + Description: String("d"), + IsVerified: Bool(true), + HasOrganizationProjects: Bool(true), + HasRepositoryProjects: Bool(true), + DefaultRepoPermission: String("drp"), + MembersCanCreateRepos: Bool(true), + MembersCanCreateInternalRepos: Bool(true), + MembersCanCreatePrivateRepos: Bool(true), + MembersCanCreatePublicRepos: Bool(false), + MembersAllowedRepositoryCreationType: String("marct"), + MembersCanCreatePages: Bool(true), + MembersCanCreatePublicPages: Bool(false), + MembersCanCreatePrivatePages: Bool(true), + }, + Repository: &Repository{ + ID: Int64(1), + URL: String("s"), + Name: String("n"), + }, + Sender: &User{ + Login: String("l"), + ID: Int64(1), + NodeID: String("n"), + URL: String("u"), + ReposURL: String("r"), + EventsURL: String("e"), + AvatarURL: String("a"), + }, + } + + want := `{ + "changes": { + "from": { + "security_and_analysis": { + "advanced_security": { + "status": "enabled" + }, + "secret_scanning": { + "status": "enabled" + }, + "secret_scanning_push_protection": { + "status": "enabled" + }, + "dependabot_security_updates": { + "status": "enabled" + } + } + } + }, + "enterprise": { + "id": 1, + "slug": "s", + "name": "n", + "node_id": "nid", + "avatar_url": "au", + "description": "d", + "website_url": "wu", + "html_url": "hu", + "created_at": ` + referenceTimeStr + `, + "updated_at": ` + referenceTimeStr + ` + }, + "installation": { + "id": 1, + "node_id": "nid", + "app_id": 1, + "app_slug": "as", + "target_id": 1, + "account": { + "login": "l", + "id": 1, + "avatar_url": "a", + "gravatar_id": "g", + "name": "n", + "company": "c", + "blog": "b", + "location": "l", + "email": "e", + "hireable": true, + "bio": "b", + "twitter_username": "t", + "public_repos": 1, + "followers": 1, + "following": 1, + "created_at": ` + referenceTimeStr + `, + "suspended_at": ` + referenceTimeStr + `, + "url": "u" + }, + "access_tokens_url": "atu", + "repositories_url": "ru", + "html_url": "hu", + "target_type": "tt", + "single_file_name": "sfn", + "repository_selection": "rs", + "events": [ + "e" + ], + "single_file_paths": [ + "s" + ], + "permissions": { + "actions": "a", + "administration": "ad", + "checks": "c", + "contents": "co", + "content_references": "cr", + "deployments": "d", + "environments": "e", + "issues": "i", + "metadata": "md", + "members": "m", + "organization_administration": "oa", + "organization_hooks": "oh", + "organization_plan": "op", + "organization_pre_receive_hooks": "opr", + "organization_projects": "op", + "organization_secrets": "os", + "organization_self_hosted_runners": "osh", + "organization_user_blocking": "oub", + "packages": "pkg", + "pages": "pg", + "pull_requests": "pr", + "repository_hooks": "rh", + "repository_projects": "rp", + "repository_pre_receive_hooks": "rprh", + "secrets": "s", + "secret_scanning_alerts": "ssa", + "security_events": "se", + "single_file": "sf", + "statuses": "s", + "team_discussions": "td", + "vulnerability_alerts": "va", + "workflows": "w" + }, + "created_at": ` + referenceTimeStr + `, + "updated_at": ` + referenceTimeStr + `, + "has_multiple_single_files": false, + "suspended_by": { + "login": "l", + "id": 1, + "avatar_url": "a", + "gravatar_id": "g", + "name": "n", + "company": "c", + "blog": "b", + "location": "l", + "email": "e", + "hireable": true, + "bio": "b", + "twitter_username": "t", + "public_repos": 1, + "followers": 1, + "following": 1, + "created_at": ` + referenceTimeStr + `, + "suspended_at": ` + referenceTimeStr + `, + "url": "u" + }, + "suspended_at": ` + referenceTimeStr + ` + }, + "organization": { + "name": "n", + "company": "c", + "blog": "b", + "location": "loc", + "email": "e", + "twitter_username": "tu", + "description": "d", + "billing_email": "be", + "is_verified": true, + "has_organization_projects": true, + "has_repository_projects": true, + "default_repository_permission": "drp", + "members_can_create_repositories": true, + "members_can_create_public_repositories": false, + "members_can_create_private_repositories": true, + "members_can_create_internal_repositories": true, + "members_allowed_repository_creation_type": "marct", + "members_can_create_pages": true, + "members_can_create_public_pages": false, + "members_can_create_private_pages": true + }, + "repository": { + "id": 1, + "url": "s", + "name": "n" + }, + "sender": { + "login": "l", + "id": 1, + "node_id": "n", + "avatar_url": "a", + "url": "u", + "events_url": "e", + "repos_url": "r" + }, + "target_type": "running" + }` + + testJSONMarshal(t, u, want) +} + func TestCodeScanningAlertEvent_Marshal(t *testing.T) { testJSONMarshal(t, &CodeScanningAlertEvent{}, "{}") diff --git a/github/github-accessors.go b/github/github-accessors.go index 3f665ede5cb..b76cc3c0cab 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -20270,6 +20270,70 @@ func (s *SecurityAndAnalysis) GetSecretScanningPushProtection() *SecretScanningP return s.SecretScanningPushProtection } +// GetFrom returns the From field. +func (s *SecurityAndAnalysisChange) GetFrom() *SecurityAndAnalysisChangeFrom { + if s == nil { + return nil + } + return s.From +} + +// GetSecurityAndAnalysis returns the SecurityAndAnalysis field. +func (s *SecurityAndAnalysisChangeFrom) GetSecurityAndAnalysis() *SecurityAndAnalysis { + if s == nil { + return nil + } + return s.SecurityAndAnalysis +} + +// GetChanges returns the Changes field. +func (s *SecurityAndAnalysisEvent) GetChanges() *SecurityAndAnalysisChange { + if s == nil { + return nil + } + return s.Changes +} + +// GetEnterprise returns the Enterprise field. +func (s *SecurityAndAnalysisEvent) GetEnterprise() *Enterprise { + if s == nil { + return nil + } + return s.Enterprise +} + +// GetInstallation returns the Installation field. +func (s *SecurityAndAnalysisEvent) GetInstallation() *Installation { + if s == nil { + return nil + } + return s.Installation +} + +// GetOrganization returns the Organization field. +func (s *SecurityAndAnalysisEvent) GetOrganization() *Organization { + if s == nil { + return nil + } + return s.Organization +} + +// GetRepository returns the Repository field. +func (s *SecurityAndAnalysisEvent) GetRepository() *Repository { + if s == nil { + return nil + } + return s.Repository +} + +// GetSender returns the Sender field. +func (s *SecurityAndAnalysisEvent) GetSender() *User { + if s == nil { + return nil + } + return s.Sender +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (s *SelectedReposList) GetTotalCount() int { if s == nil || s.TotalCount == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 712d8fc94dd..479f3c8d54d 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -23643,6 +23643,62 @@ func TestSecurityAndAnalysis_GetSecretScanningPushProtection(tt *testing.T) { s.GetSecretScanningPushProtection() } +func TestSecurityAndAnalysisChange_GetFrom(tt *testing.T) { + s := &SecurityAndAnalysisChange{} + s.GetFrom() + s = nil + s.GetFrom() +} + +func TestSecurityAndAnalysisChangeFrom_GetSecurityAndAnalysis(tt *testing.T) { + s := &SecurityAndAnalysisChangeFrom{} + s.GetSecurityAndAnalysis() + s = nil + s.GetSecurityAndAnalysis() +} + +func TestSecurityAndAnalysisEvent_GetChanges(tt *testing.T) { + s := &SecurityAndAnalysisEvent{} + s.GetChanges() + s = nil + s.GetChanges() +} + +func TestSecurityAndAnalysisEvent_GetEnterprise(tt *testing.T) { + s := &SecurityAndAnalysisEvent{} + s.GetEnterprise() + s = nil + s.GetEnterprise() +} + +func TestSecurityAndAnalysisEvent_GetInstallation(tt *testing.T) { + s := &SecurityAndAnalysisEvent{} + s.GetInstallation() + s = nil + s.GetInstallation() +} + +func TestSecurityAndAnalysisEvent_GetOrganization(tt *testing.T) { + s := &SecurityAndAnalysisEvent{} + s.GetOrganization() + s = nil + s.GetOrganization() +} + +func TestSecurityAndAnalysisEvent_GetRepository(tt *testing.T) { + s := &SecurityAndAnalysisEvent{} + s.GetRepository() + s = nil + s.GetRepository() +} + +func TestSecurityAndAnalysisEvent_GetSender(tt *testing.T) { + s := &SecurityAndAnalysisEvent{} + s.GetSender() + s = nil + s.GetSender() +} + func TestSelectedReposList_GetTotalCount(tt *testing.T) { var zeroValue int s := &SelectedReposList{TotalCount: &zeroValue} diff --git a/github/messages.go b/github/messages.go index 929587d337f..d62182689c4 100644 --- a/github/messages.go +++ b/github/messages.go @@ -96,6 +96,7 @@ var ( "release": "ReleaseEvent", "secret_scanning_alert": "SecretScanningAlertEvent", "security_advisory": "SecurityAdvisoryEvent", + "security_and_analysis": "SecurityAndAnalysisEvent", "star": "StarEvent", "status": "StatusEvent", "team": "TeamEvent", diff --git a/github/messages_test.go b/github/messages_test.go index 8ee38eb346b..b3828608505 100644 --- a/github/messages_test.go +++ b/github/messages_test.go @@ -452,6 +452,10 @@ func TestParseWebHook(t *testing.T) { payload: &SecurityAdvisoryEvent{}, messageType: "security_advisory", }, + { + payload: &SecurityAndAnalysisEvent{}, + messageType: "security_and_analysis", + }, { payload: &StarEvent{}, messageType: "star", diff --git a/github/repos_hooks_deliveries_test.go b/github/repos_hooks_deliveries_test.go index d1dda365194..a605c7f3654 100644 --- a/github/repos_hooks_deliveries_test.go +++ b/github/repos_hooks_deliveries_test.go @@ -190,6 +190,7 @@ var hookDeliveryPayloadTypeToStruct = map[string]interface{}{ "repository_vulnerability_alert": &RepositoryVulnerabilityAlertEvent{}, "secret_scanning_alert": &SecretScanningAlertEvent{}, "security_advisory": &SecurityAdvisoryEvent{}, + "security_and_analysis": &SecurityAndAnalysisEvent{}, "star": &StarEvent{}, "status": &StatusEvent{}, "team": &TeamEvent{}, From 3ecf12c9870444138bbf26af0c607099eb87b5e6 Mon Sep 17 00:00:00 2001 From: Nikita Pivkin <100182843+nikpivkin@users.noreply.github.com> Date: Tue, 15 Aug 2023 06:05:18 +0700 Subject: [PATCH 281/751] Add support for projects_v2 and projects_v2_item webhook events (#2868) --- github/event.go | 4 + github/event_types.go | 71 +++++ github/event_types_test.go | 390 ++++++++++++++++++++++++++ github/github-accessors.go | 296 +++++++++++++++++++ github/github-accessors_test.go | 328 ++++++++++++++++++++++ github/messages.go | 2 + github/messages_test.go | 8 + github/repos_hooks_deliveries_test.go | 2 + 8 files changed, 1101 insertions(+) diff --git a/github/event.go b/github/event.go index b5f39ac7b90..7ec46b5a289 100644 --- a/github/event.go +++ b/github/event.go @@ -105,6 +105,10 @@ func (e *Event) ParsePayload() (payload interface{}, err error) { payload = &ProjectCardEvent{} case "ProjectColumnEvent": payload = &ProjectColumnEvent{} + case "ProjectV2Event": + payload = &ProjectV2Event{} + case "ProjectV2ItemEvent": + payload = &ProjectV2ItemEvent{} case "PublicEvent": payload = &PublicEvent{} case "PullRequestEvent": diff --git a/github/event_types.go b/github/event_types.go index edbe8f53330..c9e97ffa291 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -942,6 +942,77 @@ type ProjectColumnEvent struct { Installation *Installation `json:"installation,omitempty"` } +// ProjectV2Event is triggered when there is activity relating to an organization-level project. +// The Webhook event name is "projects_v2". +// +// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#projects_v2 +type ProjectV2Event struct { + Action *string `json:"action,omitempty"` + ProjectsV2 *ProjectsV2 `json:"projects_v2,omitempty"` + + // The following fields are only populated by Webhook events. + Installation *Installation `json:"installation,omitempty"` + Org *Organization `json:"organization,omitempty"` + Sender *User `json:"sender,omitempty"` +} + +// ProjectsV2 represents a projects v2 project. +type ProjectsV2 struct { + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Owner *User `json:"owner,omitempty"` + Creator *User `json:"creator,omitempty"` + Title *string `json:"title,omitempty"` + Description *string `json:"description,omitempty"` + Public *bool `json:"public,omitempty"` + ClosedAt *Timestamp `json:"closed_at,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + DeletedAt *Timestamp `json:"deleted_at,omitempty"` + Number *int `json:"number,omitempty"` + ShortDescription *string `json:"short_description,omitempty"` + DeletedBy *User `json:"deleted_by,omitempty"` +} + +// ProjectV2ItemEvent is triggered when there is activity relating to an item on an organization-level project. +// The Webhook event name is "projects_v2_item". +// +// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#projects_v2_item +type ProjectV2ItemEvent struct { + Action *string `json:"action,omitempty"` + Changes *ProjectV2ItemChange `json:"changes,omitempty"` + ProjectV2Item *ProjectV2Item `json:"projects_v2_item,omitempty"` + + // The following fields are only populated by Webhook events. + Installation *Installation `json:"installation,omitempty"` + Org *Organization `json:"organization,omitempty"` + Sender *User `json:"sender,omitempty"` +} + +// ProjectV2ItemChange represents a project v2 item change. +type ProjectV2ItemChange struct { + ArchivedAt *ArchivedAt `json:"archived_at,omitempty"` +} + +// ArchivedAt represents an archiving date change. +type ArchivedAt struct { + From *Timestamp `json:"from,omitempty"` + To *Timestamp `json:"to,omitempty"` +} + +// ProjectsV2 represents an item belonging to a project. +type ProjectV2Item struct { + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + ProjectNodeID *string `json:"project_node_id,omitempty"` + ContentNodeID *string `json:"content_node_id,omitempty"` + ContentType *string `json:"content_type,omitempty"` + Creator *User `json:"creator,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + ArchivedAt *Timestamp `json:"archived_at,omitempty"` +} + // PublicEvent is triggered when a private repository is open sourced. // According to GitHub: "Without a doubt: the best GitHub event." // The Webhook event name is "public". diff --git a/github/event_types_test.go b/github/event_types_test.go index 3703d454af8..c1cb4d9636f 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -14092,6 +14092,396 @@ func TestProjectColumnEvent_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } +func TestProjectV2Event_Marshal(t *testing.T) { + testJSONMarshal(t, &ProjectV2Event{}, "{}") + + u := &ProjectV2Event{ + Action: String("a"), + ProjectsV2: &ProjectsV2{ + ID: Int64(1), + NodeID: String("nid"), + Owner: &User{ + Login: String("l"), + ID: Int64(1), + NodeID: String("n"), + URL: String("u"), + ReposURL: String("r"), + EventsURL: String("e"), + AvatarURL: String("a"), + }, + Creator: &User{ + Login: String("l"), + ID: Int64(1), + NodeID: String("n"), + URL: String("u"), + ReposURL: String("r"), + EventsURL: String("e"), + AvatarURL: String("a"), + }, + Title: String("t"), + Description: String("d"), + Public: Bool(true), + ClosedAt: &Timestamp{referenceTime}, + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + DeletedAt: &Timestamp{referenceTime}, + Number: Int(1), + ShortDescription: String("sd"), + DeletedBy: &User{ + Login: String("l"), + ID: Int64(1), + NodeID: String("n"), + URL: String("u"), + ReposURL: String("r"), + EventsURL: String("e"), + AvatarURL: String("a"), + }, + }, + Org: &Organization{ + BillingEmail: String("be"), + Blog: String("b"), + Company: String("c"), + Email: String("e"), + TwitterUsername: String("tu"), + Location: String("loc"), + Name: String("n"), + Description: String("d"), + IsVerified: Bool(true), + HasOrganizationProjects: Bool(true), + HasRepositoryProjects: Bool(true), + DefaultRepoPermission: String("drp"), + MembersCanCreateRepos: Bool(true), + MembersCanCreateInternalRepos: Bool(true), + MembersCanCreatePrivateRepos: Bool(true), + MembersCanCreatePublicRepos: Bool(false), + MembersAllowedRepositoryCreationType: String("marct"), + MembersCanCreatePages: Bool(true), + MembersCanCreatePublicPages: Bool(false), + MembersCanCreatePrivatePages: Bool(true), + }, + Sender: &User{ + Login: String("l"), + ID: Int64(1), + NodeID: String("n"), + URL: String("u"), + ReposURL: String("r"), + EventsURL: String("e"), + AvatarURL: String("a"), + }, + Installation: &Installation{ + ID: Int64(1), + NodeID: String("nid"), + AppID: Int64(1), + AppSlug: String("as"), + TargetID: Int64(1), + Account: &User{ + Login: String("l"), + ID: Int64(1), + URL: String("u"), + AvatarURL: String("a"), + GravatarID: String("g"), + Name: String("n"), + Company: String("c"), + Blog: String("b"), + Location: String("l"), + Email: String("e"), + Hireable: Bool(true), + Bio: String("b"), + TwitterUsername: String("t"), + PublicRepos: Int(1), + Followers: Int(1), + Following: Int(1), + CreatedAt: &Timestamp{referenceTime}, + SuspendedAt: &Timestamp{referenceTime}, + }, + }, + } + + want := `{ + "action": "a", + "projects_v2": { + "id": 1, + "node_id": "nid", + "owner": { + "login": "l", + "id": 1, + "node_id": "n", + "avatar_url": "a", + "url": "u", + "events_url": "e", + "repos_url": "r" + }, + "creator": { + "login": "l", + "id": 1, + "node_id": "n", + "avatar_url": "a", + "url": "u", + "events_url": "e", + "repos_url": "r" + }, + "title": "t", + "description": "d", + "public": true, + "closed_at": ` + referenceTimeStr + `, + "created_at": ` + referenceTimeStr + `, + "updated_at": ` + referenceTimeStr + `, + "deleted_at": ` + referenceTimeStr + `, + "number": 1, + "short_description": "sd", + "deleted_by": { + "login": "l", + "id": 1, + "node_id": "n", + "avatar_url": "a", + "url": "u", + "events_url": "e", + "repos_url": "r" + } + }, + "organization": { + "name": "n", + "company": "c", + "blog": "b", + "location": "loc", + "email": "e", + "twitter_username": "tu", + "description": "d", + "billing_email": "be", + "is_verified": true, + "has_organization_projects": true, + "has_repository_projects": true, + "default_repository_permission": "drp", + "members_can_create_repositories": true, + "members_can_create_public_repositories": false, + "members_can_create_private_repositories": true, + "members_can_create_internal_repositories": true, + "members_allowed_repository_creation_type": "marct", + "members_can_create_pages": true, + "members_can_create_public_pages": false, + "members_can_create_private_pages": true + }, + "sender": { + "login": "l", + "id": 1, + "node_id": "n", + "avatar_url": "a", + "url": "u", + "events_url": "e", + "repos_url": "r" + }, + "installation": { + "id": 1, + "node_id": "nid", + "app_id": 1, + "app_slug": "as", + "target_id": 1, + "account": { + "login": "l", + "id": 1, + "avatar_url": "a", + "gravatar_id": "g", + "name": "n", + "company": "c", + "blog": "b", + "location": "l", + "email": "e", + "hireable": true, + "bio": "b", + "twitter_username": "t", + "public_repos": 1, + "followers": 1, + "following": 1, + "created_at": ` + referenceTimeStr + `, + "suspended_at": ` + referenceTimeStr + `, + "url": "u" + } + } + }` + + testJSONMarshal(t, u, want) +} + +func TestProjectV2ItemEvent_Marshal(t *testing.T) { + testJSONMarshal(t, &ProjectV2ItemEvent{}, "{}") + + u := &ProjectV2ItemEvent{ + Action: String("a"), + Changes: &ProjectV2ItemChange{ + ArchivedAt: &ArchivedAt{ + From: &Timestamp{referenceTime}, + To: &Timestamp{referenceTime}, + }, + }, + ProjectV2Item: &ProjectV2Item{ + ID: Int64(1), + NodeID: String("nid"), + ProjectNodeID: String("pnid"), + ContentNodeID: String("cnid"), + ContentType: String("ct"), + Creator: &User{ + Login: String("l"), + ID: Int64(1), + NodeID: String("n"), + URL: String("u"), + ReposURL: String("r"), + EventsURL: String("e"), + AvatarURL: String("a"), + }, + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + ArchivedAt: &Timestamp{referenceTime}, + }, + Org: &Organization{ + BillingEmail: String("be"), + Blog: String("b"), + Company: String("c"), + Email: String("e"), + TwitterUsername: String("tu"), + Location: String("loc"), + Name: String("n"), + Description: String("d"), + IsVerified: Bool(true), + HasOrganizationProjects: Bool(true), + HasRepositoryProjects: Bool(true), + DefaultRepoPermission: String("drp"), + MembersCanCreateRepos: Bool(true), + MembersCanCreateInternalRepos: Bool(true), + MembersCanCreatePrivateRepos: Bool(true), + MembersCanCreatePublicRepos: Bool(false), + MembersAllowedRepositoryCreationType: String("marct"), + MembersCanCreatePages: Bool(true), + MembersCanCreatePublicPages: Bool(false), + MembersCanCreatePrivatePages: Bool(true), + }, + Sender: &User{ + Login: String("l"), + ID: Int64(1), + NodeID: String("n"), + URL: String("u"), + ReposURL: String("r"), + EventsURL: String("e"), + AvatarURL: String("a"), + }, + Installation: &Installation{ + ID: Int64(1), + NodeID: String("nid"), + AppID: Int64(1), + AppSlug: String("as"), + TargetID: Int64(1), + Account: &User{ + Login: String("l"), + ID: Int64(1), + URL: String("u"), + AvatarURL: String("a"), + GravatarID: String("g"), + Name: String("n"), + Company: String("c"), + Blog: String("b"), + Location: String("l"), + Email: String("e"), + Hireable: Bool(true), + Bio: String("b"), + TwitterUsername: String("t"), + PublicRepos: Int(1), + Followers: Int(1), + Following: Int(1), + CreatedAt: &Timestamp{referenceTime}, + SuspendedAt: &Timestamp{referenceTime}, + }, + }, + } + + want := `{ + "action": "a", + "changes": { + "archived_at": { + "from": ` + referenceTimeStr + `, + "to": ` + referenceTimeStr + ` + } + }, + "projects_v2_item": { + "id": 1, + "node_id": "nid", + "project_node_id": "pnid", + "content_node_id": "cnid", + "content_type": "ct", + "creator": { + "login": "l", + "id": 1, + "node_id": "n", + "avatar_url": "a", + "url": "u", + "events_url": "e", + "repos_url": "r" + }, + "created_at": ` + referenceTimeStr + `, + "updated_at": ` + referenceTimeStr + `, + "archived_at": ` + referenceTimeStr + ` + }, + "organization": { + "name": "n", + "company": "c", + "blog": "b", + "location": "loc", + "email": "e", + "twitter_username": "tu", + "description": "d", + "billing_email": "be", + "is_verified": true, + "has_organization_projects": true, + "has_repository_projects": true, + "default_repository_permission": "drp", + "members_can_create_repositories": true, + "members_can_create_public_repositories": false, + "members_can_create_private_repositories": true, + "members_can_create_internal_repositories": true, + "members_allowed_repository_creation_type": "marct", + "members_can_create_pages": true, + "members_can_create_public_pages": false, + "members_can_create_private_pages": true + }, + "sender": { + "login": "l", + "id": 1, + "node_id": "n", + "avatar_url": "a", + "url": "u", + "events_url": "e", + "repos_url": "r" + }, + "installation": { + "id": 1, + "node_id": "nid", + "app_id": 1, + "app_slug": "as", + "target_id": 1, + "account": { + "login": "l", + "id": 1, + "avatar_url": "a", + "gravatar_id": "g", + "name": "n", + "company": "c", + "blog": "b", + "location": "l", + "email": "e", + "hireable": true, + "bio": "b", + "twitter_username": "t", + "public_repos": 1, + "followers": 1, + "following": 1, + "created_at": ` + referenceTimeStr + `, + "suspended_at": ` + referenceTimeStr + `, + "url": "u" + } + } + }` + + testJSONMarshal(t, u, want) +} + func TestPullRequestEvent_Marshal(t *testing.T) { testJSONMarshal(t, &PullRequestEvent{}, "{}") diff --git a/github/github-accessors.go b/github/github-accessors.go index b76cc3c0cab..1fabd520ee1 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -854,6 +854,22 @@ func (a *AppConfig) GetWebhookSecret() string { return *a.WebhookSecret } +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (a *ArchivedAt) GetFrom() Timestamp { + if a == nil || a.From == nil { + return Timestamp{} + } + return *a.From +} + +// GetTo returns the To field if it's non-nil, zero value otherwise. +func (a *ArchivedAt) GetTo() Timestamp { + if a == nil || a.To == nil { + return Timestamp{} + } + return *a.To +} + // GetArchiveDownloadURL returns the ArchiveDownloadURL field if it's non-nil, zero value otherwise. func (a *Artifact) GetArchiveDownloadURL() string { if a == nil || a.ArchiveDownloadURL == nil { @@ -14374,6 +14390,286 @@ func (p *ProjectPermissionLevel) GetUser() *User { return p.User } +// GetClosedAt returns the ClosedAt field if it's non-nil, zero value otherwise. +func (p *ProjectsV2) GetClosedAt() Timestamp { + if p == nil || p.ClosedAt == nil { + return Timestamp{} + } + return *p.ClosedAt +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (p *ProjectsV2) GetCreatedAt() Timestamp { + if p == nil || p.CreatedAt == nil { + return Timestamp{} + } + return *p.CreatedAt +} + +// GetCreator returns the Creator field. +func (p *ProjectsV2) GetCreator() *User { + if p == nil { + return nil + } + return p.Creator +} + +// GetDeletedAt returns the DeletedAt field if it's non-nil, zero value otherwise. +func (p *ProjectsV2) GetDeletedAt() Timestamp { + if p == nil || p.DeletedAt == nil { + return Timestamp{} + } + return *p.DeletedAt +} + +// GetDeletedBy returns the DeletedBy field. +func (p *ProjectsV2) GetDeletedBy() *User { + if p == nil { + return nil + } + return p.DeletedBy +} + +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (p *ProjectsV2) GetDescription() string { + if p == nil || p.Description == nil { + return "" + } + return *p.Description +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (p *ProjectsV2) GetID() int64 { + if p == nil || p.ID == nil { + return 0 + } + return *p.ID +} + +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (p *ProjectsV2) GetNodeID() string { + if p == nil || p.NodeID == nil { + return "" + } + return *p.NodeID +} + +// GetNumber returns the Number field if it's non-nil, zero value otherwise. +func (p *ProjectsV2) GetNumber() int { + if p == nil || p.Number == nil { + return 0 + } + return *p.Number +} + +// GetOwner returns the Owner field. +func (p *ProjectsV2) GetOwner() *User { + if p == nil { + return nil + } + return p.Owner +} + +// GetPublic returns the Public field if it's non-nil, zero value otherwise. +func (p *ProjectsV2) GetPublic() bool { + if p == nil || p.Public == nil { + return false + } + return *p.Public +} + +// GetShortDescription returns the ShortDescription field if it's non-nil, zero value otherwise. +func (p *ProjectsV2) GetShortDescription() string { + if p == nil || p.ShortDescription == nil { + return "" + } + return *p.ShortDescription +} + +// GetTitle returns the Title field if it's non-nil, zero value otherwise. +func (p *ProjectsV2) GetTitle() string { + if p == nil || p.Title == nil { + return "" + } + return *p.Title +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (p *ProjectsV2) GetUpdatedAt() Timestamp { + if p == nil || p.UpdatedAt == nil { + return Timestamp{} + } + return *p.UpdatedAt +} + +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (p *ProjectV2Event) GetAction() string { + if p == nil || p.Action == nil { + return "" + } + return *p.Action +} + +// GetInstallation returns the Installation field. +func (p *ProjectV2Event) GetInstallation() *Installation { + if p == nil { + return nil + } + return p.Installation +} + +// GetOrg returns the Org field. +func (p *ProjectV2Event) GetOrg() *Organization { + if p == nil { + return nil + } + return p.Org +} + +// GetProjectsV2 returns the ProjectsV2 field. +func (p *ProjectV2Event) GetProjectsV2() *ProjectsV2 { + if p == nil { + return nil + } + return p.ProjectsV2 +} + +// GetSender returns the Sender field. +func (p *ProjectV2Event) GetSender() *User { + if p == nil { + return nil + } + return p.Sender +} + +// GetArchivedAt returns the ArchivedAt field if it's non-nil, zero value otherwise. +func (p *ProjectV2Item) GetArchivedAt() Timestamp { + if p == nil || p.ArchivedAt == nil { + return Timestamp{} + } + return *p.ArchivedAt +} + +// GetContentNodeID returns the ContentNodeID field if it's non-nil, zero value otherwise. +func (p *ProjectV2Item) GetContentNodeID() string { + if p == nil || p.ContentNodeID == nil { + return "" + } + return *p.ContentNodeID +} + +// GetContentType returns the ContentType field if it's non-nil, zero value otherwise. +func (p *ProjectV2Item) GetContentType() string { + if p == nil || p.ContentType == nil { + return "" + } + return *p.ContentType +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (p *ProjectV2Item) GetCreatedAt() Timestamp { + if p == nil || p.CreatedAt == nil { + return Timestamp{} + } + return *p.CreatedAt +} + +// GetCreator returns the Creator field. +func (p *ProjectV2Item) GetCreator() *User { + if p == nil { + return nil + } + return p.Creator +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (p *ProjectV2Item) GetID() int64 { + if p == nil || p.ID == nil { + return 0 + } + return *p.ID +} + +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (p *ProjectV2Item) GetNodeID() string { + if p == nil || p.NodeID == nil { + return "" + } + return *p.NodeID +} + +// GetProjectNodeID returns the ProjectNodeID field if it's non-nil, zero value otherwise. +func (p *ProjectV2Item) GetProjectNodeID() string { + if p == nil || p.ProjectNodeID == nil { + return "" + } + return *p.ProjectNodeID +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (p *ProjectV2Item) GetUpdatedAt() Timestamp { + if p == nil || p.UpdatedAt == nil { + return Timestamp{} + } + return *p.UpdatedAt +} + +// GetArchivedAt returns the ArchivedAt field. +func (p *ProjectV2ItemChange) GetArchivedAt() *ArchivedAt { + if p == nil { + return nil + } + return p.ArchivedAt +} + +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (p *ProjectV2ItemEvent) GetAction() string { + if p == nil || p.Action == nil { + return "" + } + return *p.Action +} + +// GetChanges returns the Changes field. +func (p *ProjectV2ItemEvent) GetChanges() *ProjectV2ItemChange { + if p == nil { + return nil + } + return p.Changes +} + +// GetInstallation returns the Installation field. +func (p *ProjectV2ItemEvent) GetInstallation() *Installation { + if p == nil { + return nil + } + return p.Installation +} + +// GetOrg returns the Org field. +func (p *ProjectV2ItemEvent) GetOrg() *Organization { + if p == nil { + return nil + } + return p.Org +} + +// GetProjectV2Item returns the ProjectV2Item field. +func (p *ProjectV2ItemEvent) GetProjectV2Item() *ProjectV2Item { + if p == nil { + return nil + } + return p.ProjectV2Item +} + +// GetSender returns the Sender field. +func (p *ProjectV2ItemEvent) GetSender() *User { + if p == nil { + return nil + } + return p.Sender +} + // GetAllowDeletions returns the AllowDeletions field. func (p *Protection) GetAllowDeletions() *AllowDeletions { if p == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 479f3c8d54d..12d05f2d12c 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -996,6 +996,26 @@ func TestAppConfig_GetWebhookSecret(tt *testing.T) { a.GetWebhookSecret() } +func TestArchivedAt_GetFrom(tt *testing.T) { + var zeroValue Timestamp + a := &ArchivedAt{From: &zeroValue} + a.GetFrom() + a = &ArchivedAt{} + a.GetFrom() + a = nil + a.GetFrom() +} + +func TestArchivedAt_GetTo(tt *testing.T) { + var zeroValue Timestamp + a := &ArchivedAt{To: &zeroValue} + a.GetTo() + a = &ArchivedAt{} + a.GetTo() + a = nil + a.GetTo() +} + func TestArtifact_GetArchiveDownloadURL(tt *testing.T) { var zeroValue string a := &Artifact{ArchiveDownloadURL: &zeroValue} @@ -16804,6 +16824,314 @@ func TestProjectPermissionLevel_GetUser(tt *testing.T) { p.GetUser() } +func TestProjectsV2_GetClosedAt(tt *testing.T) { + var zeroValue Timestamp + p := &ProjectsV2{ClosedAt: &zeroValue} + p.GetClosedAt() + p = &ProjectsV2{} + p.GetClosedAt() + p = nil + p.GetClosedAt() +} + +func TestProjectsV2_GetCreatedAt(tt *testing.T) { + var zeroValue Timestamp + p := &ProjectsV2{CreatedAt: &zeroValue} + p.GetCreatedAt() + p = &ProjectsV2{} + p.GetCreatedAt() + p = nil + p.GetCreatedAt() +} + +func TestProjectsV2_GetCreator(tt *testing.T) { + p := &ProjectsV2{} + p.GetCreator() + p = nil + p.GetCreator() +} + +func TestProjectsV2_GetDeletedAt(tt *testing.T) { + var zeroValue Timestamp + p := &ProjectsV2{DeletedAt: &zeroValue} + p.GetDeletedAt() + p = &ProjectsV2{} + p.GetDeletedAt() + p = nil + p.GetDeletedAt() +} + +func TestProjectsV2_GetDeletedBy(tt *testing.T) { + p := &ProjectsV2{} + p.GetDeletedBy() + p = nil + p.GetDeletedBy() +} + +func TestProjectsV2_GetDescription(tt *testing.T) { + var zeroValue string + p := &ProjectsV2{Description: &zeroValue} + p.GetDescription() + p = &ProjectsV2{} + p.GetDescription() + p = nil + p.GetDescription() +} + +func TestProjectsV2_GetID(tt *testing.T) { + var zeroValue int64 + p := &ProjectsV2{ID: &zeroValue} + p.GetID() + p = &ProjectsV2{} + p.GetID() + p = nil + p.GetID() +} + +func TestProjectsV2_GetNodeID(tt *testing.T) { + var zeroValue string + p := &ProjectsV2{NodeID: &zeroValue} + p.GetNodeID() + p = &ProjectsV2{} + p.GetNodeID() + p = nil + p.GetNodeID() +} + +func TestProjectsV2_GetNumber(tt *testing.T) { + var zeroValue int + p := &ProjectsV2{Number: &zeroValue} + p.GetNumber() + p = &ProjectsV2{} + p.GetNumber() + p = nil + p.GetNumber() +} + +func TestProjectsV2_GetOwner(tt *testing.T) { + p := &ProjectsV2{} + p.GetOwner() + p = nil + p.GetOwner() +} + +func TestProjectsV2_GetPublic(tt *testing.T) { + var zeroValue bool + p := &ProjectsV2{Public: &zeroValue} + p.GetPublic() + p = &ProjectsV2{} + p.GetPublic() + p = nil + p.GetPublic() +} + +func TestProjectsV2_GetShortDescription(tt *testing.T) { + var zeroValue string + p := &ProjectsV2{ShortDescription: &zeroValue} + p.GetShortDescription() + p = &ProjectsV2{} + p.GetShortDescription() + p = nil + p.GetShortDescription() +} + +func TestProjectsV2_GetTitle(tt *testing.T) { + var zeroValue string + p := &ProjectsV2{Title: &zeroValue} + p.GetTitle() + p = &ProjectsV2{} + p.GetTitle() + p = nil + p.GetTitle() +} + +func TestProjectsV2_GetUpdatedAt(tt *testing.T) { + var zeroValue Timestamp + p := &ProjectsV2{UpdatedAt: &zeroValue} + p.GetUpdatedAt() + p = &ProjectsV2{} + p.GetUpdatedAt() + p = nil + p.GetUpdatedAt() +} + +func TestProjectV2Event_GetAction(tt *testing.T) { + var zeroValue string + p := &ProjectV2Event{Action: &zeroValue} + p.GetAction() + p = &ProjectV2Event{} + p.GetAction() + p = nil + p.GetAction() +} + +func TestProjectV2Event_GetInstallation(tt *testing.T) { + p := &ProjectV2Event{} + p.GetInstallation() + p = nil + p.GetInstallation() +} + +func TestProjectV2Event_GetOrg(tt *testing.T) { + p := &ProjectV2Event{} + p.GetOrg() + p = nil + p.GetOrg() +} + +func TestProjectV2Event_GetProjectsV2(tt *testing.T) { + p := &ProjectV2Event{} + p.GetProjectsV2() + p = nil + p.GetProjectsV2() +} + +func TestProjectV2Event_GetSender(tt *testing.T) { + p := &ProjectV2Event{} + p.GetSender() + p = nil + p.GetSender() +} + +func TestProjectV2Item_GetArchivedAt(tt *testing.T) { + var zeroValue Timestamp + p := &ProjectV2Item{ArchivedAt: &zeroValue} + p.GetArchivedAt() + p = &ProjectV2Item{} + p.GetArchivedAt() + p = nil + p.GetArchivedAt() +} + +func TestProjectV2Item_GetContentNodeID(tt *testing.T) { + var zeroValue string + p := &ProjectV2Item{ContentNodeID: &zeroValue} + p.GetContentNodeID() + p = &ProjectV2Item{} + p.GetContentNodeID() + p = nil + p.GetContentNodeID() +} + +func TestProjectV2Item_GetContentType(tt *testing.T) { + var zeroValue string + p := &ProjectV2Item{ContentType: &zeroValue} + p.GetContentType() + p = &ProjectV2Item{} + p.GetContentType() + p = nil + p.GetContentType() +} + +func TestProjectV2Item_GetCreatedAt(tt *testing.T) { + var zeroValue Timestamp + p := &ProjectV2Item{CreatedAt: &zeroValue} + p.GetCreatedAt() + p = &ProjectV2Item{} + p.GetCreatedAt() + p = nil + p.GetCreatedAt() +} + +func TestProjectV2Item_GetCreator(tt *testing.T) { + p := &ProjectV2Item{} + p.GetCreator() + p = nil + p.GetCreator() +} + +func TestProjectV2Item_GetID(tt *testing.T) { + var zeroValue int64 + p := &ProjectV2Item{ID: &zeroValue} + p.GetID() + p = &ProjectV2Item{} + p.GetID() + p = nil + p.GetID() +} + +func TestProjectV2Item_GetNodeID(tt *testing.T) { + var zeroValue string + p := &ProjectV2Item{NodeID: &zeroValue} + p.GetNodeID() + p = &ProjectV2Item{} + p.GetNodeID() + p = nil + p.GetNodeID() +} + +func TestProjectV2Item_GetProjectNodeID(tt *testing.T) { + var zeroValue string + p := &ProjectV2Item{ProjectNodeID: &zeroValue} + p.GetProjectNodeID() + p = &ProjectV2Item{} + p.GetProjectNodeID() + p = nil + p.GetProjectNodeID() +} + +func TestProjectV2Item_GetUpdatedAt(tt *testing.T) { + var zeroValue Timestamp + p := &ProjectV2Item{UpdatedAt: &zeroValue} + p.GetUpdatedAt() + p = &ProjectV2Item{} + p.GetUpdatedAt() + p = nil + p.GetUpdatedAt() +} + +func TestProjectV2ItemChange_GetArchivedAt(tt *testing.T) { + p := &ProjectV2ItemChange{} + p.GetArchivedAt() + p = nil + p.GetArchivedAt() +} + +func TestProjectV2ItemEvent_GetAction(tt *testing.T) { + var zeroValue string + p := &ProjectV2ItemEvent{Action: &zeroValue} + p.GetAction() + p = &ProjectV2ItemEvent{} + p.GetAction() + p = nil + p.GetAction() +} + +func TestProjectV2ItemEvent_GetChanges(tt *testing.T) { + p := &ProjectV2ItemEvent{} + p.GetChanges() + p = nil + p.GetChanges() +} + +func TestProjectV2ItemEvent_GetInstallation(tt *testing.T) { + p := &ProjectV2ItemEvent{} + p.GetInstallation() + p = nil + p.GetInstallation() +} + +func TestProjectV2ItemEvent_GetOrg(tt *testing.T) { + p := &ProjectV2ItemEvent{} + p.GetOrg() + p = nil + p.GetOrg() +} + +func TestProjectV2ItemEvent_GetProjectV2Item(tt *testing.T) { + p := &ProjectV2ItemEvent{} + p.GetProjectV2Item() + p = nil + p.GetProjectV2Item() +} + +func TestProjectV2ItemEvent_GetSender(tt *testing.T) { + p := &ProjectV2ItemEvent{} + p.GetSender() + p = nil + p.GetSender() +} + func TestProtection_GetAllowDeletions(tt *testing.T) { p := &Protection{} p.GetAllowDeletions() diff --git a/github/messages.go b/github/messages.go index d62182689c4..e15442e5f19 100644 --- a/github/messages.go +++ b/github/messages.go @@ -82,6 +82,8 @@ var ( "project": "ProjectEvent", "project_card": "ProjectCardEvent", "project_column": "ProjectColumnEvent", + "projects_v2": "ProjectV2Event", + "projects_v2_item": "ProjectV2ItemEvent", "public": "PublicEvent", "pull_request": "PullRequestEvent", "pull_request_review": "PullRequestReviewEvent", diff --git a/github/messages_test.go b/github/messages_test.go index b3828608505..91a25027629 100644 --- a/github/messages_test.go +++ b/github/messages_test.go @@ -404,6 +404,14 @@ func TestParseWebHook(t *testing.T) { payload: &ProjectColumnEvent{}, messageType: "project_column", }, + { + payload: &ProjectV2Event{}, + messageType: "projects_v2", + }, + { + payload: &ProjectV2ItemEvent{}, + messageType: "projects_v2_item", + }, { payload: &PublicEvent{}, messageType: "public", diff --git a/github/repos_hooks_deliveries_test.go b/github/repos_hooks_deliveries_test.go index a605c7f3654..d5e1a383796 100644 --- a/github/repos_hooks_deliveries_test.go +++ b/github/repos_hooks_deliveries_test.go @@ -176,6 +176,8 @@ var hookDeliveryPayloadTypeToStruct = map[string]interface{}{ "project": &ProjectEvent{}, "project_card": &ProjectCardEvent{}, "project_column": &ProjectColumnEvent{}, + "projects_v2": &ProjectV2Event{}, + "projects_v2_item": &ProjectV2ItemEvent{}, "public": &PublicEvent{}, "pull_request": &PullRequestEvent{}, "pull_request_review": &PullRequestReviewEvent{}, From bb00f570d30158e17d71bf270503ceb4f67d9537 Mon Sep 17 00:00:00 2001 From: Nikita Pivkin <100182843+nikpivkin@users.noreply.github.com> Date: Tue, 15 Aug 2023 20:42:05 +0700 Subject: [PATCH 282/751] Defer closing body before checking HTTP status code (#2870) --- scrape/scrape.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scrape/scrape.go b/scrape/scrape.go index c3be9af106e..dc7aa88fad4 100644 --- a/scrape/scrape.go +++ b/scrape/scrape.go @@ -97,15 +97,17 @@ func (c *Client) get(urlStr string, a ...interface{}) (*goquery.Document, error) if err != nil { return nil, fmt.Errorf("error parsing URL: %q: %v", urlStr, err) } + resp, err := c.Client.Get(u.String()) if err != nil { return nil, fmt.Errorf("error fetching url %q: %v", u, err) } + defer resp.Body.Close() + if resp.StatusCode == http.StatusNotFound { return nil, fmt.Errorf("received %v response fetching URL %q", resp.StatusCode, u) } - defer resp.Body.Close() doc, err := goquery.NewDocumentFromReader(resp.Body) if err != nil { return nil, fmt.Errorf("error parsing response: %v", err) From 352e4c8b9466dd650b09a8152b83655fc4634726 Mon Sep 17 00:00:00 2001 From: Graham Hargreaves Date: Tue, 15 Aug 2023 17:08:23 +0100 Subject: [PATCH 283/751] Add GetAutomatedSecurityFixes to report status (#2842) Fixes: #2080. --- github/github-accessors.go | 16 ++++++++++++++ github/github-accessors_test.go | 20 +++++++++++++++++ github/github.go | 3 --- github/repos.go | 31 +++++++++++++++++++++----- github/repos_test.go | 39 +++++++++++++++++++++++++++++++-- 5 files changed, 98 insertions(+), 11 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 1fabd520ee1..8b82604e9e0 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -1886,6 +1886,22 @@ func (a *AutolinkOptions) GetURLTemplate() string { return *a.URLTemplate } +// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise. +func (a *AutomatedSecurityFixes) GetEnabled() bool { + if a == nil || a.Enabled == nil { + return false + } + return *a.Enabled +} + +// GetPaused returns the Paused field if it's non-nil, zero value otherwise. +func (a *AutomatedSecurityFixes) GetPaused() bool { + if a == nil || a.Paused == nil { + return false + } + return *a.Paused +} + // GetAppID returns the AppID field if it's non-nil, zero value otherwise. func (a *AutoTriggerCheck) GetAppID() int64 { if a == nil || a.AppID == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 12d05f2d12c..7d8729ee3fb 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -2265,6 +2265,26 @@ func TestAutolinkOptions_GetURLTemplate(tt *testing.T) { a.GetURLTemplate() } +func TestAutomatedSecurityFixes_GetEnabled(tt *testing.T) { + var zeroValue bool + a := &AutomatedSecurityFixes{Enabled: &zeroValue} + a.GetEnabled() + a = &AutomatedSecurityFixes{} + a.GetEnabled() + a = nil + a.GetEnabled() +} + +func TestAutomatedSecurityFixes_GetPaused(tt *testing.T) { + var zeroValue bool + a := &AutomatedSecurityFixes{Paused: &zeroValue} + a.GetPaused() + a = &AutomatedSecurityFixes{} + a.GetPaused() + a = nil + a.GetPaused() +} + func TestAutoTriggerCheck_GetAppID(tt *testing.T) { var zeroValue int64 a := &AutoTriggerCheck{AppID: &zeroValue} diff --git a/github/github.go b/github/github.go index 799608359be..39f4479d4ab 100644 --- a/github/github.go +++ b/github/github.go @@ -126,9 +126,6 @@ const ( // https://developer.github.com/changes/2019-04-24-vulnerability-alerts/ mediaTypeRequiredVulnerabilityAlertsPreview = "application/vnd.github.dorian-preview+json" - // https://developer.github.com/changes/2019-06-04-automated-security-fixes/ - mediaTypeRequiredAutomatedSecurityFixesPreview = "application/vnd.github.london-preview+json" - // https://developer.github.com/changes/2019-05-29-update-branch-api/ mediaTypeUpdatePullRequestBranchPreview = "application/vnd.github.lydian-preview+json" diff --git a/github/repos.go b/github/repos.go index 2451ed43689..2309d927a29 100644 --- a/github/repos.go +++ b/github/repos.go @@ -703,6 +703,25 @@ func (s *RepositoriesService) DisableVulnerabilityAlerts(ctx context.Context, ow return s.client.Do(ctx, req, nil) } +// GetAutomatedSecurityFixes checks if the automated security fixes for a repository are enabled. +// +// GitHub API docs: https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#check-if-automated-security-fixes-are-enabled-for-a-repository +func (s *RepositoriesService) GetAutomatedSecurityFixes(ctx context.Context, owner, repository string) (*AutomatedSecurityFixes, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/automated-security-fixes", owner, repository) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + p := new(AutomatedSecurityFixes) + resp, err := s.client.Do(ctx, req, p) + if err != nil { + return nil, resp, err + } + return p, resp, nil +} + // EnableAutomatedSecurityFixes enables the automated security fixes for a repository. // // GitHub API docs: https://docs.github.com/en/rest/repos/repos#enable-automated-security-fixes @@ -714,9 +733,6 @@ func (s *RepositoriesService) EnableAutomatedSecurityFixes(ctx context.Context, return nil, err } - // TODO: remove custom Accept header when this API fully launches - req.Header.Set("Accept", mediaTypeRequiredAutomatedSecurityFixesPreview) - return s.client.Do(ctx, req, nil) } @@ -731,9 +747,6 @@ func (s *RepositoriesService) DisableAutomatedSecurityFixes(ctx context.Context, return nil, err } - // TODO: remove custom Accept header when this API fully launches - req.Header.Set("Accept", mediaTypeRequiredAutomatedSecurityFixesPreview) - return s.client.Do(ctx, req, nil) } @@ -1228,6 +1241,12 @@ type SignaturesProtectedBranch struct { Enabled *bool `json:"enabled,omitempty"` } +// AutomatedSecurityFixes represents their status. +type AutomatedSecurityFixes struct { + Enabled *bool `json:"enabled"` + Paused *bool `json:"paused"` +} + // ListBranches lists branches for the specified repository. // // GitHub API docs: https://docs.github.com/en/rest/branches/branches#list-branches diff --git a/github/repos_test.go b/github/repos_test.go index 70321fd7c1c..c2abf6da4f1 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -653,7 +653,6 @@ func TestRepositoriesService_EnableAutomatedSecurityFixes(t *testing.T) { mux.HandleFunc("/repos/o/r/automated-security-fixes", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") - testHeader(t, r, "Accept", mediaTypeRequiredAutomatedSecurityFixesPreview) w.WriteHeader(http.StatusNoContent) }) @@ -664,13 +663,49 @@ func TestRepositoriesService_EnableAutomatedSecurityFixes(t *testing.T) { } } +func TestRepositoriesService_GetAutomatedSecurityFixes(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/automated-security-fixes", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"enabled": true, "paused": false}`) + }) + + ctx := context.Background() + fixes, _, err := client.Repositories.GetAutomatedSecurityFixes(ctx, "o", "r") + if err != nil { + t.Errorf("Repositories.GetAutomatedSecurityFixes returned errpr: #{err}") + } + + want := &AutomatedSecurityFixes{ + Enabled: Bool(true), + Paused: Bool(false), + } + if !cmp.Equal(fixes, want) { + t.Errorf("Repositories.GetAutomatedSecurityFixes returned #{fixes}, want #{want}") + } + + const methodName = "GetAutomatedSecurityFixes" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.GetAutomatedSecurityFixes(ctx, "\n", "\n") + return err + }) + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.GetAutomatedSecurityFixes(ctx, "o", "r") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + func TestRepositoriesService_DisableAutomatedSecurityFixes(t *testing.T) { client, mux, _, teardown := setup() defer teardown() mux.HandleFunc("/repos/o/r/automated-security-fixes", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") - testHeader(t, r, "Accept", mediaTypeRequiredAutomatedSecurityFixesPreview) w.WriteHeader(http.StatusNoContent) }) From 0c10d670aa824453a404505438e8881c41763cc7 Mon Sep 17 00:00:00 2001 From: Rafael Aramizu Gomes Date: Tue, 15 Aug 2023 15:45:00 -0300 Subject: [PATCH 284/751] Adding missing field important to find branch in fork from same owner (#2873) Fixes: #2872. --- example/commitpr/main.go | 2 ++ github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ github/pulls.go | 1 + github/pulls_test.go | 2 ++ 5 files changed, 23 insertions(+) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index 2977928cc66..da3c5a5819a 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -38,6 +38,7 @@ var ( sourceRepo = flag.String("source-repo", "", "Name of repo to create the commit in.") commitMessage = flag.String("commit-message", "", "Content of the commit message.") commitBranch = flag.String("commit-branch", "", "Name of branch to create the commit in. If it does not already exists, it will be created using the `base-branch` parameter") + repoBranch = flag.String("repo-branch", "", "Name of the repository where the changes in the pull request were made. This field is required for cross-repository pull requests if both repositories are owned by the same organization") baseBranch = flag.String("base-branch", "master", "Name of branch to create the `commit-branch` from.") prRepoOwner = flag.String("merge-repo-owner", "", "Name of the owner (user or org) of the repo to create the PR against. If not specified, the value of the `-source-owner` flag will be used.") prRepo = flag.String("merge-repo", "", "Name of repo to create the PR against. If not specified, the value of the `-source-repo` flag will be used.") @@ -164,6 +165,7 @@ func createPR() (err error) { newPR := &github.NewPullRequest{ Title: prSubject, Head: commitBranch, + HeadRepo: repoBranch, Base: prBranch, Body: prDescription, MaintainerCanModify: github.Bool(true), diff --git a/github/github-accessors.go b/github/github-accessors.go index 8b82604e9e0..06564f250c2 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -11374,6 +11374,14 @@ func (n *NewPullRequest) GetHead() string { return *n.Head } +// GetHeadRepo returns the HeadRepo field if it's non-nil, zero value otherwise. +func (n *NewPullRequest) GetHeadRepo() string { + if n == nil || n.HeadRepo == nil { + return "" + } + return *n.HeadRepo +} + // GetIssue returns the Issue field if it's non-nil, zero value otherwise. func (n *NewPullRequest) GetIssue() int { if n == nil || n.Issue == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 7d8729ee3fb..46716b88064 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -13315,6 +13315,16 @@ func TestNewPullRequest_GetHead(tt *testing.T) { n.GetHead() } +func TestNewPullRequest_GetHeadRepo(tt *testing.T) { + var zeroValue string + n := &NewPullRequest{HeadRepo: &zeroValue} + n.GetHeadRepo() + n = &NewPullRequest{} + n.GetHeadRepo() + n = nil + n.GetHeadRepo() +} + func TestNewPullRequest_GetIssue(tt *testing.T) { var zeroValue int n := &NewPullRequest{Issue: &zeroValue} diff --git a/github/pulls.go b/github/pulls.go index 533e86b5f0a..29549e24b86 100644 --- a/github/pulls.go +++ b/github/pulls.go @@ -244,6 +244,7 @@ func (s *PullRequestsService) GetRaw(ctx context.Context, owner string, repo str type NewPullRequest struct { Title *string `json:"title,omitempty"` Head *string `json:"head,omitempty"` + HeadRepo *string `json:"head_repo,omitempty"` Base *string `json:"base,omitempty"` Body *string `json:"body,omitempty"` Issue *int `json:"issue,omitempty"` diff --git a/github/pulls_test.go b/github/pulls_test.go index 87f6f41cfb8..4ea6bfa9d1e 100644 --- a/github/pulls_test.go +++ b/github/pulls_test.go @@ -933,6 +933,7 @@ func TestNewPullRequest_Marshal(t *testing.T) { u := &NewPullRequest{ Title: String("eh"), Head: String("eh"), + HeadRepo: String("eh"), Base: String("eh"), Body: String("eh"), Issue: Int(1), @@ -943,6 +944,7 @@ func TestNewPullRequest_Marshal(t *testing.T) { want := `{ "title": "eh", "head": "eh", + "head_repo": "eh", "base": "eh", "body": "eh", "issue": 1, From d00a78f4b6310da2152e79df18c31a04a9ba25bf Mon Sep 17 00:00:00 2001 From: soniachikh Date: Tue, 15 Aug 2023 16:40:44 -0400 Subject: [PATCH 285/751] Add WorkflowRun and Workflow to DeploymentEvent (#2755) --- github/event_types.go | 6 +- github/event_types_test.go | 184 ++++++++++++++++++++++++++++++++ github/github-accessors.go | 16 +++ github/github-accessors_test.go | 14 +++ 4 files changed, 218 insertions(+), 2 deletions(-) diff --git a/github/event_types.go b/github/event_types.go index c9e97ffa291..64bbde122a3 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -165,8 +165,10 @@ type DeployKeyEvent struct { // // GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#deployment type DeploymentEvent struct { - Deployment *Deployment `json:"deployment,omitempty"` - Repo *Repository `json:"repository,omitempty"` + Deployment *Deployment `json:"deployment,omitempty"` + Repo *Repository `json:"repository,omitempty"` + Workflow *Workflow `json:"workflow,omitempty"` + WorkflowRun *WorkflowRun `json:"workflow_run,omitempty"` // The following fields are only populated by Webhook events. Sender *User `json:"sender,omitempty"` diff --git a/github/event_types_test.go b/github/event_types_test.go index c1cb4d9636f..653671b8685 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -5674,6 +5674,98 @@ func TestDeploymentEvent_Marshal(t *testing.T) { }, SuspendedAt: &Timestamp{referenceTime}, }, + Workflow: &Workflow{ + ID: Int64(1), + NodeID: String("nid"), + Name: String("n"), + Path: String("p"), + State: String("s"), + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + URL: String("u"), + HTMLURL: String("h"), + BadgeURL: String("b"), + }, + WorkflowRun: &WorkflowRun{ + ID: Int64(1), + Name: String("n"), + NodeID: String("nid"), + HeadBranch: String("hb"), + HeadSHA: String("hs"), + RunNumber: Int(1), + RunAttempt: Int(1), + Event: String("e"), + Status: String("s"), + Conclusion: String("c"), + WorkflowID: Int64(1), + URL: String("u"), + HTMLURL: String("h"), + PullRequests: []*PullRequest{ + { + URL: String("u"), + ID: Int64(1), + Number: Int(1), + Head: &PullRequestBranch{ + Ref: String("r"), + SHA: String("s"), + Repo: &Repository{ + ID: Int64(1), + URL: String("s"), + Name: String("n"), + }, + }, + Base: &PullRequestBranch{ + Ref: String("r"), + SHA: String("s"), + Repo: &Repository{ + ID: Int64(1), + URL: String("u"), + Name: String("n"), + }, + }, + }, + }, + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + RunStartedAt: &Timestamp{referenceTime}, + JobsURL: String("j"), + LogsURL: String("l"), + CheckSuiteURL: String("c"), + ArtifactsURL: String("a"), + CancelURL: String("c"), + RerunURL: String("r"), + PreviousAttemptURL: String("p"), + HeadCommit: &HeadCommit{ + Message: String("m"), + Author: &CommitAuthor{ + Name: String("n"), + Email: String("e"), + Login: String("l"), + }, + URL: String("u"), + Distinct: Bool(false), + SHA: String("s"), + ID: String("i"), + TreeID: String("tid"), + Timestamp: &Timestamp{referenceTime}, + Committer: &CommitAuthor{ + Name: String("n"), + Email: String("e"), + Login: String("l"), + }, + }, + WorkflowURL: String("w"), + Repository: &Repository{ + ID: Int64(1), + URL: String("u"), + Name: String("n"), + }, + HeadRepository: &Repository{ + ID: Int64(1), + URL: String("u"), + Name: String("n"), + }, + }, } want := `{ @@ -5813,6 +5905,98 @@ func TestDeploymentEvent_Marshal(t *testing.T) { "url": "u" }, "suspended_at": ` + referenceTimeStr + ` + }, + "workflow": { + "id": 1, + "node_id": "nid", + "name": "n", + "path": "p", + "state": "s", + "created_at": ` + referenceTimeStr + `, + "updated_at": ` + referenceTimeStr + `, + "url": "u", + "html_url": "h", + "badge_url": "b" + }, + "workflow_run": { + "id": 1, + "name": "n", + "node_id": "nid", + "head_branch": "hb", + "head_sha": "hs", + "run_number": 1, + "run_attempt": 1, + "event": "e", + "status": "s", + "conclusion": "c", + "workflow_id": 1, + "url": "u", + "html_url": "h", + "pull_requests": [ + { + "id": 1, + "number": 1, + "url": "u", + "head": { + "ref": "r", + "sha": "s", + "repo": { + "id": 1, + "name": "n", + "url": "s" + } + }, + "base": { + "ref": "r", + "sha": "s", + "repo": { + "id": 1, + "name": "n", + "url": "u" + } + } + } + ], + "created_at": ` + referenceTimeStr + `, + "updated_at": ` + referenceTimeStr + `, + "run_started_at": ` + referenceTimeStr + `, + "jobs_url": "j", + "logs_url": "l", + "check_suite_url": "c", + "artifacts_url": "a", + "cancel_url": "c", + "rerun_url": "r", + "previous_attempt_url": "p", + "head_commit": { + "message": "m", + "author": { + "name": "n", + "email": "e", + "username": "l" + }, + "url": "u", + "distinct": false, + "sha": "s", + "id": "i", + "tree_id": "tid", + "timestamp": ` + referenceTimeStr + `, + "committer": { + "name": "n", + "email": "e", + "username": "l" + } + }, + "workflow_url": "w", + "repository": { + "id": 1, + "name": "n", + "url": "u" + }, + "head_repository": { + "id": 1, + "name": "n", + "url": "u" + } } }` diff --git a/github/github-accessors.go b/github/github-accessors.go index 06564f250c2..21d09c7b5ba 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -5366,6 +5366,22 @@ func (d *DeploymentEvent) GetSender() *User { return d.Sender } +// GetWorkflow returns the Workflow field. +func (d *DeploymentEvent) GetWorkflow() *Workflow { + if d == nil { + return nil + } + return d.Workflow +} + +// GetWorkflowRun returns the WorkflowRun field. +func (d *DeploymentEvent) GetWorkflowRun() *WorkflowRun { + if d == nil { + return nil + } + return d.WorkflowRun +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (d *DeploymentProtectionRuleEvent) GetAction() string { if d == nil || d.Action == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 46716b88064..391578360cb 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -6315,6 +6315,20 @@ func TestDeploymentEvent_GetSender(tt *testing.T) { d.GetSender() } +func TestDeploymentEvent_GetWorkflow(tt *testing.T) { + d := &DeploymentEvent{} + d.GetWorkflow() + d = nil + d.GetWorkflow() +} + +func TestDeploymentEvent_GetWorkflowRun(tt *testing.T) { + d := &DeploymentEvent{} + d.GetWorkflowRun() + d = nil + d.GetWorkflowRun() +} + func TestDeploymentProtectionRuleEvent_GetAction(tt *testing.T) { var zeroValue string d := &DeploymentProtectionRuleEvent{Action: &zeroValue} From e1884767c47482eeef33562308e0e9310d30fe49 Mon Sep 17 00:00:00 2001 From: Timothy O'Brien Date: Thu, 17 Aug 2023 02:00:45 +1000 Subject: [PATCH 286/751] Replace deprectated crypto/ssh/terminal module in examples (#2876) Fixes: #2875. --- example/basicauth/main.go | 4 ++-- example/tagprotection/main.go | 4 ++-- example/tokenauth/main.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/example/basicauth/main.go b/example/basicauth/main.go index edee49b8910..3c55ed18992 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -23,7 +23,7 @@ import ( "syscall" "github.com/google/go-github/v53/github" - "golang.org/x/crypto/ssh/terminal" + "golang.org/x/term" ) func main() { @@ -32,7 +32,7 @@ func main() { username, _ := r.ReadString('\n') fmt.Print("GitHub Password: ") - bytePassword, _ := terminal.ReadPassword(int(syscall.Stdin)) + bytePassword, _ := term.ReadPassword(int(syscall.Stdin)) password := string(bytePassword) tp := github.BasicAuthTransport{ diff --git a/example/tagprotection/main.go b/example/tagprotection/main.go index e68b9c300eb..aecc60bfa9f 100644 --- a/example/tagprotection/main.go +++ b/example/tagprotection/main.go @@ -20,7 +20,7 @@ import ( "syscall" "github.com/google/go-github/v53/github" - "golang.org/x/crypto/ssh/terminal" + "golang.org/x/term" ) func main() { @@ -39,7 +39,7 @@ func main() { pattern = strings.TrimSpace(pattern) fmt.Print("GitHub Token: ") - byteToken, _ := terminal.ReadPassword(int(syscall.Stdin)) + byteToken, _ := term.ReadPassword(int(syscall.Stdin)) println() token := string(byteToken) diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index 03ae076d7b8..4cfe0f5b2da 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -15,12 +15,12 @@ import ( "syscall" "github.com/google/go-github/v53/github" - "golang.org/x/crypto/ssh/terminal" + "golang.org/x/term" ) func main() { fmt.Print("GitHub Token: ") - byteToken, _ := terminal.ReadPassword(int(syscall.Stdin)) + byteToken, _ := term.ReadPassword(int(syscall.Stdin)) println() token := string(byteToken) From 2831a6be48ebcfa89cc1e8cdda8476157fcfe70e Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Wed, 16 Aug 2023 12:09:26 -0400 Subject: [PATCH 287/751] Update workflow to use Go 1.21 and 1.20 (#2878) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e6a94006958..ad0cc4487b1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,7 +21,7 @@ jobs: test: strategy: matrix: - go-version: [1.x, 1.19.x] + go-version: [1.x, 1.20.x] platform: [ubuntu-latest] include: # include windows, but only with the latest Go version, since there From b9027bd8e6f3891c6180a1b60cd692c168f7da2f Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Wed, 16 Aug 2023 12:50:10 -0400 Subject: [PATCH 288/751] Add TriggeringActor to WorkflowRun (#2879) Fixes: #2874 . --- github/actions_workflow_runs.go | 1 + github/actions_workflow_runs_test.go | 80 ++ github/github-accessors.go | 8 + github/github-accessors_test.go | 7 + github/github_test.go | 8 +- go.sum | 1533 -------------------------- 6 files changed, 100 insertions(+), 1537 deletions(-) diff --git a/github/actions_workflow_runs.go b/github/actions_workflow_runs.go index 61f736be4fb..00221086116 100644 --- a/github/actions_workflow_runs.go +++ b/github/actions_workflow_runs.go @@ -46,6 +46,7 @@ type WorkflowRun struct { Repository *Repository `json:"repository,omitempty"` HeadRepository *Repository `json:"head_repository,omitempty"` Actor *User `json:"actor,omitempty"` + TriggeringActor *User `json:"triggering_actor,omitempty"` } // WorkflowRuns represents a slice of repository action workflow run. diff --git a/github/actions_workflow_runs_test.go b/github/actions_workflow_runs_test.go index 74b5bdd0d5f..3104e6dfafd 100644 --- a/github/actions_workflow_runs_test.go +++ b/github/actions_workflow_runs_test.go @@ -741,6 +741,26 @@ func TestWorkflowRun_Marshal(t *testing.T) { SuspendedAt: &Timestamp{referenceTime}, URL: String("u"), }, + TriggeringActor: &User{ + Login: String("l2"), + ID: Int64(2), + AvatarURL: String("a2"), + GravatarID: String("g2"), + Name: String("n2"), + Company: String("c2"), + Blog: String("b2"), + Location: String("l2"), + Email: String("e2"), + Hireable: Bool(false), + Bio: String("b2"), + TwitterUsername: String("t2"), + PublicRepos: Int(2), + Followers: Int(2), + Following: Int(2), + CreatedAt: &Timestamp{referenceTime}, + SuspendedAt: &Timestamp{referenceTime}, + URL: String("u2"), + }, } want := `{ @@ -841,6 +861,26 @@ func TestWorkflowRun_Marshal(t *testing.T) { "created_at": ` + referenceTimeStr + `, "suspended_at": ` + referenceTimeStr + `, "url": "u" + }, + "triggering_actor": { + "login": "l2", + "id": 2, + "avatar_url": "a2", + "gravatar_id": "g2", + "name": "n2", + "company": "c2", + "blog": "b2", + "location": "l2", + "email": "e2", + "hireable": false, + "bio": "b2", + "twitter_username": "t2", + "public_repos": 2, + "followers": 2, + "following": 2, + "created_at": ` + referenceTimeStr + `, + "suspended_at": ` + referenceTimeStr + `, + "url": "u2" } }` @@ -952,6 +992,26 @@ func TestWorkflowRuns_Marshal(t *testing.T) { SuspendedAt: &Timestamp{referenceTime}, URL: String("u"), }, + TriggeringActor: &User{ + Login: String("l2"), + ID: Int64(2), + AvatarURL: String("a2"), + GravatarID: String("g2"), + Name: String("n2"), + Company: String("c2"), + Blog: String("b2"), + Location: String("l2"), + Email: String("e2"), + Hireable: Bool(false), + Bio: String("b2"), + TwitterUsername: String("t2"), + PublicRepos: Int(2), + Followers: Int(2), + Following: Int(2), + CreatedAt: &Timestamp{referenceTime}, + SuspendedAt: &Timestamp{referenceTime}, + URL: String("u2"), + }, }, }, } @@ -1057,6 +1117,26 @@ func TestWorkflowRuns_Marshal(t *testing.T) { "created_at": ` + referenceTimeStr + `, "suspended_at": ` + referenceTimeStr + `, "url": "u" + }, + "triggering_actor": { + "login": "l2", + "id": 2, + "avatar_url": "a2", + "gravatar_id": "g2", + "name": "n2", + "company": "c2", + "blog": "b2", + "location": "l2", + "email": "e2", + "hireable": false, + "bio": "b2", + "twitter_username": "t2", + "public_repos": 2, + "followers": 2, + "following": 2, + "created_at": ` + referenceTimeStr + `, + "suspended_at": ` + referenceTimeStr + `, + "url": "u2" } } ] diff --git a/github/github-accessors.go b/github/github-accessors.go index 21d09c7b5ba..fc7c34a6c95 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -23926,6 +23926,14 @@ func (w *WorkflowRun) GetStatus() string { return *w.Status } +// GetTriggeringActor returns the TriggeringActor field. +func (w *WorkflowRun) GetTriggeringActor() *User { + if w == nil { + return nil + } + return w.TriggeringActor +} + // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. func (w *WorkflowRun) GetUpdatedAt() Timestamp { if w == nil || w.UpdatedAt == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 391578360cb..fba6b9ee95f 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -27919,6 +27919,13 @@ func TestWorkflowRun_GetStatus(tt *testing.T) { w.GetStatus() } +func TestWorkflowRun_GetTriggeringActor(tt *testing.T) { + w := &WorkflowRun{} + w.GetTriggeringActor() + w = nil + w.GetTriggeringActor() +} + func TestWorkflowRun_GetUpdatedAt(tt *testing.T) { var zeroValue Timestamp w := &WorkflowRun{UpdatedAt: &zeroValue} diff --git a/github/github_test.go b/github/github_test.go index 2f92d3baa07..94606edd72b 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -154,19 +154,19 @@ func testJSONMarshal(t *testing.T, v interface{}, want string) { if err := json.Unmarshal([]byte(want), &u); err != nil { t.Errorf("Unable to unmarshal JSON for %v: %v", want, err) } - w, err := json.Marshal(u) + w, err := json.MarshalIndent(u, "", " ") if err != nil { t.Errorf("Unable to marshal JSON for %#v", u) } // Marshal the target value. - j, err := json.Marshal(v) + got, err := json.MarshalIndent(v, "", " ") if err != nil { t.Errorf("Unable to marshal JSON for %#v", v) } - if string(w) != string(j) { - t.Errorf("json.Marshal(%q) returned %s, want %s", v, j, w) + if diff := cmp.Diff(string(w), string(got)); diff != "" { + t.Errorf("json.Marshal returned:\n%s\nwant:\n%s\ndiff:\n%v", got, w, diff) } } diff --git a/go.sum b/go.sum index da61e80b940..1b24aa6b96a 100644 --- a/go.sum +++ b/go.sum @@ -1,1577 +1,44 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= -cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= -cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= -cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= -cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= -cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= -cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= -cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= -cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= -cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= -cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= -cloud.google.com/go v0.100.1/go.mod h1:fs4QogzfH5n2pBXBP9vRiU+eCny7lD2vmFZy79Iuw1U= -cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= -cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= -cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= -cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM= -cloud.google.com/go v0.107.0/go.mod h1:wpc2eNrD7hXUTy8EKS10jkxpZBjASrORK7goS+3YX2I= -cloud.google.com/go v0.110.0/go.mod h1:SJnCLqQ0FCFGSZMUNUf84MV3Aia54kn7pi8st7tMzaY= -cloud.google.com/go v0.110.2/go.mod h1:k04UEeEtb6ZBRTv3dZz4CeJC3jKGxyhl0sAiVVquxiw= -cloud.google.com/go/accessapproval v1.4.0/go.mod h1:zybIuC3KpDOvotz59lFe5qxRZx6C75OtwbisN56xYB4= -cloud.google.com/go/accessapproval v1.5.0/go.mod h1:HFy3tuiGvMdcd/u+Cu5b9NkO1pEICJ46IR82PoUdplw= -cloud.google.com/go/accessapproval v1.6.0/go.mod h1:R0EiYnwV5fsRFiKZkPHr6mwyk2wxUJ30nL4j2pcFY2E= -cloud.google.com/go/accesscontextmanager v1.3.0/go.mod h1:TgCBehyr5gNMz7ZaH9xubp+CE8dkrszb4oK9CWyvD4o= -cloud.google.com/go/accesscontextmanager v1.4.0/go.mod h1:/Kjh7BBu/Gh83sv+K60vN9QE5NJcd80sU33vIe2IFPE= -cloud.google.com/go/accesscontextmanager v1.6.0/go.mod h1:8XCvZWfYw3K/ji0iVnp+6pu7huxoQTLmxAbVjbloTtM= -cloud.google.com/go/accesscontextmanager v1.7.0/go.mod h1:CEGLewx8dwa33aDAZQujl7Dx+uYhS0eay198wB/VumQ= -cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= -cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= -cloud.google.com/go/aiplatform v1.27.0/go.mod h1:Bvxqtl40l0WImSb04d0hXFU7gDOiq9jQmorivIiWcKg= -cloud.google.com/go/aiplatform v1.35.0/go.mod h1:7MFT/vCaOyZT/4IIFfxH4ErVg/4ku6lKv3w0+tFTgXQ= -cloud.google.com/go/aiplatform v1.36.1/go.mod h1:WTm12vJRPARNvJ+v6P52RDHCNe4AhvjcIZ/9/RRHy/k= -cloud.google.com/go/aiplatform v1.37.0/go.mod h1:IU2Cv29Lv9oCn/9LkFiiuKfwrRTq+QQMbW+hPCxJGZw= -cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= -cloud.google.com/go/analytics v0.12.0/go.mod h1:gkfj9h6XRf9+TS4bmuhPEShsh3hH8PAZzm/41OOhQd4= -cloud.google.com/go/analytics v0.17.0/go.mod h1:WXFa3WSym4IZ+JiKmavYdJwGG/CvpqiqczmL59bTD9M= -cloud.google.com/go/analytics v0.18.0/go.mod h1:ZkeHGQlcIPkw0R/GW+boWHhCOR43xz9RN/jn7WcqfIE= -cloud.google.com/go/analytics v0.19.0/go.mod h1:k8liqf5/HCnOUkbawNtrWWc+UAzyDlW89doe8TtoDsE= -cloud.google.com/go/apigateway v1.3.0/go.mod h1:89Z8Bhpmxu6AmUxuVRg/ECRGReEdiP3vQtk4Z1J9rJk= -cloud.google.com/go/apigateway v1.4.0/go.mod h1:pHVY9MKGaH9PQ3pJ4YLzoj6U5FUDeDFBllIz7WmzJoc= -cloud.google.com/go/apigateway v1.5.0/go.mod h1:GpnZR3Q4rR7LVu5951qfXPJCHquZt02jf7xQx7kpqN8= -cloud.google.com/go/apigeeconnect v1.3.0/go.mod h1:G/AwXFAKo0gIXkPTVfZDd2qA1TxBXJ3MgMRBQkIi9jc= -cloud.google.com/go/apigeeconnect v1.4.0/go.mod h1:kV4NwOKqjvt2JYR0AoIWo2QGfoRtn/pkS3QlHp0Ni04= -cloud.google.com/go/apigeeconnect v1.5.0/go.mod h1:KFaCqvBRU6idyhSNyn3vlHXc8VMDJdRmwDF6JyFRqZ8= -cloud.google.com/go/apigeeregistry v0.4.0/go.mod h1:EUG4PGcsZvxOXAdyEghIdXwAEi/4MEaoqLMLDMIwKXY= -cloud.google.com/go/apigeeregistry v0.5.0/go.mod h1:YR5+s0BVNZfVOUkMa5pAR2xGd0A473vA5M7j247o1wM= -cloud.google.com/go/apigeeregistry v0.6.0/go.mod h1:BFNzW7yQVLZ3yj0TKcwzb8n25CFBri51GVGOEUcgQsc= -cloud.google.com/go/apikeys v0.4.0/go.mod h1:XATS/yqZbaBK0HOssf+ALHp8jAlNHUgyfprvNcBIszU= -cloud.google.com/go/apikeys v0.5.0/go.mod h1:5aQfwY4D+ewMMWScd3hm2en3hCj+BROlyrt3ytS7KLI= -cloud.google.com/go/apikeys v0.6.0/go.mod h1:kbpXu5upyiAlGkKrJgQl8A0rKNNJ7dQ377pdroRSSi8= -cloud.google.com/go/appengine v1.4.0/go.mod h1:CS2NhuBuDXM9f+qscZ6V86m1MIIqPj3WC/UoEuR1Sno= -cloud.google.com/go/appengine v1.5.0/go.mod h1:TfasSozdkFI0zeoxW3PTBLiNqRmzraodCWatWI9Dmak= -cloud.google.com/go/appengine v1.6.0/go.mod h1:hg6i0J/BD2cKmDJbaFSYHFyZkgBEfQrDg/X0V5fJn84= -cloud.google.com/go/appengine v1.7.0/go.mod h1:eZqpbHFCqRGa2aCdope7eC0SWLV1j0neb/QnMJVWx6A= -cloud.google.com/go/appengine v1.7.1/go.mod h1:IHLToyb/3fKutRysUlFO0BPt5j7RiQ45nrzEJmKTo6E= -cloud.google.com/go/area120 v0.5.0/go.mod h1:DE/n4mp+iqVyvxHN41Vf1CR602GiHQjFPusMFW6bGR4= -cloud.google.com/go/area120 v0.6.0/go.mod h1:39yFJqWVgm0UZqWTOdqkLhjoC7uFfgXRC8g/ZegeAh0= -cloud.google.com/go/area120 v0.7.0/go.mod h1:a3+8EUD1SX5RUcCs3MY5YasiO1z6yLiNLRiFrykbynY= -cloud.google.com/go/area120 v0.7.1/go.mod h1:j84i4E1RboTWjKtZVWXPqvK5VHQFJRF2c1Nm69pWm9k= -cloud.google.com/go/artifactregistry v1.6.0/go.mod h1:IYt0oBPSAGYj/kprzsBjZ/4LnG/zOcHyFHjWPCi6SAQ= -cloud.google.com/go/artifactregistry v1.7.0/go.mod h1:mqTOFOnGZx8EtSqK/ZWcsm/4U8B77rbcLP6ruDU2Ixk= -cloud.google.com/go/artifactregistry v1.8.0/go.mod h1:w3GQXkJX8hiKN0v+at4b0qotwijQbYUqF2GWkZzAhC0= -cloud.google.com/go/artifactregistry v1.9.0/go.mod h1:2K2RqvA2CYvAeARHRkLDhMDJ3OXy26h3XW+3/Jh2uYc= -cloud.google.com/go/artifactregistry v1.11.1/go.mod h1:lLYghw+Itq9SONbCa1YWBoWs1nOucMH0pwXN1rOBZFI= -cloud.google.com/go/artifactregistry v1.11.2/go.mod h1:nLZns771ZGAwVLzTX/7Al6R9ehma4WUEhZGWV6CeQNQ= -cloud.google.com/go/artifactregistry v1.12.0/go.mod h1:o6P3MIvtzTOnmvGagO9v/rOjjA0HmhJ+/6KAXrmYDCI= -cloud.google.com/go/artifactregistry v1.13.0/go.mod h1:uy/LNfoOIivepGhooAUpL1i30Hgee3Cu0l4VTWHUC08= -cloud.google.com/go/asset v1.5.0/go.mod h1:5mfs8UvcM5wHhqtSv8J1CtxxaQq3AdBxxQi2jGW/K4o= -cloud.google.com/go/asset v1.7.0/go.mod h1:YbENsRK4+xTiL+Ofoj5Ckf+O17kJtgp3Y3nn4uzZz5s= -cloud.google.com/go/asset v1.8.0/go.mod h1:mUNGKhiqIdbr8X7KNayoYvyc4HbbFO9URsjbytpUaW0= -cloud.google.com/go/asset v1.9.0/go.mod h1:83MOE6jEJBMqFKadM9NLRcs80Gdw76qGuHn8m3h8oHQ= -cloud.google.com/go/asset v1.10.0/go.mod h1:pLz7uokL80qKhzKr4xXGvBQXnzHn5evJAEAtZiIb0wY= -cloud.google.com/go/asset v1.11.1/go.mod h1:fSwLhbRvC9p9CXQHJ3BgFeQNM4c9x10lqlrdEUYXlJo= -cloud.google.com/go/asset v1.12.0/go.mod h1:h9/sFOa4eDIyKmH6QMpm4eUK3pDojWnUhTgJlk762Hg= -cloud.google.com/go/asset v1.13.0/go.mod h1:WQAMyYek/b7NBpYq/K4KJWcRqzoalEsxz/t/dTk4THw= -cloud.google.com/go/assuredworkloads v1.5.0/go.mod h1:n8HOZ6pff6re5KYfBXcFvSViQjDwxFkAkmUFffJRbbY= -cloud.google.com/go/assuredworkloads v1.6.0/go.mod h1:yo2YOk37Yc89Rsd5QMVECvjaMKymF9OP+QXWlKXUkXw= -cloud.google.com/go/assuredworkloads v1.7.0/go.mod h1:z/736/oNmtGAyU47reJgGN+KVoYoxeLBoj4XkKYscNI= -cloud.google.com/go/assuredworkloads v1.8.0/go.mod h1:AsX2cqyNCOvEQC8RMPnoc0yEarXQk6WEKkxYfL6kGIo= -cloud.google.com/go/assuredworkloads v1.9.0/go.mod h1:kFuI1P78bplYtT77Tb1hi0FMxM0vVpRC7VVoJC3ZoT0= -cloud.google.com/go/assuredworkloads v1.10.0/go.mod h1:kwdUQuXcedVdsIaKgKTp9t0UJkE5+PAVNhdQm4ZVq2E= -cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0= -cloud.google.com/go/automl v1.6.0/go.mod h1:ugf8a6Fx+zP0D59WLhqgTDsQI9w07o64uf/Is3Nh5p8= -cloud.google.com/go/automl v1.7.0/go.mod h1:RL9MYCCsJEOmt0Wf3z9uzG0a7adTT1fe+aObgSpkCt8= -cloud.google.com/go/automl v1.8.0/go.mod h1:xWx7G/aPEe/NP+qzYXktoBSDfjO+vnKMGgsApGJJquM= -cloud.google.com/go/automl v1.12.0/go.mod h1:tWDcHDp86aMIuHmyvjuKeeHEGq76lD7ZqfGLN6B0NuU= -cloud.google.com/go/baremetalsolution v0.3.0/go.mod h1:XOrocE+pvK1xFfleEnShBlNAXf+j5blPPxrhjKgnIFc= -cloud.google.com/go/baremetalsolution v0.4.0/go.mod h1:BymplhAadOO/eBa7KewQ0Ppg4A4Wplbn+PsFKRLo0uI= -cloud.google.com/go/baremetalsolution v0.5.0/go.mod h1:dXGxEkmR9BMwxhzBhV0AioD0ULBmuLZI8CdwalUxuss= -cloud.google.com/go/batch v0.3.0/go.mod h1:TR18ZoAekj1GuirsUsR1ZTKN3FC/4UDnScjT8NXImFE= -cloud.google.com/go/batch v0.4.0/go.mod h1:WZkHnP43R/QCGQsZ+0JyG4i79ranE2u8xvjq/9+STPE= -cloud.google.com/go/batch v0.7.0/go.mod h1:vLZN95s6teRUqRQ4s3RLDsH8PvboqBK+rn1oevL159g= -cloud.google.com/go/beyondcorp v0.2.0/go.mod h1:TB7Bd+EEtcw9PCPQhCJtJGjk/7TC6ckmnSFS+xwTfm4= -cloud.google.com/go/beyondcorp v0.3.0/go.mod h1:E5U5lcrcXMsCuoDNyGrpyTm/hn7ne941Jz2vmksAxW8= -cloud.google.com/go/beyondcorp v0.4.0/go.mod h1:3ApA0mbhHx6YImmuubf5pyW8srKnCEPON32/5hj+RmM= -cloud.google.com/go/beyondcorp v0.5.0/go.mod h1:uFqj9X+dSfrheVp7ssLTaRHd2EHqSL4QZmH4e8WXGGU= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/bigquery v1.42.0/go.mod h1:8dRTJxhtG+vwBKzE5OseQn/hiydoQN3EedCaOdYmxRA= -cloud.google.com/go/bigquery v1.43.0/go.mod h1:ZMQcXHsl+xmU1z36G2jNGZmKp9zNY5BUua5wDgmNCfw= -cloud.google.com/go/bigquery v1.44.0/go.mod h1:0Y33VqXTEsbamHJvJHdFmtqHvMIY28aK1+dFsvaChGc= -cloud.google.com/go/bigquery v1.47.0/go.mod h1:sA9XOgy0A8vQK9+MWhEQTY6Tix87M/ZurWFIxmF9I/E= -cloud.google.com/go/bigquery v1.48.0/go.mod h1:QAwSz+ipNgfL5jxiaK7weyOhzdoAy1zFm0Nf1fysJac= -cloud.google.com/go/bigquery v1.49.0/go.mod h1:Sv8hMmTFFYBlt/ftw2uN6dFdQPzBlREY9yBh7Oy7/4Q= -cloud.google.com/go/bigquery v1.50.0/go.mod h1:YrleYEh2pSEbgTBZYMJ5SuSr0ML3ypjRB1zgf7pvQLU= -cloud.google.com/go/billing v1.4.0/go.mod h1:g9IdKBEFlItS8bTtlrZdVLWSSdSyFUZKXNS02zKMOZY= -cloud.google.com/go/billing v1.5.0/go.mod h1:mztb1tBc3QekhjSgmpf/CV4LzWXLzCArwpLmP2Gm88s= -cloud.google.com/go/billing v1.6.0/go.mod h1:WoXzguj+BeHXPbKfNWkqVtDdzORazmCjraY+vrxcyvI= -cloud.google.com/go/billing v1.7.0/go.mod h1:q457N3Hbj9lYwwRbnlD7vUpyjq6u5U1RAOArInEiD5Y= -cloud.google.com/go/billing v1.12.0/go.mod h1:yKrZio/eu+okO/2McZEbch17O5CB5NpZhhXG6Z766ss= -cloud.google.com/go/billing v1.13.0/go.mod h1:7kB2W9Xf98hP9Sr12KfECgfGclsH3CQR0R08tnRlRbc= -cloud.google.com/go/binaryauthorization v1.1.0/go.mod h1:xwnoWu3Y84jbuHa0zd526MJYmtnVXn0syOjaJgy4+dM= -cloud.google.com/go/binaryauthorization v1.2.0/go.mod h1:86WKkJHtRcv5ViNABtYMhhNWRrD1Vpi//uKEy7aYEfI= -cloud.google.com/go/binaryauthorization v1.3.0/go.mod h1:lRZbKgjDIIQvzYQS1p99A7/U1JqvqeZg0wiI5tp6tg0= -cloud.google.com/go/binaryauthorization v1.4.0/go.mod h1:tsSPQrBd77VLplV70GUhBf/Zm3FsKmgSqgm4UmiDItk= -cloud.google.com/go/binaryauthorization v1.5.0/go.mod h1:OSe4OU1nN/VswXKRBmciKpo9LulY41gch5c68htf3/Q= -cloud.google.com/go/certificatemanager v1.3.0/go.mod h1:n6twGDvcUBFu9uBgt4eYvvf3sQ6My8jADcOVwHmzadg= -cloud.google.com/go/certificatemanager v1.4.0/go.mod h1:vowpercVFyqs8ABSmrdV+GiFf2H/ch3KyudYQEMM590= -cloud.google.com/go/certificatemanager v1.6.0/go.mod h1:3Hh64rCKjRAX8dXgRAyOcY5vQ/fE1sh8o+Mdd6KPgY8= -cloud.google.com/go/channel v1.8.0/go.mod h1:W5SwCXDJsq/rg3tn3oG0LOxpAo6IMxNa09ngphpSlnk= -cloud.google.com/go/channel v1.9.0/go.mod h1:jcu05W0my9Vx4mt3/rEHpfxc9eKi9XwsdDL8yBMbKUk= -cloud.google.com/go/channel v1.11.0/go.mod h1:IdtI0uWGqhEeatSB62VOoJ8FSUhJ9/+iGkJVqp74CGE= -cloud.google.com/go/channel v1.12.0/go.mod h1:VkxCGKASi4Cq7TbXxlaBezonAYpp1GCnKMY6tnMQnLU= -cloud.google.com/go/cloudbuild v1.3.0/go.mod h1:WequR4ULxlqvMsjDEEEFnOG5ZSRSgWOywXYDb1vPE6U= -cloud.google.com/go/cloudbuild v1.4.0/go.mod h1:5Qwa40LHiOXmz3386FrjrYM93rM/hdRr7b53sySrTqA= -cloud.google.com/go/cloudbuild v1.6.0/go.mod h1:UIbc/w9QCbH12xX+ezUsgblrWv+Cv4Tw83GiSMHOn9M= -cloud.google.com/go/cloudbuild v1.7.0/go.mod h1:zb5tWh2XI6lR9zQmsm1VRA+7OCuve5d8S+zJUul8KTg= -cloud.google.com/go/cloudbuild v1.9.0/go.mod h1:qK1d7s4QlO0VwfYn5YuClDGg2hfmLZEb4wQGAbIgL1s= -cloud.google.com/go/clouddms v1.3.0/go.mod h1:oK6XsCDdW4Ib3jCCBugx+gVjevp2TMXFtgxvPSee3OM= -cloud.google.com/go/clouddms v1.4.0/go.mod h1:Eh7sUGCC+aKry14O1NRljhjyrr0NFC0G2cjwX0cByRk= -cloud.google.com/go/clouddms v1.5.0/go.mod h1:QSxQnhikCLUw13iAbffF2CZxAER3xDGNHjsTAkQJcQA= -cloud.google.com/go/cloudtasks v1.5.0/go.mod h1:fD92REy1x5woxkKEkLdvavGnPJGEn8Uic9nWuLzqCpY= -cloud.google.com/go/cloudtasks v1.6.0/go.mod h1:C6Io+sxuke9/KNRkbQpihnW93SWDU3uXt92nu85HkYI= -cloud.google.com/go/cloudtasks v1.7.0/go.mod h1:ImsfdYWwlWNJbdgPIIGJWC+gemEGTBK/SunNQQNCAb4= -cloud.google.com/go/cloudtasks v1.8.0/go.mod h1:gQXUIwCSOI4yPVK7DgTVFiiP0ZW/eQkydWzwVMdHxrI= -cloud.google.com/go/cloudtasks v1.9.0/go.mod h1:w+EyLsVkLWHcOaqNEyvcKAsWp9p29dL6uL9Nst1cI7Y= -cloud.google.com/go/cloudtasks v1.10.0/go.mod h1:NDSoTLkZ3+vExFEWu2UJV1arUyzVDAiZtdWcsUyNwBs= -cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= -cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= -cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= -cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= -cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= -cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= -cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= -cloud.google.com/go/compute v1.12.0/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= -cloud.google.com/go/compute v1.12.1/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= -cloud.google.com/go/compute v1.13.0/go.mod h1:5aPTS0cUNMIc1CE546K+Th6weJUNQErARyZtRXDJ8GE= -cloud.google.com/go/compute v1.14.0/go.mod h1:YfLtxrj9sU4Yxv+sXzZkyPjEyPBZfXHUvjxega5vAdo= -cloud.google.com/go/compute v1.15.1/go.mod h1:bjjoF/NtFUrkD/urWfdHaKuOPDR5nWIs63rR+SXhcpA= -cloud.google.com/go/compute v1.18.0/go.mod h1:1X7yHxec2Ga+Ss6jPyjxRxpu2uu7PLgsOVXvgU0yacs= -cloud.google.com/go/compute v1.19.0/go.mod h1:rikpw2y+UMidAe9tISo04EHNOIf42RLYF/q8Bs93scU= -cloud.google.com/go/compute v1.19.3/go.mod h1:qxvISKp/gYnXkSAD1ppcSOveRAmzxicEv/JlizULFrI= -cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= -cloud.google.com/go/compute/metadata v0.1.0/go.mod h1:Z1VN+bulIf6bt4P/C37K4DyZYZEXYonfTBHHFPO/4UU= -cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= -cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= -cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= -cloud.google.com/go/contactcenterinsights v1.3.0/go.mod h1:Eu2oemoePuEFc/xKFPjbTuPSj0fYJcPls9TFlPNnHHY= -cloud.google.com/go/contactcenterinsights v1.4.0/go.mod h1:L2YzkGbPsv+vMQMCADxJoT9YiTTnSEd6fEvCeHTYVck= -cloud.google.com/go/contactcenterinsights v1.6.0/go.mod h1:IIDlT6CLcDoyv79kDv8iWxMSTZhLxSCofVV5W6YFM/w= -cloud.google.com/go/container v1.6.0/go.mod h1:Xazp7GjJSeUYo688S+6J5V+n/t+G5sKBTFkKNudGRxg= -cloud.google.com/go/container v1.7.0/go.mod h1:Dp5AHtmothHGX3DwwIHPgq45Y8KmNsgN3amoYfxVkLo= -cloud.google.com/go/container v1.13.1/go.mod h1:6wgbMPeQRw9rSnKBCAJXnds3Pzj03C4JHamr8asWKy4= -cloud.google.com/go/container v1.14.0/go.mod h1:3AoJMPhHfLDxLvrlVWaK57IXzaPnLaZq63WX59aQBfM= -cloud.google.com/go/container v1.15.0/go.mod h1:ft+9S0WGjAyjDggg5S06DXj+fHJICWg8L7isCQe9pQA= -cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= -cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= -cloud.google.com/go/containeranalysis v0.7.0/go.mod h1:9aUL+/vZ55P2CXfuZjS4UjQ9AgXoSw8Ts6lemfmxBxI= -cloud.google.com/go/containeranalysis v0.9.0/go.mod h1:orbOANbwk5Ejoom+s+DUCTTJ7IBdBQJDcSylAx/on9s= -cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= -cloud.google.com/go/datacatalog v1.5.0/go.mod h1:M7GPLNQeLfWqeIm3iuiruhPzkt65+Bx8dAKvScX8jvs= -cloud.google.com/go/datacatalog v1.6.0/go.mod h1:+aEyF8JKg+uXcIdAmmaMUmZ3q1b/lKLtXCmXdnc0lbc= -cloud.google.com/go/datacatalog v1.7.0/go.mod h1:9mEl4AuDYWw81UGc41HonIHH7/sn52H0/tc8f8ZbZIE= -cloud.google.com/go/datacatalog v1.8.0/go.mod h1:KYuoVOv9BM8EYz/4eMFxrr4DUKhGIOXxZoKYF5wdISM= -cloud.google.com/go/datacatalog v1.8.1/go.mod h1:RJ58z4rMp3gvETA465Vg+ag8BGgBdnRPEMMSTr5Uv+M= -cloud.google.com/go/datacatalog v1.12.0/go.mod h1:CWae8rFkfp6LzLumKOnmVh4+Zle4A3NXLzVJ1d1mRm0= -cloud.google.com/go/datacatalog v1.13.0/go.mod h1:E4Rj9a5ZtAxcQJlEBTLgMTphfP11/lNaAshpoBgemX8= -cloud.google.com/go/dataflow v0.6.0/go.mod h1:9QwV89cGoxjjSR9/r7eFDqqjtvbKxAK2BaYU6PVk9UM= -cloud.google.com/go/dataflow v0.7.0/go.mod h1:PX526vb4ijFMesO1o202EaUmouZKBpjHsTlCtB4parQ= -cloud.google.com/go/dataflow v0.8.0/go.mod h1:Rcf5YgTKPtQyYz8bLYhFoIV/vP39eL7fWNcSOyFfLJE= -cloud.google.com/go/dataform v0.3.0/go.mod h1:cj8uNliRlHpa6L3yVhDOBrUXH+BPAO1+KFMQQNSThKo= -cloud.google.com/go/dataform v0.4.0/go.mod h1:fwV6Y4Ty2yIFL89huYlEkwUPtS7YZinZbzzj5S9FzCE= -cloud.google.com/go/dataform v0.5.0/go.mod h1:GFUYRe8IBa2hcomWplodVmUx/iTL0FrsauObOM3Ipr0= -cloud.google.com/go/dataform v0.6.0/go.mod h1:QPflImQy33e29VuapFdf19oPbE4aYTJxr31OAPV+ulA= -cloud.google.com/go/dataform v0.7.0/go.mod h1:7NulqnVozfHvWUBpMDfKMUESr+85aJsC/2O0o3jWPDE= -cloud.google.com/go/datafusion v1.4.0/go.mod h1:1Zb6VN+W6ALo85cXnM1IKiPw+yQMKMhB9TsTSRDo/38= -cloud.google.com/go/datafusion v1.5.0/go.mod h1:Kz+l1FGHB0J+4XF2fud96WMmRiq/wj8N9u007vyXZ2w= -cloud.google.com/go/datafusion v1.6.0/go.mod h1:WBsMF8F1RhSXvVM8rCV3AeyWVxcC2xY6vith3iw3S+8= -cloud.google.com/go/datalabeling v0.5.0/go.mod h1:TGcJ0G2NzcsXSE/97yWjIZO0bXj0KbVlINXMG9ud42I= -cloud.google.com/go/datalabeling v0.6.0/go.mod h1:WqdISuk/+WIGeMkpw/1q7bK/tFEZxsrFJOJdY2bXvTQ= -cloud.google.com/go/datalabeling v0.7.0/go.mod h1:WPQb1y08RJbmpM3ww0CSUAGweL0SxByuW2E+FU+wXcM= -cloud.google.com/go/dataplex v1.3.0/go.mod h1:hQuRtDg+fCiFgC8j0zV222HvzFQdRd+SVX8gdmFcZzA= -cloud.google.com/go/dataplex v1.4.0/go.mod h1:X51GfLXEMVJ6UN47ESVqvlsRplbLhcsAt0kZCCKsU0A= -cloud.google.com/go/dataplex v1.5.2/go.mod h1:cVMgQHsmfRoI5KFYq4JtIBEUbYwc3c7tXmIDhRmNNVQ= -cloud.google.com/go/dataplex v1.6.0/go.mod h1:bMsomC/aEJOSpHXdFKFGQ1b0TDPIeL28nJObeO1ppRs= -cloud.google.com/go/dataproc v1.7.0/go.mod h1:CKAlMjII9H90RXaMpSxQ8EU6dQx6iAYNPcYPOkSbi8s= -cloud.google.com/go/dataproc v1.8.0/go.mod h1:5OW+zNAH0pMpw14JVrPONsxMQYMBqJuzORhIBfBn9uI= -cloud.google.com/go/dataproc v1.12.0/go.mod h1:zrF3aX0uV3ikkMz6z4uBbIKyhRITnxvr4i3IjKsKrw4= -cloud.google.com/go/dataqna v0.5.0/go.mod h1:90Hyk596ft3zUQ8NkFfvICSIfHFh1Bc7C4cK3vbhkeo= -cloud.google.com/go/dataqna v0.6.0/go.mod h1:1lqNpM7rqNLVgWBJyk5NF6Uen2PHym0jtVJonplVsDA= -cloud.google.com/go/dataqna v0.7.0/go.mod h1:Lx9OcIIeqCrw1a6KdO3/5KMP1wAmTc0slZWwP12Qq3c= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/datastore v1.10.0/go.mod h1:PC5UzAmDEkAmkfaknstTYbNpgE49HAgW2J1gcgUfmdM= -cloud.google.com/go/datastore v1.11.0/go.mod h1:TvGxBIHCS50u8jzG+AW/ppf87v1of8nwzFNgEZU1D3c= -cloud.google.com/go/datastream v1.2.0/go.mod h1:i/uTP8/fZwgATHS/XFu0TcNUhuA0twZxxQ3EyCUQMwo= -cloud.google.com/go/datastream v1.3.0/go.mod h1:cqlOX8xlyYF/uxhiKn6Hbv6WjwPPuI9W2M9SAXwaLLQ= -cloud.google.com/go/datastream v1.4.0/go.mod h1:h9dpzScPhDTs5noEMQVWP8Wx8AFBRyS0s8KWPx/9r0g= -cloud.google.com/go/datastream v1.5.0/go.mod h1:6TZMMNPwjUqZHBKPQ1wwXpb0d5VDVPl2/XoS5yi88q4= -cloud.google.com/go/datastream v1.6.0/go.mod h1:6LQSuswqLa7S4rPAOZFVjHIG3wJIjZcZrw8JDEDJuIs= -cloud.google.com/go/datastream v1.7.0/go.mod h1:uxVRMm2elUSPuh65IbZpzJNMbuzkcvu5CjMqVIUHrww= -cloud.google.com/go/deploy v1.4.0/go.mod h1:5Xghikd4VrmMLNaF6FiRFDlHb59VM59YoDQnOUdsH/c= -cloud.google.com/go/deploy v1.5.0/go.mod h1:ffgdD0B89tToyW/U/D2eL0jN2+IEV/3EMuXHA0l4r+s= -cloud.google.com/go/deploy v1.6.0/go.mod h1:f9PTHehG/DjCom3QH0cntOVRm93uGBDt2vKzAPwpXQI= -cloud.google.com/go/deploy v1.8.0/go.mod h1:z3myEJnA/2wnB4sgjqdMfgxCA0EqC3RBTNcVPs93mtQ= -cloud.google.com/go/dialogflow v1.15.0/go.mod h1:HbHDWs33WOGJgn6rfzBW1Kv807BE3O1+xGbn59zZWI4= -cloud.google.com/go/dialogflow v1.16.1/go.mod h1:po6LlzGfK+smoSmTBnbkIZY2w8ffjz/RcGSS+sh1el0= -cloud.google.com/go/dialogflow v1.17.0/go.mod h1:YNP09C/kXA1aZdBgC/VtXX74G/TKn7XVCcVumTflA+8= -cloud.google.com/go/dialogflow v1.18.0/go.mod h1:trO7Zu5YdyEuR+BhSNOqJezyFQ3aUzz0njv7sMx/iek= -cloud.google.com/go/dialogflow v1.19.0/go.mod h1:JVmlG1TwykZDtxtTXujec4tQ+D8SBFMoosgy+6Gn0s0= -cloud.google.com/go/dialogflow v1.29.0/go.mod h1:b+2bzMe+k1s9V+F2jbJwpHPzrnIyHihAdRFMtn2WXuM= -cloud.google.com/go/dialogflow v1.31.0/go.mod h1:cuoUccuL1Z+HADhyIA7dci3N5zUssgpBJmCzI6fNRB4= -cloud.google.com/go/dialogflow v1.32.0/go.mod h1:jG9TRJl8CKrDhMEcvfcfFkkpp8ZhgPz3sBGmAUYJ2qE= -cloud.google.com/go/dlp v1.6.0/go.mod h1:9eyB2xIhpU0sVwUixfBubDoRwP+GjeUoxxeueZmqvmM= -cloud.google.com/go/dlp v1.7.0/go.mod h1:68ak9vCiMBjbasxeVD17hVPxDEck+ExiHavX8kiHG+Q= -cloud.google.com/go/dlp v1.9.0/go.mod h1:qdgmqgTyReTz5/YNSSuueR8pl7hO0o9bQ39ZhtgkWp4= -cloud.google.com/go/documentai v1.7.0/go.mod h1:lJvftZB5NRiFSX4moiye1SMxHx0Bc3x1+p9e/RfXYiU= -cloud.google.com/go/documentai v1.8.0/go.mod h1:xGHNEB7CtsnySCNrCFdCyyMz44RhFEEX2Q7UD0c5IhU= -cloud.google.com/go/documentai v1.9.0/go.mod h1:FS5485S8R00U10GhgBC0aNGrJxBP8ZVpEeJ7PQDZd6k= -cloud.google.com/go/documentai v1.10.0/go.mod h1:vod47hKQIPeCfN2QS/jULIvQTugbmdc0ZvxxfQY1bg4= -cloud.google.com/go/documentai v1.16.0/go.mod h1:o0o0DLTEZ+YnJZ+J4wNfTxmDVyrkzFvttBXXtYRMHkM= -cloud.google.com/go/documentai v1.18.0/go.mod h1:F6CK6iUH8J81FehpskRmhLq/3VlwQvb7TvwOceQ2tbs= -cloud.google.com/go/domains v0.6.0/go.mod h1:T9Rz3GasrpYk6mEGHh4rymIhjlnIuB4ofT1wTxDeT4Y= -cloud.google.com/go/domains v0.7.0/go.mod h1:PtZeqS1xjnXuRPKE/88Iru/LdfoRyEHYA9nFQf4UKpg= -cloud.google.com/go/domains v0.8.0/go.mod h1:M9i3MMDzGFXsydri9/vW+EWz9sWb4I6WyHqdlAk0idE= -cloud.google.com/go/edgecontainer v0.1.0/go.mod h1:WgkZ9tp10bFxqO8BLPqv2LlfmQF1X8lZqwW4r1BTajk= -cloud.google.com/go/edgecontainer v0.2.0/go.mod h1:RTmLijy+lGpQ7BXuTDa4C4ssxyXT34NIuHIgKuP4s5w= -cloud.google.com/go/edgecontainer v0.3.0/go.mod h1:FLDpP4nykgwwIfcLt6zInhprzw0lEi2P1fjO6Ie0qbc= -cloud.google.com/go/edgecontainer v1.0.0/go.mod h1:cttArqZpBB2q58W/upSG++ooo6EsblxDIolxa3jSjbY= -cloud.google.com/go/errorreporting v0.3.0/go.mod h1:xsP2yaAp+OAW4OIm60An2bbLpqIhKXdWR/tawvl7QzU= -cloud.google.com/go/essentialcontacts v1.3.0/go.mod h1:r+OnHa5jfj90qIfZDO/VztSFqbQan7HV75p8sA+mdGI= -cloud.google.com/go/essentialcontacts v1.4.0/go.mod h1:8tRldvHYsmnBCHdFpvU+GL75oWiBKl80BiqlFh9tp+8= -cloud.google.com/go/essentialcontacts v1.5.0/go.mod h1:ay29Z4zODTuwliK7SnX8E86aUF2CTzdNtvv42niCX0M= -cloud.google.com/go/eventarc v1.7.0/go.mod h1:6ctpF3zTnaQCxUjHUdcfgcA1A2T309+omHZth7gDfmc= -cloud.google.com/go/eventarc v1.8.0/go.mod h1:imbzxkyAU4ubfsaKYdQg04WS1NvncblHEup4kvF+4gw= -cloud.google.com/go/eventarc v1.10.0/go.mod h1:u3R35tmZ9HvswGRBnF48IlYgYeBcPUCjkr4BTdem2Kw= -cloud.google.com/go/eventarc v1.11.0/go.mod h1:PyUjsUKPWoRBCHeOxZd/lbOOjahV41icXyUY5kSTvVY= -cloud.google.com/go/filestore v1.3.0/go.mod h1:+qbvHGvXU1HaKX2nD0WEPo92TP/8AQuCVEBXNY9z0+w= -cloud.google.com/go/filestore v1.4.0/go.mod h1:PaG5oDfo9r224f8OYXURtAsY+Fbyq/bLYoINEK8XQAI= -cloud.google.com/go/filestore v1.5.0/go.mod h1:FqBXDWBp4YLHqRnVGveOkHDf8svj9r5+mUDLupOWEDs= -cloud.google.com/go/filestore v1.6.0/go.mod h1:di5unNuss/qfZTw2U9nhFqo8/ZDSc466dre85Kydllg= -cloud.google.com/go/firestore v1.9.0/go.mod h1:HMkjKHNTtRyZNiMzu7YAsLr9K3X2udY2AMwDaMEQiiE= -cloud.google.com/go/functions v1.6.0/go.mod h1:3H1UA3qiIPRWD7PeZKLvHZ9SaQhR26XIJcC0A5GbvAk= -cloud.google.com/go/functions v1.7.0/go.mod h1:+d+QBcWM+RsrgZfV9xo6KfA1GlzJfxcfZcRPEhDDfzg= -cloud.google.com/go/functions v1.8.0/go.mod h1:RTZ4/HsQjIqIYP9a9YPbU+QFoQsAlYgrwOXJWHn1POY= -cloud.google.com/go/functions v1.9.0/go.mod h1:Y+Dz8yGguzO3PpIjhLTbnqV1CWmgQ5UwtlpzoyquQ08= -cloud.google.com/go/functions v1.10.0/go.mod h1:0D3hEOe3DbEvCXtYOZHQZmD+SzYsi1YbI7dGvHfldXw= -cloud.google.com/go/functions v1.12.0/go.mod h1:AXWGrF3e2C/5ehvwYo/GH6O5s09tOPksiKhz+hH8WkA= -cloud.google.com/go/functions v1.13.0/go.mod h1:EU4O007sQm6Ef/PwRsI8N2umygGqPBS/IZQKBQBcJ3c= -cloud.google.com/go/gaming v1.5.0/go.mod h1:ol7rGcxP/qHTRQE/RO4bxkXq+Fix0j6D4LFPzYTIrDM= -cloud.google.com/go/gaming v1.6.0/go.mod h1:YMU1GEvA39Qt3zWGyAVA9bpYz/yAhTvaQ1t2sK4KPUA= -cloud.google.com/go/gaming v1.7.0/go.mod h1:LrB8U7MHdGgFG851iHAfqUdLcKBdQ55hzXy9xBJz0+w= -cloud.google.com/go/gaming v1.8.0/go.mod h1:xAqjS8b7jAVW0KFYeRUxngo9My3f33kFmua++Pi+ggM= -cloud.google.com/go/gaming v1.9.0/go.mod h1:Fc7kEmCObylSWLO334NcO+O9QMDyz+TKC4v1D7X+Bc0= -cloud.google.com/go/gkebackup v0.2.0/go.mod h1:XKvv/4LfG829/B8B7xRkk8zRrOEbKtEam6yNfuQNH60= -cloud.google.com/go/gkebackup v0.3.0/go.mod h1:n/E671i1aOQvUxT541aTkCwExO/bTer2HDlj4TsBRAo= -cloud.google.com/go/gkebackup v0.4.0/go.mod h1:byAyBGUwYGEEww7xsbnUTBHIYcOPy/PgUWUtOeRm9Vg= -cloud.google.com/go/gkeconnect v0.5.0/go.mod h1:c5lsNAg5EwAy7fkqX/+goqFsU1Da/jQFqArp+wGNr/o= -cloud.google.com/go/gkeconnect v0.6.0/go.mod h1:Mln67KyU/sHJEBY8kFZ0xTeyPtzbq9StAVvEULYK16A= -cloud.google.com/go/gkeconnect v0.7.0/go.mod h1:SNfmVqPkaEi3bF/B3CNZOAYPYdg7sU+obZ+QTky2Myw= -cloud.google.com/go/gkehub v0.9.0/go.mod h1:WYHN6WG8w9bXU0hqNxt8rm5uxnk8IH+lPY9J2TV7BK0= -cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y977wO+hBH0= -cloud.google.com/go/gkehub v0.11.0/go.mod h1:JOWHlmN+GHyIbuWQPl47/C2RFhnFKH38jH9Ascu3n0E= -cloud.google.com/go/gkehub v0.12.0/go.mod h1:djiIwwzTTBrF5NaXCGv3mf7klpEMcST17VBTVVDcuaw= -cloud.google.com/go/gkemulticloud v0.3.0/go.mod h1:7orzy7O0S+5kq95e4Hpn7RysVA7dPs8W/GgfUtsPbrA= -cloud.google.com/go/gkemulticloud v0.4.0/go.mod h1:E9gxVBnseLWCk24ch+P9+B2CoDFJZTyIgLKSalC7tuI= -cloud.google.com/go/gkemulticloud v0.5.0/go.mod h1:W0JDkiyi3Tqh0TJr//y19wyb1yf8llHVto2Htf2Ja3Y= -cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= -cloud.google.com/go/gsuiteaddons v1.3.0/go.mod h1:EUNK/J1lZEZO8yPtykKxLXI6JSVN2rg9bN8SXOa0bgM= -cloud.google.com/go/gsuiteaddons v1.4.0/go.mod h1:rZK5I8hht7u7HxFQcFei0+AtfS9uSushomRlg+3ua1o= -cloud.google.com/go/gsuiteaddons v1.5.0/go.mod h1:TFCClYLd64Eaa12sFVmUyG62tk4mdIsI7pAnSXRkcFo= -cloud.google.com/go/iam v0.1.0/go.mod h1:vcUNEa0pEm0qRVpmWepWaFMIAI8/hjB9mO8rNCJtF6c= -cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= -cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= -cloud.google.com/go/iam v0.6.0/go.mod h1:+1AH33ueBne5MzYccyMHtEKqLE4/kJOibtffMHDMFMc= -cloud.google.com/go/iam v0.7.0/go.mod h1:H5Br8wRaDGNc8XP3keLc4unfUUZeyH3Sfl9XpQEYOeg= -cloud.google.com/go/iam v0.8.0/go.mod h1:lga0/y3iH6CX7sYqypWJ33hf7kkfXJag67naqGESjkE= -cloud.google.com/go/iam v0.11.0/go.mod h1:9PiLDanza5D+oWFZiH1uG+RnRCfEGKoyl6yo4cgWZGY= -cloud.google.com/go/iam v0.12.0/go.mod h1:knyHGviacl11zrtZUoDuYpDgLjvr28sLQaG0YB2GYAY= -cloud.google.com/go/iam v0.13.0/go.mod h1:ljOg+rcNfzZ5d6f1nAUJ8ZIxOaZUVoS14bKCtaLZ/D0= -cloud.google.com/go/iap v1.4.0/go.mod h1:RGFwRJdihTINIe4wZ2iCP0zF/qu18ZwyKxrhMhygBEc= -cloud.google.com/go/iap v1.5.0/go.mod h1:UH/CGgKd4KyohZL5Pt0jSKE4m3FR51qg6FKQ/z/Ix9A= -cloud.google.com/go/iap v1.6.0/go.mod h1:NSuvI9C/j7UdjGjIde7t7HBz+QTwBcapPE07+sSRcLk= -cloud.google.com/go/iap v1.7.0/go.mod h1:beqQx56T9O1G1yNPph+spKpNibDlYIiIixiqsQXxLIo= -cloud.google.com/go/iap v1.7.1/go.mod h1:WapEwPc7ZxGt2jFGB/C/bm+hP0Y6NXzOYGjpPnmMS74= -cloud.google.com/go/ids v1.1.0/go.mod h1:WIuwCaYVOzHIj2OhN9HAwvW+DBdmUAdcWlFxRl+KubM= -cloud.google.com/go/ids v1.2.0/go.mod h1:5WXvp4n25S0rA/mQWAg1YEEBBq6/s+7ml1RDCW1IrcY= -cloud.google.com/go/ids v1.3.0/go.mod h1:JBdTYwANikFKaDP6LtW5JAi4gubs57SVNQjemdt6xV4= -cloud.google.com/go/iot v1.3.0/go.mod h1:r7RGh2B61+B8oz0AGE+J72AhA0G7tdXItODWsaA2oLs= -cloud.google.com/go/iot v1.4.0/go.mod h1:dIDxPOn0UvNDUMD8Ger7FIaTuvMkj+aGk94RPP0iV+g= -cloud.google.com/go/iot v1.5.0/go.mod h1:mpz5259PDl3XJthEmh9+ap0affn/MqNSP4My77Qql9o= -cloud.google.com/go/iot v1.6.0/go.mod h1:IqdAsmE2cTYYNO1Fvjfzo9po179rAtJeVGUvkLN3rLE= -cloud.google.com/go/kms v1.4.0/go.mod h1:fajBHndQ+6ubNw6Ss2sSd+SWvjL26RNo/dr7uxsnnOA= -cloud.google.com/go/kms v1.5.0/go.mod h1:QJS2YY0eJGBg3mnDfuaCyLauWwBJiHRboYxJ++1xJNg= -cloud.google.com/go/kms v1.6.0/go.mod h1:Jjy850yySiasBUDi6KFUwUv2n1+o7QZFyuUJg6OgjA0= -cloud.google.com/go/kms v1.8.0/go.mod h1:4xFEhYFqvW+4VMELtZyxomGSYtSQKzM178ylFW4jMAg= -cloud.google.com/go/kms v1.9.0/go.mod h1:qb1tPTgfF9RQP8e1wq4cLFErVuTJv7UsSC915J8dh3w= -cloud.google.com/go/kms v1.10.0/go.mod h1:ng3KTUtQQU9bPX3+QGLsflZIHlkbn8amFAMY63m8d24= -cloud.google.com/go/kms v1.10.1/go.mod h1:rIWk/TryCkR59GMC3YtHtXeLzd634lBbKenvyySAyYI= -cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= -cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= -cloud.google.com/go/language v1.7.0/go.mod h1:DJ6dYN/W+SQOjF8e1hLQXMF21AkH2w9wiPzPCJa2MIE= -cloud.google.com/go/language v1.8.0/go.mod h1:qYPVHf7SPoNNiCL2Dr0FfEFNil1qi3pQEyygwpgVKB8= -cloud.google.com/go/language v1.9.0/go.mod h1:Ns15WooPM5Ad/5no/0n81yUetis74g3zrbeJBE+ptUY= -cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= -cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08= -cloud.google.com/go/lifesciences v0.8.0/go.mod h1:lFxiEOMqII6XggGbOnKiyZ7IBwoIqA84ClvoezaA/bo= -cloud.google.com/go/logging v1.6.1/go.mod h1:5ZO0mHHbvm8gEmeEUHrmDlTDSu5imF6MUP9OfilNXBw= -cloud.google.com/go/logging v1.7.0/go.mod h1:3xjP2CjkM3ZkO73aj4ASA5wRPGGCRrPIAeNqVNkzY8M= -cloud.google.com/go/longrunning v0.1.1/go.mod h1:UUFxuDWkv22EuY93jjmDMFT5GPQKeFVJBIF6QlTqdsE= -cloud.google.com/go/longrunning v0.3.0/go.mod h1:qth9Y41RRSUE69rDcOn6DdK3HfQfsUI0YSmW3iIlLJc= -cloud.google.com/go/longrunning v0.4.1/go.mod h1:4iWDqhBZ70CvZ6BfETbvam3T8FMvLK+eFj0E6AaRQTo= -cloud.google.com/go/managedidentities v1.3.0/go.mod h1:UzlW3cBOiPrzucO5qWkNkh0w33KFtBJU281hacNvsdE= -cloud.google.com/go/managedidentities v1.4.0/go.mod h1:NWSBYbEMgqmbZsLIyKvxrYbtqOsxY1ZrGM+9RgDqInM= -cloud.google.com/go/managedidentities v1.5.0/go.mod h1:+dWcZ0JlUmpuxpIDfyP5pP5y0bLdRwOS4Lp7gMni/LA= -cloud.google.com/go/maps v0.1.0/go.mod h1:BQM97WGyfw9FWEmQMpZ5T6cpovXXSd1cGmFma94eubI= -cloud.google.com/go/maps v0.6.0/go.mod h1:o6DAMMfb+aINHz/p/jbcY+mYeXBoZoxTfdSQ8VAJaCw= -cloud.google.com/go/maps v0.7.0/go.mod h1:3GnvVl3cqeSvgMcpRlQidXsPYuDGQ8naBis7MVzpXsY= -cloud.google.com/go/mediatranslation v0.5.0/go.mod h1:jGPUhGTybqsPQn91pNXw0xVHfuJ3leR1wj37oU3y1f4= -cloud.google.com/go/mediatranslation v0.6.0/go.mod h1:hHdBCTYNigsBxshbznuIMFNe5QXEowAuNmmC7h8pu5w= -cloud.google.com/go/mediatranslation v0.7.0/go.mod h1:LCnB/gZr90ONOIQLgSXagp8XUW1ODs2UmUMvcgMfI2I= -cloud.google.com/go/memcache v1.4.0/go.mod h1:rTOfiGZtJX1AaFUrOgsMHX5kAzaTQ8azHiuDoTPzNsE= -cloud.google.com/go/memcache v1.5.0/go.mod h1:dk3fCK7dVo0cUU2c36jKb4VqKPS22BTkf81Xq617aWM= -cloud.google.com/go/memcache v1.6.0/go.mod h1:XS5xB0eQZdHtTuTF9Hf8eJkKtR3pVRCcvJwtm68T3rA= -cloud.google.com/go/memcache v1.7.0/go.mod h1:ywMKfjWhNtkQTxrWxCkCFkoPjLHPW6A7WOTVI8xy3LY= -cloud.google.com/go/memcache v1.9.0/go.mod h1:8oEyzXCu+zo9RzlEaEjHl4KkgjlNDaXbCQeQWlzNFJM= -cloud.google.com/go/metastore v1.5.0/go.mod h1:2ZNrDcQwghfdtCwJ33nM0+GrBGlVuh8rakL3vdPY3XY= -cloud.google.com/go/metastore v1.6.0/go.mod h1:6cyQTls8CWXzk45G55x57DVQ9gWg7RiH65+YgPsNh9s= -cloud.google.com/go/metastore v1.7.0/go.mod h1:s45D0B4IlsINu87/AsWiEVYbLaIMeUSoxlKKDqBGFS8= -cloud.google.com/go/metastore v1.8.0/go.mod h1:zHiMc4ZUpBiM7twCIFQmJ9JMEkDSyZS9U12uf7wHqSI= -cloud.google.com/go/metastore v1.10.0/go.mod h1:fPEnH3g4JJAk+gMRnrAnoqyv2lpUCqJPWOodSaf45Eo= -cloud.google.com/go/monitoring v1.7.0/go.mod h1:HpYse6kkGo//7p6sT0wsIC6IBDET0RhIsnmlA53dvEk= -cloud.google.com/go/monitoring v1.8.0/go.mod h1:E7PtoMJ1kQXWxPjB6mv2fhC5/15jInuulFdYYtlcvT4= -cloud.google.com/go/monitoring v1.12.0/go.mod h1:yx8Jj2fZNEkL/GYZyTLS4ZtZEZN8WtDEiEqG4kLK50w= -cloud.google.com/go/monitoring v1.13.0/go.mod h1:k2yMBAB1H9JT/QETjNkgdCGD9bPF712XiLTVr+cBrpw= -cloud.google.com/go/networkconnectivity v1.4.0/go.mod h1:nOl7YL8odKyAOtzNX73/M5/mGZgqqMeryi6UPZTk/rA= -cloud.google.com/go/networkconnectivity v1.5.0/go.mod h1:3GzqJx7uhtlM3kln0+x5wyFvuVH1pIBJjhCpjzSt75o= -cloud.google.com/go/networkconnectivity v1.6.0/go.mod h1:OJOoEXW+0LAxHh89nXd64uGG+FbQoeH8DtxCHVOMlaM= -cloud.google.com/go/networkconnectivity v1.7.0/go.mod h1:RMuSbkdbPwNMQjB5HBWD5MpTBnNm39iAVpC3TmsExt8= -cloud.google.com/go/networkconnectivity v1.10.0/go.mod h1:UP4O4sWXJG13AqrTdQCD9TnLGEbtNRqjuaaA7bNjF5E= -cloud.google.com/go/networkconnectivity v1.11.0/go.mod h1:iWmDD4QF16VCDLXUqvyspJjIEtBR/4zq5hwnY2X3scM= -cloud.google.com/go/networkmanagement v1.4.0/go.mod h1:Q9mdLLRn60AsOrPc8rs8iNV6OHXaGcDdsIQe1ohekq8= -cloud.google.com/go/networkmanagement v1.5.0/go.mod h1:ZnOeZ/evzUdUsnvRt792H0uYEnHQEMaz+REhhzJRcf4= -cloud.google.com/go/networkmanagement v1.6.0/go.mod h1:5pKPqyXjB/sgtvB5xqOemumoQNB7y95Q7S+4rjSOPYY= -cloud.google.com/go/networksecurity v0.5.0/go.mod h1:xS6fOCoqpVC5zx15Z/MqkfDwH4+m/61A3ODiDV1xmiQ= -cloud.google.com/go/networksecurity v0.6.0/go.mod h1:Q5fjhTr9WMI5mbpRYEbiexTzROf7ZbDzvzCrNl14nyU= -cloud.google.com/go/networksecurity v0.7.0/go.mod h1:mAnzoxx/8TBSyXEeESMy9OOYwo1v+gZ5eMRnsT5bC8k= -cloud.google.com/go/networksecurity v0.8.0/go.mod h1:B78DkqsxFG5zRSVuwYFRZ9Xz8IcQ5iECsNrPn74hKHU= -cloud.google.com/go/notebooks v1.2.0/go.mod h1:9+wtppMfVPUeJ8fIWPOq1UnATHISkGXGqTkxeieQ6UY= -cloud.google.com/go/notebooks v1.3.0/go.mod h1:bFR5lj07DtCPC7YAAJ//vHskFBxA5JzYlH68kXVdk34= -cloud.google.com/go/notebooks v1.4.0/go.mod h1:4QPMngcwmgb6uw7Po99B2xv5ufVoIQ7nOGDyL4P8AgA= -cloud.google.com/go/notebooks v1.5.0/go.mod h1:q8mwhnP9aR8Hpfnrc5iN5IBhrXUy8S2vuYs+kBJ/gu0= -cloud.google.com/go/notebooks v1.7.0/go.mod h1:PVlaDGfJgj1fl1S3dUwhFMXFgfYGhYQt2164xOMONmE= -cloud.google.com/go/notebooks v1.8.0/go.mod h1:Lq6dYKOYOWUCTvw5t2q1gp1lAp0zxAxRycayS0iJcqQ= -cloud.google.com/go/optimization v1.1.0/go.mod h1:5po+wfvX5AQlPznyVEZjGJTMr4+CAkJf2XSTQOOl9l4= -cloud.google.com/go/optimization v1.2.0/go.mod h1:Lr7SOHdRDENsh+WXVmQhQTrzdu9ybg0NecjHidBq6xs= -cloud.google.com/go/optimization v1.3.1/go.mod h1:IvUSefKiwd1a5p0RgHDbWCIbDFgKuEdB+fPPuP0IDLI= -cloud.google.com/go/orchestration v1.3.0/go.mod h1:Sj5tq/JpWiB//X/q3Ngwdl5K7B7Y0KZ7bfv0wL6fqVA= -cloud.google.com/go/orchestration v1.4.0/go.mod h1:6W5NLFWs2TlniBphAViZEVhrXRSMgUGDfW7vrWKvsBk= -cloud.google.com/go/orchestration v1.6.0/go.mod h1:M62Bevp7pkxStDfFfTuCOaXgaaqRAga1yKyoMtEoWPQ= -cloud.google.com/go/orgpolicy v1.4.0/go.mod h1:xrSLIV4RePWmP9P3tBl8S93lTmlAxjm06NSm2UTmKvE= -cloud.google.com/go/orgpolicy v1.5.0/go.mod h1:hZEc5q3wzwXJaKrsx5+Ewg0u1LxJ51nNFlext7Tanwc= -cloud.google.com/go/orgpolicy v1.10.0/go.mod h1:w1fo8b7rRqlXlIJbVhOMPrwVljyuW5mqssvBtU18ONc= -cloud.google.com/go/osconfig v1.7.0/go.mod h1:oVHeCeZELfJP7XLxcBGTMBvRO+1nQ5tFG9VQTmYS2Fs= -cloud.google.com/go/osconfig v1.8.0/go.mod h1:EQqZLu5w5XA7eKizepumcvWx+m8mJUhEwiPqWiZeEdg= -cloud.google.com/go/osconfig v1.9.0/go.mod h1:Yx+IeIZJ3bdWmzbQU4fxNl8xsZ4amB+dygAwFPlvnNo= -cloud.google.com/go/osconfig v1.10.0/go.mod h1:uMhCzqC5I8zfD9zDEAfvgVhDS8oIjySWh+l4WK6GnWw= -cloud.google.com/go/osconfig v1.11.0/go.mod h1:aDICxrur2ogRd9zY5ytBLV89KEgT2MKB2L/n6x1ooPw= -cloud.google.com/go/oslogin v1.4.0/go.mod h1:YdgMXWRaElXz/lDk1Na6Fh5orF7gvmJ0FGLIs9LId4E= -cloud.google.com/go/oslogin v1.5.0/go.mod h1:D260Qj11W2qx/HVF29zBg+0fd6YCSjSqLUkY/qEenQU= -cloud.google.com/go/oslogin v1.6.0/go.mod h1:zOJ1O3+dTU8WPlGEkFSh7qeHPPSoxrcMbbK1Nm2iX70= -cloud.google.com/go/oslogin v1.7.0/go.mod h1:e04SN0xO1UNJ1M5GP0vzVBFicIe4O53FOfcixIqTyXo= -cloud.google.com/go/oslogin v1.9.0/go.mod h1:HNavntnH8nzrn8JCTT5fj18FuJLFJc4NaZJtBnQtKFs= -cloud.google.com/go/phishingprotection v0.5.0/go.mod h1:Y3HZknsK9bc9dMi+oE8Bim0lczMU6hrX0UpADuMefr0= -cloud.google.com/go/phishingprotection v0.6.0/go.mod h1:9Y3LBLgy0kDTcYET8ZH3bq/7qni15yVUoAxiFxnlSUA= -cloud.google.com/go/phishingprotection v0.7.0/go.mod h1:8qJI4QKHoda/sb/7/YmMQ2omRLSLYSu9bU0EKCNI+Lk= -cloud.google.com/go/policytroubleshooter v1.3.0/go.mod h1:qy0+VwANja+kKrjlQuOzmlvscn4RNsAc0e15GGqfMxg= -cloud.google.com/go/policytroubleshooter v1.4.0/go.mod h1:DZT4BcRw3QoO8ota9xw/LKtPa8lKeCByYeKTIf/vxdE= -cloud.google.com/go/policytroubleshooter v1.5.0/go.mod h1:Rz1WfV+1oIpPdN2VvvuboLVRsB1Hclg3CKQ53j9l8vw= -cloud.google.com/go/policytroubleshooter v1.6.0/go.mod h1:zYqaPTsmfvpjm5ULxAyD/lINQxJ0DDsnWOP/GZ7xzBc= -cloud.google.com/go/privatecatalog v0.5.0/go.mod h1:XgosMUvvPyxDjAVNDYxJ7wBW8//hLDDYmnsNcMGq1K0= -cloud.google.com/go/privatecatalog v0.6.0/go.mod h1:i/fbkZR0hLN29eEWiiwue8Pb+GforiEIBnV9yrRUOKI= -cloud.google.com/go/privatecatalog v0.7.0/go.mod h1:2s5ssIFO69F5csTXcwBP7NPFTZvps26xGzvQ2PQaBYg= -cloud.google.com/go/privatecatalog v0.8.0/go.mod h1:nQ6pfaegeDAq/Q5lrfCQzQLhubPiZhSaNhIgfJlnIXs= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/pubsub v1.26.0/go.mod h1:QgBH3U/jdJy/ftjPhTkyXNj543Tin1pRYcdcPRnFIRI= -cloud.google.com/go/pubsub v1.27.1/go.mod h1:hQN39ymbV9geqBnfQq6Xf63yNhUAhv9CZhzp5O6qsW0= -cloud.google.com/go/pubsub v1.28.0/go.mod h1:vuXFpwaVoIPQMGXqRyUQigu/AX1S3IWugR9xznmcXX8= -cloud.google.com/go/pubsub v1.30.0/go.mod h1:qWi1OPS0B+b5L+Sg6Gmc9zD1Y+HaM0MdUr7LsupY1P4= -cloud.google.com/go/pubsublite v1.5.0/go.mod h1:xapqNQ1CuLfGi23Yda/9l4bBCKz/wC3KIJ5gKcxveZg= -cloud.google.com/go/pubsublite v1.6.0/go.mod h1:1eFCS0U11xlOuMFV/0iBqw3zP12kddMeCbj/F3FSj9k= -cloud.google.com/go/pubsublite v1.7.0/go.mod h1:8hVMwRXfDfvGm3fahVbtDbiLePT3gpoiJYJY+vxWxVM= -cloud.google.com/go/recaptchaenterprise v1.3.1/go.mod h1:OdD+q+y4XGeAlxRaMn1Y7/GveP6zmq76byL6tjPE7d4= -cloud.google.com/go/recaptchaenterprise/v2 v2.1.0/go.mod h1:w9yVqajwroDNTfGuhmOjPDN//rZGySaf6PtFVcSCa7o= -cloud.google.com/go/recaptchaenterprise/v2 v2.2.0/go.mod h1:/Zu5jisWGeERrd5HnlS3EUGb/D335f9k51B/FVil0jk= -cloud.google.com/go/recaptchaenterprise/v2 v2.3.0/go.mod h1:O9LwGCjrhGHBQET5CA7dd5NwwNQUErSgEDit1DLNTdo= -cloud.google.com/go/recaptchaenterprise/v2 v2.4.0/go.mod h1:Am3LHfOuBstrLrNCBrlI5sbwx9LBg3te2N6hGvHn2mE= -cloud.google.com/go/recaptchaenterprise/v2 v2.5.0/go.mod h1:O8LzcHXN3rz0j+LBC91jrwI3R+1ZSZEWrfL7XHgNo9U= -cloud.google.com/go/recaptchaenterprise/v2 v2.6.0/go.mod h1:RPauz9jeLtB3JVzg6nCbe12qNoaa8pXc4d/YukAmcnA= -cloud.google.com/go/recaptchaenterprise/v2 v2.7.0/go.mod h1:19wVj/fs5RtYtynAPJdDTb69oW0vNHYDBTbB4NvMD9c= -cloud.google.com/go/recommendationengine v0.5.0/go.mod h1:E5756pJcVFeVgaQv3WNpImkFP8a+RptV6dDLGPILjvg= -cloud.google.com/go/recommendationengine v0.6.0/go.mod h1:08mq2umu9oIqc7tDy8sx+MNJdLG0fUi3vaSVbztHgJ4= -cloud.google.com/go/recommendationengine v0.7.0/go.mod h1:1reUcE3GIu6MeBz/h5xZJqNLuuVjNg1lmWMPyjatzac= -cloud.google.com/go/recommender v1.5.0/go.mod h1:jdoeiBIVrJe9gQjwd759ecLJbxCDED4A6p+mqoqDvTg= -cloud.google.com/go/recommender v1.6.0/go.mod h1:+yETpm25mcoiECKh9DEScGzIRyDKpZ0cEhWGo+8bo+c= -cloud.google.com/go/recommender v1.7.0/go.mod h1:XLHs/W+T8olwlGOgfQenXBTbIseGclClff6lhFVe9Bs= -cloud.google.com/go/recommender v1.8.0/go.mod h1:PkjXrTT05BFKwxaUxQmtIlrtj0kph108r02ZZQ5FE70= -cloud.google.com/go/recommender v1.9.0/go.mod h1:PnSsnZY7q+VL1uax2JWkt/UegHssxjUVVCrX52CuEmQ= -cloud.google.com/go/redis v1.7.0/go.mod h1:V3x5Jq1jzUcg+UNsRvdmsfuFnit1cfe3Z/PGyq/lm4Y= -cloud.google.com/go/redis v1.8.0/go.mod h1:Fm2szCDavWzBk2cDKxrkmWBqoCiL1+Ctwq7EyqBCA/A= -cloud.google.com/go/redis v1.9.0/go.mod h1:HMYQuajvb2D0LvMgZmLDZW8V5aOC/WxstZHiy4g8OiA= -cloud.google.com/go/redis v1.10.0/go.mod h1:ThJf3mMBQtW18JzGgh41/Wld6vnDDc/F/F35UolRZPM= -cloud.google.com/go/redis v1.11.0/go.mod h1:/X6eicana+BWcUda5PpwZC48o37SiFVTFSs0fWAJ7uQ= -cloud.google.com/go/resourcemanager v1.3.0/go.mod h1:bAtrTjZQFJkiWTPDb1WBjzvc6/kifjj4QBYuKCCoqKA= -cloud.google.com/go/resourcemanager v1.4.0/go.mod h1:MwxuzkumyTX7/a3n37gmsT3py7LIXwrShilPh3P1tR0= -cloud.google.com/go/resourcemanager v1.5.0/go.mod h1:eQoXNAiAvCf5PXxWxXjhKQoTMaUSNrEfg+6qdf/wots= -cloud.google.com/go/resourcemanager v1.6.0/go.mod h1:YcpXGRs8fDzcUl1Xw8uOVmI8JEadvhRIkoXXUNVYcVo= -cloud.google.com/go/resourcemanager v1.7.0/go.mod h1:HlD3m6+bwhzj9XCouqmeiGuni95NTrExfhoSrkC/3EI= -cloud.google.com/go/resourcesettings v1.3.0/go.mod h1:lzew8VfESA5DQ8gdlHwMrqZs1S9V87v3oCnKCWoOuQU= -cloud.google.com/go/resourcesettings v1.4.0/go.mod h1:ldiH9IJpcrlC3VSuCGvjR5of/ezRrOxFtpJoJo5SmXg= -cloud.google.com/go/resourcesettings v1.5.0/go.mod h1:+xJF7QSG6undsQDfsCJyqWXyBwUoJLhetkRMDRnIoXA= -cloud.google.com/go/retail v1.8.0/go.mod h1:QblKS8waDmNUhghY2TI9O3JLlFk8jybHeV4BF19FrE4= -cloud.google.com/go/retail v1.9.0/go.mod h1:g6jb6mKuCS1QKnH/dpu7isX253absFl6iE92nHwlBUY= -cloud.google.com/go/retail v1.10.0/go.mod h1:2gDk9HsL4HMS4oZwz6daui2/jmKvqShXKQuB2RZ+cCc= -cloud.google.com/go/retail v1.11.0/go.mod h1:MBLk1NaWPmh6iVFSz9MeKG/Psyd7TAgm6y/9L2B4x9Y= -cloud.google.com/go/retail v1.12.0/go.mod h1:UMkelN/0Z8XvKymXFbD4EhFJlYKRx1FGhQkVPU5kF14= -cloud.google.com/go/run v0.2.0/go.mod h1:CNtKsTA1sDcnqqIFR3Pb5Tq0usWxJJvsWOCPldRU3Do= -cloud.google.com/go/run v0.3.0/go.mod h1:TuyY1+taHxTjrD0ZFk2iAR+xyOXEA0ztb7U3UNA0zBo= -cloud.google.com/go/run v0.8.0/go.mod h1:VniEnuBwqjigv0A7ONfQUaEItaiCRVujlMqerPPiktM= -cloud.google.com/go/run v0.9.0/go.mod h1:Wwu+/vvg8Y+JUApMwEDfVfhetv30hCG4ZwDR/IXl2Qg= -cloud.google.com/go/scheduler v1.4.0/go.mod h1:drcJBmxF3aqZJRhmkHQ9b3uSSpQoltBPGPxGAWROx6s= -cloud.google.com/go/scheduler v1.5.0/go.mod h1:ri073ym49NW3AfT6DZi21vLZrG07GXr5p3H1KxN5QlI= -cloud.google.com/go/scheduler v1.6.0/go.mod h1:SgeKVM7MIwPn3BqtcBntpLyrIJftQISRrYB5ZtT+KOk= -cloud.google.com/go/scheduler v1.7.0/go.mod h1:jyCiBqWW956uBjjPMMuX09n3x37mtyPJegEWKxRsn44= -cloud.google.com/go/scheduler v1.8.0/go.mod h1:TCET+Y5Gp1YgHT8py4nlg2Sew8nUHMqcpousDgXJVQc= -cloud.google.com/go/scheduler v1.9.0/go.mod h1:yexg5t+KSmqu+njTIh3b7oYPheFtBWGcbVUYF1GGMIc= -cloud.google.com/go/secretmanager v1.6.0/go.mod h1:awVa/OXF6IiyaU1wQ34inzQNc4ISIDIrId8qE5QGgKA= -cloud.google.com/go/secretmanager v1.8.0/go.mod h1:hnVgi/bN5MYHd3Gt0SPuTPPp5ENina1/LxM+2W9U9J4= -cloud.google.com/go/secretmanager v1.9.0/go.mod h1:b71qH2l1yHmWQHt9LC80akm86mX8AL6X1MA01dW8ht4= -cloud.google.com/go/secretmanager v1.10.0/go.mod h1:MfnrdvKMPNra9aZtQFvBcvRU54hbPD8/HayQdlUgJpU= -cloud.google.com/go/security v1.5.0/go.mod h1:lgxGdyOKKjHL4YG3/YwIL2zLqMFCKs0UbQwgyZmfJl4= -cloud.google.com/go/security v1.7.0/go.mod h1:mZklORHl6Bg7CNnnjLH//0UlAlaXqiG7Lb9PsPXLfD0= -cloud.google.com/go/security v1.8.0/go.mod h1:hAQOwgmaHhztFhiQ41CjDODdWP0+AE1B3sX4OFlq+GU= -cloud.google.com/go/security v1.9.0/go.mod h1:6Ta1bO8LXI89nZnmnsZGp9lVoVWXqsVbIq/t9dzI+2Q= -cloud.google.com/go/security v1.10.0/go.mod h1:QtOMZByJVlibUT2h9afNDWRZ1G96gVywH8T5GUSb9IA= -cloud.google.com/go/security v1.12.0/go.mod h1:rV6EhrpbNHrrxqlvW0BWAIawFWq3X90SduMJdFwtLB8= -cloud.google.com/go/security v1.13.0/go.mod h1:Q1Nvxl1PAgmeW0y3HTt54JYIvUdtcpYKVfIB8AOMZ+0= -cloud.google.com/go/securitycenter v1.13.0/go.mod h1:cv5qNAqjY84FCN6Y9z28WlkKXyWsgLO832YiWwkCWcU= -cloud.google.com/go/securitycenter v1.14.0/go.mod h1:gZLAhtyKv85n52XYWt6RmeBdydyxfPeTrpToDPw4Auc= -cloud.google.com/go/securitycenter v1.15.0/go.mod h1:PeKJ0t8MoFmmXLXWm41JidyzI3PJjd8sXWaVqg43WWk= -cloud.google.com/go/securitycenter v1.16.0/go.mod h1:Q9GMaLQFUD+5ZTabrbujNWLtSLZIZF7SAR0wWECrjdk= -cloud.google.com/go/securitycenter v1.18.1/go.mod h1:0/25gAzCM/9OL9vVx4ChPeM/+DlfGQJDwBy/UC8AKK0= -cloud.google.com/go/securitycenter v1.19.0/go.mod h1:LVLmSg8ZkkyaNy4u7HCIshAngSQ8EcIRREP3xBnyfag= -cloud.google.com/go/servicecontrol v1.4.0/go.mod h1:o0hUSJ1TXJAmi/7fLJAedOovnujSEvjKCAFNXPQ1RaU= -cloud.google.com/go/servicecontrol v1.5.0/go.mod h1:qM0CnXHhyqKVuiZnGKrIurvVImCs8gmqWsDoqe9sU1s= -cloud.google.com/go/servicecontrol v1.10.0/go.mod h1:pQvyvSRh7YzUF2efw7H87V92mxU8FnFDawMClGCNuAA= -cloud.google.com/go/servicecontrol v1.11.0/go.mod h1:kFmTzYzTUIuZs0ycVqRHNaNhgR+UMUpw9n02l/pY+mc= -cloud.google.com/go/servicecontrol v1.11.1/go.mod h1:aSnNNlwEFBY+PWGQ2DoM0JJ/QUXqV5/ZD9DOLB7SnUk= -cloud.google.com/go/servicedirectory v1.4.0/go.mod h1:gH1MUaZCgtP7qQiI+F+A+OpeKF/HQWgtAddhTbhL2bs= -cloud.google.com/go/servicedirectory v1.5.0/go.mod h1:QMKFL0NUySbpZJ1UZs3oFAmdvVxhhxB6eJ/Vlp73dfg= -cloud.google.com/go/servicedirectory v1.6.0/go.mod h1:pUlbnWsLH9c13yGkxCmfumWEPjsRs1RlmJ4pqiNjVL4= -cloud.google.com/go/servicedirectory v1.7.0/go.mod h1:5p/U5oyvgYGYejufvxhgwjL8UVXjkuw7q5XcG10wx1U= -cloud.google.com/go/servicedirectory v1.8.0/go.mod h1:srXodfhY1GFIPvltunswqXpVxFPpZjf8nkKQT7XcXaY= -cloud.google.com/go/servicedirectory v1.9.0/go.mod h1:29je5JjiygNYlmsGz8k6o+OZ8vd4f//bQLtvzkPPT/s= -cloud.google.com/go/servicemanagement v1.4.0/go.mod h1:d8t8MDbezI7Z2R1O/wu8oTggo3BI2GKYbdG4y/SJTco= -cloud.google.com/go/servicemanagement v1.5.0/go.mod h1:XGaCRe57kfqu4+lRxaFEAuqmjzF0r+gWHjWqKqBvKFo= -cloud.google.com/go/servicemanagement v1.6.0/go.mod h1:aWns7EeeCOtGEX4OvZUWCCJONRZeFKiptqKf1D0l/Jc= -cloud.google.com/go/servicemanagement v1.8.0/go.mod h1:MSS2TDlIEQD/fzsSGfCdJItQveu9NXnUniTrq/L8LK4= -cloud.google.com/go/serviceusage v1.3.0/go.mod h1:Hya1cozXM4SeSKTAgGXgj97GlqUvF5JaoXacR1JTP/E= -cloud.google.com/go/serviceusage v1.4.0/go.mod h1:SB4yxXSaYVuUBYUml6qklyONXNLt83U0Rb+CXyhjEeU= -cloud.google.com/go/serviceusage v1.5.0/go.mod h1:w8U1JvqUqwJNPEOTQjrMHkw3IaIFLoLsPLvsE3xueec= -cloud.google.com/go/serviceusage v1.6.0/go.mod h1:R5wwQcbOWsyuOfbP9tGdAnCAc6B9DRwPG1xtWMDeuPA= -cloud.google.com/go/shell v1.3.0/go.mod h1:VZ9HmRjZBsjLGXusm7K5Q5lzzByZmJHf1d0IWHEN5X4= -cloud.google.com/go/shell v1.4.0/go.mod h1:HDxPzZf3GkDdhExzD/gs8Grqk+dmYcEjGShZgYa9URw= -cloud.google.com/go/shell v1.6.0/go.mod h1:oHO8QACS90luWgxP3N9iZVuEiSF84zNyLytb+qE2f9A= -cloud.google.com/go/spanner v1.41.0/go.mod h1:MLYDBJR/dY4Wt7ZaMIQ7rXOTLjYrmxLE/5ve9vFfWos= -cloud.google.com/go/spanner v1.44.0/go.mod h1:G8XIgYdOK+Fbcpbs7p2fiprDw4CaZX63whnSMLVBxjk= -cloud.google.com/go/spanner v1.45.0/go.mod h1:FIws5LowYz8YAE1J8fOS7DJup8ff7xJeetWEo5REA2M= -cloud.google.com/go/speech v1.6.0/go.mod h1:79tcr4FHCimOp56lwC01xnt/WPJZc4v3gzyT7FoBkCM= -cloud.google.com/go/speech v1.7.0/go.mod h1:KptqL+BAQIhMsj1kOP2la5DSEEerPDuOP/2mmkhHhZQ= -cloud.google.com/go/speech v1.8.0/go.mod h1:9bYIl1/tjsAnMgKGHKmBZzXKEkGgtU+MpdDPTE9f7y0= -cloud.google.com/go/speech v1.9.0/go.mod h1:xQ0jTcmnRFFM2RfX/U+rk6FQNUF6DQlydUSyoooSpco= -cloud.google.com/go/speech v1.14.1/go.mod h1:gEosVRPJ9waG7zqqnsHpYTOoAS4KouMRLDFMekpJ0J0= -cloud.google.com/go/speech v1.15.0/go.mod h1:y6oH7GhqCaZANH7+Oe0BhgIogsNInLlz542tg3VqeYI= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= -cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= -cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= -cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= -cloud.google.com/go/storage v1.28.1/go.mod h1:Qnisd4CqDdo6BGs2AD5LLnEsmSQ80wQ5ogcBBKhU86Y= -cloud.google.com/go/storage v1.29.0/go.mod h1:4puEjyTKnku6gfKoTfNOU/W+a9JyuVNxjpS5GBrB8h4= -cloud.google.com/go/storagetransfer v1.5.0/go.mod h1:dxNzUopWy7RQevYFHewchb29POFv3/AaBgnhqzqiK0w= -cloud.google.com/go/storagetransfer v1.6.0/go.mod h1:y77xm4CQV/ZhFZH75PLEXY0ROiS7Gh6pSKrM8dJyg6I= -cloud.google.com/go/storagetransfer v1.7.0/go.mod h1:8Giuj1QNb1kfLAiWM1bN6dHzfdlDAVC9rv9abHot2W4= -cloud.google.com/go/storagetransfer v1.8.0/go.mod h1:JpegsHHU1eXg7lMHkvf+KE5XDJ7EQu0GwNJbbVGanEw= -cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= -cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= -cloud.google.com/go/talent v1.3.0/go.mod h1:CmcxwJ/PKfRgd1pBjQgU6W3YBwiewmUzQYH5HHmSCmM= -cloud.google.com/go/talent v1.4.0/go.mod h1:ezFtAgVuRf8jRsvyE6EwmbTK5LKciD4KVnHuDEFmOOA= -cloud.google.com/go/talent v1.5.0/go.mod h1:G+ODMj9bsasAEJkQSzO2uHQWXHHXUomArjWQQYkqK6c= -cloud.google.com/go/texttospeech v1.4.0/go.mod h1:FX8HQHA6sEpJ7rCMSfXuzBcysDAuWusNNNvN9FELDd8= -cloud.google.com/go/texttospeech v1.5.0/go.mod h1:oKPLhR4n4ZdQqWKURdwxMy0uiTS1xU161C8W57Wkea4= -cloud.google.com/go/texttospeech v1.6.0/go.mod h1:YmwmFT8pj1aBblQOI3TfKmwibnsfvhIBzPXcW4EBovc= -cloud.google.com/go/tpu v1.3.0/go.mod h1:aJIManG0o20tfDQlRIej44FcwGGl/cD0oiRyMKG19IQ= -cloud.google.com/go/tpu v1.4.0/go.mod h1:mjZaX8p0VBgllCzF6wcU2ovUXN9TONFLd7iz227X2Xg= -cloud.google.com/go/tpu v1.5.0/go.mod h1:8zVo1rYDFuW2l4yZVY0R0fb/v44xLh3llq7RuV61fPM= -cloud.google.com/go/trace v1.3.0/go.mod h1:FFUE83d9Ca57C+K8rDl/Ih8LwOzWIV1krKgxg6N0G28= -cloud.google.com/go/trace v1.4.0/go.mod h1:UG0v8UBqzusp+z63o7FK74SdFE+AXpCLdFb1rshXG+Y= -cloud.google.com/go/trace v1.8.0/go.mod h1:zH7vcsbAhklH8hWFig58HvxcxyQbaIqMarMg9hn5ECA= -cloud.google.com/go/trace v1.9.0/go.mod h1:lOQqpE5IaWY0Ixg7/r2SjixMuc6lfTFeO4QGM4dQWOk= -cloud.google.com/go/translate v1.3.0/go.mod h1:gzMUwRjvOqj5i69y/LYLd8RrNQk+hOmIXTi9+nb3Djs= -cloud.google.com/go/translate v1.4.0/go.mod h1:06Dn/ppvLD6WvA5Rhdp029IX2Mi3Mn7fpMRLPvXT5Wg= -cloud.google.com/go/translate v1.5.0/go.mod h1:29YDSYveqqpA1CQFD7NQuP49xymq17RXNaUDdc0mNu0= -cloud.google.com/go/translate v1.6.0/go.mod h1:lMGRudH1pu7I3n3PETiOB2507gf3HnfLV8qlkHZEyos= -cloud.google.com/go/translate v1.7.0/go.mod h1:lMGRudH1pu7I3n3PETiOB2507gf3HnfLV8qlkHZEyos= -cloud.google.com/go/video v1.8.0/go.mod h1:sTzKFc0bUSByE8Yoh8X0mn8bMymItVGPfTuUBUyRgxk= -cloud.google.com/go/video v1.9.0/go.mod h1:0RhNKFRF5v92f8dQt0yhaHrEuH95m068JYOvLZYnJSw= -cloud.google.com/go/video v1.12.0/go.mod h1:MLQew95eTuaNDEGriQdcYn0dTwf9oWiA4uYebxM5kdg= -cloud.google.com/go/video v1.13.0/go.mod h1:ulzkYlYgCp15N2AokzKjy7MQ9ejuynOJdf1tR5lGthk= -cloud.google.com/go/video v1.14.0/go.mod h1:SkgaXwT+lIIAKqWAJfktHT/RbgjSuY6DobxEp0C5yTQ= -cloud.google.com/go/video v1.15.0/go.mod h1:SkgaXwT+lIIAKqWAJfktHT/RbgjSuY6DobxEp0C5yTQ= -cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= -cloud.google.com/go/videointelligence v1.7.0/go.mod h1:k8pI/1wAhjznARtVT9U1llUaFNPh7muw8QyOUpavru4= -cloud.google.com/go/videointelligence v1.8.0/go.mod h1:dIcCn4gVDdS7yte/w+koiXn5dWVplOZkE+xwG9FgK+M= -cloud.google.com/go/videointelligence v1.9.0/go.mod h1:29lVRMPDYHikk3v8EdPSaL8Ku+eMzDljjuvRs105XoU= -cloud.google.com/go/videointelligence v1.10.0/go.mod h1:LHZngX1liVtUhZvi2uNS0VQuOzNi2TkY1OakiuoUOjU= -cloud.google.com/go/vision v1.2.0/go.mod h1:SmNwgObm5DpFBme2xpyOyasvBc1aPdjvMk2bBk0tKD0= -cloud.google.com/go/vision/v2 v2.2.0/go.mod h1:uCdV4PpN1S0jyCyq8sIM42v2Y6zOLkZs+4R9LrGYwFo= -cloud.google.com/go/vision/v2 v2.3.0/go.mod h1:UO61abBx9QRMFkNBbf1D8B1LXdS2cGiiCRx0vSpZoUo= -cloud.google.com/go/vision/v2 v2.4.0/go.mod h1:VtI579ll9RpVTrdKdkMzckdnwMyX2JILb+MhPqRbPsY= -cloud.google.com/go/vision/v2 v2.5.0/go.mod h1:MmaezXOOE+IWa+cS7OhRRLK2cNv1ZL98zhqFFZaaH2E= -cloud.google.com/go/vision/v2 v2.6.0/go.mod h1:158Hes0MvOS9Z/bDMSFpjwsUrZ5fPrdwuyyvKSGAGMY= -cloud.google.com/go/vision/v2 v2.7.0/go.mod h1:H89VysHy21avemp6xcf9b9JvZHVehWbET0uT/bcuY/0= -cloud.google.com/go/vmmigration v1.2.0/go.mod h1:IRf0o7myyWFSmVR1ItrBSFLFD/rJkfDCUTO4vLlJvsE= -cloud.google.com/go/vmmigration v1.3.0/go.mod h1:oGJ6ZgGPQOFdjHuocGcLqX4lc98YQ7Ygq8YQwHh9A7g= -cloud.google.com/go/vmmigration v1.5.0/go.mod h1:E4YQ8q7/4W9gobHjQg4JJSgXXSgY21nA5r8swQV+Xxc= -cloud.google.com/go/vmmigration v1.6.0/go.mod h1:bopQ/g4z+8qXzichC7GW1w2MjbErL54rk3/C843CjfY= -cloud.google.com/go/vmwareengine v0.1.0/go.mod h1:RsdNEf/8UDvKllXhMz5J40XxDrNJNN4sagiox+OI208= -cloud.google.com/go/vmwareengine v0.2.2/go.mod h1:sKdctNJxb3KLZkE/6Oui94iw/xs9PRNC2wnNLXsHvH8= -cloud.google.com/go/vmwareengine v0.3.0/go.mod h1:wvoyMvNWdIzxMYSpH/R7y2h5h3WFkx6d+1TIsP39WGY= -cloud.google.com/go/vpcaccess v1.4.0/go.mod h1:aQHVbTWDYUR1EbTApSVvMq1EnT57ppDmQzZ3imqIk4w= -cloud.google.com/go/vpcaccess v1.5.0/go.mod h1:drmg4HLk9NkZpGfCmZ3Tz0Bwnm2+DKqViEpeEpOq0m8= -cloud.google.com/go/vpcaccess v1.6.0/go.mod h1:wX2ILaNhe7TlVa4vC5xce1bCnqE3AeH27RV31lnmZes= -cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xXZmFiHmGE= -cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= -cloud.google.com/go/webrisk v1.6.0/go.mod h1:65sW9V9rOosnc9ZY7A7jsy1zoHS5W9IAXv6dGqhMQMc= -cloud.google.com/go/webrisk v1.7.0/go.mod h1:mVMHgEYH0r337nmt1JyLthzMr6YxwN1aAIEc2fTcq7A= -cloud.google.com/go/webrisk v1.8.0/go.mod h1:oJPDuamzHXgUc+b8SiHRcVInZQuybnvEW72PqTc7sSg= -cloud.google.com/go/websecurityscanner v1.3.0/go.mod h1:uImdKm2wyeXQevQJXeh8Uun/Ym1VqworNDlBXQevGMo= -cloud.google.com/go/websecurityscanner v1.4.0/go.mod h1:ebit/Fp0a+FWu5j4JOmJEV8S8CzdTkAS77oDsiSqYWQ= -cloud.google.com/go/websecurityscanner v1.5.0/go.mod h1:Y6xdCPy81yi0SQnDY1xdNTNpfY1oAgXUlcfN3B3eSng= -cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= -cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= -cloud.google.com/go/workflows v1.8.0/go.mod h1:ysGhmEajwZxGn1OhGOGKsTXc5PyxOc0vfKf5Af+to4M= -cloud.google.com/go/workflows v1.9.0/go.mod h1:ZGkj1aFIOd9c8Gerkjjq7OW7I5+l6cSvT3ujaO/WwSA= -cloud.google.com/go/workflows v1.10.0/go.mod h1:fZ8LmRmZQWacon9UCX1r/g/DfAXx5VcPALq2CxzdePw= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8= -git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= -github.com/ajstarks/deck v0.0.0-20200831202436-30c9fc6549a9/go.mod h1:JynElWSGnm/4RlzPXRlREEwqTHAN3T56Bv2ITsFT3gY= -github.com/ajstarks/deck/generate v0.0.0-20210309230005-c3f852c02e19/go.mod h1:T13YZdzov6OU0A1+RfKZiZN9ca6VeKdBdyDV+BY97Tk= -github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= -github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM= -github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/apache/arrow/go/v10 v10.0.1/go.mod h1:YvhnlEePVnBS4+0z3fhPfUy7W1Ikj0Ih0vcRo/gZ1M0= -github.com/apache/arrow/go/v11 v11.0.0/go.mod h1:Eg5OsL5H+e299f7u5ssuXsuHQVEGC4xei5aX110hRiI= -github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU= -github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= -github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20230310173818-32f1caf87195/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= -github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= -github.com/envoyproxy/go-control-plane v0.10.3/go.mod h1:fJJn/j26vwOu972OllsvAgJJM//w9BV6Fxbg2LuVd34= -github.com/envoyproxy/go-control-plane v0.11.0/go.mod h1:VnHyVMpzcLvCFt9yUz1UnCwHLhwx1WguiVDV7pTG/tI= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo= -github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0++PMirau2/yoOwVac3AbF2w= -github.com/envoyproxy/protoc-gen-validate v0.10.0/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss= -github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= -github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g= -github.com/go-fonts/latin-modern v0.2.0/go.mod h1:rQVLdDMK+mK1xscDwsqM5J8U2jrRa3T0ecnM9pNujks= -github.com/go-fonts/liberation v0.1.1/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= -github.com/go-fonts/liberation v0.2.0/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= -github.com/go-fonts/stix v0.1.0/go.mod h1:w/c1f0ldAUlJmLBvlbkvVXLAD+tAMqobIIQpmnUIzUY= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2CSIqUrmQPqA0gdRIlnLEY0gK5JGjh37zN5U= -github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81/go.mod h1:SX0U8uGpxhq9o2S/CELCSUxEWWAuoCUcVCQWv7G2OCk= -github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= -github.com/go-pdf/fpdf v0.6.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= -github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= -github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= -github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/s2a-go v0.1.0/go.mod h1:OJpEgntRZo8ugHpF9hkoLJbS5dSI20XZeXJ9JVywLlM= -github.com/google/s2a-go v0.1.3/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= -github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= -github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= -github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= -github.com/googleapis/enterprise-certificate-proxy v0.2.1/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= -github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= -github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= -github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= -github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= -github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= -github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= -github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= -github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57QpBWsYpwqHJx8= -github.com/googleapis/gax-go/v2 v2.7.1/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= -github.com/googleapis/gax-go/v2 v2.8.0/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= -github.com/googleapis/gax-go/v2 v2.10.0/go.mod h1:4UOEnMCrxsSqQ940WnTiD6qJ63le2ev3xfyagutxiPw= -github.com/googleapis/gax-go/v2 v2.11.0/go.mod h1:DxmR61SGKkGLa2xigwuZIQpkCI2S5iydzRfb3peWZJI= -github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= -github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= -github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= -github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= -github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= -github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= -github.com/lyft/protoc-gen-star v0.6.1/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= -github.com/lyft/protoc-gen-star/v2 v2.0.1/go.mod h1:RcCdONR2ScXaYnQC5tUzxzlpA3WVYF7/opLeUgcQs/o= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-sqlite3 v1.14.14/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY= -github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE= -github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2dXMnm1mY= -github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= -github.com/phpdave11/gofpdi v1.0.13/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= -github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= -github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= -github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= -github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= -github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= -github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= -github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= -go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= -golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= -golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3/go.mod h1:NOZ3BPKG0ec/BKJQgnvsSFpcKLM5xXVWnvZS97DWHgE= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20220827204233-334a2380cb91/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= -golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20210216034530-4410531fe030/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= -golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= -golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= -golang.org/x/image v0.0.0-20220302094943-723b81ca9867/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.0.0-20221012135044-0b7e1fb9d458/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= -golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= -golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= -golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= -golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= -golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= -golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= -golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec= -golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I= -golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= -golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= -golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= golang.org/x/oauth2 v0.11.0 h1:vPL4xzxBM4niKCW6g9whtaWVXTJf1U5e4aZxxFx/gbU= golang.org/x/oauth2 v0.11.0/go.mod h1:LdF7O/8bLR/qWK9DrpXmbHLTouvRHK0SgJl0GmDBchk= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= -golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20220922220347-f3bd1da661af/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= -gonum.org/v1/gonum v0.9.3/go.mod h1:TZumC3NeyVQskjXqmyWt4S3bINhy7B4eYwW69EbyX+0= -gonum.org/v1/gonum v0.11.0/go.mod h1:fSG4YDCxxUZQJ7rKsQrj0gMOg00Il0Z96/qMA4bVQhA= -gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= -gonum.org/v1/plot v0.9.0/go.mod h1:3Pcqqmp6RHvJI72kgb8fThyUnav364FOsdDo2aGW5lY= -gonum.org/v1/plot v0.10.1/go.mod h1:VZW5OlhkL1mysU9vaqNHnsy86inf6Ot+jB3r+BczCEo= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= -google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= -google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= -google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= -google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= -google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= -google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= -google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= -google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= -google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= -google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= -google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= -google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= -google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= -google.golang.org/api v0.77.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= -google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= -google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= -google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= -google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g= -google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= -google.golang.org/api v0.93.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= -google.golang.org/api v0.95.0/go.mod h1:eADj+UBuxkh5zlrSntJghuNeg8HwQ1w5lTKkuqaETEI= -google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= -google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= -google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= -google.golang.org/api v0.99.0/go.mod h1:1YOf74vkVndF7pG6hIHuINsM7eWwpVTAfNMNiL91A08= -google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= -google.golang.org/api v0.102.0/go.mod h1:3VFl6/fzoA+qNuS1N1/VfXY4LjoXN/wzeIp7TweWwGo= -google.golang.org/api v0.103.0/go.mod h1:hGtW6nK1AC+d9si/UBhw8Xli+QMOf6xyNAyJw4qU9w0= -google.golang.org/api v0.106.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= -google.golang.org/api v0.107.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= -google.golang.org/api v0.108.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= -google.golang.org/api v0.110.0/go.mod h1:7FC4Vvx1Mooxh8C5HWjzZHcavuS2f6pmJpZx60ca7iI= -google.golang.org/api v0.111.0/go.mod h1:qtFHvU9mhgTJegR31csQ+rwxyUTHOKFqCKWp1J0fdw0= -google.golang.org/api v0.114.0/go.mod h1:ifYI2ZsFK6/uGddGfAD5BMxlnkBqCmqHSDUVi45N5Yg= -google.golang.org/api v0.118.0/go.mod h1:76TtD3vkgmZ66zZzp72bUUklpmQmKlhh6sYtIjYK+5E= -google.golang.org/api v0.122.0/go.mod h1:gcitW0lvnyWjSp9nKxAbdHKIZ6vF4aajGueeslZOyms= -google.golang.org/api v0.124.0/go.mod h1:xu2HQurE5gi/3t1aFCvhPD781p0a3p11sdunTJ2BlP4= -google.golang.org/api v0.126.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= -google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20220329172620-7be39ac1afc7/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220628213854-d9e0b6570c03/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220722212130-b98a9ff5e252/go.mod h1:GkXuJDJ6aQ7lnJcRF+SJVgFdQhypqgl3LB1C9vabdRE= -google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= -google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220817144833-d7fd3f11b9b1/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220829144015-23454907ede3/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220829175752-36a9c930ecbf/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220913154956-18f8339a66a5/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220914142337-ca0e39ece12f/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220916172020-2692e8806bfa/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220919141832-68c03719ef51/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220920201722-2b89144ce006/go.mod h1:ht8XFiar2npT/g4vkk7O0WYS1sHOHbdujxbEp7CJWbw= -google.golang.org/genproto v0.0.0-20220926165614-551eb538f295/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI= -google.golang.org/genproto v0.0.0-20220926220553-6981cbe3cfce/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI= -google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqwhZAwq4wsRUaVG555sVgsNmIjRtO7t/JH29U= -google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= -google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= -google.golang.org/genproto v0.0.0-20221024153911-1573dae28c9c/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c/go.mod h1:CGI5F/G+E5bKwmfYo09AXuVN4dD894kIKUFmVbP2/Fo= -google.golang.org/genproto v0.0.0-20221109142239-94d6d90a7d66/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= -google.golang.org/genproto v0.0.0-20221114212237-e4508ebdbee1/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= -google.golang.org/genproto v0.0.0-20221117204609-8f9c96812029/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= -google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= -google.golang.org/genproto v0.0.0-20221201164419-0e50fba7f41c/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= -google.golang.org/genproto v0.0.0-20221201204527-e3fa12d562f3/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= -google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd/go.mod h1:cTsE614GARnxrLsqKREzmNYJACSWWpAWdNMwnD7c2BE= -google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/genproto v0.0.0-20230112194545-e10362b5ecf9/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/genproto v0.0.0-20230113154510-dbe35b8444a5/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/genproto v0.0.0-20230123190316-2c411cf9d197/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/genproto v0.0.0-20230124163310-31e0e69b6fc2/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/genproto v0.0.0-20230125152338-dcaf20b6aeaa/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/genproto v0.0.0-20230127162408-596548ed4efa/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/genproto v0.0.0-20230209215440-0dfe4f8abfcc/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/genproto v0.0.0-20230216225411-c8e22ba71e44/go.mod h1:8B0gmkoRebU8ukX6HP+4wrVQUY1+6PkQ44BSyIlflHA= -google.golang.org/genproto v0.0.0-20230222225845-10f96fb3dbec/go.mod h1:3Dl5ZL0q0isWJt+FVcfpQyirqemEuLAK/iFvg1UP1Hw= -google.golang.org/genproto v0.0.0-20230223222841-637eb2293923/go.mod h1:3Dl5ZL0q0isWJt+FVcfpQyirqemEuLAK/iFvg1UP1Hw= -google.golang.org/genproto v0.0.0-20230303212802-e74f57abe488/go.mod h1:TvhZT5f700eVlTNwND1xoEZQeWTB2RY/65kplwl/bFA= -google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= -google.golang.org/genproto v0.0.0-20230320184635-7606e756e683/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= -google.golang.org/genproto v0.0.0-20230323212658-478b75c54725/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= -google.golang.org/genproto v0.0.0-20230330154414-c0448cd141ea/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= -google.golang.org/genproto v0.0.0-20230331144136-dcfb400f0633/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= -google.golang.org/genproto v0.0.0-20230403163135-c38d8f061ccd/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= -google.golang.org/genproto v0.0.0-20230525234025-438c736192d0/go.mod h1:9ExIQyXL5hZrHzQceCwuSYwZZ5QZBazOcprJ5rgs3lY= -google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a/go.mod h1:ts19tUU+Z0ZShN1y3aPyq2+O3d5FUNNgT6FtOzmrNn8= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= -google.golang.org/genproto/googleapis/api v0.0.0-20230526203410-71b5a4ffd15e/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= -google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= -google.golang.org/genproto/googleapis/bytestream v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:ylj+BE99M198VPbBh6A8d9n3w8fChvyLK3wwBOjXBFA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234015-3fc162c6f38a/go.mod h1:xURIpW9ES5+/GZhnV6beoEtxQrnkRGIfP5VQG2tCBLc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230526203410-71b5a4ffd15e/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= -google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= -google.golang.org/grpc v1.52.0/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= -google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= -google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= -google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= -lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= -lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= -modernc.org/cc/v3 v3.36.0/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= -modernc.org/cc/v3 v3.36.2/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= -modernc.org/cc/v3 v3.36.3/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= -modernc.org/ccgo/v3 v3.0.0-20220428102840-41399a37e894/go.mod h1:eI31LL8EwEBKPpNpA4bU1/i+sKOwOrQy8D87zWUcRZc= -modernc.org/ccgo/v3 v3.0.0-20220430103911-bc99d88307be/go.mod h1:bwdAnOoaIt8Ax9YdWGjxWsdkPcZyRPHqrOvJxaKAKGw= -modernc.org/ccgo/v3 v3.16.4/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ= -modernc.org/ccgo/v3 v3.16.6/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ= -modernc.org/ccgo/v3 v3.16.8/go.mod h1:zNjwkizS+fIFDrDjIAgBSCLkWbJuHF+ar3QRn+Z9aws= -modernc.org/ccgo/v3 v3.16.9/go.mod h1:zNMzC9A9xeNUepy6KuZBbugn3c0Mc9TeiJO4lgvkJDo= -modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= -modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= -modernc.org/libc v0.0.0-20220428101251-2d5f3daf273b/go.mod h1:p7Mg4+koNjc8jkqwcoFBJx7tXkpj00G77X7A72jXPXA= -modernc.org/libc v1.16.0/go.mod h1:N4LD6DBE9cf+Dzf9buBlzVJndKr/iJHG97vGLHYnb5A= -modernc.org/libc v1.16.1/go.mod h1:JjJE0eu4yeK7tab2n4S1w8tlWd9MxXLRzheaRnAKymU= -modernc.org/libc v1.16.17/go.mod h1:hYIV5VZczAmGZAnG15Vdngn5HSF5cSkbvfz2B7GRuVU= -modernc.org/libc v1.16.19/go.mod h1:p7Mg4+koNjc8jkqwcoFBJx7tXkpj00G77X7A72jXPXA= -modernc.org/libc v1.17.0/go.mod h1:XsgLldpP4aWlPlsjqKRdHPqCxCjISdHfM/yeWC5GyW0= -modernc.org/libc v1.17.1/go.mod h1:FZ23b+8LjxZs7XtFMbSzL/EhPxNbfZbErxEHc7cbD9s= -modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/mathutil v1.4.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/memory v1.1.1/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= -modernc.org/memory v1.2.0/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= -modernc.org/memory v1.2.1/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= -modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= -modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= -modernc.org/sqlite v1.18.1/go.mod h1:6ho+Gow7oX5V+OiOQ6Tr4xeqbx13UZ6t+Fw9IRUG4d4= -modernc.org/strutil v1.1.1/go.mod h1:DE+MQQ/hjKBZS2zNInV5hhcipt5rLPWkmpbGeW5mmdw= -modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= -modernc.org/tcl v1.13.1/go.mod h1:XOLfOwzhkljL4itZkK6T72ckMgvj0BDsnKNdZVUOecw= -modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= -modernc.org/z v1.5.1/go.mod h1:eWFB510QWW5Th9YGZT81s+LwvaAs3Q2yr4sP0rmLkv8= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= From 1a4b1067cc92757d8d26d22568fc1dcf05551285 Mon Sep 17 00:00:00 2001 From: Evan Anderson Date: Wed, 16 Aug 2023 10:03:10 -0700 Subject: [PATCH 289/751] Add WebhookTypes and EventForType methods (#2865) Fixes: #2863. --- github/event.go | 141 ++----------------------- github/event_test.go | 12 +++ github/messages.go | 171 +++++++++++++++++++------------ github/messages_test.go | 17 +++ github/repos_hooks_deliveries.go | 4 +- 5 files changed, 145 insertions(+), 200 deletions(-) diff --git a/github/event.go b/github/event.go index 7ec46b5a289..e98606bce5d 100644 --- a/github/event.go +++ b/github/event.go @@ -27,139 +27,16 @@ func (e Event) String() string { // ParsePayload parses the event payload. For recognized event types, // a value of the corresponding struct type will be returned. -func (e *Event) ParsePayload() (payload interface{}, err error) { - switch *e.Type { - case "BranchProtectionRuleEvent": - payload = &BranchProtectionRuleEvent{} - case "CheckRunEvent": - payload = &CheckRunEvent{} - case "CheckSuiteEvent": - payload = &CheckSuiteEvent{} - case "CodeScanningAlertEvent": - payload = &CodeScanningAlertEvent{} - case "CommitCommentEvent": - payload = &CommitCommentEvent{} - case "ContentReferenceEvent": - payload = &ContentReferenceEvent{} - case "CreateEvent": - payload = &CreateEvent{} - case "DeleteEvent": - payload = &DeleteEvent{} - case "DeployKeyEvent": - payload = &DeployKeyEvent{} - case "DeploymentEvent": - payload = &DeploymentEvent{} - case "DeploymentProtectionRuleEvent": - payload = &DeploymentProtectionRuleEvent{} - case "DeploymentStatusEvent": - payload = &DeploymentStatusEvent{} - case "DiscussionEvent": - payload = &DiscussionEvent{} - case "DiscussionCommentEvent": - payload = &DiscussionCommentEvent{} - case "ForkEvent": - payload = &ForkEvent{} - case "GitHubAppAuthorizationEvent": - payload = &GitHubAppAuthorizationEvent{} - case "GollumEvent": - payload = &GollumEvent{} - case "InstallationEvent": - payload = &InstallationEvent{} - case "InstallationRepositoriesEvent": - payload = &InstallationRepositoriesEvent{} - case "InstallationTargetEvent": - payload = &InstallationTargetEvent{} - case "IssueCommentEvent": - payload = &IssueCommentEvent{} - case "IssuesEvent": - payload = &IssuesEvent{} - case "LabelEvent": - payload = &LabelEvent{} - case "MarketplacePurchaseEvent": - payload = &MarketplacePurchaseEvent{} - case "MemberEvent": - payload = &MemberEvent{} - case "MembershipEvent": - payload = &MembershipEvent{} - case "MergeGroupEvent": - payload = &MergeGroupEvent{} - case "MetaEvent": - payload = &MetaEvent{} - case "MilestoneEvent": - payload = &MilestoneEvent{} - case "OrganizationEvent": - payload = &OrganizationEvent{} - case "OrgBlockEvent": - payload = &OrgBlockEvent{} - case "PackageEvent": - payload = &PackageEvent{} - case "PageBuildEvent": - payload = &PageBuildEvent{} - case "PersonalAccessTokenRequestEvent": - payload = &PersonalAccessTokenRequestEvent{} - case "PingEvent": - payload = &PingEvent{} - case "ProjectEvent": - payload = &ProjectEvent{} - case "ProjectCardEvent": - payload = &ProjectCardEvent{} - case "ProjectColumnEvent": - payload = &ProjectColumnEvent{} - case "ProjectV2Event": - payload = &ProjectV2Event{} - case "ProjectV2ItemEvent": - payload = &ProjectV2ItemEvent{} - case "PublicEvent": - payload = &PublicEvent{} - case "PullRequestEvent": - payload = &PullRequestEvent{} - case "PullRequestReviewEvent": - payload = &PullRequestReviewEvent{} - case "PullRequestReviewCommentEvent": - payload = &PullRequestReviewCommentEvent{} - case "PullRequestReviewThreadEvent": - payload = &PullRequestReviewThreadEvent{} - case "PullRequestTargetEvent": - payload = &PullRequestTargetEvent{} - case "PushEvent": - payload = &PushEvent{} - case "ReleaseEvent": - payload = &ReleaseEvent{} - case "RepositoryEvent": - payload = &RepositoryEvent{} - case "RepositoryDispatchEvent": - payload = &RepositoryDispatchEvent{} - case "RepositoryImportEvent": - payload = &RepositoryImportEvent{} - case "RepositoryVulnerabilityAlertEvent": - payload = &RepositoryVulnerabilityAlertEvent{} - case "SecretScanningAlertEvent": - payload = &SecretScanningAlertEvent{} - case "SecurityAdvisoryEvent": - payload = &SecurityAdvisoryEvent{} - case "SecurityAndAnalysisEvent": - payload = &SecurityAndAnalysisEvent{} - case "StarEvent": - payload = &StarEvent{} - case "StatusEvent": - payload = &StatusEvent{} - case "TeamEvent": - payload = &TeamEvent{} - case "TeamAddEvent": - payload = &TeamAddEvent{} - case "UserEvent": - payload = &UserEvent{} - case "WatchEvent": - payload = &WatchEvent{} - case "WorkflowDispatchEvent": - payload = &WorkflowDispatchEvent{} - case "WorkflowJobEvent": - payload = &WorkflowJobEvent{} - case "WorkflowRunEvent": - payload = &WorkflowRunEvent{} +func (e *Event) ParsePayload() (interface{}, error) { + // It would be nice if e.Type were the snake_case name of the event, + // but the existing interface uses the struct name instead. + payload := EventForType(typeToMessageMapping[e.GetType()]) + + if err := json.Unmarshal(e.GetRawPayload(), &payload); err != nil { + return nil, err } - err = json.Unmarshal(*e.RawPayload, &payload) - return payload, err + + return payload, nil } // Payload returns the parsed event payload. For recognized event types, diff --git a/github/event_test.go b/github/event_test.go index 6d20582c2f7..66a6bcd7e45 100644 --- a/github/event_test.go +++ b/github/event_test.go @@ -30,6 +30,18 @@ func TestPayload_NoPanic(t *testing.T) { e.Payload() } +func TestEmptyEvent_NoPanic(t *testing.T) { + e := &Event{} + if _, err := e.ParsePayload(); err == nil { + t.Error("ParsePayload unexpectedly succeeded on empty event") + } + + e = nil + if _, err := e.ParsePayload(); err == nil { + t.Error("ParsePayload unexpectedly succeeded on nil event") + } +} + func TestEvent_Marshal(t *testing.T) { testJSONMarshal(t, &Event{}, "{}") diff --git a/github/messages.go b/github/messages.go index e15442e5f19..e4fa6f6aa01 100644 --- a/github/messages.go +++ b/github/messages.go @@ -22,6 +22,8 @@ import ( "mime" "net/http" "net/url" + "reflect" + "sort" "strings" ) @@ -43,74 +45,86 @@ const ( var ( // eventTypeMapping maps webhooks types to their corresponding go-github struct types. - eventTypeMapping = map[string]string{ - "branch_protection_rule": "BranchProtectionRuleEvent", - "check_run": "CheckRunEvent", - "check_suite": "CheckSuiteEvent", - "code_scanning_alert": "CodeScanningAlertEvent", - "commit_comment": "CommitCommentEvent", - "content_reference": "ContentReferenceEvent", - "create": "CreateEvent", - "delete": "DeleteEvent", - "deploy_key": "DeployKeyEvent", - "deployment": "DeploymentEvent", - "deployment_status": "DeploymentStatusEvent", - "deployment_protection_rule": "DeploymentProtectionRuleEvent", - "discussion": "DiscussionEvent", - "discussion_comment": "DiscussionCommentEvent", - "fork": "ForkEvent", - "github_app_authorization": "GitHubAppAuthorizationEvent", - "gollum": "GollumEvent", - "installation": "InstallationEvent", - "installation_repositories": "InstallationRepositoriesEvent", - "installation_target": "InstallationTargetEvent", - "issue_comment": "IssueCommentEvent", - "issues": "IssuesEvent", - "label": "LabelEvent", - "marketplace_purchase": "MarketplacePurchaseEvent", - "member": "MemberEvent", - "membership": "MembershipEvent", - "merge_group": "MergeGroupEvent", - "meta": "MetaEvent", - "milestone": "MilestoneEvent", - "organization": "OrganizationEvent", - "org_block": "OrgBlockEvent", - "package": "PackageEvent", - "page_build": "PageBuildEvent", - "personal_access_token_request": "PersonalAccessTokenRequestEvent", - "ping": "PingEvent", - "project": "ProjectEvent", - "project_card": "ProjectCardEvent", - "project_column": "ProjectColumnEvent", - "projects_v2": "ProjectV2Event", - "projects_v2_item": "ProjectV2ItemEvent", - "public": "PublicEvent", - "pull_request": "PullRequestEvent", - "pull_request_review": "PullRequestReviewEvent", - "pull_request_review_comment": "PullRequestReviewCommentEvent", - "pull_request_review_thread": "PullRequestReviewThreadEvent", - "pull_request_target": "PullRequestTargetEvent", - "push": "PushEvent", - "repository": "RepositoryEvent", - "repository_dispatch": "RepositoryDispatchEvent", - "repository_import": "RepositoryImportEvent", - "repository_vulnerability_alert": "RepositoryVulnerabilityAlertEvent", - "release": "ReleaseEvent", - "secret_scanning_alert": "SecretScanningAlertEvent", - "security_advisory": "SecurityAdvisoryEvent", - "security_and_analysis": "SecurityAndAnalysisEvent", - "star": "StarEvent", - "status": "StatusEvent", - "team": "TeamEvent", - "team_add": "TeamAddEvent", - "user": "UserEvent", - "watch": "WatchEvent", - "workflow_dispatch": "WorkflowDispatchEvent", - "workflow_job": "WorkflowJobEvent", - "workflow_run": "WorkflowRunEvent", + eventTypeMapping = map[string]interface{}{ + "branch_protection_rule": &BranchProtectionRuleEvent{}, + "check_run": &CheckRunEvent{}, + "check_suite": &CheckSuiteEvent{}, + "code_scanning_alert": &CodeScanningAlertEvent{}, + "commit_comment": &CommitCommentEvent{}, + "content_reference": &ContentReferenceEvent{}, + "create": &CreateEvent{}, + "delete": &DeleteEvent{}, + "deploy_key": &DeployKeyEvent{}, + "deployment": &DeploymentEvent{}, + "deployment_status": &DeploymentStatusEvent{}, + "deployment_protection_rule": &DeploymentProtectionRuleEvent{}, + "discussion": &DiscussionEvent{}, + "discussion_comment": &DiscussionCommentEvent{}, + "fork": &ForkEvent{}, + "github_app_authorization": &GitHubAppAuthorizationEvent{}, + "gollum": &GollumEvent{}, + "installation": &InstallationEvent{}, + "installation_repositories": &InstallationRepositoriesEvent{}, + "installation_target": &InstallationTargetEvent{}, + "issue_comment": &IssueCommentEvent{}, + "issues": &IssuesEvent{}, + "label": &LabelEvent{}, + "marketplace_purchase": &MarketplacePurchaseEvent{}, + "member": &MemberEvent{}, + "membership": &MembershipEvent{}, + "merge_group": &MergeGroupEvent{}, + "meta": &MetaEvent{}, + "milestone": &MilestoneEvent{}, + "organization": &OrganizationEvent{}, + "org_block": &OrgBlockEvent{}, + "package": &PackageEvent{}, + "page_build": &PageBuildEvent{}, + "personal_access_token_request": &PersonalAccessTokenRequestEvent{}, + "ping": &PingEvent{}, + "project": &ProjectEvent{}, + "project_card": &ProjectCardEvent{}, + "project_column": &ProjectColumnEvent{}, + "projects_v2": &ProjectV2Event{}, + "projects_v2_item": &ProjectV2ItemEvent{}, + "public": &PublicEvent{}, + "pull_request": &PullRequestEvent{}, + "pull_request_review": &PullRequestReviewEvent{}, + "pull_request_review_comment": &PullRequestReviewCommentEvent{}, + "pull_request_review_thread": &PullRequestReviewThreadEvent{}, + "pull_request_target": &PullRequestTargetEvent{}, + "push": &PushEvent{}, + "repository": &RepositoryEvent{}, + "repository_dispatch": &RepositoryDispatchEvent{}, + "repository_import": &RepositoryImportEvent{}, + "repository_vulnerability_alert": &RepositoryVulnerabilityAlertEvent{}, + "release": &ReleaseEvent{}, + "secret_scanning_alert": &SecretScanningAlertEvent{}, + "security_advisory": &SecurityAdvisoryEvent{}, + "security_and_analysis": &SecurityAndAnalysisEvent{}, + "star": &StarEvent{}, + "status": &StatusEvent{}, + "team": &TeamEvent{}, + "team_add": &TeamAddEvent{}, + "user": &UserEvent{}, + "watch": &WatchEvent{}, + "workflow_dispatch": &WorkflowDispatchEvent{}, + "workflow_job": &WorkflowJobEvent{}, + "workflow_run": &WorkflowRunEvent{}, } + // forward mapping of event types to the string names of the structs + messageToTypeName = make(map[string]string, len(eventTypeMapping)) + // Inverse map of the above + typeToMessageMapping = make(map[string]string, len(eventTypeMapping)) ) +func init() { + for k, v := range eventTypeMapping { + typename := reflect.TypeOf(v).Elem().Name() + messageToTypeName[k] = typename + typeToMessageMapping[typename] = k + } +} + // genMAC generates the HMAC signature for a message provided the secret key // and hashFunc. func genMAC(message, key []byte, hashFunc func() hash.Hash) []byte { @@ -299,7 +313,7 @@ func DeliveryID(r *http.Request) string { // } // } func ParseWebHook(messageType string, payload []byte) (interface{}, error) { - eventType, ok := eventTypeMapping[messageType] + eventType, ok := messageToTypeName[messageType] if !ok { return nil, fmt.Errorf("unknown X-Github-Event in message: %v", messageType) } @@ -310,3 +324,28 @@ func ParseWebHook(messageType string, payload []byte) (interface{}, error) { } return event.ParsePayload() } + +// WebhookTypes returns a sorted list of all the known GitHub event type strings +// supported by go-github. +func MessageTypes() []string { + types := make([]string, 0, len(eventTypeMapping)) + for t := range eventTypeMapping { + types = append(types, t) + } + sort.Strings(types) + return types +} + +// EventForType returns an empty struct matching the specified GitHub event type. +// If messageType does not match any known event types, it returns nil. +func EventForType(messageType string) interface{} { + prototype := eventTypeMapping[messageType] + if prototype == nil { + return nil + } + // return a _copy_ of the pointed-to-object. Unfortunately, for this we + // need to use reflection. If we store the actual objects in the map, + // we still need to use reflection to convert from `any` to the actual + // type, so this was deemed the lesser of two evils. (#2865) + return reflect.New(reflect.TypeOf(prototype).Elem()).Interface() +} diff --git a/github/messages_test.go b/github/messages_test.go index 91a25027629..193501f90b1 100644 --- a/github/messages_test.go +++ b/github/messages_test.go @@ -525,6 +525,23 @@ func TestParseWebHook(t *testing.T) { } } +func TestAllMessageTypesMapped(t *testing.T) { + for _, mt := range MessageTypes() { + if obj := EventForType(mt); obj == nil { + t.Errorf("messageMap missing message type %q", mt) + } + } +} + +func TestUnknownMessageType(t *testing.T) { + if obj := EventForType("unknown"); obj != nil { + t.Errorf("EventForType(unknown) = %#v, want nil", obj) + } + if obj := EventForType(""); obj != nil { + t.Errorf(`EventForType("") = %#v, want nil`, obj) + } +} + func TestParseWebHook_BadMessageType(t *testing.T) { if _, err := ParseWebHook("bogus message type", []byte("{}")); err == nil { t.Fatal("ParseWebHook returned nil; wanted error") diff --git a/github/repos_hooks_deliveries.go b/github/repos_hooks_deliveries.go index cbd2d3819a1..5f2f8807e4b 100644 --- a/github/repos_hooks_deliveries.go +++ b/github/repos_hooks_deliveries.go @@ -126,9 +126,9 @@ func (s *RepositoriesService) RedeliverHookDelivery(ctx context.Context, owner, // ParseRequestPayload parses the request payload. For recognized event types, // a value of the corresponding struct type will be returned. func (d *HookDelivery) ParseRequestPayload() (interface{}, error) { - eType, ok := eventTypeMapping[*d.Event] + eType, ok := messageToTypeName[d.GetEvent()] if !ok { - return nil, fmt.Errorf("unsupported event type %q", *d.Event) + return nil, fmt.Errorf("unsupported event type %q", d.GetEvent()) } e := &Event{Type: &eType, RawPayload: d.Request.RawPayload} From 0c562f6a6c3f431426e043f855d8009880d2acf2 Mon Sep 17 00:00:00 2001 From: vandan rohatgi <43648786+vandanrohatgi@users.noreply.github.com> Date: Wed, 16 Aug 2023 22:57:49 +0530 Subject: [PATCH 290/751] Add support for fetching SBOMs (#2869) Fixes: #2864. --- github/dependency_graph.go | 80 ++++++++++++++++++ github/dependency_graph_test.go | 79 ++++++++++++++++++ github/github-accessors.go | 120 ++++++++++++++++++++++++++ github/github-accessors_test.go | 144 ++++++++++++++++++++++++++++++++ github/github-stringify_test.go | 10 +++ github/github.go | 2 + 6 files changed, 435 insertions(+) create mode 100644 github/dependency_graph.go create mode 100644 github/dependency_graph_test.go diff --git a/github/dependency_graph.go b/github/dependency_graph.go new file mode 100644 index 00000000000..e578965cc12 --- /dev/null +++ b/github/dependency_graph.go @@ -0,0 +1,80 @@ +// Copyright 2023 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" +) + +type DependencyGraphService service + +// SBOM represents a software bill of materials, which describes the +// packages/libraries that a repository depends on. +type SBOM struct { + SBOM *SBOMInfo `json:"sbom,omitempty"` +} + +// CreationInfo represents when the SBOM was created and who created it. +type CreationInfo struct { + Created *Timestamp `json:"created,omitempty"` + Creators []string `json:"creators,omitempty"` +} + +// RepoDependencies represents the dependencies of a repo. +type RepoDependencies struct { + SPDXID *string `json:"SPDXID,omitempty"` + // Package name + Name *string `json:"name,omitempty"` + VersionInfo *string `json:"versionInfo,omitempty"` + DownloadLocation *string `json:"downloadLocation,omitempty"` + FilesAnalyzed *bool `json:"filesAnalyzed,omitempty"` + LicenseConcluded *string `json:"licenseConcluded,omitempty"` + LicenseDeclared *string `json:"licenseDeclared,omitempty"` +} + +// SBOMInfo represents a software bill of materials (SBOM) using SPDX. +// SPDX is an open standard for SBOMs that +// identifies and catalogs components, licenses, copyrights, security +// references, and other metadata relating to software. +type SBOMInfo struct { + SPDXID *string `json:"SPDXID,omitempty"` + SPDXVersion *string `json:"spdxVersion,omitempty"` + CreationInfo *CreationInfo `json:"creationInfo,omitempty"` + + // Repo name + Name *string `json:"name,omitempty"` + DataLicense *string `json:"dataLicense,omitempty"` + DocumentDescribes []string `json:"documentDescribes,omitempty"` + DocumentNamespace *string `json:"documentNamespace,omitempty"` + + // List of packages dependencies + Packages []*RepoDependencies `json:"packages,omitempty"` +} + +func (s SBOM) String() string { + return Stringify(s) +} + +// GetSBOM fetches the software bill of materials for a repository. +// +// GitHub API docs: https://docs.github.com/en/rest/dependency-graph/sboms +func (s *DependencyGraphService) GetSBOM(ctx context.Context, owner, repo string) (*SBOM, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/dependency-graph/sbom", owner, repo) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var sbom *SBOM + resp, err := s.client.Do(ctx, req, &sbom) + if err != nil { + return nil, resp, err + } + + return sbom, resp, nil +} diff --git a/github/dependency_graph_test.go b/github/dependency_graph_test.go new file mode 100644 index 00000000000..73cf07f7161 --- /dev/null +++ b/github/dependency_graph_test.go @@ -0,0 +1,79 @@ +// Copyright 2023 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" + "time" + + "github.com/google/go-cmp/cmp" +) + +func TestDependencyGraphService_GetSBOM(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/owner/repo/dependency-graph/sbom", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "sbom":{ + "creationInfo":{ + "created":"2021-09-01T00:00:00Z" + }, + "name":"owner/repo", + "packages":[ + { + "name":"rubygems:rails", + "versionInfo":"1.0.0" + } + ] + } + }`) + }) + + ctx := context.Background() + sbom, _, err := client.DependencyGraph.GetSBOM(ctx, "owner", "repo") + if err != nil { + t.Errorf("DependencyGraph.GetSBOM returned error: %v", err) + } + + testTime := time.Date(2021, 9, 1, 0, 0, 0, 0, time.UTC) + want := &SBOM{ + &SBOMInfo{ + CreationInfo: &CreationInfo{ + Created: &Timestamp{testTime}, + }, + Name: String("owner/repo"), + Packages: []*RepoDependencies{ + { + Name: String("rubygems:rails"), + VersionInfo: String("1.0.0"), + }, + }, + }, + } + + if !cmp.Equal(sbom, want) { + t.Errorf("DependencyGraph.GetSBOM returned %+v, want %+v", sbom, want) + } + + const methodName = "GetSBOM" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.DependencyGraph.GetSBOM(ctx, "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.DependencyGraph.GetSBOM(ctx, "owner", "repo") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} diff --git a/github/github-accessors.go b/github/github-accessors.go index fc7c34a6c95..8e76ff2583e 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -4726,6 +4726,14 @@ func (c *CreateUserProjectOptions) GetBody() string { return *c.Body } +// GetCreated returns the Created field if it's non-nil, zero value otherwise. +func (c *CreationInfo) GetCreated() Timestamp { + if c == nil || c.Created == nil { + return Timestamp{} + } + return *c.Created +} + // GetAuthorizedCredentialExpiresAt returns the AuthorizedCredentialExpiresAt field if it's non-nil, zero value otherwise. func (c *CredentialAuthorization) GetAuthorizedCredentialExpiresAt() Timestamp { if c == nil || c.AuthorizedCredentialExpiresAt == nil { @@ -17342,6 +17350,62 @@ func (r *RenameOrgResponse) GetURL() string { return *r.URL } +// GetDownloadLocation returns the DownloadLocation field if it's non-nil, zero value otherwise. +func (r *RepoDependencies) GetDownloadLocation() string { + if r == nil || r.DownloadLocation == nil { + return "" + } + return *r.DownloadLocation +} + +// GetFilesAnalyzed returns the FilesAnalyzed field if it's non-nil, zero value otherwise. +func (r *RepoDependencies) GetFilesAnalyzed() bool { + if r == nil || r.FilesAnalyzed == nil { + return false + } + return *r.FilesAnalyzed +} + +// GetLicenseConcluded returns the LicenseConcluded field if it's non-nil, zero value otherwise. +func (r *RepoDependencies) GetLicenseConcluded() string { + if r == nil || r.LicenseConcluded == nil { + return "" + } + return *r.LicenseConcluded +} + +// GetLicenseDeclared returns the LicenseDeclared field if it's non-nil, zero value otherwise. +func (r *RepoDependencies) GetLicenseDeclared() string { + if r == nil || r.LicenseDeclared == nil { + return "" + } + return *r.LicenseDeclared +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (r *RepoDependencies) GetName() string { + if r == nil || r.Name == nil { + return "" + } + return *r.Name +} + +// GetSPDXID returns the SPDXID field if it's non-nil, zero value otherwise. +func (r *RepoDependencies) GetSPDXID() string { + if r == nil || r.SPDXID == nil { + return "" + } + return *r.SPDXID +} + +// GetVersionInfo returns the VersionInfo field if it's non-nil, zero value otherwise. +func (r *RepoDependencies) GetVersionInfo() string { + if r == nil || r.VersionInfo == nil { + return "" + } + return *r.VersionInfo +} + // GetBranch returns the Branch field if it's non-nil, zero value otherwise. func (r *RepoMergeUpstreamRequest) GetBranch() string { if r == nil || r.Branch == nil { @@ -19974,6 +20038,62 @@ func (s *SarifID) GetURL() string { return *s.URL } +// GetSBOM returns the SBOM field. +func (s *SBOM) GetSBOM() *SBOMInfo { + if s == nil { + return nil + } + return s.SBOM +} + +// GetCreationInfo returns the CreationInfo field. +func (s *SBOMInfo) GetCreationInfo() *CreationInfo { + if s == nil { + return nil + } + return s.CreationInfo +} + +// GetDataLicense returns the DataLicense field if it's non-nil, zero value otherwise. +func (s *SBOMInfo) GetDataLicense() string { + if s == nil || s.DataLicense == nil { + return "" + } + return *s.DataLicense +} + +// GetDocumentNamespace returns the DocumentNamespace field if it's non-nil, zero value otherwise. +func (s *SBOMInfo) GetDocumentNamespace() string { + if s == nil || s.DocumentNamespace == nil { + return "" + } + return *s.DocumentNamespace +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (s *SBOMInfo) GetName() string { + if s == nil || s.Name == nil { + return "" + } + return *s.Name +} + +// GetSPDXID returns the SPDXID field if it's non-nil, zero value otherwise. +func (s *SBOMInfo) GetSPDXID() string { + if s == nil || s.SPDXID == nil { + return "" + } + return *s.SPDXID +} + +// GetSPDXVersion returns the SPDXVersion field if it's non-nil, zero value otherwise. +func (s *SBOMInfo) GetSPDXVersion() string { + if s == nil || s.SPDXVersion == nil { + return "" + } + return *s.SPDXVersion +} + // GetAnalysisKey returns the AnalysisKey field if it's non-nil, zero value otherwise. func (s *ScanningAnalysis) GetAnalysisKey() string { if s == nil || s.AnalysisKey == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index fba6b9ee95f..6e863e0778d 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -5575,6 +5575,16 @@ func TestCreateUserProjectOptions_GetBody(tt *testing.T) { c.GetBody() } +func TestCreationInfo_GetCreated(tt *testing.T) { + var zeroValue Timestamp + c := &CreationInfo{Created: &zeroValue} + c.GetCreated() + c = &CreationInfo{} + c.GetCreated() + c = nil + c.GetCreated() +} + func TestCredentialAuthorization_GetAuthorizedCredentialExpiresAt(tt *testing.T) { var zeroValue Timestamp c := &CredentialAuthorization{AuthorizedCredentialExpiresAt: &zeroValue} @@ -20130,6 +20140,76 @@ func TestRenameOrgResponse_GetURL(tt *testing.T) { r.GetURL() } +func TestRepoDependencies_GetDownloadLocation(tt *testing.T) { + var zeroValue string + r := &RepoDependencies{DownloadLocation: &zeroValue} + r.GetDownloadLocation() + r = &RepoDependencies{} + r.GetDownloadLocation() + r = nil + r.GetDownloadLocation() +} + +func TestRepoDependencies_GetFilesAnalyzed(tt *testing.T) { + var zeroValue bool + r := &RepoDependencies{FilesAnalyzed: &zeroValue} + r.GetFilesAnalyzed() + r = &RepoDependencies{} + r.GetFilesAnalyzed() + r = nil + r.GetFilesAnalyzed() +} + +func TestRepoDependencies_GetLicenseConcluded(tt *testing.T) { + var zeroValue string + r := &RepoDependencies{LicenseConcluded: &zeroValue} + r.GetLicenseConcluded() + r = &RepoDependencies{} + r.GetLicenseConcluded() + r = nil + r.GetLicenseConcluded() +} + +func TestRepoDependencies_GetLicenseDeclared(tt *testing.T) { + var zeroValue string + r := &RepoDependencies{LicenseDeclared: &zeroValue} + r.GetLicenseDeclared() + r = &RepoDependencies{} + r.GetLicenseDeclared() + r = nil + r.GetLicenseDeclared() +} + +func TestRepoDependencies_GetName(tt *testing.T) { + var zeroValue string + r := &RepoDependencies{Name: &zeroValue} + r.GetName() + r = &RepoDependencies{} + r.GetName() + r = nil + r.GetName() +} + +func TestRepoDependencies_GetSPDXID(tt *testing.T) { + var zeroValue string + r := &RepoDependencies{SPDXID: &zeroValue} + r.GetSPDXID() + r = &RepoDependencies{} + r.GetSPDXID() + r = nil + r.GetSPDXID() +} + +func TestRepoDependencies_GetVersionInfo(tt *testing.T) { + var zeroValue string + r := &RepoDependencies{VersionInfo: &zeroValue} + r.GetVersionInfo() + r = &RepoDependencies{} + r.GetVersionInfo() + r = nil + r.GetVersionInfo() +} + func TestRepoMergeUpstreamRequest_GetBranch(tt *testing.T) { var zeroValue string r := &RepoMergeUpstreamRequest{Branch: &zeroValue} @@ -23273,6 +23353,70 @@ func TestSarifID_GetURL(tt *testing.T) { s.GetURL() } +func TestSBOM_GetSBOM(tt *testing.T) { + s := &SBOM{} + s.GetSBOM() + s = nil + s.GetSBOM() +} + +func TestSBOMInfo_GetCreationInfo(tt *testing.T) { + s := &SBOMInfo{} + s.GetCreationInfo() + s = nil + s.GetCreationInfo() +} + +func TestSBOMInfo_GetDataLicense(tt *testing.T) { + var zeroValue string + s := &SBOMInfo{DataLicense: &zeroValue} + s.GetDataLicense() + s = &SBOMInfo{} + s.GetDataLicense() + s = nil + s.GetDataLicense() +} + +func TestSBOMInfo_GetDocumentNamespace(tt *testing.T) { + var zeroValue string + s := &SBOMInfo{DocumentNamespace: &zeroValue} + s.GetDocumentNamespace() + s = &SBOMInfo{} + s.GetDocumentNamespace() + s = nil + s.GetDocumentNamespace() +} + +func TestSBOMInfo_GetName(tt *testing.T) { + var zeroValue string + s := &SBOMInfo{Name: &zeroValue} + s.GetName() + s = &SBOMInfo{} + s.GetName() + s = nil + s.GetName() +} + +func TestSBOMInfo_GetSPDXID(tt *testing.T) { + var zeroValue string + s := &SBOMInfo{SPDXID: &zeroValue} + s.GetSPDXID() + s = &SBOMInfo{} + s.GetSPDXID() + s = nil + s.GetSPDXID() +} + +func TestSBOMInfo_GetSPDXVersion(tt *testing.T) { + var zeroValue string + s := &SBOMInfo{SPDXVersion: &zeroValue} + s.GetSPDXVersion() + s = &SBOMInfo{} + s.GetSPDXVersion() + s = nil + s.GetSPDXVersion() +} + func TestScanningAnalysis_GetAnalysisKey(tt *testing.T) { var zeroValue string s := &ScanningAnalysis{AnalysisKey: &zeroValue} diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index a8a7b6f0b14..925e4563c0e 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -1763,6 +1763,16 @@ func TestRepositoryRelease_String(t *testing.T) { } } +func TestSBOM_String(t *testing.T) { + v := SBOM{ + SBOM: &SBOMInfo{}, + } + want := `github.SBOM{SBOM:github.SBOMInfo{}}` + if got := v.String(); got != want { + t.Errorf("SBOM.String = %v, want %v", got, want) + } +} + func TestSSHSigningKey_String(t *testing.T) { v := SSHSigningKey{ ID: Int64(0), diff --git a/github/github.go b/github/github.go index 39f4479d4ab..2b8780b502d 100644 --- a/github/github.go +++ b/github/github.go @@ -186,6 +186,7 @@ type Client struct { CodeScanning *CodeScanningService Codespaces *CodespacesService Dependabot *DependabotService + DependencyGraph *DependencyGraphService Enterprise *EnterpriseService Gists *GistsService Git *GitService @@ -326,6 +327,7 @@ func NewClient(httpClient *http.Client) *Client { c.CodeScanning = (*CodeScanningService)(&c.common) c.Codespaces = (*CodespacesService)(&c.common) c.Dependabot = (*DependabotService)(&c.common) + c.DependencyGraph = (*DependencyGraphService)(&c.common) c.Enterprise = (*EnterpriseService)(&c.common) c.Gists = (*GistsService)(&c.common) c.Git = (*GitService)(&c.common) From e94b955438a07b410865c17e82111fb1c1967f66 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Wed, 16 Aug 2023 13:53:51 -0400 Subject: [PATCH 291/751] Add SubmoduleGitURL to RepositoryContent (#2880) Fixes: #2877. --- github/github-accessors.go | 8 +++++ github/github-accessors_test.go | 10 ++++++ github/github-stringify_test.go | 27 ++++++++-------- github/repos_contents.go | 13 ++++---- github/repos_contents_test.go | 56 ++++++++++++++++++--------------- 5 files changed, 69 insertions(+), 45 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 8e76ff2583e..562ad734562 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -18638,6 +18638,14 @@ func (r *RepositoryContent) GetSize() int { return *r.Size } +// GetSubmoduleGitURL returns the SubmoduleGitURL field if it's non-nil, zero value otherwise. +func (r *RepositoryContent) GetSubmoduleGitURL() string { + if r == nil || r.SubmoduleGitURL == nil { + return "" + } + return *r.SubmoduleGitURL +} + // GetTarget returns the Target field if it's non-nil, zero value otherwise. func (r *RepositoryContent) GetTarget() string { if r == nil || r.Target == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 6e863e0778d..0a6b5271e8b 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -21705,6 +21705,16 @@ func TestRepositoryContent_GetSize(tt *testing.T) { r.GetSize() } +func TestRepositoryContent_GetSubmoduleGitURL(tt *testing.T) { + var zeroValue string + r := &RepositoryContent{SubmoduleGitURL: &zeroValue} + r.GetSubmoduleGitURL() + r = &RepositoryContent{} + r.GetSubmoduleGitURL() + r = nil + r.GetSubmoduleGitURL() +} + func TestRepositoryContent_GetTarget(tt *testing.T) { var zeroValue string r := &RepositoryContent{Target: &zeroValue} diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index 925e4563c0e..1d2a47bbffe 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -1683,20 +1683,21 @@ func TestRepositoryCommit_String(t *testing.T) { func TestRepositoryContent_String(t *testing.T) { v := RepositoryContent{ - Type: String(""), - Target: String(""), - Encoding: String(""), - Size: Int(0), - Name: String(""), - Path: String(""), - Content: String(""), - SHA: String(""), - URL: String(""), - GitURL: String(""), - HTMLURL: String(""), - DownloadURL: String(""), + Type: String(""), + Target: String(""), + Encoding: String(""), + Size: Int(0), + Name: String(""), + Path: String(""), + Content: String(""), + SHA: String(""), + URL: String(""), + GitURL: String(""), + HTMLURL: String(""), + DownloadURL: String(""), + SubmoduleGitURL: String(""), } - want := `github.RepositoryContent{Type:"", Target:"", Encoding:"", Size:0, Name:"", Path:"", Content:"", SHA:"", URL:"", GitURL:"", HTMLURL:"", DownloadURL:""}` + want := `github.RepositoryContent{Type:"", Target:"", Encoding:"", Size:0, Name:"", Path:"", Content:"", SHA:"", URL:"", GitURL:"", HTMLURL:"", DownloadURL:"", SubmoduleGitURL:""}` if got := v.String(); got != want { t.Errorf("RepositoryContent.String = %v, want %v", got, want) } diff --git a/github/repos_contents.go b/github/repos_contents.go index e859a4ddca4..de7a0d5b82b 100644 --- a/github/repos_contents.go +++ b/github/repos_contents.go @@ -36,12 +36,13 @@ type RepositoryContent struct { // Content contains the actual file content, which may be encoded. // Callers should call GetContent which will decode the content if // necessary. - Content *string `json:"content,omitempty"` - SHA *string `json:"sha,omitempty"` - URL *string `json:"url,omitempty"` - GitURL *string `json:"git_url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - DownloadURL *string `json:"download_url,omitempty"` + Content *string `json:"content,omitempty"` + SHA *string `json:"sha,omitempty"` + URL *string `json:"url,omitempty"` + GitURL *string `json:"git_url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + DownloadURL *string `json:"download_url,omitempty"` + SubmoduleGitURL *string `json:"submodule_git_url,omitempty"` } // RepositoryContentResponse holds the parsed response from CreateFile, UpdateFile, and DeleteFile. diff --git a/github/repos_contents_test.go b/github/repos_contents_test.go index 295c21684cd..ab69b5cdcbb 100644 --- a/github/repos_contents_test.go +++ b/github/repos_contents_test.go @@ -782,18 +782,19 @@ func TestRepositoryContent_Marshal(t *testing.T) { testJSONMarshal(t, &RepositoryContent{}, "{}") r := &RepositoryContent{ - Type: String("type"), - Target: String("target"), - Encoding: String("encoding"), - Size: Int(1), - Name: String("name"), - Path: String("path"), - Content: String("content"), - SHA: String("sha"), - URL: String("url"), - GitURL: String("gurl"), - HTMLURL: String("hurl"), - DownloadURL: String("durl"), + Type: String("type"), + Target: String("target"), + Encoding: String("encoding"), + Size: Int(1), + Name: String("name"), + Path: String("path"), + Content: String("content"), + SHA: String("sha"), + URL: String("url"), + GitURL: String("gurl"), + HTMLURL: String("hurl"), + DownloadURL: String("durl"), + SubmoduleGitURL: String("smgurl"), } want := `{ @@ -808,7 +809,8 @@ func TestRepositoryContent_Marshal(t *testing.T) { "url": "url", "git_url": "gurl", "html_url": "hurl", - "download_url": "durl" + "download_url": "durl", + "submodule_git_url": "smgurl" }` testJSONMarshal(t, r, want) @@ -819,18 +821,19 @@ func TestRepositoryContentResponse_Marshal(t *testing.T) { r := &RepositoryContentResponse{ Content: &RepositoryContent{ - Type: String("type"), - Target: String("target"), - Encoding: String("encoding"), - Size: Int(1), - Name: String("name"), - Path: String("path"), - Content: String("content"), - SHA: String("sha"), - URL: String("url"), - GitURL: String("gurl"), - HTMLURL: String("hurl"), - DownloadURL: String("durl"), + Type: String("type"), + Target: String("target"), + Encoding: String("encoding"), + Size: Int(1), + Name: String("name"), + Path: String("path"), + Content: String("content"), + SHA: String("sha"), + URL: String("url"), + GitURL: String("gurl"), + HTMLURL: String("hurl"), + DownloadURL: String("durl"), + SubmoduleGitURL: String("smgurl"), }, Commit: Commit{ SHA: String("s"), @@ -893,7 +896,8 @@ func TestRepositoryContentResponse_Marshal(t *testing.T) { "url": "url", "git_url": "gurl", "html_url": "hurl", - "download_url": "durl" + "download_url": "durl", + "submodule_git_url": "smgurl" }, "commit": { "sha": "s", From 537ebb4825685fbf981529567a2c558181e62a68 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Wed, 16 Aug 2023 14:31:23 -0400 Subject: [PATCH 292/751] Bump version of go-github to v54.0.0 (#2881) --- AUTHORS | 53 +++++++++++++++++++ README.md | 15 +++--- example/actionpermissions/main.go | 2 +- example/appengine/app.go | 2 +- example/basicauth/main.go | 2 +- .../newreposecretwithxcrypto/main.go | 2 +- .../newusersecretwithxcrypto/main.go | 2 +- example/commitpr/main.go | 2 +- example/go.mod | 6 +-- example/listenvironments/main.go | 2 +- example/migrations/main.go | 2 +- example/newfilewithappauth/main.go | 2 +- example/newrepo/main.go | 2 +- example/newreposecretwithlibsodium/go.mod | 4 +- example/newreposecretwithlibsodium/main.go | 2 +- example/newreposecretwithxcrypto/main.go | 2 +- example/ratelimit/main.go | 2 +- example/simple/main.go | 2 +- example/tagprotection/main.go | 2 +- example/tokenauth/main.go | 2 +- example/topics/main.go | 2 +- github/doc.go | 2 +- github/examples_test.go | 2 +- github/github.go | 2 +- go.mod | 2 +- test/fields/fields.go | 2 +- test/integration/activity_test.go | 2 +- test/integration/authorizations_test.go | 2 +- test/integration/github_test.go | 2 +- test/integration/repos_test.go | 2 +- test/integration/users_test.go | 2 +- update-urls/go.mod | 2 +- 32 files changed, 94 insertions(+), 40 deletions(-) diff --git a/AUTHORS b/AUTHORS index a833043b0fc..74a21dc604e 100644 --- a/AUTHORS +++ b/AUTHORS @@ -11,13 +11,17 @@ 178inaba 2BFL 413x +6543 <6543@obermui.de> Abed Kibbe Abhinav Gupta Abhishek Veeramalla aboy +Adam Kohring adrienzieba afdesk +Ahmad Nurus S Ahmed Hagy +Aidan Aidan Steele Ainsley Chong ajz01 @@ -26,6 +30,7 @@ Akhil Mohan Alec Thomas Aleks Clark Alex Bramley +Alex Ellis Alex Orr Alex Su Alex Unger @@ -51,6 +56,7 @@ Anton Nguyen Anubha Kushwaha appilon aprp +apurwaj2 Aravind Arda Kuyumcu Arıl Bozoluk @@ -60,12 +66,15 @@ Austin Dizzy Azuka Okuleye Ben Batha Benjamen Keroack +Berkay Tacyildiz Beshr Kayali Beyang Liu Billy Keyes Billy Lynch +Bingtan Lu Bjorn Neergaard Björn Häuser +Bo Huang boljen Bracken Brad Harris @@ -74,6 +83,7 @@ Bradley Falzon Bradley McAllister Brandon Butler Brandon Cook +Brandon Stubbs Brett Kuhlman Brett Logan Brian Egizi @@ -96,6 +106,7 @@ Chris Schaefer chrisforrette Christian Bargmann Christian Muehlhaeuser +Christoph Jerolimov Christoph Sassenberg CI Monk Colin Misare @@ -132,6 +143,7 @@ Don Petersen Doug Turner Drew Fradette Dustin Deus +Dustin Lish Eivind Eli Uriegas Elliott Beach @@ -142,10 +154,12 @@ eperm Erick Fejta Erik Nobel erwinvaneyk +Evan Anderson Evan Elias Fabian Holler Fabrice Fatema-Moaiyadi +Federico Di Pierro Felix Geisendörfer Filippo Valsorda Florian Forster @@ -156,6 +170,7 @@ Francisco Guimarães François de Metz Fredrik Jönsson Gabriel +Gal Ofri Garrett Squire George Kontridze Georgy Buranov @@ -164,6 +179,7 @@ Gnahz Google Inc. Grachev Mikhail griffin_stewie +guangwu Guillaume Jacquet Guz Alexander Guðmundur Bjarni Ólafsson @@ -179,6 +195,7 @@ huydx i2bskn Iain Steers Ikko Ashimine +Ilia Choly Ioannis Georgoulas Isao Jonas ishan upadhyay @@ -190,11 +207,15 @@ Jameel Haffejee James Bowes James Cockbain James Loh +James Maguire +James Turley Jamie West Jan Kosecki Jan Å vábík +Jason Field Javier Campanini Jef LeCompte +Jeff Wenzbauer Jens Rantil Jeremy Morris Jesse Haka @@ -209,7 +230,9 @@ John Engelman John Jones John Liu Jordan Brockopp +Jordan Burandt Jordan Sussman +Jorge Gómez Reus Joshua Bezaleel Abednego João Cerqueira JP Phillips @@ -223,14 +246,17 @@ Justin Abrahms Justin Toh Jusung Lee jzhoucliqr +k0ral k1rnt kadern0 +Karthik Sundari Katrina Owen Kautilya Tripathi Keita Urashima Kevin Burke Kevin Wang Kevin Zhao +kgalli Kirill Konrad Malawski Kookheon Kwon @@ -240,19 +266,24 @@ Kshitij Saraogi Kumar Saurabh Kyle Kurz kyokomi +Lars Lehtonen Laurent Verdoïa leopoldwang Liam Galvin Lluis Campos Lovro Mažgon +Loïs Postula Luca Campese Lucas Alcantara +Lucas Martin-King Luis Davim Luke Evers +Luke Hinds Luke Kysow Luke Roberts Luke Young lynn [they] +Magnus Kulke Maksim Zhylinski Marc Binder Marcelo Carlos @@ -267,9 +298,11 @@ Matija Horvat Matin Rahmanian Matt Matt Brender +Matt Dainty Matt Gaunt Matt Landis Matt Moore +Matt Simons Maxime Bury Michael Meng Michael Spiegel @@ -278,26 +311,33 @@ MichaÅ‚ Glapa Michelangelo Morrillo Miguel Elias dos Santos Mike Chen +mohammad ali <2018cs92@student.uet.edu.pk> Mohammed AlDujaili Mukundan Senthil Munia Balayil Mustafa Abban Nadav Kaner +Naoki Kanatani Nathan VanBenschoten Navaneeth Suresh +Neal Caffery Neil O'Toole Nick Miyake Nick Platt Nick Spragg +Nicolas Chapurlat Nikhita Raghunath Nilesh Singh Noah Hanjun Lee Noah Zoschke ns-cweber +nxya Ole Orhagen Oleg Kovalov OndÅ™ej Kupka Ori Talmor +Osama Faqhruldin +oslowalk Pablo Pérez Schröder Palash Nigam Panagiotis Moustafellos @@ -308,6 +348,7 @@ parkhyukjun89 Pat Alwell Patrick DeVivo Patrick Marabeas +Patrik Nordlén Pavel Dvoinos Pavel Shtanko Pete Wagner @@ -324,6 +365,7 @@ Quinn Slack Rackspace US, Inc. Radek Simko RadliÅ„ski Ignacy +Rafael Aramizu Gomes Rajat Jindal Rajendra arora Rajkumar @@ -352,6 +394,7 @@ Ryo Nakao Saaarah Safwan Olaimat Sahil Dua +Sai Ravi Teja Chintakrindi saisi Sam Minnée Sandeep Sukhani @@ -378,6 +421,7 @@ Sho Okada Shrikrishna Singh Simon Davis sona-tar +soniachikh SoundCloud, Ltd. Sridhar Mocherla SriVignessh Pss @@ -388,6 +432,7 @@ Suhaib Mujahid sushmita wable Szymon Kodrebski Søren Hansen +T.J. Corrigan Takashi Yoneuchi Takayuki Watanabe Taketoshi Fujiwara @@ -399,6 +444,7 @@ Theofilos Petsios Thomas Aidan Curran Thomas Bruyelle Tim Rogers +Timothy O'Brien Timothée Peignier Tingluo Huang tkhandel @@ -411,11 +457,15 @@ Vaibhav Singh Varadarajan Aravamudhan Victor Castell Victor Vrantchan +Victory Osikwemhe vikkyomkar +Vivek Vlad Ungureanu Wasim Thabraze Weslei Juan Moser Pereira +Wheeler Law Will Maier +Will Norris Willem D'Haeseleer William Bailey William Cooke @@ -423,12 +473,15 @@ Xabi xibz Yann Malet Yannick Utard +Yarden Shoham Yicheng Qin Yosuke Akatsuka Yumikiyo Osanai +Yurii Soldak Yusef Mohamadi Yusuke Kuoka Zach Latta zhouhaibing089 六开箱 缘生 +蒋航 diff --git a/README.md b/README.md index 4e954e15756..3eb9947c158 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-github # [![go-github release (latest SemVer)](https://img.shields.io/github/v/release/google/go-github?sort=semver)](https://github.com/google/go-github/releases) -[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v53/github) +[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v54/github) [![Test Status](https://github.com/google/go-github/workflows/tests/badge.svg)](https://github.com/google/go-github/actions?query=workflow%3Atests) [![Test Coverage](https://codecov.io/gh/google/go-github/branch/master/graph/badge.svg)](https://codecov.io/gh/google/go-github) [![Discuss at go-github@googlegroups.com](https://img.shields.io/badge/discuss-go--github%40googlegroups.com-blue.svg)](https://groups.google.com/group/go-github) @@ -24,7 +24,7 @@ If you're interested in using the [GraphQL API v4][], the recommended library is go-github is compatible with modern Go releases in module mode, with Go installed: ```bash -go get github.com/google/go-github/v53 +go get github.com/google/go-github/v54 ``` will resolve and add the package to the current development module, along with its dependencies. @@ -32,7 +32,7 @@ will resolve and add the package to the current development module, along with i Alternatively the same can be achieved if you use import in a package: ```go -import "github.com/google/go-github/v53/github" +import "github.com/google/go-github/v54/github" ``` and run `go get` without parameters. @@ -40,13 +40,13 @@ and run `go get` without parameters. Finally, to use the top-of-trunk version of this repo, use the following command: ```bash -go get github.com/google/go-github/v53@master +go get github.com/google/go-github/v54@master ``` ## Usage ## ```go -import "github.com/google/go-github/v53/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) +import "github.com/google/go-github/v54/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled ``` @@ -135,7 +135,7 @@ import ( "net/http" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v54/github" ) func main() { @@ -323,7 +323,7 @@ For complete usage of go-github, see the full [package docs][]. [oauth2]: https://github.com/golang/oauth2 [oauth2 docs]: https://godoc.org/golang.org/x/oauth2 [personal API token]: https://github.com/blog/1509-personal-api-tokens -[package docs]: https://pkg.go.dev/github.com/google/go-github/v53/github +[package docs]: https://pkg.go.dev/github.com/google/go-github/v54/github [GraphQL API v4]: https://developer.github.com/v4/ [shurcooL/githubv4]: https://github.com/shurcooL/githubv4 [GitHub webhook events]: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads @@ -396,6 +396,7 @@ Versions prior to 48.2.0 are not listed. | go-github Version | GitHub v3 API Version | | ----------------- | --------------------- | +| 54.0.0 | 2022-11-28 | | 53.2.0 | 2022-11-28 | | 53.1.0 | 2022-11-28 | | 53.0.0 | 2022-11-28 | diff --git a/example/actionpermissions/main.go b/example/actionpermissions/main.go index 7ed63b171c4..40f4a86ece0 100644 --- a/example/actionpermissions/main.go +++ b/example/actionpermissions/main.go @@ -14,7 +14,7 @@ import ( "log" "os" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v54/github" ) var ( diff --git a/example/appengine/app.go b/example/appengine/app.go index 1ad511227f2..1694faaacfd 100644 --- a/example/appengine/app.go +++ b/example/appengine/app.go @@ -12,7 +12,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v54/github" "google.golang.org/appengine" "google.golang.org/appengine/log" ) diff --git a/example/basicauth/main.go b/example/basicauth/main.go index 3c55ed18992..f9431b25035 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -22,7 +22,7 @@ import ( "strings" "syscall" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v54/github" "golang.org/x/term" ) diff --git a/example/codespaces/newreposecretwithxcrypto/main.go b/example/codespaces/newreposecretwithxcrypto/main.go index fcc547b3a43..4ec3757af25 100644 --- a/example/codespaces/newreposecretwithxcrypto/main.go +++ b/example/codespaces/newreposecretwithxcrypto/main.go @@ -36,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v54/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/codespaces/newusersecretwithxcrypto/main.go b/example/codespaces/newusersecretwithxcrypto/main.go index dd230c1da0c..964452da82b 100644 --- a/example/codespaces/newusersecretwithxcrypto/main.go +++ b/example/codespaces/newusersecretwithxcrypto/main.go @@ -37,7 +37,7 @@ import ( "log" "os" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v54/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index da3c5a5819a..2e81387017c 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -30,7 +30,7 @@ import ( "strings" "time" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v54/github" ) var ( diff --git a/example/go.mod b/example/go.mod index 8dc82fb8ddd..081ce56d129 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,11 +1,11 @@ -module github.com/google/go-github/v53/example +module github.com/google/go-github/v54/example go 1.17 require ( github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-ratelimit v1.0.3 - github.com/google/go-github/v53 v53.0.0 + github.com/google/go-github/v54 v54.0.0 golang.org/x/crypto v0.7.0 golang.org/x/oauth2 v0.7.0 google.golang.org/appengine v1.6.7 @@ -22,4 +22,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v53 => ../ +replace github.com/google/go-github/v54 => ../ diff --git a/example/listenvironments/main.go b/example/listenvironments/main.go index 1c8bb634fdf..15ec8cbb583 100644 --- a/example/listenvironments/main.go +++ b/example/listenvironments/main.go @@ -18,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v54/github" ) func main() { diff --git a/example/migrations/main.go b/example/migrations/main.go index 07f12287448..f5c36c63059 100644 --- a/example/migrations/main.go +++ b/example/migrations/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v54/github" ) func fetchAllUserMigrations() ([]*github.UserMigration, error) { diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index ccdaaf3b0eb..6526fadc35e 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -16,7 +16,7 @@ import ( "time" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v54/github" "golang.org/x/oauth2" ) diff --git a/example/newrepo/main.go b/example/newrepo/main.go index 443778bc6dc..758b293db23 100644 --- a/example/newrepo/main.go +++ b/example/newrepo/main.go @@ -16,7 +16,7 @@ import ( "log" "os" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v54/github" ) var ( diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index ca17e055dea..95dbcc9d52d 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -4,9 +4,9 @@ go 1.15 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb - github.com/google/go-github/v53 v53.0.0 + github.com/google/go-github/v54 v54.0.0 golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v53 => ../.. +replace github.com/google/go-github/v54 => ../.. diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index b33c851b877..039289054ee 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -36,7 +36,7 @@ import ( "os" sodium "github.com/GoKillers/libsodium-go/cryptobox" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v54/github" ) var ( diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index 564fc069593..76eb3dd8741 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -36,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v54/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/ratelimit/main.go b/example/ratelimit/main.go index 6ece9768982..dcc1510000f 100644 --- a/example/ratelimit/main.go +++ b/example/ratelimit/main.go @@ -13,7 +13,7 @@ import ( "fmt" "github.com/gofri/go-github-ratelimit/github_ratelimit" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v54/github" ) func main() { diff --git a/example/simple/main.go b/example/simple/main.go index fbb9c0d7907..bb2a624d315 100644 --- a/example/simple/main.go +++ b/example/simple/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v54/github" ) // Fetch all the public organizations' membership of a user. diff --git a/example/tagprotection/main.go b/example/tagprotection/main.go index aecc60bfa9f..8f85c7c0cb8 100644 --- a/example/tagprotection/main.go +++ b/example/tagprotection/main.go @@ -19,7 +19,7 @@ import ( "strings" "syscall" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v54/github" "golang.org/x/term" ) diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index 4cfe0f5b2da..a9e845bed30 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -14,7 +14,7 @@ import ( "log" "syscall" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v54/github" "golang.org/x/term" ) diff --git a/example/topics/main.go b/example/topics/main.go index bbe91a22872..83d3d7faa7b 100644 --- a/example/topics/main.go +++ b/example/topics/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v54/github" ) // Fetch and lists all the public topics associated with the specified GitHub topic diff --git a/github/doc.go b/github/doc.go index af2847111a3..42337fb878b 100644 --- a/github/doc.go +++ b/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v53/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v54/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to diff --git a/github/examples_test.go b/github/examples_test.go index ad0e94d2760..71315594afe 100644 --- a/github/examples_test.go +++ b/github/examples_test.go @@ -12,7 +12,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v54/github" ) func ExampleClient_Markdown() { diff --git a/github/github.go b/github/github.go index 2b8780b502d..aad4a7335d6 100644 --- a/github/github.go +++ b/github/github.go @@ -28,7 +28,7 @@ import ( ) const ( - Version = "v53.2.0" + Version = "v54.0.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" diff --git a/go.mod b/go.mod index 57bbbdc4bce..2ea4636dfbb 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v53 +module github.com/google/go-github/v54 require ( github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 diff --git a/test/fields/fields.go b/test/fields/fields.go index 85d4b8a024e..8f5d1ffc05e 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -25,7 +25,7 @@ import ( "reflect" "strings" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v54/github" ) var ( diff --git a/test/integration/activity_test.go b/test/integration/activity_test.go index f7145ae2c23..32620ec4270 100644 --- a/test/integration/activity_test.go +++ b/test/integration/activity_test.go @@ -12,7 +12,7 @@ import ( "context" "testing" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v54/github" ) const ( diff --git a/test/integration/authorizations_test.go b/test/integration/authorizations_test.go index cd968a63a91..ff4980672cd 100644 --- a/test/integration/authorizations_test.go +++ b/test/integration/authorizations_test.go @@ -17,7 +17,7 @@ import ( "testing" "time" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v54/github" ) const msgEnvMissing = "Skipping test because the required environment variable (%v) is not present." diff --git a/test/integration/github_test.go b/test/integration/github_test.go index 934fb02580e..9bcbf7b554a 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -15,7 +15,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v54/github" ) var ( diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index 410468ad96b..72441bc57b4 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -15,7 +15,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v54/github" ) func TestRepositories_CRUD(t *testing.T) { diff --git a/test/integration/users_test.go b/test/integration/users_test.go index 80324a180f6..61bf8c9974d 100644 --- a/test/integration/users_test.go +++ b/test/integration/users_test.go @@ -14,7 +14,7 @@ import ( "math/rand" "testing" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v54/github" ) func TestUsers_Get(t *testing.T) { diff --git a/update-urls/go.mod b/update-urls/go.mod index 2d744e632cd..faa2ff61eef 100644 --- a/update-urls/go.mod +++ b/update-urls/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v53/update-urls +module github.com/google/go-github/v54/update-urls go 1.16 From a0e8f35c5cefc688733d566ec3701e86972df056 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Wed, 16 Aug 2023 14:49:22 -0400 Subject: [PATCH 293/751] Bump go-github from v53 to v54 in /scrape (#2882) --- scrape/apps.go | 2 +- scrape/apps_test.go | 2 +- scrape/go.mod | 2 +- scrape/go.sum | 1500 ++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 1498 insertions(+), 8 deletions(-) diff --git a/scrape/apps.go b/scrape/apps.go index 290390c9f1b..56db9c9a5a1 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -17,7 +17,7 @@ import ( "strings" "github.com/PuerkitoBio/goquery" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v54/github" ) // AppRestrictionsEnabled returns whether the specified organization has diff --git a/scrape/apps_test.go b/scrape/apps_test.go index a4c2ce9057d..32d7944940e 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v54/github" ) func Test_AppRestrictionsEnabled(t *testing.T) { diff --git a/scrape/go.mod b/scrape/go.mod index 35297ea0dee..15673097473 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -5,7 +5,7 @@ go 1.13 require ( github.com/PuerkitoBio/goquery v1.8.1 github.com/google/go-cmp v0.5.9 - github.com/google/go-github/v53 v53.2.0 + github.com/google/go-github/v54 v54.0.0 github.com/xlzd/gotp v0.1.0 golang.org/x/net v0.14.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index 304493ef01b..8edb2296e4d 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -1,96 +1,1586 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= +cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= +cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= +cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= +cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= +cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= +cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= +cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= +cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= +cloud.google.com/go v0.100.1/go.mod h1:fs4QogzfH5n2pBXBP9vRiU+eCny7lD2vmFZy79Iuw1U= +cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= +cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= +cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= +cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= +cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM= +cloud.google.com/go v0.107.0/go.mod h1:wpc2eNrD7hXUTy8EKS10jkxpZBjASrORK7goS+3YX2I= +cloud.google.com/go v0.110.0/go.mod h1:SJnCLqQ0FCFGSZMUNUf84MV3Aia54kn7pi8st7tMzaY= +cloud.google.com/go v0.110.2/go.mod h1:k04UEeEtb6ZBRTv3dZz4CeJC3jKGxyhl0sAiVVquxiw= +cloud.google.com/go/accessapproval v1.4.0/go.mod h1:zybIuC3KpDOvotz59lFe5qxRZx6C75OtwbisN56xYB4= +cloud.google.com/go/accessapproval v1.5.0/go.mod h1:HFy3tuiGvMdcd/u+Cu5b9NkO1pEICJ46IR82PoUdplw= +cloud.google.com/go/accessapproval v1.6.0/go.mod h1:R0EiYnwV5fsRFiKZkPHr6mwyk2wxUJ30nL4j2pcFY2E= +cloud.google.com/go/accesscontextmanager v1.3.0/go.mod h1:TgCBehyr5gNMz7ZaH9xubp+CE8dkrszb4oK9CWyvD4o= +cloud.google.com/go/accesscontextmanager v1.4.0/go.mod h1:/Kjh7BBu/Gh83sv+K60vN9QE5NJcd80sU33vIe2IFPE= +cloud.google.com/go/accesscontextmanager v1.6.0/go.mod h1:8XCvZWfYw3K/ji0iVnp+6pu7huxoQTLmxAbVjbloTtM= +cloud.google.com/go/accesscontextmanager v1.7.0/go.mod h1:CEGLewx8dwa33aDAZQujl7Dx+uYhS0eay198wB/VumQ= +cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= +cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= +cloud.google.com/go/aiplatform v1.27.0/go.mod h1:Bvxqtl40l0WImSb04d0hXFU7gDOiq9jQmorivIiWcKg= +cloud.google.com/go/aiplatform v1.35.0/go.mod h1:7MFT/vCaOyZT/4IIFfxH4ErVg/4ku6lKv3w0+tFTgXQ= +cloud.google.com/go/aiplatform v1.36.1/go.mod h1:WTm12vJRPARNvJ+v6P52RDHCNe4AhvjcIZ/9/RRHy/k= +cloud.google.com/go/aiplatform v1.37.0/go.mod h1:IU2Cv29Lv9oCn/9LkFiiuKfwrRTq+QQMbW+hPCxJGZw= +cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= +cloud.google.com/go/analytics v0.12.0/go.mod h1:gkfj9h6XRf9+TS4bmuhPEShsh3hH8PAZzm/41OOhQd4= +cloud.google.com/go/analytics v0.17.0/go.mod h1:WXFa3WSym4IZ+JiKmavYdJwGG/CvpqiqczmL59bTD9M= +cloud.google.com/go/analytics v0.18.0/go.mod h1:ZkeHGQlcIPkw0R/GW+boWHhCOR43xz9RN/jn7WcqfIE= +cloud.google.com/go/analytics v0.19.0/go.mod h1:k8liqf5/HCnOUkbawNtrWWc+UAzyDlW89doe8TtoDsE= +cloud.google.com/go/apigateway v1.3.0/go.mod h1:89Z8Bhpmxu6AmUxuVRg/ECRGReEdiP3vQtk4Z1J9rJk= +cloud.google.com/go/apigateway v1.4.0/go.mod h1:pHVY9MKGaH9PQ3pJ4YLzoj6U5FUDeDFBllIz7WmzJoc= +cloud.google.com/go/apigateway v1.5.0/go.mod h1:GpnZR3Q4rR7LVu5951qfXPJCHquZt02jf7xQx7kpqN8= +cloud.google.com/go/apigeeconnect v1.3.0/go.mod h1:G/AwXFAKo0gIXkPTVfZDd2qA1TxBXJ3MgMRBQkIi9jc= +cloud.google.com/go/apigeeconnect v1.4.0/go.mod h1:kV4NwOKqjvt2JYR0AoIWo2QGfoRtn/pkS3QlHp0Ni04= +cloud.google.com/go/apigeeconnect v1.5.0/go.mod h1:KFaCqvBRU6idyhSNyn3vlHXc8VMDJdRmwDF6JyFRqZ8= +cloud.google.com/go/apigeeregistry v0.4.0/go.mod h1:EUG4PGcsZvxOXAdyEghIdXwAEi/4MEaoqLMLDMIwKXY= +cloud.google.com/go/apigeeregistry v0.5.0/go.mod h1:YR5+s0BVNZfVOUkMa5pAR2xGd0A473vA5M7j247o1wM= +cloud.google.com/go/apigeeregistry v0.6.0/go.mod h1:BFNzW7yQVLZ3yj0TKcwzb8n25CFBri51GVGOEUcgQsc= +cloud.google.com/go/apikeys v0.4.0/go.mod h1:XATS/yqZbaBK0HOssf+ALHp8jAlNHUgyfprvNcBIszU= +cloud.google.com/go/apikeys v0.5.0/go.mod h1:5aQfwY4D+ewMMWScd3hm2en3hCj+BROlyrt3ytS7KLI= +cloud.google.com/go/apikeys v0.6.0/go.mod h1:kbpXu5upyiAlGkKrJgQl8A0rKNNJ7dQ377pdroRSSi8= +cloud.google.com/go/appengine v1.4.0/go.mod h1:CS2NhuBuDXM9f+qscZ6V86m1MIIqPj3WC/UoEuR1Sno= +cloud.google.com/go/appengine v1.5.0/go.mod h1:TfasSozdkFI0zeoxW3PTBLiNqRmzraodCWatWI9Dmak= +cloud.google.com/go/appengine v1.6.0/go.mod h1:hg6i0J/BD2cKmDJbaFSYHFyZkgBEfQrDg/X0V5fJn84= +cloud.google.com/go/appengine v1.7.0/go.mod h1:eZqpbHFCqRGa2aCdope7eC0SWLV1j0neb/QnMJVWx6A= +cloud.google.com/go/appengine v1.7.1/go.mod h1:IHLToyb/3fKutRysUlFO0BPt5j7RiQ45nrzEJmKTo6E= +cloud.google.com/go/area120 v0.5.0/go.mod h1:DE/n4mp+iqVyvxHN41Vf1CR602GiHQjFPusMFW6bGR4= +cloud.google.com/go/area120 v0.6.0/go.mod h1:39yFJqWVgm0UZqWTOdqkLhjoC7uFfgXRC8g/ZegeAh0= +cloud.google.com/go/area120 v0.7.0/go.mod h1:a3+8EUD1SX5RUcCs3MY5YasiO1z6yLiNLRiFrykbynY= +cloud.google.com/go/area120 v0.7.1/go.mod h1:j84i4E1RboTWjKtZVWXPqvK5VHQFJRF2c1Nm69pWm9k= +cloud.google.com/go/artifactregistry v1.6.0/go.mod h1:IYt0oBPSAGYj/kprzsBjZ/4LnG/zOcHyFHjWPCi6SAQ= +cloud.google.com/go/artifactregistry v1.7.0/go.mod h1:mqTOFOnGZx8EtSqK/ZWcsm/4U8B77rbcLP6ruDU2Ixk= +cloud.google.com/go/artifactregistry v1.8.0/go.mod h1:w3GQXkJX8hiKN0v+at4b0qotwijQbYUqF2GWkZzAhC0= +cloud.google.com/go/artifactregistry v1.9.0/go.mod h1:2K2RqvA2CYvAeARHRkLDhMDJ3OXy26h3XW+3/Jh2uYc= +cloud.google.com/go/artifactregistry v1.11.1/go.mod h1:lLYghw+Itq9SONbCa1YWBoWs1nOucMH0pwXN1rOBZFI= +cloud.google.com/go/artifactregistry v1.11.2/go.mod h1:nLZns771ZGAwVLzTX/7Al6R9ehma4WUEhZGWV6CeQNQ= +cloud.google.com/go/artifactregistry v1.12.0/go.mod h1:o6P3MIvtzTOnmvGagO9v/rOjjA0HmhJ+/6KAXrmYDCI= +cloud.google.com/go/artifactregistry v1.13.0/go.mod h1:uy/LNfoOIivepGhooAUpL1i30Hgee3Cu0l4VTWHUC08= +cloud.google.com/go/asset v1.5.0/go.mod h1:5mfs8UvcM5wHhqtSv8J1CtxxaQq3AdBxxQi2jGW/K4o= +cloud.google.com/go/asset v1.7.0/go.mod h1:YbENsRK4+xTiL+Ofoj5Ckf+O17kJtgp3Y3nn4uzZz5s= +cloud.google.com/go/asset v1.8.0/go.mod h1:mUNGKhiqIdbr8X7KNayoYvyc4HbbFO9URsjbytpUaW0= +cloud.google.com/go/asset v1.9.0/go.mod h1:83MOE6jEJBMqFKadM9NLRcs80Gdw76qGuHn8m3h8oHQ= +cloud.google.com/go/asset v1.10.0/go.mod h1:pLz7uokL80qKhzKr4xXGvBQXnzHn5evJAEAtZiIb0wY= +cloud.google.com/go/asset v1.11.1/go.mod h1:fSwLhbRvC9p9CXQHJ3BgFeQNM4c9x10lqlrdEUYXlJo= +cloud.google.com/go/asset v1.12.0/go.mod h1:h9/sFOa4eDIyKmH6QMpm4eUK3pDojWnUhTgJlk762Hg= +cloud.google.com/go/asset v1.13.0/go.mod h1:WQAMyYek/b7NBpYq/K4KJWcRqzoalEsxz/t/dTk4THw= +cloud.google.com/go/assuredworkloads v1.5.0/go.mod h1:n8HOZ6pff6re5KYfBXcFvSViQjDwxFkAkmUFffJRbbY= +cloud.google.com/go/assuredworkloads v1.6.0/go.mod h1:yo2YOk37Yc89Rsd5QMVECvjaMKymF9OP+QXWlKXUkXw= +cloud.google.com/go/assuredworkloads v1.7.0/go.mod h1:z/736/oNmtGAyU47reJgGN+KVoYoxeLBoj4XkKYscNI= +cloud.google.com/go/assuredworkloads v1.8.0/go.mod h1:AsX2cqyNCOvEQC8RMPnoc0yEarXQk6WEKkxYfL6kGIo= +cloud.google.com/go/assuredworkloads v1.9.0/go.mod h1:kFuI1P78bplYtT77Tb1hi0FMxM0vVpRC7VVoJC3ZoT0= +cloud.google.com/go/assuredworkloads v1.10.0/go.mod h1:kwdUQuXcedVdsIaKgKTp9t0UJkE5+PAVNhdQm4ZVq2E= +cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0= +cloud.google.com/go/automl v1.6.0/go.mod h1:ugf8a6Fx+zP0D59WLhqgTDsQI9w07o64uf/Is3Nh5p8= +cloud.google.com/go/automl v1.7.0/go.mod h1:RL9MYCCsJEOmt0Wf3z9uzG0a7adTT1fe+aObgSpkCt8= +cloud.google.com/go/automl v1.8.0/go.mod h1:xWx7G/aPEe/NP+qzYXktoBSDfjO+vnKMGgsApGJJquM= +cloud.google.com/go/automl v1.12.0/go.mod h1:tWDcHDp86aMIuHmyvjuKeeHEGq76lD7ZqfGLN6B0NuU= +cloud.google.com/go/baremetalsolution v0.3.0/go.mod h1:XOrocE+pvK1xFfleEnShBlNAXf+j5blPPxrhjKgnIFc= +cloud.google.com/go/baremetalsolution v0.4.0/go.mod h1:BymplhAadOO/eBa7KewQ0Ppg4A4Wplbn+PsFKRLo0uI= +cloud.google.com/go/baremetalsolution v0.5.0/go.mod h1:dXGxEkmR9BMwxhzBhV0AioD0ULBmuLZI8CdwalUxuss= +cloud.google.com/go/batch v0.3.0/go.mod h1:TR18ZoAekj1GuirsUsR1ZTKN3FC/4UDnScjT8NXImFE= +cloud.google.com/go/batch v0.4.0/go.mod h1:WZkHnP43R/QCGQsZ+0JyG4i79ranE2u8xvjq/9+STPE= +cloud.google.com/go/batch v0.7.0/go.mod h1:vLZN95s6teRUqRQ4s3RLDsH8PvboqBK+rn1oevL159g= +cloud.google.com/go/beyondcorp v0.2.0/go.mod h1:TB7Bd+EEtcw9PCPQhCJtJGjk/7TC6ckmnSFS+xwTfm4= +cloud.google.com/go/beyondcorp v0.3.0/go.mod h1:E5U5lcrcXMsCuoDNyGrpyTm/hn7ne941Jz2vmksAxW8= +cloud.google.com/go/beyondcorp v0.4.0/go.mod h1:3ApA0mbhHx6YImmuubf5pyW8srKnCEPON32/5hj+RmM= +cloud.google.com/go/beyondcorp v0.5.0/go.mod h1:uFqj9X+dSfrheVp7ssLTaRHd2EHqSL4QZmH4e8WXGGU= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/bigquery v1.42.0/go.mod h1:8dRTJxhtG+vwBKzE5OseQn/hiydoQN3EedCaOdYmxRA= +cloud.google.com/go/bigquery v1.43.0/go.mod h1:ZMQcXHsl+xmU1z36G2jNGZmKp9zNY5BUua5wDgmNCfw= +cloud.google.com/go/bigquery v1.44.0/go.mod h1:0Y33VqXTEsbamHJvJHdFmtqHvMIY28aK1+dFsvaChGc= +cloud.google.com/go/bigquery v1.47.0/go.mod h1:sA9XOgy0A8vQK9+MWhEQTY6Tix87M/ZurWFIxmF9I/E= +cloud.google.com/go/bigquery v1.48.0/go.mod h1:QAwSz+ipNgfL5jxiaK7weyOhzdoAy1zFm0Nf1fysJac= +cloud.google.com/go/bigquery v1.49.0/go.mod h1:Sv8hMmTFFYBlt/ftw2uN6dFdQPzBlREY9yBh7Oy7/4Q= +cloud.google.com/go/bigquery v1.50.0/go.mod h1:YrleYEh2pSEbgTBZYMJ5SuSr0ML3ypjRB1zgf7pvQLU= +cloud.google.com/go/billing v1.4.0/go.mod h1:g9IdKBEFlItS8bTtlrZdVLWSSdSyFUZKXNS02zKMOZY= +cloud.google.com/go/billing v1.5.0/go.mod h1:mztb1tBc3QekhjSgmpf/CV4LzWXLzCArwpLmP2Gm88s= +cloud.google.com/go/billing v1.6.0/go.mod h1:WoXzguj+BeHXPbKfNWkqVtDdzORazmCjraY+vrxcyvI= +cloud.google.com/go/billing v1.7.0/go.mod h1:q457N3Hbj9lYwwRbnlD7vUpyjq6u5U1RAOArInEiD5Y= +cloud.google.com/go/billing v1.12.0/go.mod h1:yKrZio/eu+okO/2McZEbch17O5CB5NpZhhXG6Z766ss= +cloud.google.com/go/billing v1.13.0/go.mod h1:7kB2W9Xf98hP9Sr12KfECgfGclsH3CQR0R08tnRlRbc= +cloud.google.com/go/binaryauthorization v1.1.0/go.mod h1:xwnoWu3Y84jbuHa0zd526MJYmtnVXn0syOjaJgy4+dM= +cloud.google.com/go/binaryauthorization v1.2.0/go.mod h1:86WKkJHtRcv5ViNABtYMhhNWRrD1Vpi//uKEy7aYEfI= +cloud.google.com/go/binaryauthorization v1.3.0/go.mod h1:lRZbKgjDIIQvzYQS1p99A7/U1JqvqeZg0wiI5tp6tg0= +cloud.google.com/go/binaryauthorization v1.4.0/go.mod h1:tsSPQrBd77VLplV70GUhBf/Zm3FsKmgSqgm4UmiDItk= +cloud.google.com/go/binaryauthorization v1.5.0/go.mod h1:OSe4OU1nN/VswXKRBmciKpo9LulY41gch5c68htf3/Q= +cloud.google.com/go/certificatemanager v1.3.0/go.mod h1:n6twGDvcUBFu9uBgt4eYvvf3sQ6My8jADcOVwHmzadg= +cloud.google.com/go/certificatemanager v1.4.0/go.mod h1:vowpercVFyqs8ABSmrdV+GiFf2H/ch3KyudYQEMM590= +cloud.google.com/go/certificatemanager v1.6.0/go.mod h1:3Hh64rCKjRAX8dXgRAyOcY5vQ/fE1sh8o+Mdd6KPgY8= +cloud.google.com/go/channel v1.8.0/go.mod h1:W5SwCXDJsq/rg3tn3oG0LOxpAo6IMxNa09ngphpSlnk= +cloud.google.com/go/channel v1.9.0/go.mod h1:jcu05W0my9Vx4mt3/rEHpfxc9eKi9XwsdDL8yBMbKUk= +cloud.google.com/go/channel v1.11.0/go.mod h1:IdtI0uWGqhEeatSB62VOoJ8FSUhJ9/+iGkJVqp74CGE= +cloud.google.com/go/channel v1.12.0/go.mod h1:VkxCGKASi4Cq7TbXxlaBezonAYpp1GCnKMY6tnMQnLU= +cloud.google.com/go/cloudbuild v1.3.0/go.mod h1:WequR4ULxlqvMsjDEEEFnOG5ZSRSgWOywXYDb1vPE6U= +cloud.google.com/go/cloudbuild v1.4.0/go.mod h1:5Qwa40LHiOXmz3386FrjrYM93rM/hdRr7b53sySrTqA= +cloud.google.com/go/cloudbuild v1.6.0/go.mod h1:UIbc/w9QCbH12xX+ezUsgblrWv+Cv4Tw83GiSMHOn9M= +cloud.google.com/go/cloudbuild v1.7.0/go.mod h1:zb5tWh2XI6lR9zQmsm1VRA+7OCuve5d8S+zJUul8KTg= +cloud.google.com/go/cloudbuild v1.9.0/go.mod h1:qK1d7s4QlO0VwfYn5YuClDGg2hfmLZEb4wQGAbIgL1s= +cloud.google.com/go/clouddms v1.3.0/go.mod h1:oK6XsCDdW4Ib3jCCBugx+gVjevp2TMXFtgxvPSee3OM= +cloud.google.com/go/clouddms v1.4.0/go.mod h1:Eh7sUGCC+aKry14O1NRljhjyrr0NFC0G2cjwX0cByRk= +cloud.google.com/go/clouddms v1.5.0/go.mod h1:QSxQnhikCLUw13iAbffF2CZxAER3xDGNHjsTAkQJcQA= +cloud.google.com/go/cloudtasks v1.5.0/go.mod h1:fD92REy1x5woxkKEkLdvavGnPJGEn8Uic9nWuLzqCpY= +cloud.google.com/go/cloudtasks v1.6.0/go.mod h1:C6Io+sxuke9/KNRkbQpihnW93SWDU3uXt92nu85HkYI= +cloud.google.com/go/cloudtasks v1.7.0/go.mod h1:ImsfdYWwlWNJbdgPIIGJWC+gemEGTBK/SunNQQNCAb4= +cloud.google.com/go/cloudtasks v1.8.0/go.mod h1:gQXUIwCSOI4yPVK7DgTVFiiP0ZW/eQkydWzwVMdHxrI= +cloud.google.com/go/cloudtasks v1.9.0/go.mod h1:w+EyLsVkLWHcOaqNEyvcKAsWp9p29dL6uL9Nst1cI7Y= +cloud.google.com/go/cloudtasks v1.10.0/go.mod h1:NDSoTLkZ3+vExFEWu2UJV1arUyzVDAiZtdWcsUyNwBs= +cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= +cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= +cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= +cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= +cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= +cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= +cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= +cloud.google.com/go/compute v1.12.0/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= +cloud.google.com/go/compute v1.12.1/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= +cloud.google.com/go/compute v1.13.0/go.mod h1:5aPTS0cUNMIc1CE546K+Th6weJUNQErARyZtRXDJ8GE= +cloud.google.com/go/compute v1.14.0/go.mod h1:YfLtxrj9sU4Yxv+sXzZkyPjEyPBZfXHUvjxega5vAdo= +cloud.google.com/go/compute v1.15.1/go.mod h1:bjjoF/NtFUrkD/urWfdHaKuOPDR5nWIs63rR+SXhcpA= +cloud.google.com/go/compute v1.18.0/go.mod h1:1X7yHxec2Ga+Ss6jPyjxRxpu2uu7PLgsOVXvgU0yacs= +cloud.google.com/go/compute v1.19.0/go.mod h1:rikpw2y+UMidAe9tISo04EHNOIf42RLYF/q8Bs93scU= +cloud.google.com/go/compute v1.19.3/go.mod h1:qxvISKp/gYnXkSAD1ppcSOveRAmzxicEv/JlizULFrI= +cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= +cloud.google.com/go/compute/metadata v0.1.0/go.mod h1:Z1VN+bulIf6bt4P/C37K4DyZYZEXYonfTBHHFPO/4UU= cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= +cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +cloud.google.com/go/contactcenterinsights v1.3.0/go.mod h1:Eu2oemoePuEFc/xKFPjbTuPSj0fYJcPls9TFlPNnHHY= +cloud.google.com/go/contactcenterinsights v1.4.0/go.mod h1:L2YzkGbPsv+vMQMCADxJoT9YiTTnSEd6fEvCeHTYVck= +cloud.google.com/go/contactcenterinsights v1.6.0/go.mod h1:IIDlT6CLcDoyv79kDv8iWxMSTZhLxSCofVV5W6YFM/w= +cloud.google.com/go/container v1.6.0/go.mod h1:Xazp7GjJSeUYo688S+6J5V+n/t+G5sKBTFkKNudGRxg= +cloud.google.com/go/container v1.7.0/go.mod h1:Dp5AHtmothHGX3DwwIHPgq45Y8KmNsgN3amoYfxVkLo= +cloud.google.com/go/container v1.13.1/go.mod h1:6wgbMPeQRw9rSnKBCAJXnds3Pzj03C4JHamr8asWKy4= +cloud.google.com/go/container v1.14.0/go.mod h1:3AoJMPhHfLDxLvrlVWaK57IXzaPnLaZq63WX59aQBfM= +cloud.google.com/go/container v1.15.0/go.mod h1:ft+9S0WGjAyjDggg5S06DXj+fHJICWg8L7isCQe9pQA= +cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= +cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= +cloud.google.com/go/containeranalysis v0.7.0/go.mod h1:9aUL+/vZ55P2CXfuZjS4UjQ9AgXoSw8Ts6lemfmxBxI= +cloud.google.com/go/containeranalysis v0.9.0/go.mod h1:orbOANbwk5Ejoom+s+DUCTTJ7IBdBQJDcSylAx/on9s= +cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= +cloud.google.com/go/datacatalog v1.5.0/go.mod h1:M7GPLNQeLfWqeIm3iuiruhPzkt65+Bx8dAKvScX8jvs= +cloud.google.com/go/datacatalog v1.6.0/go.mod h1:+aEyF8JKg+uXcIdAmmaMUmZ3q1b/lKLtXCmXdnc0lbc= +cloud.google.com/go/datacatalog v1.7.0/go.mod h1:9mEl4AuDYWw81UGc41HonIHH7/sn52H0/tc8f8ZbZIE= +cloud.google.com/go/datacatalog v1.8.0/go.mod h1:KYuoVOv9BM8EYz/4eMFxrr4DUKhGIOXxZoKYF5wdISM= +cloud.google.com/go/datacatalog v1.8.1/go.mod h1:RJ58z4rMp3gvETA465Vg+ag8BGgBdnRPEMMSTr5Uv+M= +cloud.google.com/go/datacatalog v1.12.0/go.mod h1:CWae8rFkfp6LzLumKOnmVh4+Zle4A3NXLzVJ1d1mRm0= +cloud.google.com/go/datacatalog v1.13.0/go.mod h1:E4Rj9a5ZtAxcQJlEBTLgMTphfP11/lNaAshpoBgemX8= +cloud.google.com/go/dataflow v0.6.0/go.mod h1:9QwV89cGoxjjSR9/r7eFDqqjtvbKxAK2BaYU6PVk9UM= +cloud.google.com/go/dataflow v0.7.0/go.mod h1:PX526vb4ijFMesO1o202EaUmouZKBpjHsTlCtB4parQ= +cloud.google.com/go/dataflow v0.8.0/go.mod h1:Rcf5YgTKPtQyYz8bLYhFoIV/vP39eL7fWNcSOyFfLJE= +cloud.google.com/go/dataform v0.3.0/go.mod h1:cj8uNliRlHpa6L3yVhDOBrUXH+BPAO1+KFMQQNSThKo= +cloud.google.com/go/dataform v0.4.0/go.mod h1:fwV6Y4Ty2yIFL89huYlEkwUPtS7YZinZbzzj5S9FzCE= +cloud.google.com/go/dataform v0.5.0/go.mod h1:GFUYRe8IBa2hcomWplodVmUx/iTL0FrsauObOM3Ipr0= +cloud.google.com/go/dataform v0.6.0/go.mod h1:QPflImQy33e29VuapFdf19oPbE4aYTJxr31OAPV+ulA= +cloud.google.com/go/dataform v0.7.0/go.mod h1:7NulqnVozfHvWUBpMDfKMUESr+85aJsC/2O0o3jWPDE= +cloud.google.com/go/datafusion v1.4.0/go.mod h1:1Zb6VN+W6ALo85cXnM1IKiPw+yQMKMhB9TsTSRDo/38= +cloud.google.com/go/datafusion v1.5.0/go.mod h1:Kz+l1FGHB0J+4XF2fud96WMmRiq/wj8N9u007vyXZ2w= +cloud.google.com/go/datafusion v1.6.0/go.mod h1:WBsMF8F1RhSXvVM8rCV3AeyWVxcC2xY6vith3iw3S+8= +cloud.google.com/go/datalabeling v0.5.0/go.mod h1:TGcJ0G2NzcsXSE/97yWjIZO0bXj0KbVlINXMG9ud42I= +cloud.google.com/go/datalabeling v0.6.0/go.mod h1:WqdISuk/+WIGeMkpw/1q7bK/tFEZxsrFJOJdY2bXvTQ= +cloud.google.com/go/datalabeling v0.7.0/go.mod h1:WPQb1y08RJbmpM3ww0CSUAGweL0SxByuW2E+FU+wXcM= +cloud.google.com/go/dataplex v1.3.0/go.mod h1:hQuRtDg+fCiFgC8j0zV222HvzFQdRd+SVX8gdmFcZzA= +cloud.google.com/go/dataplex v1.4.0/go.mod h1:X51GfLXEMVJ6UN47ESVqvlsRplbLhcsAt0kZCCKsU0A= +cloud.google.com/go/dataplex v1.5.2/go.mod h1:cVMgQHsmfRoI5KFYq4JtIBEUbYwc3c7tXmIDhRmNNVQ= +cloud.google.com/go/dataplex v1.6.0/go.mod h1:bMsomC/aEJOSpHXdFKFGQ1b0TDPIeL28nJObeO1ppRs= +cloud.google.com/go/dataproc v1.7.0/go.mod h1:CKAlMjII9H90RXaMpSxQ8EU6dQx6iAYNPcYPOkSbi8s= +cloud.google.com/go/dataproc v1.8.0/go.mod h1:5OW+zNAH0pMpw14JVrPONsxMQYMBqJuzORhIBfBn9uI= +cloud.google.com/go/dataproc v1.12.0/go.mod h1:zrF3aX0uV3ikkMz6z4uBbIKyhRITnxvr4i3IjKsKrw4= +cloud.google.com/go/dataqna v0.5.0/go.mod h1:90Hyk596ft3zUQ8NkFfvICSIfHFh1Bc7C4cK3vbhkeo= +cloud.google.com/go/dataqna v0.6.0/go.mod h1:1lqNpM7rqNLVgWBJyk5NF6Uen2PHym0jtVJonplVsDA= +cloud.google.com/go/dataqna v0.7.0/go.mod h1:Lx9OcIIeqCrw1a6KdO3/5KMP1wAmTc0slZWwP12Qq3c= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/datastore v1.10.0/go.mod h1:PC5UzAmDEkAmkfaknstTYbNpgE49HAgW2J1gcgUfmdM= +cloud.google.com/go/datastore v1.11.0/go.mod h1:TvGxBIHCS50u8jzG+AW/ppf87v1of8nwzFNgEZU1D3c= +cloud.google.com/go/datastream v1.2.0/go.mod h1:i/uTP8/fZwgATHS/XFu0TcNUhuA0twZxxQ3EyCUQMwo= +cloud.google.com/go/datastream v1.3.0/go.mod h1:cqlOX8xlyYF/uxhiKn6Hbv6WjwPPuI9W2M9SAXwaLLQ= +cloud.google.com/go/datastream v1.4.0/go.mod h1:h9dpzScPhDTs5noEMQVWP8Wx8AFBRyS0s8KWPx/9r0g= +cloud.google.com/go/datastream v1.5.0/go.mod h1:6TZMMNPwjUqZHBKPQ1wwXpb0d5VDVPl2/XoS5yi88q4= +cloud.google.com/go/datastream v1.6.0/go.mod h1:6LQSuswqLa7S4rPAOZFVjHIG3wJIjZcZrw8JDEDJuIs= +cloud.google.com/go/datastream v1.7.0/go.mod h1:uxVRMm2elUSPuh65IbZpzJNMbuzkcvu5CjMqVIUHrww= +cloud.google.com/go/deploy v1.4.0/go.mod h1:5Xghikd4VrmMLNaF6FiRFDlHb59VM59YoDQnOUdsH/c= +cloud.google.com/go/deploy v1.5.0/go.mod h1:ffgdD0B89tToyW/U/D2eL0jN2+IEV/3EMuXHA0l4r+s= +cloud.google.com/go/deploy v1.6.0/go.mod h1:f9PTHehG/DjCom3QH0cntOVRm93uGBDt2vKzAPwpXQI= +cloud.google.com/go/deploy v1.8.0/go.mod h1:z3myEJnA/2wnB4sgjqdMfgxCA0EqC3RBTNcVPs93mtQ= +cloud.google.com/go/dialogflow v1.15.0/go.mod h1:HbHDWs33WOGJgn6rfzBW1Kv807BE3O1+xGbn59zZWI4= +cloud.google.com/go/dialogflow v1.16.1/go.mod h1:po6LlzGfK+smoSmTBnbkIZY2w8ffjz/RcGSS+sh1el0= +cloud.google.com/go/dialogflow v1.17.0/go.mod h1:YNP09C/kXA1aZdBgC/VtXX74G/TKn7XVCcVumTflA+8= +cloud.google.com/go/dialogflow v1.18.0/go.mod h1:trO7Zu5YdyEuR+BhSNOqJezyFQ3aUzz0njv7sMx/iek= +cloud.google.com/go/dialogflow v1.19.0/go.mod h1:JVmlG1TwykZDtxtTXujec4tQ+D8SBFMoosgy+6Gn0s0= +cloud.google.com/go/dialogflow v1.29.0/go.mod h1:b+2bzMe+k1s9V+F2jbJwpHPzrnIyHihAdRFMtn2WXuM= +cloud.google.com/go/dialogflow v1.31.0/go.mod h1:cuoUccuL1Z+HADhyIA7dci3N5zUssgpBJmCzI6fNRB4= +cloud.google.com/go/dialogflow v1.32.0/go.mod h1:jG9TRJl8CKrDhMEcvfcfFkkpp8ZhgPz3sBGmAUYJ2qE= +cloud.google.com/go/dlp v1.6.0/go.mod h1:9eyB2xIhpU0sVwUixfBubDoRwP+GjeUoxxeueZmqvmM= +cloud.google.com/go/dlp v1.7.0/go.mod h1:68ak9vCiMBjbasxeVD17hVPxDEck+ExiHavX8kiHG+Q= +cloud.google.com/go/dlp v1.9.0/go.mod h1:qdgmqgTyReTz5/YNSSuueR8pl7hO0o9bQ39ZhtgkWp4= +cloud.google.com/go/documentai v1.7.0/go.mod h1:lJvftZB5NRiFSX4moiye1SMxHx0Bc3x1+p9e/RfXYiU= +cloud.google.com/go/documentai v1.8.0/go.mod h1:xGHNEB7CtsnySCNrCFdCyyMz44RhFEEX2Q7UD0c5IhU= +cloud.google.com/go/documentai v1.9.0/go.mod h1:FS5485S8R00U10GhgBC0aNGrJxBP8ZVpEeJ7PQDZd6k= +cloud.google.com/go/documentai v1.10.0/go.mod h1:vod47hKQIPeCfN2QS/jULIvQTugbmdc0ZvxxfQY1bg4= +cloud.google.com/go/documentai v1.16.0/go.mod h1:o0o0DLTEZ+YnJZ+J4wNfTxmDVyrkzFvttBXXtYRMHkM= +cloud.google.com/go/documentai v1.18.0/go.mod h1:F6CK6iUH8J81FehpskRmhLq/3VlwQvb7TvwOceQ2tbs= +cloud.google.com/go/domains v0.6.0/go.mod h1:T9Rz3GasrpYk6mEGHh4rymIhjlnIuB4ofT1wTxDeT4Y= +cloud.google.com/go/domains v0.7.0/go.mod h1:PtZeqS1xjnXuRPKE/88Iru/LdfoRyEHYA9nFQf4UKpg= +cloud.google.com/go/domains v0.8.0/go.mod h1:M9i3MMDzGFXsydri9/vW+EWz9sWb4I6WyHqdlAk0idE= +cloud.google.com/go/edgecontainer v0.1.0/go.mod h1:WgkZ9tp10bFxqO8BLPqv2LlfmQF1X8lZqwW4r1BTajk= +cloud.google.com/go/edgecontainer v0.2.0/go.mod h1:RTmLijy+lGpQ7BXuTDa4C4ssxyXT34NIuHIgKuP4s5w= +cloud.google.com/go/edgecontainer v0.3.0/go.mod h1:FLDpP4nykgwwIfcLt6zInhprzw0lEi2P1fjO6Ie0qbc= +cloud.google.com/go/edgecontainer v1.0.0/go.mod h1:cttArqZpBB2q58W/upSG++ooo6EsblxDIolxa3jSjbY= +cloud.google.com/go/errorreporting v0.3.0/go.mod h1:xsP2yaAp+OAW4OIm60An2bbLpqIhKXdWR/tawvl7QzU= +cloud.google.com/go/essentialcontacts v1.3.0/go.mod h1:r+OnHa5jfj90qIfZDO/VztSFqbQan7HV75p8sA+mdGI= +cloud.google.com/go/essentialcontacts v1.4.0/go.mod h1:8tRldvHYsmnBCHdFpvU+GL75oWiBKl80BiqlFh9tp+8= +cloud.google.com/go/essentialcontacts v1.5.0/go.mod h1:ay29Z4zODTuwliK7SnX8E86aUF2CTzdNtvv42niCX0M= +cloud.google.com/go/eventarc v1.7.0/go.mod h1:6ctpF3zTnaQCxUjHUdcfgcA1A2T309+omHZth7gDfmc= +cloud.google.com/go/eventarc v1.8.0/go.mod h1:imbzxkyAU4ubfsaKYdQg04WS1NvncblHEup4kvF+4gw= +cloud.google.com/go/eventarc v1.10.0/go.mod h1:u3R35tmZ9HvswGRBnF48IlYgYeBcPUCjkr4BTdem2Kw= +cloud.google.com/go/eventarc v1.11.0/go.mod h1:PyUjsUKPWoRBCHeOxZd/lbOOjahV41icXyUY5kSTvVY= +cloud.google.com/go/filestore v1.3.0/go.mod h1:+qbvHGvXU1HaKX2nD0WEPo92TP/8AQuCVEBXNY9z0+w= +cloud.google.com/go/filestore v1.4.0/go.mod h1:PaG5oDfo9r224f8OYXURtAsY+Fbyq/bLYoINEK8XQAI= +cloud.google.com/go/filestore v1.5.0/go.mod h1:FqBXDWBp4YLHqRnVGveOkHDf8svj9r5+mUDLupOWEDs= +cloud.google.com/go/filestore v1.6.0/go.mod h1:di5unNuss/qfZTw2U9nhFqo8/ZDSc466dre85Kydllg= +cloud.google.com/go/firestore v1.9.0/go.mod h1:HMkjKHNTtRyZNiMzu7YAsLr9K3X2udY2AMwDaMEQiiE= +cloud.google.com/go/functions v1.6.0/go.mod h1:3H1UA3qiIPRWD7PeZKLvHZ9SaQhR26XIJcC0A5GbvAk= +cloud.google.com/go/functions v1.7.0/go.mod h1:+d+QBcWM+RsrgZfV9xo6KfA1GlzJfxcfZcRPEhDDfzg= +cloud.google.com/go/functions v1.8.0/go.mod h1:RTZ4/HsQjIqIYP9a9YPbU+QFoQsAlYgrwOXJWHn1POY= +cloud.google.com/go/functions v1.9.0/go.mod h1:Y+Dz8yGguzO3PpIjhLTbnqV1CWmgQ5UwtlpzoyquQ08= +cloud.google.com/go/functions v1.10.0/go.mod h1:0D3hEOe3DbEvCXtYOZHQZmD+SzYsi1YbI7dGvHfldXw= +cloud.google.com/go/functions v1.12.0/go.mod h1:AXWGrF3e2C/5ehvwYo/GH6O5s09tOPksiKhz+hH8WkA= +cloud.google.com/go/functions v1.13.0/go.mod h1:EU4O007sQm6Ef/PwRsI8N2umygGqPBS/IZQKBQBcJ3c= +cloud.google.com/go/gaming v1.5.0/go.mod h1:ol7rGcxP/qHTRQE/RO4bxkXq+Fix0j6D4LFPzYTIrDM= +cloud.google.com/go/gaming v1.6.0/go.mod h1:YMU1GEvA39Qt3zWGyAVA9bpYz/yAhTvaQ1t2sK4KPUA= +cloud.google.com/go/gaming v1.7.0/go.mod h1:LrB8U7MHdGgFG851iHAfqUdLcKBdQ55hzXy9xBJz0+w= +cloud.google.com/go/gaming v1.8.0/go.mod h1:xAqjS8b7jAVW0KFYeRUxngo9My3f33kFmua++Pi+ggM= +cloud.google.com/go/gaming v1.9.0/go.mod h1:Fc7kEmCObylSWLO334NcO+O9QMDyz+TKC4v1D7X+Bc0= +cloud.google.com/go/gkebackup v0.2.0/go.mod h1:XKvv/4LfG829/B8B7xRkk8zRrOEbKtEam6yNfuQNH60= +cloud.google.com/go/gkebackup v0.3.0/go.mod h1:n/E671i1aOQvUxT541aTkCwExO/bTer2HDlj4TsBRAo= +cloud.google.com/go/gkebackup v0.4.0/go.mod h1:byAyBGUwYGEEww7xsbnUTBHIYcOPy/PgUWUtOeRm9Vg= +cloud.google.com/go/gkeconnect v0.5.0/go.mod h1:c5lsNAg5EwAy7fkqX/+goqFsU1Da/jQFqArp+wGNr/o= +cloud.google.com/go/gkeconnect v0.6.0/go.mod h1:Mln67KyU/sHJEBY8kFZ0xTeyPtzbq9StAVvEULYK16A= +cloud.google.com/go/gkeconnect v0.7.0/go.mod h1:SNfmVqPkaEi3bF/B3CNZOAYPYdg7sU+obZ+QTky2Myw= +cloud.google.com/go/gkehub v0.9.0/go.mod h1:WYHN6WG8w9bXU0hqNxt8rm5uxnk8IH+lPY9J2TV7BK0= +cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y977wO+hBH0= +cloud.google.com/go/gkehub v0.11.0/go.mod h1:JOWHlmN+GHyIbuWQPl47/C2RFhnFKH38jH9Ascu3n0E= +cloud.google.com/go/gkehub v0.12.0/go.mod h1:djiIwwzTTBrF5NaXCGv3mf7klpEMcST17VBTVVDcuaw= +cloud.google.com/go/gkemulticloud v0.3.0/go.mod h1:7orzy7O0S+5kq95e4Hpn7RysVA7dPs8W/GgfUtsPbrA= +cloud.google.com/go/gkemulticloud v0.4.0/go.mod h1:E9gxVBnseLWCk24ch+P9+B2CoDFJZTyIgLKSalC7tuI= +cloud.google.com/go/gkemulticloud v0.5.0/go.mod h1:W0JDkiyi3Tqh0TJr//y19wyb1yf8llHVto2Htf2Ja3Y= +cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= +cloud.google.com/go/gsuiteaddons v1.3.0/go.mod h1:EUNK/J1lZEZO8yPtykKxLXI6JSVN2rg9bN8SXOa0bgM= +cloud.google.com/go/gsuiteaddons v1.4.0/go.mod h1:rZK5I8hht7u7HxFQcFei0+AtfS9uSushomRlg+3ua1o= +cloud.google.com/go/gsuiteaddons v1.5.0/go.mod h1:TFCClYLd64Eaa12sFVmUyG62tk4mdIsI7pAnSXRkcFo= +cloud.google.com/go/iam v0.1.0/go.mod h1:vcUNEa0pEm0qRVpmWepWaFMIAI8/hjB9mO8rNCJtF6c= +cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= +cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= +cloud.google.com/go/iam v0.6.0/go.mod h1:+1AH33ueBne5MzYccyMHtEKqLE4/kJOibtffMHDMFMc= +cloud.google.com/go/iam v0.7.0/go.mod h1:H5Br8wRaDGNc8XP3keLc4unfUUZeyH3Sfl9XpQEYOeg= +cloud.google.com/go/iam v0.8.0/go.mod h1:lga0/y3iH6CX7sYqypWJ33hf7kkfXJag67naqGESjkE= +cloud.google.com/go/iam v0.11.0/go.mod h1:9PiLDanza5D+oWFZiH1uG+RnRCfEGKoyl6yo4cgWZGY= +cloud.google.com/go/iam v0.12.0/go.mod h1:knyHGviacl11zrtZUoDuYpDgLjvr28sLQaG0YB2GYAY= +cloud.google.com/go/iam v0.13.0/go.mod h1:ljOg+rcNfzZ5d6f1nAUJ8ZIxOaZUVoS14bKCtaLZ/D0= +cloud.google.com/go/iap v1.4.0/go.mod h1:RGFwRJdihTINIe4wZ2iCP0zF/qu18ZwyKxrhMhygBEc= +cloud.google.com/go/iap v1.5.0/go.mod h1:UH/CGgKd4KyohZL5Pt0jSKE4m3FR51qg6FKQ/z/Ix9A= +cloud.google.com/go/iap v1.6.0/go.mod h1:NSuvI9C/j7UdjGjIde7t7HBz+QTwBcapPE07+sSRcLk= +cloud.google.com/go/iap v1.7.0/go.mod h1:beqQx56T9O1G1yNPph+spKpNibDlYIiIixiqsQXxLIo= +cloud.google.com/go/iap v1.7.1/go.mod h1:WapEwPc7ZxGt2jFGB/C/bm+hP0Y6NXzOYGjpPnmMS74= +cloud.google.com/go/ids v1.1.0/go.mod h1:WIuwCaYVOzHIj2OhN9HAwvW+DBdmUAdcWlFxRl+KubM= +cloud.google.com/go/ids v1.2.0/go.mod h1:5WXvp4n25S0rA/mQWAg1YEEBBq6/s+7ml1RDCW1IrcY= +cloud.google.com/go/ids v1.3.0/go.mod h1:JBdTYwANikFKaDP6LtW5JAi4gubs57SVNQjemdt6xV4= +cloud.google.com/go/iot v1.3.0/go.mod h1:r7RGh2B61+B8oz0AGE+J72AhA0G7tdXItODWsaA2oLs= +cloud.google.com/go/iot v1.4.0/go.mod h1:dIDxPOn0UvNDUMD8Ger7FIaTuvMkj+aGk94RPP0iV+g= +cloud.google.com/go/iot v1.5.0/go.mod h1:mpz5259PDl3XJthEmh9+ap0affn/MqNSP4My77Qql9o= +cloud.google.com/go/iot v1.6.0/go.mod h1:IqdAsmE2cTYYNO1Fvjfzo9po179rAtJeVGUvkLN3rLE= +cloud.google.com/go/kms v1.4.0/go.mod h1:fajBHndQ+6ubNw6Ss2sSd+SWvjL26RNo/dr7uxsnnOA= +cloud.google.com/go/kms v1.5.0/go.mod h1:QJS2YY0eJGBg3mnDfuaCyLauWwBJiHRboYxJ++1xJNg= +cloud.google.com/go/kms v1.6.0/go.mod h1:Jjy850yySiasBUDi6KFUwUv2n1+o7QZFyuUJg6OgjA0= +cloud.google.com/go/kms v1.8.0/go.mod h1:4xFEhYFqvW+4VMELtZyxomGSYtSQKzM178ylFW4jMAg= +cloud.google.com/go/kms v1.9.0/go.mod h1:qb1tPTgfF9RQP8e1wq4cLFErVuTJv7UsSC915J8dh3w= +cloud.google.com/go/kms v1.10.0/go.mod h1:ng3KTUtQQU9bPX3+QGLsflZIHlkbn8amFAMY63m8d24= +cloud.google.com/go/kms v1.10.1/go.mod h1:rIWk/TryCkR59GMC3YtHtXeLzd634lBbKenvyySAyYI= +cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= +cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= +cloud.google.com/go/language v1.7.0/go.mod h1:DJ6dYN/W+SQOjF8e1hLQXMF21AkH2w9wiPzPCJa2MIE= +cloud.google.com/go/language v1.8.0/go.mod h1:qYPVHf7SPoNNiCL2Dr0FfEFNil1qi3pQEyygwpgVKB8= +cloud.google.com/go/language v1.9.0/go.mod h1:Ns15WooPM5Ad/5no/0n81yUetis74g3zrbeJBE+ptUY= +cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= +cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08= +cloud.google.com/go/lifesciences v0.8.0/go.mod h1:lFxiEOMqII6XggGbOnKiyZ7IBwoIqA84ClvoezaA/bo= +cloud.google.com/go/logging v1.6.1/go.mod h1:5ZO0mHHbvm8gEmeEUHrmDlTDSu5imF6MUP9OfilNXBw= +cloud.google.com/go/logging v1.7.0/go.mod h1:3xjP2CjkM3ZkO73aj4ASA5wRPGGCRrPIAeNqVNkzY8M= +cloud.google.com/go/longrunning v0.1.1/go.mod h1:UUFxuDWkv22EuY93jjmDMFT5GPQKeFVJBIF6QlTqdsE= +cloud.google.com/go/longrunning v0.3.0/go.mod h1:qth9Y41RRSUE69rDcOn6DdK3HfQfsUI0YSmW3iIlLJc= +cloud.google.com/go/longrunning v0.4.1/go.mod h1:4iWDqhBZ70CvZ6BfETbvam3T8FMvLK+eFj0E6AaRQTo= +cloud.google.com/go/managedidentities v1.3.0/go.mod h1:UzlW3cBOiPrzucO5qWkNkh0w33KFtBJU281hacNvsdE= +cloud.google.com/go/managedidentities v1.4.0/go.mod h1:NWSBYbEMgqmbZsLIyKvxrYbtqOsxY1ZrGM+9RgDqInM= +cloud.google.com/go/managedidentities v1.5.0/go.mod h1:+dWcZ0JlUmpuxpIDfyP5pP5y0bLdRwOS4Lp7gMni/LA= +cloud.google.com/go/maps v0.1.0/go.mod h1:BQM97WGyfw9FWEmQMpZ5T6cpovXXSd1cGmFma94eubI= +cloud.google.com/go/maps v0.6.0/go.mod h1:o6DAMMfb+aINHz/p/jbcY+mYeXBoZoxTfdSQ8VAJaCw= +cloud.google.com/go/maps v0.7.0/go.mod h1:3GnvVl3cqeSvgMcpRlQidXsPYuDGQ8naBis7MVzpXsY= +cloud.google.com/go/mediatranslation v0.5.0/go.mod h1:jGPUhGTybqsPQn91pNXw0xVHfuJ3leR1wj37oU3y1f4= +cloud.google.com/go/mediatranslation v0.6.0/go.mod h1:hHdBCTYNigsBxshbznuIMFNe5QXEowAuNmmC7h8pu5w= +cloud.google.com/go/mediatranslation v0.7.0/go.mod h1:LCnB/gZr90ONOIQLgSXagp8XUW1ODs2UmUMvcgMfI2I= +cloud.google.com/go/memcache v1.4.0/go.mod h1:rTOfiGZtJX1AaFUrOgsMHX5kAzaTQ8azHiuDoTPzNsE= +cloud.google.com/go/memcache v1.5.0/go.mod h1:dk3fCK7dVo0cUU2c36jKb4VqKPS22BTkf81Xq617aWM= +cloud.google.com/go/memcache v1.6.0/go.mod h1:XS5xB0eQZdHtTuTF9Hf8eJkKtR3pVRCcvJwtm68T3rA= +cloud.google.com/go/memcache v1.7.0/go.mod h1:ywMKfjWhNtkQTxrWxCkCFkoPjLHPW6A7WOTVI8xy3LY= +cloud.google.com/go/memcache v1.9.0/go.mod h1:8oEyzXCu+zo9RzlEaEjHl4KkgjlNDaXbCQeQWlzNFJM= +cloud.google.com/go/metastore v1.5.0/go.mod h1:2ZNrDcQwghfdtCwJ33nM0+GrBGlVuh8rakL3vdPY3XY= +cloud.google.com/go/metastore v1.6.0/go.mod h1:6cyQTls8CWXzk45G55x57DVQ9gWg7RiH65+YgPsNh9s= +cloud.google.com/go/metastore v1.7.0/go.mod h1:s45D0B4IlsINu87/AsWiEVYbLaIMeUSoxlKKDqBGFS8= +cloud.google.com/go/metastore v1.8.0/go.mod h1:zHiMc4ZUpBiM7twCIFQmJ9JMEkDSyZS9U12uf7wHqSI= +cloud.google.com/go/metastore v1.10.0/go.mod h1:fPEnH3g4JJAk+gMRnrAnoqyv2lpUCqJPWOodSaf45Eo= +cloud.google.com/go/monitoring v1.7.0/go.mod h1:HpYse6kkGo//7p6sT0wsIC6IBDET0RhIsnmlA53dvEk= +cloud.google.com/go/monitoring v1.8.0/go.mod h1:E7PtoMJ1kQXWxPjB6mv2fhC5/15jInuulFdYYtlcvT4= +cloud.google.com/go/monitoring v1.12.0/go.mod h1:yx8Jj2fZNEkL/GYZyTLS4ZtZEZN8WtDEiEqG4kLK50w= +cloud.google.com/go/monitoring v1.13.0/go.mod h1:k2yMBAB1H9JT/QETjNkgdCGD9bPF712XiLTVr+cBrpw= +cloud.google.com/go/networkconnectivity v1.4.0/go.mod h1:nOl7YL8odKyAOtzNX73/M5/mGZgqqMeryi6UPZTk/rA= +cloud.google.com/go/networkconnectivity v1.5.0/go.mod h1:3GzqJx7uhtlM3kln0+x5wyFvuVH1pIBJjhCpjzSt75o= +cloud.google.com/go/networkconnectivity v1.6.0/go.mod h1:OJOoEXW+0LAxHh89nXd64uGG+FbQoeH8DtxCHVOMlaM= +cloud.google.com/go/networkconnectivity v1.7.0/go.mod h1:RMuSbkdbPwNMQjB5HBWD5MpTBnNm39iAVpC3TmsExt8= +cloud.google.com/go/networkconnectivity v1.10.0/go.mod h1:UP4O4sWXJG13AqrTdQCD9TnLGEbtNRqjuaaA7bNjF5E= +cloud.google.com/go/networkconnectivity v1.11.0/go.mod h1:iWmDD4QF16VCDLXUqvyspJjIEtBR/4zq5hwnY2X3scM= +cloud.google.com/go/networkmanagement v1.4.0/go.mod h1:Q9mdLLRn60AsOrPc8rs8iNV6OHXaGcDdsIQe1ohekq8= +cloud.google.com/go/networkmanagement v1.5.0/go.mod h1:ZnOeZ/evzUdUsnvRt792H0uYEnHQEMaz+REhhzJRcf4= +cloud.google.com/go/networkmanagement v1.6.0/go.mod h1:5pKPqyXjB/sgtvB5xqOemumoQNB7y95Q7S+4rjSOPYY= +cloud.google.com/go/networksecurity v0.5.0/go.mod h1:xS6fOCoqpVC5zx15Z/MqkfDwH4+m/61A3ODiDV1xmiQ= +cloud.google.com/go/networksecurity v0.6.0/go.mod h1:Q5fjhTr9WMI5mbpRYEbiexTzROf7ZbDzvzCrNl14nyU= +cloud.google.com/go/networksecurity v0.7.0/go.mod h1:mAnzoxx/8TBSyXEeESMy9OOYwo1v+gZ5eMRnsT5bC8k= +cloud.google.com/go/networksecurity v0.8.0/go.mod h1:B78DkqsxFG5zRSVuwYFRZ9Xz8IcQ5iECsNrPn74hKHU= +cloud.google.com/go/notebooks v1.2.0/go.mod h1:9+wtppMfVPUeJ8fIWPOq1UnATHISkGXGqTkxeieQ6UY= +cloud.google.com/go/notebooks v1.3.0/go.mod h1:bFR5lj07DtCPC7YAAJ//vHskFBxA5JzYlH68kXVdk34= +cloud.google.com/go/notebooks v1.4.0/go.mod h1:4QPMngcwmgb6uw7Po99B2xv5ufVoIQ7nOGDyL4P8AgA= +cloud.google.com/go/notebooks v1.5.0/go.mod h1:q8mwhnP9aR8Hpfnrc5iN5IBhrXUy8S2vuYs+kBJ/gu0= +cloud.google.com/go/notebooks v1.7.0/go.mod h1:PVlaDGfJgj1fl1S3dUwhFMXFgfYGhYQt2164xOMONmE= +cloud.google.com/go/notebooks v1.8.0/go.mod h1:Lq6dYKOYOWUCTvw5t2q1gp1lAp0zxAxRycayS0iJcqQ= +cloud.google.com/go/optimization v1.1.0/go.mod h1:5po+wfvX5AQlPznyVEZjGJTMr4+CAkJf2XSTQOOl9l4= +cloud.google.com/go/optimization v1.2.0/go.mod h1:Lr7SOHdRDENsh+WXVmQhQTrzdu9ybg0NecjHidBq6xs= +cloud.google.com/go/optimization v1.3.1/go.mod h1:IvUSefKiwd1a5p0RgHDbWCIbDFgKuEdB+fPPuP0IDLI= +cloud.google.com/go/orchestration v1.3.0/go.mod h1:Sj5tq/JpWiB//X/q3Ngwdl5K7B7Y0KZ7bfv0wL6fqVA= +cloud.google.com/go/orchestration v1.4.0/go.mod h1:6W5NLFWs2TlniBphAViZEVhrXRSMgUGDfW7vrWKvsBk= +cloud.google.com/go/orchestration v1.6.0/go.mod h1:M62Bevp7pkxStDfFfTuCOaXgaaqRAga1yKyoMtEoWPQ= +cloud.google.com/go/orgpolicy v1.4.0/go.mod h1:xrSLIV4RePWmP9P3tBl8S93lTmlAxjm06NSm2UTmKvE= +cloud.google.com/go/orgpolicy v1.5.0/go.mod h1:hZEc5q3wzwXJaKrsx5+Ewg0u1LxJ51nNFlext7Tanwc= +cloud.google.com/go/orgpolicy v1.10.0/go.mod h1:w1fo8b7rRqlXlIJbVhOMPrwVljyuW5mqssvBtU18ONc= +cloud.google.com/go/osconfig v1.7.0/go.mod h1:oVHeCeZELfJP7XLxcBGTMBvRO+1nQ5tFG9VQTmYS2Fs= +cloud.google.com/go/osconfig v1.8.0/go.mod h1:EQqZLu5w5XA7eKizepumcvWx+m8mJUhEwiPqWiZeEdg= +cloud.google.com/go/osconfig v1.9.0/go.mod h1:Yx+IeIZJ3bdWmzbQU4fxNl8xsZ4amB+dygAwFPlvnNo= +cloud.google.com/go/osconfig v1.10.0/go.mod h1:uMhCzqC5I8zfD9zDEAfvgVhDS8oIjySWh+l4WK6GnWw= +cloud.google.com/go/osconfig v1.11.0/go.mod h1:aDICxrur2ogRd9zY5ytBLV89KEgT2MKB2L/n6x1ooPw= +cloud.google.com/go/oslogin v1.4.0/go.mod h1:YdgMXWRaElXz/lDk1Na6Fh5orF7gvmJ0FGLIs9LId4E= +cloud.google.com/go/oslogin v1.5.0/go.mod h1:D260Qj11W2qx/HVF29zBg+0fd6YCSjSqLUkY/qEenQU= +cloud.google.com/go/oslogin v1.6.0/go.mod h1:zOJ1O3+dTU8WPlGEkFSh7qeHPPSoxrcMbbK1Nm2iX70= +cloud.google.com/go/oslogin v1.7.0/go.mod h1:e04SN0xO1UNJ1M5GP0vzVBFicIe4O53FOfcixIqTyXo= +cloud.google.com/go/oslogin v1.9.0/go.mod h1:HNavntnH8nzrn8JCTT5fj18FuJLFJc4NaZJtBnQtKFs= +cloud.google.com/go/phishingprotection v0.5.0/go.mod h1:Y3HZknsK9bc9dMi+oE8Bim0lczMU6hrX0UpADuMefr0= +cloud.google.com/go/phishingprotection v0.6.0/go.mod h1:9Y3LBLgy0kDTcYET8ZH3bq/7qni15yVUoAxiFxnlSUA= +cloud.google.com/go/phishingprotection v0.7.0/go.mod h1:8qJI4QKHoda/sb/7/YmMQ2omRLSLYSu9bU0EKCNI+Lk= +cloud.google.com/go/policytroubleshooter v1.3.0/go.mod h1:qy0+VwANja+kKrjlQuOzmlvscn4RNsAc0e15GGqfMxg= +cloud.google.com/go/policytroubleshooter v1.4.0/go.mod h1:DZT4BcRw3QoO8ota9xw/LKtPa8lKeCByYeKTIf/vxdE= +cloud.google.com/go/policytroubleshooter v1.5.0/go.mod h1:Rz1WfV+1oIpPdN2VvvuboLVRsB1Hclg3CKQ53j9l8vw= +cloud.google.com/go/policytroubleshooter v1.6.0/go.mod h1:zYqaPTsmfvpjm5ULxAyD/lINQxJ0DDsnWOP/GZ7xzBc= +cloud.google.com/go/privatecatalog v0.5.0/go.mod h1:XgosMUvvPyxDjAVNDYxJ7wBW8//hLDDYmnsNcMGq1K0= +cloud.google.com/go/privatecatalog v0.6.0/go.mod h1:i/fbkZR0hLN29eEWiiwue8Pb+GforiEIBnV9yrRUOKI= +cloud.google.com/go/privatecatalog v0.7.0/go.mod h1:2s5ssIFO69F5csTXcwBP7NPFTZvps26xGzvQ2PQaBYg= +cloud.google.com/go/privatecatalog v0.8.0/go.mod h1:nQ6pfaegeDAq/Q5lrfCQzQLhubPiZhSaNhIgfJlnIXs= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/pubsub v1.26.0/go.mod h1:QgBH3U/jdJy/ftjPhTkyXNj543Tin1pRYcdcPRnFIRI= +cloud.google.com/go/pubsub v1.27.1/go.mod h1:hQN39ymbV9geqBnfQq6Xf63yNhUAhv9CZhzp5O6qsW0= +cloud.google.com/go/pubsub v1.28.0/go.mod h1:vuXFpwaVoIPQMGXqRyUQigu/AX1S3IWugR9xznmcXX8= +cloud.google.com/go/pubsub v1.30.0/go.mod h1:qWi1OPS0B+b5L+Sg6Gmc9zD1Y+HaM0MdUr7LsupY1P4= +cloud.google.com/go/pubsublite v1.5.0/go.mod h1:xapqNQ1CuLfGi23Yda/9l4bBCKz/wC3KIJ5gKcxveZg= +cloud.google.com/go/pubsublite v1.6.0/go.mod h1:1eFCS0U11xlOuMFV/0iBqw3zP12kddMeCbj/F3FSj9k= +cloud.google.com/go/pubsublite v1.7.0/go.mod h1:8hVMwRXfDfvGm3fahVbtDbiLePT3gpoiJYJY+vxWxVM= +cloud.google.com/go/recaptchaenterprise v1.3.1/go.mod h1:OdD+q+y4XGeAlxRaMn1Y7/GveP6zmq76byL6tjPE7d4= +cloud.google.com/go/recaptchaenterprise/v2 v2.1.0/go.mod h1:w9yVqajwroDNTfGuhmOjPDN//rZGySaf6PtFVcSCa7o= +cloud.google.com/go/recaptchaenterprise/v2 v2.2.0/go.mod h1:/Zu5jisWGeERrd5HnlS3EUGb/D335f9k51B/FVil0jk= +cloud.google.com/go/recaptchaenterprise/v2 v2.3.0/go.mod h1:O9LwGCjrhGHBQET5CA7dd5NwwNQUErSgEDit1DLNTdo= +cloud.google.com/go/recaptchaenterprise/v2 v2.4.0/go.mod h1:Am3LHfOuBstrLrNCBrlI5sbwx9LBg3te2N6hGvHn2mE= +cloud.google.com/go/recaptchaenterprise/v2 v2.5.0/go.mod h1:O8LzcHXN3rz0j+LBC91jrwI3R+1ZSZEWrfL7XHgNo9U= +cloud.google.com/go/recaptchaenterprise/v2 v2.6.0/go.mod h1:RPauz9jeLtB3JVzg6nCbe12qNoaa8pXc4d/YukAmcnA= +cloud.google.com/go/recaptchaenterprise/v2 v2.7.0/go.mod h1:19wVj/fs5RtYtynAPJdDTb69oW0vNHYDBTbB4NvMD9c= +cloud.google.com/go/recommendationengine v0.5.0/go.mod h1:E5756pJcVFeVgaQv3WNpImkFP8a+RptV6dDLGPILjvg= +cloud.google.com/go/recommendationengine v0.6.0/go.mod h1:08mq2umu9oIqc7tDy8sx+MNJdLG0fUi3vaSVbztHgJ4= +cloud.google.com/go/recommendationengine v0.7.0/go.mod h1:1reUcE3GIu6MeBz/h5xZJqNLuuVjNg1lmWMPyjatzac= +cloud.google.com/go/recommender v1.5.0/go.mod h1:jdoeiBIVrJe9gQjwd759ecLJbxCDED4A6p+mqoqDvTg= +cloud.google.com/go/recommender v1.6.0/go.mod h1:+yETpm25mcoiECKh9DEScGzIRyDKpZ0cEhWGo+8bo+c= +cloud.google.com/go/recommender v1.7.0/go.mod h1:XLHs/W+T8olwlGOgfQenXBTbIseGclClff6lhFVe9Bs= +cloud.google.com/go/recommender v1.8.0/go.mod h1:PkjXrTT05BFKwxaUxQmtIlrtj0kph108r02ZZQ5FE70= +cloud.google.com/go/recommender v1.9.0/go.mod h1:PnSsnZY7q+VL1uax2JWkt/UegHssxjUVVCrX52CuEmQ= +cloud.google.com/go/redis v1.7.0/go.mod h1:V3x5Jq1jzUcg+UNsRvdmsfuFnit1cfe3Z/PGyq/lm4Y= +cloud.google.com/go/redis v1.8.0/go.mod h1:Fm2szCDavWzBk2cDKxrkmWBqoCiL1+Ctwq7EyqBCA/A= +cloud.google.com/go/redis v1.9.0/go.mod h1:HMYQuajvb2D0LvMgZmLDZW8V5aOC/WxstZHiy4g8OiA= +cloud.google.com/go/redis v1.10.0/go.mod h1:ThJf3mMBQtW18JzGgh41/Wld6vnDDc/F/F35UolRZPM= +cloud.google.com/go/redis v1.11.0/go.mod h1:/X6eicana+BWcUda5PpwZC48o37SiFVTFSs0fWAJ7uQ= +cloud.google.com/go/resourcemanager v1.3.0/go.mod h1:bAtrTjZQFJkiWTPDb1WBjzvc6/kifjj4QBYuKCCoqKA= +cloud.google.com/go/resourcemanager v1.4.0/go.mod h1:MwxuzkumyTX7/a3n37gmsT3py7LIXwrShilPh3P1tR0= +cloud.google.com/go/resourcemanager v1.5.0/go.mod h1:eQoXNAiAvCf5PXxWxXjhKQoTMaUSNrEfg+6qdf/wots= +cloud.google.com/go/resourcemanager v1.6.0/go.mod h1:YcpXGRs8fDzcUl1Xw8uOVmI8JEadvhRIkoXXUNVYcVo= +cloud.google.com/go/resourcemanager v1.7.0/go.mod h1:HlD3m6+bwhzj9XCouqmeiGuni95NTrExfhoSrkC/3EI= +cloud.google.com/go/resourcesettings v1.3.0/go.mod h1:lzew8VfESA5DQ8gdlHwMrqZs1S9V87v3oCnKCWoOuQU= +cloud.google.com/go/resourcesettings v1.4.0/go.mod h1:ldiH9IJpcrlC3VSuCGvjR5of/ezRrOxFtpJoJo5SmXg= +cloud.google.com/go/resourcesettings v1.5.0/go.mod h1:+xJF7QSG6undsQDfsCJyqWXyBwUoJLhetkRMDRnIoXA= +cloud.google.com/go/retail v1.8.0/go.mod h1:QblKS8waDmNUhghY2TI9O3JLlFk8jybHeV4BF19FrE4= +cloud.google.com/go/retail v1.9.0/go.mod h1:g6jb6mKuCS1QKnH/dpu7isX253absFl6iE92nHwlBUY= +cloud.google.com/go/retail v1.10.0/go.mod h1:2gDk9HsL4HMS4oZwz6daui2/jmKvqShXKQuB2RZ+cCc= +cloud.google.com/go/retail v1.11.0/go.mod h1:MBLk1NaWPmh6iVFSz9MeKG/Psyd7TAgm6y/9L2B4x9Y= +cloud.google.com/go/retail v1.12.0/go.mod h1:UMkelN/0Z8XvKymXFbD4EhFJlYKRx1FGhQkVPU5kF14= +cloud.google.com/go/run v0.2.0/go.mod h1:CNtKsTA1sDcnqqIFR3Pb5Tq0usWxJJvsWOCPldRU3Do= +cloud.google.com/go/run v0.3.0/go.mod h1:TuyY1+taHxTjrD0ZFk2iAR+xyOXEA0ztb7U3UNA0zBo= +cloud.google.com/go/run v0.8.0/go.mod h1:VniEnuBwqjigv0A7ONfQUaEItaiCRVujlMqerPPiktM= +cloud.google.com/go/run v0.9.0/go.mod h1:Wwu+/vvg8Y+JUApMwEDfVfhetv30hCG4ZwDR/IXl2Qg= +cloud.google.com/go/scheduler v1.4.0/go.mod h1:drcJBmxF3aqZJRhmkHQ9b3uSSpQoltBPGPxGAWROx6s= +cloud.google.com/go/scheduler v1.5.0/go.mod h1:ri073ym49NW3AfT6DZi21vLZrG07GXr5p3H1KxN5QlI= +cloud.google.com/go/scheduler v1.6.0/go.mod h1:SgeKVM7MIwPn3BqtcBntpLyrIJftQISRrYB5ZtT+KOk= +cloud.google.com/go/scheduler v1.7.0/go.mod h1:jyCiBqWW956uBjjPMMuX09n3x37mtyPJegEWKxRsn44= +cloud.google.com/go/scheduler v1.8.0/go.mod h1:TCET+Y5Gp1YgHT8py4nlg2Sew8nUHMqcpousDgXJVQc= +cloud.google.com/go/scheduler v1.9.0/go.mod h1:yexg5t+KSmqu+njTIh3b7oYPheFtBWGcbVUYF1GGMIc= +cloud.google.com/go/secretmanager v1.6.0/go.mod h1:awVa/OXF6IiyaU1wQ34inzQNc4ISIDIrId8qE5QGgKA= +cloud.google.com/go/secretmanager v1.8.0/go.mod h1:hnVgi/bN5MYHd3Gt0SPuTPPp5ENina1/LxM+2W9U9J4= +cloud.google.com/go/secretmanager v1.9.0/go.mod h1:b71qH2l1yHmWQHt9LC80akm86mX8AL6X1MA01dW8ht4= +cloud.google.com/go/secretmanager v1.10.0/go.mod h1:MfnrdvKMPNra9aZtQFvBcvRU54hbPD8/HayQdlUgJpU= +cloud.google.com/go/security v1.5.0/go.mod h1:lgxGdyOKKjHL4YG3/YwIL2zLqMFCKs0UbQwgyZmfJl4= +cloud.google.com/go/security v1.7.0/go.mod h1:mZklORHl6Bg7CNnnjLH//0UlAlaXqiG7Lb9PsPXLfD0= +cloud.google.com/go/security v1.8.0/go.mod h1:hAQOwgmaHhztFhiQ41CjDODdWP0+AE1B3sX4OFlq+GU= +cloud.google.com/go/security v1.9.0/go.mod h1:6Ta1bO8LXI89nZnmnsZGp9lVoVWXqsVbIq/t9dzI+2Q= +cloud.google.com/go/security v1.10.0/go.mod h1:QtOMZByJVlibUT2h9afNDWRZ1G96gVywH8T5GUSb9IA= +cloud.google.com/go/security v1.12.0/go.mod h1:rV6EhrpbNHrrxqlvW0BWAIawFWq3X90SduMJdFwtLB8= +cloud.google.com/go/security v1.13.0/go.mod h1:Q1Nvxl1PAgmeW0y3HTt54JYIvUdtcpYKVfIB8AOMZ+0= +cloud.google.com/go/securitycenter v1.13.0/go.mod h1:cv5qNAqjY84FCN6Y9z28WlkKXyWsgLO832YiWwkCWcU= +cloud.google.com/go/securitycenter v1.14.0/go.mod h1:gZLAhtyKv85n52XYWt6RmeBdydyxfPeTrpToDPw4Auc= +cloud.google.com/go/securitycenter v1.15.0/go.mod h1:PeKJ0t8MoFmmXLXWm41JidyzI3PJjd8sXWaVqg43WWk= +cloud.google.com/go/securitycenter v1.16.0/go.mod h1:Q9GMaLQFUD+5ZTabrbujNWLtSLZIZF7SAR0wWECrjdk= +cloud.google.com/go/securitycenter v1.18.1/go.mod h1:0/25gAzCM/9OL9vVx4ChPeM/+DlfGQJDwBy/UC8AKK0= +cloud.google.com/go/securitycenter v1.19.0/go.mod h1:LVLmSg8ZkkyaNy4u7HCIshAngSQ8EcIRREP3xBnyfag= +cloud.google.com/go/servicecontrol v1.4.0/go.mod h1:o0hUSJ1TXJAmi/7fLJAedOovnujSEvjKCAFNXPQ1RaU= +cloud.google.com/go/servicecontrol v1.5.0/go.mod h1:qM0CnXHhyqKVuiZnGKrIurvVImCs8gmqWsDoqe9sU1s= +cloud.google.com/go/servicecontrol v1.10.0/go.mod h1:pQvyvSRh7YzUF2efw7H87V92mxU8FnFDawMClGCNuAA= +cloud.google.com/go/servicecontrol v1.11.0/go.mod h1:kFmTzYzTUIuZs0ycVqRHNaNhgR+UMUpw9n02l/pY+mc= +cloud.google.com/go/servicecontrol v1.11.1/go.mod h1:aSnNNlwEFBY+PWGQ2DoM0JJ/QUXqV5/ZD9DOLB7SnUk= +cloud.google.com/go/servicedirectory v1.4.0/go.mod h1:gH1MUaZCgtP7qQiI+F+A+OpeKF/HQWgtAddhTbhL2bs= +cloud.google.com/go/servicedirectory v1.5.0/go.mod h1:QMKFL0NUySbpZJ1UZs3oFAmdvVxhhxB6eJ/Vlp73dfg= +cloud.google.com/go/servicedirectory v1.6.0/go.mod h1:pUlbnWsLH9c13yGkxCmfumWEPjsRs1RlmJ4pqiNjVL4= +cloud.google.com/go/servicedirectory v1.7.0/go.mod h1:5p/U5oyvgYGYejufvxhgwjL8UVXjkuw7q5XcG10wx1U= +cloud.google.com/go/servicedirectory v1.8.0/go.mod h1:srXodfhY1GFIPvltunswqXpVxFPpZjf8nkKQT7XcXaY= +cloud.google.com/go/servicedirectory v1.9.0/go.mod h1:29je5JjiygNYlmsGz8k6o+OZ8vd4f//bQLtvzkPPT/s= +cloud.google.com/go/servicemanagement v1.4.0/go.mod h1:d8t8MDbezI7Z2R1O/wu8oTggo3BI2GKYbdG4y/SJTco= +cloud.google.com/go/servicemanagement v1.5.0/go.mod h1:XGaCRe57kfqu4+lRxaFEAuqmjzF0r+gWHjWqKqBvKFo= +cloud.google.com/go/servicemanagement v1.6.0/go.mod h1:aWns7EeeCOtGEX4OvZUWCCJONRZeFKiptqKf1D0l/Jc= +cloud.google.com/go/servicemanagement v1.8.0/go.mod h1:MSS2TDlIEQD/fzsSGfCdJItQveu9NXnUniTrq/L8LK4= +cloud.google.com/go/serviceusage v1.3.0/go.mod h1:Hya1cozXM4SeSKTAgGXgj97GlqUvF5JaoXacR1JTP/E= +cloud.google.com/go/serviceusage v1.4.0/go.mod h1:SB4yxXSaYVuUBYUml6qklyONXNLt83U0Rb+CXyhjEeU= +cloud.google.com/go/serviceusage v1.5.0/go.mod h1:w8U1JvqUqwJNPEOTQjrMHkw3IaIFLoLsPLvsE3xueec= +cloud.google.com/go/serviceusage v1.6.0/go.mod h1:R5wwQcbOWsyuOfbP9tGdAnCAc6B9DRwPG1xtWMDeuPA= +cloud.google.com/go/shell v1.3.0/go.mod h1:VZ9HmRjZBsjLGXusm7K5Q5lzzByZmJHf1d0IWHEN5X4= +cloud.google.com/go/shell v1.4.0/go.mod h1:HDxPzZf3GkDdhExzD/gs8Grqk+dmYcEjGShZgYa9URw= +cloud.google.com/go/shell v1.6.0/go.mod h1:oHO8QACS90luWgxP3N9iZVuEiSF84zNyLytb+qE2f9A= +cloud.google.com/go/spanner v1.41.0/go.mod h1:MLYDBJR/dY4Wt7ZaMIQ7rXOTLjYrmxLE/5ve9vFfWos= +cloud.google.com/go/spanner v1.44.0/go.mod h1:G8XIgYdOK+Fbcpbs7p2fiprDw4CaZX63whnSMLVBxjk= +cloud.google.com/go/spanner v1.45.0/go.mod h1:FIws5LowYz8YAE1J8fOS7DJup8ff7xJeetWEo5REA2M= +cloud.google.com/go/speech v1.6.0/go.mod h1:79tcr4FHCimOp56lwC01xnt/WPJZc4v3gzyT7FoBkCM= +cloud.google.com/go/speech v1.7.0/go.mod h1:KptqL+BAQIhMsj1kOP2la5DSEEerPDuOP/2mmkhHhZQ= +cloud.google.com/go/speech v1.8.0/go.mod h1:9bYIl1/tjsAnMgKGHKmBZzXKEkGgtU+MpdDPTE9f7y0= +cloud.google.com/go/speech v1.9.0/go.mod h1:xQ0jTcmnRFFM2RfX/U+rk6FQNUF6DQlydUSyoooSpco= +cloud.google.com/go/speech v1.14.1/go.mod h1:gEosVRPJ9waG7zqqnsHpYTOoAS4KouMRLDFMekpJ0J0= +cloud.google.com/go/speech v1.15.0/go.mod h1:y6oH7GhqCaZANH7+Oe0BhgIogsNInLlz542tg3VqeYI= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= +cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= +cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= +cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= +cloud.google.com/go/storage v1.28.1/go.mod h1:Qnisd4CqDdo6BGs2AD5LLnEsmSQ80wQ5ogcBBKhU86Y= +cloud.google.com/go/storage v1.29.0/go.mod h1:4puEjyTKnku6gfKoTfNOU/W+a9JyuVNxjpS5GBrB8h4= +cloud.google.com/go/storagetransfer v1.5.0/go.mod h1:dxNzUopWy7RQevYFHewchb29POFv3/AaBgnhqzqiK0w= +cloud.google.com/go/storagetransfer v1.6.0/go.mod h1:y77xm4CQV/ZhFZH75PLEXY0ROiS7Gh6pSKrM8dJyg6I= +cloud.google.com/go/storagetransfer v1.7.0/go.mod h1:8Giuj1QNb1kfLAiWM1bN6dHzfdlDAVC9rv9abHot2W4= +cloud.google.com/go/storagetransfer v1.8.0/go.mod h1:JpegsHHU1eXg7lMHkvf+KE5XDJ7EQu0GwNJbbVGanEw= +cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= +cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= +cloud.google.com/go/talent v1.3.0/go.mod h1:CmcxwJ/PKfRgd1pBjQgU6W3YBwiewmUzQYH5HHmSCmM= +cloud.google.com/go/talent v1.4.0/go.mod h1:ezFtAgVuRf8jRsvyE6EwmbTK5LKciD4KVnHuDEFmOOA= +cloud.google.com/go/talent v1.5.0/go.mod h1:G+ODMj9bsasAEJkQSzO2uHQWXHHXUomArjWQQYkqK6c= +cloud.google.com/go/texttospeech v1.4.0/go.mod h1:FX8HQHA6sEpJ7rCMSfXuzBcysDAuWusNNNvN9FELDd8= +cloud.google.com/go/texttospeech v1.5.0/go.mod h1:oKPLhR4n4ZdQqWKURdwxMy0uiTS1xU161C8W57Wkea4= +cloud.google.com/go/texttospeech v1.6.0/go.mod h1:YmwmFT8pj1aBblQOI3TfKmwibnsfvhIBzPXcW4EBovc= +cloud.google.com/go/tpu v1.3.0/go.mod h1:aJIManG0o20tfDQlRIej44FcwGGl/cD0oiRyMKG19IQ= +cloud.google.com/go/tpu v1.4.0/go.mod h1:mjZaX8p0VBgllCzF6wcU2ovUXN9TONFLd7iz227X2Xg= +cloud.google.com/go/tpu v1.5.0/go.mod h1:8zVo1rYDFuW2l4yZVY0R0fb/v44xLh3llq7RuV61fPM= +cloud.google.com/go/trace v1.3.0/go.mod h1:FFUE83d9Ca57C+K8rDl/Ih8LwOzWIV1krKgxg6N0G28= +cloud.google.com/go/trace v1.4.0/go.mod h1:UG0v8UBqzusp+z63o7FK74SdFE+AXpCLdFb1rshXG+Y= +cloud.google.com/go/trace v1.8.0/go.mod h1:zH7vcsbAhklH8hWFig58HvxcxyQbaIqMarMg9hn5ECA= +cloud.google.com/go/trace v1.9.0/go.mod h1:lOQqpE5IaWY0Ixg7/r2SjixMuc6lfTFeO4QGM4dQWOk= +cloud.google.com/go/translate v1.3.0/go.mod h1:gzMUwRjvOqj5i69y/LYLd8RrNQk+hOmIXTi9+nb3Djs= +cloud.google.com/go/translate v1.4.0/go.mod h1:06Dn/ppvLD6WvA5Rhdp029IX2Mi3Mn7fpMRLPvXT5Wg= +cloud.google.com/go/translate v1.5.0/go.mod h1:29YDSYveqqpA1CQFD7NQuP49xymq17RXNaUDdc0mNu0= +cloud.google.com/go/translate v1.6.0/go.mod h1:lMGRudH1pu7I3n3PETiOB2507gf3HnfLV8qlkHZEyos= +cloud.google.com/go/translate v1.7.0/go.mod h1:lMGRudH1pu7I3n3PETiOB2507gf3HnfLV8qlkHZEyos= +cloud.google.com/go/video v1.8.0/go.mod h1:sTzKFc0bUSByE8Yoh8X0mn8bMymItVGPfTuUBUyRgxk= +cloud.google.com/go/video v1.9.0/go.mod h1:0RhNKFRF5v92f8dQt0yhaHrEuH95m068JYOvLZYnJSw= +cloud.google.com/go/video v1.12.0/go.mod h1:MLQew95eTuaNDEGriQdcYn0dTwf9oWiA4uYebxM5kdg= +cloud.google.com/go/video v1.13.0/go.mod h1:ulzkYlYgCp15N2AokzKjy7MQ9ejuynOJdf1tR5lGthk= +cloud.google.com/go/video v1.14.0/go.mod h1:SkgaXwT+lIIAKqWAJfktHT/RbgjSuY6DobxEp0C5yTQ= +cloud.google.com/go/video v1.15.0/go.mod h1:SkgaXwT+lIIAKqWAJfktHT/RbgjSuY6DobxEp0C5yTQ= +cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= +cloud.google.com/go/videointelligence v1.7.0/go.mod h1:k8pI/1wAhjznARtVT9U1llUaFNPh7muw8QyOUpavru4= +cloud.google.com/go/videointelligence v1.8.0/go.mod h1:dIcCn4gVDdS7yte/w+koiXn5dWVplOZkE+xwG9FgK+M= +cloud.google.com/go/videointelligence v1.9.0/go.mod h1:29lVRMPDYHikk3v8EdPSaL8Ku+eMzDljjuvRs105XoU= +cloud.google.com/go/videointelligence v1.10.0/go.mod h1:LHZngX1liVtUhZvi2uNS0VQuOzNi2TkY1OakiuoUOjU= +cloud.google.com/go/vision v1.2.0/go.mod h1:SmNwgObm5DpFBme2xpyOyasvBc1aPdjvMk2bBk0tKD0= +cloud.google.com/go/vision/v2 v2.2.0/go.mod h1:uCdV4PpN1S0jyCyq8sIM42v2Y6zOLkZs+4R9LrGYwFo= +cloud.google.com/go/vision/v2 v2.3.0/go.mod h1:UO61abBx9QRMFkNBbf1D8B1LXdS2cGiiCRx0vSpZoUo= +cloud.google.com/go/vision/v2 v2.4.0/go.mod h1:VtI579ll9RpVTrdKdkMzckdnwMyX2JILb+MhPqRbPsY= +cloud.google.com/go/vision/v2 v2.5.0/go.mod h1:MmaezXOOE+IWa+cS7OhRRLK2cNv1ZL98zhqFFZaaH2E= +cloud.google.com/go/vision/v2 v2.6.0/go.mod h1:158Hes0MvOS9Z/bDMSFpjwsUrZ5fPrdwuyyvKSGAGMY= +cloud.google.com/go/vision/v2 v2.7.0/go.mod h1:H89VysHy21avemp6xcf9b9JvZHVehWbET0uT/bcuY/0= +cloud.google.com/go/vmmigration v1.2.0/go.mod h1:IRf0o7myyWFSmVR1ItrBSFLFD/rJkfDCUTO4vLlJvsE= +cloud.google.com/go/vmmigration v1.3.0/go.mod h1:oGJ6ZgGPQOFdjHuocGcLqX4lc98YQ7Ygq8YQwHh9A7g= +cloud.google.com/go/vmmigration v1.5.0/go.mod h1:E4YQ8q7/4W9gobHjQg4JJSgXXSgY21nA5r8swQV+Xxc= +cloud.google.com/go/vmmigration v1.6.0/go.mod h1:bopQ/g4z+8qXzichC7GW1w2MjbErL54rk3/C843CjfY= +cloud.google.com/go/vmwareengine v0.1.0/go.mod h1:RsdNEf/8UDvKllXhMz5J40XxDrNJNN4sagiox+OI208= +cloud.google.com/go/vmwareengine v0.2.2/go.mod h1:sKdctNJxb3KLZkE/6Oui94iw/xs9PRNC2wnNLXsHvH8= +cloud.google.com/go/vmwareengine v0.3.0/go.mod h1:wvoyMvNWdIzxMYSpH/R7y2h5h3WFkx6d+1TIsP39WGY= +cloud.google.com/go/vpcaccess v1.4.0/go.mod h1:aQHVbTWDYUR1EbTApSVvMq1EnT57ppDmQzZ3imqIk4w= +cloud.google.com/go/vpcaccess v1.5.0/go.mod h1:drmg4HLk9NkZpGfCmZ3Tz0Bwnm2+DKqViEpeEpOq0m8= +cloud.google.com/go/vpcaccess v1.6.0/go.mod h1:wX2ILaNhe7TlVa4vC5xce1bCnqE3AeH27RV31lnmZes= +cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xXZmFiHmGE= +cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= +cloud.google.com/go/webrisk v1.6.0/go.mod h1:65sW9V9rOosnc9ZY7A7jsy1zoHS5W9IAXv6dGqhMQMc= +cloud.google.com/go/webrisk v1.7.0/go.mod h1:mVMHgEYH0r337nmt1JyLthzMr6YxwN1aAIEc2fTcq7A= +cloud.google.com/go/webrisk v1.8.0/go.mod h1:oJPDuamzHXgUc+b8SiHRcVInZQuybnvEW72PqTc7sSg= +cloud.google.com/go/websecurityscanner v1.3.0/go.mod h1:uImdKm2wyeXQevQJXeh8Uun/Ym1VqworNDlBXQevGMo= +cloud.google.com/go/websecurityscanner v1.4.0/go.mod h1:ebit/Fp0a+FWu5j4JOmJEV8S8CzdTkAS77oDsiSqYWQ= +cloud.google.com/go/websecurityscanner v1.5.0/go.mod h1:Y6xdCPy81yi0SQnDY1xdNTNpfY1oAgXUlcfN3B3eSng= +cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= +cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= +cloud.google.com/go/workflows v1.8.0/go.mod h1:ysGhmEajwZxGn1OhGOGKsTXc5PyxOc0vfKf5Af+to4M= +cloud.google.com/go/workflows v1.9.0/go.mod h1:ZGkj1aFIOd9c8Gerkjjq7OW7I5+l6cSvT3ujaO/WwSA= +cloud.google.com/go/workflows v1.10.0/go.mod h1:fZ8LmRmZQWacon9UCX1r/g/DfAXx5VcPALq2CxzdePw= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8= +git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= github.com/PuerkitoBio/goquery v1.8.1 h1:uQxhNlArOIdbrH1tr0UXwdVFgDcZDrZVdcpygAcwmWM= github.com/PuerkitoBio/goquery v1.8.1/go.mod h1:Q8ICL1kNUJ2sXGoAhPGUdYDJvgQgHzJsnnd3H7Ho5jQ= +github.com/ajstarks/deck v0.0.0-20200831202436-30c9fc6549a9/go.mod h1:JynElWSGnm/4RlzPXRlREEwqTHAN3T56Bv2ITsFT3gY= +github.com/ajstarks/deck/generate v0.0.0-20210309230005-c3f852c02e19/go.mod h1:T13YZdzov6OU0A1+RfKZiZN9ca6VeKdBdyDV+BY97Tk= +github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= +github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM= +github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c= github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/apache/arrow/go/v10 v10.0.1/go.mod h1:YvhnlEePVnBS4+0z3fhPfUy7W1Ikj0Ih0vcRo/gZ1M0= +github.com/apache/arrow/go/v11 v11.0.0/go.mod h1:Eg5OsL5H+e299f7u5ssuXsuHQVEGC4xei5aX110hRiI= +github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU= +github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= +github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20230310173818-32f1caf87195/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= +github.com/envoyproxy/go-control-plane v0.10.3/go.mod h1:fJJn/j26vwOu972OllsvAgJJM//w9BV6Fxbg2LuVd34= +github.com/envoyproxy/go-control-plane v0.11.0/go.mod h1:VnHyVMpzcLvCFt9yUz1UnCwHLhwx1WguiVDV7pTG/tI= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo= +github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0++PMirau2/yoOwVac3AbF2w= +github.com/envoyproxy/protoc-gen-validate v0.10.0/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss= +github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= +github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g= +github.com/go-fonts/latin-modern v0.2.0/go.mod h1:rQVLdDMK+mK1xscDwsqM5J8U2jrRa3T0ecnM9pNujks= +github.com/go-fonts/liberation v0.1.1/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= +github.com/go-fonts/liberation v0.2.0/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= +github.com/go-fonts/stix v0.1.0/go.mod h1:w/c1f0ldAUlJmLBvlbkvVXLAD+tAMqobIIQpmnUIzUY= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2CSIqUrmQPqA0gdRIlnLEY0gK5JGjh37zN5U= +github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81/go.mod h1:SX0U8uGpxhq9o2S/CELCSUxEWWAuoCUcVCQWv7G2OCk= +github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= +github.com/go-pdf/fpdf v0.6.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= +github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= +github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v53 v53.2.0 h1:wvz3FyF53v4BK+AsnvCmeNhf8AkTaeh2SoYu/XUvTtI= -github.com/google/go-github/v53 v53.2.0/go.mod h1:XhFRObz+m/l+UCm9b7KSIC3lT3NWSXGt7mOsAWEloao= +github.com/google/go-github/v54 v54.0.0 h1:OZdXwow4EAD5jEo5qg+dGFH2DpkyZvVsAehjvJuUL/c= +github.com/google/go-github/v54 v54.0.0/go.mod h1:Sw1LXWHhXRZtzJ9LI5fyJg9wbQzYvFhW8W5P2yaAQ7s= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/s2a-go v0.1.0/go.mod h1:OJpEgntRZo8ugHpF9hkoLJbS5dSI20XZeXJ9JVywLlM= +github.com/google/s2a-go v0.1.3/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= +github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= +github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= +github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= +github.com/googleapis/enterprise-certificate-proxy v0.2.1/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= +github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= +github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= +github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= +github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= +github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= +github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= +github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= +github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57QpBWsYpwqHJx8= +github.com/googleapis/gax-go/v2 v2.7.1/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= +github.com/googleapis/gax-go/v2 v2.8.0/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= +github.com/googleapis/gax-go/v2 v2.10.0/go.mod h1:4UOEnMCrxsSqQ940WnTiD6qJ63le2ev3xfyagutxiPw= +github.com/googleapis/gax-go/v2 v2.11.0/go.mod h1:DxmR61SGKkGLa2xigwuZIQpkCI2S5iydzRfb3peWZJI= +github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= +github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= +github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= +github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= +github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= +github.com/lyft/protoc-gen-star v0.6.1/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= +github.com/lyft/protoc-gen-star/v2 v2.0.1/go.mod h1:RcCdONR2ScXaYnQC5tUzxzlpA3WVYF7/opLeUgcQs/o= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-sqlite3 v1.14.14/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= +github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY= +github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE= +github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2dXMnm1mY= +github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= +github.com/phpdave11/gofpdi v1.0.13/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= +github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= +github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= +github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= +github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= +github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/xlzd/gotp v0.1.0 h1:37blvlKCh38s+fkem+fFh7sMnceltoIEBYTVXyoa5Po= github.com/xlzd/gotp v0.1.0/go.mod h1:ndLJ3JKzi3xLmUProq4LLxCuECL93dG9WASNLpHz8qg= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= +github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= +go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= +golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3/go.mod h1:NOZ3BPKG0ec/BKJQgnvsSFpcKLM5xXVWnvZS97DWHgE= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20220827204233-334a2380cb91/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= +golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20210216034530-4410531fe030/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= +golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= +golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= +golang.org/x/image v0.0.0-20220302094943-723b81ca9867/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.0.0-20221012135044-0b7e1fb9d458/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= +golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= -golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec= +golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I= +golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= +golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= +golang.org/x/oauth2 v0.11.0 h1:vPL4xzxBM4niKCW6g9whtaWVXTJf1U5e4aZxxFx/gbU= +golang.org/x/oauth2 v0.11.0/go.mod h1:LdF7O/8bLR/qWK9DrpXmbHLTouvRHK0SgJl0GmDBchk= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= +golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20220922220347-f3bd1da661af/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= +gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= +gonum.org/v1/gonum v0.9.3/go.mod h1:TZumC3NeyVQskjXqmyWt4S3bINhy7B4eYwW69EbyX+0= +gonum.org/v1/gonum v0.11.0/go.mod h1:fSG4YDCxxUZQJ7rKsQrj0gMOg00Il0Z96/qMA4bVQhA= +gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= +gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= +gonum.org/v1/plot v0.9.0/go.mod h1:3Pcqqmp6RHvJI72kgb8fThyUnav364FOsdDo2aGW5lY= +gonum.org/v1/plot v0.10.1/go.mod h1:VZW5OlhkL1mysU9vaqNHnsy86inf6Ot+jB3r+BczCEo= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= +google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= +google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= +google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= +google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= +google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= +google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= +google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= +google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= +google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= +google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= +google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= +google.golang.org/api v0.77.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= +google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= +google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= +google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= +google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g= +google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.93.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.95.0/go.mod h1:eADj+UBuxkh5zlrSntJghuNeg8HwQ1w5lTKkuqaETEI= +google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= +google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= +google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= +google.golang.org/api v0.99.0/go.mod h1:1YOf74vkVndF7pG6hIHuINsM7eWwpVTAfNMNiL91A08= +google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= +google.golang.org/api v0.102.0/go.mod h1:3VFl6/fzoA+qNuS1N1/VfXY4LjoXN/wzeIp7TweWwGo= +google.golang.org/api v0.103.0/go.mod h1:hGtW6nK1AC+d9si/UBhw8Xli+QMOf6xyNAyJw4qU9w0= +google.golang.org/api v0.106.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= +google.golang.org/api v0.107.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= +google.golang.org/api v0.108.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= +google.golang.org/api v0.110.0/go.mod h1:7FC4Vvx1Mooxh8C5HWjzZHcavuS2f6pmJpZx60ca7iI= +google.golang.org/api v0.111.0/go.mod h1:qtFHvU9mhgTJegR31csQ+rwxyUTHOKFqCKWp1J0fdw0= +google.golang.org/api v0.114.0/go.mod h1:ifYI2ZsFK6/uGddGfAD5BMxlnkBqCmqHSDUVi45N5Yg= +google.golang.org/api v0.118.0/go.mod h1:76TtD3vkgmZ66zZzp72bUUklpmQmKlhh6sYtIjYK+5E= +google.golang.org/api v0.122.0/go.mod h1:gcitW0lvnyWjSp9nKxAbdHKIZ6vF4aajGueeslZOyms= +google.golang.org/api v0.124.0/go.mod h1:xu2HQurE5gi/3t1aFCvhPD781p0a3p11sdunTJ2BlP4= +google.golang.org/api v0.126.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= +google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= +google.golang.org/genproto v0.0.0-20220329172620-7be39ac1afc7/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220628213854-d9e0b6570c03/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220722212130-b98a9ff5e252/go.mod h1:GkXuJDJ6aQ7lnJcRF+SJVgFdQhypqgl3LB1C9vabdRE= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= +google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220817144833-d7fd3f11b9b1/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220829144015-23454907ede3/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220829175752-36a9c930ecbf/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220913154956-18f8339a66a5/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220914142337-ca0e39ece12f/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220916172020-2692e8806bfa/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220919141832-68c03719ef51/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220920201722-2b89144ce006/go.mod h1:ht8XFiar2npT/g4vkk7O0WYS1sHOHbdujxbEp7CJWbw= +google.golang.org/genproto v0.0.0-20220926165614-551eb538f295/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI= +google.golang.org/genproto v0.0.0-20220926220553-6981cbe3cfce/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI= +google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqwhZAwq4wsRUaVG555sVgsNmIjRtO7t/JH29U= +google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= +google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= +google.golang.org/genproto v0.0.0-20221024153911-1573dae28c9c/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= +google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= +google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c/go.mod h1:CGI5F/G+E5bKwmfYo09AXuVN4dD894kIKUFmVbP2/Fo= +google.golang.org/genproto v0.0.0-20221109142239-94d6d90a7d66/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221114212237-e4508ebdbee1/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221117204609-8f9c96812029/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221201164419-0e50fba7f41c/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221201204527-e3fa12d562f3/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd/go.mod h1:cTsE614GARnxrLsqKREzmNYJACSWWpAWdNMwnD7c2BE= +google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230112194545-e10362b5ecf9/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230113154510-dbe35b8444a5/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230123190316-2c411cf9d197/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230124163310-31e0e69b6fc2/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230125152338-dcaf20b6aeaa/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230127162408-596548ed4efa/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230209215440-0dfe4f8abfcc/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230216225411-c8e22ba71e44/go.mod h1:8B0gmkoRebU8ukX6HP+4wrVQUY1+6PkQ44BSyIlflHA= +google.golang.org/genproto v0.0.0-20230222225845-10f96fb3dbec/go.mod h1:3Dl5ZL0q0isWJt+FVcfpQyirqemEuLAK/iFvg1UP1Hw= +google.golang.org/genproto v0.0.0-20230223222841-637eb2293923/go.mod h1:3Dl5ZL0q0isWJt+FVcfpQyirqemEuLAK/iFvg1UP1Hw= +google.golang.org/genproto v0.0.0-20230303212802-e74f57abe488/go.mod h1:TvhZT5f700eVlTNwND1xoEZQeWTB2RY/65kplwl/bFA= +google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= +google.golang.org/genproto v0.0.0-20230320184635-7606e756e683/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= +google.golang.org/genproto v0.0.0-20230323212658-478b75c54725/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= +google.golang.org/genproto v0.0.0-20230330154414-c0448cd141ea/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= +google.golang.org/genproto v0.0.0-20230331144136-dcfb400f0633/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= +google.golang.org/genproto v0.0.0-20230403163135-c38d8f061ccd/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= +google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= +google.golang.org/genproto v0.0.0-20230525234025-438c736192d0/go.mod h1:9ExIQyXL5hZrHzQceCwuSYwZZ5QZBazOcprJ5rgs3lY= +google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64= +google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a/go.mod h1:ts19tUU+Z0ZShN1y3aPyq2+O3d5FUNNgT6FtOzmrNn8= +google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= +google.golang.org/genproto/googleapis/api v0.0.0-20230526203410-71b5a4ffd15e/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= +google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= +google.golang.org/genproto/googleapis/bytestream v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:ylj+BE99M198VPbBh6A8d9n3w8fChvyLK3wwBOjXBFA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234015-3fc162c6f38a/go.mod h1:xURIpW9ES5+/GZhnV6beoEtxQrnkRGIfP5VQG2tCBLc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230526203410-71b5a4ffd15e/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= +google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= +google.golang.org/grpc v1.52.0/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= +google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= +google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= +google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= +lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= +lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= +modernc.org/cc/v3 v3.36.0/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= +modernc.org/cc/v3 v3.36.2/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= +modernc.org/cc/v3 v3.36.3/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= +modernc.org/ccgo/v3 v3.0.0-20220428102840-41399a37e894/go.mod h1:eI31LL8EwEBKPpNpA4bU1/i+sKOwOrQy8D87zWUcRZc= +modernc.org/ccgo/v3 v3.0.0-20220430103911-bc99d88307be/go.mod h1:bwdAnOoaIt8Ax9YdWGjxWsdkPcZyRPHqrOvJxaKAKGw= +modernc.org/ccgo/v3 v3.16.4/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ= +modernc.org/ccgo/v3 v3.16.6/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ= +modernc.org/ccgo/v3 v3.16.8/go.mod h1:zNjwkizS+fIFDrDjIAgBSCLkWbJuHF+ar3QRn+Z9aws= +modernc.org/ccgo/v3 v3.16.9/go.mod h1:zNMzC9A9xeNUepy6KuZBbugn3c0Mc9TeiJO4lgvkJDo= +modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= +modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= +modernc.org/libc v0.0.0-20220428101251-2d5f3daf273b/go.mod h1:p7Mg4+koNjc8jkqwcoFBJx7tXkpj00G77X7A72jXPXA= +modernc.org/libc v1.16.0/go.mod h1:N4LD6DBE9cf+Dzf9buBlzVJndKr/iJHG97vGLHYnb5A= +modernc.org/libc v1.16.1/go.mod h1:JjJE0eu4yeK7tab2n4S1w8tlWd9MxXLRzheaRnAKymU= +modernc.org/libc v1.16.17/go.mod h1:hYIV5VZczAmGZAnG15Vdngn5HSF5cSkbvfz2B7GRuVU= +modernc.org/libc v1.16.19/go.mod h1:p7Mg4+koNjc8jkqwcoFBJx7tXkpj00G77X7A72jXPXA= +modernc.org/libc v1.17.0/go.mod h1:XsgLldpP4aWlPlsjqKRdHPqCxCjISdHfM/yeWC5GyW0= +modernc.org/libc v1.17.1/go.mod h1:FZ23b+8LjxZs7XtFMbSzL/EhPxNbfZbErxEHc7cbD9s= +modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/mathutil v1.4.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/memory v1.1.1/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= +modernc.org/memory v1.2.0/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= +modernc.org/memory v1.2.1/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= +modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/sqlite v1.18.1/go.mod h1:6ho+Gow7oX5V+OiOQ6Tr4xeqbx13UZ6t+Fw9IRUG4d4= +modernc.org/strutil v1.1.1/go.mod h1:DE+MQQ/hjKBZS2zNInV5hhcipt5rLPWkmpbGeW5mmdw= +modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= +modernc.org/tcl v1.13.1/go.mod h1:XOLfOwzhkljL4itZkK6T72ckMgvj0BDsnKNdZVUOecw= +modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= +modernc.org/z v1.5.1/go.mod h1:eWFB510QWW5Th9YGZT81s+LwvaAs3Q2yr4sP0rmLkv8= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= From 7ceef94922277b3962cb8f61572983ff503e4819 Mon Sep 17 00:00:00 2001 From: vandan rohatgi <43648786+vandanrohatgi@users.noreply.github.com> Date: Sun, 20 Aug 2023 18:21:27 +0530 Subject: [PATCH 294/751] Add support for enable/disable private vulnerability reporting on repositories (#2887) Fixes: #2883. --- github/repos.go | 40 ++++++++++++++++++++++++++++++++++ github/repos_test.go | 52 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+) diff --git a/github/repos.go b/github/repos.go index 2309d927a29..83fc3f8e734 100644 --- a/github/repos.go +++ b/github/repos.go @@ -2069,3 +2069,43 @@ func isBranchNotProtected(err error) bool { errorResponse, ok := err.(*ErrorResponse) return ok && errorResponse.Message == githubBranchNotProtected } + +// EnablePrivateReporting enables private reporting of vulnerabilities for a +// repository. +// +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#enable-private-vulnerability-reporting-for-a-repository +func (s *RepositoriesService) EnablePrivateReporting(ctx context.Context, owner, repo string) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/private-vulnerability-reporting", 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 +} + +// DisablePrivateReporting disables private reporting of vulnerabilities for a +// repository. +// +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#disable-private-vulnerability-reporting-for-a-repository +func (s *RepositoriesService) DisablePrivateReporting(ctx context.Context, owner, repo string) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/private-vulnerability-reporting", 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_test.go b/github/repos_test.go index c2abf6da4f1..a3164edf554 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -3569,3 +3569,55 @@ func TestRepositoryTag_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestRepositoriesService_EnablePrivateReporting(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/owner/repo/private-vulnerability-reporting", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + w.WriteHeader(http.StatusNoContent) + }) + + ctx := context.Background() + _, err := client.Repositories.EnablePrivateReporting(ctx, "owner", "repo") + if err != nil { + t.Errorf("Repositories.EnablePrivateReporting returned error: %v", err) + } + + const methodName = "EnablePrivateReporting" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Repositories.EnablePrivateReporting(ctx, "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Repositories.EnablePrivateReporting(ctx, "owner", "repo") + }) +} + +func TestRepositoriesService_DisablePrivateReporting(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/owner/repo/private-vulnerability-reporting", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + w.WriteHeader(http.StatusNoContent) + }) + + ctx := context.Background() + _, err := client.Repositories.DisablePrivateReporting(ctx, "owner", "repo") + if err != nil { + t.Errorf("Repositories.DisablePrivateReporting returned error: %v", err) + } + + const methodName = "DisablePrivateReporting" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Repositories.DisablePrivateReporting(ctx, "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Repositories.DisablePrivateReporting(ctx, "owner", "repo") + }) +} From 505b7eae3643ed09845192120308becf7ddafedc Mon Sep 17 00:00:00 2001 From: Mohammed Nafees Date: Mon, 21 Aug 2023 19:48:00 +0530 Subject: [PATCH 295/751] Add support for organization, repository webhook configuration (#2885) Fixes: #2884. --- github/orgs_hooks_configuration.go | 49 +++++++++ github/orgs_hooks_configuration_test.go | 123 +++++++++++++++++++++++ github/repos_hooks_configuration.go | 49 +++++++++ github/repos_hooks_configuration_test.go | 123 +++++++++++++++++++++++ 4 files changed, 344 insertions(+) create mode 100644 github/orgs_hooks_configuration.go create mode 100644 github/orgs_hooks_configuration_test.go create mode 100644 github/repos_hooks_configuration.go create mode 100644 github/repos_hooks_configuration_test.go diff --git a/github/orgs_hooks_configuration.go b/github/orgs_hooks_configuration.go new file mode 100644 index 00000000000..953a2329c36 --- /dev/null +++ b/github/orgs_hooks_configuration.go @@ -0,0 +1,49 @@ +// Copyright 2023 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" +) + +// GetHookConfiguration returns the configuration for the specified organization webhook. +// +// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks?apiVersion=2022-11-28#get-a-webhook-configuration-for-an-organization +func (s *OrganizationsService) GetHookConfiguration(ctx context.Context, org string, id int64) (*HookConfig, *Response, error) { + u := fmt.Sprintf("orgs/%v/hooks/%v/config", org, id) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + config := new(HookConfig) + resp, err := s.client.Do(ctx, req, config) + if err != nil { + return nil, resp, err + } + + return config, resp, nil +} + +// EditHookConfiguration updates the configuration for the specified organization webhook. +// +// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks?apiVersion=2022-11-28#update-a-webhook-configuration-for-an-organization +func (s *OrganizationsService) EditHookConfiguration(ctx context.Context, org string, id int64, config *HookConfig) (*HookConfig, *Response, error) { + u := fmt.Sprintf("orgs/%v/hooks/%v/config", org, id) + req, err := s.client.NewRequest("PATCH", u, config) + if err != nil { + return nil, nil, err + } + + c := new(HookConfig) + resp, err := s.client.Do(ctx, req, c) + if err != nil { + return nil, resp, err + } + + return c, resp, nil +} diff --git a/github/orgs_hooks_configuration_test.go b/github/orgs_hooks_configuration_test.go new file mode 100644 index 00000000000..a79f8a56c57 --- /dev/null +++ b/github/orgs_hooks_configuration_test.go @@ -0,0 +1,123 @@ +// Copyright 2023 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 TestOrganizationsService_GetHookConfiguration(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/hooks/1/config", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"content_type": "json", "insecure_ssl": "0", "secret": "********", "url": "https://example.com/webhook"}`) + }) + + ctx := context.Background() + config, _, err := client.Organizations.GetHookConfiguration(ctx, "o", 1) + if err != nil { + t.Errorf("Organizations.GetHookConfiguration returned error: %v", err) + } + + want := &HookConfig{ + ContentType: String("json"), + InsecureSSL: String("0"), + Secret: String("********"), + URL: String("https://example.com/webhook"), + } + if !cmp.Equal(config, want) { + t.Errorf("Organizations.GetHookConfiguration returned %+v, want %+v", config, want) + } + + const methodName = "GetHookConfiguration" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.GetHookConfiguration(ctx, "\n", -1) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.GetHookConfiguration(ctx, "o", 1) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_GetHookConfiguration_invalidOrg(t *testing.T) { + client, _, _, teardown := setup() + defer teardown() + + ctx := context.Background() + _, _, err := client.Organizations.GetHookConfiguration(ctx, "%", 1) + testURLParseError(t, err) +} + +func TestOrganizationsService_EditHookConfiguration(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + input := &HookConfig{} + + mux.HandleFunc("/orgs/o/hooks/1/config", func(w http.ResponseWriter, r *http.Request) { + v := new(HookConfig) + json.NewDecoder(r.Body).Decode(v) + + testMethod(t, r, "PATCH") + if !cmp.Equal(v, input) { + t.Errorf("Request body = %+v, want %+v", v, input) + } + + fmt.Fprint(w, `{"content_type": "json", "insecure_ssl": "0", "secret": "********", "url": "https://example.com/webhook"}`) + }) + + ctx := context.Background() + config, _, err := client.Organizations.EditHookConfiguration(ctx, "o", 1, input) + if err != nil { + t.Errorf("Organizations.EditHookConfiguration returned error: %v", err) + } + + want := &HookConfig{ + ContentType: String("json"), + InsecureSSL: String("0"), + Secret: String("********"), + URL: String("https://example.com/webhook"), + } + if !cmp.Equal(config, want) { + t.Errorf("Organizations.EditHookConfiguration returned %+v, want %+v", config, want) + } + + const methodName = "EditHookConfiguration" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.EditHookConfiguration(ctx, "\n", -1, input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.EditHookConfiguration(ctx, "o", 1, input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_EditHookConfiguration_invalidOrg(t *testing.T) { + client, _, _, teardown := setup() + defer teardown() + + ctx := context.Background() + _, _, err := client.Organizations.EditHookConfiguration(ctx, "%", 1, nil) + testURLParseError(t, err) +} diff --git a/github/repos_hooks_configuration.go b/github/repos_hooks_configuration.go new file mode 100644 index 00000000000..5aadfb645e1 --- /dev/null +++ b/github/repos_hooks_configuration.go @@ -0,0 +1,49 @@ +// Copyright 2023 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" +) + +// GetHookConfiguration returns the configuration for the specified repository webhook. +// +// GitHub API docs: https://docs.github.com/en/rest/webhooks/repo-config?apiVersion=2022-11-28#get-a-webhook-configuration-for-a-repository +func (s *RepositoriesService) GetHookConfiguration(ctx context.Context, owner, repo string, id int64) (*HookConfig, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/hooks/%v/config", owner, repo, id) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + config := new(HookConfig) + resp, err := s.client.Do(ctx, req, config) + if err != nil { + return nil, resp, err + } + + return config, resp, nil +} + +// EditHookConfiguration updates the configuration for the specified repository webhook. +// +// GitHub API docs: https://docs.github.com/en/rest/webhooks/repo-config?apiVersion=2022-11-28#update-a-webhook-configuration-for-a-repository +func (s *RepositoriesService) EditHookConfiguration(ctx context.Context, owner, repo string, id int64, config *HookConfig) (*HookConfig, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/hooks/%v/config", owner, repo, id) + req, err := s.client.NewRequest("PATCH", u, config) + if err != nil { + return nil, nil, err + } + + c := new(HookConfig) + resp, err := s.client.Do(ctx, req, c) + if err != nil { + return nil, resp, err + } + + return c, resp, nil +} diff --git a/github/repos_hooks_configuration_test.go b/github/repos_hooks_configuration_test.go new file mode 100644 index 00000000000..0bdf5cbe9e2 --- /dev/null +++ b/github/repos_hooks_configuration_test.go @@ -0,0 +1,123 @@ +// Copyright 2023 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_GetHookConfiguration(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/hooks/1/config", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"content_type": "json", "insecure_ssl": "0", "secret": "********", "url": "https://example.com/webhook"}`) + }) + + ctx := context.Background() + config, _, err := client.Repositories.GetHookConfiguration(ctx, "o", "r", 1) + if err != nil { + t.Errorf("Repositories.GetHookConfiguration returned error: %v", err) + } + + want := &HookConfig{ + ContentType: String("json"), + InsecureSSL: String("0"), + Secret: String("********"), + URL: String("https://example.com/webhook"), + } + if !cmp.Equal(config, want) { + t.Errorf("Repositories.GetHookConfiguration returned %+v, want %+v", config, want) + } + + const methodName = "GetHookConfiguration" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.GetHookConfiguration(ctx, "\n", "\n", -1) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.GetHookConfiguration(ctx, "o", "r", 1) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestRepositoriesService_GetHookConfiguration_invalidOrg(t *testing.T) { + client, _, _, teardown := setup() + defer teardown() + + ctx := context.Background() + _, _, err := client.Repositories.GetHookConfiguration(ctx, "%", "%", 1) + testURLParseError(t, err) +} + +func TestRepositoriesService_EditHookConfiguration(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + input := &HookConfig{} + + mux.HandleFunc("/repos/o/r/hooks/1/config", func(w http.ResponseWriter, r *http.Request) { + v := new(HookConfig) + json.NewDecoder(r.Body).Decode(v) + + testMethod(t, r, "PATCH") + if !cmp.Equal(v, input) { + t.Errorf("Request body = %+v, want %+v", v, input) + } + + fmt.Fprint(w, `{"content_type": "json", "insecure_ssl": "0", "secret": "********", "url": "https://example.com/webhook"}`) + }) + + ctx := context.Background() + config, _, err := client.Repositories.EditHookConfiguration(ctx, "o", "r", 1, input) + if err != nil { + t.Errorf("Repositories.EditHookConfiguration returned error: %v", err) + } + + want := &HookConfig{ + ContentType: String("json"), + InsecureSSL: String("0"), + Secret: String("********"), + URL: String("https://example.com/webhook"), + } + if !cmp.Equal(config, want) { + t.Errorf("Repositories.EditHookConfiguration returned %+v, want %+v", config, want) + } + + const methodName = "EditHookConfiguration" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.EditHookConfiguration(ctx, "\n", "\n", -1, input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.EditHookConfiguration(ctx, "o", "r", 1, input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestRepositoriesService_EditHookConfiguration_invalidOrg(t *testing.T) { + client, _, _, teardown := setup() + defer teardown() + + ctx := context.Background() + _, _, err := client.Repositories.EditHookConfiguration(ctx, "%", "%", 1, nil) + testURLParseError(t, err) +} From 38ca69f37f8597421ceb02e08f2dd225cfaeb1a9 Mon Sep 17 00:00:00 2001 From: Nikita Pivkin Date: Tue, 22 Aug 2023 19:26:27 +0700 Subject: [PATCH 296/751] Return json.Unmarshal error when importing issues deferred (#2892) --- github/issue_import.go | 9 ++-- github/issue_import_test.go | 88 ++++++++++++++++++++++++++++++++++++- 2 files changed, 90 insertions(+), 7 deletions(-) diff --git a/github/issue_import.go b/github/issue_import.go index 4bc8d5f1d23..04899772bd1 100644 --- a/github/issue_import.go +++ b/github/issue_import.go @@ -86,14 +86,11 @@ func (s *IssueImportService) Create(ctx context.Context, owner, repo string, iss if err != nil { aerr, ok := err.(*AcceptedError) if ok { - decErr := json.Unmarshal(aerr.Raw, i) - if decErr != nil { - err = decErr + if err := json.Unmarshal(aerr.Raw, i); err != nil { + return i, resp, err } - - return i, resp, nil + return i, resp, err } - return nil, resp, err } diff --git a/github/issue_import_test.go b/github/issue_import_test.go index a86ead898b4..48f96ab3a5c 100644 --- a/github/issue_import_test.go +++ b/github/issue_import_test.go @@ -45,7 +45,6 @@ func TestIssueImportService_Create(t *testing.T) { t.Errorf("Request body = %+v, want %+v", v, input) } - w.WriteHeader(http.StatusAccepted) w.Write(issueImportResponseJSON) }) @@ -75,6 +74,93 @@ func TestIssueImportService_Create(t *testing.T) { }) } +func TestIssueImportService_Create_defered(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + createdAt := time.Date(2020, time.August, 11, 15, 30, 0, 0, time.UTC) + input := &IssueImportRequest{ + IssueImport: IssueImport{ + Assignee: String("developer"), + Body: "Dummy description", + CreatedAt: &Timestamp{createdAt}, + Labels: []string{"l1", "l2"}, + Milestone: Int(1), + Title: "Dummy Issue", + }, + Comments: []*Comment{{ + CreatedAt: &Timestamp{createdAt}, + Body: "Comment body", + }}, + } + + mux.HandleFunc("/repos/o/r/import/issues", func(w http.ResponseWriter, r *http.Request) { + v := new(IssueImportRequest) + json.NewDecoder(r.Body).Decode(v) + testMethod(t, r, "POST") + testHeader(t, r, "Accept", mediaTypeIssueImportAPI) + if !cmp.Equal(v, input) { + t.Errorf("Request body = %+v, want %+v", v, input) + } + + w.WriteHeader(http.StatusAccepted) + w.Write(issueImportResponseJSON) + }) + + ctx := context.Background() + got, _, err := client.IssueImport.Create(ctx, "o", "r", input) + + if _, ok := err.(*AcceptedError); !ok { + t.Errorf("Create returned error: %v (want AcceptedError)", err) + } + + want := wantIssueImportResponse + if !cmp.Equal(got, want) { + t.Errorf("Create = %+v, want %+v", got, want) + } +} + +func TestIssueImportService_Create_badResponse(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + createdAt := time.Date(2020, time.August, 11, 15, 30, 0, 0, time.UTC) + input := &IssueImportRequest{ + IssueImport: IssueImport{ + Assignee: String("developer"), + Body: "Dummy description", + CreatedAt: &Timestamp{createdAt}, + Labels: []string{"l1", "l2"}, + Milestone: Int(1), + Title: "Dummy Issue", + }, + Comments: []*Comment{{ + CreatedAt: &Timestamp{createdAt}, + Body: "Comment body", + }}, + } + + mux.HandleFunc("/repos/o/r/import/issues", func(w http.ResponseWriter, r *http.Request) { + v := new(IssueImportRequest) + json.NewDecoder(r.Body).Decode(v) + testMethod(t, r, "POST") + testHeader(t, r, "Accept", mediaTypeIssueImportAPI) + if !cmp.Equal(v, input) { + t.Errorf("Request body = %+v, want %+v", v, input) + } + + w.WriteHeader(http.StatusAccepted) + w.Write([]byte("{[}")) + }) + + ctx := context.Background() + _, _, err := client.IssueImport.Create(ctx, "o", "r", input) + + if err == nil || err.Error() != "invalid character '[' looking for beginning of object key string" { + t.Errorf("unexpected error: %v", err) + } +} + func TestIssueImportService_Create_invalidOwner(t *testing.T) { client, _, _, teardown := setup() defer teardown() From c36edbde82966ce8107ea8cc8085a164f33721a5 Mon Sep 17 00:00:00 2001 From: WillAbides <233500+WillAbides@users.noreply.github.com> Date: Sun, 27 Aug 2023 11:22:57 -0500 Subject: [PATCH 297/751] Remove dependency on "golang.org/x/oauth2" (#2895) Fixes: #2893. --- example/go.mod | 11 +- example/go.sum | 49 ++- example/newreposecretwithlibsodium/go.mod | 1 - example/newreposecretwithlibsodium/go.sum | 394 +++------------------- example/tokenauth/main.go | 3 +- github/github.go | 23 +- github/github_test.go | 24 +- go.mod | 5 - go.sum | 50 ++- 9 files changed, 146 insertions(+), 414 deletions(-) diff --git a/example/go.mod b/example/go.mod index 081ce56d129..aa04906aa9c 100644 --- a/example/go.mod +++ b/example/go.mod @@ -6,19 +6,22 @@ require ( github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-ratelimit v1.0.3 github.com/google/go-github/v54 v54.0.0 - golang.org/x/crypto v0.7.0 + golang.org/x/crypto v0.12.0 golang.org/x/oauth2 v0.7.0 + golang.org/x/term v0.11.0 google.golang.org/appengine v1.6.7 ) require ( + github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect + github.com/cloudflare/circl v1.3.3 // indirect github.com/golang-jwt/jwt/v4 v4.0.0 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/google/go-github/v41 v41.0.0 // indirect github.com/google/go-querystring v1.1.0 // indirect - golang.org/x/net v0.9.0 // indirect - golang.org/x/sys v0.7.0 // indirect - golang.org/x/term v0.7.0 // indirect + golang.org/x/net v0.10.0 // indirect + golang.org/x/sys v0.11.0 // indirect + google.golang.org/protobuf v1.28.0 // indirect ) // Use version at HEAD, not the latest published. diff --git a/example/go.sum b/example/go.sum index f231e169888..1151ab7548d 100644 --- a/example/go.sum +++ b/example/go.sum @@ -1,19 +1,26 @@ +cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= +github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 h1:tXKVfhE7FcSkhkv0UwkLvPDeZ4kz6OXd0PKPlFqf81M= github.com/bradleyfalzon/ghinstallation/v2 v2.0.4/go.mod h1:B40qPqJxWE0jDZgOR1JmaMy+4AY1eBP+IByOvqyAKp0= -github.com/gofri/go-github-ratelimit v1.0.1 h1:sgefSzxhnvwZ+wR9uZ4l9TnjgLuNiwipJVzJL4YLj9A= -github.com/gofri/go-github-ratelimit v1.0.1/go.mod h1:OnCi5gV+hAG/LMR7llGhU7yHt44se9sYgKPnafoL7RY= +github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= +github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= +github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= +github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= +github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/gofri/go-github-ratelimit v1.0.3 h1:Ocs2jaYokZDzgvqaajX+g04dqFyVqL0JQzoO7d2wmlk= github.com/gofri/go-github-ratelimit v1.0.3/go.mod h1:OnCi5gV+hAG/LMR7llGhU7yHt44se9sYgKPnafoL7RY= github.com/golang-jwt/jwt/v4 v4.0.0 h1:RAqyYixv1p7uEnocuy8P1nru5wprCh/MH2BIlW5z5/o= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github/v41 v41.0.0 h1:HseJrM2JFf2vfiZJ8anY2hqBjdfY1Vlj/K27ueww4gg= @@ -24,50 +31,64 @@ github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5t golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU= -golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= +golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= +golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs= +golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.11.0 h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0= +golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index 95dbcc9d52d..98684c1c1d9 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -5,7 +5,6 @@ go 1.15 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb github.com/google/go-github/v54 v54.0.0 - golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 ) // Use version at HEAD, not the latest published. diff --git a/example/newreposecretwithlibsodium/go.sum b/example/newreposecretwithlibsodium/go.sum index dfbf7641b99..236b1e435bd 100644 --- a/example/newreposecretwithlibsodium/go.sum +++ b/example/newreposecretwithlibsodium/go.sum @@ -1,374 +1,62 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb h1:ilqSFSbR1fq6x88heeHrvAqlg+ES+tZk2ZcaCmiH1gI= github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb/go.mod h1:72TQeEkiDH9QMXZa5nJJvZre0UjqqO67X2QEIoOwCRU= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= +github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= +github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= +github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= +github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= +github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= +github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ= -golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= +golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= +golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 h1:qWPm9rbaAMKs8Bq/9LRpbMqxWRVUAQwMI9fVrssnTfw= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 h1:ld7aEMNHoBnnDAX15v1T6z31v8HwR2A9FYOuAhWqkwc= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index a9e845bed30..564db2663e6 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -3,7 +3,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// The tokenauth command demonstrates using the oauth2.StaticTokenSource. +// The tokenauth command demonstrates using a Personal Access Token (PAT) to +// authenticate with GitHub. // You can test out a GitHub Personal Access Token using this simple example. // You can generate them here: https://github.com/settings/tokens package main diff --git a/github/github.go b/github/github.go index aad4a7335d6..a7031ffd65a 100644 --- a/github/github.go +++ b/github/github.go @@ -24,7 +24,6 @@ import ( "time" "github.com/google/go-querystring/query" - "golang.org/x/oauth2" ) const ( @@ -306,8 +305,9 @@ func addOptions(s string, opts interface{}) (string, error) { // NewClient returns a new GitHub API client. If a nil httpClient is // provided, a new http.Client will be used. To use API methods which require -// authentication, provide an http.Client that will perform the authentication -// for you (such as that provided by the golang.org/x/oauth2 library). +// authentication, either use NewTokenClient instead or provide NewClient with +// an http.Client that will perform the authentication for you (such as that +// provided by the golang.org/x/oauth2 library). func NewClient(httpClient *http.Client) *Client { if httpClient == nil { httpClient = &http.Client{} @@ -358,8 +358,14 @@ func NewClientWithEnvProxy() *Client { } // NewTokenClient returns a new GitHub API client authenticated with the provided token. -func NewTokenClient(ctx context.Context, token string) *Client { - return NewClient(oauth2.NewClient(ctx, oauth2.StaticTokenSource(&oauth2.Token{AccessToken: token}))) +func NewTokenClient(_ context.Context, token string) *Client { + return NewClient(&http.Client{ + Transport: roundTripperFunc(func(req *http.Request) (*http.Response, error) { + req = req.Clone(req.Context()) + req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", token)) + return http.DefaultTransport.RoundTrip(req) + }), + }) } // NewEnterpriseClient returns a new GitHub API client with provided @@ -1539,3 +1545,10 @@ func Int64(v int64) *int64 { return &v } // String is a helper routine that allocates a new string value // to store v and returns a pointer to it. func String(v string) *string { return &v } + +// roundTripperFunc creates a RoundTripper (transport) +type roundTripperFunc func(*http.Request) (*http.Response, error) + +func (fn roundTripperFunc) RoundTrip(r *http.Request) (*http.Response, error) { + return fn(r) +} diff --git a/github/github_test.go b/github/github_test.go index 94606edd72b..982e1fe7498 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -23,7 +23,6 @@ import ( "time" "github.com/google/go-cmp/cmp" - "golang.org/x/oauth2" ) const ( @@ -310,13 +309,17 @@ func TestClient(t *testing.T) { func TestNewTokenClient(t *testing.T) { token := "gh_test_token" ctx := context.Background() - c := NewTokenClient(ctx, token) - tr, ok := c.Client().Transport.(*oauth2.Transport) - if !ok { - t.Error("Client transport is not oauth2.Transport") + var gotAuthHeaderVals []string + wantAuthHeaderVals := []string{"Bearer " + token} + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + gotAuthHeaderVals = r.Header["Authorization"] + })) + _, err := NewTokenClient(ctx, token).Client().Get(srv.URL) + if err != nil { + t.Fatalf("Get returned unexpected error: %v", err) } - if tok, err := tr.Source.Token(); err != nil || tok.AccessToken != token { - t.Errorf("Client not using correct token") + if diff := cmp.Diff(wantAuthHeaderVals, gotAuthHeaderVals); diff != "" { + t.Errorf("Authorization header values mismatch (-want +got):\n%s", diff) } } @@ -2705,13 +2708,6 @@ func TestBareDo_returnsOpenBody(t *testing.T) { } } -// roundTripperFunc creates a mock RoundTripper (transport) -type roundTripperFunc func(*http.Request) (*http.Response, error) - -func (fn roundTripperFunc) RoundTrip(r *http.Request) (*http.Response, error) { - return fn(r) -} - func TestErrorResponse_Marshal(t *testing.T) { testJSONMarshal(t, &ErrorResponse{}, "{}") diff --git a/go.mod b/go.mod index 2ea4636dfbb..fa43a0aa5ff 100644 --- a/go.mod +++ b/go.mod @@ -4,17 +4,12 @@ require ( github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 github.com/google/go-cmp v0.5.9 github.com/google/go-querystring v1.1.0 - golang.org/x/oauth2 v0.11.0 ) require ( github.com/cloudflare/circl v1.3.3 // indirect - github.com/golang/protobuf v1.5.3 // indirect golang.org/x/crypto v0.12.0 // indirect - golang.org/x/net v0.14.0 // indirect golang.org/x/sys v0.11.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/protobuf v1.31.0 // indirect ) go 1.17 diff --git a/go.sum b/go.sum index 1b24aa6b96a..68e49aed424 100644 --- a/go.sum +++ b/go.sum @@ -1,44 +1,60 @@ github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= +github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= 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/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= -golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= -golang.org/x/oauth2 v0.11.0 h1:vPL4xzxBM4niKCW6g9whtaWVXTJf1U5e4aZxxFx/gbU= -golang.org/x/oauth2 v0.11.0/go.mod h1:LdF7O/8bLR/qWK9DrpXmbHLTouvRHK0SgJl0GmDBchk= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= From 8596515296f0104b3930c136fecda8f53049aa36 Mon Sep 17 00:00:00 2001 From: Nikita Pivkin Date: Wed, 30 Aug 2023 01:08:47 +0700 Subject: [PATCH 298/751] Add support for dependabot_alert webhook event (#2888) Fixes: #2790. --- github/dependabot_alerts.go | 4 +- github/event_types.go | 19 ++ github/event_types_test.go | 461 ++++++++++++++++++++++++++ github/github-accessors.go | 64 ++++ github/github-accessors_test.go | 62 ++++ github/messages.go | 1 + github/messages_test.go | 4 + github/repos_hooks_deliveries_test.go | 1 + 8 files changed, 615 insertions(+), 1 deletion(-) diff --git a/github/dependabot_alerts.go b/github/dependabot_alerts.go index a55f540f1be..e39ed277caf 100644 --- a/github/dependabot_alerts.go +++ b/github/dependabot_alerts.go @@ -62,7 +62,9 @@ type DependabotAlert struct { DismissedReason *string `json:"dismissed_reason,omitempty"` DismissedComment *string `json:"dismissed_comment,omitempty"` FixedAt *Timestamp `json:"fixed_at,omitempty"` - Repository *Repository `json:"repository,omitempty"` + AutoDismissedAt *Timestamp `json:"auto_dismissed_at,omitempty"` + // The repository is always empty for events + Repository *Repository `json:"repository,omitempty"` } // ListAlertsOptions specifies the optional parameters to the DependabotService.ListRepoAlerts diff --git a/github/event_types.go b/github/event_types.go index 64bbde122a3..d402e872463 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -134,6 +134,25 @@ type DeleteEvent struct { Installation *Installation `json:"installation,omitempty"` } +// DependabotAlertEvent is triggered when there is activity relating to Dependabot alerts. +// The Webhook event name is "dependabot_alert". +// +// GitHub API docs: https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#dependabot_alert +type DependabotAlertEvent struct { + Action *string `json:"action,omitempty"` + Alert *DependabotAlert `json:"alert,omitempty"` + + // The following fields are only populated by Webhook events. + Installation *Installation `json:"installation,omitempty"` + Enterprise *Enterprise `json:"enterprise,omitempty"` + Repo *Repository `json:"repository,omitempty"` + Sender *User `json:"sender,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Organization *Organization `json:"organization,omitempty"` +} + // DeployKeyEvent is triggered when a deploy key is added or removed from a repository. // The Webhook event name is "deploy_key". // diff --git a/github/event_types_test.go b/github/event_types_test.go index 653671b8685..485b1953d19 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -12700,6 +12700,467 @@ func TestDeleteEvent_Marshal(t *testing.T) { testJSONMarshal(t, r, want) } +func TestDependabotAlertEvent_Marshal(t *testing.T) { + testJSONMarshal(t, &DependabotAlertEvent{}, "{}") + + e := &DependabotAlertEvent{ + Action: String("a"), + Alert: &DependabotAlert{ + Number: Int(1), + State: String("s"), + Dependency: &Dependency{ + Package: &VulnerabilityPackage{ + Ecosystem: String("e"), + Name: String("n"), + }, + ManifestPath: String("mp"), + Scope: String("s"), + }, + SecurityAdvisory: &DependabotSecurityAdvisory{ + GHSAID: String("ghsaid"), + CVEID: String("cveid"), + Summary: String("s"), + Description: String("d"), + Vulnerabilities: []*AdvisoryVulnerability{ + { + Package: &VulnerabilityPackage{ + Ecosystem: String("e"), + Name: String("n"), + }, + Severity: String("s"), + }, + }, + Severity: String("s"), + CVSs: &AdvisoryCVSs{ + Score: Float64(1.0), + VectorString: String("vs"), + }, + CWEs: []*AdvisoryCWEs{ + { + CWEID: String("cweid"), + Name: String("n"), + }, + }, + Identifiers: []*AdvisoryIdentifier{ + { + Value: String("v"), + Type: String("t"), + }, + }, + References: []*AdvisoryReference{ + { + URL: String("u"), + }, + }, + PublishedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + WithdrawnAt: &Timestamp{referenceTime}, + }, + SecurityVulnerability: &AdvisoryVulnerability{ + Package: &VulnerabilityPackage{ + Ecosystem: String("e"), + Name: String("n"), + }, + Severity: String("s"), + VulnerableVersionRange: String("vvr"), + FirstPatchedVersion: &FirstPatchedVersion{ + Identifier: String("i"), + }, + }, + URL: String("u"), + HTMLURL: String("hu"), + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + DismissedAt: &Timestamp{referenceTime}, + DismissedBy: &User{ + Login: String("l"), + ID: Int64(1), + NodeID: String("n"), + URL: String("u"), + ReposURL: String("r"), + EventsURL: String("e"), + AvatarURL: String("a"), + }, + DismissedReason: String("dr"), + DismissedComment: String("dc"), + FixedAt: &Timestamp{referenceTime}, + AutoDismissedAt: &Timestamp{referenceTime}, + }, + Repo: &Repository{ + ID: Int64(1), + URL: String("s"), + Name: String("n"), + }, + Organization: &Organization{ + BillingEmail: String("be"), + Blog: String("b"), + Company: String("c"), + Email: String("e"), + TwitterUsername: String("tu"), + Location: String("loc"), + Name: String("n"), + Description: String("d"), + IsVerified: Bool(true), + HasOrganizationProjects: Bool(true), + HasRepositoryProjects: Bool(true), + DefaultRepoPermission: String("drp"), + MembersCanCreateRepos: Bool(true), + MembersCanCreateInternalRepos: Bool(true), + MembersCanCreatePrivateRepos: Bool(true), + MembersCanCreatePublicRepos: Bool(false), + MembersAllowedRepositoryCreationType: String("marct"), + MembersCanCreatePages: Bool(true), + MembersCanCreatePublicPages: Bool(false), + MembersCanCreatePrivatePages: Bool(true), + }, + Enterprise: &Enterprise{ + ID: Int(1), + Slug: String("s"), + Name: String("n"), + NodeID: String("nid"), + AvatarURL: String("au"), + Description: String("d"), + WebsiteURL: String("wu"), + HTMLURL: String("hu"), + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + }, + Sender: &User{ + Login: String("l"), + ID: Int64(1), + NodeID: String("n"), + URL: String("u"), + ReposURL: String("r"), + EventsURL: String("e"), + AvatarURL: String("a"), + }, + Installation: &Installation{ + ID: Int64(1), + NodeID: String("nid"), + AppID: Int64(1), + AppSlug: String("as"), + TargetID: Int64(1), + Account: &User{ + Login: String("l"), + ID: Int64(1), + URL: String("u"), + AvatarURL: String("a"), + GravatarID: String("g"), + Name: String("n"), + Company: String("c"), + Blog: String("b"), + Location: String("l"), + Email: String("e"), + Hireable: Bool(true), + Bio: String("b"), + TwitterUsername: String("t"), + PublicRepos: Int(1), + Followers: Int(1), + Following: Int(1), + CreatedAt: &Timestamp{referenceTime}, + SuspendedAt: &Timestamp{referenceTime}, + }, + AccessTokensURL: String("atu"), + RepositoriesURL: String("ru"), + HTMLURL: String("hu"), + TargetType: String("tt"), + SingleFileName: String("sfn"), + RepositorySelection: String("rs"), + Events: []string{"e"}, + SingleFilePaths: []string{"s"}, + Permissions: &InstallationPermissions{ + Actions: String("a"), + Administration: String("ad"), + Checks: String("c"), + Contents: String("co"), + ContentReferences: String("cr"), + Deployments: String("d"), + Environments: String("e"), + Issues: String("i"), + Metadata: String("md"), + Members: String("m"), + OrganizationAdministration: String("oa"), + OrganizationHooks: String("oh"), + OrganizationPlan: String("op"), + OrganizationPreReceiveHooks: String("opr"), + OrganizationProjects: String("op"), + OrganizationSecrets: String("os"), + OrganizationSelfHostedRunners: String("osh"), + OrganizationUserBlocking: String("oub"), + Packages: String("pkg"), + Pages: String("pg"), + PullRequests: String("pr"), + RepositoryHooks: String("rh"), + RepositoryProjects: String("rp"), + RepositoryPreReceiveHooks: String("rprh"), + Secrets: String("s"), + SecretScanningAlerts: String("ssa"), + SecurityEvents: String("se"), + SingleFile: String("sf"), + Statuses: String("s"), + TeamDiscussions: String("td"), + VulnerabilityAlerts: String("va"), + Workflows: String("w"), + }, + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + HasMultipleSingleFiles: Bool(false), + SuspendedBy: &User{ + Login: String("l"), + ID: Int64(1), + URL: String("u"), + AvatarURL: String("a"), + GravatarID: String("g"), + Name: String("n"), + Company: String("c"), + Blog: String("b"), + Location: String("l"), + Email: String("e"), + Hireable: Bool(true), + Bio: String("b"), + TwitterUsername: String("t"), + PublicRepos: Int(1), + Followers: Int(1), + Following: Int(1), + CreatedAt: &Timestamp{referenceTime}, + SuspendedAt: &Timestamp{referenceTime}, + }, + SuspendedAt: &Timestamp{referenceTime}, + }, + } + want := `{ + "action": "a", + "alert": { + "number": 1, + "state": "s", + "dependency": { + "package": { + "ecosystem": "e", + "name": "n" + }, + "manifest_path": "mp", + "scope": "s" + }, + "security_advisory": { + "ghsa_id": "ghsaid", + "cve_id": "cveid", + "summary": "s", + "description": "d", + "vulnerabilities": [ + { + "package": { + "ecosystem": "e", + "name": "n" + }, + "severity": "s" + } + ], + "severity": "s", + "cvss": { + "score": 1.0, + "vector_string": "vs" + }, + "cwes": [ + { + "cwe_id": "cweid", + "name": "n" + } + ], + "identifiers": [ + { + "value": "v", + "type": "t" + } + ], + "references": [ + { + "url": "u" + } + ], + "published_at": ` + referenceTimeStr + `, + "updated_at": ` + referenceTimeStr + `, + "withdrawn_at": ` + referenceTimeStr + ` + }, + "security_vulnerability": { + "package": { + "ecosystem": "e", + "name": "n" + }, + "severity": "s", + "vulnerable_version_range": "vvr", + "first_patched_version": { + "identifier": "i" + } + }, + "url": "u", + "html_url": "hu", + "created_at": ` + referenceTimeStr + `, + "updated_at": ` + referenceTimeStr + `, + "dismissed_at": ` + referenceTimeStr + `, + "dismissed_by": { + "login": "l", + "id": 1, + "node_id": "n", + "avatar_url": "a", + "url": "u", + "events_url": "e", + "repos_url": "r" + }, + "dismissed_reason": "dr", + "dismissed_comment": "dc", + "fixed_at": ` + referenceTimeStr + `, + "auto_dismissed_at": ` + referenceTimeStr + ` + }, + "repository": { + "id": 1, + "name": "n", + "url": "s" + }, + "organization": { + "name": "n", + "company": "c", + "blog": "b", + "location": "loc", + "email": "e", + "twitter_username": "tu", + "description": "d", + "billing_email": "be", + "is_verified": true, + "has_organization_projects": true, + "has_repository_projects": true, + "default_repository_permission": "drp", + "members_can_create_repositories": true, + "members_can_create_public_repositories": false, + "members_can_create_private_repositories": true, + "members_can_create_internal_repositories": true, + "members_allowed_repository_creation_type": "marct", + "members_can_create_pages": true, + "members_can_create_public_pages": false, + "members_can_create_private_pages": true + }, + "enterprise": { + "id": 1, + "slug": "s", + "name": "n", + "node_id": "nid", + "avatar_url": "au", + "description": "d", + "website_url": "wu", + "html_url": "hu", + "created_at": ` + referenceTimeStr + `, + "updated_at": ` + referenceTimeStr + ` + }, + "sender": { + "login": "l", + "id": 1, + "node_id": "n", + "avatar_url": "a", + "url": "u", + "events_url": "e", + "repos_url": "r" + }, + "installation": { + "id": 1, + "node_id": "nid", + "app_id": 1, + "app_slug": "as", + "target_id": 1, + "account": { + "login": "l", + "id": 1, + "avatar_url": "a", + "gravatar_id": "g", + "name": "n", + "company": "c", + "blog": "b", + "location": "l", + "email": "e", + "hireable": true, + "bio": "b", + "twitter_username": "t", + "public_repos": 1, + "followers": 1, + "following": 1, + "created_at": ` + referenceTimeStr + `, + "suspended_at": ` + referenceTimeStr + `, + "url": "u" + }, + "access_tokens_url": "atu", + "repositories_url": "ru", + "html_url": "hu", + "target_type": "tt", + "single_file_name": "sfn", + "repository_selection": "rs", + "events": [ + "e" + ], + "single_file_paths": [ + "s" + ], + "permissions": { + "actions": "a", + "administration": "ad", + "checks": "c", + "contents": "co", + "content_references": "cr", + "deployments": "d", + "environments": "e", + "issues": "i", + "metadata": "md", + "members": "m", + "organization_administration": "oa", + "organization_hooks": "oh", + "organization_plan": "op", + "organization_pre_receive_hooks": "opr", + "organization_projects": "op", + "organization_secrets": "os", + "organization_self_hosted_runners": "osh", + "organization_user_blocking": "oub", + "packages": "pkg", + "pages": "pg", + "pull_requests": "pr", + "repository_hooks": "rh", + "repository_projects": "rp", + "repository_pre_receive_hooks": "rprh", + "secrets": "s", + "secret_scanning_alerts": "ssa", + "security_events": "se", + "single_file": "sf", + "statuses": "s", + "team_discussions": "td", + "vulnerability_alerts": "va", + "workflows": "w" + }, + "created_at": ` + referenceTimeStr + `, + "updated_at": ` + referenceTimeStr + `, + "has_multiple_single_files": false, + "suspended_by": { + "login": "l", + "id": 1, + "avatar_url": "a", + "gravatar_id": "g", + "name": "n", + "company": "c", + "blog": "b", + "location": "l", + "email": "e", + "hireable": true, + "bio": "b", + "twitter_username": "t", + "public_repos": 1, + "followers": 1, + "following": 1, + "created_at": ` + referenceTimeStr + `, + "suspended_at": ` + referenceTimeStr + `, + "url": "u" + }, + "suspended_at": ` + referenceTimeStr + ` + } + }` + + testJSONMarshal(t, e, want) +} + func TestForkEvent_Marshal(t *testing.T) { testJSONMarshal(t, &ForkEvent{}, "{}") diff --git a/github/github-accessors.go b/github/github-accessors.go index 562ad734562..113053627c0 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -4926,6 +4926,14 @@ func (d *DeleteEvent) GetSender() *User { return d.Sender } +// GetAutoDismissedAt returns the AutoDismissedAt field if it's non-nil, zero value otherwise. +func (d *DependabotAlert) GetAutoDismissedAt() Timestamp { + if d == nil || d.AutoDismissedAt == nil { + return Timestamp{} + } + return *d.AutoDismissedAt +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (d *DependabotAlert) GetCreatedAt() Timestamp { if d == nil || d.CreatedAt == nil { @@ -5046,6 +5054,62 @@ func (d *DependabotAlert) GetURL() string { return *d.URL } +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (d *DependabotAlertEvent) GetAction() string { + if d == nil || d.Action == nil { + return "" + } + return *d.Action +} + +// GetAlert returns the Alert field. +func (d *DependabotAlertEvent) GetAlert() *DependabotAlert { + if d == nil { + return nil + } + return d.Alert +} + +// GetEnterprise returns the Enterprise field. +func (d *DependabotAlertEvent) GetEnterprise() *Enterprise { + if d == nil { + return nil + } + return d.Enterprise +} + +// GetInstallation returns the Installation field. +func (d *DependabotAlertEvent) GetInstallation() *Installation { + if d == nil { + return nil + } + return d.Installation +} + +// GetOrganization returns the Organization field. +func (d *DependabotAlertEvent) GetOrganization() *Organization { + if d == nil { + return nil + } + return d.Organization +} + +// GetRepo returns the Repo field. +func (d *DependabotAlertEvent) GetRepo() *Repository { + if d == nil { + return nil + } + return d.Repo +} + +// GetSender returns the Sender field. +func (d *DependabotAlertEvent) GetSender() *User { + if d == nil { + return nil + } + return d.Sender +} + // GetCVEID returns the CVEID field if it's non-nil, zero value otherwise. func (d *DependabotSecurityAdvisory) GetCVEID() string { if d == nil || d.CVEID == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 0a6b5271e8b..7ced903790e 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -5816,6 +5816,16 @@ func TestDeleteEvent_GetSender(tt *testing.T) { d.GetSender() } +func TestDependabotAlert_GetAutoDismissedAt(tt *testing.T) { + var zeroValue Timestamp + d := &DependabotAlert{AutoDismissedAt: &zeroValue} + d.GetAutoDismissedAt() + d = &DependabotAlert{} + d.GetAutoDismissedAt() + d = nil + d.GetAutoDismissedAt() +} + func TestDependabotAlert_GetCreatedAt(tt *testing.T) { var zeroValue Timestamp d := &DependabotAlert{CreatedAt: &zeroValue} @@ -5951,6 +5961,58 @@ func TestDependabotAlert_GetURL(tt *testing.T) { d.GetURL() } +func TestDependabotAlertEvent_GetAction(tt *testing.T) { + var zeroValue string + d := &DependabotAlertEvent{Action: &zeroValue} + d.GetAction() + d = &DependabotAlertEvent{} + d.GetAction() + d = nil + d.GetAction() +} + +func TestDependabotAlertEvent_GetAlert(tt *testing.T) { + d := &DependabotAlertEvent{} + d.GetAlert() + d = nil + d.GetAlert() +} + +func TestDependabotAlertEvent_GetEnterprise(tt *testing.T) { + d := &DependabotAlertEvent{} + d.GetEnterprise() + d = nil + d.GetEnterprise() +} + +func TestDependabotAlertEvent_GetInstallation(tt *testing.T) { + d := &DependabotAlertEvent{} + d.GetInstallation() + d = nil + d.GetInstallation() +} + +func TestDependabotAlertEvent_GetOrganization(tt *testing.T) { + d := &DependabotAlertEvent{} + d.GetOrganization() + d = nil + d.GetOrganization() +} + +func TestDependabotAlertEvent_GetRepo(tt *testing.T) { + d := &DependabotAlertEvent{} + d.GetRepo() + d = nil + d.GetRepo() +} + +func TestDependabotAlertEvent_GetSender(tt *testing.T) { + d := &DependabotAlertEvent{} + d.GetSender() + d = nil + d.GetSender() +} + func TestDependabotSecurityAdvisory_GetCVEID(tt *testing.T) { var zeroValue string d := &DependabotSecurityAdvisory{CVEID: &zeroValue} diff --git a/github/messages.go b/github/messages.go index e4fa6f6aa01..c16b6015284 100644 --- a/github/messages.go +++ b/github/messages.go @@ -54,6 +54,7 @@ var ( "content_reference": &ContentReferenceEvent{}, "create": &CreateEvent{}, "delete": &DeleteEvent{}, + "dependabot_alert": &DependabotAlertEvent{}, "deploy_key": &DeployKeyEvent{}, "deployment": &DeploymentEvent{}, "deployment_status": &DeploymentStatusEvent{}, diff --git a/github/messages_test.go b/github/messages_test.go index 193501f90b1..1243d755be8 100644 --- a/github/messages_test.go +++ b/github/messages_test.go @@ -284,6 +284,10 @@ func TestParseWebHook(t *testing.T) { payload: &DeleteEvent{}, messageType: "delete", }, + { + payload: &DependabotAlertEvent{}, + messageType: "dependabot_alert", + }, { payload: &DeployKeyEvent{}, messageType: "deploy_key", diff --git a/github/repos_hooks_deliveries_test.go b/github/repos_hooks_deliveries_test.go index d5e1a383796..057d7121df4 100644 --- a/github/repos_hooks_deliveries_test.go +++ b/github/repos_hooks_deliveries_test.go @@ -150,6 +150,7 @@ var hookDeliveryPayloadTypeToStruct = map[string]interface{}{ "content_reference": &ContentReferenceEvent{}, "create": &CreateEvent{}, "delete": &DeleteEvent{}, + "dependabot_alert": &DependabotAlertEvent{}, "deploy_key": &DeployKeyEvent{}, "deployment": &DeploymentEvent{}, "deployment_status": &DeploymentStatusEvent{}, From b9774adb40c5af048ef3fd1a777cc2b918d7af27 Mon Sep 17 00:00:00 2001 From: Nikita Pivkin Date: Wed, 30 Aug 2023 01:14:11 +0700 Subject: [PATCH 299/751] Add missing fields to SecurityAdvisoryEvent and rename others (#2889) --- github/dependabot_alerts.go | 6 +- github/event_types.go | 9 + github/event_types_test.go | 306 ++++++++++++++++++++++++++++++++ github/github-accessors.go | 58 +++++- github/github-accessors_test.go | 58 +++++- 5 files changed, 421 insertions(+), 16 deletions(-) diff --git a/github/dependabot_alerts.go b/github/dependabot_alerts.go index e39ed277caf..177316b1dc8 100644 --- a/github/dependabot_alerts.go +++ b/github/dependabot_alerts.go @@ -17,8 +17,8 @@ type Dependency struct { Scope *string `json:"scope,omitempty"` } -// AdvisoryCVSs represents the advisory pertaining to the Common Vulnerability Scoring System. -type AdvisoryCVSs struct { +// AdvisoryCVSS represents the advisory pertaining to the Common Vulnerability Scoring System. +type AdvisoryCVSS struct { Score *float64 `json:"score,omitempty"` VectorString *string `json:"vector_string,omitempty"` } @@ -37,7 +37,7 @@ type DependabotSecurityAdvisory struct { Description *string `json:"description,omitempty"` Vulnerabilities []*AdvisoryVulnerability `json:"vulnerabilities,omitempty"` Severity *string `json:"severity,omitempty"` - CVSs *AdvisoryCVSs `json:"cvss,omitempty"` + CVSS *AdvisoryCVSS `json:"cvss,omitempty"` CWEs []*AdvisoryCWEs `json:"cwes,omitempty"` Identifiers []*AdvisoryIdentifier `json:"identifiers,omitempty"` References []*AdvisoryReference `json:"references,omitempty"` diff --git a/github/event_types.go b/github/event_types.go index d402e872463..1a403da9b9d 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -1610,6 +1610,8 @@ type WorkflowRunEvent struct { // // GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#security_advisory type SecurityAdvisory struct { + CVSS *AdvisoryCVSS `json:"cvss,omitempty"` + CWEs []*AdvisoryCWEs `json:"cwes,omitempty"` GHSAID *string `json:"ghsa_id,omitempty"` Summary *string `json:"summary,omitempty"` Description *string `json:"description,omitempty"` @@ -1658,6 +1660,13 @@ type FirstPatchedVersion struct { type SecurityAdvisoryEvent struct { Action *string `json:"action,omitempty"` SecurityAdvisory *SecurityAdvisory `json:"security_advisory,omitempty"` + + // The following fields are only populated by Webhook events. + Enterprise *Enterprise `json:"enterprise,omitempty"` + Installation *Installation `json:"installation,omitempty"` + Organization *Organization `json:"organization,omitempty"` + Repository *Repository `json:"repository,omitempty"` + Sender *User `json:"sender,omitempty"` } // CodeScanningAlertEvent is triggered when a code scanning finds a potential vulnerability or error in your code. diff --git a/github/event_types_test.go b/github/event_types_test.go index 485b1953d19..cd8b64e5a99 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -16769,6 +16769,16 @@ func TestSecurityAdvisoryEvent_Marshal(t *testing.T) { u := &SecurityAdvisoryEvent{ Action: String("published"), SecurityAdvisory: &SecurityAdvisory{ + CVSS: &AdvisoryCVSS{ + Score: Float64(1.0), + VectorString: String("vs"), + }, + CWEs: []*AdvisoryCWEs{ + { + CWEID: String("cweid"), + Name: String("n"), + }, + }, GHSAID: String("GHSA-rf4j-j272-some"), Summary: String("Siuuuuuuuuu"), Description: String("desc"), @@ -16801,6 +16811,147 @@ func TestSecurityAdvisoryEvent_Marshal(t *testing.T) { }, }, }, + Enterprise: &Enterprise{ + ID: Int(1), + Slug: String("s"), + Name: String("n"), + NodeID: String("nid"), + AvatarURL: String("au"), + Description: String("d"), + WebsiteURL: String("wu"), + HTMLURL: String("hu"), + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + }, + Installation: &Installation{ + ID: Int64(1), + NodeID: String("nid"), + AppID: Int64(1), + AppSlug: String("as"), + TargetID: Int64(1), + Account: &User{ + Login: String("l"), + ID: Int64(1), + URL: String("u"), + AvatarURL: String("a"), + GravatarID: String("g"), + Name: String("n"), + Company: String("c"), + Blog: String("b"), + Location: String("l"), + Email: String("e"), + Hireable: Bool(true), + Bio: String("b"), + TwitterUsername: String("t"), + PublicRepos: Int(1), + Followers: Int(1), + Following: Int(1), + CreatedAt: &Timestamp{referenceTime}, + SuspendedAt: &Timestamp{referenceTime}, + }, + AccessTokensURL: String("atu"), + RepositoriesURL: String("ru"), + HTMLURL: String("hu"), + TargetType: String("tt"), + SingleFileName: String("sfn"), + RepositorySelection: String("rs"), + Events: []string{"e"}, + SingleFilePaths: []string{"s"}, + Permissions: &InstallationPermissions{ + Actions: String("a"), + Administration: String("ad"), + Checks: String("c"), + Contents: String("co"), + ContentReferences: String("cr"), + Deployments: String("d"), + Environments: String("e"), + Issues: String("i"), + Metadata: String("md"), + Members: String("m"), + OrganizationAdministration: String("oa"), + OrganizationHooks: String("oh"), + OrganizationPlan: String("op"), + OrganizationPreReceiveHooks: String("opr"), + OrganizationProjects: String("op"), + OrganizationSecrets: String("os"), + OrganizationSelfHostedRunners: String("osh"), + OrganizationUserBlocking: String("oub"), + Packages: String("pkg"), + Pages: String("pg"), + PullRequests: String("pr"), + RepositoryHooks: String("rh"), + RepositoryProjects: String("rp"), + RepositoryPreReceiveHooks: String("rprh"), + Secrets: String("s"), + SecretScanningAlerts: String("ssa"), + SecurityEvents: String("se"), + SingleFile: String("sf"), + Statuses: String("s"), + TeamDiscussions: String("td"), + VulnerabilityAlerts: String("va"), + Workflows: String("w"), + }, + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + HasMultipleSingleFiles: Bool(false), + SuspendedBy: &User{ + Login: String("l"), + ID: Int64(1), + URL: String("u"), + AvatarURL: String("a"), + GravatarID: String("g"), + Name: String("n"), + Company: String("c"), + Blog: String("b"), + Location: String("l"), + Email: String("e"), + Hireable: Bool(true), + Bio: String("b"), + TwitterUsername: String("t"), + PublicRepos: Int(1), + Followers: Int(1), + Following: Int(1), + CreatedAt: &Timestamp{referenceTime}, + SuspendedAt: &Timestamp{referenceTime}, + }, + SuspendedAt: &Timestamp{referenceTime}, + }, + Organization: &Organization{ + BillingEmail: String("be"), + Blog: String("b"), + Company: String("c"), + Email: String("e"), + TwitterUsername: String("tu"), + Location: String("loc"), + Name: String("n"), + Description: String("d"), + IsVerified: Bool(true), + HasOrganizationProjects: Bool(true), + HasRepositoryProjects: Bool(true), + DefaultRepoPermission: String("drp"), + MembersCanCreateRepos: Bool(true), + MembersCanCreateInternalRepos: Bool(true), + MembersCanCreatePrivateRepos: Bool(true), + MembersCanCreatePublicRepos: Bool(false), + MembersAllowedRepositoryCreationType: String("marct"), + MembersCanCreatePages: Bool(true), + MembersCanCreatePublicPages: Bool(false), + MembersCanCreatePrivatePages: Bool(true), + }, + Repository: &Repository{ + ID: Int64(1), + URL: String("s"), + Name: String("n"), + }, + Sender: &User{ + Login: String("l"), + ID: Int64(1), + NodeID: String("n"), + URL: String("u"), + ReposURL: String("r"), + EventsURL: String("e"), + AvatarURL: String("a"), + }, } want := `{ @@ -16808,6 +16959,16 @@ func TestSecurityAdvisoryEvent_Marshal(t *testing.T) { "security_advisory": { "ghsa_id": "GHSA-rf4j-j272-some", "summary": "Siuuuuuuuuu", + "cvss": { + "score": 1.0, + "vector_string": "vs" + }, + "cwes": [ + { + "cwe_id": "cweid", + "name": "n" + } + ], "description": "desc", "severity": "moderate", "identifiers": [ @@ -16837,6 +16998,151 @@ func TestSecurityAdvisoryEvent_Marshal(t *testing.T) { } } ] + }, + "enterprise": { + "id": 1, + "slug": "s", + "name": "n", + "node_id": "nid", + "avatar_url": "au", + "description": "d", + "website_url": "wu", + "html_url": "hu", + "created_at": ` + referenceTimeStr + `, + "updated_at": ` + referenceTimeStr + ` + }, + "installation": { + "id": 1, + "node_id": "nid", + "app_id": 1, + "app_slug": "as", + "target_id": 1, + "account": { + "login": "l", + "id": 1, + "avatar_url": "a", + "gravatar_id": "g", + "name": "n", + "company": "c", + "blog": "b", + "location": "l", + "email": "e", + "hireable": true, + "bio": "b", + "twitter_username": "t", + "public_repos": 1, + "followers": 1, + "following": 1, + "created_at": ` + referenceTimeStr + `, + "suspended_at": ` + referenceTimeStr + `, + "url": "u" + }, + "access_tokens_url": "atu", + "repositories_url": "ru", + "html_url": "hu", + "target_type": "tt", + "single_file_name": "sfn", + "repository_selection": "rs", + "events": [ + "e" + ], + "single_file_paths": [ + "s" + ], + "permissions": { + "actions": "a", + "administration": "ad", + "checks": "c", + "contents": "co", + "content_references": "cr", + "deployments": "d", + "environments": "e", + "issues": "i", + "metadata": "md", + "members": "m", + "organization_administration": "oa", + "organization_hooks": "oh", + "organization_plan": "op", + "organization_pre_receive_hooks": "opr", + "organization_projects": "op", + "organization_secrets": "os", + "organization_self_hosted_runners": "osh", + "organization_user_blocking": "oub", + "packages": "pkg", + "pages": "pg", + "pull_requests": "pr", + "repository_hooks": "rh", + "repository_projects": "rp", + "repository_pre_receive_hooks": "rprh", + "secrets": "s", + "secret_scanning_alerts": "ssa", + "security_events": "se", + "single_file": "sf", + "statuses": "s", + "team_discussions": "td", + "vulnerability_alerts": "va", + "workflows": "w" + }, + "created_at": ` + referenceTimeStr + `, + "updated_at": ` + referenceTimeStr + `, + "has_multiple_single_files": false, + "suspended_by": { + "login": "l", + "id": 1, + "avatar_url": "a", + "gravatar_id": "g", + "name": "n", + "company": "c", + "blog": "b", + "location": "l", + "email": "e", + "hireable": true, + "bio": "b", + "twitter_username": "t", + "public_repos": 1, + "followers": 1, + "following": 1, + "created_at": ` + referenceTimeStr + `, + "suspended_at": ` + referenceTimeStr + `, + "url": "u" + }, + "suspended_at": ` + referenceTimeStr + ` + }, + "organization": { + "name": "n", + "company": "c", + "blog": "b", + "location": "loc", + "email": "e", + "twitter_username": "tu", + "description": "d", + "billing_email": "be", + "is_verified": true, + "has_organization_projects": true, + "has_repository_projects": true, + "default_repository_permission": "drp", + "members_can_create_repositories": true, + "members_can_create_public_repositories": false, + "members_can_create_private_repositories": true, + "members_can_create_internal_repositories": true, + "members_allowed_repository_creation_type": "marct", + "members_can_create_pages": true, + "members_can_create_public_pages": false, + "members_can_create_private_pages": true + }, + "repository": { + "id": 1, + "url": "s", + "name": "n" + }, + "sender": { + "login": "l", + "id": 1, + "node_id": "n", + "avatar_url": "a", + "url": "u", + "events_url": "e", + "repos_url": "r" } }` diff --git a/github/github-accessors.go b/github/github-accessors.go index 113053627c0..d9b730396ff 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -343,7 +343,7 @@ func (a *AdvancedSecurityCommittersBreakdown) GetUserLogin() string { } // GetScore returns the Score field. -func (a *AdvisoryCVSs) GetScore() *float64 { +func (a *AdvisoryCVSS) GetScore() *float64 { if a == nil { return nil } @@ -351,7 +351,7 @@ func (a *AdvisoryCVSs) GetScore() *float64 { } // GetVectorString returns the VectorString field if it's non-nil, zero value otherwise. -func (a *AdvisoryCVSs) GetVectorString() string { +func (a *AdvisoryCVSS) GetVectorString() string { if a == nil || a.VectorString == nil { return "" } @@ -5118,12 +5118,12 @@ func (d *DependabotSecurityAdvisory) GetCVEID() string { return *d.CVEID } -// GetCVSs returns the CVSs field. -func (d *DependabotSecurityAdvisory) GetCVSs() *AdvisoryCVSs { +// GetCVSS returns the CVSS field. +func (d *DependabotSecurityAdvisory) GetCVSS() *AdvisoryCVSS { if d == nil { return nil } - return d.CVSs + return d.CVSS } // GetDescription returns the Description field if it's non-nil, zero value otherwise. @@ -20694,6 +20694,14 @@ func (s *SecretScanningPushProtection) GetStatus() string { return *s.Status } +// GetCVSS returns the CVSS field. +func (s *SecurityAdvisory) GetCVSS() *AdvisoryCVSS { + if s == nil { + return nil + } + return s.CVSS +} + // GetDescription returns the Description field if it's non-nil, zero value otherwise. func (s *SecurityAdvisory) GetDescription() string { if s == nil || s.Description == nil { @@ -20758,6 +20766,38 @@ func (s *SecurityAdvisoryEvent) GetAction() string { return *s.Action } +// GetEnterprise returns the Enterprise field. +func (s *SecurityAdvisoryEvent) GetEnterprise() *Enterprise { + if s == nil { + return nil + } + return s.Enterprise +} + +// GetInstallation returns the Installation field. +func (s *SecurityAdvisoryEvent) GetInstallation() *Installation { + if s == nil { + return nil + } + return s.Installation +} + +// GetOrganization returns the Organization field. +func (s *SecurityAdvisoryEvent) GetOrganization() *Organization { + if s == nil { + return nil + } + return s.Organization +} + +// GetRepository returns the Repository field. +func (s *SecurityAdvisoryEvent) GetRepository() *Repository { + if s == nil { + return nil + } + return s.Repository +} + // GetSecurityAdvisory returns the SecurityAdvisory field. func (s *SecurityAdvisoryEvent) GetSecurityAdvisory() *SecurityAdvisory { if s == nil { @@ -20766,6 +20806,14 @@ func (s *SecurityAdvisoryEvent) GetSecurityAdvisory() *SecurityAdvisory { return s.SecurityAdvisory } +// GetSender returns the Sender field. +func (s *SecurityAdvisoryEvent) GetSender() *User { + if s == nil { + return nil + } + return s.Sender +} + // GetAdvancedSecurity returns the AdvancedSecurity field. func (s *SecurityAndAnalysis) GetAdvancedSecurity() *AdvancedSecurity { if s == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 7ced903790e..6abb7fea56a 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -392,18 +392,18 @@ func TestAdvancedSecurityCommittersBreakdown_GetUserLogin(tt *testing.T) { a.GetUserLogin() } -func TestAdvisoryCVSs_GetScore(tt *testing.T) { - a := &AdvisoryCVSs{} +func TestAdvisoryCVSS_GetScore(tt *testing.T) { + a := &AdvisoryCVSS{} a.GetScore() a = nil a.GetScore() } -func TestAdvisoryCVSs_GetVectorString(tt *testing.T) { +func TestAdvisoryCVSS_GetVectorString(tt *testing.T) { var zeroValue string - a := &AdvisoryCVSs{VectorString: &zeroValue} + a := &AdvisoryCVSS{VectorString: &zeroValue} a.GetVectorString() - a = &AdvisoryCVSs{} + a = &AdvisoryCVSS{} a.GetVectorString() a = nil a.GetVectorString() @@ -6023,11 +6023,11 @@ func TestDependabotSecurityAdvisory_GetCVEID(tt *testing.T) { d.GetCVEID() } -func TestDependabotSecurityAdvisory_GetCVSs(tt *testing.T) { +func TestDependabotSecurityAdvisory_GetCVSS(tt *testing.T) { d := &DependabotSecurityAdvisory{} - d.GetCVSs() + d.GetCVSS() d = nil - d.GetCVSs() + d.GetCVSS() } func TestDependabotSecurityAdvisory_GetDescription(tt *testing.T) { @@ -24116,6 +24116,13 @@ func TestSecretScanningPushProtection_GetStatus(tt *testing.T) { s.GetStatus() } +func TestSecurityAdvisory_GetCVSS(tt *testing.T) { + s := &SecurityAdvisory{} + s.GetCVSS() + s = nil + s.GetCVSS() +} + func TestSecurityAdvisory_GetDescription(tt *testing.T) { var zeroValue string s := &SecurityAdvisory{Description: &zeroValue} @@ -24196,6 +24203,34 @@ func TestSecurityAdvisoryEvent_GetAction(tt *testing.T) { s.GetAction() } +func TestSecurityAdvisoryEvent_GetEnterprise(tt *testing.T) { + s := &SecurityAdvisoryEvent{} + s.GetEnterprise() + s = nil + s.GetEnterprise() +} + +func TestSecurityAdvisoryEvent_GetInstallation(tt *testing.T) { + s := &SecurityAdvisoryEvent{} + s.GetInstallation() + s = nil + s.GetInstallation() +} + +func TestSecurityAdvisoryEvent_GetOrganization(tt *testing.T) { + s := &SecurityAdvisoryEvent{} + s.GetOrganization() + s = nil + s.GetOrganization() +} + +func TestSecurityAdvisoryEvent_GetRepository(tt *testing.T) { + s := &SecurityAdvisoryEvent{} + s.GetRepository() + s = nil + s.GetRepository() +} + func TestSecurityAdvisoryEvent_GetSecurityAdvisory(tt *testing.T) { s := &SecurityAdvisoryEvent{} s.GetSecurityAdvisory() @@ -24203,6 +24238,13 @@ func TestSecurityAdvisoryEvent_GetSecurityAdvisory(tt *testing.T) { s.GetSecurityAdvisory() } +func TestSecurityAdvisoryEvent_GetSender(tt *testing.T) { + s := &SecurityAdvisoryEvent{} + s.GetSender() + s = nil + s.GetSender() +} + func TestSecurityAndAnalysis_GetAdvancedSecurity(tt *testing.T) { s := &SecurityAndAnalysis{} s.GetAdvancedSecurity() From 68ffeb7dbf9902052e441db4ec83d828534de84a Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Tue, 29 Aug 2023 14:25:56 -0400 Subject: [PATCH 300/751] Fix merge issue from field renaming (#2906) Fixes: #2905. --- github/event_types_test.go | 2 +- go.sum | 36 ------------------------------------ 2 files changed, 1 insertion(+), 37 deletions(-) diff --git a/github/event_types_test.go b/github/event_types_test.go index cd8b64e5a99..31b94479f3b 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -12731,7 +12731,7 @@ func TestDependabotAlertEvent_Marshal(t *testing.T) { }, }, Severity: String("s"), - CVSs: &AdvisoryCVSs{ + CVSS: &AdvisoryCVSS{ Score: Float64(1.0), VectorString: String("vs"), }, diff --git a/go.sum b/go.sum index 68e49aed424..3317d0c67b7 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,6 @@ github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= @@ -10,51 +9,16 @@ github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= 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/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From e3cda7864bceb2bbbed07fb2f353446bdc13590d Mon Sep 17 00:00:00 2001 From: Jarek Porzucek <17789797+jporzucek@users.noreply.github.com> Date: Wed, 30 Aug 2023 16:41:29 +0200 Subject: [PATCH 301/751] Add missing CodeScanning endpoints (#2900) Fixes: #2899. --- github/code-scanning.go | 189 +++++++++++++- github/code-scanning_test.go | 433 +++++++++++++++++++++++++++++--- github/github-accessors.go | 120 +++++++++ github/github-accessors_test.go | 147 +++++++++++ 4 files changed, 839 insertions(+), 50 deletions(-) diff --git a/github/code-scanning.go b/github/code-scanning.go index 09c03647876..0ae269be676 100644 --- a/github/code-scanning.go +++ b/github/code-scanning.go @@ -48,11 +48,13 @@ type Message struct { type MostRecentInstance struct { Ref *string `json:"ref,omitempty"` AnalysisKey *string `json:"analysis_key,omitempty"` + Category *string `json:"category,omitempty"` Environment *string `json:"environment,omitempty"` State *string `json:"state,omitempty"` CommitSHA *string `json:"commit_sha,omitempty"` Message *Message `json:"message,omitempty"` Location *Location `json:"location,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` Classifications []string `json:"classifications,omitempty"` } @@ -113,13 +115,22 @@ func (a *Alert) ID() int64 { return id } -// AlertListOptions specifies optional parameters to the CodeScanningService.ListAlerts -// method. +// AlertInstancesListOptions specifies optional parameters to the CodeScanningService.ListAlertInstances method. +type AlertInstancesListOptions struct { + // Return code scanning alert instances for a specific branch reference. + // The ref can be formatted as refs/heads/ or simply . To reference a pull request use refs/pull//merge + Ref string `url:"ref,omitempty"` + + ListOptions +} + +// AlertListOptions specifies optional parameters to the CodeScanningService.ListAlerts method. type AlertListOptions struct { // State of the code scanning alerts to list. Set to closed to list only closed code scanning alerts. Default: open State string `url:"state,omitempty"` - // Return code scanning alerts for a specific branch reference. The ref must be formatted as heads/. + // Return code scanning alerts for a specific branch reference. + // The ref can be formatted as refs/heads/ or simply . To reference a pull request use refs/pull//merge Ref string `url:"ref,omitempty"` // If specified, only code scanning alerts with this severity will be returned. Possible values are: critical, high, medium, low, warning, note, error. @@ -140,12 +151,28 @@ type AnalysesListOptions struct { // Return code scanning analyses belonging to the same SARIF upload. SarifID *string `url:"sarif_id,omitempty"` - // Return code scanning analyses for a specific branch reference. The ref can be formatted as refs/heads/ or simply . + // Return code scanning analyses for a specific branch reference. + // The ref can be formatted as refs/heads/ or simply . To reference a pull request use refs/pull//merge Ref *string `url:"ref,omitempty"` ListOptions } +// CodeQLDatabase represents a metadata about the CodeQL database. +// +// GitHub API docs: https://docs.github.com/en/rest/code-scanning +type CodeQLDatabase struct { + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Language *string `json:"language,omitempty"` + Uploader *User `json:"uploader,omitempty"` + ContentType *string `json:"content_type,omitempty"` + Size *int64 `json:"size,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + URL *string `json:"url,omitempty"` +} + // ScanningAnalysis represents an individual GitHub Code Scanning ScanningAnalysis on a single repository. // // GitHub API docs: https://docs.github.com/en/rest/code-scanning @@ -208,7 +235,7 @@ type SarifID struct { // You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events // read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning#list-code-scanning-alerts-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-organization func (s *CodeScanningService) ListAlertsForOrg(ctx context.Context, org string, opts *AlertListOptions) ([]*Alert, *Response, error) { u := fmt.Sprintf("orgs/%v/code-scanning/alerts", org) u, err := addOptions(u, opts) @@ -236,7 +263,7 @@ func (s *CodeScanningService) ListAlertsForOrg(ctx context.Context, org string, // You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events // read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning#list-code-scanning-alerts-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-a-repository func (s *CodeScanningService) ListAlertsForRepo(ctx context.Context, owner, repo string, opts *AlertListOptions) ([]*Alert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/alerts", owner, repo) u, err := addOptions(u, opts) @@ -265,7 +292,7 @@ func (s *CodeScanningService) ListAlertsForRepo(ctx context.Context, owner, repo // // The security alert_id is the number at the end of the security alert's URL. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning#get-a-code-scanning-alert +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#get-a-code-scanning-alert func (s *CodeScanningService) GetAlert(ctx context.Context, owner, repo string, id int64) (*Alert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/alerts/%v", owner, repo, id) @@ -308,13 +335,40 @@ func (s *CodeScanningService) UpdateAlert(ctx context.Context, owner, repo strin return a, resp, nil } +// ListAlertInstances lists instances of a code scanning alert. +// +// You must use an access token with the security_events scope to use this endpoint. +// GitHub Apps must have the security_events read permission to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#list-instances-of-a-code-scanning-alert +func (s *CodeScanningService) ListAlertInstances(ctx context.Context, owner, repo string, id int64, opts *AlertInstancesListOptions) ([]*MostRecentInstance, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/code-scanning/alerts/%v/instances", owner, repo, id) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var alertInstances []*MostRecentInstance + resp, err := s.client.Do(ctx, req, &alertInstances) + if err != nil { + return nil, resp, err + } + + return alertInstances, resp, nil +} + // UploadSarif uploads the result of code scanning job to GitHub. // // For the parameter sarif, you must first compress your SARIF file using gzip and then translate the contents of the file into a Base64 encoding string. // You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events // write permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning#upload-an-analysis-as-sarif-data +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#upload-an-analysis-as-sarif-data func (s *CodeScanningService) UploadSarif(ctx context.Context, owner, repo string, sarif *SarifAnalysis) (*SarifID, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/sarifs", owner, repo) @@ -332,13 +386,45 @@ func (s *CodeScanningService) UploadSarif(ctx context.Context, owner, repo strin return sarifID, resp, nil } +// SARIFUpload represents information about a SARIF upload. +type SARIFUpload struct { + // `pending` files have not yet been processed, while `complete` means results from the SARIF have been stored. + // `failed` files have either not been processed at all, or could only be partially processed. + ProcessingStatus *string `json:"processing_status,omitempty"` + // The REST API URL for getting the analyses associated with the upload. + AnalysesURL *string `json:"analyses_url,omitempty"` +} + +// GetSARIF gets information about a SARIF upload. +// +// You must use an access token with the security_events scope to use this endpoint. +// GitHub Apps must have the security_events read permission to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#get-information-about-a-sarif-upload +func (s *CodeScanningService) GetSARIF(ctx context.Context, owner, repo, sarifID string) (*SARIFUpload, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/code-scanning/sarifs/%v", owner, repo, sarifID) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + sarifUpload := new(SARIFUpload) + resp, err := s.client.Do(ctx, req, sarifUpload) + if err != nil { + return nil, resp, err + } + + return sarifUpload, resp, nil +} + // ListAnalysesForRepo lists code scanning analyses for a repository. // // Lists the details of all code scanning analyses for a repository, starting with the most recent. // You must use an access token with the security_events scope to use this endpoint. // GitHub Apps must have the security_events read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning#list-code-scanning-analyses-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#list-code-scanning-analyses-for-a-repository func (s *CodeScanningService) ListAnalysesForRepo(ctx context.Context, owner, repo string, opts *AnalysesListOptions) ([]*ScanningAnalysis, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/analyses", owner, repo) u, err := addOptions(u, opts) @@ -367,7 +453,7 @@ func (s *CodeScanningService) ListAnalysesForRepo(ctx context.Context, owner, re // // The security analysis_id is the ID of the analysis, as returned from the ListAnalysesForRepo operation. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning#get-a-code-scanning-analysis-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository func (s *CodeScanningService) GetAnalysis(ctx context.Context, owner, repo string, id int64) (*ScanningAnalysis, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/analyses/%v", owner, repo, id) @@ -385,6 +471,85 @@ func (s *CodeScanningService) GetAnalysis(ctx context.Context, owner, repo strin return analysis, resp, nil } +// DeleteAnalysis represents a successful deletion of a code scanning analysis. +type DeleteAnalysis struct { + // Next deletable analysis in chain, without last analysis deletion confirmation + NextAnalysisURL *string `json:"next_analysis_url,omitempty"` + // Next deletable analysis in chain, with last analysis deletion confirmation + ConfirmDeleteURL *string `json:"confirm_delete_url,omitempty"` +} + +// DeleteAnalysis deletes a single code scanning analysis from a repository. +// +// You must use an access token with the repo scope to use this endpoint. +// GitHub Apps must have the security_events read permission to use this endpoint. +// +// The security analysis_id is the ID of the analysis, as returned from the ListAnalysesForRepo operation. +// +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#delete-a-code-scanning-analysis-from-a-repository +func (s *CodeScanningService) DeleteAnalysis(ctx context.Context, owner, repo string, id int64) (*DeleteAnalysis, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/code-scanning/analyses/%v", owner, repo, id) + + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, nil, err + } + + deleteAnalysis := new(DeleteAnalysis) + resp, err := s.client.Do(ctx, req, deleteAnalysis) + if err != nil { + return nil, resp, err + } + + return deleteAnalysis, resp, nil +} + +// ListCodeQLDatabases lists the CodeQL databases that are available in a repository. +// +// You must use an access token with the security_events scope to use this endpoint. +// GitHub Apps must have the contents read permission to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#list-codeql-databases-for-a-repository +func (s *CodeScanningService) ListCodeQLDatabases(ctx context.Context, owner, repo string) ([]*CodeQLDatabase, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/code-scanning/codeql/databases", owner, repo) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var codeqlDatabases []*CodeQLDatabase + resp, err := s.client.Do(ctx, req, &codeqlDatabases) + if err != nil { + return nil, resp, err + } + + return codeqlDatabases, resp, nil +} + +// GetCodeQLDatabase gets a CodeQL database for a language in a repository. +// +// You must use an access token with the security_events scope to use this endpoint. +// GitHub Apps must have the contents read permission to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#get-a-codeql-database-for-a-repository +func (s *CodeScanningService) GetCodeQLDatabase(ctx context.Context, owner, repo, language string) (*CodeQLDatabase, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/code-scanning/codeql/databases/%v", owner, repo, language) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + codeqlDatabase := new(CodeQLDatabase) + resp, err := s.client.Do(ctx, req, codeqlDatabase) + if err != nil { + return nil, resp, err + } + + return codeqlDatabase, resp, nil +} + // DefaultSetupConfiguration represents a code scanning default setup configuration. type DefaultSetupConfiguration struct { State *string `json:"state,omitempty"` @@ -399,7 +564,7 @@ type DefaultSetupConfiguration struct { // endpoint with private repos or the public_repo scope for public repos. GitHub Apps must have the repo write // permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning#get-a-code-scanning-default-setup-configuration +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#get-a-code-scanning-default-setup-configuration func (s *CodeScanningService) GetDefaultSetupConfiguration(ctx context.Context, owner, repo string) (*DefaultSetupConfiguration, *Response, error) { u := fmt.Sprintf("repos/%s/%s/code-scanning/default-setup", owner, repo) @@ -440,7 +605,7 @@ type UpdateDefaultSetupConfigurationResponse struct { // This method might return an AcceptedError and a status code of 202. This is because this is the status that GitHub // returns to signify that it has now scheduled the update of the pull request branch in a background task. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning#update-a-code-scanning-default-setup-configuration +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#update-a-code-scanning-default-setup-configuration func (s *CodeScanningService) UpdateDefaultSetupConfiguration(ctx context.Context, owner, repo string, options *UpdateDefaultSetupConfigurationOptions) (*UpdateDefaultSetupConfigurationResponse, *Response, error) { u := fmt.Sprintf("repos/%s/%s/code-scanning/default-setup", owner, repo) diff --git a/github/code-scanning_test.go b/github/code-scanning_test.go index 20d4817d3f1..e42f1d8b37f 100644 --- a/github/code-scanning_test.go +++ b/github/code-scanning_test.go @@ -89,6 +89,47 @@ func TestCodeScanningService_UploadSarif(t *testing.T) { }) } +func TestCodeScanningService_GetSARIF(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/code-scanning/sarifs/abc", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "processing_status": "s", + "analyses_url": "u" + }`) + }) + + ctx := context.Background() + sarifUpload, _, err := client.CodeScanning.GetSARIF(ctx, "o", "r", "abc") + if err != nil { + t.Errorf("CodeScanning.GetSARIF returned error: %v", err) + } + + want := &SARIFUpload{ + ProcessingStatus: String("s"), + AnalysesURL: String("u"), + } + if !cmp.Equal(sarifUpload, want) { + t.Errorf("CodeScanning.GetSARIF returned %+v, want %+v", sarifUpload, want) + } + + const methodName = "GetSARIF" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.CodeScanning.GetSARIF(ctx, "\n", "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.CodeScanning.GetSARIF(ctx, "o", "r", "abc") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + func TestCodeScanningService_ListAlertsForOrg(t *testing.T) { client, mux, _, teardown := setup() defer teardown() @@ -730,52 +771,133 @@ func TestCodeScanningService_UpdateAlert(t *testing.T) { }) } +func TestCodeScanningService_ListAlertInstances(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/code-scanning/alerts/88/instances", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `[ + { + "ref": "refs/heads/main", + "analysis_key": ".github/workflows/codeql-analysis.yml:analyze", + "environment": "", + "category": ".github/workflows/codeql-analysis.yml:analyze", + "state": "open", + "fixed_at": null, + "commit_sha": "abcdefg12345", + "message": { + "text": "This path depends on a user-provided value." + }, + "location": { + "path": "spec-main/api-session-spec.ts", + "start_line": 917, + "end_line": 917, + "start_column": 7, + "end_column": 18 + }, + "classifications": [ + "test" + ] + } + ]`) + }) + + opts := &AlertInstancesListOptions{Ref: "heads/main", ListOptions: ListOptions{Page: 1}} + ctx := context.Background() + instances, _, err := client.CodeScanning.ListAlertInstances(ctx, "o", "r", 88, opts) + if err != nil { + t.Errorf("CodeScanning.ListAlertInstances returned error: %v", err) + } + + want := []*MostRecentInstance{ + { + Ref: String("refs/heads/main"), + AnalysisKey: String(".github/workflows/codeql-analysis.yml:analyze"), + Category: String(".github/workflows/codeql-analysis.yml:analyze"), + Environment: String(""), + State: String("open"), + CommitSHA: String("abcdefg12345"), + Message: &Message{ + Text: String("This path depends on a user-provided value."), + }, + Location: &Location{ + Path: String("spec-main/api-session-spec.ts"), + StartLine: Int(917), + EndLine: Int(917), + StartColumn: Int(7), + EndColumn: Int(18), + }, + Classifications: []string{"test"}, + }, + } + if !cmp.Equal(instances, want) { + t.Errorf("CodeScanning.ListAlertInstances returned %+v, want %+v", instances, want) + } + + const methodName = "ListAlertInstances" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.CodeScanning.ListAlertInstances(ctx, "\n", "\n", -1, opts) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.CodeScanning.ListAlertInstances(ctx, "o", "r", 88, opts) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + func TestCodeScanningService_GetAlert(t *testing.T) { client, mux, _, teardown := setup() defer teardown() mux.HandleFunc("/repos/o/r/code-scanning/alerts/88", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - fmt.Fprint(w, `{"rule_id":"js/useless-expression", - "rule_severity":"warning", - "rule_description":"Expression has no effect", - "tool": { - "name": "CodeQL", - "guid": null, - "version": "1.4.0" - }, - "rule": { - "id": "useless expression", - "severity": "warning", - "description": "Expression has no effect", - "name": "useless expression", - "full_description": "Expression has no effect", - "help": "Expression has no effect" + fmt.Fprint(w, `{ + "rule_id":"js/useless-expression", + "rule_severity":"warning", + "rule_description":"Expression has no effect", + "tool": { + "name": "CodeQL", + "guid": null, + "version": "1.4.0" + }, + "rule": { + "id": "useless expression", + "severity": "warning", + "description": "Expression has no effect", + "name": "useless expression", + "full_description": "Expression has no effect", + "help": "Expression has no effect" + }, + "most_recent_instance": { + "ref": "refs/heads/main", + "state": "open", + "commit_sha": "abcdefg12345", + "message": { + "text": "This path depends on a user-provided value." }, - "most_recent_instance": { - "ref": "refs/heads/main", - "state": "open", - "commit_sha": "abcdefg12345", - "message": { - "text": "This path depends on a user-provided value." - }, - "location": { - "path": "spec-main/api-session-spec.ts", - "start_line": 917, - "end_line": 917, - "start_column": 7, - "end_column": 18 - }, - "classifications": [ - "test" - ] + "location": { + "path": "spec-main/api-session-spec.ts", + "start_line": 917, + "end_line": 917, + "start_column": 7, + "end_column": 18 }, - "created_at":"2019-01-02T15:04:05Z", - "state":"open", - "closed_by":null, - "closed_at":null, - "url":"https://api.github.com/repos/o/r/code-scanning/alerts/88", - "html_url":"https://github.com/o/r/security/code-scanning/88"}`) + "classifications": [ + "test" + ] + }, + "created_at":"2019-01-02T15:04:05Z", + "state":"open", + "closed_by":null, + "closed_at":null, + "url":"https://api.github.com/repos/o/r/code-scanning/alerts/88", + "html_url":"https://github.com/o/r/security/code-scanning/88" + }`) }) ctx := context.Background() @@ -1178,6 +1300,241 @@ func TestCodeScanningService_GetAnalysis(t *testing.T) { }) } +func TestCodeScanningService_DeleteAnalysis(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/code-scanning/analyses/40", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + fmt.Fprint(w, `{ + "next_analysis_url": "a", + "confirm_delete_url": "b" + }`) + }) + + ctx := context.Background() + analysis, _, err := client.CodeScanning.DeleteAnalysis(ctx, "o", "r", 40) + if err != nil { + t.Errorf("CodeScanning.DeleteAnalysis returned error: %v", err) + } + + want := &DeleteAnalysis{ + NextAnalysisURL: String("a"), + ConfirmDeleteURL: String("b"), + } + if !cmp.Equal(analysis, want) { + t.Errorf("CodeScanning.DeleteAnalysis returned %+v, want %+v", analysis, want) + } + + const methodName = "DeleteAnalysis" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.CodeScanning.DeleteAnalysis(ctx, "\n", "\n", -123) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.CodeScanning.DeleteAnalysis(ctx, "o", "r", 40) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestCodeScanningService_ListCodeQLDatabases(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/code-scanning/codeql/databases", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `[ + { + "id": 1, + "name": "name", + "language": "language", + "uploader": { + "login": "a", + "id": 1, + "node_id": "b", + "avatar_url": "c", + "gravatar_id": "d", + "url": "e", + "html_url": "f", + "followers_url": "g", + "following_url": "h", + "gists_url": "i", + "starred_url": "j", + "subscriptions_url": "k", + "organizations_url": "l", + "repos_url": "m", + "events_url": "n", + "received_events_url": "o", + "type": "p", + "site_admin": false + }, + "content_type": "r", + "size": 1024, + "created_at": "2021-01-13T11:55:49Z", + "updated_at": "2021-01-13T11:55:49Z", + "url": "s" + } + ]`) + }) + + ctx := context.Background() + databases, _, err := client.CodeScanning.ListCodeQLDatabases(ctx, "o", "r") + if err != nil { + t.Errorf("CodeScanning.ListCodeQLDatabases returned error: %v", err) + } + + date := &Timestamp{time.Date(2021, time.January, 13, 11, 55, 49, 0, time.UTC)} + want := []*CodeQLDatabase{ + { + ID: Int64(1), + Name: String("name"), + Language: String("language"), + Uploader: &User{ + Login: String("a"), + ID: Int64(1), + NodeID: String("b"), + AvatarURL: String("c"), + GravatarID: String("d"), + URL: String("e"), + HTMLURL: String("f"), + FollowersURL: String("g"), + FollowingURL: String("h"), + GistsURL: String("i"), + StarredURL: String("j"), + SubscriptionsURL: String("k"), + OrganizationsURL: String("l"), + ReposURL: String("m"), + EventsURL: String("n"), + ReceivedEventsURL: String("o"), + Type: String("p"), + SiteAdmin: Bool(false), + }, + ContentType: String("r"), + Size: Int64(1024), + CreatedAt: date, + UpdatedAt: date, + URL: String("s"), + }, + } + + if !cmp.Equal(databases, want) { + t.Errorf("CodeScanning.ListCodeQLDatabases returned %+v, want %+v", databases, want) + } + + const methodName = "ListCodeQLDatabases" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.CodeScanning.ListCodeQLDatabases(ctx, "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.CodeScanning.ListCodeQLDatabases(ctx, "o", "r") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestCodeScanningService_GetCodeQLDatabase(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/code-scanning/codeql/databases/lang", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "id": 1, + "name": "name", + "language": "language", + "uploader": { + "login": "a", + "id": 1, + "node_id": "b", + "avatar_url": "c", + "gravatar_id": "d", + "url": "e", + "html_url": "f", + "followers_url": "g", + "following_url": "h", + "gists_url": "i", + "starred_url": "j", + "subscriptions_url": "k", + "organizations_url": "l", + "repos_url": "m", + "events_url": "n", + "received_events_url": "o", + "type": "p", + "site_admin": false + }, + "content_type": "r", + "size": 1024, + "created_at": "2021-01-13T11:55:49Z", + "updated_at": "2021-01-13T11:55:49Z", + "url": "s" + }`) + }) + + ctx := context.Background() + database, _, err := client.CodeScanning.GetCodeQLDatabase(ctx, "o", "r", "lang") + if err != nil { + t.Errorf("CodeScanning.GetCodeQLDatabase returned error: %v", err) + } + + date := &Timestamp{time.Date(2021, time.January, 13, 11, 55, 49, 0, time.UTC)} + want := &CodeQLDatabase{ + ID: Int64(1), + Name: String("name"), + Language: String("language"), + Uploader: &User{ + Login: String("a"), + ID: Int64(1), + NodeID: String("b"), + AvatarURL: String("c"), + GravatarID: String("d"), + URL: String("e"), + HTMLURL: String("f"), + FollowersURL: String("g"), + FollowingURL: String("h"), + GistsURL: String("i"), + StarredURL: String("j"), + SubscriptionsURL: String("k"), + OrganizationsURL: String("l"), + ReposURL: String("m"), + EventsURL: String("n"), + ReceivedEventsURL: String("o"), + Type: String("p"), + SiteAdmin: Bool(false), + }, + ContentType: String("r"), + Size: Int64(1024), + CreatedAt: date, + UpdatedAt: date, + URL: String("s"), + } + + if !cmp.Equal(database, want) { + t.Errorf("CodeScanning.GetCodeQLDatabase returned %+v, want %+v", database, want) + } + + const methodName = "GetCodeQLDatabase" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.CodeScanning.GetCodeQLDatabase(ctx, "\n", "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.CodeScanning.GetCodeQLDatabase(ctx, "o", "r", "lang") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + func TestCodeScanningService_GetDefaultSetupConfiguration(t *testing.T) { client, mux, _, teardown := setup() defer teardown() diff --git a/github/github-accessors.go b/github/github-accessors.go index d9b730396ff..560e0892eda 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -2830,6 +2830,78 @@ func (c *CodeownersError) GetSuggestion() string { return *c.Suggestion } +// GetContentType returns the ContentType field if it's non-nil, zero value otherwise. +func (c *CodeQLDatabase) GetContentType() string { + if c == nil || c.ContentType == nil { + return "" + } + return *c.ContentType +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (c *CodeQLDatabase) GetCreatedAt() Timestamp { + if c == nil || c.CreatedAt == nil { + return Timestamp{} + } + return *c.CreatedAt +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (c *CodeQLDatabase) GetID() int64 { + if c == nil || c.ID == nil { + return 0 + } + return *c.ID +} + +// GetLanguage returns the Language field if it's non-nil, zero value otherwise. +func (c *CodeQLDatabase) GetLanguage() string { + if c == nil || c.Language == nil { + return "" + } + return *c.Language +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (c *CodeQLDatabase) GetName() string { + if c == nil || c.Name == nil { + return "" + } + return *c.Name +} + +// GetSize returns the Size field if it's non-nil, zero value otherwise. +func (c *CodeQLDatabase) GetSize() int64 { + if c == nil || c.Size == nil { + return 0 + } + return *c.Size +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (c *CodeQLDatabase) GetUpdatedAt() Timestamp { + if c == nil || c.UpdatedAt == nil { + return Timestamp{} + } + return *c.UpdatedAt +} + +// GetUploader returns the Uploader field. +func (c *CodeQLDatabase) GetUploader() *User { + if c == nil { + return nil + } + return c.Uploader +} + +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (c *CodeQLDatabase) GetURL() string { + if c == nil || c.URL == nil { + return "" + } + return *c.URL +} + // GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. func (c *CodeResult) GetHTMLURL() string { if c == nil || c.HTMLURL == nil { @@ -4878,6 +4950,22 @@ func (d *DefaultSetupConfiguration) GetUpdatedAt() Timestamp { return *d.UpdatedAt } +// GetConfirmDeleteURL returns the ConfirmDeleteURL field if it's non-nil, zero value otherwise. +func (d *DeleteAnalysis) GetConfirmDeleteURL() string { + if d == nil || d.ConfirmDeleteURL == nil { + return "" + } + return *d.ConfirmDeleteURL +} + +// GetNextAnalysisURL returns the NextAnalysisURL field if it's non-nil, zero value otherwise. +func (d *DeleteAnalysis) GetNextAnalysisURL() string { + if d == nil || d.NextAnalysisURL == nil { + return "" + } + return *d.NextAnalysisURL +} + // GetInstallation returns the Installation field. func (d *DeleteEvent) GetInstallation() *Installation { if d == nil { @@ -11382,6 +11470,14 @@ func (m *MostRecentInstance) GetAnalysisKey() string { return *m.AnalysisKey } +// GetCategory returns the Category field if it's non-nil, zero value otherwise. +func (m *MostRecentInstance) GetCategory() string { + if m == nil || m.Category == nil { + return "" + } + return *m.Category +} + // GetCommitSHA returns the CommitSHA field if it's non-nil, zero value otherwise. func (m *MostRecentInstance) GetCommitSHA() string { if m == nil || m.CommitSHA == nil { @@ -11398,6 +11494,14 @@ func (m *MostRecentInstance) GetEnvironment() string { return *m.Environment } +// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. +func (m *MostRecentInstance) GetHTMLURL() string { + if m == nil || m.HTMLURL == nil { + return "" + } + return *m.HTMLURL +} + // GetLocation returns the Location field. func (m *MostRecentInstance) GetLocation() *Location { if m == nil { @@ -20110,6 +20214,22 @@ func (s *SarifID) GetURL() string { return *s.URL } +// GetAnalysesURL returns the AnalysesURL field if it's non-nil, zero value otherwise. +func (s *SARIFUpload) GetAnalysesURL() string { + if s == nil || s.AnalysesURL == nil { + return "" + } + return *s.AnalysesURL +} + +// GetProcessingStatus returns the ProcessingStatus field if it's non-nil, zero value otherwise. +func (s *SARIFUpload) GetProcessingStatus() string { + if s == nil || s.ProcessingStatus == nil { + return "" + } + return *s.ProcessingStatus +} + // GetSBOM returns the SBOM field. func (s *SBOM) GetSBOM() *SBOMInfo { if s == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 6abb7fea56a..262cdd5a06b 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -3364,6 +3364,93 @@ func TestCodeownersError_GetSuggestion(tt *testing.T) { c.GetSuggestion() } +func TestCodeQLDatabase_GetContentType(tt *testing.T) { + var zeroValue string + c := &CodeQLDatabase{ContentType: &zeroValue} + c.GetContentType() + c = &CodeQLDatabase{} + c.GetContentType() + c = nil + c.GetContentType() +} + +func TestCodeQLDatabase_GetCreatedAt(tt *testing.T) { + var zeroValue Timestamp + c := &CodeQLDatabase{CreatedAt: &zeroValue} + c.GetCreatedAt() + c = &CodeQLDatabase{} + c.GetCreatedAt() + c = nil + c.GetCreatedAt() +} + +func TestCodeQLDatabase_GetID(tt *testing.T) { + var zeroValue int64 + c := &CodeQLDatabase{ID: &zeroValue} + c.GetID() + c = &CodeQLDatabase{} + c.GetID() + c = nil + c.GetID() +} + +func TestCodeQLDatabase_GetLanguage(tt *testing.T) { + var zeroValue string + c := &CodeQLDatabase{Language: &zeroValue} + c.GetLanguage() + c = &CodeQLDatabase{} + c.GetLanguage() + c = nil + c.GetLanguage() +} + +func TestCodeQLDatabase_GetName(tt *testing.T) { + var zeroValue string + c := &CodeQLDatabase{Name: &zeroValue} + c.GetName() + c = &CodeQLDatabase{} + c.GetName() + c = nil + c.GetName() +} + +func TestCodeQLDatabase_GetSize(tt *testing.T) { + var zeroValue int64 + c := &CodeQLDatabase{Size: &zeroValue} + c.GetSize() + c = &CodeQLDatabase{} + c.GetSize() + c = nil + c.GetSize() +} + +func TestCodeQLDatabase_GetUpdatedAt(tt *testing.T) { + var zeroValue Timestamp + c := &CodeQLDatabase{UpdatedAt: &zeroValue} + c.GetUpdatedAt() + c = &CodeQLDatabase{} + c.GetUpdatedAt() + c = nil + c.GetUpdatedAt() +} + +func TestCodeQLDatabase_GetUploader(tt *testing.T) { + c := &CodeQLDatabase{} + c.GetUploader() + c = nil + c.GetUploader() +} + +func TestCodeQLDatabase_GetURL(tt *testing.T) { + var zeroValue string + c := &CodeQLDatabase{URL: &zeroValue} + c.GetURL() + c = &CodeQLDatabase{} + c.GetURL() + c = nil + c.GetURL() +} + func TestCodeResult_GetHTMLURL(tt *testing.T) { var zeroValue string c := &CodeResult{HTMLURL: &zeroValue} @@ -5765,6 +5852,26 @@ func TestDefaultSetupConfiguration_GetUpdatedAt(tt *testing.T) { d.GetUpdatedAt() } +func TestDeleteAnalysis_GetConfirmDeleteURL(tt *testing.T) { + var zeroValue string + d := &DeleteAnalysis{ConfirmDeleteURL: &zeroValue} + d.GetConfirmDeleteURL() + d = &DeleteAnalysis{} + d.GetConfirmDeleteURL() + d = nil + d.GetConfirmDeleteURL() +} + +func TestDeleteAnalysis_GetNextAnalysisURL(tt *testing.T) { + var zeroValue string + d := &DeleteAnalysis{NextAnalysisURL: &zeroValue} + d.GetNextAnalysisURL() + d = &DeleteAnalysis{} + d.GetNextAnalysisURL() + d = nil + d.GetNextAnalysisURL() +} + func TestDeleteEvent_GetInstallation(tt *testing.T) { d := &DeleteEvent{} d.GetInstallation() @@ -13307,6 +13414,16 @@ func TestMostRecentInstance_GetAnalysisKey(tt *testing.T) { m.GetAnalysisKey() } +func TestMostRecentInstance_GetCategory(tt *testing.T) { + var zeroValue string + m := &MostRecentInstance{Category: &zeroValue} + m.GetCategory() + m = &MostRecentInstance{} + m.GetCategory() + m = nil + m.GetCategory() +} + func TestMostRecentInstance_GetCommitSHA(tt *testing.T) { var zeroValue string m := &MostRecentInstance{CommitSHA: &zeroValue} @@ -13327,6 +13444,16 @@ func TestMostRecentInstance_GetEnvironment(tt *testing.T) { m.GetEnvironment() } +func TestMostRecentInstance_GetHTMLURL(tt *testing.T) { + var zeroValue string + m := &MostRecentInstance{HTMLURL: &zeroValue} + m.GetHTMLURL() + m = &MostRecentInstance{} + m.GetHTMLURL() + m = nil + m.GetHTMLURL() +} + func TestMostRecentInstance_GetLocation(tt *testing.T) { m := &MostRecentInstance{} m.GetLocation() @@ -23425,6 +23552,26 @@ func TestSarifID_GetURL(tt *testing.T) { s.GetURL() } +func TestSARIFUpload_GetAnalysesURL(tt *testing.T) { + var zeroValue string + s := &SARIFUpload{AnalysesURL: &zeroValue} + s.GetAnalysesURL() + s = &SARIFUpload{} + s.GetAnalysesURL() + s = nil + s.GetAnalysesURL() +} + +func TestSARIFUpload_GetProcessingStatus(tt *testing.T) { + var zeroValue string + s := &SARIFUpload{ProcessingStatus: &zeroValue} + s.GetProcessingStatus() + s = &SARIFUpload{} + s.GetProcessingStatus() + s = nil + s.GetProcessingStatus() +} + func TestSBOM_GetSBOM(tt *testing.T) { s := &SBOM{} s.GetSBOM() From 5ab57e7a69f08fff22d9fea977967e3ada48d9f2 Mon Sep 17 00:00:00 2001 From: WillAbides <233500+WillAbides@users.noreply.github.com> Date: Thu, 31 Aug 2023 14:27:18 -0500 Subject: [PATCH 302/751] Update package constructors (#2904) Fixes: #2897. --- README.md | 43 +-- example/actionpermissions/main.go | 2 +- example/appengine/app.go | 2 +- .../newreposecretwithxcrypto/main.go | 2 +- .../newusersecretwithxcrypto/main.go | 2 +- example/commitpr/main.go | 2 +- example/go.mod | 1 - example/go.sum | 39 -- example/listenvironments/main.go | 2 +- example/migrations/main.go | 2 +- example/newfilewithappauth/main.go | 19 +- example/newrepo/main.go | 2 +- example/newreposecretwithlibsodium/main.go | 5 +- example/newreposecretwithxcrypto/main.go | 2 +- example/tagprotection/main.go | 2 +- example/tokenauth/main.go | 2 +- github/doc.go | 26 +- github/github.go | 163 ++++++--- github/github_test.go | 334 +++++++----------- test/fields/fields.go | 2 +- test/integration/github_test.go | 2 +- 21 files changed, 270 insertions(+), 386 deletions(-) diff --git a/README.md b/README.md index 3eb9947c158..fae03041ffb 100644 --- a/README.md +++ b/README.md @@ -84,36 +84,18 @@ For more sample code snippets, head over to the ### Authentication ### -The go-github library does not directly handle authentication. Instead, when -creating a new client, pass an `http.Client` that can handle authentication for -you. The easiest and recommended way to do this is using the [oauth2][] -library, but you can always use any other library that provides an -`http.Client`. If you have an OAuth2 access token (for example, a [personal -API token][]), you can use it with the oauth2 library using: +Use the `WithAuthToken` method to configure your client to authenticate using an +OAuth token (for example, a [personal access token][]). This is what is needed +for a majority of use cases aside from GitHub Apps. ```go -import "golang.org/x/oauth2" - -func main() { - ctx := context.Background() - ts := oauth2.StaticTokenSource( - &oauth2.Token{AccessToken: "... your access token ..."}, - ) - tc := oauth2.NewClient(ctx, ts) - - client := github.NewClient(tc) - - // list all repositories for the authenticated user - repos, _, err := client.Repositories.List(ctx, "", nil) -} +client := github.NewClient(nil).WithAuthToken("... your access token ...") ``` Note that when using an authenticated Client, all calls made by the client will include the specified OAuth token. Therefore, authenticated clients should almost never be shared between different users. -See the [oauth2 docs][] for complete instructions on using that library. - For API methods that require HTTP Basic Authentication, use the [`BasicAuthTransport`](https://godoc.org/github.com/google/go-github/github#BasicAuthTransport). @@ -232,16 +214,9 @@ https://github.com/gregjones/httpcache for that. For example: ```go import "github.com/gregjones/httpcache" - ts := oauth2.StaticTokenSource( - &oauth2.Token{AccessToken: os.Getenv("GITHUB_TOKEN")}, - ) - tc := &http.Client{ - Transport: &oauth2.Transport{ - Base: httpcache.NewMemoryCacheTransport(), - Source: ts, - }, - } - client := github.NewClient(tc) + client := github.NewClient( + httpcache.NewMemoryCacheTransport().Client() + ).WithAuthToken(os.Getenv("GITHUB_TOKEN")) ``` Learn more about GitHub conditional requests at @@ -320,9 +295,7 @@ Furthermore, there are libraries like [cbrgm/githubevents][] that build upon the For complete usage of go-github, see the full [package docs][]. [GitHub API v3]: https://docs.github.com/en/rest -[oauth2]: https://github.com/golang/oauth2 -[oauth2 docs]: https://godoc.org/golang.org/x/oauth2 -[personal API token]: https://github.com/blog/1509-personal-api-tokens +[personal access token]: https://github.com/blog/1509-personal-api-tokens [package docs]: https://pkg.go.dev/github.com/google/go-github/v54/github [GraphQL API v4]: https://developer.github.com/v4/ [shurcooL/githubv4]: https://github.com/shurcooL/githubv4 diff --git a/example/actionpermissions/main.go b/example/actionpermissions/main.go index 40f4a86ece0..0a6bedbb3f6 100644 --- a/example/actionpermissions/main.go +++ b/example/actionpermissions/main.go @@ -35,7 +35,7 @@ func main() { log.Fatal("No owner: owner of repo must be given") } ctx := context.Background() - client := github.NewTokenClient(ctx, token) + client := github.NewClient(nil).WithAuthToken(token) actionsPermissionsRepository, _, err := client.Repositories.GetActionsPermissions(ctx, *owner, *name) if err != nil { diff --git a/example/appengine/app.go b/example/appengine/app.go index 1694faaacfd..1913d9a891f 100644 --- a/example/appengine/app.go +++ b/example/appengine/app.go @@ -28,7 +28,7 @@ func handler(w http.ResponseWriter, r *http.Request) { } ctx := appengine.NewContext(r) - client := github.NewTokenClient(ctx, os.Getenv("GITHUB_AUTH_TOKEN")) + client := github.NewClient(nil).WithAuthToken(os.Getenv("GITHUB_AUTH_TOKEN")) commits, _, err := client.Repositories.ListCommits(ctx, "google", "go-github", nil) if err != nil { diff --git a/example/codespaces/newreposecretwithxcrypto/main.go b/example/codespaces/newreposecretwithxcrypto/main.go index 4ec3757af25..0faf737daf8 100644 --- a/example/codespaces/newreposecretwithxcrypto/main.go +++ b/example/codespaces/newreposecretwithxcrypto/main.go @@ -72,7 +72,7 @@ func main() { } ctx := context.Background() - client := github.NewTokenClient(ctx, token) + client := github.NewClient(nil).WithAuthToken(token) if err := addRepoSecret(ctx, client, *owner, *repo, secretName, secretValue); err != nil { log.Fatal(err) diff --git a/example/codespaces/newusersecretwithxcrypto/main.go b/example/codespaces/newusersecretwithxcrypto/main.go index 964452da82b..d887b4e5f40 100644 --- a/example/codespaces/newusersecretwithxcrypto/main.go +++ b/example/codespaces/newusersecretwithxcrypto/main.go @@ -65,7 +65,7 @@ func main() { } ctx := context.Background() - client := github.NewTokenClient(ctx, token) + client := github.NewClient(nil).WithAuthToken(token) if err := addUserSecret(ctx, client, secretName, secretValue, *owner, *repo); err != nil { log.Fatal(err) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index 2e81387017c..6cdc0e8f046 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -189,7 +189,7 @@ func main() { if *sourceOwner == "" || *sourceRepo == "" || *commitBranch == "" || *sourceFiles == "" || *authorName == "" || *authorEmail == "" { log.Fatal("You need to specify a non-empty value for the flags `-source-owner`, `-source-repo`, `-commit-branch`, `-files`, `-author-name` and `-author-email`") } - client = github.NewTokenClient(ctx, token) + client = github.NewClient(nil).WithAuthToken(token) ref, err := getRef() if err != nil { diff --git a/example/go.mod b/example/go.mod index aa04906aa9c..496140a1b63 100644 --- a/example/go.mod +++ b/example/go.mod @@ -7,7 +7,6 @@ require ( github.com/gofri/go-github-ratelimit v1.0.3 github.com/google/go-github/v54 v54.0.0 golang.org/x/crypto v0.12.0 - golang.org/x/oauth2 v0.7.0 golang.org/x/term v0.11.0 google.golang.org/appengine v1.6.7 ) diff --git a/example/go.sum b/example/go.sum index 1151ab7548d..513022c3565 100644 --- a/example/go.sum +++ b/example/go.sum @@ -1,10 +1,8 @@ -cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 h1:tXKVfhE7FcSkhkv0UwkLvPDeZ4kz6OXd0PKPlFqf81M= github.com/bradleyfalzon/ghinstallation/v2 v2.0.4/go.mod h1:B40qPqJxWE0jDZgOR1JmaMy+4AY1eBP+IByOvqyAKp0= github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= @@ -20,71 +18,34 @@ github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github/v41 v41.0.0 h1:HseJrM2JFf2vfiZJ8anY2hqBjdfY1Vlj/K27ueww4gg= github.com/google/go-github/v41 v41.0.0/go.mod h1:XgmCA5H323A9rtgExdTcnDkcqp6S30AVACCBDOonIxg= 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/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= -golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.11.0 h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0= golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= diff --git a/example/listenvironments/main.go b/example/listenvironments/main.go index 15ec8cbb583..e2ff0c4b456 100644 --- a/example/listenvironments/main.go +++ b/example/listenvironments/main.go @@ -31,7 +31,7 @@ func main() { } ctx := context.Background() - client := github.NewTokenClient(ctx, token) + client := github.NewClient(nil).WithAuthToken(token) expectedPageSize := 2 diff --git a/example/migrations/main.go b/example/migrations/main.go index f5c36c63059..d87668c1479 100644 --- a/example/migrations/main.go +++ b/example/migrations/main.go @@ -17,7 +17,7 @@ import ( func fetchAllUserMigrations() ([]*github.UserMigration, error) { ctx := context.Background() - client := github.NewTokenClient(ctx, "") + client := github.NewClient(nil).WithAuthToken("") migrations, _, err := client.Migrations.ListUserMigrations(ctx, &github.ListOptions{Page: 1}) return migrations, err diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index 6526fadc35e..8b2a4987585 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -17,7 +17,6 @@ import ( "github.com/bradleyfalzon/ghinstallation/v2" "github.com/google/go-github/v54/github" - "golang.org/x/oauth2" ) func main() { @@ -35,13 +34,13 @@ func main() { itr.BaseURL = gitHost //create git client with app transport - client, err := github.NewEnterpriseClient( - gitHost, - gitHost, + client, err := github.NewClient( &http.Client{ Transport: itr, Timeout: time.Second * 30, - }) + }, + ).WithEnterpriseURLs(gitHost, gitHost) + if err != nil { log.Fatalf("faild to create git client for app: %v\n", err) } @@ -66,13 +65,9 @@ func main() { log.Fatalf("failed to create installation token: %v\n", err) } - ts := oauth2.StaticTokenSource( - &oauth2.Token{AccessToken: token.GetToken()}, - ) - oAuthClient := oauth2.NewClient(context.Background(), ts) - - //create new git hub client with accessToken - apiClient, err := github.NewEnterpriseClient(gitHost, gitHost, oAuthClient) + apiClient, err := github.NewClient(nil).WithAuthToken( + token.GetToken(), + ).WithEnterpriseURLs(gitHost, gitHost) if err != nil { log.Fatalf("failed to create new git client with token: %v\n", err) } diff --git a/example/newrepo/main.go b/example/newrepo/main.go index 758b293db23..84d315821f7 100644 --- a/example/newrepo/main.go +++ b/example/newrepo/main.go @@ -36,7 +36,7 @@ func main() { log.Fatal("No name: New repos must be given a name") } ctx := context.Background() - client := github.NewTokenClient(ctx, token) + client := github.NewClient(nil).WithAuthToken(token) r := &github.Repository{Name: name, Private: private, Description: description, AutoInit: autoInit} repo, _, err := client.Repositories.Create(ctx, "", r) diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index 039289054ee..c0d412b51ac 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -71,10 +71,7 @@ func main() { } ctx := context.Background() - client := github.NewTokenClient(ctx, token) - if err != nil { - log.Fatalf("unable to authorize using env GITHUB_AUTH_TOKEN: %v", err) - } + client := github.NewClient(nil).WithAuthToken(token) if err := addRepoSecret(ctx, client, *owner, *repo, secretName, secretValue); err != nil { log.Fatal(err) diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index 76eb3dd8741..0e9a11d9cd9 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -72,7 +72,7 @@ func main() { } ctx := context.Background() - client := github.NewTokenClient(ctx, token) + client := github.NewClient(nil).WithAuthToken(token) if err := addRepoSecret(ctx, client, *owner, *repo, secretName, secretValue); err != nil { log.Fatal(err) diff --git a/example/tagprotection/main.go b/example/tagprotection/main.go index 8f85c7c0cb8..2499b242603 100644 --- a/example/tagprotection/main.go +++ b/example/tagprotection/main.go @@ -44,7 +44,7 @@ func main() { token := string(byteToken) ctx := context.Background() - client := github.NewTokenClient(ctx, token) + client := github.NewClient(nil).WithAuthToken(token) // create new tag protection if pattern != "" { diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index 564db2663e6..645bb749aca 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -26,7 +26,7 @@ func main() { token := string(byteToken) ctx := context.Background() - client := github.NewTokenClient(ctx, token) + client := github.NewClient(nil).WithAuthToken(token) user, resp, err := client.Users.Get(ctx, "") if err != nil { diff --git a/github/doc.go b/github/doc.go index 42337fb878b..b4e6163d2b9 100644 --- a/github/doc.go +++ b/github/doc.go @@ -40,34 +40,16 @@ For more sample code snippets, head over to the https://github.com/google/go-git # Authentication -The go-github library does not directly handle authentication. Instead, when -creating a new client, pass an http.Client that can handle authentication for -you. The easiest and recommended way to do this is using the golang.org/x/oauth2 -library, but you can always use any other library that provides an http.Client. -If you have an OAuth2 access token (for example, a personal API token), you can -use it with the oauth2 library using: +Use Client.WithAuthToken to configure your client to authenticate using an Oauth token +(for example, a personal access token). This is what is needed for a majority of use cases +aside from GitHub Apps. - import "golang.org/x/oauth2" - - func main() { - ctx := context.Background() - ts := oauth2.StaticTokenSource( - &oauth2.Token{AccessToken: "... your access token ..."}, - ) - tc := oauth2.NewClient(ctx, ts) - - client := github.NewClient(tc) - - // list all repositories for the authenticated user - repos, _, err := client.Repositories.List(ctx, "", nil) - } + client := github.NewClient(nil).WithAuthToken("... your access token ...") Note that when using an authenticated Client, all calls made by the client will include the specified OAuth token. Therefore, authenticated clients should almost never be shared between different users. -See the oauth2 docs for complete instructions on using that library. - For API methods that require HTTP Basic Authentication, use the BasicAuthTransport. diff --git a/github/github.go b/github/github.go index a7031ffd65a..dbd856b0e2d 100644 --- a/github/github.go +++ b/github/github.go @@ -305,17 +305,92 @@ func addOptions(s string, opts interface{}) (string, error) { // NewClient returns a new GitHub API client. If a nil httpClient is // provided, a new http.Client will be used. To use API methods which require -// authentication, either use NewTokenClient instead or provide NewClient with +// authentication, either use Client.WithAuthToken or provide NewClient with // an http.Client that will perform the authentication for you (such as that // provided by the golang.org/x/oauth2 library). func NewClient(httpClient *http.Client) *Client { - if httpClient == nil { - httpClient = &http.Client{} + c := &Client{client: httpClient} + c.initialize() + return c +} + +// WithAuthToken returns a copy of the client configured to use the provided token for the Authorization header. +func (c *Client) WithAuthToken(token string) *Client { + c2 := c.copy() + defer c2.initialize() + transport := c2.client.Transport + if transport == nil { + transport = http.DefaultTransport + } + c2.client.Transport = roundTripperFunc( + func(req *http.Request) (*http.Response, error) { + req = req.Clone(req.Context()) + req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", token)) + return transport.RoundTrip(req) + }, + ) + return c2 +} + +// WithEnterpriseURLs returns a copy of the client configured to use the provided base and +// upload URLs. If the base URL does not have the suffix "/api/v3/", it will be added +// automatically. If the upload URL does not have the suffix "/api/uploads", it will be +// added automatically. +// +// Note that WithEnterpriseURLs is a convenience helper only; +// its behavior is equivalent to setting the BaseURL and UploadURL fields. +// +// Another important thing is that by default, the GitHub Enterprise URL format +// should be http(s)://[hostname]/api/v3/ or you will always receive the 406 status code. +// The upload URL format should be http(s)://[hostname]/api/uploads/. +func (c *Client) WithEnterpriseURLs(baseURL, uploadURL string) (*Client, error) { + c2 := c.copy() + defer c2.initialize() + var err error + c2.BaseURL, err = url.Parse(baseURL) + if err != nil { + return nil, err } - baseURL, _ := url.Parse(defaultBaseURL) - uploadURL, _ := url.Parse(uploadBaseURL) - c := &Client{client: httpClient, BaseURL: baseURL, UserAgent: defaultUserAgent, UploadURL: uploadURL} + if !strings.HasSuffix(c2.BaseURL.Path, "/") { + c2.BaseURL.Path += "/" + } + if !strings.HasSuffix(c2.BaseURL.Path, "/api/v3/") && + !strings.HasPrefix(c2.BaseURL.Host, "api.") && + !strings.Contains(c2.BaseURL.Host, ".api.") { + c2.BaseURL.Path += "api/v3/" + } + + c2.UploadURL, err = url.Parse(uploadURL) + if err != nil { + return nil, err + } + + if !strings.HasSuffix(c2.UploadURL.Path, "/") { + c2.UploadURL.Path += "/" + } + if !strings.HasSuffix(c2.UploadURL.Path, "/api/uploads/") && + !strings.HasPrefix(c2.UploadURL.Host, "api.") && + !strings.Contains(c2.UploadURL.Host, ".api.") { + c2.UploadURL.Path += "api/uploads/" + } + return c2, nil +} + +// initialize sets default values and initializes services. +func (c *Client) initialize() { + if c.client == nil { + c.client = &http.Client{} + } + if c.BaseURL == nil { + c.BaseURL, _ = url.Parse(defaultBaseURL) + } + if c.UploadURL == nil { + c.UploadURL, _ = url.Parse(uploadBaseURL) + } + if c.UserAgent == "" { + c.UserAgent = defaultUserAgent + } c.common.client = c c.Actions = (*ActionsService)(&c.common) c.Activity = (*ActivityService)(&c.common) @@ -349,7 +424,27 @@ func NewClient(httpClient *http.Client) *Client { c.SecurityAdvisories = (*SecurityAdvisoriesService)(&c.common) c.Teams = (*TeamsService)(&c.common) c.Users = (*UsersService)(&c.common) - return c +} + +// copy returns a copy of the current client. It must be initialized before use. +func (c *Client) copy() *Client { + c.clientMu.Lock() + // can't use *c here because that would copy mutexes by value. + clone := Client{ + client: c.client, + UserAgent: c.UserAgent, + BaseURL: c.BaseURL, + UploadURL: c.UploadURL, + secondaryRateLimitReset: c.secondaryRateLimitReset, + } + c.clientMu.Unlock() + if clone.client == nil { + clone.client = &http.Client{} + } + c.rateMu.Lock() + copy(clone.rateLimits[:], c.rateLimits[:]) + c.rateMu.Unlock() + return &clone } // NewClientWithEnvProxy enhances NewClient with the HttpProxy env. @@ -358,62 +453,18 @@ func NewClientWithEnvProxy() *Client { } // NewTokenClient returns a new GitHub API client authenticated with the provided token. +// Deprecated: Use NewClient(nil).WithAuthToken(token) instead. func NewTokenClient(_ context.Context, token string) *Client { - return NewClient(&http.Client{ - Transport: roundTripperFunc(func(req *http.Request) (*http.Response, error) { - req = req.Clone(req.Context()) - req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", token)) - return http.DefaultTransport.RoundTrip(req) - }), - }) + // This always returns a nil error. + return NewClient(nil).WithAuthToken(token) } // NewEnterpriseClient returns a new GitHub API client with provided // base URL and upload URL (often is your GitHub Enterprise hostname). -// If the base URL does not have the suffix "/api/v3/", it will be added automatically. -// If the upload URL does not have the suffix "/api/uploads", it will be added automatically. -// If a nil httpClient is provided, a new http.Client will be used. -// -// Note that NewEnterpriseClient is a convenience helper only; -// its behavior is equivalent to using NewClient, followed by setting -// the BaseURL and UploadURL fields. // -// Another important thing is that by default, the GitHub Enterprise URL format -// should be http(s)://[hostname]/api/v3/ or you will always receive the 406 status code. -// The upload URL format should be http(s)://[hostname]/api/uploads/. +// Deprecated: Use NewClient(httpClient).WithOptions(WithEnterpriseURLs(baseURL, uploadURL)) instead. func NewEnterpriseClient(baseURL, uploadURL string, httpClient *http.Client) (*Client, error) { - baseEndpoint, err := url.Parse(baseURL) - if err != nil { - return nil, err - } - - if !strings.HasSuffix(baseEndpoint.Path, "/") { - baseEndpoint.Path += "/" - } - if !strings.HasSuffix(baseEndpoint.Path, "/api/v3/") && - !strings.HasPrefix(baseEndpoint.Host, "api.") && - !strings.Contains(baseEndpoint.Host, ".api.") { - baseEndpoint.Path += "api/v3/" - } - - uploadEndpoint, err := url.Parse(uploadURL) - if err != nil { - return nil, err - } - - if !strings.HasSuffix(uploadEndpoint.Path, "/") { - uploadEndpoint.Path += "/" - } - if !strings.HasSuffix(uploadEndpoint.Path, "/api/uploads/") && - !strings.HasPrefix(uploadEndpoint.Host, "api.") && - !strings.Contains(uploadEndpoint.Host, ".api.") { - uploadEndpoint.Path += "api/uploads/" - } - - c := NewClient(httpClient) - c.BaseURL = baseEndpoint - c.UploadURL = uploadEndpoint - return c, nil + return NewClient(httpClient).WithEnterpriseURLs(baseURL, uploadURL) } // RequestOption represents an option that can modify an http.Request. diff --git a/github/github_test.go b/github/github_test.go index 982e1fe7498..af506e65243 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -306,219 +306,145 @@ func TestClient(t *testing.T) { } } -func TestNewTokenClient(t *testing.T) { +func TestWithAuthToken(t *testing.T) { token := "gh_test_token" - ctx := context.Background() var gotAuthHeaderVals []string wantAuthHeaderVals := []string{"Bearer " + token} srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { gotAuthHeaderVals = r.Header["Authorization"] })) - _, err := NewTokenClient(ctx, token).Client().Get(srv.URL) - if err != nil { - t.Fatalf("Get returned unexpected error: %v", err) - } - if diff := cmp.Diff(wantAuthHeaderVals, gotAuthHeaderVals); diff != "" { - t.Errorf("Authorization header values mismatch (-want +got):\n%s", diff) - } -} - -func TestNewEnterpriseClient(t *testing.T) { - baseURL := "https://custom-url/api/v3/" - uploadURL := "https://custom-upload-url/api/uploads/" - c, err := NewEnterpriseClient(baseURL, uploadURL, nil) - if err != nil { - t.Fatalf("NewEnterpriseClient returned unexpected error: %v", err) - } - - if got, want := c.BaseURL.String(), baseURL; got != want { - t.Errorf("NewClient BaseURL is %v, want %v", got, want) - } - if got, want := c.UploadURL.String(), uploadURL; got != want { - t.Errorf("NewClient UploadURL is %v, want %v", got, want) - } -} - -func TestNewEnterpriseClient_addsTrailingSlashToURLs(t *testing.T) { - baseURL := "https://custom-url/api/v3" - uploadURL := "https://custom-upload-url/api/uploads" - formattedBaseURL := baseURL + "/" - formattedUploadURL := uploadURL + "/" - - c, err := NewEnterpriseClient(baseURL, uploadURL, nil) - if err != nil { - t.Fatalf("NewEnterpriseClient returned unexpected error: %v", err) - } - - if got, want := c.BaseURL.String(), formattedBaseURL; got != want { - t.Errorf("NewClient BaseURL is %v, want %v", got, want) - } - if got, want := c.UploadURL.String(), formattedUploadURL; got != want { - t.Errorf("NewClient UploadURL is %v, want %v", got, want) - } -} - -func TestNewEnterpriseClient_addsEnterpriseSuffixToURLs(t *testing.T) { - baseURL := "https://custom-url/" - uploadURL := "https://custom-upload-url/" - formattedBaseURL := baseURL + "api/v3/" - formattedUploadURL := uploadURL + "api/uploads/" - - c, err := NewEnterpriseClient(baseURL, uploadURL, nil) - if err != nil { - t.Fatalf("NewEnterpriseClient returned unexpected error: %v", err) - } - - if got, want := c.BaseURL.String(), formattedBaseURL; got != want { - t.Errorf("NewClient BaseURL is %v, want %v", got, want) - } - if got, want := c.UploadURL.String(), formattedUploadURL; got != want { - t.Errorf("NewClient UploadURL is %v, want %v", got, want) - } -} - -func TestNewEnterpriseClient_addsEnterpriseSuffixAndTrailingSlashToURLs(t *testing.T) { - baseURL := "https://custom-url" - uploadURL := "https://custom-upload-url" - formattedBaseURL := baseURL + "/api/v3/" - formattedUploadURL := uploadURL + "/api/uploads/" - - c, err := NewEnterpriseClient(baseURL, uploadURL, nil) - if err != nil { - t.Fatalf("NewEnterpriseClient returned unexpected error: %v", err) - } - - if got, want := c.BaseURL.String(), formattedBaseURL; got != want { - t.Errorf("NewClient BaseURL is %v, want %v", got, want) - } - if got, want := c.UploadURL.String(), formattedUploadURL; got != want { - t.Errorf("NewClient UploadURL is %v, want %v", got, want) - } -} - -func TestNewEnterpriseClient_badBaseURL(t *testing.T) { - baseURL := "bogus\nbase\nURL" - uploadURL := "https://custom-upload-url/api/uploads/" - if _, err := NewEnterpriseClient(baseURL, uploadURL, nil); err == nil { - t.Fatal("NewEnterpriseClient returned nil, expected error") - } -} - -func TestNewEnterpriseClient_badUploadURL(t *testing.T) { - baseURL := "https://custom-url/api/v3/" - uploadURL := "bogus\nupload\nURL" - if _, err := NewEnterpriseClient(baseURL, uploadURL, nil); err == nil { - t.Fatal("NewEnterpriseClient returned nil, expected error") - } -} - -func TestNewEnterpriseClient_URLHasExistingAPIPrefix_AddTrailingSlash(t *testing.T) { - baseURL := "https://api.custom-url" - uploadURL := "https://api.custom-upload-url" - formattedBaseURL := baseURL + "/" - formattedUploadURL := uploadURL + "/" - - c, err := NewEnterpriseClient(baseURL, uploadURL, nil) - if err != nil { - t.Fatalf("NewEnterpriseClient returned unexpected error: %v", err) - } - - if got, want := c.BaseURL.String(), formattedBaseURL; got != want { - t.Errorf("NewClient BaseURL is %v, want %v", got, want) - } - if got, want := c.UploadURL.String(), formattedUploadURL; got != want { - t.Errorf("NewClient UploadURL is %v, want %v", got, want) - } -} - -func TestNewEnterpriseClient_URLHasExistingAPIPrefixAndTrailingSlash(t *testing.T) { - baseURL := "https://api.custom-url/" - uploadURL := "https://api.custom-upload-url/" - - c, err := NewEnterpriseClient(baseURL, uploadURL, nil) - if err != nil { - t.Fatalf("NewEnterpriseClient returned unexpected error: %v", err) - } - - if got, want := c.BaseURL.String(), baseURL; got != want { - t.Errorf("NewClient BaseURL is %v, want %v", got, want) - } - if got, want := c.UploadURL.String(), uploadURL; got != want { - t.Errorf("NewClient UploadURL is %v, want %v", got, want) - } -} - -func TestNewEnterpriseClient_URLHasAPISubdomain_AddTrailingSlash(t *testing.T) { - baseURL := "https://catalog.api.custom-url" - uploadURL := "https://catalog.api.custom-upload-url" - formattedBaseURL := baseURL + "/" - formattedUploadURL := uploadURL + "/" - - c, err := NewEnterpriseClient(baseURL, uploadURL, nil) - if err != nil { - t.Fatalf("NewEnterpriseClient returned unexpected error: %v", err) - } - - if got, want := c.BaseURL.String(), formattedBaseURL; got != want { - t.Errorf("NewClient BaseURL is %v, want %v", got, want) - } - if got, want := c.UploadURL.String(), formattedUploadURL; got != want { - t.Errorf("NewClient UploadURL is %v, want %v", got, want) - } -} - -func TestNewEnterpriseClient_URLHasAPISubdomainAndTrailingSlash(t *testing.T) { - baseURL := "https://catalog.api.custom-url/" - uploadURL := "https://catalog.api.custom-upload-url/" - - c, err := NewEnterpriseClient(baseURL, uploadURL, nil) - if err != nil { - t.Fatalf("NewEnterpriseClient returned unexpected error: %v", err) - } - - if got, want := c.BaseURL.String(), baseURL; got != want { - t.Errorf("NewClient BaseURL is %v, want %v", got, want) - } - if got, want := c.UploadURL.String(), uploadURL; got != want { - t.Errorf("NewClient UploadURL is %v, want %v", got, want) - } -} - -func TestNewEnterpriseClient_URLIsNotAProperAPISubdomain_addsEnterpriseSuffixAndSlash(t *testing.T) { - baseURL := "https://cloud-api.custom-url" - uploadURL := "https://cloud-api.custom-upload-url" - formattedBaseURL := baseURL + "/api/v3/" - formattedUploadURL := uploadURL + "/api/uploads/" - - c, err := NewEnterpriseClient(baseURL, uploadURL, nil) - if err != nil { - t.Fatalf("NewEnterpriseClient returned unexpected error: %v", err) - } - - if got, want := c.BaseURL.String(), formattedBaseURL; got != want { - t.Errorf("NewClient BaseURL is %v, want %v", got, want) - } - if got, want := c.UploadURL.String(), formattedUploadURL; got != want { - t.Errorf("NewClient UploadURL is %v, want %v", got, want) + validate := func(c *Client) { + t.Helper() + gotAuthHeaderVals = nil + _, err := c.Client().Get(srv.URL) + if err != nil { + t.Fatalf("Get returned unexpected error: %v", err) + } + diff := cmp.Diff(wantAuthHeaderVals, gotAuthHeaderVals) + if diff != "" { + t.Errorf("Authorization header values mismatch (-want +got):\n%s", diff) + } } + validate(NewClient(nil).WithAuthToken(token)) + validate(new(Client).WithAuthToken(token)) + validate(NewTokenClient(context.Background(), token)) } -func TestNewEnterpriseClient_URLIsNotAProperAPISubdomain_addsEnterpriseSuffix(t *testing.T) { - baseURL := "https://cloud-api.custom-url/" - uploadURL := "https://cloud-api.custom-upload-url/" - formattedBaseURL := baseURL + "api/v3/" - formattedUploadURL := uploadURL + "api/uploads/" - - c, err := NewEnterpriseClient(baseURL, uploadURL, nil) - if err != nil { - t.Fatalf("NewEnterpriseClient returned unexpected error: %v", err) - } - - if got, want := c.BaseURL.String(), formattedBaseURL; got != want { - t.Errorf("NewClient BaseURL is %v, want %v", got, want) - } - if got, want := c.UploadURL.String(), formattedUploadURL; got != want { - t.Errorf("NewClient UploadURL is %v, want %v", got, want) +func TestWithEnterpriseURLs(t *testing.T) { + for _, test := range []struct { + name string + baseURL string + wantBaseURL string + uploadURL string + wantUploadURL string + wantErr string + }{ + { + name: "does not modify properly formed URLs", + baseURL: "https://custom-url/api/v3/", + wantBaseURL: "https://custom-url/api/v3/", + uploadURL: "https://custom-upload-url/api/uploads/", + wantUploadURL: "https://custom-upload-url/api/uploads/", + }, + { + name: "adds trailing slash", + baseURL: "https://custom-url/api/v3", + wantBaseURL: "https://custom-url/api/v3/", + uploadURL: "https://custom-upload-url/api/uploads", + wantUploadURL: "https://custom-upload-url/api/uploads/", + }, + { + name: "adds enterprise suffix", + baseURL: "https://custom-url/", + wantBaseURL: "https://custom-url/api/v3/", + uploadURL: "https://custom-upload-url/", + wantUploadURL: "https://custom-upload-url/api/uploads/", + }, + { + name: "adds enterprise suffix and trailing slash", + baseURL: "https://custom-url", + wantBaseURL: "https://custom-url/api/v3/", + uploadURL: "https://custom-upload-url", + wantUploadURL: "https://custom-upload-url/api/uploads/", + }, + { + name: "bad base URL", + baseURL: "bogus\nbase\nURL", + uploadURL: "https://custom-upload-url/api/uploads/", + wantErr: `invalid control character in URL`, + }, + { + name: "bad upload URL", + baseURL: "https://custom-url/api/v3/", + uploadURL: "bogus\nupload\nURL", + wantErr: `invalid control character in URL`, + }, + { + name: "URL has existing API prefix, adds trailing slash", + baseURL: "https://api.custom-url", + wantBaseURL: "https://api.custom-url/", + uploadURL: "https://api.custom-upload-url", + wantUploadURL: "https://api.custom-upload-url/", + }, + { + name: "URL has existing API prefix and trailing slash", + baseURL: "https://api.custom-url/", + wantBaseURL: "https://api.custom-url/", + uploadURL: "https://api.custom-upload-url/", + wantUploadURL: "https://api.custom-upload-url/", + }, + { + name: "URL has API subdomain, adds trailing slash", + baseURL: "https://catalog.api.custom-url", + wantBaseURL: "https://catalog.api.custom-url/", + uploadURL: "https://catalog.api.custom-upload-url", + wantUploadURL: "https://catalog.api.custom-upload-url/", + }, + { + name: "URL has API subdomain and trailing slash", + baseURL: "https://catalog.api.custom-url/", + wantBaseURL: "https://catalog.api.custom-url/", + uploadURL: "https://catalog.api.custom-upload-url/", + wantUploadURL: "https://catalog.api.custom-upload-url/", + }, + { + name: "URL is not a proper API subdomain, adds enterprise suffix and slash", + baseURL: "https://cloud-api.custom-url", + wantBaseURL: "https://cloud-api.custom-url/api/v3/", + uploadURL: "https://cloud-api.custom-upload-url", + wantUploadURL: "https://cloud-api.custom-upload-url/api/uploads/", + }, + { + name: "URL is not a proper API subdomain, adds enterprise suffix", + baseURL: "https://cloud-api.custom-url/", + wantBaseURL: "https://cloud-api.custom-url/api/v3/", + uploadURL: "https://cloud-api.custom-upload-url/", + wantUploadURL: "https://cloud-api.custom-upload-url/api/uploads/", + }, + } { + t.Run(test.name, func(t *testing.T) { + validate := func(c *Client, err error) { + t.Helper() + if test.wantErr != "" { + if err == nil || !strings.Contains(err.Error(), test.wantErr) { + t.Fatalf("error does not contain expected string %q: %v", test.wantErr, err) + } + return + } + if err != nil { + t.Fatalf("got unexpected error: %v", err) + } + if c.BaseURL.String() != test.wantBaseURL { + t.Errorf("BaseURL is %v, want %v", c.BaseURL.String(), test.wantBaseURL) + } + if c.UploadURL.String() != test.wantUploadURL { + t.Errorf("UploadURL is %v, want %v", c.UploadURL.String(), test.wantUploadURL) + } + } + validate(NewClient(nil).WithEnterpriseURLs(test.baseURL, test.uploadURL)) + validate(new(Client).WithEnterpriseURLs(test.baseURL, test.uploadURL)) + validate(NewEnterpriseClient(test.baseURL, test.uploadURL, nil)) + }) } } diff --git a/test/fields/fields.go b/test/fields/fields.go index 8f5d1ffc05e..6b44a04310d 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -46,7 +46,7 @@ func main() { print("!!! No OAuth token. Some tests won't run. !!!\n\n") client = github.NewClient(nil) } else { - client = github.NewTokenClient(context.Background(), token) + client = github.NewClient(nil).WithAuthToken(token) auth = true } diff --git a/test/integration/github_test.go b/test/integration/github_test.go index 9bcbf7b554a..5bef6ca73aa 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -32,7 +32,7 @@ func init() { print("!!! No OAuth token. Some tests won't run. !!!\n\n") client = github.NewClient(nil) } else { - client = github.NewTokenClient(context.Background(), token) + client = github.NewClient(nil).WithAuthToken(token) auth = true } } From 1a6e6febdb06006b5b0d8278b0fbc89299855138 Mon Sep 17 00:00:00 2001 From: Yurii Soldak Date: Mon, 4 Sep 2023 15:53:36 +0200 Subject: [PATCH 303/751] Fix serialization of repository_names conditions object (#2910) Fixes: #2909. --- github/repos_rules.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/github/repos_rules.go b/github/repos_rules.go index 38d4255a9aa..7f964fe6655 100644 --- a/github/repos_rules.go +++ b/github/repos_rules.go @@ -38,8 +38,8 @@ type RulesetRefConditionParameters struct { // RulesetRepositoryNamesConditionParameters represents the conditions object for repository_names. type RulesetRepositoryNamesConditionParameters struct { - Include []string `json:"include,omitempty"` - Exclude []string `json:"exclude,omitempty"` + Include []string `json:"include"` + Exclude []string `json:"exclude"` Protected *bool `json:"protected,omitempty"` } From 5eddfaaeb7c8ad56b43e5c7d6719b2a5bb1defe6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 16:29:27 -0400 Subject: [PATCH 304/751] Bump actions/checkout from 3 to 4 (#2912) --- .github/workflows/linter.yml | 2 +- .github/workflows/tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index a494d8fb779..1430245422d 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -23,7 +23,7 @@ jobs: runs-on: ${{ matrix.platform }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: golangci-lint ${{ matrix.working-directory }} uses: golangci/golangci-lint-action@v3 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ad0cc4487b1..87d97f99c09 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,7 +39,7 @@ jobs: - uses: actions/setup-go@v4 with: go-version: ${{ matrix.go-version }} - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # Get values for cache paths to be used in later steps - id: cache-paths From 99ee29e326a0b3d5e09982f3de2101ba70613808 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Tue, 5 Sep 2023 13:02:11 -0400 Subject: [PATCH 305/751] Bump version of go-github to v55.0.0 (#2914) --- README.md | 15 ++++++++------- example/actionpermissions/main.go | 2 +- example/appengine/app.go | 2 +- example/basicauth/main.go | 2 +- .../codespaces/newreposecretwithxcrypto/main.go | 2 +- .../codespaces/newusersecretwithxcrypto/main.go | 2 +- example/commitpr/main.go | 2 +- example/go.mod | 6 +++--- example/listenvironments/main.go | 2 +- example/migrations/main.go | 2 +- example/newfilewithappauth/main.go | 2 +- example/newrepo/main.go | 2 +- example/newreposecretwithlibsodium/go.mod | 4 ++-- example/newreposecretwithlibsodium/main.go | 2 +- example/newreposecretwithxcrypto/main.go | 2 +- example/ratelimit/main.go | 2 +- example/simple/main.go | 2 +- example/tagprotection/main.go | 2 +- example/tokenauth/main.go | 2 +- example/topics/main.go | 2 +- github/doc.go | 2 +- github/examples_test.go | 2 +- github/github.go | 2 +- go.mod | 2 +- test/fields/fields.go | 2 +- test/integration/activity_test.go | 2 +- test/integration/authorizations_test.go | 2 +- test/integration/github_test.go | 2 +- test/integration/repos_test.go | 2 +- test/integration/users_test.go | 2 +- update-urls/go.mod | 2 +- 31 files changed, 41 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index fae03041ffb..1c8d9bd0e56 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-github # [![go-github release (latest SemVer)](https://img.shields.io/github/v/release/google/go-github?sort=semver)](https://github.com/google/go-github/releases) -[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v54/github) +[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v55/github) [![Test Status](https://github.com/google/go-github/workflows/tests/badge.svg)](https://github.com/google/go-github/actions?query=workflow%3Atests) [![Test Coverage](https://codecov.io/gh/google/go-github/branch/master/graph/badge.svg)](https://codecov.io/gh/google/go-github) [![Discuss at go-github@googlegroups.com](https://img.shields.io/badge/discuss-go--github%40googlegroups.com-blue.svg)](https://groups.google.com/group/go-github) @@ -24,7 +24,7 @@ If you're interested in using the [GraphQL API v4][], the recommended library is go-github is compatible with modern Go releases in module mode, with Go installed: ```bash -go get github.com/google/go-github/v54 +go get github.com/google/go-github/v55 ``` will resolve and add the package to the current development module, along with its dependencies. @@ -32,7 +32,7 @@ will resolve and add the package to the current development module, along with i Alternatively the same can be achieved if you use import in a package: ```go -import "github.com/google/go-github/v54/github" +import "github.com/google/go-github/v55/github" ``` and run `go get` without parameters. @@ -40,13 +40,13 @@ and run `go get` without parameters. Finally, to use the top-of-trunk version of this repo, use the following command: ```bash -go get github.com/google/go-github/v54@master +go get github.com/google/go-github/v55@master ``` ## Usage ## ```go -import "github.com/google/go-github/v54/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) +import "github.com/google/go-github/v55/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled ``` @@ -117,7 +117,7 @@ import ( "net/http" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v54/github" + "github.com/google/go-github/v55/github" ) func main() { @@ -296,7 +296,7 @@ For complete usage of go-github, see the full [package docs][]. [GitHub API v3]: https://docs.github.com/en/rest [personal access token]: https://github.com/blog/1509-personal-api-tokens -[package docs]: https://pkg.go.dev/github.com/google/go-github/v54/github +[package docs]: https://pkg.go.dev/github.com/google/go-github/v55/github [GraphQL API v4]: https://developer.github.com/v4/ [shurcooL/githubv4]: https://github.com/shurcooL/githubv4 [GitHub webhook events]: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads @@ -369,6 +369,7 @@ Versions prior to 48.2.0 are not listed. | go-github Version | GitHub v3 API Version | | ----------------- | --------------------- | +| 55.0.0 | 2022-11-28 | | 54.0.0 | 2022-11-28 | | 53.2.0 | 2022-11-28 | | 53.1.0 | 2022-11-28 | diff --git a/example/actionpermissions/main.go b/example/actionpermissions/main.go index 0a6bedbb3f6..4ff7008ca9d 100644 --- a/example/actionpermissions/main.go +++ b/example/actionpermissions/main.go @@ -14,7 +14,7 @@ import ( "log" "os" - "github.com/google/go-github/v54/github" + "github.com/google/go-github/v55/github" ) var ( diff --git a/example/appengine/app.go b/example/appengine/app.go index 1913d9a891f..449f880cd17 100644 --- a/example/appengine/app.go +++ b/example/appengine/app.go @@ -12,7 +12,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v54/github" + "github.com/google/go-github/v55/github" "google.golang.org/appengine" "google.golang.org/appengine/log" ) diff --git a/example/basicauth/main.go b/example/basicauth/main.go index f9431b25035..6cda7d6eb85 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -22,7 +22,7 @@ import ( "strings" "syscall" - "github.com/google/go-github/v54/github" + "github.com/google/go-github/v55/github" "golang.org/x/term" ) diff --git a/example/codespaces/newreposecretwithxcrypto/main.go b/example/codespaces/newreposecretwithxcrypto/main.go index 0faf737daf8..18c8ed24e3c 100644 --- a/example/codespaces/newreposecretwithxcrypto/main.go +++ b/example/codespaces/newreposecretwithxcrypto/main.go @@ -36,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v54/github" + "github.com/google/go-github/v55/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/codespaces/newusersecretwithxcrypto/main.go b/example/codespaces/newusersecretwithxcrypto/main.go index d887b4e5f40..9e05d6117e4 100644 --- a/example/codespaces/newusersecretwithxcrypto/main.go +++ b/example/codespaces/newusersecretwithxcrypto/main.go @@ -37,7 +37,7 @@ import ( "log" "os" - "github.com/google/go-github/v54/github" + "github.com/google/go-github/v55/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index 6cdc0e8f046..1a94e1489d5 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -30,7 +30,7 @@ import ( "strings" "time" - "github.com/google/go-github/v54/github" + "github.com/google/go-github/v55/github" ) var ( diff --git a/example/go.mod b/example/go.mod index 496140a1b63..eaf9f5b6926 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,11 +1,11 @@ -module github.com/google/go-github/v54/example +module github.com/google/go-github/v55/example go 1.17 require ( github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-ratelimit v1.0.3 - github.com/google/go-github/v54 v54.0.0 + github.com/google/go-github/v55 v55.0.0 golang.org/x/crypto v0.12.0 golang.org/x/term v0.11.0 google.golang.org/appengine v1.6.7 @@ -24,4 +24,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v54 => ../ +replace github.com/google/go-github/v55 => ../ diff --git a/example/listenvironments/main.go b/example/listenvironments/main.go index e2ff0c4b456..56aef7cf73a 100644 --- a/example/listenvironments/main.go +++ b/example/listenvironments/main.go @@ -18,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v54/github" + "github.com/google/go-github/v55/github" ) func main() { diff --git a/example/migrations/main.go b/example/migrations/main.go index d87668c1479..c5ee99c178f 100644 --- a/example/migrations/main.go +++ b/example/migrations/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v54/github" + "github.com/google/go-github/v55/github" ) func fetchAllUserMigrations() ([]*github.UserMigration, error) { diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index 8b2a4987585..cd85a885106 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -16,7 +16,7 @@ import ( "time" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v54/github" + "github.com/google/go-github/v55/github" ) func main() { diff --git a/example/newrepo/main.go b/example/newrepo/main.go index 84d315821f7..aa800333a6c 100644 --- a/example/newrepo/main.go +++ b/example/newrepo/main.go @@ -16,7 +16,7 @@ import ( "log" "os" - "github.com/google/go-github/v54/github" + "github.com/google/go-github/v55/github" ) var ( diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index 98684c1c1d9..114862d69f3 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -4,8 +4,8 @@ go 1.15 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb - github.com/google/go-github/v54 v54.0.0 + github.com/google/go-github/v55 v55.0.0 ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v54 => ../.. +replace github.com/google/go-github/v55 => ../.. diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index c0d412b51ac..bdd9affb2f4 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -36,7 +36,7 @@ import ( "os" sodium "github.com/GoKillers/libsodium-go/cryptobox" - "github.com/google/go-github/v54/github" + "github.com/google/go-github/v55/github" ) var ( diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index 0e9a11d9cd9..3b65e1548d8 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -36,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v54/github" + "github.com/google/go-github/v55/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/ratelimit/main.go b/example/ratelimit/main.go index dcc1510000f..a311c9c058d 100644 --- a/example/ratelimit/main.go +++ b/example/ratelimit/main.go @@ -13,7 +13,7 @@ import ( "fmt" "github.com/gofri/go-github-ratelimit/github_ratelimit" - "github.com/google/go-github/v54/github" + "github.com/google/go-github/v55/github" ) func main() { diff --git a/example/simple/main.go b/example/simple/main.go index bb2a624d315..72583159d87 100644 --- a/example/simple/main.go +++ b/example/simple/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v54/github" + "github.com/google/go-github/v55/github" ) // Fetch all the public organizations' membership of a user. diff --git a/example/tagprotection/main.go b/example/tagprotection/main.go index 2499b242603..056ffae4ea9 100644 --- a/example/tagprotection/main.go +++ b/example/tagprotection/main.go @@ -19,7 +19,7 @@ import ( "strings" "syscall" - "github.com/google/go-github/v54/github" + "github.com/google/go-github/v55/github" "golang.org/x/term" ) diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index 645bb749aca..6fe51804f2e 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -15,7 +15,7 @@ import ( "log" "syscall" - "github.com/google/go-github/v54/github" + "github.com/google/go-github/v55/github" "golang.org/x/term" ) diff --git a/example/topics/main.go b/example/topics/main.go index 83d3d7faa7b..98614836c77 100644 --- a/example/topics/main.go +++ b/example/topics/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v54/github" + "github.com/google/go-github/v55/github" ) // Fetch and lists all the public topics associated with the specified GitHub topic diff --git a/github/doc.go b/github/doc.go index b4e6163d2b9..bace6fb3c6f 100644 --- a/github/doc.go +++ b/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v54/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v55/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to diff --git a/github/examples_test.go b/github/examples_test.go index 71315594afe..a2147bf417f 100644 --- a/github/examples_test.go +++ b/github/examples_test.go @@ -12,7 +12,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v54/github" + "github.com/google/go-github/v55/github" ) func ExampleClient_Markdown() { diff --git a/github/github.go b/github/github.go index dbd856b0e2d..df01144460f 100644 --- a/github/github.go +++ b/github/github.go @@ -27,7 +27,7 @@ import ( ) const ( - Version = "v54.0.0" + Version = "v55.0.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" diff --git a/go.mod b/go.mod index fa43a0aa5ff..c41237ead0e 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v54 +module github.com/google/go-github/v55 require ( github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 diff --git a/test/fields/fields.go b/test/fields/fields.go index 6b44a04310d..c32cdaba980 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -25,7 +25,7 @@ import ( "reflect" "strings" - "github.com/google/go-github/v54/github" + "github.com/google/go-github/v55/github" ) var ( diff --git a/test/integration/activity_test.go b/test/integration/activity_test.go index 32620ec4270..90d43711b4e 100644 --- a/test/integration/activity_test.go +++ b/test/integration/activity_test.go @@ -12,7 +12,7 @@ import ( "context" "testing" - "github.com/google/go-github/v54/github" + "github.com/google/go-github/v55/github" ) const ( diff --git a/test/integration/authorizations_test.go b/test/integration/authorizations_test.go index ff4980672cd..d5bdf2e2884 100644 --- a/test/integration/authorizations_test.go +++ b/test/integration/authorizations_test.go @@ -17,7 +17,7 @@ import ( "testing" "time" - "github.com/google/go-github/v54/github" + "github.com/google/go-github/v55/github" ) const msgEnvMissing = "Skipping test because the required environment variable (%v) is not present." diff --git a/test/integration/github_test.go b/test/integration/github_test.go index 5bef6ca73aa..a51a2b23a47 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -15,7 +15,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v54/github" + "github.com/google/go-github/v55/github" ) var ( diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index 72441bc57b4..f6d72d5edd8 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -15,7 +15,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v54/github" + "github.com/google/go-github/v55/github" ) func TestRepositories_CRUD(t *testing.T) { diff --git a/test/integration/users_test.go b/test/integration/users_test.go index 61bf8c9974d..64efcd04a3e 100644 --- a/test/integration/users_test.go +++ b/test/integration/users_test.go @@ -14,7 +14,7 @@ import ( "math/rand" "testing" - "github.com/google/go-github/v54/github" + "github.com/google/go-github/v55/github" ) func TestUsers_Get(t *testing.T) { diff --git a/update-urls/go.mod b/update-urls/go.mod index faa2ff61eef..8fcf97b0614 100644 --- a/update-urls/go.mod +++ b/update-urls/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v54/update-urls +module github.com/google/go-github/v55/update-urls go 1.16 From b7004313ee714201eb28bdd4d6fb98b7bd323611 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Tue, 5 Sep 2023 13:13:24 -0400 Subject: [PATCH 306/751] Bump go-github from v54 to v55 in /scrape (#2915) --- scrape/apps.go | 2 +- scrape/apps_test.go | 2 +- scrape/go.mod | 2 +- scrape/go.sum | 1516 +------------------------------------------ 4 files changed, 5 insertions(+), 1517 deletions(-) diff --git a/scrape/apps.go b/scrape/apps.go index 56db9c9a5a1..9cb99ddc0f8 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -17,7 +17,7 @@ import ( "strings" "github.com/PuerkitoBio/goquery" - "github.com/google/go-github/v54/github" + "github.com/google/go-github/v55/github" ) // AppRestrictionsEnabled returns whether the specified organization has diff --git a/scrape/apps_test.go b/scrape/apps_test.go index 32d7944940e..f80825fbad2 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v54/github" + "github.com/google/go-github/v55/github" ) func Test_AppRestrictionsEnabled(t *testing.T) { diff --git a/scrape/go.mod b/scrape/go.mod index 15673097473..8c6116364a6 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -5,7 +5,7 @@ go 1.13 require ( github.com/PuerkitoBio/goquery v1.8.1 github.com/google/go-cmp v0.5.9 - github.com/google/go-github/v54 v54.0.0 + github.com/google/go-github/v55 v55.0.0 github.com/xlzd/gotp v0.1.0 golang.org/x/net v0.14.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index 8edb2296e4d..7a79727970b 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -1,1586 +1,74 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= -cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= -cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= -cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= -cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= -cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= -cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= -cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= -cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= -cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= -cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= -cloud.google.com/go v0.100.1/go.mod h1:fs4QogzfH5n2pBXBP9vRiU+eCny7lD2vmFZy79Iuw1U= -cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= -cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= -cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= -cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM= -cloud.google.com/go v0.107.0/go.mod h1:wpc2eNrD7hXUTy8EKS10jkxpZBjASrORK7goS+3YX2I= -cloud.google.com/go v0.110.0/go.mod h1:SJnCLqQ0FCFGSZMUNUf84MV3Aia54kn7pi8st7tMzaY= -cloud.google.com/go v0.110.2/go.mod h1:k04UEeEtb6ZBRTv3dZz4CeJC3jKGxyhl0sAiVVquxiw= -cloud.google.com/go/accessapproval v1.4.0/go.mod h1:zybIuC3KpDOvotz59lFe5qxRZx6C75OtwbisN56xYB4= -cloud.google.com/go/accessapproval v1.5.0/go.mod h1:HFy3tuiGvMdcd/u+Cu5b9NkO1pEICJ46IR82PoUdplw= -cloud.google.com/go/accessapproval v1.6.0/go.mod h1:R0EiYnwV5fsRFiKZkPHr6mwyk2wxUJ30nL4j2pcFY2E= -cloud.google.com/go/accesscontextmanager v1.3.0/go.mod h1:TgCBehyr5gNMz7ZaH9xubp+CE8dkrszb4oK9CWyvD4o= -cloud.google.com/go/accesscontextmanager v1.4.0/go.mod h1:/Kjh7BBu/Gh83sv+K60vN9QE5NJcd80sU33vIe2IFPE= -cloud.google.com/go/accesscontextmanager v1.6.0/go.mod h1:8XCvZWfYw3K/ji0iVnp+6pu7huxoQTLmxAbVjbloTtM= -cloud.google.com/go/accesscontextmanager v1.7.0/go.mod h1:CEGLewx8dwa33aDAZQujl7Dx+uYhS0eay198wB/VumQ= -cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= -cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= -cloud.google.com/go/aiplatform v1.27.0/go.mod h1:Bvxqtl40l0WImSb04d0hXFU7gDOiq9jQmorivIiWcKg= -cloud.google.com/go/aiplatform v1.35.0/go.mod h1:7MFT/vCaOyZT/4IIFfxH4ErVg/4ku6lKv3w0+tFTgXQ= -cloud.google.com/go/aiplatform v1.36.1/go.mod h1:WTm12vJRPARNvJ+v6P52RDHCNe4AhvjcIZ/9/RRHy/k= -cloud.google.com/go/aiplatform v1.37.0/go.mod h1:IU2Cv29Lv9oCn/9LkFiiuKfwrRTq+QQMbW+hPCxJGZw= -cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= -cloud.google.com/go/analytics v0.12.0/go.mod h1:gkfj9h6XRf9+TS4bmuhPEShsh3hH8PAZzm/41OOhQd4= -cloud.google.com/go/analytics v0.17.0/go.mod h1:WXFa3WSym4IZ+JiKmavYdJwGG/CvpqiqczmL59bTD9M= -cloud.google.com/go/analytics v0.18.0/go.mod h1:ZkeHGQlcIPkw0R/GW+boWHhCOR43xz9RN/jn7WcqfIE= -cloud.google.com/go/analytics v0.19.0/go.mod h1:k8liqf5/HCnOUkbawNtrWWc+UAzyDlW89doe8TtoDsE= -cloud.google.com/go/apigateway v1.3.0/go.mod h1:89Z8Bhpmxu6AmUxuVRg/ECRGReEdiP3vQtk4Z1J9rJk= -cloud.google.com/go/apigateway v1.4.0/go.mod h1:pHVY9MKGaH9PQ3pJ4YLzoj6U5FUDeDFBllIz7WmzJoc= -cloud.google.com/go/apigateway v1.5.0/go.mod h1:GpnZR3Q4rR7LVu5951qfXPJCHquZt02jf7xQx7kpqN8= -cloud.google.com/go/apigeeconnect v1.3.0/go.mod h1:G/AwXFAKo0gIXkPTVfZDd2qA1TxBXJ3MgMRBQkIi9jc= -cloud.google.com/go/apigeeconnect v1.4.0/go.mod h1:kV4NwOKqjvt2JYR0AoIWo2QGfoRtn/pkS3QlHp0Ni04= -cloud.google.com/go/apigeeconnect v1.5.0/go.mod h1:KFaCqvBRU6idyhSNyn3vlHXc8VMDJdRmwDF6JyFRqZ8= -cloud.google.com/go/apigeeregistry v0.4.0/go.mod h1:EUG4PGcsZvxOXAdyEghIdXwAEi/4MEaoqLMLDMIwKXY= -cloud.google.com/go/apigeeregistry v0.5.0/go.mod h1:YR5+s0BVNZfVOUkMa5pAR2xGd0A473vA5M7j247o1wM= -cloud.google.com/go/apigeeregistry v0.6.0/go.mod h1:BFNzW7yQVLZ3yj0TKcwzb8n25CFBri51GVGOEUcgQsc= -cloud.google.com/go/apikeys v0.4.0/go.mod h1:XATS/yqZbaBK0HOssf+ALHp8jAlNHUgyfprvNcBIszU= -cloud.google.com/go/apikeys v0.5.0/go.mod h1:5aQfwY4D+ewMMWScd3hm2en3hCj+BROlyrt3ytS7KLI= -cloud.google.com/go/apikeys v0.6.0/go.mod h1:kbpXu5upyiAlGkKrJgQl8A0rKNNJ7dQ377pdroRSSi8= -cloud.google.com/go/appengine v1.4.0/go.mod h1:CS2NhuBuDXM9f+qscZ6V86m1MIIqPj3WC/UoEuR1Sno= -cloud.google.com/go/appengine v1.5.0/go.mod h1:TfasSozdkFI0zeoxW3PTBLiNqRmzraodCWatWI9Dmak= -cloud.google.com/go/appengine v1.6.0/go.mod h1:hg6i0J/BD2cKmDJbaFSYHFyZkgBEfQrDg/X0V5fJn84= -cloud.google.com/go/appengine v1.7.0/go.mod h1:eZqpbHFCqRGa2aCdope7eC0SWLV1j0neb/QnMJVWx6A= -cloud.google.com/go/appengine v1.7.1/go.mod h1:IHLToyb/3fKutRysUlFO0BPt5j7RiQ45nrzEJmKTo6E= -cloud.google.com/go/area120 v0.5.0/go.mod h1:DE/n4mp+iqVyvxHN41Vf1CR602GiHQjFPusMFW6bGR4= -cloud.google.com/go/area120 v0.6.0/go.mod h1:39yFJqWVgm0UZqWTOdqkLhjoC7uFfgXRC8g/ZegeAh0= -cloud.google.com/go/area120 v0.7.0/go.mod h1:a3+8EUD1SX5RUcCs3MY5YasiO1z6yLiNLRiFrykbynY= -cloud.google.com/go/area120 v0.7.1/go.mod h1:j84i4E1RboTWjKtZVWXPqvK5VHQFJRF2c1Nm69pWm9k= -cloud.google.com/go/artifactregistry v1.6.0/go.mod h1:IYt0oBPSAGYj/kprzsBjZ/4LnG/zOcHyFHjWPCi6SAQ= -cloud.google.com/go/artifactregistry v1.7.0/go.mod h1:mqTOFOnGZx8EtSqK/ZWcsm/4U8B77rbcLP6ruDU2Ixk= -cloud.google.com/go/artifactregistry v1.8.0/go.mod h1:w3GQXkJX8hiKN0v+at4b0qotwijQbYUqF2GWkZzAhC0= -cloud.google.com/go/artifactregistry v1.9.0/go.mod h1:2K2RqvA2CYvAeARHRkLDhMDJ3OXy26h3XW+3/Jh2uYc= -cloud.google.com/go/artifactregistry v1.11.1/go.mod h1:lLYghw+Itq9SONbCa1YWBoWs1nOucMH0pwXN1rOBZFI= -cloud.google.com/go/artifactregistry v1.11.2/go.mod h1:nLZns771ZGAwVLzTX/7Al6R9ehma4WUEhZGWV6CeQNQ= -cloud.google.com/go/artifactregistry v1.12.0/go.mod h1:o6P3MIvtzTOnmvGagO9v/rOjjA0HmhJ+/6KAXrmYDCI= -cloud.google.com/go/artifactregistry v1.13.0/go.mod h1:uy/LNfoOIivepGhooAUpL1i30Hgee3Cu0l4VTWHUC08= -cloud.google.com/go/asset v1.5.0/go.mod h1:5mfs8UvcM5wHhqtSv8J1CtxxaQq3AdBxxQi2jGW/K4o= -cloud.google.com/go/asset v1.7.0/go.mod h1:YbENsRK4+xTiL+Ofoj5Ckf+O17kJtgp3Y3nn4uzZz5s= -cloud.google.com/go/asset v1.8.0/go.mod h1:mUNGKhiqIdbr8X7KNayoYvyc4HbbFO9URsjbytpUaW0= -cloud.google.com/go/asset v1.9.0/go.mod h1:83MOE6jEJBMqFKadM9NLRcs80Gdw76qGuHn8m3h8oHQ= -cloud.google.com/go/asset v1.10.0/go.mod h1:pLz7uokL80qKhzKr4xXGvBQXnzHn5evJAEAtZiIb0wY= -cloud.google.com/go/asset v1.11.1/go.mod h1:fSwLhbRvC9p9CXQHJ3BgFeQNM4c9x10lqlrdEUYXlJo= -cloud.google.com/go/asset v1.12.0/go.mod h1:h9/sFOa4eDIyKmH6QMpm4eUK3pDojWnUhTgJlk762Hg= -cloud.google.com/go/asset v1.13.0/go.mod h1:WQAMyYek/b7NBpYq/K4KJWcRqzoalEsxz/t/dTk4THw= -cloud.google.com/go/assuredworkloads v1.5.0/go.mod h1:n8HOZ6pff6re5KYfBXcFvSViQjDwxFkAkmUFffJRbbY= -cloud.google.com/go/assuredworkloads v1.6.0/go.mod h1:yo2YOk37Yc89Rsd5QMVECvjaMKymF9OP+QXWlKXUkXw= -cloud.google.com/go/assuredworkloads v1.7.0/go.mod h1:z/736/oNmtGAyU47reJgGN+KVoYoxeLBoj4XkKYscNI= -cloud.google.com/go/assuredworkloads v1.8.0/go.mod h1:AsX2cqyNCOvEQC8RMPnoc0yEarXQk6WEKkxYfL6kGIo= -cloud.google.com/go/assuredworkloads v1.9.0/go.mod h1:kFuI1P78bplYtT77Tb1hi0FMxM0vVpRC7VVoJC3ZoT0= -cloud.google.com/go/assuredworkloads v1.10.0/go.mod h1:kwdUQuXcedVdsIaKgKTp9t0UJkE5+PAVNhdQm4ZVq2E= -cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0= -cloud.google.com/go/automl v1.6.0/go.mod h1:ugf8a6Fx+zP0D59WLhqgTDsQI9w07o64uf/Is3Nh5p8= -cloud.google.com/go/automl v1.7.0/go.mod h1:RL9MYCCsJEOmt0Wf3z9uzG0a7adTT1fe+aObgSpkCt8= -cloud.google.com/go/automl v1.8.0/go.mod h1:xWx7G/aPEe/NP+qzYXktoBSDfjO+vnKMGgsApGJJquM= -cloud.google.com/go/automl v1.12.0/go.mod h1:tWDcHDp86aMIuHmyvjuKeeHEGq76lD7ZqfGLN6B0NuU= -cloud.google.com/go/baremetalsolution v0.3.0/go.mod h1:XOrocE+pvK1xFfleEnShBlNAXf+j5blPPxrhjKgnIFc= -cloud.google.com/go/baremetalsolution v0.4.0/go.mod h1:BymplhAadOO/eBa7KewQ0Ppg4A4Wplbn+PsFKRLo0uI= -cloud.google.com/go/baremetalsolution v0.5.0/go.mod h1:dXGxEkmR9BMwxhzBhV0AioD0ULBmuLZI8CdwalUxuss= -cloud.google.com/go/batch v0.3.0/go.mod h1:TR18ZoAekj1GuirsUsR1ZTKN3FC/4UDnScjT8NXImFE= -cloud.google.com/go/batch v0.4.0/go.mod h1:WZkHnP43R/QCGQsZ+0JyG4i79ranE2u8xvjq/9+STPE= -cloud.google.com/go/batch v0.7.0/go.mod h1:vLZN95s6teRUqRQ4s3RLDsH8PvboqBK+rn1oevL159g= -cloud.google.com/go/beyondcorp v0.2.0/go.mod h1:TB7Bd+EEtcw9PCPQhCJtJGjk/7TC6ckmnSFS+xwTfm4= -cloud.google.com/go/beyondcorp v0.3.0/go.mod h1:E5U5lcrcXMsCuoDNyGrpyTm/hn7ne941Jz2vmksAxW8= -cloud.google.com/go/beyondcorp v0.4.0/go.mod h1:3ApA0mbhHx6YImmuubf5pyW8srKnCEPON32/5hj+RmM= -cloud.google.com/go/beyondcorp v0.5.0/go.mod h1:uFqj9X+dSfrheVp7ssLTaRHd2EHqSL4QZmH4e8WXGGU= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/bigquery v1.42.0/go.mod h1:8dRTJxhtG+vwBKzE5OseQn/hiydoQN3EedCaOdYmxRA= -cloud.google.com/go/bigquery v1.43.0/go.mod h1:ZMQcXHsl+xmU1z36G2jNGZmKp9zNY5BUua5wDgmNCfw= -cloud.google.com/go/bigquery v1.44.0/go.mod h1:0Y33VqXTEsbamHJvJHdFmtqHvMIY28aK1+dFsvaChGc= -cloud.google.com/go/bigquery v1.47.0/go.mod h1:sA9XOgy0A8vQK9+MWhEQTY6Tix87M/ZurWFIxmF9I/E= -cloud.google.com/go/bigquery v1.48.0/go.mod h1:QAwSz+ipNgfL5jxiaK7weyOhzdoAy1zFm0Nf1fysJac= -cloud.google.com/go/bigquery v1.49.0/go.mod h1:Sv8hMmTFFYBlt/ftw2uN6dFdQPzBlREY9yBh7Oy7/4Q= -cloud.google.com/go/bigquery v1.50.0/go.mod h1:YrleYEh2pSEbgTBZYMJ5SuSr0ML3ypjRB1zgf7pvQLU= -cloud.google.com/go/billing v1.4.0/go.mod h1:g9IdKBEFlItS8bTtlrZdVLWSSdSyFUZKXNS02zKMOZY= -cloud.google.com/go/billing v1.5.0/go.mod h1:mztb1tBc3QekhjSgmpf/CV4LzWXLzCArwpLmP2Gm88s= -cloud.google.com/go/billing v1.6.0/go.mod h1:WoXzguj+BeHXPbKfNWkqVtDdzORazmCjraY+vrxcyvI= -cloud.google.com/go/billing v1.7.0/go.mod h1:q457N3Hbj9lYwwRbnlD7vUpyjq6u5U1RAOArInEiD5Y= -cloud.google.com/go/billing v1.12.0/go.mod h1:yKrZio/eu+okO/2McZEbch17O5CB5NpZhhXG6Z766ss= -cloud.google.com/go/billing v1.13.0/go.mod h1:7kB2W9Xf98hP9Sr12KfECgfGclsH3CQR0R08tnRlRbc= -cloud.google.com/go/binaryauthorization v1.1.0/go.mod h1:xwnoWu3Y84jbuHa0zd526MJYmtnVXn0syOjaJgy4+dM= -cloud.google.com/go/binaryauthorization v1.2.0/go.mod h1:86WKkJHtRcv5ViNABtYMhhNWRrD1Vpi//uKEy7aYEfI= -cloud.google.com/go/binaryauthorization v1.3.0/go.mod h1:lRZbKgjDIIQvzYQS1p99A7/U1JqvqeZg0wiI5tp6tg0= -cloud.google.com/go/binaryauthorization v1.4.0/go.mod h1:tsSPQrBd77VLplV70GUhBf/Zm3FsKmgSqgm4UmiDItk= -cloud.google.com/go/binaryauthorization v1.5.0/go.mod h1:OSe4OU1nN/VswXKRBmciKpo9LulY41gch5c68htf3/Q= -cloud.google.com/go/certificatemanager v1.3.0/go.mod h1:n6twGDvcUBFu9uBgt4eYvvf3sQ6My8jADcOVwHmzadg= -cloud.google.com/go/certificatemanager v1.4.0/go.mod h1:vowpercVFyqs8ABSmrdV+GiFf2H/ch3KyudYQEMM590= -cloud.google.com/go/certificatemanager v1.6.0/go.mod h1:3Hh64rCKjRAX8dXgRAyOcY5vQ/fE1sh8o+Mdd6KPgY8= -cloud.google.com/go/channel v1.8.0/go.mod h1:W5SwCXDJsq/rg3tn3oG0LOxpAo6IMxNa09ngphpSlnk= -cloud.google.com/go/channel v1.9.0/go.mod h1:jcu05W0my9Vx4mt3/rEHpfxc9eKi9XwsdDL8yBMbKUk= -cloud.google.com/go/channel v1.11.0/go.mod h1:IdtI0uWGqhEeatSB62VOoJ8FSUhJ9/+iGkJVqp74CGE= -cloud.google.com/go/channel v1.12.0/go.mod h1:VkxCGKASi4Cq7TbXxlaBezonAYpp1GCnKMY6tnMQnLU= -cloud.google.com/go/cloudbuild v1.3.0/go.mod h1:WequR4ULxlqvMsjDEEEFnOG5ZSRSgWOywXYDb1vPE6U= -cloud.google.com/go/cloudbuild v1.4.0/go.mod h1:5Qwa40LHiOXmz3386FrjrYM93rM/hdRr7b53sySrTqA= -cloud.google.com/go/cloudbuild v1.6.0/go.mod h1:UIbc/w9QCbH12xX+ezUsgblrWv+Cv4Tw83GiSMHOn9M= -cloud.google.com/go/cloudbuild v1.7.0/go.mod h1:zb5tWh2XI6lR9zQmsm1VRA+7OCuve5d8S+zJUul8KTg= -cloud.google.com/go/cloudbuild v1.9.0/go.mod h1:qK1d7s4QlO0VwfYn5YuClDGg2hfmLZEb4wQGAbIgL1s= -cloud.google.com/go/clouddms v1.3.0/go.mod h1:oK6XsCDdW4Ib3jCCBugx+gVjevp2TMXFtgxvPSee3OM= -cloud.google.com/go/clouddms v1.4.0/go.mod h1:Eh7sUGCC+aKry14O1NRljhjyrr0NFC0G2cjwX0cByRk= -cloud.google.com/go/clouddms v1.5.0/go.mod h1:QSxQnhikCLUw13iAbffF2CZxAER3xDGNHjsTAkQJcQA= -cloud.google.com/go/cloudtasks v1.5.0/go.mod h1:fD92REy1x5woxkKEkLdvavGnPJGEn8Uic9nWuLzqCpY= -cloud.google.com/go/cloudtasks v1.6.0/go.mod h1:C6Io+sxuke9/KNRkbQpihnW93SWDU3uXt92nu85HkYI= -cloud.google.com/go/cloudtasks v1.7.0/go.mod h1:ImsfdYWwlWNJbdgPIIGJWC+gemEGTBK/SunNQQNCAb4= -cloud.google.com/go/cloudtasks v1.8.0/go.mod h1:gQXUIwCSOI4yPVK7DgTVFiiP0ZW/eQkydWzwVMdHxrI= -cloud.google.com/go/cloudtasks v1.9.0/go.mod h1:w+EyLsVkLWHcOaqNEyvcKAsWp9p29dL6uL9Nst1cI7Y= -cloud.google.com/go/cloudtasks v1.10.0/go.mod h1:NDSoTLkZ3+vExFEWu2UJV1arUyzVDAiZtdWcsUyNwBs= -cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= -cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= -cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= -cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= -cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= -cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= -cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= -cloud.google.com/go/compute v1.12.0/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= -cloud.google.com/go/compute v1.12.1/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= -cloud.google.com/go/compute v1.13.0/go.mod h1:5aPTS0cUNMIc1CE546K+Th6weJUNQErARyZtRXDJ8GE= -cloud.google.com/go/compute v1.14.0/go.mod h1:YfLtxrj9sU4Yxv+sXzZkyPjEyPBZfXHUvjxega5vAdo= -cloud.google.com/go/compute v1.15.1/go.mod h1:bjjoF/NtFUrkD/urWfdHaKuOPDR5nWIs63rR+SXhcpA= -cloud.google.com/go/compute v1.18.0/go.mod h1:1X7yHxec2Ga+Ss6jPyjxRxpu2uu7PLgsOVXvgU0yacs= -cloud.google.com/go/compute v1.19.0/go.mod h1:rikpw2y+UMidAe9tISo04EHNOIf42RLYF/q8Bs93scU= -cloud.google.com/go/compute v1.19.3/go.mod h1:qxvISKp/gYnXkSAD1ppcSOveRAmzxicEv/JlizULFrI= -cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= -cloud.google.com/go/compute/metadata v0.1.0/go.mod h1:Z1VN+bulIf6bt4P/C37K4DyZYZEXYonfTBHHFPO/4UU= -cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= -cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= -cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= -cloud.google.com/go/contactcenterinsights v1.3.0/go.mod h1:Eu2oemoePuEFc/xKFPjbTuPSj0fYJcPls9TFlPNnHHY= -cloud.google.com/go/contactcenterinsights v1.4.0/go.mod h1:L2YzkGbPsv+vMQMCADxJoT9YiTTnSEd6fEvCeHTYVck= -cloud.google.com/go/contactcenterinsights v1.6.0/go.mod h1:IIDlT6CLcDoyv79kDv8iWxMSTZhLxSCofVV5W6YFM/w= -cloud.google.com/go/container v1.6.0/go.mod h1:Xazp7GjJSeUYo688S+6J5V+n/t+G5sKBTFkKNudGRxg= -cloud.google.com/go/container v1.7.0/go.mod h1:Dp5AHtmothHGX3DwwIHPgq45Y8KmNsgN3amoYfxVkLo= -cloud.google.com/go/container v1.13.1/go.mod h1:6wgbMPeQRw9rSnKBCAJXnds3Pzj03C4JHamr8asWKy4= -cloud.google.com/go/container v1.14.0/go.mod h1:3AoJMPhHfLDxLvrlVWaK57IXzaPnLaZq63WX59aQBfM= -cloud.google.com/go/container v1.15.0/go.mod h1:ft+9S0WGjAyjDggg5S06DXj+fHJICWg8L7isCQe9pQA= -cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= -cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= -cloud.google.com/go/containeranalysis v0.7.0/go.mod h1:9aUL+/vZ55P2CXfuZjS4UjQ9AgXoSw8Ts6lemfmxBxI= -cloud.google.com/go/containeranalysis v0.9.0/go.mod h1:orbOANbwk5Ejoom+s+DUCTTJ7IBdBQJDcSylAx/on9s= -cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= -cloud.google.com/go/datacatalog v1.5.0/go.mod h1:M7GPLNQeLfWqeIm3iuiruhPzkt65+Bx8dAKvScX8jvs= -cloud.google.com/go/datacatalog v1.6.0/go.mod h1:+aEyF8JKg+uXcIdAmmaMUmZ3q1b/lKLtXCmXdnc0lbc= -cloud.google.com/go/datacatalog v1.7.0/go.mod h1:9mEl4AuDYWw81UGc41HonIHH7/sn52H0/tc8f8ZbZIE= -cloud.google.com/go/datacatalog v1.8.0/go.mod h1:KYuoVOv9BM8EYz/4eMFxrr4DUKhGIOXxZoKYF5wdISM= -cloud.google.com/go/datacatalog v1.8.1/go.mod h1:RJ58z4rMp3gvETA465Vg+ag8BGgBdnRPEMMSTr5Uv+M= -cloud.google.com/go/datacatalog v1.12.0/go.mod h1:CWae8rFkfp6LzLumKOnmVh4+Zle4A3NXLzVJ1d1mRm0= -cloud.google.com/go/datacatalog v1.13.0/go.mod h1:E4Rj9a5ZtAxcQJlEBTLgMTphfP11/lNaAshpoBgemX8= -cloud.google.com/go/dataflow v0.6.0/go.mod h1:9QwV89cGoxjjSR9/r7eFDqqjtvbKxAK2BaYU6PVk9UM= -cloud.google.com/go/dataflow v0.7.0/go.mod h1:PX526vb4ijFMesO1o202EaUmouZKBpjHsTlCtB4parQ= -cloud.google.com/go/dataflow v0.8.0/go.mod h1:Rcf5YgTKPtQyYz8bLYhFoIV/vP39eL7fWNcSOyFfLJE= -cloud.google.com/go/dataform v0.3.0/go.mod h1:cj8uNliRlHpa6L3yVhDOBrUXH+BPAO1+KFMQQNSThKo= -cloud.google.com/go/dataform v0.4.0/go.mod h1:fwV6Y4Ty2yIFL89huYlEkwUPtS7YZinZbzzj5S9FzCE= -cloud.google.com/go/dataform v0.5.0/go.mod h1:GFUYRe8IBa2hcomWplodVmUx/iTL0FrsauObOM3Ipr0= -cloud.google.com/go/dataform v0.6.0/go.mod h1:QPflImQy33e29VuapFdf19oPbE4aYTJxr31OAPV+ulA= -cloud.google.com/go/dataform v0.7.0/go.mod h1:7NulqnVozfHvWUBpMDfKMUESr+85aJsC/2O0o3jWPDE= -cloud.google.com/go/datafusion v1.4.0/go.mod h1:1Zb6VN+W6ALo85cXnM1IKiPw+yQMKMhB9TsTSRDo/38= -cloud.google.com/go/datafusion v1.5.0/go.mod h1:Kz+l1FGHB0J+4XF2fud96WMmRiq/wj8N9u007vyXZ2w= -cloud.google.com/go/datafusion v1.6.0/go.mod h1:WBsMF8F1RhSXvVM8rCV3AeyWVxcC2xY6vith3iw3S+8= -cloud.google.com/go/datalabeling v0.5.0/go.mod h1:TGcJ0G2NzcsXSE/97yWjIZO0bXj0KbVlINXMG9ud42I= -cloud.google.com/go/datalabeling v0.6.0/go.mod h1:WqdISuk/+WIGeMkpw/1q7bK/tFEZxsrFJOJdY2bXvTQ= -cloud.google.com/go/datalabeling v0.7.0/go.mod h1:WPQb1y08RJbmpM3ww0CSUAGweL0SxByuW2E+FU+wXcM= -cloud.google.com/go/dataplex v1.3.0/go.mod h1:hQuRtDg+fCiFgC8j0zV222HvzFQdRd+SVX8gdmFcZzA= -cloud.google.com/go/dataplex v1.4.0/go.mod h1:X51GfLXEMVJ6UN47ESVqvlsRplbLhcsAt0kZCCKsU0A= -cloud.google.com/go/dataplex v1.5.2/go.mod h1:cVMgQHsmfRoI5KFYq4JtIBEUbYwc3c7tXmIDhRmNNVQ= -cloud.google.com/go/dataplex v1.6.0/go.mod h1:bMsomC/aEJOSpHXdFKFGQ1b0TDPIeL28nJObeO1ppRs= -cloud.google.com/go/dataproc v1.7.0/go.mod h1:CKAlMjII9H90RXaMpSxQ8EU6dQx6iAYNPcYPOkSbi8s= -cloud.google.com/go/dataproc v1.8.0/go.mod h1:5OW+zNAH0pMpw14JVrPONsxMQYMBqJuzORhIBfBn9uI= -cloud.google.com/go/dataproc v1.12.0/go.mod h1:zrF3aX0uV3ikkMz6z4uBbIKyhRITnxvr4i3IjKsKrw4= -cloud.google.com/go/dataqna v0.5.0/go.mod h1:90Hyk596ft3zUQ8NkFfvICSIfHFh1Bc7C4cK3vbhkeo= -cloud.google.com/go/dataqna v0.6.0/go.mod h1:1lqNpM7rqNLVgWBJyk5NF6Uen2PHym0jtVJonplVsDA= -cloud.google.com/go/dataqna v0.7.0/go.mod h1:Lx9OcIIeqCrw1a6KdO3/5KMP1wAmTc0slZWwP12Qq3c= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/datastore v1.10.0/go.mod h1:PC5UzAmDEkAmkfaknstTYbNpgE49HAgW2J1gcgUfmdM= -cloud.google.com/go/datastore v1.11.0/go.mod h1:TvGxBIHCS50u8jzG+AW/ppf87v1of8nwzFNgEZU1D3c= -cloud.google.com/go/datastream v1.2.0/go.mod h1:i/uTP8/fZwgATHS/XFu0TcNUhuA0twZxxQ3EyCUQMwo= -cloud.google.com/go/datastream v1.3.0/go.mod h1:cqlOX8xlyYF/uxhiKn6Hbv6WjwPPuI9W2M9SAXwaLLQ= -cloud.google.com/go/datastream v1.4.0/go.mod h1:h9dpzScPhDTs5noEMQVWP8Wx8AFBRyS0s8KWPx/9r0g= -cloud.google.com/go/datastream v1.5.0/go.mod h1:6TZMMNPwjUqZHBKPQ1wwXpb0d5VDVPl2/XoS5yi88q4= -cloud.google.com/go/datastream v1.6.0/go.mod h1:6LQSuswqLa7S4rPAOZFVjHIG3wJIjZcZrw8JDEDJuIs= -cloud.google.com/go/datastream v1.7.0/go.mod h1:uxVRMm2elUSPuh65IbZpzJNMbuzkcvu5CjMqVIUHrww= -cloud.google.com/go/deploy v1.4.0/go.mod h1:5Xghikd4VrmMLNaF6FiRFDlHb59VM59YoDQnOUdsH/c= -cloud.google.com/go/deploy v1.5.0/go.mod h1:ffgdD0B89tToyW/U/D2eL0jN2+IEV/3EMuXHA0l4r+s= -cloud.google.com/go/deploy v1.6.0/go.mod h1:f9PTHehG/DjCom3QH0cntOVRm93uGBDt2vKzAPwpXQI= -cloud.google.com/go/deploy v1.8.0/go.mod h1:z3myEJnA/2wnB4sgjqdMfgxCA0EqC3RBTNcVPs93mtQ= -cloud.google.com/go/dialogflow v1.15.0/go.mod h1:HbHDWs33WOGJgn6rfzBW1Kv807BE3O1+xGbn59zZWI4= -cloud.google.com/go/dialogflow v1.16.1/go.mod h1:po6LlzGfK+smoSmTBnbkIZY2w8ffjz/RcGSS+sh1el0= -cloud.google.com/go/dialogflow v1.17.0/go.mod h1:YNP09C/kXA1aZdBgC/VtXX74G/TKn7XVCcVumTflA+8= -cloud.google.com/go/dialogflow v1.18.0/go.mod h1:trO7Zu5YdyEuR+BhSNOqJezyFQ3aUzz0njv7sMx/iek= -cloud.google.com/go/dialogflow v1.19.0/go.mod h1:JVmlG1TwykZDtxtTXujec4tQ+D8SBFMoosgy+6Gn0s0= -cloud.google.com/go/dialogflow v1.29.0/go.mod h1:b+2bzMe+k1s9V+F2jbJwpHPzrnIyHihAdRFMtn2WXuM= -cloud.google.com/go/dialogflow v1.31.0/go.mod h1:cuoUccuL1Z+HADhyIA7dci3N5zUssgpBJmCzI6fNRB4= -cloud.google.com/go/dialogflow v1.32.0/go.mod h1:jG9TRJl8CKrDhMEcvfcfFkkpp8ZhgPz3sBGmAUYJ2qE= -cloud.google.com/go/dlp v1.6.0/go.mod h1:9eyB2xIhpU0sVwUixfBubDoRwP+GjeUoxxeueZmqvmM= -cloud.google.com/go/dlp v1.7.0/go.mod h1:68ak9vCiMBjbasxeVD17hVPxDEck+ExiHavX8kiHG+Q= -cloud.google.com/go/dlp v1.9.0/go.mod h1:qdgmqgTyReTz5/YNSSuueR8pl7hO0o9bQ39ZhtgkWp4= -cloud.google.com/go/documentai v1.7.0/go.mod h1:lJvftZB5NRiFSX4moiye1SMxHx0Bc3x1+p9e/RfXYiU= -cloud.google.com/go/documentai v1.8.0/go.mod h1:xGHNEB7CtsnySCNrCFdCyyMz44RhFEEX2Q7UD0c5IhU= -cloud.google.com/go/documentai v1.9.0/go.mod h1:FS5485S8R00U10GhgBC0aNGrJxBP8ZVpEeJ7PQDZd6k= -cloud.google.com/go/documentai v1.10.0/go.mod h1:vod47hKQIPeCfN2QS/jULIvQTugbmdc0ZvxxfQY1bg4= -cloud.google.com/go/documentai v1.16.0/go.mod h1:o0o0DLTEZ+YnJZ+J4wNfTxmDVyrkzFvttBXXtYRMHkM= -cloud.google.com/go/documentai v1.18.0/go.mod h1:F6CK6iUH8J81FehpskRmhLq/3VlwQvb7TvwOceQ2tbs= -cloud.google.com/go/domains v0.6.0/go.mod h1:T9Rz3GasrpYk6mEGHh4rymIhjlnIuB4ofT1wTxDeT4Y= -cloud.google.com/go/domains v0.7.0/go.mod h1:PtZeqS1xjnXuRPKE/88Iru/LdfoRyEHYA9nFQf4UKpg= -cloud.google.com/go/domains v0.8.0/go.mod h1:M9i3MMDzGFXsydri9/vW+EWz9sWb4I6WyHqdlAk0idE= -cloud.google.com/go/edgecontainer v0.1.0/go.mod h1:WgkZ9tp10bFxqO8BLPqv2LlfmQF1X8lZqwW4r1BTajk= -cloud.google.com/go/edgecontainer v0.2.0/go.mod h1:RTmLijy+lGpQ7BXuTDa4C4ssxyXT34NIuHIgKuP4s5w= -cloud.google.com/go/edgecontainer v0.3.0/go.mod h1:FLDpP4nykgwwIfcLt6zInhprzw0lEi2P1fjO6Ie0qbc= -cloud.google.com/go/edgecontainer v1.0.0/go.mod h1:cttArqZpBB2q58W/upSG++ooo6EsblxDIolxa3jSjbY= -cloud.google.com/go/errorreporting v0.3.0/go.mod h1:xsP2yaAp+OAW4OIm60An2bbLpqIhKXdWR/tawvl7QzU= -cloud.google.com/go/essentialcontacts v1.3.0/go.mod h1:r+OnHa5jfj90qIfZDO/VztSFqbQan7HV75p8sA+mdGI= -cloud.google.com/go/essentialcontacts v1.4.0/go.mod h1:8tRldvHYsmnBCHdFpvU+GL75oWiBKl80BiqlFh9tp+8= -cloud.google.com/go/essentialcontacts v1.5.0/go.mod h1:ay29Z4zODTuwliK7SnX8E86aUF2CTzdNtvv42niCX0M= -cloud.google.com/go/eventarc v1.7.0/go.mod h1:6ctpF3zTnaQCxUjHUdcfgcA1A2T309+omHZth7gDfmc= -cloud.google.com/go/eventarc v1.8.0/go.mod h1:imbzxkyAU4ubfsaKYdQg04WS1NvncblHEup4kvF+4gw= -cloud.google.com/go/eventarc v1.10.0/go.mod h1:u3R35tmZ9HvswGRBnF48IlYgYeBcPUCjkr4BTdem2Kw= -cloud.google.com/go/eventarc v1.11.0/go.mod h1:PyUjsUKPWoRBCHeOxZd/lbOOjahV41icXyUY5kSTvVY= -cloud.google.com/go/filestore v1.3.0/go.mod h1:+qbvHGvXU1HaKX2nD0WEPo92TP/8AQuCVEBXNY9z0+w= -cloud.google.com/go/filestore v1.4.0/go.mod h1:PaG5oDfo9r224f8OYXURtAsY+Fbyq/bLYoINEK8XQAI= -cloud.google.com/go/filestore v1.5.0/go.mod h1:FqBXDWBp4YLHqRnVGveOkHDf8svj9r5+mUDLupOWEDs= -cloud.google.com/go/filestore v1.6.0/go.mod h1:di5unNuss/qfZTw2U9nhFqo8/ZDSc466dre85Kydllg= -cloud.google.com/go/firestore v1.9.0/go.mod h1:HMkjKHNTtRyZNiMzu7YAsLr9K3X2udY2AMwDaMEQiiE= -cloud.google.com/go/functions v1.6.0/go.mod h1:3H1UA3qiIPRWD7PeZKLvHZ9SaQhR26XIJcC0A5GbvAk= -cloud.google.com/go/functions v1.7.0/go.mod h1:+d+QBcWM+RsrgZfV9xo6KfA1GlzJfxcfZcRPEhDDfzg= -cloud.google.com/go/functions v1.8.0/go.mod h1:RTZ4/HsQjIqIYP9a9YPbU+QFoQsAlYgrwOXJWHn1POY= -cloud.google.com/go/functions v1.9.0/go.mod h1:Y+Dz8yGguzO3PpIjhLTbnqV1CWmgQ5UwtlpzoyquQ08= -cloud.google.com/go/functions v1.10.0/go.mod h1:0D3hEOe3DbEvCXtYOZHQZmD+SzYsi1YbI7dGvHfldXw= -cloud.google.com/go/functions v1.12.0/go.mod h1:AXWGrF3e2C/5ehvwYo/GH6O5s09tOPksiKhz+hH8WkA= -cloud.google.com/go/functions v1.13.0/go.mod h1:EU4O007sQm6Ef/PwRsI8N2umygGqPBS/IZQKBQBcJ3c= -cloud.google.com/go/gaming v1.5.0/go.mod h1:ol7rGcxP/qHTRQE/RO4bxkXq+Fix0j6D4LFPzYTIrDM= -cloud.google.com/go/gaming v1.6.0/go.mod h1:YMU1GEvA39Qt3zWGyAVA9bpYz/yAhTvaQ1t2sK4KPUA= -cloud.google.com/go/gaming v1.7.0/go.mod h1:LrB8U7MHdGgFG851iHAfqUdLcKBdQ55hzXy9xBJz0+w= -cloud.google.com/go/gaming v1.8.0/go.mod h1:xAqjS8b7jAVW0KFYeRUxngo9My3f33kFmua++Pi+ggM= -cloud.google.com/go/gaming v1.9.0/go.mod h1:Fc7kEmCObylSWLO334NcO+O9QMDyz+TKC4v1D7X+Bc0= -cloud.google.com/go/gkebackup v0.2.0/go.mod h1:XKvv/4LfG829/B8B7xRkk8zRrOEbKtEam6yNfuQNH60= -cloud.google.com/go/gkebackup v0.3.0/go.mod h1:n/E671i1aOQvUxT541aTkCwExO/bTer2HDlj4TsBRAo= -cloud.google.com/go/gkebackup v0.4.0/go.mod h1:byAyBGUwYGEEww7xsbnUTBHIYcOPy/PgUWUtOeRm9Vg= -cloud.google.com/go/gkeconnect v0.5.0/go.mod h1:c5lsNAg5EwAy7fkqX/+goqFsU1Da/jQFqArp+wGNr/o= -cloud.google.com/go/gkeconnect v0.6.0/go.mod h1:Mln67KyU/sHJEBY8kFZ0xTeyPtzbq9StAVvEULYK16A= -cloud.google.com/go/gkeconnect v0.7.0/go.mod h1:SNfmVqPkaEi3bF/B3CNZOAYPYdg7sU+obZ+QTky2Myw= -cloud.google.com/go/gkehub v0.9.0/go.mod h1:WYHN6WG8w9bXU0hqNxt8rm5uxnk8IH+lPY9J2TV7BK0= -cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y977wO+hBH0= -cloud.google.com/go/gkehub v0.11.0/go.mod h1:JOWHlmN+GHyIbuWQPl47/C2RFhnFKH38jH9Ascu3n0E= -cloud.google.com/go/gkehub v0.12.0/go.mod h1:djiIwwzTTBrF5NaXCGv3mf7klpEMcST17VBTVVDcuaw= -cloud.google.com/go/gkemulticloud v0.3.0/go.mod h1:7orzy7O0S+5kq95e4Hpn7RysVA7dPs8W/GgfUtsPbrA= -cloud.google.com/go/gkemulticloud v0.4.0/go.mod h1:E9gxVBnseLWCk24ch+P9+B2CoDFJZTyIgLKSalC7tuI= -cloud.google.com/go/gkemulticloud v0.5.0/go.mod h1:W0JDkiyi3Tqh0TJr//y19wyb1yf8llHVto2Htf2Ja3Y= -cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= -cloud.google.com/go/gsuiteaddons v1.3.0/go.mod h1:EUNK/J1lZEZO8yPtykKxLXI6JSVN2rg9bN8SXOa0bgM= -cloud.google.com/go/gsuiteaddons v1.4.0/go.mod h1:rZK5I8hht7u7HxFQcFei0+AtfS9uSushomRlg+3ua1o= -cloud.google.com/go/gsuiteaddons v1.5.0/go.mod h1:TFCClYLd64Eaa12sFVmUyG62tk4mdIsI7pAnSXRkcFo= -cloud.google.com/go/iam v0.1.0/go.mod h1:vcUNEa0pEm0qRVpmWepWaFMIAI8/hjB9mO8rNCJtF6c= -cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= -cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= -cloud.google.com/go/iam v0.6.0/go.mod h1:+1AH33ueBne5MzYccyMHtEKqLE4/kJOibtffMHDMFMc= -cloud.google.com/go/iam v0.7.0/go.mod h1:H5Br8wRaDGNc8XP3keLc4unfUUZeyH3Sfl9XpQEYOeg= -cloud.google.com/go/iam v0.8.0/go.mod h1:lga0/y3iH6CX7sYqypWJ33hf7kkfXJag67naqGESjkE= -cloud.google.com/go/iam v0.11.0/go.mod h1:9PiLDanza5D+oWFZiH1uG+RnRCfEGKoyl6yo4cgWZGY= -cloud.google.com/go/iam v0.12.0/go.mod h1:knyHGviacl11zrtZUoDuYpDgLjvr28sLQaG0YB2GYAY= -cloud.google.com/go/iam v0.13.0/go.mod h1:ljOg+rcNfzZ5d6f1nAUJ8ZIxOaZUVoS14bKCtaLZ/D0= -cloud.google.com/go/iap v1.4.0/go.mod h1:RGFwRJdihTINIe4wZ2iCP0zF/qu18ZwyKxrhMhygBEc= -cloud.google.com/go/iap v1.5.0/go.mod h1:UH/CGgKd4KyohZL5Pt0jSKE4m3FR51qg6FKQ/z/Ix9A= -cloud.google.com/go/iap v1.6.0/go.mod h1:NSuvI9C/j7UdjGjIde7t7HBz+QTwBcapPE07+sSRcLk= -cloud.google.com/go/iap v1.7.0/go.mod h1:beqQx56T9O1G1yNPph+spKpNibDlYIiIixiqsQXxLIo= -cloud.google.com/go/iap v1.7.1/go.mod h1:WapEwPc7ZxGt2jFGB/C/bm+hP0Y6NXzOYGjpPnmMS74= -cloud.google.com/go/ids v1.1.0/go.mod h1:WIuwCaYVOzHIj2OhN9HAwvW+DBdmUAdcWlFxRl+KubM= -cloud.google.com/go/ids v1.2.0/go.mod h1:5WXvp4n25S0rA/mQWAg1YEEBBq6/s+7ml1RDCW1IrcY= -cloud.google.com/go/ids v1.3.0/go.mod h1:JBdTYwANikFKaDP6LtW5JAi4gubs57SVNQjemdt6xV4= -cloud.google.com/go/iot v1.3.0/go.mod h1:r7RGh2B61+B8oz0AGE+J72AhA0G7tdXItODWsaA2oLs= -cloud.google.com/go/iot v1.4.0/go.mod h1:dIDxPOn0UvNDUMD8Ger7FIaTuvMkj+aGk94RPP0iV+g= -cloud.google.com/go/iot v1.5.0/go.mod h1:mpz5259PDl3XJthEmh9+ap0affn/MqNSP4My77Qql9o= -cloud.google.com/go/iot v1.6.0/go.mod h1:IqdAsmE2cTYYNO1Fvjfzo9po179rAtJeVGUvkLN3rLE= -cloud.google.com/go/kms v1.4.0/go.mod h1:fajBHndQ+6ubNw6Ss2sSd+SWvjL26RNo/dr7uxsnnOA= -cloud.google.com/go/kms v1.5.0/go.mod h1:QJS2YY0eJGBg3mnDfuaCyLauWwBJiHRboYxJ++1xJNg= -cloud.google.com/go/kms v1.6.0/go.mod h1:Jjy850yySiasBUDi6KFUwUv2n1+o7QZFyuUJg6OgjA0= -cloud.google.com/go/kms v1.8.0/go.mod h1:4xFEhYFqvW+4VMELtZyxomGSYtSQKzM178ylFW4jMAg= -cloud.google.com/go/kms v1.9.0/go.mod h1:qb1tPTgfF9RQP8e1wq4cLFErVuTJv7UsSC915J8dh3w= -cloud.google.com/go/kms v1.10.0/go.mod h1:ng3KTUtQQU9bPX3+QGLsflZIHlkbn8amFAMY63m8d24= -cloud.google.com/go/kms v1.10.1/go.mod h1:rIWk/TryCkR59GMC3YtHtXeLzd634lBbKenvyySAyYI= -cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= -cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= -cloud.google.com/go/language v1.7.0/go.mod h1:DJ6dYN/W+SQOjF8e1hLQXMF21AkH2w9wiPzPCJa2MIE= -cloud.google.com/go/language v1.8.0/go.mod h1:qYPVHf7SPoNNiCL2Dr0FfEFNil1qi3pQEyygwpgVKB8= -cloud.google.com/go/language v1.9.0/go.mod h1:Ns15WooPM5Ad/5no/0n81yUetis74g3zrbeJBE+ptUY= -cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= -cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08= -cloud.google.com/go/lifesciences v0.8.0/go.mod h1:lFxiEOMqII6XggGbOnKiyZ7IBwoIqA84ClvoezaA/bo= -cloud.google.com/go/logging v1.6.1/go.mod h1:5ZO0mHHbvm8gEmeEUHrmDlTDSu5imF6MUP9OfilNXBw= -cloud.google.com/go/logging v1.7.0/go.mod h1:3xjP2CjkM3ZkO73aj4ASA5wRPGGCRrPIAeNqVNkzY8M= -cloud.google.com/go/longrunning v0.1.1/go.mod h1:UUFxuDWkv22EuY93jjmDMFT5GPQKeFVJBIF6QlTqdsE= -cloud.google.com/go/longrunning v0.3.0/go.mod h1:qth9Y41RRSUE69rDcOn6DdK3HfQfsUI0YSmW3iIlLJc= -cloud.google.com/go/longrunning v0.4.1/go.mod h1:4iWDqhBZ70CvZ6BfETbvam3T8FMvLK+eFj0E6AaRQTo= -cloud.google.com/go/managedidentities v1.3.0/go.mod h1:UzlW3cBOiPrzucO5qWkNkh0w33KFtBJU281hacNvsdE= -cloud.google.com/go/managedidentities v1.4.0/go.mod h1:NWSBYbEMgqmbZsLIyKvxrYbtqOsxY1ZrGM+9RgDqInM= -cloud.google.com/go/managedidentities v1.5.0/go.mod h1:+dWcZ0JlUmpuxpIDfyP5pP5y0bLdRwOS4Lp7gMni/LA= -cloud.google.com/go/maps v0.1.0/go.mod h1:BQM97WGyfw9FWEmQMpZ5T6cpovXXSd1cGmFma94eubI= -cloud.google.com/go/maps v0.6.0/go.mod h1:o6DAMMfb+aINHz/p/jbcY+mYeXBoZoxTfdSQ8VAJaCw= -cloud.google.com/go/maps v0.7.0/go.mod h1:3GnvVl3cqeSvgMcpRlQidXsPYuDGQ8naBis7MVzpXsY= -cloud.google.com/go/mediatranslation v0.5.0/go.mod h1:jGPUhGTybqsPQn91pNXw0xVHfuJ3leR1wj37oU3y1f4= -cloud.google.com/go/mediatranslation v0.6.0/go.mod h1:hHdBCTYNigsBxshbznuIMFNe5QXEowAuNmmC7h8pu5w= -cloud.google.com/go/mediatranslation v0.7.0/go.mod h1:LCnB/gZr90ONOIQLgSXagp8XUW1ODs2UmUMvcgMfI2I= -cloud.google.com/go/memcache v1.4.0/go.mod h1:rTOfiGZtJX1AaFUrOgsMHX5kAzaTQ8azHiuDoTPzNsE= -cloud.google.com/go/memcache v1.5.0/go.mod h1:dk3fCK7dVo0cUU2c36jKb4VqKPS22BTkf81Xq617aWM= -cloud.google.com/go/memcache v1.6.0/go.mod h1:XS5xB0eQZdHtTuTF9Hf8eJkKtR3pVRCcvJwtm68T3rA= -cloud.google.com/go/memcache v1.7.0/go.mod h1:ywMKfjWhNtkQTxrWxCkCFkoPjLHPW6A7WOTVI8xy3LY= -cloud.google.com/go/memcache v1.9.0/go.mod h1:8oEyzXCu+zo9RzlEaEjHl4KkgjlNDaXbCQeQWlzNFJM= -cloud.google.com/go/metastore v1.5.0/go.mod h1:2ZNrDcQwghfdtCwJ33nM0+GrBGlVuh8rakL3vdPY3XY= -cloud.google.com/go/metastore v1.6.0/go.mod h1:6cyQTls8CWXzk45G55x57DVQ9gWg7RiH65+YgPsNh9s= -cloud.google.com/go/metastore v1.7.0/go.mod h1:s45D0B4IlsINu87/AsWiEVYbLaIMeUSoxlKKDqBGFS8= -cloud.google.com/go/metastore v1.8.0/go.mod h1:zHiMc4ZUpBiM7twCIFQmJ9JMEkDSyZS9U12uf7wHqSI= -cloud.google.com/go/metastore v1.10.0/go.mod h1:fPEnH3g4JJAk+gMRnrAnoqyv2lpUCqJPWOodSaf45Eo= -cloud.google.com/go/monitoring v1.7.0/go.mod h1:HpYse6kkGo//7p6sT0wsIC6IBDET0RhIsnmlA53dvEk= -cloud.google.com/go/monitoring v1.8.0/go.mod h1:E7PtoMJ1kQXWxPjB6mv2fhC5/15jInuulFdYYtlcvT4= -cloud.google.com/go/monitoring v1.12.0/go.mod h1:yx8Jj2fZNEkL/GYZyTLS4ZtZEZN8WtDEiEqG4kLK50w= -cloud.google.com/go/monitoring v1.13.0/go.mod h1:k2yMBAB1H9JT/QETjNkgdCGD9bPF712XiLTVr+cBrpw= -cloud.google.com/go/networkconnectivity v1.4.0/go.mod h1:nOl7YL8odKyAOtzNX73/M5/mGZgqqMeryi6UPZTk/rA= -cloud.google.com/go/networkconnectivity v1.5.0/go.mod h1:3GzqJx7uhtlM3kln0+x5wyFvuVH1pIBJjhCpjzSt75o= -cloud.google.com/go/networkconnectivity v1.6.0/go.mod h1:OJOoEXW+0LAxHh89nXd64uGG+FbQoeH8DtxCHVOMlaM= -cloud.google.com/go/networkconnectivity v1.7.0/go.mod h1:RMuSbkdbPwNMQjB5HBWD5MpTBnNm39iAVpC3TmsExt8= -cloud.google.com/go/networkconnectivity v1.10.0/go.mod h1:UP4O4sWXJG13AqrTdQCD9TnLGEbtNRqjuaaA7bNjF5E= -cloud.google.com/go/networkconnectivity v1.11.0/go.mod h1:iWmDD4QF16VCDLXUqvyspJjIEtBR/4zq5hwnY2X3scM= -cloud.google.com/go/networkmanagement v1.4.0/go.mod h1:Q9mdLLRn60AsOrPc8rs8iNV6OHXaGcDdsIQe1ohekq8= -cloud.google.com/go/networkmanagement v1.5.0/go.mod h1:ZnOeZ/evzUdUsnvRt792H0uYEnHQEMaz+REhhzJRcf4= -cloud.google.com/go/networkmanagement v1.6.0/go.mod h1:5pKPqyXjB/sgtvB5xqOemumoQNB7y95Q7S+4rjSOPYY= -cloud.google.com/go/networksecurity v0.5.0/go.mod h1:xS6fOCoqpVC5zx15Z/MqkfDwH4+m/61A3ODiDV1xmiQ= -cloud.google.com/go/networksecurity v0.6.0/go.mod h1:Q5fjhTr9WMI5mbpRYEbiexTzROf7ZbDzvzCrNl14nyU= -cloud.google.com/go/networksecurity v0.7.0/go.mod h1:mAnzoxx/8TBSyXEeESMy9OOYwo1v+gZ5eMRnsT5bC8k= -cloud.google.com/go/networksecurity v0.8.0/go.mod h1:B78DkqsxFG5zRSVuwYFRZ9Xz8IcQ5iECsNrPn74hKHU= -cloud.google.com/go/notebooks v1.2.0/go.mod h1:9+wtppMfVPUeJ8fIWPOq1UnATHISkGXGqTkxeieQ6UY= -cloud.google.com/go/notebooks v1.3.0/go.mod h1:bFR5lj07DtCPC7YAAJ//vHskFBxA5JzYlH68kXVdk34= -cloud.google.com/go/notebooks v1.4.0/go.mod h1:4QPMngcwmgb6uw7Po99B2xv5ufVoIQ7nOGDyL4P8AgA= -cloud.google.com/go/notebooks v1.5.0/go.mod h1:q8mwhnP9aR8Hpfnrc5iN5IBhrXUy8S2vuYs+kBJ/gu0= -cloud.google.com/go/notebooks v1.7.0/go.mod h1:PVlaDGfJgj1fl1S3dUwhFMXFgfYGhYQt2164xOMONmE= -cloud.google.com/go/notebooks v1.8.0/go.mod h1:Lq6dYKOYOWUCTvw5t2q1gp1lAp0zxAxRycayS0iJcqQ= -cloud.google.com/go/optimization v1.1.0/go.mod h1:5po+wfvX5AQlPznyVEZjGJTMr4+CAkJf2XSTQOOl9l4= -cloud.google.com/go/optimization v1.2.0/go.mod h1:Lr7SOHdRDENsh+WXVmQhQTrzdu9ybg0NecjHidBq6xs= -cloud.google.com/go/optimization v1.3.1/go.mod h1:IvUSefKiwd1a5p0RgHDbWCIbDFgKuEdB+fPPuP0IDLI= -cloud.google.com/go/orchestration v1.3.0/go.mod h1:Sj5tq/JpWiB//X/q3Ngwdl5K7B7Y0KZ7bfv0wL6fqVA= -cloud.google.com/go/orchestration v1.4.0/go.mod h1:6W5NLFWs2TlniBphAViZEVhrXRSMgUGDfW7vrWKvsBk= -cloud.google.com/go/orchestration v1.6.0/go.mod h1:M62Bevp7pkxStDfFfTuCOaXgaaqRAga1yKyoMtEoWPQ= -cloud.google.com/go/orgpolicy v1.4.0/go.mod h1:xrSLIV4RePWmP9P3tBl8S93lTmlAxjm06NSm2UTmKvE= -cloud.google.com/go/orgpolicy v1.5.0/go.mod h1:hZEc5q3wzwXJaKrsx5+Ewg0u1LxJ51nNFlext7Tanwc= -cloud.google.com/go/orgpolicy v1.10.0/go.mod h1:w1fo8b7rRqlXlIJbVhOMPrwVljyuW5mqssvBtU18ONc= -cloud.google.com/go/osconfig v1.7.0/go.mod h1:oVHeCeZELfJP7XLxcBGTMBvRO+1nQ5tFG9VQTmYS2Fs= -cloud.google.com/go/osconfig v1.8.0/go.mod h1:EQqZLu5w5XA7eKizepumcvWx+m8mJUhEwiPqWiZeEdg= -cloud.google.com/go/osconfig v1.9.0/go.mod h1:Yx+IeIZJ3bdWmzbQU4fxNl8xsZ4amB+dygAwFPlvnNo= -cloud.google.com/go/osconfig v1.10.0/go.mod h1:uMhCzqC5I8zfD9zDEAfvgVhDS8oIjySWh+l4WK6GnWw= -cloud.google.com/go/osconfig v1.11.0/go.mod h1:aDICxrur2ogRd9zY5ytBLV89KEgT2MKB2L/n6x1ooPw= -cloud.google.com/go/oslogin v1.4.0/go.mod h1:YdgMXWRaElXz/lDk1Na6Fh5orF7gvmJ0FGLIs9LId4E= -cloud.google.com/go/oslogin v1.5.0/go.mod h1:D260Qj11W2qx/HVF29zBg+0fd6YCSjSqLUkY/qEenQU= -cloud.google.com/go/oslogin v1.6.0/go.mod h1:zOJ1O3+dTU8WPlGEkFSh7qeHPPSoxrcMbbK1Nm2iX70= -cloud.google.com/go/oslogin v1.7.0/go.mod h1:e04SN0xO1UNJ1M5GP0vzVBFicIe4O53FOfcixIqTyXo= -cloud.google.com/go/oslogin v1.9.0/go.mod h1:HNavntnH8nzrn8JCTT5fj18FuJLFJc4NaZJtBnQtKFs= -cloud.google.com/go/phishingprotection v0.5.0/go.mod h1:Y3HZknsK9bc9dMi+oE8Bim0lczMU6hrX0UpADuMefr0= -cloud.google.com/go/phishingprotection v0.6.0/go.mod h1:9Y3LBLgy0kDTcYET8ZH3bq/7qni15yVUoAxiFxnlSUA= -cloud.google.com/go/phishingprotection v0.7.0/go.mod h1:8qJI4QKHoda/sb/7/YmMQ2omRLSLYSu9bU0EKCNI+Lk= -cloud.google.com/go/policytroubleshooter v1.3.0/go.mod h1:qy0+VwANja+kKrjlQuOzmlvscn4RNsAc0e15GGqfMxg= -cloud.google.com/go/policytroubleshooter v1.4.0/go.mod h1:DZT4BcRw3QoO8ota9xw/LKtPa8lKeCByYeKTIf/vxdE= -cloud.google.com/go/policytroubleshooter v1.5.0/go.mod h1:Rz1WfV+1oIpPdN2VvvuboLVRsB1Hclg3CKQ53j9l8vw= -cloud.google.com/go/policytroubleshooter v1.6.0/go.mod h1:zYqaPTsmfvpjm5ULxAyD/lINQxJ0DDsnWOP/GZ7xzBc= -cloud.google.com/go/privatecatalog v0.5.0/go.mod h1:XgosMUvvPyxDjAVNDYxJ7wBW8//hLDDYmnsNcMGq1K0= -cloud.google.com/go/privatecatalog v0.6.0/go.mod h1:i/fbkZR0hLN29eEWiiwue8Pb+GforiEIBnV9yrRUOKI= -cloud.google.com/go/privatecatalog v0.7.0/go.mod h1:2s5ssIFO69F5csTXcwBP7NPFTZvps26xGzvQ2PQaBYg= -cloud.google.com/go/privatecatalog v0.8.0/go.mod h1:nQ6pfaegeDAq/Q5lrfCQzQLhubPiZhSaNhIgfJlnIXs= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/pubsub v1.26.0/go.mod h1:QgBH3U/jdJy/ftjPhTkyXNj543Tin1pRYcdcPRnFIRI= -cloud.google.com/go/pubsub v1.27.1/go.mod h1:hQN39ymbV9geqBnfQq6Xf63yNhUAhv9CZhzp5O6qsW0= -cloud.google.com/go/pubsub v1.28.0/go.mod h1:vuXFpwaVoIPQMGXqRyUQigu/AX1S3IWugR9xznmcXX8= -cloud.google.com/go/pubsub v1.30.0/go.mod h1:qWi1OPS0B+b5L+Sg6Gmc9zD1Y+HaM0MdUr7LsupY1P4= -cloud.google.com/go/pubsublite v1.5.0/go.mod h1:xapqNQ1CuLfGi23Yda/9l4bBCKz/wC3KIJ5gKcxveZg= -cloud.google.com/go/pubsublite v1.6.0/go.mod h1:1eFCS0U11xlOuMFV/0iBqw3zP12kddMeCbj/F3FSj9k= -cloud.google.com/go/pubsublite v1.7.0/go.mod h1:8hVMwRXfDfvGm3fahVbtDbiLePT3gpoiJYJY+vxWxVM= -cloud.google.com/go/recaptchaenterprise v1.3.1/go.mod h1:OdD+q+y4XGeAlxRaMn1Y7/GveP6zmq76byL6tjPE7d4= -cloud.google.com/go/recaptchaenterprise/v2 v2.1.0/go.mod h1:w9yVqajwroDNTfGuhmOjPDN//rZGySaf6PtFVcSCa7o= -cloud.google.com/go/recaptchaenterprise/v2 v2.2.0/go.mod h1:/Zu5jisWGeERrd5HnlS3EUGb/D335f9k51B/FVil0jk= -cloud.google.com/go/recaptchaenterprise/v2 v2.3.0/go.mod h1:O9LwGCjrhGHBQET5CA7dd5NwwNQUErSgEDit1DLNTdo= -cloud.google.com/go/recaptchaenterprise/v2 v2.4.0/go.mod h1:Am3LHfOuBstrLrNCBrlI5sbwx9LBg3te2N6hGvHn2mE= -cloud.google.com/go/recaptchaenterprise/v2 v2.5.0/go.mod h1:O8LzcHXN3rz0j+LBC91jrwI3R+1ZSZEWrfL7XHgNo9U= -cloud.google.com/go/recaptchaenterprise/v2 v2.6.0/go.mod h1:RPauz9jeLtB3JVzg6nCbe12qNoaa8pXc4d/YukAmcnA= -cloud.google.com/go/recaptchaenterprise/v2 v2.7.0/go.mod h1:19wVj/fs5RtYtynAPJdDTb69oW0vNHYDBTbB4NvMD9c= -cloud.google.com/go/recommendationengine v0.5.0/go.mod h1:E5756pJcVFeVgaQv3WNpImkFP8a+RptV6dDLGPILjvg= -cloud.google.com/go/recommendationengine v0.6.0/go.mod h1:08mq2umu9oIqc7tDy8sx+MNJdLG0fUi3vaSVbztHgJ4= -cloud.google.com/go/recommendationengine v0.7.0/go.mod h1:1reUcE3GIu6MeBz/h5xZJqNLuuVjNg1lmWMPyjatzac= -cloud.google.com/go/recommender v1.5.0/go.mod h1:jdoeiBIVrJe9gQjwd759ecLJbxCDED4A6p+mqoqDvTg= -cloud.google.com/go/recommender v1.6.0/go.mod h1:+yETpm25mcoiECKh9DEScGzIRyDKpZ0cEhWGo+8bo+c= -cloud.google.com/go/recommender v1.7.0/go.mod h1:XLHs/W+T8olwlGOgfQenXBTbIseGclClff6lhFVe9Bs= -cloud.google.com/go/recommender v1.8.0/go.mod h1:PkjXrTT05BFKwxaUxQmtIlrtj0kph108r02ZZQ5FE70= -cloud.google.com/go/recommender v1.9.0/go.mod h1:PnSsnZY7q+VL1uax2JWkt/UegHssxjUVVCrX52CuEmQ= -cloud.google.com/go/redis v1.7.0/go.mod h1:V3x5Jq1jzUcg+UNsRvdmsfuFnit1cfe3Z/PGyq/lm4Y= -cloud.google.com/go/redis v1.8.0/go.mod h1:Fm2szCDavWzBk2cDKxrkmWBqoCiL1+Ctwq7EyqBCA/A= -cloud.google.com/go/redis v1.9.0/go.mod h1:HMYQuajvb2D0LvMgZmLDZW8V5aOC/WxstZHiy4g8OiA= -cloud.google.com/go/redis v1.10.0/go.mod h1:ThJf3mMBQtW18JzGgh41/Wld6vnDDc/F/F35UolRZPM= -cloud.google.com/go/redis v1.11.0/go.mod h1:/X6eicana+BWcUda5PpwZC48o37SiFVTFSs0fWAJ7uQ= -cloud.google.com/go/resourcemanager v1.3.0/go.mod h1:bAtrTjZQFJkiWTPDb1WBjzvc6/kifjj4QBYuKCCoqKA= -cloud.google.com/go/resourcemanager v1.4.0/go.mod h1:MwxuzkumyTX7/a3n37gmsT3py7LIXwrShilPh3P1tR0= -cloud.google.com/go/resourcemanager v1.5.0/go.mod h1:eQoXNAiAvCf5PXxWxXjhKQoTMaUSNrEfg+6qdf/wots= -cloud.google.com/go/resourcemanager v1.6.0/go.mod h1:YcpXGRs8fDzcUl1Xw8uOVmI8JEadvhRIkoXXUNVYcVo= -cloud.google.com/go/resourcemanager v1.7.0/go.mod h1:HlD3m6+bwhzj9XCouqmeiGuni95NTrExfhoSrkC/3EI= -cloud.google.com/go/resourcesettings v1.3.0/go.mod h1:lzew8VfESA5DQ8gdlHwMrqZs1S9V87v3oCnKCWoOuQU= -cloud.google.com/go/resourcesettings v1.4.0/go.mod h1:ldiH9IJpcrlC3VSuCGvjR5of/ezRrOxFtpJoJo5SmXg= -cloud.google.com/go/resourcesettings v1.5.0/go.mod h1:+xJF7QSG6undsQDfsCJyqWXyBwUoJLhetkRMDRnIoXA= -cloud.google.com/go/retail v1.8.0/go.mod h1:QblKS8waDmNUhghY2TI9O3JLlFk8jybHeV4BF19FrE4= -cloud.google.com/go/retail v1.9.0/go.mod h1:g6jb6mKuCS1QKnH/dpu7isX253absFl6iE92nHwlBUY= -cloud.google.com/go/retail v1.10.0/go.mod h1:2gDk9HsL4HMS4oZwz6daui2/jmKvqShXKQuB2RZ+cCc= -cloud.google.com/go/retail v1.11.0/go.mod h1:MBLk1NaWPmh6iVFSz9MeKG/Psyd7TAgm6y/9L2B4x9Y= -cloud.google.com/go/retail v1.12.0/go.mod h1:UMkelN/0Z8XvKymXFbD4EhFJlYKRx1FGhQkVPU5kF14= -cloud.google.com/go/run v0.2.0/go.mod h1:CNtKsTA1sDcnqqIFR3Pb5Tq0usWxJJvsWOCPldRU3Do= -cloud.google.com/go/run v0.3.0/go.mod h1:TuyY1+taHxTjrD0ZFk2iAR+xyOXEA0ztb7U3UNA0zBo= -cloud.google.com/go/run v0.8.0/go.mod h1:VniEnuBwqjigv0A7ONfQUaEItaiCRVujlMqerPPiktM= -cloud.google.com/go/run v0.9.0/go.mod h1:Wwu+/vvg8Y+JUApMwEDfVfhetv30hCG4ZwDR/IXl2Qg= -cloud.google.com/go/scheduler v1.4.0/go.mod h1:drcJBmxF3aqZJRhmkHQ9b3uSSpQoltBPGPxGAWROx6s= -cloud.google.com/go/scheduler v1.5.0/go.mod h1:ri073ym49NW3AfT6DZi21vLZrG07GXr5p3H1KxN5QlI= -cloud.google.com/go/scheduler v1.6.0/go.mod h1:SgeKVM7MIwPn3BqtcBntpLyrIJftQISRrYB5ZtT+KOk= -cloud.google.com/go/scheduler v1.7.0/go.mod h1:jyCiBqWW956uBjjPMMuX09n3x37mtyPJegEWKxRsn44= -cloud.google.com/go/scheduler v1.8.0/go.mod h1:TCET+Y5Gp1YgHT8py4nlg2Sew8nUHMqcpousDgXJVQc= -cloud.google.com/go/scheduler v1.9.0/go.mod h1:yexg5t+KSmqu+njTIh3b7oYPheFtBWGcbVUYF1GGMIc= -cloud.google.com/go/secretmanager v1.6.0/go.mod h1:awVa/OXF6IiyaU1wQ34inzQNc4ISIDIrId8qE5QGgKA= -cloud.google.com/go/secretmanager v1.8.0/go.mod h1:hnVgi/bN5MYHd3Gt0SPuTPPp5ENina1/LxM+2W9U9J4= -cloud.google.com/go/secretmanager v1.9.0/go.mod h1:b71qH2l1yHmWQHt9LC80akm86mX8AL6X1MA01dW8ht4= -cloud.google.com/go/secretmanager v1.10.0/go.mod h1:MfnrdvKMPNra9aZtQFvBcvRU54hbPD8/HayQdlUgJpU= -cloud.google.com/go/security v1.5.0/go.mod h1:lgxGdyOKKjHL4YG3/YwIL2zLqMFCKs0UbQwgyZmfJl4= -cloud.google.com/go/security v1.7.0/go.mod h1:mZklORHl6Bg7CNnnjLH//0UlAlaXqiG7Lb9PsPXLfD0= -cloud.google.com/go/security v1.8.0/go.mod h1:hAQOwgmaHhztFhiQ41CjDODdWP0+AE1B3sX4OFlq+GU= -cloud.google.com/go/security v1.9.0/go.mod h1:6Ta1bO8LXI89nZnmnsZGp9lVoVWXqsVbIq/t9dzI+2Q= -cloud.google.com/go/security v1.10.0/go.mod h1:QtOMZByJVlibUT2h9afNDWRZ1G96gVywH8T5GUSb9IA= -cloud.google.com/go/security v1.12.0/go.mod h1:rV6EhrpbNHrrxqlvW0BWAIawFWq3X90SduMJdFwtLB8= -cloud.google.com/go/security v1.13.0/go.mod h1:Q1Nvxl1PAgmeW0y3HTt54JYIvUdtcpYKVfIB8AOMZ+0= -cloud.google.com/go/securitycenter v1.13.0/go.mod h1:cv5qNAqjY84FCN6Y9z28WlkKXyWsgLO832YiWwkCWcU= -cloud.google.com/go/securitycenter v1.14.0/go.mod h1:gZLAhtyKv85n52XYWt6RmeBdydyxfPeTrpToDPw4Auc= -cloud.google.com/go/securitycenter v1.15.0/go.mod h1:PeKJ0t8MoFmmXLXWm41JidyzI3PJjd8sXWaVqg43WWk= -cloud.google.com/go/securitycenter v1.16.0/go.mod h1:Q9GMaLQFUD+5ZTabrbujNWLtSLZIZF7SAR0wWECrjdk= -cloud.google.com/go/securitycenter v1.18.1/go.mod h1:0/25gAzCM/9OL9vVx4ChPeM/+DlfGQJDwBy/UC8AKK0= -cloud.google.com/go/securitycenter v1.19.0/go.mod h1:LVLmSg8ZkkyaNy4u7HCIshAngSQ8EcIRREP3xBnyfag= -cloud.google.com/go/servicecontrol v1.4.0/go.mod h1:o0hUSJ1TXJAmi/7fLJAedOovnujSEvjKCAFNXPQ1RaU= -cloud.google.com/go/servicecontrol v1.5.0/go.mod h1:qM0CnXHhyqKVuiZnGKrIurvVImCs8gmqWsDoqe9sU1s= -cloud.google.com/go/servicecontrol v1.10.0/go.mod h1:pQvyvSRh7YzUF2efw7H87V92mxU8FnFDawMClGCNuAA= -cloud.google.com/go/servicecontrol v1.11.0/go.mod h1:kFmTzYzTUIuZs0ycVqRHNaNhgR+UMUpw9n02l/pY+mc= -cloud.google.com/go/servicecontrol v1.11.1/go.mod h1:aSnNNlwEFBY+PWGQ2DoM0JJ/QUXqV5/ZD9DOLB7SnUk= -cloud.google.com/go/servicedirectory v1.4.0/go.mod h1:gH1MUaZCgtP7qQiI+F+A+OpeKF/HQWgtAddhTbhL2bs= -cloud.google.com/go/servicedirectory v1.5.0/go.mod h1:QMKFL0NUySbpZJ1UZs3oFAmdvVxhhxB6eJ/Vlp73dfg= -cloud.google.com/go/servicedirectory v1.6.0/go.mod h1:pUlbnWsLH9c13yGkxCmfumWEPjsRs1RlmJ4pqiNjVL4= -cloud.google.com/go/servicedirectory v1.7.0/go.mod h1:5p/U5oyvgYGYejufvxhgwjL8UVXjkuw7q5XcG10wx1U= -cloud.google.com/go/servicedirectory v1.8.0/go.mod h1:srXodfhY1GFIPvltunswqXpVxFPpZjf8nkKQT7XcXaY= -cloud.google.com/go/servicedirectory v1.9.0/go.mod h1:29je5JjiygNYlmsGz8k6o+OZ8vd4f//bQLtvzkPPT/s= -cloud.google.com/go/servicemanagement v1.4.0/go.mod h1:d8t8MDbezI7Z2R1O/wu8oTggo3BI2GKYbdG4y/SJTco= -cloud.google.com/go/servicemanagement v1.5.0/go.mod h1:XGaCRe57kfqu4+lRxaFEAuqmjzF0r+gWHjWqKqBvKFo= -cloud.google.com/go/servicemanagement v1.6.0/go.mod h1:aWns7EeeCOtGEX4OvZUWCCJONRZeFKiptqKf1D0l/Jc= -cloud.google.com/go/servicemanagement v1.8.0/go.mod h1:MSS2TDlIEQD/fzsSGfCdJItQveu9NXnUniTrq/L8LK4= -cloud.google.com/go/serviceusage v1.3.0/go.mod h1:Hya1cozXM4SeSKTAgGXgj97GlqUvF5JaoXacR1JTP/E= -cloud.google.com/go/serviceusage v1.4.0/go.mod h1:SB4yxXSaYVuUBYUml6qklyONXNLt83U0Rb+CXyhjEeU= -cloud.google.com/go/serviceusage v1.5.0/go.mod h1:w8U1JvqUqwJNPEOTQjrMHkw3IaIFLoLsPLvsE3xueec= -cloud.google.com/go/serviceusage v1.6.0/go.mod h1:R5wwQcbOWsyuOfbP9tGdAnCAc6B9DRwPG1xtWMDeuPA= -cloud.google.com/go/shell v1.3.0/go.mod h1:VZ9HmRjZBsjLGXusm7K5Q5lzzByZmJHf1d0IWHEN5X4= -cloud.google.com/go/shell v1.4.0/go.mod h1:HDxPzZf3GkDdhExzD/gs8Grqk+dmYcEjGShZgYa9URw= -cloud.google.com/go/shell v1.6.0/go.mod h1:oHO8QACS90luWgxP3N9iZVuEiSF84zNyLytb+qE2f9A= -cloud.google.com/go/spanner v1.41.0/go.mod h1:MLYDBJR/dY4Wt7ZaMIQ7rXOTLjYrmxLE/5ve9vFfWos= -cloud.google.com/go/spanner v1.44.0/go.mod h1:G8XIgYdOK+Fbcpbs7p2fiprDw4CaZX63whnSMLVBxjk= -cloud.google.com/go/spanner v1.45.0/go.mod h1:FIws5LowYz8YAE1J8fOS7DJup8ff7xJeetWEo5REA2M= -cloud.google.com/go/speech v1.6.0/go.mod h1:79tcr4FHCimOp56lwC01xnt/WPJZc4v3gzyT7FoBkCM= -cloud.google.com/go/speech v1.7.0/go.mod h1:KptqL+BAQIhMsj1kOP2la5DSEEerPDuOP/2mmkhHhZQ= -cloud.google.com/go/speech v1.8.0/go.mod h1:9bYIl1/tjsAnMgKGHKmBZzXKEkGgtU+MpdDPTE9f7y0= -cloud.google.com/go/speech v1.9.0/go.mod h1:xQ0jTcmnRFFM2RfX/U+rk6FQNUF6DQlydUSyoooSpco= -cloud.google.com/go/speech v1.14.1/go.mod h1:gEosVRPJ9waG7zqqnsHpYTOoAS4KouMRLDFMekpJ0J0= -cloud.google.com/go/speech v1.15.0/go.mod h1:y6oH7GhqCaZANH7+Oe0BhgIogsNInLlz542tg3VqeYI= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= -cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= -cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= -cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= -cloud.google.com/go/storage v1.28.1/go.mod h1:Qnisd4CqDdo6BGs2AD5LLnEsmSQ80wQ5ogcBBKhU86Y= -cloud.google.com/go/storage v1.29.0/go.mod h1:4puEjyTKnku6gfKoTfNOU/W+a9JyuVNxjpS5GBrB8h4= -cloud.google.com/go/storagetransfer v1.5.0/go.mod h1:dxNzUopWy7RQevYFHewchb29POFv3/AaBgnhqzqiK0w= -cloud.google.com/go/storagetransfer v1.6.0/go.mod h1:y77xm4CQV/ZhFZH75PLEXY0ROiS7Gh6pSKrM8dJyg6I= -cloud.google.com/go/storagetransfer v1.7.0/go.mod h1:8Giuj1QNb1kfLAiWM1bN6dHzfdlDAVC9rv9abHot2W4= -cloud.google.com/go/storagetransfer v1.8.0/go.mod h1:JpegsHHU1eXg7lMHkvf+KE5XDJ7EQu0GwNJbbVGanEw= -cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= -cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= -cloud.google.com/go/talent v1.3.0/go.mod h1:CmcxwJ/PKfRgd1pBjQgU6W3YBwiewmUzQYH5HHmSCmM= -cloud.google.com/go/talent v1.4.0/go.mod h1:ezFtAgVuRf8jRsvyE6EwmbTK5LKciD4KVnHuDEFmOOA= -cloud.google.com/go/talent v1.5.0/go.mod h1:G+ODMj9bsasAEJkQSzO2uHQWXHHXUomArjWQQYkqK6c= -cloud.google.com/go/texttospeech v1.4.0/go.mod h1:FX8HQHA6sEpJ7rCMSfXuzBcysDAuWusNNNvN9FELDd8= -cloud.google.com/go/texttospeech v1.5.0/go.mod h1:oKPLhR4n4ZdQqWKURdwxMy0uiTS1xU161C8W57Wkea4= -cloud.google.com/go/texttospeech v1.6.0/go.mod h1:YmwmFT8pj1aBblQOI3TfKmwibnsfvhIBzPXcW4EBovc= -cloud.google.com/go/tpu v1.3.0/go.mod h1:aJIManG0o20tfDQlRIej44FcwGGl/cD0oiRyMKG19IQ= -cloud.google.com/go/tpu v1.4.0/go.mod h1:mjZaX8p0VBgllCzF6wcU2ovUXN9TONFLd7iz227X2Xg= -cloud.google.com/go/tpu v1.5.0/go.mod h1:8zVo1rYDFuW2l4yZVY0R0fb/v44xLh3llq7RuV61fPM= -cloud.google.com/go/trace v1.3.0/go.mod h1:FFUE83d9Ca57C+K8rDl/Ih8LwOzWIV1krKgxg6N0G28= -cloud.google.com/go/trace v1.4.0/go.mod h1:UG0v8UBqzusp+z63o7FK74SdFE+AXpCLdFb1rshXG+Y= -cloud.google.com/go/trace v1.8.0/go.mod h1:zH7vcsbAhklH8hWFig58HvxcxyQbaIqMarMg9hn5ECA= -cloud.google.com/go/trace v1.9.0/go.mod h1:lOQqpE5IaWY0Ixg7/r2SjixMuc6lfTFeO4QGM4dQWOk= -cloud.google.com/go/translate v1.3.0/go.mod h1:gzMUwRjvOqj5i69y/LYLd8RrNQk+hOmIXTi9+nb3Djs= -cloud.google.com/go/translate v1.4.0/go.mod h1:06Dn/ppvLD6WvA5Rhdp029IX2Mi3Mn7fpMRLPvXT5Wg= -cloud.google.com/go/translate v1.5.0/go.mod h1:29YDSYveqqpA1CQFD7NQuP49xymq17RXNaUDdc0mNu0= -cloud.google.com/go/translate v1.6.0/go.mod h1:lMGRudH1pu7I3n3PETiOB2507gf3HnfLV8qlkHZEyos= -cloud.google.com/go/translate v1.7.0/go.mod h1:lMGRudH1pu7I3n3PETiOB2507gf3HnfLV8qlkHZEyos= -cloud.google.com/go/video v1.8.0/go.mod h1:sTzKFc0bUSByE8Yoh8X0mn8bMymItVGPfTuUBUyRgxk= -cloud.google.com/go/video v1.9.0/go.mod h1:0RhNKFRF5v92f8dQt0yhaHrEuH95m068JYOvLZYnJSw= -cloud.google.com/go/video v1.12.0/go.mod h1:MLQew95eTuaNDEGriQdcYn0dTwf9oWiA4uYebxM5kdg= -cloud.google.com/go/video v1.13.0/go.mod h1:ulzkYlYgCp15N2AokzKjy7MQ9ejuynOJdf1tR5lGthk= -cloud.google.com/go/video v1.14.0/go.mod h1:SkgaXwT+lIIAKqWAJfktHT/RbgjSuY6DobxEp0C5yTQ= -cloud.google.com/go/video v1.15.0/go.mod h1:SkgaXwT+lIIAKqWAJfktHT/RbgjSuY6DobxEp0C5yTQ= -cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= -cloud.google.com/go/videointelligence v1.7.0/go.mod h1:k8pI/1wAhjznARtVT9U1llUaFNPh7muw8QyOUpavru4= -cloud.google.com/go/videointelligence v1.8.0/go.mod h1:dIcCn4gVDdS7yte/w+koiXn5dWVplOZkE+xwG9FgK+M= -cloud.google.com/go/videointelligence v1.9.0/go.mod h1:29lVRMPDYHikk3v8EdPSaL8Ku+eMzDljjuvRs105XoU= -cloud.google.com/go/videointelligence v1.10.0/go.mod h1:LHZngX1liVtUhZvi2uNS0VQuOzNi2TkY1OakiuoUOjU= -cloud.google.com/go/vision v1.2.0/go.mod h1:SmNwgObm5DpFBme2xpyOyasvBc1aPdjvMk2bBk0tKD0= -cloud.google.com/go/vision/v2 v2.2.0/go.mod h1:uCdV4PpN1S0jyCyq8sIM42v2Y6zOLkZs+4R9LrGYwFo= -cloud.google.com/go/vision/v2 v2.3.0/go.mod h1:UO61abBx9QRMFkNBbf1D8B1LXdS2cGiiCRx0vSpZoUo= -cloud.google.com/go/vision/v2 v2.4.0/go.mod h1:VtI579ll9RpVTrdKdkMzckdnwMyX2JILb+MhPqRbPsY= -cloud.google.com/go/vision/v2 v2.5.0/go.mod h1:MmaezXOOE+IWa+cS7OhRRLK2cNv1ZL98zhqFFZaaH2E= -cloud.google.com/go/vision/v2 v2.6.0/go.mod h1:158Hes0MvOS9Z/bDMSFpjwsUrZ5fPrdwuyyvKSGAGMY= -cloud.google.com/go/vision/v2 v2.7.0/go.mod h1:H89VysHy21avemp6xcf9b9JvZHVehWbET0uT/bcuY/0= -cloud.google.com/go/vmmigration v1.2.0/go.mod h1:IRf0o7myyWFSmVR1ItrBSFLFD/rJkfDCUTO4vLlJvsE= -cloud.google.com/go/vmmigration v1.3.0/go.mod h1:oGJ6ZgGPQOFdjHuocGcLqX4lc98YQ7Ygq8YQwHh9A7g= -cloud.google.com/go/vmmigration v1.5.0/go.mod h1:E4YQ8q7/4W9gobHjQg4JJSgXXSgY21nA5r8swQV+Xxc= -cloud.google.com/go/vmmigration v1.6.0/go.mod h1:bopQ/g4z+8qXzichC7GW1w2MjbErL54rk3/C843CjfY= -cloud.google.com/go/vmwareengine v0.1.0/go.mod h1:RsdNEf/8UDvKllXhMz5J40XxDrNJNN4sagiox+OI208= -cloud.google.com/go/vmwareengine v0.2.2/go.mod h1:sKdctNJxb3KLZkE/6Oui94iw/xs9PRNC2wnNLXsHvH8= -cloud.google.com/go/vmwareengine v0.3.0/go.mod h1:wvoyMvNWdIzxMYSpH/R7y2h5h3WFkx6d+1TIsP39WGY= -cloud.google.com/go/vpcaccess v1.4.0/go.mod h1:aQHVbTWDYUR1EbTApSVvMq1EnT57ppDmQzZ3imqIk4w= -cloud.google.com/go/vpcaccess v1.5.0/go.mod h1:drmg4HLk9NkZpGfCmZ3Tz0Bwnm2+DKqViEpeEpOq0m8= -cloud.google.com/go/vpcaccess v1.6.0/go.mod h1:wX2ILaNhe7TlVa4vC5xce1bCnqE3AeH27RV31lnmZes= -cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xXZmFiHmGE= -cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= -cloud.google.com/go/webrisk v1.6.0/go.mod h1:65sW9V9rOosnc9ZY7A7jsy1zoHS5W9IAXv6dGqhMQMc= -cloud.google.com/go/webrisk v1.7.0/go.mod h1:mVMHgEYH0r337nmt1JyLthzMr6YxwN1aAIEc2fTcq7A= -cloud.google.com/go/webrisk v1.8.0/go.mod h1:oJPDuamzHXgUc+b8SiHRcVInZQuybnvEW72PqTc7sSg= -cloud.google.com/go/websecurityscanner v1.3.0/go.mod h1:uImdKm2wyeXQevQJXeh8Uun/Ym1VqworNDlBXQevGMo= -cloud.google.com/go/websecurityscanner v1.4.0/go.mod h1:ebit/Fp0a+FWu5j4JOmJEV8S8CzdTkAS77oDsiSqYWQ= -cloud.google.com/go/websecurityscanner v1.5.0/go.mod h1:Y6xdCPy81yi0SQnDY1xdNTNpfY1oAgXUlcfN3B3eSng= -cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= -cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= -cloud.google.com/go/workflows v1.8.0/go.mod h1:ysGhmEajwZxGn1OhGOGKsTXc5PyxOc0vfKf5Af+to4M= -cloud.google.com/go/workflows v1.9.0/go.mod h1:ZGkj1aFIOd9c8Gerkjjq7OW7I5+l6cSvT3ujaO/WwSA= -cloud.google.com/go/workflows v1.10.0/go.mod h1:fZ8LmRmZQWacon9UCX1r/g/DfAXx5VcPALq2CxzdePw= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8= -git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= github.com/PuerkitoBio/goquery v1.8.1 h1:uQxhNlArOIdbrH1tr0UXwdVFgDcZDrZVdcpygAcwmWM= github.com/PuerkitoBio/goquery v1.8.1/go.mod h1:Q8ICL1kNUJ2sXGoAhPGUdYDJvgQgHzJsnnd3H7Ho5jQ= -github.com/ajstarks/deck v0.0.0-20200831202436-30c9fc6549a9/go.mod h1:JynElWSGnm/4RlzPXRlREEwqTHAN3T56Bv2ITsFT3gY= -github.com/ajstarks/deck/generate v0.0.0-20210309230005-c3f852c02e19/go.mod h1:T13YZdzov6OU0A1+RfKZiZN9ca6VeKdBdyDV+BY97Tk= -github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= -github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM= -github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c= github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/apache/arrow/go/v10 v10.0.1/go.mod h1:YvhnlEePVnBS4+0z3fhPfUy7W1Ikj0Ih0vcRo/gZ1M0= -github.com/apache/arrow/go/v11 v11.0.0/go.mod h1:Eg5OsL5H+e299f7u5ssuXsuHQVEGC4xei5aX110hRiI= -github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU= -github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= -github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20230310173818-32f1caf87195/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= -github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= -github.com/envoyproxy/go-control-plane v0.10.3/go.mod h1:fJJn/j26vwOu972OllsvAgJJM//w9BV6Fxbg2LuVd34= -github.com/envoyproxy/go-control-plane v0.11.0/go.mod h1:VnHyVMpzcLvCFt9yUz1UnCwHLhwx1WguiVDV7pTG/tI= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo= -github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0++PMirau2/yoOwVac3AbF2w= -github.com/envoyproxy/protoc-gen-validate v0.10.0/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss= -github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= -github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g= -github.com/go-fonts/latin-modern v0.2.0/go.mod h1:rQVLdDMK+mK1xscDwsqM5J8U2jrRa3T0ecnM9pNujks= -github.com/go-fonts/liberation v0.1.1/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= -github.com/go-fonts/liberation v0.2.0/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= -github.com/go-fonts/stix v0.1.0/go.mod h1:w/c1f0ldAUlJmLBvlbkvVXLAD+tAMqobIIQpmnUIzUY= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2CSIqUrmQPqA0gdRIlnLEY0gK5JGjh37zN5U= -github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81/go.mod h1:SX0U8uGpxhq9o2S/CELCSUxEWWAuoCUcVCQWv7G2OCk= -github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= -github.com/go-pdf/fpdf v0.6.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= -github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= -github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v54 v54.0.0 h1:OZdXwow4EAD5jEo5qg+dGFH2DpkyZvVsAehjvJuUL/c= -github.com/google/go-github/v54 v54.0.0/go.mod h1:Sw1LXWHhXRZtzJ9LI5fyJg9wbQzYvFhW8W5P2yaAQ7s= +github.com/google/go-github/v55 v55.0.0 h1:4pp/1tNMB9X/LuAhs5i0KQAE40NmiR/y6prLNb9x9cg= +github.com/google/go-github/v55 v55.0.0/go.mod h1:JLahOTA1DnXzhxEymmFF5PP2tSS9JVNj68mSZNDwskA= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= -github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/s2a-go v0.1.0/go.mod h1:OJpEgntRZo8ugHpF9hkoLJbS5dSI20XZeXJ9JVywLlM= -github.com/google/s2a-go v0.1.3/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= -github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= -github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= -github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= -github.com/googleapis/enterprise-certificate-proxy v0.2.1/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= -github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= -github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= -github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= -github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= -github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= -github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= -github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= -github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57QpBWsYpwqHJx8= -github.com/googleapis/gax-go/v2 v2.7.1/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= -github.com/googleapis/gax-go/v2 v2.8.0/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= -github.com/googleapis/gax-go/v2 v2.10.0/go.mod h1:4UOEnMCrxsSqQ940WnTiD6qJ63le2ev3xfyagutxiPw= -github.com/googleapis/gax-go/v2 v2.11.0/go.mod h1:DxmR61SGKkGLa2xigwuZIQpkCI2S5iydzRfb3peWZJI= -github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= -github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= -github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= -github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= -github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= -github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= -github.com/lyft/protoc-gen-star v0.6.1/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= -github.com/lyft/protoc-gen-star/v2 v2.0.1/go.mod h1:RcCdONR2ScXaYnQC5tUzxzlpA3WVYF7/opLeUgcQs/o= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-sqlite3 v1.14.14/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY= -github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE= -github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2dXMnm1mY= -github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= -github.com/phpdave11/gofpdi v1.0.13/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= -github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= -github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= -github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= -github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= -github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= -github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/xlzd/gotp v0.1.0 h1:37blvlKCh38s+fkem+fFh7sMnceltoIEBYTVXyoa5Po= github.com/xlzd/gotp v0.1.0/go.mod h1:ndLJ3JKzi3xLmUProq4LLxCuECL93dG9WASNLpHz8qg= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= -github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= -go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= -golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3/go.mod h1:NOZ3BPKG0ec/BKJQgnvsSFpcKLM5xXVWnvZS97DWHgE= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20220827204233-334a2380cb91/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= -golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20210216034530-4410531fe030/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= -golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= -golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= -golang.org/x/image v0.0.0-20220302094943-723b81ca9867/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.0.0-20221012135044-0b7e1fb9d458/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= -golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= -golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= -golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= -golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= -golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= -golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= -golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec= -golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I= -golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= -golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= -golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= -golang.org/x/oauth2 v0.11.0 h1:vPL4xzxBM4niKCW6g9whtaWVXTJf1U5e4aZxxFx/gbU= -golang.org/x/oauth2 v0.11.0/go.mod h1:LdF7O/8bLR/qWK9DrpXmbHLTouvRHK0SgJl0GmDBchk= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= -golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20220922220347-f3bd1da661af/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= -gonum.org/v1/gonum v0.9.3/go.mod h1:TZumC3NeyVQskjXqmyWt4S3bINhy7B4eYwW69EbyX+0= -gonum.org/v1/gonum v0.11.0/go.mod h1:fSG4YDCxxUZQJ7rKsQrj0gMOg00Il0Z96/qMA4bVQhA= -gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= -gonum.org/v1/plot v0.9.0/go.mod h1:3Pcqqmp6RHvJI72kgb8fThyUnav364FOsdDo2aGW5lY= -gonum.org/v1/plot v0.10.1/go.mod h1:VZW5OlhkL1mysU9vaqNHnsy86inf6Ot+jB3r+BczCEo= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= -google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= -google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= -google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= -google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= -google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= -google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= -google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= -google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= -google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= -google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= -google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= -google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= -google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= -google.golang.org/api v0.77.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= -google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= -google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= -google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= -google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g= -google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= -google.golang.org/api v0.93.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= -google.golang.org/api v0.95.0/go.mod h1:eADj+UBuxkh5zlrSntJghuNeg8HwQ1w5lTKkuqaETEI= -google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= -google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= -google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= -google.golang.org/api v0.99.0/go.mod h1:1YOf74vkVndF7pG6hIHuINsM7eWwpVTAfNMNiL91A08= -google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= -google.golang.org/api v0.102.0/go.mod h1:3VFl6/fzoA+qNuS1N1/VfXY4LjoXN/wzeIp7TweWwGo= -google.golang.org/api v0.103.0/go.mod h1:hGtW6nK1AC+d9si/UBhw8Xli+QMOf6xyNAyJw4qU9w0= -google.golang.org/api v0.106.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= -google.golang.org/api v0.107.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= -google.golang.org/api v0.108.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= -google.golang.org/api v0.110.0/go.mod h1:7FC4Vvx1Mooxh8C5HWjzZHcavuS2f6pmJpZx60ca7iI= -google.golang.org/api v0.111.0/go.mod h1:qtFHvU9mhgTJegR31csQ+rwxyUTHOKFqCKWp1J0fdw0= -google.golang.org/api v0.114.0/go.mod h1:ifYI2ZsFK6/uGddGfAD5BMxlnkBqCmqHSDUVi45N5Yg= -google.golang.org/api v0.118.0/go.mod h1:76TtD3vkgmZ66zZzp72bUUklpmQmKlhh6sYtIjYK+5E= -google.golang.org/api v0.122.0/go.mod h1:gcitW0lvnyWjSp9nKxAbdHKIZ6vF4aajGueeslZOyms= -google.golang.org/api v0.124.0/go.mod h1:xu2HQurE5gi/3t1aFCvhPD781p0a3p11sdunTJ2BlP4= -google.golang.org/api v0.126.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= -google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20220329172620-7be39ac1afc7/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220628213854-d9e0b6570c03/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220722212130-b98a9ff5e252/go.mod h1:GkXuJDJ6aQ7lnJcRF+SJVgFdQhypqgl3LB1C9vabdRE= -google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= -google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220817144833-d7fd3f11b9b1/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220829144015-23454907ede3/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220829175752-36a9c930ecbf/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220913154956-18f8339a66a5/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220914142337-ca0e39ece12f/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220916172020-2692e8806bfa/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220919141832-68c03719ef51/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220920201722-2b89144ce006/go.mod h1:ht8XFiar2npT/g4vkk7O0WYS1sHOHbdujxbEp7CJWbw= -google.golang.org/genproto v0.0.0-20220926165614-551eb538f295/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI= -google.golang.org/genproto v0.0.0-20220926220553-6981cbe3cfce/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI= -google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqwhZAwq4wsRUaVG555sVgsNmIjRtO7t/JH29U= -google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= -google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= -google.golang.org/genproto v0.0.0-20221024153911-1573dae28c9c/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c/go.mod h1:CGI5F/G+E5bKwmfYo09AXuVN4dD894kIKUFmVbP2/Fo= -google.golang.org/genproto v0.0.0-20221109142239-94d6d90a7d66/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= -google.golang.org/genproto v0.0.0-20221114212237-e4508ebdbee1/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= -google.golang.org/genproto v0.0.0-20221117204609-8f9c96812029/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= -google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= -google.golang.org/genproto v0.0.0-20221201164419-0e50fba7f41c/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= -google.golang.org/genproto v0.0.0-20221201204527-e3fa12d562f3/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= -google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd/go.mod h1:cTsE614GARnxrLsqKREzmNYJACSWWpAWdNMwnD7c2BE= -google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/genproto v0.0.0-20230112194545-e10362b5ecf9/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/genproto v0.0.0-20230113154510-dbe35b8444a5/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/genproto v0.0.0-20230123190316-2c411cf9d197/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/genproto v0.0.0-20230124163310-31e0e69b6fc2/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/genproto v0.0.0-20230125152338-dcaf20b6aeaa/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/genproto v0.0.0-20230127162408-596548ed4efa/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/genproto v0.0.0-20230209215440-0dfe4f8abfcc/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/genproto v0.0.0-20230216225411-c8e22ba71e44/go.mod h1:8B0gmkoRebU8ukX6HP+4wrVQUY1+6PkQ44BSyIlflHA= -google.golang.org/genproto v0.0.0-20230222225845-10f96fb3dbec/go.mod h1:3Dl5ZL0q0isWJt+FVcfpQyirqemEuLAK/iFvg1UP1Hw= -google.golang.org/genproto v0.0.0-20230223222841-637eb2293923/go.mod h1:3Dl5ZL0q0isWJt+FVcfpQyirqemEuLAK/iFvg1UP1Hw= -google.golang.org/genproto v0.0.0-20230303212802-e74f57abe488/go.mod h1:TvhZT5f700eVlTNwND1xoEZQeWTB2RY/65kplwl/bFA= -google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= -google.golang.org/genproto v0.0.0-20230320184635-7606e756e683/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= -google.golang.org/genproto v0.0.0-20230323212658-478b75c54725/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= -google.golang.org/genproto v0.0.0-20230330154414-c0448cd141ea/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= -google.golang.org/genproto v0.0.0-20230331144136-dcfb400f0633/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= -google.golang.org/genproto v0.0.0-20230403163135-c38d8f061ccd/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= -google.golang.org/genproto v0.0.0-20230525234025-438c736192d0/go.mod h1:9ExIQyXL5hZrHzQceCwuSYwZZ5QZBazOcprJ5rgs3lY= -google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a/go.mod h1:ts19tUU+Z0ZShN1y3aPyq2+O3d5FUNNgT6FtOzmrNn8= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= -google.golang.org/genproto/googleapis/api v0.0.0-20230526203410-71b5a4ffd15e/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= -google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= -google.golang.org/genproto/googleapis/bytestream v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:ylj+BE99M198VPbBh6A8d9n3w8fChvyLK3wwBOjXBFA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234015-3fc162c6f38a/go.mod h1:xURIpW9ES5+/GZhnV6beoEtxQrnkRGIfP5VQG2tCBLc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230526203410-71b5a4ffd15e/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= -google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= -google.golang.org/grpc v1.52.0/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= -google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= -google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= -google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= -lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= -lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= -modernc.org/cc/v3 v3.36.0/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= -modernc.org/cc/v3 v3.36.2/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= -modernc.org/cc/v3 v3.36.3/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= -modernc.org/ccgo/v3 v3.0.0-20220428102840-41399a37e894/go.mod h1:eI31LL8EwEBKPpNpA4bU1/i+sKOwOrQy8D87zWUcRZc= -modernc.org/ccgo/v3 v3.0.0-20220430103911-bc99d88307be/go.mod h1:bwdAnOoaIt8Ax9YdWGjxWsdkPcZyRPHqrOvJxaKAKGw= -modernc.org/ccgo/v3 v3.16.4/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ= -modernc.org/ccgo/v3 v3.16.6/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ= -modernc.org/ccgo/v3 v3.16.8/go.mod h1:zNjwkizS+fIFDrDjIAgBSCLkWbJuHF+ar3QRn+Z9aws= -modernc.org/ccgo/v3 v3.16.9/go.mod h1:zNMzC9A9xeNUepy6KuZBbugn3c0Mc9TeiJO4lgvkJDo= -modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= -modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= -modernc.org/libc v0.0.0-20220428101251-2d5f3daf273b/go.mod h1:p7Mg4+koNjc8jkqwcoFBJx7tXkpj00G77X7A72jXPXA= -modernc.org/libc v1.16.0/go.mod h1:N4LD6DBE9cf+Dzf9buBlzVJndKr/iJHG97vGLHYnb5A= -modernc.org/libc v1.16.1/go.mod h1:JjJE0eu4yeK7tab2n4S1w8tlWd9MxXLRzheaRnAKymU= -modernc.org/libc v1.16.17/go.mod h1:hYIV5VZczAmGZAnG15Vdngn5HSF5cSkbvfz2B7GRuVU= -modernc.org/libc v1.16.19/go.mod h1:p7Mg4+koNjc8jkqwcoFBJx7tXkpj00G77X7A72jXPXA= -modernc.org/libc v1.17.0/go.mod h1:XsgLldpP4aWlPlsjqKRdHPqCxCjISdHfM/yeWC5GyW0= -modernc.org/libc v1.17.1/go.mod h1:FZ23b+8LjxZs7XtFMbSzL/EhPxNbfZbErxEHc7cbD9s= -modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/mathutil v1.4.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/memory v1.1.1/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= -modernc.org/memory v1.2.0/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= -modernc.org/memory v1.2.1/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= -modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= -modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= -modernc.org/sqlite v1.18.1/go.mod h1:6ho+Gow7oX5V+OiOQ6Tr4xeqbx13UZ6t+Fw9IRUG4d4= -modernc.org/strutil v1.1.1/go.mod h1:DE+MQQ/hjKBZS2zNInV5hhcipt5rLPWkmpbGeW5mmdw= -modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= -modernc.org/tcl v1.13.1/go.mod h1:XOLfOwzhkljL4itZkK6T72ckMgvj0BDsnKNdZVUOecw= -modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= -modernc.org/z v1.5.1/go.mod h1:eWFB510QWW5Th9YGZT81s+LwvaAs3Q2yr4sP0rmLkv8= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= From 4030e93eb69076454b3fc48b605b15054efbaf63 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 6 Sep 2023 18:47:32 +0300 Subject: [PATCH 307/751] Add enterprise runner group operations (#2891) --- github/enterprise_actions_runner_groups.go | 310 ++++++++ .../enterprise_actions_runner_groups_test.go | 666 ++++++++++++++++++ github/github-accessors.go | 160 +++++ github/github-accessors_test.go | 200 ++++++ 4 files changed, 1336 insertions(+) create mode 100644 github/enterprise_actions_runner_groups.go create mode 100644 github/enterprise_actions_runner_groups_test.go diff --git a/github/enterprise_actions_runner_groups.go b/github/enterprise_actions_runner_groups.go new file mode 100644 index 00000000000..b6bb70dae40 --- /dev/null +++ b/github/enterprise_actions_runner_groups.go @@ -0,0 +1,310 @@ +// Copyright 2023 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" +) + +// ListOrganizations represents the response from the list orgs endpoints. +type ListOrganizations struct { + TotalCount *int `json:"total_count,omitempty"` + Organizations []*Organization `json:"organizations"` +} + +// EnterpriseRunnerGroup represents a self-hosted runner group configured in an enterprise. +type EnterpriseRunnerGroup struct { + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Visibility *string `json:"visibility,omitempty"` + Default *bool `json:"default,omitempty"` + SelectedOrganizationsURL *string `json:"selected_organizations_url,omitempty"` + RunnersURL *string `json:"runners_url,omitempty"` + Inherited *bool `json:"inherited,omitempty"` + AllowsPublicRepositories *bool `json:"allows_public_repositories,omitempty"` + RestrictedToWorkflows *bool `json:"restricted_to_workflows,omitempty"` + SelectedWorkflows []string `json:"selected_workflows,omitempty"` + WorkflowRestrictionsReadOnly *bool `json:"workflow_restrictions_read_only,omitempty"` +} + +// EnterpriseRunnerGroups represents a collection of self-hosted runner groups configured for an enterprise. +type EnterpriseRunnerGroups struct { + TotalCount *int `json:"total_count,omitempty"` + RunnerGroups []*EnterpriseRunnerGroup `json:"runner_groups"` +} + +// CreateEnterpriseRunnerGroupRequest represents a request to create a Runner group for an enterprise. +type CreateEnterpriseRunnerGroupRequest struct { + Name *string `json:"name,omitempty"` + Visibility *string `json:"visibility,omitempty"` + // List of organization IDs that can access the runner group. + SelectedOrganizationIDs []int64 `json:"selected_organization_ids,omitempty"` + // Runners represent a list of runner IDs to add to the runner group. + Runners []int64 `json:"runners,omitempty"` + // If set to True, public repos can use this runner group + AllowsPublicRepositories *bool `json:"allows_public_repositories,omitempty"` + // If true, the runner group will be restricted to running only the workflows specified in the SelectedWorkflows slice. + RestrictedToWorkflows *bool `json:"restricted_to_workflows,omitempty"` + // List of workflows the runner group should be allowed to run. This setting will be ignored unless RestrictedToWorkflows is set to true. + SelectedWorkflows []string `json:"selected_workflows,omitempty"` +} + +// UpdateEnterpriseRunnerGroupRequest represents a request to update a Runner group for an enterprise. +type UpdateEnterpriseRunnerGroupRequest struct { + Name *string `json:"name,omitempty"` + Visibility *string `json:"visibility,omitempty"` + AllowsPublicRepositories *bool `json:"allows_public_repositories,omitempty"` + RestrictedToWorkflows *bool `json:"restricted_to_workflows,omitempty"` + SelectedWorkflows []string `json:"selected_workflows,omitempty"` +} + +// SetOrgAccessRunnerGroupRequest represents a request to replace the list of organizations +// that can access a self-hosted runner group configured in an enterprise. +type SetOrgAccessRunnerGroupRequest struct { + // Updated list of organization IDs that should be given access to the runner group. + SelectedOrganizationIDs []int64 `json:"selected_organization_ids"` +} + +// ListEnterpriseRunnerGroupOptions extend ListOptions to have the optional parameters VisibleToOrganization. +type ListEnterpriseRunnerGroupOptions struct { + ListOptions + + // Only return runner groups that are allowed to be used by this organization. + VisibleToOrganization string `url:"visible_to_organization,omitempty"` +} + +// ListRunnerGroups lists all self-hosted runner groups configured in an enterprise. +// +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#list-self-hosted-runner-groups-for-an-enterprise +func (s *EnterpriseService) ListRunnerGroups(ctx context.Context, enterprise string, opts *ListEnterpriseRunnerGroupOptions) (*EnterpriseRunnerGroups, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/runner-groups", enterprise) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + groups := &EnterpriseRunnerGroups{} + resp, err := s.client.Do(ctx, req, &groups) + if err != nil { + return nil, resp, err + } + + return groups, resp, nil +} + +// GetEnterpriseRunnerGroup gets a specific self-hosted runner group for an enterprise using its RunnerGroup ID. +// +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#get-a-self-hosted-runner-group-for-an-enterprise +func (s *EnterpriseService) GetEnterpriseRunnerGroup(ctx context.Context, enterprise string, groupID int64) (*EnterpriseRunnerGroup, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v", enterprise, groupID) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + runnerGroup := new(EnterpriseRunnerGroup) + resp, err := s.client.Do(ctx, req, runnerGroup) + if err != nil { + return nil, resp, err + } + + return runnerGroup, resp, nil +} + +// DeleteEnterpriseRunnerGroup deletes a self-hosted runner group from an enterprise. +// +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#delete-a-self-hosted-runner-group-from-an-enterprise +func (s *EnterpriseService) DeleteEnterpriseRunnerGroup(ctx context.Context, enterprise string, groupID int64) (*Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v", enterprise, groupID) + + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// CreateEnterpriseRunnerGroup creates a new self-hosted runner group for an enterprise. +// +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#create-a-self-hosted-runner-group-for-an-enterprise +func (s *EnterpriseService) CreateEnterpriseRunnerGroup(ctx context.Context, enterprise string, createReq CreateEnterpriseRunnerGroupRequest) (*EnterpriseRunnerGroup, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/runner-groups", enterprise) + req, err := s.client.NewRequest("POST", u, createReq) + if err != nil { + return nil, nil, err + } + + runnerGroup := new(EnterpriseRunnerGroup) + resp, err := s.client.Do(ctx, req, runnerGroup) + if err != nil { + return nil, resp, err + } + + return runnerGroup, resp, nil +} + +// UpdateEnterpriseRunnerGroup updates a self-hosted runner group for an enterprise. +// +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#update-a-self-hosted-runner-group-for-an-enterprise +func (s *EnterpriseService) UpdateEnterpriseRunnerGroup(ctx context.Context, enterprise string, groupID int64, updateReq UpdateEnterpriseRunnerGroupRequest) (*EnterpriseRunnerGroup, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v", enterprise, groupID) + req, err := s.client.NewRequest("PATCH", u, updateReq) + if err != nil { + return nil, nil, err + } + + runnerGroup := new(EnterpriseRunnerGroup) + resp, err := s.client.Do(ctx, req, runnerGroup) + if err != nil { + return nil, resp, err + } + + return runnerGroup, resp, nil +} + +// ListOrganizationAccessRunnerGroup lists the organizations with access to a self-hosted runner group configured in an enterprise. +// +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#list-organization-access-to-a-self-hosted-runner-group-in-an-enterprise +func (s *EnterpriseService) ListOrganizationAccessRunnerGroup(ctx context.Context, enterprise string, groupID int64, opts *ListOptions) (*ListOrganizations, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/organizations", enterprise, groupID) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + orgs := &ListOrganizations{} + resp, err := s.client.Do(ctx, req, &orgs) + if err != nil { + return nil, resp, err + } + + return orgs, resp, nil +} + +// SetOrganizationAccessRunnerGroup replaces the list of organizations that have access to a self-hosted runner group configured in an enterprise +// with a new List of organizations. +// +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#set-organization-access-for-a-self-hosted-runner-group-in-an-enterprise +func (s *EnterpriseService) SetOrganizationAccessRunnerGroup(ctx context.Context, enterprise string, groupID int64, ids SetOrgAccessRunnerGroupRequest) (*Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/organizations", enterprise, groupID) + + req, err := s.client.NewRequest("PUT", u, ids) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// AddOrganizationAccessRunnerGroup adds an organization to the list of selected organizations that can access a self-hosted runner group. +// The runner group must have visibility set to 'selected'. +// +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#add-organization-access-to-a-self-hosted-runner-group-in-an-enterprise +func (s *EnterpriseService) AddOrganizationAccessRunnerGroup(ctx context.Context, enterprise string, groupID, orgID int64) (*Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/organizations/%v", enterprise, groupID, orgID) + + req, err := s.client.NewRequest("PUT", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// RemoveOrganizationAccessRunnerGroup removes an organization from the list of selected organizations that can access a self-hosted runner group. +// The runner group must have visibility set to 'selected'. +// +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#remove-organization-access-to-a-self-hosted-runner-group-in-an-enterprise +func (s *EnterpriseService) RemoveOrganizationAccessRunnerGroup(ctx context.Context, enterprise string, groupID, orgID int64) (*Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/organizations/%v", enterprise, groupID, orgID) + + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// ListRunnerGroupRunners lists self-hosted runners that are in a specific enterprise group. +// +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#list-self-hosted-runners-in-a-group-for-an-enterprise +func (s *EnterpriseService) ListRunnerGroupRunners(ctx context.Context, enterprise string, groupID int64, opts *ListOptions) (*Runners, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/runners", enterprise, groupID) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + runners := &Runners{} + resp, err := s.client.Do(ctx, req, &runners) + if err != nil { + return nil, resp, err + } + + return runners, resp, nil +} + +// SetRunnerGroupRunners replaces the list of self-hosted runners that are part of an enterprise runner group +// with a new list of runners. +// +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#set-self-hosted-runners-in-a-group-for-an-enterprise +func (s *EnterpriseService) SetRunnerGroupRunners(ctx context.Context, enterprise string, groupID int64, ids SetRunnerGroupRunnersRequest) (*Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/runners", enterprise, groupID) + + req, err := s.client.NewRequest("PUT", u, ids) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// AddRunnerGroupRunners adds a self-hosted runner to a runner group configured in an enterprise. +// +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#add-a-self-hosted-runner-to-a-group-for-an-enterprise +func (s *EnterpriseService) AddRunnerGroupRunners(ctx context.Context, enterprise string, groupID, runnerID int64) (*Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/runners/%v", enterprise, groupID, runnerID) + + req, err := s.client.NewRequest("PUT", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// RemoveRunnerGroupRunners removes a self-hosted runner from a group configured in an enterprise. +// The runner is then returned to the default group. +// +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#remove-a-self-hosted-runner-from-a-group-for-an-enterprise +func (s *EnterpriseService) RemoveRunnerGroupRunners(ctx context.Context, enterprise string, groupID, runnerID int64) (*Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/runners/%v", enterprise, groupID, runnerID) + + 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/enterprise_actions_runner_groups_test.go b/github/enterprise_actions_runner_groups_test.go new file mode 100644 index 00000000000..36036e419c2 --- /dev/null +++ b/github/enterprise_actions_runner_groups_test.go @@ -0,0 +1,666 @@ +// Copyright 2023 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 TestEnterpriseService_ListRunnerGroups(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/enterprises/o/actions/runner-groups", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{"per_page": "2", "page": "2"}) + fmt.Fprint(w, `{"total_count":3,"runner_groups":[{"id":1,"name":"Default","visibility":"all","default":true,"runners_url":"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/1/runners","inherited":false,"allows_public_repositories":true,"restricted_to_workflows":true,"selected_workflows":["a","b"]},{"id":2,"name":"octo-runner-group","visibility":"selected","default":false,"selected_organizations_url":"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/organizations","runners_url":"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/runners","inherited":true,"allows_public_repositories":true,"restricted_to_workflows":false,"selected_workflows":[]},{"id":3,"name":"expensive-hardware","visibility":"private","default":false,"runners_url":"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/3/runners","inherited":false,"allows_public_repositories":true,"restricted_to_workflows":false,"selected_workflows":[]}]}`) + }) + + opts := &ListEnterpriseRunnerGroupOptions{ListOptions: ListOptions{Page: 2, PerPage: 2}} + ctx := context.Background() + groups, _, err := client.Enterprise.ListRunnerGroups(ctx, "o", opts) + if err != nil { + t.Errorf("Enterprise.ListRunnerGroups returned error: %v", err) + } + + want := &EnterpriseRunnerGroups{ + TotalCount: Int(3), + RunnerGroups: []*EnterpriseRunnerGroup{ + {ID: Int64(1), Name: String("Default"), Visibility: String("all"), Default: Bool(true), RunnersURL: String("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/1/runners"), Inherited: Bool(false), AllowsPublicRepositories: Bool(true), RestrictedToWorkflows: Bool(true), SelectedWorkflows: []string{"a", "b"}}, + {ID: Int64(2), Name: String("octo-runner-group"), Visibility: String("selected"), Default: Bool(false), SelectedOrganizationsURL: String("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/organizations"), RunnersURL: String("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/runners"), Inherited: Bool(true), AllowsPublicRepositories: Bool(true), RestrictedToWorkflows: Bool(false), SelectedWorkflows: []string{}}, + {ID: Int64(3), Name: String("expensive-hardware"), Visibility: String("private"), Default: Bool(false), RunnersURL: String("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/3/runners"), Inherited: Bool(false), AllowsPublicRepositories: Bool(true), RestrictedToWorkflows: Bool(false), SelectedWorkflows: []string{}}, + }, + } + if !cmp.Equal(groups, want) { + t.Errorf("Enterprise.ListRunnerGroups returned %+v, want %+v", groups, want) + } + + const methodName = "ListRunnerGroups" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Enterprise.ListRunnerGroups(ctx, "\n", opts) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.ListRunnerGroups(ctx, "o", opts) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_ListRunnerGroupsVisibleToOrganization(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/enterprises/o/actions/runner-groups", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{"per_page": "2", "page": "2", "visible_to_organization": "github"}) + fmt.Fprint(w, `{"total_count":3,"runner_groups":[{"id":1,"name":"Default","visibility":"all","default":true,"runners_url":"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/1/runners","inherited":false,"allows_public_repositories":true,"restricted_to_workflows":false,"selected_workflows":[]},{"id":2,"name":"octo-runner-group","visibility":"selected","default":false,"selected_organizations_url":"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/organizations","runners_url":"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/runners","inherited":true,"allows_public_repositories":true,"restricted_to_workflows":false,"selected_workflows":[]},{"id":3,"name":"expensive-hardware","visibility":"private","default":false,"runners_url":"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/3/runners","inherited":false,"allows_public_repositories":true,"restricted_to_workflows":false,"selected_workflows":[]}]}`) + }) + + opts := &ListEnterpriseRunnerGroupOptions{ListOptions: ListOptions{Page: 2, PerPage: 2}, VisibleToOrganization: "github"} + ctx := context.Background() + groups, _, err := client.Enterprise.ListRunnerGroups(ctx, "o", opts) + if err != nil { + t.Errorf("Enterprise.ListRunnerGroups returned error: %v", err) + } + + want := &EnterpriseRunnerGroups{ + TotalCount: Int(3), + RunnerGroups: []*EnterpriseRunnerGroup{ + {ID: Int64(1), Name: String("Default"), Visibility: String("all"), Default: Bool(true), RunnersURL: String("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/1/runners"), Inherited: Bool(false), AllowsPublicRepositories: Bool(true), RestrictedToWorkflows: Bool(false), SelectedWorkflows: []string{}}, + {ID: Int64(2), Name: String("octo-runner-group"), Visibility: String("selected"), Default: Bool(false), SelectedOrganizationsURL: String("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/organizations"), RunnersURL: String("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/runners"), Inherited: Bool(true), AllowsPublicRepositories: Bool(true), RestrictedToWorkflows: Bool(false), SelectedWorkflows: []string{}}, + {ID: Int64(3), Name: String("expensive-hardware"), Visibility: String("private"), Default: Bool(false), RunnersURL: String("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/3/runners"), Inherited: Bool(false), AllowsPublicRepositories: Bool(true), RestrictedToWorkflows: Bool(false), SelectedWorkflows: []string{}}, + }, + } + if !cmp.Equal(groups, want) { + t.Errorf("Enterprise.ListRunnerGroups returned %+v, want %+v", groups, want) + } + + const methodName = "ListRunnerGroups" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Enterprise.ListRunnerGroups(ctx, "\n", opts) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.ListRunnerGroups(ctx, "o", opts) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_GetRunnerGroup(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/enterprises/o/actions/runner-groups/2", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"id":2,"name":"octo-runner-group","visibility":"selected","default":false,"selected_organizations_url":"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/organizations","runners_url":"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/runners","inherited":false,"allows_public_repositories":true,"restricted_to_workflows":false,"selected_workflows":[]}`) + }) + + ctx := context.Background() + group, _, err := client.Enterprise.GetEnterpriseRunnerGroup(ctx, "o", 2) + if err != nil { + t.Errorf("Enterprise.GetRunnerGroup returned error: %v", err) + } + + want := &EnterpriseRunnerGroup{ + ID: Int64(2), + Name: String("octo-runner-group"), + Visibility: String("selected"), + Default: Bool(false), + SelectedOrganizationsURL: String("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/organizations"), + RunnersURL: String("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/runners"), + Inherited: Bool(false), + AllowsPublicRepositories: Bool(true), + RestrictedToWorkflows: Bool(false), + SelectedWorkflows: []string{}, + } + + if !cmp.Equal(group, want) { + t.Errorf("Enterprise.GetRunnerGroup returned %+v, want %+v", group, want) + } + + const methodName = "GetRunnerGroup" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Enterprise.GetEnterpriseRunnerGroup(ctx, "\n", 2) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.GetEnterpriseRunnerGroup(ctx, "o", 2) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_DeleteRunnerGroup(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/enterprises/o/actions/runner-groups/2", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + }) + + ctx := context.Background() + _, err := client.Enterprise.DeleteEnterpriseRunnerGroup(ctx, "o", 2) + if err != nil { + t.Errorf("Enterprise.DeleteRunnerGroup returned error: %v", err) + } + + const methodName = "DeleteRunnerGroup" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Enterprise.DeleteEnterpriseRunnerGroup(ctx, "\n", 2) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Enterprise.DeleteEnterpriseRunnerGroup(ctx, "o", 2) + }) +} + +func TestEnterpriseService_CreateRunnerGroup(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/enterprises/o/actions/runner-groups", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + fmt.Fprint(w, `{"id":2,"name":"octo-runner-group","visibility":"selected","default":false,"selected_organizations_url":"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/organizations","runners_url":"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/runners","inherited":false,"allows_public_repositories":true,"restricted_to_workflows":false,"selected_workflows":[]}`) + }) + + ctx := context.Background() + req := CreateEnterpriseRunnerGroupRequest{ + Name: String("octo-runner-group"), + Visibility: String("selected"), + AllowsPublicRepositories: Bool(true), + RestrictedToWorkflows: Bool(false), + SelectedWorkflows: []string{}, + } + group, _, err := client.Enterprise.CreateEnterpriseRunnerGroup(ctx, "o", req) + if err != nil { + t.Errorf("Enterprise.CreateRunnerGroup returned error: %v", err) + } + + want := &EnterpriseRunnerGroup{ + ID: Int64(2), + Name: String("octo-runner-group"), + Visibility: String("selected"), + Default: Bool(false), + SelectedOrganizationsURL: String("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/organizations"), + RunnersURL: String("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/runners"), + Inherited: Bool(false), + AllowsPublicRepositories: Bool(true), + RestrictedToWorkflows: Bool(false), + SelectedWorkflows: []string{}, + } + + if !cmp.Equal(group, want) { + t.Errorf("Enterprise.CreateRunnerGroup returned %+v, want %+v", group, want) + } + + const methodName = "CreateRunnerGroup" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Enterprise.CreateEnterpriseRunnerGroup(ctx, "\n", req) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.CreateEnterpriseRunnerGroup(ctx, "o", req) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_UpdateRunnerGroup(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/enterprises/o/actions/runner-groups/2", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PATCH") + fmt.Fprint(w, `{"id":2,"name":"octo-runner-group","visibility":"selected","default":false,"selected_organizations_url":"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/organizations","runners_url":"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/runners","inherited":false,"allows_public_repositories":true,"restricted_to_workflows":false,"selected_workflows":[]}`) + }) + + ctx := context.Background() + req := UpdateEnterpriseRunnerGroupRequest{ + Name: String("octo-runner-group"), + Visibility: String("selected"), + AllowsPublicRepositories: Bool(true), + RestrictedToWorkflows: Bool(false), + SelectedWorkflows: []string{}, + } + group, _, err := client.Enterprise.UpdateEnterpriseRunnerGroup(ctx, "o", 2, req) + if err != nil { + t.Errorf("Enterprise.UpdateRunnerGroup returned error: %v", err) + } + + want := &EnterpriseRunnerGroup{ + ID: Int64(2), + Name: String("octo-runner-group"), + Visibility: String("selected"), + Default: Bool(false), + SelectedOrganizationsURL: String("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/organizations"), + RunnersURL: String("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/runners"), + Inherited: Bool(false), + AllowsPublicRepositories: Bool(true), + RestrictedToWorkflows: Bool(false), + SelectedWorkflows: []string{}, + } + + if !cmp.Equal(group, want) { + t.Errorf("Enterprise.UpdateRunnerGroup returned %+v, want %+v", group, want) + } + + const methodName = "UpdateRunnerGroup" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Enterprise.UpdateEnterpriseRunnerGroup(ctx, "\n", 2, req) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.UpdateEnterpriseRunnerGroup(ctx, "o", 2, req) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_ListOrganizationAccessRunnerGroup(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/enterprises/o/actions/runner-groups/2/organizations", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{"per_page": "1", "page": "1"}) + fmt.Fprint(w, `{"total_count": 1, "organizations": [{"id": 43, "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5", "name": "Hello-World", "login": "octocat"}]}`) + }) + + ctx := context.Background() + opts := &ListOptions{Page: 1, PerPage: 1} + groups, _, err := client.Enterprise.ListOrganizationAccessRunnerGroup(ctx, "o", 2, opts) + if err != nil { + t.Errorf("Enterprise.ListOrganizationAccessRunnerGroup returned error: %v", err) + } + + want := &ListOrganizations{ + TotalCount: Int(1), + Organizations: []*Organization{ + {ID: Int64(43), NodeID: String("MDEwOlJlcG9zaXRvcnkxMjk2MjY5"), Name: String("Hello-World"), Login: String("octocat")}, + }, + } + if !cmp.Equal(groups, want) { + t.Errorf("Enterprise.ListOrganizationAccessRunnerGroup returned %+v, want %+v", groups, want) + } + + const methodName = "ListOrganizationAccessRunnerGroup" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Enterprise.ListOrganizationAccessRunnerGroup(ctx, "\n", 2, opts) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.ListOrganizationAccessRunnerGroup(ctx, "o", 2, opts) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_SetOrganizationAccessRunnerGroup(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/enterprises/o/actions/runner-groups/2/organizations", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + }) + + req := SetOrgAccessRunnerGroupRequest{ + SelectedOrganizationIDs: []int64{ + 1, + 2, + }, + } + + ctx := context.Background() + _, err := client.Enterprise.SetOrganizationAccessRunnerGroup(ctx, "o", 2, req) + if err != nil { + t.Errorf("Enterprise.SetOrganizationAccessRunnerGroup returned error: %v", err) + } + + const methodName = "SetRepositoryAccessRunnerGroup" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Enterprise.SetOrganizationAccessRunnerGroup(ctx, "\n", 2, req) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Enterprise.SetOrganizationAccessRunnerGroup(ctx, "o", 2, req) + }) +} + +func TestEnterpriseService_AddOrganizationAccessRunnerGroup(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/enterprises/o/actions/runner-groups/2/organizations/42", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + }) + + ctx := context.Background() + _, err := client.Enterprise.AddOrganizationAccessRunnerGroup(ctx, "o", 2, 42) + if err != nil { + t.Errorf("Enterprise.AddOrganizationAccessRunnerGroup returned error: %v", err) + } + + const methodName = "AddOrganizationAccessRunnerGroup" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Enterprise.AddOrganizationAccessRunnerGroup(ctx, "\n", 2, 42) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Enterprise.AddOrganizationAccessRunnerGroup(ctx, "o", 2, 42) + }) +} + +func TestEnterpriseService_RemoveOrganizationAccessRunnerGroup(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/enterprises/o/actions/runner-groups/2/organizations/42", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + }) + + ctx := context.Background() + _, err := client.Enterprise.RemoveOrganizationAccessRunnerGroup(ctx, "o", 2, 42) + if err != nil { + t.Errorf("Enterprise.RemoveOrganizationAccessRunnerGroup returned error: %v", err) + } + + const methodName = "RemoveOrganizationAccessRunnerGroup" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Enterprise.RemoveOrganizationAccessRunnerGroup(ctx, "\n", 2, 42) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Enterprise.RemoveOrganizationAccessRunnerGroup(ctx, "o", 2, 42) + }) +} + +func TestEnterpriseService_ListEnterpriseRunnerGroupRunners(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/enterprises/o/actions/runner-groups/2/runners", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{"per_page": "2", "page": "2"}) + fmt.Fprint(w, `{"total_count":2,"runners":[{"id":23,"name":"MBP","os":"macos","status":"online"},{"id":24,"name":"iMac","os":"macos","status":"offline"}]}`) + }) + + opts := &ListOptions{Page: 2, PerPage: 2} + ctx := context.Background() + runners, _, err := client.Enterprise.ListRunnerGroupRunners(ctx, "o", 2, opts) + if err != nil { + t.Errorf("Enterprise.ListEnterpriseRunnerGroupRunners returned error: %v", err) + } + + want := &Runners{ + TotalCount: 2, + Runners: []*Runner{ + {ID: Int64(23), Name: String("MBP"), OS: String("macos"), Status: String("online")}, + {ID: Int64(24), Name: String("iMac"), OS: String("macos"), Status: String("offline")}, + }, + } + if !cmp.Equal(runners, want) { + t.Errorf("Enterprise.ListEnterpriseRunnerGroupRunners returned %+v, want %+v", runners, want) + } + + const methodName = "ListEnterpriseRunnerGroupRunners" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Enterprise.ListRunnerGroupRunners(ctx, "\n", 2, opts) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.ListRunnerGroupRunners(ctx, "o", 2, opts) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_SetEnterpriseRunnerGroupRunners(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/enterprises/o/actions/runner-groups/2/runners", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + }) + + req := SetRunnerGroupRunnersRequest{ + Runners: []int64{ + 1, + 2, + }, + } + + ctx := context.Background() + _, err := client.Enterprise.SetRunnerGroupRunners(ctx, "o", 2, req) + if err != nil { + t.Errorf("Enterprise.SetEnterpriseRunnerGroupRunners returned error: %v", err) + } + + const methodName = "SetEnterpriseRunnerGroupRunners" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Enterprise.SetRunnerGroupRunners(ctx, "\n", 2, req) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Enterprise.SetRunnerGroupRunners(ctx, "o", 2, req) + }) +} + +func TestEnterpriseService_AddEnterpriseRunnerGroupRunners(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/enterprises/o/actions/runner-groups/2/runners/42", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + }) + + ctx := context.Background() + _, err := client.Enterprise.AddRunnerGroupRunners(ctx, "o", 2, 42) + if err != nil { + t.Errorf("Enterprise.AddEnterpriseRunnerGroupRunners returned error: %v", err) + } + + const methodName = "AddEnterpriseRunnerGroupRunners" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Enterprise.AddRunnerGroupRunners(ctx, "\n", 2, 42) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Enterprise.AddRunnerGroupRunners(ctx, "o", 2, 42) + }) +} + +func TestEnterpriseService_RemoveEnterpriseRunnerGroupRunners(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/enterprises/o/actions/runner-groups/2/runners/42", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + }) + + ctx := context.Background() + _, err := client.Enterprise.RemoveRunnerGroupRunners(ctx, "o", 2, 42) + if err != nil { + t.Errorf("Enterprise.RemoveEnterpriseRunnerGroupRunners returned error: %v", err) + } + + const methodName = "RemoveEnterpriseRunnerGroupRunners" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Enterprise.RemoveRunnerGroupRunners(ctx, "\n", 2, 42) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Enterprise.RemoveRunnerGroupRunners(ctx, "o", 2, 42) + }) +} + +func TestEnterpriseRunnerGroup_Marshal(t *testing.T) { + testJSONMarshal(t, &EnterpriseRunnerGroup{}, "{}") + + u := &EnterpriseRunnerGroup{ + ID: Int64(1), + Name: String("n"), + Visibility: String("v"), + Default: Bool(true), + SelectedOrganizationsURL: String("s"), + RunnersURL: String("r"), + Inherited: Bool(true), + AllowsPublicRepositories: Bool(true), + RestrictedToWorkflows: Bool(false), + SelectedWorkflows: []string{}, + } + + want := `{ + "id": 1, + "name": "n", + "visibility": "v", + "default": true, + "selected_organizations_url": "s", + "runners_url": "r", + "inherited": true, + "allows_public_repositories": true, + "restricted_to_workflows": false, + "selected_workflows": [] + }` + + testJSONMarshal(t, u, want) +} + +func TestEnterpriseRunnerGroups_Marshal(t *testing.T) { + testJSONMarshal(t, &EnterpriseRunnerGroups{}, "{}") + + u := &EnterpriseRunnerGroups{ + TotalCount: Int(1), + RunnerGroups: []*EnterpriseRunnerGroup{ + { + ID: Int64(1), + Name: String("n"), + Visibility: String("v"), + Default: Bool(true), + SelectedOrganizationsURL: String("s"), + RunnersURL: String("r"), + Inherited: Bool(true), + AllowsPublicRepositories: Bool(true), + RestrictedToWorkflows: Bool(false), + SelectedWorkflows: []string{}, + }, + }, + } + + want := `{ + "total_count": 1, + "runner_groups": [{ + "id": 1, + "name": "n", + "visibility": "v", + "default": true, + "selected_organizations_url": "s", + "runners_url": "r", + "inherited": true, + "allows_public_repositories": true, + "restricted_to_workflows": false, + "selected_workflows": [] + }] + }` + + testJSONMarshal(t, u, want) +} + +func TestCreateEnterpriseRunnerGroupRequest_Marshal(t *testing.T) { + testJSONMarshal(t, &CreateEnterpriseRunnerGroupRequest{}, "{}") + + u := &CreateEnterpriseRunnerGroupRequest{ + Name: String("n"), + Visibility: String("v"), + SelectedOrganizationIDs: []int64{1}, + Runners: []int64{1}, + AllowsPublicRepositories: Bool(true), + RestrictedToWorkflows: Bool(true), + SelectedWorkflows: []string{"a", "b"}, + } + + want := `{ + "name": "n", + "visibility": "v", + "selected_organization_ids": [1], + "runners": [1], + "allows_public_repositories": true, + "restricted_to_workflows": true, + "selected_workflows": ["a","b"] + }` + + testJSONMarshal(t, u, want) +} + +func TestUpdateEnterpriseRunnerGroupRequest_Marshal(t *testing.T) { + testJSONMarshal(t, &UpdateEnterpriseRunnerGroupRequest{}, "{}") + + u := &UpdateEnterpriseRunnerGroupRequest{ + Name: String("n"), + Visibility: String("v"), + AllowsPublicRepositories: Bool(true), + RestrictedToWorkflows: Bool(false), + SelectedWorkflows: []string{}, + } + + want := `{ + "name": "n", + "visibility": "v", + "allows_public_repositories": true, + "restricted_to_workflows": false, + "selected_workflows": [] + }` + + testJSONMarshal(t, u, want) +} + +func TestSetOrgAccessRunnerGroupRequest_Marshal(t *testing.T) { + testJSONMarshal(t, &SetOrgAccessRunnerGroupRequest{}, "{}") + + u := &SetOrgAccessRunnerGroupRequest{ + SelectedOrganizationIDs: []int64{1}, + } + + want := `{ + "selected_organization_ids": [1] + }` + + testJSONMarshal(t, u, want) +} diff --git a/github/github-accessors.go b/github/github-accessors.go index 560e0892eda..a685a3efce5 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -4574,6 +4574,38 @@ func (c *CreateCodespaceOptions) GetWorkingDirectory() string { return *c.WorkingDirectory } +// GetAllowsPublicRepositories returns the AllowsPublicRepositories field if it's non-nil, zero value otherwise. +func (c *CreateEnterpriseRunnerGroupRequest) GetAllowsPublicRepositories() bool { + if c == nil || c.AllowsPublicRepositories == nil { + return false + } + return *c.AllowsPublicRepositories +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (c *CreateEnterpriseRunnerGroupRequest) GetName() string { + if c == nil || c.Name == nil { + return "" + } + return *c.Name +} + +// GetRestrictedToWorkflows returns the RestrictedToWorkflows field if it's non-nil, zero value otherwise. +func (c *CreateEnterpriseRunnerGroupRequest) GetRestrictedToWorkflows() bool { + if c == nil || c.RestrictedToWorkflows == nil { + return false + } + return *c.RestrictedToWorkflows +} + +// GetVisibility returns the Visibility field if it's non-nil, zero value otherwise. +func (c *CreateEnterpriseRunnerGroupRequest) GetVisibility() string { + if c == nil || c.Visibility == nil { + return "" + } + return *c.Visibility +} + // GetDescription returns the Description field if it's non-nil, zero value otherwise. func (c *CreateEvent) GetDescription() string { if c == nil || c.Description == nil { @@ -6630,6 +6662,94 @@ func (e *Enterprise) GetWebsiteURL() string { return *e.WebsiteURL } +// GetAllowsPublicRepositories returns the AllowsPublicRepositories field if it's non-nil, zero value otherwise. +func (e *EnterpriseRunnerGroup) GetAllowsPublicRepositories() bool { + if e == nil || e.AllowsPublicRepositories == nil { + return false + } + return *e.AllowsPublicRepositories +} + +// GetDefault returns the Default field if it's non-nil, zero value otherwise. +func (e *EnterpriseRunnerGroup) GetDefault() bool { + if e == nil || e.Default == nil { + return false + } + return *e.Default +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (e *EnterpriseRunnerGroup) GetID() int64 { + if e == nil || e.ID == nil { + return 0 + } + return *e.ID +} + +// GetInherited returns the Inherited field if it's non-nil, zero value otherwise. +func (e *EnterpriseRunnerGroup) GetInherited() bool { + if e == nil || e.Inherited == nil { + return false + } + return *e.Inherited +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (e *EnterpriseRunnerGroup) GetName() string { + if e == nil || e.Name == nil { + return "" + } + return *e.Name +} + +// GetRestrictedToWorkflows returns the RestrictedToWorkflows field if it's non-nil, zero value otherwise. +func (e *EnterpriseRunnerGroup) GetRestrictedToWorkflows() bool { + if e == nil || e.RestrictedToWorkflows == nil { + return false + } + return *e.RestrictedToWorkflows +} + +// GetRunnersURL returns the RunnersURL field if it's non-nil, zero value otherwise. +func (e *EnterpriseRunnerGroup) GetRunnersURL() string { + if e == nil || e.RunnersURL == nil { + return "" + } + return *e.RunnersURL +} + +// GetSelectedOrganizationsURL returns the SelectedOrganizationsURL field if it's non-nil, zero value otherwise. +func (e *EnterpriseRunnerGroup) GetSelectedOrganizationsURL() string { + if e == nil || e.SelectedOrganizationsURL == nil { + return "" + } + return *e.SelectedOrganizationsURL +} + +// GetVisibility returns the Visibility field if it's non-nil, zero value otherwise. +func (e *EnterpriseRunnerGroup) GetVisibility() string { + if e == nil || e.Visibility == nil { + return "" + } + return *e.Visibility +} + +// GetWorkflowRestrictionsReadOnly returns the WorkflowRestrictionsReadOnly field if it's non-nil, zero value otherwise. +func (e *EnterpriseRunnerGroup) GetWorkflowRestrictionsReadOnly() bool { + if e == nil || e.WorkflowRestrictionsReadOnly == nil { + return false + } + return *e.WorkflowRestrictionsReadOnly +} + +// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. +func (e *EnterpriseRunnerGroups) GetTotalCount() int { + if e == nil || e.TotalCount == nil { + return 0 + } + return *e.TotalCount +} + // GetAdvancedSecurityEnabledForNewRepositories returns the AdvancedSecurityEnabledForNewRepositories field if it's non-nil, zero value otherwise. func (e *EnterpriseSecurityAnalysisSettings) GetAdvancedSecurityEnabledForNewRepositories() bool { if e == nil || e.AdvancedSecurityEnabledForNewRepositories == nil { @@ -10398,6 +10518,14 @@ func (l *ListExternalGroupsOptions) GetDisplayName() string { return *l.DisplayName } +// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. +func (l *ListOrganizations) GetTotalCount() int { + if l == nil || l.TotalCount == nil { + return 0 + } + return *l.TotalCount +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (l *ListRepositories) GetTotalCount() int { if l == nil || l.TotalCount == nil { @@ -22822,6 +22950,38 @@ func (u *UpdateDefaultSetupConfigurationResponse) GetRunURL() string { return *u.RunURL } +// GetAllowsPublicRepositories returns the AllowsPublicRepositories field if it's non-nil, zero value otherwise. +func (u *UpdateEnterpriseRunnerGroupRequest) GetAllowsPublicRepositories() bool { + if u == nil || u.AllowsPublicRepositories == nil { + return false + } + return *u.AllowsPublicRepositories +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (u *UpdateEnterpriseRunnerGroupRequest) GetName() string { + if u == nil || u.Name == nil { + return "" + } + return *u.Name +} + +// GetRestrictedToWorkflows returns the RestrictedToWorkflows field if it's non-nil, zero value otherwise. +func (u *UpdateEnterpriseRunnerGroupRequest) GetRestrictedToWorkflows() bool { + if u == nil || u.RestrictedToWorkflows == nil { + return false + } + return *u.RestrictedToWorkflows +} + +// GetVisibility returns the Visibility field if it's non-nil, zero value otherwise. +func (u *UpdateEnterpriseRunnerGroupRequest) GetVisibility() string { + if u == nil || u.Visibility == nil { + return "" + } + return *u.Visibility +} + // GetAllowsPublicRepositories returns the AllowsPublicRepositories field if it's non-nil, zero value otherwise. func (u *UpdateRunnerGroupRequest) GetAllowsPublicRepositories() bool { if u == nil || u.AllowsPublicRepositories == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 262cdd5a06b..10ef017b3cb 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -5400,6 +5400,46 @@ func TestCreateCodespaceOptions_GetWorkingDirectory(tt *testing.T) { c.GetWorkingDirectory() } +func TestCreateEnterpriseRunnerGroupRequest_GetAllowsPublicRepositories(tt *testing.T) { + var zeroValue bool + c := &CreateEnterpriseRunnerGroupRequest{AllowsPublicRepositories: &zeroValue} + c.GetAllowsPublicRepositories() + c = &CreateEnterpriseRunnerGroupRequest{} + c.GetAllowsPublicRepositories() + c = nil + c.GetAllowsPublicRepositories() +} + +func TestCreateEnterpriseRunnerGroupRequest_GetName(tt *testing.T) { + var zeroValue string + c := &CreateEnterpriseRunnerGroupRequest{Name: &zeroValue} + c.GetName() + c = &CreateEnterpriseRunnerGroupRequest{} + c.GetName() + c = nil + c.GetName() +} + +func TestCreateEnterpriseRunnerGroupRequest_GetRestrictedToWorkflows(tt *testing.T) { + var zeroValue bool + c := &CreateEnterpriseRunnerGroupRequest{RestrictedToWorkflows: &zeroValue} + c.GetRestrictedToWorkflows() + c = &CreateEnterpriseRunnerGroupRequest{} + c.GetRestrictedToWorkflows() + c = nil + c.GetRestrictedToWorkflows() +} + +func TestCreateEnterpriseRunnerGroupRequest_GetVisibility(tt *testing.T) { + var zeroValue string + c := &CreateEnterpriseRunnerGroupRequest{Visibility: &zeroValue} + c.GetVisibility() + c = &CreateEnterpriseRunnerGroupRequest{} + c.GetVisibility() + c = nil + c.GetVisibility() +} + func TestCreateEvent_GetDescription(tt *testing.T) { var zeroValue string c := &CreateEvent{Description: &zeroValue} @@ -7763,6 +7803,116 @@ func TestEnterprise_GetWebsiteURL(tt *testing.T) { e.GetWebsiteURL() } +func TestEnterpriseRunnerGroup_GetAllowsPublicRepositories(tt *testing.T) { + var zeroValue bool + e := &EnterpriseRunnerGroup{AllowsPublicRepositories: &zeroValue} + e.GetAllowsPublicRepositories() + e = &EnterpriseRunnerGroup{} + e.GetAllowsPublicRepositories() + e = nil + e.GetAllowsPublicRepositories() +} + +func TestEnterpriseRunnerGroup_GetDefault(tt *testing.T) { + var zeroValue bool + e := &EnterpriseRunnerGroup{Default: &zeroValue} + e.GetDefault() + e = &EnterpriseRunnerGroup{} + e.GetDefault() + e = nil + e.GetDefault() +} + +func TestEnterpriseRunnerGroup_GetID(tt *testing.T) { + var zeroValue int64 + e := &EnterpriseRunnerGroup{ID: &zeroValue} + e.GetID() + e = &EnterpriseRunnerGroup{} + e.GetID() + e = nil + e.GetID() +} + +func TestEnterpriseRunnerGroup_GetInherited(tt *testing.T) { + var zeroValue bool + e := &EnterpriseRunnerGroup{Inherited: &zeroValue} + e.GetInherited() + e = &EnterpriseRunnerGroup{} + e.GetInherited() + e = nil + e.GetInherited() +} + +func TestEnterpriseRunnerGroup_GetName(tt *testing.T) { + var zeroValue string + e := &EnterpriseRunnerGroup{Name: &zeroValue} + e.GetName() + e = &EnterpriseRunnerGroup{} + e.GetName() + e = nil + e.GetName() +} + +func TestEnterpriseRunnerGroup_GetRestrictedToWorkflows(tt *testing.T) { + var zeroValue bool + e := &EnterpriseRunnerGroup{RestrictedToWorkflows: &zeroValue} + e.GetRestrictedToWorkflows() + e = &EnterpriseRunnerGroup{} + e.GetRestrictedToWorkflows() + e = nil + e.GetRestrictedToWorkflows() +} + +func TestEnterpriseRunnerGroup_GetRunnersURL(tt *testing.T) { + var zeroValue string + e := &EnterpriseRunnerGroup{RunnersURL: &zeroValue} + e.GetRunnersURL() + e = &EnterpriseRunnerGroup{} + e.GetRunnersURL() + e = nil + e.GetRunnersURL() +} + +func TestEnterpriseRunnerGroup_GetSelectedOrganizationsURL(tt *testing.T) { + var zeroValue string + e := &EnterpriseRunnerGroup{SelectedOrganizationsURL: &zeroValue} + e.GetSelectedOrganizationsURL() + e = &EnterpriseRunnerGroup{} + e.GetSelectedOrganizationsURL() + e = nil + e.GetSelectedOrganizationsURL() +} + +func TestEnterpriseRunnerGroup_GetVisibility(tt *testing.T) { + var zeroValue string + e := &EnterpriseRunnerGroup{Visibility: &zeroValue} + e.GetVisibility() + e = &EnterpriseRunnerGroup{} + e.GetVisibility() + e = nil + e.GetVisibility() +} + +func TestEnterpriseRunnerGroup_GetWorkflowRestrictionsReadOnly(tt *testing.T) { + var zeroValue bool + e := &EnterpriseRunnerGroup{WorkflowRestrictionsReadOnly: &zeroValue} + e.GetWorkflowRestrictionsReadOnly() + e = &EnterpriseRunnerGroup{} + e.GetWorkflowRestrictionsReadOnly() + e = nil + e.GetWorkflowRestrictionsReadOnly() +} + +func TestEnterpriseRunnerGroups_GetTotalCount(tt *testing.T) { + var zeroValue int + e := &EnterpriseRunnerGroups{TotalCount: &zeroValue} + e.GetTotalCount() + e = &EnterpriseRunnerGroups{} + e.GetTotalCount() + e = nil + e.GetTotalCount() +} + func TestEnterpriseSecurityAnalysisSettings_GetAdvancedSecurityEnabledForNewRepositories(tt *testing.T) { var zeroValue bool e := &EnterpriseSecurityAnalysisSettings{AdvancedSecurityEnabledForNewRepositories: &zeroValue} @@ -12188,6 +12338,16 @@ func TestListExternalGroupsOptions_GetDisplayName(tt *testing.T) { l.GetDisplayName() } +func TestListOrganizations_GetTotalCount(tt *testing.T) { + var zeroValue int + l := &ListOrganizations{TotalCount: &zeroValue} + l.GetTotalCount() + l = &ListOrganizations{} + l.GetTotalCount() + l = nil + l.GetTotalCount() +} + func TestListRepositories_GetTotalCount(tt *testing.T) { var zeroValue int l := &ListRepositories{TotalCount: &zeroValue} @@ -26560,6 +26720,46 @@ func TestUpdateDefaultSetupConfigurationResponse_GetRunURL(tt *testing.T) { u.GetRunURL() } +func TestUpdateEnterpriseRunnerGroupRequest_GetAllowsPublicRepositories(tt *testing.T) { + var zeroValue bool + u := &UpdateEnterpriseRunnerGroupRequest{AllowsPublicRepositories: &zeroValue} + u.GetAllowsPublicRepositories() + u = &UpdateEnterpriseRunnerGroupRequest{} + u.GetAllowsPublicRepositories() + u = nil + u.GetAllowsPublicRepositories() +} + +func TestUpdateEnterpriseRunnerGroupRequest_GetName(tt *testing.T) { + var zeroValue string + u := &UpdateEnterpriseRunnerGroupRequest{Name: &zeroValue} + u.GetName() + u = &UpdateEnterpriseRunnerGroupRequest{} + u.GetName() + u = nil + u.GetName() +} + +func TestUpdateEnterpriseRunnerGroupRequest_GetRestrictedToWorkflows(tt *testing.T) { + var zeroValue bool + u := &UpdateEnterpriseRunnerGroupRequest{RestrictedToWorkflows: &zeroValue} + u.GetRestrictedToWorkflows() + u = &UpdateEnterpriseRunnerGroupRequest{} + u.GetRestrictedToWorkflows() + u = nil + u.GetRestrictedToWorkflows() +} + +func TestUpdateEnterpriseRunnerGroupRequest_GetVisibility(tt *testing.T) { + var zeroValue string + u := &UpdateEnterpriseRunnerGroupRequest{Visibility: &zeroValue} + u.GetVisibility() + u = &UpdateEnterpriseRunnerGroupRequest{} + u.GetVisibility() + u = nil + u.GetVisibility() +} + func TestUpdateRunnerGroupRequest_GetAllowsPublicRepositories(tt *testing.T) { var zeroValue bool u := &UpdateRunnerGroupRequest{AllowsPublicRepositories: &zeroValue} From 66b1147e57320137b57cbaf8034158ba0af47eeb Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 6 Sep 2023 18:50:07 +0300 Subject: [PATCH 308/751] Add GenerateEnterpriseJITConfig (#2890) --- github/enterprise_actions_runners.go | 20 ++++++++++ github/enterprise_actions_runners_test.go | 45 +++++++++++++++++++++++ 2 files changed, 65 insertions(+) diff --git a/github/enterprise_actions_runners.go b/github/enterprise_actions_runners.go index daafc5e6285..6fc30d50258 100644 --- a/github/enterprise_actions_runners.go +++ b/github/enterprise_actions_runners.go @@ -29,6 +29,26 @@ func (s *EnterpriseService) ListRunnerApplicationDownloads(ctx context.Context, return rads, resp, nil } +// GenerateEnterpriseJITConfig generates a just-in-time configuration for an enterprise. +// +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-configuration-for-a-just-in-time-runner-for-an-enterprise +func (s *EnterpriseService) GenerateEnterpriseJITConfig(ctx context.Context, enterprise string, request *GenerateJITConfigRequest) (*JITRunnerConfig, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/runners/generate-jitconfig", enterprise) + + req, err := s.client.NewRequest("POST", u, request) + if err != nil { + return nil, nil, err + } + + jitConfig := new(JITRunnerConfig) + resp, err := s.client.Do(ctx, req, jitConfig) + if err != nil { + return nil, resp, err + } + + return jitConfig, resp, nil +} + // CreateRegistrationToken creates a token that can be used to add a self-hosted runner. // // GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-registration-token-for-an-enterprise diff --git a/github/enterprise_actions_runners_test.go b/github/enterprise_actions_runners_test.go index b7c3f78b2d3..a1d3f17a895 100644 --- a/github/enterprise_actions_runners_test.go +++ b/github/enterprise_actions_runners_test.go @@ -7,6 +7,7 @@ package github import ( "context" + "encoding/json" "fmt" "net/http" "testing" @@ -15,6 +16,50 @@ import ( "github.com/google/go-cmp/cmp" ) +func TestEnterpriseService_GenerateEnterpriseJITConfig(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + input := &GenerateJITConfigRequest{Name: "test", RunnerGroupID: 1, Labels: []string{"one", "two"}} + + mux.HandleFunc("/enterprises/o/actions/runners/generate-jitconfig", func(w http.ResponseWriter, r *http.Request) { + v := new(GenerateJITConfigRequest) + 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, `{"encoded_jit_config":"foo"}`) + }) + + ctx := context.Background() + jitConfig, _, err := client.Enterprise.GenerateEnterpriseJITConfig(ctx, "o", input) + if err != nil { + t.Errorf("Enterprise.GenerateEnterpriseJITConfig returned error: %v", err) + } + + want := &JITRunnerConfig{EncodedJITConfig: String("foo")} + if !cmp.Equal(jitConfig, want) { + t.Errorf("Enterprise.GenerateEnterpriseJITConfig returned %+v, want %+v", jitConfig, want) + } + + const methodName = "GenerateEnterpriseJITConfig" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Enterprise.GenerateEnterpriseJITConfig(ctx, "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.GenerateEnterpriseJITConfig(ctx, "o", input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + func TestEnterpriseService_CreateRegistrationToken(t *testing.T) { client, mux, _, teardown := setup() defer teardown() From fd33b81221685302178ba197dbabe71326ca9051 Mon Sep 17 00:00:00 2001 From: WillAbides <233500+WillAbides@users.noreply.github.com> Date: Fri, 8 Sep 2023 07:55:37 -0500 Subject: [PATCH 309/751] Fix linting (#2903) --- .github/workflows/linter.yml | 3 +- .golangci.yml | 49 +++++++------- example/basicauth/main.go | 2 +- example/commitpr/main.go | 2 +- example/tagprotection/main.go | 2 +- example/tokenauth/main.go | 2 +- github/actions_runners_test.go | 4 +- github/actions_secrets.go | 2 +- github/actions_workflow_runs_test.go | 2 +- github/actions_workflows_test.go | 4 +- github/activity_notifications_test.go | 2 +- github/activity_test.go | 2 +- github/activity_watching_test.go | 2 +- github/admin_orgs_test.go | 6 +- github/admin_test.go | 4 +- github/admin_users_test.go | 2 +- github/apps_test.go | 4 +- github/code-scanning_test.go | 6 +- github/enterprise_actions_runners_test.go | 5 +- ...erprise_code_security_and_analysis_test.go | 2 +- github/gists_comments_test.go | 4 +- github/gists_test.go | 4 +- github/git_blobs_test.go | 2 +- github/git_commits_test.go | 6 +- github/git_refs_test.go | 6 +- github/git_tags_test.go | 2 +- github/github.go | 12 ++-- github/github_test.go | 38 ++++++++--- github/interactions_orgs_test.go | 2 +- github/interactions_repos_test.go | 2 +- github/issue_import_test.go | 18 ++--- github/issues_assignees_test.go | 4 +- github/issues_comments_test.go | 4 +- github/issues_labels_test.go | 8 +-- github/issues_milestones_test.go | 4 +- github/issues_test.go | 4 +- github/migrations_source_import_test.go | 8 +-- github/migrations_test.go | 8 +-- github/migrations_user_test.go | 6 +- github/misc_test.go | 2 +- github/orgs_actions_allowed_test.go | 2 +- github/orgs_actions_permissions_test.go | 2 +- github/orgs_hooks_configuration_test.go | 2 +- github/orgs_hooks_test.go | 4 +- github/orgs_members_test.go | 6 +- github/orgs_personal_access_tokens_test.go | 2 +- github/orgs_projects_test.go | 2 +- github/orgs_test.go | 2 +- github/projects_test.go | 16 ++--- github/pulls_comments_test.go | 6 +- github/pulls_reviews_test.go | 8 +-- github/pulls_test.go | 5 +- github/reactions_test.go | 24 +++---- github/repos_actions_access_test.go | 2 +- github/repos_actions_allowed_test.go | 2 +- github/repos_actions_permissions_test.go | 2 +- github/repos_autolinks_test.go | 4 +- github/repos_collaborators_test.go | 4 +- github/repos_comments_test.go | 4 +- github/repos_commits_test.go | 6 +- github/repos_deployments_test.go | 4 +- github/repos_environments_test.go | 6 +- github/repos_hooks_configuration_test.go | 2 +- github/repos_hooks_test.go | 4 +- github/repos_keys_test.go | 2 +- github/repos_merging_test.go | 4 +- github/repos_pages_test.go | 8 +-- github/repos_prereceive_hooks_test.go | 2 +- github/repos_projects_test.go | 2 +- github/repos_releases.go | 4 +- github/repos_releases_test.go | 36 +++++++++- github/repos_statuses_test.go | 2 +- github/repos_tags_test.go | 2 +- github/repos_test.go | 37 ++++------- github/secret_scanning_test.go | 2 +- github/strings.go | 4 +- github/teams_discussion_comments_test.go | 4 +- github/teams_discussions_test.go | 8 +-- github/teams_members_test.go | 8 +-- github/teams_test.go | 18 ++--- github/users_administration_test.go | 2 +- github/users_emails_test.go | 6 +- github/users_gpg_keys_test.go | 2 +- github/users_keys_test.go | 2 +- github/users_projects_test.go | 2 +- github/users_ssh_signing_keys_test.go | 2 +- github/users_test.go | 2 +- scrape/apps_test.go | 4 +- scrape/forms_test.go | 10 ++- scrape/scrape_test.go | 16 +++-- test/fields/fields.go | 5 -- test/integration/authorizations_test.go | 66 ------------------- update-urls/activity-events_test.go | 5 +- update-urls/main.go | 12 ++-- update-urls/reactions_test.go | 5 +- 95 files changed, 323 insertions(+), 333 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 1430245422d..4f3cdf8e4df 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -9,7 +9,6 @@ jobs: lint: strategy: matrix: - go-version: [1.x] platform: [ubuntu-latest] # golangci-lint will only process a single module, so we need to call it @@ -17,7 +16,7 @@ jobs: # since that needs libsodium to run. working-directory: - "" - # - example # Fails with "no go files to analyze" + - example - scrape - update-urls runs-on: ${{ matrix.platform }} diff --git a/.golangci.yml b/.golangci.yml index 4d3fc17813b..3e286f045f4 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,34 +1,39 @@ +run: + build-tags: + - integration linters: - # TODO: fix errors so that all of the linters below pass. - # The linters that are commented out, as well as those explicitly disabled, - # are currently failing. We should fix those failures or define exclusion - # rules, and then enable those linters. enable: - dogsled - dupl - gofmt - goimports - # - gosec + - gosec - misspell - nakedret - stylecheck - # - unconvert - # - unparam + - unconvert + - unparam - whitespace - disable: - - errcheck - - gosimple - - staticcheck - - ineffassign - - unused +linters-settings: + gosec: + excludes: + # performance issue: see https://github.com/golangci/golangci-lint/issues/4039 + # and https://github.com/securego/gosec/issues/1007 + - G602 issues: - exclude: - - composites exclude-rules: - - linters: - - dogsled - text: "declaration has 3 blank identifiers" - path: _test\.go - - linters: - - dupl - path: _test\.go + - linters: + - dupl + - unparam + - gosec + - dogsled + path: _test\.go + + # We need to pass nil Context in order to test DoBare erroring on nil ctx. + - linters: [ staticcheck ] + text: 'SA1012: do not pass a nil Context' + path: _test\.go + + # We need to use sha1 for validating signatures + - linters: [ gosec ] + text: 'G505: Blocklisted import crypto/sha1: weak cryptographic primitive' diff --git a/example/basicauth/main.go b/example/basicauth/main.go index 6cda7d6eb85..e677aa94a42 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -32,7 +32,7 @@ func main() { username, _ := r.ReadString('\n') fmt.Print("GitHub Password: ") - bytePassword, _ := term.ReadPassword(int(syscall.Stdin)) + bytePassword, _ := term.ReadPassword(syscall.Stdin) password := string(bytePassword) tp := github.BasicAuthTransport{ diff --git a/example/commitpr/main.go b/example/commitpr/main.go index 1a94e1489d5..328afda5469 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -133,7 +133,7 @@ func pushCommit(ref *github.Reference, tree *github.Tree) (err error) { // Create the commit using the tree. date := time.Now() - author := &github.CommitAuthor{Date: &github.Timestamp{date}, Name: authorName, Email: authorEmail} + author := &github.CommitAuthor{Date: &github.Timestamp{Time: date}, Name: authorName, Email: authorEmail} commit := &github.Commit{Author: author, Message: commitMessage, Tree: tree, Parents: []*github.Commit{parent.Commit}} newCommit, _, err := client.Git.CreateCommit(ctx, *sourceOwner, *sourceRepo, commit) if err != nil { diff --git a/example/tagprotection/main.go b/example/tagprotection/main.go index 056ffae4ea9..3b9b723dd0f 100644 --- a/example/tagprotection/main.go +++ b/example/tagprotection/main.go @@ -39,7 +39,7 @@ func main() { pattern = strings.TrimSpace(pattern) fmt.Print("GitHub Token: ") - byteToken, _ := term.ReadPassword(int(syscall.Stdin)) + byteToken, _ := term.ReadPassword(syscall.Stdin) println() token := string(byteToken) diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index 6fe51804f2e..91ad5e5067a 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -21,7 +21,7 @@ import ( func main() { fmt.Print("GitHub Token: ") - byteToken, _ := term.ReadPassword(int(syscall.Stdin)) + byteToken, _ := term.ReadPassword(syscall.Stdin) println() token := string(byteToken) diff --git a/github/actions_runners_test.go b/github/actions_runners_test.go index 8063152f93a..d059d6e82ac 100644 --- a/github/actions_runners_test.go +++ b/github/actions_runners_test.go @@ -65,7 +65,7 @@ func TestActionsService_GenerateOrgJITConfig(t *testing.T) { mux.HandleFunc("/orgs/o/actions/runners/generate-jitconfig", func(w http.ResponseWriter, r *http.Request) { v := new(GenerateJITConfigRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") if !cmp.Equal(v, input) { @@ -109,7 +109,7 @@ func TestActionsService_GenerateRepoJITConfig(t *testing.T) { mux.HandleFunc("/repos/o/r/actions/runners/generate-jitconfig", func(w http.ResponseWriter, r *http.Request) { v := new(GenerateJITConfigRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") if !cmp.Equal(v, input) { diff --git a/github/actions_secrets.go b/github/actions_secrets.go index 316badb70d6..49985e12afa 100644 --- a/github/actions_secrets.go +++ b/github/actions_secrets.go @@ -23,7 +23,7 @@ type PublicKey struct { // do not error out when unmarshaling. func (p *PublicKey) UnmarshalJSON(data []byte) error { var pk struct { - KeyID interface{} `json:"key_id,string"` + KeyID interface{} `json:"key_id"` Key *string `json:"key"` } diff --git a/github/actions_workflow_runs_test.go b/github/actions_workflow_runs_test.go index 3104e6dfafd..92cd3ad4f2f 100644 --- a/github/actions_workflow_runs_test.go +++ b/github/actions_workflow_runs_test.go @@ -1247,7 +1247,7 @@ func TestActionService_PendingDeployments(t *testing.T) { 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) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") if !cmp.Equal(v, input) { diff --git a/github/actions_workflows_test.go b/github/actions_workflows_test.go index 5e0dbbc9c13..66ad164f4ac 100644 --- a/github/actions_workflows_test.go +++ b/github/actions_workflows_test.go @@ -243,7 +243,7 @@ func TestActionsService_CreateWorkflowDispatchEventByID(t *testing.T) { } mux.HandleFunc("/repos/o/r/actions/workflows/72844/dispatches", func(w http.ResponseWriter, r *http.Request) { var v CreateWorkflowDispatchEventRequest - json.NewDecoder(r.Body).Decode(&v) + assertNilError(t, json.NewDecoder(r.Body).Decode(&v)) testMethod(t, r, "POST") if !cmp.Equal(v, event) { @@ -287,7 +287,7 @@ func TestActionsService_CreateWorkflowDispatchEventByFileName(t *testing.T) { } mux.HandleFunc("/repos/o/r/actions/workflows/main.yml/dispatches", func(w http.ResponseWriter, r *http.Request) { var v CreateWorkflowDispatchEventRequest - json.NewDecoder(r.Body).Decode(&v) + assertNilError(t, json.NewDecoder(r.Body).Decode(&v)) testMethod(t, r, "POST") if !cmp.Equal(v, event) { diff --git a/github/activity_notifications_test.go b/github/activity_notifications_test.go index 830c8b10cf8..815238ebb5e 100644 --- a/github/activity_notifications_test.go +++ b/github/activity_notifications_test.go @@ -251,7 +251,7 @@ func TestActivityService_SetThreadSubscription(t *testing.T) { mux.HandleFunc("/notifications/threads/1/subscription", func(w http.ResponseWriter, r *http.Request) { v := new(Subscription) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PUT") if !cmp.Equal(v, input) { diff --git a/github/activity_test.go b/github/activity_test.go index ef7cf32fca5..e2d800220d8 100644 --- a/github/activity_test.go +++ b/github/activity_test.go @@ -21,7 +21,7 @@ func TestActivityService_List(t *testing.T) { testMethod(t, r, "GET") w.WriteHeader(http.StatusOK) - w.Write(feedsJSON) + assertWrite(t, w, feedsJSON) }) ctx := context.Background() diff --git a/github/activity_watching_test.go b/github/activity_watching_test.go index 15b0f330783..da43f5a481e 100644 --- a/github/activity_watching_test.go +++ b/github/activity_watching_test.go @@ -196,7 +196,7 @@ func TestActivityService_SetRepositorySubscription(t *testing.T) { mux.HandleFunc("/repos/o/r/subscription", func(w http.ResponseWriter, r *http.Request) { v := new(Subscription) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PUT") if !cmp.Equal(v, input) { diff --git a/github/admin_orgs_test.go b/github/admin_orgs_test.go index 0282425bf06..55963441c7a 100644 --- a/github/admin_orgs_test.go +++ b/github/admin_orgs_test.go @@ -25,7 +25,7 @@ func TestAdminOrgs_Create(t *testing.T) { mux.HandleFunc("/admin/organizations", func(w http.ResponseWriter, r *http.Request) { v := new(createOrgRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") want := &createOrgRequest{Login: String("github"), Admin: String("ghAdmin")} @@ -67,7 +67,7 @@ func TestAdminOrgs_Rename(t *testing.T) { mux.HandleFunc("/admin/organizations/o", func(w http.ResponseWriter, r *http.Request) { v := new(renameOrgRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") want := &renameOrgRequest{Login: String("the-new-octocats")} @@ -105,7 +105,7 @@ func TestAdminOrgs_RenameByName(t *testing.T) { mux.HandleFunc("/admin/organizations/o", func(w http.ResponseWriter, r *http.Request) { v := new(renameOrgRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") want := &renameOrgRequest{Login: String("the-new-octocats")} diff --git a/github/admin_test.go b/github/admin_test.go index 207121c35cc..dbe0bd2802b 100644 --- a/github/admin_test.go +++ b/github/admin_test.go @@ -25,7 +25,7 @@ func TestAdminService_UpdateUserLDAPMapping(t *testing.T) { mux.HandleFunc("/admin/ldap/users/u/mapping", func(w http.ResponseWriter, r *http.Request) { v := new(UserLDAPMapping) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") if !cmp.Equal(v, input) { @@ -73,7 +73,7 @@ func TestAdminService_UpdateTeamLDAPMapping(t *testing.T) { mux.HandleFunc("/admin/ldap/teams/1/mapping", func(w http.ResponseWriter, r *http.Request) { v := new(TeamLDAPMapping) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") if !cmp.Equal(v, input) { diff --git a/github/admin_users_test.go b/github/admin_users_test.go index 354943d50a2..2dac611709e 100644 --- a/github/admin_users_test.go +++ b/github/admin_users_test.go @@ -22,7 +22,7 @@ func TestAdminUsers_Create(t *testing.T) { mux.HandleFunc("/admin/users", func(w http.ResponseWriter, r *http.Request) { v := new(createUserRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") want := &createUserRequest{Login: String("github"), Email: String("email@domain.com")} diff --git a/github/apps_test.go b/github/apps_test.go index d3e7c434233..f87d5006873 100644 --- a/github/apps_test.go +++ b/github/apps_test.go @@ -400,7 +400,7 @@ func TestAppsService_CreateInstallationTokenWithOptions(t *testing.T) { mux.HandleFunc("/app/installations/1/access_tokens", func(w http.ResponseWriter, r *http.Request) { v := new(InstallationTokenOptions) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) if !cmp.Equal(v, installationTokenOptions) { t.Errorf("request sent %+v, want %+v", v, installationTokenOptions) @@ -431,7 +431,7 @@ func TestAppsService_CreateAttachement(t *testing.T) { testHeader(t, r, "Accept", mediaTypeContentAttachmentsPreview) w.WriteHeader(http.StatusOK) - w.Write([]byte(`{"id":1,"title":"title1","body":"body1"}`)) + assertWrite(t, w, []byte(`{"id":1,"title":"title1","body":"body1"}`)) }) ctx := context.Background() diff --git a/github/code-scanning_test.go b/github/code-scanning_test.go index e42f1d8b37f..4fbe45e7813 100644 --- a/github/code-scanning_test.go +++ b/github/code-scanning_test.go @@ -60,7 +60,7 @@ func TestCodeScanningService_UploadSarif(t *testing.T) { mux.HandleFunc("/repos/o/r/code-scanning/sarifs", func(w http.ResponseWriter, r *http.Request) { v := new(SarifAnalysis) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") want := &SarifAnalysis{CommitSHA: String("abc"), Ref: String("ref/head/main"), Sarif: String("abc"), CheckoutURI: String("uri"), StartedAt: &Timestamp{time.Date(2006, time.January, 02, 15, 04, 05, 0, time.UTC)}, ToolName: String("codeql-cli")} if !cmp.Equal(v, want) { @@ -316,7 +316,7 @@ func TestCodeScanningService_ListAlertsForOrg(t *testing.T) { }, } if !cmp.Equal(alerts, want) { - t.Errorf("CodeScanning.ListAlertsForOrg returned %+v, want %+v", *&alerts, *&want) + t.Errorf("CodeScanning.ListAlertsForOrg returned %+v, want %+v", alerts, want) } const methodName = "ListAlertsForOrg" @@ -442,7 +442,7 @@ func TestCodeScanningService_ListAlertsForOrgLisCursorOptions(t *testing.T) { }, } if !cmp.Equal(alerts, want) { - t.Errorf("CodeScanning.ListAlertsForOrg returned %+v, want %+v", *&alerts, *&want) + t.Errorf("CodeScanning.ListAlertsForOrg returned %+v, want %+v", alerts, want) } const methodName = "ListAlertsForOrg" diff --git a/github/enterprise_actions_runners_test.go b/github/enterprise_actions_runners_test.go index a1d3f17a895..36b2aaefe89 100644 --- a/github/enterprise_actions_runners_test.go +++ b/github/enterprise_actions_runners_test.go @@ -24,7 +24,10 @@ func TestEnterpriseService_GenerateEnterpriseJITConfig(t *testing.T) { mux.HandleFunc("/enterprises/o/actions/runners/generate-jitconfig", func(w http.ResponseWriter, r *http.Request) { v := new(GenerateJITConfigRequest) - json.NewDecoder(r.Body).Decode(v) + err := json.NewDecoder(r.Body).Decode(v) + if err != nil { + t.Errorf("Request body decode failed: %v", err) + } testMethod(t, r, "POST") if !cmp.Equal(v, input) { diff --git a/github/enterprise_code_security_and_analysis_test.go b/github/enterprise_code_security_and_analysis_test.go index 24bf89c51e3..25dbd941702 100644 --- a/github/enterprise_code_security_and_analysis_test.go +++ b/github/enterprise_code_security_and_analysis_test.go @@ -77,7 +77,7 @@ func TestEnterpriseService_UpdateCodeSecurityAndAnalysis(t *testing.T) { mux.HandleFunc("/enterprises/e/code_security_and_analysis", func(w http.ResponseWriter, r *http.Request) { v := new(EnterpriseSecurityAnalysisSettings) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") if !cmp.Equal(v, input) { diff --git a/github/gists_comments_test.go b/github/gists_comments_test.go index c9c97068979..593c9eeddc6 100644 --- a/github/gists_comments_test.go +++ b/github/gists_comments_test.go @@ -169,7 +169,7 @@ func TestGistsService_CreateComment(t *testing.T) { mux.HandleFunc("/gists/1/comments", func(w http.ResponseWriter, r *http.Request) { v := new(GistComment) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") if !cmp.Equal(v, input) { @@ -222,7 +222,7 @@ func TestGistsService_EditComment(t *testing.T) { mux.HandleFunc("/gists/1/comments/2", func(w http.ResponseWriter, r *http.Request) { v := new(GistComment) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") if !cmp.Equal(v, input) { diff --git a/github/gists_test.go b/github/gists_test.go index 3066d585a25..995363ec4cc 100644 --- a/github/gists_test.go +++ b/github/gists_test.go @@ -484,7 +484,7 @@ func TestGistsService_Create(t *testing.T) { mux.HandleFunc("/gists", func(w http.ResponseWriter, r *http.Request) { v := new(Gist) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") if !cmp.Equal(v, input) { @@ -546,7 +546,7 @@ func TestGistsService_Edit(t *testing.T) { mux.HandleFunc("/gists/1", func(w http.ResponseWriter, r *http.Request) { v := new(Gist) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") if !cmp.Equal(v, input) { diff --git a/github/git_blobs_test.go b/github/git_blobs_test.go index c2cc455ab89..94cdd34e7a3 100644 --- a/github/git_blobs_test.go +++ b/github/git_blobs_test.go @@ -118,7 +118,7 @@ func TestGitService_CreateBlob(t *testing.T) { mux.HandleFunc("/repos/o/r/git/blobs", func(w http.ResponseWriter, r *http.Request) { v := new(Blob) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") diff --git a/github/git_commits_test.go b/github/git_commits_test.go index efdb0a27dc8..ddb1672ea72 100644 --- a/github/git_commits_test.go +++ b/github/git_commits_test.go @@ -174,7 +174,7 @@ func TestGitService_CreateCommit(t *testing.T) { mux.HandleFunc("/repos/o/r/git/commits", func(w http.ResponseWriter, r *http.Request) { v := new(createCommit) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") @@ -232,7 +232,7 @@ func TestGitService_CreateSignedCommit(t *testing.T) { mux.HandleFunc("/repos/o/r/git/commits", func(w http.ResponseWriter, r *http.Request) { v := new(createCommit) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") @@ -335,7 +335,7 @@ Commit Message.`) mux.HandleFunc("/repos/o/r/git/commits", func(w http.ResponseWriter, r *http.Request) { v := new(createCommit) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") diff --git a/github/git_refs_test.go b/github/git_refs_test.go index d37504945d1..1014a44aa5b 100644 --- a/github/git_refs_test.go +++ b/github/git_refs_test.go @@ -393,7 +393,7 @@ func TestGitService_CreateRef(t *testing.T) { mux.HandleFunc("/repos/o/r/git/refs", func(w http.ResponseWriter, r *http.Request) { v := new(createRefRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") if !cmp.Equal(v, args) { @@ -482,7 +482,7 @@ func TestGitService_UpdateRef(t *testing.T) { mux.HandleFunc("/repos/o/r/git/refs/heads/b", func(w http.ResponseWriter, r *http.Request) { v := new(updateRefRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") if !cmp.Equal(v, args) { @@ -635,7 +635,7 @@ func TestGitService_UpdateRef_pathEscape(t *testing.T) { mux.HandleFunc("/repos/o/r/git/refs/heads/b#1", func(w http.ResponseWriter, r *http.Request) { v := new(updateRefRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") if !cmp.Equal(v, args) { diff --git a/github/git_tags_test.go b/github/git_tags_test.go index 0d45ee26893..44084141a06 100644 --- a/github/git_tags_test.go +++ b/github/git_tags_test.go @@ -58,7 +58,7 @@ func TestGitService_CreateTag(t *testing.T) { mux.HandleFunc("/repos/o/r/git/tags", func(w http.ResponseWriter, r *http.Request) { v := new(createTagRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") if !cmp.Equal(v, input) { diff --git a/github/github.go b/github/github.go index df01144460f..e16bb084466 100644 --- a/github/github.go +++ b/github/github.go @@ -810,7 +810,7 @@ func (c *Client) BareDo(ctx context.Context, req *http.Request) (*Response, erro }, err } // If we've hit a secondary rate limit, don't make further requests before Retry After. - if err := c.checkSecondaryRateLimitBeforeDo(ctx, req); err != nil { + if err := c.checkSecondaryRateLimitBeforeDo(req); err != nil { return &Response{ Response: err.Response, }, err @@ -942,7 +942,7 @@ func (c *Client) checkRateLimitBeforeDo(req *http.Request, rateLimitCategory rat // current client state in order to quickly check if *AbuseRateLimitError can be immediately returned // from Client.Do, and if so, returns it so that Client.Do can skip making a network API call unnecessarily. // Otherwise it returns nil, and Client.Do should proceed normally. -func (c *Client) checkSecondaryRateLimitBeforeDo(ctx context.Context, req *http.Request) *AbuseRateLimitError { +func (c *Client) checkSecondaryRateLimitBeforeDo(req *http.Request) *AbuseRateLimitError { c.rateMu.Lock() secondary := c.secondaryRateLimitReset c.rateMu.Unlock() @@ -1219,7 +1219,11 @@ func CheckResponse(r *http.Response) error { errorResponse := &ErrorResponse{Response: r} data, err := io.ReadAll(r.Body) if err == nil && data != nil { - json.Unmarshal(data, errorResponse) + err = json.Unmarshal(data, errorResponse) + if err != nil { + // reset the response as if this never happened + errorResponse = &ErrorResponse{Response: r} + } } // Re-populate error response body because GitHub error responses are often // undocumented and inconsistent. @@ -1574,7 +1578,7 @@ func (c *Client) roundTripWithOptionalFollowRedirect(ctx context.Context, u stri // If redirect response is returned, follow it if followRedirects && resp.StatusCode == http.StatusMovedPermanently { - resp.Body.Close() + _ = resp.Body.Close() u = resp.Header.Get("Location") resp, err = c.roundTripWithOptionalFollowRedirect(ctx, u, false, opts...) } diff --git a/github/github_test.go b/github/github_test.go index af506e65243..7d92946dfd0 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -109,7 +109,7 @@ func testFormValues(t *testing.T, r *http.Request, values values) { want.Set(k, v) } - r.ParseForm() + assertNilError(t, r.ParseForm()) if got := r.Form; !cmp.Equal(got, want) { t.Errorf("Request parameters: %v, want %v", got, want) } @@ -275,6 +275,19 @@ func testErrorResponseForStatusCode(t *testing.T, code int) { } } +func assertNilError(t *testing.T, err error) { + t.Helper() + if err != nil { + t.Errorf("unexpected error: %v", err) + } +} + +func assertWrite(t *testing.T, w io.Writer, data []byte) { + t.Helper() + _, err := w.Write(data) + assertNilError(t, err) +} + func TestNewClient(t *testing.T) { c := NewClient(nil) @@ -991,7 +1004,8 @@ func TestDo(t *testing.T) { req, _ := client.NewRequest("GET", ".", nil) body := new(foo) ctx := context.Background() - client.Do(ctx, req, body) + _, err := client.Do(ctx, req, body) + assertNilError(t, err) want := &foo{"a"} if !cmp.Equal(body, want) { @@ -1266,11 +1280,14 @@ func TestDo_rateLimit_noNetworkCall(t *testing.T) { // First request is made, and it makes the client aware of rate reset time being in the future. req, _ := client.NewRequest("GET", "first", nil) ctx := context.Background() - client.Do(ctx, req, nil) + _, err := client.Do(ctx, req, nil) + if err == nil { + t.Error("Expected error to be returned.") + } // Second request should not cause a network call to be made, since client can predict a rate limit error. req, _ = client.NewRequest("GET", "second", nil) - _, err := client.Do(ctx, req, nil) + _, err = client.Do(ctx, req, nil) if madeNetworkCall { t.Fatal("Network call was made, even though rate limit is known to still be exceeded.") @@ -1323,11 +1340,14 @@ func TestDo_rateLimit_ignoredFromCache(t *testing.T) { // First request is made so afterwards we can check the returned rate limit headers were ignored. req, _ := client.NewRequest("GET", "first", nil) ctx := context.Background() - client.Do(ctx, req, nil) + _, err := client.Do(ctx, req, nil) + if err == nil { + t.Error("Expected error to be returned.") + } // Second request should not by hindered by rate limits. req, _ = client.NewRequest("GET", "second", nil) - _, err := client.Do(ctx, req, nil) + _, err = client.Do(ctx, req, nil) if err != nil { t.Fatalf("Second request failed, even though the rate limits from the cache should've been ignored: %v", err) @@ -2393,7 +2413,8 @@ func TestUnauthenticatedRateLimitedTransport(t *testing.T) { unauthedClient.BaseURL = client.BaseURL req, _ := unauthedClient.NewRequest("GET", ".", nil) ctx := context.Background() - unauthedClient.Do(ctx, req, nil) + _, err := unauthedClient.Do(ctx, req, nil) + assertNilError(t, err) } func TestUnauthenticatedRateLimitedTransport_missingFields(t *testing.T) { @@ -2468,7 +2489,8 @@ func TestBasicAuthTransport(t *testing.T) { basicAuthClient.BaseURL = client.BaseURL req, _ := basicAuthClient.NewRequest("GET", ".", nil) ctx := context.Background() - basicAuthClient.Do(ctx, req, nil) + _, err := basicAuthClient.Do(ctx, req, nil) + assertNilError(t, err) } func TestBasicAuthTransport_transport(t *testing.T) { diff --git a/github/interactions_orgs_test.go b/github/interactions_orgs_test.go index 9258c92f502..f014bd5feed 100644 --- a/github/interactions_orgs_test.go +++ b/github/interactions_orgs_test.go @@ -59,7 +59,7 @@ func TestInteractionsService_UpdateRestrictionsForOrg(t *testing.T) { mux.HandleFunc("/orgs/o/interaction-limits", func(w http.ResponseWriter, r *http.Request) { v := new(InteractionRestriction) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PUT") testHeader(t, r, "Accept", mediaTypeInteractionRestrictionsPreview) diff --git a/github/interactions_repos_test.go b/github/interactions_repos_test.go index 0a9f51245e4..fd48ae7130d 100644 --- a/github/interactions_repos_test.go +++ b/github/interactions_repos_test.go @@ -59,7 +59,7 @@ func TestInteractionsService_UpdateRestrictionsForRepo(t *testing.T) { mux.HandleFunc("/repos/o/r/interaction-limits", func(w http.ResponseWriter, r *http.Request) { v := new(InteractionRestriction) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PUT") testHeader(t, r, "Accept", mediaTypeInteractionRestrictionsPreview) diff --git a/github/issue_import_test.go b/github/issue_import_test.go index 48f96ab3a5c..17c7c17ffe4 100644 --- a/github/issue_import_test.go +++ b/github/issue_import_test.go @@ -38,14 +38,14 @@ func TestIssueImportService_Create(t *testing.T) { mux.HandleFunc("/repos/o/r/import/issues", func(w http.ResponseWriter, r *http.Request) { v := new(IssueImportRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") testHeader(t, r, "Accept", mediaTypeIssueImportAPI) if !cmp.Equal(v, input) { t.Errorf("Request body = %+v, want %+v", v, input) } - w.Write(issueImportResponseJSON) + assertWrite(t, w, issueImportResponseJSON) }) ctx := context.Background() @@ -96,7 +96,7 @@ func TestIssueImportService_Create_defered(t *testing.T) { mux.HandleFunc("/repos/o/r/import/issues", func(w http.ResponseWriter, r *http.Request) { v := new(IssueImportRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") testHeader(t, r, "Accept", mediaTypeIssueImportAPI) if !cmp.Equal(v, input) { @@ -104,7 +104,7 @@ func TestIssueImportService_Create_defered(t *testing.T) { } w.WriteHeader(http.StatusAccepted) - w.Write(issueImportResponseJSON) + assertWrite(t, w, issueImportResponseJSON) }) ctx := context.Background() @@ -142,7 +142,7 @@ func TestIssueImportService_Create_badResponse(t *testing.T) { mux.HandleFunc("/repos/o/r/import/issues", func(w http.ResponseWriter, r *http.Request) { v := new(IssueImportRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") testHeader(t, r, "Accept", mediaTypeIssueImportAPI) if !cmp.Equal(v, input) { @@ -150,7 +150,7 @@ func TestIssueImportService_Create_badResponse(t *testing.T) { } w.WriteHeader(http.StatusAccepted) - w.Write([]byte("{[}")) + assertWrite(t, w, []byte("{[}")) }) ctx := context.Background() @@ -178,7 +178,7 @@ func TestIssueImportService_CheckStatus(t *testing.T) { testMethod(t, r, "GET") testHeader(t, r, "Accept", mediaTypeIssueImportAPI) w.WriteHeader(http.StatusOK) - w.Write(issueImportResponseJSON) + assertWrite(t, w, issueImportResponseJSON) }) ctx := context.Background() @@ -224,7 +224,7 @@ func TestIssueImportService_CheckStatusSince(t *testing.T) { testMethod(t, r, "GET") testHeader(t, r, "Accept", mediaTypeIssueImportAPI) w.WriteHeader(http.StatusOK) - w.Write([]byte(fmt.Sprintf("[%s]", issueImportResponseJSON))) + assertWrite(t, w, []byte(fmt.Sprintf("[%s]", issueImportResponseJSON))) }) ctx := context.Background() @@ -261,7 +261,7 @@ func TestIssueImportService_CheckStatusSince_badResponse(t *testing.T) { testMethod(t, r, "GET") testHeader(t, r, "Accept", mediaTypeIssueImportAPI) w.WriteHeader(http.StatusOK) - w.Write([]byte("{badly-formed JSON")) + assertWrite(t, w, []byte("{badly-formed JSON")) }) ctx := context.Background() diff --git a/github/issues_assignees_test.go b/github/issues_assignees_test.go index 26773b1154f..5273136143e 100644 --- a/github/issues_assignees_test.go +++ b/github/issues_assignees_test.go @@ -176,7 +176,7 @@ func TestIssuesService_AddAssignees(t *testing.T) { var assignees struct { Assignees []string `json:"assignees,omitempty"` } - json.NewDecoder(r.Body).Decode(&assignees) + assertNilError(t, json.NewDecoder(r.Body).Decode(&assignees)) testMethod(t, r, "POST") want := []string{"user1", "user2"} @@ -220,7 +220,7 @@ func TestIssuesService_RemoveAssignees(t *testing.T) { var assignees struct { Assignees []string `json:"assignees,omitempty"` } - json.NewDecoder(r.Body).Decode(&assignees) + assertNilError(t, json.NewDecoder(r.Body).Decode(&assignees)) testMethod(t, r, "DELETE") want := []string{"user1", "user2"} diff --git a/github/issues_comments_test.go b/github/issues_comments_test.go index d35deedaf17..70f923481b5 100644 --- a/github/issues_comments_test.go +++ b/github/issues_comments_test.go @@ -163,7 +163,7 @@ func TestIssuesService_CreateComment(t *testing.T) { mux.HandleFunc("/repos/o/r/issues/1/comments", func(w http.ResponseWriter, r *http.Request) { v := new(IssueComment) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") if !cmp.Equal(v, input) { @@ -216,7 +216,7 @@ func TestIssuesService_EditComment(t *testing.T) { mux.HandleFunc("/repos/o/r/issues/comments/1", func(w http.ResponseWriter, r *http.Request) { v := new(IssueComment) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") if !cmp.Equal(v, input) { diff --git a/github/issues_labels_test.go b/github/issues_labels_test.go index 06f4c6b6768..88b7be7168e 100644 --- a/github/issues_labels_test.go +++ b/github/issues_labels_test.go @@ -113,7 +113,7 @@ func TestIssuesService_CreateLabel(t *testing.T) { mux.HandleFunc("/repos/o/r/labels", func(w http.ResponseWriter, r *http.Request) { v := new(Label) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") if !cmp.Equal(v, input) { @@ -166,7 +166,7 @@ func TestIssuesService_EditLabel(t *testing.T) { mux.HandleFunc("/repos/o/r/labels/n", func(w http.ResponseWriter, r *http.Request) { v := new(Label) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") if !cmp.Equal(v, input) { @@ -302,7 +302,7 @@ func TestIssuesService_AddLabelsToIssue(t *testing.T) { mux.HandleFunc("/repos/o/r/issues/1/labels", func(w http.ResponseWriter, r *http.Request) { var v []string - json.NewDecoder(r.Body).Decode(&v) + assertNilError(t, json.NewDecoder(r.Body).Decode(&v)) testMethod(t, r, "POST") if !cmp.Equal(v, input) { @@ -389,7 +389,7 @@ func TestIssuesService_ReplaceLabelsForIssue(t *testing.T) { mux.HandleFunc("/repos/o/r/issues/1/labels", func(w http.ResponseWriter, r *http.Request) { var v []string - json.NewDecoder(r.Body).Decode(&v) + assertNilError(t, json.NewDecoder(r.Body).Decode(&v)) testMethod(t, r, "PUT") if !cmp.Equal(v, input) { diff --git a/github/issues_milestones_test.go b/github/issues_milestones_test.go index b6472f34688..decaf2c1127 100644 --- a/github/issues_milestones_test.go +++ b/github/issues_milestones_test.go @@ -118,7 +118,7 @@ func TestIssuesService_CreateMilestone(t *testing.T) { mux.HandleFunc("/repos/o/r/milestones", func(w http.ResponseWriter, r *http.Request) { v := new(Milestone) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") if !cmp.Equal(v, input) { @@ -171,7 +171,7 @@ func TestIssuesService_EditMilestone(t *testing.T) { mux.HandleFunc("/repos/o/r/milestones/1", func(w http.ResponseWriter, r *http.Request) { v := new(Milestone) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") if !cmp.Equal(v, input) { diff --git a/github/issues_test.go b/github/issues_test.go index 37b2c2ad0f7..aa767d6508a 100644 --- a/github/issues_test.go +++ b/github/issues_test.go @@ -265,7 +265,7 @@ func TestIssuesService_Create(t *testing.T) { mux.HandleFunc("/repos/o/r/issues", func(w http.ResponseWriter, r *http.Request) { v := new(IssueRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") if !cmp.Equal(v, input) { @@ -318,7 +318,7 @@ func TestIssuesService_Edit(t *testing.T) { mux.HandleFunc("/repos/o/r/issues/1", func(w http.ResponseWriter, r *http.Request) { v := new(IssueRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") if !cmp.Equal(v, input) { diff --git a/github/migrations_source_import_test.go b/github/migrations_source_import_test.go index bcb49de1c90..d357ff10b8a 100644 --- a/github/migrations_source_import_test.go +++ b/github/migrations_source_import_test.go @@ -28,7 +28,7 @@ func TestMigrationService_StartImport(t *testing.T) { mux.HandleFunc("/repos/o/r/import", func(w http.ResponseWriter, r *http.Request) { v := new(Import) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PUT") if !cmp.Equal(v, input) { @@ -111,7 +111,7 @@ func TestMigrationService_UpdateImport(t *testing.T) { mux.HandleFunc("/repos/o/r/import", func(w http.ResponseWriter, r *http.Request) { v := new(Import) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") if !cmp.Equal(v, input) { @@ -192,7 +192,7 @@ func TestMigrationService_MapCommitAuthor(t *testing.T) { mux.HandleFunc("/repos/o/r/import/authors/1", func(w http.ResponseWriter, r *http.Request) { v := new(SourceImportAuthor) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") if !cmp.Equal(v, input) { @@ -235,7 +235,7 @@ func TestMigrationService_SetLFSPreference(t *testing.T) { mux.HandleFunc("/repos/o/r/import/lfs", func(w http.ResponseWriter, r *http.Request) { v := new(Import) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") if !cmp.Equal(v, input) { diff --git a/github/migrations_test.go b/github/migrations_test.go index 4a5c0fc6c06..7ddc6300a8a 100644 --- a/github/migrations_test.go +++ b/github/migrations_test.go @@ -24,7 +24,7 @@ func TestMigrationService_StartMigration(t *testing.T) { testHeader(t, r, "Accept", mediaTypeMigrationsPreview) w.WriteHeader(http.StatusCreated) - w.Write(migrationJSON) + assertWrite(t, w, migrationJSON) }) opt := &MigrationOptions{ @@ -64,7 +64,7 @@ func TestMigrationService_ListMigrations(t *testing.T) { testHeader(t, r, "Accept", mediaTypeMigrationsPreview) w.WriteHeader(http.StatusOK) - w.Write([]byte(fmt.Sprintf("[%s]", migrationJSON))) + assertWrite(t, w, []byte(fmt.Sprintf("[%s]", migrationJSON))) }) ctx := context.Background() @@ -100,7 +100,7 @@ func TestMigrationService_MigrationStatus(t *testing.T) { testHeader(t, r, "Accept", mediaTypeMigrationsPreview) w.WriteHeader(http.StatusOK) - w.Write(migrationJSON) + assertWrite(t, w, migrationJSON) }) ctx := context.Background() @@ -141,7 +141,7 @@ func TestMigrationService_MigrationArchiveURL(t *testing.T) { testMethod(t, r, "GET") w.WriteHeader(http.StatusOK) - w.Write([]byte("0123456789abcdef")) + assertWrite(t, w, []byte("0123456789abcdef")) }) ctx := context.Background() diff --git a/github/migrations_user_test.go b/github/migrations_user_test.go index 358bb9bdcf3..0a303ce6348 100644 --- a/github/migrations_user_test.go +++ b/github/migrations_user_test.go @@ -24,7 +24,7 @@ func TestMigrationService_StartUserMigration(t *testing.T) { testHeader(t, r, "Accept", mediaTypeMigrationsPreview) w.WriteHeader(http.StatusCreated) - w.Write(userMigrationJSON) + assertWrite(t, w, userMigrationJSON) }) opt := &UserMigrationOptions{ @@ -62,7 +62,7 @@ func TestMigrationService_ListUserMigrations(t *testing.T) { testHeader(t, r, "Accept", mediaTypeMigrationsPreview) w.WriteHeader(http.StatusOK) - w.Write([]byte(fmt.Sprintf("[%s]", userMigrationJSON))) + assertWrite(t, w, []byte(fmt.Sprintf("[%s]", userMigrationJSON))) }) ctx := context.Background() @@ -95,7 +95,7 @@ func TestMigrationService_UserMigrationStatus(t *testing.T) { testHeader(t, r, "Accept", mediaTypeMigrationsPreview) w.WriteHeader(http.StatusOK) - w.Write(userMigrationJSON) + assertWrite(t, w, userMigrationJSON) }) ctx := context.Background() diff --git a/github/misc_test.go b/github/misc_test.go index 4e88ec54529..69427ebf246 100644 --- a/github/misc_test.go +++ b/github/misc_test.go @@ -26,7 +26,7 @@ func TestMarkdown(t *testing.T) { } mux.HandleFunc("/markdown", func(w http.ResponseWriter, r *http.Request) { v := new(markdownRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") if !cmp.Equal(v, input) { diff --git a/github/orgs_actions_allowed_test.go b/github/orgs_actions_allowed_test.go index 6af05213523..6461dcf9a39 100644 --- a/github/orgs_actions_allowed_test.go +++ b/github/orgs_actions_allowed_test.go @@ -56,7 +56,7 @@ func TestOrganizationsService_EditActionsAllowed(t *testing.T) { mux.HandleFunc("/orgs/o/actions/permissions/selected-actions", func(w http.ResponseWriter, r *http.Request) { v := new(ActionsAllowed) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PUT") if !cmp.Equal(v, input) { diff --git a/github/orgs_actions_permissions_test.go b/github/orgs_actions_permissions_test.go index 9664c79eda8..d35965eccb1 100644 --- a/github/orgs_actions_permissions_test.go +++ b/github/orgs_actions_permissions_test.go @@ -57,7 +57,7 @@ func TestOrganizationsService_EditActionsPermissions(t *testing.T) { mux.HandleFunc("/orgs/o/actions/permissions", func(w http.ResponseWriter, r *http.Request) { v := new(ActionsPermissions) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PUT") if !cmp.Equal(v, input) { diff --git a/github/orgs_hooks_configuration_test.go b/github/orgs_hooks_configuration_test.go index a79f8a56c57..337c721f59e 100644 --- a/github/orgs_hooks_configuration_test.go +++ b/github/orgs_hooks_configuration_test.go @@ -72,7 +72,7 @@ func TestOrganizationsService_EditHookConfiguration(t *testing.T) { mux.HandleFunc("/orgs/o/hooks/1/config", func(w http.ResponseWriter, r *http.Request) { v := new(HookConfig) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") if !cmp.Equal(v, input) { diff --git a/github/orgs_hooks_test.go b/github/orgs_hooks_test.go index 0fe45565b9c..843f60e1e32 100644 --- a/github/orgs_hooks_test.go +++ b/github/orgs_hooks_test.go @@ -70,7 +70,7 @@ func TestOrganizationsService_CreateHook(t *testing.T) { mux.HandleFunc("/orgs/o/hooks", func(w http.ResponseWriter, r *http.Request) { v := new(createHookRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") want := &createHookRequest{Name: "web"} @@ -159,7 +159,7 @@ func TestOrganizationsService_EditHook(t *testing.T) { mux.HandleFunc("/orgs/o/hooks/1", func(w http.ResponseWriter, r *http.Request) { v := new(Hook) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") if !cmp.Equal(v, input) { diff --git a/github/orgs_members_test.go b/github/orgs_members_test.go index 0b5068e55e5..9526442cda4 100644 --- a/github/orgs_members_test.go +++ b/github/orgs_members_test.go @@ -445,7 +445,7 @@ func TestOrganizationsService_EditOrgMembership_AuthenticatedUser(t *testing.T) mux.HandleFunc("/user/memberships/orgs/o", func(w http.ResponseWriter, r *http.Request) { v := new(Membership) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") if !cmp.Equal(v, input) { @@ -489,7 +489,7 @@ func TestOrganizationsService_EditOrgMembership_SpecifiedUser(t *testing.T) { mux.HandleFunc("/orgs/o/memberships/u", func(w http.ResponseWriter, r *http.Request) { v := new(Membership) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PUT") if !cmp.Equal(v, input) { @@ -647,7 +647,7 @@ func TestOrganizationsService_CreateOrgInvitation(t *testing.T) { mux.HandleFunc("/orgs/o/invitations", func(w http.ResponseWriter, r *http.Request) { v := new(CreateOrgInvitationOptions) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") if !cmp.Equal(v, input) { diff --git a/github/orgs_personal_access_tokens_test.go b/github/orgs_personal_access_tokens_test.go index 93ee1b3db93..9426385f4a6 100644 --- a/github/orgs_personal_access_tokens_test.go +++ b/github/orgs_personal_access_tokens_test.go @@ -25,7 +25,7 @@ func TestOrganizationsService_ReviewPersonalAccessTokenRequest(t *testing.T) { mux.HandleFunc("/orgs/o/personal-access-token-requests/1", func(w http.ResponseWriter, r *http.Request) { v := new(ReviewPersonalAccessTokenRequestOptions) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, http.MethodPost) if !cmp.Equal(v, &input) { diff --git a/github/orgs_projects_test.go b/github/orgs_projects_test.go index 390917d4fac..0853ed9b971 100644 --- a/github/orgs_projects_test.go +++ b/github/orgs_projects_test.go @@ -64,7 +64,7 @@ func TestOrganizationsService_CreateProject(t *testing.T) { testHeader(t, r, "Accept", mediaTypeProjectsPreview) v := &ProjectOptions{} - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) if !cmp.Equal(v, input) { t.Errorf("Request body = %+v, want %+v", v, input) } diff --git a/github/orgs_test.go b/github/orgs_test.go index ca85af25b71..98a6b5257e1 100644 --- a/github/orgs_test.go +++ b/github/orgs_test.go @@ -269,7 +269,7 @@ func TestOrganizationsService_Edit(t *testing.T) { mux.HandleFunc("/orgs/o", func(w http.ResponseWriter, r *http.Request) { v := new(Organization) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testHeader(t, r, "Accept", mediaTypeMemberAllowedRepoCreationTypePreview) testMethod(t, r, "PATCH") diff --git a/github/projects_test.go b/github/projects_test.go index c4ccbd092af..369e121ae03 100644 --- a/github/projects_test.go +++ b/github/projects_test.go @@ -102,7 +102,7 @@ func TestProjectsService_UpdateProject(t *testing.T) { testHeader(t, r, "Accept", mediaTypeProjectsPreview) v := &ProjectOptions{} - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) if !cmp.Equal(v, input) { t.Errorf("Request body = %+v, want %+v", v, input) } @@ -284,7 +284,7 @@ func TestProjectsService_CreateProjectColumn(t *testing.T) { testHeader(t, r, "Accept", mediaTypeProjectsPreview) v := &ProjectColumnOptions{} - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) if !cmp.Equal(v, input) { t.Errorf("Request body = %+v, want %+v", v, input) } @@ -329,7 +329,7 @@ func TestProjectsService_UpdateProjectColumn(t *testing.T) { testHeader(t, r, "Accept", mediaTypeProjectsPreview) v := &ProjectColumnOptions{} - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) if !cmp.Equal(v, input) { t.Errorf("Request body = %+v, want %+v", v, input) } @@ -400,7 +400,7 @@ func TestProjectsService_MoveProjectColumn(t *testing.T) { testHeader(t, r, "Accept", mediaTypeProjectsPreview) v := &ProjectColumnMoveOptions{} - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) if !cmp.Equal(v, input) { t.Errorf("Request body = %+v, want %+v", v, input) } @@ -515,7 +515,7 @@ func TestProjectsService_CreateProjectCard(t *testing.T) { testHeader(t, r, "Accept", mediaTypeProjectsPreview) v := &ProjectCardOptions{} - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) if !cmp.Equal(v, input) { t.Errorf("Request body = %+v, want %+v", v, input) } @@ -563,7 +563,7 @@ func TestProjectsService_UpdateProjectCard(t *testing.T) { testHeader(t, r, "Accept", mediaTypeProjectsPreview) v := &ProjectCardOptions{} - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) if !cmp.Equal(v, input) { t.Errorf("Request body = %+v, want %+v", v, input) } @@ -634,7 +634,7 @@ func TestProjectsService_MoveProjectCard(t *testing.T) { testHeader(t, r, "Accept", mediaTypeProjectsPreview) v := &ProjectCardMoveOptions{} - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) if !cmp.Equal(v, input) { t.Errorf("Request body = %+v, want %+v", v, input) } @@ -670,7 +670,7 @@ func TestProjectsService_AddProjectCollaborator(t *testing.T) { testHeader(t, r, "Accept", mediaTypeProjectsPreview) v := &ProjectCollaboratorOptions{} - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) if !cmp.Equal(v, opt) { t.Errorf("Request body = %+v, want %+v", v, opt) } diff --git a/github/pulls_comments_test.go b/github/pulls_comments_test.go index 47d08d2b779..828651b84ac 100644 --- a/github/pulls_comments_test.go +++ b/github/pulls_comments_test.go @@ -269,7 +269,7 @@ func TestPullRequestsService_CreateComment(t *testing.T) { wantAcceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeMultiLineCommentsPreview} mux.HandleFunc("/repos/o/r/pulls/1/comments", func(w http.ResponseWriter, r *http.Request) { v := new(PullRequestComment) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) // TODO: remove custom Accept header assertion when the API fully launches. testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) @@ -324,7 +324,7 @@ func TestPullRequestsService_CreateCommentInReplyTo(t *testing.T) { mux.HandleFunc("/repos/o/r/pulls/1/comments", func(w http.ResponseWriter, r *http.Request) { v := new(PullRequestComment) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") if !cmp.Equal(v, input) { @@ -368,7 +368,7 @@ func TestPullRequestsService_EditComment(t *testing.T) { mux.HandleFunc("/repos/o/r/pulls/comments/1", func(w http.ResponseWriter, r *http.Request) { v := new(PullRequestComment) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") if !cmp.Equal(v, input) { diff --git a/github/pulls_reviews_test.go b/github/pulls_reviews_test.go index 7931ba05140..bafa9f06a3b 100644 --- a/github/pulls_reviews_test.go +++ b/github/pulls_reviews_test.go @@ -365,7 +365,7 @@ func TestPullRequestsService_CreateReview(t *testing.T) { mux.HandleFunc("/repos/o/r/pulls/1/reviews", func(w http.ResponseWriter, r *http.Request) { v := new(PullRequestReviewRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") if !cmp.Equal(v, input) { @@ -468,7 +468,7 @@ func TestPullRequestsService_CreateReview_addHeader(t *testing.T) { mux.HandleFunc("/repos/o/r/pulls/1/reviews", func(w http.ResponseWriter, r *http.Request) { v := new(PullRequestReviewRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") if !cmp.Equal(v, input) { @@ -532,7 +532,7 @@ func TestPullRequestsService_SubmitReview(t *testing.T) { mux.HandleFunc("/repos/o/r/pulls/1/reviews/1/events", func(w http.ResponseWriter, r *http.Request) { v := new(PullRequestReviewRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") if !cmp.Equal(v, input) { @@ -585,7 +585,7 @@ func TestPullRequestsService_DismissReview(t *testing.T) { mux.HandleFunc("/repos/o/r/pulls/1/reviews/1/dismissals", func(w http.ResponseWriter, r *http.Request) { v := new(PullRequestReviewDismissalRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PUT") if !cmp.Equal(v, input) { diff --git a/github/pulls_test.go b/github/pulls_test.go index 4ea6bfa9d1e..5a9582b896e 100644 --- a/github/pulls_test.go +++ b/github/pulls_test.go @@ -361,7 +361,7 @@ func TestPullRequestsService_Create(t *testing.T) { mux.HandleFunc("/repos/o/r/pulls", func(w http.ResponseWriter, r *http.Request) { v := new(NewPullRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") if !cmp.Equal(v, input) { @@ -488,7 +488,8 @@ func TestPullRequestsService_Edit(t *testing.T) { mux.HandleFunc(fmt.Sprintf("/repos/o/r/pulls/%v", i), func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") testBody(t, r, tt.wantUpdate+"\n") - io.WriteString(w, tt.sendResponse) + _, err := io.WriteString(w, tt.sendResponse) + assertNilError(t, err) madeRequest = true }) diff --git a/github/reactions_test.go b/github/reactions_test.go index f84c3383290..e77631e99a1 100644 --- a/github/reactions_test.go +++ b/github/reactions_test.go @@ -112,7 +112,7 @@ func TestReactionsService_CreateCommentReaction(t *testing.T) { testHeader(t, r, "Accept", mediaTypeReactionsPreview) w.WriteHeader(http.StatusCreated) - w.Write([]byte(`{"id":1,"user":{"login":"l","id":2},"content":"+1"}`)) + assertWrite(t, w, []byte(`{"id":1,"user":{"login":"l","id":2},"content":"+1"}`)) }) ctx := context.Background() @@ -149,7 +149,7 @@ func TestReactionsService_ListIssueReactions(t *testing.T) { testHeader(t, r, "Accept", mediaTypeReactionsPreview) w.WriteHeader(http.StatusOK) - w.Write([]byte(`[{"id":1,"user":{"login":"l","id":2},"content":"+1"}]`)) + assertWrite(t, w, []byte(`[{"id":1,"user":{"login":"l","id":2},"content":"+1"}]`)) }) ctx := context.Background() @@ -193,7 +193,7 @@ func TestReactionsService_CreateIssueReaction(t *testing.T) { testHeader(t, r, "Accept", mediaTypeReactionsPreview) w.WriteHeader(http.StatusCreated) - w.Write([]byte(`{"id":1,"user":{"login":"l","id":2},"content":"+1"}`)) + assertWrite(t, w, []byte(`{"id":1,"user":{"login":"l","id":2},"content":"+1"}`)) }) ctx := context.Background() @@ -230,7 +230,7 @@ func TestReactionsService_ListIssueCommentReactions(t *testing.T) { testHeader(t, r, "Accept", mediaTypeReactionsPreview) w.WriteHeader(http.StatusOK) - w.Write([]byte(`[{"id":1,"user":{"login":"l","id":2},"content":"+1"}]`)) + assertWrite(t, w, []byte(`[{"id":1,"user":{"login":"l","id":2},"content":"+1"}]`)) }) ctx := context.Background() @@ -274,7 +274,7 @@ func TestReactionsService_CreateIssueCommentReaction(t *testing.T) { testHeader(t, r, "Accept", mediaTypeReactionsPreview) w.WriteHeader(http.StatusCreated) - w.Write([]byte(`{"id":1,"user":{"login":"l","id":2},"content":"+1"}`)) + assertWrite(t, w, []byte(`{"id":1,"user":{"login":"l","id":2},"content":"+1"}`)) }) ctx := context.Background() @@ -311,7 +311,7 @@ func TestReactionsService_ListPullRequestCommentReactions(t *testing.T) { testHeader(t, r, "Accept", mediaTypeReactionsPreview) w.WriteHeader(http.StatusOK) - w.Write([]byte(`[{"id":1,"user":{"login":"l","id":2},"content":"+1"}]`)) + assertWrite(t, w, []byte(`[{"id":1,"user":{"login":"l","id":2},"content":"+1"}]`)) }) ctx := context.Background() @@ -355,7 +355,7 @@ func TestReactionsService_CreatePullRequestCommentReaction(t *testing.T) { testHeader(t, r, "Accept", mediaTypeReactionsPreview) w.WriteHeader(http.StatusCreated) - w.Write([]byte(`{"id":1,"user":{"login":"l","id":2},"content":"+1"}`)) + assertWrite(t, w, []byte(`{"id":1,"user":{"login":"l","id":2},"content":"+1"}`)) }) ctx := context.Background() @@ -392,7 +392,7 @@ func TestReactionsService_ListTeamDiscussionReactions(t *testing.T) { testHeader(t, r, "Accept", mediaTypeReactionsPreview) w.WriteHeader(http.StatusOK) - w.Write([]byte(`[{"id":1,"user":{"login":"l","id":2},"content":"+1"}]`)) + assertWrite(t, w, []byte(`[{"id":1,"user":{"login":"l","id":2},"content":"+1"}]`)) }) ctx := context.Background() @@ -436,7 +436,7 @@ func TestReactionsService_CreateTeamDiscussionReaction(t *testing.T) { testHeader(t, r, "Accept", mediaTypeReactionsPreview) w.WriteHeader(http.StatusCreated) - w.Write([]byte(`{"id":1,"user":{"login":"l","id":2},"content":"+1"}`)) + assertWrite(t, w, []byte(`{"id":1,"user":{"login":"l","id":2},"content":"+1"}`)) }) ctx := context.Background() @@ -473,7 +473,7 @@ func TestReactionService_ListTeamDiscussionCommentReactions(t *testing.T) { testHeader(t, r, "Accept", mediaTypeReactionsPreview) w.WriteHeader(http.StatusOK) - w.Write([]byte(`[{"id":1,"user":{"login":"l","id":2},"content":"+1"}]`)) + assertWrite(t, w, []byte(`[{"id":1,"user":{"login":"l","id":2},"content":"+1"}]`)) }) ctx := context.Background() @@ -517,7 +517,7 @@ func TestReactionService_CreateTeamDiscussionCommentReaction(t *testing.T) { testHeader(t, r, "Accept", mediaTypeReactionsPreview) w.WriteHeader(http.StatusCreated) - w.Write([]byte(`{"id":1,"user":{"login":"l","id":2},"content":"+1"}`)) + assertWrite(t, w, []byte(`{"id":1,"user":{"login":"l","id":2},"content":"+1"}`)) }) ctx := context.Background() @@ -878,7 +878,7 @@ func TestReactionService_CreateReleaseReaction(t *testing.T) { testHeader(t, r, "Accept", mediaTypeReactionsPreview) w.WriteHeader(http.StatusCreated) - w.Write([]byte(`{"id":1,"user":{"login":"l","id":2},"content":"rocket"}`)) + assertWrite(t, w, []byte(`{"id":1,"user":{"login":"l","id":2},"content":"rocket"}`)) }) const methodName = "CreateReleaseReaction" diff --git a/github/repos_actions_access_test.go b/github/repos_actions_access_test.go index 7085ac7d5c7..accfe2abf13 100644 --- a/github/repos_actions_access_test.go +++ b/github/repos_actions_access_test.go @@ -57,7 +57,7 @@ func TestRepositoriesService_EditActionsAccessLevel(t *testing.T) { mux.HandleFunc("/repos/o/r/actions/permissions/access", func(w http.ResponseWriter, r *http.Request) { v := new(RepositoryActionsAccessLevel) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PUT") if !cmp.Equal(v, input) { diff --git a/github/repos_actions_allowed_test.go b/github/repos_actions_allowed_test.go index 6736f909f9c..62ff11d966c 100644 --- a/github/repos_actions_allowed_test.go +++ b/github/repos_actions_allowed_test.go @@ -56,7 +56,7 @@ func TestRepositoriesService_EditActionsAllowed(t *testing.T) { mux.HandleFunc("/repos/o/r/actions/permissions/selected-actions", func(w http.ResponseWriter, r *http.Request) { v := new(ActionsAllowed) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PUT") if !cmp.Equal(v, input) { diff --git a/github/repos_actions_permissions_test.go b/github/repos_actions_permissions_test.go index 1d6012f62d2..ecff0d5fbca 100644 --- a/github/repos_actions_permissions_test.go +++ b/github/repos_actions_permissions_test.go @@ -57,7 +57,7 @@ func TestRepositoriesService_EditActionsPermissions(t *testing.T) { mux.HandleFunc("/repos/o/r/actions/permissions", func(w http.ResponseWriter, r *http.Request) { v := new(ActionsPermissionsRepository) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PUT") if !cmp.Equal(v, input) { diff --git a/github/repos_autolinks_test.go b/github/repos_autolinks_test.go index a666dbf3ac7..37de5b5f5a7 100644 --- a/github/repos_autolinks_test.go +++ b/github/repos_autolinks_test.go @@ -69,13 +69,13 @@ func TestRepositoriesService_AddAutolink(t *testing.T) { } mux.HandleFunc("/repos/o/r/autolinks", func(w http.ResponseWriter, r *http.Request) { v := new(AutolinkOptions) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") if !cmp.Equal(v, opt) { t.Errorf("Request body = %+v, want %+v", v, opt) } w.WriteHeader(http.StatusOK) - w.Write([]byte(` + assertWrite(t, w, []byte(` { "key_prefix": "TICKET-", "url_template": "https://example.com/TICKET?query=", diff --git a/github/repos_collaborators_test.go b/github/repos_collaborators_test.go index 8953d36bccf..5aa0ad90f70 100644 --- a/github/repos_collaborators_test.go +++ b/github/repos_collaborators_test.go @@ -268,13 +268,13 @@ func TestRepositoriesService_AddCollaborator(t *testing.T) { opt := &RepositoryAddCollaboratorOptions{Permission: "admin"} mux.HandleFunc("/repos/o/r/collaborators/u", func(w http.ResponseWriter, r *http.Request) { v := new(RepositoryAddCollaboratorOptions) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PUT") if !cmp.Equal(v, opt) { t.Errorf("Request body = %+v, want %+v", v, opt) } w.WriteHeader(http.StatusOK) - w.Write([]byte(`{"permissions": "write","url": "https://api.github.com/user/repository_invitations/1296269","html_url": "https://github.com/octocat/Hello-World/invitations","id":1,"permissions":"write","repository":{"url":"s","name":"r","id":1},"invitee":{"login":"u"},"inviter":{"login":"o"}}`)) + assertWrite(t, w, []byte(`{"permissions": "write","url": "https://api.github.com/user/repository_invitations/1296269","html_url": "https://github.com/octocat/Hello-World/invitations","id":1,"permissions":"write","repository":{"url":"s","name":"r","id":1},"invitee":{"login":"u"},"inviter":{"login":"o"}}`)) }) ctx := context.Background() collaboratorInvitation, _, err := client.Repositories.AddCollaborator(ctx, "o", "r", "u", opt) diff --git a/github/repos_comments_test.go b/github/repos_comments_test.go index b3579bf5a80..00871cd72fb 100644 --- a/github/repos_comments_test.go +++ b/github/repos_comments_test.go @@ -117,7 +117,7 @@ func TestRepositoriesService_CreateComment(t *testing.T) { mux.HandleFunc("/repos/o/r/commits/s/comments", func(w http.ResponseWriter, r *http.Request) { v := new(RepositoryComment) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") if !cmp.Equal(v, input) { @@ -215,7 +215,7 @@ func TestRepositoriesService_UpdateComment(t *testing.T) { mux.HandleFunc("/repos/o/r/comments/1", func(w http.ResponseWriter, r *http.Request) { v := new(RepositoryComment) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") if !cmp.Equal(v, input) { diff --git a/github/repos_commits_test.go b/github/repos_commits_test.go index 5840e677880..fb8b45d4439 100644 --- a/github/repos_commits_test.go +++ b/github/repos_commits_test.go @@ -243,7 +243,7 @@ func TestRepositoriesService_GetCommitSHA1(t *testing.T) { testMethod(t, r, "GET") testHeader(t, r, "Accept", mediaTypeV3SHA) - fmt.Fprintf(w, sha1) + fmt.Fprint(w, sha1) }) ctx := context.Background() @@ -299,7 +299,7 @@ func TestRepositoriesService_NonAlphabetCharacter_GetCommitSHA1(t *testing.T) { testMethod(t, r, "GET") testHeader(t, r, "Accept", mediaTypeV3SHA) - fmt.Fprintf(w, sha1) + fmt.Fprint(w, sha1) }) ctx := context.Background() @@ -339,7 +339,7 @@ func TestRepositoriesService_TrailingPercent_GetCommitSHA1(t *testing.T) { testMethod(t, r, "GET") testHeader(t, r, "Accept", mediaTypeV3SHA) - fmt.Fprintf(w, sha1) + fmt.Fprint(w, sha1) }) ctx := context.Background() diff --git a/github/repos_deployments_test.go b/github/repos_deployments_test.go index c3d6637e37f..4ee2c4f1c32 100644 --- a/github/repos_deployments_test.go +++ b/github/repos_deployments_test.go @@ -97,7 +97,7 @@ func TestRepositoriesService_CreateDeployment(t *testing.T) { mux.HandleFunc("/repos/o/r/deployments", func(w http.ResponseWriter, r *http.Request) { v := new(DeploymentRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") wantAcceptHeaders := []string{mediaTypeDeploymentStatusPreview, mediaTypeExpandDeploymentStatusPreview} @@ -256,7 +256,7 @@ func TestRepositoriesService_CreateDeploymentStatus(t *testing.T) { mux.HandleFunc("/repos/o/r/deployments/1/statuses", func(w http.ResponseWriter, r *http.Request) { v := new(DeploymentStatusRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") wantAcceptHeaders := []string{mediaTypeDeploymentStatusPreview, mediaTypeExpandDeploymentStatusPreview} diff --git a/github/repos_environments_test.go b/github/repos_environments_test.go index 0f93d290882..870c99003a4 100644 --- a/github/repos_environments_test.go +++ b/github/repos_environments_test.go @@ -184,7 +184,7 @@ func TestRepositoriesService_CreateEnvironment(t *testing.T) { mux.HandleFunc("/repos/o/r/environments/e", func(w http.ResponseWriter, r *http.Request) { v := new(CreateUpdateEnvironment) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PUT") want := &CreateUpdateEnvironment{WaitTimer: Int(30), CanAdminsBypass: Bool(true)} @@ -229,7 +229,7 @@ func TestRepositoriesService_CreateEnvironment_noEnterprise(t *testing.T) { mux.HandleFunc("/repos/o/r/environments/e", func(w http.ResponseWriter, r *http.Request) { v := new(CreateUpdateEnvironment) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PUT") if callCount == 0 { @@ -269,7 +269,7 @@ func TestRepositoriesService_createNewEnvNoEnterprise(t *testing.T) { mux.HandleFunc("/repos/o/r/environments/e", func(w http.ResponseWriter, r *http.Request) { v := new(createUpdateEnvironmentNoEnterprise) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PUT") want := &createUpdateEnvironmentNoEnterprise{ diff --git a/github/repos_hooks_configuration_test.go b/github/repos_hooks_configuration_test.go index 0bdf5cbe9e2..27c43d225d8 100644 --- a/github/repos_hooks_configuration_test.go +++ b/github/repos_hooks_configuration_test.go @@ -72,7 +72,7 @@ func TestRepositoriesService_EditHookConfiguration(t *testing.T) { mux.HandleFunc("/repos/o/r/hooks/1/config", func(w http.ResponseWriter, r *http.Request) { v := new(HookConfig) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") if !cmp.Equal(v, input) { diff --git a/github/repos_hooks_test.go b/github/repos_hooks_test.go index 82e8b554d64..84c9f5ee6fa 100644 --- a/github/repos_hooks_test.go +++ b/github/repos_hooks_test.go @@ -23,7 +23,7 @@ func TestRepositoriesService_CreateHook(t *testing.T) { mux.HandleFunc("/repos/o/r/hooks", func(w http.ResponseWriter, r *http.Request) { v := new(createHookRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") want := &createHookRequest{Name: "web"} @@ -167,7 +167,7 @@ func TestRepositoriesService_EditHook(t *testing.T) { mux.HandleFunc("/repos/o/r/hooks/1", func(w http.ResponseWriter, r *http.Request) { v := new(Hook) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") if !cmp.Equal(v, input) { diff --git a/github/repos_keys_test.go b/github/repos_keys_test.go index ba60b6ce9a7..8c29c126ee0 100644 --- a/github/repos_keys_test.go +++ b/github/repos_keys_test.go @@ -113,7 +113,7 @@ func TestRepositoriesService_CreateKey(t *testing.T) { mux.HandleFunc("/repos/o/r/keys", func(w http.ResponseWriter, r *http.Request) { v := new(Key) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") if !cmp.Equal(v, input) { diff --git a/github/repos_merging_test.go b/github/repos_merging_test.go index 09a03a19a61..b4c50178ab9 100644 --- a/github/repos_merging_test.go +++ b/github/repos_merging_test.go @@ -27,7 +27,7 @@ func TestRepositoriesService_Merge(t *testing.T) { mux.HandleFunc("/repos/o/r/merges", func(w http.ResponseWriter, r *http.Request) { v := new(RepositoryMergeRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") if !cmp.Equal(v, input) { @@ -91,7 +91,7 @@ func TestRepositoriesService_MergeUpstream(t *testing.T) { mux.HandleFunc("/repos/o/r/merge-upstream", func(w http.ResponseWriter, r *http.Request) { v := new(RepoMergeUpstreamRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") if !cmp.Equal(v, input) { diff --git a/github/repos_pages_test.go b/github/repos_pages_test.go index 21ffb18127f..5dd735c00fb 100644 --- a/github/repos_pages_test.go +++ b/github/repos_pages_test.go @@ -32,7 +32,7 @@ func TestRepositoriesService_EnablePagesLegacy(t *testing.T) { mux.HandleFunc("/repos/o/r/pages", func(w http.ResponseWriter, r *http.Request) { v := new(createPagesRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") testHeader(t, r, "Accept", mediaTypeEnablePagesAPIPreview) @@ -82,7 +82,7 @@ func TestRepositoriesService_EnablePagesWorkflow(t *testing.T) { mux.HandleFunc("/repos/o/r/pages", func(w http.ResponseWriter, r *http.Request) { v := new(createPagesRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") testHeader(t, r, "Accept", mediaTypeEnablePagesAPIPreview) @@ -133,7 +133,7 @@ func TestRepositoriesService_UpdatePagesLegacy(t *testing.T) { mux.HandleFunc("/repos/o/r/pages", func(w http.ResponseWriter, r *http.Request) { v := new(PagesUpdate) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PUT") want := &PagesUpdate{CNAME: String("www.my-domain.com"), BuildType: String("legacy"), Source: &PagesSource{Branch: String("gh-pages")}} @@ -172,7 +172,7 @@ func TestRepositoriesService_UpdatePagesWorkflow(t *testing.T) { mux.HandleFunc("/repos/o/r/pages", func(w http.ResponseWriter, r *http.Request) { v := new(PagesUpdate) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PUT") want := &PagesUpdate{CNAME: String("www.my-domain.com"), BuildType: String("workflow")} diff --git a/github/repos_prereceive_hooks_test.go b/github/repos_prereceive_hooks_test.go index 303e0e1265a..b286068047b 100644 --- a/github/repos_prereceive_hooks_test.go +++ b/github/repos_prereceive_hooks_test.go @@ -116,7 +116,7 @@ func TestRepositoriesService_UpdatePreReceiveHook(t *testing.T) { mux.HandleFunc("/repos/o/r/pre-receive-hooks/1", func(w http.ResponseWriter, r *http.Request) { v := new(PreReceiveHook) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") if !cmp.Equal(v, input) { diff --git a/github/repos_projects_test.go b/github/repos_projects_test.go index 558cc23a00a..f3818414219 100644 --- a/github/repos_projects_test.go +++ b/github/repos_projects_test.go @@ -64,7 +64,7 @@ func TestRepositoriesService_CreateProject(t *testing.T) { testHeader(t, r, "Accept", mediaTypeProjectsPreview) v := &ProjectOptions{} - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) if !cmp.Equal(v, input) { t.Errorf("Request body = %+v, want %+v", v, input) } diff --git a/github/repos_releases.go b/github/repos_releases.go index 464c2ee1e2b..e2aa845af2f 100644 --- a/github/repos_releases.go +++ b/github/repos_releases.go @@ -352,7 +352,7 @@ func (s *RepositoriesService) DownloadReleaseAsset(ctx context.Context, owner, r } if err := CheckResponse(resp); err != nil { - resp.Body.Close() + _ = resp.Body.Close() return nil, "", err } @@ -371,7 +371,7 @@ func (s *RepositoriesService) downloadReleaseAssetFromURL(ctx context.Context, f return nil, err } if err := CheckResponse(resp); err != nil { - resp.Body.Close() + _ = resp.Body.Close() return nil, err } return resp.Body, nil diff --git a/github/repos_releases_test.go b/github/repos_releases_test.go index fa33a64cd11..d7efd096d21 100644 --- a/github/repos_releases_test.go +++ b/github/repos_releases_test.go @@ -226,7 +226,7 @@ func TestRepositoriesService_CreateRelease(t *testing.T) { mux.HandleFunc("/repos/o/r/releases", func(w http.ResponseWriter, r *http.Request) { v := new(repositoryReleaseRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") want := &repositoryReleaseRequest{ @@ -291,7 +291,7 @@ func TestRepositoriesService_EditRelease(t *testing.T) { mux.HandleFunc("/repos/o/r/releases/1", func(w http.ResponseWriter, r *http.Request) { v := new(repositoryReleaseRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") want := &repositoryReleaseRequest{ @@ -512,6 +512,36 @@ func TestRepositoriesService_DownloadReleaseAsset_FollowRedirect(t *testing.T) { } } +func TestRepositoriesService_DownloadReleaseAsset_FollowRedirectToError(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/releases/assets/1", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testHeader(t, r, "Accept", defaultMediaType) + // /yo, below will be served as baseURLPath/yo + http.Redirect(w, r, baseURLPath+"/yo", http.StatusFound) + }) + mux.HandleFunc("/yo", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testHeader(t, r, "Accept", "*/*") + w.WriteHeader(http.StatusNotFound) + }) + + ctx := context.Background() + resp, loc, err := client.Repositories.DownloadReleaseAsset(ctx, "o", "r", 1, http.DefaultClient) + if err == nil { + t.Error("Repositories.DownloadReleaseAsset did not return an error") + } + if resp != nil { + resp.Close() + t.Error("Repositories.DownloadReleaseAsset returned stream, want nil") + } + if loc != "" { + t.Errorf(`Repositories.DownloadReleaseAsset returned "%s", want empty ""`, loc) + } +} + func TestRepositoriesService_DownloadReleaseAsset_APIError(t *testing.T) { client, mux, _, teardown := setup() defer teardown() @@ -547,7 +577,7 @@ func TestRepositoriesService_EditReleaseAsset(t *testing.T) { mux.HandleFunc("/repos/o/r/releases/assets/1", func(w http.ResponseWriter, r *http.Request) { v := new(ReleaseAsset) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") if !cmp.Equal(v, input) { diff --git a/github/repos_statuses_test.go b/github/repos_statuses_test.go index c9e03acb8de..cd9b0db70bb 100644 --- a/github/repos_statuses_test.go +++ b/github/repos_statuses_test.go @@ -69,7 +69,7 @@ func TestRepositoriesService_CreateStatus(t *testing.T) { mux.HandleFunc("/repos/o/r/statuses/r", func(w http.ResponseWriter, r *http.Request) { v := new(RepoStatus) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") if !cmp.Equal(v, input) { diff --git a/github/repos_tags_test.go b/github/repos_tags_test.go index d1eb8aa90ae..0195706fe69 100644 --- a/github/repos_tags_test.go +++ b/github/repos_tags_test.go @@ -68,7 +68,7 @@ func TestRepositoriesService_CreateTagProtection(t *testing.T) { mux.HandleFunc("/repos/o/r/tags/protection", func(w http.ResponseWriter, r *http.Request) { v := new(tagProtectionRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") want := &tagProtectionRequest{Pattern: "tag*"} diff --git a/github/repos_test.go b/github/repos_test.go index a3164edf554..df99b6fc8b7 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -230,7 +230,7 @@ func TestRepositoriesService_Create_user(t *testing.T) { wantAcceptHeaders := []string{mediaTypeRepositoryTemplatePreview, mediaTypeRepositoryVisibilityPreview} mux.HandleFunc("/user/repos", func(w http.ResponseWriter, r *http.Request) { v := new(createRepoRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) @@ -280,7 +280,7 @@ func TestRepositoriesService_Create_org(t *testing.T) { wantAcceptHeaders := []string{mediaTypeRepositoryTemplatePreview, mediaTypeRepositoryVisibilityPreview} mux.HandleFunc("/orgs/o/repos", func(w http.ResponseWriter, r *http.Request) { v := new(createRepoRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) @@ -314,7 +314,7 @@ func TestRepositoriesService_CreateFromTemplate(t *testing.T) { mux.HandleFunc("/repos/to/tr/generate", func(w http.ResponseWriter, r *http.Request) { v := new(TemplateRepoRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") testHeader(t, r, "Accept", mediaTypeRepositoryTemplatePreview) @@ -478,7 +478,7 @@ func TestRepositoriesService_Edit(t *testing.T) { wantAcceptHeaders := []string{mediaTypeRepositoryTemplatePreview, mediaTypeRepositoryVisibilityPreview} mux.HandleFunc("/repos/o/r", func(w http.ResponseWriter, r *http.Request) { v := new(Repository) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) @@ -1041,7 +1041,7 @@ func TestRepositoriesService_RenameBranch(t *testing.T) { mux.HandleFunc("/repos/o/r/branches/b/rename", func(w http.ResponseWriter, r *http.Request) { v := new(renameBranchRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") want := &renameBranchRequest{NewName: "nn"} @@ -1083,9 +1083,6 @@ func TestRepositoriesService_GetBranchProtection(t *testing.T) { defer teardown() mux.HandleFunc("/repos/o/r/branches/b/protection", func(w http.ResponseWriter, r *http.Request) { - v := new(ProtectionRequest) - json.NewDecoder(r.Body).Decode(v) - testMethod(t, r, "GET") // TODO: remove custom Accept header when this API fully launches testHeader(t, r, "Accept", mediaTypeRequiredApprovingReviewsPreview) @@ -1359,7 +1356,7 @@ func TestRepositoriesService_UpdateBranchProtection_Contexts(t *testing.T) { mux.HandleFunc("/repos/o/r/branches/b/protection", func(w http.ResponseWriter, r *http.Request) { v := new(ProtectionRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PUT") if !cmp.Equal(v, input) { @@ -1536,7 +1533,7 @@ func TestRepositoriesService_UpdateBranchProtection_Checks(t *testing.T) { mux.HandleFunc("/repos/o/r/branches/b/protection", func(w http.ResponseWriter, r *http.Request) { v := new(ProtectionRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PUT") if !cmp.Equal(v, input) { @@ -1677,7 +1674,7 @@ func TestRepositoriesService_UpdateBranchProtection_StrictNoChecks(t *testing.T) mux.HandleFunc("/repos/o/r/branches/b/protection", func(w http.ResponseWriter, r *http.Request) { v := new(ProtectionRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PUT") if !cmp.Equal(v, input) { @@ -1791,7 +1788,7 @@ func TestRepositoriesService_UpdateBranchProtection_RequireLastPushApproval(t *t mux.HandleFunc("/repos/o/r/branches/b/protection", func(w http.ResponseWriter, r *http.Request) { v := new(ProtectionRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PUT") if !cmp.Equal(v, input) { @@ -1907,9 +1904,6 @@ func TestRepositoriesService_GetRequiredStatusChecks(t *testing.T) { defer teardown() mux.HandleFunc("/repos/o/r/branches/b/protection/required_status_checks", func(w http.ResponseWriter, r *http.Request) { - v := new(ProtectionRequest) - json.NewDecoder(r.Body).Decode(v) - testMethod(t, r, "GET") fmt.Fprint(w, `{ "strict": true, @@ -2008,7 +2002,7 @@ func TestRepositoriesService_UpdateRequiredStatusChecks_Contexts(t *testing.T) { mux.HandleFunc("/repos/o/r/branches/b/protection/required_status_checks", func(w http.ResponseWriter, r *http.Request) { v := new(RequiredStatusChecksRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") if !cmp.Equal(v, input) { @@ -2086,7 +2080,7 @@ func TestRepositoriesService_UpdateRequiredStatusChecks_Checks(t *testing.T) { mux.HandleFunc("/repos/o/r/branches/b/protection/required_status_checks", func(w http.ResponseWriter, r *http.Request) { v := new(RequiredStatusChecksRequest) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") if !cmp.Equal(v, input) { @@ -2172,9 +2166,6 @@ func TestRepositoriesService_ListRequiredStatusChecksContexts(t *testing.T) { defer teardown() mux.HandleFunc("/repos/o/r/branches/b/protection/required_status_checks/contexts", func(w http.ResponseWriter, r *http.Request) { - v := new(ProtectionRequest) - json.NewDecoder(r.Body).Decode(v) - testMethod(t, r, "GET") fmt.Fprint(w, `["x", "y", "z"]`) }) @@ -2307,7 +2298,7 @@ func TestRepositoriesService_UpdatePullRequestReviewEnforcement(t *testing.T) { mux.HandleFunc("/repos/o/r/branches/b/protection/required_pull_request_reviews", func(w http.ResponseWriter, r *http.Request) { v := new(PullRequestReviewsEnforcementUpdate) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") if !cmp.Equal(v, input) { @@ -3259,7 +3250,7 @@ func TestRepositoriesService_Transfer(t *testing.T) { mux.HandleFunc("/repos/o/r/transfer", func(w http.ResponseWriter, r *http.Request) { var v TransferRequest - json.NewDecoder(r.Body).Decode(&v) + assertNilError(t, json.NewDecoder(r.Body).Decode(&v)) testMethod(t, r, "POST") if !cmp.Equal(v, input) { @@ -3303,7 +3294,7 @@ func TestRepositoriesService_Dispatch(t *testing.T) { mux.HandleFunc("/repos/o/r/dispatches", func(w http.ResponseWriter, r *http.Request) { var v DispatchRequestOptions - json.NewDecoder(r.Body).Decode(&v) + assertNilError(t, json.NewDecoder(r.Body).Decode(&v)) testMethod(t, r, "POST") if !cmp.Equal(v, input) { diff --git a/github/secret_scanning_test.go b/github/secret_scanning_test.go index 75275913385..2ca439aa470 100644 --- a/github/secret_scanning_test.go +++ b/github/secret_scanning_test.go @@ -357,7 +357,7 @@ func TestSecretScanningService_UpdateAlert(t *testing.T) { testMethod(t, r, "PATCH") v := new(SecretScanningAlertUpdateOptions) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) want := &SecretScanningAlertUpdateOptions{State: String("resolved"), Resolution: String("used_in_tests")} diff --git a/github/strings.go b/github/strings.go index 5611b96a882..147c515e2cf 100644 --- a/github/strings.go +++ b/github/strings.go @@ -8,8 +8,6 @@ package github import ( "bytes" "fmt" - "io" - "reflect" ) @@ -27,7 +25,7 @@ func Stringify(message interface{}) string { // stringifyValue was heavily inspired by the goprotobuf library. -func stringifyValue(w io.Writer, val reflect.Value) { +func stringifyValue(w *bytes.Buffer, val reflect.Value) { if val.Kind() == reflect.Ptr && val.IsNil() { w.Write([]byte("")) return diff --git a/github/teams_discussion_comments_test.go b/github/teams_discussion_comments_test.go index f6b5433b7b5..eaac112bf23 100644 --- a/github/teams_discussion_comments_test.go +++ b/github/teams_discussion_comments_test.go @@ -247,7 +247,7 @@ func TestTeamsService_CreateComment(t *testing.T) { handlerFunc := func(w http.ResponseWriter, r *http.Request) { v := new(DiscussionComment) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") if !cmp.Equal(v, &input) { @@ -319,7 +319,7 @@ func TestTeamsService_EditComment(t *testing.T) { input := DiscussionComment{Body: String("e")} handlerFunc := func(w http.ResponseWriter, r *http.Request) { v := new(DiscussionComment) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") if !cmp.Equal(v, &input) { diff --git a/github/teams_discussions_test.go b/github/teams_discussions_test.go index 0e73751964a..a9c7434ec1f 100644 --- a/github/teams_discussions_test.go +++ b/github/teams_discussions_test.go @@ -324,7 +324,7 @@ func TestTeamsService_CreateDiscussionByID(t *testing.T) { mux.HandleFunc("/organizations/1/team/2/discussions", func(w http.ResponseWriter, r *http.Request) { v := new(TeamDiscussion) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") if !cmp.Equal(v, &input) { @@ -368,7 +368,7 @@ func TestTeamsService_CreateDiscussionBySlug(t *testing.T) { mux.HandleFunc("/orgs/o/teams/s/discussions", func(w http.ResponseWriter, r *http.Request) { v := new(TeamDiscussion) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") if !cmp.Equal(v, &input) { @@ -412,7 +412,7 @@ func TestTeamsService_EditDiscussionByID(t *testing.T) { mux.HandleFunc("/organizations/1/team/2/discussions/3", func(w http.ResponseWriter, r *http.Request) { v := new(TeamDiscussion) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") if !cmp.Equal(v, &input) { @@ -456,7 +456,7 @@ func TestTeamsService_EditDiscussionBySlug(t *testing.T) { mux.HandleFunc("/orgs/o/teams/s/discussions/3", func(w http.ResponseWriter, r *http.Request) { v := new(TeamDiscussion) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") if !cmp.Equal(v, &input) { diff --git a/github/teams_members_test.go b/github/teams_members_test.go index 5ef17351600..bdaf1d72173 100644 --- a/github/teams_members_test.go +++ b/github/teams_members_test.go @@ -333,7 +333,7 @@ func TestTeamsService__AddTeamMembershipByID(t *testing.T) { mux.HandleFunc("/organizations/1/team/2/memberships/u", func(w http.ResponseWriter, r *http.Request) { v := new(TeamAddTeamMembershipOptions) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PUT") if !cmp.Equal(v, opt) { @@ -377,7 +377,7 @@ func TestTeamsService__AddTeamMembershipByID_notFound(t *testing.T) { mux.HandleFunc("/organizations/1/team/2/memberships/u", func(w http.ResponseWriter, r *http.Request) { v := new(TeamAddTeamMembershipOptions) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PUT") if !cmp.Equal(v, opt) { @@ -422,7 +422,7 @@ func TestTeamsService__AddTeamMembershipBySlug(t *testing.T) { mux.HandleFunc("/orgs/o/teams/s/memberships/u", func(w http.ResponseWriter, r *http.Request) { v := new(TeamAddTeamMembershipOptions) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PUT") if !cmp.Equal(v, opt) { @@ -466,7 +466,7 @@ func TestTeamsService__AddTeamMembershipBySlug_notFound(t *testing.T) { mux.HandleFunc("/orgs/o/teams/s/memberships/u", func(w http.ResponseWriter, r *http.Request) { v := new(TeamAddTeamMembershipOptions) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PUT") if !cmp.Equal(v, opt) { diff --git a/github/teams_test.go b/github/teams_test.go index d86fab7fd6b..d215605c618 100644 --- a/github/teams_test.go +++ b/github/teams_test.go @@ -195,7 +195,7 @@ func TestTeamsService_CreateTeam(t *testing.T) { mux.HandleFunc("/orgs/o/teams", func(w http.ResponseWriter, r *http.Request) { v := new(NewTeam) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") if !cmp.Equal(v, &input) { @@ -248,7 +248,7 @@ func TestTeamsService_EditTeamByID(t *testing.T) { mux.HandleFunc("/organizations/1/team/1", func(w http.ResponseWriter, r *http.Request) { v := new(NewTeam) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") if !cmp.Equal(v, &input) { @@ -298,7 +298,7 @@ func TestTeamsService_EditTeamByID_RemoveParent(t *testing.T) { t.Errorf("Unable to read body: %v", err) } body = string(buf) - json.NewDecoder(bytes.NewBuffer(buf)).Decode(v) + assertNilError(t, json.NewDecoder(bytes.NewBuffer(buf)).Decode(v)) testMethod(t, r, "PATCH") if !cmp.Equal(v, &input) { @@ -332,7 +332,7 @@ func TestTeamsService_EditTeamBySlug(t *testing.T) { mux.HandleFunc("/orgs/o/teams/s", func(w http.ResponseWriter, r *http.Request) { v := new(NewTeam) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") if !cmp.Equal(v, &input) { @@ -382,7 +382,7 @@ func TestTeamsService_EditTeamBySlug_RemoveParent(t *testing.T) { t.Errorf("Unable to read body: %v", err) } body = string(buf) - json.NewDecoder(bytes.NewBuffer(buf)).Decode(v) + assertNilError(t, json.NewDecoder(bytes.NewBuffer(buf)).Decode(v)) testMethod(t, r, "PATCH") if !cmp.Equal(v, &input) { @@ -798,7 +798,7 @@ func TestTeamsService_AddTeamRepoByID(t *testing.T) { mux.HandleFunc("/organizations/1/team/1/repos/owner/repo", func(w http.ResponseWriter, r *http.Request) { v := new(TeamAddTeamRepoOptions) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PUT") if !cmp.Equal(v, opt) { @@ -833,7 +833,7 @@ func TestTeamsService_AddTeamRepoBySlug(t *testing.T) { mux.HandleFunc("/orgs/org/teams/slug/repos/owner/repo", func(w http.ResponseWriter, r *http.Request) { v := new(TeamAddTeamRepoOptions) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PUT") if !cmp.Equal(v, opt) { @@ -1174,7 +1174,7 @@ func TestTeamsService_AddTeamProjectByID(t *testing.T) { testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) v := &TeamProjectOptions{} - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) if !cmp.Equal(v, opt) { t.Errorf("Request body = %+v, want %+v", v, opt) } @@ -1213,7 +1213,7 @@ func TestTeamsService_AddTeamProjectBySlug(t *testing.T) { testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) v := &TeamProjectOptions{} - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) if !cmp.Equal(v, opt) { t.Errorf("Request body = %+v, want %+v", v, opt) } diff --git a/github/users_administration_test.go b/github/users_administration_test.go index ff8f93584c8..3400edfccac 100644 --- a/github/users_administration_test.go +++ b/github/users_administration_test.go @@ -100,7 +100,7 @@ func TestUsersServiceReason_Suspend(t *testing.T) { mux.HandleFunc("/users/u/suspended", func(w http.ResponseWriter, r *http.Request) { v := new(UserSuspendOptions) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PUT") if !cmp.Equal(v, input) { diff --git a/github/users_emails_test.go b/github/users_emails_test.go index ad9d32e9491..9f7f92bc4dc 100644 --- a/github/users_emails_test.go +++ b/github/users_emails_test.go @@ -59,7 +59,7 @@ func TestUsersService_AddEmails(t *testing.T) { mux.HandleFunc("/user/emails", func(w http.ResponseWriter, r *http.Request) { var v []string - json.NewDecoder(r.Body).Decode(&v) + assertNilError(t, json.NewDecoder(r.Body).Decode(&v)) testMethod(t, r, "POST") if !cmp.Equal(v, input) { @@ -101,7 +101,7 @@ func TestUsersService_DeleteEmails(t *testing.T) { mux.HandleFunc("/user/emails", func(w http.ResponseWriter, r *http.Request) { var v []string - json.NewDecoder(r.Body).Decode(&v) + assertNilError(t, json.NewDecoder(r.Body).Decode(&v)) testMethod(t, r, "DELETE") if !cmp.Equal(v, input) { @@ -149,7 +149,7 @@ func TestUsersService_SetEmailVisibility(t *testing.T) { mux.HandleFunc("/user/email/visibility", func(w http.ResponseWriter, r *http.Request) { v := new(UserEmail) - json.NewDecoder(r.Body).Decode(&v) + assertNilError(t, json.NewDecoder(r.Body).Decode(&v)) testMethod(t, r, "PATCH") if !cmp.Equal(v, input) { diff --git a/github/users_gpg_keys_test.go b/github/users_gpg_keys_test.go index 79ebd2d6f40..e0d581fbbc0 100644 --- a/github/users_gpg_keys_test.go +++ b/github/users_gpg_keys_test.go @@ -134,7 +134,7 @@ mQINBFcEd9kBEACo54TDbGhKlXKWMvJgecEUKPPcv7XdnpKdGb3LRw5MvFwT0V0f var gpgKey struct { ArmoredPublicKey *string `json:"armored_public_key,omitempty"` } - json.NewDecoder(r.Body).Decode(&gpgKey) + assertNilError(t, json.NewDecoder(r.Body).Decode(&gpgKey)) testMethod(t, r, "POST") if gpgKey.ArmoredPublicKey == nil || *gpgKey.ArmoredPublicKey != input { diff --git a/github/users_keys_test.go b/github/users_keys_test.go index ac5c10d0335..f3a8218e598 100644 --- a/github/users_keys_test.go +++ b/github/users_keys_test.go @@ -125,7 +125,7 @@ func TestUsersService_CreateKey(t *testing.T) { mux.HandleFunc("/user/keys", func(w http.ResponseWriter, r *http.Request) { v := new(Key) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") if !cmp.Equal(v, input) { diff --git a/github/users_projects_test.go b/github/users_projects_test.go index 28c46107286..1a298dedaab 100644 --- a/github/users_projects_test.go +++ b/github/users_projects_test.go @@ -64,7 +64,7 @@ func TestUsersService_CreateProject(t *testing.T) { testHeader(t, r, "Accept", mediaTypeProjectsPreview) v := &CreateUserProjectOptions{} - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) if !cmp.Equal(v, input) { t.Errorf("Request body = %+v, want %+v", v, input) } diff --git a/github/users_ssh_signing_keys_test.go b/github/users_ssh_signing_keys_test.go index 3bf59e108db..c7093d7f61e 100644 --- a/github/users_ssh_signing_keys_test.go +++ b/github/users_ssh_signing_keys_test.go @@ -125,7 +125,7 @@ func TestUsersService_CreateSSHSigningKey(t *testing.T) { mux.HandleFunc("/user/ssh_signing_keys", func(w http.ResponseWriter, r *http.Request) { v := new(Key) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") if !cmp.Equal(v, input) { diff --git a/github/users_test.go b/github/users_test.go index f71df5cfd9e..80020007e4a 100644 --- a/github/users_test.go +++ b/github/users_test.go @@ -252,7 +252,7 @@ func TestUsersService_Edit(t *testing.T) { mux.HandleFunc("/user", func(w http.ResponseWriter, r *http.Request) { v := new(User) - json.NewDecoder(r.Body).Decode(v) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") if !cmp.Equal(v, input) { diff --git a/scrape/apps_test.go b/scrape/apps_test.go index f80825fbad2..8542426c83e 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -33,7 +33,7 @@ func Test_AppRestrictionsEnabled(t *testing.T) { defer cleanup() mux.HandleFunc("/organizations/o/settings/oauth_application_policy", func(w http.ResponseWriter, r *http.Request) { - copyTestFile(w, tt.testFile) + copyTestFile(t, w, tt.testFile) }) got, err := client.AppRestrictionsEnabled("o") @@ -52,7 +52,7 @@ func Test_ListOAuthApps(t *testing.T) { defer cleanup() mux.HandleFunc("/organizations/e/settings/oauth_application_policy", func(w http.ResponseWriter, r *http.Request) { - copyTestFile(w, "access-restrictions-enabled.html") + copyTestFile(t, w, "access-restrictions-enabled.html") }) got, err := client.ListOAuthApps("e") diff --git a/scrape/forms_test.go b/scrape/forms_test.go index 2c7b9fef520..b9bd60cb218 100644 --- a/scrape/forms_test.go +++ b/scrape/forms_test.go @@ -94,7 +94,10 @@ func Test_FetchAndSumbitForm(t *testing.T) { `) }) mux.HandleFunc("/submit", func(w http.ResponseWriter, r *http.Request) { - r.ParseForm() + err := r.ParseForm() + if err != nil { + t.Errorf("error parsing form: %v", err) + } want := url.Values{"hidden": {"h"}, "name": {"n"}} if got := r.Form; !cmp.Equal(got, want) { t.Errorf("submitted form contained values %v, want %v", got, want) @@ -103,7 +106,10 @@ func Test_FetchAndSumbitForm(t *testing.T) { }) setValues := func(values url.Values) { values.Set("name", "n") } - fetchAndSubmitForm(client.Client, client.baseURL.String()+"/", setValues) + _, err := fetchAndSubmitForm(client.Client, client.baseURL.String()+"/", setValues) + if err != nil { + t.Errorf("fetchAndSubmitForm returned err: %v", err) + } if !submitted { t.Error("form was never submitted") } diff --git a/scrape/scrape_test.go b/scrape/scrape_test.go index 74e867b6417..f2b928dd9aa 100644 --- a/scrape/scrape_test.go +++ b/scrape/scrape_test.go @@ -6,6 +6,7 @@ import ( "net/http/httptest" "net/url" "os" + "testing" ) // setup a test HTTP server along with a scrape.Client that is configured to @@ -21,13 +22,18 @@ func setup() (client *Client, mux *http.ServeMux, cleanup func()) { return client, mux, server.Close } -func copyTestFile(w io.Writer, filename string) error { +func copyTestFile(t *testing.T, w io.Writer, filename string) { + t.Helper() f, err := os.Open("testdata/" + filename) if err != nil { - return err + t.Errorf("unable to open test file: %v", err) } - defer f.Close() - _, err = io.Copy(w, f) - return err + if err != nil { + t.Errorf("failure copying test file: %v", err) + } + err = f.Close() + if err != nil { + t.Errorf("failure closing test file: %v", err) + } } diff --git a/test/fields/fields.go b/test/fields/fields.go index c32cdaba980..124079a5cea 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -31,10 +31,6 @@ import ( var ( client *github.Client - // auth indicates whether tests are being run with an OAuth token. - // Tests can use this flag to skip certain tests when run without auth. - auth bool - skipURLs = flag.Bool("skip_urls", false, "skip url fields") ) @@ -47,7 +43,6 @@ func main() { client = github.NewClient(nil) } else { client = github.NewClient(nil).WithAuthToken(token) - auth = true } for _, tt := range []struct { diff --git a/test/integration/authorizations_test.go b/test/integration/authorizations_test.go index d5bdf2e2884..872c8862820 100644 --- a/test/integration/authorizations_test.go +++ b/test/integration/authorizations_test.go @@ -10,9 +10,7 @@ package integration import ( "context" - "math/rand" "os" - "strconv" "strings" "testing" "time" @@ -21,8 +19,6 @@ import ( ) const msgEnvMissing = "Skipping test because the required environment variable (%v) is not present." -const envKeyGitHubUsername = "GITHUB_USERNAME" -const envKeyGitHubPassword = "GITHUB_PASSWORD" const envKeyClientID = "GITHUB_CLIENT_ID" const envKeyClientSecret = "GITHUB_CLIENT_SECRET" const envKeyAccessToken = "GITHUB_ACCESS_TOKEN" @@ -31,7 +27,6 @@ const InvalidTokenValue = "iamnotacroken" // TestAuthorizationsAppOperations tests the application/token related operations, such // as creating, testing, resetting and revoking application OAuth tokens. func TestAuthorizationsAppOperations(t *testing.T) { - appAuthenticatedClient := getOAuthAppClient(t) // We know these vars are set because getOAuthAppClient would have @@ -107,44 +102,8 @@ func TestAuthorizationsAppOperations(t *testing.T) { failIfNotStatusCode(t, resp, 404) } -// generatePersonalAuthTokenRequest is a helper function that generates an -// AuthorizationRequest for a Personal Access Token (no client id). -func generatePersonalAuthTokenRequest() *github.AuthorizationRequest { - - rand := randString() - auth := github.AuthorizationRequest{ - Note: github.String("Personal token: Note generated by test: " + rand), - Scopes: []github.Scope{github.ScopePublicRepo}, - Fingerprint: github.String("Personal token: Fingerprint generated by test: " + rand), - } - - return &auth -} - -// generatePersonalAuthTokenRequest is a helper function that generates an -// AuthorizationRequest for an OAuth application Token (uses client id). -func generateAppAuthTokenRequest(clientID string, clientSecret string) *github.AuthorizationRequest { - - rand := randString() - auth := github.AuthorizationRequest{ - Note: github.String("App token: Note generated by test: " + rand), - Scopes: []github.Scope{github.ScopePublicRepo}, - Fingerprint: github.String("App token: Fingerprint generated by test: " + rand), - ClientID: github.String(clientID), - ClientSecret: github.String(clientSecret), - } - - return &auth -} - -// randString returns a (kinda) random string for uniqueness purposes. -func randString() string { - return strconv.FormatInt(rand.NewSource(time.Now().UnixNano()).Int63(), 10) -} - // failOnError invokes t.Fatal() if err is present. func failOnError(t *testing.T, err error) { - if err != nil { t.Fatal(err) } @@ -152,33 +111,9 @@ func failOnError(t *testing.T, err error) { // failIfNotStatusCode invokes t.Fatal() if the response's status code doesn't match the expected code. func failIfNotStatusCode(t *testing.T, resp *github.Response, expectedCode int) { - if resp.StatusCode != expectedCode { t.Fatalf("Expected HTTP status code [%v] but received [%v]", expectedCode, resp.StatusCode) } - -} - -// getUserPassClient returns a GitHub client for authorization testing. The client -// uses BasicAuth via GH username and password passed in environment variables -// (and will skip the calling test if those vars are not present). -func getUserPassClient(t *testing.T) *github.Client { - username, ok := os.LookupEnv(envKeyGitHubUsername) - if !ok { - t.Skipf(msgEnvMissing, envKeyGitHubUsername) - } - - password, ok := os.LookupEnv(envKeyGitHubPassword) - if !ok { - t.Skipf(msgEnvMissing, envKeyGitHubPassword) - } - - tp := github.BasicAuthTransport{ - Username: strings.TrimSpace(username), - Password: strings.TrimSpace(password), - } - - return github.NewClient(tp.Client()) } // getOAuthAppClient returns a GitHub client for authorization testing. The client @@ -190,7 +125,6 @@ func getUserPassClient(t *testing.T) *github.Client { // // See GitHub API docs: https://developer.com/v3/oauth_authorizations/#check-an-authorization func getOAuthAppClient(t *testing.T) *github.Client { - username, ok := os.LookupEnv(envKeyClientID) if !ok { t.Skipf(msgEnvMissing, envKeyClientID) diff --git a/update-urls/activity-events_test.go b/update-urls/activity-events_test.go index 9c5b3415dfa..10dce865b29 100644 --- a/update-urls/activity-events_test.go +++ b/update-urls/activity-events_test.go @@ -48,10 +48,7 @@ func TestPipeline_ActivityEvents_FirstStripAllURLsAndDestroyReceivers(t *testing } func TestParseWebPageEndpoints_ActivityEvents(t *testing.T) { - got, err := parseWebPageEndpoints(activityEventsTestWebPage) - if err != nil { - t.Fatal(err) - } + got := parseWebPageEndpoints(activityEventsTestWebPage) testWebPageHelper(t, got, activityEventsWant) } diff --git a/update-urls/main.go b/update-urls/main.go index 0a3c53c24d8..77938be6de7 100644 --- a/update-urls/main.go +++ b/update-urls/main.go @@ -474,7 +474,7 @@ func findAllServices(pkgs map[string]*ast.Package) servicesMap { } logf("Step 1 - Processing %v ...", filename) - if err := findClientServices(filename, f, services); err != nil { + if err := findClientServices(f, services); err != nil { log.Fatal(err) } } @@ -581,12 +581,14 @@ func (dc *documentCache) CacheDocFromInternet(urlWithID, filename string, pos to logf("GET %q ...", fullURL) time.Sleep(httpGetDelay) + //nolint:gosec // G107: Potential HTTP request made with variable url resp, err := http.Get(fullURL) check("Unable to get URL: %v: %v", fullURL, err) switch resp.StatusCode { case http.StatusTooManyRequests, http.StatusServiceUnavailable: logf("Sleeping 60 seconds and trying again...") time.Sleep(60 * time.Second) + //nolint:gosec // G107: Potential HTTP request made with variable url resp, err = http.Get(fullURL) check("Unable to get URL: %v: %v", fullURL, err) case http.StatusOK: @@ -602,7 +604,7 @@ func (dc *documentCache) CacheDocFromInternet(urlWithID, filename string, pos to b, err := io.ReadAll(resp.Body) check("Unable to read body of URL: %v, %v", url, err) check("Unable to close body of URL: %v, %v", url, resp.Body.Close()) - dc.apiDocs[url], err = parseWebPageEndpoints(string(b)) + dc.apiDocs[url] = parseWebPageEndpoints(string(b)) check("Unable to parse web page endpoints: url: %v, filename: %v, err: %v", url, filename, err) logf("Found %v web page fragment identifiers.", len(dc.apiDocs[url])) if len(dc.apiDocs[url]) == 0 { @@ -1138,7 +1140,7 @@ func processCallExpr(expr *ast.CallExpr) (recv, funcName string, args []string) } // findClientServices finds all go-github services from the Client struct. -func findClientServices(filename string, f *ast.File, services servicesMap) error { +func findClientServices(f *ast.File, services servicesMap) error { for _, decl := range f.Decls { switch decl := decl.(type) { case *ast.GenDecl: @@ -1196,7 +1198,7 @@ func endpointsEqual(a, b *Endpoint) bool { // parseWebPageEndpoints returns endpoint information, mapped by // web page fragment identifier. -func parseWebPageEndpoints(buf string) (map[string][]*Endpoint, error) { +func parseWebPageEndpoints(buf string) map[string][]*Endpoint { result := map[string][]*Endpoint{} // The GitHub v3 API web pages do not appear to be auto-generated @@ -1259,7 +1261,7 @@ func parseWebPageEndpoints(buf string) (map[string][]*Endpoint, error) { } } - return result, nil + return result } func stripHTML(s string) string { diff --git a/update-urls/reactions_test.go b/update-urls/reactions_test.go index a3071966b9e..8d0504ec699 100644 --- a/update-urls/reactions_test.go +++ b/update-urls/reactions_test.go @@ -48,10 +48,7 @@ func TestPipeline_Reactions_FirstStripAllURLsAndDestroyReceivers(t *testing.T) { } func TestParseWebPageEndpoints_Reactions(t *testing.T) { - got, err := parseWebPageEndpoints(reactionsTestWebPage) - if err != nil { - t.Fatal(err) - } + got := parseWebPageEndpoints(reactionsTestWebPage) testWebPageHelper(t, got, reactionsWant) } From 9c58b7be8171e388e2a0c4ae0e49930196560c93 Mon Sep 17 00:00:00 2001 From: Gus Price <42309183+GusPrice@users.noreply.github.com> Date: Mon, 18 Sep 2023 06:17:00 -0700 Subject: [PATCH 310/751] Handle encoding value of "none" (#2924) --- github/repos_contents.go | 2 ++ github/repos_contents_test.go | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/github/repos_contents.go b/github/repos_contents.go index de7a0d5b82b..d59c735df8f 100644 --- a/github/repos_contents.go +++ b/github/repos_contents.go @@ -91,6 +91,8 @@ func (r *RepositoryContent) GetContent() (string, error) { return "", nil } return *r.Content, nil + case "none": + return "", errors.New("unsupported content encoding: none, this may occur when file size > 1 MB, if that is the case consider using DownloadContents") default: return "", fmt.Errorf("unsupported content encoding: %v", encoding) } diff --git a/github/repos_contents_test.go b/github/repos_contents_test.go index ab69b5cdcbb..f9613069209 100644 --- a/github/repos_contents_test.go +++ b/github/repos_contents_test.go @@ -54,6 +54,12 @@ func TestRepositoryContent_GetContent(t *testing.T) { want: "", wantErr: true, }, + { + encoding: String("none"), + content: nil, + want: "", + wantErr: true, + }, } for _, tt := range tests { From 3c1590db0015574f9c84e2325f7a274865dfd4ce Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Mon, 18 Sep 2023 06:19:07 -0700 Subject: [PATCH 311/751] Correct NewEnterpriseClient deprecation message (#2923) --- github/github.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/github.go b/github/github.go index e16bb084466..e9ce136b7b6 100644 --- a/github/github.go +++ b/github/github.go @@ -462,7 +462,7 @@ func NewTokenClient(_ context.Context, token string) *Client { // NewEnterpriseClient returns a new GitHub API client with provided // base URL and upload URL (often is your GitHub Enterprise hostname). // -// Deprecated: Use NewClient(httpClient).WithOptions(WithEnterpriseURLs(baseURL, uploadURL)) instead. +// Deprecated: Use NewClient(httpClient).WithEnterpriseURLs(baseURL, uploadURL) instead. func NewEnterpriseClient(baseURL, uploadURL string, httpClient *http.Client) (*Client, error) { return NewClient(httpClient).WithEnterpriseURLs(baseURL, uploadURL) } From 9b42cd175b15db1b37f90dc6905f3b3d304757e8 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Mon, 18 Sep 2023 08:30:20 -0500 Subject: [PATCH 312/751] Fix golangci-lint timeout failures (#2931) --- .github/workflows/linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 4f3cdf8e4df..4bc27ab6f2d 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -29,4 +29,4 @@ jobs: with: version: latest working-directory: ${{ matrix.working-directory}} - args: --verbose + args: --verbose --timeout=10m From b24403c072ff5187c9dbcbf40806aac2492e681b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Sep 2023 09:33:10 -0400 Subject: [PATCH 313/751] Bump golang.org/x/net from 0.14.0 to 0.15.0 in /scrape (#2925) --- scrape/go.mod | 2 +- scrape/go.sum | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 8c6116364a6..9b70258ff76 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -7,5 +7,5 @@ require ( github.com/google/go-cmp v0.5.9 github.com/google/go-github/v55 v55.0.0 github.com/xlzd/gotp v0.1.0 - golang.org/x/net v0.14.0 + golang.org/x/net v0.15.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index 7a79727970b..7db3e4418ea 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -22,8 +22,9 @@ github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5t golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= +golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= +golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -34,8 +35,8 @@ golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= -golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= +golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= +golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -50,14 +51,16 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= +golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -66,6 +69,7 @@ golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= From 0e8dfaeabef7bb709e2cf06fbf24c99d6a3bce1f Mon Sep 17 00:00:00 2001 From: WillAbides <233500+WillAbides@users.noreply.github.com> Date: Mon, 18 Sep 2023 08:41:52 -0500 Subject: [PATCH 314/751] Remove ListServiceHooks (#2917) Fixes: #2916. --- github/github-accessors.go | 8 ---- github/github-accessors_test.go | 10 ----- github/github-stringify_test.go | 12 ------ github/misc.go | 32 --------------- github/misc_test.go | 69 --------------------------------- test/integration/misc_test.go | 11 ------ 6 files changed, 142 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index a685a3efce5..7806d4d16d6 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -21166,14 +21166,6 @@ func (s *SelectedReposList) GetTotalCount() int { return *s.TotalCount } -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (s *ServiceHook) GetName() string { - if s == nil || s.Name == nil { - return "" - } - return *s.Name -} - // GetFrom returns the From field if it's non-nil, zero value otherwise. func (s *SignatureRequirementEnforcementLevelChanges) GetFrom() string { if s == nil || s.From == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 10ef017b3cb..ec74394cff3 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -24646,16 +24646,6 @@ func TestSelectedReposList_GetTotalCount(tt *testing.T) { s.GetTotalCount() } -func TestServiceHook_GetName(tt *testing.T) { - var zeroValue string - s := &ServiceHook{Name: &zeroValue} - s.GetName() - s = &ServiceHook{} - s.GetName() - s = nil - s.GetName() -} - func TestSignatureRequirementEnforcementLevelChanges_GetFrom(tt *testing.T) { var zeroValue string s := &SignatureRequirementEnforcementLevelChanges{From: &zeroValue} diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index 1d2a47bbffe..c14412c2ceb 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -1820,18 +1820,6 @@ func TestSecurityAndAnalysis_String(t *testing.T) { } } -func TestServiceHook_String(t *testing.T) { - v := ServiceHook{ - Name: String(""), - Events: []string{""}, - SupportedEvents: []string{""}, - } - want := `github.ServiceHook{Name:"", Events:[""], SupportedEvents:[""]}` - if got := v.String(); got != want { - t.Errorf("ServiceHook.String = %v, want %v", got, want) - } -} - func TestSourceImportAuthor_String(t *testing.T) { v := SourceImportAuthor{ ID: Int64(0), diff --git a/github/misc.go b/github/misc.go index 89615241570..a01b716fa23 100644 --- a/github/misc.go +++ b/github/misc.go @@ -245,35 +245,3 @@ func (c *Client) Zen(ctx context.Context) (string, *Response, error) { return buf.String(), resp, nil } - -// ServiceHook represents a hook that has configuration settings, a list of -// available events, and default events. -type ServiceHook struct { - Name *string `json:"name,omitempty"` - Events []string `json:"events,omitempty"` - SupportedEvents []string `json:"supported_events,omitempty"` - Schema [][]string `json:"schema,omitempty"` -} - -func (s *ServiceHook) String() string { - return Stringify(s) -} - -// ListServiceHooks lists all of the available service hooks. -// -// GitHub API docs: https://developer.github.com/webhooks/#services -func (c *Client) ListServiceHooks(ctx context.Context) ([]*ServiceHook, *Response, error) { - u := "hooks" - req, err := c.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var hooks []*ServiceHook - resp, err := c.Do(ctx, req, &hooks) - if err != nil { - return nil, resp, err - } - - return hooks, resp, nil -} diff --git a/github/misc_test.go b/github/misc_test.go index 69427ebf246..45c99893812 100644 --- a/github/misc_test.go +++ b/github/misc_test.go @@ -317,48 +317,6 @@ func TestZen(t *testing.T) { }) } -func TestListServiceHooks(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - mux.HandleFunc("/hooks", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - fmt.Fprint(w, `[{ - "name":"n", - "events":["e"], - "supported_events":["s"], - "schema":[ - ["a", "b"] - ] - }]`) - }) - - ctx := context.Background() - hooks, _, err := client.ListServiceHooks(ctx) - if err != nil { - t.Errorf("ListServiceHooks returned error: %v", err) - } - - want := []*ServiceHook{{ - Name: String("n"), - Events: []string{"e"}, - SupportedEvents: []string{"s"}, - Schema: [][]string{{"a", "b"}}, - }} - if !cmp.Equal(hooks, want) { - t.Errorf("ListServiceHooks returned %+v, want %+v", hooks, want) - } - - const methodName = "ListServiceHooks" - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.ListServiceHooks(ctx) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - func TestMarkdownRequest_Marshal(t *testing.T) { testJSONMarshal(t, &markdownRequest{}, "{}") @@ -396,30 +354,3 @@ func TestCodeOfConduct_Marshal(t *testing.T) { testJSONMarshal(t, a, want) } - -func TestServiceHook_Marshal(t *testing.T) { - testJSONMarshal(t, &ServiceHook{}, "{}") - - a := &ServiceHook{ - Name: String("name"), - Events: []string{"e"}, - SupportedEvents: []string{"se"}, - Schema: [][]string{{"g"}}, - } - want := `{ - "name": "name", - "events": [ - "e" - ], - "supported_events": [ - "se" - ], - "schema": [ - [ - "g" - ] - ] - }` - - testJSONMarshal(t, a, want) -} diff --git a/test/integration/misc_test.go b/test/integration/misc_test.go index 60753ada7d7..e0cee29bf07 100644 --- a/test/integration/misc_test.go +++ b/test/integration/misc_test.go @@ -67,14 +67,3 @@ func TestRateLimits(t *testing.T) { t.Errorf("Core.Reset is more than 1 minute in the past; that doesn't seem right.") } } - -func TestListServiceHooks(t *testing.T) { - hooks, _, err := client.ListServiceHooks(context.Background()) - if err != nil { - t.Fatalf("ListServiceHooks returned error: %v", err) - } - - if len(hooks) == 0 { - t.Fatalf("ListServiceHooks returned no hooks") - } -} From 477e109aa8a28352b175fffba47e2eecc5e64cf4 Mon Sep 17 00:00:00 2001 From: vandan rohatgi <43648786+vandanrohatgi@users.noreply.github.com> Date: Mon, 18 Sep 2023 19:49:39 +0530 Subject: [PATCH 315/751] Add missing secret scanning alert fields (#2930) Fixes: #2929. --- github/github-accessors.go | 40 ++++++++++++++++++++++++++++ github/github-accessors_test.go | 47 +++++++++++++++++++++++++++++++++ github/secret_scanning.go | 31 +++++++++++++--------- 3 files changed, 105 insertions(+), 13 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 7806d4d16d6..e7cfa86f89a 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -20694,6 +20694,30 @@ func (s *SecretScanningAlert) GetNumber() int { return *s.Number } +// GetPushProtectionBypassed returns the PushProtectionBypassed field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetPushProtectionBypassed() bool { + if s == nil || s.PushProtectionBypassed == nil { + return false + } + return *s.PushProtectionBypassed +} + +// GetPushProtectionBypassedAt returns the PushProtectionBypassedAt field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetPushProtectionBypassedAt() Timestamp { + if s == nil || s.PushProtectionBypassedAt == nil { + return Timestamp{} + } + return *s.PushProtectionBypassedAt +} + +// GetPushProtectionBypassedBy returns the PushProtectionBypassedBy field. +func (s *SecretScanningAlert) GetPushProtectionBypassedBy() *User { + if s == nil { + return nil + } + return s.PushProtectionBypassedBy +} + // GetRepository returns the Repository field. func (s *SecretScanningAlert) GetRepository() *Repository { if s == nil { @@ -20710,6 +20734,14 @@ func (s *SecretScanningAlert) GetResolution() string { return *s.Resolution } +// GetResolutionComment returns the ResolutionComment field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetResolutionComment() string { + if s == nil || s.ResolutionComment == nil { + return "" + } + return *s.ResolutionComment +} + // GetResolvedAt returns the ResolvedAt field if it's non-nil, zero value otherwise. func (s *SecretScanningAlert) GetResolvedAt() Timestamp { if s == nil || s.ResolvedAt == nil { @@ -20758,6 +20790,14 @@ func (s *SecretScanningAlert) GetState() string { return *s.State } +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetUpdatedAt() Timestamp { + if s == nil || s.UpdatedAt == nil { + return Timestamp{} + } + return *s.UpdatedAt +} + // GetURL returns the URL field if it's non-nil, zero value otherwise. func (s *SecretScanningAlert) GetURL() string { if s == nil || s.URL == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index ec74394cff3..e2918beaff1 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -24140,6 +24140,33 @@ func TestSecretScanningAlert_GetNumber(tt *testing.T) { s.GetNumber() } +func TestSecretScanningAlert_GetPushProtectionBypassed(tt *testing.T) { + var zeroValue bool + s := &SecretScanningAlert{PushProtectionBypassed: &zeroValue} + s.GetPushProtectionBypassed() + s = &SecretScanningAlert{} + s.GetPushProtectionBypassed() + s = nil + s.GetPushProtectionBypassed() +} + +func TestSecretScanningAlert_GetPushProtectionBypassedAt(tt *testing.T) { + var zeroValue Timestamp + s := &SecretScanningAlert{PushProtectionBypassedAt: &zeroValue} + s.GetPushProtectionBypassedAt() + s = &SecretScanningAlert{} + s.GetPushProtectionBypassedAt() + s = nil + s.GetPushProtectionBypassedAt() +} + +func TestSecretScanningAlert_GetPushProtectionBypassedBy(tt *testing.T) { + s := &SecretScanningAlert{} + s.GetPushProtectionBypassedBy() + s = nil + s.GetPushProtectionBypassedBy() +} + func TestSecretScanningAlert_GetRepository(tt *testing.T) { s := &SecretScanningAlert{} s.GetRepository() @@ -24157,6 +24184,16 @@ func TestSecretScanningAlert_GetResolution(tt *testing.T) { s.GetResolution() } +func TestSecretScanningAlert_GetResolutionComment(tt *testing.T) { + var zeroValue string + s := &SecretScanningAlert{ResolutionComment: &zeroValue} + s.GetResolutionComment() + s = &SecretScanningAlert{} + s.GetResolutionComment() + s = nil + s.GetResolutionComment() +} + func TestSecretScanningAlert_GetResolvedAt(tt *testing.T) { var zeroValue Timestamp s := &SecretScanningAlert{ResolvedAt: &zeroValue} @@ -24214,6 +24251,16 @@ func TestSecretScanningAlert_GetState(tt *testing.T) { s.GetState() } +func TestSecretScanningAlert_GetUpdatedAt(tt *testing.T) { + var zeroValue Timestamp + s := &SecretScanningAlert{UpdatedAt: &zeroValue} + s.GetUpdatedAt() + s = &SecretScanningAlert{} + s.GetUpdatedAt() + s = nil + s.GetUpdatedAt() +} + func TestSecretScanningAlert_GetURL(tt *testing.T) { var zeroValue string s := &SecretScanningAlert{URL: &zeroValue} diff --git a/github/secret_scanning.go b/github/secret_scanning.go index b8295cbf791..bea3f0e701f 100644 --- a/github/secret_scanning.go +++ b/github/secret_scanning.go @@ -16,19 +16,24 @@ type SecretScanningService service // SecretScanningAlert represents a GitHub secret scanning alert. type SecretScanningAlert struct { - Number *int `json:"number,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - URL *string `json:"url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - LocationsURL *string `json:"locations_url,omitempty"` - State *string `json:"state,omitempty"` - Resolution *string `json:"resolution,omitempty"` - ResolvedAt *Timestamp `json:"resolved_at,omitempty"` - ResolvedBy *User `json:"resolved_by,omitempty"` - SecretType *string `json:"secret_type,omitempty"` - SecretTypeDisplayName *string `json:"secret_type_display_name,omitempty"` - Secret *string `json:"secret,omitempty"` - Repository *Repository `json:"repository,omitempty"` + Number *int `json:"number,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + LocationsURL *string `json:"locations_url,omitempty"` + State *string `json:"state,omitempty"` + Resolution *string `json:"resolution,omitempty"` + ResolvedAt *Timestamp `json:"resolved_at,omitempty"` + ResolvedBy *User `json:"resolved_by,omitempty"` + SecretType *string `json:"secret_type,omitempty"` + SecretTypeDisplayName *string `json:"secret_type_display_name,omitempty"` + Secret *string `json:"secret,omitempty"` + Repository *Repository `json:"repository,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + PushProtectionBypassed *bool `json:"push_protection_bypassed,omitempty"` + PushProtectionBypassedBy *User `json:"push_protection_bypassed_by,omitempty"` + PushProtectionBypassedAt *Timestamp `json:"push_protection_bypassed_at,omitempty"` + ResolutionComment *string `json:"resolution_comment,omitempty"` } // SecretScanningAlertLocation represents the location for a secret scanning alert. From b45ef89f2dd0ec803ab8f27725bdb4941c0cbc99 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Tue, 19 Sep 2023 10:32:03 -0400 Subject: [PATCH 316/751] Fix SecretScanning API by switching arguments from url to json (#2934) Closes: #2871. --- github/github-accessors.go | 16 ---------------- github/github-accessors_test.go | 20 -------------------- github/secret_scanning.go | 18 ++++++++---------- github/secret_scanning_test.go | 4 ++-- 4 files changed, 10 insertions(+), 48 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index e7cfa86f89a..083d6139148 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -20958,22 +20958,6 @@ func (s *SecretScanningAlertUpdateOptions) GetResolution() string { return *s.Resolution } -// GetSecretType returns the SecretType field if it's non-nil, zero value otherwise. -func (s *SecretScanningAlertUpdateOptions) GetSecretType() string { - if s == nil || s.SecretType == nil { - return "" - } - return *s.SecretType -} - -// GetState returns the State field if it's non-nil, zero value otherwise. -func (s *SecretScanningAlertUpdateOptions) GetState() string { - if s == nil || s.State == nil { - return "" - } - return *s.State -} - // GetStatus returns the Status field if it's non-nil, zero value otherwise. func (s *SecretScanningPushProtection) GetStatus() string { if s == nil || s.Status == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index e2918beaff1..90d15369d0b 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -24440,26 +24440,6 @@ func TestSecretScanningAlertUpdateOptions_GetResolution(tt *testing.T) { s.GetResolution() } -func TestSecretScanningAlertUpdateOptions_GetSecretType(tt *testing.T) { - var zeroValue string - s := &SecretScanningAlertUpdateOptions{SecretType: &zeroValue} - s.GetSecretType() - s = &SecretScanningAlertUpdateOptions{} - s.GetSecretType() - s = nil - s.GetSecretType() -} - -func TestSecretScanningAlertUpdateOptions_GetState(tt *testing.T) { - var zeroValue string - s := &SecretScanningAlertUpdateOptions{State: &zeroValue} - s.GetState() - s = &SecretScanningAlertUpdateOptions{} - s.GetState() - s = nil - s.GetState() -} - func TestSecretScanningPushProtection_GetStatus(tt *testing.T) { var zeroValue string s := &SecretScanningPushProtection{Status: &zeroValue} diff --git a/github/secret_scanning.go b/github/secret_scanning.go index bea3f0e701f..30d3da8ebf8 100644 --- a/github/secret_scanning.go +++ b/github/secret_scanning.go @@ -80,16 +80,14 @@ type SecretScanningAlertListOptions struct { // SecretScanningAlertUpdateOptions specifies optional parameters to the SecretScanningService.UpdateAlert method. type SecretScanningAlertUpdateOptions struct { - // Required. Sets the state of the secret scanning alert. Can be either open or resolved. - // You must provide resolution when you set the state to resolved. - State *string `url:"state,omitempty"` - - // A comma-separated list of secret types to return. By default all secret types are returned. - SecretType *string `url:"secret_type,omitempty"` - - // Required when the state is resolved. The reason for resolving the alert. Can be one of false_positive, - // wont_fix, revoked, or used_in_tests. - Resolution *string `url:"resolution,omitempty"` + // State is required and sets the state of the secret scanning alert. + // Can be either "open" or "resolved". + // You must provide resolution when you set the state to "resolved". + State string `json:"state"` + + // Required when the state is "resolved" and represents the reason for resolving the alert. + // Can be one of: "false_positive", "wont_fix", "revoked", or "used_in_tests". + Resolution *string `json:"resolution,omitempty"` } // Lists secret scanning alerts for eligible repositories in an enterprise, from newest to oldest. diff --git a/github/secret_scanning_test.go b/github/secret_scanning_test.go index 2ca439aa470..7898d29a38c 100644 --- a/github/secret_scanning_test.go +++ b/github/secret_scanning_test.go @@ -359,7 +359,7 @@ func TestSecretScanningService_UpdateAlert(t *testing.T) { v := new(SecretScanningAlertUpdateOptions) assertNilError(t, json.NewDecoder(r.Body).Decode(v)) - want := &SecretScanningAlertUpdateOptions{State: String("resolved"), Resolution: String("used_in_tests")} + want := &SecretScanningAlertUpdateOptions{State: "resolved", Resolution: String("used_in_tests")} if !cmp.Equal(v, want) { t.Errorf("Request body = %+v, want %+v", v, want) @@ -381,7 +381,7 @@ func TestSecretScanningService_UpdateAlert(t *testing.T) { }) ctx := context.Background() - opts := &SecretScanningAlertUpdateOptions{State: String("resolved"), Resolution: String("used_in_tests")} + opts := &SecretScanningAlertUpdateOptions{State: "resolved", Resolution: String("used_in_tests")} alert, _, err := client.SecretScanning.UpdateAlert(ctx, "o", "r", 1, opts) if err != nil { From 9f1382e5fd78bff4b221e0310f44409190b6e05d Mon Sep 17 00:00:00 2001 From: WillAbides <233500+WillAbides@users.noreply.github.com> Date: Thu, 21 Sep 2023 08:53:43 -0500 Subject: [PATCH 317/751] Add development scripts (#2928) --- .codecov.yml | 2 + .github/workflows/linter.yml | 26 ++------ .github/workflows/tests.yml | 29 +++------ .gitignore | 2 + .golangci.yml | 1 + CONTRIBUTING.md | 112 ++++++++++++++++------------------ example/basicauth/main.go | 3 +- example/tagprotection/main.go | 3 +- example/tokenauth/main.go | 4 +- script/fmt.sh | 15 +++++ script/generate.sh | 48 +++++++++++++++ script/lint.sh | 38 ++++++++++++ script/test.sh | 26 ++++++++ 13 files changed, 204 insertions(+), 105 deletions(-) create mode 100755 script/fmt.sh create mode 100755 script/generate.sh create mode 100755 script/lint.sh create mode 100755 script/test.sh diff --git a/.codecov.yml b/.codecov.yml index 0f63adb3a6c..2ef223a6e96 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -3,3 +3,5 @@ ignore: - "github/github-accessors.go" # ignore experimental scrape package - "scrape" + # ignore update-urls + - "update-urls" diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 4bc27ab6f2d..98a1f5de8be 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -3,30 +3,14 @@ name: linter permissions: contents: read - pull-requests: read jobs: lint: - strategy: - matrix: - platform: [ubuntu-latest] - - # golangci-lint will only process a single module, so we need to call it - # separately for each module in the repo. We dont lint example/newreposecretwithlibsodium - # since that needs libsodium to run. - working-directory: - - "" - - example - - scrape - - update-urls - runs-on: ${{ matrix.platform }} - + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - - name: golangci-lint ${{ matrix.working-directory }} - uses: golangci/golangci-lint-action@v3 + - uses: actions/setup-go@v4 with: - version: latest - working-directory: ${{ matrix.working-directory}} - args: --verbose --timeout=10m + go-version: 1.x + cache-dependency-path: "**/go.sum" + - run: script/lint.sh diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 87d97f99c09..b3abd8b6f92 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -19,6 +19,9 @@ permissions: jobs: test: + defaults: + run: + shell: bash strategy: matrix: go-version: [1.x, 1.20.x] @@ -41,12 +44,11 @@ jobs: go-version: ${{ matrix.go-version }} - uses: actions/checkout@v4 - # Get values for cache paths to be used in later steps + # Get values for cache paths to be used in later steps - id: cache-paths run: | echo "go-cache=$(go env GOCACHE)" >> $GITHUB_OUTPUT echo "go-mod-cache=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT - shell: bash - name: Cache go modules uses: actions/cache@v3 @@ -57,29 +59,18 @@ jobs: key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: ${{ runner.os }}-go- - - name: Ensure go generate produces a zero diff - shell: bash - run: go generate -x ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code) - - name: Run go test - run: go test -v -race -coverprofile coverage.txt -covermode atomic ./... + run: | + if [ -n "${{ matrix.update-coverage }}" ]; then + script/test.sh -race -covermode atomic -coverprofile coverage.txt ./... + exit + fi + script/test.sh -race -covermode atomic ./... - name: Ensure integration tests build # don't actually run tests since they hit live GitHub API run: go test -v -tags=integration -run=^$ ./test/integration - - name: Run scrape tests - run: | - cd scrape - go test ./... - - name: Upload coverage to Codecov if: ${{ matrix.update-coverage }} uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d #v3.1.4 - - - name: Ensure go generate produces a zero diff for update-urls - shell: bash - run: cd update-urls && go generate -x ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code) - - - name: Run go test for update-urls - run: cd update-urls && go test -v -race ./... diff --git a/.gitignore b/.gitignore index 704f4ef5b54..0c803b53aa6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ *.sh +!/script/*.sh *.test coverage.out +/bin # intellij files .idea/ vendor/ diff --git a/.golangci.yml b/.golangci.yml index 3e286f045f4..d1ec5b11c92 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,6 +1,7 @@ run: build-tags: - integration + timeout: 10m linters: enable: - dogsled diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fb3660461fc..451924ce4c3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -31,68 +31,62 @@ are more sensitive, emailed to . ## Submitting a patch ## - 1. It's generally best to start by opening a new issue describing the bug or - feature you're intending to fix. Even if you think it's relatively minor, - it's helpful to know what people are working on. Mention in the initial - issue that you are planning to work on that bug or feature so that it can - be assigned to you. - - 1. Follow the normal process of [forking][] the project, and setup a new - branch to work in. It's important that each group of changes be done in - separate branches in order to ensure that a pull request only includes the - commits related to that bug or feature. - - 1. Go makes it very simple to ensure properly formatted code, so always run - `go fmt` on your code before committing it. You should also run - [go vet][] over your code. this will help you find common style issues - within your code and will keep styling consistent within the project. - - 1. Any significant changes should almost always be accompanied by tests. The - project already has good test coverage, so look at some of the existing - tests if you're unsure how to go about it. [gocov][] and [gocov-html][] - are invaluable tools for seeing which parts of your code aren't being - exercised by your tests. - - 1. Please run: - * `go generate github.com/google/go-github/...` - * `go test github.com/google/go-github/...` - * `go vet github.com/google/go-github/...` - - The `go generate ./...` command will update or generate certain files, and the - resulting changes should be included in your pull request. - - The `go test ./...` command will run tests inside your code. This will help you - spot places where code might be faulty before committing. - - And finally, the `go vet ./...` command will check linting and styling over your - code, keeping the project consistent formatting-wise. - - In any case, it is always a good idea to read [official Go documentation][] when working - on this project, as the definition of tools and commands of the Go programming - language is described in further detail there. - - 1. Do your best to have [well-formed commit messages][] for each change. - This provides consistency throughout the project, and ensures that commit - messages are able to be formatted properly by various git tools. - - 1. Finally, push the commits to your fork and submit a [pull request][]. - Before pushing commits, it is highly advised to check for generated files - that were either created or modified for the sake of your commit. Running - `go generate -x ./...` should return a log of modified generated files that should - be included alongside the manually written code in the commit. - **NOTE:** Please do not use force-push on PRs in this repo, as it makes - it more difficult for reviewers to see what has changed since the last - code review. - -[official Go documentation]: https://pkg.go.dev/std +1. It's generally best to start by opening a new issue describing the bug or + feature you're intending to fix. Even if you think it's relatively minor, + it's helpful to know what people are working on. Mention in the initial issue + that you are planning to work on that bug or feature so that it can be + assigned to you. + +2. Follow the normal process of [forking][] the project, and set up a new branch + to work in. It's important that each group of changes be done in separate + branches in order to ensure that a pull request only includes the commits + related to that bug or feature. + +3. Any significant changes should almost always be accompanied by tests. The + project already has good test coverage, so look at some of the existing tests + if you're unsure how to go about it. Coverage is [monitored by codecov.io][], + which flags pull requests that decrease test coverage. This doesn't + necessarily mean that PRs with decreased coverage won't be merged. Sometimes + a decrease in coverage makes sense, but if your PR is flagged, you should + either add tests to cover those lines or add a PR comment explaining the + untested lines. + +4. Run `script/fmt.sh`, `script/test.sh` and `script/lint.sh` to format your code and + check that it passes all tests and linters. `script/lint.sh` may also tell you + that generated files need to be updated. If so, run `script/generate.sh` to + update them. + +5. Do your best to have [well-formed commit messages][] for each change. This + provides consistency throughout the project, and ensures that commit messages + are able to be formatted properly by various git tools. + +6. Finally, push the commits to your fork and submit a [pull request][]. + **NOTE:** Please do not use force-push on PRs in this repo, as it makes it + more difficult for reviewers to see what has changed since the last code + review. We always perform "squash and merge" actions on PRs in this repo, so it doesn't + matter how many commits your PR has, as they will end up being a single commit after merging. + This is done to make a much cleaner `git log` history and helps to find regressions in the code + using existing tools such as `git bisect`. + [forking]: https://help.github.com/articles/fork-a-repo -[go vet]: https://pkg.go.dev/cmd/vet -[gocov]: https://github.com/axw/gocov -[gocov-html]: https://github.com/matm/gocov-html [well-formed commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html -[squash]: http://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits [pull request]: https://help.github.com/articles/creating-a-pull-request +[monitored by codecov.io]: https://codecov.io/gh/google/go-github + +## Scripts ## + +The `script` directory has shell scripts that help with common development +tasks. + +**script/fmt.sh** formats all go code in the repository. + +**script/generate.sh** runs code generators and `go mod tidy` on all modules. With +`--check` it checks that the generated files are current. + +**script/lint.sh** runs linters on the project and checks generated files are +current. +**script/test.sh** runs tests on all modules. ## Other notes on code organization ## @@ -144,5 +138,5 @@ this][modified-comment]. [rebase-comment]: https://github.com/google/go-github/pull/277#issuecomment-183035491 [modified-comment]: https://github.com/google/go-github/pull/280#issuecomment-184859046 -**When creating a release, don't forget to update the `Version` constant in `github.go`.** This is used to +**When creating a release, don't forget to update the `Version` constant in `github.go`.** This is used to send the version in the `User-Agent` header to identify clients to the GitHub API. diff --git a/example/basicauth/main.go b/example/basicauth/main.go index e677aa94a42..95ec4360c21 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -20,7 +20,6 @@ import ( "fmt" "os" "strings" - "syscall" "github.com/google/go-github/v55/github" "golang.org/x/term" @@ -32,7 +31,7 @@ func main() { username, _ := r.ReadString('\n') fmt.Print("GitHub Password: ") - bytePassword, _ := term.ReadPassword(syscall.Stdin) + bytePassword, _ := term.ReadPassword(int(os.Stdin.Fd())) password := string(bytePassword) tp := github.BasicAuthTransport{ diff --git a/example/tagprotection/main.go b/example/tagprotection/main.go index 3b9b723dd0f..4127d2b44de 100644 --- a/example/tagprotection/main.go +++ b/example/tagprotection/main.go @@ -17,7 +17,6 @@ import ( "log" "os" "strings" - "syscall" "github.com/google/go-github/v55/github" "golang.org/x/term" @@ -39,7 +38,7 @@ func main() { pattern = strings.TrimSpace(pattern) fmt.Print("GitHub Token: ") - byteToken, _ := term.ReadPassword(syscall.Stdin) + byteToken, _ := term.ReadPassword(int(os.Stdin.Fd())) println() token := string(byteToken) diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index 91ad5e5067a..ccd36543584 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -13,7 +13,7 @@ import ( "context" "fmt" "log" - "syscall" + "os" "github.com/google/go-github/v55/github" "golang.org/x/term" @@ -21,7 +21,7 @@ import ( func main() { fmt.Print("GitHub Token: ") - byteToken, _ := term.ReadPassword(syscall.Stdin) + byteToken, _ := term.ReadPassword(int(os.Stdin.Fd())) println() token := string(byteToken) diff --git a/script/fmt.sh b/script/fmt.sh new file mode 100755 index 00000000000..20ff6e69254 --- /dev/null +++ b/script/fmt.sh @@ -0,0 +1,15 @@ +#!/bin/sh +#/ script/fmt.sh runs go fmt on all go files in the project. + +set -e + +CDPATH="" cd -- "$(dirname -- "$0")/.." + +MOD_DIRS="$(git ls-files '*go.mod' | xargs dirname | sort)" + +for dir in $MOD_DIRS; do + ( + cd "$dir" + go fmt ./... + ) +done diff --git a/script/generate.sh b/script/generate.sh new file mode 100755 index 00000000000..17707b2385c --- /dev/null +++ b/script/generate.sh @@ -0,0 +1,48 @@ +#!/bin/sh +#/ script/generate.sh runs go generate on all modules in this repo. +#/ `script/generate.sh --check` checks that the generated files are up to date. + +set -e + +CDPATH="" cd -- "$(dirname -- "$0")/.." + +if [ "$1" = "--check" ]; then + GENTEMP="$(mktemp -d)" + git worktree add -q --detach "$GENTEMP" + trap 'git worktree remove -f "$GENTEMP"; rm -rf "$GENTEMP"' EXIT + for f in $(git ls-files -com --exclude-standard); do + target="$GENTEMP/$f" + mkdir -p "$(dirname -- "$target")" + cp "$f" "$target" + done + if [ -f "$(pwd)"/bin ]; then + ln -s "$(pwd)"/bin "$GENTEMP"/bin + fi + ( + cd "$GENTEMP" + git add . + git -c user.name='bot' -c user.email='bot@localhost' commit -m "generate" -q --allow-empty + script/generate.sh + [ -z "$(git status --porcelain)" ] || { + msg="Generated files are out of date. Please run script/generate.sh and commit the results" + if [ -n "$GITHUB_ACTIONS" ]; then + echo "::error ::$msg" + else + echo "$msg" 1>&2 + fi + git diff + exit 1 + } + ) + exit 0 +fi + +MOD_DIRS="$(git ls-files '*go.mod' | xargs dirname | sort)" + +for dir in $MOD_DIRS; do + ( + cd "$dir" + go generate ./... + go mod tidy -compat '1.17' + ) +done diff --git a/script/lint.sh b/script/lint.sh new file mode 100755 index 00000000000..af5ae991006 --- /dev/null +++ b/script/lint.sh @@ -0,0 +1,38 @@ +#!/bin/sh +#/ script/lint.sh runs linters and validates generated files. + +set -e + +GOLANGCI_LINT_VERSION="1.54.2" + +CDPATH="" cd -- "$(dirname -- "$0")/.." +BIN="$(pwd -P)"/bin + +mkdir -p "$BIN" + +# install golangci-lint bin/golangci-lint doesn't exist with the correct version +if ! "$BIN"/golangci-lint --version 2> /dev/null | grep -q "$GOLANGCI_LINT_VERSION"; then + GOBIN="$BIN" go install "github.com/golangci/golangci-lint/cmd/golangci-lint@v$GOLANGCI_LINT_VERSION" +fi + +MOD_DIRS="$(git ls-files '*go.mod' | xargs dirname | sort)" + +for dir in $MOD_DIRS; do + [ "$dir" = "example/newreposecretwithlibsodium" ] && continue + echo linting "$dir" + ( + cd "$dir" + # github actions output when running in an action + if [ -n "$GITHUB_ACTIONS" ]; then + "$BIN"/golangci-lint run --path-prefix "$dir" --out-format github-actions + else + "$BIN"/golangci-lint run --path-prefix "$dir" + fi + ) || FAILED=1 +done + +script/generate.sh --check || FAILED=1 + +if [ -n "$FAILED" ]; then + exit 1 +fi diff --git a/script/test.sh b/script/test.sh new file mode 100755 index 00000000000..23e6a0c8f84 --- /dev/null +++ b/script/test.sh @@ -0,0 +1,26 @@ +#!/bin/sh +#/ script/test.sh runs tests on each go module in go-github. Arguments are passed to each go test invocation. +#/ "-race -covermode atomic ./..." is used when no arguments are given. + +set -e + +CDPATH="" cd -- "$(dirname -- "$0")/.." + +if [ "$#" = "0" ]; then + set -- -race -covermode atomic ./... +fi + +MOD_DIRS="$(git ls-files '*go.mod' | xargs dirname | sort)" + +for dir in $MOD_DIRS; do + [ "$dir" = "example/newreposecretwithlibsodium" ] && continue + echo "testing $dir" + ( + cd "$dir" + go test "$@" + ) || FAILED=1 +done + +if [ -n "$FAILED" ]; then + exit 1 +fi From aa3fcbe7aabce60227eb210c0c81a8722770590d Mon Sep 17 00:00:00 2001 From: WillAbides <233500+WillAbides@users.noreply.github.com> Date: Thu, 21 Sep 2023 08:58:34 -0500 Subject: [PATCH 318/751] Remove openpgp and change CreateCommit signature (#2935) Fixes: #2932. --- example/commitpr/main.go | 24 ++- example/go.mod | 2 +- example/go.sum | 39 +++- example/newreposecretwithlibsodium/go.sum | 54 ----- github/git_commits.go | 58 ++++-- github/git_commits_test.go | 230 +++++++--------------- github/repos_commits_test.go | 2 - github/repos_contents_test.go | 2 - go.mod | 7 - go.sum | 18 -- 10 files changed, 169 insertions(+), 267 deletions(-) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index 328afda5469..7e73d7ffdef 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -21,15 +21,18 @@ package main import ( + "bytes" "context" "errors" "flag" "fmt" + "io" "log" "os" "strings" "time" + "github.com/ProtonMail/go-crypto/openpgp" "github.com/google/go-github/v55/github" ) @@ -51,6 +54,7 @@ If the file should be in the same location with the same name, you can just put Example: README.md,main.go:github/examples/commitpr/main.go`) authorName = flag.String("author-name", "", "Name of the author of the commit.") authorEmail = flag.String("author-email", "", "Email of the author of the commit.") + privateKey = flag.String("private-key", "", "Path to the private key to use to sign the commit.") ) var client *github.Client @@ -135,7 +139,25 @@ func pushCommit(ref *github.Reference, tree *github.Tree) (err error) { date := time.Now() author := &github.CommitAuthor{Date: &github.Timestamp{Time: date}, Name: authorName, Email: authorEmail} commit := &github.Commit{Author: author, Message: commitMessage, Tree: tree, Parents: []*github.Commit{parent.Commit}} - newCommit, _, err := client.Git.CreateCommit(ctx, *sourceOwner, *sourceRepo, commit) + opts := github.CreateCommitOptions{} + if *privateKey != "" { + armoredBlock, e := os.ReadFile(*privateKey) + if e != nil { + return e + } + keyring, e := openpgp.ReadArmoredKeyRing(bytes.NewReader(armoredBlock)) + if e != nil { + return e + } + if len(keyring) != 1 { + return errors.New("expected exactly one key in the keyring") + } + key := keyring[0] + opts.Signer = github.MessageSignerFunc(func(w io.Writer, r io.Reader) error { + return openpgp.ArmoredDetachSign(w, key, r, nil) + }) + } + newCommit, _, err := client.Git.CreateCommit(ctx, *sourceOwner, *sourceRepo, commit, &opts) if err != nil { return err } diff --git a/example/go.mod b/example/go.mod index eaf9f5b6926..7f7c9ededaa 100644 --- a/example/go.mod +++ b/example/go.mod @@ -3,6 +3,7 @@ module github.com/google/go-github/v55/example go 1.17 require ( + github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-ratelimit v1.0.3 github.com/google/go-github/v55 v55.0.0 @@ -12,7 +13,6 @@ require ( ) require ( - github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect github.com/cloudflare/circl v1.3.3 // indirect github.com/golang-jwt/jwt/v4 v4.0.0 // indirect github.com/golang/protobuf v1.5.2 // indirect diff --git a/example/go.sum b/example/go.sum index 513022c3565..7b1a57e73c8 100644 --- a/example/go.sum +++ b/example/go.sum @@ -1,9 +1,8 @@ -github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= -github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= +github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg= +github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 h1:tXKVfhE7FcSkhkv0UwkLvPDeZ4kz6OXd0PKPlFqf81M= github.com/bradleyfalzon/ghinstallation/v2 v2.0.4/go.mod h1:B40qPqJxWE0jDZgOR1JmaMy+4AY1eBP+IByOvqyAKp0= -github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= +github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/gofri/go-github-ratelimit v1.0.3 h1:Ocs2jaYokZDzgvqaajX+g04dqFyVqL0JQzoO7d2wmlk= @@ -23,29 +22,59 @@ github.com/google/go-github/v41 v41.0.0 h1:HseJrM2JFf2vfiZJ8anY2hqBjdfY1Vlj/K27u github.com/google/go-github/v41 v41.0.0/go.mod h1:XgmCA5H323A9rtgExdTcnDkcqp6S30AVACCBDOonIxg= 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/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= +golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.11.0 h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0= golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= diff --git a/example/newreposecretwithlibsodium/go.sum b/example/newreposecretwithlibsodium/go.sum index 236b1e435bd..dd58884a049 100644 --- a/example/newreposecretwithlibsodium/go.sum +++ b/example/newreposecretwithlibsodium/go.sum @@ -1,62 +1,8 @@ github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb h1:ilqSFSbR1fq6x88heeHrvAqlg+ES+tZk2ZcaCmiH1gI= github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb/go.mod h1:72TQeEkiDH9QMXZa5nJJvZre0UjqqO67X2QEIoOwCRU= -github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= -github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= -github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= -github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= -github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= 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/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= -golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/github/git_commits.go b/github/git_commits.go index 862837c0d59..1a683bc34c9 100644 --- a/github/git_commits.go +++ b/github/git_commits.go @@ -10,9 +10,8 @@ import ( "context" "errors" "fmt" + "io" "strings" - - "github.com/ProtonMail/go-crypto/openpgp" ) // SignatureVerification represents GPG signature verification. @@ -23,6 +22,25 @@ type SignatureVerification struct { Payload *string `json:"payload,omitempty"` } +// MessageSigner is used by GitService.CreateCommit to sign a commit. +// +// To create a MessageSigner that signs a commit with a [golang.org/x/crypto/openpgp.Entity], +// or [github.com/ProtonMail/go-crypto/openpgp.Entity], use: +// +// commit.Signer = github.MessageSignerFunc(func(w io.Writer, r io.Reader) error { +// return openpgp.ArmoredDetachSign(w, openpgpEntity, r, nil) +// }) +type MessageSigner interface { + Sign(w io.Writer, r io.Reader) error +} + +// MessageSignerFunc is a single function implementation of MessageSigner. +type MessageSignerFunc func(w io.Writer, r io.Reader) error + +func (f MessageSignerFunc) Sign(w io.Writer, r io.Reader) error { + return f(w, r) +} + // Commit represents a GitHub commit. type Commit struct { SHA *string `json:"sha,omitempty"` @@ -41,11 +59,6 @@ type Commit struct { // is only populated for requests that fetch GitHub data like // Pulls.ListCommits, Repositories.ListCommits, etc. CommentCount *int `json:"comment_count,omitempty"` - - // SigningKey denotes a key to sign the commit with. If not nil this key will - // be used to sign the commit. The private key must be present and already - // decrypted. Ignored if Verification.Signature is defined. - SigningKey *openpgp.Entity `json:"-"` } func (c Commit) String() string { @@ -96,6 +109,12 @@ type createCommit struct { Signature *string `json:"signature,omitempty"` } +type CreateCommitOptions struct { + // CreateCommit will sign the commit with this signer. See MessageSigner doc for more details. + // Ignored on commits where Verification.Signature is defined. + Signer MessageSigner +} + // CreateCommit creates a new commit in a repository. // commit must not be nil. // @@ -104,10 +123,13 @@ type createCommit struct { // the authenticated user’s information and the current date. // // GitHub API docs: https://docs.github.com/en/rest/git/commits#create-a-commit -func (s *GitService) CreateCommit(ctx context.Context, owner string, repo string, commit *Commit) (*Commit, *Response, error) { +func (s *GitService) CreateCommit(ctx context.Context, owner string, repo string, commit *Commit, opts *CreateCommitOptions) (*Commit, *Response, error) { if commit == nil { return nil, nil, fmt.Errorf("commit must be provided") } + if opts == nil { + opts = &CreateCommitOptions{} + } u := fmt.Sprintf("repos/%v/%v/git/commits", owner, repo) @@ -125,16 +147,16 @@ func (s *GitService) CreateCommit(ctx context.Context, owner string, repo string if commit.Tree != nil { body.Tree = commit.Tree.SHA } - if commit.SigningKey != nil { - signature, err := createSignature(commit.SigningKey, body) + switch { + case commit.Verification != nil: + body.Signature = commit.Verification.Signature + case opts.Signer != nil: + signature, err := createSignature(opts.Signer, body) if err != nil { return nil, nil, err } body.Signature = &signature } - if commit.Verification != nil { - body.Signature = commit.Verification.Signature - } req, err := s.client.NewRequest("POST", u, body) if err != nil { @@ -150,8 +172,8 @@ func (s *GitService) CreateCommit(ctx context.Context, owner string, repo string return c, resp, nil } -func createSignature(signingKey *openpgp.Entity, commit *createCommit) (string, error) { - if signingKey == nil || commit == nil { +func createSignature(signer MessageSigner, commit *createCommit) (string, error) { + if signer == nil { return "", errors.New("createSignature: invalid parameters") } @@ -160,9 +182,9 @@ func createSignature(signingKey *openpgp.Entity, commit *createCommit) (string, return "", err } - writer := new(bytes.Buffer) - reader := bytes.NewReader([]byte(message)) - if err := openpgp.ArmoredDetachSign(writer, signingKey, reader, nil); err != nil { + var writer bytes.Buffer + err = signer.Sign(&writer, strings.NewReader(message)) + if err != nil { return "", err } diff --git a/github/git_commits_test.go b/github/git_commits_test.go index ddb1672ea72..bc25206b495 100644 --- a/github/git_commits_test.go +++ b/github/git_commits_test.go @@ -9,15 +9,34 @@ import ( "context" "encoding/json" "fmt" + "io" "net/http" - "strings" "testing" "time" - "github.com/ProtonMail/go-crypto/openpgp" "github.com/google/go-cmp/cmp" ) +func mockSigner(t *testing.T, signature string, emitErr error, wantMessage string) MessageSignerFunc { + return func(w io.Writer, r io.Reader) error { + t.Helper() + message, err := io.ReadAll(r) + assertNilError(t, err) + if wantMessage != "" && string(message) != wantMessage { + t.Errorf("MessageSignerFunc got %q, want %q", string(message), wantMessage) + } + assertWrite(t, w, []byte(signature)) + return emitErr + } +} + +func uncalledSigner(t *testing.T) MessageSignerFunc { + return func(w io.Writer, r io.Reader) error { + t.Error("MessageSignerFunc should not be called") + return nil + } +} + func TestCommit_Marshal(t *testing.T) { testJSONMarshal(t, &Commit{}, "{}") @@ -65,7 +84,6 @@ func TestCommit_Marshal(t *testing.T) { }, NodeID: String("n"), CommentCount: Int(1), - SigningKey: &openpgp.Entity{}, } want := `{ @@ -190,7 +208,7 @@ func TestGitService_CreateCommit(t *testing.T) { }) ctx := context.Background() - commit, _, err := client.Git.CreateCommit(ctx, "o", "r", input) + commit, _, err := client.Git.CreateCommit(ctx, "o", "r", input, nil) if err != nil { t.Errorf("Git.CreateCommit returned error: %v", err) } @@ -202,12 +220,12 @@ func TestGitService_CreateCommit(t *testing.T) { const methodName = "CreateCommit" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Git.CreateCommit(ctx, "\n", "\n", input) + _, _, err = client.Git.CreateCommit(ctx, "\n", "\n", input, nil) return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Git.CreateCommit(ctx, "o", "r", input) + got, resp, err := client.Git.CreateCommit(ctx, "o", "r", input, nil) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -249,7 +267,7 @@ func TestGitService_CreateSignedCommit(t *testing.T) { }) ctx := context.Background() - commit, _, err := client.Git.CreateCommit(ctx, "o", "r", input) + commit, _, err := client.Git.CreateCommit(ctx, "o", "r", input, nil) if err != nil { t.Errorf("Git.CreateCommit returned error: %v", err) } @@ -261,12 +279,12 @@ func TestGitService_CreateSignedCommit(t *testing.T) { const methodName = "CreateCommit" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Git.CreateCommit(ctx, "\n", "\n", input) + _, _, err = client.Git.CreateCommit(ctx, "\n", "\n", input, nil) return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Git.CreateCommit(ctx, "o", "r", input) + got, resp, err := client.Git.CreateCommit(ctx, "o", "r", input, nil) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -278,103 +296,78 @@ func TestGitService_CreateSignedCommitWithInvalidParams(t *testing.T) { client, _, _, teardown := setup() defer teardown() - input := &Commit{ - SigningKey: &openpgp.Entity{}, - } + input := &Commit{} ctx := context.Background() - _, _, err := client.Git.CreateCommit(ctx, "o", "r", input) + opts := CreateCommitOptions{Signer: uncalledSigner(t)} + _, _, err := client.Git.CreateCommit(ctx, "o", "r", input, &opts) if err == nil { t.Errorf("Expected error to be returned because invalid params were passed") } } -func TestGitService_CreateSignedCommitWithNilCommit(t *testing.T) { +func TestGitService_CreateCommitWithNilCommit(t *testing.T) { client, _, _, teardown := setup() defer teardown() ctx := context.Background() - _, _, err := client.Git.CreateCommit(ctx, "o", "r", nil) + _, _, err := client.Git.CreateCommit(ctx, "o", "r", nil, nil) if err == nil { t.Errorf("Expected error to be returned because commit=nil") } } -func TestGitService_CreateSignedCommitWithKey(t *testing.T) { +func TestGitService_CreateCommit_WithSigner(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - s := strings.NewReader(testGPGKey) - keyring, err := openpgp.ReadArmoredKeyRing(s) - if err != nil { - t.Errorf("Error reading keyring: %+v", err) - } - - // Set the key lifetime to nil so we don't care about the example key expiring and making tests fail - keyring[0].Identities["go-github "].SelfSignature.KeyLifetimeSecs = nil - - date, _ := time.Parse("Mon Jan 02 15:04:05 2006 -0700", "Thu May 04 00:03:43 2017 +0200") + signature := "my voice is my password" + date := time.Date(2017, time.May, 4, 0, 3, 43, 0, time.FixedZone("CEST", 2*3600)) author := CommitAuthor{ Name: String("go-github"), Email: String("go-github@github.com"), Date: &Timestamp{date}, } - input := &Commit{ - Message: String("Commit Message."), - Tree: &Tree{SHA: String("t")}, - Parents: []*Commit{{SHA: String("p")}}, - SigningKey: keyring[0], - Author: &author, - } - - messageReader := strings.NewReader(`tree t + wantMessage := `tree t parent p author go-github 1493849023 +0200 committer go-github 1493849023 +0200 -Commit Message.`) - +Commit Message.` + sha := "commitSha" + input := &Commit{ + SHA: &sha, + Message: String("Commit Message."), + Tree: &Tree{SHA: String("t")}, + Parents: []*Commit{{SHA: String("p")}}, + Author: &author, + } + wantBody := createCommit{ + Message: input.Message, + Tree: String("t"), + Parents: []string{"p"}, + Author: &author, + Signature: &signature, + } + var gotBody createCommit mux.HandleFunc("/repos/o/r/git/commits", func(w http.ResponseWriter, r *http.Request) { - v := new(createCommit) - assertNilError(t, json.NewDecoder(r.Body).Decode(v)) - + assertNilError(t, json.NewDecoder(r.Body).Decode(&gotBody)) testMethod(t, r, "POST") - - want := &createCommit{ - Message: input.Message, - Tree: String("t"), - Parents: []string{"p"}, - Author: &author, - } - - sigReader := strings.NewReader(*v.Signature) - signer, err := openpgp.CheckArmoredDetachedSignature(keyring, messageReader, sigReader, nil) - if err != nil { - t.Errorf("Error verifying signature: %+v", err) - } - if signer.Identities["go-github "].Name != "go-github " { - t.Errorf("Signer is incorrect. got: %+v, want %+v", signer.Identities["go-github "].Name, "go-github ") - } - // Nullify Signature since we checked it above - v.Signature = nil - if !cmp.Equal(v, want) { - t.Errorf("Request body = %+v, want %+v", v, want) - } - fmt.Fprint(w, `{"sha":"commitSha"}`) + fmt.Fprintf(w, `{"sha":"%s"}`, sha) }) - ctx := context.Background() - commit, _, err := client.Git.CreateCommit(ctx, "o", "r", input) - if err != nil { - t.Errorf("Git.CreateCommit returned error: %v", err) + wantCommit := &Commit{SHA: String(sha)} + opts := CreateCommitOptions{Signer: mockSigner(t, signature, nil, wantMessage)} + commit, _, err := client.Git.CreateCommit(ctx, "o", "r", input, &opts) + assertNilError(t, err) + if cmp.Diff(gotBody, wantBody) != "" { + t.Errorf("Request body = %+v, want %+v\n%s", gotBody, wantBody, cmp.Diff(gotBody, wantBody)) } - - want := &Commit{SHA: String("commitSha")} - if !cmp.Equal(commit, want) { - t.Errorf("Git.CreateCommit returned %+v, want %+v", commit, want) + if cmp.Diff(commit, wantCommit) != "" { + t.Errorf("Git.CreateCommit returned %+v, want %+v\n%s", commit, wantCommit, cmp.Diff(commit, wantCommit)) } } -func TestGitService_createSignature_nilSigningKey(t *testing.T) { +func TestGitService_createSignature_nilSigner(t *testing.T) { a := &createCommit{ Message: String("Commit Message."), Tree: String("t"), @@ -389,48 +382,26 @@ func TestGitService_createSignature_nilSigningKey(t *testing.T) { } func TestGitService_createSignature_nilCommit(t *testing.T) { - _, err := createSignature(&openpgp.Entity{}, nil) + _, err := createSignature(uncalledSigner(t), nil) if err == nil { t.Errorf("Expected error to be returned because no author was passed") } } -func TestGitService_createSignature_noAuthor(t *testing.T) { +func TestGitService_createSignature_signerError(t *testing.T) { a := &createCommit{ Message: String("Commit Message."), Tree: String("t"), Parents: []string{"p"}, + Author: &CommitAuthor{Name: String("go-github")}, } - _, err := createSignature(&openpgp.Entity{}, a) - - if err == nil { - t.Errorf("Expected error to be returned because no author was passed") - } -} - -func TestGitService_createSignature_invalidKey(t *testing.T) { - date, _ := time.Parse("Mon Jan 02 15:04:05 2006 -0700", "Thu May 04 00:03:43 2017 +0200") - authorName := "go-github" - authorEmail := "go-github@github.com" - - signKey, _ := openpgp.NewEntity(authorName, "", authorEmail, nil) - _ = signKey.RevokeKey(0, "Invalidate key", nil) - - _, err := createSignature(signKey, &createCommit{ - Message: String("Commit Message."), - Tree: String("t"), - Parents: []string{"p"}, - Author: &CommitAuthor{ - Name: String("go-github"), - Email: String("go-github@github.com"), - Date: &Timestamp{date}, - }, - }) + signer := mockSigner(t, "", fmt.Errorf("signer error"), "") + _, err := createSignature(signer, a) if err == nil { - t.Errorf("Expected error to be returned due to invalid key") + t.Errorf("Expected error to be returned because signer returned an error") } } @@ -540,69 +511,10 @@ func TestGitService_CreateCommit_invalidOwner(t *testing.T) { defer teardown() ctx := context.Background() - _, _, err := client.Git.CreateCommit(ctx, "%", "%", &Commit{}) + _, _, err := client.Git.CreateCommit(ctx, "%", "%", &Commit{}, nil) testURLParseError(t, err) } -const testGPGKey = ` ------BEGIN PGP PRIVATE KEY BLOCK----- - -lQOYBFyi1qYBCAD3EPfLJzIt4qkAceUKkhdvfaIvOsBwXbfr5sSu/lkMqL0Wq47+ -iv+SRwOC7zvN8SlB8nPUgs5dbTRCJJfG5MAqTRR7KZRbyq2jBpi4BtmO30Ul/qId -3A18cVUfgVbxH85K9bdnyOxep/Q2NjLjTKmWLkzgmgkfbUmSLuWW9HRXPjYy9B7i -dOFD6GdkN/HwPAaId8ym0TE1mIuSpw8UQHyxusAkK52Pn4h/PgJhLTzbSi1X2eDt -OgzjhbdxTPzKFQfs97dY8y9C7Bt+CqH6Bvr3785LeKdxiUnCjfUJ+WAoJy780ec+ -IVwSpPp1CaEtzu73w6GH5945GELHE8HRe25FABEBAAEAB/9dtx72/VAoXZCTbaBe -iRnAnZwWZCe4t6PbJHa4lhv7FEpdPggIf3r/5lXrpYk+zdpDfI75LgDPKWwoJq83 -r29A3GoHabcvtkp0yzzEmTyO2BvnlJWz09N9v5N1Vt8+qTzb7CZ8hJc8NGMK6TYW -R+8P21In4+XP+OluPMGzp9g1etHScLhQUtF/xcN3JQGkeq4CPX6jUSYlJNeEtuLm -xjBTLBdg8zK5mJ3tolvnS/VhSTdiBeUaYtVt/qxq+fPqdFGHrO5H9ORbt56ahU+f -Ne86sOjQfJZPsx9z8ffP+XhLZPT1ZUGJMI/Vysx9gwDiEnaxrCJ02fO0Dnqsj/o2 -T14lBAD55+KtaS0C0OpHpA/F+XhL3IDcYQOYgu8idBTshr4vv7M+jdZqpECOn72Q -8SZJ+gYMcA9Z07Afnin1DVdtxiMN/tbyOu7e1BE7y77eA+zQw4PjLJPZJMbco7z+ -q9ZnZF3GyRyil6HkKUTfrao8AMtb0allZnqXwpPb5Mza32VqtwQA/RdbG6OIS6og -OpP7zKu4GP4guBk8NrVpVuV5Xz4r8JlL+POt0TadlT93coW/SajLrN/eeUwk6jQw -wrabmIGMarG5mrC4tnXLze5LICJTpOuqCACyFwL6w/ag+c7Qt9t9hvLMDFifcZW/ -mylqY7Z1eVcnbOcFsQG+0LzJBU0qouMEAKkXmJcQ3lJM8yoJuYOvbwexVR+5Y+5v -FNEGPlp3H/fq6ETYWHjMxPOE5dvGbQL8oKWZgkkHEGAKAavEGebM/y/qIPOCAluT -tn1sfx//n6kTMhswpg/3+BciUaJFjwYbIwUH5XD0vFbe9O2VOfTVdo1p19wegVs5 -LMf8rWFWYXtqUgG0IGdvLWdpdGh1YiA8Z28tZ2l0aHViQGdpdGh1Yi5jb20+iQFU -BBMBCAA+FiEELZ6AMqOpBMVblK0uiKTQXVy+MAsFAlyi1qYCGwMFCQPCZwAFCwkI -BwIGFQoJCAsCBBYCAwECHgECF4AACgkQiKTQXVy+MAtEYggA0LRecz71HUjEKXJj -C5Wgds1hZ0q+g3ew7zms4fuascd/2PqT5lItHU3oezdzMOHetSPvPzJILjl7RYcY -pWvoyzEBC5MutlmuzfwUa7qYCiuRDkYRjke8a4o8ijsxc8ANXwulXcI3udjAZdV0 -CKjrjPTyrHFUnPyZyaZp8p2eX62iPYhaXkoBnEiarf0xKtJuT/8IlP5n/redlKYz -GIHG5Svg3uDq9E09BOjFsgemhPyqbf7yrh5aRwDOIdHtn9mNevFPfQ1jO8lI/wbe -4kC6zXM7te0/ZkM06DYRhcaeoYdeyY/gvE+w7wU/+f7Wzqt+LxOMIjKk0oDxZIv9 -praEM50DmARcotamAQgAsiO75WZvjt7BEAzdTvWekWXqBo4NOes2UgzSYToVs6xW -8iXnE+mpDS7GHtNQLU6oeC0vizUjCwBfU+qGqw1JjI3I1pwv7xRqBIlA6f5ancVK -KiMx+/HxasbBrbav8DmZT8E8VaJhYM614Kav91W8YoqK5YXmP/A+OwwhkVEGo8v3 -Iy7mnJPMSjNiNTpiDgc5wvRiTan+uf+AtNPUS0k0fbrTZWosbrSmBymhrEy8stMj -rG2wZX5aRY7AXrQXoIXedqvP3kW/nqd0wvuiD11ZZWvoawjZRRVsT27DED0x2+o6 -aAEKrSLj8LlWvGVkD/jP9lSkC81uwGgD5VIMeXv6EQARAQABAAf7BHef8SdJ+ee9 -KLVh4WaIdPX80fBDBaZP5OvcZMLLo4dZYNYxfs7XxfRb1I8RDinQUL81V4TcHZ0D -Rvv1J5n8M7GkjTk6fIDjDb0RayzNQfKeIwNh8AMHvllApyYTMG+JWDYs2KrrTT2x -0vHrLMUyJbh6tjnO5eCU9u8dcmL5Syc6DzGUvDl6ZdJxlHEEJOwMlVCwQn5LQDVI -t0KEXigqs7eDCpTduJeAI7oA96s/8LwdlG5t6q9vbkEjl1XpR5FfKvJcZbd7Kmk9 -6R0EdbH6Ffe8qAp8lGmjx+91gqeL7jyl500H4gK/ybzlxQczIsbQ7WcZTPEnROIX -tCFWh6puvwQAyV6ygcatz+1BfCfgxWNYFXyowwOGSP9Nma+/aDVdeRCjZ69Is0lz -GV0NNqh7hpaoVbXS9Vc3sFOwBr5ZyKQaf07BoCDW+XJtvPyyZNLb004smtB5uHCf -uWDBpQ9erlrpSkOLgifbzfkYHdSvhc2ws9Tgab7Mk7P/ExOZjnUJPOcEAOJ3q/2/ -0wqRnkSelgkWwUmZ+hFIBz6lgWS3KTJs6Qc5WBnXono+EOoqhFxsiRM4lewExxHM -kPIcxb+0hiNz8hJkWOHEdgkXNim9Q08J0HPz6owtlD/rtmOi2+7d5BukbY/3JEXs -r2bjqbXXIE7heytIn/dQv7aEDyDqexiJKnpHBACQItjuYlewLt94NMNdGcwxmKdJ -bfaoIQz1h8fX5uSGKU+hXatI6sltD9PrhwwhdqJNcQ0K1dRkm24olO4I/sJwactI -G3r1UTq6BMV94eIyS/zZH5xChlOUavy9PrgU3kAK21bdmAFuNwbHnN34BBUk9J6f -IIxEZUOxw2CrKhsubUOuiQE8BBgBCAAmFiEELZ6AMqOpBMVblK0uiKTQXVy+MAsF -Alyi1qYCGwwFCQPCZwAACgkQiKTQXVy+MAstJAf/Tm2hfagVjzgJ5pFHmpP+fYxp -8dIPZLonP5HW12iaSOXThtvWBY578Cb9RmU+WkHyPXg8SyshW7aco4HrUDk+Qmyi -f9BvHS5RsLbyPlhgCqNkn+3QS62fZiIlbHLrQ/6iHXkgLV04Fnj+F4v8YYpOI9nY -NFc5iWm0zZRcLiRKZk1up8SCngyolcjVuTuCXDKyAUX1jRqDu7tlN0qVH0CYDGch -BqTKXNkzAvV+CKOyaUILSBBWdef+cxVrDCJuuC3894x3G1FjJycOy0m9PArvGtSG -g7/0Bp9oLXwiHzFoUMDvx+WlPnPHQNcufmQXUNdZvg+Ad4/unEU81EGDBDz3Eg== -=VFSn ------END PGP PRIVATE KEY BLOCK-----` - func TestSignatureVerification_Marshal(t *testing.T) { testJSONMarshal(t, &SignatureVerification{}, "{}") diff --git a/github/repos_commits_test.go b/github/repos_commits_test.go index fb8b45d4439..8fa8eb9f401 100644 --- a/github/repos_commits_test.go +++ b/github/repos_commits_test.go @@ -14,7 +14,6 @@ import ( "testing" "time" - "github.com/ProtonMail/go-crypto/openpgp" "github.com/google/go-cmp/cmp" ) @@ -713,7 +712,6 @@ func TestBranchCommit_Marshal(t *testing.T) { }, NodeID: String("n"), CommentCount: Int(1), - SigningKey: &openpgp.Entity{}, }, Protected: Bool(false), } diff --git a/github/repos_contents_test.go b/github/repos_contents_test.go index f9613069209..91da567f4aa 100644 --- a/github/repos_contents_test.go +++ b/github/repos_contents_test.go @@ -14,7 +14,6 @@ import ( "net/url" "testing" - "github.com/ProtonMail/go-crypto/openpgp" "github.com/google/go-cmp/cmp" ) @@ -885,7 +884,6 @@ func TestRepositoryContentResponse_Marshal(t *testing.T) { }, NodeID: String("n"), CommentCount: Int(1), - SigningKey: &openpgp.Entity{}, }, } diff --git a/go.mod b/go.mod index c41237ead0e..05f97f6f1ff 100644 --- a/go.mod +++ b/go.mod @@ -1,15 +1,8 @@ module github.com/google/go-github/v55 require ( - github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 github.com/google/go-cmp v0.5.9 github.com/google/go-querystring v1.1.0 ) -require ( - github.com/cloudflare/circl v1.3.3 // indirect - golang.org/x/crypto v0.12.0 // indirect - golang.org/x/sys v0.11.0 // indirect -) - go 1.17 diff --git a/go.sum b/go.sum index 3317d0c67b7..a2c5fe4a12f 100644 --- a/go.sum +++ b/go.sum @@ -1,24 +1,6 @@ -github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= -github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= -github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= -github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= -github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= -golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From 2d889e8d865c3bb7345366252f336d7cff366ea0 Mon Sep 17 00:00:00 2001 From: k0ral Date: Mon, 25 Sep 2023 17:07:47 +0000 Subject: [PATCH 319/751] Allow up to maxRedirects upon receiving HTTP 301 status (#2939) --- github/actions_artifacts.go | 4 ++-- github/actions_artifacts_test.go | 14 +++++++------- github/actions_workflow_jobs.go | 4 ++-- github/actions_workflow_jobs_test.go | 10 +++++----- github/actions_workflow_runs.go | 8 ++++---- github/actions_workflow_runs_test.go | 20 ++++++++++---------- github/github.go | 6 +++--- github/repos.go | 4 ++-- github/repos_contents.go | 4 ++-- github/repos_contents_test.go | 10 +++++----- github/repos_test.go | 12 ++++++------ test/integration/repos_test.go | 4 ++-- 12 files changed, 50 insertions(+), 50 deletions(-) diff --git a/github/actions_artifacts.go b/github/actions_artifacts.go index 441a53910e3..6389268b4ea 100644 --- a/github/actions_artifacts.go +++ b/github/actions_artifacts.go @@ -121,10 +121,10 @@ func (s *ActionsService) GetArtifact(ctx context.Context, owner, repo string, ar // DownloadArtifact gets a redirect URL to download an archive for a repository. // // GitHub API docs: https://docs.github.com/en/rest/actions/artifacts#download-an-artifact -func (s *ActionsService) DownloadArtifact(ctx context.Context, owner, repo string, artifactID int64, followRedirects bool) (*url.URL, *Response, error) { +func (s *ActionsService) DownloadArtifact(ctx context.Context, owner, repo string, artifactID int64, maxRedirects int) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/artifacts/%v/zip", owner, repo, artifactID) - resp, err := s.client.roundTripWithOptionalFollowRedirect(ctx, u, followRedirects) + resp, err := s.client.roundTripWithOptionalFollowRedirect(ctx, u, maxRedirects) if err != nil { return nil, nil, err } diff --git a/github/actions_artifacts_test.go b/github/actions_artifacts_test.go index de07c14f847..296e7259c08 100644 --- a/github/actions_artifacts_test.go +++ b/github/actions_artifacts_test.go @@ -277,7 +277,7 @@ func TestActionsSerivice_DownloadArtifact(t *testing.T) { }) ctx := context.Background() - url, resp, err := client.Actions.DownloadArtifact(ctx, "o", "r", 1, true) + url, resp, err := client.Actions.DownloadArtifact(ctx, "o", "r", 1, 1) if err != nil { t.Errorf("Actions.DownloadArtifact returned error: %v", err) } @@ -292,7 +292,7 @@ func TestActionsSerivice_DownloadArtifact(t *testing.T) { const methodName = "DownloadArtifact" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Actions.DownloadArtifact(ctx, "\n", "\n", -1, true) + _, _, err = client.Actions.DownloadArtifact(ctx, "\n", "\n", -1, 1) return err }) @@ -301,7 +301,7 @@ func TestActionsSerivice_DownloadArtifact(t *testing.T) { return nil, errors.New("failed to download artifact") }) testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Actions.DownloadArtifact(ctx, "o", "r", 1, true) + _, _, err = client.Actions.DownloadArtifact(ctx, "o", "r", 1, 1) return err }) } @@ -311,7 +311,7 @@ func TestActionsService_DownloadArtifact_invalidOwner(t *testing.T) { defer teardown() ctx := context.Background() - _, _, err := client.Actions.DownloadArtifact(ctx, "%", "r", 1, true) + _, _, err := client.Actions.DownloadArtifact(ctx, "%", "r", 1, 1) testURLParseError(t, err) } @@ -320,7 +320,7 @@ func TestActionsService_DownloadArtifact_invalidRepo(t *testing.T) { defer teardown() ctx := context.Background() - _, _, err := client.Actions.DownloadArtifact(ctx, "o", "%", 1, true) + _, _, err := client.Actions.DownloadArtifact(ctx, "o", "%", 1, 1) testURLParseError(t, err) } @@ -334,7 +334,7 @@ func TestActionsService_DownloadArtifact_StatusMovedPermanently_dontFollowRedire }) ctx := context.Background() - _, resp, _ := client.Actions.DownloadArtifact(ctx, "o", "r", 1, false) + _, resp, _ := client.Actions.DownloadArtifact(ctx, "o", "r", 1, 0) if resp.StatusCode != http.StatusMovedPermanently { t.Errorf("Actions.DownloadArtifact return status %d, want %d", resp.StatusCode, http.StatusMovedPermanently) } @@ -355,7 +355,7 @@ func TestActionsService_DownloadArtifact_StatusMovedPermanently_followRedirects( }) ctx := context.Background() - url, resp, err := client.Actions.DownloadArtifact(ctx, "o", "r", 1, true) + url, resp, err := client.Actions.DownloadArtifact(ctx, "o", "r", 1, 1) if err != nil { t.Errorf("Actions.DownloadArtifact return error: %v", err) } diff --git a/github/actions_workflow_jobs.go b/github/actions_workflow_jobs.go index 1f018b3e48e..87d117ba9a9 100644 --- a/github/actions_workflow_jobs.go +++ b/github/actions_workflow_jobs.go @@ -115,10 +115,10 @@ func (s *ActionsService) GetWorkflowJobByID(ctx context.Context, owner, repo str // GetWorkflowJobLogs gets a redirect URL to download a plain text file of logs for a workflow job. // // GitHub API docs: https://docs.github.com/en/rest/actions/workflow-jobs#download-job-logs-for-a-workflow-run -func (s *ActionsService) GetWorkflowJobLogs(ctx context.Context, owner, repo string, jobID int64, followRedirects bool) (*url.URL, *Response, error) { +func (s *ActionsService) GetWorkflowJobLogs(ctx context.Context, owner, repo string, jobID int64, maxRedirects int) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/jobs/%v/logs", owner, repo, jobID) - resp, err := s.client.roundTripWithOptionalFollowRedirect(ctx, u, followRedirects) + resp, err := s.client.roundTripWithOptionalFollowRedirect(ctx, u, maxRedirects) if err != nil { return nil, nil, err } diff --git a/github/actions_workflow_jobs_test.go b/github/actions_workflow_jobs_test.go index 8cea9545003..1cdf4a6c81a 100644 --- a/github/actions_workflow_jobs_test.go +++ b/github/actions_workflow_jobs_test.go @@ -138,7 +138,7 @@ func TestActionsService_GetWorkflowJobLogs(t *testing.T) { }) ctx := context.Background() - url, resp, err := client.Actions.GetWorkflowJobLogs(ctx, "o", "r", 399444496, true) + url, resp, err := client.Actions.GetWorkflowJobLogs(ctx, "o", "r", 399444496, 1) if err != nil { t.Errorf("Actions.GetWorkflowJobLogs returned error: %v", err) } @@ -152,7 +152,7 @@ func TestActionsService_GetWorkflowJobLogs(t *testing.T) { const methodName = "GetWorkflowJobLogs" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Actions.GetWorkflowJobLogs(ctx, "\n", "\n", 399444496, true) + _, _, err = client.Actions.GetWorkflowJobLogs(ctx, "\n", "\n", 399444496, 1) return err }) @@ -161,7 +161,7 @@ func TestActionsService_GetWorkflowJobLogs(t *testing.T) { return nil, errors.New("failed to get workflow logs") }) testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Actions.GetWorkflowJobLogs(ctx, "o", "r", 399444496, true) + _, _, err = client.Actions.GetWorkflowJobLogs(ctx, "o", "r", 399444496, 1) return err }) } @@ -176,7 +176,7 @@ func TestActionsService_GetWorkflowJobLogs_StatusMovedPermanently_dontFollowRedi }) ctx := context.Background() - _, resp, _ := client.Actions.GetWorkflowJobLogs(ctx, "o", "r", 399444496, false) + _, resp, _ := client.Actions.GetWorkflowJobLogs(ctx, "o", "r", 399444496, 0) if resp.StatusCode != http.StatusMovedPermanently { t.Errorf("Actions.GetWorkflowJobLogs returned status: %d, want %d", resp.StatusCode, http.StatusMovedPermanently) } @@ -199,7 +199,7 @@ func TestActionsService_GetWorkflowJobLogs_StatusMovedPermanently_followRedirect }) ctx := context.Background() - url, resp, err := client.Actions.GetWorkflowJobLogs(ctx, "o", "r", 399444496, true) + url, resp, err := client.Actions.GetWorkflowJobLogs(ctx, "o", "r", 399444496, 1) if err != nil { t.Errorf("Actions.GetWorkflowJobLogs returned error: %v", err) } diff --git a/github/actions_workflow_runs.go b/github/actions_workflow_runs.go index 00221086116..390c26af9c3 100644 --- a/github/actions_workflow_runs.go +++ b/github/actions_workflow_runs.go @@ -211,10 +211,10 @@ func (s *ActionsService) GetWorkflowRunAttempt(ctx context.Context, owner, repo // GetWorkflowRunAttemptLogs gets a redirect URL to download a plain text file of logs for a workflow run for attempt number. // // GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#download-workflow-run-attempt-logs -func (s *ActionsService) GetWorkflowRunAttemptLogs(ctx context.Context, owner, repo string, runID int64, attemptNumber int, followRedirects bool) (*url.URL, *Response, error) { +func (s *ActionsService) GetWorkflowRunAttemptLogs(ctx context.Context, owner, repo string, runID int64, attemptNumber int, maxRedirects int) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/attempts/%v/logs", owner, repo, runID, attemptNumber) - resp, err := s.client.roundTripWithOptionalFollowRedirect(ctx, u, followRedirects) + resp, err := s.client.roundTripWithOptionalFollowRedirect(ctx, u, maxRedirects) if err != nil { return nil, nil, err } @@ -287,10 +287,10 @@ func (s *ActionsService) CancelWorkflowRunByID(ctx context.Context, owner, repo // GetWorkflowRunLogs gets a redirect URL to download a plain text file of logs for a workflow run. // // GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#download-workflow-run-logs -func (s *ActionsService) GetWorkflowRunLogs(ctx context.Context, owner, repo string, runID int64, followRedirects bool) (*url.URL, *Response, error) { +func (s *ActionsService) GetWorkflowRunLogs(ctx context.Context, owner, repo string, runID int64, maxRedirects int) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/logs", owner, repo, runID) - resp, err := s.client.roundTripWithOptionalFollowRedirect(ctx, u, followRedirects) + resp, err := s.client.roundTripWithOptionalFollowRedirect(ctx, u, maxRedirects) if err != nil { return nil, nil, err } diff --git a/github/actions_workflow_runs_test.go b/github/actions_workflow_runs_test.go index 92cd3ad4f2f..8a573c20ac2 100644 --- a/github/actions_workflow_runs_test.go +++ b/github/actions_workflow_runs_test.go @@ -198,7 +198,7 @@ func TestActionsService_GetWorkflowRunAttemptLogs(t *testing.T) { }) ctx := context.Background() - url, resp, err := client.Actions.GetWorkflowRunAttemptLogs(ctx, "o", "r", 399444496, 2, true) + url, resp, err := client.Actions.GetWorkflowRunAttemptLogs(ctx, "o", "r", 399444496, 2, 1) if err != nil { t.Errorf("Actions.GetWorkflowRunAttemptLogs returned error: %v", err) } @@ -212,7 +212,7 @@ func TestActionsService_GetWorkflowRunAttemptLogs(t *testing.T) { const methodName = "GetWorkflowRunAttemptLogs" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Actions.GetWorkflowRunAttemptLogs(ctx, "\n", "\n", 399444496, 2, true) + _, _, err = client.Actions.GetWorkflowRunAttemptLogs(ctx, "\n", "\n", 399444496, 2, 1) return err }) } @@ -227,7 +227,7 @@ func TestActionsService_GetWorkflowRunAttemptLogs_StatusMovedPermanently_dontFol }) ctx := context.Background() - _, resp, _ := client.Actions.GetWorkflowRunAttemptLogs(ctx, "o", "r", 399444496, 2, false) + _, resp, _ := client.Actions.GetWorkflowRunAttemptLogs(ctx, "o", "r", 399444496, 2, 0) if resp.StatusCode != http.StatusMovedPermanently { t.Errorf("Actions.GetWorkflowRunAttemptLogs returned status: %d, want %d", resp.StatusCode, http.StatusMovedPermanently) } @@ -250,7 +250,7 @@ func TestActionsService_GetWorkflowRunAttemptLogs_StatusMovedPermanently_followR }) ctx := context.Background() - url, resp, err := client.Actions.GetWorkflowRunAttemptLogs(ctx, "o", "r", 399444496, 2, true) + url, resp, err := client.Actions.GetWorkflowRunAttemptLogs(ctx, "o", "r", 399444496, 2, 1) if err != nil { t.Errorf("Actions.GetWorkflowRunAttemptLogs returned error: %v", err) } @@ -266,7 +266,7 @@ func TestActionsService_GetWorkflowRunAttemptLogs_StatusMovedPermanently_followR const methodName = "GetWorkflowRunAttemptLogs" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Actions.GetWorkflowRunAttemptLogs(ctx, "\n", "\n", 399444496, 2, true) + _, _, err = client.Actions.GetWorkflowRunAttemptLogs(ctx, "\n", "\n", 399444496, 2, 1) return err }) } @@ -397,7 +397,7 @@ func TestActionsService_GetWorkflowRunLogs(t *testing.T) { }) ctx := context.Background() - url, resp, err := client.Actions.GetWorkflowRunLogs(ctx, "o", "r", 399444496, true) + url, resp, err := client.Actions.GetWorkflowRunLogs(ctx, "o", "r", 399444496, 1) if err != nil { t.Errorf("Actions.GetWorkflowRunLogs returned error: %v", err) } @@ -411,7 +411,7 @@ func TestActionsService_GetWorkflowRunLogs(t *testing.T) { const methodName = "GetWorkflowRunLogs" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Actions.GetWorkflowRunLogs(ctx, "\n", "\n", 399444496, true) + _, _, err = client.Actions.GetWorkflowRunLogs(ctx, "\n", "\n", 399444496, 1) return err }) } @@ -426,7 +426,7 @@ func TestActionsService_GetWorkflowRunLogs_StatusMovedPermanently_dontFollowRedi }) ctx := context.Background() - _, resp, _ := client.Actions.GetWorkflowRunLogs(ctx, "o", "r", 399444496, false) + _, resp, _ := client.Actions.GetWorkflowRunLogs(ctx, "o", "r", 399444496, 0) if resp.StatusCode != http.StatusMovedPermanently { t.Errorf("Actions.GetWorkflowJobLogs returned status: %d, want %d", resp.StatusCode, http.StatusMovedPermanently) } @@ -449,7 +449,7 @@ func TestActionsService_GetWorkflowRunLogs_StatusMovedPermanently_followRedirect }) ctx := context.Background() - url, resp, err := client.Actions.GetWorkflowRunLogs(ctx, "o", "r", 399444496, true) + url, resp, err := client.Actions.GetWorkflowRunLogs(ctx, "o", "r", 399444496, 1) if err != nil { t.Errorf("Actions.GetWorkflowJobLogs returned error: %v", err) } @@ -465,7 +465,7 @@ func TestActionsService_GetWorkflowRunLogs_StatusMovedPermanently_followRedirect const methodName = "GetWorkflowRunLogs" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Actions.GetWorkflowRunLogs(ctx, "\n", "\n", 399444496, true) + _, _, err = client.Actions.GetWorkflowRunLogs(ctx, "\n", "\n", 399444496, 1) return err }) } diff --git a/github/github.go b/github/github.go index e9ce136b7b6..dace1184719 100644 --- a/github/github.go +++ b/github/github.go @@ -1558,7 +1558,7 @@ func formatRateReset(d time.Duration) string { // When using roundTripWithOptionalFollowRedirect, note that it // is the responsibility of the caller to close the response body. -func (c *Client) roundTripWithOptionalFollowRedirect(ctx context.Context, u string, followRedirects bool, opts ...RequestOption) (*http.Response, error) { +func (c *Client) roundTripWithOptionalFollowRedirect(ctx context.Context, u string, maxRedirects int, opts ...RequestOption) (*http.Response, error) { req, err := c.NewRequest("GET", u, nil, opts...) if err != nil { return nil, err @@ -1577,10 +1577,10 @@ func (c *Client) roundTripWithOptionalFollowRedirect(ctx context.Context, u stri } // If redirect response is returned, follow it - if followRedirects && resp.StatusCode == http.StatusMovedPermanently { + if maxRedirects > 0 && resp.StatusCode == http.StatusMovedPermanently { _ = resp.Body.Close() u = resp.Header.Get("Location") - resp, err = c.roundTripWithOptionalFollowRedirect(ctx, u, false, opts...) + resp, err = c.roundTripWithOptionalFollowRedirect(ctx, u, maxRedirects-1, opts...) } return resp, err } diff --git a/github/repos.go b/github/repos.go index 83fc3f8e734..e09971abea9 100644 --- a/github/repos.go +++ b/github/repos.go @@ -1274,10 +1274,10 @@ func (s *RepositoriesService) ListBranches(ctx context.Context, owner string, re // GetBranch gets the specified branch for a repository. // // GitHub API docs: https://docs.github.com/en/rest/branches/branches#get-a-branch -func (s *RepositoriesService) GetBranch(ctx context.Context, owner, repo, branch string, followRedirects bool) (*Branch, *Response, error) { +func (s *RepositoriesService) GetBranch(ctx context.Context, owner, repo, branch string, maxRedirects int) (*Branch, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v", owner, repo, branch) - resp, err := s.client.roundTripWithOptionalFollowRedirect(ctx, u, followRedirects) + resp, err := s.client.roundTripWithOptionalFollowRedirect(ctx, u, maxRedirects) if err != nil { return nil, nil, err } diff --git a/github/repos_contents.go b/github/repos_contents.go index d59c735df8f..cfb4a6da22f 100644 --- a/github/repos_contents.go +++ b/github/repos_contents.go @@ -313,12 +313,12 @@ const ( // or github.Zipball constant. // // GitHub API docs: https://docs.github.com/en/rest/repos/contents/#get-archive-link -func (s *RepositoriesService) GetArchiveLink(ctx context.Context, owner, repo string, archiveformat ArchiveFormat, opts *RepositoryContentGetOptions, followRedirects bool) (*url.URL, *Response, error) { +func (s *RepositoriesService) GetArchiveLink(ctx context.Context, owner, repo string, archiveformat ArchiveFormat, opts *RepositoryContentGetOptions, maxRedirects int) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%s/%s/%s", owner, repo, archiveformat) if opts != nil && opts.Ref != "" { u += fmt.Sprintf("/%s", opts.Ref) } - resp, err := s.client.roundTripWithOptionalFollowRedirect(ctx, u, followRedirects) + resp, err := s.client.roundTripWithOptionalFollowRedirect(ctx, u, maxRedirects) if err != nil { return nil, nil, err } diff --git a/github/repos_contents_test.go b/github/repos_contents_test.go index 91da567f4aa..6310e739538 100644 --- a/github/repos_contents_test.go +++ b/github/repos_contents_test.go @@ -694,7 +694,7 @@ func TestRepositoriesService_GetArchiveLink(t *testing.T) { http.Redirect(w, r, "http://github.com/a", http.StatusFound) }) ctx := context.Background() - url, resp, err := client.Repositories.GetArchiveLink(ctx, "o", "r", Tarball, &RepositoryContentGetOptions{Ref: "yo"}, true) + url, resp, err := client.Repositories.GetArchiveLink(ctx, "o", "r", Tarball, &RepositoryContentGetOptions{Ref: "yo"}, 1) if err != nil { t.Errorf("Repositories.GetArchiveLink returned error: %v", err) } @@ -708,7 +708,7 @@ func TestRepositoriesService_GetArchiveLink(t *testing.T) { const methodName = "GetArchiveLink" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.GetArchiveLink(ctx, "\n", "\n", Tarball, &RepositoryContentGetOptions{}, true) + _, _, err = client.Repositories.GetArchiveLink(ctx, "\n", "\n", Tarball, &RepositoryContentGetOptions{}, 1) return err }) @@ -717,7 +717,7 @@ func TestRepositoriesService_GetArchiveLink(t *testing.T) { return nil, errors.New("failed to get archive link") }) testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.GetArchiveLink(ctx, "o", "r", Tarball, &RepositoryContentGetOptions{}, true) + _, _, err = client.Repositories.GetArchiveLink(ctx, "o", "r", Tarball, &RepositoryContentGetOptions{}, 1) return err }) } @@ -730,7 +730,7 @@ func TestRepositoriesService_GetArchiveLink_StatusMovedPermanently_dontFollowRed http.Redirect(w, r, "http://github.com/a", http.StatusMovedPermanently) }) ctx := context.Background() - _, resp, _ := client.Repositories.GetArchiveLink(ctx, "o", "r", Tarball, &RepositoryContentGetOptions{}, false) + _, resp, _ := client.Repositories.GetArchiveLink(ctx, "o", "r", Tarball, &RepositoryContentGetOptions{}, 0) if resp.StatusCode != http.StatusMovedPermanently { t.Errorf("Repositories.GetArchiveLink returned status: %d, want %d", resp.StatusCode, http.StatusMovedPermanently) } @@ -750,7 +750,7 @@ func TestRepositoriesService_GetArchiveLink_StatusMovedPermanently_followRedirec http.Redirect(w, r, "http://github.com/a", http.StatusFound) }) ctx := context.Background() - url, resp, err := client.Repositories.GetArchiveLink(ctx, "o", "r", Tarball, &RepositoryContentGetOptions{}, true) + url, resp, err := client.Repositories.GetArchiveLink(ctx, "o", "r", Tarball, &RepositoryContentGetOptions{}, 1) if err != nil { t.Errorf("Repositories.GetArchiveLink returned error: %v", err) } diff --git a/github/repos_test.go b/github/repos_test.go index df99b6fc8b7..6aba962a91f 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -925,7 +925,7 @@ func TestRepositoriesService_GetBranch(t *testing.T) { }) ctx := context.Background() - branch, _, err := client.Repositories.GetBranch(ctx, "o", "r", "b", false) + branch, _, err := client.Repositories.GetBranch(ctx, "o", "r", "b", 0) if err != nil { t.Errorf("Repositories.GetBranch returned error: %v", err) } @@ -947,7 +947,7 @@ func TestRepositoriesService_GetBranch(t *testing.T) { const methodName = "GetBranch" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.GetBranch(ctx, "\n", "\n", "\n", false) + _, _, err = client.Repositories.GetBranch(ctx, "\n", "\n", "\n", 0) return err }) } @@ -962,7 +962,7 @@ func TestRepositoriesService_GetBranch_BadJSONResponse(t *testing.T) { }) ctx := context.Background() - if _, _, err := client.Repositories.GetBranch(ctx, "o", "r", "b", false); err == nil { + if _, _, err := client.Repositories.GetBranch(ctx, "o", "r", "b", 0); err == nil { t.Error("Repositories.GetBranch returned no error; wanted JSON error") } } @@ -981,7 +981,7 @@ func TestRepositoriesService_GetBranch_StatusMovedPermanently_followRedirects(t fmt.Fprint(w, `{"name":"n", "commit":{"sha":"s","commit":{"message":"m"}}, "protected":true}`) }) ctx := context.Background() - branch, resp, err := client.Repositories.GetBranch(ctx, "o", "r", "b", true) + branch, resp, err := client.Repositories.GetBranch(ctx, "o", "r", "b", 1) if err != nil { t.Errorf("Repositories.GetBranch returned error: %v", err) } @@ -1013,7 +1013,7 @@ func TestRepositoriesService_GetBranch_notFound(t *testing.T) { http.Error(w, "branch not found", http.StatusNotFound) }) ctx := context.Background() - _, resp, err := client.Repositories.GetBranch(ctx, "o", "r", "b", true) + _, resp, err := client.Repositories.GetBranch(ctx, "o", "r", "b", 1) if err == nil { t.Error("Repositories.GetBranch returned error: nil") } @@ -1028,7 +1028,7 @@ func TestRepositoriesService_GetBranch_notFound(t *testing.T) { const methodName = "GetBranch" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.GetBranch(ctx, "\n", "\n", "\n", true) + _, _, err = client.Repositories.GetBranch(ctx, "\n", "\n", "\n", 1) return err }) } diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index f6d72d5edd8..cc6ff0425c8 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -64,7 +64,7 @@ func TestRepositories_BranchesTags(t *testing.T) { t.Fatalf("Repositories.ListBranches('git', 'git') returned no branches") } - _, _, err = client.Repositories.GetBranch(context.Background(), "git", "git", *branches[0].Name, false) + _, _, err = client.Repositories.GetBranch(context.Background(), "git", "git", *branches[0].Name, 0) if err != nil { t.Fatalf("Repositories.GetBranch() returned error: %v", err) } @@ -91,7 +91,7 @@ func TestRepositories_EditBranches(t *testing.T) { t.Fatalf("createRandomTestRepository returned error: %v", err) } - branch, _, err := client.Repositories.GetBranch(context.Background(), *repo.Owner.Login, *repo.Name, "master", false) + branch, _, err := client.Repositories.GetBranch(context.Background(), *repo.Owner.Login, *repo.Name, "master", 0) if err != nil { t.Fatalf("Repositories.GetBranch() returned error: %v", err) } From e6f58e6e786881caeb29aa5739294d2f42179785 Mon Sep 17 00:00:00 2001 From: nxya Date: Thu, 28 Sep 2023 20:24:13 -0400 Subject: [PATCH 320/751] Add enterprise actions permissions endpoints and reorg files (#2920) --- github/actions_permissions_enterprise.go | 191 ++++++++++ github/actions_permissions_enterprise_test.go | 298 ++++++++++++++++ github/actions_permissions_orgs.go | 204 +++++++++++ github/actions_permissions_orgs_test.go | 336 ++++++++++++++++++ github/actions_runners.go | 89 ----- github/actions_runners_test.go | 127 ------- github/github-accessors.go | 24 ++ github/github-accessors_test.go | 30 ++ github/github-stringify_test.go | 12 + github/orgs_actions_allowed.go | 47 +-- github/orgs_actions_allowed_test.go | 38 -- github/orgs_actions_permissions.go | 47 +-- 12 files changed, 1107 insertions(+), 336 deletions(-) create mode 100644 github/actions_permissions_enterprise.go create mode 100644 github/actions_permissions_enterprise_test.go create mode 100644 github/actions_permissions_orgs.go create mode 100644 github/actions_permissions_orgs_test.go diff --git a/github/actions_permissions_enterprise.go b/github/actions_permissions_enterprise.go new file mode 100644 index 00000000000..8311e729438 --- /dev/null +++ b/github/actions_permissions_enterprise.go @@ -0,0 +1,191 @@ +// Copyright 2023 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" +) + +// ActionsEnabledOnEnterpriseOrgs represents all the repositories in an enterprise for which Actions is enabled. +type ActionsEnabledOnEnterpriseRepos struct { + TotalCount int `json:"total_count"` + Organizations []*Organization `json:"organizations"` +} + +// ActionsPermissionsEnterprise represents a policy for allowed actions in an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions +type ActionsPermissionsEnterprise struct { + EnabledOrganizations *string `json:"enabled_organizations,omitempty"` + AllowedActions *string `json:"allowed_actions,omitempty"` + SelectedActionsURL *string `json:"selected_actions_url,omitempty"` +} + +func (a ActionsPermissionsEnterprise) String() string { + return Stringify(a) +} + +// GetActionsPermissionsInEnterprise gets the GitHub Actions permissions policy for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-github-actions-permissions-for-an-enterprise +func (s *ActionsService) GetActionsPermissionsInEnterprise(ctx context.Context, enterprise string) (*ActionsPermissionsEnterprise, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/permissions", enterprise) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + permissions := new(ActionsPermissionsEnterprise) + resp, err := s.client.Do(ctx, req, permissions) + if err != nil { + return nil, resp, err + } + + return permissions, resp, nil +} + +// EditActionsPermissionsInEnterprise sets the permissions policy in an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-github-actions-permissions-for-an-enterprise +func (s *ActionsService) EditActionsPermissionsInEnterprise(ctx context.Context, enterprise string, actionsPermissionsEnterprise ActionsPermissionsEnterprise) (*ActionsPermissionsEnterprise, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/permissions", enterprise) + req, err := s.client.NewRequest("PUT", u, actionsPermissionsEnterprise) + if err != nil { + return nil, nil, err + } + + p := new(ActionsPermissionsEnterprise) + resp, err := s.client.Do(ctx, req, p) + if err != nil { + return nil, resp, err + } + + return p, resp, nil +} + +// ListEnabledOrgsInEnterprise lists the selected organizations that are enabled for GitHub Actions in an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#list-selected-organizations-enabled-for-github-actions-in-an-enterprise +func (s *ActionsService) ListEnabledOrgsInEnterprise(ctx context.Context, owner string, opts *ListOptions) (*ActionsEnabledOnEnterpriseRepos, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/permissions/organizations", owner) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + orgs := &ActionsEnabledOnEnterpriseRepos{} + resp, err := s.client.Do(ctx, req, orgs) + if err != nil { + return nil, resp, err + } + + return orgs, resp, nil +} + +// SetEnabledOrgsInEnterprise replaces the list of selected organizations that are enabled for GitHub Actions in an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-selected-organizations-enabled-for-github-actions-in-an-enterprise +func (s *ActionsService) SetEnabledOrgsInEnterprise(ctx context.Context, owner string, organizationIDs []int64) (*Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/permissions/organizations", owner) + + req, err := s.client.NewRequest("PUT", u, struct { + IDs []int64 `json:"selected_organization_ids"` + }{IDs: organizationIDs}) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req, nil) + if err != nil { + return resp, err + } + + return resp, nil +} + +// AddEnabledOrgInEnterprise adds an organization to the list of selected organizations that are enabled for GitHub Actions in an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#enable-a-selected-organization-for-github-actions-in-an-enterprise +func (s *ActionsService) AddEnabledOrgInEnterprise(ctx context.Context, owner string, organizationID int64) (*Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/permissions/organizations/%v", owner, organizationID) + + 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 +} + +// RemoveEnabledOrgInEnterprise removes an organization from the list of selected organizations that are enabled for GitHub Actions in an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#disable-a-selected-organization-for-github-actions-in-an-enterprise +func (s *ActionsService) RemoveEnabledOrgInEnterprise(ctx context.Context, owner string, organizationID int64) (*Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/permissions/organizations/%v", owner, organizationID) + + 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 +} + +// GetActionsAllowedInEnterprise gets the actions that are allowed in an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-enterprise +func (s *ActionsService) GetActionsAllowedInEnterprise(ctx context.Context, enterprise string) (*ActionsAllowed, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/permissions/selected-actions", enterprise) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + actionsAllowed := new(ActionsAllowed) + resp, err := s.client.Do(ctx, req, actionsAllowed) + if err != nil { + return nil, resp, err + } + + return actionsAllowed, resp, nil +} + +// EditActionsAllowedInEnterprise sets the actions that are allowed in an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-enterprise +func (s *ActionsService) EditActionsAllowedInEnterprise(ctx context.Context, enterprise string, actionsAllowed ActionsAllowed) (*ActionsAllowed, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/permissions/selected-actions", enterprise) + req, err := s.client.NewRequest("PUT", u, actionsAllowed) + if err != nil { + return nil, nil, err + } + + p := new(ActionsAllowed) + resp, err := s.client.Do(ctx, req, p) + if err != nil { + return nil, resp, err + } + + return p, resp, nil +} diff --git a/github/actions_permissions_enterprise_test.go b/github/actions_permissions_enterprise_test.go new file mode 100644 index 00000000000..14e8e3a6b33 --- /dev/null +++ b/github/actions_permissions_enterprise_test.go @@ -0,0 +1,298 @@ +// Copyright 2023 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 TestActionsService_GetActionsPermissionsInEnterprise(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/enterprises/e/actions/permissions", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"enabled_organizations": "all", "allowed_actions": "all"}`) + }) + + ctx := context.Background() + ent, _, err := client.Actions.GetActionsPermissionsInEnterprise(ctx, "e") + if err != nil { + t.Errorf("Actions.GetActionsPermissionsInEnterprise returned error: %v", err) + } + want := &ActionsPermissionsEnterprise{EnabledOrganizations: String("all"), AllowedActions: String("all")} + if !cmp.Equal(ent, want) { + t.Errorf("Actions.GetActionsPermissionsInEnterprise returned %+v, want %+v", ent, want) + } + + const methodName = "GetActionsPermissionsInEnterprise" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.GetActionsPermissionsInEnterprise(ctx, "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.GetActionsPermissionsInEnterprise(ctx, "e") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_EditActionsPermissionsInEnterprise(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + input := &ActionsPermissionsEnterprise{EnabledOrganizations: String("all"), AllowedActions: String("selected")} + + mux.HandleFunc("/enterprises/e/actions/permissions", func(w http.ResponseWriter, r *http.Request) { + v := new(ActionsPermissionsEnterprise) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) + + testMethod(t, r, "PUT") + if !cmp.Equal(v, input) { + t.Errorf("Request body = %+v, want %+v", v, input) + } + + fmt.Fprint(w, `{"enabled_organizations": "all", "allowed_actions": "selected"}`) + }) + + ctx := context.Background() + ent, _, err := client.Actions.EditActionsPermissionsInEnterprise(ctx, "e", *input) + if err != nil { + t.Errorf("Actions.EditActionsPermissionsInEnterprise returned error: %v", err) + } + + want := &ActionsPermissionsEnterprise{EnabledOrganizations: String("all"), AllowedActions: String("selected")} + if !cmp.Equal(ent, want) { + t.Errorf("Actions.EditActionsPermissionsInEnterprise returned %+v, want %+v", ent, want) + } + + const methodName = "EditActionsPermissionsInEnterprise" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.EditActionsPermissionsInEnterprise(ctx, "\n", *input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.EditActionsPermissionsInEnterprise(ctx, "e", *input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_ListEnabledOrgsInEnterprise(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/enterprises/e/actions/permissions/organizations", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{ + "page": "1", + }) + fmt.Fprint(w, `{"total_count":2,"organizations":[{"id":2}, {"id":3}]}`) + }) + + ctx := context.Background() + opt := &ListOptions{ + Page: 1, + } + got, _, err := client.Actions.ListEnabledOrgsInEnterprise(ctx, "e", opt) + if err != nil { + t.Errorf("Actions.ListEnabledOrgsInEnterprise returned error: %v", err) + } + + want := &ActionsEnabledOnEnterpriseRepos{TotalCount: int(2), Organizations: []*Organization{ + {ID: Int64(2)}, + {ID: Int64(3)}, + }} + if !cmp.Equal(got, want) { + t.Errorf("Actions.ListEnabledOrgsInEnterprise returned %+v, want %+v", got, want) + } + + const methodName = "ListEnabledOrgsInEnterprise" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.ListEnabledOrgsInEnterprise(ctx, "\n", opt) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.ListEnabledOrgsInEnterprise(ctx, "e", opt) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_SetEnabledOrgsInEnterprise(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/enterprises/e/actions/permissions/organizations", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + testHeader(t, r, "Content-Type", "application/json") + testBody(t, r, `{"selected_organization_ids":[123,1234]}`+"\n") + w.WriteHeader(http.StatusNoContent) + }) + + ctx := context.Background() + _, err := client.Actions.SetEnabledOrgsInEnterprise(ctx, "e", []int64{123, 1234}) + if err != nil { + t.Errorf("Actions.SetEnabledOrgsInEnterprise returned error: %v", err) + } + + const methodName = "SetEnabledOrgsInEnterprise" + + testBadOptions(t, methodName, func() (err error) { + _, err = client.Actions.SetEnabledOrgsInEnterprise(ctx, "\n", []int64{123, 1234}) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Actions.SetEnabledOrgsInEnterprise(ctx, "e", []int64{123, 1234}) + }) +} + +func TestActionsService_AddEnabledOrgInEnterprise(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/enterprises/e/actions/permissions/organizations/123", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + w.WriteHeader(http.StatusNoContent) + }) + + ctx := context.Background() + _, err := client.Actions.AddEnabledOrgInEnterprise(ctx, "e", 123) + if err != nil { + t.Errorf("Actions.AddEnabledOrgInEnterprise returned error: %v", err) + } + + const methodName = "AddEnabledOrgInEnterprise" + + testBadOptions(t, methodName, func() (err error) { + _, err = client.Actions.AddEnabledOrgInEnterprise(ctx, "\n", 123) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Actions.AddEnabledOrgInEnterprise(ctx, "e", 123) + }) +} + +func TestActionsService_RemoveEnabledOrgInEnterprise(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/enterprises/e/actions/permissions/organizations/123", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + w.WriteHeader(http.StatusNoContent) + }) + + ctx := context.Background() + _, err := client.Actions.RemoveEnabledOrgInEnterprise(ctx, "e", 123) + if err != nil { + t.Errorf("Actions.RemoveEnabledOrgInEnterprise returned error: %v", err) + } + + const methodName = "RemoveEnabledOrgInEnterprise" + + testBadOptions(t, methodName, func() (err error) { + _, err = client.Actions.RemoveEnabledOrgInEnterprise(ctx, "\n", 123) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Actions.RemoveEnabledOrgInEnterprise(ctx, "e", 123) + }) +} + +func TestActionsService_GetActionsAllowedInEnterprise(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/enterprises/e/actions/permissions/selected-actions", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"github_owned_allowed":true, "verified_allowed":false, "patterns_allowed":["a/b"]}`) + }) + + ctx := context.Background() + ent, _, err := client.Actions.GetActionsAllowedInEnterprise(ctx, "e") + if err != nil { + t.Errorf("Actions.GetActionsAllowedInEnterprise returned error: %v", err) + } + want := &ActionsAllowed{GithubOwnedAllowed: Bool(true), VerifiedAllowed: Bool(false), PatternsAllowed: []string{"a/b"}} + if !cmp.Equal(ent, want) { + t.Errorf("Actions.GetActionsAllowedInEnterprise returned %+v, want %+v", ent, want) + } + + const methodName = "GetActionsAllowedInEnterprise" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.GetActionsAllowedInEnterprise(ctx, "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.GetActionsAllowedInEnterprise(ctx, "e") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_EditActionsAllowedInEnterprise(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + input := &ActionsAllowed{GithubOwnedAllowed: Bool(true), VerifiedAllowed: Bool(false), PatternsAllowed: []string{"a/b"}} + + mux.HandleFunc("/enterprises/e/actions/permissions/selected-actions", func(w http.ResponseWriter, r *http.Request) { + v := new(ActionsAllowed) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) + + testMethod(t, r, "PUT") + if !cmp.Equal(v, input) { + t.Errorf("Request body = %+v, want %+v", v, input) + } + + fmt.Fprint(w, `{"github_owned_allowed":true, "verified_allowed":false, "patterns_allowed":["a/b"]}`) + }) + + ctx := context.Background() + ent, _, err := client.Actions.EditActionsAllowedInEnterprise(ctx, "e", *input) + if err != nil { + t.Errorf("Actions.EditActionsAllowedInEnterprise returned error: %v", err) + } + + want := &ActionsAllowed{GithubOwnedAllowed: Bool(true), VerifiedAllowed: Bool(false), PatternsAllowed: []string{"a/b"}} + if !cmp.Equal(ent, want) { + t.Errorf("Actions.EditActionsAllowedInEnterprise returned %+v, want %+v", ent, want) + } + + const methodName = "EditActionsAllowedInEnterprise" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.EditActionsAllowedInEnterprise(ctx, "\n", *input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.EditActionsAllowedInEnterprise(ctx, "e", *input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} diff --git a/github/actions_permissions_orgs.go b/github/actions_permissions_orgs.go new file mode 100644 index 00000000000..801f1d97437 --- /dev/null +++ b/github/actions_permissions_orgs.go @@ -0,0 +1,204 @@ +// Copyright 2023 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" +) + +// ActionsPermissions represents a policy for repositories and allowed actions in an organization. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions +type ActionsPermissions struct { + EnabledRepositories *string `json:"enabled_repositories,omitempty"` + AllowedActions *string `json:"allowed_actions,omitempty"` + SelectedActionsURL *string `json:"selected_actions_url,omitempty"` +} + +func (a ActionsPermissions) String() string { + return Stringify(a) +} + +// ActionsEnabledOnOrgRepos represents all the repositories in an organization for which Actions is enabled. +type ActionsEnabledOnOrgRepos struct { + TotalCount int `json:"total_count"` + Repositories []*Repository `json:"repositories"` +} + +// ActionsAllowed represents selected actions that are allowed. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions +type ActionsAllowed struct { + GithubOwnedAllowed *bool `json:"github_owned_allowed,omitempty"` + VerifiedAllowed *bool `json:"verified_allowed,omitempty"` + PatternsAllowed []string `json:"patterns_allowed,omitempty"` +} + +func (a ActionsAllowed) String() string { + return Stringify(a) +} + +// GetActionsPermissions gets the GitHub Actions permissions policy for repositories and allowed actions in an organization. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#get-github-actions-permissions-for-an-organization +func (s *ActionsService) GetActionsPermissions(ctx context.Context, org string) (*ActionsPermissions, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/permissions", org) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + permissions := new(ActionsPermissions) + resp, err := s.client.Do(ctx, req, permissions) + if err != nil { + return nil, resp, err + } + + return permissions, resp, nil +} + +// EditActionsPermissions sets the permissions policy for repositories and allowed actions in an organization. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-github-actions-permissions-for-an-organization +func (s *ActionsService) EditActionsPermissions(ctx context.Context, org string, actionsPermissions ActionsPermissions) (*ActionsPermissions, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/permissions", org) + req, err := s.client.NewRequest("PUT", u, actionsPermissions) + if err != nil { + return nil, nil, err + } + + p := new(ActionsPermissions) + resp, err := s.client.Do(ctx, req, p) + if err != nil { + return nil, resp, err + } + + return p, resp, nil +} + +// ListEnabledReposInOrg lists the selected repositories that are enabled for GitHub Actions in an organization. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#list-selected-repositories-enabled-for-github-actions-in-an-organization +func (s *ActionsService) ListEnabledReposInOrg(ctx context.Context, owner string, opts *ListOptions) (*ActionsEnabledOnOrgRepos, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/permissions/repositories", owner) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + repos := &ActionsEnabledOnOrgRepos{} + resp, err := s.client.Do(ctx, req, repos) + if err != nil { + return nil, resp, err + } + + return repos, resp, nil +} + +// SetEnabledReposInOrg replaces the list of selected repositories that are enabled for GitHub Actions in an organization.. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-selected-repositories-enabled-for-github-actions-in-an-organization +func (s *ActionsService) SetEnabledReposInOrg(ctx context.Context, owner string, repositoryIDs []int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/actions/permissions/repositories", owner) + + req, err := s.client.NewRequest("PUT", u, struct { + IDs []int64 `json:"selected_repository_ids"` + }{IDs: repositoryIDs}) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req, nil) + if err != nil { + return resp, err + } + + return resp, nil +} + +// AddEnabledReposInOrg adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#enable-a-selected-repository-for-github-actions-in-an-organization +func (s *ActionsService) AddEnabledReposInOrg(ctx context.Context, owner string, repositoryID int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/actions/permissions/repositories/%v", owner, repositoryID) + + 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 +} + +// RemoveEnabledRepoInOrg removes a single repository from the list of enabled repos for GitHub Actions in an organization. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#disable-a-selected-repository-for-github-actions-in-an-organization +func (s *ActionsService) RemoveEnabledReposInOrg(ctx context.Context, owner string, repositoryID int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/actions/permissions/repositories/%v", owner, repositoryID) + + 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 +} + +// GetActionsAllowed gets the actions that are allowed in an organization. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization +func (s *ActionsService) GetActionsAllowed(ctx context.Context, org string) (*ActionsAllowed, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/permissions/selected-actions", org) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + actionsAllowed := new(ActionsAllowed) + resp, err := s.client.Do(ctx, req, actionsAllowed) + if err != nil { + return nil, resp, err + } + + return actionsAllowed, resp, nil +} + +// EditActionsAllowed sets the actions that are allowed in an organization. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-organization +func (s *ActionsService) EditActionsAllowed(ctx context.Context, org string, actionsAllowed ActionsAllowed) (*ActionsAllowed, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/permissions/selected-actions", org) + req, err := s.client.NewRequest("PUT", u, actionsAllowed) + if err != nil { + return nil, nil, err + } + + p := new(ActionsAllowed) + resp, err := s.client.Do(ctx, req, p) + if err != nil { + return nil, resp, err + } + + return p, resp, nil +} diff --git a/github/actions_permissions_orgs_test.go b/github/actions_permissions_orgs_test.go new file mode 100644 index 00000000000..36a241f6ea2 --- /dev/null +++ b/github/actions_permissions_orgs_test.go @@ -0,0 +1,336 @@ +// Copyright 2023 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 TestActionsService_GetActionsPermissions(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/actions/permissions", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"enabled_repositories": "all", "allowed_actions": "all"}`) + }) + + ctx := context.Background() + org, _, err := client.Actions.GetActionsPermissions(ctx, "o") + if err != nil { + t.Errorf("Actions.GetActionsPermissions returned error: %v", err) + } + want := &ActionsPermissions{EnabledRepositories: String("all"), AllowedActions: String("all")} + if !cmp.Equal(org, want) { + t.Errorf("Actions.GetActionsPermissions returned %+v, want %+v", org, want) + } + + const methodName = "GetActionsPermissions" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.GetActionsPermissions(ctx, "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.GetActionsPermissions(ctx, "o") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_EditActionsPermissions(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + input := &ActionsPermissions{EnabledRepositories: String("all"), AllowedActions: String("selected")} + + mux.HandleFunc("/orgs/o/actions/permissions", func(w http.ResponseWriter, r *http.Request) { + v := new(ActionsPermissions) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) + + testMethod(t, r, "PUT") + if !cmp.Equal(v, input) { + t.Errorf("Request body = %+v, want %+v", v, input) + } + + fmt.Fprint(w, `{"enabled_repositories": "all", "allowed_actions": "selected"}`) + }) + + ctx := context.Background() + org, _, err := client.Actions.EditActionsPermissions(ctx, "o", *input) + if err != nil { + t.Errorf("Actions.EditActionsPermissions returned error: %v", err) + } + + want := &ActionsPermissions{EnabledRepositories: String("all"), AllowedActions: String("selected")} + if !cmp.Equal(org, want) { + t.Errorf("Actions.EditActionsPermissions returned %+v, want %+v", org, want) + } + + const methodName = "EditActionsPermissions" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.EditActionsPermissions(ctx, "\n", *input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.EditActionsPermissions(ctx, "o", *input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_ListEnabledReposInOrg(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/actions/permissions/repositories", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{ + "page": "1", + }) + fmt.Fprint(w, `{"total_count":2,"repositories":[{"id":2}, {"id": 3}]}`) + }) + + ctx := context.Background() + opt := &ListOptions{ + Page: 1, + } + got, _, err := client.Actions.ListEnabledReposInOrg(ctx, "o", opt) + if err != nil { + t.Errorf("Actions.ListEnabledRepos returned error: %v", err) + } + + want := &ActionsEnabledOnOrgRepos{TotalCount: int(2), Repositories: []*Repository{ + {ID: Int64(2)}, + {ID: Int64(3)}, + }} + if !cmp.Equal(got, want) { + t.Errorf("Actions.ListEnabledRepos returned %+v, want %+v", got, want) + } + + const methodName = "ListEnabledRepos" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.ListEnabledReposInOrg(ctx, "\n", opt) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.ListEnabledReposInOrg(ctx, "o", opt) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_SetEnabledReposInOrg(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/actions/permissions/repositories", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + testHeader(t, r, "Content-Type", "application/json") + testBody(t, r, `{"selected_repository_ids":[123,1234]}`+"\n") + w.WriteHeader(http.StatusNoContent) + }) + + ctx := context.Background() + _, err := client.Actions.SetEnabledReposInOrg(ctx, "o", []int64{123, 1234}) + if err != nil { + t.Errorf("Actions.SetEnabledRepos returned error: %v", err) + } + + const methodName = "SetEnabledRepos" + + testBadOptions(t, methodName, func() (err error) { + _, err = client.Actions.SetEnabledReposInOrg(ctx, "\n", []int64{123, 1234}) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Actions.SetEnabledReposInOrg(ctx, "o", []int64{123, 1234}) + }) +} + +func TestActionsService_AddEnabledReposInOrg(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/actions/permissions/repositories/123", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + w.WriteHeader(http.StatusNoContent) + }) + + ctx := context.Background() + _, err := client.Actions.AddEnabledReposInOrg(ctx, "o", 123) + if err != nil { + t.Errorf("Actions.AddEnabledReposInOrg returned error: %v", err) + } + + const methodName = "AddEnabledReposInOrg" + + testBadOptions(t, methodName, func() (err error) { + _, err = client.Actions.AddEnabledReposInOrg(ctx, "\n", 123) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Actions.AddEnabledReposInOrg(ctx, "o", 123) + }) +} + +func TestActionsService_RemoveEnabledReposInOrg(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/actions/permissions/repositories/123", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + w.WriteHeader(http.StatusNoContent) + }) + + ctx := context.Background() + _, err := client.Actions.RemoveEnabledReposInOrg(ctx, "o", 123) + if err != nil { + t.Errorf("Actions.RemoveEnabledReposInOrg returned error: %v", err) + } + + const methodName = "RemoveEnabledReposInOrg" + + testBadOptions(t, methodName, func() (err error) { + _, err = client.Actions.RemoveEnabledReposInOrg(ctx, "\n", 123) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Actions.RemoveEnabledReposInOrg(ctx, "o", 123) + }) +} + +func TestActionsService_GetActionsAllowed(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/actions/permissions/selected-actions", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"github_owned_allowed":true, "verified_allowed":false, "patterns_allowed":["a/b"]}`) + }) + + ctx := context.Background() + org, _, err := client.Actions.GetActionsAllowed(ctx, "o") + if err != nil { + t.Errorf("Actions.GetActionsAllowed returned error: %v", err) + } + want := &ActionsAllowed{GithubOwnedAllowed: Bool(true), VerifiedAllowed: Bool(false), PatternsAllowed: []string{"a/b"}} + if !cmp.Equal(org, want) { + t.Errorf("Actions.GetActionsAllowed returned %+v, want %+v", org, want) + } + + const methodName = "GetActionsAllowed" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.GetActionsAllowed(ctx, "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.GetActionsAllowed(ctx, "o") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_EditActionsAllowed(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + input := &ActionsAllowed{GithubOwnedAllowed: Bool(true), VerifiedAllowed: Bool(false), PatternsAllowed: []string{"a/b"}} + + mux.HandleFunc("/orgs/o/actions/permissions/selected-actions", func(w http.ResponseWriter, r *http.Request) { + v := new(ActionsAllowed) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) + + testMethod(t, r, "PUT") + if !cmp.Equal(v, input) { + t.Errorf("Request body = %+v, want %+v", v, input) + } + + fmt.Fprint(w, `{"github_owned_allowed":true, "verified_allowed":false, "patterns_allowed":["a/b"]}`) + }) + + ctx := context.Background() + org, _, err := client.Actions.EditActionsAllowed(ctx, "o", *input) + if err != nil { + t.Errorf("Actions.EditActionsAllowed returned error: %v", err) + } + + want := &ActionsAllowed{GithubOwnedAllowed: Bool(true), VerifiedAllowed: Bool(false), PatternsAllowed: []string{"a/b"}} + if !cmp.Equal(org, want) { + t.Errorf("Actions.EditActionsAllowed returned %+v, want %+v", org, want) + } + + const methodName = "EditActionsAllowed" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.EditActionsAllowed(ctx, "\n", *input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.EditActionsAllowed(ctx, "o", *input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsAllowed_Marshal(t *testing.T) { + testJSONMarshal(t, &ActionsAllowed{}, "{}") + + u := &ActionsAllowed{ + GithubOwnedAllowed: Bool(false), + VerifiedAllowed: Bool(false), + PatternsAllowed: []string{"s"}, + } + + want := `{ + "github_owned_allowed": false, + "verified_allowed": false, + "patterns_allowed": [ + "s" + ] + }` + + testJSONMarshal(t, u, want) +} + +func TestActionsPermissions_Marshal(t *testing.T) { + testJSONMarshal(t, &ActionsPermissions{}, "{}") + + u := &ActionsPermissions{ + EnabledRepositories: String("e"), + AllowedActions: String("a"), + SelectedActionsURL: String("sau"), + } + + want := `{ + "enabled_repositories": "e", + "allowed_actions": "a", + "selected_actions_url": "sau" + }` + + testJSONMarshal(t, u, want) +} diff --git a/github/actions_runners.go b/github/actions_runners.go index 7427451ccfa..d54d6d41ca2 100644 --- a/github/actions_runners.go +++ b/github/actions_runners.go @@ -20,12 +20,6 @@ type RunnerApplicationDownload struct { SHA256Checksum *string `json:"sha256_checksum,omitempty"` } -// ActionsEnabledOnOrgRepos represents all the repositories in an organization for which Actions is enabled. -type ActionsEnabledOnOrgRepos struct { - TotalCount int `json:"total_count"` - Repositories []*Repository `json:"repositories"` -} - // ListRunnerApplicationDownloads lists self-hosted runner application binaries that can be downloaded and run. // // GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#list-runner-applications-for-a-repository @@ -295,89 +289,6 @@ func (s *ActionsService) ListOrganizationRunners(ctx context.Context, owner stri return runners, resp, nil } -// ListEnabledReposInOrg lists the selected repositories that are enabled for GitHub Actions in an organization. -// -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#list-selected-repositories-enabled-for-github-actions-in-an-organization -func (s *ActionsService) ListEnabledReposInOrg(ctx context.Context, owner string, opts *ListOptions) (*ActionsEnabledOnOrgRepos, *Response, error) { - u := fmt.Sprintf("orgs/%v/actions/permissions/repositories", owner) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - repos := &ActionsEnabledOnOrgRepos{} - resp, err := s.client.Do(ctx, req, repos) - if err != nil { - return nil, resp, err - } - - return repos, resp, nil -} - -// SetEnabledReposInOrg replaces the list of selected repositories that are enabled for GitHub Actions in an organization.. -// -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-selected-repositories-enabled-for-github-actions-in-an-organization -func (s *ActionsService) SetEnabledReposInOrg(ctx context.Context, owner string, repositoryIDs []int64) (*Response, error) { - u := fmt.Sprintf("orgs/%v/actions/permissions/repositories", owner) - - req, err := s.client.NewRequest("PUT", u, struct { - IDs []int64 `json:"selected_repository_ids"` - }{IDs: repositoryIDs}) - if err != nil { - return nil, err - } - - resp, err := s.client.Do(ctx, req, nil) - if err != nil { - return resp, err - } - - return resp, nil -} - -// AddEnabledReposInOrg adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. -// -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#enable-a-selected-repository-for-github-actions-in-an-organization -func (s *ActionsService) AddEnabledReposInOrg(ctx context.Context, owner string, repositoryID int64) (*Response, error) { - u := fmt.Sprintf("orgs/%v/actions/permissions/repositories/%v", owner, repositoryID) - - 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 -} - -// RemoveEnabledRepoInOrg removes a single repository from the list of enabled repos for GitHub Actions in an organization. -// -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#disable-a-selected-repository-for-github-actions-in-an-organization -func (s *ActionsService) RemoveEnabledRepoInOrg(ctx context.Context, owner string, repositoryID int64) (*Response, error) { - u := fmt.Sprintf("orgs/%v/actions/permissions/repositories/%v", owner, repositoryID) - - 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 -} - // GetOrganizationRunner gets a specific self-hosted runner for an organization using its runner ID. // // GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-organization diff --git a/github/actions_runners_test.go b/github/actions_runners_test.go index d059d6e82ac..581e459442d 100644 --- a/github/actions_runners_test.go +++ b/github/actions_runners_test.go @@ -446,133 +446,6 @@ func TestActionsService_ListOrganizationRunners(t *testing.T) { }) } -func TestActionsService_ListEnabledReposInOrg(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - mux.HandleFunc("/orgs/o/actions/permissions/repositories", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - testFormValues(t, r, values{ - "page": "1", - }) - fmt.Fprint(w, `{"total_count":2,"repositories":[{"id":2}, {"id": 3}]}`) - }) - - ctx := context.Background() - opt := &ListOptions{ - Page: 1, - } - got, _, err := client.Actions.ListEnabledReposInOrg(ctx, "o", opt) - if err != nil { - t.Errorf("Actions.ListEnabledReposInOrg returned error: %v", err) - } - - want := &ActionsEnabledOnOrgRepos{TotalCount: int(2), Repositories: []*Repository{ - {ID: Int64(2)}, - {ID: Int64(3)}, - }} - if !cmp.Equal(got, want) { - t.Errorf("Actions.ListEnabledReposInOrg returned %+v, want %+v", got, want) - } - - const methodName = "ListEnabledReposInOrg" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Actions.ListEnabledReposInOrg(ctx, "\n", opt) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Actions.ListEnabledReposInOrg(ctx, "o", opt) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestActionsService_SetEnabledReposInOrg(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - mux.HandleFunc("/orgs/o/actions/permissions/repositories", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "PUT") - testHeader(t, r, "Content-Type", "application/json") - testBody(t, r, `{"selected_repository_ids":[123,1234]}`+"\n") - w.WriteHeader(http.StatusNoContent) - }) - - ctx := context.Background() - _, err := client.Actions.SetEnabledReposInOrg(ctx, "o", []int64{123, 1234}) - if err != nil { - t.Errorf("Actions.SetEnabledReposInOrg returned error: %v", err) - } - - const methodName = "SetEnabledReposInOrg" - - testBadOptions(t, methodName, func() (err error) { - _, err = client.Actions.SetEnabledReposInOrg(ctx, "\n", []int64{123, 1234}) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Actions.SetEnabledReposInOrg(ctx, "o", []int64{123, 1234}) - }) -} - -func TestActionsService_AddEnabledReposInOrg(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - mux.HandleFunc("/orgs/o/actions/permissions/repositories/123", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "PUT") - w.WriteHeader(http.StatusNoContent) - }) - - ctx := context.Background() - _, err := client.Actions.AddEnabledReposInOrg(ctx, "o", 123) - if err != nil { - t.Errorf("Actions.AddEnabledReposInOrg returned error: %v", err) - } - - const methodName = "AddEnabledReposInOrg" - - testBadOptions(t, methodName, func() (err error) { - _, err = client.Actions.AddEnabledReposInOrg(ctx, "\n", 123) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Actions.AddEnabledReposInOrg(ctx, "o", 123) - }) -} - -func TestActionsService_RemoveEnabledRepoInOrg(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - mux.HandleFunc("/orgs/o/actions/permissions/repositories/123", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "DELETE") - w.WriteHeader(http.StatusNoContent) - }) - - ctx := context.Background() - _, err := client.Actions.RemoveEnabledRepoInOrg(ctx, "o", 123) - if err != nil { - t.Errorf("Actions.RemoveEnabledRepoInOrg returned error: %v", err) - } - - const methodName = "RemoveEnabledRepoInOrg" - - testBadOptions(t, methodName, func() (err error) { - _, err = client.Actions.RemoveEnabledRepoInOrg(ctx, "\n", 123) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Actions.RemoveEnabledRepoInOrg(ctx, "o", 123) - }) -} - func TestActionsService_GetOrganizationRunner(t *testing.T) { client, mux, _, teardown := setup() defer teardown() diff --git a/github/github-accessors.go b/github/github-accessors.go index 083d6139148..03ebc9a111c 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -150,6 +150,30 @@ func (a *ActionsPermissions) GetSelectedActionsURL() string { return *a.SelectedActionsURL } +// GetAllowedActions returns the AllowedActions field if it's non-nil, zero value otherwise. +func (a *ActionsPermissionsEnterprise) GetAllowedActions() string { + if a == nil || a.AllowedActions == nil { + return "" + } + return *a.AllowedActions +} + +// GetEnabledOrganizations returns the EnabledOrganizations field if it's non-nil, zero value otherwise. +func (a *ActionsPermissionsEnterprise) GetEnabledOrganizations() string { + if a == nil || a.EnabledOrganizations == nil { + return "" + } + return *a.EnabledOrganizations +} + +// GetSelectedActionsURL returns the SelectedActionsURL field if it's non-nil, zero value otherwise. +func (a *ActionsPermissionsEnterprise) GetSelectedActionsURL() string { + if a == nil || a.SelectedActionsURL == nil { + return "" + } + return *a.SelectedActionsURL +} + // GetAllowedActions returns the AllowedActions field if it's non-nil, zero value otherwise. func (a *ActionsPermissionsRepository) GetAllowedActions() string { if a == nil || a.AllowedActions == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 90d15369d0b..45f1f1cfef9 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -185,6 +185,36 @@ func TestActionsPermissions_GetSelectedActionsURL(tt *testing.T) { a.GetSelectedActionsURL() } +func TestActionsPermissionsEnterprise_GetAllowedActions(tt *testing.T) { + var zeroValue string + a := &ActionsPermissionsEnterprise{AllowedActions: &zeroValue} + a.GetAllowedActions() + a = &ActionsPermissionsEnterprise{} + a.GetAllowedActions() + a = nil + a.GetAllowedActions() +} + +func TestActionsPermissionsEnterprise_GetEnabledOrganizations(tt *testing.T) { + var zeroValue string + a := &ActionsPermissionsEnterprise{EnabledOrganizations: &zeroValue} + a.GetEnabledOrganizations() + a = &ActionsPermissionsEnterprise{} + a.GetEnabledOrganizations() + a = nil + a.GetEnabledOrganizations() +} + +func TestActionsPermissionsEnterprise_GetSelectedActionsURL(tt *testing.T) { + var zeroValue string + a := &ActionsPermissionsEnterprise{SelectedActionsURL: &zeroValue} + a.GetSelectedActionsURL() + a = &ActionsPermissionsEnterprise{} + a.GetSelectedActionsURL() + a = nil + a.GetSelectedActionsURL() +} + func TestActionsPermissionsRepository_GetAllowedActions(tt *testing.T) { var zeroValue string a := &ActionsPermissionsRepository{AllowedActions: &zeroValue} diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index c14412c2ceb..1dfd878fd59 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -39,6 +39,18 @@ func TestActionsPermissions_String(t *testing.T) { } } +func TestActionsPermissionsEnterprise_String(t *testing.T) { + v := ActionsPermissionsEnterprise{ + EnabledOrganizations: String(""), + AllowedActions: String(""), + SelectedActionsURL: String(""), + } + want := `github.ActionsPermissionsEnterprise{EnabledOrganizations:"", AllowedActions:"", SelectedActionsURL:""}` + if got := v.String(); got != want { + t.Errorf("ActionsPermissionsEnterprise.String = %v, want %v", got, want) + } +} + func TestActionsPermissionsRepository_String(t *testing.T) { v := ActionsPermissionsRepository{ Enabled: Bool(false), diff --git a/github/orgs_actions_allowed.go b/github/orgs_actions_allowed.go index e3b35b1df1f..c467c11546b 100644 --- a/github/orgs_actions_allowed.go +++ b/github/orgs_actions_allowed.go @@ -7,57 +7,22 @@ package github import ( "context" - "fmt" ) -// ActionsAllowed represents selected actions that are allowed. -// -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions -type ActionsAllowed struct { - GithubOwnedAllowed *bool `json:"github_owned_allowed,omitempty"` - VerifiedAllowed *bool `json:"verified_allowed,omitempty"` - PatternsAllowed []string `json:"patterns_allowed,omitempty"` -} - -func (a ActionsAllowed) String() string { - return Stringify(a) -} - // GetActionsAllowed gets the actions that are allowed in an organization. // // GitHub API docs: https://docs.github.com/en/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization +// Deprecated: please use `client.Actions.GetActionsAllowed` instead. func (s *OrganizationsService) GetActionsAllowed(ctx context.Context, org string) (*ActionsAllowed, *Response, error) { - u := fmt.Sprintf("orgs/%v/actions/permissions/selected-actions", org) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - actionsAllowed := new(ActionsAllowed) - resp, err := s.client.Do(ctx, req, actionsAllowed) - if err != nil { - return nil, resp, err - } - - return actionsAllowed, resp, nil + s2 := (*ActionsService)(s) + return s2.GetActionsAllowed(ctx, org) } // EditActionsAllowed sets the actions that are allowed in an organization. // // GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-organization +// Deprecated: please use `client.Actions.EditActionsAllowed` instead. func (s *OrganizationsService) EditActionsAllowed(ctx context.Context, org string, actionsAllowed ActionsAllowed) (*ActionsAllowed, *Response, error) { - u := fmt.Sprintf("orgs/%v/actions/permissions/selected-actions", org) - req, err := s.client.NewRequest("PUT", u, actionsAllowed) - if err != nil { - return nil, nil, err - } - - p := new(ActionsAllowed) - resp, err := s.client.Do(ctx, req, p) - if err != nil { - return nil, resp, err - } - - return p, resp, nil + s2 := (*ActionsService)(s) + return s2.EditActionsAllowed(ctx, org, actionsAllowed) } diff --git a/github/orgs_actions_allowed_test.go b/github/orgs_actions_allowed_test.go index 6461dcf9a39..de4c6d5a0bc 100644 --- a/github/orgs_actions_allowed_test.go +++ b/github/orgs_actions_allowed_test.go @@ -91,41 +91,3 @@ func TestOrganizationsService_EditActionsAllowed(t *testing.T) { return resp, err }) } - -func TestActionsAllowed_Marshal(t *testing.T) { - testJSONMarshal(t, &ActionsAllowed{}, "{}") - - u := &ActionsAllowed{ - GithubOwnedAllowed: Bool(false), - VerifiedAllowed: Bool(false), - PatternsAllowed: []string{"s"}, - } - - want := `{ - "github_owned_allowed": false, - "verified_allowed": false, - "patterns_allowed": [ - "s" - ] - }` - - testJSONMarshal(t, u, want) -} - -func TestActionsPermissions_Marshal(t *testing.T) { - testJSONMarshal(t, &ActionsPermissions{}, "{}") - - u := &ActionsPermissions{ - EnabledRepositories: String("e"), - AllowedActions: String("a"), - SelectedActionsURL: String("sau"), - } - - want := `{ - "enabled_repositories": "e", - "allowed_actions": "a", - "selected_actions_url": "sau" - }` - - testJSONMarshal(t, u, want) -} diff --git a/github/orgs_actions_permissions.go b/github/orgs_actions_permissions.go index 6d1db2ee0a3..607ffca7981 100644 --- a/github/orgs_actions_permissions.go +++ b/github/orgs_actions_permissions.go @@ -7,57 +7,22 @@ package github import ( "context" - "fmt" ) -// ActionsPermissions represents a policy for repositories and allowed actions in an organization. -// -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions -type ActionsPermissions struct { - EnabledRepositories *string `json:"enabled_repositories,omitempty"` - AllowedActions *string `json:"allowed_actions,omitempty"` - SelectedActionsURL *string `json:"selected_actions_url,omitempty"` -} - -func (a ActionsPermissions) String() string { - return Stringify(a) -} - // GetActionsPermissions gets the GitHub Actions permissions policy for repositories and allowed actions in an organization. // // GitHub API docs: https://docs.github.com/en/rest/actions/permissions#get-github-actions-permissions-for-an-organization +// Deprecated: please use `client.Actions.GetActionsPermissions` instead. func (s *OrganizationsService) GetActionsPermissions(ctx context.Context, org string) (*ActionsPermissions, *Response, error) { - u := fmt.Sprintf("orgs/%v/actions/permissions", org) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - permissions := new(ActionsPermissions) - resp, err := s.client.Do(ctx, req, permissions) - if err != nil { - return nil, resp, err - } - - return permissions, resp, nil + s2 := (*ActionsService)(s) + return s2.GetActionsPermissions(ctx, org) } // EditActionsPermissions sets the permissions policy for repositories and allowed actions in an organization. // // GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-github-actions-permissions-for-an-organization +// Deprecated: please use `client.Actions.EditActionsPermissions` instead. func (s *OrganizationsService) EditActionsPermissions(ctx context.Context, org string, actionsPermissions ActionsPermissions) (*ActionsPermissions, *Response, error) { - u := fmt.Sprintf("orgs/%v/actions/permissions", org) - req, err := s.client.NewRequest("PUT", u, actionsPermissions) - if err != nil { - return nil, nil, err - } - - p := new(ActionsPermissions) - resp, err := s.client.Do(ctx, req, p) - if err != nil { - return nil, resp, err - } - - return p, resp, nil + s2 := (*ActionsService)(s) + return s2.EditActionsPermissions(ctx, org, actionsPermissions) } From d99d3dff14f7581047f510b74cc4213d58fb78e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrik=20Nordl=C3=A9n?= Date: Fri, 29 Sep 2023 14:53:37 +0200 Subject: [PATCH 321/751] Add SAML SSO audit log fields (#2941) --- github/github-accessors.go | 16 ++++ github/github-accessors_test.go | 20 ++++ github/orgs_audit_log.go | 158 ++++++++++++++++---------------- github/orgs_audit_log_test.go | 92 ++++++++++--------- 4 files changed, 164 insertions(+), 122 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 03ebc9a111c..b305bfc6448 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -1230,6 +1230,22 @@ func (a *AuditEntry) GetExplanation() string { return *a.Explanation } +// GetExternalIdentityNameID returns the ExternalIdentityNameID field if it's non-nil, zero value otherwise. +func (a *AuditEntry) GetExternalIdentityNameID() string { + if a == nil || a.ExternalIdentityNameID == nil { + return "" + } + return *a.ExternalIdentityNameID +} + +// GetExternalIdentityUsername returns the ExternalIdentityUsername field if it's non-nil, zero value otherwise. +func (a *AuditEntry) GetExternalIdentityUsername() string { + if a == nil || a.ExternalIdentityUsername == nil { + return "" + } + return *a.ExternalIdentityUsername +} + // GetFingerprint returns the Fingerprint field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetFingerprint() string { if a == nil || a.Fingerprint == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 45f1f1cfef9..962e5e8f733 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -1451,6 +1451,26 @@ func TestAuditEntry_GetExplanation(tt *testing.T) { a.GetExplanation() } +func TestAuditEntry_GetExternalIdentityNameID(tt *testing.T) { + var zeroValue string + a := &AuditEntry{ExternalIdentityNameID: &zeroValue} + a.GetExternalIdentityNameID() + a = &AuditEntry{} + a.GetExternalIdentityNameID() + a = nil + a.GetExternalIdentityNameID() +} + +func TestAuditEntry_GetExternalIdentityUsername(tt *testing.T) { + var zeroValue string + a := &AuditEntry{ExternalIdentityUsername: &zeroValue} + a.GetExternalIdentityUsername() + a = &AuditEntry{} + a.GetExternalIdentityUsername() + a = nil + a.GetExternalIdentityUsername() +} + func TestAuditEntry_GetFingerprint(tt *testing.T) { var zeroValue string a := &AuditEntry{Fingerprint: &zeroValue} diff --git a/github/orgs_audit_log.go b/github/orgs_audit_log.go index 4c34445fa1b..e2f8fc24ffd 100644 --- a/github/orgs_audit_log.go +++ b/github/orgs_audit_log.go @@ -43,84 +43,86 @@ type PolicyOverrideReason struct { // AuditEntry describes the fields that may be represented by various audit-log "action" entries. // For a list of actions see - https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization#audit-log-actions type AuditEntry struct { - ActorIP *string `json:"actor_ip,omitempty"` - Action *string `json:"action,omitempty"` // The name of the action that was performed, for example `user.login` or `repo.create`. - Active *bool `json:"active,omitempty"` - ActiveWas *bool `json:"active_was,omitempty"` - Actor *string `json:"actor,omitempty"` // The actor who performed the action. - ActorLocation *ActorLocation `json:"actor_location,omitempty"` - BlockedUser *string `json:"blocked_user,omitempty"` - Business *string `json:"business,omitempty"` - CancelledAt *Timestamp `json:"cancelled_at,omitempty"` - CompletedAt *Timestamp `json:"completed_at,omitempty"` - Conclusion *string `json:"conclusion,omitempty"` - Config *HookConfig `json:"config,omitempty"` - ConfigWas *HookConfig `json:"config_was,omitempty"` - ContentType *string `json:"content_type,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - DeployKeyFingerprint *string `json:"deploy_key_fingerprint,omitempty"` - DocumentID *string `json:"_document_id,omitempty"` - Emoji *string `json:"emoji,omitempty"` - EnvironmentName *string `json:"environment_name,omitempty"` - Event *string `json:"event,omitempty"` - Events []string `json:"events,omitempty"` - EventsWere []string `json:"events_were,omitempty"` - Explanation *string `json:"explanation,omitempty"` - Fingerprint *string `json:"fingerprint,omitempty"` - HashedToken *string `json:"hashed_token,omitempty"` - HeadBranch *string `json:"head_branch,omitempty"` - HeadSHA *string `json:"head_sha,omitempty"` - HookID *int64 `json:"hook_id,omitempty"` - IsHostedRunner *bool `json:"is_hosted_runner,omitempty"` - JobName *string `json:"job_name,omitempty"` - JobWorkflowRef *string `json:"job_workflow_ref,omitempty"` - LimitedAvailability *bool `json:"limited_availability,omitempty"` - Message *string `json:"message,omitempty"` - Name *string `json:"name,omitempty"` - OAuthApplicationID *int64 `json:"oauth_application_id,omitempty"` - OldUser *string `json:"old_user,omitempty"` - OldPermission *string `json:"old_permission,omitempty"` // The permission level for membership changes, for example `admin` or `read`. - OpenSSHPublicKey *string `json:"openssh_public_key,omitempty"` - OperationType *string `json:"operation_type,omitempty"` - Org *string `json:"org,omitempty"` - OrgID *int64 `json:"org_id,omitempty"` - OverriddenCodes []string `json:"overridden_codes,omitempty"` - Permission *string `json:"permission,omitempty"` // The permission level for membership changes, for example `admin` or `read`. - PreviousVisibility *string `json:"previous_visibility,omitempty"` - ProgrammaticAccessType *string `json:"programmatic_access_type,omitempty"` - PullRequestID *int64 `json:"pull_request_id,omitempty"` - PullRequestTitle *string `json:"pull_request_title,omitempty"` - PullRequestURL *string `json:"pull_request_url,omitempty"` - ReadOnly *string `json:"read_only,omitempty"` - Reasons []*PolicyOverrideReason `json:"reasons,omitempty"` - 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"` - RunnerLabels []string `json:"runner_labels,omitempty"` - RunnerName *string `json:"runner_name,omitempty"` - RunNumber *int64 `json:"run_number,omitempty"` - SecretsPassed []string `json:"secrets_passed,omitempty"` - SourceVersion *string `json:"source_version,omitempty"` - StartedAt *Timestamp `json:"started_at,omitempty"` - TargetLogin *string `json:"target_login,omitempty"` - TargetVersion *string `json:"target_version,omitempty"` - Team *string `json:"team,omitempty"` - Timestamp *Timestamp `json:"@timestamp,omitempty"` // The time the audit log event occurred, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). - TokenID *int64 `json:"token_id,omitempty"` - TokenScopes *string `json:"token_scopes,omitempty"` - Topic *string `json:"topic,omitempty"` - TransportProtocolName *string `json:"transport_protocol_name,omitempty"` // A human readable name for the protocol (for example, HTTP or SSH) used to transfer Git data. - TransportProtocol *int `json:"transport_protocol,omitempty"` // The type of protocol (for example, HTTP=1 or SSH=2) used to transfer Git data. - TriggerID *int64 `json:"trigger_id,omitempty"` - User *string `json:"user,omitempty"` // The user that was affected by the action performed (if available). - UserAgent *string `json:"user_agent,omitempty"` - Visibility *string `json:"visibility,omitempty"` // The repository visibility, for example `public` or `private`. - WorkflowID *int64 `json:"workflow_id,omitempty"` - WorkflowRunID *int64 `json:"workflow_run_id,omitempty"` + ActorIP *string `json:"actor_ip,omitempty"` + Action *string `json:"action,omitempty"` // The name of the action that was performed, for example `user.login` or `repo.create`. + Active *bool `json:"active,omitempty"` + ActiveWas *bool `json:"active_was,omitempty"` + Actor *string `json:"actor,omitempty"` // The actor who performed the action. + ActorLocation *ActorLocation `json:"actor_location,omitempty"` + BlockedUser *string `json:"blocked_user,omitempty"` + Business *string `json:"business,omitempty"` + CancelledAt *Timestamp `json:"cancelled_at,omitempty"` + CompletedAt *Timestamp `json:"completed_at,omitempty"` + Conclusion *string `json:"conclusion,omitempty"` + Config *HookConfig `json:"config,omitempty"` + ConfigWas *HookConfig `json:"config_was,omitempty"` + ContentType *string `json:"content_type,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + DeployKeyFingerprint *string `json:"deploy_key_fingerprint,omitempty"` + DocumentID *string `json:"_document_id,omitempty"` + Emoji *string `json:"emoji,omitempty"` + EnvironmentName *string `json:"environment_name,omitempty"` + Event *string `json:"event,omitempty"` + Events []string `json:"events,omitempty"` + EventsWere []string `json:"events_were,omitempty"` + Explanation *string `json:"explanation,omitempty"` + ExternalIdentityNameID *string `json:"external_identity_nameid,omitempty"` + ExternalIdentityUsername *string `json:"external_identity_username,omitempty"` + Fingerprint *string `json:"fingerprint,omitempty"` + HashedToken *string `json:"hashed_token,omitempty"` + HeadBranch *string `json:"head_branch,omitempty"` + HeadSHA *string `json:"head_sha,omitempty"` + HookID *int64 `json:"hook_id,omitempty"` + IsHostedRunner *bool `json:"is_hosted_runner,omitempty"` + JobName *string `json:"job_name,omitempty"` + JobWorkflowRef *string `json:"job_workflow_ref,omitempty"` + LimitedAvailability *bool `json:"limited_availability,omitempty"` + Message *string `json:"message,omitempty"` + Name *string `json:"name,omitempty"` + OAuthApplicationID *int64 `json:"oauth_application_id,omitempty"` + OldUser *string `json:"old_user,omitempty"` + OldPermission *string `json:"old_permission,omitempty"` // The permission level for membership changes, for example `admin` or `read`. + OpenSSHPublicKey *string `json:"openssh_public_key,omitempty"` + OperationType *string `json:"operation_type,omitempty"` + Org *string `json:"org,omitempty"` + OrgID *int64 `json:"org_id,omitempty"` + OverriddenCodes []string `json:"overridden_codes,omitempty"` + Permission *string `json:"permission,omitempty"` // The permission level for membership changes, for example `admin` or `read`. + PreviousVisibility *string `json:"previous_visibility,omitempty"` + ProgrammaticAccessType *string `json:"programmatic_access_type,omitempty"` + PullRequestID *int64 `json:"pull_request_id,omitempty"` + PullRequestTitle *string `json:"pull_request_title,omitempty"` + PullRequestURL *string `json:"pull_request_url,omitempty"` + ReadOnly *string `json:"read_only,omitempty"` + Reasons []*PolicyOverrideReason `json:"reasons,omitempty"` + 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"` + RunnerLabels []string `json:"runner_labels,omitempty"` + RunnerName *string `json:"runner_name,omitempty"` + RunNumber *int64 `json:"run_number,omitempty"` + SecretsPassed []string `json:"secrets_passed,omitempty"` + SourceVersion *string `json:"source_version,omitempty"` + StartedAt *Timestamp `json:"started_at,omitempty"` + TargetLogin *string `json:"target_login,omitempty"` + TargetVersion *string `json:"target_version,omitempty"` + Team *string `json:"team,omitempty"` + Timestamp *Timestamp `json:"@timestamp,omitempty"` // The time the audit log event occurred, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). + TokenID *int64 `json:"token_id,omitempty"` + TokenScopes *string `json:"token_scopes,omitempty"` + Topic *string `json:"topic,omitempty"` + TransportProtocolName *string `json:"transport_protocol_name,omitempty"` // A human readable name for the protocol (for example, HTTP or SSH) used to transfer Git data. + TransportProtocol *int `json:"transport_protocol,omitempty"` // The type of protocol (for example, HTTP=1 or SSH=2) used to transfer Git data. + TriggerID *int64 `json:"trigger_id,omitempty"` + User *string `json:"user,omitempty"` // The user that was affected by the action performed (if available). + UserAgent *string `json:"user_agent,omitempty"` + Visibility *string `json:"visibility,omitempty"` // The repository visibility, for example `public` or `private`. + WorkflowID *int64 `json:"workflow_id,omitempty"` + WorkflowRunID *int64 `json:"workflow_run_id,omitempty"` Data *AuditEntryData `json:"data,omitempty"` } diff --git a/github/orgs_audit_log_test.go b/github/orgs_audit_log_test.go index 89cdf46242e..1a82471face 100644 --- a/github/orgs_audit_log_test.go +++ b/github/orgs_audit_log_test.go @@ -223,50 +223,52 @@ func TestAuditEntry_Marshal(t *testing.T) { testJSONMarshal(t, &AuditEntry{}, "{}") u := &AuditEntry{ - Action: String("a"), - Active: Bool(false), - ActiveWas: Bool(false), - Actor: String("ac"), - ActorIP: String("aip"), - ActorLocation: &ActorLocation{CountryCode: String("alcc")}, - BlockedUser: String("bu"), - Business: String("b"), - CancelledAt: &Timestamp{referenceTime}, - CompletedAt: &Timestamp{referenceTime}, - Conclusion: String("c"), - Config: &HookConfig{URL: String("s")}, - ConfigWas: &HookConfig{URL: String("s")}, - ContentType: String("ct"), - CreatedAt: &Timestamp{referenceTime}, - DeployKeyFingerprint: String("dkf"), - DocumentID: String("did"), - Emoji: String("e"), - EnvironmentName: String("en"), - Event: String("e"), - Events: []string{"s"}, - EventsWere: []string{"s"}, - Explanation: String("e"), - Fingerprint: String("f"), - HashedToken: String("ht"), - HeadBranch: String("hb"), - HeadSHA: String("hsha"), - HookID: Int64(1), - IsHostedRunner: Bool(false), - JobName: String("jn"), - LimitedAvailability: Bool(false), - Message: String("m"), - Name: String("n"), - OldPermission: String("op"), - OldUser: String("ou"), - OpenSSHPublicKey: String("osshpk"), - Org: String("o"), - OrgID: Int64(1), - Permission: String("p"), - PreviousVisibility: String("pv"), - ProgrammaticAccessType: String("pat"), - PullRequestID: Int64(1), - PullRequestTitle: String("prt"), - PullRequestURL: String("pru"), + Action: String("a"), + Active: Bool(false), + ActiveWas: Bool(false), + Actor: String("ac"), + ActorIP: String("aip"), + ActorLocation: &ActorLocation{CountryCode: String("alcc")}, + BlockedUser: String("bu"), + Business: String("b"), + CancelledAt: &Timestamp{referenceTime}, + CompletedAt: &Timestamp{referenceTime}, + Conclusion: String("c"), + Config: &HookConfig{URL: String("s")}, + ConfigWas: &HookConfig{URL: String("s")}, + ContentType: String("ct"), + CreatedAt: &Timestamp{referenceTime}, + DeployKeyFingerprint: String("dkf"), + DocumentID: String("did"), + Emoji: String("e"), + EnvironmentName: String("en"), + Event: String("e"), + Events: []string{"s"}, + EventsWere: []string{"s"}, + Explanation: String("e"), + ExternalIdentityNameID: String("ein"), + ExternalIdentityUsername: String("eiu"), + Fingerprint: String("f"), + HashedToken: String("ht"), + HeadBranch: String("hb"), + HeadSHA: String("hsha"), + HookID: Int64(1), + IsHostedRunner: Bool(false), + JobName: String("jn"), + LimitedAvailability: Bool(false), + Message: String("m"), + Name: String("n"), + OldPermission: String("op"), + OldUser: String("ou"), + OpenSSHPublicKey: String("osshpk"), + Org: String("o"), + OrgID: Int64(1), + Permission: String("p"), + PreviousVisibility: String("pv"), + ProgrammaticAccessType: String("pat"), + PullRequestID: Int64(1), + PullRequestTitle: String("prt"), + PullRequestURL: String("pru"), Reasons: []*PolicyOverrideReason{{ Code: String("c"), Message: String("m"), @@ -339,6 +341,8 @@ func TestAuditEntry_Marshal(t *testing.T) { "s" ], "explanation": "e", + "external_identity_nameid": "ein", + "external_identity_username": "eiu", "fingerprint": "f", "hashed_token": "ht", "head_branch": "hb", From 25309f38d8d017ce7a6305842ed0b40b72e4a59e Mon Sep 17 00:00:00 2001 From: Julien Midedji Date: Sun, 1 Oct 2023 19:15:41 +0200 Subject: [PATCH 322/751] Add test for resource JSON marshaling - ActionVariable (#2942) --- github/actions_variables_test.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/github/actions_variables_test.go b/github/actions_variables_test.go index 646da92b1e8..a9f773c261e 100644 --- a/github/actions_variables_test.go +++ b/github/actions_variables_test.go @@ -657,3 +657,31 @@ func TestActionsService_DeleteEnvVariable(t *testing.T) { return client.Actions.DeleteEnvVariable(ctx, 1, "r", "variable") }) } + +func TestActionVariable_Marshal(t *testing.T) { + testJSONMarshal(t, &ActionsVariable{}, "{}") + + av := &ActionsVariable{ + Name: "n", + Value: "v", + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + Visibility: String("v"), + SelectedRepositoriesURL: String("s"), + SelectedRepositoryIDs: &SelectedRepoIDs{1, 2, 3}, + } + + want := fmt.Sprintf(`{ + "name": "n", + "value": "v", + "created_at": %s, + "updated_at": %s, + "visibility": "v", + "selected_repositories_url": "s", + "selected_repository_ids": [1,2,3] + }`, referenceTimeStr, referenceTimeStr) + + fmt.Println(want) + + testJSONMarshal(t, av, want) +} From 8cd452b85e821c32eefcc5964e91e57f9731891f Mon Sep 17 00:00:00 2001 From: Ramesh Gaikwad Date: Sun, 1 Oct 2023 22:56:23 +0530 Subject: [PATCH 323/751] Add json marshaling tests for action usage and OIDC types (#2944) --- github/actions_cache_test.go | 130 +++++++++++++++++++++++++++++++++++ github/actions_oidc_test.go | 18 +++++ 2 files changed, 148 insertions(+) diff --git a/github/actions_cache_test.go b/github/actions_cache_test.go index b72d5cb8284..c13b772691c 100644 --- a/github/actions_cache_test.go +++ b/github/actions_cache_test.go @@ -515,3 +515,133 @@ func TestActionsService_GetCacheUsageForEnterprise_notFound(t *testing.T) { t.Errorf("Actions.GetTotalCacheUsageForEnterprise return %+v, want nil", caches) } } + +func TestActionsCache_Marshal(t *testing.T) { + testJSONMarshal(t, &ActionsCache{}, "{}") + + u := &ActionsCache{ + ID: Int64(1), + Ref: String("refAction"), + Key: String("key1"), + Version: String("alpha"), + LastAccessedAt: &Timestamp{referenceTime}, + CreatedAt: &Timestamp{referenceTime}, + SizeInBytes: Int64(1), + } + + want := `{ + "id": 1, + "ref": "refAction", + "key": "key1", + "version": "alpha", + "last_accessed_at": ` + referenceTimeStr + `, + "created_at": ` + referenceTimeStr + `, + "size_in_bytes": 1 + }` + + testJSONMarshal(t, u, want) +} + +func TestActionsCacheList_Marshal(t *testing.T) { + testJSONMarshal(t, &ActionsCacheList{}, "{}") + + u := &ActionsCacheList{ + TotalCount: 2, + ActionsCaches: []*ActionsCache{ + { + ID: Int64(1), + Key: String("key1"), + Version: String("alpha"), + LastAccessedAt: &Timestamp{referenceTime}, + CreatedAt: &Timestamp{referenceTime}, + SizeInBytes: Int64(1), + }, + { + ID: Int64(2), + Ref: String("refAction"), + LastAccessedAt: &Timestamp{referenceTime}, + CreatedAt: &Timestamp{referenceTime}, + SizeInBytes: Int64(1), + }, + }, + } + want := `{ + "total_count": 2, + "actions_caches": [{ + "id": 1, + "key": "key1", + "version": "alpha", + "last_accessed_at": ` + referenceTimeStr + `, + "created_at": ` + referenceTimeStr + `, + "size_in_bytes": 1 + }, + { + "id": 2, + "ref": "refAction", + "last_accessed_at": ` + referenceTimeStr + `, + "created_at": ` + referenceTimeStr + `, + "size_in_bytes": 1 + }] + }` + testJSONMarshal(t, u, want) +} + +func TestActionsCacheUsage_Marshal(t *testing.T) { + testJSONMarshal(t, &ActionsCacheUsage{}, "{}") + + u := &ActionsCacheUsage{ + FullName: "cache_usage1", + ActiveCachesSizeInBytes: 2, + ActiveCachesCount: 2, + } + + want := `{ + "full_name": "cache_usage1", + "active_caches_size_in_bytes": 2, + "active_caches_count": 2 + }` + + testJSONMarshal(t, u, want) +} + +func TestActionsCacheUsageList_Marshal(t *testing.T) { + testJSONMarshal(t, &ActionsCacheUsageList{}, "{}") + + u := &ActionsCacheUsageList{ + TotalCount: 1, + RepoCacheUsage: []*ActionsCacheUsage{ + { + FullName: "cache_usage1", + ActiveCachesSizeInBytes: 2, + ActiveCachesCount: 2, + }, + }, + } + + want := `{ + "total_count": 1, + "repository_cache_usages": [{ + "full_name": "cache_usage1", + "active_caches_size_in_bytes": 2, + "active_caches_count": 2 + }] + }` + + testJSONMarshal(t, u, want) +} + +func TestTotalCacheUsage_Marshal(t *testing.T) { + testJSONMarshal(t, &TotalCacheUsage{}, "{}") + + u := &TotalCacheUsage{ + TotalActiveCachesUsageSizeInBytes: 2, + TotalActiveCachesCount: 2, + } + + want := `{ + "total_active_caches_size_in_bytes": 2, + "total_active_caches_count": 2 + }` + + testJSONMarshal(t, u, want) +} diff --git a/github/actions_oidc_test.go b/github/actions_oidc_test.go index c56dfef3d9d..a1eee7c3157 100644 --- a/github/actions_oidc_test.go +++ b/github/actions_oidc_test.go @@ -179,3 +179,21 @@ func TestActionService_SetRepoOIDCSubjectClaimCustomTemplateToDefault(t *testing return client.Actions.SetRepoOIDCSubjectClaimCustomTemplate(ctx, "o", "r", input) }) } + +func TestOIDCSubjectClaimCustomTemplate_Marshal(t *testing.T) { + testJSONMarshal(t, &OIDCSubjectClaimCustomTemplate{}, "{}") + + u := &OIDCSubjectClaimCustomTemplate{ + UseDefault: Bool(false), + IncludeClaimKeys: []string{"s"}, + } + + want := `{ + "use_default": false, + "include_claim_keys": [ + "s" + ] + }` + + testJSONMarshal(t, u, want) +} From 7d26b99722ae97b2549526161aa2150cb6401ec6 Mon Sep 17 00:00:00 2001 From: Abhijit Hota Date: Wed, 4 Oct 2023 04:30:16 +0530 Subject: [PATCH 324/751] Add List Installation Requests API (#2947) --- github/apps.go | 32 ++++++++++++++++++++++ github/apps_test.go | 47 +++++++++++++++++++++++++++++++++ github/github-accessors.go | 40 ++++++++++++++++++++++++++++ github/github-accessors_test.go | 44 ++++++++++++++++++++++++++++++ 4 files changed, 163 insertions(+) diff --git a/github/apps.go b/github/apps.go index ab83d59ab2f..8965e66815c 100644 --- a/github/apps.go +++ b/github/apps.go @@ -102,6 +102,15 @@ type InstallationPermissions struct { Workflows *string `json:"workflows,omitempty"` } +// InstallationRequest represents a pending GitHub App installation request. +type InstallationRequest struct { + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Account *User `json:"account,omitempty"` + Requester *User `json:"requester,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` +} + // Installation represents a GitHub Apps installation. type Installation struct { ID *int64 `json:"id,omitempty"` @@ -175,6 +184,29 @@ func (s *AppsService) Get(ctx context.Context, appSlug string) (*App, *Response, return app, resp, nil } +// ListInstallationRequests lists the pending installation requests that the current GitHub App has. +// +// GitHub API docs: https://docs.github.com/en/rest/apps/apps#list-installation-requests-for-the-authenticated-app +func (s *AppsService) ListInstallationRequests(ctx context.Context, opts *ListOptions) ([]*InstallationRequest, *Response, error) { + u, err := addOptions("app/installation-requests", opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var i []*InstallationRequest + resp, err := s.client.Do(ctx, req, &i) + if err != nil { + return nil, resp, err + } + + return i, resp, nil +} + // ListInstallations lists the installations that the current GitHub App has. // // GitHub API docs: https://docs.github.com/en/rest/apps/apps#list-installations-for-the-authenticated-app diff --git a/github/apps_test.go b/github/apps_test.go index f87d5006873..a58326ea5ee 100644 --- a/github/apps_test.go +++ b/github/apps_test.go @@ -72,6 +72,53 @@ func TestAppsService_Get_specifiedApp(t *testing.T) { } } +func TestAppsService_ListInstallationRequests(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/app/installation-requests", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{ + "page": "1", + "per_page": "2", + }) + fmt.Fprint(w, `[{ + "id": 1, + "account": { "id": 2 }, + "requester": { "id": 3 }, + "created_at": "2018-01-01T00:00:00Z" + }]`, + ) + }) + + opt := &ListOptions{Page: 1, PerPage: 2} + ctx := context.Background() + installationRequests, _, err := client.Apps.ListInstallationRequests(ctx, opt) + if err != nil { + t.Errorf("Apps.ListInstallations returned error: %v", err) + } + + date := Timestamp{Time: time.Date(2018, time.January, 1, 0, 0, 0, 0, time.UTC)} + want := []*InstallationRequest{{ + ID: Int64(1), + Account: &User{ID: Int64(2)}, + Requester: &User{ID: Int64(3)}, + CreatedAt: &date, + }} + if !cmp.Equal(installationRequests, want) { + t.Errorf("Apps.ListInstallationRequests returned %+v, want %+v", installationRequests, want) + } + + const methodName = "ListInstallationRequests" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Apps.ListInstallationRequests(ctx, opt) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + func TestAppsService_ListInstallations(t *testing.T) { client, mux, _, teardown := setup() defer teardown() diff --git a/github/github-accessors.go b/github/github-accessors.go index b305bfc6448..f34d9a4afdf 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -8910,6 +8910,46 @@ func (i *InstallationRepositoriesEvent) GetSender() *User { return i.Sender } +// GetAccount returns the Account field. +func (i *InstallationRequest) GetAccount() *User { + if i == nil { + return nil + } + return i.Account +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (i *InstallationRequest) GetCreatedAt() Timestamp { + if i == nil || i.CreatedAt == nil { + return Timestamp{} + } + return *i.CreatedAt +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (i *InstallationRequest) GetID() int64 { + if i == nil || i.ID == nil { + return 0 + } + return *i.ID +} + +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (i *InstallationRequest) GetNodeID() string { + if i == nil || i.NodeID == nil { + return "" + } + return *i.NodeID +} + +// GetRequester returns the Requester field. +func (i *InstallationRequest) GetRequester() *User { + if i == nil { + return nil + } + return i.Requester +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (i *InstallationSlugChange) GetFrom() string { if i == nil || i.From == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 962e5e8f733..25c8ab7e4b4 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -10487,6 +10487,50 @@ func TestInstallationRepositoriesEvent_GetSender(tt *testing.T) { i.GetSender() } +func TestInstallationRequest_GetAccount(tt *testing.T) { + i := &InstallationRequest{} + i.GetAccount() + i = nil + i.GetAccount() +} + +func TestInstallationRequest_GetCreatedAt(tt *testing.T) { + var zeroValue Timestamp + i := &InstallationRequest{CreatedAt: &zeroValue} + i.GetCreatedAt() + i = &InstallationRequest{} + i.GetCreatedAt() + i = nil + i.GetCreatedAt() +} + +func TestInstallationRequest_GetID(tt *testing.T) { + var zeroValue int64 + i := &InstallationRequest{ID: &zeroValue} + i.GetID() + i = &InstallationRequest{} + i.GetID() + i = nil + i.GetID() +} + +func TestInstallationRequest_GetNodeID(tt *testing.T) { + var zeroValue string + i := &InstallationRequest{NodeID: &zeroValue} + i.GetNodeID() + i = &InstallationRequest{} + i.GetNodeID() + i = nil + i.GetNodeID() +} + +func TestInstallationRequest_GetRequester(tt *testing.T) { + i := &InstallationRequest{} + i.GetRequester() + i = nil + i.GetRequester() +} + func TestInstallationSlugChange_GetFrom(tt *testing.T) { var zeroValue string i := &InstallationSlugChange{From: &zeroValue} From 5224e344009ffb8dd77256afe3b3528f1c0cddfb Mon Sep 17 00:00:00 2001 From: Pj Meyer Date: Tue, 3 Oct 2023 17:13:19 -0600 Subject: [PATCH 325/751] Add support for "performed_via_github_app" and "requested_team" in IssueEvent (#2946) Fixes: #2495. --- github/event_types.go | 6 ++ github/event_types_test.go | 148 ++++++++++++++++++++------------ github/github-accessors.go | 40 +++++++++ github/github-accessors_test.go | 35 ++++++++ github/issues_events.go | 26 +++--- github/issues_events_test.go | 112 ++++++++++++++++++++++++ github/issues_timeline.go | 2 + 7 files changed, 301 insertions(+), 68 deletions(-) diff --git a/github/event_types.go b/github/event_types.go index 1a403da9b9d..3161384f15d 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -1086,6 +1086,9 @@ type PullRequestEvent struct { // The following fields are only populated when the Action is "synchronize". Before *string `json:"before,omitempty"` After *string `json:"after,omitempty"` + + // The following will be populated if the event was performed by an App + PerformedViaGithubApp *App `json:"performed_via_github_app,omitempty"` } // PullRequestReviewEvent is triggered when a review is submitted on a pull @@ -1186,6 +1189,9 @@ type PullRequestTargetEvent struct { // The following fields are only populated when the Action is "synchronize". Before *string `json:"before,omitempty"` After *string `json:"after,omitempty"` + + // The following will be populated if the event was performed by an App + PerformedViaGithubApp *App `json:"performed_via_github_app,omitempty"` } // PushEvent represents a git push to a GitHub repository. diff --git a/github/event_types_test.go b/github/event_types_test.go index 31b94479f3b..91ac291205f 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -15177,6 +15177,15 @@ func TestPullRequestEvent_Marshal(t *testing.T) { URL: String("s"), Name: String("n"), }, + PerformedViaGithubApp: &App{ + ID: Int64(1), + NodeID: String("n"), + Slug: String("s"), + Name: String("n"), + Description: String("d"), + ExternalURL: String("e"), + HTMLURL: String("h"), + }, Organization: &Organization{ BillingEmail: String("be"), Blog: String("b"), @@ -15346,11 +15355,47 @@ func TestPullRequestEvent_Marshal(t *testing.T) { "requested_team": { "id": 1 }, + "label": { + "id": 1 + }, + "before": "before", + "after": "after", "repository": { "id": 1, "name": "n", "url": "s" }, + "performed_via_github_app": { + "id": 1, + "node_id": "n", + "slug": "s", + "name": "n", + "description": "d", + "external_url": "e", + "html_url": "h" + }, + "organization": { + "name": "n", + "company": "c", + "blog": "b", + "location": "loc", + "email": "e", + "twitter_username": "tu", + "description": "d", + "billing_email": "be", + "is_verified": true, + "has_organization_projects": true, + "has_repository_projects": true, + "default_repository_permission": "drp", + "members_can_create_repositories": true, + "members_can_create_public_repositories": false, + "members_can_create_private_repositories": true, + "members_can_create_internal_repositories": true, + "members_allowed_repository_creation_type": "marct", + "members_can_create_pages": true, + "members_can_create_public_pages": false, + "members_can_create_private_pages": true + }, "sender": { "login": "l", "id": 1, @@ -15456,34 +15501,7 @@ func TestPullRequestEvent_Marshal(t *testing.T) { "url": "u" }, "suspended_at": ` + referenceTimeStr + ` - }, - "label": { - "id": 1 - }, - "organization": { - "name": "n", - "company": "c", - "blog": "b", - "location": "loc", - "email": "e", - "twitter_username": "tu", - "description": "d", - "billing_email": "be", - "is_verified": true, - "has_organization_projects": true, - "has_repository_projects": true, - "default_repository_permission": "drp", - "members_can_create_repositories": true, - "members_can_create_public_repositories": false, - "members_can_create_private_repositories": true, - "members_can_create_internal_repositories": true, - "members_allowed_repository_creation_type": "marct", - "members_can_create_pages": true, - "members_can_create_public_pages": false, - "members_can_create_private_pages": true - }, - "before": "before", - "after": "after" + } }` testJSONMarshal(t, u, want) @@ -16060,6 +16078,15 @@ func TestPullRequestTargetEvent_Marshal(t *testing.T) { URL: String("s"), Name: String("n"), }, + PerformedViaGithubApp: &App{ + ID: Int64(1), + NodeID: String("n"), + Slug: String("s"), + Name: String("n"), + Description: String("d"), + ExternalURL: String("e"), + HTMLURL: String("h"), + }, Organization: &Organization{ BillingEmail: String("be"), Blog: String("b"), @@ -16229,11 +16256,47 @@ func TestPullRequestTargetEvent_Marshal(t *testing.T) { "requested_team": { "id": 1 }, + "label": { + "id": 1 + }, + "before": "before", + "after": "after", "repository": { "id": 1, "name": "n", "url": "s" }, + "performed_via_github_app": { + "id": 1, + "node_id": "n", + "slug": "s", + "name": "n", + "description": "d", + "external_url": "e", + "html_url": "h" + }, + "organization": { + "name": "n", + "company": "c", + "blog": "b", + "location": "loc", + "email": "e", + "twitter_username": "tu", + "description": "d", + "billing_email": "be", + "is_verified": true, + "has_organization_projects": true, + "has_repository_projects": true, + "default_repository_permission": "drp", + "members_can_create_repositories": true, + "members_can_create_public_repositories": false, + "members_can_create_private_repositories": true, + "members_can_create_internal_repositories": true, + "members_allowed_repository_creation_type": "marct", + "members_can_create_pages": true, + "members_can_create_public_pages": false, + "members_can_create_private_pages": true + }, "sender": { "login": "l", "id": 1, @@ -16339,34 +16402,7 @@ func TestPullRequestTargetEvent_Marshal(t *testing.T) { "url": "u" }, "suspended_at": ` + referenceTimeStr + ` - }, - "label": { - "id": 1 - }, - "organization": { - "name": "n", - "company": "c", - "blog": "b", - "location": "loc", - "email": "e", - "twitter_username": "tu", - "description": "d", - "billing_email": "be", - "is_verified": true, - "has_organization_projects": true, - "has_repository_projects": true, - "default_repository_permission": "drp", - "members_can_create_repositories": true, - "members_can_create_public_repositories": false, - "members_can_create_private_repositories": true, - "members_can_create_internal_repositories": true, - "members_allowed_repository_creation_type": "marct", - "members_can_create_pages": true, - "members_can_create_public_pages": false, - "members_can_create_private_pages": true - }, - "before": "before", - "after": "after" + } }` testJSONMarshal(t, u, want) diff --git a/github/github-accessors.go b/github/github-accessors.go index f34d9a4afdf..7317081668e 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -9638,6 +9638,14 @@ func (i *IssueEvent) GetMilestone() *Milestone { return i.Milestone } +// GetPerformedViaGithubApp returns the PerformedViaGithubApp field. +func (i *IssueEvent) GetPerformedViaGithubApp() *App { + if i == nil { + return nil + } + return i.PerformedViaGithubApp +} + // GetProjectCard returns the ProjectCard field. func (i *IssueEvent) GetProjectCard() *ProjectCard { if i == nil { @@ -9662,6 +9670,14 @@ func (i *IssueEvent) GetRequestedReviewer() *User { return i.RequestedReviewer } +// GetRequestedTeam returns the RequestedTeam field. +func (i *IssueEvent) GetRequestedTeam() *Team { + if i == nil { + return nil + } + return i.RequestedTeam +} + // GetReviewRequester returns the ReviewRequester field. func (i *IssueEvent) GetReviewRequester() *User { if i == nil { @@ -16198,6 +16214,14 @@ func (p *PullRequestEvent) GetOrganization() *Organization { return p.Organization } +// GetPerformedViaGithubApp returns the PerformedViaGithubApp field. +func (p *PullRequestEvent) GetPerformedViaGithubApp() *App { + if p == nil { + return nil + } + return p.PerformedViaGithubApp +} + // GetPullRequest returns the PullRequest field. func (p *PullRequestEvent) GetPullRequest() *PullRequest { if p == nil { @@ -16734,6 +16758,14 @@ func (p *PullRequestTargetEvent) GetOrganization() *Organization { return p.Organization } +// GetPerformedViaGithubApp returns the PerformedViaGithubApp field. +func (p *PullRequestTargetEvent) GetPerformedViaGithubApp() *App { + if p == nil { + return nil + } + return p.PerformedViaGithubApp +} + // GetPullRequest returns the PullRequest field. func (p *PullRequestTargetEvent) GetPullRequest() *PullRequest { if p == nil { @@ -22566,6 +22598,14 @@ func (t *Timeline) GetMilestone() *Milestone { return t.Milestone } +// GetPerformedViaGithubApp returns the PerformedViaGithubApp field. +func (t *Timeline) GetPerformedViaGithubApp() *App { + if t == nil { + return nil + } + return t.PerformedViaGithubApp +} + // GetProjectCard returns the ProjectCard field. func (t *Timeline) GetProjectCard() *ProjectCard { if t == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 25c8ab7e4b4..bdb4209a270 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -11292,6 +11292,13 @@ func TestIssueEvent_GetMilestone(tt *testing.T) { i.GetMilestone() } +func TestIssueEvent_GetPerformedViaGithubApp(tt *testing.T) { + i := &IssueEvent{} + i.GetPerformedViaGithubApp() + i = nil + i.GetPerformedViaGithubApp() +} + func TestIssueEvent_GetProjectCard(tt *testing.T) { i := &IssueEvent{} i.GetProjectCard() @@ -11313,6 +11320,13 @@ func TestIssueEvent_GetRequestedReviewer(tt *testing.T) { i.GetRequestedReviewer() } +func TestIssueEvent_GetRequestedTeam(tt *testing.T) { + i := &IssueEvent{} + i.GetRequestedTeam() + i = nil + i.GetRequestedTeam() +} + func TestIssueEvent_GetReviewRequester(tt *testing.T) { i := &IssueEvent{} i.GetReviewRequester() @@ -18856,6 +18870,13 @@ func TestPullRequestEvent_GetOrganization(tt *testing.T) { p.GetOrganization() } +func TestPullRequestEvent_GetPerformedViaGithubApp(tt *testing.T) { + p := &PullRequestEvent{} + p.GetPerformedViaGithubApp() + p = nil + p.GetPerformedViaGithubApp() +} + func TestPullRequestEvent_GetPullRequest(tt *testing.T) { p := &PullRequestEvent{} p.GetPullRequest() @@ -19424,6 +19445,13 @@ func TestPullRequestTargetEvent_GetOrganization(tt *testing.T) { p.GetOrganization() } +func TestPullRequestTargetEvent_GetPerformedViaGithubApp(tt *testing.T) { + p := &PullRequestTargetEvent{} + p.GetPerformedViaGithubApp() + p = nil + p.GetPerformedViaGithubApp() +} + func TestPullRequestTargetEvent_GetPullRequest(tt *testing.T) { p := &PullRequestTargetEvent{} p.GetPullRequest() @@ -26258,6 +26286,13 @@ func TestTimeline_GetMilestone(tt *testing.T) { t.GetMilestone() } +func TestTimeline_GetPerformedViaGithubApp(tt *testing.T) { + t := &Timeline{} + t.GetPerformedViaGithubApp() + t = nil + t.GetPerformedViaGithubApp() +} + func TestTimeline_GetProjectCard(tt *testing.T) { t := &Timeline{} t.GetProjectCard() diff --git a/github/issues_events.go b/github/issues_events.go index ed076591701..0305fca1168 100644 --- a/github/issues_events.go +++ b/github/issues_events.go @@ -66,7 +66,7 @@ type IssueEvent struct { // // review_requested, review_request_removed // The Actor requested or removed the request for a review. - // RequestedReviewer and ReviewRequester will be populated below. + // RequestedReviewer or RequestedTeam, and ReviewRequester will be populated below. // Event *string `json:"event,omitempty"` @@ -74,17 +74,19 @@ type IssueEvent struct { Issue *Issue `json:"issue,omitempty"` // Only present on certain events; see above. - Assignee *User `json:"assignee,omitempty"` - Assigner *User `json:"assigner,omitempty"` - CommitID *string `json:"commit_id,omitempty"` - Milestone *Milestone `json:"milestone,omitempty"` - Label *Label `json:"label,omitempty"` - Rename *Rename `json:"rename,omitempty"` - LockReason *string `json:"lock_reason,omitempty"` - ProjectCard *ProjectCard `json:"project_card,omitempty"` - DismissedReview *DismissedReview `json:"dismissed_review,omitempty"` - RequestedReviewer *User `json:"requested_reviewer,omitempty"` - ReviewRequester *User `json:"review_requester,omitempty"` + Assignee *User `json:"assignee,omitempty"` + Assigner *User `json:"assigner,omitempty"` + CommitID *string `json:"commit_id,omitempty"` + Milestone *Milestone `json:"milestone,omitempty"` + Label *Label `json:"label,omitempty"` + Rename *Rename `json:"rename,omitempty"` + LockReason *string `json:"lock_reason,omitempty"` + ProjectCard *ProjectCard `json:"project_card,omitempty"` + DismissedReview *DismissedReview `json:"dismissed_review,omitempty"` + RequestedReviewer *User `json:"requested_reviewer,omitempty"` + RequestedTeam *Team `json:"requested_team,omitempty"` + ReviewRequester *User `json:"review_requester,omitempty"` + PerformedViaGithubApp *App `json:"performed_via_github_app,omitempty"` } // DismissedReview represents details for 'dismissed_review' events. diff --git a/github/issues_events_test.go b/github/issues_events_test.go index 1d8d3233d19..e8118b6ddcd 100644 --- a/github/issues_events_test.go +++ b/github/issues_events_test.go @@ -270,6 +270,62 @@ func TestIssueEvent_Marshal(t *testing.T) { CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, + RequestedTeam: &Team{ + ID: Int64(1), + NodeID: String("n"), + Name: String("n"), + Description: String("d"), + URL: String("u"), + Slug: String("s"), + Permission: String("p"), + Privacy: String("p"), + MembersCount: Int(1), + ReposCount: Int(1), + MembersURL: String("m"), + RepositoriesURL: String("r"), + Organization: &Organization{ + Login: String("l"), + ID: Int64(1), + NodeID: String("n"), + AvatarURL: String("a"), + HTMLURL: String("h"), + Name: String("n"), + Company: String("c"), + Blog: String("b"), + Location: String("l"), + Email: String("e"), + }, + Parent: &Team{ + ID: Int64(1), + NodeID: String("n"), + Name: String("n"), + Description: String("d"), + URL: String("u"), + Slug: String("s"), + Permission: String("p"), + Privacy: String("p"), + MembersCount: Int(1), + ReposCount: Int(1), + }, + LDAPDN: String("l"), + }, + PerformedViaGithubApp: &App{ + ID: Int64(1), + NodeID: String("n"), + Owner: &User{ + Login: String("l"), + ID: Int64(1), + NodeID: String("n"), + URL: String("u"), + ReposURL: String("r"), + EventsURL: String("e"), + AvatarURL: String("a"), + }, + Name: String("n"), + Description: String("d"), + HTMLURL: String("h"), + ExternalURL: String("u"), + }, ReviewRequester: &User{ Login: String("l"), ID: Int64(1), @@ -401,6 +457,62 @@ func TestIssueEvent_Marshal(t *testing.T) { "suspended_at": ` + referenceTimeStr + `, "url": "u" }, + "requested_team": { + "id": 1, + "node_id": "n", + "name": "n", + "description": "d", + "url": "u", + "slug": "s", + "permission": "p", + "privacy": "p", + "members_count": 1, + "repos_count": 1, + "members_url": "m", + "repositories_url": "r", + "organization": { + "login": "l", + "id": 1, + "node_id": "n", + "avatar_url": "a", + "html_url": "h", + "name": "n", + "company": "c", + "blog": "b", + "location": "l", + "email": "e" + }, + "parent": { + "id": 1, + "node_id": "n", + "name": "n", + "description": "d", + "url": "u", + "slug": "s", + "permission": "p", + "privacy": "p", + "members_count": 1, + "repos_count": 1 + }, + "ldap_dn": "l" + }, + "performed_via_github_app": { + "id": 1, + "node_id": "n", + "owner": { + "login": "l", + "id": 1, + "node_id": "n", + "url": "u", + "repos_url": "r", + "events_url": "e", + "avatar_url": "a" + }, + "name": "n", + "description": "d", + "html_url": "h", + "external_url": "u" + }, "review_requester": { "login": "l", "id": 1, diff --git a/github/issues_timeline.go b/github/issues_timeline.go index 9c73e6176d1..8ac02ac14dc 100644 --- a/github/issues_timeline.go +++ b/github/issues_timeline.go @@ -151,6 +151,8 @@ type Timeline struct { // The review summary text. Body *string `json:"body,omitempty"` SubmittedAt *Timestamp `json:"submitted_at,omitempty"` + + PerformedViaGithubApp *App `json:"performed_via_github_app,omitempty"` } // Source represents a reference's source. From 84651d1d8c93c5016e4d19da00eeb38307b6c286 Mon Sep 17 00:00:00 2001 From: billnapier Date: Wed, 4 Oct 2023 08:06:36 -0700 Subject: [PATCH 326/751] Add "organization" field to more events (#2949) Fixes: #2950. --- github/event_types.go | 76 ++++++++++++++++ github/github-accessors.go | 152 ++++++++++++++++++++++++++++++++ github/github-accessors_test.go | 133 ++++++++++++++++++++++++++++ 3 files changed, 361 insertions(+) diff --git a/github/event_types.go b/github/event_types.go index 3161384f15d..b3e58b3318f 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -76,6 +76,10 @@ type CommitCommentEvent struct { Repo *Repository `json:"repository,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Org *Organization `json:"organization,omitempty"` } // ContentReferenceEvent is triggered when the body or comment of an issue or @@ -132,6 +136,10 @@ type DeleteEvent struct { Repo *Repository `json:"repository,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Org *Organization `json:"organization,omitempty"` } // DependabotAlertEvent is triggered when there is activity relating to Dependabot alerts. @@ -192,6 +200,10 @@ type DeploymentEvent struct { // The following fields are only populated by Webhook events. Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Org *Organization `json:"organization,omitempty"` } // DeploymentProtectionRuleEvent represents a deployment protection rule event. @@ -227,6 +239,10 @@ type DeploymentStatusEvent struct { // The following fields are only populated by Webhook events. Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Org *Organization `json:"organization,omitempty"` } // DiscussionCommentEvent represents a webhook event for a comment on discussion. @@ -363,6 +379,10 @@ type GollumEvent struct { Repo *Repository `json:"repository,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Org *Organization `json:"organization,omitempty"` } // EditChange represents the changes when an issue, pull request, comment, @@ -510,6 +530,10 @@ type InstallationEvent struct { Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` Requester *User `json:"requester,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Org *Organization `json:"organization,omitempty"` } // InstallationRepositoriesEvent is triggered when a repository is added or @@ -524,6 +548,10 @@ type InstallationRepositoriesEvent struct { RepositorySelection *string `json:"repository_selection,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Org *Organization `json:"organization,omitempty"` } // InstallationLoginChange represents a change in login on an installation. @@ -603,6 +631,10 @@ type IssuesEvent struct { Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` Milestone *Milestone `json:"milestone,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Org *Organization `json:"organization,omitempty"` } // LabelEvent is triggered when a repository's label is created, edited, or deleted. @@ -639,6 +671,10 @@ type MarketplacePurchaseEvent struct { PreviousMarketplacePurchase *MarketplacePurchase `json:"previous_marketplace_purchase,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Org *Organization `json:"organization,omitempty"` } // MemberEvent is triggered when a user is added as a collaborator to a repository. @@ -654,6 +690,10 @@ type MemberEvent struct { Repo *Repository `json:"repository,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Org *Organization `json:"organization,omitempty"` } // MembershipEvent is triggered when a user is added or removed from a team. @@ -825,6 +865,10 @@ type PageBuildEvent struct { Repo *Repository `json:"repository,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Org *Organization `json:"organization,omitempty"` } // PersonalAccessTokenRequestEvent occurs when there is activity relating to a @@ -885,6 +929,10 @@ type PersonalAccessTokenRequest struct { // Date and time when the associated fine-grained personal access token was last used for authentication. TokenLastUsedAt *Timestamp `json:"token_last_used_at,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Org *Organization `json:"organization,omitempty"` } // PersonalAccessTokenPermissions represents the original or newly requested @@ -1044,6 +1092,10 @@ type PublicEvent struct { Repo *Repository `json:"repository,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Org *Organization `json:"organization,omitempty"` } // PullRequestEvent is triggered when a pull request is assigned, unassigned, labeled, @@ -1129,6 +1181,10 @@ type PullRequestReviewCommentEvent struct { Repo *Repository `json:"repository,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Org *Organization `json:"organization,omitempty"` } // PullRequestReviewThreadEvent is triggered when a comment made as part of a @@ -1147,6 +1203,10 @@ type PullRequestReviewThreadEvent struct { Repo *Repository `json:"repository,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Org *Organization `json:"organization,omitempty"` } // PullRequestTargetEvent is triggered when a pull request is assigned, unassigned, labeled, @@ -1315,6 +1375,10 @@ type ReleaseEvent struct { Repo *Repository `json:"repository,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Org *Organization `json:"organization,omitempty"` } // RepositoryEvent is triggered when a repository is created, archived, unarchived, @@ -1385,6 +1449,10 @@ type RepositoryVulnerabilityAlertEvent struct { // The user that triggered the event. Sender *User `json:"sender,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Org *Organization `json:"organization,omitempty"` } // RepositoryVulnerabilityAlert represents a repository security alert. @@ -1491,6 +1559,10 @@ type StatusEvent struct { Repo *Repository `json:"repository,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Org *Organization `json:"organization,omitempty"` } // TeamEvent is triggered when an organization's team is created, modified or deleted. @@ -1561,6 +1633,10 @@ type WatchEvent struct { Repo *Repository `json:"repository,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Org *Organization `json:"organization,omitempty"` } // WorkflowDispatchEvent is triggered when someone triggers a workflow run on GitHub or diff --git a/github/github-accessors.go b/github/github-accessors.go index 7317081668e..8519de2de9d 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -3814,6 +3814,14 @@ func (c *CommitCommentEvent) GetInstallation() *Installation { return c.Installation } +// GetOrg returns the Org field. +func (c *CommitCommentEvent) GetOrg() *Organization { + if c == nil { + return nil + } + return c.Org +} + // GetRepo returns the Repo field. func (c *CommitCommentEvent) GetRepo() *Repository { if c == nil { @@ -5046,6 +5054,14 @@ func (d *DeleteEvent) GetInstallation() *Installation { return d.Installation } +// GetOrg returns the Org field. +func (d *DeleteEvent) GetOrg() *Organization { + if d == nil { + return nil + } + return d.Org +} + // GetPusherType returns the PusherType field if it's non-nil, zero value otherwise. func (d *DeleteEvent) GetPusherType() string { if d == nil || d.PusherType == nil { @@ -5582,6 +5598,14 @@ func (d *DeploymentEvent) GetInstallation() *Installation { return d.Installation } +// GetOrg returns the Org field. +func (d *DeploymentEvent) GetOrg() *Organization { + if d == nil { + return nil + } + return d.Org +} + // GetRepo returns the Repo field. func (d *DeploymentEvent) GetRepo() *Repository { if d == nil { @@ -5886,6 +5910,14 @@ func (d *DeploymentStatusEvent) GetInstallation() *Installation { return d.Installation } +// GetOrg returns the Org field. +func (d *DeploymentStatusEvent) GetOrg() *Organization { + if d == nil { + return nil + } + return d.Org +} + // GetRepo returns the Repo field. func (d *DeploymentStatusEvent) GetRepo() *Repository { if d == nil { @@ -7686,6 +7718,14 @@ func (g *GollumEvent) GetInstallation() *Installation { return g.Installation } +// GetOrg returns the Org field. +func (g *GollumEvent) GetOrg() *Organization { + if g == nil { + return nil + } + return g.Org +} + // GetRepo returns the Repo field. func (g *GollumEvent) GetRepo() *Repository { if g == nil { @@ -8558,6 +8598,14 @@ func (i *InstallationEvent) GetInstallation() *Installation { return i.Installation } +// GetOrg returns the Org field. +func (i *InstallationEvent) GetOrg() *Organization { + if i == nil { + return nil + } + return i.Org +} + // GetRequester returns the Requester field. func (i *InstallationEvent) GetRequester() *User { if i == nil { @@ -8894,6 +8942,14 @@ func (i *InstallationRepositoriesEvent) GetInstallation() *Installation { return i.Installation } +// GetOrg returns the Org field. +func (i *InstallationRepositoriesEvent) GetOrg() *Organization { + if i == nil { + return nil + } + return i.Org +} + // GetRepositorySelection returns the RepositorySelection field if it's non-nil, zero value otherwise. func (i *InstallationRepositoriesEvent) GetRepositorySelection() string { if i == nil || i.RepositorySelection == nil { @@ -9998,6 +10054,14 @@ func (i *IssuesEvent) GetMilestone() *Milestone { return i.Milestone } +// GetOrg returns the Org field. +func (i *IssuesEvent) GetOrg() *Organization { + if i == nil { + return nil + } + return i.Org +} + // GetRepo returns the Repo field. func (i *IssuesEvent) GetRepo() *Repository { if i == nil { @@ -11046,6 +11110,14 @@ func (m *MarketplacePurchaseEvent) GetMarketplacePurchase() *MarketplacePurchase return m.MarketplacePurchase } +// GetOrg returns the Org field. +func (m *MarketplacePurchaseEvent) GetOrg() *Organization { + if m == nil { + return nil + } + return m.Org +} + // GetPreviousMarketplacePurchase returns the PreviousMarketplacePurchase field. func (m *MarketplacePurchaseEvent) GetPreviousMarketplacePurchase() *MarketplacePurchase { if m == nil { @@ -11094,6 +11166,14 @@ func (m *MemberEvent) GetMember() *User { return m.Member } +// GetOrg returns the Org field. +func (m *MemberEvent) GetOrg() *Organization { + if m == nil { + return nil + } + return m.Org +} + // GetRepo returns the Repo field. func (m *MemberEvent) GetRepo() *Repository { if m == nil { @@ -13326,6 +13406,14 @@ func (p *PageBuildEvent) GetInstallation() *Installation { return p.Installation } +// GetOrg returns the Org field. +func (p *PageBuildEvent) GetOrg() *Organization { + if p == nil { + return nil + } + return p.Org +} + // GetRepo returns the Repo field. func (p *PageBuildEvent) GetRepo() *Repository { if p == nil { @@ -13862,6 +13950,14 @@ func (p *PersonalAccessTokenRequest) GetID() int64 { return *p.ID } +// GetOrg returns the Org field. +func (p *PersonalAccessTokenRequest) GetOrg() *Organization { + if p == nil { + return nil + } + return p.Org +} + // GetOwner returns the Owner field. func (p *PersonalAccessTokenRequest) GetOwner() *User { if p == nil { @@ -15454,6 +15550,14 @@ func (p *PublicEvent) GetInstallation() *Installation { return p.Installation } +// GetOrg returns the Org field. +func (p *PublicEvent) GetOrg() *Organization { + if p == nil { + return nil + } + return p.Org +} + // GetRepo returns the Repo field. func (p *PublicEvent) GetRepo() *Repository { if p == nil { @@ -16430,6 +16534,14 @@ func (p *PullRequestReviewCommentEvent) GetInstallation() *Installation { return p.Installation } +// GetOrg returns the Org field. +func (p *PullRequestReviewCommentEvent) GetOrg() *Organization { + if p == nil { + return nil + } + return p.Org +} + // GetPullRequest returns the PullRequest field. func (p *PullRequestReviewCommentEvent) GetPullRequest() *PullRequest { if p == nil { @@ -16654,6 +16766,14 @@ func (p *PullRequestReviewThreadEvent) GetInstallation() *Installation { return p.Installation } +// GetOrg returns the Org field. +func (p *PullRequestReviewThreadEvent) GetOrg() *Organization { + if p == nil { + return nil + } + return p.Org +} + // GetPullRequest returns the PullRequest field. func (p *PullRequestReviewThreadEvent) GetPullRequest() *PullRequest { if p == nil { @@ -17686,6 +17806,14 @@ func (r *ReleaseEvent) GetInstallation() *Installation { return r.Installation } +// GetOrg returns the Org field. +func (r *ReleaseEvent) GetOrg() *Organization { + if r == nil { + return nil + } + return r.Org +} + // GetRelease returns the Release field. func (r *ReleaseEvent) GetRelease() *RepositoryRelease { if r == nil { @@ -19774,6 +19902,14 @@ func (r *RepositoryVulnerabilityAlertEvent) GetInstallation() *Installation { return r.Installation } +// GetOrg returns the Org field. +func (r *RepositoryVulnerabilityAlertEvent) GetOrg() *Organization { + if r == nil { + return nil + } + return r.Org +} + // GetRepository returns the Repository field. func (r *RepositoryVulnerabilityAlertEvent) GetRepository() *Repository { if r == nil { @@ -21622,6 +21758,14 @@ func (s *StatusEvent) GetName() string { return *s.Name } +// GetOrg returns the Org field. +func (s *StatusEvent) GetOrg() *Organization { + if s == nil { + return nil + } + return s.Org +} + // GetRepo returns the Repo field. func (s *StatusEvent) GetRepo() *Repository { if s == nil { @@ -23950,6 +24094,14 @@ func (w *WatchEvent) GetInstallation() *Installation { return w.Installation } +// GetOrg returns the Org field. +func (w *WatchEvent) GetOrg() *Organization { + if w == nil { + return nil + } + return w.Org +} + // GetRepo returns the Repo field. func (w *WatchEvent) GetRepo() *Repository { if w == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index bdb4209a270..c3e02988ae7 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -4519,6 +4519,13 @@ func TestCommitCommentEvent_GetInstallation(tt *testing.T) { c.GetInstallation() } +func TestCommitCommentEvent_GetOrg(tt *testing.T) { + c := &CommitCommentEvent{} + c.GetOrg() + c = nil + c.GetOrg() +} + func TestCommitCommentEvent_GetRepo(tt *testing.T) { c := &CommitCommentEvent{} c.GetRepo() @@ -5969,6 +5976,13 @@ func TestDeleteEvent_GetInstallation(tt *testing.T) { d.GetInstallation() } +func TestDeleteEvent_GetOrg(tt *testing.T) { + d := &DeleteEvent{} + d.GetOrg() + d = nil + d.GetOrg() +} + func TestDeleteEvent_GetPusherType(tt *testing.T) { var zeroValue string d := &DeleteEvent{PusherType: &zeroValue} @@ -6570,6 +6584,13 @@ func TestDeploymentEvent_GetInstallation(tt *testing.T) { d.GetInstallation() } +func TestDeploymentEvent_GetOrg(tt *testing.T) { + d := &DeploymentEvent{} + d.GetOrg() + d = nil + d.GetOrg() +} + func TestDeploymentEvent_GetRepo(tt *testing.T) { d := &DeploymentEvent{} d.GetRepo() @@ -6911,6 +6932,13 @@ func TestDeploymentStatusEvent_GetInstallation(tt *testing.T) { d.GetInstallation() } +func TestDeploymentStatusEvent_GetOrg(tt *testing.T) { + d := &DeploymentStatusEvent{} + d.GetOrg() + d = nil + d.GetOrg() +} + func TestDeploymentStatusEvent_GetRepo(tt *testing.T) { d := &DeploymentStatusEvent{} d.GetRepo() @@ -9011,6 +9039,13 @@ func TestGollumEvent_GetInstallation(tt *testing.T) { g.GetInstallation() } +func TestGollumEvent_GetOrg(tt *testing.T) { + g := &GollumEvent{} + g.GetOrg() + g = nil + g.GetOrg() +} + func TestGollumEvent_GetRepo(tt *testing.T) { g := &GollumEvent{} g.GetRepo() @@ -10059,6 +10094,13 @@ func TestInstallationEvent_GetInstallation(tt *testing.T) { i.GetInstallation() } +func TestInstallationEvent_GetOrg(tt *testing.T) { + i := &InstallationEvent{} + i.GetOrg() + i = nil + i.GetOrg() +} + func TestInstallationEvent_GetRequester(tt *testing.T) { i := &InstallationEvent{} i.GetRequester() @@ -10470,6 +10512,13 @@ func TestInstallationRepositoriesEvent_GetInstallation(tt *testing.T) { i.GetInstallation() } +func TestInstallationRepositoriesEvent_GetOrg(tt *testing.T) { + i := &InstallationRepositoriesEvent{} + i.GetOrg() + i = nil + i.GetOrg() +} + func TestInstallationRepositoriesEvent_GetRepositorySelection(tt *testing.T) { var zeroValue string i := &InstallationRepositoriesEvent{RepositorySelection: &zeroValue} @@ -11706,6 +11755,13 @@ func TestIssuesEvent_GetMilestone(tt *testing.T) { i.GetMilestone() } +func TestIssuesEvent_GetOrg(tt *testing.T) { + i := &IssuesEvent{} + i.GetOrg() + i = nil + i.GetOrg() +} + func TestIssuesEvent_GetRepo(tt *testing.T) { i := &IssuesEvent{} i.GetRepo() @@ -12965,6 +13021,13 @@ func TestMarketplacePurchaseEvent_GetMarketplacePurchase(tt *testing.T) { m.GetMarketplacePurchase() } +func TestMarketplacePurchaseEvent_GetOrg(tt *testing.T) { + m := &MarketplacePurchaseEvent{} + m.GetOrg() + m = nil + m.GetOrg() +} + func TestMarketplacePurchaseEvent_GetPreviousMarketplacePurchase(tt *testing.T) { m := &MarketplacePurchaseEvent{} m.GetPreviousMarketplacePurchase() @@ -13013,6 +13076,13 @@ func TestMemberEvent_GetMember(tt *testing.T) { m.GetMember() } +func TestMemberEvent_GetOrg(tt *testing.T) { + m := &MemberEvent{} + m.GetOrg() + m = nil + m.GetOrg() +} + func TestMemberEvent_GetRepo(tt *testing.T) { m := &MemberEvent{} m.GetRepo() @@ -15620,6 +15690,13 @@ func TestPageBuildEvent_GetInstallation(tt *testing.T) { p.GetInstallation() } +func TestPageBuildEvent_GetOrg(tt *testing.T) { + p := &PageBuildEvent{} + p.GetOrg() + p = nil + p.GetOrg() +} + func TestPageBuildEvent_GetRepo(tt *testing.T) { p := &PageBuildEvent{} p.GetRepo() @@ -16263,6 +16340,13 @@ func TestPersonalAccessTokenRequest_GetID(tt *testing.T) { p.GetID() } +func TestPersonalAccessTokenRequest_GetOrg(tt *testing.T) { + p := &PersonalAccessTokenRequest{} + p.GetOrg() + p = nil + p.GetOrg() +} + func TestPersonalAccessTokenRequest_GetOwner(tt *testing.T) { p := &PersonalAccessTokenRequest{} p.GetOwner() @@ -17980,6 +18064,13 @@ func TestPublicEvent_GetInstallation(tt *testing.T) { p.GetInstallation() } +func TestPublicEvent_GetOrg(tt *testing.T) { + p := &PublicEvent{} + p.GetOrg() + p = nil + p.GetOrg() +} + func TestPublicEvent_GetRepo(tt *testing.T) { p := &PublicEvent{} p.GetRepo() @@ -19110,6 +19201,13 @@ func TestPullRequestReviewCommentEvent_GetInstallation(tt *testing.T) { p.GetInstallation() } +func TestPullRequestReviewCommentEvent_GetOrg(tt *testing.T) { + p := &PullRequestReviewCommentEvent{} + p.GetOrg() + p = nil + p.GetOrg() +} + func TestPullRequestReviewCommentEvent_GetPullRequest(tt *testing.T) { p := &PullRequestReviewCommentEvent{} p.GetPullRequest() @@ -19342,6 +19440,13 @@ func TestPullRequestReviewThreadEvent_GetInstallation(tt *testing.T) { p.GetInstallation() } +func TestPullRequestReviewThreadEvent_GetOrg(tt *testing.T) { + p := &PullRequestReviewThreadEvent{} + p.GetOrg() + p = nil + p.GetOrg() +} + func TestPullRequestReviewThreadEvent_GetPullRequest(tt *testing.T) { p := &PullRequestReviewThreadEvent{} p.GetPullRequest() @@ -20530,6 +20635,13 @@ func TestReleaseEvent_GetInstallation(tt *testing.T) { r.GetInstallation() } +func TestReleaseEvent_GetOrg(tt *testing.T) { + r := &ReleaseEvent{} + r.GetOrg() + r = nil + r.GetOrg() +} + func TestReleaseEvent_GetRelease(tt *testing.T) { r := &ReleaseEvent{} r.GetRelease() @@ -23011,6 +23123,13 @@ func TestRepositoryVulnerabilityAlertEvent_GetInstallation(tt *testing.T) { r.GetInstallation() } +func TestRepositoryVulnerabilityAlertEvent_GetOrg(tt *testing.T) { + r := &RepositoryVulnerabilityAlertEvent{} + r.GetOrg() + r = nil + r.GetOrg() +} + func TestRepositoryVulnerabilityAlertEvent_GetRepository(tt *testing.T) { r := &RepositoryVulnerabilityAlertEvent{} r.GetRepository() @@ -25165,6 +25284,13 @@ func TestStatusEvent_GetName(tt *testing.T) { s.GetName() } +func TestStatusEvent_GetOrg(tt *testing.T) { + s := &StatusEvent{} + s.GetOrg() + s = nil + s.GetOrg() +} + func TestStatusEvent_GetRepo(tt *testing.T) { s := &StatusEvent{} s.GetRepo() @@ -27925,6 +28051,13 @@ func TestWatchEvent_GetInstallation(tt *testing.T) { w.GetInstallation() } +func TestWatchEvent_GetOrg(tt *testing.T) { + w := &WatchEvent{} + w.GetOrg() + w = nil + w.GetOrg() +} + func TestWatchEvent_GetRepo(tt *testing.T) { w := &WatchEvent{} w.GetRepo() From 5ea85e29d8e8ea9c5573bd3994ad7aa75b128fc8 Mon Sep 17 00:00:00 2001 From: k0ral Date: Wed, 4 Oct 2023 21:35:21 +0200 Subject: [PATCH 327/751] Escape branch string before inserting it in URL (#2948) --- github/repos.go | 125 +- github/repos_test.go | 4400 +++++++++++++++++++++++------------------- 2 files changed, 2539 insertions(+), 1986 deletions(-) diff --git a/github/repos.go b/github/repos.go index e09971abea9..f2059926ec8 100644 --- a/github/repos.go +++ b/github/repos.go @@ -11,6 +11,7 @@ import ( "errors" "fmt" "net/http" + "net/url" "strings" ) @@ -1273,9 +1274,11 @@ func (s *RepositoriesService) ListBranches(ctx context.Context, owner string, re // GetBranch gets the specified branch for a repository. // +// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . +// // GitHub API docs: https://docs.github.com/en/rest/branches/branches#get-a-branch func (s *RepositoriesService) GetBranch(ctx context.Context, owner, repo, branch string, maxRedirects int) (*Branch, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/branches/%v", owner, repo, branch) + u := fmt.Sprintf("repos/%v/%v/branches/%v", owner, repo, url.PathEscape(branch)) resp, err := s.client.roundTripWithOptionalFollowRedirect(ctx, u, maxRedirects) if err != nil { @@ -1302,9 +1305,11 @@ type renameBranchRequest struct { // To rename a non-default branch: Users must have push access. GitHub Apps must have the `contents:write` repository permission. // To rename the default branch: Users must have admin or owner permissions. GitHub Apps must have the `administration:write` repository permission. // +// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . +// // GitHub API docs: https://docs.github.com/en/rest/branches/branches#rename-a-branch func (s *RepositoriesService) RenameBranch(ctx context.Context, owner, repo, branch, newName string) (*Branch, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/branches/%v/rename", owner, repo, branch) + u := fmt.Sprintf("repos/%v/%v/branches/%v/rename", owner, repo, url.PathEscape(branch)) r := &renameBranchRequest{NewName: newName} req, err := s.client.NewRequest("POST", u, r) if err != nil { @@ -1322,9 +1327,11 @@ func (s *RepositoriesService) RenameBranch(ctx context.Context, owner, repo, bra // GetBranchProtection gets the protection of a given branch. // +// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . +// // GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-branch-protection func (s *RepositoriesService) GetBranchProtection(ctx context.Context, owner, repo, branch string) (*Protection, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/branches/%v/protection", owner, repo, branch) + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err @@ -1347,9 +1354,11 @@ func (s *RepositoriesService) GetBranchProtection(ctx context.Context, owner, re // GetRequiredStatusChecks gets the required status checks for a given protected branch. // +// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . +// // GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-status-checks-protection func (s *RepositoriesService) GetRequiredStatusChecks(ctx context.Context, owner, repo, branch string) (*RequiredStatusChecks, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_status_checks", owner, repo, branch) + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_status_checks", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err @@ -1369,9 +1378,11 @@ func (s *RepositoriesService) GetRequiredStatusChecks(ctx context.Context, owner // ListRequiredStatusChecksContexts lists the required status checks contexts for a given protected branch. // +// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . +// // GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-all-status-check-contexts func (s *RepositoriesService) ListRequiredStatusChecksContexts(ctx context.Context, owner, repo, branch string) (contexts []string, resp *Response, err error) { - u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_status_checks/contexts", owner, repo, branch) + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_status_checks/contexts", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err @@ -1390,9 +1401,11 @@ func (s *RepositoriesService) ListRequiredStatusChecksContexts(ctx context.Conte // UpdateBranchProtection updates the protection of a given branch. // +// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . +// // GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#update-branch-protection func (s *RepositoriesService) UpdateBranchProtection(ctx context.Context, owner, repo, branch string, preq *ProtectionRequest) (*Protection, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/branches/%v/protection", owner, repo, branch) + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("PUT", u, preq) if err != nil { return nil, nil, err @@ -1412,9 +1425,11 @@ func (s *RepositoriesService) UpdateBranchProtection(ctx context.Context, owner, // RemoveBranchProtection removes the protection of a given branch. // +// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . +// // GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#delete-branch-protection func (s *RepositoriesService) RemoveBranchProtection(ctx context.Context, owner, repo, branch string) (*Response, error) { - u := fmt.Sprintf("repos/%v/%v/branches/%v/protection", owner, repo, branch) + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("DELETE", u, nil) if err != nil { return nil, err @@ -1425,9 +1440,11 @@ func (s *RepositoriesService) RemoveBranchProtection(ctx context.Context, owner, // GetSignaturesProtectedBranch gets required signatures of protected branch. // +// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . +// // GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-commit-signature-protection func (s *RepositoriesService) GetSignaturesProtectedBranch(ctx context.Context, owner, repo, branch string) (*SignaturesProtectedBranch, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_signatures", owner, repo, branch) + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_signatures", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err @@ -1448,9 +1465,11 @@ func (s *RepositoriesService) GetSignaturesProtectedBranch(ctx context.Context, // RequireSignaturesOnProtectedBranch makes signed commits required on a protected branch. // It requires admin access and branch protection to be enabled. // +// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . +// // GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#create-commit-signature-protection func (s *RepositoriesService) RequireSignaturesOnProtectedBranch(ctx context.Context, owner, repo, branch string) (*SignaturesProtectedBranch, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_signatures", owner, repo, branch) + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_signatures", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("POST", u, nil) if err != nil { return nil, nil, err @@ -1470,9 +1489,11 @@ func (s *RepositoriesService) RequireSignaturesOnProtectedBranch(ctx context.Con // OptionalSignaturesOnProtectedBranch removes required signed commits on a given branch. // +// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . +// // GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#delete-commit-signature-protection func (s *RepositoriesService) OptionalSignaturesOnProtectedBranch(ctx context.Context, owner, repo, branch string) (*Response, error) { - u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_signatures", owner, repo, branch) + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_signatures", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("DELETE", u, nil) if err != nil { return nil, err @@ -1486,9 +1507,11 @@ func (s *RepositoriesService) OptionalSignaturesOnProtectedBranch(ctx context.Co // UpdateRequiredStatusChecks updates the required status checks for a given protected branch. // +// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . +// // GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#update-status-check-protection func (s *RepositoriesService) UpdateRequiredStatusChecks(ctx context.Context, owner, repo, branch string, sreq *RequiredStatusChecksRequest) (*RequiredStatusChecks, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_status_checks", owner, repo, branch) + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_status_checks", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("PATCH", u, sreq) if err != nil { return nil, nil, err @@ -1505,9 +1528,11 @@ func (s *RepositoriesService) UpdateRequiredStatusChecks(ctx context.Context, ow // RemoveRequiredStatusChecks removes the required status checks for a given protected branch. // +// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . +// // GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#remove-status-check-protection func (s *RepositoriesService) RemoveRequiredStatusChecks(ctx context.Context, owner, repo, branch string) (*Response, error) { - u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_status_checks", owner, repo, branch) + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_status_checks", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("DELETE", u, nil) if err != nil { return nil, err @@ -1537,9 +1562,11 @@ func (s *RepositoriesService) License(ctx context.Context, owner, repo string) ( // GetPullRequestReviewEnforcement gets pull request review enforcement of a protected branch. // +// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . +// // GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-pull-request-review-protection func (s *RepositoriesService) GetPullRequestReviewEnforcement(ctx context.Context, owner, repo, branch string) (*PullRequestReviewsEnforcement, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_pull_request_reviews", owner, repo, branch) + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_pull_request_reviews", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err @@ -1560,9 +1587,11 @@ func (s *RepositoriesService) GetPullRequestReviewEnforcement(ctx context.Contex // UpdatePullRequestReviewEnforcement patches pull request review enforcement of a protected branch. // It requires admin access and branch protection to be enabled. // +// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . +// // GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#update-pull-request-review-protection func (s *RepositoriesService) UpdatePullRequestReviewEnforcement(ctx context.Context, owner, repo, branch string, patch *PullRequestReviewsEnforcementUpdate) (*PullRequestReviewsEnforcement, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_pull_request_reviews", owner, repo, branch) + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_pull_request_reviews", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("PATCH", u, patch) if err != nil { return nil, nil, err @@ -1583,9 +1612,11 @@ func (s *RepositoriesService) UpdatePullRequestReviewEnforcement(ctx context.Con // DisableDismissalRestrictions disables dismissal restrictions of a protected branch. // It requires admin access and branch protection to be enabled. // +// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . +// // GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#update-pull-request-review-protection func (s *RepositoriesService) DisableDismissalRestrictions(ctx context.Context, owner, repo, branch string) (*PullRequestReviewsEnforcement, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_pull_request_reviews", owner, repo, branch) + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_pull_request_reviews", owner, repo, url.PathEscape(branch)) data := new(struct { DismissalRestrictionsRequest `json:"dismissal_restrictions"` @@ -1610,9 +1641,11 @@ func (s *RepositoriesService) DisableDismissalRestrictions(ctx context.Context, // RemovePullRequestReviewEnforcement removes pull request enforcement of a protected branch. // +// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . +// // GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#delete-pull-request-review-protection func (s *RepositoriesService) RemovePullRequestReviewEnforcement(ctx context.Context, owner, repo, branch string) (*Response, error) { - u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_pull_request_reviews", owner, repo, branch) + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_pull_request_reviews", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("DELETE", u, nil) if err != nil { return nil, err @@ -1623,9 +1656,11 @@ func (s *RepositoriesService) RemovePullRequestReviewEnforcement(ctx context.Con // GetAdminEnforcement gets admin enforcement information of a protected branch. // +// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . +// // GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-admin-branch-protection func (s *RepositoriesService) GetAdminEnforcement(ctx context.Context, owner, repo, branch string) (*AdminEnforcement, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/enforce_admins", owner, repo, branch) + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/enforce_admins", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err @@ -1643,9 +1678,11 @@ func (s *RepositoriesService) GetAdminEnforcement(ctx context.Context, owner, re // AddAdminEnforcement adds admin enforcement to a protected branch. // It requires admin access and branch protection to be enabled. // +// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . +// // GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#set-admin-branch-protection func (s *RepositoriesService) AddAdminEnforcement(ctx context.Context, owner, repo, branch string) (*AdminEnforcement, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/enforce_admins", owner, repo, branch) + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/enforce_admins", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("POST", u, nil) if err != nil { return nil, nil, err @@ -1662,9 +1699,11 @@ func (s *RepositoriesService) AddAdminEnforcement(ctx context.Context, owner, re // RemoveAdminEnforcement removes admin enforcement from a protected branch. // +// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . +// // GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#delete-admin-branch-protection func (s *RepositoriesService) RemoveAdminEnforcement(ctx context.Context, owner, repo, branch string) (*Response, error) { - u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/enforce_admins", owner, repo, branch) + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/enforce_admins", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("DELETE", u, nil) if err != nil { return nil, err @@ -1731,11 +1770,13 @@ func (s *RepositoriesService) ReplaceAllTopics(ctx context.Context, owner, repo // ListApps lists the GitHub apps that have push access to a given protected branch. // It requires the GitHub apps to have `write` access to the `content` permission. // +// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . +// // GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch // // Deprecated: Please use ListAppRestrictions instead. func (s *RepositoriesService) ListApps(ctx context.Context, owner, repo, branch string) ([]*App, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, branch) + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err @@ -1766,9 +1807,11 @@ func (s *RepositoriesService) ListAppRestrictions(ctx context.Context, owner, re // // Note: The list of users, apps, and teams in total is limited to 100 items. // +// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . +// // GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#set-app-access-restrictions func (s *RepositoriesService) ReplaceAppRestrictions(ctx context.Context, owner, repo, branch string, apps []string) ([]*App, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, branch) + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("PUT", u, apps) if err != nil { return nil, nil, err @@ -1788,9 +1831,11 @@ func (s *RepositoriesService) ReplaceAppRestrictions(ctx context.Context, owner, // // Note: The list of users, apps, and teams in total is limited to 100 items. // +// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . +// // GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#add-app-access-restrictions func (s *RepositoriesService) AddAppRestrictions(ctx context.Context, owner, repo, branch string, apps []string) ([]*App, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, branch) + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("POST", u, apps) if err != nil { return nil, nil, err @@ -1810,9 +1855,11 @@ func (s *RepositoriesService) AddAppRestrictions(ctx context.Context, owner, rep // // Note: The list of users, apps, and teams in total is limited to 100 items. // +// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . +// // GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#remove-app-access-restrictions func (s *RepositoriesService) RemoveAppRestrictions(ctx context.Context, owner, repo, branch string, apps []string) ([]*App, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, branch) + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("DELETE", u, apps) if err != nil { return nil, nil, err @@ -1830,9 +1877,11 @@ func (s *RepositoriesService) RemoveAppRestrictions(ctx context.Context, owner, // ListTeamRestrictions lists the GitHub teams that have push access to a given protected branch. // It requires the GitHub teams to have `write` access to the `content` permission. // +// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . +// // GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-teams-with-access-to-the-protected-branch func (s *RepositoriesService) ListTeamRestrictions(ctx context.Context, owner, repo, branch string) ([]*Team, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/teams", owner, repo, branch) + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/teams", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err @@ -1853,9 +1902,11 @@ func (s *RepositoriesService) ListTeamRestrictions(ctx context.Context, owner, r // // Note: The list of users, apps, and teams in total is limited to 100 items. // +// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . +// // GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#set-team-access-restrictions func (s *RepositoriesService) ReplaceTeamRestrictions(ctx context.Context, owner, repo, branch string, teams []string) ([]*Team, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/teams", owner, repo, branch) + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/teams", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("PUT", u, teams) if err != nil { return nil, nil, err @@ -1875,9 +1926,11 @@ func (s *RepositoriesService) ReplaceTeamRestrictions(ctx context.Context, owner // // Note: The list of users, apps, and teams in total is limited to 100 items. // +// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . +// // GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#add-team-access-restrictions func (s *RepositoriesService) AddTeamRestrictions(ctx context.Context, owner, repo, branch string, teams []string) ([]*Team, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/teams", owner, repo, branch) + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/teams", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("POST", u, teams) if err != nil { return nil, nil, err @@ -1897,9 +1950,11 @@ func (s *RepositoriesService) AddTeamRestrictions(ctx context.Context, owner, re // // Note: The list of users, apps, and teams in total is limited to 100 items. // +// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . +// // GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#remove-team-access-restrictions func (s *RepositoriesService) RemoveTeamRestrictions(ctx context.Context, owner, repo, branch string, teams []string) ([]*Team, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/teams", owner, repo, branch) + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/teams", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("DELETE", u, teams) if err != nil { return nil, nil, err @@ -1917,9 +1972,11 @@ func (s *RepositoriesService) RemoveTeamRestrictions(ctx context.Context, owner, // ListUserRestrictions lists the GitHub users that have push access to a given protected branch. // It requires the GitHub users to have `write` access to the `content` permission. // +// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . +// // GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-users-with-access-to-the-protected-branch func (s *RepositoriesService) ListUserRestrictions(ctx context.Context, owner, repo, branch string) ([]*User, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/users", owner, repo, branch) + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/users", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err @@ -1940,9 +1997,11 @@ func (s *RepositoriesService) ListUserRestrictions(ctx context.Context, owner, r // // Note: The list of users, apps, and teams in total is limited to 100 items. // +// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . +// // GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#set-team-access-restrictions func (s *RepositoriesService) ReplaceUserRestrictions(ctx context.Context, owner, repo, branch string, users []string) ([]*User, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/users", owner, repo, branch) + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/users", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("PUT", u, users) if err != nil { return nil, nil, err @@ -1962,9 +2021,11 @@ func (s *RepositoriesService) ReplaceUserRestrictions(ctx context.Context, owner // // Note: The list of users, apps, and teams in total is limited to 100 items. // +// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . +// // GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#add-team-access-restrictions func (s *RepositoriesService) AddUserRestrictions(ctx context.Context, owner, repo, branch string, users []string) ([]*User, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/users", owner, repo, branch) + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/users", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("POST", u, users) if err != nil { return nil, nil, err @@ -1984,9 +2045,11 @@ func (s *RepositoriesService) AddUserRestrictions(ctx context.Context, owner, re // // Note: The list of users, apps, and teams in total is limited to 100 items. // +// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . +// // GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#remove-team-access-restrictions func (s *RepositoriesService) RemoveUserRestrictions(ctx context.Context, owner, repo, branch string, users []string) ([]*User, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/users", owner, repo, branch) + u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/users", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("DELETE", u, users) if err != nil { return nil, nil, err diff --git a/github/repos_test.go b/github/repos_test.go index 6aba962a91f..7486e488fe6 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -919,51 +919,73 @@ func TestRepositoriesService_GetBranch(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - mux.HandleFunc("/repos/o/r/branches/b", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - fmt.Fprint(w, `{"name":"n", "commit":{"sha":"s","commit":{"message":"m"}}, "protected":true}`) - }) + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%"}, + } + + for _, test := range tests { + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"name":"n", "commit":{"sha":"s","commit":{"message":"m"}}, "protected":true}`) + }) - ctx := context.Background() - branch, _, err := client.Repositories.GetBranch(ctx, "o", "r", "b", 0) - if err != nil { - t.Errorf("Repositories.GetBranch returned error: %v", err) - } + ctx := context.Background() + branch, _, err := client.Repositories.GetBranch(ctx, "o", "r", test.branch, 0) + if err != nil { + t.Errorf("Repositories.GetBranch returned error: %v", err) + } - want := &Branch{ - Name: String("n"), - Commit: &RepositoryCommit{ - SHA: String("s"), - Commit: &Commit{ - Message: String("m"), + want := &Branch{ + Name: String("n"), + Commit: &RepositoryCommit{ + SHA: String("s"), + Commit: &Commit{ + Message: String("m"), + }, }, - }, - Protected: Bool(true), - } + Protected: Bool(true), + } - if !cmp.Equal(branch, want) { - t.Errorf("Repositories.GetBranch returned %+v, want %+v", branch, want) - } + if !cmp.Equal(branch, want) { + t.Errorf("Repositories.GetBranch returned %+v, want %+v", branch, want) + } - const methodName = "GetBranch" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.GetBranch(ctx, "\n", "\n", "\n", 0) - return err - }) + const methodName = "GetBranch" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.GetBranch(ctx, "\n", "\n", "\n", 0) + return err + }) + } } func TestRepositoriesService_GetBranch_BadJSONResponse(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - mux.HandleFunc("/repos/o/r/branches/b", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - fmt.Fprint(w, `{"name":"n", "commit":{"sha":...truncated`) - }) - - ctx := context.Background() - if _, _, err := client.Repositories.GetBranch(ctx, "o", "r", "b", 0); err == nil { - t.Error("Repositories.GetBranch returned no error; wanted JSON error") + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"name":"n", "commit":{"sha":...truncated`) + }) + + ctx := context.Background() + if _, _, err := client.Repositories.GetBranch(ctx, "o", "r", test.branch, 0); err == nil { + t.Error("Repositories.GetBranch returned no error; wanted JSON error") + } + }) } } @@ -1005,492 +1027,1013 @@ func TestRepositoriesService_GetBranch_StatusMovedPermanently_followRedirects(t } func TestRepositoriesService_GetBranch_notFound(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat-branch-50%"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + http.Error(w, "branch not found", http.StatusNotFound) + }) + ctx := context.Background() + _, resp, err := client.Repositories.GetBranch(ctx, "o", "r", test.branch, 1) + if err == nil { + t.Error("Repositories.GetBranch returned error: nil") + } + if resp.StatusCode != http.StatusNotFound { + t.Errorf("Repositories.GetBranch returned status: %d, want %d", resp.StatusCode, http.StatusNotFound) + } - mux.HandleFunc("/repos/o/r/branches/b", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - http.Error(w, "branch not found", http.StatusNotFound) - }) - ctx := context.Background() - _, resp, err := client.Repositories.GetBranch(ctx, "o", "r", "b", 1) - if err == nil { - t.Error("Repositories.GetBranch returned error: nil") + // Add custom round tripper + client.client.Transport = roundTripperFunc(func(r *http.Request) (*http.Response, error) { + return nil, errors.New("failed to get branch") + }) + + const methodName = "GetBranch" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.GetBranch(ctx, "\n", "\n", "\n", 1) + return err + }) + }) } - if resp.StatusCode != http.StatusNotFound { - t.Errorf("Repositories.GetBranch returned status: %d, want %d", resp.StatusCode, http.StatusNotFound) +} + +func TestRepositoriesService_RenameBranch(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/rename"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/rename"}, } - // Add custom round tripper - client.client.Transport = roundTripperFunc(func(r *http.Request) (*http.Response, error) { - return nil, errors.New("failed to get branch") - }) + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() - const methodName = "GetBranch" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.GetBranch(ctx, "\n", "\n", "\n", 1) - return err - }) -} + renameBranchReq := "nn" -func TestRepositoriesService_RenameBranch(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + v := new(renameBranchRequest) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) - renameBranchReq := "nn" + testMethod(t, r, "POST") + want := &renameBranchRequest{NewName: renameBranchReq} + if !cmp.Equal(v, want) { + t.Errorf("Request body = %+v, want %+v", v, want) + } - mux.HandleFunc("/repos/o/r/branches/b/rename", func(w http.ResponseWriter, r *http.Request) { - v := new(renameBranchRequest) - assertNilError(t, json.NewDecoder(r.Body).Decode(v)) + fmt.Fprint(w, `{"protected":true,"name":"nn"}`) + }) - testMethod(t, r, "POST") - want := &renameBranchRequest{NewName: "nn"} - if !cmp.Equal(v, want) { - t.Errorf("Request body = %+v, want %+v", v, want) - } + ctx := context.Background() + got, _, err := client.Repositories.RenameBranch(ctx, "o", "r", test.branch, renameBranchReq) + if err != nil { + t.Errorf("Repositories.RenameBranch returned error: %v", err) + } - fmt.Fprint(w, `{"protected":true,"name":"nn"}`) - }) + want := &Branch{Name: String("nn"), Protected: Bool(true)} + if !cmp.Equal(got, want) { + t.Errorf("Repositories.RenameBranch returned %+v, want %+v", got, want) + } - ctx := context.Background() - got, _, err := client.Repositories.RenameBranch(ctx, "o", "r", "b", renameBranchReq) - if err != nil { - t.Errorf("Repositories.RenameBranch returned error: %v", err) - } + const methodName = "RenameBranch" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.RenameBranch(ctx, "\n", "\n", "\n", renameBranchReq) + return err + }) - want := &Branch{Name: String("nn"), Protected: Bool(true)} - if !cmp.Equal(got, want) { - t.Errorf("Repositories.RenameBranch returned %+v, want %+v", got, want) + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.RenameBranch(ctx, "o", "r", test.branch, renameBranchReq) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) + }) } +} - const methodName = "RenameBranch" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.RenameBranch(ctx, "\n", "\n", "\n", renameBranchReq) - return err - }) +func TestRepositoriesService_GetBranchProtection(t *testing.T) { + tests := []struct { + branch string + urlPath string + enforceAdminsURLPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection", enforceAdminsURLPath: "/repos/o/r/branches/b/protection/enforce_admins"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection", enforceAdminsURLPath: "/repos/o/r/branches/feat/branch-50%/protection/enforce_admins"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + // TODO: remove custom Accept header when this API fully launches + testHeader(t, r, "Accept", mediaTypeRequiredApprovingReviewsPreview) + fmt.Fprintf(w, `{ + "required_status_checks":{ + "strict":true, + "contexts":["continuous-integration"], + "checks": [ + { + "context": "continuous-integration", + "app_id": null + } + ] + }, + "required_pull_request_reviews":{ + "dismissal_restrictions":{ + "users":[{ + "id":3, + "login":"u" + }], + "teams":[{ + "id":4, + "slug":"t" + }], + "apps":[{ + "id":5, + "slug":"a" + }] + }, + "dismiss_stale_reviews":true, + "require_code_owner_reviews":true, + "require_last_push_approval":false, + "required_approving_review_count":1 + }, + "enforce_admins":{ + "url":"%s", + "enabled":true + }, + "restrictions":{ + "users":[{"id":1,"login":"u"}], + "teams":[{"id":2,"slug":"t"}], + "apps":[{"id":3,"slug":"a"}] + }, + "required_conversation_resolution": { + "enabled": true + }, + "block_creations": { + "enabled": false + }, + "lock_branch": { + "enabled": false + }, + "allow_fork_syncing": { + "enabled": false + } + }`, test.enforceAdminsURLPath) + }) + + ctx := context.Background() + protection, _, err := client.Repositories.GetBranchProtection(ctx, "o", "r", test.branch) + if err != nil { + t.Errorf("Repositories.GetBranchProtection returned error: %v", err) + } - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.RenameBranch(ctx, "o", "r", "b", renameBranchReq) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) + want := &Protection{ + RequiredStatusChecks: &RequiredStatusChecks{ + Strict: true, + Contexts: []string{"continuous-integration"}, + Checks: []*RequiredStatusCheck{ + { + Context: "continuous-integration", + }, + }, + }, + RequiredPullRequestReviews: &PullRequestReviewsEnforcement{ + DismissStaleReviews: true, + DismissalRestrictions: &DismissalRestrictions{ + Users: []*User{ + {Login: String("u"), ID: Int64(3)}, + }, + Teams: []*Team{ + {Slug: String("t"), ID: Int64(4)}, + }, + Apps: []*App{ + {Slug: String("a"), ID: Int64(5)}, + }, + }, + RequireCodeOwnerReviews: true, + RequiredApprovingReviewCount: 1, + RequireLastPushApproval: false, + }, + EnforceAdmins: &AdminEnforcement{ + URL: String(test.enforceAdminsURLPath), + Enabled: true, + }, + Restrictions: &BranchRestrictions{ + Users: []*User{ + {Login: String("u"), ID: Int64(1)}, + }, + Teams: []*Team{ + {Slug: String("t"), ID: Int64(2)}, + }, + Apps: []*App{ + {Slug: String("a"), ID: Int64(3)}, + }, + }, + RequiredConversationResolution: &RequiredConversationResolution{ + Enabled: true, + }, + BlockCreations: &BlockCreations{ + Enabled: Bool(false), + }, + LockBranch: &LockBranch{ + Enabled: Bool(false), + }, + AllowForkSyncing: &AllowForkSyncing{ + Enabled: Bool(false), + }, + } + if !cmp.Equal(protection, want) { + t.Errorf("Repositories.GetBranchProtection returned %+v, want %+v", protection, want) + } + + const methodName = "GetBranchProtection" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.GetBranchProtection(ctx, "\n", "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.GetBranchProtection(ctx, "o", "r", test.branch) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) + }) + } } -func TestRepositoriesService_GetBranchProtection(t *testing.T) { +func TestRepositoriesService_GetBranchProtection_noDismissalRestrictions(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - mux.HandleFunc("/repos/o/r/branches/b/protection", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - // TODO: remove custom Accept header when this API fully launches - testHeader(t, r, "Accept", mediaTypeRequiredApprovingReviewsPreview) - fmt.Fprintf(w, `{ - "required_status_checks":{ - "strict":true, - "contexts":["continuous-integration"], - "checks": [ - { - "context": "continuous-integration", - "app_id": null + tests := []struct { + branch string + urlPath string + enforceAdminsURLPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection", enforceAdminsURLPath: "/repos/o/r/branches/b/protection/enforce_admins"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection", enforceAdminsURLPath: "/repos/o/r/branches/feat/branch-50%/protection/enforce_admins"}, + } + + for _, test := range tests { + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + // TODO: remove custom Accept header when this API fully launches + testHeader(t, r, "Accept", mediaTypeRequiredApprovingReviewsPreview) + fmt.Fprintf(w, `{ + "required_status_checks":{ + "strict":true, + "contexts":["continuous-integration"], + "checks": [ + { + "context": "continuous-integration", + "app_id": null + } + ] + }, + "required_pull_request_reviews":{ + "dismiss_stale_reviews":true, + "require_code_owner_reviews":true, + "required_approving_review_count":1 + }, + "enforce_admins":{ + "url":"%s", + "enabled":true + }, + "restrictions":{ + "users":[{"id":1,"login":"u"}], + "teams":[{"id":2,"slug":"t"}] } - ] + }`, test.enforceAdminsURLPath) + }) + + ctx := context.Background() + protection, _, err := client.Repositories.GetBranchProtection(ctx, "o", "r", test.branch) + if err != nil { + t.Errorf("Repositories.GetBranchProtection returned error: %v", err) + } + + want := &Protection{ + RequiredStatusChecks: &RequiredStatusChecks{ + Strict: true, + Contexts: []string{"continuous-integration"}, + Checks: []*RequiredStatusCheck{ + { + Context: "continuous-integration", + }, }, - "required_pull_request_reviews":{ - "dismissal_restrictions":{ - "users":[{ - "id":3, - "login":"u" - }], - "teams":[{ - "id":4, - "slug":"t" - }], - "apps":[{ - "id":5, - "slug":"a" - }] + }, + RequiredPullRequestReviews: &PullRequestReviewsEnforcement{ + DismissStaleReviews: true, + DismissalRestrictions: nil, + RequireCodeOwnerReviews: true, + RequiredApprovingReviewCount: 1, + }, + EnforceAdmins: &AdminEnforcement{ + URL: String(test.enforceAdminsURLPath), + Enabled: true, + }, + Restrictions: &BranchRestrictions{ + Users: []*User{ + {Login: String("u"), ID: Int64(1)}, + }, + Teams: []*Team{ + {Slug: String("t"), ID: Int64(2)}, + }, + }, + } + if !cmp.Equal(protection, want) { + t.Errorf("Repositories.GetBranchProtection returned %+v, want %+v", protection, want) + } + } +} + +func TestRepositoriesService_GetBranchProtection_branchNotProtected(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + + w.WriteHeader(http.StatusBadRequest) + fmt.Fprintf(w, `{ + "message": %q, + "documentation_url": "https://docs.github.com/rest/repos#get-branch-protection" + }`, githubBranchNotProtected) + }) + + ctx := context.Background() + protection, _, err := client.Repositories.GetBranchProtection(ctx, "o", "r", test.branch) + + if protection != nil { + t.Errorf("Repositories.GetBranchProtection returned non-nil protection data") + } + + if err != ErrBranchNotProtected { + t.Errorf("Repositories.GetBranchProtection returned an invalid error: %v", err) + } + }) + } +} + +func TestRepositoriesService_UpdateBranchProtection_Contexts(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + input := &ProtectionRequest{ + RequiredStatusChecks: &RequiredStatusChecks{ + Strict: true, + Contexts: []string{"continuous-integration"}, + }, + RequiredPullRequestReviews: &PullRequestReviewsEnforcementRequest{ + DismissStaleReviews: true, + DismissalRestrictionsRequest: &DismissalRestrictionsRequest{ + Users: &[]string{"uu"}, + Teams: &[]string{"tt"}, + Apps: &[]string{"aa"}, }, - "dismiss_stale_reviews":true, - "require_code_owner_reviews":true, - "require_last_push_approval":false, - "required_approving_review_count":1 + BypassPullRequestAllowancesRequest: &BypassPullRequestAllowancesRequest{ + Users: []string{"uuu"}, + Teams: []string{"ttt"}, + Apps: []string{"aaa"}, + }, + }, + Restrictions: &BranchRestrictionsRequest{ + Users: []string{"u"}, + Teams: []string{"t"}, + Apps: []string{"a"}, + }, + BlockCreations: Bool(true), + LockBranch: Bool(true), + AllowForkSyncing: Bool(true), + } + + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + v := new(ProtectionRequest) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) + + testMethod(t, r, "PUT") + if !cmp.Equal(v, input) { + t.Errorf("Request body = %+v, want %+v", v, input) + } + + // TODO: remove custom Accept header when this API fully launches + testHeader(t, r, "Accept", mediaTypeRequiredApprovingReviewsPreview) + fmt.Fprintf(w, `{ + "required_status_checks":{ + "strict":true, + "contexts":["continuous-integration"], + "checks": [ + { + "context": "continuous-integration", + "app_id": null + } + ] }, - "enforce_admins":{ - "url":"/repos/o/r/branches/b/protection/enforce_admins", - "enabled":true + "required_pull_request_reviews":{ + "dismissal_restrictions":{ + "users":[{ + "id":3, + "login":"uu" + }], + "teams":[{ + "id":4, + "slug":"tt" + }], + "apps":[{ + "id":5, + "slug":"aa" + }] + }, + "dismiss_stale_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"}], "teams":[{"id":2,"slug":"t"}], "apps":[{"id":3,"slug":"a"}] }, - "required_conversation_resolution": { - "enabled": true - }, "block_creations": { - "enabled": false + "enabled": true }, "lock_branch": { - "enabled": false + "enabled": true }, "allow_fork_syncing": { - "enabled": false + "enabled": true } }`) - }) + }) - ctx := context.Background() - protection, _, err := client.Repositories.GetBranchProtection(ctx, "o", "r", "b") - if err != nil { - t.Errorf("Repositories.GetBranchProtection returned error: %v", err) - } + ctx := context.Background() + protection, _, err := client.Repositories.UpdateBranchProtection(ctx, "o", "r", test.branch, input) + if err != nil { + t.Errorf("Repositories.UpdateBranchProtection returned error: %v", err) + } - want := &Protection{ - RequiredStatusChecks: &RequiredStatusChecks{ - Strict: true, - Contexts: []string{"continuous-integration"}, - Checks: []*RequiredStatusCheck{ - { - Context: "continuous-integration", + want := &Protection{ + RequiredStatusChecks: &RequiredStatusChecks{ + Strict: true, + Contexts: []string{"continuous-integration"}, + Checks: []*RequiredStatusCheck{ + { + Context: "continuous-integration", + }, + }, }, - }, - }, - RequiredPullRequestReviews: &PullRequestReviewsEnforcement{ - DismissStaleReviews: true, - DismissalRestrictions: &DismissalRestrictions{ - Users: []*User{ - {Login: String("u"), ID: Int64(3)}, + RequiredPullRequestReviews: &PullRequestReviewsEnforcement{ + DismissStaleReviews: true, + DismissalRestrictions: &DismissalRestrictions{ + Users: []*User{ + {Login: String("uu"), ID: Int64(3)}, + }, + Teams: []*Team{ + {Slug: String("tt"), ID: Int64(4)}, + }, + Apps: []*App{ + {Slug: String("aa"), ID: Int64(5)}, + }, + }, + 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)}, + }, + }, }, - Teams: []*Team{ - {Slug: String("t"), ID: Int64(4)}, + Restrictions: &BranchRestrictions{ + Users: []*User{ + {Login: String("u"), ID: Int64(1)}, + }, + Teams: []*Team{ + {Slug: String("t"), ID: Int64(2)}, + }, + Apps: []*App{ + {Slug: String("a"), ID: Int64(3)}, + }, }, - Apps: []*App{ - {Slug: String("a"), ID: Int64(5)}, + BlockCreations: &BlockCreations{ + Enabled: Bool(true), }, - }, - RequireCodeOwnerReviews: true, - RequiredApprovingReviewCount: 1, - RequireLastPushApproval: false, - }, - EnforceAdmins: &AdminEnforcement{ - URL: String("/repos/o/r/branches/b/protection/enforce_admins"), - Enabled: true, - }, - Restrictions: &BranchRestrictions{ - Users: []*User{ - {Login: String("u"), ID: Int64(1)}, - }, - Teams: []*Team{ - {Slug: String("t"), ID: Int64(2)}, - }, - Apps: []*App{ - {Slug: String("a"), ID: Int64(3)}, - }, - }, - RequiredConversationResolution: &RequiredConversationResolution{ - Enabled: true, - }, - BlockCreations: &BlockCreations{ - Enabled: Bool(false), - }, - LockBranch: &LockBranch{ - Enabled: Bool(false), - }, - AllowForkSyncing: &AllowForkSyncing{ - Enabled: Bool(false), - }, - } - if !cmp.Equal(protection, want) { - t.Errorf("Repositories.GetBranchProtection returned %+v, want %+v", protection, want) - } + LockBranch: &LockBranch{ + Enabled: Bool(true), + }, + AllowForkSyncing: &AllowForkSyncing{ + Enabled: Bool(true), + }, + } + if !cmp.Equal(protection, want) { + t.Errorf("Repositories.UpdateBranchProtection returned %+v, want %+v", protection, want) + } - const methodName = "GetBranchProtection" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.GetBranchProtection(ctx, "\n", "\n", "\n") - return err - }) + const methodName = "UpdateBranchProtection" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.UpdateBranchProtection(ctx, "\n", "\n", "\n", input) + return err + }) - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.GetBranchProtection(ctx, "o", "r", "b") - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.UpdateBranchProtection(ctx, "o", "r", test.branch, input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) + }) + } } -func TestRepositoriesService_GetBranchProtection_noDismissalRestrictions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - mux.HandleFunc("/repos/o/r/branches/b/protection", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - // TODO: remove custom Accept header when this API fully launches - testHeader(t, r, "Accept", mediaTypeRequiredApprovingReviewsPreview) - fmt.Fprintf(w, `{ - "required_status_checks":{ - "strict":true, - "contexts":["continuous-integration"], - "checks": [ +func TestRepositoriesService_UpdateBranchProtection_Checks(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + input := &ProtectionRequest{ + RequiredStatusChecks: &RequiredStatusChecks{ + Strict: true, + Checks: []*RequiredStatusCheck{ { - "context": "continuous-integration", - "app_id": null - } - ] + Context: "continuous-integration", + }, + }, }, - "required_pull_request_reviews":{ - "dismiss_stale_reviews":true, - "require_code_owner_reviews":true, - "required_approving_review_count":1 + RequiredPullRequestReviews: &PullRequestReviewsEnforcementRequest{ + DismissStaleReviews: true, + DismissalRestrictionsRequest: &DismissalRestrictionsRequest{ + Users: &[]string{"uu"}, + Teams: &[]string{"tt"}, + Apps: &[]string{"aa"}, + }, + BypassPullRequestAllowancesRequest: &BypassPullRequestAllowancesRequest{ + Users: []string{"uuu"}, + Teams: []string{"ttt"}, + Apps: []string{"aaa"}, + }, + }, + Restrictions: &BranchRestrictionsRequest{ + Users: []string{"u"}, + Teams: []string{"t"}, + Apps: []string{"a"}, + }, + } + + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + v := new(ProtectionRequest) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) + + testMethod(t, r, "PUT") + if !cmp.Equal(v, input) { + t.Errorf("Request body = %+v, want %+v", v, input) + } + + // TODO: remove custom Accept header when this API fully launches + testHeader(t, r, "Accept", mediaTypeRequiredApprovingReviewsPreview) + fmt.Fprintf(w, `{ + "required_status_checks":{ + "strict":true, + "contexts":["continuous-integration"], + "checks": [ + { + "context": "continuous-integration", + "app_id": null + } + ] }, - "enforce_admins":{ - "url":"/repos/o/r/branches/b/protection/enforce_admins", - "enabled":true + "required_pull_request_reviews":{ + "dismissal_restrictions":{ + "users":[{ + "id":3, + "login":"uu" + }], + "teams":[{ + "id":4, + "slug":"tt" + }], + "apps":[{ + "id":5, + "slug":"aa" + }] + }, + "dismiss_stale_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"}], - "teams":[{"id":2,"slug":"t"}] + "teams":[{"id":2,"slug":"t"}], + "apps":[{"id":3,"slug":"a"}] } }`) - }) + }) - ctx := context.Background() - protection, _, err := client.Repositories.GetBranchProtection(ctx, "o", "r", "b") - if err != nil { - t.Errorf("Repositories.GetBranchProtection returned error: %v", err) - } + ctx := context.Background() + protection, _, err := client.Repositories.UpdateBranchProtection(ctx, "o", "r", test.branch, input) + if err != nil { + t.Errorf("Repositories.UpdateBranchProtection returned error: %v", err) + } - want := &Protection{ - RequiredStatusChecks: &RequiredStatusChecks{ - Strict: true, - Contexts: []string{"continuous-integration"}, - Checks: []*RequiredStatusCheck{ - { - Context: "continuous-integration", + want := &Protection{ + RequiredStatusChecks: &RequiredStatusChecks{ + Strict: true, + Contexts: []string{"continuous-integration"}, + Checks: []*RequiredStatusCheck{ + { + Context: "continuous-integration", + }, + }, }, - }, - }, - RequiredPullRequestReviews: &PullRequestReviewsEnforcement{ - DismissStaleReviews: true, - DismissalRestrictions: nil, - RequireCodeOwnerReviews: true, - RequiredApprovingReviewCount: 1, - }, - EnforceAdmins: &AdminEnforcement{ - URL: String("/repos/o/r/branches/b/protection/enforce_admins"), - Enabled: true, - }, - Restrictions: &BranchRestrictions{ - Users: []*User{ - {Login: String("u"), ID: Int64(1)}, - }, - Teams: []*Team{ - {Slug: String("t"), ID: Int64(2)}, - }, - }, - } - if !cmp.Equal(protection, want) { - t.Errorf("Repositories.GetBranchProtection returned %+v, want %+v", protection, want) + RequiredPullRequestReviews: &PullRequestReviewsEnforcement{ + DismissStaleReviews: true, + DismissalRestrictions: &DismissalRestrictions{ + Users: []*User{ + {Login: String("uu"), ID: Int64(3)}, + }, + Teams: []*Team{ + {Slug: String("tt"), ID: Int64(4)}, + }, + Apps: []*App{ + {Slug: String("aa"), ID: Int64(5)}, + }, + }, + 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{ + {Login: String("u"), ID: Int64(1)}, + }, + Teams: []*Team{ + {Slug: String("t"), ID: Int64(2)}, + }, + Apps: []*App{ + {Slug: String("a"), ID: Int64(3)}, + }, + }, + } + if !cmp.Equal(protection, want) { + t.Errorf("Repositories.UpdateBranchProtection returned %+v, want %+v", protection, want) + } + }) } } -func TestRepositoriesService_GetBranchProtection_branchNotProtected(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() +func TestRepositoriesService_UpdateBranchProtection_StrictNoChecks(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + input := &ProtectionRequest{ + RequiredStatusChecks: &RequiredStatusChecks{ + Strict: true, + Checks: []*RequiredStatusCheck{}, + }, + RequiredPullRequestReviews: &PullRequestReviewsEnforcementRequest{ + DismissStaleReviews: true, + DismissalRestrictionsRequest: &DismissalRestrictionsRequest{ + Users: &[]string{"uu"}, + Teams: &[]string{"tt"}, + Apps: &[]string{"aa"}, + }, + BypassPullRequestAllowancesRequest: &BypassPullRequestAllowancesRequest{ + Users: []string{"uuu"}, + Teams: []string{"ttt"}, + Apps: []string{"aaa"}, + }, + }, + Restrictions: &BranchRestrictionsRequest{ + Users: []string{"u"}, + Teams: []string{"t"}, + Apps: []string{"a"}, + }, + } - mux.HandleFunc("/repos/o/r/branches/b/protection", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + v := new(ProtectionRequest) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) - w.WriteHeader(http.StatusBadRequest) - fmt.Fprintf(w, `{ - "message": %q, - "documentation_url": "https://docs.github.com/rest/repos#get-branch-protection" - }`, githubBranchNotProtected) - }) + testMethod(t, r, "PUT") + if !cmp.Equal(v, input) { + t.Errorf("Request body = %+v, want %+v", v, input) + } - ctx := context.Background() - protection, _, err := client.Repositories.GetBranchProtection(ctx, "o", "r", "b") + // TODO: remove custom Accept header when this API fully launches + testHeader(t, r, "Accept", mediaTypeRequiredApprovingReviewsPreview) + fmt.Fprintf(w, `{ + "required_status_checks":{ + "strict":true, + "contexts":[], + "checks": [] + }, + "required_pull_request_reviews":{ + "dismissal_restrictions":{ + "users":[{ + "id":3, + "login":"uu" + }], + "teams":[{ + "id":4, + "slug":"tt" + }], + "apps":[{ + "id":5, + "slug":"aa" + }] + }, + "dismiss_stale_reviews":true, + "require_code_owner_reviews":true, + "require_last_push_approval":false, + "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"}], + "teams":[{"id":2,"slug":"t"}], + "apps":[{"id":3,"slug":"a"}] + } + }`) + }) - if protection != nil { - t.Errorf("Repositories.GetBranchProtection returned non-nil protection data") - } + ctx := context.Background() + protection, _, err := client.Repositories.UpdateBranchProtection(ctx, "o", "r", test.branch, input) + if err != nil { + t.Errorf("Repositories.UpdateBranchProtection returned error: %v", err) + } - if err != ErrBranchNotProtected { - t.Errorf("Repositories.GetBranchProtection returned an invalid error: %v", err) + want := &Protection{ + RequiredStatusChecks: &RequiredStatusChecks{ + Strict: true, + Contexts: []string{}, + Checks: []*RequiredStatusCheck{}, + }, + RequiredPullRequestReviews: &PullRequestReviewsEnforcement{ + DismissStaleReviews: true, + DismissalRestrictions: &DismissalRestrictions{ + Users: []*User{ + {Login: String("uu"), ID: Int64(3)}, + }, + Teams: []*Team{ + {Slug: String("tt"), ID: Int64(4)}, + }, + Apps: []*App{ + {Slug: String("aa"), ID: Int64(5)}, + }, + }, + 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{ + {Login: String("u"), ID: Int64(1)}, + }, + Teams: []*Team{ + {Slug: String("t"), ID: Int64(2)}, + }, + Apps: []*App{ + {Slug: String("a"), ID: Int64(3)}, + }, + }, + } + if !cmp.Equal(protection, want) { + t.Errorf("Repositories.UpdateBranchProtection returned %+v, want %+v", protection, want) + } + }) } } -func TestRepositoriesService_UpdateBranchProtection_Contexts(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - input := &ProtectionRequest{ - RequiredStatusChecks: &RequiredStatusChecks{ - Strict: true, - Contexts: []string{"continuous-integration"}, - }, - RequiredPullRequestReviews: &PullRequestReviewsEnforcementRequest{ - DismissStaleReviews: true, - DismissalRestrictionsRequest: &DismissalRestrictionsRequest{ - Users: &[]string{"uu"}, - Teams: &[]string{"tt"}, - Apps: &[]string{"aa"}, - }, - BypassPullRequestAllowancesRequest: &BypassPullRequestAllowancesRequest{ - Users: []string{"uuu"}, - Teams: []string{"ttt"}, - Apps: []string{"aaa"}, - }, - }, - Restrictions: &BranchRestrictionsRequest{ - Users: []string{"u"}, - Teams: []string{"t"}, - Apps: []string{"a"}, - }, - BlockCreations: Bool(true), - LockBranch: Bool(true), - AllowForkSyncing: Bool(true), - } +func TestRepositoriesService_UpdateBranchProtection_RequireLastPushApproval(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + input := &ProtectionRequest{ + RequiredPullRequestReviews: &PullRequestReviewsEnforcementRequest{ + RequireLastPushApproval: Bool(true), + }, + } - mux.HandleFunc("/repos/o/r/branches/b/protection", func(w http.ResponseWriter, r *http.Request) { - v := new(ProtectionRequest) - assertNilError(t, json.NewDecoder(r.Body).Decode(v)) + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + v := new(ProtectionRequest) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) - testMethod(t, r, "PUT") - if !cmp.Equal(v, input) { - t.Errorf("Request body = %+v, want %+v", v, input) - } + testMethod(t, r, "PUT") + if !cmp.Equal(v, input) { + t.Errorf("Request body = %+v, want %+v", v, input) + } - // TODO: remove custom Accept header when this API fully launches - testHeader(t, r, "Accept", mediaTypeRequiredApprovingReviewsPreview) - fmt.Fprintf(w, `{ - "required_status_checks":{ - "strict":true, - "contexts":["continuous-integration"], - "checks": [ - { - "context": "continuous-integration", - "app_id": null + fmt.Fprintf(w, `{ + "required_pull_request_reviews":{ + "require_last_push_approval":true } - ] - }, - "required_pull_request_reviews":{ - "dismissal_restrictions":{ - "users":[{ - "id":3, - "login":"uu" - }], - "teams":[{ - "id":4, - "slug":"tt" - }], - "apps":[{ - "id":5, - "slug":"aa" - }] + }`) + }) + + ctx := context.Background() + protection, _, err := client.Repositories.UpdateBranchProtection(ctx, "o", "r", test.branch, input) + if err != nil { + t.Errorf("Repositories.UpdateBranchProtection returned error: %v", err) + } + + want := &Protection{ + RequiredPullRequestReviews: &PullRequestReviewsEnforcement{ + RequireLastPushApproval: true, }, - "dismiss_stale_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"}], - "teams":[{"id":2,"slug":"t"}], - "apps":[{"id":3,"slug":"a"}] - }, - "block_creations": { - "enabled": true - }, - "lock_branch": { - "enabled": true - }, - "allow_fork_syncing": { - "enabled": true } - }`) + if !cmp.Equal(protection, want) { + t.Errorf("Repositories.UpdateBranchProtection returned %+v, want %+v", protection, want) + } + }) + } +} + +func TestRepositoriesService_RemoveBranchProtection(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + w.WriteHeader(http.StatusNoContent) + }) + + ctx := context.Background() + _, err := client.Repositories.RemoveBranchProtection(ctx, "o", "r", test.branch) + if err != nil { + t.Errorf("Repositories.RemoveBranchProtection returned error: %v", err) + } + + const methodName = "RemoveBranchProtection" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Repositories.RemoveBranchProtection(ctx, "\n", "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Repositories.RemoveBranchProtection(ctx, "o", "r", test.branch) + }) + }) + } +} + +func TestRepositoriesService_ListLanguages_invalidOwner(t *testing.T) { + client, _, _, teardown := setup() + defer teardown() + + ctx := context.Background() + _, _, err := client.Repositories.ListLanguages(ctx, "%", "%") + testURLParseError(t, err) +} + +func TestRepositoriesService_License(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/license", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"name": "LICENSE", "path": "LICENSE", "license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","featured":true}}`) }) ctx := context.Background() - protection, _, err := client.Repositories.UpdateBranchProtection(ctx, "o", "r", "b", input) + got, _, err := client.Repositories.License(ctx, "o", "r") if err != nil { - t.Errorf("Repositories.UpdateBranchProtection returned error: %v", err) + t.Errorf("Repositories.License returned error: %v", err) } - want := &Protection{ - RequiredStatusChecks: &RequiredStatusChecks{ - Strict: true, - Contexts: []string{"continuous-integration"}, - Checks: []*RequiredStatusCheck{ - { - Context: "continuous-integration", - }, - }, - }, - RequiredPullRequestReviews: &PullRequestReviewsEnforcement{ - DismissStaleReviews: true, - DismissalRestrictions: &DismissalRestrictions{ - Users: []*User{ - {Login: String("uu"), ID: Int64(3)}, - }, - Teams: []*Team{ - {Slug: String("tt"), ID: Int64(4)}, - }, - Apps: []*App{ - {Slug: String("aa"), ID: Int64(5)}, - }, - }, - 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{ - {Login: String("u"), ID: Int64(1)}, - }, - Teams: []*Team{ - {Slug: String("t"), ID: Int64(2)}, - }, - Apps: []*App{ - {Slug: String("a"), ID: Int64(3)}, - }, - }, - BlockCreations: &BlockCreations{ - Enabled: Bool(true), - }, - LockBranch: &LockBranch{ - Enabled: Bool(true), - }, - AllowForkSyncing: &AllowForkSyncing{ - Enabled: Bool(true), + want := &RepositoryLicense{ + Name: String("LICENSE"), + Path: String("LICENSE"), + License: &License{ + Name: String("MIT License"), + Key: String("mit"), + SPDXID: String("MIT"), + URL: String("https://api.github.com/licenses/mit"), + Featured: Bool(true), }, } - if !cmp.Equal(protection, want) { - t.Errorf("Repositories.UpdateBranchProtection returned %+v, want %+v", protection, want) + + if !cmp.Equal(got, want) { + t.Errorf("Repositories.License returned %+v, want %+v", got, want) } - const methodName = "UpdateBranchProtection" + const methodName = "License" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.UpdateBranchProtection(ctx, "\n", "\n", "\n", input) + _, _, err = client.Repositories.License(ctx, "\n", "\n") return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.UpdateBranchProtection(ctx, "o", "r", "b", input) + got, resp, err := client.Repositories.License(ctx, "o", "r") if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -1498,1532 +2041,1025 @@ func TestRepositoriesService_UpdateBranchProtection_Contexts(t *testing.T) { }) } -func TestRepositoriesService_UpdateBranchProtection_Checks(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - input := &ProtectionRequest{ - RequiredStatusChecks: &RequiredStatusChecks{ - Strict: true, - Checks: []*RequiredStatusCheck{ - { - Context: "continuous-integration", - }, - }, - }, - RequiredPullRequestReviews: &PullRequestReviewsEnforcementRequest{ - DismissStaleReviews: true, - DismissalRestrictionsRequest: &DismissalRestrictionsRequest{ - Users: &[]string{"uu"}, - Teams: &[]string{"tt"}, - Apps: &[]string{"aa"}, - }, - BypassPullRequestAllowancesRequest: &BypassPullRequestAllowancesRequest{ - Users: []string{"uuu"}, - Teams: []string{"ttt"}, - Apps: []string{"aaa"}, - }, - }, - Restrictions: &BranchRestrictionsRequest{ - Users: []string{"u"}, - Teams: []string{"t"}, - Apps: []string{"a"}, - }, - } - - mux.HandleFunc("/repos/o/r/branches/b/protection", func(w http.ResponseWriter, r *http.Request) { - v := new(ProtectionRequest) - assertNilError(t, json.NewDecoder(r.Body).Decode(v)) +func TestRepositoriesService_GetRequiredStatusChecks(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection/required_status_checks"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/required_status_checks"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "strict": true, + "contexts": ["x","y","z"], + "checks": [ + { + "context": "x", + "app_id": null + }, + { + "context": "y", + "app_id": null + }, + { + "context": "z", + "app_id": null + } + ] + }`) + }) - testMethod(t, r, "PUT") - if !cmp.Equal(v, input) { - t.Errorf("Request body = %+v, want %+v", v, input) - } + ctx := context.Background() + checks, _, err := client.Repositories.GetRequiredStatusChecks(ctx, "o", "r", test.branch) + if err != nil { + t.Errorf("Repositories.GetRequiredStatusChecks returned error: %v", err) + } - // TODO: remove custom Accept header when this API fully launches - testHeader(t, r, "Accept", mediaTypeRequiredApprovingReviewsPreview) - fmt.Fprintf(w, `{ - "required_status_checks":{ - "strict":true, - "contexts":["continuous-integration"], - "checks": [ + want := &RequiredStatusChecks{ + Strict: true, + Contexts: []string{"x", "y", "z"}, + Checks: []*RequiredStatusCheck{ { - "context": "continuous-integration", - "app_id": null - } - ] - }, - "required_pull_request_reviews":{ - "dismissal_restrictions":{ - "users":[{ - "id":3, - "login":"uu" - }], - "teams":[{ - "id":4, - "slug":"tt" - }], - "apps":[{ - "id":5, - "slug":"aa" - }] + Context: "x", + }, + { + Context: "y", + }, + { + Context: "z", + }, }, - "dismiss_stale_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"}], - "teams":[{"id":2,"slug":"t"}], - "apps":[{"id":3,"slug":"a"}] } - }`) - }) + if !cmp.Equal(checks, want) { + t.Errorf("Repositories.GetRequiredStatusChecks returned %+v, want %+v", checks, want) + } - ctx := context.Background() - protection, _, err := client.Repositories.UpdateBranchProtection(ctx, "o", "r", "b", input) - if err != nil { - t.Errorf("Repositories.UpdateBranchProtection returned error: %v", err) - } + const methodName = "GetRequiredStatusChecks" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.GetRequiredStatusChecks(ctx, "\n", "\n", "\n") + return err + }) - want := &Protection{ - RequiredStatusChecks: &RequiredStatusChecks{ - Strict: true, - Contexts: []string{"continuous-integration"}, - Checks: []*RequiredStatusCheck{ - { - Context: "continuous-integration", - }, - }, - }, - RequiredPullRequestReviews: &PullRequestReviewsEnforcement{ - DismissStaleReviews: true, - DismissalRestrictions: &DismissalRestrictions{ - Users: []*User{ - {Login: String("uu"), ID: Int64(3)}, - }, - Teams: []*Team{ - {Slug: String("tt"), ID: Int64(4)}, - }, - Apps: []*App{ - {Slug: String("aa"), ID: Int64(5)}, - }, - }, - 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{ - {Login: String("u"), ID: Int64(1)}, - }, - Teams: []*Team{ - {Slug: String("t"), ID: Int64(2)}, - }, - Apps: []*App{ - {Slug: String("a"), ID: Int64(3)}, - }, - }, - } - if !cmp.Equal(protection, want) { - t.Errorf("Repositories.UpdateBranchProtection returned %+v, want %+v", protection, want) + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.GetRequiredStatusChecks(ctx, "o", "r", test.branch) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) + }) } } -func TestRepositoriesService_UpdateBranchProtection_StrictNoChecks(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - input := &ProtectionRequest{ - RequiredStatusChecks: &RequiredStatusChecks{ - Strict: true, - Checks: []*RequiredStatusCheck{}, - }, - RequiredPullRequestReviews: &PullRequestReviewsEnforcementRequest{ - DismissStaleReviews: true, - DismissalRestrictionsRequest: &DismissalRestrictionsRequest{ - Users: &[]string{"uu"}, - Teams: &[]string{"tt"}, - Apps: &[]string{"aa"}, - }, - BypassPullRequestAllowancesRequest: &BypassPullRequestAllowancesRequest{ - Users: []string{"uuu"}, - Teams: []string{"ttt"}, - Apps: []string{"aaa"}, - }, - }, - Restrictions: &BranchRestrictionsRequest{ - Users: []string{"u"}, - Teams: []string{"t"}, - Apps: []string{"a"}, - }, +func TestRepositoriesService_GetRequiredStatusChecks_branchNotProtected(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection/required_status_checks"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/required_status_checks"}, } - mux.HandleFunc("/repos/o/r/branches/b/protection", func(w http.ResponseWriter, r *http.Request) { - v := new(ProtectionRequest) - assertNilError(t, json.NewDecoder(r.Body).Decode(v)) + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() - testMethod(t, r, "PUT") - if !cmp.Equal(v, input) { - t.Errorf("Request body = %+v, want %+v", v, input) - } + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") - // TODO: remove custom Accept header when this API fully launches - testHeader(t, r, "Accept", mediaTypeRequiredApprovingReviewsPreview) - fmt.Fprintf(w, `{ - "required_status_checks":{ - "strict":true, - "contexts":[], - "checks": [] - }, - "required_pull_request_reviews":{ - "dismissal_restrictions":{ - "users":[{ - "id":3, - "login":"uu" - }], - "teams":[{ - "id":4, - "slug":"tt" - }], - "apps":[{ - "id":5, - "slug":"aa" - }] - }, - "dismiss_stale_reviews":true, - "require_code_owner_reviews":true, - "require_last_push_approval":false, - "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"}], - "teams":[{"id":2,"slug":"t"}], - "apps":[{"id":3,"slug":"a"}] - } - }`) - }) + w.WriteHeader(http.StatusBadRequest) + fmt.Fprintf(w, `{ + "message": %q, + "documentation_url": "https://docs.github.com/rest/repos#get-branch-protection" + }`, githubBranchNotProtected) + }) - ctx := context.Background() - protection, _, err := client.Repositories.UpdateBranchProtection(ctx, "o", "r", "b", input) - if err != nil { - t.Errorf("Repositories.UpdateBranchProtection returned error: %v", err) - } + ctx := context.Background() + checks, _, err := client.Repositories.GetRequiredStatusChecks(ctx, "o", "r", test.branch) - want := &Protection{ - RequiredStatusChecks: &RequiredStatusChecks{ - Strict: true, - Contexts: []string{}, - Checks: []*RequiredStatusCheck{}, - }, - RequiredPullRequestReviews: &PullRequestReviewsEnforcement{ - DismissStaleReviews: true, - DismissalRestrictions: &DismissalRestrictions{ - Users: []*User{ - {Login: String("uu"), ID: Int64(3)}, - }, - Teams: []*Team{ - {Slug: String("tt"), ID: Int64(4)}, - }, - Apps: []*App{ - {Slug: String("aa"), ID: Int64(5)}, - }, - }, - 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{ - {Login: String("u"), ID: Int64(1)}, - }, - Teams: []*Team{ - {Slug: String("t"), ID: Int64(2)}, - }, - Apps: []*App{ - {Slug: String("a"), ID: Int64(3)}, - }, - }, - } - if !cmp.Equal(protection, want) { - t.Errorf("Repositories.UpdateBranchProtection returned %+v, want %+v", protection, want) + if checks != nil { + t.Errorf("Repositories.GetRequiredStatusChecks returned non-nil status-checks data") + } + + if err != ErrBranchNotProtected { + t.Errorf("Repositories.GetRequiredStatusChecks returned an invalid error: %v", err) + } + }) } } -func TestRepositoriesService_UpdateBranchProtection_RequireLastPushApproval(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() +func TestRepositoriesService_UpdateRequiredStatusChecks_Contexts(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection/required_status_checks"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/required_status_checks"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + input := &RequiredStatusChecksRequest{ + Strict: Bool(true), + Contexts: []string{"continuous-integration"}, + } - input := &ProtectionRequest{ - RequiredPullRequestReviews: &PullRequestReviewsEnforcementRequest{ - RequireLastPushApproval: Bool(true), - }, - } + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + v := new(RequiredStatusChecksRequest) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) - mux.HandleFunc("/repos/o/r/branches/b/protection", func(w http.ResponseWriter, r *http.Request) { - v := new(ProtectionRequest) - assertNilError(t, json.NewDecoder(r.Body).Decode(v)) + testMethod(t, r, "PATCH") + if !cmp.Equal(v, input) { + t.Errorf("Request body = %+v, want %+v", v, input) + } + testHeader(t, r, "Accept", mediaTypeV3) + fmt.Fprintf(w, `{ + "strict":true, + "contexts":["continuous-integration"], + "checks": [ + { + "context": "continuous-integration", + "app_id": null + } + ] + }`) + }) - testMethod(t, r, "PUT") - if !cmp.Equal(v, input) { - t.Errorf("Request body = %+v, want %+v", v, input) - } + ctx := context.Background() + statusChecks, _, err := client.Repositories.UpdateRequiredStatusChecks(ctx, "o", "r", test.branch, input) + if err != nil { + t.Errorf("Repositories.UpdateRequiredStatusChecks returned error: %v", err) + } - fmt.Fprintf(w, `{ - "required_pull_request_reviews":{ - "require_last_push_approval":true + want := &RequiredStatusChecks{ + Strict: true, + Contexts: []string{"continuous-integration"}, + Checks: []*RequiredStatusCheck{ + { + Context: "continuous-integration", + }, + }, + } + if !cmp.Equal(statusChecks, want) { + t.Errorf("Repositories.UpdateRequiredStatusChecks returned %+v, want %+v", statusChecks, want) } - }`) - }) - ctx := context.Background() - protection, _, err := client.Repositories.UpdateBranchProtection(ctx, "o", "r", "b", input) - if err != nil { - t.Errorf("Repositories.UpdateBranchProtection returned error: %v", err) - } + const methodName = "UpdateRequiredStatusChecks" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.UpdateRequiredStatusChecks(ctx, "\n", "\n", "\n", input) + return err + }) - want := &Protection{ - RequiredPullRequestReviews: &PullRequestReviewsEnforcement{ - RequireLastPushApproval: true, - }, - } - if !cmp.Equal(protection, want) { - t.Errorf("Repositories.UpdateBranchProtection returned %+v, want %+v", protection, want) + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.UpdateRequiredStatusChecks(ctx, "o", "r", test.branch, input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) + }) } } -func TestRepositoriesService_RemoveBranchProtection(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - mux.HandleFunc("/repos/o/r/branches/b/protection", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "DELETE") - w.WriteHeader(http.StatusNoContent) - }) - - ctx := context.Background() - _, err := client.Repositories.RemoveBranchProtection(ctx, "o", "r", "b") - if err != nil { - t.Errorf("Repositories.RemoveBranchProtection returned error: %v", err) - } +func TestRepositoriesService_UpdateRequiredStatusChecks_Checks(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection/required_status_checks"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/required_status_checks"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + appID := int64(123) + noAppID := int64(-1) + input := &RequiredStatusChecksRequest{ + Strict: Bool(true), + Checks: []*RequiredStatusCheck{ + { + Context: "continuous-integration", + }, + { + Context: "continuous-integration2", + AppID: &appID, + }, + { + Context: "continuous-integration3", + AppID: &noAppID, + }, + }, + } - const methodName = "RemoveBranchProtection" - testBadOptions(t, methodName, func() (err error) { - _, err = client.Repositories.RemoveBranchProtection(ctx, "\n", "\n", "\n") - return err - }) + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + v := new(RequiredStatusChecksRequest) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Repositories.RemoveBranchProtection(ctx, "o", "r", "b") - }) -} + testMethod(t, r, "PATCH") + if !cmp.Equal(v, input) { + t.Errorf("Request body = %+v, want %+v", v, input) + } + testHeader(t, r, "Accept", mediaTypeV3) + fmt.Fprintf(w, `{ + "strict":true, + "contexts":["continuous-integration"], + "checks": [ + { + "context": "continuous-integration", + "app_id": null + }, + { + "context": "continuous-integration2", + "app_id": 123 + }, + { + "context": "continuous-integration3", + "app_id": null + } + ] + }`) + }) -func TestRepositoriesService_ListLanguages_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + ctx := context.Background() + statusChecks, _, err := client.Repositories.UpdateRequiredStatusChecks(ctx, "o", "r", test.branch, input) + if err != nil { + t.Errorf("Repositories.UpdateRequiredStatusChecks returned error: %v", err) + } - ctx := context.Background() - _, _, err := client.Repositories.ListLanguages(ctx, "%", "%") - testURLParseError(t, err) + want := &RequiredStatusChecks{ + Strict: true, + Contexts: []string{"continuous-integration"}, + Checks: []*RequiredStatusCheck{ + { + Context: "continuous-integration", + }, + { + Context: "continuous-integration2", + AppID: &appID, + }, + { + Context: "continuous-integration3", + }, + }, + } + if !cmp.Equal(statusChecks, want) { + t.Errorf("Repositories.UpdateRequiredStatusChecks returned %+v, want %+v", statusChecks, want) + } + }) + } } -func TestRepositoriesService_License(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - mux.HandleFunc("/repos/o/r/license", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - fmt.Fprint(w, `{"name": "LICENSE", "path": "LICENSE", "license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","featured":true}}`) - }) - - ctx := context.Background() - got, _, err := client.Repositories.License(ctx, "o", "r") - if err != nil { - t.Errorf("Repositories.License returned error: %v", err) - } +func TestRepositoriesService_RemoveRequiredStatusChecks(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection/required_status_checks"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/required_status_checks"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + testHeader(t, r, "Accept", mediaTypeV3) + w.WriteHeader(http.StatusNoContent) + }) + + ctx := context.Background() + _, err := client.Repositories.RemoveRequiredStatusChecks(ctx, "o", "r", test.branch) + if err != nil { + t.Errorf("Repositories.RemoveRequiredStatusChecks returned error: %v", err) + } - want := &RepositoryLicense{ - Name: String("LICENSE"), - Path: String("LICENSE"), - License: &License{ - Name: String("MIT License"), - Key: String("mit"), - SPDXID: String("MIT"), - URL: String("https://api.github.com/licenses/mit"), - Featured: Bool(true), - }, - } + const methodName = "RemoveRequiredStatusChecks" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Repositories.RemoveRequiredStatusChecks(ctx, "\n", "\n", "\n") + return err + }) - if !cmp.Equal(got, want) { - t.Errorf("Repositories.License returned %+v, want %+v", got, want) + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Repositories.RemoveRequiredStatusChecks(ctx, "o", "r", test.branch) + }) + }) } +} - const methodName = "License" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.License(ctx, "\n", "\n") - return err - }) +func TestRepositoriesService_ListRequiredStatusChecksContexts(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection/required_status_checks/contexts"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/required_status_checks/contexts"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `["x", "y", "z"]`) + }) + + ctx := context.Background() + contexts, _, err := client.Repositories.ListRequiredStatusChecksContexts(ctx, "o", "r", test.branch) + if err != nil { + t.Errorf("Repositories.ListRequiredStatusChecksContexts returned error: %v", err) + } - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.License(ctx, "o", "r") - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} + want := []string{"x", "y", "z"} + if !cmp.Equal(contexts, want) { + t.Errorf("Repositories.ListRequiredStatusChecksContexts returned %+v, want %+v", contexts, want) + } -func TestRepositoriesService_GetRequiredStatusChecks(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + const methodName = "ListRequiredStatusChecksContexts" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.ListRequiredStatusChecksContexts(ctx, "\n", "\n", "\n") + return err + }) - mux.HandleFunc("/repos/o/r/branches/b/protection/required_status_checks", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - fmt.Fprint(w, `{ - "strict": true, - "contexts": ["x","y","z"], - "checks": [ - { - "context": "x", - "app_id": null - }, - { - "context": "y", - "app_id": null - }, - { - "context": "z", - "app_id": null + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.ListRequiredStatusChecksContexts(ctx, "o", "r", test.branch) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } - ] - }`) - }) - - ctx := context.Background() - checks, _, err := client.Repositories.GetRequiredStatusChecks(ctx, "o", "r", "b") - if err != nil { - t.Errorf("Repositories.GetRequiredStatusChecks returned error: %v", err) + return resp, err + }) + }) } +} - want := &RequiredStatusChecks{ - Strict: true, - Contexts: []string{"x", "y", "z"}, - Checks: []*RequiredStatusCheck{ - { - Context: "x", - }, - { - Context: "y", - }, - { - Context: "z", - }, - }, - } - if !cmp.Equal(checks, want) { - t.Errorf("Repositories.GetRequiredStatusChecks returned %+v, want %+v", checks, want) +func TestRepositoriesService_ListRequiredStatusChecksContexts_branchNotProtected(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection/required_status_checks/contexts"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/required_status_checks/contexts"}, } - const methodName = "GetRequiredStatusChecks" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.GetRequiredStatusChecks(ctx, "\n", "\n", "\n") - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.GetRequiredStatusChecks(ctx, "o", "r", "b") - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestRepositoriesService_GetRequiredStatusChecks_branchNotProtected(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() - mux.HandleFunc("/repos/o/r/branches/b/protection/required_status_checks", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") - w.WriteHeader(http.StatusBadRequest) - fmt.Fprintf(w, `{ + w.WriteHeader(http.StatusBadRequest) + fmt.Fprintf(w, `{ "message": %q, "documentation_url": "https://docs.github.com/rest/repos#get-branch-protection" }`, githubBranchNotProtected) - }) + }) - ctx := context.Background() - checks, _, err := client.Repositories.GetRequiredStatusChecks(ctx, "o", "r", "b") + ctx := context.Background() + contexts, _, err := client.Repositories.ListRequiredStatusChecksContexts(ctx, "o", "r", test.branch) - if checks != nil { - t.Errorf("Repositories.GetRequiredStatusChecks returned non-nil status-checks data") - } + if contexts != nil { + t.Errorf("Repositories.ListRequiredStatusChecksContexts returned non-nil contexts data") + } - if err != ErrBranchNotProtected { - t.Errorf("Repositories.GetRequiredStatusChecks returned an invalid error: %v", err) + if err != ErrBranchNotProtected { + t.Errorf("Repositories.ListRequiredStatusChecksContexts returned an invalid error: %v", err) + } + }) } } -func TestRepositoriesService_UpdateRequiredStatusChecks_Contexts(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() +func TestRepositoriesService_GetPullRequestReviewEnforcement(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection/required_pull_request_reviews"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/required_pull_request_reviews"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + // TODO: remove custom Accept header when this API fully launches + testHeader(t, r, "Accept", mediaTypeRequiredApprovingReviewsPreview) + fmt.Fprintf(w, `{ + "dismissal_restrictions":{ + "users":[{"id":1,"login":"u"}], + "teams":[{"id":2,"slug":"t"}], + "apps":[{"id":3,"slug":"a"}] + }, + "dismiss_stale_reviews":true, + "require_code_owner_reviews":true, + "required_approving_review_count":1 + }`) + }) - input := &RequiredStatusChecksRequest{ - Strict: Bool(true), - Contexts: []string{"continuous-integration"}, - } + ctx := context.Background() + enforcement, _, err := client.Repositories.GetPullRequestReviewEnforcement(ctx, "o", "r", test.branch) + if err != nil { + t.Errorf("Repositories.GetPullRequestReviewEnforcement returned error: %v", err) + } - mux.HandleFunc("/repos/o/r/branches/b/protection/required_status_checks", func(w http.ResponseWriter, r *http.Request) { - v := new(RequiredStatusChecksRequest) - assertNilError(t, json.NewDecoder(r.Body).Decode(v)) + want := &PullRequestReviewsEnforcement{ + DismissStaleReviews: true, + DismissalRestrictions: &DismissalRestrictions{ + Users: []*User{ + {Login: String("u"), ID: Int64(1)}, + }, + Teams: []*Team{ + {Slug: String("t"), ID: Int64(2)}, + }, + Apps: []*App{ + {Slug: String("a"), ID: Int64(3)}, + }, + }, + RequireCodeOwnerReviews: true, + RequiredApprovingReviewCount: 1, + } - testMethod(t, r, "PATCH") - if !cmp.Equal(v, input) { - t.Errorf("Request body = %+v, want %+v", v, input) - } - testHeader(t, r, "Accept", mediaTypeV3) - fmt.Fprintf(w, `{ - "strict":true, - "contexts":["continuous-integration"], - "checks": [ - { - "context": "continuous-integration", - "app_id": null - } - ] - }`) - }) + if !cmp.Equal(enforcement, want) { + t.Errorf("Repositories.GetPullRequestReviewEnforcement returned %+v, want %+v", enforcement, want) + } - ctx := context.Background() - statusChecks, _, err := client.Repositories.UpdateRequiredStatusChecks(ctx, "o", "r", "b", input) - if err != nil { - t.Errorf("Repositories.UpdateRequiredStatusChecks returned error: %v", err) - } + const methodName = "GetPullRequestReviewEnforcement" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.GetPullRequestReviewEnforcement(ctx, "\n", "\n", "\n") + return err + }) - want := &RequiredStatusChecks{ - Strict: true, - Contexts: []string{"continuous-integration"}, - Checks: []*RequiredStatusCheck{ - { - Context: "continuous-integration", - }, - }, - } - if !cmp.Equal(statusChecks, want) { - t.Errorf("Repositories.UpdateRequiredStatusChecks returned %+v, want %+v", statusChecks, want) + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.GetPullRequestReviewEnforcement(ctx, "o", "r", test.branch) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) + }) } +} - const methodName = "UpdateRequiredStatusChecks" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.UpdateRequiredStatusChecks(ctx, "\n", "\n", "\n", input) - return err - }) +func TestRepositoriesService_UpdatePullRequestReviewEnforcement(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection/required_pull_request_reviews"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/required_pull_request_reviews"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + input := &PullRequestReviewsEnforcementUpdate{ + DismissalRestrictionsRequest: &DismissalRestrictionsRequest{ + Users: &[]string{"u"}, + Teams: &[]string{"t"}, + Apps: &[]string{"a"}, + }, + } - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.UpdateRequiredStatusChecks(ctx, "o", "r", "b", input) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + v := new(PullRequestReviewsEnforcementUpdate) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) -func TestRepositoriesService_UpdateRequiredStatusChecks_Checks(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - appID := int64(123) - noAppID := int64(-1) - input := &RequiredStatusChecksRequest{ - Strict: Bool(true), - Checks: []*RequiredStatusCheck{ - { - Context: "continuous-integration", - }, - { - Context: "continuous-integration2", - AppID: &appID, - }, - { - Context: "continuous-integration3", - AppID: &noAppID, - }, - }, - } - - mux.HandleFunc("/repos/o/r/branches/b/protection/required_status_checks", func(w http.ResponseWriter, r *http.Request) { - v := new(RequiredStatusChecksRequest) - assertNilError(t, json.NewDecoder(r.Body).Decode(v)) - - testMethod(t, r, "PATCH") - if !cmp.Equal(v, input) { - t.Errorf("Request body = %+v, want %+v", v, input) - } - testHeader(t, r, "Accept", mediaTypeV3) - fmt.Fprintf(w, `{ - "strict":true, - "contexts":["continuous-integration"], - "checks": [ - { - "context": "continuous-integration", - "app_id": null - }, - { - "context": "continuous-integration2", - "app_id": 123 - }, - { - "context": "continuous-integration3", - "app_id": null + testMethod(t, r, "PATCH") + if !cmp.Equal(v, input) { + t.Errorf("Request body = %+v, want %+v", v, input) } - ] - }`) - }) - - ctx := context.Background() - statusChecks, _, err := client.Repositories.UpdateRequiredStatusChecks(ctx, "o", "r", "b", input) - if err != nil { - t.Errorf("Repositories.UpdateRequiredStatusChecks returned error: %v", err) - } - - want := &RequiredStatusChecks{ - Strict: true, - Contexts: []string{"continuous-integration"}, - Checks: []*RequiredStatusCheck{ - { - Context: "continuous-integration", - }, - { - Context: "continuous-integration2", - AppID: &appID, - }, - { - Context: "continuous-integration3", - }, - }, - } - if !cmp.Equal(statusChecks, want) { - t.Errorf("Repositories.UpdateRequiredStatusChecks returned %+v, want %+v", statusChecks, want) - } -} - -func TestRepositoriesService_RemoveRequiredStatusChecks(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - mux.HandleFunc("/repos/o/r/branches/b/protection/required_status_checks", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "DELETE") - testHeader(t, r, "Accept", mediaTypeV3) - w.WriteHeader(http.StatusNoContent) - }) - - ctx := context.Background() - _, err := client.Repositories.RemoveRequiredStatusChecks(ctx, "o", "r", "b") - if err != nil { - t.Errorf("Repositories.RemoveRequiredStatusChecks returned error: %v", err) - } - - const methodName = "RemoveRequiredStatusChecks" - testBadOptions(t, methodName, func() (err error) { - _, err = client.Repositories.RemoveRequiredStatusChecks(ctx, "\n", "\n", "\n") - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Repositories.RemoveRequiredStatusChecks(ctx, "o", "r", "b") - }) -} - -func TestRepositoriesService_ListRequiredStatusChecksContexts(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - mux.HandleFunc("/repos/o/r/branches/b/protection/required_status_checks/contexts", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - fmt.Fprint(w, `["x", "y", "z"]`) - }) - - ctx := context.Background() - contexts, _, err := client.Repositories.ListRequiredStatusChecksContexts(ctx, "o", "r", "b") - if err != nil { - t.Errorf("Repositories.ListRequiredStatusChecksContexts returned error: %v", err) - } - - want := []string{"x", "y", "z"} - if !cmp.Equal(contexts, want) { - t.Errorf("Repositories.ListRequiredStatusChecksContexts returned %+v, want %+v", contexts, want) - } - - const methodName = "ListRequiredStatusChecksContexts" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.ListRequiredStatusChecksContexts(ctx, "\n", "\n", "\n") - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.ListRequiredStatusChecksContexts(ctx, "o", "r", "b") - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestRepositoriesService_ListRequiredStatusChecksContexts_branchNotProtected(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - mux.HandleFunc("/repos/o/r/branches/b/protection/required_status_checks/contexts", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - - w.WriteHeader(http.StatusBadRequest) - fmt.Fprintf(w, `{ - "message": %q, - "documentation_url": "https://docs.github.com/rest/repos#get-branch-protection" - }`, githubBranchNotProtected) - }) - - ctx := context.Background() - contexts, _, err := client.Repositories.ListRequiredStatusChecksContexts(ctx, "o", "r", "b") - - if contexts != nil { - t.Errorf("Repositories.ListRequiredStatusChecksContexts returned non-nil contexts data") - } - - if err != ErrBranchNotProtected { - t.Errorf("Repositories.ListRequiredStatusChecksContexts returned an invalid error: %v", err) - } -} - -func TestRepositoriesService_GetPullRequestReviewEnforcement(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - mux.HandleFunc("/repos/o/r/branches/b/protection/required_pull_request_reviews", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - // TODO: remove custom Accept header when this API fully launches - testHeader(t, r, "Accept", mediaTypeRequiredApprovingReviewsPreview) - fmt.Fprintf(w, `{ - "dismissal_restrictions":{ - "users":[{"id":1,"login":"u"}], - "teams":[{"id":2,"slug":"t"}], - "apps":[{"id":3,"slug":"a"}] - }, - "dismiss_stale_reviews":true, - "require_code_owner_reviews":true, - "required_approving_review_count":1 - }`) - }) - - ctx := context.Background() - enforcement, _, err := client.Repositories.GetPullRequestReviewEnforcement(ctx, "o", "r", "b") - if err != nil { - t.Errorf("Repositories.GetPullRequestReviewEnforcement returned error: %v", err) - } - - want := &PullRequestReviewsEnforcement{ - DismissStaleReviews: true, - DismissalRestrictions: &DismissalRestrictions{ - Users: []*User{ - {Login: String("u"), ID: Int64(1)}, - }, - Teams: []*Team{ - {Slug: String("t"), ID: Int64(2)}, - }, - Apps: []*App{ - {Slug: String("a"), ID: Int64(3)}, - }, - }, - RequireCodeOwnerReviews: true, - RequiredApprovingReviewCount: 1, - } - - if !cmp.Equal(enforcement, want) { - t.Errorf("Repositories.GetPullRequestReviewEnforcement returned %+v, want %+v", enforcement, want) - } - - const methodName = "GetPullRequestReviewEnforcement" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.GetPullRequestReviewEnforcement(ctx, "\n", "\n", "\n") - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.GetPullRequestReviewEnforcement(ctx, "o", "r", "b") - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestRepositoriesService_UpdatePullRequestReviewEnforcement(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - input := &PullRequestReviewsEnforcementUpdate{ - DismissalRestrictionsRequest: &DismissalRestrictionsRequest{ - Users: &[]string{"u"}, - Teams: &[]string{"t"}, - Apps: &[]string{"a"}, - }, - } - - mux.HandleFunc("/repos/o/r/branches/b/protection/required_pull_request_reviews", func(w http.ResponseWriter, r *http.Request) { - v := new(PullRequestReviewsEnforcementUpdate) - assertNilError(t, json.NewDecoder(r.Body).Decode(v)) - - testMethod(t, r, "PATCH") - if !cmp.Equal(v, input) { - t.Errorf("Request body = %+v, want %+v", v, input) - } - // TODO: remove custom Accept header when this API fully launches - testHeader(t, r, "Accept", mediaTypeRequiredApprovingReviewsPreview) - fmt.Fprintf(w, `{ - "dismissal_restrictions":{ - "users":[{"id":1,"login":"u"}], - "teams":[{"id":2,"slug":"t"}], - "apps":[{"id":3,"slug":"a"}] - }, - "dismiss_stale_reviews":true, - "require_code_owner_reviews":true, - "required_approving_review_count":3 - }`) - }) - - ctx := context.Background() - enforcement, _, err := client.Repositories.UpdatePullRequestReviewEnforcement(ctx, "o", "r", "b", input) - if err != nil { - t.Errorf("Repositories.UpdatePullRequestReviewEnforcement returned error: %v", err) - } - - want := &PullRequestReviewsEnforcement{ - DismissStaleReviews: true, - DismissalRestrictions: &DismissalRestrictions{ - Users: []*User{ - {Login: String("u"), ID: Int64(1)}, - }, - Teams: []*Team{ - {Slug: String("t"), ID: Int64(2)}, - }, - Apps: []*App{ - {Slug: String("a"), ID: Int64(3)}, - }, - }, - RequireCodeOwnerReviews: true, - RequiredApprovingReviewCount: 3, - } - if !cmp.Equal(enforcement, want) { - t.Errorf("Repositories.UpdatePullRequestReviewEnforcement returned %+v, want %+v", enforcement, want) - } - - const methodName = "UpdatePullRequestReviewEnforcement" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.UpdatePullRequestReviewEnforcement(ctx, "\n", "\n", "\n", input) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.UpdatePullRequestReviewEnforcement(ctx, "o", "r", "b", input) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestRepositoriesService_DisableDismissalRestrictions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - mux.HandleFunc("/repos/o/r/branches/b/protection/required_pull_request_reviews", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "PATCH") - // TODO: remove custom Accept header when this API fully launches - testHeader(t, r, "Accept", mediaTypeRequiredApprovingReviewsPreview) - testBody(t, r, `{"dismissal_restrictions":{}}`+"\n") - fmt.Fprintf(w, `{"dismiss_stale_reviews":true,"require_code_owner_reviews":true,"required_approving_review_count":1}`) - }) - - ctx := context.Background() - enforcement, _, err := client.Repositories.DisableDismissalRestrictions(ctx, "o", "r", "b") - if err != nil { - t.Errorf("Repositories.DisableDismissalRestrictions returned error: %v", err) - } - - want := &PullRequestReviewsEnforcement{ - DismissStaleReviews: true, - DismissalRestrictions: nil, - RequireCodeOwnerReviews: true, - RequiredApprovingReviewCount: 1, - } - if !cmp.Equal(enforcement, want) { - t.Errorf("Repositories.DisableDismissalRestrictions returned %+v, want %+v", enforcement, want) - } - - const methodName = "DisableDismissalRestrictions" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.DisableDismissalRestrictions(ctx, "\n", "\n", "\n") - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.DisableDismissalRestrictions(ctx, "o", "r", "b") - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestRepositoriesService_RemovePullRequestReviewEnforcement(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - mux.HandleFunc("/repos/o/r/branches/b/protection/required_pull_request_reviews", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "DELETE") - w.WriteHeader(http.StatusNoContent) - }) - - ctx := context.Background() - _, err := client.Repositories.RemovePullRequestReviewEnforcement(ctx, "o", "r", "b") - if err != nil { - t.Errorf("Repositories.RemovePullRequestReviewEnforcement returned error: %v", err) - } - - const methodName = "RemovePullRequestReviewEnforcement" - testBadOptions(t, methodName, func() (err error) { - _, err = client.Repositories.RemovePullRequestReviewEnforcement(ctx, "\n", "\n", "\n") - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Repositories.RemovePullRequestReviewEnforcement(ctx, "o", "r", "b") - }) -} - -func TestRepositoriesService_GetAdminEnforcement(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - mux.HandleFunc("/repos/o/r/branches/b/protection/enforce_admins", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - fmt.Fprintf(w, `{"url":"/repos/o/r/branches/b/protection/enforce_admins","enabled":true}`) - }) - - ctx := context.Background() - enforcement, _, err := client.Repositories.GetAdminEnforcement(ctx, "o", "r", "b") - if err != nil { - t.Errorf("Repositories.GetAdminEnforcement returned error: %v", err) - } - - want := &AdminEnforcement{ - URL: String("/repos/o/r/branches/b/protection/enforce_admins"), - Enabled: true, - } - - if !cmp.Equal(enforcement, want) { - t.Errorf("Repositories.GetAdminEnforcement returned %+v, want %+v", enforcement, want) - } - - const methodName = "GetAdminEnforcement" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.GetAdminEnforcement(ctx, "\n", "\n", "\n") - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.GetAdminEnforcement(ctx, "o", "r", "b") - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestRepositoriesService_AddAdminEnforcement(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - mux.HandleFunc("/repos/o/r/branches/b/protection/enforce_admins", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "POST") - fmt.Fprintf(w, `{"url":"/repos/o/r/branches/b/protection/enforce_admins","enabled":true}`) - }) - - ctx := context.Background() - enforcement, _, err := client.Repositories.AddAdminEnforcement(ctx, "o", "r", "b") - if err != nil { - t.Errorf("Repositories.AddAdminEnforcement returned error: %v", err) - } - - want := &AdminEnforcement{ - URL: String("/repos/o/r/branches/b/protection/enforce_admins"), - Enabled: true, - } - if !cmp.Equal(enforcement, want) { - t.Errorf("Repositories.AddAdminEnforcement returned %+v, want %+v", enforcement, want) - } - - const methodName = "AddAdminEnforcement" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.AddAdminEnforcement(ctx, "\n", "\n", "\n") - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.AddAdminEnforcement(ctx, "o", "r", "b") - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestRepositoriesService_RemoveAdminEnforcement(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - mux.HandleFunc("/repos/o/r/branches/b/protection/enforce_admins", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "DELETE") - w.WriteHeader(http.StatusNoContent) - }) - - ctx := context.Background() - _, err := client.Repositories.RemoveAdminEnforcement(ctx, "o", "r", "b") - if err != nil { - t.Errorf("Repositories.RemoveAdminEnforcement returned error: %v", err) - } - - const methodName = "RemoveAdminEnforcement" - testBadOptions(t, methodName, func() (err error) { - _, err = client.Repositories.RemoveAdminEnforcement(ctx, "\n", "\n", "\n") - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Repositories.RemoveAdminEnforcement(ctx, "o", "r", "b") - }) -} - -func TestRepositoriesService_GetSignaturesProtectedBranch(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - mux.HandleFunc("/repos/o/r/branches/b/protection/required_signatures", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - testHeader(t, r, "Accept", mediaTypeSignaturePreview) - fmt.Fprintf(w, `{"url":"/repos/o/r/branches/b/protection/required_signatures","enabled":false}`) - }) - - ctx := context.Background() - signature, _, err := client.Repositories.GetSignaturesProtectedBranch(ctx, "o", "r", "b") - if err != nil { - t.Errorf("Repositories.GetSignaturesProtectedBranch returned error: %v", err) - } - - want := &SignaturesProtectedBranch{ - URL: String("/repos/o/r/branches/b/protection/required_signatures"), - Enabled: Bool(false), - } - - if !cmp.Equal(signature, want) { - t.Errorf("Repositories.GetSignaturesProtectedBranch returned %+v, want %+v", signature, want) - } - - const methodName = "GetSignaturesProtectedBranch" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.GetSignaturesProtectedBranch(ctx, "\n", "\n", "\n") - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.GetSignaturesProtectedBranch(ctx, "o", "r", "b") - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestRepositoriesService_RequireSignaturesOnProtectedBranch(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - mux.HandleFunc("/repos/o/r/branches/b/protection/required_signatures", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "POST") - testHeader(t, r, "Accept", mediaTypeSignaturePreview) - fmt.Fprintf(w, `{"url":"/repos/o/r/branches/b/protection/required_signatures","enabled":true}`) - }) - - ctx := context.Background() - signature, _, err := client.Repositories.RequireSignaturesOnProtectedBranch(ctx, "o", "r", "b") - if err != nil { - t.Errorf("Repositories.RequireSignaturesOnProtectedBranch returned error: %v", err) - } - - want := &SignaturesProtectedBranch{ - URL: String("/repos/o/r/branches/b/protection/required_signatures"), - Enabled: Bool(true), - } - - if !cmp.Equal(signature, want) { - t.Errorf("Repositories.RequireSignaturesOnProtectedBranch returned %+v, want %+v", signature, want) - } - - const methodName = "RequireSignaturesOnProtectedBranch" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.RequireSignaturesOnProtectedBranch(ctx, "\n", "\n", "\n") - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.RequireSignaturesOnProtectedBranch(ctx, "o", "r", "b") - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestRepositoriesService_OptionalSignaturesOnProtectedBranch(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - mux.HandleFunc("/repos/o/r/branches/b/protection/required_signatures", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "DELETE") - testHeader(t, r, "Accept", mediaTypeSignaturePreview) - w.WriteHeader(http.StatusNoContent) - }) - - ctx := context.Background() - _, err := client.Repositories.OptionalSignaturesOnProtectedBranch(ctx, "o", "r", "b") - if err != nil { - t.Errorf("Repositories.OptionalSignaturesOnProtectedBranch returned error: %v", err) - } - - const methodName = "OptionalSignaturesOnProtectedBranch" - testBadOptions(t, methodName, func() (err error) { - _, err = client.Repositories.OptionalSignaturesOnProtectedBranch(ctx, "\n", "\n", "\n") - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Repositories.OptionalSignaturesOnProtectedBranch(ctx, "o", "r", "b") - }) -} - -func TestPullRequestReviewsEnforcementRequest_MarshalJSON_nilDismissalRestirctions(t *testing.T) { - req := PullRequestReviewsEnforcementRequest{} - - got, err := json.Marshal(req) - if err != nil { - t.Errorf("PullRequestReviewsEnforcementRequest.MarshalJSON returned error: %v", err) - } - - want := `{"dismiss_stale_reviews":false,"require_code_owner_reviews":false,"required_approving_review_count":0}` - if want != string(got) { - t.Errorf("PullRequestReviewsEnforcementRequest.MarshalJSON returned %+v, want %+v", string(got), want) - } - - req = PullRequestReviewsEnforcementRequest{ - DismissalRestrictionsRequest: &DismissalRestrictionsRequest{}, - } - - got, err = json.Marshal(req) - if err != nil { - t.Errorf("PullRequestReviewsEnforcementRequest.MarshalJSON returned error: %v", err) - } - - want = `{"dismissal_restrictions":{},"dismiss_stale_reviews":false,"require_code_owner_reviews":false,"required_approving_review_count":0}` - if want != string(got) { - t.Errorf("PullRequestReviewsEnforcementRequest.MarshalJSON returned %+v, want %+v", string(got), want) - } - - req = PullRequestReviewsEnforcementRequest{ - DismissalRestrictionsRequest: &DismissalRestrictionsRequest{ - Users: &[]string{}, - Teams: &[]string{}, - Apps: &[]string{}, - }, - RequireLastPushApproval: Bool(true), - } - - got, err = json.Marshal(req) - if err != nil { - t.Errorf("PullRequestReviewsEnforcementRequest.MarshalJSON returned error: %v", err) - } - - want = `{"dismissal_restrictions":{"users":[],"teams":[],"apps":[]},"dismiss_stale_reviews":false,"require_code_owner_reviews":false,"required_approving_review_count":0,"require_last_push_approval":true}` - if want != string(got) { - t.Errorf("PullRequestReviewsEnforcementRequest.MarshalJSON returned %+v, want %+v", string(got), want) - } -} - -func TestRepositoriesService_ListAllTopics(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - mux.HandleFunc("/repos/o/r/topics", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - testHeader(t, r, "Accept", mediaTypeTopicsPreview) - fmt.Fprint(w, `{"names":["go", "go-github", "github"]}`) - }) - - ctx := context.Background() - got, _, err := client.Repositories.ListAllTopics(ctx, "o", "r") - if err != nil { - t.Fatalf("Repositories.ListAllTopics returned error: %v", err) - } - - want := []string{"go", "go-github", "github"} - if !cmp.Equal(got, want) { - t.Errorf("Repositories.ListAllTopics returned %+v, want %+v", got, want) - } - - const methodName = "ListAllTopics" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.ListAllTopics(ctx, "\n", "\n") - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.ListAllTopics(ctx, "o", "r") - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} + // TODO: remove custom Accept header when this API fully launches + testHeader(t, r, "Accept", mediaTypeRequiredApprovingReviewsPreview) + fmt.Fprintf(w, `{ + "dismissal_restrictions":{ + "users":[{"id":1,"login":"u"}], + "teams":[{"id":2,"slug":"t"}], + "apps":[{"id":3,"slug":"a"}] + }, + "dismiss_stale_reviews":true, + "require_code_owner_reviews":true, + "required_approving_review_count":3 + }`) + }) -func TestRepositoriesService_ListAllTopics_emptyTopics(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + ctx := context.Background() + enforcement, _, err := client.Repositories.UpdatePullRequestReviewEnforcement(ctx, "o", "r", test.branch, input) + if err != nil { + t.Errorf("Repositories.UpdatePullRequestReviewEnforcement returned error: %v", err) + } - mux.HandleFunc("/repos/o/r/topics", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - testHeader(t, r, "Accept", mediaTypeTopicsPreview) - fmt.Fprint(w, `{"names":[]}`) - }) + want := &PullRequestReviewsEnforcement{ + DismissStaleReviews: true, + DismissalRestrictions: &DismissalRestrictions{ + Users: []*User{ + {Login: String("u"), ID: Int64(1)}, + }, + Teams: []*Team{ + {Slug: String("t"), ID: Int64(2)}, + }, + Apps: []*App{ + {Slug: String("a"), ID: Int64(3)}, + }, + }, + RequireCodeOwnerReviews: true, + RequiredApprovingReviewCount: 3, + } + if !cmp.Equal(enforcement, want) { + t.Errorf("Repositories.UpdatePullRequestReviewEnforcement returned %+v, want %+v", enforcement, want) + } - ctx := context.Background() - got, _, err := client.Repositories.ListAllTopics(ctx, "o", "r") - if err != nil { - t.Fatalf("Repositories.ListAllTopics returned error: %v", err) - } + const methodName = "UpdatePullRequestReviewEnforcement" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.UpdatePullRequestReviewEnforcement(ctx, "\n", "\n", "\n", input) + return err + }) - want := []string{} - if !cmp.Equal(got, want) { - t.Errorf("Repositories.ListAllTopics returned %+v, want %+v", got, want) + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.UpdatePullRequestReviewEnforcement(ctx, "o", "r", test.branch, input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) + }) } } -func TestRepositoriesService_ReplaceAllTopics(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() +func TestRepositoriesService_DisableDismissalRestrictions(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection/required_pull_request_reviews"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/required_pull_request_reviews"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PATCH") + // TODO: remove custom Accept header when this API fully launches + testHeader(t, r, "Accept", mediaTypeRequiredApprovingReviewsPreview) + testBody(t, r, `{"dismissal_restrictions":{}}`+"\n") + fmt.Fprintf(w, `{"dismiss_stale_reviews":true,"require_code_owner_reviews":true,"required_approving_review_count":1}`) + }) + + ctx := context.Background() + enforcement, _, err := client.Repositories.DisableDismissalRestrictions(ctx, "o", "r", test.branch) + if err != nil { + t.Errorf("Repositories.DisableDismissalRestrictions returned error: %v", err) + } - mux.HandleFunc("/repos/o/r/topics", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "PUT") - testHeader(t, r, "Accept", mediaTypeTopicsPreview) - fmt.Fprint(w, `{"names":["go", "go-github", "github"]}`) - }) + want := &PullRequestReviewsEnforcement{ + DismissStaleReviews: true, + DismissalRestrictions: nil, + RequireCodeOwnerReviews: true, + RequiredApprovingReviewCount: 1, + } + if !cmp.Equal(enforcement, want) { + t.Errorf("Repositories.DisableDismissalRestrictions returned %+v, want %+v", enforcement, want) + } - ctx := context.Background() - got, _, err := client.Repositories.ReplaceAllTopics(ctx, "o", "r", []string{"go", "go-github", "github"}) - if err != nil { - t.Fatalf("Repositories.ReplaceAllTopics returned error: %v", err) - } + const methodName = "DisableDismissalRestrictions" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.DisableDismissalRestrictions(ctx, "\n", "\n", "\n") + return err + }) - want := []string{"go", "go-github", "github"} - if !cmp.Equal(got, want) { - t.Errorf("Repositories.ReplaceAllTopics returned %+v, want %+v", got, want) + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.DisableDismissalRestrictions(ctx, "o", "r", test.branch) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) + }) } +} - const methodName = "ReplaceAllTopics" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.ReplaceAllTopics(ctx, "\n", "\n", []string{"\n", "\n", "\n"}) - return err - }) +func TestRepositoriesService_RemovePullRequestReviewEnforcement(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection/required_pull_request_reviews"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/required_pull_request_reviews"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + w.WriteHeader(http.StatusNoContent) + }) + + ctx := context.Background() + _, err := client.Repositories.RemovePullRequestReviewEnforcement(ctx, "o", "r", test.branch) + if err != nil { + t.Errorf("Repositories.RemovePullRequestReviewEnforcement returned error: %v", err) + } - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.ReplaceAllTopics(ctx, "o", "r", []string{"go", "go-github", "github"}) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) + const methodName = "RemovePullRequestReviewEnforcement" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Repositories.RemovePullRequestReviewEnforcement(ctx, "\n", "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Repositories.RemovePullRequestReviewEnforcement(ctx, "o", "r", test.branch) + }) + }) + } } -func TestRepositoriesService_ReplaceAllTopics_nilSlice(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() +func TestRepositoriesService_GetAdminEnforcement(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection/enforce_admins"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/enforce_admins"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprintf(w, `{"url":"/repos/o/r/branches/b/protection/enforce_admins","enabled":true}`) + }) + + ctx := context.Background() + enforcement, _, err := client.Repositories.GetAdminEnforcement(ctx, "o", "r", test.branch) + if err != nil { + t.Errorf("Repositories.GetAdminEnforcement returned error: %v", err) + } - mux.HandleFunc("/repos/o/r/topics", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "PUT") - testHeader(t, r, "Accept", mediaTypeTopicsPreview) - testBody(t, r, `{"names":[]}`+"\n") - fmt.Fprint(w, `{"names":[]}`) - }) + want := &AdminEnforcement{ + URL: String("/repos/o/r/branches/b/protection/enforce_admins"), + Enabled: true, + } - ctx := context.Background() - got, _, err := client.Repositories.ReplaceAllTopics(ctx, "o", "r", nil) - if err != nil { - t.Fatalf("Repositories.ReplaceAllTopics returned error: %v", err) - } + if !cmp.Equal(enforcement, want) { + t.Errorf("Repositories.GetAdminEnforcement returned %+v, want %+v", enforcement, want) + } - want := []string{} - if !cmp.Equal(got, want) { - t.Errorf("Repositories.ReplaceAllTopics returned %+v, want %+v", got, want) + const methodName = "GetAdminEnforcement" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.GetAdminEnforcement(ctx, "\n", "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.GetAdminEnforcement(ctx, "o", "r", test.branch) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) + }) } } -func TestRepositoriesService_ReplaceAllTopics_emptySlice(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() +func TestRepositoriesService_AddAdminEnforcement(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection/enforce_admins"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/enforce_admins"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + fmt.Fprintf(w, `{"url":"/repos/o/r/branches/b/protection/enforce_admins","enabled":true}`) + }) + + ctx := context.Background() + enforcement, _, err := client.Repositories.AddAdminEnforcement(ctx, "o", "r", test.branch) + if err != nil { + t.Errorf("Repositories.AddAdminEnforcement returned error: %v", err) + } - mux.HandleFunc("/repos/o/r/topics", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "PUT") - testHeader(t, r, "Accept", mediaTypeTopicsPreview) - testBody(t, r, `{"names":[]}`+"\n") - fmt.Fprint(w, `{"names":[]}`) - }) + want := &AdminEnforcement{ + URL: String("/repos/o/r/branches/b/protection/enforce_admins"), + Enabled: true, + } + if !cmp.Equal(enforcement, want) { + t.Errorf("Repositories.AddAdminEnforcement returned %+v, want %+v", enforcement, want) + } - ctx := context.Background() - got, _, err := client.Repositories.ReplaceAllTopics(ctx, "o", "r", []string{}) - if err != nil { - t.Fatalf("Repositories.ReplaceAllTopics returned error: %v", err) - } + const methodName = "AddAdminEnforcement" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.AddAdminEnforcement(ctx, "\n", "\n", "\n") + return err + }) - want := []string{} - if !cmp.Equal(got, want) { - t.Errorf("Repositories.ReplaceAllTopics returned %+v, want %+v", got, want) + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.AddAdminEnforcement(ctx, "o", "r", test.branch) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) + }) } } -func TestRepositoriesService_ListAppRestrictions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() +func TestRepositoriesService_RemoveAdminEnforcement(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection/enforce_admins"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/enforce_admins"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + w.WriteHeader(http.StatusNoContent) + }) + + ctx := context.Background() + _, err := client.Repositories.RemoveAdminEnforcement(ctx, "o", "r", test.branch) + if err != nil { + t.Errorf("Repositories.RemoveAdminEnforcement returned error: %v", err) + } - mux.HandleFunc("/repos/o/r/branches/b/protection/restrictions/apps", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - }) + const methodName = "RemoveAdminEnforcement" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Repositories.RemoveAdminEnforcement(ctx, "\n", "\n", "\n") + return err + }) - ctx := context.Background() - _, _, err := client.Repositories.ListAppRestrictions(ctx, "o", "r", "b") - if err != nil { - t.Errorf("Repositories.ListAppRestrictions returned error: %v", err) + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Repositories.RemoveAdminEnforcement(ctx, "o", "r", test.branch) + }) + }) } +} - const methodName = "ListAppRestrictions" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.ListAppRestrictions(ctx, "\n", "\n", "\n") - return err - }) +func TestRepositoriesService_GetSignaturesProtectedBranch(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection/required_signatures"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/required_signatures"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testHeader(t, r, "Accept", mediaTypeSignaturePreview) + fmt.Fprintf(w, `{"url":"/repos/o/r/branches/b/protection/required_signatures","enabled":false}`) + }) + + ctx := context.Background() + signature, _, err := client.Repositories.GetSignaturesProtectedBranch(ctx, "o", "r", test.branch) + if err != nil { + t.Errorf("Repositories.GetSignaturesProtectedBranch returned error: %v", err) + } - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.ListAppRestrictions(ctx, "o", "r", "b") - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} + want := &SignaturesProtectedBranch{ + URL: String("/repos/o/r/branches/b/protection/required_signatures"), + Enabled: Bool(false), + } -func TestRepositoriesService_ReplaceAppRestrictions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + if !cmp.Equal(signature, want) { + t.Errorf("Repositories.GetSignaturesProtectedBranch returned %+v, want %+v", signature, want) + } - mux.HandleFunc("/repos/o/r/branches/b/protection/restrictions/apps", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "PUT") - fmt.Fprint(w, `[{ - "name": "octocat" - }]`) - }) - input := []string{"octocat"} - ctx := context.Background() - got, _, err := client.Repositories.ReplaceAppRestrictions(ctx, "o", "r", "b", input) - if err != nil { - t.Errorf("Repositories.ReplaceAppRestrictions returned error: %v", err) - } - want := []*App{ - {Name: String("octocat")}, - } - if !cmp.Equal(got, want) { - t.Errorf("Repositories.ReplaceAppRestrictions returned %+v, want %+v", got, want) + const methodName = "GetSignaturesProtectedBranch" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.GetSignaturesProtectedBranch(ctx, "\n", "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.GetSignaturesProtectedBranch(ctx, "o", "r", test.branch) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) + }) } +} - const methodName = "ReplaceAppRestrictions" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.ReplaceAppRestrictions(ctx, "\n", "\n", "\n", input) - return err - }) +func TestRepositoriesService_RequireSignaturesOnProtectedBranch(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection/required_signatures"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/required_signatures"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + testHeader(t, r, "Accept", mediaTypeSignaturePreview) + fmt.Fprintf(w, `{"url":"/repos/o/r/branches/b/protection/required_signatures","enabled":true}`) + }) + + ctx := context.Background() + signature, _, err := client.Repositories.RequireSignaturesOnProtectedBranch(ctx, "o", "r", test.branch) + if err != nil { + t.Errorf("Repositories.RequireSignaturesOnProtectedBranch returned error: %v", err) + } - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.ReplaceAppRestrictions(ctx, "o", "r", "b", input) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} + want := &SignaturesProtectedBranch{ + URL: String("/repos/o/r/branches/b/protection/required_signatures"), + Enabled: Bool(true), + } -func TestRepositoriesService_AddAppRestrictions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + if !cmp.Equal(signature, want) { + t.Errorf("Repositories.RequireSignaturesOnProtectedBranch returned %+v, want %+v", signature, want) + } - mux.HandleFunc("/repos/o/r/branches/b/protection/restrictions/apps", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "POST") - fmt.Fprint(w, `[{ - "name": "octocat" - }]`) - }) - input := []string{"octocat"} - ctx := context.Background() - got, _, err := client.Repositories.AddAppRestrictions(ctx, "o", "r", "b", input) - if err != nil { - t.Errorf("Repositories.AddAppRestrictions returned error: %v", err) - } - want := []*App{ - {Name: String("octocat")}, - } - if !cmp.Equal(got, want) { - t.Errorf("Repositories.AddAppRestrictions returned %+v, want %+v", got, want) + const methodName = "RequireSignaturesOnProtectedBranch" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.RequireSignaturesOnProtectedBranch(ctx, "\n", "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.RequireSignaturesOnProtectedBranch(ctx, "o", "r", test.branch) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) + }) } +} - const methodName = "AddAppRestrictions" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.AddAppRestrictions(ctx, "\n", "\n", "\n", input) - return err - }) +func TestRepositoriesService_OptionalSignaturesOnProtectedBranch(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection/required_signatures"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/required_signatures"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + testHeader(t, r, "Accept", mediaTypeSignaturePreview) + w.WriteHeader(http.StatusNoContent) + }) + + ctx := context.Background() + _, err := client.Repositories.OptionalSignaturesOnProtectedBranch(ctx, "o", "r", test.branch) + if err != nil { + t.Errorf("Repositories.OptionalSignaturesOnProtectedBranch returned error: %v", err) + } - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.AddAppRestrictions(ctx, "o", "r", "b", input) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) + const methodName = "OptionalSignaturesOnProtectedBranch" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Repositories.OptionalSignaturesOnProtectedBranch(ctx, "\n", "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Repositories.OptionalSignaturesOnProtectedBranch(ctx, "o", "r", test.branch) + }) + }) + } } -func TestRepositoriesService_RemoveAppRestrictions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() +func TestPullRequestReviewsEnforcementRequest_MarshalJSON_nilDismissalRestirctions(t *testing.T) { + req := PullRequestReviewsEnforcementRequest{} - mux.HandleFunc("/repos/o/r/branches/b/protection/restrictions/apps", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "DELETE") - fmt.Fprint(w, `[]`) - }) - input := []string{"octocat"} - ctx := context.Background() - got, _, err := client.Repositories.RemoveAppRestrictions(ctx, "o", "r", "b", input) + got, err := json.Marshal(req) if err != nil { - t.Errorf("Repositories.RemoveAppRestrictions returned error: %v", err) + t.Errorf("PullRequestReviewsEnforcementRequest.MarshalJSON returned error: %v", err) } - want := []*App{} - if !cmp.Equal(got, want) { - t.Errorf("Repositories.RemoveAppRestrictions returned %+v, want %+v", got, want) + + want := `{"dismiss_stale_reviews":false,"require_code_owner_reviews":false,"required_approving_review_count":0}` + if want != string(got) { + t.Errorf("PullRequestReviewsEnforcementRequest.MarshalJSON returned %+v, want %+v", string(got), want) } - const methodName = "RemoveAppRestrictions" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.RemoveAppRestrictions(ctx, "\n", "\n", "\n", input) - return err - }) + req = PullRequestReviewsEnforcementRequest{ + DismissalRestrictionsRequest: &DismissalRestrictionsRequest{}, + } - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.RemoveAppRestrictions(ctx, "o", "r", "b", input) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} + got, err = json.Marshal(req) + if err != nil { + t.Errorf("PullRequestReviewsEnforcementRequest.MarshalJSON returned error: %v", err) + } -func TestRepositoriesService_ListTeamRestrictions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + want = `{"dismissal_restrictions":{},"dismiss_stale_reviews":false,"require_code_owner_reviews":false,"required_approving_review_count":0}` + if want != string(got) { + t.Errorf("PullRequestReviewsEnforcementRequest.MarshalJSON returned %+v, want %+v", string(got), want) + } - mux.HandleFunc("/repos/o/r/branches/b/protection/restrictions/teams", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - }) + req = PullRequestReviewsEnforcementRequest{ + DismissalRestrictionsRequest: &DismissalRestrictionsRequest{ + Users: &[]string{}, + Teams: &[]string{}, + Apps: &[]string{}, + }, + RequireLastPushApproval: Bool(true), + } - ctx := context.Background() - _, _, err := client.Repositories.ListTeamRestrictions(ctx, "o", "r", "b") + got, err = json.Marshal(req) if err != nil { - t.Errorf("Repositories.ListTeamRestrictions returned error: %v", err) + t.Errorf("PullRequestReviewsEnforcementRequest.MarshalJSON returned error: %v", err) } - const methodName = "ListTeamRestrictions" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.ListTeamRestrictions(ctx, "\n", "\n", "\n") - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.ListTeamRestrictions(ctx, "o", "r", "b") - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) + want = `{"dismissal_restrictions":{"users":[],"teams":[],"apps":[]},"dismiss_stale_reviews":false,"require_code_owner_reviews":false,"required_approving_review_count":0,"require_last_push_approval":true}` + if want != string(got) { + t.Errorf("PullRequestReviewsEnforcementRequest.MarshalJSON returned %+v, want %+v", string(got), want) + } } -func TestRepositoriesService_ReplaceTeamRestrictions(t *testing.T) { +func TestRepositoriesService_ListAllTopics(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - - mux.HandleFunc("/repos/o/r/branches/b/protection/restrictions/teams", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "PUT") - fmt.Fprint(w, `[{ - "name": "octocat" - }]`) + + mux.HandleFunc("/repos/o/r/topics", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testHeader(t, r, "Accept", mediaTypeTopicsPreview) + fmt.Fprint(w, `{"names":["go", "go-github", "github"]}`) }) - input := []string{"octocat"} + ctx := context.Background() - got, _, err := client.Repositories.ReplaceTeamRestrictions(ctx, "o", "r", "b", input) + got, _, err := client.Repositories.ListAllTopics(ctx, "o", "r") if err != nil { - t.Errorf("Repositories.ReplaceTeamRestrictions returned error: %v", err) - } - want := []*Team{ - {Name: String("octocat")}, + t.Fatalf("Repositories.ListAllTopics returned error: %v", err) } + + want := []string{"go", "go-github", "github"} if !cmp.Equal(got, want) { - t.Errorf("Repositories.ReplaceTeamRestrictions returned %+v, want %+v", got, want) + t.Errorf("Repositories.ListAllTopics returned %+v, want %+v", got, want) } - const methodName = "ReplaceTeamRestrictions" + const methodName = "ListAllTopics" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.ReplaceTeamRestrictions(ctx, "\n", "\n", "\n", input) + _, _, err = client.Repositories.ListAllTopics(ctx, "\n", "\n") return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.ReplaceTeamRestrictions(ctx, "o", "r", "b", input) + got, resp, err := client.Repositories.ListAllTopics(ctx, "o", "r") if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -3031,71 +3067,57 @@ func TestRepositoriesService_ReplaceTeamRestrictions(t *testing.T) { }) } -func TestRepositoriesService_AddTeamRestrictions(t *testing.T) { +func TestRepositoriesService_ListAllTopics_emptyTopics(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - mux.HandleFunc("/repos/o/r/branches/b/protection/restrictions/teams", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "POST") - fmt.Fprint(w, `[{ - "name": "octocat" - }]`) + mux.HandleFunc("/repos/o/r/topics", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testHeader(t, r, "Accept", mediaTypeTopicsPreview) + fmt.Fprint(w, `{"names":[]}`) }) - input := []string{"octocat"} + ctx := context.Background() - got, _, err := client.Repositories.AddTeamRestrictions(ctx, "o", "r", "b", input) + got, _, err := client.Repositories.ListAllTopics(ctx, "o", "r") if err != nil { - t.Errorf("Repositories.AddTeamRestrictions returned error: %v", err) - } - want := []*Team{ - {Name: String("octocat")}, + t.Fatalf("Repositories.ListAllTopics returned error: %v", err) } + + want := []string{} if !cmp.Equal(got, want) { - t.Errorf("Repositories.AddTeamRestrictions returned %+v, want %+v", got, want) + t.Errorf("Repositories.ListAllTopics returned %+v, want %+v", got, want) } - - const methodName = "AddTeamRestrictions" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.AddTeamRestrictions(ctx, "\n", "\n", "\n", input) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.AddTeamRestrictions(ctx, "o", "r", "b", input) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) } -func TestRepositoriesService_RemoveTeamRestrictions(t *testing.T) { +func TestRepositoriesService_ReplaceAllTopics(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - mux.HandleFunc("/repos/o/r/branches/b/protection/restrictions/teams", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "DELETE") - fmt.Fprint(w, `[]`) + mux.HandleFunc("/repos/o/r/topics", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + testHeader(t, r, "Accept", mediaTypeTopicsPreview) + fmt.Fprint(w, `{"names":["go", "go-github", "github"]}`) }) - input := []string{"octocat"} + ctx := context.Background() - got, _, err := client.Repositories.RemoveTeamRestrictions(ctx, "o", "r", "b", input) + got, _, err := client.Repositories.ReplaceAllTopics(ctx, "o", "r", []string{"go", "go-github", "github"}) if err != nil { - t.Errorf("Repositories.RemoveTeamRestrictions returned error: %v", err) + t.Fatalf("Repositories.ReplaceAllTopics returned error: %v", err) } - want := []*Team{} + + want := []string{"go", "go-github", "github"} if !cmp.Equal(got, want) { - t.Errorf("Repositories.RemoveTeamRestrictions returned %+v, want %+v", got, want) + t.Errorf("Repositories.ReplaceAllTopics returned %+v, want %+v", got, want) } - const methodName = "RemoveTeamRestrictions" + const methodName = "ReplaceAllTopics" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.RemoveTeamRestrictions(ctx, "\n", "\n", "\n", input) + _, _, err = client.Repositories.ReplaceAllTopics(ctx, "\n", "\n", []string{"\n", "\n", "\n"}) return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.RemoveTeamRestrictions(ctx, "o", "r", "b", input) + got, resp, err := client.Repositories.ReplaceAllTopics(ctx, "o", "r", []string{"go", "go-github", "github"}) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -3103,143 +3125,611 @@ func TestRepositoriesService_RemoveTeamRestrictions(t *testing.T) { }) } -func TestRepositoriesService_ListUserRestrictions(t *testing.T) { +func TestRepositoriesService_ReplaceAllTopics_nilSlice(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - mux.HandleFunc("/repos/o/r/branches/b/protection/restrictions/users", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") + mux.HandleFunc("/repos/o/r/topics", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + testHeader(t, r, "Accept", mediaTypeTopicsPreview) + testBody(t, r, `{"names":[]}`+"\n") + fmt.Fprint(w, `{"names":[]}`) }) ctx := context.Background() - _, _, err := client.Repositories.ListUserRestrictions(ctx, "o", "r", "b") + got, _, err := client.Repositories.ReplaceAllTopics(ctx, "o", "r", nil) if err != nil { - t.Errorf("Repositories.ListUserRestrictions returned error: %v", err) + t.Fatalf("Repositories.ReplaceAllTopics returned error: %v", err) } - const methodName = "ListUserRestrictions" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.ListUserRestrictions(ctx, "\n", "\n", "\n") - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.ListUserRestrictions(ctx, "o", "r", "b") - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) + want := []string{} + if !cmp.Equal(got, want) { + t.Errorf("Repositories.ReplaceAllTopics returned %+v, want %+v", got, want) + } } -func TestRepositoriesService_ReplaceUserRestrictions(t *testing.T) { +func TestRepositoriesService_ReplaceAllTopics_emptySlice(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - mux.HandleFunc("/repos/o/r/branches/b/protection/restrictions/users", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/topics", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") - fmt.Fprint(w, `[{ - "name": "octocat" - }]`) + testHeader(t, r, "Accept", mediaTypeTopicsPreview) + testBody(t, r, `{"names":[]}`+"\n") + fmt.Fprint(w, `{"names":[]}`) }) - input := []string{"octocat"} + ctx := context.Background() - got, _, err := client.Repositories.ReplaceUserRestrictions(ctx, "o", "r", "b", input) + got, _, err := client.Repositories.ReplaceAllTopics(ctx, "o", "r", []string{}) if err != nil { - t.Errorf("Repositories.ReplaceUserRestrictions returned error: %v", err) - } - want := []*User{ - {Name: String("octocat")}, + t.Fatalf("Repositories.ReplaceAllTopics returned error: %v", err) } + + want := []string{} if !cmp.Equal(got, want) { - t.Errorf("Repositories.ReplaceUserRestrictions returned %+v, want %+v", got, want) + t.Errorf("Repositories.ReplaceAllTopics returned %+v, want %+v", got, want) } +} - const methodName = "ReplaceUserRestrictions" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.ReplaceUserRestrictions(ctx, "\n", "\n", "\n", input) - return err - }) +func TestRepositoriesService_ListAppRestrictions(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection/restrictions/apps"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/restrictions/apps"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + }) + + ctx := context.Background() + _, _, err := client.Repositories.ListAppRestrictions(ctx, "o", "r", test.branch) + if err != nil { + t.Errorf("Repositories.ListAppRestrictions returned error: %v", err) + } - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.ReplaceUserRestrictions(ctx, "o", "r", "b", input) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) + const methodName = "ListAppRestrictions" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.ListAppRestrictions(ctx, "\n", "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.ListAppRestrictions(ctx, "o", "r", test.branch) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) + }) + } } -func TestRepositoriesService_AddUserRestrictions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() +func TestRepositoriesService_ReplaceAppRestrictions(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection/restrictions/apps"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/restrictions/apps"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + fmt.Fprint(w, `[{ + "name": "octocat" + }]`) + }) + input := []string{"octocat"} + ctx := context.Background() + got, _, err := client.Repositories.ReplaceAppRestrictions(ctx, "o", "r", test.branch, input) + if err != nil { + t.Errorf("Repositories.ReplaceAppRestrictions returned error: %v", err) + } + want := []*App{ + {Name: String("octocat")}, + } + if !cmp.Equal(got, want) { + t.Errorf("Repositories.ReplaceAppRestrictions returned %+v, want %+v", got, want) + } - mux.HandleFunc("/repos/o/r/branches/b/protection/restrictions/users", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "POST") - fmt.Fprint(w, `[{ + const methodName = "ReplaceAppRestrictions" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.ReplaceAppRestrictions(ctx, "\n", "\n", "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.ReplaceAppRestrictions(ctx, "o", "r", test.branch, input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) + }) + } +} + +func TestRepositoriesService_AddAppRestrictions(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection/restrictions/apps"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/restrictions/apps"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + fmt.Fprint(w, `[{ "name": "octocat" }]`) - }) - input := []string{"octocat"} - ctx := context.Background() - got, _, err := client.Repositories.AddUserRestrictions(ctx, "o", "r", "b", input) - if err != nil { - t.Errorf("Repositories.AddUserRestrictions returned error: %v", err) + }) + input := []string{"octocat"} + ctx := context.Background() + got, _, err := client.Repositories.AddAppRestrictions(ctx, "o", "r", test.branch, input) + if err != nil { + t.Errorf("Repositories.AddAppRestrictions returned error: %v", err) + } + want := []*App{ + {Name: String("octocat")}, + } + if !cmp.Equal(got, want) { + t.Errorf("Repositories.AddAppRestrictions returned %+v, want %+v", got, want) + } + + const methodName = "AddAppRestrictions" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.AddAppRestrictions(ctx, "\n", "\n", "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.AddAppRestrictions(ctx, "o", "r", test.branch, input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) + }) } - want := []*User{ - {Name: String("octocat")}, +} + +func TestRepositoriesService_RemoveAppRestrictions(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection/restrictions/apps"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/restrictions/apps"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + fmt.Fprint(w, `[]`) + }) + input := []string{"octocat"} + ctx := context.Background() + got, _, err := client.Repositories.RemoveAppRestrictions(ctx, "o", "r", test.branch, input) + if err != nil { + t.Errorf("Repositories.RemoveAppRestrictions returned error: %v", err) + } + want := []*App{} + if !cmp.Equal(got, want) { + t.Errorf("Repositories.RemoveAppRestrictions returned %+v, want %+v", got, want) + } + + const methodName = "RemoveAppRestrictions" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.RemoveAppRestrictions(ctx, "\n", "\n", "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.RemoveAppRestrictions(ctx, "o", "r", test.branch, input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) + }) } - if !cmp.Equal(got, want) { - t.Errorf("Repositories.AddUserRestrictions returned %+v, want %+v", got, want) +} + +func TestRepositoriesService_ListTeamRestrictions(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection/restrictions/teams"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/restrictions/teams"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + }) + + ctx := context.Background() + _, _, err := client.Repositories.ListTeamRestrictions(ctx, "o", "r", test.branch) + if err != nil { + t.Errorf("Repositories.ListTeamRestrictions returned error: %v", err) + } + + const methodName = "ListTeamRestrictions" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.ListTeamRestrictions(ctx, "\n", "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.ListTeamRestrictions(ctx, "o", "r", test.branch) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) + }) } +} - const methodName = "AddUserRestrictions" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.AddUserRestrictions(ctx, "\n", "\n", "\n", input) - return err - }) +func TestRepositoriesService_ReplaceTeamRestrictions(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection/restrictions/teams"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/restrictions/teams"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + fmt.Fprint(w, `[{ + "name": "octocat" + }]`) + }) + input := []string{"octocat"} + ctx := context.Background() + got, _, err := client.Repositories.ReplaceTeamRestrictions(ctx, "o", "r", test.branch, input) + if err != nil { + t.Errorf("Repositories.ReplaceTeamRestrictions returned error: %v", err) + } + want := []*Team{ + {Name: String("octocat")}, + } + if !cmp.Equal(got, want) { + t.Errorf("Repositories.ReplaceTeamRestrictions returned %+v, want %+v", got, want) + } - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.AddUserRestrictions(ctx, "o", "r", "b", input) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) + const methodName = "ReplaceTeamRestrictions" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.ReplaceTeamRestrictions(ctx, "\n", "\n", "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.ReplaceTeamRestrictions(ctx, "o", "r", test.branch, input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) + }) + } } -func TestRepositoriesService_RemoveUserRestrictions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() +func TestRepositoriesService_AddTeamRestrictions(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection/restrictions/teams"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/restrictions/teams"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + fmt.Fprint(w, `[{ + "name": "octocat" + }]`) + }) + input := []string{"octocat"} + ctx := context.Background() + got, _, err := client.Repositories.AddTeamRestrictions(ctx, "o", "r", test.branch, input) + if err != nil { + t.Errorf("Repositories.AddTeamRestrictions returned error: %v", err) + } + want := []*Team{ + {Name: String("octocat")}, + } + if !cmp.Equal(got, want) { + t.Errorf("Repositories.AddTeamRestrictions returned %+v, want %+v", got, want) + } - mux.HandleFunc("/repos/o/r/branches/b/protection/restrictions/users", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "DELETE") - fmt.Fprint(w, `[]`) - }) - input := []string{"octocat"} - ctx := context.Background() - got, _, err := client.Repositories.RemoveUserRestrictions(ctx, "o", "r", "b", input) - if err != nil { - t.Errorf("Repositories.RemoveUserRestrictions returned error: %v", err) + const methodName = "AddTeamRestrictions" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.AddTeamRestrictions(ctx, "\n", "\n", "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.AddTeamRestrictions(ctx, "o", "r", test.branch, input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) + }) } - want := []*User{} - if !cmp.Equal(got, want) { - t.Errorf("Repositories.RemoveUserRestrictions returned %+v, want %+v", got, want) +} + +func TestRepositoriesService_RemoveTeamRestrictions(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection/restrictions/teams"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/restrictions/teams"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + fmt.Fprint(w, `[]`) + }) + input := []string{"octocat"} + ctx := context.Background() + got, _, err := client.Repositories.RemoveTeamRestrictions(ctx, "o", "r", test.branch, input) + if err != nil { + t.Errorf("Repositories.RemoveTeamRestrictions returned error: %v", err) + } + want := []*Team{} + if !cmp.Equal(got, want) { + t.Errorf("Repositories.RemoveTeamRestrictions returned %+v, want %+v", got, want) + } + + const methodName = "RemoveTeamRestrictions" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.RemoveTeamRestrictions(ctx, "\n", "\n", "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.RemoveTeamRestrictions(ctx, "o", "r", test.branch, input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) + }) } +} - const methodName = "RemoveUserRestrictions" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.RemoveUserRestrictions(ctx, "\n", "\n", "\n", input) - return err - }) +func TestRepositoriesService_ListUserRestrictions(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection/restrictions/users"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/restrictions/users"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + }) + + ctx := context.Background() + _, _, err := client.Repositories.ListUserRestrictions(ctx, "o", "r", test.branch) + if err != nil { + t.Errorf("Repositories.ListUserRestrictions returned error: %v", err) + } - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.RemoveUserRestrictions(ctx, "o", "r", "b", input) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) + const methodName = "ListUserRestrictions" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.ListUserRestrictions(ctx, "\n", "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.ListUserRestrictions(ctx, "o", "r", test.branch) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) + }) + } +} + +func TestRepositoriesService_ReplaceUserRestrictions(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection/restrictions/users"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/restrictions/users"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + fmt.Fprint(w, `[{ + "name": "octocat" + }]`) + }) + input := []string{"octocat"} + ctx := context.Background() + got, _, err := client.Repositories.ReplaceUserRestrictions(ctx, "o", "r", test.branch, input) + if err != nil { + t.Errorf("Repositories.ReplaceUserRestrictions returned error: %v", err) + } + want := []*User{ + {Name: String("octocat")}, + } + if !cmp.Equal(got, want) { + t.Errorf("Repositories.ReplaceUserRestrictions returned %+v, want %+v", got, want) + } + + const methodName = "ReplaceUserRestrictions" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.ReplaceUserRestrictions(ctx, "\n", "\n", "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.ReplaceUserRestrictions(ctx, "o", "r", test.branch, input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) + }) + } +} + +func TestRepositoriesService_AddUserRestrictions(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection/restrictions/users"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/restrictions/users"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + fmt.Fprint(w, `[{ + "name": "octocat" + }]`) + }) + input := []string{"octocat"} + ctx := context.Background() + got, _, err := client.Repositories.AddUserRestrictions(ctx, "o", "r", test.branch, input) + if err != nil { + t.Errorf("Repositories.AddUserRestrictions returned error: %v", err) + } + want := []*User{ + {Name: String("octocat")}, + } + if !cmp.Equal(got, want) { + t.Errorf("Repositories.AddUserRestrictions returned %+v, want %+v", got, want) + } + + const methodName = "AddUserRestrictions" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.AddUserRestrictions(ctx, "\n", "\n", "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.AddUserRestrictions(ctx, "o", "r", test.branch, input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) + }) + } +} + +func TestRepositoriesService_RemoveUserRestrictions(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection/restrictions/users"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/restrictions/users"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + fmt.Fprint(w, `[]`) + }) + input := []string{"octocat"} + ctx := context.Background() + got, _, err := client.Repositories.RemoveUserRestrictions(ctx, "o", "r", test.branch, input) + if err != nil { + t.Errorf("Repositories.RemoveUserRestrictions returned error: %v", err) + } + want := []*User{} + if !cmp.Equal(got, want) { + t.Errorf("Repositories.RemoveUserRestrictions returned %+v, want %+v", got, want) + } + + const methodName = "RemoveUserRestrictions" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.RemoveUserRestrictions(ctx, "\n", "\n", "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.RemoveUserRestrictions(ctx, "o", "r", test.branch, input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) + }) + } } func TestRepositoriesService_Transfer(t *testing.T) { From 74db58f49eff5459db2d512abdb2aa3075d93300 Mon Sep 17 00:00:00 2001 From: Anish Rajan Date: Thu, 5 Oct 2023 17:23:45 +0530 Subject: [PATCH 328/751] Add Repository Security Advisories APIs (#2902) Fixes: #2866. --- github/event_types.go | 45 +++-- github/github-accessors.go | 136 +++++++++++++++ github/github-accessors_test.go | 155 +++++++++++++++++ github/security_advisories.go | 83 +++++++++ github/security_advisories_test.go | 265 +++++++++++++++++++++++++++++ 5 files changed, 672 insertions(+), 12 deletions(-) diff --git a/github/event_types.go b/github/event_types.go index b3e58b3318f..e91d22686ff 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -1692,18 +1692,33 @@ type WorkflowRunEvent struct { // // GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#security_advisory type SecurityAdvisory struct { - CVSS *AdvisoryCVSS `json:"cvss,omitempty"` - CWEs []*AdvisoryCWEs `json:"cwes,omitempty"` - GHSAID *string `json:"ghsa_id,omitempty"` - Summary *string `json:"summary,omitempty"` - Description *string `json:"description,omitempty"` - Severity *string `json:"severity,omitempty"` - Identifiers []*AdvisoryIdentifier `json:"identifiers,omitempty"` - References []*AdvisoryReference `json:"references,omitempty"` - PublishedAt *Timestamp `json:"published_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - WithdrawnAt *Timestamp `json:"withdrawn_at,omitempty"` - Vulnerabilities []*AdvisoryVulnerability `json:"vulnerabilities,omitempty"` + CVSS *AdvisoryCVSS `json:"cvss,omitempty"` + CWEs []*AdvisoryCWEs `json:"cwes,omitempty"` + GHSAID *string `json:"ghsa_id,omitempty"` + Summary *string `json:"summary,omitempty"` + Description *string `json:"description,omitempty"` + Severity *string `json:"severity,omitempty"` + Identifiers []*AdvisoryIdentifier `json:"identifiers,omitempty"` + References []*AdvisoryReference `json:"references,omitempty"` + PublishedAt *Timestamp `json:"published_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + WithdrawnAt *Timestamp `json:"withdrawn_at,omitempty"` + Vulnerabilities []*AdvisoryVulnerability `json:"vulnerabilities,omitempty"` + CVEID *string `json:"cve_id,omitempty"` + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + Author *User `json:"author,omitempty"` + Publisher *User `json:"publisher,omitempty"` + State *string `json:"state,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + ClosedAt *Timestamp `json:"closed_at,omitempty"` + Submission *SecurityAdvisorySubmission `json:"submission,omitempty"` + CWEIDs []string `json:"cwe_ids,omitempty"` + Credits []*RepoAdvisoryCredit `json:"credits,omitempty"` + CreditsDetailed []*RepoAdvisoryCreditDetailed `json:"credits_detailed,omitempty"` + CollaboratingUsers []*User `json:"collaborating_users,omitempty"` + CollaboratingTeams []*Team `json:"collaborating_teams,omitempty"` + PrivateFork *Repository `json:"private_fork,omitempty"` } // AdvisoryIdentifier represents the identifier for a Security Advisory. @@ -1723,6 +1738,12 @@ type AdvisoryVulnerability struct { Severity *string `json:"severity,omitempty"` VulnerableVersionRange *string `json:"vulnerable_version_range,omitempty"` FirstPatchedVersion *FirstPatchedVersion `json:"first_patched_version,omitempty"` + + // PatchedVersions and VulnerableFunctions are used in the following APIs: + // - https://docs.github.com/en/rest/security-advisories/repository-advisories?apiVersion=2022-11-28#list-repository-security-advisories-for-an-organization + // - https://docs.github.com/en/rest/security-advisories/repository-advisories?apiVersion=2022-11-28#list-repository-security-advisories + PatchedVersions *string `json:"patched_versions,omitempty"` + VulnerableFunctions []string `json:"vulnerable_functions,omitempty"` } // VulnerabilityPackage represents the package object for an Advisory Vulnerability. diff --git a/github/github-accessors.go b/github/github-accessors.go index 8519de2de9d..a0e7a74366e 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -438,6 +438,14 @@ func (a *AdvisoryVulnerability) GetPackage() *VulnerabilityPackage { return a.Package } +// GetPatchedVersions returns the PatchedVersions field if it's non-nil, zero value otherwise. +func (a *AdvisoryVulnerability) GetPatchedVersions() string { + if a == nil || a.PatchedVersions == nil { + return "" + } + return *a.PatchedVersions +} + // GetSeverity returns the Severity field if it's non-nil, zero value otherwise. func (a *AdvisoryVulnerability) GetSeverity() string { if a == nil || a.Severity == nil { @@ -17886,6 +17894,46 @@ func (r *RenameOrgResponse) GetURL() string { return *r.URL } +// GetLogin returns the Login field if it's non-nil, zero value otherwise. +func (r *RepoAdvisoryCredit) GetLogin() string { + if r == nil || r.Login == nil { + return "" + } + return *r.Login +} + +// GetType returns the Type field if it's non-nil, zero value otherwise. +func (r *RepoAdvisoryCredit) GetType() string { + if r == nil || r.Type == nil { + return "" + } + return *r.Type +} + +// GetState returns the State field if it's non-nil, zero value otherwise. +func (r *RepoAdvisoryCreditDetailed) GetState() string { + if r == nil || r.State == nil { + return "" + } + return *r.State +} + +// GetType returns the Type field if it's non-nil, zero value otherwise. +func (r *RepoAdvisoryCreditDetailed) GetType() string { + if r == nil || r.Type == nil { + return "" + } + return *r.Type +} + +// GetUser returns the User field. +func (r *RepoAdvisoryCreditDetailed) GetUser() *User { + if r == nil { + return nil + } + return r.User +} + // GetDownloadLocation returns the DownloadLocation field if it's non-nil, zero value otherwise. func (r *RepoDependencies) GetDownloadLocation() string { if r == nil || r.DownloadLocation == nil { @@ -21214,6 +21262,38 @@ func (s *SecretScanningPushProtection) GetStatus() string { return *s.Status } +// GetAuthor returns the Author field. +func (s *SecurityAdvisory) GetAuthor() *User { + if s == nil { + return nil + } + return s.Author +} + +// GetClosedAt returns the ClosedAt field if it's non-nil, zero value otherwise. +func (s *SecurityAdvisory) GetClosedAt() Timestamp { + if s == nil || s.ClosedAt == nil { + return Timestamp{} + } + return *s.ClosedAt +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (s *SecurityAdvisory) GetCreatedAt() Timestamp { + if s == nil || s.CreatedAt == nil { + return Timestamp{} + } + return *s.CreatedAt +} + +// GetCVEID returns the CVEID field if it's non-nil, zero value otherwise. +func (s *SecurityAdvisory) GetCVEID() string { + if s == nil || s.CVEID == nil { + return "" + } + return *s.CVEID +} + // GetCVSS returns the CVSS field. func (s *SecurityAdvisory) GetCVSS() *AdvisoryCVSS { if s == nil { @@ -21238,6 +21318,22 @@ func (s *SecurityAdvisory) GetGHSAID() string { return *s.GHSAID } +// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. +func (s *SecurityAdvisory) GetHTMLURL() string { + if s == nil || s.HTMLURL == nil { + return "" + } + return *s.HTMLURL +} + +// GetPrivateFork returns the PrivateFork field. +func (s *SecurityAdvisory) GetPrivateFork() *Repository { + if s == nil { + return nil + } + return s.PrivateFork +} + // GetPublishedAt returns the PublishedAt field if it's non-nil, zero value otherwise. func (s *SecurityAdvisory) GetPublishedAt() Timestamp { if s == nil || s.PublishedAt == nil { @@ -21246,6 +21342,14 @@ func (s *SecurityAdvisory) GetPublishedAt() Timestamp { return *s.PublishedAt } +// GetPublisher returns the Publisher field. +func (s *SecurityAdvisory) GetPublisher() *User { + if s == nil { + return nil + } + return s.Publisher +} + // GetSeverity returns the Severity field if it's non-nil, zero value otherwise. func (s *SecurityAdvisory) GetSeverity() string { if s == nil || s.Severity == nil { @@ -21254,6 +21358,22 @@ func (s *SecurityAdvisory) GetSeverity() string { return *s.Severity } +// GetState returns the State field if it's non-nil, zero value otherwise. +func (s *SecurityAdvisory) GetState() string { + if s == nil || s.State == nil { + return "" + } + return *s.State +} + +// GetSubmission returns the Submission field. +func (s *SecurityAdvisory) GetSubmission() *SecurityAdvisorySubmission { + if s == nil { + return nil + } + return s.Submission +} + // GetSummary returns the Summary field if it's non-nil, zero value otherwise. func (s *SecurityAdvisory) GetSummary() string { if s == nil || s.Summary == nil { @@ -21270,6 +21390,14 @@ func (s *SecurityAdvisory) GetUpdatedAt() Timestamp { return *s.UpdatedAt } +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (s *SecurityAdvisory) GetURL() string { + if s == nil || s.URL == nil { + return "" + } + return *s.URL +} + // GetWithdrawnAt returns the WithdrawnAt field if it's non-nil, zero value otherwise. func (s *SecurityAdvisory) GetWithdrawnAt() Timestamp { if s == nil || s.WithdrawnAt == nil { @@ -21334,6 +21462,14 @@ func (s *SecurityAdvisoryEvent) GetSender() *User { return s.Sender } +// GetAccepted returns the Accepted field if it's non-nil, zero value otherwise. +func (s *SecurityAdvisorySubmission) GetAccepted() bool { + if s == nil || s.Accepted == nil { + return false + } + return *s.Accepted +} + // GetAdvancedSecurity returns the AdvancedSecurity field. func (s *SecurityAndAnalysis) GetAdvancedSecurity() *AdvancedSecurity { if s == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index c3e02988ae7..9b3c36fd9bc 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -503,6 +503,16 @@ func TestAdvisoryVulnerability_GetPackage(tt *testing.T) { a.GetPackage() } +func TestAdvisoryVulnerability_GetPatchedVersions(tt *testing.T) { + var zeroValue string + a := &AdvisoryVulnerability{PatchedVersions: &zeroValue} + a.GetPatchedVersions() + a = &AdvisoryVulnerability{} + a.GetPatchedVersions() + a = nil + a.GetPatchedVersions() +} + func TestAdvisoryVulnerability_GetSeverity(tt *testing.T) { var zeroValue string a := &AdvisoryVulnerability{Severity: &zeroValue} @@ -20723,6 +20733,53 @@ func TestRenameOrgResponse_GetURL(tt *testing.T) { r.GetURL() } +func TestRepoAdvisoryCredit_GetLogin(tt *testing.T) { + var zeroValue string + r := &RepoAdvisoryCredit{Login: &zeroValue} + r.GetLogin() + r = &RepoAdvisoryCredit{} + r.GetLogin() + r = nil + r.GetLogin() +} + +func TestRepoAdvisoryCredit_GetType(tt *testing.T) { + var zeroValue string + r := &RepoAdvisoryCredit{Type: &zeroValue} + r.GetType() + r = &RepoAdvisoryCredit{} + r.GetType() + r = nil + r.GetType() +} + +func TestRepoAdvisoryCreditDetailed_GetState(tt *testing.T) { + var zeroValue string + r := &RepoAdvisoryCreditDetailed{State: &zeroValue} + r.GetState() + r = &RepoAdvisoryCreditDetailed{} + r.GetState() + r = nil + r.GetState() +} + +func TestRepoAdvisoryCreditDetailed_GetType(tt *testing.T) { + var zeroValue string + r := &RepoAdvisoryCreditDetailed{Type: &zeroValue} + r.GetType() + r = &RepoAdvisoryCreditDetailed{} + r.GetType() + r = nil + r.GetType() +} + +func TestRepoAdvisoryCreditDetailed_GetUser(tt *testing.T) { + r := &RepoAdvisoryCreditDetailed{} + r.GetUser() + r = nil + r.GetUser() +} + func TestRepoDependencies_GetDownloadLocation(tt *testing.T) { var zeroValue string r := &RepoDependencies{DownloadLocation: &zeroValue} @@ -24691,6 +24748,43 @@ func TestSecretScanningPushProtection_GetStatus(tt *testing.T) { s.GetStatus() } +func TestSecurityAdvisory_GetAuthor(tt *testing.T) { + s := &SecurityAdvisory{} + s.GetAuthor() + s = nil + s.GetAuthor() +} + +func TestSecurityAdvisory_GetClosedAt(tt *testing.T) { + var zeroValue Timestamp + s := &SecurityAdvisory{ClosedAt: &zeroValue} + s.GetClosedAt() + s = &SecurityAdvisory{} + s.GetClosedAt() + s = nil + s.GetClosedAt() +} + +func TestSecurityAdvisory_GetCreatedAt(tt *testing.T) { + var zeroValue Timestamp + s := &SecurityAdvisory{CreatedAt: &zeroValue} + s.GetCreatedAt() + s = &SecurityAdvisory{} + s.GetCreatedAt() + s = nil + s.GetCreatedAt() +} + +func TestSecurityAdvisory_GetCVEID(tt *testing.T) { + var zeroValue string + s := &SecurityAdvisory{CVEID: &zeroValue} + s.GetCVEID() + s = &SecurityAdvisory{} + s.GetCVEID() + s = nil + s.GetCVEID() +} + func TestSecurityAdvisory_GetCVSS(tt *testing.T) { s := &SecurityAdvisory{} s.GetCVSS() @@ -24718,6 +24812,23 @@ func TestSecurityAdvisory_GetGHSAID(tt *testing.T) { s.GetGHSAID() } +func TestSecurityAdvisory_GetHTMLURL(tt *testing.T) { + var zeroValue string + s := &SecurityAdvisory{HTMLURL: &zeroValue} + s.GetHTMLURL() + s = &SecurityAdvisory{} + s.GetHTMLURL() + s = nil + s.GetHTMLURL() +} + +func TestSecurityAdvisory_GetPrivateFork(tt *testing.T) { + s := &SecurityAdvisory{} + s.GetPrivateFork() + s = nil + s.GetPrivateFork() +} + func TestSecurityAdvisory_GetPublishedAt(tt *testing.T) { var zeroValue Timestamp s := &SecurityAdvisory{PublishedAt: &zeroValue} @@ -24728,6 +24839,13 @@ func TestSecurityAdvisory_GetPublishedAt(tt *testing.T) { s.GetPublishedAt() } +func TestSecurityAdvisory_GetPublisher(tt *testing.T) { + s := &SecurityAdvisory{} + s.GetPublisher() + s = nil + s.GetPublisher() +} + func TestSecurityAdvisory_GetSeverity(tt *testing.T) { var zeroValue string s := &SecurityAdvisory{Severity: &zeroValue} @@ -24738,6 +24856,23 @@ func TestSecurityAdvisory_GetSeverity(tt *testing.T) { s.GetSeverity() } +func TestSecurityAdvisory_GetState(tt *testing.T) { + var zeroValue string + s := &SecurityAdvisory{State: &zeroValue} + s.GetState() + s = &SecurityAdvisory{} + s.GetState() + s = nil + s.GetState() +} + +func TestSecurityAdvisory_GetSubmission(tt *testing.T) { + s := &SecurityAdvisory{} + s.GetSubmission() + s = nil + s.GetSubmission() +} + func TestSecurityAdvisory_GetSummary(tt *testing.T) { var zeroValue string s := &SecurityAdvisory{Summary: &zeroValue} @@ -24758,6 +24893,16 @@ func TestSecurityAdvisory_GetUpdatedAt(tt *testing.T) { s.GetUpdatedAt() } +func TestSecurityAdvisory_GetURL(tt *testing.T) { + var zeroValue string + s := &SecurityAdvisory{URL: &zeroValue} + s.GetURL() + s = &SecurityAdvisory{} + s.GetURL() + s = nil + s.GetURL() +} + func TestSecurityAdvisory_GetWithdrawnAt(tt *testing.T) { var zeroValue Timestamp s := &SecurityAdvisory{WithdrawnAt: &zeroValue} @@ -24820,6 +24965,16 @@ func TestSecurityAdvisoryEvent_GetSender(tt *testing.T) { s.GetSender() } +func TestSecurityAdvisorySubmission_GetAccepted(tt *testing.T) { + var zeroValue bool + s := &SecurityAdvisorySubmission{Accepted: &zeroValue} + s.GetAccepted() + s = &SecurityAdvisorySubmission{} + s.GetAccepted() + s = nil + s.GetAccepted() +} + func TestSecurityAndAnalysis_GetAdvancedSecurity(tt *testing.T) { s := &SecurityAndAnalysis{} s.GetAdvancedSecurity() diff --git a/github/security_advisories.go b/github/security_advisories.go index a75fce54d95..681d0cd4bd5 100644 --- a/github/security_advisories.go +++ b/github/security_advisories.go @@ -12,6 +12,41 @@ import ( type SecurityAdvisoriesService service +// SecurityAdvisorySubmission represents the Security Advisory Submission. +type SecurityAdvisorySubmission struct { + // Accepted represents whether a private vulnerability report was accepted by the repository's administrators. + Accepted *bool `json:"accepted,omitempty"` +} + +// RepoAdvisoryCredit represents the credit object for a repository Security Advisory. +type RepoAdvisoryCredit struct { + Login *string `json:"login,omitempty"` + Type *string `json:"type,omitempty"` +} + +// RepoAdvisoryCreditDetailed represents a credit given to a user for a repository Security Advisory. +type RepoAdvisoryCreditDetailed struct { + User *User `json:"user,omitempty"` + Type *string `json:"type,omitempty"` + State *string `json:"state,omitempty"` +} + +// ListRepositorySecurityAdvisoriesOptions specifies the optional parameters to list the repository security advisories. +type ListRepositorySecurityAdvisoriesOptions struct { + ListCursorOptions + + // Direction in which to sort advisories. Possible values are: asc, desc. + // Default is "asc". + Direction string `url:"direction,omitempty"` + + // Sort specifies how to sort advisories. Possible values are: created, updated, + // and published. Default value is "created". + Sort string `url:"sort,omitempty"` + + // State filters advisories based on their state. Possible values are: triage, draft, published, closed. + State string `url:"state,omitempty"` +} + // RequestCVE requests a Common Vulnerabilities and Exposures (CVE) for a repository security advisory. // The ghsaID is the GitHub Security Advisory identifier of the advisory. // @@ -35,3 +70,51 @@ func (s *SecurityAdvisoriesService) RequestCVE(ctx context.Context, owner, repo, return resp, nil } + +// ListRepositorySecurityAdvisoriesForOrg lists the repository security advisories for an organization. +// +// GitHub API docs: https://docs.github.com/en/rest/security-advisories/repository-advisories?apiVersion=2022-11-28#list-repository-security-advisories-for-an-organization +func (s *SecurityAdvisoriesService) ListRepositorySecurityAdvisoriesForOrg(ctx context.Context, org string, opt *ListRepositorySecurityAdvisoriesOptions) ([]*SecurityAdvisory, *Response, error) { + url := fmt.Sprintf("orgs/%v/security-advisories", org) + url, err := addOptions(url, opt) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", url, nil) + if err != nil { + return nil, nil, err + } + + var advisories []*SecurityAdvisory + resp, err := s.client.Do(ctx, req, &advisories) + if err != nil { + return nil, resp, err + } + + return advisories, resp, nil +} + +// ListRepositorySecurityAdvisories lists the security advisories in a repository. +// +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/security-advisories/repository-advisories?apiVersion=2022-11-28#list-repository-security-advisories +func (s *SecurityAdvisoriesService) ListRepositorySecurityAdvisories(ctx context.Context, owner, repo string, opt *ListRepositorySecurityAdvisoriesOptions) ([]*SecurityAdvisory, *Response, error) { + url := fmt.Sprintf("repos/%v/%v/security-advisories", owner, repo) + url, err := addOptions(url, opt) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", url, nil) + if err != nil { + return nil, nil, err + } + + var advisories []*SecurityAdvisory + resp, err := s.client.Do(ctx, req, &advisories) + if err != nil { + return nil, resp, err + } + + return advisories, resp, nil +} diff --git a/github/security_advisories_test.go b/github/security_advisories_test.go index e4a6fbd7c14..5476ef6138f 100644 --- a/github/security_advisories_test.go +++ b/github/security_advisories_test.go @@ -8,7 +8,10 @@ package github import ( "context" "net/http" + "strings" "testing" + + "github.com/google/go-cmp/cmp" ) func TestSecurityAdvisoriesService_RequestCVE(t *testing.T) { @@ -50,3 +53,265 @@ func TestSecurityAdvisoriesService_RequestCVE(t *testing.T) { return resp, err }) } + +func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisoriesForOrg_BadRequest(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/security-advisories", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + + http.Error(w, "Bad Request", 400) + }) + + ctx := context.Background() + advisories, resp, err := client.SecurityAdvisories.ListRepositorySecurityAdvisoriesForOrg(ctx, "o", nil) + if err == nil { + t.Errorf("Expected HTTP 400 response") + } + if got, want := resp.Response.StatusCode, http.StatusBadRequest; got != want { + t.Errorf("ListRepositorySecurityAdvisoriesForOrg return status %d, want %d", got, want) + } + if advisories != nil { + t.Errorf("ListRepositorySecurityAdvisoriesForOrg return %+v, want nil", advisories) + } +} + +func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisoriesForOrg_NotFound(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/security-advisories", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + + query := r.URL.Query() + if query.Get("state") != "draft" { + t.Errorf("ListRepositorySecurityAdvisoriesForOrg returned %+v, want %+v", query.Get("state"), "draft") + } + + http.NotFound(w, r) + }) + + ctx := context.Background() + advisories, resp, err := client.SecurityAdvisories.ListRepositorySecurityAdvisoriesForOrg(ctx, "o", &ListRepositorySecurityAdvisoriesOptions{ + State: "draft", + }) + if err == nil { + t.Errorf("Expected HTTP 404 response") + } + if got, want := resp.Response.StatusCode, http.StatusNotFound; got != want { + t.Errorf("ListRepositorySecurityAdvisoriesForOrg return status %d, want %d", got, want) + } + if advisories != nil { + t.Errorf("ListRepositorySecurityAdvisoriesForOrg return %+v, want nil", advisories) + } +} + +func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisoriesForOrg_UnmarshalError(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/security-advisories", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + + w.WriteHeader(http.StatusOK) + assertWrite(t, w, []byte(`[{"ghsa_id": 12334354}]`)) + }) + + ctx := context.Background() + advisories, resp, err := client.SecurityAdvisories.ListRepositorySecurityAdvisoriesForOrg(ctx, "o", nil) + if err == nil { + t.Errorf("Expected unmarshal error") + } else if !strings.Contains(err.Error(), "json: cannot unmarshal number into Go struct field SecurityAdvisory.ghsa_id of type string") { + t.Errorf("ListRepositorySecurityAdvisoriesForOrg returned unexpected error: %v", err) + } + if got, want := resp.Response.StatusCode, http.StatusOK; got != want { + t.Errorf("ListRepositorySecurityAdvisoriesForOrg return status %d, want %d", got, want) + } + if advisories != nil { + t.Errorf("ListRepositorySecurityAdvisoriesForOrg return %+v, want nil", advisories) + } +} + +func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisoriesForOrg(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/security-advisories", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + + w.WriteHeader(http.StatusOK) + assertWrite(t, w, []byte(`[ + { + "ghsa_id": "GHSA-abcd-1234-efgh", + "cve_id": "CVE-2050-00000" + } + ]`)) + }) + + ctx := context.Background() + advisories, resp, err := client.SecurityAdvisories.ListRepositorySecurityAdvisoriesForOrg(ctx, "o", nil) + if err != nil { + t.Errorf("ListRepositorySecurityAdvisoriesForOrg returned error: %v, want nil", err) + } + if got, want := resp.Response.StatusCode, http.StatusOK; got != want { + t.Errorf("ListRepositorySecurityAdvisoriesForOrg return status %d, want %d", got, want) + } + + want := []*SecurityAdvisory{ + { + GHSAID: String("GHSA-abcd-1234-efgh"), + CVEID: String("CVE-2050-00000"), + }, + } + if !cmp.Equal(advisories, want) { + t.Errorf("ListRepositorySecurityAdvisoriesForOrg returned %+v, want %+v", advisories, want) + } + + methodName := "ListRepositorySecurityAdvisoriesForOrg" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.SecurityAdvisories.ListRepositorySecurityAdvisoriesForOrg(ctx, "\n", &ListRepositorySecurityAdvisoriesOptions{ + Sort: "\n", + }) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.SecurityAdvisories.ListRepositorySecurityAdvisoriesForOrg(ctx, "o", nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisories_BadRequest(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/security-advisories", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + + http.Error(w, "Bad Request", 400) + }) + + ctx := context.Background() + advisories, resp, err := client.SecurityAdvisories.ListRepositorySecurityAdvisories(ctx, "o", "r", nil) + if err == nil { + t.Errorf("Expected HTTP 400 response") + } + if got, want := resp.Response.StatusCode, http.StatusBadRequest; got != want { + t.Errorf("ListRepositorySecurityAdvisories return status %d, want %d", got, want) + } + if advisories != nil { + t.Errorf("ListRepositorySecurityAdvisories return %+v, want nil", advisories) + } +} + +func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisories_NotFound(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/security-advisories", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + + query := r.URL.Query() + if query.Get("state") != "draft" { + t.Errorf("ListRepositorySecurityAdvisories returned %+v, want %+v", query.Get("state"), "draft") + } + + http.NotFound(w, r) + }) + + ctx := context.Background() + advisories, resp, err := client.SecurityAdvisories.ListRepositorySecurityAdvisories(ctx, "o", "r", &ListRepositorySecurityAdvisoriesOptions{ + State: "draft", + }) + if err == nil { + t.Errorf("Expected HTTP 404 response") + } + if got, want := resp.Response.StatusCode, http.StatusNotFound; got != want { + t.Errorf("ListRepositorySecurityAdvisories return status %d, want %d", got, want) + } + if advisories != nil { + t.Errorf("ListRepositorySecurityAdvisories return %+v, want nil", advisories) + } +} + +func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisories_UnmarshalError(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/security-advisories", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + + w.WriteHeader(http.StatusOK) + assertWrite(t, w, []byte(`[{"ghsa_id": 12334354}]`)) + }) + + ctx := context.Background() + advisories, resp, err := client.SecurityAdvisories.ListRepositorySecurityAdvisories(ctx, "o", "r", nil) + if err == nil { + t.Errorf("Expected unmarshal error") + } else if !strings.Contains(err.Error(), "json: cannot unmarshal number into Go struct field SecurityAdvisory.ghsa_id of type string") { + t.Errorf("ListRepositorySecurityAdvisories returned unexpected error: %v", err) + } + if got, want := resp.Response.StatusCode, http.StatusOK; got != want { + t.Errorf("ListRepositorySecurityAdvisories return status %d, want %d", got, want) + } + if advisories != nil { + t.Errorf("ListRepositorySecurityAdvisories return %+v, want nil", advisories) + } +} + +func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisories(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/security-advisories", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + + w.WriteHeader(http.StatusOK) + assertWrite(t, w, []byte(`[ + { + "ghsa_id": "GHSA-abcd-1234-efgh", + "cve_id": "CVE-2050-00000" + } + ]`)) + }) + + ctx := context.Background() + advisories, resp, err := client.SecurityAdvisories.ListRepositorySecurityAdvisories(ctx, "o", "r", nil) + if err != nil { + t.Errorf("ListRepositorySecurityAdvisories returned error: %v, want nil", err) + } + if got, want := resp.Response.StatusCode, http.StatusOK; got != want { + t.Errorf("ListRepositorySecurityAdvisories return status %d, want %d", got, want) + } + + want := []*SecurityAdvisory{ + { + GHSAID: String("GHSA-abcd-1234-efgh"), + CVEID: String("CVE-2050-00000"), + }, + } + if !cmp.Equal(advisories, want) { + t.Errorf("ListRepositorySecurityAdvisories returned %+v, want %+v", advisories, want) + } + + methodName := "ListRepositorySecurityAdvisories" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.SecurityAdvisories.ListRepositorySecurityAdvisories(ctx, "\n", "\n", &ListRepositorySecurityAdvisoriesOptions{ + Sort: "\n", + }) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.SecurityAdvisories.ListRepositorySecurityAdvisories(ctx, "o", "r", nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} From f8c16b85c03b20c979787e1d01336517dbd1b6e1 Mon Sep 17 00:00:00 2001 From: WillAbides <233500+WillAbides@users.noreply.github.com> Date: Mon, 9 Oct 2023 06:56:57 -0500 Subject: [PATCH 329/751] Create MarkdownService, EmojisService, CodesOfConductService and MetaService (#2937) Fixes: #2936. --- github/codesofconduct.go | 81 ++++++++ github/codesofconduct_test.go | 117 +++++++++++ github/emojis.go | 37 ++++ github/emojis_test.go | 45 +++++ github/examples_test.go | 4 +- github/github.go | 8 + github/markdown.go | 67 +++++++ github/markdown_test.go | 80 ++++++++ github/meta.go | 146 ++++++++++++++ github/meta_test.go | 155 +++++++++++++++ github/misc.go | 247 ----------------------- github/misc_test.go | 356 ---------------------------------- test/integration/misc_test.go | 16 +- 13 files changed, 746 insertions(+), 613 deletions(-) create mode 100644 github/codesofconduct.go create mode 100644 github/codesofconduct_test.go create mode 100644 github/emojis.go create mode 100644 github/emojis_test.go create mode 100644 github/markdown.go create mode 100644 github/markdown_test.go create mode 100644 github/meta.go create mode 100644 github/meta_test.go delete mode 100644 github/misc.go delete mode 100644 github/misc_test.go diff --git a/github/codesofconduct.go b/github/codesofconduct.go new file mode 100644 index 00000000000..4318ba56d2c --- /dev/null +++ b/github/codesofconduct.go @@ -0,0 +1,81 @@ +// Copyright 2023 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" +) + +// CodesOfConductService provides access to code-of-conduct-related functions in the GitHub API. +type CodesOfConductService service + +// CodeOfConduct represents a code of conduct. +type CodeOfConduct struct { + Name *string `json:"name,omitempty"` + Key *string `json:"key,omitempty"` + URL *string `json:"url,omitempty"` + Body *string `json:"body,omitempty"` +} + +func (c *CodeOfConduct) String() string { + return Stringify(c) +} + +// List returns all codes of conduct. +// +// GitHub API docs: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-all-codes-of-conduct +func (s *CodesOfConductService) List(ctx context.Context) ([]*CodeOfConduct, *Response, error) { + req, err := s.client.NewRequest("GET", "codes_of_conduct", nil) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept header when this API fully launches. + req.Header.Set("Accept", mediaTypeCodesOfConductPreview) + + var cs []*CodeOfConduct + resp, err := s.client.Do(ctx, req, &cs) + if err != nil { + return nil, resp, err + } + + return cs, resp, nil +} + +// ListCodesOfConduct +// Deprecated: Use CodesOfConductService.List instead +func (c *Client) ListCodesOfConduct(ctx context.Context) ([]*CodeOfConduct, *Response, error) { + return c.CodesOfConduct.List(ctx) +} + +// Get returns an individual code of conduct. +// +// GitHub API docs: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-a-code-of-conduct +func (s *CodesOfConductService) Get(ctx context.Context, key string) (*CodeOfConduct, *Response, error) { + u := fmt.Sprintf("codes_of_conduct/%s", key) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept header when this API fully launches. + req.Header.Set("Accept", mediaTypeCodesOfConductPreview) + + coc := new(CodeOfConduct) + resp, err := s.client.Do(ctx, req, coc) + if err != nil { + return nil, resp, err + } + + return coc, resp, nil +} + +// GetCodeOfConduct +// Deprecated: Use CodesOfConductService.Get instead +func (c *Client) GetCodeOfConduct(ctx context.Context, key string) (*CodeOfConduct, *Response, error) { + return c.CodesOfConduct.Get(ctx, key) +} diff --git a/github/codesofconduct_test.go b/github/codesofconduct_test.go new file mode 100644 index 00000000000..71ef31f7afd --- /dev/null +++ b/github/codesofconduct_test.go @@ -0,0 +1,117 @@ +// Copyright 2023 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 TestCodesOfConductService_List(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/codes_of_conduct", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testHeader(t, r, "Accept", mediaTypeCodesOfConductPreview) + fmt.Fprint(w, `[{ + "key": "key", + "name": "name", + "url": "url"} + ]`) + }) + + ctx := context.Background() + cs, _, err := client.ListCodesOfConduct(ctx) + assertNilError(t, err) + + want := []*CodeOfConduct{ + { + Key: String("key"), + Name: String("name"), + URL: String("url"), + }} + if !cmp.Equal(want, cs) { + t.Errorf("returned %+v, want %+v", cs, want) + } + + const methodName = "List" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.CodesOfConduct.List(ctx) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestCodesOfConductService_Get(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/codes_of_conduct/k", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testHeader(t, r, "Accept", mediaTypeCodesOfConductPreview) + fmt.Fprint(w, `{ + "key": "key", + "name": "name", + "url": "url", + "body": "body"}`, + ) + }) + + ctx := context.Background() + coc, _, err := client.GetCodeOfConduct(ctx, "k") + assertNilError(t, err) + + want := &CodeOfConduct{ + Key: String("key"), + Name: String("name"), + URL: String("url"), + Body: String("body"), + } + if !cmp.Equal(want, coc) { + t.Errorf("returned %+v, want %+v", coc, want) + } + + const methodName = "Get" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.CodesOfConduct.Get(ctx, "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.CodesOfConduct.Get(ctx, "k") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestCodeOfConduct_Marshal(t *testing.T) { + testJSONMarshal(t, &CodeOfConduct{}, "{}") + + a := &CodeOfConduct{ + Name: String("name"), + Key: String("key"), + URL: String("url"), + Body: String("body"), + } + + want := `{ + "name": "name", + "key": "key", + "url": "url", + "body": "body" + }` + + testJSONMarshal(t, a, want) +} diff --git a/github/emojis.go b/github/emojis.go new file mode 100644 index 00000000000..15b57130b3b --- /dev/null +++ b/github/emojis.go @@ -0,0 +1,37 @@ +// Copyright 2023 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" +) + +// EmojisService provides access to emoji-related functions in the GitHub API. +type EmojisService service + +// List returns the emojis available to use on GitHub. +// +// GitHub API docs: https://docs.github.com/rest/emojis/emojis#get-emojis +func (s *EmojisService) List(ctx context.Context) (map[string]string, *Response, error) { + req, err := s.client.NewRequest("GET", "emojis", nil) + if err != nil { + return nil, nil, err + } + + var emoji map[string]string + resp, err := s.client.Do(ctx, req, &emoji) + if err != nil { + return nil, resp, err + } + + return emoji, resp, nil +} + +// ListEmojis +// Deprecated: Use EmojisService.List instead +func (c *Client) ListEmojis(ctx context.Context) (map[string]string, *Response, error) { + return c.Emojis.List(ctx) +} diff --git a/github/emojis_test.go b/github/emojis_test.go new file mode 100644 index 00000000000..79c890e36d1 --- /dev/null +++ b/github/emojis_test.go @@ -0,0 +1,45 @@ +// Copyright 2023 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 TestEmojisService_List(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/emojis", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"+1": "+1.png"}`) + }) + + ctx := context.Background() + emoji, _, err := client.ListEmojis(ctx) + if err != nil { + t.Errorf("List returned error: %v", err) + } + + want := map[string]string{"+1": "+1.png"} + if !cmp.Equal(want, emoji) { + t.Errorf("List returned %+v, want %+v", emoji, want) + } + + const methodName = "List" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Emojis.List(ctx) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} diff --git a/github/examples_test.go b/github/examples_test.go index a2147bf417f..4aca86218fa 100644 --- a/github/examples_test.go +++ b/github/examples_test.go @@ -15,14 +15,14 @@ import ( "github.com/google/go-github/v55/github" ) -func ExampleClient_Markdown() { +func ExampleMarkdownService_Render() { client := github.NewClient(nil) input := "# heading #\n\nLink to issue #1" opt := &github.MarkdownOptions{Mode: "gfm", Context: "google/go-github"} ctx := context.Background() - output, _, err := client.Markdown(ctx, input, opt) + output, _, err := client.Markdown.Render(ctx, input, opt) if err != nil { fmt.Println(err) } diff --git a/github/github.go b/github/github.go index dace1184719..519f3f31a37 100644 --- a/github/github.go +++ b/github/github.go @@ -183,9 +183,11 @@ type Client struct { Billing *BillingService Checks *ChecksService CodeScanning *CodeScanningService + CodesOfConduct *CodesOfConductService Codespaces *CodespacesService Dependabot *DependabotService DependencyGraph *DependencyGraphService + Emojis *EmojisService Enterprise *EnterpriseService Gists *GistsService Git *GitService @@ -194,7 +196,9 @@ type Client struct { IssueImport *IssueImportService Issues *IssuesService Licenses *LicensesService + Markdown *MarkdownService Marketplace *MarketplaceService + Meta *MetaService Migrations *MigrationService Organizations *OrganizationsService Projects *ProjectsService @@ -401,8 +405,10 @@ func (c *Client) initialize() { c.Checks = (*ChecksService)(&c.common) c.CodeScanning = (*CodeScanningService)(&c.common) c.Codespaces = (*CodespacesService)(&c.common) + c.CodesOfConduct = (*CodesOfConductService)(&c.common) c.Dependabot = (*DependabotService)(&c.common) c.DependencyGraph = (*DependencyGraphService)(&c.common) + c.Emojis = (*EmojisService)(&c.common) c.Enterprise = (*EnterpriseService)(&c.common) c.Gists = (*GistsService)(&c.common) c.Git = (*GitService)(&c.common) @@ -411,7 +417,9 @@ func (c *Client) initialize() { c.IssueImport = (*IssueImportService)(&c.common) c.Issues = (*IssuesService)(&c.common) c.Licenses = (*LicensesService)(&c.common) + c.Markdown = (*MarkdownService)(&c.common) c.Marketplace = &MarketplaceService{client: c} + c.Meta = (*MetaService)(&c.common) c.Migrations = (*MigrationService)(&c.common) c.Organizations = (*OrganizationsService)(&c.common) c.Projects = (*ProjectsService)(&c.common) diff --git a/github/markdown.go b/github/markdown.go new file mode 100644 index 00000000000..48b445b3d85 --- /dev/null +++ b/github/markdown.go @@ -0,0 +1,67 @@ +// Copyright 2023 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 ( + "bytes" + "context" +) + +// MarkdownService provides access to markdown-related functions in the GitHub API. +type MarkdownService service + +// MarkdownOptions specifies optional parameters to the Render method. +type MarkdownOptions struct { + // Mode identifies the rendering mode. Possible values are: + // markdown - render a document as plain Render, just like + // README files are rendered. + // + // gfm - to render a document as user-content, e.g. like user + // comments or issues are rendered. In GFM mode, hard line breaks are + // always taken into account, and issue and user mentions are linked + // accordingly. + // + // Default is "markdown". + Mode string + + // Context identifies the repository context. Only taken into account + // when rendering as "gfm". + Context string +} + +type markdownRenderRequest struct { + Text *string `json:"text,omitempty"` + Mode *string `json:"mode,omitempty"` + Context *string `json:"context,omitempty"` +} + +// Render renders an arbitrary Render document. +// +// GitHub API docs: https://docs.github.com/rest/markdown/markdown#render-a-markdown-document +func (s *MarkdownService) Render(ctx context.Context, text string, opts *MarkdownOptions) (string, *Response, error) { + request := &markdownRenderRequest{Text: String(text)} + if opts != nil { + if opts.Mode != "" { + request.Mode = String(opts.Mode) + } + if opts.Context != "" { + request.Context = String(opts.Context) + } + } + + req, err := s.client.NewRequest("POST", "markdown", request) + if err != nil { + return "", nil, err + } + + buf := new(bytes.Buffer) + resp, err := s.client.Do(ctx, req, buf) + if err != nil { + return "", resp, err + } + + return buf.String(), resp, nil +} diff --git a/github/markdown_test.go b/github/markdown_test.go new file mode 100644 index 00000000000..2b6e7eee48e --- /dev/null +++ b/github/markdown_test.go @@ -0,0 +1,80 @@ +// Copyright 2023 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 TestMarkdownService_Markdown(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + input := &markdownRenderRequest{ + Text: String("# text #"), + Mode: String("gfm"), + Context: String("google/go-github"), + } + mux.HandleFunc("/markdown", func(w http.ResponseWriter, r *http.Request) { + v := new(markdownRenderRequest) + assertNilError(t, 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, `

    text

    `) + }) + + ctx := context.Background() + md, _, err := client.Markdown.Render(ctx, "# text #", &MarkdownOptions{ + Mode: "gfm", + Context: "google/go-github", + }) + if err != nil { + t.Errorf("Render returned error: %v", err) + } + + if want := "

    text

    "; want != md { + t.Errorf("Render returned %+v, want %+v", md, want) + } + + const methodName = "Render" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Markdown.Render(ctx, "# text #", &MarkdownOptions{ + Mode: "gfm", + Context: "google/go-github", + }) + if got != "" { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestMarkdownRenderRequest_Marshal(t *testing.T) { + testJSONMarshal(t, &markdownRenderRequest{}, "{}") + + a := &markdownRenderRequest{ + Text: String("txt"), + Mode: String("mode"), + Context: String("ctx"), + } + + want := `{ + "text": "txt", + "mode": "mode", + "context": "ctx" + }` + + testJSONMarshal(t, a, want) +} diff --git a/github/meta.go b/github/meta.go new file mode 100644 index 00000000000..a4d9bac77b4 --- /dev/null +++ b/github/meta.go @@ -0,0 +1,146 @@ +// Copyright 2014 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 ( + "bytes" + "context" + "fmt" + "net/url" +) + +// MetaService provides access to functions in the GitHub API that GitHub categorizes as "meta". +type MetaService service + +// APIMeta represents metadata about the GitHub API. +type APIMeta struct { + // An Array of IP addresses in CIDR format specifying the addresses + // that incoming service hooks will originate from on GitHub.com. + Hooks []string `json:"hooks,omitempty"` + + // An Array of IP addresses in CIDR format specifying the Git servers + // for GitHub.com. + Git []string `json:"git,omitempty"` + + // Whether authentication with username and password is supported. + // (GitHub Enterprise instances using CAS or OAuth for authentication + // will return false. Features like Basic Authentication with a + // username and password, sudo mode, and two-factor authentication are + // not supported on these servers.) + VerifiablePasswordAuthentication *bool `json:"verifiable_password_authentication,omitempty"` + + // An array of IP addresses in CIDR format specifying the addresses + // which serve GitHub Pages websites. + Pages []string `json:"pages,omitempty"` + + // An Array of IP addresses specifying the addresses that source imports + // will originate from on GitHub.com. + Importer []string `json:"importer,omitempty"` + + // An array of IP addresses in CIDR format specifying the IP addresses + // GitHub Actions will originate from. + Actions []string `json:"actions,omitempty"` + + // An array of IP addresses in CIDR format specifying the IP addresses + // Dependabot will originate from. + Dependabot []string `json:"dependabot,omitempty"` + + // A map of algorithms to SSH key fingerprints. + SSHKeyFingerprints map[string]string `json:"ssh_key_fingerprints,omitempty"` + + // An array of SSH keys. + SSHKeys []string `json:"ssh_keys,omitempty"` + + // An array of IP addresses in CIDR format specifying the addresses + // which serve GitHub websites. + Web []string `json:"web,omitempty"` + + // An array of IP addresses in CIDR format specifying the addresses + // which serve GitHub APIs. + API []string `json:"api,omitempty"` +} + +// Get returns information about GitHub.com, the service. Or, if you access +// this endpoint on your organization’s GitHub Enterprise installation, this +// endpoint provides information about that installation. +// +// GitHub API docs: https://docs.github.com/rest/meta/meta#get-github-meta-information +func (s *MetaService) Get(ctx context.Context) (*APIMeta, *Response, error) { + req, err := s.client.NewRequest("GET", "meta", nil) + if err != nil { + return nil, nil, err + } + + meta := new(APIMeta) + resp, err := s.client.Do(ctx, req, meta) + if err != nil { + return nil, resp, err + } + + return meta, resp, nil +} + +// APIMeta +// Deprecated: Use MetaService.Get instead. +func (c *Client) APIMeta(ctx context.Context) (*APIMeta, *Response, error) { + return c.Meta.Get(ctx) +} + +// Octocat returns an ASCII art octocat with the specified message in a speech +// bubble. If message is empty, a random zen phrase is used. +// +// GitHub API docs: https://docs.github.com/rest/meta/meta#get-octocat +func (s *MetaService) Octocat(ctx context.Context, message string) (string, *Response, error) { + u := "octocat" + if message != "" { + u = fmt.Sprintf("%s?s=%s", u, url.QueryEscape(message)) + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return "", nil, err + } + + buf := new(bytes.Buffer) + resp, err := s.client.Do(ctx, req, buf) + if err != nil { + return "", resp, err + } + + return buf.String(), resp, nil +} + +// Octocat +// Deprecated: Use MetaService.Octocat instead. +func (c *Client) Octocat(ctx context.Context, message string) (string, *Response, error) { + return c.Meta.Octocat(ctx, message) +} + +// Zen returns a random line from The Zen of GitHub. +// +// See also: http://warpspire.com/posts/taste/ +// +// GitHub API docs: https://docs.github.com/rest/meta/meta#get-the-zen-of-github +func (s *MetaService) Zen(ctx context.Context) (string, *Response, error) { + req, err := s.client.NewRequest("GET", "zen", nil) + if err != nil { + return "", nil, err + } + + buf := new(bytes.Buffer) + resp, err := s.client.Do(ctx, req, buf) + if err != nil { + return "", resp, err + } + + return buf.String(), resp, nil +} + +// Zen +// Deprecated: Use MetaService.Zen instead. +func (c *Client) Zen(ctx context.Context) (string, *Response, error) { + return c.Meta.Zen(ctx) +} diff --git a/github/meta_test.go b/github/meta_test.go new file mode 100644 index 00000000000..c7b01e298ed --- /dev/null +++ b/github/meta_test.go @@ -0,0 +1,155 @@ +// Copyright 2014 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 TestAPIMeta_Marshal(t *testing.T) { + testJSONMarshal(t, &APIMeta{}, "{}") + + a := &APIMeta{ + Hooks: []string{"h"}, + Git: []string{"g"}, + VerifiablePasswordAuthentication: Bool(true), + Pages: []string{"p"}, + Importer: []string{"i"}, + Actions: []string{"a"}, + Dependabot: []string{"d"}, + SSHKeyFingerprints: map[string]string{"a": "f"}, + SSHKeys: []string{"k"}, + API: []string{"a"}, + Web: []string{"w"}, + } + want := `{ + "hooks":["h"], + "git":["g"], + "verifiable_password_authentication":true, + "pages":["p"], + "importer":["i"], + "actions":["a"], + "dependabot":["d"], + "ssh_key_fingerprints":{"a":"f"}, + "ssh_keys":["k"], + "api":["a"], + "web":["w"] + }` + + testJSONMarshal(t, a, want) +} + +func TestMetaService_Get(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/meta", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"web":["w"],"api":["a"],"hooks":["h"], "git":["g"], "pages":["p"], "importer":["i"], "actions":["a"], "dependabot":["d"], "verifiable_password_authentication": true}`) + }) + + ctx := context.Background() + meta, _, err := client.Meta.Get(ctx) + if err != nil { + t.Errorf("Get returned error: %v", err) + } + + want := &APIMeta{ + Hooks: []string{"h"}, + Git: []string{"g"}, + Pages: []string{"p"}, + Importer: []string{"i"}, + Actions: []string{"a"}, + Dependabot: []string{"d"}, + API: []string{"a"}, + Web: []string{"w"}, + + VerifiablePasswordAuthentication: Bool(true), + } + if !cmp.Equal(want, meta) { + t.Errorf("Get returned %+v, want %+v", meta, want) + } + + const methodName = "Get" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Meta.Get(ctx) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestMetaService_Octocat(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + input := "input" + output := "sample text" + + mux.HandleFunc("/octocat", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{"s": input}) + w.Header().Set("Content-Type", "application/octocat-stream") + fmt.Fprint(w, output) + }) + + ctx := context.Background() + got, _, err := client.Meta.Octocat(ctx, input) + if err != nil { + t.Errorf("Octocat returned error: %v", err) + } + + if want := output; got != want { + t.Errorf("Octocat returned %+v, want %+v", got, want) + } + + const methodName = "Octocat" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Meta.Octocat(ctx, input) + if got != "" { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestMetaService_Zen(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + output := "sample text" + + mux.HandleFunc("/zen", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + w.Header().Set("Content-Type", "text/plain;charset=utf-8") + fmt.Fprint(w, output) + }) + + ctx := context.Background() + got, _, err := client.Meta.Zen(ctx) + if err != nil { + t.Errorf("Zen returned error: %v", err) + } + + if want := output; got != want { + t.Errorf("Zen returned %+v, want %+v", got, want) + } + + const methodName = "Zen" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Meta.Zen(ctx) + if got != "" { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} diff --git a/github/misc.go b/github/misc.go deleted file mode 100644 index a01b716fa23..00000000000 --- a/github/misc.go +++ /dev/null @@ -1,247 +0,0 @@ -// Copyright 2014 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 ( - "bytes" - "context" - "fmt" - "net/url" -) - -// MarkdownOptions specifies optional parameters to the Markdown method. -type MarkdownOptions struct { - // Mode identifies the rendering mode. Possible values are: - // markdown - render a document as plain Markdown, just like - // README files are rendered. - // - // gfm - to render a document as user-content, e.g. like user - // comments or issues are rendered. In GFM mode, hard line breaks are - // always taken into account, and issue and user mentions are linked - // accordingly. - // - // Default is "markdown". - Mode string - - // Context identifies the repository context. Only taken into account - // when rendering as "gfm". - Context string -} - -type markdownRequest struct { - Text *string `json:"text,omitempty"` - Mode *string `json:"mode,omitempty"` - Context *string `json:"context,omitempty"` -} - -// Markdown renders an arbitrary Markdown document. -// -// GitHub API docs: https://docs.github.com/en/rest/markdown/ -func (c *Client) Markdown(ctx context.Context, text string, opts *MarkdownOptions) (string, *Response, error) { - request := &markdownRequest{Text: String(text)} - if opts != nil { - if opts.Mode != "" { - request.Mode = String(opts.Mode) - } - if opts.Context != "" { - request.Context = String(opts.Context) - } - } - - req, err := c.NewRequest("POST", "markdown", request) - if err != nil { - return "", nil, err - } - - buf := new(bytes.Buffer) - resp, err := c.Do(ctx, req, buf) - if err != nil { - return "", resp, err - } - - return buf.String(), resp, nil -} - -// ListEmojis returns the emojis available to use on GitHub. -// -// GitHub API docs: https://docs.github.com/en/rest/emojis/ -func (c *Client) ListEmojis(ctx context.Context) (map[string]string, *Response, error) { - req, err := c.NewRequest("GET", "emojis", nil) - if err != nil { - return nil, nil, err - } - - var emoji map[string]string - resp, err := c.Do(ctx, req, &emoji) - if err != nil { - return nil, resp, err - } - - return emoji, resp, nil -} - -// CodeOfConduct represents a code of conduct. -type CodeOfConduct struct { - Name *string `json:"name,omitempty"` - Key *string `json:"key,omitempty"` - URL *string `json:"url,omitempty"` - Body *string `json:"body,omitempty"` -} - -func (c *CodeOfConduct) String() string { - return Stringify(c) -} - -// ListCodesOfConduct returns all codes of conduct. -// -// GitHub API docs: https://docs.github.com/en/rest/codes_of_conduct/#list-all-codes-of-conduct -func (c *Client) ListCodesOfConduct(ctx context.Context) ([]*CodeOfConduct, *Response, error) { - req, err := c.NewRequest("GET", "codes_of_conduct", nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeCodesOfConductPreview) - - var cs []*CodeOfConduct - resp, err := c.Do(ctx, req, &cs) - if err != nil { - return nil, resp, err - } - - return cs, resp, nil -} - -// GetCodeOfConduct returns an individual code of conduct. -// -// https://docs.github.com/en/rest/codes_of_conduct/#get-an-individual-code-of-conduct -func (c *Client) GetCodeOfConduct(ctx context.Context, key string) (*CodeOfConduct, *Response, error) { - u := fmt.Sprintf("codes_of_conduct/%s", key) - req, err := c.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeCodesOfConductPreview) - - coc := new(CodeOfConduct) - resp, err := c.Do(ctx, req, coc) - if err != nil { - return nil, resp, err - } - - return coc, resp, nil -} - -// APIMeta represents metadata about the GitHub API. -type APIMeta struct { - // An Array of IP addresses in CIDR format specifying the addresses - // that incoming service hooks will originate from on GitHub.com. - Hooks []string `json:"hooks,omitempty"` - - // An Array of IP addresses in CIDR format specifying the Git servers - // for GitHub.com. - Git []string `json:"git,omitempty"` - - // Whether authentication with username and password is supported. - // (GitHub Enterprise instances using CAS or OAuth for authentication - // will return false. Features like Basic Authentication with a - // username and password, sudo mode, and two-factor authentication are - // not supported on these servers.) - VerifiablePasswordAuthentication *bool `json:"verifiable_password_authentication,omitempty"` - - // An array of IP addresses in CIDR format specifying the addresses - // which serve GitHub Pages websites. - Pages []string `json:"pages,omitempty"` - - // An Array of IP addresses specifying the addresses that source imports - // will originate from on GitHub.com. - Importer []string `json:"importer,omitempty"` - - // An array of IP addresses in CIDR format specifying the IP addresses - // GitHub Actions will originate from. - Actions []string `json:"actions,omitempty"` - - // An array of IP addresses in CIDR format specifying the IP addresses - // Dependabot will originate from. - Dependabot []string `json:"dependabot,omitempty"` - - // A map of algorithms to SSH key fingerprints. - SSHKeyFingerprints map[string]string `json:"ssh_key_fingerprints,omitempty"` - - // An array of SSH keys. - SSHKeys []string `json:"ssh_keys,omitempty"` - - // An array of IP addresses in CIDR format specifying the addresses - // which serve GitHub websites. - Web []string `json:"web,omitempty"` - - // An array of IP addresses in CIDR format specifying the addresses - // which serve GitHub APIs. - API []string `json:"api,omitempty"` -} - -// APIMeta returns information about GitHub.com, the service. Or, if you access -// this endpoint on your organization’s GitHub Enterprise installation, this -// endpoint provides information about that installation. -// -// GitHub API docs: https://docs.github.com/en/rest/meta#get-github-meta-information -func (c *Client) APIMeta(ctx context.Context) (*APIMeta, *Response, error) { - req, err := c.NewRequest("GET", "meta", nil) - if err != nil { - return nil, nil, err - } - - meta := new(APIMeta) - resp, err := c.Do(ctx, req, meta) - if err != nil { - return nil, resp, err - } - - return meta, resp, nil -} - -// Octocat returns an ASCII art octocat with the specified message in a speech -// bubble. If message is empty, a random zen phrase is used. -func (c *Client) Octocat(ctx context.Context, message string) (string, *Response, error) { - u := "octocat" - if message != "" { - u = fmt.Sprintf("%s?s=%s", u, url.QueryEscape(message)) - } - - req, err := c.NewRequest("GET", u, nil) - if err != nil { - return "", nil, err - } - - buf := new(bytes.Buffer) - resp, err := c.Do(ctx, req, buf) - if err != nil { - return "", resp, err - } - - return buf.String(), resp, nil -} - -// Zen returns a random line from The Zen of GitHub. -// -// see also: http://warpspire.com/posts/taste/ -func (c *Client) Zen(ctx context.Context) (string, *Response, error) { - req, err := c.NewRequest("GET", "zen", nil) - if err != nil { - return "", nil, err - } - - buf := new(bytes.Buffer) - resp, err := c.Do(ctx, req, buf) - if err != nil { - return "", resp, err - } - - return buf.String(), resp, nil -} diff --git a/github/misc_test.go b/github/misc_test.go deleted file mode 100644 index 45c99893812..00000000000 --- a/github/misc_test.go +++ /dev/null @@ -1,356 +0,0 @@ -// Copyright 2014 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 TestMarkdown(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - input := &markdownRequest{ - Text: String("# text #"), - Mode: String("gfm"), - Context: String("google/go-github"), - } - mux.HandleFunc("/markdown", func(w http.ResponseWriter, r *http.Request) { - v := new(markdownRequest) - assertNilError(t, 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, `

    text

    `) - }) - - ctx := context.Background() - md, _, err := client.Markdown(ctx, "# text #", &MarkdownOptions{ - Mode: "gfm", - Context: "google/go-github", - }) - if err != nil { - t.Errorf("Markdown returned error: %v", err) - } - - if want := "

    text

    "; want != md { - t.Errorf("Markdown returned %+v, want %+v", md, want) - } - - const methodName = "Markdown" - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Markdown(ctx, "# text #", &MarkdownOptions{ - Mode: "gfm", - Context: "google/go-github", - }) - if got != "" { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestListEmojis(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - mux.HandleFunc("/emojis", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - fmt.Fprint(w, `{"+1": "+1.png"}`) - }) - - ctx := context.Background() - emoji, _, err := client.ListEmojis(ctx) - if err != nil { - t.Errorf("ListEmojis returned error: %v", err) - } - - want := map[string]string{"+1": "+1.png"} - if !cmp.Equal(want, emoji) { - t.Errorf("ListEmojis returned %+v, want %+v", emoji, want) - } - - const methodName = "ListEmojis" - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.ListEmojis(ctx) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestListCodesOfConduct(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - mux.HandleFunc("/codes_of_conduct", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - testHeader(t, r, "Accept", mediaTypeCodesOfConductPreview) - fmt.Fprint(w, `[{ - "key": "key", - "name": "name", - "url": "url"} - ]`) - }) - - ctx := context.Background() - cs, _, err := client.ListCodesOfConduct(ctx) - if err != nil { - t.Errorf("ListCodesOfConduct returned error: %v", err) - } - - want := []*CodeOfConduct{ - { - Key: String("key"), - Name: String("name"), - URL: String("url"), - }} - if !cmp.Equal(want, cs) { - t.Errorf("ListCodesOfConduct returned %+v, want %+v", cs, want) - } - - const methodName = "ListCodesOfConduct" - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.ListCodesOfConduct(ctx) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestGetCodeOfConduct(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - mux.HandleFunc("/codes_of_conduct/k", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - testHeader(t, r, "Accept", mediaTypeCodesOfConductPreview) - fmt.Fprint(w, `{ - "key": "key", - "name": "name", - "url": "url", - "body": "body"}`, - ) - }) - - ctx := context.Background() - coc, _, err := client.GetCodeOfConduct(ctx, "k") - if err != nil { - t.Errorf("ListCodesOfConduct returned error: %v", err) - } - - want := &CodeOfConduct{ - Key: String("key"), - Name: String("name"), - URL: String("url"), - Body: String("body"), - } - if !cmp.Equal(want, coc) { - t.Errorf("GetCodeOfConductByKey returned %+v, want %+v", coc, want) - } - - const methodName = "GetCodeOfConduct" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.GetCodeOfConduct(ctx, "\n") - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.GetCodeOfConduct(ctx, "k") - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestAPIMeta_Marshal(t *testing.T) { - testJSONMarshal(t, &APIMeta{}, "{}") - - a := &APIMeta{ - Hooks: []string{"h"}, - Git: []string{"g"}, - VerifiablePasswordAuthentication: Bool(true), - Pages: []string{"p"}, - Importer: []string{"i"}, - Actions: []string{"a"}, - Dependabot: []string{"d"}, - SSHKeyFingerprints: map[string]string{"a": "f"}, - SSHKeys: []string{"k"}, - API: []string{"a"}, - Web: []string{"w"}, - } - want := `{ - "hooks":["h"], - "git":["g"], - "verifiable_password_authentication":true, - "pages":["p"], - "importer":["i"], - "actions":["a"], - "dependabot":["d"], - "ssh_key_fingerprints":{"a":"f"}, - "ssh_keys":["k"], - "api":["a"], - "web":["w"] - }` - - testJSONMarshal(t, a, want) -} - -func TestAPIMeta(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - mux.HandleFunc("/meta", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - fmt.Fprint(w, `{"web":["w"],"api":["a"],"hooks":["h"], "git":["g"], "pages":["p"], "importer":["i"], "actions":["a"], "dependabot":["d"], "verifiable_password_authentication": true}`) - }) - - ctx := context.Background() - meta, _, err := client.APIMeta(ctx) - if err != nil { - t.Errorf("APIMeta returned error: %v", err) - } - - want := &APIMeta{ - Hooks: []string{"h"}, - Git: []string{"g"}, - Pages: []string{"p"}, - Importer: []string{"i"}, - Actions: []string{"a"}, - Dependabot: []string{"d"}, - API: []string{"a"}, - Web: []string{"w"}, - - VerifiablePasswordAuthentication: Bool(true), - } - if !cmp.Equal(want, meta) { - t.Errorf("APIMeta returned %+v, want %+v", meta, want) - } - - const methodName = "APIMeta" - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.APIMeta(ctx) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestOctocat(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - input := "input" - output := "sample text" - - mux.HandleFunc("/octocat", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - testFormValues(t, r, values{"s": input}) - w.Header().Set("Content-Type", "application/octocat-stream") - fmt.Fprint(w, output) - }) - - ctx := context.Background() - got, _, err := client.Octocat(ctx, input) - if err != nil { - t.Errorf("Octocat returned error: %v", err) - } - - if want := output; got != want { - t.Errorf("Octocat returned %+v, want %+v", got, want) - } - - const methodName = "Octocat" - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Octocat(ctx, input) - if got != "" { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestZen(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - output := "sample text" - - mux.HandleFunc("/zen", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - w.Header().Set("Content-Type", "text/plain;charset=utf-8") - fmt.Fprint(w, output) - }) - - ctx := context.Background() - got, _, err := client.Zen(ctx) - if err != nil { - t.Errorf("Zen returned error: %v", err) - } - - if want := output; got != want { - t.Errorf("Zen returned %+v, want %+v", got, want) - } - - const methodName = "Zen" - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Zen(ctx) - if got != "" { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestMarkdownRequest_Marshal(t *testing.T) { - testJSONMarshal(t, &markdownRequest{}, "{}") - - a := &markdownRequest{ - Text: String("txt"), - Mode: String("mode"), - Context: String("ctx"), - } - - want := `{ - "text": "txt", - "mode": "mode", - "context": "ctx" - }` - - testJSONMarshal(t, a, want) -} - -func TestCodeOfConduct_Marshal(t *testing.T) { - testJSONMarshal(t, &CodeOfConduct{}, "{}") - - a := &CodeOfConduct{ - Name: String("name"), - Key: String("key"), - URL: String("url"), - Body: String("body"), - } - - want := `{ - "name": "name", - "key": "key", - "url": "url", - "body": "body" - }` - - testJSONMarshal(t, a, want) -} diff --git a/test/integration/misc_test.go b/test/integration/misc_test.go index e0cee29bf07..6ffb163fdcd 100644 --- a/test/integration/misc_test.go +++ b/test/integration/misc_test.go @@ -15,32 +15,32 @@ import ( ) func TestEmojis(t *testing.T) { - emoji, _, err := client.ListEmojis(context.Background()) + emoji, _, err := client.Emojis.List(context.Background()) if err != nil { - t.Fatalf("ListEmojis returned error: %v", err) + t.Fatalf("List returned error: %v", err) } if len(emoji) == 0 { - t.Errorf("ListEmojis returned no emojis") + t.Errorf("List returned no emojis") } if _, ok := emoji["+1"]; !ok { - t.Errorf("ListEmojis missing '+1' emoji") + t.Errorf("List missing '+1' emoji") } } func TestAPIMeta(t *testing.T) { - meta, _, err := client.APIMeta(context.Background()) + meta, _, err := client.Meta.Get(context.Background()) if err != nil { - t.Fatalf("APIMeta returned error: %v", err) + t.Fatalf("Get returned error: %v", err) } if len(meta.Hooks) == 0 { - t.Errorf("APIMeta returned no hook addresses") + t.Errorf("Get returned no hook addresses") } if len(meta.Git) == 0 { - t.Errorf("APIMeta returned no git addresses") + t.Errorf("Get returned no git addresses") } if !*meta.VerifiablePasswordAuthentication { From a1e8b0ec3b4b625d40a7526d51bfdab27e3eabc1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Oct 2023 17:36:00 -0400 Subject: [PATCH 330/751] Bump golang.org/x/net from 0.15.0 to 0.16.0 in /scrape (#2954) --- scrape/go.mod | 2 +- scrape/go.sum | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 9b70258ff76..0bb9f38ecac 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -7,5 +7,5 @@ require ( github.com/google/go-cmp v0.5.9 github.com/google/go-github/v55 v55.0.0 github.com/xlzd/gotp v0.1.0 - golang.org/x/net v0.15.0 + golang.org/x/net v0.16.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index 7db3e4418ea..4a8cc6b0911 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -23,8 +23,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= -golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= -golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= +golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -35,8 +35,8 @@ golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= -golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= +golang.org/x/net v0.16.0 h1:7eBu7KsSvFDtSXUIDbh3aqlK4DPsZ1rByC8PFfBThos= +golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -52,15 +52,15 @@ golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= -golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= From 77b5b3d9efd8336a03180031a0764aa9dabdc98f Mon Sep 17 00:00:00 2001 From: Jasper <62405708+brekelj1@users.noreply.github.com> Date: Tue, 10 Oct 2023 08:39:46 +1100 Subject: [PATCH 331/751] Add prevent_self_review on repo environments (#2951) --- github/github-accessors.go | 16 ++++++++++++++++ github/github-accessors_test.go | 20 ++++++++++++++++++++ github/repos_environments.go | 12 +++++++----- 3 files changed, 43 insertions(+), 5 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index a0e7a74366e..78a184e6c80 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -4838,6 +4838,14 @@ func (c *CreateUpdateEnvironment) GetDeploymentBranchPolicy() *BranchPolicy { return c.DeploymentBranchPolicy } +// GetPreventSelfReview returns the PreventSelfReview field if it's non-nil, zero value otherwise. +func (c *CreateUpdateEnvironment) GetPreventSelfReview() bool { + if c == nil || c.PreventSelfReview == nil { + return false + } + return *c.PreventSelfReview +} + // GetWaitTimer returns the WaitTimer field if it's non-nil, zero value otherwise. func (c *CreateUpdateEnvironment) GetWaitTimer() int { if c == nil || c.WaitTimer == nil { @@ -15534,6 +15542,14 @@ func (p *ProtectionRule) GetNodeID() string { return *p.NodeID } +// GetPreventSelfReview returns the PreventSelfReview field if it's non-nil, zero value otherwise. +func (p *ProtectionRule) GetPreventSelfReview() bool { + if p == nil || p.PreventSelfReview == nil { + return false + } + return *p.PreventSelfReview +} + // GetType returns the Type field if it's non-nil, zero value otherwise. func (p *ProtectionRule) GetType() string { if p == nil || p.Type == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 9b3c36fd9bc..54c89eb9876 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -5712,6 +5712,16 @@ func TestCreateUpdateEnvironment_GetDeploymentBranchPolicy(tt *testing.T) { c.GetDeploymentBranchPolicy() } +func TestCreateUpdateEnvironment_GetPreventSelfReview(tt *testing.T) { + var zeroValue bool + c := &CreateUpdateEnvironment{PreventSelfReview: &zeroValue} + c.GetPreventSelfReview() + c = &CreateUpdateEnvironment{} + c.GetPreventSelfReview() + c = nil + c.GetPreventSelfReview() +} + func TestCreateUpdateEnvironment_GetWaitTimer(tt *testing.T) { var zeroValue int c := &CreateUpdateEnvironment{WaitTimer: &zeroValue} @@ -18047,6 +18057,16 @@ func TestProtectionRule_GetNodeID(tt *testing.T) { p.GetNodeID() } +func TestProtectionRule_GetPreventSelfReview(tt *testing.T) { + var zeroValue bool + p := &ProtectionRule{PreventSelfReview: &zeroValue} + p.GetPreventSelfReview() + p = &ProtectionRule{} + p.GetPreventSelfReview() + p = nil + p.GetPreventSelfReview() +} + func TestProtectionRule_GetType(tt *testing.T) { var zeroValue string p := &ProtectionRule{Type: &zeroValue} diff --git a/github/repos_environments.go b/github/repos_environments.go index 2399a42c746..e22ca5cd1be 100644 --- a/github/repos_environments.go +++ b/github/repos_environments.go @@ -52,11 +52,12 @@ type EnvResponse struct { // ProtectionRule represents a single protection rule applied to the environment. type ProtectionRule struct { - ID *int64 `json:"id,omitempty"` - NodeID *string `json:"node_id,omitempty"` - Type *string `json:"type,omitempty"` - WaitTimer *int `json:"wait_timer,omitempty"` - Reviewers []*RequiredReviewer `json:"reviewers,omitempty"` + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + PreventSelfReview *bool `json:"prevent_self_review,omitempty"` + Type *string `json:"type,omitempty"` + WaitTimer *int `json:"wait_timer,omitempty"` + Reviewers []*RequiredReviewer `json:"reviewers,omitempty"` } // RequiredReviewer represents a required reviewer. @@ -173,6 +174,7 @@ type CreateUpdateEnvironment struct { Reviewers []*EnvReviewers `json:"reviewers"` CanAdminsBypass *bool `json:"can_admins_bypass"` DeploymentBranchPolicy *BranchPolicy `json:"deployment_branch_policy"` + PreventSelfReview *bool `json:"prevent_self_review,omitempty"` } // createUpdateEnvironmentNoEnterprise represents the fields accepted for Pro/Teams private repos. From fb8f20f8fc6ef16f06d40a1b730a4abd3cc6caa5 Mon Sep 17 00:00:00 2001 From: Lachlan Cooper Date: Wed, 11 Oct 2023 05:10:51 +1100 Subject: [PATCH 332/751] Support options for GetCodeownersErrors (#2953) Fixes: #2952. --- github/repos_codeowners.go | 15 ++++++- github/repos_codeowners_test.go | 71 +++++++++++++++++++++++++++++++-- 2 files changed, 81 insertions(+), 5 deletions(-) diff --git a/github/repos_codeowners.go b/github/repos_codeowners.go index 835d56e164c..1c3f78abd9b 100644 --- a/github/repos_codeowners.go +++ b/github/repos_codeowners.go @@ -10,6 +10,14 @@ import ( "fmt" ) +// GetCodeownersErrorsOptions specifies the optional parameters to the +// RepositoriesService.GetCodeownersErrors method. +type GetCodeownersErrorsOptions struct { + // A branch, tag or commit name used to determine which version of the CODEOWNERS file to use. + // Default: the repository's default branch (e.g. main). + Ref string `url:"ref,omitempty"` +} + // CodeownersErrors represents a list of syntax errors detected in the CODEOWNERS file. type CodeownersErrors struct { Errors []*CodeownersError `json:"errors"` @@ -29,8 +37,13 @@ type CodeownersError struct { // 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) { +func (s *RepositoriesService) GetCodeownersErrors(ctx context.Context, owner, repo string, opts *GetCodeownersErrorsOptions) (*CodeownersErrors, *Response, error) { u := fmt.Sprintf("repos/%v/%v/codeowners/errors", owner, repo) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err diff --git a/github/repos_codeowners_test.go b/github/repos_codeowners_test.go index 62c58c5b192..84f0ee462bb 100644 --- a/github/repos_codeowners_test.go +++ b/github/repos_codeowners_test.go @@ -14,7 +14,7 @@ import ( "github.com/google/go-cmp/cmp" ) -func TestRepositoriesService_GetCodeownersErrors(t *testing.T) { +func TestRepositoriesService_GetCodeownersErrors_noRef(t *testing.T) { client, mux, _, teardown := setup() defer teardown() @@ -38,7 +38,7 @@ func TestRepositoriesService_GetCodeownersErrors(t *testing.T) { }) ctx := context.Background() - codeownersErrors, _, err := client.Repositories.GetCodeownersErrors(ctx, "o", "r") + codeownersErrors, _, err := client.Repositories.GetCodeownersErrors(ctx, "o", "r", nil) if err != nil { t.Errorf("Repositories.GetCodeownersErrors returned error: %v", err) } @@ -62,12 +62,75 @@ func TestRepositoriesService_GetCodeownersErrors(t *testing.T) { const methodName = "GetCodeownersErrors" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.GetCodeownersErrors(ctx, "\n", "\n") + _, _, err = client.Repositories.GetCodeownersErrors(ctx, "\n", "\n", nil) return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.GetCodeownersErrors(ctx, "o", "r") + got, resp, err := client.Repositories.GetCodeownersErrors(ctx, "o", "r", nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestRepositoriesService_GetCodeownersErrors_specificRef(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) + testFormValues(t, r, values{"ref": "mybranch"}) + 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" + } + ] + } + `) + }) + + opts := &GetCodeownersErrorsOptions{Ref: "mybranch"} + ctx := context.Background() + codeownersErrors, _, err := client.Repositories.GetCodeownersErrors(ctx, "o", "r", opts) + 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", opts) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.GetCodeownersErrors(ctx, "o", "r", opts) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } From 9f746fad4bb1eb295f5b7e625a9c632ca243fbd2 Mon Sep 17 00:00:00 2001 From: Dion Gionet Mallet Date: Wed, 11 Oct 2023 08:47:58 -0400 Subject: [PATCH 333/751] Add type field to DeploymentBranchPolicy (#2957) Fixes: #2956. --- github/github-accessors.go | 16 +++++++++++++++ github/github-accessors_test.go | 20 +++++++++++++++++++ github/repos_deployment_branch_policies.go | 2 ++ .../repos_deployment_branch_policies_test.go | 6 +++--- 4 files changed, 41 insertions(+), 3 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 78a184e6c80..199c9b8a37d 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -5582,6 +5582,14 @@ func (d *DeploymentBranchPolicy) GetNodeID() string { return *d.NodeID } +// GetType returns the Type field if it's non-nil, zero value otherwise. +func (d *DeploymentBranchPolicy) GetType() string { + if d == nil || d.Type == nil { + return "" + } + return *d.Type +} + // GetName returns the Name field if it's non-nil, zero value otherwise. func (d *DeploymentBranchPolicyRequest) GetName() string { if d == nil || d.Name == nil { @@ -5590,6 +5598,14 @@ func (d *DeploymentBranchPolicyRequest) GetName() string { return *d.Name } +// GetType returns the Type field if it's non-nil, zero value otherwise. +func (d *DeploymentBranchPolicyRequest) GetType() string { + if d == nil || d.Type == nil { + return "" + } + return *d.Type +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (d *DeploymentBranchPolicyResponse) GetTotalCount() int { if d == nil || d.TotalCount == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 54c89eb9876..d179a927750 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -6570,6 +6570,16 @@ func TestDeploymentBranchPolicy_GetNodeID(tt *testing.T) { d.GetNodeID() } +func TestDeploymentBranchPolicy_GetType(tt *testing.T) { + var zeroValue string + d := &DeploymentBranchPolicy{Type: &zeroValue} + d.GetType() + d = &DeploymentBranchPolicy{} + d.GetType() + d = nil + d.GetType() +} + func TestDeploymentBranchPolicyRequest_GetName(tt *testing.T) { var zeroValue string d := &DeploymentBranchPolicyRequest{Name: &zeroValue} @@ -6580,6 +6590,16 @@ func TestDeploymentBranchPolicyRequest_GetName(tt *testing.T) { d.GetName() } +func TestDeploymentBranchPolicyRequest_GetType(tt *testing.T) { + var zeroValue string + d := &DeploymentBranchPolicyRequest{Type: &zeroValue} + d.GetType() + d = &DeploymentBranchPolicyRequest{} + d.GetType() + d = nil + d.GetType() +} + func TestDeploymentBranchPolicyResponse_GetTotalCount(tt *testing.T) { var zeroValue int d := &DeploymentBranchPolicyResponse{TotalCount: &zeroValue} diff --git a/github/repos_deployment_branch_policies.go b/github/repos_deployment_branch_policies.go index 8c4628b39bc..32bf72ccab5 100644 --- a/github/repos_deployment_branch_policies.go +++ b/github/repos_deployment_branch_policies.go @@ -15,6 +15,7 @@ type DeploymentBranchPolicy struct { Name *string `json:"name,omitempty"` ID *int64 `json:"id,omitempty"` NodeID *string `json:"node_id,omitempty"` + Type *string `json:"type,omitempty"` } // DeploymentBranchPolicyResponse represents the slightly different format of response that comes back when you list deployment branch policies. @@ -26,6 +27,7 @@ type DeploymentBranchPolicyResponse struct { // DeploymentBranchPolicyRequest represents a deployment branch policy request. type DeploymentBranchPolicyRequest struct { Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` } // ListDeploymentBranchPolicies lists the deployment branch policies for an environment. diff --git a/github/repos_deployment_branch_policies_test.go b/github/repos_deployment_branch_policies_test.go index 69bffac86ed..9d2acd199d3 100644 --- a/github/repos_deployment_branch_policies_test.go +++ b/github/repos_deployment_branch_policies_test.go @@ -83,16 +83,16 @@ func TestRepositoriesService_CreateDeploymentBranchPolicy(t *testing.T) { mux.HandleFunc("/repos/o/r/environments/e/deployment-branch-policies", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") - fmt.Fprint(w, `{"id":1}`) + fmt.Fprint(w, `{"id":1, "type":"branch"}`) }) ctx := context.Background() - got, _, err := client.Repositories.CreateDeploymentBranchPolicy(ctx, "o", "r", "e", &DeploymentBranchPolicyRequest{Name: String("n")}) + got, _, err := client.Repositories.CreateDeploymentBranchPolicy(ctx, "o", "r", "e", &DeploymentBranchPolicyRequest{Name: String("n"), Type: String("branch")}) if err != nil { t.Errorf("Repositories.CreateDeploymentBranchPolicy returned error: %v", err) } - want := &DeploymentBranchPolicy{ID: Int64(1)} + want := &DeploymentBranchPolicy{ID: Int64(1), Type: String("branch")} if !reflect.DeepEqual(got, want) { t.Errorf("Repositories.CreateDeploymentBranchPolicy = %+v, want %+v", got, want) } From 2efd7ddf633bcc05e4967cf601d4eb6c2f65f1e8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Oct 2023 19:07:49 -0400 Subject: [PATCH 334/751] Bump golang.org/x/net from 0.16.0 to 0.17.0 in /scrape (#2958) --- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 0bb9f38ecac..54ba62c13d7 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -7,5 +7,5 @@ require ( github.com/google/go-cmp v0.5.9 github.com/google/go-github/v55 v55.0.0 github.com/xlzd/gotp v0.1.0 - golang.org/x/net v0.16.0 + golang.org/x/net v0.17.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index 4a8cc6b0911..e2a573f53f8 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -35,8 +35,8 @@ golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.16.0 h1:7eBu7KsSvFDtSXUIDbh3aqlK4DPsZ1rByC8PFfBThos= -golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= From 05ea56229977602a87946e0ea7bad837889a5cd6 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Wed, 11 Oct 2023 19:33:33 -0400 Subject: [PATCH 335/751] Bump golang.org/x/net from 0.10.0 to 0.17.0 in /example (#2960) Fixes: #2959. --- example/go.mod | 8 ++++---- example/go.sum | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/example/go.mod b/example/go.mod index 7f7c9ededaa..b89ac02e06a 100644 --- a/example/go.mod +++ b/example/go.mod @@ -7,8 +7,8 @@ require ( github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-ratelimit v1.0.3 github.com/google/go-github/v55 v55.0.0 - golang.org/x/crypto v0.12.0 - golang.org/x/term v0.11.0 + golang.org/x/crypto v0.14.0 + golang.org/x/term v0.13.0 google.golang.org/appengine v1.6.7 ) @@ -18,8 +18,8 @@ require ( github.com/golang/protobuf v1.5.2 // indirect github.com/google/go-github/v41 v41.0.0 // indirect github.com/google/go-querystring v1.1.0 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/sys v0.11.0 // indirect + golang.org/x/net v0.17.0 // indirect + golang.org/x/sys v0.13.0 // indirect google.golang.org/protobuf v1.28.0 // indirect ) diff --git a/example/go.sum b/example/go.sum index 7b1a57e73c8..2c16d048c2f 100644 --- a/example/go.sum +++ b/example/go.sum @@ -28,8 +28,8 @@ golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= -golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= +golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= @@ -39,8 +39,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -54,15 +54,15 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.11.0 h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0= -golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= +golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= From 5e25c5c215b3d21991d17447fba2e9d13a875159 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Wed, 11 Oct 2023 19:46:53 -0400 Subject: [PATCH 336/751] Bump version of go-github to v56.0.0 (#2961) --- README.md | 15 ++++++++------- example/actionpermissions/main.go | 2 +- example/appengine/app.go | 2 +- example/basicauth/main.go | 2 +- .../codespaces/newreposecretwithxcrypto/main.go | 2 +- .../codespaces/newusersecretwithxcrypto/main.go | 2 +- example/commitpr/main.go | 2 +- example/go.mod | 6 +++--- example/listenvironments/main.go | 2 +- example/migrations/main.go | 2 +- example/newfilewithappauth/main.go | 2 +- example/newrepo/main.go | 2 +- example/newreposecretwithlibsodium/go.mod | 4 ++-- example/newreposecretwithlibsodium/main.go | 2 +- example/newreposecretwithxcrypto/main.go | 2 +- example/ratelimit/main.go | 2 +- example/simple/main.go | 2 +- example/tagprotection/main.go | 2 +- example/tokenauth/main.go | 2 +- example/topics/main.go | 2 +- github/doc.go | 2 +- github/examples_test.go | 2 +- github/github.go | 2 +- go.mod | 2 +- test/fields/fields.go | 2 +- test/integration/activity_test.go | 2 +- test/integration/authorizations_test.go | 2 +- test/integration/github_test.go | 2 +- test/integration/repos_test.go | 2 +- test/integration/users_test.go | 2 +- update-urls/go.mod | 2 +- 31 files changed, 41 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index 1c8d9bd0e56..daf57fe0275 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-github # [![go-github release (latest SemVer)](https://img.shields.io/github/v/release/google/go-github?sort=semver)](https://github.com/google/go-github/releases) -[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v55/github) +[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v56/github) [![Test Status](https://github.com/google/go-github/workflows/tests/badge.svg)](https://github.com/google/go-github/actions?query=workflow%3Atests) [![Test Coverage](https://codecov.io/gh/google/go-github/branch/master/graph/badge.svg)](https://codecov.io/gh/google/go-github) [![Discuss at go-github@googlegroups.com](https://img.shields.io/badge/discuss-go--github%40googlegroups.com-blue.svg)](https://groups.google.com/group/go-github) @@ -24,7 +24,7 @@ If you're interested in using the [GraphQL API v4][], the recommended library is go-github is compatible with modern Go releases in module mode, with Go installed: ```bash -go get github.com/google/go-github/v55 +go get github.com/google/go-github/v56 ``` will resolve and add the package to the current development module, along with its dependencies. @@ -32,7 +32,7 @@ will resolve and add the package to the current development module, along with i Alternatively the same can be achieved if you use import in a package: ```go -import "github.com/google/go-github/v55/github" +import "github.com/google/go-github/v56/github" ``` and run `go get` without parameters. @@ -40,13 +40,13 @@ and run `go get` without parameters. Finally, to use the top-of-trunk version of this repo, use the following command: ```bash -go get github.com/google/go-github/v55@master +go get github.com/google/go-github/v56@master ``` ## Usage ## ```go -import "github.com/google/go-github/v55/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) +import "github.com/google/go-github/v56/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled ``` @@ -117,7 +117,7 @@ import ( "net/http" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v55/github" + "github.com/google/go-github/v56/github" ) func main() { @@ -296,7 +296,7 @@ For complete usage of go-github, see the full [package docs][]. [GitHub API v3]: https://docs.github.com/en/rest [personal access token]: https://github.com/blog/1509-personal-api-tokens -[package docs]: https://pkg.go.dev/github.com/google/go-github/v55/github +[package docs]: https://pkg.go.dev/github.com/google/go-github/v56/github [GraphQL API v4]: https://developer.github.com/v4/ [shurcooL/githubv4]: https://github.com/shurcooL/githubv4 [GitHub webhook events]: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads @@ -369,6 +369,7 @@ Versions prior to 48.2.0 are not listed. | go-github Version | GitHub v3 API Version | | ----------------- | --------------------- | +| 56.0.0 | 2022-11-28 | | 55.0.0 | 2022-11-28 | | 54.0.0 | 2022-11-28 | | 53.2.0 | 2022-11-28 | diff --git a/example/actionpermissions/main.go b/example/actionpermissions/main.go index 4ff7008ca9d..711906a1227 100644 --- a/example/actionpermissions/main.go +++ b/example/actionpermissions/main.go @@ -14,7 +14,7 @@ import ( "log" "os" - "github.com/google/go-github/v55/github" + "github.com/google/go-github/v56/github" ) var ( diff --git a/example/appengine/app.go b/example/appengine/app.go index 449f880cd17..fff9807f7fa 100644 --- a/example/appengine/app.go +++ b/example/appengine/app.go @@ -12,7 +12,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v55/github" + "github.com/google/go-github/v56/github" "google.golang.org/appengine" "google.golang.org/appengine/log" ) diff --git a/example/basicauth/main.go b/example/basicauth/main.go index 95ec4360c21..e9027efcbce 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -21,7 +21,7 @@ import ( "os" "strings" - "github.com/google/go-github/v55/github" + "github.com/google/go-github/v56/github" "golang.org/x/term" ) diff --git a/example/codespaces/newreposecretwithxcrypto/main.go b/example/codespaces/newreposecretwithxcrypto/main.go index 18c8ed24e3c..68b67696cfb 100644 --- a/example/codespaces/newreposecretwithxcrypto/main.go +++ b/example/codespaces/newreposecretwithxcrypto/main.go @@ -36,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v55/github" + "github.com/google/go-github/v56/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/codespaces/newusersecretwithxcrypto/main.go b/example/codespaces/newusersecretwithxcrypto/main.go index 9e05d6117e4..9264aabad74 100644 --- a/example/codespaces/newusersecretwithxcrypto/main.go +++ b/example/codespaces/newusersecretwithxcrypto/main.go @@ -37,7 +37,7 @@ import ( "log" "os" - "github.com/google/go-github/v55/github" + "github.com/google/go-github/v56/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index 7e73d7ffdef..15919277f91 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -33,7 +33,7 @@ import ( "time" "github.com/ProtonMail/go-crypto/openpgp" - "github.com/google/go-github/v55/github" + "github.com/google/go-github/v56/github" ) var ( diff --git a/example/go.mod b/example/go.mod index b89ac02e06a..6900dbaafa6 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v55/example +module github.com/google/go-github/v56/example go 1.17 @@ -6,7 +6,7 @@ require ( github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-ratelimit v1.0.3 - github.com/google/go-github/v55 v55.0.0 + github.com/google/go-github/v56 v56.0.0 golang.org/x/crypto v0.14.0 golang.org/x/term v0.13.0 google.golang.org/appengine v1.6.7 @@ -24,4 +24,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v55 => ../ +replace github.com/google/go-github/v56 => ../ diff --git a/example/listenvironments/main.go b/example/listenvironments/main.go index 56aef7cf73a..ec3e9878ffc 100644 --- a/example/listenvironments/main.go +++ b/example/listenvironments/main.go @@ -18,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v55/github" + "github.com/google/go-github/v56/github" ) func main() { diff --git a/example/migrations/main.go b/example/migrations/main.go index c5ee99c178f..8304b75e962 100644 --- a/example/migrations/main.go +++ b/example/migrations/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v55/github" + "github.com/google/go-github/v56/github" ) func fetchAllUserMigrations() ([]*github.UserMigration, error) { diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index cd85a885106..36f56fca5f9 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -16,7 +16,7 @@ import ( "time" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v55/github" + "github.com/google/go-github/v56/github" ) func main() { diff --git a/example/newrepo/main.go b/example/newrepo/main.go index aa800333a6c..b2d0879c801 100644 --- a/example/newrepo/main.go +++ b/example/newrepo/main.go @@ -16,7 +16,7 @@ import ( "log" "os" - "github.com/google/go-github/v55/github" + "github.com/google/go-github/v56/github" ) var ( diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index 114862d69f3..6f71c4f9ce0 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -4,8 +4,8 @@ go 1.15 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb - github.com/google/go-github/v55 v55.0.0 + github.com/google/go-github/v56 v56.0.0 ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v55 => ../.. +replace github.com/google/go-github/v56 => ../.. diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index bdd9affb2f4..aa9ea38a834 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -36,7 +36,7 @@ import ( "os" sodium "github.com/GoKillers/libsodium-go/cryptobox" - "github.com/google/go-github/v55/github" + "github.com/google/go-github/v56/github" ) var ( diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index 3b65e1548d8..686b12e7a3c 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -36,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v55/github" + "github.com/google/go-github/v56/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/ratelimit/main.go b/example/ratelimit/main.go index a311c9c058d..9c07cf301b8 100644 --- a/example/ratelimit/main.go +++ b/example/ratelimit/main.go @@ -13,7 +13,7 @@ import ( "fmt" "github.com/gofri/go-github-ratelimit/github_ratelimit" - "github.com/google/go-github/v55/github" + "github.com/google/go-github/v56/github" ) func main() { diff --git a/example/simple/main.go b/example/simple/main.go index 72583159d87..fcaddd6ae91 100644 --- a/example/simple/main.go +++ b/example/simple/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v55/github" + "github.com/google/go-github/v56/github" ) // Fetch all the public organizations' membership of a user. diff --git a/example/tagprotection/main.go b/example/tagprotection/main.go index 4127d2b44de..e0e494e7da8 100644 --- a/example/tagprotection/main.go +++ b/example/tagprotection/main.go @@ -18,7 +18,7 @@ import ( "os" "strings" - "github.com/google/go-github/v55/github" + "github.com/google/go-github/v56/github" "golang.org/x/term" ) diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index ccd36543584..9d30ad79663 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -15,7 +15,7 @@ import ( "log" "os" - "github.com/google/go-github/v55/github" + "github.com/google/go-github/v56/github" "golang.org/x/term" ) diff --git a/example/topics/main.go b/example/topics/main.go index 98614836c77..80f5627672e 100644 --- a/example/topics/main.go +++ b/example/topics/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v55/github" + "github.com/google/go-github/v56/github" ) // Fetch and lists all the public topics associated with the specified GitHub topic diff --git a/github/doc.go b/github/doc.go index bace6fb3c6f..4a9aa95c3af 100644 --- a/github/doc.go +++ b/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v55/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v56/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to diff --git a/github/examples_test.go b/github/examples_test.go index 4aca86218fa..ab319151786 100644 --- a/github/examples_test.go +++ b/github/examples_test.go @@ -12,7 +12,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v55/github" + "github.com/google/go-github/v56/github" ) func ExampleMarkdownService_Render() { diff --git a/github/github.go b/github/github.go index 519f3f31a37..d71236ef088 100644 --- a/github/github.go +++ b/github/github.go @@ -27,7 +27,7 @@ import ( ) const ( - Version = "v55.0.0" + Version = "v56.0.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" diff --git a/go.mod b/go.mod index 05f97f6f1ff..3a5c1501969 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v55 +module github.com/google/go-github/v56 require ( github.com/google/go-cmp v0.5.9 diff --git a/test/fields/fields.go b/test/fields/fields.go index 124079a5cea..3334569dd38 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -25,7 +25,7 @@ import ( "reflect" "strings" - "github.com/google/go-github/v55/github" + "github.com/google/go-github/v56/github" ) var ( diff --git a/test/integration/activity_test.go b/test/integration/activity_test.go index 90d43711b4e..52c163c8a97 100644 --- a/test/integration/activity_test.go +++ b/test/integration/activity_test.go @@ -12,7 +12,7 @@ import ( "context" "testing" - "github.com/google/go-github/v55/github" + "github.com/google/go-github/v56/github" ) const ( diff --git a/test/integration/authorizations_test.go b/test/integration/authorizations_test.go index 872c8862820..66c7952a311 100644 --- a/test/integration/authorizations_test.go +++ b/test/integration/authorizations_test.go @@ -15,7 +15,7 @@ import ( "testing" "time" - "github.com/google/go-github/v55/github" + "github.com/google/go-github/v56/github" ) const msgEnvMissing = "Skipping test because the required environment variable (%v) is not present." diff --git a/test/integration/github_test.go b/test/integration/github_test.go index a51a2b23a47..2d297f0ede3 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -15,7 +15,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v55/github" + "github.com/google/go-github/v56/github" ) var ( diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index cc6ff0425c8..b0fa75cb8fc 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -15,7 +15,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v55/github" + "github.com/google/go-github/v56/github" ) func TestRepositories_CRUD(t *testing.T) { diff --git a/test/integration/users_test.go b/test/integration/users_test.go index 64efcd04a3e..d3a9abb0e80 100644 --- a/test/integration/users_test.go +++ b/test/integration/users_test.go @@ -14,7 +14,7 @@ import ( "math/rand" "testing" - "github.com/google/go-github/v55/github" + "github.com/google/go-github/v56/github" ) func TestUsers_Get(t *testing.T) { diff --git a/update-urls/go.mod b/update-urls/go.mod index 8fcf97b0614..4d20e6cee73 100644 --- a/update-urls/go.mod +++ b/update-urls/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v55/update-urls +module github.com/google/go-github/v56/update-urls go 1.16 From 16e695dadf7afb7983193499816a009ae2227a61 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Wed, 11 Oct 2023 20:02:39 -0400 Subject: [PATCH 337/751] Bump go-github from v55 to v56 in /scrape (#2962) --- scrape/apps.go | 2 +- scrape/apps_test.go | 2 +- scrape/go.mod | 2 +- scrape/go.sum | 24 ++---------------------- 4 files changed, 5 insertions(+), 25 deletions(-) diff --git a/scrape/apps.go b/scrape/apps.go index 9cb99ddc0f8..851c4e1d2fb 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -17,7 +17,7 @@ import ( "strings" "github.com/PuerkitoBio/goquery" - "github.com/google/go-github/v55/github" + "github.com/google/go-github/v56/github" ) // AppRestrictionsEnabled returns whether the specified organization has diff --git a/scrape/apps_test.go b/scrape/apps_test.go index 8542426c83e..155056876b3 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v55/github" + "github.com/google/go-github/v56/github" ) func Test_AppRestrictionsEnabled(t *testing.T) { diff --git a/scrape/go.mod b/scrape/go.mod index 54ba62c13d7..8f921034fa4 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -5,7 +5,7 @@ go 1.13 require ( github.com/PuerkitoBio/goquery v1.8.1 github.com/google/go-cmp v0.5.9 - github.com/google/go-github/v55 v55.0.0 + github.com/google/go-github/v56 v56.0.0 github.com/xlzd/gotp v0.1.0 golang.org/x/net v0.17.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index e2a573f53f8..3c9fd48d680 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -1,19 +1,12 @@ -github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= -github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= github.com/PuerkitoBio/goquery v1.8.1 h1:uQxhNlArOIdbrH1tr0UXwdVFgDcZDrZVdcpygAcwmWM= github.com/PuerkitoBio/goquery v1.8.1/go.mod h1:Q8ICL1kNUJ2sXGoAhPGUdYDJvgQgHzJsnnd3H7Ho5jQ= github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c= github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA= -github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= -github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= -github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v55 v55.0.0 h1:4pp/1tNMB9X/LuAhs5i0KQAE40NmiR/y6prLNb9x9cg= -github.com/google/go-github/v55 v55.0.0/go.mod h1:JLahOTA1DnXzhxEymmFF5PP2tSS9JVNj68mSZNDwskA= +github.com/google/go-github/v56 v56.0.0 h1:TysL7dMa/r7wsQi44BjqlwaHvwlFlqkK8CtBWCX3gb4= +github.com/google/go-github/v56 v56.0.0/go.mod h1:D8cdcX98YWJvi7TLo7zM4/h8ZTx6u6fwGEkCdisopo0= 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.1.0 h1:37blvlKCh38s+fkem+fFh7sMnceltoIEBYTVXyoa5Po= @@ -21,9 +14,6 @@ github.com/xlzd/gotp v0.1.0/go.mod h1:ndLJ3JKzi3xLmUProq4LLxCuECL93dG9WASNLpHz8q github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= -golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= @@ -31,7 +21,6 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= @@ -44,31 +33,22 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= From ee3f273456454b9a254f039adf5c4c20eac721b0 Mon Sep 17 00:00:00 2001 From: Mishin Nikolai Date: Sun, 15 Oct 2023 00:13:14 +0200 Subject: [PATCH 338/751] Add support for packages IP address for APIMeta (#2964) Fixes: #2963 . --- github/meta.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/github/meta.go b/github/meta.go index a4d9bac77b4..57fa8ccf588 100644 --- a/github/meta.go +++ b/github/meta.go @@ -32,6 +32,10 @@ type APIMeta struct { // not supported on these servers.) VerifiablePasswordAuthentication *bool `json:"verifiable_password_authentication,omitempty"` + // An array of IP addresses in CIDR format specifying the addresses + // which serve GitHub Packages. + Packages []string `json:"packages,omitempty"` + // An array of IP addresses in CIDR format specifying the addresses // which serve GitHub Pages websites. Pages []string `json:"pages,omitempty"` From 56ca0e5d559f691400370d2341542f06c0305df9 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Mon, 16 Oct 2023 15:49:31 -0400 Subject: [PATCH 339/751] Bump github.com/google/go-cmp from 0.5.9 to 0.6.0 (#2967) --- example/go.sum | 2 +- example/newreposecretwithlibsodium/go.sum | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- scrape/go.mod | 2 +- scrape/go.sum | 3 ++- update-urls/go.mod | 2 +- update-urls/go.sum | 4 ++-- 8 files changed, 12 insertions(+), 11 deletions(-) diff --git a/example/go.sum b/example/go.sum index 2c16d048c2f..be6272956d8 100644 --- a/example/go.sum +++ b/example/go.sum @@ -17,7 +17,7 @@ github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-github/v41 v41.0.0 h1:HseJrM2JFf2vfiZJ8anY2hqBjdfY1Vlj/K27ueww4gg= github.com/google/go-github/v41 v41.0.0/go.mod h1:XgmCA5H323A9rtgExdTcnDkcqp6S30AVACCBDOonIxg= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= diff --git a/example/newreposecretwithlibsodium/go.sum b/example/newreposecretwithlibsodium/go.sum index dd58884a049..a1345cced05 100644 --- a/example/newreposecretwithlibsodium/go.sum +++ b/example/newreposecretwithlibsodium/go.sum @@ -1,8 +1,8 @@ github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb h1:ilqSFSbR1fq6x88heeHrvAqlg+ES+tZk2ZcaCmiH1gI= github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb/go.mod h1:72TQeEkiDH9QMXZa5nJJvZre0UjqqO67X2QEIoOwCRU= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/go.mod b/go.mod index 3a5c1501969..718bedab9d4 100644 --- a/go.mod +++ b/go.mod @@ -1,7 +1,7 @@ module github.com/google/go-github/v56 require ( - github.com/google/go-cmp v0.5.9 + github.com/google/go-cmp v0.6.0 github.com/google/go-querystring v1.1.0 ) diff --git a/go.sum b/go.sum index a2c5fe4a12f..b2abdf11c21 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,6 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/scrape/go.mod b/scrape/go.mod index 8f921034fa4..22bd9bf60ec 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -4,7 +4,7 @@ go 1.13 require ( github.com/PuerkitoBio/goquery v1.8.1 - github.com/google/go-cmp v0.5.9 + github.com/google/go-cmp v0.6.0 github.com/google/go-github/v56 v56.0.0 github.com/xlzd/gotp v0.1.0 golang.org/x/net v0.17.0 diff --git a/scrape/go.sum b/scrape/go.sum index 3c9fd48d680..d7b761f318d 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -3,8 +3,9 @@ github.com/PuerkitoBio/goquery v1.8.1/go.mod h1:Q8ICL1kNUJ2sXGoAhPGUdYDJvgQgHzJs github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c= github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github/v56 v56.0.0 h1:TysL7dMa/r7wsQi44BjqlwaHvwlFlqkK8CtBWCX3gb4= github.com/google/go-github/v56 v56.0.0/go.mod h1:D8cdcX98YWJvi7TLo7zM4/h8ZTx6u6fwGEkCdisopo0= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= diff --git a/update-urls/go.mod b/update-urls/go.mod index 4d20e6cee73..81d9a3a5848 100644 --- a/update-urls/go.mod +++ b/update-urls/go.mod @@ -3,6 +3,6 @@ module github.com/google/go-github/v56/update-urls go 1.16 require ( - github.com/google/go-cmp v0.5.9 + github.com/google/go-cmp v0.6.0 github.com/pmezard/go-difflib v1.0.0 ) diff --git a/update-urls/go.sum b/update-urls/go.sum index 915dea3a949..ddc1bfa1ce9 100644 --- a/update-urls/go.sum +++ b/update-urls/go.sum @@ -1,4 +1,4 @@ -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= From eea6e0a8b1464f5b360c7bde92367845685b84c9 Mon Sep 17 00:00:00 2001 From: Nayeem Hasan Date: Fri, 20 Oct 2023 23:15:23 +0600 Subject: [PATCH 340/751] Move RateLimits method to a service (#2969) Fixes: #2968. --- github/github.go | 99 +-------- github/github_test.go | 372 -------------------------------- github/rate_limit.go | 109 ++++++++++ github/rate_limit_test.go | 388 ++++++++++++++++++++++++++++++++++ test/integration/misc_test.go | 2 +- 5 files changed, 503 insertions(+), 467 deletions(-) create mode 100644 github/rate_limit.go create mode 100644 github/rate_limit_test.go diff --git a/github/github.go b/github/github.go index d71236ef088..edd86ab2ad8 100644 --- a/github/github.go +++ b/github/github.go @@ -203,6 +203,7 @@ type Client struct { Organizations *OrganizationsService Projects *ProjectsService PullRequests *PullRequestsService + RateLimit *RateLimitService Reactions *ReactionsService Repositories *RepositoriesService SCIM *SCIMService @@ -424,6 +425,7 @@ func (c *Client) initialize() { c.Organizations = (*OrganizationsService)(&c.common) c.Projects = (*ProjectsService)(&c.common) c.PullRequests = (*PullRequestsService)(&c.common) + c.RateLimit = (*RateLimitService)(&c.common) c.Reactions = (*ReactionsService)(&c.common) c.Repositories = (*RepositoriesService)(&c.common) c.SCIM = (*SCIMService)(&c.common) @@ -1281,54 +1283,6 @@ func parseBoolResponse(err error) (bool, error) { return false, err } -// Rate represents the rate limit for the current client. -type Rate struct { - // The number of requests per hour the client is currently limited to. - Limit int `json:"limit"` - - // The number of remaining requests the client can make this hour. - Remaining int `json:"remaining"` - - // The time at which the current rate limit will reset. - Reset Timestamp `json:"reset"` -} - -func (r Rate) String() string { - return Stringify(r) -} - -// RateLimits represents the rate limits for the current client. -type RateLimits struct { - // The rate limit for non-search API requests. Unauthenticated - // requests are limited to 60 per hour. Authenticated requests are - // limited to 5,000 per hour. - // - // GitHub API docs: https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting - Core *Rate `json:"core"` - - // The rate limit for search API requests. Unauthenticated requests - // are limited to 10 requests per minutes. Authenticated requests are - // limited to 30 per minute. - // - // GitHub API docs: https://docs.github.com/en/rest/search#rate-limit - Search *Rate `json:"search"` - - // GitHub API docs: https://docs.github.com/en/graphql/overview/resource-limitations#rate-limit - GraphQL *Rate `json:"graphql"` - - // GitHub API dos: https://docs.github.com/en/rest/rate-limit - IntegrationManifest *Rate `json:"integration_manifest"` - - SourceImport *Rate `json:"source_import"` - CodeScanningUpload *Rate `json:"code_scanning_upload"` - ActionsRunnerRegistration *Rate `json:"actions_runner_registration"` - SCIM *Rate `json:"scim"` -} - -func (r RateLimits) String() string { - return Stringify(r) -} - type rateLimitCategory uint8 const ( @@ -1378,53 +1332,10 @@ func category(method, path string) rateLimitCategory { } // RateLimits returns the rate limits for the current client. +// +// Deprecated: Use RateLimitService.Get instead. func (c *Client) RateLimits(ctx context.Context) (*RateLimits, *Response, error) { - req, err := c.NewRequest("GET", "rate_limit", nil) - if err != nil { - return nil, nil, err - } - - response := new(struct { - Resources *RateLimits `json:"resources"` - }) - - // This resource is not subject to rate limits. - ctx = context.WithValue(ctx, bypassRateLimitCheck, true) - resp, err := c.Do(ctx, req, response) - if err != nil { - return nil, resp, err - } - - if response.Resources != nil { - c.rateMu.Lock() - if response.Resources.Core != nil { - c.rateLimits[coreCategory] = *response.Resources.Core - } - if response.Resources.Search != nil { - c.rateLimits[searchCategory] = *response.Resources.Search - } - if response.Resources.GraphQL != nil { - c.rateLimits[graphqlCategory] = *response.Resources.GraphQL - } - if response.Resources.IntegrationManifest != nil { - c.rateLimits[integrationManifestCategory] = *response.Resources.IntegrationManifest - } - if response.Resources.SourceImport != nil { - c.rateLimits[sourceImportCategory] = *response.Resources.SourceImport - } - if response.Resources.CodeScanningUpload != nil { - c.rateLimits[codeScanningUploadCategory] = *response.Resources.CodeScanningUpload - } - if response.Resources.ActionsRunnerRegistration != nil { - c.rateLimits[actionsRunnerRegistrationCategory] = *response.Resources.ActionsRunnerRegistration - } - if response.Resources.SCIM != nil { - c.rateLimits[scimCategory] = *response.Resources.SCIM - } - c.rateMu.Unlock() - } - - return response.Resources, resp, nil + return c.RateLimit.Get(ctx) } func setCredentialsAsHeaders(req *http.Request, id, secret string) *http.Request { diff --git a/github/github_test.go b/github/github_test.go index 7d92946dfd0..90e95b035f5 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -468,23 +468,6 @@ func TestClient_rateLimits(t *testing.T) { } } -func TestRateLimits_String(t *testing.T) { - v := RateLimits{ - Core: &Rate{}, - Search: &Rate{}, - GraphQL: &Rate{}, - IntegrationManifest: &Rate{}, - SourceImport: &Rate{}, - CodeScanningUpload: &Rate{}, - ActionsRunnerRegistration: &Rate{}, - SCIM: &Rate{}, - } - want := `github.RateLimits{Core:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, Search:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, GraphQL:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, IntegrationManifest:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, SourceImport:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, CodeScanningUpload:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, ActionsRunnerRegistration:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, SCIM:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}}` - if got := v.String(); got != want { - t.Errorf("RateLimits.String = %v, want %v", got, want) - } -} - func TestNewRequest(t *testing.T) { c := NewClient(nil) @@ -2123,251 +2106,6 @@ func TestError_Error(t *testing.T) { } } -func TestRateLimits(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - mux.HandleFunc("/rate_limit", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - fmt.Fprint(w, `{"resources":{ - "core": {"limit":2,"remaining":1,"reset":1372700873}, - "search": {"limit":3,"remaining":2,"reset":1372700874}, - "graphql": {"limit":4,"remaining":3,"reset":1372700875}, - "integration_manifest": {"limit":5,"remaining":4,"reset":1372700876}, - "source_import": {"limit":6,"remaining":5,"reset":1372700877}, - "code_scanning_upload": {"limit":7,"remaining":6,"reset":1372700878}, - "actions_runner_registration": {"limit":8,"remaining":7,"reset":1372700879}, - "scim": {"limit":9,"remaining":8,"reset":1372700880} - }}`) - }) - - ctx := context.Background() - rate, _, err := client.RateLimits(ctx) - if err != nil { - t.Errorf("RateLimits returned error: %v", err) - } - - want := &RateLimits{ - Core: &Rate{ - Limit: 2, - Remaining: 1, - Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 53, 0, time.UTC).Local()}, - }, - Search: &Rate{ - Limit: 3, - Remaining: 2, - Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 54, 0, time.UTC).Local()}, - }, - GraphQL: &Rate{ - Limit: 4, - Remaining: 3, - Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 55, 0, time.UTC).Local()}, - }, - IntegrationManifest: &Rate{ - Limit: 5, - Remaining: 4, - Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 56, 0, time.UTC).Local()}, - }, - SourceImport: &Rate{ - Limit: 6, - Remaining: 5, - Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 57, 0, time.UTC).Local()}, - }, - CodeScanningUpload: &Rate{ - Limit: 7, - Remaining: 6, - Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 58, 0, time.UTC).Local()}, - }, - ActionsRunnerRegistration: &Rate{ - Limit: 8, - Remaining: 7, - Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 59, 0, time.UTC).Local()}, - }, - SCIM: &Rate{ - Limit: 9, - Remaining: 8, - Reset: Timestamp{time.Date(2013, time.July, 1, 17, 48, 00, 0, time.UTC).Local()}, - }, - } - if !cmp.Equal(rate, want) { - t.Errorf("RateLimits returned %+v, want %+v", rate, want) - } - tests := []struct { - category rateLimitCategory - rate *Rate - }{ - { - category: coreCategory, - rate: want.Core, - }, - { - category: searchCategory, - rate: want.Search, - }, - { - category: graphqlCategory, - rate: want.GraphQL, - }, - { - category: integrationManifestCategory, - rate: want.IntegrationManifest, - }, - { - category: sourceImportCategory, - rate: want.SourceImport, - }, - { - category: codeScanningUploadCategory, - rate: want.CodeScanningUpload, - }, - { - category: actionsRunnerRegistrationCategory, - rate: want.ActionsRunnerRegistration, - }, - { - category: scimCategory, - rate: want.SCIM, - }, - } - - for _, tt := range tests { - if got, want := client.rateLimits[tt.category], *tt.rate; got != want { - t.Errorf("client.rateLimits[%v] is %+v, want %+v", tt.category, got, want) - } - } -} - -func TestRateLimits_coverage(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() - - ctx := context.Background() - - const methodName = "RateLimits" - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - _, resp, err := client.RateLimits(ctx) - return resp, err - }) -} - -func TestRateLimits_overQuota(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - client.rateLimits[coreCategory] = Rate{ - Limit: 1, - Remaining: 0, - Reset: Timestamp{time.Now().Add(time.Hour).Local()}, - } - mux.HandleFunc("/rate_limit", func(w http.ResponseWriter, r *http.Request) { - fmt.Fprint(w, `{"resources":{ - "core": {"limit":2,"remaining":1,"reset":1372700873}, - "search": {"limit":3,"remaining":2,"reset":1372700874}, - "graphql": {"limit":4,"remaining":3,"reset":1372700875}, - "integration_manifest": {"limit":5,"remaining":4,"reset":1372700876}, - "source_import": {"limit":6,"remaining":5,"reset":1372700877}, - "code_scanning_upload": {"limit":7,"remaining":6,"reset":1372700878}, - "actions_runner_registration": {"limit":8,"remaining":7,"reset":1372700879}, - "scim": {"limit":9,"remaining":8,"reset":1372700880} - }}`) - }) - - ctx := context.Background() - rate, _, err := client.RateLimits(ctx) - if err != nil { - t.Errorf("RateLimits returned error: %v", err) - } - - want := &RateLimits{ - Core: &Rate{ - Limit: 2, - Remaining: 1, - Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 53, 0, time.UTC).Local()}, - }, - Search: &Rate{ - Limit: 3, - Remaining: 2, - Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 54, 0, time.UTC).Local()}, - }, - GraphQL: &Rate{ - Limit: 4, - Remaining: 3, - Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 55, 0, time.UTC).Local()}, - }, - IntegrationManifest: &Rate{ - Limit: 5, - Remaining: 4, - Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 56, 0, time.UTC).Local()}, - }, - SourceImport: &Rate{ - Limit: 6, - Remaining: 5, - Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 57, 0, time.UTC).Local()}, - }, - CodeScanningUpload: &Rate{ - Limit: 7, - Remaining: 6, - Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 58, 0, time.UTC).Local()}, - }, - ActionsRunnerRegistration: &Rate{ - Limit: 8, - Remaining: 7, - Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 59, 0, time.UTC).Local()}, - }, - SCIM: &Rate{ - Limit: 9, - Remaining: 8, - Reset: Timestamp{time.Date(2013, time.July, 1, 17, 48, 00, 0, time.UTC).Local()}, - }, - } - if !cmp.Equal(rate, want) { - t.Errorf("RateLimits returned %+v, want %+v", rate, want) - } - - tests := []struct { - category rateLimitCategory - rate *Rate - }{ - { - category: coreCategory, - rate: want.Core, - }, - { - category: searchCategory, - rate: want.Search, - }, - { - category: graphqlCategory, - rate: want.GraphQL, - }, - { - category: integrationManifestCategory, - rate: want.IntegrationManifest, - }, - { - category: sourceImportCategory, - rate: want.SourceImport, - }, - { - category: codeScanningUploadCategory, - rate: want.CodeScanningUpload, - }, - { - category: actionsRunnerRegistrationCategory, - rate: want.ActionsRunnerRegistration, - }, - { - category: scimCategory, - rate: want.SCIM, - }, - } - for _, tt := range tests { - if got, want := client.rateLimits[tt.category], *tt.rate; got != want { - t.Errorf("client.rateLimits[%v] is %+v, want %+v", tt.category, got, want) - } - } -} - func TestSetCredentialsAsHeaders(t *testing.T) { req := new(http.Request) id, secret := "id", "secret" @@ -2770,116 +2508,6 @@ func TestError_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } -func TestRate_Marshal(t *testing.T) { - testJSONMarshal(t, &Rate{}, "{}") - - u := &Rate{ - Limit: 1, - Remaining: 1, - Reset: Timestamp{referenceTime}, - } - - want := `{ - "limit": 1, - "remaining": 1, - "reset": ` + referenceTimeStr + ` - }` - - testJSONMarshal(t, u, want) -} - -func TestRateLimits_Marshal(t *testing.T) { - testJSONMarshal(t, &RateLimits{}, "{}") - - u := &RateLimits{ - Core: &Rate{ - Limit: 1, - Remaining: 1, - Reset: Timestamp{referenceTime}, - }, - Search: &Rate{ - Limit: 1, - Remaining: 1, - Reset: Timestamp{referenceTime}, - }, - GraphQL: &Rate{ - Limit: 1, - Remaining: 1, - Reset: Timestamp{referenceTime}, - }, - IntegrationManifest: &Rate{ - Limit: 1, - Remaining: 1, - Reset: Timestamp{referenceTime}, - }, - SourceImport: &Rate{ - Limit: 1, - Remaining: 1, - Reset: Timestamp{referenceTime}, - }, - CodeScanningUpload: &Rate{ - Limit: 1, - Remaining: 1, - Reset: Timestamp{referenceTime}, - }, - ActionsRunnerRegistration: &Rate{ - Limit: 1, - Remaining: 1, - Reset: Timestamp{referenceTime}, - }, - SCIM: &Rate{ - Limit: 1, - Remaining: 1, - Reset: Timestamp{referenceTime}, - }, - } - - want := `{ - "core": { - "limit": 1, - "remaining": 1, - "reset": ` + referenceTimeStr + ` - }, - "search": { - "limit": 1, - "remaining": 1, - "reset": ` + referenceTimeStr + ` - }, - "graphql": { - "limit": 1, - "remaining": 1, - "reset": ` + referenceTimeStr + ` - }, - "integration_manifest": { - "limit": 1, - "remaining": 1, - "reset": ` + referenceTimeStr + ` - }, - "source_import": { - "limit": 1, - "remaining": 1, - "reset": ` + referenceTimeStr + ` - }, - "code_scanning_upload": { - "limit": 1, - "remaining": 1, - "reset": ` + referenceTimeStr + ` - }, - "actions_runner_registration": { - "limit": 1, - "remaining": 1, - "reset": ` + referenceTimeStr + ` - }, - "scim": { - "limit": 1, - "remaining": 1, - "reset": ` + referenceTimeStr + ` - } - }` - - testJSONMarshal(t, u, want) -} - func TestParseTokenExpiration(t *testing.T) { tests := []struct { header string diff --git a/github/rate_limit.go b/github/rate_limit.go new file mode 100644 index 00000000000..4243a144033 --- /dev/null +++ b/github/rate_limit.go @@ -0,0 +1,109 @@ +// Copyright 2023 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" + +// RateLimitService provides access to rate limit functions in the GitHub API. +type RateLimitService service + +// Rate represents the rate limit for the current client. +type Rate struct { + // The number of requests per hour the client is currently limited to. + Limit int `json:"limit"` + + // The number of remaining requests the client can make this hour. + Remaining int `json:"remaining"` + + // The time at which the current rate limit will reset. + Reset Timestamp `json:"reset"` +} + +func (r Rate) String() string { + return Stringify(r) +} + +// RateLimits represents the rate limits for the current client. +type RateLimits struct { + // The rate limit for non-search API requests. Unauthenticated + // requests are limited to 60 per hour. Authenticated requests are + // limited to 5,000 per hour. + // + // GitHub API docs: https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting + Core *Rate `json:"core"` + + // The rate limit for search API requests. Unauthenticated requests + // are limited to 10 requests per minutes. Authenticated requests are + // limited to 30 per minute. + // + // GitHub API docs: https://docs.github.com/en/rest/search#rate-limit + Search *Rate `json:"search"` + + // GitHub API docs: https://docs.github.com/en/graphql/overview/resource-limitations#rate-limit + GraphQL *Rate `json:"graphql"` + + // GitHub API dos: https://docs.github.com/en/rest/rate-limit + IntegrationManifest *Rate `json:"integration_manifest"` + + SourceImport *Rate `json:"source_import"` + CodeScanningUpload *Rate `json:"code_scanning_upload"` + ActionsRunnerRegistration *Rate `json:"actions_runner_registration"` + SCIM *Rate `json:"scim"` +} + +func (r RateLimits) String() string { + return Stringify(r) +} + +// RateLimits returns the rate limits for the current client. +func (s *RateLimitService) Get(ctx context.Context) (*RateLimits, *Response, error) { + req, err := s.client.NewRequest("GET", "rate_limit", nil) + if err != nil { + return nil, nil, err + } + + response := new(struct { + Resources *RateLimits `json:"resources"` + }) + + // This resource is not subject to rate limits. + ctx = context.WithValue(ctx, bypassRateLimitCheck, true) + resp, err := s.client.Do(ctx, req, response) + if err != nil { + return nil, resp, err + } + + if response.Resources != nil { + s.client.rateMu.Lock() + if response.Resources.Core != nil { + s.client.rateLimits[coreCategory] = *response.Resources.Core + } + if response.Resources.Search != nil { + s.client.rateLimits[searchCategory] = *response.Resources.Search + } + if response.Resources.GraphQL != nil { + s.client.rateLimits[graphqlCategory] = *response.Resources.GraphQL + } + if response.Resources.IntegrationManifest != nil { + s.client.rateLimits[integrationManifestCategory] = *response.Resources.IntegrationManifest + } + if response.Resources.SourceImport != nil { + s.client.rateLimits[sourceImportCategory] = *response.Resources.SourceImport + } + if response.Resources.CodeScanningUpload != nil { + s.client.rateLimits[codeScanningUploadCategory] = *response.Resources.CodeScanningUpload + } + if response.Resources.ActionsRunnerRegistration != nil { + s.client.rateLimits[actionsRunnerRegistrationCategory] = *response.Resources.ActionsRunnerRegistration + } + if response.Resources.SCIM != nil { + s.client.rateLimits[scimCategory] = *response.Resources.SCIM + } + s.client.rateMu.Unlock() + } + + return response.Resources, resp, nil +} diff --git a/github/rate_limit_test.go b/github/rate_limit_test.go new file mode 100644 index 00000000000..167288bc889 --- /dev/null +++ b/github/rate_limit_test.go @@ -0,0 +1,388 @@ +// Copyright 2023 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" + "time" + + "github.com/google/go-cmp/cmp" +) + +func TestRateLimits_String(t *testing.T) { + v := RateLimits{ + Core: &Rate{}, + Search: &Rate{}, + GraphQL: &Rate{}, + IntegrationManifest: &Rate{}, + SourceImport: &Rate{}, + CodeScanningUpload: &Rate{}, + ActionsRunnerRegistration: &Rate{}, + SCIM: &Rate{}, + } + want := `github.RateLimits{Core:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, Search:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, GraphQL:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, IntegrationManifest:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, SourceImport:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, CodeScanningUpload:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, ActionsRunnerRegistration:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, SCIM:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}}` + if got := v.String(); got != want { + t.Errorf("RateLimits.String = %v, want %v", got, want) + } +} + +func TestRateLimits(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/rate_limit", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"resources":{ + "core": {"limit":2,"remaining":1,"reset":1372700873}, + "search": {"limit":3,"remaining":2,"reset":1372700874}, + "graphql": {"limit":4,"remaining":3,"reset":1372700875}, + "integration_manifest": {"limit":5,"remaining":4,"reset":1372700876}, + "source_import": {"limit":6,"remaining":5,"reset":1372700877}, + "code_scanning_upload": {"limit":7,"remaining":6,"reset":1372700878}, + "actions_runner_registration": {"limit":8,"remaining":7,"reset":1372700879}, + "scim": {"limit":9,"remaining":8,"reset":1372700880} + }}`) + }) + + ctx := context.Background() + rate, _, err := client.RateLimit.Get(ctx) + if err != nil { + t.Errorf("RateLimits returned error: %v", err) + } + + want := &RateLimits{ + Core: &Rate{ + Limit: 2, + Remaining: 1, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 53, 0, time.UTC).Local()}, + }, + Search: &Rate{ + Limit: 3, + Remaining: 2, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 54, 0, time.UTC).Local()}, + }, + GraphQL: &Rate{ + Limit: 4, + Remaining: 3, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 55, 0, time.UTC).Local()}, + }, + IntegrationManifest: &Rate{ + Limit: 5, + Remaining: 4, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 56, 0, time.UTC).Local()}, + }, + SourceImport: &Rate{ + Limit: 6, + Remaining: 5, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 57, 0, time.UTC).Local()}, + }, + CodeScanningUpload: &Rate{ + Limit: 7, + Remaining: 6, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 58, 0, time.UTC).Local()}, + }, + ActionsRunnerRegistration: &Rate{ + Limit: 8, + Remaining: 7, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 59, 0, time.UTC).Local()}, + }, + SCIM: &Rate{ + Limit: 9, + Remaining: 8, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 48, 00, 0, time.UTC).Local()}, + }, + } + if !cmp.Equal(rate, want) { + t.Errorf("RateLimits returned %+v, want %+v", rate, want) + } + tests := []struct { + category rateLimitCategory + rate *Rate + }{ + { + category: coreCategory, + rate: want.Core, + }, + { + category: searchCategory, + rate: want.Search, + }, + { + category: graphqlCategory, + rate: want.GraphQL, + }, + { + category: integrationManifestCategory, + rate: want.IntegrationManifest, + }, + { + category: sourceImportCategory, + rate: want.SourceImport, + }, + { + category: codeScanningUploadCategory, + rate: want.CodeScanningUpload, + }, + { + category: actionsRunnerRegistrationCategory, + rate: want.ActionsRunnerRegistration, + }, + { + category: scimCategory, + rate: want.SCIM, + }, + } + + for _, tt := range tests { + if got, want := client.rateLimits[tt.category], *tt.rate; got != want { + t.Errorf("client.rateLimits[%v] is %+v, want %+v", tt.category, got, want) + } + } +} + +func TestRateLimits_coverage(t *testing.T) { + client, _, _, teardown := setup() + defer teardown() + + ctx := context.Background() + + const methodName = "RateLimits" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + _, resp, err := client.RateLimit.Get(ctx) + return resp, err + }) +} + +func TestRateLimits_overQuota(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + client.rateLimits[coreCategory] = Rate{ + Limit: 1, + Remaining: 0, + Reset: Timestamp{time.Now().Add(time.Hour).Local()}, + } + mux.HandleFunc("/rate_limit", func(w http.ResponseWriter, r *http.Request) { + fmt.Fprint(w, `{"resources":{ + "core": {"limit":2,"remaining":1,"reset":1372700873}, + "search": {"limit":3,"remaining":2,"reset":1372700874}, + "graphql": {"limit":4,"remaining":3,"reset":1372700875}, + "integration_manifest": {"limit":5,"remaining":4,"reset":1372700876}, + "source_import": {"limit":6,"remaining":5,"reset":1372700877}, + "code_scanning_upload": {"limit":7,"remaining":6,"reset":1372700878}, + "actions_runner_registration": {"limit":8,"remaining":7,"reset":1372700879}, + "scim": {"limit":9,"remaining":8,"reset":1372700880} + }}`) + }) + + ctx := context.Background() + rate, _, err := client.RateLimit.Get(ctx) + if err != nil { + t.Errorf("RateLimits returned error: %v", err) + } + + want := &RateLimits{ + Core: &Rate{ + Limit: 2, + Remaining: 1, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 53, 0, time.UTC).Local()}, + }, + Search: &Rate{ + Limit: 3, + Remaining: 2, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 54, 0, time.UTC).Local()}, + }, + GraphQL: &Rate{ + Limit: 4, + Remaining: 3, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 55, 0, time.UTC).Local()}, + }, + IntegrationManifest: &Rate{ + Limit: 5, + Remaining: 4, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 56, 0, time.UTC).Local()}, + }, + SourceImport: &Rate{ + Limit: 6, + Remaining: 5, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 57, 0, time.UTC).Local()}, + }, + CodeScanningUpload: &Rate{ + Limit: 7, + Remaining: 6, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 58, 0, time.UTC).Local()}, + }, + ActionsRunnerRegistration: &Rate{ + Limit: 8, + Remaining: 7, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 59, 0, time.UTC).Local()}, + }, + SCIM: &Rate{ + Limit: 9, + Remaining: 8, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 48, 00, 0, time.UTC).Local()}, + }, + } + if !cmp.Equal(rate, want) { + t.Errorf("RateLimits returned %+v, want %+v", rate, want) + } + + tests := []struct { + category rateLimitCategory + rate *Rate + }{ + { + category: coreCategory, + rate: want.Core, + }, + { + category: searchCategory, + rate: want.Search, + }, + { + category: graphqlCategory, + rate: want.GraphQL, + }, + { + category: integrationManifestCategory, + rate: want.IntegrationManifest, + }, + { + category: sourceImportCategory, + rate: want.SourceImport, + }, + { + category: codeScanningUploadCategory, + rate: want.CodeScanningUpload, + }, + { + category: actionsRunnerRegistrationCategory, + rate: want.ActionsRunnerRegistration, + }, + { + category: scimCategory, + rate: want.SCIM, + }, + } + for _, tt := range tests { + if got, want := client.rateLimits[tt.category], *tt.rate; got != want { + t.Errorf("client.rateLimits[%v] is %+v, want %+v", tt.category, got, want) + } + } +} + +func TestRateLimits_Marshal(t *testing.T) { + testJSONMarshal(t, &RateLimits{}, "{}") + + u := &RateLimits{ + Core: &Rate{ + Limit: 1, + Remaining: 1, + Reset: Timestamp{referenceTime}, + }, + Search: &Rate{ + Limit: 1, + Remaining: 1, + Reset: Timestamp{referenceTime}, + }, + GraphQL: &Rate{ + Limit: 1, + Remaining: 1, + Reset: Timestamp{referenceTime}, + }, + IntegrationManifest: &Rate{ + Limit: 1, + Remaining: 1, + Reset: Timestamp{referenceTime}, + }, + SourceImport: &Rate{ + Limit: 1, + Remaining: 1, + Reset: Timestamp{referenceTime}, + }, + CodeScanningUpload: &Rate{ + Limit: 1, + Remaining: 1, + Reset: Timestamp{referenceTime}, + }, + ActionsRunnerRegistration: &Rate{ + Limit: 1, + Remaining: 1, + Reset: Timestamp{referenceTime}, + }, + SCIM: &Rate{ + Limit: 1, + Remaining: 1, + Reset: Timestamp{referenceTime}, + }, + } + + want := `{ + "core": { + "limit": 1, + "remaining": 1, + "reset": ` + referenceTimeStr + ` + }, + "search": { + "limit": 1, + "remaining": 1, + "reset": ` + referenceTimeStr + ` + }, + "graphql": { + "limit": 1, + "remaining": 1, + "reset": ` + referenceTimeStr + ` + }, + "integration_manifest": { + "limit": 1, + "remaining": 1, + "reset": ` + referenceTimeStr + ` + }, + "source_import": { + "limit": 1, + "remaining": 1, + "reset": ` + referenceTimeStr + ` + }, + "code_scanning_upload": { + "limit": 1, + "remaining": 1, + "reset": ` + referenceTimeStr + ` + }, + "actions_runner_registration": { + "limit": 1, + "remaining": 1, + "reset": ` + referenceTimeStr + ` + }, + "scim": { + "limit": 1, + "remaining": 1, + "reset": ` + referenceTimeStr + ` + } + }` + + testJSONMarshal(t, u, want) +} + +func TestRate_Marshal(t *testing.T) { + testJSONMarshal(t, &Rate{}, "{}") + + u := &Rate{ + Limit: 1, + Remaining: 1, + Reset: Timestamp{referenceTime}, + } + + want := `{ + "limit": 1, + "remaining": 1, + "reset": ` + referenceTimeStr + ` + }` + + testJSONMarshal(t, u, want) +} diff --git a/test/integration/misc_test.go b/test/integration/misc_test.go index 6ffb163fdcd..0e9ef6e01e7 100644 --- a/test/integration/misc_test.go +++ b/test/integration/misc_test.go @@ -49,7 +49,7 @@ func TestAPIMeta(t *testing.T) { } func TestRateLimits(t *testing.T) { - limits, _, err := client.RateLimits(context.Background()) + limits, _, err := client.RateLimit.Get(context.Background()) if err != nil { t.Fatalf("RateLimits returned error: %v", err) } From 3c49fd961c0c3119e9242500028b1774fd92214e Mon Sep 17 00:00:00 2001 From: Rajat Jindal Date: Mon, 23 Oct 2023 22:57:16 +0530 Subject: [PATCH 341/751] Add nil check in ErrorResponse.Error method (#2971) Fixes: #2970. --- github/github.go | 14 +++++++++++--- github/github_test.go | 13 +++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/github/github.go b/github/github.go index edd86ab2ad8..834aa86bc6a 100644 --- a/github/github.go +++ b/github/github.go @@ -1017,9 +1017,17 @@ type ErrorBlock struct { } func (r *ErrorResponse) Error() string { - return fmt.Sprintf("%v %v: %d %v %+v", - r.Response.Request.Method, sanitizeURL(r.Response.Request.URL), - r.Response.StatusCode, r.Message, r.Errors) + if r.Response != nil && r.Response.Request != nil { + return fmt.Sprintf("%v %v: %d %v %+v", + r.Response.Request.Method, sanitizeURL(r.Response.Request.URL), + r.Response.StatusCode, r.Message, r.Errors) + } + + if r.Response != nil { + return fmt.Sprintf("%d %v %+v", r.Response.StatusCode, r.Message, r.Errors) + } + + return fmt.Sprintf("%v %+v", r.Message, r.Errors) } // Is returns whether the provided error equals this error. diff --git a/github/github_test.go b/github/github_test.go index 90e95b035f5..b994496cc01 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -2097,6 +2097,19 @@ func TestErrorResponse_Error(t *testing.T) { if err.Error() == "" { t.Errorf("Expected non-empty ErrorResponse.Error()") } + + //dont panic if request is nil + res = &http.Response{} + err = ErrorResponse{Message: "m", Response: res} + if err.Error() == "" { + t.Errorf("Expected non-empty ErrorResponse.Error()") + } + + //dont panic if response is nil + err = ErrorResponse{Message: "m"} + if err.Error() == "" { + t.Errorf("Expected non-empty ErrorResponse.Error()") + } } func TestError_Error(t *testing.T) { From 66ed84deba8936684a4a6bb09b00135f326064fc Mon Sep 17 00:00:00 2001 From: WillAbides <233500+WillAbides@users.noreply.github.com> Date: Mon, 23 Oct 2023 14:28:03 -0500 Subject: [PATCH 342/751] Lint godoc comments (#2972) --- .golangci.yml | 13 +++++++++++++ github/actions_permissions_enterprise.go | 2 +- github/actions_permissions_orgs.go | 2 +- github/codesofconduct.go | 6 ++++-- github/codespaces.go | 2 +- github/emojis.go | 3 ++- github/event_types.go | 2 +- github/issues.go | 2 +- github/messages.go | 2 +- github/meta.go | 10 +++++++--- github/orgs_packages.go | 16 ++++++++-------- github/rate_limit.go | 2 +- github/reactions.go | 2 +- github/repos.go | 3 ++- github/repos_pages.go | 2 +- github/repos_rules.go | 2 +- github/secret_scanning.go | 12 ++++++------ github/users_packages.go | 16 ++++++++-------- github/users_ssh_signing_keys.go | 2 +- 19 files changed, 61 insertions(+), 40 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index d1ec5b11c92..1770bd2e417 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -18,10 +18,13 @@ linters: linters-settings: gosec: excludes: + # duplicates errcheck + - G104 # performance issue: see https://github.com/golangci/golangci-lint/issues/4039 # and https://github.com/securego/gosec/issues/1007 - G602 issues: + exclude-use-default: false exclude-rules: - linters: - dupl @@ -38,3 +41,13 @@ issues: # We need to use sha1 for validating signatures - linters: [ gosec ] text: 'G505: Blocklisted import crypto/sha1: weak cryptographic primitive' + + # This is adapted from golangci-lint's default exclusions. It disables linting for error checks on + # os.RemoveAll and any function ending in "Close". + - linters: [ errcheck ] + text: Error return value of .(.*Close|os\.Remove(All)?). is not checked + + # We don't care about file inclusion via variable in examples or internal tools. + - linters: [ gosec ] + text: 'G304: Potential file inclusion via variable' + path: '^(example|update-urls)\/' diff --git a/github/actions_permissions_enterprise.go b/github/actions_permissions_enterprise.go index 8311e729438..1d97fc91b4f 100644 --- a/github/actions_permissions_enterprise.go +++ b/github/actions_permissions_enterprise.go @@ -10,7 +10,7 @@ import ( "fmt" ) -// ActionsEnabledOnEnterpriseOrgs represents all the repositories in an enterprise for which Actions is enabled. +// ActionsEnabledOnEnterpriseRepos represents all the repositories in an enterprise for which Actions is enabled. type ActionsEnabledOnEnterpriseRepos struct { TotalCount int `json:"total_count"` Organizations []*Organization `json:"organizations"` diff --git a/github/actions_permissions_orgs.go b/github/actions_permissions_orgs.go index 801f1d97437..d55a2d45a61 100644 --- a/github/actions_permissions_orgs.go +++ b/github/actions_permissions_orgs.go @@ -145,7 +145,7 @@ func (s *ActionsService) AddEnabledReposInOrg(ctx context.Context, owner string, return resp, nil } -// RemoveEnabledRepoInOrg removes a single repository from the list of enabled repos for GitHub Actions in an organization. +// RemoveEnabledReposInOrg removes a single repository from the list of enabled repos for GitHub Actions in an organization. // // GitHub API docs: https://docs.github.com/en/rest/actions/permissions#disable-a-selected-repository-for-github-actions-in-an-organization func (s *ActionsService) RemoveEnabledReposInOrg(ctx context.Context, owner string, repositoryID int64) (*Response, error) { diff --git a/github/codesofconduct.go b/github/codesofconduct.go index 4318ba56d2c..11e1fb38df0 100644 --- a/github/codesofconduct.go +++ b/github/codesofconduct.go @@ -46,7 +46,8 @@ func (s *CodesOfConductService) List(ctx context.Context) ([]*CodeOfConduct, *Re return cs, resp, nil } -// ListCodesOfConduct +// ListCodesOfConduct returns all codes of conduct. +// // Deprecated: Use CodesOfConductService.List instead func (c *Client) ListCodesOfConduct(ctx context.Context) ([]*CodeOfConduct, *Response, error) { return c.CodesOfConduct.List(ctx) @@ -74,7 +75,8 @@ func (s *CodesOfConductService) Get(ctx context.Context, key string) (*CodeOfCon return coc, resp, nil } -// GetCodeOfConduct +// GetCodeOfConduct returns an individual code of conduct. +// // Deprecated: Use CodesOfConductService.Get instead func (c *Client) GetCodeOfConduct(ctx context.Context, key string) (*CodeOfConduct, *Response, error) { return c.CodesOfConduct.Get(ctx, key) diff --git a/github/codespaces.go b/github/codespaces.go index cd8b0e5bee5..f2e6a284cf0 100644 --- a/github/codespaces.go +++ b/github/codespaces.go @@ -112,7 +112,7 @@ func (s *CodespacesService) ListInRepo(ctx context.Context, owner, repo string, return codespaces, resp, nil } -// ListOptions represents the options for listing codespaces for a user. +// ListCodespacesOptions represents the options for listing codespaces for a user. type ListCodespacesOptions struct { ListOptions RepositoryID int64 `url:"repository_id,omitempty"` diff --git a/github/emojis.go b/github/emojis.go index 15b57130b3b..5a2c86baa38 100644 --- a/github/emojis.go +++ b/github/emojis.go @@ -30,7 +30,8 @@ func (s *EmojisService) List(ctx context.Context) (map[string]string, *Response, return emoji, resp, nil } -// ListEmojis +// ListEmojis returns the emojis available to use on GitHub. +// // Deprecated: Use EmojisService.List instead func (c *Client) ListEmojis(ctx context.Context) (map[string]string, *Response, error) { return c.Emojis.List(ctx) diff --git a/github/event_types.go b/github/event_types.go index e91d22686ff..c270f6bcf0a 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -1069,7 +1069,7 @@ type ArchivedAt struct { To *Timestamp `json:"to,omitempty"` } -// ProjectsV2 represents an item belonging to a project. +// ProjectV2Item represents an item belonging to a project. type ProjectV2Item struct { ID *int64 `json:"id,omitempty"` NodeID *string `json:"node_id,omitempty"` diff --git a/github/issues.go b/github/issues.go index 42e58a17a8a..44364811d3f 100644 --- a/github/issues.go +++ b/github/issues.go @@ -303,7 +303,7 @@ func (s *IssuesService) Edit(ctx context.Context, owner string, repo string, num return i, resp, nil } -// Remove a milestone from an issue. +// RemoveMilestone removes a milestone from an issue. // // This is a helper method to explicitly update an issue with a `null` milestone, thereby removing it. // diff --git a/github/messages.go b/github/messages.go index c16b6015284..0d9811549c2 100644 --- a/github/messages.go +++ b/github/messages.go @@ -326,7 +326,7 @@ func ParseWebHook(messageType string, payload []byte) (interface{}, error) { return event.ParsePayload() } -// WebhookTypes returns a sorted list of all the known GitHub event type strings +// MessageTypes returns a sorted list of all the known GitHub event type strings // supported by go-github. func MessageTypes() []string { types := make([]string, 0, len(eventTypeMapping)) diff --git a/github/meta.go b/github/meta.go index 57fa8ccf588..3e9743b00cb 100644 --- a/github/meta.go +++ b/github/meta.go @@ -87,7 +87,8 @@ func (s *MetaService) Get(ctx context.Context) (*APIMeta, *Response, error) { return meta, resp, nil } -// APIMeta +// APIMeta returns information about GitHub.com. +// // Deprecated: Use MetaService.Get instead. func (c *Client) APIMeta(ctx context.Context) (*APIMeta, *Response, error) { return c.Meta.Get(ctx) @@ -117,7 +118,9 @@ func (s *MetaService) Octocat(ctx context.Context, message string) (string, *Res return buf.String(), resp, nil } -// Octocat +// Octocat returns an ASCII art octocat with the specified message in a speech +// bubble. If message is empty, a random zen phrase is used. +// // Deprecated: Use MetaService.Octocat instead. func (c *Client) Octocat(ctx context.Context, message string) (string, *Response, error) { return c.Meta.Octocat(ctx, message) @@ -143,7 +146,8 @@ func (s *MetaService) Zen(ctx context.Context) (string, *Response, error) { return buf.String(), resp, nil } -// Zen +// Zen returns a random line from The Zen of GitHub. +// // Deprecated: Use MetaService.Zen instead. func (c *Client) Zen(ctx context.Context) (string, *Response, error) { return c.Meta.Zen(ctx) diff --git a/github/orgs_packages.go b/github/orgs_packages.go index 0ae68aaa369..449b3dd3e91 100644 --- a/github/orgs_packages.go +++ b/github/orgs_packages.go @@ -10,7 +10,7 @@ import ( "fmt" ) -// List the packages for an organization. +// ListPackages lists the packages for an organization. // // GitHub API docs: https://docs.github.com/en/rest/packages#list-packages-for-an-organization func (s *OrganizationsService) ListPackages(ctx context.Context, org string, opts *PackageListOptions) ([]*Package, *Response, error) { @@ -34,7 +34,7 @@ func (s *OrganizationsService) ListPackages(ctx context.Context, org string, opt return packages, resp, nil } -// Get a package by name from an organization. +// GetPackage gets a package by name from an organization. // // GitHub API docs: https://docs.github.com/en/rest/packages#get-a-package-for-an-organization func (s *OrganizationsService) GetPackage(ctx context.Context, org, packageType, packageName string) (*Package, *Response, error) { @@ -53,7 +53,7 @@ func (s *OrganizationsService) GetPackage(ctx context.Context, org, packageType, return pack, resp, nil } -// Delete a package from an organization. +// DeletePackage deletes a package from an organization. // // GitHub API docs: https://docs.github.com/en/rest/packages#delete-a-package-for-an-organization func (s *OrganizationsService) DeletePackage(ctx context.Context, org, packageType, packageName string) (*Response, error) { @@ -66,7 +66,7 @@ func (s *OrganizationsService) DeletePackage(ctx context.Context, org, packageTy return s.client.Do(ctx, req, nil) } -// Restore a package to an organization. +// RestorePackage restores a package to an organization. // // GitHub API docs: https://docs.github.com/en/rest/packages#restore-a-package-for-an-organization func (s *OrganizationsService) RestorePackage(ctx context.Context, org, packageType, packageName string) (*Response, error) { @@ -79,7 +79,7 @@ func (s *OrganizationsService) RestorePackage(ctx context.Context, org, packageT return s.client.Do(ctx, req, nil) } -// Get all versions of a package in an organization. +// PackageGetAllVersions gets all versions of a package in an organization. // // GitHub API docs: https://docs.github.com/en/rest/packages#list-package-versions-for-a-package-owned-by-an-organization func (s *OrganizationsService) PackageGetAllVersions(ctx context.Context, org, packageType, packageName string, opts *PackageListOptions) ([]*PackageVersion, *Response, error) { @@ -103,7 +103,7 @@ func (s *OrganizationsService) PackageGetAllVersions(ctx context.Context, org, p return versions, resp, nil } -// Get a specific version of a package in an organization. +// PackageGetVersion gets a specific version of a package in an organization. // // GitHub API docs: https://docs.github.com/en/rest/packages#get-a-package-version-for-an-organization func (s *OrganizationsService) PackageGetVersion(ctx context.Context, org, packageType, packageName string, packageVersionID int64) (*PackageVersion, *Response, error) { @@ -122,7 +122,7 @@ func (s *OrganizationsService) PackageGetVersion(ctx context.Context, org, packa return version, resp, nil } -// Delete a package version from an organization. +// PackageDeleteVersion deletes a package version from an organization. // // GitHub API docs: https://docs.github.com/en/rest/packages#delete-package-version-for-an-organization func (s *OrganizationsService) PackageDeleteVersion(ctx context.Context, org, packageType, packageName string, packageVersionID int64) (*Response, error) { @@ -135,7 +135,7 @@ func (s *OrganizationsService) PackageDeleteVersion(ctx context.Context, org, pa return s.client.Do(ctx, req, nil) } -// Restore a package version to an organization. +// PackageRestoreVersion restores a package version to an organization. // // GitHub API docs: https://docs.github.com/en/rest/packages#restore-package-version-for-an-organization func (s *OrganizationsService) PackageRestoreVersion(ctx context.Context, org, packageType, packageName string, packageVersionID int64) (*Response, error) { diff --git a/github/rate_limit.go b/github/rate_limit.go index 4243a144033..838c3ba7966 100644 --- a/github/rate_limit.go +++ b/github/rate_limit.go @@ -58,7 +58,7 @@ func (r RateLimits) String() string { return Stringify(r) } -// RateLimits returns the rate limits for the current client. +// Get returns the rate limits for the current client. func (s *RateLimitService) Get(ctx context.Context) (*RateLimits, *Response, error) { req, err := s.client.NewRequest("GET", "rate_limit", nil) if err != nil { diff --git a/github/reactions.go b/github/reactions.go index 14d193ae887..f06a8ef3dbc 100644 --- a/github/reactions.go +++ b/github/reactions.go @@ -493,7 +493,7 @@ func (s *ReactionsService) deleteReaction(ctx context.Context, url string) (*Res return s.client.Do(ctx, req, nil) } -// Create a reaction to a release. +// CreateReleaseReaction creates a reaction to a release. // Note that a response with a Status: 200 OK means that you already // added the reaction type to this release. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". diff --git a/github/repos.go b/github/repos.go index f2059926ec8..60ff9b41347 100644 --- a/github/repos.go +++ b/github/repos.go @@ -1153,7 +1153,8 @@ type AllowForcePushes struct { Enabled bool `json:"enabled"` } -// RequiredConversationResolution, if enabled, requires all comments on the pull request to be resolved before it can be merged to a protected branch. +// RequiredConversationResolution requires all comments on the pull request to be resolved before it can be +// merged to a protected branch when enabled. type RequiredConversationResolution struct { Enabled bool `json:"enabled"` } diff --git a/github/repos_pages.go b/github/repos_pages.go index 83075dbdd23..060f6eb8b1d 100644 --- a/github/repos_pages.go +++ b/github/repos_pages.go @@ -286,7 +286,7 @@ func (s *RepositoriesService) RequestPageBuild(ctx context.Context, owner, repo return build, resp, nil } -// GetPagesHealthCheck gets a DNS health check for the CNAME record configured for a repository's GitHub Pages. +// GetPageHealthCheck gets a DNS health check for the CNAME record configured for a repository's GitHub Pages. // // GitHub API docs: https://docs.github.com/en/rest/pages#get-a-dns-health-check-for-github-pages func (s *RepositoriesService) GetPageHealthCheck(ctx context.Context, owner, repo string) (*PagesHealthCheckResponse, *Response, error) { diff --git a/github/repos_rules.go b/github/repos_rules.go index 7f964fe6655..2c24f8c27b3 100644 --- a/github/repos_rules.go +++ b/github/repos_rules.go @@ -48,7 +48,7 @@ type RulesetRepositoryIDsConditionParameters struct { RepositoryIDs []int64 `json:"repository_ids,omitempty"` } -// RulesetCondition represents the conditions object in a ruleset. +// RulesetConditions represents the conditions object in a ruleset. // Set either RepositoryName or RepositoryID, not both. type RulesetConditions struct { RefName *RulesetRefConditionParameters `json:"ref_name,omitempty"` diff --git a/github/secret_scanning.go b/github/secret_scanning.go index 30d3da8ebf8..ddcbfc1b667 100644 --- a/github/secret_scanning.go +++ b/github/secret_scanning.go @@ -90,7 +90,7 @@ type SecretScanningAlertUpdateOptions struct { Resolution *string `json:"resolution,omitempty"` } -// Lists secret scanning alerts for eligible repositories in an enterprise, from newest to oldest. +// ListAlertsForEnterprise lists secret scanning alerts for eligible repositories in an enterprise, from newest to oldest. // // To use this endpoint, you must be a member of the enterprise, and you must use an access token with the repo scope or // security_events scope. Alerts are only returned for organizations in the enterprise for which you are an organization owner or a security manager. @@ -117,7 +117,7 @@ func (s *SecretScanningService) ListAlertsForEnterprise(ctx context.Context, ent return alerts, resp, nil } -// Lists secret scanning alerts for eligible repositories in an organization, from newest to oldest. +// ListAlertsForOrg lists secret scanning alerts for eligible repositories in an organization, from newest to oldest. // // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. @@ -144,7 +144,7 @@ func (s *SecretScanningService) ListAlertsForOrg(ctx context.Context, org string return alerts, resp, nil } -// Lists secret scanning alerts for a private repository, from newest to oldest. +// ListAlertsForRepo lists secret scanning alerts for a private repository, from newest to oldest. // // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. @@ -171,7 +171,7 @@ func (s *SecretScanningService) ListAlertsForRepo(ctx context.Context, owner, re return alerts, resp, nil } -// Gets a single secret scanning alert detected in a private repository. +// GetAlert gets a single secret scanning alert detected in a private repository. // // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. @@ -194,7 +194,7 @@ func (s *SecretScanningService) GetAlert(ctx context.Context, owner, repo string return alert, resp, nil } -// Updates the status of a secret scanning alert in a private repository. +// UpdateAlert updates the status of a secret scanning alert in a private repository. // // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. @@ -217,7 +217,7 @@ func (s *SecretScanningService) UpdateAlert(ctx context.Context, owner, repo str return alert, resp, nil } -// Lists all locations for a given secret scanning alert for a private repository. +// ListLocationsForAlert lists all locations for a given secret scanning alert for a private repository. // // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. diff --git a/github/users_packages.go b/github/users_packages.go index da04919eccd..c3ffc6ab074 100644 --- a/github/users_packages.go +++ b/github/users_packages.go @@ -10,7 +10,7 @@ import ( "fmt" ) -// List the packages for a user. Passing the empty string for "user" will +// ListPackages lists the packages for a user. Passing the empty string for "user" will // list packages for the authenticated user. // // GitHub API docs: https://docs.github.com/en/rest/packages#list-packages-for-the-authenticated-users-namespace @@ -41,7 +41,7 @@ func (s *UsersService) ListPackages(ctx context.Context, user string, opts *Pack return packages, resp, nil } -// Get a package by name for a user. Passing the empty string for "user" will +// GetPackage gets a package by name for a user. Passing the empty string for "user" will // get the package for the authenticated user. // // GitHub API docs: https://docs.github.com/en/rest/packages#get-a-package-for-the-authenticated-user @@ -68,7 +68,7 @@ func (s *UsersService) GetPackage(ctx context.Context, user, packageType, packag return pack, resp, nil } -// Delete a package from a user. Passing the empty string for "user" will +// DeletePackage deletes a package from a user. Passing the empty string for "user" will // delete the package for the authenticated user. // // GitHub API docs: https://docs.github.com/en/rest/packages#delete-a-package-for-the-authenticated-user @@ -89,7 +89,7 @@ func (s *UsersService) DeletePackage(ctx context.Context, user, packageType, pac return s.client.Do(ctx, req, nil) } -// Restore a package to a user. Passing the empty string for "user" will +// RestorePackage restores a package to a user. Passing the empty string for "user" will // restore the package for the authenticated user. // // GitHub API docs: https://docs.github.com/en/rest/packages#restore-a-package-for-the-authenticated-user @@ -110,7 +110,7 @@ func (s *UsersService) RestorePackage(ctx context.Context, user, packageType, pa return s.client.Do(ctx, req, nil) } -// Get all versions of a package for a user. Passing the empty string for "user" will +// PackageGetAllVersions gets all versions of a package for a user. Passing the empty string for "user" will // get versions for the authenticated user. // // GitHub API docs: https://docs.github.com/en/rest/packages#get-all-package-versions-for-a-package-owned-by-the-authenticated-user @@ -141,7 +141,7 @@ func (s *UsersService) PackageGetAllVersions(ctx context.Context, user, packageT return versions, resp, nil } -// Get a specific version of a package for a user. Passing the empty string for "user" will +// PackageGetVersion gets a specific version of a package for a user. Passing the empty string for "user" will // get the version for the authenticated user. // // GitHub API docs: https://docs.github.com/en/rest/packages#get-a-package-version-for-the-authenticated-user @@ -168,7 +168,7 @@ func (s *UsersService) PackageGetVersion(ctx context.Context, user, packageType, return version, resp, nil } -// Delete a package version for a user. Passing the empty string for "user" will +// PackageDeleteVersion deletes a package version for a user. Passing the empty string for "user" will // delete the version for the authenticated user. // // GitHub API docs: https://docs.github.com/en/rest/packages#delete-a-package-version-for-the-authenticated-user @@ -189,7 +189,7 @@ func (s *UsersService) PackageDeleteVersion(ctx context.Context, user, packageTy return s.client.Do(ctx, req, nil) } -// Restore a package version to a user. Passing the empty string for "user" will +// PackageRestoreVersion restores a package version to a user. Passing the empty string for "user" will // restore the version for the authenticated user. // // GitHub API docs: https://docs.github.com/en/rest/packages#restore-a-package-version-for-the-authenticated-user diff --git a/github/users_ssh_signing_keys.go b/github/users_ssh_signing_keys.go index 567623f8875..23e4c36aea3 100644 --- a/github/users_ssh_signing_keys.go +++ b/github/users_ssh_signing_keys.go @@ -93,7 +93,7 @@ func (s *UsersService) CreateSSHSigningKey(ctx context.Context, key *Key) (*SSHS return k, resp, nil } -// DeleteKey deletes a SSH signing key for the authenticated user. +// DeleteSSHSigningKey deletes a SSH signing key for the authenticated user. // // GitHub API docs: https://docs.github.com/en/rest/users/ssh-signing-keys#delete-an-ssh-signing-key-for-the-authenticated-user func (s *UsersService) DeleteSSHSigningKey(ctx context.Context, id int64) (*Response, error) { From 5b34ea7816491eb20286d951b04081ab4de6d381 Mon Sep 17 00:00:00 2001 From: schaffe-cb <137919538+schaffe-cb@users.noreply.github.com> Date: Wed, 25 Oct 2023 14:00:20 -0700 Subject: [PATCH 343/751] Add referenced workflows to WorkflowRun (#2975) Fixes: #2974. --- github/actions_workflow_runs.go | 73 +++++++++++++++------------- github/actions_workflow_runs_test.go | 16 +++++- github/github-accessors.go | 24 +++++++++ github/github-accessors_test.go | 30 ++++++++++++ 4 files changed, 109 insertions(+), 34 deletions(-) diff --git a/github/actions_workflow_runs.go b/github/actions_workflow_runs.go index 390c26af9c3..d57e4887db1 100644 --- a/github/actions_workflow_runs.go +++ b/github/actions_workflow_runs.go @@ -14,39 +14,40 @@ import ( // WorkflowRun represents a repository action workflow run. type WorkflowRun struct { - ID *int64 `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - NodeID *string `json:"node_id,omitempty"` - HeadBranch *string `json:"head_branch,omitempty"` - HeadSHA *string `json:"head_sha,omitempty"` - RunNumber *int `json:"run_number,omitempty"` - RunAttempt *int `json:"run_attempt,omitempty"` - Event *string `json:"event,omitempty"` - DisplayTitle *string `json:"display_title,omitempty"` - Status *string `json:"status,omitempty"` - Conclusion *string `json:"conclusion,omitempty"` - WorkflowID *int64 `json:"workflow_id,omitempty"` - CheckSuiteID *int64 `json:"check_suite_id,omitempty"` - CheckSuiteNodeID *string `json:"check_suite_node_id,omitempty"` - URL *string `json:"url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - PullRequests []*PullRequest `json:"pull_requests,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - RunStartedAt *Timestamp `json:"run_started_at,omitempty"` - JobsURL *string `json:"jobs_url,omitempty"` - LogsURL *string `json:"logs_url,omitempty"` - CheckSuiteURL *string `json:"check_suite_url,omitempty"` - ArtifactsURL *string `json:"artifacts_url,omitempty"` - CancelURL *string `json:"cancel_url,omitempty"` - RerunURL *string `json:"rerun_url,omitempty"` - PreviousAttemptURL *string `json:"previous_attempt_url,omitempty"` - HeadCommit *HeadCommit `json:"head_commit,omitempty"` - WorkflowURL *string `json:"workflow_url,omitempty"` - Repository *Repository `json:"repository,omitempty"` - HeadRepository *Repository `json:"head_repository,omitempty"` - Actor *User `json:"actor,omitempty"` - TriggeringActor *User `json:"triggering_actor,omitempty"` + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + NodeID *string `json:"node_id,omitempty"` + HeadBranch *string `json:"head_branch,omitempty"` + HeadSHA *string `json:"head_sha,omitempty"` + RunNumber *int `json:"run_number,omitempty"` + RunAttempt *int `json:"run_attempt,omitempty"` + Event *string `json:"event,omitempty"` + DisplayTitle *string `json:"display_title,omitempty"` + Status *string `json:"status,omitempty"` + Conclusion *string `json:"conclusion,omitempty"` + WorkflowID *int64 `json:"workflow_id,omitempty"` + CheckSuiteID *int64 `json:"check_suite_id,omitempty"` + CheckSuiteNodeID *string `json:"check_suite_node_id,omitempty"` + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + PullRequests []*PullRequest `json:"pull_requests,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + RunStartedAt *Timestamp `json:"run_started_at,omitempty"` + JobsURL *string `json:"jobs_url,omitempty"` + LogsURL *string `json:"logs_url,omitempty"` + CheckSuiteURL *string `json:"check_suite_url,omitempty"` + ArtifactsURL *string `json:"artifacts_url,omitempty"` + CancelURL *string `json:"cancel_url,omitempty"` + RerunURL *string `json:"rerun_url,omitempty"` + PreviousAttemptURL *string `json:"previous_attempt_url,omitempty"` + HeadCommit *HeadCommit `json:"head_commit,omitempty"` + WorkflowURL *string `json:"workflow_url,omitempty"` + Repository *Repository `json:"repository,omitempty"` + HeadRepository *Repository `json:"head_repository,omitempty"` + Actor *User `json:"actor,omitempty"` + TriggeringActor *User `json:"triggering_actor,omitempty"` + ReferencedWorkflows []*ReferencedWorkflow `json:"referenced_workflows,omitempty"` } // WorkflowRuns represents a slice of repository action workflow run. @@ -104,6 +105,12 @@ type PendingDeploymentsRequest struct { Comment string `json:"comment"` } +type ReferencedWorkflow struct { + Path *string `json:"path,omitempty"` + SHA *string `json:"sha,omitempty"` + Ref *string `json:"ref,omitempty"` +} + func (s *ActionsService) listWorkflowRuns(ctx context.Context, endpoint string, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) { u, err := addOptions(endpoint, opts) if err != nil { diff --git a/github/actions_workflow_runs_test.go b/github/actions_workflow_runs_test.go index 8a573c20ac2..b4b1c9177f6 100644 --- a/github/actions_workflow_runs_test.go +++ b/github/actions_workflow_runs_test.go @@ -761,6 +761,13 @@ func TestWorkflowRun_Marshal(t *testing.T) { SuspendedAt: &Timestamp{referenceTime}, URL: String("u2"), }, + ReferencedWorkflows: []*ReferencedWorkflow{ + { + Path: String("rwfp"), + SHA: String("rwfsha"), + Ref: String("rwfref"), + }, + }, } want := `{ @@ -881,7 +888,14 @@ func TestWorkflowRun_Marshal(t *testing.T) { "created_at": ` + referenceTimeStr + `, "suspended_at": ` + referenceTimeStr + `, "url": "u2" - } + }, + "referenced_workflows": [ + { + "path": "rwfp", + "sha": "rwfsha", + "ref": "rwfref" + } + ] }` testJSONMarshal(t, u, want) diff --git a/github/github-accessors.go b/github/github-accessors.go index 199c9b8a37d..fc79d01d7c8 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -17710,6 +17710,30 @@ func (r *Reference) GetURL() string { return *r.URL } +// GetPath returns the Path field if it's non-nil, zero value otherwise. +func (r *ReferencedWorkflow) GetPath() string { + if r == nil || r.Path == nil { + return "" + } + return *r.Path +} + +// GetRef returns the Ref field if it's non-nil, zero value otherwise. +func (r *ReferencedWorkflow) GetRef() string { + if r == nil || r.Ref == nil { + return "" + } + return *r.Ref +} + +// GetSHA returns the SHA field if it's non-nil, zero value otherwise. +func (r *ReferencedWorkflow) GetSHA() string { + if r == nil || r.SHA == nil { + return "" + } + return *r.SHA +} + // GetExpiresAt returns the ExpiresAt field if it's non-nil, zero value otherwise. func (r *RegistrationToken) GetExpiresAt() Timestamp { if r == nil || r.ExpiresAt == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index d179a927750..ff4a49d7fb7 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -20521,6 +20521,36 @@ func TestReference_GetURL(tt *testing.T) { r.GetURL() } +func TestReferencedWorkflow_GetPath(tt *testing.T) { + var zeroValue string + r := &ReferencedWorkflow{Path: &zeroValue} + r.GetPath() + r = &ReferencedWorkflow{} + r.GetPath() + r = nil + r.GetPath() +} + +func TestReferencedWorkflow_GetRef(tt *testing.T) { + var zeroValue string + r := &ReferencedWorkflow{Ref: &zeroValue} + r.GetRef() + r = &ReferencedWorkflow{} + r.GetRef() + r = nil + r.GetRef() +} + +func TestReferencedWorkflow_GetSHA(tt *testing.T) { + var zeroValue string + r := &ReferencedWorkflow{SHA: &zeroValue} + r.GetSHA() + r = &ReferencedWorkflow{} + r.GetSHA() + r = nil + r.GetSHA() +} + func TestRegistrationToken_GetExpiresAt(tt *testing.T) { var zeroValue Timestamp r := &RegistrationToken{ExpiresAt: &zeroValue} From a54bc7da1d91a3d2de234741640965ac9ece6d74 Mon Sep 17 00:00:00 2001 From: WillAbides <233500+WillAbides@users.noreply.github.com> Date: Fri, 3 Nov 2023 09:26:59 -0500 Subject: [PATCH 344/751] Use metadata to reconcile go-github with GitHub's OpenAPI descriptions (#2919) --- .codecov.yml | 4 +- .github/dependabot.yml | 2 +- .github/workflows/linter.yml | 3 + .golangci.yml | 2 +- CONTRIBUTING.md | 121 +- github/actions.go | 2 +- github/actions_artifacts.go | 26 +- github/actions_cache.go | 40 +- github/actions_oidc.go | 16 +- github/actions_permissions_enterprise.go | 16 + github/actions_permissions_orgs.go | 36 +- github/actions_required_workflows.go | 40 +- github/actions_runner_groups.go | 52 +- github/actions_runners.go | 56 +- github/actions_secrets.go | 76 +- github/actions_variables.go | 76 +- github/actions_workflow_jobs.go | 12 +- github/actions_workflow_runs.go | 60 +- github/actions_workflows.go | 44 +- github/activity.go | 6 +- github/activity_events.go | 38 +- github/activity_notifications.go | 38 +- github/activity_star.go | 23 +- github/activity_watching.go | 23 +- github/admin.go | 10 +- github/admin_orgs.go | 12 +- github/admin_stats.go | 4 +- github/admin_users.go | 16 +- github/apps.go | 65 +- github/apps_hooks.go | 8 +- github/apps_hooks_deliveries.go | 12 +- github/apps_installation.go | 20 +- github/apps_manifest.go | 4 +- github/apps_marketplace.go | 29 +- github/authorizations.go | 30 +- github/billing.go | 30 +- github/checks.go | 50 +- github/code-scanning.go | 70 +- github/codesofconduct.go | 4 + github/codespaces.go | 28 +- github/codespaces_secrets.go | 92 +- github/dependabot.go | 2 +- github/dependabot_alerts.go | 12 +- github/dependabot_secrets.go | 56 +- github/dependency_graph.go | 4 +- github/doc.go | 6 +- github/emojis.go | 2 + github/enterprise.go | 2 +- github/enterprise_actions_runner_groups.go | 52 +- github/enterprise_actions_runners.go | 20 +- github/enterprise_audit_log.go | 4 +- .../enterprise_code_security_and_analysis.go | 12 +- github/event_types.go | 124 +- github/gists.go | 61 +- github/gists_comments.go | 20 +- github/git.go | 2 +- github/git_blobs.go | 12 +- github/git_commits.go | 8 +- github/git_refs.go | 20 +- github/git_tags.go | 8 +- github/git_trees.go | 8 +- github/github.go | 23 +- github/gitignore.go | 10 +- github/interactions.go | 2 +- github/interactions_orgs.go | 12 +- github/interactions_repos.go | 12 +- github/issue_import.go | 12 +- github/issues.go | 43 +- github/issues_assignees.go | 16 +- github/issues_comments.go | 23 +- github/issues_events.go | 12 +- github/issues_labels.go | 44 +- github/issues_milestones.go | 20 +- github/issues_timeline.go | 6 +- github/licenses.go | 10 +- github/markdown.go | 2 + github/messages.go | 4 +- github/meta.go | 6 + github/migrations.go | 26 +- github/migrations_source_import.go | 36 +- github/migrations_user.go | 24 +- github/orgs.go | 33 +- github/orgs_actions_allowed.go | 10 +- github/orgs_actions_permissions.go | 10 +- github/orgs_audit_log.go | 6 +- github/orgs_credential_authorizations.go | 8 +- github/orgs_custom_roles.go | 18 +- github/orgs_hooks.go | 24 +- github/orgs_hooks_configuration.go | 8 +- github/orgs_hooks_deliveries.go | 12 +- github/orgs_members.go | 65 +- github/orgs_outside_collaborators.go | 12 +- github/orgs_packages.go | 32 +- github/orgs_personal_access_tokens.go | 4 +- github/orgs_projects.go | 8 +- github/orgs_rules.go | 20 +- github/orgs_security_managers.go | 12 +- github/orgs_users_blocking.go | 16 +- github/projects.go | 82 +- github/pulls.go | 48 +- github/pulls_comments.go | 29 +- github/pulls_reviewers.go | 12 +- github/pulls_reviews.go | 34 +- github/rate_limit.go | 4 + github/reactions.go | 102 +- github/repos.go | 268 +- github/repos_actions_access.go | 10 +- github/repos_actions_allowed.go | 8 +- github/repos_actions_permissions.go | 10 +- github/repos_autolinks.go | 16 +- github/repos_codeowners.go | 4 +- github/repos_collaborators.go | 22 +- github/repos_comments.go | 24 +- github/repos_commits.go | 29 +- github/repos_community_health.go | 4 +- github/repos_contents.go | 36 +- github/repos_deployment_branch_policies.go | 20 +- github/repos_deployments.go | 28 +- github/repos_environments.go | 18 +- github/repos_forks.go | 8 +- github/repos_hooks.go | 36 +- github/repos_hooks_configuration.go | 8 +- github/repos_hooks_deliveries.go | 16 +- github/repos_invitations.go | 12 +- github/repos_keys.go | 16 +- github/repos_lfs.go | 8 +- github/repos_merging.go | 8 +- github/repos_pages.go | 36 +- github/repos_prereceive_hooks.go | 16 +- github/repos_projects.go | 8 +- github/repos_releases.go | 56 +- github/repos_rules.go | 24 +- github/repos_stats.go | 20 +- github/repos_statuses.go | 12 +- github/repos_tags.go | 12 +- github/repos_traffic.go | 16 +- github/scim.go | 32 +- github/search.go | 34 +- github/secret_scanning.go | 28 +- github/security_advisories.go | 12 +- github/teams.go | 151 +- github/teams_discussion_comments.go | 40 +- github/teams_discussions.go | 40 +- github/teams_members.go | 40 +- github/users.go | 39 +- github/users_administration.go | 16 +- github/users_blocking.go | 16 +- github/users_emails.go | 16 +- github/users_followers.go | 29 +- github/users_gpg_keys.go | 19 +- github/users_keys.go | 19 +- github/users_packages.go | 56 +- github/users_projects.go | 8 +- github/users_ssh_signing_keys.go | 19 +- openapi_operations.yaml | 6291 +++++++++++++++++ script/lint.sh | 27 +- script/metadata.sh | 14 + script/test.sh | 6 + tools/go.mod | 24 + tools/go.sum | 61 + tools/metadata/main.go | 194 + tools/metadata/main_test.go | 422 ++ tools/metadata/metadata.go | 520 ++ tools/metadata/metadata_test.go | 28 + tools/metadata/openapi.go | 172 + .../testdata/format/openapi_operations.yaml | 16 + .../golden/TestFormat/openapi_operations.yaml | 13 + .../golden/TestUpdateGo/valid/github/a.go | 37 + .../TestUpdateOpenAPI/openapi_operations.yaml | 14 + tools/metadata/testdata/unused/github/a.go | 8 + .../testdata/unused/openapi_operations.yaml | 15 + .../testdata/update-go/invalid/github/a.go | 24 + .../update-go/invalid/openapi_operations.yaml | 16 + .../testdata/update-go/valid/github/a.go | 31 + .../update-go/valid/github/ignoreme.txt | 0 .../update-go/valid/openapi_operations.yaml | 13 + .../update-openapi/openapi_operations.yaml | 4 + update-urls/activity-events_test.go | 190 - update-urls/go.mod | 8 - update-urls/go.sum | 4 - update-urls/main.go | 1352 ---- update-urls/main_test.go | 617 -- update-urls/reactions_test.go | 140 - update-urls/testdata/activity-events.html | 5686 --------------- .../testdata/activity_events-original.go | 196 - update-urls/testdata/activity_events-want.go | 196 - update-urls/testdata/reactions-original.go | 490 -- update-urls/testdata/reactions-want.go | 490 -- update-urls/testdata/reactions.html | 5690 --------------- 189 files changed, 10969 insertions(+), 16146 deletions(-) create mode 100644 openapi_operations.yaml create mode 100755 script/metadata.sh create mode 100644 tools/go.mod create mode 100644 tools/go.sum create mode 100644 tools/metadata/main.go create mode 100644 tools/metadata/main_test.go create mode 100644 tools/metadata/metadata.go create mode 100644 tools/metadata/metadata_test.go create mode 100644 tools/metadata/openapi.go create mode 100644 tools/metadata/testdata/format/openapi_operations.yaml create mode 100644 tools/metadata/testdata/golden/TestFormat/openapi_operations.yaml create mode 100644 tools/metadata/testdata/golden/TestUpdateGo/valid/github/a.go create mode 100644 tools/metadata/testdata/golden/TestUpdateOpenAPI/openapi_operations.yaml create mode 100644 tools/metadata/testdata/unused/github/a.go create mode 100644 tools/metadata/testdata/unused/openapi_operations.yaml create mode 100644 tools/metadata/testdata/update-go/invalid/github/a.go create mode 100644 tools/metadata/testdata/update-go/invalid/openapi_operations.yaml create mode 100644 tools/metadata/testdata/update-go/valid/github/a.go create mode 100644 tools/metadata/testdata/update-go/valid/github/ignoreme.txt create mode 100644 tools/metadata/testdata/update-go/valid/openapi_operations.yaml create mode 100644 tools/metadata/testdata/update-openapi/openapi_operations.yaml delete mode 100644 update-urls/activity-events_test.go delete mode 100644 update-urls/go.mod delete mode 100644 update-urls/go.sum delete mode 100644 update-urls/main.go delete mode 100644 update-urls/main_test.go delete mode 100644 update-urls/reactions_test.go delete mode 100644 update-urls/testdata/activity-events.html delete mode 100644 update-urls/testdata/activity_events-original.go delete mode 100644 update-urls/testdata/activity_events-want.go delete mode 100644 update-urls/testdata/reactions-original.go delete mode 100644 update-urls/testdata/reactions-want.go delete mode 100644 update-urls/testdata/reactions.html diff --git a/.codecov.yml b/.codecov.yml index 2ef223a6e96..6488176ce17 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -3,5 +3,5 @@ ignore: - "github/github-accessors.go" # ignore experimental scrape package - "scrape" - # ignore update-urls - - "update-urls" + # ignore tools + - "tools" diff --git a/.github/dependabot.yml b/.github/dependabot.yml index d4960c13431..0c068c6c1ac 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,7 +9,7 @@ updates: schedule: interval: weekly - package-ecosystem: gomod - directory: update-urls + directory: tools schedule: interval: weekly - package-ecosystem: github-actions diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 98a1f5de8be..f9d6d7e4639 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -14,3 +14,6 @@ jobs: go-version: 1.x cache-dependency-path: "**/go.sum" - run: script/lint.sh + env: + CHECK_GITHUB_OPENAPI: 1 + GITHUB_TOKEN: ${{ github.token }} diff --git a/.golangci.yml b/.golangci.yml index 1770bd2e417..79d8481fd63 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -50,4 +50,4 @@ issues: # We don't care about file inclusion via variable in examples or internal tools. - linters: [ gosec ] text: 'G304: Potential file inclusion via variable' - path: '^(example|update-urls)\/' + path: '^(example|tools)\/' diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 451924ce4c3..e1fdbef5abe 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,10 +1,9 @@ -# How to contribute # +# How to contribute We'd love to accept your patches and contributions to this project. There are a just a few small guidelines you need to follow. - -## Contributor License Agreement ## +## Contributor License Agreement Contributions to any Google project must be accompanied by a Contributor License Agreement. This is not a copyright **assignment**, it simply gives @@ -17,7 +16,7 @@ You generally only need to submit a CLA once, so if you've already submitted one again. -## Reporting issues ## +## Reporting issues Bugs, feature requests, and development-related questions should be directed to our [GitHub issue tracker](https://github.com/google/go-github/issues). If @@ -29,7 +28,7 @@ how the requested feature would help you do that. Security related bugs can either be reported in the issue tracker, or if they are more sensitive, emailed to . -## Submitting a patch ## +## Submitting a patch 1. It's generally best to start by opening a new issue describing the bug or feature you're intending to fix. Even if you think it's relatively minor, @@ -73,7 +72,112 @@ are more sensitive, emailed to . [pull request]: https://help.github.com/articles/creating-a-pull-request [monitored by codecov.io]: https://codecov.io/gh/google/go-github -## Scripts ## +## Code Comments + +Every exported method needs to have code comments that follow +[Go Doc Comments][]. A typical method's comments will look like this: + +```go +// Get fetches a repository. +// +// GitHub API docs: https://docs.github.com/rest/repos/repos#get-a-repository +// +//meta:operation GET /repos/{owner}/{repo} +func (s *RepositoriesService) Get(ctx context.Context, owner, repo string) (*Repository, *Response, error) { +u := fmt.Sprintf("repos/%v/%v", owner, repo) +req, err := s.client.NewRequest("GET", u, nil) +... +} +``` + +The first line is the name of the method followed by a short description. This +could also be a longer description if needed, but there is no need to repeat any +details that are documented in GitHub's documentation because users are expected +to follow the documentation links to learn more. + +After the description comes a link to the GitHub API documentation. This is +added or fixed automatically when you run `script/generate.sh`, so you won't +need to set this yourself. + +Finally, the `//meta:operation` comment is a directive to the code generator +that maps the method to the corresponding OpenAPI operation. Once again, there +can be multiple directives for methods that call multiple +endpoints. `script/generate.sh` will normalize these directives for you, so if +you are adding a new method you can use the pattern from the `u := fmt.Sprintf` +line instead of looking up what the url parameters are called in the OpenAPI +description. + +[Go Doc Comments]: https://go.dev/doc/comment + +## Metadata + +GitHub publishes [OpenAPI descriptions of their API][]. We use these +descriptions to keep documentation links up to date and to keep track of which +methods call which endpoints via the `//meta:operation` comments described +above. GitHub's descriptions are far too large to keep in this repository or to +pull down every time we generate code, so we keep only the metadata we need +in `openapi_operations.yaml`. + +### openapi_operations.yaml + +Most contributors won't need to interact with `openapi_operations.yaml`, but it +may be useful to know what it is. Its sections are: + +- `openapi_operations` - is the metadata that comes from GitHub's OpenAPI + descriptions. It is generated by `script/metadata.sh update-openapi` and + should not be edited by hand. In the rare case where it needs to be + overridden, use the `operation_overrides` section instead. + + An operation consists of `name`, `documentation_url`, + and `openapi_files`. `openapi_files` is the list of files where the operation + is described. In order or preference, values can be "api.github.com.json" for + operations available on the free plan, "ghec.json" for operations available on + GitHub Enterprise Cloud or "ghes-.json" for operations available on + GitHub Enterprise Server. When an operation is described in multiple ghes + files, only the most recent version is included. `documentation_url` is the + URL that should be linked from godoc. It is the documentation link found in + the first file listed in `openapi_files`. + +- `openapi_commit` - is the git commit that `script/metadata.sh update-openapi` + saw when it last updated `openapi_operations`. It is not necessarily the most + recent commit seen because `update-openapi` doesn't update the file when + there are no changes to `openapi_operations`. + +- `operations` - contains manually added metadata that is not in GitHub's + OpenAPI descriptions. There are only a few of these. Some have + documentation_urls that point to relevant GitHub documentation that is not in + the OpenAPI descriptions. Others have no documentation_url and result in a + note in the generated code that the documentation is missing. + +- `operation_overrides` - is where we override the documentation_url for + operations where the link in the OpenAPI descriptions is wrong. + +### tools/metadata + +The `tools/metadata` package is a command-line tool for working with metadata. +In a typical workflow, you won't use it directly, but you will use it indirectly +through `script/generate.sh` and `script/lint.sh`. + +Its subcommands are: + +- `update-openapi` - updates `openapi_operations.yaml` with the latest + information from GitHub's OpenAPI descriptions. With `--validate` it will + validate that the descriptions are correct as of the commit + in `openapi_commit`. `update-openapi --validate` is called + by `script/lint.sh`. + +- `update-go` - updates Go files with documentation URLs and formats comments. + It is used by `script/generate.sh`. + +- `format` - formats whitespace in `openapi_operations.yaml` and sorts its + arrays. It is used by `script/fmt.sh`. + +- `unused` - lists operations from `openapi_operations.yaml` that are not mapped + from any methods. + +[OpenAPI descriptions of their API]: https://github.com/github/rest-api-description + +## Scripts The `script` directory has shell scripts that help with common development tasks. @@ -86,6 +190,9 @@ tasks. **script/lint.sh** runs linters on the project and checks generated files are current. +**script/metadata.sh** runs `tools/metadata`. See the [Metadata](#metadata) +section for more information. + **script/test.sh** runs tests on all modules. ## Other notes on code organization ## @@ -104,7 +211,7 @@ defined at live in [repos_hooks.go]: https://github.com/google/go-github/blob/master/github/repos_hooks.go -## Maintainer's Guide ## +## Maintainer's Guide (These notes are mostly only for people merging in pull requests.) diff --git a/github/actions.go b/github/actions.go index 8d552f2d0db..4b88a1e1145 100644 --- a/github/actions.go +++ b/github/actions.go @@ -8,5 +8,5 @@ package github // ActionsService handles communication with the actions related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/actions/ +// GitHub API docs: https://docs.github.com/rest/actions/ type ActionsService service diff --git a/github/actions_artifacts.go b/github/actions_artifacts.go index 6389268b4ea..f804b809b4a 100644 --- a/github/actions_artifacts.go +++ b/github/actions_artifacts.go @@ -14,7 +14,7 @@ import ( // ArtifactWorkflowRun represents a GitHub artifact's workflow run. // -// GitHub API docs: https://docs.github.com/en/rest/actions/artifacts +// GitHub API docs: https://docs.github.com/rest/actions/artifacts type ArtifactWorkflowRun struct { ID *int64 `json:"id,omitempty"` RepositoryID *int64 `json:"repository_id,omitempty"` @@ -27,7 +27,7 @@ type ArtifactWorkflowRun struct { // data between jobs in a workflow and provide storage for data // once a workflow is complete. // -// GitHub API docs: https://docs.github.com/en/rest/actions/artifacts +// GitHub API docs: https://docs.github.com/rest/actions/artifacts type Artifact struct { ID *int64 `json:"id,omitempty"` NodeID *string `json:"node_id,omitempty"` @@ -44,7 +44,7 @@ type Artifact struct { // ArtifactList represents a list of GitHub artifacts. // -// GitHub API docs: https://docs.github.com/en/rest/actions/artifacts#artifacts +// GitHub API docs: https://docs.github.com/rest/actions/artifacts#artifacts type ArtifactList struct { TotalCount *int64 `json:"total_count,omitempty"` Artifacts []*Artifact `json:"artifacts,omitempty"` @@ -52,7 +52,9 @@ type ArtifactList struct { // ListArtifacts lists all artifacts that belong to a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/artifacts#list-artifacts-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/artifacts#list-artifacts-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/actions/artifacts func (s *ActionsService) ListArtifacts(ctx context.Context, owner, repo string, opts *ListOptions) (*ArtifactList, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/artifacts", owner, repo) u, err := addOptions(u, opts) @@ -76,7 +78,9 @@ func (s *ActionsService) ListArtifacts(ctx context.Context, owner, repo string, // ListWorkflowRunArtifacts lists all artifacts that belong to a workflow run. // -// GitHub API docs: https://docs.github.com/en/rest/actions/artifacts#list-workflow-run-artifacts +// GitHub API docs: https://docs.github.com/rest/actions/artifacts#list-workflow-run-artifacts +// +//meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts func (s *ActionsService) ListWorkflowRunArtifacts(ctx context.Context, owner, repo string, runID int64, opts *ListOptions) (*ArtifactList, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/artifacts", owner, repo, runID) u, err := addOptions(u, opts) @@ -100,7 +104,9 @@ func (s *ActionsService) ListWorkflowRunArtifacts(ctx context.Context, owner, re // GetArtifact gets a specific artifact for a workflow run. // -// GitHub API docs: https://docs.github.com/en/rest/actions/artifacts#get-an-artifact +// GitHub API docs: https://docs.github.com/rest/actions/artifacts#get-an-artifact +// +//meta:operation GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id} func (s *ActionsService) GetArtifact(ctx context.Context, owner, repo string, artifactID int64) (*Artifact, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/artifacts/%v", owner, repo, artifactID) @@ -120,7 +126,9 @@ func (s *ActionsService) GetArtifact(ctx context.Context, owner, repo string, ar // DownloadArtifact gets a redirect URL to download an archive for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/artifacts#download-an-artifact +// GitHub API docs: https://docs.github.com/rest/actions/artifacts#download-an-artifact +// +//meta:operation GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format} func (s *ActionsService) DownloadArtifact(ctx context.Context, owner, repo string, artifactID int64, maxRedirects int) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/artifacts/%v/zip", owner, repo, artifactID) @@ -144,7 +152,9 @@ func (s *ActionsService) DownloadArtifact(ctx context.Context, owner, repo strin // DeleteArtifact deletes a workflow run artifact. // -// GitHub API docs: https://docs.github.com/en/rest/actions/artifacts#delete-an-artifact +// GitHub API docs: https://docs.github.com/rest/actions/artifacts#delete-an-artifact +// +//meta:operation DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id} func (s *ActionsService) DeleteArtifact(ctx context.Context, owner, repo string, artifactID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/artifacts/%v", owner, repo, artifactID) diff --git a/github/actions_cache.go b/github/actions_cache.go index 9592d9ab62f..271d7d82069 100644 --- a/github/actions_cache.go +++ b/github/actions_cache.go @@ -12,7 +12,7 @@ import ( // ActionsCache represents a GitHub action cache. // -// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#about-the-cache-api +// GitHub API docs: https://docs.github.com/rest/actions/cache#about-the-cache-api type ActionsCache struct { ID *int64 `json:"id,omitempty" url:"-"` Ref *string `json:"ref,omitempty" url:"ref"` @@ -25,7 +25,7 @@ type ActionsCache struct { // ActionsCacheList represents a list of GitHub actions Cache. // -// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#list-github-actions-caches-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/cache#list-github-actions-caches-for-a-repository type ActionsCacheList struct { TotalCount int `json:"total_count"` ActionsCaches []*ActionsCache `json:"actions_caches,omitempty"` @@ -33,7 +33,7 @@ type ActionsCacheList struct { // ActionsCacheUsage represents a GitHub Actions Cache Usage object. // -// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-a-repository type ActionsCacheUsage struct { FullName string `json:"full_name"` ActiveCachesSizeInBytes int64 `json:"active_caches_size_in_bytes"` @@ -42,7 +42,7 @@ type ActionsCacheUsage struct { // ActionsCacheUsageList represents a list of repositories with GitHub Actions cache usage for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-a-repository type ActionsCacheUsageList struct { TotalCount int `json:"total_count"` RepoCacheUsage []*ActionsCacheUsage `json:"repository_cache_usages,omitempty"` @@ -50,7 +50,7 @@ type ActionsCacheUsageList struct { // TotalCacheUsage represents total GitHub actions cache usage of an organization or enterprise. // -// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-an-enterprise +// GitHub API docs: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-an-enterprise type TotalCacheUsage struct { TotalActiveCachesUsageSizeInBytes int64 `json:"total_active_caches_size_in_bytes"` TotalActiveCachesCount int `json:"total_active_caches_count"` @@ -58,7 +58,7 @@ type TotalCacheUsage struct { // ActionsCacheListOptions represents a list of all possible optional Query parameters for ListCaches method. // -// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#list-github-actions-caches-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/cache#list-github-actions-caches-for-a-repository type ActionsCacheListOptions struct { ListOptions // The Git reference for the results you want to list. @@ -77,7 +77,9 @@ type ActionsCacheListOptions struct { // // Permissions: must have the actions:read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#list-github-actions-caches-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/cache#list-github-actions-caches-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/actions/caches func (s *ActionsService) ListCaches(ctx context.Context, owner, repo string, opts *ActionsCacheListOptions) (*ActionsCacheList, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/caches", owner, repo) u, err := addOptions(u, opts) @@ -107,7 +109,9 @@ func (s *ActionsService) ListCaches(ctx context.Context, owner, repo string, opt // // Permissions: You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#delete-github-actions-caches-for-a-repository-using-a-cache-key +// GitHub API docs: https://docs.github.com/rest/actions/cache#delete-github-actions-caches-for-a-repository-using-a-cache-key +// +//meta:operation DELETE /repos/{owner}/{repo}/actions/caches func (s *ActionsService) DeleteCachesByKey(ctx context.Context, owner, repo, key string, ref *string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/caches", owner, repo) u, err := addOptions(u, ActionsCache{Key: &key, Ref: ref}) @@ -127,7 +131,9 @@ func (s *ActionsService) DeleteCachesByKey(ctx context.Context, owner, repo, key // // Permissions: You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#delete-a-github-actions-cache-for-a-repository-using-a-cache-id +// GitHub API docs: https://docs.github.com/rest/actions/cache#delete-a-github-actions-cache-for-a-repository-using-a-cache-id +// +//meta:operation DELETE /repos/{owner}/{repo}/actions/caches/{cache_id} func (s *ActionsService) DeleteCachesByID(ctx context.Context, owner, repo string, cacheID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/caches/%v", owner, repo, cacheID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -144,7 +150,9 @@ func (s *ActionsService) DeleteCachesByID(ctx context.Context, owner, repo strin // Permissions: Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an // access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/actions/cache/usage func (s *ActionsService) GetCacheUsageForRepo(ctx context.Context, owner, repo string) (*ActionsCacheUsage, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/cache/usage", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -167,7 +175,9 @@ func (s *ActionsService) GetCacheUsageForRepo(ctx context.Context, owner, repo s // Permissions: You must authenticate using an access token with the read:org scope to use this endpoint. // GitHub Apps must have the organization_admistration:read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#list-repositories-with-github-actions-cache-usage-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/cache#list-repositories-with-github-actions-cache-usage-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/cache/usage-by-repository func (s *ActionsService) ListCacheUsageByRepoForOrg(ctx context.Context, org string, opts *ListOptions) (*ActionsCacheUsageList, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/cache/usage-by-repository", org) u, err := addOptions(u, opts) @@ -195,7 +205,9 @@ func (s *ActionsService) ListCacheUsageByRepoForOrg(ctx context.Context, org str // Permissions: You must authenticate using an access token with the read:org scope to use this endpoint. // GitHub Apps must have the organization_admistration:read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/cache/usage func (s *ActionsService) GetTotalCacheUsageForOrg(ctx context.Context, org string) (*TotalCacheUsage, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/cache/usage", org) req, err := s.client.NewRequest("GET", u, nil) @@ -217,7 +229,9 @@ func (s *ActionsService) GetTotalCacheUsageForOrg(ctx context.Context, org strin // // Permissions: You must authenticate using an access token with the "admin:enterprise" scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/cache#get-github-actions-cache-usage-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/cache/usage func (s *ActionsService) GetTotalCacheUsageForEnterprise(ctx context.Context, enterprise string) (*TotalCacheUsage, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/cache/usage", enterprise) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/actions_oidc.go b/github/actions_oidc.go index b7f2d26ae9c..596aa9d981e 100644 --- a/github/actions_oidc.go +++ b/github/actions_oidc.go @@ -18,7 +18,9 @@ type OIDCSubjectClaimCustomTemplate struct { // GetOrgOIDCSubjectClaimCustomTemplate gets the subject claim customization template for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/oidc/customization/sub func (s *ActionsService) GetOrgOIDCSubjectClaimCustomTemplate(ctx context.Context, org string) (*OIDCSubjectClaimCustomTemplate, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/oidc/customization/sub", org) return s.getOIDCSubjectClaimCustomTemplate(ctx, u) @@ -26,7 +28,9 @@ func (s *ActionsService) GetOrgOIDCSubjectClaimCustomTemplate(ctx context.Contex // GetRepoOIDCSubjectClaimCustomTemplate gets the subject claim customization template for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/actions/oidc/customization/sub func (s *ActionsService) GetRepoOIDCSubjectClaimCustomTemplate(ctx context.Context, owner, repo string) (*OIDCSubjectClaimCustomTemplate, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/oidc/customization/sub", owner, repo) return s.getOIDCSubjectClaimCustomTemplate(ctx, u) @@ -49,7 +53,9 @@ func (s *ActionsService) getOIDCSubjectClaimCustomTemplate(ctx context.Context, // SetOrgOIDCSubjectClaimCustomTemplate sets the subject claim customization for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-an-organization +// +//meta:operation PUT /orgs/{org}/actions/oidc/customization/sub func (s *ActionsService) SetOrgOIDCSubjectClaimCustomTemplate(ctx context.Context, org string, template *OIDCSubjectClaimCustomTemplate) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/oidc/customization/sub", org) return s.setOIDCSubjectClaimCustomTemplate(ctx, u, template) @@ -57,7 +63,9 @@ func (s *ActionsService) SetOrgOIDCSubjectClaimCustomTemplate(ctx context.Contex // SetRepoOIDCSubjectClaimCustomTemplate sets the subject claim customization for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-a-repository +// +//meta:operation PUT /repos/{owner}/{repo}/actions/oidc/customization/sub func (s *ActionsService) SetRepoOIDCSubjectClaimCustomTemplate(ctx context.Context, owner, repo string, template *OIDCSubjectClaimCustomTemplate) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/oidc/customization/sub", owner, repo) return s.setOIDCSubjectClaimCustomTemplate(ctx, u, template) diff --git a/github/actions_permissions_enterprise.go b/github/actions_permissions_enterprise.go index 1d97fc91b4f..7e10444af47 100644 --- a/github/actions_permissions_enterprise.go +++ b/github/actions_permissions_enterprise.go @@ -32,6 +32,8 @@ func (a ActionsPermissionsEnterprise) String() string { // GetActionsPermissionsInEnterprise gets the GitHub Actions permissions policy for an enterprise. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-github-actions-permissions-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/permissions func (s *ActionsService) GetActionsPermissionsInEnterprise(ctx context.Context, enterprise string) (*ActionsPermissionsEnterprise, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/permissions", enterprise) @@ -52,6 +54,8 @@ func (s *ActionsService) GetActionsPermissionsInEnterprise(ctx context.Context, // EditActionsPermissionsInEnterprise sets the permissions policy in an enterprise. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-github-actions-permissions-for-an-enterprise +// +//meta:operation PUT /enterprises/{enterprise}/actions/permissions func (s *ActionsService) EditActionsPermissionsInEnterprise(ctx context.Context, enterprise string, actionsPermissionsEnterprise ActionsPermissionsEnterprise) (*ActionsPermissionsEnterprise, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/permissions", enterprise) req, err := s.client.NewRequest("PUT", u, actionsPermissionsEnterprise) @@ -71,6 +75,8 @@ func (s *ActionsService) EditActionsPermissionsInEnterprise(ctx context.Context, // ListEnabledOrgsInEnterprise lists the selected organizations that are enabled for GitHub Actions in an enterprise. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#list-selected-organizations-enabled-for-github-actions-in-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/permissions/organizations func (s *ActionsService) ListEnabledOrgsInEnterprise(ctx context.Context, owner string, opts *ListOptions) (*ActionsEnabledOnEnterpriseRepos, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/permissions/organizations", owner) u, err := addOptions(u, opts) @@ -95,6 +101,8 @@ func (s *ActionsService) ListEnabledOrgsInEnterprise(ctx context.Context, owner // SetEnabledOrgsInEnterprise replaces the list of selected organizations that are enabled for GitHub Actions in an enterprise. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-selected-organizations-enabled-for-github-actions-in-an-enterprise +// +//meta:operation PUT /enterprises/{enterprise}/actions/permissions/organizations func (s *ActionsService) SetEnabledOrgsInEnterprise(ctx context.Context, owner string, organizationIDs []int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/permissions/organizations", owner) @@ -116,6 +124,8 @@ func (s *ActionsService) SetEnabledOrgsInEnterprise(ctx context.Context, owner s // AddEnabledOrgInEnterprise adds an organization to the list of selected organizations that are enabled for GitHub Actions in an enterprise. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#enable-a-selected-organization-for-github-actions-in-an-enterprise +// +//meta:operation PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id} func (s *ActionsService) AddEnabledOrgInEnterprise(ctx context.Context, owner string, organizationID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/permissions/organizations/%v", owner, organizationID) @@ -135,6 +145,8 @@ func (s *ActionsService) AddEnabledOrgInEnterprise(ctx context.Context, owner st // RemoveEnabledOrgInEnterprise removes an organization from the list of selected organizations that are enabled for GitHub Actions in an enterprise. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#disable-a-selected-organization-for-github-actions-in-an-enterprise +// +//meta:operation DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id} func (s *ActionsService) RemoveEnabledOrgInEnterprise(ctx context.Context, owner string, organizationID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/permissions/organizations/%v", owner, organizationID) @@ -154,6 +166,8 @@ func (s *ActionsService) RemoveEnabledOrgInEnterprise(ctx context.Context, owner // GetActionsAllowedInEnterprise gets the actions that are allowed in an enterprise. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/permissions/selected-actions func (s *ActionsService) GetActionsAllowedInEnterprise(ctx context.Context, enterprise string) (*ActionsAllowed, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/permissions/selected-actions", enterprise) @@ -174,6 +188,8 @@ func (s *ActionsService) GetActionsAllowedInEnterprise(ctx context.Context, ente // EditActionsAllowedInEnterprise sets the actions that are allowed in an enterprise. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-enterprise +// +//meta:operation PUT /enterprises/{enterprise}/actions/permissions/selected-actions func (s *ActionsService) EditActionsAllowedInEnterprise(ctx context.Context, enterprise string, actionsAllowed ActionsAllowed) (*ActionsAllowed, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/permissions/selected-actions", enterprise) req, err := s.client.NewRequest("PUT", u, actionsAllowed) diff --git a/github/actions_permissions_orgs.go b/github/actions_permissions_orgs.go index d55a2d45a61..1a31e4c6f1b 100644 --- a/github/actions_permissions_orgs.go +++ b/github/actions_permissions_orgs.go @@ -12,7 +12,7 @@ import ( // ActionsPermissions represents a policy for repositories and allowed actions in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions +// GitHub API docs: https://docs.github.com/rest/actions/permissions type ActionsPermissions struct { EnabledRepositories *string `json:"enabled_repositories,omitempty"` AllowedActions *string `json:"allowed_actions,omitempty"` @@ -31,7 +31,7 @@ type ActionsEnabledOnOrgRepos struct { // ActionsAllowed represents selected actions that are allowed. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions +// GitHub API docs: https://docs.github.com/rest/actions/permissions type ActionsAllowed struct { GithubOwnedAllowed *bool `json:"github_owned_allowed,omitempty"` VerifiedAllowed *bool `json:"verified_allowed,omitempty"` @@ -44,7 +44,9 @@ func (a ActionsAllowed) String() string { // GetActionsPermissions gets the GitHub Actions permissions policy for repositories and allowed actions in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#get-github-actions-permissions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/permissions func (s *ActionsService) GetActionsPermissions(ctx context.Context, org string) (*ActionsPermissions, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions", org) @@ -64,7 +66,9 @@ func (s *ActionsService) GetActionsPermissions(ctx context.Context, org string) // EditActionsPermissions sets the permissions policy for repositories and allowed actions in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-github-actions-permissions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-an-organization +// +//meta:operation PUT /orgs/{org}/actions/permissions func (s *ActionsService) EditActionsPermissions(ctx context.Context, org string, actionsPermissions ActionsPermissions) (*ActionsPermissions, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions", org) req, err := s.client.NewRequest("PUT", u, actionsPermissions) @@ -83,7 +87,9 @@ func (s *ActionsService) EditActionsPermissions(ctx context.Context, org string, // ListEnabledReposInOrg lists the selected repositories that are enabled for GitHub Actions in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#list-selected-repositories-enabled-for-github-actions-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions#list-selected-repositories-enabled-for-github-actions-in-an-organization +// +//meta:operation GET /orgs/{org}/actions/permissions/repositories func (s *ActionsService) ListEnabledReposInOrg(ctx context.Context, owner string, opts *ListOptions) (*ActionsEnabledOnOrgRepos, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/repositories", owner) u, err := addOptions(u, opts) @@ -107,7 +113,9 @@ func (s *ActionsService) ListEnabledReposInOrg(ctx context.Context, owner string // SetEnabledReposInOrg replaces the list of selected repositories that are enabled for GitHub Actions in an organization.. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-selected-repositories-enabled-for-github-actions-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-selected-repositories-enabled-for-github-actions-in-an-organization +// +//meta:operation PUT /orgs/{org}/actions/permissions/repositories func (s *ActionsService) SetEnabledReposInOrg(ctx context.Context, owner string, repositoryIDs []int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/repositories", owner) @@ -128,7 +136,9 @@ func (s *ActionsService) SetEnabledReposInOrg(ctx context.Context, owner string, // AddEnabledReposInOrg adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#enable-a-selected-repository-for-github-actions-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions#enable-a-selected-repository-for-github-actions-in-an-organization +// +//meta:operation PUT /orgs/{org}/actions/permissions/repositories/{repository_id} func (s *ActionsService) AddEnabledReposInOrg(ctx context.Context, owner string, repositoryID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/repositories/%v", owner, repositoryID) @@ -147,7 +157,9 @@ func (s *ActionsService) AddEnabledReposInOrg(ctx context.Context, owner string, // RemoveEnabledReposInOrg removes a single repository from the list of enabled repos for GitHub Actions in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#disable-a-selected-repository-for-github-actions-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions#disable-a-selected-repository-for-github-actions-in-an-organization +// +//meta:operation DELETE /orgs/{org}/actions/permissions/repositories/{repository_id} func (s *ActionsService) RemoveEnabledReposInOrg(ctx context.Context, owner string, repositoryID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/repositories/%v", owner, repositoryID) @@ -166,7 +178,9 @@ func (s *ActionsService) RemoveEnabledReposInOrg(ctx context.Context, owner stri // GetActionsAllowed gets the actions that are allowed in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/permissions/selected-actions func (s *ActionsService) GetActionsAllowed(ctx context.Context, org string) (*ActionsAllowed, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/selected-actions", org) @@ -186,7 +200,9 @@ func (s *ActionsService) GetActionsAllowed(ctx context.Context, org string) (*Ac // EditActionsAllowed sets the actions that are allowed in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-organization +// +//meta:operation PUT /orgs/{org}/actions/permissions/selected-actions func (s *ActionsService) EditActionsAllowed(ctx context.Context, org string, actionsAllowed ActionsAllowed) (*ActionsAllowed, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/selected-actions", org) req, err := s.client.NewRequest("PUT", u, actionsAllowed) diff --git a/github/actions_required_workflows.go b/github/actions_required_workflows.go index 3566eb9d207..b89741a82a1 100644 --- a/github/actions_required_workflows.go +++ b/github/actions_required_workflows.go @@ -67,7 +67,9 @@ type RepoRequiredWorkflows struct { // ListOrgRequiredWorkflows lists the RequiredWorkflows for an org. // -// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#list-required-workflows +// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows +// +//meta:operation GET /orgs/{org}/actions/required_workflows func (s *ActionsService) ListOrgRequiredWorkflows(ctx context.Context, org string, opts *ListOptions) (*OrgRequiredWorkflows, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows", org) u, err := addOptions(url, opts) @@ -91,7 +93,9 @@ func (s *ActionsService) ListOrgRequiredWorkflows(ctx context.Context, org strin // CreateRequiredWorkflow creates the required workflow in an org. // -// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#create-a-required-workflow +// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows +// +//meta:operation POST /orgs/{org}/actions/required_workflows func (s *ActionsService) CreateRequiredWorkflow(ctx context.Context, org string, createRequiredWorkflowOptions *CreateUpdateRequiredWorkflowOptions) (*OrgRequiredWorkflow, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows", org) req, err := s.client.NewRequest("POST", url, createRequiredWorkflowOptions) @@ -110,7 +114,9 @@ func (s *ActionsService) CreateRequiredWorkflow(ctx context.Context, org string, // GetRequiredWorkflowByID get the RequiredWorkflows for an org by its ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#list-required-workflows +// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows +// +//meta:operation GET /orgs/{org}/actions/required_workflows/{workflow_id} func (s *ActionsService) GetRequiredWorkflowByID(ctx context.Context, owner string, requiredWorkflowID int64) (*OrgRequiredWorkflow, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/required_workflows/%v", owner, requiredWorkflowID) @@ -130,7 +136,9 @@ func (s *ActionsService) GetRequiredWorkflowByID(ctx context.Context, owner stri // UpdateRequiredWorkflow updates a required workflow in an org. // -// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#update-a-required-workflow +// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows +// +//meta:operation PATCH /orgs/{org}/actions/required_workflows/{workflow_id} func (s *ActionsService) UpdateRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID int64, updateRequiredWorkflowOptions *CreateUpdateRequiredWorkflowOptions) (*OrgRequiredWorkflow, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v", org, requiredWorkflowID) req, err := s.client.NewRequest("PATCH", url, updateRequiredWorkflowOptions) @@ -149,7 +157,9 @@ func (s *ActionsService) UpdateRequiredWorkflow(ctx context.Context, org string, // DeleteRequiredWorkflow deletes a required workflow in an org. // -// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#update-a-required-workflow +// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows +// +//meta:operation DELETE /orgs/{org}/actions/required_workflows/{workflow_id} func (s *ActionsService) DeleteRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID int64) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v", org, requiredWorkflowID) req, err := s.client.NewRequest("DELETE", url, nil) @@ -161,7 +171,9 @@ func (s *ActionsService) DeleteRequiredWorkflow(ctx context.Context, org string, // ListRequiredWorkflowSelectedRepos lists the Repositories selected for a workflow. // -// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#list-selected-repositories-for-a-required-workflow +// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows +// +//meta:operation GET /orgs/{org}/actions/required_workflows/{workflow_id}/repositories func (s *ActionsService) ListRequiredWorkflowSelectedRepos(ctx context.Context, org string, requiredWorkflowID int64, opts *ListOptions) (*RequiredWorkflowSelectedRepos, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories", org, requiredWorkflowID) u, err := addOptions(url, opts) @@ -184,7 +196,9 @@ func (s *ActionsService) ListRequiredWorkflowSelectedRepos(ctx context.Context, // SetRequiredWorkflowSelectedRepos sets the Repositories selected for a workflow. // -// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#sets-repositories-for-a-required-workflow +// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows +// +//meta:operation PUT /orgs/{org}/actions/required_workflows/{workflow_id}/repositories func (s *ActionsService) SetRequiredWorkflowSelectedRepos(ctx context.Context, org string, requiredWorkflowID int64, ids SelectedRepoIDs) (*Response, error) { type repoIDs struct { SelectedIDs SelectedRepoIDs `json:"selected_repository_ids"` @@ -200,7 +214,9 @@ func (s *ActionsService) SetRequiredWorkflowSelectedRepos(ctx context.Context, o // AddRepoToRequiredWorkflow adds the Repository to a required workflow. // -// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#add-a-repository-to-a-required-workflow +// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows +// +//meta:operation PUT /orgs/{org}/actions/required_workflows/{workflow_id}/repositories/{repository_id} func (s *ActionsService) AddRepoToRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID, repoID int64) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories/%v", org, requiredWorkflowID, repoID) req, err := s.client.NewRequest("PUT", url, nil) @@ -212,7 +228,9 @@ func (s *ActionsService) AddRepoToRequiredWorkflow(ctx context.Context, org stri // RemoveRepoFromRequiredWorkflow removes the Repository from a required workflow. // -// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#add-a-repository-to-a-required-workflow +// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows +// +//meta:operation DELETE /orgs/{org}/actions/required_workflows/{workflow_id}/repositories/{repository_id} func (s *ActionsService) RemoveRepoFromRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID, repoID int64) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories/%v", org, requiredWorkflowID, repoID) req, err := s.client.NewRequest("DELETE", url, nil) @@ -224,7 +242,9 @@ func (s *ActionsService) RemoveRepoFromRequiredWorkflow(ctx context.Context, org // ListRepoRequiredWorkflows lists the RequiredWorkflows for a repo. // -// Github API docs:https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#list-repository-required-workflows +// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows +// +//meta:operation GET /repos/{owner}/{repo}/actions/required_workflows func (s *ActionsService) ListRepoRequiredWorkflows(ctx context.Context, owner, repo string, opts *ListOptions) (*RepoRequiredWorkflows, *Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/required_workflows", owner, repo) u, err := addOptions(url, opts) diff --git a/github/actions_runner_groups.go b/github/actions_runner_groups.go index 00b9b6ce091..a1f453f3c67 100644 --- a/github/actions_runner_groups.go +++ b/github/actions_runner_groups.go @@ -80,7 +80,9 @@ type ListOrgRunnerGroupOptions struct { // ListOrganizationRunnerGroups lists all self-hosted runner groups configured in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/runner-groups func (s *ActionsService) ListOrganizationRunnerGroups(ctx context.Context, org string, opts *ListOrgRunnerGroupOptions) (*RunnerGroups, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups", org) u, err := addOptions(u, opts) @@ -104,7 +106,9 @@ func (s *ActionsService) ListOrganizationRunnerGroups(ctx context.Context, org s // GetOrganizationRunnerGroup gets a specific self-hosted runner group for an organization using its RunnerGroup ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/runner-groups/{runner_group_id} func (s *ActionsService) GetOrganizationRunnerGroup(ctx context.Context, org string, groupID int64) (*RunnerGroup, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v", org, groupID) req, err := s.client.NewRequest("GET", u, nil) @@ -123,7 +127,9 @@ func (s *ActionsService) GetOrganizationRunnerGroup(ctx context.Context, org str // DeleteOrganizationRunnerGroup deletes a self-hosted runner group from an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-organization +// +//meta:operation DELETE /orgs/{org}/actions/runner-groups/{runner_group_id} func (s *ActionsService) DeleteOrganizationRunnerGroup(ctx context.Context, org string, groupID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v", org, groupID) @@ -137,7 +143,9 @@ func (s *ActionsService) DeleteOrganizationRunnerGroup(ctx context.Context, org // CreateOrganizationRunnerGroup creates a new self-hosted runner group for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-organization +// +//meta:operation POST /orgs/{org}/actions/runner-groups func (s *ActionsService) CreateOrganizationRunnerGroup(ctx context.Context, org string, createReq CreateRunnerGroupRequest) (*RunnerGroup, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups", org) req, err := s.client.NewRequest("POST", u, createReq) @@ -156,7 +164,9 @@ func (s *ActionsService) CreateOrganizationRunnerGroup(ctx context.Context, org // UpdateOrganizationRunnerGroup updates a self-hosted runner group for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-organization +// +//meta:operation PATCH /orgs/{org}/actions/runner-groups/{runner_group_id} func (s *ActionsService) UpdateOrganizationRunnerGroup(ctx context.Context, org string, groupID int64, updateReq UpdateRunnerGroupRequest) (*RunnerGroup, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v", org, groupID) req, err := s.client.NewRequest("PATCH", u, updateReq) @@ -175,7 +185,9 @@ func (s *ActionsService) UpdateOrganizationRunnerGroup(ctx context.Context, org // ListRepositoryAccessRunnerGroup lists the repositories with access to a self-hosted runner group configured in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#list-repository-access-to-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#list-repository-access-to-a-self-hosted-runner-group-in-an-organization +// +//meta:operation GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories func (s *ActionsService) ListRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID int64, opts *ListOptions) (*ListRepositories, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/repositories", org, groupID) u, err := addOptions(u, opts) @@ -200,7 +212,9 @@ func (s *ActionsService) ListRepositoryAccessRunnerGroup(ctx context.Context, or // SetRepositoryAccessRunnerGroup replaces the list of repositories that have access to a self-hosted runner group configured in an organization // with a new List of repositories. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#set-repository-access-for-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#set-repository-access-for-a-self-hosted-runner-group-in-an-organization +// +//meta:operation PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories func (s *ActionsService) SetRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID int64, ids SetRepoAccessRunnerGroupRequest) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/repositories", org, groupID) @@ -215,7 +229,9 @@ func (s *ActionsService) SetRepositoryAccessRunnerGroup(ctx context.Context, org // AddRepositoryAccessRunnerGroup adds a repository to the list of selected repositories that can access a self-hosted runner group. // The runner group must have visibility set to 'selected'. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#add-repository-access-to-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#add-repository-access-to-a-self-hosted-runner-group-in-an-organization +// +//meta:operation PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} func (s *ActionsService) AddRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID, repoID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/repositories/%v", org, groupID, repoID) @@ -230,7 +246,9 @@ func (s *ActionsService) AddRepositoryAccessRunnerGroup(ctx context.Context, org // RemoveRepositoryAccessRunnerGroup removes a repository from the list of selected repositories that can access a self-hosted runner group. // The runner group must have visibility set to 'selected'. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization +// +//meta:operation DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} func (s *ActionsService) RemoveRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID, repoID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/repositories/%v", org, groupID, repoID) @@ -244,7 +262,9 @@ func (s *ActionsService) RemoveRepositoryAccessRunnerGroup(ctx context.Context, // ListRunnerGroupRunners lists self-hosted runners that are in a specific organization group. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners func (s *ActionsService) ListRunnerGroupRunners(ctx context.Context, org string, groupID int64, opts *ListOptions) (*Runners, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/runners", org, groupID) u, err := addOptions(u, opts) @@ -269,7 +289,9 @@ func (s *ActionsService) ListRunnerGroupRunners(ctx context.Context, org string, // SetRunnerGroupRunners replaces the list of self-hosted runners that are part of an organization runner group // with a new list of runners. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-organization +// +//meta:operation PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners func (s *ActionsService) SetRunnerGroupRunners(ctx context.Context, org string, groupID int64, ids SetRunnerGroupRunnersRequest) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/runners", org, groupID) @@ -283,7 +305,9 @@ func (s *ActionsService) SetRunnerGroupRunners(ctx context.Context, org string, // AddRunnerGroupRunners adds a self-hosted runner to a runner group configured in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-organization +// +//meta:operation PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} func (s *ActionsService) AddRunnerGroupRunners(ctx context.Context, org string, groupID, runnerID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/runners/%v", org, groupID, runnerID) @@ -298,7 +322,9 @@ func (s *ActionsService) AddRunnerGroupRunners(ctx context.Context, org string, // RemoveRunnerGroupRunners removes a self-hosted runner from a group configured in an organization. // The runner is then returned to the default group. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-organization +// +//meta:operation DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} func (s *ActionsService) RemoveRunnerGroupRunners(ctx context.Context, org string, groupID, runnerID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/runners/%v", org, groupID, runnerID) diff --git a/github/actions_runners.go b/github/actions_runners.go index d54d6d41ca2..90cf5804e1e 100644 --- a/github/actions_runners.go +++ b/github/actions_runners.go @@ -22,7 +22,9 @@ type RunnerApplicationDownload struct { // ListRunnerApplicationDownloads lists self-hosted runner application binaries that can be downloaded and run. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#list-runner-applications-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/actions/runners/downloads func (s *ActionsService) ListRunnerApplicationDownloads(ctx context.Context, owner, repo string) ([]*RunnerApplicationDownload, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners/downloads", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -58,7 +60,9 @@ type JITRunnerConfig struct { // GenerateOrgJITConfig generate a just-in-time configuration for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-configuration-for-a-just-in-time-runner-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-organization +// +//meta:operation POST /orgs/{org}/actions/runners/generate-jitconfig func (s *ActionsService) GenerateOrgJITConfig(ctx context.Context, owner string, request *GenerateJITConfigRequest) (*JITRunnerConfig, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners/generate-jitconfig", owner) req, err := s.client.NewRequest("POST", u, request) @@ -77,7 +81,9 @@ func (s *ActionsService) GenerateOrgJITConfig(ctx context.Context, owner string, // GenerateRepoJITConfig generates a just-in-time configuration for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-configuration-for-a-just-in-time-runner-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-a-repository +// +//meta:operation POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig func (s *ActionsService) GenerateRepoJITConfig(ctx context.Context, owner, repo string, request *GenerateJITConfigRequest) (*JITRunnerConfig, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners/generate-jitconfig", owner, repo) req, err := s.client.NewRequest("POST", u, request) @@ -102,7 +108,9 @@ type RegistrationToken struct { // CreateRegistrationToken creates a token that can be used to add a self-hosted runner. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-registration-token-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-a-repository +// +//meta:operation POST /repos/{owner}/{repo}/actions/runners/registration-token func (s *ActionsService) CreateRegistrationToken(ctx context.Context, owner, repo string) (*RegistrationToken, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners/registration-token", owner, repo) @@ -145,7 +153,9 @@ type Runners struct { // ListRunners lists all the self-hosted runners for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#list-self-hosted-runners-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/actions/runners func (s *ActionsService) ListRunners(ctx context.Context, owner, repo string, opts *ListOptions) (*Runners, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners", owner, repo) u, err := addOptions(u, opts) @@ -169,7 +179,9 @@ func (s *ActionsService) ListRunners(ctx context.Context, owner, repo string, op // GetRunner gets a specific self-hosted runner for a repository using its runner ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/actions/runners/{runner_id} func (s *ActionsService) GetRunner(ctx context.Context, owner, repo string, runnerID int64) (*Runner, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners/%v", owner, repo, runnerID) req, err := s.client.NewRequest("GET", u, nil) @@ -194,7 +206,9 @@ type RemoveToken struct { // CreateRemoveToken creates a token that can be used to remove a self-hosted runner from a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-remove-token-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-a-repository +// +//meta:operation POST /repos/{owner}/{repo}/actions/runners/remove-token func (s *ActionsService) CreateRemoveToken(ctx context.Context, owner, repo string) (*RemoveToken, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners/remove-token", owner, repo) @@ -214,7 +228,9 @@ func (s *ActionsService) CreateRemoveToken(ctx context.Context, owner, repo stri // RemoveRunner forces the removal of a self-hosted runner in a repository using the runner id. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-a-repository +// +//meta:operation DELETE /repos/{owner}/{repo}/actions/runners/{runner_id} func (s *ActionsService) RemoveRunner(ctx context.Context, owner, repo string, runnerID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners/%v", owner, repo, runnerID) @@ -228,7 +244,9 @@ func (s *ActionsService) RemoveRunner(ctx context.Context, owner, repo string, r // ListOrganizationRunnerApplicationDownloads lists self-hosted runner application binaries that can be downloaded and run. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#list-runner-applications-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/runners/downloads func (s *ActionsService) ListOrganizationRunnerApplicationDownloads(ctx context.Context, owner string) ([]*RunnerApplicationDownload, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners/downloads", owner) req, err := s.client.NewRequest("GET", u, nil) @@ -247,7 +265,9 @@ func (s *ActionsService) ListOrganizationRunnerApplicationDownloads(ctx context. // CreateOrganizationRegistrationToken creates a token that can be used to add a self-hosted runner to an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-registration-token-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-an-organization +// +//meta:operation POST /orgs/{org}/actions/runners/registration-token func (s *ActionsService) CreateOrganizationRegistrationToken(ctx context.Context, owner string) (*RegistrationToken, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners/registration-token", owner) @@ -267,7 +287,9 @@ func (s *ActionsService) CreateOrganizationRegistrationToken(ctx context.Context // ListOrganizationRunners lists all the self-hosted runners for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/runners func (s *ActionsService) ListOrganizationRunners(ctx context.Context, owner string, opts *ListOptions) (*Runners, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners", owner) u, err := addOptions(u, opts) @@ -291,7 +313,9 @@ func (s *ActionsService) ListOrganizationRunners(ctx context.Context, owner stri // GetOrganizationRunner gets a specific self-hosted runner for an organization using its runner ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/runners/{runner_id} func (s *ActionsService) GetOrganizationRunner(ctx context.Context, owner string, runnerID int64) (*Runner, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners/%v", owner, runnerID) req, err := s.client.NewRequest("GET", u, nil) @@ -310,7 +334,9 @@ func (s *ActionsService) GetOrganizationRunner(ctx context.Context, owner string // CreateOrganizationRemoveToken creates a token that can be used to remove a self-hosted runner from an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-remove-token-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-an-organization +// +//meta:operation POST /orgs/{org}/actions/runners/remove-token func (s *ActionsService) CreateOrganizationRemoveToken(ctx context.Context, owner string) (*RemoveToken, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners/remove-token", owner) @@ -330,7 +356,9 @@ func (s *ActionsService) CreateOrganizationRemoveToken(ctx context.Context, owne // RemoveOrganizationRunner forces the removal of a self-hosted runner from an organization using the runner id. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-organization +// +//meta:operation DELETE /orgs/{org}/actions/runners/{runner_id} func (s *ActionsService) RemoveOrganizationRunner(ctx context.Context, owner string, runnerID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners/%v", owner, runnerID) diff --git a/github/actions_secrets.go b/github/actions_secrets.go index 49985e12afa..2d4ba98db30 100644 --- a/github/actions_secrets.go +++ b/github/actions_secrets.go @@ -64,7 +64,9 @@ func (s *ActionsService) getPublicKey(ctx context.Context, url string) (*PublicK // GetRepoPublicKey gets a public key that should be used for secret encryption. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#get-a-repository-public-key +// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-a-repository-public-key +// +//meta:operation GET /repos/{owner}/{repo}/actions/secrets/public-key func (s *ActionsService) GetRepoPublicKey(ctx context.Context, owner, repo string) (*PublicKey, *Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/secrets/public-key", owner, repo) return s.getPublicKey(ctx, url) @@ -72,7 +74,9 @@ func (s *ActionsService) GetRepoPublicKey(ctx context.Context, owner, repo strin // GetOrgPublicKey gets a public key that should be used for secret encryption. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#get-an-organization-public-key +// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-an-organization-public-key +// +//meta:operation GET /orgs/{org}/actions/secrets/public-key func (s *ActionsService) GetOrgPublicKey(ctx context.Context, org string) (*PublicKey, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/public-key", org) return s.getPublicKey(ctx, url) @@ -80,7 +84,9 @@ func (s *ActionsService) GetOrgPublicKey(ctx context.Context, org string) (*Publ // GetEnvPublicKey gets a public key that should be used for secret encryption. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#get-an-environment-public-key +// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-an-environment-public-key +// +//meta:operation GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key func (s *ActionsService) GetEnvPublicKey(ctx context.Context, repoID int, env string) (*PublicKey, *Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/secrets/public-key", repoID, env) return s.getPublicKey(ctx, url) @@ -124,7 +130,9 @@ func (s *ActionsService) listSecrets(ctx context.Context, url string, opts *List // ListRepoSecrets lists all secrets available in a repository // without revealing their encrypted values. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#list-repository-secrets +// GitHub API docs: https://docs.github.com/rest/actions/secrets#list-repository-secrets +// +//meta:operation GET /repos/{owner}/{repo}/actions/secrets func (s *ActionsService) ListRepoSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/secrets", owner, repo) return s.listSecrets(ctx, url, opts) @@ -133,7 +141,9 @@ func (s *ActionsService) ListRepoSecrets(ctx context.Context, owner, repo string // ListOrgSecrets lists all secrets available in an organization // without revealing their encrypted values. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#list-organization-secrets +// GitHub API docs: https://docs.github.com/rest/actions/secrets#list-organization-secrets +// +//meta:operation GET /orgs/{org}/actions/secrets func (s *ActionsService) ListOrgSecrets(ctx context.Context, org string, opts *ListOptions) (*Secrets, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets", org) return s.listSecrets(ctx, url, opts) @@ -141,7 +151,9 @@ func (s *ActionsService) ListOrgSecrets(ctx context.Context, org string, opts *L // ListEnvSecrets lists all secrets available in an environment. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#list-environment-secrets +// GitHub API docs: https://docs.github.com/rest/actions/secrets#list-environment-secrets +// +//meta:operation GET /repositories/{repository_id}/environments/{environment_name}/secrets func (s *ActionsService) ListEnvSecrets(ctx context.Context, repoID int, env string, opts *ListOptions) (*Secrets, *Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/secrets", repoID, env) return s.listSecrets(ctx, url, opts) @@ -164,7 +176,9 @@ func (s *ActionsService) getSecret(ctx context.Context, url string) (*Secret, *R // GetRepoSecret gets a single repository secret without revealing its encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#get-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-a-repository-secret +// +//meta:operation GET /repos/{owner}/{repo}/actions/secrets/{secret_name} func (s *ActionsService) GetRepoSecret(ctx context.Context, owner, repo, name string) (*Secret, *Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/secrets/%v", owner, repo, name) return s.getSecret(ctx, url) @@ -172,7 +186,9 @@ func (s *ActionsService) GetRepoSecret(ctx context.Context, owner, repo, name st // GetOrgSecret gets a single organization secret without revealing its encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#get-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-an-organization-secret +// +//meta:operation GET /orgs/{org}/actions/secrets/{secret_name} func (s *ActionsService) GetOrgSecret(ctx context.Context, org, name string) (*Secret, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/%v", org, name) return s.getSecret(ctx, url) @@ -180,7 +196,9 @@ func (s *ActionsService) GetOrgSecret(ctx context.Context, org, name string) (*S // GetEnvSecret gets a single environment secret without revealing its encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#get-an-environment-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-an-environment-secret +// +//meta:operation GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} func (s *ActionsService) GetEnvSecret(ctx context.Context, repoID int, env, secretName string) (*Secret, *Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/secrets/%v", repoID, env, secretName) return s.getSecret(ctx, url) @@ -213,7 +231,9 @@ func (s *ActionsService) putSecret(ctx context.Context, url string, eSecret *Enc // CreateOrUpdateRepoSecret creates or updates a repository secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#create-or-update-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#create-or-update-a-repository-secret +// +//meta:operation PUT /repos/{owner}/{repo}/actions/secrets/{secret_name} func (s *ActionsService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *EncryptedSecret) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/secrets/%v", owner, repo, eSecret.Name) return s.putSecret(ctx, url, eSecret) @@ -221,7 +241,9 @@ func (s *ActionsService) CreateOrUpdateRepoSecret(ctx context.Context, owner, re // CreateOrUpdateOrgSecret creates or updates an organization secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#create-or-update-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret +// +//meta:operation PUT /orgs/{org}/actions/secrets/{secret_name} func (s *ActionsService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *EncryptedSecret) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/%v", org, eSecret.Name) return s.putSecret(ctx, url, eSecret) @@ -229,7 +251,9 @@ func (s *ActionsService) CreateOrUpdateOrgSecret(ctx context.Context, org string // CreateOrUpdateEnvSecret creates or updates a single environment secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#create-or-update-an-environment-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#create-or-update-an-environment-secret +// +//meta:operation PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} func (s *ActionsService) CreateOrUpdateEnvSecret(ctx context.Context, repoID int, env string, eSecret *EncryptedSecret) (*Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/secrets/%v", repoID, env, eSecret.Name) return s.putSecret(ctx, url, eSecret) @@ -246,7 +270,9 @@ func (s *ActionsService) deleteSecret(ctx context.Context, url string) (*Respons // DeleteRepoSecret deletes a secret in a repository using the secret name. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#delete-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#delete-a-repository-secret +// +//meta:operation DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name} func (s *ActionsService) DeleteRepoSecret(ctx context.Context, owner, repo, name string) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/secrets/%v", owner, repo, name) return s.deleteSecret(ctx, url) @@ -254,7 +280,9 @@ func (s *ActionsService) DeleteRepoSecret(ctx context.Context, owner, repo, name // DeleteOrgSecret deletes a secret in an organization using the secret name. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#delete-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#delete-an-organization-secret +// +//meta:operation DELETE /orgs/{org}/actions/secrets/{secret_name} func (s *ActionsService) DeleteOrgSecret(ctx context.Context, org, name string) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/%v", org, name) return s.deleteSecret(ctx, url) @@ -262,7 +290,9 @@ func (s *ActionsService) DeleteOrgSecret(ctx context.Context, org, name string) // DeleteEnvSecret deletes a secret in an environment using the secret name. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#delete-an-environment-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#delete-an-environment-secret +// +//meta:operation DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} func (s *ActionsService) DeleteEnvSecret(ctx context.Context, repoID int, env, secretName string) (*Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/secrets/%v", repoID, env, secretName) return s.deleteSecret(ctx, url) @@ -296,7 +326,9 @@ func (s *ActionsService) listSelectedReposForSecret(ctx context.Context, url str // ListSelectedReposForOrgSecret lists all repositories that have access to a secret. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#list-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#list-selected-repositories-for-an-organization-secret +// +//meta:operation GET /orgs/{org}/actions/secrets/{secret_name}/repositories func (s *ActionsService) ListSelectedReposForOrgSecret(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/%v/repositories", org, name) return s.listSelectedReposForSecret(ctx, url, opts) @@ -317,7 +349,9 @@ func (s *ActionsService) setSelectedReposForSecret(ctx context.Context, url stri // SetSelectedReposForOrgSecret sets the repositories that have access to a secret. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#set-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#set-selected-repositories-for-an-organization-secret +// +//meta:operation PUT /orgs/{org}/actions/secrets/{secret_name}/repositories func (s *ActionsService) SetSelectedReposForOrgSecret(ctx context.Context, org, name string, ids SelectedRepoIDs) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/%v/repositories", org, name) return s.setSelectedReposForSecret(ctx, url, ids) @@ -334,7 +368,9 @@ func (s *ActionsService) addSelectedRepoToSecret(ctx context.Context, url string // AddSelectedRepoToOrgSecret adds a repository to an organization secret. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#add-selected-repository-to-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#add-selected-repository-to-an-organization-secret +// +//meta:operation PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} func (s *ActionsService) AddSelectedRepoToOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/%v/repositories/%v", org, name, *repo.ID) return s.addSelectedRepoToSecret(ctx, url) @@ -351,7 +387,9 @@ func (s *ActionsService) removeSelectedRepoFromSecret(ctx context.Context, url s // RemoveSelectedRepoFromOrgSecret removes a repository from an organization secret. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#remove-selected-repository-from-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#remove-selected-repository-from-an-organization-secret +// +//meta:operation DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} func (s *ActionsService) RemoveSelectedRepoFromOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/%v/repositories/%v", org, name, *repo.ID) return s.removeSelectedRepoFromSecret(ctx, url) diff --git a/github/actions_variables.go b/github/actions_variables.go index 29445edd042..244d159079e 100644 --- a/github/actions_variables.go +++ b/github/actions_variables.go @@ -51,7 +51,9 @@ func (s *ActionsService) listVariables(ctx context.Context, url string, opts *Li // ListRepoVariables lists all variables available in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#list-repository-variables +// GitHub API docs: https://docs.github.com/rest/actions/variables#list-repository-variables +// +//meta:operation GET /repos/{owner}/{repo}/actions/variables func (s *ActionsService) ListRepoVariables(ctx context.Context, owner, repo string, opts *ListOptions) (*ActionsVariables, *Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/variables", owner, repo) return s.listVariables(ctx, url, opts) @@ -59,7 +61,9 @@ func (s *ActionsService) ListRepoVariables(ctx context.Context, owner, repo stri // ListOrgVariables lists all variables available in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#list-organization-variables +// GitHub API docs: https://docs.github.com/rest/actions/variables#list-organization-variables +// +//meta:operation GET /orgs/{org}/actions/variables func (s *ActionsService) ListOrgVariables(ctx context.Context, org string, opts *ListOptions) (*ActionsVariables, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables", org) return s.listVariables(ctx, url, opts) @@ -67,7 +71,9 @@ func (s *ActionsService) ListOrgVariables(ctx context.Context, org string, opts // ListEnvVariables lists all variables available in an environment. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#list-environment-variables +// GitHub API docs: https://docs.github.com/rest/actions/variables#list-environment-variables +// +//meta:operation GET /repositories/{repository_id}/environments/{environment_name}/variables func (s *ActionsService) ListEnvVariables(ctx context.Context, repoID int, env string, opts *ListOptions) (*ActionsVariables, *Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/variables", repoID, env) return s.listVariables(ctx, url, opts) @@ -90,7 +96,9 @@ func (s *ActionsService) getVariable(ctx context.Context, url string) (*ActionsV // GetRepoVariable gets a single repository variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#get-a-repository-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#get-a-repository-variable +// +//meta:operation GET /repos/{owner}/{repo}/actions/variables/{name} func (s *ActionsService) GetRepoVariable(ctx context.Context, owner, repo, name string) (*ActionsVariable, *Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/variables/%v", owner, repo, name) return s.getVariable(ctx, url) @@ -98,7 +106,9 @@ func (s *ActionsService) GetRepoVariable(ctx context.Context, owner, repo, name // GetOrgVariable gets a single organization variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#get-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#get-an-organization-variable +// +//meta:operation GET /orgs/{org}/actions/variables/{name} func (s *ActionsService) GetOrgVariable(ctx context.Context, org, name string) (*ActionsVariable, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables/%v", org, name) return s.getVariable(ctx, url) @@ -106,7 +116,9 @@ func (s *ActionsService) GetOrgVariable(ctx context.Context, org, name string) ( // GetEnvVariable gets a single environment variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#get-an-environment-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#get-an-environment-variable +// +//meta:operation GET /repositories/{repository_id}/environments/{environment_name}/variables/{name} func (s *ActionsService) GetEnvVariable(ctx context.Context, repoID int, env, variableName string) (*ActionsVariable, *Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/variables/%v", repoID, env, variableName) return s.getVariable(ctx, url) @@ -122,7 +134,9 @@ func (s *ActionsService) postVariable(ctx context.Context, url string, variable // CreateRepoVariable creates a repository variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#create-a-repository-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#create-a-repository-variable +// +//meta:operation POST /repos/{owner}/{repo}/actions/variables func (s *ActionsService) CreateRepoVariable(ctx context.Context, owner, repo string, variable *ActionsVariable) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/variables", owner, repo) return s.postVariable(ctx, url, variable) @@ -130,7 +144,9 @@ func (s *ActionsService) CreateRepoVariable(ctx context.Context, owner, repo str // CreateOrgVariable creates an organization variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#create-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#create-an-organization-variable +// +//meta:operation POST /orgs/{org}/actions/variables func (s *ActionsService) CreateOrgVariable(ctx context.Context, org string, variable *ActionsVariable) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables", org) return s.postVariable(ctx, url, variable) @@ -138,7 +154,9 @@ func (s *ActionsService) CreateOrgVariable(ctx context.Context, org string, vari // CreateEnvVariable creates an environment variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#create-an-environment-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#create-an-environment-variable +// +//meta:operation POST /repositories/{repository_id}/environments/{environment_name}/variables func (s *ActionsService) CreateEnvVariable(ctx context.Context, repoID int, env string, variable *ActionsVariable) (*Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/variables", repoID, env) return s.postVariable(ctx, url, variable) @@ -154,7 +172,9 @@ func (s *ActionsService) patchVariable(ctx context.Context, url string, variable // UpdateRepoVariable updates a repository variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#update-a-repository-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#update-a-repository-variable +// +//meta:operation PATCH /repos/{owner}/{repo}/actions/variables/{name} func (s *ActionsService) UpdateRepoVariable(ctx context.Context, owner, repo string, variable *ActionsVariable) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/variables/%v", owner, repo, variable.Name) return s.patchVariable(ctx, url, variable) @@ -162,7 +182,9 @@ func (s *ActionsService) UpdateRepoVariable(ctx context.Context, owner, repo str // UpdateOrgVariable updates an organization variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#update-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#update-an-organization-variable +// +//meta:operation PATCH /orgs/{org}/actions/variables/{name} func (s *ActionsService) UpdateOrgVariable(ctx context.Context, org string, variable *ActionsVariable) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables/%v", org, variable.Name) return s.patchVariable(ctx, url, variable) @@ -170,7 +192,9 @@ func (s *ActionsService) UpdateOrgVariable(ctx context.Context, org string, vari // UpdateEnvVariable updates an environment variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#create-an-environment-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#update-an-environment-variable +// +//meta:operation PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{name} func (s *ActionsService) UpdateEnvVariable(ctx context.Context, repoID int, env string, variable *ActionsVariable) (*Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/variables/%v", repoID, env, variable.Name) return s.patchVariable(ctx, url, variable) @@ -187,7 +211,9 @@ func (s *ActionsService) deleteVariable(ctx context.Context, url string) (*Respo // DeleteRepoVariable deletes a variable in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#delete-a-repository-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#delete-a-repository-variable +// +//meta:operation DELETE /repos/{owner}/{repo}/actions/variables/{name} func (s *ActionsService) DeleteRepoVariable(ctx context.Context, owner, repo, name string) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/variables/%v", owner, repo, name) return s.deleteVariable(ctx, url) @@ -195,7 +221,9 @@ func (s *ActionsService) DeleteRepoVariable(ctx context.Context, owner, repo, na // DeleteOrgVariable deletes a variable in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#delete-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#delete-an-organization-variable +// +//meta:operation DELETE /orgs/{org}/actions/variables/{name} func (s *ActionsService) DeleteOrgVariable(ctx context.Context, org, name string) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables/%v", org, name) return s.deleteVariable(ctx, url) @@ -203,7 +231,9 @@ func (s *ActionsService) DeleteOrgVariable(ctx context.Context, org, name string // DeleteEnvVariable deletes a variable in an environment. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#delete-an-environment-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#delete-an-environment-variable +// +//meta:operation DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{name} func (s *ActionsService) DeleteEnvVariable(ctx context.Context, repoID int, env, variableName string) (*Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/variables/%v", repoID, env, variableName) return s.deleteVariable(ctx, url) @@ -231,7 +261,9 @@ func (s *ActionsService) listSelectedReposForVariable(ctx context.Context, url s // ListSelectedReposForOrgVariable lists all repositories that have access to a variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#list-selected-repositories-for-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#list-selected-repositories-for-an-organization-variable +// +//meta:operation GET /orgs/{org}/actions/variables/{name}/repositories func (s *ActionsService) ListSelectedReposForOrgVariable(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables/%v/repositories", org, name) return s.listSelectedReposForVariable(ctx, url, opts) @@ -252,7 +284,9 @@ func (s *ActionsService) setSelectedReposForVariable(ctx context.Context, url st // SetSelectedReposForOrgVariable sets the repositories that have access to a variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#set-selected-repositories-for-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#set-selected-repositories-for-an-organization-variable +// +//meta:operation PUT /orgs/{org}/actions/variables/{name}/repositories func (s *ActionsService) SetSelectedReposForOrgVariable(ctx context.Context, org, name string, ids SelectedRepoIDs) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables/%v/repositories", org, name) return s.setSelectedReposForVariable(ctx, url, ids) @@ -269,7 +303,9 @@ func (s *ActionsService) addSelectedRepoToVariable(ctx context.Context, url stri // AddSelectedRepoToOrgVariable adds a repository to an organization variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#add-selected-repository-to-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#add-selected-repository-to-an-organization-variable +// +//meta:operation PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id} func (s *ActionsService) AddSelectedRepoToOrgVariable(ctx context.Context, org, name string, repo *Repository) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables/%v/repositories/%v", org, name, *repo.ID) return s.addSelectedRepoToVariable(ctx, url) @@ -286,7 +322,9 @@ func (s *ActionsService) removeSelectedRepoFromVariable(ctx context.Context, url // RemoveSelectedRepoFromOrgVariable removes a repository from an organization variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#remove-selected-repository-from-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#remove-selected-repository-from-an-organization-variable +// +//meta:operation DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id} func (s *ActionsService) RemoveSelectedRepoFromOrgVariable(ctx context.Context, org, name string, repo *Repository) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables/%v/repositories/%v", org, name, *repo.ID) return s.removeSelectedRepoFromVariable(ctx, url) diff --git a/github/actions_workflow_jobs.go b/github/actions_workflow_jobs.go index 87d117ba9a9..0e0eb6e1146 100644 --- a/github/actions_workflow_jobs.go +++ b/github/actions_workflow_jobs.go @@ -70,7 +70,9 @@ type ListWorkflowJobsOptions struct { // ListWorkflowJobs lists all jobs for a workflow run. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run +// +//meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs func (s *ActionsService) ListWorkflowJobs(ctx context.Context, owner, repo string, runID int64, opts *ListWorkflowJobsOptions) (*Jobs, *Response, error) { u := fmt.Sprintf("repos/%s/%s/actions/runs/%v/jobs", owner, repo, runID) u, err := addOptions(u, opts) @@ -94,7 +96,9 @@ func (s *ActionsService) ListWorkflowJobs(ctx context.Context, owner, repo strin // GetWorkflowJobByID gets a specific job in a workflow run by ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-jobs#get-a-job-for-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs#get-a-job-for-a-workflow-run +// +//meta:operation GET /repos/{owner}/{repo}/actions/jobs/{job_id} func (s *ActionsService) GetWorkflowJobByID(ctx context.Context, owner, repo string, jobID int64) (*WorkflowJob, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/jobs/%v", owner, repo, jobID) @@ -114,7 +118,9 @@ func (s *ActionsService) GetWorkflowJobByID(ctx context.Context, owner, repo str // GetWorkflowJobLogs gets a redirect URL to download a plain text file of logs for a workflow job. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-jobs#download-job-logs-for-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs#download-job-logs-for-a-workflow-run +// +//meta:operation GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs func (s *ActionsService) GetWorkflowJobLogs(ctx context.Context, owner, repo string, jobID int64, maxRedirects int) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/jobs/%v/logs", owner, repo, jobID) diff --git a/github/actions_workflow_runs.go b/github/actions_workflow_runs.go index d57e4887db1..bc7afe9e944 100644 --- a/github/actions_workflow_runs.go +++ b/github/actions_workflow_runs.go @@ -133,7 +133,9 @@ func (s *ActionsService) listWorkflowRuns(ctx context.Context, endpoint string, // ListWorkflowRunsByID lists all workflow runs by workflow ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#list-workflow-runs +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-workflow +// +//meta:operation GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs func (s *ActionsService) ListWorkflowRunsByID(ctx context.Context, owner, repo string, workflowID int64, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) { u := fmt.Sprintf("repos/%s/%s/actions/workflows/%v/runs", owner, repo, workflowID) return s.listWorkflowRuns(ctx, u, opts) @@ -141,7 +143,9 @@ func (s *ActionsService) ListWorkflowRunsByID(ctx context.Context, owner, repo s // ListWorkflowRunsByFileName lists all workflow runs by workflow file name. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#list-workflow-runs +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-workflow +// +//meta:operation GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs func (s *ActionsService) ListWorkflowRunsByFileName(ctx context.Context, owner, repo, workflowFileName string, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) { u := fmt.Sprintf("repos/%s/%s/actions/workflows/%v/runs", owner, repo, workflowFileName) return s.listWorkflowRuns(ctx, u, opts) @@ -149,7 +153,9 @@ func (s *ActionsService) ListWorkflowRunsByFileName(ctx context.Context, owner, // ListRepositoryWorkflowRuns lists all workflow runs for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#list-workflow-runs-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/actions/runs func (s *ActionsService) ListRepositoryWorkflowRuns(ctx context.Context, owner, repo string, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) { u := fmt.Sprintf("repos/%s/%s/actions/runs", owner, repo) u, err := addOptions(u, opts) @@ -173,7 +179,9 @@ func (s *ActionsService) ListRepositoryWorkflowRuns(ctx context.Context, owner, // GetWorkflowRunByID gets a specific workflow run by ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#get-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run +// +//meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id} func (s *ActionsService) GetWorkflowRunByID(ctx context.Context, owner, repo string, runID int64) (*WorkflowRun, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v", owner, repo, runID) @@ -193,7 +201,9 @@ func (s *ActionsService) GetWorkflowRunByID(ctx context.Context, owner, repo str // GetWorkflowRunAttempt gets a specific workflow run attempt. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#get-a-workflow-run-attempt +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run-attempt +// +//meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number} func (s *ActionsService) GetWorkflowRunAttempt(ctx context.Context, owner, repo string, runID int64, attemptNumber int, opts *WorkflowRunAttemptOptions) (*WorkflowRun, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/attempts/%v", owner, repo, runID, attemptNumber) u, err := addOptions(u, opts) @@ -217,7 +227,9 @@ func (s *ActionsService) GetWorkflowRunAttempt(ctx context.Context, owner, repo // GetWorkflowRunAttemptLogs gets a redirect URL to download a plain text file of logs for a workflow run for attempt number. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#download-workflow-run-attempt-logs +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-attempt-logs +// +//meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs func (s *ActionsService) GetWorkflowRunAttemptLogs(ctx context.Context, owner, repo string, runID int64, attemptNumber int, maxRedirects int) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/attempts/%v/logs", owner, repo, runID, attemptNumber) @@ -237,7 +249,9 @@ func (s *ActionsService) GetWorkflowRunAttemptLogs(ctx context.Context, owner, r // RerunWorkflowByID re-runs a workflow by ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#re-run-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#re-run-a-workflow +// +//meta:operation POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun func (s *ActionsService) RerunWorkflowByID(ctx context.Context, owner, repo string, runID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/rerun", owner, repo, runID) @@ -251,7 +265,9 @@ func (s *ActionsService) RerunWorkflowByID(ctx context.Context, owner, repo stri // RerunFailedJobsByID re-runs all of the failed jobs and their dependent jobs in a workflow run by ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#re-run-failed-jobs-from-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#re-run-failed-jobs-from-a-workflow-run +// +//meta:operation POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs func (s *ActionsService) RerunFailedJobsByID(ctx context.Context, owner, repo string, runID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/rerun-failed-jobs", owner, repo, runID) @@ -265,7 +281,9 @@ func (s *ActionsService) RerunFailedJobsByID(ctx context.Context, owner, repo st // RerunJobByID re-runs a job and its dependent jobs in a workflow run by ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run +// +//meta:operation POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun func (s *ActionsService) RerunJobByID(ctx context.Context, owner, repo string, jobID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/jobs/%v/rerun", owner, repo, jobID) @@ -279,7 +297,9 @@ func (s *ActionsService) RerunJobByID(ctx context.Context, owner, repo string, j // CancelWorkflowRunByID cancels a workflow run by ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#cancel-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#cancel-a-workflow-run +// +//meta:operation POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel func (s *ActionsService) CancelWorkflowRunByID(ctx context.Context, owner, repo string, runID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/cancel", owner, repo, runID) @@ -293,7 +313,9 @@ func (s *ActionsService) CancelWorkflowRunByID(ctx context.Context, owner, repo // GetWorkflowRunLogs gets a redirect URL to download a plain text file of logs for a workflow run. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#download-workflow-run-logs +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-logs +// +//meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs func (s *ActionsService) GetWorkflowRunLogs(ctx context.Context, owner, repo string, runID int64, maxRedirects int) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/logs", owner, repo, runID) @@ -313,7 +335,9 @@ func (s *ActionsService) GetWorkflowRunLogs(ctx context.Context, owner, repo str // DeleteWorkflowRun deletes a workflow run by ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#delete-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#delete-a-workflow-run +// +//meta:operation DELETE /repos/{owner}/{repo}/actions/runs/{run_id} 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) @@ -327,7 +351,9 @@ func (s *ActionsService) DeleteWorkflowRun(ctx context.Context, owner, repo stri // DeleteWorkflowRunLogs deletes all logs for a workflow run. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#delete-workflow-run-logs +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#delete-workflow-run-logs +// +//meta:operation DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs func (s *ActionsService) DeleteWorkflowRunLogs(ctx context.Context, owner, repo string, runID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/logs", owner, repo, runID) @@ -341,7 +367,9 @@ func (s *ActionsService) DeleteWorkflowRunLogs(ctx context.Context, owner, repo // GetWorkflowRunUsageByID gets a specific workflow usage run by run ID in the unit of billable milliseconds. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#get-workflow-run-usage +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-workflow-run-usage +// +//meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing func (s *ActionsService) GetWorkflowRunUsageByID(ctx context.Context, owner, repo string, runID int64) (*WorkflowRunUsage, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/timing", owner, repo, runID) @@ -361,7 +389,9 @@ func (s *ActionsService) GetWorkflowRunUsageByID(ctx context.Context, owner, rep // 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 +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run +// +//meta:operation POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments 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) diff --git a/github/actions_workflows.go b/github/actions_workflows.go index c9b47ed4be4..0214e6abff2 100644 --- a/github/actions_workflows.go +++ b/github/actions_workflows.go @@ -58,7 +58,9 @@ type CreateWorkflowDispatchEventRequest struct { // ListWorkflows lists all workflows in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#list-repository-workflows +// GitHub API docs: https://docs.github.com/rest/actions/workflows#list-repository-workflows +// +//meta:operation GET /repos/{owner}/{repo}/actions/workflows func (s *ActionsService) ListWorkflows(ctx context.Context, owner, repo string, opts *ListOptions) (*Workflows, *Response, error) { u := fmt.Sprintf("repos/%s/%s/actions/workflows", owner, repo) u, err := addOptions(u, opts) @@ -82,7 +84,9 @@ func (s *ActionsService) ListWorkflows(ctx context.Context, owner, repo string, // GetWorkflowByID gets a specific workflow by ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#get-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflows#get-a-workflow +// +//meta:operation GET /repos/{owner}/{repo}/actions/workflows/{workflow_id} func (s *ActionsService) GetWorkflowByID(ctx context.Context, owner, repo string, workflowID int64) (*Workflow, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v", owner, repo, workflowID) @@ -91,7 +95,9 @@ func (s *ActionsService) GetWorkflowByID(ctx context.Context, owner, repo string // GetWorkflowByFileName gets a specific workflow by file name. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#get-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflows#get-a-workflow +// +//meta:operation GET /repos/{owner}/{repo}/actions/workflows/{workflow_id} func (s *ActionsService) GetWorkflowByFileName(ctx context.Context, owner, repo, workflowFileName string) (*Workflow, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v", owner, repo, workflowFileName) @@ -115,7 +121,9 @@ func (s *ActionsService) getWorkflow(ctx context.Context, url string) (*Workflow // GetWorkflowUsageByID gets a specific workflow usage by ID in the unit of billable milliseconds. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#get-workflow-usage +// GitHub API docs: https://docs.github.com/rest/actions/workflows#get-workflow-usage +// +//meta:operation GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing func (s *ActionsService) GetWorkflowUsageByID(ctx context.Context, owner, repo string, workflowID int64) (*WorkflowUsage, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/timing", owner, repo, workflowID) @@ -124,7 +132,9 @@ func (s *ActionsService) GetWorkflowUsageByID(ctx context.Context, owner, repo s // GetWorkflowUsageByFileName gets a specific workflow usage by file name in the unit of billable milliseconds. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#get-workflow-usage +// GitHub API docs: https://docs.github.com/rest/actions/workflows#get-workflow-usage +// +//meta:operation GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing func (s *ActionsService) GetWorkflowUsageByFileName(ctx context.Context, owner, repo, workflowFileName string) (*WorkflowUsage, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/timing", owner, repo, workflowFileName) @@ -148,7 +158,9 @@ func (s *ActionsService) getWorkflowUsage(ctx context.Context, url string) (*Wor // CreateWorkflowDispatchEventByID manually triggers a GitHub Actions workflow run. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#create-a-workflow-dispatch-event +// GitHub API docs: https://docs.github.com/rest/actions/workflows#create-a-workflow-dispatch-event +// +//meta:operation POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches func (s *ActionsService) CreateWorkflowDispatchEventByID(ctx context.Context, owner, repo string, workflowID int64, event CreateWorkflowDispatchEventRequest) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/dispatches", owner, repo, workflowID) @@ -157,7 +169,9 @@ func (s *ActionsService) CreateWorkflowDispatchEventByID(ctx context.Context, ow // CreateWorkflowDispatchEventByFileName manually triggers a GitHub Actions workflow run. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#create-a-workflow-dispatch-event +// GitHub API docs: https://docs.github.com/rest/actions/workflows#create-a-workflow-dispatch-event +// +//meta:operation POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches func (s *ActionsService) CreateWorkflowDispatchEventByFileName(ctx context.Context, owner, repo, workflowFileName string, event CreateWorkflowDispatchEventRequest) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/dispatches", owner, repo, workflowFileName) @@ -175,7 +189,9 @@ func (s *ActionsService) createWorkflowDispatchEvent(ctx context.Context, url st // EnableWorkflowByID enables a workflow and sets the state of the workflow to "active". // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#enable-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflows#enable-a-workflow +// +//meta:operation PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable func (s *ActionsService) EnableWorkflowByID(ctx context.Context, owner, repo string, workflowID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/enable", owner, repo, workflowID) return s.doNewPutRequest(ctx, u) @@ -183,7 +199,9 @@ func (s *ActionsService) EnableWorkflowByID(ctx context.Context, owner, repo str // EnableWorkflowByFileName enables a workflow and sets the state of the workflow to "active". // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#enable-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflows#enable-a-workflow +// +//meta:operation PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable func (s *ActionsService) EnableWorkflowByFileName(ctx context.Context, owner, repo, workflowFileName string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/enable", owner, repo, workflowFileName) return s.doNewPutRequest(ctx, u) @@ -191,7 +209,9 @@ func (s *ActionsService) EnableWorkflowByFileName(ctx context.Context, owner, re // DisableWorkflowByID disables a workflow and sets the state of the workflow to "disabled_manually". // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#disable-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflows#disable-a-workflow +// +//meta:operation PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable func (s *ActionsService) DisableWorkflowByID(ctx context.Context, owner, repo string, workflowID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/disable", owner, repo, workflowID) return s.doNewPutRequest(ctx, u) @@ -199,7 +219,9 @@ func (s *ActionsService) DisableWorkflowByID(ctx context.Context, owner, repo st // DisableWorkflowByFileName disables a workflow and sets the state of the workflow to "disabled_manually". // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#disable-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflows#disable-a-workflow +// +//meta:operation PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable func (s *ActionsService) DisableWorkflowByFileName(ctx context.Context, owner, repo, workflowFileName string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/disable", owner, repo, workflowFileName) return s.doNewPutRequest(ctx, u) diff --git a/github/activity.go b/github/activity.go index 9cd9f9b71d7..edf8cc4397c 100644 --- a/github/activity.go +++ b/github/activity.go @@ -10,7 +10,7 @@ import "context" // ActivityService handles communication with the activity related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/activity/ +// GitHub API docs: https://docs.github.com/rest/activity/ type ActivityService service // FeedLink represents a link to a related resource. @@ -57,6 +57,10 @@ type FeedLinks struct { // // Note: Private feeds are only returned when authenticating via Basic Auth // since current feed URIs use the older, non revocable auth tokens. +// +// GitHub API docs: https://docs.github.com/rest/activity/feeds#get-feeds +// +//meta:operation GET /feeds func (s *ActivityService) ListFeeds(ctx context.Context) (*Feeds, *Response, error) { req, err := s.client.NewRequest("GET", "feeds", nil) if err != nil { diff --git a/github/activity_events.go b/github/activity_events.go index d6f0f043b08..b12baa99e67 100644 --- a/github/activity_events.go +++ b/github/activity_events.go @@ -12,7 +12,9 @@ import ( // ListEvents drinks from the firehose of all public events across GitHub. // -// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-public-events +// GitHub API docs: https://docs.github.com/rest/activity/events#list-public-events +// +//meta:operation GET /events func (s *ActivityService) ListEvents(ctx context.Context, opts *ListOptions) ([]*Event, *Response, error) { u, err := addOptions("events", opts) if err != nil { @@ -35,7 +37,9 @@ func (s *ActivityService) ListEvents(ctx context.Context, opts *ListOptions) ([] // ListRepositoryEvents lists events for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-repository-events +// GitHub API docs: https://docs.github.com/rest/activity/events#list-repository-events +// +//meta:operation GET /repos/{owner}/{repo}/events func (s *ActivityService) ListRepositoryEvents(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Event, *Response, error) { u := fmt.Sprintf("repos/%v/%v/events", owner, repo) u, err := addOptions(u, opts) @@ -59,7 +63,9 @@ func (s *ActivityService) ListRepositoryEvents(ctx context.Context, owner, repo // ListIssueEventsForRepository lists issue events for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/issues/events#list-issue-events-for-a-repository +// GitHub API docs: https://docs.github.com/rest/issues/events#list-issue-events-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/issues/events func (s *ActivityService) ListIssueEventsForRepository(ctx context.Context, owner, repo string, opts *ListOptions) ([]*IssueEvent, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/events", owner, repo) u, err := addOptions(u, opts) @@ -83,7 +89,9 @@ func (s *ActivityService) ListIssueEventsForRepository(ctx context.Context, owne // ListEventsForRepoNetwork lists public events for a network of repositories. // -// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-public-events-for-a-network-of-repositories +// GitHub API docs: https://docs.github.com/rest/activity/events#list-public-events-for-a-network-of-repositories +// +//meta:operation GET /networks/{owner}/{repo}/events func (s *ActivityService) ListEventsForRepoNetwork(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Event, *Response, error) { u := fmt.Sprintf("networks/%v/%v/events", owner, repo) u, err := addOptions(u, opts) @@ -107,7 +115,9 @@ func (s *ActivityService) ListEventsForRepoNetwork(ctx context.Context, owner, r // ListEventsForOrganization lists public events for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-public-organization-events +// GitHub API docs: https://docs.github.com/rest/activity/events#list-public-organization-events +// +//meta:operation GET /orgs/{org}/events func (s *ActivityService) ListEventsForOrganization(ctx context.Context, org string, opts *ListOptions) ([]*Event, *Response, error) { u := fmt.Sprintf("orgs/%v/events", org) u, err := addOptions(u, opts) @@ -132,8 +142,11 @@ func (s *ActivityService) ListEventsForOrganization(ctx context.Context, org str // ListEventsPerformedByUser lists the events performed by a user. If publicOnly is // true, only public events will be returned. // -// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-events-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-public-events-for-a-user +// GitHub API docs: https://docs.github.com/rest/activity/events#list-events-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/events#list-public-events-for-a-user +// +//meta:operation GET /users/{username}/events +//meta:operation GET /users/{username}/events/public func (s *ActivityService) ListEventsPerformedByUser(ctx context.Context, user string, publicOnly bool, opts *ListOptions) ([]*Event, *Response, error) { var u string if publicOnly { @@ -163,8 +176,11 @@ func (s *ActivityService) ListEventsPerformedByUser(ctx context.Context, user st // ListEventsReceivedByUser lists the events received by a user. If publicOnly is // true, only public events will be returned. // -// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-events-received-by-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-public-events-received-by-a-user +// GitHub API docs: https://docs.github.com/rest/activity/events#list-events-received-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/events#list-public-events-received-by-a-user +// +//meta:operation GET /users/{username}/received_events +//meta:operation GET /users/{username}/received_events/public func (s *ActivityService) ListEventsReceivedByUser(ctx context.Context, user string, publicOnly bool, opts *ListOptions) ([]*Event, *Response, error) { var u string if publicOnly { @@ -194,7 +210,9 @@ func (s *ActivityService) ListEventsReceivedByUser(ctx context.Context, user str // ListUserEventsForOrganization provides the user’s organization dashboard. You // must be authenticated as the user to view this. // -// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-organization-events-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/events#list-organization-events-for-the-authenticated-user +// +//meta:operation GET /users/{username}/events/orgs/{org} func (s *ActivityService) ListUserEventsForOrganization(ctx context.Context, org, user string, opts *ListOptions) ([]*Event, *Response, error) { u := fmt.Sprintf("users/%v/events/orgs/%v", user, org) u, err := addOptions(u, opts) diff --git a/github/activity_notifications.go b/github/activity_notifications.go index 03476c2e2c3..47f22261dd2 100644 --- a/github/activity_notifications.go +++ b/github/activity_notifications.go @@ -19,7 +19,7 @@ type Notification struct { // Reason identifies the event that triggered the notification. // - // GitHub API docs: https://docs.github.com/en/rest/activity#notification-reasons + // GitHub API docs: https://docs.github.com/rest/activity#notification-reasons Reason *string `json:"reason,omitempty"` Unread *bool `json:"unread,omitempty"` @@ -49,7 +49,9 @@ type NotificationListOptions struct { // ListNotifications lists all notifications for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#list-notifications-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/notifications#list-notifications-for-the-authenticated-user +// +//meta:operation GET /notifications func (s *ActivityService) ListNotifications(ctx context.Context, opts *NotificationListOptions) ([]*Notification, *Response, error) { u := "notifications" u, err := addOptions(u, opts) @@ -74,7 +76,9 @@ func (s *ActivityService) ListNotifications(ctx context.Context, opts *Notificat // ListRepositoryNotifications lists all notifications in a given repository // for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user +// +//meta:operation GET /repos/{owner}/{repo}/notifications func (s *ActivityService) ListRepositoryNotifications(ctx context.Context, owner, repo string, opts *NotificationListOptions) ([]*Notification, *Response, error) { u := fmt.Sprintf("repos/%v/%v/notifications", owner, repo) u, err := addOptions(u, opts) @@ -102,7 +106,9 @@ type markReadOptions struct { // MarkNotificationsRead marks all notifications up to lastRead as read. // -// GitHub API docs: https://docs.github.com/en/rest/activity#mark-as-read +// GitHub API docs: https://docs.github.com/rest/activity/notifications#mark-notifications-as-read +// +//meta:operation PUT /notifications func (s *ActivityService) MarkNotificationsRead(ctx context.Context, lastRead Timestamp) (*Response, error) { opts := &markReadOptions{ LastReadAt: lastRead, @@ -118,7 +124,9 @@ func (s *ActivityService) MarkNotificationsRead(ctx context.Context, lastRead Ti // MarkRepositoryNotificationsRead marks all notifications up to lastRead in // the specified repository as read. // -// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#mark-repository-notifications-as-read +// GitHub API docs: https://docs.github.com/rest/activity/notifications#mark-repository-notifications-as-read +// +//meta:operation PUT /repos/{owner}/{repo}/notifications func (s *ActivityService) MarkRepositoryNotificationsRead(ctx context.Context, owner, repo string, lastRead Timestamp) (*Response, error) { opts := &markReadOptions{ LastReadAt: lastRead, @@ -134,7 +142,9 @@ func (s *ActivityService) MarkRepositoryNotificationsRead(ctx context.Context, o // GetThread gets the specified notification thread. // -// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#get-a-thread +// GitHub API docs: https://docs.github.com/rest/activity/notifications#get-a-thread +// +//meta:operation GET /notifications/threads/{thread_id} func (s *ActivityService) GetThread(ctx context.Context, id string) (*Notification, *Response, error) { u := fmt.Sprintf("notifications/threads/%v", id) @@ -154,7 +164,9 @@ func (s *ActivityService) GetThread(ctx context.Context, id string) (*Notificati // MarkThreadRead marks the specified thread as read. // -// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#mark-a-thread-as-read +// GitHub API docs: https://docs.github.com/rest/activity/notifications#mark-a-thread-as-read +// +//meta:operation PATCH /notifications/threads/{thread_id} func (s *ActivityService) MarkThreadRead(ctx context.Context, id string) (*Response, error) { u := fmt.Sprintf("notifications/threads/%v", id) @@ -169,7 +181,9 @@ func (s *ActivityService) MarkThreadRead(ctx context.Context, id string) (*Respo // GetThreadSubscription checks to see if the authenticated user is subscribed // to a thread. // -// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#get-a-thread-subscription-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/notifications#get-a-thread-subscription-for-the-authenticated-user +// +//meta:operation GET /notifications/threads/{thread_id}/subscription func (s *ActivityService) GetThreadSubscription(ctx context.Context, id string) (*Subscription, *Response, error) { u := fmt.Sprintf("notifications/threads/%v/subscription", id) @@ -190,7 +204,9 @@ func (s *ActivityService) GetThreadSubscription(ctx context.Context, id string) // SetThreadSubscription sets the subscription for the specified thread for the // authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#set-a-thread-subscription +// GitHub API docs: https://docs.github.com/rest/activity/notifications#set-a-thread-subscription +// +//meta:operation PUT /notifications/threads/{thread_id}/subscription func (s *ActivityService) SetThreadSubscription(ctx context.Context, id string, subscription *Subscription) (*Subscription, *Response, error) { u := fmt.Sprintf("notifications/threads/%v/subscription", id) @@ -211,7 +227,9 @@ func (s *ActivityService) SetThreadSubscription(ctx context.Context, id string, // DeleteThreadSubscription deletes the subscription for the specified thread // for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#delete-a-thread-subscription +// GitHub API docs: https://docs.github.com/rest/activity/notifications#delete-a-thread-subscription +// +//meta:operation DELETE /notifications/threads/{thread_id}/subscription func (s *ActivityService) DeleteThreadSubscription(ctx context.Context, id string) (*Response, error) { u := fmt.Sprintf("notifications/threads/%v/subscription", id) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/activity_star.go b/github/activity_star.go index 65a316f5325..cebdacf76a9 100644 --- a/github/activity_star.go +++ b/github/activity_star.go @@ -25,7 +25,9 @@ type Stargazer struct { // ListStargazers lists people who have starred the specified repo. // -// GitHub API docs: https://docs.github.com/en/rest/activity/starring#list-stargazers +// GitHub API docs: https://docs.github.com/rest/activity/starring#list-stargazers +// +//meta:operation GET /repos/{owner}/{repo}/stargazers func (s *ActivityService) ListStargazers(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Stargazer, *Response, error) { u := fmt.Sprintf("repos/%s/%s/stargazers", owner, repo) u, err := addOptions(u, opts) @@ -67,8 +69,11 @@ type ActivityListStarredOptions struct { // ListStarred lists all the repos starred by a user. Passing the empty string // will list the starred repositories for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/activity/starring#list-repositories-starred-by-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/activity/starring#list-repositories-starred-by-a-user +// GitHub API docs: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-a-user +// GitHub API docs: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-the-authenticated-user +// +//meta:operation GET /user/starred +//meta:operation GET /users/{username}/starred func (s *ActivityService) ListStarred(ctx context.Context, user string, opts *ActivityListStarredOptions) ([]*StarredRepository, *Response, error) { var u string if user != "" { @@ -101,7 +106,9 @@ func (s *ActivityService) ListStarred(ctx context.Context, user string, opts *Ac // IsStarred checks if a repository is starred by authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/activity/starring#check-if-a-repository-is-starred-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/starring#check-if-a-repository-is-starred-by-the-authenticated-user +// +//meta:operation GET /user/starred/{owner}/{repo} func (s *ActivityService) IsStarred(ctx context.Context, owner, repo string) (bool, *Response, error) { u := fmt.Sprintf("user/starred/%v/%v", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -116,7 +123,9 @@ func (s *ActivityService) IsStarred(ctx context.Context, owner, repo string) (bo // Star a repository as the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/activity/starring#star-a-repository-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/starring#star-a-repository-for-the-authenticated-user +// +//meta:operation PUT /user/starred/{owner}/{repo} func (s *ActivityService) Star(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("user/starred/%v/%v", owner, repo) req, err := s.client.NewRequest("PUT", u, nil) @@ -129,7 +138,9 @@ func (s *ActivityService) Star(ctx context.Context, owner, repo string) (*Respon // Unstar a repository as the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/activity/starring#unstar-a-repository-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/starring#unstar-a-repository-for-the-authenticated-user +// +//meta:operation DELETE /user/starred/{owner}/{repo} func (s *ActivityService) Unstar(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("user/starred/%v/%v", owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/activity_watching.go b/github/activity_watching.go index 2d6fafcc793..348590057b9 100644 --- a/github/activity_watching.go +++ b/github/activity_watching.go @@ -27,7 +27,9 @@ type Subscription struct { // ListWatchers lists watchers of a particular repo. // -// GitHub API docs: https://docs.github.com/en/rest/activity/watching#list-watchers +// GitHub API docs: https://docs.github.com/rest/activity/watching#list-watchers +// +//meta:operation GET /repos/{owner}/{repo}/subscribers func (s *ActivityService) ListWatchers(ctx context.Context, owner, repo string, opts *ListOptions) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%s/%s/subscribers", owner, repo) u, err := addOptions(u, opts) @@ -52,8 +54,11 @@ func (s *ActivityService) ListWatchers(ctx context.Context, owner, repo string, // ListWatched lists the repositories the specified user is watching. Passing // the empty string will fetch watched repos for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/activity/watching#list-repositories-watched-by-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/activity/watching#list-repositories-watched-by-a-user +// GitHub API docs: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-a-user +// GitHub API docs: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-the-authenticated-user +// +//meta:operation GET /user/subscriptions +//meta:operation GET /users/{username}/subscriptions func (s *ActivityService) ListWatched(ctx context.Context, user string, opts *ListOptions) ([]*Repository, *Response, error) { var u string if user != "" { @@ -84,7 +89,9 @@ func (s *ActivityService) ListWatched(ctx context.Context, user string, opts *Li // repository for the authenticated user. If the authenticated user is not // watching the repository, a nil Subscription is returned. // -// GitHub API docs: https://docs.github.com/en/rest/activity/watching#get-a-repository-subscription +// GitHub API docs: https://docs.github.com/rest/activity/watching#get-a-repository-subscription +// +//meta:operation GET /repos/{owner}/{repo}/subscription func (s *ActivityService) GetRepositorySubscription(ctx context.Context, owner, repo string) (*Subscription, *Response, error) { u := fmt.Sprintf("repos/%s/%s/subscription", owner, repo) @@ -111,7 +118,9 @@ func (s *ActivityService) GetRepositorySubscription(ctx context.Context, owner, // To ignore notifications made within a repository, set subscription.Ignored to true. // To stop watching a repository, use DeleteRepositorySubscription. // -// GitHub API docs: https://docs.github.com/en/rest/activity/watching#set-a-repository-subscription +// GitHub API docs: https://docs.github.com/rest/activity/watching#set-a-repository-subscription +// +//meta:operation PUT /repos/{owner}/{repo}/subscription func (s *ActivityService) SetRepositorySubscription(ctx context.Context, owner, repo string, subscription *Subscription) (*Subscription, *Response, error) { u := fmt.Sprintf("repos/%s/%s/subscription", owner, repo) @@ -135,7 +144,9 @@ func (s *ActivityService) SetRepositorySubscription(ctx context.Context, owner, // This is used to stop watching a repository. To control whether or not to // receive notifications from a repository, use SetRepositorySubscription. // -// GitHub API docs: https://docs.github.com/en/rest/activity/watching#delete-a-repository-subscription +// GitHub API docs: https://docs.github.com/rest/activity/watching#delete-a-repository-subscription +// +//meta:operation DELETE /repos/{owner}/{repo}/subscription func (s *ActivityService) DeleteRepositorySubscription(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%s/%s/subscription", owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/admin.go b/github/admin.go index 1b28ef64c7d..8eee9854c11 100644 --- a/github/admin.go +++ b/github/admin.go @@ -14,7 +14,7 @@ import ( // GitHub API. These API routes are normally only accessible for GitHub // Enterprise installations. // -// GitHub API docs: https://docs.github.com/en/rest/enterprise-admin +// GitHub API docs: https://docs.github.com/rest/enterprise-admin type AdminService service // TeamLDAPMapping represents the mapping between a GitHub team and an LDAP group. @@ -82,7 +82,9 @@ func (m Enterprise) String() string { // UpdateUserLDAPMapping updates the mapping between a GitHub user and an LDAP user. // -// GitHub API docs: https://docs.github.com/en/enterprise-server/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user +// +//meta:operation PATCH /admin/ldap/users/{username}/mapping func (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, mapping *UserLDAPMapping) (*UserLDAPMapping, *Response, error) { u := fmt.Sprintf("admin/ldap/users/%v/mapping", user) req, err := s.client.NewRequest("PATCH", u, mapping) @@ -101,7 +103,9 @@ func (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, m // UpdateTeamLDAPMapping updates the mapping between a GitHub team and an LDAP group. // -// GitHub API docs: https://docs.github.com/en/rest/enterprise/ldap/#update-ldap-mapping-for-a-team +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team +// +//meta:operation PATCH /admin/ldap/teams/{team_id}/mapping func (s *AdminService) UpdateTeamLDAPMapping(ctx context.Context, team int64, mapping *TeamLDAPMapping) (*TeamLDAPMapping, *Response, error) { u := fmt.Sprintf("admin/ldap/teams/%v/mapping", team) req, err := s.client.NewRequest("PATCH", u, mapping) diff --git a/github/admin_orgs.go b/github/admin_orgs.go index 448e51f631e..c734d4de12f 100644 --- a/github/admin_orgs.go +++ b/github/admin_orgs.go @@ -22,7 +22,9 @@ type createOrgRequest struct { // Note that only a subset of the org fields are used and org must // not be nil. // -// GitHub Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/orgs/#create-an-organization +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/orgs#create-an-organization +// +//meta:operation POST /admin/organizations func (s *AdminService) CreateOrg(ctx context.Context, org *Organization, admin string) (*Organization, *Response, error) { u := "admin/organizations" @@ -59,14 +61,18 @@ type RenameOrgResponse struct { // RenameOrg renames an organization in GitHub Enterprise. // -// GitHub Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/orgs/#rename-an-organization +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/orgs#update-an-organization-name +// +//meta:operation PATCH /admin/organizations/{org} func (s *AdminService) RenameOrg(ctx context.Context, org *Organization, newName string) (*RenameOrgResponse, *Response, error) { return s.RenameOrgByName(ctx, *org.Login, newName) } // RenameOrgByName renames an organization in GitHub Enterprise using its current name. // -// GitHub Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/orgs/#rename-an-organization +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/orgs#update-an-organization-name +// +//meta:operation PATCH /admin/organizations/{org} func (s *AdminService) RenameOrgByName(ctx context.Context, org, newName string) (*RenameOrgResponse, *Response, error) { u := fmt.Sprintf("admin/organizations/%v", org) diff --git a/github/admin_stats.go b/github/admin_stats.go index 17e568f62b2..aa23f5d1995 100644 --- a/github/admin_stats.go +++ b/github/admin_stats.go @@ -152,7 +152,9 @@ func (s RepoStats) String() string { // Please note that this is only available to site administrators, // otherwise it will error with a 404 not found (instead of 401 or 403). // -// GitHub API docs: https://docs.github.com/en/rest/enterprise-admin/admin_stats/ +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-all-statistics +// +//meta:operation GET /enterprise/stats/all func (s *AdminService) GetAdminStats(ctx context.Context) (*AdminStats, *Response, error) { u := "enterprise/stats/all" req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/admin_users.go b/github/admin_users.go index d756a77e20d..3916a470b04 100644 --- a/github/admin_users.go +++ b/github/admin_users.go @@ -19,7 +19,9 @@ type createUserRequest struct { // CreateUser creates a new user in GitHub Enterprise. // -// GitHub Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#create-a-new-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#create-a-user +// +//meta:operation POST /admin/users func (s *AdminService) CreateUser(ctx context.Context, login, email string) (*User, *Response, error) { u := "admin/users" @@ -44,7 +46,9 @@ func (s *AdminService) CreateUser(ctx context.Context, login, email string) (*Us // DeleteUser deletes a user in GitHub Enterprise. // -// GitHub Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#delete-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#delete-a-user +// +//meta:operation DELETE /admin/users/{username} func (s *AdminService) DeleteUser(ctx context.Context, username string) (*Response, error) { u := "admin/users/" + username @@ -95,7 +99,9 @@ type UserAuthorization struct { // CreateUserImpersonation creates an impersonation OAuth token. // -// GitHub Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#create-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#create-an-impersonation-oauth-token +// +//meta:operation POST /admin/users/{username}/authorizations func (s *AdminService) CreateUserImpersonation(ctx context.Context, username string, opts *ImpersonateUserOptions) (*UserAuthorization, *Response, error) { u := fmt.Sprintf("admin/users/%s/authorizations", username) @@ -115,7 +121,9 @@ func (s *AdminService) CreateUserImpersonation(ctx context.Context, username str // DeleteUserImpersonation deletes an impersonation OAuth token. // -// GitHub Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#delete-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#delete-an-impersonation-oauth-token +// +//meta:operation DELETE /admin/users/{username}/authorizations func (s *AdminService) DeleteUserImpersonation(ctx context.Context, username string) (*Response, error) { u := fmt.Sprintf("admin/users/%s/authorizations", username) diff --git a/github/apps.go b/github/apps.go index 8965e66815c..f0392f2d706 100644 --- a/github/apps.go +++ b/github/apps.go @@ -13,7 +13,7 @@ import ( // AppsService provides access to the installation related functions // in the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/apps/ +// GitHub API docs: https://docs.github.com/rest/apps/ type AppsService service // App represents a GitHub App. @@ -60,8 +60,8 @@ type InstallationTokenOptions struct { // // Permission names taken from: // -// https://docs.github.com/en/enterprise-server@3.0/rest/apps#create-an-installation-access-token-for-an-app -// https://docs.github.com/en/rest/apps#create-an-installation-access-token-for-an-app +// https://docs.github.com/enterprise-server@3.0/rest/apps#create-an-installation-access-token-for-an-app +// https://docs.github.com/rest/apps#create-an-installation-access-token-for-an-app type InstallationPermissions struct { Actions *string `json:"actions,omitempty"` Administration *string `json:"administration,omitempty"` @@ -160,8 +160,11 @@ func (i Installation) String() string { // You can find this on the settings page for your GitHub App // (e.g., https://github.com/settings/apps/:app_slug). // -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#get-the-authenticated-app -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#get-an-app +// GitHub API docs: https://docs.github.com/rest/apps/apps#get-an-app +// GitHub API docs: https://docs.github.com/rest/apps/apps#get-the-authenticated-app +// +//meta:operation GET /app +//meta:operation GET /apps/{app_slug} func (s *AppsService) Get(ctx context.Context, appSlug string) (*App, *Response, error) { var u string if appSlug != "" { @@ -186,7 +189,9 @@ func (s *AppsService) Get(ctx context.Context, appSlug string) (*App, *Response, // ListInstallationRequests lists the pending installation requests that the current GitHub App has. // -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#list-installation-requests-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/rest/apps/apps#list-installation-requests-for-the-authenticated-app +// +//meta:operation GET /app/installation-requests func (s *AppsService) ListInstallationRequests(ctx context.Context, opts *ListOptions) ([]*InstallationRequest, *Response, error) { u, err := addOptions("app/installation-requests", opts) if err != nil { @@ -209,7 +214,9 @@ func (s *AppsService) ListInstallationRequests(ctx context.Context, opts *ListOp // ListInstallations lists the installations that the current GitHub App has. // -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#list-installations-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/rest/apps/apps#list-installations-for-the-authenticated-app +// +//meta:operation GET /app/installations func (s *AppsService) ListInstallations(ctx context.Context, opts *ListOptions) ([]*Installation, *Response, error) { u, err := addOptions("app/installations", opts) if err != nil { @@ -232,14 +239,18 @@ func (s *AppsService) ListInstallations(ctx context.Context, opts *ListOptions) // GetInstallation returns the specified installation. // -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#get-an-installation-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/rest/apps/apps#get-an-installation-for-the-authenticated-app +// +//meta:operation GET /app/installations/{installation_id} func (s *AppsService) GetInstallation(ctx context.Context, id int64) (*Installation, *Response, error) { return s.getInstallation(ctx, fmt.Sprintf("app/installations/%v", id)) } // ListUserInstallations lists installations that are accessible to the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/apps/installations#list-app-installations-accessible-to-the-user-access-token +// GitHub API docs: https://docs.github.com/rest/apps/installations#list-app-installations-accessible-to-the-user-access-token +// +//meta:operation GET /user/installations func (s *AppsService) ListUserInstallations(ctx context.Context, opts *ListOptions) ([]*Installation, *Response, error) { u, err := addOptions("user/installations", opts) if err != nil { @@ -264,7 +275,9 @@ func (s *AppsService) ListUserInstallations(ctx context.Context, opts *ListOptio // SuspendInstallation suspends the specified installation. // -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#suspend-an-app-installation +// GitHub API docs: https://docs.github.com/rest/apps/apps#suspend-an-app-installation +// +//meta:operation PUT /app/installations/{installation_id}/suspended func (s *AppsService) SuspendInstallation(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("app/installations/%v/suspended", id) @@ -278,7 +291,9 @@ func (s *AppsService) SuspendInstallation(ctx context.Context, id int64) (*Respo // UnsuspendInstallation unsuspends the specified installation. // -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#unsuspend-an-app-installation +// GitHub API docs: https://docs.github.com/rest/apps/apps#unsuspend-an-app-installation +// +//meta:operation DELETE /app/installations/{installation_id}/suspended func (s *AppsService) UnsuspendInstallation(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("app/installations/%v/suspended", id) @@ -292,7 +307,9 @@ func (s *AppsService) UnsuspendInstallation(ctx context.Context, id int64) (*Res // DeleteInstallation deletes the specified installation. // -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#delete-an-installation-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/rest/apps/apps#delete-an-installation-for-the-authenticated-app +// +//meta:operation DELETE /app/installations/{installation_id} func (s *AppsService) DeleteInstallation(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("app/installations/%v", id) @@ -306,7 +323,9 @@ func (s *AppsService) DeleteInstallation(ctx context.Context, id int64) (*Respon // CreateInstallationToken creates a new installation token. // -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#create-an-installation-access-token-for-an-app +// GitHub API docs: https://docs.github.com/rest/apps/apps#create-an-installation-access-token-for-an-app +// +//meta:operation POST /app/installations/{installation_id}/access_tokens func (s *AppsService) CreateInstallationToken(ctx context.Context, id int64, opts *InstallationTokenOptions) (*InstallationToken, *Response, error) { u := fmt.Sprintf("app/installations/%v/access_tokens", id) @@ -326,7 +345,9 @@ func (s *AppsService) CreateInstallationToken(ctx context.Context, id int64, opt // CreateAttachment creates a new attachment on user comment containing a url. // -// TODO: Find GitHub API docs. +// GitHub API docs: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#create-a-content-attachment +// +//meta:operation POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments func (s *AppsService) CreateAttachment(ctx context.Context, contentReferenceID int64, title, body string) (*Attachment, *Response, error) { u := fmt.Sprintf("content_references/%v/attachments", contentReferenceID) payload := &Attachment{Title: String(title), Body: String(body)} @@ -349,28 +370,36 @@ func (s *AppsService) CreateAttachment(ctx context.Context, contentReferenceID i // FindOrganizationInstallation finds the organization's installation information. // -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#get-an-organization-installation-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/rest/apps/apps#get-an-organization-installation-for-the-authenticated-app +// +//meta:operation GET /orgs/{org}/installation func (s *AppsService) FindOrganizationInstallation(ctx context.Context, org string) (*Installation, *Response, error) { return s.getInstallation(ctx, fmt.Sprintf("orgs/%v/installation", org)) } // FindRepositoryInstallation finds the repository's installation information. // -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#get-a-repository-installation-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/rest/apps/apps#get-a-repository-installation-for-the-authenticated-app +// +//meta:operation GET /repos/{owner}/{repo}/installation func (s *AppsService) FindRepositoryInstallation(ctx context.Context, owner, repo string) (*Installation, *Response, error) { return s.getInstallation(ctx, fmt.Sprintf("repos/%v/%v/installation", owner, repo)) } // FindRepositoryInstallationByID finds the repository's installation information. // -// Note: FindRepositoryInstallationByID uses the undocumented GitHub API endpoint /repositories/:id/installation. +// Note: FindRepositoryInstallationByID uses the undocumented GitHub API endpoint "GET /repositories/{repository_id}/installation". +// +//meta:operation GET /repositories/{repository_id}/installation func (s *AppsService) FindRepositoryInstallationByID(ctx context.Context, id int64) (*Installation, *Response, error) { return s.getInstallation(ctx, fmt.Sprintf("repositories/%d/installation", id)) } // FindUserInstallation finds the user's installation information. // -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#get-a-user-installation-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/rest/apps/apps#get-a-user-installation-for-the-authenticated-app +// +//meta:operation GET /users/{username}/installation func (s *AppsService) FindUserInstallation(ctx context.Context, user string) (*Installation, *Response, error) { return s.getInstallation(ctx, fmt.Sprintf("users/%v/installation", user)) } diff --git a/github/apps_hooks.go b/github/apps_hooks.go index e3bd2afc032..6046827ef06 100644 --- a/github/apps_hooks.go +++ b/github/apps_hooks.go @@ -12,7 +12,9 @@ import ( // GetHookConfig returns the webhook configuration for a GitHub App. // The underlying transport must be authenticated as an app. // -// GitHub API docs: https://docs.github.com/en/rest/apps#get-a-webhook-configuration-for-an-app +// GitHub API docs: https://docs.github.com/rest/apps/webhooks#get-a-webhook-configuration-for-an-app +// +//meta:operation GET /app/hook/config func (s *AppsService) GetHookConfig(ctx context.Context) (*HookConfig, *Response, error) { req, err := s.client.NewRequest("GET", "app/hook/config", nil) if err != nil { @@ -31,7 +33,9 @@ func (s *AppsService) GetHookConfig(ctx context.Context) (*HookConfig, *Response // UpdateHookConfig updates the webhook configuration for a GitHub App. // The underlying transport must be authenticated as an app. // -// GitHub API docs: https://docs.github.com/en/rest/apps#update-a-webhook-configuration-for-an-app +// GitHub API docs: https://docs.github.com/rest/apps/webhooks#update-a-webhook-configuration-for-an-app +// +//meta:operation PATCH /app/hook/config func (s *AppsService) UpdateHookConfig(ctx context.Context, config *HookConfig) (*HookConfig, *Response, error) { req, err := s.client.NewRequest("PATCH", "app/hook/config", config) if err != nil { diff --git a/github/apps_hooks_deliveries.go b/github/apps_hooks_deliveries.go index 33102f36d2b..59800a0ae43 100644 --- a/github/apps_hooks_deliveries.go +++ b/github/apps_hooks_deliveries.go @@ -12,7 +12,9 @@ import ( // ListHookDeliveries lists deliveries of an App webhook. // -// GitHub API docs: https://docs.github.com/en/rest/apps/webhooks#list-deliveries-for-an-app-webhook +// GitHub API docs: https://docs.github.com/rest/apps/webhooks#list-deliveries-for-an-app-webhook +// +//meta:operation GET /app/hook/deliveries func (s *AppsService) ListHookDeliveries(ctx context.Context, opts *ListCursorOptions) ([]*HookDelivery, *Response, error) { u, err := addOptions("app/hook/deliveries", opts) if err != nil { @@ -35,7 +37,9 @@ func (s *AppsService) ListHookDeliveries(ctx context.Context, opts *ListCursorOp // GetHookDelivery returns the App webhook delivery with the specified ID. // -// GitHub API docs: https://docs.github.com/en/rest/apps/webhooks#get-a-delivery-for-an-app-webhook +// GitHub API docs: https://docs.github.com/rest/apps/webhooks#get-a-delivery-for-an-app-webhook +// +//meta:operation GET /app/hook/deliveries/{delivery_id} func (s *AppsService) GetHookDelivery(ctx context.Context, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("app/hook/deliveries/%v", deliveryID) req, err := s.client.NewRequest("GET", u, nil) @@ -54,7 +58,9 @@ func (s *AppsService) GetHookDelivery(ctx context.Context, deliveryID int64) (*H // RedeliverHookDelivery redelivers a delivery for an App webhook. // -// GitHub API docs: https://docs.github.com/en/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook +// GitHub API docs: https://docs.github.com/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook +// +//meta:operation POST /app/hook/deliveries/{delivery_id}/attempts func (s *AppsService) RedeliverHookDelivery(ctx context.Context, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("app/hook/deliveries/%v/attempts", deliveryID) req, err := s.client.NewRequest("POST", u, nil) diff --git a/github/apps_installation.go b/github/apps_installation.go index b619080713f..d430511d074 100644 --- a/github/apps_installation.go +++ b/github/apps_installation.go @@ -19,7 +19,9 @@ type ListRepositories struct { // ListRepos lists the repositories that are accessible to the authenticated installation. // -// GitHub API docs: https://docs.github.com/en/rest/apps/installations#list-repositories-accessible-to-the-app-installation +// GitHub API docs: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-app-installation +// +//meta:operation GET /installation/repositories func (s *AppsService) ListRepos(ctx context.Context, opts *ListOptions) (*ListRepositories, *Response, error) { u, err := addOptions("installation/repositories", opts) if err != nil { @@ -52,7 +54,9 @@ func (s *AppsService) ListRepos(ctx context.Context, opts *ListOptions) (*ListRe // ListUserRepos lists repositories that are accessible // to the authenticated user for an installation. // -// GitHub API docs: https://docs.github.com/en/rest/apps/installations#list-repositories-accessible-to-the-user-access-token +// GitHub API docs: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-user-access-token +// +//meta:operation GET /user/installations/{installation_id}/repositories func (s *AppsService) ListUserRepos(ctx context.Context, id int64, opts *ListOptions) (*ListRepositories, *Response, error) { u := fmt.Sprintf("user/installations/%v/repositories", id) u, err := addOptions(u, opts) @@ -84,7 +88,9 @@ func (s *AppsService) ListUserRepos(ctx context.Context, id int64, opts *ListOpt // AddRepository adds a single repository to an installation. // -// GitHub API docs: https://docs.github.com/en/rest/apps/installations#add-a-repository-to-an-app-installation +// GitHub API docs: https://docs.github.com/rest/apps/installations#add-a-repository-to-an-app-installation +// +//meta:operation PUT /user/installations/{installation_id}/repositories/{repository_id} func (s *AppsService) AddRepository(ctx context.Context, instID, repoID int64) (*Repository, *Response, error) { u := fmt.Sprintf("user/installations/%v/repositories/%v", instID, repoID) req, err := s.client.NewRequest("PUT", u, nil) @@ -103,7 +109,9 @@ func (s *AppsService) AddRepository(ctx context.Context, instID, repoID int64) ( // RemoveRepository removes a single repository from an installation. // -// GitHub API docs: https://docs.github.com/en/rest/apps/installations#remove-a-repository-from-an-app-installation +// GitHub API docs: https://docs.github.com/rest/apps/installations#remove-a-repository-from-an-app-installation +// +//meta:operation DELETE /user/installations/{installation_id}/repositories/{repository_id} func (s *AppsService) RemoveRepository(ctx context.Context, instID, repoID int64) (*Response, error) { u := fmt.Sprintf("user/installations/%v/repositories/%v", instID, repoID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -116,7 +124,9 @@ func (s *AppsService) RemoveRepository(ctx context.Context, instID, repoID int64 // RevokeInstallationToken revokes an installation token. // -// GitHub API docs: https://docs.github.com/en/rest/apps/installations#revoke-an-installation-access-token +// GitHub API docs: https://docs.github.com/rest/apps/installations#revoke-an-installation-access-token +// +//meta:operation DELETE /installation/token func (s *AppsService) RevokeInstallationToken(ctx context.Context) (*Response, error) { u := "installation/token" req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/apps_manifest.go b/github/apps_manifest.go index fa4c85379ca..5b6ff9af414 100644 --- a/github/apps_manifest.go +++ b/github/apps_manifest.go @@ -31,7 +31,9 @@ type AppConfig struct { // CompleteAppManifest completes the App manifest handshake flow for the given // code. // -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#create-a-github-app-from-a-manifest +// GitHub API docs: https://docs.github.com/rest/apps/apps#create-a-github-app-from-a-manifest +// +//meta:operation POST /app-manifests/{code}/conversions func (s *AppsService) CompleteAppManifest(ctx context.Context, code string) (*AppConfig, *Response, error) { u := fmt.Sprintf("app-manifests/%s/conversions", code) req, err := s.client.NewRequest("POST", u, nil) diff --git a/github/apps_marketplace.go b/github/apps_marketplace.go index 32889abd240..976775a79a0 100644 --- a/github/apps_marketplace.go +++ b/github/apps_marketplace.go @@ -13,7 +13,7 @@ import ( // MarketplaceService handles communication with the marketplace related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/apps#marketplace +// GitHub API docs: https://docs.github.com/rest/apps#marketplace type MarketplaceService struct { client *Client // Stubbed controls whether endpoints that return stubbed data are used @@ -21,7 +21,7 @@ type MarketplaceService struct { // for testing your GitHub Apps. Stubbed data is hard-coded and will not // change based on actual subscriptions. // - // GitHub API docs: https://docs.github.com/en/rest/apps#testing-with-stubbed-endpoints + // GitHub API docs: https://docs.github.com/rest/apps#testing-with-stubbed-endpoints Stubbed bool } @@ -89,7 +89,11 @@ type MarketplacePurchaseAccount struct { // ListPlans lists all plans for your Marketplace listing. // -// GitHub API docs: https://docs.github.com/en/rest/apps#list-plans +// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-plans +// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-plans-stubbed +// +//meta:operation GET /marketplace_listing/plans +//meta:operation GET /marketplace_listing/stubbed/plans func (s *MarketplaceService) ListPlans(ctx context.Context, opts *ListOptions) ([]*MarketplacePlan, *Response, error) { uri := s.marketplaceURI("plans") u, err := addOptions(uri, opts) @@ -113,7 +117,11 @@ func (s *MarketplaceService) ListPlans(ctx context.Context, opts *ListOptions) ( // ListPlanAccountsForPlan lists all GitHub accounts (user or organization) on a specific plan. // -// GitHub API docs: https://docs.github.com/en/rest/apps#list-accounts-for-a-plan +// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-accounts-for-a-plan +// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-accounts-for-a-plan-stubbed +// +//meta:operation GET /marketplace_listing/plans/{plan_id}/accounts +//meta:operation GET /marketplace_listing/stubbed/plans/{plan_id}/accounts func (s *MarketplaceService) ListPlanAccountsForPlan(ctx context.Context, planID int64, opts *ListOptions) ([]*MarketplacePlanAccount, *Response, error) { uri := s.marketplaceURI(fmt.Sprintf("plans/%v/accounts", planID)) u, err := addOptions(uri, opts) @@ -137,7 +145,11 @@ func (s *MarketplaceService) ListPlanAccountsForPlan(ctx context.Context, planID // GetPlanAccountForAccount get GitHub account (user or organization) associated with an account. // -// GitHub API docs: https://docs.github.com/en/rest/apps#get-a-subscription-plan-for-an-account +// GitHub API docs: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account +// GitHub API docs: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account-stubbed +// +//meta:operation GET /marketplace_listing/accounts/{account_id} +//meta:operation GET /marketplace_listing/stubbed/accounts/{account_id} func (s *MarketplaceService) GetPlanAccountForAccount(ctx context.Context, accountID int64) (*MarketplacePlanAccount, *Response, error) { uri := s.marketplaceURI(fmt.Sprintf("accounts/%v", accountID)) @@ -157,8 +169,11 @@ func (s *MarketplaceService) GetPlanAccountForAccount(ctx context.Context, accou // ListMarketplacePurchasesForUser lists all GitHub marketplace purchases made by a user. // -// GitHub API docs: https://docs.github.com/en/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user-stubbed -// GitHub API docs: https://docs.github.com/en/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user-stubbed +// +//meta:operation GET /user/marketplace_purchases +//meta:operation GET /user/marketplace_purchases/stubbed func (s *MarketplaceService) ListMarketplacePurchasesForUser(ctx context.Context, opts *ListOptions) ([]*MarketplacePurchase, *Response, error) { uri := "user/marketplace_purchases" if s.Stubbed { diff --git a/github/authorizations.go b/github/authorizations.go index ea0897e3627..7adc5323678 100644 --- a/github/authorizations.go +++ b/github/authorizations.go @@ -12,7 +12,7 @@ import ( // Scope models a GitHub authorization scope. // -// GitHub API docs: https://docs.github.com/en/rest/oauth/#scopes +// GitHub API docs: https://docs.github.com/rest/oauth/#scopes type Scope string // This is the set of scopes for GitHub API V3 @@ -50,7 +50,7 @@ const ( // This service requires HTTP Basic Authentication; it cannot be accessed using // an OAuth token. // -// GitHub API docs: https://docs.github.com/en/rest/oauth-authorizations +// GitHub API docs: https://docs.github.com/rest/oauth-authorizations type AuthorizationsService service // Authorization represents an individual GitHub authorization. @@ -121,7 +121,7 @@ func (a AuthorizationRequest) String() string { // fields. That is, you may provide only one of "Scopes", or "AddScopes", or // "RemoveScopes". // -// GitHub API docs: https://docs.github.com/en/rest/oauth-authorizations#update-an-existing-authorization +// GitHub API docs: https://docs.github.com/rest/oauth-authorizations#update-an-existing-authorization type AuthorizationUpdateRequest struct { Scopes []string `json:"scopes,omitempty"` AddScopes []string `json:"add_scopes,omitempty"` @@ -143,7 +143,9 @@ func (a AuthorizationUpdateRequest) String() string { // // The returned Authorization.User field will be populated. // -// GitHub API docs: https://docs.github.com/en/rest/apps/oauth-applications#check-a-token +// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications#check-a-token +// +//meta:operation POST /applications/{client_id}/token func (s *AuthorizationsService) Check(ctx context.Context, clientID, accessToken string) (*Authorization, *Response, error) { u := fmt.Sprintf("applications/%v/token", clientID) @@ -176,7 +178,9 @@ func (s *AuthorizationsService) Check(ctx context.Context, clientID, accessToken // // The returned Authorization.User field will be populated. // -// GitHub API docs: https://docs.github.com/en/rest/apps/oauth-applications#reset-a-token +// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications#reset-a-token +// +//meta:operation PATCH /applications/{client_id}/token func (s *AuthorizationsService) Reset(ctx context.Context, clientID, accessToken string) (*Authorization, *Response, error) { u := fmt.Sprintf("applications/%v/token", clientID) @@ -205,7 +209,9 @@ func (s *AuthorizationsService) Reset(ctx context.Context, clientID, accessToken // username is the OAuth application clientID, and the password is its // clientSecret. Invalid tokens will return a 404 Not Found. // -// GitHub API docs: https://docs.github.com/en/rest/apps/oauth-applications#delete-an-app-token +// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications#delete-an-app-token +// +//meta:operation DELETE /applications/{client_id}/token func (s *AuthorizationsService) Revoke(ctx context.Context, clientID, accessToken string) (*Response, error) { u := fmt.Sprintf("applications/%v/token", clientID) @@ -226,7 +232,9 @@ func (s *AuthorizationsService) Revoke(ctx context.Context, clientID, accessToke // grant will also delete all OAuth tokens associated with the application for // the user. // -// GitHub API docs: https://docs.github.com/en/rest/apps/oauth-applications#delete-an-app-authorization +// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications#delete-an-app-authorization +// +//meta:operation DELETE /applications/{client_id}/grant func (s *AuthorizationsService) DeleteGrant(ctx context.Context, clientID, accessToken string) (*Response, error) { u := fmt.Sprintf("applications/%v/grant", clientID) @@ -249,7 +257,9 @@ func (s *AuthorizationsService) DeleteGrant(ctx context.Context, clientID, acces // you can e.g. create or delete a user's public SSH key. NOTE: creating a // new token automatically revokes an existing one. // -// GitHub API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#create-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#create-an-impersonation-oauth-token +// +//meta:operation POST /admin/users/{username}/authorizations func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, username string, authReq *AuthorizationRequest) (*Authorization, *Response, error) { u := fmt.Sprintf("admin/users/%v/authorizations", username) req, err := s.client.NewRequest("POST", u, authReq) @@ -269,7 +279,9 @@ func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, usernam // // NOTE: there can be only one at a time. // -// GitHub API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#delete-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#delete-an-impersonation-oauth-token +// +//meta:operation DELETE /admin/users/{username}/authorizations func (s *AuthorizationsService) DeleteImpersonation(ctx context.Context, username string) (*Response, error) { u := fmt.Sprintf("admin/users/%v/authorizations", username) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/billing.go b/github/billing.go index 7a76bf86fda..6d7579b884d 100644 --- a/github/billing.go +++ b/github/billing.go @@ -13,7 +13,7 @@ import ( // BillingService provides access to the billing related functions // in the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/billing +// GitHub API docs: https://docs.github.com/rest/billing type BillingService service // ActionBilling represents a GitHub Action billing. @@ -62,7 +62,9 @@ type AdvancedSecurityCommittersBreakdown struct { // 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/billing#get-github-actions-billing-for-an-organization +// GitHub API docs: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-an-organization +// +//meta:operation GET /orgs/{org}/settings/billing/actions func (s *BillingService) GetActionsBillingOrg(ctx context.Context, org string) (*ActionBilling, *Response, error) { u := fmt.Sprintf("orgs/%v/settings/billing/actions", org) req, err := s.client.NewRequest("GET", u, nil) @@ -81,7 +83,9 @@ func (s *BillingService) GetActionsBillingOrg(ctx context.Context, org string) ( // GetPackagesBillingOrg returns the free and paid storage used for GitHub Packages in gigabytes for an Org. // -// GitHub API docs: https://docs.github.com/en/rest/billing#get-github-packages-billing-for-an-organization +// GitHub API docs: https://docs.github.com/rest/billing/billing#get-github-packages-billing-for-an-organization +// +//meta:operation GET /orgs/{org}/settings/billing/packages func (s *BillingService) GetPackagesBillingOrg(ctx context.Context, org string) (*PackageBilling, *Response, error) { u := fmt.Sprintf("orgs/%v/settings/billing/packages", org) req, err := s.client.NewRequest("GET", u, nil) @@ -101,7 +105,9 @@ func (s *BillingService) GetPackagesBillingOrg(ctx context.Context, org string) // GetStorageBillingOrg returns the estimated paid and estimated total storage used for GitHub Actions // and GitHub Packages in gigabytes for an Org. // -// GitHub API docs: https://docs.github.com/en/rest/billing#get-shared-storage-billing-for-an-organization +// GitHub API docs: https://docs.github.com/rest/billing/billing#get-shared-storage-billing-for-an-organization +// +//meta:operation GET /orgs/{org}/settings/billing/shared-storage func (s *BillingService) GetStorageBillingOrg(ctx context.Context, org string) (*StorageBilling, *Response, error) { u := fmt.Sprintf("orgs/%v/settings/billing/shared-storage", org) req, err := s.client.NewRequest("GET", u, nil) @@ -120,7 +126,9 @@ func (s *BillingService) GetStorageBillingOrg(ctx context.Context, org string) ( // GetAdvancedSecurityActiveCommittersOrg returns the GitHub Advanced Security active committers for an organization per repository. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/billing?apiVersion=2022-11-28#get-github-advanced-security-active-committers-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/billing#get-github-advanced-security-active-committers-for-an-organization +// +//meta:operation GET /orgs/{org}/settings/billing/advanced-security func (s *BillingService) GetAdvancedSecurityActiveCommittersOrg(ctx context.Context, org string, opts *ListOptions) (*ActiveCommitters, *Response, error) { u := fmt.Sprintf("orgs/%v/settings/billing/advanced-security", org) u, err := addOptions(u, opts) @@ -144,7 +152,9 @@ func (s *BillingService) GetAdvancedSecurityActiveCommittersOrg(ctx context.Cont // 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/billing#get-github-actions-billing-for-a-user +// GitHub API docs: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-a-user +// +//meta:operation GET /users/{username}/settings/billing/actions func (s *BillingService) GetActionsBillingUser(ctx context.Context, user string) (*ActionBilling, *Response, error) { u := fmt.Sprintf("users/%v/settings/billing/actions", user) req, err := s.client.NewRequest("GET", u, nil) @@ -163,7 +173,9 @@ func (s *BillingService) GetActionsBillingUser(ctx context.Context, user string) // GetPackagesBillingUser returns the free and paid storage used for GitHub Packages in gigabytes for a user. // -// GitHub API docs: https://docs.github.com/en/rest/billing#get-github-packages-billing-for-a-user +// GitHub API docs: https://docs.github.com/rest/billing/billing#get-github-packages-billing-for-a-user +// +//meta:operation GET /users/{username}/settings/billing/packages func (s *BillingService) GetPackagesBillingUser(ctx context.Context, user string) (*PackageBilling, *Response, error) { u := fmt.Sprintf("users/%v/settings/billing/packages", user) req, err := s.client.NewRequest("GET", u, nil) @@ -183,7 +195,9 @@ func (s *BillingService) GetPackagesBillingUser(ctx context.Context, user string // GetStorageBillingUser returns the estimated paid and estimated total storage used for GitHub Actions // and GitHub Packages in gigabytes for a user. // -// GitHub API docs: https://docs.github.com/en/rest/billing#get-shared-storage-billing-for-a-user +// GitHub API docs: https://docs.github.com/rest/billing/billing#get-shared-storage-billing-for-a-user +// +//meta:operation GET /users/{username}/settings/billing/shared-storage func (s *BillingService) GetStorageBillingUser(ctx context.Context, user string) (*StorageBilling, *Response, error) { u := fmt.Sprintf("users/%v/settings/billing/shared-storage", user) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/checks.go b/github/checks.go index 12d08530ca0..a8618944532 100644 --- a/github/checks.go +++ b/github/checks.go @@ -13,7 +13,7 @@ import ( // ChecksService provides access to the Checks API in the // GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/checks/ +// GitHub API docs: https://docs.github.com/rest/checks/ type ChecksService service // CheckRun represents a GitHub check run on a repository associated with a GitHub app. @@ -98,7 +98,9 @@ func (c CheckSuite) String() string { // GetCheckRun gets a check-run for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/checks/runs#get-a-check-run +// GitHub API docs: https://docs.github.com/rest/checks/runs#get-a-check-run +// +//meta:operation GET /repos/{owner}/{repo}/check-runs/{check_run_id} func (s *ChecksService) GetCheckRun(ctx context.Context, owner, repo string, checkRunID int64) (*CheckRun, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-runs/%v", owner, repo, checkRunID) req, err := s.client.NewRequest("GET", u, nil) @@ -119,7 +121,9 @@ func (s *ChecksService) GetCheckRun(ctx context.Context, owner, repo string, che // GetCheckSuite gets a single check suite. // -// GitHub API docs: https://docs.github.com/en/rest/checks/suites#get-a-check-suite +// GitHub API docs: https://docs.github.com/rest/checks/suites#get-a-check-suite +// +//meta:operation GET /repos/{owner}/{repo}/check-suites/{check_suite_id} func (s *ChecksService) GetCheckSuite(ctx context.Context, owner, repo string, checkSuiteID int64) (*CheckSuite, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-suites/%v", owner, repo, checkSuiteID) req, err := s.client.NewRequest("GET", u, nil) @@ -161,7 +165,9 @@ type CheckRunAction struct { // CreateCheckRun creates a check run for repository. // -// GitHub API docs: https://docs.github.com/en/rest/checks/runs#create-a-check-run +// GitHub API docs: https://docs.github.com/rest/checks/runs#create-a-check-run +// +//meta:operation POST /repos/{owner}/{repo}/check-runs func (s *ChecksService) CreateCheckRun(ctx context.Context, owner, repo string, opts CreateCheckRunOptions) (*CheckRun, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-runs", owner, repo) req, err := s.client.NewRequest("POST", u, opts) @@ -194,7 +200,9 @@ type UpdateCheckRunOptions struct { // UpdateCheckRun updates a check run for a specific commit in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/checks/runs#update-a-check-run +// GitHub API docs: https://docs.github.com/rest/checks/runs#update-a-check-run +// +//meta:operation PATCH /repos/{owner}/{repo}/check-runs/{check_run_id} func (s *ChecksService) UpdateCheckRun(ctx context.Context, owner, repo string, checkRunID int64, opts UpdateCheckRunOptions) (*CheckRun, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-runs/%v", owner, repo, checkRunID) req, err := s.client.NewRequest("PATCH", u, opts) @@ -215,7 +223,9 @@ func (s *ChecksService) UpdateCheckRun(ctx context.Context, owner, repo string, // ListCheckRunAnnotations lists the annotations for a check run. // -// GitHub API docs: https://docs.github.com/en/rest/checks/runs#list-check-run-annotations +// GitHub API docs: https://docs.github.com/rest/checks/runs#list-check-run-annotations +// +//meta:operation GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations func (s *ChecksService) ListCheckRunAnnotations(ctx context.Context, owner, repo string, checkRunID int64, opts *ListOptions) ([]*CheckRunAnnotation, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-runs/%v/annotations", owner, repo, checkRunID) u, err := addOptions(u, opts) @@ -257,7 +267,9 @@ type ListCheckRunsResults struct { // ListCheckRunsForRef lists check runs for a specific ref. // -// GitHub API docs: https://docs.github.com/en/rest/checks/runs#list-check-runs-for-a-git-reference +// GitHub API docs: https://docs.github.com/rest/checks/runs#list-check-runs-for-a-git-reference +// +//meta:operation GET /repos/{owner}/{repo}/commits/{ref}/check-runs func (s *ChecksService) ListCheckRunsForRef(ctx context.Context, owner, repo, ref string, opts *ListCheckRunsOptions) (*ListCheckRunsResults, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/check-runs", owner, repo, refURLEscape(ref)) u, err := addOptions(u, opts) @@ -283,7 +295,9 @@ func (s *ChecksService) ListCheckRunsForRef(ctx context.Context, owner, repo, re // ListCheckRunsCheckSuite lists check runs for a check suite. // -// GitHub API docs: https://docs.github.com/en/rest/checks/runs#list-check-runs-in-a-check-suite +// GitHub API docs: https://docs.github.com/rest/checks/runs#list-check-runs-in-a-check-suite +// +//meta:operation GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs func (s *ChecksService) ListCheckRunsCheckSuite(ctx context.Context, owner, repo string, checkSuiteID int64, opts *ListCheckRunsOptions) (*ListCheckRunsResults, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-suites/%v/check-runs", owner, repo, checkSuiteID) u, err := addOptions(u, opts) @@ -309,7 +323,9 @@ func (s *ChecksService) ListCheckRunsCheckSuite(ctx context.Context, owner, repo // ReRequestCheckRun triggers GitHub to rerequest an existing check run. // -// GitHub API docs: https://docs.github.com/en/rest/checks/runs#rerequest-a-check-run +// GitHub API docs: https://docs.github.com/rest/checks/runs#rerequest-a-check-run +// +//meta:operation POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest func (s *ChecksService) ReRequestCheckRun(ctx context.Context, owner, repo string, checkRunID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/check-runs/%v/rerequest", owner, repo, checkRunID) @@ -339,7 +355,9 @@ type ListCheckSuiteResults struct { // ListCheckSuitesForRef lists check suite for a specific ref. // -// GitHub API docs: https://docs.github.com/en/rest/checks/suites#list-check-suites-for-a-git-reference +// GitHub API docs: https://docs.github.com/rest/checks/suites#list-check-suites-for-a-git-reference +// +//meta:operation GET /repos/{owner}/{repo}/commits/{ref}/check-suites func (s *ChecksService) ListCheckSuitesForRef(ctx context.Context, owner, repo, ref string, opts *ListCheckSuiteOptions) (*ListCheckSuiteResults, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/check-suites", owner, repo, refURLEscape(ref)) u, err := addOptions(u, opts) @@ -387,7 +405,9 @@ type PreferenceList struct { // SetCheckSuitePreferences changes the default automatic flow when creating check suites. // -// GitHub API docs: https://docs.github.com/en/rest/checks/suites#update-repository-preferences-for-check-suites +// GitHub API docs: https://docs.github.com/rest/checks/suites#update-repository-preferences-for-check-suites +// +//meta:operation PATCH /repos/{owner}/{repo}/check-suites/preferences func (s *ChecksService) SetCheckSuitePreferences(ctx context.Context, owner, repo string, opts CheckSuitePreferenceOptions) (*CheckSuitePreferenceResults, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-suites/preferences", owner, repo) req, err := s.client.NewRequest("PATCH", u, opts) @@ -414,7 +434,9 @@ type CreateCheckSuiteOptions struct { // CreateCheckSuite manually creates a check suite for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/checks/suites#create-a-check-suite +// GitHub API docs: https://docs.github.com/rest/checks/suites#create-a-check-suite +// +//meta:operation POST /repos/{owner}/{repo}/check-suites func (s *ChecksService) CreateCheckSuite(ctx context.Context, owner, repo string, opts CreateCheckSuiteOptions) (*CheckSuite, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-suites", owner, repo) req, err := s.client.NewRequest("POST", u, opts) @@ -435,7 +457,9 @@ func (s *ChecksService) CreateCheckSuite(ctx context.Context, owner, repo string // ReRequestCheckSuite triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. // -// GitHub API docs: https://docs.github.com/en/rest/checks/suites#rerequest-a-check-suite +// GitHub API docs: https://docs.github.com/rest/checks/suites#rerequest-a-check-suite +// +//meta:operation POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest func (s *ChecksService) ReRequestCheckSuite(ctx context.Context, owner, repo string, checkSuiteID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/check-suites/%v/rerequest", owner, repo, checkSuiteID) diff --git a/github/code-scanning.go b/github/code-scanning.go index 0ae269be676..74a7b6c9b47 100644 --- a/github/code-scanning.go +++ b/github/code-scanning.go @@ -15,7 +15,7 @@ import ( // CodeScanningService handles communication with the code scanning related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning +// GitHub API docs: https://docs.github.com/rest/code-scanning type CodeScanningService service // Rule represents the complete details of GitHub Code Scanning alert type. @@ -67,7 +67,7 @@ type Tool struct { // Alert represents an individual GitHub Code Scanning Alert on a single repository. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning +// GitHub API docs: https://docs.github.com/rest/code-scanning type Alert struct { Number *int `json:"number,omitempty"` Repository *Repository `json:"repository,omitempty"` @@ -160,7 +160,7 @@ type AnalysesListOptions struct { // CodeQLDatabase represents a metadata about the CodeQL database. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning +// GitHub API docs: https://docs.github.com/rest/code-scanning type CodeQLDatabase struct { ID *int64 `json:"id,omitempty"` Name *string `json:"name,omitempty"` @@ -175,7 +175,7 @@ type CodeQLDatabase struct { // ScanningAnalysis represents an individual GitHub Code Scanning ScanningAnalysis on a single repository. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning +// GitHub API docs: https://docs.github.com/rest/code-scanning type ScanningAnalysis struct { ID *int64 `json:"id,omitempty"` Ref *string `json:"ref,omitempty"` @@ -196,7 +196,7 @@ type ScanningAnalysis struct { // SarifAnalysis specifies the results of a code scanning job. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning +// GitHub API docs: https://docs.github.com/rest/code-scanning type SarifAnalysis struct { CommitSHA *string `json:"commit_sha,omitempty"` Ref *string `json:"ref,omitempty"` @@ -208,7 +208,7 @@ type SarifAnalysis struct { // CodeScanningAlertState specifies the state of a code scanning alert. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning +// GitHub API docs: https://docs.github.com/rest/code-scanning type CodeScanningAlertState struct { // State sets the state of the code scanning alert and is a required field. // You must also provide DismissedReason when you set the state to "dismissed". @@ -224,7 +224,7 @@ type CodeScanningAlertState struct { // SarifID identifies a sarif analysis upload. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning +// GitHub API docs: https://docs.github.com/rest/code-scanning type SarifID struct { ID *string `json:"id,omitempty"` URL *string `json:"url,omitempty"` @@ -235,7 +235,9 @@ type SarifID struct { // You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events // read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-organization +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-organization +// +//meta:operation GET /orgs/{org}/code-scanning/alerts func (s *CodeScanningService) ListAlertsForOrg(ctx context.Context, org string, opts *AlertListOptions) ([]*Alert, *Response, error) { u := fmt.Sprintf("orgs/%v/code-scanning/alerts", org) u, err := addOptions(u, opts) @@ -263,7 +265,9 @@ func (s *CodeScanningService) ListAlertsForOrg(ctx context.Context, org string, // You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events // read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-a-repository +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/code-scanning/alerts func (s *CodeScanningService) ListAlertsForRepo(ctx context.Context, owner, repo string, opts *AlertListOptions) ([]*Alert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/alerts", owner, repo) u, err := addOptions(u, opts) @@ -292,7 +296,9 @@ func (s *CodeScanningService) ListAlertsForRepo(ctx context.Context, owner, repo // // The security alert_id is the number at the end of the security alert's URL. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#get-a-code-scanning-alert +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-alert +// +//meta:operation GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number} func (s *CodeScanningService) GetAlert(ctx context.Context, owner, repo string, id int64) (*Alert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/alerts/%v", owner, repo, id) @@ -317,7 +323,9 @@ func (s *CodeScanningService) GetAlert(ctx context.Context, owner, repo string, // // The security alert_id is the number at the end of the security alert's URL. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning?apiVersion=2022-11-28#update-a-code-scanning-alert +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-alert +// +//meta:operation PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number} func (s *CodeScanningService) UpdateAlert(ctx context.Context, owner, repo string, id int64, stateInfo *CodeScanningAlertState) (*Alert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/alerts/%v", owner, repo, id) @@ -340,7 +348,9 @@ func (s *CodeScanningService) UpdateAlert(ctx context.Context, owner, repo strin // You must use an access token with the security_events scope to use this endpoint. // GitHub Apps must have the security_events read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#list-instances-of-a-code-scanning-alert +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#list-instances-of-a-code-scanning-alert +// +//meta:operation GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances func (s *CodeScanningService) ListAlertInstances(ctx context.Context, owner, repo string, id int64, opts *AlertInstancesListOptions) ([]*MostRecentInstance, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/alerts/%v/instances", owner, repo, id) u, err := addOptions(u, opts) @@ -368,7 +378,9 @@ func (s *CodeScanningService) ListAlertInstances(ctx context.Context, owner, rep // You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events // write permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#upload-an-analysis-as-sarif-data +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#upload-an-analysis-as-sarif-data +// +//meta:operation POST /repos/{owner}/{repo}/code-scanning/sarifs func (s *CodeScanningService) UploadSarif(ctx context.Context, owner, repo string, sarif *SarifAnalysis) (*SarifID, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/sarifs", owner, repo) @@ -400,7 +412,9 @@ type SARIFUpload struct { // You must use an access token with the security_events scope to use this endpoint. // GitHub Apps must have the security_events read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#get-information-about-a-sarif-upload +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#get-information-about-a-sarif-upload +// +//meta:operation GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id} func (s *CodeScanningService) GetSARIF(ctx context.Context, owner, repo, sarifID string) (*SARIFUpload, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/sarifs/%v", owner, repo, sarifID) @@ -424,7 +438,9 @@ func (s *CodeScanningService) GetSARIF(ctx context.Context, owner, repo, sarifID // You must use an access token with the security_events scope to use this endpoint. // GitHub Apps must have the security_events read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#list-code-scanning-analyses-for-a-repository +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-analyses-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/code-scanning/analyses func (s *CodeScanningService) ListAnalysesForRepo(ctx context.Context, owner, repo string, opts *AnalysesListOptions) ([]*ScanningAnalysis, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/analyses", owner, repo) u, err := addOptions(u, opts) @@ -453,7 +469,9 @@ func (s *CodeScanningService) ListAnalysesForRepo(ctx context.Context, owner, re // // The security analysis_id is the ID of the analysis, as returned from the ListAnalysesForRepo operation. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id} func (s *CodeScanningService) GetAnalysis(ctx context.Context, owner, repo string, id int64) (*ScanningAnalysis, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/analyses/%v", owner, repo, id) @@ -486,7 +504,9 @@ type DeleteAnalysis struct { // // The security analysis_id is the ID of the analysis, as returned from the ListAnalysesForRepo operation. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#delete-a-code-scanning-analysis-from-a-repository +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#delete-a-code-scanning-analysis-from-a-repository +// +//meta:operation DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id} func (s *CodeScanningService) DeleteAnalysis(ctx context.Context, owner, repo string, id int64) (*DeleteAnalysis, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/analyses/%v", owner, repo, id) @@ -509,7 +529,9 @@ func (s *CodeScanningService) DeleteAnalysis(ctx context.Context, owner, repo st // You must use an access token with the security_events scope to use this endpoint. // GitHub Apps must have the contents read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#list-codeql-databases-for-a-repository +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#list-codeql-databases-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/code-scanning/codeql/databases func (s *CodeScanningService) ListCodeQLDatabases(ctx context.Context, owner, repo string) ([]*CodeQLDatabase, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/codeql/databases", owner, repo) @@ -532,7 +554,9 @@ func (s *CodeScanningService) ListCodeQLDatabases(ctx context.Context, owner, re // You must use an access token with the security_events scope to use this endpoint. // GitHub Apps must have the contents read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#get-a-codeql-database-for-a-repository +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#get-a-codeql-database-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language} func (s *CodeScanningService) GetCodeQLDatabase(ctx context.Context, owner, repo, language string) (*CodeQLDatabase, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/codeql/databases/%v", owner, repo, language) @@ -564,7 +588,9 @@ type DefaultSetupConfiguration struct { // endpoint with private repos or the public_repo scope for public repos. GitHub Apps must have the repo write // permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#get-a-code-scanning-default-setup-configuration +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-default-setup-configuration +// +//meta:operation GET /repos/{owner}/{repo}/code-scanning/default-setup func (s *CodeScanningService) GetDefaultSetupConfiguration(ctx context.Context, owner, repo string) (*DefaultSetupConfiguration, *Response, error) { u := fmt.Sprintf("repos/%s/%s/code-scanning/default-setup", owner, repo) @@ -605,7 +631,9 @@ type UpdateDefaultSetupConfigurationResponse struct { // This method might return an AcceptedError and a status code of 202. This is because this is the status that GitHub // returns to signify that it has now scheduled the update of the pull request branch in a background task. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#update-a-code-scanning-default-setup-configuration +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-default-setup-configuration +// +//meta:operation PATCH /repos/{owner}/{repo}/code-scanning/default-setup func (s *CodeScanningService) UpdateDefaultSetupConfiguration(ctx context.Context, owner, repo string, options *UpdateDefaultSetupConfigurationOptions) (*UpdateDefaultSetupConfigurationResponse, *Response, error) { u := fmt.Sprintf("repos/%s/%s/code-scanning/default-setup", owner, repo) diff --git a/github/codesofconduct.go b/github/codesofconduct.go index 11e1fb38df0..7d7f9ef8188 100644 --- a/github/codesofconduct.go +++ b/github/codesofconduct.go @@ -28,6 +28,8 @@ func (c *CodeOfConduct) String() string { // List returns all codes of conduct. // // GitHub API docs: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-all-codes-of-conduct +// +//meta:operation GET /codes_of_conduct func (s *CodesOfConductService) List(ctx context.Context) ([]*CodeOfConduct, *Response, error) { req, err := s.client.NewRequest("GET", "codes_of_conduct", nil) if err != nil { @@ -56,6 +58,8 @@ func (c *Client) ListCodesOfConduct(ctx context.Context) ([]*CodeOfConduct, *Res // Get returns an individual code of conduct. // // GitHub API docs: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-a-code-of-conduct +// +//meta:operation GET /codes_of_conduct/{key} func (s *CodesOfConductService) Get(ctx context.Context, key string) (*CodeOfConduct, *Response, error) { u := fmt.Sprintf("codes_of_conduct/%s", key) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/codespaces.go b/github/codespaces.go index f2e6a284cf0..608370503f6 100644 --- a/github/codespaces.go +++ b/github/codespaces.go @@ -13,12 +13,12 @@ import ( // CodespacesService handles communication with the Codespaces related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/ +// GitHub API docs: https://docs.github.com/rest/codespaces/ type CodespacesService service // Codespace represents a codespace. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces +// GitHub API docs: https://docs.github.com/rest/codespaces type Codespace struct { ID *int64 `json:"id,omitempty"` Name *string `json:"name,omitempty"` @@ -90,7 +90,9 @@ type ListCodespaces struct { // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have read access to the codespaces repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/codespaces?apiVersion=2022-11-28#list-codespaces-in-a-repository-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#list-codespaces-in-a-repository-for-the-authenticated-user +// +//meta:operation GET /repos/{owner}/{repo}/codespaces func (s *CodespacesService) ListInRepo(ctx context.Context, owner, repo string, opts *ListOptions) (*ListCodespaces, *Response, error) { u := fmt.Sprintf("repos/%v/%v/codespaces", owner, repo) u, err := addOptions(u, opts) @@ -124,7 +126,9 @@ type ListCodespacesOptions struct { // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have read access to the codespaces repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/codespaces?apiVersion=2022-11-28#list-codespaces-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#list-codespaces-for-the-authenticated-user +// +//meta:operation GET /user/codespaces func (s *CodespacesService) List(ctx context.Context, opts *ListCodespacesOptions) (*ListCodespaces, *Response, error) { u := "user/codespaces" u, err := addOptions(u, opts) @@ -172,7 +176,9 @@ type CreateCodespaceOptions struct { // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have write access to the codespaces repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/codespaces?apiVersion=2022-11-28#create-a-codespace-in-a-repository +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-in-a-repository +// +//meta:operation POST /repos/{owner}/{repo}/codespaces func (s *CodespacesService) CreateInRepo(ctx context.Context, owner, repo string, request *CreateCodespaceOptions) (*Codespace, *Response, error) { u := fmt.Sprintf("repos/%v/%v/codespaces", owner, repo) @@ -195,7 +201,9 @@ func (s *CodespacesService) CreateInRepo(ctx context.Context, owner, repo string // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have write access to the codespaces_lifecycle_admin repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/codespaces?apiVersion=2022-11-28#start-a-codespace-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#start-a-codespace-for-the-authenticated-user +// +//meta:operation POST /user/codespaces/{codespace_name}/start func (s *CodespacesService) Start(ctx context.Context, codespaceName string) (*Codespace, *Response, error) { u := fmt.Sprintf("user/codespaces/%v/start", codespaceName) @@ -218,7 +226,9 @@ func (s *CodespacesService) Start(ctx context.Context, codespaceName string) (*C // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have write access to the codespaces_lifecycle_admin repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/codespaces?apiVersion=2022-11-28#stop-a-codespace-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#stop-a-codespace-for-the-authenticated-user +// +//meta:operation POST /user/codespaces/{codespace_name}/stop func (s *CodespacesService) Stop(ctx context.Context, codespaceName string) (*Codespace, *Response, error) { u := fmt.Sprintf("user/codespaces/%v/stop", codespaceName) @@ -241,7 +251,9 @@ func (s *CodespacesService) Stop(ctx context.Context, codespaceName string) (*Co // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have write access to the codespaces repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/codespaces?apiVersion=2022-11-28#delete-a-codespace-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#delete-a-codespace-for-the-authenticated-user +// +//meta:operation DELETE /user/codespaces/{codespace_name} func (s *CodespacesService) Delete(ctx context.Context, codespaceName string) (*Response, error) { u := fmt.Sprintf("user/codespaces/%v", codespaceName) diff --git a/github/codespaces_secrets.go b/github/codespaces_secrets.go index e11c679c668..438c27f8ffe 100644 --- a/github/codespaces_secrets.go +++ b/github/codespaces_secrets.go @@ -16,7 +16,9 @@ import ( // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint // GitHub Apps must have read access to the codespaces_user_secrets user permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#list-secrets-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#list-secrets-for-the-authenticated-user +// +//meta:operation GET /user/codespaces/secrets func (s *CodespacesService) ListUserSecrets(ctx context.Context, opts *ListOptions) (*Secrets, *Response, error) { u, err := addOptions("user/codespaces/secrets", opts) if err != nil { @@ -29,7 +31,9 @@ func (s *CodespacesService) ListUserSecrets(ctx context.Context, opts *ListOptio // // Lists all Codespaces secrets available at the organization-level without revealing their encrypted values. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#list-organization-secrets +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#list-organization-secrets +// +//meta:operation GET /orgs/{org}/codespaces/secrets func (s *CodespacesService) ListOrgSecrets(ctx context.Context, org string, opts *ListOptions) (*Secrets, *Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/secrets", org) u, err := addOptions(u, opts) @@ -43,7 +47,9 @@ func (s *CodespacesService) ListOrgSecrets(ctx context.Context, org string, opts // // Lists all secrets available in a repository without revealing their encrypted values. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/repository-secrets?apiVersion=2022-11-28#list-repository-secrets +// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets#list-repository-secrets +// +//meta:operation GET /repos/{owner}/{repo}/codespaces/secrets func (s *CodespacesService) ListRepoSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error) { u := fmt.Sprintf("repos/%v/%v/codespaces/secrets", owner, repo) u, err := addOptions(u, opts) @@ -74,7 +80,9 @@ func (s *CodespacesService) listSecrets(ctx context.Context, url string) (*Secre // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. // GitHub Apps must have read access to the codespaces_user_secrets user permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#get-public-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#get-public-key-for-the-authenticated-user +// +//meta:operation GET /user/codespaces/secrets/public-key func (s *CodespacesService) GetUserPublicKey(ctx context.Context) (*PublicKey, *Response, error) { return s.getPublicKey(ctx, "user/codespaces/secrets/public-key") } @@ -83,7 +91,9 @@ func (s *CodespacesService) GetUserPublicKey(ctx context.Context) (*PublicKey, * // // Gets a public key for an organization, which is required in order to encrypt secrets. You need to encrypt the value of a secret before you can create or update secrets. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#get-an-organization-public-key +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#get-an-organization-public-key +// +//meta:operation GET /orgs/{org}/codespaces/secrets/public-key func (s *CodespacesService) GetOrgPublicKey(ctx context.Context, org string) (*PublicKey, *Response, error) { return s.getPublicKey(ctx, fmt.Sprintf("orgs/%v/codespaces/secrets/public-key", org)) } @@ -92,7 +102,9 @@ func (s *CodespacesService) GetOrgPublicKey(ctx context.Context, org string) (*P // // Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/repository-secrets?apiVersion=2022-11-28#get-a-repository-public-key +// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets#get-a-repository-public-key +// +//meta:operation GET /repos/{owner}/{repo}/codespaces/secrets/public-key func (s *CodespacesService) GetRepoPublicKey(ctx context.Context, owner, repo string) (*PublicKey, *Response, error) { return s.getPublicKey(ctx, fmt.Sprintf("repos/%v/%v/codespaces/secrets/public-key", owner, repo)) } @@ -118,7 +130,9 @@ func (s *CodespacesService) getPublicKey(ctx context.Context, url string) (*Publ // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. // GitHub Apps must have read access to the codespaces_user_secrets user permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#get-a-secret-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#get-a-secret-for-the-authenticated-user +// +//meta:operation GET /user/codespaces/secrets/{secret_name} func (s *CodespacesService) GetUserSecret(ctx context.Context, name string) (*Secret, *Response, error) { u := fmt.Sprintf("user/codespaces/secrets/%v", name) return s.getSecret(ctx, u) @@ -128,7 +142,9 @@ func (s *CodespacesService) GetUserSecret(ctx context.Context, name string) (*Se // // Gets an organization secret without revealing its encrypted value. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#get-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#get-an-organization-secret +// +//meta:operation GET /orgs/{org}/codespaces/secrets/{secret_name} func (s *CodespacesService) GetOrgSecret(ctx context.Context, org, name string) (*Secret, *Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v", org, name) return s.getSecret(ctx, u) @@ -138,7 +154,9 @@ func (s *CodespacesService) GetOrgSecret(ctx context.Context, org, name string) // // Gets a single repository secret without revealing its encrypted value. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/repository-secrets?apiVersion=2022-11-28#get-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets#get-a-repository-secret +// +//meta:operation GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name} func (s *CodespacesService) GetRepoSecret(ctx context.Context, owner, repo, name string) (*Secret, *Response, error) { u := fmt.Sprintf("repos/%v/%v/codespaces/secrets/%v", owner, repo, name) return s.getSecret(ctx, u) @@ -165,7 +183,9 @@ func (s *CodespacesService) getSecret(ctx context.Context, url string) (*Secret, // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must also have Codespaces access to use this endpoint. // GitHub Apps must have write access to the codespaces_user_secrets user permission and codespaces_secrets repository permission on all referenced repositories to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#create-or-update-a-secret-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#create-or-update-a-secret-for-the-authenticated-user +// +//meta:operation PUT /user/codespaces/secrets/{secret_name} func (s *CodespacesService) CreateOrUpdateUserSecret(ctx context.Context, eSecret *EncryptedSecret) (*Response, error) { u := fmt.Sprintf("user/codespaces/secrets/%v", eSecret.Name) return s.createOrUpdateSecret(ctx, u, eSecret) @@ -175,7 +195,9 @@ func (s *CodespacesService) CreateOrUpdateUserSecret(ctx context.Context, eSecre // // Creates or updates an organization secret with an encrypted value. Encrypt your secret using LibSodium. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#create-or-update-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#create-or-update-an-organization-secret +// +//meta:operation PUT /orgs/{org}/codespaces/secrets/{secret_name} func (s *CodespacesService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *EncryptedSecret) (*Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v", org, eSecret.Name) return s.createOrUpdateSecret(ctx, u, eSecret) @@ -185,7 +207,9 @@ func (s *CodespacesService) CreateOrUpdateOrgSecret(ctx context.Context, org str // // Creates or updates a repository secret with an encrypted value. Encrypt your secret using LibSodium. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/repository-secrets?apiVersion=2022-11-28#create-or-update-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets#create-or-update-a-repository-secret +// +//meta:operation PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name} func (s *CodespacesService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *EncryptedSecret) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/codespaces/secrets/%v", owner, repo, eSecret.Name) return s.createOrUpdateSecret(ctx, u, eSecret) @@ -211,7 +235,9 @@ func (s *CodespacesService) createOrUpdateSecret(ctx context.Context, url string // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. // GitHub Apps must have write access to the codespaces_user_secrets user permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#delete-a-secret-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#delete-a-secret-for-the-authenticated-user +// +//meta:operation DELETE /user/codespaces/secrets/{secret_name} func (s *CodespacesService) DeleteUserSecret(ctx context.Context, name string) (*Response, error) { u := fmt.Sprintf("user/codespaces/secrets/%v", name) return s.deleteSecret(ctx, u) @@ -221,7 +247,9 @@ func (s *CodespacesService) DeleteUserSecret(ctx context.Context, name string) ( // // Deletes an organization secret using the secret name. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#delete-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#delete-an-organization-secret +// +//meta:operation DELETE /orgs/{org}/codespaces/secrets/{secret_name} func (s *CodespacesService) DeleteOrgSecret(ctx context.Context, org, name string) (*Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v", org, name) return s.deleteSecret(ctx, u) @@ -231,7 +259,9 @@ func (s *CodespacesService) DeleteOrgSecret(ctx context.Context, org, name strin // // Deletes a secret in a repository using the secret name. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/repository-secrets?apiVersion=2022-11-28#delete-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets#delete-a-repository-secret +// +//meta:operation DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name} func (s *CodespacesService) DeleteRepoSecret(ctx context.Context, owner, repo, name string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/codespaces/secrets/%v", owner, repo, name) return s.deleteSecret(ctx, u) @@ -256,7 +286,9 @@ func (s *CodespacesService) deleteSecret(ctx context.Context, url string) (*Resp // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. // GitHub Apps must have read access to the codespaces_user_secrets user permission and write access to the codespaces_secrets repository permission on all referenced repositories to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#list-selected-repositories-for-a-user-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#list-selected-repositories-for-a-user-secret +// +//meta:operation GET /user/codespaces/secrets/{secret_name}/repositories func (s *CodespacesService) ListSelectedReposForUserSecret(ctx context.Context, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { u := fmt.Sprintf("user/codespaces/secrets/%v/repositories", name) u, err := addOptions(u, opts) @@ -271,7 +303,9 @@ func (s *CodespacesService) ListSelectedReposForUserSecret(ctx context.Context, // // Lists all repositories that have been selected when the visibility for repository access to a secret is set to selected. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#list-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#list-selected-repositories-for-an-organization-secret +// +//meta:operation GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories func (s *CodespacesService) ListSelectedReposForOrgSecret(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v/repositories", org, name) u, err := addOptions(u, opts) @@ -302,7 +336,9 @@ func (s *CodespacesService) listSelectedReposForSecret(ctx context.Context, url // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. // GitHub Apps must have write access to the codespaces_user_secrets user permission and write access to the codespaces_secrets repository permission on all referenced repositories to use this endpoint. // -// Github API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#set-selected-repositories-for-a-user-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#set-selected-repositories-for-a-user-secret +// +//meta:operation PUT /user/codespaces/secrets/{secret_name}/repositories func (s *CodespacesService) SetSelectedReposForUserSecret(ctx context.Context, name string, ids SelectedRepoIDs) (*Response, error) { u := fmt.Sprintf("user/codespaces/secrets/%v/repositories", name) return s.setSelectedRepoForSecret(ctx, u, ids) @@ -312,7 +348,9 @@ func (s *CodespacesService) SetSelectedReposForUserSecret(ctx context.Context, n // // Replaces all repositories for an organization secret when the visibility for repository access is set to selected. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// Github API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#set-selected-repositories-for-a-user-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#set-selected-repositories-for-an-organization-secret +// +//meta:operation PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories func (s *CodespacesService) SetSelectedReposForOrgSecret(ctx context.Context, org, name string, ids SelectedRepoIDs) (*Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v/repositories", org, name) return s.setSelectedRepoForSecret(ctx, u, ids) @@ -340,7 +378,9 @@ func (s *CodespacesService) setSelectedRepoForSecret(ctx context.Context, url st // // Adds a repository to the selected repositories for a user's codespace secret. You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. GitHub Apps must have write access to the codespaces_user_secrets user permission and write access to the codespaces_secrets repository permission on the referenced repository to use this endpoint. // -// Github API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#add-a-selected-repository-to-a-user-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#add-a-selected-repository-to-a-user-secret +// +//meta:operation PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id} func (s *CodespacesService) AddSelectedRepoToUserSecret(ctx context.Context, name string, repo *Repository) (*Response, error) { u := fmt.Sprintf("user/codespaces/secrets/%v/repositories/%v", name, *repo.ID) return s.addSelectedRepoToSecret(ctx, u) @@ -350,7 +390,9 @@ func (s *CodespacesService) AddSelectedRepoToUserSecret(ctx context.Context, nam // // Adds a repository to an organization secret when the visibility for repository access is set to selected. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// Github API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#add-selected-repository-to-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#add-selected-repository-to-an-organization-secret +// +//meta:operation PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id} func (s *CodespacesService) AddSelectedRepoToOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v/repositories/%v", org, name, *repo.ID) return s.addSelectedRepoToSecret(ctx, u) @@ -374,7 +416,9 @@ func (s *CodespacesService) addSelectedRepoToSecret(ctx context.Context, url str // // Removes a repository from the selected repositories for a user's codespace secret. You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. GitHub Apps must have write access to the codespaces_user_secrets user permission to use this endpoint. // -// Github API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#remove-a-selected-repository-from-a-user-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#remove-a-selected-repository-from-a-user-secret +// +//meta:operation DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id} func (s *CodespacesService) RemoveSelectedRepoFromUserSecret(ctx context.Context, name string, repo *Repository) (*Response, error) { u := fmt.Sprintf("user/codespaces/secrets/%v/repositories/%v", name, *repo.ID) return s.removeSelectedRepoFromSecret(ctx, u) @@ -384,7 +428,9 @@ func (s *CodespacesService) RemoveSelectedRepoFromUserSecret(ctx context.Context // // Removes a repository from an organization secret when the visibility for repository access is set to selected. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// Github API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#remove-selected-repository-from-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#remove-selected-repository-from-an-organization-secret +// +//meta:operation DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id} func (s *CodespacesService) RemoveSelectedRepoFromOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v/repositories/%v", org, name, *repo.ID) return s.removeSelectedRepoFromSecret(ctx, u) diff --git a/github/dependabot.go b/github/dependabot.go index 07e68b506af..2a11a9c9563 100644 --- a/github/dependabot.go +++ b/github/dependabot.go @@ -8,5 +8,5 @@ package github // DependabotService handles communication with the Dependabot related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/ +// GitHub API docs: https://docs.github.com/rest/dependabot/ type DependabotService service diff --git a/github/dependabot_alerts.go b/github/dependabot_alerts.go index 177316b1dc8..94be610c53d 100644 --- a/github/dependabot_alerts.go +++ b/github/dependabot_alerts.go @@ -104,7 +104,9 @@ func (s *DependabotService) listAlerts(ctx context.Context, url string, opts *Li // ListRepoAlerts lists all Dependabot alerts of a repository. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/alerts#list-dependabot-alerts-for-a-repository +// GitHub API docs: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/dependabot/alerts func (s *DependabotService) ListRepoAlerts(ctx context.Context, owner, repo string, opts *ListAlertsOptions) ([]*DependabotAlert, *Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/alerts", owner, repo) return s.listAlerts(ctx, url, opts) @@ -112,7 +114,9 @@ func (s *DependabotService) ListRepoAlerts(ctx context.Context, owner, repo stri // ListOrgAlerts lists all Dependabot alerts of an organization. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/alerts#list-dependabot-alerts-for-an-organization +// GitHub API docs: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-organization +// +//meta:operation GET /orgs/{org}/dependabot/alerts func (s *DependabotService) ListOrgAlerts(ctx context.Context, org string, opts *ListAlertsOptions) ([]*DependabotAlert, *Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/alerts", org) return s.listAlerts(ctx, url, opts) @@ -120,7 +124,9 @@ func (s *DependabotService) ListOrgAlerts(ctx context.Context, org string, opts // GetRepoAlert gets a single repository Dependabot alert. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/alerts#get-a-dependabot-alert +// GitHub API docs: https://docs.github.com/rest/dependabot/alerts#get-a-dependabot-alert +// +//meta:operation GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number} func (s *DependabotService) GetRepoAlert(ctx context.Context, owner, repo string, number int) (*DependabotAlert, *Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/alerts/%v", owner, repo, number) req, err := s.client.NewRequest("GET", url, nil) diff --git a/github/dependabot_secrets.go b/github/dependabot_secrets.go index 685f7bea8ea..e85c805a63f 100644 --- a/github/dependabot_secrets.go +++ b/github/dependabot_secrets.go @@ -27,7 +27,9 @@ func (s *DependabotService) getPublicKey(ctx context.Context, url string) (*Publ // GetRepoPublicKey gets a public key that should be used for Dependabot secret encryption. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#get-a-repository-public-key +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#get-a-repository-public-key +// +//meta:operation GET /repos/{owner}/{repo}/dependabot/secrets/public-key func (s *DependabotService) GetRepoPublicKey(ctx context.Context, owner, repo string) (*PublicKey, *Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/secrets/public-key", owner, repo) return s.getPublicKey(ctx, url) @@ -35,7 +37,9 @@ func (s *DependabotService) GetRepoPublicKey(ctx context.Context, owner, repo st // GetOrgPublicKey gets a public key that should be used for Dependabot secret encryption. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#get-an-organization-public-key +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#get-an-organization-public-key +// +//meta:operation GET /orgs/{org}/dependabot/secrets/public-key func (s *DependabotService) GetOrgPublicKey(ctx context.Context, org string) (*PublicKey, *Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/public-key", org) return s.getPublicKey(ctx, url) @@ -64,7 +68,9 @@ func (s *DependabotService) listSecrets(ctx context.Context, url string, opts *L // ListRepoSecrets lists all Dependabot secrets available in a repository // without revealing their encrypted values. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#list-repository-secrets +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#list-repository-secrets +// +//meta:operation GET /repos/{owner}/{repo}/dependabot/secrets func (s *DependabotService) ListRepoSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/secrets", owner, repo) return s.listSecrets(ctx, url, opts) @@ -73,7 +79,9 @@ func (s *DependabotService) ListRepoSecrets(ctx context.Context, owner, repo str // ListOrgSecrets lists all Dependabot secrets available in an organization // without revealing their encrypted values. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#list-organization-secrets +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#list-organization-secrets +// +//meta:operation GET /orgs/{org}/dependabot/secrets func (s *DependabotService) ListOrgSecrets(ctx context.Context, org string, opts *ListOptions) (*Secrets, *Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets", org) return s.listSecrets(ctx, url, opts) @@ -96,7 +104,9 @@ func (s *DependabotService) getSecret(ctx context.Context, url string) (*Secret, // GetRepoSecret gets a single repository Dependabot secret without revealing its encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#get-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#get-a-repository-secret +// +//meta:operation GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name} func (s *DependabotService) GetRepoSecret(ctx context.Context, owner, repo, name string) (*Secret, *Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/secrets/%v", owner, repo, name) return s.getSecret(ctx, url) @@ -104,7 +114,9 @@ func (s *DependabotService) GetRepoSecret(ctx context.Context, owner, repo, name // GetOrgSecret gets a single organization Dependabot secret without revealing its encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#get-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#get-an-organization-secret +// +//meta:operation GET /orgs/{org}/dependabot/secrets/{secret_name} func (s *DependabotService) GetOrgSecret(ctx context.Context, org, name string) (*Secret, *Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v", org, name) return s.getSecret(ctx, url) @@ -134,7 +146,9 @@ func (s *DependabotService) putSecret(ctx context.Context, url string, eSecret * // CreateOrUpdateRepoSecret creates or updates a repository Dependabot secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#create-or-update-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#create-or-update-a-repository-secret +// +//meta:operation PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name} func (s *DependabotService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *DependabotEncryptedSecret) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/secrets/%v", owner, repo, eSecret.Name) return s.putSecret(ctx, url, eSecret) @@ -142,7 +156,9 @@ func (s *DependabotService) CreateOrUpdateRepoSecret(ctx context.Context, owner, // CreateOrUpdateOrgSecret creates or updates an organization Dependabot secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#create-or-update-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret +// +//meta:operation PUT /orgs/{org}/dependabot/secrets/{secret_name} func (s *DependabotService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *DependabotEncryptedSecret) (*Response, error) { repoIDs := make([]string, len(eSecret.SelectedRepositoryIDs)) for i, secret := range eSecret.SelectedRepositoryIDs { @@ -176,7 +192,9 @@ func (s *DependabotService) deleteSecret(ctx context.Context, url string) (*Resp // DeleteRepoSecret deletes a Dependabot secret in a repository using the secret name. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#delete-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#delete-a-repository-secret +// +//meta:operation DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name} func (s *DependabotService) DeleteRepoSecret(ctx context.Context, owner, repo, name string) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/secrets/%v", owner, repo, name) return s.deleteSecret(ctx, url) @@ -184,7 +202,9 @@ func (s *DependabotService) DeleteRepoSecret(ctx context.Context, owner, repo, n // DeleteOrgSecret deletes a Dependabot secret in an organization using the secret name. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#delete-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#delete-an-organization-secret +// +//meta:operation DELETE /orgs/{org}/dependabot/secrets/{secret_name} func (s *DependabotService) DeleteOrgSecret(ctx context.Context, org, name string) (*Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v", org, name) return s.deleteSecret(ctx, url) @@ -192,7 +212,9 @@ func (s *DependabotService) DeleteOrgSecret(ctx context.Context, org, name strin // ListSelectedReposForOrgSecret lists all repositories that have access to a Dependabot secret. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret +// +//meta:operation GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories func (s *DependabotService) ListSelectedReposForOrgSecret(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v/repositories", org, name) u, err := addOptions(url, opts) @@ -219,7 +241,9 @@ type DependabotSecretsSelectedRepoIDs []int64 // SetSelectedReposForOrgSecret sets the repositories that have access to a Dependabot secret. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret +// +//meta:operation PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories func (s *DependabotService) SetSelectedReposForOrgSecret(ctx context.Context, org, name string, ids DependabotSecretsSelectedRepoIDs) (*Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v/repositories", org, name) type repoIDs struct { @@ -236,7 +260,9 @@ func (s *DependabotService) SetSelectedReposForOrgSecret(ctx context.Context, or // AddSelectedRepoToOrgSecret adds a repository to an organization Dependabot secret. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#add-selected-repository-to-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#add-selected-repository-to-an-organization-secret +// +//meta:operation PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id} func (s *DependabotService) AddSelectedRepoToOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v/repositories/%v", org, name, *repo.ID) req, err := s.client.NewRequest("PUT", url, nil) @@ -249,7 +275,9 @@ func (s *DependabotService) AddSelectedRepoToOrgSecret(ctx context.Context, org, // RemoveSelectedRepoFromOrgSecret removes a repository from an organization Dependabot secret. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret +// +//meta:operation DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id} func (s *DependabotService) RemoveSelectedRepoFromOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v/repositories/%v", org, name, *repo.ID) req, err := s.client.NewRequest("DELETE", url, nil) diff --git a/github/dependency_graph.go b/github/dependency_graph.go index e578965cc12..86a1fe48b98 100644 --- a/github/dependency_graph.go +++ b/github/dependency_graph.go @@ -61,7 +61,9 @@ func (s SBOM) String() string { // GetSBOM fetches the software bill of materials for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/dependency-graph/sboms +// GitHub API docs: https://docs.github.com/rest/dependency-graph/sboms#export-a-software-bill-of-materials-sbom-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/dependency-graph/sbom func (s *DependencyGraphService) GetSBOM(ctx context.Context, owner, repo string) (*SBOM, *Response, error) { u := fmt.Sprintf("repos/%v/%v/dependency-graph/sbom", owner, repo) diff --git a/github/doc.go b/github/doc.go index 4a9aa95c3af..b10810d5338 100644 --- a/github/doc.go +++ b/github/doc.go @@ -29,7 +29,7 @@ Some API methods have optional parameters that can be passed. For example: The services of a client divide the API into logical chunks and correspond to the structure of the GitHub API documentation at -https://docs.github.com/en/rest . +https://docs.github.com/rest . NOTE: Using the https://godoc.org/context package, one can easily pass cancelation signals and deadlines to various services of the client for @@ -119,7 +119,7 @@ For secondary rate limits, you can check if its type is *github.AbuseRateLimitEr } Learn more about GitHub rate limiting at -https://docs.github.com/en/rest/rate-limit . +https://docs.github.com/rest/rate-limit . # Accepted Status @@ -145,7 +145,7 @@ instead designed to work with a caching http.Transport. We recommend using https://github.com/gregjones/httpcache for that. Learn more about GitHub conditional requests at -https://docs.github.com/en/rest/overview/resources-in-the-rest-api#conditional-requests. +https://docs.github.com/rest/overview/resources-in-the-rest-api#conditional-requests. # Creating and Updating Resources diff --git a/github/emojis.go b/github/emojis.go index 5a2c86baa38..93ef232f6c7 100644 --- a/github/emojis.go +++ b/github/emojis.go @@ -15,6 +15,8 @@ type EmojisService service // List returns the emojis available to use on GitHub. // // GitHub API docs: https://docs.github.com/rest/emojis/emojis#get-emojis +// +//meta:operation GET /emojis func (s *EmojisService) List(ctx context.Context) (map[string]string, *Response, error) { req, err := s.client.NewRequest("GET", "emojis", nil) if err != nil { diff --git a/github/enterprise.go b/github/enterprise.go index 1c9b0695669..2036f8bc75d 100644 --- a/github/enterprise.go +++ b/github/enterprise.go @@ -8,5 +8,5 @@ package github // EnterpriseService provides access to the enterprise related functions // in the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/enterprise-admin/ +// GitHub API docs: https://docs.github.com/rest/enterprise-admin/ type EnterpriseService service diff --git a/github/enterprise_actions_runner_groups.go b/github/enterprise_actions_runner_groups.go index b6bb70dae40..f171df75734 100644 --- a/github/enterprise_actions_runner_groups.go +++ b/github/enterprise_actions_runner_groups.go @@ -79,7 +79,9 @@ type ListEnterpriseRunnerGroupOptions struct { // ListRunnerGroups lists all self-hosted runner groups configured in an enterprise. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#list-self-hosted-runner-groups-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/runner-groups func (s *EnterpriseService) ListRunnerGroups(ctx context.Context, enterprise string, opts *ListEnterpriseRunnerGroupOptions) (*EnterpriseRunnerGroups, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups", enterprise) u, err := addOptions(u, opts) @@ -103,7 +105,9 @@ func (s *EnterpriseService) ListRunnerGroups(ctx context.Context, enterprise str // GetEnterpriseRunnerGroup gets a specific self-hosted runner group for an enterprise using its RunnerGroup ID. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#get-a-self-hosted-runner-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} func (s *EnterpriseService) GetEnterpriseRunnerGroup(ctx context.Context, enterprise string, groupID int64) (*EnterpriseRunnerGroup, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v", enterprise, groupID) req, err := s.client.NewRequest("GET", u, nil) @@ -122,7 +126,9 @@ func (s *EnterpriseService) GetEnterpriseRunnerGroup(ctx context.Context, enterp // DeleteEnterpriseRunnerGroup deletes a self-hosted runner group from an enterprise. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#delete-a-self-hosted-runner-group-from-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-enterprise +// +//meta:operation DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} func (s *EnterpriseService) DeleteEnterpriseRunnerGroup(ctx context.Context, enterprise string, groupID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v", enterprise, groupID) @@ -136,7 +142,9 @@ func (s *EnterpriseService) DeleteEnterpriseRunnerGroup(ctx context.Context, ent // CreateEnterpriseRunnerGroup creates a new self-hosted runner group for an enterprise. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#create-a-self-hosted-runner-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-enterprise +// +//meta:operation POST /enterprises/{enterprise}/actions/runner-groups func (s *EnterpriseService) CreateEnterpriseRunnerGroup(ctx context.Context, enterprise string, createReq CreateEnterpriseRunnerGroupRequest) (*EnterpriseRunnerGroup, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups", enterprise) req, err := s.client.NewRequest("POST", u, createReq) @@ -155,7 +163,9 @@ func (s *EnterpriseService) CreateEnterpriseRunnerGroup(ctx context.Context, ent // UpdateEnterpriseRunnerGroup updates a self-hosted runner group for an enterprise. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#update-a-self-hosted-runner-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-enterprise +// +//meta:operation PATCH /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} func (s *EnterpriseService) UpdateEnterpriseRunnerGroup(ctx context.Context, enterprise string, groupID int64, updateReq UpdateEnterpriseRunnerGroupRequest) (*EnterpriseRunnerGroup, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v", enterprise, groupID) req, err := s.client.NewRequest("PATCH", u, updateReq) @@ -174,7 +184,9 @@ func (s *EnterpriseService) UpdateEnterpriseRunnerGroup(ctx context.Context, ent // ListOrganizationAccessRunnerGroup lists the organizations with access to a self-hosted runner group configured in an enterprise. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#list-organization-access-to-a-self-hosted-runner-group-in-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#list-organization-access-to-a-self-hosted-runner-group-in-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations func (s *EnterpriseService) ListOrganizationAccessRunnerGroup(ctx context.Context, enterprise string, groupID int64, opts *ListOptions) (*ListOrganizations, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/organizations", enterprise, groupID) u, err := addOptions(u, opts) @@ -199,7 +211,9 @@ func (s *EnterpriseService) ListOrganizationAccessRunnerGroup(ctx context.Contex // SetOrganizationAccessRunnerGroup replaces the list of organizations that have access to a self-hosted runner group configured in an enterprise // with a new List of organizations. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#set-organization-access-for-a-self-hosted-runner-group-in-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#set-organization-access-for-a-self-hosted-runner-group-in-an-enterprise +// +//meta:operation PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations func (s *EnterpriseService) SetOrganizationAccessRunnerGroup(ctx context.Context, enterprise string, groupID int64, ids SetOrgAccessRunnerGroupRequest) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/organizations", enterprise, groupID) @@ -214,7 +228,9 @@ func (s *EnterpriseService) SetOrganizationAccessRunnerGroup(ctx context.Context // AddOrganizationAccessRunnerGroup adds an organization to the list of selected organizations that can access a self-hosted runner group. // The runner group must have visibility set to 'selected'. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#add-organization-access-to-a-self-hosted-runner-group-in-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#add-organization-access-to-a-self-hosted-runner-group-in-an-enterprise +// +//meta:operation PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} func (s *EnterpriseService) AddOrganizationAccessRunnerGroup(ctx context.Context, enterprise string, groupID, orgID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/organizations/%v", enterprise, groupID, orgID) @@ -229,7 +245,9 @@ func (s *EnterpriseService) AddOrganizationAccessRunnerGroup(ctx context.Context // RemoveOrganizationAccessRunnerGroup removes an organization from the list of selected organizations that can access a self-hosted runner group. // The runner group must have visibility set to 'selected'. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#remove-organization-access-to-a-self-hosted-runner-group-in-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#remove-organization-access-to-a-self-hosted-runner-group-in-an-enterprise +// +//meta:operation DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} func (s *EnterpriseService) RemoveOrganizationAccessRunnerGroup(ctx context.Context, enterprise string, groupID, orgID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/organizations/%v", enterprise, groupID, orgID) @@ -243,7 +261,9 @@ func (s *EnterpriseService) RemoveOrganizationAccessRunnerGroup(ctx context.Cont // ListRunnerGroupRunners lists self-hosted runners that are in a specific enterprise group. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#list-self-hosted-runners-in-a-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners func (s *EnterpriseService) ListRunnerGroupRunners(ctx context.Context, enterprise string, groupID int64, opts *ListOptions) (*Runners, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/runners", enterprise, groupID) u, err := addOptions(u, opts) @@ -268,7 +288,9 @@ func (s *EnterpriseService) ListRunnerGroupRunners(ctx context.Context, enterpri // SetRunnerGroupRunners replaces the list of self-hosted runners that are part of an enterprise runner group // with a new list of runners. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#set-self-hosted-runners-in-a-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-enterprise +// +//meta:operation PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners func (s *EnterpriseService) SetRunnerGroupRunners(ctx context.Context, enterprise string, groupID int64, ids SetRunnerGroupRunnersRequest) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/runners", enterprise, groupID) @@ -282,7 +304,9 @@ func (s *EnterpriseService) SetRunnerGroupRunners(ctx context.Context, enterpris // AddRunnerGroupRunners adds a self-hosted runner to a runner group configured in an enterprise. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#add-a-self-hosted-runner-to-a-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-enterprise +// +//meta:operation PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} func (s *EnterpriseService) AddRunnerGroupRunners(ctx context.Context, enterprise string, groupID, runnerID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/runners/%v", enterprise, groupID, runnerID) @@ -297,7 +321,9 @@ func (s *EnterpriseService) AddRunnerGroupRunners(ctx context.Context, enterpris // RemoveRunnerGroupRunners removes a self-hosted runner from a group configured in an enterprise. // The runner is then returned to the default group. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#remove-a-self-hosted-runner-from-a-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-enterprise +// +//meta:operation DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} func (s *EnterpriseService) RemoveRunnerGroupRunners(ctx context.Context, enterprise string, groupID, runnerID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/runners/%v", enterprise, groupID, runnerID) diff --git a/github/enterprise_actions_runners.go b/github/enterprise_actions_runners.go index 6fc30d50258..4a6e6b52c10 100644 --- a/github/enterprise_actions_runners.go +++ b/github/enterprise_actions_runners.go @@ -12,7 +12,9 @@ import ( // ListRunnerApplicationDownloads lists self-hosted runner application binaries that can be downloaded and run. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#list-runner-applications-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#list-runner-applications-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/runners/downloads func (s *EnterpriseService) ListRunnerApplicationDownloads(ctx context.Context, enterprise string) ([]*RunnerApplicationDownload, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runners/downloads", enterprise) req, err := s.client.NewRequest("GET", u, nil) @@ -31,7 +33,9 @@ func (s *EnterpriseService) ListRunnerApplicationDownloads(ctx context.Context, // GenerateEnterpriseJITConfig generates a just-in-time configuration for an enterprise. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-configuration-for-a-just-in-time-runner-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-enterprise +// +//meta:operation POST /enterprises/{enterprise}/actions/runners/generate-jitconfig func (s *EnterpriseService) GenerateEnterpriseJITConfig(ctx context.Context, enterprise string, request *GenerateJITConfigRequest) (*JITRunnerConfig, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runners/generate-jitconfig", enterprise) @@ -51,7 +55,9 @@ func (s *EnterpriseService) GenerateEnterpriseJITConfig(ctx context.Context, ent // CreateRegistrationToken creates a token that can be used to add a self-hosted runner. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-registration-token-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#create-a-registration-token-for-an-enterprise +// +//meta:operation POST /enterprises/{enterprise}/actions/runners/registration-token func (s *EnterpriseService) CreateRegistrationToken(ctx context.Context, enterprise string) (*RegistrationToken, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runners/registration-token", enterprise) @@ -71,7 +77,9 @@ func (s *EnterpriseService) CreateRegistrationToken(ctx context.Context, enterpr // ListRunners lists all the self-hosted runners for a enterprise. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/runners func (s *EnterpriseService) ListRunners(ctx context.Context, enterprise string, opts *ListOptions) (*Runners, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runners", enterprise) u, err := addOptions(u, opts) @@ -95,7 +103,9 @@ func (s *EnterpriseService) ListRunners(ctx context.Context, enterprise string, // RemoveRunner forces the removal of a self-hosted runner from an enterprise using the runner id. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-enterprise +// +//meta:operation DELETE /enterprises/{enterprise}/actions/runners/{runner_id} func (s *EnterpriseService) RemoveRunner(ctx context.Context, enterprise string, runnerID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runners/%v", enterprise, runnerID) diff --git a/github/enterprise_audit_log.go b/github/enterprise_audit_log.go index 40648673385..058a7d17786 100644 --- a/github/enterprise_audit_log.go +++ b/github/enterprise_audit_log.go @@ -12,7 +12,9 @@ import ( // GetAuditLog gets the audit-log entries for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/enterprise-admin/audit-log#get-the-audit-log-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/audit-log#get-the-audit-log-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/audit-log func (s *EnterpriseService) GetAuditLog(ctx context.Context, enterprise string, opts *GetAuditLogOptions) ([]*AuditEntry, *Response, error) { u := fmt.Sprintf("enterprises/%v/audit-log", enterprise) u, err := addOptions(u, opts) diff --git a/github/enterprise_code_security_and_analysis.go b/github/enterprise_code_security_and_analysis.go index 3980a86aa4b..af8eb0ffb2f 100644 --- a/github/enterprise_code_security_and_analysis.go +++ b/github/enterprise_code_security_and_analysis.go @@ -20,7 +20,9 @@ type EnterpriseSecurityAnalysisSettings struct { // GetCodeSecurityAndAnalysis gets code security and analysis features for an enterprise. // -// GitHub API docs: https://docs.github.com/en/rest/enterprise-admin/code-security-and-analysis?apiVersion=2022-11-28#get-code-security-and-analysis-features-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/code-security-and-analysis#get-code-security-and-analysis-features-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/code_security_and_analysis func (s *EnterpriseService) GetCodeSecurityAndAnalysis(ctx context.Context, enterprise string) (*EnterpriseSecurityAnalysisSettings, *Response, error) { u := fmt.Sprintf("enterprises/%v/code_security_and_analysis", enterprise) @@ -40,7 +42,9 @@ func (s *EnterpriseService) GetCodeSecurityAndAnalysis(ctx context.Context, ente // UpdateCodeSecurityAndAnalysis updates code security and analysis features for new repositories in an enterprise. // -// GitHub API docs: https://docs.github.com/en/rest/enterprise-admin/code-security-and-analysis?apiVersion=2022-11-28#update-code-security-and-analysis-features-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/code-security-and-analysis#update-code-security-and-analysis-features-for-an-enterprise +// +//meta:operation PATCH /enterprises/{enterprise}/code_security_and_analysis func (s *EnterpriseService) UpdateCodeSecurityAndAnalysis(ctx context.Context, enterprise string, settings *EnterpriseSecurityAnalysisSettings) (*Response, error) { u := fmt.Sprintf("enterprises/%v/code_security_and_analysis", enterprise) req, err := s.client.NewRequest("PATCH", u, settings) @@ -61,7 +65,9 @@ func (s *EnterpriseService) UpdateCodeSecurityAndAnalysis(ctx context.Context, e // Valid values for securityProduct: "advanced_security", "secret_scanning", "secret_scanning_push_protection". // Valid values for enablement: "enable_all", "disable_all". // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/enterprise-admin/code-security-and-analysis?apiVersion=2022-11-28#enable-or-disable-a-security-feature +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/code-security-and-analysis#enable-or-disable-a-security-feature +// +//meta:operation POST /enterprises/{enterprise}/{security_product}/{enablement} func (s *EnterpriseService) EnableDisableSecurityFeature(ctx context.Context, enterprise, securityProduct, enablement string) (*Response, error) { u := fmt.Sprintf("enterprises/%v/%v/%v", enterprise, securityProduct, enablement) req, err := s.client.NewRequest("POST", u, nil) diff --git a/github/event_types.go b/github/event_types.go index c270f6bcf0a..6ff1eb84851 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -18,7 +18,7 @@ type RequestedAction struct { // BranchProtectionRuleEvent triggered when a check suite is "created", "edited", or "deleted". // The Webhook event name is "branch_protection_rule". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#branch_protection_rule +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#branch_protection_rule type BranchProtectionRuleEvent struct { Action *string `json:"action,omitempty"` Rule *BranchProtectionRule `json:"rule,omitempty"` @@ -32,7 +32,7 @@ type BranchProtectionRuleEvent struct { // CheckRunEvent is triggered when a check run is "created", "completed", or "rerequested". // The Webhook event name is "check_run". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#check_run +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#check_run type CheckRunEvent struct { CheckRun *CheckRun `json:"check_run,omitempty"` // The action performed. Possible values are: "created", "completed", "rerequested" or "requested_action". @@ -51,7 +51,7 @@ type CheckRunEvent struct { // CheckSuiteEvent is triggered when a check suite is "completed", "requested", or "rerequested". // The Webhook event name is "check_suite". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#check_suite +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#check_suite type CheckSuiteEvent struct { CheckSuite *CheckSuite `json:"check_suite,omitempty"` // The action performed. Possible values are: "completed", "requested" or "rerequested". @@ -67,7 +67,7 @@ type CheckSuiteEvent struct { // CommitCommentEvent is triggered when a commit comment is created. // The Webhook event name is "commit_comment". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#commit_comment +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#commit_comment type CommitCommentEvent struct { Comment *RepositoryComment `json:"comment,omitempty"` @@ -103,7 +103,7 @@ type ContentReferenceEvent struct { // Additionally, webhooks will not receive this event for tags if more // than three tags are pushed at once. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/github-event-types#createevent +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/github-event-types#createevent type CreateEvent struct { Ref *string `json:"ref,omitempty"` // RefType is the object that was created. Possible values are: "repository", "branch", "tag". @@ -125,7 +125,7 @@ type CreateEvent struct { // Note: webhooks will not receive this event for tags if more than three tags // are deleted at once. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/github-event-types#deleteevent +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/github-event-types#deleteevent type DeleteEvent struct { Ref *string `json:"ref,omitempty"` // RefType is the object that was deleted. Possible values are: "branch", "tag". @@ -145,7 +145,7 @@ type DeleteEvent struct { // DependabotAlertEvent is triggered when there is activity relating to Dependabot alerts. // The Webhook event name is "dependabot_alert". // -// GitHub API docs: https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#dependabot_alert +// GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#dependabot_alert type DependabotAlertEvent struct { Action *string `json:"action,omitempty"` Alert *DependabotAlert `json:"alert,omitempty"` @@ -164,7 +164,7 @@ type DependabotAlertEvent struct { // DeployKeyEvent is triggered when a deploy key is added or removed from a repository. // The Webhook event name is "deploy_key". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#deploy_key +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#deploy_key type DeployKeyEvent struct { // Action is the action that was performed. Possible values are: // "created" or "deleted". @@ -190,7 +190,7 @@ type DeployKeyEvent struct { // // Events of this type are not visible in timelines, they are only used to trigger hooks. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#deployment +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#deployment type DeploymentEvent struct { Deployment *Deployment `json:"deployment,omitempty"` Repo *Repository `json:"repository,omitempty"` @@ -230,7 +230,7 @@ type DeploymentProtectionRuleEvent struct { // // Events of this type are not visible in timelines, they are only used to trigger hooks. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#deployment_status +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#deployment_status type DeploymentStatusEvent struct { Deployment *Deployment `json:"deployment,omitempty"` DeploymentStatus *DeploymentStatus `json:"deployment_status,omitempty"` @@ -281,7 +281,7 @@ type CommentDiscussion struct { // DiscussionEvent represents a webhook event for a discussion. // The Webhook event name is "discussion". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#discussion +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#discussion type DiscussionEvent struct { // Action is the action that was performed. Possible values are: // created, edited, deleted, pinned, unpinned, locked, unlocked, @@ -334,7 +334,7 @@ type DiscussionCategory struct { // ForkEvent is triggered when a user forks a repository. // The Webhook event name is "fork". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#fork +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#fork type ForkEvent struct { // Forkee is the created repository. Forkee *Repository `json:"forkee,omitempty"` @@ -348,7 +348,7 @@ type ForkEvent struct { // GitHubAppAuthorizationEvent is triggered when a user's authorization for a // GitHub Application is revoked. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#github_app_authorization +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#github_app_authorization type GitHubAppAuthorizationEvent struct { // The action performed. Possible value is: "revoked". Action *string `json:"action,omitempty"` @@ -371,7 +371,7 @@ type Page struct { // GollumEvent is triggered when a Wiki page is created or updated. // The Webhook event name is "gollum". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#gollum +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#gollum type GollumEvent struct { Pages []*Page `json:"pages,omitempty"` @@ -522,7 +522,7 @@ type TeamPermissionsFrom struct { // or new permissions have been accepted. // The Webhook event name is "installation". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#installation +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#installation type InstallationEvent struct { // The action that was performed. Can be either "created", "deleted", "suspend", "unsuspend" or "new_permissions_accepted". Action *string `json:"action,omitempty"` @@ -539,7 +539,7 @@ type InstallationEvent struct { // InstallationRepositoriesEvent is triggered when a repository is added or // removed from an installation. The Webhook event name is "installation_repositories". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#installation_repositories +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#installation_repositories type InstallationRepositoriesEvent struct { // The action that was performed. Can be either "added" or "removed". Action *string `json:"action,omitempty"` @@ -573,7 +573,7 @@ type InstallationChanges struct { // InstallationTargetEvent is triggered when there is activity on an installation from a user or organization account. // The Webhook event name is "installation_target". // -// GitHub API docs: https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#installation_target +// GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#installation_target type InstallationTargetEvent struct { Account *User `json:"account,omitempty"` Action *string `json:"action,omitempty"` @@ -590,7 +590,7 @@ type InstallationTargetEvent struct { // or pull request. // The Webhook event name is "issue_comment". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#issue_comment +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#issue_comment type IssueCommentEvent struct { // Action is the action that was performed on the comment. // Possible values are: "created", "edited", "deleted". @@ -614,7 +614,7 @@ type IssueCommentEvent struct { // locked, unlocked, milestoned, or demilestoned. // The Webhook event name is "issues". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#issues +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#issues type IssuesEvent struct { // Action is the action that was performed. Possible values are: "opened", // "edited", "deleted", "transferred", "pinned", "unpinned", "closed", "reopened", @@ -640,7 +640,7 @@ type IssuesEvent struct { // LabelEvent is triggered when a repository's label is created, edited, or deleted. // The Webhook event name is "label" // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#label +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#label type LabelEvent struct { // Action is the action that was performed. Possible values are: // "created", "edited", "deleted" @@ -659,7 +659,7 @@ type LabelEvent struct { // their GitHub Marketplace plan. // Webhook event name "marketplace_purchase". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#marketplace_purchase +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#marketplace_purchase type MarketplacePurchaseEvent struct { // Action is the action that was performed. Possible values are: // "purchased", "cancelled", "pending_change", "pending_change_cancelled", "changed". @@ -680,7 +680,7 @@ type MarketplacePurchaseEvent struct { // MemberEvent is triggered when a user is added as a collaborator to a repository. // The Webhook event name is "member". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#member +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#member type MemberEvent struct { // Action is the action that was performed. Possible value is: "added". Action *string `json:"action,omitempty"` @@ -702,7 +702,7 @@ type MemberEvent struct { // Events of this type are not visible in timelines, they are only used to // trigger organization webhooks. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#membership +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#membership type MembershipEvent struct { // Action is the action that was performed. Possible values are: "added", "removed". Action *string `json:"action,omitempty"` @@ -734,7 +734,7 @@ type MergeGroup struct { // MergeGroupEvent represents activity related to merge groups in a merge queue. The type of activity is specified // in the action property of the payload object. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#merge_group +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#merge_group type MergeGroupEvent struct { // The action that was performed. Currently, can only be checks_requested. Action *string `json:"action,omitempty"` @@ -753,7 +753,7 @@ type MergeGroupEvent struct { // Therefore, it must be selected for each hook that you'd like to receive meta events for. // The Webhook event name is "meta". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#meta +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#meta type MetaEvent struct { // Action is the action that was performed. Possible value is: "deleted". Action *string `json:"action,omitempty"` @@ -774,7 +774,7 @@ type MetaEvent struct { // MilestoneEvent is triggered when a milestone is created, closed, opened, edited, or deleted. // The Webhook event name is "milestone". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#milestone +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#milestone type MilestoneEvent struct { // Action is the action that was performed. Possible values are: // "created", "closed", "opened", "edited", "deleted" @@ -794,7 +794,7 @@ type MilestoneEvent struct { // Events of this type are not visible in timelines. These events are only used to trigger organization hooks. // Webhook event name is "organization". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#organization +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#organization type OrganizationEvent struct { // Action is the action that was performed. // Possible values are: "deleted", "renamed", "member_added", "member_removed", or "member_invited". @@ -815,7 +815,7 @@ type OrganizationEvent struct { // OrgBlockEvent is triggered when an organization blocks or unblocks a user. // The Webhook event name is "org_block". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#org_block +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#org_block type OrgBlockEvent struct { // Action is the action that was performed. // Can be "blocked" or "unblocked". @@ -856,7 +856,7 @@ type PackageEvent struct { // // Events of this type are not visible in timelines, they are only used to trigger hooks. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#page_build +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#page_build type PageBuildEvent struct { Build *PagesBuild `json:"build,omitempty"` @@ -876,7 +876,7 @@ type PageBuildEvent struct { // belong to a resource owner that requires approval for token access. // The webhook event name is "personal_access_token_request". // -// GitHub API docs: https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#personal_access_token_request +// GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#personal_access_token_request type PersonalAccessTokenRequestEvent struct { // Action is the action that was performed. Possible values are: // "approved", "cancelled", "created" or "denied" @@ -964,7 +964,7 @@ type PingEvent struct { // ProjectEvent is triggered when project is created, modified or deleted. // The webhook event name is "project". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#project +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#project type ProjectEvent struct { Action *string `json:"action,omitempty"` Changes *ProjectChange `json:"changes,omitempty"` @@ -980,7 +980,7 @@ type ProjectEvent struct { // ProjectCardEvent is triggered when a project card is created, updated, moved, converted to an issue, or deleted. // The webhook event name is "project_card". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#project_card +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#project_card type ProjectCardEvent struct { Action *string `json:"action,omitempty"` Changes *ProjectCardChange `json:"changes,omitempty"` @@ -997,7 +997,7 @@ type ProjectCardEvent struct { // ProjectColumnEvent is triggered when a project column is created, updated, moved, or deleted. // The webhook event name is "project_column". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#project_column +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#project_column type ProjectColumnEvent struct { Action *string `json:"action,omitempty"` Changes *ProjectColumnChange `json:"changes,omitempty"` @@ -1014,7 +1014,7 @@ type ProjectColumnEvent struct { // ProjectV2Event is triggered when there is activity relating to an organization-level project. // The Webhook event name is "projects_v2". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#projects_v2 +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#projects_v2 type ProjectV2Event struct { Action *string `json:"action,omitempty"` ProjectsV2 *ProjectsV2 `json:"projects_v2,omitempty"` @@ -1046,7 +1046,7 @@ type ProjectsV2 struct { // ProjectV2ItemEvent is triggered when there is activity relating to an item on an organization-level project. // The Webhook event name is "projects_v2_item". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#projects_v2_item +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#projects_v2_item type ProjectV2ItemEvent struct { Action *string `json:"action,omitempty"` Changes *ProjectV2ItemChange `json:"changes,omitempty"` @@ -1086,7 +1086,7 @@ type ProjectV2Item struct { // According to GitHub: "Without a doubt: the best GitHub event." // The Webhook event name is "public". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#public +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#public type PublicEvent struct { // The following fields are only populated by Webhook events. Repo *Repository `json:"repository,omitempty"` @@ -1103,7 +1103,7 @@ type PublicEvent struct { // locked, unlocked, a pull request review is requested, or a review request is removed. // The Webhook event name is "pull_request". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/github-event-types#pullrequestevent +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/github-event-types#pullrequestevent type PullRequestEvent struct { // Action is the action that was performed. Possible values are: // "assigned", "unassigned", "review_requested", "review_request_removed", "labeled", "unlabeled", @@ -1147,7 +1147,7 @@ type PullRequestEvent struct { // request. // The Webhook event name is "pull_request_review". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#pull_request_review +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#pull_request_review type PullRequestReviewEvent struct { // Action is always "submitted". Action *string `json:"action,omitempty"` @@ -1168,7 +1168,7 @@ type PullRequestReviewEvent struct { // portion of the unified diff of a pull request. // The Webhook event name is "pull_request_review_comment". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#pull_request_review_comment +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#pull_request_review_comment type PullRequestReviewCommentEvent struct { // Action is the action that was performed on the comment. // Possible values are: "created", "edited", "deleted". @@ -1191,7 +1191,7 @@ type PullRequestReviewCommentEvent struct { // review of a pull request is marked resolved or unresolved. // The Webhook event name is "pull_request_review_thread". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#pull_request_review_thread +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#pull_request_review_thread type PullRequestReviewThreadEvent struct { // Action is the action that was performed on the comment. // Possible values are: "resolved", "unresolved". @@ -1214,7 +1214,7 @@ type PullRequestReviewThreadEvent struct { // locked, unlocked, a pull request review is requested, or a review request is removed. // The Webhook event name is "pull_request_target". // -// GitHub API docs: https://docs.github.com/en/actions/events-that-trigger-workflows#pull_request_target +// GitHub API docs: https://docs.github.com/actions/events-that-trigger-workflows#pull_request_target type PullRequestTargetEvent struct { // Action is the action that was performed. Possible values are: // "assigned", "unassigned", "labeled", "unlabeled", "opened", "edited", "closed", "reopened", @@ -1256,7 +1256,7 @@ type PullRequestTargetEvent struct { // PushEvent represents a git push to a GitHub repository. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#push +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#push type PushEvent struct { PushID *int64 `json:"push_id,omitempty"` Head *string `json:"head,omitempty"` @@ -1364,7 +1364,7 @@ type PushEventRepoOwner struct { // edited, deleted, or prereleased. // The Webhook event name is "release". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#release +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#release type ReleaseEvent struct { // Action is the action that was performed. Possible values are: "published", "unpublished", // "created", "edited", "deleted", or "prereleased". @@ -1389,7 +1389,7 @@ type ReleaseEvent struct { // Events of this type are not visible in timelines, they are only used to // trigger organization webhooks. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#repository +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#repository type RepositoryEvent struct { // Action is the action that was performed. Possible values are: "created", // "deleted" (organization hooks only), "archived", "unarchived", "edited", "renamed", @@ -1406,7 +1406,7 @@ type RepositoryEvent struct { // RepositoryDispatchEvent is triggered when a client sends a POST request to the repository dispatch event endpoint. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#repository_dispatch +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#repository_dispatch type RepositoryDispatchEvent struct { // Action is the event_type that submitted with the repository dispatch payload. Value can be any string. Action *string `json:"action,omitempty"` @@ -1422,7 +1422,7 @@ type RepositoryDispatchEvent struct { // RepositoryImportEvent represents the activity related to a repository being imported to GitHub. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#repository_import +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#repository_import type RepositoryImportEvent struct { // Status represents the final state of the import. This can be one of "success", "cancelled", or "failure". Status *string `json:"status,omitempty"` @@ -1433,7 +1433,7 @@ type RepositoryImportEvent struct { // RepositoryVulnerabilityAlertEvent is triggered when a security alert is created, dismissed, or resolved. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#repository_vulnerability_alert +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#repository_vulnerability_alert type RepositoryVulnerabilityAlertEvent struct { // Action is the action that was performed. Possible values are: "create", "dismiss", "resolve". Action *string `json:"action,omitempty"` @@ -1474,7 +1474,7 @@ type RepositoryVulnerabilityAlert struct { // SecretScanningAlertEvent is triggered when a secret scanning alert occurs in a repository. // The Webhook name is secret_scanning_alert. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#secret_scanning_alert +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#secret_scanning_alert type SecretScanningAlertEvent struct { // Action is the action that was performed. Possible values are: "created", "resolved", or "reopened". Action *string `json:"action,omitempty"` @@ -1494,7 +1494,7 @@ type SecretScanningAlertEvent struct { // SecurityAndAnalysisEvent is triggered when code security and analysis features // are enabled or disabled for a repository. // -// GitHub API docs: https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#security_and_analysis +// GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#security_and_analysis type SecurityAndAnalysisEvent struct { Changes *SecurityAndAnalysisChange `json:"changes,omitempty"` Enterprise *Enterprise `json:"enterprise,omitempty"` @@ -1519,7 +1519,7 @@ type SecurityAndAnalysisChangeFrom struct { // StarEvent is triggered when a star is added or removed from a repository. // The Webhook event name is "star". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#star +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#star type StarEvent struct { // Action is the action that was performed. Possible values are: "created" or "deleted". Action *string `json:"action,omitempty"` @@ -1540,7 +1540,7 @@ type StarEvent struct { // Events of this type are not visible in timelines, they are only used to // trigger hooks. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#status +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#status type StatusEvent struct { SHA *string `json:"sha,omitempty"` // State is the new state. Possible values are: "pending", "success", "failure", "error". @@ -1571,7 +1571,7 @@ type StatusEvent struct { // Events of this type are not visible in timelines. These events are only used // to trigger hooks. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#team +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#team type TeamEvent struct { Action *string `json:"action,omitempty"` Team *Team `json:"team,omitempty"` @@ -1590,7 +1590,7 @@ type TeamEvent struct { // Events of this type are not visible in timelines. These events are only used // to trigger hooks. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#team_add +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#team_add type TeamAddEvent struct { Team *Team `json:"team,omitempty"` Repo *Repository `json:"repository,omitempty"` @@ -1624,7 +1624,7 @@ type UserEvent struct { // The event’s actor is the user who starred a repository, and the event’s // repository is the repository that was starred. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#watch +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#watch type WatchEvent struct { // Action is the action that was performed. Possible value is: "started". Action *string `json:"action,omitempty"` @@ -1642,7 +1642,7 @@ type WatchEvent struct { // WorkflowDispatchEvent is triggered when someone triggers a workflow run on GitHub or // sends a POST request to the create a workflow dispatch event endpoint. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#workflow_dispatch +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#workflow_dispatch type WorkflowDispatchEvent struct { Inputs json.RawMessage `json:"inputs,omitempty"` Ref *string `json:"ref,omitempty"` @@ -1657,7 +1657,7 @@ type WorkflowDispatchEvent struct { // WorkflowJobEvent is triggered when a job is queued, started or completed. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_job +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_job type WorkflowJobEvent struct { WorkflowJob *WorkflowJob `json:"workflow_job,omitempty"` @@ -1675,7 +1675,7 @@ type WorkflowJobEvent struct { // WorkflowRunEvent is triggered when a GitHub Actions workflow run is requested or completed. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#workflow_run +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#workflow_run type WorkflowRunEvent struct { Action *string `json:"action,omitempty"` Workflow *Workflow `json:"workflow,omitempty"` @@ -1690,7 +1690,7 @@ type WorkflowRunEvent struct { // SecurityAdvisory represents the advisory object in SecurityAdvisoryEvent payload. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#security_advisory +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#security_advisory type SecurityAdvisory struct { CVSS *AdvisoryCVSS `json:"cvss,omitempty"` CWEs []*AdvisoryCWEs `json:"cwes,omitempty"` @@ -1740,8 +1740,8 @@ type AdvisoryVulnerability struct { FirstPatchedVersion *FirstPatchedVersion `json:"first_patched_version,omitempty"` // PatchedVersions and VulnerableFunctions are used in the following APIs: - // - https://docs.github.com/en/rest/security-advisories/repository-advisories?apiVersion=2022-11-28#list-repository-security-advisories-for-an-organization - // - https://docs.github.com/en/rest/security-advisories/repository-advisories?apiVersion=2022-11-28#list-repository-security-advisories + // - https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories-for-an-organization + // - https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories PatchedVersions *string `json:"patched_versions,omitempty"` VulnerableFunctions []string `json:"vulnerable_functions,omitempty"` } @@ -1759,7 +1759,7 @@ type FirstPatchedVersion struct { // SecurityAdvisoryEvent is triggered when a security-related vulnerability is found in software on GitHub. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#security_advisory +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#security_advisory type SecurityAdvisoryEvent struct { Action *string `json:"action,omitempty"` SecurityAdvisory *SecurityAdvisory `json:"security_advisory,omitempty"` @@ -1774,7 +1774,7 @@ type SecurityAdvisoryEvent struct { // CodeScanningAlertEvent is triggered when a code scanning finds a potential vulnerability or error in your code. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#code_scanning_alert +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#code_scanning_alert type CodeScanningAlertEvent struct { Action *string `json:"action,omitempty"` Alert *Alert `json:"alert,omitempty"` diff --git a/github/gists.go b/github/gists.go index 80961fcb908..08180c6d301 100644 --- a/github/gists.go +++ b/github/gists.go @@ -14,7 +14,7 @@ import ( // GistsService handles communication with the Gist related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/gists +// GitHub API docs: https://docs.github.com/rest/gists type GistsService service // Gist represents a GitHub's gist. @@ -96,8 +96,11 @@ type GistListOptions struct { // is authenticated, it will returns all gists for the authenticated // user. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#list-gists-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#list-gists-for-a-user +// GitHub API docs: https://docs.github.com/rest/gists/gists#list-gists-for-a-user +// GitHub API docs: https://docs.github.com/rest/gists/gists#list-gists-for-the-authenticated-user +// +//meta:operation GET /gists +//meta:operation GET /users/{username}/gists func (s *GistsService) List(ctx context.Context, user string, opts *GistListOptions) ([]*Gist, *Response, error) { var u string if user != "" { @@ -126,7 +129,9 @@ func (s *GistsService) List(ctx context.Context, user string, opts *GistListOpti // ListAll lists all public gists. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#list-public-gists +// GitHub API docs: https://docs.github.com/rest/gists/gists#list-public-gists +// +//meta:operation GET /gists/public func (s *GistsService) ListAll(ctx context.Context, opts *GistListOptions) ([]*Gist, *Response, error) { u, err := addOptions("gists/public", opts) if err != nil { @@ -149,7 +154,9 @@ func (s *GistsService) ListAll(ctx context.Context, opts *GistListOptions) ([]*G // ListStarred lists starred gists of authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#list-starred-gists +// GitHub API docs: https://docs.github.com/rest/gists/gists#list-starred-gists +// +//meta:operation GET /gists/starred func (s *GistsService) ListStarred(ctx context.Context, opts *GistListOptions) ([]*Gist, *Response, error) { u, err := addOptions("gists/starred", opts) if err != nil { @@ -172,7 +179,9 @@ func (s *GistsService) ListStarred(ctx context.Context, opts *GistListOptions) ( // Get a single gist. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#get-a-gist +// GitHub API docs: https://docs.github.com/rest/gists/gists#get-a-gist +// +//meta:operation GET /gists/{gist_id} func (s *GistsService) Get(ctx context.Context, id string) (*Gist, *Response, error) { u := fmt.Sprintf("gists/%v", id) req, err := s.client.NewRequest("GET", u, nil) @@ -191,7 +200,9 @@ func (s *GistsService) Get(ctx context.Context, id string) (*Gist, *Response, er // GetRevision gets a specific revision of a gist. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#get-a-gist-revision +// GitHub API docs: https://docs.github.com/rest/gists/gists#get-a-gist-revision +// +//meta:operation GET /gists/{gist_id}/{sha} func (s *GistsService) GetRevision(ctx context.Context, id, sha string) (*Gist, *Response, error) { u := fmt.Sprintf("gists/%v/%v", id, sha) req, err := s.client.NewRequest("GET", u, nil) @@ -210,7 +221,9 @@ func (s *GistsService) GetRevision(ctx context.Context, id, sha string) (*Gist, // Create a gist for authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#create-a-gist +// GitHub API docs: https://docs.github.com/rest/gists/gists#create-a-gist +// +//meta:operation POST /gists func (s *GistsService) Create(ctx context.Context, gist *Gist) (*Gist, *Response, error) { u := "gists" req, err := s.client.NewRequest("POST", u, gist) @@ -229,7 +242,9 @@ func (s *GistsService) Create(ctx context.Context, gist *Gist) (*Gist, *Response // Edit a gist. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#update-a-gist +// GitHub API docs: https://docs.github.com/rest/gists/gists#update-a-gist +// +//meta:operation PATCH /gists/{gist_id} func (s *GistsService) Edit(ctx context.Context, id string, gist *Gist) (*Gist, *Response, error) { u := fmt.Sprintf("gists/%v", id) req, err := s.client.NewRequest("PATCH", u, gist) @@ -248,7 +263,9 @@ func (s *GistsService) Edit(ctx context.Context, id string, gist *Gist) (*Gist, // ListCommits lists commits of a gist. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#list-gist-commits +// GitHub API docs: https://docs.github.com/rest/gists/gists#list-gist-commits +// +//meta:operation GET /gists/{gist_id}/commits func (s *GistsService) ListCommits(ctx context.Context, id string, opts *ListOptions) ([]*GistCommit, *Response, error) { u := fmt.Sprintf("gists/%v/commits", id) u, err := addOptions(u, opts) @@ -272,7 +289,9 @@ func (s *GistsService) ListCommits(ctx context.Context, id string, opts *ListOpt // Delete a gist. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#delete-a-gist +// GitHub API docs: https://docs.github.com/rest/gists/gists#delete-a-gist +// +//meta:operation DELETE /gists/{gist_id} func (s *GistsService) Delete(ctx context.Context, id string) (*Response, error) { u := fmt.Sprintf("gists/%v", id) req, err := s.client.NewRequest("DELETE", u, nil) @@ -285,7 +304,9 @@ func (s *GistsService) Delete(ctx context.Context, id string) (*Response, error) // Star a gist on behalf of authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#star-a-gist +// GitHub API docs: https://docs.github.com/rest/gists/gists#star-a-gist +// +//meta:operation PUT /gists/{gist_id}/star func (s *GistsService) Star(ctx context.Context, id string) (*Response, error) { u := fmt.Sprintf("gists/%v/star", id) req, err := s.client.NewRequest("PUT", u, nil) @@ -298,7 +319,9 @@ func (s *GistsService) Star(ctx context.Context, id string) (*Response, error) { // Unstar a gist on a behalf of authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#unstar-a-gist +// GitHub API docs: https://docs.github.com/rest/gists/gists#unstar-a-gist +// +//meta:operation DELETE /gists/{gist_id}/star func (s *GistsService) Unstar(ctx context.Context, id string) (*Response, error) { u := fmt.Sprintf("gists/%v/star", id) req, err := s.client.NewRequest("DELETE", u, nil) @@ -311,7 +334,9 @@ func (s *GistsService) Unstar(ctx context.Context, id string) (*Response, error) // IsStarred checks if a gist is starred by authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#check-if-a-gist-is-starred +// GitHub API docs: https://docs.github.com/rest/gists/gists#check-if-a-gist-is-starred +// +//meta:operation GET /gists/{gist_id}/star func (s *GistsService) IsStarred(ctx context.Context, id string) (bool, *Response, error) { u := fmt.Sprintf("gists/%v/star", id) req, err := s.client.NewRequest("GET", u, nil) @@ -326,7 +351,9 @@ func (s *GistsService) IsStarred(ctx context.Context, id string) (bool, *Respons // Fork a gist. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#fork-a-gist +// GitHub API docs: https://docs.github.com/rest/gists/gists#fork-a-gist +// +//meta:operation POST /gists/{gist_id}/forks func (s *GistsService) Fork(ctx context.Context, id string) (*Gist, *Response, error) { u := fmt.Sprintf("gists/%v/forks", id) req, err := s.client.NewRequest("POST", u, nil) @@ -345,7 +372,9 @@ func (s *GistsService) Fork(ctx context.Context, id string) (*Gist, *Response, e // ListForks lists forks of a gist. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#list-gist-forks +// GitHub API docs: https://docs.github.com/rest/gists/gists#list-gist-forks +// +//meta:operation GET /gists/{gist_id}/forks func (s *GistsService) ListForks(ctx context.Context, id string, opts *ListOptions) ([]*GistFork, *Response, error) { u := fmt.Sprintf("gists/%v/forks", id) u, err := addOptions(u, opts) diff --git a/github/gists_comments.go b/github/gists_comments.go index ee0fbfa45f8..5e0614231b8 100644 --- a/github/gists_comments.go +++ b/github/gists_comments.go @@ -25,7 +25,9 @@ func (g GistComment) String() string { // ListComments lists all comments for a gist. // -// GitHub API docs: https://docs.github.com/en/rest/gists/comments#list-gist-comments +// GitHub API docs: https://docs.github.com/rest/gists/comments#list-gist-comments +// +//meta:operation GET /gists/{gist_id}/comments func (s *GistsService) ListComments(ctx context.Context, gistID string, opts *ListOptions) ([]*GistComment, *Response, error) { u := fmt.Sprintf("gists/%v/comments", gistID) u, err := addOptions(u, opts) @@ -49,7 +51,9 @@ func (s *GistsService) ListComments(ctx context.Context, gistID string, opts *Li // GetComment retrieves a single comment from a gist. // -// GitHub API docs: https://docs.github.com/en/rest/gists/comments#get-a-gist-comment +// GitHub API docs: https://docs.github.com/rest/gists/comments#get-a-gist-comment +// +//meta:operation GET /gists/{gist_id}/comments/{comment_id} func (s *GistsService) GetComment(ctx context.Context, gistID string, commentID int64) (*GistComment, *Response, error) { u := fmt.Sprintf("gists/%v/comments/%v", gistID, commentID) req, err := s.client.NewRequest("GET", u, nil) @@ -68,7 +72,9 @@ func (s *GistsService) GetComment(ctx context.Context, gistID string, commentID // CreateComment creates a comment for a gist. // -// GitHub API docs: https://docs.github.com/en/rest/gists/comments#create-a-gist-comment +// GitHub API docs: https://docs.github.com/rest/gists/comments#create-a-gist-comment +// +//meta:operation POST /gists/{gist_id}/comments func (s *GistsService) CreateComment(ctx context.Context, gistID string, comment *GistComment) (*GistComment, *Response, error) { u := fmt.Sprintf("gists/%v/comments", gistID) req, err := s.client.NewRequest("POST", u, comment) @@ -87,7 +93,9 @@ func (s *GistsService) CreateComment(ctx context.Context, gistID string, comment // EditComment edits an existing gist comment. // -// GitHub API docs: https://docs.github.com/en/rest/gists/comments#update-a-gist-comment +// GitHub API docs: https://docs.github.com/rest/gists/comments#update-a-gist-comment +// +//meta:operation PATCH /gists/{gist_id}/comments/{comment_id} func (s *GistsService) EditComment(ctx context.Context, gistID string, commentID int64, comment *GistComment) (*GistComment, *Response, error) { u := fmt.Sprintf("gists/%v/comments/%v", gistID, commentID) req, err := s.client.NewRequest("PATCH", u, comment) @@ -106,7 +114,9 @@ func (s *GistsService) EditComment(ctx context.Context, gistID string, commentID // DeleteComment deletes a gist comment. // -// GitHub API docs: https://docs.github.com/en/rest/gists/comments#delete-a-gist-comment +// GitHub API docs: https://docs.github.com/rest/gists/comments#delete-a-gist-comment +// +//meta:operation DELETE /gists/{gist_id}/comments/{comment_id} func (s *GistsService) DeleteComment(ctx context.Context, gistID string, commentID int64) (*Response, error) { u := fmt.Sprintf("gists/%v/comments/%v", gistID, commentID) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/git.go b/github/git.go index 8960de7b14a..2ca835e1b50 100644 --- a/github/git.go +++ b/github/git.go @@ -8,5 +8,5 @@ package github // GitService handles communication with the git data related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/git/ +// GitHub API docs: https://docs.github.com/rest/git/ type GitService service diff --git a/github/git_blobs.go b/github/git_blobs.go index da0485ccbe2..d8904288896 100644 --- a/github/git_blobs.go +++ b/github/git_blobs.go @@ -23,7 +23,9 @@ type Blob struct { // GetBlob fetches a blob from a repo given a SHA. // -// GitHub API docs: https://docs.github.com/en/rest/git/blobs#get-a-blob +// GitHub API docs: https://docs.github.com/rest/git/blobs#get-a-blob +// +//meta:operation GET /repos/{owner}/{repo}/git/blobs/{file_sha} func (s *GitService) GetBlob(ctx context.Context, owner string, repo string, sha string) (*Blob, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/blobs/%v", owner, repo, sha) req, err := s.client.NewRequest("GET", u, nil) @@ -43,7 +45,9 @@ func (s *GitService) GetBlob(ctx context.Context, owner string, repo string, sha // GetBlobRaw fetches a blob's contents from a repo. // Unlike GetBlob, it returns the raw bytes rather than the base64-encoded data. // -// GitHub API docs: https://docs.github.com/en/rest/git/blobs#get-a-blob +// GitHub API docs: https://docs.github.com/rest/git/blobs#get-a-blob +// +//meta:operation GET /repos/{owner}/{repo}/git/blobs/{file_sha} func (s *GitService) GetBlobRaw(ctx context.Context, owner, repo, sha string) ([]byte, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/blobs/%v", owner, repo, sha) req, err := s.client.NewRequest("GET", u, nil) @@ -64,7 +68,9 @@ func (s *GitService) GetBlobRaw(ctx context.Context, owner, repo, sha string) ([ // CreateBlob creates a blob object. // -// GitHub API docs: https://docs.github.com/en/rest/git/blobs#create-a-blob +// GitHub API docs: https://docs.github.com/rest/git/blobs#create-a-blob +// +//meta:operation POST /repos/{owner}/{repo}/git/blobs func (s *GitService) CreateBlob(ctx context.Context, owner string, repo string, blob *Blob) (*Blob, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/blobs", owner, repo) req, err := s.client.NewRequest("POST", u, blob) diff --git a/github/git_commits.go b/github/git_commits.go index 1a683bc34c9..573d38be528 100644 --- a/github/git_commits.go +++ b/github/git_commits.go @@ -82,7 +82,9 @@ func (c CommitAuthor) String() string { // GetCommit fetches the Commit object for a given SHA. // -// GitHub API docs: https://docs.github.com/en/rest/git/commits#get-a-commit +// GitHub API docs: https://docs.github.com/rest/git/commits#get-a-commit-object +// +//meta:operation GET /repos/{owner}/{repo}/git/commits/{commit_sha} func (s *GitService) GetCommit(ctx context.Context, owner string, repo string, sha string) (*Commit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/commits/%v", owner, repo, sha) req, err := s.client.NewRequest("GET", u, nil) @@ -122,7 +124,9 @@ type CreateCommitOptions struct { // data if omitted. If the commit.Author is omitted, it will be filled in with // the authenticated user’s information and the current date. // -// GitHub API docs: https://docs.github.com/en/rest/git/commits#create-a-commit +// GitHub API docs: https://docs.github.com/rest/git/commits#create-a-commit +// +//meta:operation POST /repos/{owner}/{repo}/git/commits func (s *GitService) CreateCommit(ctx context.Context, owner string, repo string, commit *Commit, opts *CreateCommitOptions) (*Commit, *Response, error) { if commit == nil { return nil, nil, fmt.Errorf("commit must be provided") diff --git a/github/git_refs.go b/github/git_refs.go index e839c30f667..ad7b10d7d3f 100644 --- a/github/git_refs.go +++ b/github/git_refs.go @@ -49,7 +49,9 @@ type updateRefRequest struct { // GetRef fetches a single reference in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/git/refs#get-a-reference +// GitHub API docs: https://docs.github.com/rest/git/refs#get-a-reference +// +//meta:operation GET /repos/{owner}/{repo}/git/ref/{ref} func (s *GitService) GetRef(ctx context.Context, owner string, repo string, ref string) (*Reference, *Response, error) { ref = strings.TrimPrefix(ref, "refs/") u := fmt.Sprintf("repos/%v/%v/git/ref/%v", owner, repo, refURLEscape(ref)) @@ -88,7 +90,9 @@ type ReferenceListOptions struct { // ListMatchingRefs lists references in a repository that match a supplied ref. // Use an empty ref to list all references. // -// GitHub API docs: https://docs.github.com/en/rest/git/refs#list-matching-references +// GitHub API docs: https://docs.github.com/rest/git/refs#list-matching-references +// +//meta:operation GET /repos/{owner}/{repo}/git/matching-refs/{ref} func (s *GitService) ListMatchingRefs(ctx context.Context, owner, repo string, opts *ReferenceListOptions) ([]*Reference, *Response, error) { var ref string if opts != nil { @@ -116,7 +120,9 @@ func (s *GitService) ListMatchingRefs(ctx context.Context, owner, repo string, o // CreateRef creates a new ref in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/git/refs#create-a-reference +// GitHub API docs: https://docs.github.com/rest/git/refs#create-a-reference +// +//meta:operation POST /repos/{owner}/{repo}/git/refs func (s *GitService) CreateRef(ctx context.Context, owner string, repo string, ref *Reference) (*Reference, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/refs", owner, repo) req, err := s.client.NewRequest("POST", u, &createRefRequest{ @@ -139,7 +145,9 @@ func (s *GitService) CreateRef(ctx context.Context, owner string, repo string, r // UpdateRef updates an existing ref in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/git/refs#update-a-reference +// GitHub API docs: https://docs.github.com/rest/git/refs#update-a-reference +// +//meta:operation PATCH /repos/{owner}/{repo}/git/refs/{ref} func (s *GitService) UpdateRef(ctx context.Context, owner string, repo string, ref *Reference, force bool) (*Reference, *Response, error) { refPath := strings.TrimPrefix(*ref.Ref, "refs/") u := fmt.Sprintf("repos/%v/%v/git/refs/%v", owner, repo, refURLEscape(refPath)) @@ -162,7 +170,9 @@ func (s *GitService) UpdateRef(ctx context.Context, owner string, repo string, r // DeleteRef deletes a ref from a repository. // -// GitHub API docs: https://docs.github.com/en/rest/git/refs#delete-a-reference +// GitHub API docs: https://docs.github.com/rest/git/refs#delete-a-reference +// +//meta:operation DELETE /repos/{owner}/{repo}/git/refs/{ref} func (s *GitService) DeleteRef(ctx context.Context, owner string, repo string, ref string) (*Response, error) { ref = strings.TrimPrefix(ref, "refs/") u := fmt.Sprintf("repos/%v/%v/git/refs/%v", owner, repo, refURLEscape(ref)) diff --git a/github/git_tags.go b/github/git_tags.go index 30d7b2c2d23..67321566f73 100644 --- a/github/git_tags.go +++ b/github/git_tags.go @@ -35,7 +35,9 @@ type createTagRequest struct { // GetTag fetches a tag from a repo given a SHA. // -// GitHub API docs: https://docs.github.com/en/rest/git/tags#get-a-tag +// GitHub API docs: https://docs.github.com/rest/git/tags#get-a-tag +// +//meta:operation GET /repos/{owner}/{repo}/git/tags/{tag_sha} func (s *GitService) GetTag(ctx context.Context, owner string, repo string, sha string) (*Tag, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/tags/%v", owner, repo, sha) req, err := s.client.NewRequest("GET", u, nil) @@ -54,7 +56,9 @@ func (s *GitService) GetTag(ctx context.Context, owner string, repo string, sha // CreateTag creates a tag object. // -// GitHub API docs: https://docs.github.com/en/rest/git/tags#create-a-tag-object +// GitHub API docs: https://docs.github.com/rest/git/tags#create-a-tag-object +// +//meta:operation POST /repos/{owner}/{repo}/git/tags func (s *GitService) CreateTag(ctx context.Context, owner string, repo string, tag *Tag) (*Tag, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/tags", owner, repo) diff --git a/github/git_trees.go b/github/git_trees.go index db28976e032..b8eed58e136 100644 --- a/github/git_trees.go +++ b/github/git_trees.go @@ -93,7 +93,9 @@ func (t *TreeEntry) MarshalJSON() ([]byte, error) { // GetTree fetches the Tree object for a given sha hash from a repository. // -// GitHub API docs: https://docs.github.com/en/rest/git/trees#get-a-tree +// GitHub API docs: https://docs.github.com/rest/git/trees#get-a-tree +// +//meta:operation GET /repos/{owner}/{repo}/git/trees/{tree_sha} func (s *GitService) GetTree(ctx context.Context, owner string, repo string, sha string, recursive bool) (*Tree, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/trees/%v", owner, repo, sha) if recursive { @@ -124,7 +126,9 @@ type createTree struct { // path modifying that tree are specified, it will overwrite the contents of // that tree with the new path contents and write a new tree out. // -// GitHub API docs: https://docs.github.com/en/rest/git/trees#create-a-tree +// GitHub API docs: https://docs.github.com/rest/git/trees#create-a-tree +// +//meta:operation POST /repos/{owner}/{repo}/git/trees func (s *GitService) CreateTree(ctx context.Context, owner string, repo string, baseTree string, entries []*TreeEntry) (*Tree, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/trees", owner, repo) diff --git a/github/github.go b/github/github.go index 834aa86bc6a..9c1bf084d35 100644 --- a/github/github.go +++ b/github/github.go @@ -5,6 +5,7 @@ //go:generate go run gen-accessors.go //go:generate go run gen-stringify-test.go +//go:generate ../script/metadata.sh update-go package github @@ -131,10 +132,10 @@ const ( // https://developer.github.com/changes/2019-04-11-pulls-branches-for-commit/ mediaTypeListPullsOrBranchesForCommitPreview = "application/vnd.github.groot-preview+json" - // https://docs.github.com/en/rest/previews/#repository-creation-permissions + // https://docs.github.com/rest/previews/#repository-creation-permissions mediaTypeMemberAllowedRepoCreationTypePreview = "application/vnd.github.surtur-preview+json" - // https://docs.github.com/en/rest/previews/#create-and-use-repository-templates + // https://docs.github.com/rest/previews/#create-and-use-repository-templates mediaTypeRepositoryTemplatePreview = "application/vnd.github.baptiste-preview+json" // https://developer.github.com/changes/2019-10-03-multi-line-comments/ @@ -994,7 +995,7 @@ func compareHTTPResponse(r1, r2 *http.Response) bool { /* An ErrorResponse reports one or more errors caused by an API request. -GitHub API docs: https://docs.github.com/en/rest/#client-errors +GitHub API docs: https://docs.github.com/rest/#client-errors */ type ErrorResponse struct { Response *http.Response `json:"-"` // HTTP response that caused this error @@ -1004,7 +1005,7 @@ type ErrorResponse struct { Block *ErrorBlock `json:"block,omitempty"` // Most errors will also include a documentation_url field pointing // to some content that might help you resolve the error, see - // https://docs.github.com/en/rest/#client-errors + // https://docs.github.com/rest/#client-errors DocumentationURL string `json:"documentation_url,omitempty"` } @@ -1132,7 +1133,7 @@ func (ae *AcceptedError) Is(target error) bool { } // AbuseRateLimitError occurs when GitHub returns 403 Forbidden response with the -// "documentation_url" field value equal to "https://docs.github.com/en/rest/overview/resources-in-the-rest-api#secondary-rate-limits". +// "documentation_url" field value equal to "https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits". type AbuseRateLimitError struct { Response *http.Response // HTTP response that caused this error Message string `json:"message"` // error message @@ -1195,7 +1196,7 @@ GitHub error responses structure are often undocumented and inconsistent. Sometimes error is just a simple string (Issue #540). In such cases, Message represents an error message as a workaround. -GitHub API docs: https://docs.github.com/en/rest/#client-errors +GitHub API docs: https://docs.github.com/rest/#client-errors */ type Error struct { Resource string `json:"resource"` // resource on which the error occurred @@ -1309,7 +1310,7 @@ const ( // category returns the rate limit category of the endpoint, determined by HTTP method and Request.URL.Path. func category(method, path string) rateLimitCategory { switch { - // https://docs.github.com/en/rest/rate-limit#about-rate-limits + // https://docs.github.com/rest/rate-limit#about-rate-limits default: // NOTE: coreCategory is returned for actionsRunnerRegistrationCategory too, // because no API found for this category. @@ -1323,17 +1324,17 @@ func category(method, path string) rateLimitCategory { method == http.MethodPost: return integrationManifestCategory - // https://docs.github.com/en/rest/migrations/source-imports#start-an-import + // https://docs.github.com/rest/migrations/source-imports#start-an-import case strings.HasPrefix(path, "/repos/") && strings.HasSuffix(path, "/import") && method == http.MethodPut: return sourceImportCategory - // https://docs.github.com/en/rest/code-scanning#upload-an-analysis-as-sarif-data + // https://docs.github.com/rest/code-scanning#upload-an-analysis-as-sarif-data case strings.HasSuffix(path, "/code-scanning/sarifs"): return codeScanningUploadCategory - // https://docs.github.com/en/enterprise-cloud@latest/rest/scim + // https://docs.github.com/enterprise-cloud@latest/rest/scim case strings.HasPrefix(path, "/scim/"): return scimCategory } @@ -1377,7 +1378,7 @@ that need to use a higher rate limit associated with your OAuth application. This will add the client id and secret as a base64-encoded string in the format ClientID:ClientSecret and apply it as an "Authorization": "Basic" header. -See https://docs.github.com/en/rest/#unauthenticated-rate-limited-requests for +See https://docs.github.com/rest/#unauthenticated-rate-limited-requests for more information. */ type UnauthenticatedRateLimitedTransport struct { diff --git a/github/gitignore.go b/github/gitignore.go index a20a868b44a..34cf285e146 100644 --- a/github/gitignore.go +++ b/github/gitignore.go @@ -13,7 +13,7 @@ import ( // GitignoresService provides access to the gitignore related functions in the // GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/gitignore/ +// GitHub API docs: https://docs.github.com/rest/gitignore/ type GitignoresService service // Gitignore represents a .gitignore file as returned by the GitHub API. @@ -28,7 +28,9 @@ func (g Gitignore) String() string { // List all available Gitignore templates. // -// GitHub API docs: https://docs.github.com/en/rest/gitignore/#listing-available-templates +// GitHub API docs: https://docs.github.com/rest/gitignore/gitignore#get-all-gitignore-templates +// +//meta:operation GET /gitignore/templates func (s *GitignoresService) List(ctx context.Context) ([]string, *Response, error) { req, err := s.client.NewRequest("GET", "gitignore/templates", nil) if err != nil { @@ -46,7 +48,9 @@ func (s *GitignoresService) List(ctx context.Context) ([]string, *Response, erro // Get a Gitignore by name. // -// GitHub API docs: https://docs.github.com/en/rest/gitignore#get-a-gitignore-template +// GitHub API docs: https://docs.github.com/rest/gitignore/gitignore#get-a-gitignore-template +// +//meta:operation GET /gitignore/templates/{name} func (s *GitignoresService) Get(ctx context.Context, name string) (*Gitignore, *Response, error) { u := fmt.Sprintf("gitignore/templates/%v", name) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/interactions.go b/github/interactions.go index a690f61268f..2268273dd48 100644 --- a/github/interactions.go +++ b/github/interactions.go @@ -8,7 +8,7 @@ package github // InteractionsService handles communication with the repository and organization related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/interactions/ +// GitHub API docs: https://docs.github.com/rest/interactions/ type InteractionsService service // InteractionRestriction represents the interaction restrictions for repository and organization. diff --git a/github/interactions_orgs.go b/github/interactions_orgs.go index 5c7663f583d..f0ba0b15f04 100644 --- a/github/interactions_orgs.go +++ b/github/interactions_orgs.go @@ -12,7 +12,9 @@ import ( // GetRestrictionsForOrg fetches the interaction restrictions for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/interactions/orgs#get-interaction-restrictions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/interactions/orgs#get-interaction-restrictions-for-an-organization +// +//meta:operation GET /orgs/{org}/interaction-limits func (s *InteractionsService) GetRestrictionsForOrg(ctx context.Context, organization string) (*InteractionRestriction, *Response, error) { u := fmt.Sprintf("orgs/%v/interaction-limits", organization) req, err := s.client.NewRequest("GET", u, nil) @@ -39,7 +41,9 @@ func (s *InteractionsService) GetRestrictionsForOrg(ctx context.Context, organiz // in public repositories for the given organization. // Possible values are: "existing_users", "contributors_only", "collaborators_only". // -// GitHub API docs: https://docs.github.com/en/rest/interactions/orgs#set-interaction-restrictions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/interactions/orgs#set-interaction-restrictions-for-an-organization +// +//meta:operation PUT /orgs/{org}/interaction-limits func (s *InteractionsService) UpdateRestrictionsForOrg(ctx context.Context, organization, limit string) (*InteractionRestriction, *Response, error) { u := fmt.Sprintf("orgs/%v/interaction-limits", organization) @@ -65,7 +69,9 @@ func (s *InteractionsService) UpdateRestrictionsForOrg(ctx context.Context, orga // RemoveRestrictionsFromOrg removes the interaction restrictions for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/interactions/orgs#remove-interaction-restrictions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/interactions/orgs#remove-interaction-restrictions-for-an-organization +// +//meta:operation DELETE /orgs/{org}/interaction-limits func (s *InteractionsService) RemoveRestrictionsFromOrg(ctx context.Context, organization string) (*Response, error) { u := fmt.Sprintf("orgs/%v/interaction-limits", organization) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/interactions_repos.go b/github/interactions_repos.go index 41e6c5319d0..9c044badd19 100644 --- a/github/interactions_repos.go +++ b/github/interactions_repos.go @@ -12,7 +12,9 @@ import ( // GetRestrictionsForRepo fetches the interaction restrictions for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/interactions/repos#get-interaction-restrictions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/interactions/repos#get-interaction-restrictions-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/interaction-limits func (s *InteractionsService) GetRestrictionsForRepo(ctx context.Context, owner, repo string) (*InteractionRestriction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/interaction-limits", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -39,7 +41,9 @@ func (s *InteractionsService) GetRestrictionsForRepo(ctx context.Context, owner, // for the given repository. // Possible values are: "existing_users", "contributors_only", "collaborators_only". // -// GitHub API docs: https://docs.github.com/en/rest/interactions/repos#set-interaction-restrictions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/interactions/repos#set-interaction-restrictions-for-a-repository +// +//meta:operation PUT /repos/{owner}/{repo}/interaction-limits func (s *InteractionsService) UpdateRestrictionsForRepo(ctx context.Context, owner, repo, limit string) (*InteractionRestriction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/interaction-limits", owner, repo) @@ -65,7 +69,9 @@ func (s *InteractionsService) UpdateRestrictionsForRepo(ctx context.Context, own // RemoveRestrictionsFromRepo removes the interaction restrictions for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/interactions/repos#remove-interaction-restrictions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/interactions/repos#remove-interaction-restrictions-for-a-repository +// +//meta:operation DELETE /repos/{owner}/{repo}/interaction-limits func (s *InteractionsService) RemoveRestrictionsFromRepo(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/interaction-limits", owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/issue_import.go b/github/issue_import.go index 04899772bd1..4f06371085e 100644 --- a/github/issue_import.go +++ b/github/issue_import.go @@ -70,7 +70,9 @@ type IssueImportError struct { // Create a new imported issue on the specified repository. // -// https://gist.github.com/jonmagic/5282384165e0f86ef105#start-an-issue-import +// GitHub API docs: https://gist.github.com/jonmagic/5282384165e0f86ef105#start-an-issue-import +// +//meta:operation POST /repos/{owner}/{repo}/import/issues func (s *IssueImportService) Create(ctx context.Context, owner, repo string, issue *IssueImportRequest) (*IssueImportResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/issues", owner, repo) req, err := s.client.NewRequest("POST", u, issue) @@ -99,7 +101,9 @@ func (s *IssueImportService) Create(ctx context.Context, owner, repo string, iss // CheckStatus checks the status of an imported issue. // -// https://gist.github.com/jonmagic/5282384165e0f86ef105#import-status-request +// GitHub API docs: https://gist.github.com/jonmagic/5282384165e0f86ef105#import-status-request +// +//meta:operation GET /repos/{owner}/{repo}/import/issues/{issue_number} func (s *IssueImportService) CheckStatus(ctx context.Context, owner, repo string, issueID int64) (*IssueImportResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/issues/%v", owner, repo, issueID) req, err := s.client.NewRequest("GET", u, nil) @@ -121,7 +125,9 @@ func (s *IssueImportService) CheckStatus(ctx context.Context, owner, repo string // CheckStatusSince checks the status of multiple imported issues since a given date. // -// https://gist.github.com/jonmagic/5282384165e0f86ef105#check-status-of-multiple-issues +// GitHub API docs: https://gist.github.com/jonmagic/5282384165e0f86ef105#check-status-of-multiple-issues +// +//meta:operation GET /repos/{owner}/{repo}/import/issues func (s *IssueImportService) CheckStatusSince(ctx context.Context, owner, repo string, since Timestamp) ([]*IssueImportResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/issues?since=%v", owner, repo, since.Format("2006-01-02")) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/issues.go b/github/issues.go index 44364811d3f..1db99328b51 100644 --- a/github/issues.go +++ b/github/issues.go @@ -14,7 +14,7 @@ import ( // IssuesService handles communication with the issue related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/issues/ +// GitHub API docs: https://docs.github.com/rest/issues/ type IssuesService service // Issue represents a GitHub issue on a repository. @@ -56,7 +56,7 @@ type Issue struct { NodeID *string `json:"node_id,omitempty"` // TextMatches is only populated from search results that request text matches - // See: search.go and https://docs.github.com/en/rest/search/#text-match-metadata + // See: search.go and https://docs.github.com/rest/search/#text-match-metadata TextMatches []*TextMatch `json:"text_matches,omitempty"` // ActiveLockReason is populated only when LockReason is provided while locking the issue. @@ -132,8 +132,11 @@ type PullRequestLinks struct { // organization repositories; if false, list only owned and member // repositories. // -// GitHub API docs: https://docs.github.com/en/rest/issues/issues#list-user-account-issues-assigned-to-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/issues/issues#list-issues-assigned-to-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/issues/issues#list-issues-assigned-to-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/issues/issues#list-user-account-issues-assigned-to-the-authenticated-user +// +//meta:operation GET /issues +//meta:operation GET /user/issues func (s *IssuesService) List(ctx context.Context, all bool, opts *IssueListOptions) ([]*Issue, *Response, error) { var u string if all { @@ -147,7 +150,9 @@ func (s *IssuesService) List(ctx context.Context, all bool, opts *IssueListOptio // ListByOrg fetches the issues in the specified organization for the // authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/issues/issues#list-organization-issues-assigned-to-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/issues/issues#list-organization-issues-assigned-to-the-authenticated-user +// +//meta:operation GET /orgs/{org}/issues func (s *IssuesService) ListByOrg(ctx context.Context, org string, opts *IssueListOptions) ([]*Issue, *Response, error) { u := fmt.Sprintf("orgs/%v/issues", org) return s.listIssues(ctx, u, opts) @@ -218,7 +223,9 @@ type IssueListByRepoOptions struct { // ListByRepo lists the issues for the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/issues/issues#list-repository-issues +// GitHub API docs: https://docs.github.com/rest/issues/issues#list-repository-issues +// +//meta:operation GET /repos/{owner}/{repo}/issues func (s *IssuesService) ListByRepo(ctx context.Context, owner string, repo string, opts *IssueListByRepoOptions) ([]*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues", owner, repo) u, err := addOptions(u, opts) @@ -245,7 +252,9 @@ func (s *IssuesService) ListByRepo(ctx context.Context, owner string, repo strin // Get a single issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/issues#get-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/issues#get-an-issue +// +//meta:operation GET /repos/{owner}/{repo}/issues/{issue_number} func (s *IssuesService) Get(ctx context.Context, owner string, repo string, number int) (*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d", owner, repo, number) req, err := s.client.NewRequest("GET", u, nil) @@ -267,7 +276,9 @@ func (s *IssuesService) Get(ctx context.Context, owner string, repo string, numb // Create a new issue on the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/issues/issues#create-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/issues#create-an-issue +// +//meta:operation POST /repos/{owner}/{repo}/issues func (s *IssuesService) Create(ctx context.Context, owner string, repo string, issue *IssueRequest) (*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues", owner, repo) req, err := s.client.NewRequest("POST", u, issue) @@ -286,7 +297,9 @@ func (s *IssuesService) Create(ctx context.Context, owner string, repo string, i // Edit (update) an issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/issues#update-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/issues#update-an-issue +// +//meta:operation PATCH /repos/{owner}/{repo}/issues/{issue_number} func (s *IssuesService) Edit(ctx context.Context, owner string, repo string, number int, issue *IssueRequest) (*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d", owner, repo, number) req, err := s.client.NewRequest("PATCH", u, issue) @@ -307,7 +320,9 @@ func (s *IssuesService) Edit(ctx context.Context, owner string, repo string, num // // This is a helper method to explicitly update an issue with a `null` milestone, thereby removing it. // -// GitHub API docs: https://docs.github.com/en/rest/issues/issues#update-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/issues#update-an-issue +// +//meta:operation PATCH /repos/{owner}/{repo}/issues/{issue_number} func (s *IssuesService) RemoveMilestone(ctx context.Context, owner, repo string, issueNumber int) (*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v", owner, repo, issueNumber) req, err := s.client.NewRequest("PATCH", u, &struct { @@ -337,7 +352,9 @@ type LockIssueOptions struct { // Lock an issue's conversation. // -// GitHub API docs: https://docs.github.com/en/rest/issues/issues#lock-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/issues#lock-an-issue +// +//meta:operation PUT /repos/{owner}/{repo}/issues/{issue_number}/lock func (s *IssuesService) Lock(ctx context.Context, owner string, repo string, number int, opts *LockIssueOptions) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/lock", owner, repo, number) req, err := s.client.NewRequest("PUT", u, opts) @@ -350,7 +367,9 @@ func (s *IssuesService) Lock(ctx context.Context, owner string, repo string, num // Unlock an issue's conversation. // -// GitHub API docs: https://docs.github.com/en/rest/issues/issues#unlock-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/issues#unlock-an-issue +// +//meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock func (s *IssuesService) Unlock(ctx context.Context, owner string, repo string, number int) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/lock", owner, repo, number) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/issues_assignees.go b/github/issues_assignees.go index b7f2e802437..fd065771ed3 100644 --- a/github/issues_assignees.go +++ b/github/issues_assignees.go @@ -13,7 +13,9 @@ import ( // ListAssignees fetches all available assignees (owners and collaborators) to // which issues may be assigned. // -// GitHub API docs: https://docs.github.com/en/rest/issues/assignees#list-assignees +// GitHub API docs: https://docs.github.com/rest/issues/assignees#list-assignees +// +//meta:operation GET /repos/{owner}/{repo}/assignees func (s *IssuesService) ListAssignees(ctx context.Context, owner, repo string, opts *ListOptions) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%v/%v/assignees", owner, repo) u, err := addOptions(u, opts) @@ -37,7 +39,9 @@ func (s *IssuesService) ListAssignees(ctx context.Context, owner, repo string, o // IsAssignee checks if a user is an assignee for the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/issues/assignees#check-if-a-user-can-be-assigned +// GitHub API docs: https://docs.github.com/rest/issues/assignees#check-if-a-user-can-be-assigned +// +//meta:operation GET /repos/{owner}/{repo}/assignees/{assignee} func (s *IssuesService) IsAssignee(ctx context.Context, owner, repo, user string) (bool, *Response, error) { u := fmt.Sprintf("repos/%v/%v/assignees/%v", owner, repo, user) req, err := s.client.NewRequest("GET", u, nil) @@ -52,7 +56,9 @@ func (s *IssuesService) IsAssignee(ctx context.Context, owner, repo, user string // AddAssignees adds the provided GitHub users as assignees to the issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/assignees#add-assignees-to-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/assignees#add-assignees-to-an-issue +// +//meta:operation POST /repos/{owner}/{repo}/issues/{issue_number}/assignees func (s *IssuesService) AddAssignees(ctx context.Context, owner, repo string, number int, assignees []string) (*Issue, *Response, error) { users := &struct { Assignees []string `json:"assignees,omitempty"` @@ -74,7 +80,9 @@ func (s *IssuesService) AddAssignees(ctx context.Context, owner, repo string, nu // RemoveAssignees removes the provided GitHub users as assignees from the issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/assignees#remove-assignees-from-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/assignees#remove-assignees-from-an-issue +// +//meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees func (s *IssuesService) RemoveAssignees(ctx context.Context, owner, repo string, number int, assignees []string) (*Issue, *Response, error) { users := &struct { Assignees []string `json:"assignees,omitempty"` diff --git a/github/issues_comments.go b/github/issues_comments.go index 17881c093dc..74a4e60f7ca 100644 --- a/github/issues_comments.go +++ b/github/issues_comments.go @@ -50,8 +50,11 @@ type IssueListCommentsOptions struct { // ListComments lists all comments on the specified issue. Specifying an issue // number of 0 will return all comments on all issues for the repository. // -// GitHub API docs: https://docs.github.com/en/rest/issues/comments#list-issue-comments -// GitHub API docs: https://docs.github.com/en/rest/issues/comments#list-issue-comments-for-a-repository +// GitHub API docs: https://docs.github.com/rest/issues/comments#list-issue-comments +// GitHub API docs: https://docs.github.com/rest/issues/comments#list-issue-comments-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/issues/comments +//meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/comments func (s *IssuesService) ListComments(ctx context.Context, owner string, repo string, number int, opts *IssueListCommentsOptions) ([]*IssueComment, *Response, error) { var u string if number == 0 { @@ -83,7 +86,9 @@ func (s *IssuesService) ListComments(ctx context.Context, owner string, repo str // GetComment fetches the specified issue comment. // -// GitHub API docs: https://docs.github.com/en/rest/issues/comments#get-an-issue-comment +// GitHub API docs: https://docs.github.com/rest/issues/comments#get-an-issue-comment +// +//meta:operation GET /repos/{owner}/{repo}/issues/comments/{comment_id} func (s *IssuesService) GetComment(ctx context.Context, owner string, repo string, commentID int64) (*IssueComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%d", owner, repo, commentID) @@ -106,7 +111,9 @@ func (s *IssuesService) GetComment(ctx context.Context, owner string, repo strin // CreateComment creates a new comment on the specified issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/comments#create-an-issue-comment +// GitHub API docs: https://docs.github.com/rest/issues/comments#create-an-issue-comment +// +//meta:operation POST /repos/{owner}/{repo}/issues/{issue_number}/comments func (s *IssuesService) CreateComment(ctx context.Context, owner string, repo string, number int, comment *IssueComment) (*IssueComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/comments", owner, repo, number) req, err := s.client.NewRequest("POST", u, comment) @@ -125,7 +132,9 @@ func (s *IssuesService) CreateComment(ctx context.Context, owner string, repo st // EditComment updates an issue comment. // A non-nil comment.Body must be provided. Other comment fields should be left nil. // -// GitHub API docs: https://docs.github.com/en/rest/issues/comments#update-an-issue-comment +// GitHub API docs: https://docs.github.com/rest/issues/comments#update-an-issue-comment +// +//meta:operation PATCH /repos/{owner}/{repo}/issues/comments/{comment_id} func (s *IssuesService) EditComment(ctx context.Context, owner string, repo string, commentID int64, comment *IssueComment) (*IssueComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%d", owner, repo, commentID) req, err := s.client.NewRequest("PATCH", u, comment) @@ -143,7 +152,9 @@ func (s *IssuesService) EditComment(ctx context.Context, owner string, repo stri // DeleteComment deletes an issue comment. // -// GitHub API docs: https://docs.github.com/en/rest/issues/comments#delete-an-issue-comment +// GitHub API docs: https://docs.github.com/rest/issues/comments#delete-an-issue-comment +// +//meta:operation DELETE /repos/{owner}/{repo}/issues/comments/{comment_id} func (s *IssuesService) DeleteComment(ctx context.Context, owner string, repo string, commentID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%d", owner, repo, commentID) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/issues_events.go b/github/issues_events.go index 0305fca1168..23a16bcdc72 100644 --- a/github/issues_events.go +++ b/github/issues_events.go @@ -101,7 +101,9 @@ type DismissedReview struct { // ListIssueEvents lists events for the specified issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/events#list-issue-events +// GitHub API docs: https://docs.github.com/rest/issues/events#list-issue-events +// +//meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/events func (s *IssuesService) ListIssueEvents(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*IssueEvent, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/events", owner, repo, number) u, err := addOptions(u, opts) @@ -127,7 +129,9 @@ func (s *IssuesService) ListIssueEvents(ctx context.Context, owner, repo string, // ListRepositoryEvents lists events for the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/issues/events#list-issue-events-for-a-repository +// GitHub API docs: https://docs.github.com/rest/issues/events#list-issue-events-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/issues/events func (s *IssuesService) ListRepositoryEvents(ctx context.Context, owner, repo string, opts *ListOptions) ([]*IssueEvent, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/events", owner, repo) u, err := addOptions(u, opts) @@ -151,7 +155,9 @@ func (s *IssuesService) ListRepositoryEvents(ctx context.Context, owner, repo st // GetEvent returns the specified issue event. // -// GitHub API docs: https://docs.github.com/en/rest/issues/events#get-an-issue-event +// GitHub API docs: https://docs.github.com/rest/issues/events#get-an-issue-event +// +//meta:operation GET /repos/{owner}/{repo}/issues/events/{event_id} func (s *IssuesService) GetEvent(ctx context.Context, owner, repo string, id int64) (*IssueEvent, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/events/%v", owner, repo, id) diff --git a/github/issues_labels.go b/github/issues_labels.go index d0f865c03f1..51e7fe6a55b 100644 --- a/github/issues_labels.go +++ b/github/issues_labels.go @@ -27,7 +27,9 @@ func (l Label) String() string { // ListLabels lists all labels for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/issues/labels#list-labels-for-a-repository +// GitHub API docs: https://docs.github.com/rest/issues/labels#list-labels-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/labels func (s *IssuesService) ListLabels(ctx context.Context, owner string, repo string, opts *ListOptions) ([]*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/labels", owner, repo) u, err := addOptions(u, opts) @@ -51,7 +53,9 @@ func (s *IssuesService) ListLabels(ctx context.Context, owner string, repo strin // GetLabel gets a single label. // -// GitHub API docs: https://docs.github.com/en/rest/issues/labels#get-a-label +// GitHub API docs: https://docs.github.com/rest/issues/labels#get-a-label +// +//meta:operation GET /repos/{owner}/{repo}/labels/{name} func (s *IssuesService) GetLabel(ctx context.Context, owner string, repo string, name string) (*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/labels/%v", owner, repo, name) req, err := s.client.NewRequest("GET", u, nil) @@ -70,7 +74,9 @@ func (s *IssuesService) GetLabel(ctx context.Context, owner string, repo string, // CreateLabel creates a new label on the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/issues/labels#create-a-label +// GitHub API docs: https://docs.github.com/rest/issues/labels#create-a-label +// +//meta:operation POST /repos/{owner}/{repo}/labels func (s *IssuesService) CreateLabel(ctx context.Context, owner string, repo string, label *Label) (*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/labels", owner, repo) req, err := s.client.NewRequest("POST", u, label) @@ -89,7 +95,9 @@ func (s *IssuesService) CreateLabel(ctx context.Context, owner string, repo stri // EditLabel edits a label. // -// GitHub API docs: https://docs.github.com/en/rest/issues/labels#update-a-label +// GitHub API docs: https://docs.github.com/rest/issues/labels#update-a-label +// +//meta:operation PATCH /repos/{owner}/{repo}/labels/{name} func (s *IssuesService) EditLabel(ctx context.Context, owner string, repo string, name string, label *Label) (*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/labels/%v", owner, repo, name) req, err := s.client.NewRequest("PATCH", u, label) @@ -108,7 +116,9 @@ func (s *IssuesService) EditLabel(ctx context.Context, owner string, repo string // DeleteLabel deletes a label. // -// GitHub API docs: https://docs.github.com/en/rest/issues/labels#delete-a-label +// GitHub API docs: https://docs.github.com/rest/issues/labels#delete-a-label +// +//meta:operation DELETE /repos/{owner}/{repo}/labels/{name} func (s *IssuesService) DeleteLabel(ctx context.Context, owner string, repo string, name string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/labels/%v", owner, repo, name) req, err := s.client.NewRequest("DELETE", u, nil) @@ -120,7 +130,9 @@ func (s *IssuesService) DeleteLabel(ctx context.Context, owner string, repo stri // ListLabelsByIssue lists all labels for an issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/labels#list-labels-for-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/labels#list-labels-for-an-issue +// +//meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/labels func (s *IssuesService) ListLabelsByIssue(ctx context.Context, owner string, repo string, number int, opts *ListOptions) ([]*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/labels", owner, repo, number) u, err := addOptions(u, opts) @@ -144,7 +156,9 @@ func (s *IssuesService) ListLabelsByIssue(ctx context.Context, owner string, rep // AddLabelsToIssue adds labels to an issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/labels#add-labels-to-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/labels#add-labels-to-an-issue +// +//meta:operation POST /repos/{owner}/{repo}/issues/{issue_number}/labels func (s *IssuesService) AddLabelsToIssue(ctx context.Context, owner string, repo string, number int, labels []string) ([]*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/labels", owner, repo, number) req, err := s.client.NewRequest("POST", u, labels) @@ -163,7 +177,9 @@ func (s *IssuesService) AddLabelsToIssue(ctx context.Context, owner string, repo // RemoveLabelForIssue removes a label for an issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/labels#remove-a-label-from-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/labels#remove-a-label-from-an-issue +// +//meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name} func (s *IssuesService) RemoveLabelForIssue(ctx context.Context, owner string, repo string, number int, label string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/labels/%v", owner, repo, number, label) req, err := s.client.NewRequest("DELETE", u, nil) @@ -176,7 +192,9 @@ func (s *IssuesService) RemoveLabelForIssue(ctx context.Context, owner string, r // ReplaceLabelsForIssue replaces all labels for an issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/labels#set-labels-for-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/labels#set-labels-for-an-issue +// +//meta:operation PUT /repos/{owner}/{repo}/issues/{issue_number}/labels func (s *IssuesService) ReplaceLabelsForIssue(ctx context.Context, owner string, repo string, number int, labels []string) ([]*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/labels", owner, repo, number) req, err := s.client.NewRequest("PUT", u, labels) @@ -195,7 +213,9 @@ func (s *IssuesService) ReplaceLabelsForIssue(ctx context.Context, owner string, // RemoveLabelsForIssue removes all labels for an issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/labels#remove-all-labels-from-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/labels#remove-all-labels-from-an-issue +// +//meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels func (s *IssuesService) RemoveLabelsForIssue(ctx context.Context, owner string, repo string, number int) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/labels", owner, repo, number) req, err := s.client.NewRequest("DELETE", u, nil) @@ -208,7 +228,9 @@ func (s *IssuesService) RemoveLabelsForIssue(ctx context.Context, owner string, // ListLabelsForMilestone lists labels for every issue in a milestone. // -// GitHub API docs: https://docs.github.com/en/rest/issues/labels#list-labels-for-issues-in-a-milestone +// GitHub API docs: https://docs.github.com/rest/issues/labels#list-labels-for-issues-in-a-milestone +// +//meta:operation GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels func (s *IssuesService) ListLabelsForMilestone(ctx context.Context, owner string, repo string, number int, opts *ListOptions) ([]*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones/%d/labels", owner, repo, number) u, err := addOptions(u, opts) diff --git a/github/issues_milestones.go b/github/issues_milestones.go index 897c7c0b6da..6c31bcd054d 100644 --- a/github/issues_milestones.go +++ b/github/issues_milestones.go @@ -54,7 +54,9 @@ type MilestoneListOptions struct { // ListMilestones lists all milestones for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/issues/milestones#list-milestones +// GitHub API docs: https://docs.github.com/rest/issues/milestones#list-milestones +// +//meta:operation GET /repos/{owner}/{repo}/milestones func (s *IssuesService) ListMilestones(ctx context.Context, owner string, repo string, opts *MilestoneListOptions) ([]*Milestone, *Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones", owner, repo) u, err := addOptions(u, opts) @@ -78,7 +80,9 @@ func (s *IssuesService) ListMilestones(ctx context.Context, owner string, repo s // GetMilestone gets a single milestone. // -// GitHub API docs: https://docs.github.com/en/rest/issues/milestones#get-a-milestone +// GitHub API docs: https://docs.github.com/rest/issues/milestones#get-a-milestone +// +//meta:operation GET /repos/{owner}/{repo}/milestones/{milestone_number} func (s *IssuesService) GetMilestone(ctx context.Context, owner string, repo string, number int) (*Milestone, *Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones/%d", owner, repo, number) req, err := s.client.NewRequest("GET", u, nil) @@ -97,7 +101,9 @@ func (s *IssuesService) GetMilestone(ctx context.Context, owner string, repo str // CreateMilestone creates a new milestone on the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/issues/milestones#create-a-milestone +// GitHub API docs: https://docs.github.com/rest/issues/milestones#create-a-milestone +// +//meta:operation POST /repos/{owner}/{repo}/milestones func (s *IssuesService) CreateMilestone(ctx context.Context, owner string, repo string, milestone *Milestone) (*Milestone, *Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones", owner, repo) req, err := s.client.NewRequest("POST", u, milestone) @@ -116,7 +122,9 @@ func (s *IssuesService) CreateMilestone(ctx context.Context, owner string, repo // EditMilestone edits a milestone. // -// GitHub API docs: https://docs.github.com/en/rest/issues/milestones#update-a-milestone +// GitHub API docs: https://docs.github.com/rest/issues/milestones#update-a-milestone +// +//meta:operation PATCH /repos/{owner}/{repo}/milestones/{milestone_number} func (s *IssuesService) EditMilestone(ctx context.Context, owner string, repo string, number int, milestone *Milestone) (*Milestone, *Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones/%d", owner, repo, number) req, err := s.client.NewRequest("PATCH", u, milestone) @@ -135,7 +143,9 @@ func (s *IssuesService) EditMilestone(ctx context.Context, owner string, repo st // DeleteMilestone deletes a milestone. // -// GitHub API docs: https://docs.github.com/en/rest/issues/milestones#delete-a-milestone +// GitHub API docs: https://docs.github.com/rest/issues/milestones#delete-a-milestone +// +//meta:operation DELETE /repos/{owner}/{repo}/milestones/{milestone_number} func (s *IssuesService) DeleteMilestone(ctx context.Context, owner string, repo string, number int) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones/%d", owner, repo, number) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/issues_timeline.go b/github/issues_timeline.go index 8ac02ac14dc..0aa589afe40 100644 --- a/github/issues_timeline.go +++ b/github/issues_timeline.go @@ -14,7 +14,7 @@ import ( // Timeline represents an event that occurred around an Issue or Pull Request. // // It is similar to an IssueEvent but may contain more information. -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/events/issue-event-types +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/events/issue-event-types type Timeline struct { ID *int64 `json:"id,omitempty"` URL *string `json:"url,omitempty"` @@ -166,7 +166,9 @@ type Source struct { // ListIssueTimeline lists events for the specified issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/timeline#list-timeline-events-for-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/timeline#list-timeline-events-for-an-issue +// +//meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/timeline func (s *IssuesService) ListIssueTimeline(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*Timeline, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/timeline", owner, repo, number) u, err := addOptions(u, opts) diff --git a/github/licenses.go b/github/licenses.go index 0877b6d1831..34b8a3d8af1 100644 --- a/github/licenses.go +++ b/github/licenses.go @@ -13,7 +13,7 @@ import ( // LicensesService handles communication with the license related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/licenses/ +// GitHub API docs: https://docs.github.com/rest/licenses/ type LicensesService service // RepositoryLicense represents the license for a repository. @@ -60,7 +60,9 @@ func (l License) String() string { // List popular open source licenses. // -// GitHub API docs: https://docs.github.com/en/rest/licenses/#list-all-licenses +// GitHub API docs: https://docs.github.com/rest/licenses/licenses#get-all-commonly-used-licenses +// +//meta:operation GET /licenses func (s *LicensesService) List(ctx context.Context) ([]*License, *Response, error) { req, err := s.client.NewRequest("GET", "licenses", nil) if err != nil { @@ -78,7 +80,9 @@ func (s *LicensesService) List(ctx context.Context) ([]*License, *Response, erro // Get extended metadata for one license. // -// GitHub API docs: https://docs.github.com/en/rest/licenses#get-a-license +// GitHub API docs: https://docs.github.com/rest/licenses/licenses#get-a-license +// +//meta:operation GET /licenses/{license} func (s *LicensesService) Get(ctx context.Context, licenseName string) (*License, *Response, error) { u := fmt.Sprintf("licenses/%s", licenseName) diff --git a/github/markdown.go b/github/markdown.go index 48b445b3d85..fe3b31128d5 100644 --- a/github/markdown.go +++ b/github/markdown.go @@ -41,6 +41,8 @@ type markdownRenderRequest struct { // Render renders an arbitrary Render document. // // GitHub API docs: https://docs.github.com/rest/markdown/markdown#render-a-markdown-document +// +//meta:operation POST /markdown func (s *MarkdownService) Render(ctx context.Context, text string, opts *MarkdownOptions) (string, *Response, error) { request := &markdownRenderRequest{Text: String(text)} if opts != nil { diff --git a/github/messages.go b/github/messages.go index 0d9811549c2..72edbd9feef 100644 --- a/github/messages.go +++ b/github/messages.go @@ -281,14 +281,14 @@ func ValidateSignature(signature string, payload, secretToken []byte) error { // WebHookType returns the event type of webhook request r. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/events/github-event-types +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/events/github-event-types func WebHookType(r *http.Request) string { return r.Header.Get(EventTypeHeader) } // DeliveryID returns the unique delivery ID of webhook request r. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/events/github-event-types +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/events/github-event-types func DeliveryID(r *http.Request) string { return r.Header.Get(DeliveryIDHeader) } diff --git a/github/meta.go b/github/meta.go index 3e9743b00cb..1da8fcf1326 100644 --- a/github/meta.go +++ b/github/meta.go @@ -72,6 +72,8 @@ type APIMeta struct { // endpoint provides information about that installation. // // GitHub API docs: https://docs.github.com/rest/meta/meta#get-github-meta-information +// +//meta:operation GET /meta func (s *MetaService) Get(ctx context.Context) (*APIMeta, *Response, error) { req, err := s.client.NewRequest("GET", "meta", nil) if err != nil { @@ -98,6 +100,8 @@ func (c *Client) APIMeta(ctx context.Context) (*APIMeta, *Response, error) { // bubble. If message is empty, a random zen phrase is used. // // GitHub API docs: https://docs.github.com/rest/meta/meta#get-octocat +// +//meta:operation GET /octocat func (s *MetaService) Octocat(ctx context.Context, message string) (string, *Response, error) { u := "octocat" if message != "" { @@ -131,6 +135,8 @@ func (c *Client) Octocat(ctx context.Context, message string) (string, *Response // See also: http://warpspire.com/posts/taste/ // // GitHub API docs: https://docs.github.com/rest/meta/meta#get-the-zen-of-github +// +//meta:operation GET /zen func (s *MetaService) Zen(ctx context.Context) (string, *Response, error) { req, err := s.client.NewRequest("GET", "zen", nil) if err != nil { diff --git a/github/migrations.go b/github/migrations.go index 67989c0789f..5af8817050f 100644 --- a/github/migrations.go +++ b/github/migrations.go @@ -16,7 +16,7 @@ import ( // MigrationService provides access to the migration related functions // in the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/migration/ +// GitHub API docs: https://docs.github.com/rest/migration/ type MigrationService service // Migration represents a GitHub migration (archival). @@ -74,7 +74,9 @@ type startMigration struct { // StartMigration starts the generation of a migration archive. // repos is a slice of repository names to migrate. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/orgs#start-an-organization-migration +// GitHub API docs: https://docs.github.com/rest/migrations/orgs#start-an-organization-migration +// +//meta:operation POST /orgs/{org}/migrations func (s *MigrationService) StartMigration(ctx context.Context, org string, repos []string, opts *MigrationOptions) (*Migration, *Response, error) { u := fmt.Sprintf("orgs/%v/migrations", org) @@ -103,7 +105,9 @@ func (s *MigrationService) StartMigration(ctx context.Context, org string, repos // ListMigrations lists the most recent migrations. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/orgs#list-organization-migrations +// GitHub API docs: https://docs.github.com/rest/migrations/orgs#list-organization-migrations +// +//meta:operation GET /orgs/{org}/migrations func (s *MigrationService) ListMigrations(ctx context.Context, org string, opts *ListOptions) ([]*Migration, *Response, error) { u := fmt.Sprintf("orgs/%v/migrations", org) u, err := addOptions(u, opts) @@ -131,7 +135,9 @@ func (s *MigrationService) ListMigrations(ctx context.Context, org string, opts // MigrationStatus gets the status of a specific migration archive. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/orgs#get-an-organization-migration-status +// GitHub API docs: https://docs.github.com/rest/migrations/orgs#get-an-organization-migration-status +// +//meta:operation GET /orgs/{org}/migrations/{migration_id} func (s *MigrationService) MigrationStatus(ctx context.Context, org string, id int64) (*Migration, *Response, error) { u := fmt.Sprintf("orgs/%v/migrations/%v", org, id) @@ -155,7 +161,9 @@ func (s *MigrationService) MigrationStatus(ctx context.Context, org string, id i // MigrationArchiveURL fetches a migration archive URL. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/orgs#download-an-organization-migration-archive +// GitHub API docs: https://docs.github.com/rest/migrations/orgs#download-an-organization-migration-archive +// +//meta:operation GET /orgs/{org}/migrations/{migration_id}/archive func (s *MigrationService) MigrationArchiveURL(ctx context.Context, org string, id int64) (url string, err error) { u := fmt.Sprintf("orgs/%v/migrations/%v/archive", org, id) @@ -192,7 +200,9 @@ func (s *MigrationService) MigrationArchiveURL(ctx context.Context, org string, // DeleteMigration deletes a previous migration archive. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/orgs#delete-an-organization-migration-archive +// GitHub API docs: https://docs.github.com/rest/migrations/orgs#delete-an-organization-migration-archive +// +//meta:operation DELETE /orgs/{org}/migrations/{migration_id}/archive func (s *MigrationService) DeleteMigration(ctx context.Context, org string, id int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/migrations/%v/archive", org, id) @@ -212,7 +222,9 @@ func (s *MigrationService) DeleteMigration(ctx context.Context, org string, id i // You should unlock each migrated repository and delete them when the migration // is complete and you no longer need the source data. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/orgs#unlock-an-organization-repository +// GitHub API docs: https://docs.github.com/rest/migrations/orgs#unlock-an-organization-repository +// +//meta:operation DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock func (s *MigrationService) UnlockRepo(ctx context.Context, org string, id int64, repo string) (*Response, error) { u := fmt.Sprintf("orgs/%v/migrations/%v/repos/%v/lock", org, id, repo) diff --git a/github/migrations_source_import.go b/github/migrations_source_import.go index 74a04b22a4e..3b161232f6a 100644 --- a/github/migrations_source_import.go +++ b/github/migrations_source_import.go @@ -115,7 +115,7 @@ func (i Import) String() string { // SourceImportAuthor identifies an author imported from a source repository. // -// GitHub API docs: https://docs.github.com/en/rest/migration/source_imports/#get-commit-authors +// GitHub API docs: https://docs.github.com/rest/migration/source_imports/#get-commit-authors type SourceImportAuthor struct { ID *int64 `json:"id,omitempty"` RemoteID *string `json:"remote_id,omitempty"` @@ -132,7 +132,7 @@ func (a SourceImportAuthor) String() string { // LargeFile identifies a file larger than 100MB found during a repository import. // -// GitHub API docs: https://docs.github.com/en/rest/migration/source_imports/#get-large-files +// GitHub API docs: https://docs.github.com/rest/migration/source_imports/#get-large-files type LargeFile struct { RefName *string `json:"ref_name,omitempty"` Path *string `json:"path,omitempty"` @@ -146,7 +146,9 @@ func (f LargeFile) String() string { // StartImport initiates a repository import. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#start-an-import +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#start-an-import +// +//meta:operation PUT /repos/{owner}/{repo}/import func (s *MigrationService) StartImport(ctx context.Context, owner, repo string, in *Import) (*Import, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import", owner, repo) req, err := s.client.NewRequest("PUT", u, in) @@ -165,7 +167,9 @@ func (s *MigrationService) StartImport(ctx context.Context, owner, repo string, // ImportProgress queries for the status and progress of an ongoing repository import. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#get-an-import-status +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#get-an-import-status +// +//meta:operation GET /repos/{owner}/{repo}/import func (s *MigrationService) ImportProgress(ctx context.Context, owner, repo string) (*Import, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -184,7 +188,9 @@ func (s *MigrationService) ImportProgress(ctx context.Context, owner, repo strin // UpdateImport initiates a repository import. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#update-an-import +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#update-an-import +// +//meta:operation PATCH /repos/{owner}/{repo}/import func (s *MigrationService) UpdateImport(ctx context.Context, owner, repo string, in *Import) (*Import, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import", owner, repo) req, err := s.client.NewRequest("PATCH", u, in) @@ -213,7 +219,9 @@ func (s *MigrationService) UpdateImport(ctx context.Context, owner, repo string, // This method and MapCommitAuthor allow you to provide correct Git author // information. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#get-commit-authors +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#get-commit-authors +// +//meta:operation GET /repos/{owner}/{repo}/import/authors func (s *MigrationService) CommitAuthors(ctx context.Context, owner, repo string) ([]*SourceImportAuthor, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/authors", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -234,7 +242,9 @@ func (s *MigrationService) CommitAuthors(ctx context.Context, owner, repo string // application can continue updating authors any time before you push new // commits to the repository. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#map-a-commit-author +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#map-a-commit-author +// +//meta:operation PATCH /repos/{owner}/{repo}/import/authors/{author_id} func (s *MigrationService) MapCommitAuthor(ctx context.Context, owner, repo string, id int64, author *SourceImportAuthor) (*SourceImportAuthor, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/authors/%v", owner, repo, id) req, err := s.client.NewRequest("PATCH", u, author) @@ -255,7 +265,9 @@ func (s *MigrationService) MapCommitAuthor(ctx context.Context, owner, repo stri // files larger than 100MB. Only the UseLFS field on the provided Import is // used. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#update-git-lfs-preference +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference +// +//meta:operation PATCH /repos/{owner}/{repo}/import/lfs func (s *MigrationService) SetLFSPreference(ctx context.Context, owner, repo string, in *Import) (*Import, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/lfs", owner, repo) req, err := s.client.NewRequest("PATCH", u, in) @@ -274,7 +286,9 @@ func (s *MigrationService) SetLFSPreference(ctx context.Context, owner, repo str // LargeFiles lists files larger than 100MB found during the import. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#get-large-files +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#get-large-files +// +//meta:operation GET /repos/{owner}/{repo}/import/large_files func (s *MigrationService) LargeFiles(ctx context.Context, owner, repo string) ([]*LargeFile, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/large_files", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -293,7 +307,9 @@ func (s *MigrationService) LargeFiles(ctx context.Context, owner, repo string) ( // CancelImport stops an import for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#cancel-an-import +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#cancel-an-import +// +//meta:operation DELETE /repos/{owner}/{repo}/import func (s *MigrationService) CancelImport(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/import", owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/migrations_user.go b/github/migrations_user.go index 6586fdb2d3f..1f907cd4ec2 100644 --- a/github/migrations_user.go +++ b/github/migrations_user.go @@ -67,7 +67,9 @@ type startUserMigration struct { // StartUserMigration starts the generation of a migration archive. // repos is a slice of repository names to migrate. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/users#start-a-user-migration +// GitHub API docs: https://docs.github.com/rest/migrations/users#start-a-user-migration +// +//meta:operation POST /user/migrations func (s *MigrationService) StartUserMigration(ctx context.Context, repos []string, opts *UserMigrationOptions) (*UserMigration, *Response, error) { u := "user/migrations" @@ -96,7 +98,9 @@ func (s *MigrationService) StartUserMigration(ctx context.Context, repos []strin // ListUserMigrations lists the most recent migrations. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/users#list-user-migrations +// GitHub API docs: https://docs.github.com/rest/migrations/users#list-user-migrations +// +//meta:operation GET /user/migrations func (s *MigrationService) ListUserMigrations(ctx context.Context, opts *ListOptions) ([]*UserMigration, *Response, error) { u := "user/migrations" u, err := addOptions(u, opts) @@ -124,7 +128,9 @@ func (s *MigrationService) ListUserMigrations(ctx context.Context, opts *ListOpt // UserMigrationStatus gets the status of a specific migration archive. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/users#get-a-user-migration-status +// GitHub API docs: https://docs.github.com/rest/migrations/users#get-a-user-migration-status +// +//meta:operation GET /user/migrations/{migration_id} func (s *MigrationService) UserMigrationStatus(ctx context.Context, id int64) (*UserMigration, *Response, error) { u := fmt.Sprintf("user/migrations/%v", id) @@ -148,7 +154,9 @@ func (s *MigrationService) UserMigrationStatus(ctx context.Context, id int64) (* // UserMigrationArchiveURL gets the URL for a specific migration archive. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/users#download-a-user-migration-archive +// GitHub API docs: https://docs.github.com/rest/migrations/users#download-a-user-migration-archive +// +//meta:operation GET /user/migrations/{migration_id}/archive func (s *MigrationService) UserMigrationArchiveURL(ctx context.Context, id int64) (string, error) { url := fmt.Sprintf("user/migrations/%v/archive", id) @@ -182,7 +190,9 @@ func (s *MigrationService) UserMigrationArchiveURL(ctx context.Context, id int64 // DeleteUserMigration will delete a previous migration archive. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/users#delete-a-user-migration-archive +// GitHub API docs: https://docs.github.com/rest/migrations/users#delete-a-user-migration-archive +// +//meta:operation DELETE /user/migrations/{migration_id}/archive func (s *MigrationService) DeleteUserMigration(ctx context.Context, id int64) (*Response, error) { url := fmt.Sprintf("user/migrations/%v/archive", id) @@ -202,7 +212,9 @@ func (s *MigrationService) DeleteUserMigration(ctx context.Context, id int64) (* // You should unlock each migrated repository and delete them when the migration // is complete and you no longer need the source data. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/users#unlock-a-user-repository +// GitHub API docs: https://docs.github.com/rest/migrations/users#unlock-a-user-repository +// +//meta:operation DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock func (s *MigrationService) UnlockUserRepo(ctx context.Context, id int64, repo string) (*Response, error) { url := fmt.Sprintf("user/migrations/%v/repos/%v/lock", id, repo) diff --git a/github/orgs.go b/github/orgs.go index 0c7e361b3fc..4d3465271b6 100644 --- a/github/orgs.go +++ b/github/orgs.go @@ -13,7 +13,7 @@ import ( // OrganizationsService provides access to the organization related functions // in the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/ +// GitHub API docs: https://docs.github.com/rest/orgs/ type OrganizationsService service // Organization represents a GitHub organization account. @@ -148,7 +148,9 @@ type OrganizationsListOptions struct { // listing the next set of organizations, use the ID of the last-returned organization // as the opts.Since parameter for the next call. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#list-organizations +// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-organizations +// +//meta:operation GET /organizations func (s *OrganizationsService) ListAll(ctx context.Context, opts *OrganizationsListOptions) ([]*Organization, *Response, error) { u, err := addOptions("organizations", opts) if err != nil { @@ -171,8 +173,11 @@ func (s *OrganizationsService) ListAll(ctx context.Context, opts *OrganizationsL // List the organizations for a user. Passing the empty string will list // organizations for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#list-organizations-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#list-organizations-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-organizations-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-organizations-for-the-authenticated-user +// +//meta:operation GET /user/orgs +//meta:operation GET /users/{username}/orgs func (s *OrganizationsService) List(ctx context.Context, user string, opts *ListOptions) ([]*Organization, *Response, error) { var u string if user != "" { @@ -201,7 +206,9 @@ func (s *OrganizationsService) List(ctx context.Context, user string, opts *List // Get fetches an organization by name. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#get-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/orgs#get-an-organization +// +//meta:operation GET /orgs/{org} func (s *OrganizationsService) Get(ctx context.Context, org string) (*Organization, *Response, error) { u := fmt.Sprintf("orgs/%v", org) req, err := s.client.NewRequest("GET", u, nil) @@ -223,7 +230,9 @@ func (s *OrganizationsService) Get(ctx context.Context, org string) (*Organizati // GetByID fetches an organization. // -// Note: GetByID uses the undocumented GitHub API endpoint /organizations/:id. +// Note: GetByID uses the undocumented GitHub API endpoint "GET /organizations/{organization_id}". +// +//meta:operation GET /organizations/{organization_id} func (s *OrganizationsService) GetByID(ctx context.Context, id int64) (*Organization, *Response, error) { u := fmt.Sprintf("organizations/%d", id) req, err := s.client.NewRequest("GET", u, nil) @@ -242,7 +251,9 @@ func (s *OrganizationsService) GetByID(ctx context.Context, id int64) (*Organiza // Edit an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#update-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/orgs#update-an-organization +// +//meta:operation PATCH /orgs/{org} func (s *OrganizationsService) Edit(ctx context.Context, name string, org *Organization) (*Organization, *Response, error) { u := fmt.Sprintf("orgs/%v", name) req, err := s.client.NewRequest("PATCH", u, org) @@ -264,7 +275,9 @@ func (s *OrganizationsService) Edit(ctx context.Context, name string, org *Organ // Delete an organization by name. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#delete-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/orgs#delete-an-organization +// +//meta:operation DELETE /orgs/{org} func (s *OrganizationsService) Delete(ctx context.Context, org string) (*Response, error) { u := fmt.Sprintf("orgs/%v", org) req, err := s.client.NewRequest("DELETE", u, nil) @@ -277,7 +290,9 @@ func (s *OrganizationsService) Delete(ctx context.Context, org string) (*Respons // ListInstallations lists installations for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#list-app-installations-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-app-installations-for-an-organization +// +//meta:operation GET /orgs/{org}/installations func (s *OrganizationsService) ListInstallations(ctx context.Context, org string, opts *ListOptions) (*OrganizationInstallations, *Response, error) { u := fmt.Sprintf("orgs/%v/installations", org) diff --git a/github/orgs_actions_allowed.go b/github/orgs_actions_allowed.go index c467c11546b..b115e094a4b 100644 --- a/github/orgs_actions_allowed.go +++ b/github/orgs_actions_allowed.go @@ -11,8 +11,11 @@ import ( // GetActionsAllowed gets the actions that are allowed in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization // Deprecated: please use `client.Actions.GetActionsAllowed` instead. +// +// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/permissions/selected-actions func (s *OrganizationsService) GetActionsAllowed(ctx context.Context, org string) (*ActionsAllowed, *Response, error) { s2 := (*ActionsService)(s) return s2.GetActionsAllowed(ctx, org) @@ -20,8 +23,11 @@ func (s *OrganizationsService) GetActionsAllowed(ctx context.Context, org string // EditActionsAllowed sets the actions that are allowed in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-organization // Deprecated: please use `client.Actions.EditActionsAllowed` instead. +// +// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-organization +// +//meta:operation PUT /orgs/{org}/actions/permissions/selected-actions func (s *OrganizationsService) EditActionsAllowed(ctx context.Context, org string, actionsAllowed ActionsAllowed) (*ActionsAllowed, *Response, error) { s2 := (*ActionsService)(s) return s2.EditActionsAllowed(ctx, org, actionsAllowed) diff --git a/github/orgs_actions_permissions.go b/github/orgs_actions_permissions.go index 607ffca7981..97df1c967e9 100644 --- a/github/orgs_actions_permissions.go +++ b/github/orgs_actions_permissions.go @@ -11,8 +11,11 @@ import ( // GetActionsPermissions gets the GitHub Actions permissions policy for repositories and allowed actions in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#get-github-actions-permissions-for-an-organization // Deprecated: please use `client.Actions.GetActionsPermissions` instead. +// +// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/permissions func (s *OrganizationsService) GetActionsPermissions(ctx context.Context, org string) (*ActionsPermissions, *Response, error) { s2 := (*ActionsService)(s) return s2.GetActionsPermissions(ctx, org) @@ -20,8 +23,11 @@ func (s *OrganizationsService) GetActionsPermissions(ctx context.Context, org st // EditActionsPermissions sets the permissions policy for repositories and allowed actions in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-github-actions-permissions-for-an-organization // Deprecated: please use `client.Actions.EditActionsPermissions` instead. +// +// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-an-organization +// +//meta:operation PUT /orgs/{org}/actions/permissions func (s *OrganizationsService) EditActionsPermissions(ctx context.Context, org string, actionsPermissions ActionsPermissions) (*ActionsPermissions, *Response, error) { s2 := (*ActionsService)(s) return s2.EditActionsPermissions(ctx, org, actionsPermissions) diff --git a/github/orgs_audit_log.go b/github/orgs_audit_log.go index e2f8fc24ffd..e3afd3117f5 100644 --- a/github/orgs_audit_log.go +++ b/github/orgs_audit_log.go @@ -41,7 +41,7 @@ type PolicyOverrideReason struct { } // AuditEntry describes the fields that may be represented by various audit-log "action" entries. -// For a list of actions see - https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization#audit-log-actions +// For a list of actions see - https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization#audit-log-actions type AuditEntry struct { ActorIP *string `json:"actor_ip,omitempty"` Action *string `json:"action,omitempty"` // The name of the action that was performed, for example `user.login` or `repo.create`. @@ -135,7 +135,9 @@ type AuditEntryData struct { // GetAuditLog gets the audit-log entries for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#get-the-audit-log-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/orgs#get-the-audit-log-for-an-organization +// +//meta:operation GET /orgs/{org}/audit-log func (s *OrganizationsService) GetAuditLog(ctx context.Context, org string, opts *GetAuditLogOptions) ([]*AuditEntry, *Response, error) { u := fmt.Sprintf("orgs/%v/audit-log", org) u, err := addOptions(u, opts) diff --git a/github/orgs_credential_authorizations.go b/github/orgs_credential_authorizations.go index 6d56fe8f79a..eed0f0c66e0 100644 --- a/github/orgs_credential_authorizations.go +++ b/github/orgs_credential_authorizations.go @@ -58,7 +58,9 @@ type CredentialAuthorization struct { // ListCredentialAuthorizations lists credentials authorized through SAML SSO // for a given organization. Only available with GitHub Enterprise Cloud. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/orgs?apiVersion=2022-11-28#list-saml-sso-authorizations-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/orgs#list-saml-sso-authorizations-for-an-organization +// +//meta:operation GET /orgs/{org}/credential-authorizations func (s *OrganizationsService) ListCredentialAuthorizations(ctx context.Context, org string, opts *ListOptions) ([]*CredentialAuthorization, *Response, error) { u := fmt.Sprintf("orgs/%v/credential-authorizations", org) u, err := addOptions(u, opts) @@ -83,7 +85,9 @@ func (s *OrganizationsService) ListCredentialAuthorizations(ctx context.Context, // RemoveCredentialAuthorization revokes the SAML SSO authorization for a given // credential within an organization. Only available with GitHub Enterprise Cloud. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/orgs?apiVersion=2022-11-28#remove-a-saml-sso-authorization-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/orgs#remove-a-saml-sso-authorization-for-an-organization +// +//meta:operation DELETE /orgs/{org}/credential-authorizations/{credential_id} func (s *OrganizationsService) RemoveCredentialAuthorization(ctx context.Context, org string, credentialID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/credential-authorizations/%v", org, credentialID) req, err := s.client.NewRequest(http.MethodDelete, u, nil) diff --git a/github/orgs_custom_roles.go b/github/orgs_custom_roles.go index 7c1b2d6292d..45de896a2f9 100644 --- a/github/orgs_custom_roles.go +++ b/github/orgs_custom_roles.go @@ -17,7 +17,7 @@ type OrganizationCustomRepoRoles struct { } // CustomRepoRoles represents custom repository roles for an organization. -// See https://docs.github.com/en/enterprise-cloud@latest/organizations/managing-peoples-access-to-your-organization-with-roles/managing-custom-repository-roles-for-an-organization +// See https://docs.github.com/enterprise-cloud@latest/organizations/managing-peoples-access-to-your-organization-with-roles/managing-custom-repository-roles-for-an-organization // for more information. type CustomRepoRoles struct { ID *int64 `json:"id,omitempty"` @@ -30,7 +30,9 @@ type CustomRepoRoles struct { // ListCustomRepoRoles lists the custom repository roles available in this organization. // In order to see custom repository roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization +// +//meta:operation GET /orgs/{org}/custom-repository-roles func (s *OrganizationsService) ListCustomRepoRoles(ctx context.Context, org string) (*OrganizationCustomRepoRoles, *Response, error) { u := fmt.Sprintf("orgs/%v/custom-repository-roles", org) @@ -59,7 +61,9 @@ type CreateOrUpdateCustomRoleOptions struct { // CreateCustomRepoRole creates a custom repository role in this organization. // In order to create custom repository roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/custom-roles#create-a-custom-repository-role +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#create-a-custom-repository-role +// +//meta:operation POST /orgs/{org}/custom-repository-roles func (s *OrganizationsService) CreateCustomRepoRole(ctx context.Context, org string, opts *CreateOrUpdateCustomRoleOptions) (*CustomRepoRoles, *Response, error) { u := fmt.Sprintf("orgs/%v/custom-repository-roles", org) @@ -80,7 +84,9 @@ func (s *OrganizationsService) CreateCustomRepoRole(ctx context.Context, org str // UpdateCustomRepoRole updates a custom repository role in this organization. // In order to update custom repository roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/custom-roles#update-a-custom-repository-role +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#update-a-custom-repository-role +// +//meta:operation PATCH /orgs/{org}/custom-repository-roles/{role_id} func (s *OrganizationsService) UpdateCustomRepoRole(ctx context.Context, org, roleID string, opts *CreateOrUpdateCustomRoleOptions) (*CustomRepoRoles, *Response, error) { u := fmt.Sprintf("orgs/%v/custom-repository-roles/%v", org, roleID) @@ -101,7 +107,9 @@ func (s *OrganizationsService) UpdateCustomRepoRole(ctx context.Context, org, ro // DeleteCustomRepoRole deletes an existing custom repository role in this organization. // In order to delete custom repository roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/custom-roles#delete-a-custom-repository-role +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#delete-a-custom-repository-role +// +//meta:operation DELETE /orgs/{org}/custom-repository-roles/{role_id} func (s *OrganizationsService) DeleteCustomRepoRole(ctx context.Context, org, roleID string) (*Response, error) { u := fmt.Sprintf("orgs/%v/custom-repository-roles/%v", org, roleID) diff --git a/github/orgs_hooks.go b/github/orgs_hooks.go index c0dd51e24e3..c2eef77c92e 100644 --- a/github/orgs_hooks.go +++ b/github/orgs_hooks.go @@ -12,7 +12,9 @@ import ( // ListHooks lists all Hooks for the specified organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#list-organization-webhooks +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#list-organization-webhooks +// +//meta:operation GET /orgs/{org}/hooks func (s *OrganizationsService) ListHooks(ctx context.Context, org string, opts *ListOptions) ([]*Hook, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks", org) u, err := addOptions(u, opts) @@ -36,7 +38,9 @@ func (s *OrganizationsService) ListHooks(ctx context.Context, org string, opts * // GetHook returns a single specified Hook. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#get-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#get-an-organization-webhook +// +//meta:operation GET /orgs/{org}/hooks/{hook_id} func (s *OrganizationsService) GetHook(ctx context.Context, org string, id int64) (*Hook, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%d", org, id) req, err := s.client.NewRequest("GET", u, nil) @@ -59,7 +63,9 @@ func (s *OrganizationsService) GetHook(ctx context.Context, org string, id int64 // Note that only a subset of the hook fields are used and hook must // not be nil. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#create-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#create-an-organization-webhook +// +//meta:operation POST /orgs/{org}/hooks func (s *OrganizationsService) CreateHook(ctx context.Context, org string, hook *Hook) (*Hook, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks", org) @@ -86,7 +92,9 @@ func (s *OrganizationsService) CreateHook(ctx context.Context, org string, hook // EditHook updates a specified Hook. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#update-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#update-an-organization-webhook +// +//meta:operation PATCH /orgs/{org}/hooks/{hook_id} func (s *OrganizationsService) EditHook(ctx context.Context, org string, id int64, hook *Hook) (*Hook, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%d", org, id) req, err := s.client.NewRequest("PATCH", u, hook) @@ -105,7 +113,9 @@ func (s *OrganizationsService) EditHook(ctx context.Context, org string, id int6 // PingHook triggers a 'ping' event to be sent to the Hook. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#ping-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#ping-an-organization-webhook +// +//meta:operation POST /orgs/{org}/hooks/{hook_id}/pings func (s *OrganizationsService) PingHook(ctx context.Context, org string, id int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%d/pings", org, id) req, err := s.client.NewRequest("POST", u, nil) @@ -118,7 +128,9 @@ func (s *OrganizationsService) PingHook(ctx context.Context, org string, id int6 // DeleteHook deletes a specified Hook. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#delete-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#delete-an-organization-webhook +// +//meta:operation DELETE /orgs/{org}/hooks/{hook_id} func (s *OrganizationsService) DeleteHook(ctx context.Context, org string, id int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%d", org, id) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/orgs_hooks_configuration.go b/github/orgs_hooks_configuration.go index 953a2329c36..aeb616fc4c7 100644 --- a/github/orgs_hooks_configuration.go +++ b/github/orgs_hooks_configuration.go @@ -12,7 +12,9 @@ import ( // GetHookConfiguration returns the configuration for the specified organization webhook. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks?apiVersion=2022-11-28#get-a-webhook-configuration-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization +// +//meta:operation GET /orgs/{org}/hooks/{hook_id}/config func (s *OrganizationsService) GetHookConfiguration(ctx context.Context, org string, id int64) (*HookConfig, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%v/config", org, id) req, err := s.client.NewRequest("GET", u, nil) @@ -31,7 +33,9 @@ func (s *OrganizationsService) GetHookConfiguration(ctx context.Context, org str // EditHookConfiguration updates the configuration for the specified organization webhook. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks?apiVersion=2022-11-28#update-a-webhook-configuration-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization +// +//meta:operation PATCH /orgs/{org}/hooks/{hook_id}/config func (s *OrganizationsService) EditHookConfiguration(ctx context.Context, org string, id int64, config *HookConfig) (*HookConfig, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%v/config", org, id) req, err := s.client.NewRequest("PATCH", u, config) diff --git a/github/orgs_hooks_deliveries.go b/github/orgs_hooks_deliveries.go index 1bfad409ea5..c1c30124028 100644 --- a/github/orgs_hooks_deliveries.go +++ b/github/orgs_hooks_deliveries.go @@ -12,7 +12,9 @@ import ( // ListHookDeliveries lists webhook deliveries for a webhook configured in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#list-deliveries-for-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#list-deliveries-for-an-organization-webhook +// +//meta:operation GET /orgs/{org}/hooks/{hook_id}/deliveries func (s *OrganizationsService) ListHookDeliveries(ctx context.Context, org string, id int64, opts *ListCursorOptions) ([]*HookDelivery, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%v/deliveries", org, id) u, err := addOptions(u, opts) @@ -36,7 +38,9 @@ func (s *OrganizationsService) ListHookDeliveries(ctx context.Context, org strin // GetHookDelivery returns a delivery for a webhook configured in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#get-a-webhook-delivery-for-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-delivery-for-an-organization-webhook +// +//meta:operation GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id} func (s *OrganizationsService) GetHookDelivery(ctx context.Context, owner string, hookID, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%v/deliveries/%v", owner, hookID, deliveryID) req, err := s.client.NewRequest("GET", u, nil) @@ -55,7 +59,9 @@ func (s *OrganizationsService) GetHookDelivery(ctx context.Context, owner string // RedeliverHookDelivery redelivers a delivery for a webhook configured in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#redeliver-a-delivery-for-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#redeliver-a-delivery-for-an-organization-webhook +// +//meta:operation POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts func (s *OrganizationsService) RedeliverHookDelivery(ctx context.Context, owner string, hookID, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%v/deliveries/%v/attempts", owner, hookID, deliveryID) req, err := s.client.NewRequest("POST", u, nil) diff --git a/github/orgs_members.go b/github/orgs_members.go index 79f8a653333..5bc23657fcd 100644 --- a/github/orgs_members.go +++ b/github/orgs_members.go @@ -71,8 +71,11 @@ type ListMembersOptions struct { // user is an owner of the organization, this will return both concealed and // public members, otherwise it will only return public members. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#list-organization-members -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#list-public-organization-members +// GitHub API docs: https://docs.github.com/rest/orgs/members#list-organization-members +// GitHub API docs: https://docs.github.com/rest/orgs/members#list-public-organization-members +// +//meta:operation GET /orgs/{org}/members +//meta:operation GET /orgs/{org}/public_members func (s *OrganizationsService) ListMembers(ctx context.Context, org string, opts *ListMembersOptions) ([]*User, *Response, error) { var u string if opts != nil && opts.PublicOnly { @@ -101,7 +104,9 @@ func (s *OrganizationsService) ListMembers(ctx context.Context, org string, opts // IsMember checks if a user is a member of an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#check-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/members#check-organization-membership-for-a-user +// +//meta:operation GET /orgs/{org}/members/{username} func (s *OrganizationsService) IsMember(ctx context.Context, org, user string) (bool, *Response, error) { u := fmt.Sprintf("orgs/%v/members/%v", org, user) req, err := s.client.NewRequest("GET", u, nil) @@ -116,7 +121,9 @@ func (s *OrganizationsService) IsMember(ctx context.Context, org, user string) ( // IsPublicMember checks if a user is a public member of an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#check-public-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/members#check-public-organization-membership-for-a-user +// +//meta:operation GET /orgs/{org}/public_members/{username} func (s *OrganizationsService) IsPublicMember(ctx context.Context, org, user string) (bool, *Response, error) { u := fmt.Sprintf("orgs/%v/public_members/%v", org, user) req, err := s.client.NewRequest("GET", u, nil) @@ -131,7 +138,9 @@ func (s *OrganizationsService) IsPublicMember(ctx context.Context, org, user str // RemoveMember removes a user from all teams of an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#remove-an-organization-member +// GitHub API docs: https://docs.github.com/rest/orgs/members#remove-an-organization-member +// +//meta:operation DELETE /orgs/{org}/members/{username} func (s *OrganizationsService) RemoveMember(ctx context.Context, org, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/members/%v", org, user) req, err := s.client.NewRequest("DELETE", u, nil) @@ -145,7 +154,9 @@ func (s *OrganizationsService) RemoveMember(ctx context.Context, org, user strin // PublicizeMembership publicizes a user's membership in an organization. (A // user cannot publicize the membership for another user.) // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#set-public-organization-membership-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/orgs/members#set-public-organization-membership-for-the-authenticated-user +// +//meta:operation PUT /orgs/{org}/public_members/{username} func (s *OrganizationsService) PublicizeMembership(ctx context.Context, org, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/public_members/%v", org, user) req, err := s.client.NewRequest("PUT", u, nil) @@ -158,7 +169,9 @@ func (s *OrganizationsService) PublicizeMembership(ctx context.Context, org, use // ConcealMembership conceals a user's membership in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#remove-public-organization-membership-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/orgs/members#remove-public-organization-membership-for-the-authenticated-user +// +//meta:operation DELETE /orgs/{org}/public_members/{username} func (s *OrganizationsService) ConcealMembership(ctx context.Context, org, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/public_members/%v", org, user) req, err := s.client.NewRequest("DELETE", u, nil) @@ -181,7 +194,9 @@ type ListOrgMembershipsOptions struct { // ListOrgMemberships lists the organization memberships for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#list-organization-memberships-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/orgs/members#list-organization-memberships-for-the-authenticated-user +// +//meta:operation GET /user/memberships/orgs func (s *OrganizationsService) ListOrgMemberships(ctx context.Context, opts *ListOrgMembershipsOptions) ([]*Membership, *Response, error) { u := "user/memberships/orgs" u, err := addOptions(u, opts) @@ -207,8 +222,11 @@ func (s *OrganizationsService) ListOrgMemberships(ctx context.Context, opts *Lis // Passing an empty string for user will get the membership for the // authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#get-an-organization-membership-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#get-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/members#get-an-organization-membership-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user +// +//meta:operation GET /orgs/{org}/memberships/{username} +//meta:operation GET /user/memberships/orgs/{org} func (s *OrganizationsService) GetOrgMembership(ctx context.Context, user, org string) (*Membership, *Response, error) { var u string if user != "" { @@ -235,8 +253,11 @@ func (s *OrganizationsService) GetOrgMembership(ctx context.Context, user, org s // Passing an empty string for user will edit the membership for the // authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#update-an-organization-membership-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#set-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/members#set-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/members#update-an-organization-membership-for-the-authenticated-user +// +//meta:operation PUT /orgs/{org}/memberships/{username} +//meta:operation PATCH /user/memberships/orgs/{org} func (s *OrganizationsService) EditOrgMembership(ctx context.Context, user, org string, membership *Membership) (*Membership, *Response, error) { var u, method string if user != "" { @@ -264,7 +285,9 @@ func (s *OrganizationsService) EditOrgMembership(ctx context.Context, user, org // RemoveOrgMembership removes user from the specified organization. If the // user has been invited to the organization, this will cancel their invitation. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#remove-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/members#remove-organization-membership-for-a-user +// +//meta:operation DELETE /orgs/{org}/memberships/{username} func (s *OrganizationsService) RemoveOrgMembership(ctx context.Context, user, org string) (*Response, error) { u := fmt.Sprintf("orgs/%v/memberships/%v", org, user) req, err := s.client.NewRequest("DELETE", u, nil) @@ -277,7 +300,9 @@ func (s *OrganizationsService) RemoveOrgMembership(ctx context.Context, user, or // ListPendingOrgInvitations returns a list of pending invitations. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#list-pending-organization-invitations +// GitHub API docs: https://docs.github.com/rest/orgs/members#list-pending-organization-invitations +// +//meta:operation GET /orgs/{org}/invitations func (s *OrganizationsService) ListPendingOrgInvitations(ctx context.Context, org string, opts *ListOptions) ([]*Invitation, *Response, error) { u := fmt.Sprintf("orgs/%v/invitations", org) u, err := addOptions(u, opts) @@ -323,7 +348,9 @@ type CreateOrgInvitationOptions struct { // In order to create invitations in an organization, // the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#create-an-organization-invitation +// GitHub API docs: https://docs.github.com/rest/orgs/members#create-an-organization-invitation +// +//meta:operation POST /orgs/{org}/invitations func (s *OrganizationsService) CreateOrgInvitation(ctx context.Context, org string, opts *CreateOrgInvitationOptions) (*Invitation, *Response, error) { u := fmt.Sprintf("orgs/%v/invitations", org) @@ -344,7 +371,9 @@ func (s *OrganizationsService) CreateOrgInvitation(ctx context.Context, org stri // ListOrgInvitationTeams lists all teams associated with an invitation. In order to see invitations in an organization, // the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#list-organization-invitation-teams +// GitHub API docs: https://docs.github.com/rest/orgs/members#list-organization-invitation-teams +// +//meta:operation GET /orgs/{org}/invitations/{invitation_id}/teams func (s *OrganizationsService) ListOrgInvitationTeams(ctx context.Context, org, invitationID string, opts *ListOptions) ([]*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/invitations/%v/teams", org, invitationID) u, err := addOptions(u, opts) @@ -368,7 +397,9 @@ func (s *OrganizationsService) ListOrgInvitationTeams(ctx context.Context, org, // ListFailedOrgInvitations returns a list of failed inviatations. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#list-failed-organization-invitations +// GitHub API docs: https://docs.github.com/rest/orgs/members#list-failed-organization-invitations +// +//meta:operation GET /orgs/{org}/failed_invitations func (s *OrganizationsService) ListFailedOrgInvitations(ctx context.Context, org string, opts *ListOptions) ([]*Invitation, *Response, error) { u := fmt.Sprintf("orgs/%v/failed_invitations", org) u, err := addOptions(u, opts) diff --git a/github/orgs_outside_collaborators.go b/github/orgs_outside_collaborators.go index 506a4946034..56034d72602 100644 --- a/github/orgs_outside_collaborators.go +++ b/github/orgs_outside_collaborators.go @@ -27,7 +27,9 @@ type ListOutsideCollaboratorsOptions struct { // Warning: The API may change without advance notice during the preview period. // Preview features are not supported for production use. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/outside-collaborators#list-outside-collaborators-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/outside-collaborators#list-outside-collaborators-for-an-organization +// +//meta:operation GET /orgs/{org}/outside_collaborators func (s *OrganizationsService) ListOutsideCollaborators(ctx context.Context, org string, opts *ListOutsideCollaboratorsOptions) ([]*User, *Response, error) { u := fmt.Sprintf("orgs/%v/outside_collaborators", org) u, err := addOptions(u, opts) @@ -52,7 +54,9 @@ func (s *OrganizationsService) ListOutsideCollaborators(ctx context.Context, org // RemoveOutsideCollaborator removes a user from the list of outside collaborators; // consequently, removing them from all the organization's repositories. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/outside-collaborators#remove-outside-collaborator-from-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/outside-collaborators#remove-outside-collaborator-from-an-organization +// +//meta:operation DELETE /orgs/{org}/outside_collaborators/{username} func (s *OrganizationsService) RemoveOutsideCollaborator(ctx context.Context, org string, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/outside_collaborators/%v", org, user) req, err := s.client.NewRequest("DELETE", u, nil) @@ -69,7 +73,9 @@ func (s *OrganizationsService) RemoveOutsideCollaborator(ctx context.Context, or // Responses for converting a non-member or the last owner to an outside collaborator // are listed in GitHub API docs. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/outside-collaborators#convert-an-organization-member-to-outside-collaborator +// GitHub API docs: https://docs.github.com/rest/orgs/outside-collaborators#convert-an-organization-member-to-outside-collaborator +// +//meta:operation PUT /orgs/{org}/outside_collaborators/{username} func (s *OrganizationsService) ConvertMemberToOutsideCollaborator(ctx context.Context, org string, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/outside_collaborators/%v", org, user) req, err := s.client.NewRequest("PUT", u, nil) diff --git a/github/orgs_packages.go b/github/orgs_packages.go index 449b3dd3e91..4fb9a63b428 100644 --- a/github/orgs_packages.go +++ b/github/orgs_packages.go @@ -12,7 +12,9 @@ import ( // ListPackages lists the packages for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/packages#list-packages-for-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages#list-packages-for-an-organization +// +//meta:operation GET /orgs/{org}/packages func (s *OrganizationsService) ListPackages(ctx context.Context, org string, opts *PackageListOptions) ([]*Package, *Response, error) { u := fmt.Sprintf("orgs/%v/packages", org) u, err := addOptions(u, opts) @@ -36,7 +38,9 @@ func (s *OrganizationsService) ListPackages(ctx context.Context, org string, opt // GetPackage gets a package by name from an organization. // -// GitHub API docs: https://docs.github.com/en/rest/packages#get-a-package-for-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-for-an-organization +// +//meta:operation GET /orgs/{org}/packages/{package_type}/{package_name} func (s *OrganizationsService) GetPackage(ctx context.Context, org, packageType, packageName string) (*Package, *Response, error) { u := fmt.Sprintf("orgs/%v/packages/%v/%v", org, packageType, packageName) req, err := s.client.NewRequest("GET", u, nil) @@ -55,7 +59,9 @@ func (s *OrganizationsService) GetPackage(ctx context.Context, org, packageType, // DeletePackage deletes a package from an organization. // -// GitHub API docs: https://docs.github.com/en/rest/packages#delete-a-package-for-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-a-package-for-an-organization +// +//meta:operation DELETE /orgs/{org}/packages/{package_type}/{package_name} func (s *OrganizationsService) DeletePackage(ctx context.Context, org, packageType, packageName string) (*Response, error) { u := fmt.Sprintf("orgs/%v/packages/%v/%v", org, packageType, packageName) req, err := s.client.NewRequest("DELETE", u, nil) @@ -68,7 +74,9 @@ func (s *OrganizationsService) DeletePackage(ctx context.Context, org, packageTy // RestorePackage restores a package to an organization. // -// GitHub API docs: https://docs.github.com/en/rest/packages#restore-a-package-for-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-a-package-for-an-organization +// +//meta:operation POST /orgs/{org}/packages/{package_type}/{package_name}/restore func (s *OrganizationsService) RestorePackage(ctx context.Context, org, packageType, packageName string) (*Response, error) { u := fmt.Sprintf("orgs/%v/packages/%v/%v/restore", org, packageType, packageName) req, err := s.client.NewRequest("POST", u, nil) @@ -81,7 +89,9 @@ func (s *OrganizationsService) RestorePackage(ctx context.Context, org, packageT // PackageGetAllVersions gets all versions of a package in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/packages#list-package-versions-for-a-package-owned-by-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-an-organization +// +//meta:operation GET /orgs/{org}/packages/{package_type}/{package_name}/versions func (s *OrganizationsService) PackageGetAllVersions(ctx context.Context, org, packageType, packageName string, opts *PackageListOptions) ([]*PackageVersion, *Response, error) { u := fmt.Sprintf("orgs/%v/packages/%v/%v/versions", org, packageType, packageName) u, err := addOptions(u, opts) @@ -105,7 +115,9 @@ func (s *OrganizationsService) PackageGetAllVersions(ctx context.Context, org, p // PackageGetVersion gets a specific version of a package in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/packages#get-a-package-version-for-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-version-for-an-organization +// +//meta:operation GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id} func (s *OrganizationsService) PackageGetVersion(ctx context.Context, org, packageType, packageName string, packageVersionID int64) (*PackageVersion, *Response, error) { u := fmt.Sprintf("orgs/%v/packages/%v/%v/versions/%v", org, packageType, packageName, packageVersionID) req, err := s.client.NewRequest("GET", u, nil) @@ -124,7 +136,9 @@ func (s *OrganizationsService) PackageGetVersion(ctx context.Context, org, packa // PackageDeleteVersion deletes a package version from an organization. // -// GitHub API docs: https://docs.github.com/en/rest/packages#delete-package-version-for-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-package-version-for-an-organization +// +//meta:operation DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id} func (s *OrganizationsService) PackageDeleteVersion(ctx context.Context, org, packageType, packageName string, packageVersionID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/packages/%v/%v/versions/%v", org, packageType, packageName, packageVersionID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -137,7 +151,9 @@ func (s *OrganizationsService) PackageDeleteVersion(ctx context.Context, org, pa // PackageRestoreVersion restores a package version to an organization. // -// GitHub API docs: https://docs.github.com/en/rest/packages#restore-package-version-for-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-package-version-for-an-organization +// +//meta:operation POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore func (s *OrganizationsService) PackageRestoreVersion(ctx context.Context, org, packageType, packageName string, packageVersionID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/packages/%v/%v/versions/%v/restore", org, packageType, packageName, packageVersionID) req, err := s.client.NewRequest("POST", u, nil) diff --git a/github/orgs_personal_access_tokens.go b/github/orgs_personal_access_tokens.go index c30ff2843ee..0d786114f8c 100644 --- a/github/orgs_personal_access_tokens.go +++ b/github/orgs_personal_access_tokens.go @@ -21,7 +21,9 @@ type ReviewPersonalAccessTokenRequestOptions struct { // Only GitHub Apps can call this API, using the `organization_personal_access_token_requests: write` permission. // `action` can be one of `approve` or `deny`. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/personal-access-tokens?apiVersion=2022-11-28#review-a-request-to-access-organization-resources-with-a-fine-grained-personal-access-token +// GitHub API docs: https://docs.github.com/rest/orgs/personal-access-tokens#review-a-request-to-access-organization-resources-with-a-fine-grained-personal-access-token +// +//meta:operation POST /orgs/{org}/personal-access-token-requests/{pat_request_id} func (s *OrganizationsService) ReviewPersonalAccessTokenRequest(ctx context.Context, org string, requestID int64, opts ReviewPersonalAccessTokenRequestOptions) (*Response, error) { u := fmt.Sprintf("orgs/%v/personal-access-token-requests/%v", org, requestID) diff --git a/github/orgs_projects.go b/github/orgs_projects.go index d49eae54dce..454d8cf1c34 100644 --- a/github/orgs_projects.go +++ b/github/orgs_projects.go @@ -12,7 +12,9 @@ import ( // ListProjects lists the projects for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/projects/projects#list-organization-projects +// GitHub API docs: https://docs.github.com/rest/projects/projects#list-organization-projects +// +//meta:operation GET /orgs/{org}/projects func (s *OrganizationsService) ListProjects(ctx context.Context, org string, opts *ProjectListOptions) ([]*Project, *Response, error) { u := fmt.Sprintf("orgs/%v/projects", org) u, err := addOptions(u, opts) @@ -39,7 +41,9 @@ func (s *OrganizationsService) ListProjects(ctx context.Context, org string, opt // CreateProject creates a GitHub Project for the specified organization. // -// GitHub API docs: https://docs.github.com/en/rest/projects/projects#create-an-organization-project +// GitHub API docs: https://docs.github.com/rest/projects/projects#create-an-organization-project +// +//meta:operation POST /orgs/{org}/projects func (s *OrganizationsService) CreateProject(ctx context.Context, org string, opts *ProjectOptions) (*Project, *Response, error) { u := fmt.Sprintf("orgs/%v/projects", org) req, err := s.client.NewRequest("POST", u, opts) diff --git a/github/orgs_rules.go b/github/orgs_rules.go index a3905af8fb3..37c06a7333c 100644 --- a/github/orgs_rules.go +++ b/github/orgs_rules.go @@ -12,7 +12,9 @@ import ( // GetAllOrganizationRulesets gets all the rulesets for the specified organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/rules#get-all-organization-repository-rulesets +// GitHub API docs: https://docs.github.com/rest/orgs/rules#get-all-organization-repository-rulesets +// +//meta:operation GET /orgs/{org}/rulesets func (s *OrganizationsService) GetAllOrganizationRulesets(ctx context.Context, org string) ([]*Ruleset, *Response, error) { u := fmt.Sprintf("orgs/%v/rulesets", org) @@ -32,7 +34,9 @@ func (s *OrganizationsService) GetAllOrganizationRulesets(ctx context.Context, o // CreateOrganizationRuleset creates a ruleset for the specified organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/rules#create-an-organization-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/orgs/rules#create-an-organization-repository-ruleset +// +//meta:operation POST /orgs/{org}/rulesets func (s *OrganizationsService) CreateOrganizationRuleset(ctx context.Context, org string, rs *Ruleset) (*Ruleset, *Response, error) { u := fmt.Sprintf("orgs/%v/rulesets", org) @@ -52,7 +56,9 @@ func (s *OrganizationsService) CreateOrganizationRuleset(ctx context.Context, or // GetOrganizationRuleset gets a ruleset from the specified organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/rules#get-an-organization-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/orgs/rules#get-an-organization-repository-ruleset +// +//meta:operation GET /orgs/{org}/rulesets/{ruleset_id} func (s *OrganizationsService) GetOrganizationRuleset(ctx context.Context, org string, rulesetID int64) (*Ruleset, *Response, error) { u := fmt.Sprintf("orgs/%v/rulesets/%v", org, rulesetID) @@ -72,7 +78,9 @@ func (s *OrganizationsService) GetOrganizationRuleset(ctx context.Context, org s // UpdateOrganizationRuleset updates a ruleset from the specified organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/rules#update-an-organization-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/orgs/rules#update-an-organization-repository-ruleset +// +//meta:operation PUT /orgs/{org}/rulesets/{ruleset_id} func (s *OrganizationsService) UpdateOrganizationRuleset(ctx context.Context, org string, rulesetID int64, rs *Ruleset) (*Ruleset, *Response, error) { u := fmt.Sprintf("orgs/%v/rulesets/%v", org, rulesetID) @@ -92,7 +100,9 @@ func (s *OrganizationsService) UpdateOrganizationRuleset(ctx context.Context, or // DeleteOrganizationRuleset deletes a ruleset from the specified organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/rules#delete-an-organization-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/orgs/rules#delete-an-organization-repository-ruleset +// +//meta:operation DELETE /orgs/{org}/rulesets/{ruleset_id} func (s *OrganizationsService) DeleteOrganizationRuleset(ctx context.Context, org string, rulesetID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/rulesets/%v", org, rulesetID) diff --git a/github/orgs_security_managers.go b/github/orgs_security_managers.go index a3f002e0e1c..08037727320 100644 --- a/github/orgs_security_managers.go +++ b/github/orgs_security_managers.go @@ -12,7 +12,9 @@ import ( // ListSecurityManagerTeams lists all security manager teams for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/security-managers#list-security-manager-teams +// GitHub API docs: https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams +// +//meta:operation GET /orgs/{org}/security-managers func (s *OrganizationsService) ListSecurityManagerTeams(ctx context.Context, org string) ([]*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/security-managers", org) @@ -32,7 +34,9 @@ func (s *OrganizationsService) ListSecurityManagerTeams(ctx context.Context, org // AddSecurityManagerTeam adds a team to the list of security managers for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/security-managers#add-a-security-manager-team +// GitHub API docs: https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team +// +//meta:operation PUT /orgs/{org}/security-managers/teams/{team_slug} func (s *OrganizationsService) AddSecurityManagerTeam(ctx context.Context, org, team string) (*Response, error) { u := fmt.Sprintf("orgs/%v/security-managers/teams/%v", org, team) req, err := s.client.NewRequest("PUT", u, nil) @@ -45,7 +49,9 @@ func (s *OrganizationsService) AddSecurityManagerTeam(ctx context.Context, org, // RemoveSecurityManagerTeam removes a team from the list of security managers for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/security-managers#remove-a-security-manager-team +// GitHub API docs: https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team +// +//meta:operation DELETE /orgs/{org}/security-managers/teams/{team_slug} func (s *OrganizationsService) RemoveSecurityManagerTeam(ctx context.Context, org, team string) (*Response, error) { u := fmt.Sprintf("orgs/%v/security-managers/teams/%v", org, team) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/orgs_users_blocking.go b/github/orgs_users_blocking.go index 9c6cf60269e..62bd9116cde 100644 --- a/github/orgs_users_blocking.go +++ b/github/orgs_users_blocking.go @@ -12,7 +12,9 @@ import ( // ListBlockedUsers lists all the users blocked by an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/blocking#list-users-blocked-by-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/blocking#list-users-blocked-by-an-organization +// +//meta:operation GET /orgs/{org}/blocks func (s *OrganizationsService) ListBlockedUsers(ctx context.Context, org string, opts *ListOptions) ([]*User, *Response, error) { u := fmt.Sprintf("orgs/%v/blocks", org) u, err := addOptions(u, opts) @@ -39,7 +41,9 @@ func (s *OrganizationsService) ListBlockedUsers(ctx context.Context, org string, // IsBlocked reports whether specified user is blocked from an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/blocking#check-if-a-user-is-blocked-by-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/blocking#check-if-a-user-is-blocked-by-an-organization +// +//meta:operation GET /orgs/{org}/blocks/{username} func (s *OrganizationsService) IsBlocked(ctx context.Context, org string, user string) (bool, *Response, error) { u := fmt.Sprintf("orgs/%v/blocks/%v", org, user) @@ -58,7 +62,9 @@ func (s *OrganizationsService) IsBlocked(ctx context.Context, org string, user s // BlockUser blocks specified user from an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/blocking#block-a-user-from-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/blocking#block-a-user-from-an-organization +// +//meta:operation PUT /orgs/{org}/blocks/{username} func (s *OrganizationsService) BlockUser(ctx context.Context, org string, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/blocks/%v", org, user) @@ -75,7 +81,9 @@ func (s *OrganizationsService) BlockUser(ctx context.Context, org string, user s // UnblockUser unblocks specified user from an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/blocking#unblock-a-user-from-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/blocking#unblock-a-user-from-an-organization +// +//meta:operation DELETE /orgs/{org}/blocks/{username} func (s *OrganizationsService) UnblockUser(ctx context.Context, org string, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/blocks/%v", org, user) diff --git a/github/projects.go b/github/projects.go index df7ad6cd97e..c5c42f8939b 100644 --- a/github/projects.go +++ b/github/projects.go @@ -13,7 +13,7 @@ import ( // ProjectsService provides access to the projects functions in the // GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/projects +// GitHub API docs: https://docs.github.com/rest/projects type ProjectsService service // Project represents a GitHub Project. @@ -43,7 +43,9 @@ func (p Project) String() string { // GetProject gets a GitHub Project for a repo. // -// GitHub API docs: https://docs.github.com/en/rest/projects/projects#get-a-project +// GitHub API docs: https://docs.github.com/rest/projects/projects#get-a-project +// +//meta:operation GET /projects/{project_id} func (s *ProjectsService) GetProject(ctx context.Context, id int64) (*Project, *Response, error) { u := fmt.Sprintf("projects/%v", id) req, err := s.client.NewRequest("GET", u, nil) @@ -90,7 +92,9 @@ type ProjectOptions struct { // UpdateProject updates a repository project. // -// GitHub API docs: https://docs.github.com/en/rest/projects/projects#update-a-project +// GitHub API docs: https://docs.github.com/rest/projects/projects#update-a-project +// +//meta:operation PATCH /projects/{project_id} func (s *ProjectsService) UpdateProject(ctx context.Context, id int64, opts *ProjectOptions) (*Project, *Response, error) { u := fmt.Sprintf("projects/%v", id) req, err := s.client.NewRequest("PATCH", u, opts) @@ -112,7 +116,9 @@ func (s *ProjectsService) UpdateProject(ctx context.Context, id int64, opts *Pro // DeleteProject deletes a GitHub Project from a repository. // -// GitHub API docs: https://docs.github.com/en/rest/projects/projects#delete-a-project +// GitHub API docs: https://docs.github.com/rest/projects/projects#delete-a-project +// +//meta:operation DELETE /projects/{project_id} func (s *ProjectsService) DeleteProject(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("projects/%v", id) req, err := s.client.NewRequest("DELETE", u, nil) @@ -128,7 +134,7 @@ func (s *ProjectsService) DeleteProject(ctx context.Context, id int64) (*Respons // ProjectColumn represents a column of a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/rest/repos/projects/ +// GitHub API docs: https://docs.github.com/rest/repos/projects/ type ProjectColumn struct { ID *int64 `json:"id,omitempty"` Name *string `json:"name,omitempty"` @@ -142,7 +148,9 @@ type ProjectColumn struct { // ListProjectColumns lists the columns of a GitHub Project for a repo. // -// GitHub API docs: https://docs.github.com/en/rest/projects/columns#list-project-columns +// GitHub API docs: https://docs.github.com/rest/projects/columns#list-project-columns +// +//meta:operation GET /projects/{project_id}/columns func (s *ProjectsService) ListProjectColumns(ctx context.Context, projectID int64, opts *ListOptions) ([]*ProjectColumn, *Response, error) { u := fmt.Sprintf("projects/%v/columns", projectID) u, err := addOptions(u, opts) @@ -169,7 +177,9 @@ func (s *ProjectsService) ListProjectColumns(ctx context.Context, projectID int6 // GetProjectColumn gets a column of a GitHub Project for a repo. // -// GitHub API docs: https://docs.github.com/en/rest/projects/columns#get-a-project-column +// GitHub API docs: https://docs.github.com/rest/projects/columns#get-a-project-column +// +//meta:operation GET /projects/columns/{column_id} func (s *ProjectsService) GetProjectColumn(ctx context.Context, id int64) (*ProjectColumn, *Response, error) { u := fmt.Sprintf("projects/columns/%v", id) req, err := s.client.NewRequest("GET", u, nil) @@ -199,7 +209,9 @@ type ProjectColumnOptions struct { // CreateProjectColumn creates a column for the specified (by number) project. // -// GitHub API docs: https://docs.github.com/en/rest/projects/columns#create-a-project-column +// GitHub API docs: https://docs.github.com/rest/projects/columns#create-a-project-column +// +//meta:operation POST /projects/{project_id}/columns func (s *ProjectsService) CreateProjectColumn(ctx context.Context, projectID int64, opts *ProjectColumnOptions) (*ProjectColumn, *Response, error) { u := fmt.Sprintf("projects/%v/columns", projectID) req, err := s.client.NewRequest("POST", u, opts) @@ -221,7 +233,9 @@ func (s *ProjectsService) CreateProjectColumn(ctx context.Context, projectID int // UpdateProjectColumn updates a column of a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/rest/projects/columns#update-an-existing-project-column +// GitHub API docs: https://docs.github.com/rest/projects/columns#update-an-existing-project-column +// +//meta:operation PATCH /projects/columns/{column_id} func (s *ProjectsService) UpdateProjectColumn(ctx context.Context, columnID int64, opts *ProjectColumnOptions) (*ProjectColumn, *Response, error) { u := fmt.Sprintf("projects/columns/%v", columnID) req, err := s.client.NewRequest("PATCH", u, opts) @@ -243,7 +257,9 @@ func (s *ProjectsService) UpdateProjectColumn(ctx context.Context, columnID int6 // DeleteProjectColumn deletes a column from a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/rest/projects/columns#delete-a-project-column +// GitHub API docs: https://docs.github.com/rest/projects/columns#delete-a-project-column +// +//meta:operation DELETE /projects/columns/{column_id} func (s *ProjectsService) DeleteProjectColumn(ctx context.Context, columnID int64) (*Response, error) { u := fmt.Sprintf("projects/columns/%v", columnID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -267,7 +283,9 @@ type ProjectColumnMoveOptions struct { // MoveProjectColumn moves a column within a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/rest/projects/columns#move-a-project-column +// GitHub API docs: https://docs.github.com/rest/projects/columns#move-a-project-column +// +//meta:operation POST /projects/columns/{column_id}/moves func (s *ProjectsService) MoveProjectColumn(ctx context.Context, columnID int64, opts *ProjectColumnMoveOptions) (*Response, error) { u := fmt.Sprintf("projects/columns/%v/moves", columnID) req, err := s.client.NewRequest("POST", u, opts) @@ -283,7 +301,7 @@ func (s *ProjectsService) MoveProjectColumn(ctx context.Context, columnID int64, // ProjectCard represents a card in a column of a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/rest/projects/cards/#get-a-project-card +// GitHub API docs: https://docs.github.com/rest/projects/cards/#get-a-project-card type ProjectCard struct { URL *string `json:"url,omitempty"` ColumnURL *string `json:"column_url,omitempty"` @@ -318,7 +336,9 @@ type ProjectCardListOptions struct { // ListProjectCards lists the cards in a column of a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/rest/projects/cards#list-project-cards +// GitHub API docs: https://docs.github.com/rest/projects/cards#list-project-cards +// +//meta:operation GET /projects/columns/{column_id}/cards func (s *ProjectsService) ListProjectCards(ctx context.Context, columnID int64, opts *ProjectCardListOptions) ([]*ProjectCard, *Response, error) { u := fmt.Sprintf("projects/columns/%v/cards", columnID) u, err := addOptions(u, opts) @@ -345,7 +365,9 @@ func (s *ProjectsService) ListProjectCards(ctx context.Context, columnID int64, // GetProjectCard gets a card in a column of a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/rest/projects/cards#get-a-project-card +// GitHub API docs: https://docs.github.com/rest/projects/cards#get-a-project-card +// +//meta:operation GET /projects/columns/cards/{card_id} func (s *ProjectsService) GetProjectCard(ctx context.Context, cardID int64) (*ProjectCard, *Response, error) { u := fmt.Sprintf("projects/columns/cards/%v", cardID) req, err := s.client.NewRequest("GET", u, nil) @@ -383,7 +405,9 @@ type ProjectCardOptions struct { // CreateProjectCard creates a card in the specified column of a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/rest/projects/cards#create-a-project-card +// GitHub API docs: https://docs.github.com/rest/projects/cards#create-a-project-card +// +//meta:operation POST /projects/columns/{column_id}/cards func (s *ProjectsService) CreateProjectCard(ctx context.Context, columnID int64, opts *ProjectCardOptions) (*ProjectCard, *Response, error) { u := fmt.Sprintf("projects/columns/%v/cards", columnID) req, err := s.client.NewRequest("POST", u, opts) @@ -405,7 +429,9 @@ func (s *ProjectsService) CreateProjectCard(ctx context.Context, columnID int64, // UpdateProjectCard updates a card of a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/rest/projects/cards#update-an-existing-project-card +// GitHub API docs: https://docs.github.com/rest/projects/cards#update-an-existing-project-card +// +//meta:operation PATCH /projects/columns/cards/{card_id} func (s *ProjectsService) UpdateProjectCard(ctx context.Context, cardID int64, opts *ProjectCardOptions) (*ProjectCard, *Response, error) { u := fmt.Sprintf("projects/columns/cards/%v", cardID) req, err := s.client.NewRequest("PATCH", u, opts) @@ -427,7 +453,9 @@ func (s *ProjectsService) UpdateProjectCard(ctx context.Context, cardID int64, o // DeleteProjectCard deletes a card from a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/rest/projects/cards#delete-a-project-card +// GitHub API docs: https://docs.github.com/rest/projects/cards#delete-a-project-card +// +//meta:operation DELETE /projects/columns/cards/{card_id} func (s *ProjectsService) DeleteProjectCard(ctx context.Context, cardID int64) (*Response, error) { u := fmt.Sprintf("projects/columns/cards/%v", cardID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -455,7 +483,9 @@ type ProjectCardMoveOptions struct { // MoveProjectCard moves a card within a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/rest/projects/cards#move-a-project-card +// GitHub API docs: https://docs.github.com/rest/projects/cards#move-a-project-card +// +//meta:operation POST /projects/columns/cards/{card_id}/moves func (s *ProjectsService) MoveProjectCard(ctx context.Context, cardID int64, opts *ProjectCardMoveOptions) (*Response, error) { u := fmt.Sprintf("projects/columns/cards/%v/moves", cardID) req, err := s.client.NewRequest("POST", u, opts) @@ -485,7 +515,9 @@ type ProjectCollaboratorOptions struct { // AddProjectCollaborator adds a collaborator to an organization project and sets // their permission level. You must be an organization owner or a project admin to add a collaborator. // -// GitHub API docs: https://docs.github.com/en/rest/projects/collaborators#add-project-collaborator +// GitHub API docs: https://docs.github.com/rest/projects/collaborators#add-project-collaborator +// +//meta:operation PUT /projects/{project_id}/collaborators/{username} func (s *ProjectsService) AddProjectCollaborator(ctx context.Context, id int64, username string, opts *ProjectCollaboratorOptions) (*Response, error) { u := fmt.Sprintf("projects/%v/collaborators/%v", id, username) req, err := s.client.NewRequest("PUT", u, opts) @@ -502,7 +534,9 @@ func (s *ProjectsService) AddProjectCollaborator(ctx context.Context, id int64, // RemoveProjectCollaborator removes a collaborator from an organization project. // You must be an organization owner or a project admin to remove a collaborator. // -// GitHub API docs: https://docs.github.com/en/rest/projects/collaborators#remove-user-as-a-collaborator +// GitHub API docs: https://docs.github.com/rest/projects/collaborators#remove-user-as-a-collaborator +// +//meta:operation DELETE /projects/{project_id}/collaborators/{username} func (s *ProjectsService) RemoveProjectCollaborator(ctx context.Context, id int64, username string) (*Response, error) { u := fmt.Sprintf("projects/%v/collaborators/%v", id, username) req, err := s.client.NewRequest("DELETE", u, nil) @@ -538,7 +572,9 @@ type ListCollaboratorOptions struct { // with access through default organization permissions, and organization owners. You must be an // organization owner or a project admin to list collaborators. // -// GitHub API docs: https://docs.github.com/en/rest/projects/collaborators#list-project-collaborators +// GitHub API docs: https://docs.github.com/rest/projects/collaborators#list-project-collaborators +// +//meta:operation GET /projects/{project_id}/collaborators func (s *ProjectsService) ListProjectCollaborators(ctx context.Context, id int64, opts *ListCollaboratorOptions) ([]*User, *Response, error) { u := fmt.Sprintf("projects/%v/collaborators", id) u, err := addOptions(u, opts) @@ -576,7 +612,9 @@ type ProjectPermissionLevel struct { // project. Possible values for the permission key: "admin", "write", "read", "none". // You must be an organization owner or a project admin to review a user's permission level. // -// GitHub API docs: https://docs.github.com/en/rest/projects/collaborators#get-project-permission-for-a-user +// GitHub API docs: https://docs.github.com/rest/projects/collaborators#get-project-permission-for-a-user +// +//meta:operation GET /projects/{project_id}/collaborators/{username}/permission func (s *ProjectsService) ReviewProjectCollaboratorPermission(ctx context.Context, id int64, username string) (*ProjectPermissionLevel, *Response, error) { u := fmt.Sprintf("projects/%v/collaborators/%v/permission", id, username) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/pulls.go b/github/pulls.go index 29549e24b86..80df9fa688a 100644 --- a/github/pulls.go +++ b/github/pulls.go @@ -14,7 +14,7 @@ import ( // PullRequestsService handles communication with the pull request related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/ +// GitHub API docs: https://docs.github.com/rest/pulls/ type PullRequestsService service // PullRequestAutoMerge represents the "auto_merge" response for a PullRequest. @@ -72,7 +72,7 @@ type PullRequest struct { AutoMerge *PullRequestAutoMerge `json:"auto_merge,omitempty"` // RequestedTeams is populated as part of the PullRequestEvent. - // See, https://docs.github.com/en/developers/webhooks-and-events/github-event-types#pullrequestevent for an example. + // See, https://docs.github.com/developers/webhooks-and-events/github-event-types#pullrequestevent for an example. RequestedTeams []*Team `json:"requested_teams,omitempty"` Links *PRLinks `json:"_links,omitempty"` @@ -142,7 +142,9 @@ type PullRequestListOptions struct { // List the pull requests for the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#list-pull-requests +// GitHub API docs: https://docs.github.com/rest/pulls/pulls#list-pull-requests +// +//meta:operation GET /repos/{owner}/{repo}/pulls func (s *PullRequestsService) List(ctx context.Context, owner string, repo string, opts *PullRequestListOptions) ([]*PullRequest, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls", owner, repo) u, err := addOptions(u, opts) @@ -169,7 +171,9 @@ func (s *PullRequestsService) List(ctx context.Context, owner string, repo strin // The results may include open and closed pull requests. // By default, the PullRequestListOptions State filters for "open". // -// GitHub API docs: https://docs.github.com/en/rest/commits/commits#list-pull-requests-associated-with-a-commit +// GitHub API docs: https://docs.github.com/rest/commits/commits#list-pull-requests-associated-with-a-commit +// +//meta:operation GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls func (s *PullRequestsService) ListPullRequestsWithCommit(ctx context.Context, owner, repo, sha string, opts *ListOptions) ([]*PullRequest, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/pulls", owner, repo, sha) u, err := addOptions(u, opts) @@ -195,7 +199,9 @@ func (s *PullRequestsService) ListPullRequestsWithCommit(ctx context.Context, ow // Get a single pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#get-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/pulls#get-a-pull-request +// +//meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number} func (s *PullRequestsService) Get(ctx context.Context, owner string, repo string, number int) (*PullRequest, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d", owner, repo, number) req, err := s.client.NewRequest("GET", u, nil) @@ -214,7 +220,9 @@ func (s *PullRequestsService) Get(ctx context.Context, owner string, repo string // GetRaw gets a single pull request in raw (diff or patch) format. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#get-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/pulls#get-a-pull-request +// +//meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number} func (s *PullRequestsService) GetRaw(ctx context.Context, owner string, repo string, number int, opts RawOptions) (string, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d", owner, repo, number) req, err := s.client.NewRequest("GET", u, nil) @@ -254,7 +262,9 @@ type NewPullRequest struct { // Create a new pull request on the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#create-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/pulls#create-a-pull-request +// +//meta:operation POST /repos/{owner}/{repo}/pulls func (s *PullRequestsService) Create(ctx context.Context, owner string, repo string, pull *NewPullRequest) (*PullRequest, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls", owner, repo) req, err := s.client.NewRequest("POST", u, pull) @@ -293,7 +303,9 @@ type PullRequestBranchUpdateResponse struct { // A follow up request, after a delay of a second or so, should result // in a successful request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#update-a-pull-request-branch +// GitHub API docs: https://docs.github.com/rest/pulls/pulls#update-a-pull-request-branch +// +//meta:operation PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch func (s *PullRequestsService) UpdateBranch(ctx context.Context, owner, repo string, number int, opts *PullRequestBranchUpdateOptions) (*PullRequestBranchUpdateResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/update-branch", owner, repo, number) @@ -328,7 +340,9 @@ type pullRequestUpdate struct { // The following fields are editable: Title, Body, State, Base.Ref and MaintainerCanModify. // Base.Ref updates the base branch of the pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#update-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/pulls#update-a-pull-request +// +//meta:operation PATCH /repos/{owner}/{repo}/pulls/{pull_number} func (s *PullRequestsService) Edit(ctx context.Context, owner string, repo string, number int, pull *PullRequest) (*PullRequest, *Response, error) { if pull == nil { return nil, nil, fmt.Errorf("pull must be provided") @@ -365,7 +379,9 @@ func (s *PullRequestsService) Edit(ctx context.Context, owner string, repo strin // ListCommits lists the commits in a pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#list-commits-on-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/pulls#list-commits-on-a-pull-request +// +//meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/commits func (s *PullRequestsService) ListCommits(ctx context.Context, owner string, repo string, number int, opts *ListOptions) ([]*RepositoryCommit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/commits", owner, repo, number) u, err := addOptions(u, opts) @@ -389,7 +405,9 @@ func (s *PullRequestsService) ListCommits(ctx context.Context, owner string, rep // ListFiles lists the files in a pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#list-pull-requests-files +// GitHub API docs: https://docs.github.com/rest/pulls/pulls#list-pull-requests-files +// +//meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/files func (s *PullRequestsService) ListFiles(ctx context.Context, owner string, repo string, number int, opts *ListOptions) ([]*CommitFile, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/files", owner, repo, number) u, err := addOptions(u, opts) @@ -413,7 +431,9 @@ func (s *PullRequestsService) ListFiles(ctx context.Context, owner string, repo // IsMerged checks if a pull request has been merged. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#check-if-a-pull-request-has-been-merged +// GitHub API docs: https://docs.github.com/rest/pulls/pulls#check-if-a-pull-request-has-been-merged +// +//meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/merge func (s *PullRequestsService) IsMerged(ctx context.Context, owner string, repo string, number int) (bool, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/merge", owner, repo, number) req, err := s.client.NewRequest("GET", u, nil) @@ -455,7 +475,9 @@ type pullRequestMergeRequest struct { // Merge a pull request. // commitMessage is an extra detail to append to automatic commit message. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#merge-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/pulls#merge-a-pull-request +// +//meta:operation PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge func (s *PullRequestsService) Merge(ctx context.Context, owner string, repo string, number int, commitMessage string, options *PullRequestOptions) (*PullRequestMergeResult, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/merge", owner, repo, number) diff --git a/github/pulls_comments.go b/github/pulls_comments.go index ea1cf45d1e8..a9ffe8d7cc1 100644 --- a/github/pulls_comments.go +++ b/github/pulls_comments.go @@ -41,7 +41,7 @@ type PullRequestComment struct { URL *string `json:"url,omitempty"` HTMLURL *string `json:"html_url,omitempty"` PullRequestURL *string `json:"pull_request_url,omitempty"` - // Can be one of: LINE, FILE from https://docs.github.com/en/rest/pulls/comments?apiVersion=2022-11-28#create-a-review-comment-for-a-pull-request + // Can be one of: LINE, FILE from https://docs.github.com/rest/pulls/comments#create-a-review-comment-for-a-pull-request SubjectType *string `json:"subject_type,omitempty"` } @@ -68,8 +68,11 @@ type PullRequestListCommentsOptions struct { // pull request number of 0 will return all comments on all pull requests for // the repository. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/comments#list-review-comments-on-a-pull-request -// GitHub API docs: https://docs.github.com/en/rest/pulls/comments#list-review-comments-in-a-repository +// GitHub API docs: https://docs.github.com/rest/pulls/comments#list-review-comments-in-a-repository +// GitHub API docs: https://docs.github.com/rest/pulls/comments#list-review-comments-on-a-pull-request +// +//meta:operation GET /repos/{owner}/{repo}/pulls/comments +//meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/comments func (s *PullRequestsService) ListComments(ctx context.Context, owner, repo string, number int, opts *PullRequestListCommentsOptions) ([]*PullRequestComment, *Response, error) { var u string if number == 0 { @@ -102,7 +105,9 @@ func (s *PullRequestsService) ListComments(ctx context.Context, owner, repo stri // GetComment fetches the specified pull request comment. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/comments#get-a-review-comment-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request +// +//meta:operation GET /repos/{owner}/{repo}/pulls/comments/{comment_id} func (s *PullRequestsService) GetComment(ctx context.Context, owner, repo string, commentID int64) (*PullRequestComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%d", owner, repo, commentID) req, err := s.client.NewRequest("GET", u, nil) @@ -125,7 +130,9 @@ func (s *PullRequestsService) GetComment(ctx context.Context, owner, repo string // CreateComment creates a new comment on the specified pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/comments#create-a-review-comment-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/comments#create-a-review-comment-for-a-pull-request +// +//meta:operation POST /repos/{owner}/{repo}/pulls/{pull_number}/comments func (s *PullRequestsService) CreateComment(ctx context.Context, owner, repo string, number int, comment *PullRequestComment) (*PullRequestComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/comments", owner, repo, number) req, err := s.client.NewRequest("POST", u, comment) @@ -147,7 +154,9 @@ func (s *PullRequestsService) CreateComment(ctx context.Context, owner, repo str // CreateCommentInReplyTo creates a new comment as a reply to an existing pull request comment. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/comments#create-a-review-comment-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/comments#create-a-review-comment-for-a-pull-request +// +//meta:operation POST /repos/{owner}/{repo}/pulls/{pull_number}/comments func (s *PullRequestsService) CreateCommentInReplyTo(ctx context.Context, owner, repo string, number int, body string, commentID int64) (*PullRequestComment, *Response, error) { comment := &struct { Body string `json:"body,omitempty"` @@ -174,7 +183,9 @@ func (s *PullRequestsService) CreateCommentInReplyTo(ctx context.Context, owner, // EditComment updates a pull request comment. // A non-nil comment.Body must be provided. Other comment fields should be left nil. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/comments#update-a-review-comment-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/comments#update-a-review-comment-for-a-pull-request +// +//meta:operation PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id} func (s *PullRequestsService) EditComment(ctx context.Context, owner, repo string, commentID int64, comment *PullRequestComment) (*PullRequestComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%d", owner, repo, commentID) req, err := s.client.NewRequest("PATCH", u, comment) @@ -193,7 +204,9 @@ func (s *PullRequestsService) EditComment(ctx context.Context, owner, repo strin // DeleteComment deletes a pull request comment. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/comments#delete-a-review-comment-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/comments#delete-a-review-comment-for-a-pull-request +// +//meta:operation DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id} func (s *PullRequestsService) DeleteComment(ctx context.Context, owner, repo string, commentID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%d", owner, repo, commentID) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/pulls_reviewers.go b/github/pulls_reviewers.go index 1c336540b81..3f0c50b746a 100644 --- a/github/pulls_reviewers.go +++ b/github/pulls_reviewers.go @@ -25,7 +25,9 @@ type Reviewers struct { // RequestReviewers creates a review request for the provided reviewers for the specified pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/review-requests#request-reviewers-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/review-requests#request-reviewers-for-a-pull-request +// +//meta:operation POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers func (s *PullRequestsService) RequestReviewers(ctx context.Context, owner, repo string, number int, reviewers ReviewersRequest) (*PullRequest, *Response, error) { u := fmt.Sprintf("repos/%s/%s/pulls/%d/requested_reviewers", owner, repo, number) req, err := s.client.NewRequest("POST", u, &reviewers) @@ -44,7 +46,9 @@ func (s *PullRequestsService) RequestReviewers(ctx context.Context, owner, repo // ListReviewers lists reviewers whose reviews have been requested on the specified pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/review-requests#list-requested-reviewers-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/review-requests#get-all-requested-reviewers-for-a-pull-request +// +//meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers func (s *PullRequestsService) ListReviewers(ctx context.Context, owner, repo string, number int, opts *ListOptions) (*Reviewers, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/requested_reviewers", owner, repo, number) u, err := addOptions(u, opts) @@ -68,7 +72,9 @@ func (s *PullRequestsService) ListReviewers(ctx context.Context, owner, repo str // RemoveReviewers removes the review request for the provided reviewers for the specified pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/review-requests#remove-requested-reviewers-from-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/review-requests#remove-requested-reviewers-from-a-pull-request +// +//meta:operation DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers func (s *PullRequestsService) RemoveReviewers(ctx context.Context, owner, repo string, number int, reviewers ReviewersRequest) (*Response, error) { u := fmt.Sprintf("repos/%s/%s/pulls/%d/requested_reviewers", owner, repo, number) req, err := s.client.NewRequest("DELETE", u, &reviewers) diff --git a/github/pulls_reviews.go b/github/pulls_reviews.go index addcce46834..27b8dc37d5d 100644 --- a/github/pulls_reviews.go +++ b/github/pulls_reviews.go @@ -100,7 +100,9 @@ func (r PullRequestReviewDismissalRequest) String() string { // ListReviews lists all reviews on the specified pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#list-reviews-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/reviews#list-reviews-for-a-pull-request +// +//meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews func (s *PullRequestsService) ListReviews(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews", owner, repo, number) u, err := addOptions(u, opts) @@ -124,7 +126,9 @@ func (s *PullRequestsService) ListReviews(ctx context.Context, owner, repo strin // GetReview fetches the specified pull request review. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#get-a-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/reviews#get-a-review-for-a-pull-request +// +//meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} func (s *PullRequestsService) GetReview(ctx context.Context, owner, repo string, number int, reviewID int64) (*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d", owner, repo, number, reviewID) @@ -144,7 +148,9 @@ func (s *PullRequestsService) GetReview(ctx context.Context, owner, repo string, // DeletePendingReview deletes the specified pull request pending review. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#delete-a-pending-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/reviews#delete-a-pending-review-for-a-pull-request +// +//meta:operation DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} func (s *PullRequestsService) DeletePendingReview(ctx context.Context, owner, repo string, number int, reviewID int64) (*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d", owner, repo, number, reviewID) @@ -164,7 +170,9 @@ func (s *PullRequestsService) DeletePendingReview(ctx context.Context, owner, re // ListReviewComments lists all the comments for the specified review. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#list-comments-for-a-pull-request-review +// GitHub API docs: https://docs.github.com/rest/pulls/reviews#list-comments-for-a-pull-request-review +// +//meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments func (s *PullRequestsService) ListReviewComments(ctx context.Context, owner, repo string, number int, reviewID int64, opts *ListOptions) ([]*PullRequestComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d/comments", owner, repo, number, reviewID) u, err := addOptions(u, opts) @@ -188,8 +196,6 @@ func (s *PullRequestsService) ListReviewComments(ctx context.Context, owner, rep // CreateReview creates a new review on the specified pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#create-a-review-for-a-pull-request -// // In order to use multi-line comments, you must use the "comfort fade" preview. // This replaces the use of the "Position" field in comments with 4 new fields: // @@ -223,6 +229,10 @@ func (s *PullRequestsService) ListReviewComments(ctx context.Context, owner, rep // Use this instead. // It is waaaaaay better. // ``` +// +// GitHub API docs: https://docs.github.com/rest/pulls/reviews#create-a-review-for-a-pull-request +// +//meta:operation POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews func (s *PullRequestsService) CreateReview(ctx context.Context, owner, repo string, number int, review *PullRequestReviewRequest) (*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews", owner, repo, number) @@ -251,7 +261,9 @@ func (s *PullRequestsService) CreateReview(ctx context.Context, owner, repo stri // UpdateReview updates the review summary on the specified pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#update-a-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/reviews#update-a-review-for-a-pull-request +// +//meta:operation PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} func (s *PullRequestsService) UpdateReview(ctx context.Context, owner, repo string, number int, reviewID int64, body string) (*PullRequestReview, *Response, error) { opts := &struct { Body string `json:"body"` @@ -274,7 +286,9 @@ func (s *PullRequestsService) UpdateReview(ctx context.Context, owner, repo stri // SubmitReview submits a specified review on the specified pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#submit-a-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/reviews#submit-a-review-for-a-pull-request +// +//meta:operation POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events func (s *PullRequestsService) SubmitReview(ctx context.Context, owner, repo string, number int, reviewID int64, review *PullRequestReviewRequest) (*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d/events", owner, repo, number, reviewID) @@ -294,7 +308,9 @@ func (s *PullRequestsService) SubmitReview(ctx context.Context, owner, repo stri // DismissReview dismisses a specified review on the specified pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#dismiss-a-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/reviews#dismiss-a-review-for-a-pull-request +// +//meta:operation PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals func (s *PullRequestsService) DismissReview(ctx context.Context, owner, repo string, number int, reviewID int64, review *PullRequestReviewDismissalRequest) (*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d/dismissals", owner, repo, number, reviewID) diff --git a/github/rate_limit.go b/github/rate_limit.go index 838c3ba7966..0fc15f815e2 100644 --- a/github/rate_limit.go +++ b/github/rate_limit.go @@ -59,6 +59,10 @@ func (r RateLimits) String() string { } // Get returns the rate limits for the current client. +// +// GitHub API docs: https://docs.github.com/rest/rate-limit/rate-limit#get-rate-limit-status-for-the-authenticated-user +// +//meta:operation GET /rate_limit func (s *RateLimitService) Get(ctx context.Context) (*RateLimits, *Response, error) { req, err := s.client.NewRequest("GET", "rate_limit", nil) if err != nil { diff --git a/github/reactions.go b/github/reactions.go index f06a8ef3dbc..1aa7ac38f2a 100644 --- a/github/reactions.go +++ b/github/reactions.go @@ -14,7 +14,7 @@ import ( // ReactionsService provides access to the reactions-related functions in the // GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/reactions +// GitHub API docs: https://docs.github.com/rest/reactions type ReactionsService service // Reaction represents a GitHub reaction. @@ -60,7 +60,9 @@ type ListCommentReactionOptions struct { // ListCommentReactions lists the reactions for a commit comment. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#list-reactions-for-a-commit-comment +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-commit-comment +// +//meta:operation GET /repos/{owner}/{repo}/comments/{comment_id}/reactions func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListCommentReactionOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) u, err := addOptions(u, opts) @@ -90,7 +92,9 @@ func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo // previously created reaction will be returned with Status: 200 OK. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-a-commit-comment +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-commit-comment +// +//meta:operation POST /repos/{owner}/{repo}/comments/{comment_id}/reactions func (s *ReactionsService) CreateCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) @@ -114,7 +118,9 @@ func (s *ReactionsService) CreateCommentReaction(ctx context.Context, owner, rep // DeleteCommentReaction deletes the reaction for a commit comment. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-a-commit-comment-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-commit-comment-reaction +// +//meta:operation DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id} func (s *ReactionsService) DeleteCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions/%v", owner, repo, commentID, reactionID) @@ -123,7 +129,9 @@ func (s *ReactionsService) DeleteCommentReaction(ctx context.Context, owner, rep // DeleteCommentReactionByID deletes the reaction for a commit comment by repository ID. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-a-commit-comment-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-commit-comment-reaction +// +//meta:operation DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id} func (s *ReactionsService) DeleteCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { u := fmt.Sprintf("repositories/%v/comments/%v/reactions/%v", repoID, commentID, reactionID) @@ -132,7 +140,9 @@ func (s *ReactionsService) DeleteCommentReactionByID(ctx context.Context, repoID // ListIssueReactions lists the reactions for an issue. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#list-reactions-for-an-issue +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue +// +//meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/reactions func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) u, err := addOptions(u, opts) @@ -162,7 +172,9 @@ func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo s // previously created reaction will be returned with Status: 200 OK. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-an-issue +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue +// +//meta:operation POST /repos/{owner}/{repo}/issues/{issue_number}/reactions func (s *ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo string, number int, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) @@ -186,7 +198,9 @@ func (s *ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo // DeleteIssueReaction deletes the reaction to an issue. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-an-issue-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-an-issue-reaction +// +//meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id} func (s *ReactionsService) DeleteIssueReaction(ctx context.Context, owner, repo string, issueNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/issues/%v/reactions/%v", owner, repo, issueNumber, reactionID) @@ -195,7 +209,9 @@ func (s *ReactionsService) DeleteIssueReaction(ctx context.Context, owner, repo // DeleteIssueReactionByID deletes the reaction to an issue by repository ID. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-an-issue-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-an-issue-reaction +// +//meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id} func (s *ReactionsService) DeleteIssueReactionByID(ctx context.Context, repoID, issueNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("repositories/%v/issues/%v/reactions/%v", repoID, issueNumber, reactionID) @@ -204,7 +220,9 @@ func (s *ReactionsService) DeleteIssueReactionByID(ctx context.Context, repoID, // ListIssueCommentReactions lists the reactions for an issue comment. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#list-reactions-for-an-issue-comment +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue-comment +// +//meta:operation GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) u, err := addOptions(u, opts) @@ -234,7 +252,9 @@ func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, // previously created reaction will be returned with Status: 200 OK. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-an-issue-comment +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue-comment +// +//meta:operation POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions func (s *ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) @@ -258,7 +278,9 @@ func (s *ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner // DeleteIssueCommentReaction deletes the reaction to an issue comment. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-an-issue-comment-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-an-issue-comment-reaction +// +//meta:operation DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id} func (s *ReactionsService) DeleteIssueCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions/%v", owner, repo, commentID, reactionID) @@ -267,7 +289,9 @@ func (s *ReactionsService) DeleteIssueCommentReaction(ctx context.Context, owner // DeleteIssueCommentReactionByID deletes the reaction to an issue comment by repository ID. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-an-issue-comment-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-an-issue-comment-reaction +// +//meta:operation DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id} func (s *ReactionsService) DeleteIssueCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { url := fmt.Sprintf("repositories/%v/issues/comments/%v/reactions/%v", repoID, commentID, reactionID) @@ -276,7 +300,9 @@ func (s *ReactionsService) DeleteIssueCommentReactionByID(ctx context.Context, r // ListPullRequestCommentReactions lists the reactions for a pull request review comment. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#list-reactions-for-a-pull-request-review-comment +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-pull-request-review-comment +// +//meta:operation GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) u, err := addOptions(u, opts) @@ -306,7 +332,9 @@ func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, // previously created reaction will be returned with Status: 200 OK. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-a-pull-request-review-comment +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-pull-request-review-comment +// +//meta:operation POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions func (s *ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) @@ -330,7 +358,9 @@ func (s *ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, // DeletePullRequestCommentReaction deletes the reaction to a pull request review comment. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-a-pull-request-comment-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-pull-request-comment-reaction +// +//meta:operation DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id} func (s *ReactionsService) DeletePullRequestCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions/%v", owner, repo, commentID, reactionID) @@ -339,7 +369,9 @@ func (s *ReactionsService) DeletePullRequestCommentReaction(ctx context.Context, // DeletePullRequestCommentReactionByID deletes the reaction to a pull request review comment by repository ID. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-a-pull-request-comment-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-pull-request-comment-reaction +// +//meta:operation DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id} func (s *ReactionsService) DeletePullRequestCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { url := fmt.Sprintf("repositories/%v/pulls/comments/%v/reactions/%v", repoID, commentID, reactionID) @@ -348,7 +380,9 @@ func (s *ReactionsService) DeletePullRequestCommentReactionByID(ctx context.Cont // ListTeamDiscussionReactions lists the reactions for a team discussion. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#list-reactions-for-a-team-discussion-legacy +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-legacy +// +//meta:operation GET /teams/{team_id}/discussions/{discussion_number}/reactions func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, teamID int64, discussionNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) u, err := addOptions(u, opts) @@ -375,7 +409,9 @@ func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, team // CreateTeamDiscussionReaction creates a reaction for a team discussion. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-a-team-discussion-legacy +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-legacy +// +//meta:operation POST /teams/{team_id}/discussions/{discussion_number}/reactions func (s *ReactionsService) CreateTeamDiscussionReaction(ctx context.Context, teamID int64, discussionNumber int, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) @@ -398,7 +434,9 @@ func (s *ReactionsService) CreateTeamDiscussionReaction(ctx context.Context, tea // DeleteTeamDiscussionReaction deletes the reaction to a team discussion. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-team-discussion-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-team-discussion-reaction +// +//meta:operation DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id} func (s *ReactionsService) DeleteTeamDiscussionReaction(ctx context.Context, org, teamSlug string, discussionNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/reactions/%v", org, teamSlug, discussionNumber, reactionID) @@ -407,7 +445,9 @@ func (s *ReactionsService) DeleteTeamDiscussionReaction(ctx context.Context, org // DeleteTeamDiscussionReactionByOrgIDAndTeamID deletes the reaction to a team discussion by organization ID and team ID. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-a-team-discussion +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion +// +//meta:operation POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions func (s *ReactionsService) DeleteTeamDiscussionReactionByOrgIDAndTeamID(ctx context.Context, orgID, teamID, discussionNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/reactions/%v", orgID, teamID, discussionNumber, reactionID) @@ -416,7 +456,9 @@ func (s *ReactionsService) DeleteTeamDiscussionReactionByOrgIDAndTeamID(ctx cont // ListTeamDiscussionCommentReactions lists the reactions for a team discussion comment. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#list-reactions-for-a-team-discussion-comment-legacy +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment-legacy +// +//meta:operation GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Context, teamID int64, discussionNumber, commentNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) u, err := addOptions(u, opts) @@ -442,7 +484,9 @@ func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Contex // CreateTeamDiscussionCommentReaction creates a reaction for a team discussion comment. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-a-team-discussion-comment-legacy +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment-legacy +// +//meta:operation POST /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions func (s *ReactionsService) CreateTeamDiscussionCommentReaction(ctx context.Context, teamID int64, discussionNumber, commentNumber int, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) @@ -465,7 +509,9 @@ func (s *ReactionsService) CreateTeamDiscussionCommentReaction(ctx context.Conte // DeleteTeamDiscussionCommentReaction deletes the reaction to a team discussion comment. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-team-discussion-comment-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-team-discussion-comment-reaction +// +//meta:operation DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id} func (s *ReactionsService) DeleteTeamDiscussionCommentReaction(ctx context.Context, org, teamSlug string, discussionNumber, commentNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v/reactions/%v", org, teamSlug, discussionNumber, commentNumber, reactionID) @@ -474,7 +520,9 @@ func (s *ReactionsService) DeleteTeamDiscussionCommentReaction(ctx context.Conte // DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID deletes the reaction to a team discussion comment by organization ID and team ID. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-a-team-discussion-comment +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment +// +//meta:operation POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions func (s *ReactionsService) DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID(ctx context.Context, orgID, teamID, discussionNumber, commentNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v/reactions/%v", orgID, teamID, discussionNumber, commentNumber, reactionID) @@ -498,7 +546,9 @@ func (s *ReactionsService) deleteReaction(ctx context.Context, url string) (*Res // added the reaction type to this release. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-a-release +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-release +// +//meta:operation POST /repos/{owner}/{repo}/releases/{release_id}/reactions func (s *ReactionsService) CreateReleaseReaction(ctx context.Context, owner, repo string, releaseID int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/releases/%v/reactions", owner, repo, releaseID) diff --git a/github/repos.go b/github/repos.go index 60ff9b41347..e158562e69d 100644 --- a/github/repos.go +++ b/github/repos.go @@ -22,7 +22,7 @@ var ErrBranchNotProtected = errors.New("branch is not protected") // RepositoriesService handles communication with the repository related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/repos/ +// GitHub API docs: https://docs.github.com/rest/repos/ type RepositoriesService service // Repository represents a GitHub repository. @@ -141,7 +141,7 @@ type Repository struct { TeamsURL *string `json:"teams_url,omitempty"` // TextMatches is only populated from search results that request text matches - // See: search.go and https://docs.github.com/en/rest/search/#text-match-metadata + // See: search.go and https://docs.github.com/rest/search/#text-match-metadata TextMatches []*TextMatch `json:"text_matches,omitempty"` // Visibility is only used for Create and Edit endpoints. The visibility field @@ -150,7 +150,7 @@ type Repository struct { Visibility *string `json:"visibility,omitempty"` // RoleName is only returned by the API 'check team permissions for a repository'. - // See: teams.go (IsTeamRepoByID) https://docs.github.com/en/rest/teams/teams#check-team-permissions-for-a-repository + // See: teams.go (IsTeamRepoByID) https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository RoleName *string `json:"role_name,omitempty"` } @@ -220,7 +220,7 @@ func (s SecurityAndAnalysis) String() string { // AdvancedSecurity specifies the state of advanced security on a repository. // -// GitHub API docs: https://docs.github.com/en/github/getting-started-with-github/learning-about-github/about-github-advanced-security +// GitHub API docs: https://docs.github.com/github/getting-started-with-github/learning-about-github/about-github-advanced-security type AdvancedSecurity struct { Status *string `json:"status,omitempty"` } @@ -231,7 +231,7 @@ func (a AdvancedSecurity) String() string { // SecretScanning specifies the state of secret scanning on a repository. // -// GitHub API docs: https://docs.github.com/en/code-security/secret-security/about-secret-scanning +// GitHub API docs: https://docs.github.com/code-security/secret-security/about-secret-scanning type SecretScanning struct { Status *string `json:"status,omitempty"` } @@ -242,7 +242,7 @@ func (s SecretScanning) String() string { // SecretScanningPushProtection specifies the state of secret scanning push protection on a repository. // -// GitHub API docs: https://docs.github.com/en/code-security/secret-scanning/about-secret-scanning#about-secret-scanning-for-partner-patterns +// GitHub API docs: https://docs.github.com/code-security/secret-scanning/about-secret-scanning#about-secret-scanning-for-partner-patterns type SecretScanningPushProtection struct { Status *string `json:"status,omitempty"` } @@ -253,7 +253,7 @@ func (s SecretScanningPushProtection) String() string { // DependabotSecurityUpdates specifies the state of Dependabot security updates on a repository. // -// GitHub API docs: https://docs.github.com/en/code-security/dependabot/dependabot-security-updates/about-dependabot-security-updates +// GitHub API docs: https://docs.github.com/code-security/dependabot/dependabot-security-updates/about-dependabot-security-updates type DependabotSecurityUpdates struct { Status *string `json:"status,omitempty"` } @@ -265,8 +265,11 @@ func (d DependabotSecurityUpdates) String() string { // List the repositories for a user. Passing the empty string will list // repositories for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-repositories-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-repositories-for-a-user +// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repositories-for-a-user +// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repositories-for-the-authenticated-user +// +//meta:operation GET /user/repos +//meta:operation GET /users/{username}/repos func (s *RepositoriesService) List(ctx context.Context, user string, opts *RepositoryListOptions) ([]*Repository, *Response, error) { var u string if user != "" { @@ -317,7 +320,9 @@ type RepositoryListByOrgOptions struct { // ListByOrg lists the repositories for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-organization-repositories +// GitHub API docs: https://docs.github.com/rest/repos/repos#list-organization-repositories +// +//meta:operation GET /orgs/{org}/repos func (s *RepositoriesService) ListByOrg(ctx context.Context, org string, opts *RepositoryListByOrgOptions) ([]*Repository, *Response, error) { u := fmt.Sprintf("orgs/%v/repos", org) u, err := addOptions(u, opts) @@ -352,7 +357,9 @@ type RepositoryListAllOptions struct { // ListAll lists all GitHub repositories in the order that they were created. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-public-repositories +// GitHub API docs: https://docs.github.com/rest/repos/repos#list-public-repositories +// +//meta:operation GET /repositories func (s *RepositoriesService) ListAll(ctx context.Context, opts *RepositoryListAllOptions) ([]*Repository, *Response, error) { u, err := addOptions("repositories", opts) if err != nil { @@ -424,8 +431,11 @@ type createRepoRequest struct { // changes propagate throughout its servers. You may set up a loop with // exponential back-off to verify repository's creation. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#create-a-repository-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#create-an-organization-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos#create-a-repository-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/repos/repos#create-an-organization-repository +// +//meta:operation POST /orgs/{org}/repos +//meta:operation POST /user/repos func (s *RepositoriesService) Create(ctx context.Context, org string, repo *Repository) (*Repository, *Response, error) { var u string if org != "" { @@ -492,7 +502,9 @@ type TemplateRepoRequest struct { // CreateFromTemplate generates a repository from a template. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#create-a-repository-using-a-template +// GitHub API docs: https://docs.github.com/rest/repos/repos#create-a-repository-using-a-template +// +//meta:operation POST /repos/{template_owner}/{template_repo}/generate func (s *RepositoriesService) CreateFromTemplate(ctx context.Context, templateOwner, templateRepo string, templateRepoReq *TemplateRepoRequest) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/generate", templateOwner, templateRepo) @@ -513,7 +525,9 @@ func (s *RepositoriesService) CreateFromTemplate(ctx context.Context, templateOw // Get fetches a repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#get-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos#get-a-repository +// +//meta:operation GET /repos/{owner}/{repo} func (s *RepositoriesService) Get(ctx context.Context, owner, repo string) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -522,7 +536,7 @@ func (s *RepositoriesService) Get(ctx context.Context, owner, repo string) (*Rep } // TODO: remove custom Accept header when the license support fully launches - // https://docs.github.com/en/rest/licenses/#get-a-repositorys-license + // https://docs.github.com/rest/licenses/#get-a-repositorys-license acceptHeaders := []string{ mediaTypeCodesOfConductPreview, mediaTypeTopicsPreview, @@ -541,10 +555,12 @@ func (s *RepositoriesService) Get(ctx context.Context, owner, repo string) (*Rep } // GetCodeOfConduct gets the contents of a repository's code of conduct. -// Note that https://docs.github.com/en/rest/codes-of-conduct#about-the-codes-of-conduct-api +// Note that https://docs.github.com/rest/codes-of-conduct#about-the-codes-of-conduct-api // says to use the GET /repos/{owner}/{repo} endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#update-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos#get-a-repository +// +//meta:operation GET /repos/{owner}/{repo} func (s *RepositoriesService) GetCodeOfConduct(ctx context.Context, owner, repo string) (*CodeOfConduct, *Response, error) { u := fmt.Sprintf("repos/%v/%v", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -566,7 +582,9 @@ func (s *RepositoriesService) GetCodeOfConduct(ctx context.Context, owner, repo // GetByID fetches a repository. // -// Note: GetByID uses the undocumented GitHub API endpoint /repositories/:id. +// Note: GetByID uses the undocumented GitHub API endpoint "GET /repositories/{repository_id}". +// +//meta:operation GET /repositories/{repository_id} func (s *RepositoriesService) GetByID(ctx context.Context, id int64) (*Repository, *Response, error) { u := fmt.Sprintf("repositories/%d", id) req, err := s.client.NewRequest("GET", u, nil) @@ -585,7 +603,9 @@ func (s *RepositoriesService) GetByID(ctx context.Context, id int64) (*Repositor // Edit updates a repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#update-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos#update-a-repository +// +//meta:operation PATCH /repos/{owner}/{repo} func (s *RepositoriesService) Edit(ctx context.Context, owner, repo string, repository *Repository) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v", owner, repo) req, err := s.client.NewRequest("PATCH", u, repository) @@ -606,7 +626,9 @@ func (s *RepositoriesService) Edit(ctx context.Context, owner, repo string, repo // Delete a repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#delete-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos#delete-a-repository +// +//meta:operation DELETE /repos/{owner}/{repo} func (s *RepositoriesService) Delete(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v", owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) @@ -653,7 +675,9 @@ type ListContributorsOptions struct { // GetVulnerabilityAlerts checks if vulnerability alerts are enabled for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#check-if-vulnerability-alerts-are-enabled-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos#check-if-vulnerability-alerts-are-enabled-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/vulnerability-alerts func (s *RepositoriesService) GetVulnerabilityAlerts(ctx context.Context, owner, repository string) (bool, *Response, error) { u := fmt.Sprintf("repos/%v/%v/vulnerability-alerts", owner, repository) @@ -672,7 +696,9 @@ func (s *RepositoriesService) GetVulnerabilityAlerts(ctx context.Context, owner, // EnableVulnerabilityAlerts enables vulnerability alerts and the dependency graph for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#enable-vulnerability-alerts +// GitHub API docs: https://docs.github.com/rest/repos/repos#enable-vulnerability-alerts +// +//meta:operation PUT /repos/{owner}/{repo}/vulnerability-alerts func (s *RepositoriesService) EnableVulnerabilityAlerts(ctx context.Context, owner, repository string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/vulnerability-alerts", owner, repository) @@ -689,7 +715,9 @@ func (s *RepositoriesService) EnableVulnerabilityAlerts(ctx context.Context, own // DisableVulnerabilityAlerts disables vulnerability alerts and the dependency graph for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#disable-vulnerability-alerts +// GitHub API docs: https://docs.github.com/rest/repos/repos#disable-vulnerability-alerts +// +//meta:operation DELETE /repos/{owner}/{repo}/vulnerability-alerts func (s *RepositoriesService) DisableVulnerabilityAlerts(ctx context.Context, owner, repository string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/vulnerability-alerts", owner, repository) @@ -706,7 +734,9 @@ func (s *RepositoriesService) DisableVulnerabilityAlerts(ctx context.Context, ow // GetAutomatedSecurityFixes checks if the automated security fixes for a repository are enabled. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#check-if-automated-security-fixes-are-enabled-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos#check-if-automated-security-fixes-are-enabled-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/automated-security-fixes func (s *RepositoriesService) GetAutomatedSecurityFixes(ctx context.Context, owner, repository string) (*AutomatedSecurityFixes, *Response, error) { u := fmt.Sprintf("repos/%v/%v/automated-security-fixes", owner, repository) @@ -725,7 +755,9 @@ func (s *RepositoriesService) GetAutomatedSecurityFixes(ctx context.Context, own // EnableAutomatedSecurityFixes enables the automated security fixes for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#enable-automated-security-fixes +// GitHub API docs: https://docs.github.com/rest/repos/repos#enable-automated-security-fixes +// +//meta:operation PUT /repos/{owner}/{repo}/automated-security-fixes func (s *RepositoriesService) EnableAutomatedSecurityFixes(ctx context.Context, owner, repository string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/automated-security-fixes", owner, repository) @@ -739,7 +771,9 @@ func (s *RepositoriesService) EnableAutomatedSecurityFixes(ctx context.Context, // DisableAutomatedSecurityFixes disables vulnerability alerts and the dependency graph for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#disable-automated-security-fixes +// GitHub API docs: https://docs.github.com/rest/repos/repos#disable-automated-security-fixes +// +//meta:operation DELETE /repos/{owner}/{repo}/automated-security-fixes func (s *RepositoriesService) DisableAutomatedSecurityFixes(ctx context.Context, owner, repository string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/automated-security-fixes", owner, repository) @@ -753,7 +787,9 @@ func (s *RepositoriesService) DisableAutomatedSecurityFixes(ctx context.Context, // ListContributors lists contributors for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-repository-contributors +// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-contributors +// +//meta:operation GET /repos/{owner}/{repo}/contributors func (s *RepositoriesService) ListContributors(ctx context.Context, owner string, repository string, opts *ListContributorsOptions) ([]*Contributor, *Response, error) { u := fmt.Sprintf("repos/%v/%v/contributors", owner, repository) u, err := addOptions(u, opts) @@ -784,7 +820,9 @@ func (s *RepositoriesService) ListContributors(ctx context.Context, owner string // "Python": 7769 // } // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-repository-languages +// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-languages +// +//meta:operation GET /repos/{owner}/{repo}/languages func (s *RepositoriesService) ListLanguages(ctx context.Context, owner string, repo string) (map[string]int, *Response, error) { u := fmt.Sprintf("repos/%v/%v/languages", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -803,7 +841,9 @@ func (s *RepositoriesService) ListLanguages(ctx context.Context, owner string, r // ListTeams lists the teams for the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-repository-teams +// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-teams +// +//meta:operation GET /repos/{owner}/{repo}/teams func (s *RepositoriesService) ListTeams(ctx context.Context, owner string, repo string, opts *ListOptions) ([]*Team, *Response, error) { u := fmt.Sprintf("repos/%v/%v/teams", owner, repo) u, err := addOptions(u, opts) @@ -835,7 +875,9 @@ type RepositoryTag struct { // ListTags lists tags for the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-repository-tags +// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-tags +// +//meta:operation GET /repos/{owner}/{repo}/tags func (s *RepositoriesService) ListTags(ctx context.Context, owner string, repo string, opts *ListOptions) ([]*RepositoryTag, *Response, error) { u := fmt.Sprintf("repos/%v/%v/tags", owner, repo) u, err := addOptions(u, opts) @@ -1251,7 +1293,9 @@ type AutomatedSecurityFixes struct { // ListBranches lists branches for the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branches#list-branches +// GitHub API docs: https://docs.github.com/rest/branches/branches#list-branches +// +//meta:operation GET /repos/{owner}/{repo}/branches func (s *RepositoriesService) ListBranches(ctx context.Context, owner string, repo string, opts *BranchListOptions) ([]*Branch, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches", owner, repo) u, err := addOptions(u, opts) @@ -1277,7 +1321,9 @@ func (s *RepositoriesService) ListBranches(ctx context.Context, owner string, re // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branches#get-a-branch +// GitHub API docs: https://docs.github.com/rest/branches/branches#get-a-branch +// +//meta:operation GET /repos/{owner}/{repo}/branches/{branch} func (s *RepositoriesService) GetBranch(ctx context.Context, owner, repo, branch string, maxRedirects int) (*Branch, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v", owner, repo, url.PathEscape(branch)) @@ -1308,7 +1354,9 @@ type renameBranchRequest struct { // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branches#rename-a-branch +// GitHub API docs: https://docs.github.com/rest/branches/branches#rename-a-branch +// +//meta:operation POST /repos/{owner}/{repo}/branches/{branch}/rename func (s *RepositoriesService) RenameBranch(ctx context.Context, owner, repo, branch, newName string) (*Branch, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/rename", owner, repo, url.PathEscape(branch)) r := &renameBranchRequest{NewName: newName} @@ -1330,7 +1378,9 @@ func (s *RepositoriesService) RenameBranch(ctx context.Context, owner, repo, bra // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-branch-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-branch-protection +// +//meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection func (s *RepositoriesService) GetBranchProtection(ctx context.Context, owner, repo, branch string) (*Protection, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("GET", u, nil) @@ -1357,7 +1407,9 @@ func (s *RepositoriesService) GetBranchProtection(ctx context.Context, owner, re // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-status-checks-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-status-checks-protection +// +//meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks func (s *RepositoriesService) GetRequiredStatusChecks(ctx context.Context, owner, repo, branch string) (*RequiredStatusChecks, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_status_checks", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("GET", u, nil) @@ -1381,7 +1433,9 @@ func (s *RepositoriesService) GetRequiredStatusChecks(ctx context.Context, owner // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-all-status-check-contexts +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-all-status-check-contexts +// +//meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts func (s *RepositoriesService) ListRequiredStatusChecksContexts(ctx context.Context, owner, repo, branch string) (contexts []string, resp *Response, err error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_status_checks/contexts", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("GET", u, nil) @@ -1404,7 +1458,9 @@ func (s *RepositoriesService) ListRequiredStatusChecksContexts(ctx context.Conte // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#update-branch-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#update-branch-protection +// +//meta:operation PUT /repos/{owner}/{repo}/branches/{branch}/protection func (s *RepositoriesService) UpdateBranchProtection(ctx context.Context, owner, repo, branch string, preq *ProtectionRequest) (*Protection, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("PUT", u, preq) @@ -1428,7 +1484,9 @@ func (s *RepositoriesService) UpdateBranchProtection(ctx context.Context, owner, // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#delete-branch-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#delete-branch-protection +// +//meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection func (s *RepositoriesService) RemoveBranchProtection(ctx context.Context, owner, repo, branch string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("DELETE", u, nil) @@ -1443,7 +1501,9 @@ func (s *RepositoriesService) RemoveBranchProtection(ctx context.Context, owner, // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-commit-signature-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-commit-signature-protection +// +//meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures func (s *RepositoriesService) GetSignaturesProtectedBranch(ctx context.Context, owner, repo, branch string) (*SignaturesProtectedBranch, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_signatures", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("GET", u, nil) @@ -1468,7 +1528,9 @@ func (s *RepositoriesService) GetSignaturesProtectedBranch(ctx context.Context, // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#create-commit-signature-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#create-commit-signature-protection +// +//meta:operation POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures func (s *RepositoriesService) RequireSignaturesOnProtectedBranch(ctx context.Context, owner, repo, branch string) (*SignaturesProtectedBranch, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_signatures", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("POST", u, nil) @@ -1492,7 +1554,9 @@ func (s *RepositoriesService) RequireSignaturesOnProtectedBranch(ctx context.Con // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#delete-commit-signature-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#delete-commit-signature-protection +// +//meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures func (s *RepositoriesService) OptionalSignaturesOnProtectedBranch(ctx context.Context, owner, repo, branch string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_signatures", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("DELETE", u, nil) @@ -1510,7 +1574,9 @@ func (s *RepositoriesService) OptionalSignaturesOnProtectedBranch(ctx context.Co // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#update-status-check-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#update-status-check-protection +// +//meta:operation PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks func (s *RepositoriesService) UpdateRequiredStatusChecks(ctx context.Context, owner, repo, branch string, sreq *RequiredStatusChecksRequest) (*RequiredStatusChecks, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_status_checks", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("PATCH", u, sreq) @@ -1531,7 +1597,9 @@ func (s *RepositoriesService) UpdateRequiredStatusChecks(ctx context.Context, ow // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#remove-status-check-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#remove-status-check-protection +// +//meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks func (s *RepositoriesService) RemoveRequiredStatusChecks(ctx context.Context, owner, repo, branch string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_status_checks", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("DELETE", u, nil) @@ -1544,7 +1612,9 @@ func (s *RepositoriesService) RemoveRequiredStatusChecks(ctx context.Context, ow // License gets the contents of a repository's license if one is detected. // -// GitHub API docs: https://docs.github.com/en/rest/licenses#get-the-license-for-a-repository +// GitHub API docs: https://docs.github.com/rest/licenses/licenses#get-the-license-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/license func (s *RepositoriesService) License(ctx context.Context, owner, repo string) (*RepositoryLicense, *Response, error) { u := fmt.Sprintf("repos/%v/%v/license", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -1565,7 +1635,9 @@ func (s *RepositoriesService) License(ctx context.Context, owner, repo string) ( // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-pull-request-review-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-pull-request-review-protection +// +//meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews func (s *RepositoriesService) GetPullRequestReviewEnforcement(ctx context.Context, owner, repo, branch string) (*PullRequestReviewsEnforcement, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_pull_request_reviews", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("GET", u, nil) @@ -1590,7 +1662,9 @@ func (s *RepositoriesService) GetPullRequestReviewEnforcement(ctx context.Contex // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#update-pull-request-review-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#update-pull-request-review-protection +// +//meta:operation PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews func (s *RepositoriesService) UpdatePullRequestReviewEnforcement(ctx context.Context, owner, repo, branch string, patch *PullRequestReviewsEnforcementUpdate) (*PullRequestReviewsEnforcement, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_pull_request_reviews", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("PATCH", u, patch) @@ -1615,7 +1689,9 @@ func (s *RepositoriesService) UpdatePullRequestReviewEnforcement(ctx context.Con // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#update-pull-request-review-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#update-pull-request-review-protection +// +//meta:operation PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews func (s *RepositoriesService) DisableDismissalRestrictions(ctx context.Context, owner, repo, branch string) (*PullRequestReviewsEnforcement, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_pull_request_reviews", owner, repo, url.PathEscape(branch)) @@ -1644,7 +1720,9 @@ func (s *RepositoriesService) DisableDismissalRestrictions(ctx context.Context, // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#delete-pull-request-review-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#delete-pull-request-review-protection +// +//meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews func (s *RepositoriesService) RemovePullRequestReviewEnforcement(ctx context.Context, owner, repo, branch string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_pull_request_reviews", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("DELETE", u, nil) @@ -1659,7 +1737,9 @@ func (s *RepositoriesService) RemovePullRequestReviewEnforcement(ctx context.Con // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-admin-branch-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-admin-branch-protection +// +//meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins func (s *RepositoriesService) GetAdminEnforcement(ctx context.Context, owner, repo, branch string) (*AdminEnforcement, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/enforce_admins", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("GET", u, nil) @@ -1681,7 +1761,9 @@ func (s *RepositoriesService) GetAdminEnforcement(ctx context.Context, owner, re // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#set-admin-branch-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#set-admin-branch-protection +// +//meta:operation POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins func (s *RepositoriesService) AddAdminEnforcement(ctx context.Context, owner, repo, branch string) (*AdminEnforcement, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/enforce_admins", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("POST", u, nil) @@ -1702,7 +1784,9 @@ func (s *RepositoriesService) AddAdminEnforcement(ctx context.Context, owner, re // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#delete-admin-branch-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#delete-admin-branch-protection +// +//meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins func (s *RepositoriesService) RemoveAdminEnforcement(ctx context.Context, owner, repo, branch string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/enforce_admins", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("DELETE", u, nil) @@ -1720,7 +1804,9 @@ type repositoryTopics struct { // ListAllTopics lists topics for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#get-all-repository-topics +// GitHub API docs: https://docs.github.com/rest/repos/repos#get-all-repository-topics +// +//meta:operation GET /repos/{owner}/{repo}/topics func (s *RepositoriesService) ListAllTopics(ctx context.Context, owner, repo string) ([]string, *Response, error) { u := fmt.Sprintf("repos/%v/%v/topics", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -1742,7 +1828,9 @@ func (s *RepositoriesService) ListAllTopics(ctx context.Context, owner, repo str // ReplaceAllTopics replaces all repository topics. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#replace-all-repository-topics +// GitHub API docs: https://docs.github.com/rest/repos/repos#replace-all-repository-topics +// +//meta:operation PUT /repos/{owner}/{repo}/topics func (s *RepositoriesService) ReplaceAllTopics(ctx context.Context, owner, repo string, topics []string) ([]string, *Response, error) { u := fmt.Sprintf("repos/%v/%v/topics", owner, repo) t := &repositoryTopics{ @@ -1773,9 +1861,11 @@ func (s *RepositoriesService) ReplaceAllTopics(ctx context.Context, owner, repo // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch -// // Deprecated: Please use ListAppRestrictions instead. +// +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch +// +//meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps func (s *RepositoriesService) ListApps(ctx context.Context, owner, repo, branch string) ([]*App, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("GET", u, nil) @@ -1795,9 +1885,11 @@ func (s *RepositoriesService) ListApps(ctx context.Context, owner, repo, branch // ListAppRestrictions lists the GitHub apps that have push access to a given protected branch. // It requires the GitHub apps to have `write` access to the `content` permission. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch -// // Note: This is a wrapper around ListApps so a naming convention with ListUserRestrictions and ListTeamRestrictions is preserved. +// +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch +// +//meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps func (s *RepositoriesService) ListAppRestrictions(ctx context.Context, owner, repo, branch string) ([]*App, *Response, error) { return s.ListApps(ctx, owner, repo, branch) } @@ -1810,7 +1902,9 @@ func (s *RepositoriesService) ListAppRestrictions(ctx context.Context, owner, re // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#set-app-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#set-app-access-restrictions +// +//meta:operation PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps func (s *RepositoriesService) ReplaceAppRestrictions(ctx context.Context, owner, repo, branch string, apps []string) ([]*App, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("PUT", u, apps) @@ -1834,7 +1928,9 @@ func (s *RepositoriesService) ReplaceAppRestrictions(ctx context.Context, owner, // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#add-app-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#add-app-access-restrictions +// +//meta:operation POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps func (s *RepositoriesService) AddAppRestrictions(ctx context.Context, owner, repo, branch string, apps []string) ([]*App, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("POST", u, apps) @@ -1858,7 +1954,9 @@ func (s *RepositoriesService) AddAppRestrictions(ctx context.Context, owner, rep // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#remove-app-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#remove-app-access-restrictions +// +//meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps func (s *RepositoriesService) RemoveAppRestrictions(ctx context.Context, owner, repo, branch string, apps []string) ([]*App, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("DELETE", u, apps) @@ -1880,7 +1978,9 @@ func (s *RepositoriesService) RemoveAppRestrictions(ctx context.Context, owner, // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-teams-with-access-to-the-protected-branch +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-teams-with-access-to-the-protected-branch +// +//meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams func (s *RepositoriesService) ListTeamRestrictions(ctx context.Context, owner, repo, branch string) ([]*Team, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/teams", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("GET", u, nil) @@ -1905,7 +2005,9 @@ func (s *RepositoriesService) ListTeamRestrictions(ctx context.Context, owner, r // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#set-team-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#set-team-access-restrictions +// +//meta:operation PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams func (s *RepositoriesService) ReplaceTeamRestrictions(ctx context.Context, owner, repo, branch string, teams []string) ([]*Team, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/teams", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("PUT", u, teams) @@ -1929,7 +2031,9 @@ func (s *RepositoriesService) ReplaceTeamRestrictions(ctx context.Context, owner // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#add-team-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#add-team-access-restrictions +// +//meta:operation POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams func (s *RepositoriesService) AddTeamRestrictions(ctx context.Context, owner, repo, branch string, teams []string) ([]*Team, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/teams", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("POST", u, teams) @@ -1953,7 +2057,9 @@ func (s *RepositoriesService) AddTeamRestrictions(ctx context.Context, owner, re // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#remove-team-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#remove-team-access-restrictions +// +//meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams func (s *RepositoriesService) RemoveTeamRestrictions(ctx context.Context, owner, repo, branch string, teams []string) ([]*Team, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/teams", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("DELETE", u, teams) @@ -1975,7 +2081,9 @@ func (s *RepositoriesService) RemoveTeamRestrictions(ctx context.Context, owner, // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-users-with-access-to-the-protected-branch +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-users-with-access-to-the-protected-branch +// +//meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users func (s *RepositoriesService) ListUserRestrictions(ctx context.Context, owner, repo, branch string) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/users", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("GET", u, nil) @@ -2000,7 +2108,9 @@ func (s *RepositoriesService) ListUserRestrictions(ctx context.Context, owner, r // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#set-team-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#set-user-access-restrictions +// +//meta:operation PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users func (s *RepositoriesService) ReplaceUserRestrictions(ctx context.Context, owner, repo, branch string, users []string) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/users", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("PUT", u, users) @@ -2024,7 +2134,9 @@ func (s *RepositoriesService) ReplaceUserRestrictions(ctx context.Context, owner // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#add-team-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#add-user-access-restrictions +// +//meta:operation POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users func (s *RepositoriesService) AddUserRestrictions(ctx context.Context, owner, repo, branch string, users []string) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/users", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("POST", u, users) @@ -2048,7 +2160,9 @@ func (s *RepositoriesService) AddUserRestrictions(ctx context.Context, owner, re // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#remove-team-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#remove-user-access-restrictions +// +//meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users func (s *RepositoriesService) RemoveUserRestrictions(ctx context.Context, owner, repo, branch string, users []string) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/users", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("DELETE", u, users) @@ -2080,7 +2194,9 @@ type TransferRequest struct { // A follow up request, after a delay of a second or so, should result // in a successful request. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#transfer-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos#transfer-a-repository +// +//meta:operation POST /repos/{owner}/{repo}/transfer func (s *RepositoriesService) Transfer(ctx context.Context, owner, repo string, transfer TransferRequest) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/transfer", owner, repo) @@ -2109,7 +2225,9 @@ type DispatchRequestOptions struct { // Dispatch triggers a repository_dispatch event in a GitHub Actions workflow. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#create-a-repository-dispatch-event +// GitHub API docs: https://docs.github.com/rest/repos/repos#create-a-repository-dispatch-event +// +//meta:operation POST /repos/{owner}/{repo}/dispatches func (s *RepositoriesService) Dispatch(ctx context.Context, owner, repo string, opts DispatchRequestOptions) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/dispatches", owner, repo) @@ -2137,7 +2255,9 @@ func isBranchNotProtected(err error) bool { // EnablePrivateReporting enables private reporting of vulnerabilities for a // repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#enable-private-vulnerability-reporting-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos#enable-private-vulnerability-reporting-for-a-repository +// +//meta:operation PUT /repos/{owner}/{repo}/private-vulnerability-reporting func (s *RepositoriesService) EnablePrivateReporting(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/private-vulnerability-reporting", owner, repo) @@ -2157,7 +2277,9 @@ func (s *RepositoriesService) EnablePrivateReporting(ctx context.Context, owner, // DisablePrivateReporting disables private reporting of vulnerabilities for a // repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#disable-private-vulnerability-reporting-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos#disable-private-vulnerability-reporting-for-a-repository +// +//meta:operation DELETE /repos/{owner}/{repo}/private-vulnerability-reporting func (s *RepositoriesService) DisablePrivateReporting(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/private-vulnerability-reporting", owner, repo) diff --git a/github/repos_actions_access.go b/github/repos_actions_access.go index 55761eeb7ee..2da1f01cc26 100644 --- a/github/repos_actions_access.go +++ b/github/repos_actions_access.go @@ -12,7 +12,7 @@ import ( // RepositoryActionsAccessLevel represents the repository actions access level. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-the-level-of-access-for-workflows-outside-of-the-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-the-level-of-access-for-workflows-outside-of-the-repository type RepositoryActionsAccessLevel struct { // AccessLevel specifies the level of access that workflows outside of the repository have // to actions and reusable workflows within the repository. @@ -23,7 +23,9 @@ type RepositoryActionsAccessLevel struct { // GetActionsAccessLevel gets the level of access that workflows outside of the repository have // to actions and reusable workflows in the repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#get-the-level-of-access-for-workflows-outside-of-the-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-the-level-of-access-for-workflows-outside-of-the-repository +// +//meta:operation GET /repos/{owner}/{repo}/actions/permissions/access func (s *RepositoriesService) GetActionsAccessLevel(ctx context.Context, owner, repo string) (*RepositoryActionsAccessLevel, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions/access", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -43,7 +45,9 @@ func (s *RepositoriesService) GetActionsAccessLevel(ctx context.Context, owner, // EditActionsAccessLevel sets the level of access that workflows outside of the repository have // to actions and reusable workflows in the repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-the-level-of-access-for-workflows-outside-of-the-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-the-level-of-access-for-workflows-outside-of-the-repository +// +//meta:operation PUT /repos/{owner}/{repo}/actions/permissions/access func (s *RepositoriesService) EditActionsAccessLevel(ctx context.Context, owner, repo string, repositoryActionsAccessLevel RepositoryActionsAccessLevel) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions/access", owner, repo) req, err := s.client.NewRequest("PUT", u, repositoryActionsAccessLevel) diff --git a/github/repos_actions_allowed.go b/github/repos_actions_allowed.go index 25a46905839..e9ebff1d328 100644 --- a/github/repos_actions_allowed.go +++ b/github/repos_actions_allowed.go @@ -12,7 +12,9 @@ import ( // GetActionsAllowed gets the allowed actions and reusable workflows for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/actions/permissions/selected-actions func (s *RepositoriesService) GetActionsAllowed(ctx context.Context, org, repo string) (*ActionsAllowed, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions/selected-actions", org, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -31,7 +33,9 @@ func (s *RepositoriesService) GetActionsAllowed(ctx context.Context, org, repo s // EditActionsAllowed sets the allowed actions and reusable workflows for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-a-repository +// +//meta:operation PUT /repos/{owner}/{repo}/actions/permissions/selected-actions func (s *RepositoriesService) EditActionsAllowed(ctx context.Context, org, repo string, actionsAllowed ActionsAllowed) (*ActionsAllowed, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions/selected-actions", org, repo) req, err := s.client.NewRequest("PUT", u, actionsAllowed) diff --git a/github/repos_actions_permissions.go b/github/repos_actions_permissions.go index 45f844cec02..2dcc367de1c 100644 --- a/github/repos_actions_permissions.go +++ b/github/repos_actions_permissions.go @@ -12,7 +12,7 @@ import ( // ActionsPermissionsRepository represents a policy for repositories and allowed actions in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions +// GitHub API docs: https://docs.github.com/rest/actions/permissions type ActionsPermissionsRepository struct { Enabled *bool `json:"enabled,omitempty"` AllowedActions *string `json:"allowed_actions,omitempty"` @@ -25,7 +25,9 @@ func (a ActionsPermissionsRepository) String() string { // GetActionsPermissions gets the GitHub Actions permissions policy for repositories and allowed actions in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#get-github-actions-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/actions/permissions func (s *RepositoriesService) GetActionsPermissions(ctx context.Context, owner, repo string) (*ActionsPermissionsRepository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -44,7 +46,9 @@ func (s *RepositoriesService) GetActionsPermissions(ctx context.Context, owner, // EditActionsPermissions sets the permissions policy for repositories and allowed actions in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-github-actions-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-a-repository +// +//meta:operation PUT /repos/{owner}/{repo}/actions/permissions func (s *RepositoriesService) EditActionsPermissions(ctx context.Context, owner, repo string, actionsPermissionsRepository ActionsPermissionsRepository) (*ActionsPermissionsRepository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions", owner, repo) req, err := s.client.NewRequest("PUT", u, actionsPermissionsRepository) diff --git a/github/repos_autolinks.go b/github/repos_autolinks.go index 0d2cec618f0..200605aa0b2 100644 --- a/github/repos_autolinks.go +++ b/github/repos_autolinks.go @@ -28,7 +28,9 @@ type Autolink struct { // ListAutolinks returns a list of autolinks configured for the given repository. // Information about autolinks are only available to repository administrators. // -// GitHub API docs: https://docs.github.com/en/rest/repos/autolinks#list-all-autolinks-of-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/autolinks#list-all-autolinks-of-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/autolinks func (s *RepositoriesService) ListAutolinks(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Autolink, *Response, error) { u := fmt.Sprintf("repos/%v/%v/autolinks", owner, repo) u, err := addOptions(u, opts) @@ -53,7 +55,9 @@ func (s *RepositoriesService) ListAutolinks(ctx context.Context, owner, repo str // AddAutolink creates an autolink reference for a repository. // Users with admin access to the repository can create an autolink. // -// GitHub API docs: https://docs.github.com/en/rest/repos/autolinks#create-an-autolink-reference-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/autolinks#create-an-autolink-reference-for-a-repository +// +//meta:operation POST /repos/{owner}/{repo}/autolinks func (s *RepositoriesService) AddAutolink(ctx context.Context, owner, repo string, opts *AutolinkOptions) (*Autolink, *Response, error) { u := fmt.Sprintf("repos/%v/%v/autolinks", owner, repo) req, err := s.client.NewRequest("POST", u, opts) @@ -72,7 +76,9 @@ func (s *RepositoriesService) AddAutolink(ctx context.Context, owner, repo strin // GetAutolink returns a single autolink reference by ID that was configured for the given repository. // Information about autolinks are only available to repository administrators. // -// GitHub API docs: https://docs.github.com/en/rest/repos/autolinks#get-an-autolink-reference-of-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/autolinks#get-an-autolink-reference-of-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/autolinks/{autolink_id} func (s *RepositoriesService) GetAutolink(ctx context.Context, owner, repo string, id int64) (*Autolink, *Response, error) { u := fmt.Sprintf("repos/%v/%v/autolinks/%v", owner, repo, id) @@ -93,7 +99,9 @@ func (s *RepositoriesService) GetAutolink(ctx context.Context, owner, repo strin // DeleteAutolink deletes a single autolink reference by ID that was configured for the given repository. // Information about autolinks are only available to repository administrators. // -// GitHub API docs: https://docs.github.com/en/rest/repos/autolinks#delete-an-autolink-reference-from-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/autolinks#delete-an-autolink-reference-from-a-repository +// +//meta:operation DELETE /repos/{owner}/{repo}/autolinks/{autolink_id} func (s *RepositoriesService) DeleteAutolink(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/autolinks/%v", owner, repo, id) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/repos_codeowners.go b/github/repos_codeowners.go index 1c3f78abd9b..93eeae09b17 100644 --- a/github/repos_codeowners.go +++ b/github/repos_codeowners.go @@ -36,7 +36,9 @@ type CodeownersError struct { // 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 +// GitHub API docs: https://docs.github.com/rest/repos/repos#list-codeowners-errors +// +//meta:operation GET /repos/{owner}/{repo}/codeowners/errors func (s *RepositoriesService) GetCodeownersErrors(ctx context.Context, owner, repo string, opts *GetCodeownersErrorsOptions) (*CodeownersErrors, *Response, error) { u := fmt.Sprintf("repos/%v/%v/codeowners/errors", owner, repo) u, err := addOptions(u, opts) diff --git a/github/repos_collaborators.go b/github/repos_collaborators.go index c2396872f2e..15a4e77a2f1 100644 --- a/github/repos_collaborators.go +++ b/github/repos_collaborators.go @@ -34,7 +34,7 @@ type ListCollaboratorsOptions struct { } // CollaboratorInvitation represents an invitation created when adding a collaborator. -// GitHub API docs: https://docs.github.com/en/rest/repos/collaborators/#response-when-a-new-invitation-is-created +// GitHub API docs: https://docs.github.com/rest/repos/collaborators/#response-when-a-new-invitation-is-created type CollaboratorInvitation struct { ID *int64 `json:"id,omitempty"` Repo *Repository `json:"repository,omitempty"` @@ -48,7 +48,9 @@ type CollaboratorInvitation struct { // ListCollaborators lists the GitHub users that have access to the repository. // -// GitHub API docs: https://docs.github.com/en/rest/collaborators/collaborators#list-repository-collaborators +// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators#list-repository-collaborators +// +//meta:operation GET /repos/{owner}/{repo}/collaborators func (s *RepositoriesService) ListCollaborators(ctx context.Context, owner, repo string, opts *ListCollaboratorsOptions) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%v/%v/collaborators", owner, repo) u, err := addOptions(u, opts) @@ -75,7 +77,9 @@ func (s *RepositoriesService) ListCollaborators(ctx context.Context, owner, repo // Note: This will return false if the user is not a collaborator OR the user // is not a GitHub user. // -// GitHub API docs: https://docs.github.com/en/rest/collaborators/collaborators#check-if-a-user-is-a-repository-collaborator +// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators#check-if-a-user-is-a-repository-collaborator +// +//meta:operation GET /repos/{owner}/{repo}/collaborators/{username} func (s *RepositoriesService) IsCollaborator(ctx context.Context, owner, repo, user string) (bool, *Response, error) { u := fmt.Sprintf("repos/%v/%v/collaborators/%v", owner, repo, user) req, err := s.client.NewRequest("GET", u, nil) @@ -99,7 +103,9 @@ type RepositoryPermissionLevel struct { // GetPermissionLevel retrieves the specific permission level a collaborator has for a given repository. // -// GitHub API docs: https://docs.github.com/en/rest/collaborators/collaborators#get-repository-permissions-for-a-user +// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators#get-repository-permissions-for-a-user +// +//meta:operation GET /repos/{owner}/{repo}/collaborators/{username}/permission func (s *RepositoriesService) GetPermissionLevel(ctx context.Context, owner, repo, user string) (*RepositoryPermissionLevel, *Response, error) { u := fmt.Sprintf("repos/%v/%v/collaborators/%v/permission", owner, repo, user) req, err := s.client.NewRequest("GET", u, nil) @@ -134,7 +140,9 @@ type RepositoryAddCollaboratorOptions struct { // AddCollaborator sends an invitation to the specified GitHub user // to become a collaborator to the given repo. // -// GitHub API docs: https://docs.github.com/en/rest/collaborators/collaborators#add-a-repository-collaborator +// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators#add-a-repository-collaborator +// +//meta:operation PUT /repos/{owner}/{repo}/collaborators/{username} func (s *RepositoriesService) AddCollaborator(ctx context.Context, owner, repo, user string, opts *RepositoryAddCollaboratorOptions) (*CollaboratorInvitation, *Response, error) { u := fmt.Sprintf("repos/%v/%v/collaborators/%v", owner, repo, user) req, err := s.client.NewRequest("PUT", u, opts) @@ -154,7 +162,9 @@ func (s *RepositoriesService) AddCollaborator(ctx context.Context, owner, repo, // RemoveCollaborator removes the specified GitHub user as collaborator from the given repo. // Note: Does not return error if a valid user that is not a collaborator is removed. // -// GitHub API docs: https://docs.github.com/en/rest/collaborators/collaborators#remove-a-repository-collaborator +// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators#remove-a-repository-collaborator +// +//meta:operation DELETE /repos/{owner}/{repo}/collaborators/{username} func (s *RepositoriesService) RemoveCollaborator(ctx context.Context, owner, repo, user string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/collaborators/%v", owner, repo, user) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/repos_comments.go b/github/repos_comments.go index e282374e9e5..766a614cc12 100644 --- a/github/repos_comments.go +++ b/github/repos_comments.go @@ -35,7 +35,9 @@ func (r RepositoryComment) String() string { // ListComments lists all the comments for the repository. // -// GitHub API docs: https://docs.github.com/en/rest/commits/comments#list-commit-comments-for-a-repository +// GitHub API docs: https://docs.github.com/rest/commits/comments#list-commit-comments-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/comments func (s *RepositoriesService) ListComments(ctx context.Context, owner, repo string, opts *ListOptions) ([]*RepositoryComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments", owner, repo) u, err := addOptions(u, opts) @@ -62,7 +64,9 @@ func (s *RepositoriesService) ListComments(ctx context.Context, owner, repo stri // ListCommitComments lists all the comments for a given commit SHA. // -// GitHub API docs: https://docs.github.com/en/rest/commits/comments#list-commit-comments +// GitHub API docs: https://docs.github.com/rest/commits/comments#list-commit-comments +// +//meta:operation GET /repos/{owner}/{repo}/commits/{commit_sha}/comments func (s *RepositoriesService) ListCommitComments(ctx context.Context, owner, repo, sha string, opts *ListOptions) ([]*RepositoryComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/comments", owner, repo, sha) u, err := addOptions(u, opts) @@ -90,7 +94,9 @@ func (s *RepositoriesService) ListCommitComments(ctx context.Context, owner, rep // CreateComment creates a comment for the given commit. // Note: GitHub allows for comments to be created for non-existing files and positions. // -// GitHub API docs: https://docs.github.com/en/rest/commits/comments#create-a-commit-comment +// GitHub API docs: https://docs.github.com/rest/commits/comments#create-a-commit-comment +// +//meta:operation POST /repos/{owner}/{repo}/commits/{commit_sha}/comments func (s *RepositoriesService) CreateComment(ctx context.Context, owner, repo, sha string, comment *RepositoryComment) (*RepositoryComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/comments", owner, repo, sha) req, err := s.client.NewRequest("POST", u, comment) @@ -109,7 +115,9 @@ func (s *RepositoriesService) CreateComment(ctx context.Context, owner, repo, sh // GetComment gets a single comment from a repository. // -// GitHub API docs: https://docs.github.com/en/rest/commits/comments#get-a-commit-comment +// GitHub API docs: https://docs.github.com/rest/commits/comments#get-a-commit-comment +// +//meta:operation GET /repos/{owner}/{repo}/comments/{comment_id} func (s *RepositoriesService) GetComment(ctx context.Context, owner, repo string, id int64) (*RepositoryComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v", owner, repo, id) req, err := s.client.NewRequest("GET", u, nil) @@ -131,7 +139,9 @@ func (s *RepositoriesService) GetComment(ctx context.Context, owner, repo string // UpdateComment updates the body of a single comment. // -// GitHub API docs: https://docs.github.com/en/rest/commits/comments#update-a-commit-comment +// GitHub API docs: https://docs.github.com/rest/commits/comments#update-a-commit-comment +// +//meta:operation PATCH /repos/{owner}/{repo}/comments/{comment_id} func (s *RepositoriesService) UpdateComment(ctx context.Context, owner, repo string, id int64, comment *RepositoryComment) (*RepositoryComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v", owner, repo, id) req, err := s.client.NewRequest("PATCH", u, comment) @@ -150,7 +160,9 @@ func (s *RepositoriesService) UpdateComment(ctx context.Context, owner, repo str // DeleteComment deletes a single comment from a repository. // -// GitHub API docs: https://docs.github.com/en/rest/commits/comments#delete-a-commit-comment +// GitHub API docs: https://docs.github.com/rest/commits/comments#delete-a-commit-comment +// +//meta:operation DELETE /repos/{owner}/{repo}/comments/{comment_id} func (s *RepositoriesService) DeleteComment(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v", owner, repo, id) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/repos_commits.go b/github/repos_commits.go index d1fb577c61c..cca7430cb51 100644 --- a/github/repos_commits.go +++ b/github/repos_commits.go @@ -124,7 +124,9 @@ type BranchCommit struct { // ListCommits lists the commits of a repository. // -// GitHub API docs: https://docs.github.com/en/rest/commits/commits#list-commits +// GitHub API docs: https://docs.github.com/rest/commits/commits#list-commits +// +//meta:operation GET /repos/{owner}/{repo}/commits func (s *RepositoriesService) ListCommits(ctx context.Context, owner, repo string, opts *CommitsListOptions) ([]*RepositoryCommit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits", owner, repo) u, err := addOptions(u, opts) @@ -148,8 +150,9 @@ func (s *RepositoriesService) ListCommits(ctx context.Context, owner, repo strin // GetCommit fetches the specified commit, including all details about it. // -// GitHub API docs: https://docs.github.com/en/rest/commits/commits#get-a-single-commit -// GitHub API docs: https://docs.github.com/en/rest/commits/commits#get-a-commit +// GitHub API docs: https://docs.github.com/rest/commits/commits#get-a-commit +// +//meta:operation GET /repos/{owner}/{repo}/commits/{ref} func (s *RepositoriesService) GetCommit(ctx context.Context, owner, repo, sha string, opts *ListOptions) (*RepositoryCommit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v", owner, repo, sha) u, err := addOptions(u, opts) @@ -173,7 +176,9 @@ func (s *RepositoriesService) GetCommit(ctx context.Context, owner, repo, sha st // GetCommitRaw fetches the specified commit in raw (diff or patch) format. // -// GitHub API docs: https://docs.github.com/en/rest/commits/commits#get-a-commit +// GitHub API docs: https://docs.github.com/rest/commits/commits#get-a-commit +// +//meta:operation GET /repos/{owner}/{repo}/commits/{ref} func (s *RepositoriesService) GetCommitRaw(ctx context.Context, owner string, repo string, sha string, opts RawOptions) (string, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v", owner, repo, sha) req, err := s.client.NewRequest("GET", u, nil) @@ -202,7 +207,9 @@ func (s *RepositoriesService) GetCommitRaw(ctx context.Context, owner string, re // GetCommitSHA1 gets the SHA-1 of a commit reference. If a last-known SHA1 is // supplied and no new commits have occurred, a 304 Unmodified response is returned. // -// GitHub API docs: https://docs.github.com/en/rest/commits/commits#get-a-commit +// GitHub API docs: https://docs.github.com/rest/commits/commits#get-a-commit +// +//meta:operation GET /repos/{owner}/{repo}/commits/{ref} func (s *RepositoriesService) GetCommitSHA1(ctx context.Context, owner, repo, ref, lastSHA string) (string, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v", owner, repo, refURLEscape(ref)) @@ -227,7 +234,9 @@ func (s *RepositoriesService) GetCommitSHA1(ctx context.Context, owner, repo, re // CompareCommits compares a range of commits with each other. // -// GitHub API docs: https://docs.github.com/en/rest/commits/commits#compare-two-commits +// GitHub API docs: https://docs.github.com/rest/commits/commits#compare-two-commits +// +//meta:operation GET /repos/{owner}/{repo}/compare/{basehead} func (s *RepositoriesService) CompareCommits(ctx context.Context, owner, repo string, base, head string, opts *ListOptions) (*CommitsComparison, *Response, error) { escapedBase := url.QueryEscape(base) escapedHead := url.QueryEscape(head) @@ -258,7 +267,9 @@ func (s *RepositoriesService) CompareCommits(ctx context.Context, owner, repo st // To compare branches across other repositories in the same network as "repo", // use the format ":branch". // -// GitHub API docs: https://docs.github.com/en/rest/commits/commits#compare-two-commits +// GitHub API docs: https://docs.github.com/rest/commits/commits#compare-two-commits +// +//meta:operation GET /repos/{owner}/{repo}/compare/{basehead} func (s *RepositoriesService) CompareCommitsRaw(ctx context.Context, owner, repo, base, head string, opts RawOptions) (string, *Response, error) { escapedBase := url.QueryEscape(base) escapedHead := url.QueryEscape(head) @@ -291,7 +302,9 @@ func (s *RepositoriesService) CompareCommitsRaw(ctx context.Context, owner, repo // ListBranchesHeadCommit gets all branches where the given commit SHA is the HEAD, // or latest commit for the branch. // -// GitHub API docs: https://docs.github.com/en/rest/commits/commits#list-branches-for-head-commit +// GitHub API docs: https://docs.github.com/rest/commits/commits#list-branches-for-head-commit +// +//meta:operation GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head func (s *RepositoriesService) ListBranchesHeadCommit(ctx context.Context, owner, repo, sha string) ([]*BranchCommit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/branches-where-head", owner, repo, sha) diff --git a/github/repos_community_health.go b/github/repos_community_health.go index 750ee158270..54d1b414ec9 100644 --- a/github/repos_community_health.go +++ b/github/repos_community_health.go @@ -43,7 +43,9 @@ type CommunityHealthMetrics struct { // GetCommunityHealthMetrics retrieves all the community health metrics for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/metrics/community#get-community-profile-metrics +// GitHub API docs: https://docs.github.com/rest/metrics/community#get-community-profile-metrics +// +//meta:operation GET /repos/{owner}/{repo}/community/profile func (s *RepositoriesService) GetCommunityHealthMetrics(ctx context.Context, owner, repo string) (*CommunityHealthMetrics, *Response, error) { u := fmt.Sprintf("repos/%v/%v/community/profile", owner, repo) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/repos_contents.go b/github/repos_contents.go index cfb4a6da22f..9539a5c4296 100644 --- a/github/repos_contents.go +++ b/github/repos_contents.go @@ -4,7 +4,7 @@ // license that can be found in the LICENSE file. // Repository contents API methods. -// GitHub API docs: https://docs.github.com/en/rest/repos/contents/ +// GitHub API docs: https://docs.github.com/rest/repos/contents/ package github @@ -100,7 +100,9 @@ func (r *RepositoryContent) GetContent() (string, error) { // GetReadme gets the Readme file for the repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/contents#get-a-repository-readme +// GitHub API docs: https://docs.github.com/rest/repos/contents#get-a-repository-readme +// +//meta:operation GET /repos/{owner}/{repo}/readme func (s *RepositoriesService) GetReadme(ctx context.Context, owner, repo string, opts *RepositoryContentGetOptions) (*RepositoryContent, *Response, error) { u := fmt.Sprintf("repos/%v/%v/readme", owner, repo) u, err := addOptions(u, opts) @@ -130,6 +132,10 @@ func (s *RepositoriesService) GetReadme(ctx context.Context, owner, repo string, // It is possible for the download to result in a failed response when the // returned error is nil. Callers should check the returned Response status // code to verify the content is from a successful response. +// +// GitHub API docs: https://docs.github.com/rest/repos/contents#get-repository-content +// +//meta:operation GET /repos/{owner}/{repo}/contents/{path} func (s *RepositoriesService) DownloadContents(ctx context.Context, owner, repo, filepath string, opts *RepositoryContentGetOptions) (io.ReadCloser, *Response, error) { dir := path.Dir(filepath) filename := path.Base(filepath) @@ -164,6 +170,10 @@ func (s *RepositoriesService) DownloadContents(ctx context.Context, owner, repo, // It is possible for the download to result in a failed response when the // returned error is nil. Callers should check the returned Response status // code to verify the content is from a successful response. +// +// GitHub API docs: https://docs.github.com/rest/repos/contents#get-repository-content +// +//meta:operation GET /repos/{owner}/{repo}/contents/{path} func (s *RepositoriesService) DownloadContentsWithMeta(ctx context.Context, owner, repo, filepath string, opts *RepositoryContentGetOptions) (io.ReadCloser, *RepositoryContent, *Response, error) { dir := path.Dir(filepath) filename := path.Base(filepath) @@ -200,7 +210,9 @@ func (s *RepositoriesService) DownloadContentsWithMeta(ctx context.Context, owne // Due to an auth vulnerability issue in the GitHub v3 API, ".." is not allowed // to appear anywhere in the "path" or this method will return an error. // -// GitHub API docs: https://docs.github.com/en/rest/repos/contents#get-repository-content +// GitHub API docs: https://docs.github.com/rest/repos/contents#get-repository-content +// +//meta:operation GET /repos/{owner}/{repo}/contents/{path} func (s *RepositoriesService) GetContents(ctx context.Context, owner, repo, path string, opts *RepositoryContentGetOptions) (fileContent *RepositoryContent, directoryContent []*RepositoryContent, resp *Response, err error) { if strings.Contains(path, "..") { return nil, nil, nil, ErrPathForbidden @@ -240,7 +252,9 @@ func (s *RepositoriesService) GetContents(ctx context.Context, owner, repo, path // CreateFile creates a new file in a repository at the given path and returns // the commit and file metadata. // -// GitHub API docs: https://docs.github.com/en/rest/repos/contents#create-or-update-file-contents +// GitHub API docs: https://docs.github.com/rest/repos/contents#create-or-update-file-contents +// +//meta:operation PUT /repos/{owner}/{repo}/contents/{path} func (s *RepositoriesService) CreateFile(ctx context.Context, owner, repo, path string, opts *RepositoryContentFileOptions) (*RepositoryContentResponse, *Response, error) { u := fmt.Sprintf("repos/%s/%s/contents/%s", owner, repo, path) req, err := s.client.NewRequest("PUT", u, opts) @@ -260,7 +274,9 @@ func (s *RepositoriesService) CreateFile(ctx context.Context, owner, repo, path // UpdateFile updates a file in a repository at the given path and returns the // commit and file metadata. Requires the blob SHA of the file being updated. // -// GitHub API docs: https://docs.github.com/en/rest/repos/contents#create-or-update-file-contents +// GitHub API docs: https://docs.github.com/rest/repos/contents#create-or-update-file-contents +// +//meta:operation PUT /repos/{owner}/{repo}/contents/{path} func (s *RepositoriesService) UpdateFile(ctx context.Context, owner, repo, path string, opts *RepositoryContentFileOptions) (*RepositoryContentResponse, *Response, error) { u := fmt.Sprintf("repos/%s/%s/contents/%s", owner, repo, path) req, err := s.client.NewRequest("PUT", u, opts) @@ -280,7 +296,9 @@ func (s *RepositoriesService) UpdateFile(ctx context.Context, owner, repo, path // DeleteFile deletes a file from a repository and returns the commit. // Requires the blob SHA of the file to be deleted. // -// GitHub API docs: https://docs.github.com/en/rest/repos/contents#delete-a-file +// GitHub API docs: https://docs.github.com/rest/repos/contents#delete-a-file +// +//meta:operation DELETE /repos/{owner}/{repo}/contents/{path} func (s *RepositoriesService) DeleteFile(ctx context.Context, owner, repo, path string, opts *RepositoryContentFileOptions) (*RepositoryContentResponse, *Response, error) { u := fmt.Sprintf("repos/%s/%s/contents/%s", owner, repo, path) req, err := s.client.NewRequest("DELETE", u, opts) @@ -312,7 +330,11 @@ const ( // repository. The archiveFormat can be specified by either the github.Tarball // or github.Zipball constant. // -// GitHub API docs: https://docs.github.com/en/rest/repos/contents/#get-archive-link +// GitHub API docs: https://docs.github.com/rest/repos/contents#download-a-repository-archive-tar +// GitHub API docs: https://docs.github.com/rest/repos/contents#download-a-repository-archive-zip +// +//meta:operation GET /repos/{owner}/{repo}/tarball/{ref} +//meta:operation GET /repos/{owner}/{repo}/zipball/{ref} func (s *RepositoriesService) GetArchiveLink(ctx context.Context, owner, repo string, archiveformat ArchiveFormat, opts *RepositoryContentGetOptions, maxRedirects int) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%s/%s/%s", owner, repo, archiveformat) if opts != nil && opts.Ref != "" { diff --git a/github/repos_deployment_branch_policies.go b/github/repos_deployment_branch_policies.go index 32bf72ccab5..77ac73e44e1 100644 --- a/github/repos_deployment_branch_policies.go +++ b/github/repos_deployment_branch_policies.go @@ -32,7 +32,9 @@ type DeploymentBranchPolicyRequest struct { // ListDeploymentBranchPolicies lists the deployment branch policies for an environment. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/branch-policies#list-deployment-branch-policies +// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies#list-deployment-branch-policies +// +//meta:operation GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies func (s *RepositoriesService) ListDeploymentBranchPolicies(ctx context.Context, owner, repo, environment string) (*DeploymentBranchPolicyResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment-branch-policies", owner, repo, environment) @@ -52,7 +54,9 @@ func (s *RepositoriesService) ListDeploymentBranchPolicies(ctx context.Context, // GetDeploymentBranchPolicy gets a deployment branch policy for an environment. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/branch-policies#get-a-deployment-branch-policy +// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies#get-a-deployment-branch-policy +// +//meta:operation GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} func (s *RepositoriesService) GetDeploymentBranchPolicy(ctx context.Context, owner, repo, environment string, branchPolicyID int64) (*DeploymentBranchPolicy, *Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment-branch-policies/%v", owner, repo, environment, branchPolicyID) @@ -72,7 +76,9 @@ func (s *RepositoriesService) GetDeploymentBranchPolicy(ctx context.Context, own // CreateDeploymentBranchPolicy creates a deployment branch policy for an environment. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/branch-policies#create-a-deployment-branch-policy +// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies#create-a-deployment-branch-policy +// +//meta:operation POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies func (s *RepositoriesService) CreateDeploymentBranchPolicy(ctx context.Context, owner, repo, environment string, request *DeploymentBranchPolicyRequest) (*DeploymentBranchPolicy, *Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment-branch-policies", owner, repo, environment) @@ -92,7 +98,9 @@ func (s *RepositoriesService) CreateDeploymentBranchPolicy(ctx context.Context, // UpdateDeploymentBranchPolicy updates a deployment branch policy for an environment. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/branch-policies#update-a-deployment-branch-policy +// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies#update-a-deployment-branch-policy +// +//meta:operation PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} func (s *RepositoriesService) UpdateDeploymentBranchPolicy(ctx context.Context, owner, repo, environment string, branchPolicyID int64, request *DeploymentBranchPolicyRequest) (*DeploymentBranchPolicy, *Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment-branch-policies/%v", owner, repo, environment, branchPolicyID) @@ -112,7 +120,9 @@ func (s *RepositoriesService) UpdateDeploymentBranchPolicy(ctx context.Context, // DeleteDeploymentBranchPolicy deletes a deployment branch policy for an environment. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/branch-policies#delete-a-deployment-branch-policy +// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies#delete-a-deployment-branch-policy +// +//meta:operation DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} func (s *RepositoriesService) DeleteDeploymentBranchPolicy(ctx context.Context, owner, repo, environment string, branchPolicyID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment-branch-policies/%v", owner, repo, environment, branchPolicyID) diff --git a/github/repos_deployments.go b/github/repos_deployments.go index 36445f895e2..d8c0b63218e 100644 --- a/github/repos_deployments.go +++ b/github/repos_deployments.go @@ -63,7 +63,9 @@ type DeploymentsListOptions struct { // ListDeployments lists the deployments of a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/deployments#list-deployments +// GitHub API docs: https://docs.github.com/rest/deployments/deployments#list-deployments +// +//meta:operation GET /repos/{owner}/{repo}/deployments func (s *RepositoriesService) ListDeployments(ctx context.Context, owner, repo string, opts *DeploymentsListOptions) ([]*Deployment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments", owner, repo) u, err := addOptions(u, opts) @@ -87,7 +89,9 @@ func (s *RepositoriesService) ListDeployments(ctx context.Context, owner, repo s // GetDeployment returns a single deployment of a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/deployments#get-a-deployment +// GitHub API docs: https://docs.github.com/rest/deployments/deployments#get-a-deployment +// +//meta:operation GET /repos/{owner}/{repo}/deployments/{deployment_id} func (s *RepositoriesService) GetDeployment(ctx context.Context, owner, repo string, deploymentID int64) (*Deployment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments/%v", owner, repo, deploymentID) @@ -107,7 +111,9 @@ func (s *RepositoriesService) GetDeployment(ctx context.Context, owner, repo str // CreateDeployment creates a new deployment for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/deployments#create-a-deployment +// GitHub API docs: https://docs.github.com/rest/deployments/deployments#create-a-deployment +// +//meta:operation POST /repos/{owner}/{repo}/deployments func (s *RepositoriesService) CreateDeployment(ctx context.Context, owner, repo string, request *DeploymentRequest) (*Deployment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments", owner, repo) @@ -131,7 +137,9 @@ func (s *RepositoriesService) CreateDeployment(ctx context.Context, owner, repo // DeleteDeployment deletes an existing deployment for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/deployments#delete-a-deployment +// GitHub API docs: https://docs.github.com/rest/deployments/deployments#delete-a-deployment +// +//meta:operation DELETE /repos/{owner}/{repo}/deployments/{deployment_id} func (s *RepositoriesService) DeleteDeployment(ctx context.Context, owner, repo string, deploymentID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments/%v", owner, repo, deploymentID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -175,7 +183,9 @@ type DeploymentStatusRequest struct { // ListDeploymentStatuses lists the statuses of a given deployment of a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/statuses#list-deployment-statuses +// GitHub API docs: https://docs.github.com/rest/deployments/statuses#list-deployment-statuses +// +//meta:operation GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses func (s *RepositoriesService) ListDeploymentStatuses(ctx context.Context, owner, repo string, deployment int64, opts *ListOptions) ([]*DeploymentStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments/%v/statuses", owner, repo, deployment) u, err := addOptions(u, opts) @@ -203,7 +213,9 @@ func (s *RepositoriesService) ListDeploymentStatuses(ctx context.Context, owner, // GetDeploymentStatus returns a single deployment status of a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/statuses#get-a-deployment-status +// GitHub API docs: https://docs.github.com/rest/deployments/statuses#get-a-deployment-status +// +//meta:operation GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id} func (s *RepositoriesService) GetDeploymentStatus(ctx context.Context, owner, repo string, deploymentID, deploymentStatusID int64) (*DeploymentStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments/%v/statuses/%v", owner, repo, deploymentID, deploymentStatusID) @@ -227,7 +239,9 @@ func (s *RepositoriesService) GetDeploymentStatus(ctx context.Context, owner, re // CreateDeploymentStatus creates a new status for a deployment. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/statuses#create-a-deployment-status +// GitHub API docs: https://docs.github.com/rest/deployments/statuses#create-a-deployment-status +// +//meta:operation POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses func (s *RepositoriesService) CreateDeploymentStatus(ctx context.Context, owner, repo string, deployment int64, request *DeploymentStatusRequest) (*DeploymentStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments/%v/statuses", owner, repo, deployment) diff --git a/github/repos_environments.go b/github/repos_environments.go index e22ca5cd1be..ed81e3a1f95 100644 --- a/github/repos_environments.go +++ b/github/repos_environments.go @@ -107,7 +107,9 @@ func (r *RequiredReviewer) UnmarshalJSON(data []byte) error { // ListEnvironments lists all environments for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/environments#get-all-environments +// GitHub API docs: https://docs.github.com/rest/deployments/environments#list-environments +// +//meta:operation GET /repos/{owner}/{repo}/environments func (s *RepositoriesService) ListEnvironments(ctx context.Context, owner, repo string, opts *EnvironmentListOptions) (*EnvResponse, *Response, error) { u := fmt.Sprintf("repos/%s/%s/environments", owner, repo) u, err := addOptions(u, opts) @@ -130,7 +132,9 @@ func (s *RepositoriesService) ListEnvironments(ctx context.Context, owner, repo // GetEnvironment get a single environment for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/environments#get-an-environment +// GitHub API docs: https://docs.github.com/rest/deployments/environments#get-an-environment +// +//meta:operation GET /repos/{owner}/{repo}/environments/{environment_name} func (s *RepositoriesService) GetEnvironment(ctx context.Context, owner, repo, name string) (*Environment, *Response, error) { u := fmt.Sprintf("repos/%s/%s/environments/%s", owner, repo, name) @@ -178,7 +182,7 @@ type CreateUpdateEnvironment struct { } // createUpdateEnvironmentNoEnterprise represents the fields accepted for Pro/Teams private repos. -// Ref: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment +// Ref: https://docs.github.com/actions/deployment/targeting-different-environments/using-environments-for-deployment // See https://github.com/google/go-github/issues/2602 for more information. type createUpdateEnvironmentNoEnterprise struct { DeploymentBranchPolicy *BranchPolicy `json:"deployment_branch_policy"` @@ -186,7 +190,9 @@ type createUpdateEnvironmentNoEnterprise struct { // CreateUpdateEnvironment create or update a new environment for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/environments#create-or-update-an-environment +// GitHub API docs: https://docs.github.com/rest/deployments/environments#create-or-update-an-environment +// +//meta:operation PUT /repos/{owner}/{repo}/environments/{environment_name} func (s *RepositoriesService) CreateUpdateEnvironment(ctx context.Context, owner, repo, name string, environment *CreateUpdateEnvironment) (*Environment, *Response, error) { u := fmt.Sprintf("repos/%s/%s/environments/%s", owner, repo, name) @@ -232,7 +238,9 @@ func (s *RepositoriesService) createNewEnvNoEnterprise(ctx context.Context, u st // DeleteEnvironment delete an environment from a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/environments#delete-an-environment +// GitHub API docs: https://docs.github.com/rest/deployments/environments#delete-an-environment +// +//meta:operation DELETE /repos/{owner}/{repo}/environments/{environment_name} func (s *RepositoriesService) DeleteEnvironment(ctx context.Context, owner, repo, name string) (*Response, error) { u := fmt.Sprintf("repos/%s/%s/environments/%s", owner, repo, name) diff --git a/github/repos_forks.go b/github/repos_forks.go index f175dfe3b03..60fb49da5ab 100644 --- a/github/repos_forks.go +++ b/github/repos_forks.go @@ -23,7 +23,9 @@ type RepositoryListForksOptions struct { // ListForks lists the forks of the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/forks#list-forks +// GitHub API docs: https://docs.github.com/rest/repos/forks#list-forks +// +//meta:operation GET /repos/{owner}/{repo}/forks func (s *RepositoriesService) ListForks(ctx context.Context, owner, repo string, opts *RepositoryListForksOptions) ([]*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/forks", owner, repo) u, err := addOptions(u, opts) @@ -66,7 +68,9 @@ type RepositoryCreateForkOptions struct { // A follow up request, after a delay of a second or so, should result // in a successful request. // -// GitHub API docs: https://docs.github.com/en/rest/repos/forks#create-a-fork +// GitHub API docs: https://docs.github.com/rest/repos/forks#create-a-fork +// +//meta:operation POST /repos/{owner}/{repo}/forks func (s *RepositoriesService) CreateFork(ctx context.Context, owner, repo string, opts *RepositoryCreateForkOptions) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/forks", owner, repo) diff --git a/github/repos_hooks.go b/github/repos_hooks.go index ba229e7bca8..8768d603d2b 100644 --- a/github/repos_hooks.go +++ b/github/repos_hooks.go @@ -79,7 +79,9 @@ type createHookRequest struct { // Note that only a subset of the hook fields are used and hook must // not be nil. // -// GitHub API docs: https://docs.github.com/en/rest/webhooks/repos#create-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/webhooks/repos#create-a-repository-webhook +// +//meta:operation POST /repos/{owner}/{repo}/hooks func (s *RepositoriesService) CreateHook(ctx context.Context, owner, repo string, hook *Hook) (*Hook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks", owner, repo) @@ -106,7 +108,9 @@ func (s *RepositoriesService) CreateHook(ctx context.Context, owner, repo string // ListHooks lists all Hooks for the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/webhooks/repos#list-repository-webhooks +// GitHub API docs: https://docs.github.com/rest/webhooks/repos#list-repository-webhooks +// +//meta:operation GET /repos/{owner}/{repo}/hooks func (s *RepositoriesService) ListHooks(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Hook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks", owner, repo) u, err := addOptions(u, opts) @@ -130,7 +134,9 @@ func (s *RepositoriesService) ListHooks(ctx context.Context, owner, repo string, // GetHook returns a single specified Hook. // -// GitHub API docs: https://docs.github.com/en/rest/webhooks/repos#get-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/webhooks/repos#get-a-repository-webhook +// +//meta:operation GET /repos/{owner}/{repo}/hooks/{hook_id} func (s *RepositoriesService) GetHook(ctx context.Context, owner, repo string, id int64) (*Hook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%d", owner, repo, id) req, err := s.client.NewRequest("GET", u, nil) @@ -148,7 +154,9 @@ func (s *RepositoriesService) GetHook(ctx context.Context, owner, repo string, i // EditHook updates a specified Hook. // -// GitHub API docs: https://docs.github.com/en/rest/webhooks/repos#update-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/webhooks/repos#update-a-repository-webhook +// +//meta:operation PATCH /repos/{owner}/{repo}/hooks/{hook_id} func (s *RepositoriesService) EditHook(ctx context.Context, owner, repo string, id int64, hook *Hook) (*Hook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%d", owner, repo, id) req, err := s.client.NewRequest("PATCH", u, hook) @@ -166,7 +174,9 @@ func (s *RepositoriesService) EditHook(ctx context.Context, owner, repo string, // DeleteHook deletes a specified Hook. // -// GitHub API docs: https://docs.github.com/en/rest/webhooks/repos#delete-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/webhooks/repos#delete-a-repository-webhook +// +//meta:operation DELETE /repos/{owner}/{repo}/hooks/{hook_id} func (s *RepositoriesService) DeleteHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%d", owner, repo, id) req, err := s.client.NewRequest("DELETE", u, nil) @@ -178,7 +188,9 @@ func (s *RepositoriesService) DeleteHook(ctx context.Context, owner, repo string // PingHook triggers a 'ping' event to be sent to the Hook. // -// GitHub API docs: https://docs.github.com/en/rest/webhooks/repos#ping-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/webhooks/repos#ping-a-repository-webhook +// +//meta:operation POST /repos/{owner}/{repo}/hooks/{hook_id}/pings func (s *RepositoriesService) PingHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%d/pings", owner, repo, id) req, err := s.client.NewRequest("POST", u, nil) @@ -190,7 +202,9 @@ func (s *RepositoriesService) PingHook(ctx context.Context, owner, repo string, // TestHook triggers a test Hook by github. // -// GitHub API docs: https://docs.github.com/en/rest/webhooks/repos#test-the-push-repository-webhook +// GitHub API docs: https://docs.github.com/rest/webhooks/repos#test-the-push-repository-webhook +// +//meta:operation POST /repos/{owner}/{repo}/hooks/{hook_id}/tests func (s *RepositoriesService) TestHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%d/tests", owner, repo, id) req, err := s.client.NewRequest("POST", u, nil) @@ -202,7 +216,9 @@ func (s *RepositoriesService) TestHook(ctx context.Context, owner, repo string, // Subscribe lets servers register to receive updates when a topic is updated. // -// GitHub API docs: https://docs.github.com/en/rest/webhooks#pubsubhubbub +// GitHub API docs: https://docs.github.com/webhooks/about-webhooks-for-repositories#pubsubhubbub +// +//meta:operation POST /hub func (s *RepositoriesService) Subscribe(ctx context.Context, owner, repo, event, callback string, secret []byte) (*Response, error) { req, err := s.createWebSubRequest("subscribe", owner, repo, event, callback, secret) if err != nil { @@ -214,7 +230,9 @@ func (s *RepositoriesService) Subscribe(ctx context.Context, owner, repo, event, // Unsubscribe lets servers unregister to no longer receive updates when a topic is updated. // -// GitHub API docs: https://docs.github.com/en/rest/webhooks#pubsubhubbub +// GitHub API docs: https://docs.github.com/webhooks/about-webhooks-for-repositories#pubsubhubbub +// +//meta:operation POST /hub func (s *RepositoriesService) Unsubscribe(ctx context.Context, owner, repo, event, callback string, secret []byte) (*Response, error) { req, err := s.createWebSubRequest("unsubscribe", owner, repo, event, callback, secret) if err != nil { diff --git a/github/repos_hooks_configuration.go b/github/repos_hooks_configuration.go index 5aadfb645e1..2203d7614f5 100644 --- a/github/repos_hooks_configuration.go +++ b/github/repos_hooks_configuration.go @@ -12,7 +12,9 @@ import ( // GetHookConfiguration returns the configuration for the specified repository webhook. // -// GitHub API docs: https://docs.github.com/en/rest/webhooks/repo-config?apiVersion=2022-11-28#get-a-webhook-configuration-for-a-repository +// GitHub API docs: https://docs.github.com/rest/webhooks/repo-config#get-a-webhook-configuration-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/hooks/{hook_id}/config func (s *RepositoriesService) GetHookConfiguration(ctx context.Context, owner, repo string, id int64) (*HookConfig, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%v/config", owner, repo, id) req, err := s.client.NewRequest("GET", u, nil) @@ -31,7 +33,9 @@ func (s *RepositoriesService) GetHookConfiguration(ctx context.Context, owner, r // EditHookConfiguration updates the configuration for the specified repository webhook. // -// GitHub API docs: https://docs.github.com/en/rest/webhooks/repo-config?apiVersion=2022-11-28#update-a-webhook-configuration-for-a-repository +// GitHub API docs: https://docs.github.com/rest/webhooks/repo-config#update-a-webhook-configuration-for-a-repository +// +//meta:operation PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config func (s *RepositoriesService) EditHookConfiguration(ctx context.Context, owner, repo string, id int64, config *HookConfig) (*HookConfig, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%v/config", owner, repo, id) req, err := s.client.NewRequest("PATCH", u, config) diff --git a/github/repos_hooks_deliveries.go b/github/repos_hooks_deliveries.go index 5f2f8807e4b..6e1fd86f99b 100644 --- a/github/repos_hooks_deliveries.go +++ b/github/repos_hooks_deliveries.go @@ -14,8 +14,8 @@ import ( // HookDelivery represents the data that is received from GitHub's Webhook Delivery API // // GitHub API docs: -// - https://docs.github.com/en/rest/webhooks/repo-deliveries#list-deliveries-for-a-repository-webhook -// - https://docs.github.com/en/rest/webhooks/repo-deliveries#get-a-delivery-for-a-repository-webhook +// - https://docs.github.com/rest/webhooks/repo-deliveries#list-deliveries-for-a-repository-webhook +// - https://docs.github.com/rest/webhooks/repo-deliveries#get-a-delivery-for-a-repository-webhook type HookDelivery struct { ID *int64 `json:"id,omitempty"` GUID *string `json:"guid,omitempty"` @@ -63,7 +63,9 @@ func (r HookResponse) String() string { // ListHookDeliveries lists webhook deliveries for a webhook configured in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/webhooks/repo-deliveries#list-deliveries-for-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/webhooks/repo-deliveries#list-deliveries-for-a-repository-webhook +// +//meta:operation GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries func (s *RepositoriesService) ListHookDeliveries(ctx context.Context, owner, repo string, id int64, opts *ListCursorOptions) ([]*HookDelivery, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%v/deliveries", owner, repo, id) u, err := addOptions(u, opts) @@ -87,7 +89,9 @@ func (s *RepositoriesService) ListHookDeliveries(ctx context.Context, owner, rep // GetHookDelivery returns a delivery for a webhook configured in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/webhooks/repo-deliveries#get-a-delivery-for-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/webhooks/repo-deliveries#get-a-delivery-for-a-repository-webhook +// +//meta:operation GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id} func (s *RepositoriesService) GetHookDelivery(ctx context.Context, owner, repo string, hookID, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%v/deliveries/%v", owner, repo, hookID, deliveryID) req, err := s.client.NewRequest("GET", u, nil) @@ -106,7 +110,9 @@ func (s *RepositoriesService) GetHookDelivery(ctx context.Context, owner, repo s // RedeliverHookDelivery redelivers a delivery for a webhook configured in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/webhooks/repo-deliveries#redeliver-a-delivery-for-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/webhooks/repo-deliveries#redeliver-a-delivery-for-a-repository-webhook +// +//meta:operation POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts func (s *RepositoriesService) RedeliverHookDelivery(ctx context.Context, owner, repo string, hookID, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%v/deliveries/%v/attempts", owner, repo, hookID, deliveryID) req, err := s.client.NewRequest("POST", u, nil) diff --git a/github/repos_invitations.go b/github/repos_invitations.go index 81956cd49c9..4922e0b298c 100644 --- a/github/repos_invitations.go +++ b/github/repos_invitations.go @@ -27,7 +27,9 @@ type RepositoryInvitation struct { // ListInvitations lists all currently-open repository invitations. // -// GitHub API docs: https://docs.github.com/en/rest/collaborators/invitations#list-repository-invitations +// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#list-repository-invitations +// +//meta:operation GET /repos/{owner}/{repo}/invitations func (s *RepositoriesService) ListInvitations(ctx context.Context, owner, repo string, opts *ListOptions) ([]*RepositoryInvitation, *Response, error) { u := fmt.Sprintf("repos/%v/%v/invitations", owner, repo) u, err := addOptions(u, opts) @@ -51,7 +53,9 @@ func (s *RepositoriesService) ListInvitations(ctx context.Context, owner, repo s // DeleteInvitation deletes a repository invitation. // -// GitHub API docs: https://docs.github.com/en/rest/collaborators/invitations#delete-a-repository-invitation +// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#delete-a-repository-invitation +// +//meta:operation DELETE /repos/{owner}/{repo}/invitations/{invitation_id} func (s *RepositoriesService) DeleteInvitation(ctx context.Context, owner, repo string, invitationID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/invitations/%v", owner, repo, invitationID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -68,7 +72,9 @@ func (s *RepositoriesService) DeleteInvitation(ctx context.Context, owner, repo // permissions represents the permissions that the associated user will have // on the repository. Possible values are: "read", "write", "admin". // -// GitHub API docs: https://docs.github.com/en/rest/collaborators/invitations#update-a-repository-invitation +// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#update-a-repository-invitation +// +//meta:operation PATCH /repos/{owner}/{repo}/invitations/{invitation_id} func (s *RepositoriesService) UpdateInvitation(ctx context.Context, owner, repo string, invitationID int64, permissions string) (*RepositoryInvitation, *Response, error) { opts := &struct { Permissions string `json:"permissions"` diff --git a/github/repos_keys.go b/github/repos_keys.go index 42c5de49709..cc86f8bbd09 100644 --- a/github/repos_keys.go +++ b/github/repos_keys.go @@ -14,7 +14,9 @@ import ( // ListKeys lists the deploy keys for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deploy-keys#list-deploy-keys +// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#list-deploy-keys +// +//meta:operation GET /repos/{owner}/{repo}/keys func (s *RepositoriesService) ListKeys(ctx context.Context, owner string, repo string, opts *ListOptions) ([]*Key, *Response, error) { u := fmt.Sprintf("repos/%v/%v/keys", owner, repo) u, err := addOptions(u, opts) @@ -38,7 +40,9 @@ func (s *RepositoriesService) ListKeys(ctx context.Context, owner string, repo s // GetKey fetches a single deploy key. // -// GitHub API docs: https://docs.github.com/en/rest/deploy-keys#get-a-deploy-key +// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#get-a-deploy-key +// +//meta:operation GET /repos/{owner}/{repo}/keys/{key_id} func (s *RepositoriesService) GetKey(ctx context.Context, owner string, repo string, id int64) (*Key, *Response, error) { u := fmt.Sprintf("repos/%v/%v/keys/%v", owner, repo, id) @@ -58,7 +62,9 @@ func (s *RepositoriesService) GetKey(ctx context.Context, owner string, repo str // CreateKey adds a deploy key for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deploy-keys#create-a-deploy-key +// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#create-a-deploy-key +// +//meta:operation POST /repos/{owner}/{repo}/keys func (s *RepositoriesService) CreateKey(ctx context.Context, owner string, repo string, key *Key) (*Key, *Response, error) { u := fmt.Sprintf("repos/%v/%v/keys", owner, repo) @@ -78,7 +84,9 @@ func (s *RepositoriesService) CreateKey(ctx context.Context, owner string, repo // DeleteKey deletes a deploy key. // -// GitHub API docs: https://docs.github.com/en/rest/deploy-keys#delete-a-deploy-key +// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#delete-a-deploy-key +// +//meta:operation DELETE /repos/{owner}/{repo}/keys/{key_id} func (s *RepositoriesService) DeleteKey(ctx context.Context, owner string, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/keys/%v", owner, repo, id) diff --git a/github/repos_lfs.go b/github/repos_lfs.go index 6ac2e5a8778..f0153c08086 100644 --- a/github/repos_lfs.go +++ b/github/repos_lfs.go @@ -12,7 +12,9 @@ import ( // 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 +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/repos/lfs#enable-git-lfs-for-a-repository +// +//meta:operation PUT /repos/{owner}/{repo}/lfs func (s *RepositoriesService) EnableLFS(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/lfs", owner, repo) @@ -31,7 +33,9 @@ func (s *RepositoriesService) EnableLFS(ctx context.Context, owner, repo string) // 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 +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/repos/lfs#disable-git-lfs-for-a-repository +// +//meta:operation DELETE /repos/{owner}/{repo}/lfs func (s *RepositoriesService) DisableLFS(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/lfs", owner, repo) diff --git a/github/repos_merging.go b/github/repos_merging.go index 66e88452e86..b26e5da1af6 100644 --- a/github/repos_merging.go +++ b/github/repos_merging.go @@ -34,7 +34,9 @@ type RepoMergeUpstreamResult struct { // Merge a branch in the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branches#merge-a-branch +// GitHub API docs: https://docs.github.com/rest/branches/branches#merge-a-branch +// +//meta:operation POST /repos/{owner}/{repo}/merges func (s *RepositoriesService) Merge(ctx context.Context, owner, repo string, request *RepositoryMergeRequest) (*RepositoryCommit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/merges", owner, repo) req, err := s.client.NewRequest("POST", u, request) @@ -54,7 +56,9 @@ func (s *RepositoriesService) Merge(ctx context.Context, owner, repo string, req // MergeUpstream syncs a branch of a forked repository to keep it up-to-date // with the upstream repository. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branches#sync-a-fork-branch-with-the-upstream-repository +// GitHub API docs: https://docs.github.com/rest/branches/branches#sync-a-fork-branch-with-the-upstream-repository +// +//meta:operation POST /repos/{owner}/{repo}/merge-upstream func (s *RepositoriesService) MergeUpstream(ctx context.Context, owner, repo string, request *RepoMergeUpstreamRequest) (*RepoMergeUpstreamResult, *Response, error) { u := fmt.Sprintf("repos/%v/%v/merge-upstream", owner, repo) req, err := s.client.NewRequest("POST", u, request) diff --git a/github/repos_pages.go b/github/repos_pages.go index 060f6eb8b1d..6b9ba76e44d 100644 --- a/github/repos_pages.go +++ b/github/repos_pages.go @@ -103,7 +103,9 @@ type createPagesRequest struct { // EnablePages enables GitHub Pages for the named repo. // -// GitHub API docs: https://docs.github.com/en/rest/pages#create-a-github-pages-site +// GitHub API docs: https://docs.github.com/rest/pages/pages#create-a-github-pages-site +// +//meta:operation POST /repos/{owner}/{repo}/pages func (s *RepositoriesService) EnablePages(ctx context.Context, owner, repo string, pages *Pages) (*Pages, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages", owner, repo) @@ -153,7 +155,9 @@ type PagesUpdate struct { // UpdatePages updates GitHub Pages for the named repo. // -// GitHub API docs: https://docs.github.com/en/rest/pages#update-information-about-a-github-pages-site +// GitHub API docs: https://docs.github.com/rest/pages/pages#update-information-about-a-github-pages-site +// +//meta:operation PUT /repos/{owner}/{repo}/pages func (s *RepositoriesService) UpdatePages(ctx context.Context, owner, repo string, opts *PagesUpdate) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/pages", owner, repo) @@ -172,7 +176,9 @@ func (s *RepositoriesService) UpdatePages(ctx context.Context, owner, repo strin // DisablePages disables GitHub Pages for the named repo. // -// GitHub API docs: https://docs.github.com/en/rest/pages#delete-a-github-pages-site +// GitHub API docs: https://docs.github.com/rest/pages/pages#delete-a-github-pages-site +// +//meta:operation DELETE /repos/{owner}/{repo}/pages func (s *RepositoriesService) DisablePages(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/pages", owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) @@ -188,7 +194,9 @@ func (s *RepositoriesService) DisablePages(ctx context.Context, owner, repo stri // GetPagesInfo fetches information about a GitHub Pages site. // -// GitHub API docs: https://docs.github.com/en/rest/pages#get-a-github-pages-site +// GitHub API docs: https://docs.github.com/rest/pages/pages#get-a-github-pages-site +// +//meta:operation GET /repos/{owner}/{repo}/pages func (s *RepositoriesService) GetPagesInfo(ctx context.Context, owner, repo string) (*Pages, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -207,7 +215,9 @@ func (s *RepositoriesService) GetPagesInfo(ctx context.Context, owner, repo stri // ListPagesBuilds lists the builds for a GitHub Pages site. // -// GitHub API docs: https://docs.github.com/en/rest/pages#list-github-pages-builds +// GitHub API docs: https://docs.github.com/rest/pages/pages#list-github-pages-builds +// +//meta:operation GET /repos/{owner}/{repo}/pages/builds func (s *RepositoriesService) ListPagesBuilds(ctx context.Context, owner, repo string, opts *ListOptions) ([]*PagesBuild, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages/builds", owner, repo) u, err := addOptions(u, opts) @@ -231,7 +241,9 @@ func (s *RepositoriesService) ListPagesBuilds(ctx context.Context, owner, repo s // GetLatestPagesBuild fetches the latest build information for a GitHub pages site. // -// GitHub API docs: https://docs.github.com/en/rest/pages#get-latest-pages-build +// GitHub API docs: https://docs.github.com/rest/pages/pages#get-latest-pages-build +// +//meta:operation GET /repos/{owner}/{repo}/pages/builds/latest func (s *RepositoriesService) GetLatestPagesBuild(ctx context.Context, owner, repo string) (*PagesBuild, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages/builds/latest", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -250,7 +262,9 @@ func (s *RepositoriesService) GetLatestPagesBuild(ctx context.Context, owner, re // GetPageBuild fetches the specific build information for a GitHub pages site. // -// GitHub API docs: https://docs.github.com/en/rest/pages#get-github-pages-build +// GitHub API docs: https://docs.github.com/rest/pages/pages#get-github-pages-build +// +//meta:operation GET /repos/{owner}/{repo}/pages/builds/{build_id} func (s *RepositoriesService) GetPageBuild(ctx context.Context, owner, repo string, id int64) (*PagesBuild, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages/builds/%v", owner, repo, id) req, err := s.client.NewRequest("GET", u, nil) @@ -269,7 +283,9 @@ func (s *RepositoriesService) GetPageBuild(ctx context.Context, owner, repo stri // RequestPageBuild requests a build of a GitHub Pages site without needing to push new commit. // -// GitHub API docs: https://docs.github.com/en/rest/pages#request-a-github-pages-build +// GitHub API docs: https://docs.github.com/rest/pages/pages#request-a-github-pages-build +// +//meta:operation POST /repos/{owner}/{repo}/pages/builds func (s *RepositoriesService) RequestPageBuild(ctx context.Context, owner, repo string) (*PagesBuild, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages/builds", owner, repo) req, err := s.client.NewRequest("POST", u, nil) @@ -288,7 +304,9 @@ func (s *RepositoriesService) RequestPageBuild(ctx context.Context, owner, repo // GetPageHealthCheck gets a DNS health check for the CNAME record configured for a repository's GitHub Pages. // -// GitHub API docs: https://docs.github.com/en/rest/pages#get-a-dns-health-check-for-github-pages +// GitHub API docs: https://docs.github.com/rest/pages/pages#get-a-dns-health-check-for-github-pages +// +//meta:operation GET /repos/{owner}/{repo}/pages/health func (s *RepositoriesService) GetPageHealthCheck(ctx context.Context, owner, repo string) (*PagesHealthCheckResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages/health", owner, repo) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/repos_prereceive_hooks.go b/github/repos_prereceive_hooks.go index 1ce6478d33b..e8361383f57 100644 --- a/github/repos_prereceive_hooks.go +++ b/github/repos_prereceive_hooks.go @@ -24,7 +24,9 @@ func (p PreReceiveHook) String() string { // ListPreReceiveHooks lists all pre-receive hooks for the specified repository. // -// GitHub API docs: https://developer.github.com/enterprise/2.13/v3/repos/pre_receive_hooks/#list-pre-receive-hooks +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/pre-receive-hooks func (s *RepositoriesService) ListPreReceiveHooks(ctx context.Context, owner, repo string, opts *ListOptions) ([]*PreReceiveHook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pre-receive-hooks", owner, repo) u, err := addOptions(u, opts) @@ -51,7 +53,9 @@ func (s *RepositoriesService) ListPreReceiveHooks(ctx context.Context, owner, re // GetPreReceiveHook returns a single specified pre-receive hook. // -// GitHub API docs: https://developer.github.com/enterprise/2.13/v3/repos/pre_receive_hooks/#get-a-single-pre-receive-hook +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) GetPreReceiveHook(ctx context.Context, owner, repo string, id int64) (*PreReceiveHook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pre-receive-hooks/%d", owner, repo, id) req, err := s.client.NewRequest("GET", u, nil) @@ -73,7 +77,9 @@ func (s *RepositoriesService) GetPreReceiveHook(ctx context.Context, owner, repo // UpdatePreReceiveHook updates a specified pre-receive hook. // -// GitHub API docs: https://developer.github.com/enterprise/2.13/v3/repos/pre_receive_hooks/#update-pre-receive-hook-enforcement +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository +// +//meta:operation PATCH /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) UpdatePreReceiveHook(ctx context.Context, owner, repo string, id int64, hook *PreReceiveHook) (*PreReceiveHook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pre-receive-hooks/%d", owner, repo, id) req, err := s.client.NewRequest("PATCH", u, hook) @@ -95,7 +101,9 @@ func (s *RepositoriesService) UpdatePreReceiveHook(ctx context.Context, owner, r // DeletePreReceiveHook deletes a specified pre-receive hook. // -// GitHub API docs: https://developer.github.com/enterprise/2.13/v3/repos/pre_receive_hooks/#remove-enforcement-overrides-for-a-pre-receive-hook +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository +// +//meta:operation DELETE /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) DeletePreReceiveHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/pre-receive-hooks/%d", owner, repo, id) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/repos_projects.go b/github/repos_projects.go index a3001dee988..9269d4e95c0 100644 --- a/github/repos_projects.go +++ b/github/repos_projects.go @@ -21,7 +21,9 @@ type ProjectListOptions struct { // ListProjects lists the projects for a repo. // -// GitHub API docs: https://docs.github.com/en/rest/projects/projects#list-repository-projects +// GitHub API docs: https://docs.github.com/rest/projects/projects#list-repository-projects +// +//meta:operation GET /repos/{owner}/{repo}/projects func (s *RepositoriesService) ListProjects(ctx context.Context, owner, repo string, opts *ProjectListOptions) ([]*Project, *Response, error) { u := fmt.Sprintf("repos/%v/%v/projects", owner, repo) u, err := addOptions(u, opts) @@ -48,7 +50,9 @@ func (s *RepositoriesService) ListProjects(ctx context.Context, owner, repo stri // CreateProject creates a GitHub Project for the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/projects/projects#create-a-repository-project +// GitHub API docs: https://docs.github.com/rest/projects/projects#create-a-repository-project +// +//meta:operation POST /repos/{owner}/{repo}/projects func (s *RepositoriesService) CreateProject(ctx context.Context, owner, repo string, opts *ProjectOptions) (*Project, *Response, error) { u := fmt.Sprintf("repos/%v/%v/projects", owner, repo) req, err := s.client.NewRequest("POST", u, opts) diff --git a/github/repos_releases.go b/github/repos_releases.go index e2aa845af2f..7231db6d9ea 100644 --- a/github/repos_releases.go +++ b/github/repos_releases.go @@ -87,7 +87,9 @@ func (r ReleaseAsset) String() string { // ListReleases lists the releases for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/releases/releases#list-releases +// GitHub API docs: https://docs.github.com/rest/releases/releases#list-releases +// +//meta:operation GET /repos/{owner}/{repo}/releases func (s *RepositoriesService) ListReleases(ctx context.Context, owner, repo string, opts *ListOptions) ([]*RepositoryRelease, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases", owner, repo) u, err := addOptions(u, opts) @@ -110,7 +112,9 @@ func (s *RepositoriesService) ListReleases(ctx context.Context, owner, repo stri // GetRelease fetches a single release. // -// GitHub API docs: https://docs.github.com/en/rest/releases/releases#get-a-release +// GitHub API docs: https://docs.github.com/rest/releases/releases#get-a-release +// +//meta:operation GET /repos/{owner}/{repo}/releases/{release_id} func (s *RepositoriesService) GetRelease(ctx context.Context, owner, repo string, id int64) (*RepositoryRelease, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/%d", owner, repo, id) return s.getSingleRelease(ctx, u) @@ -118,7 +122,9 @@ func (s *RepositoriesService) GetRelease(ctx context.Context, owner, repo string // GetLatestRelease fetches the latest published release for the repository. // -// GitHub API docs: https://docs.github.com/en/rest/releases/releases#get-the-latest-release +// GitHub API docs: https://docs.github.com/rest/releases/releases#get-the-latest-release +// +//meta:operation GET /repos/{owner}/{repo}/releases/latest func (s *RepositoriesService) GetLatestRelease(ctx context.Context, owner, repo string) (*RepositoryRelease, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/latest", owner, repo) return s.getSingleRelease(ctx, u) @@ -126,7 +132,9 @@ func (s *RepositoriesService) GetLatestRelease(ctx context.Context, owner, repo // GetReleaseByTag fetches a release with the specified tag. // -// GitHub API docs: https://docs.github.com/en/rest/releases/releases#get-a-release-by-tag-name +// GitHub API docs: https://docs.github.com/rest/releases/releases#get-a-release-by-tag-name +// +//meta:operation GET /repos/{owner}/{repo}/releases/tags/{tag} func (s *RepositoriesService) GetReleaseByTag(ctx context.Context, owner, repo, tag string) (*RepositoryRelease, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/tags/%s", owner, repo, tag) return s.getSingleRelease(ctx, u) @@ -134,7 +142,9 @@ func (s *RepositoriesService) GetReleaseByTag(ctx context.Context, owner, repo, // GenerateReleaseNotes generates the release notes for the given tag. // -// GitHub API docs: https://docs.github.com/en/rest/releases/releases#generate-release-notes-content-for-a-release +// GitHub API docs: https://docs.github.com/rest/releases/releases#generate-release-notes-content-for-a-release +// +//meta:operation POST /repos/{owner}/{repo}/releases/generate-notes func (s *RepositoriesService) GenerateReleaseNotes(ctx context.Context, owner, repo string, opts *GenerateNotesOptions) (*RepositoryReleaseNotes, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/generate-notes", owner, repo) req, err := s.client.NewRequest("POST", u, opts) @@ -188,7 +198,9 @@ type repositoryReleaseRequest struct { // Note that only a subset of the release fields are used. // See RepositoryRelease for more information. // -// GitHub API docs: https://docs.github.com/en/rest/releases/releases#create-a-release +// GitHub API docs: https://docs.github.com/rest/releases/releases#create-a-release +// +//meta:operation POST /repos/{owner}/{repo}/releases func (s *RepositoriesService) CreateRelease(ctx context.Context, owner, repo string, release *RepositoryRelease) (*RepositoryRelease, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases", owner, repo) @@ -222,7 +234,9 @@ func (s *RepositoriesService) CreateRelease(ctx context.Context, owner, repo str // Note that only a subset of the release fields are used. // See RepositoryRelease for more information. // -// GitHub API docs: https://docs.github.com/en/rest/releases/releases#update-a-release +// GitHub API docs: https://docs.github.com/rest/releases/releases#update-a-release +// +//meta:operation PATCH /repos/{owner}/{repo}/releases/{release_id} func (s *RepositoriesService) EditRelease(ctx context.Context, owner, repo string, id int64, release *RepositoryRelease) (*RepositoryRelease, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/%d", owner, repo, id) @@ -252,7 +266,9 @@ func (s *RepositoriesService) EditRelease(ctx context.Context, owner, repo strin // DeleteRelease delete a single release from a repository. // -// GitHub API docs: https://docs.github.com/en/rest/releases/releases#delete-a-release +// GitHub API docs: https://docs.github.com/rest/releases/releases#delete-a-release +// +//meta:operation DELETE /repos/{owner}/{repo}/releases/{release_id} func (s *RepositoriesService) DeleteRelease(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/%d", owner, repo, id) @@ -265,7 +281,9 @@ func (s *RepositoriesService) DeleteRelease(ctx context.Context, owner, repo str // ListReleaseAssets lists the release's assets. // -// GitHub API docs: https://docs.github.com/en/rest/releases/assets#list-release-assets +// GitHub API docs: https://docs.github.com/rest/releases/assets#list-release-assets +// +//meta:operation GET /repos/{owner}/{repo}/releases/{release_id}/assets func (s *RepositoriesService) ListReleaseAssets(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*ReleaseAsset, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/%d/assets", owner, repo, id) u, err := addOptions(u, opts) @@ -288,7 +306,9 @@ func (s *RepositoriesService) ListReleaseAssets(ctx context.Context, owner, repo // GetReleaseAsset fetches a single release asset. // -// GitHub API docs: https://docs.github.com/en/rest/releases/assets#get-a-release-asset +// GitHub API docs: https://docs.github.com/rest/releases/assets#get-a-release-asset +// +//meta:operation GET /repos/{owner}/{repo}/releases/assets/{asset_id} func (s *RepositoriesService) GetReleaseAsset(ctx context.Context, owner, repo string, id int64) (*ReleaseAsset, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/assets/%d", owner, repo, id) @@ -317,7 +337,9 @@ func (s *RepositoriesService) GetReleaseAsset(ctx context.Context, owner, repo s // exist, but it's possible to pass any http.Client. If nil is passed the // redirectURL will be returned instead. // -// GitHub API docs: https://docs.github.com/en/rest/releases/assets#get-a-release-asset +// GitHub API docs: https://docs.github.com/rest/releases/assets#get-a-release-asset +// +//meta:operation GET /repos/{owner}/{repo}/releases/assets/{asset_id} func (s *RepositoriesService) DownloadReleaseAsset(ctx context.Context, owner, repo string, id int64, followRedirectsClient *http.Client) (rc io.ReadCloser, redirectURL string, err error) { u := fmt.Sprintf("repos/%s/%s/releases/assets/%d", owner, repo, id) @@ -379,7 +401,9 @@ func (s *RepositoriesService) downloadReleaseAssetFromURL(ctx context.Context, f // EditReleaseAsset edits a repository release asset. // -// GitHub API docs: https://docs.github.com/en/rest/releases/assets#update-a-release-asset +// GitHub API docs: https://docs.github.com/rest/releases/assets#update-a-release-asset +// +//meta:operation PATCH /repos/{owner}/{repo}/releases/assets/{asset_id} func (s *RepositoriesService) EditReleaseAsset(ctx context.Context, owner, repo string, id int64, release *ReleaseAsset) (*ReleaseAsset, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/assets/%d", owner, repo, id) @@ -398,7 +422,9 @@ func (s *RepositoriesService) EditReleaseAsset(ctx context.Context, owner, repo // DeleteReleaseAsset delete a single release asset from a repository. // -// GitHub API docs: https://docs.github.com/en/rest/releases/assets#delete-a-release-asset +// GitHub API docs: https://docs.github.com/rest/releases/assets#delete-a-release-asset +// +//meta:operation DELETE /repos/{owner}/{repo}/releases/assets/{asset_id} func (s *RepositoriesService) DeleteReleaseAsset(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/assets/%d", owner, repo, id) @@ -412,7 +438,9 @@ func (s *RepositoriesService) DeleteReleaseAsset(ctx context.Context, owner, rep // UploadReleaseAsset creates an asset by uploading a file into a release repository. // To upload assets that cannot be represented by an os.File, call NewUploadRequest directly. // -// GitHub API docs: https://docs.github.com/en/rest/releases/assets#upload-a-release-asset +// GitHub API docs: https://docs.github.com/rest/releases/assets#upload-a-release-asset +// +//meta:operation POST /repos/{owner}/{repo}/releases/{release_id}/assets func (s *RepositoriesService) UploadReleaseAsset(ctx context.Context, owner, repo string, id int64, opts *UploadOptions, file *os.File) (*ReleaseAsset, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/%d/assets", owner, repo, id) u, err := addOptions(u, opts) diff --git a/github/repos_rules.go b/github/repos_rules.go index 2c24f8c27b3..b47b37038ed 100644 --- a/github/repos_rules.go +++ b/github/repos_rules.go @@ -349,7 +349,9 @@ type Ruleset struct { // GetRulesForBranch gets all the rules that apply to the specified branch. // -// GitHub API docs: https://docs.github.com/en/rest/repos/rules#get-rules-for-a-branch +// GitHub API docs: https://docs.github.com/rest/repos/rules#get-rules-for-a-branch +// +//meta:operation GET /repos/{owner}/{repo}/rules/branches/{branch} func (s *RepositoriesService) GetRulesForBranch(ctx context.Context, owner, repo, branch string) ([]*RepositoryRule, *Response, error) { u := fmt.Sprintf("repos/%v/%v/rules/branches/%v", owner, repo, branch) @@ -370,7 +372,9 @@ func (s *RepositoriesService) GetRulesForBranch(ctx context.Context, owner, repo // GetAllRulesets gets all the rules that apply to the specified repository. // If includesParents is true, rulesets configured at the organization level that apply to the repository will be returned. // -// GitHub API docs: https://docs.github.com/en/rest/repos/rules#get-all-repository-rulesets +// GitHub API docs: https://docs.github.com/rest/repos/rules#get-all-repository-rulesets +// +//meta:operation GET /repos/{owner}/{repo}/rulesets func (s *RepositoriesService) GetAllRulesets(ctx context.Context, owner, repo string, includesParents bool) ([]*Ruleset, *Response, error) { u := fmt.Sprintf("repos/%v/%v/rulesets?includes_parents=%v", owner, repo, includesParents) @@ -390,7 +394,9 @@ func (s *RepositoriesService) GetAllRulesets(ctx context.Context, owner, repo st // CreateRuleset creates a ruleset for the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/rules#create-a-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/repos/rules#create-a-repository-ruleset +// +//meta:operation POST /repos/{owner}/{repo}/rulesets func (s *RepositoriesService) CreateRuleset(ctx context.Context, owner, repo string, rs *Ruleset) (*Ruleset, *Response, error) { u := fmt.Sprintf("repos/%v/%v/rulesets", owner, repo) @@ -411,7 +417,9 @@ func (s *RepositoriesService) CreateRuleset(ctx context.Context, owner, repo str // GetRuleset gets a ruleset for the specified repository. // If includesParents is true, rulesets configured at the organization level that apply to the repository will be returned. // -// GitHub API docs: https://docs.github.com/en/rest/repos/rules#get-a-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/repos/rules#get-a-repository-ruleset +// +//meta:operation GET /repos/{owner}/{repo}/rulesets/{ruleset_id} func (s *RepositoriesService) GetRuleset(ctx context.Context, owner, repo string, rulesetID int64, includesParents bool) (*Ruleset, *Response, error) { u := fmt.Sprintf("repos/%v/%v/rulesets/%v?includes_parents=%v", owner, repo, rulesetID, includesParents) @@ -431,7 +439,9 @@ func (s *RepositoriesService) GetRuleset(ctx context.Context, owner, repo string // UpdateRuleset updates a ruleset for the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/rules#update-a-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/repos/rules#update-a-repository-ruleset +// +//meta:operation PUT /repos/{owner}/{repo}/rulesets/{ruleset_id} func (s *RepositoriesService) UpdateRuleset(ctx context.Context, owner, repo string, rulesetID int64, rs *Ruleset) (*Ruleset, *Response, error) { u := fmt.Sprintf("repos/%v/%v/rulesets/%v", owner, repo, rulesetID) @@ -451,7 +461,9 @@ func (s *RepositoriesService) UpdateRuleset(ctx context.Context, owner, repo str // DeleteRuleset deletes a ruleset for the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/rules#delete-a-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset +// +//meta:operation DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id} func (s *RepositoriesService) DeleteRuleset(ctx context.Context, owner, repo string, rulesetID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/rulesets/%v", owner, repo, rulesetID) diff --git a/github/repos_stats.go b/github/repos_stats.go index 3df0a8f6deb..898693f7864 100644 --- a/github/repos_stats.go +++ b/github/repos_stats.go @@ -45,7 +45,9 @@ func (w WeeklyStats) String() string { // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://docs.github.com/en/rest/metrics/statistics#get-all-contributor-commit-activity +// GitHub API docs: https://docs.github.com/rest/metrics/statistics#get-all-contributor-commit-activity +// +//meta:operation GET /repos/{owner}/{repo}/stats/contributors func (s *RepositoriesService) ListContributorsStats(ctx context.Context, owner, repo string) ([]*ContributorStats, *Response, error) { u := fmt.Sprintf("repos/%v/%v/stats/contributors", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -84,7 +86,9 @@ func (w WeeklyCommitActivity) String() string { // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://docs.github.com/en/rest/metrics/statistics#get-the-last-year-of-commit-activity +// GitHub API docs: https://docs.github.com/rest/metrics/statistics#get-the-last-year-of-commit-activity +// +//meta:operation GET /repos/{owner}/{repo}/stats/commit_activity func (s *RepositoriesService) ListCommitActivity(ctx context.Context, owner, repo string) ([]*WeeklyCommitActivity, *Response, error) { u := fmt.Sprintf("repos/%v/%v/stats/commit_activity", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -111,7 +115,9 @@ func (s *RepositoriesService) ListCommitActivity(ctx context.Context, owner, rep // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://docs.github.com/en/rest/metrics/statistics#get-the-weekly-commit-activity +// GitHub API docs: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-activity +// +//meta:operation GET /repos/{owner}/{repo}/stats/code_frequency func (s *RepositoriesService) ListCodeFrequency(ctx context.Context, owner, repo string) ([]*WeeklyStats, *Response, error) { u := fmt.Sprintf("repos/%v/%v/stats/code_frequency", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -167,7 +173,9 @@ func (r RepositoryParticipation) String() string { // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://docs.github.com/en/rest/metrics/statistics#get-the-weekly-commit-count +// GitHub API docs: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-count +// +//meta:operation GET /repos/{owner}/{repo}/stats/participation func (s *RepositoriesService) ListParticipation(ctx context.Context, owner, repo string) (*RepositoryParticipation, *Response, error) { u := fmt.Sprintf("repos/%v/%v/stats/participation", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -200,7 +208,9 @@ type PunchCard struct { // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://docs.github.com/en/rest/metrics/statistics#get-the-hourly-commit-count-for-each-day +// GitHub API docs: https://docs.github.com/rest/metrics/statistics#get-the-hourly-commit-count-for-each-day +// +//meta:operation GET /repos/{owner}/{repo}/stats/punch_card func (s *RepositoriesService) ListPunchCard(ctx context.Context, owner, repo string) ([]*PunchCard, *Response, error) { u := fmt.Sprintf("repos/%v/%v/stats/punch_card", owner, repo) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/repos_statuses.go b/github/repos_statuses.go index ea3d166c753..e7b03047521 100644 --- a/github/repos_statuses.go +++ b/github/repos_statuses.go @@ -45,7 +45,9 @@ func (r RepoStatus) String() string { // ListStatuses lists the statuses of a repository at the specified // reference. ref can be a SHA, a branch name, or a tag name. // -// GitHub API docs: https://docs.github.com/en/rest/commits/statuses#list-commit-statuses-for-a-reference +// GitHub API docs: https://docs.github.com/rest/commits/statuses#list-commit-statuses-for-a-reference +// +//meta:operation GET /repos/{owner}/{repo}/commits/{ref}/statuses func (s *RepositoriesService) ListStatuses(ctx context.Context, owner, repo, ref string, opts *ListOptions) ([]*RepoStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/statuses", owner, repo, refURLEscape(ref)) u, err := addOptions(u, opts) @@ -70,7 +72,9 @@ func (s *RepositoriesService) ListStatuses(ctx context.Context, owner, repo, ref // CreateStatus creates a new status for a repository at the specified // reference. Ref can be a SHA, a branch name, or a tag name. // -// GitHub API docs: https://docs.github.com/en/rest/commits/statuses#create-a-commit-status +// GitHub API docs: https://docs.github.com/rest/commits/statuses#create-a-commit-status +// +//meta:operation POST /repos/{owner}/{repo}/statuses/{sha} func (s *RepositoriesService) CreateStatus(ctx context.Context, owner, repo, ref string, status *RepoStatus) (*RepoStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/statuses/%v", owner, repo, refURLEscape(ref)) req, err := s.client.NewRequest("POST", u, status) @@ -109,7 +113,9 @@ func (s CombinedStatus) String() string { // GetCombinedStatus returns the combined status of a repository at the specified // reference. ref can be a SHA, a branch name, or a tag name. // -// GitHub API docs: https://docs.github.com/en/rest/commits/statuses#get-the-combined-status-for-a-specific-reference +// GitHub API docs: https://docs.github.com/rest/commits/statuses#get-the-combined-status-for-a-specific-reference +// +//meta:operation GET /repos/{owner}/{repo}/commits/{ref}/status func (s *RepositoriesService) GetCombinedStatus(ctx context.Context, owner, repo, ref string, opts *ListOptions) (*CombinedStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/status", owner, repo, refURLEscape(ref)) u, err := addOptions(u, opts) diff --git a/github/repos_tags.go b/github/repos_tags.go index ff46d90c731..93164dd1b8e 100644 --- a/github/repos_tags.go +++ b/github/repos_tags.go @@ -24,7 +24,9 @@ type tagProtectionRequest struct { // 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 +// GitHub API docs: https://docs.github.com/rest/repos/tags#list-tag-protection-states-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/tags/protection func (s *RepositoriesService) ListTagProtection(ctx context.Context, owner, repo string) ([]*TagProtection, *Response, error) { u := fmt.Sprintf("repos/%v/%v/tags/protection", owner, repo) @@ -44,7 +46,9 @@ func (s *RepositoriesService) ListTagProtection(ctx context.Context, owner, repo // 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 +// GitHub API docs: https://docs.github.com/rest/repos/tags#create-a-tag-protection-state-for-a-repository +// +//meta:operation POST /repos/{owner}/{repo}/tags/protection 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} @@ -64,7 +68,9 @@ func (s *RepositoriesService) CreateTagProtection(ctx context.Context, owner, re // 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 +// GitHub API docs: https://docs.github.com/rest/repos/tags#delete-a-tag-protection-state-for-a-repository +// +//meta:operation DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id} 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) diff --git a/github/repos_traffic.go b/github/repos_traffic.go index bf093c03ea7..ae2f1a86bd7 100644 --- a/github/repos_traffic.go +++ b/github/repos_traffic.go @@ -54,7 +54,9 @@ type TrafficBreakdownOptions struct { // ListTrafficReferrers list the top 10 referrers over the last 14 days. // -// GitHub API docs: https://docs.github.com/en/rest/metrics/traffic#get-top-referral-sources +// GitHub API docs: https://docs.github.com/rest/metrics/traffic#get-top-referral-sources +// +//meta:operation GET /repos/{owner}/{repo}/traffic/popular/referrers func (s *RepositoriesService) ListTrafficReferrers(ctx context.Context, owner, repo string) ([]*TrafficReferrer, *Response, error) { u := fmt.Sprintf("repos/%v/%v/traffic/popular/referrers", owner, repo) @@ -74,7 +76,9 @@ func (s *RepositoriesService) ListTrafficReferrers(ctx context.Context, owner, r // ListTrafficPaths list the top 10 popular content over the last 14 days. // -// GitHub API docs: https://docs.github.com/en/rest/metrics/traffic#get-top-referral-paths +// GitHub API docs: https://docs.github.com/rest/metrics/traffic#get-top-referral-paths +// +//meta:operation GET /repos/{owner}/{repo}/traffic/popular/paths func (s *RepositoriesService) ListTrafficPaths(ctx context.Context, owner, repo string) ([]*TrafficPath, *Response, error) { u := fmt.Sprintf("repos/%v/%v/traffic/popular/paths", owner, repo) @@ -94,7 +98,9 @@ func (s *RepositoriesService) ListTrafficPaths(ctx context.Context, owner, repo // ListTrafficViews get total number of views for the last 14 days and breaks it down either per day or week. // -// GitHub API docs: https://docs.github.com/en/rest/metrics/traffic#get-page-views +// GitHub API docs: https://docs.github.com/rest/metrics/traffic#get-page-views +// +//meta:operation GET /repos/{owner}/{repo}/traffic/views func (s *RepositoriesService) ListTrafficViews(ctx context.Context, owner, repo string, opts *TrafficBreakdownOptions) (*TrafficViews, *Response, error) { u := fmt.Sprintf("repos/%v/%v/traffic/views", owner, repo) u, err := addOptions(u, opts) @@ -118,7 +124,9 @@ func (s *RepositoriesService) ListTrafficViews(ctx context.Context, owner, repo // ListTrafficClones get total number of clones for the last 14 days and breaks it down either per day or week for the last 14 days. // -// GitHub API docs: https://docs.github.com/en/rest/metrics/traffic#get-repository-clones +// GitHub API docs: https://docs.github.com/rest/metrics/traffic#get-repository-clones +// +//meta:operation GET /repos/{owner}/{repo}/traffic/clones func (s *RepositoriesService) ListTrafficClones(ctx context.Context, owner, repo string, opts *TrafficBreakdownOptions) (*TrafficClones, *Response, error) { u := fmt.Sprintf("repos/%v/%v/traffic/clones", owner, repo) u, err := addOptions(u, opts) diff --git a/github/scim.go b/github/scim.go index 7deee6be4b5..02136d7ef91 100644 --- a/github/scim.go +++ b/github/scim.go @@ -14,12 +14,12 @@ import ( // SCIMService provides access to SCIM related functions in the // GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/scim +// GitHub API docs: https://docs.github.com/rest/scim type SCIMService service // SCIMUserAttributes represents supported SCIM User attributes. // -// GitHub API docs: https://docs.github.com/en/rest/scim#supported-scim-user-attributes +// GitHub API docs: https://docs.github.com/rest/scim#supported-scim-user-attributes type SCIMUserAttributes struct { UserName string `json:"userName"` // Configured by the admin. Could be an email, login, or username. (Required.) Name SCIMUserName `json:"name"` // (Required.) @@ -67,7 +67,7 @@ type SCIMProvisionedIdentities struct { // ListSCIMProvisionedIdentitiesOptions represents options for ListSCIMProvisionedIdentities. // -// Github API docs: https://docs.github.com/en/rest/scim#list-scim-provisioned-identities--parameters +// GitHub API docs: https://docs.github.com/rest/scim#list-scim-provisioned-identities--parameters type ListSCIMProvisionedIdentitiesOptions struct { StartIndex *int `url:"startIndex,omitempty"` // Used for pagination: the index of the first result to return. (Optional.) Count *int `url:"count,omitempty"` // Used for pagination: the number of results to return. (Optional.) @@ -81,7 +81,9 @@ type ListSCIMProvisionedIdentitiesOptions struct { // ListSCIMProvisionedIdentities lists SCIM provisioned identities. // -// GitHub API docs: https://docs.github.com/en/rest/scim#list-scim-provisioned-identities +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#list-scim-provisioned-identities +// +//meta:operation GET /scim/v2/organizations/{org}/Users func (s *SCIMService) ListSCIMProvisionedIdentities(ctx context.Context, org string, opts *ListSCIMProvisionedIdentitiesOptions) (*SCIMProvisionedIdentities, *Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users", org) u, err := addOptions(u, opts) @@ -105,7 +107,9 @@ func (s *SCIMService) ListSCIMProvisionedIdentities(ctx context.Context, org str // ProvisionAndInviteSCIMUser provisions organization membership for a user, and sends an activation email to the email address. // -// GitHub API docs: https://docs.github.com/en/rest/scim#provision-and-invite-a-scim-user +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#provision-and-invite-a-scim-user +// +//meta:operation POST /scim/v2/organizations/{org}/Users func (s *SCIMService) ProvisionAndInviteSCIMUser(ctx context.Context, org string, opts *SCIMUserAttributes) (*Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users", org) u, err := addOptions(u, opts) @@ -123,7 +127,9 @@ func (s *SCIMService) ProvisionAndInviteSCIMUser(ctx context.Context, org string // GetSCIMProvisioningInfoForUser returns SCIM provisioning information for a user. // -// GitHub API docs: https://docs.github.com/en/rest/scim#supported-scim-user-attributes +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#get-scim-provisioning-information-for-a-user +// +//meta:operation GET /scim/v2/organizations/{org}/Users/{scim_user_id} func (s *SCIMService) GetSCIMProvisioningInfoForUser(ctx context.Context, org, scimUserID string) (*SCIMUserAttributes, *Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users/%v", org, scimUserID) req, err := s.client.NewRequest("GET", u, nil) @@ -142,7 +148,9 @@ func (s *SCIMService) GetSCIMProvisioningInfoForUser(ctx context.Context, org, s // UpdateProvisionedOrgMembership updates a provisioned organization membership. // -// GitHub API docs: https://docs.github.com/en/rest/scim#update-a-provisioned-organization-membership +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#update-a-provisioned-organization-membership +// +//meta:operation PUT /scim/v2/organizations/{org}/Users/{scim_user_id} func (s *SCIMService) UpdateProvisionedOrgMembership(ctx context.Context, org, scimUserID string, opts *SCIMUserAttributes) (*Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users/%v", org, scimUserID) u, err := addOptions(u, opts) @@ -160,7 +168,7 @@ func (s *SCIMService) UpdateProvisionedOrgMembership(ctx context.Context, org, s // UpdateAttributeForSCIMUserOptions represents options for UpdateAttributeForSCIMUser. // -// GitHub API docs: https://docs.github.com/en/rest/scim#update-an-attribute-for-a-scim-user--parameters +// GitHub API docs: https://docs.github.com/rest/scim#update-an-attribute-for-a-scim-user--parameters type UpdateAttributeForSCIMUserOptions struct { Schemas []string `json:"schemas,omitempty"` // (Optional.) Operations UpdateAttributeForSCIMUserOperations `json:"operations"` // Set of operations to be performed. (Required.) @@ -175,7 +183,9 @@ type UpdateAttributeForSCIMUserOperations struct { // UpdateAttributeForSCIMUser updates an attribute for an SCIM user. // -// GitHub API docs: https://docs.github.com/en/rest/scim#update-an-attribute-for-a-scim-user +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#update-an-attribute-for-a-scim-user +// +//meta:operation PATCH /scim/v2/organizations/{org}/Users/{scim_user_id} func (s *SCIMService) UpdateAttributeForSCIMUser(ctx context.Context, org, scimUserID string, opts *UpdateAttributeForSCIMUserOptions) (*Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users/%v", org, scimUserID) u, err := addOptions(u, opts) @@ -193,7 +203,9 @@ func (s *SCIMService) UpdateAttributeForSCIMUser(ctx context.Context, org, scimU // DeleteSCIMUserFromOrg deletes SCIM user from an organization. // -// GitHub API docs: https://docs.github.com/en/rest/scim#delete-a-scim-user-from-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#delete-a-scim-user-from-an-organization +// +//meta:operation DELETE /scim/v2/organizations/{org}/Users/{scim_user_id} func (s *SCIMService) DeleteSCIMUserFromOrg(ctx context.Context, org, scimUserID string) (*Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users/%v", org, scimUserID) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/search.go b/github/search.go index adb832d0d8f..71efe87a039 100644 --- a/github/search.go +++ b/github/search.go @@ -32,7 +32,7 @@ import ( // For example, querying with "language:c++" and "leveldb", then query should be // "language:c++ leveldb" but not "language:c+++leveldb". // -// GitHub API docs: https://docs.github.com/en/rest/search/ +// GitHub API docs: https://docs.github.com/rest/search/ type SearchService service // SearchOptions specifies optional parameters to the SearchService methods. @@ -72,7 +72,9 @@ type RepositoriesSearchResult struct { // Repositories searches repositories via various criteria. // -// GitHub API docs: https://docs.github.com/en/rest/search#search-repositories +// GitHub API docs: https://docs.github.com/rest/search/search#search-repositories +// +//meta:operation GET /search/repositories func (s *SearchService) Repositories(ctx context.Context, query string, opts *SearchOptions) (*RepositoriesSearchResult, *Response, error) { result := new(RepositoriesSearchResult) resp, err := s.search(ctx, "repositories", &searchParameters{Query: query}, opts, result) @@ -104,10 +106,12 @@ type TopicResult struct { } // Topics finds topics via various criteria. Results are sorted by best match. -// Please see https://help.github.com/en/articles/searching-topics for more +// Please see https://help.github.com/articles/searching-topics for more // information about search qualifiers. // -// GitHub API docs: https://docs.github.com/en/rest/search#search-topics +// GitHub API docs: https://docs.github.com/rest/search/search#search-topics +// +//meta:operation GET /search/topics func (s *SearchService) Topics(ctx context.Context, query string, opts *SearchOptions) (*TopicsSearchResult, *Response, error) { result := new(TopicsSearchResult) resp, err := s.search(ctx, "topics", &searchParameters{Query: query}, opts, result) @@ -142,7 +146,9 @@ type CommitResult struct { // Commits searches commits via various criteria. // -// GitHub API docs: https://docs.github.com/en/rest/search#search-commits +// GitHub API docs: https://docs.github.com/rest/search/search#search-commits +// +//meta:operation GET /search/commits func (s *SearchService) Commits(ctx context.Context, query string, opts *SearchOptions) (*CommitsSearchResult, *Response, error) { result := new(CommitsSearchResult) resp, err := s.search(ctx, "commits", &searchParameters{Query: query}, opts, result) @@ -162,7 +168,9 @@ type IssuesSearchResult struct { // Issues searches issues via various criteria. // -// GitHub API docs: https://docs.github.com/en/rest/search#search-issues-and-pull-requests +// GitHub API docs: https://docs.github.com/rest/search/search#search-issues-and-pull-requests +// +//meta:operation GET /search/issues func (s *SearchService) Issues(ctx context.Context, query string, opts *SearchOptions) (*IssuesSearchResult, *Response, error) { result := new(IssuesSearchResult) resp, err := s.search(ctx, "issues", &searchParameters{Query: query}, opts, result) @@ -182,7 +190,9 @@ type UsersSearchResult struct { // Users searches users via various criteria. // -// GitHub API docs: https://docs.github.com/en/rest/search#search-users +// GitHub API docs: https://docs.github.com/rest/search/search#search-users +// +//meta:operation GET /search/users func (s *SearchService) Users(ctx context.Context, query string, opts *SearchOptions) (*UsersSearchResult, *Response, error) { result := new(UsersSearchResult) resp, err := s.search(ctx, "users", &searchParameters{Query: query}, opts, result) @@ -235,7 +245,9 @@ func (c CodeResult) String() string { // Code searches code via various criteria. // -// GitHub API docs: https://docs.github.com/en/rest/search#search-code +// GitHub API docs: https://docs.github.com/rest/search/search#search-code +// +//meta:operation GET /search/code func (s *SearchService) Code(ctx context.Context, query string, opts *SearchOptions) (*CodeSearchResult, *Response, error) { result := new(CodeSearchResult) resp, err := s.search(ctx, "code", &searchParameters{Query: query}, opts, result) @@ -270,7 +282,9 @@ func (l LabelResult) String() string { // Labels searches labels in the repository with ID repoID via various criteria. // -// GitHub API docs: https://docs.github.com/en/rest/search#search-labels +// GitHub API docs: https://docs.github.com/rest/search/search#search-labels +// +//meta:operation GET /search/labels func (s *SearchService) Labels(ctx context.Context, repoID int64, query string, opts *SearchOptions) (*LabelsSearchResult, *Response, error) { result := new(LabelsSearchResult) resp, err := s.search(ctx, "labels", &searchParameters{RepositoryID: &repoID, Query: query}, opts, result) @@ -321,7 +335,7 @@ func (s *SearchService) search(ctx context.Context, searchType string, parameter // TODO: remove custom Accept header when this API fully launches. acceptHeaders = append(acceptHeaders, mediaTypeReactionsPreview) } - // https://docs.github.com/en/rest/search#search-repositories + // https://docs.github.com/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 { diff --git a/github/secret_scanning.go b/github/secret_scanning.go index ddcbfc1b667..9b2ad8cd0d2 100644 --- a/github/secret_scanning.go +++ b/github/secret_scanning.go @@ -72,9 +72,9 @@ type SecretScanningAlertListOptions struct { // List options can vary on the Enterprise type. // On Enterprise Cloud, Secret Scan alerts support requesting by page number // along with providing a cursor for an "after" param. - // See: https://docs.github.com/en/enterprise-cloud@latest/rest/secret-scanning#list-secret-scanning-alerts-for-an-organization + // See: https://docs.github.com/enterprise-cloud@latest/rest/secret-scanning#list-secret-scanning-alerts-for-an-organization // Whereas on Enterprise Server, pagination is by index. - // See: https://docs.github.com/en/enterprise-server@3.6/rest/secret-scanning#list-secret-scanning-alerts-for-an-organization + // See: https://docs.github.com/enterprise-server@3.6/rest/secret-scanning#list-secret-scanning-alerts-for-an-organization ListOptions } @@ -95,7 +95,9 @@ type SecretScanningAlertUpdateOptions struct { // To use this endpoint, you must be a member of the enterprise, and you must use an access token with the repo scope or // security_events scope. Alerts are only returned for organizations in the enterprise for which you are an organization owner or a security manager. // -// GitHub API docs: https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#list-secret-scanning-alerts-for-an-enterprise +// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/secret-scanning/alerts func (s *SecretScanningService) ListAlertsForEnterprise(ctx context.Context, enterprise string, opts *SecretScanningAlertListOptions) ([]*SecretScanningAlert, *Response, error) { u := fmt.Sprintf("enterprises/%v/secret-scanning/alerts", enterprise) u, err := addOptions(u, opts) @@ -122,7 +124,9 @@ func (s *SecretScanningService) ListAlertsForEnterprise(ctx context.Context, ent // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#list-secret-scanning-alerts-for-an-organization +// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-organization +// +//meta:operation GET /orgs/{org}/secret-scanning/alerts func (s *SecretScanningService) ListAlertsForOrg(ctx context.Context, org string, opts *SecretScanningAlertListOptions) ([]*SecretScanningAlert, *Response, error) { u := fmt.Sprintf("orgs/%v/secret-scanning/alerts", org) u, err := addOptions(u, opts) @@ -149,7 +153,9 @@ func (s *SecretScanningService) ListAlertsForOrg(ctx context.Context, org string // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#list-secret-scanning-alerts-for-a-repository +// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/secret-scanning/alerts func (s *SecretScanningService) ListAlertsForRepo(ctx context.Context, owner, repo string, opts *SecretScanningAlertListOptions) ([]*SecretScanningAlert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/secret-scanning/alerts", owner, repo) u, err := addOptions(u, opts) @@ -176,7 +182,9 @@ func (s *SecretScanningService) ListAlertsForRepo(ctx context.Context, owner, re // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#get-a-secret-scanning-alert +// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#get-a-secret-scanning-alert +// +//meta:operation GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} func (s *SecretScanningService) GetAlert(ctx context.Context, owner, repo string, number int64) (*SecretScanningAlert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/secret-scanning/alerts/%v", owner, repo, number) @@ -199,7 +207,9 @@ func (s *SecretScanningService) GetAlert(ctx context.Context, owner, repo string // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#update-a-secret-scanning-alert +// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#update-a-secret-scanning-alert +// +//meta:operation PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} func (s *SecretScanningService) UpdateAlert(ctx context.Context, owner, repo string, number int64, opts *SecretScanningAlertUpdateOptions) (*SecretScanningAlert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/secret-scanning/alerts/%v", owner, repo, number) @@ -222,7 +232,9 @@ func (s *SecretScanningService) UpdateAlert(ctx context.Context, owner, repo str // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#list-locations-for-a-secret-scanning-alert +// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#list-locations-for-a-secret-scanning-alert +// +//meta:operation GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations func (s *SecretScanningService) ListLocationsForAlert(ctx context.Context, owner, repo string, number int64, opts *ListOptions) ([]*SecretScanningAlertLocation, *Response, error) { u := fmt.Sprintf("repos/%v/%v/secret-scanning/alerts/%v/locations", owner, repo, number) u, err := addOptions(u, opts) diff --git a/github/security_advisories.go b/github/security_advisories.go index 681d0cd4bd5..66e7dba15ac 100644 --- a/github/security_advisories.go +++ b/github/security_advisories.go @@ -50,7 +50,9 @@ type ListRepositorySecurityAdvisoriesOptions struct { // RequestCVE requests a Common Vulnerabilities and Exposures (CVE) for a repository security advisory. // The ghsaID is the GitHub Security Advisory identifier of the advisory. // -// GitHub API docs: https://docs.github.com/en/rest/security-advisories/repository-advisories#request-a-cve-for-a-repository-security-advisory +// GitHub API docs: https://docs.github.com/rest/security-advisories/repository-advisories#request-a-cve-for-a-repository-security-advisory +// +//meta:operation POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve func (s *SecurityAdvisoriesService) RequestCVE(ctx context.Context, owner, repo, ghsaID string) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/security-advisories/%v/cve", owner, repo, ghsaID) @@ -73,7 +75,9 @@ func (s *SecurityAdvisoriesService) RequestCVE(ctx context.Context, owner, repo, // ListRepositorySecurityAdvisoriesForOrg lists the repository security advisories for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/security-advisories/repository-advisories?apiVersion=2022-11-28#list-repository-security-advisories-for-an-organization +// GitHub API docs: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories-for-an-organization +// +//meta:operation GET /orgs/{org}/security-advisories func (s *SecurityAdvisoriesService) ListRepositorySecurityAdvisoriesForOrg(ctx context.Context, org string, opt *ListRepositorySecurityAdvisoriesOptions) ([]*SecurityAdvisory, *Response, error) { url := fmt.Sprintf("orgs/%v/security-advisories", org) url, err := addOptions(url, opt) @@ -97,7 +101,9 @@ func (s *SecurityAdvisoriesService) ListRepositorySecurityAdvisoriesForOrg(ctx c // ListRepositorySecurityAdvisories lists the security advisories in a repository. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/security-advisories/repository-advisories?apiVersion=2022-11-28#list-repository-security-advisories +// GitHub API docs: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories +// +//meta:operation GET /repos/{owner}/{repo}/security-advisories func (s *SecurityAdvisoriesService) ListRepositorySecurityAdvisories(ctx context.Context, owner, repo string, opt *ListRepositorySecurityAdvisoriesOptions) ([]*SecurityAdvisory, *Response, error) { url := fmt.Sprintf("repos/%v/%v/security-advisories", owner, repo) url, err := addOptions(url, opt) diff --git a/github/teams.go b/github/teams.go index 0ee7c200792..fd22b792a66 100644 --- a/github/teams.go +++ b/github/teams.go @@ -15,7 +15,7 @@ import ( // TeamsService provides access to the team-related functions // in the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/teams/ +// GitHub API docs: https://docs.github.com/rest/teams/ type TeamsService service // Team represents a team within a GitHub organization. Teams are used to @@ -81,7 +81,9 @@ func (i Invitation) String() string { // ListTeams lists all of the teams for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-teams +// GitHub API docs: https://docs.github.com/rest/teams/teams#list-teams +// +//meta:operation GET /orgs/{org}/teams func (s *TeamsService) ListTeams(ctx context.Context, org string, opts *ListOptions) ([]*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/teams", org) u, err := addOptions(u, opts) @@ -105,7 +107,9 @@ func (s *TeamsService) ListTeams(ctx context.Context, org string, opts *ListOpti // GetTeamByID fetches a team, given a specified organization ID, by ID. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#get-a-team-by-name +// GitHub API docs: https://docs.github.com/rest/teams/teams#get-a-team-by-name +// +//meta:operation GET /orgs/{org}/teams/{team_slug} func (s *TeamsService) GetTeamByID(ctx context.Context, orgID, teamID int64) (*Team, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v", orgID, teamID) req, err := s.client.NewRequest("GET", u, nil) @@ -124,7 +128,9 @@ func (s *TeamsService) GetTeamByID(ctx context.Context, orgID, teamID int64) (*T // GetTeamBySlug fetches a team, given a specified organization name, by slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#get-a-team-by-name +// GitHub API docs: https://docs.github.com/rest/teams/teams#get-a-team-by-name +// +//meta:operation GET /orgs/{org}/teams/{team_slug} func (s *TeamsService) GetTeamBySlug(ctx context.Context, org, slug string) (*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v", org, slug) req, err := s.client.NewRequest("GET", u, nil) @@ -174,7 +180,9 @@ func (s NewTeam) String() string { // CreateTeam creates a new team within an organization. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#create-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams#create-a-team +// +//meta:operation POST /orgs/{org}/teams func (s *TeamsService) CreateTeam(ctx context.Context, org string, team NewTeam) (*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/teams", org) req, err := s.client.NewRequest("POST", u, team) @@ -220,7 +228,9 @@ func copyNewTeamWithoutParent(team *NewTeam) *newTeamNoParent { // EditTeamByID edits a team, given an organization ID, selected by ID. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#update-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams#update-a-team +// +//meta:operation PATCH /orgs/{org}/teams/{team_slug} func (s *TeamsService) EditTeamByID(ctx context.Context, orgID, teamID int64, team NewTeam, removeParent bool) (*Team, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v", orgID, teamID) @@ -247,7 +257,9 @@ func (s *TeamsService) EditTeamByID(ctx context.Context, orgID, teamID int64, te // EditTeamBySlug edits a team, given an organization name, by slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#update-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams#update-a-team +// +//meta:operation PATCH /orgs/{org}/teams/{team_slug} func (s *TeamsService) EditTeamBySlug(ctx context.Context, org, slug string, team NewTeam, removeParent bool) (*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v", org, slug) @@ -274,7 +286,9 @@ func (s *TeamsService) EditTeamBySlug(ctx context.Context, org, slug string, tea // DeleteTeamByID deletes a team referenced by ID. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#delete-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams#delete-a-team +// +//meta:operation DELETE /orgs/{org}/teams/{team_slug} func (s *TeamsService) DeleteTeamByID(ctx context.Context, orgID, teamID int64) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v", orgID, teamID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -287,7 +301,9 @@ func (s *TeamsService) DeleteTeamByID(ctx context.Context, orgID, teamID int64) // DeleteTeamBySlug deletes a team reference by slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#delete-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams#delete-a-team +// +//meta:operation DELETE /orgs/{org}/teams/{team_slug} func (s *TeamsService) DeleteTeamBySlug(ctx context.Context, org, slug string) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v", org, slug) req, err := s.client.NewRequest("DELETE", u, nil) @@ -300,7 +316,9 @@ func (s *TeamsService) DeleteTeamBySlug(ctx context.Context, org, slug string) ( // ListChildTeamsByParentID lists child teams for a parent team given parent ID. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-child-teams +// GitHub API docs: https://docs.github.com/rest/teams/teams#list-child-teams +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/teams func (s *TeamsService) ListChildTeamsByParentID(ctx context.Context, orgID, teamID int64, opts *ListOptions) ([]*Team, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/teams", orgID, teamID) u, err := addOptions(u, opts) @@ -324,7 +342,9 @@ func (s *TeamsService) ListChildTeamsByParentID(ctx context.Context, orgID, team // ListChildTeamsByParentSlug lists child teams for a parent team given parent slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-child-teams +// GitHub API docs: https://docs.github.com/rest/teams/teams#list-child-teams +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/teams func (s *TeamsService) ListChildTeamsByParentSlug(ctx context.Context, org, slug string, opts *ListOptions) ([]*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/teams", org, slug) u, err := addOptions(u, opts) @@ -348,7 +368,9 @@ func (s *TeamsService) ListChildTeamsByParentSlug(ctx context.Context, org, slug // ListTeamReposByID lists the repositories given a team ID that the specified team has access to. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-team-repositories +// GitHub API docs: https://docs.github.com/rest/teams/teams#list-team-repositories +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/repos func (s *TeamsService) ListTeamReposByID(ctx context.Context, orgID, teamID int64, opts *ListOptions) ([]*Repository, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/repos", orgID, teamID) u, err := addOptions(u, opts) @@ -376,7 +398,9 @@ func (s *TeamsService) ListTeamReposByID(ctx context.Context, orgID, teamID int6 // ListTeamReposBySlug lists the repositories given a team slug that the specified team has access to. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-team-repositories +// GitHub API docs: https://docs.github.com/rest/teams/teams#list-team-repositories +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/repos func (s *TeamsService) ListTeamReposBySlug(ctx context.Context, org, slug string, opts *ListOptions) ([]*Repository, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/repos", org, slug) u, err := addOptions(u, opts) @@ -406,7 +430,9 @@ func (s *TeamsService) ListTeamReposBySlug(ctx context.Context, org, slug string // repository is managed by team, a Repository is returned which includes the // permissions team has for that repo. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#check-team-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} func (s *TeamsService) IsTeamRepoByID(ctx context.Context, orgID, teamID int64, owner, repo string) (*Repository, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/repos/%v/%v", orgID, teamID, owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -430,7 +456,9 @@ func (s *TeamsService) IsTeamRepoByID(ctx context.Context, orgID, teamID int64, // repository is managed by team, a Repository is returned which includes the // permissions team has for that repo. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#check-team-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} func (s *TeamsService) IsTeamRepoBySlug(ctx context.Context, org, slug, owner, repo string) (*Repository, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/repos/%v/%v", org, slug, owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -469,7 +497,9 @@ type TeamAddTeamRepoOptions struct { // The specified repository must be owned by the organization to which the team // belongs, or a direct fork of a repository owned by the organization. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#add-or-update-team-repository-permissions +// GitHub API docs: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions +// +//meta:operation PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} func (s *TeamsService) AddTeamRepoByID(ctx context.Context, orgID, teamID int64, owner, repo string, opts *TeamAddTeamRepoOptions) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/repos/%v/%v", orgID, teamID, owner, repo) req, err := s.client.NewRequest("PUT", u, opts) @@ -484,7 +514,9 @@ func (s *TeamsService) AddTeamRepoByID(ctx context.Context, orgID, teamID int64, // The specified repository must be owned by the organization to which the team // belongs, or a direct fork of a repository owned by the organization. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#add-or-update-team-repository-permissions +// GitHub API docs: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions +// +//meta:operation PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} func (s *TeamsService) AddTeamRepoBySlug(ctx context.Context, org, slug, owner, repo string, opts *TeamAddTeamRepoOptions) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/repos/%v/%v", org, slug, owner, repo) req, err := s.client.NewRequest("PUT", u, opts) @@ -499,7 +531,9 @@ func (s *TeamsService) AddTeamRepoBySlug(ctx context.Context, org, slug, owner, // team given the team ID. Note that this does not delete the repository, it // just removes it from the team. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#remove-a-repository-from-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team +// +//meta:operation DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} func (s *TeamsService) RemoveTeamRepoByID(ctx context.Context, orgID, teamID int64, owner, repo string) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/repos/%v/%v", orgID, teamID, owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) @@ -514,7 +548,9 @@ func (s *TeamsService) RemoveTeamRepoByID(ctx context.Context, orgID, teamID int // team given the team slug. Note that this does not delete the repository, it // just removes it from the team. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#remove-a-repository-from-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team +// +//meta:operation DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} func (s *TeamsService) RemoveTeamRepoBySlug(ctx context.Context, org, slug, owner, repo string) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/repos/%v/%v", org, slug, owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) @@ -526,7 +562,10 @@ func (s *TeamsService) RemoveTeamRepoBySlug(ctx context.Context, org, slug, owne } // ListUserTeams lists a user's teams -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-teams-for-the-authenticated-user +// +// GitHub API docs: https://docs.github.com/rest/teams/teams#list-teams-for-the-authenticated-user +// +//meta:operation GET /user/teams func (s *TeamsService) ListUserTeams(ctx context.Context, opts *ListOptions) ([]*Team, *Response, error) { u := "user/teams" u, err := addOptions(u, opts) @@ -550,7 +589,9 @@ func (s *TeamsService) ListUserTeams(ctx context.Context, opts *ListOptions) ([] // ListTeamProjectsByID lists the organization projects for a team given the team ID. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-team-projects +// GitHub API docs: https://docs.github.com/rest/teams/teams#list-team-projects +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/projects func (s *TeamsService) ListTeamProjectsByID(ctx context.Context, orgID, teamID int64) ([]*Project, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/projects", orgID, teamID) @@ -574,7 +615,9 @@ func (s *TeamsService) ListTeamProjectsByID(ctx context.Context, orgID, teamID i // ListTeamProjectsBySlug lists the organization projects for a team given the team slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-team-projects +// GitHub API docs: https://docs.github.com/rest/teams/teams#list-team-projects +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/projects func (s *TeamsService) ListTeamProjectsBySlug(ctx context.Context, org, slug string) ([]*Project, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/projects", org, slug) @@ -599,7 +642,9 @@ func (s *TeamsService) ListTeamProjectsBySlug(ctx context.Context, org, slug str // ReviewTeamProjectsByID checks whether a team, given its ID, has read, write, or admin // permissions for an organization project. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#check-team-permissions-for-a-project +// GitHub API docs: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/projects/{project_id} func (s *TeamsService) ReviewTeamProjectsByID(ctx context.Context, orgID, teamID, projectID int64) (*Project, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/projects/%v", orgID, teamID, projectID) req, err := s.client.NewRequest("GET", u, nil) @@ -623,7 +668,9 @@ func (s *TeamsService) ReviewTeamProjectsByID(ctx context.Context, orgID, teamID // ReviewTeamProjectsBySlug checks whether a team, given its slug, has read, write, or admin // permissions for an organization project. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#check-team-permissions-for-a-project +// GitHub API docs: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/projects/{project_id} func (s *TeamsService) ReviewTeamProjectsBySlug(ctx context.Context, org, slug string, projectID int64) (*Project, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/projects/%v", org, slug, projectID) req, err := s.client.NewRequest("GET", u, nil) @@ -660,7 +707,9 @@ type TeamProjectOptions struct { // To add a project to a team or update the team's permission on a project, the // authenticated user must have admin permissions for the project. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#add-or-update-team-project-permissions +// GitHub API docs: https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions +// +//meta:operation PUT /orgs/{org}/teams/{team_slug}/projects/{project_id} func (s *TeamsService) AddTeamProjectByID(ctx context.Context, orgID, teamID, projectID int64, opts *TeamProjectOptions) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/projects/%v", orgID, teamID, projectID) req, err := s.client.NewRequest("PUT", u, opts) @@ -679,7 +728,9 @@ func (s *TeamsService) AddTeamProjectByID(ctx context.Context, orgID, teamID, pr // To add a project to a team or update the team's permission on a project, the // authenticated user must have admin permissions for the project. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#add-or-update-team-project-permissions +// GitHub API docs: https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions +// +//meta:operation PUT /orgs/{org}/teams/{team_slug}/projects/{project_id} func (s *TeamsService) AddTeamProjectBySlug(ctx context.Context, org, slug string, projectID int64, opts *TeamProjectOptions) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/projects/%v", org, slug, projectID) req, err := s.client.NewRequest("PUT", u, opts) @@ -701,7 +752,9 @@ func (s *TeamsService) AddTeamProjectBySlug(ctx context.Context, org, slug strin // or project. // Note: This endpoint removes the project from the team, but does not delete it. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#remove-a-project-from-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team +// +//meta:operation DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id} func (s *TeamsService) RemoveTeamProjectByID(ctx context.Context, orgID, teamID, projectID int64) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/projects/%v", orgID, teamID, projectID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -723,7 +776,9 @@ func (s *TeamsService) RemoveTeamProjectByID(ctx context.Context, orgID, teamID, // or project. // Note: This endpoint removes the project from the team, but does not delete it. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#remove-a-project-from-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team +// +//meta:operation DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id} func (s *TeamsService) RemoveTeamProjectBySlug(ctx context.Context, org, slug string, projectID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/projects/%v", org, slug, projectID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -752,7 +807,9 @@ type IDPGroup struct { // ListIDPGroupsInOrganization lists IDP groups available in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/teams/team-sync#list-idp-groups-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#list-idp-groups-for-an-organization +// +//meta:operation GET /orgs/{org}/team-sync/groups func (s *TeamsService) ListIDPGroupsInOrganization(ctx context.Context, org string, opts *ListCursorOptions) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("orgs/%v/team-sync/groups", org) u, err := addOptions(u, opts) @@ -777,7 +834,9 @@ func (s *TeamsService) ListIDPGroupsInOrganization(ctx context.Context, org stri // ListIDPGroupsForTeamByID lists IDP groups connected to a team on GitHub // given organization and team IDs. // -// GitHub API docs: https://docs.github.com/en/rest/teams/team-sync#list-idp-groups-for-a-team +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#list-idp-groups-for-a-team +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings func (s *TeamsService) ListIDPGroupsForTeamByID(ctx context.Context, orgID, teamID int64) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/team-sync/group-mappings", orgID, teamID) @@ -798,7 +857,9 @@ func (s *TeamsService) ListIDPGroupsForTeamByID(ctx context.Context, orgID, team // ListIDPGroupsForTeamBySlug lists IDP groups connected to a team on GitHub // given organization name and team slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/team-sync#list-idp-groups-for-a-team +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#list-idp-groups-for-a-team +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings func (s *TeamsService) ListIDPGroupsForTeamBySlug(ctx context.Context, org, slug string) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/team-sync/group-mappings", org, slug) @@ -819,7 +880,9 @@ func (s *TeamsService) ListIDPGroupsForTeamBySlug(ctx context.Context, org, slug // CreateOrUpdateIDPGroupConnectionsByID creates, updates, or removes a connection // between a team and an IDP group given organization and team IDs. // -// GitHub API docs: https://docs.github.com/en/rest/teams/team-sync#create-or-update-idp-group-connections +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#create-or-update-idp-group-connections +// +//meta:operation PATCH /orgs/{org}/teams/{team_slug}/team-sync/group-mappings func (s *TeamsService) CreateOrUpdateIDPGroupConnectionsByID(ctx context.Context, orgID, teamID int64, opts IDPGroupList) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/team-sync/group-mappings", orgID, teamID) @@ -840,7 +903,9 @@ func (s *TeamsService) CreateOrUpdateIDPGroupConnectionsByID(ctx context.Context // CreateOrUpdateIDPGroupConnectionsBySlug creates, updates, or removes a connection // between a team and an IDP group given organization name and team slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/team-sync#create-or-update-idp-group-connections +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#create-or-update-idp-group-connections +// +//meta:operation PATCH /orgs/{org}/teams/{team_slug}/team-sync/group-mappings func (s *TeamsService) CreateOrUpdateIDPGroupConnectionsBySlug(ctx context.Context, org, slug string, opts IDPGroupList) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/team-sync/group-mappings", org, slug) @@ -888,7 +953,9 @@ type ExternalGroupList struct { // GetExternalGroup fetches an external group. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/teams/external-groups#get-an-external-group +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/external-groups#get-an-external-group +// +//meta:operation GET /orgs/{org}/external-group/{group_id} func (s *TeamsService) GetExternalGroup(ctx context.Context, org string, groupID int64) (*ExternalGroup, *Response, error) { u := fmt.Sprintf("orgs/%v/external-group/%v", org, groupID) req, err := s.client.NewRequest("GET", u, nil) @@ -915,7 +982,9 @@ type ListExternalGroupsOptions struct { // ListExternalGroups lists external groups in an organization on GitHub. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/teams/external-groups#list-external-groups-in-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/external-groups#list-external-groups-in-an-organization +// +//meta:operation GET /orgs/{org}/external-groups func (s *TeamsService) ListExternalGroups(ctx context.Context, org string, opts *ListExternalGroupsOptions) (*ExternalGroupList, *Response, error) { u := fmt.Sprintf("orgs/%v/external-groups", org) u, err := addOptions(u, opts) @@ -939,7 +1008,9 @@ func (s *TeamsService) ListExternalGroups(ctx context.Context, org string, opts // ListExternalGroupsForTeamBySlug lists external groups connected to a team on GitHub. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/teams/external-groups#list-a-connection-between-an-external-group-and-a-team +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/external-groups#list-a-connection-between-an-external-group-and-a-team +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/external-groups func (s *TeamsService) ListExternalGroupsForTeamBySlug(ctx context.Context, org, slug string) (*ExternalGroupList, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/external-groups", org, slug) @@ -959,7 +1030,9 @@ func (s *TeamsService) ListExternalGroupsForTeamBySlug(ctx context.Context, org, // UpdateConnectedExternalGroup updates the connection between an external group and a team. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/teams/external-groups#update-the-connection-between-an-external-group-and-a-team +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/external-groups#update-the-connection-between-an-external-group-and-a-team +// +//meta:operation PATCH /orgs/{org}/teams/{team_slug}/external-groups func (s *TeamsService) UpdateConnectedExternalGroup(ctx context.Context, org, slug string, eg *ExternalGroup) (*ExternalGroup, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/external-groups", org, slug) @@ -979,7 +1052,9 @@ func (s *TeamsService) UpdateConnectedExternalGroup(ctx context.Context, org, sl // RemoveConnectedExternalGroup removes the connection between an external group and a team. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/teams/external-groups#remove-the-connection-between-an-external-group-and-a-team +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/external-groups#remove-the-connection-between-an-external-group-and-a-team +// +//meta:operation DELETE /orgs/{org}/teams/{team_slug}/external-groups func (s *TeamsService) RemoveConnectedExternalGroup(ctx context.Context, org, slug string) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/external-groups", org, slug) diff --git a/github/teams_discussion_comments.go b/github/teams_discussion_comments.go index f3a1cc4dc00..ad3818c13fb 100644 --- a/github/teams_discussion_comments.go +++ b/github/teams_discussion_comments.go @@ -43,7 +43,9 @@ type DiscussionCommentListOptions struct { // ListCommentsByID lists all comments on a team discussion by team ID. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#list-discussion-comments +// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments func (s *TeamsService) ListCommentsByID(ctx context.Context, orgID, teamID int64, discussionNumber int, options *DiscussionCommentListOptions) ([]*DiscussionComment, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments", orgID, teamID, discussionNumber) u, err := addOptions(u, options) @@ -68,7 +70,9 @@ func (s *TeamsService) ListCommentsByID(ctx context.Context, orgID, teamID int64 // ListCommentsBySlug lists all comments on a team discussion by team slug. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#list-discussion-comments +// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments func (s *TeamsService) ListCommentsBySlug(ctx context.Context, org, slug string, discussionNumber int, options *DiscussionCommentListOptions) ([]*DiscussionComment, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments", org, slug, discussionNumber) u, err := addOptions(u, options) @@ -93,7 +97,9 @@ func (s *TeamsService) ListCommentsBySlug(ctx context.Context, org, slug string, // GetCommentByID gets a specific comment on a team discussion by team ID. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#get-a-discussion-comment +// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} func (s *TeamsService) GetCommentByID(ctx context.Context, orgID, teamID int64, discussionNumber, commentNumber int) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v", orgID, teamID, discussionNumber, commentNumber) req, err := s.client.NewRequest("GET", u, nil) @@ -113,7 +119,9 @@ func (s *TeamsService) GetCommentByID(ctx context.Context, orgID, teamID int64, // GetCommentBySlug gets a specific comment on a team discussion by team slug. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#get-a-discussion-comment +// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} func (s *TeamsService) GetCommentBySlug(ctx context.Context, org, slug string, discussionNumber, commentNumber int) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v", org, slug, discussionNumber, commentNumber) @@ -134,7 +142,9 @@ func (s *TeamsService) GetCommentBySlug(ctx context.Context, org, slug string, d // CreateCommentByID creates a new comment on a team discussion by team ID. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#create-a-discussion-comment +// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment +// +//meta:operation POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments func (s *TeamsService) CreateCommentByID(ctx context.Context, orgID, teamID int64, discsusionNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments", orgID, teamID, discsusionNumber) req, err := s.client.NewRequest("POST", u, comment) @@ -154,7 +164,9 @@ func (s *TeamsService) CreateCommentByID(ctx context.Context, orgID, teamID int6 // CreateCommentBySlug creates a new comment on a team discussion by team slug. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#create-a-discussion-comment +// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment +// +//meta:operation POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments func (s *TeamsService) CreateCommentBySlug(ctx context.Context, org, slug string, discsusionNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments", org, slug, discsusionNumber) req, err := s.client.NewRequest("POST", u, comment) @@ -175,7 +187,9 @@ func (s *TeamsService) CreateCommentBySlug(ctx context.Context, org, slug string // Authenticated user must grant write:discussion scope. // User is allowed to edit body of a comment only. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#update-a-discussion-comment +// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment +// +//meta:operation PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} func (s *TeamsService) EditCommentByID(ctx context.Context, orgID, teamID int64, discussionNumber, commentNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v", orgID, teamID, discussionNumber, commentNumber) req, err := s.client.NewRequest("PATCH", u, comment) @@ -196,7 +210,9 @@ func (s *TeamsService) EditCommentByID(ctx context.Context, orgID, teamID int64, // Authenticated user must grant write:discussion scope. // User is allowed to edit body of a comment only. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#update-a-discussion-comment +// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment +// +//meta:operation PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} func (s *TeamsService) EditCommentBySlug(ctx context.Context, org, slug string, discussionNumber, commentNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v", org, slug, discussionNumber, commentNumber) req, err := s.client.NewRequest("PATCH", u, comment) @@ -216,7 +232,9 @@ func (s *TeamsService) EditCommentBySlug(ctx context.Context, org, slug string, // DeleteCommentByID deletes a comment on a team discussion by team ID. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#delete-a-discussion-comment +// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment +// +//meta:operation DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} func (s *TeamsService) DeleteCommentByID(ctx context.Context, orgID, teamID int64, discussionNumber, commentNumber int) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v", orgID, teamID, discussionNumber, commentNumber) req, err := s.client.NewRequest("DELETE", u, nil) @@ -230,7 +248,9 @@ func (s *TeamsService) DeleteCommentByID(ctx context.Context, orgID, teamID int6 // DeleteCommentBySlug deletes a comment on a team discussion by team slug. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#delete-a-discussion-comment +// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment +// +//meta:operation DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} func (s *TeamsService) DeleteCommentBySlug(ctx context.Context, org, slug string, discussionNumber, commentNumber int) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v", org, slug, discussionNumber, commentNumber) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/teams_discussions.go b/github/teams_discussions.go index 69a3ebd51ff..ee78c032a61 100644 --- a/github/teams_discussions.go +++ b/github/teams_discussions.go @@ -49,7 +49,9 @@ type DiscussionListOptions struct { // ListDiscussionsByID lists all discussions on team's page given Organization and Team ID. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#list-discussions +// GitHub API docs: https://docs.github.com/rest/teams/discussions#list-discussions +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/discussions func (s *TeamsService) ListDiscussionsByID(ctx context.Context, orgID, teamID int64, opts *DiscussionListOptions) ([]*TeamDiscussion, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions", orgID, teamID) u, err := addOptions(u, opts) @@ -74,7 +76,9 @@ func (s *TeamsService) ListDiscussionsByID(ctx context.Context, orgID, teamID in // ListDiscussionsBySlug lists all discussions on team's page given Organization name and Team's slug. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#list-discussions +// GitHub API docs: https://docs.github.com/rest/teams/discussions#list-discussions +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/discussions func (s *TeamsService) ListDiscussionsBySlug(ctx context.Context, org, slug string, opts *DiscussionListOptions) ([]*TeamDiscussion, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions", org, slug) u, err := addOptions(u, opts) @@ -99,7 +103,9 @@ func (s *TeamsService) ListDiscussionsBySlug(ctx context.Context, org, slug stri // GetDiscussionByID gets a specific discussion on a team's page given Organization and Team ID. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#get-a-discussion +// GitHub API docs: https://docs.github.com/rest/teams/discussions#get-a-discussion +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} func (s *TeamsService) GetDiscussionByID(ctx context.Context, orgID, teamID int64, discussionNumber int) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v", orgID, teamID, discussionNumber) req, err := s.client.NewRequest("GET", u, nil) @@ -119,7 +125,9 @@ func (s *TeamsService) GetDiscussionByID(ctx context.Context, orgID, teamID int6 // GetDiscussionBySlug gets a specific discussion on a team's page given Organization name and Team's slug. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#get-a-discussion +// GitHub API docs: https://docs.github.com/rest/teams/discussions#get-a-discussion +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} func (s *TeamsService) GetDiscussionBySlug(ctx context.Context, org, slug string, discussionNumber int) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v", org, slug, discussionNumber) req, err := s.client.NewRequest("GET", u, nil) @@ -139,7 +147,9 @@ func (s *TeamsService) GetDiscussionBySlug(ctx context.Context, org, slug string // CreateDiscussionByID creates a new discussion post on a team's page given Organization and Team ID. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#create-a-discussion +// GitHub API docs: https://docs.github.com/rest/teams/discussions#create-a-discussion +// +//meta:operation POST /orgs/{org}/teams/{team_slug}/discussions func (s *TeamsService) CreateDiscussionByID(ctx context.Context, orgID, teamID int64, discussion TeamDiscussion) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions", orgID, teamID) req, err := s.client.NewRequest("POST", u, discussion) @@ -159,7 +169,9 @@ func (s *TeamsService) CreateDiscussionByID(ctx context.Context, orgID, teamID i // CreateDiscussionBySlug creates a new discussion post on a team's page given Organization name and Team's slug. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#create-a-discussion +// GitHub API docs: https://docs.github.com/rest/teams/discussions#create-a-discussion +// +//meta:operation POST /orgs/{org}/teams/{team_slug}/discussions func (s *TeamsService) CreateDiscussionBySlug(ctx context.Context, org, slug string, discussion TeamDiscussion) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions", org, slug) req, err := s.client.NewRequest("POST", u, discussion) @@ -180,7 +192,9 @@ func (s *TeamsService) CreateDiscussionBySlug(ctx context.Context, org, slug str // Authenticated user must grant write:discussion scope. // User is allowed to change Title and Body of a discussion only. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#update-a-discussion +// GitHub API docs: https://docs.github.com/rest/teams/discussions#update-a-discussion +// +//meta:operation PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} func (s *TeamsService) EditDiscussionByID(ctx context.Context, orgID, teamID int64, discussionNumber int, discussion TeamDiscussion) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v", orgID, teamID, discussionNumber) req, err := s.client.NewRequest("PATCH", u, discussion) @@ -201,7 +215,9 @@ func (s *TeamsService) EditDiscussionByID(ctx context.Context, orgID, teamID int // Authenticated user must grant write:discussion scope. // User is allowed to change Title and Body of a discussion only. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#update-a-discussion +// GitHub API docs: https://docs.github.com/rest/teams/discussions#update-a-discussion +// +//meta:operation PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} func (s *TeamsService) EditDiscussionBySlug(ctx context.Context, org, slug string, discussionNumber int, discussion TeamDiscussion) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v", org, slug, discussionNumber) req, err := s.client.NewRequest("PATCH", u, discussion) @@ -221,7 +237,9 @@ func (s *TeamsService) EditDiscussionBySlug(ctx context.Context, org, slug strin // DeleteDiscussionByID deletes a discussion from team's page given Organization and Team ID. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#delete-a-discussion +// GitHub API docs: https://docs.github.com/rest/teams/discussions#delete-a-discussion +// +//meta:operation DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} func (s *TeamsService) DeleteDiscussionByID(ctx context.Context, orgID, teamID int64, discussionNumber int) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v", orgID, teamID, discussionNumber) req, err := s.client.NewRequest("DELETE", u, nil) @@ -235,7 +253,9 @@ func (s *TeamsService) DeleteDiscussionByID(ctx context.Context, orgID, teamID i // DeleteDiscussionBySlug deletes a discussion from team's page given Organization name and Team's slug. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#delete-a-discussion +// GitHub API docs: https://docs.github.com/rest/teams/discussions#delete-a-discussion +// +//meta:operation DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} func (s *TeamsService) DeleteDiscussionBySlug(ctx context.Context, org, slug string, discussionNumber int) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v", org, slug, discussionNumber) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/teams_members.go b/github/teams_members.go index 58cb79744e1..059d993a3e6 100644 --- a/github/teams_members.go +++ b/github/teams_members.go @@ -23,7 +23,9 @@ type TeamListTeamMembersOptions struct { // ListTeamMembersByID lists all of the users who are members of a team, given a specified // organization ID, by team ID. // -// GitHub API docs: https://docs.github.com/en/rest/teams/members#list-team-members +// GitHub API docs: https://docs.github.com/rest/teams/members#list-team-members +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/members func (s *TeamsService) ListTeamMembersByID(ctx context.Context, orgID, teamID int64, opts *TeamListTeamMembersOptions) ([]*User, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/members", orgID, teamID) u, err := addOptions(u, opts) @@ -48,7 +50,9 @@ func (s *TeamsService) ListTeamMembersByID(ctx context.Context, orgID, teamID in // ListTeamMembersBySlug lists all of the users who are members of a team, given a specified // organization name, by team slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/members#list-team-members +// GitHub API docs: https://docs.github.com/rest/teams/members#list-team-members +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/members func (s *TeamsService) ListTeamMembersBySlug(ctx context.Context, org, slug string, opts *TeamListTeamMembersOptions) ([]*User, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/members", org, slug) u, err := addOptions(u, opts) @@ -73,7 +77,9 @@ func (s *TeamsService) ListTeamMembersBySlug(ctx context.Context, org, slug stri // GetTeamMembershipByID returns the membership status for a user in a team, given a specified // organization ID, by team ID. // -// GitHub API docs: https://docs.github.com/en/rest/teams/members#list-team-members +// GitHub API docs: https://docs.github.com/rest/teams/members#list-team-members +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/members func (s *TeamsService) GetTeamMembershipByID(ctx context.Context, orgID, teamID int64, user string) (*Membership, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/memberships/%v", orgID, teamID, user) req, err := s.client.NewRequest("GET", u, nil) @@ -93,7 +99,9 @@ func (s *TeamsService) GetTeamMembershipByID(ctx context.Context, orgID, teamID // GetTeamMembershipBySlug returns the membership status for a user in a team, given a specified // organization name, by team slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/members#get-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/teams/members#get-team-membership-for-a-user +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/memberships/{username} func (s *TeamsService) GetTeamMembershipBySlug(ctx context.Context, org, slug, user string) (*Membership, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/memberships/%v", org, slug, user) req, err := s.client.NewRequest("GET", u, nil) @@ -127,7 +135,9 @@ type TeamAddTeamMembershipOptions struct { // AddTeamMembershipByID adds or invites a user to a team, given a specified // organization ID, by team ID. // -// GitHub API docs: https://docs.github.com/en/rest/teams/members#add-or-update-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user +// +//meta:operation PUT /orgs/{org}/teams/{team_slug}/memberships/{username} func (s *TeamsService) AddTeamMembershipByID(ctx context.Context, orgID, teamID int64, user string, opts *TeamAddTeamMembershipOptions) (*Membership, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/memberships/%v", orgID, teamID, user) req, err := s.client.NewRequest("PUT", u, opts) @@ -147,7 +157,9 @@ func (s *TeamsService) AddTeamMembershipByID(ctx context.Context, orgID, teamID // AddTeamMembershipBySlug adds or invites a user to a team, given a specified // organization name, by team slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/members#add-or-update-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user +// +//meta:operation PUT /orgs/{org}/teams/{team_slug}/memberships/{username} func (s *TeamsService) AddTeamMembershipBySlug(ctx context.Context, org, slug, user string, opts *TeamAddTeamMembershipOptions) (*Membership, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/memberships/%v", org, slug, user) req, err := s.client.NewRequest("PUT", u, opts) @@ -167,7 +179,9 @@ func (s *TeamsService) AddTeamMembershipBySlug(ctx context.Context, org, slug, u // RemoveTeamMembershipByID removes a user from a team, given a specified // organization ID, by team ID. // -// GitHub API docs: https://docs.github.com/en/rest/teams/members#remove-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user +// +//meta:operation DELETE /orgs/{org}/teams/{team_slug}/memberships/{username} func (s *TeamsService) RemoveTeamMembershipByID(ctx context.Context, orgID, teamID int64, user string) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/memberships/%v", orgID, teamID, user) req, err := s.client.NewRequest("DELETE", u, nil) @@ -181,7 +195,9 @@ func (s *TeamsService) RemoveTeamMembershipByID(ctx context.Context, orgID, team // RemoveTeamMembershipBySlug removes a user from a team, given a specified // organization name, by team slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/members#remove-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user +// +//meta:operation DELETE /orgs/{org}/teams/{team_slug}/memberships/{username} func (s *TeamsService) RemoveTeamMembershipBySlug(ctx context.Context, org, slug, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/memberships/%v", org, slug, user) req, err := s.client.NewRequest("DELETE", u, nil) @@ -195,7 +211,9 @@ func (s *TeamsService) RemoveTeamMembershipBySlug(ctx context.Context, org, slug // ListPendingTeamInvitationsByID gets pending invitation list of a team, given a specified // organization ID, by team ID. // -// GitHub API docs: https://docs.github.com/en/rest/teams/members#list-pending-team-invitations +// GitHub API docs: https://docs.github.com/rest/teams/members#list-pending-team-invitations +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/invitations func (s *TeamsService) ListPendingTeamInvitationsByID(ctx context.Context, orgID, teamID int64, opts *ListOptions) ([]*Invitation, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/invitations", orgID, teamID) u, err := addOptions(u, opts) @@ -220,7 +238,9 @@ func (s *TeamsService) ListPendingTeamInvitationsByID(ctx context.Context, orgID // ListPendingTeamInvitationsBySlug get pending invitation list of a team, given a specified // organization name, by team slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/members#list-pending-team-invitations +// GitHub API docs: https://docs.github.com/rest/teams/members#list-pending-team-invitations +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/invitations func (s *TeamsService) ListPendingTeamInvitationsBySlug(ctx context.Context, org, slug string, opts *ListOptions) ([]*Invitation, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/invitations", org, slug) u, err := addOptions(u, opts) diff --git a/github/users.go b/github/users.go index 1b0670103b3..51b2b2193bc 100644 --- a/github/users.go +++ b/github/users.go @@ -13,7 +13,7 @@ import ( // UsersService handles communication with the user related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/users/ +// GitHub API docs: https://docs.github.com/rest/users/ type UsersService service // User represents a GitHub user. @@ -63,7 +63,7 @@ type User struct { SubscriptionsURL *string `json:"subscriptions_url,omitempty"` // TextMatches is only populated from search results that request text matches - // See: search.go and https://docs.github.com/en/rest/search/#text-match-metadata + // See: search.go and https://docs.github.com/rest/search/#text-match-metadata TextMatches []*TextMatch `json:"text_matches,omitempty"` // Permissions and RoleName identify the permissions and role that a user has on a given @@ -79,8 +79,11 @@ func (u User) String() string { // Get fetches a user. Passing the empty string will fetch the authenticated // user. // -// GitHub API docs: https://docs.github.com/en/rest/users/users#get-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/users/users#get-a-user +// GitHub API docs: https://docs.github.com/rest/users/users#get-a-user +// GitHub API docs: https://docs.github.com/rest/users/users#get-the-authenticated-user +// +//meta:operation GET /user +//meta:operation GET /users/{username} func (s *UsersService) Get(ctx context.Context, user string) (*User, *Response, error) { var u string if user != "" { @@ -104,7 +107,9 @@ func (s *UsersService) Get(ctx context.Context, user string) (*User, *Response, // GetByID fetches a user. // -// Note: GetByID uses the undocumented GitHub API endpoint /user/:id. +// Note: GetByID uses the undocumented GitHub API endpoint "GET /user/{user_id}". +// +//meta:operation GET /user/{user_id} func (s *UsersService) GetByID(ctx context.Context, id int64) (*User, *Response, error) { u := fmt.Sprintf("user/%d", id) req, err := s.client.NewRequest("GET", u, nil) @@ -123,7 +128,9 @@ func (s *UsersService) GetByID(ctx context.Context, id int64) (*User, *Response, // Edit the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/users#update-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/users#update-the-authenticated-user +// +//meta:operation PATCH /user func (s *UsersService) Edit(ctx context.Context, user *User) (*User, *Response, error) { u := "user" req, err := s.client.NewRequest("PATCH", u, user) @@ -165,7 +172,9 @@ type UserContext struct { // GetHovercard fetches contextual information about user. It requires authentication // via Basic Auth or via OAuth with the repo scope. // -// GitHub API docs: https://docs.github.com/en/rest/users/users#get-contextual-information-for-a-user +// GitHub API docs: https://docs.github.com/rest/users/users#get-contextual-information-for-a-user +// +//meta:operation GET /users/{username}/hovercard func (s *UsersService) GetHovercard(ctx context.Context, user string, opts *HovercardOptions) (*Hovercard, *Response, error) { u := fmt.Sprintf("users/%v/hovercard", user) u, err := addOptions(u, opts) @@ -203,7 +212,9 @@ type UserListOptions struct { // // To paginate through all users, populate 'Since' with the ID of the last user. // -// GitHub API docs: https://docs.github.com/en/rest/users/users#list-users +// GitHub API docs: https://docs.github.com/rest/users/users#list-users +// +//meta:operation GET /users func (s *UsersService) ListAll(ctx context.Context, opts *UserListOptions) ([]*User, *Response, error) { u, err := addOptions("users", opts) if err != nil { @@ -227,7 +238,9 @@ func (s *UsersService) ListAll(ctx context.Context, opts *UserListOptions) ([]*U // ListInvitations lists all currently-open repository invitations for the // authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/collaborators/invitations#list-repository-invitations-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#list-repository-invitations-for-the-authenticated-user +// +//meta:operation GET /user/repository_invitations func (s *UsersService) ListInvitations(ctx context.Context, opts *ListOptions) ([]*RepositoryInvitation, *Response, error) { u, err := addOptions("user/repository_invitations", opts) if err != nil { @@ -251,7 +264,9 @@ func (s *UsersService) ListInvitations(ctx context.Context, opts *ListOptions) ( // AcceptInvitation accepts the currently-open repository invitation for the // authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/collaborators/invitations#accept-a-repository-invitation +// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#accept-a-repository-invitation +// +//meta:operation PATCH /user/repository_invitations/{invitation_id} func (s *UsersService) AcceptInvitation(ctx context.Context, invitationID int64) (*Response, error) { u := fmt.Sprintf("user/repository_invitations/%v", invitationID) req, err := s.client.NewRequest("PATCH", u, nil) @@ -265,7 +280,9 @@ func (s *UsersService) AcceptInvitation(ctx context.Context, invitationID int64) // DeclineInvitation declines the currently-open repository invitation for the // authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/collaborators/invitations#decline-a-repository-invitation +// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#decline-a-repository-invitation +// +//meta:operation DELETE /user/repository_invitations/{invitation_id} func (s *UsersService) DeclineInvitation(ctx context.Context, invitationID int64) (*Response, error) { u := fmt.Sprintf("user/repository_invitations/%v", invitationID) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/users_administration.go b/github/users_administration.go index aef947ec451..02cb894bc3b 100644 --- a/github/users_administration.go +++ b/github/users_administration.go @@ -12,7 +12,9 @@ import ( // PromoteSiteAdmin promotes a user to a site administrator of a GitHub Enterprise instance. // -// GitHub API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#promote-an-ordinary-user-to-a-site-administrator +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator +// +//meta:operation PUT /users/{username}/site_admin func (s *UsersService) PromoteSiteAdmin(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("users/%v/site_admin", user) @@ -26,7 +28,9 @@ func (s *UsersService) PromoteSiteAdmin(ctx context.Context, user string) (*Resp // DemoteSiteAdmin demotes a user from site administrator of a GitHub Enterprise instance. // -// GitHub API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#demote-a-site-administrator-to-an-ordinary-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#demote-a-site-administrator +// +//meta:operation DELETE /users/{username}/site_admin func (s *UsersService) DemoteSiteAdmin(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("users/%v/site_admin", user) @@ -45,7 +49,9 @@ type UserSuspendOptions struct { // Suspend a user on a GitHub Enterprise instance. // -// GitHub API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#suspend-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#suspend-a-user +// +//meta:operation PUT /users/{username}/suspended func (s *UsersService) Suspend(ctx context.Context, user string, opts *UserSuspendOptions) (*Response, error) { u := fmt.Sprintf("users/%v/suspended", user) @@ -59,7 +65,9 @@ func (s *UsersService) Suspend(ctx context.Context, user string, opts *UserSuspe // Unsuspend a user on a GitHub Enterprise instance. // -// GitHub API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#unsuspend-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#unsuspend-a-user +// +//meta:operation DELETE /users/{username}/suspended func (s *UsersService) Unsuspend(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("users/%v/suspended", user) diff --git a/github/users_blocking.go b/github/users_blocking.go index 3d38d947898..3f2af38f6c9 100644 --- a/github/users_blocking.go +++ b/github/users_blocking.go @@ -12,7 +12,9 @@ import ( // ListBlockedUsers lists all the blocked users by the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/blocking#list-users-blocked-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/blocking#list-users-blocked-by-the-authenticated-user +// +//meta:operation GET /user/blocks func (s *UsersService) ListBlockedUsers(ctx context.Context, opts *ListOptions) ([]*User, *Response, error) { u := "user/blocks" u, err := addOptions(u, opts) @@ -39,7 +41,9 @@ func (s *UsersService) ListBlockedUsers(ctx context.Context, opts *ListOptions) // IsBlocked reports whether specified user is blocked by the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/blocking#check-if-a-user-is-blocked-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/blocking#check-if-a-user-is-blocked-by-the-authenticated-user +// +//meta:operation GET /user/blocks/{username} func (s *UsersService) IsBlocked(ctx context.Context, user string) (bool, *Response, error) { u := fmt.Sprintf("user/blocks/%v", user) @@ -58,7 +62,9 @@ func (s *UsersService) IsBlocked(ctx context.Context, user string) (bool, *Respo // BlockUser blocks specified user for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/blocking#block-a-user +// GitHub API docs: https://docs.github.com/rest/users/blocking#block-a-user +// +//meta:operation PUT /user/blocks/{username} func (s *UsersService) BlockUser(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("user/blocks/%v", user) @@ -75,7 +81,9 @@ func (s *UsersService) BlockUser(ctx context.Context, user string) (*Response, e // UnblockUser unblocks specified user for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/blocking#unblock-a-user +// GitHub API docs: https://docs.github.com/rest/users/blocking#unblock-a-user +// +//meta:operation DELETE /user/blocks/{username} func (s *UsersService) UnblockUser(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("user/blocks/%v", user) diff --git a/github/users_emails.go b/github/users_emails.go index 67bd210e8d5..8386de250b2 100644 --- a/github/users_emails.go +++ b/github/users_emails.go @@ -17,7 +17,9 @@ type UserEmail struct { // ListEmails lists all email addresses for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/emails#list-email-addresses-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/emails#list-email-addresses-for-the-authenticated-user +// +//meta:operation GET /user/emails func (s *UsersService) ListEmails(ctx context.Context, opts *ListOptions) ([]*UserEmail, *Response, error) { u := "user/emails" u, err := addOptions(u, opts) @@ -41,7 +43,9 @@ func (s *UsersService) ListEmails(ctx context.Context, opts *ListOptions) ([]*Us // AddEmails adds email addresses of the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/emails#add-an-email-address-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/emails#add-an-email-address-for-the-authenticated-user +// +//meta:operation POST /user/emails func (s *UsersService) AddEmails(ctx context.Context, emails []string) ([]*UserEmail, *Response, error) { u := "user/emails" req, err := s.client.NewRequest("POST", u, emails) @@ -60,7 +64,9 @@ func (s *UsersService) AddEmails(ctx context.Context, emails []string) ([]*UserE // DeleteEmails deletes email addresses from authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/emails#delete-an-email-address-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/emails#delete-an-email-address-for-the-authenticated-user +// +//meta:operation DELETE /user/emails func (s *UsersService) DeleteEmails(ctx context.Context, emails []string) (*Response, error) { u := "user/emails" req, err := s.client.NewRequest("DELETE", u, emails) @@ -74,7 +80,9 @@ func (s *UsersService) DeleteEmails(ctx context.Context, emails []string) (*Resp // SetEmailVisibility sets the visibility for the primary email address of the authenticated user. // `visibility` can be "private" or "public". // -// GitHub API docs: https://docs.github.com/en/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user +// +//meta:operation PATCH /user/email/visibility func (s *UsersService) SetEmailVisibility(ctx context.Context, visibility string) ([]*UserEmail, *Response, error) { u := "user/email/visibility" diff --git a/github/users_followers.go b/github/users_followers.go index 1266e0e9ee3..ec6f531eaa4 100644 --- a/github/users_followers.go +++ b/github/users_followers.go @@ -13,8 +13,11 @@ import ( // ListFollowers lists the followers for a user. Passing the empty string will // fetch followers for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/followers#list-followers-of-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/users/followers#list-followers-of-a-user +// GitHub API docs: https://docs.github.com/rest/users/followers#list-followers-of-a-user +// GitHub API docs: https://docs.github.com/rest/users/followers#list-followers-of-the-authenticated-user +// +//meta:operation GET /user/followers +//meta:operation GET /users/{username}/followers func (s *UsersService) ListFollowers(ctx context.Context, user string, opts *ListOptions) ([]*User, *Response, error) { var u string if user != "" { @@ -44,8 +47,11 @@ func (s *UsersService) ListFollowers(ctx context.Context, user string, opts *Lis // ListFollowing lists the people that a user is following. Passing the empty // string will list people the authenticated user is following. // -// GitHub API docs: https://docs.github.com/en/rest/users/followers#list-the-people-the-authenticated-user-follows -// GitHub API docs: https://docs.github.com/en/rest/users/followers#list-the-people-a-user-follows +// GitHub API docs: https://docs.github.com/rest/users/followers#list-the-people-a-user-follows +// GitHub API docs: https://docs.github.com/rest/users/followers#list-the-people-the-authenticated-user-follows +// +//meta:operation GET /user/following +//meta:operation GET /users/{username}/following func (s *UsersService) ListFollowing(ctx context.Context, user string, opts *ListOptions) ([]*User, *Response, error) { var u string if user != "" { @@ -75,8 +81,11 @@ func (s *UsersService) ListFollowing(ctx context.Context, user string, opts *Lis // IsFollowing checks if "user" is following "target". Passing the empty // string for "user" will check if the authenticated user is following "target". // -// GitHub API docs: https://docs.github.com/en/rest/users/followers#check-if-a-person-is-followed-by-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/users/followers#check-if-a-user-follows-another-user +// GitHub API docs: https://docs.github.com/rest/users/followers#check-if-a-person-is-followed-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/followers#check-if-a-user-follows-another-user +// +//meta:operation GET /user/following/{username} +//meta:operation GET /users/{username}/following/{target_user} func (s *UsersService) IsFollowing(ctx context.Context, user, target string) (bool, *Response, error) { var u string if user != "" { @@ -97,7 +106,9 @@ func (s *UsersService) IsFollowing(ctx context.Context, user, target string) (bo // Follow will cause the authenticated user to follow the specified user. // -// GitHub API docs: https://docs.github.com/en/rest/users/followers#follow-a-user +// GitHub API docs: https://docs.github.com/rest/users/followers#follow-a-user +// +//meta:operation PUT /user/following/{username} func (s *UsersService) Follow(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("user/following/%v", user) req, err := s.client.NewRequest("PUT", u, nil) @@ -110,7 +121,9 @@ func (s *UsersService) Follow(ctx context.Context, user string) (*Response, erro // Unfollow will cause the authenticated user to unfollow the specified user. // -// GitHub API docs: https://docs.github.com/en/rest/users/followers#unfollow-a-user +// GitHub API docs: https://docs.github.com/rest/users/followers#unfollow-a-user +// +//meta:operation DELETE /user/following/{username} func (s *UsersService) Unfollow(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("user/following/%v", user) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/users_gpg_keys.go b/github/users_gpg_keys.go index 54189b83077..de7caaf1bd0 100644 --- a/github/users_gpg_keys.go +++ b/github/users_gpg_keys.go @@ -44,8 +44,11 @@ type GPGEmail struct { // string will fetch keys for the authenticated user. It requires authentication // via Basic Auth or via OAuth with at least read:gpg_key scope. // -// GitHub API docs: https://docs.github.com/en/rest/users/gpg-keys#list-gpg-keys-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/users/gpg-keys#list-gpg-keys-for-a-user +// GitHub API docs: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-a-user +// GitHub API docs: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-the-authenticated-user +// +//meta:operation GET /user/gpg_keys +//meta:operation GET /users/{username}/gpg_keys func (s *UsersService) ListGPGKeys(ctx context.Context, user string, opts *ListOptions) ([]*GPGKey, *Response, error) { var u string if user != "" { @@ -75,7 +78,9 @@ func (s *UsersService) ListGPGKeys(ctx context.Context, user string, opts *ListO // GetGPGKey gets extended details for a single GPG key. It requires authentication // via Basic Auth or via OAuth with at least read:gpg_key scope. // -// GitHub API docs: https://docs.github.com/en/rest/users/gpg-keys#get-a-gpg-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/gpg-keys#get-a-gpg-key-for-the-authenticated-user +// +//meta:operation GET /user/gpg_keys/{gpg_key_id} func (s *UsersService) GetGPGKey(ctx context.Context, id int64) (*GPGKey, *Response, error) { u := fmt.Sprintf("user/gpg_keys/%v", id) req, err := s.client.NewRequest("GET", u, nil) @@ -95,7 +100,9 @@ func (s *UsersService) GetGPGKey(ctx context.Context, id int64) (*GPGKey, *Respo // CreateGPGKey creates a GPG key. It requires authenticatation via Basic Auth // or OAuth with at least write:gpg_key scope. // -// GitHub API docs: https://docs.github.com/en/rest/users/gpg-keys#create-a-gpg-key +// GitHub API docs: https://docs.github.com/rest/users/gpg-keys#create-a-gpg-key-for-the-authenticated-user +// +//meta:operation POST /user/gpg_keys func (s *UsersService) CreateGPGKey(ctx context.Context, armoredPublicKey string) (*GPGKey, *Response, error) { gpgKey := &struct { ArmoredPublicKey string `json:"armored_public_key"` @@ -117,7 +124,9 @@ func (s *UsersService) CreateGPGKey(ctx context.Context, armoredPublicKey string // DeleteGPGKey deletes a GPG key. It requires authentication via Basic Auth or // via OAuth with at least admin:gpg_key scope. // -// GitHub API docs: https://docs.github.com/en/rest/users/gpg-keys#delete-a-gpg-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/gpg-keys#delete-a-gpg-key-for-the-authenticated-user +// +//meta:operation DELETE /user/gpg_keys/{gpg_key_id} func (s *UsersService) DeleteGPGKey(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("user/gpg_keys/%v", id) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/users_keys.go b/github/users_keys.go index b49b8e4b4ef..4d42986ed2b 100644 --- a/github/users_keys.go +++ b/github/users_keys.go @@ -30,8 +30,11 @@ func (k Key) String() string { // ListKeys lists the verified public keys for a user. Passing the empty // string will fetch keys for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/keys#list-public-ssh-keys-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/users/keys#list-public-keys-for-a-user +// GitHub API docs: https://docs.github.com/rest/users/keys#list-public-keys-for-a-user +// GitHub API docs: https://docs.github.com/rest/users/keys#list-public-ssh-keys-for-the-authenticated-user +// +//meta:operation GET /user/keys +//meta:operation GET /users/{username}/keys func (s *UsersService) ListKeys(ctx context.Context, user string, opts *ListOptions) ([]*Key, *Response, error) { var u string if user != "" { @@ -60,7 +63,9 @@ func (s *UsersService) ListKeys(ctx context.Context, user string, opts *ListOpti // GetKey fetches a single public key. // -// GitHub API docs: https://docs.github.com/en/rest/users/keys#get-a-public-ssh-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/keys#get-a-public-ssh-key-for-the-authenticated-user +// +//meta:operation GET /user/keys/{key_id} func (s *UsersService) GetKey(ctx context.Context, id int64) (*Key, *Response, error) { u := fmt.Sprintf("user/keys/%v", id) @@ -80,7 +85,9 @@ func (s *UsersService) GetKey(ctx context.Context, id int64) (*Key, *Response, e // CreateKey adds a public key for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/keys#create-a-public-ssh-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/keys#create-a-public-ssh-key-for-the-authenticated-user +// +//meta:operation POST /user/keys func (s *UsersService) CreateKey(ctx context.Context, key *Key) (*Key, *Response, error) { u := "user/keys" @@ -100,7 +107,9 @@ func (s *UsersService) CreateKey(ctx context.Context, key *Key) (*Key, *Response // DeleteKey deletes a public key. // -// GitHub API docs: https://docs.github.com/en/rest/users/keys#delete-a-public-ssh-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/keys#delete-a-public-ssh-key-for-the-authenticated-user +// +//meta:operation DELETE /user/keys/{key_id} func (s *UsersService) DeleteKey(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("user/keys/%v", id) diff --git a/github/users_packages.go b/github/users_packages.go index c3ffc6ab074..3ccf68a1696 100644 --- a/github/users_packages.go +++ b/github/users_packages.go @@ -13,8 +13,11 @@ import ( // ListPackages lists the packages for a user. Passing the empty string for "user" will // list packages for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/packages#list-packages-for-the-authenticated-users-namespace -// GitHub API docs: https://docs.github.com/en/rest/packages#list-packages-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#list-packages-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#list-packages-for-the-authenticated-users-namespace +// +//meta:operation GET /user/packages +//meta:operation GET /users/{username}/packages func (s *UsersService) ListPackages(ctx context.Context, user string, opts *PackageListOptions) ([]*Package, *Response, error) { var u string if user != "" { @@ -44,8 +47,11 @@ func (s *UsersService) ListPackages(ctx context.Context, user string, opts *Pack // GetPackage gets a package by name for a user. Passing the empty string for "user" will // get the package for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/packages#get-a-package-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/packages#get-a-package-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-for-the-authenticated-user +// +//meta:operation GET /user/packages/{package_type}/{package_name} +//meta:operation GET /users/{username}/packages/{package_type}/{package_name} func (s *UsersService) GetPackage(ctx context.Context, user, packageType, packageName string) (*Package, *Response, error) { var u string if user != "" { @@ -71,8 +77,11 @@ func (s *UsersService) GetPackage(ctx context.Context, user, packageType, packag // DeletePackage deletes a package from a user. Passing the empty string for "user" will // delete the package for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/packages#delete-a-package-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/packages#delete-a-package-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-a-package-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-a-package-for-the-authenticated-user +// +//meta:operation DELETE /user/packages/{package_type}/{package_name} +//meta:operation DELETE /users/{username}/packages/{package_type}/{package_name} func (s *UsersService) DeletePackage(ctx context.Context, user, packageType, packageName string) (*Response, error) { var u string if user != "" { @@ -92,8 +101,11 @@ func (s *UsersService) DeletePackage(ctx context.Context, user, packageType, pac // RestorePackage restores a package to a user. Passing the empty string for "user" will // restore the package for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/packages#restore-a-package-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/packages#restore-a-package-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-a-package-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-a-package-for-the-authenticated-user +// +//meta:operation POST /user/packages/{package_type}/{package_name}/restore +//meta:operation POST /users/{username}/packages/{package_type}/{package_name}/restore func (s *UsersService) RestorePackage(ctx context.Context, user, packageType, packageName string) (*Response, error) { var u string if user != "" { @@ -113,8 +125,11 @@ func (s *UsersService) RestorePackage(ctx context.Context, user, packageType, pa // PackageGetAllVersions gets all versions of a package for a user. Passing the empty string for "user" will // get versions for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/packages#get-all-package-versions-for-a-package-owned-by-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/packages#get-all-package-versions-for-a-package-owned-by-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-the-authenticated-user +// +//meta:operation GET /user/packages/{package_type}/{package_name}/versions +//meta:operation GET /users/{username}/packages/{package_type}/{package_name}/versions func (s *UsersService) PackageGetAllVersions(ctx context.Context, user, packageType, packageName string, opts *PackageListOptions) ([]*PackageVersion, *Response, error) { var u string if user != "" { @@ -144,8 +159,11 @@ func (s *UsersService) PackageGetAllVersions(ctx context.Context, user, packageT // PackageGetVersion gets a specific version of a package for a user. Passing the empty string for "user" will // get the version for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/packages#get-a-package-version-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/packages#get-a-package-version-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-version-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-version-for-the-authenticated-user +// +//meta:operation GET /user/packages/{package_type}/{package_name}/versions/{package_version_id} +//meta:operation GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id} func (s *UsersService) PackageGetVersion(ctx context.Context, user, packageType, packageName string, packageVersionID int64) (*PackageVersion, *Response, error) { var u string if user != "" { @@ -171,8 +189,11 @@ func (s *UsersService) PackageGetVersion(ctx context.Context, user, packageType, // PackageDeleteVersion deletes a package version for a user. Passing the empty string for "user" will // delete the version for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/packages#delete-a-package-version-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/packages#delete-package-version-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-a-package-version-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-package-version-for-a-user +// +//meta:operation DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id} +//meta:operation DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id} func (s *UsersService) PackageDeleteVersion(ctx context.Context, user, packageType, packageName string, packageVersionID int64) (*Response, error) { var u string if user != "" { @@ -192,8 +213,11 @@ func (s *UsersService) PackageDeleteVersion(ctx context.Context, user, packageTy // PackageRestoreVersion restores a package version to a user. Passing the empty string for "user" will // restore the version for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/packages#restore-a-package-version-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/packages#restore-package-version-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-a-package-version-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-package-version-for-a-user +// +//meta:operation POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore +//meta:operation POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore func (s *UsersService) PackageRestoreVersion(ctx context.Context, user, packageType, packageName string, packageVersionID int64) (*Response, error) { var u string if user != "" { diff --git a/github/users_projects.go b/github/users_projects.go index 0cbd61f923c..0ab57e5c23c 100644 --- a/github/users_projects.go +++ b/github/users_projects.go @@ -12,7 +12,9 @@ import ( // ListProjects lists the projects for the specified user. // -// GitHub API docs: https://docs.github.com/en/rest/projects/projects#list-user-projects +// GitHub API docs: https://docs.github.com/rest/projects/projects#list-user-projects +// +//meta:operation GET /users/{username}/projects func (s *UsersService) ListProjects(ctx context.Context, user string, opts *ProjectListOptions) ([]*Project, *Response, error) { u := fmt.Sprintf("users/%v/projects", user) u, err := addOptions(u, opts) @@ -47,7 +49,9 @@ type CreateUserProjectOptions struct { // CreateProject creates a GitHub Project for the current user. // -// GitHub API docs: https://docs.github.com/en/rest/projects/projects#create-a-user-project +// GitHub API docs: https://docs.github.com/rest/projects/projects#create-a-user-project +// +//meta:operation POST /user/projects func (s *UsersService) CreateProject(ctx context.Context, opts *CreateUserProjectOptions) (*Project, *Response, error) { u := "user/projects" req, err := s.client.NewRequest("POST", u, opts) diff --git a/github/users_ssh_signing_keys.go b/github/users_ssh_signing_keys.go index 23e4c36aea3..fcc930be628 100644 --- a/github/users_ssh_signing_keys.go +++ b/github/users_ssh_signing_keys.go @@ -25,8 +25,11 @@ func (k SSHSigningKey) String() string { // ListSSHSigningKeys lists the SSH signing keys for a user. Passing an empty // username string will fetch SSH signing keys for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-a-user +// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-a-user +// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-the-authenticated-user +// +//meta:operation GET /user/ssh_signing_keys +//meta:operation GET /users/{username}/ssh_signing_keys func (s *UsersService) ListSSHSigningKeys(ctx context.Context, user string, opts *ListOptions) ([]*SSHSigningKey, *Response, error) { var u string if user != "" { @@ -55,7 +58,9 @@ func (s *UsersService) ListSSHSigningKeys(ctx context.Context, user string, opts // GetSSHSigningKey fetches a single SSH signing key for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/ssh-signing-keys#get-an-ssh-signing-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys#get-an-ssh-signing-key-for-the-authenticated-user +// +//meta:operation GET /user/ssh_signing_keys/{ssh_signing_key_id} func (s *UsersService) GetSSHSigningKey(ctx context.Context, id int64) (*SSHSigningKey, *Response, error) { u := fmt.Sprintf("user/ssh_signing_keys/%v", id) @@ -75,7 +80,9 @@ func (s *UsersService) GetSSHSigningKey(ctx context.Context, id int64) (*SSHSign // CreateSSHSigningKey adds a SSH signing key for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/ssh-signing-keys#create-a-ssh-signing-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys#create-a-ssh-signing-key-for-the-authenticated-user +// +//meta:operation POST /user/ssh_signing_keys func (s *UsersService) CreateSSHSigningKey(ctx context.Context, key *Key) (*SSHSigningKey, *Response, error) { u := "user/ssh_signing_keys" @@ -95,7 +102,9 @@ func (s *UsersService) CreateSSHSigningKey(ctx context.Context, key *Key) (*SSHS // DeleteSSHSigningKey deletes a SSH signing key for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/ssh-signing-keys#delete-an-ssh-signing-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys#delete-an-ssh-signing-key-for-the-authenticated-user +// +//meta:operation DELETE /user/ssh_signing_keys/{ssh_signing_key_id} func (s *UsersService) DeleteSSHSigningKey(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("user/ssh_signing_keys/%v", id) diff --git a/openapi_operations.yaml b/openapi_operations.yaml new file mode 100644 index 00000000000..f2b1af28843 --- /dev/null +++ b/openapi_operations.yaml @@ -0,0 +1,6291 @@ +operations: + - name: POST /hub + documentation_url: https://docs.github.com/webhooks/about-webhooks-for-repositories#pubsubhubbub + - name: GET /organizations/{organization_id} + - name: GET /orgs/{org}/actions/required_workflows + documentation_url: https://docs.github.com/actions/using-workflows/required-workflows + - name: POST /orgs/{org}/actions/required_workflows + documentation_url: https://docs.github.com/actions/using-workflows/required-workflows + - name: DELETE /orgs/{org}/actions/required_workflows/{workflow_id} + documentation_url: https://docs.github.com/actions/using-workflows/required-workflows + - name: GET /orgs/{org}/actions/required_workflows/{workflow_id} + documentation_url: https://docs.github.com/actions/using-workflows/required-workflows + - name: PATCH /orgs/{org}/actions/required_workflows/{workflow_id} + documentation_url: https://docs.github.com/actions/using-workflows/required-workflows + - name: GET /orgs/{org}/actions/required_workflows/{workflow_id}/repositories + documentation_url: https://docs.github.com/actions/using-workflows/required-workflows + - name: PUT /orgs/{org}/actions/required_workflows/{workflow_id}/repositories + documentation_url: https://docs.github.com/actions/using-workflows/required-workflows + - name: DELETE /orgs/{org}/actions/required_workflows/{workflow_id}/repositories/{repository_id} + documentation_url: https://docs.github.com/actions/using-workflows/required-workflows + - name: PUT /orgs/{org}/actions/required_workflows/{workflow_id}/repositories/{repository_id} + documentation_url: https://docs.github.com/actions/using-workflows/required-workflows + - name: GET /repos/{owner}/{repo}/actions/required_workflows + documentation_url: https://docs.github.com/actions/using-workflows/required-workflows + - name: GET /repos/{owner}/{repo}/import/issues + documentation_url: https://gist.github.com/jonmagic/5282384165e0f86ef105#check-status-of-multiple-issues + - name: POST /repos/{owner}/{repo}/import/issues + documentation_url: https://gist.github.com/jonmagic/5282384165e0f86ef105#start-an-issue-import + - name: GET /repos/{owner}/{repo}/import/issues/{issue_number} + documentation_url: https://gist.github.com/jonmagic/5282384165e0f86ef105#import-status-request + - name: GET /repositories/{repository_id} + - name: GET /repositories/{repository_id}/installation + - name: GET /user/{user_id} +operation_overrides: + - name: GET /meta + documentation_url: https://docs.github.com/rest/meta/meta#get-github-meta-information + - name: DELETE /repos/{owner}/{repo}/pages + documentation_url: https://docs.github.com/rest/pages/pages#delete-a-github-pages-site + - name: GET /repos/{owner}/{repo}/pages + documentation_url: https://docs.github.com/rest/pages/pages#get-a-github-pages-site + - name: POST /repos/{owner}/{repo}/pages + documentation_url: https://docs.github.com/rest/pages/pages#create-a-github-pages-site + - name: PUT /repos/{owner}/{repo}/pages + documentation_url: https://docs.github.com/rest/pages/pages#update-information-about-a-github-pages-site + - name: GET /repos/{owner}/{repo}/pages/builds + documentation_url: https://docs.github.com/rest/pages/pages#list-github-pages-builds + - name: POST /repos/{owner}/{repo}/pages/builds + documentation_url: https://docs.github.com/rest/pages/pages#request-a-github-pages-build + - name: GET /repos/{owner}/{repo}/pages/builds/{build_id} + documentation_url: https://docs.github.com/rest/pages/pages#get-github-pages-build +openapi_commit: c86f07e1ca0d543d0b8fc7591991b02767e02deb +openapi_operations: + - name: GET / + documentation_url: https://docs.github.com/rest/meta/meta#github-api-root + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /admin/hooks + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/global-webhooks#list-global-webhooks + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /admin/hooks + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/global-webhooks#create-a-global-webhook + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /admin/hooks/{hook_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/global-webhooks#delete-a-global-webhook + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /admin/hooks/{hook_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/global-webhooks#get-a-global-webhook + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /admin/hooks/{hook_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/global-webhooks#update-a-global-webhook + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /admin/hooks/{hook_id}/pings + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/global-webhooks#ping-a-global-webhook + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /admin/keys + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#list-public-keys + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /admin/keys/{key_ids} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#delete-a-public-key + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /admin/ldap/teams/{team_id}/mapping + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /admin/ldap/teams/{team_id}/sync + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/ldap#sync-ldap-mapping-for-a-team + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /admin/ldap/users/{username}/mapping + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /admin/ldap/users/{username}/sync + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/ldap#sync-ldap-mapping-for-a-user + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /admin/organizations + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/orgs#create-an-organization + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /admin/organizations/{org} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/orgs#update-an-organization-name + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /admin/pre-receive-environments + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-environments#list-pre-receive-environments + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /admin/pre-receive-environments + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-environments#create-a-pre-receive-environment + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /admin/pre-receive-environments/{pre_receive_environment_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-environments#delete-a-pre-receive-environment + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /admin/pre-receive-environments/{pre_receive_environment_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-environments#get-a-pre-receive-environment + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /admin/pre-receive-environments/{pre_receive_environment_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-environments#update-a-pre-receive-environment + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /admin/pre-receive-environments/{pre_receive_environment_id}/downloads + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-environments#start-a-pre-receive-environment-download + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /admin/pre-receive-environments/{pre_receive_environment_id}/downloads/latest + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-environments#get-the-download-status-for-a-pre-receive-environment + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /admin/pre-receive-hooks + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-hooks#list-pre-receive-hooks + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /admin/pre-receive-hooks + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-hooks#create-a-pre-receive-hook + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /admin/pre-receive-hooks/{pre_receive_hook_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-hooks#delete-a-pre-receive-hook + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /admin/pre-receive-hooks/{pre_receive_hook_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-hooks#get-a-pre-receive-hook + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /admin/pre-receive-hooks/{pre_receive_hook_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-hooks#update-a-pre-receive-hook + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /admin/tokens + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#list-personal-access-tokens + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /admin/tokens/{token_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#delete-a-personal-access-token + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /admin/users + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#create-a-user + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /admin/users/{username} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#delete-a-user + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /admin/users/{username} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#update-the-username-for-a-user + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /admin/users/{username}/authorizations + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#delete-an-impersonation-oauth-token + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /admin/users/{username}/authorizations + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#create-an-impersonation-oauth-token + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /advisories + documentation_url: https://docs.github.com/rest/security-advisories/global-advisories#list-global-security-advisories + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /advisories/{ghsa_id} + documentation_url: https://docs.github.com/rest/security-advisories/global-advisories#get-a-global-security-advisory + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /app + documentation_url: https://docs.github.com/rest/apps/apps#get-the-authenticated-app + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /app-manifests/{code}/conversions + documentation_url: https://docs.github.com/rest/apps/apps#create-a-github-app-from-a-manifest + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /app/hook/config + documentation_url: https://docs.github.com/rest/apps/webhooks#get-a-webhook-configuration-for-an-app + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /app/hook/config + documentation_url: https://docs.github.com/rest/apps/webhooks#update-a-webhook-configuration-for-an-app + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /app/hook/deliveries + documentation_url: https://docs.github.com/rest/apps/webhooks#list-deliveries-for-an-app-webhook + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /app/hook/deliveries/{delivery_id} + documentation_url: https://docs.github.com/rest/apps/webhooks#get-a-delivery-for-an-app-webhook + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /app/hook/deliveries/{delivery_id}/attempts + documentation_url: https://docs.github.com/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /app/installation-requests + documentation_url: https://docs.github.com/rest/apps/apps#list-installation-requests-for-the-authenticated-app + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /app/installations + documentation_url: https://docs.github.com/rest/apps/apps#list-installations-for-the-authenticated-app + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /app/installations/{installation_id} + documentation_url: https://docs.github.com/rest/apps/apps#delete-an-installation-for-the-authenticated-app + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /app/installations/{installation_id} + documentation_url: https://docs.github.com/rest/apps/apps#get-an-installation-for-the-authenticated-app + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /app/installations/{installation_id}/access_tokens + documentation_url: https://docs.github.com/rest/apps/apps#create-an-installation-access-token-for-an-app + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /app/installations/{installation_id}/suspended + documentation_url: https://docs.github.com/rest/apps/apps#unsuspend-an-app-installation + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /app/installations/{installation_id}/suspended + documentation_url: https://docs.github.com/rest/apps/apps#suspend-an-app-installation + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /applications/grants + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#list-your-grants + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /applications/grants/{grant_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#delete-a-grant + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /applications/grants/{grant_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#get-a-single-grant + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /applications/{client_id}/grant + documentation_url: https://docs.github.com/rest/apps/oauth-applications#delete-an-app-authorization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /applications/{client_id}/grants/{access_token} + documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#revoke-a-grant-for-an-application + openapi_files: + - descriptions/ghes-3.3/ghes-3.3.json + - name: DELETE /applications/{client_id}/token + documentation_url: https://docs.github.com/rest/apps/oauth-applications#delete-an-app-token + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /applications/{client_id}/token + documentation_url: https://docs.github.com/rest/apps/oauth-applications#reset-a-token + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /applications/{client_id}/token + documentation_url: https://docs.github.com/rest/apps/oauth-applications#check-a-token + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /applications/{client_id}/token/scoped + documentation_url: https://docs.github.com/rest/apps/apps#create-a-scoped-access-token + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /applications/{client_id}/tokens/{access_token} + documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#revoke-an-authorization-for-an-application + openapi_files: + - descriptions/ghes-3.3/ghes-3.3.json + - name: GET /applications/{client_id}/tokens/{access_token} + documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#check-an-authorization + openapi_files: + - descriptions/ghes-3.3/ghes-3.3.json + - name: POST /applications/{client_id}/tokens/{access_token} + documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#reset-an-authorization + openapi_files: + - descriptions/ghes-3.3/ghes-3.3.json + - name: GET /apps/{app_slug} + documentation_url: https://docs.github.com/rest/apps/apps#get-an-app + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /assignments/{assignment_id} + documentation_url: https://docs.github.com/rest/classroom/classroom#get-an-assignment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /assignments/{assignment_id}/accepted_assignments + documentation_url: https://docs.github.com/rest/classroom/classroom#list-accepted-assignments-for-an-assignment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /assignments/{assignment_id}/grades + documentation_url: https://docs.github.com/rest/classroom/classroom#get-assignment-grades + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /authorizations + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#list-your-authorizations + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /authorizations + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#create-a-new-authorization + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /authorizations/clients/{client_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /authorizations/clients/{client_id}/{fingerprint} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app-and-fingerprint + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /authorizations/{authorization_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#delete-an-authorization + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /authorizations/{authorization_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#get-a-single-authorization + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /authorizations/{authorization_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#update-an-existing-authorization + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /classrooms + documentation_url: https://docs.github.com/rest/classroom/classroom#list-classrooms + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /classrooms/{classroom_id} + documentation_url: https://docs.github.com/rest/classroom/classroom#get-a-classroom + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /classrooms/{classroom_id}/assignments + documentation_url: https://docs.github.com/rest/classroom/classroom#list-assignments-for-a-classroom + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /codes_of_conduct + documentation_url: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-all-codes-of-conduct + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /codes_of_conduct/{key} + documentation_url: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-a-code-of-conduct + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /emojis + documentation_url: https://docs.github.com/rest/emojis/emojis#get-emojis + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /enterprise-installation/{enterprise_or_org}/server-statistics + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/admin-stats#get-github-enterprise-server-statistics + openapi_files: + - descriptions/ghec/ghec.json + - name: DELETE /enterprise/announcement + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/announcement#remove-the-global-announcement-banner + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /enterprise/announcement + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/announcement#get-the-global-announcement-banner + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /enterprise/announcement + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/announcement#set-the-global-announcement-banner + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /enterprise/settings/license + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/license#get-license-information + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /enterprise/stats/all + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-all-statistics + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /enterprise/stats/comments + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-comment-statistics + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /enterprise/stats/gists + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-gist-statistics + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /enterprise/stats/hooks + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-hooks-statistics + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /enterprise/stats/issues + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-issue-statistics + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /enterprise/stats/milestones + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-milestone-statistics + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /enterprise/stats/orgs + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-organization-statistics + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /enterprise/stats/pages + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-pages-statistics + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /enterprise/stats/pulls + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-pull-request-statistics + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /enterprise/stats/repos + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-repository-statistics + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /enterprise/stats/security-products + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-security-products-statistics + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /enterprise/stats/users + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-users-statistics + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /enterprises/{enterprise}/actions/cache/usage + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/cache#get-github-actions-cache-usage-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /enterprises/{enterprise}/actions/cache/usage-policy + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/actions/cache#get-github-actions-cache-usage-policy-for-an-enterprise + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /enterprises/{enterprise}/actions/cache/usage-policy + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/actions/cache#set-github-actions-cache-usage-policy-for-an-enterprise + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /enterprises/{enterprise}/actions/oidc/customization/issuer + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/oidc#set-the-github-actions-oidc-custom-issuer-policy-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - name: GET /enterprises/{enterprise}/actions/permissions + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-github-actions-permissions-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /enterprises/{enterprise}/actions/permissions + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-github-actions-permissions-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /enterprises/{enterprise}/actions/permissions/organizations + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#list-selected-organizations-enabled-for-github-actions-in-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /enterprises/{enterprise}/actions/permissions/organizations + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-selected-organizations-enabled-for-github-actions-in-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#disable-a-selected-organization-for-github-actions-in-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#enable-a-selected-organization-for-github-actions-in-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /enterprises/{enterprise}/actions/permissions/selected-actions + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /enterprises/{enterprise}/actions/permissions/selected-actions + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /enterprises/{enterprise}/actions/permissions/workflow + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-default-workflow-permissions-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /enterprises/{enterprise}/actions/permissions/workflow + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-default-workflow-permissions-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /enterprises/{enterprise}/actions/runner-groups + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /enterprises/{enterprise}/actions/runner-groups + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-organization-access-to-a-self-hosted-runner-group-in-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-organization-access-for-a-self-hosted-runner-group-in-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-organization-access-to-a-self-hosted-runner-group-in-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-organization-access-to-a-self-hosted-runner-group-in-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /enterprises/{enterprise}/actions/runners + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /enterprises/{enterprise}/actions/runners/downloads + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#list-runner-applications-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /enterprises/{enterprise}/actions/runners/generate-jitconfig + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /enterprises/{enterprise}/actions/runners/registration-token + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#create-a-registration-token-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /enterprises/{enterprise}/actions/runners/remove-token + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#create-a-remove-token-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /enterprises/{enterprise}/actions/runners/{runner_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /enterprises/{enterprise}/actions/runners/{runner_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /enterprises/{enterprise}/actions/runners/{runner_id}/labels + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /enterprises/{enterprise}/actions/runners/{runner_id}/labels + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /enterprises/{enterprise}/actions/runners/{runner_id}/labels + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels/{name} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#remove-a-custom-label-from-a-self-hosted-runner-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /enterprises/{enterprise}/announcement + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/enterprises#remove-announcement-banner-from-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - name: GET /enterprises/{enterprise}/announcement + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/enterprises#get-announcement-banner-for-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - name: PATCH /enterprises/{enterprise}/announcement + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/enterprises#set-announcement-banner-for-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - name: GET /enterprises/{enterprise}/audit-log + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#get-the-audit-log-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /enterprises/{enterprise}/code-scanning/alerts + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /enterprises/{enterprise}/code_security_and_analysis + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#get-code-security-and-analysis-features-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /enterprises/{enterprise}/code_security_and_analysis + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#update-code-security-and-analysis-features-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /enterprises/{enterprise}/consumed-licenses + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/license#list-enterprise-consumed-licenses + openapi_files: + - descriptions/ghec/ghec.json + - name: GET /enterprises/{enterprise}/dependabot/alerts + documentation_url: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-enterprise + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /enterprises/{enterprise}/license-sync-status + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/license#get-a-license-sync-status + openapi_files: + - descriptions/ghec/ghec.json + - name: GET /enterprises/{enterprise}/secret-scanning/alerts + documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-enterprise + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /enterprises/{enterprise}/settings/billing/actions + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#get-github-actions-billing-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - name: GET /enterprises/{enterprise}/settings/billing/advanced-security + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#get-github-advanced-security-active-committers-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /enterprises/{enterprise}/settings/billing/packages + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#get-github-packages-billing-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - name: GET /enterprises/{enterprise}/settings/billing/shared-storage + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#get-shared-storage-billing-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - name: POST /enterprises/{enterprise}/{security_product}/{enablement} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#enable-or-disable-a-security-feature + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /events + documentation_url: https://docs.github.com/rest/activity/events#list-public-events + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /feeds + documentation_url: https://docs.github.com/rest/activity/feeds#get-feeds + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /gists + documentation_url: https://docs.github.com/rest/gists/gists#list-gists-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /gists + documentation_url: https://docs.github.com/rest/gists/gists#create-a-gist + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /gists/public + documentation_url: https://docs.github.com/rest/gists/gists#list-public-gists + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /gists/starred + documentation_url: https://docs.github.com/rest/gists/gists#list-starred-gists + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /gists/{gist_id} + documentation_url: https://docs.github.com/rest/gists/gists#delete-a-gist + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /gists/{gist_id} + documentation_url: https://docs.github.com/rest/gists/gists#get-a-gist + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /gists/{gist_id} + documentation_url: https://docs.github.com/rest/gists/gists#update-a-gist + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /gists/{gist_id}/comments + documentation_url: https://docs.github.com/rest/gists/comments#list-gist-comments + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /gists/{gist_id}/comments + documentation_url: https://docs.github.com/rest/gists/comments#create-a-gist-comment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /gists/{gist_id}/comments/{comment_id} + documentation_url: https://docs.github.com/rest/gists/comments#delete-a-gist-comment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /gists/{gist_id}/comments/{comment_id} + documentation_url: https://docs.github.com/rest/gists/comments#get-a-gist-comment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /gists/{gist_id}/comments/{comment_id} + documentation_url: https://docs.github.com/rest/gists/comments#update-a-gist-comment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /gists/{gist_id}/commits + documentation_url: https://docs.github.com/rest/gists/gists#list-gist-commits + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /gists/{gist_id}/forks + documentation_url: https://docs.github.com/rest/gists/gists#list-gist-forks + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /gists/{gist_id}/forks + documentation_url: https://docs.github.com/rest/gists/gists#fork-a-gist + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /gists/{gist_id}/star + documentation_url: https://docs.github.com/rest/gists/gists#unstar-a-gist + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /gists/{gist_id}/star + documentation_url: https://docs.github.com/rest/gists/gists#check-if-a-gist-is-starred + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /gists/{gist_id}/star + documentation_url: https://docs.github.com/rest/gists/gists#star-a-gist + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /gists/{gist_id}/{sha} + documentation_url: https://docs.github.com/rest/gists/gists#get-a-gist-revision + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /gitignore/templates + documentation_url: https://docs.github.com/rest/gitignore/gitignore#get-all-gitignore-templates + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /gitignore/templates/{name} + documentation_url: https://docs.github.com/rest/gitignore/gitignore#get-a-gitignore-template + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /installation/repositories + documentation_url: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-app-installation + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /installation/token + documentation_url: https://docs.github.com/rest/apps/installations#revoke-an-installation-access-token + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /issues + documentation_url: https://docs.github.com/rest/issues/issues#list-issues-assigned-to-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /licenses + documentation_url: https://docs.github.com/rest/licenses/licenses#get-all-commonly-used-licenses + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /licenses/{license} + documentation_url: https://docs.github.com/rest/licenses/licenses#get-a-license + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /manage/v1/config/nodes + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/manage-ghes#get-ghes-node-metadata-for-all-nodes + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /manage/v1/maintenance + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/manage-ghes#get-the-status-of-maintenance-mode + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /manage/v1/maintenance + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/manage-ghes#set-the-status-of-maintenance-mode + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /manage/v1/replication/status + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-replica-nodes + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /manage/v1/version + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/manage-ghes#get-all-ghes-release-versions-for-all-nodes + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /markdown + documentation_url: https://docs.github.com/rest/markdown/markdown#render-a-markdown-document + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /markdown/raw + documentation_url: https://docs.github.com/rest/markdown/markdown#render-a-markdown-document-in-raw-mode + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /marketplace_listing/accounts/{account_id} + documentation_url: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /marketplace_listing/plans + documentation_url: https://docs.github.com/rest/apps/marketplace#list-plans + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /marketplace_listing/plans/{plan_id}/accounts + documentation_url: https://docs.github.com/rest/apps/marketplace#list-accounts-for-a-plan + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /marketplace_listing/stubbed/accounts/{account_id} + documentation_url: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account-stubbed + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /marketplace_listing/stubbed/plans + documentation_url: https://docs.github.com/rest/apps/marketplace#list-plans-stubbed + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /marketplace_listing/stubbed/plans/{plan_id}/accounts + documentation_url: https://docs.github.com/rest/apps/marketplace#list-accounts-for-a-plan-stubbed + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /meta + documentation_url: https://docs.github.com/rest/meta/meta#get-apiname-meta-information + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /networks/{owner}/{repo}/events + documentation_url: https://docs.github.com/rest/activity/events#list-public-events-for-a-network-of-repositories + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /notifications + documentation_url: https://docs.github.com/rest/activity/notifications#list-notifications-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /notifications + documentation_url: https://docs.github.com/rest/activity/notifications#mark-notifications-as-read + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /notifications/threads/{thread_id} + documentation_url: https://docs.github.com/rest/activity/notifications#get-a-thread + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /notifications/threads/{thread_id} + documentation_url: https://docs.github.com/rest/activity/notifications#mark-a-thread-as-read + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /notifications/threads/{thread_id}/subscription + documentation_url: https://docs.github.com/rest/activity/notifications#delete-a-thread-subscription + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /notifications/threads/{thread_id}/subscription + documentation_url: https://docs.github.com/rest/activity/notifications#get-a-thread-subscription-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /notifications/threads/{thread_id}/subscription + documentation_url: https://docs.github.com/rest/activity/notifications#set-a-thread-subscription + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /octocat + documentation_url: https://docs.github.com/rest/meta/meta#get-octocat + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /organizations + documentation_url: https://docs.github.com/rest/orgs/orgs#list-organizations + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /organizations/{organization_id}/custom_roles + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#deprecated---list-custom-repository-roles-in-an-organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org} + documentation_url: https://docs.github.com/rest/orgs/orgs#delete-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org} + documentation_url: https://docs.github.com/rest/orgs/orgs#get-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /orgs/{org} + documentation_url: https://docs.github.com/rest/orgs/orgs#update-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/actions/cache/usage + documentation_url: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/actions/cache/usage-by-repository + documentation_url: https://docs.github.com/rest/actions/cache#list-repositories-with-github-actions-cache-usage-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/actions/oidc/customization/sub + documentation_url: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /orgs/{org}/actions/oidc/customization/sub + documentation_url: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/actions/permissions + documentation_url: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /orgs/{org}/actions/permissions + documentation_url: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/actions/permissions/repositories + documentation_url: https://docs.github.com/rest/actions/permissions#list-selected-repositories-enabled-for-github-actions-in-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /orgs/{org}/actions/permissions/repositories + documentation_url: https://docs.github.com/rest/actions/permissions#set-selected-repositories-enabled-for-github-actions-in-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org}/actions/permissions/repositories/{repository_id} + documentation_url: https://docs.github.com/rest/actions/permissions#disable-a-selected-repository-for-github-actions-in-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /orgs/{org}/actions/permissions/repositories/{repository_id} + documentation_url: https://docs.github.com/rest/actions/permissions#enable-a-selected-repository-for-github-actions-in-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/actions/permissions/selected-actions + documentation_url: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /orgs/{org}/actions/permissions/selected-actions + documentation_url: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/actions/permissions/workflow + documentation_url: https://docs.github.com/rest/actions/permissions#get-default-workflow-permissions-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /orgs/{org}/actions/permissions/workflow + documentation_url: https://docs.github.com/rest/actions/permissions#set-default-workflow-permissions-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/actions/runner-groups + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /orgs/{org}/actions/runner-groups + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org}/actions/runner-groups/{runner_group_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/actions/runner-groups/{runner_group_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /orgs/{org}/actions/runner-groups/{runner_group_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-repository-access-to-a-self-hosted-runner-group-in-an-organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-repository-access-for-a-self-hosted-runner-group-in-an-organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-repository-access-to-a-self-hosted-runner-group-in-an-organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/actions/runners + documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/actions/runners/downloads + documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /orgs/{org}/actions/runners/generate-jitconfig + documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /orgs/{org}/actions/runners/registration-token + documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /orgs/{org}/actions/runners/remove-token + documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org}/actions/runners/{runner_id} + documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/actions/runners/{runner_id} + documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org}/actions/runners/{runner_id}/labels + documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/actions/runners/{runner_id}/labels + documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /orgs/{org}/actions/runners/{runner_id}/labels + documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /orgs/{org}/actions/runners/{runner_id}/labels + documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name} + documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-a-custom-label-from-a-self-hosted-runner-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/actions/secrets + documentation_url: https://docs.github.com/rest/actions/secrets#list-organization-secrets + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/actions/secrets/public-key + documentation_url: https://docs.github.com/rest/actions/secrets#get-an-organization-public-key + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org}/actions/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/actions/secrets#delete-an-organization-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/actions/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/actions/secrets#get-an-organization-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /orgs/{org}/actions/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/actions/secrets/{secret_name}/repositories + documentation_url: https://docs.github.com/rest/actions/secrets#list-selected-repositories-for-an-organization-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /orgs/{org}/actions/secrets/{secret_name}/repositories + documentation_url: https://docs.github.com/rest/actions/secrets#set-selected-repositories-for-an-organization-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} + documentation_url: https://docs.github.com/rest/actions/secrets#remove-selected-repository-from-an-organization-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} + documentation_url: https://docs.github.com/rest/actions/secrets#add-selected-repository-to-an-organization-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/actions/variables + documentation_url: https://docs.github.com/rest/actions/variables#list-organization-variables + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /orgs/{org}/actions/variables + documentation_url: https://docs.github.com/rest/actions/variables#create-an-organization-variable + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org}/actions/variables/{name} + documentation_url: https://docs.github.com/rest/actions/variables#delete-an-organization-variable + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/actions/variables/{name} + documentation_url: https://docs.github.com/rest/actions/variables#get-an-organization-variable + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /orgs/{org}/actions/variables/{name} + documentation_url: https://docs.github.com/rest/actions/variables#update-an-organization-variable + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/actions/variables/{name}/repositories + documentation_url: https://docs.github.com/rest/actions/variables#list-selected-repositories-for-an-organization-variable + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /orgs/{org}/actions/variables/{name}/repositories + documentation_url: https://docs.github.com/rest/actions/variables#set-selected-repositories-for-an-organization-variable + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id} + documentation_url: https://docs.github.com/rest/actions/variables#remove-selected-repository-from-an-organization-variable + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id} + documentation_url: https://docs.github.com/rest/actions/variables#add-selected-repository-to-an-organization-variable + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org}/announcement + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/organizations#remove-announcement-banner-from-organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/announcement + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/organizations#get-announcement-banner-for-organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /orgs/{org}/announcement + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/organizations#set-announcement-banner-for-organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/audit-log + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/orgs#get-the-audit-log-for-an-organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/blocks + documentation_url: https://docs.github.com/rest/orgs/blocking#list-users-blocked-by-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /orgs/{org}/blocks/{username} + documentation_url: https://docs.github.com/rest/orgs/blocking#unblock-a-user-from-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/blocks/{username} + documentation_url: https://docs.github.com/rest/orgs/blocking#check-if-a-user-is-blocked-by-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PUT /orgs/{org}/blocks/{username} + documentation_url: https://docs.github.com/rest/orgs/blocking#block-a-user-from-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/code-scanning/alerts + documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/codespaces + documentation_url: https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-the-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PUT /orgs/{org}/codespaces/access + documentation_url: https://docs.github.com/rest/codespaces/organizations#manage-access-control-for-organization-codespaces + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /orgs/{org}/codespaces/access/selected_users + documentation_url: https://docs.github.com/rest/codespaces/organizations#remove-users-from-codespaces-access-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: POST /orgs/{org}/codespaces/access/selected_users + documentation_url: https://docs.github.com/rest/codespaces/organizations#add-users-to-codespaces-access-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/codespaces/secrets + documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#list-organization-secrets + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/codespaces/secrets/public-key + documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#get-an-organization-public-key + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /orgs/{org}/codespaces/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#delete-an-organization-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/codespaces/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#get-an-organization-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PUT /orgs/{org}/codespaces/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#create-or-update-an-organization-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories + documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#list-selected-repositories-for-an-organization-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories + documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#set-selected-repositories-for-an-organization-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id} + documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#remove-selected-repository-from-an-organization-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id} + documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#add-selected-repository-to-an-organization-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/copilot/billing + documentation_url: https://docs.github.com/rest/copilot/copilot-for-business#get-copilot-for-business-seat-information-and-settings-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/copilot/billing/seats + documentation_url: https://docs.github.com/rest/copilot/copilot-for-business#list-all-copilot-for-business-seat-assignments-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /orgs/{org}/copilot/billing/selected_teams + documentation_url: https://docs.github.com/rest/copilot/copilot-for-business#remove-teams-from-the-copilot-for-business-subscription-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: POST /orgs/{org}/copilot/billing/selected_teams + documentation_url: https://docs.github.com/rest/copilot/copilot-for-business#add-teams-to-the-copilot-for-business-subscription-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /orgs/{org}/copilot/billing/selected_users + documentation_url: https://docs.github.com/rest/copilot/copilot-for-business#remove-users-from-the-copilot-for-business-subscription-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: POST /orgs/{org}/copilot/billing/selected_users + documentation_url: https://docs.github.com/rest/copilot/copilot-for-business#add-users-to-the-copilot-for-business-subscription-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/credential-authorizations + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/orgs#list-saml-sso-authorizations-for-an-organization + openapi_files: + - descriptions/ghec/ghec.json + - name: DELETE /orgs/{org}/credential-authorizations/{credential_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/orgs#remove-a-saml-sso-authorization-for-an-organization + openapi_files: + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/custom-repository-roles + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /orgs/{org}/custom-repository-roles + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#create-a-custom-repository-role + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org}/custom-repository-roles/{role_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#delete-a-custom-repository-role + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/custom-repository-roles/{role_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#get-a-custom-repository-role + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /orgs/{org}/custom-repository-roles/{role_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#update-a-custom-repository-role + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /orgs/{org}/custom_roles + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#deprecated---create-a-custom-role + openapi_files: + - descriptions/ghec/ghec.json + - name: DELETE /orgs/{org}/custom_roles/{role_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#deprecated---delete-a-custom-role + openapi_files: + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/custom_roles/{role_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#deprecated---get-a-custom-role + openapi_files: + - descriptions/ghec/ghec.json + - name: PATCH /orgs/{org}/custom_roles/{role_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#deprecated---update-a-custom-role + openapi_files: + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/dependabot/alerts + documentation_url: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/dependabot/secrets + documentation_url: https://docs.github.com/rest/dependabot/secrets#list-organization-secrets + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/dependabot/secrets/public-key + documentation_url: https://docs.github.com/rest/dependabot/secrets#get-an-organization-public-key + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org}/dependabot/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/dependabot/secrets#delete-an-organization-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/dependabot/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/dependabot/secrets#get-an-organization-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /orgs/{org}/dependabot/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories + documentation_url: https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories + documentation_url: https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id} + documentation_url: https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id} + documentation_url: https://docs.github.com/rest/dependabot/secrets#add-selected-repository-to-an-organization-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/docker/conflicts + documentation_url: https://docs.github.com/rest/packages/packages#get-list-of-conflicting-packages-during-docker-migration-for-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/events + documentation_url: https://docs.github.com/rest/activity/events#list-public-organization-events + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/external-group/{group_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#get-an-external-group + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/external-groups + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#list-external-groups-in-an-organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/failed_invitations + documentation_url: https://docs.github.com/rest/orgs/members#list-failed-organization-invitations + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/fine_grained_permissions + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#deprecated---list-fine-grained-permissions-for-an-organization + openapi_files: + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/hooks + documentation_url: https://docs.github.com/rest/orgs/webhooks#list-organization-webhooks + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /orgs/{org}/hooks + documentation_url: https://docs.github.com/rest/orgs/webhooks#create-an-organization-webhook + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org}/hooks/{hook_id} + documentation_url: https://docs.github.com/rest/orgs/webhooks#delete-an-organization-webhook + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/hooks/{hook_id} + documentation_url: https://docs.github.com/rest/orgs/webhooks#get-an-organization-webhook + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /orgs/{org}/hooks/{hook_id} + documentation_url: https://docs.github.com/rest/orgs/webhooks#update-an-organization-webhook + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/hooks/{hook_id}/config + documentation_url: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /orgs/{org}/hooks/{hook_id}/config + documentation_url: https://docs.github.com/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/hooks/{hook_id}/deliveries + documentation_url: https://docs.github.com/rest/orgs/webhooks#list-deliveries-for-an-organization-webhook + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id} + documentation_url: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-delivery-for-an-organization-webhook + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts + documentation_url: https://docs.github.com/rest/orgs/webhooks#redeliver-a-delivery-for-an-organization-webhook + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /orgs/{org}/hooks/{hook_id}/pings + documentation_url: https://docs.github.com/rest/orgs/webhooks#ping-an-organization-webhook + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/installation + documentation_url: https://docs.github.com/rest/apps/apps#get-an-organization-installation-for-the-authenticated-app + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/installations + documentation_url: https://docs.github.com/rest/orgs/orgs#list-app-installations-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org}/interaction-limits + documentation_url: https://docs.github.com/rest/interactions/orgs#remove-interaction-restrictions-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/interaction-limits + documentation_url: https://docs.github.com/rest/interactions/orgs#get-interaction-restrictions-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PUT /orgs/{org}/interaction-limits + documentation_url: https://docs.github.com/rest/interactions/orgs#set-interaction-restrictions-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/invitations + documentation_url: https://docs.github.com/rest/orgs/members#list-pending-organization-invitations + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: POST /orgs/{org}/invitations + documentation_url: https://docs.github.com/rest/orgs/members#create-an-organization-invitation + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /orgs/{org}/invitations/{invitation_id} + documentation_url: https://docs.github.com/rest/orgs/members#cancel-an-organization-invitation + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/invitations/{invitation_id}/teams + documentation_url: https://docs.github.com/rest/orgs/members#list-organization-invitation-teams + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/issues + documentation_url: https://docs.github.com/rest/issues/issues#list-organization-issues-assigned-to-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/members + documentation_url: https://docs.github.com/rest/orgs/members#list-organization-members + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org}/members/{username} + documentation_url: https://docs.github.com/rest/orgs/members#remove-an-organization-member + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/members/{username} + documentation_url: https://docs.github.com/rest/orgs/members#check-organization-membership-for-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/members/{username}/codespaces + documentation_url: https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-a-user-in-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name} + documentation_url: https://docs.github.com/rest/codespaces/organizations#delete-a-codespace-from-the-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop + documentation_url: https://docs.github.com/rest/codespaces/organizations#stop-a-codespace-for-an-organization-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/members/{username}/copilot + documentation_url: https://docs.github.com/rest/copilot/copilot-for-business#get-copilot-for-business-seat-assignment-details-for-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /orgs/{org}/memberships/{username} + documentation_url: https://docs.github.com/rest/orgs/members#remove-organization-membership-for-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/memberships/{username} + documentation_url: https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /orgs/{org}/memberships/{username} + documentation_url: https://docs.github.com/rest/orgs/members#set-organization-membership-for-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/migrations + documentation_url: https://docs.github.com/rest/migrations/orgs#list-organization-migrations + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /orgs/{org}/migrations + documentation_url: https://docs.github.com/rest/migrations/orgs#start-an-organization-migration + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/migrations/{migration_id} + documentation_url: https://docs.github.com/rest/migrations/orgs#get-an-organization-migration-status + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org}/migrations/{migration_id}/archive + documentation_url: https://docs.github.com/rest/migrations/orgs#delete-an-organization-migration-archive + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/migrations/{migration_id}/archive + documentation_url: https://docs.github.com/rest/migrations/orgs#download-an-organization-migration-archive + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock + documentation_url: https://docs.github.com/rest/migrations/orgs#unlock-an-organization-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/migrations/{migration_id}/repositories + documentation_url: https://docs.github.com/rest/migrations/orgs#list-repositories-in-an-organization-migration + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/outside_collaborators + documentation_url: https://docs.github.com/rest/orgs/outside-collaborators#list-outside-collaborators-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org}/outside_collaborators/{username} + documentation_url: https://docs.github.com/rest/orgs/outside-collaborators#remove-outside-collaborator-from-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /orgs/{org}/outside_collaborators/{username} + documentation_url: https://docs.github.com/rest/orgs/outside-collaborators#convert-an-organization-member-to-outside-collaborator + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/packages + documentation_url: https://docs.github.com/rest/packages/packages#list-packages-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org}/packages/{package_type}/{package_name} + documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/packages/{package_type}/{package_name} + documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /orgs/{org}/packages/{package_type}/{package_name}/restore + documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/packages/{package_type}/{package_name}/versions + documentation_url: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id} + documentation_url: https://docs.github.com/rest/packages/packages#delete-package-version-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id} + documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-version-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore + documentation_url: https://docs.github.com/rest/packages/packages#restore-package-version-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/personal-access-token-requests + documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /orgs/{org}/personal-access-token-requests + documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#review-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /orgs/{org}/personal-access-token-requests/{pat_request_id} + documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#review-a-request-to-access-organization-resources-with-a-fine-grained-personal-access-token + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories + documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-repositories-requested-to-be-accessed-by-a-fine-grained-personal-access-token + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/personal-access-tokens + documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-fine-grained-personal-access-tokens-with-access-to-organization-resources + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /orgs/{org}/personal-access-tokens + documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#update-the-access-to-organization-resources-via-fine-grained-personal-access-tokens + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /orgs/{org}/personal-access-tokens/{pat_id} + documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#update-the-access-a-fine-grained-personal-access-token-has-to-organization-resources + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories + documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-repositories-a-fine-grained-personal-access-token-has-access-to + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/pre-receive-hooks + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/org-pre-receive-hooks#list-pre-receive-hooks-for-an-organization + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org}/pre-receive-hooks/{pre_receive_hook_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/org-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-an-organization + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/pre-receive-hooks/{pre_receive_hook_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/org-pre-receive-hooks#get-a-pre-receive-hook-for-an-organization + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /orgs/{org}/pre-receive-hooks/{pre_receive_hook_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/org-pre-receive-hooks#update-pre-receive-hook-enforcement-for-an-organization + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/projects + documentation_url: https://docs.github.com/rest/projects/projects#list-organization-projects + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /orgs/{org}/projects + documentation_url: https://docs.github.com/rest/projects/projects#create-an-organization-project + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/properties/schema + documentation_url: https://docs.github.com/rest/orgs/properties#get-all-custom-properties-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PATCH /orgs/{org}/properties/schema + documentation_url: https://docs.github.com/rest/orgs/properties#create-or-update-custom-properties-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /orgs/{org}/properties/schema/{custom_property_name} + documentation_url: https://docs.github.com/rest/orgs/properties#remove-a-custom-property-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/properties/schema/{custom_property_name} + documentation_url: https://docs.github.com/rest/orgs/properties#get-a-custom-property-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PUT /orgs/{org}/properties/schema/{custom_property_name} + documentation_url: https://docs.github.com/rest/orgs/properties#create-or-update-a-custom-property-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/properties/values + documentation_url: https://docs.github.com/rest/orgs/properties#list-custom-property-values-for-organization-repositories + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PATCH /orgs/{org}/properties/values + documentation_url: https://docs.github.com/rest/orgs/properties#create-or-update-custom-property-values-for-organization-repositories + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/public_members + documentation_url: https://docs.github.com/rest/orgs/members#list-public-organization-members + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org}/public_members/{username} + documentation_url: https://docs.github.com/rest/orgs/members#remove-public-organization-membership-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/public_members/{username} + documentation_url: https://docs.github.com/rest/orgs/members#check-public-organization-membership-for-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /orgs/{org}/public_members/{username} + documentation_url: https://docs.github.com/rest/orgs/members#set-public-organization-membership-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/repos + documentation_url: https://docs.github.com/rest/repos/repos#list-organization-repositories + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /orgs/{org}/repos + documentation_url: https://docs.github.com/rest/repos/repos#create-an-organization-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/repository-fine-grained-permissions + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#list-repository-fine-grained-permissions-for-an-organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/rulesets + documentation_url: https://docs.github.com/rest/orgs/rules#get-all-organization-repository-rulesets + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: POST /orgs/{org}/rulesets + documentation_url: https://docs.github.com/rest/orgs/rules#create-an-organization-repository-ruleset + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/rulesets/rule-suites + documentation_url: https://docs.github.com/rest/orgs/rule-suites#list-organization-rule-suites + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id} + documentation_url: https://docs.github.com/rest/orgs/rule-suites#get-an-organization-rule-suite + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /orgs/{org}/rulesets/{ruleset_id} + documentation_url: https://docs.github.com/rest/orgs/rules#delete-an-organization-repository-ruleset + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/rulesets/{ruleset_id} + documentation_url: https://docs.github.com/rest/orgs/rules#get-an-organization-repository-ruleset + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PUT /orgs/{org}/rulesets/{ruleset_id} + documentation_url: https://docs.github.com/rest/orgs/rules#update-an-organization-repository-ruleset + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/secret-scanning/alerts + documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/security-advisories + documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/security-managers + documentation_url: https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org}/security-managers/teams/{team_slug} + documentation_url: https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /orgs/{org}/security-managers/teams/{team_slug} + documentation_url: https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/settings/billing/actions + documentation_url: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/settings/billing/advanced-security + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/billing/billing#get-github-advanced-security-active-committers-for-an-organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/settings/billing/packages + documentation_url: https://docs.github.com/rest/billing/billing#get-github-packages-billing-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/settings/billing/shared-storage + documentation_url: https://docs.github.com/rest/billing/billing#get-shared-storage-billing-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/team-sync/groups + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#list-idp-groups-for-an-organization + openapi_files: + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/teams + documentation_url: https://docs.github.com/rest/teams/teams#list-teams + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /orgs/{org}/teams + documentation_url: https://docs.github.com/rest/teams/teams#create-a-team + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org}/teams/{team_slug} + documentation_url: https://docs.github.com/rest/teams/teams#delete-a-team + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/teams/{team_slug} + documentation_url: https://docs.github.com/rest/teams/teams#get-a-team-by-name + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /orgs/{org}/teams/{team_slug} + documentation_url: https://docs.github.com/rest/teams/teams#update-a-team + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/teams/{team_slug}/discussions + documentation_url: https://docs.github.com/rest/teams/discussions#list-discussions + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /orgs/{org}/teams/{team_slug}/discussions + documentation_url: https://docs.github.com/rest/teams/discussions#create-a-discussion + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} + documentation_url: https://docs.github.com/rest/teams/discussions#delete-a-discussion + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} + documentation_url: https://docs.github.com/rest/teams/discussions#get-a-discussion + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} + documentation_url: https://docs.github.com/rest/teams/discussions#update-a-discussion + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments + documentation_url: https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments + documentation_url: https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} + documentation_url: https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} + documentation_url: https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} + documentation_url: https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions + documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions + documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id} + documentation_url: https://docs.github.com/rest/reactions/reactions#delete-team-discussion-comment-reaction + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions + documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions + documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id} + documentation_url: https://docs.github.com/rest/reactions/reactions#delete-team-discussion-reaction + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org}/teams/{team_slug}/external-groups + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#remove-the-connection-between-an-external-group-and-a-team + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/teams/{team_slug}/external-groups + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#list-a-connection-between-an-external-group-and-a-team + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /orgs/{org}/teams/{team_slug}/external-groups + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#update-the-connection-between-an-external-group-and-a-team + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/teams/{team_slug}/invitations + documentation_url: https://docs.github.com/rest/teams/members#list-pending-team-invitations + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/teams/{team_slug}/members + documentation_url: https://docs.github.com/rest/teams/members#list-team-members + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org}/teams/{team_slug}/memberships/{username} + documentation_url: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/teams/{team_slug}/memberships/{username} + documentation_url: https://docs.github.com/rest/teams/members#get-team-membership-for-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /orgs/{org}/teams/{team_slug}/memberships/{username} + documentation_url: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/teams/{team_slug}/projects + documentation_url: https://docs.github.com/rest/teams/teams#list-team-projects + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id} + documentation_url: https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/teams/{team_slug}/projects/{project_id} + documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /orgs/{org}/teams/{team_slug}/projects/{project_id} + documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/teams/{team_slug}/repos + documentation_url: https://docs.github.com/rest/teams/teams#list-team-repositories + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} + documentation_url: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} + documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} + documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#list-idp-groups-for-a-team + openapi_files: + - descriptions/ghec/ghec.json + - name: PATCH /orgs/{org}/teams/{team_slug}/team-sync/group-mappings + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#create-or-update-idp-group-connections + openapi_files: + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/teams/{team_slug}/teams + documentation_url: https://docs.github.com/rest/teams/teams#list-child-teams + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /orgs/{org}/{security_product}/{enablement} + documentation_url: https://docs.github.com/rest/orgs/orgs#enable-or-disable-a-security-feature-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /projects/columns/cards/{card_id} + documentation_url: https://docs.github.com/rest/projects/cards#delete-a-project-card + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /projects/columns/cards/{card_id} + documentation_url: https://docs.github.com/rest/projects/cards#get-a-project-card + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /projects/columns/cards/{card_id} + documentation_url: https://docs.github.com/rest/projects/cards#update-an-existing-project-card + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /projects/columns/cards/{card_id}/moves + documentation_url: https://docs.github.com/rest/projects/cards#move-a-project-card + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /projects/columns/{column_id} + documentation_url: https://docs.github.com/rest/projects/columns#delete-a-project-column + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /projects/columns/{column_id} + documentation_url: https://docs.github.com/rest/projects/columns#get-a-project-column + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /projects/columns/{column_id} + documentation_url: https://docs.github.com/rest/projects/columns#update-an-existing-project-column + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /projects/columns/{column_id}/cards + documentation_url: https://docs.github.com/rest/projects/cards#list-project-cards + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /projects/columns/{column_id}/cards + documentation_url: https://docs.github.com/rest/projects/cards#create-a-project-card + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /projects/columns/{column_id}/moves + documentation_url: https://docs.github.com/rest/projects/columns#move-a-project-column + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /projects/{project_id} + documentation_url: https://docs.github.com/rest/projects/projects#delete-a-project + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /projects/{project_id} + documentation_url: https://docs.github.com/rest/projects/projects#get-a-project + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /projects/{project_id} + documentation_url: https://docs.github.com/rest/projects/projects#update-a-project + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /projects/{project_id}/collaborators + documentation_url: https://docs.github.com/rest/projects/collaborators#list-project-collaborators + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /projects/{project_id}/collaborators/{username} + documentation_url: https://docs.github.com/rest/projects/collaborators#remove-user-as-a-collaborator + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /projects/{project_id}/collaborators/{username} + documentation_url: https://docs.github.com/rest/projects/collaborators#add-project-collaborator + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /projects/{project_id}/collaborators/{username}/permission + documentation_url: https://docs.github.com/rest/projects/collaborators#get-project-permission-for-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /projects/{project_id}/columns + documentation_url: https://docs.github.com/rest/projects/columns#list-project-columns + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /projects/{project_id}/columns + documentation_url: https://docs.github.com/rest/projects/columns#create-a-project-column + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /rate_limit + documentation_url: https://docs.github.com/rest/rate-limit/rate-limit#get-rate-limit-status-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /reactions/{reaction_id} + documentation_url: https://docs.github.com/enterprise-server@3.4/rest/reference/reactions/#delete-a-reaction-legacy + openapi_files: + - descriptions/ghes-3.4/ghes-3.4.json + - name: DELETE /repos/{owner}/{repo} + documentation_url: https://docs.github.com/rest/repos/repos#delete-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo} + documentation_url: https://docs.github.com/rest/repos/repos#get-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /repos/{owner}/{repo} + documentation_url: https://docs.github.com/rest/repos/repos#update-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/artifacts + documentation_url: https://docs.github.com/rest/actions/artifacts#list-artifacts-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id} + documentation_url: https://docs.github.com/rest/actions/artifacts#delete-an-artifact + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id} + documentation_url: https://docs.github.com/rest/actions/artifacts#get-an-artifact + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format} + documentation_url: https://docs.github.com/rest/actions/artifacts#download-an-artifact + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/cache/usage + documentation_url: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/cache/usage-policy + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/actions/cache#get-github-actions-cache-usage-policy-for-a-repository + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /repos/{owner}/{repo}/actions/cache/usage-policy + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/actions/cache#set-github-actions-cache-usage-policy-for-a-repository + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/actions/caches + documentation_url: https://docs.github.com/rest/actions/cache#delete-github-actions-caches-for-a-repository-using-a-cache-key + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/caches + documentation_url: https://docs.github.com/rest/actions/cache#list-github-actions-caches-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/actions/caches/{cache_id} + documentation_url: https://docs.github.com/rest/actions/cache#delete-a-github-actions-cache-for-a-repository-using-a-cache-id + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/jobs/{job_id} + documentation_url: https://docs.github.com/rest/actions/workflow-jobs#get-a-job-for-a-workflow-run + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs + documentation_url: https://docs.github.com/rest/actions/workflow-jobs#download-job-logs-for-a-workflow-run + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun + documentation_url: https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/oidc/customization/sub + documentation_url: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /repos/{owner}/{repo}/actions/oidc/customization/sub + documentation_url: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/organization-secrets + documentation_url: https://docs.github.com/rest/actions/secrets#list-repository-organization-secrets + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/organization-variables + documentation_url: https://docs.github.com/rest/actions/variables#list-repository-organization-variables + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/permissions + documentation_url: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /repos/{owner}/{repo}/actions/permissions + documentation_url: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/permissions/access + documentation_url: https://docs.github.com/rest/actions/permissions#get-the-level-of-access-for-workflows-outside-of-the-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /repos/{owner}/{repo}/actions/permissions/access + documentation_url: https://docs.github.com/rest/actions/permissions#set-the-level-of-access-for-workflows-outside-of-the-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/permissions/selected-actions + documentation_url: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /repos/{owner}/{repo}/actions/permissions/selected-actions + documentation_url: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/permissions/workflow + documentation_url: https://docs.github.com/rest/actions/permissions#get-default-workflow-permissions-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /repos/{owner}/{repo}/actions/permissions/workflow + documentation_url: https://docs.github.com/rest/actions/permissions#set-default-workflow-permissions-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/runners + documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/runners/downloads + documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig + documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/actions/runners/registration-token + documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/actions/runners/remove-token + documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/actions/runners/{runner_id} + documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/runners/{runner_id} + documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels + documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels + documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels + documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels + documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name} + documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-a-custom-label-from-a-self-hosted-runner-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/runs + documentation_url: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/actions/runs/{run_id} + documentation_url: https://docs.github.com/rest/actions/workflow-runs#delete-a-workflow-run + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/runs/{run_id} + documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals + documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-the-review-history-for-a-workflow-run + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve + documentation_url: https://docs.github.com/rest/actions/workflow-runs#approve-a-workflow-run-for-a-fork-pull-request + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts + documentation_url: https://docs.github.com/rest/actions/artifacts#list-workflow-run-artifacts + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number} + documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run-attempt + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs + documentation_url: https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run-attempt + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs + documentation_url: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-attempt-logs + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel + documentation_url: https://docs.github.com/rest/actions/workflow-runs#cancel-a-workflow-run + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule + documentation_url: https://docs.github.com/rest/actions/workflow-runs#review-custom-deployment-protection-rules-for-a-workflow-run + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel + documentation_url: https://docs.github.com/rest/actions/workflow-runs#force-cancel-a-workflow-run + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs + documentation_url: https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs + documentation_url: https://docs.github.com/rest/actions/workflow-runs#delete-workflow-run-logs + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs + documentation_url: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-logs + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments + documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-pending-deployments-for-a-workflow-run + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments + documentation_url: https://docs.github.com/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun + documentation_url: https://docs.github.com/rest/actions/workflow-runs#re-run-a-workflow + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs + documentation_url: https://docs.github.com/rest/actions/workflow-runs#re-run-failed-jobs-from-a-workflow-run + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing + documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-workflow-run-usage + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/actions/secrets + documentation_url: https://docs.github.com/rest/actions/secrets#list-repository-secrets + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/secrets/public-key + documentation_url: https://docs.github.com/rest/actions/secrets#get-a-repository-public-key + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/actions/secrets#delete-a-repository-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/actions/secrets#get-a-repository-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /repos/{owner}/{repo}/actions/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/actions/secrets#create-or-update-a-repository-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/variables + documentation_url: https://docs.github.com/rest/actions/variables#list-repository-variables + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/actions/variables + documentation_url: https://docs.github.com/rest/actions/variables#create-a-repository-variable + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/actions/variables/{name} + documentation_url: https://docs.github.com/rest/actions/variables#delete-a-repository-variable + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/variables/{name} + documentation_url: https://docs.github.com/rest/actions/variables#get-a-repository-variable + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /repos/{owner}/{repo}/actions/variables/{name} + documentation_url: https://docs.github.com/rest/actions/variables#update-a-repository-variable + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/workflows + documentation_url: https://docs.github.com/rest/actions/workflows#list-repository-workflows + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/workflows/{workflow_id} + documentation_url: https://docs.github.com/rest/actions/workflows#get-a-workflow + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable + documentation_url: https://docs.github.com/rest/actions/workflows#disable-a-workflow + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches + documentation_url: https://docs.github.com/rest/actions/workflows#create-a-workflow-dispatch-event + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable + documentation_url: https://docs.github.com/rest/actions/workflows#enable-a-workflow + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs + documentation_url: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-workflow + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing + documentation_url: https://docs.github.com/rest/actions/workflows#get-workflow-usage + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/activity + documentation_url: https://docs.github.com/rest/repos/repos#list-repository-activities + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/assignees + documentation_url: https://docs.github.com/rest/issues/assignees#list-assignees + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/assignees/{assignee} + documentation_url: https://docs.github.com/rest/issues/assignees#check-if-a-user-can-be-assigned + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/autolinks + documentation_url: https://docs.github.com/rest/repos/autolinks#list-all-autolinks-of-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/autolinks + documentation_url: https://docs.github.com/rest/repos/autolinks#create-an-autolink-reference-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/autolinks/{autolink_id} + documentation_url: https://docs.github.com/rest/repos/autolinks#delete-an-autolink-reference-from-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/autolinks/{autolink_id} + documentation_url: https://docs.github.com/rest/repos/autolinks#get-an-autolink-reference-of-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/automated-security-fixes + documentation_url: https://docs.github.com/rest/repos/repos#disable-automated-security-fixes + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/automated-security-fixes + documentation_url: https://docs.github.com/rest/repos/repos#check-if-automated-security-fixes-are-enabled-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /repos/{owner}/{repo}/automated-security-fixes + documentation_url: https://docs.github.com/rest/repos/repos#enable-automated-security-fixes + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/branches + documentation_url: https://docs.github.com/rest/branches/branches#list-branches + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/branches/{branch} + documentation_url: https://docs.github.com/rest/branches/branches#get-a-branch + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection + documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-branch-protection + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/branches/{branch}/protection + documentation_url: https://docs.github.com/rest/branches/branch-protection#get-branch-protection + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection + documentation_url: https://docs.github.com/rest/branches/branch-protection#update-branch-protection + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins + documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-admin-branch-protection + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins + documentation_url: https://docs.github.com/rest/branches/branch-protection#get-admin-branch-protection + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins + documentation_url: https://docs.github.com/rest/branches/branch-protection#set-admin-branch-protection + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews + documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-pull-request-review-protection + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews + documentation_url: https://docs.github.com/rest/branches/branch-protection#get-pull-request-review-protection + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews + documentation_url: https://docs.github.com/rest/branches/branch-protection#update-pull-request-review-protection + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures + documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-commit-signature-protection + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures + documentation_url: https://docs.github.com/rest/branches/branch-protection#get-commit-signature-protection + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures + documentation_url: https://docs.github.com/rest/branches/branch-protection#create-commit-signature-protection + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks + documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-status-check-protection + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks + documentation_url: https://docs.github.com/rest/branches/branch-protection#get-status-checks-protection + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks + documentation_url: https://docs.github.com/rest/branches/branch-protection#update-status-check-protection + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts + documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-status-check-contexts + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts + documentation_url: https://docs.github.com/rest/branches/branch-protection#get-all-status-check-contexts + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts + documentation_url: https://docs.github.com/rest/branches/branch-protection#add-status-check-contexts + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts + documentation_url: https://docs.github.com/rest/branches/branch-protection#set-status-check-contexts + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions + documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-access-restrictions + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions + documentation_url: https://docs.github.com/rest/branches/branch-protection#get-access-restrictions + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps + documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-app-access-restrictions + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps + documentation_url: https://docs.github.com/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps + documentation_url: https://docs.github.com/rest/branches/branch-protection#add-app-access-restrictions + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps + documentation_url: https://docs.github.com/rest/branches/branch-protection#set-app-access-restrictions + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-team-access-restrictions + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + documentation_url: https://docs.github.com/rest/branches/branch-protection#get-teams-with-access-to-the-protected-branch + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + documentation_url: https://docs.github.com/rest/branches/branch-protection#add-team-access-restrictions + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + documentation_url: https://docs.github.com/rest/branches/branch-protection#set-team-access-restrictions + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-user-access-restrictions + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + documentation_url: https://docs.github.com/rest/branches/branch-protection#get-users-with-access-to-the-protected-branch + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + documentation_url: https://docs.github.com/rest/branches/branch-protection#add-user-access-restrictions + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + documentation_url: https://docs.github.com/rest/branches/branch-protection#set-user-access-restrictions + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/branches/{branch}/rename + documentation_url: https://docs.github.com/rest/branches/branches#rename-a-branch + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/check-runs + documentation_url: https://docs.github.com/rest/checks/runs#create-a-check-run + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/check-runs/{check_run_id} + documentation_url: https://docs.github.com/rest/checks/runs#get-a-check-run + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /repos/{owner}/{repo}/check-runs/{check_run_id} + documentation_url: https://docs.github.com/rest/checks/runs#update-a-check-run + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations + documentation_url: https://docs.github.com/rest/checks/runs#list-check-run-annotations + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest + documentation_url: https://docs.github.com/rest/checks/runs#rerequest-a-check-run + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/check-suites + documentation_url: https://docs.github.com/rest/checks/suites#create-a-check-suite + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /repos/{owner}/{repo}/check-suites/preferences + documentation_url: https://docs.github.com/rest/checks/suites#update-repository-preferences-for-check-suites + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/check-suites/{check_suite_id} + documentation_url: https://docs.github.com/rest/checks/suites#get-a-check-suite + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs + documentation_url: https://docs.github.com/rest/checks/runs#list-check-runs-in-a-check-suite + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest + documentation_url: https://docs.github.com/rest/checks/suites#rerequest-a-check-suite + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/code-scanning/alerts + documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number} + documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-alert + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number} + documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-alert + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances + documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-instances-of-a-code-scanning-alert + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/code-scanning/analyses + documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-analyses-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id} + documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#delete-a-code-scanning-analysis-from-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id} + documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/code-scanning/codeql/databases + documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-codeql-databases-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language} + documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-a-codeql-database-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/code-scanning/default-setup + documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-default-setup-configuration + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /repos/{owner}/{repo}/code-scanning/default-setup + documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-default-setup-configuration + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/code-scanning/sarifs + documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#upload-an-analysis-as-sarif-data + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id} + documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-information-about-a-sarif-upload + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/codeowners/errors + documentation_url: https://docs.github.com/rest/repos/repos#list-codeowners-errors + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/codespaces + documentation_url: https://docs.github.com/rest/codespaces/codespaces#list-codespaces-in-a-repository-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: POST /repos/{owner}/{repo}/codespaces + documentation_url: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-in-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/codespaces/devcontainers + documentation_url: https://docs.github.com/rest/codespaces/codespaces#list-devcontainer-configurations-in-a-repository-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/codespaces/machines + documentation_url: https://docs.github.com/rest/codespaces/machines#list-available-machine-types-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/codespaces/new + documentation_url: https://docs.github.com/rest/codespaces/codespaces#get-default-attributes-for-a-codespace + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/codespaces/permissions_check + documentation_url: https://docs.github.com/rest/codespaces/codespaces#check-if-permissions-defined-by-a-devcontainer-have-been-accepted-by-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/codespaces/secrets + documentation_url: https://docs.github.com/rest/codespaces/repository-secrets#list-repository-secrets + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/codespaces/secrets/public-key + documentation_url: https://docs.github.com/rest/codespaces/repository-secrets#get-a-repository-public-key + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/codespaces/repository-secrets#delete-a-repository-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/codespaces/repository-secrets#get-a-repository-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/codespaces/repository-secrets#create-or-update-a-repository-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/collaborators + documentation_url: https://docs.github.com/rest/collaborators/collaborators#list-repository-collaborators + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/collaborators/{username} + documentation_url: https://docs.github.com/rest/collaborators/collaborators#remove-a-repository-collaborator + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/collaborators/{username} + documentation_url: https://docs.github.com/rest/collaborators/collaborators#check-if-a-user-is-a-repository-collaborator + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /repos/{owner}/{repo}/collaborators/{username} + documentation_url: https://docs.github.com/rest/collaborators/collaborators#add-a-repository-collaborator + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/collaborators/{username}/permission + documentation_url: https://docs.github.com/rest/collaborators/collaborators#get-repository-permissions-for-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/comments + documentation_url: https://docs.github.com/rest/commits/comments#list-commit-comments-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/comments/{comment_id} + documentation_url: https://docs.github.com/rest/commits/comments#delete-a-commit-comment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/comments/{comment_id} + documentation_url: https://docs.github.com/rest/commits/comments#get-a-commit-comment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /repos/{owner}/{repo}/comments/{comment_id} + documentation_url: https://docs.github.com/rest/commits/comments#update-a-commit-comment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/comments/{comment_id}/reactions + documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-commit-comment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/comments/{comment_id}/reactions + documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-commit-comment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id} + documentation_url: https://docs.github.com/rest/reactions/reactions#delete-a-commit-comment-reaction + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/commits + documentation_url: https://docs.github.com/rest/commits/commits#list-commits + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head + documentation_url: https://docs.github.com/rest/commits/commits#list-branches-for-head-commit + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/commits/{commit_sha}/comments + documentation_url: https://docs.github.com/rest/commits/comments#list-commit-comments + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/commits/{commit_sha}/comments + documentation_url: https://docs.github.com/rest/commits/comments#create-a-commit-comment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls + documentation_url: https://docs.github.com/rest/commits/commits#list-pull-requests-associated-with-a-commit + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/commits/{ref} + documentation_url: https://docs.github.com/rest/commits/commits#get-a-commit + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/commits/{ref}/check-runs + documentation_url: https://docs.github.com/rest/checks/runs#list-check-runs-for-a-git-reference + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/commits/{ref}/check-suites + documentation_url: https://docs.github.com/rest/checks/suites#list-check-suites-for-a-git-reference + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/commits/{ref}/status + documentation_url: https://docs.github.com/rest/commits/statuses#get-the-combined-status-for-a-specific-reference + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/commits/{ref}/statuses + documentation_url: https://docs.github.com/rest/commits/statuses#list-commit-statuses-for-a-reference + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/community/profile + documentation_url: https://docs.github.com/rest/metrics/community#get-community-profile-metrics + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/compare/{basehead} + documentation_url: https://docs.github.com/rest/commits/commits#compare-two-commits + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments + documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#create-a-content-attachment + openapi_files: + - descriptions/ghes-3.3/ghes-3.3.json + - name: DELETE /repos/{owner}/{repo}/contents/{path} + documentation_url: https://docs.github.com/rest/repos/contents#delete-a-file + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/contents/{path} + documentation_url: https://docs.github.com/rest/repos/contents#get-repository-content + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /repos/{owner}/{repo}/contents/{path} + documentation_url: https://docs.github.com/rest/repos/contents#create-or-update-file-contents + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/contributors + documentation_url: https://docs.github.com/rest/repos/repos#list-repository-contributors + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/dependabot/alerts + documentation_url: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number} + documentation_url: https://docs.github.com/rest/dependabot/alerts#get-a-dependabot-alert + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number} + documentation_url: https://docs.github.com/rest/dependabot/alerts#update-a-dependabot-alert + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/dependabot/secrets + documentation_url: https://docs.github.com/rest/dependabot/secrets#list-repository-secrets + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/dependabot/secrets/public-key + documentation_url: https://docs.github.com/rest/dependabot/secrets#get-a-repository-public-key + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/dependabot/secrets#delete-a-repository-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/dependabot/secrets#get-a-repository-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/dependabot/secrets#create-or-update-a-repository-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead} + documentation_url: https://docs.github.com/rest/dependency-graph/dependency-review#get-a-diff-of-the-dependencies-between-commits + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/dependency-graph/sbom + documentation_url: https://docs.github.com/rest/dependency-graph/sboms#export-a-software-bill-of-materials-sbom-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/dependency-graph/snapshots + documentation_url: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/deployments + documentation_url: https://docs.github.com/rest/deployments/deployments#list-deployments + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/deployments + documentation_url: https://docs.github.com/rest/deployments/deployments#create-a-deployment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/deployments/{deployment_id} + documentation_url: https://docs.github.com/rest/deployments/deployments#delete-a-deployment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/deployments/{deployment_id} + documentation_url: https://docs.github.com/rest/deployments/deployments#get-a-deployment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses + documentation_url: https://docs.github.com/rest/deployments/statuses#list-deployment-statuses + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses + documentation_url: https://docs.github.com/rest/deployments/statuses#create-a-deployment-status + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id} + documentation_url: https://docs.github.com/rest/deployments/statuses#get-a-deployment-status + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/dispatches + documentation_url: https://docs.github.com/rest/repos/repos#create-a-repository-dispatch-event + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/environments + documentation_url: https://docs.github.com/rest/deployments/environments#list-environments + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/environments/{environment_name} + documentation_url: https://docs.github.com/rest/deployments/environments#delete-an-environment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/environments/{environment_name} + documentation_url: https://docs.github.com/rest/deployments/environments#get-an-environment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /repos/{owner}/{repo}/environments/{environment_name} + documentation_url: https://docs.github.com/rest/deployments/environments#create-or-update-an-environment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies + documentation_url: https://docs.github.com/rest/deployments/branch-policies#list-deployment-branch-policies + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies + documentation_url: https://docs.github.com/rest/deployments/branch-policies#create-a-deployment-branch-policy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} + documentation_url: https://docs.github.com/rest/deployments/branch-policies#delete-a-deployment-branch-policy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} + documentation_url: https://docs.github.com/rest/deployments/branch-policies#get-a-deployment-branch-policy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} + documentation_url: https://docs.github.com/rest/deployments/branch-policies#update-a-deployment-branch-policy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules + documentation_url: https://docs.github.com/rest/deployments/protection-rules#get-all-deployment-protection-rules-for-an-environment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules + documentation_url: https://docs.github.com/rest/deployments/protection-rules#create-a-custom-deployment-protection-rule-on-an-environment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps + documentation_url: https://docs.github.com/rest/deployments/protection-rules#list-custom-deployment-rule-integrations-available-for-an-environment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id} + documentation_url: https://docs.github.com/rest/deployments/protection-rules#disable-a-custom-protection-rule-for-an-environment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id} + documentation_url: https://docs.github.com/rest/deployments/protection-rules#get-a-custom-deployment-protection-rule + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/events + documentation_url: https://docs.github.com/rest/activity/events#list-repository-events + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/forks + documentation_url: https://docs.github.com/rest/repos/forks#list-forks + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/forks + documentation_url: https://docs.github.com/rest/repos/forks#create-a-fork + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/git/blobs + documentation_url: https://docs.github.com/rest/git/blobs#create-a-blob + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/git/blobs/{file_sha} + documentation_url: https://docs.github.com/rest/git/blobs#get-a-blob + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/git/commits + documentation_url: https://docs.github.com/rest/git/commits#create-a-commit + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/git/commits/{commit_sha} + documentation_url: https://docs.github.com/rest/git/commits#get-a-commit-object + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/git/matching-refs/{ref} + documentation_url: https://docs.github.com/rest/git/refs#list-matching-references + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/git/ref/{ref} + documentation_url: https://docs.github.com/rest/git/refs#get-a-reference + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/git/refs + documentation_url: https://docs.github.com/rest/git/refs#create-a-reference + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/git/refs/{ref} + documentation_url: https://docs.github.com/rest/git/refs#delete-a-reference + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /repos/{owner}/{repo}/git/refs/{ref} + documentation_url: https://docs.github.com/rest/git/refs#update-a-reference + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/git/tags + documentation_url: https://docs.github.com/rest/git/tags#create-a-tag-object + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/git/tags/{tag_sha} + documentation_url: https://docs.github.com/rest/git/tags#get-a-tag + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/git/trees + documentation_url: https://docs.github.com/rest/git/trees#create-a-tree + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/git/trees/{tree_sha} + documentation_url: https://docs.github.com/rest/git/trees#get-a-tree + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/hooks + documentation_url: https://docs.github.com/rest/webhooks/repos#list-repository-webhooks + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/hooks + documentation_url: https://docs.github.com/rest/webhooks/repos#create-a-repository-webhook + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/hooks/{hook_id} + documentation_url: https://docs.github.com/rest/webhooks/repos#delete-a-repository-webhook + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/hooks/{hook_id} + documentation_url: https://docs.github.com/rest/webhooks/repos#get-a-repository-webhook + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /repos/{owner}/{repo}/hooks/{hook_id} + documentation_url: https://docs.github.com/rest/webhooks/repos#update-a-repository-webhook + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/hooks/{hook_id}/config + documentation_url: https://docs.github.com/rest/webhooks/repo-config#get-a-webhook-configuration-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config + documentation_url: https://docs.github.com/rest/webhooks/repo-config#update-a-webhook-configuration-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries + documentation_url: https://docs.github.com/rest/webhooks/repo-deliveries#list-deliveries-for-a-repository-webhook + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id} + documentation_url: https://docs.github.com/rest/webhooks/repo-deliveries#get-a-delivery-for-a-repository-webhook + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts + documentation_url: https://docs.github.com/rest/webhooks/repo-deliveries#redeliver-a-delivery-for-a-repository-webhook + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/hooks/{hook_id}/pings + documentation_url: https://docs.github.com/rest/webhooks/repos#ping-a-repository-webhook + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/hooks/{hook_id}/tests + documentation_url: https://docs.github.com/rest/webhooks/repos#test-the-push-repository-webhook + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/import + documentation_url: https://docs.github.com/rest/migrations/source-imports#cancel-an-import + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/import + documentation_url: https://docs.github.com/rest/migrations/source-imports#get-an-import-status + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PATCH /repos/{owner}/{repo}/import + documentation_url: https://docs.github.com/rest/migrations/source-imports#update-an-import + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PUT /repos/{owner}/{repo}/import + documentation_url: https://docs.github.com/rest/migrations/source-imports#start-an-import + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/import/authors + documentation_url: https://docs.github.com/rest/migrations/source-imports#get-commit-authors + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PATCH /repos/{owner}/{repo}/import/authors/{author_id} + documentation_url: https://docs.github.com/rest/migrations/source-imports#map-a-commit-author + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/import/large_files + documentation_url: https://docs.github.com/rest/migrations/source-imports#get-large-files + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PATCH /repos/{owner}/{repo}/import/lfs + documentation_url: https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/installation + documentation_url: https://docs.github.com/rest/apps/apps#get-a-repository-installation-for-the-authenticated-app + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/interaction-limits + documentation_url: https://docs.github.com/rest/interactions/repos#remove-interaction-restrictions-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/interaction-limits + documentation_url: https://docs.github.com/rest/interactions/repos#get-interaction-restrictions-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PUT /repos/{owner}/{repo}/interaction-limits + documentation_url: https://docs.github.com/rest/interactions/repos#set-interaction-restrictions-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/invitations + documentation_url: https://docs.github.com/rest/collaborators/invitations#list-repository-invitations + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/invitations/{invitation_id} + documentation_url: https://docs.github.com/rest/collaborators/invitations#delete-a-repository-invitation + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /repos/{owner}/{repo}/invitations/{invitation_id} + documentation_url: https://docs.github.com/rest/collaborators/invitations#update-a-repository-invitation + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/issues + documentation_url: https://docs.github.com/rest/issues/issues#list-repository-issues + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/issues + documentation_url: https://docs.github.com/rest/issues/issues#create-an-issue + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/issues/comments + documentation_url: https://docs.github.com/rest/issues/comments#list-issue-comments-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/issues/comments/{comment_id} + documentation_url: https://docs.github.com/rest/issues/comments#delete-an-issue-comment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/issues/comments/{comment_id} + documentation_url: https://docs.github.com/rest/issues/comments#get-an-issue-comment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /repos/{owner}/{repo}/issues/comments/{comment_id} + documentation_url: https://docs.github.com/rest/issues/comments#update-an-issue-comment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions + documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue-comment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions + documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue-comment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id} + documentation_url: https://docs.github.com/rest/reactions/reactions#delete-an-issue-comment-reaction + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/issues/events + documentation_url: https://docs.github.com/rest/issues/events#list-issue-events-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/issues/events/{event_id} + documentation_url: https://docs.github.com/rest/issues/events#get-an-issue-event + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/issues/{issue_number} + documentation_url: https://docs.github.com/rest/issues/issues#get-an-issue + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /repos/{owner}/{repo}/issues/{issue_number} + documentation_url: https://docs.github.com/rest/issues/issues#update-an-issue + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees + documentation_url: https://docs.github.com/rest/issues/assignees#remove-assignees-from-an-issue + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/issues/{issue_number}/assignees + documentation_url: https://docs.github.com/rest/issues/assignees#add-assignees-to-an-issue + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee} + documentation_url: https://docs.github.com/rest/issues/assignees#check-if-a-user-can-be-assigned-to-a-issue + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/issues/{issue_number}/comments + documentation_url: https://docs.github.com/rest/issues/comments#list-issue-comments + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/issues/{issue_number}/comments + documentation_url: https://docs.github.com/rest/issues/comments#create-an-issue-comment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/issues/{issue_number}/events + documentation_url: https://docs.github.com/rest/issues/events#list-issue-events + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels + documentation_url: https://docs.github.com/rest/issues/labels#remove-all-labels-from-an-issue + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/issues/{issue_number}/labels + documentation_url: https://docs.github.com/rest/issues/labels#list-labels-for-an-issue + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/issues/{issue_number}/labels + documentation_url: https://docs.github.com/rest/issues/labels#add-labels-to-an-issue + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /repos/{owner}/{repo}/issues/{issue_number}/labels + documentation_url: https://docs.github.com/rest/issues/labels#set-labels-for-an-issue + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name} + documentation_url: https://docs.github.com/rest/issues/labels#remove-a-label-from-an-issue + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock + documentation_url: https://docs.github.com/rest/issues/issues#unlock-an-issue + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /repos/{owner}/{repo}/issues/{issue_number}/lock + documentation_url: https://docs.github.com/rest/issues/issues#lock-an-issue + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/issues/{issue_number}/reactions + documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/issues/{issue_number}/reactions + documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id} + documentation_url: https://docs.github.com/rest/reactions/reactions#delete-an-issue-reaction + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/issues/{issue_number}/timeline + documentation_url: https://docs.github.com/rest/issues/timeline#list-timeline-events-for-an-issue + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/keys + documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#list-deploy-keys + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/keys + documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#create-a-deploy-key + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/keys/{key_id} + documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#delete-a-deploy-key + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/keys/{key_id} + documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#get-a-deploy-key + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/labels + documentation_url: https://docs.github.com/rest/issues/labels#list-labels-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/labels + documentation_url: https://docs.github.com/rest/issues/labels#create-a-label + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/labels/{name} + documentation_url: https://docs.github.com/rest/issues/labels#delete-a-label + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/labels/{name} + documentation_url: https://docs.github.com/rest/issues/labels#get-a-label + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /repos/{owner}/{repo}/labels/{name} + documentation_url: https://docs.github.com/rest/issues/labels#update-a-label + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/languages + documentation_url: https://docs.github.com/rest/repos/repos#list-repository-languages + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/lfs + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/repos/lfs#disable-git-lfs-for-a-repository + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /repos/{owner}/{repo}/lfs + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/repos/lfs#enable-git-lfs-for-a-repository + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/license + documentation_url: https://docs.github.com/rest/licenses/licenses#get-the-license-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/merge-upstream + documentation_url: https://docs.github.com/rest/branches/branches#sync-a-fork-branch-with-the-upstream-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/merges + documentation_url: https://docs.github.com/rest/branches/branches#merge-a-branch + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/milestones + documentation_url: https://docs.github.com/rest/issues/milestones#list-milestones + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/milestones + documentation_url: https://docs.github.com/rest/issues/milestones#create-a-milestone + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/milestones/{milestone_number} + documentation_url: https://docs.github.com/rest/issues/milestones#delete-a-milestone + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/milestones/{milestone_number} + documentation_url: https://docs.github.com/rest/issues/milestones#get-a-milestone + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /repos/{owner}/{repo}/milestones/{milestone_number} + documentation_url: https://docs.github.com/rest/issues/milestones#update-a-milestone + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels + documentation_url: https://docs.github.com/rest/issues/labels#list-labels-for-issues-in-a-milestone + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/notifications + documentation_url: https://docs.github.com/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /repos/{owner}/{repo}/notifications + documentation_url: https://docs.github.com/rest/activity/notifications#mark-repository-notifications-as-read + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/pages + documentation_url: https://docs.github.com/rest/pages/pages#delete-a-apiname-pages-site + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/pages + documentation_url: https://docs.github.com/rest/pages/pages#get-a-apiname-pages-site + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/pages + documentation_url: https://docs.github.com/rest/pages/pages#create-a-apiname-pages-site + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /repos/{owner}/{repo}/pages + documentation_url: https://docs.github.com/rest/pages/pages#update-information-about-a-apiname-pages-site + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/pages/builds + documentation_url: https://docs.github.com/rest/pages/pages#list-apiname-pages-builds + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/pages/builds + documentation_url: https://docs.github.com/rest/pages/pages#request-a-apiname-pages-build + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/pages/builds/latest + documentation_url: https://docs.github.com/rest/pages/pages#get-latest-pages-build + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/pages/builds/{build_id} + documentation_url: https://docs.github.com/rest/pages/pages#get-apiname-pages-build + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/pages/deployment + documentation_url: https://docs.github.com/rest/pages/pages#create-a-github-pages-deployment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/pages/health + documentation_url: https://docs.github.com/rest/pages/pages#get-a-dns-health-check-for-github-pages + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/pre-receive-hooks + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/private-vulnerability-reporting + documentation_url: https://docs.github.com/rest/repos/repos#disable-private-vulnerability-reporting-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PUT /repos/{owner}/{repo}/private-vulnerability-reporting + documentation_url: https://docs.github.com/rest/repos/repos#enable-private-vulnerability-reporting-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/projects + documentation_url: https://docs.github.com/rest/projects/projects#list-repository-projects + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/projects + documentation_url: https://docs.github.com/rest/projects/projects#create-a-repository-project + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/properties/values + documentation_url: https://docs.github.com/rest/repos/properties#get-all-custom-property-values-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/pulls + documentation_url: https://docs.github.com/rest/pulls/pulls#list-pull-requests + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/pulls + documentation_url: https://docs.github.com/rest/pulls/pulls#create-a-pull-request + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/pulls/comments + documentation_url: https://docs.github.com/rest/pulls/comments#list-review-comments-in-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id} + documentation_url: https://docs.github.com/rest/pulls/comments#delete-a-review-comment-for-a-pull-request + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/pulls/comments/{comment_id} + documentation_url: https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id} + documentation_url: https://docs.github.com/rest/pulls/comments#update-a-review-comment-for-a-pull-request + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions + documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-pull-request-review-comment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions + documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-pull-request-review-comment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id} + documentation_url: https://docs.github.com/rest/reactions/reactions#delete-a-pull-request-comment-reaction + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/pulls/{pull_number} + documentation_url: https://docs.github.com/rest/pulls/pulls#get-a-pull-request + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /repos/{owner}/{repo}/pulls/{pull_number} + documentation_url: https://docs.github.com/rest/pulls/pulls#update-a-pull-request + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces + documentation_url: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-from-a-pull-request + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/comments + documentation_url: https://docs.github.com/rest/pulls/comments#list-review-comments-on-a-pull-request + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/comments + documentation_url: https://docs.github.com/rest/pulls/comments#create-a-review-comment-for-a-pull-request + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies + documentation_url: https://docs.github.com/rest/pulls/comments#create-a-reply-for-a-review-comment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/commits + documentation_url: https://docs.github.com/rest/pulls/pulls#list-commits-on-a-pull-request + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/files + documentation_url: https://docs.github.com/rest/pulls/pulls#list-pull-requests-files + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/merge + documentation_url: https://docs.github.com/rest/pulls/pulls#check-if-a-pull-request-has-been-merged + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge + documentation_url: https://docs.github.com/rest/pulls/pulls#merge-a-pull-request + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers + documentation_url: https://docs.github.com/rest/pulls/review-requests#remove-requested-reviewers-from-a-pull-request + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers + documentation_url: https://docs.github.com/rest/pulls/review-requests#get-all-requested-reviewers-for-a-pull-request + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers + documentation_url: https://docs.github.com/rest/pulls/review-requests#request-reviewers-for-a-pull-request + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews + documentation_url: https://docs.github.com/rest/pulls/reviews#list-reviews-for-a-pull-request + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews + documentation_url: https://docs.github.com/rest/pulls/reviews#create-a-review-for-a-pull-request + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} + documentation_url: https://docs.github.com/rest/pulls/reviews#delete-a-pending-review-for-a-pull-request + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} + documentation_url: https://docs.github.com/rest/pulls/reviews#get-a-review-for-a-pull-request + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} + documentation_url: https://docs.github.com/rest/pulls/reviews#update-a-review-for-a-pull-request + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments + documentation_url: https://docs.github.com/rest/pulls/reviews#list-comments-for-a-pull-request-review + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals + documentation_url: https://docs.github.com/rest/pulls/reviews#dismiss-a-review-for-a-pull-request + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events + documentation_url: https://docs.github.com/rest/pulls/reviews#submit-a-review-for-a-pull-request + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch + documentation_url: https://docs.github.com/rest/pulls/pulls#update-a-pull-request-branch + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/readme + documentation_url: https://docs.github.com/rest/repos/contents#get-a-repository-readme + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/readme/{dir} + documentation_url: https://docs.github.com/rest/repos/contents#get-a-repository-readme-for-a-directory + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/releases + documentation_url: https://docs.github.com/rest/releases/releases#list-releases + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/releases + documentation_url: https://docs.github.com/rest/releases/releases#create-a-release + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/releases/assets/{asset_id} + documentation_url: https://docs.github.com/rest/releases/assets#delete-a-release-asset + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/releases/assets/{asset_id} + documentation_url: https://docs.github.com/rest/releases/assets#get-a-release-asset + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /repos/{owner}/{repo}/releases/assets/{asset_id} + documentation_url: https://docs.github.com/rest/releases/assets#update-a-release-asset + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/releases/generate-notes + documentation_url: https://docs.github.com/rest/releases/releases#generate-release-notes-content-for-a-release + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/releases/latest + documentation_url: https://docs.github.com/rest/releases/releases#get-the-latest-release + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/releases/tags/{tag} + documentation_url: https://docs.github.com/rest/releases/releases#get-a-release-by-tag-name + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/releases/{release_id} + documentation_url: https://docs.github.com/rest/releases/releases#delete-a-release + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/releases/{release_id} + documentation_url: https://docs.github.com/rest/releases/releases#get-a-release + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /repos/{owner}/{repo}/releases/{release_id} + documentation_url: https://docs.github.com/rest/releases/releases#update-a-release + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/releases/{release_id}/assets + documentation_url: https://docs.github.com/rest/releases/assets#list-release-assets + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/releases/{release_id}/assets + documentation_url: https://docs.github.com/rest/releases/assets#upload-a-release-asset + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/releases/{release_id}/reactions + documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-release + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/releases/{release_id}/reactions + documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-release + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id} + documentation_url: https://docs.github.com/rest/reactions/reactions#delete-a-release-reaction + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/replicas/caches + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/repos/repos#list-repository-cache-replication-status + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/rules/branches/{branch} + documentation_url: https://docs.github.com/rest/repos/rules#get-rules-for-a-branch + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/rulesets + documentation_url: https://docs.github.com/rest/repos/rules#get-all-repository-rulesets + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: POST /repos/{owner}/{repo}/rulesets + documentation_url: https://docs.github.com/rest/repos/rules#create-a-repository-ruleset + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/rulesets/rule-suites + documentation_url: https://docs.github.com/rest/repos/rule-suites#list-repository-rule-suites + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id} + documentation_url: https://docs.github.com/rest/repos/rule-suites#get-a-repository-rule-suite + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id} + documentation_url: https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/rulesets/{ruleset_id} + documentation_url: https://docs.github.com/rest/repos/rules#get-a-repository-ruleset + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PUT /repos/{owner}/{repo}/rulesets/{ruleset_id} + documentation_url: https://docs.github.com/rest/repos/rules#update-a-repository-ruleset + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/secret-scanning/alerts + documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} + documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#get-a-secret-scanning-alert + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} + documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#update-a-secret-scanning-alert + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations + documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-locations-for-a-secret-scanning-alert + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/security-advisories + documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: POST /repos/{owner}/{repo}/security-advisories + documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#create-a-repository-security-advisory + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: POST /repos/{owner}/{repo}/security-advisories/reports + documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#privately-report-a-security-vulnerability + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/security-advisories/{ghsa_id} + documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#get-a-repository-security-advisory + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id} + documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#update-a-repository-security-advisory + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve + documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#request-a-cve-for-a-repository-security-advisory + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/stargazers + documentation_url: https://docs.github.com/rest/activity/starring#list-stargazers + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/stats/code_frequency + documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-activity + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/stats/commit_activity + documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-last-year-of-commit-activity + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/stats/contributors + documentation_url: https://docs.github.com/rest/metrics/statistics#get-all-contributor-commit-activity + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/stats/participation + documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-count + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/stats/punch_card + documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-hourly-commit-count-for-each-day + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/statuses/{sha} + documentation_url: https://docs.github.com/rest/commits/statuses#create-a-commit-status + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/subscribers + documentation_url: https://docs.github.com/rest/activity/watching#list-watchers + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/subscription + documentation_url: https://docs.github.com/rest/activity/watching#delete-a-repository-subscription + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/subscription + documentation_url: https://docs.github.com/rest/activity/watching#get-a-repository-subscription + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /repos/{owner}/{repo}/subscription + documentation_url: https://docs.github.com/rest/activity/watching#set-a-repository-subscription + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/tags + documentation_url: https://docs.github.com/rest/repos/repos#list-repository-tags + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/tags/protection + documentation_url: https://docs.github.com/rest/repos/tags#list-tag-protection-states-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{owner}/{repo}/tags/protection + documentation_url: https://docs.github.com/rest/repos/tags#create-a-tag-protection-state-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id} + documentation_url: https://docs.github.com/rest/repos/tags#delete-a-tag-protection-state-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/tarball/{ref} + documentation_url: https://docs.github.com/rest/repos/contents#download-a-repository-archive-tar + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/teams + documentation_url: https://docs.github.com/rest/repos/repos#list-repository-teams + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/topics + documentation_url: https://docs.github.com/rest/repos/repos#get-all-repository-topics + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /repos/{owner}/{repo}/topics + documentation_url: https://docs.github.com/rest/repos/repos#replace-all-repository-topics + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/traffic/clones + documentation_url: https://docs.github.com/rest/metrics/traffic#get-repository-clones + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/traffic/popular/paths + documentation_url: https://docs.github.com/rest/metrics/traffic#get-top-referral-paths + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/traffic/popular/referrers + documentation_url: https://docs.github.com/rest/metrics/traffic#get-top-referral-sources + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/traffic/views + documentation_url: https://docs.github.com/rest/metrics/traffic#get-page-views + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: POST /repos/{owner}/{repo}/transfer + documentation_url: https://docs.github.com/rest/repos/repos#transfer-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/vulnerability-alerts + documentation_url: https://docs.github.com/rest/repos/repos#disable-vulnerability-alerts + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/vulnerability-alerts + documentation_url: https://docs.github.com/rest/repos/repos#check-if-vulnerability-alerts-are-enabled-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /repos/{owner}/{repo}/vulnerability-alerts + documentation_url: https://docs.github.com/rest/repos/repos#enable-vulnerability-alerts + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/zipball/{ref} + documentation_url: https://docs.github.com/rest/repos/contents#download-a-repository-archive-zip + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repos/{template_owner}/{template_repo}/generate + documentation_url: https://docs.github.com/rest/repos/repos#create-a-repository-using-a-template + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repositories + documentation_url: https://docs.github.com/rest/repos/repos#list-public-repositories + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repositories/{repository_id}/environments/{environment_name}/secrets + documentation_url: https://docs.github.com/rest/actions/secrets#list-environment-secrets + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key + documentation_url: https://docs.github.com/rest/actions/secrets#get-an-environment-public-key + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/actions/secrets#delete-an-environment-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/actions/secrets#get-an-environment-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/actions/secrets#create-or-update-an-environment-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repositories/{repository_id}/environments/{environment_name}/variables + documentation_url: https://docs.github.com/rest/actions/variables#list-environment-variables + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /repositories/{repository_id}/environments/{environment_name}/variables + documentation_url: https://docs.github.com/rest/actions/variables#create-an-environment-variable + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{name} + documentation_url: https://docs.github.com/rest/actions/variables#delete-an-environment-variable + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repositories/{repository_id}/environments/{environment_name}/variables/{name} + documentation_url: https://docs.github.com/rest/actions/variables#get-an-environment-variable + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{name} + documentation_url: https://docs.github.com/rest/actions/variables#update-an-environment-variable + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /scim/v2/Groups + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#list-provisioned-scim-groups-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /scim/v2/Groups + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#provision-a-scim-enterprise-group + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /scim/v2/Groups/{scim_group_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#delete-a-scim-group-from-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /scim/v2/Groups/{scim_group_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-group + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /scim/v2/Groups/{scim_group_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#update-an-attribute-for-a-scim-enterprise-group + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /scim/v2/Groups/{scim_group_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#set-scim-information-for-a-provisioned-enterprise-group + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /scim/v2/Users + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#list-scim-provisioned-identities-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /scim/v2/Users + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#provision-a-scim-enterprise-user + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /scim/v2/Users/{scim_user_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#delete-a-scim-user-from-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /scim/v2/Users/{scim_user_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-user + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /scim/v2/Users/{scim_user_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#update-an-attribute-for-a-scim-enterprise-user + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /scim/v2/Users/{scim_user_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#set-scim-information-for-a-provisioned-enterprise-user + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /scim/v2/organizations/{org}/Users + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#list-scim-provisioned-identities + openapi_files: + - descriptions/ghec/ghec.json + - name: POST /scim/v2/organizations/{org}/Users + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#provision-and-invite-a-scim-user + openapi_files: + - descriptions/ghec/ghec.json + - name: DELETE /scim/v2/organizations/{org}/Users/{scim_user_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#delete-a-scim-user-from-an-organization + openapi_files: + - descriptions/ghec/ghec.json + - name: GET /scim/v2/organizations/{org}/Users/{scim_user_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#get-scim-provisioning-information-for-a-user + openapi_files: + - descriptions/ghec/ghec.json + - name: PATCH /scim/v2/organizations/{org}/Users/{scim_user_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#update-an-attribute-for-a-scim-user + openapi_files: + - descriptions/ghec/ghec.json + - name: PUT /scim/v2/organizations/{org}/Users/{scim_user_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#update-a-provisioned-organization-membership + openapi_files: + - descriptions/ghec/ghec.json + - name: GET /search/code + documentation_url: https://docs.github.com/rest/search/search#search-code + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /search/commits + documentation_url: https://docs.github.com/rest/search/search#search-commits + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /search/issues + documentation_url: https://docs.github.com/rest/search/search#search-issues-and-pull-requests + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /search/labels + documentation_url: https://docs.github.com/rest/search/search#search-labels + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /search/repositories + documentation_url: https://docs.github.com/rest/search/search#search-repositories + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /search/topics + documentation_url: https://docs.github.com/rest/search/search#search-topics + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /search/users + documentation_url: https://docs.github.com/rest/search/search#search-users + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /setup/api/configcheck + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#get-the-configuration-status + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /setup/api/configure + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#start-a-configuration-process + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /setup/api/maintenance + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#get-the-maintenance-status + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /setup/api/maintenance + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#enable-or-disable-maintenance-mode + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /setup/api/settings + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#get-settings + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /setup/api/settings + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#set-settings + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /setup/api/settings/authorized-keys + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#remove-an-authorized-ssh-key + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /setup/api/settings/authorized-keys + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#get-all-authorized-ssh-keys + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /setup/api/settings/authorized-keys + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#add-an-authorized-ssh-key + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /setup/api/start + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#create-a-github-license + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /setup/api/upgrade + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#upgrade-a-license + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /teams/{team_id} + documentation_url: https://docs.github.com/rest/teams/teams#delete-a-team-legacy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /teams/{team_id} + documentation_url: https://docs.github.com/rest/teams/teams#get-a-team-legacy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /teams/{team_id} + documentation_url: https://docs.github.com/rest/teams/teams#update-a-team-legacy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /teams/{team_id}/discussions + documentation_url: https://docs.github.com/rest/teams/discussions#list-discussions-legacy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /teams/{team_id}/discussions + documentation_url: https://docs.github.com/rest/teams/discussions#create-a-discussion-legacy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /teams/{team_id}/discussions/{discussion_number} + documentation_url: https://docs.github.com/rest/teams/discussions#delete-a-discussion-legacy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /teams/{team_id}/discussions/{discussion_number} + documentation_url: https://docs.github.com/rest/teams/discussions#get-a-discussion-legacy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /teams/{team_id}/discussions/{discussion_number} + documentation_url: https://docs.github.com/rest/teams/discussions#update-a-discussion-legacy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /teams/{team_id}/discussions/{discussion_number}/comments + documentation_url: https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments-legacy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /teams/{team_id}/discussions/{discussion_number}/comments + documentation_url: https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment-legacy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} + documentation_url: https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment-legacy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} + documentation_url: https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment-legacy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} + documentation_url: https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment-legacy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions + documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment-legacy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions + documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment-legacy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /teams/{team_id}/discussions/{discussion_number}/reactions + documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-legacy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /teams/{team_id}/discussions/{discussion_number}/reactions + documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-legacy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /teams/{team_id}/invitations + documentation_url: https://docs.github.com/rest/teams/members#list-pending-team-invitations-legacy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /teams/{team_id}/members + documentation_url: https://docs.github.com/rest/teams/members#list-team-members-legacy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /teams/{team_id}/members/{username} + documentation_url: https://docs.github.com/rest/teams/members#remove-team-member-legacy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /teams/{team_id}/members/{username} + documentation_url: https://docs.github.com/rest/teams/members#get-team-member-legacy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /teams/{team_id}/members/{username} + documentation_url: https://docs.github.com/rest/teams/members#add-team-member-legacy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /teams/{team_id}/memberships/{username} + documentation_url: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user-legacy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /teams/{team_id}/memberships/{username} + documentation_url: https://docs.github.com/rest/teams/members#get-team-membership-for-a-user-legacy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /teams/{team_id}/memberships/{username} + documentation_url: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user-legacy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /teams/{team_id}/projects + documentation_url: https://docs.github.com/rest/teams/teams#list-team-projects-legacy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /teams/{team_id}/projects/{project_id} + documentation_url: https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team-legacy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /teams/{team_id}/projects/{project_id} + documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project-legacy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /teams/{team_id}/projects/{project_id} + documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions-legacy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /teams/{team_id}/repos + documentation_url: https://docs.github.com/rest/teams/teams#list-team-repositories-legacy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /teams/{team_id}/repos/{owner}/{repo} + documentation_url: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team-legacy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /teams/{team_id}/repos/{owner}/{repo} + documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository-legacy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /teams/{team_id}/repos/{owner}/{repo} + documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions-legacy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /teams/{team_id}/team-sync/group-mappings + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#list-idp-groups-for-a-team-legacy + openapi_files: + - descriptions/ghec/ghec.json + - name: PATCH /teams/{team_id}/team-sync/group-mappings + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#create-or-update-idp-group-connections-legacy + openapi_files: + - descriptions/ghec/ghec.json + - name: GET /teams/{team_id}/teams + documentation_url: https://docs.github.com/rest/teams/teams#list-child-teams-legacy + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /user + documentation_url: https://docs.github.com/rest/users/users#get-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /user + documentation_url: https://docs.github.com/rest/users/users#update-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /user/blocks + documentation_url: https://docs.github.com/rest/users/blocking#list-users-blocked-by-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /user/blocks/{username} + documentation_url: https://docs.github.com/rest/users/blocking#unblock-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /user/blocks/{username} + documentation_url: https://docs.github.com/rest/users/blocking#check-if-a-user-is-blocked-by-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PUT /user/blocks/{username} + documentation_url: https://docs.github.com/rest/users/blocking#block-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /user/codespaces + documentation_url: https://docs.github.com/rest/codespaces/codespaces#list-codespaces-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: POST /user/codespaces + documentation_url: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /user/codespaces/secrets + documentation_url: https://docs.github.com/rest/codespaces/secrets#list-secrets-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /user/codespaces/secrets/public-key + documentation_url: https://docs.github.com/rest/codespaces/secrets#get-public-key-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /user/codespaces/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/codespaces/secrets#delete-a-secret-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /user/codespaces/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/codespaces/secrets#get-a-secret-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PUT /user/codespaces/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/codespaces/secrets#create-or-update-a-secret-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /user/codespaces/secrets/{secret_name}/repositories + documentation_url: https://docs.github.com/rest/codespaces/secrets#list-selected-repositories-for-a-user-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PUT /user/codespaces/secrets/{secret_name}/repositories + documentation_url: https://docs.github.com/rest/codespaces/secrets#set-selected-repositories-for-a-user-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id} + documentation_url: https://docs.github.com/rest/codespaces/secrets#remove-a-selected-repository-from-a-user-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id} + documentation_url: https://docs.github.com/rest/codespaces/secrets#add-a-selected-repository-to-a-user-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /user/codespaces/{codespace_name} + documentation_url: https://docs.github.com/rest/codespaces/codespaces#delete-a-codespace-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /user/codespaces/{codespace_name} + documentation_url: https://docs.github.com/rest/codespaces/codespaces#get-a-codespace-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PATCH /user/codespaces/{codespace_name} + documentation_url: https://docs.github.com/rest/codespaces/codespaces#update-a-codespace-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: POST /user/codespaces/{codespace_name}/exports + documentation_url: https://docs.github.com/rest/codespaces/codespaces#export-a-codespace-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /user/codespaces/{codespace_name}/exports/{export_id} + documentation_url: https://docs.github.com/rest/codespaces/codespaces#get-details-about-a-codespace-export + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /user/codespaces/{codespace_name}/machines + documentation_url: https://docs.github.com/rest/codespaces/machines#list-machine-types-for-a-codespace + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: POST /user/codespaces/{codespace_name}/publish + documentation_url: https://docs.github.com/rest/codespaces/codespaces#create-a-repository-from-an-unpublished-codespace + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: POST /user/codespaces/{codespace_name}/start + documentation_url: https://docs.github.com/rest/codespaces/codespaces#start-a-codespace-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: POST /user/codespaces/{codespace_name}/stop + documentation_url: https://docs.github.com/rest/codespaces/codespaces#stop-a-codespace-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /user/docker/conflicts + documentation_url: https://docs.github.com/rest/packages/packages#get-list-of-conflicting-packages-during-docker-migration-for-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /user/email/visibility + documentation_url: https://docs.github.com/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /user/emails + documentation_url: https://docs.github.com/rest/users/emails#delete-an-email-address-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /user/emails + documentation_url: https://docs.github.com/rest/users/emails#list-email-addresses-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /user/emails + documentation_url: https://docs.github.com/rest/users/emails#add-an-email-address-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /user/followers + documentation_url: https://docs.github.com/rest/users/followers#list-followers-of-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /user/following + documentation_url: https://docs.github.com/rest/users/followers#list-the-people-the-authenticated-user-follows + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /user/following/{username} + documentation_url: https://docs.github.com/rest/users/followers#unfollow-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /user/following/{username} + documentation_url: https://docs.github.com/rest/users/followers#check-if-a-person-is-followed-by-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /user/following/{username} + documentation_url: https://docs.github.com/rest/users/followers#follow-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /user/gpg_keys + documentation_url: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /user/gpg_keys + documentation_url: https://docs.github.com/rest/users/gpg-keys#create-a-gpg-key-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /user/gpg_keys/{gpg_key_id} + documentation_url: https://docs.github.com/rest/users/gpg-keys#delete-a-gpg-key-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /user/gpg_keys/{gpg_key_id} + documentation_url: https://docs.github.com/rest/users/gpg-keys#get-a-gpg-key-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /user/installations + documentation_url: https://docs.github.com/rest/apps/installations#list-app-installations-accessible-to-the-user-access-token + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /user/installations/{installation_id}/repositories + documentation_url: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-user-access-token + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /user/installations/{installation_id}/repositories/{repository_id} + documentation_url: https://docs.github.com/rest/apps/installations#remove-a-repository-from-an-app-installation + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /user/installations/{installation_id}/repositories/{repository_id} + documentation_url: https://docs.github.com/rest/apps/installations#add-a-repository-to-an-app-installation + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /user/interaction-limits + documentation_url: https://docs.github.com/rest/interactions/user#remove-interaction-restrictions-from-your-public-repositories + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /user/interaction-limits + documentation_url: https://docs.github.com/rest/interactions/user#get-interaction-restrictions-for-your-public-repositories + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PUT /user/interaction-limits + documentation_url: https://docs.github.com/rest/interactions/user#set-interaction-restrictions-for-your-public-repositories + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /user/issues + documentation_url: https://docs.github.com/rest/issues/issues#list-user-account-issues-assigned-to-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /user/keys + documentation_url: https://docs.github.com/rest/users/keys#list-public-ssh-keys-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /user/keys + documentation_url: https://docs.github.com/rest/users/keys#create-a-public-ssh-key-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /user/keys/{key_id} + documentation_url: https://docs.github.com/rest/users/keys#delete-a-public-ssh-key-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /user/keys/{key_id} + documentation_url: https://docs.github.com/rest/users/keys#get-a-public-ssh-key-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /user/marketplace_purchases + documentation_url: https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /user/marketplace_purchases/stubbed + documentation_url: https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user-stubbed + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /user/memberships/orgs + documentation_url: https://docs.github.com/rest/orgs/members#list-organization-memberships-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /user/memberships/orgs/{org} + documentation_url: https://docs.github.com/rest/orgs/members#get-an-organization-membership-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /user/memberships/orgs/{org} + documentation_url: https://docs.github.com/rest/orgs/members#update-an-organization-membership-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /user/migrations + documentation_url: https://docs.github.com/rest/migrations/users#list-user-migrations + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /user/migrations + documentation_url: https://docs.github.com/rest/migrations/users#start-a-user-migration + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /user/migrations/{migration_id} + documentation_url: https://docs.github.com/rest/migrations/users#get-a-user-migration-status + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /user/migrations/{migration_id}/archive + documentation_url: https://docs.github.com/rest/migrations/users#delete-a-user-migration-archive + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /user/migrations/{migration_id}/archive + documentation_url: https://docs.github.com/rest/migrations/users#download-a-user-migration-archive + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock + documentation_url: https://docs.github.com/rest/migrations/users#unlock-a-user-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /user/migrations/{migration_id}/repositories + documentation_url: https://docs.github.com/rest/migrations/users#list-repositories-for-a-user-migration + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /user/orgs + documentation_url: https://docs.github.com/rest/orgs/orgs#list-organizations-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /user/packages + documentation_url: https://docs.github.com/rest/packages/packages#list-packages-for-the-authenticated-users-namespace + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /user/packages/{package_type}/{package_name} + documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /user/packages/{package_type}/{package_name} + documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /user/packages/{package_type}/{package_name}/restore + documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /user/packages/{package_type}/{package_name}/versions + documentation_url: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id} + documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-version-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /user/packages/{package_type}/{package_name}/versions/{package_version_id} + documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-version-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore + documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-version-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /user/projects + documentation_url: https://docs.github.com/rest/projects/projects#create-a-user-project + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /user/public_emails + documentation_url: https://docs.github.com/rest/users/emails#list-public-email-addresses-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /user/repos + documentation_url: https://docs.github.com/rest/repos/repos#list-repositories-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /user/repos + documentation_url: https://docs.github.com/rest/repos/repos#create-a-repository-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /user/repository_invitations + documentation_url: https://docs.github.com/rest/collaborators/invitations#list-repository-invitations-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /user/repository_invitations/{invitation_id} + documentation_url: https://docs.github.com/rest/collaborators/invitations#decline-a-repository-invitation + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /user/repository_invitations/{invitation_id} + documentation_url: https://docs.github.com/rest/collaborators/invitations#accept-a-repository-invitation + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /user/social_accounts + documentation_url: https://docs.github.com/rest/users/social-accounts#delete-social-accounts-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /user/social_accounts + documentation_url: https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /user/social_accounts + documentation_url: https://docs.github.com/rest/users/social-accounts#add-social-accounts-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /user/ssh_signing_keys + documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /user/ssh_signing_keys + documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#create-a-ssh-signing-key-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /user/ssh_signing_keys/{ssh_signing_key_id} + documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#delete-an-ssh-signing-key-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /user/ssh_signing_keys/{ssh_signing_key_id} + documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#get-an-ssh-signing-key-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /user/starred + documentation_url: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /user/starred/{owner}/{repo} + documentation_url: https://docs.github.com/rest/activity/starring#unstar-a-repository-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /user/starred/{owner}/{repo} + documentation_url: https://docs.github.com/rest/activity/starring#check-if-a-repository-is-starred-by-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /user/starred/{owner}/{repo} + documentation_url: https://docs.github.com/rest/activity/starring#star-a-repository-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /user/subscriptions + documentation_url: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /user/teams + documentation_url: https://docs.github.com/rest/teams/teams#list-teams-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /users + documentation_url: https://docs.github.com/rest/users/users#list-users + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /users/{username} + documentation_url: https://docs.github.com/rest/users/users#get-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /users/{username}/docker/conflicts + documentation_url: https://docs.github.com/rest/packages/packages#get-list-of-conflicting-packages-during-docker-migration-for-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /users/{username}/events + documentation_url: https://docs.github.com/rest/activity/events#list-events-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /users/{username}/events/orgs/{org} + documentation_url: https://docs.github.com/rest/activity/events#list-organization-events-for-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /users/{username}/events/public + documentation_url: https://docs.github.com/rest/activity/events#list-public-events-for-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /users/{username}/followers + documentation_url: https://docs.github.com/rest/users/followers#list-followers-of-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /users/{username}/following + documentation_url: https://docs.github.com/rest/users/followers#list-the-people-a-user-follows + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /users/{username}/following/{target_user} + documentation_url: https://docs.github.com/rest/users/followers#check-if-a-user-follows-another-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /users/{username}/gists + documentation_url: https://docs.github.com/rest/gists/gists#list-gists-for-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /users/{username}/gpg_keys + documentation_url: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /users/{username}/hovercard + documentation_url: https://docs.github.com/rest/users/users#get-contextual-information-for-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /users/{username}/installation + documentation_url: https://docs.github.com/rest/apps/apps#get-a-user-installation-for-the-authenticated-app + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /users/{username}/keys + documentation_url: https://docs.github.com/rest/users/keys#list-public-keys-for-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /users/{username}/orgs + documentation_url: https://docs.github.com/rest/orgs/orgs#list-organizations-for-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /users/{username}/packages + documentation_url: https://docs.github.com/rest/packages/packages#list-packages-for-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /users/{username}/packages/{package_type}/{package_name} + documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-for-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /users/{username}/packages/{package_type}/{package_name} + documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-for-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /users/{username}/packages/{package_type}/{package_name}/restore + documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-for-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /users/{username}/packages/{package_type}/{package_name}/versions + documentation_url: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id} + documentation_url: https://docs.github.com/rest/packages/packages#delete-package-version-for-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id} + documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-version-for-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore + documentation_url: https://docs.github.com/rest/packages/packages#restore-package-version-for-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /users/{username}/projects + documentation_url: https://docs.github.com/rest/projects/projects#list-user-projects + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /users/{username}/received_events + documentation_url: https://docs.github.com/rest/activity/events#list-events-received-by-the-authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /users/{username}/received_events/public + documentation_url: https://docs.github.com/rest/activity/events#list-public-events-received-by-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /users/{username}/repos + documentation_url: https://docs.github.com/rest/repos/repos#list-repositories-for-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /users/{username}/settings/billing/actions + documentation_url: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /users/{username}/settings/billing/packages + documentation_url: https://docs.github.com/rest/billing/billing#get-github-packages-billing-for-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /users/{username}/settings/billing/shared-storage + documentation_url: https://docs.github.com/rest/billing/billing#get-shared-storage-billing-for-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /users/{username}/site_admin + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#demote-a-site-administrator + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /users/{username}/site_admin + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /users/{username}/social_accounts + documentation_url: https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /users/{username}/ssh_signing_keys + documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /users/{username}/starred + documentation_url: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /users/{username}/subscriptions + documentation_url: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /users/{username}/suspended + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#unsuspend-a-user + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: PUT /users/{username}/suspended + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#suspend-a-user + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /versions + documentation_url: https://docs.github.com/rest/meta/meta#get-all-api-versions + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /zen + documentation_url: https://docs.github.com/rest/meta/meta#get-the-zen-of-github + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json diff --git a/script/lint.sh b/script/lint.sh index af5ae991006..b76758a47d4 100755 --- a/script/lint.sh +++ b/script/lint.sh @@ -1,5 +1,7 @@ #!/bin/sh -#/ script/lint.sh runs linters and validates generated files. +#/ [ CHECK_GITHUB_OPENAPI=1 ] script/lint.sh runs linters and validates generated files. +#/ When CHECK_GITHUB is set, it validates that openapi_operations.yaml is consistent with the +#/ descriptions from github.com/github/rest-api-description. set -e @@ -10,6 +12,13 @@ BIN="$(pwd -P)"/bin mkdir -p "$BIN" +EXIT_CODE=0 + +fail() { + echo "$@" + EXIT_CODE=1 +} + # install golangci-lint bin/golangci-lint doesn't exist with the correct version if ! "$BIN"/golangci-lint --version 2> /dev/null | grep -q "$GOLANGCI_LINT_VERSION"; then GOBIN="$BIN" go install "github.com/golangci/golangci-lint/cmd/golangci-lint@v$GOLANGCI_LINT_VERSION" @@ -28,11 +37,17 @@ for dir in $MOD_DIRS; do else "$BIN"/golangci-lint run --path-prefix "$dir" fi - ) || FAILED=1 + ) || fail "failed linting $dir" done -script/generate.sh --check || FAILED=1 - -if [ -n "$FAILED" ]; then - exit 1 +if [ -n "$CHECK_GITHUB_OPENAPI" ]; then + echo validating openapi_operations.yaml + script/metadata.sh update-openapi --validate || fail "failed validating openapi_operations.yaml" fi + +echo validating generated files +script/generate.sh --check || fail "failed validating generated files" + +[ -z "$FAILED" ] || exit 1 + +exit "$EXIT_CODE" diff --git a/script/metadata.sh b/script/metadata.sh new file mode 100755 index 00000000000..3b7c7fbeb8b --- /dev/null +++ b/script/metadata.sh @@ -0,0 +1,14 @@ +#!/bin/sh +#/ script/metadata.sh runs ./tools/metadata in the repository root with the given arguments + +set -e + +CDPATH="" cd -- "$(dirname -- "$0")/.." +REPO_DIR="$(pwd)" + +( + cd tools/metadata + go build -o "$REPO_DIR"/bin/metadata +) + +exec bin/metadata "$@" diff --git a/script/test.sh b/script/test.sh index 23e6a0c8f84..dedd832ecad 100755 --- a/script/test.sh +++ b/script/test.sh @@ -1,6 +1,8 @@ #!/bin/sh #/ script/test.sh runs tests on each go module in go-github. Arguments are passed to each go test invocation. #/ "-race -covermode atomic ./..." is used when no arguments are given. +#/ +#/ When UPDATE_GOLDEN is set, all directories named "golden" are removed before running tests. set -e @@ -10,6 +12,10 @@ if [ "$#" = "0" ]; then set -- -race -covermode atomic ./... fi +if [ -n "$UPDATE_GOLDEN" ]; then + find . -name golden -type d -exec rm -rf {} + +fi + MOD_DIRS="$(git ls-files '*go.mod' | xargs dirname | sort)" for dir in $MOD_DIRS; do diff --git a/tools/go.mod b/tools/go.mod new file mode 100644 index 00000000000..8085d1a1ce9 --- /dev/null +++ b/tools/go.mod @@ -0,0 +1,24 @@ +module tools + +go 1.20 + +require ( + github.com/alecthomas/kong v0.8.1 + github.com/getkin/kin-openapi v0.120.0 + github.com/google/go-cmp v0.6.0 + github.com/google/go-github/v56 v56.0.0 + golang.org/x/sync v0.4.0 + gopkg.in/yaml.v3 v3.0.1 +) + +require ( + github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/swag v0.22.4 // indirect + github.com/google/go-querystring v1.1.0 // indirect + github.com/invopop/yaml v0.2.0 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/mailru/easyjson v0.7.7 // indirect + github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect + github.com/perimeterx/marshmallow v1.1.5 // indirect + github.com/stretchr/testify v1.8.4 // indirect +) diff --git a/tools/go.sum b/tools/go.sum new file mode 100644 index 00000000000..46bc40af389 --- /dev/null +++ b/tools/go.sum @@ -0,0 +1,61 @@ +github.com/alecthomas/assert/v2 v2.1.0 h1:tbredtNcQnoSd3QBhQWI7QZ3XHOVkw1Moklp2ojoH/0= +github.com/alecthomas/kong v0.8.1 h1:acZdn3m4lLRobeh3Zi2S2EpnXTd1mOL6U7xVml+vfkY= +github.com/alecthomas/kong v0.8.1/go.mod h1:n1iCIO2xS46oE8ZfYCNDqdR0b0wZNrXAIAqro/2132U= +github.com/alecthomas/repr v0.1.0 h1:ENn2e1+J3k09gyj2shc0dHr/yjaWSHRlrJ4DPMevDqE= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/getkin/kin-openapi v0.120.0 h1:MqJcNJFrMDFNc07iwE8iFC5eT2k/NPUFDIpNeiZv8Jg= +github.com/getkin/kin-openapi v0.120.0/go.mod h1:PCWw/lfBrJY4HcdqE3jj+QFkaFK8ABoqo7PvqVhXXqw= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= +github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-github/v56 v56.0.0 h1:TysL7dMa/r7wsQi44BjqlwaHvwlFlqkK8CtBWCX3gb4= +github.com/google/go-github/v56 v56.0.0/go.mod h1:D8cdcX98YWJvi7TLo7zM4/h8ZTx6u6fwGEkCdisopo0= +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/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= +github.com/invopop/yaml v0.2.0 h1:7zky/qH+O0DwAyoobXUqvVBwgBFRxKoQ/3FjcVpjTMY= +github.com/invopop/yaml v0.2.0/go.mod h1:2XuRLgs/ouIrW3XNzuNj7J3Nvu/Dig5MXvbCEdiBN3Q= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= +github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s= +github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= +golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= +golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/tools/metadata/main.go b/tools/metadata/main.go new file mode 100644 index 00000000000..0b0562948f0 --- /dev/null +++ b/tools/metadata/main.go @@ -0,0 +1,194 @@ +// Copyright 2023 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. + +// metadata is a command-line tool used to check and update this repo. +// See CONTRIBUTING.md for details. +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + "path/filepath" + + "github.com/alecthomas/kong" + "github.com/google/go-github/v56/github" +) + +var helpVars = kong.Vars{ + "update_openapi_help": ` +Update openapi_operations.yaml from OpenAPI descriptions in github.com/github/rest-api-description at the given git ref. +`, + + "update_go_help": ` +Update go source code to be consistent with openapi_operations.yaml. + - Adds and updates "// GitHub API docs:" comments for service methods. + - Updates "//meta:operation" comments to use canonical operation names. + - Updates formatting of "//meta:operation" comments to make sure there isn't a space between the "//" and the "meta". + - Formats modified files with the equivalent of "go fmt". +`, + + "format_help": `Format whitespace in openapi_operations.yaml and sort its operations.`, + "unused_help": `List operations in openapi_operations.yaml that aren't used by any service methods.`, + + "working_dir_help": `Working directory. Should be the root of the go-github repository.`, + "openapi_ref_help": `Git ref to pull OpenAPI descriptions from.`, + + "openapi_validate_help": ` +Instead of updating, make sure that the operations in openapi_operations.yaml's "openapi_operations" field are +consistent with the sha listed in "openapi_commit". This is run in CI as a convenience so that reviewers can trust +changes to openapi_operations.yaml. +`, + + "output_json_help": `Output JSON.`, +} + +type rootCmd struct { + UpdateOpenAPI updateOpenAPICmd `kong:"cmd,name=update-openapi,help=${update_openapi_help}"` + UpdateGo updateGoCmd `kong:"cmd,help=${update_go_help}"` + Format formatCmd `kong:"cmd,help=${format_help}"` + Unused unusedCmd `kong:"cmd,help=${unused_help}"` + + WorkingDir string `kong:"short=C,default=.,help=${working_dir_help}"` + + // for testing + GithubURL string `kong:"hidden,default='https://api.github.com'"` +} + +func (c *rootCmd) opsFile() (string, *operationsFile, error) { + filename := filepath.Join(c.WorkingDir, "openapi_operations.yaml") + opsFile, err := loadOperationsFile(filename) + if err != nil { + return "", nil, err + } + return filename, opsFile, nil +} + +func githubClient(apiURL string) (*github.Client, error) { + token := os.Getenv("GITHUB_TOKEN") + if token == "" { + return nil, fmt.Errorf("GITHUB_TOKEN environment variable must be set to a GitHub personal access token with the public_repo scope") + } + return github.NewClient(nil).WithAuthToken(token).WithEnterpriseURLs(apiURL, "") +} + +type updateOpenAPICmd struct { + Ref string `kong:"default=main,help=${openapi_ref_help}"` + ValidateGithub bool `kong:"name=validate,help=${openapi_validate_help}"` +} + +func (c *updateOpenAPICmd) Run(root *rootCmd) error { + ctx := context.Background() + if c.ValidateGithub && c.Ref != "main" { + return fmt.Errorf("--validate and --ref are mutually exclusive") + } + filename, opsFile, err := root.opsFile() + if err != nil { + return err + } + origOps := make([]*operation, len(opsFile.OpenapiOps)) + copy(origOps, opsFile.OpenapiOps) + for i := range origOps { + origOps[i] = origOps[i].clone() + } + client, err := githubClient(root.GithubURL) + if err != nil { + return err + } + ref := c.Ref + if c.ValidateGithub { + ref = opsFile.GitCommit + if ref == "" { + return fmt.Errorf("openapi_operations.yaml does not have an openapi_commit field") + } + } + err = opsFile.updateFromGithub(ctx, client, ref) + if err != nil { + return err + } + if !c.ValidateGithub { + return opsFile.saveFile(filename) + } + if !operationsEqual(origOps, opsFile.OpenapiOps) { + return fmt.Errorf("openapi_operations.yaml does not match the OpenAPI descriptions in github.com/github/rest-api-description") + } + return nil +} + +type formatCmd struct{} + +func (c *formatCmd) Run(root *rootCmd) error { + filename, opsFile, err := root.opsFile() + if err != nil { + return err + } + return opsFile.saveFile(filename) +} + +type updateGoCmd struct{} + +func (c *updateGoCmd) Run(root *rootCmd) error { + _, opsFile, err := root.opsFile() + if err != nil { + return err + } + err = updateDocs(opsFile, filepath.Join(root.WorkingDir, "github")) + return err +} + +type unusedCmd struct { + JSON bool `kong:"help=${output_json_help}"` +} + +func (c *unusedCmd) Run(root *rootCmd, k *kong.Context) error { + _, opsFile, err := root.opsFile() + if err != nil { + return err + } + unused, err := unusedOps(opsFile, filepath.Join(root.WorkingDir, "github")) + if err != nil { + return err + } + if c.JSON { + enc := json.NewEncoder(k.Stdout) + enc.SetIndent("", " ") + return enc.Encode(unused) + } + fmt.Fprintf(k.Stdout, "Found %d unused operations\n", len(unused)) + if len(unused) == 0 { + return nil + } + fmt.Fprintln(k.Stdout, "") + for _, op := range unused { + fmt.Fprintln(k.Stdout, op.Name) + if op.DocumentationURL != "" { + fmt.Fprintf(k.Stdout, "doc: %s\n", op.DocumentationURL) + } + fmt.Fprintln(k.Stdout, "") + } + return nil +} + +func main() { + err := run(os.Args[1:], nil) + if err != nil { + fmt.Fprintln(os.Stderr, err) + os.Exit(1) + } +} + +func run(args []string, opts []kong.Option) error { + var cmd rootCmd + parser, err := kong.New(&cmd, append(opts, helpVars)...) + if err != nil { + return err + } + k, err := parser.Parse(args) + if err != nil { + return err + } + return k.Run() +} diff --git a/tools/metadata/main_test.go b/tools/metadata/main_test.go new file mode 100644 index 00000000000..39fe5357d0f --- /dev/null +++ b/tools/metadata/main_test.go @@ -0,0 +1,422 @@ +// Copyright 2023 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 main + +import ( + "bytes" + "encoding/json" + "fmt" + "io" + "io/fs" + "net/http" + "net/http/httptest" + "net/url" + "os" + "path" + "path/filepath" + "strings" + "testing" + + "github.com/alecthomas/kong" + "github.com/getkin/kin-openapi/openapi3" + "github.com/google/go-cmp/cmp" + "github.com/google/go-github/v56/github" +) + +func TestUpdateGo(t *testing.T) { + t.Run("valid", func(t *testing.T) { + res := runTest(t, "testdata/update-go/valid", "update-go") + res.assertOutput("", "") + res.assertNoErr() + res.checkGolden() + }) + + t.Run("invalid", func(t *testing.T) { + res := runTest(t, "testdata/update-go/invalid", "update-go") + res.assertOutput("", "") + res.assertErr(` +no operations defined for AService.NoOperation +no operations defined for AService.NoComment +ambiguous operation "GET /ambiguous/{}" could match any of: [GET /ambiguous/{id} GET /ambiguous/{name}] +could not find operation "GET /missing/{id}" in openapi_operations.yaml +duplicate operation: GET /a/{a_id} +`) + res.checkGolden() + }) +} + +func TestUnused(t *testing.T) { + res := runTest(t, "testdata/unused", "unused") + res.assertOutput(` +Found 3 unused operations + +GET /a/{a_id} +doc: https://docs.github.com/rest/a/a#overridden-get-a + +POST /a/{a_id} +doc: https://docs.github.com/rest/a/a#update-a + +GET /undocumented/{undocumented_id} +`, "") +} + +func TestUpdateOpenAPI(t *testing.T) { + testServer := newTestServer(t, "main", map[string]interface{}{ + "api.github.com/api.github.com.json": openapi3.T{ + Paths: openapi3.Paths{ + "/a/{a_id}": &openapi3.PathItem{ + Get: &openapi3.Operation{ + ExternalDocs: &openapi3.ExternalDocs{ + URL: "https://docs.github.com/rest/reference/a", + }, + }, + }, + }, + }, + "ghec/ghec.json": openapi3.T{ + Paths: openapi3.Paths{ + "/a/b/{a_id}": &openapi3.PathItem{ + Get: &openapi3.Operation{ + ExternalDocs: &openapi3.ExternalDocs{ + URL: "https://docs.github.com/rest/reference/a", + }, + }, + }, + }, + }, + "ghes-3.9/ghes-3.9.json": openapi3.T{ + Paths: openapi3.Paths{ + "/a/b/{a_id}": &openapi3.PathItem{ + Get: &openapi3.Operation{ + ExternalDocs: &openapi3.ExternalDocs{ + URL: "https://docs.github.com/rest/reference/a", + }, + }, + }, + }, + }, + "ghes-3.10/ghes-3.10.json": openapi3.T{ + Paths: openapi3.Paths{ + "/a/b/{a_id}": &openapi3.PathItem{ + Get: &openapi3.Operation{ + ExternalDocs: &openapi3.ExternalDocs{ + URL: "https://docs.github.com/rest/reference/a", + }, + }, + }, + }, + }, + "ghes-2.22/ghes-2.22.json": openapi3.T{ + Paths: openapi3.Paths{ + "/a/b/{a_id}": &openapi3.PathItem{ + Get: &openapi3.Operation{ + ExternalDocs: &openapi3.ExternalDocs{ + URL: "https://docs.github.com/rest/reference/a", + }, + }, + }, + }, + }, + }) + + res := runTest(t, "testdata/update-openapi", "update-openapi", "--github-url", testServer.URL) + res.assertOutput("", "") + res.assertNoErr() + res.checkGolden() +} + +func TestFormat(t *testing.T) { + res := runTest(t, "testdata/format", "format") + res.assertOutput("", "") + res.assertNoErr() + res.checkGolden() +} + +func updateGoldenDir(t *testing.T, origDir, resultDir, goldenDir string) { + t.Helper() + if os.Getenv("UPDATE_GOLDEN") == "" { + return + } + assertNilError(t, os.RemoveAll(goldenDir)) + assertNilError(t, filepath.WalkDir(resultDir, func(path string, d fs.DirEntry, err error) error { + if err != nil || d.IsDir() { + return err + } + relName := mustRel(t, resultDir, path) + origName := filepath.Join(origDir, relName) + _, err = os.Stat(origName) + if err != nil { + if os.IsNotExist(err) { + err = os.MkdirAll(filepath.Dir(filepath.Join(goldenDir, relName)), d.Type()) + if err != nil { + return err + } + return copyFile(path, filepath.Join(goldenDir, relName)) + } + return err + } + resContent, err := os.ReadFile(path) + if err != nil { + return err + } + origContent, err := os.ReadFile(origName) + if err != nil { + return err + } + if bytes.Equal(resContent, origContent) { + return nil + } + return copyFile(path, filepath.Join(goldenDir, relName)) + })) +} + +func checkGoldenDir(t *testing.T, origDir, resultDir, goldenDir string) { + t.Helper() + golden := true + t.Cleanup(func() { + t.Helper() + if !golden { + t.Log("To regenerate golden files run `UPDATE_GOLDEN=1 script/test.sh`") + } + }) + updateGoldenDir(t, origDir, resultDir, goldenDir) + checked := map[string]bool{} + _, err := os.Stat(goldenDir) + if err == nil { + assertNilError(t, filepath.Walk(goldenDir, func(wantPath string, info fs.FileInfo, err error) error { + relPath := mustRel(t, goldenDir, wantPath) + if err != nil || info.IsDir() { + return err + } + if !assertEqualFiles(t, wantPath, filepath.Join(resultDir, relPath)) { + golden = false + } + checked[relPath] = true + return nil + })) + } + assertNilError(t, filepath.Walk(origDir, func(wantPath string, info fs.FileInfo, err error) error { + relPath := mustRel(t, origDir, wantPath) + if err != nil || info.IsDir() || checked[relPath] { + return err + } + if !assertEqualFiles(t, wantPath, filepath.Join(resultDir, relPath)) { + golden = false + } + checked[relPath] = true + return nil + })) + assertNilError(t, filepath.Walk(resultDir, func(resultPath string, info fs.FileInfo, err error) error { + relPath := mustRel(t, resultDir, resultPath) + if err != nil || info.IsDir() || checked[relPath] { + return err + } + golden = false + return fmt.Errorf("found unexpected file:\n%s", relPath) + })) +} + +func mustRel(t *testing.T, base, target string) string { + t.Helper() + rel, err := filepath.Rel(base, target) + assertNilError(t, err) + return rel +} + +func copyDir(t *testing.T, dst, src string) error { + fmt.Println("dst", dst) + dst, err := filepath.Abs(dst) + if err != nil { + return err + } + return filepath.Walk(src, func(srcPath string, info fs.FileInfo, err error) error { + if err != nil || info.IsDir() { + return err + } + dstPath := filepath.Join(dst, mustRel(t, src, srcPath)) + err = copyFile(srcPath, dstPath) + return err + }) +} + +func copyFile(src, dst string) (errOut error) { + srcDirStat, err := os.Stat(filepath.Dir(src)) + if err != nil { + return err + } + err = os.MkdirAll(filepath.Dir(dst), srcDirStat.Mode()) + if err != nil { + return err + } + dstFile, err := os.Create(dst) + if err != nil { + return err + } + defer func() { + e := dstFile.Close() + if errOut == nil { + errOut = e + } + }() + srcFile, err := os.Open(src) + if err != nil { + return err + } + defer func() { + e := srcFile.Close() + if errOut == nil { + errOut = e + } + }() + _, err = io.Copy(dstFile, srcFile) + return err +} + +type testRun struct { + t *testing.T + workDir string + srcDir string + stdOut bytes.Buffer + stdErr bytes.Buffer + err error +} + +func (r testRun) checkGolden() { + r.t.Helper() + checkGoldenDir(r.t, r.srcDir, r.workDir, filepath.Join("testdata", "golden", r.t.Name())) +} + +func (r testRun) assertOutput(stdout, stderr string) { + r.t.Helper() + assertEqualStrings(r.t, strings.TrimSpace(stdout), strings.TrimSpace(r.stdOut.String())) + assertEqualStrings(r.t, strings.TrimSpace(stderr), strings.TrimSpace(r.stdErr.String())) +} + +func (r testRun) assertNoErr() { + r.t.Helper() + assertNilError(r.t, r.err) +} + +func (r testRun) assertErr(want string) { + r.t.Helper() + if r.err == nil { + r.t.Error("expected error") + return + } + if strings.TrimSpace(r.err.Error()) != strings.TrimSpace(want) { + r.t.Errorf("unexpected error:\nwant:\n%s\ngot:\n%s", want, r.err.Error()) + } +} + +func runTest(t *testing.T, srcDir string, args ...string) testRun { + t.Helper() + srcDir = filepath.FromSlash(srcDir) + res := testRun{ + t: t, + workDir: t.TempDir(), + srcDir: srcDir, + } + err := copyDir(t, res.workDir, srcDir) + if err != nil { + t.Error(err) + return res + } + res.err = run( + append(args, "-C", res.workDir), + []kong.Option{kong.Writers(&res.stdOut, &res.stdErr)}, + ) + return res +} + +func newTestServer(t *testing.T, ref string, files map[string]interface{}) *httptest.Server { + t.Helper() + jsonHandler := func(wantQuery url.Values, val interface{}) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + gotQuery := r.URL.Query() + queryDiff := cmp.Diff(wantQuery, gotQuery) + if queryDiff != "" { + t.Errorf("query mismatch for %s (-want +got):\n%s", r.URL.Path, queryDiff) + } + w.WriteHeader(200) + err := json.NewEncoder(w).Encode(val) + if err != nil { + panic(err) + } + } + } + repoPath := "/api/v3/repos/github/rest-api-description" + emptyQuery := url.Values{} + refQuery := url.Values{"ref": []string{ref}} + mux := http.NewServeMux() + server := httptest.NewServer(mux) + mux.HandleFunc( + path.Join(repoPath, "commits", ref), + jsonHandler(emptyQuery, &github.RepositoryCommit{SHA: github.String("s")}), + ) + var descriptionsContent []*github.RepositoryContent + for name, content := range files { + descriptionsContent = append(descriptionsContent, &github.RepositoryContent{ + Name: github.String(path.Base(path.Dir(name))), + }) + mux.HandleFunc( + path.Join(repoPath, "contents/descriptions", path.Dir(name)), + jsonHandler(refQuery, []*github.RepositoryContent{ + { + Name: github.String(path.Base(name)), + DownloadURL: github.String(server.URL + "/dl/" + name), + }, + }), + ) + mux.HandleFunc( + path.Join("/dl", name), + jsonHandler(emptyQuery, content), + ) + } + mux.HandleFunc( + path.Join(repoPath, "contents/descriptions"), + jsonHandler(refQuery, descriptionsContent), + ) + t.Cleanup(server.Close) + t.Setenv("GITHUB_TOKEN", "fake token") + return server +} + +func assertEqualStrings(t *testing.T, want, got string) { + t.Helper() + diff := cmp.Diff(want, got) + if diff != "" { + t.Error(diff) + } +} + +func assertEqualFiles(t *testing.T, want, got string) bool { + t.Helper() + wantBytes, err := os.ReadFile(want) + if !assertNilError(t, err) { + return false + } + wantBytes = bytes.ReplaceAll(wantBytes, []byte("\r\n"), []byte("\n")) + gotBytes, err := os.ReadFile(got) + if !assertNilError(t, err) { + return false + } + gotBytes = bytes.ReplaceAll(gotBytes, []byte("\r\n"), []byte("\n")) + if !bytes.Equal(wantBytes, gotBytes) { + diff := cmp.Diff(string(wantBytes), string(gotBytes)) + t.Errorf("files %q and %q differ: %s", want, got, diff) + return false + } + return true +} + +func assertNilError(t *testing.T, err error) bool { + t.Helper() + if err != nil { + t.Error(err) + return false + } + return true +} diff --git a/tools/metadata/metadata.go b/tools/metadata/metadata.go new file mode 100644 index 00000000000..c60a1cfe215 --- /dev/null +++ b/tools/metadata/metadata.go @@ -0,0 +1,520 @@ +// Copyright 2023 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 main + +import ( + "bytes" + "context" + "errors" + "fmt" + "go/ast" + "go/format" + "go/parser" + "go/printer" + "go/token" + "net/url" + "os" + "path" + "path/filepath" + "regexp" + "sort" + "strings" + "sync" + + "github.com/google/go-github/v56/github" + "gopkg.in/yaml.v3" +) + +type operation struct { + Name string `yaml:"name,omitempty" json:"name,omitempty"` + DocumentationURL string `yaml:"documentation_url,omitempty" json:"documentation_url,omitempty"` + OpenAPIFiles []string `yaml:"openapi_files,omitempty" json:"openapi_files,omitempty"` +} + +func (o *operation) equal(other *operation) bool { + if o.Name != other.Name || o.DocumentationURL != other.DocumentationURL { + return false + } + if len(o.OpenAPIFiles) != len(other.OpenAPIFiles) { + return false + } + for i := range o.OpenAPIFiles { + if o.OpenAPIFiles[i] != other.OpenAPIFiles[i] { + return false + } + } + return true +} + +func (o *operation) clone() *operation { + return &operation{ + Name: o.Name, + DocumentationURL: o.DocumentationURL, + OpenAPIFiles: append([]string{}, o.OpenAPIFiles...), + } +} + +func operationsEqual(a, b []*operation) bool { + if len(a) != len(b) { + return false + } + for i := range a { + if !a[i].equal(b[i]) { + return false + } + } + return true +} + +func sortOperations(ops []*operation) { + sort.Slice(ops, func(i, j int) bool { + leftVerb, leftURL := parseOpName(ops[i].Name) + rightVerb, rightURL := parseOpName(ops[j].Name) + if leftURL != rightURL { + return leftURL < rightURL + } + return leftVerb < rightVerb + }) +} + +// normalizeOpPath returns an endpoint with all templated path parameters replaced with *. +func normalizeOpPath(opPath string) string { + if !strings.ContainsAny(opPath, "{%") { + return opPath + } + segments := strings.Split(opPath, "/") + for i, segment := range segments { + if len(segment) == 0 { + continue + } + if segment[0] == '{' || segment[0] == '%' { + segments[i] = "*" + } + } + return strings.Join(segments, "/") +} + +func normalizedOpName(name string) string { + verb, u := parseOpName(name) + return strings.TrimSpace(verb + " " + normalizeOpPath(u)) +} + +// matches something like "GET /some/path" +var opNameRe = regexp.MustCompile(`(?i)(\S+)(?:\s+(\S.*))?`) + +func parseOpName(id string) (verb, url string) { + match := opNameRe.FindStringSubmatch(id) + if match == nil { + return "", "" + } + u := strings.TrimSpace(match[2]) + if !strings.HasPrefix(u, "/") { + u = "/" + u + } + return strings.ToUpper(match[1]), u +} + +type operationsFile struct { + ManualOps []*operation `yaml:"operations,omitempty"` + OverrideOps []*operation `yaml:"operation_overrides,omitempty"` + GitCommit string `yaml:"openapi_commit,omitempty"` + OpenapiOps []*operation `yaml:"openapi_operations,omitempty"` + + mu sync.Mutex + resolvedOps map[string]*operation +} + +func (m *operationsFile) resolve() { + m.mu.Lock() + defer m.mu.Unlock() + if m.resolvedOps != nil { + return + } + m.resolvedOps = map[string]*operation{} + for _, op := range m.OpenapiOps { + m.resolvedOps[op.Name] = op.clone() + } + for _, op := range m.ManualOps { + m.resolvedOps[op.Name] = op.clone() + } + for _, override := range m.OverrideOps { + _, ok := m.resolvedOps[override.Name] + if !ok { + continue + } + override = override.clone() + if override.DocumentationURL != "" { + m.resolvedOps[override.Name].DocumentationURL = override.DocumentationURL + } + if len(override.OpenAPIFiles) > 0 { + m.resolvedOps[override.Name].OpenAPIFiles = override.OpenAPIFiles + } + } +} + +func (m *operationsFile) saveFile(filename string) (errOut error) { + sortOperations(m.ManualOps) + sortOperations(m.OverrideOps) + sortOperations(m.OpenapiOps) + f, err := os.Create(filename) + if err != nil { + return err + } + defer func() { + e := f.Close() + if errOut == nil { + errOut = e + } + }() + enc := yaml.NewEncoder(f) + enc.SetIndent(2) + defer func() { + e := enc.Close() + if errOut == nil { + errOut = e + } + }() + return enc.Encode(m) +} + +func (m *operationsFile) updateFromGithub(ctx context.Context, client *github.Client, ref string) error { + commit, resp, err := client.Repositories.GetCommit(ctx, descriptionsOwnerName, descriptionsRepoName, ref, nil) + if err != nil { + return err + } + if resp.StatusCode != 200 { + return fmt.Errorf("unexpected status code: %s", resp.Status) + } + ops, err := getOpsFromGithub(ctx, client, ref) + if err != nil { + return err + } + if !operationsEqual(m.OpenapiOps, ops) { + m.OpenapiOps = ops + m.GitCommit = commit.GetSHA() + } + return nil +} + +func loadOperationsFile(filename string) (*operationsFile, error) { + b, err := os.ReadFile(filename) + if err != nil { + return nil, err + } + var opsFile operationsFile + err = yaml.Unmarshal(b, &opsFile) + if err != nil { + return nil, err + } + return &opsFile, nil +} + +func addOperation(ops []*operation, filename, opName, docURL string) []*operation { + for _, op := range ops { + if opName != op.Name { + continue + } + if len(op.OpenAPIFiles) == 0 { + op.OpenAPIFiles = append(op.OpenAPIFiles, filename) + op.DocumentationURL = docURL + return ops + } + // just append to files, but only add the first ghes file + if !strings.Contains(filename, "/ghes") { + op.OpenAPIFiles = append(op.OpenAPIFiles, filename) + return ops + } + for _, f := range op.OpenAPIFiles { + if strings.Contains(f, "/ghes") { + return ops + } + } + op.OpenAPIFiles = append(op.OpenAPIFiles, filename) + return ops + } + return append(ops, &operation{ + Name: opName, + OpenAPIFiles: []string{filename}, + DocumentationURL: docURL, + }) +} + +func unusedOps(opsFile *operationsFile, dir string) ([]*operation, error) { + var usedOps map[string]bool + err := visitServiceMethods(dir, false, func(_ string, fn *ast.FuncDecl, cmap ast.CommentMap) error { + ops, err := methodOps(opsFile, cmap, fn) + if err != nil { + return err + } + for _, op := range ops { + if usedOps == nil { + usedOps = map[string]bool{} + } + usedOps[op.Name] = true + } + return nil + }) + if err != nil { + return nil, err + } + var result []*operation + opsFile.resolve() + for opName, op := range opsFile.resolvedOps { + if !usedOps[opName] { + result = append(result, op) + } + } + sortOperations(result) + return result, nil +} + +func updateDocsVisitor(opsFile *operationsFile) nodeVisitor { + return func(serviceMethod string, fn *ast.FuncDecl, cmap ast.CommentMap) error { + linksMap := map[string]struct{}{} + undocMap := map[string]bool{} + + ops, err := methodOps(opsFile, cmap, fn) + if err != nil { + return err + } + if len(ops) == 0 { + return fmt.Errorf("no operations defined for %s", serviceMethod) + } + + for _, op := range ops { + if op.DocumentationURL == "" { + undocMap[op.Name] = true + continue + } + linksMap[op.DocumentationURL] = struct{}{} + } + var undocumentedOps []string + for op := range undocMap { + undocumentedOps = append(undocumentedOps, op) + } + sort.Strings(undocumentedOps) + + // Find the group that comes before the function + var group *ast.CommentGroup + for _, g := range cmap[fn] { + if g.End() == fn.Pos()-1 { + group = g + } + } + + // If there is no group, create one + if group == nil { + group = &ast.CommentGroup{ + List: []*ast.Comment{{Text: "//", Slash: fn.Pos() - 1}}, + } + cmap[fn] = append(cmap[fn], group) + } + + origList := group.List + group.List = nil + for _, comment := range origList { + if metaOpRe.MatchString(comment.Text) || + docLineRE.MatchString(comment.Text) || + undocRE.MatchString(comment.Text) { + continue + } + group.List = append(group.List, comment) + } + + // add an empty line before adding doc links + group.List = append(group.List, &ast.Comment{Text: "//"}) + + var docLinks []string + for link := range linksMap { + docLinks = append(docLinks, link) + } + sort.Strings(docLinks) + + for _, dl := range docLinks { + group.List = append( + group.List, + &ast.Comment{ + Text: "// GitHub API docs: " + cleanURLPath(dl), + }, + ) + } + _, methodName, _ := strings.Cut(serviceMethod, ".") + for _, opName := range undocumentedOps { + line := fmt.Sprintf("// Note: %s uses the undocumented GitHub API endpoint %q.", methodName, opName) + group.List = append(group.List, &ast.Comment{Text: line}) + } + for _, op := range ops { + group.List = append(group.List, &ast.Comment{ + Text: fmt.Sprintf("//meta:operation %s", op.Name), + }) + } + group.List[0].Slash = fn.Pos() - 1 + for i := 1; i < len(group.List); i++ { + group.List[i].Slash = token.NoPos + } + return nil + } +} + +// updateDocs updates the code comments in dir with doc urls from metadata. +func updateDocs(opsFile *operationsFile, dir string) error { + return visitServiceMethods(dir, true, updateDocsVisitor(opsFile)) +} + +type nodeVisitor func(serviceMethod string, fn *ast.FuncDecl, cmap ast.CommentMap) error + +// visitServiceMethods runs visit on the ast.Node of every service method in dir. When writeFiles is true it will +// save any changes back to the original file. +func visitServiceMethods(dir string, writeFiles bool, visit nodeVisitor) error { + dirEntries, err := os.ReadDir(dir) + if err != nil { + return err + } + for _, dirEntry := range dirEntries { + filename := filepath.Join(dir, dirEntry.Name()) + if dirEntry.IsDir() || + !strings.HasSuffix(filename, ".go") || + strings.HasSuffix(filename, "_test.go") { + continue + } + err = errors.Join(err, visitFileMethods(writeFiles, filename, visit)) + } + return err +} + +func visitFileMethods(updateFile bool, filename string, visit nodeVisitor) error { + content, err := os.ReadFile(filename) + if err != nil { + return err + } + content = bytes.ReplaceAll(content, []byte("\r\n"), []byte("\n")) + + fset := token.NewFileSet() + fileNode, err := parser.ParseFile(fset, "", content, parser.ParseComments) + if err != nil { + return err + } + cmap := ast.NewCommentMap(fset, fileNode, fileNode.Comments) + + ast.Inspect(fileNode, func(n ast.Node) bool { + fn, ok := n.(*ast.FuncDecl) + if !ok { + return true + } + serviceMethod := nodeServiceMethod(fn) + if serviceMethod == "" { + return true + } + e := visit(serviceMethod, fn, cmap) + err = errors.Join(err, e) + return true + }) + if err != nil { + return err + } + if !updateFile { + return nil + } + fileNode.Comments = cmap.Filter(fileNode).Comments() + var buf bytes.Buffer + err = printer.Fprint(&buf, fset, fileNode) + if err != nil { + return err + } + updatedContent, err := format.Source(buf.Bytes()) + if err != nil { + return err + } + if bytes.Equal(content, updatedContent) { + return nil + } + return os.WriteFile(filename, updatedContent, 0600) +} + +var ( + metaOpRe = regexp.MustCompile(`(?i)\s*//\s*meta:operation\s+(\S.+)`) + undocRE = regexp.MustCompile(`(?i)\s*//\s*Note:\s+\S.+ uses the undocumented GitHub API endpoint`) + docLineRE = regexp.MustCompile(`(?i)\s*//\s*GitHub\s+API\s+docs:`) +) + +// methodOps parses a method's comments for //meta:operation lines and returns the corresponding operations. +func methodOps(opsFile *operationsFile, cmap ast.CommentMap, fn *ast.FuncDecl) ([]*operation, error) { + var ops []*operation + var err error + seen := map[string]bool{} + for _, g := range cmap[fn] { + for _, c := range g.List { + match := metaOpRe.FindStringSubmatch(c.Text) + if match == nil { + continue + } + opName := strings.TrimSpace(match[1]) + opsFile.resolve() + var found []*operation + norm := normalizedOpName(opName) + for n := range opsFile.resolvedOps { + if normalizedOpName(n) == norm { + found = append(found, opsFile.resolvedOps[n]) + } + } + switch len(found) { + case 0: + err = errors.Join(err, fmt.Errorf("could not find operation %q in openapi_operations.yaml", opName)) + case 1: + name := found[0].Name + if seen[name] { + err = errors.Join(err, fmt.Errorf("duplicate operation: %s", name)) + } + seen[name] = true + ops = append(ops, found[0]) + default: + var foundNames []string + for _, op := range found { + foundNames = append(foundNames, op.Name) + } + sort.Strings(foundNames) + err = errors.Join(err, fmt.Errorf("ambiguous operation %q could match any of: %v", opName, foundNames)) + } + } + } + sortOperations(ops) + return ops, err +} + +// cleanURLPath runs path.Clean on the url path. This is to remove the unsightly double slashes from some +// of the urls in github's openapi descriptions. +func cleanURLPath(docURL string) string { + u, err := url.Parse(docURL) + if err != nil { + return docURL + } + u.Path = path.Clean(u.Path) + return u.String() +} + +// nodeServiceMethod returns the name of the service method represented by fn, or "" if fn is not a service method. +// Name is in the form of "Receiver.Function", for example "IssuesService.Create". +func nodeServiceMethod(fn *ast.FuncDecl) string { + if fn.Recv == nil || len(fn.Recv.List) != 1 { + return "" + } + recv := fn.Recv.List[0] + se, ok := recv.Type.(*ast.StarExpr) + if !ok { + return "" + } + id, ok := se.X.(*ast.Ident) + if !ok { + return "" + } + + // We only want exported methods on exported types where the type name ends in "Service". + if !id.IsExported() || !fn.Name.IsExported() || !strings.HasSuffix(id.Name, "Service") { + return "" + } + + return id.Name + "." + fn.Name.Name +} diff --git a/tools/metadata/metadata_test.go b/tools/metadata/metadata_test.go new file mode 100644 index 00000000000..c3ad0a788f9 --- /dev/null +++ b/tools/metadata/metadata_test.go @@ -0,0 +1,28 @@ +// Copyright 2023 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 main + +import ( + "testing" +) + +func Test_normalizedOpName(t *testing.T) { + for _, td := range []struct { + name string + want string + }{ + {name: "", want: ""}, + {name: "get /foo/{id}", want: "GET /foo/*"}, + {name: "get foo", want: "GET /foo"}, + } { + t.Run(td.name, func(t *testing.T) { + got := normalizedOpName(td.name) + if got != td.want { + t.Errorf("normalizedOpName() = %v, want %v", got, td.want) + } + }) + } +} diff --git a/tools/metadata/openapi.go b/tools/metadata/openapi.go new file mode 100644 index 00000000000..4b858481f5e --- /dev/null +++ b/tools/metadata/openapi.go @@ -0,0 +1,172 @@ +// Copyright 2023 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 main + +import ( + "context" + "fmt" + "io" + "regexp" + "sort" + "strconv" + + "github.com/getkin/kin-openapi/openapi3" + "github.com/google/go-github/v56/github" + "golang.org/x/sync/errgroup" +) + +const ( + descriptionsOwnerName = "github" + descriptionsRepoName = "rest-api-description" + descriptionsPath = "descriptions" +) + +type openapiFile struct { + description *openapi3.T + filename string + plan string + planIdx int + releaseMajor int + releaseMinor int +} + +func getOpsFromGithub(ctx context.Context, client *github.Client, gitRef string) ([]*operation, error) { + descs, err := getDescriptions(ctx, client, gitRef) + if err != nil { + return nil, err + } + var ops []*operation + for _, desc := range descs { + for p, pathItem := range desc.description.Paths { + for method, op := range pathItem.Operations() { + docURL := "" + if op.ExternalDocs != nil { + docURL = op.ExternalDocs.URL + } + ops = addOperation(ops, desc.filename, method+" "+p, docURL) + } + } + } + sortOperations(ops) + return ops, nil +} + +func (o *openapiFile) loadDescription(ctx context.Context, client *github.Client, gitRef string) error { + contents, resp, err := client.Repositories.DownloadContents( + ctx, + descriptionsOwnerName, + descriptionsRepoName, + o.filename, + &github.RepositoryContentGetOptions{Ref: gitRef}, + ) + if err != nil { + return err + } + if resp.StatusCode != 200 { + return fmt.Errorf("unexpected status code: %s", resp.Status) + } + b, err := io.ReadAll(contents) + if err != nil { + return err + } + err = contents.Close() + if err != nil { + return err + } + o.description, err = openapi3.NewLoader().LoadFromData(b) + return err +} + +// less sorts by the following rules: +// - planIdx ascending +// - releaseMajor descending +// - releaseMinor descending +func (o *openapiFile) less(other *openapiFile) bool { + if o.planIdx != other.planIdx { + return o.planIdx < other.planIdx + } + if o.releaseMajor != other.releaseMajor { + return o.releaseMajor > other.releaseMajor + } + return o.releaseMinor > other.releaseMinor +} + +var dirPatterns = []*regexp.Regexp{ + regexp.MustCompile(`^(?Papi\.github\.com)(-(?P\d+)\.(?P\d+))?$`), + regexp.MustCompile(`^(?Pghec)(-(?P\d+)\.(?P\d+))?$`), + regexp.MustCompile(`^(?Pghes)(-(?P\d+)\.(?P\d+))?$`), +} + +// getDescriptions loads OpenapiFiles for all the OpenAPI 3.0 description files in github/rest-api-description. +// This assumes that all directories in "descriptions/" contain OpenAPI 3.0 description files with the same +// name as the directory (plus the ".json" extension). For example, "descriptions/api.github.com/api.github.com.json". +// Results are sorted by these rules: +// - Directories that don't match any of the patterns in dirPatterns are removed. +// - Directories are sorted by the pattern that matched in the same order they appear in dirPatterns. +// - Directories are then sorted by major and minor version in descending order. +func getDescriptions(ctx context.Context, client *github.Client, gitRef string) ([]*openapiFile, error) { + _, dir, resp, err := client.Repositories.GetContents( + ctx, + descriptionsOwnerName, + descriptionsRepoName, + descriptionsPath, + &github.RepositoryContentGetOptions{Ref: gitRef}, + ) + if err != nil { + return nil, err + } + if resp.StatusCode != 200 { + return nil, fmt.Errorf("unexpected status code: %s", resp.Status) + } + files := make([]*openapiFile, 0, len(dir)) + for _, d := range dir { + for i, pattern := range dirPatterns { + m := pattern.FindStringSubmatch(d.GetName()) + if m == nil { + continue + } + file := openapiFile{ + filename: fmt.Sprintf("descriptions/%s/%s.json", d.GetName(), d.GetName()), + plan: m[pattern.SubexpIndex("plan")], + planIdx: i, + } + rawMajor := m[pattern.SubexpIndex("major")] + if rawMajor != "" { + file.releaseMajor, err = strconv.Atoi(rawMajor) + if err != nil { + return nil, err + } + } + rawMinor := m[pattern.SubexpIndex("minor")] + if rawMinor != "" { + file.releaseMinor, err = strconv.Atoi(rawMinor) + if err != nil { + return nil, err + } + } + if file.plan == "ghes" && file.releaseMajor < 3 { + continue + } + files = append(files, &file) + break + } + } + sort.Slice(files, func(i, j int) bool { + return files[i].less(files[j]) + }) + g, ctx := errgroup.WithContext(ctx) + for _, file := range files { + f := file + g.Go(func() error { + return f.loadDescription(ctx, client, gitRef) + }) + } + err = g.Wait() + if err != nil { + return nil, err + } + return files, nil +} diff --git a/tools/metadata/testdata/format/openapi_operations.yaml b/tools/metadata/testdata/format/openapi_operations.yaml new file mode 100644 index 00000000000..abaafeb9aa8 --- /dev/null +++ b/tools/metadata/testdata/format/openapi_operations.yaml @@ -0,0 +1,16 @@ + +operations: + - name: POST /a/{a_id} + documentation_url: https://docs.github.com/rest/a/a#update-a +openapi_operations: + - name: GET /a/{a_id} + documentation_url: https://docs.github.com/rest/a/a#get-a + - name: GET /undocumented/{undocumented_id} + +operation_overrides: + - name: GET /a/{a_id_noncanonical2} # this comment will disappear + documentation_url: https://docs.github.com/rest/a/a#overridden-get-a + - name: GET /fake/{a_id} + documentation_url: https://docs.github.com/rest/a/a#overridden-get-a + +openapi_commit: b8dafbe912a3be421d21346faa2b29bf15e6f84d diff --git a/tools/metadata/testdata/golden/TestFormat/openapi_operations.yaml b/tools/metadata/testdata/golden/TestFormat/openapi_operations.yaml new file mode 100644 index 00000000000..524d56817fb --- /dev/null +++ b/tools/metadata/testdata/golden/TestFormat/openapi_operations.yaml @@ -0,0 +1,13 @@ +operations: + - name: POST /a/{a_id} + documentation_url: https://docs.github.com/rest/a/a#update-a +operation_overrides: + - name: GET /a/{a_id_noncanonical2} + documentation_url: https://docs.github.com/rest/a/a#overridden-get-a + - name: GET /fake/{a_id} + documentation_url: https://docs.github.com/rest/a/a#overridden-get-a +openapi_commit: b8dafbe912a3be421d21346faa2b29bf15e6f84d +openapi_operations: + - name: GET /a/{a_id} + documentation_url: https://docs.github.com/rest/a/a#get-a + - name: GET /undocumented/{undocumented_id} diff --git a/tools/metadata/testdata/golden/TestUpdateGo/valid/github/a.go b/tools/metadata/testdata/golden/TestUpdateGo/valid/github/a.go new file mode 100644 index 00000000000..571c1eb2da9 --- /dev/null +++ b/tools/metadata/testdata/golden/TestUpdateGo/valid/github/a.go @@ -0,0 +1,37 @@ +package github + +type AService struct{} + +// Get gets an A +// +// GitHub API docs: https://docs.github.com/rest/a/a#overridden-get-a +// +//meta:operation GET /a/{a_id} +func (s *AService) Get() {} + +// Undocumented uses an undocumented operation +// +// Note: Undocumented uses the undocumented GitHub API endpoint "GET /undocumented/{undocumented_id}". +// +//meta:operation GET /undocumented/{undocumented_id} +func (s *AService) Undocumented() {} + +// OutdatedLinks has links that are outdated or wrong +// +// GitHub API docs: https://docs.github.com/rest/a/a#update-a +// +//meta:operation POST /a/{a_id} +func (s *AService) OutdatedLinks() {} + +// GitHub API docs: https://docs.github.com/rest/a/a#overridden-get-a +// +//meta:operation GET /a/{a_id} +func (s *AService) Uncommented() {} + +func (s *AService) unexported() {} + +func NotAMethod() {} + +type internalService struct{} + +func (i *internalService) Get() {} diff --git a/tools/metadata/testdata/golden/TestUpdateOpenAPI/openapi_operations.yaml b/tools/metadata/testdata/golden/TestUpdateOpenAPI/openapi_operations.yaml new file mode 100644 index 00000000000..c1e3cf4cbd6 --- /dev/null +++ b/tools/metadata/testdata/golden/TestUpdateOpenAPI/openapi_operations.yaml @@ -0,0 +1,14 @@ +operations: + - name: GET /a/{a_id} + documentation_url: https://docs.github.com/rest/a/a#get-a +openapi_commit: s +openapi_operations: + - name: GET /a/b/{a_id} + documentation_url: https://docs.github.com/rest/reference/a + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /a/{a_id} + documentation_url: https://docs.github.com/rest/reference/a + openapi_files: + - descriptions/api.github.com/api.github.com.json diff --git a/tools/metadata/testdata/unused/github/a.go b/tools/metadata/testdata/unused/github/a.go new file mode 100644 index 00000000000..0169531b2b6 --- /dev/null +++ b/tools/metadata/testdata/unused/github/a.go @@ -0,0 +1,8 @@ +package github + +type AService struct{} + +// PostABC +// +//meta:operation POST /a/b/c/{a_id} +func (a *AService) PostABC() {} diff --git a/tools/metadata/testdata/unused/openapi_operations.yaml b/tools/metadata/testdata/unused/openapi_operations.yaml new file mode 100644 index 00000000000..c5c3772b1f3 --- /dev/null +++ b/tools/metadata/testdata/unused/openapi_operations.yaml @@ -0,0 +1,15 @@ +openapi_commit: b8dafbe912a3be421d21346faa2b29bf15e6f84d +operations: + - name: POST /a/{a_id} + documentation_url: https://docs.github.com/rest/a/a#update-a +openapi_operations: + - name: POST /a/b/c/{a_id} + documentation_url: https://docs.github.com/rest/a/b/c#update-a + - name: GET /a/{a_id} + documentation_url: https://docs.github.com/rest/a/a#get-a + - name: GET /undocumented/{undocumented_id} +operation_overrides: + - name: GET /a/{a_id} + documentation_url: https://docs.github.com/rest/a/a#overridden-get-a + - name: GET /fake/{a_id} + documentation_url: https://docs.github.com/rest/a/a#overridden-get-a diff --git a/tools/metadata/testdata/update-go/invalid/github/a.go b/tools/metadata/testdata/update-go/invalid/github/a.go new file mode 100644 index 00000000000..ceef5fb5963 --- /dev/null +++ b/tools/metadata/testdata/update-go/invalid/github/a.go @@ -0,0 +1,24 @@ +package github + +type AService struct{} + +// NoOperation has no operation +func (*AService) NoOperation() {} + +func (*AService) NoComment() {} + +// Ambiguous has an operation that could resolve to multiple operations +// +//meta:operation GET /ambiguous/{} +func (*AService) Ambiguous() {} + +// MissingOperation has an operation that is missing from the OpenAPI spec +// +//meta:operation GET /missing/{id} +func (*AService) MissingOperation() {} + +// DuplicateOperations has duplicate operations +//meta:operation GET /a/{a_id} +//meta:operation POST /a/{a_id} +//meta:operation GET /a/{a_id} +func (*AService) DuplicateOperations() {} diff --git a/tools/metadata/testdata/update-go/invalid/openapi_operations.yaml b/tools/metadata/testdata/update-go/invalid/openapi_operations.yaml new file mode 100644 index 00000000000..07b0c3e5013 --- /dev/null +++ b/tools/metadata/testdata/update-go/invalid/openapi_operations.yaml @@ -0,0 +1,16 @@ +operations: + - name: POST /a/{a_id} + documentation_url: https://docs.github.com/rest/a/a#update-a +openapi_operations: + - name: GET /ambiguous/{id} + documentation_url: https://docs.github.com/rest/ambiguous/ + - name: GET /ambiguous/{name} + documentation_url: https://docs.github.com/rest/ambiguous/ + - name: GET /undocumented/{undocumented_id} + - name: GET /a/{a_id} + documentation_url: https://docs.github.com/rest/a/a#get-a +operation_overrides: + - name: GET /a/{a_id} + documentation_url: https://docs.github.com/rest/a/a#overridden-get-a + - name: GET /fake/{a_id} + documentation_url: https://docs.github.com/rest/a/a#overridden-get-a diff --git a/tools/metadata/testdata/update-go/valid/github/a.go b/tools/metadata/testdata/update-go/valid/github/a.go new file mode 100644 index 00000000000..7885efd8c79 --- /dev/null +++ b/tools/metadata/testdata/update-go/valid/github/a.go @@ -0,0 +1,31 @@ +package github + +type AService struct{} + +// Get gets an A +//meta:operation GET /a/{non-canonical-id} +func (s *AService) Get() {} + +// Undocumented uses an undocumented operation +//meta:operation GET /undocumented/{undocumented_id} +func (s *AService) Undocumented() {} + +// OutdatedLinks has links that are outdated or wrong +// +// GitHub API docs: https://docs.github.com/rest/a/a#get-a +// GitHub API docs: https://example.com +// Note: Undocumented uses the undocumented GitHub API endpoint "GET /undocumented/{undocumented_id}". +// +//meta:operation post a/{a_id} +func (s *AService) OutdatedLinks() {} + +//meta:operation GET /a/{a_id} +func (s *AService) Uncommented() {} + +func (s *AService) unexported() {} + +func NotAMethod() {} + +type internalService struct{} + +func (i *internalService) Get() {} diff --git a/tools/metadata/testdata/update-go/valid/github/ignoreme.txt b/tools/metadata/testdata/update-go/valid/github/ignoreme.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tools/metadata/testdata/update-go/valid/openapi_operations.yaml b/tools/metadata/testdata/update-go/valid/openapi_operations.yaml new file mode 100644 index 00000000000..ed401c0d283 --- /dev/null +++ b/tools/metadata/testdata/update-go/valid/openapi_operations.yaml @@ -0,0 +1,13 @@ +openapi_commit: b8dafbe912a3be421d21346faa2b29bf15e6f84d +operations: + - name: POST /a/{a_id} + documentation_url: https://docs.github.com/rest/a/a#update-a +openapi_operations: + - name: GET /a/{a_id} + documentation_url: https://docs.github.com/rest/a/a#get-a + - name: GET /undocumented/{undocumented_id} +operation_overrides: + - name: GET /a/{a_id} + documentation_url: https://docs.github.com/rest/a/a#overridden-get-a + - name: GET /fake/{a_id} + documentation_url: https://docs.github.com/rest/a/a#overridden-get-a diff --git a/tools/metadata/testdata/update-openapi/openapi_operations.yaml b/tools/metadata/testdata/update-openapi/openapi_operations.yaml new file mode 100644 index 00000000000..1577e739ab6 --- /dev/null +++ b/tools/metadata/testdata/update-openapi/openapi_operations.yaml @@ -0,0 +1,4 @@ +operations: + - name: GET /a/{a_id} + documentation_url: https://docs.github.com/rest/a/a#get-a +openapi_commit: s diff --git a/update-urls/activity-events_test.go b/update-urls/activity-events_test.go deleted file mode 100644 index 10dce865b29..00000000000 --- a/update-urls/activity-events_test.go +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright 2020 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 main - -import ( - _ "embed" - "strings" - "testing" -) - -func newActivitiesEventsPipeline() *pipelineSetup { - return &pipelineSetup{ - baseURL: "https://docs.github.com/en/rest/activity/events/", - endpointsFromWebsite: activityEventsWant, - filename: "activity_events.go", - serviceName: "ActivityService", - originalGoSource: strings.ReplaceAll(activityEventsGoFileOriginal, "\r", ""), - wantGoSource: strings.ReplaceAll(activityEventsGoFileWant, "\r", ""), - wantNumEndpoints: 7, - } -} - -func TestPipeline_ActivityEvents(t *testing.T) { - ps := newActivitiesEventsPipeline() - ps.setup(t, false, false) - ps.validate(t) -} - -func TestPipeline_ActivityEvents_FirstStripAllURLs(t *testing.T) { - ps := newActivitiesEventsPipeline() - ps.setup(t, true, false) - ps.validate(t) -} - -func TestPipeline_ActivityEvents_FirstDestroyReceivers(t *testing.T) { - ps := newActivitiesEventsPipeline() - ps.setup(t, false, true) - ps.validate(t) -} - -func TestPipeline_ActivityEvents_FirstStripAllURLsAndDestroyReceivers(t *testing.T) { - ps := newActivitiesEventsPipeline() - ps.setup(t, true, true) - ps.validate(t) -} - -func TestParseWebPageEndpoints_ActivityEvents(t *testing.T) { - got := parseWebPageEndpoints(activityEventsTestWebPage) - testWebPageHelper(t, got, activityEventsWant) -} - -var activityEventsWant = endpointsByFragmentID{ - "list-public-events": []*Endpoint{ - {urlFormats: []string{"events"}, httpMethod: "GET"}, - }, - - "list-repository-events": []*Endpoint{ - {urlFormats: []string{"repos/%v/%v/events"}, httpMethod: "GET"}, - }, - - "list-public-events-for-a-network-of-repositories": []*Endpoint{ - {urlFormats: []string{"networks/%v/%v/events"}, httpMethod: "GET"}, - }, - - "list-events-received-by-the-authenticated-user": []*Endpoint{ - {urlFormats: []string{"users/%v/received_events"}, httpMethod: "GET"}, - }, - - "list-events-for-the-authenticated-user": []*Endpoint{ - {urlFormats: []string{"users/%v/events"}, httpMethod: "GET"}, - }, - - "list-public-events-for-a-user": []*Endpoint{ - {urlFormats: []string{"users/%v/events/public"}, httpMethod: "GET"}, - }, - - "list-organization-events-for-the-authenticated-user": []*Endpoint{ - {urlFormats: []string{"users/%v/events/orgs/%v"}, httpMethod: "GET"}, - }, - - "list-public-organization-events": []*Endpoint{ - {urlFormats: []string{"orgs/%v/events"}, httpMethod: "GET"}, - }, - - "list-public-events-received-by-a-user": []*Endpoint{ - {urlFormats: []string{"users/%v/received_events/public"}, httpMethod: "GET"}, - }, - - // Updated docs - consolidated into single page. - - "delete-a-thread-subscription": []*Endpoint{ - {urlFormats: []string{"notifications/threads/%v/subscription"}, httpMethod: "DELETE"}, - }, - - "mark-notifications-as-read": []*Endpoint{ - {urlFormats: []string{"notifications"}, httpMethod: "PUT"}, - }, - - "set-a-thread-subscription": []*Endpoint{ - {urlFormats: []string{"notifications/threads/%v/subscription"}, httpMethod: "PUT"}, - }, - - "delete-a-repository-subscription": []*Endpoint{ - {urlFormats: []string{"repos/%v/%v/subscription"}, httpMethod: "DELETE"}, - }, - - "star-a-repository-for-the-authenticated-user": []*Endpoint{ - {urlFormats: []string{"user/starred/%v/%v"}, httpMethod: "PUT"}, - }, - - "list-repositories-starred-by-the-authenticated-user": []*Endpoint{ - {urlFormats: []string{"user/starred"}, httpMethod: "GET"}, - }, - - "list-watchers": []*Endpoint{ - {urlFormats: []string{"repos/%v/%v/subscribers"}, httpMethod: "GET"}, - }, - - "get-feeds": []*Endpoint{ - {urlFormats: []string{"feeds"}, httpMethod: "GET"}, - }, - - "get-a-thread": []*Endpoint{ - {urlFormats: []string{"notifications/threads/%v"}, httpMethod: "GET"}, - }, - - "mark-a-thread-as-read": []*Endpoint{ - {urlFormats: []string{"notifications/threads/%v"}, httpMethod: "PATCH"}, - }, - - "list-stargazers": []*Endpoint{ - {urlFormats: []string{"repos/%v/%v/stargazers"}, httpMethod: "GET"}, - }, - - "list-repositories-watched-by-a-user": []*Endpoint{ - {urlFormats: []string{"users/%v/subscriptions"}, httpMethod: "GET"}, - }, - - "list-repository-notifications-for-the-authenticated-user": []*Endpoint{ - {urlFormats: []string{"repos/%v/%v/notifications"}, httpMethod: "GET"}, - }, - - "mark-repository-notifications-as-read": []*Endpoint{ - {urlFormats: []string{"repos/%v/%v/notifications"}, httpMethod: "PUT"}, - }, - - "check-if-a-repository-is-starred-by-the-authenticated-user": []*Endpoint{ - {urlFormats: []string{"user/starred/%v/%v"}, httpMethod: "GET"}, - }, - - "list-notifications-for-the-authenticated-user": []*Endpoint{ - {urlFormats: []string{"notifications"}, httpMethod: "GET"}, - }, - - "get-a-thread-subscription-for-the-authenticated-user": []*Endpoint{ - {urlFormats: []string{"notifications/threads/%v/subscription"}, httpMethod: "GET"}, - }, - - "unstar-a-repository-for-the-authenticated-user": []*Endpoint{ - {urlFormats: []string{"user/starred/%v/%v"}, httpMethod: "DELETE"}, - }, - - "list-repositories-watched-by-the-authenticated-user": []*Endpoint{ - {urlFormats: []string{"user/subscriptions"}, httpMethod: "GET"}, - }, - - "get-a-repository-subscription": []*Endpoint{ - {urlFormats: []string{"repos/%v/%v/subscription"}, httpMethod: "GET"}, - }, - - "set-a-repository-subscription": []*Endpoint{ - {urlFormats: []string{"repos/%v/%v/subscription"}, httpMethod: "PUT"}, - }, - - "list-repositories-starred-by-a-user": []*Endpoint{ - {urlFormats: []string{"users/%v/starred"}, httpMethod: "GET"}, - }, -} - -//go:embed testdata/activity-events.html -var activityEventsTestWebPage string - -//go:embed testdata/activity_events-original.go -var activityEventsGoFileOriginal string - -//go:embed testdata/activity_events-want.go -var activityEventsGoFileWant string diff --git a/update-urls/go.mod b/update-urls/go.mod deleted file mode 100644 index 81d9a3a5848..00000000000 --- a/update-urls/go.mod +++ /dev/null @@ -1,8 +0,0 @@ -module github.com/google/go-github/v56/update-urls - -go 1.16 - -require ( - github.com/google/go-cmp v0.6.0 - github.com/pmezard/go-difflib v1.0.0 -) diff --git a/update-urls/go.sum b/update-urls/go.sum deleted file mode 100644 index ddc1bfa1ce9..00000000000 --- a/update-urls/go.sum +++ /dev/null @@ -1,4 +0,0 @@ -github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= diff --git a/update-urls/main.go b/update-urls/main.go deleted file mode 100644 index 77938be6de7..00000000000 --- a/update-urls/main.go +++ /dev/null @@ -1,1352 +0,0 @@ -// Copyright 2020 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. - -// update-urls updates GitHub URL docs for each service endpoint. -// -// It is meant to be used periodically by go-github repo maintainers -// to update stale GitHub Developer v3 API documentation URLs. -// -// Usage (from go-github directory): -// -// go run ./update-urls/main.go -// go generate ./... -// go test ./... -// go vet ./... -// -// When confronted with "PLEASE CHECK MANUALLY AND FIX", the problematic -// URL needs to be debugged. To debug a specific file, run like this: -// -// go run ./update-urls/main.go -v -d enterprise_actions_runners.go -package main - -import ( - "errors" - "flag" - "fmt" - "go/ast" - "go/parser" - "go/token" - "io" - "log" - "net/http" - "os" - "regexp" - "sort" - "strings" - "time" - - "github.com/google/go-cmp/cmp" -) - -const ( - codeLegacySplitString = `` - codeSplitString = `await octokit.request('` - skipPrefix = "gen-" - - // enterpriseURL = "docs.github.com" - stdURL = "docs.github.com" - - enterpriseRefFmt = "// GitHub Enterprise API docs: %v" - stdRefFmt = "// GitHub API docs: %v" - - httpGetDelay = 1 * time.Second -) - -var ( - verbose = flag.Bool("v", false, "Print verbose log messages") - debugFile = flag.String("d", "", "Debug named file only") - - fragmentIDStringRE = regexp.MustCompile(`

    ]*id="`) - stripHTMLRE = regexp.MustCompile(`<\/?[^>]+\/?>`) - condenseWhitespaceRE = regexp.MustCompile(`\s+`) - - // skipMethods holds methods which are skipped because they do not have GitHub v3 - // API URLs or are otherwise problematic in parsing, discovering, and/or fixing. - skipMethods = map[string]bool{ - "ActionsService.DownloadArtifact": true, - "AdminService.CreateOrg": true, - "AdminService.CreateUser": true, - "AdminService.CreateUserImpersonation": true, - "AdminService.DeleteUserImpersonation": true, - "AdminService.GetAdminStats": true, - "AdminService.RenameOrg": true, - "AdminService.RenameOrgByName": true, - "AdminService.UpdateTeamLDAPMapping": true, - "AdminService.UpdateUserLDAPMapping": true, - "AppsService.CreateAttachment": true, - "AppsService.FindRepositoryInstallationByID": true, - "AuthorizationsService.CreateImpersonation": true, - "AuthorizationsService.DeleteImpersonation": true, - "IssueImportService.CheckStatus": true, - "IssueImportService.CheckStatusSince": true, - "IssueImportService.Create": true, - "MarketplaceService.marketplaceURI": true, - "MigrationService.UserMigrationArchiveURL": true, - "OrganizationsService.GetByID": true, - "RepositoriesService.CompareCommits": true, - "RepositoriesService.CompareCommitsRaw": true, - "RepositoriesService.DeletePreReceiveHook": true, - "RepositoriesService.DownloadContents": true, - "RepositoriesService.DownloadContentsWithMeta": true, - "RepositoriesService.GetArchiveLink": true, - "RepositoriesService.GetByID": true, - "RepositoriesService.GetPreReceiveHook": true, - "RepositoriesService.ListPreReceiveHooks": true, - "RepositoriesService.UpdatePreReceiveHook": true, - "SearchService.search": true, - "TeamsService.ListTeamMembersByID": true, - "UsersService.DemoteSiteAdmin": true, - "UsersService.GetByID": true, - "UsersService.PromoteSiteAdmin": true, - "UsersService.Suspend": true, - "UsersService.Unsuspend": true, - } - - helperOverrides = map[string]overrideFunc{ - "s.search": func(arg string) (httpMethod, url string) { - return "GET", fmt.Sprintf("search/%v", arg) - }, - } - - // methodOverrides contains overrides for troublesome endpoints. - methodOverrides = map[string]string{ - "OrganizationsService.EditOrgMembership: method orgs/%v/memberships/%v": "PUT", - "OrganizationsService.EditOrgMembership: PUT user/memberships/orgs/%v": "PATCH", - } - - paramLegacyRE = regexp.MustCompile(`:[a-z_]+`) - paramRE = regexp.MustCompile(`{[a-z_]+}`) -) - -type overrideFunc func(arg string) (httpMethod, url string) - -func logf(fmt string, args ...interface{}) { - if *verbose { - log.Printf(fmt, args...) - } -} - -type servicesMap map[string]*Service -type endpointsMap map[string]*Endpoint - -func main() { - flag.Parse() - fset := token.NewFileSet() - - sourceFilter := func(fi os.FileInfo) bool { - return !strings.HasSuffix(fi.Name(), "_test.go") && !strings.HasPrefix(fi.Name(), skipPrefix) - } - - if err := os.Chdir("./github"); err != nil { - if err := os.Chdir("../github"); err != nil { - log.Fatalf("Please run this from the go-github directory.") - } - } - - pkgs, err := parser.ParseDir(fset, ".", sourceFilter, parser.ParseComments) - if err != nil { - log.Fatal(err) - } - - // Step 1 - get a map of all services. - services := findAllServices(pkgs) - - // Step 2 - find all the API service endpoints. - iter := &realAstFileIterator{fset: fset, pkgs: pkgs} - endpoints, err := findAllServiceEndpoints(iter, services) - if err != nil { - log.Fatalf("\n%v", err) - } - - // Step 3 - resolve all missing httpMethods from helperMethods. - // Additionally, use existing URLs as hints to pre-cache all apiDocs. - docCache := &documentCache{positioner: iter} - usedHelpers, endpointsByFilename := resolveHelpersAndCacheDocs(endpoints, docCache) - - // Step 4 - validate and rewrite all URLs, skipping used helper methods. - frw := &liveFileRewriter{fset: fset} - validateRewriteURLs(usedHelpers, endpointsByFilename, docCache, frw) - - logf("Done.") -} - -type usedHelpersMap map[string]bool -type endpointsByFilenameMap map[string][]*Endpoint - -// FileRewriter read/writes files and converts AST token positions. -type FileRewriter interface { - Position(token.Pos) token.Position - ReadFile(filename string) ([]byte, error) - WriteFile(filename string, buf []byte, mode os.FileMode) error -} - -// liveFileRewriter implements FileRewriter. -type liveFileRewriter struct { - fset *token.FileSet -} - -func (lfr *liveFileRewriter) Position(pos token.Pos) token.Position { return lfr.fset.Position(pos) } -func (lfr *liveFileRewriter) ReadFile(filename string) ([]byte, error) { - return os.ReadFile(filename) -} -func (lfr *liveFileRewriter) WriteFile(filename string, buf []byte, mode os.FileMode) error { - return os.WriteFile(filename, buf, mode) -} - -func validateRewriteURLs(usedHelpers usedHelpersMap, endpointsByFilename endpointsByFilenameMap, docCache documentCacheReader, fileRewriter FileRewriter) { - for filename, slc := range endpointsByFilename { - logf("Step 4 - Processing %v methods in %v ...", len(slc), filename) - - var fileEdits []*FileEdit - for _, endpoint := range slc { - fullName := fmt.Sprintf("%v.%v", endpoint.serviceName, endpoint.endpointName) - if usedHelpers[fullName] { - logf("Step 4 - skipping used helper method %q", fullName) - continue - } - - // First, find the correct GitHub v3 API URL by httpMethod and urlFormat. - for _, path := range endpoint.urlFormats { - path = strings.ReplaceAll(path, "%d", "%v") - path = strings.ReplaceAll(path, "%s", "%v") - - // Check the overrides. - endpoint.checkHTTPMethodOverride(path) - - methodAndPath := fmt.Sprintf("%v %v", endpoint.httpMethod, path) - url, ok := docCache.URLByMethodAndPath(methodAndPath) - if !ok { - if i := len(endpoint.endpointComments); i > 0 { - pos := fileRewriter.Position(endpoint.endpointComments[i-1].Pos()) - fmt.Printf("%v:%v:%v: WARNING: unable to find online docs for %q: (%v)\nPLEASE CHECK MANUALLY AND FIX.\n", pos.Filename, pos.Line, pos.Column, fullName, methodAndPath) - } else { - fmt.Printf("%v: WARNING: unable to find online docs for %q: (%v)\nPLEASE CHECK MANUALLY AND FIX.\n", filename, fullName, methodAndPath) - } - continue - } - logf("found %q for: %q (%v)", url, fullName, methodAndPath) - - // Make sure URL is up-to-date. - switch { - case len(endpoint.enterpriseRefLines) > 1: - log.Printf("WARNING: multiple Enterprise GitHub URLs found - skipping:") - for i, refLine := range endpoint.enterpriseRefLines { - log.Printf("line %v: %#v", i, refLine) - } - case len(endpoint.enterpriseRefLines) > 0: - line := fmt.Sprintf(enterpriseRefFmt, url) - cmt := endpoint.enterpriseRefLines[0] - if cmt.Text != line { - pos := fileRewriter.Position(cmt.Pos()) - logf("At byte offset %v:\nFOUND %q\nWANT: %q", pos.Offset, cmt.Text, line) - fileEdits = append(fileEdits, &FileEdit{ - pos: pos, - fromText: cmt.Text, - toText: line, - }) - } - case len(endpoint.stdRefLines) > 1: - var foundMatch bool - line := fmt.Sprintf(stdRefFmt, url) - for i, stdRefLine := range endpoint.stdRefLines { - if stdRefLine.Text == line { - foundMatch = true - logf("found match with %v, not editing and removing from list", line) - // Remove matching line - endpoint.stdRefLines = append(endpoint.stdRefLines[:i], endpoint.stdRefLines[i+1:]...) - break - } - } - if !foundMatch { // Edit last stdRefLine, then remove it. - cmt := endpoint.stdRefLines[len(endpoint.stdRefLines)-1] - pos := fileRewriter.Position(cmt.Pos()) - logf("stdRefLines=%v: At byte offset %v:\nFOUND %q\nWANT: %q", len(endpoint.stdRefLines), pos.Offset, cmt.Text, line) - fileEdits = append(fileEdits, &FileEdit{ - pos: pos, - fromText: cmt.Text, - toText: line, - }) - endpoint.stdRefLines = endpoint.stdRefLines[:len(endpoint.stdRefLines)-1] - } - case len(endpoint.stdRefLines) > 0: - line := fmt.Sprintf(stdRefFmt, url) - cmt := endpoint.stdRefLines[0] - if cmt.Text != line { - pos := fileRewriter.Position(cmt.Pos()) - logf("stdRefLines=1: At byte offset %v:\nFOUND %q\nWANT: %q", pos.Offset, cmt.Text, line) - fileEdits = append(fileEdits, &FileEdit{ - pos: pos, - fromText: cmt.Text, - toText: line, - }) - } - endpoint.stdRefLines = nil - case len(endpoint.endpointComments) > 0: - lastCmt := endpoint.endpointComments[len(endpoint.endpointComments)-1] - // logf("lastCmt.Text=%q (len=%v)", lastCmt.Text, len(lastCmt.Text)) - pos := fileRewriter.Position(lastCmt.Pos()) - pos.Offset += len(lastCmt.Text) - line := "\n" + fmt.Sprintf(stdRefFmt, url) - if lastCmt.Text != "//" { - line = "\n//" + line // Add blank comment line before URL. - } - // logf("line=%q (len=%v)", line, len(line)) - // logf("At byte offset %v: adding missing documentation:\n%q", pos.Offset, line) - fileEdits = append(fileEdits, &FileEdit{ - pos: pos, - fromText: "", - toText: line, - }) - default: // Missing documentation - add it. - log.Printf("WARNING: file %v has no godoc comment string for method %v", fullName, methodAndPath) - } - } - } - - if len(fileEdits) > 0 { - b, err := fileRewriter.ReadFile(filename) - if err != nil { - log.Fatalf("ReadFile: %v", err) - } - - log.Printf("Performing %v edits on file %v", len(fileEdits), filename) - b = performBufferEdits(b, fileEdits) - - if err := fileRewriter.WriteFile(filename, b, 0644); err != nil { - log.Fatalf("WriteFile: %v", err) - } - } - } -} - -func performBufferEdits(b []byte, fileEdits []*FileEdit) []byte { - fileEdits = sortAndMergeFileEdits(fileEdits) - - for _, edit := range fileEdits { - prelude := b[0:edit.pos.Offset] - postlude := b[edit.pos.Offset+len(edit.fromText):] - logf("At byte offset %v, replacing %v bytes with %v bytes\nBEFORE: %v\nAFTER : %v", edit.pos.Offset, len(edit.fromText), len(edit.toText), edit.fromText, edit.toText) - b = []byte(fmt.Sprintf("%s%v%s", prelude, edit.toText, postlude)) - } - - return b -} - -func sortAndMergeFileEdits(fileEdits []*FileEdit) []*FileEdit { - // Sort edits from last to first in the file. - // If the offsets are identical, sort the comment "toText" strings, ascending. - var foundDups bool - sort.Slice(fileEdits, func(a, b int) bool { - if fileEdits[a].pos.Offset == fileEdits[b].pos.Offset { - foundDups = true - return fileEdits[a].toText < fileEdits[b].toText - } - return fileEdits[a].pos.Offset > fileEdits[b].pos.Offset - }) - - if !foundDups { - return fileEdits - } - - // Merge the duplicate edits. - var mergedEdits []*FileEdit - var dupOffsets []*FileEdit - - mergeFunc := func() { - if len(dupOffsets) > 1 { - isInsert := dupOffsets[0].fromText == "" - var hasBlankCommentLine bool - - // Merge dups - var lines []string - for _, dup := range dupOffsets { - if isInsert && strings.HasPrefix(dup.toText, "\n//\n//") { - lines = append(lines, strings.TrimPrefix(dup.toText, "\n//")) - hasBlankCommentLine = true - } else { - lines = append(lines, dup.toText) - } - } - sort.Strings(lines) - - var joinStr string - // if insert, no extra newlines - if !isInsert { // if replacement - add newlines - joinStr = "\n" - } - toText := strings.Join(lines, joinStr) - if hasBlankCommentLine { // Add back in - toText = "\n//" + toText - } - mergedEdits = append(mergedEdits, &FileEdit{ - pos: dupOffsets[0].pos, - fromText: dupOffsets[0].fromText, - toText: toText, - }) - } else if len(dupOffsets) > 0 { - // Move non-dup to final output - mergedEdits = append(mergedEdits, dupOffsets[0]) - } - dupOffsets = nil - } - - lastOffset := -1 - for _, fileEdit := range fileEdits { - if fileEdit.pos.Offset != lastOffset { - mergeFunc() - } - dupOffsets = append(dupOffsets, fileEdit) - lastOffset = fileEdit.pos.Offset - } - mergeFunc() - return mergedEdits -} - -// astFileIterator iterates over all files in an ast.Package. -type astFileIterator interface { - // Finds the position of a token. - Position(token.Pos) token.Position - // Reset resets the iterator. - Reset() - // Next returns the next filenameAstFilePair pair or nil if done. - Next() *filenameAstFilePair -} - -type filenameAstFilePair struct { - filename string - astFile *ast.File -} - -// realAstFileIterator implements astFileIterator. -type realAstFileIterator struct { - fset *token.FileSet - pkgs map[string]*ast.Package - ch chan *filenameAstFilePair - closed bool -} - -func (rafi *realAstFileIterator) Position(pos token.Pos) token.Position { - return rafi.fset.Position(pos) -} - -func (rafi *realAstFileIterator) Reset() { - if !rafi.closed && rafi.ch != nil { - logf("Closing old channel on Reset") - close(rafi.ch) - } - rafi.ch = make(chan *filenameAstFilePair, 10) - rafi.closed = false - - go func() { - var count int - for _, pkg := range rafi.pkgs { - for filename, f := range pkg.Files { - // logf("Sending file #%v: %v to channel", count, filename) - rafi.ch <- &filenameAstFilePair{filename: filename, astFile: f} - count++ - } - } - rafi.closed = true - close(rafi.ch) - logf("Closed channel after sending %v files", count) - if count == 0 { - log.Fatalf("Processed no files. Did you run this from the go-github directory?") - } - }() -} - -func (rafi *realAstFileIterator) Next() *filenameAstFilePair { - for pair := range rafi.ch { - // logf("Next: returning file %v", pair.filename) - return pair - } - return nil -} - -func findAllServices(pkgs map[string]*ast.Package) servicesMap { - services := servicesMap{} - for _, pkg := range pkgs { - for filename, f := range pkg.Files { - if filename != "github.go" { - continue - } - - logf("Step 1 - Processing %v ...", filename) - if err := findClientServices(f, services); err != nil { - log.Fatal(err) - } - } - } - return services -} - -func findAllServiceEndpoints(iter astFileIterator, services servicesMap) (endpointsMap, error) { - endpoints := endpointsMap{} - iter.Reset() - var errs []string // Collect all the errors and return in a big batch. - for next := iter.Next(); next != nil; next = iter.Next() { - filename, f := next.filename, next.astFile - if filename == "github.go" { - continue - } - - if *debugFile != "" && !strings.Contains(filename, *debugFile) { - continue - } - - logf("Step 2 - Processing %v ...", filename) - if err := processAST(filename, f, services, endpoints, iter); err != nil { - errs = append(errs, err.Error()) - } - } - - if len(errs) > 0 { - return nil, errors.New(strings.Join(errs, "\n")) - } - - return endpoints, nil -} - -func resolveHelpersAndCacheDocs(endpoints endpointsMap, docCache documentCacheWriter) (usedHelpers usedHelpersMap, endpointsByFilename endpointsByFilenameMap) { - logf("Step 3 - resolving helpers and cache docs ...") - usedHelpers = usedHelpersMap{} - endpointsByFilename = endpointsByFilenameMap{} - for k, v := range endpoints { - if _, ok := endpointsByFilename[v.filename]; !ok { - endpointsByFilename[v.filename] = []*Endpoint{} - } - endpointsByFilename[v.filename] = append(endpointsByFilename[v.filename], v) - - for _, cmt := range v.enterpriseRefLines { - docCache.CacheDocFromInternet(cmt.Text, v.filename, docCache.Position(cmt.Pos())) - } - for _, cmt := range v.stdRefLines { - docCache.CacheDocFromInternet(cmt.Text, v.filename, docCache.Position(cmt.Pos())) - } - - if v.httpMethod == "" && v.helperMethod != "" { - fullName := fmt.Sprintf("%v.%v", v.serviceName, v.helperMethod) - hm, ok := endpoints[fullName] - if !ok { - log.Fatalf("Unable to find helper method %q for %q", fullName, k) - } - if hm.httpMethod == "" { - log.Fatalf("Helper method %q for %q has empty httpMethod: %#v", fullName, k, hm) - } - v.httpMethod = hm.httpMethod - usedHelpers[fullName] = true - } - } - - return usedHelpers, endpointsByFilename -} - -type documentCacheReader interface { - URLByMethodAndPath(string) (string, bool) -} - -type documentCacheWriter interface { - CacheDocFromInternet(urlWithFragmentID, filename string, pos token.Position) - Position(token.Pos) token.Position -} - -type positioner interface { - Position(token.Pos) token.Position -} - -// documentCache implements documentCacheReader and documentCachWriter. -type documentCache struct { - apiDocs map[string]map[string][]*Endpoint // cached by URL, then mapped by web fragment identifier. - urlByMethodAndPath map[string]string - positioner positioner -} - -func (dc *documentCache) URLByMethodAndPath(methodAndPath string) (string, bool) { - url, ok := dc.urlByMethodAndPath[methodAndPath] - return url, ok -} - -func (dc *documentCache) CacheDocFromInternet(urlWithID, filename string, pos token.Position) { - if dc.apiDocs == nil { - dc.apiDocs = map[string]map[string][]*Endpoint{} // cached by URL, then mapped by web fragment identifier. - dc.urlByMethodAndPath = map[string]string{} - } - - baseURL, fullURL := getURL(urlWithID) - if _, ok := dc.apiDocs[baseURL]; ok { - return // already cached - } - - logf("GET %q ...", fullURL) - time.Sleep(httpGetDelay) - //nolint:gosec // G107: Potential HTTP request made with variable url - resp, err := http.Get(fullURL) - check("Unable to get URL: %v: %v", fullURL, err) - switch resp.StatusCode { - case http.StatusTooManyRequests, http.StatusServiceUnavailable: - logf("Sleeping 60 seconds and trying again...") - time.Sleep(60 * time.Second) - //nolint:gosec // G107: Potential HTTP request made with variable url - resp, err = http.Get(fullURL) - check("Unable to get URL: %v: %v", fullURL, err) - case http.StatusOK: - default: - log.Fatalf("url %v - StatusCode=%v\ngithub/%v:%v:%v %v", fullURL, resp.StatusCode, filename, pos.Line, pos.Column, urlWithID) - } - - finalURL := resp.Request.URL.String() - baseURL, fullURL = getURL(finalURL) - url := baseURL - logf("urlWithID: %v ; finalURL: %v ; baseURL: %v, fullURL: %v", urlWithID, finalURL, baseURL, fullURL) - - b, err := io.ReadAll(resp.Body) - check("Unable to read body of URL: %v, %v", url, err) - check("Unable to close body of URL: %v, %v", url, resp.Body.Close()) - dc.apiDocs[url] = parseWebPageEndpoints(string(b)) - check("Unable to parse web page endpoints: url: %v, filename: %v, err: %v", url, filename, err) - logf("Found %v web page fragment identifiers.", len(dc.apiDocs[url])) - if len(dc.apiDocs[url]) == 0 { - logf("webage text: %s", b) - } - - // Now reverse-map the methods+paths to URLs. - for fragID, v := range dc.apiDocs[url] { - logf("For fragID=%q, found %v endpoints.", fragID, len(v)) - for _, endpoint := range v { - logf("For fragID=%q, endpoint=%q, found %v paths.", fragID, endpoint, len(endpoint.urlFormats)) - for _, path := range endpoint.urlFormats { - methodAndPath := fmt.Sprintf("%v %v", endpoint.httpMethod, path) - dc.urlByMethodAndPath[methodAndPath] = fmt.Sprintf("%v#%v", strings.TrimRight(url, "/"), fragID) - logf("urlByMethodAndPath[%q] = %q", methodAndPath, dc.urlByMethodAndPath[methodAndPath]) - } - } - } -} - -func (dc *documentCache) Position(pos token.Pos) token.Position { - return dc.positioner.Position(pos) -} - -// FileEdit represents an edit that needs to be performed on a file. -type FileEdit struct { - pos token.Position - fromText string - toText string -} - -func getURL(s string) (baseURL, fullURL string) { - i := strings.Index(s, "http") - if i < 0 { - return "", "" - } - j := strings.Index(s, "#") - if j < i { - if !strings.HasSuffix(s, "/") { // Prevent unnecessary redirects if possible. - s += "/" - } - baseURL = s[i:] - fullURL = s[i:] - } else { - fullURL = s[i:] - baseURL = s[i:j] - if !strings.HasSuffix(baseURL, "/") { // Prevent unnecessary redirects if possible. - baseURL += "/" - } - } - return baseURL, fullURL -} - -// Service represents a go-github service. -type Service struct { - serviceName string -} - -// Endpoint represents an API endpoint in this repo. -type Endpoint struct { - endpointName string - filename string - serviceName string - urlFormats []string - httpMethod string - helperMethod string // If populated, httpMethod lives in helperMethod. - - enterpriseRefLines []*ast.Comment - stdRefLines []*ast.Comment - endpointComments []*ast.Comment -} - -// String helps with debugging by providing an easy-to-read summary of the endpoint. -func (e *Endpoint) String() string { - if e == nil { - return "Endpoint{nil}" - } - var b strings.Builder - if e.filename != "" { - b.WriteString(fmt.Sprintf(" filename: %v\n", e.filename)) - } - if e.serviceName != "" { - b.WriteString(fmt.Sprintf(" serviceName: %v\n", e.serviceName)) - } - if e.endpointName != "" { - b.WriteString(fmt.Sprintf(" endpointName: %v\n", e.endpointName)) - } - b.WriteString(fmt.Sprintf(" httpMethod: %v\n", e.httpMethod)) - if e.helperMethod != "" { - b.WriteString(fmt.Sprintf(" helperMethod: %v\n", e.helperMethod)) - } - for i := 0; i < len(e.urlFormats); i++ { - b.WriteString(fmt.Sprintf(" urlFormats[%v]: %v\n", i, e.urlFormats[i])) - } - for i := 0; i < len(e.enterpriseRefLines); i++ { - b.WriteString(fmt.Sprintf(" enterpriseRefLines[%v]: comment: %v\n", i, e.enterpriseRefLines[i].Text)) - } - for i := 0; i < len(e.stdRefLines); i++ { - b.WriteString(fmt.Sprintf(" stdRefLines[%v]: comment: %v\n", i, e.stdRefLines[i].Text)) - } - return b.String() -} - -func (e *Endpoint) checkHTTPMethodOverride(path string) { - lookupOverride := fmt.Sprintf("%v.%v: %v %v", e.serviceName, e.endpointName, e.httpMethod, path) - logf("Looking up override for %q", lookupOverride) - if v, ok := methodOverrides[lookupOverride]; ok { - logf("overriding method for %v to %q", lookupOverride, v) - e.httpMethod = v - return - } -} - -func processAST(filename string, f *ast.File, services servicesMap, endpoints endpointsMap, iter astFileIterator) error { - var errs []string - - for _, decl := range f.Decls { - switch decl := decl.(type) { - case *ast.FuncDecl: // Doc, Recv, Name, Type, Body - if decl.Recv == nil || len(decl.Recv.List) != 1 || decl.Name == nil || decl.Body == nil { - continue - } - - recv := decl.Recv.List[0] - se, ok := recv.Type.(*ast.StarExpr) // Star, X - if !ok || se.X == nil || len(recv.Names) != 1 { - if decl.Name.Name != "String" && decl.Name.Name != "Equal" && decl.Name.Name != "IsPullRequest" { - pos := iter.Position(recv.Pos()) - if id, ok := recv.Type.(*ast.Ident); ok { - pos = iter.Position(id.Pos()) - } - errs = append(errs, fmt.Sprintf("%v:%v:%v: method %v does not use a pointer receiver and needs fixing!", pos.Filename, pos.Line, pos.Column, decl.Name)) - } - continue - } - recvType, ok := se.X.(*ast.Ident) // NamePos, Name, Obj - if !ok { - return fmt.Errorf("unhandled se.X = %T", se.X) - } - serviceName := recvType.Name - if _, ok := services[serviceName]; !ok { - continue - } - endpointName := decl.Name.Name - fullName := fmt.Sprintf("%v.%v", serviceName, endpointName) - if skipMethods[fullName] { - logf("skipping %v", fullName) - continue - } - - receiverName := recv.Names[0].Name - - logf("\n\nast.FuncDecl: %#v", *decl) // Doc, Recv, Name, Type, Body - logf("ast.FuncDecl.Name: %#v", *decl.Name) // NamePos, Name, Obj(nil) - // logf("ast.FuncDecl.Recv: %#v", *decl.Recv) // Opening, List, Closing - logf("ast.FuncDecl.Recv.List[0]: %#v", *recv) // Doc, Names, Type, Tag, Comment - // for i, name := range decl.Recv.List[0].Names { - // logf("recv.name[%v] = %v", i, name.Name) - // } - logf("recvType = %#v", recvType) - var enterpriseRefLines []*ast.Comment - var stdRefLines []*ast.Comment - var endpointComments []*ast.Comment - if decl.Doc != nil { - endpointComments = decl.Doc.List - for i, comment := range decl.Doc.List { - logf("doc.comment[%v] = %#v", i, *comment) - // if strings.Contains(comment.Text, enterpriseURL) { - // enterpriseRefLines = append(enterpriseRefLines, comment) - // } else - if strings.Contains(comment.Text, stdURL) { - stdRefLines = append(stdRefLines, comment) - } - } - logf("%v comment lines, %v enterprise URLs, %v standard URLs", len(decl.Doc.List), len(enterpriseRefLines), len(stdRefLines)) - } - - bd := &bodyData{receiverName: receiverName} - if err := bd.parseBody(decl.Body); err != nil { // Lbrace, List, Rbrace - return fmt.Errorf("parseBody: %v", err) - } - - ep := &Endpoint{ - endpointName: endpointName, - filename: filename, - serviceName: serviceName, - urlFormats: bd.urlFormats, - httpMethod: bd.httpMethod, - helperMethod: bd.helperMethod, - enterpriseRefLines: enterpriseRefLines, - stdRefLines: stdRefLines, - endpointComments: endpointComments, - } - // ep.checkHTTPMethodOverride("") - endpoints[fullName] = ep - logf("endpoints[%q] = %#v", fullName, endpoints[fullName]) - if ep.httpMethod == "" && (ep.helperMethod == "" || len(ep.urlFormats) == 0) { - return fmt.Errorf("filename=%q, endpoint=%q: could not find body info: %#v", filename, fullName, *ep) - } - case *ast.GenDecl: - default: - return fmt.Errorf("unhandled decl type: %T", decl) - } - } - - if len(errs) > 0 { - return errors.New(strings.Join(errs, "\n")) - } - - return nil -} - -// bodyData contains information found in a BlockStmt. -type bodyData struct { - receiverName string // receiver name of method to help identify helper methods. - httpMethod string - urlVarName string - urlFormats []string - assignments []lhsrhs - helperMethod string // If populated, httpMethod lives in helperMethod. -} - -func (b *bodyData) parseBody(body *ast.BlockStmt) error { - logf("body=%#v", *body) - - // Find the variable used for the format string, its one-or-more values, - // and the httpMethod used for the NewRequest. - for _, stmt := range body.List { - switch stmt := stmt.(type) { - case *ast.AssignStmt: - hm, uvn, hlp, asgn := processAssignStmt(b.receiverName, stmt) - if b.httpMethod != "" && hm != "" && b.httpMethod != hm { - return fmt.Errorf("found two httpMethod values: %q and %q", b.httpMethod, hm) - } - if hm != "" { - b.httpMethod = hm - // logf("parseBody: httpMethod=%v", b.httpMethod) - } - if hlp != "" { - b.helperMethod = hlp - } - b.assignments = append(b.assignments, asgn...) - // logf("assignments=%#v", b.assignments) - if b.urlVarName == "" && uvn != "" { - b.urlVarName = uvn - // logf("parseBody: urlVarName=%v", b.urlVarName) - // By the time the urlVarName is found, all assignments should - // have already taken place so that we can find the correct - // ones and determine the urlFormats. - for _, lr := range b.assignments { - if lr.lhs == b.urlVarName { - b.urlFormats = append(b.urlFormats, lr.rhs) - logf("found urlFormat: %v", lr.rhs) - } - } - } - case *ast.DeclStmt: - logf("*ast.DeclStmt: %#v", *stmt) - case *ast.DeferStmt: - logf("*ast.DeferStmt: %#v", *stmt) - case *ast.ExprStmt: - logf("*ast.ExprStmt: %#v", *stmt) - case *ast.IfStmt: - if err := b.parseIf(stmt); err != nil { - return err - } - case *ast.RangeStmt: - logf("*ast.RangeStmt: %#v", *stmt) - case *ast.ReturnStmt: // Return Results - logf("*ast.ReturnStmt: %#v", *stmt) - if len(stmt.Results) > 0 { - switch rslt0 := stmt.Results[0].(type) { - case *ast.CallExpr: - recv, funcName, args := processCallExpr(rslt0) - logf("return CallExpr: recv=%q, funcName=%q, args=%#v", recv, funcName, args) - // If the httpMethod has not been found at this point, but - // this method is calling a helper function, then see if - // any of its arguments match a previous assignment, then - // record the urlFormat and remember the helper method. - if b.httpMethod == "" && len(args) > 1 && recv == b.receiverName { - if args[0] != "ctx" { - return fmt.Errorf("expected helper function to get ctx as first arg: %#v, %#v", args, *b) - } - if len(b.assignments) == 0 && len(b.urlFormats) == 0 { - b.urlFormats = append(b.urlFormats, strings.Trim(args[1], `"`)) - b.helperMethod = funcName - switch b.helperMethod { - case "deleteReaction": - b.httpMethod = "DELETE" - default: - logf("WARNING: helper method %q not found", b.helperMethod) - } - logf("found urlFormat: %v and helper method: %v, httpMethod: %v", b.urlFormats[0], b.helperMethod, b.httpMethod) - } else { - for _, lr := range b.assignments { - if lr.lhs == args[1] { // Multiple matches are possible. Loop over all assignments. - b.urlVarName = args[1] - b.urlFormats = append(b.urlFormats, lr.rhs) - b.helperMethod = funcName - switch b.helperMethod { - case "deleteReaction": - b.httpMethod = "DELETE" - default: - logf("WARNING: helper method %q not found", b.helperMethod) - } - logf("found urlFormat: %v and helper method: %v, httpMethod: %v", lr.rhs, b.helperMethod, b.httpMethod) - } - } - } - } - default: - logf("WARNING: stmt.Results[0] unhandled type = %T = %#v", stmt.Results[0], stmt.Results[0]) - } - } - case *ast.SwitchStmt: - logf("*ast.SwitchStmt: %#v", *stmt) - default: - return fmt.Errorf("unhandled stmt type: %T", stmt) - } - } - logf("parseBody: assignments=%#v", b.assignments) - - return nil -} - -func (b *bodyData) parseIf(stmt *ast.IfStmt) error { - logf("parseIf: *ast.IfStmt: %#v", *stmt) - if err := b.parseBody(stmt.Body); err != nil { - return err - } - logf("parseIf: if body: b=%#v", *b) - if stmt.Else != nil { - switch els := stmt.Else.(type) { - case *ast.BlockStmt: - if err := b.parseBody(els); err != nil { - return err - } - logf("parseIf: if else: b=%#v", *b) - case *ast.IfStmt: - if err := b.parseIf(els); err != nil { - return err - } - default: - return fmt.Errorf("unhandled else stmt type %T", els) - } - } - - return nil -} - -// lhsrhs represents an assignment with a variable name on the left -// and a string on the right - used to find the URL format string. -type lhsrhs struct { - lhs string - rhs string -} - -func processAssignStmt(receiverName string, stmt *ast.AssignStmt) (httpMethod, urlVarName, helperMethod string, assignments []lhsrhs) { - logf("*ast.AssignStmt: %#v", *stmt) // Lhs, TokPos, Tok, Rhs - var lhs []string - for _, expr := range stmt.Lhs { - switch expr := expr.(type) { - case *ast.Ident: // NamePos, Name, Obj - logf("processAssignStmt: *ast.Ident: %#v", expr) - lhs = append(lhs, expr.Name) - case *ast.SelectorExpr: // X, Sel - logf("processAssignStmt: *ast.SelectorExpr: %#v", expr) - default: - log.Fatalf("unhandled AssignStmt Lhs type: %T", expr) - } - } - - for i, expr := range stmt.Rhs { - switch expr := expr.(type) { - case *ast.BasicLit: // ValuePos, Kind, Value - v := strings.Trim(expr.Value, `"`) - if !strings.HasPrefix(v, "?") { // Hack to remove "?recursive=1" - assignments = append(assignments, lhsrhs{lhs: lhs[i], rhs: v}) - } - case *ast.BinaryExpr: - logf("processAssignStmt: *ast.BinaryExpr: %#v", *expr) - case *ast.CallExpr: // Fun, Lparen, Args, Ellipsis, Rparen - recv, funcName, args := processCallExpr(expr) - logf("processAssignStmt: CallExpr: recv=%q, funcName=%q, args=%#v", recv, funcName, args) - switch funcName { - case "addOptions": - if v := strings.Trim(args[0], `"`); v != args[0] { - assignments = append(assignments, lhsrhs{lhs: lhs[i], rhs: v}) - urlVarName = lhs[i] - } else { - urlVarName = args[0] - } - case "Sprintf": - assignments = append(assignments, lhsrhs{lhs: lhs[i], rhs: strings.Trim(args[0], `"`)}) - case "NewRequest": - httpMethod = strings.Trim(args[0], `"`) - urlVarName = args[1] - case "NewUploadRequest": - httpMethod = "POST" - urlVarName = args[0] - case "roundTripWithOptionalFollowRedirect": - httpMethod = "GET" - urlVarName = args[1] - default: - logf("WARNING: processAssignStmt: unhandled CallExpr: recv=%q, funcName=%q, args=%#v", recv, funcName, args) - } - if recv == receiverName && len(args) > 1 && args[0] == "ctx" { // This might be a helper method. - fullName := fmt.Sprintf("%v.%v", recv, funcName) - logf("checking for override: fullName=%v", fullName) - if fn, ok := helperOverrides[fullName]; ok { - logf("found helperOverride for %v", fullName) - hm, url := fn(strings.Trim(args[1], `"`)) - httpMethod = hm - urlVarName = "u" // arbitrary - assignments = []lhsrhs{{lhs: urlVarName, rhs: url}} - } else { - urlVarName = args[1] // For this to work correctly, the URL must be the second arg to the helper method! - helperMethod = funcName - logf("found possible helper method: funcName=%v, urlVarName=%v", funcName, urlVarName) - } - } - case *ast.CompositeLit: // Type, Lbrace, Elts, Rbrace, Incomplete - logf("processAssignStmt: *ast.CompositeLit: %#v", *expr) - case *ast.FuncLit: - logf("processAssignStmt: *ast.FuncLit: %#v", *expr) - case *ast.SelectorExpr: - logf("processAssignStmt: *ast.SelectorExpr: %#v", *expr) - case *ast.UnaryExpr: // OpPos, Op, X - logf("processAssignStmt: *ast.UnaryExpr: %#v", *expr) - case *ast.TypeAssertExpr: // X, Lparen, Type, Rparen - logf("processAssignStmt: *ast.TypeAssertExpr: %#v", *expr) - case *ast.Ident: // NamePos, Name, Obj - logf("processAssignStmt: *ast.Ident: %#v", *expr) - default: - log.Fatalf("unhandled AssignStmt Rhs type: %T", expr) - } - } - logf("urlVarName=%v, assignments=%#v", urlVarName, assignments) - - return httpMethod, urlVarName, helperMethod, assignments -} - -func processCallExpr(expr *ast.CallExpr) (recv, funcName string, args []string) { - logf("*ast.CallExpr: %#v", *expr) - - for _, arg := range expr.Args { - switch arg := arg.(type) { - case *ast.ArrayType: - logf("processCallExpr: *ast.ArrayType: %#v", arg) - case *ast.BasicLit: // ValuePos, Kind, Value - args = append(args, arg.Value) // Do not trim quotes here so as to identify it later as a string literal. - case *ast.CallExpr: // Fun, Lparen, Args, Ellipsis, Rparen - logf("processCallExpr: *ast.CallExpr: %#v", arg) - r, fn, as := processCallExpr(arg) - if r == "fmt" && fn == "Sprintf" && len(as) > 0 { // Special case - return format string. - args = append(args, as[0]) - } - case *ast.CompositeLit: - logf("processCallExpr: *ast.CompositeLit: %#v", arg) // Type, Lbrace, Elts, Rbrace, Incomplete - case *ast.Ident: // NamePos, Name, Obj - args = append(args, arg.Name) - case *ast.MapType: - logf("processCallExpr: *ast.MapType: %#v", arg) - case *ast.SelectorExpr: // X, Sel - logf("processCallExpr: *ast.SelectorExpr: %#v", arg) - x, ok := arg.X.(*ast.Ident) - if ok { // special case - switch name := fmt.Sprintf("%v.%v", x.Name, arg.Sel.Name); name { - case "http.MethodGet": - args = append(args, http.MethodGet) - case "http.MethodHead": - args = append(args, http.MethodHead) - case "http.MethodPost": - args = append(args, http.MethodPost) - case "http.MethodPut": - args = append(args, http.MethodPut) - case "http.MethodPatch": - args = append(args, http.MethodPatch) - case "http.MethodDelete": - args = append(args, http.MethodDelete) - case "http.MethodConnect": - args = append(args, http.MethodConnect) - case "http.MethodOptions": - args = append(args, http.MethodOptions) - case "http.MethodTrace": - args = append(args, http.MethodTrace) - default: - args = append(args, name) - } - } - case *ast.StarExpr: - logf("processCallExpr: *ast.StarExpr: %#v", arg) - case *ast.StructType: - logf("processCallExpr: *ast.StructType: %#v", arg) - case *ast.UnaryExpr: // OpPos, Op, X - switch x := arg.X.(type) { - case *ast.Ident: - args = append(args, x.Name) - case *ast.CompositeLit: // Type, Lbrace, Elts, Rbrace, Incomplete - logf("processCallExpr: *ast.CompositeLit: %#v", x) - default: - log.Fatalf("processCallExpr: unhandled UnaryExpr.X arg type: %T", arg.X) - } - default: - log.Fatalf("processCallExpr: unhandled arg type: %T", arg) - } - } - - switch fun := expr.Fun.(type) { - case *ast.Ident: // NamePos, Name, Obj - funcName = fun.Name - case *ast.SelectorExpr: // X, Sel - funcName = fun.Sel.Name - switch x := fun.X.(type) { - case *ast.Ident: // NamePos, Name, Obj - logf("processCallExpr: X recv *ast.Ident=%#v", x) - recv = x.Name - case *ast.ParenExpr: - logf("processCallExpr: X recv *ast.ParenExpr: %#v", x) - case *ast.SelectorExpr: // X, Sel - logf("processCallExpr: X recv *ast.SelectorExpr: %#v", x.Sel) - recv = x.Sel.Name - case *ast.CallExpr: // Fun, LParen, Args, Ellipsis, RParen - logf("processCallExpr: X recv *ast.CallExpr: %#v", x) - default: - log.Fatalf("processCallExpr: unhandled X receiver type: %T, funcName=%q", x, funcName) - } - default: - log.Fatalf("processCallExpr: unhandled Fun: %T", expr.Fun) - } - - return recv, funcName, args -} - -// findClientServices finds all go-github services from the Client struct. -func findClientServices(f *ast.File, services servicesMap) error { - for _, decl := range f.Decls { - switch decl := decl.(type) { - case *ast.GenDecl: - if decl.Tok != token.TYPE || len(decl.Specs) != 1 { - continue - } - ts, ok := decl.Specs[0].(*ast.TypeSpec) - if !ok || decl.Doc == nil || ts.Name == nil || ts.Type == nil || ts.Name.Name != "Client" { - continue - } - st, ok := ts.Type.(*ast.StructType) - if !ok || st.Fields == nil || len(st.Fields.List) == 0 { - continue - } - - for _, field := range st.Fields.List { - se, ok := field.Type.(*ast.StarExpr) - if !ok || se.X == nil || len(field.Names) != 1 { - continue - } - id, ok := se.X.(*ast.Ident) - if !ok { - continue - } - name := id.Name - if !strings.HasSuffix(name, "Service") { - continue - } - - services[name] = &Service{serviceName: name} - } - - return nil // Found all services in Client struct. - } - } - - return fmt.Errorf("unable to find Client struct in github.go") -} - -func check(fmtStr string, args ...interface{}) { - if err := args[len(args)-1]; err != nil { - log.Fatalf(fmtStr, args...) - } -} - -func endpointsEqual(a, b *Endpoint) bool { - if a == nil || b == nil { - return false - } - if a.httpMethod != b.httpMethod { - return false - } - return cmp.Equal(a.urlFormats, b.urlFormats) -} - -// parseWebPageEndpoints returns endpoint information, mapped by -// web page fragment identifier. -func parseWebPageEndpoints(buf string) map[string][]*Endpoint { - result := map[string][]*Endpoint{} - - // The GitHub v3 API web pages do not appear to be auto-generated - // and therefore, the XML decoder is too strict to reliably parse them. - // Here is a tiny example where the XML decoder completely fails - // due to mal-formed HTML: - // - // - //

    - // - // ... - // - - parts := splitHTML(buf) - var lastFragmentID string - - addDedup := func(endpoint *Endpoint) { - for _, v := range result[lastFragmentID] { - if endpointsEqual(v, endpoint) { - return - } - } - result[lastFragmentID] = append(result[lastFragmentID], endpoint) - } - - for i, part := range parts { - noHTML := stripHTML(part) - - m := fragmentIDStringRE.FindAllStringSubmatch(part, -1) - if len(m) > 0 { - fragmentIDString := m[len(m)-1][0] - if i := strings.LastIndex(part, fragmentIDString); i >= 0 { - b := part[i+len(fragmentIDString):] - i = strings.Index(b, `"`) - if i >= 0 { - lastFragmentID = b[:i] - if j := strings.Index(lastFragmentID, "--"); j > 0 { - lastFragmentID = lastFragmentID[:j] // chop off trailing "--code-samples" for example. - } - logf("Found lastFragmentID: %v", lastFragmentID) - } - } - } - - for _, method := range httpMethods { - if strings.HasPrefix(part, method) { - if lastFragmentID == "" { - logf("WARNING: ignoring empty lastFragmentID: part #%v: noHTML=\n%v", i+1, noHTML) - continue - } - endpoint := parseEndpoint(part, method) - addDedup(endpoint) - continue - } - - if endpoint := parseNewfangledEndpoint(noHTML, method); endpoint != nil && lastFragmentID != "" { - logf("part #%v: adding newfangled endpoint: %#v", i+1, endpoint) - addDedup(endpoint) - } - } - } - - return result -} - -func stripHTML(s string) string { - s = strings.ReplaceAll(s, "", "") - s = strings.ReplaceAll(s, "", "") - s = stripHTMLRE.ReplaceAllString(s, " ") - return condenseWhitespaceRE.ReplaceAllString(s, " ") -} - -func splitHTML(buf string) []string { - var result []string - for buf != "" { - i := strings.Index(buf, codeLegacySplitString) - j := strings.Index(buf, codeSplitString) - switch { - case i < 0 && j < 0: - result = append(result, buf) - buf = "" - logf("splitHTML region #%v (%v bytes): case 1: i=%v, j=%v", len(result), len(result[len(result)-1]), i, j) - case j < 0, i >= 0 && j >= 0 && i < j: - result = append(result, buf[:i]) - buf = buf[i+len(codeLegacySplitString):] - logf("splitHTML region #%v (%v bytes): case 2: i=%v, j=%v", len(result), len(result[len(result)-1]), i, j) - case i < 0, i >= 0 && j >= 0 && j < i: - result = append(result, buf[:j]) - buf = buf[j+len(codeSplitString):] - logf("splitHTML region #%v (%v bytes): case 3: i=%v, j=%v", len(result), len(result[len(result)-1]), i, j) - default: - log.Fatalf("splitHTML: i=%v, j=%v", i, j) - } - } - return result -} - -func parseNewfangledEndpoint(s, method string) *Endpoint { - parts := strings.Split(s, " ") - if len(parts) < 2 { - return nil - } - for i, part := range parts[:len(parts)-1] { - if strings.EqualFold(part, method) && strings.HasPrefix(parts[i+1], "/") { - return parseEndpoint(method+" "+parts[i+1], method) - } - } - return nil -} - -func parseEndpoint(s, method string) *Endpoint { - eol := strings.Index(s, "\n") - if eol < 0 { - eol = len(s) - } - if v := strings.Index(s, "'"); v > len(method) && v < eol { - eol = v - } - if v := strings.Index(s, "<"); v > len(method) && v < eol { - eol = v - } - // if v := strings.Index(s, "{"); v > len(method) && v < eol { - // eol = v - // } - path := strings.TrimSpace(s[len(method):eol]) - path = strings.TrimPrefix(path, "{server}") - path = paramLegacyRE.ReplaceAllString(path, "%v") - path = paramRE.ReplaceAllString(path, "%v") - // strip leading garbage - if i := strings.Index(path, "/"); i >= 0 { - path = path[i+1:] - } - path = strings.TrimSuffix(path, ".") - logf("Found endpoint: %v %v", method, path) - return &Endpoint{ - urlFormats: []string{path}, - httpMethod: method, - } -} - -var httpMethods = []string{ - "GET", - "HEAD", - "POST", - "PUT", - "PATCH", - "DELETE", - "CONNECT", - "OPTIONS", - "TRACE", -} diff --git a/update-urls/main_test.go b/update-urls/main_test.go deleted file mode 100644 index d4696e1e967..00000000000 --- a/update-urls/main_test.go +++ /dev/null @@ -1,617 +0,0 @@ -// Copyright 2020 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 main - -import ( - "fmt" - "go/parser" - "go/token" - "os" - "regexp" - "strings" - "testing" - - "github.com/google/go-cmp/cmp" - "github.com/pmezard/go-difflib/difflib" -) - -type pipelineSetup struct { - // Fields filled in by the unit test: - baseURL string - endpointsFromWebsite endpointsByFragmentID - filename string - serviceName string - originalGoSource string - wantGoSource string - wantNumEndpoints int - - // Fields filled in by setup: - docCache *fakeDocCache - fileRewriter *fakeFileRewriter - iter *fakeAstFileIterator - services servicesMap - wantFailure bool -} - -func (ps *pipelineSetup) setup(t *testing.T, stripURLs, destroyReceiverPointers bool) *pipelineSetup { - t.Helper() - - if stripURLs { - // For every GitHub API doc URL, remove it from the original source, - // and alternate between stripping the previous blank comment line and not. - for removeBlank := false; true; removeBlank = !removeBlank { - var changes bool - if removeBlank { - ps.originalGoSource, changes = removeNextURLAndOptionalBlank(ps.originalGoSource) - } else { - ps.originalGoSource, changes = removeNextURLLineOnly(ps.originalGoSource) - } - if !changes { - break - } - } - // log.Printf("Modified Go Source:\n%v", ps.originalGoSource) - } - - if destroyReceiverPointers { - from := fmt.Sprintf(" *%v) ", ps.serviceName) - to := fmt.Sprintf(" %v) ", ps.serviceName) - ps.originalGoSource = strings.ReplaceAll(ps.originalGoSource, from, to) - ps.wantFailure = true // receiver pointers must be fixed before running. - } - - ps.docCache = &fakeDocCache{ - t: t, - baseURL: ps.baseURL, - endpoints: ps.endpointsFromWebsite, - } - fset := token.NewFileSet() - ps.fileRewriter = &fakeFileRewriter{fset: fset, in: ps.originalGoSource} - ps.services = servicesMap{ps.serviceName: &Service{serviceName: ps.serviceName}} - astFile, err := parser.ParseFile(fset, ps.filename, ps.originalGoSource, parser.ParseComments) - if err != nil { - t.Fatalf("ParseFile: %v", err) - } - ps.iter = &fakeAstFileIterator{ - fset: fset, - orig: &filenameAstFilePair{ - filename: ps.filename, - astFile: astFile, - }, - } - - return ps -} - -func (ps *pipelineSetup) validate(t *testing.T) { - t.Helper() - - // Call pipeline - endpoints, err := findAllServiceEndpoints(ps.iter, ps.services) - if ps.wantFailure { - if err != nil { - // test successful - receivers must be pointers first - return - } - t.Fatalf("Expected non-pointer receivers to fail parsing, but no error was raised") - } - if err != nil { - t.Fatalf("Fail detected but not expected: %v", err) - } - - // log.Printf("endpoints=%#v (%v)", endpoints, len(endpoints)) - if len(endpoints) != ps.wantNumEndpoints { - t.Errorf("got %v endpoints, want %v", len(endpoints), ps.wantNumEndpoints) - } - usedHelpers, endpointsByFilename := resolveHelpersAndCacheDocs(endpoints, ps.docCache) - // log.Printf("endpointsByFilename=%#v (%v)", endpointsByFilename, len(endpointsByFilename[ps.filename])) - if len(endpointsByFilename[ps.filename]) != ps.wantNumEndpoints { - t.Errorf("got %v endpointsByFilename, want %v", len(endpointsByFilename[ps.filename]), ps.wantNumEndpoints) - } - validateRewriteURLs(usedHelpers, endpointsByFilename, ps.docCache, ps.fileRewriter) - - if ps.fileRewriter.out == "" { - t.Fatalf("No modifications were made to the file") - } - - if ps.fileRewriter.out != ps.wantGoSource { - diff := difflib.ContextDiff{ - A: difflib.SplitLines(ps.fileRewriter.out), - B: difflib.SplitLines(ps.wantGoSource), - FromFile: "got", - ToFile: "want", - Context: 1, - Eol: "\n", - } - result, _ := difflib.GetContextDiffString(diff) - t.Errorf(strings.Replace(result, "\t", " ", -1)) - } -} - -var ( - urlWithBlankCommentRE = regexp.MustCompile(`(//\n)?// GitHub API docs: [^\n]+\n`) - urlLineOnlyRE = regexp.MustCompile(`// GitHub API docs: [^\n]+\n`) -) - -func removeNextURLAndOptionalBlank(s string) (string, bool) { - parts := urlWithBlankCommentRE.Split(s, 2) - if len(parts) == 1 { - return parts[0], false - } - return parts[0] + parts[1], true -} - -func TestRemoveNextURLAndOptionalBlank(t *testing.T) { - tests := []struct { - name string - s string - want string - changes bool - }{ - {name: "empty string"}, - {name: "no URLs", s: "// line 1\n//\n// line 3", want: "// line 1\n//\n// line 3"}, - { - name: "URL without prior blank comment", - s: "// line 1\n// GitHub API docs: yeah\nfunc MyFunc() {\n", - want: "// line 1\nfunc MyFunc() {\n", - changes: true, - }, - { - name: "URL with prior blank comment", - s: "// line 1\n//\n// GitHub API docs: yeah\nfunc MyFunc() {\n", - want: "// line 1\nfunc MyFunc() {\n", - changes: true, - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("test #%v: %v", i, tt.name), func(t *testing.T) { - got, changes := removeNextURLAndOptionalBlank(tt.s) - if got != tt.want { - t.Errorf("got = %v, want %v", got, tt.want) - } - if changes != tt.changes { - t.Errorf("got changes = %v, want %v", changes, tt.changes) - } - }) - } -} - -func removeNextURLLineOnly(s string) (string, bool) { - parts := urlLineOnlyRE.Split(s, 2) - if len(parts) == 1 { - return parts[0], false - } - return parts[0] + parts[1], true -} - -func TestRemoveNextURLLineOnly(t *testing.T) { - tests := []struct { - name string - s string - want string - changes bool - }{ - {name: "empty string"}, - {name: "no URLs", s: "// line 1\n//\n// line 3", want: "// line 1\n//\n// line 3"}, - { - name: "URL without prior blank comment", - s: "// line 1\n// GitHub API docs: yeah\nfunc MyFunc() {\n", - want: "// line 1\nfunc MyFunc() {\n", - changes: true, - }, - { - name: "URL with prior blank comment", - s: "// line 1\n//\n// GitHub API docs: yeah\nfunc MyFunc() {\n", - want: "// line 1\n//\nfunc MyFunc() {\n", - changes: true, - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("test #%v: %v", i, tt.name), func(t *testing.T) { - got, changes := removeNextURLLineOnly(tt.s) - if got != tt.want { - t.Errorf("got = %v, want %v", got, tt.want) - } - if changes != tt.changes { - t.Errorf("got changes = %v, want %v", changes, tt.changes) - } - }) - } -} - -type endpointsByFragmentID map[string][]*Endpoint - -// fakeDocCache implements documentCacheReader and documentCacheWriter. -type fakeDocCache struct { - t *testing.T - baseURL string - endpoints endpointsByFragmentID -} - -func (f *fakeDocCache) URLByMethodAndPath(methodAndPath string) (string, bool) { - f.t.Helper() - for fragmentID, endpoints := range f.endpoints { - for _, endpoint := range endpoints { - for _, urlFormat := range endpoint.urlFormats { - key := fmt.Sprintf("%v %v", endpoint.httpMethod, urlFormat) - if key == methodAndPath { - url := fmt.Sprintf("%v#%v", f.baseURL, fragmentID) - // log.Printf("URLByMethodAndPath(%q) = (%q, true)", methodAndPath, url) - return url, true - } - } - } - } - f.t.Fatalf("fakeDocCache.URLByMethodAndPath: unable to find method %v", methodAndPath) - return "", false -} - -func (f *fakeDocCache) CacheDocFromInternet(url, filename string, pos token.Position) {} // no-op -func (f *fakeDocCache) Position(pos token.Pos) token.Position { return token.Position{} } // no-op - -// fakeFileRewriter implements FileRewriter. -type fakeFileRewriter struct { - fset *token.FileSet - in string - out string -} - -func (f *fakeFileRewriter) Position(pos token.Pos) token.Position { - return f.fset.Position(pos) -} - -func (f *fakeFileRewriter) ReadFile(filename string) ([]byte, error) { - return []byte(f.in), nil -} - -func (f *fakeFileRewriter) WriteFile(filename string, buf []byte, mode os.FileMode) error { - f.out = string(buf) - return nil -} - -// fakeAstFileIterator implements astFileIterator. -type fakeAstFileIterator struct { - orig, next *filenameAstFilePair - fset *token.FileSet -} - -func (f *fakeAstFileIterator) Position(pos token.Pos) token.Position { return f.fset.Position(pos) } -func (f *fakeAstFileIterator) Reset() { f.next = f.orig } -func (f *fakeAstFileIterator) Next() *filenameAstFilePair { - v := f.next - f.next = nil - return v -} - -func TestSortAndMergeFileEdits(t *testing.T) { - tests := []struct { - name string - fileEdits []*FileEdit - want []*FileEdit - }{ - {name: "no edits"}, - { - name: "one edit", - fileEdits: []*FileEdit{ - {toText: "one edit"}, - }, - want: []*FileEdit{ - {toText: "one edit"}, - }, - }, - { - name: "two inserts at same offset - no extra blank comment", - fileEdits: []*FileEdit{ - {pos: token.Position{Offset: 2}, fromText: "", toText: "\n// one insert"}, - {pos: token.Position{Offset: 2}, fromText: "", toText: "\n// second insert"}, - }, - want: []*FileEdit{ - {pos: token.Position{Offset: 2}, toText: "\n// one insert\n// second insert"}, - }, - }, - { - name: "two inserts at same offset - strip extra blank comment", - fileEdits: []*FileEdit{ - {pos: token.Position{Offset: 2}, fromText: "", toText: "\n//\n// one insert"}, - {pos: token.Position{Offset: 2}, fromText: "", toText: "\n//\n// second insert"}, - }, - want: []*FileEdit{ - {pos: token.Position{Offset: 2}, toText: "\n//\n// one insert\n// second insert"}, - }, - }, - { - name: "two non-overlapping edits, low offset to high", - fileEdits: []*FileEdit{ - {fromText: ".", pos: token.Position{Offset: 0}, toText: "edit one"}, - {fromText: ".", pos: token.Position{Offset: 100}, toText: "edit two"}, - }, - want: []*FileEdit{ - {fromText: ".", pos: token.Position{Offset: 100}, toText: "edit two"}, - {fromText: ".", pos: token.Position{Offset: 0}, toText: "edit one"}, - }, - }, - { - name: "two non-overlapping edits, high offset to low", - fileEdits: []*FileEdit{ - {fromText: ".", pos: token.Position{Offset: 100}, toText: "edit two"}, - {fromText: ".", pos: token.Position{Offset: 0}, toText: "edit one"}, - }, - want: []*FileEdit{ - {fromText: ".", pos: token.Position{Offset: 100}, toText: "edit two"}, - {fromText: ".", pos: token.Position{Offset: 0}, toText: "edit one"}, - }, - }, - { - name: "two overlapping edits, text low to high", - fileEdits: []*FileEdit{ - {fromText: ".", toText: "edit 0"}, - {fromText: ".", toText: "edit 1"}, - }, - want: []*FileEdit{ - {fromText: ".", toText: "edit 0\nedit 1"}, - }, - }, - { - name: "two overlapping edits, text high to low", - fileEdits: []*FileEdit{ - {fromText: ".", toText: "edit 1"}, - {fromText: ".", toText: "edit 0"}, - }, - want: []*FileEdit{ - {fromText: ".", toText: "edit 0\nedit 1"}, - }, - }, - { - name: "dup, non-dup", - fileEdits: []*FileEdit{ - {fromText: ".", toText: "edit 1"}, - {fromText: ".", toText: "edit 0"}, - {fromText: ".", pos: token.Position{Offset: 100}, toText: "edit 2"}, - }, - want: []*FileEdit{ - {fromText: ".", pos: token.Position{Offset: 100}, toText: "edit 2"}, - {fromText: ".", toText: "edit 0\nedit 1"}, - }, - }, - { - name: "non-dup, dup", - fileEdits: []*FileEdit{ - {fromText: ".", toText: "edit 2"}, - {fromText: ".", pos: token.Position{Offset: 100}, toText: "edit 1"}, - {fromText: ".", pos: token.Position{Offset: 100}, toText: "edit 0"}, - }, - want: []*FileEdit{ - {fromText: ".", pos: token.Position{Offset: 100}, toText: "edit 0\nedit 1"}, - {fromText: ".", toText: "edit 2"}, - }, - }, - { - name: "dup, non-dup, dup", - fileEdits: []*FileEdit{ - {fromText: ".", toText: "edit 1"}, - {fromText: ".", toText: "edit 0"}, - {fromText: ".", pos: token.Position{Offset: 100}, toText: "edit 2"}, - {fromText: ".", pos: token.Position{Offset: 200}, toText: "edit 4"}, - {fromText: ".", pos: token.Position{Offset: 200}, toText: "edit 3"}, - }, - want: []*FileEdit{ - {fromText: ".", pos: token.Position{Offset: 200}, toText: "edit 3\nedit 4"}, - {fromText: ".", pos: token.Position{Offset: 100}, toText: "edit 2"}, - {fromText: ".", toText: "edit 0\nedit 1"}, - }, - }, - { - name: "non-dup, dup, non-dup", - fileEdits: []*FileEdit{ - {fromText: ".", toText: "edit 2"}, - {fromText: ".", pos: token.Position{Offset: 100}, toText: "edit 1"}, - {fromText: ".", pos: token.Position{Offset: 100}, toText: "edit 0"}, - {fromText: ".", pos: token.Position{Offset: 200}, toText: "edit 3"}, - }, - want: []*FileEdit{ - {fromText: ".", pos: token.Position{Offset: 200}, toText: "edit 3"}, - {fromText: ".", pos: token.Position{Offset: 100}, toText: "edit 0\nedit 1"}, - {fromText: ".", toText: "edit 2"}, - }, - }, - { - name: "triplet, non-dup", - fileEdits: []*FileEdit{ - {fromText: ".", toText: "edit 1"}, - {fromText: ".", toText: "edit 0"}, - {fromText: ".", toText: "edit 2"}, - {fromText: ".", pos: token.Position{Offset: 100}, toText: "edit 3"}, - }, - want: []*FileEdit{ - {fromText: ".", pos: token.Position{Offset: 100}, toText: "edit 3"}, - {fromText: ".", toText: "edit 0\nedit 1\nedit 2"}, - }, - }, - } - - fileEditEqual := cmp.Comparer(func(a, b *FileEdit) bool { - return a.fromText == b.fromText && a.pos == b.pos && a.toText == b.toText - }) - - for i, tt := range tests { - t.Run(fmt.Sprintf("test #%v: %v", i, tt.name), func(t *testing.T) { - got := sortAndMergeFileEdits(tt.fileEdits) - - if len(got) != len(tt.want) { - t.Errorf("len(got) = %v, len(want) = %v", len(got), len(tt.want)) - } - for i := 0; i < len(got); i++ { - var wantFileEdit *FileEdit - if i < len(tt.want) { - wantFileEdit = tt.want[i] - } - if !cmp.Equal(got[i], wantFileEdit, fileEditEqual) { - t.Errorf("got[%v] =\n%#v\nwant[%v]:\n%#v", i, got[i], i, wantFileEdit) - } - } - }) - } -} - -func TestPerformBufferEdits(t *testing.T) { - tests := []struct { - name string - fileEdits []*FileEdit - s string - want string - }{ - {name: "no edits", s: "my\nshort\nfile\n", want: "my\nshort\nfile\n"}, - { - name: "one edit", - fileEdits: []*FileEdit{ - {pos: token.Position{Offset: 3}, fromText: "short", toText: "one edit"}, - }, - s: "my\nshort\nfile\n", - want: "my\none edit\nfile\n", - }, - { - name: "one insert", - fileEdits: []*FileEdit{ - {pos: token.Position{Offset: 2}, fromText: "", toText: "\none insert"}, - }, - s: "my\nshort\nfile\n", - want: "my\none insert\nshort\nfile\n", - }, - { - name: "two inserts at same offset", - fileEdits: []*FileEdit{ - {pos: token.Position{Offset: 2}, fromText: "", toText: "\none insert"}, - {pos: token.Position{Offset: 2}, fromText: "", toText: "\nsecond insert"}, - }, - s: "my\nshort\nfile\n", - want: "my\none insert\nsecond insert\nshort\nfile\n", - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("test #%v: %v", i, tt.name), func(t *testing.T) { - b := performBufferEdits([]byte(tt.s), tt.fileEdits) - got := string(b) - - if len(got) != len(tt.want) { - t.Errorf("len(got) = %v, len(want) = %v", len(got), len(tt.want)) - } - if got != tt.want { - t.Errorf("got = %v, want = %v", got, tt.want) - } - }) - } -} - -func TestGitURL(t *testing.T) { - tests := []struct { - name string - s string - wantBase string - wantFull string - }{ - {name: "empty string"}, - {name: "non-http", s: "howdy"}, - { - name: "normal URL, no slash", - s: "https://docs.github.com/en/rest/activity/events", - wantBase: "https://docs.github.com/en/rest/activity/events/", - wantFull: "https://docs.github.com/en/rest/activity/events/", - }, - { - name: "normal URL, with slash", - s: "https://docs.github.com/en/rest/activity/events/", - wantBase: "https://docs.github.com/en/rest/activity/events/", - wantFull: "https://docs.github.com/en/rest/activity/events/", - }, - { - name: "normal URL, with fragment identifier", - s: "https://docs.github.com/en/rest/activity/events/#list-public-events", - wantBase: "https://docs.github.com/en/rest/activity/events/", - wantFull: "https://docs.github.com/en/rest/activity/events/#list-public-events", - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("test #%v: %v", i, tt.name), func(t *testing.T) { - gotBase, gotFull := getURL(tt.s) - - if gotBase != tt.wantBase { - t.Errorf("getURL base = %v ; want %v", gotBase, tt.wantBase) - } - - if gotFull != tt.wantFull { - t.Errorf("getURL full = %v ; want %v", gotFull, tt.wantFull) - } - }) - } -} - -var endpointsEqualCmp = cmp.Comparer(endpointsEqual) - -func testWebPageHelper(t *testing.T, got, want map[string][]*Endpoint) { - t.Helper() - - for k := range got { - w, ok := want[k] - if len(got[k]) != len(w) { - t.Errorf("len(got[%q]) = %v, len(want[%q]) = %v", k, len(got[k]), k, len(w)) - } - - for i := 0; i < len(got[k]); i++ { - var wantEndpoint *Endpoint - if ok && i < len(w) { - wantEndpoint = w[i] - } - - if diff := cmp.Diff(wantEndpoint, got[k][i], endpointsEqualCmp); diff != "" { - t.Errorf("endpoint %q i=%v mismatch (-want +got):\n%v", k, i, diff) - } - } - } - - for k := range want { - if _, ok := got[k]; !ok { - t.Errorf("got[%q] = nil\nwant[%q]:\n%#v", k, k, want[k]) - } - } -} - -func TestParseEndpoint(t *testing.T) { - tests := []struct { - name string - s string - method string - want *Endpoint - }{ - { - name: "orgs_projects: list-repository-projects", - s: `GET /repos/{owner}/{repo}/projects'
    , { -`, - method: "GET", - want: &Endpoint{urlFormats: []string{"repos/%v/%v/projects"}, httpMethod: "GET"}, - }, - { - name: "orgs_projects: ListProjects", - s: `GET /orgs/{org}/projects', { -`, - method: "GET", - want: &Endpoint{urlFormats: []string{"orgs/%v/projects"}, httpMethod: "GET"}, - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("test #%v: %v", i, tt.name), func(t *testing.T) { - got := parseEndpoint(tt.s, tt.method) - - if !cmp.Equal(got, tt.want, endpointsEqualCmp) { - t.Errorf("parseEndpoint = %#v, want %#v", got, tt.want) - } - }) - } -} diff --git a/update-urls/reactions_test.go b/update-urls/reactions_test.go deleted file mode 100644 index 8d0504ec699..00000000000 --- a/update-urls/reactions_test.go +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright 2020 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 main - -import ( - _ "embed" - "strings" - "testing" -) - -func newReactionsPipeline() *pipelineSetup { - return &pipelineSetup{ - baseURL: "https://docs.github.com/en/rest/reactions/", - endpointsFromWebsite: reactionsWant, - filename: "reactions.go", - serviceName: "ReactionsService", - originalGoSource: strings.ReplaceAll(reactionsGoFileOriginal, "\r", ""), - wantGoSource: strings.ReplaceAll(reactionsGoFileWant, "\r", ""), - wantNumEndpoints: 25, - } -} - -func TestPipeline_Reactions(t *testing.T) { - ps := newReactionsPipeline() - ps.setup(t, false, false) - ps.validate(t) -} - -func TestPipeline_Reactions_FirstStripAllURLs(t *testing.T) { - ps := newReactionsPipeline() - ps.setup(t, true, false) - ps.validate(t) -} - -func TestPipeline_Reactions_FirstDestroyReceivers(t *testing.T) { - ps := newReactionsPipeline() - ps.setup(t, false, true) - ps.validate(t) -} - -func TestPipeline_Reactions_FirstStripAllURLsAndDestroyReceivers(t *testing.T) { - ps := newReactionsPipeline() - ps.setup(t, true, true) - ps.validate(t) -} - -func TestParseWebPageEndpoints_Reactions(t *testing.T) { - got := parseWebPageEndpoints(reactionsTestWebPage) - testWebPageHelper(t, got, reactionsWant) -} - -var reactionsWant = endpointsByFragmentID{ - "list-reactions-for-a-commit-comment": []*Endpoint{{urlFormats: []string{"repos/%v/%v/comments/%v/reactions"}, httpMethod: "GET"}}, - - "delete-a-commit-comment-reaction": []*Endpoint{ - {urlFormats: []string{"repositories/%v/comments/%v/reactions/%v"}, httpMethod: "DELETE"}, - {urlFormats: []string{"repos/%v/%v/comments/%v/reactions/%v"}, httpMethod: "DELETE"}, - }, - - "create-reaction-for-an-issue": []*Endpoint{{urlFormats: []string{"repos/%v/%v/issues/%v/reactions"}, httpMethod: "POST"}}, - - "delete-an-issue-reaction": []*Endpoint{ - {urlFormats: []string{"repositories/%v/issues/%v/reactions/%v"}, httpMethod: "DELETE"}, - {urlFormats: []string{"repos/%v/%v/issues/%v/reactions/%v"}, httpMethod: "DELETE"}, - }, - - "create-reaction-for-a-pull-request-review-comment": []*Endpoint{{urlFormats: []string{"repos/%v/%v/pulls/comments/%v/reactions"}, httpMethod: "POST"}}, - - "list-reactions-for-a-team-discussion": []*Endpoint{ - {urlFormats: []string{"organizations/%v/team/%v/discussions/%v/reactions"}, httpMethod: "GET"}, - {urlFormats: []string{"orgs/%v/teams/%v/discussions/%v/reactions"}, httpMethod: "GET"}, - }, - - "delete-a-reaction-legacy": []*Endpoint{{urlFormats: []string{"reactions/%v"}, httpMethod: "DELETE"}}, - - "list-reactions-for-a-team-discussion-comment-legacy": []*Endpoint{{urlFormats: []string{"teams/%v/discussions/%v/comments/%v/reactions"}, httpMethod: "GET"}}, - - "delete-an-issue-comment-reaction": []*Endpoint{ - {urlFormats: []string{"repositories/%v/issues/comments/%v/reactions/%v"}, httpMethod: "DELETE"}, - {urlFormats: []string{"repos/%v/%v/issues/comments/%v/reactions/%v"}, httpMethod: "DELETE"}, - }, - - "list-reactions-for-a-pull-request-review-comment": []*Endpoint{{urlFormats: []string{"repos/%v/%v/pulls/comments/%v/reactions"}, httpMethod: "GET"}}, - - "create-reaction-for-a-team-discussion-legacy": []*Endpoint{{urlFormats: []string{"teams/%v/discussions/%v/reactions"}, httpMethod: "POST"}}, - - "create-reaction-for-a-team-discussion-comment-legacy": []*Endpoint{{urlFormats: []string{"teams/%v/discussions/%v/comments/%v/reactions"}, httpMethod: "POST"}}, - - "create-reaction-for-a-commit-comment": []*Endpoint{{urlFormats: []string{"repos/%v/%v/comments/%v/reactions"}, httpMethod: "POST"}}, - - "list-reactions-for-an-issue": []*Endpoint{{urlFormats: []string{"repos/%v/%v/issues/%v/reactions"}, httpMethod: "GET"}}, - - "create-reaction-for-an-issue-comment": []*Endpoint{{urlFormats: []string{"repos/%v/%v/issues/comments/%v/reactions"}, httpMethod: "POST"}}, - - "create-reaction-for-a-team-discussion": []*Endpoint{ - {urlFormats: []string{"organizations/%v/team/%v/discussions/%v/reactions"}, httpMethod: "POST"}, - {urlFormats: []string{"orgs/%v/teams/%v/discussions/%v/reactions"}, httpMethod: "POST"}, - }, - - "delete-team-discussion-reaction": []*Endpoint{ - {urlFormats: []string{"organizations/%v/team/%v/discussions/%v/reactions/%v"}, httpMethod: "DELETE"}, - {urlFormats: []string{"orgs/%v/teams/%v/discussions/%v/reactions/%v"}, httpMethod: "DELETE"}, - }, - - "create-reaction-for-a-team-discussion-comment": []*Endpoint{ - {urlFormats: []string{"organizations/%v/team/%v/discussions/%v/comments/%v/reactions"}, httpMethod: "POST"}, - {urlFormats: []string{"orgs/%v/teams/%v/discussions/%v/comments/%v/reactions"}, httpMethod: "POST"}, - }, - - "list-reactions-for-an-issue-comment": []*Endpoint{{urlFormats: []string{"repos/%v/%v/issues/comments/%v/reactions"}, httpMethod: "GET"}}, - - "delete-a-pull-request-comment-reaction": []*Endpoint{ - {urlFormats: []string{"repositories/%v/pulls/comments/%v/reactions/%v"}, httpMethod: "DELETE"}, - {urlFormats: []string{"repos/%v/%v/pulls/comments/%v/reactions/%v"}, httpMethod: "DELETE"}, - }, - - "list-reactions-for-a-team-discussion-comment": []*Endpoint{ - {urlFormats: []string{"organizations/%v/team/%v/discussions/%v/comments/%v/reactions"}, httpMethod: "GET"}, - {urlFormats: []string{"orgs/%v/teams/%v/discussions/%v/comments/%v/reactions"}, httpMethod: "GET"}, - }, - - "delete-team-discussion-comment-reaction": []*Endpoint{ - {urlFormats: []string{"organizations/%v/team/%v/discussions/%v/comments/%v/reactions/%v"}, httpMethod: "DELETE"}, - {urlFormats: []string{"orgs/%v/teams/%v/discussions/%v/comments/%v/reactions/%v"}, httpMethod: "DELETE"}, - }, - - "list-reactions-for-a-team-discussion-legacy": []*Endpoint{{urlFormats: []string{"teams/%v/discussions/%v/reactions"}, httpMethod: "GET"}}, -} - -//go:embed testdata/reactions.html -var reactionsTestWebPage string - -//go:embed testdata/reactions-original.go -var reactionsGoFileOriginal string - -//go:embed testdata/reactions-want.go -var reactionsGoFileWant string diff --git a/update-urls/testdata/activity-events.html b/update-urls/testdata/activity-events.html deleted file mode 100644 index 90eac2f59ff..00000000000 --- a/update-urls/testdata/activity-events.html +++ /dev/null @@ -1,5686 +0,0 @@ - - - Activity - GitHub Docs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - -
    -
    - - - -
    -
    - -
    - - - Article version: GitHub.com - - - - -
    - - -
    -
    - - -
    -
    - -
    - -
    -
    -

    Activity

    -
    - -
    -
    - - - - - - - - -
    -
    -
    - -

    In this article

    - - -
    - -
    -

    - Did this doc help you? -

    -

    - - - - -

    - - - - - -

    - - -

    - - -
    - -
    -
    -
    -
    - -

    Events

    -

    The Events API is a read-only API to the GitHub events. These events power the various activity streams on the site.

    -

    The Events API can return different types of events triggered by activity on GitHub. For more information about the specific events that you can receive from the Events API, see "GitHub Event types." An events API for repository issues is also available. For more information, see the "Issue Events API."

    -

    Events are optimized for polling with the "ETag" header. If no new events have been triggered, you will see a "304 Not Modified" response, and your current rate limit will be untouched. There is also an "X-Poll-Interval" header that specifies how often (in seconds) you are allowed to poll. In times of high server load, the time may increase. Please obey the header.

    -
    $ curl -I https://api.github.com/users/tater/events
    -> HTTP/1.1 200 OK
    -> X-Poll-Interval: 60
    -> ETag: "a18c3bded88eb5dbb5c849a489412bf3"
    -
    -# The quotes around the ETag value are important
    -$ curl -I https://api.github.com/users/tater/events \
    -$    -H 'If-None-Match: "a18c3bded88eb5dbb5c849a489412bf3"'
    -> HTTP/1.1 304 Not Modified
    -> X-Poll-Interval: 60
    -

    Events support pagination, however the per_page option is unsupported. The fixed page size is 30 items. Fetching up to ten pages is supported, for a total of 300 events. For information, see "Traversing with pagination."

    -

    Only events created within the past 90 days will be included in timelines. Events older than 90 days will not be included (even if the total number of events in the timeline is less than 300).

    -
    -
    -

    - List public events -

    -

    We delay the public events feed by five minutes, which means the most recent event returned by the public events API actually occurred at least five minutes ago.

    -
    -
    get /events
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/events
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /events')
    -
    - - - - -

    Response

    -
    Status: 200 OK
    -
    - - -

    Notes

    - - - -
    -
    -
    -
    - -
    get /networks/{owner}/{repo}/events
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    ownerstringpath - - -
    repostringpath - - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/networks/octocat/hello-world/events
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /networks/{owner}/{repo}/events', {
    -  owner: 'octocat',
    -  repo: 'hello-world'
    -})
    -
    - - - - -

    Response

    -
    Status: 200 OK
    -
    - - -

    Notes

    - - - -
    -
    -
    -
    - -
    get /orgs/{org}/events
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    orgstringpath - - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/orgs/ORG/events
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /orgs/{org}/events', {
    -  org: 'org'
    -})
    -
    - - - - -

    Response

    -
    Status: 200 OK
    -
    - - -

    Notes

    - - - -
    -
    -
    -
    - -
    get /repos/{owner}/{repo}/events
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    ownerstringpath - - -
    repostringpath - - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/repos/octocat/hello-world/events
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /repos/{owner}/{repo}/events', {
    -  owner: 'octocat',
    -  repo: 'hello-world'
    -})
    -
    - - - - -

    Response

    -
    Status: 200 OK
    -
    - - -

    Notes

    - - - -
    -
    -
    -
    -
    -

    - List events for the authenticated user -

    -

    If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events.

    -
    -
    get /users/{username}/events
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    usernamestringpath - - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/users/USERNAME/events
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /users/{username}/events', {
    -  username: 'username'
    -})
    -
    - - - - -

    Response

    -
    Status: 200 OK
    -
    - - -

    Notes

    - - - -
    -
    -
    -
    -
    -

    - List organization events for the authenticated user -

    -

    This is the user's organization dashboard. You must be authenticated as the user to view this.

    -
    -
    get /users/{username}/events/orgs/{org}
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    usernamestringpath - - -
    orgstringpath - - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/users/USERNAME/events/orgs/ORG
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /users/{username}/events/orgs/{org}', {
    -  username: 'username',
    -  org: 'org'
    -})
    -
    - - - - -

    Response

    -
    Status: 200 OK
    -
    - - - -
    -
    -
    -
    - -
    get /users/{username}/events/public
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    usernamestringpath - - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/users/USERNAME/events/public
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /users/{username}/events/public', {
    -  username: 'username'
    -})
    -
    - - - - -

    Response

    -
    Status: 200 OK
    -
    - - -

    Notes

    - - - -
    -
    -
    -
    -
    -

    - List events received by the authenticated user -

    -

    These are events that you've received by watching repos and following users. If you are authenticated as the given user, you will see private events. Otherwise, you'll only see public events.

    -
    -
    get /users/{username}/received_events
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    usernamestringpath - - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/users/USERNAME/received_events
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /users/{username}/received_events', {
    -  username: 'username'
    -})
    -
    - - - - -

    Response

    -
    Status: 200 OK
    -
    - - -

    Notes

    - - - -
    -
    -
    -
    - -
    get /users/{username}/received_events/public
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    usernamestringpath - - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/users/USERNAME/received_events/public
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /users/{username}/received_events/public', {
    -  username: 'username'
    -})
    -
    - - - - -

    Response

    -
    Status: 200 OK
    -
    - - -

    Notes

    - - - -
    -
    -
    -

    Feeds

    -
    -
    -

    - Get feeds -

    -

    GitHub provides several timeline resources in Atom format. The Feeds API lists all the feeds available to the authenticated user:

    -
      -
    • Timeline: The GitHub global public timeline
    • -
    • User: The public timeline for any user, using URI template
    • -
    • Current user public: The public timeline for the authenticated user
    • -
    • Current user: The private timeline for the authenticated user
    • -
    • Current user actor: The private timeline for activity created by the authenticated user
    • -
    • Current user organizations: The private timeline for the organizations the authenticated user is a member of.
    • -
    • Security advisories: A collection of public announcements that provide information about security-related vulnerabilities in software on GitHub.
    • -
    -

    Note: Private feeds are only returned when authenticating via Basic Auth since current feed URIs use the older, non revocable auth tokens.

    -
    -
    get /feeds
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/feeds
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /feeds')
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    {
    -  "timeline_url": "https://github.com/timeline",
    -  "user_url": "https://github.com/{user}",
    -  "current_user_public_url": "https://github.com/octocat",
    -  "current_user_url": "https://github.com/octocat.private?token=abc123",
    -  "current_user_actor_url": "https://github.com/octocat.private.actor?token=abc123",
    -  "current_user_organization_url": "",
    -  "current_user_organization_urls": [
    -    "https://github.com/organizations/github/octocat.private.atom?token=abc123"
    -  ],
    -  "security_advisories_url": "https://github.com/security-advisories",
    -  "_links": {
    -    "timeline": {
    -      "href": "https://github.com/timeline",
    -      "type": "application/atom+xml"
    -    },
    -    "user": {
    -      "href": "https://github.com/{user}",
    -      "type": "application/atom+xml"
    -    },
    -    "current_user_public": {
    -      "href": "https://github.com/octocat",
    -      "type": "application/atom+xml"
    -    },
    -    "current_user": {
    -      "href": "https://github.com/octocat.private?token=abc123",
    -      "type": "application/atom+xml"
    -    },
    -    "current_user_actor": {
    -      "href": "https://github.com/octocat.private.actor?token=abc123",
    -      "type": "application/atom+xml"
    -    },
    -    "current_user_organization": {
    -      "href": "",
    -      "type": ""
    -    },
    -    "current_user_organizations": [
    -      {
    -        "href": "https://github.com/organizations/github/octocat.private.atom?token=abc123",
    -        "type": "application/atom+xml"
    -      }
    -    ],
    -    "security_advisories": {
    -      "href": "https://github.com/security-advisories",
    -      "type": "application/atom+xml"
    -    }
    -  }
    -}
    -
    - - -

    Notes

    - - - -
    -
    -
    -

    Example of getting an Atom feed

    -

    To get a feed in Atom format, you must specify the application/atom+xml type in the Accept header. For example, to get the Atom feed for GitHub security advisories:

    -
    curl -H "Accept: application/atom+xml" https://github.com/security-advisories
    -
    -

    Response

    -
    Status: 200 OK
    -
    <?xml version="1.0" encoding="UTF-8"?>
    -<feed xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xml:lang="en-US">
    -  <id>tag:github.com,2008:/security-advisories</id>
    -  <link rel="self" type="application/atom+xml" href="https://github.com/security-advisories.atom"/>
    -  <title>GitHub Security Advisory Feed</title>
    -  <author>
    -    <name>GitHub</name>
    -  </author>
    -  <updated>2019-01-14T19:34:52Z</updated>
    -     <entry>
    -      <id>tag:github.com,2008:GHSA-abcd-12ab-23cd</id>
    -      <published>2018-07-26T15:14:52Z</published>
    -      <updated>2019-01-14T19:34:52Z</updated>
    -      <title type="html">[GHSA-abcd-12ab-23cd] Moderate severity vulnerability that affects Octoapp</title>
    -        <category term="NPM"/>
    -      <content type="html">
    -        &lt;p&gt;Octoapp node module before 4.17.5 suffers from a Modification of Assumed-Immutable Data (MAID) vulnerability via defaultsDeep, merge, and mergeWith functions, which allows a malicious user to modify the prototype of &quot;Object&quot; via &lt;strong&gt;proto&lt;/strong&gt;, causing the addition or modification of an existing property that will exist on all objects.&lt;/p&gt;
    -          &lt;p&gt;&lt;strong&gt;Affected Packages&lt;/strong&gt;&lt;/p&gt;
    -
    -  &lt;dl&gt;
    -      &lt;dt&gt;Octoapp&lt;/dt&gt;
    -      &lt;dd&gt;Ecosystem: npm&lt;/dd&gt;
    -      &lt;dd&gt;Severity: moderate&lt;/dd&gt;
    -      &lt;dd&gt;Versions: &amp;lt; 4.17.5&lt;/dd&gt;
    -        &lt;dd&gt;Fixed in: 4.17.5&lt;/dd&gt;
    -  &lt;/dl&gt;
    -
    -          &lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;
    -
    -  &lt;ul&gt;
    -      &lt;li&gt;https://nvd.nist.gov/vuln/detail/CVE-2018-123&lt;/li&gt;
    -  &lt;/ul&gt;
    -
    -      </content>
    -    </entry>
    -</feed>
    -
    -

    Notifications

    -

    Users receive notifications for conversations in repositories they watch including:

    -
      -
    • Issues and their comments
    • -
    • Pull Requests and their comments
    • -
    • Comments on any commits
    • -
    -

    Notifications are also sent for conversations in unwatched repositories when the user is involved including:

    -
      -
    • @mentions
    • -
    • Issue assignments
    • -
    • Commits the user authors or commits
    • -
    • Any discussion in which the user actively participates
    • -
    -

    All Notification API calls require the notifications or repo API scopes. Doing this will give read-only access to some issue and commit content. You will still need the repo scope to access issues and commits from their respective endpoints.

    -

    Notifications come back as "threads". A thread contains information about the current discussion of an issue, pull request, or commit.

    -

    Notifications are optimized for polling with the Last-Modified header. If there are no new notifications, you will see a 304 Not Modified response, leaving your current rate limit untouched. There is an X-Poll-Interval header that specifies how often (in seconds) you are allowed to poll. In times of high server load, the time may increase. Please obey the header.

    -
    # Add authentication to your requests
    -$ curl -I https://api.github.com/notifications
    -HTTP/1.1 200 OK
    -Last-Modified: Thu, 25 Oct 2012 15:16:27 GMT
    -X-Poll-Interval: 60
    -
    -# Pass the Last-Modified header exactly
    -$ curl -I https://api.github.com/notifications
    -$    -H "If-Modified-Since: Thu, 25 Oct 2012 15:16:27 GMT"
    -> HTTP/1.1 304 Not Modified
    -> X-Poll-Interval: 60
    -

    Notification reasons

    -

    When retrieving responses from the Notifications API, each payload has a key titled reason. These correspond to events that trigger a notification.

    -

    Here's a list of potential reasons for receiving a notification:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Reason NameDescription
    assignYou were assigned to the issue.
    authorYou created the thread.
    commentYou commented on the thread.
    invitationYou accepted an invitation to contribute to the repository.
    manualYou subscribed to the thread (via an issue or pull request).
    mentionYou were specifically @mentioned in the content.
    review_requestedYou, or a team you're a member of, were requested to review a pull request.
    security_alertGitHub discovered a security vulnerability in your repository.
    state_changeYou changed the thread state (for example, closing an issue or merging a pull request).
    subscribedYou're watching the repository.
    team_mentionYou were on a team that was mentioned.
    -

    Note that the reason is modified on a per-thread basis, and can change, if the reason on a later notification is different.

    -

    For example, if you are the author of an issue, subsequent notifications on that issue will have a reason of author. If you're then @mentioned on the same issue, the notifications you fetch thereafter will have a reason of mention. The reason remains as mention, regardless of whether you're ever mentioned again.

    -
    -
    -

    - List notifications for the authenticated user -

    -

    List all notifications for the current user, sorted by most recently updated.

    -
    -
    get /notifications
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    allbooleanquery -

    If true, show notifications marked as read.

    - -
    participatingbooleanquery -

    If true, only shows notifications in which the user is directly participating or mentioned.

    - -
    sincestringquery -

    Only show notifications updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

    - -
    beforestringquery -

    Only show notifications updated before the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

    - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/notifications
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /notifications')
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    [
    -  {
    -    "id": "1",
    -    "repository": {
    -      "id": 1296269,
    -      "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
    -      "name": "Hello-World",
    -      "full_name": "octocat/Hello-World",
    -      "owner": {
    -        "login": "octocat",
    -        "id": 1,
    -        "node_id": "MDQ6VXNlcjE=",
    -        "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -        "gravatar_id": "",
    -        "url": "https://api.github.com/users/octocat",
    -        "html_url": "https://github.com/octocat",
    -        "followers_url": "https://api.github.com/users/octocat/followers",
    -        "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -        "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -        "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -        "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -        "organizations_url": "https://api.github.com/users/octocat/orgs",
    -        "repos_url": "https://api.github.com/users/octocat/repos",
    -        "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -        "received_events_url": "https://api.github.com/users/octocat/received_events",
    -        "type": "User",
    -        "site_admin": false
    -      },
    -      "private": false,
    -      "html_url": "https://github.com/octocat/Hello-World",
    -      "description": "This your first repo!",
    -      "fork": false,
    -      "url": "https://api.github.com/repos/octocat/Hello-World",
    -      "archive_url": "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
    -      "assignees_url": "http://api.github.com/repos/octocat/Hello-World/assignees{/user}",
    -      "blobs_url": "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
    -      "branches_url": "http://api.github.com/repos/octocat/Hello-World/branches{/branch}",
    -      "collaborators_url": "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
    -      "comments_url": "http://api.github.com/repos/octocat/Hello-World/comments{/number}",
    -      "commits_url": "http://api.github.com/repos/octocat/Hello-World/commits{/sha}",
    -      "compare_url": "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
    -      "contents_url": "http://api.github.com/repos/octocat/Hello-World/contents/{+path}",
    -      "contributors_url": "http://api.github.com/repos/octocat/Hello-World/contributors",
    -      "deployments_url": "http://api.github.com/repos/octocat/Hello-World/deployments",
    -      "downloads_url": "http://api.github.com/repos/octocat/Hello-World/downloads",
    -      "events_url": "http://api.github.com/repos/octocat/Hello-World/events",
    -      "forks_url": "http://api.github.com/repos/octocat/Hello-World/forks",
    -      "git_commits_url": "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
    -      "git_refs_url": "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
    -      "git_tags_url": "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
    -      "git_url": "git:github.com/octocat/Hello-World.git",
    -      "issue_comment_url": "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
    -      "issue_events_url": "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
    -      "issues_url": "http://api.github.com/repos/octocat/Hello-World/issues{/number}",
    -      "keys_url": "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
    -      "labels_url": "http://api.github.com/repos/octocat/Hello-World/labels{/name}",
    -      "languages_url": "http://api.github.com/repos/octocat/Hello-World/languages",
    -      "merges_url": "http://api.github.com/repos/octocat/Hello-World/merges",
    -      "milestones_url": "http://api.github.com/repos/octocat/Hello-World/milestones{/number}",
    -      "notifications_url": "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
    -      "pulls_url": "http://api.github.com/repos/octocat/Hello-World/pulls{/number}",
    -      "releases_url": "http://api.github.com/repos/octocat/Hello-World/releases{/id}",
    -      "ssh_url": "git@github.com:octocat/Hello-World.git",
    -      "stargazers_url": "http://api.github.com/repos/octocat/Hello-World/stargazers",
    -      "statuses_url": "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
    -      "subscribers_url": "http://api.github.com/repos/octocat/Hello-World/subscribers",
    -      "subscription_url": "http://api.github.com/repos/octocat/Hello-World/subscription",
    -      "tags_url": "http://api.github.com/repos/octocat/Hello-World/tags",
    -      "teams_url": "http://api.github.com/repos/octocat/Hello-World/teams",
    -      "trees_url": "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}"
    -    },
    -    "subject": {
    -      "title": "Greetings",
    -      "url": "https://api.github.com/repos/octokit/octokit.rb/issues/123",
    -      "latest_comment_url": "https://api.github.com/repos/octokit/octokit.rb/issues/comments/123",
    -      "type": "Issue"
    -    },
    -    "reason": "subscribed",
    -    "unread": true,
    -    "updated_at": "2014-11-07T22:01:45Z",
    -    "last_read_at": "2014-11-07T22:01:45Z",
    -    "url": "https://api.github.com/notifications/threads/1"
    -  }
    -]
    -
    - - - -
    -
    -
    -
    -
    -

    - Mark notifications as read -

    -

    Marks all notifications as "read" removes it from the default view on GitHub. If the number of notifications is too large to complete in one request, you will receive a 202 Accepted status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the List notifications for the authenticated user endpoint and pass the query parameter all=false.

    -
    -
    put /notifications
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    last_read_atstringbody -

    Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. Default: The current timestamp.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X PUT \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/notifications \
    -  -d '{"last_read_at":"last_read_at"}'
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('PUT /notifications', {
    -  last_read_at: 'last_read_at'
    -})
    -
    - - - - -

    Response

    -
    Status: 205 Reset Content
    -
    - - - -
    -
    -
    -
    -
    -

    - Get a thread -

    - -
    -
    get /notifications/threads/{thread_id}
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    thread_idintegerpath - - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/notifications/threads/42
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /notifications/threads/{thread_id}', {
    -  thread_id: 42
    -})
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    {
    -  "id": "1",
    -  "repository": {
    -    "id": 1296269,
    -    "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
    -    "name": "Hello-World",
    -    "full_name": "octocat/Hello-World",
    -    "owner": {
    -      "login": "octocat",
    -      "id": 1,
    -      "node_id": "MDQ6VXNlcjE=",
    -      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -      "gravatar_id": "",
    -      "url": "https://api.github.com/users/octocat",
    -      "html_url": "https://github.com/octocat",
    -      "followers_url": "https://api.github.com/users/octocat/followers",
    -      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -      "organizations_url": "https://api.github.com/users/octocat/orgs",
    -      "repos_url": "https://api.github.com/users/octocat/repos",
    -      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -      "received_events_url": "https://api.github.com/users/octocat/received_events",
    -      "type": "User",
    -      "site_admin": false
    -    },
    -    "private": false,
    -    "html_url": "https://github.com/octocat/Hello-World",
    -    "description": "This your first repo!",
    -    "fork": false,
    -    "url": "https://api.github.com/repos/octocat/Hello-World",
    -    "archive_url": "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
    -    "assignees_url": "http://api.github.com/repos/octocat/Hello-World/assignees{/user}",
    -    "blobs_url": "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
    -    "branches_url": "http://api.github.com/repos/octocat/Hello-World/branches{/branch}",
    -    "collaborators_url": "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
    -    "comments_url": "http://api.github.com/repos/octocat/Hello-World/comments{/number}",
    -    "commits_url": "http://api.github.com/repos/octocat/Hello-World/commits{/sha}",
    -    "compare_url": "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
    -    "contents_url": "http://api.github.com/repos/octocat/Hello-World/contents/{+path}",
    -    "contributors_url": "http://api.github.com/repos/octocat/Hello-World/contributors",
    -    "deployments_url": "http://api.github.com/repos/octocat/Hello-World/deployments",
    -    "downloads_url": "http://api.github.com/repos/octocat/Hello-World/downloads",
    -    "events_url": "http://api.github.com/repos/octocat/Hello-World/events",
    -    "forks_url": "http://api.github.com/repos/octocat/Hello-World/forks",
    -    "git_commits_url": "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
    -    "git_refs_url": "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
    -    "git_tags_url": "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
    -    "git_url": "git:github.com/octocat/Hello-World.git",
    -    "issue_comment_url": "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
    -    "issue_events_url": "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
    -    "issues_url": "http://api.github.com/repos/octocat/Hello-World/issues{/number}",
    -    "keys_url": "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
    -    "labels_url": "http://api.github.com/repos/octocat/Hello-World/labels{/name}",
    -    "languages_url": "http://api.github.com/repos/octocat/Hello-World/languages",
    -    "merges_url": "http://api.github.com/repos/octocat/Hello-World/merges",
    -    "milestones_url": "http://api.github.com/repos/octocat/Hello-World/milestones{/number}",
    -    "notifications_url": "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
    -    "pulls_url": "http://api.github.com/repos/octocat/Hello-World/pulls{/number}",
    -    "releases_url": "http://api.github.com/repos/octocat/Hello-World/releases{/id}",
    -    "ssh_url": "git@github.com:octocat/Hello-World.git",
    -    "stargazers_url": "http://api.github.com/repos/octocat/Hello-World/stargazers",
    -    "statuses_url": "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
    -    "subscribers_url": "http://api.github.com/repos/octocat/Hello-World/subscribers",
    -    "subscription_url": "http://api.github.com/repos/octocat/Hello-World/subscription",
    -    "tags_url": "http://api.github.com/repos/octocat/Hello-World/tags",
    -    "teams_url": "http://api.github.com/repos/octocat/Hello-World/teams",
    -    "trees_url": "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}"
    -  },
    -  "subject": {
    -    "title": "Greetings",
    -    "url": "https://api.github.com/repos/octokit/octokit.rb/issues/123",
    -    "latest_comment_url": "https://api.github.com/repos/octokit/octokit.rb/issues/comments/123",
    -    "type": "Issue"
    -  },
    -  "reason": "subscribed",
    -  "unread": true,
    -  "updated_at": "2014-11-07T22:01:45Z",
    -  "last_read_at": "2014-11-07T22:01:45Z",
    -  "url": "https://api.github.com/notifications/threads/1"
    -}
    -
    - - - -
    -
    -
    -
    - -
    patch /notifications/threads/{thread_id}
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    thread_idintegerpath - - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X PATCH \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/notifications/threads/42
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('PATCH /notifications/threads/{thread_id}', {
    -  thread_id: 42
    -})
    -
    - - - - -

    Response

    -
    Status: 205 Reset Content
    -
    - - - -
    -
    -
    -
    -
    -

    - Get a thread subscription for the authenticated user -

    -

    This checks to see if the current user is subscribed to a thread. You can also get a repository subscription.

    -

    Note that subscriptions are only generated if a user is participating in a conversation--for example, they've replied to the thread, were @mentioned, or manually subscribe to a thread.

    -
    -
    get /notifications/threads/{thread_id}/subscription
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    thread_idintegerpath - - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/notifications/threads/42/subscription
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /notifications/threads/{thread_id}/subscription', {
    -  thread_id: 42
    -})
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    {
    -  "subscribed": true,
    -  "ignored": false,
    -  "reason": null,
    -  "created_at": "2012-10-06T21:34:12Z",
    -  "url": "https://api.github.com/notifications/threads/1/subscription",
    -  "thread_url": "https://api.github.com/notifications/threads/1"
    -}
    -
    - - - -
    -
    -
    -
    -
    -

    - Set a thread subscription -

    -

    If you are watching a repository, you receive notifications for all threads by default. Use this endpoint to ignore future notifications for threads until you comment on the thread or get an @mention.

    -

    You can also use this endpoint to subscribe to threads that you are currently not receiving notifications for or to subscribed to threads that you have previously ignored.

    -

    Unsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the Delete a thread subscription endpoint.

    -
    -
    put /notifications/threads/{thread_id}/subscription
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    thread_idintegerpath - - -
    ignoredbooleanbody -

    Unsubscribes and subscribes you to a conversation. Set ignored to true to block all notifications from this thread.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X PUT \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/notifications/threads/42/subscription \
    -  -d '{"ignored":true}'
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('PUT /notifications/threads/{thread_id}/subscription', {
    -  thread_id: 42,
    -  ignored: true
    -})
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    {
    -  "subscribed": true,
    -  "ignored": false,
    -  "reason": null,
    -  "created_at": "2012-10-06T21:34:12Z",
    -  "url": "https://api.github.com/notifications/threads/1/subscription",
    -  "thread_url": "https://api.github.com/notifications/threads/1"
    -}
    -
    - - - -
    -
    -
    -
    -
    -

    - Delete a thread subscription -

    -

    Mutes all future notifications for a conversation until you comment on the thread or get an @mention. If you are watching the repository of the thread, you will still receive notifications. To ignore future notifications for a repository you are watching, use the Set a thread subscription endpoint and set ignore to true.

    -
    -
    delete /notifications/threads/{thread_id}/subscription
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    thread_idintegerpath - - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X DELETE \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/notifications/threads/42/subscription
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('DELETE /notifications/threads/{thread_id}/subscription', {
    -  thread_id: 42
    -})
    -
    - - - - -

    Default Response

    -
    Status: 204 No Content
    -
    - - - -
    -
    -
    -
    -
    -

    - List repository notifications for the authenticated user -

    -

    List all notifications for the current user.

    -
    -
    get /repos/{owner}/{repo}/notifications
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    ownerstringpath - - -
    repostringpath - - -
    allbooleanquery -

    If true, show notifications marked as read.

    - -
    participatingbooleanquery -

    If true, only shows notifications in which the user is directly participating or mentioned.

    - -
    sincestringquery -

    Only show notifications updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

    - -
    beforestringquery -

    Only show notifications updated before the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

    - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/repos/octocat/hello-world/notifications
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /repos/{owner}/{repo}/notifications', {
    -  owner: 'octocat',
    -  repo: 'hello-world'
    -})
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    [
    -  {
    -    "id": "1",
    -    "repository": {
    -      "id": 1296269,
    -      "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
    -      "name": "Hello-World",
    -      "full_name": "octocat/Hello-World",
    -      "owner": {
    -        "login": "octocat",
    -        "id": 1,
    -        "node_id": "MDQ6VXNlcjE=",
    -        "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -        "gravatar_id": "",
    -        "url": "https://api.github.com/users/octocat",
    -        "html_url": "https://github.com/octocat",
    -        "followers_url": "https://api.github.com/users/octocat/followers",
    -        "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -        "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -        "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -        "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -        "organizations_url": "https://api.github.com/users/octocat/orgs",
    -        "repos_url": "https://api.github.com/users/octocat/repos",
    -        "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -        "received_events_url": "https://api.github.com/users/octocat/received_events",
    -        "type": "User",
    -        "site_admin": false
    -      },
    -      "private": false,
    -      "html_url": "https://github.com/octocat/Hello-World",
    -      "description": "This your first repo!",
    -      "fork": false,
    -      "url": "https://api.github.com/repos/octocat/Hello-World",
    -      "archive_url": "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
    -      "assignees_url": "http://api.github.com/repos/octocat/Hello-World/assignees{/user}",
    -      "blobs_url": "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
    -      "branches_url": "http://api.github.com/repos/octocat/Hello-World/branches{/branch}",
    -      "collaborators_url": "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
    -      "comments_url": "http://api.github.com/repos/octocat/Hello-World/comments{/number}",
    -      "commits_url": "http://api.github.com/repos/octocat/Hello-World/commits{/sha}",
    -      "compare_url": "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
    -      "contents_url": "http://api.github.com/repos/octocat/Hello-World/contents/{+path}",
    -      "contributors_url": "http://api.github.com/repos/octocat/Hello-World/contributors",
    -      "deployments_url": "http://api.github.com/repos/octocat/Hello-World/deployments",
    -      "downloads_url": "http://api.github.com/repos/octocat/Hello-World/downloads",
    -      "events_url": "http://api.github.com/repos/octocat/Hello-World/events",
    -      "forks_url": "http://api.github.com/repos/octocat/Hello-World/forks",
    -      "git_commits_url": "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
    -      "git_refs_url": "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
    -      "git_tags_url": "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
    -      "git_url": "git:github.com/octocat/Hello-World.git",
    -      "issue_comment_url": "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
    -      "issue_events_url": "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
    -      "issues_url": "http://api.github.com/repos/octocat/Hello-World/issues{/number}",
    -      "keys_url": "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
    -      "labels_url": "http://api.github.com/repos/octocat/Hello-World/labels{/name}",
    -      "languages_url": "http://api.github.com/repos/octocat/Hello-World/languages",
    -      "merges_url": "http://api.github.com/repos/octocat/Hello-World/merges",
    -      "milestones_url": "http://api.github.com/repos/octocat/Hello-World/milestones{/number}",
    -      "notifications_url": "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
    -      "pulls_url": "http://api.github.com/repos/octocat/Hello-World/pulls{/number}",
    -      "releases_url": "http://api.github.com/repos/octocat/Hello-World/releases{/id}",
    -      "ssh_url": "git@github.com:octocat/Hello-World.git",
    -      "stargazers_url": "http://api.github.com/repos/octocat/Hello-World/stargazers",
    -      "statuses_url": "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
    -      "subscribers_url": "http://api.github.com/repos/octocat/Hello-World/subscribers",
    -      "subscription_url": "http://api.github.com/repos/octocat/Hello-World/subscription",
    -      "tags_url": "http://api.github.com/repos/octocat/Hello-World/tags",
    -      "teams_url": "http://api.github.com/repos/octocat/Hello-World/teams",
    -      "trees_url": "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}"
    -    },
    -    "subject": {
    -      "title": "Greetings",
    -      "url": "https://api.github.com/repos/octokit/octokit.rb/issues/123",
    -      "latest_comment_url": "https://api.github.com/repos/octokit/octokit.rb/issues/comments/123",
    -      "type": "Issue"
    -    },
    -    "reason": "subscribed",
    -    "unread": true,
    -    "updated_at": "2014-11-07T22:01:45Z",
    -    "last_read_at": "2014-11-07T22:01:45Z",
    -    "url": "https://api.github.com/notifications/threads/1"
    -  }
    -]
    -
    - - - -
    -
    -
    -
    -
    -

    - Mark repository notifications as read -

    -

    Marks all notifications in a repository as "read" removes them from the default view on GitHub. If the number of notifications is too large to complete in one request, you will receive a 202 Accepted status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the List repository notifications for the authenticated user endpoint and pass the query parameter all=false.

    -
    -
    put /repos/{owner}/{repo}/notifications
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    ownerstringpath - - -
    repostringpath - - -
    last_read_atstringbody -

    Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. Default: The current timestamp.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X PUT \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/repos/octocat/hello-world/notifications \
    -  -d '{"last_read_at":"last_read_at"}'
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('PUT /repos/{owner}/{repo}/notifications', {
    -  owner: 'octocat',
    -  repo: 'hello-world',
    -  last_read_at: 'last_read_at'
    -})
    -
    - - - - -

    Response

    -
    Status: 205 Reset Content
    -
    - - - -
    -
    -
    -

    Starring

    -

    Repository starring is a feature that lets users bookmark repositories. Stars are shown next to repositories to show an approximate level of interest. Stars have no effect on notifications or the activity feed.

    -

    Starring vs. Watching

    -

    In August 2012, we changed the way watching -works on GitHub. Many API -client applications may be using the original "watcher" endpoints for accessing -this data. You can now start using the "star" endpoints instead (described -below). For more information, see the Watcher API Change post and the "Repository Watching API."

    -

    Custom media types for starring

    -

    There is one supported custom media type for the Starring REST API. When you use this custom media type, you will receive a response with the starred_at timestamp property that indicates the time the star was created. The response also has a second property that includes the resource that is returned when the custom media type is not included. The property that contains the resource will be either user or repo.

    -
    application/vnd.github.v3.star+json
    -
    -

    For more information about media types, see "Custom media types."

    -
    -
    -

    - List stargazers -

    -

    Lists the people that have starred the repository.

    -

    You can also find out when stars were created by passing the following custom media type via the Accept header:

    -
    -
    get /repos/{owner}/{repo}/stargazers
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    ownerstringpath - - -
    repostringpath - - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/repos/octocat/hello-world/stargazers
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /repos/{owner}/{repo}/stargazers', {
    -  owner: 'octocat',
    -  repo: 'hello-world'
    -})
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    [
    -  {
    -    "login": "octocat",
    -    "id": 1,
    -    "node_id": "MDQ6VXNlcjE=",
    -    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -    "gravatar_id": "",
    -    "url": "https://api.github.com/users/octocat",
    -    "html_url": "https://github.com/octocat",
    -    "followers_url": "https://api.github.com/users/octocat/followers",
    -    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -    "organizations_url": "https://api.github.com/users/octocat/orgs",
    -    "repos_url": "https://api.github.com/users/octocat/repos",
    -    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -    "received_events_url": "https://api.github.com/users/octocat/received_events",
    -    "type": "User",
    -    "site_admin": false
    -  }
    -]
    -
    - - -

    Notes

    - - - -
    -
    -
    -
    -
    -

    - List repositories starred by the authenticated user -

    -

    Lists repositories the authenticated user has starred.

    -

    You can also find out when stars were created by passing the following custom media type via the Accept header:

    -
    -
    get /user/starred
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    sortstringquery -

    One of created (when the repository was starred) or updated (when it was last pushed to).

    - -
    directionstringquery -

    One of asc (ascending) or desc (descending).

    - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/user/starred
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /user/starred')
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    [
    -  {
    -    "id": 1296269,
    -    "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
    -    "name": "Hello-World",
    -    "full_name": "octocat/Hello-World",
    -    "owner": {
    -      "login": "octocat",
    -      "id": 1,
    -      "node_id": "MDQ6VXNlcjE=",
    -      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -      "gravatar_id": "",
    -      "url": "https://api.github.com/users/octocat",
    -      "html_url": "https://github.com/octocat",
    -      "followers_url": "https://api.github.com/users/octocat/followers",
    -      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -      "organizations_url": "https://api.github.com/users/octocat/orgs",
    -      "repos_url": "https://api.github.com/users/octocat/repos",
    -      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -      "received_events_url": "https://api.github.com/users/octocat/received_events",
    -      "type": "User",
    -      "site_admin": false
    -    },
    -    "private": false,
    -    "html_url": "https://github.com/octocat/Hello-World",
    -    "description": "This your first repo!",
    -    "fork": false,
    -    "url": "https://api.github.com/repos/octocat/Hello-World",
    -    "archive_url": "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
    -    "assignees_url": "http://api.github.com/repos/octocat/Hello-World/assignees{/user}",
    -    "blobs_url": "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
    -    "branches_url": "http://api.github.com/repos/octocat/Hello-World/branches{/branch}",
    -    "collaborators_url": "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
    -    "comments_url": "http://api.github.com/repos/octocat/Hello-World/comments{/number}",
    -    "commits_url": "http://api.github.com/repos/octocat/Hello-World/commits{/sha}",
    -    "compare_url": "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
    -    "contents_url": "http://api.github.com/repos/octocat/Hello-World/contents/{+path}",
    -    "contributors_url": "http://api.github.com/repos/octocat/Hello-World/contributors",
    -    "deployments_url": "http://api.github.com/repos/octocat/Hello-World/deployments",
    -    "downloads_url": "http://api.github.com/repos/octocat/Hello-World/downloads",
    -    "events_url": "http://api.github.com/repos/octocat/Hello-World/events",
    -    "forks_url": "http://api.github.com/repos/octocat/Hello-World/forks",
    -    "git_commits_url": "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
    -    "git_refs_url": "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
    -    "git_tags_url": "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
    -    "git_url": "git:github.com/octocat/Hello-World.git",
    -    "issue_comment_url": "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
    -    "issue_events_url": "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
    -    "issues_url": "http://api.github.com/repos/octocat/Hello-World/issues{/number}",
    -    "keys_url": "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
    -    "labels_url": "http://api.github.com/repos/octocat/Hello-World/labels{/name}",
    -    "languages_url": "http://api.github.com/repos/octocat/Hello-World/languages",
    -    "merges_url": "http://api.github.com/repos/octocat/Hello-World/merges",
    -    "milestones_url": "http://api.github.com/repos/octocat/Hello-World/milestones{/number}",
    -    "notifications_url": "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
    -    "pulls_url": "http://api.github.com/repos/octocat/Hello-World/pulls{/number}",
    -    "releases_url": "http://api.github.com/repos/octocat/Hello-World/releases{/id}",
    -    "ssh_url": "git@github.com:octocat/Hello-World.git",
    -    "stargazers_url": "http://api.github.com/repos/octocat/Hello-World/stargazers",
    -    "statuses_url": "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
    -    "subscribers_url": "http://api.github.com/repos/octocat/Hello-World/subscribers",
    -    "subscription_url": "http://api.github.com/repos/octocat/Hello-World/subscription",
    -    "tags_url": "http://api.github.com/repos/octocat/Hello-World/tags",
    -    "teams_url": "http://api.github.com/repos/octocat/Hello-World/teams",
    -    "trees_url": "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
    -    "clone_url": "https://github.com/octocat/Hello-World.git",
    -    "mirror_url": "git:git.example.com/octocat/Hello-World",
    -    "hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks",
    -    "svn_url": "https://svn.github.com/octocat/Hello-World",
    -    "homepage": "https://github.com",
    -    "language": null,
    -    "forks_count": 9,
    -    "stargazers_count": 80,
    -    "watchers_count": 80,
    -    "size": 108,
    -    "default_branch": "master",
    -    "open_issues_count": 0,
    -    "is_template": true,
    -    "topics": [
    -      "octocat",
    -      "atom",
    -      "electron",
    -      "api"
    -    ],
    -    "has_issues": true,
    -    "has_projects": true,
    -    "has_wiki": true,
    -    "has_pages": false,
    -    "has_downloads": true,
    -    "archived": false,
    -    "disabled": false,
    -    "visibility": "public",
    -    "pushed_at": "2011-01-26T19:06:43Z",
    -    "created_at": "2011-01-26T19:01:12Z",
    -    "updated_at": "2011-01-26T19:14:43Z",
    -    "permissions": {
    -      "admin": false,
    -      "push": false,
    -      "pull": true
    -    },
    -    "allow_rebase_merge": true,
    -    "template_repository": null,
    -    "temp_clone_token": "ABTLWHOULUVAXGTRYU7OC2876QJ2O",
    -    "allow_squash_merge": true,
    -    "delete_branch_on_merge": true,
    -    "allow_merge_commit": true,
    -    "subscribers_count": 42,
    -    "network_count": 0
    -  }
    -]
    -
    - - - -
    -
    -
    -
    - -
    get /user/starred/{owner}/{repo}
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    ownerstringpath - - -
    repostringpath - - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/user/starred/octocat/hello-world
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /user/starred/{owner}/{repo}', {
    -  owner: 'octocat',
    -  repo: 'hello-world'
    -})
    -
    - - - - -

    Response if this repository is starred by you

    -
    Status: 204 No Content
    -
    - -

    Response if this repository is not starred by you

    -
    Status: 404 Not Found
    -
    - - - -
    -
    -
    -
    -
    -

    - Star a repository for the authenticated user -

    -

    Note that you'll need to set Content-Length to zero when calling out to this endpoint. For more information, see "HTTP verbs."

    -
    -
    put /user/starred/{owner}/{repo}
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    ownerstringpath - - -
    repostringpath - - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X PUT \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/user/starred/octocat/hello-world
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('PUT /user/starred/{owner}/{repo}', {
    -  owner: 'octocat',
    -  repo: 'hello-world'
    -})
    -
    - - - - -

    Default Response

    -
    Status: 204 No Content
    -
    - - - -
    -
    -
    -
    - -
    delete /user/starred/{owner}/{repo}
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    ownerstringpath - - -
    repostringpath - - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X DELETE \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/user/starred/octocat/hello-world
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('DELETE /user/starred/{owner}/{repo}', {
    -  owner: 'octocat',
    -  repo: 'hello-world'
    -})
    -
    - - - - -

    Default Response

    -
    Status: 204 No Content
    -
    - - - -
    -
    -
    -
    -
    -

    - List repositories starred by a user -

    -

    Lists repositories a user has starred.

    -

    You can also find out when stars were created by passing the following custom media type via the Accept header:

    -
    -
    get /users/{username}/starred
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    usernamestringpath - - -
    sortstringquery -

    One of created (when the repository was starred) or updated (when it was last pushed to).

    - -
    directionstringquery -

    One of asc (ascending) or desc (descending).

    - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/users/USERNAME/starred
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /users/{username}/starred', {
    -  username: 'username'
    -})
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    [
    -  {
    -    "id": 1296269,
    -    "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
    -    "name": "Hello-World",
    -    "full_name": "octocat/Hello-World",
    -    "owner": {
    -      "login": "octocat",
    -      "id": 1,
    -      "node_id": "MDQ6VXNlcjE=",
    -      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -      "gravatar_id": "",
    -      "url": "https://api.github.com/users/octocat",
    -      "html_url": "https://github.com/octocat",
    -      "followers_url": "https://api.github.com/users/octocat/followers",
    -      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -      "organizations_url": "https://api.github.com/users/octocat/orgs",
    -      "repos_url": "https://api.github.com/users/octocat/repos",
    -      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -      "received_events_url": "https://api.github.com/users/octocat/received_events",
    -      "type": "User",
    -      "site_admin": false
    -    },
    -    "private": false,
    -    "html_url": "https://github.com/octocat/Hello-World",
    -    "description": "This your first repo!",
    -    "fork": false,
    -    "url": "https://api.github.com/repos/octocat/Hello-World",
    -    "archive_url": "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
    -    "assignees_url": "http://api.github.com/repos/octocat/Hello-World/assignees{/user}",
    -    "blobs_url": "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
    -    "branches_url": "http://api.github.com/repos/octocat/Hello-World/branches{/branch}",
    -    "collaborators_url": "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
    -    "comments_url": "http://api.github.com/repos/octocat/Hello-World/comments{/number}",
    -    "commits_url": "http://api.github.com/repos/octocat/Hello-World/commits{/sha}",
    -    "compare_url": "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
    -    "contents_url": "http://api.github.com/repos/octocat/Hello-World/contents/{+path}",
    -    "contributors_url": "http://api.github.com/repos/octocat/Hello-World/contributors",
    -    "deployments_url": "http://api.github.com/repos/octocat/Hello-World/deployments",
    -    "downloads_url": "http://api.github.com/repos/octocat/Hello-World/downloads",
    -    "events_url": "http://api.github.com/repos/octocat/Hello-World/events",
    -    "forks_url": "http://api.github.com/repos/octocat/Hello-World/forks",
    -    "git_commits_url": "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
    -    "git_refs_url": "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
    -    "git_tags_url": "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
    -    "git_url": "git:github.com/octocat/Hello-World.git",
    -    "issue_comment_url": "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
    -    "issue_events_url": "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
    -    "issues_url": "http://api.github.com/repos/octocat/Hello-World/issues{/number}",
    -    "keys_url": "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
    -    "labels_url": "http://api.github.com/repos/octocat/Hello-World/labels{/name}",
    -    "languages_url": "http://api.github.com/repos/octocat/Hello-World/languages",
    -    "merges_url": "http://api.github.com/repos/octocat/Hello-World/merges",
    -    "milestones_url": "http://api.github.com/repos/octocat/Hello-World/milestones{/number}",
    -    "notifications_url": "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
    -    "pulls_url": "http://api.github.com/repos/octocat/Hello-World/pulls{/number}",
    -    "releases_url": "http://api.github.com/repos/octocat/Hello-World/releases{/id}",
    -    "ssh_url": "git@github.com:octocat/Hello-World.git",
    -    "stargazers_url": "http://api.github.com/repos/octocat/Hello-World/stargazers",
    -    "statuses_url": "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
    -    "subscribers_url": "http://api.github.com/repos/octocat/Hello-World/subscribers",
    -    "subscription_url": "http://api.github.com/repos/octocat/Hello-World/subscription",
    -    "tags_url": "http://api.github.com/repos/octocat/Hello-World/tags",
    -    "teams_url": "http://api.github.com/repos/octocat/Hello-World/teams",
    -    "trees_url": "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
    -    "clone_url": "https://github.com/octocat/Hello-World.git",
    -    "mirror_url": "git:git.example.com/octocat/Hello-World",
    -    "hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks",
    -    "svn_url": "https://svn.github.com/octocat/Hello-World",
    -    "homepage": "https://github.com",
    -    "language": null,
    -    "forks_count": 9,
    -    "stargazers_count": 80,
    -    "watchers_count": 80,
    -    "size": 108,
    -    "default_branch": "master",
    -    "open_issues_count": 0,
    -    "is_template": true,
    -    "topics": [
    -      "octocat",
    -      "atom",
    -      "electron",
    -      "api"
    -    ],
    -    "has_issues": true,
    -    "has_projects": true,
    -    "has_wiki": true,
    -    "has_pages": false,
    -    "has_downloads": true,
    -    "archived": false,
    -    "disabled": false,
    -    "visibility": "public",
    -    "pushed_at": "2011-01-26T19:06:43Z",
    -    "created_at": "2011-01-26T19:01:12Z",
    -    "updated_at": "2011-01-26T19:14:43Z",
    -    "permissions": {
    -      "admin": false,
    -      "push": false,
    -      "pull": true
    -    },
    -    "allow_rebase_merge": true,
    -    "template_repository": null,
    -    "temp_clone_token": "ABTLWHOULUVAXGTRYU7OC2876QJ2O",
    -    "allow_squash_merge": true,
    -    "delete_branch_on_merge": true,
    -    "allow_merge_commit": true,
    -    "subscribers_count": 42,
    -    "network_count": 0
    -  }
    -]
    -
    - - -

    Notes

    - - - -
    -
    -
    -

    Watching

    -

    Watching a repository registers the user to receive notifications on new discussions, as well as events in the user's activity feed. For simple repository bookmarks, see "Repository starring."

    -
    -
    -

    - List watchers -

    -

    Lists the people watching the specified repository.

    -
    -
    get /repos/{owner}/{repo}/subscribers
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    ownerstringpath - - -
    repostringpath - - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/repos/octocat/hello-world/subscribers
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /repos/{owner}/{repo}/subscribers', {
    -  owner: 'octocat',
    -  repo: 'hello-world'
    -})
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    [
    -  {
    -    "login": "octocat",
    -    "id": 1,
    -    "node_id": "MDQ6VXNlcjE=",
    -    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -    "gravatar_id": "",
    -    "url": "https://api.github.com/users/octocat",
    -    "html_url": "https://github.com/octocat",
    -    "followers_url": "https://api.github.com/users/octocat/followers",
    -    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -    "organizations_url": "https://api.github.com/users/octocat/orgs",
    -    "repos_url": "https://api.github.com/users/octocat/repos",
    -    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -    "received_events_url": "https://api.github.com/users/octocat/received_events",
    -    "type": "User",
    -    "site_admin": false
    -  }
    -]
    -
    - - -

    Notes

    - - - -
    -
    -
    -
    - -
    get /repos/{owner}/{repo}/subscription
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    ownerstringpath - - -
    repostringpath - - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/repos/octocat/hello-world/subscription
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /repos/{owner}/{repo}/subscription', {
    -  owner: 'octocat',
    -  repo: 'hello-world'
    -})
    -
    - - - - -

    Response if you subscribe to the repository

    -
    Status: 200 OK
    -
    {
    -  "subscribed": true,
    -  "ignored": false,
    -  "reason": null,
    -  "created_at": "2012-10-06T21:34:12Z",
    -  "url": "https://api.github.com/repos/octocat/example/subscription",
    -  "repository_url": "https://api.github.com/repos/octocat/example"
    -}
    -
    - -

    Response if you don t subscribe to the repository

    -
    Status: 404 Not Found
    -
    - - - -
    -
    -
    -
    -
    -

    - Set a repository subscription -

    -

    If you would like to watch a repository, set subscribed to true. If you would like to ignore notifications made within a repository, set ignored to true. If you would like to stop watching a repository, delete the repository's subscription completely.

    -
    -
    put /repos/{owner}/{repo}/subscription
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    ownerstringpath - - -
    repostringpath - - -
    subscribedbooleanbody -

    Determines if notifications should be received from this repository.

    - -
    ignoredbooleanbody -

    Determines if all notifications should be blocked from this repository.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X PUT \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/repos/octocat/hello-world/subscription \
    -  -d '{"subscribed":true}'
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('PUT /repos/{owner}/{repo}/subscription', {
    -  owner: 'octocat',
    -  repo: 'hello-world',
    -  subscribed: true
    -})
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    {
    -  "subscribed": true,
    -  "ignored": false,
    -  "reason": null,
    -  "created_at": "2012-10-06T21:34:12Z",
    -  "url": "https://api.github.com/repos/octocat/example/subscription",
    -  "repository_url": "https://api.github.com/repos/octocat/example"
    -}
    -
    - - - -
    -
    -
    -
    -
    -

    - Delete a repository subscription -

    -

    This endpoint should only be used to stop watching a repository. To control whether or not you wish to receive notifications from a repository, set the repository's subscription manually.

    -
    -
    delete /repos/{owner}/{repo}/subscription
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    ownerstringpath - - -
    repostringpath - - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X DELETE \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/repos/octocat/hello-world/subscription
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('DELETE /repos/{owner}/{repo}/subscription', {
    -  owner: 'octocat',
    -  repo: 'hello-world'
    -})
    -
    - - - - -

    Default Response

    -
    Status: 204 No Content
    -
    - - - -
    -
    -
    -
    -
    -

    - List repositories watched by the authenticated user -

    -

    Lists repositories the authenticated user is watching.

    -
    -
    get /user/subscriptions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/user/subscriptions
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /user/subscriptions')
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    [
    -  {
    -    "id": 1296269,
    -    "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
    -    "name": "Hello-World",
    -    "full_name": "octocat/Hello-World",
    -    "owner": {
    -      "login": "octocat",
    -      "id": 1,
    -      "node_id": "MDQ6VXNlcjE=",
    -      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -      "gravatar_id": "",
    -      "url": "https://api.github.com/users/octocat",
    -      "html_url": "https://github.com/octocat",
    -      "followers_url": "https://api.github.com/users/octocat/followers",
    -      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -      "organizations_url": "https://api.github.com/users/octocat/orgs",
    -      "repos_url": "https://api.github.com/users/octocat/repos",
    -      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -      "received_events_url": "https://api.github.com/users/octocat/received_events",
    -      "type": "User",
    -      "site_admin": false
    -    },
    -    "private": false,
    -    "html_url": "https://github.com/octocat/Hello-World",
    -    "description": "This your first repo!",
    -    "fork": false,
    -    "url": "https://api.github.com/repos/octocat/Hello-World",
    -    "archive_url": "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
    -    "assignees_url": "http://api.github.com/repos/octocat/Hello-World/assignees{/user}",
    -    "blobs_url": "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
    -    "branches_url": "http://api.github.com/repos/octocat/Hello-World/branches{/branch}",
    -    "collaborators_url": "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
    -    "comments_url": "http://api.github.com/repos/octocat/Hello-World/comments{/number}",
    -    "commits_url": "http://api.github.com/repos/octocat/Hello-World/commits{/sha}",
    -    "compare_url": "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
    -    "contents_url": "http://api.github.com/repos/octocat/Hello-World/contents/{+path}",
    -    "contributors_url": "http://api.github.com/repos/octocat/Hello-World/contributors",
    -    "deployments_url": "http://api.github.com/repos/octocat/Hello-World/deployments",
    -    "downloads_url": "http://api.github.com/repos/octocat/Hello-World/downloads",
    -    "events_url": "http://api.github.com/repos/octocat/Hello-World/events",
    -    "forks_url": "http://api.github.com/repos/octocat/Hello-World/forks",
    -    "git_commits_url": "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
    -    "git_refs_url": "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
    -    "git_tags_url": "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
    -    "git_url": "git:github.com/octocat/Hello-World.git",
    -    "issue_comment_url": "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
    -    "issue_events_url": "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
    -    "issues_url": "http://api.github.com/repos/octocat/Hello-World/issues{/number}",
    -    "keys_url": "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
    -    "labels_url": "http://api.github.com/repos/octocat/Hello-World/labels{/name}",
    -    "languages_url": "http://api.github.com/repos/octocat/Hello-World/languages",
    -    "merges_url": "http://api.github.com/repos/octocat/Hello-World/merges",
    -    "milestones_url": "http://api.github.com/repos/octocat/Hello-World/milestones{/number}",
    -    "notifications_url": "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
    -    "pulls_url": "http://api.github.com/repos/octocat/Hello-World/pulls{/number}",
    -    "releases_url": "http://api.github.com/repos/octocat/Hello-World/releases{/id}",
    -    "ssh_url": "git@github.com:octocat/Hello-World.git",
    -    "stargazers_url": "http://api.github.com/repos/octocat/Hello-World/stargazers",
    -    "statuses_url": "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
    -    "subscribers_url": "http://api.github.com/repos/octocat/Hello-World/subscribers",
    -    "subscription_url": "http://api.github.com/repos/octocat/Hello-World/subscription",
    -    "tags_url": "http://api.github.com/repos/octocat/Hello-World/tags",
    -    "teams_url": "http://api.github.com/repos/octocat/Hello-World/teams",
    -    "trees_url": "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
    -    "clone_url": "https://github.com/octocat/Hello-World.git",
    -    "mirror_url": "git:git.example.com/octocat/Hello-World",
    -    "hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks",
    -    "svn_url": "https://svn.github.com/octocat/Hello-World",
    -    "homepage": "https://github.com",
    -    "language": null,
    -    "forks_count": 9,
    -    "stargazers_count": 80,
    -    "watchers_count": 80,
    -    "size": 108,
    -    "default_branch": "master",
    -    "open_issues_count": 0,
    -    "is_template": true,
    -    "topics": [
    -      "octocat",
    -      "atom",
    -      "electron",
    -      "api"
    -    ],
    -    "has_issues": true,
    -    "has_projects": true,
    -    "has_wiki": true,
    -    "has_pages": false,
    -    "has_downloads": true,
    -    "archived": false,
    -    "disabled": false,
    -    "visibility": "public",
    -    "pushed_at": "2011-01-26T19:06:43Z",
    -    "created_at": "2011-01-26T19:01:12Z",
    -    "updated_at": "2011-01-26T19:14:43Z",
    -    "permissions": {
    -      "admin": false,
    -      "push": false,
    -      "pull": true
    -    },
    -    "template_repository": null,
    -    "temp_clone_token": "ABTLWHOULUVAXGTRYU7OC2876QJ2O",
    -    "delete_branch_on_merge": true,
    -    "subscribers_count": 42,
    -    "network_count": 0,
    -    "license": {
    -      "key": "mit",
    -      "name": "MIT License",
    -      "spdx_id": "MIT",
    -      "url": "https://api.github.com/licenses/mit",
    -      "node_id": "MDc6TGljZW5zZW1pdA=="
    -    }
    -  }
    -]
    -
    - - - -
    -
    -
    -
    -
    -

    - List repositories watched by a user -

    -

    Lists repositories a user is watching.

    -
    -
    get /users/{username}/subscriptions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    Setting to application/vnd.github.v3+json is recommended

    - -
    usernamestringpath - - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.v3+json" \
    -  https://api.github.com/users/USERNAME/subscriptions
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /users/{username}/subscriptions', {
    -  username: 'username'
    -})
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    [
    -  {
    -    "id": 1296269,
    -    "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
    -    "name": "Hello-World",
    -    "full_name": "octocat/Hello-World",
    -    "owner": {
    -      "login": "octocat",
    -      "id": 1,
    -      "node_id": "MDQ6VXNlcjE=",
    -      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -      "gravatar_id": "",
    -      "url": "https://api.github.com/users/octocat",
    -      "html_url": "https://github.com/octocat",
    -      "followers_url": "https://api.github.com/users/octocat/followers",
    -      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -      "organizations_url": "https://api.github.com/users/octocat/orgs",
    -      "repos_url": "https://api.github.com/users/octocat/repos",
    -      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -      "received_events_url": "https://api.github.com/users/octocat/received_events",
    -      "type": "User",
    -      "site_admin": false
    -    },
    -    "private": false,
    -    "html_url": "https://github.com/octocat/Hello-World",
    -    "description": "This your first repo!",
    -    "fork": false,
    -    "url": "https://api.github.com/repos/octocat/Hello-World",
    -    "archive_url": "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
    -    "assignees_url": "http://api.github.com/repos/octocat/Hello-World/assignees{/user}",
    -    "blobs_url": "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
    -    "branches_url": "http://api.github.com/repos/octocat/Hello-World/branches{/branch}",
    -    "collaborators_url": "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
    -    "comments_url": "http://api.github.com/repos/octocat/Hello-World/comments{/number}",
    -    "commits_url": "http://api.github.com/repos/octocat/Hello-World/commits{/sha}",
    -    "compare_url": "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
    -    "contents_url": "http://api.github.com/repos/octocat/Hello-World/contents/{+path}",
    -    "contributors_url": "http://api.github.com/repos/octocat/Hello-World/contributors",
    -    "deployments_url": "http://api.github.com/repos/octocat/Hello-World/deployments",
    -    "downloads_url": "http://api.github.com/repos/octocat/Hello-World/downloads",
    -    "events_url": "http://api.github.com/repos/octocat/Hello-World/events",
    -    "forks_url": "http://api.github.com/repos/octocat/Hello-World/forks",
    -    "git_commits_url": "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
    -    "git_refs_url": "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
    -    "git_tags_url": "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
    -    "git_url": "git:github.com/octocat/Hello-World.git",
    -    "issue_comment_url": "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
    -    "issue_events_url": "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
    -    "issues_url": "http://api.github.com/repos/octocat/Hello-World/issues{/number}",
    -    "keys_url": "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
    -    "labels_url": "http://api.github.com/repos/octocat/Hello-World/labels{/name}",
    -    "languages_url": "http://api.github.com/repos/octocat/Hello-World/languages",
    -    "merges_url": "http://api.github.com/repos/octocat/Hello-World/merges",
    -    "milestones_url": "http://api.github.com/repos/octocat/Hello-World/milestones{/number}",
    -    "notifications_url": "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
    -    "pulls_url": "http://api.github.com/repos/octocat/Hello-World/pulls{/number}",
    -    "releases_url": "http://api.github.com/repos/octocat/Hello-World/releases{/id}",
    -    "ssh_url": "git@github.com:octocat/Hello-World.git",
    -    "stargazers_url": "http://api.github.com/repos/octocat/Hello-World/stargazers",
    -    "statuses_url": "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
    -    "subscribers_url": "http://api.github.com/repos/octocat/Hello-World/subscribers",
    -    "subscription_url": "http://api.github.com/repos/octocat/Hello-World/subscription",
    -    "tags_url": "http://api.github.com/repos/octocat/Hello-World/tags",
    -    "teams_url": "http://api.github.com/repos/octocat/Hello-World/teams",
    -    "trees_url": "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
    -    "clone_url": "https://github.com/octocat/Hello-World.git",
    -    "mirror_url": "git:git.example.com/octocat/Hello-World",
    -    "hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks",
    -    "svn_url": "https://svn.github.com/octocat/Hello-World",
    -    "homepage": "https://github.com",
    -    "language": null,
    -    "forks_count": 9,
    -    "stargazers_count": 80,
    -    "watchers_count": 80,
    -    "size": 108,
    -    "default_branch": "master",
    -    "open_issues_count": 0,
    -    "is_template": true,
    -    "topics": [
    -      "octocat",
    -      "atom",
    -      "electron",
    -      "api"
    -    ],
    -    "has_issues": true,
    -    "has_projects": true,
    -    "has_wiki": true,
    -    "has_pages": false,
    -    "has_downloads": true,
    -    "archived": false,
    -    "disabled": false,
    -    "visibility": "public",
    -    "pushed_at": "2011-01-26T19:06:43Z",
    -    "created_at": "2011-01-26T19:01:12Z",
    -    "updated_at": "2011-01-26T19:14:43Z",
    -    "permissions": {
    -      "admin": false,
    -      "push": false,
    -      "pull": true
    -    },
    -    "template_repository": null,
    -    "temp_clone_token": "ABTLWHOULUVAXGTRYU7OC2876QJ2O",
    -    "delete_branch_on_merge": true,
    -    "subscribers_count": 42,
    -    "network_count": 0,
    -    "license": {
    -      "key": "mit",
    -      "name": "MIT License",
    -      "spdx_id": "MIT",
    -      "url": "https://api.github.com/licenses/mit",
    -      "node_id": "MDc6TGljZW5zZW1pdA=="
    -    }
    -  }
    -]
    -
    - - -

    Notes

    - - - -
    -
    -
    -
    -
    -
    -
    - -
    -

    - Did this doc help you? -

    -

    - - - - -

    - - - - - -

    - - -

    - - -
    - -
    -
    - - - -
    -
    -
    -
    -

    Ask a human

    -

    Can't find what you're looking for?

    - Contact us -
    -
    - -
    -
    -
    -
    - - - - - -
    - - diff --git a/update-urls/testdata/activity_events-original.go b/update-urls/testdata/activity_events-original.go deleted file mode 100644 index eec0f956de7..00000000000 --- a/update-urls/testdata/activity_events-original.go +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright 2013 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" -) - -// ListEvents drinks from the firehose of all public events across GitHub. -// -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-public-events -func (s *ActivityService) ListEvents(ctx context.Context, opts *ListOptions) ([]*Event, *Response, error) { - u, err := addOptions("events", opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// ListRepositoryEvents lists events for a repository. -// -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-repository-events -func (s *ActivityService) ListRepositoryEvents(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Event, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/events", owner, repo) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// Note that ActivityService.ListIssueEventsForRepository was moved to: -// IssuesService.ListRepositoryEvents. - -// ListEventsForRepoNetwork lists public events for a network of repositories. -// -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-public-events-for-a-network-of-repositories -func (s *ActivityService) ListEventsForRepoNetwork(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Event, *Response, error) { - u := fmt.Sprintf("networks/%v/%v/events", owner, repo) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// ListEventsForOrganization lists public events for an organization. -// -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-public-events-for-an-organization -func (s *ActivityService) ListEventsForOrganization(ctx context.Context, org string, opts *ListOptions) ([]*Event, *Response, error) { - u := fmt.Sprintf("orgs/%v/events", org) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// ListEventsPerformedByUser lists the events performed by a user. If publicOnly is -// true, only public events will be returned. -// -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-events-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-public-events-for-a-user -func (s *ActivityService) ListEventsPerformedByUser(ctx context.Context, user string, publicOnly bool, opts *ListOptions) ([]*Event, *Response, error) { - var u string - if publicOnly { - u = fmt.Sprintf("users/%v/events/public", user) - } else { - u = fmt.Sprintf("users/%v/events", user) - } - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// ListEventsReceivedByUser lists the events received by a user. If publicOnly is -// true, only public events will be returned. -// -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-events-received-by-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-public-events-received-by-a-user -func (s *ActivityService) ListEventsReceivedByUser(ctx context.Context, user string, publicOnly bool, opts *ListOptions) ([]*Event, *Response, error) { - var u string - if publicOnly { - u = fmt.Sprintf("users/%v/received_events/public", user) - } else { - u = fmt.Sprintf("users/%v/received_events", user) - } - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// ListUserEventsForOrganization provides the user’s organization dashboard. You -// must be authenticated as the user to view this. -// -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-events-for-an-organization -func (s *ActivityService) ListUserEventsForOrganization(ctx context.Context, org, user string, opts *ListOptions) ([]*Event, *Response, error) { - u := fmt.Sprintf("users/%v/events/orgs/%v", user, org) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} diff --git a/update-urls/testdata/activity_events-want.go b/update-urls/testdata/activity_events-want.go deleted file mode 100644 index 760793e6985..00000000000 --- a/update-urls/testdata/activity_events-want.go +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright 2013 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" -) - -// ListEvents drinks from the firehose of all public events across GitHub. -// -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-public-events -func (s *ActivityService) ListEvents(ctx context.Context, opts *ListOptions) ([]*Event, *Response, error) { - u, err := addOptions("events", opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// ListRepositoryEvents lists events for a repository. -// -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-repository-events -func (s *ActivityService) ListRepositoryEvents(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Event, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/events", owner, repo) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// Note that ActivityService.ListIssueEventsForRepository was moved to: -// IssuesService.ListRepositoryEvents. - -// ListEventsForRepoNetwork lists public events for a network of repositories. -// -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-public-events-for-a-network-of-repositories -func (s *ActivityService) ListEventsForRepoNetwork(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Event, *Response, error) { - u := fmt.Sprintf("networks/%v/%v/events", owner, repo) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// ListEventsForOrganization lists public events for an organization. -// -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-public-organization-events -func (s *ActivityService) ListEventsForOrganization(ctx context.Context, org string, opts *ListOptions) ([]*Event, *Response, error) { - u := fmt.Sprintf("orgs/%v/events", org) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// ListEventsPerformedByUser lists the events performed by a user. If publicOnly is -// true, only public events will be returned. -// -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-events-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-public-events-for-a-user -func (s *ActivityService) ListEventsPerformedByUser(ctx context.Context, user string, publicOnly bool, opts *ListOptions) ([]*Event, *Response, error) { - var u string - if publicOnly { - u = fmt.Sprintf("users/%v/events/public", user) - } else { - u = fmt.Sprintf("users/%v/events", user) - } - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// ListEventsReceivedByUser lists the events received by a user. If publicOnly is -// true, only public events will be returned. -// -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-events-received-by-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-public-events-received-by-a-user -func (s *ActivityService) ListEventsReceivedByUser(ctx context.Context, user string, publicOnly bool, opts *ListOptions) ([]*Event, *Response, error) { - var u string - if publicOnly { - u = fmt.Sprintf("users/%v/received_events/public", user) - } else { - u = fmt.Sprintf("users/%v/received_events", user) - } - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// ListUserEventsForOrganization provides the user’s organization dashboard. You -// must be authenticated as the user to view this. -// -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-organization-events-for-the-authenticated-user -func (s *ActivityService) ListUserEventsForOrganization(ctx context.Context, org, user string, opts *ListOptions) ([]*Event, *Response, error) { - u := fmt.Sprintf("users/%v/events/orgs/%v", user, org) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} diff --git a/update-urls/testdata/reactions-original.go b/update-urls/testdata/reactions-original.go deleted file mode 100644 index d3e57bdb819..00000000000 --- a/update-urls/testdata/reactions-original.go +++ /dev/null @@ -1,490 +0,0 @@ -// Copyright 2016 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" -) - -// ReactionsService provides access to the reactions-related functions in the -// GitHub API. -type ReactionsService service - -// Reaction represents a GitHub reaction. -type Reaction struct { - // ID is the Reaction ID. - ID *int64 `json:"id,omitempty"` - User *User `json:"user,omitempty"` - NodeID *string `json:"node_id,omitempty"` - // Content is the type of reaction. - // Possible values are: - // "+1", "-1", "laugh", "confused", "heart", "hooray". - Content *string `json:"content,omitempty"` -} - -// Reactions represents a summary of GitHub reactions. -type Reactions struct { - TotalCount *int `json:"total_count,omitempty"` - PlusOne *int `json:"+1,omitempty"` - MinusOne *int `json:"-1,omitempty"` - Laugh *int `json:"laugh,omitempty"` - Confused *int `json:"confused,omitempty"` - Heart *int `json:"heart,omitempty"` - Hooray *int `json:"hooray,omitempty"` - URL *string `json:"url,omitempty"` -} - -func (r Reaction) String() string { - return Stringify(r) -} - -// ListCommentReactionOptions specifies the optional parameters to the -// ReactionsService.ListCommentReactions method. -type ListCommentReactionOptions struct { - // Content restricts the returned comment reactions to only those with the given type. - // Omit this parameter to list all reactions to a commit comment. - // Possible values are: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". - Content string `url:"content,omitempty"` - - ListOptions -} - -// ListCommentReactions lists the reactions for a commit comment. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-a-commit-comment -func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListCommentReactionOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// CreateCommentReaction creates a reaction for a commit comment. -// Note that if you have already created a reaction of type content, the -// previously created reaction will be returned with Status: 200 OK. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-a-commit-comment -func (s *ReactionsService) CreateCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// DeleteCommentReaction deletes the reaction for a commit comment. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-a-commit-comment-reaction -func (s *ReactionsService) DeleteCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { - u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions/%v", owner, repo, commentID, reactionID) - - return s.deleteReaction(ctx, u) -} - -// DeleteCommentReactionByID deletes the reaction for a commit comment by repository ID. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-a-commit-comment-reaction -func (s *ReactionsService) DeleteCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { - u := fmt.Sprintf("repositories/%v/comments/%v/reactions/%v", repoID, commentID, reactionID) - - return s.deleteReaction(ctx, u) -} - -// ListIssueReactions lists the reactions for an issue. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-an-issue -func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// CreateIssueReaction creates a reaction for an issue. -// Note that if you have already created a reaction of type content, the -// previously created reaction will be returned with Status: 200 OK. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-an-issue -func (s *ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo string, number int, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// DeleteIssueReaction deletes the reaction to an issue. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-an-issue-reaction -func (s *ReactionsService) DeleteIssueReaction(ctx context.Context, owner, repo string, issueNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repos/%v/%v/issues/%v/reactions/%v", owner, repo, issueNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -// DeleteIssueReactionByID deletes the reaction to an issue by repository ID. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-an-issue-reaction -func (s *ReactionsService) DeleteIssueReactionByID(ctx context.Context, repoID, issueNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repositories/%v/issues/%v/reactions/%v", repoID, issueNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -// ListIssueCommentReactions lists the reactions for an issue comment. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-an-issue-comment -func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// CreateIssueCommentReaction creates a reaction for an issue comment. -// Note that if you have already created a reaction of type content, the -// previously created reaction will be returned with Status: 200 OK. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-an-issue-comment -func (s *ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// DeleteIssueCommentReaction deletes the reaction to an issue comment. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-an-issue-comment-reaction -func (s *ReactionsService) DeleteIssueCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions/%v", owner, repo, commentID, reactionID) - - return s.deleteReaction(ctx, url) -} - -// DeleteIssueCommentReactionByID deletes the reaction to an issue comment by repository ID. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-an-issue-comment-reaction -func (s *ReactionsService) DeleteIssueCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repositories/%v/issues/comments/%v/reactions/%v", repoID, commentID, reactionID) - - return s.deleteReaction(ctx, url) -} - -// ListPullRequestCommentReactions lists the reactions for a pull request review comment. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-an-issue-comment -func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// CreatePullRequestCommentReaction creates a reaction for a pull request review comment. -// Note that if you have already created a reaction of type content, the -// previously created reaction will be returned with Status: 200 OK. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-an-issue-comment -func (s *ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// DeletePullRequestCommentReaction deletes the reaction to a pull request review comment. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-a-pull-request-comment-reaction -func (s *ReactionsService) DeletePullRequestCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions/%v", owner, repo, commentID, reactionID) - - return s.deleteReaction(ctx, url) -} - -// DeletePullRequestCommentReactionByID deletes the reaction to a pull request review comment by repository ID. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-a-pull-request-comment-reaction -func (s *ReactionsService) DeletePullRequestCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repositories/%v/pulls/comments/%v/reactions/%v", repoID, commentID, reactionID) - - return s.deleteReaction(ctx, url) -} - -// ListTeamDiscussionReactions lists the reactions for a team discussion. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-a-team-discussion -func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, teamID int64, discussionNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// CreateTeamDiscussionReaction creates a reaction for a team discussion. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-a-team-discussion -func (s *ReactionsService) CreateTeamDiscussionReaction(ctx context.Context, teamID int64, discussionNumber int, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - req.Header.Set("Accept", mediaTypeReactionsPreview) - - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// DeleteTeamDiscussionReaction deletes the reaction to a team discussion. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-team-discussion-reaction -func (s *ReactionsService) DeleteTeamDiscussionReaction(ctx context.Context, org, teamSlug string, discussionNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/reactions/%v", org, teamSlug, discussionNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -// DeleteTeamDiscussionReactionByOrgIDAndTeamID deletes the reaction to a team discussion by organization ID and team ID. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-team-discussion-reaction -func (s *ReactionsService) DeleteTeamDiscussionReactionByOrgIDAndTeamID(ctx context.Context, orgID, teamID, discussionNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/reactions/%v", orgID, teamID, discussionNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -// ListTeamDiscussionCommentReactions lists the reactions for a team discussion comment. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-a-team-discussion-comment -func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Context, teamID int64, discussionNumber, commentNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, nil, err - } - return m, resp, nil -} - -// CreateTeamDiscussionCommentReaction creates a reaction for a team discussion comment. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-a-team-discussion-comment -func (s *ReactionsService) CreateTeamDiscussionCommentReaction(ctx context.Context, teamID int64, discussionNumber, commentNumber int, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - req.Header.Set("Accept", mediaTypeReactionsPreview) - - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// DeleteTeamDiscussionCommentReaction deletes the reaction to a team discussion comment. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-team-discussion-comment-reaction -func (s *ReactionsService) DeleteTeamDiscussionCommentReaction(ctx context.Context, org, teamSlug string, discussionNumber, commentNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v/reactions/%v", org, teamSlug, discussionNumber, commentNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -// DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID deletes the reaction to a team discussion comment by organization ID and team ID. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-team-discussion-comment-reaction -func (s *ReactionsService) DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID(ctx context.Context, orgID, teamID, discussionNumber, commentNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v/reactions/%v", orgID, teamID, discussionNumber, commentNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -func (s *ReactionsService) deleteReaction(ctx context.Context, url string) (*Response, error) { - req, err := s.client.NewRequest(http.MethodDelete, url, nil) - if err != nil { - return nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - return s.client.Do(ctx, req, nil) -} diff --git a/update-urls/testdata/reactions-want.go b/update-urls/testdata/reactions-want.go deleted file mode 100644 index 4e70c458706..00000000000 --- a/update-urls/testdata/reactions-want.go +++ /dev/null @@ -1,490 +0,0 @@ -// Copyright 2016 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" -) - -// ReactionsService provides access to the reactions-related functions in the -// GitHub API. -type ReactionsService service - -// Reaction represents a GitHub reaction. -type Reaction struct { - // ID is the Reaction ID. - ID *int64 `json:"id,omitempty"` - User *User `json:"user,omitempty"` - NodeID *string `json:"node_id,omitempty"` - // Content is the type of reaction. - // Possible values are: - // "+1", "-1", "laugh", "confused", "heart", "hooray". - Content *string `json:"content,omitempty"` -} - -// Reactions represents a summary of GitHub reactions. -type Reactions struct { - TotalCount *int `json:"total_count,omitempty"` - PlusOne *int `json:"+1,omitempty"` - MinusOne *int `json:"-1,omitempty"` - Laugh *int `json:"laugh,omitempty"` - Confused *int `json:"confused,omitempty"` - Heart *int `json:"heart,omitempty"` - Hooray *int `json:"hooray,omitempty"` - URL *string `json:"url,omitempty"` -} - -func (r Reaction) String() string { - return Stringify(r) -} - -// ListCommentReactionOptions specifies the optional parameters to the -// ReactionsService.ListCommentReactions method. -type ListCommentReactionOptions struct { - // Content restricts the returned comment reactions to only those with the given type. - // Omit this parameter to list all reactions to a commit comment. - // Possible values are: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". - Content string `url:"content,omitempty"` - - ListOptions -} - -// ListCommentReactions lists the reactions for a commit comment. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-a-commit-comment -func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListCommentReactionOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// CreateCommentReaction creates a reaction for a commit comment. -// Note that if you have already created a reaction of type content, the -// previously created reaction will be returned with Status: 200 OK. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-a-commit-comment -func (s *ReactionsService) CreateCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// DeleteCommentReaction deletes the reaction for a commit comment. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-a-commit-comment-reaction -func (s *ReactionsService) DeleteCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { - u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions/%v", owner, repo, commentID, reactionID) - - return s.deleteReaction(ctx, u) -} - -// DeleteCommentReactionByID deletes the reaction for a commit comment by repository ID. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-a-commit-comment-reaction -func (s *ReactionsService) DeleteCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { - u := fmt.Sprintf("repositories/%v/comments/%v/reactions/%v", repoID, commentID, reactionID) - - return s.deleteReaction(ctx, u) -} - -// ListIssueReactions lists the reactions for an issue. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-an-issue -func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// CreateIssueReaction creates a reaction for an issue. -// Note that if you have already created a reaction of type content, the -// previously created reaction will be returned with Status: 200 OK. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-an-issue -func (s *ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo string, number int, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// DeleteIssueReaction deletes the reaction to an issue. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-an-issue-reaction -func (s *ReactionsService) DeleteIssueReaction(ctx context.Context, owner, repo string, issueNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repos/%v/%v/issues/%v/reactions/%v", owner, repo, issueNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -// DeleteIssueReactionByID deletes the reaction to an issue by repository ID. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-an-issue-reaction -func (s *ReactionsService) DeleteIssueReactionByID(ctx context.Context, repoID, issueNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repositories/%v/issues/%v/reactions/%v", repoID, issueNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -// ListIssueCommentReactions lists the reactions for an issue comment. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-an-issue-comment -func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// CreateIssueCommentReaction creates a reaction for an issue comment. -// Note that if you have already created a reaction of type content, the -// previously created reaction will be returned with Status: 200 OK. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-an-issue-comment -func (s *ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// DeleteIssueCommentReaction deletes the reaction to an issue comment. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-an-issue-comment-reaction -func (s *ReactionsService) DeleteIssueCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions/%v", owner, repo, commentID, reactionID) - - return s.deleteReaction(ctx, url) -} - -// DeleteIssueCommentReactionByID deletes the reaction to an issue comment by repository ID. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-an-issue-comment-reaction -func (s *ReactionsService) DeleteIssueCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repositories/%v/issues/comments/%v/reactions/%v", repoID, commentID, reactionID) - - return s.deleteReaction(ctx, url) -} - -// ListPullRequestCommentReactions lists the reactions for a pull request review comment. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-a-pull-request-review-comment -func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// CreatePullRequestCommentReaction creates a reaction for a pull request review comment. -// Note that if you have already created a reaction of type content, the -// previously created reaction will be returned with Status: 200 OK. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-a-pull-request-review-comment -func (s *ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// DeletePullRequestCommentReaction deletes the reaction to a pull request review comment. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-a-pull-request-comment-reaction -func (s *ReactionsService) DeletePullRequestCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions/%v", owner, repo, commentID, reactionID) - - return s.deleteReaction(ctx, url) -} - -// DeletePullRequestCommentReactionByID deletes the reaction to a pull request review comment by repository ID. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-a-pull-request-comment-reaction -func (s *ReactionsService) DeletePullRequestCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repositories/%v/pulls/comments/%v/reactions/%v", repoID, commentID, reactionID) - - return s.deleteReaction(ctx, url) -} - -// ListTeamDiscussionReactions lists the reactions for a team discussion. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-a-team-discussion-legacy -func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, teamID int64, discussionNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// CreateTeamDiscussionReaction creates a reaction for a team discussion. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-a-team-discussion-legacy -func (s *ReactionsService) CreateTeamDiscussionReaction(ctx context.Context, teamID int64, discussionNumber int, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - req.Header.Set("Accept", mediaTypeReactionsPreview) - - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// DeleteTeamDiscussionReaction deletes the reaction to a team discussion. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-team-discussion-reaction -func (s *ReactionsService) DeleteTeamDiscussionReaction(ctx context.Context, org, teamSlug string, discussionNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/reactions/%v", org, teamSlug, discussionNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -// DeleteTeamDiscussionReactionByOrgIDAndTeamID deletes the reaction to a team discussion by organization ID and team ID. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-team-discussion-reaction -func (s *ReactionsService) DeleteTeamDiscussionReactionByOrgIDAndTeamID(ctx context.Context, orgID, teamID, discussionNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/reactions/%v", orgID, teamID, discussionNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -// ListTeamDiscussionCommentReactions lists the reactions for a team discussion comment. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-a-team-discussion-comment-legacy -func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Context, teamID int64, discussionNumber, commentNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, nil, err - } - return m, resp, nil -} - -// CreateTeamDiscussionCommentReaction creates a reaction for a team discussion comment. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-a-team-discussion-comment-legacy -func (s *ReactionsService) CreateTeamDiscussionCommentReaction(ctx context.Context, teamID int64, discussionNumber, commentNumber int, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - req.Header.Set("Accept", mediaTypeReactionsPreview) - - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// DeleteTeamDiscussionCommentReaction deletes the reaction to a team discussion comment. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-team-discussion-comment-reaction -func (s *ReactionsService) DeleteTeamDiscussionCommentReaction(ctx context.Context, org, teamSlug string, discussionNumber, commentNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v/reactions/%v", org, teamSlug, discussionNumber, commentNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -// DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID deletes the reaction to a team discussion comment by organization ID and team ID. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-team-discussion-comment-reaction -func (s *ReactionsService) DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID(ctx context.Context, orgID, teamID, discussionNumber, commentNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v/reactions/%v", orgID, teamID, discussionNumber, commentNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -func (s *ReactionsService) deleteReaction(ctx context.Context, url string) (*Response, error) { - req, err := s.client.NewRequest(http.MethodDelete, url, nil) - if err != nil { - return nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - return s.client.Do(ctx, req, nil) -} diff --git a/update-urls/testdata/reactions.html b/update-urls/testdata/reactions.html deleted file mode 100644 index 2669f856c09..00000000000 --- a/update-urls/testdata/reactions.html +++ /dev/null @@ -1,5690 +0,0 @@ - - - Reactions - GitHub Docs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - -
    -
    - - - -
    -
    - -
    - - - Article version: GitHub.com - - - - -
    - - -
    -
    - - -
    -
    - -
    - -
    -
    -

    Reactions

    -
    - -
    -
    - - - - - - - - -
    -
    -
    - -

    In this article

    - - -
    - -
    -

    - Did this doc help you? -

    -

    - - - - -

    - - - - - -

    - - -

    - - -
    - -
    -
    -
    -
    - -

    Reaction types

    -

    When creating a reaction, the allowed values for the content parameter are as follows (with the corresponding emoji for reference):

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    contentemoji
    +1👍
    -1👎
    laugh😄
    confused😕
    heart❤️
    hooray🎉
    rocket🚀
    eyes👀
    -
    -
    -

    - List reactions for a team discussion comment -

    -

    List the reactions to a team discussion comment. OAuth access tokens require the read:discussion scope.

    -

    Note: You can also specify a team by org_id and team_id using the route GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions.

    -
    -
    get /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    orgstringpath - - -
    team_slugstringpath - - -
    discussion_numberintegerpath - - -
    comment_numberintegerpath - - -
    contentstringquery -

    Returns a single reaction type. Omit this parameter to list all reactions to a team discussion comment.

    - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/discussions/42/comments/42/reactions
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions', {
    -  org: 'org',
    -  team_slug: 'team_slug',
    -  discussion_number: 42,
    -  comment_number: 42,
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    [
    -  {
    -    "id": 1,
    -    "node_id": "MDg6UmVhY3Rpb24x",
    -    "user": {
    -      "login": "octocat",
    -      "id": 1,
    -      "node_id": "MDQ6VXNlcjE=",
    -      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -      "gravatar_id": "",
    -      "url": "https://api.github.com/users/octocat",
    -      "html_url": "https://github.com/octocat",
    -      "followers_url": "https://api.github.com/users/octocat/followers",
    -      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -      "organizations_url": "https://api.github.com/users/octocat/orgs",
    -      "repos_url": "https://api.github.com/users/octocat/repos",
    -      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -      "received_events_url": "https://api.github.com/users/octocat/received_events",
    -      "type": "User",
    -      "site_admin": false
    -    },
    -    "content": "heart",
    -    "created_at": "2016-05-20T20:09:31Z"
    -  }
    -]
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - Create reaction for a team discussion comment -

    -

    Create a reaction to a team discussion comment. OAuth access tokens require the write:discussion scope. A response with a Status: 200 OK means that you already added the reaction type to this team discussion comment.

    -

    Note: You can also specify a team by org_id and team_id using the route POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions.

    -
    -
    post /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    orgstringpath - - -
    team_slugstringpath - - -
    discussion_numberintegerpath - - -
    comment_numberintegerpath - - -
    contentstringbody -

    Required. The reaction type to add to the team discussion comment.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X POST \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/discussions/42/comments/42/reactions \
    -  -d '{"content":"content"}'
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions', {
    -  org: 'org',
    -  team_slug: 'team_slug',
    -  discussion_number: 42,
    -  comment_number: 42,
    -  content: 'content',
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default response

    -
    Status: 201 Created
    -
    {
    -  "id": 1,
    -  "node_id": "MDg6UmVhY3Rpb24x",
    -  "user": {
    -    "login": "octocat",
    -    "id": 1,
    -    "node_id": "MDQ6VXNlcjE=",
    -    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -    "gravatar_id": "",
    -    "url": "https://api.github.com/users/octocat",
    -    "html_url": "https://github.com/octocat",
    -    "followers_url": "https://api.github.com/users/octocat/followers",
    -    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -    "organizations_url": "https://api.github.com/users/octocat/orgs",
    -    "repos_url": "https://api.github.com/users/octocat/repos",
    -    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -    "received_events_url": "https://api.github.com/users/octocat/received_events",
    -    "type": "User",
    -    "site_admin": false
    -  },
    -  "content": "heart",
    -  "created_at": "2016-05-20T20:09:31Z"
    -}
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - Delete team discussion comment reaction -

    -

    Note: You can also specify a team or organization with team_id and org_id using the route DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id.

    -

    Delete a reaction to a team discussion comment. OAuth access tokens require the write:discussion scope.

    -
    -
    delete /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    orgstringpath - - -
    team_slugstringpath - - -
    discussion_numberintegerpath - - -
    comment_numberintegerpath - - -
    reaction_idintegerpath - - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X DELETE \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/discussions/42/comments/42/reactions/42
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}', {
    -  org: 'org',
    -  team_slug: 'team_slug',
    -  discussion_number: 42,
    -  comment_number: 42,
    -  reaction_id: 42,
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default Response

    -
    Status: 204 No Content
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - List reactions for a team discussion -

    -

    List the reactions to a team discussion. OAuth access tokens require the read:discussion scope.

    -

    Note: You can also specify a team by org_id and team_id using the route GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions.

    -
    -
    get /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    orgstringpath - - -
    team_slugstringpath - - -
    discussion_numberintegerpath - - -
    contentstringquery -

    Returns a single reaction type. Omit this parameter to list all reactions to a team discussion.

    - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/discussions/42/reactions
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions', {
    -  org: 'org',
    -  team_slug: 'team_slug',
    -  discussion_number: 42,
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    [
    -  {
    -    "id": 1,
    -    "node_id": "MDg6UmVhY3Rpb24x",
    -    "user": {
    -      "login": "octocat",
    -      "id": 1,
    -      "node_id": "MDQ6VXNlcjE=",
    -      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -      "gravatar_id": "",
    -      "url": "https://api.github.com/users/octocat",
    -      "html_url": "https://github.com/octocat",
    -      "followers_url": "https://api.github.com/users/octocat/followers",
    -      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -      "organizations_url": "https://api.github.com/users/octocat/orgs",
    -      "repos_url": "https://api.github.com/users/octocat/repos",
    -      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -      "received_events_url": "https://api.github.com/users/octocat/received_events",
    -      "type": "User",
    -      "site_admin": false
    -    },
    -    "content": "heart",
    -    "created_at": "2016-05-20T20:09:31Z"
    -  }
    -]
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - Create reaction for a team discussion -

    -

    Create a reaction to a team discussion. OAuth access tokens require the write:discussion scope. A response with a Status: 200 OK means that you already added the reaction type to this team discussion.

    -

    Note: You can also specify a team by org_id and team_id using the route POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions.

    -
    -
    post /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    orgstringpath - - -
    team_slugstringpath - - -
    discussion_numberintegerpath - - -
    contentstringbody -

    Required. The reaction type to add to the team discussion.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X POST \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/discussions/42/reactions \
    -  -d '{"content":"content"}'
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions', {
    -  org: 'org',
    -  team_slug: 'team_slug',
    -  discussion_number: 42,
    -  content: 'content',
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default response

    -
    Status: 201 Created
    -
    {
    -  "id": 1,
    -  "node_id": "MDg6UmVhY3Rpb24x",
    -  "user": {
    -    "login": "octocat",
    -    "id": 1,
    -    "node_id": "MDQ6VXNlcjE=",
    -    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -    "gravatar_id": "",
    -    "url": "https://api.github.com/users/octocat",
    -    "html_url": "https://github.com/octocat",
    -    "followers_url": "https://api.github.com/users/octocat/followers",
    -    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -    "organizations_url": "https://api.github.com/users/octocat/orgs",
    -    "repos_url": "https://api.github.com/users/octocat/repos",
    -    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -    "received_events_url": "https://api.github.com/users/octocat/received_events",
    -    "type": "User",
    -    "site_admin": false
    -  },
    -  "content": "heart",
    -  "created_at": "2016-05-20T20:09:31Z"
    -}
    -
    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - Delete team discussion reaction -

    -

    Note: You can also specify a team or organization with team_id and org_id using the route DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions/:reaction_id.

    -

    Delete a reaction to a team discussion. OAuth access tokens require the write:discussion scope.

    -
    -
    delete /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    orgstringpath - - -
    team_slugstringpath - - -
    discussion_numberintegerpath - - -
    reaction_idintegerpath - - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X DELETE \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/discussions/42/reactions/42
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}', {
    -  org: 'org',
    -  team_slug: 'team_slug',
    -  discussion_number: 42,
    -  reaction_id: 42,
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default Response

    -
    Status: 204 No Content
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - Delete a reaction (Legacy) -

    -

    Deprecation Notice: This endpoint route is deprecated and will be removed from the Reactions API. We recommend migrating your existing code to use the new delete reactions endpoints. For more information, see this blog post.

    -

    OAuth access tokens require the write:discussion scope, when deleting a team discussion or team discussion comment.

    -
    -
    delete /reactions/{reaction_id}
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    reaction_idintegerpath - - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X DELETE \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/reactions/42
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('DELETE /reactions/{reaction_id}', {
    -  reaction_id: 42,
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default Response

    -
    Status: 204 No Content
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - List reactions for a commit comment -

    -

    List the reactions to a commit comment.

    -
    -
    get /repos/{owner}/{repo}/comments/{comment_id}/reactions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    ownerstringpath - - -
    repostringpath - - -
    comment_idintegerpath - - -
    contentstringquery -

    Returns a single reaction type. Omit this parameter to list all reactions to a commit comment.

    - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/repos/octocat/hello-world/comments/42/reactions
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /repos/{owner}/{repo}/comments/{comment_id}/reactions', {
    -  owner: 'octocat',
    -  repo: 'hello-world',
    -  comment_id: 42,
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    [
    -  {
    -    "id": 1,
    -    "node_id": "MDg6UmVhY3Rpb24x",
    -    "user": {
    -      "login": "octocat",
    -      "id": 1,
    -      "node_id": "MDQ6VXNlcjE=",
    -      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -      "gravatar_id": "",
    -      "url": "https://api.github.com/users/octocat",
    -      "html_url": "https://github.com/octocat",
    -      "followers_url": "https://api.github.com/users/octocat/followers",
    -      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -      "organizations_url": "https://api.github.com/users/octocat/orgs",
    -      "repos_url": "https://api.github.com/users/octocat/repos",
    -      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -      "received_events_url": "https://api.github.com/users/octocat/received_events",
    -      "type": "User",
    -      "site_admin": false
    -    },
    -    "content": "heart",
    -    "created_at": "2016-05-20T20:09:31Z"
    -  }
    -]
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - Create reaction for a commit comment -

    -

    Create a reaction to a commit comment. A response with a Status: 200 OK means that you already added the reaction type to this commit comment.

    -
    -
    post /repos/{owner}/{repo}/comments/{comment_id}/reactions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    ownerstringpath - - -
    repostringpath - - -
    comment_idintegerpath - - -
    contentstringbody -

    Required. The reaction type to add to the commit comment.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X POST \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/repos/octocat/hello-world/comments/42/reactions \
    -  -d '{"content":"content"}'
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('POST /repos/{owner}/{repo}/comments/{comment_id}/reactions', {
    -  owner: 'octocat',
    -  repo: 'hello-world',
    -  comment_id: 42,
    -  content: 'content',
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default response

    -
    Status: 201 Created
    -
    {
    -  "id": 1,
    -  "node_id": "MDg6UmVhY3Rpb24x",
    -  "user": {
    -    "login": "octocat",
    -    "id": 1,
    -    "node_id": "MDQ6VXNlcjE=",
    -    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -    "gravatar_id": "",
    -    "url": "https://api.github.com/users/octocat",
    -    "html_url": "https://github.com/octocat",
    -    "followers_url": "https://api.github.com/users/octocat/followers",
    -    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -    "organizations_url": "https://api.github.com/users/octocat/orgs",
    -    "repos_url": "https://api.github.com/users/octocat/repos",
    -    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -    "received_events_url": "https://api.github.com/users/octocat/received_events",
    -    "type": "User",
    -    "site_admin": false
    -  },
    -  "content": "heart",
    -  "created_at": "2016-05-20T20:09:31Z"
    -}
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - Delete a commit comment reaction -

    -

    Note: You can also specify a repository by repository_id using the route DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id.

    -

    Delete a reaction to a commit comment.

    -
    -
    delete /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    ownerstringpath - - -
    repostringpath - - -
    comment_idintegerpath - - -
    reaction_idintegerpath - - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X DELETE \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/repos/octocat/hello-world/comments/42/reactions/42
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}', {
    -  owner: 'octocat',
    -  repo: 'hello-world',
    -  comment_id: 42,
    -  reaction_id: 42,
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default Response

    -
    Status: 204 No Content
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - List reactions for an issue comment -

    -

    List the reactions to an issue comment.

    -
    -
    get /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    ownerstringpath - - -
    repostringpath - - -
    comment_idintegerpath - - -
    contentstringquery -

    Returns a single reaction type. Omit this parameter to list all reactions to an issue comment.

    - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/repos/octocat/hello-world/issues/comments/42/reactions
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions', {
    -  owner: 'octocat',
    -  repo: 'hello-world',
    -  comment_id: 42,
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    [
    -  {
    -    "id": 1,
    -    "node_id": "MDg6UmVhY3Rpb24x",
    -    "user": {
    -      "login": "octocat",
    -      "id": 1,
    -      "node_id": "MDQ6VXNlcjE=",
    -      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -      "gravatar_id": "",
    -      "url": "https://api.github.com/users/octocat",
    -      "html_url": "https://github.com/octocat",
    -      "followers_url": "https://api.github.com/users/octocat/followers",
    -      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -      "organizations_url": "https://api.github.com/users/octocat/orgs",
    -      "repos_url": "https://api.github.com/users/octocat/repos",
    -      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -      "received_events_url": "https://api.github.com/users/octocat/received_events",
    -      "type": "User",
    -      "site_admin": false
    -    },
    -    "content": "heart",
    -    "created_at": "2016-05-20T20:09:31Z"
    -  }
    -]
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - Create reaction for an issue comment -

    -

    Create a reaction to an issue comment. A response with a Status: 200 OK means that you already added the reaction type to this issue comment.

    -
    -
    post /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    ownerstringpath - - -
    repostringpath - - -
    comment_idintegerpath - - -
    contentstringbody -

    Required. The reaction type to add to the issue comment.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X POST \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/repos/octocat/hello-world/issues/comments/42/reactions \
    -  -d '{"content":"content"}'
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions', {
    -  owner: 'octocat',
    -  repo: 'hello-world',
    -  comment_id: 42,
    -  content: 'content',
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default response

    -
    Status: 201 Created
    -
    {
    -  "id": 1,
    -  "node_id": "MDg6UmVhY3Rpb24x",
    -  "user": {
    -    "login": "octocat",
    -    "id": 1,
    -    "node_id": "MDQ6VXNlcjE=",
    -    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -    "gravatar_id": "",
    -    "url": "https://api.github.com/users/octocat",
    -    "html_url": "https://github.com/octocat",
    -    "followers_url": "https://api.github.com/users/octocat/followers",
    -    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -    "organizations_url": "https://api.github.com/users/octocat/orgs",
    -    "repos_url": "https://api.github.com/users/octocat/repos",
    -    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -    "received_events_url": "https://api.github.com/users/octocat/received_events",
    -    "type": "User",
    -    "site_admin": false
    -  },
    -  "content": "heart",
    -  "created_at": "2016-05-20T20:09:31Z"
    -}
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - Delete an issue comment reaction -

    -

    Note: You can also specify a repository by repository_id using the route DELETE delete /repositories/:repository_id/issues/comments/:comment_id/reactions/:reaction_id.

    -

    Delete a reaction to an issue comment.

    -
    -
    delete /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    ownerstringpath - - -
    repostringpath - - -
    comment_idintegerpath - - -
    reaction_idintegerpath - - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X DELETE \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/repos/octocat/hello-world/issues/comments/42/reactions/42
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}', {
    -  owner: 'octocat',
    -  repo: 'hello-world',
    -  comment_id: 42,
    -  reaction_id: 42,
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default Response

    -
    Status: 204 No Content
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - List reactions for an issue -

    -

    List the reactions to an issue.

    -
    -
    get /repos/{owner}/{repo}/issues/{issue_number}/reactions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    ownerstringpath - - -
    repostringpath - - -
    issue_numberintegerpath - - -
    contentstringquery -

    Returns a single reaction type. Omit this parameter to list all reactions to an issue.

    - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/repos/octocat/hello-world/issues/42/reactions
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /repos/{owner}/{repo}/issues/{issue_number}/reactions', {
    -  owner: 'octocat',
    -  repo: 'hello-world',
    -  issue_number: 42,
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    [
    -  {
    -    "id": 1,
    -    "node_id": "MDg6UmVhY3Rpb24x",
    -    "user": {
    -      "login": "octocat",
    -      "id": 1,
    -      "node_id": "MDQ6VXNlcjE=",
    -      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -      "gravatar_id": "",
    -      "url": "https://api.github.com/users/octocat",
    -      "html_url": "https://github.com/octocat",
    -      "followers_url": "https://api.github.com/users/octocat/followers",
    -      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -      "organizations_url": "https://api.github.com/users/octocat/orgs",
    -      "repos_url": "https://api.github.com/users/octocat/repos",
    -      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -      "received_events_url": "https://api.github.com/users/octocat/received_events",
    -      "type": "User",
    -      "site_admin": false
    -    },
    -    "content": "heart",
    -    "created_at": "2016-05-20T20:09:31Z"
    -  }
    -]
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - Create reaction for an issue -

    -

    Create a reaction to an issue. A response with a Status: 200 OK means that you already added the reaction type to this issue.

    -
    -
    post /repos/{owner}/{repo}/issues/{issue_number}/reactions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    ownerstringpath - - -
    repostringpath - - -
    issue_numberintegerpath - - -
    contentstringbody -

    Required. The reaction type to add to the issue.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X POST \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/repos/octocat/hello-world/issues/42/reactions \
    -  -d '{"content":"content"}'
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('POST /repos/{owner}/{repo}/issues/{issue_number}/reactions', {
    -  owner: 'octocat',
    -  repo: 'hello-world',
    -  issue_number: 42,
    -  content: 'content',
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default response

    -
    Status: 201 Created
    -
    {
    -  "id": 1,
    -  "node_id": "MDg6UmVhY3Rpb24x",
    -  "user": {
    -    "login": "octocat",
    -    "id": 1,
    -    "node_id": "MDQ6VXNlcjE=",
    -    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -    "gravatar_id": "",
    -    "url": "https://api.github.com/users/octocat",
    -    "html_url": "https://github.com/octocat",
    -    "followers_url": "https://api.github.com/users/octocat/followers",
    -    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -    "organizations_url": "https://api.github.com/users/octocat/orgs",
    -    "repos_url": "https://api.github.com/users/octocat/repos",
    -    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -    "received_events_url": "https://api.github.com/users/octocat/received_events",
    -    "type": "User",
    -    "site_admin": false
    -  },
    -  "content": "heart",
    -  "created_at": "2016-05-20T20:09:31Z"
    -}
    -
    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - Delete an issue reaction -

    -

    Note: You can also specify a repository by repository_id using the route DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id.

    -

    Delete a reaction to an issue.

    -
    -
    delete /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    ownerstringpath - - -
    repostringpath - - -
    issue_numberintegerpath - - -
    reaction_idintegerpath - - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X DELETE \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/repos/octocat/hello-world/issues/42/reactions/42
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}', {
    -  owner: 'octocat',
    -  repo: 'hello-world',
    -  issue_number: 42,
    -  reaction_id: 42,
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default Response

    -
    Status: 204 No Content
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    - -
    get /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    ownerstringpath - - -
    repostringpath - - -
    comment_idintegerpath - - -
    contentstringquery -

    Returns a single reaction type. Omit this parameter to list all reactions to a pull request review comment.

    - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/repos/octocat/hello-world/pulls/comments/42/reactions
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions', {
    -  owner: 'octocat',
    -  repo: 'hello-world',
    -  comment_id: 42,
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    [
    -  {
    -    "id": 1,
    -    "node_id": "MDg6UmVhY3Rpb24x",
    -    "user": {
    -      "login": "octocat",
    -      "id": 1,
    -      "node_id": "MDQ6VXNlcjE=",
    -      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -      "gravatar_id": "",
    -      "url": "https://api.github.com/users/octocat",
    -      "html_url": "https://github.com/octocat",
    -      "followers_url": "https://api.github.com/users/octocat/followers",
    -      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -      "organizations_url": "https://api.github.com/users/octocat/orgs",
    -      "repos_url": "https://api.github.com/users/octocat/repos",
    -      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -      "received_events_url": "https://api.github.com/users/octocat/received_events",
    -      "type": "User",
    -      "site_admin": false
    -    },
    -    "content": "heart",
    -    "created_at": "2016-05-20T20:09:31Z"
    -  }
    -]
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - Create reaction for a pull request review comment -

    -

    Create a reaction to a pull request review comment. A response with a Status: 200 OK means that you already added the reaction type to this pull request review comment.

    -
    -
    post /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    ownerstringpath - - -
    repostringpath - - -
    comment_idintegerpath - - -
    contentstringbody -

    Required. The reaction type to add to the pull request review comment.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X POST \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/repos/octocat/hello-world/pulls/comments/42/reactions \
    -  -d '{"content":"content"}'
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions', {
    -  owner: 'octocat',
    -  repo: 'hello-world',
    -  comment_id: 42,
    -  content: 'content',
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default response

    -
    Status: 201 Created
    -
    {
    -  "id": 1,
    -  "node_id": "MDg6UmVhY3Rpb24x",
    -  "user": {
    -    "login": "octocat",
    -    "id": 1,
    -    "node_id": "MDQ6VXNlcjE=",
    -    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -    "gravatar_id": "",
    -    "url": "https://api.github.com/users/octocat",
    -    "html_url": "https://github.com/octocat",
    -    "followers_url": "https://api.github.com/users/octocat/followers",
    -    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -    "organizations_url": "https://api.github.com/users/octocat/orgs",
    -    "repos_url": "https://api.github.com/users/octocat/repos",
    -    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -    "received_events_url": "https://api.github.com/users/octocat/received_events",
    -    "type": "User",
    -    "site_admin": false
    -  },
    -  "content": "heart",
    -  "created_at": "2016-05-20T20:09:31Z"
    -}
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - Delete a pull request comment reaction -

    -

    Note: You can also specify a repository by repository_id using the route DELETE /repositories/:repository_id/pulls/comments/:comment_id/reactions/:reaction_id.

    -

    Delete a reaction to a pull request review comment.

    -
    -
    delete /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    ownerstringpath - - -
    repostringpath - - -
    comment_idintegerpath - - -
    reaction_idintegerpath - - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X DELETE \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/repos/octocat/hello-world/pulls/comments/42/reactions/42
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}', {
    -  owner: 'octocat',
    -  repo: 'hello-world',
    -  comment_id: 42,
    -  reaction_id: 42,
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default Response

    -
    Status: 204 No Content
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - List reactions for a team discussion comment (Legacy) -

    -

    Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new List reactions for a team discussion comment endpoint.

    -

    List the reactions to a team discussion comment. OAuth access tokens require the read:discussion scope.

    -
    -
    get /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    team_idintegerpath - - -
    discussion_numberintegerpath - - -
    comment_numberintegerpath - - -
    contentstringquery -

    Returns a single reaction type. Omit this parameter to list all reactions to a team discussion comment.

    - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/teams/42/discussions/42/comments/42/reactions
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions', {
    -  team_id: 42,
    -  discussion_number: 42,
    -  comment_number: 42,
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    [
    -  {
    -    "id": 1,
    -    "node_id": "MDg6UmVhY3Rpb24x",
    -    "user": {
    -      "login": "octocat",
    -      "id": 1,
    -      "node_id": "MDQ6VXNlcjE=",
    -      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -      "gravatar_id": "",
    -      "url": "https://api.github.com/users/octocat",
    -      "html_url": "https://github.com/octocat",
    -      "followers_url": "https://api.github.com/users/octocat/followers",
    -      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -      "organizations_url": "https://api.github.com/users/octocat/orgs",
    -      "repos_url": "https://api.github.com/users/octocat/repos",
    -      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -      "received_events_url": "https://api.github.com/users/octocat/received_events",
    -      "type": "User",
    -      "site_admin": false
    -    },
    -    "content": "heart",
    -    "created_at": "2016-05-20T20:09:31Z"
    -  }
    -]
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - Create reaction for a team discussion comment (Legacy) -

    -

    Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Create reaction for a team discussion comment endpoint.

    -

    Create a reaction to a team discussion comment. OAuth access tokens require the write:discussion scope. A response with a Status: 200 OK means that you already added the reaction type to this team discussion comment.

    -
    -
    post /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    team_idintegerpath - - -
    discussion_numberintegerpath - - -
    comment_numberintegerpath - - -
    contentstringbody -

    Required. The reaction type to add to the team discussion comment.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X POST \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/teams/42/discussions/42/comments/42/reactions \
    -  -d '{"content":"content"}'
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('POST /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions', {
    -  team_id: 42,
    -  discussion_number: 42,
    -  comment_number: 42,
    -  content: 'content',
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default response

    -
    Status: 201 Created
    -
    {
    -  "id": 1,
    -  "node_id": "MDg6UmVhY3Rpb24x",
    -  "user": {
    -    "login": "octocat",
    -    "id": 1,
    -    "node_id": "MDQ6VXNlcjE=",
    -    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -    "gravatar_id": "",
    -    "url": "https://api.github.com/users/octocat",
    -    "html_url": "https://github.com/octocat",
    -    "followers_url": "https://api.github.com/users/octocat/followers",
    -    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -    "organizations_url": "https://api.github.com/users/octocat/orgs",
    -    "repos_url": "https://api.github.com/users/octocat/repos",
    -    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -    "received_events_url": "https://api.github.com/users/octocat/received_events",
    -    "type": "User",
    -    "site_admin": false
    -  },
    -  "content": "heart",
    -  "created_at": "2016-05-20T20:09:31Z"
    -}
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - List reactions for a team discussion (Legacy) -

    -

    Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new List reactions for a team discussion endpoint.

    -

    List the reactions to a team discussion. OAuth access tokens require the read:discussion scope.

    -
    -
    get /teams/{team_id}/discussions/{discussion_number}/reactions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    team_idintegerpath - - -
    discussion_numberintegerpath - - -
    contentstringquery -

    Returns a single reaction type. Omit this parameter to list all reactions to a team discussion.

    - -
    per_pageintegerquery -

    Results per page (max 100)

    - -
    pageintegerquery -

    Page number of the results to fetch.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/teams/42/discussions/42/reactions
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('GET /teams/{team_id}/discussions/{discussion_number}/reactions', {
    -  team_id: 42,
    -  discussion_number: 42,
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default response

    -
    Status: 200 OK
    -
    [
    -  {
    -    "id": 1,
    -    "node_id": "MDg6UmVhY3Rpb24x",
    -    "user": {
    -      "login": "octocat",
    -      "id": 1,
    -      "node_id": "MDQ6VXNlcjE=",
    -      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -      "gravatar_id": "",
    -      "url": "https://api.github.com/users/octocat",
    -      "html_url": "https://github.com/octocat",
    -      "followers_url": "https://api.github.com/users/octocat/followers",
    -      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -      "organizations_url": "https://api.github.com/users/octocat/orgs",
    -      "repos_url": "https://api.github.com/users/octocat/repos",
    -      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -      "received_events_url": "https://api.github.com/users/octocat/received_events",
    -      "type": "User",
    -      "site_admin": false
    -    },
    -    "content": "heart",
    -    "created_at": "2016-05-20T20:09:31Z"
    -  }
    -]
    -
    - - -

    Notes

    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -

    - Create reaction for a team discussion (Legacy) -

    -

    Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Create reaction for a team discussion endpoint.

    -

    Create a reaction to a team discussion. OAuth access tokens require the write:discussion scope. A response with a Status: 200 OK means that you already added the reaction type to this team discussion.

    -
    -
    post /teams/{team_id}/discussions/{discussion_number}/reactions
    -
    - -

    - Parameters -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeInDescription
    acceptstringheader -

    This API is under preview and subject to change.

    - - - - See preview notice. - - -
    team_idintegerpath - - -
    discussion_numberintegerpath - - -
    contentstringbody -

    Required. The reaction type to add to the team discussion.

    - -
    - - -

    - Code samples -

    - - -
    - - Shell - -
    -
    curl \
    -  -X POST \
    -  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
    -  https://api.github.com/teams/42/discussions/42/reactions \
    -  -d '{"content":"content"}'
    -
    - - - -
    - - JavaScript (@octokit/core.js) - -
    -
    await octokit.request('POST /teams/{team_id}/discussions/{discussion_number}/reactions', {
    -  team_id: 42,
    -  discussion_number: 42,
    -  content: 'content',
    -  mediaType: {
    -    previews: [
    -      'squirrel-girl'
    -    ]
    -  }
    -})
    -
    - - - - -

    Default response

    -
    Status: 201 Created
    -
    {
    -  "id": 1,
    -  "node_id": "MDg6UmVhY3Rpb24x",
    -  "user": {
    -    "login": "octocat",
    -    "id": 1,
    -    "node_id": "MDQ6VXNlcjE=",
    -    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    -    "gravatar_id": "",
    -    "url": "https://api.github.com/users/octocat",
    -    "html_url": "https://github.com/octocat",
    -    "followers_url": "https://api.github.com/users/octocat/followers",
    -    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    -    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    -    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    -    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    -    "organizations_url": "https://api.github.com/users/octocat/orgs",
    -    "repos_url": "https://api.github.com/users/octocat/repos",
    -    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    -    "received_events_url": "https://api.github.com/users/octocat/received_events",
    -    "type": "User",
    -    "site_admin": false
    -  },
    -  "content": "heart",
    -  "created_at": "2016-05-20T20:09:31Z"
    -}
    -
    - - - -

    - - Preview notice - -

    - -
    -

    An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

    -

    To access the API you must provide a custom media type in the Accept header:

    -
    application/vnd.github.squirrel-girl-preview
    -
    -

    The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

    -
    {
    -  "total_count": 5,
    -  "+1": 3,
    -  "-1": 1,
    -  "laugh": 0,
    -  "confused": 0,
    -  "heart": 1,
    -  "hooray": 0,
    -  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
    -}
    -
    - ☝️ This header is required. -
    - - -
    -
    -
    -
    -
    -
    -
    - -
    -

    - Did this doc help you? -

    -

    - - - - -

    - - - - - -

    - - -

    - - -
    - -
    -
    - - - -
    -
    -
    -
    -

    Ask a human

    -

    Can't find what you're looking for?

    - Contact us -
    -
    - -
    -
    -
    -
    - - - - - -
    - - From f643c0f3fab9235ece313e9b935ae9136d2bb5ab Mon Sep 17 00:00:00 2001 From: Hasnae Rehioui Date: Sat, 4 Nov 2023 02:07:43 +1100 Subject: [PATCH 345/751] Fix branch protection request fields (#2977) Fixes: #2976. --- github/repos.go | 2 +- github/repos_test.go | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/github/repos.go b/github/repos.go index e158562e69d..b16cd3b8159 100644 --- a/github/repos.go +++ b/github/repos.go @@ -1097,7 +1097,7 @@ type RequiredStatusChecks struct { Contexts []string `json:"contexts,omitempty"` // The list of status checks to require in order to merge into this // branch. - Checks []*RequiredStatusCheck `json:"checks"` + Checks []*RequiredStatusCheck `json:"checks,omitempty"` ContextsURL *string `json:"contexts_url,omitempty"` URL *string `json:"url,omitempty"` } diff --git a/github/repos_test.go b/github/repos_test.go index 7486e488fe6..2bdc1b4289d 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -1766,7 +1766,6 @@ func TestRepositoriesService_UpdateBranchProtection_StrictNoChecks(t *testing.T) input := &ProtectionRequest{ RequiredStatusChecks: &RequiredStatusChecks{ Strict: true, - Checks: []*RequiredStatusCheck{}, }, RequiredPullRequestReviews: &PullRequestReviewsEnforcementRequest{ DismissStaleReviews: true, @@ -1802,8 +1801,7 @@ func TestRepositoriesService_UpdateBranchProtection_StrictNoChecks(t *testing.T) fmt.Fprintf(w, `{ "required_status_checks":{ "strict":true, - "contexts":[], - "checks": [] + "contexts":[] }, "required_pull_request_reviews":{ "dismissal_restrictions":{ @@ -1847,7 +1845,6 @@ func TestRepositoriesService_UpdateBranchProtection_StrictNoChecks(t *testing.T) RequiredStatusChecks: &RequiredStatusChecks{ Strict: true, Contexts: []string{}, - Checks: []*RequiredStatusCheck{}, }, RequiredPullRequestReviews: &PullRequestReviewsEnforcement{ DismissStaleReviews: true, From a5b1cea2fe8d05dc2a9e0190abd6f17d519b2696 Mon Sep 17 00:00:00 2001 From: Mark Collao <106274486+mcollao-hc@users.noreply.github.com> Date: Fri, 3 Nov 2023 15:54:59 -0500 Subject: [PATCH 346/751] Add dependabot alert update endpoint (#2981) Fixes: #2922. --- github/dependabot_alerts.go | 32 ++++++++++++++++++++++ github/dependabot_alerts_test.go | 46 ++++++++++++++++++++++++++++++++ github/github-accessors.go | 16 +++++++++++ github/github-accessors_test.go | 20 ++++++++++++++ 4 files changed, 114 insertions(+) diff --git a/github/dependabot_alerts.go b/github/dependabot_alerts.go index 94be610c53d..f1ed126c217 100644 --- a/github/dependabot_alerts.go +++ b/github/dependabot_alerts.go @@ -67,6 +67,17 @@ type DependabotAlert struct { Repository *Repository `json:"repository,omitempty"` } +// DependabotAlertState represents the state of a Dependabot alert to update. +type DependabotAlertState struct { + // The state of the Dependabot alert. A dismissed_reason must be provided when setting the state to dismissed. + State string `json:"state"` + // Required when state is dismissed. A reason for dismissing the alert. + // Can be one of: fix_started, inaccurate, no_bandwidth, not_used, tolerable_risk + DismissedReason *string `json:"dismissed_reason,omitempty"` + // An optional comment associated with dismissing the alert. + DismissedComment *string `json:"dismissed_comment,omitempty"` +} + // ListAlertsOptions specifies the optional parameters to the DependabotService.ListRepoAlerts // and DependabotService.ListOrgAlerts methods. type ListAlertsOptions struct { @@ -142,3 +153,24 @@ func (s *DependabotService) GetRepoAlert(ctx context.Context, owner, repo string return alert, resp, nil } + +// UpdateAlert updates a Dependabot alert. +// +// GitHub API docs: https://docs.github.com/rest/dependabot/alerts#update-a-dependabot-alert +// +//meta:operation PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number} +func (s *DependabotService) UpdateAlert(ctx context.Context, owner, repo string, number int, stateInfo *DependabotAlertState) (*DependabotAlert, *Response, error) { + url := fmt.Sprintf("repos/%v/%v/dependabot/alerts/%v", owner, repo, number) + req, err := s.client.NewRequest("PATCH", url, stateInfo) + if err != nil { + return nil, nil, err + } + + alert := new(DependabotAlert) + resp, err := s.client.Do(ctx, req, alert) + if err != nil { + return nil, resp, err + } + + return alert, resp, nil +} diff --git a/github/dependabot_alerts_test.go b/github/dependabot_alerts_test.go index a7c3b14788b..45fd11ee41c 100644 --- a/github/dependabot_alerts_test.go +++ b/github/dependabot_alerts_test.go @@ -131,3 +131,49 @@ func TestDependabotService_ListOrgAlerts(t *testing.T) { return resp, err }) } + +func TestDependabotService_UpdateAlert(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + state := String("dismissed") + dismissedReason := String("no_bandwidth") + dismissedComment := String("no time to fix this") + + alertState := &DependabotAlertState{State: *state, DismissedReason: dismissedReason, DismissedComment: dismissedComment} + + mux.HandleFunc("/repos/o/r/dependabot/alerts/42", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PATCH") + fmt.Fprint(w, `{"number":42,"state":"dismissed","dismissed_reason":"no_bandwidth","dismissed_comment":"no time to fix this"}`) + }) + + ctx := context.Background() + alert, _, err := client.Dependabot.UpdateAlert(ctx, "o", "r", 42, alertState) + if err != nil { + t.Errorf("Dependabot.UpdateAlert returned error: %v", err) + } + + want := &DependabotAlert{ + Number: Int(42), + State: String("dismissed"), + DismissedReason: String("no_bandwidth"), + DismissedComment: String("no time to fix this"), + } + if !cmp.Equal(alert, want) { + t.Errorf("Dependabot.UpdateAlert returned %+v, want %+v", alert, want) + } + + const methodName = "UpdateAlert" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Dependabot.UpdateAlert(ctx, "\n", "\n", 0, alertState) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Dependabot.UpdateAlert(ctx, "o", "r", 42, alertState) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} diff --git a/github/github-accessors.go b/github/github-accessors.go index fc79d01d7c8..a489d66cd43 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -5302,6 +5302,22 @@ func (d *DependabotAlertEvent) GetSender() *User { return d.Sender } +// GetDismissedComment returns the DismissedComment field if it's non-nil, zero value otherwise. +func (d *DependabotAlertState) GetDismissedComment() string { + if d == nil || d.DismissedComment == nil { + return "" + } + return *d.DismissedComment +} + +// GetDismissedReason returns the DismissedReason field if it's non-nil, zero value otherwise. +func (d *DependabotAlertState) GetDismissedReason() string { + if d == nil || d.DismissedReason == nil { + return "" + } + return *d.DismissedReason +} + // GetCVEID returns the CVEID field if it's non-nil, zero value otherwise. func (d *DependabotSecurityAdvisory) GetCVEID() string { if d == nil || d.CVEID == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index ff4a49d7fb7..2c26fb6ba79 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -6244,6 +6244,26 @@ func TestDependabotAlertEvent_GetSender(tt *testing.T) { d.GetSender() } +func TestDependabotAlertState_GetDismissedComment(tt *testing.T) { + var zeroValue string + d := &DependabotAlertState{DismissedComment: &zeroValue} + d.GetDismissedComment() + d = &DependabotAlertState{} + d.GetDismissedComment() + d = nil + d.GetDismissedComment() +} + +func TestDependabotAlertState_GetDismissedReason(tt *testing.T) { + var zeroValue string + d := &DependabotAlertState{DismissedReason: &zeroValue} + d.GetDismissedReason() + d = &DependabotAlertState{} + d.GetDismissedReason() + d = nil + d.GetDismissedReason() +} + func TestDependabotSecurityAdvisory_GetCVEID(tt *testing.T) { var zeroValue string d := &DependabotSecurityAdvisory{CVEID: &zeroValue} From 887612f2a3ba6de69891efc7c08bd89d453670fd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 15:37:33 -0500 Subject: [PATCH 347/751] Bump golang.org/x/sync from 0.4.0 to 0.5.0 in /tools (#2990) --- tools/go.mod | 2 +- tools/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index 8085d1a1ce9..40c58020a6c 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -7,7 +7,7 @@ require ( github.com/getkin/kin-openapi v0.120.0 github.com/google/go-cmp v0.6.0 github.com/google/go-github/v56 v56.0.0 - golang.org/x/sync v0.4.0 + golang.org/x/sync v0.5.0 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/tools/go.sum b/tools/go.sum index 46bc40af389..7e8be0f06e5 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -49,8 +49,8 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= -golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= -golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= +golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= From 630bfdb865475b476c8abcb2c2ba0ea53736997b Mon Sep 17 00:00:00 2001 From: WillAbides <233500+WillAbides@users.noreply.github.com> Date: Tue, 7 Nov 2023 08:32:04 -0600 Subject: [PATCH 348/751] Deprecate RepositoriesService.List (#2988) --- github/examples_test.go | 6 +- github/repos.go | 148 ++++++++++++++++++++++++++------- github/repos_test.go | 66 +++++++-------- test/integration/repos_test.go | 20 +++-- 4 files changed, 166 insertions(+), 74 deletions(-) diff --git a/github/examples_test.go b/github/examples_test.go index ab319151786..9338e0b6170 100644 --- a/github/examples_test.go +++ b/github/examples_test.go @@ -49,14 +49,14 @@ func ExampleRepositoriesService_GetReadme() { fmt.Printf("google/go-github README:\n%v\n", content) } -func ExampleRepositoriesService_List() { +func ExampleRepositoriesService_ListByUser() { client := github.NewClient(nil) user := "willnorris" - opt := &github.RepositoryListOptions{Type: "owner", Sort: "updated", Direction: "desc"} + opt := &github.RepositoryListByUserOptions{Type: "owner", Sort: "updated", Direction: "desc"} ctx := context.Background() - repos, _, err := client.Repositories.List(ctx, user, opt) + repos, _, err := client.Repositories.ListByUser(ctx, user, opt) if err != nil { fmt.Println(err) } diff --git a/github/repos.go b/github/repos.go index b16cd3b8159..5fcf219b3cf 100644 --- a/github/repos.go +++ b/github/repos.go @@ -173,33 +173,19 @@ type BranchListOptions struct { // RepositoryListOptions specifies the optional parameters to the // RepositoriesService.List method. type RepositoryListOptions struct { - // Visibility of repositories to list. Can be one of all, public, or private. - // Default: all + // See RepositoryListByAuthenticatedUserOptions.Visibility Visibility string `url:"visibility,omitempty"` - // List repos of given affiliation[s]. - // Comma-separated list of values. Can include: - // * owner: Repositories that are owned by the authenticated user. - // * collaborator: Repositories that the user has been added to as a - // collaborator. - // * organization_member: Repositories that the user has access to through - // being a member of an organization. This includes every repository on - // every team that the user is on. - // Default: owner,collaborator,organization_member + // See RepositoryListByAuthenticatedUserOptions.Affiliation Affiliation string `url:"affiliation,omitempty"` - // Type of repositories to list. - // Can be one of all, owner, public, private, member. Default: all - // Will cause a 422 error if used in the same request as visibility or - // affiliation. + // See RepositoryListByUserOptions.Type or RepositoryListByAuthenticatedUserOptions.Type Type string `url:"type,omitempty"` - // How to sort the repository list. Can be one of created, updated, pushed, - // full_name. Default: full_name + // See RepositoryListByUserOptions.Sort or RepositoryListByAuthenticatedUserOptions.Sort Sort string `url:"sort,omitempty"` - // Direction in which to sort repositories. Can be one of asc or desc. - // Default: when using full_name: asc; otherwise desc + // See RepositoryListByUserOptions.Direction or RepositoryListByAuthenticatedUserOptions.Direction Direction string `url:"direction,omitempty"` ListOptions @@ -262,8 +248,10 @@ func (d DependabotSecurityUpdates) String() string { return Stringify(d) } -// List the repositories for a user. Passing the empty string will list -// repositories for the authenticated user. +// List calls either RepositoriesService.ListByUser or RepositoriesService.ListByAuthenticatedUser +// depending on whether user is empty. +// +// Deprecated: Use RepositoriesService.ListByUser or RepositoriesService.ListByAuthenticatedUser instead. // // GitHub API docs: https://docs.github.com/rest/repos/repos#list-repositories-for-a-user // GitHub API docs: https://docs.github.com/rest/repos/repos#list-repositories-for-the-authenticated-user @@ -271,12 +259,55 @@ func (d DependabotSecurityUpdates) String() string { //meta:operation GET /user/repos //meta:operation GET /users/{username}/repos func (s *RepositoriesService) List(ctx context.Context, user string, opts *RepositoryListOptions) ([]*Repository, *Response, error) { - var u string - if user != "" { - u = fmt.Sprintf("users/%v/repos", user) - } else { - u = "user/repos" + if opts == nil { + opts = &RepositoryListOptions{} } + if user != "" { + return s.ListByUser(ctx, user, &RepositoryListByUserOptions{ + Type: opts.Type, + Sort: opts.Sort, + Direction: opts.Direction, + ListOptions: opts.ListOptions, + }) + } + return s.ListByAuthenticatedUser(ctx, &RepositoryListByAuthenticatedUserOptions{ + Visibility: opts.Visibility, + Affiliation: opts.Affiliation, + Type: opts.Type, + Sort: opts.Sort, + Direction: opts.Direction, + ListOptions: opts.ListOptions, + }) +} + +// RepositoryListByUserOptions specifies the optional parameters to the +// RepositoriesService.ListByUser method. +type RepositoryListByUserOptions struct { + // Limit results to repositories of the specified type. + // Default: owner + // Can be one of: all, owner, member + Type string `url:"type,omitempty"` + + // The property to sort the results by. + // Default: full_name + // Can be one of: created, updated, pushed, full_name + Sort string `url:"sort,omitempty"` + + // The order to sort by. + // Default: asc when using full_name, otherwise desc. + // Can be one of: asc, desc + Direction string `url:"direction,omitempty"` + + ListOptions +} + +// ListByUser lists public repositories for the specified user. +// +// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repositories-for-a-user +// +//meta:operation GET /users/{username}/repos +func (s *RepositoriesService) ListByUser(ctx context.Context, user string, opts *RepositoryListByUserOptions) ([]*Repository, *Response, error) { + u := fmt.Sprintf("users/%v/repos", user) u, err := addOptions(u, opts) if err != nil { return nil, nil, err @@ -287,9 +318,68 @@ func (s *RepositoriesService) List(ctx context.Context, user string, opts *Repos return nil, nil, err } - // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{mediaTypeTopicsPreview, mediaTypeRepositoryVisibilityPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + var repos []*Repository + resp, err := s.client.Do(ctx, req, &repos) + if err != nil { + return nil, resp, err + } + + return repos, resp, nil +} + +// RepositoryListByAuthenticatedUserOptions specifies the optional parameters to the +// RepositoriesService.ListByAuthenticatedUser method. +type RepositoryListByAuthenticatedUserOptions struct { + // Limit results to repositories with the specified visibility. + // Default: all + // Can be one of: all, public, private + Visibility string `url:"visibility,omitempty"` + + // List repos of given affiliation[s]. + // Comma-separated list of values. Can include: + // * owner: Repositories that are owned by the authenticated user. + // * collaborator: Repositories that the user has been added to as a + // collaborator. + // * organization_member: Repositories that the user has access to through + // being a member of an organization. This includes every repository on + // every team that the user is on. + // Default: owner,collaborator,organization_member + Affiliation string `url:"affiliation,omitempty"` + + // Limit results to repositories of the specified type. Will cause a 422 error if + // used in the same request as visibility or affiliation. + // Default: all + // Can be one of: all, owner, public, private, member + Type string `url:"type,omitempty"` + + // The property to sort the results by. + // Default: full_name + // Can be one of: created, updated, pushed, full_name + Sort string `url:"sort,omitempty"` + + // Direction in which to sort repositories. Can be one of asc or desc. + // Default: when using full_name: asc; otherwise desc + Direction string `url:"direction,omitempty"` + + ListOptions +} + +// ListByAuthenticatedUser lists repositories for the authenticated user. +// +// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repositories-for-the-authenticated-user +// +//meta:operation GET /user/repos +func (s *RepositoriesService) ListByAuthenticatedUser(ctx context.Context, opts *RepositoryListByAuthenticatedUserOptions) ([]*Repository, *Response, error) { + u := "user/repos" + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } var repos []*Repository resp, err := s.client.Do(ctx, req, &repos) diff --git a/github/repos_test.go b/github/repos_test.go index 2bdc1b4289d..fa49ddd4f5c 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -18,36 +18,30 @@ import ( "github.com/google/go-cmp/cmp" ) -func TestRepositoriesService_List_authenticatedUser(t *testing.T) { +func TestRepositoriesService_ListByAuthenticatedUser(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - wantAcceptHeaders := []string{mediaTypeTopicsPreview, mediaTypeRepositoryVisibilityPreview} mux.HandleFunc("/user/repos", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) fmt.Fprint(w, `[{"id":1},{"id":2}]`) }) ctx := context.Background() - got, _, err := client.Repositories.List(ctx, "", nil) + got, _, err := client.Repositories.ListByAuthenticatedUser(ctx, nil) if err != nil { t.Errorf("Repositories.List returned error: %v", err) } want := []*Repository{{ID: Int64(1)}, {ID: Int64(2)}} if !cmp.Equal(got, want) { - t.Errorf("Repositories.List returned %+v, want %+v", got, want) + t.Errorf("Repositories.ListByAuthenticatedUser returned %+v, want %+v", got, want) } - const methodName = "List" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.List(ctx, "\n", &RepositoryListOptions{}) - return err - }) + const methodName = "ListByAuthenticatedUser" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.List(ctx, "", nil) + got, resp, err := client.Repositories.ListByAuthenticatedUser(ctx, nil) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -55,78 +49,84 @@ func TestRepositoriesService_List_authenticatedUser(t *testing.T) { }) } -func TestRepositoriesService_List_specifiedUser(t *testing.T) { +func TestRepositoriesService_ListByUser(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - wantAcceptHeaders := []string{mediaTypeTopicsPreview, mediaTypeRepositoryVisibilityPreview} mux.HandleFunc("/users/u/repos", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) testFormValues(t, r, values{ - "visibility": "public", - "affiliation": "owner,collaborator", - "sort": "created", - "direction": "asc", - "page": "2", + "sort": "created", + "direction": "asc", + "page": "2", }) fmt.Fprint(w, `[{"id":1}]`) }) - opt := &RepositoryListOptions{ - Visibility: "public", - Affiliation: "owner,collaborator", + opt := &RepositoryListByUserOptions{ Sort: "created", Direction: "asc", ListOptions: ListOptions{Page: 2}, } ctx := context.Background() - repos, _, err := client.Repositories.List(ctx, "u", opt) + repos, _, err := client.Repositories.ListByUser(ctx, "u", opt) if err != nil { t.Errorf("Repositories.List returned error: %v", err) } want := []*Repository{{ID: Int64(1)}} if !cmp.Equal(repos, want) { - t.Errorf("Repositories.List returned %+v, want %+v", repos, want) + t.Errorf("Repositories.ListByUser returned %+v, want %+v", repos, want) } + + const methodName = "ListByUser" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.ListByUser(ctx, "\n", &RepositoryListByUserOptions{}) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.ListByUser(ctx, "u", nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) } -func TestRepositoriesService_List_specifiedUser_type(t *testing.T) { +func TestRepositoriesService_ListByUser_type(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - wantAcceptHeaders := []string{mediaTypeTopicsPreview, mediaTypeRepositoryVisibilityPreview} mux.HandleFunc("/users/u/repos", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) testFormValues(t, r, values{ "type": "owner", }) fmt.Fprint(w, `[{"id":1}]`) }) - opt := &RepositoryListOptions{ + opt := &RepositoryListByUserOptions{ Type: "owner", } ctx := context.Background() - repos, _, err := client.Repositories.List(ctx, "u", opt) + repos, _, err := client.Repositories.ListByUser(ctx, "u", opt) if err != nil { - t.Errorf("Repositories.List returned error: %v", err) + t.Errorf("Repositories.ListByUser returned error: %v", err) } want := []*Repository{{ID: Int64(1)}} if !cmp.Equal(repos, want) { - t.Errorf("Repositories.List returned %+v, want %+v", repos, want) + t.Errorf("Repositories.ListByUser returned %+v, want %+v", repos, want) } } -func TestRepositoriesService_List_invalidUser(t *testing.T) { +func TestRepositoriesService_ListByUser_invalidUser(t *testing.T) { client, _, _, teardown := setup() defer teardown() ctx := context.Background() - _, _, err := client.Repositories.List(ctx, "%", nil) + _, _, err := client.Repositories.ListByUser(ctx, "%", nil) testURLParseError(t, err) } diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index b0fa75cb8fc..39a99fef98f 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -157,29 +157,31 @@ func TestRepositories_EditBranches(t *testing.T) { } } -func TestRepositories_List(t *testing.T) { - if !checkAuth("TestRepositories_List") { +func TestRepositories_ListByAuthenticatedUser(t *testing.T) { + if !checkAuth("TestRepositories_ListByAuthenticatedUser") { return } - _, _, err := client.Repositories.List(context.Background(), "", nil) + _, _, err := client.Repositories.ListByAuthenticatedUser(context.Background(), nil) if err != nil { - t.Fatalf("Repositories.List('') returned error: %v", err) + t.Fatalf("Repositories.ListByAuthenticatedUser() returned error: %v", err) } +} - _, _, err = client.Repositories.List(context.Background(), "google", nil) +func TestRepositories_ListByUser(t *testing.T) { + _, _, err := client.Repositories.ListByUser(context.Background(), "google", nil) if err != nil { - t.Fatalf("Repositories.List('google') returned error: %v", err) + t.Fatalf("Repositories.ListByUser('google') returned error: %v", err) } - opt := github.RepositoryListOptions{Sort: "created"} - repos, _, err := client.Repositories.List(context.Background(), "google", &opt) + opt := github.RepositoryListByUserOptions{Sort: "created"} + repos, _, err := client.Repositories.ListByUser(context.Background(), "google", &opt) if err != nil { t.Fatalf("Repositories.List('google') with Sort opt returned error: %v", err) } for i, repo := range repos { if i > 0 && (*repos[i-1].CreatedAt).Time.Before((*repo.CreatedAt).Time) { - t.Fatalf("Repositories.List('google') with default descending Sort returned incorrect order") + t.Fatalf("Repositories.ListByUser('google') with default descending Sort returned incorrect order") } } } From 14dccc27fc2b03095c8e766bf364ec12c45a19a8 Mon Sep 17 00:00:00 2001 From: Claystation Date: Wed, 8 Nov 2023 17:37:41 +0100 Subject: [PATCH 349/751] Add support for Required Workflows (#2979) Fixes: #2978. --- github/github-accessors.go | 24 ++++++++++++++++++++++ github/github-accessors_test.go | 30 ++++++++++++++++++++++++++++ github/repos_rules.go | 35 +++++++++++++++++++++++++++++++++ github/repos_rules_test.go | 11 +++++++++++ 4 files changed, 100 insertions(+) diff --git a/github/github-accessors.go b/github/github-accessors.go index a489d66cd43..bcae7636d0a 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -20358,6 +20358,30 @@ func (r *RuleRequiredStatusChecks) GetIntegrationID() int64 { return *r.IntegrationID } +// GetRef returns the Ref field if it's non-nil, zero value otherwise. +func (r *RuleRequiredWorkflow) GetRef() string { + if r == nil || r.Ref == nil { + return "" + } + return *r.Ref +} + +// GetRepositoryID returns the RepositoryID field if it's non-nil, zero value otherwise. +func (r *RuleRequiredWorkflow) GetRepositoryID() int64 { + if r == nil || r.RepositoryID == nil { + return 0 + } + return *r.RepositoryID +} + +// GetSha returns the Sha field if it's non-nil, zero value otherwise. +func (r *RuleRequiredWorkflow) GetSha() string { + if r == nil || r.Sha == nil { + return "" + } + return *r.Sha +} + // GetConditions returns the Conditions field. func (r *Ruleset) GetConditions() *RulesetConditions { if r == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 2c26fb6ba79..36feed7fe8e 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -23678,6 +23678,36 @@ func TestRuleRequiredStatusChecks_GetIntegrationID(tt *testing.T) { r.GetIntegrationID() } +func TestRuleRequiredWorkflow_GetRef(tt *testing.T) { + var zeroValue string + r := &RuleRequiredWorkflow{Ref: &zeroValue} + r.GetRef() + r = &RuleRequiredWorkflow{} + r.GetRef() + r = nil + r.GetRef() +} + +func TestRuleRequiredWorkflow_GetRepositoryID(tt *testing.T) { + var zeroValue int64 + r := &RuleRequiredWorkflow{RepositoryID: &zeroValue} + r.GetRepositoryID() + r = &RuleRequiredWorkflow{} + r.GetRepositoryID() + r = nil + r.GetRepositoryID() +} + +func TestRuleRequiredWorkflow_GetSha(tt *testing.T) { + var zeroValue string + r := &RuleRequiredWorkflow{Sha: &zeroValue} + r.GetSha() + r = &RuleRequiredWorkflow{} + r.GetSha() + r = nil + r.GetSha() +} + func TestRuleset_GetConditions(tt *testing.T) { r := &Ruleset{} r.GetConditions() diff --git a/github/repos_rules.go b/github/repos_rules.go index b47b37038ed..479806c2ee9 100644 --- a/github/repos_rules.go +++ b/github/repos_rules.go @@ -97,6 +97,19 @@ type RequiredStatusChecksRuleParameters struct { StrictRequiredStatusChecksPolicy bool `json:"strict_required_status_checks_policy"` } +// RuleRequiredWorkflow represents the Workflow for the RequireWorkflowsRuleParameters object. +type RuleRequiredWorkflow struct { + Path string `json:"path"` + Ref *string `json:"ref,omitempty"` + RepositoryID *int64 `json:"repository_id,omitempty"` + Sha *string `json:"sha,omitempty"` +} + +// RequiredWorkflowsRuleParameters represents the workflows rule parameters. +type RequiredWorkflowsRuleParameters struct { + RequiredWorkflows []*RuleRequiredWorkflow `json:"workflows"` +} + // RepositoryRule represents a GitHub Rule. type RepositoryRule struct { Type string `json:"type"` @@ -171,6 +184,16 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { bytes, _ := json.Marshal(params) rawParams := json.RawMessage(bytes) + r.Parameters = &rawParams + case "workflows": + params := RequiredWorkflowsRuleParameters{} + if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { + return err + } + + bytes, _ := json.Marshal(params) + rawParams := json.RawMessage(bytes) + r.Parameters = &rawParams default: r.Type = "" @@ -329,6 +352,18 @@ func NewTagNamePatternRule(params *RulePatternParameters) (rule *RepositoryRule) } } +// NewRequiredWorkflowsRule creates a rule to require which status checks must pass before branches can be merged into a branch rule. +func NewRequiredWorkflowsRule(params *RequiredWorkflowsRuleParameters) (rule *RepositoryRule) { + bytes, _ := json.Marshal(params) + + rawParams := json.RawMessage(bytes) + + return &RepositoryRule{ + Type: "workflows", + Parameters: &rawParams, + } +} + // Ruleset represents a GitHub ruleset object. type Ruleset struct { ID *int64 `json:"id,omitempty"` diff --git a/github/repos_rules_test.go b/github/repos_rules_test.go index a57137c688d..cd8e49c2e07 100644 --- a/github/repos_rules_test.go +++ b/github/repos_rules_test.go @@ -215,6 +215,17 @@ func TestRepositoryRule_UnmarshalJSON(t *testing.T) { }, wantErr: true, }, + "Required workflows params": { + data: `{"type":"workflows","parameters":{"workflows":[{"path": ".github/workflows/test.yml", "repository_id": 1}]}}`, + want: NewRequiredWorkflowsRule(&RequiredWorkflowsRuleParameters{ + RequiredWorkflows: []*RuleRequiredWorkflow{ + { + Path: ".github/workflows/test.yml", + RepositoryID: Int64(1), + }, + }, + }), + }, "Invalid type": { data: `{"type":"unknown"}`, want: &RepositoryRule{ From 3b96fb363f3e1c607f87f1a9e4051f2c4431055d Mon Sep 17 00:00:00 2001 From: Daniel Liao <10663736+liaodaniel@users.noreply.github.com> Date: Fri, 10 Nov 2023 14:36:15 +1100 Subject: [PATCH 350/751] Implement Custom Properties (#2986) Fixes: #2965. --- github/github-accessors.go | 40 ++++ github/github-accessors_test.go | 50 +++++ github/orgs_properties.go | 198 +++++++++++++++++ github/orgs_properties_test.go | 369 ++++++++++++++++++++++++++++++++ 4 files changed, 657 insertions(+) create mode 100644 github/orgs_properties.go create mode 100644 github/orgs_properties_test.go diff --git a/github/github-accessors.go b/github/github-accessors.go index bcae7636d0a..536ce5a8407 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -4990,6 +4990,46 @@ func (c *CredentialAuthorization) GetTokenLastEight() string { return *c.TokenLastEight } +// GetDefaultValue returns the DefaultValue field if it's non-nil, zero value otherwise. +func (c *CustomProperty) GetDefaultValue() string { + if c == nil || c.DefaultValue == nil { + return "" + } + return *c.DefaultValue +} + +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (c *CustomProperty) GetDescription() string { + if c == nil || c.Description == nil { + return "" + } + return *c.Description +} + +// GetPropertyName returns the PropertyName field if it's non-nil, zero value otherwise. +func (c *CustomProperty) GetPropertyName() string { + if c == nil || c.PropertyName == nil { + return "" + } + return *c.PropertyName +} + +// GetRequired returns the Required field if it's non-nil, zero value otherwise. +func (c *CustomProperty) GetRequired() bool { + if c == nil || c.Required == nil { + return false + } + return *c.Required +} + +// GetValue returns the Value field if it's non-nil, zero value otherwise. +func (c *CustomPropertyValue) GetValue() string { + if c == nil || c.Value == nil { + return "" + } + return *c.Value +} + // GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise. func (c *CustomRepoRoles) GetBaseRole() string { if c == nil || c.BaseRole == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 36feed7fe8e..abe96ecf98f 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -5899,6 +5899,56 @@ func TestCredentialAuthorization_GetTokenLastEight(tt *testing.T) { c.GetTokenLastEight() } +func TestCustomProperty_GetDefaultValue(tt *testing.T) { + var zeroValue string + c := &CustomProperty{DefaultValue: &zeroValue} + c.GetDefaultValue() + c = &CustomProperty{} + c.GetDefaultValue() + c = nil + c.GetDefaultValue() +} + +func TestCustomProperty_GetDescription(tt *testing.T) { + var zeroValue string + c := &CustomProperty{Description: &zeroValue} + c.GetDescription() + c = &CustomProperty{} + c.GetDescription() + c = nil + c.GetDescription() +} + +func TestCustomProperty_GetPropertyName(tt *testing.T) { + var zeroValue string + c := &CustomProperty{PropertyName: &zeroValue} + c.GetPropertyName() + c = &CustomProperty{} + c.GetPropertyName() + c = nil + c.GetPropertyName() +} + +func TestCustomProperty_GetRequired(tt *testing.T) { + var zeroValue bool + c := &CustomProperty{Required: &zeroValue} + c.GetRequired() + c = &CustomProperty{} + c.GetRequired() + c = nil + c.GetRequired() +} + +func TestCustomPropertyValue_GetValue(tt *testing.T) { + var zeroValue string + c := &CustomPropertyValue{Value: &zeroValue} + c.GetValue() + c = &CustomPropertyValue{} + c.GetValue() + c = nil + c.GetValue() +} + func TestCustomRepoRoles_GetBaseRole(tt *testing.T) { var zeroValue string c := &CustomRepoRoles{BaseRole: &zeroValue} diff --git a/github/orgs_properties.go b/github/orgs_properties.go new file mode 100644 index 00000000000..1daac811804 --- /dev/null +++ b/github/orgs_properties.go @@ -0,0 +1,198 @@ +// Copyright 2023 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" +) + +// CustomProperty represents an organization custom property object. +type CustomProperty struct { + // PropertyName is required for most endpoints except when calling CreateOrUpdateCustomProperty; + // where this is sent in the path and thus can be omitted. + PropertyName *string `json:"property_name,omitempty"` + // Possible values for ValueType are: string, single_select + ValueType string `json:"value_type"` + Required *bool `json:"required,omitempty"` + DefaultValue *string `json:"default_value,omitempty"` + Description *string `json:"description,omitempty"` + AllowedValues []string `json:"allowed_values,omitempty"` +} + +// RepoCustomPropertyValue represents a repository custom property value. +type RepoCustomPropertyValue struct { + RepositoryID int64 `json:"repository_id"` + RepositoryName string `json:"repository_name"` + RepositoryFullName string `json:"repository_full_name"` + Properties []*CustomPropertyValue `json:"properties"` +} + +// CustomPropertyValue represents a custom property value. +type CustomPropertyValue struct { + PropertyName string `json:"property_name"` + Value *string `json:"value,omitempty"` +} + +// GetAllCustomProperties gets all custom properties that are defined for the specified organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/properties#get-all-custom-properties-for-an-organization +// +//meta:operation GET /orgs/{org}/properties/schema +func (s *OrganizationsService) GetAllCustomProperties(ctx context.Context, org string) ([]*CustomProperty, *Response, error) { + u := fmt.Sprintf("orgs/%v/properties/schema", org) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var customProperties []*CustomProperty + resp, err := s.client.Do(ctx, req, &customProperties) + if err != nil { + return nil, resp, err + } + + return customProperties, resp, nil +} + +// CreateOrUpdateCustomProperties creates new or updates existing custom properties that are defined for the specified organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/properties#create-or-update-custom-properties-for-an-organization +// +//meta:operation PATCH /orgs/{org}/properties/schema +func (s *OrganizationsService) CreateOrUpdateCustomProperties(ctx context.Context, org string, properties []*CustomProperty) ([]*CustomProperty, *Response, error) { + u := fmt.Sprintf("orgs/%v/properties/schema", org) + + params := struct { + Properties []*CustomProperty `json:"properties"` + }{ + Properties: properties, + } + + req, err := s.client.NewRequest("PATCH", u, params) + if err != nil { + return nil, nil, err + } + + var customProperties []*CustomProperty + resp, err := s.client.Do(ctx, req, &customProperties) + if err != nil { + return nil, resp, err + } + + return customProperties, resp, nil +} + +// GetCustomProperty gets a custom property that is defined for the specified organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/properties#get-a-custom-property-for-an-organization +// +//meta:operation GET /orgs/{org}/properties/schema/{custom_property_name} +func (s *OrganizationsService) GetCustomProperty(ctx context.Context, org, name string) (*CustomProperty, *Response, error) { + u := fmt.Sprintf("orgs/%v/properties/schema/%v", org, name) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var customProperty *CustomProperty + resp, err := s.client.Do(ctx, req, &customProperty) + if err != nil { + return nil, resp, err + } + + return customProperty, resp, nil +} + +// CreateOrUpdateCustomProperty creates a new or updates an existing custom property that is defined for the specified organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/properties#create-or-update-a-custom-property-for-an-organization +// +//meta:operation PUT /orgs/{org}/properties/schema/{custom_property_name} +func (s *OrganizationsService) CreateOrUpdateCustomProperty(ctx context.Context, org, customPropertyName string, property *CustomProperty) (*CustomProperty, *Response, error) { + u := fmt.Sprintf("orgs/%v/properties/schema/%v", org, customPropertyName) + + req, err := s.client.NewRequest("PUT", u, property) + if err != nil { + return nil, nil, err + } + + var customProperty *CustomProperty + resp, err := s.client.Do(ctx, req, &customProperty) + if err != nil { + return nil, resp, err + } + + return customProperty, resp, nil +} + +// RemoveCustomProperty removes a custom property that is defined for the specified organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/properties#remove-a-custom-property-for-an-organization +// +//meta:operation DELETE /orgs/{org}/properties/schema/{custom_property_name} +func (s *OrganizationsService) RemoveCustomProperty(ctx context.Context, org, customPropertyName string) (*Response, error) { + u := fmt.Sprintf("orgs/%v/properties/schema/%v", org, customPropertyName) + + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// ListCustomPropertyValues lists all custom property values for repositories in the specified organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/properties#list-custom-property-values-for-organization-repositories +// +//meta:operation GET /orgs/{org}/properties/values +func (s *OrganizationsService) ListCustomPropertyValues(ctx context.Context, org string, opts *ListOptions) ([]*RepoCustomPropertyValue, *Response, error) { + u := fmt.Sprintf("orgs/%v/properties/values", org) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var repoCustomPropertyValues []*RepoCustomPropertyValue + resp, err := s.client.Do(ctx, req, &repoCustomPropertyValues) + if err != nil { + return nil, resp, err + } + + return repoCustomPropertyValues, resp, nil +} + +// CreateOrUpdateRepoCustomPropertyValues creates new or updates existing custom property values across multiple repositories for the specified organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/properties#create-or-update-custom-property-values-for-organization-repositories +// +//meta:operation PATCH /orgs/{org}/properties/values +func (s *OrganizationsService) CreateOrUpdateRepoCustomPropertyValues(ctx context.Context, org string, repoNames []string, properties []*CustomProperty) (*Response, error) { + u := fmt.Sprintf("orgs/%v/properties/values", org) + + params := struct { + RepositoryNames []string `json:"repository_names"` + Properties []*CustomProperty `json:"properties"` + }{ + RepositoryNames: repoNames, + Properties: properties, + } + + req, err := s.client.NewRequest("PATCH", u, params) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} diff --git a/github/orgs_properties_test.go b/github/orgs_properties_test.go new file mode 100644 index 00000000000..1a372306046 --- /dev/null +++ b/github/orgs_properties_test.go @@ -0,0 +1,369 @@ +// Copyright 2023 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 TestOrganizationsService_GetAllCustomProperties(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/properties/schema", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `[ + { + "property_name": "name", + "value_type": "single_select", + "required": true, + "default_value": "production", + "description": "Prod or dev environment", + "allowed_values":[ + "production", + "development" + ] + }, + { + "property_name": "service", + "value_type": "string" + }, + { + "property_name": "team", + "value_type": "string", + "description": "Team owning the repository" + } + ]`) + }) + + ctx := context.Background() + properties, _, err := client.Organizations.GetAllCustomProperties(ctx, "o") + if err != nil { + t.Errorf("Organizations.GetAllCustomProperties returned error: %v", err) + } + + want := []*CustomProperty{ + { + PropertyName: String("name"), + ValueType: "single_select", + Required: Bool(true), + DefaultValue: String("production"), + Description: String("Prod or dev environment"), + AllowedValues: []string{"production", "development"}, + }, + { + PropertyName: String("service"), + ValueType: "string", + }, + { + PropertyName: String("team"), + ValueType: "string", + Description: String("Team owning the repository"), + }, + } + if !cmp.Equal(properties, want) { + t.Errorf("Organizations.GetAllCustomProperties returned %+v, want %+v", properties, want) + } + + const methodName = "GetAllCustomProperties" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.GetAllCustomProperties(ctx, "o") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_CreateOrUpdateCustomProperties(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/properties/schema", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PATCH") + testBody(t, r, `{"properties":[{"property_name":"name","value_type":"single_select","required":true},{"property_name":"service","value_type":"string"}]}`+"\n") + fmt.Fprint(w, `[ + { + "property_name": "name", + "value_type": "single_select", + "required": true + }, + { + "property_name": "service", + "value_type": "string" + } + ]`) + }) + + ctx := context.Background() + properties, _, err := client.Organizations.CreateOrUpdateCustomProperties(ctx, "o", []*CustomProperty{ + { + PropertyName: String("name"), + ValueType: "single_select", + Required: Bool(true), + }, + { + PropertyName: String("service"), + ValueType: "string", + }, + }) + if err != nil { + t.Errorf("Organizations.CreateOrUpdateCustomProperties returned error: %v", err) + } + + want := []*CustomProperty{ + { + PropertyName: String("name"), + ValueType: "single_select", + Required: Bool(true), + }, + { + PropertyName: String("service"), + ValueType: "string", + }, + } + + if !cmp.Equal(properties, want) { + t.Errorf("Organizations.CreateOrUpdateCustomProperties returned %+v, want %+v", properties, want) + } + + const methodName = "CreateOrUpdateCustomProperties" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.CreateOrUpdateCustomProperties(ctx, "o", nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_GetCustomProperty(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/properties/schema/name", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "property_name": "name", + "value_type": "single_select", + "required": true, + "default_value": "production", + "description": "Prod or dev environment", + "allowed_values":[ + "production", + "development" + ] + }`) + }) + + ctx := context.Background() + property, _, err := client.Organizations.GetCustomProperty(ctx, "o", "name") + if err != nil { + t.Errorf("Organizations.GetCustomProperty returned error: %v", err) + } + + want := &CustomProperty{ + PropertyName: String("name"), + ValueType: "single_select", + Required: Bool(true), + DefaultValue: String("production"), + Description: String("Prod or dev environment"), + AllowedValues: []string{"production", "development"}, + } + if !cmp.Equal(property, want) { + t.Errorf("Organizations.GetCustomProperty returned %+v, want %+v", property, want) + } + + const methodName = "GetCustomProperty" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.GetCustomProperty(ctx, "o", "name") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_CreateOrUpdateCustomProperty(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/properties/schema/name", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + fmt.Fprint(w, `{ + "property_name": "name", + "value_type": "single_select", + "required": true, + "default_value": "production", + "description": "Prod or dev environment", + "allowed_values":[ + "production", + "development" + ] + }`) + }) + + ctx := context.Background() + property, _, err := client.Organizations.CreateOrUpdateCustomProperty(ctx, "o", "name", &CustomProperty{ + ValueType: "single_select", + Required: Bool(true), + DefaultValue: String("production"), + Description: String("Prod or dev environment"), + AllowedValues: []string{"production", "development"}, + }) + if err != nil { + t.Errorf("Organizations.CreateOrUpdateCustomProperty returned error: %v", err) + } + + want := &CustomProperty{ + PropertyName: String("name"), + ValueType: "single_select", + Required: Bool(true), + DefaultValue: String("production"), + Description: String("Prod or dev environment"), + AllowedValues: []string{"production", "development"}, + } + if !cmp.Equal(property, want) { + t.Errorf("Organizations.CreateOrUpdateCustomProperty returned %+v, want %+v", property, want) + } + + const methodName = "CreateOrUpdateCustomProperty" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.CreateOrUpdateCustomProperty(ctx, "o", "name", nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_RemoveCustomProperty(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/properties/schema/name", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + }) + + ctx := context.Background() + _, err := client.Organizations.RemoveCustomProperty(ctx, "o", "name") + if err != nil { + t.Errorf("Organizations.RemoveCustomProperty returned error: %v", err) + } + + const methodName = "RemoveCustomProperty" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Organizations.RemoveCustomProperty(ctx, "0", "name") + }) +} + +func TestOrganizationsService_ListCustomPropertyValues(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/properties/values", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{"page": "1", "per_page": "100"}) + fmt.Fprint(w, `[{ + "repository_id": 1296269, + "repository_name": "Hello-World", + "repository_full_name": "octocat/Hello-World", + "properties": [ + { + "property_name": "environment", + "value": "production" + }, + { + "property_name": "service", + "value": "web" + } + ] + }]`) + }) + + ctx := context.Background() + repoPropertyValues, _, err := client.Organizations.ListCustomPropertyValues(ctx, "o", &ListOptions{ + Page: 1, + PerPage: 100, + }) + if err != nil { + t.Errorf("Organizations.ListCustomPropertyValues returned error: %v", err) + } + + want := []*RepoCustomPropertyValue{ + { + RepositoryID: 1296269, + RepositoryName: "Hello-World", + RepositoryFullName: "octocat/Hello-World", + Properties: []*CustomPropertyValue{ + { + PropertyName: "environment", + Value: String("production"), + }, + { + PropertyName: "service", + Value: String("web"), + }, + }, + }, + } + + if !cmp.Equal(repoPropertyValues, want) { + t.Errorf("Organizations.ListCustomPropertyValues returned %+v, want %+v", repoPropertyValues, want) + } + + const methodName = "ListCustomPropertyValues" + + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.ListCustomPropertyValues(ctx, "\n", &ListOptions{}) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.ListCustomPropertyValues(ctx, "o", nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_CreateOrUpdateRepoCustomPropertyValues(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/properties/values", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PATCH") + testBody(t, r, `{"repository_names":["repo"],"properties":[{"property_name":"service","value_type":"string"}]}`+"\n") + }) + + ctx := context.Background() + _, err := client.Organizations.CreateOrUpdateRepoCustomPropertyValues(ctx, "o", []string{"repo"}, []*CustomProperty{ + { + PropertyName: String("service"), + ValueType: "string", + }, + }) + if err != nil { + t.Errorf("Organizations.CreateOrUpdateCustomPropertyValuesForRepos returned error: %v", err) + } + + const methodName = "CreateOrUpdateCustomPropertyValuesForRepos" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Organizations.CreateOrUpdateRepoCustomPropertyValues(ctx, "o", nil, nil) + }) +} From 78c6de0b72ac4f5205eaa31a19c57fb18a510400 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 18:07:24 -0500 Subject: [PATCH 351/751] Bump golang.org/x/net from 0.17.0 to 0.18.0 in /scrape (#2991) --- scrape/go.mod | 2 +- scrape/go.sum | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 22bd9bf60ec..95c03591b22 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -7,5 +7,5 @@ require ( github.com/google/go-cmp v0.6.0 github.com/google/go-github/v56 v56.0.0 github.com/xlzd/gotp v0.1.0 - golang.org/x/net v0.17.0 + golang.org/x/net v0.18.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index d7b761f318d..78483af2cbf 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -15,7 +15,7 @@ github.com/xlzd/gotp v0.1.0/go.mod h1:ndLJ3JKzi3xLmUProq4LLxCuECL93dG9WASNLpHz8q github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -25,8 +25,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= +golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -38,19 +38,19 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= +golang.org/x/term v0.14.0/go.mod h1:TySc+nGkYR6qt8km8wUhuFRTVSMIX3XPR58y2lC8vww= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= From a5f292c3c1585781bf3236aa481cd6fef626d3e8 Mon Sep 17 00:00:00 2001 From: Casey Date: Wed, 22 Nov 2023 11:48:39 -0800 Subject: [PATCH 352/751] Add default branch to repository edit event (#2995) Fixes: #2994. --- github/event_types.go | 16 +++++++++++----- github/github-accessors.go | 16 ++++++++++++++++ github/github-accessors_test.go | 17 +++++++++++++++++ 3 files changed, 44 insertions(+), 5 deletions(-) diff --git a/github/event_types.go b/github/event_types.go index 6ff1eb84851..327fc561662 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -388,11 +388,12 @@ type GollumEvent struct { // EditChange represents the changes when an issue, pull request, comment, // or repository has been edited. type EditChange struct { - Title *EditTitle `json:"title,omitempty"` - Body *EditBody `json:"body,omitempty"` - Base *EditBase `json:"base,omitempty"` - Repo *EditRepo `json:"repository,omitempty"` - Owner *EditOwner `json:"owner,omitempty"` + Title *EditTitle `json:"title,omitempty"` + Body *EditBody `json:"body,omitempty"` + Base *EditBase `json:"base,omitempty"` + Repo *EditRepo `json:"repository,omitempty"` + Owner *EditOwner `json:"owner,omitempty"` + DefaultBranch *EditDefaultBranch `json:"default_branch,omitempty"` } // EditTitle represents a pull-request title change. @@ -442,6 +443,11 @@ type EditSHA struct { From *string `json:"from,omitempty"` } +// EditDefaultBranch represents a change of repository's default branch name. +type EditDefaultBranch struct { + From *string `json:"from,omitempty"` +} + // ProjectChange represents the changes when a project has been edited. type ProjectChange struct { Name *ProjectName `json:"name,omitempty"` diff --git a/github/github-accessors.go b/github/github-accessors.go index 536ce5a8407..541be64a8de 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -6678,6 +6678,14 @@ func (e *EditChange) GetBody() *EditBody { return e.Body } +// GetDefaultBranch returns the DefaultBranch field. +func (e *EditChange) GetDefaultBranch() *EditDefaultBranch { + if e == nil { + return nil + } + return e.DefaultBranch +} + // GetOwner returns the Owner field. func (e *EditChange) GetOwner() *EditOwner { if e == nil { @@ -6702,6 +6710,14 @@ func (e *EditChange) GetTitle() *EditTitle { return e.Title } +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (e *EditDefaultBranch) GetFrom() string { + if e == nil || e.From == nil { + return "" + } + return *e.From +} + // GetOwnerInfo returns the OwnerInfo field. func (e *EditOwner) GetOwnerInfo() *OwnerInfo { if e == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index abe96ecf98f..49ed8eee086 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -7826,6 +7826,13 @@ func TestEditChange_GetBody(tt *testing.T) { e.GetBody() } +func TestEditChange_GetDefaultBranch(tt *testing.T) { + e := &EditChange{} + e.GetDefaultBranch() + e = nil + e.GetDefaultBranch() +} + func TestEditChange_GetOwner(tt *testing.T) { e := &EditChange{} e.GetOwner() @@ -7847,6 +7854,16 @@ func TestEditChange_GetTitle(tt *testing.T) { e.GetTitle() } +func TestEditDefaultBranch_GetFrom(tt *testing.T) { + var zeroValue string + e := &EditDefaultBranch{From: &zeroValue} + e.GetFrom() + e = &EditDefaultBranch{} + e.GetFrom() + e = nil + e.GetFrom() +} + func TestEditOwner_GetOwnerInfo(tt *testing.T) { e := &EditOwner{} e.GetOwnerInfo() From 942692ee973fd8b917b182fe5cb0a0c5bf5290fe Mon Sep 17 00:00:00 2001 From: Casey Date: Wed, 22 Nov 2023 19:03:06 -0800 Subject: [PATCH 353/751] Add `Draft` to `Issue` type (#2997) Fixes: #2996. --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ github/github-stringify_test.go | 3 ++- github/issues.go | 1 + 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 541be64a8de..d5696279d43 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -9406,6 +9406,14 @@ func (i *Issue) GetCreatedAt() Timestamp { return *i.CreatedAt } +// GetDraft returns the Draft field if it's non-nil, zero value otherwise. +func (i *Issue) GetDraft() bool { + if i == nil || i.Draft == nil { + return false + } + return *i.Draft +} + // GetEventsURL returns the EventsURL field if it's non-nil, zero value otherwise. func (i *Issue) GetEventsURL() string { if i == nil || i.EventsURL == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 49ed8eee086..3ad4b6b2ecf 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -11041,6 +11041,16 @@ func TestIssue_GetCreatedAt(tt *testing.T) { i.GetCreatedAt() } +func TestIssue_GetDraft(tt *testing.T) { + var zeroValue bool + i := &Issue{Draft: &zeroValue} + i.GetDraft() + i = &Issue{} + i.GetDraft() + i = nil + i.GetDraft() +} + func TestIssue_GetEventsURL(tt *testing.T) { var zeroValue string i := &Issue{EventsURL: &zeroValue} diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index 1dfd878fd59..a9b719c516a 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -768,9 +768,10 @@ func TestIssue_String(t *testing.T) { Repository: &Repository{}, Reactions: &Reactions{}, NodeID: String(""), + Draft: Bool(false), ActiveLockReason: String(""), } - want := `github.Issue{ID:0, Number:0, State:"", StateReason:"", Locked:false, Title:"", Body:"", AuthorAssociation:"", User:github.User{}, Assignee:github.User{}, Comments:0, ClosedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, ClosedBy:github.User{}, URL:"", HTMLURL:"", CommentsURL:"", EventsURL:"", LabelsURL:"", RepositoryURL:"", Milestone:github.Milestone{}, PullRequestLinks:github.PullRequestLinks{}, Repository:github.Repository{}, Reactions:github.Reactions{}, NodeID:"", ActiveLockReason:""}` + want := `github.Issue{ID:0, Number:0, State:"", StateReason:"", Locked:false, Title:"", Body:"", AuthorAssociation:"", User:github.User{}, Assignee:github.User{}, Comments:0, ClosedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, ClosedBy:github.User{}, URL:"", HTMLURL:"", CommentsURL:"", EventsURL:"", LabelsURL:"", RepositoryURL:"", Milestone:github.Milestone{}, PullRequestLinks:github.PullRequestLinks{}, Repository:github.Repository{}, Reactions:github.Reactions{}, NodeID:"", Draft:false, ActiveLockReason:""}` if got := v.String(); got != want { t.Errorf("Issue.String = %v, want %v", got, want) } diff --git a/github/issues.go b/github/issues.go index 1db99328b51..1c07fef827b 100644 --- a/github/issues.go +++ b/github/issues.go @@ -54,6 +54,7 @@ type Issue struct { Reactions *Reactions `json:"reactions,omitempty"` Assignees []*User `json:"assignees,omitempty"` NodeID *string `json:"node_id,omitempty"` + Draft *bool `json:"draft,omitempty"` // TextMatches is only populated from search results that request text matches // See: search.go and https://docs.github.com/rest/search/#text-match-metadata From 182859f01734d19cfa11a09dccede8864820b344 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Sal=C3=A9?= Date: Mon, 27 Nov 2023 01:00:00 +0100 Subject: [PATCH 354/751] Fix secondary rate limits URL (#3001) --- github/github.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/github/github.go b/github/github.go index 9c1bf084d35..c2706b0f10a 100644 --- a/github/github.go +++ b/github/github.go @@ -1133,7 +1133,7 @@ func (ae *AcceptedError) Is(target error) bool { } // AbuseRateLimitError occurs when GitHub returns 403 Forbidden response with the -// "documentation_url" field value equal to "https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits". +// "documentation_url" field value equal to "https://docs.github.com/rest/overview/rate-limits-for-the-rest-api#about-secondary-rate-limits". type AbuseRateLimitError struct { Response *http.Response // HTTP response that caused this error Message string `json:"message"` // error message @@ -1259,7 +1259,7 @@ func CheckResponse(r *http.Response) error { } case r.StatusCode == http.StatusForbidden && (strings.HasSuffix(errorResponse.DocumentationURL, "#abuse-rate-limits") || - strings.HasSuffix(errorResponse.DocumentationURL, "#secondary-rate-limits")): + strings.HasSuffix(errorResponse.DocumentationURL, "secondary-rate-limits")): abuseRateLimitError := &AbuseRateLimitError{ Response: errorResponse.Response, Message: errorResponse.Message, From 466e52f0cd17ddbed7a4ac88307fc8fdaf440605 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Nov 2023 15:19:00 -0500 Subject: [PATCH 355/751] Bump golang.org/x/net from 0.18.0 to 0.19.0 in /scrape (#3003) --- scrape/go.mod | 2 +- scrape/go.sum | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 95c03591b22..05f87b6b3a3 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -7,5 +7,5 @@ require ( github.com/google/go-cmp v0.6.0 github.com/google/go-github/v56 v56.0.0 github.com/xlzd/gotp v0.1.0 - golang.org/x/net v0.18.0 + golang.org/x/net v0.19.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index 78483af2cbf..907678b1c1d 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -15,7 +15,7 @@ github.com/xlzd/gotp v0.1.0/go.mod h1:ndLJ3JKzi3xLmUProq4LLxCuECL93dG9WASNLpHz8q github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= +golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -25,8 +25,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= -golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= +golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -38,12 +38,12 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.14.0/go.mod h1:TySc+nGkYR6qt8km8wUhuFRTVSMIX3XPR58y2lC8vww= +golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= From 9cf8c174d1af9aca1d2976ae6ddd1072ba77045b Mon Sep 17 00:00:00 2001 From: Carlos Tadeu Panato Junior Date: Wed, 29 Nov 2023 15:56:21 +0100 Subject: [PATCH 356/751] Implement global security advisories API (#2993) Fixes: #2851. --- github/github-accessors.go | 168 +++++++++++++ github/github-accessors_test.go | 204 ++++++++++++++++ github/security_advisories.go | 122 ++++++++++ github/security_advisories_test.go | 378 +++++++++++++++++++++++++++++ 4 files changed, 872 insertions(+) diff --git a/github/github-accessors.go b/github/github-accessors.go index d5696279d43..bccc3b4eb01 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -4990,6 +4990,22 @@ func (c *CredentialAuthorization) GetTokenLastEight() string { return *c.TokenLastEight } +// GetType returns the Type field if it's non-nil, zero value otherwise. +func (c *Credit) GetType() string { + if c == nil || c.Type == nil { + return "" + } + return *c.Type +} + +// GetUser returns the User field. +func (c *Credit) GetUser() *User { + if c == nil { + return nil + } + return c.User +} + // GetDefaultValue returns the DefaultValue field if it's non-nil, zero value otherwise. func (c *CustomProperty) GetDefaultValue() string { if c == nil || c.DefaultValue == nil { @@ -7814,6 +7830,78 @@ func (g *GitObject) GetURL() string { return *g.URL } +// GetGithubReviewedAt returns the GithubReviewedAt field if it's non-nil, zero value otherwise. +func (g *GlobalSecurityAdvisory) GetGithubReviewedAt() Timestamp { + if g == nil || g.GithubReviewedAt == nil { + return Timestamp{} + } + return *g.GithubReviewedAt +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (g *GlobalSecurityAdvisory) GetID() int64 { + if g == nil || g.ID == nil { + return 0 + } + return *g.ID +} + +// GetNVDPublishedAt returns the NVDPublishedAt field if it's non-nil, zero value otherwise. +func (g *GlobalSecurityAdvisory) GetNVDPublishedAt() Timestamp { + if g == nil || g.NVDPublishedAt == nil { + return Timestamp{} + } + return *g.NVDPublishedAt +} + +// GetRepositoryAdvisoryURL returns the RepositoryAdvisoryURL field if it's non-nil, zero value otherwise. +func (g *GlobalSecurityAdvisory) GetRepositoryAdvisoryURL() string { + if g == nil || g.RepositoryAdvisoryURL == nil { + return "" + } + return *g.RepositoryAdvisoryURL +} + +// GetSourceCodeLocation returns the SourceCodeLocation field if it's non-nil, zero value otherwise. +func (g *GlobalSecurityAdvisory) GetSourceCodeLocation() string { + if g == nil || g.SourceCodeLocation == nil { + return "" + } + return *g.SourceCodeLocation +} + +// GetType returns the Type field if it's non-nil, zero value otherwise. +func (g *GlobalSecurityAdvisory) GetType() string { + if g == nil || g.Type == nil { + return "" + } + return *g.Type +} + +// GetFirstPatchedVersion returns the FirstPatchedVersion field if it's non-nil, zero value otherwise. +func (g *GlobalSecurityVulnerability) GetFirstPatchedVersion() string { + if g == nil || g.FirstPatchedVersion == nil { + return "" + } + return *g.FirstPatchedVersion +} + +// GetPackage returns the Package field. +func (g *GlobalSecurityVulnerability) GetPackage() *VulnerabilityPackage { + if g == nil { + return nil + } + return g.Package +} + +// GetVulnerableVersionRange returns the VulnerableVersionRange field if it's non-nil, zero value otherwise. +func (g *GlobalSecurityVulnerability) GetVulnerableVersionRange() string { + if g == nil || g.VulnerableVersionRange == nil { + return "" + } + return *g.VulnerableVersionRange +} + // GetInstallation returns the Installation field. func (g *GollumEvent) GetInstallation() *Installation { if g == nil { @@ -10790,6 +10878,86 @@ func (l *ListExternalGroupsOptions) GetDisplayName() string { return *l.DisplayName } +// GetAffects returns the Affects field if it's non-nil, zero value otherwise. +func (l *ListGlobalSecurityAdvisoriesOptions) GetAffects() string { + if l == nil || l.Affects == nil { + return "" + } + return *l.Affects +} + +// GetCVEID returns the CVEID field if it's non-nil, zero value otherwise. +func (l *ListGlobalSecurityAdvisoriesOptions) GetCVEID() string { + if l == nil || l.CVEID == nil { + return "" + } + return *l.CVEID +} + +// GetEcosystem returns the Ecosystem field if it's non-nil, zero value otherwise. +func (l *ListGlobalSecurityAdvisoriesOptions) GetEcosystem() string { + if l == nil || l.Ecosystem == nil { + return "" + } + return *l.Ecosystem +} + +// GetGHSAID returns the GHSAID field if it's non-nil, zero value otherwise. +func (l *ListGlobalSecurityAdvisoriesOptions) GetGHSAID() string { + if l == nil || l.GHSAID == nil { + return "" + } + return *l.GHSAID +} + +// GetIsWithdrawn returns the IsWithdrawn field if it's non-nil, zero value otherwise. +func (l *ListGlobalSecurityAdvisoriesOptions) GetIsWithdrawn() bool { + if l == nil || l.IsWithdrawn == nil { + return false + } + return *l.IsWithdrawn +} + +// GetModified returns the Modified field if it's non-nil, zero value otherwise. +func (l *ListGlobalSecurityAdvisoriesOptions) GetModified() string { + if l == nil || l.Modified == nil { + return "" + } + return *l.Modified +} + +// GetPublished returns the Published field if it's non-nil, zero value otherwise. +func (l *ListGlobalSecurityAdvisoriesOptions) GetPublished() string { + if l == nil || l.Published == nil { + return "" + } + return *l.Published +} + +// GetSeverity returns the Severity field if it's non-nil, zero value otherwise. +func (l *ListGlobalSecurityAdvisoriesOptions) GetSeverity() string { + if l == nil || l.Severity == nil { + return "" + } + return *l.Severity +} + +// GetType returns the Type field if it's non-nil, zero value otherwise. +func (l *ListGlobalSecurityAdvisoriesOptions) GetType() string { + if l == nil || l.Type == nil { + return "" + } + return *l.Type +} + +// GetUpdated returns the Updated field if it's non-nil, zero value otherwise. +func (l *ListGlobalSecurityAdvisoriesOptions) GetUpdated() string { + if l == nil || l.Updated == nil { + return "" + } + return *l.Updated +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (l *ListOrganizations) GetTotalCount() int { if l == nil || l.TotalCount == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 3ad4b6b2ecf..84d104f18cb 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -5899,6 +5899,23 @@ func TestCredentialAuthorization_GetTokenLastEight(tt *testing.T) { c.GetTokenLastEight() } +func TestCredit_GetType(tt *testing.T) { + var zeroValue string + c := &Credit{Type: &zeroValue} + c.GetType() + c = &Credit{} + c.GetType() + c = nil + c.GetType() +} + +func TestCredit_GetUser(tt *testing.T) { + c := &Credit{} + c.GetUser() + c = nil + c.GetUser() +} + func TestCustomProperty_GetDefaultValue(tt *testing.T) { var zeroValue string c := &CustomProperty{DefaultValue: &zeroValue} @@ -9159,6 +9176,93 @@ func TestGitObject_GetURL(tt *testing.T) { g.GetURL() } +func TestGlobalSecurityAdvisory_GetGithubReviewedAt(tt *testing.T) { + var zeroValue Timestamp + g := &GlobalSecurityAdvisory{GithubReviewedAt: &zeroValue} + g.GetGithubReviewedAt() + g = &GlobalSecurityAdvisory{} + g.GetGithubReviewedAt() + g = nil + g.GetGithubReviewedAt() +} + +func TestGlobalSecurityAdvisory_GetID(tt *testing.T) { + var zeroValue int64 + g := &GlobalSecurityAdvisory{ID: &zeroValue} + g.GetID() + g = &GlobalSecurityAdvisory{} + g.GetID() + g = nil + g.GetID() +} + +func TestGlobalSecurityAdvisory_GetNVDPublishedAt(tt *testing.T) { + var zeroValue Timestamp + g := &GlobalSecurityAdvisory{NVDPublishedAt: &zeroValue} + g.GetNVDPublishedAt() + g = &GlobalSecurityAdvisory{} + g.GetNVDPublishedAt() + g = nil + g.GetNVDPublishedAt() +} + +func TestGlobalSecurityAdvisory_GetRepositoryAdvisoryURL(tt *testing.T) { + var zeroValue string + g := &GlobalSecurityAdvisory{RepositoryAdvisoryURL: &zeroValue} + g.GetRepositoryAdvisoryURL() + g = &GlobalSecurityAdvisory{} + g.GetRepositoryAdvisoryURL() + g = nil + g.GetRepositoryAdvisoryURL() +} + +func TestGlobalSecurityAdvisory_GetSourceCodeLocation(tt *testing.T) { + var zeroValue string + g := &GlobalSecurityAdvisory{SourceCodeLocation: &zeroValue} + g.GetSourceCodeLocation() + g = &GlobalSecurityAdvisory{} + g.GetSourceCodeLocation() + g = nil + g.GetSourceCodeLocation() +} + +func TestGlobalSecurityAdvisory_GetType(tt *testing.T) { + var zeroValue string + g := &GlobalSecurityAdvisory{Type: &zeroValue} + g.GetType() + g = &GlobalSecurityAdvisory{} + g.GetType() + g = nil + g.GetType() +} + +func TestGlobalSecurityVulnerability_GetFirstPatchedVersion(tt *testing.T) { + var zeroValue string + g := &GlobalSecurityVulnerability{FirstPatchedVersion: &zeroValue} + g.GetFirstPatchedVersion() + g = &GlobalSecurityVulnerability{} + g.GetFirstPatchedVersion() + g = nil + g.GetFirstPatchedVersion() +} + +func TestGlobalSecurityVulnerability_GetPackage(tt *testing.T) { + g := &GlobalSecurityVulnerability{} + g.GetPackage() + g = nil + g.GetPackage() +} + +func TestGlobalSecurityVulnerability_GetVulnerableVersionRange(tt *testing.T) { + var zeroValue string + g := &GlobalSecurityVulnerability{VulnerableVersionRange: &zeroValue} + g.GetVulnerableVersionRange() + g = &GlobalSecurityVulnerability{} + g.GetVulnerableVersionRange() + g = nil + g.GetVulnerableVersionRange() +} + func TestGollumEvent_GetInstallation(tt *testing.T) { g := &GollumEvent{} g.GetInstallation() @@ -12639,6 +12743,106 @@ func TestListExternalGroupsOptions_GetDisplayName(tt *testing.T) { l.GetDisplayName() } +func TestListGlobalSecurityAdvisoriesOptions_GetAffects(tt *testing.T) { + var zeroValue string + l := &ListGlobalSecurityAdvisoriesOptions{Affects: &zeroValue} + l.GetAffects() + l = &ListGlobalSecurityAdvisoriesOptions{} + l.GetAffects() + l = nil + l.GetAffects() +} + +func TestListGlobalSecurityAdvisoriesOptions_GetCVEID(tt *testing.T) { + var zeroValue string + l := &ListGlobalSecurityAdvisoriesOptions{CVEID: &zeroValue} + l.GetCVEID() + l = &ListGlobalSecurityAdvisoriesOptions{} + l.GetCVEID() + l = nil + l.GetCVEID() +} + +func TestListGlobalSecurityAdvisoriesOptions_GetEcosystem(tt *testing.T) { + var zeroValue string + l := &ListGlobalSecurityAdvisoriesOptions{Ecosystem: &zeroValue} + l.GetEcosystem() + l = &ListGlobalSecurityAdvisoriesOptions{} + l.GetEcosystem() + l = nil + l.GetEcosystem() +} + +func TestListGlobalSecurityAdvisoriesOptions_GetGHSAID(tt *testing.T) { + var zeroValue string + l := &ListGlobalSecurityAdvisoriesOptions{GHSAID: &zeroValue} + l.GetGHSAID() + l = &ListGlobalSecurityAdvisoriesOptions{} + l.GetGHSAID() + l = nil + l.GetGHSAID() +} + +func TestListGlobalSecurityAdvisoriesOptions_GetIsWithdrawn(tt *testing.T) { + var zeroValue bool + l := &ListGlobalSecurityAdvisoriesOptions{IsWithdrawn: &zeroValue} + l.GetIsWithdrawn() + l = &ListGlobalSecurityAdvisoriesOptions{} + l.GetIsWithdrawn() + l = nil + l.GetIsWithdrawn() +} + +func TestListGlobalSecurityAdvisoriesOptions_GetModified(tt *testing.T) { + var zeroValue string + l := &ListGlobalSecurityAdvisoriesOptions{Modified: &zeroValue} + l.GetModified() + l = &ListGlobalSecurityAdvisoriesOptions{} + l.GetModified() + l = nil + l.GetModified() +} + +func TestListGlobalSecurityAdvisoriesOptions_GetPublished(tt *testing.T) { + var zeroValue string + l := &ListGlobalSecurityAdvisoriesOptions{Published: &zeroValue} + l.GetPublished() + l = &ListGlobalSecurityAdvisoriesOptions{} + l.GetPublished() + l = nil + l.GetPublished() +} + +func TestListGlobalSecurityAdvisoriesOptions_GetSeverity(tt *testing.T) { + var zeroValue string + l := &ListGlobalSecurityAdvisoriesOptions{Severity: &zeroValue} + l.GetSeverity() + l = &ListGlobalSecurityAdvisoriesOptions{} + l.GetSeverity() + l = nil + l.GetSeverity() +} + +func TestListGlobalSecurityAdvisoriesOptions_GetType(tt *testing.T) { + var zeroValue string + l := &ListGlobalSecurityAdvisoriesOptions{Type: &zeroValue} + l.GetType() + l = &ListGlobalSecurityAdvisoriesOptions{} + l.GetType() + l = nil + l.GetType() +} + +func TestListGlobalSecurityAdvisoriesOptions_GetUpdated(tt *testing.T) { + var zeroValue string + l := &ListGlobalSecurityAdvisoriesOptions{Updated: &zeroValue} + l.GetUpdated() + l = &ListGlobalSecurityAdvisoriesOptions{} + l.GetUpdated() + l = nil + l.GetUpdated() +} + func TestListOrganizations_GetTotalCount(tt *testing.T) { var zeroValue int l := &ListOrganizations{TotalCount: &zeroValue} diff --git a/github/security_advisories.go b/github/security_advisories.go index 66e7dba15ac..635263748d4 100644 --- a/github/security_advisories.go +++ b/github/security_advisories.go @@ -47,6 +47,81 @@ type ListRepositorySecurityAdvisoriesOptions struct { State string `url:"state,omitempty"` } +// ListGlobalSecurityAdvisoriesOptions specifies the optional parameters to list the global security advisories. +type ListGlobalSecurityAdvisoriesOptions struct { + ListCursorOptions + + // If specified, only advisories with this GHSA (GitHub Security Advisory) identifier will be returned. + GHSAID *string `url:"ghsa_id,omitempty"` + + // If specified, only advisories of this type will be returned. + // By default, a request with no other parameters defined will only return reviewed advisories that are not malware. + // Default: reviewed + // Can be one of: reviewed, malware, unreviewed + Type *string `url:"type,omitempty"` + + // If specified, only advisories with this CVE (Common Vulnerabilities and Exposures) identifier will be returned. + CVEID *string `url:"cve_id,omitempty"` + + // If specified, only advisories for these ecosystems will be returned. + // Can be one of: actions, composer, erlang, go, maven, npm, nuget, other, pip, pub, rubygems, rust + Ecosystem *string `url:"ecosystem,omitempty"` + + // If specified, only advisories with these severities will be returned. + // Can be one of: unknown, low, medium, high, critical + Severity *string `url:"severity,omitempty"` + + // If specified, only advisories with these Common Weakness Enumerations (CWEs) will be returned. + // Example: cwes=79,284,22 or cwes[]=79&cwes[]=284&cwes[]=22 + CWEs []string `url:"cwes,omitempty"` + + // Whether to only return advisories that have been withdrawn. + IsWithdrawn *bool `url:"is_withdrawn,omitempty"` + + // If specified, only return advisories that affect any of package or package@version. + // A maximum of 1000 packages can be specified. If the query parameter causes + // the URL to exceed the maximum URL length supported by your client, you must specify fewer packages. + // Example: affects=package1,package2@1.0.0,package3@^2.0.0 or affects[]=package1&affects[]=package2@1.0.0 + Affects *string `url:"affects,omitempty"` + + // If specified, only return advisories that were published on a date or date range. + Published *string `url:"published,omitempty"` + + // If specified, only return advisories that were updated on a date or date range. + Updated *string `url:"updated,omitempty"` + + // If specified, only show advisories that were updated or published on a date or date range. + Modified *string `url:"modified,omitempty"` +} + +// GlobalSecurityAdvisory represents the global security advisory object response. +type GlobalSecurityAdvisory struct { + SecurityAdvisory + ID *int64 `json:"id,omitempty"` + RepositoryAdvisoryURL *string `json:"repository_advisory_url,omitempty"` + Type *string `json:"type,omitempty"` + SourceCodeLocation *string `json:"source_code_location,omitempty"` + References []string `json:"references,omitempty"` + Vulnerabilities []*GlobalSecurityVulnerability `json:"vulnerabilities,omitempty"` + GithubReviewedAt *Timestamp `json:"github_reviewed_at,omitempty"` + NVDPublishedAt *Timestamp `json:"nvd_published_at,omitempty"` + Credits []*Credit `json:"credits,omitempty"` +} + +// GlobalSecurityVulnerability represents a vulnerability for a global security advisory. +type GlobalSecurityVulnerability struct { + Package *VulnerabilityPackage `json:"package,omitempty"` + FirstPatchedVersion *string `json:"first_patched_version,omitempty"` + VulnerableVersionRange *string `json:"vulnerable_version_range,omitempty"` + VulnerableFunctions []string `json:"vulnerable_functions,omitempty"` +} + +// Credit represents the credit object for a global security advisory. +type Credit struct { + User *User `json:"user,omitempty"` + Type *string `json:"type,omitempty"` +} + // RequestCVE requests a Common Vulnerabilities and Exposures (CVE) for a repository security advisory. // The ghsaID is the GitHub Security Advisory identifier of the advisory. // @@ -124,3 +199,50 @@ func (s *SecurityAdvisoriesService) ListRepositorySecurityAdvisories(ctx context return advisories, resp, nil } + +// ListGlobalSecurityAdvisories lists all global security advisories. +// +// GitHub API docs: https://docs.github.com/rest/security-advisories/global-advisories#list-global-security-advisories +// +//meta:operation GET /advisories +func (s *SecurityAdvisoriesService) ListGlobalSecurityAdvisories(ctx context.Context, opts *ListGlobalSecurityAdvisoriesOptions) ([]*GlobalSecurityAdvisory, *Response, error) { + url := "advisories" + url, err := addOptions(url, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", url, nil) + if err != nil { + return nil, nil, err + } + + var advisories []*GlobalSecurityAdvisory + resp, err := s.client.Do(ctx, req, &advisories) + if err != nil { + return nil, resp, err + } + + return advisories, resp, nil +} + +// GetGlobalSecurityAdvisories gets a global security advisory using its GitHub Security Advisory (GHSA) identifier. +// +// GitHub API docs: https://docs.github.com/rest/security-advisories/global-advisories#get-a-global-security-advisory +// +//meta:operation GET /advisories/{ghsa_id} +func (s *SecurityAdvisoriesService) GetGlobalSecurityAdvisories(ctx context.Context, ghsaID string) (*GlobalSecurityAdvisory, *Response, error) { + url := fmt.Sprintf("advisories/%s", ghsaID) + req, err := s.client.NewRequest("GET", url, nil) + if err != nil { + return nil, nil, err + } + + var advisory *GlobalSecurityAdvisory + resp, err := s.client.Do(ctx, req, &advisory) + if err != nil { + return nil, resp, err + } + + return advisory, resp, nil +} diff --git a/github/security_advisories_test.go b/github/security_advisories_test.go index 5476ef6138f..918e3e05002 100644 --- a/github/security_advisories_test.go +++ b/github/security_advisories_test.go @@ -7,9 +7,11 @@ package github import ( "context" + "fmt" "net/http" "strings" "testing" + "time" "github.com/google/go-cmp/cmp" ) @@ -315,3 +317,379 @@ func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisories(t *testing.T return resp, err }) } + +func TestListGlobalSecurityAdvisories(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/advisories", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{"cve_id": "CVE-xoxo-1234"}) + + fmt.Fprint(w, `[{ + "id": 1, + "ghsa_id": "GHSA-xoxo-1234-xoxo", + "cve_id": "CVE-xoxo-1234", + "url": "https://api.github.com/advisories/GHSA-xoxo-1234-xoxo", + "html_url": "https://github.com/advisories/GHSA-xoxo-1234-xoxo", + "repository_advisory_url": "https://api.github.com/repos/project/a-package/security-advisories/GHSA-xoxo-1234-xoxo", + "summary": "Heartbleed security advisory", + "description": "This bug allows an attacker to read portions of the affected server’s memory, potentially disclosing sensitive information.", + "type": "reviewed", + "severity": "high", + "source_code_location": "https://github.com/project/a-package", + "identifiers": [ + { + "type": "GHSA", + "value": "GHSA-xoxo-1234-xoxo" + }, + { + "type": "CVE", + "value": "CVE-xoxo-1234" + } + ], + "references": ["https://nvd.nist.gov/vuln/detail/CVE-xoxo-1234"], + "published_at": "1996-06-20T00:00:00Z", + "updated_at": "1996-06-20T00:00:00Z", + "github_reviewed_at": "1996-06-20T00:00:00Z", + "nvd_published_at": "1996-06-20T00:00:00Z", + "withdrawn_at": null, + "vulnerabilities": [ + { + "package": { + "ecosystem": "npm", + "name": "a-package" + }, + "first_patched_version": "1.0.3", + "vulnerable_version_range": "<=1.0.2", + "vulnerable_functions": ["a_function"] + } + ], + "cvss": { + "vector_string": "CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:H", + "score": 7.6 + }, + "cwes": [ + { + "cwe_id": "CWE-400", + "name": "Uncontrolled Resource Consumption" + } + ], + "credits": [ + { + "user": { + "login": "user", + "id": 1, + "node_id": "12=", + "avatar_url": "a", + "gravatar_id": "", + "url": "a", + "html_url": "b", + "followers_url": "b", + "following_url": "c", + "gists_url": "d", + "starred_url": "e", + "subscriptions_url": "f", + "organizations_url": "g", + "repos_url": "h", + "events_url": "i", + "received_events_url": "j", + "type": "User", + "site_admin": false + }, + "type": "analyst" + } + ] + } + ]`) + }) + + ctx := context.Background() + opts := &ListGlobalSecurityAdvisoriesOptions{CVEID: String("CVE-xoxo-1234")} + + advisories, _, err := client.SecurityAdvisories.ListGlobalSecurityAdvisories(ctx, opts) + if err != nil { + t.Errorf("SecurityAdvisories.ListGlobalSecurityAdvisories returned error: %v", err) + } + + date := Timestamp{time.Date(1996, time.June, 20, 00, 00, 00, 0, time.UTC)} + want := []*GlobalSecurityAdvisory{ + { + ID: Int64(1), + SecurityAdvisory: SecurityAdvisory{ + GHSAID: String("GHSA-xoxo-1234-xoxo"), + CVEID: String("CVE-xoxo-1234"), + URL: String("https://api.github.com/advisories/GHSA-xoxo-1234-xoxo"), + HTMLURL: String("https://github.com/advisories/GHSA-xoxo-1234-xoxo"), + Severity: String("high"), + Summary: String("Heartbleed security advisory"), + Description: String("This bug allows an attacker to read portions of the affected server’s memory, potentially disclosing sensitive information."), + Identifiers: []*AdvisoryIdentifier{ + { + Type: String("GHSA"), + Value: String("GHSA-xoxo-1234-xoxo"), + }, + { + Type: String("CVE"), + Value: String("CVE-xoxo-1234"), + }, + }, + PublishedAt: &date, + UpdatedAt: &date, + WithdrawnAt: nil, + CVSS: &AdvisoryCVSS{ + VectorString: String("CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:H"), + Score: Float64(7.6), + }, + CWEs: []*AdvisoryCWEs{ + { + CWEID: String("CWE-400"), + Name: String("Uncontrolled Resource Consumption"), + }, + }, + }, + References: []string{"https://nvd.nist.gov/vuln/detail/CVE-xoxo-1234"}, + Vulnerabilities: []*GlobalSecurityVulnerability{ + { + Package: &VulnerabilityPackage{ + Ecosystem: String("npm"), + Name: String("a-package"), + }, + FirstPatchedVersion: String("1.0.3"), + VulnerableVersionRange: String("<=1.0.2"), + VulnerableFunctions: []string{"a_function"}, + }, + }, + RepositoryAdvisoryURL: String("https://api.github.com/repos/project/a-package/security-advisories/GHSA-xoxo-1234-xoxo"), + Type: String("reviewed"), + SourceCodeLocation: String("https://github.com/project/a-package"), + GithubReviewedAt: &date, + NVDPublishedAt: &date, + Credits: []*Credit{ + { + User: &User{ + Login: String("user"), + ID: Int64(1), + NodeID: String("12="), + AvatarURL: String("a"), + GravatarID: String(""), + URL: String("a"), + HTMLURL: String("b"), + FollowersURL: String("b"), + FollowingURL: String("c"), + GistsURL: String("d"), + StarredURL: String("e"), + SubscriptionsURL: String("f"), + OrganizationsURL: String("g"), + ReposURL: String("h"), + EventsURL: String("i"), + ReceivedEventsURL: String("j"), + Type: String("User"), + SiteAdmin: Bool(false), + }, + Type: String("analyst"), + }, + }, + }, + } + + if !cmp.Equal(advisories, want) { + t.Errorf("SecurityAdvisories.ListGlobalSecurityAdvisories %+v, want %+v", advisories, want) + } + + const methodName = "ListGlobalSecurityAdvisories" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + _, resp, err := client.SecurityAdvisories.ListGlobalSecurityAdvisories(ctx, nil) + return resp, err + }) +} + +func TestGetGlobalSecurityAdvisories(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/advisories/GHSA-xoxo-1234-xoxo", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + + fmt.Fprint(w, `{ + "id": 1, + "ghsa_id": "GHSA-xoxo-1234-xoxo", + "cve_id": "CVE-xoxo-1234", + "url": "https://api.github.com/advisories/GHSA-xoxo-1234-xoxo", + "html_url": "https://github.com/advisories/GHSA-xoxo-1234-xoxo", + "repository_advisory_url": "https://api.github.com/repos/project/a-package/security-advisories/GHSA-xoxo-1234-xoxo", + "summary": "Heartbleed security advisory", + "description": "This bug allows an attacker to read portions of the affected server’s memory, potentially disclosing sensitive information.", + "type": "reviewed", + "severity": "high", + "source_code_location": "https://github.com/project/a-package", + "identifiers": [ + { + "type": "GHSA", + "value": "GHSA-xoxo-1234-xoxo" + }, + { + "type": "CVE", + "value": "CVE-xoxo-1234" + } + ], + "references": ["https://nvd.nist.gov/vuln/detail/CVE-xoxo-1234"], + "published_at": "1996-06-20T00:00:00Z", + "updated_at": "1996-06-20T00:00:00Z", + "github_reviewed_at": "1996-06-20T00:00:00Z", + "nvd_published_at": "1996-06-20T00:00:00Z", + "withdrawn_at": null, + "vulnerabilities": [ + { + "package": { + "ecosystem": "npm", + "name": "a-package" + }, + "first_patched_version": "1.0.3", + "vulnerable_version_range": "<=1.0.2", + "vulnerable_functions": ["a_function"] + } + ], + "cvss": { + "vector_string": "CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:H", + "score": 7.6 + }, + "cwes": [ + { + "cwe_id": "CWE-400", + "name": "Uncontrolled Resource Consumption" + } + ], + "credits": [ + { + "user": { + "login": "user", + "id": 1, + "node_id": "12=", + "avatar_url": "a", + "gravatar_id": "", + "url": "a", + "html_url": "b", + "followers_url": "b", + "following_url": "c", + "gists_url": "d", + "starred_url": "e", + "subscriptions_url": "f", + "organizations_url": "g", + "repos_url": "h", + "events_url": "i", + "received_events_url": "j", + "type": "User", + "site_admin": false + }, + "type": "analyst" + } + ] + }`) + }) + + ctx := context.Background() + advisory, _, err := client.SecurityAdvisories.GetGlobalSecurityAdvisories(ctx, "GHSA-xoxo-1234-xoxo") + if err != nil { + t.Errorf("SecurityAdvisories.GetGlobalSecurityAdvisories returned error: %v", err) + } + + date := Timestamp{time.Date(1996, time.June, 20, 00, 00, 00, 0, time.UTC)} + want := &GlobalSecurityAdvisory{ + ID: Int64(1), + SecurityAdvisory: SecurityAdvisory{ + GHSAID: String("GHSA-xoxo-1234-xoxo"), + CVEID: String("CVE-xoxo-1234"), + URL: String("https://api.github.com/advisories/GHSA-xoxo-1234-xoxo"), + HTMLURL: String("https://github.com/advisories/GHSA-xoxo-1234-xoxo"), + Severity: String("high"), + Summary: String("Heartbleed security advisory"), + Description: String("This bug allows an attacker to read portions of the affected server’s memory, potentially disclosing sensitive information."), + Identifiers: []*AdvisoryIdentifier{ + { + Type: String("GHSA"), + Value: String("GHSA-xoxo-1234-xoxo"), + }, + { + Type: String("CVE"), + Value: String("CVE-xoxo-1234"), + }, + }, + PublishedAt: &date, + UpdatedAt: &date, + WithdrawnAt: nil, + CVSS: &AdvisoryCVSS{ + VectorString: String("CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:H"), + Score: Float64(7.6), + }, + CWEs: []*AdvisoryCWEs{ + { + CWEID: String("CWE-400"), + Name: String("Uncontrolled Resource Consumption"), + }, + }, + }, + RepositoryAdvisoryURL: String("https://api.github.com/repos/project/a-package/security-advisories/GHSA-xoxo-1234-xoxo"), + Type: String("reviewed"), + SourceCodeLocation: String("https://github.com/project/a-package"), + References: []string{"https://nvd.nist.gov/vuln/detail/CVE-xoxo-1234"}, + GithubReviewedAt: &date, + NVDPublishedAt: &date, + + Vulnerabilities: []*GlobalSecurityVulnerability{ + { + Package: &VulnerabilityPackage{ + Ecosystem: String("npm"), + Name: String("a-package"), + }, + FirstPatchedVersion: String("1.0.3"), + VulnerableVersionRange: String("<=1.0.2"), + VulnerableFunctions: []string{"a_function"}, + }, + }, + Credits: []*Credit{ + { + User: &User{ + Login: String("user"), + ID: Int64(1), + NodeID: String("12="), + AvatarURL: String("a"), + GravatarID: String(""), + URL: String("a"), + HTMLURL: String("b"), + FollowersURL: String("b"), + FollowingURL: String("c"), + GistsURL: String("d"), + StarredURL: String("e"), + SubscriptionsURL: String("f"), + OrganizationsURL: String("g"), + ReposURL: String("h"), + EventsURL: String("i"), + ReceivedEventsURL: String("j"), + Type: String("User"), + SiteAdmin: Bool(false), + }, + Type: String("analyst"), + }, + }, + } + + if !cmp.Equal(advisory, want) { + t.Errorf("SecurityAdvisories.GetGlobalSecurityAdvisories %+v, want %+v", advisory, want) + } + + const methodName = "GetGlobalSecurityAdvisories" + + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.SecurityAdvisories.GetGlobalSecurityAdvisories(ctx, "CVE-\n-1234") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.SecurityAdvisories.GetGlobalSecurityAdvisories(ctx, "e") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} From 50d4db259d28af40a3ee60af632f43f429842f91 Mon Sep 17 00:00:00 2001 From: Casey Date: Thu, 30 Nov 2023 03:45:17 -0800 Subject: [PATCH 357/751] Change `PushEvent.Pusher` type to `CommitAuthor` (#2999) Fixes: #2998. --- github/event_types.go | 2 +- github/event_types_test.go | 24 +++++++++--------------- github/github-accessors.go | 2 +- github/github-stringify_test.go | 4 ++-- github/repos_hooks_test.go | 6 ++---- 5 files changed, 15 insertions(+), 23 deletions(-) diff --git a/github/event_types.go b/github/event_types.go index 327fc561662..badd29b2a01 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -1282,7 +1282,7 @@ type PushEvent struct { Compare *string `json:"compare,omitempty"` Repo *PushEventRepository `json:"repository,omitempty"` HeadCommit *HeadCommit `json:"head_commit,omitempty"` - Pusher *User `json:"pusher,omitempty"` + Pusher *CommitAuthor `json:"pusher,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` diff --git a/github/event_types_test.go b/github/event_types_test.go index 91ac291205f..80eca61d0fc 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -3777,14 +3777,11 @@ func TestPushEvent_Marshal(t *testing.T) { Compare: String("a"), Repo: &PushEventRepository{ID: Int64(1)}, HeadCommit: &HeadCommit{ID: String("id")}, - Pusher: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Pusher: &CommitAuthor{ + Login: String("l"), + Date: &Timestamp{referenceTime}, + Name: String("n"), + Email: String("e"), }, Sender: &User{ Login: String("l"), @@ -3937,13 +3934,10 @@ func TestPushEvent_Marshal(t *testing.T) { "id": "id" }, "pusher": { - "login": "l", - "id": 1, - "node_id": "n", - "avatar_url": "a", - "url": "u", - "events_url": "e", - "repos_url": "r" + "date": ` + referenceTimeStr + `, + "name": "n", + "email": "e", + "username": "l" }, "sender": { "login": "l", diff --git a/github/github-accessors.go b/github/github-accessors.go index bccc3b4eb01..e15eb10204b 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -17399,7 +17399,7 @@ func (p *PushEvent) GetOrganization() *Organization { } // GetPusher returns the Pusher field. -func (p *PushEvent) GetPusher() *User { +func (p *PushEvent) GetPusher() *CommitAuthor { if p == nil { return nil } diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index a9b719c516a..7472edfd59a 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -1426,12 +1426,12 @@ func TestPushEvent_String(t *testing.T) { Compare: String(""), Repo: &PushEventRepository{}, HeadCommit: &HeadCommit{}, - Pusher: &User{}, + Pusher: &CommitAuthor{}, Sender: &User{}, Installation: &Installation{}, Organization: &Organization{}, } - want := `github.PushEvent{PushID:0, Head:"", Ref:"", Size:0, Before:"", DistinctSize:0, Action:"", After:"", Created:false, Deleted:false, Forced:false, BaseRef:"", Compare:"", Repo:github.PushEventRepository{}, HeadCommit:github.HeadCommit{}, Pusher:github.User{}, Sender:github.User{}, Installation:github.Installation{}, Organization:github.Organization{}}` + want := `github.PushEvent{PushID:0, Head:"", Ref:"", Size:0, Before:"", DistinctSize:0, Action:"", After:"", Created:false, Deleted:false, Forced:false, BaseRef:"", Compare:"", Repo:github.PushEventRepository{}, HeadCommit:github.HeadCommit{}, Pusher:github.CommitAuthor{}, Sender:github.User{}, Installation:github.Installation{}, Organization:github.Organization{}}` if got := v.String(); got != want { t.Errorf("PushEvent.String = %v, want %v", got, want) } diff --git a/github/repos_hooks_test.go b/github/repos_hooks_test.go index 84c9f5ee6fa..fa44440ade0 100644 --- a/github/repos_hooks_test.go +++ b/github/repos_hooks_test.go @@ -357,9 +357,8 @@ func TestBranchWebHookPayload_Marshal(t *testing.T) { Organization: &Organization{ ID: Int64(22), }, - Pusher: &User{ + Pusher: &CommitAuthor{ Login: String("rd@yahoo.com"), - ID: Int64(112), }, Repo: &PushEventRepository{ ID: Int64(321), @@ -421,8 +420,7 @@ func TestBranchWebHookPayload_Marshal(t *testing.T) { "id" : 22 }, "pusher":{ - "login": "rd@yahoo.com", - "id": 112 + "username": "rd@yahoo.com" }, "repository":{ "id": 321, From 4046b93ef02fd787085a2a25b7b0be3e01d6fd01 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Fri, 1 Dec 2023 12:46:26 -0500 Subject: [PATCH 358/751] Bump version of go-github to v57.0.0 (#3009) --- README.md | 15 ++++++++------- example/actionpermissions/main.go | 2 +- example/appengine/app.go | 2 +- example/basicauth/main.go | 2 +- .../codespaces/newreposecretwithxcrypto/main.go | 2 +- .../codespaces/newusersecretwithxcrypto/main.go | 2 +- example/commitpr/main.go | 2 +- example/go.mod | 6 +++--- example/listenvironments/main.go | 2 +- example/migrations/main.go | 2 +- example/newfilewithappauth/main.go | 2 +- example/newrepo/main.go | 2 +- example/newreposecretwithlibsodium/go.mod | 4 ++-- example/newreposecretwithlibsodium/main.go | 2 +- example/newreposecretwithxcrypto/main.go | 2 +- example/ratelimit/main.go | 2 +- example/simple/main.go | 2 +- example/tagprotection/main.go | 2 +- example/tokenauth/main.go | 2 +- example/topics/main.go | 2 +- github/doc.go | 2 +- github/examples_test.go | 2 +- github/github.go | 2 +- go.mod | 2 +- test/fields/fields.go | 2 +- test/integration/activity_test.go | 2 +- test/integration/authorizations_test.go | 2 +- test/integration/github_test.go | 2 +- test/integration/repos_test.go | 2 +- test/integration/users_test.go | 2 +- tools/go.mod | 5 ++++- tools/go.sum | 2 -- tools/metadata/main.go | 2 +- tools/metadata/main_test.go | 2 +- tools/metadata/metadata.go | 2 +- tools/metadata/openapi.go | 2 +- 36 files changed, 48 insertions(+), 46 deletions(-) diff --git a/README.md b/README.md index daf57fe0275..f10c43df8c4 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-github # [![go-github release (latest SemVer)](https://img.shields.io/github/v/release/google/go-github?sort=semver)](https://github.com/google/go-github/releases) -[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v56/github) +[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v57/github) [![Test Status](https://github.com/google/go-github/workflows/tests/badge.svg)](https://github.com/google/go-github/actions?query=workflow%3Atests) [![Test Coverage](https://codecov.io/gh/google/go-github/branch/master/graph/badge.svg)](https://codecov.io/gh/google/go-github) [![Discuss at go-github@googlegroups.com](https://img.shields.io/badge/discuss-go--github%40googlegroups.com-blue.svg)](https://groups.google.com/group/go-github) @@ -24,7 +24,7 @@ If you're interested in using the [GraphQL API v4][], the recommended library is go-github is compatible with modern Go releases in module mode, with Go installed: ```bash -go get github.com/google/go-github/v56 +go get github.com/google/go-github/v57 ``` will resolve and add the package to the current development module, along with its dependencies. @@ -32,7 +32,7 @@ will resolve and add the package to the current development module, along with i Alternatively the same can be achieved if you use import in a package: ```go -import "github.com/google/go-github/v56/github" +import "github.com/google/go-github/v57/github" ``` and run `go get` without parameters. @@ -40,13 +40,13 @@ and run `go get` without parameters. Finally, to use the top-of-trunk version of this repo, use the following command: ```bash -go get github.com/google/go-github/v56@master +go get github.com/google/go-github/v57@master ``` ## Usage ## ```go -import "github.com/google/go-github/v56/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) +import "github.com/google/go-github/v57/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled ``` @@ -117,7 +117,7 @@ import ( "net/http" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) func main() { @@ -296,7 +296,7 @@ For complete usage of go-github, see the full [package docs][]. [GitHub API v3]: https://docs.github.com/en/rest [personal access token]: https://github.com/blog/1509-personal-api-tokens -[package docs]: https://pkg.go.dev/github.com/google/go-github/v56/github +[package docs]: https://pkg.go.dev/github.com/google/go-github/v57/github [GraphQL API v4]: https://developer.github.com/v4/ [shurcooL/githubv4]: https://github.com/shurcooL/githubv4 [GitHub webhook events]: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads @@ -369,6 +369,7 @@ Versions prior to 48.2.0 are not listed. | go-github Version | GitHub v3 API Version | | ----------------- | --------------------- | +| 57.0.0 | 2022-11-28 | | 56.0.0 | 2022-11-28 | | 55.0.0 | 2022-11-28 | | 54.0.0 | 2022-11-28 | diff --git a/example/actionpermissions/main.go b/example/actionpermissions/main.go index 711906a1227..a37c0043209 100644 --- a/example/actionpermissions/main.go +++ b/example/actionpermissions/main.go @@ -14,7 +14,7 @@ import ( "log" "os" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) var ( diff --git a/example/appengine/app.go b/example/appengine/app.go index fff9807f7fa..496bca402b3 100644 --- a/example/appengine/app.go +++ b/example/appengine/app.go @@ -12,7 +12,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" "google.golang.org/appengine" "google.golang.org/appengine/log" ) diff --git a/example/basicauth/main.go b/example/basicauth/main.go index e9027efcbce..48f9170b5bc 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -21,7 +21,7 @@ import ( "os" "strings" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" "golang.org/x/term" ) diff --git a/example/codespaces/newreposecretwithxcrypto/main.go b/example/codespaces/newreposecretwithxcrypto/main.go index 68b67696cfb..da1dabab76d 100644 --- a/example/codespaces/newreposecretwithxcrypto/main.go +++ b/example/codespaces/newreposecretwithxcrypto/main.go @@ -36,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/codespaces/newusersecretwithxcrypto/main.go b/example/codespaces/newusersecretwithxcrypto/main.go index 9264aabad74..860c5161b77 100644 --- a/example/codespaces/newusersecretwithxcrypto/main.go +++ b/example/codespaces/newusersecretwithxcrypto/main.go @@ -37,7 +37,7 @@ import ( "log" "os" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index 15919277f91..9e4098c916b 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -33,7 +33,7 @@ import ( "time" "github.com/ProtonMail/go-crypto/openpgp" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) var ( diff --git a/example/go.mod b/example/go.mod index 6900dbaafa6..a2bfe50f63d 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v56/example +module github.com/google/go-github/v57/example go 1.17 @@ -6,7 +6,7 @@ require ( github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-ratelimit v1.0.3 - github.com/google/go-github/v56 v56.0.0 + github.com/google/go-github/v57 v57.0.0 golang.org/x/crypto v0.14.0 golang.org/x/term v0.13.0 google.golang.org/appengine v1.6.7 @@ -24,4 +24,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v56 => ../ +replace github.com/google/go-github/v57 => ../ diff --git a/example/listenvironments/main.go b/example/listenvironments/main.go index ec3e9878ffc..936f5470cf2 100644 --- a/example/listenvironments/main.go +++ b/example/listenvironments/main.go @@ -18,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) func main() { diff --git a/example/migrations/main.go b/example/migrations/main.go index 8304b75e962..81872e062f2 100644 --- a/example/migrations/main.go +++ b/example/migrations/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) func fetchAllUserMigrations() ([]*github.UserMigration, error) { diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index 36f56fca5f9..670021a99dd 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -16,7 +16,7 @@ import ( "time" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) func main() { diff --git a/example/newrepo/main.go b/example/newrepo/main.go index b2d0879c801..21cb7f52a9d 100644 --- a/example/newrepo/main.go +++ b/example/newrepo/main.go @@ -16,7 +16,7 @@ import ( "log" "os" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) var ( diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index 6f71c4f9ce0..81a013ee37a 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -4,8 +4,8 @@ go 1.15 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb - github.com/google/go-github/v56 v56.0.0 + github.com/google/go-github/v57 v57.0.0 ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v56 => ../.. +replace github.com/google/go-github/v57 => ../.. diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index aa9ea38a834..c022562d353 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -36,7 +36,7 @@ import ( "os" sodium "github.com/GoKillers/libsodium-go/cryptobox" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) var ( diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index 686b12e7a3c..b7366908e1c 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -36,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/ratelimit/main.go b/example/ratelimit/main.go index 9c07cf301b8..67a8b0de483 100644 --- a/example/ratelimit/main.go +++ b/example/ratelimit/main.go @@ -13,7 +13,7 @@ import ( "fmt" "github.com/gofri/go-github-ratelimit/github_ratelimit" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) func main() { diff --git a/example/simple/main.go b/example/simple/main.go index fcaddd6ae91..70206e7f00f 100644 --- a/example/simple/main.go +++ b/example/simple/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) // Fetch all the public organizations' membership of a user. diff --git a/example/tagprotection/main.go b/example/tagprotection/main.go index e0e494e7da8..40a00af2b0d 100644 --- a/example/tagprotection/main.go +++ b/example/tagprotection/main.go @@ -18,7 +18,7 @@ import ( "os" "strings" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" "golang.org/x/term" ) diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index 9d30ad79663..e27b72b1a0e 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -15,7 +15,7 @@ import ( "log" "os" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" "golang.org/x/term" ) diff --git a/example/topics/main.go b/example/topics/main.go index 80f5627672e..a23f1b3a0d7 100644 --- a/example/topics/main.go +++ b/example/topics/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) // Fetch and lists all the public topics associated with the specified GitHub topic diff --git a/github/doc.go b/github/doc.go index b10810d5338..ca00a4bd049 100644 --- a/github/doc.go +++ b/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v56/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v57/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to diff --git a/github/examples_test.go b/github/examples_test.go index 9338e0b6170..d1070be4663 100644 --- a/github/examples_test.go +++ b/github/examples_test.go @@ -12,7 +12,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) func ExampleMarkdownService_Render() { diff --git a/github/github.go b/github/github.go index c2706b0f10a..c248b256f6e 100644 --- a/github/github.go +++ b/github/github.go @@ -28,7 +28,7 @@ import ( ) const ( - Version = "v56.0.0" + Version = "v57.0.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" diff --git a/go.mod b/go.mod index 718bedab9d4..51c7c0e3327 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v56 +module github.com/google/go-github/v57 require ( github.com/google/go-cmp v0.6.0 diff --git a/test/fields/fields.go b/test/fields/fields.go index 3334569dd38..fc9f29672c5 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -25,7 +25,7 @@ import ( "reflect" "strings" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) var ( diff --git a/test/integration/activity_test.go b/test/integration/activity_test.go index 52c163c8a97..b32bb5a02f7 100644 --- a/test/integration/activity_test.go +++ b/test/integration/activity_test.go @@ -12,7 +12,7 @@ import ( "context" "testing" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) const ( diff --git a/test/integration/authorizations_test.go b/test/integration/authorizations_test.go index 66c7952a311..61ec0239feb 100644 --- a/test/integration/authorizations_test.go +++ b/test/integration/authorizations_test.go @@ -15,7 +15,7 @@ import ( "testing" "time" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) const msgEnvMissing = "Skipping test because the required environment variable (%v) is not present." diff --git a/test/integration/github_test.go b/test/integration/github_test.go index 2d297f0ede3..81753b6bbb8 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -15,7 +15,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) var ( diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index 39a99fef98f..a4ead783846 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -15,7 +15,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) func TestRepositories_CRUD(t *testing.T) { diff --git a/test/integration/users_test.go b/test/integration/users_test.go index d3a9abb0e80..448b5af7ffe 100644 --- a/test/integration/users_test.go +++ b/test/integration/users_test.go @@ -14,7 +14,7 @@ import ( "math/rand" "testing" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) func TestUsers_Get(t *testing.T) { diff --git a/tools/go.mod b/tools/go.mod index 40c58020a6c..25cef1fd110 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -6,7 +6,7 @@ require ( github.com/alecthomas/kong v0.8.1 github.com/getkin/kin-openapi v0.120.0 github.com/google/go-cmp v0.6.0 - github.com/google/go-github/v56 v56.0.0 + github.com/google/go-github/v57 v57.0.0 golang.org/x/sync v0.5.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -22,3 +22,6 @@ require ( github.com/perimeterx/marshmallow v1.1.5 // indirect github.com/stretchr/testify v1.8.4 // indirect ) + +// Use version at HEAD, not the latest published. +replace github.com/google/go-github/v57 => ../ diff --git a/tools/go.sum b/tools/go.sum index 7e8be0f06e5..099ce0450dd 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -17,8 +17,6 @@ github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v56 v56.0.0 h1:TysL7dMa/r7wsQi44BjqlwaHvwlFlqkK8CtBWCX3gb4= -github.com/google/go-github/v56 v56.0.0/go.mod h1:D8cdcX98YWJvi7TLo7zM4/h8ZTx6u6fwGEkCdisopo0= 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/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= diff --git a/tools/metadata/main.go b/tools/metadata/main.go index 0b0562948f0..1ab2b7d2d50 100644 --- a/tools/metadata/main.go +++ b/tools/metadata/main.go @@ -15,7 +15,7 @@ import ( "path/filepath" "github.com/alecthomas/kong" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) var helpVars = kong.Vars{ diff --git a/tools/metadata/main_test.go b/tools/metadata/main_test.go index 39fe5357d0f..17de07d79a0 100644 --- a/tools/metadata/main_test.go +++ b/tools/metadata/main_test.go @@ -23,7 +23,7 @@ import ( "github.com/alecthomas/kong" "github.com/getkin/kin-openapi/openapi3" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) func TestUpdateGo(t *testing.T) { diff --git a/tools/metadata/metadata.go b/tools/metadata/metadata.go index c60a1cfe215..079ff5c698b 100644 --- a/tools/metadata/metadata.go +++ b/tools/metadata/metadata.go @@ -24,7 +24,7 @@ import ( "strings" "sync" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" "gopkg.in/yaml.v3" ) diff --git a/tools/metadata/openapi.go b/tools/metadata/openapi.go index 4b858481f5e..0804a47020b 100644 --- a/tools/metadata/openapi.go +++ b/tools/metadata/openapi.go @@ -14,7 +14,7 @@ import ( "strconv" "github.com/getkin/kin-openapi/openapi3" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" "golang.org/x/sync/errgroup" ) From 062b6119e47d73486fe40193262708332f1dc9be Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Fri, 1 Dec 2023 12:55:17 -0500 Subject: [PATCH 359/751] Bump go-github from v56 to v57 in /scrape (#3010) --- scrape/apps.go | 2 +- scrape/apps_test.go | 2 +- scrape/go.mod | 2 +- scrape/go.sum | 5 ++--- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/scrape/apps.go b/scrape/apps.go index 851c4e1d2fb..0f26fe8f2e5 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -17,7 +17,7 @@ import ( "strings" "github.com/PuerkitoBio/goquery" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) // AppRestrictionsEnabled returns whether the specified organization has diff --git a/scrape/apps_test.go b/scrape/apps_test.go index 155056876b3..9b486e6a535 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) func Test_AppRestrictionsEnabled(t *testing.T) { diff --git a/scrape/go.mod b/scrape/go.mod index 05f87b6b3a3..08daf2365b9 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -5,7 +5,7 @@ go 1.13 require ( github.com/PuerkitoBio/goquery v1.8.1 github.com/google/go-cmp v0.6.0 - github.com/google/go-github/v56 v56.0.0 + github.com/google/go-github/v57 v57.0.0 github.com/xlzd/gotp v0.1.0 golang.org/x/net v0.19.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index 907678b1c1d..44051859775 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -3,11 +3,10 @@ github.com/PuerkitoBio/goquery v1.8.1/go.mod h1:Q8ICL1kNUJ2sXGoAhPGUdYDJvgQgHzJs github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c= github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v56 v56.0.0 h1:TysL7dMa/r7wsQi44BjqlwaHvwlFlqkK8CtBWCX3gb4= -github.com/google/go-github/v56 v56.0.0/go.mod h1:D8cdcX98YWJvi7TLo7zM4/h8ZTx6u6fwGEkCdisopo0= +github.com/google/go-github/v57 v57.0.0 h1:L+Y3UPTY8ALM8x+TV0lg+IEBI+upibemtBD8Q9u7zHs= +github.com/google/go-github/v57 v57.0.0/go.mod h1:s0omdnye0hvK/ecLvpsGfJMiRt85PimQh4oygmLIxHw= 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.1.0 h1:37blvlKCh38s+fkem+fFh7sMnceltoIEBYTVXyoa5Po= From 1e66201027e8c106a1915fdaf44a63513f317409 Mon Sep 17 00:00:00 2001 From: WillAbides <233500+WillAbides@users.noreply.github.com> Date: Sat, 2 Dec 2023 15:47:01 -0600 Subject: [PATCH 360/751] Update metadata (#3012) --- github/admin.go | 4 +- github/admin_orgs.go | 6 +- github/admin_stats.go | 2 +- github/admin_users.go | 8 +- github/authorizations.go | 4 +- github/orgs_properties.go | 14 +- github/repos_hooks.go | 14 +- github/repos_hooks_configuration.go | 4 +- github/repos_hooks_deliveries.go | 6 +- github/repos_prereceive_hooks.go | 8 +- github/users_administration.go | 8 +- openapi_operations.yaml | 2185 ++++++++++++++------------- 12 files changed, 1176 insertions(+), 1087 deletions(-) diff --git a/github/admin.go b/github/admin.go index 8eee9854c11..c1f7066c7ad 100644 --- a/github/admin.go +++ b/github/admin.go @@ -82,7 +82,7 @@ func (m Enterprise) String() string { // UpdateUserLDAPMapping updates the mapping between a GitHub user and an LDAP user. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user // //meta:operation PATCH /admin/ldap/users/{username}/mapping func (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, mapping *UserLDAPMapping) (*UserLDAPMapping, *Response, error) { @@ -103,7 +103,7 @@ func (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, m // UpdateTeamLDAPMapping updates the mapping between a GitHub team and an LDAP group. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team // //meta:operation PATCH /admin/ldap/teams/{team_id}/mapping func (s *AdminService) UpdateTeamLDAPMapping(ctx context.Context, team int64, mapping *TeamLDAPMapping) (*TeamLDAPMapping, *Response, error) { diff --git a/github/admin_orgs.go b/github/admin_orgs.go index c734d4de12f..e1b3641e003 100644 --- a/github/admin_orgs.go +++ b/github/admin_orgs.go @@ -22,7 +22,7 @@ type createOrgRequest struct { // Note that only a subset of the org fields are used and org must // not be nil. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/orgs#create-an-organization +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/orgs#create-an-organization // //meta:operation POST /admin/organizations func (s *AdminService) CreateOrg(ctx context.Context, org *Organization, admin string) (*Organization, *Response, error) { @@ -61,7 +61,7 @@ type RenameOrgResponse struct { // RenameOrg renames an organization in GitHub Enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/orgs#update-an-organization-name +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/orgs#update-an-organization-name // //meta:operation PATCH /admin/organizations/{org} func (s *AdminService) RenameOrg(ctx context.Context, org *Organization, newName string) (*RenameOrgResponse, *Response, error) { @@ -70,7 +70,7 @@ func (s *AdminService) RenameOrg(ctx context.Context, org *Organization, newName // RenameOrgByName renames an organization in GitHub Enterprise using its current name. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/orgs#update-an-organization-name +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/orgs#update-an-organization-name // //meta:operation PATCH /admin/organizations/{org} func (s *AdminService) RenameOrgByName(ctx context.Context, org, newName string) (*RenameOrgResponse, *Response, error) { diff --git a/github/admin_stats.go b/github/admin_stats.go index aa23f5d1995..f26b393e02f 100644 --- a/github/admin_stats.go +++ b/github/admin_stats.go @@ -152,7 +152,7 @@ func (s RepoStats) String() string { // Please note that this is only available to site administrators, // otherwise it will error with a 404 not found (instead of 401 or 403). // -// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-all-statistics +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-all-statistics // //meta:operation GET /enterprise/stats/all func (s *AdminService) GetAdminStats(ctx context.Context) (*AdminStats, *Response, error) { diff --git a/github/admin_users.go b/github/admin_users.go index 3916a470b04..0d3fe9fafc1 100644 --- a/github/admin_users.go +++ b/github/admin_users.go @@ -19,7 +19,7 @@ type createUserRequest struct { // CreateUser creates a new user in GitHub Enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#create-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#create-a-user // //meta:operation POST /admin/users func (s *AdminService) CreateUser(ctx context.Context, login, email string) (*User, *Response, error) { @@ -46,7 +46,7 @@ func (s *AdminService) CreateUser(ctx context.Context, login, email string) (*Us // DeleteUser deletes a user in GitHub Enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#delete-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#delete-a-user // //meta:operation DELETE /admin/users/{username} func (s *AdminService) DeleteUser(ctx context.Context, username string) (*Response, error) { @@ -99,7 +99,7 @@ type UserAuthorization struct { // CreateUserImpersonation creates an impersonation OAuth token. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#create-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#create-an-impersonation-oauth-token // //meta:operation POST /admin/users/{username}/authorizations func (s *AdminService) CreateUserImpersonation(ctx context.Context, username string, opts *ImpersonateUserOptions) (*UserAuthorization, *Response, error) { @@ -121,7 +121,7 @@ func (s *AdminService) CreateUserImpersonation(ctx context.Context, username str // DeleteUserImpersonation deletes an impersonation OAuth token. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#delete-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#delete-an-impersonation-oauth-token // //meta:operation DELETE /admin/users/{username}/authorizations func (s *AdminService) DeleteUserImpersonation(ctx context.Context, username string) (*Response, error) { diff --git a/github/authorizations.go b/github/authorizations.go index 7adc5323678..931b77299b0 100644 --- a/github/authorizations.go +++ b/github/authorizations.go @@ -257,7 +257,7 @@ func (s *AuthorizationsService) DeleteGrant(ctx context.Context, clientID, acces // you can e.g. create or delete a user's public SSH key. NOTE: creating a // new token automatically revokes an existing one. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#create-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#create-an-impersonation-oauth-token // //meta:operation POST /admin/users/{username}/authorizations func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, username string, authReq *AuthorizationRequest) (*Authorization, *Response, error) { @@ -279,7 +279,7 @@ func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, usernam // // NOTE: there can be only one at a time. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#delete-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#delete-an-impersonation-oauth-token // //meta:operation DELETE /admin/users/{username}/authorizations func (s *AuthorizationsService) DeleteImpersonation(ctx context.Context, username string) (*Response, error) { diff --git a/github/orgs_properties.go b/github/orgs_properties.go index 1daac811804..45e3f1f964d 100644 --- a/github/orgs_properties.go +++ b/github/orgs_properties.go @@ -39,7 +39,7 @@ type CustomPropertyValue struct { // GetAllCustomProperties gets all custom properties that are defined for the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/properties#get-all-custom-properties-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#get-all-custom-properties-for-an-organization // //meta:operation GET /orgs/{org}/properties/schema func (s *OrganizationsService) GetAllCustomProperties(ctx context.Context, org string) ([]*CustomProperty, *Response, error) { @@ -61,7 +61,7 @@ func (s *OrganizationsService) GetAllCustomProperties(ctx context.Context, org s // CreateOrUpdateCustomProperties creates new or updates existing custom properties that are defined for the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/properties#create-or-update-custom-properties-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-properties-for-an-organization // //meta:operation PATCH /orgs/{org}/properties/schema func (s *OrganizationsService) CreateOrUpdateCustomProperties(ctx context.Context, org string, properties []*CustomProperty) ([]*CustomProperty, *Response, error) { @@ -89,7 +89,7 @@ func (s *OrganizationsService) CreateOrUpdateCustomProperties(ctx context.Contex // GetCustomProperty gets a custom property that is defined for the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/properties#get-a-custom-property-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#get-a-custom-property-for-an-organization // //meta:operation GET /orgs/{org}/properties/schema/{custom_property_name} func (s *OrganizationsService) GetCustomProperty(ctx context.Context, org, name string) (*CustomProperty, *Response, error) { @@ -111,7 +111,7 @@ func (s *OrganizationsService) GetCustomProperty(ctx context.Context, org, name // CreateOrUpdateCustomProperty creates a new or updates an existing custom property that is defined for the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/properties#create-or-update-a-custom-property-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#create-or-update-a-custom-property-for-an-organization // //meta:operation PUT /orgs/{org}/properties/schema/{custom_property_name} func (s *OrganizationsService) CreateOrUpdateCustomProperty(ctx context.Context, org, customPropertyName string, property *CustomProperty) (*CustomProperty, *Response, error) { @@ -133,7 +133,7 @@ func (s *OrganizationsService) CreateOrUpdateCustomProperty(ctx context.Context, // RemoveCustomProperty removes a custom property that is defined for the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/properties#remove-a-custom-property-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#remove-a-custom-property-for-an-organization // //meta:operation DELETE /orgs/{org}/properties/schema/{custom_property_name} func (s *OrganizationsService) RemoveCustomProperty(ctx context.Context, org, customPropertyName string) (*Response, error) { @@ -149,7 +149,7 @@ func (s *OrganizationsService) RemoveCustomProperty(ctx context.Context, org, cu // ListCustomPropertyValues lists all custom property values for repositories in the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/properties#list-custom-property-values-for-organization-repositories +// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#list-custom-property-values-for-organization-repositories // //meta:operation GET /orgs/{org}/properties/values func (s *OrganizationsService) ListCustomPropertyValues(ctx context.Context, org string, opts *ListOptions) ([]*RepoCustomPropertyValue, *Response, error) { @@ -175,7 +175,7 @@ func (s *OrganizationsService) ListCustomPropertyValues(ctx context.Context, org // CreateOrUpdateRepoCustomPropertyValues creates new or updates existing custom property values across multiple repositories for the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/properties#create-or-update-custom-property-values-for-organization-repositories +// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-property-values-for-organization-repositories // //meta:operation PATCH /orgs/{org}/properties/values func (s *OrganizationsService) CreateOrUpdateRepoCustomPropertyValues(ctx context.Context, org string, repoNames []string, properties []*CustomProperty) (*Response, error) { diff --git a/github/repos_hooks.go b/github/repos_hooks.go index 8768d603d2b..3edf6475666 100644 --- a/github/repos_hooks.go +++ b/github/repos_hooks.go @@ -79,7 +79,7 @@ type createHookRequest struct { // Note that only a subset of the hook fields are used and hook must // not be nil. // -// GitHub API docs: https://docs.github.com/rest/webhooks/repos#create-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks#create-a-repository-webhook // //meta:operation POST /repos/{owner}/{repo}/hooks func (s *RepositoriesService) CreateHook(ctx context.Context, owner, repo string, hook *Hook) (*Hook, *Response, error) { @@ -108,7 +108,7 @@ func (s *RepositoriesService) CreateHook(ctx context.Context, owner, repo string // ListHooks lists all Hooks for the specified repository. // -// GitHub API docs: https://docs.github.com/rest/webhooks/repos#list-repository-webhooks +// GitHub API docs: https://docs.github.com/rest/repos/webhooks#list-repository-webhooks // //meta:operation GET /repos/{owner}/{repo}/hooks func (s *RepositoriesService) ListHooks(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Hook, *Response, error) { @@ -134,7 +134,7 @@ func (s *RepositoriesService) ListHooks(ctx context.Context, owner, repo string, // GetHook returns a single specified Hook. // -// GitHub API docs: https://docs.github.com/rest/webhooks/repos#get-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks#get-a-repository-webhook // //meta:operation GET /repos/{owner}/{repo}/hooks/{hook_id} func (s *RepositoriesService) GetHook(ctx context.Context, owner, repo string, id int64) (*Hook, *Response, error) { @@ -154,7 +154,7 @@ func (s *RepositoriesService) GetHook(ctx context.Context, owner, repo string, i // EditHook updates a specified Hook. // -// GitHub API docs: https://docs.github.com/rest/webhooks/repos#update-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks#update-a-repository-webhook // //meta:operation PATCH /repos/{owner}/{repo}/hooks/{hook_id} func (s *RepositoriesService) EditHook(ctx context.Context, owner, repo string, id int64, hook *Hook) (*Hook, *Response, error) { @@ -174,7 +174,7 @@ func (s *RepositoriesService) EditHook(ctx context.Context, owner, repo string, // DeleteHook deletes a specified Hook. // -// GitHub API docs: https://docs.github.com/rest/webhooks/repos#delete-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks#delete-a-repository-webhook // //meta:operation DELETE /repos/{owner}/{repo}/hooks/{hook_id} func (s *RepositoriesService) DeleteHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { @@ -188,7 +188,7 @@ func (s *RepositoriesService) DeleteHook(ctx context.Context, owner, repo string // PingHook triggers a 'ping' event to be sent to the Hook. // -// GitHub API docs: https://docs.github.com/rest/webhooks/repos#ping-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks#ping-a-repository-webhook // //meta:operation POST /repos/{owner}/{repo}/hooks/{hook_id}/pings func (s *RepositoriesService) PingHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { @@ -202,7 +202,7 @@ func (s *RepositoriesService) PingHook(ctx context.Context, owner, repo string, // TestHook triggers a test Hook by github. // -// GitHub API docs: https://docs.github.com/rest/webhooks/repos#test-the-push-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks#test-the-push-repository-webhook // //meta:operation POST /repos/{owner}/{repo}/hooks/{hook_id}/tests func (s *RepositoriesService) TestHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { diff --git a/github/repos_hooks_configuration.go b/github/repos_hooks_configuration.go index 2203d7614f5..b58eb248e44 100644 --- a/github/repos_hooks_configuration.go +++ b/github/repos_hooks_configuration.go @@ -12,7 +12,7 @@ import ( // GetHookConfiguration returns the configuration for the specified repository webhook. // -// GitHub API docs: https://docs.github.com/rest/webhooks/repo-config#get-a-webhook-configuration-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/webhooks#get-a-webhook-configuration-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/hooks/{hook_id}/config func (s *RepositoriesService) GetHookConfiguration(ctx context.Context, owner, repo string, id int64) (*HookConfig, *Response, error) { @@ -33,7 +33,7 @@ func (s *RepositoriesService) GetHookConfiguration(ctx context.Context, owner, r // EditHookConfiguration updates the configuration for the specified repository webhook. // -// GitHub API docs: https://docs.github.com/rest/webhooks/repo-config#update-a-webhook-configuration-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/webhooks#update-a-webhook-configuration-for-a-repository // //meta:operation PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config func (s *RepositoriesService) EditHookConfiguration(ctx context.Context, owner, repo string, id int64, config *HookConfig) (*HookConfig, *Response, error) { diff --git a/github/repos_hooks_deliveries.go b/github/repos_hooks_deliveries.go index 6e1fd86f99b..c8029f626b9 100644 --- a/github/repos_hooks_deliveries.go +++ b/github/repos_hooks_deliveries.go @@ -63,7 +63,7 @@ func (r HookResponse) String() string { // ListHookDeliveries lists webhook deliveries for a webhook configured in a repository. // -// GitHub API docs: https://docs.github.com/rest/webhooks/repo-deliveries#list-deliveries-for-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks#list-deliveries-for-a-repository-webhook // //meta:operation GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries func (s *RepositoriesService) ListHookDeliveries(ctx context.Context, owner, repo string, id int64, opts *ListCursorOptions) ([]*HookDelivery, *Response, error) { @@ -89,7 +89,7 @@ func (s *RepositoriesService) ListHookDeliveries(ctx context.Context, owner, rep // GetHookDelivery returns a delivery for a webhook configured in a repository. // -// GitHub API docs: https://docs.github.com/rest/webhooks/repo-deliveries#get-a-delivery-for-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks#get-a-delivery-for-a-repository-webhook // //meta:operation GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id} func (s *RepositoriesService) GetHookDelivery(ctx context.Context, owner, repo string, hookID, deliveryID int64) (*HookDelivery, *Response, error) { @@ -110,7 +110,7 @@ func (s *RepositoriesService) GetHookDelivery(ctx context.Context, owner, repo s // RedeliverHookDelivery redelivers a delivery for a webhook configured in a repository. // -// GitHub API docs: https://docs.github.com/rest/webhooks/repo-deliveries#redeliver-a-delivery-for-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks#redeliver-a-delivery-for-a-repository-webhook // //meta:operation POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts func (s *RepositoriesService) RedeliverHookDelivery(ctx context.Context, owner, repo string, hookID, deliveryID int64) (*HookDelivery, *Response, error) { diff --git a/github/repos_prereceive_hooks.go b/github/repos_prereceive_hooks.go index e8361383f57..b1d3f3c818d 100644 --- a/github/repos_prereceive_hooks.go +++ b/github/repos_prereceive_hooks.go @@ -24,7 +24,7 @@ func (p PreReceiveHook) String() string { // ListPreReceiveHooks lists all pre-receive hooks for the specified repository. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/pre-receive-hooks func (s *RepositoriesService) ListPreReceiveHooks(ctx context.Context, owner, repo string, opts *ListOptions) ([]*PreReceiveHook, *Response, error) { @@ -53,7 +53,7 @@ func (s *RepositoriesService) ListPreReceiveHooks(ctx context.Context, owner, re // GetPreReceiveHook returns a single specified pre-receive hook. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) GetPreReceiveHook(ctx context.Context, owner, repo string, id int64) (*PreReceiveHook, *Response, error) { @@ -77,7 +77,7 @@ func (s *RepositoriesService) GetPreReceiveHook(ctx context.Context, owner, repo // UpdatePreReceiveHook updates a specified pre-receive hook. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository // //meta:operation PATCH /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) UpdatePreReceiveHook(ctx context.Context, owner, repo string, id int64, hook *PreReceiveHook) (*PreReceiveHook, *Response, error) { @@ -101,7 +101,7 @@ func (s *RepositoriesService) UpdatePreReceiveHook(ctx context.Context, owner, r // DeletePreReceiveHook deletes a specified pre-receive hook. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository // //meta:operation DELETE /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) DeletePreReceiveHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { diff --git a/github/users_administration.go b/github/users_administration.go index 02cb894bc3b..5b9e1de8c60 100644 --- a/github/users_administration.go +++ b/github/users_administration.go @@ -12,7 +12,7 @@ import ( // PromoteSiteAdmin promotes a user to a site administrator of a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator // //meta:operation PUT /users/{username}/site_admin func (s *UsersService) PromoteSiteAdmin(ctx context.Context, user string) (*Response, error) { @@ -28,7 +28,7 @@ func (s *UsersService) PromoteSiteAdmin(ctx context.Context, user string) (*Resp // DemoteSiteAdmin demotes a user from site administrator of a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#demote-a-site-administrator +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#demote-a-site-administrator // //meta:operation DELETE /users/{username}/site_admin func (s *UsersService) DemoteSiteAdmin(ctx context.Context, user string) (*Response, error) { @@ -49,7 +49,7 @@ type UserSuspendOptions struct { // Suspend a user on a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#suspend-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#suspend-a-user // //meta:operation PUT /users/{username}/suspended func (s *UsersService) Suspend(ctx context.Context, user string, opts *UserSuspendOptions) (*Response, error) { @@ -65,7 +65,7 @@ func (s *UsersService) Suspend(ctx context.Context, user string, opts *UserSuspe // Unsuspend a user on a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#unsuspend-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#unsuspend-a-user // //meta:operation DELETE /users/{username}/suspended func (s *UsersService) Unsuspend(ctx context.Context, user string) (*Response, error) { diff --git a/openapi_operations.yaml b/openapi_operations.yaml index f2b1af28843..53fe8c5fe52 100644 --- a/openapi_operations.yaml +++ b/openapi_operations.yaml @@ -48,258 +48,260 @@ operation_overrides: documentation_url: https://docs.github.com/rest/pages/pages#request-a-github-pages-build - name: GET /repos/{owner}/{repo}/pages/builds/{build_id} documentation_url: https://docs.github.com/rest/pages/pages#get-github-pages-build -openapi_commit: c86f07e1ca0d543d0b8fc7591991b02767e02deb +openapi_commit: 6922a6cfe785e1069e93d6e501805cf6e1891076 openapi_operations: - name: GET / documentation_url: https://docs.github.com/rest/meta/meta#github-api-root openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /admin/hooks - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/global-webhooks#list-global-webhooks + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/global-webhooks#list-global-webhooks openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /admin/hooks - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/global-webhooks#create-a-global-webhook + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/global-webhooks#create-a-global-webhook openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /admin/hooks/{hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/global-webhooks#delete-a-global-webhook + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/global-webhooks#delete-a-global-webhook openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /admin/hooks/{hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/global-webhooks#get-a-global-webhook + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/global-webhooks#get-a-global-webhook openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /admin/hooks/{hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/global-webhooks#update-a-global-webhook + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/global-webhooks#update-a-global-webhook openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /admin/hooks/{hook_id}/pings - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/global-webhooks#ping-a-global-webhook + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/global-webhooks#ping-a-global-webhook openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /admin/keys - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#list-public-keys + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#list-public-keys openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /admin/keys/{key_ids} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#delete-a-public-key + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#delete-a-public-key openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /admin/ldap/teams/{team_id}/mapping - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /admin/ldap/teams/{team_id}/sync - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/ldap#sync-ldap-mapping-for-a-team + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/ldap#sync-ldap-mapping-for-a-team openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /admin/ldap/users/{username}/mapping - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /admin/ldap/users/{username}/sync - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/ldap#sync-ldap-mapping-for-a-user + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/ldap#sync-ldap-mapping-for-a-user openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /admin/organizations - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/orgs#create-an-organization + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/orgs#create-an-organization openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /admin/organizations/{org} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/orgs#update-an-organization-name + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/orgs#update-an-organization-name openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /admin/pre-receive-environments - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-environments#list-pre-receive-environments + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-environments#list-pre-receive-environments openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /admin/pre-receive-environments - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-environments#create-a-pre-receive-environment + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-environments#create-a-pre-receive-environment openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /admin/pre-receive-environments/{pre_receive_environment_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-environments#delete-a-pre-receive-environment + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-environments#delete-a-pre-receive-environment openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /admin/pre-receive-environments/{pre_receive_environment_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-environments#get-a-pre-receive-environment + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-environments#get-a-pre-receive-environment openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /admin/pre-receive-environments/{pre_receive_environment_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-environments#update-a-pre-receive-environment + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-environments#update-a-pre-receive-environment openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /admin/pre-receive-environments/{pre_receive_environment_id}/downloads - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-environments#start-a-pre-receive-environment-download + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-environments#start-a-pre-receive-environment-download openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /admin/pre-receive-environments/{pre_receive_environment_id}/downloads/latest - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-environments#get-the-download-status-for-a-pre-receive-environment + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-environments#get-the-download-status-for-a-pre-receive-environment openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /admin/pre-receive-hooks - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-hooks#list-pre-receive-hooks + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-hooks#list-pre-receive-hooks openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /admin/pre-receive-hooks - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-hooks#create-a-pre-receive-hook + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-hooks#create-a-pre-receive-hook openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /admin/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-hooks#delete-a-pre-receive-hook + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-hooks#delete-a-pre-receive-hook openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /admin/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-hooks#get-a-pre-receive-hook + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-hooks#get-a-pre-receive-hook openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /admin/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-hooks#update-a-pre-receive-hook + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-hooks#update-a-pre-receive-hook openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /admin/tokens - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#list-personal-access-tokens + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#list-personal-access-tokens openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /admin/tokens/{token_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#delete-a-personal-access-token + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#delete-a-personal-access-token openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /admin/users - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#create-a-user + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#create-a-user openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /admin/users/{username} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#delete-a-user + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#delete-a-user openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /admin/users/{username} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#update-the-username-for-a-user + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#update-the-username-for-a-user openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /admin/users/{username}/authorizations - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#delete-an-impersonation-oauth-token + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#delete-an-impersonation-oauth-token openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /admin/users/{username}/authorizations - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#create-an-impersonation-oauth-token + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#create-an-impersonation-oauth-token openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /advisories documentation_url: https://docs.github.com/rest/security-advisories/global-advisories#list-global-security-advisories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /advisories/{ghsa_id} documentation_url: https://docs.github.com/rest/security-advisories/global-advisories#get-a-global-security-advisory openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /app documentation_url: https://docs.github.com/rest/apps/apps#get-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /app-manifests/{code}/conversions documentation_url: https://docs.github.com/rest/apps/apps#create-a-github-app-from-a-manifest openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /app/hook/config documentation_url: https://docs.github.com/rest/apps/webhooks#get-a-webhook-configuration-for-an-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /app/hook/config documentation_url: https://docs.github.com/rest/apps/webhooks#update-a-webhook-configuration-for-an-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /app/hook/deliveries documentation_url: https://docs.github.com/rest/apps/webhooks#list-deliveries-for-an-app-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /app/hook/deliveries/{delivery_id} documentation_url: https://docs.github.com/rest/apps/webhooks#get-a-delivery-for-an-app-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /app/hook/deliveries/{delivery_id}/attempts documentation_url: https://docs.github.com/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /app/installation-requests documentation_url: https://docs.github.com/rest/apps/apps#list-installation-requests-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /app/installations documentation_url: https://docs.github.com/rest/apps/apps#list-installations-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /app/installations/{installation_id} documentation_url: https://docs.github.com/rest/apps/apps#delete-an-installation-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /app/installations/{installation_id} documentation_url: https://docs.github.com/rest/apps/apps#get-an-installation-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /app/installations/{installation_id}/access_tokens documentation_url: https://docs.github.com/rest/apps/apps#create-an-installation-access-token-for-an-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /app/installations/{installation_id}/suspended documentation_url: https://docs.github.com/rest/apps/apps#unsuspend-an-app-installation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /app/installations/{installation_id}/suspended documentation_url: https://docs.github.com/rest/apps/apps#suspend-an-app-installation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /applications/grants - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#list-your-grants + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/oauth-authorizations/oauth-authorizations#list-your-grants openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /applications/grants/{grant_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#delete-a-grant + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/oauth-authorizations/oauth-authorizations#delete-a-grant openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /applications/grants/{grant_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#get-a-single-grant + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/oauth-authorizations/oauth-authorizations#get-a-single-grant openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /applications/{client_id}/grant documentation_url: https://docs.github.com/rest/apps/oauth-applications#delete-an-app-authorization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /applications/{client_id}/grants/{access_token} documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#revoke-a-grant-for-an-application openapi_files: @@ -309,25 +311,25 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /applications/{client_id}/token documentation_url: https://docs.github.com/rest/apps/oauth-applications#reset-a-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /applications/{client_id}/token documentation_url: https://docs.github.com/rest/apps/oauth-applications#check-a-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /applications/{client_id}/token/scoped documentation_url: https://docs.github.com/rest/apps/apps#create-a-scoped-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /applications/{client_id}/tokens/{access_token} documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#revoke-an-authorization-for-an-application openapi_files: @@ -345,7 +347,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /assignments/{assignment_id} documentation_url: https://docs.github.com/rest/classroom/classroom#get-an-assignment openapi_files: @@ -362,33 +364,33 @@ openapi_operations: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: GET /authorizations - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#list-your-authorizations + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/oauth-authorizations/oauth-authorizations#list-your-authorizations openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /authorizations - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#create-a-new-authorization + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/oauth-authorizations/oauth-authorizations#create-a-new-authorization openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /authorizations/clients/{client_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/oauth-authorizations/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /authorizations/clients/{client_id}/{fingerprint} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app-and-fingerprint + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/oauth-authorizations/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app-and-fingerprint openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /authorizations/{authorization_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#delete-an-authorization + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/oauth-authorizations/oauth-authorizations#delete-an-authorization openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /authorizations/{authorization_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#get-a-single-authorization + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/oauth-authorizations/oauth-authorizations#get-a-single-authorization openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /authorizations/{authorization_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#update-an-existing-authorization + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/oauth-authorizations/oauth-authorizations#update-an-existing-authorization openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /classrooms documentation_url: https://docs.github.com/rest/classroom/classroom#list-classrooms openapi_files: @@ -409,100 +411,100 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /codes_of_conduct/{key} documentation_url: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-a-code-of-conduct openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /emojis documentation_url: https://docs.github.com/rest/emojis/emojis#get-emojis openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprise-installation/{enterprise_or_org}/server-statistics documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/admin-stats#get-github-enterprise-server-statistics openapi_files: - descriptions/ghec/ghec.json - name: DELETE /enterprise/announcement - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/announcement#remove-the-global-announcement-banner + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/announcement#remove-the-global-announcement-banner openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprise/announcement - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/announcement#get-the-global-announcement-banner + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/announcement#get-the-global-announcement-banner openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /enterprise/announcement - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/announcement#set-the-global-announcement-banner + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/announcement#set-the-global-announcement-banner openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprise/settings/license - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/license#get-license-information + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/license#get-license-information openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprise/stats/all - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-all-statistics + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-all-statistics openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprise/stats/comments - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-comment-statistics + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-comment-statistics openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprise/stats/gists - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-gist-statistics + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-gist-statistics openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprise/stats/hooks - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-hooks-statistics + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-hooks-statistics openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprise/stats/issues - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-issue-statistics + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-issue-statistics openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprise/stats/milestones - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-milestone-statistics + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-milestone-statistics openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprise/stats/orgs - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-organization-statistics + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-organization-statistics openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprise/stats/pages - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-pages-statistics + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-pages-statistics openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprise/stats/pulls - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-pull-request-statistics + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-pull-request-statistics openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprise/stats/repos - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-repository-statistics + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-repository-statistics openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprise/stats/security-products - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-security-products-statistics + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-security-products-statistics openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprise/stats/users - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-users-statistics + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-users-statistics openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/actions/cache/usage documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/cache#get-github-actions-cache-usage-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/actions/cache/usage-policy - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/actions/cache#get-github-actions-cache-usage-policy-for-an-enterprise + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/actions/cache#get-github-actions-cache-usage-policy-for-an-enterprise openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /enterprises/{enterprise}/actions/cache/usage-policy - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/actions/cache#set-github-actions-cache-usage-policy-for-an-enterprise + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/actions/cache#set-github-actions-cache-usage-policy-for-an-enterprise openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /enterprises/{enterprise}/actions/oidc/customization/issuer documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/oidc#set-the-github-actions-oidc-custom-issuer-policy-for-an-enterprise openapi_files: @@ -511,177 +513,177 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-github-actions-permissions-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /enterprises/{enterprise}/actions/permissions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-github-actions-permissions-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/actions/permissions/organizations documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#list-selected-organizations-enabled-for-github-actions-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /enterprises/{enterprise}/actions/permissions/organizations documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-selected-organizations-enabled-for-github-actions-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#disable-a-selected-organization-for-github-actions-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#enable-a-selected-organization-for-github-actions-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/actions/permissions/selected-actions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /enterprises/{enterprise}/actions/permissions/selected-actions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/actions/permissions/workflow documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-default-workflow-permissions-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /enterprises/{enterprise}/actions/permissions/workflow documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-default-workflow-permissions-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/actions/runner-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /enterprises/{enterprise}/actions/runner-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-organization-access-to-a-self-hosted-runner-group-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-organization-access-for-a-self-hosted-runner-group-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-organization-access-to-a-self-hosted-runner-group-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-organization-access-to-a-self-hosted-runner-group-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/actions/runners documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/actions/runners/downloads documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#list-runner-applications-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /enterprises/{enterprise}/actions/runners/generate-jitconfig documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /enterprises/{enterprise}/actions/runners/registration-token documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#create-a-registration-token-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /enterprises/{enterprise}/actions/runners/remove-token documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#create-a-remove-token-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /enterprises/{enterprise}/actions/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/actions/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /enterprises/{enterprise}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /enterprises/{enterprise}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels/{name} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#remove-a-custom-label-from-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /enterprises/{enterprise}/announcement documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/enterprises#remove-announcement-banner-from-enterprise openapi_files: @@ -698,22 +700,22 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#get-the-audit-log-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/code-scanning/alerts documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/code_security_and_analysis documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#get-code-security-and-analysis-features-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /enterprises/{enterprise}/code_security_and_analysis documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#update-code-security-and-analysis-features-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/consumed-licenses documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/license#list-enterprise-consumed-licenses openapi_files: @@ -723,7 +725,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/license-sync-status documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/license#get-a-license-sync-status openapi_files: @@ -733,7 +735,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/settings/billing/actions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#get-github-actions-billing-for-an-enterprise openapi_files: @@ -742,7 +744,7 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#get-github-advanced-security-active-committers-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/settings/billing/packages documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#get-github-packages-billing-for-an-enterprise openapi_files: @@ -755,207 +757,207 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#enable-or-disable-a-security-feature openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /events documentation_url: https://docs.github.com/rest/activity/events#list-public-events openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /feeds documentation_url: https://docs.github.com/rest/activity/feeds#get-feeds openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /gists documentation_url: https://docs.github.com/rest/gists/gists#list-gists-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /gists documentation_url: https://docs.github.com/rest/gists/gists#create-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /gists/public documentation_url: https://docs.github.com/rest/gists/gists#list-public-gists openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /gists/starred documentation_url: https://docs.github.com/rest/gists/gists#list-starred-gists openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /gists/{gist_id} documentation_url: https://docs.github.com/rest/gists/gists#delete-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /gists/{gist_id} documentation_url: https://docs.github.com/rest/gists/gists#get-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /gists/{gist_id} documentation_url: https://docs.github.com/rest/gists/gists#update-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /gists/{gist_id}/comments documentation_url: https://docs.github.com/rest/gists/comments#list-gist-comments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /gists/{gist_id}/comments documentation_url: https://docs.github.com/rest/gists/comments#create-a-gist-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /gists/{gist_id}/comments/{comment_id} documentation_url: https://docs.github.com/rest/gists/comments#delete-a-gist-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /gists/{gist_id}/comments/{comment_id} documentation_url: https://docs.github.com/rest/gists/comments#get-a-gist-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /gists/{gist_id}/comments/{comment_id} documentation_url: https://docs.github.com/rest/gists/comments#update-a-gist-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /gists/{gist_id}/commits documentation_url: https://docs.github.com/rest/gists/gists#list-gist-commits openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /gists/{gist_id}/forks documentation_url: https://docs.github.com/rest/gists/gists#list-gist-forks openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /gists/{gist_id}/forks documentation_url: https://docs.github.com/rest/gists/gists#fork-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /gists/{gist_id}/star documentation_url: https://docs.github.com/rest/gists/gists#unstar-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /gists/{gist_id}/star documentation_url: https://docs.github.com/rest/gists/gists#check-if-a-gist-is-starred openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /gists/{gist_id}/star documentation_url: https://docs.github.com/rest/gists/gists#star-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /gists/{gist_id}/{sha} documentation_url: https://docs.github.com/rest/gists/gists#get-a-gist-revision openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /gitignore/templates documentation_url: https://docs.github.com/rest/gitignore/gitignore#get-all-gitignore-templates openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /gitignore/templates/{name} documentation_url: https://docs.github.com/rest/gitignore/gitignore#get-a-gitignore-template openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /installation/repositories documentation_url: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-app-installation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /installation/token documentation_url: https://docs.github.com/rest/apps/installations#revoke-an-installation-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /issues documentation_url: https://docs.github.com/rest/issues/issues#list-issues-assigned-to-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /licenses documentation_url: https://docs.github.com/rest/licenses/licenses#get-all-commonly-used-licenses openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /licenses/{license} documentation_url: https://docs.github.com/rest/licenses/licenses#get-a-license openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /manage/v1/config/nodes - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/manage-ghes#get-ghes-node-metadata-for-all-nodes + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/manage-ghes#get-ghes-node-metadata-for-all-nodes openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /manage/v1/maintenance - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/manage-ghes#get-the-status-of-maintenance-mode + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/manage-ghes#get-the-status-of-maintenance-mode openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /manage/v1/maintenance - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/manage-ghes#set-the-status-of-maintenance-mode + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/manage-ghes#set-the-status-of-maintenance-mode openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /manage/v1/replication/status - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-replica-nodes + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-replica-nodes openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /manage/v1/version - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/manage-ghes#get-all-ghes-release-versions-for-all-nodes + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/manage-ghes#get-all-ghes-release-versions-for-all-nodes openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /markdown documentation_url: https://docs.github.com/rest/markdown/markdown#render-a-markdown-document openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /markdown/raw documentation_url: https://docs.github.com/rest/markdown/markdown#render-a-markdown-document-in-raw-mode openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /marketplace_listing/accounts/{account_id} documentation_url: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account openapi_files: @@ -991,439 +993,439 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /networks/{owner}/{repo}/events documentation_url: https://docs.github.com/rest/activity/events#list-public-events-for-a-network-of-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /notifications documentation_url: https://docs.github.com/rest/activity/notifications#list-notifications-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /notifications documentation_url: https://docs.github.com/rest/activity/notifications#mark-notifications-as-read openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /notifications/threads/{thread_id} documentation_url: https://docs.github.com/rest/activity/notifications#get-a-thread openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /notifications/threads/{thread_id} documentation_url: https://docs.github.com/rest/activity/notifications#mark-a-thread-as-read openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /notifications/threads/{thread_id}/subscription documentation_url: https://docs.github.com/rest/activity/notifications#delete-a-thread-subscription openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /notifications/threads/{thread_id}/subscription documentation_url: https://docs.github.com/rest/activity/notifications#get-a-thread-subscription-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /notifications/threads/{thread_id}/subscription documentation_url: https://docs.github.com/rest/activity/notifications#set-a-thread-subscription openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /octocat documentation_url: https://docs.github.com/rest/meta/meta#get-octocat openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /organizations documentation_url: https://docs.github.com/rest/orgs/orgs#list-organizations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /organizations/{organization_id}/custom_roles documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#deprecated---list-custom-repository-roles-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org} documentation_url: https://docs.github.com/rest/orgs/orgs#delete-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org} documentation_url: https://docs.github.com/rest/orgs/orgs#get-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /orgs/{org} documentation_url: https://docs.github.com/rest/orgs/orgs#update-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/cache/usage documentation_url: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/cache/usage-by-repository documentation_url: https://docs.github.com/rest/actions/cache#list-repositories-with-github-actions-cache-usage-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/oidc/customization/sub documentation_url: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/actions/oidc/customization/sub documentation_url: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/permissions documentation_url: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/actions/permissions documentation_url: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/permissions/repositories documentation_url: https://docs.github.com/rest/actions/permissions#list-selected-repositories-enabled-for-github-actions-in-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/actions/permissions/repositories documentation_url: https://docs.github.com/rest/actions/permissions#set-selected-repositories-enabled-for-github-actions-in-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/actions/permissions/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/permissions#disable-a-selected-repository-for-github-actions-in-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/actions/permissions/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/permissions#enable-a-selected-repository-for-github-actions-in-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/permissions/selected-actions documentation_url: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/actions/permissions/selected-actions documentation_url: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/permissions/workflow documentation_url: https://docs.github.com/rest/actions/permissions#get-default-workflow-permissions-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/actions/permissions/workflow documentation_url: https://docs.github.com/rest/actions/permissions#set-default-workflow-permissions-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/runner-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/actions/runner-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /orgs/{org}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-repository-access-to-a-self-hosted-runner-group-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-repository-access-for-a-self-hosted-runner-group-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-repository-access-to-a-self-hosted-runner-group-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/runners documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/runners/downloads documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/actions/runners/generate-jitconfig documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/actions/runners/registration-token documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/actions/runners/remove-token documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/actions/runners/{runner_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/runners/{runner_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-a-custom-label-from-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/secrets documentation_url: https://docs.github.com/rest/actions/secrets#list-organization-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/secrets/public-key documentation_url: https://docs.github.com/rest/actions/secrets#get-an-organization-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#delete-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#get-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/secrets/{secret_name}/repositories documentation_url: https://docs.github.com/rest/actions/secrets#list-selected-repositories-for-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/actions/secrets/{secret_name}/repositories documentation_url: https://docs.github.com/rest/actions/secrets#set-selected-repositories-for-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/secrets#remove-selected-repository-from-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/secrets#add-selected-repository-to-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/variables documentation_url: https://docs.github.com/rest/actions/variables#list-organization-variables openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/actions/variables documentation_url: https://docs.github.com/rest/actions/variables#create-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#delete-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#get-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /orgs/{org}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#update-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/variables/{name}/repositories documentation_url: https://docs.github.com/rest/actions/variables#list-selected-repositories-for-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/actions/variables/{name}/repositories documentation_url: https://docs.github.com/rest/actions/variables#set-selected-repositories-for-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/variables#remove-selected-repository-from-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/variables#add-selected-repository-to-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/announcement documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/organizations#remove-announcement-banner-from-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/announcement documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/organizations#get-announcement-banner-for-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /orgs/{org}/announcement documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/organizations#set-announcement-banner-for-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/audit-log documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/orgs#get-the-audit-log-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/blocks documentation_url: https://docs.github.com/rest/orgs/blocking#list-users-blocked-by-an-organization openapi_files: @@ -1449,7 +1451,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/codespaces documentation_url: https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-the-organization openapi_files: @@ -1516,32 +1518,32 @@ openapi_operations: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: GET /orgs/{org}/copilot/billing - documentation_url: https://docs.github.com/rest/copilot/copilot-for-business#get-copilot-for-business-seat-information-and-settings-for-an-organization + documentation_url: https://docs.github.com/rest/copilot/copilot-business#get-copilot-business-seat-information-and-settings-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: GET /orgs/{org}/copilot/billing/seats - documentation_url: https://docs.github.com/rest/copilot/copilot-for-business#list-all-copilot-for-business-seat-assignments-for-an-organization + documentation_url: https://docs.github.com/rest/copilot/copilot-business#list-all-copilot-business-seat-assignments-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: DELETE /orgs/{org}/copilot/billing/selected_teams - documentation_url: https://docs.github.com/rest/copilot/copilot-for-business#remove-teams-from-the-copilot-for-business-subscription-for-an-organization + documentation_url: https://docs.github.com/rest/copilot/copilot-business#remove-teams-from-the-copilot-business-subscription-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: POST /orgs/{org}/copilot/billing/selected_teams - documentation_url: https://docs.github.com/rest/copilot/copilot-for-business#add-teams-to-the-copilot-for-business-subscription-for-an-organization + documentation_url: https://docs.github.com/rest/copilot/copilot-business#add-teams-to-the-copilot-business-subscription-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: DELETE /orgs/{org}/copilot/billing/selected_users - documentation_url: https://docs.github.com/rest/copilot/copilot-for-business#remove-users-from-the-copilot-for-business-subscription-for-an-organization + documentation_url: https://docs.github.com/rest/copilot/copilot-business#remove-users-from-the-copilot-business-subscription-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: POST /orgs/{org}/copilot/billing/selected_users - documentation_url: https://docs.github.com/rest/copilot/copilot-for-business#add-users-to-the-copilot-for-business-subscription-for-an-organization + documentation_url: https://docs.github.com/rest/copilot/copilot-business#add-users-to-the-copilot-business-subscription-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json @@ -1557,27 +1559,27 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/custom-repository-roles documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#create-a-custom-repository-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/custom-repository-roles/{role_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#delete-a-custom-repository-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/custom-repository-roles/{role_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#get-a-custom-repository-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /orgs/{org}/custom-repository-roles/{role_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#update-a-custom-repository-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/custom_roles documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#deprecated---create-a-custom-role openapi_files: @@ -1599,83 +1601,83 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/dependabot/secrets documentation_url: https://docs.github.com/rest/dependabot/secrets#list-organization-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/dependabot/secrets/public-key documentation_url: https://docs.github.com/rest/dependabot/secrets#get-an-organization-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#delete-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#get-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories documentation_url: https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories documentation_url: https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/dependabot/secrets#add-selected-repository-to-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/docker/conflicts documentation_url: https://docs.github.com/rest/packages/packages#get-list-of-conflicting-packages-during-docker-migration-for-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/events documentation_url: https://docs.github.com/rest/activity/events#list-public-organization-events openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/external-group/{group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#get-an-external-group openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/external-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#list-external-groups-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/failed_invitations documentation_url: https://docs.github.com/rest/orgs/members#list-failed-organization-invitations openapi_files: @@ -1690,79 +1692,79 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/hooks documentation_url: https://docs.github.com/rest/orgs/webhooks#create-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/orgs/webhooks#delete-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/orgs/webhooks#get-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /orgs/{org}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/orgs/webhooks#update-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/hooks/{hook_id}/config documentation_url: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /orgs/{org}/hooks/{hook_id}/config documentation_url: https://docs.github.com/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/hooks/{hook_id}/deliveries documentation_url: https://docs.github.com/rest/orgs/webhooks#list-deliveries-for-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id} documentation_url: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-delivery-for-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts documentation_url: https://docs.github.com/rest/orgs/webhooks#redeliver-a-delivery-for-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/hooks/{hook_id}/pings documentation_url: https://docs.github.com/rest/orgs/webhooks#ping-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/installation documentation_url: https://docs.github.com/rest/apps/apps#get-an-organization-installation-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/installations documentation_url: https://docs.github.com/rest/orgs/orgs#list-app-installations-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/interaction-limits documentation_url: https://docs.github.com/rest/interactions/orgs#remove-interaction-restrictions-for-an-organization openapi_files: @@ -1803,25 +1805,25 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/members documentation_url: https://docs.github.com/rest/orgs/members#list-organization-members openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/members/{username} documentation_url: https://docs.github.com/rest/orgs/members#remove-an-organization-member openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/members/{username} documentation_url: https://docs.github.com/rest/orgs/members#check-organization-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/members/{username}/codespaces documentation_url: https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-a-user-in-organization openapi_files: @@ -1838,7 +1840,7 @@ openapi_operations: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: GET /orgs/{org}/members/{username}/copilot - documentation_url: https://docs.github.com/rest/copilot/copilot-for-business#get-copilot-for-business-seat-assignment-details-for-a-user + documentation_url: https://docs.github.com/rest/copilot/copilot-business#get-copilot-business-seat-assignment-details-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json @@ -1847,235 +1849,305 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/memberships/{username} documentation_url: https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/memberships/{username} documentation_url: https://docs.github.com/rest/orgs/members#set-organization-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/migrations documentation_url: https://docs.github.com/rest/migrations/orgs#list-organization-migrations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/migrations documentation_url: https://docs.github.com/rest/migrations/orgs#start-an-organization-migration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/migrations/{migration_id} documentation_url: https://docs.github.com/rest/migrations/orgs#get-an-organization-migration-status openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/migrations/{migration_id}/archive documentation_url: https://docs.github.com/rest/migrations/orgs#delete-an-organization-migration-archive openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/migrations/{migration_id}/archive documentation_url: https://docs.github.com/rest/migrations/orgs#download-an-organization-migration-archive openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock documentation_url: https://docs.github.com/rest/migrations/orgs#unlock-an-organization-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/migrations/{migration_id}/repositories documentation_url: https://docs.github.com/rest/migrations/orgs#list-repositories-in-an-organization-migration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json + - name: GET /orgs/{org}/organization-fine-grained-permissions + documentation_url: https://docs.github.com/rest/orgs/organization-roles#list-organization-fine-grained-permissions-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/organization-roles + documentation_url: https://docs.github.com/rest/orgs/organization-roles#get-all-organization-roles-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: POST /orgs/{org}/organization-roles + documentation_url: https://docs.github.com/rest/orgs/organization-roles#create-a-custom-organization-role + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /orgs/{org}/organization-roles/teams/{team_slug} + documentation_url: https://docs.github.com/rest/orgs/organization-roles#remove-all-organization-roles-for-a-team + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id} + documentation_url: https://docs.github.com/rest/orgs/organization-roles#remove-an-organization-role-from-a-team + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id} + documentation_url: https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-team + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /orgs/{org}/organization-roles/users/{username} + documentation_url: https://docs.github.com/rest/orgs/organization-roles#remove-all-organization-roles-for-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /orgs/{org}/organization-roles/users/{username}/{role_id} + documentation_url: https://docs.github.com/rest/orgs/organization-roles#remove-an-organization-role-from-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PUT /orgs/{org}/organization-roles/users/{username}/{role_id} + documentation_url: https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /orgs/{org}/organization-roles/{role_id} + documentation_url: https://docs.github.com/rest/orgs/organization-roles#delete-a-custom-organization-role + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/organization-roles/{role_id} + documentation_url: https://docs.github.com/rest/orgs/organization-roles#get-an-organization-role + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PATCH /orgs/{org}/organization-roles/{role_id} + documentation_url: https://docs.github.com/rest/orgs/organization-roles#update-a-custom-organization-role + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/organization-roles/{role_id}/teams + documentation_url: https://docs.github.com/rest/orgs/organization-roles#list-teams-that-are-assigned-to-an-organization-role + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/organization-roles/{role_id}/users + documentation_url: https://docs.github.com/rest/orgs/organization-roles#list-users-that-are-assigned-to-an-organization-role + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /orgs/{org}/outside_collaborators documentation_url: https://docs.github.com/rest/orgs/outside-collaborators#list-outside-collaborators-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/outside_collaborators/{username} documentation_url: https://docs.github.com/rest/orgs/outside-collaborators#remove-outside-collaborator-from-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/outside_collaborators/{username} documentation_url: https://docs.github.com/rest/orgs/outside-collaborators#convert-an-organization-member-to-outside-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/packages documentation_url: https://docs.github.com/rest/packages/packages#list-packages-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/packages/{package_type}/{package_name}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/packages/{package_type}/{package_name}/versions documentation_url: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#delete-package-version-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-version-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-package-version-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/personal-access-token-requests documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/personal-access-token-requests documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#review-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/personal-access-token-requests/{pat_request_id} documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#review-a-request-to-access-organization-resources-with-a-fine-grained-personal-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-repositories-requested-to-be-accessed-by-a-fine-grained-personal-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/personal-access-tokens documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-fine-grained-personal-access-tokens-with-access-to-organization-resources openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/personal-access-tokens documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#update-the-access-to-organization-resources-via-fine-grained-personal-access-tokens openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/personal-access-tokens/{pat_id} documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#update-the-access-a-fine-grained-personal-access-token-has-to-organization-resources openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-repositories-a-fine-grained-personal-access-token-has-access-to openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/pre-receive-hooks - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/org-pre-receive-hooks#list-pre-receive-hooks-for-an-organization + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/org-pre-receive-hooks#list-pre-receive-hooks-for-an-organization openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/org-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-an-organization + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/org-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-an-organization openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/org-pre-receive-hooks#get-a-pre-receive-hook-for-an-organization + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/org-pre-receive-hooks#get-a-pre-receive-hook-for-an-organization openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /orgs/{org}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/org-pre-receive-hooks#update-pre-receive-hook-enforcement-for-an-organization + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/org-pre-receive-hooks#update-pre-receive-hook-enforcement-for-an-organization openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/projects documentation_url: https://docs.github.com/rest/projects/projects#list-organization-projects openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/projects documentation_url: https://docs.github.com/rest/projects/projects#create-an-organization-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/properties/schema - documentation_url: https://docs.github.com/rest/orgs/properties#get-all-custom-properties-for-an-organization + documentation_url: https://docs.github.com/rest/orgs/custom-properties#get-all-custom-properties-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: PATCH /orgs/{org}/properties/schema - documentation_url: https://docs.github.com/rest/orgs/properties#create-or-update-custom-properties-for-an-organization + documentation_url: https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-properties-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: DELETE /orgs/{org}/properties/schema/{custom_property_name} - documentation_url: https://docs.github.com/rest/orgs/properties#remove-a-custom-property-for-an-organization + documentation_url: https://docs.github.com/rest/orgs/custom-properties#remove-a-custom-property-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: GET /orgs/{org}/properties/schema/{custom_property_name} - documentation_url: https://docs.github.com/rest/orgs/properties#get-a-custom-property-for-an-organization + documentation_url: https://docs.github.com/rest/orgs/custom-properties#get-a-custom-property-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: PUT /orgs/{org}/properties/schema/{custom_property_name} - documentation_url: https://docs.github.com/rest/orgs/properties#create-or-update-a-custom-property-for-an-organization + documentation_url: https://docs.github.com/rest/orgs/custom-properties#create-or-update-a-custom-property-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: GET /orgs/{org}/properties/values - documentation_url: https://docs.github.com/rest/orgs/properties#list-custom-property-values-for-organization-repositories + documentation_url: https://docs.github.com/rest/orgs/custom-properties#list-custom-property-values-for-organization-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: PATCH /orgs/{org}/properties/values - documentation_url: https://docs.github.com/rest/orgs/properties#create-or-update-custom-property-values-for-organization-repositories + documentation_url: https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-property-values-for-organization-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json @@ -2084,52 +2156,54 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/public_members/{username} documentation_url: https://docs.github.com/rest/orgs/members#remove-public-organization-membership-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/public_members/{username} documentation_url: https://docs.github.com/rest/orgs/members#check-public-organization-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/public_members/{username} documentation_url: https://docs.github.com/rest/orgs/members#set-public-organization-membership-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/repos documentation_url: https://docs.github.com/rest/repos/repos#list-organization-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/repos documentation_url: https://docs.github.com/rest/repos/repos#create-an-organization-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/repository-fine-grained-permissions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#list-repository-fine-grained-permissions-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/rulesets documentation_url: https://docs.github.com/rest/orgs/rules#get-all-organization-repository-rulesets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/rulesets documentation_url: https://docs.github.com/rest/orgs/rules#create-an-organization-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/rulesets/rule-suites documentation_url: https://docs.github.com/rest/orgs/rule-suites#list-organization-rule-suites openapi_files: @@ -2145,22 +2219,25 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/orgs/rules#get-an-organization-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/orgs/rules#update-an-organization-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/secret-scanning/alerts documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/security-advisories documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories-for-an-organization openapi_files: @@ -2171,19 +2248,19 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/security-managers/teams/{team_slug} documentation_url: https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/security-managers/teams/{team_slug} documentation_url: https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/settings/billing/actions documentation_url: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-an-organization openapi_files: @@ -2193,7 +2270,7 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/billing/billing#get-github-advanced-security-active-committers-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/settings/billing/packages documentation_url: https://docs.github.com/rest/billing/billing#get-github-packages-billing-for-an-organization openapi_files: @@ -2213,142 +2290,142 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/teams documentation_url: https://docs.github.com/rest/teams/teams#create-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/teams/{team_slug} documentation_url: https://docs.github.com/rest/teams/teams#delete-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/teams/{team_slug} documentation_url: https://docs.github.com/rest/teams/teams#get-a-team-by-name openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /orgs/{org}/teams/{team_slug} documentation_url: https://docs.github.com/rest/teams/teams#update-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/teams/{team_slug}/discussions documentation_url: https://docs.github.com/rest/teams/discussions#list-discussions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/teams/{team_slug}/discussions documentation_url: https://docs.github.com/rest/teams/discussions#create-a-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#delete-a-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#get-a-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#update-a-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments documentation_url: https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments documentation_url: https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-team-discussion-comment-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-team-discussion-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/teams/{team_slug}/external-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#remove-the-connection-between-an-external-group-and-a-team openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/teams/{team_slug}/external-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#list-a-connection-between-an-external-group-and-a-team openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /orgs/{org}/teams/{team_slug}/external-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#update-the-connection-between-an-external-group-and-a-team openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/teams/{team_slug}/invitations documentation_url: https://docs.github.com/rest/teams/members#list-pending-team-invitations openapi_files: @@ -2359,73 +2436,73 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/teams/{team_slug}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/teams/{team_slug}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#get-team-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/teams/{team_slug}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/teams/{team_slug}/projects documentation_url: https://docs.github.com/rest/teams/teams#list-team-projects openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/teams/{team_slug}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/teams/{team_slug}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/teams/{team_slug}/repos documentation_url: https://docs.github.com/rest/teams/teams#list-team-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#list-idp-groups-for-a-team openapi_files: @@ -2439,133 +2516,133 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/{security_product}/{enablement} documentation_url: https://docs.github.com/rest/orgs/orgs#enable-or-disable-a-security-feature-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /projects/columns/cards/{card_id} documentation_url: https://docs.github.com/rest/projects/cards#delete-a-project-card openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /projects/columns/cards/{card_id} documentation_url: https://docs.github.com/rest/projects/cards#get-a-project-card openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /projects/columns/cards/{card_id} documentation_url: https://docs.github.com/rest/projects/cards#update-an-existing-project-card openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /projects/columns/cards/{card_id}/moves documentation_url: https://docs.github.com/rest/projects/cards#move-a-project-card openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /projects/columns/{column_id} documentation_url: https://docs.github.com/rest/projects/columns#delete-a-project-column openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /projects/columns/{column_id} documentation_url: https://docs.github.com/rest/projects/columns#get-a-project-column openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /projects/columns/{column_id} documentation_url: https://docs.github.com/rest/projects/columns#update-an-existing-project-column openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /projects/columns/{column_id}/cards documentation_url: https://docs.github.com/rest/projects/cards#list-project-cards openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /projects/columns/{column_id}/cards documentation_url: https://docs.github.com/rest/projects/cards#create-a-project-card openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /projects/columns/{column_id}/moves documentation_url: https://docs.github.com/rest/projects/columns#move-a-project-column openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /projects/{project_id} documentation_url: https://docs.github.com/rest/projects/projects#delete-a-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /projects/{project_id} documentation_url: https://docs.github.com/rest/projects/projects#get-a-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /projects/{project_id} documentation_url: https://docs.github.com/rest/projects/projects#update-a-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /projects/{project_id}/collaborators documentation_url: https://docs.github.com/rest/projects/collaborators#list-project-collaborators openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /projects/{project_id}/collaborators/{username} documentation_url: https://docs.github.com/rest/projects/collaborators#remove-user-as-a-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /projects/{project_id}/collaborators/{username} documentation_url: https://docs.github.com/rest/projects/collaborators#add-project-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /projects/{project_id}/collaborators/{username}/permission documentation_url: https://docs.github.com/rest/projects/collaborators#get-project-permission-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /projects/{project_id}/columns documentation_url: https://docs.github.com/rest/projects/columns#list-project-columns openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /projects/{project_id}/columns documentation_url: https://docs.github.com/rest/projects/columns#create-a-project-column openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /rate_limit documentation_url: https://docs.github.com/rest/rate-limit/rate-limit#get-rate-limit-status-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /reactions/{reaction_id} documentation_url: https://docs.github.com/enterprise-server@3.4/rest/reference/reactions/#delete-a-reaction-legacy openapi_files: @@ -2575,261 +2652,261 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/repos/repos#get-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/repos/repos#update-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/artifacts documentation_url: https://docs.github.com/rest/actions/artifacts#list-artifacts-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id} documentation_url: https://docs.github.com/rest/actions/artifacts#delete-an-artifact openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id} documentation_url: https://docs.github.com/rest/actions/artifacts#get-an-artifact openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format} documentation_url: https://docs.github.com/rest/actions/artifacts#download-an-artifact openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/cache/usage documentation_url: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/cache/usage-policy - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/actions/cache#get-github-actions-cache-usage-policy-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/actions/cache#get-github-actions-cache-usage-policy-for-a-repository openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/actions/cache/usage-policy - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/actions/cache#set-github-actions-cache-usage-policy-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/actions/cache#set-github-actions-cache-usage-policy-for-a-repository openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/actions/caches documentation_url: https://docs.github.com/rest/actions/cache#delete-github-actions-caches-for-a-repository-using-a-cache-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/caches documentation_url: https://docs.github.com/rest/actions/cache#list-github-actions-caches-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/actions/caches/{cache_id} documentation_url: https://docs.github.com/rest/actions/cache#delete-a-github-actions-cache-for-a-repository-using-a-cache-id openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/jobs/{job_id} documentation_url: https://docs.github.com/rest/actions/workflow-jobs#get-a-job-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs documentation_url: https://docs.github.com/rest/actions/workflow-jobs#download-job-logs-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun documentation_url: https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/oidc/customization/sub documentation_url: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/actions/oidc/customization/sub documentation_url: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/organization-secrets documentation_url: https://docs.github.com/rest/actions/secrets#list-repository-organization-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/organization-variables documentation_url: https://docs.github.com/rest/actions/variables#list-repository-organization-variables openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/permissions documentation_url: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/actions/permissions documentation_url: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/permissions/access documentation_url: https://docs.github.com/rest/actions/permissions#get-the-level-of-access-for-workflows-outside-of-the-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/actions/permissions/access documentation_url: https://docs.github.com/rest/actions/permissions#set-the-level-of-access-for-workflows-outside-of-the-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/permissions/selected-actions documentation_url: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/actions/permissions/selected-actions documentation_url: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/permissions/workflow documentation_url: https://docs.github.com/rest/actions/permissions#get-default-workflow-permissions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/actions/permissions/workflow documentation_url: https://docs.github.com/rest/actions/permissions#set-default-workflow-permissions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/runners documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/runners/downloads documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/actions/runners/registration-token documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/actions/runners/remove-token documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/actions/runners/{runner_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/runners/{runner_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-a-custom-label-from-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/runs documentation_url: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/actions/runs/{run_id} documentation_url: https://docs.github.com/rest/actions/workflow-runs#delete-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id} documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-the-review-history-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve documentation_url: https://docs.github.com/rest/actions/workflow-runs#approve-a-workflow-run-for-a-fork-pull-request openapi_files: @@ -2840,37 +2917,37 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number} documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run-attempt openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs documentation_url: https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run-attempt openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs documentation_url: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-attempt-logs openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel documentation_url: https://docs.github.com/rest/actions/workflow-runs#cancel-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule documentation_url: https://docs.github.com/rest/actions/workflow-runs#review-custom-deployment-protection-rules-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel documentation_url: https://docs.github.com/rest/actions/workflow-runs#force-cancel-a-workflow-run openapi_files: @@ -2881,43 +2958,43 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs documentation_url: https://docs.github.com/rest/actions/workflow-runs#delete-workflow-run-logs openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs documentation_url: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-logs openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-pending-deployments-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments documentation_url: https://docs.github.com/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun documentation_url: https://docs.github.com/rest/actions/workflow-runs#re-run-a-workflow openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs documentation_url: https://docs.github.com/rest/actions/workflow-runs#re-run-failed-jobs-from-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-workflow-run-usage openapi_files: @@ -2928,97 +3005,97 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/secrets/public-key documentation_url: https://docs.github.com/rest/actions/secrets#get-a-repository-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#delete-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#get-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#create-or-update-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/variables documentation_url: https://docs.github.com/rest/actions/variables#list-repository-variables openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/actions/variables documentation_url: https://docs.github.com/rest/actions/variables#create-a-repository-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#delete-a-repository-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#get-a-repository-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#update-a-repository-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/workflows documentation_url: https://docs.github.com/rest/actions/workflows#list-repository-workflows openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/workflows/{workflow_id} documentation_url: https://docs.github.com/rest/actions/workflows#get-a-workflow openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable documentation_url: https://docs.github.com/rest/actions/workflows#disable-a-workflow openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches documentation_url: https://docs.github.com/rest/actions/workflows#create-a-workflow-dispatch-event openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable documentation_url: https://docs.github.com/rest/actions/workflows#enable-a-workflow openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs documentation_url: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-workflow openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing documentation_url: https://docs.github.com/rest/actions/workflows#get-workflow-usage openapi_files: @@ -3029,42 +3106,43 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/assignees documentation_url: https://docs.github.com/rest/issues/assignees#list-assignees openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/assignees/{assignee} documentation_url: https://docs.github.com/rest/issues/assignees#check-if-a-user-can-be-assigned openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/autolinks documentation_url: https://docs.github.com/rest/repos/autolinks#list-all-autolinks-of-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/autolinks documentation_url: https://docs.github.com/rest/repos/autolinks#create-an-autolink-reference-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/autolinks/{autolink_id} documentation_url: https://docs.github.com/rest/repos/autolinks#delete-an-autolink-reference-from-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/autolinks/{autolink_id} documentation_url: https://docs.github.com/rest/repos/autolinks#get-an-autolink-reference-of-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/automated-security-fixes documentation_url: https://docs.github.com/rest/repos/repos#disable-automated-security-fixes openapi_files: @@ -3075,7 +3153,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/automated-security-fixes documentation_url: https://docs.github.com/rest/repos/repos#enable-automated-security-fixes openapi_files: @@ -3086,319 +3164,319 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/branches/{branch} documentation_url: https://docs.github.com/rest/branches/branches#get-a-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection documentation_url: https://docs.github.com/rest/branches/branch-protection#get-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection documentation_url: https://docs.github.com/rest/branches/branch-protection#update-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-admin-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins documentation_url: https://docs.github.com/rest/branches/branch-protection#get-admin-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins documentation_url: https://docs.github.com/rest/branches/branch-protection#set-admin-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-pull-request-review-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews documentation_url: https://docs.github.com/rest/branches/branch-protection#get-pull-request-review-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews documentation_url: https://docs.github.com/rest/branches/branch-protection#update-pull-request-review-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-commit-signature-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures documentation_url: https://docs.github.com/rest/branches/branch-protection#get-commit-signature-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures documentation_url: https://docs.github.com/rest/branches/branch-protection#create-commit-signature-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-status-check-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks documentation_url: https://docs.github.com/rest/branches/branch-protection#get-status-checks-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks documentation_url: https://docs.github.com/rest/branches/branch-protection#update-status-check-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-status-check-contexts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts documentation_url: https://docs.github.com/rest/branches/branch-protection#get-all-status-check-contexts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts documentation_url: https://docs.github.com/rest/branches/branch-protection#add-status-check-contexts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts documentation_url: https://docs.github.com/rest/branches/branch-protection#set-status-check-contexts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions documentation_url: https://docs.github.com/rest/branches/branch-protection#get-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-app-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps documentation_url: https://docs.github.com/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps documentation_url: https://docs.github.com/rest/branches/branch-protection#add-app-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps documentation_url: https://docs.github.com/rest/branches/branch-protection#set-app-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-team-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams documentation_url: https://docs.github.com/rest/branches/branch-protection#get-teams-with-access-to-the-protected-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams documentation_url: https://docs.github.com/rest/branches/branch-protection#add-team-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams documentation_url: https://docs.github.com/rest/branches/branch-protection#set-team-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-user-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users documentation_url: https://docs.github.com/rest/branches/branch-protection#get-users-with-access-to-the-protected-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users documentation_url: https://docs.github.com/rest/branches/branch-protection#add-user-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users documentation_url: https://docs.github.com/rest/branches/branch-protection#set-user-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/branches/{branch}/rename documentation_url: https://docs.github.com/rest/branches/branches#rename-a-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/check-runs documentation_url: https://docs.github.com/rest/checks/runs#create-a-check-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/check-runs/{check_run_id} documentation_url: https://docs.github.com/rest/checks/runs#get-a-check-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/check-runs/{check_run_id} documentation_url: https://docs.github.com/rest/checks/runs#update-a-check-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations documentation_url: https://docs.github.com/rest/checks/runs#list-check-run-annotations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest documentation_url: https://docs.github.com/rest/checks/runs#rerequest-a-check-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/check-suites documentation_url: https://docs.github.com/rest/checks/suites#create-a-check-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/check-suites/preferences documentation_url: https://docs.github.com/rest/checks/suites#update-repository-preferences-for-check-suites openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/check-suites/{check_suite_id} documentation_url: https://docs.github.com/rest/checks/suites#get-a-check-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs documentation_url: https://docs.github.com/rest/checks/runs#list-check-runs-in-a-check-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest documentation_url: https://docs.github.com/rest/checks/suites#rerequest-a-check-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/code-scanning/alerts documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-instances-of-a-code-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/code-scanning/analyses documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-analyses-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#delete-a-code-scanning-analysis-from-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/code-scanning/codeql/databases documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-codeql-databases-for-a-repository openapi_files: @@ -3414,31 +3492,31 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/code-scanning/default-setup documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-default-setup-configuration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/code-scanning/sarifs documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#upload-an-analysis-as-sarif-data openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-information-about-a-sarif-upload openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/codeowners/errors documentation_url: https://docs.github.com/rest/repos/repos#list-codeowners-errors openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/codespaces documentation_url: https://docs.github.com/rest/codespaces/codespaces#list-codespaces-in-a-repository-for-the-authenticated-user openapi_files: @@ -3499,133 +3577,133 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/collaborators/{username} documentation_url: https://docs.github.com/rest/collaborators/collaborators#remove-a-repository-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/collaborators/{username} documentation_url: https://docs.github.com/rest/collaborators/collaborators#check-if-a-user-is-a-repository-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/collaborators/{username} documentation_url: https://docs.github.com/rest/collaborators/collaborators#add-a-repository-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/collaborators/{username}/permission documentation_url: https://docs.github.com/rest/collaborators/collaborators#get-repository-permissions-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/comments documentation_url: https://docs.github.com/rest/commits/comments#list-commit-comments-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/comments/{comment_id} documentation_url: https://docs.github.com/rest/commits/comments#delete-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/comments/{comment_id} documentation_url: https://docs.github.com/rest/commits/comments#get-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/comments/{comment_id} documentation_url: https://docs.github.com/rest/commits/comments#update-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-a-commit-comment-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/commits documentation_url: https://docs.github.com/rest/commits/commits#list-commits openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head documentation_url: https://docs.github.com/rest/commits/commits#list-branches-for-head-commit openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/commits/{commit_sha}/comments documentation_url: https://docs.github.com/rest/commits/comments#list-commit-comments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/commits/{commit_sha}/comments documentation_url: https://docs.github.com/rest/commits/comments#create-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls documentation_url: https://docs.github.com/rest/commits/commits#list-pull-requests-associated-with-a-commit openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/commits/{ref} documentation_url: https://docs.github.com/rest/commits/commits#get-a-commit openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/commits/{ref}/check-runs documentation_url: https://docs.github.com/rest/checks/runs#list-check-runs-for-a-git-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/commits/{ref}/check-suites documentation_url: https://docs.github.com/rest/checks/suites#list-check-suites-for-a-git-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/commits/{ref}/status documentation_url: https://docs.github.com/rest/commits/statuses#get-the-combined-status-for-a-specific-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/commits/{ref}/statuses documentation_url: https://docs.github.com/rest/commits/statuses#list-commit-statuses-for-a-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/community/profile documentation_url: https://docs.github.com/rest/metrics/community#get-community-profile-metrics openapi_files: @@ -3636,7 +3714,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#create-a-content-attachment openapi_files: @@ -3646,391 +3724,391 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/contents/{path} documentation_url: https://docs.github.com/rest/repos/contents#get-repository-content openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/contents/{path} documentation_url: https://docs.github.com/rest/repos/contents#create-or-update-file-contents openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/contributors documentation_url: https://docs.github.com/rest/repos/repos#list-repository-contributors openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/dependabot/alerts documentation_url: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number} documentation_url: https://docs.github.com/rest/dependabot/alerts#get-a-dependabot-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number} documentation_url: https://docs.github.com/rest/dependabot/alerts#update-a-dependabot-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/dependabot/secrets documentation_url: https://docs.github.com/rest/dependabot/secrets#list-repository-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/dependabot/secrets/public-key documentation_url: https://docs.github.com/rest/dependabot/secrets#get-a-repository-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#delete-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#get-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#create-or-update-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead} documentation_url: https://docs.github.com/rest/dependency-graph/dependency-review#get-a-diff-of-the-dependencies-between-commits openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/dependency-graph/sbom documentation_url: https://docs.github.com/rest/dependency-graph/sboms#export-a-software-bill-of-materials-sbom-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/dependency-graph/snapshots documentation_url: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/deployments documentation_url: https://docs.github.com/rest/deployments/deployments#list-deployments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/deployments documentation_url: https://docs.github.com/rest/deployments/deployments#create-a-deployment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/deployments/{deployment_id} documentation_url: https://docs.github.com/rest/deployments/deployments#delete-a-deployment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/deployments/{deployment_id} documentation_url: https://docs.github.com/rest/deployments/deployments#get-a-deployment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses documentation_url: https://docs.github.com/rest/deployments/statuses#list-deployment-statuses openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses documentation_url: https://docs.github.com/rest/deployments/statuses#create-a-deployment-status openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id} documentation_url: https://docs.github.com/rest/deployments/statuses#get-a-deployment-status openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/dispatches documentation_url: https://docs.github.com/rest/repos/repos#create-a-repository-dispatch-event openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/environments documentation_url: https://docs.github.com/rest/deployments/environments#list-environments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/environments/{environment_name} documentation_url: https://docs.github.com/rest/deployments/environments#delete-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/environments/{environment_name} documentation_url: https://docs.github.com/rest/deployments/environments#get-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/environments/{environment_name} documentation_url: https://docs.github.com/rest/deployments/environments#create-or-update-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies documentation_url: https://docs.github.com/rest/deployments/branch-policies#list-deployment-branch-policies openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies documentation_url: https://docs.github.com/rest/deployments/branch-policies#create-a-deployment-branch-policy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} documentation_url: https://docs.github.com/rest/deployments/branch-policies#delete-a-deployment-branch-policy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} documentation_url: https://docs.github.com/rest/deployments/branch-policies#get-a-deployment-branch-policy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} documentation_url: https://docs.github.com/rest/deployments/branch-policies#update-a-deployment-branch-policy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules documentation_url: https://docs.github.com/rest/deployments/protection-rules#get-all-deployment-protection-rules-for-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules documentation_url: https://docs.github.com/rest/deployments/protection-rules#create-a-custom-deployment-protection-rule-on-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps documentation_url: https://docs.github.com/rest/deployments/protection-rules#list-custom-deployment-rule-integrations-available-for-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id} documentation_url: https://docs.github.com/rest/deployments/protection-rules#disable-a-custom-protection-rule-for-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id} documentation_url: https://docs.github.com/rest/deployments/protection-rules#get-a-custom-deployment-protection-rule openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/events documentation_url: https://docs.github.com/rest/activity/events#list-repository-events openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/forks documentation_url: https://docs.github.com/rest/repos/forks#list-forks openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/forks documentation_url: https://docs.github.com/rest/repos/forks#create-a-fork openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/git/blobs documentation_url: https://docs.github.com/rest/git/blobs#create-a-blob openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/git/blobs/{file_sha} documentation_url: https://docs.github.com/rest/git/blobs#get-a-blob openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/git/commits documentation_url: https://docs.github.com/rest/git/commits#create-a-commit openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/git/commits/{commit_sha} documentation_url: https://docs.github.com/rest/git/commits#get-a-commit-object openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/git/matching-refs/{ref} documentation_url: https://docs.github.com/rest/git/refs#list-matching-references openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/git/ref/{ref} documentation_url: https://docs.github.com/rest/git/refs#get-a-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/git/refs documentation_url: https://docs.github.com/rest/git/refs#create-a-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/git/refs/{ref} documentation_url: https://docs.github.com/rest/git/refs#delete-a-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/git/refs/{ref} documentation_url: https://docs.github.com/rest/git/refs#update-a-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/git/tags documentation_url: https://docs.github.com/rest/git/tags#create-a-tag-object openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/git/tags/{tag_sha} documentation_url: https://docs.github.com/rest/git/tags#get-a-tag openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/git/trees documentation_url: https://docs.github.com/rest/git/trees#create-a-tree openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/git/trees/{tree_sha} documentation_url: https://docs.github.com/rest/git/trees#get-a-tree openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/hooks - documentation_url: https://docs.github.com/rest/webhooks/repos#list-repository-webhooks + documentation_url: https://docs.github.com/rest/repos/webhooks#list-repository-webhooks openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/hooks - documentation_url: https://docs.github.com/rest/webhooks/repos#create-a-repository-webhook + documentation_url: https://docs.github.com/rest/repos/webhooks#create-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/hooks/{hook_id} - documentation_url: https://docs.github.com/rest/webhooks/repos#delete-a-repository-webhook + documentation_url: https://docs.github.com/rest/repos/webhooks#delete-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/hooks/{hook_id} - documentation_url: https://docs.github.com/rest/webhooks/repos#get-a-repository-webhook + documentation_url: https://docs.github.com/rest/repos/webhooks#get-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/hooks/{hook_id} - documentation_url: https://docs.github.com/rest/webhooks/repos#update-a-repository-webhook + documentation_url: https://docs.github.com/rest/repos/webhooks#update-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/hooks/{hook_id}/config - documentation_url: https://docs.github.com/rest/webhooks/repo-config#get-a-webhook-configuration-for-a-repository + documentation_url: https://docs.github.com/rest/repos/webhooks#get-a-webhook-configuration-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config - documentation_url: https://docs.github.com/rest/webhooks/repo-config#update-a-webhook-configuration-for-a-repository + documentation_url: https://docs.github.com/rest/repos/webhooks#update-a-webhook-configuration-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries - documentation_url: https://docs.github.com/rest/webhooks/repo-deliveries#list-deliveries-for-a-repository-webhook + documentation_url: https://docs.github.com/rest/repos/webhooks#list-deliveries-for-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id} - documentation_url: https://docs.github.com/rest/webhooks/repo-deliveries#get-a-delivery-for-a-repository-webhook + documentation_url: https://docs.github.com/rest/repos/webhooks#get-a-delivery-for-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts - documentation_url: https://docs.github.com/rest/webhooks/repo-deliveries#redeliver-a-delivery-for-a-repository-webhook + documentation_url: https://docs.github.com/rest/repos/webhooks#redeliver-a-delivery-for-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/hooks/{hook_id}/pings - documentation_url: https://docs.github.com/rest/webhooks/repos#ping-a-repository-webhook + documentation_url: https://docs.github.com/rest/repos/webhooks#ping-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/hooks/{hook_id}/tests - documentation_url: https://docs.github.com/rest/webhooks/repos#test-the-push-repository-webhook + documentation_url: https://docs.github.com/rest/repos/webhooks#test-the-push-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/import documentation_url: https://docs.github.com/rest/migrations/source-imports#cancel-an-import openapi_files: @@ -4076,7 +4154,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/interaction-limits documentation_url: https://docs.github.com/rest/interactions/repos#remove-interaction-restrictions-for-a-repository openapi_files: @@ -4097,410 +4175,410 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/invitations/{invitation_id} documentation_url: https://docs.github.com/rest/collaborators/invitations#delete-a-repository-invitation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/invitations/{invitation_id} documentation_url: https://docs.github.com/rest/collaborators/invitations#update-a-repository-invitation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/issues documentation_url: https://docs.github.com/rest/issues/issues#list-repository-issues openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/issues documentation_url: https://docs.github.com/rest/issues/issues#create-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/issues/comments documentation_url: https://docs.github.com/rest/issues/comments#list-issue-comments-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/issues/comments/{comment_id} documentation_url: https://docs.github.com/rest/issues/comments#delete-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/issues/comments/{comment_id} documentation_url: https://docs.github.com/rest/issues/comments#get-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/issues/comments/{comment_id} documentation_url: https://docs.github.com/rest/issues/comments#update-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-an-issue-comment-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/issues/events documentation_url: https://docs.github.com/rest/issues/events#list-issue-events-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/issues/events/{event_id} documentation_url: https://docs.github.com/rest/issues/events#get-an-issue-event openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/issues/{issue_number} documentation_url: https://docs.github.com/rest/issues/issues#get-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/issues/{issue_number} documentation_url: https://docs.github.com/rest/issues/issues#update-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees documentation_url: https://docs.github.com/rest/issues/assignees#remove-assignees-from-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/issues/{issue_number}/assignees documentation_url: https://docs.github.com/rest/issues/assignees#add-assignees-to-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee} documentation_url: https://docs.github.com/rest/issues/assignees#check-if-a-user-can-be-assigned-to-a-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/comments documentation_url: https://docs.github.com/rest/issues/comments#list-issue-comments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/issues/{issue_number}/comments documentation_url: https://docs.github.com/rest/issues/comments#create-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/events documentation_url: https://docs.github.com/rest/issues/events#list-issue-events openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels documentation_url: https://docs.github.com/rest/issues/labels#remove-all-labels-from-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/labels documentation_url: https://docs.github.com/rest/issues/labels#list-labels-for-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/issues/{issue_number}/labels documentation_url: https://docs.github.com/rest/issues/labels#add-labels-to-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/issues/{issue_number}/labels documentation_url: https://docs.github.com/rest/issues/labels#set-labels-for-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name} documentation_url: https://docs.github.com/rest/issues/labels#remove-a-label-from-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock documentation_url: https://docs.github.com/rest/issues/issues#unlock-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/issues/{issue_number}/lock documentation_url: https://docs.github.com/rest/issues/issues#lock-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/issues/{issue_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-an-issue-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/timeline documentation_url: https://docs.github.com/rest/issues/timeline#list-timeline-events-for-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/keys documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#list-deploy-keys openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/keys documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#create-a-deploy-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/keys/{key_id} documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#delete-a-deploy-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/keys/{key_id} documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#get-a-deploy-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/labels documentation_url: https://docs.github.com/rest/issues/labels#list-labels-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/labels documentation_url: https://docs.github.com/rest/issues/labels#create-a-label openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/labels/{name} documentation_url: https://docs.github.com/rest/issues/labels#delete-a-label openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/labels/{name} documentation_url: https://docs.github.com/rest/issues/labels#get-a-label openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/labels/{name} documentation_url: https://docs.github.com/rest/issues/labels#update-a-label openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/languages documentation_url: https://docs.github.com/rest/repos/repos#list-repository-languages openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/lfs documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/repos/lfs#disable-git-lfs-for-a-repository openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/lfs documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/repos/lfs#enable-git-lfs-for-a-repository openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/license documentation_url: https://docs.github.com/rest/licenses/licenses#get-the-license-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/merge-upstream documentation_url: https://docs.github.com/rest/branches/branches#sync-a-fork-branch-with-the-upstream-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/merges documentation_url: https://docs.github.com/rest/branches/branches#merge-a-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/milestones documentation_url: https://docs.github.com/rest/issues/milestones#list-milestones openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/milestones documentation_url: https://docs.github.com/rest/issues/milestones#create-a-milestone openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/milestones/{milestone_number} documentation_url: https://docs.github.com/rest/issues/milestones#delete-a-milestone openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/milestones/{milestone_number} documentation_url: https://docs.github.com/rest/issues/milestones#get-a-milestone openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/milestones/{milestone_number} documentation_url: https://docs.github.com/rest/issues/milestones#update-a-milestone openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels documentation_url: https://docs.github.com/rest/issues/labels#list-labels-for-issues-in-a-milestone openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/notifications documentation_url: https://docs.github.com/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/notifications documentation_url: https://docs.github.com/rest/activity/notifications#mark-repository-notifications-as-read openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/pages documentation_url: https://docs.github.com/rest/pages/pages#delete-a-apiname-pages-site openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/pages documentation_url: https://docs.github.com/rest/pages/pages#get-a-apiname-pages-site openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/pages documentation_url: https://docs.github.com/rest/pages/pages#create-a-apiname-pages-site openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/pages documentation_url: https://docs.github.com/rest/pages/pages#update-information-about-a-apiname-pages-site openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/pages/builds documentation_url: https://docs.github.com/rest/pages/pages#list-apiname-pages-builds openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/pages/builds documentation_url: https://docs.github.com/rest/pages/pages#request-a-apiname-pages-build openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/pages/builds/latest documentation_url: https://docs.github.com/rest/pages/pages#get-latest-pages-build openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/pages/builds/{build_id} documentation_url: https://docs.github.com/rest/pages/pages#get-apiname-pages-build openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/pages/deployment documentation_url: https://docs.github.com/rest/pages/pages#create-a-github-pages-deployment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/pages/health documentation_url: https://docs.github.com/rest/pages/pages#get-a-dns-health-check-for-github-pages openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: GET /repos/{owner}/{repo}/pre-receive-hooks - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/private-vulnerability-reporting documentation_url: https://docs.github.com/rest/repos/repos#disable-private-vulnerability-reporting-for-a-repository openapi_files: @@ -4516,15 +4594,15 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/projects documentation_url: https://docs.github.com/rest/projects/projects#create-a-repository-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/properties/values - documentation_url: https://docs.github.com/rest/repos/properties#get-all-custom-property-values-for-a-repository + documentation_url: https://docs.github.com/rest/repos/custom-properties#get-all-custom-property-values-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json @@ -4533,67 +4611,67 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/pulls documentation_url: https://docs.github.com/rest/pulls/pulls#create-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/pulls/comments documentation_url: https://docs.github.com/rest/pulls/comments#list-review-comments-in-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id} documentation_url: https://docs.github.com/rest/pulls/comments#delete-a-review-comment-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/pulls/comments/{comment_id} documentation_url: https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id} documentation_url: https://docs.github.com/rest/pulls/comments#update-a-review-comment-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-pull-request-review-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-pull-request-review-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-a-pull-request-comment-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number} documentation_url: https://docs.github.com/rest/pulls/pulls#get-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/pulls/{pull_number} documentation_url: https://docs.github.com/rest/pulls/pulls#update-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces documentation_url: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-from-a-pull-request openapi_files: @@ -4604,242 +4682,245 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/comments documentation_url: https://docs.github.com/rest/pulls/comments#create-a-review-comment-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies documentation_url: https://docs.github.com/rest/pulls/comments#create-a-reply-for-a-review-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/commits documentation_url: https://docs.github.com/rest/pulls/pulls#list-commits-on-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/files documentation_url: https://docs.github.com/rest/pulls/pulls#list-pull-requests-files openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/merge documentation_url: https://docs.github.com/rest/pulls/pulls#check-if-a-pull-request-has-been-merged openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge documentation_url: https://docs.github.com/rest/pulls/pulls#merge-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers documentation_url: https://docs.github.com/rest/pulls/review-requests#remove-requested-reviewers-from-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers documentation_url: https://docs.github.com/rest/pulls/review-requests#get-all-requested-reviewers-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers documentation_url: https://docs.github.com/rest/pulls/review-requests#request-reviewers-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews documentation_url: https://docs.github.com/rest/pulls/reviews#list-reviews-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews documentation_url: https://docs.github.com/rest/pulls/reviews#create-a-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} documentation_url: https://docs.github.com/rest/pulls/reviews#delete-a-pending-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} documentation_url: https://docs.github.com/rest/pulls/reviews#get-a-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} documentation_url: https://docs.github.com/rest/pulls/reviews#update-a-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments documentation_url: https://docs.github.com/rest/pulls/reviews#list-comments-for-a-pull-request-review openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals documentation_url: https://docs.github.com/rest/pulls/reviews#dismiss-a-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events documentation_url: https://docs.github.com/rest/pulls/reviews#submit-a-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch documentation_url: https://docs.github.com/rest/pulls/pulls#update-a-pull-request-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/readme documentation_url: https://docs.github.com/rest/repos/contents#get-a-repository-readme openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/readme/{dir} documentation_url: https://docs.github.com/rest/repos/contents#get-a-repository-readme-for-a-directory openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/releases documentation_url: https://docs.github.com/rest/releases/releases#list-releases openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/releases documentation_url: https://docs.github.com/rest/releases/releases#create-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/releases/assets/{asset_id} documentation_url: https://docs.github.com/rest/releases/assets#delete-a-release-asset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/releases/assets/{asset_id} documentation_url: https://docs.github.com/rest/releases/assets#get-a-release-asset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/releases/assets/{asset_id} documentation_url: https://docs.github.com/rest/releases/assets#update-a-release-asset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/releases/generate-notes documentation_url: https://docs.github.com/rest/releases/releases#generate-release-notes-content-for-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/releases/latest documentation_url: https://docs.github.com/rest/releases/releases#get-the-latest-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/releases/tags/{tag} documentation_url: https://docs.github.com/rest/releases/releases#get-a-release-by-tag-name openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/releases/{release_id} documentation_url: https://docs.github.com/rest/releases/releases#delete-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/releases/{release_id} documentation_url: https://docs.github.com/rest/releases/releases#get-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/releases/{release_id} documentation_url: https://docs.github.com/rest/releases/releases#update-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/releases/{release_id}/assets documentation_url: https://docs.github.com/rest/releases/assets#list-release-assets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/releases/{release_id}/assets documentation_url: https://docs.github.com/rest/releases/assets#upload-a-release-asset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/releases/{release_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/releases/{release_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-a-release-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/replicas/caches - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/repos/repos#list-repository-cache-replication-status + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/repos/repos#list-repository-cache-replication-status openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/rules/branches/{branch} documentation_url: https://docs.github.com/rest/repos/rules#get-rules-for-a-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/rulesets documentation_url: https://docs.github.com/rest/repos/rules#get-all-repository-rulesets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/rulesets documentation_url: https://docs.github.com/rest/repos/rules#create-a-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/rulesets/rule-suites documentation_url: https://docs.github.com/rest/repos/rule-suites#list-repository-rule-suites openapi_files: @@ -4855,40 +4936,43 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/repos/rules#get-a-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/repos/rules#update-a-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/secret-scanning/alerts documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#get-a-secret-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#update-a-secret-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-locations-for-a-secret-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/security-advisories documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories openapi_files: @@ -4919,120 +5003,125 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - name: POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks + documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#create-a-temporary-private-fork + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /repos/{owner}/{repo}/stargazers documentation_url: https://docs.github.com/rest/activity/starring#list-stargazers openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/stats/code_frequency documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-activity openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/stats/commit_activity documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-last-year-of-commit-activity openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/stats/contributors documentation_url: https://docs.github.com/rest/metrics/statistics#get-all-contributor-commit-activity openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/stats/participation documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-count openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/stats/punch_card documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-hourly-commit-count-for-each-day openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/statuses/{sha} documentation_url: https://docs.github.com/rest/commits/statuses#create-a-commit-status openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/subscribers documentation_url: https://docs.github.com/rest/activity/watching#list-watchers openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/subscription documentation_url: https://docs.github.com/rest/activity/watching#delete-a-repository-subscription openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/subscription documentation_url: https://docs.github.com/rest/activity/watching#get-a-repository-subscription openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/subscription documentation_url: https://docs.github.com/rest/activity/watching#set-a-repository-subscription openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/tags documentation_url: https://docs.github.com/rest/repos/repos#list-repository-tags openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/tags/protection documentation_url: https://docs.github.com/rest/repos/tags#list-tag-protection-states-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/tags/protection documentation_url: https://docs.github.com/rest/repos/tags#create-a-tag-protection-state-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id} documentation_url: https://docs.github.com/rest/repos/tags#delete-a-tag-protection-state-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/tarball/{ref} documentation_url: https://docs.github.com/rest/repos/contents#download-a-repository-archive-tar openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/teams documentation_url: https://docs.github.com/rest/repos/repos#list-repository-teams openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/topics documentation_url: https://docs.github.com/rest/repos/repos#get-all-repository-topics openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/topics documentation_url: https://docs.github.com/rest/repos/repos#replace-all-repository-topics openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/traffic/clones documentation_url: https://docs.github.com/rest/metrics/traffic#get-repository-clones openapi_files: @@ -5058,163 +5147,163 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/vulnerability-alerts documentation_url: https://docs.github.com/rest/repos/repos#disable-vulnerability-alerts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/vulnerability-alerts documentation_url: https://docs.github.com/rest/repos/repos#check-if-vulnerability-alerts-are-enabled-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/vulnerability-alerts documentation_url: https://docs.github.com/rest/repos/repos#enable-vulnerability-alerts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/zipball/{ref} documentation_url: https://docs.github.com/rest/repos/contents#download-a-repository-archive-zip openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{template_owner}/{template_repo}/generate documentation_url: https://docs.github.com/rest/repos/repos#create-a-repository-using-a-template openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repositories documentation_url: https://docs.github.com/rest/repos/repos#list-public-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repositories/{repository_id}/environments/{environment_name}/secrets documentation_url: https://docs.github.com/rest/actions/secrets#list-environment-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key documentation_url: https://docs.github.com/rest/actions/secrets#get-an-environment-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#delete-an-environment-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#get-an-environment-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#create-or-update-an-environment-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repositories/{repository_id}/environments/{environment_name}/variables documentation_url: https://docs.github.com/rest/actions/variables#list-environment-variables openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repositories/{repository_id}/environments/{environment_name}/variables documentation_url: https://docs.github.com/rest/actions/variables#create-an-environment-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#delete-an-environment-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repositories/{repository_id}/environments/{environment_name}/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#get-an-environment-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#update-an-environment-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /scim/v2/Groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#list-provisioned-scim-groups-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /scim/v2/Groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#provision-a-scim-enterprise-group openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /scim/v2/Groups/{scim_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#delete-a-scim-group-from-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /scim/v2/Groups/{scim_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-group openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /scim/v2/Groups/{scim_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#update-an-attribute-for-a-scim-enterprise-group openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /scim/v2/Groups/{scim_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#set-scim-information-for-a-provisioned-enterprise-group openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /scim/v2/Users documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#list-scim-provisioned-identities-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /scim/v2/Users documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#provision-a-scim-enterprise-user openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /scim/v2/Users/{scim_user_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#delete-a-scim-user-from-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /scim/v2/Users/{scim_user_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-user openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /scim/v2/Users/{scim_user_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#update-an-attribute-for-a-scim-enterprise-user openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /scim/v2/Users/{scim_user_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#set-scim-information-for-a-provisioned-enterprise-user openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /scim/v2/organizations/{org}/Users documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#list-scim-provisioned-identities openapi_files: @@ -5244,189 +5333,189 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /search/commits documentation_url: https://docs.github.com/rest/search/search#search-commits openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /search/issues documentation_url: https://docs.github.com/rest/search/search#search-issues-and-pull-requests openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /search/labels documentation_url: https://docs.github.com/rest/search/search#search-labels openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /search/repositories documentation_url: https://docs.github.com/rest/search/search#search-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /search/topics documentation_url: https://docs.github.com/rest/search/search#search-topics openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /search/users documentation_url: https://docs.github.com/rest/search/search#search-users openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /setup/api/configcheck - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#get-the-configuration-status + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/management-console#get-the-configuration-status openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /setup/api/configure - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#start-a-configuration-process + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/management-console#start-a-configuration-process openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /setup/api/maintenance - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#get-the-maintenance-status + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/management-console#get-the-maintenance-status openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /setup/api/maintenance - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#enable-or-disable-maintenance-mode + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/management-console#enable-or-disable-maintenance-mode openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /setup/api/settings - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#get-settings + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/management-console#get-settings openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /setup/api/settings - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#set-settings + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/management-console#set-settings openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /setup/api/settings/authorized-keys - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#remove-an-authorized-ssh-key + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/management-console#remove-an-authorized-ssh-key openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /setup/api/settings/authorized-keys - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#get-all-authorized-ssh-keys + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/management-console#get-all-authorized-ssh-keys openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /setup/api/settings/authorized-keys - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#add-an-authorized-ssh-key + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/management-console#add-an-authorized-ssh-key openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /setup/api/start - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#create-a-github-license + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/management-console#create-a-github-license openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /setup/api/upgrade - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#upgrade-a-license + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/management-console#upgrade-a-license openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /teams/{team_id} documentation_url: https://docs.github.com/rest/teams/teams#delete-a-team-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /teams/{team_id} documentation_url: https://docs.github.com/rest/teams/teams#get-a-team-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /teams/{team_id} documentation_url: https://docs.github.com/rest/teams/teams#update-a-team-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /teams/{team_id}/discussions documentation_url: https://docs.github.com/rest/teams/discussions#list-discussions-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /teams/{team_id}/discussions documentation_url: https://docs.github.com/rest/teams/discussions#create-a-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /teams/{team_id}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#delete-a-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /teams/{team_id}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#get-a-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /teams/{team_id}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#update-a-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /teams/{team_id}/discussions/{discussion_number}/comments documentation_url: https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /teams/{team_id}/discussions/{discussion_number}/comments documentation_url: https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /teams/{team_id}/discussions/{discussion_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /teams/{team_id}/discussions/{discussion_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /teams/{team_id}/invitations documentation_url: https://docs.github.com/rest/teams/members#list-pending-team-invitations-legacy openapi_files: @@ -5437,91 +5526,91 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /teams/{team_id}/members/{username} documentation_url: https://docs.github.com/rest/teams/members#remove-team-member-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /teams/{team_id}/members/{username} documentation_url: https://docs.github.com/rest/teams/members#get-team-member-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /teams/{team_id}/members/{username} documentation_url: https://docs.github.com/rest/teams/members#add-team-member-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /teams/{team_id}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /teams/{team_id}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#get-team-membership-for-a-user-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /teams/{team_id}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /teams/{team_id}/projects documentation_url: https://docs.github.com/rest/teams/teams#list-team-projects-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /teams/{team_id}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /teams/{team_id}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /teams/{team_id}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /teams/{team_id}/repos documentation_url: https://docs.github.com/rest/teams/teams#list-team-repositories-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /teams/{team_id}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /teams/{team_id}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /teams/{team_id}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /teams/{team_id}/team-sync/group-mappings documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#list-idp-groups-for-a-team-legacy openapi_files: @@ -5535,19 +5624,19 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user documentation_url: https://docs.github.com/rest/users/users#get-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /user documentation_url: https://docs.github.com/rest/users/users#update-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/blocks documentation_url: https://docs.github.com/rest/users/blocking#list-users-blocked-by-the-authenticated-user openapi_files: @@ -5673,7 +5762,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /user/email/visibility documentation_url: https://docs.github.com/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user openapi_files: @@ -5684,97 +5773,97 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/emails documentation_url: https://docs.github.com/rest/users/emails#list-email-addresses-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /user/emails documentation_url: https://docs.github.com/rest/users/emails#add-an-email-address-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/followers documentation_url: https://docs.github.com/rest/users/followers#list-followers-of-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/following documentation_url: https://docs.github.com/rest/users/followers#list-the-people-the-authenticated-user-follows openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /user/following/{username} documentation_url: https://docs.github.com/rest/users/followers#unfollow-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/following/{username} documentation_url: https://docs.github.com/rest/users/followers#check-if-a-person-is-followed-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /user/following/{username} documentation_url: https://docs.github.com/rest/users/followers#follow-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/gpg_keys documentation_url: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /user/gpg_keys documentation_url: https://docs.github.com/rest/users/gpg-keys#create-a-gpg-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /user/gpg_keys/{gpg_key_id} documentation_url: https://docs.github.com/rest/users/gpg-keys#delete-a-gpg-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/gpg_keys/{gpg_key_id} documentation_url: https://docs.github.com/rest/users/gpg-keys#get-a-gpg-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/installations documentation_url: https://docs.github.com/rest/apps/installations#list-app-installations-accessible-to-the-user-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/installations/{installation_id}/repositories documentation_url: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-user-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /user/installations/{installation_id}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/apps/installations#remove-a-repository-from-an-app-installation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /user/installations/{installation_id}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/apps/installations#add-a-repository-to-an-app-installation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /user/interaction-limits documentation_url: https://docs.github.com/rest/interactions/user#remove-interaction-restrictions-from-your-public-repositories openapi_files: @@ -5795,31 +5884,31 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/keys documentation_url: https://docs.github.com/rest/users/keys#list-public-ssh-keys-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /user/keys documentation_url: https://docs.github.com/rest/users/keys#create-a-public-ssh-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /user/keys/{key_id} documentation_url: https://docs.github.com/rest/users/keys#delete-a-public-ssh-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/keys/{key_id} documentation_url: https://docs.github.com/rest/users/keys#get-a-public-ssh-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/marketplace_purchases documentation_url: https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user openapi_files: @@ -5835,31 +5924,31 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/memberships/orgs/{org} documentation_url: https://docs.github.com/rest/orgs/members#get-an-organization-membership-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /user/memberships/orgs/{org} documentation_url: https://docs.github.com/rest/orgs/members#update-an-organization-membership-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/migrations documentation_url: https://docs.github.com/rest/migrations/users#list-user-migrations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /user/migrations documentation_url: https://docs.github.com/rest/migrations/users#start-a-user-migration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/migrations/{migration_id} documentation_url: https://docs.github.com/rest/migrations/users#get-a-user-migration-status openapi_files: @@ -5875,7 +5964,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock documentation_url: https://docs.github.com/rest/migrations/users#unlock-a-user-repository openapi_files: @@ -5886,343 +5975,343 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/orgs documentation_url: https://docs.github.com/rest/orgs/orgs#list-organizations-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/packages documentation_url: https://docs.github.com/rest/packages/packages#list-packages-for-the-authenticated-users-namespace openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /user/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /user/packages/{package_type}/{package_name}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/packages/{package_type}/{package_name}/versions documentation_url: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-version-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-version-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-version-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /user/projects documentation_url: https://docs.github.com/rest/projects/projects#create-a-user-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/public_emails documentation_url: https://docs.github.com/rest/users/emails#list-public-email-addresses-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/repos documentation_url: https://docs.github.com/rest/repos/repos#list-repositories-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /user/repos documentation_url: https://docs.github.com/rest/repos/repos#create-a-repository-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/repository_invitations documentation_url: https://docs.github.com/rest/collaborators/invitations#list-repository-invitations-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /user/repository_invitations/{invitation_id} documentation_url: https://docs.github.com/rest/collaborators/invitations#decline-a-repository-invitation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /user/repository_invitations/{invitation_id} documentation_url: https://docs.github.com/rest/collaborators/invitations#accept-a-repository-invitation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /user/social_accounts documentation_url: https://docs.github.com/rest/users/social-accounts#delete-social-accounts-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/social_accounts documentation_url: https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /user/social_accounts documentation_url: https://docs.github.com/rest/users/social-accounts#add-social-accounts-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/ssh_signing_keys documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /user/ssh_signing_keys documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#create-a-ssh-signing-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /user/ssh_signing_keys/{ssh_signing_key_id} documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#delete-an-ssh-signing-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/ssh_signing_keys/{ssh_signing_key_id} documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#get-an-ssh-signing-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/starred documentation_url: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /user/starred/{owner}/{repo} documentation_url: https://docs.github.com/rest/activity/starring#unstar-a-repository-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/starred/{owner}/{repo} documentation_url: https://docs.github.com/rest/activity/starring#check-if-a-repository-is-starred-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /user/starred/{owner}/{repo} documentation_url: https://docs.github.com/rest/activity/starring#star-a-repository-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/subscriptions documentation_url: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/teams documentation_url: https://docs.github.com/rest/teams/teams#list-teams-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users documentation_url: https://docs.github.com/rest/users/users#list-users openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username} documentation_url: https://docs.github.com/rest/users/users#get-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/docker/conflicts documentation_url: https://docs.github.com/rest/packages/packages#get-list-of-conflicting-packages-during-docker-migration-for-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/events documentation_url: https://docs.github.com/rest/activity/events#list-events-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/events/orgs/{org} documentation_url: https://docs.github.com/rest/activity/events#list-organization-events-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/events/public documentation_url: https://docs.github.com/rest/activity/events#list-public-events-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/followers documentation_url: https://docs.github.com/rest/users/followers#list-followers-of-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/following documentation_url: https://docs.github.com/rest/users/followers#list-the-people-a-user-follows openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/following/{target_user} documentation_url: https://docs.github.com/rest/users/followers#check-if-a-user-follows-another-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/gists documentation_url: https://docs.github.com/rest/gists/gists#list-gists-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/gpg_keys documentation_url: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/hovercard documentation_url: https://docs.github.com/rest/users/users#get-contextual-information-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/installation documentation_url: https://docs.github.com/rest/apps/apps#get-a-user-installation-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/keys documentation_url: https://docs.github.com/rest/users/keys#list-public-keys-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/orgs documentation_url: https://docs.github.com/rest/orgs/orgs#list-organizations-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/packages documentation_url: https://docs.github.com/rest/packages/packages#list-packages-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /users/{username}/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /users/{username}/packages/{package_type}/{package_name}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/packages/{package_type}/{package_name}/versions documentation_url: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#delete-package-version-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-version-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-package-version-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/projects documentation_url: https://docs.github.com/rest/projects/projects#list-user-projects openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/received_events documentation_url: https://docs.github.com/rest/activity/events#list-events-received-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/received_events/public documentation_url: https://docs.github.com/rest/activity/events#list-public-events-received-by-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/repos documentation_url: https://docs.github.com/rest/repos/repos#list-repositories-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/settings/billing/actions documentation_url: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-a-user openapi_files: @@ -6239,45 +6328,45 @@ openapi_operations: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: DELETE /users/{username}/site_admin - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#demote-a-site-administrator + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#demote-a-site-administrator openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /users/{username}/site_admin - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/social_accounts documentation_url: https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/ssh_signing_keys documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/starred documentation_url: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/subscriptions documentation_url: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /users/{username}/suspended - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#unsuspend-a-user + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#unsuspend-a-user openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /users/{username}/suspended - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#suspend-a-user + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#suspend-a-user openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /versions documentation_url: https://docs.github.com/rest/meta/meta#get-all-api-versions openapi_files: @@ -6288,4 +6377,4 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json From c135be9459ed40979be841f065badb7de19d467b Mon Sep 17 00:00:00 2001 From: Peter Aglen <86360391+peter-aglen@users.noreply.github.com> Date: Fri, 8 Dec 2023 14:36:23 +0100 Subject: [PATCH 361/751] Fix broken CreateOrUpdateRepoCustomPropertyValues (#3023) Fixes: #3021. --- github/orgs_properties.go | 6 +++--- github/orgs_properties_test.go | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/github/orgs_properties.go b/github/orgs_properties.go index 45e3f1f964d..2e88b7f4f98 100644 --- a/github/orgs_properties.go +++ b/github/orgs_properties.go @@ -178,12 +178,12 @@ func (s *OrganizationsService) ListCustomPropertyValues(ctx context.Context, org // GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-property-values-for-organization-repositories // //meta:operation PATCH /orgs/{org}/properties/values -func (s *OrganizationsService) CreateOrUpdateRepoCustomPropertyValues(ctx context.Context, org string, repoNames []string, properties []*CustomProperty) (*Response, error) { +func (s *OrganizationsService) CreateOrUpdateRepoCustomPropertyValues(ctx context.Context, org string, repoNames []string, properties []*CustomPropertyValue) (*Response, error) { u := fmt.Sprintf("orgs/%v/properties/values", org) params := struct { - RepositoryNames []string `json:"repository_names"` - Properties []*CustomProperty `json:"properties"` + RepositoryNames []string `json:"repository_names"` + Properties []*CustomPropertyValue `json:"properties"` }{ RepositoryNames: repoNames, Properties: properties, diff --git a/github/orgs_properties_test.go b/github/orgs_properties_test.go index 1a372306046..86daedb3a5b 100644 --- a/github/orgs_properties_test.go +++ b/github/orgs_properties_test.go @@ -347,14 +347,14 @@ func TestOrganizationsService_CreateOrUpdateRepoCustomPropertyValues(t *testing. mux.HandleFunc("/orgs/o/properties/values", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") - testBody(t, r, `{"repository_names":["repo"],"properties":[{"property_name":"service","value_type":"string"}]}`+"\n") + testBody(t, r, `{"repository_names":["repo"],"properties":[{"property_name":"service","value":"string"}]}`+"\n") }) ctx := context.Background() - _, err := client.Organizations.CreateOrUpdateRepoCustomPropertyValues(ctx, "o", []string{"repo"}, []*CustomProperty{ + _, err := client.Organizations.CreateOrUpdateRepoCustomPropertyValues(ctx, "o", []string{"repo"}, []*CustomPropertyValue{ { - PropertyName: String("service"), - ValueType: "string", + PropertyName: "service", + Value: String("string"), }, }) if err != nil { From fb8a83de3e7046c49ab76e09a4e9b5857f8f3997 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 14:28:57 -0500 Subject: [PATCH 362/751] Bump actions/setup-go from 4 to 5 (#3027) --- .github/workflows/linter.yml | 2 +- .github/workflows/tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index f9d6d7e4639..24f3d909db4 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: 1.x cache-dependency-path: "**/go.sum" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b3abd8b6f92..3067b1b0bec 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,7 +39,7 @@ jobs: runs-on: ${{ matrix.platform }} steps: - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} - uses: actions/checkout@v4 From c4ec3276de8584568e12e2a6af0d84a29a5ba8d8 Mon Sep 17 00:00:00 2001 From: Tomasz Adam Skrzypczak Date: Thu, 14 Dec 2023 09:14:41 -0500 Subject: [PATCH 363/751] Add scanning validity checks (#3026) Fixes: #3006. --- .../enterprise_code_security_and_analysis.go | 1 + ...erprise_code_security_and_analysis_test.go | 5 ++- github/github-accessors.go | 32 ++++++++++++++++ github/github-accessors_test.go | 37 +++++++++++++++++++ github/github-stringify_test.go | 20 +++++----- github/orgs.go | 2 + github/repos.go | 8 ++++ github/repos_test.go | 4 +- 8 files changed, 97 insertions(+), 12 deletions(-) diff --git a/github/enterprise_code_security_and_analysis.go b/github/enterprise_code_security_and_analysis.go index af8eb0ffb2f..159aeae4dca 100644 --- a/github/enterprise_code_security_and_analysis.go +++ b/github/enterprise_code_security_and_analysis.go @@ -16,6 +16,7 @@ type EnterpriseSecurityAnalysisSettings struct { SecretScanningEnabledForNewRepositories *bool `json:"secret_scanning_enabled_for_new_repositories,omitempty"` SecretScanningPushProtectionEnabledForNewRepositories *bool `json:"secret_scanning_push_protection_enabled_for_new_repositories,omitempty"` SecretScanningPushProtectionCustomLink *string `json:"secret_scanning_push_protection_custom_link,omitempty"` + SecretScanningValidityChecksEnabled *bool `json:"secret_scanning_validity_checks_enabled,omitempty"` } // GetCodeSecurityAndAnalysis gets code security and analysis features for an enterprise. diff --git a/github/enterprise_code_security_and_analysis_test.go b/github/enterprise_code_security_and_analysis_test.go index 25dbd941702..17bbe18beae 100644 --- a/github/enterprise_code_security_and_analysis_test.go +++ b/github/enterprise_code_security_and_analysis_test.go @@ -27,7 +27,8 @@ func TestEnterpriseService_GetCodeSecurityAndAnalysis(t *testing.T) { "advanced_security_enabled_for_new_repositories": true, "secret_scanning_enabled_for_new_repositories": true, "secret_scanning_push_protection_enabled_for_new_repositories": true, - "secret_scanning_push_protection_custom_link": "https://github.com/test-org/test-repo/blob/main/README.md" + "secret_scanning_push_protection_custom_link": "https://github.com/test-org/test-repo/blob/main/README.md", + "secret_scanning_validity_checks_enabled": true }`) }) @@ -44,6 +45,7 @@ func TestEnterpriseService_GetCodeSecurityAndAnalysis(t *testing.T) { SecretScanningEnabledForNewRepositories: Bool(true), SecretScanningPushProtectionEnabledForNewRepositories: Bool(true), SecretScanningPushProtectionCustomLink: String("https://github.com/test-org/test-repo/blob/main/README.md"), + SecretScanningValidityChecksEnabled: Bool(true), } if !cmp.Equal(settings, want) { @@ -73,6 +75,7 @@ func TestEnterpriseService_UpdateCodeSecurityAndAnalysis(t *testing.T) { SecretScanningEnabledForNewRepositories: Bool(true), SecretScanningPushProtectionEnabledForNewRepositories: Bool(true), SecretScanningPushProtectionCustomLink: String("https://github.com/test-org/test-repo/blob/main/README.md"), + SecretScanningValidityChecksEnabled: Bool(true), } mux.HandleFunc("/enterprises/e/code_security_and_analysis", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/github-accessors.go b/github/github-accessors.go index e15eb10204b..4cb34b1260a 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -6974,6 +6974,14 @@ func (e *EnterpriseSecurityAnalysisSettings) GetSecretScanningPushProtectionEnab return *e.SecretScanningPushProtectionEnabledForNewRepositories } +// GetSecretScanningValidityChecksEnabled returns the SecretScanningValidityChecksEnabled field if it's non-nil, zero value otherwise. +func (e *EnterpriseSecurityAnalysisSettings) GetSecretScanningValidityChecksEnabled() bool { + if e == nil || e.SecretScanningValidityChecksEnabled == nil { + return false + } + return *e.SecretScanningValidityChecksEnabled +} + // GetCanAdminsBypass returns the CanAdminsBypass field if it's non-nil, zero value otherwise. func (e *Environment) GetCanAdminsBypass() bool { if e == nil || e.CanAdminsBypass == nil { @@ -12734,6 +12742,14 @@ func (o *Organization) GetSecretScanningPushProtectionEnabledForNewRepos() bool return *o.SecretScanningPushProtectionEnabledForNewRepos } +// GetSecretScanningValidityChecksEnabled returns the SecretScanningValidityChecksEnabled field if it's non-nil, zero value otherwise. +func (o *Organization) GetSecretScanningValidityChecksEnabled() bool { + if o == nil || o.SecretScanningValidityChecksEnabled == nil { + return false + } + return *o.SecretScanningValidityChecksEnabled +} + // GetTotalPrivateRepos returns the TotalPrivateRepos field if it's non-nil, zero value otherwise. func (o *Organization) GetTotalPrivateRepos() int64 { if o == nil || o.TotalPrivateRepos == nil { @@ -21590,6 +21606,14 @@ func (s *SecretScanningPushProtection) GetStatus() string { return *s.Status } +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (s *SecretScanningValidityChecks) GetStatus() string { + if s == nil || s.Status == nil { + return "" + } + return *s.Status +} + // GetAuthor returns the Author field. func (s *SecurityAdvisory) GetAuthor() *User { if s == nil { @@ -21830,6 +21854,14 @@ func (s *SecurityAndAnalysis) GetSecretScanningPushProtection() *SecretScanningP return s.SecretScanningPushProtection } +// GetSecretScanningValidityChecks returns the SecretScanningValidityChecks field. +func (s *SecurityAndAnalysis) GetSecretScanningValidityChecks() *SecretScanningValidityChecks { + if s == nil { + return nil + } + return s.SecretScanningValidityChecks +} + // GetFrom returns the From field. func (s *SecurityAndAnalysisChange) GetFrom() *SecurityAndAnalysisChangeFrom { if s == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 84d104f18cb..cdc27ab9966 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -8175,6 +8175,16 @@ func TestEnterpriseSecurityAnalysisSettings_GetSecretScanningPushProtectionEnabl e.GetSecretScanningPushProtectionEnabledForNewRepositories() } +func TestEnterpriseSecurityAnalysisSettings_GetSecretScanningValidityChecksEnabled(tt *testing.T) { + var zeroValue bool + e := &EnterpriseSecurityAnalysisSettings{SecretScanningValidityChecksEnabled: &zeroValue} + e.GetSecretScanningValidityChecksEnabled() + e = &EnterpriseSecurityAnalysisSettings{} + e.GetSecretScanningValidityChecksEnabled() + e = nil + e.GetSecretScanningValidityChecksEnabled() +} + func TestEnvironment_GetCanAdminsBypass(tt *testing.T) { var zeroValue bool e := &Environment{CanAdminsBypass: &zeroValue} @@ -14928,6 +14938,16 @@ func TestOrganization_GetSecretScanningPushProtectionEnabledForNewRepos(tt *test o.GetSecretScanningPushProtectionEnabledForNewRepos() } +func TestOrganization_GetSecretScanningValidityChecksEnabled(tt *testing.T) { + var zeroValue bool + o := &Organization{SecretScanningValidityChecksEnabled: &zeroValue} + o.GetSecretScanningValidityChecksEnabled() + o = &Organization{} + o.GetSecretScanningValidityChecksEnabled() + o = nil + o.GetSecretScanningValidityChecksEnabled() +} + func TestOrganization_GetTotalPrivateRepos(tt *testing.T) { var zeroValue int64 o := &Organization{TotalPrivateRepos: &zeroValue} @@ -25149,6 +25169,16 @@ func TestSecretScanningPushProtection_GetStatus(tt *testing.T) { s.GetStatus() } +func TestSecretScanningValidityChecks_GetStatus(tt *testing.T) { + var zeroValue string + s := &SecretScanningValidityChecks{Status: &zeroValue} + s.GetStatus() + s = &SecretScanningValidityChecks{} + s.GetStatus() + s = nil + s.GetStatus() +} + func TestSecurityAdvisory_GetAuthor(tt *testing.T) { s := &SecurityAdvisory{} s.GetAuthor() @@ -25404,6 +25434,13 @@ func TestSecurityAndAnalysis_GetSecretScanningPushProtection(tt *testing.T) { s.GetSecretScanningPushProtection() } +func TestSecurityAndAnalysis_GetSecretScanningValidityChecks(tt *testing.T) { + s := &SecurityAndAnalysis{} + s.GetSecretScanningValidityChecks() + s = nil + s.GetSecretScanningValidityChecks() +} + func TestSecurityAndAnalysisChange_GetFrom(tt *testing.T) { s := &SecurityAndAnalysisChange{} s.GetFrom() diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index 7472edfd59a..bb69ce1ad5a 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -1051,15 +1051,16 @@ func TestOrganization_String(t *testing.T) { DependencyGraphEnabledForNewRepos: Bool(false), SecretScanningEnabledForNewRepos: Bool(false), SecretScanningPushProtectionEnabledForNewRepos: Bool(false), - URL: String(""), - EventsURL: String(""), - HooksURL: String(""), - IssuesURL: String(""), - MembersURL: String(""), - PublicMembersURL: String(""), - ReposURL: String(""), + SecretScanningValidityChecksEnabled: Bool(false), + URL: String(""), + EventsURL: String(""), + HooksURL: String(""), + IssuesURL: String(""), + MembersURL: String(""), + 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, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, 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, WebCommitSignoffRequired:false, AdvancedSecurityEnabledForNewRepos:false, DependabotAlertsEnabledForNewRepos:false, DependabotSecurityUpdatesEnabledForNewRepos:false, DependencyGraphEnabledForNewRepos:false, SecretScanningEnabledForNewRepos:false, SecretScanningPushProtectionEnabledForNewRepos: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, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, 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, WebCommitSignoffRequired:false, AdvancedSecurityEnabledForNewRepos:false, DependabotAlertsEnabledForNewRepos:false, DependabotSecurityUpdatesEnabledForNewRepos:false, DependencyGraphEnabledForNewRepos:false, SecretScanningEnabledForNewRepos:false, SecretScanningPushProtectionEnabledForNewRepos:false, SecretScanningValidityChecksEnabled:false, URL:"", EventsURL:"", HooksURL:"", IssuesURL:"", MembersURL:"", PublicMembersURL:"", ReposURL:""}` if got := v.String(); got != want { t.Errorf("Organization.String = %v, want %v", got, want) } @@ -1826,8 +1827,9 @@ func TestSecurityAndAnalysis_String(t *testing.T) { SecretScanning: &SecretScanning{}, SecretScanningPushProtection: &SecretScanningPushProtection{}, DependabotSecurityUpdates: &DependabotSecurityUpdates{}, + SecretScanningValidityChecks: &SecretScanningValidityChecks{}, } - want := `github.SecurityAndAnalysis{AdvancedSecurity:github.AdvancedSecurity{}, SecretScanning:github.SecretScanning{}, SecretScanningPushProtection:github.SecretScanningPushProtection{}, DependabotSecurityUpdates:github.DependabotSecurityUpdates{}}` + want := `github.SecurityAndAnalysis{AdvancedSecurity:github.AdvancedSecurity{}, SecretScanning:github.SecretScanning{}, SecretScanningPushProtection:github.SecretScanningPushProtection{}, DependabotSecurityUpdates:github.DependabotSecurityUpdates{}, SecretScanningValidityChecks:github.SecretScanningValidityChecks{}}` if got := v.String(); got != want { t.Errorf("SecurityAndAnalysis.String = %v, want %v", got, want) } diff --git a/github/orgs.go b/github/orgs.go index 4d3465271b6..27c0f102842 100644 --- a/github/orgs.go +++ b/github/orgs.go @@ -95,6 +95,8 @@ type Organization struct { SecretScanningEnabledForNewRepos *bool `json:"secret_scanning_enabled_for_new_repositories,omitempty"` // SecretScanningPushProtectionEnabledForNewRepos toggles whether secret scanning push protection is enabled on new repositories. SecretScanningPushProtectionEnabledForNewRepos *bool `json:"secret_scanning_push_protection_enabled_for_new_repositories,omitempty"` + // SecretScanningValidityChecksEnabled toggles whether secret scanning validity check is enabled. + SecretScanningValidityChecksEnabled *bool `json:"secret_scanning_validity_checks_enabled,omitempty"` // API URLs URL *string `json:"url,omitempty"` diff --git a/github/repos.go b/github/repos.go index 5fcf219b3cf..a7574d72f07 100644 --- a/github/repos.go +++ b/github/repos.go @@ -198,6 +198,7 @@ type SecurityAndAnalysis struct { SecretScanning *SecretScanning `json:"secret_scanning,omitempty"` SecretScanningPushProtection *SecretScanningPushProtection `json:"secret_scanning_push_protection,omitempty"` DependabotSecurityUpdates *DependabotSecurityUpdates `json:"dependabot_security_updates,omitempty"` + SecretScanningValidityChecks *SecretScanningValidityChecks `json:"secret_scanning_validity_checks,omitempty"` } func (s SecurityAndAnalysis) String() string { @@ -248,6 +249,13 @@ func (d DependabotSecurityUpdates) String() string { return Stringify(d) } +// SecretScanningValidityChecks represents the state of secret scanning validity checks on a repository. +// +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-security-and-analysis-settings-for-your-repository#allowing-validity-checks-for-partner-patterns-in-a-repository +type SecretScanningValidityChecks struct { + Status *string `json:"status,omitempty"` +} + // List calls either RepositoriesService.ListByUser or RepositoriesService.ListByAuthenticatedUser // depending on whether user is empty. // diff --git a/github/repos_test.go b/github/repos_test.go index fa49ddd4f5c..2e61aeb1b1f 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -360,7 +360,7 @@ func TestRepositoriesService_Get(t *testing.T) { mux.HandleFunc("/repos/o/r", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) - fmt.Fprint(w, `{"id":1,"name":"n","description":"d","owner":{"login":"l"},"license":{"key":"mit"},"security_and_analysis":{"advanced_security":{"status":"enabled"},"secret_scanning":{"status":"enabled"},"secret_scanning_push_protection":{"status":"enabled"},"dependabot_security_updates":{"status": "enabled"}}}`) + fmt.Fprint(w, `{"id":1,"name":"n","description":"d","owner":{"login":"l"},"license":{"key":"mit"},"security_and_analysis":{"advanced_security":{"status":"enabled"},"secret_scanning":{"status":"enabled"},"secret_scanning_push_protection":{"status":"enabled"},"dependabot_security_updates":{"status": "enabled"}, "secret_scanning_validity_checks":{"status":"enabled"}}}`) }) ctx := context.Background() @@ -369,7 +369,7 @@ func TestRepositoriesService_Get(t *testing.T) { t.Errorf("Repositories.Get returned error: %v", err) } - want := &Repository{ID: Int64(1), Name: String("n"), Description: String("d"), Owner: &User{Login: String("l")}, License: &License{Key: String("mit")}, SecurityAndAnalysis: &SecurityAndAnalysis{AdvancedSecurity: &AdvancedSecurity{Status: String("enabled")}, SecretScanning: &SecretScanning{String("enabled")}, SecretScanningPushProtection: &SecretScanningPushProtection{String("enabled")}, DependabotSecurityUpdates: &DependabotSecurityUpdates{String("enabled")}}} + want := &Repository{ID: Int64(1), Name: String("n"), Description: String("d"), Owner: &User{Login: String("l")}, License: &License{Key: String("mit")}, SecurityAndAnalysis: &SecurityAndAnalysis{AdvancedSecurity: &AdvancedSecurity{Status: String("enabled")}, SecretScanning: &SecretScanning{String("enabled")}, SecretScanningPushProtection: &SecretScanningPushProtection{String("enabled")}, DependabotSecurityUpdates: &DependabotSecurityUpdates{String("enabled")}, SecretScanningValidityChecks: &SecretScanningValidityChecks{String("enabled")}}} if !cmp.Equal(got, want) { t.Errorf("Repositories.Get returned %+v, want %+v", got, want) } From d47936fec3c94de5b655df9d9da717a7d9137ce2 Mon Sep 17 00:00:00 2001 From: Khanh Ngo Date: Fri, 15 Dec 2023 18:55:20 +0100 Subject: [PATCH 364/751] Add Referrer field to AuditEntry (#3032) Fixes: #3031. --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ github/orgs_audit_log.go | 1 + 3 files changed, 19 insertions(+) diff --git a/github/github-accessors.go b/github/github-accessors.go index 4cb34b1260a..b13ed4083ff 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -1454,6 +1454,14 @@ func (a *AuditEntry) GetReadOnly() string { return *a.ReadOnly } +// GetReferrer returns the Referrer field if it's non-nil, zero value otherwise. +func (a *AuditEntry) GetReferrer() string { + if a == nil || a.Referrer == nil { + return "" + } + return *a.Referrer +} + // GetRepo returns the Repo field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetRepo() string { if a == nil || a.Repo == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index cdc27ab9966..c8bd40b5333 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -1731,6 +1731,16 @@ func TestAuditEntry_GetReadOnly(tt *testing.T) { a.GetReadOnly() } +func TestAuditEntry_GetReferrer(tt *testing.T) { + var zeroValue string + a := &AuditEntry{Referrer: &zeroValue} + a.GetReferrer() + a = &AuditEntry{} + a.GetReferrer() + a = nil + a.GetReferrer() +} + func TestAuditEntry_GetRepo(tt *testing.T) { var zeroValue string a := &AuditEntry{Repo: &zeroValue} diff --git a/github/orgs_audit_log.go b/github/orgs_audit_log.go index e3afd3117f5..aa3591359ef 100644 --- a/github/orgs_audit_log.go +++ b/github/orgs_audit_log.go @@ -95,6 +95,7 @@ type AuditEntry struct { PullRequestURL *string `json:"pull_request_url,omitempty"` ReadOnly *string `json:"read_only,omitempty"` Reasons []*PolicyOverrideReason `json:"reasons,omitempty"` + Referrer *string `json:"referrer,omitempty"` Repo *string `json:"repo,omitempty"` Repository *string `json:"repository,omitempty"` RepositoryPublic *bool `json:"repository_public,omitempty"` From 2cc47f9fa6b4d4997260c590388eecd19045c145 Mon Sep 17 00:00:00 2001 From: Rufina Talalaeva Date: Fri, 15 Dec 2023 22:20:07 +0300 Subject: [PATCH 365/751] Add code_search and dependency_snapshots for RateLimits (#3019) Fixes: #3018. --- github/github-accessors.go | 16 ++++++++ github/github-accessors_test.go | 14 +++++++ github/github.go | 14 +++++++ github/github_test.go | 10 +++++ github/rate_limit.go | 8 ++++ github/rate_limit_test.go | 68 +++++++++++++++++++++++++++++++-- 6 files changed, 127 insertions(+), 3 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index b13ed4083ff..02d1212cd9b 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -17790,6 +17790,14 @@ func (r *RateLimits) GetCodeScanningUpload() *Rate { return r.CodeScanningUpload } +// GetCodeSearch returns the CodeSearch field. +func (r *RateLimits) GetCodeSearch() *Rate { + if r == nil { + return nil + } + return r.CodeSearch +} + // GetCore returns the Core field. func (r *RateLimits) GetCore() *Rate { if r == nil { @@ -17798,6 +17806,14 @@ func (r *RateLimits) GetCore() *Rate { return r.Core } +// GetDependencySnapshots returns the DependencySnapshots field. +func (r *RateLimits) GetDependencySnapshots() *Rate { + if r == nil { + return nil + } + return r.DependencySnapshots +} + // GetGraphQL returns the GraphQL field. func (r *RateLimits) GetGraphQL() *Rate { if r == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index c8bd40b5333..6ae89e454a6 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -20636,6 +20636,13 @@ func TestRateLimits_GetCodeScanningUpload(tt *testing.T) { r.GetCodeScanningUpload() } +func TestRateLimits_GetCodeSearch(tt *testing.T) { + r := &RateLimits{} + r.GetCodeSearch() + r = nil + r.GetCodeSearch() +} + func TestRateLimits_GetCore(tt *testing.T) { r := &RateLimits{} r.GetCore() @@ -20643,6 +20650,13 @@ func TestRateLimits_GetCore(tt *testing.T) { r.GetCore() } +func TestRateLimits_GetDependencySnapshots(tt *testing.T) { + r := &RateLimits{} + r.GetDependencySnapshots() + r = nil + r.GetDependencySnapshots() +} + func TestRateLimits_GetGraphQL(tt *testing.T) { r := &RateLimits{} r.GetGraphQL() diff --git a/github/github.go b/github/github.go index c248b256f6e..e41036361a8 100644 --- a/github/github.go +++ b/github/github.go @@ -1303,6 +1303,8 @@ const ( codeScanningUploadCategory actionsRunnerRegistrationCategory scimCategory + dependencySnapshotsCategory + codeSearchCategory categories // An array of this length will be able to contain all rate limit categories. ) @@ -1315,6 +1317,12 @@ func category(method, path string) rateLimitCategory { // NOTE: coreCategory is returned for actionsRunnerRegistrationCategory too, // because no API found for this category. return coreCategory + + // https://docs.github.com/en/rest/search/search#search-code + case strings.HasPrefix(path, "/search/code") && + method == http.MethodGet: + return codeSearchCategory + case strings.HasPrefix(path, "/search/"): return searchCategory case path == "/graphql": @@ -1337,6 +1345,12 @@ func category(method, path string) rateLimitCategory { // https://docs.github.com/enterprise-cloud@latest/rest/scim case strings.HasPrefix(path, "/scim/"): return scimCategory + + // https://docs.github.com/en/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository + case strings.HasPrefix(path, "/repos/") && + strings.HasSuffix(path, "/dependency-graph/snapshots") && + method == http.MethodPost: + return dependencySnapshotsCategory } } diff --git a/github/github_test.go b/github/github_test.go index b994496cc01..933d29e7741 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -1153,6 +1153,16 @@ func TestDo_rateLimitCategory(t *testing.T) { url: "/scim/v2/organizations/ORG/Users", category: scimCategory, }, + { + method: http.MethodPost, + url: "/repos/google/go-github/dependency-graph/snapshots", + category: dependencySnapshotsCategory, + }, + { + method: http.MethodGet, + url: "/search/code?q=rate", + category: codeSearchCategory, + }, // missing a check for actionsRunnerRegistrationCategory: API not found } diff --git a/github/rate_limit.go b/github/rate_limit.go index 0fc15f815e2..febe5edccfb 100644 --- a/github/rate_limit.go +++ b/github/rate_limit.go @@ -52,6 +52,8 @@ type RateLimits struct { CodeScanningUpload *Rate `json:"code_scanning_upload"` ActionsRunnerRegistration *Rate `json:"actions_runner_registration"` SCIM *Rate `json:"scim"` + DependencySnapshots *Rate `json:"dependency_snapshots"` + CodeSearch *Rate `json:"code_search"` } func (r RateLimits) String() string { @@ -106,6 +108,12 @@ func (s *RateLimitService) Get(ctx context.Context) (*RateLimits, *Response, err if response.Resources.SCIM != nil { s.client.rateLimits[scimCategory] = *response.Resources.SCIM } + if response.Resources.DependencySnapshots != nil { + s.client.rateLimits[dependencySnapshotsCategory] = *response.Resources.DependencySnapshots + } + if response.Resources.CodeSearch != nil { + s.client.rateLimits[codeSearchCategory] = *response.Resources.CodeSearch + } s.client.rateMu.Unlock() } diff --git a/github/rate_limit_test.go b/github/rate_limit_test.go index 167288bc889..da8a68c9106 100644 --- a/github/rate_limit_test.go +++ b/github/rate_limit_test.go @@ -25,8 +25,10 @@ func TestRateLimits_String(t *testing.T) { CodeScanningUpload: &Rate{}, ActionsRunnerRegistration: &Rate{}, SCIM: &Rate{}, + DependencySnapshots: &Rate{}, + CodeSearch: &Rate{}, } - want := `github.RateLimits{Core:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, Search:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, GraphQL:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, IntegrationManifest:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, SourceImport:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, CodeScanningUpload:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, ActionsRunnerRegistration:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, SCIM:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}}` + want := `github.RateLimits{Core:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, Search:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, GraphQL:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, IntegrationManifest:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, SourceImport:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, CodeScanningUpload:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, ActionsRunnerRegistration:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, SCIM:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, DependencySnapshots:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, CodeSearch:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}}` if got := v.String(); got != want { t.Errorf("RateLimits.String = %v, want %v", got, want) } @@ -46,7 +48,9 @@ func TestRateLimits(t *testing.T) { "source_import": {"limit":6,"remaining":5,"reset":1372700877}, "code_scanning_upload": {"limit":7,"remaining":6,"reset":1372700878}, "actions_runner_registration": {"limit":8,"remaining":7,"reset":1372700879}, - "scim": {"limit":9,"remaining":8,"reset":1372700880} + "scim": {"limit":9,"remaining":8,"reset":1372700880}, + "dependency_snapshots": {"limit":10,"remaining":9,"reset":1372700881}, + "code_search": {"limit":11,"remaining":10,"reset":1372700882} }}`) }) @@ -97,6 +101,16 @@ func TestRateLimits(t *testing.T) { Remaining: 8, Reset: Timestamp{time.Date(2013, time.July, 1, 17, 48, 00, 0, time.UTC).Local()}, }, + DependencySnapshots: &Rate{ + Limit: 10, + Remaining: 9, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 48, 1, 0, time.UTC).Local()}, + }, + CodeSearch: &Rate{ + Limit: 11, + Remaining: 10, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 48, 2, 0, time.UTC).Local()}, + }, } if !cmp.Equal(rate, want) { t.Errorf("RateLimits returned %+v, want %+v", rate, want) @@ -137,6 +151,14 @@ func TestRateLimits(t *testing.T) { category: scimCategory, rate: want.SCIM, }, + { + category: dependencySnapshotsCategory, + rate: want.DependencySnapshots, + }, + { + category: codeSearchCategory, + rate: want.CodeSearch, + }, } for _, tt := range tests { @@ -177,7 +199,9 @@ func TestRateLimits_overQuota(t *testing.T) { "source_import": {"limit":6,"remaining":5,"reset":1372700877}, "code_scanning_upload": {"limit":7,"remaining":6,"reset":1372700878}, "actions_runner_registration": {"limit":8,"remaining":7,"reset":1372700879}, - "scim": {"limit":9,"remaining":8,"reset":1372700880} + "scim": {"limit":9,"remaining":8,"reset":1372700880}, + "dependency_snapshots": {"limit":10,"remaining":9,"reset":1372700881}, + "code_search": {"limit":11,"remaining":10,"reset":1372700882} }}`) }) @@ -228,6 +252,16 @@ func TestRateLimits_overQuota(t *testing.T) { Remaining: 8, Reset: Timestamp{time.Date(2013, time.July, 1, 17, 48, 00, 0, time.UTC).Local()}, }, + DependencySnapshots: &Rate{ + Limit: 10, + Remaining: 9, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 48, 1, 0, time.UTC).Local()}, + }, + CodeSearch: &Rate{ + Limit: 11, + Remaining: 10, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 48, 2, 0, time.UTC).Local()}, + }, } if !cmp.Equal(rate, want) { t.Errorf("RateLimits returned %+v, want %+v", rate, want) @@ -269,6 +303,14 @@ func TestRateLimits_overQuota(t *testing.T) { category: scimCategory, rate: want.SCIM, }, + { + category: dependencySnapshotsCategory, + rate: want.DependencySnapshots, + }, + { + category: codeSearchCategory, + rate: want.CodeSearch, + }, } for _, tt := range tests { if got, want := client.rateLimits[tt.category], *tt.rate; got != want { @@ -321,6 +363,16 @@ func TestRateLimits_Marshal(t *testing.T) { Remaining: 1, Reset: Timestamp{referenceTime}, }, + DependencySnapshots: &Rate{ + Limit: 1, + Remaining: 1, + Reset: Timestamp{referenceTime}, + }, + CodeSearch: &Rate{ + Limit: 1, + Remaining: 1, + Reset: Timestamp{referenceTime}, + }, } want := `{ @@ -363,6 +415,16 @@ func TestRateLimits_Marshal(t *testing.T) { "limit": 1, "remaining": 1, "reset": ` + referenceTimeStr + ` + }, + "dependency_snapshots": { + "limit": 1, + "remaining": 1, + "reset": ` + referenceTimeStr + ` + }, + "code_search": { + "limit": 1, + "remaining": 1, + "reset": ` + referenceTimeStr + ` } }` From 37f1826a2248f21f2affb8a37f0ba7787f5afaae Mon Sep 17 00:00:00 2001 From: Kiyofumi Sano <62272140+Kiyo510@users.noreply.github.com> Date: Sat, 16 Dec 2023 07:22:57 +0900 Subject: [PATCH 366/751] Support temporary private fork creation via API (#3025) Fixes: #3007. --- github/security_advisories.go | 31 ++ github/security_advisories_test.go | 474 ++++++++++++++++++++++++++++- 2 files changed, 501 insertions(+), 4 deletions(-) diff --git a/github/security_advisories.go b/github/security_advisories.go index 635263748d4..b5a43f1aac8 100644 --- a/github/security_advisories.go +++ b/github/security_advisories.go @@ -7,6 +7,7 @@ package github import ( "context" + "encoding/json" "fmt" ) @@ -148,6 +149,36 @@ func (s *SecurityAdvisoriesService) RequestCVE(ctx context.Context, owner, repo, return resp, nil } +// CreateTemporaryPrivateFork creates a temporary private fork to collaborate on fixing a security vulnerability in your repository. +// The ghsaID is the GitHub Security Advisory identifier of the advisory. +// +// GitHub API docs: https://docs.github.com/rest/security-advisories/repository-advisories#create-a-temporary-private-fork +// +//meta:operation POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks +func (s *SecurityAdvisoriesService) CreateTemporaryPrivateFork(ctx context.Context, owner, repo, ghsaID string) (*Repository, *Response, error) { + url := fmt.Sprintf("repos/%v/%v/security-advisories/%v/forks", owner, repo, ghsaID) + + req, err := s.client.NewRequest("POST", url, nil) + if err != nil { + return nil, nil, err + } + + fork := new(Repository) + resp, err := s.client.Do(ctx, req, fork) + if err != nil { + if aerr, ok := err.(*AcceptedError); ok { + if err := json.Unmarshal(aerr.Raw, fork); err != nil { + return fork, resp, err + } + + return fork, resp, err + } + return nil, resp, err + } + + return fork, resp, nil +} + // ListRepositorySecurityAdvisoriesForOrg lists the repository security advisories for an organization. // // GitHub API docs: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories-for-an-organization diff --git a/github/security_advisories_test.go b/github/security_advisories_test.go index 918e3e05002..eb8e7d317d6 100644 --- a/github/security_advisories_test.go +++ b/github/security_advisories_test.go @@ -56,6 +56,472 @@ func TestSecurityAdvisoriesService_RequestCVE(t *testing.T) { }) } +func TestSecurityAdvisoriesService_CreateTemporaryPrivateFork(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/security-advisories/ghsa_id/forks", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + fmt.Fprint(w, `{ + "id": 1, + "node_id": "R_kgDPP3c6pQ", + "owner": { + "login": "owner", + "id": 2, + "node_id": "MDQ6VXFGcjYyMjcyMTQw", + "avatar_url": "https://avatars.githubusercontent.com/u/111111?v=4", + "html_url": "https://github.com/xxxxx", + "gravatar_id": "", + "type": "User", + "site_admin": false, + "url": "https://api.github.com/users/owner", + "events_url": "https://api.github.com/users/owner/events{/privacy}", + "following_url": "https://api.github.com/users/owner/following{/other_user}", + "followers_url": "https://api.github.com/users/owner/followers", + "gists_url": "https://api.github.com/users/owner/gists{/gist_id}", + "organizations_url": "https://api.github.com/users/owner/orgs", + "received_events_url": "https://api.github.com/users/owner/received_events", + "repos_url": "https://api.github.com/users/owner/repos", + "starred_url": "https://api.github.com/users/owner/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/owner/subscriptions" + }, + "name": "repo-ghsa-xxxx-xxxx-xxxx", + "full_name": "owner/repo-ghsa-xxxx-xxxx-xxxx", + "default_branch": "master", + "created_at": "2023-12-08T17:22:41Z", + "pushed_at": "2023-12-03T11:27:08Z", + "updated_at": "2023-12-08T17:22:42Z", + "html_url": "https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx", + "clone_url": "https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git", + "git_url": "git://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git", + "ssh_url": "git@github.com:owner/repo-ghsa-xxxx-xxxx-xxxx.git", + "svn_url": "https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx", + "fork": false, + "forks_count": 0, + "network_count": 0, + "open_issues_count": 0, + "open_issues": 0, + "stargazers_count": 0, + "subscribers_count": 0, + "watchers_count": 0, + "watchers": 0, + "size": 0, + "permissions": { + "admin": true, + "maintain": true, + "pull": true, + "push": true, + "triage": true + }, + "allow_forking": true, + "web_commit_signoff_required": false, + "archived": false, + "disabled": false, + "private": true, + "has_issues": false, + "has_wiki": false, + "has_pages": false, + "has_projects": false, + "has_downloads": false, + "has_discussions": false, + "is_template": false, + "url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx", + "archive_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/{archive_format}{/ref}", + "assignees_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/assignees{/user}", + "blobs_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/blobs{/sha}", + "branches_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/branches{/branch}", + "collaborators_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/collaborators{/collaborator}", + "comments_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/comments{/number}", + "commits_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/commits{/sha}", + "compare_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/compare/{base}...{head}", + "contents_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contents/{+path}", + "contributors_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contributors", + "deployments_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/deployments", + "downloads_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/downloads", + "events_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/events", + "forks_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/forks", + "git_commits_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/commits{/sha}", + "git_refs_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/refs{/sha}", + "git_tags_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/tags{/sha}", + "hooks_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/hooks", + "issue_comment_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/comments{/number}", + "issue_events_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/events{/number}", + "issues_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues{/number}", + "keys_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/keys{/key_id}", + "labels_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/labels{/name}", + "languages_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/languages", + "merges_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/merges", + "milestones_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/milestones{/number}", + "notifications_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/notifications{?since,all,participating}", + "pulls_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/pulls{/number}", + "releases_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/releases{/id}", + "stargazers_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/stargazers", + "statuses_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/statuses/{sha}", + "subscribers_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscribers", + "subscription_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscription", + "tags_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/tags", + "teams_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/teams", + "visibility": "private" + }`) + }) + + ctx := context.Background() + fork, _, err := client.SecurityAdvisories.CreateTemporaryPrivateFork(ctx, "o", "r", "ghsa_id") + if err != nil { + t.Errorf("SecurityAdvisoriesService.CreateTemporaryPrivateFork returned error: %v", err) + } + + want := &Repository{ + ID: Int64(1), + NodeID: String("R_kgDPP3c6pQ"), + Owner: &User{ + Login: String("owner"), + ID: Int64(2), + NodeID: String("MDQ6VXFGcjYyMjcyMTQw"), + AvatarURL: String("https://avatars.githubusercontent.com/u/111111?v=4"), + HTMLURL: String("https://github.com/xxxxx"), + GravatarID: String(""), + Type: String("User"), + SiteAdmin: Bool(false), + URL: String("https://api.github.com/users/owner"), + EventsURL: String("https://api.github.com/users/owner/events{/privacy}"), + FollowingURL: String("https://api.github.com/users/owner/following{/other_user}"), + FollowersURL: String("https://api.github.com/users/owner/followers"), + GistsURL: String("https://api.github.com/users/owner/gists{/gist_id}"), + OrganizationsURL: String("https://api.github.com/users/owner/orgs"), + ReceivedEventsURL: String("https://api.github.com/users/owner/received_events"), + ReposURL: String("https://api.github.com/users/owner/repos"), + StarredURL: String("https://api.github.com/users/owner/starred{/owner}{/repo}"), + SubscriptionsURL: String("https://api.github.com/users/owner/subscriptions"), + }, + Name: String("repo-ghsa-xxxx-xxxx-xxxx"), + FullName: String("owner/repo-ghsa-xxxx-xxxx-xxxx"), + DefaultBranch: String("master"), + CreatedAt: &Timestamp{time.Date(2023, time.December, 8, 17, 22, 41, 0, time.UTC)}, + PushedAt: &Timestamp{time.Date(2023, time.December, 3, 11, 27, 8, 0, time.UTC)}, + UpdatedAt: &Timestamp{time.Date(2023, time.December, 8, 17, 22, 42, 0, time.UTC)}, + HTMLURL: String("https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx"), + CloneURL: String("https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git"), + GitURL: String("git://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git"), + SSHURL: String("git@github.com:owner/repo-ghsa-xxxx-xxxx-xxxx.git"), + SVNURL: String("https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx"), + 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), + Permissions: map[string]bool{ + "admin": true, + "maintain": true, + "pull": true, + "push": true, + "triage": true, + }, + AllowForking: Bool(true), + WebCommitSignoffRequired: Bool(false), + Archived: Bool(false), + Disabled: Bool(false), + Private: Bool(true), + HasIssues: Bool(false), + HasWiki: Bool(false), + HasPages: Bool(false), + HasProjects: Bool(false), + HasDownloads: Bool(false), + HasDiscussions: Bool(false), + IsTemplate: Bool(false), + URL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx"), + ArchiveURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/{archive_format}{/ref}"), + AssigneesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/assignees{/user}"), + BlobsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/blobs{/sha}"), + BranchesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/branches{/branch}"), + CollaboratorsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/collaborators{/collaborator}"), + CommentsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/comments{/number}"), + CommitsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/commits{/sha}"), + CompareURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/compare/{base}...{head}"), + ContentsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contents/{+path}"), + ContributorsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contributors"), + DeploymentsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/deployments"), + DownloadsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/downloads"), + EventsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/events"), + ForksURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/forks"), + GitCommitsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/commits{/sha}"), + GitRefsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/refs{/sha}"), + GitTagsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/tags{/sha}"), + HooksURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/hooks"), + IssueCommentURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/comments{/number}"), + IssueEventsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/events{/number}"), + IssuesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues{/number}"), + KeysURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/keys{/key_id}"), + LabelsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/labels{/name}"), + LanguagesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/languages"), + MergesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/merges"), + MilestonesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/milestones{/number}"), + NotificationsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/notifications{?since,all,participating}"), + PullsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/pulls{/number}"), + ReleasesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/releases{/id}"), + StargazersURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/stargazers"), + StatusesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/statuses/{sha}"), + SubscribersURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscribers"), + SubscriptionURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscription"), + TagsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/tags"), + TeamsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/teams"), + Visibility: String("private"), + } + if !cmp.Equal(fork, want) { + t.Errorf("SecurityAdvisoriesService.CreateTemporaryPrivateFork returned %+v, want %+v", fork, want) + } + + const methodName = "CreateTemporaryPrivateFork" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.SecurityAdvisories.CreateTemporaryPrivateFork(ctx, "\n", "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.SecurityAdvisories.CreateTemporaryPrivateFork(ctx, "o", "r", "ghsa_id") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestSecurityAdvisoriesService_CreateTemporaryPrivateFork_deferred(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/security-advisories/ghsa_id/forks", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + w.WriteHeader(http.StatusAccepted) + fmt.Fprint(w, `{ + "id": 1, + "node_id": "R_kgDPP3c6pQ", + "owner": { + "login": "owner", + "id": 2, + "node_id": "MDQ6VXFGcjYyMjcyMTQw", + "avatar_url": "https://avatars.githubusercontent.com/u/111111?v=4", + "html_url": "https://github.com/xxxxx", + "gravatar_id": "", + "type": "User", + "site_admin": false, + "url": "https://api.github.com/users/owner", + "events_url": "https://api.github.com/users/owner/events{/privacy}", + "following_url": "https://api.github.com/users/owner/following{/other_user}", + "followers_url": "https://api.github.com/users/owner/followers", + "gists_url": "https://api.github.com/users/owner/gists{/gist_id}", + "organizations_url": "https://api.github.com/users/owner/orgs", + "received_events_url": "https://api.github.com/users/owner/received_events", + "repos_url": "https://api.github.com/users/owner/repos", + "starred_url": "https://api.github.com/users/owner/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/owner/subscriptions" + }, + "name": "repo-ghsa-xxxx-xxxx-xxxx", + "full_name": "owner/repo-ghsa-xxxx-xxxx-xxxx", + "default_branch": "master", + "created_at": "2023-12-08T17:22:41Z", + "pushed_at": "2023-12-03T11:27:08Z", + "updated_at": "2023-12-08T17:22:42Z", + "html_url": "https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx", + "clone_url": "https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git", + "git_url": "git://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git", + "ssh_url": "git@github.com:owner/repo-ghsa-xxxx-xxxx-xxxx.git", + "svn_url": "https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx", + "fork": false, + "forks_count": 0, + "network_count": 0, + "open_issues_count": 0, + "open_issues": 0, + "stargazers_count": 0, + "subscribers_count": 0, + "watchers_count": 0, + "watchers": 0, + "size": 0, + "permissions": { + "admin": true, + "maintain": true, + "pull": true, + "push": true, + "triage": true + }, + "allow_forking": true, + "web_commit_signoff_required": false, + "archived": false, + "disabled": false, + "private": true, + "has_issues": false, + "has_wiki": false, + "has_pages": false, + "has_projects": false, + "has_downloads": false, + "has_discussions": false, + "is_template": false, + "url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx", + "archive_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/{archive_format}{/ref}", + "assignees_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/assignees{/user}", + "blobs_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/blobs{/sha}", + "branches_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/branches{/branch}", + "collaborators_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/collaborators{/collaborator}", + "comments_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/comments{/number}", + "commits_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/commits{/sha}", + "compare_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/compare/{base}...{head}", + "contents_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contents/{+path}", + "contributors_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contributors", + "deployments_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/deployments", + "downloads_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/downloads", + "events_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/events", + "forks_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/forks", + "git_commits_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/commits{/sha}", + "git_refs_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/refs{/sha}", + "git_tags_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/tags{/sha}", + "hooks_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/hooks", + "issue_comment_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/comments{/number}", + "issue_events_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/events{/number}", + "issues_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues{/number}", + "keys_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/keys{/key_id}", + "labels_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/labels{/name}", + "languages_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/languages", + "merges_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/merges", + "milestones_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/milestones{/number}", + "notifications_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/notifications{?since,all,participating}", + "pulls_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/pulls{/number}", + "releases_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/releases{/id}", + "stargazers_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/stargazers", + "statuses_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/statuses/{sha}", + "subscribers_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscribers", + "subscription_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscription", + "tags_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/tags", + "teams_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/teams", + "visibility": "private" + }`) + }) + + ctx := context.Background() + fork, _, err := client.SecurityAdvisories.CreateTemporaryPrivateFork(ctx, "o", "r", "ghsa_id") + if _, ok := err.(*AcceptedError); !ok { + t.Errorf("SecurityAdvisoriesService.CreateTemporaryPrivateFork returned error: %v (want AcceptedError)", err) + } + + want := &Repository{ + ID: Int64(1), + NodeID: String("R_kgDPP3c6pQ"), + Owner: &User{ + Login: String("owner"), + ID: Int64(2), + NodeID: String("MDQ6VXFGcjYyMjcyMTQw"), + AvatarURL: String("https://avatars.githubusercontent.com/u/111111?v=4"), + HTMLURL: String("https://github.com/xxxxx"), + GravatarID: String(""), + Type: String("User"), + SiteAdmin: Bool(false), + URL: String("https://api.github.com/users/owner"), + EventsURL: String("https://api.github.com/users/owner/events{/privacy}"), + FollowingURL: String("https://api.github.com/users/owner/following{/other_user}"), + FollowersURL: String("https://api.github.com/users/owner/followers"), + GistsURL: String("https://api.github.com/users/owner/gists{/gist_id}"), + OrganizationsURL: String("https://api.github.com/users/owner/orgs"), + ReceivedEventsURL: String("https://api.github.com/users/owner/received_events"), + ReposURL: String("https://api.github.com/users/owner/repos"), + StarredURL: String("https://api.github.com/users/owner/starred{/owner}{/repo}"), + SubscriptionsURL: String("https://api.github.com/users/owner/subscriptions"), + }, + Name: String("repo-ghsa-xxxx-xxxx-xxxx"), + FullName: String("owner/repo-ghsa-xxxx-xxxx-xxxx"), + DefaultBranch: String("master"), + CreatedAt: &Timestamp{time.Date(2023, time.December, 8, 17, 22, 41, 0, time.UTC)}, + PushedAt: &Timestamp{time.Date(2023, time.December, 3, 11, 27, 8, 0, time.UTC)}, + UpdatedAt: &Timestamp{time.Date(2023, time.December, 8, 17, 22, 42, 0, time.UTC)}, + HTMLURL: String("https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx"), + CloneURL: String("https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git"), + GitURL: String("git://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git"), + SSHURL: String("git@github.com:owner/repo-ghsa-xxxx-xxxx-xxxx.git"), + SVNURL: String("https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx"), + 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), + Permissions: map[string]bool{ + "admin": true, + "maintain": true, + "pull": true, + "push": true, + "triage": true, + }, + AllowForking: Bool(true), + WebCommitSignoffRequired: Bool(false), + Archived: Bool(false), + Disabled: Bool(false), + Private: Bool(true), + HasIssues: Bool(false), + HasWiki: Bool(false), + HasPages: Bool(false), + HasProjects: Bool(false), + HasDownloads: Bool(false), + HasDiscussions: Bool(false), + IsTemplate: Bool(false), + URL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx"), + ArchiveURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/{archive_format}{/ref}"), + AssigneesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/assignees{/user}"), + BlobsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/blobs{/sha}"), + BranchesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/branches{/branch}"), + CollaboratorsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/collaborators{/collaborator}"), + CommentsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/comments{/number}"), + CommitsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/commits{/sha}"), + CompareURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/compare/{base}...{head}"), + ContentsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contents/{+path}"), + ContributorsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contributors"), + DeploymentsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/deployments"), + DownloadsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/downloads"), + EventsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/events"), + ForksURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/forks"), + GitCommitsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/commits{/sha}"), + GitRefsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/refs{/sha}"), + GitTagsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/tags{/sha}"), + HooksURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/hooks"), + IssueCommentURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/comments{/number}"), + IssueEventsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/events{/number}"), + IssuesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues{/number}"), + KeysURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/keys{/key_id}"), + LabelsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/labels{/name}"), + LanguagesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/languages"), + MergesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/merges"), + MilestonesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/milestones{/number}"), + NotificationsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/notifications{?since,all,participating}"), + PullsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/pulls{/number}"), + ReleasesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/releases{/id}"), + StargazersURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/stargazers"), + StatusesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/statuses/{sha}"), + SubscribersURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscribers"), + SubscriptionURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscription"), + TagsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/tags"), + TeamsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/teams"), + Visibility: String("private"), + } + if !cmp.Equal(fork, want) { + t.Errorf("SecurityAdvisoriesService.CreateTemporaryPrivateFork returned %+v, want %+v", fork, want) + } +} + +func TestSecurityAdvisoriesService_CreateTemporaryPrivateFork_invalidOwner(t *testing.T) { + client, _, _, teardown := setup() + defer teardown() + + ctx := context.Background() + _, _, err := client.SecurityAdvisories.CreateTemporaryPrivateFork(ctx, "%", "r", "ghsa_id") + testURLParseError(t, err) +} + func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisoriesForOrg_BadRequest(t *testing.T) { client, mux, _, teardown := setup() defer teardown() @@ -146,8 +612,8 @@ func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisoriesForOrg(t *tes assertWrite(t, w, []byte(`[ { "ghsa_id": "GHSA-abcd-1234-efgh", - "cve_id": "CVE-2050-00000" - } + "cve_id": "CVE-2050-00000" + } ]`)) }) @@ -277,8 +743,8 @@ func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisories(t *testing.T assertWrite(t, w, []byte(`[ { "ghsa_id": "GHSA-abcd-1234-efgh", - "cve_id": "CVE-2050-00000" - } + "cve_id": "CVE-2050-00000" + } ]`)) }) From ee55955a121f80d3dcdf28faf92005b5e3df13fe Mon Sep 17 00:00:00 2001 From: Benjamin Nater Date: Sat, 16 Dec 2023 02:01:49 +0100 Subject: [PATCH 367/751] Escape package names to support names which include a slash (#3002) --- github/orgs_packages.go | 29 ++++++++--- github/orgs_packages_test.go | 95 +++++++++++++++++++++--------------- 2 files changed, 79 insertions(+), 45 deletions(-) diff --git a/github/orgs_packages.go b/github/orgs_packages.go index 4fb9a63b428..edd8e508fb4 100644 --- a/github/orgs_packages.go +++ b/github/orgs_packages.go @@ -8,6 +8,7 @@ package github import ( "context" "fmt" + "net/url" ) // ListPackages lists the packages for an organization. @@ -38,11 +39,13 @@ func (s *OrganizationsService) ListPackages(ctx context.Context, org string, opt // GetPackage gets a package by name from an organization. // +// Note that packageName is escaped for the URL path so that you don't need to. +// // GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-for-an-organization // //meta:operation GET /orgs/{org}/packages/{package_type}/{package_name} func (s *OrganizationsService) GetPackage(ctx context.Context, org, packageType, packageName string) (*Package, *Response, error) { - u := fmt.Sprintf("orgs/%v/packages/%v/%v", org, packageType, packageName) + u := fmt.Sprintf("orgs/%v/packages/%v/%v", org, packageType, url.PathEscape(packageName)) req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err @@ -59,11 +62,13 @@ func (s *OrganizationsService) GetPackage(ctx context.Context, org, packageType, // DeletePackage deletes a package from an organization. // +// Note that packageName is escaped for the URL path so that you don't need to. +// // GitHub API docs: https://docs.github.com/rest/packages/packages#delete-a-package-for-an-organization // //meta:operation DELETE /orgs/{org}/packages/{package_type}/{package_name} func (s *OrganizationsService) DeletePackage(ctx context.Context, org, packageType, packageName string) (*Response, error) { - u := fmt.Sprintf("orgs/%v/packages/%v/%v", org, packageType, packageName) + u := fmt.Sprintf("orgs/%v/packages/%v/%v", org, packageType, url.PathEscape(packageName)) req, err := s.client.NewRequest("DELETE", u, nil) if err != nil { return nil, err @@ -74,11 +79,13 @@ func (s *OrganizationsService) DeletePackage(ctx context.Context, org, packageTy // RestorePackage restores a package to an organization. // +// Note that packageName is escaped for the URL path so that you don't need to. +// // GitHub API docs: https://docs.github.com/rest/packages/packages#restore-a-package-for-an-organization // //meta:operation POST /orgs/{org}/packages/{package_type}/{package_name}/restore func (s *OrganizationsService) RestorePackage(ctx context.Context, org, packageType, packageName string) (*Response, error) { - u := fmt.Sprintf("orgs/%v/packages/%v/%v/restore", org, packageType, packageName) + u := fmt.Sprintf("orgs/%v/packages/%v/%v/restore", org, packageType, url.PathEscape(packageName)) req, err := s.client.NewRequest("POST", u, nil) if err != nil { return nil, err @@ -89,11 +96,13 @@ func (s *OrganizationsService) RestorePackage(ctx context.Context, org, packageT // PackageGetAllVersions gets all versions of a package in an organization. // +// Note that packageName is escaped for the URL path so that you don't need to. +// // GitHub API docs: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-an-organization // //meta:operation GET /orgs/{org}/packages/{package_type}/{package_name}/versions func (s *OrganizationsService) PackageGetAllVersions(ctx context.Context, org, packageType, packageName string, opts *PackageListOptions) ([]*PackageVersion, *Response, error) { - u := fmt.Sprintf("orgs/%v/packages/%v/%v/versions", org, packageType, packageName) + u := fmt.Sprintf("orgs/%v/packages/%v/%v/versions", org, packageType, url.PathEscape(packageName)) u, err := addOptions(u, opts) if err != nil { return nil, nil, err @@ -115,11 +124,13 @@ func (s *OrganizationsService) PackageGetAllVersions(ctx context.Context, org, p // PackageGetVersion gets a specific version of a package in an organization. // +// Note that packageName is escaped for the URL path so that you don't need to. +// // GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-version-for-an-organization // //meta:operation GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id} func (s *OrganizationsService) PackageGetVersion(ctx context.Context, org, packageType, packageName string, packageVersionID int64) (*PackageVersion, *Response, error) { - u := fmt.Sprintf("orgs/%v/packages/%v/%v/versions/%v", org, packageType, packageName, packageVersionID) + u := fmt.Sprintf("orgs/%v/packages/%v/%v/versions/%v", org, packageType, url.PathEscape(packageName), packageVersionID) req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err @@ -136,11 +147,13 @@ func (s *OrganizationsService) PackageGetVersion(ctx context.Context, org, packa // PackageDeleteVersion deletes a package version from an organization. // +// Note that packageName is escaped for the URL path so that you don't need to. +// // GitHub API docs: https://docs.github.com/rest/packages/packages#delete-package-version-for-an-organization // //meta:operation DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id} func (s *OrganizationsService) PackageDeleteVersion(ctx context.Context, org, packageType, packageName string, packageVersionID int64) (*Response, error) { - u := fmt.Sprintf("orgs/%v/packages/%v/%v/versions/%v", org, packageType, packageName, packageVersionID) + u := fmt.Sprintf("orgs/%v/packages/%v/%v/versions/%v", org, packageType, url.PathEscape(packageName), packageVersionID) req, err := s.client.NewRequest("DELETE", u, nil) if err != nil { return nil, err @@ -151,11 +164,13 @@ func (s *OrganizationsService) PackageDeleteVersion(ctx context.Context, org, pa // PackageRestoreVersion restores a package version to an organization. // +// Note that packageName is escaped for the URL path so that you don't need to. +// // GitHub API docs: https://docs.github.com/rest/packages/packages#restore-package-version-for-an-organization // //meta:operation POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore func (s *OrganizationsService) PackageRestoreVersion(ctx context.Context, org, packageType, packageName string, packageVersionID int64) (*Response, error) { - u := fmt.Sprintf("orgs/%v/packages/%v/%v/versions/%v/restore", org, packageType, packageName, packageVersionID) + u := fmt.Sprintf("orgs/%v/packages/%v/%v/versions/%v/restore", org, packageType, url.PathEscape(packageName), packageVersionID) req, err := s.client.NewRequest("POST", u, nil) if err != nil { return nil, err diff --git a/github/orgs_packages_test.go b/github/orgs_packages_test.go index f8c8701d300..097cae76282 100644 --- a/github/orgs_packages_test.go +++ b/github/orgs_packages_test.go @@ -7,7 +7,7 @@ package github import ( "context" - "fmt" + "io" "net/http" "testing" @@ -20,7 +20,7 @@ func TestOrganizationsService_ListPackages(t *testing.T) { mux.HandleFunc("/orgs/o/packages", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - fmt.Fprint(w, `[{ + _, err := io.WriteString(w, `[{ "id": 197, "name": "hello_docker", "package_type": "container", @@ -52,6 +52,9 @@ func TestOrganizationsService_ListPackages(t *testing.T) { "html_url": "https://github.com/orgs/github/packages/container/package/hello_docker" } ]`) + if err != nil { + t.Fatal("Failed to write test response: ", err) + } }) ctx := context.Background() @@ -114,35 +117,39 @@ func TestOrganizationsService_GetPackage(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - mux.HandleFunc("/orgs/o/packages/container/hello_docker", func(w http.ResponseWriter, r *http.Request) { + // don't url escape the package name here since mux will convert it to a slash automatically + mux.HandleFunc("/orgs/o/packages/container/hello/hello_docker", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - fmt.Fprint(w, `{ + _, err := io.WriteString(w, `{ "id": 197, - "name": "hello_docker", + "name": "hello/hello_docker", "package_type": "container", "version_count": 1, "visibility": "private", - "url": "https://api.github.com/orgs/github/packages/container/hello_docker", + "url": "https://api.github.com/orgs/github/packages/container/hello%2Fhello_docker", "created_at": `+referenceTimeStr+`, "updated_at": `+referenceTimeStr+`, - "html_url": "https://github.com/orgs/github/packages/container/package/hello_docker" + "html_url": "https://github.com/orgs/github/packages/container/package/hello%2Fhello_docker" }`) + if err != nil { + t.Fatal("Failed to write test response: ", err) + } }) ctx := context.Background() - packages, _, err := client.Organizations.GetPackage(ctx, "o", "container", "hello_docker") + packages, _, err := client.Organizations.GetPackage(ctx, "o", "container", "hello/hello_docker") if err != nil { t.Errorf("Organizations.GetPackage returned error: %v", err) } want := &Package{ ID: Int64(197), - Name: String("hello_docker"), + Name: String("hello/hello_docker"), PackageType: String("container"), VersionCount: Int64(1), Visibility: String("private"), - URL: String("https://api.github.com/orgs/github/packages/container/hello_docker"), - HTMLURL: String("https://github.com/orgs/github/packages/container/package/hello_docker"), + URL: String("https://api.github.com/orgs/github/packages/container/hello%2Fhello_docker"), + HTMLURL: String("https://github.com/orgs/github/packages/container/package/hello%2Fhello_docker"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, } @@ -169,12 +176,13 @@ func TestOrganizationsService_DeletePackage(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - mux.HandleFunc("/orgs/o/packages/container/hello_docker", func(w http.ResponseWriter, r *http.Request) { + // don't url escape the package name here since mux will convert it to a slash automatically + mux.HandleFunc("/orgs/o/packages/container/hello/hello_docker", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) ctx := context.Background() - _, err := client.Organizations.DeletePackage(ctx, "o", "container", "hello_docker") + _, err := client.Organizations.DeletePackage(ctx, "o", "container", "hello/hello_docker") if err != nil { t.Errorf("Organizations.DeletePackage returned error: %v", err) } @@ -198,12 +206,13 @@ func TestOrganizationsService_RestorePackage(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - mux.HandleFunc("/orgs/o/packages/container/hello_docker/restore", func(w http.ResponseWriter, r *http.Request) { + // don't url escape the package name here since mux will convert it to a slash automatically + mux.HandleFunc("/orgs/o/packages/container/hello/hello_docker/restore", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") }) ctx := context.Background() - _, err := client.Organizations.RestorePackage(ctx, "o", "container", "hello_docker") + _, err := client.Organizations.RestorePackage(ctx, "o", "container", "hello/hello_docker") if err != nil { t.Errorf("Organizations.RestorePackage returned error: %v", err) } @@ -215,7 +224,7 @@ func TestOrganizationsService_RestorePackage(t *testing.T) { }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Organizations.RestorePackage(ctx, "", "container", "hello_docker") + return client.Organizations.RestorePackage(ctx, "", "container", "hello/hello_docker") }) } @@ -223,18 +232,19 @@ func TestOrganizationsService_ListPackagesVersions(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - mux.HandleFunc("/orgs/o/packages/container/hello_docker/versions", func(w http.ResponseWriter, r *http.Request) { + // don't url escape the package name here since mux will convert it to a slash automatically + mux.HandleFunc("/orgs/o/packages/container/hello/hello_docker/versions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") testFormValues(t, r, values{"per_page": "2", "page": "1", "state": "deleted", "visibility": "internal", "package_type": "container"}) - fmt.Fprint(w, `[ + _, err := io.WriteString(w, `[ { "id": 45763, "name": "sha256:08a44bab0bddaddd8837a8b381aebc2e4b933768b981685a9e088360af0d3dd9", - "url": "https://api.github.com/users/octocat/packages/container/hello_docker/versions/45763", - "package_html_url": "https://github.com/users/octocat/packages/container/package/hello_docker", + "url": "https://api.github.com/users/octocat/packages/container/hello%2Fhello_docker/versions/45763", + "package_html_url": "https://github.com/users/octocat/packages/container/package/hello%2Fhello_docker", "created_at": `+referenceTimeStr+`, "updated_at": `+referenceTimeStr+`, - "html_url": "https://github.com/users/octocat/packages/container/hello_docker/45763", + "html_url": "https://github.com/users/octocat/packages/container/hello%2Fhello_docker/45763", "metadata": { "package_type": "container", "container": { @@ -244,13 +254,16 @@ func TestOrganizationsService_ListPackagesVersions(t *testing.T) { } } }]`) + if err != nil { + t.Fatal("Failed to write test response: ", err) + } }) ctx := context.Background() opts := &PackageListOptions{ String("internal"), String("container"), String("deleted"), ListOptions{Page: 1, PerPage: 2}, } - packages, _, err := client.Organizations.PackageGetAllVersions(ctx, "o", "container", "hello_docker", opts) + packages, _, err := client.Organizations.PackageGetAllVersions(ctx, "o", "container", "hello/hello_docker", opts) if err != nil { t.Errorf("Organizations.PackageGetAllVersions returned error: %v", err) } @@ -258,11 +271,11 @@ func TestOrganizationsService_ListPackagesVersions(t *testing.T) { want := []*PackageVersion{{ ID: Int64(45763), Name: String("sha256:08a44bab0bddaddd8837a8b381aebc2e4b933768b981685a9e088360af0d3dd9"), - URL: String("https://api.github.com/users/octocat/packages/container/hello_docker/versions/45763"), - PackageHTMLURL: String("https://github.com/users/octocat/packages/container/package/hello_docker"), + URL: String("https://api.github.com/users/octocat/packages/container/hello%2Fhello_docker/versions/45763"), + PackageHTMLURL: String("https://github.com/users/octocat/packages/container/package/hello%2Fhello_docker"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HTMLURL: String("https://github.com/users/octocat/packages/container/hello_docker/45763"), + HTMLURL: String("https://github.com/users/octocat/packages/container/hello%2Fhello_docker/45763"), Metadata: &PackageMetadata{ PackageType: String("container"), Container: &PackageContainerMetadata{ @@ -293,17 +306,18 @@ func TestOrganizationsService_PackageGetVersion(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - mux.HandleFunc("/orgs/o/packages/container/hello_docker/versions/45763", func(w http.ResponseWriter, r *http.Request) { + // don't url escape the package name here since mux will convert it to a slash automatically + mux.HandleFunc("/orgs/o/packages/container/hello/hello_docker/versions/45763", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - fmt.Fprint(w, ` + _, err := io.WriteString(w, ` { "id": 45763, "name": "sha256:08a44bab0bddaddd8837a8b381aebc2e4b933768b981685a9e088360af0d3dd9", - "url": "https://api.github.com/users/octocat/packages/container/hello_docker/versions/45763", - "package_html_url": "https://github.com/users/octocat/packages/container/package/hello_docker", + "url": "https://api.github.com/users/octocat/packages/container/hello%2Fhello_docker/versions/45763", + "package_html_url": "https://github.com/users/octocat/packages/container/package/hello%2Fhello_docker", "created_at": `+referenceTimeStr+`, "updated_at": `+referenceTimeStr+`, - "html_url": "https://github.com/users/octocat/packages/container/hello_docker/45763", + "html_url": "https://github.com/users/octocat/packages/container/hello%2Fhello_docker/45763", "metadata": { "package_type": "container", "container": { @@ -313,10 +327,13 @@ func TestOrganizationsService_PackageGetVersion(t *testing.T) { } } }`) + if err != nil { + t.Fatal("Failed to write test response: ", err) + } }) ctx := context.Background() - packages, _, err := client.Organizations.PackageGetVersion(ctx, "o", "container", "hello_docker", 45763) + packages, _, err := client.Organizations.PackageGetVersion(ctx, "o", "container", "hello/hello_docker", 45763) if err != nil { t.Errorf("Organizations.PackageGetVersion returned error: %v", err) } @@ -324,11 +341,11 @@ func TestOrganizationsService_PackageGetVersion(t *testing.T) { want := &PackageVersion{ ID: Int64(45763), Name: String("sha256:08a44bab0bddaddd8837a8b381aebc2e4b933768b981685a9e088360af0d3dd9"), - URL: String("https://api.github.com/users/octocat/packages/container/hello_docker/versions/45763"), - PackageHTMLURL: String("https://github.com/users/octocat/packages/container/package/hello_docker"), + URL: String("https://api.github.com/users/octocat/packages/container/hello%2Fhello_docker/versions/45763"), + PackageHTMLURL: String("https://github.com/users/octocat/packages/container/package/hello%2Fhello_docker"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HTMLURL: String("https://github.com/users/octocat/packages/container/hello_docker/45763"), + HTMLURL: String("https://github.com/users/octocat/packages/container/hello%2Fhello_docker/45763"), Metadata: &PackageMetadata{ PackageType: String("container"), Container: &PackageContainerMetadata{ @@ -359,12 +376,13 @@ func TestOrganizationsService_PackageDeleteVersion(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - mux.HandleFunc("/orgs/o/packages/container/hello_docker/versions/45763", func(w http.ResponseWriter, r *http.Request) { + // don't url escape the package name here since mux will convert it to a slash automatically + mux.HandleFunc("/orgs/o/packages/container/hello/hello_docker/versions/45763", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) ctx := context.Background() - _, err := client.Organizations.PackageDeleteVersion(ctx, "o", "container", "hello_docker", 45763) + _, err := client.Organizations.PackageDeleteVersion(ctx, "o", "container", "hello/hello_docker", 45763) if err != nil { t.Errorf("Organizations.PackageDeleteVersion returned error: %v", err) } @@ -384,12 +402,13 @@ func TestOrganizationsService_PackageRestoreVersion(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - mux.HandleFunc("/orgs/o/packages/container/hello_docker/versions/45763/restore", func(w http.ResponseWriter, r *http.Request) { + // don't url escape the package name here since mux will convert it to a slash automatically + mux.HandleFunc("/orgs/o/packages/container/hello/hello_docker/versions/45763/restore", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") }) ctx := context.Background() - _, err := client.Organizations.PackageRestoreVersion(ctx, "o", "container", "hello_docker", 45763) + _, err := client.Organizations.PackageRestoreVersion(ctx, "o", "container", "hello/hello_docker", 45763) if err != nil { t.Errorf("Organizations.PackageRestoreVersion returned error: %v", err) } From 6d3dfc616349d61e32cac97a82415d4205926d7a Mon Sep 17 00:00:00 2001 From: WillAbides <233500+WillAbides@users.noreply.github.com> Date: Fri, 15 Dec 2023 19:07:07 -0600 Subject: [PATCH 368/751] Don't update httpClient passed to NewClient (#3011) --- github/github.go | 8 ++++++- github/github_test.go | 51 +++++++++++++++++++++++++++++-------------- 2 files changed, 42 insertions(+), 17 deletions(-) diff --git a/github/github.go b/github/github.go index e41036361a8..da4f2d067ee 100644 --- a/github/github.go +++ b/github/github.go @@ -220,6 +220,8 @@ type service struct { } // Client returns the http.Client used by this GitHub client. +// This should only be used for requests to the GitHub API because +// request headers will contain an authorization token. func (c *Client) Client() *http.Client { c.clientMu.Lock() defer c.clientMu.Unlock() @@ -315,7 +317,11 @@ func addOptions(s string, opts interface{}) (string, error) { // an http.Client that will perform the authentication for you (such as that // provided by the golang.org/x/oauth2 library). func NewClient(httpClient *http.Client) *Client { - c := &Client{client: httpClient} + if httpClient == nil { + httpClient = &http.Client{} + } + httpClient2 := *httpClient + c := &Client{client: &httpClient2} c.initialize() return c } diff --git a/github/github_test.go b/github/github_test.go index 933d29e7741..4d672f6096f 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -321,26 +321,45 @@ func TestClient(t *testing.T) { func TestWithAuthToken(t *testing.T) { token := "gh_test_token" - var gotAuthHeaderVals []string - wantAuthHeaderVals := []string{"Bearer " + token} - srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - gotAuthHeaderVals = r.Header["Authorization"] - })) - validate := func(c *Client) { + + validate := func(t *testing.T, c *http.Client, token string) { t.Helper() - gotAuthHeaderVals = nil - _, err := c.Client().Get(srv.URL) - if err != nil { - t.Fatalf("Get returned unexpected error: %v", err) + want := token + if want != "" { + want = "Bearer " + want + } + gotReq := false + headerVal := "" + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + gotReq = true + headerVal = r.Header.Get("Authorization") + })) + _, err := c.Get(srv.URL) + assertNilError(t, err) + if !gotReq { + t.Error("request not sent") } - diff := cmp.Diff(wantAuthHeaderVals, gotAuthHeaderVals) - if diff != "" { - t.Errorf("Authorization header values mismatch (-want +got):\n%s", diff) + if headerVal != want { + t.Errorf("Authorization header is %v, want %v", headerVal, want) } } - validate(NewClient(nil).WithAuthToken(token)) - validate(new(Client).WithAuthToken(token)) - validate(NewTokenClient(context.Background(), token)) + + t.Run("zero-value Client", func(t *testing.T) { + c := new(Client).WithAuthToken(token) + validate(t, c.Client(), token) + }) + + t.Run("NewClient", func(t *testing.T) { + httpClient := &http.Client{} + client := NewClient(httpClient).WithAuthToken(token) + validate(t, client.Client(), token) + // make sure the original client isn't setting auth headers now + validate(t, httpClient, "") + }) + + t.Run("NewTokenClient", func(t *testing.T) { + validate(t, NewTokenClient(context.Background(), token).Client(), token) + }) } func TestWithEnterpriseURLs(t *testing.T) { From 005e6c884528e50ce94914b2e07e1a580e4f5836 Mon Sep 17 00:00:00 2001 From: Daniel Liao <10663736+liaodaniel@users.noreply.github.com> Date: Mon, 18 Dec 2023 06:46:23 +1100 Subject: [PATCH 369/751] Add GetAllCustomPropertyValues for repositories (#3020) Fixes: #3014. --- github/repos_properties.go | 33 +++++++++++++++++ github/repos_properties_test.go | 65 +++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 github/repos_properties.go create mode 100644 github/repos_properties_test.go diff --git a/github/repos_properties.go b/github/repos_properties.go new file mode 100644 index 00000000000..5a8626c4530 --- /dev/null +++ b/github/repos_properties.go @@ -0,0 +1,33 @@ +// Copyright 2023 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" +) + +// GetAllCustomPropertyValues gets all custom property values that are set for a repository. +// +// GitHub API docs: https://docs.github.com/rest/repos/custom-properties#get-all-custom-property-values-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/properties/values +func (s *RepositoriesService) GetAllCustomPropertyValues(ctx context.Context, org, repo string) ([]*CustomPropertyValue, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/properties/values", org, repo) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var customPropertyValues []*CustomPropertyValue + resp, err := s.client.Do(ctx, req, &customPropertyValues) + if err != nil { + return nil, resp, err + } + + return customPropertyValues, resp, nil +} diff --git a/github/repos_properties_test.go b/github/repos_properties_test.go new file mode 100644 index 00000000000..ee231a138c6 --- /dev/null +++ b/github/repos_properties_test.go @@ -0,0 +1,65 @@ +// Copyright 2023 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_GetAllCustomPropertyValues(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/properties/values", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `[ + { + "property_name": "environment", + "value": "production" + }, + { + "property_name": "service", + "value": "web" + } + ]`) + }) + + ctx := context.Background() + customPropertyValues, _, err := client.Repositories.GetAllCustomPropertyValues(ctx, "o", "r") + if err != nil { + t.Errorf("Repositories.GetAllCustomPropertyValues returned error: %v", err) + } + + want := []*CustomPropertyValue{ + { + PropertyName: "environment", + Value: String("production"), + }, + { + PropertyName: "service", + Value: String("web"), + }, + } + + if !cmp.Equal(customPropertyValues, want) { + t.Errorf("Repositories.GetAllCustomPropertyValues returned %+v, want %+v", customPropertyValues, want) + } + + const methodName = "GetAllCustomPropertyValues" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.GetAllCustomPropertyValues(ctx, "o", "r") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} From a354a6c890321a8b4736be0ab7713582a4e26b21 Mon Sep 17 00:00:00 2001 From: WillAbides <233500+WillAbides@users.noreply.github.com> Date: Sun, 17 Dec 2023 19:38:55 -0600 Subject: [PATCH 370/751] Remove ambiguous fields from AuditEntry (#3017) Fixes: #3016. --- github/enterprise_audit_log_test.go | 43 +- github/github-accessors.go | 524 +--------------------- github/github-accessors_test.go | 645 +--------------------------- github/github_test.go | 7 + github/orgs_audit_log.go | 177 ++++---- github/orgs_audit_log_test.go | 322 +++++++------- test/integration/audit_log_test.go | 2 +- 7 files changed, 308 insertions(+), 1412 deletions(-) diff --git a/github/enterprise_audit_log_test.go b/github/enterprise_audit_log_test.go index 2e91346ebf3..0d9e44a3eb6 100644 --- a/github/enterprise_audit_log_test.go +++ b/github/enterprise_audit_log_test.go @@ -11,8 +11,6 @@ import ( "net/http" "testing" "time" - - "github.com/google/go-cmp/cmp" ) func TestEnterpriseService_GetAuditLog(t *testing.T) { @@ -54,34 +52,31 @@ func TestEnterpriseService_GetAuditLog(t *testing.T) { if err != nil { t.Errorf("Enterprise.GetAuditLog returned error: %v", err) } - startedAt, _ := time.Parse(time.RFC3339, "2021-03-07T00:33:04.000Z") - completedAt, _ := time.Parse(time.RFC3339, "2021-03-07T00:35:08.000Z") timestamp := time.Unix(0, 1615077308538*1e6) - want := []*AuditEntry{ { - Timestamp: &Timestamp{timestamp}, - DocumentID: String("beeZYapIUe-wKg5-beadb33"), - Action: String("workflows.completed_workflow_run"), - Actor: String("testactor"), - CompletedAt: &Timestamp{completedAt}, - Conclusion: String("success"), - CreatedAt: &Timestamp{timestamp}, - Event: String("schedule"), - HeadBranch: String("master"), - HeadSHA: String("5acdeadbeef64d1a62388e901e5cdc9358644b37"), - Name: String("Code scanning - action"), - Org: String("o"), - Repo: String("o/blue-crayon-1"), - StartedAt: &Timestamp{startedAt}, - WorkflowID: Int64(123456), - WorkflowRunID: Int64(628312345), + Timestamp: &Timestamp{timestamp}, + DocumentID: String("beeZYapIUe-wKg5-beadb33"), + Action: String("workflows.completed_workflow_run"), + Actor: String("testactor"), + CreatedAt: &Timestamp{timestamp}, + Org: String("o"), + AdditionalFields: map[string]interface{}{ + "completed_at": "2021-03-07T00:35:08.000Z", + "conclusion": "success", + "event": "schedule", + "head_branch": "master", + "head_sha": "5acdeadbeef64d1a62388e901e5cdc9358644b37", + "name": "Code scanning - action", + "repo": "o/blue-crayon-1", + "started_at": "2021-03-07T00:33:04.000Z", + "workflow_id": float64(123456), + "workflow_run_id": float64(628312345), + }, }, } - if !cmp.Equal(auditEntries, want) { - t.Errorf("Enterprise.GetAuditLog return \ngot: %+v,\nwant:%+v", auditEntries, want) - } + assertNoDiff(t, want, auditEntries) const methodName = "GetAuditLog" testBadOptions(t, methodName, func() (err error) { diff --git a/github/github-accessors.go b/github/github-accessors.go index 02d1212cd9b..f41409f9e6c 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -1070,22 +1070,6 @@ func (a *AuditEntry) GetAction() string { return *a.Action } -// GetActive returns the Active field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetActive() bool { - if a == nil || a.Active == nil { - return false - } - return *a.Active -} - -// GetActiveWas returns the ActiveWas field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetActiveWas() bool { - if a == nil || a.ActiveWas == nil { - return false - } - return *a.ActiveWas -} - // GetActor returns the Actor field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetActor() string { if a == nil || a.Actor == nil { @@ -1094,12 +1078,12 @@ func (a *AuditEntry) GetActor() string { return *a.Actor } -// GetActorIP returns the ActorIP field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetActorIP() string { - if a == nil || a.ActorIP == nil { - return "" +// GetActorID returns the ActorID field if it's non-nil, zero value otherwise. +func (a *AuditEntry) GetActorID() int64 { + if a == nil || a.ActorID == nil { + return 0 } - return *a.ActorIP + return *a.ActorID } // GetActorLocation returns the ActorLocation field. @@ -1110,14 +1094,6 @@ func (a *AuditEntry) GetActorLocation() *ActorLocation { return a.ActorLocation } -// GetBlockedUser returns the BlockedUser field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetBlockedUser() string { - if a == nil || a.BlockedUser == nil { - return "" - } - return *a.BlockedUser -} - // GetBusiness returns the Business field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetBusiness() string { if a == nil || a.Business == nil { @@ -1126,52 +1102,12 @@ func (a *AuditEntry) GetBusiness() string { return *a.Business } -// GetCancelledAt returns the CancelledAt field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetCancelledAt() Timestamp { - if a == nil || a.CancelledAt == nil { - return Timestamp{} - } - return *a.CancelledAt -} - -// GetCompletedAt returns the CompletedAt field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetCompletedAt() Timestamp { - if a == nil || a.CompletedAt == nil { - return Timestamp{} - } - return *a.CompletedAt -} - -// GetConclusion returns the Conclusion field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetConclusion() string { - if a == nil || a.Conclusion == nil { - return "" - } - return *a.Conclusion -} - -// GetConfig returns the Config field. -func (a *AuditEntry) GetConfig() *HookConfig { - if a == nil { - return nil - } - return a.Config -} - -// GetConfigWas returns the ConfigWas field. -func (a *AuditEntry) GetConfigWas() *HookConfig { - if a == nil { - return nil - } - return a.ConfigWas -} - -// GetContentType returns the ContentType field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetContentType() string { - if a == nil || a.ContentType == nil { - return "" +// GetBusinessID returns the BusinessID field if it's non-nil, zero value otherwise. +func (a *AuditEntry) GetBusinessID() int64 { + if a == nil || a.BusinessID == nil { + return 0 } - return *a.ContentType + return *a.BusinessID } // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. @@ -1182,22 +1118,6 @@ func (a *AuditEntry) GetCreatedAt() Timestamp { return *a.CreatedAt } -// GetData returns the Data field. -func (a *AuditEntry) GetData() *AuditEntryData { - if a == nil { - return nil - } - return a.Data -} - -// GetDeployKeyFingerprint returns the DeployKeyFingerprint field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetDeployKeyFingerprint() string { - if a == nil || a.DeployKeyFingerprint == nil { - return "" - } - return *a.DeployKeyFingerprint -} - // GetDocumentID returns the DocumentID field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetDocumentID() string { if a == nil || a.DocumentID == nil { @@ -1206,38 +1126,6 @@ func (a *AuditEntry) GetDocumentID() string { return *a.DocumentID } -// GetEmoji returns the Emoji field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetEmoji() string { - if a == nil || a.Emoji == nil { - return "" - } - return *a.Emoji -} - -// GetEnvironmentName returns the EnvironmentName field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetEnvironmentName() string { - if a == nil || a.EnvironmentName == nil { - return "" - } - return *a.EnvironmentName -} - -// GetEvent returns the Event field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetEvent() string { - if a == nil || a.Event == nil { - return "" - } - return *a.Event -} - -// GetExplanation returns the Explanation field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetExplanation() string { - if a == nil || a.Explanation == nil { - return "" - } - return *a.Explanation -} - // GetExternalIdentityNameID returns the ExternalIdentityNameID field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetExternalIdentityNameID() string { if a == nil || a.ExternalIdentityNameID == nil { @@ -1254,14 +1142,6 @@ func (a *AuditEntry) GetExternalIdentityUsername() string { return *a.ExternalIdentityUsername } -// GetFingerprint returns the Fingerprint field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetFingerprint() string { - if a == nil || a.Fingerprint == nil { - return "" - } - return *a.Fingerprint -} - // GetHashedToken returns the HashedToken field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetHashedToken() string { if a == nil || a.HashedToken == nil { @@ -1270,118 +1150,6 @@ func (a *AuditEntry) GetHashedToken() string { return *a.HashedToken } -// GetHeadBranch returns the HeadBranch field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetHeadBranch() string { - if a == nil || a.HeadBranch == nil { - return "" - } - return *a.HeadBranch -} - -// GetHeadSHA returns the HeadSHA field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetHeadSHA() string { - if a == nil || a.HeadSHA == nil { - return "" - } - return *a.HeadSHA -} - -// GetHookID returns the HookID field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetHookID() int64 { - if a == nil || a.HookID == nil { - return 0 - } - return *a.HookID -} - -// GetIsHostedRunner returns the IsHostedRunner field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetIsHostedRunner() bool { - if a == nil || a.IsHostedRunner == nil { - return false - } - return *a.IsHostedRunner -} - -// GetJobName returns the JobName field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetJobName() string { - if a == nil || a.JobName == nil { - return "" - } - return *a.JobName -} - -// GetJobWorkflowRef returns the JobWorkflowRef field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetJobWorkflowRef() string { - if a == nil || a.JobWorkflowRef == nil { - return "" - } - return *a.JobWorkflowRef -} - -// GetLimitedAvailability returns the LimitedAvailability field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetLimitedAvailability() bool { - if a == nil || a.LimitedAvailability == nil { - return false - } - return *a.LimitedAvailability -} - -// GetMessage returns the Message field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetMessage() string { - if a == nil || a.Message == nil { - return "" - } - return *a.Message -} - -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetName() string { - if a == nil || a.Name == nil { - return "" - } - return *a.Name -} - -// GetOAuthApplicationID returns the OAuthApplicationID field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetOAuthApplicationID() int64 { - if a == nil || a.OAuthApplicationID == nil { - return 0 - } - return *a.OAuthApplicationID -} - -// GetOldPermission returns the OldPermission field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetOldPermission() string { - if a == nil || a.OldPermission == nil { - return "" - } - return *a.OldPermission -} - -// GetOldUser returns the OldUser field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetOldUser() string { - if a == nil || a.OldUser == nil { - return "" - } - return *a.OldUser -} - -// GetOpenSSHPublicKey returns the OpenSSHPublicKey field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetOpenSSHPublicKey() string { - if a == nil || a.OpenSSHPublicKey == nil { - return "" - } - return *a.OpenSSHPublicKey -} - -// GetOperationType returns the OperationType field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetOperationType() string { - if a == nil || a.OperationType == nil { - return "" - } - return *a.OperationType -} - // GetOrg returns the Org field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetOrg() string { if a == nil || a.Org == nil { @@ -1398,182 +1166,6 @@ func (a *AuditEntry) GetOrgID() int64 { return *a.OrgID } -// GetPermission returns the Permission field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetPermission() string { - if a == nil || a.Permission == nil { - return "" - } - return *a.Permission -} - -// GetPreviousVisibility returns the PreviousVisibility field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetPreviousVisibility() string { - if a == nil || a.PreviousVisibility == nil { - return "" - } - return *a.PreviousVisibility -} - -// GetProgrammaticAccessType returns the ProgrammaticAccessType field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetProgrammaticAccessType() string { - if a == nil || a.ProgrammaticAccessType == nil { - return "" - } - return *a.ProgrammaticAccessType -} - -// GetPullRequestID returns the PullRequestID field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetPullRequestID() int64 { - if a == nil || a.PullRequestID == nil { - return 0 - } - return *a.PullRequestID -} - -// GetPullRequestTitle returns the PullRequestTitle field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetPullRequestTitle() string { - if a == nil || a.PullRequestTitle == nil { - return "" - } - return *a.PullRequestTitle -} - -// GetPullRequestURL returns the PullRequestURL field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetPullRequestURL() string { - if a == nil || a.PullRequestURL == nil { - return "" - } - return *a.PullRequestURL -} - -// GetReadOnly returns the ReadOnly field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetReadOnly() string { - if a == nil || a.ReadOnly == nil { - return "" - } - return *a.ReadOnly -} - -// GetReferrer returns the Referrer field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetReferrer() string { - if a == nil || a.Referrer == nil { - return "" - } - return *a.Referrer -} - -// GetRepo returns the Repo field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetRepo() string { - if a == nil || a.Repo == nil { - return "" - } - return *a.Repo -} - -// GetRepository returns the Repository field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetRepository() string { - if a == nil || a.Repository == nil { - return "" - } - return *a.Repository -} - -// GetRepositoryPublic returns the RepositoryPublic field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetRepositoryPublic() bool { - if a == nil || a.RepositoryPublic == nil { - return false - } - 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 { - return 0 - } - return *a.RunnerGroupID -} - -// GetRunnerGroupName returns the RunnerGroupName field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetRunnerGroupName() string { - if a == nil || a.RunnerGroupName == nil { - return "" - } - return *a.RunnerGroupName -} - -// GetRunnerID returns the RunnerID field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetRunnerID() int64 { - if a == nil || a.RunnerID == nil { - return 0 - } - return *a.RunnerID -} - -// GetRunnerName returns the RunnerName field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetRunnerName() string { - if a == nil || a.RunnerName == nil { - return "" - } - return *a.RunnerName -} - -// GetRunNumber returns the RunNumber field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetRunNumber() int64 { - if a == nil || a.RunNumber == nil { - return 0 - } - return *a.RunNumber -} - -// GetSourceVersion returns the SourceVersion field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetSourceVersion() string { - if a == nil || a.SourceVersion == nil { - return "" - } - return *a.SourceVersion -} - -// GetStartedAt returns the StartedAt field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetStartedAt() Timestamp { - if a == nil || a.StartedAt == nil { - return Timestamp{} - } - return *a.StartedAt -} - -// GetTargetLogin returns the TargetLogin field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetTargetLogin() string { - if a == nil || a.TargetLogin == nil { - return "" - } - return *a.TargetLogin -} - -// GetTargetVersion returns the TargetVersion field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetTargetVersion() string { - if a == nil || a.TargetVersion == nil { - return "" - } - return *a.TargetVersion -} - -// GetTeam returns the Team field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetTeam() string { - if a == nil || a.Team == nil { - return "" - } - return *a.Team -} - // GetTimestamp returns the Timestamp field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetTimestamp() Timestamp { if a == nil || a.Timestamp == nil { @@ -1598,38 +1190,6 @@ func (a *AuditEntry) GetTokenScopes() string { return *a.TokenScopes } -// GetTopic returns the Topic field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetTopic() string { - if a == nil || a.Topic == nil { - return "" - } - return *a.Topic -} - -// GetTransportProtocol returns the TransportProtocol field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetTransportProtocol() int { - if a == nil || a.TransportProtocol == nil { - return 0 - } - return *a.TransportProtocol -} - -// GetTransportProtocolName returns the TransportProtocolName field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetTransportProtocolName() string { - if a == nil || a.TransportProtocolName == nil { - return "" - } - return *a.TransportProtocolName -} - -// GetTriggerID returns the TriggerID field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetTriggerID() int64 { - if a == nil || a.TriggerID == nil { - return 0 - } - return *a.TriggerID -} - // GetUser returns the User field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetUser() string { if a == nil || a.User == nil { @@ -1638,52 +1198,12 @@ func (a *AuditEntry) GetUser() string { return *a.User } -// GetUserAgent returns the UserAgent field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetUserAgent() string { - if a == nil || a.UserAgent == nil { - return "" - } - return *a.UserAgent -} - -// GetVisibility returns the Visibility field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetVisibility() string { - if a == nil || a.Visibility == nil { - return "" - } - return *a.Visibility -} - -// GetWorkflowID returns the WorkflowID field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetWorkflowID() int64 { - if a == nil || a.WorkflowID == nil { +// GetUserID returns the UserID field if it's non-nil, zero value otherwise. +func (a *AuditEntry) GetUserID() int64 { + if a == nil || a.UserID == nil { return 0 } - return *a.WorkflowID -} - -// GetWorkflowRunID returns the WorkflowRunID field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetWorkflowRunID() int64 { - if a == nil || a.WorkflowRunID == nil { - return 0 - } - return *a.WorkflowRunID -} - -// GetOldLogin returns the OldLogin field if it's non-nil, zero value otherwise. -func (a *AuditEntryData) GetOldLogin() string { - if a == nil || a.OldLogin == nil { - return "" - } - return *a.OldLogin -} - -// GetOldName returns the OldName field if it's non-nil, zero value otherwise. -func (a *AuditEntryData) GetOldName() string { - if a == nil || a.OldName == nil { - return "" - } - return *a.OldName + return *a.UserID } // GetApp returns the App field. @@ -14478,22 +13998,6 @@ func (p *Plan) GetSpace() int { return *p.Space } -// GetCode returns the Code field if it's non-nil, zero value otherwise. -func (p *PolicyOverrideReason) GetCode() string { - if p == nil || p.Code == nil { - return "" - } - return *p.Code -} - -// GetMessage returns the Message field if it's non-nil, zero value otherwise. -func (p *PolicyOverrideReason) GetMessage() string { - if p == nil || p.Message == nil { - return "" - } - return *p.Message -} - // GetConfigURL returns the ConfigURL field if it's non-nil, zero value otherwise. func (p *PreReceiveHook) GetConfigURL() string { if p == nil || p.ConfigURL == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 6ae89e454a6..5b0b9911bdb 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -1263,26 +1263,6 @@ func TestAuditEntry_GetAction(tt *testing.T) { a.GetAction() } -func TestAuditEntry_GetActive(tt *testing.T) { - var zeroValue bool - a := &AuditEntry{Active: &zeroValue} - a.GetActive() - a = &AuditEntry{} - a.GetActive() - a = nil - a.GetActive() -} - -func TestAuditEntry_GetActiveWas(tt *testing.T) { - var zeroValue bool - a := &AuditEntry{ActiveWas: &zeroValue} - a.GetActiveWas() - a = &AuditEntry{} - a.GetActiveWas() - a = nil - a.GetActiveWas() -} - func TestAuditEntry_GetActor(tt *testing.T) { var zeroValue string a := &AuditEntry{Actor: &zeroValue} @@ -1293,14 +1273,14 @@ func TestAuditEntry_GetActor(tt *testing.T) { a.GetActor() } -func TestAuditEntry_GetActorIP(tt *testing.T) { - var zeroValue string - a := &AuditEntry{ActorIP: &zeroValue} - a.GetActorIP() +func TestAuditEntry_GetActorID(tt *testing.T) { + var zeroValue int64 + a := &AuditEntry{ActorID: &zeroValue} + a.GetActorID() a = &AuditEntry{} - a.GetActorIP() + a.GetActorID() a = nil - a.GetActorIP() + a.GetActorID() } func TestAuditEntry_GetActorLocation(tt *testing.T) { @@ -1310,16 +1290,6 @@ func TestAuditEntry_GetActorLocation(tt *testing.T) { a.GetActorLocation() } -func TestAuditEntry_GetBlockedUser(tt *testing.T) { - var zeroValue string - a := &AuditEntry{BlockedUser: &zeroValue} - a.GetBlockedUser() - a = &AuditEntry{} - a.GetBlockedUser() - a = nil - a.GetBlockedUser() -} - func TestAuditEntry_GetBusiness(tt *testing.T) { var zeroValue string a := &AuditEntry{Business: &zeroValue} @@ -1330,58 +1300,14 @@ func TestAuditEntry_GetBusiness(tt *testing.T) { a.GetBusiness() } -func TestAuditEntry_GetCancelledAt(tt *testing.T) { - var zeroValue Timestamp - a := &AuditEntry{CancelledAt: &zeroValue} - a.GetCancelledAt() - a = &AuditEntry{} - a.GetCancelledAt() - a = nil - a.GetCancelledAt() -} - -func TestAuditEntry_GetCompletedAt(tt *testing.T) { - var zeroValue Timestamp - a := &AuditEntry{CompletedAt: &zeroValue} - a.GetCompletedAt() - a = &AuditEntry{} - a.GetCompletedAt() - a = nil - a.GetCompletedAt() -} - -func TestAuditEntry_GetConclusion(tt *testing.T) { - var zeroValue string - a := &AuditEntry{Conclusion: &zeroValue} - a.GetConclusion() - a = &AuditEntry{} - a.GetConclusion() - a = nil - a.GetConclusion() -} - -func TestAuditEntry_GetConfig(tt *testing.T) { - a := &AuditEntry{} - a.GetConfig() - a = nil - a.GetConfig() -} - -func TestAuditEntry_GetConfigWas(tt *testing.T) { - a := &AuditEntry{} - a.GetConfigWas() - a = nil - a.GetConfigWas() -} - -func TestAuditEntry_GetContentType(tt *testing.T) { - var zeroValue string - a := &AuditEntry{ContentType: &zeroValue} - a.GetContentType() +func TestAuditEntry_GetBusinessID(tt *testing.T) { + var zeroValue int64 + a := &AuditEntry{BusinessID: &zeroValue} + a.GetBusinessID() a = &AuditEntry{} - a.GetContentType() + a.GetBusinessID() a = nil - a.GetContentType() + a.GetBusinessID() } func TestAuditEntry_GetCreatedAt(tt *testing.T) { @@ -1394,23 +1320,6 @@ func TestAuditEntry_GetCreatedAt(tt *testing.T) { a.GetCreatedAt() } -func TestAuditEntry_GetData(tt *testing.T) { - a := &AuditEntry{} - a.GetData() - a = nil - a.GetData() -} - -func TestAuditEntry_GetDeployKeyFingerprint(tt *testing.T) { - var zeroValue string - a := &AuditEntry{DeployKeyFingerprint: &zeroValue} - a.GetDeployKeyFingerprint() - a = &AuditEntry{} - a.GetDeployKeyFingerprint() - a = nil - a.GetDeployKeyFingerprint() -} - func TestAuditEntry_GetDocumentID(tt *testing.T) { var zeroValue string a := &AuditEntry{DocumentID: &zeroValue} @@ -1421,46 +1330,6 @@ func TestAuditEntry_GetDocumentID(tt *testing.T) { a.GetDocumentID() } -func TestAuditEntry_GetEmoji(tt *testing.T) { - var zeroValue string - a := &AuditEntry{Emoji: &zeroValue} - a.GetEmoji() - a = &AuditEntry{} - a.GetEmoji() - a = nil - a.GetEmoji() -} - -func TestAuditEntry_GetEnvironmentName(tt *testing.T) { - var zeroValue string - a := &AuditEntry{EnvironmentName: &zeroValue} - a.GetEnvironmentName() - a = &AuditEntry{} - a.GetEnvironmentName() - a = nil - a.GetEnvironmentName() -} - -func TestAuditEntry_GetEvent(tt *testing.T) { - var zeroValue string - a := &AuditEntry{Event: &zeroValue} - a.GetEvent() - a = &AuditEntry{} - a.GetEvent() - a = nil - a.GetEvent() -} - -func TestAuditEntry_GetExplanation(tt *testing.T) { - var zeroValue string - a := &AuditEntry{Explanation: &zeroValue} - a.GetExplanation() - a = &AuditEntry{} - a.GetExplanation() - a = nil - a.GetExplanation() -} - func TestAuditEntry_GetExternalIdentityNameID(tt *testing.T) { var zeroValue string a := &AuditEntry{ExternalIdentityNameID: &zeroValue} @@ -1481,16 +1350,6 @@ func TestAuditEntry_GetExternalIdentityUsername(tt *testing.T) { a.GetExternalIdentityUsername() } -func TestAuditEntry_GetFingerprint(tt *testing.T) { - var zeroValue string - a := &AuditEntry{Fingerprint: &zeroValue} - a.GetFingerprint() - a = &AuditEntry{} - a.GetFingerprint() - a = nil - a.GetFingerprint() -} - func TestAuditEntry_GetHashedToken(tt *testing.T) { var zeroValue string a := &AuditEntry{HashedToken: &zeroValue} @@ -1501,146 +1360,6 @@ func TestAuditEntry_GetHashedToken(tt *testing.T) { a.GetHashedToken() } -func TestAuditEntry_GetHeadBranch(tt *testing.T) { - var zeroValue string - a := &AuditEntry{HeadBranch: &zeroValue} - a.GetHeadBranch() - a = &AuditEntry{} - a.GetHeadBranch() - a = nil - a.GetHeadBranch() -} - -func TestAuditEntry_GetHeadSHA(tt *testing.T) { - var zeroValue string - a := &AuditEntry{HeadSHA: &zeroValue} - a.GetHeadSHA() - a = &AuditEntry{} - a.GetHeadSHA() - a = nil - a.GetHeadSHA() -} - -func TestAuditEntry_GetHookID(tt *testing.T) { - var zeroValue int64 - a := &AuditEntry{HookID: &zeroValue} - a.GetHookID() - a = &AuditEntry{} - a.GetHookID() - a = nil - a.GetHookID() -} - -func TestAuditEntry_GetIsHostedRunner(tt *testing.T) { - var zeroValue bool - a := &AuditEntry{IsHostedRunner: &zeroValue} - a.GetIsHostedRunner() - a = &AuditEntry{} - a.GetIsHostedRunner() - a = nil - a.GetIsHostedRunner() -} - -func TestAuditEntry_GetJobName(tt *testing.T) { - var zeroValue string - a := &AuditEntry{JobName: &zeroValue} - a.GetJobName() - a = &AuditEntry{} - a.GetJobName() - a = nil - a.GetJobName() -} - -func TestAuditEntry_GetJobWorkflowRef(tt *testing.T) { - var zeroValue string - a := &AuditEntry{JobWorkflowRef: &zeroValue} - a.GetJobWorkflowRef() - a = &AuditEntry{} - a.GetJobWorkflowRef() - a = nil - a.GetJobWorkflowRef() -} - -func TestAuditEntry_GetLimitedAvailability(tt *testing.T) { - var zeroValue bool - a := &AuditEntry{LimitedAvailability: &zeroValue} - a.GetLimitedAvailability() - a = &AuditEntry{} - a.GetLimitedAvailability() - a = nil - a.GetLimitedAvailability() -} - -func TestAuditEntry_GetMessage(tt *testing.T) { - var zeroValue string - a := &AuditEntry{Message: &zeroValue} - a.GetMessage() - a = &AuditEntry{} - a.GetMessage() - a = nil - a.GetMessage() -} - -func TestAuditEntry_GetName(tt *testing.T) { - var zeroValue string - a := &AuditEntry{Name: &zeroValue} - a.GetName() - a = &AuditEntry{} - a.GetName() - a = nil - a.GetName() -} - -func TestAuditEntry_GetOAuthApplicationID(tt *testing.T) { - var zeroValue int64 - a := &AuditEntry{OAuthApplicationID: &zeroValue} - a.GetOAuthApplicationID() - a = &AuditEntry{} - a.GetOAuthApplicationID() - a = nil - a.GetOAuthApplicationID() -} - -func TestAuditEntry_GetOldPermission(tt *testing.T) { - var zeroValue string - a := &AuditEntry{OldPermission: &zeroValue} - a.GetOldPermission() - a = &AuditEntry{} - a.GetOldPermission() - a = nil - a.GetOldPermission() -} - -func TestAuditEntry_GetOldUser(tt *testing.T) { - var zeroValue string - a := &AuditEntry{OldUser: &zeroValue} - a.GetOldUser() - a = &AuditEntry{} - a.GetOldUser() - a = nil - a.GetOldUser() -} - -func TestAuditEntry_GetOpenSSHPublicKey(tt *testing.T) { - var zeroValue string - a := &AuditEntry{OpenSSHPublicKey: &zeroValue} - a.GetOpenSSHPublicKey() - a = &AuditEntry{} - a.GetOpenSSHPublicKey() - a = nil - a.GetOpenSSHPublicKey() -} - -func TestAuditEntry_GetOperationType(tt *testing.T) { - var zeroValue string - a := &AuditEntry{OperationType: &zeroValue} - a.GetOperationType() - a = &AuditEntry{} - a.GetOperationType() - a = nil - a.GetOperationType() -} - func TestAuditEntry_GetOrg(tt *testing.T) { var zeroValue string a := &AuditEntry{Org: &zeroValue} @@ -1661,226 +1380,6 @@ func TestAuditEntry_GetOrgID(tt *testing.T) { a.GetOrgID() } -func TestAuditEntry_GetPermission(tt *testing.T) { - var zeroValue string - a := &AuditEntry{Permission: &zeroValue} - a.GetPermission() - a = &AuditEntry{} - a.GetPermission() - a = nil - a.GetPermission() -} - -func TestAuditEntry_GetPreviousVisibility(tt *testing.T) { - var zeroValue string - a := &AuditEntry{PreviousVisibility: &zeroValue} - a.GetPreviousVisibility() - a = &AuditEntry{} - a.GetPreviousVisibility() - a = nil - a.GetPreviousVisibility() -} - -func TestAuditEntry_GetProgrammaticAccessType(tt *testing.T) { - var zeroValue string - a := &AuditEntry{ProgrammaticAccessType: &zeroValue} - a.GetProgrammaticAccessType() - a = &AuditEntry{} - a.GetProgrammaticAccessType() - a = nil - a.GetProgrammaticAccessType() -} - -func TestAuditEntry_GetPullRequestID(tt *testing.T) { - var zeroValue int64 - a := &AuditEntry{PullRequestID: &zeroValue} - a.GetPullRequestID() - a = &AuditEntry{} - a.GetPullRequestID() - a = nil - a.GetPullRequestID() -} - -func TestAuditEntry_GetPullRequestTitle(tt *testing.T) { - var zeroValue string - a := &AuditEntry{PullRequestTitle: &zeroValue} - a.GetPullRequestTitle() - a = &AuditEntry{} - a.GetPullRequestTitle() - a = nil - a.GetPullRequestTitle() -} - -func TestAuditEntry_GetPullRequestURL(tt *testing.T) { - var zeroValue string - a := &AuditEntry{PullRequestURL: &zeroValue} - a.GetPullRequestURL() - a = &AuditEntry{} - a.GetPullRequestURL() - a = nil - a.GetPullRequestURL() -} - -func TestAuditEntry_GetReadOnly(tt *testing.T) { - var zeroValue string - a := &AuditEntry{ReadOnly: &zeroValue} - a.GetReadOnly() - a = &AuditEntry{} - a.GetReadOnly() - a = nil - a.GetReadOnly() -} - -func TestAuditEntry_GetReferrer(tt *testing.T) { - var zeroValue string - a := &AuditEntry{Referrer: &zeroValue} - a.GetReferrer() - a = &AuditEntry{} - a.GetReferrer() - a = nil - a.GetReferrer() -} - -func TestAuditEntry_GetRepo(tt *testing.T) { - var zeroValue string - a := &AuditEntry{Repo: &zeroValue} - a.GetRepo() - a = &AuditEntry{} - a.GetRepo() - a = nil - a.GetRepo() -} - -func TestAuditEntry_GetRepository(tt *testing.T) { - var zeroValue string - a := &AuditEntry{Repository: &zeroValue} - a.GetRepository() - a = &AuditEntry{} - a.GetRepository() - a = nil - a.GetRepository() -} - -func TestAuditEntry_GetRepositoryPublic(tt *testing.T) { - var zeroValue bool - a := &AuditEntry{RepositoryPublic: &zeroValue} - a.GetRepositoryPublic() - a = &AuditEntry{} - a.GetRepositoryPublic() - a = nil - 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} - a.GetRunnerGroupID() - a = &AuditEntry{} - a.GetRunnerGroupID() - a = nil - a.GetRunnerGroupID() -} - -func TestAuditEntry_GetRunnerGroupName(tt *testing.T) { - var zeroValue string - a := &AuditEntry{RunnerGroupName: &zeroValue} - a.GetRunnerGroupName() - a = &AuditEntry{} - a.GetRunnerGroupName() - a = nil - a.GetRunnerGroupName() -} - -func TestAuditEntry_GetRunnerID(tt *testing.T) { - var zeroValue int64 - a := &AuditEntry{RunnerID: &zeroValue} - a.GetRunnerID() - a = &AuditEntry{} - a.GetRunnerID() - a = nil - a.GetRunnerID() -} - -func TestAuditEntry_GetRunnerName(tt *testing.T) { - var zeroValue string - a := &AuditEntry{RunnerName: &zeroValue} - a.GetRunnerName() - a = &AuditEntry{} - a.GetRunnerName() - a = nil - a.GetRunnerName() -} - -func TestAuditEntry_GetRunNumber(tt *testing.T) { - var zeroValue int64 - a := &AuditEntry{RunNumber: &zeroValue} - a.GetRunNumber() - a = &AuditEntry{} - a.GetRunNumber() - a = nil - a.GetRunNumber() -} - -func TestAuditEntry_GetSourceVersion(tt *testing.T) { - var zeroValue string - a := &AuditEntry{SourceVersion: &zeroValue} - a.GetSourceVersion() - a = &AuditEntry{} - a.GetSourceVersion() - a = nil - a.GetSourceVersion() -} - -func TestAuditEntry_GetStartedAt(tt *testing.T) { - var zeroValue Timestamp - a := &AuditEntry{StartedAt: &zeroValue} - a.GetStartedAt() - a = &AuditEntry{} - a.GetStartedAt() - a = nil - a.GetStartedAt() -} - -func TestAuditEntry_GetTargetLogin(tt *testing.T) { - var zeroValue string - a := &AuditEntry{TargetLogin: &zeroValue} - a.GetTargetLogin() - a = &AuditEntry{} - a.GetTargetLogin() - a = nil - a.GetTargetLogin() -} - -func TestAuditEntry_GetTargetVersion(tt *testing.T) { - var zeroValue string - a := &AuditEntry{TargetVersion: &zeroValue} - a.GetTargetVersion() - a = &AuditEntry{} - a.GetTargetVersion() - a = nil - a.GetTargetVersion() -} - -func TestAuditEntry_GetTeam(tt *testing.T) { - var zeroValue string - a := &AuditEntry{Team: &zeroValue} - a.GetTeam() - a = &AuditEntry{} - a.GetTeam() - a = nil - a.GetTeam() -} - func TestAuditEntry_GetTimestamp(tt *testing.T) { var zeroValue Timestamp a := &AuditEntry{Timestamp: &zeroValue} @@ -1911,46 +1410,6 @@ func TestAuditEntry_GetTokenScopes(tt *testing.T) { a.GetTokenScopes() } -func TestAuditEntry_GetTopic(tt *testing.T) { - var zeroValue string - a := &AuditEntry{Topic: &zeroValue} - a.GetTopic() - a = &AuditEntry{} - a.GetTopic() - a = nil - a.GetTopic() -} - -func TestAuditEntry_GetTransportProtocol(tt *testing.T) { - var zeroValue int - a := &AuditEntry{TransportProtocol: &zeroValue} - a.GetTransportProtocol() - a = &AuditEntry{} - a.GetTransportProtocol() - a = nil - a.GetTransportProtocol() -} - -func TestAuditEntry_GetTransportProtocolName(tt *testing.T) { - var zeroValue string - a := &AuditEntry{TransportProtocolName: &zeroValue} - a.GetTransportProtocolName() - a = &AuditEntry{} - a.GetTransportProtocolName() - a = nil - a.GetTransportProtocolName() -} - -func TestAuditEntry_GetTriggerID(tt *testing.T) { - var zeroValue int64 - a := &AuditEntry{TriggerID: &zeroValue} - a.GetTriggerID() - a = &AuditEntry{} - a.GetTriggerID() - a = nil - a.GetTriggerID() -} - func TestAuditEntry_GetUser(tt *testing.T) { var zeroValue string a := &AuditEntry{User: &zeroValue} @@ -1961,64 +1420,14 @@ func TestAuditEntry_GetUser(tt *testing.T) { a.GetUser() } -func TestAuditEntry_GetUserAgent(tt *testing.T) { - var zeroValue string - a := &AuditEntry{UserAgent: &zeroValue} - a.GetUserAgent() - a = &AuditEntry{} - a.GetUserAgent() - a = nil - a.GetUserAgent() -} - -func TestAuditEntry_GetVisibility(tt *testing.T) { - var zeroValue string - a := &AuditEntry{Visibility: &zeroValue} - a.GetVisibility() - a = &AuditEntry{} - a.GetVisibility() - a = nil - a.GetVisibility() -} - -func TestAuditEntry_GetWorkflowID(tt *testing.T) { +func TestAuditEntry_GetUserID(tt *testing.T) { var zeroValue int64 - a := &AuditEntry{WorkflowID: &zeroValue} - a.GetWorkflowID() + a := &AuditEntry{UserID: &zeroValue} + a.GetUserID() a = &AuditEntry{} - a.GetWorkflowID() + a.GetUserID() a = nil - a.GetWorkflowID() -} - -func TestAuditEntry_GetWorkflowRunID(tt *testing.T) { - var zeroValue int64 - a := &AuditEntry{WorkflowRunID: &zeroValue} - a.GetWorkflowRunID() - a = &AuditEntry{} - a.GetWorkflowRunID() - a = nil - a.GetWorkflowRunID() -} - -func TestAuditEntryData_GetOldLogin(tt *testing.T) { - var zeroValue string - a := &AuditEntryData{OldLogin: &zeroValue} - a.GetOldLogin() - a = &AuditEntryData{} - a.GetOldLogin() - a = nil - a.GetOldLogin() -} - -func TestAuditEntryData_GetOldName(tt *testing.T) { - var zeroValue string - a := &AuditEntryData{OldName: &zeroValue} - a.GetOldName() - a = &AuditEntryData{} - a.GetOldName() - a = nil - a.GetOldName() + a.GetUserID() } func TestAuthorization_GetApp(tt *testing.T) { @@ -16949,26 +16358,6 @@ func TestPlan_GetSpace(tt *testing.T) { p.GetSpace() } -func TestPolicyOverrideReason_GetCode(tt *testing.T) { - var zeroValue string - p := &PolicyOverrideReason{Code: &zeroValue} - p.GetCode() - p = &PolicyOverrideReason{} - p.GetCode() - p = nil - p.GetCode() -} - -func TestPolicyOverrideReason_GetMessage(tt *testing.T) { - var zeroValue string - p := &PolicyOverrideReason{Message: &zeroValue} - p.GetMessage() - p = &PolicyOverrideReason{} - p.GetMessage() - p = nil - p.GetMessage() -} - func TestPreReceiveHook_GetConfigURL(tt *testing.T) { var zeroValue string p := &PreReceiveHook{ConfigURL: &zeroValue} diff --git a/github/github_test.go b/github/github_test.go index 4d672f6096f..45ac57c0019 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -275,6 +275,13 @@ func testErrorResponseForStatusCode(t *testing.T, code int) { } } +func assertNoDiff(t *testing.T, want, got interface{}) { + t.Helper() + if diff := cmp.Diff(want, got); diff != "" { + t.Errorf("diff mismatch (-want +got):\n%v", diff) + } +} + func assertNilError(t *testing.T, err error) { t.Helper() if err != nil { diff --git a/github/orgs_audit_log.go b/github/orgs_audit_log.go index aa3591359ef..28ac079bb3b 100644 --- a/github/orgs_audit_log.go +++ b/github/orgs_audit_log.go @@ -7,6 +7,7 @@ package github import ( "context" + "encoding/json" "fmt" ) @@ -34,104 +35,94 @@ type ActorLocation struct { CountryCode *string `json:"country_code,omitempty"` } -// PolicyOverrideReason contains user-supplied information about why a policy was overridden. -type PolicyOverrideReason struct { - Code *string `json:"code,omitempty"` - Message *string `json:"message,omitempty"` -} - // AuditEntry describes the fields that may be represented by various audit-log "action" entries. +// There are many other fields that may be present depending on the action. You can access those +// in AdditionalFields. // For a list of actions see - https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization#audit-log-actions type AuditEntry struct { - ActorIP *string `json:"actor_ip,omitempty"` - Action *string `json:"action,omitempty"` // The name of the action that was performed, for example `user.login` or `repo.create`. - Active *bool `json:"active,omitempty"` - ActiveWas *bool `json:"active_was,omitempty"` - Actor *string `json:"actor,omitempty"` // The actor who performed the action. - ActorLocation *ActorLocation `json:"actor_location,omitempty"` - BlockedUser *string `json:"blocked_user,omitempty"` - Business *string `json:"business,omitempty"` - CancelledAt *Timestamp `json:"cancelled_at,omitempty"` - CompletedAt *Timestamp `json:"completed_at,omitempty"` - Conclusion *string `json:"conclusion,omitempty"` - Config *HookConfig `json:"config,omitempty"` - ConfigWas *HookConfig `json:"config_was,omitempty"` - ContentType *string `json:"content_type,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - DeployKeyFingerprint *string `json:"deploy_key_fingerprint,omitempty"` - DocumentID *string `json:"_document_id,omitempty"` - Emoji *string `json:"emoji,omitempty"` - EnvironmentName *string `json:"environment_name,omitempty"` - Event *string `json:"event,omitempty"` - Events []string `json:"events,omitempty"` - EventsWere []string `json:"events_were,omitempty"` - Explanation *string `json:"explanation,omitempty"` - ExternalIdentityNameID *string `json:"external_identity_nameid,omitempty"` - ExternalIdentityUsername *string `json:"external_identity_username,omitempty"` - Fingerprint *string `json:"fingerprint,omitempty"` - HashedToken *string `json:"hashed_token,omitempty"` - HeadBranch *string `json:"head_branch,omitempty"` - HeadSHA *string `json:"head_sha,omitempty"` - HookID *int64 `json:"hook_id,omitempty"` - IsHostedRunner *bool `json:"is_hosted_runner,omitempty"` - JobName *string `json:"job_name,omitempty"` - JobWorkflowRef *string `json:"job_workflow_ref,omitempty"` - LimitedAvailability *bool `json:"limited_availability,omitempty"` - Message *string `json:"message,omitempty"` - Name *string `json:"name,omitempty"` - OAuthApplicationID *int64 `json:"oauth_application_id,omitempty"` - OldUser *string `json:"old_user,omitempty"` - OldPermission *string `json:"old_permission,omitempty"` // The permission level for membership changes, for example `admin` or `read`. - OpenSSHPublicKey *string `json:"openssh_public_key,omitempty"` - OperationType *string `json:"operation_type,omitempty"` - Org *string `json:"org,omitempty"` - OrgID *int64 `json:"org_id,omitempty"` - OverriddenCodes []string `json:"overridden_codes,omitempty"` - Permission *string `json:"permission,omitempty"` // The permission level for membership changes, for example `admin` or `read`. - PreviousVisibility *string `json:"previous_visibility,omitempty"` - ProgrammaticAccessType *string `json:"programmatic_access_type,omitempty"` - PullRequestID *int64 `json:"pull_request_id,omitempty"` - PullRequestTitle *string `json:"pull_request_title,omitempty"` - PullRequestURL *string `json:"pull_request_url,omitempty"` - ReadOnly *string `json:"read_only,omitempty"` - Reasons []*PolicyOverrideReason `json:"reasons,omitempty"` - Referrer *string `json:"referrer,omitempty"` - 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"` - RunnerLabels []string `json:"runner_labels,omitempty"` - RunnerName *string `json:"runner_name,omitempty"` - RunNumber *int64 `json:"run_number,omitempty"` - SecretsPassed []string `json:"secrets_passed,omitempty"` - SourceVersion *string `json:"source_version,omitempty"` - StartedAt *Timestamp `json:"started_at,omitempty"` - TargetLogin *string `json:"target_login,omitempty"` - TargetVersion *string `json:"target_version,omitempty"` - Team *string `json:"team,omitempty"` - Timestamp *Timestamp `json:"@timestamp,omitempty"` // The time the audit log event occurred, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). - TokenID *int64 `json:"token_id,omitempty"` - TokenScopes *string `json:"token_scopes,omitempty"` - Topic *string `json:"topic,omitempty"` - TransportProtocolName *string `json:"transport_protocol_name,omitempty"` // A human readable name for the protocol (for example, HTTP or SSH) used to transfer Git data. - TransportProtocol *int `json:"transport_protocol,omitempty"` // The type of protocol (for example, HTTP=1 or SSH=2) used to transfer Git data. - TriggerID *int64 `json:"trigger_id,omitempty"` - User *string `json:"user,omitempty"` // The user that was affected by the action performed (if available). - UserAgent *string `json:"user_agent,omitempty"` - Visibility *string `json:"visibility,omitempty"` // The repository visibility, for example `public` or `private`. - WorkflowID *int64 `json:"workflow_id,omitempty"` - WorkflowRunID *int64 `json:"workflow_run_id,omitempty"` - - Data *AuditEntryData `json:"data,omitempty"` + Action *string `json:"action,omitempty"` // The name of the action that was performed, for example `user.login` or `repo.create`. + Actor *string `json:"actor,omitempty"` // The actor who performed the action. + ActorID *int64 `json:"actor_id,omitempty"` + ActorLocation *ActorLocation `json:"actor_location,omitempty"` + Business *string `json:"business,omitempty"` + BusinessID *int64 `json:"business_id,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + DocumentID *string `json:"_document_id,omitempty"` + ExternalIdentityNameID *string `json:"external_identity_nameid,omitempty"` + ExternalIdentityUsername *string `json:"external_identity_username,omitempty"` + HashedToken *string `json:"hashed_token,omitempty"` + Org *string `json:"org,omitempty"` + OrgID *int64 `json:"org_id,omitempty"` + Timestamp *Timestamp `json:"@timestamp,omitempty"` // The time the audit log event occurred, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). + TokenID *int64 `json:"token_id,omitempty"` + TokenScopes *string `json:"token_scopes,omitempty"` + User *string `json:"user,omitempty"` // The user that was affected by the action performed (if available). + UserID *int64 `json:"user_id,omitempty"` + + // Some events types have a data field that contains additional information about the event. + Data map[string]interface{} `json:"data,omitempty"` + + // All fields that are not explicitly defined in the struct are captured here. + AdditionalFields map[string]interface{} `json:"-"` +} + +func (a *AuditEntry) UnmarshalJSON(data []byte) error { + type entryAlias AuditEntry + var v entryAlias + if err := json.Unmarshal(data, &v); err != nil { + return err + } + + rawDefinedFields, err := json.Marshal(v) + if err != nil { + return err + } + definedFields := map[string]interface{}{} + if err := json.Unmarshal(rawDefinedFields, &definedFields); err != nil { + return err + } + + if err := json.Unmarshal(data, &v.AdditionalFields); err != nil { + return err + } + + for key, val := range v.AdditionalFields { + if _, ok := definedFields[key]; ok || val == nil { + delete(v.AdditionalFields, key) + } + } + + *a = AuditEntry(v) + if len(v.AdditionalFields) == 0 { + a.AdditionalFields = nil + } + return nil } -// AuditEntryData represents additional information stuffed into a `data` field. -type AuditEntryData struct { - OldName *string `json:"old_name,omitempty"` // The previous name of the repository, for a name change - OldLogin *string `json:"old_login,omitempty"` // The previous name of the organization, for a name change +func (a *AuditEntry) MarshalJSON() ([]byte, error) { + type entryAlias AuditEntry + v := entryAlias(*a) + defBytes, err := json.Marshal(v) + if err != nil { + return nil, err + } + if len(a.AdditionalFields) == 0 { + return defBytes, err + } + resMap := map[string]interface{}{} + if err := json.Unmarshal(defBytes, &resMap); err != nil { + return nil, err + } + for key, val := range a.AdditionalFields { + if val == nil { + continue + } + if _, ok := resMap[key]; ok { + return nil, fmt.Errorf("unexpected field in AdditionalFields: %v", key) + } + resMap[key] = val + } + return json.Marshal(resMap) } // GetAuditLog gets the audit-log entries for an organization. diff --git a/github/orgs_audit_log_test.go b/github/orgs_audit_log_test.go index 1a82471face..7c8de74c650 100644 --- a/github/orgs_audit_log_test.go +++ b/github/orgs_audit_log_test.go @@ -12,8 +12,6 @@ import ( "strings" "testing" "time" - - "github.com/google/go-cmp/cmp" ) func TestOrganizationService_GetAuditLog(t *testing.T) { @@ -24,46 +22,43 @@ func TestOrganizationService_GetAuditLog(t *testing.T) { testMethod(t, r, "GET") fmt.Fprint(w, `[ - { + { + "@timestamp": 1615077308538, + "_document_id": "beeZYapIUe-wKg5-beadb33", + "action": "workflows.completed_workflow_run", + "active": true, + "actor": "testactor", "actor_ip": "10.0.0.1", "actor_location": { "country_code": "US" }, - "active": true, - "workflow_id": 123456, - "head_branch": "master", - "org": "o", - "trigger_id": null, - "repo": "o/blue-crayon-1", - "created_at": 1615077308538, + "cancelled_at": "2021-03-07T00:35:08.000Z", + "completed_at": "2021-03-07T00:35:08.000Z", + "conclusion": "success", + "config": { + "content_type": "json", + "insecure_ssl": "0", + "url": "https://example.com/deadbeef-new-hook" + }, + "created_at": 1615077308538, + "event": "schedule", + "events": ["code_scanning_alert"], "hashed_token": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=", - "head_sha": "5acdeadbeef64d1a62388e901e5cdc9358644b37", - "conclusion": "success", - "old_permission": "read", - "permission": "admin", - "actor": "testactor", - "completed_at": "2021-03-07T00:35:08.000Z", - "@timestamp": 1615077308538, - "name": "Code scanning - action", - "action": "workflows.completed_workflow_run", - "started_at": "2021-03-07T00:33:04.000Z", - "event": "schedule", - "workflow_run_id": 628312345, - "_document_id": "beeZYapIUe-wKg5-beadb33", - "run_attempt": 1, - "run_number": 1, - "token_id": 1, - "token_scopes": "gist,repo:read", - "topic": "cp1-iad.ingest.github.actions.v0.WorkflowUpdate", + "head_branch": "master", + "head_sha": "5acdeadbeef64d1a62388e901e5cdc9358644b37", "job_workflow_ref": "testorg/testrepo/.github/workflows/testjob.yml@refs/pull/1/merge", + "name": "Code scanning - action", "oauth_application_id": 1, + "old_permission": "read", + "org": "o", "org_id": 1, - "pull_request_id": 1, - "pull_request_title": "a pr title", - "pull_request_url": "https://github.com/testorg/testrepo/pull/1", "overridden_codes": [ "review_policy_not_satisfied" ], + "permission": "admin", + "pull_request_id": 1, + "pull_request_title": "a pr title", + "pull_request_url": "https://github.com/testorg/testrepo/pull/1", "reasons": [ { "code": "a code", @@ -71,14 +66,19 @@ func TestOrganizationService_GetAuditLog(t *testing.T) { } ], "programmatic_access_type": "GitHub App server-to-server token", + "referrer": "a referrer", + "repo": "o/blue-crayon-1", + "run_attempt": 1, + "run_number": 1, + "started_at": "2021-03-07T00:33:04.000Z", + "token_id": 1, + "token_scopes": "gist,repo:read", + "topic": "cp1-iad.ingest.github.actions.v0.WorkflowUpdate", + "trigger_id": null, "user_agent": "a user agent", - "config": { - "content_type": "json", - "insecure_ssl": "0", - "url": "https://example.com/deadbeef-new-hook" - }, - "events": ["code_scanning_alert"] - }]`) + "workflow_id": 123456, + "workflow_run_id": 628312345 + }]`) }) ctx := context.Background() getOpts := GetAuditLogOptions{ @@ -91,8 +91,6 @@ func TestOrganizationService_GetAuditLog(t *testing.T) { if err != nil { t.Errorf("Organizations.GetAuditLog returned error: %v", err) } - startedAt, _ := time.Parse(time.RFC3339, "2021-03-07T00:33:04.000Z") - completedAt, _ := time.Parse(time.RFC3339, "2021-03-07T00:35:08.000Z") timestamp := time.Unix(0, 1615077308538*1e6) want := []*AuditEntry{ @@ -101,56 +99,58 @@ func TestOrganizationService_GetAuditLog(t *testing.T) { DocumentID: String("beeZYapIUe-wKg5-beadb33"), Action: String("workflows.completed_workflow_run"), Actor: String("testactor"), - ActorIP: String("10.0.0.1"), ActorLocation: &ActorLocation{ CountryCode: String("US"), }, - Active: Bool(true), - CompletedAt: &Timestamp{completedAt}, - Conclusion: String("success"), - CreatedAt: &Timestamp{timestamp}, - Event: String("schedule"), - HashedToken: String("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="), - HeadBranch: String("master"), - HeadSHA: String("5acdeadbeef64d1a62388e901e5cdc9358644b37"), - JobWorkflowRef: String("testorg/testrepo/.github/workflows/testjob.yml@refs/pull/1/merge"), - Name: String("Code scanning - action"), - OAuthApplicationID: Int64(1), - OldPermission: String("read"), - Org: String("o"), - OrgID: Int64(1), - OverriddenCodes: []string{"review_policy_not_satisfied"}, - Permission: String("admin"), - ProgrammaticAccessType: String("GitHub App server-to-server token"), - PullRequestID: Int64(1), - PullRequestTitle: String("a pr title"), - PullRequestURL: String("https://github.com/testorg/testrepo/pull/1"), - Reasons: []*PolicyOverrideReason{{ - Code: String("a code"), - Message: String("a message"), - }}, - Repo: String("o/blue-crayon-1"), - RunAttempt: Int64(1), - RunNumber: Int64(1), - StartedAt: &Timestamp{startedAt}, - TokenID: Int64(1), - TokenScopes: String("gist,repo:read"), - Topic: String("cp1-iad.ingest.github.actions.v0.WorkflowUpdate"), - UserAgent: String("a user agent"), - WorkflowID: Int64(123456), - WorkflowRunID: Int64(628312345), - Events: []string{"code_scanning_alert"}, - Config: &HookConfig{ - ContentType: String("json"), - InsecureSSL: String("0"), - URL: String("https://example.com/deadbeef-new-hook"), + CreatedAt: &Timestamp{timestamp}, + HashedToken: String("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="), + Org: String("o"), + OrgID: Int64(1), + TokenID: Int64(1), + TokenScopes: String("gist,repo:read"), + AdditionalFields: map[string]interface{}{ + "actor_ip": "10.0.0.1", + "active": true, + "cancelled_at": "2021-03-07T00:35:08.000Z", + "completed_at": "2021-03-07T00:35:08.000Z", + "conclusion": "success", + "event": "schedule", + "head_branch": "master", + "head_sha": "5acdeadbeef64d1a62388e901e5cdc9358644b37", + "job_workflow_ref": "testorg/testrepo/.github/workflows/testjob.yml@refs/pull/1/merge", + "name": "Code scanning - action", + "oauth_application_id": float64(1), + "old_permission": "read", + "overridden_codes": []interface{}{"review_policy_not_satisfied"}, + "permission": "admin", + "programmatic_access_type": "GitHub App server-to-server token", + "pull_request_id": float64(1), + "pull_request_title": "a pr title", + "pull_request_url": "https://github.com/testorg/testrepo/pull/1", + "reasons": []interface{}{map[string]interface{}{ + "code": "a code", + "message": "a message", + }}, + "referrer": "a referrer", + "repo": "o/blue-crayon-1", + "run_attempt": float64(1), + "run_number": float64(1), + "started_at": "2021-03-07T00:33:04.000Z", + "topic": "cp1-iad.ingest.github.actions.v0.WorkflowUpdate", + "user_agent": "a user agent", + "workflow_id": float64(123456), + "workflow_run_id": float64(628312345), + "events": []interface{}{"code_scanning_alert"}, + "config": map[string]interface{}{ + "content_type": "json", + "insecure_ssl": "0", + "url": "https://example.com/deadbeef-new-hook", + }, }, }, } - if !cmp.Equal(auditEntries, want) { - t.Errorf("Organizations.GetAuditLog return \ngot: %+v,\nwant:%+v", auditEntries, want) - } + assertNoDiff(t, want, auditEntries) // assert query string has lower case params requestedQuery := resp.Request.URL.RawQuery @@ -224,86 +224,95 @@ func TestAuditEntry_Marshal(t *testing.T) { u := &AuditEntry{ Action: String("a"), - Active: Bool(false), - ActiveWas: Bool(false), Actor: String("ac"), - ActorIP: String("aip"), ActorLocation: &ActorLocation{CountryCode: String("alcc")}, - BlockedUser: String("bu"), Business: String("b"), - CancelledAt: &Timestamp{referenceTime}, - CompletedAt: &Timestamp{referenceTime}, - Conclusion: String("c"), - Config: &HookConfig{URL: String("s")}, - ConfigWas: &HookConfig{URL: String("s")}, - ContentType: String("ct"), CreatedAt: &Timestamp{referenceTime}, - DeployKeyFingerprint: String("dkf"), DocumentID: String("did"), - Emoji: String("e"), - EnvironmentName: String("en"), - Event: String("e"), - Events: []string{"s"}, - EventsWere: []string{"s"}, - Explanation: String("e"), ExternalIdentityNameID: String("ein"), ExternalIdentityUsername: String("eiu"), - Fingerprint: String("f"), HashedToken: String("ht"), - HeadBranch: String("hb"), - HeadSHA: String("hsha"), - HookID: Int64(1), - IsHostedRunner: Bool(false), - JobName: String("jn"), - LimitedAvailability: Bool(false), - Message: String("m"), - Name: String("n"), - OldPermission: String("op"), - OldUser: String("ou"), - OpenSSHPublicKey: String("osshpk"), Org: String("o"), OrgID: Int64(1), - Permission: String("p"), - PreviousVisibility: String("pv"), - ProgrammaticAccessType: String("pat"), - PullRequestID: Int64(1), - PullRequestTitle: String("prt"), - PullRequestURL: String("pru"), - Reasons: []*PolicyOverrideReason{{ - Code: String("c"), - Message: String("m"), - }}, - ReadOnly: String("ro"), - Repo: String("r"), - Repository: String("repo"), - RepositoryPublic: Bool(false), - RunAttempt: Int64(1), - RunnerGroupID: Int64(1), - RunnerGroupName: String("rgn"), - RunnerID: Int64(1), - RunnerLabels: []string{"s"}, - RunnerName: String("rn"), - SecretsPassed: []string{"s"}, - SourceVersion: String("sv"), - StartedAt: &Timestamp{referenceTime}, - TargetLogin: String("tl"), - TargetVersion: String("tv"), - Team: String("t"), - Timestamp: &Timestamp{referenceTime}, - TokenID: Int64(1), - TokenScopes: String("ts"), - Topic: String("tp"), - TransportProtocolName: String("tpn"), - TransportProtocol: Int(1), - TriggerID: Int64(1), - User: String("u"), - UserAgent: String("ua"), - Visibility: String("v"), - WorkflowID: Int64(1), - WorkflowRunID: Int64(1), - Data: &AuditEntryData{ - OldName: String("on"), - OldLogin: String("ol"), + Timestamp: &Timestamp{referenceTime}, + TokenID: Int64(1), + TokenScopes: String("ts"), + User: String("u"), + Data: map[string]interface{}{ + "old_name": "on", + "old_login": "ol", + }, + AdditionalFields: map[string]interface{}{ + "active": false, + "active_was": false, + "actor_ip": "aip", + "blocked_user": "bu", + "cancelled_at": "2021-03-07T00:35:08.000Z", + "completed_at": "2021-03-07T00:35:08.000Z", + "conclusion": "c", + "config": map[string]interface{}{ + "url": "s", + }, + "config_was": map[string]interface{}{ + "url": "s", + }, + "content_type": "ct", + "deploy_key_fingerprint": "dkf", + "emoji": "e", + "environment_name": "en", + "event": "e", + "events": []interface{}{"s"}, + "events_were": []interface{}{"s"}, + "explanation": "e", + "fingerprint": "f", + "head_branch": "hb", + "head_sha": "hsha", + "hook_id": float64(1), + "is_hosted_runner": false, + "job_name": "jn", + "limited_availability": false, + "message": "m", + "name": "n", + "old_permission": "op", + "old_user": "ou", + "openssh_public_key": "osshpk", + "permission": "p", + "previous_visibility": "pv", + "programmatic_access_type": "pat", + "pull_request_id": float64(1), + "pull_request_title": "prt", + "pull_request_url": "pru", + "read_only": "ro", + "reasons": []interface{}{ + map[string]interface{}{ + "code": "c", + "message": "m", + }, + }, + "referrer": "a referrer", + "repo": "r", + "repository": "repo", + "repository_public": false, + "run_attempt": 1, + "runner_group_id": 1, + "runner_group_name": "rgn", + "runner_id": 1, + "runner_labels": []interface{}{"s"}, + "runner_name": "rn", + "secrets_passed": []interface{}{"s"}, + "source_version": "sv", + "started_at": "2006-01-02T15:04:05Z", + "target_login": "tl", + "target_version": "tv", + "team": "t", + "topic": "cp1-iad.ingest.github.actions.v0.WorkflowUpdate", + "transport_protocol": 1, + "transport_protocol_name": "tpn", + "trigger_id": 1, + "user_agent": "ua", + "visibility": "v", + "workflow_id": 1, + "workflow_run_id": 1, }, } @@ -318,8 +327,8 @@ func TestAuditEntry_Marshal(t *testing.T) { }, "blocked_user": "bu", "business": "b", - "cancelled_at": ` + referenceTimeStr + `, - "completed_at": ` + referenceTimeStr + `, + "cancelled_at": "2021-03-07T00:35:08.000Z", + "completed_at": "2021-03-07T00:35:08.000Z", "conclusion": "c", "config": { "url": "s" @@ -368,6 +377,7 @@ func TestAuditEntry_Marshal(t *testing.T) { "code": "c", "message": "m" }], + "referrer": "a referrer", "read_only": "ro", "repo": "r", "repository": "repo", @@ -391,7 +401,7 @@ func TestAuditEntry_Marshal(t *testing.T) { "@timestamp": ` + referenceTimeStr + `, "token_id": 1, "token_scopes": "ts", - "topic": "tp", + "topic": "cp1-iad.ingest.github.actions.v0.WorkflowUpdate", "transport_protocol_name": "tpn", "transport_protocol": 1, "trigger_id": 1, diff --git a/test/integration/audit_log_test.go b/test/integration/audit_log_test.go index 7819f9292ff..639ea7a6780 100644 --- a/test/integration/audit_log_test.go +++ b/test/integration/audit_log_test.go @@ -28,6 +28,6 @@ func TestOrganizationAuditLog(t *testing.T) { } for _, e := range entries { - t.Log(e.GetAction(), e.GetActor(), e.GetTimestamp(), e.GetUser(), e.GetActive()) + t.Log(e.GetAction(), e.GetActor(), e.GetTimestamp(), e.GetUser()) } } From 9d6658a678d61dcbb8b63b53eb12f519a221c749 Mon Sep 17 00:00:00 2001 From: Osama Faqhruldin Date: Tue, 19 Dec 2023 09:31:54 -0500 Subject: [PATCH 371/751] Add Copilot endpoints (#2973) Fixes: #2938. --- github/copilot.go | 311 +++++++++++ github/copilot_test.go | 887 ++++++++++++++++++++++++++++++++ github/github-accessors.go | 56 ++ github/github-accessors_test.go | 64 +++ github/github.go | 2 + 5 files changed, 1320 insertions(+) create mode 100644 github/copilot.go create mode 100644 github/copilot_test.go diff --git a/github/copilot.go b/github/copilot.go new file mode 100644 index 00000000000..3f3d73b25bc --- /dev/null +++ b/github/copilot.go @@ -0,0 +1,311 @@ +// Copyright 2023 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" +) + +// CopilotService provides access to the Copilot-related functions +// in the GitHub API. +// +// GitHub API docs: https://docs.github.com/en/rest/copilot/ +type CopilotService service + +// CopilotOrganizationDetails represents the details of an organization's Copilot for Business subscription. +type CopilotOrganizationDetails struct { + SeatBreakdown *CopilotSeatBreakdown `json:"seat_breakdown"` + PublicCodeSuggestions string `json:"public_code_suggestions"` + CopilotChat string `json:"copilot_chat"` + SeatManagementSetting string `json:"seat_management_setting"` +} + +// CopilotSeatBreakdown represents the breakdown of Copilot for Business seats for the organization. +type CopilotSeatBreakdown struct { + Total int `json:"total"` + AddedThisCycle int `json:"added_this_cycle"` + PendingCancellation int `json:"pending_cancellation"` + PendingInvitation int `json:"pending_invitation"` + ActiveThisCycle int `json:"active_this_cycle"` + InactiveThisCycle int `json:"inactive_this_cycle"` +} + +// ListCopilotSeatsResponse represents the Copilot for Business seat assignments for an organization. +type ListCopilotSeatsResponse struct { + TotalSeats int64 `json:"total_seats"` + Seats []*CopilotSeatDetails `json:"seats"` +} + +// CopilotSeatDetails represents the details of a Copilot for Business seat. +type CopilotSeatDetails struct { + // Assignee can either be a User, Team, or Organization. + Assignee interface{} `json:"assignee"` + AssigningTeam *Team `json:"assigning_team,omitempty"` + PendingCancellationDate *string `json:"pending_cancellation_date,omitempty"` + LastActivityAt *Timestamp `json:"last_activity_at,omitempty"` + LastActivityEditor *string `json:"last_activity_editor,omitempty"` + CreatedAt *Timestamp `json:"created_at"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` +} + +// SeatAssignments represents the number of seats assigned. +type SeatAssignments struct { + SeatsCreated int `json:"seats_created"` +} + +// SeatCancellations represents the number of seats cancelled. +type SeatCancellations struct { + SeatsCancelled int `json:"seats_cancelled"` +} + +func (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error { + // Using an alias to avoid infinite recursion when calling json.Unmarshal + type alias CopilotSeatDetails + var seatDetail alias + + if err := json.Unmarshal(data, &seatDetail); err != nil { + return err + } + + cp.AssigningTeam = seatDetail.AssigningTeam + cp.PendingCancellationDate = seatDetail.PendingCancellationDate + cp.LastActivityAt = seatDetail.LastActivityAt + cp.LastActivityEditor = seatDetail.LastActivityEditor + cp.CreatedAt = seatDetail.CreatedAt + cp.UpdatedAt = seatDetail.UpdatedAt + + switch v := seatDetail.Assignee.(type) { + case map[string]interface{}: + jsonData, err := json.Marshal(seatDetail.Assignee) + if err != nil { + return err + } + + if v["type"] == nil { + return fmt.Errorf("assignee type field is not set") + } + + if t, ok := v["type"].(string); ok && t == "User" { + user := &User{} + if err := json.Unmarshal(jsonData, user); err != nil { + return err + } + cp.Assignee = user + } else if t, ok := v["type"].(string); ok && t == "Team" { + team := &Team{} + if err := json.Unmarshal(jsonData, team); err != nil { + return err + } + cp.Assignee = team + } else if t, ok := v["type"].(string); ok && t == "Organization" { + organization := &Organization{} + if err := json.Unmarshal(jsonData, organization); err != nil { + return err + } + cp.Assignee = organization + } else { + return fmt.Errorf("unsupported assignee type %v", v["type"]) + } + default: + return fmt.Errorf("unsupported assignee type %T", v) + } + + return nil +} + +// GetUser gets the User from the CopilotSeatDetails if the assignee is a user. +func (cp *CopilotSeatDetails) GetUser() (*User, bool) { u, ok := cp.Assignee.(*User); return u, ok } + +// GetTeam gets the Team from the CopilotSeatDetails if the assignee is a team. +func (cp *CopilotSeatDetails) GetTeam() (*Team, bool) { t, ok := cp.Assignee.(*Team); return t, ok } + +// GetOrganization gets the Organization from the CopilotSeatDetails if the assignee is an organization. +func (cp *CopilotSeatDetails) GetOrganization() (*Organization, bool) { + o, ok := cp.Assignee.(*Organization) + return o, ok +} + +// GetCopilotBilling gets Copilot for Business billing information and settings for an organization. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-business#get-copilot-business-seat-information-and-settings-for-an-organization +// +//meta:operation GET /orgs/{org}/copilot/billing +func (s *CopilotService) GetCopilotBilling(ctx context.Context, org string) (*CopilotOrganizationDetails, *Response, error) { + u := fmt.Sprintf("orgs/%v/copilot/billing", org) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var copilotDetails *CopilotOrganizationDetails + resp, err := s.client.Do(ctx, req, &copilotDetails) + if err != nil { + return nil, resp, err + } + + return copilotDetails, resp, nil +} + +// ListCopilotSeats lists Copilot for Business seat assignments for an organization. +// +// To paginate through all seats, populate 'Page' with the number of the last page. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-business#list-all-copilot-business-seat-assignments-for-an-organization +// +//meta:operation GET /orgs/{org}/copilot/billing/seats +func (s *CopilotService) ListCopilotSeats(ctx context.Context, org string, opts *ListOptions) (*ListCopilotSeatsResponse, *Response, error) { + u := fmt.Sprintf("orgs/%v/copilot/billing/seats", org) + + req, err := s.client.NewRequest("GET", u, opts) + if err != nil { + return nil, nil, err + } + + var copilotSeats *ListCopilotSeatsResponse + resp, err := s.client.Do(ctx, req, &copilotSeats) + if err != nil { + return nil, resp, err + } + + return copilotSeats, resp, nil +} + +// AddCopilotTeams adds teams to the Copilot for Business subscription for an organization. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-business#add-teams-to-the-copilot-business-subscription-for-an-organization +// +//meta:operation POST /orgs/{org}/copilot/billing/selected_teams +func (s *CopilotService) AddCopilotTeams(ctx context.Context, org string, teamNames []string) (*SeatAssignments, *Response, error) { + u := fmt.Sprintf("orgs/%v/copilot/billing/selected_teams", org) + + body := struct { + SelectedTeams []string `json:"selected_teams"` + }{ + SelectedTeams: teamNames, + } + + req, err := s.client.NewRequest("POST", u, body) + if err != nil { + return nil, nil, err + } + + var seatAssignments *SeatAssignments + resp, err := s.client.Do(ctx, req, &seatAssignments) + if err != nil { + return nil, resp, err + } + + return seatAssignments, resp, nil +} + +// RemoveCopilotTeams removes teams from the Copilot for Business subscription for an organization. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-business#remove-teams-from-the-copilot-business-subscription-for-an-organization +// +//meta:operation DELETE /orgs/{org}/copilot/billing/selected_teams +func (s *CopilotService) RemoveCopilotTeams(ctx context.Context, org string, teamNames []string) (*SeatCancellations, *Response, error) { + u := fmt.Sprintf("orgs/%v/copilot/billing/selected_teams", org) + + body := struct { + SelectedTeams []string `json:"selected_teams"` + }{ + SelectedTeams: teamNames, + } + + req, err := s.client.NewRequest("DELETE", u, body) + if err != nil { + return nil, nil, err + } + + var seatCancellations *SeatCancellations + resp, err := s.client.Do(ctx, req, &seatCancellations) + if err != nil { + return nil, resp, err + } + + return seatCancellations, resp, nil +} + +// AddCopilotUsers adds users to the Copilot for Business subscription for an organization +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-business#add-users-to-the-copilot-business-subscription-for-an-organization +// +//meta:operation POST /orgs/{org}/copilot/billing/selected_users +func (s *CopilotService) AddCopilotUsers(ctx context.Context, org string, users []string) (*SeatAssignments, *Response, error) { + u := fmt.Sprintf("orgs/%v/copilot/billing/selected_users", org) + + body := struct { + SelectedUsers []string `json:"selected_users"` + }{ + SelectedUsers: users, + } + + req, err := s.client.NewRequest("POST", u, body) + if err != nil { + return nil, nil, err + } + + var seatAssignments *SeatAssignments + resp, err := s.client.Do(ctx, req, &seatAssignments) + if err != nil { + return nil, resp, err + } + + return seatAssignments, resp, nil +} + +// RemoveCopilotUsers removes users from the Copilot for Business subscription for an organization. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-business#remove-users-from-the-copilot-business-subscription-for-an-organization +// +//meta:operation DELETE /orgs/{org}/copilot/billing/selected_users +func (s *CopilotService) RemoveCopilotUsers(ctx context.Context, org string, users []string) (*SeatCancellations, *Response, error) { + u := fmt.Sprintf("orgs/%v/copilot/billing/selected_users", org) + + body := struct { + SelectedUsers []string `json:"selected_users"` + }{ + SelectedUsers: users, + } + + req, err := s.client.NewRequest("DELETE", u, body) + if err != nil { + return nil, nil, err + } + + var seatCancellations *SeatCancellations + resp, err := s.client.Do(ctx, req, &seatCancellations) + if err != nil { + return nil, resp, err + } + + return seatCancellations, resp, nil +} + +// GetSeatDetails gets Copilot for Business seat assignment details for a user. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-business#get-copilot-business-seat-assignment-details-for-a-user +// +//meta:operation GET /orgs/{org}/members/{username}/copilot +func (s *CopilotService) GetSeatDetails(ctx context.Context, org, user string) (*CopilotSeatDetails, *Response, error) { + u := fmt.Sprintf("orgs/%v/members/%v/copilot", org, user) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var seatDetails *CopilotSeatDetails + resp, err := s.client.Do(ctx, req, &seatDetails) + if err != nil { + return nil, resp, err + } + + return seatDetails, resp, nil +} diff --git a/github/copilot_test.go b/github/copilot_test.go new file mode 100644 index 00000000000..9df2c9a497d --- /dev/null +++ b/github/copilot_test.go @@ -0,0 +1,887 @@ +// Copyright 2023 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" + "time" + + "github.com/google/go-cmp/cmp" +) + +// Test invalid JSON responses, vlaid responses are covered in the other tests +func TestCopilotSeatDetails_UnmarshalJSON(t *testing.T) { + tests := []struct { + name string + data string + want *CopilotSeatDetails + wantErr bool + }{ + { + name: "Invalid JSON", + data: `{`, + want: &CopilotSeatDetails{ + Assignee: nil, + }, + wantErr: true, + }, + { + name: "Invalid top level type", + data: `{ + "assignee": { + "type": "User", + "name": "octokittens", + "id": 1 + }, + "assigning_team": "this should be an object" + }`, + want: &CopilotSeatDetails{}, + wantErr: true, + }, + { + name: "No Type Field", + data: `{ + "assignee": { + "name": "octokittens", + "id": 1 + } + }`, + want: &CopilotSeatDetails{}, + wantErr: true, + }, + { + name: "Invalid Assignee Field Type", + data: `{ + "assignee": "test" + }`, + want: &CopilotSeatDetails{}, + wantErr: true, + }, + { + name: "Invalid Assignee Type", + data: `{ + "assignee": { + "name": "octokittens", + "id": 1, + "type": [] + } + }`, + want: &CopilotSeatDetails{}, + wantErr: true, + }, + { + name: "Invalid User", + data: `{ + "assignee": { + "type": "User", + "id": "bad" + } + }`, + want: &CopilotSeatDetails{}, + wantErr: true, + }, + { + name: "Invalid Team", + data: `{ + "assignee": { + "type": "Team", + "id": "bad" + } + }`, + want: &CopilotSeatDetails{}, + wantErr: true, + }, + { + name: "Invalid Organization", + data: `{ + "assignee": { + "type": "Organization", + "id": "bad" + } + }`, + want: &CopilotSeatDetails{}, + wantErr: true, + }, + } + + for _, tc := range tests { + seatDetails := &CopilotSeatDetails{} + + t.Run(tc.name, func(t *testing.T) { + err := json.Unmarshal([]byte(tc.data), seatDetails) + if err == nil && tc.wantErr { + t.Errorf("CopilotSeatDetails.UnmarshalJSON returned nil instead of an error") + } + if err != nil && !tc.wantErr { + t.Errorf("CopilotSeatDetails.UnmarshalJSON returned an unexpected error: %v", err) + } + if !cmp.Equal(tc.want, seatDetails) { + t.Errorf("CopilotSeatDetails.UnmarshalJSON expected %+v, got %+v", tc.want, seatDetails) + } + }) + } +} + +func TestCopilotService_GetSeatDetailsUser(t *testing.T) { + data := `{ + "assignee": { + "type": "User", + "id": 1 + } + }` + + seatDetails := &CopilotSeatDetails{} + + err := json.Unmarshal([]byte(data), seatDetails) + if err != nil { + t.Errorf("CopilotSeatDetails.UnmarshalJSON returned an unexpected error: %v", err) + } + + want := &User{ + ID: Int64(1), + Type: String("User"), + } + + if got, ok := seatDetails.GetUser(); ok && !cmp.Equal(got, want) { + t.Errorf("CopilotSeatDetails.GetTeam returned %+v, want %+v", got, want) + } else if !ok { + t.Errorf("CopilotSeatDetails.GetUser returned false, expected true") + } + + data = `{ + "assignee": { + "type": "Organization", + "id": 1 + } + }` + + bad := &Organization{ + ID: Int64(1), + Type: String("Organization"), + } + + err = json.Unmarshal([]byte(data), seatDetails) + if err != nil { + t.Errorf("CopilotSeatDetails.UnmarshalJSON returned an unexpected error: %v", err) + } + + if got, ok := seatDetails.GetUser(); ok { + t.Errorf("CopilotSeatDetails.GetUser returned true, expected false. Returned %v, expected %v", got, bad) + } +} + +func TestCopilotService_GetSeatDetailsTeam(t *testing.T) { + data := `{ + "assignee": { + "type": "Team", + "id": 1 + } + }` + + seatDetails := &CopilotSeatDetails{} + + err := json.Unmarshal([]byte(data), seatDetails) + if err != nil { + t.Errorf("CopilotSeatDetails.UnmarshalJSON returned an unexpected error: %v", err) + } + + want := &Team{ + ID: Int64(1), + } + + if got, ok := seatDetails.GetTeam(); ok && !cmp.Equal(got, want) { + t.Errorf("CopilotSeatDetails.GetTeam returned %+v, want %+v", got, want) + } else if !ok { + t.Errorf("CopilotSeatDetails.GetTeam returned false, expected true") + } + + data = `{ + "assignee": { + "type": "User", + "id": 1 + } + }` + + bad := &User{ + ID: Int64(1), + Type: String("User"), + } + + err = json.Unmarshal([]byte(data), seatDetails) + if err != nil { + t.Errorf("CopilotSeatDetails.UnmarshalJSON returned an unexpected error: %v", err) + } + + if got, ok := seatDetails.GetTeam(); ok { + t.Errorf("CopilotSeatDetails.GetTeam returned true, expected false. Returned %v, expected %v", got, bad) + } +} + +func TestCopilotService_GetSeatDetailsOrganization(t *testing.T) { + data := `{ + "assignee": { + "type": "Organization", + "id": 1 + } + }` + + seatDetails := &CopilotSeatDetails{} + + err := json.Unmarshal([]byte(data), seatDetails) + if err != nil { + t.Errorf("CopilotSeatDetails.UnmarshalJSON returned an unexpected error: %v", err) + } + + want := &Organization{ + ID: Int64(1), + Type: String("Organization"), + } + + if got, ok := seatDetails.GetOrganization(); ok && !cmp.Equal(got, want) { + t.Errorf("CopilotSeatDetails.GetOrganization returned %+v, want %+v", got, want) + } else if !ok { + t.Errorf("CopilotSeatDetails.GetOrganization returned false, expected true") + } + + data = `{ + "assignee": { + "type": "Team", + "id": 1 + } + }` + + bad := &Team{ + ID: Int64(1), + } + + err = json.Unmarshal([]byte(data), seatDetails) + if err != nil { + t.Errorf("CopilotSeatDetails.UnmarshalJSON returned an unexpected error: %v", err) + } + + if got, ok := seatDetails.GetOrganization(); ok { + t.Errorf("CopilotSeatDetails.GetOrganization returned true, expected false. Returned %v, expected %v", got, bad) + } +} + +func TestCopilotService_GetCopilotBilling(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/copilot/billing", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "seat_breakdown": { + "total": 12, + "added_this_cycle": 9, + "pending_invitation": 0, + "pending_cancellation": 0, + "active_this_cycle": 12, + "inactive_this_cycle": 11 + }, + "seat_management_setting": "assign_selected", + "public_code_suggestions": "block" + }`) + }) + + ctx := context.Background() + got, _, err := client.Copilot.GetCopilotBilling(ctx, "o") + if err != nil { + t.Errorf("Copilot.GetCopilotBilling returned error: %v", err) + } + + want := &CopilotOrganizationDetails{ + SeatBreakdown: &CopilotSeatBreakdown{ + Total: 12, + AddedThisCycle: 9, + PendingInvitation: 0, + PendingCancellation: 0, + ActiveThisCycle: 12, + InactiveThisCycle: 11, + }, + PublicCodeSuggestions: "block", + CopilotChat: "", + SeatManagementSetting: "assign_selected", + } + if !cmp.Equal(got, want) { + t.Errorf("Copilot.GetCopilotBilling returned %+v, want %+v", got, want) + } + + const methodName = "GetCopilotBilling" + + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Copilot.GetCopilotBilling(ctx, "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Copilot.GetCopilotBilling(ctx, "o") + if got != nil { + t.Errorf("Copilot.GetCopilotBilling returned %+v, want nil", got) + } + return resp, err + }) +} + +func TestCopilotService_ListCopilotSeats(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/copilot/billing/seats", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "total_seats": 4, + "seats": [ + { + "created_at": "2021-08-03T18:00:00-06:00", + "updated_at": "2021-09-23T15:00:00-06:00", + "pending_cancellation_date": null, + "last_activity_at": "2021-10-14T00:53:32-06:00", + "last_activity_editor": "vscode/1.77.3/copilot/1.86.82", + "assignee": { + "login": "octocat", + "id": 1, + "node_id": "MDQ6VXNlcjE=", + "avatar_url": "https://github.com/images/error/octocat_happy.gif", + "gravatar_id": "", + "url": "https://api.github.com/users/octocat", + "html_url": "https://github.com/octocat", + "followers_url": "https://api.github.com/users/octocat/followers", + "following_url": "https://api.github.com/users/octocat/following{/other_user}", + "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", + "organizations_url": "https://api.github.com/users/octocat/orgs", + "repos_url": "https://api.github.com/users/octocat/repos", + "events_url": "https://api.github.com/users/octocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/octocat/received_events", + "type": "User", + "site_admin": false + }, + "assigning_team": { + "id": 1, + "node_id": "MDQ6VGVhbTE=", + "url": "https://api.github.com/teams/1", + "html_url": "https://github.com/orgs/github/teams/justice-league", + "name": "Justice League", + "slug": "justice-league", + "description": "A great team.", + "privacy": "closed", + "notification_setting": "notifications_enabled", + "permission": "admin", + "members_url": "https://api.github.com/teams/1/members{/member}", + "repositories_url": "https://api.github.com/teams/1/repos", + "parent": null + } + }, + { + "created_at": "2021-09-23T18:00:00-06:00", + "updated_at": "2021-09-23T15:00:00-06:00", + "pending_cancellation_date": "2021-11-01", + "last_activity_at": "2021-10-13T00:53:32-06:00", + "last_activity_editor": "vscode/1.77.3/copilot/1.86.82", + "assignee": { + "login": "octokitten", + "id": 1, + "node_id": "MDQ76VNlcjE=", + "avatar_url": "https://github.com/images/error/octokitten_happy.gif", + "gravatar_id": "", + "url": "https://api.github.com/users/octokitten", + "html_url": "https://github.com/octokitten", + "followers_url": "https://api.github.com/users/octokitten/followers", + "following_url": "https://api.github.com/users/octokitten/following{/other_user}", + "gists_url": "https://api.github.com/users/octokitten/gists{/gist_id}", + "starred_url": "https://api.github.com/users/octokitten/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/octokitten/subscriptions", + "organizations_url": "https://api.github.com/users/octokitten/orgs", + "repos_url": "https://api.github.com/users/octokitten/repos", + "events_url": "https://api.github.com/users/octokitten/events{/privacy}", + "received_events_url": "https://api.github.com/users/octokitten/received_events", + "type": "User", + "site_admin": false + } + }, + { + "created_at": "2021-09-23T18:00:00-06:00", + "updated_at": "2021-09-23T15:00:00-06:00", + "pending_cancellation_date": "2021-11-01", + "last_activity_at": "2021-10-13T00:53:32-06:00", + "last_activity_editor": "vscode/1.77.3/copilot/1.86.82", + "assignee": { + "name": "octokittens", + "id": 1, + "type": "Team" + } + }, + { + "created_at": "2021-09-23T18:00:00-06:00", + "updated_at": "2021-09-23T15:00:00-06:00", + "pending_cancellation_date": "2021-11-01", + "last_activity_at": "2021-10-13T00:53:32-06:00", + "last_activity_editor": "vscode/1.77.3/copilot/1.86.82", + "assignee": { + "name": "octocats", + "id": 1, + "type": "Organization" + } + } + ] + }`) + }) + + tmp, err := time.Parse(time.RFC3339, "2021-08-03T18:00:00-06:00") + if err != nil { + panic(err) + } + createdAt1 := Timestamp{tmp} + + tmp, err = time.Parse(time.RFC3339, "2021-09-23T15:00:00-06:00") + if err != nil { + panic(err) + } + updatedAt1 := Timestamp{tmp} + + tmp, err = time.Parse(time.RFC3339, "2021-10-14T00:53:32-06:00") + if err != nil { + panic(err) + } + lastActivityAt1 := Timestamp{tmp} + + tmp, err = time.Parse(time.RFC3339, "2021-09-23T18:00:00-06:00") + if err != nil { + panic(err) + } + createdAt2 := Timestamp{tmp} + + tmp, err = time.Parse(time.RFC3339, "2021-09-23T15:00:00-06:00") + if err != nil { + panic(err) + } + updatedAt2 := Timestamp{tmp} + + tmp, err = time.Parse(time.RFC3339, "2021-10-13T00:53:32-06:00") + if err != nil { + panic(err) + } + lastActivityAt2 := Timestamp{tmp} + + ctx := context.Background() + got, _, err := client.Copilot.ListCopilotSeats(ctx, "o", nil) + if err != nil { + t.Errorf("Copilot.ListCopilotSeats returned error: %v", err) + } + + want := &ListCopilotSeatsResponse{ + TotalSeats: 4, + Seats: []*CopilotSeatDetails{ + { + Assignee: &User{ + Login: String("octocat"), + ID: Int64(1), + NodeID: String("MDQ6VXNlcjE="), + AvatarURL: String("https://github.com/images/error/octocat_happy.gif"), + GravatarID: String(""), + URL: String("https://api.github.com/users/octocat"), + HTMLURL: String("https://github.com/octocat"), + FollowersURL: String("https://api.github.com/users/octocat/followers"), + FollowingURL: String("https://api.github.com/users/octocat/following{/other_user}"), + GistsURL: String("https://api.github.com/users/octocat/gists{/gist_id}"), + StarredURL: String("https://api.github.com/users/octocat/starred{/owner}{/repo}"), + SubscriptionsURL: String("https://api.github.com/users/octocat/subscriptions"), + OrganizationsURL: String("https://api.github.com/users/octocat/orgs"), + ReposURL: String("https://api.github.com/users/octocat/repos"), + EventsURL: String("https://api.github.com/users/octocat/events{/privacy}"), + ReceivedEventsURL: String("https://api.github.com/users/octocat/received_events"), + Type: String("User"), + SiteAdmin: Bool(false), + }, + AssigningTeam: &Team{ + ID: Int64(1), + NodeID: String("MDQ6VGVhbTE="), + URL: String("https://api.github.com/teams/1"), + HTMLURL: String("https://github.com/orgs/github/teams/justice-league"), + Name: String("Justice League"), + Slug: String("justice-league"), + Description: String("A great team."), + Privacy: String("closed"), + Permission: String("admin"), + MembersURL: String("https://api.github.com/teams/1/members{/member}"), + RepositoriesURL: String("https://api.github.com/teams/1/repos"), + Parent: nil, + }, + CreatedAt: &createdAt1, + UpdatedAt: &updatedAt1, + PendingCancellationDate: nil, + LastActivityAt: &lastActivityAt1, + LastActivityEditor: String("vscode/1.77.3/copilot/1.86.82"), + }, + { + Assignee: &User{ + Login: String("octokitten"), + ID: Int64(1), + NodeID: String("MDQ76VNlcjE="), + AvatarURL: String("https://github.com/images/error/octokitten_happy.gif"), + GravatarID: String(""), + URL: String("https://api.github.com/users/octokitten"), + HTMLURL: String("https://github.com/octokitten"), + FollowersURL: String("https://api.github.com/users/octokitten/followers"), + FollowingURL: String("https://api.github.com/users/octokitten/following{/other_user}"), + GistsURL: String("https://api.github.com/users/octokitten/gists{/gist_id}"), + StarredURL: String("https://api.github.com/users/octokitten/starred{/owner}{/repo}"), + SubscriptionsURL: String("https://api.github.com/users/octokitten/subscriptions"), + OrganizationsURL: String("https://api.github.com/users/octokitten/orgs"), + ReposURL: String("https://api.github.com/users/octokitten/repos"), + EventsURL: String("https://api.github.com/users/octokitten/events{/privacy}"), + ReceivedEventsURL: String("https://api.github.com/users/octokitten/received_events"), + Type: String("User"), + SiteAdmin: Bool(false), + }, + AssigningTeam: nil, + CreatedAt: &createdAt2, + UpdatedAt: &updatedAt2, + PendingCancellationDate: String("2021-11-01"), + LastActivityAt: &lastActivityAt2, + LastActivityEditor: String("vscode/1.77.3/copilot/1.86.82"), + }, + { + Assignee: &Team{ + ID: Int64(1), + Name: String("octokittens"), + }, + AssigningTeam: nil, + CreatedAt: &createdAt2, + UpdatedAt: &updatedAt2, + PendingCancellationDate: String("2021-11-01"), + LastActivityAt: &lastActivityAt2, + LastActivityEditor: String("vscode/1.77.3/copilot/1.86.82"), + }, + { + Assignee: &Organization{ + ID: Int64(1), + Name: String("octocats"), + Type: String("Organization"), + }, + AssigningTeam: nil, + CreatedAt: &createdAt2, + UpdatedAt: &updatedAt2, + PendingCancellationDate: String("2021-11-01"), + LastActivityAt: &lastActivityAt2, + LastActivityEditor: String("vscode/1.77.3/copilot/1.86.82"), + }, + }, + } + + if !cmp.Equal(got, want) { + t.Errorf("Copilot.ListCopilotSeats returned %+v, want %+v", got, want) + } + + const methodName = "ListCopilotSeats" + + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Copilot.ListCopilotSeats(ctx, "\n", nil) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Copilot.ListCopilotSeats(ctx, "", nil) + if got != nil { + t.Errorf("Copilot.ListCopilotSeats returned %+v, want nil", got) + } + return resp, err + }) +} + +func TestCopilotService_AddCopilotTeams(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/copilot/billing/selected_teams", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + testBody(t, r, `{"selected_teams":["team1","team2"]}`+"\n") + fmt.Fprint(w, `{"seats_created": 2}`) + }) + + ctx := context.Background() + got, _, err := client.Copilot.AddCopilotTeams(ctx, "o", []string{"team1", "team2"}) + if err != nil { + t.Errorf("Copilot.AddCopilotTeams returned error: %v", err) + } + + want := &SeatAssignments{SeatsCreated: 2} + + if !cmp.Equal(got, want) { + t.Errorf("Copilot.AddCopilotTeams returned %+v, want %+v", got, want) + } + + const methodName = "AddCopilotTeams" + + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Copilot.AddCopilotTeams(ctx, "\n", []string{"team1", "team2"}) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Copilot.AddCopilotTeams(ctx, "o", []string{"team1", "team2"}) + if got != nil { + t.Errorf("Copilot.AddCopilotTeams returned %+v, want nil", got) + } + return resp, err + }) +} + +func TestCopilotService_RemoveCopilotTeams(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/copilot/billing/selected_teams", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + testBody(t, r, `{"selected_teams":["team1","team2"]}`+"\n") + fmt.Fprint(w, `{"seats_cancelled": 2}`) + }) + + ctx := context.Background() + got, _, err := client.Copilot.RemoveCopilotTeams(ctx, "o", []string{"team1", "team2"}) + if err != nil { + t.Errorf("Copilot.RemoveCopilotTeams returned error: %v", err) + } + + want := &SeatCancellations{SeatsCancelled: 2} + + if !cmp.Equal(got, want) { + t.Errorf("Copilot.RemoveCopilotTeams returned %+v, want %+v", got, want) + } + + const methodName = "RemoveCopilotTeams" + + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Copilot.RemoveCopilotTeams(ctx, "\n", []string{"team1", "team2"}) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Copilot.RemoveCopilotTeams(ctx, "o", []string{"team1", "team2"}) + if got != nil { + t.Errorf("Copilot.RemoveCopilotTeams returned %+v, want nil", got) + } + return resp, err + }) +} + +func TestCopilotService_AddCopilotUsers(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/copilot/billing/selected_users", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + testBody(t, r, `{"selected_users":["user1","user2"]}`+"\n") + fmt.Fprint(w, `{"seats_created": 2}`) + }) + + ctx := context.Background() + got, _, err := client.Copilot.AddCopilotUsers(ctx, "o", []string{"user1", "user2"}) + if err != nil { + t.Errorf("Copilot.AddCopilotUsers returned error: %v", err) + } + + want := &SeatAssignments{SeatsCreated: 2} + + if !cmp.Equal(got, want) { + t.Errorf("Copilot.AddCopilotUsers returned %+v, want %+v", got, want) + } + + const methodName = "AddCopilotUsers" + + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Copilot.AddCopilotUsers(ctx, "\n", []string{"user1", "user2"}) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Copilot.AddCopilotUsers(ctx, "o", []string{"user1", "user2"}) + if got != nil { + t.Errorf("Copilot.AddCopilotUsers returned %+v, want nil", got) + } + return resp, err + }) +} + +func TestCopilotService_RemoveCopilotUsers(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/copilot/billing/selected_users", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + testBody(t, r, `{"selected_users":["user1","user2"]}`+"\n") + fmt.Fprint(w, `{"seats_cancelled": 2}`) + }) + + ctx := context.Background() + got, _, err := client.Copilot.RemoveCopilotUsers(ctx, "o", []string{"user1", "user2"}) + if err != nil { + t.Errorf("Copilot.RemoveCopilotUsers returned error: %v", err) + } + + want := &SeatCancellations{SeatsCancelled: 2} + + if !cmp.Equal(got, want) { + t.Errorf("Copilot.RemoveCopilotUsers returned %+v, want %+v", got, want) + } + + const methodName = "RemoveCopilotUsers" + + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Copilot.RemoveCopilotUsers(ctx, "\n", []string{"user1", "user2"}) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Copilot.RemoveCopilotUsers(ctx, "o", []string{"user1", "user2"}) + if got != nil { + t.Errorf("Copilot.RemoveCopilotUsers returned %+v, want nil", got) + } + return resp, err + }) +} + +func TestCopilotService_GetSeatDetails(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/members/u/copilot", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "created_at": "2021-08-03T18:00:00-06:00", + "updated_at": "2021-09-23T15:00:00-06:00", + "pending_cancellation_date": null, + "last_activity_at": "2021-10-14T00:53:32-06:00", + "last_activity_editor": "vscode/1.77.3/copilot/1.86.82", + "assignee": { + "login": "octocat", + "id": 1, + "node_id": "MDQ6VXNlcjE=", + "avatar_url": "https://github.com/images/error/octocat_happy.gif", + "gravatar_id": "", + "url": "https://api.github.com/users/octocat", + "html_url": "https://github.com/octocat", + "followers_url": "https://api.github.com/users/octocat/followers", + "following_url": "https://api.github.com/users/octocat/following{/other_user}", + "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", + "organizations_url": "https://api.github.com/users/octocat/orgs", + "repos_url": "https://api.github.com/users/octocat/repos", + "events_url": "https://api.github.com/users/octocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/octocat/received_events", + "type": "User", + "site_admin": false + }, + "assigning_team": { + "id": 1, + "node_id": "MDQ6VGVhbTE=", + "url": "https://api.github.com/teams/1", + "html_url": "https://github.com/orgs/github/teams/justice-league", + "name": "Justice League", + "slug": "justice-league", + "description": "A great team.", + "privacy": "closed", + "notification_setting": "notifications_enabled", + "permission": "admin", + "members_url": "https://api.github.com/teams/1/members{/member}", + "repositories_url": "https://api.github.com/teams/1/repos", + "parent": null + } + }`) + }) + + tmp, err := time.Parse(time.RFC3339, "2021-08-03T18:00:00-06:00") + if err != nil { + panic(err) + } + createdAt := Timestamp{tmp} + + tmp, err = time.Parse(time.RFC3339, "2021-09-23T15:00:00-06:00") + if err != nil { + panic(err) + } + updatedAt := Timestamp{tmp} + + tmp, err = time.Parse(time.RFC3339, "2021-10-14T00:53:32-06:00") + if err != nil { + panic(err) + } + lastActivityAt := Timestamp{tmp} + + ctx := context.Background() + got, _, err := client.Copilot.GetSeatDetails(ctx, "o", "u") + if err != nil { + t.Errorf("Copilot.GetSeatDetails returned error: %v", err) + } + + want := &CopilotSeatDetails{ + Assignee: &User{ + Login: String("octocat"), + ID: Int64(1), + NodeID: String("MDQ6VXNlcjE="), + AvatarURL: String("https://github.com/images/error/octocat_happy.gif"), + GravatarID: String(""), + URL: String("https://api.github.com/users/octocat"), + HTMLURL: String("https://github.com/octocat"), + FollowersURL: String("https://api.github.com/users/octocat/followers"), + FollowingURL: String("https://api.github.com/users/octocat/following{/other_user}"), + GistsURL: String("https://api.github.com/users/octocat/gists{/gist_id}"), + StarredURL: String("https://api.github.com/users/octocat/starred{/owner}{/repo}"), + SubscriptionsURL: String("https://api.github.com/users/octocat/subscriptions"), + OrganizationsURL: String("https://api.github.com/users/octocat/orgs"), + ReposURL: String("https://api.github.com/users/octocat/repos"), + EventsURL: String("https://api.github.com/users/octocat/events{/privacy}"), + ReceivedEventsURL: String("https://api.github.com/users/octocat/received_events"), + Type: String("User"), + SiteAdmin: Bool(false), + }, + AssigningTeam: &Team{ + ID: Int64(1), + NodeID: String("MDQ6VGVhbTE="), + URL: String("https://api.github.com/teams/1"), + HTMLURL: String("https://github.com/orgs/github/teams/justice-league"), + Name: String("Justice League"), + Slug: String("justice-league"), + Description: String("A great team."), + Privacy: String("closed"), + Permission: String("admin"), + MembersURL: String("https://api.github.com/teams/1/members{/member}"), + RepositoriesURL: String("https://api.github.com/teams/1/repos"), + Parent: nil, + }, + CreatedAt: &createdAt, + UpdatedAt: &updatedAt, + PendingCancellationDate: nil, + LastActivityAt: &lastActivityAt, + LastActivityEditor: String("vscode/1.77.3/copilot/1.86.82"), + } + + if !cmp.Equal(got, want) { + t.Errorf("Copilot.GetSeatDetails returned %+v, want %+v", got, want) + } + + const methodName = "GetSeatDetails" + + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Copilot.GetSeatDetails(ctx, "\n", "u") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Copilot.GetSeatDetails(ctx, "o", "u") + if got != nil { + t.Errorf("Copilot.GetSeatDetails returned %+v, want nil", got) + } + return resp, err + }) +} diff --git a/github/github-accessors.go b/github/github-accessors.go index f41409f9e6c..3f24a795e5c 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -4014,6 +4014,62 @@ func (c *ContributorStats) GetTotal() int { return *c.Total } +// GetSeatBreakdown returns the SeatBreakdown field. +func (c *CopilotOrganizationDetails) GetSeatBreakdown() *CopilotSeatBreakdown { + if c == nil { + return nil + } + return c.SeatBreakdown +} + +// GetAssigningTeam returns the AssigningTeam field. +func (c *CopilotSeatDetails) GetAssigningTeam() *Team { + if c == nil { + return nil + } + return c.AssigningTeam +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (c *CopilotSeatDetails) GetCreatedAt() Timestamp { + if c == nil || c.CreatedAt == nil { + return Timestamp{} + } + return *c.CreatedAt +} + +// GetLastActivityAt returns the LastActivityAt field if it's non-nil, zero value otherwise. +func (c *CopilotSeatDetails) GetLastActivityAt() Timestamp { + if c == nil || c.LastActivityAt == nil { + return Timestamp{} + } + return *c.LastActivityAt +} + +// GetLastActivityEditor returns the LastActivityEditor field if it's non-nil, zero value otherwise. +func (c *CopilotSeatDetails) GetLastActivityEditor() string { + if c == nil || c.LastActivityEditor == nil { + return "" + } + return *c.LastActivityEditor +} + +// GetPendingCancellationDate returns the PendingCancellationDate field if it's non-nil, zero value otherwise. +func (c *CopilotSeatDetails) GetPendingCancellationDate() string { + if c == nil || c.PendingCancellationDate == nil { + return "" + } + return *c.PendingCancellationDate +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (c *CopilotSeatDetails) GetUpdatedAt() Timestamp { + if c == nil || c.UpdatedAt == nil { + return Timestamp{} + } + return *c.UpdatedAt +} + // GetCompletedAt returns the CompletedAt field if it's non-nil, zero value otherwise. func (c *CreateCheckRunOptions) GetCompletedAt() Timestamp { if c == nil || c.CompletedAt == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 5b0b9911bdb..e575fea2526 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -4709,6 +4709,70 @@ func TestContributorStats_GetTotal(tt *testing.T) { c.GetTotal() } +func TestCopilotOrganizationDetails_GetSeatBreakdown(tt *testing.T) { + c := &CopilotOrganizationDetails{} + c.GetSeatBreakdown() + c = nil + c.GetSeatBreakdown() +} + +func TestCopilotSeatDetails_GetAssigningTeam(tt *testing.T) { + c := &CopilotSeatDetails{} + c.GetAssigningTeam() + c = nil + c.GetAssigningTeam() +} + +func TestCopilotSeatDetails_GetCreatedAt(tt *testing.T) { + var zeroValue Timestamp + c := &CopilotSeatDetails{CreatedAt: &zeroValue} + c.GetCreatedAt() + c = &CopilotSeatDetails{} + c.GetCreatedAt() + c = nil + c.GetCreatedAt() +} + +func TestCopilotSeatDetails_GetLastActivityAt(tt *testing.T) { + var zeroValue Timestamp + c := &CopilotSeatDetails{LastActivityAt: &zeroValue} + c.GetLastActivityAt() + c = &CopilotSeatDetails{} + c.GetLastActivityAt() + c = nil + c.GetLastActivityAt() +} + +func TestCopilotSeatDetails_GetLastActivityEditor(tt *testing.T) { + var zeroValue string + c := &CopilotSeatDetails{LastActivityEditor: &zeroValue} + c.GetLastActivityEditor() + c = &CopilotSeatDetails{} + c.GetLastActivityEditor() + c = nil + c.GetLastActivityEditor() +} + +func TestCopilotSeatDetails_GetPendingCancellationDate(tt *testing.T) { + var zeroValue string + c := &CopilotSeatDetails{PendingCancellationDate: &zeroValue} + c.GetPendingCancellationDate() + c = &CopilotSeatDetails{} + c.GetPendingCancellationDate() + c = nil + c.GetPendingCancellationDate() +} + +func TestCopilotSeatDetails_GetUpdatedAt(tt *testing.T) { + var zeroValue Timestamp + c := &CopilotSeatDetails{UpdatedAt: &zeroValue} + c.GetUpdatedAt() + c = &CopilotSeatDetails{} + c.GetUpdatedAt() + c = nil + c.GetUpdatedAt() +} + func TestCreateCheckRunOptions_GetCompletedAt(tt *testing.T) { var zeroValue Timestamp c := &CreateCheckRunOptions{CompletedAt: &zeroValue} diff --git a/github/github.go b/github/github.go index da4f2d067ee..0b00655243e 100644 --- a/github/github.go +++ b/github/github.go @@ -186,6 +186,7 @@ type Client struct { CodeScanning *CodeScanningService CodesOfConduct *CodesOfConductService Codespaces *CodespacesService + Copilot *CopilotService Dependabot *DependabotService DependencyGraph *DependencyGraphService Emojis *EmojisService @@ -414,6 +415,7 @@ func (c *Client) initialize() { c.CodeScanning = (*CodeScanningService)(&c.common) c.Codespaces = (*CodespacesService)(&c.common) c.CodesOfConduct = (*CodesOfConductService)(&c.common) + c.Copilot = (*CopilotService)(&c.common) c.Dependabot = (*DependabotService)(&c.common) c.DependencyGraph = (*DependencyGraphService)(&c.common) c.Emojis = (*EmojisService)(&c.common) From a6f50f1b02b66fb31671a4ecc5ab75d07dc791ed Mon Sep 17 00:00:00 2001 From: Jesse Haka Date: Tue, 19 Dec 2023 22:30:31 +0200 Subject: [PATCH 372/751] Fix copilot API payload (#3034) --- github/copilot.go | 8 ++++---- github/copilot_test.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/github/copilot.go b/github/copilot.go index 3f3d73b25bc..51c938c9748 100644 --- a/github/copilot.go +++ b/github/copilot.go @@ -241,9 +241,9 @@ func (s *CopilotService) AddCopilotUsers(ctx context.Context, org string, users u := fmt.Sprintf("orgs/%v/copilot/billing/selected_users", org) body := struct { - SelectedUsers []string `json:"selected_users"` + SelectedUsernames []string `json:"selected_usernames"` }{ - SelectedUsers: users, + SelectedUsernames: users, } req, err := s.client.NewRequest("POST", u, body) @@ -269,9 +269,9 @@ func (s *CopilotService) RemoveCopilotUsers(ctx context.Context, org string, use u := fmt.Sprintf("orgs/%v/copilot/billing/selected_users", org) body := struct { - SelectedUsers []string `json:"selected_users"` + SelectedUsernames []string `json:"selected_usernames"` }{ - SelectedUsers: users, + SelectedUsernames: users, } req, err := s.client.NewRequest("DELETE", u, body) diff --git a/github/copilot_test.go b/github/copilot_test.go index 9df2c9a497d..c65fda0f217 100644 --- a/github/copilot_test.go +++ b/github/copilot_test.go @@ -680,7 +680,7 @@ func TestCopilotService_AddCopilotUsers(t *testing.T) { mux.HandleFunc("/orgs/o/copilot/billing/selected_users", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") - testBody(t, r, `{"selected_users":["user1","user2"]}`+"\n") + testBody(t, r, `{"selected_usernames":["user1","user2"]}`+"\n") fmt.Fprint(w, `{"seats_created": 2}`) }) @@ -718,7 +718,7 @@ func TestCopilotService_RemoveCopilotUsers(t *testing.T) { mux.HandleFunc("/orgs/o/copilot/billing/selected_users", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") - testBody(t, r, `{"selected_users":["user1","user2"]}`+"\n") + testBody(t, r, `{"selected_usernames":["user1","user2"]}`+"\n") fmt.Fprint(w, `{"seats_cancelled": 2}`) }) From 2d0bd43a44220ae01f2ea3d179fab16cf57845c2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Dec 2023 19:27:30 -0500 Subject: [PATCH 373/751] Bump golang.org/x/crypto from 0.14.0 to 0.17.0 in /example (#3033) --- example/go.mod | 6 +++--- example/go.sum | 16 +++++++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/example/go.mod b/example/go.mod index a2bfe50f63d..efda4229223 100644 --- a/example/go.mod +++ b/example/go.mod @@ -7,8 +7,8 @@ require ( github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-ratelimit v1.0.3 github.com/google/go-github/v57 v57.0.0 - golang.org/x/crypto v0.14.0 - golang.org/x/term v0.13.0 + golang.org/x/crypto v0.17.0 + golang.org/x/term v0.15.0 google.golang.org/appengine v1.6.7 ) @@ -19,7 +19,7 @@ require ( github.com/google/go-github/v41 v41.0.0 // indirect github.com/google/go-querystring v1.1.0 // indirect golang.org/x/net v0.17.0 // indirect - golang.org/x/sys v0.13.0 // indirect + golang.org/x/sys v0.15.0 // indirect google.golang.org/protobuf v1.28.0 // indirect ) diff --git a/example/go.sum b/example/go.sum index be6272956d8..567182ec3d7 100644 --- a/example/go.sum +++ b/example/go.sum @@ -18,6 +18,7 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github/v41 v41.0.0 h1:HseJrM2JFf2vfiZJ8anY2hqBjdfY1Vlj/K27ueww4gg= github.com/google/go-github/v41 v41.0.0/go.mod h1:XgmCA5H323A9rtgExdTcnDkcqp6S30AVACCBDOonIxg= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= @@ -28,8 +29,9 @@ golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= @@ -39,6 +41,7 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -54,15 +57,19 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= +golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= +golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -70,6 +77,9 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= From a7c8db8ddbc65e8b03516abec383988b0a9ba87d Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Tue, 19 Dec 2023 19:35:37 -0500 Subject: [PATCH 374/751] Fix example/go.sum (#3035) --- example/go.sum | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/example/go.sum b/example/go.sum index 567182ec3d7..4679434efea 100644 --- a/example/go.sum +++ b/example/go.sum @@ -18,7 +18,6 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github/v41 v41.0.0 h1:HseJrM2JFf2vfiZJ8anY2hqBjdfY1Vlj/K27ueww4gg= github.com/google/go-github/v41 v41.0.0/go.mod h1:XgmCA5H323A9rtgExdTcnDkcqp6S30AVACCBDOonIxg= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= @@ -29,7 +28,6 @@ golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= @@ -41,7 +39,6 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -57,8 +54,6 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -66,8 +61,6 @@ golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuX golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -77,9 +70,6 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= From 3bb05c23365b24a9a99d692e39c5fde50b88be69 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Dec 2023 20:09:28 -0500 Subject: [PATCH 375/751] Bump github.com/getkin/kin-openapi from 0.120.0 to 0.122.0 in /tools (#3015) --- tools/go.mod | 2 +- tools/go.sum | 4 ++-- tools/metadata/main_test.go | 35 +++++++++++++++-------------------- tools/metadata/openapi.go | 2 +- 4 files changed, 19 insertions(+), 24 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index 25cef1fd110..ce710420ec3 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/alecthomas/kong v0.8.1 - github.com/getkin/kin-openapi v0.120.0 + github.com/getkin/kin-openapi v0.122.0 github.com/google/go-cmp v0.6.0 github.com/google/go-github/v57 v57.0.0 golang.org/x/sync v0.5.0 diff --git a/tools/go.sum b/tools/go.sum index 099ce0450dd..29b5dfebe54 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -6,8 +6,8 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/getkin/kin-openapi v0.120.0 h1:MqJcNJFrMDFNc07iwE8iFC5eT2k/NPUFDIpNeiZv8Jg= -github.com/getkin/kin-openapi v0.120.0/go.mod h1:PCWw/lfBrJY4HcdqE3jj+QFkaFK8ABoqo7PvqVhXXqw= +github.com/getkin/kin-openapi v0.122.0 h1:WB9Jbl0Hp/T79/JF9xlSW5Kl9uYdk/AWD0yAd9HOM10= +github.com/getkin/kin-openapi v0.122.0/go.mod h1:PCWw/lfBrJY4HcdqE3jj+QFkaFK8ABoqo7PvqVhXXqw= github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= diff --git a/tools/metadata/main_test.go b/tools/metadata/main_test.go index 17de07d79a0..a00c11ba090 100644 --- a/tools/metadata/main_test.go +++ b/tools/metadata/main_test.go @@ -66,59 +66,54 @@ GET /undocumented/{undocumented_id} func TestUpdateOpenAPI(t *testing.T) { testServer := newTestServer(t, "main", map[string]interface{}{ "api.github.com/api.github.com.json": openapi3.T{ - Paths: openapi3.Paths{ - "/a/{a_id}": &openapi3.PathItem{ + Paths: openapi3.NewPaths( + openapi3.WithPath("/a/{a_id}", &openapi3.PathItem{ Get: &openapi3.Operation{ ExternalDocs: &openapi3.ExternalDocs{ URL: "https://docs.github.com/rest/reference/a", }, }, - }, - }, + })), }, "ghec/ghec.json": openapi3.T{ - Paths: openapi3.Paths{ - "/a/b/{a_id}": &openapi3.PathItem{ + Paths: openapi3.NewPaths( + openapi3.WithPath("/a/b/{a_id}", &openapi3.PathItem{ Get: &openapi3.Operation{ ExternalDocs: &openapi3.ExternalDocs{ URL: "https://docs.github.com/rest/reference/a", }, }, - }, - }, + })), }, "ghes-3.9/ghes-3.9.json": openapi3.T{ - Paths: openapi3.Paths{ - "/a/b/{a_id}": &openapi3.PathItem{ + Paths: openapi3.NewPaths( + openapi3.WithPath("/a/b/{a_id}", &openapi3.PathItem{ Get: &openapi3.Operation{ ExternalDocs: &openapi3.ExternalDocs{ URL: "https://docs.github.com/rest/reference/a", }, }, - }, - }, + })), }, "ghes-3.10/ghes-3.10.json": openapi3.T{ - Paths: openapi3.Paths{ - "/a/b/{a_id}": &openapi3.PathItem{ + Paths: openapi3.NewPaths( + openapi3.WithPath("/a/b/{a_id}", &openapi3.PathItem{ Get: &openapi3.Operation{ ExternalDocs: &openapi3.ExternalDocs{ URL: "https://docs.github.com/rest/reference/a", }, }, - }, - }, + })), }, "ghes-2.22/ghes-2.22.json": openapi3.T{ - Paths: openapi3.Paths{ - "/a/b/{a_id}": &openapi3.PathItem{ + Paths: openapi3.NewPaths( + openapi3.WithPath("/a/b/{a_id}", &openapi3.PathItem{ Get: &openapi3.Operation{ ExternalDocs: &openapi3.ExternalDocs{ URL: "https://docs.github.com/rest/reference/a", }, }, - }, - }, + })), }, }) diff --git a/tools/metadata/openapi.go b/tools/metadata/openapi.go index 0804a47020b..327b7afba87 100644 --- a/tools/metadata/openapi.go +++ b/tools/metadata/openapi.go @@ -40,7 +40,7 @@ func getOpsFromGithub(ctx context.Context, client *github.Client, gitRef string) } var ops []*operation for _, desc := range descs { - for p, pathItem := range desc.description.Paths { + for p, pathItem := range desc.description.Paths.Map() { for method, op := range pathItem.Operations() { docURL := "" if op.ExternalDocs != nil { From b40c811fdcd3abbf6423486e8528a86ee7c1cf45 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jan 2024 13:09:06 -0500 Subject: [PATCH 376/751] Bump github.com/cloudflare/circl from 1.3.3 to 1.3.7 in /example (#3039) --- example/go.mod | 2 +- example/go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/example/go.mod b/example/go.mod index efda4229223..bc636639439 100644 --- a/example/go.mod +++ b/example/go.mod @@ -13,7 +13,7 @@ require ( ) require ( - github.com/cloudflare/circl v1.3.3 // indirect + github.com/cloudflare/circl v1.3.7 // indirect github.com/golang-jwt/jwt/v4 v4.0.0 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/google/go-github/v41 v41.0.0 // indirect diff --git a/example/go.sum b/example/go.sum index 4679434efea..1bdf8355928 100644 --- a/example/go.sum +++ b/example/go.sum @@ -3,8 +3,9 @@ github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjA github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 h1:tXKVfhE7FcSkhkv0UwkLvPDeZ4kz6OXd0PKPlFqf81M= github.com/bradleyfalzon/ghinstallation/v2 v2.0.4/go.mod h1:B40qPqJxWE0jDZgOR1JmaMy+4AY1eBP+IByOvqyAKp0= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= +github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= +github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= github.com/gofri/go-github-ratelimit v1.0.3 h1:Ocs2jaYokZDzgvqaajX+g04dqFyVqL0JQzoO7d2wmlk= github.com/gofri/go-github-ratelimit v1.0.3/go.mod h1:OnCi5gV+hAG/LMR7llGhU7yHt44se9sYgKPnafoL7RY= github.com/golang-jwt/jwt/v4 v4.0.0 h1:RAqyYixv1p7uEnocuy8P1nru5wprCh/MH2BIlW5z5/o= From c462160a1b9bdc89a7e0b3b111c8a64e0c986f90 Mon Sep 17 00:00:00 2001 From: Noble Varghese Date: Tue, 9 Jan 2024 00:44:09 +0530 Subject: [PATCH 377/751] Add Repo and Action to IssueEvent (#3040) Fixes: #3038. --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 7 +++++++ github/issues_events.go | 4 ++++ 3 files changed, 19 insertions(+) diff --git a/github/github-accessors.go b/github/github-accessors.go index 3f24a795e5c..256bfacfb50 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -9510,6 +9510,14 @@ func (i *IssueEvent) GetRename() *Rename { return i.Rename } +// GetRepository returns the Repository field. +func (i *IssueEvent) GetRepository() *Repository { + if i == nil { + return nil + } + return i.Repository +} + // GetRequestedReviewer returns the RequestedReviewer field. func (i *IssueEvent) GetRequestedReviewer() *User { if i == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index e575fea2526..461ce8ed7eb 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -11096,6 +11096,13 @@ func TestIssueEvent_GetRename(tt *testing.T) { i.GetRename() } +func TestIssueEvent_GetRepository(tt *testing.T) { + i := &IssueEvent{} + i.GetRepository() + i = nil + i.GetRepository() +} + func TestIssueEvent_GetRequestedReviewer(tt *testing.T) { i := &IssueEvent{} i.GetRequestedReviewer() diff --git a/github/issues_events.go b/github/issues_events.go index 23a16bcdc72..bba3b180311 100644 --- a/github/issues_events.go +++ b/github/issues_events.go @@ -18,6 +18,9 @@ type IssueEvent struct { // The User that generated this event. Actor *User `json:"actor,omitempty"` + // The action corresponding to the event. + Action string `json:"action,omitempty"` + // Event identifies the actual type of Event that occurred. Possible // values are: // @@ -74,6 +77,7 @@ type IssueEvent struct { Issue *Issue `json:"issue,omitempty"` // Only present on certain events; see above. + Repository *Repository `json:"repository,omitempty"` Assignee *User `json:"assignee,omitempty"` Assigner *User `json:"assigner,omitempty"` CommitID *string `json:"commit_id,omitempty"` From 5c8ee0baaeb2b0859a4f58638d78bc9cd46c6be8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jan 2024 14:43:53 -0500 Subject: [PATCH 378/751] Bump golang.org/x/sync from 0.5.0 to 0.6.0 in /tools (#3041) --- tools/go.mod | 2 +- tools/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index ce710420ec3..c0de3b4fade 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -7,7 +7,7 @@ require ( github.com/getkin/kin-openapi v0.122.0 github.com/google/go-cmp v0.6.0 github.com/google/go-github/v57 v57.0.0 - golang.org/x/sync v0.5.0 + golang.org/x/sync v0.6.0 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/tools/go.sum b/tools/go.sum index 29b5dfebe54..7ba38eeec66 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -47,8 +47,8 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= -golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= -golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= From f5496494e2789e2a3d0c39f771701a2ed7f8105b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jan 2024 16:01:49 -0500 Subject: [PATCH 379/751] Bump golang.org/x/net from 0.19.0 to 0.20.0 in /scrape (#3042) --- scrape/go.mod | 2 +- scrape/go.sum | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 08daf2365b9..230c795b6ea 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -7,5 +7,5 @@ require ( github.com/google/go-cmp v0.6.0 github.com/google/go-github/v57 v57.0.0 github.com/xlzd/gotp v0.1.0 - golang.org/x/net v0.19.0 + golang.org/x/net v0.20.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index 44051859775..1b43790fc67 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -14,7 +14,7 @@ github.com/xlzd/gotp v0.1.0/go.mod h1:ndLJ3JKzi3xLmUProq4LLxCuECL93dG9WASNLpHz8q github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -24,8 +24,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= -golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= +golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= +golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -37,12 +37,12 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= +golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= From eb3bed00ca77f6e718f034d07008e6f7cfd93b17 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Tue, 9 Jan 2024 22:35:15 -0500 Subject: [PATCH 380/751] Bump version of go-github to v58.0.0 (#3045) --- README.md | 15 ++++++++------- example/actionpermissions/main.go | 2 +- example/appengine/app.go | 2 +- example/basicauth/main.go | 2 +- .../codespaces/newreposecretwithxcrypto/main.go | 2 +- .../codespaces/newusersecretwithxcrypto/main.go | 2 +- example/commitpr/main.go | 2 +- example/go.mod | 6 +++--- example/listenvironments/main.go | 2 +- example/migrations/main.go | 2 +- example/newfilewithappauth/main.go | 2 +- example/newrepo/main.go | 2 +- example/newreposecretwithlibsodium/go.mod | 4 ++-- example/newreposecretwithlibsodium/main.go | 2 +- example/newreposecretwithxcrypto/main.go | 2 +- example/ratelimit/main.go | 2 +- example/simple/main.go | 2 +- example/tagprotection/main.go | 2 +- example/tokenauth/main.go | 2 +- example/topics/main.go | 2 +- github/doc.go | 2 +- github/examples_test.go | 2 +- github/github.go | 2 +- go.mod | 2 +- test/fields/fields.go | 2 +- test/integration/activity_test.go | 2 +- test/integration/authorizations_test.go | 2 +- test/integration/github_test.go | 2 +- test/integration/repos_test.go | 2 +- test/integration/users_test.go | 2 +- tools/go.mod | 4 ++-- tools/metadata/main.go | 2 +- tools/metadata/main_test.go | 2 +- tools/metadata/metadata.go | 2 +- tools/metadata/openapi.go | 2 +- 35 files changed, 46 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index f10c43df8c4..099fd37311d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-github # [![go-github release (latest SemVer)](https://img.shields.io/github/v/release/google/go-github?sort=semver)](https://github.com/google/go-github/releases) -[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v57/github) +[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v58/github) [![Test Status](https://github.com/google/go-github/workflows/tests/badge.svg)](https://github.com/google/go-github/actions?query=workflow%3Atests) [![Test Coverage](https://codecov.io/gh/google/go-github/branch/master/graph/badge.svg)](https://codecov.io/gh/google/go-github) [![Discuss at go-github@googlegroups.com](https://img.shields.io/badge/discuss-go--github%40googlegroups.com-blue.svg)](https://groups.google.com/group/go-github) @@ -24,7 +24,7 @@ If you're interested in using the [GraphQL API v4][], the recommended library is go-github is compatible with modern Go releases in module mode, with Go installed: ```bash -go get github.com/google/go-github/v57 +go get github.com/google/go-github/v58 ``` will resolve and add the package to the current development module, along with its dependencies. @@ -32,7 +32,7 @@ will resolve and add the package to the current development module, along with i Alternatively the same can be achieved if you use import in a package: ```go -import "github.com/google/go-github/v57/github" +import "github.com/google/go-github/v58/github" ``` and run `go get` without parameters. @@ -40,13 +40,13 @@ and run `go get` without parameters. Finally, to use the top-of-trunk version of this repo, use the following command: ```bash -go get github.com/google/go-github/v57@master +go get github.com/google/go-github/v58@master ``` ## Usage ## ```go -import "github.com/google/go-github/v57/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) +import "github.com/google/go-github/v58/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled ``` @@ -117,7 +117,7 @@ import ( "net/http" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" ) func main() { @@ -296,7 +296,7 @@ For complete usage of go-github, see the full [package docs][]. [GitHub API v3]: https://docs.github.com/en/rest [personal access token]: https://github.com/blog/1509-personal-api-tokens -[package docs]: https://pkg.go.dev/github.com/google/go-github/v57/github +[package docs]: https://pkg.go.dev/github.com/google/go-github/v58/github [GraphQL API v4]: https://developer.github.com/v4/ [shurcooL/githubv4]: https://github.com/shurcooL/githubv4 [GitHub webhook events]: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads @@ -369,6 +369,7 @@ Versions prior to 48.2.0 are not listed. | go-github Version | GitHub v3 API Version | | ----------------- | --------------------- | +| 58.0.0 | 2022-11-28 | | 57.0.0 | 2022-11-28 | | 56.0.0 | 2022-11-28 | | 55.0.0 | 2022-11-28 | diff --git a/example/actionpermissions/main.go b/example/actionpermissions/main.go index a37c0043209..ab1a4c9413d 100644 --- a/example/actionpermissions/main.go +++ b/example/actionpermissions/main.go @@ -14,7 +14,7 @@ import ( "log" "os" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" ) var ( diff --git a/example/appengine/app.go b/example/appengine/app.go index 496bca402b3..998a5271904 100644 --- a/example/appengine/app.go +++ b/example/appengine/app.go @@ -12,7 +12,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" "google.golang.org/appengine" "google.golang.org/appengine/log" ) diff --git a/example/basicauth/main.go b/example/basicauth/main.go index 48f9170b5bc..958ccafb74e 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -21,7 +21,7 @@ import ( "os" "strings" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" "golang.org/x/term" ) diff --git a/example/codespaces/newreposecretwithxcrypto/main.go b/example/codespaces/newreposecretwithxcrypto/main.go index da1dabab76d..0e4afb30bd3 100644 --- a/example/codespaces/newreposecretwithxcrypto/main.go +++ b/example/codespaces/newreposecretwithxcrypto/main.go @@ -36,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/codespaces/newusersecretwithxcrypto/main.go b/example/codespaces/newusersecretwithxcrypto/main.go index 860c5161b77..e6746fa146f 100644 --- a/example/codespaces/newusersecretwithxcrypto/main.go +++ b/example/codespaces/newusersecretwithxcrypto/main.go @@ -37,7 +37,7 @@ import ( "log" "os" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index 9e4098c916b..8e21f503d80 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -33,7 +33,7 @@ import ( "time" "github.com/ProtonMail/go-crypto/openpgp" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" ) var ( diff --git a/example/go.mod b/example/go.mod index bc636639439..ea991adb3da 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v57/example +module github.com/google/go-github/v58/example go 1.17 @@ -6,7 +6,7 @@ require ( github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-ratelimit v1.0.3 - github.com/google/go-github/v57 v57.0.0 + github.com/google/go-github/v58 v58.0.0 golang.org/x/crypto v0.17.0 golang.org/x/term v0.15.0 google.golang.org/appengine v1.6.7 @@ -24,4 +24,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v57 => ../ +replace github.com/google/go-github/v58 => ../ diff --git a/example/listenvironments/main.go b/example/listenvironments/main.go index 936f5470cf2..ce02614cf54 100644 --- a/example/listenvironments/main.go +++ b/example/listenvironments/main.go @@ -18,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" ) func main() { diff --git a/example/migrations/main.go b/example/migrations/main.go index 81872e062f2..39b67d1e2f3 100644 --- a/example/migrations/main.go +++ b/example/migrations/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" ) func fetchAllUserMigrations() ([]*github.UserMigration, error) { diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index 670021a99dd..3162174d451 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -16,7 +16,7 @@ import ( "time" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" ) func main() { diff --git a/example/newrepo/main.go b/example/newrepo/main.go index 21cb7f52a9d..405e54d7aeb 100644 --- a/example/newrepo/main.go +++ b/example/newrepo/main.go @@ -16,7 +16,7 @@ import ( "log" "os" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" ) var ( diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index 81a013ee37a..8b0c2e2ad7c 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -4,8 +4,8 @@ go 1.15 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb - github.com/google/go-github/v57 v57.0.0 + github.com/google/go-github/v58 v58.0.0 ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v57 => ../.. +replace github.com/google/go-github/v58 => ../.. diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index c022562d353..a134ffee183 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -36,7 +36,7 @@ import ( "os" sodium "github.com/GoKillers/libsodium-go/cryptobox" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" ) var ( diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index b7366908e1c..c77455c3174 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -36,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/ratelimit/main.go b/example/ratelimit/main.go index 67a8b0de483..0898c7a8338 100644 --- a/example/ratelimit/main.go +++ b/example/ratelimit/main.go @@ -13,7 +13,7 @@ import ( "fmt" "github.com/gofri/go-github-ratelimit/github_ratelimit" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" ) func main() { diff --git a/example/simple/main.go b/example/simple/main.go index 70206e7f00f..f85a6bfcacf 100644 --- a/example/simple/main.go +++ b/example/simple/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" ) // Fetch all the public organizations' membership of a user. diff --git a/example/tagprotection/main.go b/example/tagprotection/main.go index 40a00af2b0d..d2bdea046d2 100644 --- a/example/tagprotection/main.go +++ b/example/tagprotection/main.go @@ -18,7 +18,7 @@ import ( "os" "strings" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" "golang.org/x/term" ) diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index e27b72b1a0e..4666dedd19d 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -15,7 +15,7 @@ import ( "log" "os" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" "golang.org/x/term" ) diff --git a/example/topics/main.go b/example/topics/main.go index a23f1b3a0d7..d2a5c3f5c1f 100644 --- a/example/topics/main.go +++ b/example/topics/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" ) // Fetch and lists all the public topics associated with the specified GitHub topic diff --git a/github/doc.go b/github/doc.go index ca00a4bd049..5fcf8b03691 100644 --- a/github/doc.go +++ b/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v57/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v58/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to diff --git a/github/examples_test.go b/github/examples_test.go index d1070be4663..d58c6e41cff 100644 --- a/github/examples_test.go +++ b/github/examples_test.go @@ -12,7 +12,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" ) func ExampleMarkdownService_Render() { diff --git a/github/github.go b/github/github.go index 0b00655243e..7378d3f2039 100644 --- a/github/github.go +++ b/github/github.go @@ -28,7 +28,7 @@ import ( ) const ( - Version = "v57.0.0" + Version = "v58.0.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" diff --git a/go.mod b/go.mod index 51c7c0e3327..d4fd03ba937 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v57 +module github.com/google/go-github/v58 require ( github.com/google/go-cmp v0.6.0 diff --git a/test/fields/fields.go b/test/fields/fields.go index fc9f29672c5..6c823364ffe 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -25,7 +25,7 @@ import ( "reflect" "strings" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" ) var ( diff --git a/test/integration/activity_test.go b/test/integration/activity_test.go index b32bb5a02f7..79131193cb9 100644 --- a/test/integration/activity_test.go +++ b/test/integration/activity_test.go @@ -12,7 +12,7 @@ import ( "context" "testing" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" ) const ( diff --git a/test/integration/authorizations_test.go b/test/integration/authorizations_test.go index 61ec0239feb..aa5c4d94580 100644 --- a/test/integration/authorizations_test.go +++ b/test/integration/authorizations_test.go @@ -15,7 +15,7 @@ import ( "testing" "time" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" ) const msgEnvMissing = "Skipping test because the required environment variable (%v) is not present." diff --git a/test/integration/github_test.go b/test/integration/github_test.go index 81753b6bbb8..692e9e91466 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -15,7 +15,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" ) var ( diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index a4ead783846..32d02cab81d 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -15,7 +15,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" ) func TestRepositories_CRUD(t *testing.T) { diff --git a/test/integration/users_test.go b/test/integration/users_test.go index 448b5af7ffe..fc479b25859 100644 --- a/test/integration/users_test.go +++ b/test/integration/users_test.go @@ -14,7 +14,7 @@ import ( "math/rand" "testing" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" ) func TestUsers_Get(t *testing.T) { diff --git a/tools/go.mod b/tools/go.mod index c0de3b4fade..c36b9fecbbc 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -6,7 +6,7 @@ require ( github.com/alecthomas/kong v0.8.1 github.com/getkin/kin-openapi v0.122.0 github.com/google/go-cmp v0.6.0 - github.com/google/go-github/v57 v57.0.0 + github.com/google/go-github/v58 v58.0.0 golang.org/x/sync v0.6.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -24,4 +24,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v57 => ../ +replace github.com/google/go-github/v58 => ../ diff --git a/tools/metadata/main.go b/tools/metadata/main.go index 1ab2b7d2d50..1b8d754b90c 100644 --- a/tools/metadata/main.go +++ b/tools/metadata/main.go @@ -15,7 +15,7 @@ import ( "path/filepath" "github.com/alecthomas/kong" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" ) var helpVars = kong.Vars{ diff --git a/tools/metadata/main_test.go b/tools/metadata/main_test.go index a00c11ba090..001f2eeead3 100644 --- a/tools/metadata/main_test.go +++ b/tools/metadata/main_test.go @@ -23,7 +23,7 @@ import ( "github.com/alecthomas/kong" "github.com/getkin/kin-openapi/openapi3" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" ) func TestUpdateGo(t *testing.T) { diff --git a/tools/metadata/metadata.go b/tools/metadata/metadata.go index 079ff5c698b..834ccae8fce 100644 --- a/tools/metadata/metadata.go +++ b/tools/metadata/metadata.go @@ -24,7 +24,7 @@ import ( "strings" "sync" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" "gopkg.in/yaml.v3" ) diff --git a/tools/metadata/openapi.go b/tools/metadata/openapi.go index 327b7afba87..55697e389a4 100644 --- a/tools/metadata/openapi.go +++ b/tools/metadata/openapi.go @@ -14,7 +14,7 @@ import ( "strconv" "github.com/getkin/kin-openapi/openapi3" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" "golang.org/x/sync/errgroup" ) From 9231a0f0bc205f0535a29361d773a77da5e39294 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Tue, 9 Jan 2024 22:45:20 -0500 Subject: [PATCH 381/751] Bump go-github from v57 to v58 in /scrape (#3046) --- scrape/apps.go | 2 +- scrape/apps_test.go | 2 +- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scrape/apps.go b/scrape/apps.go index 0f26fe8f2e5..f2dd84da609 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -17,7 +17,7 @@ import ( "strings" "github.com/PuerkitoBio/goquery" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" ) // AppRestrictionsEnabled returns whether the specified organization has diff --git a/scrape/apps_test.go b/scrape/apps_test.go index 9b486e6a535..dd0b006e56d 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" ) func Test_AppRestrictionsEnabled(t *testing.T) { diff --git a/scrape/go.mod b/scrape/go.mod index 230c795b6ea..48a03a23bc4 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -5,7 +5,7 @@ go 1.13 require ( github.com/PuerkitoBio/goquery v1.8.1 github.com/google/go-cmp v0.6.0 - github.com/google/go-github/v57 v57.0.0 + github.com/google/go-github/v58 v58.0.0 github.com/xlzd/gotp v0.1.0 golang.org/x/net v0.20.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index 1b43790fc67..245655f139a 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -5,8 +5,8 @@ github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEq github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v57 v57.0.0 h1:L+Y3UPTY8ALM8x+TV0lg+IEBI+upibemtBD8Q9u7zHs= -github.com/google/go-github/v57 v57.0.0/go.mod h1:s0omdnye0hvK/ecLvpsGfJMiRt85PimQh4oygmLIxHw= +github.com/google/go-github/v58 v58.0.0 h1:Una7GGERlF/37XfkPwpzYJe0Vp4dt2k1kCjlxwjIvzw= +github.com/google/go-github/v58 v58.0.0/go.mod h1:k4hxDKEfoWpSqFlc8LTpGd9fu2KrV1YAa6Hi6FmDNY4= 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.1.0 h1:37blvlKCh38s+fkem+fFh7sMnceltoIEBYTVXyoa5Po= From 207a38df70d69be52b461ac124b818d81601c601 Mon Sep 17 00:00:00 2001 From: "M. Ryan Rigdon" Date: Wed, 10 Jan 2024 09:19:09 -0500 Subject: [PATCH 382/751] Fix issue in AcceptedError handling for UploadSarif (#3047) Fixes: #3036. --- github/code-scanning.go | 18 +++++++++++++++--- github/code-scanning_test.go | 14 ++++++++++++-- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/github/code-scanning.go b/github/code-scanning.go index 74a7b6c9b47..a8fca98a92d 100644 --- a/github/code-scanning.go +++ b/github/code-scanning.go @@ -7,6 +7,8 @@ package github import ( "context" + "encoding/json" + "errors" "fmt" "strconv" "strings" @@ -389,11 +391,21 @@ func (s *CodeScanningService) UploadSarif(ctx context.Context, owner, repo strin return nil, nil, err } - sarifID := new(SarifID) - resp, err := s.client.Do(ctx, req, sarifID) - if err != nil { + // This will always return an error without unmarshalling the data + resp, err := s.client.Do(ctx, req, nil) + // Even though there was an error, we still return the response + // in case the caller wants to inspect it further. + // However, if the error is AcceptedError, decode it below before + // returning from this function and closing the response body. + var acceptedError *AcceptedError + if !errors.As(err, &acceptedError) { return nil, resp, err } + sarifID := new(SarifID) + decErr := json.Unmarshal(acceptedError.Raw, sarifID) + if decErr != nil { + return nil, resp, decErr + } return sarifID, resp, nil } diff --git a/github/code-scanning_test.go b/github/code-scanning_test.go index 4fbe45e7813..a081a6ba5f1 100644 --- a/github/code-scanning_test.go +++ b/github/code-scanning_test.go @@ -58,6 +58,11 @@ func TestCodeScanningService_UploadSarif(t *testing.T) { client, mux, _, teardown := setup() defer teardown() + expectedSarifID := &SarifID{ + ID: String("testid"), + URL: String("https://example.com/testurl"), + } + mux.HandleFunc("/repos/o/r/code-scanning/sarifs", func(w http.ResponseWriter, r *http.Request) { v := new(SarifAnalysis) assertNilError(t, json.NewDecoder(r.Body).Decode(v)) @@ -67,15 +72,20 @@ func TestCodeScanningService_UploadSarif(t *testing.T) { t.Errorf("Request body = %+v, want %+v", v, want) } - fmt.Fprint(w, `{"commit_sha":"abc","ref":"ref/head/main","sarif":"abc"}`) + w.WriteHeader(http.StatusAccepted) + respBody, _ := json.Marshal(expectedSarifID) + _, _ = w.Write(respBody) }) ctx := context.Background() sarifAnalysis := &SarifAnalysis{CommitSHA: String("abc"), Ref: String("ref/head/main"), Sarif: String("abc"), CheckoutURI: String("uri"), StartedAt: &Timestamp{time.Date(2006, time.January, 02, 15, 04, 05, 0, time.UTC)}, ToolName: String("codeql-cli")} - _, _, err := client.CodeScanning.UploadSarif(ctx, "o", "r", sarifAnalysis) + respSarifID, _, err := client.CodeScanning.UploadSarif(ctx, "o", "r", sarifAnalysis) if err != nil { t.Errorf("CodeScanning.UploadSarif returned error: %v", err) } + if !cmp.Equal(expectedSarifID, respSarifID) { + t.Errorf("Sarif response = %+v, want %+v", respSarifID, expectedSarifID) + } const methodName = "UploadSarif" testBadOptions(t, methodName, func() (err error) { From e9f52699f5e55a4791567bce668f56446e6343ef Mon Sep 17 00:00:00 2001 From: Andreas Deininger Date: Thu, 11 Jan 2024 20:34:43 +0100 Subject: [PATCH 383/751] Fix typos (#3048) --- example/newfilewithappauth/main.go | 4 ++-- github/dependabot_alerts.go | 4 ++-- github/event_types.go | 2 +- github/github.go | 2 +- github/strings_test.go | 2 +- github/teams_test.go | 4 ++-- tools/metadata/testdata/update-go/invalid/github/a.go | 1 + tools/metadata/testdata/update-go/valid/github/a.go | 2 ++ 8 files changed, 12 insertions(+), 9 deletions(-) diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index 3162174d451..0e7c0899564 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -29,7 +29,7 @@ func main() { itr, err := ghinstallation.NewAppsTransport(http.DefaultTransport, 10, privatePem) if err != nil { - log.Fatalf("faild to create app transport: %v\n", err) + log.Fatalf("failed to create app transport: %v\n", err) } itr.BaseURL = gitHost @@ -42,7 +42,7 @@ func main() { ).WithEnterpriseURLs(gitHost, gitHost) if err != nil { - log.Fatalf("faild to create git client for app: %v\n", err) + log.Fatalf("failed to create git client for app: %v\n", err) } installations, _, err := client.Apps.ListInstallations(context.Background(), &github.ListOptions{}) diff --git a/github/dependabot_alerts.go b/github/dependabot_alerts.go index f1ed126c217..c274f07bece 100644 --- a/github/dependabot_alerts.go +++ b/github/dependabot_alerts.go @@ -10,7 +10,7 @@ import ( "fmt" ) -// Dependency reprensents the vulnerable dependency. +// Dependency represents the vulnerable dependency. type Dependency struct { Package *VulnerabilityPackage `json:"package,omitempty"` ManifestPath *string `json:"manifest_path,omitempty"` @@ -23,7 +23,7 @@ type AdvisoryCVSS struct { VectorString *string `json:"vector_string,omitempty"` } -// AdvisoryCWEs reprensent the advisory pertaining to Common Weakness Enumeration. +// AdvisoryCWEs represent the advisory pertaining to Common Weakness Enumeration. type AdvisoryCWEs struct { CWEID *string `json:"cwe_id,omitempty"` Name *string `json:"name,omitempty"` diff --git a/github/event_types.go b/github/event_types.go index badd29b2a01..db7c7c69efe 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -1389,7 +1389,7 @@ type ReleaseEvent struct { // RepositoryEvent is triggered when a repository is created, archived, unarchived, // renamed, edited, transferred, made public, or made private. Organization hooks are -// also trigerred when a repository is deleted. +// also triggered when a repository is deleted. // The Webhook event name is "repository". // // Events of this type are not visible in timelines, they are only used to diff --git a/github/github.go b/github/github.go index 7378d3f2039..8bc35e5efe2 100644 --- a/github/github.go +++ b/github/github.go @@ -901,7 +901,7 @@ func (c *Client) BareDo(ctx context.Context, req *http.Request) (*Response, erro // JSON decoded and stored in the value pointed to by v, or returned as an // error if an API error has occurred. If v implements the io.Writer interface, // the raw response body will be written to v, without attempting to first -// decode it. If v is nil, and no error hapens, the response is returned as is. +// decode it. If v is nil, and no error happens, the response is returned as is. // If rate limit is exceeded and reset time is in the future, Do returns // *RateLimitError immediately without making a network API call. // diff --git a/github/strings_test.go b/github/strings_test.go index 10074f08bdf..fc0f6bafcf3 100644 --- a/github/strings_test.go +++ b/github/strings_test.go @@ -80,7 +80,7 @@ func TestStringify(t *testing.T) { } // Directly test the String() methods on various GitHub types. We don't do an -// exaustive test of all the various field types, since TestStringify() above +// exhaustive test of all the various field types, since TestStringify() above // takes care of that. Rather, we just make sure that Stringify() is being // used to build the strings, which we do by verifying that pointers are // stringified as their underlying value. diff --git a/github/teams_test.go b/github/teams_test.go index d215605c618..c0ca1f6dd71 100644 --- a/github/teams_test.go +++ b/github/teams_test.go @@ -872,7 +872,7 @@ func TestTeamsService_AddTeamRepoByID_noAccess(t *testing.T) { ctx := context.Background() _, err := client.Teams.AddTeamRepoByID(ctx, 1, 1, "owner", "repo", nil) if err == nil { - t.Errorf("Expcted error to be returned") + t.Errorf("Expected error to be returned") } } @@ -888,7 +888,7 @@ func TestTeamsService_AddTeamRepoBySlug_noAccess(t *testing.T) { ctx := context.Background() _, err := client.Teams.AddTeamRepoBySlug(ctx, "org", "slug", "owner", "repo", nil) if err == nil { - t.Errorf("Expcted error to be returned") + t.Errorf("Expected error to be returned") } } diff --git a/tools/metadata/testdata/update-go/invalid/github/a.go b/tools/metadata/testdata/update-go/invalid/github/a.go index ceef5fb5963..3f58dd2b846 100644 --- a/tools/metadata/testdata/update-go/invalid/github/a.go +++ b/tools/metadata/testdata/update-go/invalid/github/a.go @@ -18,6 +18,7 @@ func (*AService) Ambiguous() {} func (*AService) MissingOperation() {} // DuplicateOperations has duplicate operations +// //meta:operation GET /a/{a_id} //meta:operation POST /a/{a_id} //meta:operation GET /a/{a_id} diff --git a/tools/metadata/testdata/update-go/valid/github/a.go b/tools/metadata/testdata/update-go/valid/github/a.go index 7885efd8c79..245e2ba1df1 100644 --- a/tools/metadata/testdata/update-go/valid/github/a.go +++ b/tools/metadata/testdata/update-go/valid/github/a.go @@ -3,10 +3,12 @@ package github type AService struct{} // Get gets an A +// //meta:operation GET /a/{non-canonical-id} func (s *AService) Get() {} // Undocumented uses an undocumented operation +// //meta:operation GET /undocumented/{undocumented_id} func (s *AService) Undocumented() {} From e7a3cc7ba31a1723c65b8f0e0c88e9bccaa5ee82 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> Date: Fri, 19 Jan 2024 22:11:29 +0900 Subject: [PATCH 384/751] Add MergedAt field to PullRequestLinks (#3053) Fixes: #3052. --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ github/issues.go | 9 +++++---- github/issues_test.go | 4 +++- 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 256bfacfb50..6663fc1ae7d 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -16262,6 +16262,14 @@ func (p *PullRequestLinks) GetHTMLURL() string { return *p.HTMLURL } +// GetMergedAt returns the MergedAt field if it's non-nil, zero value otherwise. +func (p *PullRequestLinks) GetMergedAt() Timestamp { + if p == nil || p.MergedAt == nil { + return Timestamp{} + } + return *p.MergedAt +} + // GetPatchURL returns the PatchURL field if it's non-nil, zero value otherwise. func (p *PullRequestLinks) GetPatchURL() string { if p == nil || p.PatchURL == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 461ce8ed7eb..86c9140d55b 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -18864,6 +18864,16 @@ func TestPullRequestLinks_GetHTMLURL(tt *testing.T) { p.GetHTMLURL() } +func TestPullRequestLinks_GetMergedAt(tt *testing.T) { + var zeroValue Timestamp + p := &PullRequestLinks{MergedAt: &zeroValue} + p.GetMergedAt() + p = &PullRequestLinks{} + p.GetMergedAt() + p = nil + p.GetMergedAt() +} + func TestPullRequestLinks_GetPatchURL(tt *testing.T) { var zeroValue string p := &PullRequestLinks{PatchURL: &zeroValue} diff --git a/github/issues.go b/github/issues.go index 1c07fef827b..a2652b34972 100644 --- a/github/issues.go +++ b/github/issues.go @@ -122,10 +122,11 @@ type IssueListOptions struct { // PullRequestLinks object is added to the Issue object when it's an issue included // in the IssueCommentEvent webhook payload, if the webhook is fired by a comment on a PR. type PullRequestLinks struct { - URL *string `json:"url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - DiffURL *string `json:"diff_url,omitempty"` - PatchURL *string `json:"patch_url,omitempty"` + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + DiffURL *string `json:"diff_url,omitempty"` + PatchURL *string `json:"patch_url,omitempty"` + MergedAt *Timestamp `json:"merged_at,omitempty"` } // List the issues for the authenticated user. If all is true, list issues diff --git a/github/issues_test.go b/github/issues_test.go index aa767d6508a..d64ef88d72f 100644 --- a/github/issues_test.go +++ b/github/issues_test.go @@ -499,13 +499,15 @@ func TestPullRequestLinks_Marshal(t *testing.T) { HTMLURL: String("hurl"), DiffURL: String("durl"), PatchURL: String("purl"), + MergedAt: &Timestamp{referenceTime}, } want := `{ "url": "url", "html_url": "hurl", "diff_url": "durl", - "patch_url": "purl" + "patch_url": "purl", + "merged_at": ` + referenceTimeStr + ` }` testJSONMarshal(t, u, want) From a541a92024d01083fa9b71820a5f85f424d248b8 Mon Sep 17 00:00:00 2001 From: Erik Elkins Date: Mon, 22 Jan 2024 12:00:02 -0600 Subject: [PATCH 385/751] Add default workflow permissions for enterprise/org/repo (#3054) --- github/actions_permissions_enterprise.go | 51 ++++++++++++ github/actions_permissions_enterprise_test.go | 77 ++++++++++++++++++ github/actions_permissions_orgs.go | 51 ++++++++++++ github/actions_permissions_orgs_test.go | 77 ++++++++++++++++++ github/github-accessors.go | 48 ++++++++++++ github/github-accessors_test.go | 60 ++++++++++++++ github/repos_actions_permissions.go | 52 +++++++++++++ github/repos_actions_permissions_test.go | 78 +++++++++++++++++++ 8 files changed, 494 insertions(+) diff --git a/github/actions_permissions_enterprise.go b/github/actions_permissions_enterprise.go index 7e10444af47..a6a85aa32a5 100644 --- a/github/actions_permissions_enterprise.go +++ b/github/actions_permissions_enterprise.go @@ -29,6 +29,14 @@ func (a ActionsPermissionsEnterprise) String() string { return Stringify(a) } +// DefaultWorkflowPermissionEnterprise represents the default permissions for GitHub Actions workflows for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions +type DefaultWorkflowPermissionEnterprise struct { + DefaultWorkflowPermissions *string `json:"default_workflow_permissions,omitempty"` + CanApprovePullRequestReviews *bool `json:"can_approve_pull_request_reviews,omitempty"` +} + // GetActionsPermissionsInEnterprise gets the GitHub Actions permissions policy for an enterprise. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-github-actions-permissions-for-an-enterprise @@ -205,3 +213,46 @@ func (s *ActionsService) EditActionsAllowedInEnterprise(ctx context.Context, ent return p, resp, nil } + +// GetDefaultWorkflowPermissionsInEnterprise gets the GitHub Actions default workflow permissions for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-default-workflow-permissions-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/permissions/workflow +func (s *ActionsService) GetDefaultWorkflowPermissionsInEnterprise(ctx context.Context, enterprise string) (*DefaultWorkflowPermissionEnterprise, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/permissions/workflow", enterprise) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + permissions := new(DefaultWorkflowPermissionEnterprise) + resp, err := s.client.Do(ctx, req, permissions) + if err != nil { + return nil, resp, err + } + + return permissions, resp, nil +} + +// EditDefaultWorkflowPermissionsInEnterprise sets the GitHub Actions default workflow permissions for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-default-workflow-permissions-for-an-enterprise +// +//meta:operation PUT /enterprises/{enterprise}/actions/permissions/workflow +func (s *ActionsService) EditDefaultWorkflowPermissionsInEnterprise(ctx context.Context, enterprise string, permissions DefaultWorkflowPermissionEnterprise) (*DefaultWorkflowPermissionEnterprise, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/permissions/workflow", enterprise) + req, err := s.client.NewRequest("PUT", u, permissions) + if err != nil { + return nil, nil, err + } + + p := new(DefaultWorkflowPermissionEnterprise) + resp, err := s.client.Do(ctx, req, p) + if err != nil { + return nil, resp, err + } + + return p, resp, nil +} diff --git a/github/actions_permissions_enterprise_test.go b/github/actions_permissions_enterprise_test.go index 14e8e3a6b33..70f7d2c0979 100644 --- a/github/actions_permissions_enterprise_test.go +++ b/github/actions_permissions_enterprise_test.go @@ -296,3 +296,80 @@ func TestActionsService_EditActionsAllowedInEnterprise(t *testing.T) { return resp, err }) } + +func TestActionsService_GetDefaultWorkflowPermissionsInEnterprise(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/enterprises/e/actions/permissions/workflow", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ "default_workflow_permissions": "read", "can_approve_pull_request_reviews": true }`) + }) + + ctx := context.Background() + ent, _, err := client.Actions.GetDefaultWorkflowPermissionsInEnterprise(ctx, "e") + if err != nil { + t.Errorf("Actions.GetDefaultWorkflowPermissionsInEnterprise returned error: %v", err) + } + want := &DefaultWorkflowPermissionEnterprise{DefaultWorkflowPermissions: String("read"), CanApprovePullRequestReviews: Bool(true)} + if !cmp.Equal(ent, want) { + t.Errorf("Actions.GetDefaultWorkflowPermissionsInEnterprise returned %+v, want %+v", ent, want) + } + + const methodName = "GetDefaultWorkflowPermissionsInEnterprise" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.GetDefaultWorkflowPermissionsInEnterprise(ctx, "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.GetDefaultWorkflowPermissionsInEnterprise(ctx, "e") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_EditDefaultWorkflowPermissionsInEnterprise(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + input := &DefaultWorkflowPermissionEnterprise{DefaultWorkflowPermissions: String("read"), CanApprovePullRequestReviews: Bool(true)} + + mux.HandleFunc("/enterprises/e/actions/permissions/workflow", func(w http.ResponseWriter, r *http.Request) { + v := new(DefaultWorkflowPermissionEnterprise) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) + + testMethod(t, r, "PUT") + if !cmp.Equal(v, input) { + t.Errorf("Request body = %+v, want %+v", v, input) + } + + fmt.Fprint(w, `{ "default_workflow_permissions": "read", "can_approve_pull_request_reviews": true }`) + }) + + ctx := context.Background() + ent, _, err := client.Actions.EditDefaultWorkflowPermissionsInEnterprise(ctx, "e", *input) + if err != nil { + t.Errorf("Actions.EditDefaultWorkflowPermissionsInEnterprise returned error: %v", err) + } + + want := &DefaultWorkflowPermissionEnterprise{DefaultWorkflowPermissions: String("read"), CanApprovePullRequestReviews: Bool(true)} + if !cmp.Equal(ent, want) { + t.Errorf("Actions.EditDefaultWorkflowPermissionsInEnterprise returned %+v, want %+v", ent, want) + } + + const methodName = "EditDefaultWorkflowPermissionsInEnterprise" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.EditDefaultWorkflowPermissionsInEnterprise(ctx, "\n", *input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.EditDefaultWorkflowPermissionsInEnterprise(ctx, "e", *input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} diff --git a/github/actions_permissions_orgs.go b/github/actions_permissions_orgs.go index 1a31e4c6f1b..2f555f24935 100644 --- a/github/actions_permissions_orgs.go +++ b/github/actions_permissions_orgs.go @@ -42,6 +42,14 @@ func (a ActionsAllowed) String() string { return Stringify(a) } +// DefaultWorkflowPermissionOrganization represents the default permissions for GitHub Actions workflows for an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/permissions +type DefaultWorkflowPermissionOrganization struct { + DefaultWorkflowPermissions *string `json:"default_workflow_permissions,omitempty"` + CanApprovePullRequestReviews *bool `json:"can_approve_pull_request_reviews,omitempty"` +} + // GetActionsPermissions gets the GitHub Actions permissions policy for repositories and allowed actions in an organization. // // GitHub API docs: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-an-organization @@ -218,3 +226,46 @@ func (s *ActionsService) EditActionsAllowed(ctx context.Context, org string, act return p, resp, nil } + +// GetDefaultWorkflowPermissionsInOrganization gets the GitHub Actions default workflow permissions for an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-default-workflow-permissions-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/permissions/workflow +func (s *ActionsService) GetDefaultWorkflowPermissionsInOrganization(ctx context.Context, org string) (*DefaultWorkflowPermissionOrganization, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/permissions/workflow", org) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + permissions := new(DefaultWorkflowPermissionOrganization) + resp, err := s.client.Do(ctx, req, permissions) + if err != nil { + return nil, resp, err + } + + return permissions, resp, nil +} + +// EditDefaultWorkflowPermissionsInOrganization sets the GitHub Actions default workflow permissions for an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-default-workflow-permissions-for-an-organization +// +//meta:operation PUT /orgs/{org}/actions/permissions/workflow +func (s *ActionsService) EditDefaultWorkflowPermissionsInOrganization(ctx context.Context, org string, permissions DefaultWorkflowPermissionOrganization) (*DefaultWorkflowPermissionOrganization, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/permissions/workflow", org) + req, err := s.client.NewRequest("PUT", u, permissions) + if err != nil { + return nil, nil, err + } + + p := new(DefaultWorkflowPermissionOrganization) + resp, err := s.client.Do(ctx, req, p) + if err != nil { + return nil, resp, err + } + + return p, resp, nil +} diff --git a/github/actions_permissions_orgs_test.go b/github/actions_permissions_orgs_test.go index 36a241f6ea2..fd35c519645 100644 --- a/github/actions_permissions_orgs_test.go +++ b/github/actions_permissions_orgs_test.go @@ -334,3 +334,80 @@ func TestActionsPermissions_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestActionsService_GetDefaultWorkflowPermissionsInOrganization(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/actions/permissions/workflow", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ "default_workflow_permissions": "read", "can_approve_pull_request_reviews": true }`) + }) + + ctx := context.Background() + org, _, err := client.Actions.GetDefaultWorkflowPermissionsInOrganization(ctx, "o") + if err != nil { + t.Errorf("Actions.GetDefaultWorkflowPermissionsInOrganization returned error: %v", err) + } + want := &DefaultWorkflowPermissionOrganization{DefaultWorkflowPermissions: String("read"), CanApprovePullRequestReviews: Bool(true)} + if !cmp.Equal(org, want) { + t.Errorf("Actions.GetDefaultWorkflowPermissionsInOrganization returned %+v, want %+v", org, want) + } + + const methodName = "GetDefaultWorkflowPermissionsInOrganization" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.GetDefaultWorkflowPermissionsInOrganization(ctx, "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.GetDefaultWorkflowPermissionsInOrganization(ctx, "o") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_EditDefaultWorkflowPermissionsInOrganization(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + input := &DefaultWorkflowPermissionOrganization{DefaultWorkflowPermissions: String("read"), CanApprovePullRequestReviews: Bool(true)} + + mux.HandleFunc("/orgs/o/actions/permissions/workflow", func(w http.ResponseWriter, r *http.Request) { + v := new(DefaultWorkflowPermissionOrganization) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) + + testMethod(t, r, "PUT") + if !cmp.Equal(v, input) { + t.Errorf("Request body = %+v, want %+v", v, input) + } + + fmt.Fprint(w, `{ "default_workflow_permissions": "read", "can_approve_pull_request_reviews": true }`) + }) + + ctx := context.Background() + org, _, err := client.Actions.EditDefaultWorkflowPermissionsInOrganization(ctx, "o", *input) + if err != nil { + t.Errorf("Actions.EditDefaultWorkflowPermissionsInOrganization returned error: %v", err) + } + + want := &DefaultWorkflowPermissionOrganization{DefaultWorkflowPermissions: String("read"), CanApprovePullRequestReviews: Bool(true)} + if !cmp.Equal(org, want) { + t.Errorf("Actions.EditDefaultWorkflowPermissionsInOrganization returned %+v, want %+v", org, want) + } + + const methodName = "EditDefaultWorkflowPermissionsInOrganization" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.EditDefaultWorkflowPermissionsInOrganization(ctx, "\n", *input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.EditDefaultWorkflowPermissionsInOrganization(ctx, "o", *input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} diff --git a/github/github-accessors.go b/github/github-accessors.go index 6663fc1ae7d..5a763df1e21 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -4686,6 +4686,54 @@ func (d *DefaultSetupConfiguration) GetUpdatedAt() Timestamp { return *d.UpdatedAt } +// GetCanApprovePullRequestReviews returns the CanApprovePullRequestReviews field if it's non-nil, zero value otherwise. +func (d *DefaultWorkflowPermissionEnterprise) GetCanApprovePullRequestReviews() bool { + if d == nil || d.CanApprovePullRequestReviews == nil { + return false + } + return *d.CanApprovePullRequestReviews +} + +// GetDefaultWorkflowPermissions returns the DefaultWorkflowPermissions field if it's non-nil, zero value otherwise. +func (d *DefaultWorkflowPermissionEnterprise) GetDefaultWorkflowPermissions() string { + if d == nil || d.DefaultWorkflowPermissions == nil { + return "" + } + return *d.DefaultWorkflowPermissions +} + +// GetCanApprovePullRequestReviews returns the CanApprovePullRequestReviews field if it's non-nil, zero value otherwise. +func (d *DefaultWorkflowPermissionOrganization) GetCanApprovePullRequestReviews() bool { + if d == nil || d.CanApprovePullRequestReviews == nil { + return false + } + return *d.CanApprovePullRequestReviews +} + +// GetDefaultWorkflowPermissions returns the DefaultWorkflowPermissions field if it's non-nil, zero value otherwise. +func (d *DefaultWorkflowPermissionOrganization) GetDefaultWorkflowPermissions() string { + if d == nil || d.DefaultWorkflowPermissions == nil { + return "" + } + return *d.DefaultWorkflowPermissions +} + +// GetCanApprovePullRequestReviews returns the CanApprovePullRequestReviews field if it's non-nil, zero value otherwise. +func (d *DefaultWorkflowPermissionRepository) GetCanApprovePullRequestReviews() bool { + if d == nil || d.CanApprovePullRequestReviews == nil { + return false + } + return *d.CanApprovePullRequestReviews +} + +// GetDefaultWorkflowPermissions returns the DefaultWorkflowPermissions field if it's non-nil, zero value otherwise. +func (d *DefaultWorkflowPermissionRepository) GetDefaultWorkflowPermissions() string { + if d == nil || d.DefaultWorkflowPermissions == nil { + return "" + } + return *d.DefaultWorkflowPermissions +} + // GetConfirmDeleteURL returns the ConfirmDeleteURL field if it's non-nil, zero value otherwise. func (d *DeleteAnalysis) GetConfirmDeleteURL() string { if d == nil || d.ConfirmDeleteURL == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 86c9140d55b..5c291306ab2 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -5519,6 +5519,66 @@ func TestDefaultSetupConfiguration_GetUpdatedAt(tt *testing.T) { d.GetUpdatedAt() } +func TestDefaultWorkflowPermissionEnterprise_GetCanApprovePullRequestReviews(tt *testing.T) { + var zeroValue bool + d := &DefaultWorkflowPermissionEnterprise{CanApprovePullRequestReviews: &zeroValue} + d.GetCanApprovePullRequestReviews() + d = &DefaultWorkflowPermissionEnterprise{} + d.GetCanApprovePullRequestReviews() + d = nil + d.GetCanApprovePullRequestReviews() +} + +func TestDefaultWorkflowPermissionEnterprise_GetDefaultWorkflowPermissions(tt *testing.T) { + var zeroValue string + d := &DefaultWorkflowPermissionEnterprise{DefaultWorkflowPermissions: &zeroValue} + d.GetDefaultWorkflowPermissions() + d = &DefaultWorkflowPermissionEnterprise{} + d.GetDefaultWorkflowPermissions() + d = nil + d.GetDefaultWorkflowPermissions() +} + +func TestDefaultWorkflowPermissionOrganization_GetCanApprovePullRequestReviews(tt *testing.T) { + var zeroValue bool + d := &DefaultWorkflowPermissionOrganization{CanApprovePullRequestReviews: &zeroValue} + d.GetCanApprovePullRequestReviews() + d = &DefaultWorkflowPermissionOrganization{} + d.GetCanApprovePullRequestReviews() + d = nil + d.GetCanApprovePullRequestReviews() +} + +func TestDefaultWorkflowPermissionOrganization_GetDefaultWorkflowPermissions(tt *testing.T) { + var zeroValue string + d := &DefaultWorkflowPermissionOrganization{DefaultWorkflowPermissions: &zeroValue} + d.GetDefaultWorkflowPermissions() + d = &DefaultWorkflowPermissionOrganization{} + d.GetDefaultWorkflowPermissions() + d = nil + d.GetDefaultWorkflowPermissions() +} + +func TestDefaultWorkflowPermissionRepository_GetCanApprovePullRequestReviews(tt *testing.T) { + var zeroValue bool + d := &DefaultWorkflowPermissionRepository{CanApprovePullRequestReviews: &zeroValue} + d.GetCanApprovePullRequestReviews() + d = &DefaultWorkflowPermissionRepository{} + d.GetCanApprovePullRequestReviews() + d = nil + d.GetCanApprovePullRequestReviews() +} + +func TestDefaultWorkflowPermissionRepository_GetDefaultWorkflowPermissions(tt *testing.T) { + var zeroValue string + d := &DefaultWorkflowPermissionRepository{DefaultWorkflowPermissions: &zeroValue} + d.GetDefaultWorkflowPermissions() + d = &DefaultWorkflowPermissionRepository{} + d.GetDefaultWorkflowPermissions() + d = nil + d.GetDefaultWorkflowPermissions() +} + func TestDeleteAnalysis_GetConfirmDeleteURL(tt *testing.T) { var zeroValue string d := &DeleteAnalysis{ConfirmDeleteURL: &zeroValue} diff --git a/github/repos_actions_permissions.go b/github/repos_actions_permissions.go index 2dcc367de1c..9abd32a7837 100644 --- a/github/repos_actions_permissions.go +++ b/github/repos_actions_permissions.go @@ -23,6 +23,14 @@ func (a ActionsPermissionsRepository) String() string { return Stringify(a) } +// DefaultWorkflowPermissionRepository represents the default permissions for GitHub Actions workflows for a repository. +// +// GitHub API docs: https://docs.github.com/rest/actions/permissions +type DefaultWorkflowPermissionRepository struct { + DefaultWorkflowPermissions *string `json:"default_workflow_permissions,omitempty"` + CanApprovePullRequestReviews *bool `json:"can_approve_pull_request_reviews,omitempty"` +} + // GetActionsPermissions gets the GitHub Actions permissions policy for repositories and allowed actions in a repository. // // GitHub API docs: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-a-repository @@ -30,6 +38,7 @@ func (a ActionsPermissionsRepository) String() string { //meta:operation GET /repos/{owner}/{repo}/actions/permissions func (s *RepositoriesService) GetActionsPermissions(ctx context.Context, owner, repo string) (*ActionsPermissionsRepository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions", owner, repo) + req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err @@ -64,3 +73,46 @@ func (s *RepositoriesService) EditActionsPermissions(ctx context.Context, owner, return permissions, resp, nil } + +// GetDefaultWorkflowPermissions gets the GitHub Actions default workflow permissions in a repository. +// +// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-default-workflow-permissions-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/actions/permissions/workflow +func (s *RepositoriesService) GetDefaultWorkflowPermissions(ctx context.Context, owner, repo string) (*DefaultWorkflowPermissionRepository, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/permissions/workflow", owner, repo) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + permissions := new(DefaultWorkflowPermissionRepository) + resp, err := s.client.Do(ctx, req, permissions) + if err != nil { + return nil, resp, err + } + + return permissions, resp, nil +} + +// EditDefaultWorkflowPermissions sets the GitHub Actions default workflow permissions in a repository. +// +// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-default-workflow-permissions-for-a-repository +// +//meta:operation PUT /repos/{owner}/{repo}/actions/permissions/workflow +func (s *RepositoriesService) EditDefaultWorkflowPermissions(ctx context.Context, owner, repo string, permissions DefaultWorkflowPermissionRepository) (*DefaultWorkflowPermissionRepository, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/permissions/workflow", owner, repo) + req, err := s.client.NewRequest("PUT", u, permissions) + if err != nil { + return nil, nil, err + } + + p := new(DefaultWorkflowPermissionRepository) + resp, err := s.client.Do(ctx, req, p) + if err != nil { + return nil, resp, err + } + + return p, resp, nil +} diff --git a/github/repos_actions_permissions_test.go b/github/repos_actions_permissions_test.go index ecff0d5fbca..9959a6e7685 100644 --- a/github/repos_actions_permissions_test.go +++ b/github/repos_actions_permissions_test.go @@ -110,3 +110,81 @@ func TestActionsPermissionsRepository_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestRepositoriesService_GetDefaultWorkflowPermissions(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/actions/permissions/workflow", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ "default_workflow_permissions": "read", "can_approve_pull_request_reviews": true }`) + }) + + ctx := context.Background() + org, _, err := client.Repositories.GetDefaultWorkflowPermissions(ctx, "o", "r") + if err != nil { + t.Errorf("Repositories.GetDefaultWorkflowPermissions returned error: %v", err) + } + want := &DefaultWorkflowPermissionRepository{DefaultWorkflowPermissions: String("read"), CanApprovePullRequestReviews: Bool(true)} + if !cmp.Equal(org, want) { + t.Errorf("Repositories.GetDefaultWorkflowPermissions returned %+v, want %+v", org, want) + } + + const methodName = "GetDefaultWorkflowPermissions" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.GetDefaultWorkflowPermissions(ctx, "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.GetDefaultWorkflowPermissions(ctx, "o", "r") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestRepositoriesService_EditDefaultWorkflowPermissions(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + input := &DefaultWorkflowPermissionRepository{DefaultWorkflowPermissions: String("read"), CanApprovePullRequestReviews: Bool(true)} + + mux.HandleFunc("/repos/o/r/actions/permissions/workflow", func(w http.ResponseWriter, r *http.Request) { + v := new(DefaultWorkflowPermissionRepository) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) + + testMethod(t, r, "PUT") + if !cmp.Equal(v, input) { + t.Errorf("Request body = %+v, want %+v", v, input) + } + + fmt.Fprint(w, `{ "default_workflow_permissions": "read", "can_approve_pull_request_reviews": true }`) + }) + + ctx := context.Background() + org, _, err := client.Repositories.EditDefaultWorkflowPermissions(ctx, "o", "r", *input) + if err != nil { + t.Errorf("Repositories.EditDefaultWorkflowPermissions returned error: %v", err) + } + + want := &DefaultWorkflowPermissionRepository{DefaultWorkflowPermissions: String("read"), CanApprovePullRequestReviews: Bool(true)} + if !cmp.Equal(org, want) { + t.Errorf("Repositories.EditDefaultWorkflowPermissions returned %+v, want %+v", org, want) + } + + const methodName = "EditDefaultWorkflowPermissions" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.EditDefaultWorkflowPermissions(ctx, "\n", "\n", *input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.EditDefaultWorkflowPermissions(ctx, "o", "r", *input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} From b61795d74253456297d180698c1aada6978e0e67 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 14:56:53 -0500 Subject: [PATCH 386/751] Bump actions/cache from 3 to 4 (#3055) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3067b1b0bec..78305423b47 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -51,7 +51,7 @@ jobs: echo "go-mod-cache=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT - name: Cache go modules - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ${{ steps.cache-paths.outputs.go-cache }} From 20fc90190626bc9ff64da10ffdbb3be9f1ba85be Mon Sep 17 00:00:00 2001 From: Riaje Date: Wed, 24 Jan 2024 18:27:19 -0500 Subject: [PATCH 387/751] Add Topics to EditChange struct (#3057) Fixes: #3056. --- github/event_types.go | 6 ++++++ github/event_types_test.go | 9 +++++++++ github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 7 +++++++ 4 files changed, 30 insertions(+) diff --git a/github/event_types.go b/github/event_types.go index db7c7c69efe..56db9f5b18c 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -394,6 +394,7 @@ type EditChange struct { Repo *EditRepo `json:"repository,omitempty"` Owner *EditOwner `json:"owner,omitempty"` DefaultBranch *EditDefaultBranch `json:"default_branch,omitempty"` + Topics *EditTopics `json:"topics,omitempty"` } // EditTitle represents a pull-request title change. @@ -438,6 +439,11 @@ type RepoName struct { From *string `json:"from,omitempty"` } +// EditTopics represents a change of repository topics. +type EditTopics struct { + From []string `json:"from,omitempty"` +} + // EditSHA represents a sha change of a pull-request. type EditSHA struct { From *string `json:"from,omitempty"` diff --git a/github/event_types_test.go b/github/event_types_test.go index 80eca61d0fc..8578b922bf6 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -91,6 +91,9 @@ func TestEditChange_Marshal_Repo(t *testing.T) { From: String("old-repo-name"), }, }, + Topics: &EditTopics{ + From: []string{"topic1", "topic2"}, + }, } want := `{ @@ -98,6 +101,12 @@ func TestEditChange_Marshal_Repo(t *testing.T) { "name": { "from": "old-repo-name" } + }, + "topics": { + "from": [ + "topic1", + "topic2" + ] } }` diff --git a/github/github-accessors.go b/github/github-accessors.go index 5a763df1e21..6d32908ce01 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -6358,6 +6358,14 @@ func (e *EditChange) GetTitle() *EditTitle { return e.Title } +// GetTopics returns the Topics field. +func (e *EditChange) GetTopics() *EditTopics { + if e == nil { + return nil + } + return e.Topics +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (e *EditDefaultBranch) GetFrom() string { if e == nil || e.From == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 5c291306ab2..5856cc7ac25 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -7414,6 +7414,13 @@ func TestEditChange_GetTitle(tt *testing.T) { e.GetTitle() } +func TestEditChange_GetTopics(tt *testing.T) { + e := &EditChange{} + e.GetTopics() + e = nil + e.GetTopics() +} + func TestEditDefaultBranch_GetFrom(tt *testing.T) { var zeroValue string e := &EditDefaultBranch{From: &zeroValue} From d26bcb8be17264a1fad1aaf15147625c0df75a99 Mon Sep 17 00:00:00 2001 From: tomfeigin Date: Sat, 27 Jan 2024 18:35:40 +0200 Subject: [PATCH 388/751] Add list repo org variables and secrets (#3058) --- github/actions_secrets.go | 11 ++++++++ github/actions_secrets_test.go | 43 ++++++++++++++++++++++++++++++++ github/actions_variables.go | 10 ++++++++ github/actions_variables_test.go | 43 ++++++++++++++++++++++++++++++++ 4 files changed, 107 insertions(+) diff --git a/github/actions_secrets.go b/github/actions_secrets.go index 2d4ba98db30..d8d405c06d7 100644 --- a/github/actions_secrets.go +++ b/github/actions_secrets.go @@ -138,6 +138,17 @@ func (s *ActionsService) ListRepoSecrets(ctx context.Context, owner, repo string return s.listSecrets(ctx, url, opts) } +// ListRepoOrgSecrets lists all organization secrets available in a repository +// without revealing their encrypted values. +// +// GitHub API docs: https://docs.github.com/rest/actions/secrets#list-repository-organization-secrets +// +//meta:operation GET /repos/{owner}/{repo}/actions/organization-secrets +func (s *ActionsService) ListRepoOrgSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error) { + url := fmt.Sprintf("repos/%v/%v/actions/organization-secrets", owner, repo) + return s.listSecrets(ctx, url, opts) +} + // ListOrgSecrets lists all secrets available in an organization // without revealing their encrypted values. // diff --git a/github/actions_secrets_test.go b/github/actions_secrets_test.go index a1266d6bae6..a2ac169cd24 100644 --- a/github/actions_secrets_test.go +++ b/github/actions_secrets_test.go @@ -205,6 +205,49 @@ func TestActionsService_ListRepoSecrets(t *testing.T) { }) } +func TestActionsService_ListRepoOrgSecrets(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/actions/organization-secrets", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{"per_page": "2", "page": "2"}) + fmt.Fprint(w, `{"total_count":4,"secrets":[{"name":"A","created_at":"2019-01-02T15:04:05Z","updated_at":"2020-01-02T15:04:05Z"},{"name":"B","created_at":"2019-01-02T15:04:05Z","updated_at":"2020-01-02T15:04:05Z"}]}`) + }) + + opts := &ListOptions{Page: 2, PerPage: 2} + ctx := context.Background() + secrets, _, err := client.Actions.ListRepoOrgSecrets(ctx, "o", "r", opts) + if err != nil { + t.Errorf("Actions.ListRepoOrgSecrets returned error: %v", err) + } + + want := &Secrets{ + TotalCount: 4, + Secrets: []*Secret{ + {Name: "A", CreatedAt: Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, UpdatedAt: Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}}, + {Name: "B", CreatedAt: Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, UpdatedAt: Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}}, + }, + } + if !cmp.Equal(secrets, want) { + t.Errorf("Actions.ListRepoOrgSecrets returned %+v, want %+v", secrets, want) + } + + const methodName = "ListRepoOrgSecrets" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.ListRepoOrgSecrets(ctx, "\n", "\n", opts) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.ListRepoOrgSecrets(ctx, "o", "r", opts) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + func TestActionsService_GetRepoSecret(t *testing.T) { client, mux, _, teardown := setup() defer teardown() diff --git a/github/actions_variables.go b/github/actions_variables.go index 244d159079e..aa0f23ca48d 100644 --- a/github/actions_variables.go +++ b/github/actions_variables.go @@ -59,6 +59,16 @@ func (s *ActionsService) ListRepoVariables(ctx context.Context, owner, repo stri return s.listVariables(ctx, url, opts) } +// ListRepoOrgVariables lists all organization variables available in a repository. +// +// GitHub API docs: https://docs.github.com/rest/actions/variables#list-repository-organization-variables +// +//meta:operation GET /repos/{owner}/{repo}/actions/organization-variables +func (s *ActionsService) ListRepoOrgVariables(ctx context.Context, owner, repo string, opts *ListOptions) (*ActionsVariables, *Response, error) { + url := fmt.Sprintf("repos/%v/%v/actions/organization-variables", owner, repo) + return s.listVariables(ctx, url, opts) +} + // ListOrgVariables lists all variables available in an organization. // // GitHub API docs: https://docs.github.com/rest/actions/variables#list-organization-variables diff --git a/github/actions_variables_test.go b/github/actions_variables_test.go index a9f773c261e..dcd648c25c3 100644 --- a/github/actions_variables_test.go +++ b/github/actions_variables_test.go @@ -58,6 +58,49 @@ func TestActionsService_ListRepoVariables(t *testing.T) { }) } +func TestActionsService_ListRepoOrgVariables(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/actions/organization-variables", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{"per_page": "2", "page": "2"}) + fmt.Fprint(w, `{"total_count":4,"variables":[{"name":"A","value":"AA","created_at":"2019-01-02T15:04:05Z","updated_at":"2020-01-02T15:04:05Z"},{"name":"B","value":"BB","created_at":"2019-01-02T15:04:05Z","updated_at":"2020-01-02T15:04:05Z"}]}`) + }) + + opts := &ListOptions{Page: 2, PerPage: 2} + ctx := context.Background() + variables, _, err := client.Actions.ListRepoOrgVariables(ctx, "o", "r", opts) + if err != nil { + t.Errorf("Actions.ListRepoOrgVariables returned error: %v", err) + } + + want := &ActionsVariables{ + TotalCount: 4, + Variables: []*ActionsVariable{ + {Name: "A", Value: "AA", CreatedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}}, + {Name: "B", Value: "BB", CreatedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}}, + }, + } + if !cmp.Equal(variables, want) { + t.Errorf("Actions.ListRepoOrgVariables returned %+v, want %+v", variables, want) + } + + const methodName = "ListRepoOrgVariables" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.ListRepoOrgVariables(ctx, "\n", "\n", opts) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.ListRepoOrgVariables(ctx, "o", "r", opts) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + func TestActionsService_GetRepoVariable(t *testing.T) { client, mux, _, teardown := setup() defer teardown() From 536966dd02c2dbf01695f41d6fe8a6719b7d3cf6 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Sun, 28 Jan 2024 14:24:21 -0500 Subject: [PATCH 389/751] Fix leaked client transport on copy (#3051) Fixes: #3043. --- github/github.go | 9 ++++++--- github/github_test.go | 29 +++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/github/github.go b/github/github.go index 8bc35e5efe2..a7326a7bd5d 100644 --- a/github/github.go +++ b/github/github.go @@ -450,15 +450,18 @@ func (c *Client) copy() *Client { c.clientMu.Lock() // can't use *c here because that would copy mutexes by value. clone := Client{ - client: c.client, + client: &http.Client{}, UserAgent: c.UserAgent, BaseURL: c.BaseURL, UploadURL: c.UploadURL, secondaryRateLimitReset: c.secondaryRateLimitReset, } c.clientMu.Unlock() - if clone.client == nil { - clone.client = &http.Client{} + if c.client != nil { + clone.client.Transport = c.client.Transport + clone.client.CheckRedirect = c.client.CheckRedirect + clone.client.Jar = c.client.Jar + clone.client.Timeout = c.client.Timeout } c.rateMu.Lock() copy(clone.rateLimits[:], c.rateLimits[:]) diff --git a/github/github_test.go b/github/github_test.go index 45ac57c0019..9a369a25fd4 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -2599,3 +2599,32 @@ func TestParseTokenExpiration(t *testing.T) { } } } + +func TestClientCopy_leak_transport(t *testing.T) { + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + accessToken := r.Header.Get("Authorization") + _, _ = fmt.Fprintf(w, `{"login": "%s"}`, accessToken) + })) + clientPreconfiguredWithURLs, err := NewClient(nil).WithEnterpriseURLs(srv.URL, srv.URL) + if err != nil { + t.Fatal(err) + } + + aliceClient := clientPreconfiguredWithURLs.WithAuthToken("alice") + bobClient := clientPreconfiguredWithURLs.WithAuthToken("bob") + + alice, _, err := aliceClient.Users.Get(context.Background(), "") + if err != nil { + t.Fatal(err) + } + + assertNoDiff(t, "Bearer alice", alice.GetLogin()) + + bob, _, err := bobClient.Users.Get(context.Background(), "") + if err != nil { + t.Fatal(err) + } + + assertNoDiff(t, "Bearer bob", bob.GetLogin()) +} From 8d349fe0c84ba964dc739b74c6dd8533c6e7429c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 14:38:49 -0500 Subject: [PATCH 390/751] Bump codecov/codecov-action from 3.1.4 to 3.1.5 (#3061) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 78305423b47..aab03d750e4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -73,4 +73,4 @@ jobs: - name: Upload coverage to Codecov if: ${{ matrix.update-coverage }} - uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d #v3.1.4 + uses: codecov/codecov-action@4fe8c5f003fae66aa5ebb77cfd3e7bfbbda0b6b0 #v3.1.5 From e574cdf07e0fa553edd56660a7daf8416660705f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 15:17:27 -0500 Subject: [PATCH 391/751] Bump github.com/getkin/kin-openapi from 0.122.0 to 0.123.0 in /tools (#3062) --- tools/go.mod | 7 +++---- tools/go.sum | 33 ++++++++------------------------- 2 files changed, 11 insertions(+), 29 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index c36b9fecbbc..2fbca2de6a9 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/alecthomas/kong v0.8.1 - github.com/getkin/kin-openapi v0.122.0 + github.com/getkin/kin-openapi v0.123.0 github.com/google/go-cmp v0.6.0 github.com/google/go-github/v58 v58.0.0 golang.org/x/sync v0.6.0 @@ -12,15 +12,14 @@ require ( ) require ( - github.com/go-openapi/jsonpointer v0.19.6 // indirect - github.com/go-openapi/swag v0.22.4 // indirect + github.com/go-openapi/jsonpointer v0.20.2 // indirect + github.com/go-openapi/swag v0.22.8 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/invopop/yaml v0.2.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/perimeterx/marshmallow v1.1.5 // indirect - github.com/stretchr/testify v1.8.4 // indirect ) // Use version at HEAD, not the latest published. diff --git a/tools/go.sum b/tools/go.sum index 7ba38eeec66..d4a1fd8b7aa 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -2,17 +2,13 @@ github.com/alecthomas/assert/v2 v2.1.0 h1:tbredtNcQnoSd3QBhQWI7QZ3XHOVkw1Moklp2o github.com/alecthomas/kong v0.8.1 h1:acZdn3m4lLRobeh3Zi2S2EpnXTd1mOL6U7xVml+vfkY= github.com/alecthomas/kong v0.8.1/go.mod h1:n1iCIO2xS46oE8ZfYCNDqdR0b0wZNrXAIAqro/2132U= github.com/alecthomas/repr v0.1.0 h1:ENn2e1+J3k09gyj2shc0dHr/yjaWSHRlrJ4DPMevDqE= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/getkin/kin-openapi v0.122.0 h1:WB9Jbl0Hp/T79/JF9xlSW5Kl9uYdk/AWD0yAd9HOM10= -github.com/getkin/kin-openapi v0.122.0/go.mod h1:PCWw/lfBrJY4HcdqE3jj+QFkaFK8ABoqo7PvqVhXXqw= -github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= -github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= -github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= -github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/getkin/kin-openapi v0.123.0 h1:zIik0mRwFNLyvtXK274Q6ut+dPh6nlxBp0x7mNrPhs8= +github.com/getkin/kin-openapi v0.123.0/go.mod h1:wb1aSZA/iWmorQP9KTAS/phLj/t17B5jT7+fS8ed9NM= +github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q= +github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs= +github.com/go-openapi/swag v0.22.8 h1:/9RjDSQ0vbFR+NyjGMkFTsA1IA0fmhKSThmfGZjicbw= +github.com/go-openapi/swag v0.22.8/go.mod h1:6QT22icPLEqAM/z/TChgb4WAveCHF92+2gF0CNjHpPI= github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= @@ -24,12 +20,8 @@ github.com/invopop/yaml v0.2.0 h1:7zky/qH+O0DwAyoobXUqvVBwgBFRxKoQ/3FjcVpjTMY= github.com/invopop/yaml v0.2.0/go.mod h1:2XuRLgs/ouIrW3XNzuNj7J3Nvu/Dig5MXvbCEdiBN3Q= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= @@ -37,23 +29,14 @@ github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwd github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s= github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From fe7732246522328c143ad09b90972c8fa8f5ae44 Mon Sep 17 00:00:00 2001 From: Nicolas Chapurlat Date: Wed, 31 Jan 2024 15:40:11 +0100 Subject: [PATCH 392/751] Add custom properties on Repository and PushEventRepository (#3065) Fixes: #3064. --- github/event_types.go | 75 ++++++++++++----------- github/github-accessors.go | 16 +++++ github/github-accessors_test.go | 20 ++++++ github/repos.go | 105 ++++++++++++++++---------------- 4 files changed, 127 insertions(+), 89 deletions(-) diff --git a/github/event_types.go b/github/event_types.go index 56db9f5b18c..b820dddf4a7 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -1327,43 +1327,44 @@ func (h HeadCommit) String() string { // PushEventRepository represents the repo object in a PushEvent payload. type PushEventRepository struct { - ID *int64 `json:"id,omitempty"` - NodeID *string `json:"node_id,omitempty"` - Name *string `json:"name,omitempty"` - FullName *string `json:"full_name,omitempty"` - Owner *User `json:"owner,omitempty"` - Private *bool `json:"private,omitempty"` - Description *string `json:"description,omitempty"` - Fork *bool `json:"fork,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - PushedAt *Timestamp `json:"pushed_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - Homepage *string `json:"homepage,omitempty"` - PullsURL *string `json:"pulls_url,omitempty"` - Size *int `json:"size,omitempty"` - StargazersCount *int `json:"stargazers_count,omitempty"` - WatchersCount *int `json:"watchers_count,omitempty"` - Language *string `json:"language,omitempty"` - HasIssues *bool `json:"has_issues,omitempty"` - HasDownloads *bool `json:"has_downloads,omitempty"` - HasWiki *bool `json:"has_wiki,omitempty"` - HasPages *bool `json:"has_pages,omitempty"` - ForksCount *int `json:"forks_count,omitempty"` - Archived *bool `json:"archived,omitempty"` - Disabled *bool `json:"disabled,omitempty"` - OpenIssuesCount *int `json:"open_issues_count,omitempty"` - DefaultBranch *string `json:"default_branch,omitempty"` - MasterBranch *string `json:"master_branch,omitempty"` - Organization *string `json:"organization,omitempty"` - URL *string `json:"url,omitempty"` - ArchiveURL *string `json:"archive_url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - StatusesURL *string `json:"statuses_url,omitempty"` - GitURL *string `json:"git_url,omitempty"` - SSHURL *string `json:"ssh_url,omitempty"` - CloneURL *string `json:"clone_url,omitempty"` - SVNURL *string `json:"svn_url,omitempty"` - Topics []string `json:"topics,omitempty"` + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Name *string `json:"name,omitempty"` + FullName *string `json:"full_name,omitempty"` + Owner *User `json:"owner,omitempty"` + Private *bool `json:"private,omitempty"` + Description *string `json:"description,omitempty"` + Fork *bool `json:"fork,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + PushedAt *Timestamp `json:"pushed_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + Homepage *string `json:"homepage,omitempty"` + PullsURL *string `json:"pulls_url,omitempty"` + Size *int `json:"size,omitempty"` + StargazersCount *int `json:"stargazers_count,omitempty"` + WatchersCount *int `json:"watchers_count,omitempty"` + Language *string `json:"language,omitempty"` + HasIssues *bool `json:"has_issues,omitempty"` + HasDownloads *bool `json:"has_downloads,omitempty"` + HasWiki *bool `json:"has_wiki,omitempty"` + HasPages *bool `json:"has_pages,omitempty"` + ForksCount *int `json:"forks_count,omitempty"` + Archived *bool `json:"archived,omitempty"` + Disabled *bool `json:"disabled,omitempty"` + OpenIssuesCount *int `json:"open_issues_count,omitempty"` + DefaultBranch *string `json:"default_branch,omitempty"` + MasterBranch *string `json:"master_branch,omitempty"` + Organization *string `json:"organization,omitempty"` + URL *string `json:"url,omitempty"` + ArchiveURL *string `json:"archive_url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + StatusesURL *string `json:"statuses_url,omitempty"` + GitURL *string `json:"git_url,omitempty"` + SSHURL *string `json:"ssh_url,omitempty"` + CloneURL *string `json:"clone_url,omitempty"` + SVNURL *string `json:"svn_url,omitempty"` + Topics []string `json:"topics,omitempty"` + CustomProperties map[string]string `json:"custom_properties,omitempty"` } // PushEventRepoOwner is a basic representation of user/org in a PushEvent payload. diff --git a/github/github-accessors.go b/github/github-accessors.go index 6d32908ce01..20c8462132b 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -17150,6 +17150,14 @@ func (p *PushEventRepository) GetCreatedAt() Timestamp { return *p.CreatedAt } +// GetCustomProperties returns the CustomProperties map if it's non-nil, an empty map otherwise. +func (p *PushEventRepository) GetCustomProperties() map[string]string { + if p == nil || p.CustomProperties == nil { + return map[string]string{} + } + return p.CustomProperties +} + // GetDefaultBranch returns the DefaultBranch field if it's non-nil, zero value otherwise. func (p *PushEventRepository) GetDefaultBranch() string { if p == nil || p.DefaultBranch == nil { @@ -18286,6 +18294,14 @@ func (r *Repository) GetCreatedAt() Timestamp { return *r.CreatedAt } +// GetCustomProperties returns the CustomProperties map if it's non-nil, an empty map otherwise. +func (r *Repository) GetCustomProperties() map[string]string { + if r == nil || r.CustomProperties == nil { + return map[string]string{} + } + return r.CustomProperties +} + // GetDefaultBranch returns the DefaultBranch field if it's non-nil, zero value otherwise. func (r *Repository) GetDefaultBranch() string { if r == nil || r.DefaultBranch == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 5856cc7ac25..d35d4bf29fb 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -19842,6 +19842,16 @@ func TestPushEventRepository_GetCreatedAt(tt *testing.T) { p.GetCreatedAt() } +func TestPushEventRepository_GetCustomProperties(tt *testing.T) { + zeroValue := map[string]string{} + p := &PushEventRepository{CustomProperties: zeroValue} + p.GetCustomProperties() + p = &PushEventRepository{} + p.GetCustomProperties() + p = nil + p.GetCustomProperties() +} + func TestPushEventRepository_GetDefaultBranch(tt *testing.T) { var zeroValue string p := &PushEventRepository{DefaultBranch: &zeroValue} @@ -21196,6 +21206,16 @@ func TestRepository_GetCreatedAt(tt *testing.T) { r.GetCreatedAt() } +func TestRepository_GetCustomProperties(tt *testing.T) { + zeroValue := map[string]string{} + r := &Repository{CustomProperties: zeroValue} + r.GetCustomProperties() + r = &Repository{} + r.GetCustomProperties() + r = nil + r.GetCustomProperties() +} + func TestRepository_GetDefaultBranch(tt *testing.T) { var zeroValue string r := &Repository{DefaultBranch: &zeroValue} diff --git a/github/repos.go b/github/repos.go index a7574d72f07..b492e55b464 100644 --- a/github/repos.go +++ b/github/repos.go @@ -27,58 +27,59 @@ 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"` - WebCommitSignoffRequired *bool `json:"web_commit_signoff_required,omitempty"` - DeleteBranchOnMerge *bool `json:"delete_branch_on_merge,omitempty"` - UseSquashPRTitleAsDefault *bool `json:"use_squash_pr_title_as_default,omitempty"` - SquashMergeCommitTitle *string `json:"squash_merge_commit_title,omitempty"` // Can be one of: "PR_TITLE", "COMMIT_OR_PR_TITLE" - SquashMergeCommitMessage *string `json:"squash_merge_commit_message,omitempty"` // Can be one of: "PR_BODY", "COMMIT_MESSAGES", "BLANK" - MergeCommitTitle *string `json:"merge_commit_title,omitempty"` // Can be one of: "PR_TITLE", "MERGE_MESSAGE" - MergeCommitMessage *string `json:"merge_commit_message,omitempty"` // Can be one of: "PR_BODY", "PR_TITLE", "BLANK" - 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"` + WebCommitSignoffRequired *bool `json:"web_commit_signoff_required,omitempty"` + DeleteBranchOnMerge *bool `json:"delete_branch_on_merge,omitempty"` + UseSquashPRTitleAsDefault *bool `json:"use_squash_pr_title_as_default,omitempty"` + SquashMergeCommitTitle *string `json:"squash_merge_commit_title,omitempty"` // Can be one of: "PR_TITLE", "COMMIT_OR_PR_TITLE" + SquashMergeCommitMessage *string `json:"squash_merge_commit_message,omitempty"` // Can be one of: "PR_BODY", "COMMIT_MESSAGES", "BLANK" + MergeCommitTitle *string `json:"merge_commit_title,omitempty"` // Can be one of: "PR_TITLE", "MERGE_MESSAGE" + MergeCommitMessage *string `json:"merge_commit_message,omitempty"` // Can be one of: "PR_BODY", "PR_TITLE", "BLANK" + Topics []string `json:"topics,omitempty"` + CustomProperties map[string]string `json:"custom_properties,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"` From 8f2dcee2e7706ca2a47f8310eec900520468e3a1 Mon Sep 17 00:00:00 2001 From: Abhishek Sharma Date: Thu, 1 Feb 2024 11:57:13 -0600 Subject: [PATCH 393/751] Add support for deployment protection rules (#3050) Fixes: #3022. --- github/github-accessors.go | 88 ++++++++ github/github-accessors_test.go | 107 +++++++++ github/repos_deployment_protection_rules.go | 148 ++++++++++++ .../repos_deployment_protection_rules_test.go | 213 ++++++++++++++++++ 4 files changed, 556 insertions(+) create mode 100644 github/repos_deployment_protection_rules.go create mode 100644 github/repos_deployment_protection_rules_test.go diff --git a/github/github-accessors.go b/github/github-accessors.go index 20c8462132b..00211cd7145 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -4590,6 +4590,78 @@ func (c *Credit) GetUser() *User { return c.User } +// GetApp returns the App field. +func (c *CustomDeploymentProtectionRule) GetApp() *CustomDeploymentProtectionRuleApp { + if c == nil { + return nil + } + return c.App +} + +// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise. +func (c *CustomDeploymentProtectionRule) GetEnabled() bool { + if c == nil || c.Enabled == nil { + return false + } + return *c.Enabled +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (c *CustomDeploymentProtectionRule) GetID() int64 { + if c == nil || c.ID == nil { + return 0 + } + return *c.ID +} + +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (c *CustomDeploymentProtectionRule) GetNodeID() string { + if c == nil || c.NodeID == nil { + return "" + } + return *c.NodeID +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (c *CustomDeploymentProtectionRuleApp) GetID() int64 { + if c == nil || c.ID == nil { + return 0 + } + return *c.ID +} + +// GetIntegrationURL returns the IntegrationURL field if it's non-nil, zero value otherwise. +func (c *CustomDeploymentProtectionRuleApp) GetIntegrationURL() string { + if c == nil || c.IntegrationURL == nil { + return "" + } + return *c.IntegrationURL +} + +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (c *CustomDeploymentProtectionRuleApp) GetNodeID() string { + if c == nil || c.NodeID == nil { + return "" + } + return *c.NodeID +} + +// GetSlug returns the Slug field if it's non-nil, zero value otherwise. +func (c *CustomDeploymentProtectionRuleApp) GetSlug() string { + if c == nil || c.Slug == nil { + return "" + } + return *c.Slug +} + +// GetIntegrationID returns the IntegrationID field if it's non-nil, zero value otherwise. +func (c *CustomDeploymentProtectionRuleRequest) GetIntegrationID() int64 { + if c == nil || c.IntegrationID == nil { + return 0 + } + return *c.IntegrationID +} + // GetDefaultValue returns the DefaultValue field if it's non-nil, zero value otherwise. func (c *CustomProperty) GetDefaultValue() string { if c == nil || c.DefaultValue == nil { @@ -10526,6 +10598,22 @@ func (l *ListCollaboratorOptions) GetAffiliation() string { return *l.Affiliation } +// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. +func (l *ListCustomDeploymentRuleIntegrationsResponse) GetTotalCount() int { + if l == nil || l.TotalCount == nil { + return 0 + } + return *l.TotalCount +} + +// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. +func (l *ListDeploymentProtectionRuleResponse) GetTotalCount() int { + if l == nil || l.TotalCount == nil { + return 0 + } + return *l.TotalCount +} + // GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise. func (l *ListExternalGroupsOptions) GetDisplayName() string { if l == nil || l.DisplayName == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index d35d4bf29fb..7f7962cd10e 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -5399,6 +5399,93 @@ func TestCredit_GetUser(tt *testing.T) { c.GetUser() } +func TestCustomDeploymentProtectionRule_GetApp(tt *testing.T) { + c := &CustomDeploymentProtectionRule{} + c.GetApp() + c = nil + c.GetApp() +} + +func TestCustomDeploymentProtectionRule_GetEnabled(tt *testing.T) { + var zeroValue bool + c := &CustomDeploymentProtectionRule{Enabled: &zeroValue} + c.GetEnabled() + c = &CustomDeploymentProtectionRule{} + c.GetEnabled() + c = nil + c.GetEnabled() +} + +func TestCustomDeploymentProtectionRule_GetID(tt *testing.T) { + var zeroValue int64 + c := &CustomDeploymentProtectionRule{ID: &zeroValue} + c.GetID() + c = &CustomDeploymentProtectionRule{} + c.GetID() + c = nil + c.GetID() +} + +func TestCustomDeploymentProtectionRule_GetNodeID(tt *testing.T) { + var zeroValue string + c := &CustomDeploymentProtectionRule{NodeID: &zeroValue} + c.GetNodeID() + c = &CustomDeploymentProtectionRule{} + c.GetNodeID() + c = nil + c.GetNodeID() +} + +func TestCustomDeploymentProtectionRuleApp_GetID(tt *testing.T) { + var zeroValue int64 + c := &CustomDeploymentProtectionRuleApp{ID: &zeroValue} + c.GetID() + c = &CustomDeploymentProtectionRuleApp{} + c.GetID() + c = nil + c.GetID() +} + +func TestCustomDeploymentProtectionRuleApp_GetIntegrationURL(tt *testing.T) { + var zeroValue string + c := &CustomDeploymentProtectionRuleApp{IntegrationURL: &zeroValue} + c.GetIntegrationURL() + c = &CustomDeploymentProtectionRuleApp{} + c.GetIntegrationURL() + c = nil + c.GetIntegrationURL() +} + +func TestCustomDeploymentProtectionRuleApp_GetNodeID(tt *testing.T) { + var zeroValue string + c := &CustomDeploymentProtectionRuleApp{NodeID: &zeroValue} + c.GetNodeID() + c = &CustomDeploymentProtectionRuleApp{} + c.GetNodeID() + c = nil + c.GetNodeID() +} + +func TestCustomDeploymentProtectionRuleApp_GetSlug(tt *testing.T) { + var zeroValue string + c := &CustomDeploymentProtectionRuleApp{Slug: &zeroValue} + c.GetSlug() + c = &CustomDeploymentProtectionRuleApp{} + c.GetSlug() + c = nil + c.GetSlug() +} + +func TestCustomDeploymentProtectionRuleRequest_GetIntegrationID(tt *testing.T) { + var zeroValue int64 + c := &CustomDeploymentProtectionRuleRequest{IntegrationID: &zeroValue} + c.GetIntegrationID() + c = &CustomDeploymentProtectionRuleRequest{} + c.GetIntegrationID() + c = nil + c.GetIntegrationID() +} + func TestCustomProperty_GetDefaultValue(tt *testing.T) { var zeroValue string c := &CustomProperty{DefaultValue: &zeroValue} @@ -12300,6 +12387,26 @@ func TestListCollaboratorOptions_GetAffiliation(tt *testing.T) { l.GetAffiliation() } +func TestListCustomDeploymentRuleIntegrationsResponse_GetTotalCount(tt *testing.T) { + var zeroValue int + l := &ListCustomDeploymentRuleIntegrationsResponse{TotalCount: &zeroValue} + l.GetTotalCount() + l = &ListCustomDeploymentRuleIntegrationsResponse{} + l.GetTotalCount() + l = nil + l.GetTotalCount() +} + +func TestListDeploymentProtectionRuleResponse_GetTotalCount(tt *testing.T) { + var zeroValue int + l := &ListDeploymentProtectionRuleResponse{TotalCount: &zeroValue} + l.GetTotalCount() + l = &ListDeploymentProtectionRuleResponse{} + l.GetTotalCount() + l = nil + l.GetTotalCount() +} + func TestListExternalGroupsOptions_GetDisplayName(tt *testing.T) { var zeroValue string l := &ListExternalGroupsOptions{DisplayName: &zeroValue} diff --git a/github/repos_deployment_protection_rules.go b/github/repos_deployment_protection_rules.go new file mode 100644 index 00000000000..29d49032818 --- /dev/null +++ b/github/repos_deployment_protection_rules.go @@ -0,0 +1,148 @@ +// Copyright 2024 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" +) + +// CustomDeploymentProtectionRuleApp represents a single deployment protection rule app for an environment. +type CustomDeploymentProtectionRuleApp struct { + ID *int64 `json:"id,omitempty"` + Slug *string `json:"slug,omitempty"` + IntegrationURL *string `json:"integration_url,omitempty"` + NodeID *string `json:"node_id,omitempty"` +} + +// CustomDeploymentProtectionRule represents a single deployment protection rule for an environment. +type CustomDeploymentProtectionRule struct { + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + App *CustomDeploymentProtectionRuleApp `json:"app,omitempty"` +} + +// ListDeploymentProtectionRuleResponse represents the response that comes back when you list deployment protection rules. +type ListDeploymentProtectionRuleResponse struct { + TotalCount *int `json:"total_count,omitempty"` + ProtectionRules []*CustomDeploymentProtectionRule `json:"custom_deployment_protection_rules,omitempty"` +} + +// ListCustomDeploymentRuleIntegrationsResponse represents the slightly different response that comes back when you list custom deployment rule integrations. +type ListCustomDeploymentRuleIntegrationsResponse struct { + TotalCount *int `json:"total_count,omitempty"` + AvailableIntegrations []*CustomDeploymentProtectionRuleApp `json:"available_custom_deployment_protection_rule_integrations,omitempty"` +} + +// CustomDeploymentProtectionRuleRequest represents a deployment protection rule request. +type CustomDeploymentProtectionRuleRequest struct { + IntegrationID *int64 `json:"integration_id,omitempty"` +} + +// GetAllDeploymentProtectionRules gets all the deployment protection rules for an environment. +// +// GitHub API docs: https://docs.github.com/rest/deployments/protection-rules#get-all-deployment-protection-rules-for-an-environment +// +//meta:operation GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules +func (s *RepositoriesService) GetAllDeploymentProtectionRules(ctx context.Context, owner, repo, environment string) (*ListDeploymentProtectionRuleResponse, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment_protection_rules", owner, repo, environment) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var list *ListDeploymentProtectionRuleResponse + resp, err := s.client.Do(ctx, req, &list) + if err != nil { + return nil, resp, err + } + + return list, resp, nil +} + +// CreateCustomDeploymentProtectionRule creates a custom deployment protection rule on an environment. +// +// GitHub API docs: https://docs.github.com/rest/deployments/protection-rules#create-a-custom-deployment-protection-rule-on-an-environment +// +//meta:operation POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules +func (s *RepositoriesService) CreateCustomDeploymentProtectionRule(ctx context.Context, owner, repo, environment string, request *CustomDeploymentProtectionRuleRequest) (*CustomDeploymentProtectionRule, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment_protection_rules", owner, repo, environment) + + req, err := s.client.NewRequest("POST", u, request) + if err != nil { + return nil, nil, err + } + + protectionRule := new(CustomDeploymentProtectionRule) + resp, err := s.client.Do(ctx, req, protectionRule) + if err != nil { + return nil, resp, err + } + + return protectionRule, resp, nil +} + +// ListCustomDeploymentRuleIntegrations lists the custom deployment rule integrations for an environment. +// +// GitHub API docs: https://docs.github.com/rest/deployments/protection-rules#list-custom-deployment-rule-integrations-available-for-an-environment +// +//meta:operation GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps +func (s *RepositoriesService) ListCustomDeploymentRuleIntegrations(ctx context.Context, owner, repo, environment string) (*ListCustomDeploymentRuleIntegrationsResponse, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment_protection_rules/apps", owner, repo, environment) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var list *ListCustomDeploymentRuleIntegrationsResponse + resp, err := s.client.Do(ctx, req, &list) + if err != nil { + return nil, resp, err + } + + return list, resp, nil +} + +// GetCustomDeploymentProtectionRule gets a custom deployment protection rule for an environment. +// +// GitHub API docs: https://docs.github.com/rest/deployments/protection-rules#get-a-custom-deployment-protection-rule +// +//meta:operation GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id} +func (s *RepositoriesService) GetCustomDeploymentProtectionRule(ctx context.Context, owner, repo, environment string, protectionRuleID int64) (*CustomDeploymentProtectionRule, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment_protection_rules/%v", owner, repo, environment, protectionRuleID) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var protectionRule *CustomDeploymentProtectionRule + resp, err := s.client.Do(ctx, req, &protectionRule) + if err != nil { + return nil, resp, err + } + + return protectionRule, resp, nil +} + +// DisableCustomDeploymentProtectionRule disables a custom deployment protection rule for an environment. +// +// GitHub API docs: https://docs.github.com/rest/deployments/protection-rules#disable-a-custom-protection-rule-for-an-environment +// +//meta:operation DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id} +func (s *RepositoriesService) DisableCustomDeploymentProtectionRule(ctx context.Context, owner, repo, environment string, protectionRuleID int64) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment_protection_rules/%v", owner, repo, environment, protectionRuleID) + + 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/repos_deployment_protection_rules_test.go b/github/repos_deployment_protection_rules_test.go new file mode 100644 index 00000000000..d5a6b87acc7 --- /dev/null +++ b/github/repos_deployment_protection_rules_test.go @@ -0,0 +1,213 @@ +// Copyright 2024 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" + "reflect" + "testing" + + "github.com/google/go-cmp/cmp" +) + +func TestRepositoriesService_GetAllDeploymentProtectionRules(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/environments/e/deployment_protection_rules", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"total_count":2, "custom_deployment_protection_rules":[{ "id": 3, "node_id": "IEH37kRlcGxveW1lbnRTdGF0ddiv", "enabled": true, "app": { "id": 1, "node_id": "GHT58kRlcGxveW1lbnRTdTY!bbcy", "slug": "a-custom-app", "integration_url": "https://api.github.com/apps/a-custom-app"}}, { "id": 4, "node_id": "MDE2OkRlcGxveW1lbnRTdHJ41128", "enabled": true, "app": { "id": 1, "node_id": "UHVE67RlcGxveW1lbnRTdTY!jfeuy", "slug": "another-custom-app", "integration_url": "https://api.github.com/apps/another-custom-app"}}]}`) + }) + + ctx := context.Background() + got, _, err := client.Repositories.GetAllDeploymentProtectionRules(ctx, "o", "r", "e") + if err != nil { + t.Errorf("Repositories.GetAllDeploymentProtectionRules returned error: %v", err) + } + + want := &ListDeploymentProtectionRuleResponse{ + ProtectionRules: []*CustomDeploymentProtectionRule{ + {ID: Int64(3), NodeID: String("IEH37kRlcGxveW1lbnRTdGF0ddiv"), Enabled: Bool(true), App: &CustomDeploymentProtectionRuleApp{ID: Int64(1), NodeID: String("GHT58kRlcGxveW1lbnRTdTY!bbcy"), Slug: String("a-custom-app"), IntegrationURL: String("https://api.github.com/apps/a-custom-app")}}, + {ID: Int64(4), NodeID: String("MDE2OkRlcGxveW1lbnRTdHJ41128"), Enabled: Bool(true), App: &CustomDeploymentProtectionRuleApp{ID: Int64(1), NodeID: String("UHVE67RlcGxveW1lbnRTdTY!jfeuy"), Slug: String("another-custom-app"), IntegrationURL: String("https://api.github.com/apps/another-custom-app")}}, + }, + TotalCount: Int(2), + } + if !reflect.DeepEqual(got, want) { + t.Errorf("Repositories.GetAllDeploymentProtectionRules = %+v, want %+v", got, want) + } + + const methodName = "GetAllDeploymentProtectionRules" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.GetAllDeploymentProtectionRules(ctx, "o", "r", "e") + if got != nil { + t.Errorf("got non-nil Repositories.GetAllDeploymentProtectionRules response: %+v", got) + } + return resp, err + }) +} + +func TestRepositoriesService_CreateCustomDeploymentProtectionRule(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + input := &CustomDeploymentProtectionRuleRequest{ + IntegrationID: Int64(5), + } + + mux.HandleFunc("/repos/o/r/environments/e/deployment_protection_rules", func(w http.ResponseWriter, r *http.Request) { + v := new(CustomDeploymentProtectionRuleRequest) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) + + testMethod(t, r, "POST") + want := input + if !reflect.DeepEqual(v, want) { + t.Errorf("Request body = %+v, want %+v", v, want) + } + + fmt.Fprint(w, `{"id":3, "node_id": "IEH37kRlcGxveW1lbnRTdGF0ddiv", "enabled": true, "app": {"id": 1, "node_id": "GHT58kRlcGxveW1lbnRTdTY!bbcy", "slug": "a-custom-app", "integration_url": "https://api.github.com/apps/a-custom-app"}}`) + }) + + ctx := context.Background() + got, _, err := client.Repositories.CreateCustomDeploymentProtectionRule(ctx, "o", "r", "e", input) + if err != nil { + t.Errorf("Repositories.CreateCustomDeploymentProtectionRule returned error: %v", err) + } + + want := &CustomDeploymentProtectionRule{ + ID: Int64(3), + NodeID: String("IEH37kRlcGxveW1lbnRTdGF0ddiv"), + Enabled: Bool(true), + App: &CustomDeploymentProtectionRuleApp{ + ID: Int64(1), + NodeID: String("GHT58kRlcGxveW1lbnRTdTY!bbcy"), + Slug: String("a-custom-app"), + IntegrationURL: String("https://api.github.com/apps/a-custom-app"), + }, + } + if !reflect.DeepEqual(got, want) { + t.Errorf("Repositories.CreateCustomDeploymentProtectionRule = %+v, want %+v", got, want) + } + + const methodName = "CreateCustomDeploymentProtectionRule" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.CreateCustomDeploymentProtectionRule(ctx, "\n", "\n", "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.CreateCustomDeploymentProtectionRule(ctx, "o", "r", "e", input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestRepositoriesService_ListCustomDeploymentRuleIntegrations(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/environments/e/deployment_protection_rules/apps", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"total_count": 2, "available_custom_deployment_protection_rule_integrations": [{"id": 1, "node_id": "GHT58kRlcGxveW1lbnRTdTY!bbcy", "slug": "a-custom-app", "integration_url": "https://api.github.com/apps/a-custom-app"}, {"id": 2, "node_id": "UHVE67RlcGxveW1lbnRTdTY!jfeuy", "slug": "another-custom-app", "integration_url": "https://api.github.com/apps/another-custom-app"}]}`) + }) + + ctx := context.Background() + got, _, err := client.Repositories.ListCustomDeploymentRuleIntegrations(ctx, "o", "r", "e") + if err != nil { + t.Errorf("Repositories.ListCustomDeploymentRuleIntegrations returned error: %v", err) + } + + want := &ListCustomDeploymentRuleIntegrationsResponse{ + TotalCount: Int(2), + AvailableIntegrations: []*CustomDeploymentProtectionRuleApp{ + {ID: Int64(1), NodeID: String("GHT58kRlcGxveW1lbnRTdTY!bbcy"), Slug: String("a-custom-app"), IntegrationURL: String("https://api.github.com/apps/a-custom-app")}, + {ID: Int64(2), NodeID: String("UHVE67RlcGxveW1lbnRTdTY!jfeuy"), Slug: String("another-custom-app"), IntegrationURL: String("https://api.github.com/apps/another-custom-app")}, + }, + } + if !reflect.DeepEqual(got, want) { + t.Errorf("Repositories.ListCustomDeploymentRuleIntegrations = %+v, want %+v", got, want) + } + + const methodName = "ListCustomDeploymentRuleIntegrations" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.ListCustomDeploymentRuleIntegrations(ctx, "o", "r", "e") + if got != nil { + t.Errorf("got non-nil Repositories.ListCustomDeploymentRuleIntegrations response: %+v", got) + } + return resp, err + }) +} + +func TestRepositoriesService_GetCustomDeploymentProtectionRule(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/environments/e/deployment_protection_rules/1", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"id":1, "node_id": "IEH37kRlcGxveW1lbnRTdGF0ddiv", "enabled": true, "app": {"id": 1, "node_id": "GHT58kRlcGxveW1lbnRTdTY!bbcy", "slug": "a-custom-app", "integration_url": "https://api.github.com/apps/a-custom-app"}}`) + }) + + ctx := context.Background() + got, _, err := client.Repositories.GetCustomDeploymentProtectionRule(ctx, "o", "r", "e", 1) + if err != nil { + t.Errorf("Repositories.GetCustomDeploymentProtectionRule returned error: %v", err) + } + + want := &CustomDeploymentProtectionRule{ + ID: Int64(1), + NodeID: String("IEH37kRlcGxveW1lbnRTdGF0ddiv"), + Enabled: Bool(true), + App: &CustomDeploymentProtectionRuleApp{ + ID: Int64(1), + NodeID: String("GHT58kRlcGxveW1lbnRTdTY!bbcy"), + Slug: String("a-custom-app"), + IntegrationURL: String("https://api.github.com/apps/a-custom-app"), + }, + } + + if !reflect.DeepEqual(got, want) { + t.Errorf("Repositories.GetCustomDeploymentProtectionRule = %+v, want %+v", got, want) + } + + const methodName = "GetCustomDeploymentProtectionRule" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.GetCustomDeploymentProtectionRule(ctx, "o", "r", "e", 1) + if got != nil { + t.Errorf("got non-nil Repositories.GetCustomDeploymentProtectionRule response: %+v", got) + } + return resp, err + }) +} + +func TestRepositoriesService_DisableCustomDeploymentProtectionRule(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/environments/e/deployment_protection_rules/1", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + w.WriteHeader(http.StatusNoContent) + }) + + ctx := context.Background() + resp, err := client.Repositories.DisableCustomDeploymentProtectionRule(ctx, "o", "r", "e", 1) + if err != nil { + t.Errorf("Repositories.DisableCustomDeploymentProtectionRule returned error: %v", err) + } + + if !cmp.Equal(resp.StatusCode, 204) { + t.Errorf("Repositories.DisableCustomDeploymentProtectionRule returned status code %+v, want %+v", resp.StatusCode, "204") + } + + const methodName = "DisableCustomDeploymentProtectionRule" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Repositories.DisableCustomDeploymentProtectionRule(ctx, "\n", "\n", "\n", 1) + return err + }) +} From 2b8c7fa86fcd1cb4a89a44c8e7b5a49fe4be8a45 Mon Sep 17 00:00:00 2001 From: Travis Tomsu Date: Thu, 1 Feb 2024 13:07:27 -0500 Subject: [PATCH 394/751] Add suspended as option to AdminService.CreateUser() (#3049) --- github/admin_users.go | 18 +++++++----------- github/admin_users_test.go | 22 +++++++++++++++------- github/github-accessors.go | 16 ++++++++++++++++ github/github-accessors_test.go | 20 ++++++++++++++++++++ 4 files changed, 58 insertions(+), 18 deletions(-) diff --git a/github/admin_users.go b/github/admin_users.go index 0d3fe9fafc1..e134ff34dbf 100644 --- a/github/admin_users.go +++ b/github/admin_users.go @@ -10,11 +10,12 @@ import ( "fmt" ) -// createUserRequest is a subset of User and is used internally -// by CreateUser to pass only the known fields for the endpoint. -type createUserRequest struct { - Login *string `json:"login,omitempty"` - Email *string `json:"email,omitempty"` +// CreateUserRequest represents the fields sent to the `CreateUser` endpoint. +// Note that `Login` is a required field. +type CreateUserRequest struct { + Login string `json:"login"` + Email *string `json:"email,omitempty"` + Suspended *bool `json:"suspended,omitempty"` } // CreateUser creates a new user in GitHub Enterprise. @@ -22,14 +23,9 @@ type createUserRequest struct { // GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#create-a-user // //meta:operation POST /admin/users -func (s *AdminService) CreateUser(ctx context.Context, login, email string) (*User, *Response, error) { +func (s *AdminService) CreateUser(ctx context.Context, userReq CreateUserRequest) (*User, *Response, error) { u := "admin/users" - userReq := &createUserRequest{ - Login: &login, - Email: &email, - } - req, err := s.client.NewRequest("POST", u, userReq) if err != nil { return nil, nil, err diff --git a/github/admin_users_test.go b/github/admin_users_test.go index 2dac611709e..d29a7e672f1 100644 --- a/github/admin_users_test.go +++ b/github/admin_users_test.go @@ -21,11 +21,11 @@ func TestAdminUsers_Create(t *testing.T) { defer teardown() mux.HandleFunc("/admin/users", func(w http.ResponseWriter, r *http.Request) { - v := new(createUserRequest) + v := new(CreateUserRequest) assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") - want := &createUserRequest{Login: String("github"), Email: String("email@domain.com")} + want := &CreateUserRequest{Login: "github", Email: String("email@domain.com"), Suspended: Bool(false)} if !cmp.Equal(v, want) { t.Errorf("Request body = %+v, want %+v", v, want) } @@ -34,7 +34,11 @@ func TestAdminUsers_Create(t *testing.T) { }) ctx := context.Background() - org, _, err := client.Admin.CreateUser(ctx, "github", "email@domain.com") + org, _, err := client.Admin.CreateUser(ctx, CreateUserRequest{ + Login: "github", + Email: String("email@domain.com"), + Suspended: Bool(false), + }) if err != nil { t.Errorf("Admin.CreateUser returned error: %v", err) } @@ -46,7 +50,11 @@ func TestAdminUsers_Create(t *testing.T) { const methodName = "CreateUser" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Admin.CreateUser(ctx, "github", "email@domain.com") + got, resp, err := client.Admin.CreateUser(ctx, CreateUserRequest{ + Login: "github", + Email: String("email@domain.com"), + Suspended: Bool(false), + }) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -177,10 +185,10 @@ func TestUserImpersonation_Delete(t *testing.T) { } func TestCreateUserRequest_Marshal(t *testing.T) { - testJSONMarshal(t, &createUserRequest{}, "{}") + testJSONMarshal(t, &CreateUserRequest{}, "{}") - u := &createUserRequest{ - Login: String("l"), + u := &CreateUserRequest{ + Login: "l", Email: String("e"), } diff --git a/github/github-accessors.go b/github/github-accessors.go index 00211cd7145..e28fd275682 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -4478,6 +4478,22 @@ func (c *CreateUserProjectOptions) GetBody() string { return *c.Body } +// GetEmail returns the Email field if it's non-nil, zero value otherwise. +func (c *CreateUserRequest) GetEmail() string { + if c == nil || c.Email == nil { + return "" + } + return *c.Email +} + +// GetSuspended returns the Suspended field if it's non-nil, zero value otherwise. +func (c *CreateUserRequest) GetSuspended() bool { + if c == nil || c.Suspended == nil { + return false + } + return *c.Suspended +} + // GetCreated returns the Created field if it's non-nil, zero value otherwise. func (c *CreationInfo) GetCreated() Timestamp { if c == nil || c.Created == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 7f7962cd10e..4c349a05ae8 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -5262,6 +5262,26 @@ func TestCreateUserProjectOptions_GetBody(tt *testing.T) { c.GetBody() } +func TestCreateUserRequest_GetEmail(tt *testing.T) { + var zeroValue string + c := &CreateUserRequest{Email: &zeroValue} + c.GetEmail() + c = &CreateUserRequest{} + c.GetEmail() + c = nil + c.GetEmail() +} + +func TestCreateUserRequest_GetSuspended(tt *testing.T) { + var zeroValue bool + c := &CreateUserRequest{Suspended: &zeroValue} + c.GetSuspended() + c = &CreateUserRequest{} + c.GetSuspended() + c = nil + c.GetSuspended() +} + func TestCreationInfo_GetCreated(tt *testing.T) { var zeroValue Timestamp c := &CreationInfo{Created: &zeroValue} From 975b2e55cec1dd1a438ed15ec605cc46113506ab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 14:40:49 -0500 Subject: [PATCH 395/751] Bump codecov/codecov-action from 3.1.5 to 4.0.1 (#3066) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index aab03d750e4..267066633b5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -73,4 +73,4 @@ jobs: - name: Upload coverage to Codecov if: ${{ matrix.update-coverage }} - uses: codecov/codecov-action@4fe8c5f003fae66aa5ebb77cfd3e7bfbbda0b6b0 #v3.1.5 + uses: codecov/codecov-action@e0b68c6749509c5f83f984dd99a76a1c1a231044 #v4.0.1 From 9390a86d3969e000efb18cebf6930948a901f217 Mon Sep 17 00:00:00 2001 From: Ryo Mimura <52129983+fchimpan@users.noreply.github.com> Date: Fri, 9 Feb 2024 21:37:05 +0900 Subject: [PATCH 396/751] Add ListWorkflowJobsAttempt method to ActionsService (#3060) Fixes: #3059. --- github/actions_workflow_jobs.go | 26 ++++++++++++++ github/actions_workflow_jobs_test.go | 54 ++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) diff --git a/github/actions_workflow_jobs.go b/github/actions_workflow_jobs.go index 0e0eb6e1146..84bbe5aa46d 100644 --- a/github/actions_workflow_jobs.go +++ b/github/actions_workflow_jobs.go @@ -94,6 +94,32 @@ func (s *ActionsService) ListWorkflowJobs(ctx context.Context, owner, repo strin return jobs, resp, nil } +// ListWorkflowJobsAttempt lists jobs for a workflow run Attempt. +// +// GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run-attempt +// +//meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs +func (s *ActionsService) ListWorkflowJobsAttempt(ctx context.Context, owner, repo string, runID, attemptNumber int64, opts *ListOptions) (*Jobs, *Response, error) { + u := fmt.Sprintf("repos/%s/%s/actions/runs/%v/attempts/%v/jobs", owner, repo, runID, attemptNumber) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + jobs := new(Jobs) + resp, err := s.client.Do(ctx, req, &jobs) + if err != nil { + return nil, resp, err + } + + return jobs, resp, nil +} + // GetWorkflowJobByID gets a specific job in a workflow run by ID. // // GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs#get-a-job-for-a-workflow-run diff --git a/github/actions_workflow_jobs_test.go b/github/actions_workflow_jobs_test.go index 1cdf4a6c81a..4e46b1377b9 100644 --- a/github/actions_workflow_jobs_test.go +++ b/github/actions_workflow_jobs_test.go @@ -89,6 +89,60 @@ func TestActionsService_ListWorkflowJobs_Filter(t *testing.T) { } } +func TestActionsService_ListWorkflowJobsAttempt(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/actions/runs/29679449/attempts/1/jobs", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{"per_page": "2", "page": "2"}) + fmt.Fprint(w, `{"total_count":4,"jobs":[{"id":399444496,"run_id":29679449,"started_at":"2019-01-02T15:04:05Z","completed_at":"2020-01-02T15:04:05Z","run_attempt":2},{"id":399444497,"run_id":29679449,"started_at":"2019-01-02T15:04:05Z","completed_at":"2020-01-02T15:04:05Z","run_attempt":2}]}`) + }) + opts := &ListOptions{Page: 2, PerPage: 2} + ctx := context.Background() + jobs, _, err := client.Actions.ListWorkflowJobsAttempt(ctx, "o", "r", 29679449, 1, opts) + if err != nil { + t.Errorf("Actions.ListWorkflowJobsAttempt returned error: %v", err) + } + + want := &Jobs{ + TotalCount: Int(4), + Jobs: []*WorkflowJob{ + { + ID: Int64(399444496), + RunID: Int64(29679449), + StartedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, + CompletedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}, + RunAttempt: Int64(2), + }, + { + ID: Int64(399444497), + RunID: Int64(29679449), + StartedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, + CompletedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}, + RunAttempt: Int64(2), + }, + }, + } + if !cmp.Equal(jobs, want) { + t.Errorf("Actions.ListWorkflowJobsAttempt returned %+v, want %+v", jobs, want) + } + + const methodName = "ListWorkflowJobsAttempt" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.ListWorkflowJobsAttempt(ctx, "\n", "\n", 29679449, 1, opts) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.ListWorkflowJobsAttempt(ctx, "o", "r", 29679449, 1, opts) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + func TestActionsService_GetWorkflowJobByID(t *testing.T) { client, mux, _, teardown := setup() defer teardown() From 4177a193b1205aa1ab5019448bafc5c438ebb01e Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Fri, 9 Feb 2024 09:33:13 -0500 Subject: [PATCH 397/751] Bump version of go-github to v59.0.0 (#3068) --- README.md | 15 ++++++++------- example/actionpermissions/main.go | 2 +- example/appengine/app.go | 2 +- example/basicauth/main.go | 2 +- .../codespaces/newreposecretwithxcrypto/main.go | 2 +- .../codespaces/newusersecretwithxcrypto/main.go | 2 +- example/commitpr/main.go | 2 +- example/go.mod | 6 +++--- example/listenvironments/main.go | 2 +- example/migrations/main.go | 2 +- example/newfilewithappauth/main.go | 2 +- example/newrepo/main.go | 2 +- example/newreposecretwithlibsodium/go.mod | 4 ++-- example/newreposecretwithlibsodium/main.go | 2 +- example/newreposecretwithxcrypto/main.go | 2 +- example/ratelimit/main.go | 2 +- example/simple/main.go | 2 +- example/tagprotection/main.go | 2 +- example/tokenauth/main.go | 2 +- example/topics/main.go | 2 +- github/doc.go | 2 +- github/examples_test.go | 2 +- github/github.go | 2 +- go.mod | 2 +- test/fields/fields.go | 2 +- test/integration/activity_test.go | 2 +- test/integration/authorizations_test.go | 2 +- test/integration/github_test.go | 2 +- test/integration/repos_test.go | 2 +- test/integration/users_test.go | 2 +- tools/go.mod | 4 ++-- tools/metadata/main.go | 2 +- tools/metadata/main_test.go | 2 +- tools/metadata/metadata.go | 2 +- tools/metadata/openapi.go | 2 +- 35 files changed, 46 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 099fd37311d..00407f2d745 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-github # [![go-github release (latest SemVer)](https://img.shields.io/github/v/release/google/go-github?sort=semver)](https://github.com/google/go-github/releases) -[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v58/github) +[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v59/github) [![Test Status](https://github.com/google/go-github/workflows/tests/badge.svg)](https://github.com/google/go-github/actions?query=workflow%3Atests) [![Test Coverage](https://codecov.io/gh/google/go-github/branch/master/graph/badge.svg)](https://codecov.io/gh/google/go-github) [![Discuss at go-github@googlegroups.com](https://img.shields.io/badge/discuss-go--github%40googlegroups.com-blue.svg)](https://groups.google.com/group/go-github) @@ -24,7 +24,7 @@ If you're interested in using the [GraphQL API v4][], the recommended library is go-github is compatible with modern Go releases in module mode, with Go installed: ```bash -go get github.com/google/go-github/v58 +go get github.com/google/go-github/v59 ``` will resolve and add the package to the current development module, along with its dependencies. @@ -32,7 +32,7 @@ will resolve and add the package to the current development module, along with i Alternatively the same can be achieved if you use import in a package: ```go -import "github.com/google/go-github/v58/github" +import "github.com/google/go-github/v59/github" ``` and run `go get` without parameters. @@ -40,13 +40,13 @@ and run `go get` without parameters. Finally, to use the top-of-trunk version of this repo, use the following command: ```bash -go get github.com/google/go-github/v58@master +go get github.com/google/go-github/v59@master ``` ## Usage ## ```go -import "github.com/google/go-github/v58/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) +import "github.com/google/go-github/v59/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled ``` @@ -117,7 +117,7 @@ import ( "net/http" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v58/github" + "github.com/google/go-github/v59/github" ) func main() { @@ -296,7 +296,7 @@ For complete usage of go-github, see the full [package docs][]. [GitHub API v3]: https://docs.github.com/en/rest [personal access token]: https://github.com/blog/1509-personal-api-tokens -[package docs]: https://pkg.go.dev/github.com/google/go-github/v58/github +[package docs]: https://pkg.go.dev/github.com/google/go-github/v59/github [GraphQL API v4]: https://developer.github.com/v4/ [shurcooL/githubv4]: https://github.com/shurcooL/githubv4 [GitHub webhook events]: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads @@ -369,6 +369,7 @@ Versions prior to 48.2.0 are not listed. | go-github Version | GitHub v3 API Version | | ----------------- | --------------------- | +| 59.0.0 | 2022-11-28 | | 58.0.0 | 2022-11-28 | | 57.0.0 | 2022-11-28 | | 56.0.0 | 2022-11-28 | diff --git a/example/actionpermissions/main.go b/example/actionpermissions/main.go index ab1a4c9413d..f4229a8b8a6 100644 --- a/example/actionpermissions/main.go +++ b/example/actionpermissions/main.go @@ -14,7 +14,7 @@ import ( "log" "os" - "github.com/google/go-github/v58/github" + "github.com/google/go-github/v59/github" ) var ( diff --git a/example/appengine/app.go b/example/appengine/app.go index 998a5271904..2a971c3ce94 100644 --- a/example/appengine/app.go +++ b/example/appengine/app.go @@ -12,7 +12,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v58/github" + "github.com/google/go-github/v59/github" "google.golang.org/appengine" "google.golang.org/appengine/log" ) diff --git a/example/basicauth/main.go b/example/basicauth/main.go index 958ccafb74e..5145185f851 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -21,7 +21,7 @@ import ( "os" "strings" - "github.com/google/go-github/v58/github" + "github.com/google/go-github/v59/github" "golang.org/x/term" ) diff --git a/example/codespaces/newreposecretwithxcrypto/main.go b/example/codespaces/newreposecretwithxcrypto/main.go index 0e4afb30bd3..8b4168697de 100644 --- a/example/codespaces/newreposecretwithxcrypto/main.go +++ b/example/codespaces/newreposecretwithxcrypto/main.go @@ -36,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v58/github" + "github.com/google/go-github/v59/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/codespaces/newusersecretwithxcrypto/main.go b/example/codespaces/newusersecretwithxcrypto/main.go index e6746fa146f..ed5e42daae5 100644 --- a/example/codespaces/newusersecretwithxcrypto/main.go +++ b/example/codespaces/newusersecretwithxcrypto/main.go @@ -37,7 +37,7 @@ import ( "log" "os" - "github.com/google/go-github/v58/github" + "github.com/google/go-github/v59/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index 8e21f503d80..f3023619c3c 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -33,7 +33,7 @@ import ( "time" "github.com/ProtonMail/go-crypto/openpgp" - "github.com/google/go-github/v58/github" + "github.com/google/go-github/v59/github" ) var ( diff --git a/example/go.mod b/example/go.mod index ea991adb3da..79d1c11ebee 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v58/example +module github.com/google/go-github/v59/example go 1.17 @@ -6,7 +6,7 @@ require ( github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-ratelimit v1.0.3 - github.com/google/go-github/v58 v58.0.0 + github.com/google/go-github/v59 v59.0.0 golang.org/x/crypto v0.17.0 golang.org/x/term v0.15.0 google.golang.org/appengine v1.6.7 @@ -24,4 +24,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v58 => ../ +replace github.com/google/go-github/v59 => ../ diff --git a/example/listenvironments/main.go b/example/listenvironments/main.go index ce02614cf54..b6af06c2ca2 100644 --- a/example/listenvironments/main.go +++ b/example/listenvironments/main.go @@ -18,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v58/github" + "github.com/google/go-github/v59/github" ) func main() { diff --git a/example/migrations/main.go b/example/migrations/main.go index 39b67d1e2f3..37b578d4d01 100644 --- a/example/migrations/main.go +++ b/example/migrations/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v58/github" + "github.com/google/go-github/v59/github" ) func fetchAllUserMigrations() ([]*github.UserMigration, error) { diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index 0e7c0899564..787a60111ac 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -16,7 +16,7 @@ import ( "time" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v58/github" + "github.com/google/go-github/v59/github" ) func main() { diff --git a/example/newrepo/main.go b/example/newrepo/main.go index 405e54d7aeb..17681c28704 100644 --- a/example/newrepo/main.go +++ b/example/newrepo/main.go @@ -16,7 +16,7 @@ import ( "log" "os" - "github.com/google/go-github/v58/github" + "github.com/google/go-github/v59/github" ) var ( diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index 8b0c2e2ad7c..4bd526d3145 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -4,8 +4,8 @@ go 1.15 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb - github.com/google/go-github/v58 v58.0.0 + github.com/google/go-github/v59 v59.0.0 ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v58 => ../.. +replace github.com/google/go-github/v59 => ../.. diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index a134ffee183..93d6f5be03a 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -36,7 +36,7 @@ import ( "os" sodium "github.com/GoKillers/libsodium-go/cryptobox" - "github.com/google/go-github/v58/github" + "github.com/google/go-github/v59/github" ) var ( diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index c77455c3174..8fb1b533b3e 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -36,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v58/github" + "github.com/google/go-github/v59/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/ratelimit/main.go b/example/ratelimit/main.go index 0898c7a8338..4728cb504ad 100644 --- a/example/ratelimit/main.go +++ b/example/ratelimit/main.go @@ -13,7 +13,7 @@ import ( "fmt" "github.com/gofri/go-github-ratelimit/github_ratelimit" - "github.com/google/go-github/v58/github" + "github.com/google/go-github/v59/github" ) func main() { diff --git a/example/simple/main.go b/example/simple/main.go index f85a6bfcacf..7df3f927fec 100644 --- a/example/simple/main.go +++ b/example/simple/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v58/github" + "github.com/google/go-github/v59/github" ) // Fetch all the public organizations' membership of a user. diff --git a/example/tagprotection/main.go b/example/tagprotection/main.go index d2bdea046d2..825ef7b895b 100644 --- a/example/tagprotection/main.go +++ b/example/tagprotection/main.go @@ -18,7 +18,7 @@ import ( "os" "strings" - "github.com/google/go-github/v58/github" + "github.com/google/go-github/v59/github" "golang.org/x/term" ) diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index 4666dedd19d..e4ed2e7dcab 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -15,7 +15,7 @@ import ( "log" "os" - "github.com/google/go-github/v58/github" + "github.com/google/go-github/v59/github" "golang.org/x/term" ) diff --git a/example/topics/main.go b/example/topics/main.go index d2a5c3f5c1f..c29e0d45bd2 100644 --- a/example/topics/main.go +++ b/example/topics/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v58/github" + "github.com/google/go-github/v59/github" ) // Fetch and lists all the public topics associated with the specified GitHub topic diff --git a/github/doc.go b/github/doc.go index 5fcf8b03691..7bb0d18dff4 100644 --- a/github/doc.go +++ b/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v58/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v59/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to diff --git a/github/examples_test.go b/github/examples_test.go index d58c6e41cff..db26615f45d 100644 --- a/github/examples_test.go +++ b/github/examples_test.go @@ -12,7 +12,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v58/github" + "github.com/google/go-github/v59/github" ) func ExampleMarkdownService_Render() { diff --git a/github/github.go b/github/github.go index a7326a7bd5d..805a3fed3da 100644 --- a/github/github.go +++ b/github/github.go @@ -28,7 +28,7 @@ import ( ) const ( - Version = "v58.0.0" + Version = "v59.0.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" diff --git a/go.mod b/go.mod index d4fd03ba937..95675d8396b 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v58 +module github.com/google/go-github/v59 require ( github.com/google/go-cmp v0.6.0 diff --git a/test/fields/fields.go b/test/fields/fields.go index 6c823364ffe..6be99aa23d1 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -25,7 +25,7 @@ import ( "reflect" "strings" - "github.com/google/go-github/v58/github" + "github.com/google/go-github/v59/github" ) var ( diff --git a/test/integration/activity_test.go b/test/integration/activity_test.go index 79131193cb9..f15a9e6188a 100644 --- a/test/integration/activity_test.go +++ b/test/integration/activity_test.go @@ -12,7 +12,7 @@ import ( "context" "testing" - "github.com/google/go-github/v58/github" + "github.com/google/go-github/v59/github" ) const ( diff --git a/test/integration/authorizations_test.go b/test/integration/authorizations_test.go index aa5c4d94580..1942454eb54 100644 --- a/test/integration/authorizations_test.go +++ b/test/integration/authorizations_test.go @@ -15,7 +15,7 @@ import ( "testing" "time" - "github.com/google/go-github/v58/github" + "github.com/google/go-github/v59/github" ) const msgEnvMissing = "Skipping test because the required environment variable (%v) is not present." diff --git a/test/integration/github_test.go b/test/integration/github_test.go index 692e9e91466..4fc8c003070 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -15,7 +15,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v58/github" + "github.com/google/go-github/v59/github" ) var ( diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index 32d02cab81d..79e8cdfe9fb 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -15,7 +15,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v58/github" + "github.com/google/go-github/v59/github" ) func TestRepositories_CRUD(t *testing.T) { diff --git a/test/integration/users_test.go b/test/integration/users_test.go index fc479b25859..21e14c16a7d 100644 --- a/test/integration/users_test.go +++ b/test/integration/users_test.go @@ -14,7 +14,7 @@ import ( "math/rand" "testing" - "github.com/google/go-github/v58/github" + "github.com/google/go-github/v59/github" ) func TestUsers_Get(t *testing.T) { diff --git a/tools/go.mod b/tools/go.mod index 2fbca2de6a9..cdc69d921c7 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -6,7 +6,7 @@ require ( github.com/alecthomas/kong v0.8.1 github.com/getkin/kin-openapi v0.123.0 github.com/google/go-cmp v0.6.0 - github.com/google/go-github/v58 v58.0.0 + github.com/google/go-github/v59 v59.0.0 golang.org/x/sync v0.6.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -23,4 +23,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v58 => ../ +replace github.com/google/go-github/v59 => ../ diff --git a/tools/metadata/main.go b/tools/metadata/main.go index 1b8d754b90c..a8c597ae00d 100644 --- a/tools/metadata/main.go +++ b/tools/metadata/main.go @@ -15,7 +15,7 @@ import ( "path/filepath" "github.com/alecthomas/kong" - "github.com/google/go-github/v58/github" + "github.com/google/go-github/v59/github" ) var helpVars = kong.Vars{ diff --git a/tools/metadata/main_test.go b/tools/metadata/main_test.go index 001f2eeead3..0d850fb5b30 100644 --- a/tools/metadata/main_test.go +++ b/tools/metadata/main_test.go @@ -23,7 +23,7 @@ import ( "github.com/alecthomas/kong" "github.com/getkin/kin-openapi/openapi3" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v58/github" + "github.com/google/go-github/v59/github" ) func TestUpdateGo(t *testing.T) { diff --git a/tools/metadata/metadata.go b/tools/metadata/metadata.go index 834ccae8fce..0818a14202e 100644 --- a/tools/metadata/metadata.go +++ b/tools/metadata/metadata.go @@ -24,7 +24,7 @@ import ( "strings" "sync" - "github.com/google/go-github/v58/github" + "github.com/google/go-github/v59/github" "gopkg.in/yaml.v3" ) diff --git a/tools/metadata/openapi.go b/tools/metadata/openapi.go index 55697e389a4..e138e142bd4 100644 --- a/tools/metadata/openapi.go +++ b/tools/metadata/openapi.go @@ -14,7 +14,7 @@ import ( "strconv" "github.com/getkin/kin-openapi/openapi3" - "github.com/google/go-github/v58/github" + "github.com/google/go-github/v59/github" "golang.org/x/sync/errgroup" ) From 5145e7fe7eb5cf02fc5e646bb8bf1cb08cdd9788 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Fri, 9 Feb 2024 09:42:42 -0500 Subject: [PATCH 398/751] Bump go-github from v58 to v59 in /scrape (#3069) --- scrape/apps.go | 2 +- scrape/apps_test.go | 2 +- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scrape/apps.go b/scrape/apps.go index f2dd84da609..5310f88ce62 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -17,7 +17,7 @@ import ( "strings" "github.com/PuerkitoBio/goquery" - "github.com/google/go-github/v58/github" + "github.com/google/go-github/v59/github" ) // AppRestrictionsEnabled returns whether the specified organization has diff --git a/scrape/apps_test.go b/scrape/apps_test.go index dd0b006e56d..8cfbbdb0006 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v58/github" + "github.com/google/go-github/v59/github" ) func Test_AppRestrictionsEnabled(t *testing.T) { diff --git a/scrape/go.mod b/scrape/go.mod index 48a03a23bc4..c70573c1f32 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -5,7 +5,7 @@ go 1.13 require ( github.com/PuerkitoBio/goquery v1.8.1 github.com/google/go-cmp v0.6.0 - github.com/google/go-github/v58 v58.0.0 + github.com/google/go-github/v59 v59.0.0 github.com/xlzd/gotp v0.1.0 golang.org/x/net v0.20.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index 245655f139a..7dee995d95e 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -5,8 +5,8 @@ github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEq github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v58 v58.0.0 h1:Una7GGERlF/37XfkPwpzYJe0Vp4dt2k1kCjlxwjIvzw= -github.com/google/go-github/v58 v58.0.0/go.mod h1:k4hxDKEfoWpSqFlc8LTpGd9fu2KrV1YAa6Hi6FmDNY4= +github.com/google/go-github/v59 v59.0.0 h1:7h6bgpF5as0YQLLkEiVqpgtJqjimMYhBkD4jT5aN3VA= +github.com/google/go-github/v59 v59.0.0/go.mod h1:rJU4R0rQHFVFDOkqGWxfLNo6vEk4dv40oDjhV/gH6wM= 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.1.0 h1:37blvlKCh38s+fkem+fFh7sMnceltoIEBYTVXyoa5Po= From dd4d2a19c120ebb71a8f91097d1be1e991047b55 Mon Sep 17 00:00:00 2001 From: Emma Sax Date: Sun, 11 Feb 2024 14:53:04 -0600 Subject: [PATCH 399/751] Turn `RequiredStatusChecks` `Checks` and `Contexts` into pointers (#3070) Fixes: #2976 and #2467. --- github/github-accessors.go | 16 ++ github/github-accessors_test.go | 20 ++ github/repos.go | 16 +- github/repos_test.go | 355 ++++++++++++++++++++++++++++++-- test/integration/repos_test.go | 4 +- 5 files changed, 384 insertions(+), 27 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index e28fd275682..b645390e83a 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -20246,6 +20246,22 @@ func (r *RequiredStatusCheck) GetAppID() int64 { return *r.AppID } +// GetChecks returns the Checks field if it's non-nil, zero value otherwise. +func (r *RequiredStatusChecks) GetChecks() []*RequiredStatusCheck { + if r == nil || r.Checks == nil { + return nil + } + return *r.Checks +} + +// GetContexts returns the Contexts field if it's non-nil, zero value otherwise. +func (r *RequiredStatusChecks) GetContexts() []string { + if r == nil || r.Contexts == nil { + return nil + } + return *r.Contexts +} + // GetContextsURL returns the ContextsURL field if it's non-nil, zero value otherwise. func (r *RequiredStatusChecks) GetContextsURL() string { if r == nil || r.ContextsURL == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 4c349a05ae8..8d5b438054d 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -23517,6 +23517,26 @@ func TestRequiredStatusCheck_GetAppID(tt *testing.T) { r.GetAppID() } +func TestRequiredStatusChecks_GetChecks(tt *testing.T) { + var zeroValue []*RequiredStatusCheck + r := &RequiredStatusChecks{Checks: &zeroValue} + r.GetChecks() + r = &RequiredStatusChecks{} + r.GetChecks() + r = nil + r.GetChecks() +} + +func TestRequiredStatusChecks_GetContexts(tt *testing.T) { + var zeroValue []string + r := &RequiredStatusChecks{Contexts: &zeroValue} + r.GetContexts() + r = &RequiredStatusChecks{} + r.GetContexts() + r = nil + r.GetContexts() +} + func TestRequiredStatusChecks_GetContextsURL(tt *testing.T) { var zeroValue string r := &RequiredStatusChecks{ContextsURL: &zeroValue} diff --git a/github/repos.go b/github/repos.go index b492e55b464..2fb4c6f190a 100644 --- a/github/repos.go +++ b/github/repos.go @@ -1191,20 +1191,20 @@ type RequiredStatusChecks struct { // Require branches to be up to date before merging. (Required.) Strict bool `json:"strict"` // The list of status checks to require in order to merge into this - // branch. (Deprecated. Note: only one of Contexts/Checks can be populated, - // but at least one must be populated). - Contexts []string `json:"contexts,omitempty"` + // branch. An empty slice is valid. (Deprecated. Note: only one of + // Contexts/Checks can be populated, but at least one must be populated). + Contexts *[]string `json:"contexts,omitempty"` // The list of status checks to require in order to merge into this - // branch. - Checks []*RequiredStatusCheck `json:"checks,omitempty"` - ContextsURL *string `json:"contexts_url,omitempty"` - URL *string `json:"url,omitempty"` + // branch. An empty slice is valid. + Checks *[]*RequiredStatusCheck `json:"checks,omitempty"` + ContextsURL *string `json:"contexts_url,omitempty"` + URL *string `json:"url,omitempty"` } // RequiredStatusChecksRequest represents a request to edit a protected branch's status checks. type RequiredStatusChecksRequest struct { Strict *bool `json:"strict,omitempty"` - // Note: if both Contexts and Checks are populated, + // Deprecated. Note: if both Contexts and Checks are populated, // the GitHub API will only use Checks. Contexts []string `json:"contexts,omitempty"` Checks []*RequiredStatusCheck `json:"checks,omitempty"` diff --git a/github/repos_test.go b/github/repos_test.go index 2e61aeb1b1f..0ea381ebb56 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -1207,8 +1207,8 @@ func TestRepositoriesService_GetBranchProtection(t *testing.T) { want := &Protection{ RequiredStatusChecks: &RequiredStatusChecks{ Strict: true, - Contexts: []string{"continuous-integration"}, - Checks: []*RequiredStatusCheck{ + Contexts: &[]string{"continuous-integration"}, + Checks: &[]*RequiredStatusCheck{ { Context: "continuous-integration", }, @@ -1334,8 +1334,8 @@ func TestRepositoriesService_GetBranchProtection_noDismissalRestrictions(t *test want := &Protection{ RequiredStatusChecks: &RequiredStatusChecks{ Strict: true, - Contexts: []string{"continuous-integration"}, - Checks: []*RequiredStatusCheck{ + Contexts: &[]string{"continuous-integration"}, + Checks: &[]*RequiredStatusCheck{ { Context: "continuous-integration", }, @@ -1421,7 +1421,7 @@ func TestRepositoriesService_UpdateBranchProtection_Contexts(t *testing.T) { input := &ProtectionRequest{ RequiredStatusChecks: &RequiredStatusChecks{ Strict: true, - Contexts: []string{"continuous-integration"}, + Contexts: &[]string{"continuous-integration"}, }, RequiredPullRequestReviews: &PullRequestReviewsEnforcementRequest{ DismissStaleReviews: true, @@ -1517,8 +1517,8 @@ func TestRepositoriesService_UpdateBranchProtection_Contexts(t *testing.T) { want := &Protection{ RequiredStatusChecks: &RequiredStatusChecks{ Strict: true, - Contexts: []string{"continuous-integration"}, - Checks: []*RequiredStatusCheck{ + Contexts: &[]string{"continuous-integration"}, + Checks: &[]*RequiredStatusCheck{ { Context: "continuous-integration", }, @@ -1592,6 +1592,184 @@ func TestRepositoriesService_UpdateBranchProtection_Contexts(t *testing.T) { } } +func TestRepositoriesService_UpdateBranchProtection_EmptyContexts(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + input := &ProtectionRequest{ + RequiredStatusChecks: &RequiredStatusChecks{ + Strict: true, + Contexts: &[]string{}, + }, + RequiredPullRequestReviews: &PullRequestReviewsEnforcementRequest{ + DismissStaleReviews: true, + DismissalRestrictionsRequest: &DismissalRestrictionsRequest{ + Users: &[]string{"uu"}, + Teams: &[]string{"tt"}, + Apps: &[]string{"aa"}, + }, + BypassPullRequestAllowancesRequest: &BypassPullRequestAllowancesRequest{ + Users: []string{"uuu"}, + Teams: []string{"ttt"}, + Apps: []string{"aaa"}, + }, + }, + Restrictions: &BranchRestrictionsRequest{ + Users: []string{"u"}, + Teams: []string{"t"}, + Apps: []string{"a"}, + }, + BlockCreations: Bool(true), + LockBranch: Bool(true), + AllowForkSyncing: Bool(true), + } + + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + v := new(ProtectionRequest) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) + + testMethod(t, r, "PUT") + if !cmp.Equal(v, input) { + t.Errorf("Request body = %+v, want %+v", v, input) + } + + // TODO: remove custom Accept header when this API fully launches + testHeader(t, r, "Accept", mediaTypeRequiredApprovingReviewsPreview) + fmt.Fprintf(w, `{ + "required_status_checks":{ + "strict":true, + "contexts":[], + "checks": null + }, + "required_pull_request_reviews":{ + "dismissal_restrictions":{ + "users":[{ + "id":3, + "login":"uu" + }], + "teams":[{ + "id":4, + "slug":"tt" + }], + "apps":[{ + "id":5, + "slug":"aa" + }] + }, + "dismiss_stale_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"}], + "teams":[{"id":2,"slug":"t"}], + "apps":[{"id":3,"slug":"a"}] + }, + "block_creations": { + "enabled": true + }, + "lock_branch": { + "enabled": true + }, + "allow_fork_syncing": { + "enabled": true + } + }`) + }) + + ctx := context.Background() + protection, _, err := client.Repositories.UpdateBranchProtection(ctx, "o", "r", test.branch, input) + if err != nil { + t.Errorf("Repositories.UpdateBranchProtection returned error: %v", err) + } + + want := &Protection{ + RequiredStatusChecks: &RequiredStatusChecks{ + Strict: true, + Contexts: &[]string{}, + }, + RequiredPullRequestReviews: &PullRequestReviewsEnforcement{ + DismissStaleReviews: true, + DismissalRestrictions: &DismissalRestrictions{ + Users: []*User{ + {Login: String("uu"), ID: Int64(3)}, + }, + Teams: []*Team{ + {Slug: String("tt"), ID: Int64(4)}, + }, + Apps: []*App{ + {Slug: String("aa"), ID: Int64(5)}, + }, + }, + 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{ + {Login: String("u"), ID: Int64(1)}, + }, + Teams: []*Team{ + {Slug: String("t"), ID: Int64(2)}, + }, + Apps: []*App{ + {Slug: String("a"), ID: Int64(3)}, + }, + }, + BlockCreations: &BlockCreations{ + Enabled: Bool(true), + }, + LockBranch: &LockBranch{ + Enabled: Bool(true), + }, + AllowForkSyncing: &AllowForkSyncing{ + Enabled: Bool(true), + }, + } + if !cmp.Equal(protection, want) { + t.Errorf("Repositories.UpdateBranchProtection returned %+v, want %+v", protection, want) + } + + const methodName = "UpdateBranchProtection" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.UpdateBranchProtection(ctx, "\n", "\n", "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.UpdateBranchProtection(ctx, "o", "r", test.branch, input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) + }) + } +} + func TestRepositoriesService_UpdateBranchProtection_Checks(t *testing.T) { tests := []struct { branch string @@ -1609,7 +1787,7 @@ func TestRepositoriesService_UpdateBranchProtection_Checks(t *testing.T) { input := &ProtectionRequest{ RequiredStatusChecks: &RequiredStatusChecks{ Strict: true, - Checks: []*RequiredStatusCheck{ + Checks: &[]*RequiredStatusCheck{ { Context: "continuous-integration", }, @@ -1697,8 +1875,8 @@ func TestRepositoriesService_UpdateBranchProtection_Checks(t *testing.T) { want := &Protection{ RequiredStatusChecks: &RequiredStatusChecks{ Strict: true, - Contexts: []string{"continuous-integration"}, - Checks: []*RequiredStatusCheck{ + Contexts: &[]string{"continuous-integration"}, + Checks: &[]*RequiredStatusCheck{ { Context: "continuous-integration", }, @@ -1749,6 +1927,149 @@ func TestRepositoriesService_UpdateBranchProtection_Checks(t *testing.T) { } } +func TestRepositoriesService_UpdateBranchProtection_EmptyChecks(t *testing.T) { + tests := []struct { + branch string + urlPath string + }{ + {branch: "b", urlPath: "/repos/o/r/branches/b/protection"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection"}, + } + + for _, test := range tests { + t.Run(test.branch, func(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + input := &ProtectionRequest{ + RequiredStatusChecks: &RequiredStatusChecks{ + Strict: true, + Checks: &[]*RequiredStatusCheck{}, + }, + RequiredPullRequestReviews: &PullRequestReviewsEnforcementRequest{ + DismissStaleReviews: true, + DismissalRestrictionsRequest: &DismissalRestrictionsRequest{ + Users: &[]string{"uu"}, + Teams: &[]string{"tt"}, + Apps: &[]string{"aa"}, + }, + BypassPullRequestAllowancesRequest: &BypassPullRequestAllowancesRequest{ + Users: []string{"uuu"}, + Teams: []string{"ttt"}, + Apps: []string{"aaa"}, + }, + }, + Restrictions: &BranchRestrictionsRequest{ + Users: []string{"u"}, + Teams: []string{"t"}, + Apps: []string{"a"}, + }, + } + + mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + v := new(ProtectionRequest) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) + + testMethod(t, r, "PUT") + if !cmp.Equal(v, input) { + t.Errorf("Request body = %+v, want %+v", v, input) + } + + // TODO: remove custom Accept header when this API fully launches + testHeader(t, r, "Accept", mediaTypeRequiredApprovingReviewsPreview) + fmt.Fprintf(w, `{ + "required_status_checks":{ + "strict":true, + "contexts":null, + "checks": [] + }, + "required_pull_request_reviews":{ + "dismissal_restrictions":{ + "users":[{ + "id":3, + "login":"uu" + }], + "teams":[{ + "id":4, + "slug":"tt" + }], + "apps":[{ + "id":5, + "slug":"aa" + }] + }, + "dismiss_stale_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"}], + "teams":[{"id":2,"slug":"t"}], + "apps":[{"id":3,"slug":"a"}] + } + }`) + }) + + ctx := context.Background() + protection, _, err := client.Repositories.UpdateBranchProtection(ctx, "o", "r", test.branch, input) + if err != nil { + t.Errorf("Repositories.UpdateBranchProtection returned error: %v", err) + } + + want := &Protection{ + RequiredStatusChecks: &RequiredStatusChecks{ + Strict: true, + Checks: &[]*RequiredStatusCheck{}, + }, + RequiredPullRequestReviews: &PullRequestReviewsEnforcement{ + DismissStaleReviews: true, + DismissalRestrictions: &DismissalRestrictions{ + Users: []*User{ + {Login: String("uu"), ID: Int64(3)}, + }, + Teams: []*Team{ + {Slug: String("tt"), ID: Int64(4)}, + }, + Apps: []*App{ + {Slug: String("aa"), ID: Int64(5)}, + }, + }, + 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{ + {Login: String("u"), ID: Int64(1)}, + }, + Teams: []*Team{ + {Slug: String("t"), ID: Int64(2)}, + }, + Apps: []*App{ + {Slug: String("a"), ID: Int64(3)}, + }, + }, + } + if !cmp.Equal(protection, want) { + t.Errorf("Repositories.UpdateBranchProtection returned %+v, want %+v", protection, want) + } + }) + } +} + func TestRepositoriesService_UpdateBranchProtection_StrictNoChecks(t *testing.T) { tests := []struct { branch string @@ -1844,7 +2165,7 @@ func TestRepositoriesService_UpdateBranchProtection_StrictNoChecks(t *testing.T) want := &Protection{ RequiredStatusChecks: &RequiredStatusChecks{ Strict: true, - Contexts: []string{}, + Contexts: &[]string{}, }, RequiredPullRequestReviews: &PullRequestReviewsEnforcement{ DismissStaleReviews: true, @@ -2082,8 +2403,8 @@ func TestRepositoriesService_GetRequiredStatusChecks(t *testing.T) { want := &RequiredStatusChecks{ Strict: true, - Contexts: []string{"x", "y", "z"}, - Checks: []*RequiredStatusCheck{ + Contexts: &[]string{"x", "y", "z"}, + Checks: &[]*RequiredStatusCheck{ { Context: "x", }, @@ -2202,8 +2523,8 @@ func TestRepositoriesService_UpdateRequiredStatusChecks_Contexts(t *testing.T) { want := &RequiredStatusChecks{ Strict: true, - Contexts: []string{"continuous-integration"}, - Checks: []*RequiredStatusCheck{ + Contexts: &[]string{"continuous-integration"}, + Checks: &[]*RequiredStatusCheck{ { Context: "continuous-integration", }, @@ -2300,8 +2621,8 @@ func TestRepositoriesService_UpdateRequiredStatusChecks_Checks(t *testing.T) { want := &RequiredStatusChecks{ Strict: true, - Contexts: []string{"continuous-integration"}, - Checks: []*RequiredStatusCheck{ + Contexts: &[]string{"continuous-integration"}, + Checks: &[]*RequiredStatusCheck{ { Context: "continuous-integration", }, diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index 79e8cdfe9fb..9b32cc4a311 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -103,7 +103,7 @@ func TestRepositories_EditBranches(t *testing.T) { protectionRequest := &github.ProtectionRequest{ RequiredStatusChecks: &github.RequiredStatusChecks{ Strict: true, - Contexts: []string{"continuous-integration"}, + Contexts: &[]string{"continuous-integration"}, }, RequiredPullRequestReviews: &github.PullRequestReviewsEnforcementRequest{ DismissStaleReviews: true, @@ -126,7 +126,7 @@ func TestRepositories_EditBranches(t *testing.T) { want := &github.Protection{ RequiredStatusChecks: &github.RequiredStatusChecks{ Strict: true, - Contexts: []string{"continuous-integration"}, + Contexts: &[]string{"continuous-integration"}, }, RequiredPullRequestReviews: &github.PullRequestReviewsEnforcement{ DismissStaleReviews: true, From 6ca4d142bef57e88f87290837796a54a0296fcc4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 15:09:39 -0500 Subject: [PATCH 400/751] Bump golang.org/x/net from 0.20.0 to 0.21.0 in /scrape (#3071) --- scrape/go.mod | 2 +- scrape/go.sum | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index c70573c1f32..260a0414972 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -7,5 +7,5 @@ require ( github.com/google/go-cmp v0.6.0 github.com/google/go-github/v59 v59.0.0 github.com/xlzd/gotp v0.1.0 - golang.org/x/net v0.20.0 + golang.org/x/net v0.21.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index 7dee995d95e..8eee238637c 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -14,7 +14,7 @@ github.com/xlzd/gotp v0.1.0/go.mod h1:ndLJ3JKzi3xLmUProq4LLxCuECL93dG9WASNLpHz8q github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -24,8 +24,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= -golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -37,12 +37,12 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= +golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= From a516e21897a3c49c8bc3d6ba1e4b146e1a7aefec Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Tue, 13 Feb 2024 22:01:20 -0500 Subject: [PATCH 401/751] Update workflow and tools to use Go 1.22 and 1.21 (#3074) --- .github/workflows/tests.yml | 2 +- example/go.mod | 2 +- example/go.sum | 1 + example/newreposecretwithlibsodium/go.mod | 6 +++++- go.mod | 2 +- script/generate.sh | 2 +- tools/go.mod | 4 +++- tools/go.sum | 12 ++++++++++++ 8 files changed, 25 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 267066633b5..d789c811c14 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,7 +24,7 @@ jobs: shell: bash strategy: matrix: - go-version: [1.x, 1.20.x] + go-version: [1.x, 1.21.x] platform: [ubuntu-latest] include: # include windows, but only with the latest Go version, since there diff --git a/example/go.mod b/example/go.mod index 79d1c11ebee..f3e6883fa1c 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,6 +1,6 @@ module github.com/google/go-github/v59/example -go 1.17 +go 1.21 require ( github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 diff --git a/example/go.sum b/example/go.sum index 1bdf8355928..81f5d70a5b0 100644 --- a/example/go.sum +++ b/example/go.sum @@ -19,6 +19,7 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github/v41 v41.0.0 h1:HseJrM2JFf2vfiZJ8anY2hqBjdfY1Vlj/K27ueww4gg= github.com/google/go-github/v41 v41.0.0/go.mod h1:XgmCA5H323A9rtgExdTcnDkcqp6S30AVACCBDOonIxg= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index 4bd526d3145..07619c05181 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -1,11 +1,15 @@ module newreposecretwithlibsodium -go 1.15 +go 1.21 + +toolchain go1.22.0 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb github.com/google/go-github/v59 v59.0.0 ) +require github.com/google/go-querystring v1.1.0 // indirect + // Use version at HEAD, not the latest published. replace github.com/google/go-github/v59 => ../.. diff --git a/go.mod b/go.mod index 95675d8396b..32244bfb7d5 100644 --- a/go.mod +++ b/go.mod @@ -5,4 +5,4 @@ require ( github.com/google/go-querystring v1.1.0 ) -go 1.17 +go 1.21 diff --git a/script/generate.sh b/script/generate.sh index 17707b2385c..6dab2ad6795 100755 --- a/script/generate.sh +++ b/script/generate.sh @@ -43,6 +43,6 @@ for dir in $MOD_DIRS; do ( cd "$dir" go generate ./... - go mod tidy -compat '1.17' + go mod tidy -compat '1.21' ) done diff --git a/tools/go.mod b/tools/go.mod index cdc69d921c7..4d6ad23eefa 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -1,6 +1,8 @@ module tools -go 1.20 +go 1.21 + +toolchain go1.22.0 require ( github.com/alecthomas/kong v0.8.1 diff --git a/tools/go.sum b/tools/go.sum index d4a1fd8b7aa..87c9d843a96 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -1,8 +1,11 @@ github.com/alecthomas/assert/v2 v2.1.0 h1:tbredtNcQnoSd3QBhQWI7QZ3XHOVkw1Moklp2ojoH/0= +github.com/alecthomas/assert/v2 v2.1.0/go.mod h1:b/+1DI2Q6NckYi+3mXyH3wFb8qG37K/DuK80n7WefXA= github.com/alecthomas/kong v0.8.1 h1:acZdn3m4lLRobeh3Zi2S2EpnXTd1mOL6U7xVml+vfkY= github.com/alecthomas/kong v0.8.1/go.mod h1:n1iCIO2xS46oE8ZfYCNDqdR0b0wZNrXAIAqro/2132U= github.com/alecthomas/repr v0.1.0 h1:ENn2e1+J3k09gyj2shc0dHr/yjaWSHRlrJ4DPMevDqE= +github.com/alecthomas/repr v0.1.0/go.mod h1:2kn6fqh/zIyPLmm3ugklbEi5hg5wS435eygvNfaDQL8= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/getkin/kin-openapi v0.123.0 h1:zIik0mRwFNLyvtXK274Q6ut+dPh6nlxBp0x7mNrPhs8= github.com/getkin/kin-openapi v0.123.0/go.mod h1:wb1aSZA/iWmorQP9KTAS/phLj/t17B5jT7+fS8ed9NM= github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q= @@ -10,18 +13,22 @@ github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1Rf github.com/go-openapi/swag v0.22.8 h1:/9RjDSQ0vbFR+NyjGMkFTsA1IA0fmhKSThmfGZjicbw= github.com/go-openapi/swag v0.22.8/go.mod h1:6QT22icPLEqAM/z/TChgb4WAveCHF92+2gF0CNjHpPI= github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= +github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= 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/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= +github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= github.com/invopop/yaml v0.2.0 h1:7zky/qH+O0DwAyoobXUqvVBwgBFRxKoQ/3FjcVpjTMY= github.com/invopop/yaml v0.2.0/go.mod h1:2XuRLgs/ouIrW3XNzuNj7J3Nvu/Dig5MXvbCEdiBN3Q= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= @@ -29,14 +36,19 @@ github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwd github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s= github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= +github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From 8bb3d096305926412c890028c5a40adbb97e01ab Mon Sep 17 00:00:00 2001 From: Shervil Gupta <35729671+ShervilG@users.noreply.github.com> Date: Wed, 14 Feb 2024 20:24:52 +0530 Subject: [PATCH 402/751] Add test case for JSON resource marshaling (#3075) --- github/secret_scanning_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/github/secret_scanning_test.go b/github/secret_scanning_test.go index 7898d29a38c..1c8ad82bfcb 100644 --- a/github/secret_scanning_test.go +++ b/github/secret_scanning_test.go @@ -595,3 +595,19 @@ func TestSecretScanningAlertLocationDetails_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestSecretScanningAlertUpdateOptions_Marshal(t *testing.T) { + testJSONMarshal(t, &SecretScanningAlertUpdateOptions{}, `{}`) + + u := &SecretScanningAlertUpdateOptions{ + State: "open", + Resolution: String("false_positive"), + } + + want := `{ + "state": "open", + "resolution": "false_positive" + }` + + testJSONMarshal(t, u, want) +} From a79e405d09613fc0cd2e647ba452a3350f69de94 Mon Sep 17 00:00:00 2001 From: Shervil Gupta <35729671+ShervilG@users.noreply.github.com> Date: Thu, 15 Feb 2024 20:29:20 +0530 Subject: [PATCH 403/751] Add test case for JSON resource marshaling (#3076) --- github/security_advisories_test.go | 169 +++++++++++++++++++++++++++++ 1 file changed, 169 insertions(+) diff --git a/github/security_advisories_test.go b/github/security_advisories_test.go index eb8e7d317d6..0116f0ddbb1 100644 --- a/github/security_advisories_test.go +++ b/github/security_advisories_test.go @@ -1159,3 +1159,172 @@ func TestGetGlobalSecurityAdvisories(t *testing.T) { return resp, err }) } + +func TestSecurityAdvisorySubmission_Marshal(t *testing.T) { + testJSONMarshal(t, &SecurityAdvisorySubmission{}, `{}`) + + u := &SecurityAdvisorySubmission{ + Accepted: Bool(true), + } + + w := `{ + "accepted": true + }` + + testJSONMarshal(t, u, w) +} + +func TestRepoAdvisoryCredit_Marshal(t *testing.T) { + testJSONMarshal(t, &RepoAdvisoryCredit{}, `{}`) + + u := &RepoAdvisoryCredit{ + Login: String("l"), + Type: String("t"), + } + + w := `{ + "login": "l", + "type": "t" + }` + + testJSONMarshal(t, u, w) +} + +func TestRepoAdvisoryCreditDetailed_Marshal(t *testing.T) { + testJSONMarshal(t, &RepoAdvisoryCreditDetailed{}, `{}`) + + testDate := &Timestamp{time.Date(2019, time.August, 10, 14, 59, 22, 0, time.UTC)} + u := &RepoAdvisoryCreditDetailed{ + Type: String("t"), + State: String("s"), + User: &User{ + Name: String("u"), + Company: String("c"), + Blog: String("b"), + Location: String("l"), + Email: String("e"), + Hireable: Bool(false), + Bio: String("bio"), + TwitterUsername: String("tu"), + PublicRepos: Int(1), + PublicGists: Int(1), + Followers: Int(2), + Following: Int(2), + CreatedAt: testDate, + UpdatedAt: testDate, + SuspendedAt: testDate, + Type: String("type"), + SiteAdmin: Bool(false), + TotalPrivateRepos: Int64(10), + OwnedPrivateRepos: Int64(10), + PrivateGists: Int(10), + DiskUsage: Int(10), + Collaborators: Int(10), + TwoFactorAuthentication: Bool(true), + Plan: &Plan{ + Name: String("p"), + Space: Int(2), + Collaborators: Int(2), + PrivateRepos: Int64(2), + Seats: Int(2), + FilledSeats: Int(1), + }, + LdapDn: String("l"), + URL: String("url"), + EventsURL: String("e"), + FollowingURL: String("f"), + FollowersURL: String("f"), + GistsURL: String("g"), + OrganizationsURL: String("o"), + ReceivedEventsURL: String("r"), + ReposURL: String("rep"), + StarredURL: String("star"), + SubscriptionsURL: String("sub"), + TextMatches: []*TextMatch{ + { + ObjectURL: String("u"), + ObjectType: String("t"), + Property: String("p"), + Fragment: String("f"), + Matches: []*Match{ + { + Text: String("t"), + Indices: []int{1, 2}, + }, + }, + }, + }, + Permissions: map[string]bool{"p1": true}, + RoleName: String("r"), + }, + } + + w := `{ + "type": "t", + "state": "s", + "user": { + "name": "u", + "company": "c", + "blog": "b", + "location": "l", + "email": "e", + "hireable": false, + "bio": "bio", + "twitter_username": "tu", + "public_repos": 1, + "public_gists": 1, + "followers": 2, + "following": 2, + "created_at": "2019-08-10T14:59:22Z", + "updated_at": "2019-08-10T14:59:22Z", + "suspended_at": "2019-08-10T14:59:22Z", + "type": "type", + "site_admin": false, + "total_private_repos": 10, + "owned_private_repos": 10, + "private_gists": 10, + "disk_usage": 10, + "collaborators": 10, + "two_factor_authentication": true, + "plan": { + "name": "p", + "space": 2, + "collaborators": 2, + "private_repos": 2, + "seats": 2, + "filled_seats": 1 + }, + "ldap_dn": "l", + "url": "url", + "events_url": "e", + "following_url": "f", + "followers_url": "f", + "gists_url": "g", + "organizations_url": "o", + "received_events_url": "r", + "repos_url": "rep", + "starred_url": "star", + "subscriptions_url": "sub", + "text_matches": [ + { + "object_url": "u", + "object_type": "t", + "property": "p", + "fragment": "f", + "matches": [ + { + "text": "t", + "indices": [1, 2] + } + ] + } + ], + "permissions": { + "p1": true + }, + "role_name": "r" + } + }` + + testJSONMarshal(t, u, w) +} From 5bf78f8b6b3ea99c8073df6b8d2875441851694f Mon Sep 17 00:00:00 2001 From: Florian Maier Date: Thu, 15 Feb 2024 21:51:22 +0100 Subject: [PATCH 404/751] Rename function parameters to match usage as url parameters (#3078) --- github/actions_runners.go | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/github/actions_runners.go b/github/actions_runners.go index 90cf5804e1e..c5c90279df5 100644 --- a/github/actions_runners.go +++ b/github/actions_runners.go @@ -63,8 +63,8 @@ type JITRunnerConfig struct { // GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-organization // //meta:operation POST /orgs/{org}/actions/runners/generate-jitconfig -func (s *ActionsService) GenerateOrgJITConfig(ctx context.Context, owner string, request *GenerateJITConfigRequest) (*JITRunnerConfig, *Response, error) { - u := fmt.Sprintf("orgs/%v/actions/runners/generate-jitconfig", owner) +func (s *ActionsService) GenerateOrgJITConfig(ctx context.Context, org string, request *GenerateJITConfigRequest) (*JITRunnerConfig, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/runners/generate-jitconfig", org) req, err := s.client.NewRequest("POST", u, request) if err != nil { return nil, nil, err @@ -247,8 +247,8 @@ func (s *ActionsService) RemoveRunner(ctx context.Context, owner, repo string, r // GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-an-organization // //meta:operation GET /orgs/{org}/actions/runners/downloads -func (s *ActionsService) ListOrganizationRunnerApplicationDownloads(ctx context.Context, owner string) ([]*RunnerApplicationDownload, *Response, error) { - u := fmt.Sprintf("orgs/%v/actions/runners/downloads", owner) +func (s *ActionsService) ListOrganizationRunnerApplicationDownloads(ctx context.Context, org string) ([]*RunnerApplicationDownload, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/runners/downloads", org) req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err @@ -268,8 +268,8 @@ func (s *ActionsService) ListOrganizationRunnerApplicationDownloads(ctx context. // GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-an-organization // //meta:operation POST /orgs/{org}/actions/runners/registration-token -func (s *ActionsService) CreateOrganizationRegistrationToken(ctx context.Context, owner string) (*RegistrationToken, *Response, error) { - u := fmt.Sprintf("orgs/%v/actions/runners/registration-token", owner) +func (s *ActionsService) CreateOrganizationRegistrationToken(ctx context.Context, org string) (*RegistrationToken, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/runners/registration-token", org) req, err := s.client.NewRequest("POST", u, nil) if err != nil { @@ -290,8 +290,8 @@ func (s *ActionsService) CreateOrganizationRegistrationToken(ctx context.Context // GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-organization // //meta:operation GET /orgs/{org}/actions/runners -func (s *ActionsService) ListOrganizationRunners(ctx context.Context, owner string, opts *ListOptions) (*Runners, *Response, error) { - u := fmt.Sprintf("orgs/%v/actions/runners", owner) +func (s *ActionsService) ListOrganizationRunners(ctx context.Context, org string, opts *ListOptions) (*Runners, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/runners", org) u, err := addOptions(u, opts) if err != nil { return nil, nil, err @@ -316,8 +316,8 @@ func (s *ActionsService) ListOrganizationRunners(ctx context.Context, owner stri // GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-organization // //meta:operation GET /orgs/{org}/actions/runners/{runner_id} -func (s *ActionsService) GetOrganizationRunner(ctx context.Context, owner string, runnerID int64) (*Runner, *Response, error) { - u := fmt.Sprintf("orgs/%v/actions/runners/%v", owner, runnerID) +func (s *ActionsService) GetOrganizationRunner(ctx context.Context, org string, runnerID int64) (*Runner, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/runners/%v", org, runnerID) req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err @@ -337,8 +337,8 @@ func (s *ActionsService) GetOrganizationRunner(ctx context.Context, owner string // GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-an-organization // //meta:operation POST /orgs/{org}/actions/runners/remove-token -func (s *ActionsService) CreateOrganizationRemoveToken(ctx context.Context, owner string) (*RemoveToken, *Response, error) { - u := fmt.Sprintf("orgs/%v/actions/runners/remove-token", owner) +func (s *ActionsService) CreateOrganizationRemoveToken(ctx context.Context, org string) (*RemoveToken, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/runners/remove-token", org) req, err := s.client.NewRequest("POST", u, nil) if err != nil { @@ -359,8 +359,8 @@ func (s *ActionsService) CreateOrganizationRemoveToken(ctx context.Context, owne // GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-organization // //meta:operation DELETE /orgs/{org}/actions/runners/{runner_id} -func (s *ActionsService) RemoveOrganizationRunner(ctx context.Context, owner string, runnerID int64) (*Response, error) { - u := fmt.Sprintf("orgs/%v/actions/runners/%v", owner, runnerID) +func (s *ActionsService) RemoveOrganizationRunner(ctx context.Context, org string, runnerID int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/actions/runners/%v", org, runnerID) req, err := s.client.NewRequest("DELETE", u, nil) if err != nil { From 454c1ddaeb85aa3caba66b7cd21ca24b6a2e311d Mon Sep 17 00:00:00 2001 From: Shervil Gupta <35729671+ShervilG@users.noreply.github.com> Date: Fri, 16 Feb 2024 23:04:01 +0530 Subject: [PATCH 405/751] Add test case for JSON resource marshaling (#3080) --- github/security_advisories_test.go | 386 +++++++++++++++++++++++++++++ 1 file changed, 386 insertions(+) diff --git a/github/security_advisories_test.go b/github/security_advisories_test.go index 0116f0ddbb1..b43ef7f990a 100644 --- a/github/security_advisories_test.go +++ b/github/security_advisories_test.go @@ -1328,3 +1328,389 @@ func TestRepoAdvisoryCreditDetailed_Marshal(t *testing.T) { testJSONMarshal(t, u, w) } + +func TestCredit_Marshal(t *testing.T) { + testJSONMarshal(t, &Credit{}, `{}`) + + testDate := &Timestamp{time.Date(2019, time.August, 10, 14, 59, 22, 0, time.UTC)} + u := &Credit{ + Type: String("t"), + User: &User{ + Name: String("u"), + Company: String("c"), + Blog: String("b"), + Location: String("l"), + Email: String("e"), + Hireable: Bool(false), + Bio: String("bio"), + TwitterUsername: String("tu"), + PublicRepos: Int(1), + PublicGists: Int(1), + Followers: Int(2), + Following: Int(2), + CreatedAt: testDate, + UpdatedAt: testDate, + SuspendedAt: testDate, + Type: String("type"), + SiteAdmin: Bool(false), + TotalPrivateRepos: Int64(10), + OwnedPrivateRepos: Int64(10), + PrivateGists: Int(10), + DiskUsage: Int(10), + Collaborators: Int(10), + TwoFactorAuthentication: Bool(true), + Plan: &Plan{ + Name: String("p"), + Space: Int(2), + Collaborators: Int(2), + PrivateRepos: Int64(2), + Seats: Int(2), + FilledSeats: Int(1), + }, + LdapDn: String("l"), + URL: String("url"), + EventsURL: String("e"), + FollowingURL: String("f"), + FollowersURL: String("f"), + GistsURL: String("g"), + OrganizationsURL: String("o"), + ReceivedEventsURL: String("r"), + ReposURL: String("rep"), + StarredURL: String("star"), + SubscriptionsURL: String("sub"), + TextMatches: []*TextMatch{ + { + ObjectURL: String("u"), + ObjectType: String("t"), + Property: String("p"), + Fragment: String("f"), + Matches: []*Match{ + { + Text: String("t"), + Indices: []int{1, 2}, + }, + }, + }, + }, + Permissions: map[string]bool{"p1": true}, + RoleName: String("r"), + }, + } + + w := `{ + "type": "t", + "user": { + "name": "u", + "company": "c", + "blog": "b", + "location": "l", + "email": "e", + "hireable": false, + "bio": "bio", + "twitter_username": "tu", + "public_repos": 1, + "public_gists": 1, + "followers": 2, + "following": 2, + "created_at": "2019-08-10T14:59:22Z", + "updated_at": "2019-08-10T14:59:22Z", + "suspended_at": "2019-08-10T14:59:22Z", + "type": "type", + "site_admin": false, + "total_private_repos": 10, + "owned_private_repos": 10, + "private_gists": 10, + "disk_usage": 10, + "collaborators": 10, + "two_factor_authentication": true, + "plan": { + "name": "p", + "space": 2, + "collaborators": 2, + "private_repos": 2, + "seats": 2, + "filled_seats": 1 + }, + "ldap_dn": "l", + "url": "url", + "events_url": "e", + "following_url": "f", + "followers_url": "f", + "gists_url": "g", + "organizations_url": "o", + "received_events_url": "r", + "repos_url": "rep", + "starred_url": "star", + "subscriptions_url": "sub", + "text_matches": [ + { + "object_url": "u", + "object_type": "t", + "property": "p", + "fragment": "f", + "matches": [ + { + "text": "t", + "indices": [1, 2] + } + ] + } + ], + "permissions": { + "p1": true + }, + "role_name": "r" + } + }` + + testJSONMarshal(t, u, w) +} + +func TestGlobalSecurityAdvisory_Marshal(t *testing.T) { + testJSONMarshal(t, &GlobalSecurityAdvisory{}, `{}`) + + testDate := &Timestamp{time.Date(2019, time.August, 10, 14, 59, 22, 0, time.UTC)} + u := &GlobalSecurityAdvisory{ + ID: Int64(1), + RepositoryAdvisoryURL: String("r"), + Type: String("t"), + SourceCodeLocation: String("s"), + References: []string{"r"}, + Vulnerabilities: []*GlobalSecurityVulnerability{ + { + Package: &VulnerabilityPackage{ + Ecosystem: String("npm"), + Name: String("a-package"), + }, + FirstPatchedVersion: String("1.0.3"), + VulnerableVersionRange: String("<=1.0.2"), + VulnerableFunctions: []string{"a_function"}, + }, + }, + GithubReviewedAt: testDate, + NVDPublishedAt: testDate, + Credits: []*Credit{ + { + Type: String("t"), + User: &User{ + Name: String("u"), + Company: String("c"), + Blog: String("b"), + Location: String("l"), + Email: String("e"), + Hireable: Bool(false), + Bio: String("bio"), + TwitterUsername: String("tu"), + PublicRepos: Int(1), + PublicGists: Int(1), + Followers: Int(2), + Following: Int(2), + CreatedAt: testDate, + UpdatedAt: testDate, + SuspendedAt: testDate, + Type: String("type"), + SiteAdmin: Bool(false), + TotalPrivateRepos: Int64(10), + OwnedPrivateRepos: Int64(10), + PrivateGists: Int(10), + DiskUsage: Int(10), + Collaborators: Int(10), + TwoFactorAuthentication: Bool(true), + Plan: &Plan{ + Name: String("p"), + Space: Int(2), + Collaborators: Int(2), + PrivateRepos: Int64(2), + Seats: Int(2), + FilledSeats: Int(1), + }, + LdapDn: String("l"), + URL: String("url"), + EventsURL: String("e"), + FollowingURL: String("f"), + FollowersURL: String("f"), + GistsURL: String("g"), + OrganizationsURL: String("o"), + ReceivedEventsURL: String("r"), + ReposURL: String("rep"), + StarredURL: String("star"), + SubscriptionsURL: String("sub"), + TextMatches: []*TextMatch{ + { + ObjectURL: String("u"), + ObjectType: String("t"), + Property: String("p"), + Fragment: String("f"), + Matches: []*Match{ + { + Text: String("t"), + Indices: []int{1, 2}, + }, + }, + }, + }, + Permissions: map[string]bool{"p1": true}, + RoleName: String("r"), + }, + }, + }, + SecurityAdvisory: SecurityAdvisory{ + GHSAID: String("GHSA-xoxo-1234-xoxo"), + CVEID: String("CVE-xoxo-1234"), + URL: String("https://api.github.com/advisories/GHSA-xoxo-1234-xoxo"), + HTMLURL: String("https://github.com/advisories/GHSA-xoxo-1234-xoxo"), + Severity: String("high"), + Summary: String("Heartbleed security advisory"), + Description: String("This bug allows an attacker to read portions of the affected server’s memory, potentially disclosing sensitive information."), + Identifiers: []*AdvisoryIdentifier{ + { + Type: String("GHSA"), + Value: String("GHSA-xoxo-1234-xoxo"), + }, + { + Type: String("CVE"), + Value: String("CVE-xoxo-1234"), + }, + }, + PublishedAt: testDate, + UpdatedAt: testDate, + WithdrawnAt: nil, + CVSS: &AdvisoryCVSS{ + VectorString: String("CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:H"), + Score: Float64(7.6), + }, + CWEs: []*AdvisoryCWEs{ + { + CWEID: String("CWE-400"), + Name: String("Uncontrolled Resource Consumption"), + }, + }, + }, + } + + w := `{ + "cvss": { + "score": 7.6, + "vector_string": "CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:H" + }, + "cwes": [ + { + "cwe_id": "CWE-400", + "name": "Uncontrolled Resource Consumption" + } + ], + "ghsa_id": "GHSA-xoxo-1234-xoxo", + "summary": "Heartbleed security advisory", + "description": "This bug allows an attacker to read portions of the affected server’s memory, potentially disclosing sensitive information.", + "severity": "high", + "identifiers": [ + { + "value": "GHSA-xoxo-1234-xoxo", + "type": "GHSA" + }, + { + "value": "CVE-xoxo-1234", + "type": "CVE" + } + ], + "published_at": "2019-08-10T14:59:22Z", + "updated_at": "2019-08-10T14:59:22Z", + "cve_id": "CVE-xoxo-1234", + "url": "https://api.github.com/advisories/GHSA-xoxo-1234-xoxo", + "html_url": "https://github.com/advisories/GHSA-xoxo-1234-xoxo", + "id": 1, + "repository_advisory_url": "r", + "type": "t", + "source_code_location": "s", + "references": [ + "r" + ], + "vulnerabilities": [ + { + "package": { + "ecosystem": "npm", + "name": "a-package" + }, + "first_patched_version": "1.0.3", + "vulnerable_version_range": "\u003c=1.0.2", + "vulnerable_functions": [ + "a_function" + ] + } + ], + "github_reviewed_at": "2019-08-10T14:59:22Z", + "nvd_published_at": "2019-08-10T14:59:22Z", + "credits": [ + { + "user": { + "name": "u", + "company": "c", + "blog": "b", + "location": "l", + "email": "e", + "hireable": false, + "bio": "bio", + "twitter_username": "tu", + "public_repos": 1, + "public_gists": 1, + "followers": 2, + "following": 2, + "created_at": "2019-08-10T14:59:22Z", + "updated_at": "2019-08-10T14:59:22Z", + "suspended_at": "2019-08-10T14:59:22Z", + "type": "type", + "site_admin": false, + "total_private_repos": 10, + "owned_private_repos": 10, + "private_gists": 10, + "disk_usage": 10, + "collaborators": 10, + "two_factor_authentication": true, + "plan": { + "name": "p", + "space": 2, + "collaborators": 2, + "private_repos": 2, + "filled_seats": 1, + "seats": 2 + }, + "ldap_dn": "l", + "url": "url", + "events_url": "e", + "following_url": "f", + "followers_url": "f", + "gists_url": "g", + "organizations_url": "o", + "received_events_url": "r", + "repos_url": "rep", + "starred_url": "star", + "subscriptions_url": "sub", + "text_matches": [ + { + "object_url": "u", + "object_type": "t", + "property": "p", + "fragment": "f", + "matches": [ + { + "text": "t", + "indices": [ + 1, + 2 + ] + } + ] + } + ], + "permissions": { + "p1": true + }, + "role_name": "r" + }, + "type": "t" + } + ] + }` + + testJSONMarshal(t, u, w) +} From 73422173c6336ad014ce14c9113477bea3339187 Mon Sep 17 00:00:00 2001 From: Francesco Giordano <73994521+himazawa@users.noreply.github.com> Date: Sat, 17 Feb 2024 16:10:21 +0100 Subject: [PATCH 406/751] feat!: Change Hook.Config field from map to *HookConfig (#3073) Fixes: #3072. BREAKING CHANGE: Changes `Hook.Config` from `map[string]interface{}` to `*HookConfig`. --- github/event_types_test.go | 10 +++++++--- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 7 +++++++ github/github-stringify_test.go | 3 ++- github/orgs_audit_log.go | 10 ---------- github/repos_hooks.go | 14 +++++++------- github/repos_hooks_configuration.go | 15 +++++++++++++++ github/repos_hooks_test.go | 12 ++++-------- 8 files changed, 50 insertions(+), 29 deletions(-) diff --git a/github/event_types_test.go b/github/event_types_test.go index 8578b922bf6..b00e94a34e4 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -7691,6 +7691,7 @@ func TestPingEvent_Marshal(t *testing.T) { l := make(map[string]interface{}) l["key"] = "value" + hookConfig := new(HookConfig) u := &PingEvent{ Zen: String("z"), @@ -7705,7 +7706,7 @@ func TestPingEvent_Marshal(t *testing.T) { TestURL: String("tu"), PingURL: String("pu"), LastResponse: l, - Config: l, + Config: hookConfig, Events: []string{"a"}, Active: Bool(true), }, @@ -12165,6 +12166,9 @@ func TestMetaEvent_Marshal(t *testing.T) { v := make(map[string]interface{}) v["a"] = "b" + hookConfig := &HookConfig{ + ContentType: String("json"), + } u := &MetaEvent{ Action: String("a"), @@ -12179,7 +12183,7 @@ func TestMetaEvent_Marshal(t *testing.T) { TestURL: String("tu"), PingURL: String("pu"), LastResponse: v, - Config: v, + Config: hookConfig, Events: []string{"a"}, Active: Bool(true), }, @@ -12201,7 +12205,7 @@ func TestMetaEvent_Marshal(t *testing.T) { "a": "b" }, "config": { - "a": "b" + "content_type": "json" }, "events": [ "a" diff --git a/github/github-accessors.go b/github/github-accessors.go index b645390e83a..89728d38df9 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -7894,6 +7894,14 @@ func (h *Hook) GetActive() bool { return *h.Active } +// GetConfig returns the Config field. +func (h *Hook) GetConfig() *HookConfig { + if h == nil { + return nil + } + return h.Config +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (h *Hook) GetCreatedAt() Timestamp { if h == nil || h.CreatedAt == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 8d5b438054d..1dcb4dc2bb9 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -9229,6 +9229,13 @@ func TestHook_GetActive(tt *testing.T) { h.GetActive() } +func TestHook_GetConfig(tt *testing.T) { + h := &Hook{} + h.GetConfig() + h = nil + h.GetConfig() +} + func TestHook_GetCreatedAt(tt *testing.T) { var zeroValue Timestamp h := &Hook{CreatedAt: &zeroValue} diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index bb69ce1ad5a..576db8ff29a 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -617,10 +617,11 @@ func TestHook_String(t *testing.T) { Name: String(""), TestURL: String(""), PingURL: String(""), + Config: &HookConfig{}, Events: []string{""}, Active: Bool(false), } - want := `github.Hook{CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, URL:"", ID:0, Type:"", Name:"", TestURL:"", PingURL:"", Events:[""], Active:false}` + want := `github.Hook{CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, URL:"", ID:0, Type:"", Name:"", TestURL:"", PingURL:"", Config:github.HookConfig{}, Events:[""], Active:false}` if got := v.String(); got != want { t.Errorf("Hook.String = %v, want %v", got, want) } diff --git a/github/orgs_audit_log.go b/github/orgs_audit_log.go index 28ac079bb3b..025c5d02327 100644 --- a/github/orgs_audit_log.go +++ b/github/orgs_audit_log.go @@ -20,16 +20,6 @@ type GetAuditLogOptions struct { ListCursorOptions } -// HookConfig describes metadata about a webhook configuration. -type HookConfig struct { - ContentType *string `json:"content_type,omitempty"` - InsecureSSL *string `json:"insecure_ssl,omitempty"` - URL *string `json:"url,omitempty"` - - // Secret is returned obfuscated by GitHub, but it can be set for outgoing requests. - Secret *string `json:"secret,omitempty"` -} - // ActorLocation contains information about reported location for an actor. type ActorLocation struct { CountryCode *string `json:"country_code,omitempty"` diff --git a/github/repos_hooks.go b/github/repos_hooks.go index 3edf6475666..d221db21b6b 100644 --- a/github/repos_hooks.go +++ b/github/repos_hooks.go @@ -51,9 +51,9 @@ type Hook struct { // Only the following fields are used when creating a hook. // Config is required. - Config map[string]interface{} `json:"config,omitempty"` - Events []string `json:"events,omitempty"` - Active *bool `json:"active,omitempty"` + Config *HookConfig `json:"config,omitempty"` + Events []string `json:"events,omitempty"` + Active *bool `json:"active,omitempty"` } func (h Hook) String() string { @@ -67,10 +67,10 @@ func (h Hook) String() string { // information. type createHookRequest struct { // Config is required. - Name string `json:"name"` - Config map[string]interface{} `json:"config,omitempty"` - Events []string `json:"events,omitempty"` - Active *bool `json:"active,omitempty"` + Name string `json:"name"` + Config *HookConfig `json:"config,omitempty"` + Events []string `json:"events,omitempty"` + Active *bool `json:"active,omitempty"` } // CreateHook creates a Hook for the specified repository. diff --git a/github/repos_hooks_configuration.go b/github/repos_hooks_configuration.go index b58eb248e44..9560bd7a4ba 100644 --- a/github/repos_hooks_configuration.go +++ b/github/repos_hooks_configuration.go @@ -10,6 +10,21 @@ import ( "fmt" ) +// HookConfig describes metadata about a webhook configuration. +type HookConfig struct { + // The media type used to serialize the payloads + // Possible values are `json` and `form`, the field is not specified the default is `form` + ContentType *string `json:"content_type,omitempty"` + // The possible values are 0 and 1. + // Setting it to 1 will allow skip certificate verification for the host, + // potentially exposing to MitM attacks: https://en.wikipedia.org/wiki/Man-in-the-middle_attack + InsecureSSL *string `json:"insecure_ssl,omitempty"` + URL *string `json:"url,omitempty"` + + // Secret is returned obfuscated by GitHub, but it can be set for outgoing requests. + Secret *string `json:"secret,omitempty"` +} + // GetHookConfiguration returns the configuration for the specified repository webhook. // // GitHub API docs: https://docs.github.com/rest/repos/webhooks#get-a-webhook-configuration-for-a-repository diff --git a/github/repos_hooks_test.go b/github/repos_hooks_test.go index fa44440ade0..bda277af735 100644 --- a/github/repos_hooks_test.go +++ b/github/repos_hooks_test.go @@ -502,9 +502,7 @@ func TestBranchCreateHookRequest_Marshal(t *testing.T) { Name: "abc", Events: []string{"1", "2", "3"}, Active: Bool(true), - Config: map[string]interface{}{ - "thing": "@123", - }, + Config: &HookConfig{ContentType: String("json")}, } want := `{ @@ -512,7 +510,7 @@ func TestBranchCreateHookRequest_Marshal(t *testing.T) { "active": true, "events": ["1","2","3"], "config":{ - "thing": "@123" + "content_type": "json" } }` @@ -534,9 +532,7 @@ func TestBranchHook_Marshal(t *testing.T) { LastResponse: map[string]interface{}{ "item": "item", }, - Config: map[string]interface{}{ - "thing": "@123", - }, + Config: &HookConfig{ContentType: String("json")}, Events: []string{"1", "2", "3"}, Active: Bool(true), } @@ -554,7 +550,7 @@ func TestBranchHook_Marshal(t *testing.T) { "item": "item" }, "config":{ - "thing": "@123" + "content_type": "json" }, "events": ["1","2","3"], "active": true From c066426738317917d55c7efbbde29f8213427fc7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Feb 2024 15:49:43 -0500 Subject: [PATCH 407/751] Bump github.com/PuerkitoBio/goquery from 1.8.1 to 1.9.0 in /scrape (#3085) --- scrape/go.mod | 2 +- scrape/go.sum | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 260a0414972..a59c0619622 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -3,7 +3,7 @@ module github.com/google/go-github/scrape go 1.13 require ( - github.com/PuerkitoBio/goquery v1.8.1 + github.com/PuerkitoBio/goquery v1.9.0 github.com/google/go-cmp v0.6.0 github.com/google/go-github/v59 v59.0.0 github.com/xlzd/gotp v0.1.0 diff --git a/scrape/go.sum b/scrape/go.sum index 8eee238637c..452c976d664 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -1,7 +1,7 @@ -github.com/PuerkitoBio/goquery v1.8.1 h1:uQxhNlArOIdbrH1tr0UXwdVFgDcZDrZVdcpygAcwmWM= -github.com/PuerkitoBio/goquery v1.8.1/go.mod h1:Q8ICL1kNUJ2sXGoAhPGUdYDJvgQgHzJsnnd3H7Ho5jQ= -github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c= -github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA= +github.com/PuerkitoBio/goquery v1.9.0 h1:zgjKkdpRY9T97Q5DCtcXwfqkcylSFIVCocZmn2huTp8= +github.com/PuerkitoBio/goquery v1.9.0/go.mod h1:cW1n6TmIMDoORQU5IU/P1T3tGFunOeXEpGP2WHRwkbY= +github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsViSLyss= +github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -19,10 +19,9 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91 golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= @@ -31,21 +30,21 @@ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= From 4f323e5388007d9ee6e19cf9f57ec994574698a4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Feb 2024 15:50:17 -0500 Subject: [PATCH 408/751] Bump codecov/codecov-action from 4.0.1 to 4.0.2 (#3084) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d789c811c14..cf6f7ec284c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -73,4 +73,4 @@ jobs: - name: Upload coverage to Codecov if: ${{ matrix.update-coverage }} - uses: codecov/codecov-action@e0b68c6749509c5f83f984dd99a76a1c1a231044 #v4.0.1 + uses: codecov/codecov-action@0cfda1dd0a4ad9efc75517f399d859cd1ea4ced1 #v4.0.2 From ffe505198ca42c56e8c2232928a040a6d0f5b31f Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Thu, 29 Feb 2024 12:16:23 -0500 Subject: [PATCH 409/751] Bump version of go-github to v60.0.0 (#3086) --- README.md | 15 ++++++++------- example/actionpermissions/main.go | 2 +- example/appengine/app.go | 2 +- example/basicauth/main.go | 2 +- .../codespaces/newreposecretwithxcrypto/main.go | 2 +- .../codespaces/newusersecretwithxcrypto/main.go | 2 +- example/commitpr/main.go | 2 +- example/go.mod | 6 +++--- example/listenvironments/main.go | 2 +- example/migrations/main.go | 2 +- example/newfilewithappauth/main.go | 2 +- example/newrepo/main.go | 2 +- example/newreposecretwithlibsodium/go.mod | 4 ++-- example/newreposecretwithlibsodium/main.go | 2 +- example/newreposecretwithxcrypto/main.go | 2 +- example/ratelimit/main.go | 2 +- example/simple/main.go | 2 +- example/tagprotection/main.go | 2 +- example/tokenauth/main.go | 2 +- example/topics/main.go | 2 +- github/doc.go | 2 +- github/examples_test.go | 2 +- github/github.go | 2 +- go.mod | 2 +- test/fields/fields.go | 2 +- test/integration/activity_test.go | 2 +- test/integration/authorizations_test.go | 2 +- test/integration/github_test.go | 2 +- test/integration/repos_test.go | 2 +- test/integration/users_test.go | 2 +- tools/go.mod | 4 ++-- tools/metadata/main.go | 2 +- tools/metadata/main_test.go | 2 +- tools/metadata/metadata.go | 2 +- tools/metadata/openapi.go | 2 +- 35 files changed, 46 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 00407f2d745..f2f1437744b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-github # [![go-github release (latest SemVer)](https://img.shields.io/github/v/release/google/go-github?sort=semver)](https://github.com/google/go-github/releases) -[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v59/github) +[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v60/github) [![Test Status](https://github.com/google/go-github/workflows/tests/badge.svg)](https://github.com/google/go-github/actions?query=workflow%3Atests) [![Test Coverage](https://codecov.io/gh/google/go-github/branch/master/graph/badge.svg)](https://codecov.io/gh/google/go-github) [![Discuss at go-github@googlegroups.com](https://img.shields.io/badge/discuss-go--github%40googlegroups.com-blue.svg)](https://groups.google.com/group/go-github) @@ -24,7 +24,7 @@ If you're interested in using the [GraphQL API v4][], the recommended library is go-github is compatible with modern Go releases in module mode, with Go installed: ```bash -go get github.com/google/go-github/v59 +go get github.com/google/go-github/v60 ``` will resolve and add the package to the current development module, along with its dependencies. @@ -32,7 +32,7 @@ will resolve and add the package to the current development module, along with i Alternatively the same can be achieved if you use import in a package: ```go -import "github.com/google/go-github/v59/github" +import "github.com/google/go-github/v60/github" ``` and run `go get` without parameters. @@ -40,13 +40,13 @@ and run `go get` without parameters. Finally, to use the top-of-trunk version of this repo, use the following command: ```bash -go get github.com/google/go-github/v59@master +go get github.com/google/go-github/v60@master ``` ## Usage ## ```go -import "github.com/google/go-github/v59/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) +import "github.com/google/go-github/v60/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled ``` @@ -117,7 +117,7 @@ import ( "net/http" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" ) func main() { @@ -296,7 +296,7 @@ For complete usage of go-github, see the full [package docs][]. [GitHub API v3]: https://docs.github.com/en/rest [personal access token]: https://github.com/blog/1509-personal-api-tokens -[package docs]: https://pkg.go.dev/github.com/google/go-github/v59/github +[package docs]: https://pkg.go.dev/github.com/google/go-github/v60/github [GraphQL API v4]: https://developer.github.com/v4/ [shurcooL/githubv4]: https://github.com/shurcooL/githubv4 [GitHub webhook events]: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads @@ -369,6 +369,7 @@ Versions prior to 48.2.0 are not listed. | go-github Version | GitHub v3 API Version | | ----------------- | --------------------- | +| 60.0.0 | 2022-11-28 | | 59.0.0 | 2022-11-28 | | 58.0.0 | 2022-11-28 | | 57.0.0 | 2022-11-28 | diff --git a/example/actionpermissions/main.go b/example/actionpermissions/main.go index f4229a8b8a6..46a541ffa35 100644 --- a/example/actionpermissions/main.go +++ b/example/actionpermissions/main.go @@ -14,7 +14,7 @@ import ( "log" "os" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" ) var ( diff --git a/example/appengine/app.go b/example/appengine/app.go index 2a971c3ce94..e8a578d5fea 100644 --- a/example/appengine/app.go +++ b/example/appengine/app.go @@ -12,7 +12,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" "google.golang.org/appengine" "google.golang.org/appengine/log" ) diff --git a/example/basicauth/main.go b/example/basicauth/main.go index 5145185f851..c5453573a9e 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -21,7 +21,7 @@ import ( "os" "strings" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" "golang.org/x/term" ) diff --git a/example/codespaces/newreposecretwithxcrypto/main.go b/example/codespaces/newreposecretwithxcrypto/main.go index 8b4168697de..9fffd8fbcb7 100644 --- a/example/codespaces/newreposecretwithxcrypto/main.go +++ b/example/codespaces/newreposecretwithxcrypto/main.go @@ -36,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/codespaces/newusersecretwithxcrypto/main.go b/example/codespaces/newusersecretwithxcrypto/main.go index ed5e42daae5..72256136c40 100644 --- a/example/codespaces/newusersecretwithxcrypto/main.go +++ b/example/codespaces/newusersecretwithxcrypto/main.go @@ -37,7 +37,7 @@ import ( "log" "os" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index f3023619c3c..ffe7aa4529f 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -33,7 +33,7 @@ import ( "time" "github.com/ProtonMail/go-crypto/openpgp" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" ) var ( diff --git a/example/go.mod b/example/go.mod index f3e6883fa1c..17e9dd10f60 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v59/example +module github.com/google/go-github/v60/example go 1.21 @@ -6,7 +6,7 @@ require ( github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-ratelimit v1.0.3 - github.com/google/go-github/v59 v59.0.0 + github.com/google/go-github/v60 v60.0.0 golang.org/x/crypto v0.17.0 golang.org/x/term v0.15.0 google.golang.org/appengine v1.6.7 @@ -24,4 +24,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v59 => ../ +replace github.com/google/go-github/v60 => ../ diff --git a/example/listenvironments/main.go b/example/listenvironments/main.go index b6af06c2ca2..83cff102825 100644 --- a/example/listenvironments/main.go +++ b/example/listenvironments/main.go @@ -18,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" ) func main() { diff --git a/example/migrations/main.go b/example/migrations/main.go index 37b578d4d01..8f3d80943c2 100644 --- a/example/migrations/main.go +++ b/example/migrations/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" ) func fetchAllUserMigrations() ([]*github.UserMigration, error) { diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index 787a60111ac..9754af7b71e 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -16,7 +16,7 @@ import ( "time" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" ) func main() { diff --git a/example/newrepo/main.go b/example/newrepo/main.go index 17681c28704..64f09a8f947 100644 --- a/example/newrepo/main.go +++ b/example/newrepo/main.go @@ -16,7 +16,7 @@ import ( "log" "os" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" ) var ( diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index 07619c05181..138068bca8f 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -6,10 +6,10 @@ toolchain go1.22.0 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb - github.com/google/go-github/v59 v59.0.0 + github.com/google/go-github/v60 v60.0.0 ) require github.com/google/go-querystring v1.1.0 // indirect // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v59 => ../.. +replace github.com/google/go-github/v60 => ../.. diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index 93d6f5be03a..9eb40ac875c 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -36,7 +36,7 @@ import ( "os" sodium "github.com/GoKillers/libsodium-go/cryptobox" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" ) var ( diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index 8fb1b533b3e..660e3004e1e 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -36,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/ratelimit/main.go b/example/ratelimit/main.go index 4728cb504ad..f7f8d1a52fc 100644 --- a/example/ratelimit/main.go +++ b/example/ratelimit/main.go @@ -13,7 +13,7 @@ import ( "fmt" "github.com/gofri/go-github-ratelimit/github_ratelimit" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" ) func main() { diff --git a/example/simple/main.go b/example/simple/main.go index 7df3f927fec..af8c6ae8f78 100644 --- a/example/simple/main.go +++ b/example/simple/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" ) // Fetch all the public organizations' membership of a user. diff --git a/example/tagprotection/main.go b/example/tagprotection/main.go index 825ef7b895b..2dad5a27369 100644 --- a/example/tagprotection/main.go +++ b/example/tagprotection/main.go @@ -18,7 +18,7 @@ import ( "os" "strings" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" "golang.org/x/term" ) diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index e4ed2e7dcab..04c6e5a4ef7 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -15,7 +15,7 @@ import ( "log" "os" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" "golang.org/x/term" ) diff --git a/example/topics/main.go b/example/topics/main.go index c29e0d45bd2..09ae6c203b5 100644 --- a/example/topics/main.go +++ b/example/topics/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" ) // Fetch and lists all the public topics associated with the specified GitHub topic diff --git a/github/doc.go b/github/doc.go index 7bb0d18dff4..1896244d7f0 100644 --- a/github/doc.go +++ b/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v59/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v60/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to diff --git a/github/examples_test.go b/github/examples_test.go index db26615f45d..cb22fecd95b 100644 --- a/github/examples_test.go +++ b/github/examples_test.go @@ -12,7 +12,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" ) func ExampleMarkdownService_Render() { diff --git a/github/github.go b/github/github.go index 805a3fed3da..05c3acd55b7 100644 --- a/github/github.go +++ b/github/github.go @@ -28,7 +28,7 @@ import ( ) const ( - Version = "v59.0.0" + Version = "v60.0.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" diff --git a/go.mod b/go.mod index 32244bfb7d5..b00b053ad8c 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v59 +module github.com/google/go-github/v60 require ( github.com/google/go-cmp v0.6.0 diff --git a/test/fields/fields.go b/test/fields/fields.go index 6be99aa23d1..5dea9bcfd43 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -25,7 +25,7 @@ import ( "reflect" "strings" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" ) var ( diff --git a/test/integration/activity_test.go b/test/integration/activity_test.go index f15a9e6188a..0a9744df1a3 100644 --- a/test/integration/activity_test.go +++ b/test/integration/activity_test.go @@ -12,7 +12,7 @@ import ( "context" "testing" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" ) const ( diff --git a/test/integration/authorizations_test.go b/test/integration/authorizations_test.go index 1942454eb54..f6edbd8aada 100644 --- a/test/integration/authorizations_test.go +++ b/test/integration/authorizations_test.go @@ -15,7 +15,7 @@ import ( "testing" "time" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" ) const msgEnvMissing = "Skipping test because the required environment variable (%v) is not present." diff --git a/test/integration/github_test.go b/test/integration/github_test.go index 4fc8c003070..642cb406ff0 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -15,7 +15,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" ) var ( diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index 9b32cc4a311..9451bf81e52 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -15,7 +15,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" ) func TestRepositories_CRUD(t *testing.T) { diff --git a/test/integration/users_test.go b/test/integration/users_test.go index 21e14c16a7d..0a2d9c8aebe 100644 --- a/test/integration/users_test.go +++ b/test/integration/users_test.go @@ -14,7 +14,7 @@ import ( "math/rand" "testing" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" ) func TestUsers_Get(t *testing.T) { diff --git a/tools/go.mod b/tools/go.mod index 4d6ad23eefa..b9e425c604f 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -8,7 +8,7 @@ require ( github.com/alecthomas/kong v0.8.1 github.com/getkin/kin-openapi v0.123.0 github.com/google/go-cmp v0.6.0 - github.com/google/go-github/v59 v59.0.0 + github.com/google/go-github/v60 v60.0.0 golang.org/x/sync v0.6.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -25,4 +25,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v59 => ../ +replace github.com/google/go-github/v60 => ../ diff --git a/tools/metadata/main.go b/tools/metadata/main.go index a8c597ae00d..9b279fff182 100644 --- a/tools/metadata/main.go +++ b/tools/metadata/main.go @@ -15,7 +15,7 @@ import ( "path/filepath" "github.com/alecthomas/kong" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" ) var helpVars = kong.Vars{ diff --git a/tools/metadata/main_test.go b/tools/metadata/main_test.go index 0d850fb5b30..1118414d12f 100644 --- a/tools/metadata/main_test.go +++ b/tools/metadata/main_test.go @@ -23,7 +23,7 @@ import ( "github.com/alecthomas/kong" "github.com/getkin/kin-openapi/openapi3" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" ) func TestUpdateGo(t *testing.T) { diff --git a/tools/metadata/metadata.go b/tools/metadata/metadata.go index 0818a14202e..4a87603e8d1 100644 --- a/tools/metadata/metadata.go +++ b/tools/metadata/metadata.go @@ -24,7 +24,7 @@ import ( "strings" "sync" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" "gopkg.in/yaml.v3" ) diff --git a/tools/metadata/openapi.go b/tools/metadata/openapi.go index e138e142bd4..ae18b66b258 100644 --- a/tools/metadata/openapi.go +++ b/tools/metadata/openapi.go @@ -14,7 +14,7 @@ import ( "strconv" "github.com/getkin/kin-openapi/openapi3" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" "golang.org/x/sync/errgroup" ) From a25989b0298916f638f33c35429ecda5d6c0850b Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Thu, 29 Feb 2024 12:31:09 -0500 Subject: [PATCH 410/751] Bump go-github from v59 to v60 in /scrape (#3087) --- scrape/apps.go | 2 +- scrape/apps_test.go | 2 +- scrape/go.mod | 11 +++++++++-- scrape/go.sum | 11 ++--------- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/scrape/apps.go b/scrape/apps.go index 5310f88ce62..fcf61588730 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -17,7 +17,7 @@ import ( "strings" "github.com/PuerkitoBio/goquery" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" ) // AppRestrictionsEnabled returns whether the specified organization has diff --git a/scrape/apps_test.go b/scrape/apps_test.go index 8cfbbdb0006..c0a6a751de3 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" ) func Test_AppRestrictionsEnabled(t *testing.T) { diff --git a/scrape/go.mod b/scrape/go.mod index a59c0619622..7a41ce4f1b9 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -1,11 +1,18 @@ module github.com/google/go-github/scrape -go 1.13 +go 1.21 + +toolchain go1.22.0 require ( github.com/PuerkitoBio/goquery v1.9.0 github.com/google/go-cmp v0.6.0 - github.com/google/go-github/v59 v59.0.0 + github.com/google/go-github/v60 v60.0.0 github.com/xlzd/gotp v0.1.0 golang.org/x/net v0.21.0 ) + +require ( + github.com/andybalholm/cascadia v1.3.2 // indirect + github.com/google/go-querystring v1.1.0 // indirect +) diff --git a/scrape/go.sum b/scrape/go.sum index 452c976d664..22a8b903416 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -5,8 +5,8 @@ github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6 github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v59 v59.0.0 h1:7h6bgpF5as0YQLLkEiVqpgtJqjimMYhBkD4jT5aN3VA= -github.com/google/go-github/v59 v59.0.0/go.mod h1:rJU4R0rQHFVFDOkqGWxfLNo6vEk4dv40oDjhV/gH6wM= +github.com/google/go-github/v60 v60.0.0 h1:oLG98PsLauFvvu4D/YPxq374jhSxFYdzQGNCyONLfn8= +github.com/google/go-github/v60 v60.0.0/go.mod h1:ByhX2dP9XT9o/ll2yXAu2VD8l5eNVg8hD4Cr0S/LmQk= 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.1.0 h1:37blvlKCh38s+fkem+fFh7sMnceltoIEBYTVXyoa5Po= @@ -14,7 +14,6 @@ github.com/xlzd/gotp v0.1.0/go.mod h1:ndLJ3JKzi3xLmUProq4LLxCuECL93dG9WASNLpHz8q github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -22,7 +21,6 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -35,20 +33,15 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= From 9bb6bf428d6d02d0c7fdfb9b2e4c51885c76aa51 Mon Sep 17 00:00:00 2001 From: tomfeigin Date: Sun, 3 Mar 2024 15:51:07 +0200 Subject: [PATCH 411/751] Allow querying rule set information by ID with information returned from GetRulesFromBranch (#3089) --- github/repos_rules.go | 10 ++++++++-- github/repos_rules_test.go | 26 ++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/github/repos_rules.go b/github/repos_rules.go index 479806c2ee9..9f4e0245f08 100644 --- a/github/repos_rules.go +++ b/github/repos_rules.go @@ -112,8 +112,11 @@ type RequiredWorkflowsRuleParameters struct { // RepositoryRule represents a GitHub Rule. type RepositoryRule struct { - Type string `json:"type"` - Parameters *json.RawMessage `json:"parameters,omitempty"` + Type string `json:"type"` + Parameters *json.RawMessage `json:"parameters,omitempty"` + RulesetSourceType string `json:"ruleset_source_type"` + RulesetSource string `json:"ruleset_source"` + RulesetID int64 `json:"ruleset_id"` } // UnmarshalJSON implements the json.Unmarshaler interface. @@ -125,6 +128,9 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { return err } + r.RulesetID = RepositoryRule.RulesetID + r.RulesetSourceType = RepositoryRule.RulesetSourceType + r.RulesetSource = RepositoryRule.RulesetSource r.Type = RepositoryRule.Type switch RepositoryRule.Type { diff --git a/github/repos_rules_test.go b/github/repos_rules_test.go index cd8e49c2e07..cbc3e5ce617 100644 --- a/github/repos_rules_test.go +++ b/github/repos_rules_test.go @@ -28,6 +28,20 @@ func TestRepositoryRule_UnmarshalJSON(t *testing.T) { }, wantErr: true, }, + "With Metadata": { + data: `{ + "type": "creation", + "ruleset_source_type": "Repository", + "ruleset_source": "google", + "ruleset_id": 1984 + }`, + want: &RepositoryRule{ + RulesetSource: "google", + RulesetSourceType: "Repository", + RulesetID: 1984, + Type: "creation", + }, + }, "Valid creation": { data: `{"type":"creation"}`, want: NewCreationRule(), @@ -262,9 +276,15 @@ func TestRepositoriesService_GetRulesForBranch(t *testing.T) { testMethod(t, r, "GET") fmt.Fprint(w, `[ { + "ruleset_id": 42069, + "ruleset_source_type": "Repository", + "ruleset_source": "google", "type": "creation" }, { + "ruleset_id": 42069, + "ruleset_source_type": "Organization", + "ruleset_source": "google", "type": "update", "parameters": { "update_allows_fetch_and_merge": true @@ -280,9 +300,15 @@ func TestRepositoriesService_GetRulesForBranch(t *testing.T) { } creationRule := NewCreationRule() + creationRule.RulesetID = 42069 + creationRule.RulesetSource = "google" + creationRule.RulesetSourceType = "Repository" updateRule := NewUpdateRule(&UpdateAllowsFetchAndMergeRuleParameters{ UpdateAllowsFetchAndMerge: true, }) + updateRule.RulesetID = 42069 + updateRule.RulesetSource = "google" + updateRule.RulesetSourceType = "Organization" want := []*RepositoryRule{ creationRule, From f034bcf4a7fd4b68ea475164635bc532a8628015 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Mar 2024 14:17:07 -0500 Subject: [PATCH 412/751] Bump codecov/codecov-action from 4.0.2 to 4.1.0 (#3091) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cf6f7ec284c..fdde6151063 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -73,4 +73,4 @@ jobs: - name: Upload coverage to Codecov if: ${{ matrix.update-coverage }} - uses: codecov/codecov-action@0cfda1dd0a4ad9efc75517f399d859cd1ea4ced1 #v4.0.2 + uses: codecov/codecov-action@54bcd8715eee62d40e33596ef5e8f0f48dbbccab #v4.1.0 From 0e3ab5807f0e9bc6ea690f1b49e94b78259f3681 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Mar 2024 14:28:06 -0500 Subject: [PATCH 413/751] Bump github.com/PuerkitoBio/goquery from 1.9.0 to 1.9.1 in /scrape (#3092) --- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 7a41ce4f1b9..17618d1dbf6 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -5,7 +5,7 @@ go 1.21 toolchain go1.22.0 require ( - github.com/PuerkitoBio/goquery v1.9.0 + github.com/PuerkitoBio/goquery v1.9.1 github.com/google/go-cmp v0.6.0 github.com/google/go-github/v60 v60.0.0 github.com/xlzd/gotp v0.1.0 diff --git a/scrape/go.sum b/scrape/go.sum index 22a8b903416..994ce7f0984 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -1,5 +1,5 @@ -github.com/PuerkitoBio/goquery v1.9.0 h1:zgjKkdpRY9T97Q5DCtcXwfqkcylSFIVCocZmn2huTp8= -github.com/PuerkitoBio/goquery v1.9.0/go.mod h1:cW1n6TmIMDoORQU5IU/P1T3tGFunOeXEpGP2WHRwkbY= +github.com/PuerkitoBio/goquery v1.9.1 h1:mTL6XjbJTZdpfL+Gwl5U2h1l9yEkJjhmlTeV9VPW7UI= +github.com/PuerkitoBio/goquery v1.9.1/go.mod h1:cW1n6TmIMDoORQU5IU/P1T3tGFunOeXEpGP2WHRwkbY= github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsViSLyss= github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= From 2c1b36c92f356f33521a5433477e5eae3f9e94a7 Mon Sep 17 00:00:00 2001 From: Jake Scaltreto Date: Mon, 11 Mar 2024 10:31:34 -0400 Subject: [PATCH 414/751] Add Protection to Branch struct (#3095) --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 7 +++++++ github/repos.go | 8 ++++++++ github/repos_test.go | 14 ++++++++++++-- 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 89728d38df9..18aa42dd672 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -1574,6 +1574,14 @@ func (b *Branch) GetProtected() bool { return *b.Protected } +// GetProtection returns the Protection field. +func (b *Branch) GetProtection() *Protection { + if b == nil { + return nil + } + return b.Protection +} + // GetCommit returns the Commit field. func (b *BranchCommit) GetCommit() *Commit { if b == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 1dcb4dc2bb9..e187cd4aba5 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -1881,6 +1881,13 @@ func TestBranch_GetProtected(tt *testing.T) { b.GetProtected() } +func TestBranch_GetProtection(tt *testing.T) { + b := &Branch{} + b.GetProtection() + b = nil + b.GetProtection() +} + func TestBranchCommit_GetCommit(tt *testing.T) { b := &BranchCommit{} b.GetCommit() diff --git a/github/repos.go b/github/repos.go index 2fb4c6f190a..6fb0030a3b2 100644 --- a/github/repos.go +++ b/github/repos.go @@ -1003,6 +1003,14 @@ type Branch struct { Name *string `json:"name,omitempty"` Commit *RepositoryCommit `json:"commit,omitempty"` Protected *bool `json:"protected,omitempty"` + + // Protection will always be included in APIs which return the + // 'Branch With Protection' schema such as 'Get a branch', but may + // not be included in APIs that return the `Short Branch` schema + // such as 'List branches'. In such cases, if branch protection is + // enabled, Protected will be `true` but this will be nil, and + // additional protection details can be obtained by calling GetBranch(). + Protection *Protection `json:"protection,omitempty"` } // Protection represents a repository branch's protection. diff --git a/github/repos_test.go b/github/repos_test.go index 0ea381ebb56..2b742bef904 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -930,7 +930,7 @@ func TestRepositoriesService_GetBranch(t *testing.T) { for _, test := range tests { mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - fmt.Fprint(w, `{"name":"n", "commit":{"sha":"s","commit":{"message":"m"}}, "protected":true}`) + fmt.Fprint(w, `{"name":"n", "commit":{"sha":"s","commit":{"message":"m"}}, "protected":true, "protection":{"required_status_checks":{"contexts":["c"]}}}`) }) ctx := context.Background() @@ -948,6 +948,11 @@ func TestRepositoriesService_GetBranch(t *testing.T) { }, }, Protected: Bool(true), + Protection: &Protection{ + RequiredStatusChecks: &RequiredStatusChecks{ + Contexts: &[]string{"c"}, + }, + }, } if !cmp.Equal(branch, want) { @@ -1000,7 +1005,7 @@ func TestRepositoriesService_GetBranch_StatusMovedPermanently_followRedirects(t }) mux.HandleFunc("/repos/o/r/branches/br", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - fmt.Fprint(w, `{"name":"n", "commit":{"sha":"s","commit":{"message":"m"}}, "protected":true}`) + fmt.Fprint(w, `{"name":"n", "commit":{"sha":"s","commit":{"message":"m"}}, "protected":true, "protection":{"required_status_checks":{"contexts":["c"]}}}`) }) ctx := context.Background() branch, resp, err := client.Repositories.GetBranch(ctx, "o", "r", "b", 1) @@ -1020,6 +1025,11 @@ func TestRepositoriesService_GetBranch_StatusMovedPermanently_followRedirects(t }, }, Protected: Bool(true), + Protection: &Protection{ + RequiredStatusChecks: &RequiredStatusChecks{ + Contexts: &[]string{"c"}, + }, + }, } if !cmp.Equal(branch, want) { t.Errorf("Repositories.GetBranch returned %+v, want %+v", branch, want) From 145c01b2815eb6963ac8c49c071224f95a869b58 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Mar 2024 20:14:18 -0400 Subject: [PATCH 415/751] Bump github.com/alecthomas/kong from 0.8.1 to 0.9.0 in /tools (#3097) --- tools/go.mod | 2 +- tools/go.sum | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index b9e425c604f..874aa769d2c 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -5,7 +5,7 @@ go 1.21 toolchain go1.22.0 require ( - github.com/alecthomas/kong v0.8.1 + github.com/alecthomas/kong v0.9.0 github.com/getkin/kin-openapi v0.123.0 github.com/google/go-cmp v0.6.0 github.com/google/go-github/v60 v60.0.0 diff --git a/tools/go.sum b/tools/go.sum index 87c9d843a96..ce5b0414f82 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -1,9 +1,9 @@ -github.com/alecthomas/assert/v2 v2.1.0 h1:tbredtNcQnoSd3QBhQWI7QZ3XHOVkw1Moklp2ojoH/0= -github.com/alecthomas/assert/v2 v2.1.0/go.mod h1:b/+1DI2Q6NckYi+3mXyH3wFb8qG37K/DuK80n7WefXA= -github.com/alecthomas/kong v0.8.1 h1:acZdn3m4lLRobeh3Zi2S2EpnXTd1mOL6U7xVml+vfkY= -github.com/alecthomas/kong v0.8.1/go.mod h1:n1iCIO2xS46oE8ZfYCNDqdR0b0wZNrXAIAqro/2132U= -github.com/alecthomas/repr v0.1.0 h1:ENn2e1+J3k09gyj2shc0dHr/yjaWSHRlrJ4DPMevDqE= -github.com/alecthomas/repr v0.1.0/go.mod h1:2kn6fqh/zIyPLmm3ugklbEi5hg5wS435eygvNfaDQL8= +github.com/alecthomas/assert/v2 v2.6.0 h1:o3WJwILtexrEUk3cUVal3oiQY2tfgr/FHWiz/v2n4FU= +github.com/alecthomas/assert/v2 v2.6.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= +github.com/alecthomas/kong v0.9.0 h1:G5diXxc85KvoV2f0ZRVuMsi45IrBgx9zDNGNj165aPA= +github.com/alecthomas/kong v0.9.0/go.mod h1:Y47y5gKfHp1hDc7CH7OeXgLIpp+Q2m1Ni0L5s3bI8Os= +github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc= +github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/getkin/kin-openapi v0.123.0 h1:zIik0mRwFNLyvtXK274Q6ut+dPh6nlxBp0x7mNrPhs8= From f29e3f239cfde8214493d0c0952c375b3952e884 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Mar 2024 20:14:56 -0400 Subject: [PATCH 416/751] Bump golang.org/x/net from 0.21.0 to 0.22.0 in /scrape (#3096) --- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 17618d1dbf6..f48713d021c 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -9,7 +9,7 @@ require ( github.com/google/go-cmp v0.6.0 github.com/google/go-github/v60 v60.0.0 github.com/xlzd/gotp v0.1.0 - golang.org/x/net v0.21.0 + golang.org/x/net v0.22.0 ) require ( diff --git a/scrape/go.sum b/scrape/go.sum index 994ce7f0984..3c8442f6aec 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -21,8 +21,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= +golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= From 169ad4d74d0fad23559bac97d8ad2095999a4f29 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Mar 2024 18:46:39 -0400 Subject: [PATCH 417/751] Bump google.golang.org/protobuf from 1.28.0 to 1.33.0 in /example (#3099) --- example/go.mod | 2 +- example/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/example/go.mod b/example/go.mod index 17e9dd10f60..7a2473934ed 100644 --- a/example/go.mod +++ b/example/go.mod @@ -20,7 +20,7 @@ require ( github.com/google/go-querystring v1.1.0 // indirect golang.org/x/net v0.17.0 // indirect golang.org/x/sys v0.15.0 // indirect - google.golang.org/protobuf v1.28.0 // indirect + google.golang.org/protobuf v1.33.0 // indirect ) // Use version at HEAD, not the latest published. diff --git a/example/go.sum b/example/go.sum index 81f5d70a5b0..d8e05e56537 100644 --- a/example/go.sum +++ b/example/go.sum @@ -82,5 +82,5 @@ google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6 google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= From dbf91ee0f7104df9f5a36e01a0b8b48662f616fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Sal=C3=A9?= Date: Wed, 20 Mar 2024 13:53:47 +0100 Subject: [PATCH 418/751] Add audit log rate limit category and make rate limit category getter public (#3088) --- github/code-scanning_test.go | 2 +- github/enterprise_audit_log_test.go | 2 +- github/github-accessors.go | 8 +++ github/github-accessors_test.go | 7 +++ github/github.go | 59 ++++++++++---------- github/github_test.go | 35 ++++++------ github/orgs_audit_log_test.go | 2 +- github/rate_limit.go | 24 +++++---- github/rate_limit_test.go | 83 ++++++++++++++++++++--------- 9 files changed, 141 insertions(+), 81 deletions(-) diff --git a/github/code-scanning_test.go b/github/code-scanning_test.go index a081a6ba5f1..1edbebae0fa 100644 --- a/github/code-scanning_test.go +++ b/github/code-scanning_test.go @@ -93,7 +93,7 @@ func TestCodeScanningService_UploadSarif(t *testing.T) { return err }) - testNewRequestAndDoFailureCategory(t, methodName, client, codeScanningUploadCategory, func() (*Response, error) { + testNewRequestAndDoFailureCategory(t, methodName, client, CodeScanningUploadCategory, func() (*Response, error) { _, resp, err := client.CodeScanning.UploadSarif(ctx, "o", "r", sarifAnalysis) return resp, err }) diff --git a/github/enterprise_audit_log_test.go b/github/enterprise_audit_log_test.go index 0d9e44a3eb6..1ae94babb75 100644 --- a/github/enterprise_audit_log_test.go +++ b/github/enterprise_audit_log_test.go @@ -84,7 +84,7 @@ func TestEnterpriseService_GetAuditLog(t *testing.T) { return err }) - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + testNewRequestAndDoFailureCategory(t, methodName, client, AuditLogCategory, func() (*Response, error) { got, resp, err := client.Enterprise.GetAuditLog(ctx, "o", &GetAuditLogOptions{}) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) diff --git a/github/github-accessors.go b/github/github-accessors.go index 18aa42dd672..01b81375234 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -17542,6 +17542,14 @@ func (r *RateLimits) GetActionsRunnerRegistration() *Rate { return r.ActionsRunnerRegistration } +// GetAuditLog returns the AuditLog field. +func (r *RateLimits) GetAuditLog() *Rate { + if r == nil { + return nil + } + return r.AuditLog +} + // GetCodeScanningUpload returns the CodeScanningUpload field. func (r *RateLimits) GetCodeScanningUpload() *Rate { if r == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index e187cd4aba5..ba3287351da 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -20317,6 +20317,13 @@ func TestRateLimits_GetActionsRunnerRegistration(tt *testing.T) { r.GetActionsRunnerRegistration() } +func TestRateLimits_GetAuditLog(tt *testing.T) { + r := &RateLimits{} + r.GetAuditLog() + r = nil + r.GetAuditLog() +} + func TestRateLimits_GetCodeScanningUpload(tt *testing.T) { r := &RateLimits{} r.GetCodeScanningUpload() diff --git a/github/github.go b/github/github.go index 05c3acd55b7..bf0b5715a89 100644 --- a/github/github.go +++ b/github/github.go @@ -170,7 +170,7 @@ type Client struct { UserAgent string rateMu sync.Mutex - rateLimits [categories]Rate // Rate limits for the client as determined by the most recent API calls. + rateLimits [Categories]Rate // Rate limits for the client as determined by the most recent API calls. secondaryRateLimitReset time.Time // Secondary rate limit reset for the client as determined by the most recent API calls. common service // Reuse a single struct instead of allocating one for each service on the heap. @@ -821,7 +821,7 @@ func (c *Client) BareDo(ctx context.Context, req *http.Request) (*Response, erro req = withContext(ctx, req) - rateLimitCategory := category(req.Method, req.URL.Path) + rateLimitCategory := GetRateLimitCategory(req.Method, req.URL.Path) if bypass := ctx.Value(bypassRateLimitCheck); bypass == nil { // If we've hit rate limit, don't make further requests before Reset time. @@ -937,7 +937,7 @@ func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*Res // current client state in order to quickly check if *RateLimitError can be immediately returned // from Client.Do, and if so, returns it so that Client.Do can skip making a network API call unnecessarily. // Otherwise it returns nil, and Client.Do should proceed normally. -func (c *Client) checkRateLimitBeforeDo(req *http.Request, rateLimitCategory rateLimitCategory) *RateLimitError { +func (c *Client) checkRateLimitBeforeDo(req *http.Request, rateLimitCategory RateLimitCategory) *RateLimitError { c.rateMu.Lock() rate := c.rateLimits[rateLimitCategory] c.rateMu.Unlock() @@ -1303,65 +1303,70 @@ func parseBoolResponse(err error) (bool, error) { return false, err } -type rateLimitCategory uint8 +type RateLimitCategory uint8 const ( - coreCategory rateLimitCategory = iota - searchCategory - graphqlCategory - integrationManifestCategory - sourceImportCategory - codeScanningUploadCategory - actionsRunnerRegistrationCategory - scimCategory - dependencySnapshotsCategory - codeSearchCategory - - categories // An array of this length will be able to contain all rate limit categories. + CoreCategory RateLimitCategory = iota + SearchCategory + GraphqlCategory + IntegrationManifestCategory + SourceImportCategory + CodeScanningUploadCategory + ActionsRunnerRegistrationCategory + ScimCategory + DependencySnapshotsCategory + CodeSearchCategory + AuditLogCategory + + Categories // An array of this length will be able to contain all rate limit categories. ) -// category returns the rate limit category of the endpoint, determined by HTTP method and Request.URL.Path. -func category(method, path string) rateLimitCategory { +// GetRateLimitCategory returns the rate limit RateLimitCategory of the endpoint, determined by HTTP method and Request.URL.Path. +func GetRateLimitCategory(method, path string) RateLimitCategory { switch { // https://docs.github.com/rest/rate-limit#about-rate-limits default: // NOTE: coreCategory is returned for actionsRunnerRegistrationCategory too, // because no API found for this category. - return coreCategory + return CoreCategory // https://docs.github.com/en/rest/search/search#search-code case strings.HasPrefix(path, "/search/code") && method == http.MethodGet: - return codeSearchCategory + return CodeSearchCategory case strings.HasPrefix(path, "/search/"): - return searchCategory + return SearchCategory case path == "/graphql": - return graphqlCategory + return GraphqlCategory case strings.HasPrefix(path, "/app-manifests/") && strings.HasSuffix(path, "/conversions") && method == http.MethodPost: - return integrationManifestCategory + return IntegrationManifestCategory // https://docs.github.com/rest/migrations/source-imports#start-an-import case strings.HasPrefix(path, "/repos/") && strings.HasSuffix(path, "/import") && method == http.MethodPut: - return sourceImportCategory + return SourceImportCategory // https://docs.github.com/rest/code-scanning#upload-an-analysis-as-sarif-data case strings.HasSuffix(path, "/code-scanning/sarifs"): - return codeScanningUploadCategory + return CodeScanningUploadCategory // https://docs.github.com/enterprise-cloud@latest/rest/scim case strings.HasPrefix(path, "/scim/"): - return scimCategory + return ScimCategory // https://docs.github.com/en/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository case strings.HasPrefix(path, "/repos/") && strings.HasSuffix(path, "/dependency-graph/snapshots") && method == http.MethodPost: - return dependencySnapshotsCategory + return DependencySnapshotsCategory + + // https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/orgs?apiVersion=2022-11-28#get-the-audit-log-for-an-organization + case strings.HasSuffix(path, "/audit-log"): + return AuditLogCategory } } diff --git a/github/github_test.go b/github/github_test.go index 9a369a25fd4..efc42d432fb 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -212,11 +212,11 @@ func testBadOptions(t *testing.T, methodName string, f func() error) { // Method f should be a regular call that would normally succeed, but // should return an error when NewRequest or s.client.Do fails. func testNewRequestAndDoFailure(t *testing.T, methodName string, client *Client, f func() (*Response, error)) { - testNewRequestAndDoFailureCategory(t, methodName, client, coreCategory, f) + testNewRequestAndDoFailureCategory(t, methodName, client, CoreCategory, f) } // testNewRequestAndDoFailureCategory works Like testNewRequestAndDoFailure, but allows setting the category -func testNewRequestAndDoFailureCategory(t *testing.T, methodName string, client *Client, category rateLimitCategory, f func() (*Response, error)) { +func testNewRequestAndDoFailureCategory(t *testing.T, methodName string, client *Client, category RateLimitCategory, f func() (*Response, error)) { t.Helper() if methodName == "" { t.Error("testNewRequestAndDoFailure: must supply method methodName") @@ -1132,68 +1132,73 @@ func TestDo_rateLimitCategory(t *testing.T) { tests := []struct { method string url string - category rateLimitCategory + category RateLimitCategory }{ { method: http.MethodGet, url: "/", - category: coreCategory, + category: CoreCategory, }, { method: http.MethodGet, url: "/search/issues?q=rate", - category: searchCategory, + category: SearchCategory, }, { method: http.MethodGet, url: "/graphql", - category: graphqlCategory, + category: GraphqlCategory, }, { method: http.MethodPost, url: "/app-manifests/code/conversions", - category: integrationManifestCategory, + category: IntegrationManifestCategory, }, { method: http.MethodGet, url: "/app-manifests/code/conversions", - category: coreCategory, // only POST requests are in the integration manifest category + category: CoreCategory, // only POST requests are in the integration manifest category }, { method: http.MethodPut, url: "/repos/google/go-github/import", - category: sourceImportCategory, + category: SourceImportCategory, }, { method: http.MethodGet, url: "/repos/google/go-github/import", - category: coreCategory, // only PUT requests are in the source import category + category: CoreCategory, // only PUT requests are in the source import category }, { method: http.MethodPost, url: "/repos/google/go-github/code-scanning/sarifs", - category: codeScanningUploadCategory, + category: CodeScanningUploadCategory, }, { method: http.MethodGet, url: "/scim/v2/organizations/ORG/Users", - category: scimCategory, + category: ScimCategory, }, { method: http.MethodPost, url: "/repos/google/go-github/dependency-graph/snapshots", - category: dependencySnapshotsCategory, + category: DependencySnapshotsCategory, }, { method: http.MethodGet, url: "/search/code?q=rate", - category: codeSearchCategory, + category: CodeSearchCategory, + }, + { + method: http.MethodGet, + url: "/orgs/google/audit-log", + category: AuditLogCategory, }, // missing a check for actionsRunnerRegistrationCategory: API not found } for _, tt := range tests { - if got, want := category(tt.method, tt.url), tt.category; got != want { + if got, want := GetRateLimitCategory(tt.method, tt.url), tt.category; got != want { t.Errorf("expecting category %v, found %v", got, want) } } diff --git a/github/orgs_audit_log_test.go b/github/orgs_audit_log_test.go index 7c8de74c650..feebd0affc7 100644 --- a/github/orgs_audit_log_test.go +++ b/github/orgs_audit_log_test.go @@ -164,7 +164,7 @@ func TestOrganizationService_GetAuditLog(t *testing.T) { return err }) - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + testNewRequestAndDoFailureCategory(t, methodName, client, AuditLogCategory, func() (*Response, error) { got, resp, err := client.Organizations.GetAuditLog(ctx, "o", &GetAuditLogOptions{}) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) diff --git a/github/rate_limit.go b/github/rate_limit.go index febe5edccfb..5b01b573d8a 100644 --- a/github/rate_limit.go +++ b/github/rate_limit.go @@ -54,6 +54,7 @@ type RateLimits struct { SCIM *Rate `json:"scim"` DependencySnapshots *Rate `json:"dependency_snapshots"` CodeSearch *Rate `json:"code_search"` + AuditLog *Rate `json:"audit_log"` } func (r RateLimits) String() string { @@ -85,34 +86,37 @@ func (s *RateLimitService) Get(ctx context.Context) (*RateLimits, *Response, err if response.Resources != nil { s.client.rateMu.Lock() if response.Resources.Core != nil { - s.client.rateLimits[coreCategory] = *response.Resources.Core + s.client.rateLimits[CoreCategory] = *response.Resources.Core } if response.Resources.Search != nil { - s.client.rateLimits[searchCategory] = *response.Resources.Search + s.client.rateLimits[SearchCategory] = *response.Resources.Search } if response.Resources.GraphQL != nil { - s.client.rateLimits[graphqlCategory] = *response.Resources.GraphQL + s.client.rateLimits[GraphqlCategory] = *response.Resources.GraphQL } if response.Resources.IntegrationManifest != nil { - s.client.rateLimits[integrationManifestCategory] = *response.Resources.IntegrationManifest + s.client.rateLimits[IntegrationManifestCategory] = *response.Resources.IntegrationManifest } if response.Resources.SourceImport != nil { - s.client.rateLimits[sourceImportCategory] = *response.Resources.SourceImport + s.client.rateLimits[SourceImportCategory] = *response.Resources.SourceImport } if response.Resources.CodeScanningUpload != nil { - s.client.rateLimits[codeScanningUploadCategory] = *response.Resources.CodeScanningUpload + s.client.rateLimits[CodeScanningUploadCategory] = *response.Resources.CodeScanningUpload } if response.Resources.ActionsRunnerRegistration != nil { - s.client.rateLimits[actionsRunnerRegistrationCategory] = *response.Resources.ActionsRunnerRegistration + s.client.rateLimits[ActionsRunnerRegistrationCategory] = *response.Resources.ActionsRunnerRegistration } if response.Resources.SCIM != nil { - s.client.rateLimits[scimCategory] = *response.Resources.SCIM + s.client.rateLimits[ScimCategory] = *response.Resources.SCIM } if response.Resources.DependencySnapshots != nil { - s.client.rateLimits[dependencySnapshotsCategory] = *response.Resources.DependencySnapshots + s.client.rateLimits[DependencySnapshotsCategory] = *response.Resources.DependencySnapshots } if response.Resources.CodeSearch != nil { - s.client.rateLimits[codeSearchCategory] = *response.Resources.CodeSearch + s.client.rateLimits[CodeSearchCategory] = *response.Resources.CodeSearch + } + if response.Resources.AuditLog != nil { + s.client.rateLimits[AuditLogCategory] = *response.Resources.AuditLog } s.client.rateMu.Unlock() } diff --git a/github/rate_limit_test.go b/github/rate_limit_test.go index da8a68c9106..6ff87824dda 100644 --- a/github/rate_limit_test.go +++ b/github/rate_limit_test.go @@ -27,8 +27,9 @@ func TestRateLimits_String(t *testing.T) { SCIM: &Rate{}, DependencySnapshots: &Rate{}, CodeSearch: &Rate{}, + AuditLog: &Rate{}, } - want := `github.RateLimits{Core:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, Search:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, GraphQL:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, IntegrationManifest:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, SourceImport:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, CodeScanningUpload:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, ActionsRunnerRegistration:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, SCIM:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, DependencySnapshots:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, CodeSearch:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}}` + want := `github.RateLimits{Core:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, Search:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, GraphQL:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, IntegrationManifest:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, SourceImport:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, CodeScanningUpload:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, ActionsRunnerRegistration:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, SCIM:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, DependencySnapshots:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, CodeSearch:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, AuditLog:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}}` if got := v.String(); got != want { t.Errorf("RateLimits.String = %v, want %v", got, want) } @@ -50,7 +51,8 @@ func TestRateLimits(t *testing.T) { "actions_runner_registration": {"limit":8,"remaining":7,"reset":1372700879}, "scim": {"limit":9,"remaining":8,"reset":1372700880}, "dependency_snapshots": {"limit":10,"remaining":9,"reset":1372700881}, - "code_search": {"limit":11,"remaining":10,"reset":1372700882} + "code_search": {"limit":11,"remaining":10,"reset":1372700882}, + "audit_log": {"limit": 12,"remaining":11,"reset":1372700883} }}`) }) @@ -111,54 +113,63 @@ func TestRateLimits(t *testing.T) { Remaining: 10, Reset: Timestamp{time.Date(2013, time.July, 1, 17, 48, 2, 0, time.UTC).Local()}, }, + AuditLog: &Rate{ + Limit: 12, + Remaining: 11, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 48, 3, 0, time.UTC).Local()}, + }, } if !cmp.Equal(rate, want) { t.Errorf("RateLimits returned %+v, want %+v", rate, want) } tests := []struct { - category rateLimitCategory + category RateLimitCategory rate *Rate }{ { - category: coreCategory, + category: CoreCategory, rate: want.Core, }, { - category: searchCategory, + category: SearchCategory, rate: want.Search, }, { - category: graphqlCategory, + category: GraphqlCategory, rate: want.GraphQL, }, { - category: integrationManifestCategory, + category: IntegrationManifestCategory, rate: want.IntegrationManifest, }, { - category: sourceImportCategory, + category: SourceImportCategory, rate: want.SourceImport, }, { - category: codeScanningUploadCategory, + category: CodeScanningUploadCategory, rate: want.CodeScanningUpload, }, { - category: actionsRunnerRegistrationCategory, + category: ActionsRunnerRegistrationCategory, rate: want.ActionsRunnerRegistration, }, { - category: scimCategory, + category: ScimCategory, rate: want.SCIM, }, { - category: dependencySnapshotsCategory, + category: DependencySnapshotsCategory, rate: want.DependencySnapshots, }, { - category: codeSearchCategory, + category: CodeSearchCategory, rate: want.CodeSearch, }, + { + category: AuditLogCategory, + rate: want.AuditLog, + }, } for _, tt := range tests { @@ -185,7 +196,7 @@ func TestRateLimits_overQuota(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - client.rateLimits[coreCategory] = Rate{ + client.rateLimits[CoreCategory] = Rate{ Limit: 1, Remaining: 0, Reset: Timestamp{time.Now().Add(time.Hour).Local()}, @@ -201,7 +212,8 @@ func TestRateLimits_overQuota(t *testing.T) { "actions_runner_registration": {"limit":8,"remaining":7,"reset":1372700879}, "scim": {"limit":9,"remaining":8,"reset":1372700880}, "dependency_snapshots": {"limit":10,"remaining":9,"reset":1372700881}, - "code_search": {"limit":11,"remaining":10,"reset":1372700882} + "code_search": {"limit":11,"remaining":10,"reset":1372700882}, + "audit_log": {"limit":12,"remaining":11,"reset":1372700883} }}`) }) @@ -262,55 +274,64 @@ func TestRateLimits_overQuota(t *testing.T) { Remaining: 10, Reset: Timestamp{time.Date(2013, time.July, 1, 17, 48, 2, 0, time.UTC).Local()}, }, + AuditLog: &Rate{ + Limit: 12, + Remaining: 11, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 48, 3, 0, time.UTC).Local()}, + }, } if !cmp.Equal(rate, want) { t.Errorf("RateLimits returned %+v, want %+v", rate, want) } tests := []struct { - category rateLimitCategory + category RateLimitCategory rate *Rate }{ { - category: coreCategory, + category: CoreCategory, rate: want.Core, }, { - category: searchCategory, + category: SearchCategory, rate: want.Search, }, { - category: graphqlCategory, + category: GraphqlCategory, rate: want.GraphQL, }, { - category: integrationManifestCategory, + category: IntegrationManifestCategory, rate: want.IntegrationManifest, }, { - category: sourceImportCategory, + category: SourceImportCategory, rate: want.SourceImport, }, { - category: codeScanningUploadCategory, + category: CodeScanningUploadCategory, rate: want.CodeScanningUpload, }, { - category: actionsRunnerRegistrationCategory, + category: ActionsRunnerRegistrationCategory, rate: want.ActionsRunnerRegistration, }, { - category: scimCategory, + category: ScimCategory, rate: want.SCIM, }, { - category: dependencySnapshotsCategory, + category: DependencySnapshotsCategory, rate: want.DependencySnapshots, }, { - category: codeSearchCategory, + category: CodeSearchCategory, rate: want.CodeSearch, }, + { + category: AuditLogCategory, + rate: want.AuditLog, + }, } for _, tt := range tests { if got, want := client.rateLimits[tt.category], *tt.rate; got != want { @@ -373,6 +394,11 @@ func TestRateLimits_Marshal(t *testing.T) { Remaining: 1, Reset: Timestamp{referenceTime}, }, + AuditLog: &Rate{ + Limit: 1, + Remaining: 1, + Reset: Timestamp{referenceTime}, + }, } want := `{ @@ -425,6 +451,11 @@ func TestRateLimits_Marshal(t *testing.T) { "limit": 1, "remaining": 1, "reset": ` + referenceTimeStr + ` + }, + "audit_log": { + "limit": 1, + "remaining": 1, + "reset": ` + referenceTimeStr + ` } }` From 17afef1b53bb8bd98a332d03db6420fc86a1ffeb Mon Sep 17 00:00:00 2001 From: Ryo Mimura <52129983+fchimpan@users.noreply.github.com> Date: Sun, 24 Mar 2024 11:10:42 +0900 Subject: [PATCH 419/751] Update README.md (#3110) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f2f1437744b..7e429525936 100644 --- a/README.md +++ b/README.md @@ -184,7 +184,7 @@ You can use [go-github-ratelimit](https://github.com/gofri/go-github-ratelimit) secondary rate limit sleep-and-retry for you. Learn more about GitHub secondary rate limiting at -https://docs.github.com/en/rest/overview/resources-in-the-rest-api#secondary-rate-limits . +https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#about-secondary-rate-limits . ### Accepted Status ### From b3e96fdc1f002ce3c2aa71cba0e98214f5f50af9 Mon Sep 17 00:00:00 2001 From: Alex Rosenzweig <64241648+shellz-n-stuff@users.noreply.github.com> Date: Mon, 25 Mar 2024 08:29:11 +1100 Subject: [PATCH 420/751] Allow Installation of Custom Properties Permissions (#3108) --- github/apps.go | 1 + github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ 3 files changed, 19 insertions(+) diff --git a/github/apps.go b/github/apps.go index f0392f2d706..2ebfee505cd 100644 --- a/github/apps.go +++ b/github/apps.go @@ -77,6 +77,7 @@ type InstallationPermissions struct { Metadata *string `json:"metadata,omitempty"` Members *string `json:"members,omitempty"` OrganizationAdministration *string `json:"organization_administration,omitempty"` + OrganizationCustomProperties *string `json:"organization_custom_properties,omitempty"` OrganizationCustomRoles *string `json:"organization_custom_roles,omitempty"` OrganizationHooks *string `json:"organization_hooks,omitempty"` OrganizationPackages *string `json:"organization_packages,omitempty"` diff --git a/github/github-accessors.go b/github/github-accessors.go index 01b81375234..f95e4c3b9bd 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -8686,6 +8686,14 @@ func (i *InstallationPermissions) GetOrganizationAdministration() string { return *i.OrganizationAdministration } +// GetOrganizationCustomProperties returns the OrganizationCustomProperties field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetOrganizationCustomProperties() string { + if i == nil || i.OrganizationCustomProperties == nil { + return "" + } + return *i.OrganizationCustomProperties +} + // GetOrganizationCustomRoles returns the OrganizationCustomRoles field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetOrganizationCustomRoles() string { if i == nil || i.OrganizationCustomRoles == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index ba3287351da..ca263064ffb 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -10177,6 +10177,16 @@ func TestInstallationPermissions_GetOrganizationAdministration(tt *testing.T) { i.GetOrganizationAdministration() } +func TestInstallationPermissions_GetOrganizationCustomProperties(tt *testing.T) { + var zeroValue string + i := &InstallationPermissions{OrganizationCustomProperties: &zeroValue} + i.GetOrganizationCustomProperties() + i = &InstallationPermissions{} + i.GetOrganizationCustomProperties() + i = nil + i.GetOrganizationCustomProperties() +} + func TestInstallationPermissions_GetOrganizationCustomRoles(tt *testing.T) { var zeroValue string i := &InstallationPermissions{OrganizationCustomRoles: &zeroValue} From 8bec011ec30db88863f28675d13c2be95ea5808d Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Mon, 25 Mar 2024 09:21:05 -0400 Subject: [PATCH 421/751] Add NotificationSetting to NewTeam (#3111) Fixes: #3107. --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ github/github-stringify_test.go | 21 +++++++++++---------- github/teams.go | 3 +++ github/teams_test.go | 18 ++++++++++-------- 5 files changed, 42 insertions(+), 18 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index f95e4c3b9bd..57a7165f7ff 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -11982,6 +11982,14 @@ func (n *NewTeam) GetLDAPDN() string { return *n.LDAPDN } +// GetNotificationSetting returns the NotificationSetting field if it's non-nil, zero value otherwise. +func (n *NewTeam) GetNotificationSetting() string { + if n == nil || n.NotificationSetting == nil { + return "" + } + return *n.NotificationSetting +} + // GetParentTeamID returns the ParentTeamID field if it's non-nil, zero value otherwise. func (n *NewTeam) GetParentTeamID() int64 { if n == nil || n.ParentTeamID == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index ca263064ffb..bbf9fb8422c 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -13985,6 +13985,16 @@ func TestNewTeam_GetLDAPDN(tt *testing.T) { n.GetLDAPDN() } +func TestNewTeam_GetNotificationSetting(tt *testing.T) { + var zeroValue string + n := &NewTeam{NotificationSetting: &zeroValue} + n.GetNotificationSetting() + n = &NewTeam{} + n.GetNotificationSetting() + n = nil + n.GetNotificationSetting() +} + func TestNewTeam_GetParentTeamID(tt *testing.T) { var zeroValue int64 n := &NewTeam{ParentTeamID: &zeroValue} diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index 576db8ff29a..8633d837d12 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -962,16 +962,17 @@ func TestMilestoneStats_String(t *testing.T) { func TestNewTeam_String(t *testing.T) { v := NewTeam{ - Name: "", - Description: String(""), - Maintainers: []string{""}, - RepoNames: []string{""}, - ParentTeamID: Int64(0), - Permission: String(""), - Privacy: String(""), - LDAPDN: String(""), - } - want := `github.NewTeam{Name:"", Description:"", Maintainers:[""], RepoNames:[""], ParentTeamID:0, Permission:"", Privacy:"", LDAPDN:""}` + Name: "", + Description: String(""), + Maintainers: []string{""}, + RepoNames: []string{""}, + ParentTeamID: Int64(0), + NotificationSetting: String(""), + Permission: String(""), + Privacy: String(""), + LDAPDN: String(""), + } + want := `github.NewTeam{Name:"", Description:"", Maintainers:[""], RepoNames:[""], ParentTeamID:0, NotificationSetting:"", Permission:"", Privacy:"", LDAPDN:""}` if got := v.String(); got != want { t.Errorf("NewTeam.String = %v, want %v", got, want) } diff --git a/github/teams.go b/github/teams.go index fd22b792a66..0f6cc9d16e4 100644 --- a/github/teams.go +++ b/github/teams.go @@ -155,6 +155,9 @@ type NewTeam struct { RepoNames []string `json:"repo_names,omitempty"` ParentTeamID *int64 `json:"parent_team_id,omitempty"` + // NotificationSetting can be one of: "notifications_enabled", "notifications_disabled". + NotificationSetting *string `json:"notification_setting,omitempty"` + // Deprecated: Permission is deprecated when creating or editing a team in an org // using the new GitHub permission model. It no longer identifies the // permission a team has on its repos, but only specifies the default diff --git a/github/teams_test.go b/github/teams_test.go index c0ca1f6dd71..516c88f43ae 100644 --- a/github/teams_test.go +++ b/github/teams_test.go @@ -1590,14 +1590,15 @@ func TestNewTeam_Marshal(t *testing.T) { testJSONMarshal(t, &NewTeam{}, "{}") u := &NewTeam{ - Name: "n", - Description: String("d"), - Maintainers: []string{"m1", "m2"}, - RepoNames: []string{"repo1", "repo2"}, - ParentTeamID: Int64(1), - Permission: String("perm"), - Privacy: String("p"), - LDAPDN: String("l"), + Name: "n", + Description: String("d"), + Maintainers: []string{"m1", "m2"}, + RepoNames: []string{"repo1", "repo2"}, + NotificationSetting: String("notifications_enabled"), + ParentTeamID: Int64(1), + Permission: String("perm"), + Privacy: String("p"), + LDAPDN: String("l"), } want := `{ @@ -1606,6 +1607,7 @@ func TestNewTeam_Marshal(t *testing.T) { "maintainers": ["m1", "m2"], "repo_names": ["repo1", "repo2"], "parent_team_id": 1, + "notification_setting": "notifications_enabled", "permission": "perm", "privacy": "p", "ldap_dn": "l" From 189123903e78a8697f19baa1633b1c10a1603373 Mon Sep 17 00:00:00 2001 From: Alin Balutoiu Date: Tue, 26 Mar 2024 19:11:42 +0000 Subject: [PATCH 422/751] Fix pagination for ListCopilotSeats (#3112) --- github/copilot.go | 6 +++++- github/copilot_test.go | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/github/copilot.go b/github/copilot.go index 51c938c9748..50e05253ce5 100644 --- a/github/copilot.go +++ b/github/copilot.go @@ -161,8 +161,12 @@ func (s *CopilotService) GetCopilotBilling(ctx context.Context, org string) (*Co //meta:operation GET /orgs/{org}/copilot/billing/seats func (s *CopilotService) ListCopilotSeats(ctx context.Context, org string, opts *ListOptions) (*ListCopilotSeatsResponse, *Response, error) { u := fmt.Sprintf("orgs/%v/copilot/billing/seats", org) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } - req, err := s.client.NewRequest("GET", u, opts) + req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err } diff --git a/github/copilot_test.go b/github/copilot_test.go index c65fda0f217..bc295af3a61 100644 --- a/github/copilot_test.go +++ b/github/copilot_test.go @@ -584,8 +584,9 @@ func TestCopilotService_ListCopilotSeats(t *testing.T) { const methodName = "ListCopilotSeats" + opts := &ListOptions{Page: 2} testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Copilot.ListCopilotSeats(ctx, "\n", nil) + _, _, err = client.Copilot.ListCopilotSeats(ctx, "\n", opts) return err }) From 8c1032ac9889c9aa5dae32b196fb3c3164d64bc1 Mon Sep 17 00:00:00 2001 From: Hari Charan Korrapati <80394987+HariCharan-001@users.noreply.github.com> Date: Fri, 29 Mar 2024 00:03:35 +0530 Subject: [PATCH 423/751] feat!: Update deprecated endpoints in github/action_variables.go (#3104) Fixes: #3103. BREAKING-CHANGE: The following endpoints now take `owner` and `repo` (string) names instead of an integer repo ID: ActionsService.ListEnvVariables ActionsService.GetEnvVariable ActionsService.CreateEnvVariable ActionsService.UpdateEnvVariable ActionsService.DeleteEnvVariable --- github/actions_secrets.go | 10 +- github/actions_variables.go | 30 +- github/actions_variables_test.go | 40 +- github/admin.go | 4 +- github/admin_orgs.go | 6 +- github/admin_stats.go | 2 +- github/admin_users.go | 8 +- github/authorizations.go | 4 +- github/copilot.go | 14 +- github/repos_autolinks.go | 2 +- github/repos_prereceive_hooks.go | 8 +- github/users_administration.go | 8 +- openapi_operations.yaml | 2322 ++++++++++++++++-------------- 13 files changed, 1300 insertions(+), 1158 deletions(-) diff --git a/github/actions_secrets.go b/github/actions_secrets.go index d8d405c06d7..ec519838eab 100644 --- a/github/actions_secrets.go +++ b/github/actions_secrets.go @@ -84,7 +84,7 @@ func (s *ActionsService) GetOrgPublicKey(ctx context.Context, org string) (*Publ // GetEnvPublicKey gets a public key that should be used for secret encryption. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-an-environment-public-key +// GitHub API docs: https://docs.github.com/enterprise-server@3.7/rest/actions/secrets#get-an-environment-public-key // //meta:operation GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key func (s *ActionsService) GetEnvPublicKey(ctx context.Context, repoID int, env string) (*PublicKey, *Response, error) { @@ -162,7 +162,7 @@ func (s *ActionsService) ListOrgSecrets(ctx context.Context, org string, opts *L // ListEnvSecrets lists all secrets available in an environment. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#list-environment-secrets +// GitHub API docs: https://docs.github.com/enterprise-server@3.7/rest/actions/secrets#list-environment-secrets // //meta:operation GET /repositories/{repository_id}/environments/{environment_name}/secrets func (s *ActionsService) ListEnvSecrets(ctx context.Context, repoID int, env string, opts *ListOptions) (*Secrets, *Response, error) { @@ -207,7 +207,7 @@ func (s *ActionsService) GetOrgSecret(ctx context.Context, org, name string) (*S // GetEnvSecret gets a single environment secret without revealing its encrypted value. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-an-environment-secret +// GitHub API docs: https://docs.github.com/enterprise-server@3.7/rest/actions/secrets#get-an-environment-secret // //meta:operation GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} func (s *ActionsService) GetEnvSecret(ctx context.Context, repoID int, env, secretName string) (*Secret, *Response, error) { @@ -262,7 +262,7 @@ func (s *ActionsService) CreateOrUpdateOrgSecret(ctx context.Context, org string // CreateOrUpdateEnvSecret creates or updates a single environment secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#create-or-update-an-environment-secret +// GitHub API docs: https://docs.github.com/enterprise-server@3.7/rest/actions/secrets#create-or-update-an-environment-secret // //meta:operation PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} func (s *ActionsService) CreateOrUpdateEnvSecret(ctx context.Context, repoID int, env string, eSecret *EncryptedSecret) (*Response, error) { @@ -301,7 +301,7 @@ func (s *ActionsService) DeleteOrgSecret(ctx context.Context, org, name string) // DeleteEnvSecret deletes a secret in an environment using the secret name. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#delete-an-environment-secret +// GitHub API docs: https://docs.github.com/enterprise-server@3.7/rest/actions/secrets#delete-an-environment-secret // //meta:operation DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} func (s *ActionsService) DeleteEnvSecret(ctx context.Context, repoID int, env, secretName string) (*Response, error) { diff --git a/github/actions_variables.go b/github/actions_variables.go index aa0f23ca48d..bca46b6df6b 100644 --- a/github/actions_variables.go +++ b/github/actions_variables.go @@ -83,9 +83,9 @@ func (s *ActionsService) ListOrgVariables(ctx context.Context, org string, opts // // GitHub API docs: https://docs.github.com/rest/actions/variables#list-environment-variables // -//meta:operation GET /repositories/{repository_id}/environments/{environment_name}/variables -func (s *ActionsService) ListEnvVariables(ctx context.Context, repoID int, env string, opts *ListOptions) (*ActionsVariables, *Response, error) { - url := fmt.Sprintf("repositories/%v/environments/%v/variables", repoID, env) +//meta:operation GET /repos/{owner}/{repo}/environments/{environment_name}/variables +func (s *ActionsService) ListEnvVariables(ctx context.Context, owner, repo, env string, opts *ListOptions) (*ActionsVariables, *Response, error) { + url := fmt.Sprintf("repos/%v/%v/environments/%v/variables", owner, repo, env) return s.listVariables(ctx, url, opts) } @@ -128,9 +128,9 @@ func (s *ActionsService) GetOrgVariable(ctx context.Context, org, name string) ( // // GitHub API docs: https://docs.github.com/rest/actions/variables#get-an-environment-variable // -//meta:operation GET /repositories/{repository_id}/environments/{environment_name}/variables/{name} -func (s *ActionsService) GetEnvVariable(ctx context.Context, repoID int, env, variableName string) (*ActionsVariable, *Response, error) { - url := fmt.Sprintf("repositories/%v/environments/%v/variables/%v", repoID, env, variableName) +//meta:operation GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name} +func (s *ActionsService) GetEnvVariable(ctx context.Context, owner, repo, env, variableName string) (*ActionsVariable, *Response, error) { + url := fmt.Sprintf("repos/%v/%v/environments/%v/variables/%v", owner, repo, env, variableName) return s.getVariable(ctx, url) } @@ -166,9 +166,9 @@ func (s *ActionsService) CreateOrgVariable(ctx context.Context, org string, vari // // GitHub API docs: https://docs.github.com/rest/actions/variables#create-an-environment-variable // -//meta:operation POST /repositories/{repository_id}/environments/{environment_name}/variables -func (s *ActionsService) CreateEnvVariable(ctx context.Context, repoID int, env string, variable *ActionsVariable) (*Response, error) { - url := fmt.Sprintf("repositories/%v/environments/%v/variables", repoID, env) +//meta:operation POST /repos/{owner}/{repo}/environments/{environment_name}/variables +func (s *ActionsService) CreateEnvVariable(ctx context.Context, owner, repo, env string, variable *ActionsVariable) (*Response, error) { + url := fmt.Sprintf("repos/%v/%v/environments/%v/variables", owner, repo, env) return s.postVariable(ctx, url, variable) } @@ -204,9 +204,9 @@ func (s *ActionsService) UpdateOrgVariable(ctx context.Context, org string, vari // // GitHub API docs: https://docs.github.com/rest/actions/variables#update-an-environment-variable // -//meta:operation PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{name} -func (s *ActionsService) UpdateEnvVariable(ctx context.Context, repoID int, env string, variable *ActionsVariable) (*Response, error) { - url := fmt.Sprintf("repositories/%v/environments/%v/variables/%v", repoID, env, variable.Name) +//meta:operation PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name} +func (s *ActionsService) UpdateEnvVariable(ctx context.Context, owner, repo, env string, variable *ActionsVariable) (*Response, error) { + url := fmt.Sprintf("repos/%v/%v/environments/%v/variables/%v", owner, repo, env, variable.Name) return s.patchVariable(ctx, url, variable) } @@ -243,9 +243,9 @@ func (s *ActionsService) DeleteOrgVariable(ctx context.Context, org, name string // // GitHub API docs: https://docs.github.com/rest/actions/variables#delete-an-environment-variable // -//meta:operation DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{name} -func (s *ActionsService) DeleteEnvVariable(ctx context.Context, repoID int, env, variableName string) (*Response, error) { - url := fmt.Sprintf("repositories/%v/environments/%v/variables/%v", repoID, env, variableName) +//meta:operation DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name} +func (s *ActionsService) DeleteEnvVariable(ctx context.Context, owner, repo, env, variableName string) (*Response, error) { + url := fmt.Sprintf("repos/%v/%v/environments/%v/variables/%v", owner, repo, env, variableName) return s.deleteVariable(ctx, url) } diff --git a/github/actions_variables_test.go b/github/actions_variables_test.go index dcd648c25c3..37c1a2613ac 100644 --- a/github/actions_variables_test.go +++ b/github/actions_variables_test.go @@ -533,7 +533,7 @@ func TestActionsService_ListEnvVariables(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - mux.HandleFunc("/repositories/1/environments/e/variables", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/usr/1/environments/e/variables", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") testFormValues(t, r, values{"per_page": "2", "page": "2"}) fmt.Fprint(w, `{"total_count":4,"variables":[{"name":"A","value":"AA","created_at":"2019-01-02T15:04:05Z","updated_at":"2020-01-02T15:04:05Z"},{"name":"B","value":"BB","created_at":"2019-01-02T15:04:05Z","updated_at":"2020-01-02T15:04:05Z"}]}`) @@ -541,7 +541,7 @@ func TestActionsService_ListEnvVariables(t *testing.T) { opts := &ListOptions{Page: 2, PerPage: 2} ctx := context.Background() - variables, _, err := client.Actions.ListEnvVariables(ctx, 1, "e", opts) + variables, _, err := client.Actions.ListEnvVariables(ctx, "usr", "1", "e", opts) if err != nil { t.Errorf("Actions.ListEnvVariables returned error: %v", err) } @@ -559,12 +559,12 @@ func TestActionsService_ListEnvVariables(t *testing.T) { const methodName = "ListEnvVariables" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Actions.ListEnvVariables(ctx, 0.0, "\n", opts) + _, _, err = client.Actions.ListEnvVariables(ctx, "usr", "0", "\n", opts) return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Actions.ListEnvVariables(ctx, 1, "e", opts) + got, resp, err := client.Actions.ListEnvVariables(ctx, "usr", "1", "e", opts) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -576,13 +576,13 @@ func TestActionsService_GetEnvVariable(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - mux.HandleFunc("/repositories/1/environments/e/variables/variable", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/usr/1/environments/e/variables/variable", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `{"name":"variable","value":"VAR","created_at":"2019-01-02T15:04:05Z","updated_at":"2020-01-02T15:04:05Z"}`) }) ctx := context.Background() - variable, _, err := client.Actions.GetEnvVariable(ctx, 1, "e", "variable") + variable, _, err := client.Actions.GetEnvVariable(ctx, "usr", "1", "e", "variable") if err != nil { t.Errorf("Actions.GetEnvVariable returned error: %v", err) } @@ -599,12 +599,12 @@ func TestActionsService_GetEnvVariable(t *testing.T) { const methodName = "GetEnvVariable" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Actions.GetEnvVariable(ctx, 0.0, "\n", "\n") + _, _, err = client.Actions.GetEnvVariable(ctx, "usr", "0", "\n", "\n") return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Actions.GetEnvVariable(ctx, 1, "e", "variable") + got, resp, err := client.Actions.GetEnvVariable(ctx, "usr", "1", "e", "variable") if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -616,7 +616,7 @@ func TestActionsService_CreateEnvVariable(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - mux.HandleFunc("/repositories/1/environments/e/variables", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/usr/1/environments/e/variables", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") testHeader(t, r, "Content-Type", "application/json") testBody(t, r, `{"name":"variable","value":"VAR"}`+"\n") @@ -628,19 +628,19 @@ func TestActionsService_CreateEnvVariable(t *testing.T) { Value: "VAR", } ctx := context.Background() - _, err := client.Actions.CreateEnvVariable(ctx, 1, "e", input) + _, err := client.Actions.CreateEnvVariable(ctx, "usr", "1", "e", input) if err != nil { t.Errorf("Actions.CreateEnvVariable returned error: %v", err) } const methodName = "CreateEnvVariable" testBadOptions(t, methodName, func() (err error) { - _, err = client.Actions.CreateEnvVariable(ctx, 0.0, "\n", input) + _, err = client.Actions.CreateEnvVariable(ctx, "usr", "0", "\n", input) return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Actions.CreateEnvVariable(ctx, 1, "e", input) + return client.Actions.CreateEnvVariable(ctx, "usr", "1", "e", input) }) } @@ -648,7 +648,7 @@ func TestActionsService_UpdateEnvVariable(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - mux.HandleFunc("/repositories/1/environments/e/variables/variable", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/usr/1/environments/e/variables/variable", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") testHeader(t, r, "Content-Type", "application/json") testBody(t, r, `{"name":"variable","value":"VAR"}`+"\n") @@ -660,19 +660,19 @@ func TestActionsService_UpdateEnvVariable(t *testing.T) { Value: "VAR", } ctx := context.Background() - _, err := client.Actions.UpdateEnvVariable(ctx, 1, "e", input) + _, err := client.Actions.UpdateEnvVariable(ctx, "usr", "1", "e", input) if err != nil { t.Errorf("Actions.UpdateEnvVariable returned error: %v", err) } const methodName = "UpdateEnvVariable" testBadOptions(t, methodName, func() (err error) { - _, err = client.Actions.UpdateEnvVariable(ctx, 0.0, "\n", input) + _, err = client.Actions.UpdateEnvVariable(ctx, "usr", "1", "\n", input) return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Actions.UpdateEnvVariable(ctx, 1, "e", input) + return client.Actions.UpdateEnvVariable(ctx, "usr", "1", "e", input) }) } @@ -680,24 +680,24 @@ func TestActionsService_DeleteEnvVariable(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - mux.HandleFunc("/repositories/1/environments/e/variables/variable", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/usr/1/environments/e/variables/variable", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) ctx := context.Background() - _, err := client.Actions.DeleteEnvVariable(ctx, 1, "e", "variable") + _, err := client.Actions.DeleteEnvVariable(ctx, "usr", "1", "e", "variable") if err != nil { t.Errorf("Actions.DeleteEnvVariable returned error: %v", err) } const methodName = "DeleteEnvVariable" testBadOptions(t, methodName, func() (err error) { - _, err = client.Actions.DeleteEnvVariable(ctx, 0.0, "\n", "\n") + _, err = client.Actions.DeleteEnvVariable(ctx, "usr", "0", "\n", "\n") return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Actions.DeleteEnvVariable(ctx, 1, "r", "variable") + return client.Actions.DeleteEnvVariable(ctx, "usr", "1", "r", "variable") }) } diff --git a/github/admin.go b/github/admin.go index c1f7066c7ad..e93c2266bd1 100644 --- a/github/admin.go +++ b/github/admin.go @@ -82,7 +82,7 @@ func (m Enterprise) String() string { // UpdateUserLDAPMapping updates the mapping between a GitHub user and an LDAP user. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user // //meta:operation PATCH /admin/ldap/users/{username}/mapping func (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, mapping *UserLDAPMapping) (*UserLDAPMapping, *Response, error) { @@ -103,7 +103,7 @@ func (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, m // UpdateTeamLDAPMapping updates the mapping between a GitHub team and an LDAP group. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team +// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team // //meta:operation PATCH /admin/ldap/teams/{team_id}/mapping func (s *AdminService) UpdateTeamLDAPMapping(ctx context.Context, team int64, mapping *TeamLDAPMapping) (*TeamLDAPMapping, *Response, error) { diff --git a/github/admin_orgs.go b/github/admin_orgs.go index e1b3641e003..cb11fe47f42 100644 --- a/github/admin_orgs.go +++ b/github/admin_orgs.go @@ -22,7 +22,7 @@ type createOrgRequest struct { // Note that only a subset of the org fields are used and org must // not be nil. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/orgs#create-an-organization +// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/orgs#create-an-organization // //meta:operation POST /admin/organizations func (s *AdminService) CreateOrg(ctx context.Context, org *Organization, admin string) (*Organization, *Response, error) { @@ -61,7 +61,7 @@ type RenameOrgResponse struct { // RenameOrg renames an organization in GitHub Enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/orgs#update-an-organization-name +// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/orgs#update-an-organization-name // //meta:operation PATCH /admin/organizations/{org} func (s *AdminService) RenameOrg(ctx context.Context, org *Organization, newName string) (*RenameOrgResponse, *Response, error) { @@ -70,7 +70,7 @@ func (s *AdminService) RenameOrg(ctx context.Context, org *Organization, newName // RenameOrgByName renames an organization in GitHub Enterprise using its current name. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/orgs#update-an-organization-name +// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/orgs#update-an-organization-name // //meta:operation PATCH /admin/organizations/{org} func (s *AdminService) RenameOrgByName(ctx context.Context, org, newName string) (*RenameOrgResponse, *Response, error) { diff --git a/github/admin_stats.go b/github/admin_stats.go index f26b393e02f..70412625147 100644 --- a/github/admin_stats.go +++ b/github/admin_stats.go @@ -152,7 +152,7 @@ func (s RepoStats) String() string { // Please note that this is only available to site administrators, // otherwise it will error with a 404 not found (instead of 401 or 403). // -// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-all-statistics +// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/admin-stats#get-all-statistics // //meta:operation GET /enterprise/stats/all func (s *AdminService) GetAdminStats(ctx context.Context) (*AdminStats, *Response, error) { diff --git a/github/admin_users.go b/github/admin_users.go index e134ff34dbf..82e568a0ac6 100644 --- a/github/admin_users.go +++ b/github/admin_users.go @@ -20,7 +20,7 @@ type CreateUserRequest struct { // CreateUser creates a new user in GitHub Enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#create-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#create-a-user // //meta:operation POST /admin/users func (s *AdminService) CreateUser(ctx context.Context, userReq CreateUserRequest) (*User, *Response, error) { @@ -42,7 +42,7 @@ func (s *AdminService) CreateUser(ctx context.Context, userReq CreateUserRequest // DeleteUser deletes a user in GitHub Enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#delete-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#delete-a-user // //meta:operation DELETE /admin/users/{username} func (s *AdminService) DeleteUser(ctx context.Context, username string) (*Response, error) { @@ -95,7 +95,7 @@ type UserAuthorization struct { // CreateUserImpersonation creates an impersonation OAuth token. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#create-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#create-an-impersonation-oauth-token // //meta:operation POST /admin/users/{username}/authorizations func (s *AdminService) CreateUserImpersonation(ctx context.Context, username string, opts *ImpersonateUserOptions) (*UserAuthorization, *Response, error) { @@ -117,7 +117,7 @@ func (s *AdminService) CreateUserImpersonation(ctx context.Context, username str // DeleteUserImpersonation deletes an impersonation OAuth token. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#delete-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#delete-an-impersonation-oauth-token // //meta:operation DELETE /admin/users/{username}/authorizations func (s *AdminService) DeleteUserImpersonation(ctx context.Context, username string) (*Response, error) { diff --git a/github/authorizations.go b/github/authorizations.go index 931b77299b0..9bfff7330ab 100644 --- a/github/authorizations.go +++ b/github/authorizations.go @@ -257,7 +257,7 @@ func (s *AuthorizationsService) DeleteGrant(ctx context.Context, clientID, acces // you can e.g. create or delete a user's public SSH key. NOTE: creating a // new token automatically revokes an existing one. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#create-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#create-an-impersonation-oauth-token // //meta:operation POST /admin/users/{username}/authorizations func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, username string, authReq *AuthorizationRequest) (*Authorization, *Response, error) { @@ -279,7 +279,7 @@ func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, usernam // // NOTE: there can be only one at a time. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#delete-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#delete-an-impersonation-oauth-token // //meta:operation DELETE /admin/users/{username}/authorizations func (s *AuthorizationsService) DeleteImpersonation(ctx context.Context, username string) (*Response, error) { diff --git a/github/copilot.go b/github/copilot.go index 50e05253ce5..2697b71850c 100644 --- a/github/copilot.go +++ b/github/copilot.go @@ -132,7 +132,7 @@ func (cp *CopilotSeatDetails) GetOrganization() (*Organization, bool) { // GetCopilotBilling gets Copilot for Business billing information and settings for an organization. // -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-business#get-copilot-business-seat-information-and-settings-for-an-organization +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#get-copilot-seat-information-and-settings-for-an-organization // //meta:operation GET /orgs/{org}/copilot/billing func (s *CopilotService) GetCopilotBilling(ctx context.Context, org string) (*CopilotOrganizationDetails, *Response, error) { @@ -156,7 +156,7 @@ func (s *CopilotService) GetCopilotBilling(ctx context.Context, org string) (*Co // // To paginate through all seats, populate 'Page' with the number of the last page. // -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-business#list-all-copilot-business-seat-assignments-for-an-organization +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#list-all-copilot-seat-assignments-for-an-organization // //meta:operation GET /orgs/{org}/copilot/billing/seats func (s *CopilotService) ListCopilotSeats(ctx context.Context, org string, opts *ListOptions) (*ListCopilotSeatsResponse, *Response, error) { @@ -182,7 +182,7 @@ func (s *CopilotService) ListCopilotSeats(ctx context.Context, org string, opts // AddCopilotTeams adds teams to the Copilot for Business subscription for an organization. // -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-business#add-teams-to-the-copilot-business-subscription-for-an-organization +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#add-teams-to-the-copilot-subscription-for-an-organization // //meta:operation POST /orgs/{org}/copilot/billing/selected_teams func (s *CopilotService) AddCopilotTeams(ctx context.Context, org string, teamNames []string) (*SeatAssignments, *Response, error) { @@ -210,7 +210,7 @@ func (s *CopilotService) AddCopilotTeams(ctx context.Context, org string, teamNa // RemoveCopilotTeams removes teams from the Copilot for Business subscription for an organization. // -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-business#remove-teams-from-the-copilot-business-subscription-for-an-organization +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#remove-teams-from-the-copilot-subscription-for-an-organization // //meta:operation DELETE /orgs/{org}/copilot/billing/selected_teams func (s *CopilotService) RemoveCopilotTeams(ctx context.Context, org string, teamNames []string) (*SeatCancellations, *Response, error) { @@ -238,7 +238,7 @@ func (s *CopilotService) RemoveCopilotTeams(ctx context.Context, org string, tea // AddCopilotUsers adds users to the Copilot for Business subscription for an organization // -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-business#add-users-to-the-copilot-business-subscription-for-an-organization +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#add-users-to-the-copilot-subscription-for-an-organization // //meta:operation POST /orgs/{org}/copilot/billing/selected_users func (s *CopilotService) AddCopilotUsers(ctx context.Context, org string, users []string) (*SeatAssignments, *Response, error) { @@ -266,7 +266,7 @@ func (s *CopilotService) AddCopilotUsers(ctx context.Context, org string, users // RemoveCopilotUsers removes users from the Copilot for Business subscription for an organization. // -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-business#remove-users-from-the-copilot-business-subscription-for-an-organization +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#remove-users-from-the-copilot-subscription-for-an-organization // //meta:operation DELETE /orgs/{org}/copilot/billing/selected_users func (s *CopilotService) RemoveCopilotUsers(ctx context.Context, org string, users []string) (*SeatCancellations, *Response, error) { @@ -294,7 +294,7 @@ func (s *CopilotService) RemoveCopilotUsers(ctx context.Context, org string, use // GetSeatDetails gets Copilot for Business seat assignment details for a user. // -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-business#get-copilot-business-seat-assignment-details-for-a-user +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#get-copilot-seat-assignment-details-for-a-user // //meta:operation GET /orgs/{org}/members/{username}/copilot func (s *CopilotService) GetSeatDetails(ctx context.Context, org, user string) (*CopilotSeatDetails, *Response, error) { diff --git a/github/repos_autolinks.go b/github/repos_autolinks.go index 200605aa0b2..6c209b2d5e8 100644 --- a/github/repos_autolinks.go +++ b/github/repos_autolinks.go @@ -28,7 +28,7 @@ type Autolink struct { // ListAutolinks returns a list of autolinks configured for the given repository. // Information about autolinks are only available to repository administrators. // -// GitHub API docs: https://docs.github.com/rest/repos/autolinks#list-all-autolinks-of-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/autolinks#get-all-autolinks-of-a-repository // //meta:operation GET /repos/{owner}/{repo}/autolinks func (s *RepositoriesService) ListAutolinks(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Autolink, *Response, error) { diff --git a/github/repos_prereceive_hooks.go b/github/repos_prereceive_hooks.go index b1d3f3c818d..7d85c873620 100644 --- a/github/repos_prereceive_hooks.go +++ b/github/repos_prereceive_hooks.go @@ -24,7 +24,7 @@ func (p PreReceiveHook) String() string { // ListPreReceiveHooks lists all pre-receive hooks for the specified repository. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/pre-receive-hooks func (s *RepositoriesService) ListPreReceiveHooks(ctx context.Context, owner, repo string, opts *ListOptions) ([]*PreReceiveHook, *Response, error) { @@ -53,7 +53,7 @@ func (s *RepositoriesService) ListPreReceiveHooks(ctx context.Context, owner, re // GetPreReceiveHook returns a single specified pre-receive hook. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) GetPreReceiveHook(ctx context.Context, owner, repo string, id int64) (*PreReceiveHook, *Response, error) { @@ -77,7 +77,7 @@ func (s *RepositoriesService) GetPreReceiveHook(ctx context.Context, owner, repo // UpdatePreReceiveHook updates a specified pre-receive hook. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository // //meta:operation PATCH /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) UpdatePreReceiveHook(ctx context.Context, owner, repo string, id int64, hook *PreReceiveHook) (*PreReceiveHook, *Response, error) { @@ -101,7 +101,7 @@ func (s *RepositoriesService) UpdatePreReceiveHook(ctx context.Context, owner, r // DeletePreReceiveHook deletes a specified pre-receive hook. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository // //meta:operation DELETE /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) DeletePreReceiveHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { diff --git a/github/users_administration.go b/github/users_administration.go index 5b9e1de8c60..2c86af7336d 100644 --- a/github/users_administration.go +++ b/github/users_administration.go @@ -12,7 +12,7 @@ import ( // PromoteSiteAdmin promotes a user to a site administrator of a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator +// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator // //meta:operation PUT /users/{username}/site_admin func (s *UsersService) PromoteSiteAdmin(ctx context.Context, user string) (*Response, error) { @@ -28,7 +28,7 @@ func (s *UsersService) PromoteSiteAdmin(ctx context.Context, user string) (*Resp // DemoteSiteAdmin demotes a user from site administrator of a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#demote-a-site-administrator +// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#demote-a-site-administrator // //meta:operation DELETE /users/{username}/site_admin func (s *UsersService) DemoteSiteAdmin(ctx context.Context, user string) (*Response, error) { @@ -49,7 +49,7 @@ type UserSuspendOptions struct { // Suspend a user on a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#suspend-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#suspend-a-user // //meta:operation PUT /users/{username}/suspended func (s *UsersService) Suspend(ctx context.Context, user string, opts *UserSuspendOptions) (*Response, error) { @@ -65,7 +65,7 @@ func (s *UsersService) Suspend(ctx context.Context, user string, opts *UserSuspe // Unsuspend a user on a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#unsuspend-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#unsuspend-a-user // //meta:operation DELETE /users/{username}/suspended func (s *UsersService) Unsuspend(ctx context.Context, user string) (*Response, error) { diff --git a/openapi_operations.yaml b/openapi_operations.yaml index 53fe8c5fe52..2cc8bde30a7 100644 --- a/openapi_operations.yaml +++ b/openapi_operations.yaml @@ -48,260 +48,260 @@ operation_overrides: documentation_url: https://docs.github.com/rest/pages/pages#request-a-github-pages-build - name: GET /repos/{owner}/{repo}/pages/builds/{build_id} documentation_url: https://docs.github.com/rest/pages/pages#get-github-pages-build -openapi_commit: 6922a6cfe785e1069e93d6e501805cf6e1891076 +openapi_commit: b65cdcaa8a1453dd394cb898b35696a2130f4504 openapi_operations: - name: GET / documentation_url: https://docs.github.com/rest/meta/meta#github-api-root openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /admin/hooks - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/global-webhooks#list-global-webhooks + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/global-webhooks#list-global-webhooks openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /admin/hooks - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/global-webhooks#create-a-global-webhook + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/global-webhooks#create-a-global-webhook openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /admin/hooks/{hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/global-webhooks#delete-a-global-webhook + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/global-webhooks#delete-a-global-webhook openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /admin/hooks/{hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/global-webhooks#get-a-global-webhook + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/global-webhooks#get-a-global-webhook openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /admin/hooks/{hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/global-webhooks#update-a-global-webhook + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/global-webhooks#update-a-global-webhook openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /admin/hooks/{hook_id}/pings - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/global-webhooks#ping-a-global-webhook + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/global-webhooks#ping-a-global-webhook openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /admin/keys - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#list-public-keys + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#list-public-keys openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /admin/keys/{key_ids} - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#delete-a-public-key + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#delete-a-public-key openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /admin/ldap/teams/{team_id}/mapping - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /admin/ldap/teams/{team_id}/sync - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/ldap#sync-ldap-mapping-for-a-team + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/ldap#sync-ldap-mapping-for-a-team openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /admin/ldap/users/{username}/mapping - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /admin/ldap/users/{username}/sync - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/ldap#sync-ldap-mapping-for-a-user + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/ldap#sync-ldap-mapping-for-a-user openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /admin/organizations - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/orgs#create-an-organization + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/orgs#create-an-organization openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /admin/organizations/{org} - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/orgs#update-an-organization-name + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/orgs#update-an-organization-name openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /admin/pre-receive-environments - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-environments#list-pre-receive-environments + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/pre-receive-environments#list-pre-receive-environments openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /admin/pre-receive-environments - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-environments#create-a-pre-receive-environment + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/pre-receive-environments#create-a-pre-receive-environment openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /admin/pre-receive-environments/{pre_receive_environment_id} - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-environments#delete-a-pre-receive-environment + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/pre-receive-environments#delete-a-pre-receive-environment openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /admin/pre-receive-environments/{pre_receive_environment_id} - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-environments#get-a-pre-receive-environment + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/pre-receive-environments#get-a-pre-receive-environment openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /admin/pre-receive-environments/{pre_receive_environment_id} - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-environments#update-a-pre-receive-environment + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/pre-receive-environments#update-a-pre-receive-environment openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /admin/pre-receive-environments/{pre_receive_environment_id}/downloads - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-environments#start-a-pre-receive-environment-download + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/pre-receive-environments#start-a-pre-receive-environment-download openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /admin/pre-receive-environments/{pre_receive_environment_id}/downloads/latest - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-environments#get-the-download-status-for-a-pre-receive-environment + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/pre-receive-environments#get-the-download-status-for-a-pre-receive-environment openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /admin/pre-receive-hooks - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-hooks#list-pre-receive-hooks + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/pre-receive-hooks#list-pre-receive-hooks openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /admin/pre-receive-hooks - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-hooks#create-a-pre-receive-hook + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/pre-receive-hooks#create-a-pre-receive-hook openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /admin/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-hooks#delete-a-pre-receive-hook + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/pre-receive-hooks#delete-a-pre-receive-hook openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /admin/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-hooks#get-a-pre-receive-hook + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/pre-receive-hooks#get-a-pre-receive-hook openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /admin/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-hooks#update-a-pre-receive-hook + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/pre-receive-hooks#update-a-pre-receive-hook openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /admin/tokens - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#list-personal-access-tokens + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#list-personal-access-tokens openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /admin/tokens/{token_id} - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#delete-a-personal-access-token + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#delete-a-personal-access-token openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /admin/users - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#create-a-user + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#create-a-user openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /admin/users/{username} - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#delete-a-user + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#delete-a-user openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /admin/users/{username} - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#update-the-username-for-a-user + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#update-the-username-for-a-user openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /admin/users/{username}/authorizations - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#delete-an-impersonation-oauth-token + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#delete-an-impersonation-oauth-token openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /admin/users/{username}/authorizations - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#create-an-impersonation-oauth-token + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#create-an-impersonation-oauth-token openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /advisories documentation_url: https://docs.github.com/rest/security-advisories/global-advisories#list-global-security-advisories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /advisories/{ghsa_id} documentation_url: https://docs.github.com/rest/security-advisories/global-advisories#get-a-global-security-advisory openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /app documentation_url: https://docs.github.com/rest/apps/apps#get-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /app-manifests/{code}/conversions documentation_url: https://docs.github.com/rest/apps/apps#create-a-github-app-from-a-manifest openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /app/hook/config documentation_url: https://docs.github.com/rest/apps/webhooks#get-a-webhook-configuration-for-an-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /app/hook/config documentation_url: https://docs.github.com/rest/apps/webhooks#update-a-webhook-configuration-for-an-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /app/hook/deliveries documentation_url: https://docs.github.com/rest/apps/webhooks#list-deliveries-for-an-app-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /app/hook/deliveries/{delivery_id} documentation_url: https://docs.github.com/rest/apps/webhooks#get-a-delivery-for-an-app-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /app/hook/deliveries/{delivery_id}/attempts documentation_url: https://docs.github.com/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /app/installation-requests documentation_url: https://docs.github.com/rest/apps/apps#list-installation-requests-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /app/installations documentation_url: https://docs.github.com/rest/apps/apps#list-installations-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /app/installations/{installation_id} documentation_url: https://docs.github.com/rest/apps/apps#delete-an-installation-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /app/installations/{installation_id} documentation_url: https://docs.github.com/rest/apps/apps#get-an-installation-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /app/installations/{installation_id}/access_tokens documentation_url: https://docs.github.com/rest/apps/apps#create-an-installation-access-token-for-an-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /app/installations/{installation_id}/suspended documentation_url: https://docs.github.com/rest/apps/apps#unsuspend-an-app-installation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /app/installations/{installation_id}/suspended documentation_url: https://docs.github.com/rest/apps/apps#suspend-an-app-installation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /applications/grants - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/oauth-authorizations/oauth-authorizations#list-your-grants + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/oauth-authorizations/oauth-authorizations#list-your-grants openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /applications/grants/{grant_id} - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/oauth-authorizations/oauth-authorizations#delete-a-grant + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/oauth-authorizations/oauth-authorizations#delete-a-grant openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /applications/grants/{grant_id} - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/oauth-authorizations/oauth-authorizations#get-a-single-grant + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/oauth-authorizations/oauth-authorizations#get-a-single-grant openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /applications/{client_id}/grant documentation_url: https://docs.github.com/rest/apps/oauth-applications#delete-an-app-authorization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /applications/{client_id}/grants/{access_token} documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#revoke-a-grant-for-an-application openapi_files: @@ -311,25 +311,25 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /applications/{client_id}/token documentation_url: https://docs.github.com/rest/apps/oauth-applications#reset-a-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /applications/{client_id}/token documentation_url: https://docs.github.com/rest/apps/oauth-applications#check-a-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /applications/{client_id}/token/scoped documentation_url: https://docs.github.com/rest/apps/apps#create-a-scoped-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /applications/{client_id}/tokens/{access_token} documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#revoke-an-authorization-for-an-application openapi_files: @@ -347,7 +347,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /assignments/{assignment_id} documentation_url: https://docs.github.com/rest/classroom/classroom#get-an-assignment openapi_files: @@ -364,33 +364,33 @@ openapi_operations: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: GET /authorizations - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/oauth-authorizations/oauth-authorizations#list-your-authorizations + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/oauth-authorizations/oauth-authorizations#list-your-authorizations openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /authorizations - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/oauth-authorizations/oauth-authorizations#create-a-new-authorization + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/oauth-authorizations/oauth-authorizations#create-a-new-authorization openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /authorizations/clients/{client_id} - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/oauth-authorizations/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/oauth-authorizations/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /authorizations/clients/{client_id}/{fingerprint} - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/oauth-authorizations/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app-and-fingerprint + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/oauth-authorizations/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app-and-fingerprint openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /authorizations/{authorization_id} - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/oauth-authorizations/oauth-authorizations#delete-an-authorization + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/oauth-authorizations/oauth-authorizations#delete-an-authorization openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /authorizations/{authorization_id} - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/oauth-authorizations/oauth-authorizations#get-a-single-authorization + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/oauth-authorizations/oauth-authorizations#get-a-single-authorization openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /authorizations/{authorization_id} - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/oauth-authorizations/oauth-authorizations#update-an-existing-authorization + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/oauth-authorizations/oauth-authorizations#update-an-existing-authorization openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /classrooms documentation_url: https://docs.github.com/rest/classroom/classroom#list-classrooms openapi_files: @@ -411,100 +411,100 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /codes_of_conduct/{key} documentation_url: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-a-code-of-conduct openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /emojis documentation_url: https://docs.github.com/rest/emojis/emojis#get-emojis openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /enterprise-installation/{enterprise_or_org}/server-statistics documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/admin-stats#get-github-enterprise-server-statistics openapi_files: - descriptions/ghec/ghec.json - name: DELETE /enterprise/announcement - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/announcement#remove-the-global-announcement-banner + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/announcement#remove-the-global-announcement-banner openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /enterprise/announcement - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/announcement#get-the-global-announcement-banner + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/announcement#get-the-global-announcement-banner openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /enterprise/announcement - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/announcement#set-the-global-announcement-banner + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/announcement#set-the-global-announcement-banner openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /enterprise/settings/license - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/license#get-license-information + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/license#get-license-information openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /enterprise/stats/all - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-all-statistics + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/admin-stats#get-all-statistics openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /enterprise/stats/comments - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-comment-statistics + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/admin-stats#get-comment-statistics openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /enterprise/stats/gists - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-gist-statistics + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/admin-stats#get-gist-statistics openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /enterprise/stats/hooks - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-hooks-statistics + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/admin-stats#get-hooks-statistics openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /enterprise/stats/issues - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-issue-statistics + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/admin-stats#get-issue-statistics openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /enterprise/stats/milestones - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-milestone-statistics + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/admin-stats#get-milestone-statistics openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /enterprise/stats/orgs - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-organization-statistics + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/admin-stats#get-organization-statistics openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /enterprise/stats/pages - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-pages-statistics + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/admin-stats#get-pages-statistics openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /enterprise/stats/pulls - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-pull-request-statistics + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/admin-stats#get-pull-request-statistics openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /enterprise/stats/repos - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-repository-statistics + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/admin-stats#get-repository-statistics openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /enterprise/stats/security-products - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-security-products-statistics + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/admin-stats#get-security-products-statistics openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /enterprise/stats/users - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-users-statistics + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/admin-stats#get-users-statistics openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /enterprises/{enterprise}/actions/cache/usage documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/cache#get-github-actions-cache-usage-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /enterprises/{enterprise}/actions/cache/usage-policy - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/actions/cache#get-github-actions-cache-usage-policy-for-an-enterprise + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/actions/cache#get-github-actions-cache-usage-policy-for-an-enterprise openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /enterprises/{enterprise}/actions/cache/usage-policy - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/actions/cache#set-github-actions-cache-usage-policy-for-an-enterprise + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/actions/cache#set-github-actions-cache-usage-policy-for-an-enterprise openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /enterprises/{enterprise}/actions/oidc/customization/issuer documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/oidc#set-the-github-actions-oidc-custom-issuer-policy-for-an-enterprise openapi_files: @@ -513,177 +513,177 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-github-actions-permissions-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /enterprises/{enterprise}/actions/permissions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-github-actions-permissions-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /enterprises/{enterprise}/actions/permissions/organizations documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#list-selected-organizations-enabled-for-github-actions-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /enterprises/{enterprise}/actions/permissions/organizations documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-selected-organizations-enabled-for-github-actions-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#disable-a-selected-organization-for-github-actions-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#enable-a-selected-organization-for-github-actions-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /enterprises/{enterprise}/actions/permissions/selected-actions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /enterprises/{enterprise}/actions/permissions/selected-actions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /enterprises/{enterprise}/actions/permissions/workflow documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-default-workflow-permissions-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /enterprises/{enterprise}/actions/permissions/workflow documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-default-workflow-permissions-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /enterprises/{enterprise}/actions/runner-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /enterprises/{enterprise}/actions/runner-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-organization-access-to-a-self-hosted-runner-group-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-organization-access-for-a-self-hosted-runner-group-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-organization-access-to-a-self-hosted-runner-group-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-organization-access-to-a-self-hosted-runner-group-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /enterprises/{enterprise}/actions/runners documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /enterprises/{enterprise}/actions/runners/downloads documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#list-runner-applications-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /enterprises/{enterprise}/actions/runners/generate-jitconfig documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /enterprises/{enterprise}/actions/runners/registration-token documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#create-a-registration-token-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /enterprises/{enterprise}/actions/runners/remove-token documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#create-a-remove-token-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /enterprises/{enterprise}/actions/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /enterprises/{enterprise}/actions/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /enterprises/{enterprise}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /enterprises/{enterprise}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /enterprises/{enterprise}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels/{name} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#remove-a-custom-label-from-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /enterprises/{enterprise}/announcement documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/enterprises#remove-announcement-banner-from-enterprise openapi_files: @@ -700,22 +700,22 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#get-the-audit-log-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /enterprises/{enterprise}/code-scanning/alerts documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /enterprises/{enterprise}/code_security_and_analysis documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#get-code-security-and-analysis-features-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /enterprises/{enterprise}/code_security_and_analysis documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#update-code-security-and-analysis-features-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /enterprises/{enterprise}/consumed-licenses documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/license#list-enterprise-consumed-licenses openapi_files: @@ -725,7 +725,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /enterprises/{enterprise}/license-sync-status documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/license#get-a-license-sync-status openapi_files: @@ -735,7 +735,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /enterprises/{enterprise}/settings/billing/actions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#get-github-actions-billing-for-an-enterprise openapi_files: @@ -744,7 +744,7 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#get-github-advanced-security-active-committers-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /enterprises/{enterprise}/settings/billing/packages documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#get-github-packages-billing-for-an-enterprise openapi_files: @@ -757,207 +757,247 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#enable-or-disable-a-security-feature openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /events documentation_url: https://docs.github.com/rest/activity/events#list-public-events openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /feeds documentation_url: https://docs.github.com/rest/activity/feeds#get-feeds openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /gists documentation_url: https://docs.github.com/rest/gists/gists#list-gists-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /gists documentation_url: https://docs.github.com/rest/gists/gists#create-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /gists/public documentation_url: https://docs.github.com/rest/gists/gists#list-public-gists openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /gists/starred documentation_url: https://docs.github.com/rest/gists/gists#list-starred-gists openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /gists/{gist_id} documentation_url: https://docs.github.com/rest/gists/gists#delete-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /gists/{gist_id} documentation_url: https://docs.github.com/rest/gists/gists#get-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /gists/{gist_id} documentation_url: https://docs.github.com/rest/gists/gists#update-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /gists/{gist_id}/comments documentation_url: https://docs.github.com/rest/gists/comments#list-gist-comments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /gists/{gist_id}/comments documentation_url: https://docs.github.com/rest/gists/comments#create-a-gist-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /gists/{gist_id}/comments/{comment_id} documentation_url: https://docs.github.com/rest/gists/comments#delete-a-gist-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /gists/{gist_id}/comments/{comment_id} documentation_url: https://docs.github.com/rest/gists/comments#get-a-gist-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /gists/{gist_id}/comments/{comment_id} documentation_url: https://docs.github.com/rest/gists/comments#update-a-gist-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /gists/{gist_id}/commits documentation_url: https://docs.github.com/rest/gists/gists#list-gist-commits openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /gists/{gist_id}/forks documentation_url: https://docs.github.com/rest/gists/gists#list-gist-forks openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /gists/{gist_id}/forks documentation_url: https://docs.github.com/rest/gists/gists#fork-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /gists/{gist_id}/star documentation_url: https://docs.github.com/rest/gists/gists#unstar-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /gists/{gist_id}/star documentation_url: https://docs.github.com/rest/gists/gists#check-if-a-gist-is-starred openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /gists/{gist_id}/star documentation_url: https://docs.github.com/rest/gists/gists#star-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /gists/{gist_id}/{sha} documentation_url: https://docs.github.com/rest/gists/gists#get-a-gist-revision openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /gitignore/templates documentation_url: https://docs.github.com/rest/gitignore/gitignore#get-all-gitignore-templates openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /gitignore/templates/{name} documentation_url: https://docs.github.com/rest/gitignore/gitignore#get-a-gitignore-template openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /installation/repositories documentation_url: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-app-installation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /installation/token documentation_url: https://docs.github.com/rest/apps/installations#revoke-an-installation-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /issues documentation_url: https://docs.github.com/rest/issues/issues#list-issues-assigned-to-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /licenses documentation_url: https://docs.github.com/rest/licenses/licenses#get-all-commonly-used-licenses openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /licenses/{license} documentation_url: https://docs.github.com/rest/licenses/licenses#get-a-license openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json + - name: DELETE /manage/v1/access/ssh + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/manage-ghes#delete-ssh-key + openapi_files: + - descriptions/ghes-3.12/ghes-3.12.json + - name: GET /manage/v1/access/ssh + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/manage-ghes#get-ssh-keys + openapi_files: + - descriptions/ghes-3.12/ghes-3.12.json + - name: POST /manage/v1/access/ssh + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/manage-ghes#set-ssh-key + openapi_files: + - descriptions/ghes-3.12/ghes-3.12.json + - name: GET /manage/v1/checks/system-requirements + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/manage-ghes#get-system-requirements-check-results-on-configured-nodes + openapi_files: + - descriptions/ghes-3.12/ghes-3.12.json + - name: POST /manage/v1/config/init + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/manage-ghes#initialize-instance-configuration-with-license-upload + openapi_files: + - descriptions/ghes-3.12/ghes-3.12.json + - name: GET /manage/v1/config/license + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/manage-ghes#get-the-enterprise-license-information + openapi_files: + - descriptions/ghes-3.12/ghes-3.12.json + - name: PUT /manage/v1/config/license + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/manage-ghes#upload-an-enterprise-license + openapi_files: + - descriptions/ghes-3.12/ghes-3.12.json + - name: GET /manage/v1/config/license/check + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/manage-ghes#check-a-license + openapi_files: + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /manage/v1/config/nodes - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/manage-ghes#get-ghes-node-metadata-for-all-nodes + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/manage-ghes#get-ghes-node-metadata-for-all-nodes openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json + - name: GET /manage/v1/config/settings + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/manage-ghes#get-settings + openapi_files: + - descriptions/ghes-3.12/ghes-3.12.json + - name: PUT /manage/v1/config/settings + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/manage-ghes#set-settings + openapi_files: + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /manage/v1/maintenance - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/manage-ghes#get-the-status-of-maintenance-mode + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/manage-ghes#get-the-status-of-maintenance-mode openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /manage/v1/maintenance - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/manage-ghes#set-the-status-of-maintenance-mode + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/manage-ghes#set-the-status-of-maintenance-mode openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /manage/v1/replication/status - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-replica-nodes + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-replica-nodes openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /manage/v1/version - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/manage-ghes#get-all-ghes-release-versions-for-all-nodes + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/manage-ghes#get-all-ghes-release-versions-for-all-nodes openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /markdown documentation_url: https://docs.github.com/rest/markdown/markdown#render-a-markdown-document openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /markdown/raw documentation_url: https://docs.github.com/rest/markdown/markdown#render-a-markdown-document-in-raw-mode openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /marketplace_listing/accounts/{account_id} documentation_url: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account openapi_files: @@ -993,439 +1033,444 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /networks/{owner}/{repo}/events documentation_url: https://docs.github.com/rest/activity/events#list-public-events-for-a-network-of-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /notifications documentation_url: https://docs.github.com/rest/activity/notifications#list-notifications-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /notifications documentation_url: https://docs.github.com/rest/activity/notifications#mark-notifications-as-read openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json + - name: DELETE /notifications/threads/{thread_id} + documentation_url: https://docs.github.com/rest/activity/notifications#mark-a-thread-as-done + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /notifications/threads/{thread_id} documentation_url: https://docs.github.com/rest/activity/notifications#get-a-thread openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /notifications/threads/{thread_id} documentation_url: https://docs.github.com/rest/activity/notifications#mark-a-thread-as-read openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /notifications/threads/{thread_id}/subscription documentation_url: https://docs.github.com/rest/activity/notifications#delete-a-thread-subscription openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /notifications/threads/{thread_id}/subscription documentation_url: https://docs.github.com/rest/activity/notifications#get-a-thread-subscription-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /notifications/threads/{thread_id}/subscription documentation_url: https://docs.github.com/rest/activity/notifications#set-a-thread-subscription openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /octocat documentation_url: https://docs.github.com/rest/meta/meta#get-octocat openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /organizations documentation_url: https://docs.github.com/rest/orgs/orgs#list-organizations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /organizations/{organization_id}/custom_roles documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#deprecated---list-custom-repository-roles-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org} documentation_url: https://docs.github.com/rest/orgs/orgs#delete-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org} documentation_url: https://docs.github.com/rest/orgs/orgs#get-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /orgs/{org} documentation_url: https://docs.github.com/rest/orgs/orgs#update-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/actions/cache/usage documentation_url: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/actions/cache/usage-by-repository documentation_url: https://docs.github.com/rest/actions/cache#list-repositories-with-github-actions-cache-usage-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/actions/oidc/customization/sub documentation_url: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /orgs/{org}/actions/oidc/customization/sub documentation_url: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/actions/permissions documentation_url: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /orgs/{org}/actions/permissions documentation_url: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/actions/permissions/repositories documentation_url: https://docs.github.com/rest/actions/permissions#list-selected-repositories-enabled-for-github-actions-in-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /orgs/{org}/actions/permissions/repositories documentation_url: https://docs.github.com/rest/actions/permissions#set-selected-repositories-enabled-for-github-actions-in-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/actions/permissions/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/permissions#disable-a-selected-repository-for-github-actions-in-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /orgs/{org}/actions/permissions/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/permissions#enable-a-selected-repository-for-github-actions-in-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/actions/permissions/selected-actions documentation_url: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /orgs/{org}/actions/permissions/selected-actions documentation_url: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/actions/permissions/workflow documentation_url: https://docs.github.com/rest/actions/permissions#get-default-workflow-permissions-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /orgs/{org}/actions/permissions/workflow documentation_url: https://docs.github.com/rest/actions/permissions#set-default-workflow-permissions-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/actions/runner-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /orgs/{org}/actions/runner-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /orgs/{org}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-repository-access-to-a-self-hosted-runner-group-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-repository-access-for-a-self-hosted-runner-group-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-repository-access-to-a-self-hosted-runner-group-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/actions/runners documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/actions/runners/downloads documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /orgs/{org}/actions/runners/generate-jitconfig documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /orgs/{org}/actions/runners/registration-token documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /orgs/{org}/actions/runners/remove-token documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/actions/runners/{runner_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/actions/runners/{runner_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /orgs/{org}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /orgs/{org}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-a-custom-label-from-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/actions/secrets documentation_url: https://docs.github.com/rest/actions/secrets#list-organization-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/actions/secrets/public-key documentation_url: https://docs.github.com/rest/actions/secrets#get-an-organization-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#delete-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#get-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /orgs/{org}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/actions/secrets/{secret_name}/repositories documentation_url: https://docs.github.com/rest/actions/secrets#list-selected-repositories-for-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /orgs/{org}/actions/secrets/{secret_name}/repositories documentation_url: https://docs.github.com/rest/actions/secrets#set-selected-repositories-for-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/secrets#remove-selected-repository-from-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/secrets#add-selected-repository-to-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/actions/variables documentation_url: https://docs.github.com/rest/actions/variables#list-organization-variables openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /orgs/{org}/actions/variables documentation_url: https://docs.github.com/rest/actions/variables#create-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#delete-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#get-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /orgs/{org}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#update-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/actions/variables/{name}/repositories documentation_url: https://docs.github.com/rest/actions/variables#list-selected-repositories-for-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /orgs/{org}/actions/variables/{name}/repositories documentation_url: https://docs.github.com/rest/actions/variables#set-selected-repositories-for-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/variables#remove-selected-repository-from-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/variables#add-selected-repository-to-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/announcement documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/organizations#remove-announcement-banner-from-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/announcement documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/organizations#get-announcement-banner-for-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /orgs/{org}/announcement documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/organizations#set-announcement-banner-for-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/audit-log documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/orgs#get-the-audit-log-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/blocks documentation_url: https://docs.github.com/rest/orgs/blocking#list-users-blocked-by-an-organization openapi_files: @@ -1451,7 +1496,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/codespaces documentation_url: https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-the-organization openapi_files: @@ -1518,32 +1563,32 @@ openapi_operations: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: GET /orgs/{org}/copilot/billing - documentation_url: https://docs.github.com/rest/copilot/copilot-business#get-copilot-business-seat-information-and-settings-for-an-organization + documentation_url: https://docs.github.com/rest/copilot/copilot-user-management#get-copilot-seat-information-and-settings-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: GET /orgs/{org}/copilot/billing/seats - documentation_url: https://docs.github.com/rest/copilot/copilot-business#list-all-copilot-business-seat-assignments-for-an-organization + documentation_url: https://docs.github.com/rest/copilot/copilot-user-management#list-all-copilot-seat-assignments-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: DELETE /orgs/{org}/copilot/billing/selected_teams - documentation_url: https://docs.github.com/rest/copilot/copilot-business#remove-teams-from-the-copilot-business-subscription-for-an-organization + documentation_url: https://docs.github.com/rest/copilot/copilot-user-management#remove-teams-from-the-copilot-subscription-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: POST /orgs/{org}/copilot/billing/selected_teams - documentation_url: https://docs.github.com/rest/copilot/copilot-business#add-teams-to-the-copilot-business-subscription-for-an-organization + documentation_url: https://docs.github.com/rest/copilot/copilot-user-management#add-teams-to-the-copilot-subscription-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: DELETE /orgs/{org}/copilot/billing/selected_users - documentation_url: https://docs.github.com/rest/copilot/copilot-business#remove-users-from-the-copilot-business-subscription-for-an-organization + documentation_url: https://docs.github.com/rest/copilot/copilot-user-management#remove-users-from-the-copilot-subscription-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: POST /orgs/{org}/copilot/billing/selected_users - documentation_url: https://docs.github.com/rest/copilot/copilot-business#add-users-to-the-copilot-business-subscription-for-an-organization + documentation_url: https://docs.github.com/rest/copilot/copilot-user-management#add-users-to-the-copilot-subscription-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json @@ -1559,27 +1604,27 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /orgs/{org}/custom-repository-roles documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#create-a-custom-repository-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/custom-repository-roles/{role_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#delete-a-custom-repository-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/custom-repository-roles/{role_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#get-a-custom-repository-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /orgs/{org}/custom-repository-roles/{role_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#update-a-custom-repository-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /orgs/{org}/custom_roles documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#deprecated---create-a-custom-role openapi_files: @@ -1601,83 +1646,83 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/dependabot/secrets documentation_url: https://docs.github.com/rest/dependabot/secrets#list-organization-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/dependabot/secrets/public-key documentation_url: https://docs.github.com/rest/dependabot/secrets#get-an-organization-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#delete-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#get-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /orgs/{org}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories documentation_url: https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories documentation_url: https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/dependabot/secrets#add-selected-repository-to-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/docker/conflicts documentation_url: https://docs.github.com/rest/packages/packages#get-list-of-conflicting-packages-during-docker-migration-for-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/events documentation_url: https://docs.github.com/rest/activity/events#list-public-organization-events openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/external-group/{group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#get-an-external-group openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/external-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#list-external-groups-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/failed_invitations documentation_url: https://docs.github.com/rest/orgs/members#list-failed-organization-invitations openapi_files: @@ -1692,79 +1737,79 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /orgs/{org}/hooks documentation_url: https://docs.github.com/rest/orgs/webhooks#create-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/orgs/webhooks#delete-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/orgs/webhooks#get-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /orgs/{org}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/orgs/webhooks#update-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/hooks/{hook_id}/config documentation_url: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /orgs/{org}/hooks/{hook_id}/config documentation_url: https://docs.github.com/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/hooks/{hook_id}/deliveries documentation_url: https://docs.github.com/rest/orgs/webhooks#list-deliveries-for-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id} documentation_url: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-delivery-for-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts documentation_url: https://docs.github.com/rest/orgs/webhooks#redeliver-a-delivery-for-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /orgs/{org}/hooks/{hook_id}/pings documentation_url: https://docs.github.com/rest/orgs/webhooks#ping-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/installation documentation_url: https://docs.github.com/rest/apps/apps#get-an-organization-installation-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/installations documentation_url: https://docs.github.com/rest/orgs/orgs#list-app-installations-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/interaction-limits documentation_url: https://docs.github.com/rest/interactions/orgs#remove-interaction-restrictions-for-an-organization openapi_files: @@ -1805,25 +1850,25 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/members documentation_url: https://docs.github.com/rest/orgs/members#list-organization-members openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/members/{username} documentation_url: https://docs.github.com/rest/orgs/members#remove-an-organization-member openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/members/{username} documentation_url: https://docs.github.com/rest/orgs/members#check-organization-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/members/{username}/codespaces documentation_url: https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-a-user-in-organization openapi_files: @@ -1840,7 +1885,7 @@ openapi_operations: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: GET /orgs/{org}/members/{username}/copilot - documentation_url: https://docs.github.com/rest/copilot/copilot-business#get-copilot-business-seat-assignment-details-for-a-user + documentation_url: https://docs.github.com/rest/copilot/copilot-user-management#get-copilot-seat-assignment-details-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json @@ -1849,61 +1894,61 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/memberships/{username} documentation_url: https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /orgs/{org}/memberships/{username} documentation_url: https://docs.github.com/rest/orgs/members#set-organization-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/migrations documentation_url: https://docs.github.com/rest/migrations/orgs#list-organization-migrations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /orgs/{org}/migrations documentation_url: https://docs.github.com/rest/migrations/orgs#start-an-organization-migration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/migrations/{migration_id} documentation_url: https://docs.github.com/rest/migrations/orgs#get-an-organization-migration-status openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/migrations/{migration_id}/archive documentation_url: https://docs.github.com/rest/migrations/orgs#delete-an-organization-migration-archive openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/migrations/{migration_id}/archive documentation_url: https://docs.github.com/rest/migrations/orgs#download-an-organization-migration-archive openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock documentation_url: https://docs.github.com/rest/migrations/orgs#unlock-an-organization-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/migrations/{migration_id}/repositories documentation_url: https://docs.github.com/rest/migrations/orgs#list-repositories-in-an-organization-migration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/organization-fine-grained-permissions documentation_url: https://docs.github.com/rest/orgs/organization-roles#list-organization-fine-grained-permissions-for-an-organization openapi_files: @@ -1979,143 +2024,143 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/outside_collaborators/{username} documentation_url: https://docs.github.com/rest/orgs/outside-collaborators#remove-outside-collaborator-from-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /orgs/{org}/outside_collaborators/{username} documentation_url: https://docs.github.com/rest/orgs/outside-collaborators#convert-an-organization-member-to-outside-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/packages documentation_url: https://docs.github.com/rest/packages/packages#list-packages-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /orgs/{org}/packages/{package_type}/{package_name}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/packages/{package_type}/{package_name}/versions documentation_url: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#delete-package-version-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-version-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-package-version-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/personal-access-token-requests documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /orgs/{org}/personal-access-token-requests documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#review-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /orgs/{org}/personal-access-token-requests/{pat_request_id} documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#review-a-request-to-access-organization-resources-with-a-fine-grained-personal-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-repositories-requested-to-be-accessed-by-a-fine-grained-personal-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/personal-access-tokens documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-fine-grained-personal-access-tokens-with-access-to-organization-resources openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /orgs/{org}/personal-access-tokens documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#update-the-access-to-organization-resources-via-fine-grained-personal-access-tokens openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /orgs/{org}/personal-access-tokens/{pat_id} documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#update-the-access-a-fine-grained-personal-access-token-has-to-organization-resources openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-repositories-a-fine-grained-personal-access-token-has-access-to openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/pre-receive-hooks - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/org-pre-receive-hooks#list-pre-receive-hooks-for-an-organization + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/org-pre-receive-hooks#list-pre-receive-hooks-for-an-organization openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/org-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-an-organization + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/org-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-an-organization openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/org-pre-receive-hooks#get-a-pre-receive-hook-for-an-organization + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/org-pre-receive-hooks#get-a-pre-receive-hook-for-an-organization openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /orgs/{org}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/org-pre-receive-hooks#update-pre-receive-hook-enforcement-for-an-organization + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/org-pre-receive-hooks#update-pre-receive-hook-enforcement-for-an-organization openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/projects documentation_url: https://docs.github.com/rest/projects/projects#list-organization-projects openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /orgs/{org}/projects documentation_url: https://docs.github.com/rest/projects/projects#create-an-organization-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/properties/schema documentation_url: https://docs.github.com/rest/orgs/custom-properties#get-all-custom-properties-for-an-organization openapi_files: @@ -2156,88 +2201,90 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/public_members/{username} documentation_url: https://docs.github.com/rest/orgs/members#remove-public-organization-membership-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/public_members/{username} documentation_url: https://docs.github.com/rest/orgs/members#check-public-organization-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /orgs/{org}/public_members/{username} documentation_url: https://docs.github.com/rest/orgs/members#set-public-organization-membership-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/repos documentation_url: https://docs.github.com/rest/repos/repos#list-organization-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /orgs/{org}/repos documentation_url: https://docs.github.com/rest/repos/repos#create-an-organization-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/repository-fine-grained-permissions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#list-repository-fine-grained-permissions-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/rulesets documentation_url: https://docs.github.com/rest/orgs/rules#get-all-organization-repository-rulesets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /orgs/{org}/rulesets documentation_url: https://docs.github.com/rest/orgs/rules#create-an-organization-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/rulesets/rule-suites documentation_url: https://docs.github.com/rest/orgs/rule-suites#list-organization-rule-suites openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id} documentation_url: https://docs.github.com/rest/orgs/rule-suites#get-an-organization-rule-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/orgs/rules#delete-an-organization-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/orgs/rules#get-an-organization-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /orgs/{org}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/orgs/rules#update-an-organization-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/secret-scanning/alerts documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/security-advisories documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories-for-an-organization openapi_files: @@ -2248,19 +2295,19 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/security-managers/teams/{team_slug} documentation_url: https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /orgs/{org}/security-managers/teams/{team_slug} documentation_url: https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/settings/billing/actions documentation_url: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-an-organization openapi_files: @@ -2270,7 +2317,7 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/billing/billing#get-github-advanced-security-active-committers-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/settings/billing/packages documentation_url: https://docs.github.com/rest/billing/billing#get-github-packages-billing-for-an-organization openapi_files: @@ -2290,142 +2337,142 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /orgs/{org}/teams documentation_url: https://docs.github.com/rest/teams/teams#create-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/teams/{team_slug} documentation_url: https://docs.github.com/rest/teams/teams#delete-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/teams/{team_slug} documentation_url: https://docs.github.com/rest/teams/teams#get-a-team-by-name openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /orgs/{org}/teams/{team_slug} documentation_url: https://docs.github.com/rest/teams/teams#update-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/teams/{team_slug}/discussions documentation_url: https://docs.github.com/rest/teams/discussions#list-discussions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /orgs/{org}/teams/{team_slug}/discussions documentation_url: https://docs.github.com/rest/teams/discussions#create-a-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#delete-a-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#get-a-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#update-a-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments documentation_url: https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments documentation_url: https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-team-discussion-comment-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-team-discussion-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/teams/{team_slug}/external-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#remove-the-connection-between-an-external-group-and-a-team openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/teams/{team_slug}/external-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#list-a-connection-between-an-external-group-and-a-team openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /orgs/{org}/teams/{team_slug}/external-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#update-the-connection-between-an-external-group-and-a-team openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/teams/{team_slug}/invitations documentation_url: https://docs.github.com/rest/teams/members#list-pending-team-invitations openapi_files: @@ -2436,73 +2483,73 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/teams/{team_slug}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/teams/{team_slug}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#get-team-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /orgs/{org}/teams/{team_slug}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/teams/{team_slug}/projects documentation_url: https://docs.github.com/rest/teams/teams#list-team-projects openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/teams/{team_slug}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /orgs/{org}/teams/{team_slug}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/teams/{team_slug}/repos documentation_url: https://docs.github.com/rest/teams/teams#list-team-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#list-idp-groups-for-a-team openapi_files: @@ -2516,133 +2563,133 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /orgs/{org}/{security_product}/{enablement} documentation_url: https://docs.github.com/rest/orgs/orgs#enable-or-disable-a-security-feature-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /projects/columns/cards/{card_id} documentation_url: https://docs.github.com/rest/projects/cards#delete-a-project-card openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /projects/columns/cards/{card_id} documentation_url: https://docs.github.com/rest/projects/cards#get-a-project-card openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /projects/columns/cards/{card_id} documentation_url: https://docs.github.com/rest/projects/cards#update-an-existing-project-card openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /projects/columns/cards/{card_id}/moves documentation_url: https://docs.github.com/rest/projects/cards#move-a-project-card openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /projects/columns/{column_id} documentation_url: https://docs.github.com/rest/projects/columns#delete-a-project-column openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /projects/columns/{column_id} documentation_url: https://docs.github.com/rest/projects/columns#get-a-project-column openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /projects/columns/{column_id} documentation_url: https://docs.github.com/rest/projects/columns#update-an-existing-project-column openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /projects/columns/{column_id}/cards documentation_url: https://docs.github.com/rest/projects/cards#list-project-cards openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /projects/columns/{column_id}/cards documentation_url: https://docs.github.com/rest/projects/cards#create-a-project-card openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /projects/columns/{column_id}/moves documentation_url: https://docs.github.com/rest/projects/columns#move-a-project-column openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /projects/{project_id} documentation_url: https://docs.github.com/rest/projects/projects#delete-a-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /projects/{project_id} documentation_url: https://docs.github.com/rest/projects/projects#get-a-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /projects/{project_id} documentation_url: https://docs.github.com/rest/projects/projects#update-a-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /projects/{project_id}/collaborators documentation_url: https://docs.github.com/rest/projects/collaborators#list-project-collaborators openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /projects/{project_id}/collaborators/{username} documentation_url: https://docs.github.com/rest/projects/collaborators#remove-user-as-a-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /projects/{project_id}/collaborators/{username} documentation_url: https://docs.github.com/rest/projects/collaborators#add-project-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /projects/{project_id}/collaborators/{username}/permission documentation_url: https://docs.github.com/rest/projects/collaborators#get-project-permission-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /projects/{project_id}/columns documentation_url: https://docs.github.com/rest/projects/columns#list-project-columns openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /projects/{project_id}/columns documentation_url: https://docs.github.com/rest/projects/columns#create-a-project-column openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /rate_limit documentation_url: https://docs.github.com/rest/rate-limit/rate-limit#get-rate-limit-status-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /reactions/{reaction_id} documentation_url: https://docs.github.com/enterprise-server@3.4/rest/reference/reactions/#delete-a-reaction-legacy openapi_files: @@ -2652,261 +2699,261 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/repos/repos#get-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/repos/repos#update-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/artifacts documentation_url: https://docs.github.com/rest/actions/artifacts#list-artifacts-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id} documentation_url: https://docs.github.com/rest/actions/artifacts#delete-an-artifact openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id} documentation_url: https://docs.github.com/rest/actions/artifacts#get-an-artifact openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format} documentation_url: https://docs.github.com/rest/actions/artifacts#download-an-artifact openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/cache/usage documentation_url: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/cache/usage-policy - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/actions/cache#get-github-actions-cache-usage-policy-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/actions/cache#get-github-actions-cache-usage-policy-for-a-repository openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /repos/{owner}/{repo}/actions/cache/usage-policy - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/actions/cache#set-github-actions-cache-usage-policy-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/actions/cache#set-github-actions-cache-usage-policy-for-a-repository openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/actions/caches documentation_url: https://docs.github.com/rest/actions/cache#delete-github-actions-caches-for-a-repository-using-a-cache-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/caches documentation_url: https://docs.github.com/rest/actions/cache#list-github-actions-caches-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/actions/caches/{cache_id} documentation_url: https://docs.github.com/rest/actions/cache#delete-a-github-actions-cache-for-a-repository-using-a-cache-id openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/jobs/{job_id} documentation_url: https://docs.github.com/rest/actions/workflow-jobs#get-a-job-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs documentation_url: https://docs.github.com/rest/actions/workflow-jobs#download-job-logs-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun documentation_url: https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/oidc/customization/sub documentation_url: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /repos/{owner}/{repo}/actions/oidc/customization/sub documentation_url: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/organization-secrets documentation_url: https://docs.github.com/rest/actions/secrets#list-repository-organization-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/organization-variables documentation_url: https://docs.github.com/rest/actions/variables#list-repository-organization-variables openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/permissions documentation_url: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /repos/{owner}/{repo}/actions/permissions documentation_url: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/permissions/access documentation_url: https://docs.github.com/rest/actions/permissions#get-the-level-of-access-for-workflows-outside-of-the-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /repos/{owner}/{repo}/actions/permissions/access documentation_url: https://docs.github.com/rest/actions/permissions#set-the-level-of-access-for-workflows-outside-of-the-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/permissions/selected-actions documentation_url: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /repos/{owner}/{repo}/actions/permissions/selected-actions documentation_url: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/permissions/workflow documentation_url: https://docs.github.com/rest/actions/permissions#get-default-workflow-permissions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /repos/{owner}/{repo}/actions/permissions/workflow documentation_url: https://docs.github.com/rest/actions/permissions#set-default-workflow-permissions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/runners documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/runners/downloads documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/actions/runners/registration-token documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/actions/runners/remove-token documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/actions/runners/{runner_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/runners/{runner_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-a-custom-label-from-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/runs documentation_url: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/actions/runs/{run_id} documentation_url: https://docs.github.com/rest/actions/workflow-runs#delete-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id} documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-the-review-history-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve documentation_url: https://docs.github.com/rest/actions/workflow-runs#approve-a-workflow-run-for-a-fork-pull-request openapi_files: @@ -2917,84 +2964,85 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number} documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run-attempt openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs documentation_url: https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run-attempt openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs documentation_url: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-attempt-logs openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel documentation_url: https://docs.github.com/rest/actions/workflow-runs#cancel-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule documentation_url: https://docs.github.com/rest/actions/workflow-runs#review-custom-deployment-protection-rules-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel documentation_url: https://docs.github.com/rest/actions/workflow-runs#force-cancel-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs documentation_url: https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs documentation_url: https://docs.github.com/rest/actions/workflow-runs#delete-workflow-run-logs openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs documentation_url: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-logs openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-pending-deployments-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments documentation_url: https://docs.github.com/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun documentation_url: https://docs.github.com/rest/actions/workflow-runs#re-run-a-workflow openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs documentation_url: https://docs.github.com/rest/actions/workflow-runs#re-run-failed-jobs-from-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-workflow-run-usage openapi_files: @@ -3005,97 +3053,97 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/secrets/public-key documentation_url: https://docs.github.com/rest/actions/secrets#get-a-repository-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#delete-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#get-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /repos/{owner}/{repo}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#create-or-update-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/variables documentation_url: https://docs.github.com/rest/actions/variables#list-repository-variables openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/actions/variables documentation_url: https://docs.github.com/rest/actions/variables#create-a-repository-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#delete-a-repository-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#get-a-repository-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /repos/{owner}/{repo}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#update-a-repository-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/workflows documentation_url: https://docs.github.com/rest/actions/workflows#list-repository-workflows openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/workflows/{workflow_id} documentation_url: https://docs.github.com/rest/actions/workflows#get-a-workflow openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable documentation_url: https://docs.github.com/rest/actions/workflows#disable-a-workflow openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches documentation_url: https://docs.github.com/rest/actions/workflows#create-a-workflow-dispatch-event openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable documentation_url: https://docs.github.com/rest/actions/workflows#enable-a-workflow openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs documentation_url: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-workflow openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing documentation_url: https://docs.github.com/rest/actions/workflows#get-workflow-usage openapi_files: @@ -3106,43 +3154,43 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/assignees documentation_url: https://docs.github.com/rest/issues/assignees#list-assignees openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/assignees/{assignee} documentation_url: https://docs.github.com/rest/issues/assignees#check-if-a-user-can-be-assigned openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/autolinks - documentation_url: https://docs.github.com/rest/repos/autolinks#list-all-autolinks-of-a-repository + documentation_url: https://docs.github.com/rest/repos/autolinks#get-all-autolinks-of-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/autolinks documentation_url: https://docs.github.com/rest/repos/autolinks#create-an-autolink-reference-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/autolinks/{autolink_id} documentation_url: https://docs.github.com/rest/repos/autolinks#delete-an-autolink-reference-from-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/autolinks/{autolink_id} documentation_url: https://docs.github.com/rest/repos/autolinks#get-an-autolink-reference-of-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/automated-security-fixes documentation_url: https://docs.github.com/rest/repos/repos#disable-automated-security-fixes openapi_files: @@ -3153,7 +3201,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /repos/{owner}/{repo}/automated-security-fixes documentation_url: https://docs.github.com/rest/repos/repos#enable-automated-security-fixes openapi_files: @@ -3164,319 +3212,319 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/branches/{branch} documentation_url: https://docs.github.com/rest/branches/branches#get-a-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection documentation_url: https://docs.github.com/rest/branches/branch-protection#get-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection documentation_url: https://docs.github.com/rest/branches/branch-protection#update-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-admin-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins documentation_url: https://docs.github.com/rest/branches/branch-protection#get-admin-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins documentation_url: https://docs.github.com/rest/branches/branch-protection#set-admin-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-pull-request-review-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews documentation_url: https://docs.github.com/rest/branches/branch-protection#get-pull-request-review-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews documentation_url: https://docs.github.com/rest/branches/branch-protection#update-pull-request-review-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-commit-signature-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures documentation_url: https://docs.github.com/rest/branches/branch-protection#get-commit-signature-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures documentation_url: https://docs.github.com/rest/branches/branch-protection#create-commit-signature-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-status-check-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks documentation_url: https://docs.github.com/rest/branches/branch-protection#get-status-checks-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks documentation_url: https://docs.github.com/rest/branches/branch-protection#update-status-check-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-status-check-contexts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts documentation_url: https://docs.github.com/rest/branches/branch-protection#get-all-status-check-contexts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts documentation_url: https://docs.github.com/rest/branches/branch-protection#add-status-check-contexts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts documentation_url: https://docs.github.com/rest/branches/branch-protection#set-status-check-contexts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions documentation_url: https://docs.github.com/rest/branches/branch-protection#get-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-app-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps documentation_url: https://docs.github.com/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps documentation_url: https://docs.github.com/rest/branches/branch-protection#add-app-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps documentation_url: https://docs.github.com/rest/branches/branch-protection#set-app-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-team-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams documentation_url: https://docs.github.com/rest/branches/branch-protection#get-teams-with-access-to-the-protected-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams documentation_url: https://docs.github.com/rest/branches/branch-protection#add-team-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams documentation_url: https://docs.github.com/rest/branches/branch-protection#set-team-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-user-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users documentation_url: https://docs.github.com/rest/branches/branch-protection#get-users-with-access-to-the-protected-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users documentation_url: https://docs.github.com/rest/branches/branch-protection#add-user-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users documentation_url: https://docs.github.com/rest/branches/branch-protection#set-user-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/branches/{branch}/rename documentation_url: https://docs.github.com/rest/branches/branches#rename-a-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/check-runs documentation_url: https://docs.github.com/rest/checks/runs#create-a-check-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/check-runs/{check_run_id} documentation_url: https://docs.github.com/rest/checks/runs#get-a-check-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /repos/{owner}/{repo}/check-runs/{check_run_id} documentation_url: https://docs.github.com/rest/checks/runs#update-a-check-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations documentation_url: https://docs.github.com/rest/checks/runs#list-check-run-annotations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest documentation_url: https://docs.github.com/rest/checks/runs#rerequest-a-check-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/check-suites documentation_url: https://docs.github.com/rest/checks/suites#create-a-check-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /repos/{owner}/{repo}/check-suites/preferences documentation_url: https://docs.github.com/rest/checks/suites#update-repository-preferences-for-check-suites openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/check-suites/{check_suite_id} documentation_url: https://docs.github.com/rest/checks/suites#get-a-check-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs documentation_url: https://docs.github.com/rest/checks/runs#list-check-runs-in-a-check-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest documentation_url: https://docs.github.com/rest/checks/suites#rerequest-a-check-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/code-scanning/alerts documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-instances-of-a-code-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/code-scanning/analyses documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-analyses-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#delete-a-code-scanning-analysis-from-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/code-scanning/codeql/databases documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-codeql-databases-for-a-repository openapi_files: @@ -3492,31 +3540,31 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /repos/{owner}/{repo}/code-scanning/default-setup documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-default-setup-configuration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/code-scanning/sarifs documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#upload-an-analysis-as-sarif-data openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-information-about-a-sarif-upload openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/codeowners/errors documentation_url: https://docs.github.com/rest/repos/repos#list-codeowners-errors openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/codespaces documentation_url: https://docs.github.com/rest/codespaces/codespaces#list-codespaces-in-a-repository-for-the-authenticated-user openapi_files: @@ -3577,133 +3625,133 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/collaborators/{username} documentation_url: https://docs.github.com/rest/collaborators/collaborators#remove-a-repository-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/collaborators/{username} documentation_url: https://docs.github.com/rest/collaborators/collaborators#check-if-a-user-is-a-repository-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /repos/{owner}/{repo}/collaborators/{username} documentation_url: https://docs.github.com/rest/collaborators/collaborators#add-a-repository-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/collaborators/{username}/permission documentation_url: https://docs.github.com/rest/collaborators/collaborators#get-repository-permissions-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/comments documentation_url: https://docs.github.com/rest/commits/comments#list-commit-comments-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/comments/{comment_id} documentation_url: https://docs.github.com/rest/commits/comments#delete-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/comments/{comment_id} documentation_url: https://docs.github.com/rest/commits/comments#get-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /repos/{owner}/{repo}/comments/{comment_id} documentation_url: https://docs.github.com/rest/commits/comments#update-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-a-commit-comment-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/commits documentation_url: https://docs.github.com/rest/commits/commits#list-commits openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head documentation_url: https://docs.github.com/rest/commits/commits#list-branches-for-head-commit openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/commits/{commit_sha}/comments documentation_url: https://docs.github.com/rest/commits/comments#list-commit-comments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/commits/{commit_sha}/comments documentation_url: https://docs.github.com/rest/commits/comments#create-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls documentation_url: https://docs.github.com/rest/commits/commits#list-pull-requests-associated-with-a-commit openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/commits/{ref} documentation_url: https://docs.github.com/rest/commits/commits#get-a-commit openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/commits/{ref}/check-runs documentation_url: https://docs.github.com/rest/checks/runs#list-check-runs-for-a-git-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/commits/{ref}/check-suites documentation_url: https://docs.github.com/rest/checks/suites#list-check-suites-for-a-git-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/commits/{ref}/status documentation_url: https://docs.github.com/rest/commits/statuses#get-the-combined-status-for-a-specific-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/commits/{ref}/statuses documentation_url: https://docs.github.com/rest/commits/statuses#list-commit-statuses-for-a-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/community/profile documentation_url: https://docs.github.com/rest/metrics/community#get-community-profile-metrics openapi_files: @@ -3714,7 +3762,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#create-a-content-attachment openapi_files: @@ -3724,391 +3772,451 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/contents/{path} documentation_url: https://docs.github.com/rest/repos/contents#get-repository-content openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /repos/{owner}/{repo}/contents/{path} documentation_url: https://docs.github.com/rest/repos/contents#create-or-update-file-contents openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/contributors documentation_url: https://docs.github.com/rest/repos/repos#list-repository-contributors openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/dependabot/alerts documentation_url: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number} documentation_url: https://docs.github.com/rest/dependabot/alerts#get-a-dependabot-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number} documentation_url: https://docs.github.com/rest/dependabot/alerts#update-a-dependabot-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/dependabot/secrets documentation_url: https://docs.github.com/rest/dependabot/secrets#list-repository-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/dependabot/secrets/public-key documentation_url: https://docs.github.com/rest/dependabot/secrets#get-a-repository-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#delete-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#get-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#create-or-update-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead} documentation_url: https://docs.github.com/rest/dependency-graph/dependency-review#get-a-diff-of-the-dependencies-between-commits openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/dependency-graph/sbom documentation_url: https://docs.github.com/rest/dependency-graph/sboms#export-a-software-bill-of-materials-sbom-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/dependency-graph/snapshots documentation_url: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/deployments documentation_url: https://docs.github.com/rest/deployments/deployments#list-deployments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/deployments documentation_url: https://docs.github.com/rest/deployments/deployments#create-a-deployment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/deployments/{deployment_id} documentation_url: https://docs.github.com/rest/deployments/deployments#delete-a-deployment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/deployments/{deployment_id} documentation_url: https://docs.github.com/rest/deployments/deployments#get-a-deployment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses documentation_url: https://docs.github.com/rest/deployments/statuses#list-deployment-statuses openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses documentation_url: https://docs.github.com/rest/deployments/statuses#create-a-deployment-status openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id} documentation_url: https://docs.github.com/rest/deployments/statuses#get-a-deployment-status openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/dispatches documentation_url: https://docs.github.com/rest/repos/repos#create-a-repository-dispatch-event openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/environments documentation_url: https://docs.github.com/rest/deployments/environments#list-environments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/environments/{environment_name} documentation_url: https://docs.github.com/rest/deployments/environments#delete-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/environments/{environment_name} documentation_url: https://docs.github.com/rest/deployments/environments#get-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /repos/{owner}/{repo}/environments/{environment_name} documentation_url: https://docs.github.com/rest/deployments/environments#create-or-update-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies documentation_url: https://docs.github.com/rest/deployments/branch-policies#list-deployment-branch-policies openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies documentation_url: https://docs.github.com/rest/deployments/branch-policies#create-a-deployment-branch-policy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} documentation_url: https://docs.github.com/rest/deployments/branch-policies#delete-a-deployment-branch-policy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} documentation_url: https://docs.github.com/rest/deployments/branch-policies#get-a-deployment-branch-policy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} documentation_url: https://docs.github.com/rest/deployments/branch-policies#update-a-deployment-branch-policy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules documentation_url: https://docs.github.com/rest/deployments/protection-rules#get-all-deployment-protection-rules-for-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules documentation_url: https://docs.github.com/rest/deployments/protection-rules#create-a-custom-deployment-protection-rule-on-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps documentation_url: https://docs.github.com/rest/deployments/protection-rules#list-custom-deployment-rule-integrations-available-for-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id} documentation_url: https://docs.github.com/rest/deployments/protection-rules#disable-a-custom-protection-rule-for-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id} documentation_url: https://docs.github.com/rest/deployments/protection-rules#get-a-custom-deployment-protection-rule openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json + - name: GET /repos/{owner}/{repo}/environments/{environment_name}/secrets + documentation_url: https://docs.github.com/rest/actions/secrets#list-environment-secrets + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.12/ghes-3.12.json + - name: GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key + documentation_url: https://docs.github.com/rest/actions/secrets#get-an-environment-public-key + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.12/ghes-3.12.json + - name: DELETE /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/actions/secrets#delete-an-environment-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.12/ghes-3.12.json + - name: GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/actions/secrets#get-an-environment-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.12/ghes-3.12.json + - name: PUT /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/actions/secrets#create-or-update-an-environment-secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.12/ghes-3.12.json + - name: GET /repos/{owner}/{repo}/environments/{environment_name}/variables + documentation_url: https://docs.github.com/rest/actions/variables#list-environment-variables + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.12/ghes-3.12.json + - name: POST /repos/{owner}/{repo}/environments/{environment_name}/variables + documentation_url: https://docs.github.com/rest/actions/variables#create-an-environment-variable + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.12/ghes-3.12.json + - name: DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name} + documentation_url: https://docs.github.com/rest/actions/variables#delete-an-environment-variable + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.12/ghes-3.12.json + - name: GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name} + documentation_url: https://docs.github.com/rest/actions/variables#get-an-environment-variable + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.12/ghes-3.12.json + - name: PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name} + documentation_url: https://docs.github.com/rest/actions/variables#update-an-environment-variable + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/events documentation_url: https://docs.github.com/rest/activity/events#list-repository-events openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/forks documentation_url: https://docs.github.com/rest/repos/forks#list-forks openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/forks documentation_url: https://docs.github.com/rest/repos/forks#create-a-fork openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/git/blobs documentation_url: https://docs.github.com/rest/git/blobs#create-a-blob openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/git/blobs/{file_sha} documentation_url: https://docs.github.com/rest/git/blobs#get-a-blob openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/git/commits documentation_url: https://docs.github.com/rest/git/commits#create-a-commit openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/git/commits/{commit_sha} documentation_url: https://docs.github.com/rest/git/commits#get-a-commit-object openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/git/matching-refs/{ref} documentation_url: https://docs.github.com/rest/git/refs#list-matching-references openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/git/ref/{ref} documentation_url: https://docs.github.com/rest/git/refs#get-a-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/git/refs documentation_url: https://docs.github.com/rest/git/refs#create-a-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/git/refs/{ref} documentation_url: https://docs.github.com/rest/git/refs#delete-a-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /repos/{owner}/{repo}/git/refs/{ref} documentation_url: https://docs.github.com/rest/git/refs#update-a-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/git/tags documentation_url: https://docs.github.com/rest/git/tags#create-a-tag-object openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/git/tags/{tag_sha} documentation_url: https://docs.github.com/rest/git/tags#get-a-tag openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/git/trees documentation_url: https://docs.github.com/rest/git/trees#create-a-tree openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/git/trees/{tree_sha} documentation_url: https://docs.github.com/rest/git/trees#get-a-tree openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/hooks documentation_url: https://docs.github.com/rest/repos/webhooks#list-repository-webhooks openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/hooks documentation_url: https://docs.github.com/rest/repos/webhooks#create-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/repos/webhooks#delete-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/repos/webhooks#get-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /repos/{owner}/{repo}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/repos/webhooks#update-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/hooks/{hook_id}/config documentation_url: https://docs.github.com/rest/repos/webhooks#get-a-webhook-configuration-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config documentation_url: https://docs.github.com/rest/repos/webhooks#update-a-webhook-configuration-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries documentation_url: https://docs.github.com/rest/repos/webhooks#list-deliveries-for-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id} documentation_url: https://docs.github.com/rest/repos/webhooks#get-a-delivery-for-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts documentation_url: https://docs.github.com/rest/repos/webhooks#redeliver-a-delivery-for-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/hooks/{hook_id}/pings documentation_url: https://docs.github.com/rest/repos/webhooks#ping-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/hooks/{hook_id}/tests documentation_url: https://docs.github.com/rest/repos/webhooks#test-the-push-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/import documentation_url: https://docs.github.com/rest/migrations/source-imports#cancel-an-import openapi_files: @@ -4154,7 +4262,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/interaction-limits documentation_url: https://docs.github.com/rest/interactions/repos#remove-interaction-restrictions-for-a-repository openapi_files: @@ -4175,415 +4283,434 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/invitations/{invitation_id} documentation_url: https://docs.github.com/rest/collaborators/invitations#delete-a-repository-invitation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /repos/{owner}/{repo}/invitations/{invitation_id} documentation_url: https://docs.github.com/rest/collaborators/invitations#update-a-repository-invitation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/issues documentation_url: https://docs.github.com/rest/issues/issues#list-repository-issues openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/issues documentation_url: https://docs.github.com/rest/issues/issues#create-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/issues/comments documentation_url: https://docs.github.com/rest/issues/comments#list-issue-comments-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/issues/comments/{comment_id} documentation_url: https://docs.github.com/rest/issues/comments#delete-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/issues/comments/{comment_id} documentation_url: https://docs.github.com/rest/issues/comments#get-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /repos/{owner}/{repo}/issues/comments/{comment_id} documentation_url: https://docs.github.com/rest/issues/comments#update-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-an-issue-comment-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/issues/events documentation_url: https://docs.github.com/rest/issues/events#list-issue-events-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/issues/events/{event_id} documentation_url: https://docs.github.com/rest/issues/events#get-an-issue-event openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/issues/{issue_number} documentation_url: https://docs.github.com/rest/issues/issues#get-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /repos/{owner}/{repo}/issues/{issue_number} documentation_url: https://docs.github.com/rest/issues/issues#update-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees documentation_url: https://docs.github.com/rest/issues/assignees#remove-assignees-from-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/issues/{issue_number}/assignees documentation_url: https://docs.github.com/rest/issues/assignees#add-assignees-to-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee} documentation_url: https://docs.github.com/rest/issues/assignees#check-if-a-user-can-be-assigned-to-a-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/comments documentation_url: https://docs.github.com/rest/issues/comments#list-issue-comments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/issues/{issue_number}/comments documentation_url: https://docs.github.com/rest/issues/comments#create-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/events documentation_url: https://docs.github.com/rest/issues/events#list-issue-events openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels documentation_url: https://docs.github.com/rest/issues/labels#remove-all-labels-from-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/labels documentation_url: https://docs.github.com/rest/issues/labels#list-labels-for-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/issues/{issue_number}/labels documentation_url: https://docs.github.com/rest/issues/labels#add-labels-to-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /repos/{owner}/{repo}/issues/{issue_number}/labels documentation_url: https://docs.github.com/rest/issues/labels#set-labels-for-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name} documentation_url: https://docs.github.com/rest/issues/labels#remove-a-label-from-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock documentation_url: https://docs.github.com/rest/issues/issues#unlock-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /repos/{owner}/{repo}/issues/{issue_number}/lock documentation_url: https://docs.github.com/rest/issues/issues#lock-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/issues/{issue_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-an-issue-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/timeline documentation_url: https://docs.github.com/rest/issues/timeline#list-timeline-events-for-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/keys documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#list-deploy-keys openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/keys documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#create-a-deploy-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/keys/{key_id} documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#delete-a-deploy-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/keys/{key_id} documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#get-a-deploy-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/labels documentation_url: https://docs.github.com/rest/issues/labels#list-labels-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/labels documentation_url: https://docs.github.com/rest/issues/labels#create-a-label openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/labels/{name} documentation_url: https://docs.github.com/rest/issues/labels#delete-a-label openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/labels/{name} documentation_url: https://docs.github.com/rest/issues/labels#get-a-label openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /repos/{owner}/{repo}/labels/{name} documentation_url: https://docs.github.com/rest/issues/labels#update-a-label openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/languages documentation_url: https://docs.github.com/rest/repos/repos#list-repository-languages openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/lfs documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/repos/lfs#disable-git-lfs-for-a-repository openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /repos/{owner}/{repo}/lfs documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/repos/lfs#enable-git-lfs-for-a-repository openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/license documentation_url: https://docs.github.com/rest/licenses/licenses#get-the-license-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/merge-upstream documentation_url: https://docs.github.com/rest/branches/branches#sync-a-fork-branch-with-the-upstream-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/merges documentation_url: https://docs.github.com/rest/branches/branches#merge-a-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/milestones documentation_url: https://docs.github.com/rest/issues/milestones#list-milestones openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/milestones documentation_url: https://docs.github.com/rest/issues/milestones#create-a-milestone openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/milestones/{milestone_number} documentation_url: https://docs.github.com/rest/issues/milestones#delete-a-milestone openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/milestones/{milestone_number} documentation_url: https://docs.github.com/rest/issues/milestones#get-a-milestone openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /repos/{owner}/{repo}/milestones/{milestone_number} documentation_url: https://docs.github.com/rest/issues/milestones#update-a-milestone openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels documentation_url: https://docs.github.com/rest/issues/labels#list-labels-for-issues-in-a-milestone openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/notifications documentation_url: https://docs.github.com/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /repos/{owner}/{repo}/notifications documentation_url: https://docs.github.com/rest/activity/notifications#mark-repository-notifications-as-read openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/pages documentation_url: https://docs.github.com/rest/pages/pages#delete-a-apiname-pages-site openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/pages documentation_url: https://docs.github.com/rest/pages/pages#get-a-apiname-pages-site openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/pages documentation_url: https://docs.github.com/rest/pages/pages#create-a-apiname-pages-site openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /repos/{owner}/{repo}/pages documentation_url: https://docs.github.com/rest/pages/pages#update-information-about-a-apiname-pages-site openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/pages/builds documentation_url: https://docs.github.com/rest/pages/pages#list-apiname-pages-builds openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/pages/builds documentation_url: https://docs.github.com/rest/pages/pages#request-a-apiname-pages-build openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/pages/builds/latest documentation_url: https://docs.github.com/rest/pages/pages#get-latest-pages-build openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/pages/builds/{build_id} documentation_url: https://docs.github.com/rest/pages/pages#get-apiname-pages-build openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/pages/deployment + documentation_url: https://docs.github.com/enterprise-server@3.7/rest/pages/pages#create-a-github-pages-deployment + openapi_files: + - descriptions/ghes-3.7/ghes-3.7.json + - name: POST /repos/{owner}/{repo}/pages/deployments documentation_url: https://docs.github.com/rest/pages/pages#create-a-github-pages-deployment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json + - name: GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id} + documentation_url: https://docs.github.com/rest/pages/pages#get-the-status-of-a-github-pages-deployment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel + documentation_url: https://docs.github.com/rest/pages/pages#cancel-a-github-pages-deployment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /repos/{owner}/{repo}/pages/health documentation_url: https://docs.github.com/rest/pages/pages#get-a-dns-health-check-for-github-pages openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: GET /repos/{owner}/{repo}/pre-receive-hooks - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/private-vulnerability-reporting documentation_url: https://docs.github.com/rest/repos/repos#disable-private-vulnerability-reporting-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/private-vulnerability-reporting + documentation_url: https://docs.github.com/rest/repos/repos#check-if-private-vulnerability-reporting-is-enabled-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: PUT /repos/{owner}/{repo}/private-vulnerability-reporting documentation_url: https://docs.github.com/rest/repos/repos#enable-private-vulnerability-reporting-for-a-repository openapi_files: @@ -4594,84 +4721,89 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/projects documentation_url: https://docs.github.com/rest/projects/projects#create-a-repository-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/properties/values documentation_url: https://docs.github.com/rest/repos/custom-properties#get-all-custom-property-values-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - name: PATCH /repos/{owner}/{repo}/properties/values + documentation_url: https://docs.github.com/rest/repos/custom-properties#create-or-update-custom-property-values-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /repos/{owner}/{repo}/pulls documentation_url: https://docs.github.com/rest/pulls/pulls#list-pull-requests openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/pulls documentation_url: https://docs.github.com/rest/pulls/pulls#create-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/pulls/comments documentation_url: https://docs.github.com/rest/pulls/comments#list-review-comments-in-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id} documentation_url: https://docs.github.com/rest/pulls/comments#delete-a-review-comment-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/pulls/comments/{comment_id} documentation_url: https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id} documentation_url: https://docs.github.com/rest/pulls/comments#update-a-review-comment-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-pull-request-review-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-pull-request-review-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-a-pull-request-comment-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number} documentation_url: https://docs.github.com/rest/pulls/pulls#get-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /repos/{owner}/{repo}/pulls/{pull_number} documentation_url: https://docs.github.com/rest/pulls/pulls#update-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces documentation_url: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-from-a-pull-request openapi_files: @@ -4682,297 +4814,299 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/comments documentation_url: https://docs.github.com/rest/pulls/comments#create-a-review-comment-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies documentation_url: https://docs.github.com/rest/pulls/comments#create-a-reply-for-a-review-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/commits documentation_url: https://docs.github.com/rest/pulls/pulls#list-commits-on-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/files documentation_url: https://docs.github.com/rest/pulls/pulls#list-pull-requests-files openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/merge documentation_url: https://docs.github.com/rest/pulls/pulls#check-if-a-pull-request-has-been-merged openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge documentation_url: https://docs.github.com/rest/pulls/pulls#merge-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers documentation_url: https://docs.github.com/rest/pulls/review-requests#remove-requested-reviewers-from-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers documentation_url: https://docs.github.com/rest/pulls/review-requests#get-all-requested-reviewers-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers documentation_url: https://docs.github.com/rest/pulls/review-requests#request-reviewers-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews documentation_url: https://docs.github.com/rest/pulls/reviews#list-reviews-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews documentation_url: https://docs.github.com/rest/pulls/reviews#create-a-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} documentation_url: https://docs.github.com/rest/pulls/reviews#delete-a-pending-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} documentation_url: https://docs.github.com/rest/pulls/reviews#get-a-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} documentation_url: https://docs.github.com/rest/pulls/reviews#update-a-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments documentation_url: https://docs.github.com/rest/pulls/reviews#list-comments-for-a-pull-request-review openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals documentation_url: https://docs.github.com/rest/pulls/reviews#dismiss-a-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events documentation_url: https://docs.github.com/rest/pulls/reviews#submit-a-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch documentation_url: https://docs.github.com/rest/pulls/pulls#update-a-pull-request-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/readme documentation_url: https://docs.github.com/rest/repos/contents#get-a-repository-readme openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/readme/{dir} documentation_url: https://docs.github.com/rest/repos/contents#get-a-repository-readme-for-a-directory openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/releases documentation_url: https://docs.github.com/rest/releases/releases#list-releases openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/releases documentation_url: https://docs.github.com/rest/releases/releases#create-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/releases/assets/{asset_id} documentation_url: https://docs.github.com/rest/releases/assets#delete-a-release-asset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/releases/assets/{asset_id} documentation_url: https://docs.github.com/rest/releases/assets#get-a-release-asset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /repos/{owner}/{repo}/releases/assets/{asset_id} documentation_url: https://docs.github.com/rest/releases/assets#update-a-release-asset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/releases/generate-notes documentation_url: https://docs.github.com/rest/releases/releases#generate-release-notes-content-for-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/releases/latest documentation_url: https://docs.github.com/rest/releases/releases#get-the-latest-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/releases/tags/{tag} documentation_url: https://docs.github.com/rest/releases/releases#get-a-release-by-tag-name openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/releases/{release_id} documentation_url: https://docs.github.com/rest/releases/releases#delete-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/releases/{release_id} documentation_url: https://docs.github.com/rest/releases/releases#get-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /repos/{owner}/{repo}/releases/{release_id} documentation_url: https://docs.github.com/rest/releases/releases#update-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/releases/{release_id}/assets documentation_url: https://docs.github.com/rest/releases/assets#list-release-assets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/releases/{release_id}/assets documentation_url: https://docs.github.com/rest/releases/assets#upload-a-release-asset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/releases/{release_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/releases/{release_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-a-release-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/replicas/caches - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/repos/repos#list-repository-cache-replication-status + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/repos/repos#list-repository-cache-replication-status openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/rules/branches/{branch} documentation_url: https://docs.github.com/rest/repos/rules#get-rules-for-a-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/rulesets documentation_url: https://docs.github.com/rest/repos/rules#get-all-repository-rulesets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/rulesets documentation_url: https://docs.github.com/rest/repos/rules#create-a-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/rulesets/rule-suites documentation_url: https://docs.github.com/rest/repos/rule-suites#list-repository-rule-suites openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id} documentation_url: https://docs.github.com/rest/repos/rule-suites#get-a-repository-rule-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/repos/rules#get-a-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /repos/{owner}/{repo}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/repos/rules#update-a-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/secret-scanning/alerts documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#get-a-secret-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#update-a-secret-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-locations-for-a-secret-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/security-advisories documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories openapi_files: @@ -5013,115 +5147,115 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/stats/code_frequency documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-activity openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/stats/commit_activity documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-last-year-of-commit-activity openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/stats/contributors documentation_url: https://docs.github.com/rest/metrics/statistics#get-all-contributor-commit-activity openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/stats/participation documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-count openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/stats/punch_card documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-hourly-commit-count-for-each-day openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/statuses/{sha} documentation_url: https://docs.github.com/rest/commits/statuses#create-a-commit-status openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/subscribers documentation_url: https://docs.github.com/rest/activity/watching#list-watchers openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/subscription documentation_url: https://docs.github.com/rest/activity/watching#delete-a-repository-subscription openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/subscription documentation_url: https://docs.github.com/rest/activity/watching#get-a-repository-subscription openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /repos/{owner}/{repo}/subscription documentation_url: https://docs.github.com/rest/activity/watching#set-a-repository-subscription openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/tags documentation_url: https://docs.github.com/rest/repos/repos#list-repository-tags openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/tags/protection documentation_url: https://docs.github.com/rest/repos/tags#list-tag-protection-states-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{owner}/{repo}/tags/protection documentation_url: https://docs.github.com/rest/repos/tags#create-a-tag-protection-state-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id} documentation_url: https://docs.github.com/rest/repos/tags#delete-a-tag-protection-state-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/tarball/{ref} documentation_url: https://docs.github.com/rest/repos/contents#download-a-repository-archive-tar openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/teams documentation_url: https://docs.github.com/rest/repos/repos#list-repository-teams openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/topics documentation_url: https://docs.github.com/rest/repos/repos#get-all-repository-topics openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /repos/{owner}/{repo}/topics documentation_url: https://docs.github.com/rest/repos/repos#replace-all-repository-topics openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/traffic/clones documentation_url: https://docs.github.com/rest/metrics/traffic#get-repository-clones openapi_files: @@ -5147,163 +5281,171 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /repos/{owner}/{repo}/vulnerability-alerts documentation_url: https://docs.github.com/rest/repos/repos#disable-vulnerability-alerts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/vulnerability-alerts documentation_url: https://docs.github.com/rest/repos/repos#check-if-vulnerability-alerts-are-enabled-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /repos/{owner}/{repo}/vulnerability-alerts documentation_url: https://docs.github.com/rest/repos/repos#enable-vulnerability-alerts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repos/{owner}/{repo}/zipball/{ref} documentation_url: https://docs.github.com/rest/repos/contents#download-a-repository-archive-zip openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /repos/{template_owner}/{template_repo}/generate documentation_url: https://docs.github.com/rest/repos/repos#create-a-repository-using-a-template openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repositories documentation_url: https://docs.github.com/rest/repos/repos#list-public-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /repositories/{repository_id}/environments/{environment_name}/secrets - documentation_url: https://docs.github.com/rest/actions/secrets#list-environment-secrets + documentation_url: https://docs.github.com/enterprise-server@3.7/rest/actions/secrets#list-environment-secrets openapi_files: - - descriptions/api.github.com/api.github.com.json - - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.7/ghes-3.7.json - name: GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key - documentation_url: https://docs.github.com/rest/actions/secrets#get-an-environment-public-key + documentation_url: https://docs.github.com/enterprise-server@3.7/rest/actions/secrets#get-an-environment-public-key openapi_files: - - descriptions/api.github.com/api.github.com.json - - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.7/ghes-3.7.json - name: DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} - documentation_url: https://docs.github.com/rest/actions/secrets#delete-an-environment-secret + documentation_url: https://docs.github.com/enterprise-server@3.7/rest/actions/secrets#delete-an-environment-secret openapi_files: - - descriptions/api.github.com/api.github.com.json - - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.7/ghes-3.7.json - name: GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} - documentation_url: https://docs.github.com/rest/actions/secrets#get-an-environment-secret + documentation_url: https://docs.github.com/enterprise-server@3.7/rest/actions/secrets#get-an-environment-secret openapi_files: - - descriptions/api.github.com/api.github.com.json - - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.7/ghes-3.7.json - name: PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} - documentation_url: https://docs.github.com/rest/actions/secrets#create-or-update-an-environment-secret + documentation_url: https://docs.github.com/enterprise-server@3.7/rest/actions/secrets#create-or-update-an-environment-secret openapi_files: - - descriptions/api.github.com/api.github.com.json - - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json - - name: GET /repositories/{repository_id}/environments/{environment_name}/variables - documentation_url: https://docs.github.com/rest/actions/variables#list-environment-variables + - descriptions/ghes-3.7/ghes-3.7.json + - name: GET /scim/v2/Groups + documentation_url: https://docs.github.com/enterprise-server@3.7/rest/enterprise-admin/scim#list-provisioned-scim-groups-for-an-enterprise openapi_files: - - descriptions/api.github.com/api.github.com.json - - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json - - name: POST /repositories/{repository_id}/environments/{environment_name}/variables - documentation_url: https://docs.github.com/rest/actions/variables#create-an-environment-variable + - descriptions/ghes-3.7/ghes-3.7.json + - name: POST /scim/v2/Groups + documentation_url: https://docs.github.com/enterprise-server@3.7/rest/enterprise-admin/scim#provision-a-scim-enterprise-group openapi_files: - - descriptions/api.github.com/api.github.com.json - - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json - - name: DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{name} - documentation_url: https://docs.github.com/rest/actions/variables#delete-an-environment-variable + - descriptions/ghes-3.7/ghes-3.7.json + - name: DELETE /scim/v2/Groups/{scim_group_id} + documentation_url: https://docs.github.com/enterprise-server@3.7/rest/enterprise-admin/scim#delete-a-scim-group-from-an-enterprise openapi_files: - - descriptions/api.github.com/api.github.com.json - - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json - - name: GET /repositories/{repository_id}/environments/{environment_name}/variables/{name} - documentation_url: https://docs.github.com/rest/actions/variables#get-an-environment-variable + - descriptions/ghes-3.7/ghes-3.7.json + - name: GET /scim/v2/Groups/{scim_group_id} + documentation_url: https://docs.github.com/enterprise-server@3.7/rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-group openapi_files: - - descriptions/api.github.com/api.github.com.json - - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json - - name: PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{name} - documentation_url: https://docs.github.com/rest/actions/variables#update-an-environment-variable + - descriptions/ghes-3.7/ghes-3.7.json + - name: PATCH /scim/v2/Groups/{scim_group_id} + documentation_url: https://docs.github.com/enterprise-server@3.7/rest/enterprise-admin/scim#update-an-attribute-for-a-scim-enterprise-group openapi_files: - - descriptions/api.github.com/api.github.com.json - - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json - - name: GET /scim/v2/Groups + - descriptions/ghes-3.7/ghes-3.7.json + - name: PUT /scim/v2/Groups/{scim_group_id} + documentation_url: https://docs.github.com/enterprise-server@3.7/rest/enterprise-admin/scim#set-scim-information-for-a-provisioned-enterprise-group + openapi_files: + - descriptions/ghes-3.7/ghes-3.7.json + - name: GET /scim/v2/Users + documentation_url: https://docs.github.com/enterprise-server@3.7/rest/enterprise-admin/scim#list-scim-provisioned-identities-for-an-enterprise + openapi_files: + - descriptions/ghes-3.7/ghes-3.7.json + - name: POST /scim/v2/Users + documentation_url: https://docs.github.com/enterprise-server@3.7/rest/enterprise-admin/scim#provision-a-scim-enterprise-user + openapi_files: + - descriptions/ghes-3.7/ghes-3.7.json + - name: DELETE /scim/v2/Users/{scim_user_id} + documentation_url: https://docs.github.com/enterprise-server@3.7/rest/enterprise-admin/scim#delete-a-scim-user-from-an-enterprise + openapi_files: + - descriptions/ghes-3.7/ghes-3.7.json + - name: GET /scim/v2/Users/{scim_user_id} + documentation_url: https://docs.github.com/enterprise-server@3.7/rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-user + openapi_files: + - descriptions/ghes-3.7/ghes-3.7.json + - name: PATCH /scim/v2/Users/{scim_user_id} + documentation_url: https://docs.github.com/enterprise-server@3.7/rest/enterprise-admin/scim#update-an-attribute-for-a-scim-enterprise-user + openapi_files: + - descriptions/ghes-3.7/ghes-3.7.json + - name: PUT /scim/v2/Users/{scim_user_id} + documentation_url: https://docs.github.com/enterprise-server@3.7/rest/enterprise-admin/scim#set-scim-information-for-a-provisioned-enterprise-user + openapi_files: + - descriptions/ghes-3.7/ghes-3.7.json + - name: GET /scim/v2/enterprises/{enterprise}/Groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#list-provisioned-scim-groups-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json - - name: POST /scim/v2/Groups + - descriptions/ghes-3.12/ghes-3.12.json + - name: POST /scim/v2/enterprises/{enterprise}/Groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#provision-a-scim-enterprise-group openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json - - name: DELETE /scim/v2/Groups/{scim_group_id} + - descriptions/ghes-3.12/ghes-3.12.json + - name: DELETE /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#delete-a-scim-group-from-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json - - name: GET /scim/v2/Groups/{scim_group_id} + - descriptions/ghes-3.12/ghes-3.12.json + - name: GET /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-group openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json - - name: PATCH /scim/v2/Groups/{scim_group_id} + - descriptions/ghes-3.12/ghes-3.12.json + - name: PATCH /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#update-an-attribute-for-a-scim-enterprise-group openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json - - name: PUT /scim/v2/Groups/{scim_group_id} + - descriptions/ghes-3.12/ghes-3.12.json + - name: PUT /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#set-scim-information-for-a-provisioned-enterprise-group openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json - - name: GET /scim/v2/Users + - descriptions/ghes-3.12/ghes-3.12.json + - name: GET /scim/v2/enterprises/{enterprise}/Users documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#list-scim-provisioned-identities-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json - - name: POST /scim/v2/Users + - descriptions/ghes-3.12/ghes-3.12.json + - name: POST /scim/v2/enterprises/{enterprise}/Users documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#provision-a-scim-enterprise-user openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json - - name: DELETE /scim/v2/Users/{scim_user_id} + - descriptions/ghes-3.12/ghes-3.12.json + - name: DELETE /scim/v2/enterprises/{enterprise}/Users/{scim_user_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#delete-a-scim-user-from-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json - - name: GET /scim/v2/Users/{scim_user_id} + - descriptions/ghes-3.12/ghes-3.12.json + - name: GET /scim/v2/enterprises/{enterprise}/Users/{scim_user_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-user openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json - - name: PATCH /scim/v2/Users/{scim_user_id} + - descriptions/ghes-3.12/ghes-3.12.json + - name: PATCH /scim/v2/enterprises/{enterprise}/Users/{scim_user_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#update-an-attribute-for-a-scim-enterprise-user openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json - - name: PUT /scim/v2/Users/{scim_user_id} + - descriptions/ghes-3.12/ghes-3.12.json + - name: PUT /scim/v2/enterprises/{enterprise}/Users/{scim_user_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#set-scim-information-for-a-provisioned-enterprise-user openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /scim/v2/organizations/{org}/Users documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#list-scim-provisioned-identities openapi_files: @@ -5333,189 +5475,189 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /search/commits documentation_url: https://docs.github.com/rest/search/search#search-commits openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /search/issues documentation_url: https://docs.github.com/rest/search/search#search-issues-and-pull-requests openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /search/labels documentation_url: https://docs.github.com/rest/search/search#search-labels openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /search/repositories documentation_url: https://docs.github.com/rest/search/search#search-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /search/topics documentation_url: https://docs.github.com/rest/search/search#search-topics openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /search/users documentation_url: https://docs.github.com/rest/search/search#search-users openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /setup/api/configcheck - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/management-console#get-the-configuration-status + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/management-console#get-the-configuration-status openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /setup/api/configure - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/management-console#start-a-configuration-process + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/management-console#start-a-configuration-process openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /setup/api/maintenance - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/management-console#get-the-maintenance-status + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/management-console#get-the-maintenance-status openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /setup/api/maintenance - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/management-console#enable-or-disable-maintenance-mode + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/management-console#enable-or-disable-maintenance-mode openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /setup/api/settings - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/management-console#get-settings + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/management-console#get-settings openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /setup/api/settings - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/management-console#set-settings + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/management-console#set-settings openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /setup/api/settings/authorized-keys - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/management-console#remove-an-authorized-ssh-key + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/management-console#remove-an-authorized-ssh-key openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /setup/api/settings/authorized-keys - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/management-console#get-all-authorized-ssh-keys + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/management-console#get-all-authorized-ssh-keys openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /setup/api/settings/authorized-keys - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/management-console#add-an-authorized-ssh-key + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/management-console#add-an-authorized-ssh-key openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /setup/api/start - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/management-console#create-a-github-license + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/management-console#create-a-github-license openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /setup/api/upgrade - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/management-console#upgrade-a-license + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/management-console#upgrade-a-license openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /teams/{team_id} documentation_url: https://docs.github.com/rest/teams/teams#delete-a-team-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /teams/{team_id} documentation_url: https://docs.github.com/rest/teams/teams#get-a-team-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /teams/{team_id} documentation_url: https://docs.github.com/rest/teams/teams#update-a-team-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /teams/{team_id}/discussions documentation_url: https://docs.github.com/rest/teams/discussions#list-discussions-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /teams/{team_id}/discussions documentation_url: https://docs.github.com/rest/teams/discussions#create-a-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /teams/{team_id}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#delete-a-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /teams/{team_id}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#get-a-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /teams/{team_id}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#update-a-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /teams/{team_id}/discussions/{discussion_number}/comments documentation_url: https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /teams/{team_id}/discussions/{discussion_number}/comments documentation_url: https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /teams/{team_id}/discussions/{discussion_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /teams/{team_id}/discussions/{discussion_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /teams/{team_id}/invitations documentation_url: https://docs.github.com/rest/teams/members#list-pending-team-invitations-legacy openapi_files: @@ -5526,91 +5668,91 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /teams/{team_id}/members/{username} documentation_url: https://docs.github.com/rest/teams/members#remove-team-member-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /teams/{team_id}/members/{username} documentation_url: https://docs.github.com/rest/teams/members#get-team-member-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /teams/{team_id}/members/{username} documentation_url: https://docs.github.com/rest/teams/members#add-team-member-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /teams/{team_id}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /teams/{team_id}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#get-team-membership-for-a-user-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /teams/{team_id}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /teams/{team_id}/projects documentation_url: https://docs.github.com/rest/teams/teams#list-team-projects-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /teams/{team_id}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /teams/{team_id}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /teams/{team_id}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /teams/{team_id}/repos documentation_url: https://docs.github.com/rest/teams/teams#list-team-repositories-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /teams/{team_id}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /teams/{team_id}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /teams/{team_id}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /teams/{team_id}/team-sync/group-mappings documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#list-idp-groups-for-a-team-legacy openapi_files: @@ -5624,19 +5766,19 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /user documentation_url: https://docs.github.com/rest/users/users#get-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /user documentation_url: https://docs.github.com/rest/users/users#update-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /user/blocks documentation_url: https://docs.github.com/rest/users/blocking#list-users-blocked-by-the-authenticated-user openapi_files: @@ -5762,7 +5904,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /user/email/visibility documentation_url: https://docs.github.com/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user openapi_files: @@ -5773,97 +5915,97 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /user/emails documentation_url: https://docs.github.com/rest/users/emails#list-email-addresses-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /user/emails documentation_url: https://docs.github.com/rest/users/emails#add-an-email-address-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /user/followers documentation_url: https://docs.github.com/rest/users/followers#list-followers-of-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /user/following documentation_url: https://docs.github.com/rest/users/followers#list-the-people-the-authenticated-user-follows openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /user/following/{username} documentation_url: https://docs.github.com/rest/users/followers#unfollow-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /user/following/{username} documentation_url: https://docs.github.com/rest/users/followers#check-if-a-person-is-followed-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /user/following/{username} documentation_url: https://docs.github.com/rest/users/followers#follow-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /user/gpg_keys documentation_url: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /user/gpg_keys documentation_url: https://docs.github.com/rest/users/gpg-keys#create-a-gpg-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /user/gpg_keys/{gpg_key_id} documentation_url: https://docs.github.com/rest/users/gpg-keys#delete-a-gpg-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /user/gpg_keys/{gpg_key_id} documentation_url: https://docs.github.com/rest/users/gpg-keys#get-a-gpg-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /user/installations documentation_url: https://docs.github.com/rest/apps/installations#list-app-installations-accessible-to-the-user-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /user/installations/{installation_id}/repositories documentation_url: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-user-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /user/installations/{installation_id}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/apps/installations#remove-a-repository-from-an-app-installation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /user/installations/{installation_id}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/apps/installations#add-a-repository-to-an-app-installation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /user/interaction-limits documentation_url: https://docs.github.com/rest/interactions/user#remove-interaction-restrictions-from-your-public-repositories openapi_files: @@ -5884,31 +6026,31 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /user/keys documentation_url: https://docs.github.com/rest/users/keys#list-public-ssh-keys-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /user/keys documentation_url: https://docs.github.com/rest/users/keys#create-a-public-ssh-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /user/keys/{key_id} documentation_url: https://docs.github.com/rest/users/keys#delete-a-public-ssh-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /user/keys/{key_id} documentation_url: https://docs.github.com/rest/users/keys#get-a-public-ssh-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /user/marketplace_purchases documentation_url: https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user openapi_files: @@ -5924,31 +6066,31 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /user/memberships/orgs/{org} documentation_url: https://docs.github.com/rest/orgs/members#get-an-organization-membership-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /user/memberships/orgs/{org} documentation_url: https://docs.github.com/rest/orgs/members#update-an-organization-membership-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /user/migrations documentation_url: https://docs.github.com/rest/migrations/users#list-user-migrations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /user/migrations documentation_url: https://docs.github.com/rest/migrations/users#start-a-user-migration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /user/migrations/{migration_id} documentation_url: https://docs.github.com/rest/migrations/users#get-a-user-migration-status openapi_files: @@ -5964,7 +6106,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock documentation_url: https://docs.github.com/rest/migrations/users#unlock-a-user-repository openapi_files: @@ -5975,343 +6117,343 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /user/orgs documentation_url: https://docs.github.com/rest/orgs/orgs#list-organizations-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /user/packages documentation_url: https://docs.github.com/rest/packages/packages#list-packages-for-the-authenticated-users-namespace openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /user/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /user/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /user/packages/{package_type}/{package_name}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /user/packages/{package_type}/{package_name}/versions documentation_url: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-version-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /user/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-version-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-version-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /user/projects documentation_url: https://docs.github.com/rest/projects/projects#create-a-user-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /user/public_emails documentation_url: https://docs.github.com/rest/users/emails#list-public-email-addresses-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /user/repos documentation_url: https://docs.github.com/rest/repos/repos#list-repositories-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /user/repos documentation_url: https://docs.github.com/rest/repos/repos#create-a-repository-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /user/repository_invitations documentation_url: https://docs.github.com/rest/collaborators/invitations#list-repository-invitations-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /user/repository_invitations/{invitation_id} documentation_url: https://docs.github.com/rest/collaborators/invitations#decline-a-repository-invitation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PATCH /user/repository_invitations/{invitation_id} documentation_url: https://docs.github.com/rest/collaborators/invitations#accept-a-repository-invitation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /user/social_accounts documentation_url: https://docs.github.com/rest/users/social-accounts#delete-social-accounts-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /user/social_accounts documentation_url: https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /user/social_accounts documentation_url: https://docs.github.com/rest/users/social-accounts#add-social-accounts-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /user/ssh_signing_keys documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /user/ssh_signing_keys documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#create-a-ssh-signing-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /user/ssh_signing_keys/{ssh_signing_key_id} documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#delete-an-ssh-signing-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /user/ssh_signing_keys/{ssh_signing_key_id} documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#get-an-ssh-signing-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /user/starred documentation_url: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /user/starred/{owner}/{repo} documentation_url: https://docs.github.com/rest/activity/starring#unstar-a-repository-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /user/starred/{owner}/{repo} documentation_url: https://docs.github.com/rest/activity/starring#check-if-a-repository-is-starred-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /user/starred/{owner}/{repo} documentation_url: https://docs.github.com/rest/activity/starring#star-a-repository-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /user/subscriptions documentation_url: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /user/teams documentation_url: https://docs.github.com/rest/teams/teams#list-teams-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /users documentation_url: https://docs.github.com/rest/users/users#list-users openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /users/{username} documentation_url: https://docs.github.com/rest/users/users#get-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /users/{username}/docker/conflicts documentation_url: https://docs.github.com/rest/packages/packages#get-list-of-conflicting-packages-during-docker-migration-for-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /users/{username}/events documentation_url: https://docs.github.com/rest/activity/events#list-events-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /users/{username}/events/orgs/{org} documentation_url: https://docs.github.com/rest/activity/events#list-organization-events-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /users/{username}/events/public documentation_url: https://docs.github.com/rest/activity/events#list-public-events-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /users/{username}/followers documentation_url: https://docs.github.com/rest/users/followers#list-followers-of-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /users/{username}/following documentation_url: https://docs.github.com/rest/users/followers#list-the-people-a-user-follows openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /users/{username}/following/{target_user} documentation_url: https://docs.github.com/rest/users/followers#check-if-a-user-follows-another-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /users/{username}/gists documentation_url: https://docs.github.com/rest/gists/gists#list-gists-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /users/{username}/gpg_keys documentation_url: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /users/{username}/hovercard documentation_url: https://docs.github.com/rest/users/users#get-contextual-information-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /users/{username}/installation documentation_url: https://docs.github.com/rest/apps/apps#get-a-user-installation-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /users/{username}/keys documentation_url: https://docs.github.com/rest/users/keys#list-public-keys-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /users/{username}/orgs documentation_url: https://docs.github.com/rest/orgs/orgs#list-organizations-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /users/{username}/packages documentation_url: https://docs.github.com/rest/packages/packages#list-packages-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /users/{username}/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /users/{username}/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /users/{username}/packages/{package_type}/{package_name}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /users/{username}/packages/{package_type}/{package_name}/versions documentation_url: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#delete-package-version-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-version-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-package-version-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /users/{username}/projects documentation_url: https://docs.github.com/rest/projects/projects#list-user-projects openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /users/{username}/received_events documentation_url: https://docs.github.com/rest/activity/events#list-events-received-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /users/{username}/received_events/public documentation_url: https://docs.github.com/rest/activity/events#list-public-events-received-by-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /users/{username}/repos documentation_url: https://docs.github.com/rest/repos/repos#list-repositories-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /users/{username}/settings/billing/actions documentation_url: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-a-user openapi_files: @@ -6328,45 +6470,45 @@ openapi_operations: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: DELETE /users/{username}/site_admin - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#demote-a-site-administrator + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#demote-a-site-administrator openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /users/{username}/site_admin - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /users/{username}/social_accounts documentation_url: https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /users/{username}/ssh_signing_keys documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /users/{username}/starred documentation_url: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /users/{username}/subscriptions documentation_url: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: DELETE /users/{username}/suspended - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#unsuspend-a-user + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#unsuspend-a-user openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: PUT /users/{username}/suspended - documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#suspend-a-user + documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#suspend-a-user openapi_files: - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json - name: GET /versions documentation_url: https://docs.github.com/rest/meta/meta#get-all-api-versions openapi_files: @@ -6377,4 +6519,4 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.11/ghes-3.11.json + - descriptions/ghes-3.12/ghes-3.12.json From e75e456218d5d940cebb839eebc28839eeb9ad5f Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Thu, 28 Mar 2024 14:45:21 -0400 Subject: [PATCH 424/751] Add .*.local to .gitignore (#3115) --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 0c803b53aa6..8e24389445d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *.sh !/script/*.sh *.test +.*.local coverage.out /bin # intellij files From e85a74dd6a47fc03e5de9b0cb0ee462be1ac5ad3 Mon Sep 17 00:00:00 2001 From: ganeshkumarsv <53483484+ganeshkumarsv@users.noreply.github.com> Date: Fri, 29 Mar 2024 11:38:06 -0400 Subject: [PATCH 425/751] Add CreateOrUpdateRepoCustomPropertyValues (#3109) --- github/repos_properties.go | 27 +++++++++++++++++++++++++++ github/repos_properties_test.go | 28 ++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/github/repos_properties.go b/github/repos_properties.go index 5a8626c4530..5b12bc8b30e 100644 --- a/github/repos_properties.go +++ b/github/repos_properties.go @@ -31,3 +31,30 @@ func (s *RepositoriesService) GetAllCustomPropertyValues(ctx context.Context, or return customPropertyValues, resp, nil } + +// CreateOrUpdateCustomProperties creates new or updates existing custom property values for a repository. +// +// GitHub API docs: https://docs.github.com/rest/repos/custom-properties#create-or-update-custom-property-values-for-a-repository +// +//meta:operation PATCH /repos/{owner}/{repo}/properties/values +func (s *RepositoriesService) CreateOrUpdateCustomProperties(ctx context.Context, org, repo string, customPropertyValues []*CustomPropertyValue) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/properties/values", org, repo) + + params := struct { + Properties []*CustomPropertyValue `json:"properties"` + }{ + Properties: customPropertyValues, + } + + req, err := s.client.NewRequest("PATCH", u, params) + 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_properties_test.go b/github/repos_properties_test.go index ee231a138c6..5ce05c26d7b 100644 --- a/github/repos_properties_test.go +++ b/github/repos_properties_test.go @@ -63,3 +63,31 @@ func TestRepositoriesService_GetAllCustomPropertyValues(t *testing.T) { return resp, err }) } + +func TestRepositoriesService_CreateOrUpdateCustomProperties(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/usr/r/properties/values", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PATCH") + w.WriteHeader(http.StatusNoContent) + }) + + ctx := context.Background() + RepoCustomProperty := []*CustomPropertyValue{ + { + PropertyName: "environment", + Value: String("production"), + }, + } + _, err := client.Repositories.CreateOrUpdateCustomProperties(ctx, "usr", "r", RepoCustomProperty) + if err != nil { + t.Errorf("Repositories.CreateOrUpdateCustomProperties returned error: %v", err) + } + + const methodName = "CreateOrUpdateCustomProperties" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Repositories.CreateOrUpdateCustomProperties(ctx, "usr", "r", RepoCustomProperty) + }) +} From a4b145ac2406e3f63343e403605435ac98ea2ba6 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Mon, 1 Apr 2024 15:01:23 -0400 Subject: [PATCH 426/751] Bump version of go-github to v61.0.0 (#3118) --- README.md | 15 ++++++++------- example/actionpermissions/main.go | 2 +- example/appengine/app.go | 2 +- example/basicauth/main.go | 2 +- .../codespaces/newreposecretwithxcrypto/main.go | 2 +- .../codespaces/newusersecretwithxcrypto/main.go | 2 +- example/commitpr/main.go | 2 +- example/go.mod | 6 +++--- example/listenvironments/main.go | 2 +- example/migrations/main.go | 2 +- example/newfilewithappauth/main.go | 2 +- example/newrepo/main.go | 2 +- example/newreposecretwithlibsodium/go.mod | 4 ++-- example/newreposecretwithlibsodium/main.go | 2 +- example/newreposecretwithxcrypto/main.go | 2 +- example/ratelimit/main.go | 2 +- example/simple/main.go | 2 +- example/tagprotection/main.go | 2 +- example/tokenauth/main.go | 2 +- example/topics/main.go | 2 +- github/doc.go | 2 +- github/examples_test.go | 2 +- github/github.go | 2 +- go.mod | 2 +- test/fields/fields.go | 2 +- test/integration/activity_test.go | 2 +- test/integration/authorizations_test.go | 2 +- test/integration/github_test.go | 2 +- test/integration/repos_test.go | 2 +- test/integration/users_test.go | 2 +- tools/go.mod | 4 ++-- tools/metadata/main.go | 2 +- tools/metadata/main_test.go | 2 +- tools/metadata/metadata.go | 2 +- tools/metadata/openapi.go | 2 +- 35 files changed, 46 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 7e429525936..94e1cc544ee 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-github # [![go-github release (latest SemVer)](https://img.shields.io/github/v/release/google/go-github?sort=semver)](https://github.com/google/go-github/releases) -[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v60/github) +[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v61/github) [![Test Status](https://github.com/google/go-github/workflows/tests/badge.svg)](https://github.com/google/go-github/actions?query=workflow%3Atests) [![Test Coverage](https://codecov.io/gh/google/go-github/branch/master/graph/badge.svg)](https://codecov.io/gh/google/go-github) [![Discuss at go-github@googlegroups.com](https://img.shields.io/badge/discuss-go--github%40googlegroups.com-blue.svg)](https://groups.google.com/group/go-github) @@ -24,7 +24,7 @@ If you're interested in using the [GraphQL API v4][], the recommended library is go-github is compatible with modern Go releases in module mode, with Go installed: ```bash -go get github.com/google/go-github/v60 +go get github.com/google/go-github/v61 ``` will resolve and add the package to the current development module, along with its dependencies. @@ -32,7 +32,7 @@ will resolve and add the package to the current development module, along with i Alternatively the same can be achieved if you use import in a package: ```go -import "github.com/google/go-github/v60/github" +import "github.com/google/go-github/v61/github" ``` and run `go get` without parameters. @@ -40,13 +40,13 @@ and run `go get` without parameters. Finally, to use the top-of-trunk version of this repo, use the following command: ```bash -go get github.com/google/go-github/v60@master +go get github.com/google/go-github/v61@master ``` ## Usage ## ```go -import "github.com/google/go-github/v60/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) +import "github.com/google/go-github/v61/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled ``` @@ -117,7 +117,7 @@ import ( "net/http" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v60/github" + "github.com/google/go-github/v61/github" ) func main() { @@ -296,7 +296,7 @@ For complete usage of go-github, see the full [package docs][]. [GitHub API v3]: https://docs.github.com/en/rest [personal access token]: https://github.com/blog/1509-personal-api-tokens -[package docs]: https://pkg.go.dev/github.com/google/go-github/v60/github +[package docs]: https://pkg.go.dev/github.com/google/go-github/v61/github [GraphQL API v4]: https://developer.github.com/v4/ [shurcooL/githubv4]: https://github.com/shurcooL/githubv4 [GitHub webhook events]: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads @@ -369,6 +369,7 @@ Versions prior to 48.2.0 are not listed. | go-github Version | GitHub v3 API Version | | ----------------- | --------------------- | +| 61.0.0 | 2022-11-28 | | 60.0.0 | 2022-11-28 | | 59.0.0 | 2022-11-28 | | 58.0.0 | 2022-11-28 | diff --git a/example/actionpermissions/main.go b/example/actionpermissions/main.go index 46a541ffa35..8453cf14827 100644 --- a/example/actionpermissions/main.go +++ b/example/actionpermissions/main.go @@ -14,7 +14,7 @@ import ( "log" "os" - "github.com/google/go-github/v60/github" + "github.com/google/go-github/v61/github" ) var ( diff --git a/example/appengine/app.go b/example/appengine/app.go index e8a578d5fea..1aa425d02f9 100644 --- a/example/appengine/app.go +++ b/example/appengine/app.go @@ -12,7 +12,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v60/github" + "github.com/google/go-github/v61/github" "google.golang.org/appengine" "google.golang.org/appengine/log" ) diff --git a/example/basicauth/main.go b/example/basicauth/main.go index c5453573a9e..d7a74701e23 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -21,7 +21,7 @@ import ( "os" "strings" - "github.com/google/go-github/v60/github" + "github.com/google/go-github/v61/github" "golang.org/x/term" ) diff --git a/example/codespaces/newreposecretwithxcrypto/main.go b/example/codespaces/newreposecretwithxcrypto/main.go index 9fffd8fbcb7..a2ac7e45106 100644 --- a/example/codespaces/newreposecretwithxcrypto/main.go +++ b/example/codespaces/newreposecretwithxcrypto/main.go @@ -36,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v60/github" + "github.com/google/go-github/v61/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/codespaces/newusersecretwithxcrypto/main.go b/example/codespaces/newusersecretwithxcrypto/main.go index 72256136c40..ca6ac396459 100644 --- a/example/codespaces/newusersecretwithxcrypto/main.go +++ b/example/codespaces/newusersecretwithxcrypto/main.go @@ -37,7 +37,7 @@ import ( "log" "os" - "github.com/google/go-github/v60/github" + "github.com/google/go-github/v61/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index ffe7aa4529f..021024b10d1 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -33,7 +33,7 @@ import ( "time" "github.com/ProtonMail/go-crypto/openpgp" - "github.com/google/go-github/v60/github" + "github.com/google/go-github/v61/github" ) var ( diff --git a/example/go.mod b/example/go.mod index 7a2473934ed..5b11139f25e 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v60/example +module github.com/google/go-github/v61/example go 1.21 @@ -6,7 +6,7 @@ require ( github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-ratelimit v1.0.3 - github.com/google/go-github/v60 v60.0.0 + github.com/google/go-github/v61 v61.0.0 golang.org/x/crypto v0.17.0 golang.org/x/term v0.15.0 google.golang.org/appengine v1.6.7 @@ -24,4 +24,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v60 => ../ +replace github.com/google/go-github/v61 => ../ diff --git a/example/listenvironments/main.go b/example/listenvironments/main.go index 83cff102825..14d10949704 100644 --- a/example/listenvironments/main.go +++ b/example/listenvironments/main.go @@ -18,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v60/github" + "github.com/google/go-github/v61/github" ) func main() { diff --git a/example/migrations/main.go b/example/migrations/main.go index 8f3d80943c2..7771cbe9527 100644 --- a/example/migrations/main.go +++ b/example/migrations/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v60/github" + "github.com/google/go-github/v61/github" ) func fetchAllUserMigrations() ([]*github.UserMigration, error) { diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index 9754af7b71e..18ecd7eb485 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -16,7 +16,7 @@ import ( "time" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v60/github" + "github.com/google/go-github/v61/github" ) func main() { diff --git a/example/newrepo/main.go b/example/newrepo/main.go index 64f09a8f947..1326a2d9ce9 100644 --- a/example/newrepo/main.go +++ b/example/newrepo/main.go @@ -16,7 +16,7 @@ import ( "log" "os" - "github.com/google/go-github/v60/github" + "github.com/google/go-github/v61/github" ) var ( diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index 138068bca8f..84930ca7a94 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -6,10 +6,10 @@ toolchain go1.22.0 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb - github.com/google/go-github/v60 v60.0.0 + github.com/google/go-github/v61 v61.0.0 ) require github.com/google/go-querystring v1.1.0 // indirect // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v60 => ../.. +replace github.com/google/go-github/v61 => ../.. diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index 9eb40ac875c..a61ff06ed7d 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -36,7 +36,7 @@ import ( "os" sodium "github.com/GoKillers/libsodium-go/cryptobox" - "github.com/google/go-github/v60/github" + "github.com/google/go-github/v61/github" ) var ( diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index 660e3004e1e..9bf8845e531 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -36,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v60/github" + "github.com/google/go-github/v61/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/ratelimit/main.go b/example/ratelimit/main.go index f7f8d1a52fc..276301c1c2c 100644 --- a/example/ratelimit/main.go +++ b/example/ratelimit/main.go @@ -13,7 +13,7 @@ import ( "fmt" "github.com/gofri/go-github-ratelimit/github_ratelimit" - "github.com/google/go-github/v60/github" + "github.com/google/go-github/v61/github" ) func main() { diff --git a/example/simple/main.go b/example/simple/main.go index af8c6ae8f78..5512c6cb5df 100644 --- a/example/simple/main.go +++ b/example/simple/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v60/github" + "github.com/google/go-github/v61/github" ) // Fetch all the public organizations' membership of a user. diff --git a/example/tagprotection/main.go b/example/tagprotection/main.go index 2dad5a27369..f9bedf1f335 100644 --- a/example/tagprotection/main.go +++ b/example/tagprotection/main.go @@ -18,7 +18,7 @@ import ( "os" "strings" - "github.com/google/go-github/v60/github" + "github.com/google/go-github/v61/github" "golang.org/x/term" ) diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index 04c6e5a4ef7..0cf12a8b01d 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -15,7 +15,7 @@ import ( "log" "os" - "github.com/google/go-github/v60/github" + "github.com/google/go-github/v61/github" "golang.org/x/term" ) diff --git a/example/topics/main.go b/example/topics/main.go index 09ae6c203b5..b6e76bfd7e9 100644 --- a/example/topics/main.go +++ b/example/topics/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v60/github" + "github.com/google/go-github/v61/github" ) // Fetch and lists all the public topics associated with the specified GitHub topic diff --git a/github/doc.go b/github/doc.go index 1896244d7f0..6c4b3a81a91 100644 --- a/github/doc.go +++ b/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v60/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v61/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to diff --git a/github/examples_test.go b/github/examples_test.go index cb22fecd95b..4dbd17e1ba8 100644 --- a/github/examples_test.go +++ b/github/examples_test.go @@ -12,7 +12,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v60/github" + "github.com/google/go-github/v61/github" ) func ExampleMarkdownService_Render() { diff --git a/github/github.go b/github/github.go index bf0b5715a89..03e2e6273cf 100644 --- a/github/github.go +++ b/github/github.go @@ -28,7 +28,7 @@ import ( ) const ( - Version = "v60.0.0" + Version = "v61.0.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" diff --git a/go.mod b/go.mod index b00b053ad8c..a2a7aeed191 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v60 +module github.com/google/go-github/v61 require ( github.com/google/go-cmp v0.6.0 diff --git a/test/fields/fields.go b/test/fields/fields.go index 5dea9bcfd43..0629dd33e6a 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -25,7 +25,7 @@ import ( "reflect" "strings" - "github.com/google/go-github/v60/github" + "github.com/google/go-github/v61/github" ) var ( diff --git a/test/integration/activity_test.go b/test/integration/activity_test.go index 0a9744df1a3..6a70c42b05a 100644 --- a/test/integration/activity_test.go +++ b/test/integration/activity_test.go @@ -12,7 +12,7 @@ import ( "context" "testing" - "github.com/google/go-github/v60/github" + "github.com/google/go-github/v61/github" ) const ( diff --git a/test/integration/authorizations_test.go b/test/integration/authorizations_test.go index f6edbd8aada..d5cfb6f51e0 100644 --- a/test/integration/authorizations_test.go +++ b/test/integration/authorizations_test.go @@ -15,7 +15,7 @@ import ( "testing" "time" - "github.com/google/go-github/v60/github" + "github.com/google/go-github/v61/github" ) const msgEnvMissing = "Skipping test because the required environment variable (%v) is not present." diff --git a/test/integration/github_test.go b/test/integration/github_test.go index 642cb406ff0..fb581679e2c 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -15,7 +15,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v60/github" + "github.com/google/go-github/v61/github" ) var ( diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index 9451bf81e52..5737950c664 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -15,7 +15,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v60/github" + "github.com/google/go-github/v61/github" ) func TestRepositories_CRUD(t *testing.T) { diff --git a/test/integration/users_test.go b/test/integration/users_test.go index 0a2d9c8aebe..5f40622b22b 100644 --- a/test/integration/users_test.go +++ b/test/integration/users_test.go @@ -14,7 +14,7 @@ import ( "math/rand" "testing" - "github.com/google/go-github/v60/github" + "github.com/google/go-github/v61/github" ) func TestUsers_Get(t *testing.T) { diff --git a/tools/go.mod b/tools/go.mod index 874aa769d2c..e6e95c644de 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -8,7 +8,7 @@ require ( github.com/alecthomas/kong v0.9.0 github.com/getkin/kin-openapi v0.123.0 github.com/google/go-cmp v0.6.0 - github.com/google/go-github/v60 v60.0.0 + github.com/google/go-github/v61 v61.0.0 golang.org/x/sync v0.6.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -25,4 +25,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v60 => ../ +replace github.com/google/go-github/v61 => ../ diff --git a/tools/metadata/main.go b/tools/metadata/main.go index 9b279fff182..f846d1cad8c 100644 --- a/tools/metadata/main.go +++ b/tools/metadata/main.go @@ -15,7 +15,7 @@ import ( "path/filepath" "github.com/alecthomas/kong" - "github.com/google/go-github/v60/github" + "github.com/google/go-github/v61/github" ) var helpVars = kong.Vars{ diff --git a/tools/metadata/main_test.go b/tools/metadata/main_test.go index 1118414d12f..059c2b72b54 100644 --- a/tools/metadata/main_test.go +++ b/tools/metadata/main_test.go @@ -23,7 +23,7 @@ import ( "github.com/alecthomas/kong" "github.com/getkin/kin-openapi/openapi3" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v60/github" + "github.com/google/go-github/v61/github" ) func TestUpdateGo(t *testing.T) { diff --git a/tools/metadata/metadata.go b/tools/metadata/metadata.go index 4a87603e8d1..2becaaabe73 100644 --- a/tools/metadata/metadata.go +++ b/tools/metadata/metadata.go @@ -24,7 +24,7 @@ import ( "strings" "sync" - "github.com/google/go-github/v60/github" + "github.com/google/go-github/v61/github" "gopkg.in/yaml.v3" ) diff --git a/tools/metadata/openapi.go b/tools/metadata/openapi.go index ae18b66b258..07ac9fd033b 100644 --- a/tools/metadata/openapi.go +++ b/tools/metadata/openapi.go @@ -14,7 +14,7 @@ import ( "strconv" "github.com/getkin/kin-openapi/openapi3" - "github.com/google/go-github/v60/github" + "github.com/google/go-github/v61/github" "golang.org/x/sync/errgroup" ) From 7d2e4b2ce0d360d62f37dfc9edcf23a8bed8b3e7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Apr 2024 15:51:12 -0400 Subject: [PATCH 427/751] Bump codecov/codecov-action from 4.1.0 to 4.1.1 (#3120) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fdde6151063..760fb6c9191 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -73,4 +73,4 @@ jobs: - name: Upload coverage to Codecov if: ${{ matrix.update-coverage }} - uses: codecov/codecov-action@54bcd8715eee62d40e33596ef5e8f0f48dbbccab #v4.1.0 + uses: codecov/codecov-action@c16abc29c95fcf9174b58eb7e1abf4c866893bc8 #v4.1.1 From 2e3b8e928a35d7d1117aee7d5115664d65fb8777 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Mon, 1 Apr 2024 16:39:00 -0400 Subject: [PATCH 428/751] Bump go-github from v60 to v61 in /scrape (#3119) --- scrape/apps.go | 2 +- scrape/apps_test.go | 2 +- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scrape/apps.go b/scrape/apps.go index fcf61588730..7bb2d6f30d6 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -17,7 +17,7 @@ import ( "strings" "github.com/PuerkitoBio/goquery" - "github.com/google/go-github/v60/github" + "github.com/google/go-github/v61/github" ) // AppRestrictionsEnabled returns whether the specified organization has diff --git a/scrape/apps_test.go b/scrape/apps_test.go index c0a6a751de3..65c88a787c1 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v60/github" + "github.com/google/go-github/v61/github" ) func Test_AppRestrictionsEnabled(t *testing.T) { diff --git a/scrape/go.mod b/scrape/go.mod index f48713d021c..445cf7023a4 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -7,7 +7,7 @@ toolchain go1.22.0 require ( github.com/PuerkitoBio/goquery v1.9.1 github.com/google/go-cmp v0.6.0 - github.com/google/go-github/v60 v60.0.0 + github.com/google/go-github/v61 v61.0.0 github.com/xlzd/gotp v0.1.0 golang.org/x/net v0.22.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index 3c8442f6aec..b17e88c87d4 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -5,8 +5,8 @@ github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6 github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v60 v60.0.0 h1:oLG98PsLauFvvu4D/YPxq374jhSxFYdzQGNCyONLfn8= -github.com/google/go-github/v60 v60.0.0/go.mod h1:ByhX2dP9XT9o/ll2yXAu2VD8l5eNVg8hD4Cr0S/LmQk= +github.com/google/go-github/v61 v61.0.0 h1:VwQCBwhyE9JclCI+22/7mLB1PuU9eowCXKY5pNlu1go= +github.com/google/go-github/v61 v61.0.0/go.mod h1:0WR+KmsWX75G2EbpyGsGmradjo3IiciuI4BmdVCobQY= 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.1.0 h1:37blvlKCh38s+fkem+fFh7sMnceltoIEBYTVXyoa5Po= From 9b87ff3d9657f1d6a90f02b98e4bd14dc6df9634 Mon Sep 17 00:00:00 2001 From: tomfeigin Date: Tue, 2 Apr 2024 02:07:12 +0300 Subject: [PATCH 429/751] Print the unrecognized repository rule type (#3113) --- github/repos_rules.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/repos_rules.go b/github/repos_rules.go index 9f4e0245f08..34711dda979 100644 --- a/github/repos_rules.go +++ b/github/repos_rules.go @@ -204,7 +204,7 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { default: r.Type = "" r.Parameters = nil - return fmt.Errorf("RepositoryRule.Type %T is not yet implemented, unable to unmarshal", RepositoryRule.Type) + return fmt.Errorf("RepositoryRule.Type %q is not yet implemented, unable to unmarshal (%#v)", RepositoryRule.Type, RepositoryRule) } return nil From 24209f034709de1744be65544f45962d925b4614 Mon Sep 17 00:00:00 2001 From: Liam Stanley Date: Wed, 3 Apr 2024 15:51:18 -0400 Subject: [PATCH 430/751] feat: Add missing github enterprise importer and domains meta fields (#3121) --- github/meta.go | 14 +++++++++++--- github/meta_test.go | 30 ++++++++++++++++++++---------- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/github/meta.go b/github/meta.go index 1da8fcf1326..e0e355e8cd0 100644 --- a/github/meta.go +++ b/github/meta.go @@ -17,11 +17,11 @@ type MetaService service // APIMeta represents metadata about the GitHub API. type APIMeta struct { - // An Array of IP addresses in CIDR format specifying the addresses + // An array of IP addresses in CIDR format specifying the addresses // that incoming service hooks will originate from on GitHub.com. Hooks []string `json:"hooks,omitempty"` - // An Array of IP addresses in CIDR format specifying the Git servers + // An array of IP addresses in CIDR format specifying the Git servers // for GitHub.com. Git []string `json:"git,omitempty"` @@ -40,10 +40,14 @@ type APIMeta struct { // which serve GitHub Pages websites. Pages []string `json:"pages,omitempty"` - // An Array of IP addresses specifying the addresses that source imports + // An array of IP addresses specifying the addresses that source imports // will originate from on GitHub.com. Importer []string `json:"importer,omitempty"` + // An array of IP addresses specifying the addresses that source imports + // will originate from on GitHub Enterprise Cloud. + GithubEnterpriseImporter []string `json:"github_enterprise_importer,omitempty"` + // An array of IP addresses in CIDR format specifying the IP addresses // GitHub Actions will originate from. Actions []string `json:"actions,omitempty"` @@ -65,6 +69,10 @@ type APIMeta struct { // An array of IP addresses in CIDR format specifying the addresses // which serve GitHub APIs. API []string `json:"api,omitempty"` + + // A map of GitHub services and their associated domains. Note that many + // of these domains are represented as wildcards (e.g. "*.github.com"). + Domains map[string][]string `json:"domains,omitempty"` } // Get returns information about GitHub.com, the service. Or, if you access diff --git a/github/meta_test.go b/github/meta_test.go index c7b01e298ed..99cb0b02ceb 100644 --- a/github/meta_test.go +++ b/github/meta_test.go @@ -23,12 +23,16 @@ func TestAPIMeta_Marshal(t *testing.T) { VerifiablePasswordAuthentication: Bool(true), Pages: []string{"p"}, Importer: []string{"i"}, + GithubEnterpriseImporter: []string{"gei"}, Actions: []string{"a"}, Dependabot: []string{"d"}, SSHKeyFingerprints: map[string]string{"a": "f"}, SSHKeys: []string{"k"}, API: []string{"a"}, Web: []string{"w"}, + Domains: map[string][]string{ + "example": {"example.com", "*.example.com"}, + }, } want := `{ "hooks":["h"], @@ -36,12 +40,14 @@ func TestAPIMeta_Marshal(t *testing.T) { "verifiable_password_authentication":true, "pages":["p"], "importer":["i"], + "github_enterprise_importer":["gei"], "actions":["a"], "dependabot":["d"], "ssh_key_fingerprints":{"a":"f"}, "ssh_keys":["k"], "api":["a"], - "web":["w"] + "web":["w"], + "domains":{"example":["example.com","*.example.com"]} }` testJSONMarshal(t, a, want) @@ -53,7 +59,7 @@ func TestMetaService_Get(t *testing.T) { mux.HandleFunc("/meta", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - fmt.Fprint(w, `{"web":["w"],"api":["a"],"hooks":["h"], "git":["g"], "pages":["p"], "importer":["i"], "actions":["a"], "dependabot":["d"], "verifiable_password_authentication": true}`) + fmt.Fprint(w, `{"web":["w"],"api":["a"],"hooks":["h"], "git":["g"], "pages":["p"], "importer":["i"], "github_enterprise_importer": ["gei"], "actions":["a"], "dependabot":["d"], "verifiable_password_authentication": true, "domains":{"example":["example.com","*.example.com"]}}`) }) ctx := context.Background() @@ -63,14 +69,18 @@ func TestMetaService_Get(t *testing.T) { } want := &APIMeta{ - Hooks: []string{"h"}, - Git: []string{"g"}, - Pages: []string{"p"}, - Importer: []string{"i"}, - Actions: []string{"a"}, - Dependabot: []string{"d"}, - API: []string{"a"}, - Web: []string{"w"}, + Hooks: []string{"h"}, + Git: []string{"g"}, + Pages: []string{"p"}, + Importer: []string{"i"}, + GithubEnterpriseImporter: []string{"gei"}, + Actions: []string{"a"}, + Dependabot: []string{"d"}, + API: []string{"a"}, + Web: []string{"w"}, + Domains: map[string][]string{ + "example": {"example.com", "*.example.com"}, + }, VerifiablePasswordAuthentication: Bool(true), } From 224c0aec4302309d811cf492703b2ac487732540 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Apr 2024 15:27:02 -0400 Subject: [PATCH 431/751] Bump github.com/getkin/kin-openapi from 0.123.0 to 0.124.0 in /tools (#3122) --- tools/go.mod | 2 +- tools/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index e6e95c644de..b4a206960c4 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -6,7 +6,7 @@ toolchain go1.22.0 require ( github.com/alecthomas/kong v0.9.0 - github.com/getkin/kin-openapi v0.123.0 + github.com/getkin/kin-openapi v0.124.0 github.com/google/go-cmp v0.6.0 github.com/google/go-github/v61 v61.0.0 golang.org/x/sync v0.6.0 diff --git a/tools/go.sum b/tools/go.sum index ce5b0414f82..d6349d01278 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -6,8 +6,8 @@ github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/getkin/kin-openapi v0.123.0 h1:zIik0mRwFNLyvtXK274Q6ut+dPh6nlxBp0x7mNrPhs8= -github.com/getkin/kin-openapi v0.123.0/go.mod h1:wb1aSZA/iWmorQP9KTAS/phLj/t17B5jT7+fS8ed9NM= +github.com/getkin/kin-openapi v0.124.0 h1:VSFNMB9C9rTKBnQ/fpyDU8ytMTr4dWI9QovSKj9kz/M= +github.com/getkin/kin-openapi v0.124.0/go.mod h1:wb1aSZA/iWmorQP9KTAS/phLj/t17B5jT7+fS8ed9NM= github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q= github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs= github.com/go-openapi/swag v0.22.8 h1:/9RjDSQ0vbFR+NyjGMkFTsA1IA0fmhKSThmfGZjicbw= From 33609b63bd1b2a6b4c276d8f27f4c12eea55786c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Apr 2024 15:42:19 -0400 Subject: [PATCH 432/751] Bump golang.org/x/sync from 0.6.0 to 0.7.0 in /tools (#3123) --- tools/go.mod | 2 +- tools/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index b4a206960c4..07515cb5ff0 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -9,7 +9,7 @@ require ( github.com/getkin/kin-openapi v0.124.0 github.com/google/go-cmp v0.6.0 github.com/google/go-github/v61 v61.0.0 - golang.org/x/sync v0.6.0 + golang.org/x/sync v0.7.0 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/tools/go.sum b/tools/go.sum index d6349d01278..a9e50530749 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -43,8 +43,8 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= From 0a7c7fd5aabf2a53fc9c77e7e4222a9f391c16ce Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Apr 2024 15:44:51 -0400 Subject: [PATCH 433/751] Bump codecov/codecov-action from 4.1.1 to 4.2.0 (#3124) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 760fb6c9191..da8143a7aeb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -73,4 +73,4 @@ jobs: - name: Upload coverage to Codecov if: ${{ matrix.update-coverage }} - uses: codecov/codecov-action@c16abc29c95fcf9174b58eb7e1abf4c866893bc8 #v4.1.1 + uses: codecov/codecov-action@7afa10ed9b269c561c2336fd862446844e0cbf71 #v4.2.0 From b603120bf932e99e8cc0a9fab0693fa6b5f92c4d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Apr 2024 15:49:51 -0400 Subject: [PATCH 434/751] Bump golang.org/x/net from 0.22.0 to 0.24.0 in /scrape (#3125) --- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 445cf7023a4..d3e23404724 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -9,7 +9,7 @@ require ( github.com/google/go-cmp v0.6.0 github.com/google/go-github/v61 v61.0.0 github.com/xlzd/gotp v0.1.0 - golang.org/x/net v0.22.0 + golang.org/x/net v0.24.0 ) require ( diff --git a/scrape/go.sum b/scrape/go.sum index b17e88c87d4..8c603f69ac6 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -21,8 +21,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= From a6806bc71d514c2104a596dd44ebe74830adf330 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Apr 2024 17:05:28 -0400 Subject: [PATCH 435/751] Bump codecov/codecov-action from 4.2.0 to 4.3.0 (#3128) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index da8143a7aeb..efac3df3d90 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -73,4 +73,4 @@ jobs: - name: Upload coverage to Codecov if: ${{ matrix.update-coverage }} - uses: codecov/codecov-action@7afa10ed9b269c561c2336fd862446844e0cbf71 #v4.2.0 + uses: codecov/codecov-action@84508663e988701840491b86de86b666e8a86bed #v4.3.0 From b02f283714b9150fd31eaa60bc805814f50a1447 Mon Sep 17 00:00:00 2001 From: Matthew William Reidy <48036844+Matthew-Reidy@users.noreply.github.com> Date: Thu, 18 Apr 2024 18:25:10 -0700 Subject: [PATCH 436/751] Add support for merge queue ruleset JSON unmarshaling (#3131) Fixes: #3098. --- AUTHORS | 3 ++- github/orgs_rules_test.go | 10 ++++++++++ github/repos_rules.go | 9 ++++++++- github/repos_rules_test.go | 7 +++++++ 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index 74a21dc604e..0197b94a23a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -303,6 +303,7 @@ Matt Gaunt Matt Landis Matt Moore Matt Simons +Matthew Reidy Maxime Bury Michael Meng Michael Spiegel @@ -484,4 +485,4 @@ Zach Latta zhouhaibing089 六开箱 缘生 -蒋航 +蒋航 \ No newline at end of file diff --git a/github/orgs_rules_test.go b/github/orgs_rules_test.go index 50ba4e20c01..0ed54ca8d27 100644 --- a/github/orgs_rules_test.go +++ b/github/orgs_rules_test.go @@ -123,6 +123,9 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) { "type": "deletion" }, + { + "type": "merge_queue" + }, { "type": "required_linear_history" }, @@ -238,6 +241,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) UpdateAllowsFetchAndMerge: true, }), NewDeletionRule(), + NewMergeQueueRule(), NewRequiredLinearHistoryRule(), NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ RequiredDeploymentEnvironments: []string{"test"}, @@ -324,6 +328,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) UpdateAllowsFetchAndMerge: true, }), NewDeletionRule(), + NewMergeQueueRule(), NewRequiredLinearHistoryRule(), NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ RequiredDeploymentEnvironments: []string{"test"}, @@ -437,6 +442,9 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { { "type": "deletion" }, + { + "type": "merge_queue" + }, { "type": "required_linear_history" }, @@ -550,6 +558,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { UpdateAllowsFetchAndMerge: true, }), NewDeletionRule(), + NewMergeQueueRule(), NewRequiredLinearHistoryRule(), NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ RequiredDeploymentEnvironments: []string{"test"}, @@ -634,6 +643,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { UpdateAllowsFetchAndMerge: true, }), NewDeletionRule(), + NewMergeQueueRule(), NewRequiredLinearHistoryRule(), NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ RequiredDeploymentEnvironments: []string{"test"}, diff --git a/github/repos_rules.go b/github/repos_rules.go index 34711dda979..6f046a356a6 100644 --- a/github/repos_rules.go +++ b/github/repos_rules.go @@ -134,7 +134,7 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { r.Type = RepositoryRule.Type switch RepositoryRule.Type { - case "creation", "deletion", "required_linear_history", "required_signatures", "non_fast_forward": + case "creation", "deletion", "merge_queue", "non_fast_forward", "required_linear_history", "required_signatures": r.Parameters = nil case "update": if RepositoryRule.Parameters == nil { @@ -210,6 +210,13 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { return nil } +// NewMergeQueueRule creates a rule to only allow merges via a merge queue. +func NewMergeQueueRule() (rule *RepositoryRule) { + return &RepositoryRule{ + Type: "merge_queue", + } +} + // NewCreationRule creates a rule to only allow users with bypass permission to create matching refs. func NewCreationRule() (rule *RepositoryRule) { return &RepositoryRule{ diff --git a/github/repos_rules_test.go b/github/repos_rules_test.go index cbc3e5ce617..23ffd3ed5c1 100644 --- a/github/repos_rules_test.go +++ b/github/repos_rules_test.go @@ -67,6 +67,13 @@ func TestRepositoryRule_UnmarshalJSON(t *testing.T) { Parameters: nil, }, }, + "Valid merge_queue": { + data: `{"type":"merge_queue"}`, + want: &RepositoryRule{ + Type: "merge_queue", + Parameters: nil, + }, + }, "Valid non_fast_forward": { data: `{"type":"non_fast_forward"}`, want: &RepositoryRule{ From 8d4be0b2cf2b8242a0b7e3777232cd0058ae535f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Apr 2024 09:16:31 -0400 Subject: [PATCH 437/751] Bump golang.org/x/net from 0.17.0 to 0.23.0 in /example (#3134) --- example/go.mod | 8 ++++---- example/go.sum | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/example/go.mod b/example/go.mod index 5b11139f25e..0213a527e0c 100644 --- a/example/go.mod +++ b/example/go.mod @@ -7,8 +7,8 @@ require ( github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-ratelimit v1.0.3 github.com/google/go-github/v61 v61.0.0 - golang.org/x/crypto v0.17.0 - golang.org/x/term v0.15.0 + golang.org/x/crypto v0.21.0 + golang.org/x/term v0.18.0 google.golang.org/appengine v1.6.7 ) @@ -18,8 +18,8 @@ require ( github.com/golang/protobuf v1.5.2 // indirect github.com/google/go-github/v41 v41.0.0 // indirect github.com/google/go-querystring v1.1.0 // indirect - golang.org/x/net v0.17.0 // indirect - golang.org/x/sys v0.15.0 // indirect + golang.org/x/net v0.23.0 // indirect + golang.org/x/sys v0.18.0 // indirect google.golang.org/protobuf v1.33.0 // indirect ) diff --git a/example/go.sum b/example/go.sum index d8e05e56537..7e3d1749689 100644 --- a/example/go.sum +++ b/example/go.sum @@ -30,8 +30,8 @@ golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= -golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= @@ -41,8 +41,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -56,15 +56,15 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= -golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= +golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= +golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= From d0678244549b22cbe0c45b3b6cb4a04f27b09f47 Mon Sep 17 00:00:00 2001 From: Tayo Oloyede <106995402+tayosec@users.noreply.github.com> Date: Thu, 25 Apr 2024 15:47:09 -0500 Subject: [PATCH 438/751] Add Missing Changes Field to Member Event Type. (#3153) Fixes: #3154. --- github/event_types.go | 28 ++++++++++++--- github/event_types_test.go | 20 +++++++++++ github/github-accessors.go | 56 ++++++++++++++++++++++++++++++ github/github-accessors_test.go | 61 +++++++++++++++++++++++++++++++++ 4 files changed, 161 insertions(+), 4 deletions(-) diff --git a/github/event_types.go b/github/event_types.go index b820dddf4a7..703af1f2f2b 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -689,14 +689,34 @@ type MarketplacePurchaseEvent struct { Org *Organization `json:"organization,omitempty"` } -// MemberEvent is triggered when a user is added as a collaborator to a repository. +// MemberChangesPermission represents changes to a repository collaborator's permissions. +type MemberChangesPermission struct { + From *string `json:"from,omitempty"` + To *string `json:"to,omitempty"` +} + +// MemberChangesRoleName represents changes to a repository collaborator's role. +type MemberChangesRoleName struct { + From *string `json:"from,omitempty"` + To *string `json:"to,omitempty"` +} + +// MemberChanges represents changes to a repository collaborator's role or permission. +type MemberChanges struct { + Permission *MemberChangesPermission `json:"permission,omitempty"` + RoleName *MemberChangesRoleName `json:"role_name,omitempty"` +} + +// MemberEvent is triggered when a user's membership as a collaborator to a repository changes. // The Webhook event name is "member". // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#member type MemberEvent struct { - // Action is the action that was performed. Possible value is: "added". - Action *string `json:"action,omitempty"` - Member *User `json:"member,omitempty"` + // Action is the action that was performed. Possible values are: + //"added", "edited", "removed". + Action *string `json:"action,omitempty"` + Member *User `json:"member,omitempty"` + Changes *MemberChanges `json:"changes,omitempty"` // The following fields are only populated by Webhook events. Repo *Repository `json:"repository,omitempty"` diff --git a/github/event_types_test.go b/github/event_types_test.go index b00e94a34e4..79532d4916a 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -9106,6 +9106,16 @@ func TestMemberEvent_Marshal(t *testing.T) { EventsURL: String("e"), AvatarURL: String("a"), }, + Changes: &MemberChanges{ + Permission: &MemberChangesPermission{ + From: String("f"), + To: String("t"), + }, + RoleName: &MemberChangesRoleName{ + From: String("f"), + To: String("t"), + }, + }, Repo: &Repository{ ID: Int64(1), URL: String("s"), @@ -9226,6 +9236,16 @@ func TestMemberEvent_Marshal(t *testing.T) { "events_url": "e", "repos_url": "r" }, + "changes": { + "permission": { + "from": "f", + "to": "t" + }, + "role_name": { + "from": "f", + "to": "t" + } + }, "repository": { "id": 1, "name": "n", diff --git a/github/github-accessors.go b/github/github-accessors.go index 57a7165f7ff..13bf7d6668c 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -11206,6 +11206,54 @@ func (m *Match) GetText() string { return *m.Text } +// GetPermission returns the Permission field. +func (m *MemberChanges) GetPermission() *MemberChangesPermission { + if m == nil { + return nil + } + return m.Permission +} + +// GetRoleName returns the RoleName field. +func (m *MemberChanges) GetRoleName() *MemberChangesRoleName { + if m == nil { + return nil + } + return m.RoleName +} + +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (m *MemberChangesPermission) GetFrom() string { + if m == nil || m.From == nil { + return "" + } + return *m.From +} + +// GetTo returns the To field if it's non-nil, zero value otherwise. +func (m *MemberChangesPermission) GetTo() string { + if m == nil || m.To == nil { + return "" + } + return *m.To +} + +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (m *MemberChangesRoleName) GetFrom() string { + if m == nil || m.From == nil { + return "" + } + return *m.From +} + +// GetTo returns the To field if it's non-nil, zero value otherwise. +func (m *MemberChangesRoleName) GetTo() string { + if m == nil || m.To == nil { + return "" + } + return *m.To +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (m *MemberEvent) GetAction() string { if m == nil || m.Action == nil { @@ -11214,6 +11262,14 @@ func (m *MemberEvent) GetAction() string { return *m.Action } +// GetChanges returns the Changes field. +func (m *MemberEvent) GetChanges() *MemberChanges { + if m == nil { + return nil + } + return m.Changes +} + // GetInstallation returns the Installation field. func (m *MemberEvent) GetInstallation() *Installation { if m == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index bbf9fb8422c..313e92c0596 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -13111,6 +13111,60 @@ func TestMatch_GetText(tt *testing.T) { m.GetText() } +func TestMemberChanges_GetPermission(tt *testing.T) { + m := &MemberChanges{} + m.GetPermission() + m = nil + m.GetPermission() +} + +func TestMemberChanges_GetRoleName(tt *testing.T) { + m := &MemberChanges{} + m.GetRoleName() + m = nil + m.GetRoleName() +} + +func TestMemberChangesPermission_GetFrom(tt *testing.T) { + var zeroValue string + m := &MemberChangesPermission{From: &zeroValue} + m.GetFrom() + m = &MemberChangesPermission{} + m.GetFrom() + m = nil + m.GetFrom() +} + +func TestMemberChangesPermission_GetTo(tt *testing.T) { + var zeroValue string + m := &MemberChangesPermission{To: &zeroValue} + m.GetTo() + m = &MemberChangesPermission{} + m.GetTo() + m = nil + m.GetTo() +} + +func TestMemberChangesRoleName_GetFrom(tt *testing.T) { + var zeroValue string + m := &MemberChangesRoleName{From: &zeroValue} + m.GetFrom() + m = &MemberChangesRoleName{} + m.GetFrom() + m = nil + m.GetFrom() +} + +func TestMemberChangesRoleName_GetTo(tt *testing.T) { + var zeroValue string + m := &MemberChangesRoleName{To: &zeroValue} + m.GetTo() + m = &MemberChangesRoleName{} + m.GetTo() + m = nil + m.GetTo() +} + func TestMemberEvent_GetAction(tt *testing.T) { var zeroValue string m := &MemberEvent{Action: &zeroValue} @@ -13121,6 +13175,13 @@ func TestMemberEvent_GetAction(tt *testing.T) { m.GetAction() } +func TestMemberEvent_GetChanges(tt *testing.T) { + m := &MemberEvent{} + m.GetChanges() + m = nil + m.GetChanges() +} + func TestMemberEvent_GetInstallation(tt *testing.T) { m := &MemberEvent{} m.GetInstallation() From 108f958f6ff14140a10710d15a2796a9b8334e08 Mon Sep 17 00:00:00 2001 From: Matthew William Reidy <48036844+Matthew-Reidy@users.noreply.github.com> Date: Mon, 29 Apr 2024 14:28:04 -0700 Subject: [PATCH 439/751] Allow an empty array of repo ids as a request parameter (#3155) Fixes: #3106. --- github/apps.go | 38 ++++++++++++++++++ github/apps_test.go | 71 +++++++++++++++++++++++++++++++++ github/github-accessors.go | 8 ++++ github/github-accessors_test.go | 7 ++++ 4 files changed, 124 insertions(+) diff --git a/github/apps.go b/github/apps.go index 2ebfee505cd..6969daba6c0 100644 --- a/github/apps.go +++ b/github/apps.go @@ -56,6 +56,20 @@ type InstallationTokenOptions struct { Permissions *InstallationPermissions `json:"permissions,omitempty"` } +type InstallationTokenListRepoOptions struct { + // The IDs of the repositories that the installation token can access. + // Providing repository IDs restricts the access of an installation token to specific repositories. + RepositoryIDs []int64 `json:"repository_ids"` + + // The names of the repositories that the installation token can access. + // Providing repository names restricts the access of an installation token to specific repositories. + Repositories []string `json:"repositories,omitempty"` + + // The permissions granted to the access token. + // The permissions object includes the permission names and their access type. + Permissions *InstallationPermissions `json:"permissions,omitempty"` +} + // InstallationPermissions lists the repository and organization permissions for an installation. // // Permission names taken from: @@ -344,6 +358,30 @@ func (s *AppsService) CreateInstallationToken(ctx context.Context, id int64, opt return t, resp, nil } +// CreateInstallationTokenListRepos creates a new installation token with a list of all repositories in an installation which is not possible with CreateInstallationToken. +// +// It differs from CreateInstallationToken by taking InstallationTokenListRepoOptions as a parameter which does not omit RepositoryIDs if that field is nil or an empty array. +// +// GitHub API docs: https://docs.github.com/rest/apps/apps#create-an-installation-access-token-for-an-app +// +//meta:operation POST /app/installations/{installation_id}/access_tokens +func (s *AppsService) CreateInstallationTokenListRepos(ctx context.Context, id int64, opts *InstallationTokenListRepoOptions) (*InstallationToken, *Response, error) { + u := fmt.Sprintf("app/installations/%v/access_tokens", id) + + req, err := s.client.NewRequest("POST", u, opts) + if err != nil { + return nil, nil, err + } + + t := new(InstallationToken) + resp, err := s.client.Do(ctx, req, t) + if err != nil { + return nil, resp, err + } + + return t, resp, nil +} + // CreateAttachment creates a new attachment on user comment containing a url. // // GitHub API docs: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#create-a-content-attachment diff --git a/github/apps_test.go b/github/apps_test.go index a58326ea5ee..ea670344595 100644 --- a/github/apps_test.go +++ b/github/apps_test.go @@ -469,6 +469,77 @@ func TestAppsService_CreateInstallationTokenWithOptions(t *testing.T) { } } +func TestAppsService_CreateInstallationTokenListReposWithOptions(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + installationTokenListRepoOptions := &InstallationTokenListRepoOptions{ + Repositories: []string{"foo"}, + Permissions: &InstallationPermissions{ + Contents: String("write"), + Issues: String("read"), + }, + } + + mux.HandleFunc("/app/installations/1/access_tokens", func(w http.ResponseWriter, r *http.Request) { + v := new(InstallationTokenListRepoOptions) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) + + if !cmp.Equal(v, installationTokenListRepoOptions) { + t.Errorf("request sent %+v, want %+v", v, installationTokenListRepoOptions) + } + + testMethod(t, r, "POST") + fmt.Fprint(w, `{"token":"t"}`) + }) + + ctx := context.Background() + token, _, err := client.Apps.CreateInstallationTokenListRepos(ctx, 1, installationTokenListRepoOptions) + if err != nil { + t.Errorf("Apps.CreateInstallationTokenListRepos returned error: %v", err) + } + + want := &InstallationToken{Token: String("t")} + if !cmp.Equal(token, want) { + t.Errorf("Apps.CreateInstallationTokenListRepos returned %+v, want %+v", token, want) + } +} + +func TestAppsService_CreateInstallationTokenListReposWithNoOptions(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/app/installations/1/access_tokens", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + fmt.Fprint(w, `{"token":"t"}`) + }) + + ctx := context.Background() + token, _, err := client.Apps.CreateInstallationTokenListRepos(ctx, 1, nil) + if err != nil { + t.Errorf("Apps.CreateInstallationTokenListRepos returned error: %v", err) + } + + want := &InstallationToken{Token: String("t")} + if !cmp.Equal(token, want) { + t.Errorf("Apps.CreateInstallationTokenListRepos returned %+v, want %+v", token, want) + } + + const methodName = "CreateInstallationTokenListRepos" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Apps.CreateInstallationTokenListRepos(ctx, -1, nil) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Apps.CreateInstallationTokenListRepos(ctx, 1, nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + func TestAppsService_CreateAttachement(t *testing.T) { client, mux, _, teardown := setup() defer teardown() diff --git a/github/github-accessors.go b/github/github-accessors.go index 13bf7d6668c..390ae086d3d 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -9062,6 +9062,14 @@ func (i *InstallationToken) GetToken() string { return *i.Token } +// GetPermissions returns the Permissions field. +func (i *InstallationTokenListRepoOptions) GetPermissions() *InstallationPermissions { + if i == nil { + return nil + } + return i.Permissions +} + // GetPermissions returns the Permissions field. func (i *InstallationTokenOptions) GetPermissions() *InstallationPermissions { if i == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 313e92c0596..8fafe9a2187 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -10608,6 +10608,13 @@ func TestInstallationToken_GetToken(tt *testing.T) { i.GetToken() } +func TestInstallationTokenListRepoOptions_GetPermissions(tt *testing.T) { + i := &InstallationTokenListRepoOptions{} + i.GetPermissions() + i = nil + i.GetPermissions() +} + func TestInstallationTokenOptions_GetPermissions(tt *testing.T) { i := &InstallationTokenOptions{} i.GetPermissions() From 715be3982a2feb7f57fcaace3b63a3ac63d3ddac Mon Sep 17 00:00:00 2001 From: Ryan Skidmore Date: Mon, 29 Apr 2024 23:44:50 +0100 Subject: [PATCH 440/751] Fix application of pagination options on ListCopilotSeats endpoint (#3090) --- github/copilot_test.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/github/copilot_test.go b/github/copilot_test.go index bc295af3a61..7ba333c89e0 100644 --- a/github/copilot_test.go +++ b/github/copilot_test.go @@ -336,6 +336,10 @@ func TestCopilotService_ListCopilotSeats(t *testing.T) { mux.HandleFunc("/orgs/o/copilot/billing/seats", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") + testFormValues(t, r, values{ + "per_page": "100", + "page": "1", + }) fmt.Fprint(w, `{ "total_seats": 4, "seats": [ @@ -473,7 +477,8 @@ func TestCopilotService_ListCopilotSeats(t *testing.T) { lastActivityAt2 := Timestamp{tmp} ctx := context.Background() - got, _, err := client.Copilot.ListCopilotSeats(ctx, "o", nil) + opts := &ListOptions{Page: 1, PerPage: 100} + got, _, err := client.Copilot.ListCopilotSeats(ctx, "o", opts) if err != nil { t.Errorf("Copilot.ListCopilotSeats returned error: %v", err) } @@ -591,7 +596,7 @@ func TestCopilotService_ListCopilotSeats(t *testing.T) { }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Copilot.ListCopilotSeats(ctx, "", nil) + got, resp, err := client.Copilot.ListCopilotSeats(ctx, "o", opts) if got != nil { t.Errorf("Copilot.ListCopilotSeats returned %+v, want nil", got) } From e21b500cb839e0c9e4997926818b287243c973f9 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Mon, 29 Apr 2024 19:29:06 -0400 Subject: [PATCH 441/751] Hotfix: Fix broken unit test in copilot_test.go (#3156) --- github/copilot_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/github/copilot_test.go b/github/copilot_test.go index 7ba333c89e0..008630ab273 100644 --- a/github/copilot_test.go +++ b/github/copilot_test.go @@ -589,7 +589,6 @@ func TestCopilotService_ListCopilotSeats(t *testing.T) { const methodName = "ListCopilotSeats" - opts := &ListOptions{Page: 2} testBadOptions(t, methodName, func() (err error) { _, _, err = client.Copilot.ListCopilotSeats(ctx, "\n", opts) return err From 497dbe8d04174542f7e055da7c0449f969893dc4 Mon Sep 17 00:00:00 2001 From: Erez Rokah Date: Wed, 1 May 2024 17:09:18 +0100 Subject: [PATCH 442/751] feat: Allow blocking until primary rate limit is reset (#3117) Fixes: #3114. --- README.md | 6 ++ github/github.go | 36 +++++++++ github/github_test.go | 170 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 212 insertions(+) diff --git a/README.md b/README.md index 94e1cc544ee..386f581968b 100644 --- a/README.md +++ b/README.md @@ -180,6 +180,12 @@ if _, ok := err.(*github.AbuseRateLimitError); ok { } ``` +Alternatively, you can block until the rate limit is reset by using the `context.WithValue` method: + +````go +repos, _, err := client.Repositories.List(context.WithValue(ctx, github.SleepUntilPrimaryRateLimitResetWhenRateLimited, true), "", nil) +``` + You can use [go-github-ratelimit](https://github.com/gofri/go-github-ratelimit) to handle secondary rate limit sleep-and-retry for you. diff --git a/github/github.go b/github/github.go index 03e2e6273cf..ad4269595bf 100644 --- a/github/github.go +++ b/github/github.go @@ -804,6 +804,7 @@ type requestContext uint8 const ( bypassRateLimitCheck requestContext = iota + SleepUntilPrimaryRateLimitResetWhenRateLimited ) // BareDo sends an API request and lets you handle the api response. If an error @@ -889,6 +890,15 @@ func (c *Client) BareDo(ctx context.Context, req *http.Request) (*Response, erro err = aerr } + rateLimitError, ok := err.(*RateLimitError) + if ok && req.Context().Value(SleepUntilPrimaryRateLimitResetWhenRateLimited) != nil { + if err := sleepUntilResetWithBuffer(req.Context(), rateLimitError.Rate.Reset.Time); err != nil { + return response, err + } + // retry the request once when the rate limit has reset + return c.BareDo(context.WithValue(req.Context(), SleepUntilPrimaryRateLimitResetWhenRateLimited, nil), req) + } + // Update the secondary rate limit if we hit it. rerr, ok := err.(*AbuseRateLimitError) if ok && rerr.RetryAfter != nil { @@ -950,6 +960,18 @@ func (c *Client) checkRateLimitBeforeDo(req *http.Request, rateLimitCategory Rat Header: make(http.Header), Body: io.NopCloser(strings.NewReader("")), } + + if req.Context().Value(SleepUntilPrimaryRateLimitResetWhenRateLimited) != nil { + if err := sleepUntilResetWithBuffer(req.Context(), rate.Reset.Time); err == nil { + return nil + } + return &RateLimitError{ + Rate: rate, + Response: resp, + Message: fmt.Sprintf("Context cancelled while waiting for rate limit to reset until %v, not making remote request.", rate.Reset.Time), + } + } + return &RateLimitError{ Rate: rate, Response: resp, @@ -1514,6 +1536,20 @@ func formatRateReset(d time.Duration) string { return fmt.Sprintf("[rate reset in %v]", timeString) } +func sleepUntilResetWithBuffer(ctx context.Context, reset time.Time) error { + buffer := time.Second + timer := time.NewTimer(time.Until(reset) + buffer) + select { + case <-ctx.Done(): + if !timer.Stop() { + <-timer.C + } + return ctx.Err() + case <-timer.C: + } + return nil +} + // When using roundTripWithOptionalFollowRedirect, note that it // is the responsibility of the caller to close the response body. func (c *Client) roundTripWithOptionalFollowRedirect(ctx context.Context, u string, maxRedirects int, opts ...RequestOption) (*http.Response, error) { diff --git a/github/github_test.go b/github/github_test.go index efc42d432fb..8c6c38a84f0 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -1381,6 +1381,176 @@ func TestDo_rateLimit_ignoredFromCache(t *testing.T) { } } +// Ensure sleeps until the rate limit is reset when the client is rate limited. +func TestDo_rateLimit_sleepUntilResponseResetLimit(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + reset := time.Now().UTC().Add(time.Second) + + var firstRequest = true + mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + if firstRequest { + firstRequest = false + w.Header().Set(headerRateLimit, "60") + w.Header().Set(headerRateRemaining, "0") + w.Header().Set(headerRateReset, fmt.Sprint(reset.Unix())) + w.Header().Set("Content-Type", "application/json; charset=utf-8") + w.WriteHeader(http.StatusForbidden) + fmt.Fprintln(w, `{ + "message": "API rate limit exceeded for xxx.xxx.xxx.xxx. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)", + "documentation_url": "https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits" +}`) + return + } + w.Header().Set(headerRateLimit, "5000") + w.Header().Set(headerRateRemaining, "5000") + w.Header().Set(headerRateReset, fmt.Sprint(reset.Add(time.Hour).Unix())) + w.Header().Set("Content-Type", "application/json; charset=utf-8") + w.WriteHeader(http.StatusOK) + fmt.Fprintln(w, `{}`) + }) + + req, _ := client.NewRequest("GET", ".", nil) + ctx := context.Background() + resp, err := client.Do(context.WithValue(ctx, SleepUntilPrimaryRateLimitResetWhenRateLimited, true), req, nil) + if err != nil { + t.Errorf("Do returned unexpected error: %v", err) + } + if got, want := resp.StatusCode, http.StatusOK; got != want { + t.Errorf("Response status code = %v, want %v", got, want) + } +} + +// Ensure tries to sleep until the rate limit is reset when the client is rate limited, but only once. +func TestDo_rateLimit_sleepUntilResponseResetLimitRetryOnce(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + reset := time.Now().UTC().Add(time.Second) + + requestCount := 0 + mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + requestCount++ + w.Header().Set(headerRateLimit, "60") + w.Header().Set(headerRateRemaining, "0") + w.Header().Set(headerRateReset, fmt.Sprint(reset.Unix())) + w.Header().Set("Content-Type", "application/json; charset=utf-8") + w.WriteHeader(http.StatusForbidden) + fmt.Fprintln(w, `{ + "message": "API rate limit exceeded for xxx.xxx.xxx.xxx. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)", + "documentation_url": "https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits" +}`) + }) + + req, _ := client.NewRequest("GET", ".", nil) + ctx := context.Background() + _, err := client.Do(context.WithValue(ctx, SleepUntilPrimaryRateLimitResetWhenRateLimited, true), req, nil) + if err == nil { + t.Error("Expected error to be returned.") + } + if got, want := requestCount, 2; got != want { + t.Errorf("Expected 2 requests, got %d", got) + } +} + +// Ensure a network call is not made when it's known that API rate limit is still exceeded. +func TestDo_rateLimit_sleepUntilClientResetLimit(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + reset := time.Now().UTC().Add(time.Second) + client.rateLimits[CoreCategory] = Rate{Limit: 5000, Remaining: 0, Reset: Timestamp{reset}} + requestCount := 0 + mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + requestCount++ + w.Header().Set(headerRateLimit, "5000") + w.Header().Set(headerRateRemaining, "5000") + w.Header().Set(headerRateReset, fmt.Sprint(reset.Add(time.Hour).Unix())) + w.Header().Set("Content-Type", "application/json; charset=utf-8") + w.WriteHeader(http.StatusOK) + fmt.Fprintln(w, `{}`) + }) + req, _ := client.NewRequest("GET", ".", nil) + ctx := context.Background() + resp, err := client.Do(context.WithValue(ctx, SleepUntilPrimaryRateLimitResetWhenRateLimited, true), req, nil) + if err != nil { + t.Errorf("Do returned unexpected error: %v", err) + } + if got, want := resp.StatusCode, http.StatusOK; got != want { + t.Errorf("Response status code = %v, want %v", got, want) + } + if got, want := requestCount, 1; got != want { + t.Errorf("Expected 1 request, got %d", got) + } +} + +// Ensure sleep is aborted when the context is cancelled. +func TestDo_rateLimit_abortSleepContextCancelled(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + // We use a 1 minute reset time to ensure the sleep is not completed. + reset := time.Now().UTC().Add(time.Minute) + requestCount := 0 + mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + requestCount++ + w.Header().Set(headerRateLimit, "60") + w.Header().Set(headerRateRemaining, "0") + w.Header().Set(headerRateReset, fmt.Sprint(reset.Unix())) + w.Header().Set("Content-Type", "application/json; charset=utf-8") + w.WriteHeader(http.StatusForbidden) + fmt.Fprintln(w, `{ + "message": "API rate limit exceeded for xxx.xxx.xxx.xxx. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)", + "documentation_url": "https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits" +}`) + }) + + req, _ := client.NewRequest("GET", ".", nil) + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Millisecond) + defer cancel() + _, err := client.Do(context.WithValue(ctx, SleepUntilPrimaryRateLimitResetWhenRateLimited, true), req, nil) + if !errors.Is(err, context.DeadlineExceeded) { + t.Error("Expected context deadline exceeded error.") + } + if got, want := requestCount, 1; got != want { + t.Errorf("Expected 1 requests, got %d", got) + } +} + +// Ensure sleep is aborted when the context is cancelled on initial request. +func TestDo_rateLimit_abortSleepContextCancelledClientLimit(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + reset := time.Now().UTC().Add(time.Minute) + client.rateLimits[CoreCategory] = Rate{Limit: 5000, Remaining: 0, Reset: Timestamp{reset}} + requestCount := 0 + mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + requestCount++ + w.Header().Set(headerRateLimit, "5000") + w.Header().Set(headerRateRemaining, "5000") + w.Header().Set(headerRateReset, fmt.Sprint(reset.Add(time.Hour).Unix())) + w.Header().Set("Content-Type", "application/json; charset=utf-8") + w.WriteHeader(http.StatusOK) + fmt.Fprintln(w, `{}`) + }) + req, _ := client.NewRequest("GET", ".", nil) + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Millisecond) + defer cancel() + _, err := client.Do(context.WithValue(ctx, SleepUntilPrimaryRateLimitResetWhenRateLimited, true), req, nil) + rateLimitError, ok := err.(*RateLimitError) + if !ok { + t.Fatalf("Expected a *rateLimitError error; got %#v.", err) + } + if got, wantSuffix := rateLimitError.Message, "Context cancelled while waiting for rate limit to reset until"; !strings.HasPrefix(got, wantSuffix) { + t.Errorf("Expected request to be prevented because context cancellation, got: %v.", got) + } + if got, want := requestCount, 0; got != want { + t.Errorf("Expected 1 requests, got %d", got) + } +} + // Ensure *AbuseRateLimitError is returned when the response indicates that // the client has triggered an abuse detection mechanism. func TestDo_rateLimit_abuseRateLimitError(t *testing.T) { From faffd29a1cb1e391c8b4de819928c97821e87a2f Mon Sep 17 00:00:00 2001 From: Jan Guth Date: Wed, 1 May 2024 18:12:50 +0200 Subject: [PATCH 443/751] feat!: Add ListRunnersOptions to support all query parameters (#3094) Fixes: #3093. BREAKING-CHANGE: This changes `ListOptions` to `ListRunnersOptions` in `ListRunners` and `ListOrganizationRunners`. --- github/actions_runners.go | 10 ++++++++-- github/actions_runners_test.go | 16 ++++++++++------ github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ 4 files changed, 36 insertions(+), 8 deletions(-) diff --git a/github/actions_runners.go b/github/actions_runners.go index c5c90279df5..c4ae48232ec 100644 --- a/github/actions_runners.go +++ b/github/actions_runners.go @@ -151,12 +151,18 @@ type Runners struct { Runners []*Runner `json:"runners"` } +// ListRunnersOptions specifies the optional parameters to the ListRunners and ListOrganizationRunners methods. +type ListRunnersOptions struct { + Name *string `url:"name,omitempty"` + ListOptions +} + // ListRunners lists all the self-hosted runners for a repository. // // GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/actions/runners -func (s *ActionsService) ListRunners(ctx context.Context, owner, repo string, opts *ListOptions) (*Runners, *Response, error) { +func (s *ActionsService) ListRunners(ctx context.Context, owner, repo string, opts *ListRunnersOptions) (*Runners, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners", owner, repo) u, err := addOptions(u, opts) if err != nil { @@ -290,7 +296,7 @@ func (s *ActionsService) CreateOrganizationRegistrationToken(ctx context.Context // GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-organization // //meta:operation GET /orgs/{org}/actions/runners -func (s *ActionsService) ListOrganizationRunners(ctx context.Context, org string, opts *ListOptions) (*Runners, *Response, error) { +func (s *ActionsService) ListOrganizationRunners(ctx context.Context, org string, opts *ListRunnersOptions) (*Runners, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners", org) u, err := addOptions(u, opts) if err != nil { diff --git a/github/actions_runners_test.go b/github/actions_runners_test.go index 581e459442d..f425e8af7b0 100644 --- a/github/actions_runners_test.go +++ b/github/actions_runners_test.go @@ -188,11 +188,14 @@ func TestActionsService_ListRunners(t *testing.T) { mux.HandleFunc("/repos/o/r/actions/runners", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testFormValues(t, r, values{"per_page": "2", "page": "2"}) - fmt.Fprint(w, `{"total_count":2,"runners":[{"id":23,"name":"MBP","os":"macos","status":"online"},{"id":24,"name":"iMac","os":"macos","status":"offline"}]}`) + testFormValues(t, r, values{"name": "MBP", "per_page": "2", "page": "2"}) + fmt.Fprint(w, `{"total_count":1,"runners":[{"id":23,"name":"MBP","os":"macos","status":"online"}]}`) }) - opts := &ListOptions{Page: 2, PerPage: 2} + opts := &ListRunnersOptions{ + Name: String("MBP"), + ListOptions: ListOptions{Page: 2, PerPage: 2}, + } ctx := context.Background() runners, _, err := client.Actions.ListRunners(ctx, "o", "r", opts) if err != nil { @@ -200,10 +203,9 @@ func TestActionsService_ListRunners(t *testing.T) { } want := &Runners{ - TotalCount: 2, + TotalCount: 1, Runners: []*Runner{ {ID: Int64(23), Name: String("MBP"), OS: String("macos"), Status: String("online")}, - {ID: Int64(24), Name: String("iMac"), OS: String("macos"), Status: String("offline")}, }, } if !cmp.Equal(runners, want) { @@ -413,7 +415,9 @@ func TestActionsService_ListOrganizationRunners(t *testing.T) { fmt.Fprint(w, `{"total_count":2,"runners":[{"id":23,"name":"MBP","os":"macos","status":"online"},{"id":24,"name":"iMac","os":"macos","status":"offline"}]}`) }) - opts := &ListOptions{Page: 2, PerPage: 2} + opts := &ListRunnersOptions{ + ListOptions: ListOptions{Page: 2, PerPage: 2}, + } ctx := context.Background() runners, _, err := client.Actions.ListOrganizationRunners(ctx, "o", opts) if err != nil { diff --git a/github/github-accessors.go b/github/github-accessors.go index 390ae086d3d..a0ecef5ddaa 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -10766,6 +10766,14 @@ func (l *ListRepositories) GetTotalCount() int { return *l.TotalCount } +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (l *ListRunnersOptions) GetName() string { + if l == nil || l.Name == nil { + return "" + } + return *l.Name +} + // GetCount returns the Count field if it's non-nil, zero value otherwise. func (l *ListSCIMProvisionedIdentitiesOptions) GetCount() int { if l == nil || l.Count == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 8fafe9a2187..4cc49f7d7ab 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -12588,6 +12588,16 @@ func TestListRepositories_GetTotalCount(tt *testing.T) { l.GetTotalCount() } +func TestListRunnersOptions_GetName(tt *testing.T) { + var zeroValue string + l := &ListRunnersOptions{Name: &zeroValue} + l.GetName() + l = &ListRunnersOptions{} + l.GetName() + l = nil + l.GetName() +} + func TestListSCIMProvisionedIdentitiesOptions_GetCount(tt *testing.T) { var zeroValue int l := &ListSCIMProvisionedIdentitiesOptions{Count: &zeroValue} From faa0e7ceab73b24244cfe6800acb1a74ac619cf9 Mon Sep 17 00:00:00 2001 From: Nathan Date: Wed, 1 May 2024 14:30:28 -0400 Subject: [PATCH 444/751] Remove extra backtick from README.md (#3158) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 386f581968b..d1cd2df1d0e 100644 --- a/README.md +++ b/README.md @@ -182,7 +182,7 @@ if _, ok := err.(*github.AbuseRateLimitError); ok { Alternatively, you can block until the rate limit is reset by using the `context.WithValue` method: -````go +```go repos, _, err := client.Repositories.List(context.WithValue(ctx, github.SleepUntilPrimaryRateLimitResetWhenRateLimited, true), "", nil) ``` From 5868a6619be26b4cff20fdd00152c3197a9396e5 Mon Sep 17 00:00:00 2001 From: Sai Ravi Teja Chintakrindi Date: Sun, 5 May 2024 05:56:00 +0530 Subject: [PATCH 445/751] Add support for check private vulnerability reporting endpoint (#3157) Fixes: #3152. --- github/repos.go | 24 ++++++++++++++++++++++++ github/repos_test.go | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) diff --git a/github/repos.go b/github/repos.go index 6fb0030a3b2..630ce748c94 100644 --- a/github/repos.go +++ b/github/repos.go @@ -2402,3 +2402,27 @@ func (s *RepositoriesService) DisablePrivateReporting(ctx context.Context, owner return resp, nil } + +// checkPrivateReporting represents whether private vulnerability reporting is enabled. +type checkPrivateReporting struct { + Enabled bool `json:"enabled,omitempty"` +} + +// IsPrivateReportingEnabled checks if private vulnerability reporting is enabled +// for the repository and returns a boolean indicating the status. +// +// GitHub API docs: https://docs.github.com/rest/repos/repos#check-if-private-vulnerability-reporting-is-enabled-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/private-vulnerability-reporting +func (s *RepositoriesService) IsPrivateReportingEnabled(ctx context.Context, owner, repo string) (bool, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/private-vulnerability-reporting", owner, repo) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return false, nil, err + } + + privateReporting := new(checkPrivateReporting) + resp, err := s.client.Do(ctx, req, privateReporting) + return privateReporting.Enabled, resp, err +} diff --git a/github/repos_test.go b/github/repos_test.go index 2b742bef904..e07b1b367d5 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -4430,3 +4430,36 @@ func TestRepositoriesService_DisablePrivateReporting(t *testing.T) { return client.Repositories.DisablePrivateReporting(ctx, "owner", "repo") }) } + +func TestRepositoriesService_IsPrivateReportingEnabled(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/owner/repo/private-vulnerability-reporting", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"enabled": true}`) + }) + + ctx := context.Background() + enabled, _, err := client.Repositories.IsPrivateReportingEnabled(ctx, "owner", "repo") + if err != nil { + t.Errorf("Repositories.IsPrivateReportingEnabled returned error: %v", err) + } + if want := true; enabled != want { + t.Errorf("Repositories.IsPrivateReportingEnabled returned %+v, want %+v", enabled, want) + } + + const methodName = "IsPrivateReportingEnabled" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.IsPrivateReportingEnabled(ctx, "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.IsPrivateReportingEnabled(ctx, "owner", "repo") + if got { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want false", methodName, got) + } + return resp, err + }) +} From 807d5cfeffc2d529544167e23cc145e533bade02 Mon Sep 17 00:00:00 2001 From: Diogo Vilela Date: Sun, 5 May 2024 12:50:15 +0100 Subject: [PATCH 446/751] Add support for Dependency Graph Snapshots endpoint (#2856) --- github/dependency_graph_snapshots.go | 113 +++++++++++++ github/dependency_graph_snapshots_test.go | 94 +++++++++++ github/github-accessors.go | 160 ++++++++++++++++++ github/github-accessors_test.go | 191 ++++++++++++++++++++++ 4 files changed, 558 insertions(+) create mode 100644 github/dependency_graph_snapshots.go create mode 100644 github/dependency_graph_snapshots_test.go diff --git a/github/dependency_graph_snapshots.go b/github/dependency_graph_snapshots.go new file mode 100644 index 00000000000..0606b981510 --- /dev/null +++ b/github/dependency_graph_snapshots.go @@ -0,0 +1,113 @@ +// Copyright 2023 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" +) + +// DependencyGraphSnapshotResolvedDependency represents a resolved dependency in a dependency graph snapshot. +// +// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository +type DependencyGraphSnapshotResolvedDependency struct { + PackageURL *string `json:"package_url,omitempty"` + // Represents whether the dependency is requested directly by the manifest or is a dependency of another dependency. + // Can have the following values: + // - "direct": indicates that the dependency is requested directly by the manifest. + // - "indirect": indicates that the dependency is a dependency of another dependency. + Relationship *string `json:"relationship,omitempty"` + // Represents whether the dependency is required for the primary build artifact or is only used for development. + // Can have the following values: + // - "runtime": indicates that the dependency is required for the primary build artifact. + // - "development": indicates that the dependency is only used for development. + Scope *string `json:"scope,omitempty"` + Dependencies []string `json:"dependencies,omitempty"` +} + +// DependencyGraphSnapshotJob represents the job that created the snapshot. +// +// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository +type DependencyGraphSnapshotJob struct { + Correlator *string `json:"correlator,omitempty"` + ID *string `json:"id,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` +} + +// DependencyGraphSnapshotDetector represents a description of the detector used. +// +// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository +type DependencyGraphSnapshotDetector struct { + Name *string `json:"name,omitempty"` + Version *string `json:"version,omitempty"` + URL *string `json:"url,omitempty"` +} + +// DependencyGraphSnapshotManifestFile represents the file declaring the repository's dependencies. +// +// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository +type DependencyGraphSnapshotManifestFile struct { + SourceLocation *string `json:"source_location,omitempty"` +} + +// DependencyGraphSnapshotManifest represents a collection of related dependencies declared in a file or representing a logical group of dependencies. +// +// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository +type DependencyGraphSnapshotManifest struct { + Name *string `json:"name,omitempty"` + File *DependencyGraphSnapshotManifestFile `json:"file,omitempty"` + Resolved map[string]*DependencyGraphSnapshotResolvedDependency `json:"resolved,omitempty"` +} + +// DependencyGraphSnapshot represent a snapshot of a repository's dependencies. +// +// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository +type DependencyGraphSnapshot struct { + Version int `json:"version"` + Sha *string `json:"sha,omitempty"` + Ref *string `json:"ref,omitempty"` + Job *DependencyGraphSnapshotJob `json:"job,omitempty"` + Detector *DependencyGraphSnapshotDetector `json:"detector,omitempty"` + Scanned *Timestamp `json:"scanned,omitempty"` + Manifests map[string]*DependencyGraphSnapshotManifest `json:"manifests,omitempty"` +} + +// DependencyGraphSnapshotCreationData represents the dependency snapshot's creation result. +// +// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository +type DependencyGraphSnapshotCreationData struct { + ID int64 `json:"id"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + Message *string `json:"message,omitempty"` + // Represents the snapshot creation result. + // Can have the following values: + // - "SUCCESS": indicates that the snapshot was successfully created and the repository's dependencies were updated. + // - "ACCEPTED": indicates that the snapshot was successfully created, but the repository's dependencies were not updated. + // - "INVALID": indicates that the snapshot was malformed. + Result *string `json:"result,omitempty"` +} + +// CreateSnapshot creates a new snapshot of a repository's dependencies. +// +// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository +// +//meta:operation POST /repos/{owner}/{repo}/dependency-graph/snapshots +func (s *DependencyGraphService) CreateSnapshot(ctx context.Context, owner, repo string, dependencyGraphSnapshot *DependencyGraphSnapshot) (*DependencyGraphSnapshotCreationData, *Response, error) { + url := fmt.Sprintf("repos/%v/%v/dependency-graph/snapshots", owner, repo) + + req, err := s.client.NewRequest("POST", url, dependencyGraphSnapshot) + if err != nil { + return nil, nil, err + } + + var snapshotCreationData *DependencyGraphSnapshotCreationData + resp, err := s.client.Do(ctx, req, &snapshotCreationData) + if err != nil { + return nil, resp, err + } + + return snapshotCreationData, resp, nil +} diff --git a/github/dependency_graph_snapshots_test.go b/github/dependency_graph_snapshots_test.go new file mode 100644 index 00000000000..ed70ed574d2 --- /dev/null +++ b/github/dependency_graph_snapshots_test.go @@ -0,0 +1,94 @@ +// Copyright 2023 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" + "time" + + "github.com/google/go-cmp/cmp" +) + +func TestDependencyGraphService_CreateSnapshot(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/dependency-graph/snapshots", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + testBody(t, r, `{"version":0,"sha":"ce587453ced02b1526dfb4cb910479d431683101","ref":"refs/heads/main","job":{"correlator":"yourworkflowname_youractionname","id":"yourrunid","html_url":"https://example.com"},"detector":{"name":"octo-detector","version":"0.0.1","url":"https://github.com/octo-org/octo-repo"},"scanned":"2022-06-14T20:25:00Z","manifests":{"package-lock.json":{"name":"package-lock.json","file":{"source_location":"src/package-lock.json"},"resolved":{"@actions/core":{"package_url":"pkg:/npm/%40actions/core@1.1.9","relationship":"direct","scope":"runtime","dependencies":["@actions/http-client"]},"@actions/http-client":{"package_url":"pkg:/npm/%40actions/http-client@1.0.7","relationship":"indirect","scope":"runtime","dependencies":["tunnel"]},"tunnel":{"package_url":"pkg:/npm/tunnel@0.0.6","relationship":"indirect","scope":"runtime"}}}}}`+"\n") + fmt.Fprint(w, `{"id":12345,"created_at":"2022-06-14T20:25:01Z","message":"Dependency results for the repo have been successfully updated.","result":"SUCCESS"}`) + }) + + ctx := context.Background() + snapshot := &DependencyGraphSnapshot{ + Version: 0, + Sha: String("ce587453ced02b1526dfb4cb910479d431683101"), + Ref: String("refs/heads/main"), + Job: &DependencyGraphSnapshotJob{ + Correlator: String("yourworkflowname_youractionname"), + ID: String("yourrunid"), + HTMLURL: String("https://example.com"), + }, + Detector: &DependencyGraphSnapshotDetector{ + Name: String("octo-detector"), + Version: String("0.0.1"), + URL: String("https://github.com/octo-org/octo-repo"), + }, + Scanned: &Timestamp{time.Date(2022, time.June, 14, 20, 25, 00, 0, time.UTC)}, + Manifests: map[string]*DependencyGraphSnapshotManifest{ + "package-lock.json": { + Name: String("package-lock.json"), + File: &DependencyGraphSnapshotManifestFile{SourceLocation: String("src/package-lock.json")}, + Resolved: map[string]*DependencyGraphSnapshotResolvedDependency{ + "@actions/core": { + PackageURL: String("pkg:/npm/%40actions/core@1.1.9"), + Relationship: String("direct"), + Scope: String("runtime"), + Dependencies: []string{"@actions/http-client"}, + }, + "@actions/http-client": { + PackageURL: String("pkg:/npm/%40actions/http-client@1.0.7"), + Relationship: String("indirect"), + Scope: String("runtime"), + Dependencies: []string{"tunnel"}, + }, + "tunnel": { + PackageURL: String("pkg:/npm/tunnel@0.0.6"), + Relationship: String("indirect"), + Scope: String("runtime"), + }, + }, + }, + }, + } + + snapshotCreationData, _, err := client.DependencyGraph.CreateSnapshot(ctx, "o", "r", snapshot) + if err != nil { + t.Errorf("DependencyGraph.CreateSnapshot returned error: %v", err) + } + + want := &DependencyGraphSnapshotCreationData{ + ID: 12345, + CreatedAt: &Timestamp{time.Date(2022, time.June, 14, 20, 25, 01, 0, time.UTC)}, + Message: String("Dependency results for the repo have been successfully updated."), + Result: String("SUCCESS"), + } + if !cmp.Equal(snapshotCreationData, want) { + t.Errorf("DependencyGraph.CreateSnapshot returned %+v, want %+v", snapshotCreationData, want) + } + + const methodName = "CreateSnapshot" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.DependencyGraph.CreateSnapshot(ctx, "o", "r", snapshot) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} diff --git a/github/github-accessors.go b/github/github-accessors.go index a0ecef5ddaa..3ba66c80d47 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -5206,6 +5206,166 @@ func (d *Dependency) GetScope() string { return *d.Scope } +// GetDetector returns the Detector field. +func (d *DependencyGraphSnapshot) GetDetector() *DependencyGraphSnapshotDetector { + if d == nil { + return nil + } + return d.Detector +} + +// GetJob returns the Job field. +func (d *DependencyGraphSnapshot) GetJob() *DependencyGraphSnapshotJob { + if d == nil { + return nil + } + return d.Job +} + +// GetRef returns the Ref field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshot) GetRef() string { + if d == nil || d.Ref == nil { + return "" + } + return *d.Ref +} + +// GetScanned returns the Scanned field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshot) GetScanned() Timestamp { + if d == nil || d.Scanned == nil { + return Timestamp{} + } + return *d.Scanned +} + +// GetSha returns the Sha field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshot) GetSha() string { + if d == nil || d.Sha == nil { + return "" + } + return *d.Sha +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotCreationData) GetCreatedAt() Timestamp { + if d == nil || d.CreatedAt == nil { + return Timestamp{} + } + return *d.CreatedAt +} + +// GetMessage returns the Message field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotCreationData) GetMessage() string { + if d == nil || d.Message == nil { + return "" + } + return *d.Message +} + +// GetResult returns the Result field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotCreationData) GetResult() string { + if d == nil || d.Result == nil { + return "" + } + return *d.Result +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotDetector) GetName() string { + if d == nil || d.Name == nil { + return "" + } + return *d.Name +} + +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotDetector) GetURL() string { + if d == nil || d.URL == nil { + return "" + } + return *d.URL +} + +// GetVersion returns the Version field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotDetector) GetVersion() string { + if d == nil || d.Version == nil { + return "" + } + return *d.Version +} + +// GetCorrelator returns the Correlator field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotJob) GetCorrelator() string { + if d == nil || d.Correlator == nil { + return "" + } + return *d.Correlator +} + +// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotJob) GetHTMLURL() string { + if d == nil || d.HTMLURL == nil { + return "" + } + return *d.HTMLURL +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotJob) GetID() string { + if d == nil || d.ID == nil { + return "" + } + return *d.ID +} + +// GetFile returns the File field. +func (d *DependencyGraphSnapshotManifest) GetFile() *DependencyGraphSnapshotManifestFile { + if d == nil { + return nil + } + return d.File +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotManifest) GetName() string { + if d == nil || d.Name == nil { + return "" + } + return *d.Name +} + +// GetSourceLocation returns the SourceLocation field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotManifestFile) GetSourceLocation() string { + if d == nil || d.SourceLocation == nil { + return "" + } + return *d.SourceLocation +} + +// GetPackageURL returns the PackageURL field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotResolvedDependency) GetPackageURL() string { + if d == nil || d.PackageURL == nil { + return "" + } + return *d.PackageURL +} + +// GetRelationship returns the Relationship field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotResolvedDependency) GetRelationship() string { + if d == nil || d.Relationship == nil { + return "" + } + return *d.Relationship +} + +// GetScope returns the Scope field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotResolvedDependency) GetScope() string { + if d == nil || d.Scope == nil { + return "" + } + return *d.Scope +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (d *DeployKeyEvent) GetAction() string { if d == nil || d.Action == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 4cc49f7d7ab..5b0e1de66dc 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -6112,6 +6112,197 @@ func TestDependency_GetScope(tt *testing.T) { d.GetScope() } +func TestDependencyGraphSnapshot_GetDetector(tt *testing.T) { + d := &DependencyGraphSnapshot{} + d.GetDetector() + d = nil + d.GetDetector() +} + +func TestDependencyGraphSnapshot_GetJob(tt *testing.T) { + d := &DependencyGraphSnapshot{} + d.GetJob() + d = nil + d.GetJob() +} + +func TestDependencyGraphSnapshot_GetRef(tt *testing.T) { + var zeroValue string + d := &DependencyGraphSnapshot{Ref: &zeroValue} + d.GetRef() + d = &DependencyGraphSnapshot{} + d.GetRef() + d = nil + d.GetRef() +} + +func TestDependencyGraphSnapshot_GetScanned(tt *testing.T) { + var zeroValue Timestamp + d := &DependencyGraphSnapshot{Scanned: &zeroValue} + d.GetScanned() + d = &DependencyGraphSnapshot{} + d.GetScanned() + d = nil + d.GetScanned() +} + +func TestDependencyGraphSnapshot_GetSha(tt *testing.T) { + var zeroValue string + d := &DependencyGraphSnapshot{Sha: &zeroValue} + d.GetSha() + d = &DependencyGraphSnapshot{} + d.GetSha() + d = nil + d.GetSha() +} + +func TestDependencyGraphSnapshotCreationData_GetCreatedAt(tt *testing.T) { + var zeroValue Timestamp + d := &DependencyGraphSnapshotCreationData{CreatedAt: &zeroValue} + d.GetCreatedAt() + d = &DependencyGraphSnapshotCreationData{} + d.GetCreatedAt() + d = nil + d.GetCreatedAt() +} + +func TestDependencyGraphSnapshotCreationData_GetMessage(tt *testing.T) { + var zeroValue string + d := &DependencyGraphSnapshotCreationData{Message: &zeroValue} + d.GetMessage() + d = &DependencyGraphSnapshotCreationData{} + d.GetMessage() + d = nil + d.GetMessage() +} + +func TestDependencyGraphSnapshotCreationData_GetResult(tt *testing.T) { + var zeroValue string + d := &DependencyGraphSnapshotCreationData{Result: &zeroValue} + d.GetResult() + d = &DependencyGraphSnapshotCreationData{} + d.GetResult() + d = nil + d.GetResult() +} + +func TestDependencyGraphSnapshotDetector_GetName(tt *testing.T) { + var zeroValue string + d := &DependencyGraphSnapshotDetector{Name: &zeroValue} + d.GetName() + d = &DependencyGraphSnapshotDetector{} + d.GetName() + d = nil + d.GetName() +} + +func TestDependencyGraphSnapshotDetector_GetURL(tt *testing.T) { + var zeroValue string + d := &DependencyGraphSnapshotDetector{URL: &zeroValue} + d.GetURL() + d = &DependencyGraphSnapshotDetector{} + d.GetURL() + d = nil + d.GetURL() +} + +func TestDependencyGraphSnapshotDetector_GetVersion(tt *testing.T) { + var zeroValue string + d := &DependencyGraphSnapshotDetector{Version: &zeroValue} + d.GetVersion() + d = &DependencyGraphSnapshotDetector{} + d.GetVersion() + d = nil + d.GetVersion() +} + +func TestDependencyGraphSnapshotJob_GetCorrelator(tt *testing.T) { + var zeroValue string + d := &DependencyGraphSnapshotJob{Correlator: &zeroValue} + d.GetCorrelator() + d = &DependencyGraphSnapshotJob{} + d.GetCorrelator() + d = nil + d.GetCorrelator() +} + +func TestDependencyGraphSnapshotJob_GetHTMLURL(tt *testing.T) { + var zeroValue string + d := &DependencyGraphSnapshotJob{HTMLURL: &zeroValue} + d.GetHTMLURL() + d = &DependencyGraphSnapshotJob{} + d.GetHTMLURL() + d = nil + d.GetHTMLURL() +} + +func TestDependencyGraphSnapshotJob_GetID(tt *testing.T) { + var zeroValue string + d := &DependencyGraphSnapshotJob{ID: &zeroValue} + d.GetID() + d = &DependencyGraphSnapshotJob{} + d.GetID() + d = nil + d.GetID() +} + +func TestDependencyGraphSnapshotManifest_GetFile(tt *testing.T) { + d := &DependencyGraphSnapshotManifest{} + d.GetFile() + d = nil + d.GetFile() +} + +func TestDependencyGraphSnapshotManifest_GetName(tt *testing.T) { + var zeroValue string + d := &DependencyGraphSnapshotManifest{Name: &zeroValue} + d.GetName() + d = &DependencyGraphSnapshotManifest{} + d.GetName() + d = nil + d.GetName() +} + +func TestDependencyGraphSnapshotManifestFile_GetSourceLocation(tt *testing.T) { + var zeroValue string + d := &DependencyGraphSnapshotManifestFile{SourceLocation: &zeroValue} + d.GetSourceLocation() + d = &DependencyGraphSnapshotManifestFile{} + d.GetSourceLocation() + d = nil + d.GetSourceLocation() +} + +func TestDependencyGraphSnapshotResolvedDependency_GetPackageURL(tt *testing.T) { + var zeroValue string + d := &DependencyGraphSnapshotResolvedDependency{PackageURL: &zeroValue} + d.GetPackageURL() + d = &DependencyGraphSnapshotResolvedDependency{} + d.GetPackageURL() + d = nil + d.GetPackageURL() +} + +func TestDependencyGraphSnapshotResolvedDependency_GetRelationship(tt *testing.T) { + var zeroValue string + d := &DependencyGraphSnapshotResolvedDependency{Relationship: &zeroValue} + d.GetRelationship() + d = &DependencyGraphSnapshotResolvedDependency{} + d.GetRelationship() + d = nil + d.GetRelationship() +} + +func TestDependencyGraphSnapshotResolvedDependency_GetScope(tt *testing.T) { + var zeroValue string + d := &DependencyGraphSnapshotResolvedDependency{Scope: &zeroValue} + d.GetScope() + d = &DependencyGraphSnapshotResolvedDependency{} + d.GetScope() + d = nil + d.GetScope() +} + func TestDeployKeyEvent_GetAction(tt *testing.T) { var zeroValue string d := &DeployKeyEvent{Action: &zeroValue} From 85edd7c4a10eba891da512768b7656af1d10135b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 May 2024 14:26:12 -0400 Subject: [PATCH 447/751] Bump codecov/codecov-action from 4.3.0 to 4.3.1 (#3162) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index efac3df3d90..66ebb06f4de 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -73,4 +73,4 @@ jobs: - name: Upload coverage to Codecov if: ${{ matrix.update-coverage }} - uses: codecov/codecov-action@84508663e988701840491b86de86b666e8a86bed #v4.3.0 + uses: codecov/codecov-action@5ecb98a3c6b747ed38dc09f787459979aebb39be #v4.3.1 From 6cf2ff676477b64e8b58c8eed87cca75fd24e9a3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 May 2024 14:32:15 -0400 Subject: [PATCH 448/751] Bump golang.org/x/net from 0.24.0 to 0.25.0 in /scrape (#3161) --- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index d3e23404724..b96c6952d64 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -9,7 +9,7 @@ require ( github.com/google/go-cmp v0.6.0 github.com/google/go-github/v61 v61.0.0 github.com/xlzd/gotp v0.1.0 - golang.org/x/net v0.24.0 + golang.org/x/net v0.25.0 ) require ( diff --git a/scrape/go.sum b/scrape/go.sum index 8c603f69ac6..1365f91a9f4 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -21,8 +21,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= -golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= -golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= From 654769fdb2e2effbbe1f7db5ed0fa79cc938d107 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 May 2024 14:34:33 -0400 Subject: [PATCH 449/751] Bump github.com/PuerkitoBio/goquery from 1.9.1 to 1.9.2 in /scrape (#3160) --- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index b96c6952d64..e940f8ea932 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -5,7 +5,7 @@ go 1.21 toolchain go1.22.0 require ( - github.com/PuerkitoBio/goquery v1.9.1 + github.com/PuerkitoBio/goquery v1.9.2 github.com/google/go-cmp v0.6.0 github.com/google/go-github/v61 v61.0.0 github.com/xlzd/gotp v0.1.0 diff --git a/scrape/go.sum b/scrape/go.sum index 1365f91a9f4..316fda4c28e 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -1,5 +1,5 @@ -github.com/PuerkitoBio/goquery v1.9.1 h1:mTL6XjbJTZdpfL+Gwl5U2h1l9yEkJjhmlTeV9VPW7UI= -github.com/PuerkitoBio/goquery v1.9.1/go.mod h1:cW1n6TmIMDoORQU5IU/P1T3tGFunOeXEpGP2WHRwkbY= +github.com/PuerkitoBio/goquery v1.9.2 h1:4/wZksC3KgkQw7SQgkKotmKljk0M6V8TUvA8Wb4yPeE= +github.com/PuerkitoBio/goquery v1.9.2/go.mod h1:GHPCaP0ODyyxqcNoFGYlAprUFH81NuRPd0GX3Zu2Mvk= github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsViSLyss= github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= From 5c79fa2c0154ff24608c8ece4edc6593c686d403 Mon Sep 17 00:00:00 2001 From: JoannaaKL Date: Tue, 7 May 2024 20:40:23 +0200 Subject: [PATCH 450/751] Add Action to DeploymentStatusEvent (#3163) --- github/event_types.go | 1 + github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ 3 files changed, 19 insertions(+) diff --git a/github/event_types.go b/github/event_types.go index 703af1f2f2b..e5ae33a5fa0 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -232,6 +232,7 @@ type DeploymentProtectionRuleEvent struct { // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#deployment_status type DeploymentStatusEvent struct { + Action *string `json:"action,omitempty"` Deployment *Deployment `json:"deployment,omitempty"` DeploymentStatus *DeploymentStatus `json:"deployment_status,omitempty"` Repo *Repository `json:"repository,omitempty"` diff --git a/github/github-accessors.go b/github/github-accessors.go index 3ba66c80d47..fd2fe22591d 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -5878,6 +5878,14 @@ func (d *DeploymentStatus) GetURL() string { return *d.URL } +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (d *DeploymentStatusEvent) GetAction() string { + if d == nil || d.Action == nil { + return "" + } + return *d.Action +} + // GetDeployment returns the Deployment field. func (d *DeploymentStatusEvent) GetDeployment() *Deployment { if d == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 5b0e1de66dc..294822bf3aa 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -6886,6 +6886,16 @@ func TestDeploymentStatus_GetURL(tt *testing.T) { d.GetURL() } +func TestDeploymentStatusEvent_GetAction(tt *testing.T) { + var zeroValue string + d := &DeploymentStatusEvent{Action: &zeroValue} + d.GetAction() + d = &DeploymentStatusEvent{} + d.GetAction() + d = nil + d.GetAction() +} + func TestDeploymentStatusEvent_GetDeployment(tt *testing.T) { d := &DeploymentStatusEvent{} d.GetDeployment() From 81ff3c9e8b0cfcb14e87142d4b6d6b69078238eb Mon Sep 17 00:00:00 2001 From: tomfeigin Date: Tue, 7 May 2024 21:44:50 +0300 Subject: [PATCH 451/751] Query identities associated with organization roles (#3130) --- github/orgs_custom_roles.go | 54 ++++++++++++++++++++++++ github/orgs_custom_roles_test.go | 70 ++++++++++++++++++++++++++++++++ 2 files changed, 124 insertions(+) diff --git a/github/orgs_custom_roles.go b/github/orgs_custom_roles.go index 45de896a2f9..e1deeb73ed4 100644 --- a/github/orgs_custom_roles.go +++ b/github/orgs_custom_roles.go @@ -126,3 +126,57 @@ func (s *OrganizationsService) DeleteCustomRepoRole(ctx context.Context, org, ro return resp, nil } + +// ListTeamsAssignedToOrgRole returns all teams assigned to a specific organization role. +// In order to list teams assigned to an organization role, the authenticated user must be an organization owner. +// +// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#list-teams-that-are-assigned-to-an-organization-role +// +//meta:operation GET /orgs/{org}/organization-roles/{role_id}/teams +func (s *OrganizationsService) ListTeamsAssignedToOrgRole(ctx context.Context, org string, roleID int64, opts *ListOptions) ([]*Team, *Response, error) { + u := fmt.Sprintf("orgs/%v/organization-roles/%v/teams", org, roleID) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var teams []*Team + resp, err := s.client.Do(ctx, req, &teams) + if err != nil { + return nil, resp, err + } + + return teams, resp, nil +} + +// ListUsersAssignedToOrgRole returns all users assigned to a specific organization role. +// In order to list users assigned to an organization role, the authenticated user must be an organization owner. +// +// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#list-users-that-are-assigned-to-an-organization-role +// +//meta:operation GET /orgs/{org}/organization-roles/{role_id}/users +func (s *OrganizationsService) ListUsersAssignedToOrgRole(ctx context.Context, org string, roleID int64, opts *ListOptions) ([]*User, *Response, error) { + u := fmt.Sprintf("orgs/%v/organization-roles/%v/users", org, roleID) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var users []*User + resp, err := s.client.Do(ctx, req, &users) + if err != nil { + return nil, resp, err + } + + return users, resp, nil +} diff --git a/github/orgs_custom_roles_test.go b/github/orgs_custom_roles_test.go index 08810909a06..25e5011fcb9 100644 --- a/github/orgs_custom_roles_test.go +++ b/github/orgs_custom_roles_test.go @@ -159,3 +159,73 @@ func TestOrganizationsService_DeleteCustomRepoRole(t *testing.T) { return err }) } + +func TestOrganizationsService_ListTeamsAssignedToOrgRole(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/organization-roles/1729/teams", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `[{"id":1}]`) + }) + opt := &ListOptions{Page: 2} + ctx := context.Background() + apps, _, err := client.Organizations.ListTeamsAssignedToOrgRole(ctx, "o", 1729, opt) + if err != nil { + t.Errorf("Organizations.ListTeamsAssignedToOrgRole returned error: %v", err) + } + + want := []*Team{{ID: Int64(1)}} + if !cmp.Equal(apps, want) { + t.Errorf("Organizations.ListTeamsAssignedToOrgRole returned %+v, want %+v", apps, want) + } + + const methodName = "ListTeamsAssignedToOrgRole" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.ListTeamsAssignedToOrgRole(ctx, "\no", 1729, opt) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.ListTeamsAssignedToOrgRole(ctx, "o", 1729, opt) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_ListUsersAssignedToOrgRole(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/organization-roles/1729/users", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `[{"id":1}]`) + }) + opt := &ListOptions{Page: 2} + ctx := context.Background() + apps, _, err := client.Organizations.ListUsersAssignedToOrgRole(ctx, "o", 1729, opt) + if err != nil { + t.Errorf("Organizations.ListUsersAssignedToOrgRole returned error: %v", err) + } + + want := []*User{{ID: Int64(1)}} + if !cmp.Equal(apps, want) { + t.Errorf("Organizations.ListUsersAssignedToOrgRole returned %+v, want %+v", apps, want) + } + + const methodName = "ListUsersAssignedToOrgRole" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.ListUsersAssignedToOrgRole(ctx, "\no", 1729, opt) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.ListUsersAssignedToOrgRole(ctx, "o", 1729, opt) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} From 87c3716824f717fcbb1be8d574c08f95cada0e68 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Fri, 10 May 2024 20:01:25 -0400 Subject: [PATCH 452/751] Bump version of go-github to v62.0.0 (#3165) --- README.md | 15 ++++++++------- example/actionpermissions/main.go | 2 +- example/appengine/app.go | 2 +- example/basicauth/main.go | 2 +- .../codespaces/newreposecretwithxcrypto/main.go | 2 +- .../codespaces/newusersecretwithxcrypto/main.go | 2 +- example/commitpr/main.go | 2 +- example/go.mod | 6 +++--- example/listenvironments/main.go | 2 +- example/migrations/main.go | 2 +- example/newfilewithappauth/main.go | 2 +- example/newrepo/main.go | 2 +- example/newreposecretwithlibsodium/go.mod | 4 ++-- example/newreposecretwithlibsodium/main.go | 2 +- example/newreposecretwithxcrypto/main.go | 2 +- example/ratelimit/main.go | 2 +- example/simple/main.go | 2 +- example/tagprotection/main.go | 2 +- example/tokenauth/main.go | 2 +- example/topics/main.go | 2 +- github/doc.go | 2 +- github/examples_test.go | 2 +- github/github.go | 2 +- go.mod | 2 +- test/fields/fields.go | 2 +- test/integration/activity_test.go | 2 +- test/integration/authorizations_test.go | 2 +- test/integration/github_test.go | 2 +- test/integration/repos_test.go | 2 +- test/integration/users_test.go | 2 +- tools/go.mod | 4 ++-- tools/metadata/main.go | 2 +- tools/metadata/main_test.go | 2 +- tools/metadata/metadata.go | 2 +- tools/metadata/openapi.go | 2 +- 35 files changed, 46 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index d1cd2df1d0e..42e1681e113 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-github # [![go-github release (latest SemVer)](https://img.shields.io/github/v/release/google/go-github?sort=semver)](https://github.com/google/go-github/releases) -[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v61/github) +[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v62/github) [![Test Status](https://github.com/google/go-github/workflows/tests/badge.svg)](https://github.com/google/go-github/actions?query=workflow%3Atests) [![Test Coverage](https://codecov.io/gh/google/go-github/branch/master/graph/badge.svg)](https://codecov.io/gh/google/go-github) [![Discuss at go-github@googlegroups.com](https://img.shields.io/badge/discuss-go--github%40googlegroups.com-blue.svg)](https://groups.google.com/group/go-github) @@ -24,7 +24,7 @@ If you're interested in using the [GraphQL API v4][], the recommended library is go-github is compatible with modern Go releases in module mode, with Go installed: ```bash -go get github.com/google/go-github/v61 +go get github.com/google/go-github/v62 ``` will resolve and add the package to the current development module, along with its dependencies. @@ -32,7 +32,7 @@ will resolve and add the package to the current development module, along with i Alternatively the same can be achieved if you use import in a package: ```go -import "github.com/google/go-github/v61/github" +import "github.com/google/go-github/v62/github" ``` and run `go get` without parameters. @@ -40,13 +40,13 @@ and run `go get` without parameters. Finally, to use the top-of-trunk version of this repo, use the following command: ```bash -go get github.com/google/go-github/v61@master +go get github.com/google/go-github/v62@master ``` ## Usage ## ```go -import "github.com/google/go-github/v61/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) +import "github.com/google/go-github/v62/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled ``` @@ -117,7 +117,7 @@ import ( "net/http" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v61/github" + "github.com/google/go-github/v62/github" ) func main() { @@ -302,7 +302,7 @@ For complete usage of go-github, see the full [package docs][]. [GitHub API v3]: https://docs.github.com/en/rest [personal access token]: https://github.com/blog/1509-personal-api-tokens -[package docs]: https://pkg.go.dev/github.com/google/go-github/v61/github +[package docs]: https://pkg.go.dev/github.com/google/go-github/v62/github [GraphQL API v4]: https://developer.github.com/v4/ [shurcooL/githubv4]: https://github.com/shurcooL/githubv4 [GitHub webhook events]: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads @@ -375,6 +375,7 @@ Versions prior to 48.2.0 are not listed. | go-github Version | GitHub v3 API Version | | ----------------- | --------------------- | +| 62.0.0 | 2022-11-28 | | 61.0.0 | 2022-11-28 | | 60.0.0 | 2022-11-28 | | 59.0.0 | 2022-11-28 | diff --git a/example/actionpermissions/main.go b/example/actionpermissions/main.go index 8453cf14827..c8b42e8fc89 100644 --- a/example/actionpermissions/main.go +++ b/example/actionpermissions/main.go @@ -14,7 +14,7 @@ import ( "log" "os" - "github.com/google/go-github/v61/github" + "github.com/google/go-github/v62/github" ) var ( diff --git a/example/appengine/app.go b/example/appengine/app.go index 1aa425d02f9..ff400268f3c 100644 --- a/example/appengine/app.go +++ b/example/appengine/app.go @@ -12,7 +12,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v61/github" + "github.com/google/go-github/v62/github" "google.golang.org/appengine" "google.golang.org/appengine/log" ) diff --git a/example/basicauth/main.go b/example/basicauth/main.go index d7a74701e23..597b5b7e29d 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -21,7 +21,7 @@ import ( "os" "strings" - "github.com/google/go-github/v61/github" + "github.com/google/go-github/v62/github" "golang.org/x/term" ) diff --git a/example/codespaces/newreposecretwithxcrypto/main.go b/example/codespaces/newreposecretwithxcrypto/main.go index a2ac7e45106..aaada76a69e 100644 --- a/example/codespaces/newreposecretwithxcrypto/main.go +++ b/example/codespaces/newreposecretwithxcrypto/main.go @@ -36,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v61/github" + "github.com/google/go-github/v62/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/codespaces/newusersecretwithxcrypto/main.go b/example/codespaces/newusersecretwithxcrypto/main.go index ca6ac396459..dbbca4b3e21 100644 --- a/example/codespaces/newusersecretwithxcrypto/main.go +++ b/example/codespaces/newusersecretwithxcrypto/main.go @@ -37,7 +37,7 @@ import ( "log" "os" - "github.com/google/go-github/v61/github" + "github.com/google/go-github/v62/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index 021024b10d1..36d71c49fd6 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -33,7 +33,7 @@ import ( "time" "github.com/ProtonMail/go-crypto/openpgp" - "github.com/google/go-github/v61/github" + "github.com/google/go-github/v62/github" ) var ( diff --git a/example/go.mod b/example/go.mod index 0213a527e0c..4b6cdb2afe8 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v61/example +module github.com/google/go-github/v62/example go 1.21 @@ -6,7 +6,7 @@ require ( github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-ratelimit v1.0.3 - github.com/google/go-github/v61 v61.0.0 + github.com/google/go-github/v62 v62.0.0 golang.org/x/crypto v0.21.0 golang.org/x/term v0.18.0 google.golang.org/appengine v1.6.7 @@ -24,4 +24,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v61 => ../ +replace github.com/google/go-github/v62 => ../ diff --git a/example/listenvironments/main.go b/example/listenvironments/main.go index 14d10949704..e640dec32a7 100644 --- a/example/listenvironments/main.go +++ b/example/listenvironments/main.go @@ -18,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v61/github" + "github.com/google/go-github/v62/github" ) func main() { diff --git a/example/migrations/main.go b/example/migrations/main.go index 7771cbe9527..7537e77a49e 100644 --- a/example/migrations/main.go +++ b/example/migrations/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v61/github" + "github.com/google/go-github/v62/github" ) func fetchAllUserMigrations() ([]*github.UserMigration, error) { diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index 18ecd7eb485..d4a7bc2dda2 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -16,7 +16,7 @@ import ( "time" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v61/github" + "github.com/google/go-github/v62/github" ) func main() { diff --git a/example/newrepo/main.go b/example/newrepo/main.go index 1326a2d9ce9..bbcfddb553a 100644 --- a/example/newrepo/main.go +++ b/example/newrepo/main.go @@ -16,7 +16,7 @@ import ( "log" "os" - "github.com/google/go-github/v61/github" + "github.com/google/go-github/v62/github" ) var ( diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index 84930ca7a94..d5eea34c2a6 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -6,10 +6,10 @@ toolchain go1.22.0 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb - github.com/google/go-github/v61 v61.0.0 + github.com/google/go-github/v62 v62.0.0 ) require github.com/google/go-querystring v1.1.0 // indirect // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v61 => ../.. +replace github.com/google/go-github/v62 => ../.. diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index a61ff06ed7d..1508d6756ff 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -36,7 +36,7 @@ import ( "os" sodium "github.com/GoKillers/libsodium-go/cryptobox" - "github.com/google/go-github/v61/github" + "github.com/google/go-github/v62/github" ) var ( diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index 9bf8845e531..8cdffa2b5d2 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -36,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v61/github" + "github.com/google/go-github/v62/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/ratelimit/main.go b/example/ratelimit/main.go index 276301c1c2c..7bf7c7142bc 100644 --- a/example/ratelimit/main.go +++ b/example/ratelimit/main.go @@ -13,7 +13,7 @@ import ( "fmt" "github.com/gofri/go-github-ratelimit/github_ratelimit" - "github.com/google/go-github/v61/github" + "github.com/google/go-github/v62/github" ) func main() { diff --git a/example/simple/main.go b/example/simple/main.go index 5512c6cb5df..8390377dc6c 100644 --- a/example/simple/main.go +++ b/example/simple/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v61/github" + "github.com/google/go-github/v62/github" ) // Fetch all the public organizations' membership of a user. diff --git a/example/tagprotection/main.go b/example/tagprotection/main.go index f9bedf1f335..994d53d0a09 100644 --- a/example/tagprotection/main.go +++ b/example/tagprotection/main.go @@ -18,7 +18,7 @@ import ( "os" "strings" - "github.com/google/go-github/v61/github" + "github.com/google/go-github/v62/github" "golang.org/x/term" ) diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index 0cf12a8b01d..557eb0fa4d2 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -15,7 +15,7 @@ import ( "log" "os" - "github.com/google/go-github/v61/github" + "github.com/google/go-github/v62/github" "golang.org/x/term" ) diff --git a/example/topics/main.go b/example/topics/main.go index b6e76bfd7e9..6312588b5de 100644 --- a/example/topics/main.go +++ b/example/topics/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v61/github" + "github.com/google/go-github/v62/github" ) // Fetch and lists all the public topics associated with the specified GitHub topic diff --git a/github/doc.go b/github/doc.go index 6c4b3a81a91..e0c810871f2 100644 --- a/github/doc.go +++ b/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v61/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v62/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to diff --git a/github/examples_test.go b/github/examples_test.go index 4dbd17e1ba8..4abc289359e 100644 --- a/github/examples_test.go +++ b/github/examples_test.go @@ -12,7 +12,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v61/github" + "github.com/google/go-github/v62/github" ) func ExampleMarkdownService_Render() { diff --git a/github/github.go b/github/github.go index ad4269595bf..28a3c10bb28 100644 --- a/github/github.go +++ b/github/github.go @@ -28,7 +28,7 @@ import ( ) const ( - Version = "v61.0.0" + Version = "v62.0.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" diff --git a/go.mod b/go.mod index a2a7aeed191..8218224b110 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v61 +module github.com/google/go-github/v62 require ( github.com/google/go-cmp v0.6.0 diff --git a/test/fields/fields.go b/test/fields/fields.go index 0629dd33e6a..9cdfd8d1f50 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -25,7 +25,7 @@ import ( "reflect" "strings" - "github.com/google/go-github/v61/github" + "github.com/google/go-github/v62/github" ) var ( diff --git a/test/integration/activity_test.go b/test/integration/activity_test.go index 6a70c42b05a..2b9cc9e6302 100644 --- a/test/integration/activity_test.go +++ b/test/integration/activity_test.go @@ -12,7 +12,7 @@ import ( "context" "testing" - "github.com/google/go-github/v61/github" + "github.com/google/go-github/v62/github" ) const ( diff --git a/test/integration/authorizations_test.go b/test/integration/authorizations_test.go index d5cfb6f51e0..2ea5a6edbcd 100644 --- a/test/integration/authorizations_test.go +++ b/test/integration/authorizations_test.go @@ -15,7 +15,7 @@ import ( "testing" "time" - "github.com/google/go-github/v61/github" + "github.com/google/go-github/v62/github" ) const msgEnvMissing = "Skipping test because the required environment variable (%v) is not present." diff --git a/test/integration/github_test.go b/test/integration/github_test.go index fb581679e2c..228d3c7b5a2 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -15,7 +15,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v61/github" + "github.com/google/go-github/v62/github" ) var ( diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index 5737950c664..f4837877f5b 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -15,7 +15,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v61/github" + "github.com/google/go-github/v62/github" ) func TestRepositories_CRUD(t *testing.T) { diff --git a/test/integration/users_test.go b/test/integration/users_test.go index 5f40622b22b..6264ca9945d 100644 --- a/test/integration/users_test.go +++ b/test/integration/users_test.go @@ -14,7 +14,7 @@ import ( "math/rand" "testing" - "github.com/google/go-github/v61/github" + "github.com/google/go-github/v62/github" ) func TestUsers_Get(t *testing.T) { diff --git a/tools/go.mod b/tools/go.mod index 07515cb5ff0..26e9fe45a68 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -8,7 +8,7 @@ require ( github.com/alecthomas/kong v0.9.0 github.com/getkin/kin-openapi v0.124.0 github.com/google/go-cmp v0.6.0 - github.com/google/go-github/v61 v61.0.0 + github.com/google/go-github/v62 v62.0.0 golang.org/x/sync v0.7.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -25,4 +25,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v61 => ../ +replace github.com/google/go-github/v62 => ../ diff --git a/tools/metadata/main.go b/tools/metadata/main.go index f846d1cad8c..153e5b76a3e 100644 --- a/tools/metadata/main.go +++ b/tools/metadata/main.go @@ -15,7 +15,7 @@ import ( "path/filepath" "github.com/alecthomas/kong" - "github.com/google/go-github/v61/github" + "github.com/google/go-github/v62/github" ) var helpVars = kong.Vars{ diff --git a/tools/metadata/main_test.go b/tools/metadata/main_test.go index 059c2b72b54..6d1013ae4cf 100644 --- a/tools/metadata/main_test.go +++ b/tools/metadata/main_test.go @@ -23,7 +23,7 @@ import ( "github.com/alecthomas/kong" "github.com/getkin/kin-openapi/openapi3" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v61/github" + "github.com/google/go-github/v62/github" ) func TestUpdateGo(t *testing.T) { diff --git a/tools/metadata/metadata.go b/tools/metadata/metadata.go index 2becaaabe73..b37784dad94 100644 --- a/tools/metadata/metadata.go +++ b/tools/metadata/metadata.go @@ -24,7 +24,7 @@ import ( "strings" "sync" - "github.com/google/go-github/v61/github" + "github.com/google/go-github/v62/github" "gopkg.in/yaml.v3" ) diff --git a/tools/metadata/openapi.go b/tools/metadata/openapi.go index 07ac9fd033b..d3cdbf0522c 100644 --- a/tools/metadata/openapi.go +++ b/tools/metadata/openapi.go @@ -14,7 +14,7 @@ import ( "strconv" "github.com/getkin/kin-openapi/openapi3" - "github.com/google/go-github/v61/github" + "github.com/google/go-github/v62/github" "golang.org/x/sync/errgroup" ) From 51bedebff81b00a204050e6b50399f673f719b94 Mon Sep 17 00:00:00 2001 From: Liam Stanley Date: Fri, 10 May 2024 20:38:28 -0400 Subject: [PATCH 453/751] feat: Add missing values_editable_by field for organization custom properties (#3164) --- github/github-accessors.go | 8 +++++ github/github-accessors_test.go | 10 ++++++ github/orgs_properties.go | 17 ++++++--- github/orgs_properties_test.go | 61 ++++++++++++++++++--------------- 4 files changed, 64 insertions(+), 32 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index fd2fe22591d..1580ab4ba5e 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -4718,6 +4718,14 @@ func (c *CustomProperty) GetRequired() bool { return *c.Required } +// GetValuesEditableBy returns the ValuesEditableBy field if it's non-nil, zero value otherwise. +func (c *CustomProperty) GetValuesEditableBy() string { + if c == nil || c.ValuesEditableBy == nil { + return "" + } + return *c.ValuesEditableBy +} + // GetValue returns the Value field if it's non-nil, zero value otherwise. func (c *CustomPropertyValue) GetValue() string { if c == nil || c.Value == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 294822bf3aa..08f0e825583 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -5553,6 +5553,16 @@ func TestCustomProperty_GetRequired(tt *testing.T) { c.GetRequired() } +func TestCustomProperty_GetValuesEditableBy(tt *testing.T) { + var zeroValue string + c := &CustomProperty{ValuesEditableBy: &zeroValue} + c.GetValuesEditableBy() + c = &CustomProperty{} + c.GetValuesEditableBy() + c = nil + c.GetValuesEditableBy() +} + func TestCustomPropertyValue_GetValue(tt *testing.T) { var zeroValue string c := &CustomPropertyValue{Value: &zeroValue} diff --git a/github/orgs_properties.go b/github/orgs_properties.go index 2e88b7f4f98..124b89cb5db 100644 --- a/github/orgs_properties.go +++ b/github/orgs_properties.go @@ -15,12 +15,19 @@ type CustomProperty struct { // PropertyName is required for most endpoints except when calling CreateOrUpdateCustomProperty; // where this is sent in the path and thus can be omitted. PropertyName *string `json:"property_name,omitempty"` - // Possible values for ValueType are: string, single_select - ValueType string `json:"value_type"` - Required *bool `json:"required,omitempty"` - DefaultValue *string `json:"default_value,omitempty"` - Description *string `json:"description,omitempty"` + // The type of the value for the property. Can be one of: string, single_select. + ValueType string `json:"value_type"` + // Whether the property is required. + Required *bool `json:"required,omitempty"` + // Default value of the property. + DefaultValue *string `json:"default_value,omitempty"` + // Short description of the property. + Description *string `json:"description,omitempty"` + // An ordered list of the allowed values of the property. The property can have up to 200 + // allowed values. AllowedValues []string `json:"allowed_values,omitempty"` + // Who can edit the values of the property. Can be one of: org_actors, org_and_repo_actors, nil (null). + ValuesEditableBy *string `json:"values_editable_by,omitempty"` } // RepoCustomPropertyValue represents a repository custom property value. diff --git a/github/orgs_properties_test.go b/github/orgs_properties_test.go index 86daedb3a5b..59866fd98a7 100644 --- a/github/orgs_properties_test.go +++ b/github/orgs_properties_test.go @@ -30,7 +30,8 @@ func TestOrganizationsService_GetAllCustomProperties(t *testing.T) { "allowed_values":[ "production", "development" - ] + ], + "values_editable_by": "org_actors" }, { "property_name": "service", @@ -52,12 +53,13 @@ func TestOrganizationsService_GetAllCustomProperties(t *testing.T) { want := []*CustomProperty{ { - PropertyName: String("name"), - ValueType: "single_select", - Required: Bool(true), - DefaultValue: String("production"), - Description: String("Prod or dev environment"), - AllowedValues: []string{"production", "development"}, + PropertyName: String("name"), + ValueType: "single_select", + Required: Bool(true), + DefaultValue: String("production"), + Description: String("Prod or dev environment"), + AllowedValues: []string{"production", "development"}, + ValuesEditableBy: String("org_actors"), }, { PropertyName: String("service"), @@ -162,7 +164,8 @@ func TestOrganizationsService_GetCustomProperty(t *testing.T) { "allowed_values":[ "production", "development" - ] + ], + "values_editable_by": "org_actors" }`) }) @@ -173,12 +176,13 @@ func TestOrganizationsService_GetCustomProperty(t *testing.T) { } want := &CustomProperty{ - PropertyName: String("name"), - ValueType: "single_select", - Required: Bool(true), - DefaultValue: String("production"), - Description: String("Prod or dev environment"), - AllowedValues: []string{"production", "development"}, + PropertyName: String("name"), + ValueType: "single_select", + Required: Bool(true), + DefaultValue: String("production"), + Description: String("Prod or dev environment"), + AllowedValues: []string{"production", "development"}, + ValuesEditableBy: String("org_actors"), } if !cmp.Equal(property, want) { t.Errorf("Organizations.GetCustomProperty returned %+v, want %+v", property, want) @@ -210,29 +214,32 @@ func TestOrganizationsService_CreateOrUpdateCustomProperty(t *testing.T) { "allowed_values":[ "production", "development" - ] + ], + "values_editable_by": "org_actors" }`) }) ctx := context.Background() property, _, err := client.Organizations.CreateOrUpdateCustomProperty(ctx, "o", "name", &CustomProperty{ - ValueType: "single_select", - Required: Bool(true), - DefaultValue: String("production"), - Description: String("Prod or dev environment"), - AllowedValues: []string{"production", "development"}, + ValueType: "single_select", + Required: Bool(true), + DefaultValue: String("production"), + Description: String("Prod or dev environment"), + AllowedValues: []string{"production", "development"}, + ValuesEditableBy: String("org_actors"), }) if err != nil { t.Errorf("Organizations.CreateOrUpdateCustomProperty returned error: %v", err) } want := &CustomProperty{ - PropertyName: String("name"), - ValueType: "single_select", - Required: Bool(true), - DefaultValue: String("production"), - Description: String("Prod or dev environment"), - AllowedValues: []string{"production", "development"}, + PropertyName: String("name"), + ValueType: "single_select", + Required: Bool(true), + DefaultValue: String("production"), + Description: String("Prod or dev environment"), + AllowedValues: []string{"production", "development"}, + ValuesEditableBy: String("org_actors"), } if !cmp.Equal(property, want) { t.Errorf("Organizations.CreateOrUpdateCustomProperty returned %+v, want %+v", property, want) @@ -280,7 +287,7 @@ func TestOrganizationsService_ListCustomPropertyValues(t *testing.T) { fmt.Fprint(w, `[{ "repository_id": 1296269, "repository_name": "Hello-World", - "repository_full_name": "octocat/Hello-World", + "repository_full_name": "octocat/Hello-World", "properties": [ { "property_name": "environment", From 4169a9c04d6de06cfe5c4d64307ec54197563f44 Mon Sep 17 00:00:00 2001 From: YuyaKoda <29038315+ponkio-o@users.noreply.github.com> Date: Mon, 13 May 2024 20:28:29 +0900 Subject: [PATCH 454/751] feat!: Change enterprise runner to also use ListRunnersOptions (#3167) Fixes: #3166. BREAKING-CHANGE: This changes `ListOptions` to `ListRunnersOptions` in `EnterpriseService.ListRunners`. --- github/enterprise_actions_runners.go | 2 +- github/enterprise_actions_runners_test.go | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/github/enterprise_actions_runners.go b/github/enterprise_actions_runners.go index 4a6e6b52c10..a5364815324 100644 --- a/github/enterprise_actions_runners.go +++ b/github/enterprise_actions_runners.go @@ -80,7 +80,7 @@ func (s *EnterpriseService) CreateRegistrationToken(ctx context.Context, enterpr // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/actions/runners -func (s *EnterpriseService) ListRunners(ctx context.Context, enterprise string, opts *ListOptions) (*Runners, *Response, error) { +func (s *EnterpriseService) ListRunners(ctx context.Context, enterprise string, opts *ListRunnersOptions) (*Runners, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runners", enterprise) u, err := addOptions(u, opts) if err != nil { diff --git a/github/enterprise_actions_runners_test.go b/github/enterprise_actions_runners_test.go index 36b2aaefe89..3bc3c737b89 100644 --- a/github/enterprise_actions_runners_test.go +++ b/github/enterprise_actions_runners_test.go @@ -106,11 +106,14 @@ func TestEnterpriseService_ListRunners(t *testing.T) { mux.HandleFunc("/enterprises/e/actions/runners", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testFormValues(t, r, values{"per_page": "2", "page": "2"}) - fmt.Fprint(w, `{"total_count":2,"runners":[{"id":23,"name":"MBP","os":"macos","status":"online"},{"id":24,"name":"iMac","os":"macos","status":"offline"}]}`) + testFormValues(t, r, values{"name": "MBP", "per_page": "2", "page": "2"}) + fmt.Fprint(w, `{"total_count":1,"runners":[{"id":23,"name":"MBP","os":"macos","status":"online"}]}`) }) - opts := &ListOptions{Page: 2, PerPage: 2} + opts := &ListRunnersOptions{ + Name: String("MBP"), + ListOptions: ListOptions{Page: 2, PerPage: 2}, + } ctx := context.Background() runners, _, err := client.Enterprise.ListRunners(ctx, "e", opts) if err != nil { @@ -118,10 +121,9 @@ func TestEnterpriseService_ListRunners(t *testing.T) { } want := &Runners{ - TotalCount: 2, + TotalCount: 1, Runners: []*Runner{ {ID: Int64(23), Name: String("MBP"), OS: String("macos"), Status: String("online")}, - {ID: Int64(24), Name: String("iMac"), OS: String("macos"), Status: String("offline")}, }, } if !cmp.Equal(runners, want) { @@ -130,7 +132,7 @@ func TestEnterpriseService_ListRunners(t *testing.T) { const methodName = "ListRunners" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Enterprise.ListRunners(ctx, "\n", &ListOptions{}) + _, _, err = client.Enterprise.ListRunners(ctx, "\n", &ListRunnersOptions{}) return err }) From 06c97092155a2ecabd86d4db38b6bb4354e4e420 Mon Sep 17 00:00:00 2001 From: Matt Simons Date: Tue, 14 May 2024 16:04:21 +0100 Subject: [PATCH 455/751] Add CommitID, InReplyTo, and SubjectType to DraftReviewComment (#3169) Fixes: #3168. --- github/github-accessors.go | 24 ++++++++++++++++++++++++ github/github-accessors_test.go | 30 ++++++++++++++++++++++++++++++ github/github-stringify_test.go | 21 ++++++++++++--------- github/pulls_reviews.go | 9 ++++++--- 4 files changed, 72 insertions(+), 12 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 1580ab4ba5e..fc6d787e55c 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -6510,6 +6510,22 @@ func (d *DraftReviewComment) GetBody() string { return *d.Body } +// GetCommitID returns the CommitID field if it's non-nil, zero value otherwise. +func (d *DraftReviewComment) GetCommitID() string { + if d == nil || d.CommitID == nil { + return "" + } + return *d.CommitID +} + +// GetInReplyTo returns the InReplyTo field if it's non-nil, zero value otherwise. +func (d *DraftReviewComment) GetInReplyTo() int64 { + if d == nil || d.InReplyTo == nil { + return 0 + } + return *d.InReplyTo +} + // GetLine returns the Line field if it's non-nil, zero value otherwise. func (d *DraftReviewComment) GetLine() int { if d == nil || d.Line == nil { @@ -6558,6 +6574,14 @@ func (d *DraftReviewComment) GetStartSide() string { return *d.StartSide } +// GetSubjectType returns the SubjectType field if it's non-nil, zero value otherwise. +func (d *DraftReviewComment) GetSubjectType() string { + if d == nil || d.SubjectType == nil { + return "" + } + return *d.SubjectType +} + // GetRef returns the Ref field. func (e *EditBase) GetRef() *EditRef { if e == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 08f0e825583..a15fb2ec183 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -7613,6 +7613,26 @@ func TestDraftReviewComment_GetBody(tt *testing.T) { d.GetBody() } +func TestDraftReviewComment_GetCommitID(tt *testing.T) { + var zeroValue string + d := &DraftReviewComment{CommitID: &zeroValue} + d.GetCommitID() + d = &DraftReviewComment{} + d.GetCommitID() + d = nil + d.GetCommitID() +} + +func TestDraftReviewComment_GetInReplyTo(tt *testing.T) { + var zeroValue int64 + d := &DraftReviewComment{InReplyTo: &zeroValue} + d.GetInReplyTo() + d = &DraftReviewComment{} + d.GetInReplyTo() + d = nil + d.GetInReplyTo() +} + func TestDraftReviewComment_GetLine(tt *testing.T) { var zeroValue int d := &DraftReviewComment{Line: &zeroValue} @@ -7673,6 +7693,16 @@ func TestDraftReviewComment_GetStartSide(tt *testing.T) { d.GetStartSide() } +func TestDraftReviewComment_GetSubjectType(tt *testing.T) { + var zeroValue string + d := &DraftReviewComment{SubjectType: &zeroValue} + d.GetSubjectType() + d = &DraftReviewComment{} + d.GetSubjectType() + d = nil + d.GetSubjectType() +} + func TestEditBase_GetRef(tt *testing.T) { e := &EditBase{} e.GetRef() diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index 8633d837d12..c311889c284 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -388,15 +388,18 @@ func TestDiscussionComment_String(t *testing.T) { func TestDraftReviewComment_String(t *testing.T) { v := DraftReviewComment{ - Path: String(""), - Position: Int(0), - Body: String(""), - StartSide: String(""), - Side: String(""), - StartLine: Int(0), - Line: Int(0), - } - want := `github.DraftReviewComment{Path:"", Position:0, Body:"", StartSide:"", Side:"", StartLine:0, Line:0}` + Path: String(""), + Position: Int(0), + Body: String(""), + CommitID: String(""), + InReplyTo: Int64(0), + SubjectType: String(""), + StartSide: String(""), + Side: String(""), + StartLine: Int(0), + Line: Int(0), + } + want := `github.DraftReviewComment{Path:"", Position:0, Body:"", CommitID:"", InReplyTo:0, SubjectType:"", StartSide:"", Side:"", StartLine:0, Line:0}` if got := v.String(); got != want { t.Errorf("DraftReviewComment.String = %v, want %v", got, want) } diff --git a/github/pulls_reviews.go b/github/pulls_reviews.go index 27b8dc37d5d..28450c3d433 100644 --- a/github/pulls_reviews.go +++ b/github/pulls_reviews.go @@ -35,9 +35,12 @@ func (p PullRequestReview) String() string { // DraftReviewComment represents a comment part of the review. type DraftReviewComment struct { - Path *string `json:"path,omitempty"` - Position *int `json:"position,omitempty"` - Body *string `json:"body,omitempty"` + Path *string `json:"path,omitempty"` + Position *int `json:"position,omitempty"` + Body *string `json:"body,omitempty"` + CommitID *string `json:"commit_id,omitempty"` + InReplyTo *int64 `json:"in_reply_to,omitempty"` + SubjectType *string `json:"subject_type,omitempty"` // The new comfort-fade-preview fields StartSide *string `json:"start_side,omitempty"` From 4b160159699431a329f39f54d88044ed61f44a13 Mon Sep 17 00:00:00 2001 From: tomfeigin Date: Wed, 15 May 2024 16:01:38 +0300 Subject: [PATCH 456/751] feat!: Support querying organization custom roles (#3129) BREAKING CHANGE: `CreateOrUpdateCustomRoleOptions` has been renamed to `CreateOrUpdateCustomRepoRoleOptions` and `roleID` has been changed from type `string` to `int64`. --- github/github-accessors.go | 54 +++++++++- github/github-accessors_test.go | 78 +++++++++++++-- github/orgs_custom_roles.go | 135 ++++++++++++++++++++++--- github/orgs_custom_roles_test.go | 163 +++++++++++++++++++++++++++++-- 4 files changed, 400 insertions(+), 30 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index fc6d787e55c..0da23493ec2 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -4351,7 +4351,7 @@ func (c *CreateOrgInvitationOptions) GetRole() string { } // GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise. -func (c *CreateOrUpdateCustomRoleOptions) GetBaseRole() string { +func (c *CreateOrUpdateCustomRepoRoleOptions) GetBaseRole() string { if c == nil || c.BaseRole == nil { return "" } @@ -4359,7 +4359,7 @@ func (c *CreateOrUpdateCustomRoleOptions) GetBaseRole() string { } // GetDescription returns the Description field if it's non-nil, zero value otherwise. -func (c *CreateOrUpdateCustomRoleOptions) GetDescription() string { +func (c *CreateOrUpdateCustomRepoRoleOptions) GetDescription() string { if c == nil || c.Description == nil { return "" } @@ -4367,7 +4367,23 @@ func (c *CreateOrUpdateCustomRoleOptions) GetDescription() string { } // GetName returns the Name field if it's non-nil, zero value otherwise. -func (c *CreateOrUpdateCustomRoleOptions) GetName() string { +func (c *CreateOrUpdateCustomRepoRoleOptions) GetName() string { + if c == nil || c.Name == nil { + return "" + } + return *c.Name +} + +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (c *CreateOrUpdateOrgRoleOptions) GetDescription() string { + if c == nil || c.Description == nil { + return "" + } + return *c.Description +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (c *CreateOrUpdateOrgRoleOptions) GetName() string { if c == nil || c.Name == nil { return "" } @@ -4686,6 +4702,30 @@ func (c *CustomDeploymentProtectionRuleRequest) GetIntegrationID() int64 { return *c.IntegrationID } +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (c *CustomOrgRoles) GetDescription() string { + if c == nil || c.Description == nil { + return "" + } + return *c.Description +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (c *CustomOrgRoles) GetID() int64 { + if c == nil || c.ID == nil { + return 0 + } + return *c.ID +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (c *CustomOrgRoles) GetName() string { + if c == nil || c.Name == nil { + return "" + } + return *c.Name +} + // GetDefaultValue returns the DefaultValue field if it's non-nil, zero value otherwise. func (c *CustomProperty) GetDefaultValue() string { if c == nil || c.DefaultValue == nil { @@ -12870,6 +12910,14 @@ func (o *OrganizationCustomRepoRoles) GetTotalCount() int { return *o.TotalCount } +// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. +func (o *OrganizationCustomRoles) GetTotalCount() int { + if o == nil || o.TotalCount == nil { + return 0 + } + return *o.TotalCount +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (o *OrganizationEvent) GetAction() string { if o == nil || o.Action == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index a15fb2ec183..8bb86540d9b 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -5105,31 +5105,51 @@ func TestCreateOrgInvitationOptions_GetRole(tt *testing.T) { c.GetRole() } -func TestCreateOrUpdateCustomRoleOptions_GetBaseRole(tt *testing.T) { +func TestCreateOrUpdateCustomRepoRoleOptions_GetBaseRole(tt *testing.T) { var zeroValue string - c := &CreateOrUpdateCustomRoleOptions{BaseRole: &zeroValue} + c := &CreateOrUpdateCustomRepoRoleOptions{BaseRole: &zeroValue} c.GetBaseRole() - c = &CreateOrUpdateCustomRoleOptions{} + c = &CreateOrUpdateCustomRepoRoleOptions{} c.GetBaseRole() c = nil c.GetBaseRole() } -func TestCreateOrUpdateCustomRoleOptions_GetDescription(tt *testing.T) { +func TestCreateOrUpdateCustomRepoRoleOptions_GetDescription(tt *testing.T) { var zeroValue string - c := &CreateOrUpdateCustomRoleOptions{Description: &zeroValue} + c := &CreateOrUpdateCustomRepoRoleOptions{Description: &zeroValue} c.GetDescription() - c = &CreateOrUpdateCustomRoleOptions{} + c = &CreateOrUpdateCustomRepoRoleOptions{} c.GetDescription() c = nil c.GetDescription() } -func TestCreateOrUpdateCustomRoleOptions_GetName(tt *testing.T) { +func TestCreateOrUpdateCustomRepoRoleOptions_GetName(tt *testing.T) { var zeroValue string - c := &CreateOrUpdateCustomRoleOptions{Name: &zeroValue} + c := &CreateOrUpdateCustomRepoRoleOptions{Name: &zeroValue} c.GetName() - c = &CreateOrUpdateCustomRoleOptions{} + c = &CreateOrUpdateCustomRepoRoleOptions{} + c.GetName() + c = nil + c.GetName() +} + +func TestCreateOrUpdateOrgRoleOptions_GetDescription(tt *testing.T) { + var zeroValue string + c := &CreateOrUpdateOrgRoleOptions{Description: &zeroValue} + c.GetDescription() + c = &CreateOrUpdateOrgRoleOptions{} + c.GetDescription() + c = nil + c.GetDescription() +} + +func TestCreateOrUpdateOrgRoleOptions_GetName(tt *testing.T) { + var zeroValue string + c := &CreateOrUpdateOrgRoleOptions{Name: &zeroValue} + c.GetName() + c = &CreateOrUpdateOrgRoleOptions{} c.GetName() c = nil c.GetName() @@ -5513,6 +5533,36 @@ func TestCustomDeploymentProtectionRuleRequest_GetIntegrationID(tt *testing.T) { c.GetIntegrationID() } +func TestCustomOrgRoles_GetDescription(tt *testing.T) { + var zeroValue string + c := &CustomOrgRoles{Description: &zeroValue} + c.GetDescription() + c = &CustomOrgRoles{} + c.GetDescription() + c = nil + c.GetDescription() +} + +func TestCustomOrgRoles_GetID(tt *testing.T) { + var zeroValue int64 + c := &CustomOrgRoles{ID: &zeroValue} + c.GetID() + c = &CustomOrgRoles{} + c.GetID() + c = nil + c.GetID() +} + +func TestCustomOrgRoles_GetName(tt *testing.T) { + var zeroValue string + c := &CustomOrgRoles{Name: &zeroValue} + c.GetName() + c = &CustomOrgRoles{} + c.GetName() + c = nil + c.GetName() +} + func TestCustomProperty_GetDefaultValue(tt *testing.T) { var zeroValue string c := &CustomProperty{DefaultValue: &zeroValue} @@ -15065,6 +15115,16 @@ func TestOrganizationCustomRepoRoles_GetTotalCount(tt *testing.T) { o.GetTotalCount() } +func TestOrganizationCustomRoles_GetTotalCount(tt *testing.T) { + var zeroValue int + o := &OrganizationCustomRoles{TotalCount: &zeroValue} + o.GetTotalCount() + o = &OrganizationCustomRoles{} + o.GetTotalCount() + o = nil + o.GetTotalCount() +} + func TestOrganizationEvent_GetAction(tt *testing.T) { var zeroValue string o := &OrganizationEvent{Action: &zeroValue} diff --git a/github/orgs_custom_roles.go b/github/orgs_custom_roles.go index e1deeb73ed4..f71cb7aee03 100644 --- a/github/orgs_custom_roles.go +++ b/github/orgs_custom_roles.go @@ -10,6 +10,20 @@ import ( "fmt" ) +// OrganizationCustomRoles represents custom organization roles available in specified organization. +type OrganizationCustomRoles struct { + TotalCount *int `json:"total_count,omitempty"` + CustomRepoRoles []*CustomOrgRoles `json:"roles,omitempty"` +} + +// CustomOrgRoles represents custom organization role available in specified organization. +type CustomOrgRoles struct { + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + Permissions []string `json:"permissions,omitempty"` +} + // OrganizationCustomRepoRoles represents custom repository roles available in specified organization. type OrganizationCustomRepoRoles struct { TotalCount *int `json:"total_count,omitempty"` @@ -27,6 +41,113 @@ type CustomRepoRoles struct { Permissions []string `json:"permissions,omitempty"` } +// CreateOrUpdateOrgRoleOptions represents options required to create or update a custom organization role. +type CreateOrUpdateOrgRoleOptions struct { + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + Permissions []string `json:"permissions,omitempty"` +} + +// CreateOrUpdateCustomRepoRoleOptions represents options required to create or update a custom repository role. +type CreateOrUpdateCustomRepoRoleOptions struct { + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + BaseRole *string `json:"base_role,omitempty"` + Permissions []string `json:"permissions,omitempty"` +} + +// ListRoles lists the custom roles available in this organization. +// In order to see custom roles in an organization, the authenticated user must be an organization owner. +// +// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#get-all-organization-roles-for-an-organization +// +//meta:operation GET /orgs/{org}/organization-roles +func (s *OrganizationsService) ListRoles(ctx context.Context, org string) (*OrganizationCustomRoles, *Response, error) { + u := fmt.Sprintf("orgs/%v/organization-roles", org) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + customRepoRoles := new(OrganizationCustomRoles) + resp, err := s.client.Do(ctx, req, customRepoRoles) + if err != nil { + return nil, resp, err + } + + return customRepoRoles, resp, nil +} + +// CreateCustomOrgRole creates a custom role in this organization. +// In order to create custom roles in an organization, the authenticated user must be an organization owner. +// +// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#create-a-custom-organization-role +// +//meta:operation POST /orgs/{org}/organization-roles +func (s *OrganizationsService) CreateCustomOrgRole(ctx context.Context, org string, opts *CreateOrUpdateOrgRoleOptions) (*CustomOrgRoles, *Response, error) { + u := fmt.Sprintf("orgs/%v/organization-roles", org) + + req, err := s.client.NewRequest("POST", u, opts) + if err != nil { + return nil, nil, err + } + + resultingRole := new(CustomOrgRoles) + resp, err := s.client.Do(ctx, req, resultingRole) + if err != nil { + return nil, resp, err + } + + return resultingRole, resp, err +} + +// UpdateCustomOrgRole updates a custom role in this organization. +// In order to update custom roles in an organization, the authenticated user must be an organization owner. +// +// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#update-a-custom-organization-role +// +//meta:operation PATCH /orgs/{org}/organization-roles/{role_id} +func (s *OrganizationsService) UpdateCustomOrgRole(ctx context.Context, org string, roleID int64, opts *CreateOrUpdateOrgRoleOptions) (*CustomOrgRoles, *Response, error) { + u := fmt.Sprintf("orgs/%v/organization-roles/%v", org, roleID) + + req, err := s.client.NewRequest("PATCH", u, opts) + if err != nil { + return nil, nil, err + } + + resultingRole := new(CustomOrgRoles) + resp, err := s.client.Do(ctx, req, resultingRole) + if err != nil { + return nil, resp, err + } + + return resultingRole, resp, err +} + +// DeleteCustomOrgRole deletes an existing custom role in this organization. +// In order to delete custom roles in an organization, the authenticated user must be an organization owner. +// +// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#delete-a-custom-organization-role +// +//meta:operation DELETE /orgs/{org}/organization-roles/{role_id} +func (s *OrganizationsService) DeleteCustomOrgRole(ctx context.Context, org string, roleID int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/organization-roles/%v", org, roleID) + + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + resultingRole := new(CustomOrgRoles) + resp, err := s.client.Do(ctx, req, resultingRole) + if err != nil { + return resp, err + } + + return resp, nil +} + // ListCustomRepoRoles lists the custom repository roles available in this organization. // In order to see custom repository roles in an organization, the authenticated user must be an organization owner. // @@ -50,21 +171,13 @@ func (s *OrganizationsService) ListCustomRepoRoles(ctx context.Context, org stri return customRepoRoles, resp, nil } -// CreateOrUpdateCustomRoleOptions represents options required to create or update a custom repository role. -type CreateOrUpdateCustomRoleOptions struct { - Name *string `json:"name,omitempty"` - Description *string `json:"description,omitempty"` - BaseRole *string `json:"base_role,omitempty"` - Permissions []string `json:"permissions,omitempty"` -} - // CreateCustomRepoRole creates a custom repository role in this organization. // In order to create custom repository roles in an organization, the authenticated user must be an organization owner. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#create-a-custom-repository-role // //meta:operation POST /orgs/{org}/custom-repository-roles -func (s *OrganizationsService) CreateCustomRepoRole(ctx context.Context, org string, opts *CreateOrUpdateCustomRoleOptions) (*CustomRepoRoles, *Response, error) { +func (s *OrganizationsService) CreateCustomRepoRole(ctx context.Context, org string, opts *CreateOrUpdateCustomRepoRoleOptions) (*CustomRepoRoles, *Response, error) { u := fmt.Sprintf("orgs/%v/custom-repository-roles", org) req, err := s.client.NewRequest("POST", u, opts) @@ -87,7 +200,7 @@ func (s *OrganizationsService) CreateCustomRepoRole(ctx context.Context, org str // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#update-a-custom-repository-role // //meta:operation PATCH /orgs/{org}/custom-repository-roles/{role_id} -func (s *OrganizationsService) UpdateCustomRepoRole(ctx context.Context, org, roleID string, opts *CreateOrUpdateCustomRoleOptions) (*CustomRepoRoles, *Response, error) { +func (s *OrganizationsService) UpdateCustomRepoRole(ctx context.Context, org string, roleID int64, opts *CreateOrUpdateCustomRepoRoleOptions) (*CustomRepoRoles, *Response, error) { u := fmt.Sprintf("orgs/%v/custom-repository-roles/%v", org, roleID) req, err := s.client.NewRequest("PATCH", u, opts) @@ -110,7 +223,7 @@ func (s *OrganizationsService) UpdateCustomRepoRole(ctx context.Context, org, ro // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#delete-a-custom-repository-role // //meta:operation DELETE /orgs/{org}/custom-repository-roles/{role_id} -func (s *OrganizationsService) DeleteCustomRepoRole(ctx context.Context, org, roleID string) (*Response, error) { +func (s *OrganizationsService) DeleteCustomRepoRole(ctx context.Context, org string, roleID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/custom-repository-roles/%v", org, roleID) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/orgs_custom_roles_test.go b/github/orgs_custom_roles_test.go index 25e5011fcb9..c03b5a6d44b 100644 --- a/github/orgs_custom_roles_test.go +++ b/github/orgs_custom_roles_test.go @@ -14,6 +14,155 @@ import ( "github.com/google/go-cmp/cmp" ) +func TestOrganizationsService_ListRoles(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/organization-roles", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"total_count": 1, "roles": [{ "id": 1, "name": "Auditor", "permissions": ["read_audit_logs"]}]}`) + }) + + ctx := context.Background() + apps, _, err := client.Organizations.ListRoles(ctx, "o") + if err != nil { + t.Errorf("Organizations.ListRoles returned error: %v", err) + } + + want := &OrganizationCustomRoles{TotalCount: Int(1), CustomRepoRoles: []*CustomOrgRoles{{ID: Int64(1), Name: String("Auditor"), Permissions: []string{"read_audit_logs"}}}} + if !cmp.Equal(apps, want) { + t.Errorf("Organizations.ListRoles returned %+v, want %+v", apps, want) + } + + const methodName = "ListRoles" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.ListRoles(ctx, "\no") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.ListRoles(ctx, "o") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_CreateCustomOrgRole(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/organization-roles", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + fmt.Fprint(w, `{"id":8030,"name":"Reader","description":"A role for reading custom org roles","permissions":["read_organization_custom_org_role"]}`) + }) + + ctx := context.Background() + + opts := &CreateOrUpdateOrgRoleOptions{ + Name: String("Reader"), + Description: String("A role for reading custom org roles"), + Permissions: []string{"read_organization_custom_org_role"}, + } + gotRoles, _, err := client.Organizations.CreateCustomOrgRole(ctx, "o", opts) + if err != nil { + t.Errorf("Organizations.CreateCustomOrgRole returned error: %v", err) + } + + want := &CustomOrgRoles{ID: Int64(8030), Name: String("Reader"), Permissions: []string{"read_organization_custom_org_role"}, Description: String("A role for reading custom org roles")} + + if !cmp.Equal(gotRoles, want) { + t.Errorf("Organizations.CreateCustomOrgRole returned %+v, want %+v", gotRoles, want) + } + + const methodName = "CreateCustomOrgRole" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.CreateCustomOrgRole(ctx, "\no", nil) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.CreateCustomOrgRole(ctx, "o", nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_UpdateCustomOrgRole(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/organization-roles/8030", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PATCH") + fmt.Fprint(w, `{"id":8030,"name":"Updated Name","description":"Updated Description","permissions":["read_organization_custom_org_role"]}`) + }) + + ctx := context.Background() + + opts := &CreateOrUpdateOrgRoleOptions{ + Name: String("Updated Name"), + Description: String("Updated Description"), + } + gotRoles, _, err := client.Organizations.UpdateCustomOrgRole(ctx, "o", 8030, opts) + if err != nil { + t.Errorf("Organizations.UpdateCustomOrgRole returned error: %v", err) + } + + want := &CustomOrgRoles{ID: Int64(8030), Name: String("Updated Name"), Permissions: []string{"read_organization_custom_org_role"}, Description: String("Updated Description")} + + if !cmp.Equal(gotRoles, want) { + t.Errorf("Organizations.UpdateCustomOrgRole returned %+v, want %+v", gotRoles, want) + } + + const methodName = "UpdateCustomOrgRole" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.UpdateCustomOrgRole(ctx, "\no", 8030, nil) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.UpdateCustomOrgRole(ctx, "o", 8030, nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_DeleteCustomOrgRole(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/organization-roles/8030", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + w.WriteHeader(http.StatusNoContent) + }) + + ctx := context.Background() + + resp, err := client.Organizations.DeleteCustomOrgRole(ctx, "o", 8030) + if err != nil { + t.Errorf("Organizations.DeleteCustomOrgRole returned error: %v", err) + } + + if !cmp.Equal(resp.StatusCode, 204) { + t.Errorf("Organizations.DeleteCustomOrgRole returned status code %+v, want %+v", resp.StatusCode, "204") + } + + const methodName = "DeleteCustomOrgRole" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Organizations.DeleteCustomOrgRole(ctx, "\no", 8030) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Organizations.DeleteCustomOrgRole(ctx, "o", 8030) + }) +} + func TestOrganizationsService_ListCustomRepoRoles(t *testing.T) { client, mux, _, teardown := setup() defer teardown() @@ -60,7 +209,7 @@ func TestOrganizationsService_CreateCustomRepoRole(t *testing.T) { ctx := context.Background() - opts := &CreateOrUpdateCustomRoleOptions{ + opts := &CreateOrUpdateCustomRepoRoleOptions{ Name: String("Labeler"), Description: String("A role for issue and PR labelers"), BaseRole: String("read"), @@ -103,11 +252,11 @@ func TestOrganizationsService_UpdateCustomRepoRole(t *testing.T) { ctx := context.Background() - opts := &CreateOrUpdateCustomRoleOptions{ + opts := &CreateOrUpdateCustomRepoRoleOptions{ Name: String("Updated Name"), Description: String("Updated Description"), } - apps, _, err := client.Organizations.UpdateCustomRepoRole(ctx, "o", "8030", opts) + apps, _, err := client.Organizations.UpdateCustomRepoRole(ctx, "o", 8030, opts) if err != nil { t.Errorf("Organizations.UpdateCustomRepoRole returned error: %v", err) } @@ -120,12 +269,12 @@ func TestOrganizationsService_UpdateCustomRepoRole(t *testing.T) { const methodName = "UpdateCustomRepoRole" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Organizations.UpdateCustomRepoRole(ctx, "\no", "8030", nil) + _, _, err = client.Organizations.UpdateCustomRepoRole(ctx, "\no", 8030, nil) return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Organizations.UpdateCustomRepoRole(ctx, "o", "8030", nil) + got, resp, err := client.Organizations.UpdateCustomRepoRole(ctx, "o", 8030, nil) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -144,7 +293,7 @@ func TestOrganizationsService_DeleteCustomRepoRole(t *testing.T) { ctx := context.Background() - resp, err := client.Organizations.DeleteCustomRepoRole(ctx, "o", "8030") + resp, err := client.Organizations.DeleteCustomRepoRole(ctx, "o", 8030) if err != nil { t.Errorf("Organizations.DeleteCustomRepoRole returned error: %v", err) } @@ -155,7 +304,7 @@ func TestOrganizationsService_DeleteCustomRepoRole(t *testing.T) { const methodName = "DeleteCustomRepoRole" testBadOptions(t, methodName, func() (err error) { - _, err = client.Organizations.DeleteCustomRepoRole(ctx, "\no", "8030") + _, err = client.Organizations.DeleteCustomRepoRole(ctx, "\no", 8030) return err }) } From 0a8878b2cc3592d1303d9ed94d36b70b1022a5f8 Mon Sep 17 00:00:00 2001 From: assembly-winston <153486593+assembly-winston@users.noreply.github.com> Date: Thu, 16 May 2024 16:10:00 -0700 Subject: [PATCH 457/751] Support status codes 302 and 200 in GetArchiveLink endpoint (#3172) Fixes: #3171. --- github/repos_contents.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/repos_contents.go b/github/repos_contents.go index 9539a5c4296..c4453739f9c 100644 --- a/github/repos_contents.go +++ b/github/repos_contents.go @@ -346,7 +346,7 @@ func (s *RepositoriesService) GetArchiveLink(ctx context.Context, owner, repo st } defer resp.Body.Close() - if resp.StatusCode != http.StatusFound { + if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusFound { return nil, newResponse(resp), fmt.Errorf("unexpected status code: %s", resp.Status) } From 8c1232a5960307a6383998e1aa2dd71711343810 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 May 2024 15:52:13 -0400 Subject: [PATCH 458/751] Bump codecov/codecov-action from 4.3.1 to 4.4.1 (#3173) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 66ebb06f4de..485e3978a6e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -73,4 +73,4 @@ jobs: - name: Upload coverage to Codecov if: ${{ matrix.update-coverage }} - uses: codecov/codecov-action@5ecb98a3c6b747ed38dc09f787459979aebb39be #v4.3.1 + uses: codecov/codecov-action@125fc84a9a348dbcf27191600683ec096ec9021c #v4.4.1 From 7665f317d3985efe6a7828e3af2751c41b3526b1 Mon Sep 17 00:00:00 2001 From: Richard Macklin <1863540+rmacklin@users.noreply.github.com> Date: Thu, 23 May 2024 12:02:25 -0700 Subject: [PATCH 459/751] Support `path` property in `WorkflowRun` (#3176) Fixes: #3175. --- github/actions_workflow_runs.go | 1 + github/actions_workflow_runs_test.go | 2 ++ github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ 4 files changed, 21 insertions(+) diff --git a/github/actions_workflow_runs.go b/github/actions_workflow_runs.go index bc7afe9e944..d55c01dcd74 100644 --- a/github/actions_workflow_runs.go +++ b/github/actions_workflow_runs.go @@ -19,6 +19,7 @@ type WorkflowRun struct { NodeID *string `json:"node_id,omitempty"` HeadBranch *string `json:"head_branch,omitempty"` HeadSHA *string `json:"head_sha,omitempty"` + Path *string `json:"path,omitempty"` RunNumber *int `json:"run_number,omitempty"` RunAttempt *int `json:"run_attempt,omitempty"` Event *string `json:"event,omitempty"` diff --git a/github/actions_workflow_runs_test.go b/github/actions_workflow_runs_test.go index b4b1c9177f6..8e01aa82297 100644 --- a/github/actions_workflow_runs_test.go +++ b/github/actions_workflow_runs_test.go @@ -648,6 +648,7 @@ func TestWorkflowRun_Marshal(t *testing.T) { NodeID: String("nid"), HeadBranch: String("hb"), HeadSHA: String("hs"), + Path: String("p"), RunNumber: Int(1), RunAttempt: Int(1), Event: String("e"), @@ -776,6 +777,7 @@ func TestWorkflowRun_Marshal(t *testing.T) { "node_id": "nid", "head_branch": "hb", "head_sha": "hs", + "path": "p", "run_number": 1, "run_attempt": 1, "event": "e", diff --git a/github/github-accessors.go b/github/github-accessors.go index 0da23493ec2..421922d33db 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -25326,6 +25326,14 @@ func (w *WorkflowRun) GetNodeID() string { return *w.NodeID } +// GetPath returns the Path field if it's non-nil, zero value otherwise. +func (w *WorkflowRun) GetPath() string { + if w == nil || w.Path == nil { + return "" + } + return *w.Path +} + // GetPreviousAttemptURL returns the PreviousAttemptURL field if it's non-nil, zero value otherwise. func (w *WorkflowRun) GetPreviousAttemptURL() string { if w == nil || w.PreviousAttemptURL == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 8bb86540d9b..8753c42b79e 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -29477,6 +29477,16 @@ func TestWorkflowRun_GetNodeID(tt *testing.T) { w.GetNodeID() } +func TestWorkflowRun_GetPath(tt *testing.T) { + var zeroValue string + w := &WorkflowRun{Path: &zeroValue} + w.GetPath() + w = &WorkflowRun{} + w.GetPath() + w = nil + w.GetPath() +} + func TestWorkflowRun_GetPreviousAttemptURL(tt *testing.T) { var zeroValue string w := &WorkflowRun{PreviousAttemptURL: &zeroValue} From 6257442bcdfa0363012e60a33e475954d5e75fa7 Mon Sep 17 00:00:00 2001 From: Sanjito Kurniawan Date: Wed, 29 May 2024 01:18:35 +0200 Subject: [PATCH 460/751] docs: Update README (#3177) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 42e1681e113..b243c795bd9 100644 --- a/README.md +++ b/README.md @@ -226,7 +226,7 @@ import "github.com/gregjones/httpcache" ``` Learn more about GitHub conditional requests at -https://docs.github.com/en/rest/overview/resources-in-the-rest-api#conditional-requests. +https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api?apiVersion=2022-11-28#use-conditional-requests-if-appropriate ### Creating and Updating Resources ### From 446a2968d80b0adc88c54a1c1a17a05b25e83ea7 Mon Sep 17 00:00:00 2001 From: Jorge Ferrero Date: Sun, 2 Jun 2024 00:22:31 +0200 Subject: [PATCH 461/751] Update readme to include go-githubauth for Application auth (#3180) Fixes: #3178. --- README.md | 44 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b243c795bd9..06922ab780c 100644 --- a/README.md +++ b/README.md @@ -101,8 +101,7 @@ For API methods that require HTTP Basic Authentication, use the #### As a GitHub App #### -GitHub Apps authentication can be provided by the [ghinstallation](https://github.com/bradleyfalzon/ghinstallation) -package. +GitHub Apps authentication can be provided by different pkgs like [ghinstallation](https://github.com/bradleyfalzon/ghinstallation) or [go-githubauth](github.com/jferrl/go-githubauth). > **Note**: Most endpoints (ex. [`GET /rate_limit`]) require access token authentication > while a few others (ex. [`GET /app/hook/deliveries`]) require [JWT] authentication. @@ -111,6 +110,9 @@ package. [`GET /app/hook/deliveries`]: https://docs.github.com/en/rest/apps/webhooks#list-deliveries-for-an-app-webhook [JWT]: https://docs.github.com/en/developers/apps/building-github-apps/authenticating-with-github-apps#authenticating-as-a-github-app +`ghinstallation` provides `Transport`, which implements `http.RoundTripper` to provide authentication as an installation for GitHub Apps. + +Here is an example of how to authenticate as a GitHub App using the `ghinstallation` package: ```go import ( @@ -138,6 +140,44 @@ func main() { } ``` +`go-githubauth` implements a set of `oauth2.TokenSource` to be used with `oauth2.Client`. An `oauth2.Client` can be injected into the `github.Client` to authenticate requests. + +Other example using `go-githubauth`: + +```go +package main + +import ( + "context" + "fmt" + "os" + "strconv" + + "github.com/google/go-github/v62/github" + "github.com/jferrl/go-githubauth" + "golang.org/x/oauth2" +) + +func main() { + privateKey := []byte(os.Getenv("GITHUB_APP_PRIVATE_KEY")) + + appTokenSource, err := githubauth.NewApplicationTokenSource(1112, privateKey) + if err != nil { + fmt.Println("Error creating application token source:", err) + return + } + + installationTokenSource := githubauth.NewInstallationTokenSource(1113, appTokenSource) + + // oauth2.NewClient uses oauth2.ReuseTokenSource to reuse the token until it expires. + // The token will be automatically refreshed when it expires. + // InstallationTokenSource has the mechanism to refresh the token when it expires. + httpClient := oauth2.NewClient(context.Background(), installationTokenSource) + + client := github.NewClient(httpClient) +} +``` + *Note*: In order to interact with certain APIs, for example writing a file to a repo, one must generate an installation token using the installation ID of the GitHub app and authenticate with the OAuth method mentioned above. See the examples. From f0afb252c4b3d45291e052038a535b75a430e1b1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Jun 2024 23:03:17 -0400 Subject: [PATCH 462/751] Bump golang.org/x/net from 0.25.0 to 0.26.0 in /scrape (#3183) --- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index e940f8ea932..ab67d8f31e6 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -9,7 +9,7 @@ require ( github.com/google/go-cmp v0.6.0 github.com/google/go-github/v61 v61.0.0 github.com/xlzd/gotp v0.1.0 - golang.org/x/net v0.25.0 + golang.org/x/net v0.26.0 ) require ( diff --git a/scrape/go.sum b/scrape/go.sum index 316fda4c28e..606899bf664 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -21,8 +21,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= -golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= From f78378d339a8ce90d4229412852240b493260f68 Mon Sep 17 00:00:00 2001 From: Nicholas Herring Date: Tue, 11 Jun 2024 15:05:20 +0000 Subject: [PATCH 463/751] Fix: Propagate context with DownloadContents (#3181) --- github/repos_contents.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/github/repos_contents.go b/github/repos_contents.go index c4453739f9c..97539aeeb5e 100644 --- a/github/repos_contents.go +++ b/github/repos_contents.go @@ -150,7 +150,11 @@ func (s *RepositoriesService) DownloadContents(ctx context.Context, owner, repo, return nil, resp, fmt.Errorf("no download link found for %s", filepath) } - dlResp, err := s.client.client.Get(*contents.DownloadURL) + dlReq, err := http.NewRequestWithContext(ctx, http.MethodGet, *contents.DownloadURL, nil) + if err != nil { + return nil, resp, err + } + dlResp, err := s.client.client.Do(dlReq) if err != nil { return nil, &Response{Response: dlResp}, err } @@ -188,7 +192,11 @@ func (s *RepositoriesService) DownloadContentsWithMeta(ctx context.Context, owne return nil, contents, resp, fmt.Errorf("no download link found for %s", filepath) } - dlResp, err := s.client.client.Get(*contents.DownloadURL) + dlReq, err := http.NewRequestWithContext(ctx, http.MethodGet, *contents.DownloadURL, nil) + if err != nil { + return nil, contents, resp, err + } + dlResp, err := s.client.client.Do(dlReq) if err != nil { return nil, contents, &Response{Response: dlResp}, err } From 0e99a5425784a444086cf1c6b9197a462ec7b4f8 Mon Sep 17 00:00:00 2001 From: tomfeigin Date: Tue, 11 Jun 2024 18:14:37 +0300 Subject: [PATCH 464/751] Add fields to the InstallationPermissions struct (#3184) --- github/apps.go | 2 ++ github/apps_test.go | 18 ++++++++++++++++++ github/github-accessors.go | 16 ++++++++++++++++ github/github-accessors_test.go | 20 ++++++++++++++++++++ 4 files changed, 56 insertions(+) diff --git a/github/apps.go b/github/apps.go index 6969daba6c0..16ef758cbdd 100644 --- a/github/apps.go +++ b/github/apps.go @@ -78,6 +78,7 @@ type InstallationTokenListRepoOptions struct { // https://docs.github.com/rest/apps#create-an-installation-access-token-for-an-app type InstallationPermissions struct { Actions *string `json:"actions,omitempty"` + ActionsVariables *string `json:"actions_variables,omitempty"` Administration *string `json:"administration,omitempty"` Blocking *string `json:"blocking,omitempty"` Checks *string `json:"checks,omitempty"` @@ -93,6 +94,7 @@ type InstallationPermissions struct { OrganizationAdministration *string `json:"organization_administration,omitempty"` OrganizationCustomProperties *string `json:"organization_custom_properties,omitempty"` OrganizationCustomRoles *string `json:"organization_custom_roles,omitempty"` + OrganizationCustomOrgRoles *string `json:"organization_custom_org_roles,omitempty"` OrganizationHooks *string `json:"organization_hooks,omitempty"` OrganizationPackages *string `json:"organization_packages,omitempty"` OrganizationPlan *string `json:"organization_plan,omitempty"` diff --git a/github/apps_test.go b/github/apps_test.go index ea670344595..bb060d7a052 100644 --- a/github/apps_test.go +++ b/github/apps_test.go @@ -769,6 +769,7 @@ func TestInstallationPermissions_Marshal(t *testing.T) { Metadata: String("md"), Members: String("m"), OrganizationAdministration: String("oa"), + OrganizationCustomOrgRoles: String("ocr"), OrganizationHooks: String("oh"), OrganizationPlan: String("op"), OrganizationPreReceiveHooks: String("opr"), @@ -804,6 +805,7 @@ func TestInstallationPermissions_Marshal(t *testing.T) { "metadata": "md", "members": "m", "organization_administration": "oa", + "organization_custom_org_roles": "ocr", "organization_hooks": "oh", "organization_plan": "op", "organization_pre_receive_hooks": "opr", @@ -869,6 +871,7 @@ func TestInstallation_Marshal(t *testing.T) { SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ Actions: String("a"), + ActionsVariables: String("ac"), Administration: String("ad"), Checks: String("c"), Contents: String("co"), @@ -879,6 +882,7 @@ func TestInstallation_Marshal(t *testing.T) { Metadata: String("md"), Members: String("m"), OrganizationAdministration: String("oa"), + OrganizationCustomOrgRoles: String("ocr"), OrganizationHooks: String("oh"), OrganizationPlan: String("op"), OrganizationPreReceiveHooks: String("opr"), @@ -967,6 +971,7 @@ func TestInstallation_Marshal(t *testing.T) { ], "permissions": { "actions": "a", + "actions_variables": "ac", "administration": "ad", "checks": "c", "contents": "co", @@ -977,6 +982,7 @@ func TestInstallation_Marshal(t *testing.T) { "metadata": "md", "members": "m", "organization_administration": "oa", + "organization_custom_org_roles": "ocr", "organization_hooks": "oh", "organization_plan": "op", "organization_pre_receive_hooks": "opr", @@ -1035,6 +1041,7 @@ func TestInstallationTokenOptions_Marshal(t *testing.T) { RepositoryIDs: []int64{1}, Permissions: &InstallationPermissions{ Actions: String("a"), + ActionsVariables: String("ac"), Administration: String("ad"), Checks: String("c"), Contents: String("co"), @@ -1045,6 +1052,7 @@ func TestInstallationTokenOptions_Marshal(t *testing.T) { Metadata: String("md"), Members: String("m"), OrganizationAdministration: String("oa"), + OrganizationCustomOrgRoles: String("ocr"), OrganizationHooks: String("oh"), OrganizationPlan: String("op"), OrganizationPreReceiveHooks: String("opr"), @@ -1073,6 +1081,7 @@ func TestInstallationTokenOptions_Marshal(t *testing.T) { "repository_ids": [1], "permissions": { "actions": "a", + "actions_variables": "ac", "administration": "ad", "checks": "c", "contents": "co", @@ -1083,6 +1092,7 @@ func TestInstallationTokenOptions_Marshal(t *testing.T) { "metadata": "md", "members": "m", "organization_administration": "oa", + "organization_custom_org_roles": "ocr", "organization_hooks": "oh", "organization_plan": "op", "organization_pre_receive_hooks": "opr", @@ -1118,6 +1128,7 @@ func TestInstallationToken_Marshal(t *testing.T) { ExpiresAt: &Timestamp{referenceTime}, Permissions: &InstallationPermissions{ Actions: String("a"), + ActionsVariables: String("ac"), Administration: String("ad"), Checks: String("c"), Contents: String("co"), @@ -1128,6 +1139,7 @@ func TestInstallationToken_Marshal(t *testing.T) { Metadata: String("md"), Members: String("m"), OrganizationAdministration: String("oa"), + OrganizationCustomOrgRoles: String("ocr"), OrganizationHooks: String("oh"), OrganizationPlan: String("op"), OrganizationPreReceiveHooks: String("opr"), @@ -1164,6 +1176,7 @@ func TestInstallationToken_Marshal(t *testing.T) { "expires_at": ` + referenceTimeStr + `, "permissions": { "actions": "a", + "actions_variables": "ac", "administration": "ad", "checks": "c", "contents": "co", @@ -1174,6 +1187,7 @@ func TestInstallationToken_Marshal(t *testing.T) { "metadata": "md", "members": "m", "organization_administration": "oa", + "organization_custom_org_roles": "ocr", "organization_hooks": "oh", "organization_plan": "op", "organization_pre_receive_hooks": "opr", @@ -1243,6 +1257,7 @@ func TestApp_Marshal(t *testing.T) { UpdatedAt: &Timestamp{referenceTime}, Permissions: &InstallationPermissions{ Actions: String("a"), + ActionsVariables: String("ac"), Administration: String("ad"), Checks: String("c"), Contents: String("co"), @@ -1253,6 +1268,7 @@ func TestApp_Marshal(t *testing.T) { Metadata: String("md"), Members: String("m"), OrganizationAdministration: String("oa"), + OrganizationCustomOrgRoles: String("ocr"), OrganizationHooks: String("oh"), OrganizationPlan: String("op"), OrganizationPreReceiveHooks: String("opr"), @@ -1310,6 +1326,7 @@ func TestApp_Marshal(t *testing.T) { "updated_at": ` + referenceTimeStr + `, "permissions": { "actions": "a", + "actions_variables": "ac", "administration": "ad", "checks": "c", "contents": "co", @@ -1320,6 +1337,7 @@ func TestApp_Marshal(t *testing.T) { "metadata": "md", "members": "m", "organization_administration": "oa", + "organization_custom_org_roles": "ocr", "organization_hooks": "oh", "organization_plan": "op", "organization_pre_receive_hooks": "opr", diff --git a/github/github-accessors.go b/github/github-accessors.go index 421922d33db..98985def895 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -8822,6 +8822,14 @@ func (i *InstallationPermissions) GetActions() string { return *i.Actions } +// GetActionsVariables returns the ActionsVariables field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetActionsVariables() string { + if i == nil || i.ActionsVariables == nil { + return "" + } + return *i.ActionsVariables +} + // GetAdministration returns the Administration field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetAdministration() string { if i == nil || i.Administration == nil { @@ -8926,6 +8934,14 @@ func (i *InstallationPermissions) GetOrganizationAdministration() string { return *i.OrganizationAdministration } +// GetOrganizationCustomOrgRoles returns the OrganizationCustomOrgRoles field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetOrganizationCustomOrgRoles() string { + if i == nil || i.OrganizationCustomOrgRoles == nil { + return "" + } + return *i.OrganizationCustomOrgRoles +} + // GetOrganizationCustomProperties returns the OrganizationCustomProperties field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetOrganizationCustomProperties() string { if i == nil || i.OrganizationCustomProperties == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 8753c42b79e..f123be8f8c4 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -10338,6 +10338,16 @@ func TestInstallationPermissions_GetActions(tt *testing.T) { i.GetActions() } +func TestInstallationPermissions_GetActionsVariables(tt *testing.T) { + var zeroValue string + i := &InstallationPermissions{ActionsVariables: &zeroValue} + i.GetActionsVariables() + i = &InstallationPermissions{} + i.GetActionsVariables() + i = nil + i.GetActionsVariables() +} + func TestInstallationPermissions_GetAdministration(tt *testing.T) { var zeroValue string i := &InstallationPermissions{Administration: &zeroValue} @@ -10468,6 +10478,16 @@ func TestInstallationPermissions_GetOrganizationAdministration(tt *testing.T) { i.GetOrganizationAdministration() } +func TestInstallationPermissions_GetOrganizationCustomOrgRoles(tt *testing.T) { + var zeroValue string + i := &InstallationPermissions{OrganizationCustomOrgRoles: &zeroValue} + i.GetOrganizationCustomOrgRoles() + i = &InstallationPermissions{} + i.GetOrganizationCustomOrgRoles() + i = nil + i.GetOrganizationCustomOrgRoles() +} + func TestInstallationPermissions_GetOrganizationCustomProperties(tt *testing.T) { var zeroValue string i := &InstallationPermissions{OrganizationCustomProperties: &zeroValue} From a2b2fc8220b83beb988d71c56d2157e104369cb9 Mon Sep 17 00:00:00 2001 From: asultania-sc <156134989+asultania-sc@users.noreply.github.com> Date: Wed, 12 Jun 2024 06:21:12 -0700 Subject: [PATCH 465/751] Add role name to RepositoryPermissionLevel (#3188) Fixes: #3189. --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ github/repos_collaborators.go | 2 ++ 3 files changed, 20 insertions(+) diff --git a/github/github-accessors.go b/github/github-accessors.go index 98985def895..5a69f27f8cf 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -20094,6 +20094,14 @@ func (r *RepositoryPermissionLevel) GetPermission() string { return *r.Permission } +// GetRoleName returns the RoleName field if it's non-nil, zero value otherwise. +func (r *RepositoryPermissionLevel) GetRoleName() string { + if r == nil || r.RoleName == nil { + return "" + } + return *r.RoleName +} + // GetUser returns the User field. func (r *RepositoryPermissionLevel) GetUser() *User { if r == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index f123be8f8c4..bfe3c61e0f9 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -23327,6 +23327,16 @@ func TestRepositoryPermissionLevel_GetPermission(tt *testing.T) { r.GetPermission() } +func TestRepositoryPermissionLevel_GetRoleName(tt *testing.T) { + var zeroValue string + r := &RepositoryPermissionLevel{RoleName: &zeroValue} + r.GetRoleName() + r = &RepositoryPermissionLevel{} + r.GetRoleName() + r = nil + r.GetRoleName() +} + func TestRepositoryPermissionLevel_GetUser(tt *testing.T) { r := &RepositoryPermissionLevel{} r.GetUser() diff --git a/github/repos_collaborators.go b/github/repos_collaborators.go index 15a4e77a2f1..d6c985359aa 100644 --- a/github/repos_collaborators.go +++ b/github/repos_collaborators.go @@ -99,6 +99,8 @@ type RepositoryPermissionLevel struct { Permission *string `json:"permission,omitempty"` User *User `json:"user,omitempty"` + + RoleName *string `json:"role_name,omitempty"` } // GetPermissionLevel retrieves the specific permission level a collaborator has for a given repository. From c70298ca0b6ce92b01d6d289b1ed6667b1b2a588 Mon Sep 17 00:00:00 2001 From: Luke Young Date: Sun, 16 Jun 2024 15:52:06 -0700 Subject: [PATCH 466/751] Fix go-githubauth link in README.md (#3191) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 06922ab780c..cbbcd485db9 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ For API methods that require HTTP Basic Authentication, use the #### As a GitHub App #### -GitHub Apps authentication can be provided by different pkgs like [ghinstallation](https://github.com/bradleyfalzon/ghinstallation) or [go-githubauth](github.com/jferrl/go-githubauth). +GitHub Apps authentication can be provided by different pkgs like [ghinstallation](https://github.com/bradleyfalzon/ghinstallation) or [go-githubauth](https://github.com/jferrl/go-githubauth). > **Note**: Most endpoints (ex. [`GET /rate_limit`]) require access token authentication > while a few others (ex. [`GET /app/hook/deliveries`]) require [JWT] authentication. From daf4f8b38a4ea35fb802618e145a9eecce7f77e9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 15:54:38 -0400 Subject: [PATCH 467/751] Bump codecov/codecov-action from 4.4.1 to 4.5.0 (#3193) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 485e3978a6e..d9e3d3bac02 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -73,4 +73,4 @@ jobs: - name: Upload coverage to Codecov if: ${{ matrix.update-coverage }} - uses: codecov/codecov-action@125fc84a9a348dbcf27191600683ec096ec9021c #v4.4.1 + uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 #v4.5.0 From 91449217b7254a4e9fcf63c18474b09de77c727d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 16:07:34 -0400 Subject: [PATCH 468/751] Bump github.com/getkin/kin-openapi from 0.124.0 to 0.125.0 in /tools (#3192) --- tools/go.mod | 2 +- tools/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index 26e9fe45a68..b2111ca5991 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -6,7 +6,7 @@ toolchain go1.22.0 require ( github.com/alecthomas/kong v0.9.0 - github.com/getkin/kin-openapi v0.124.0 + github.com/getkin/kin-openapi v0.125.0 github.com/google/go-cmp v0.6.0 github.com/google/go-github/v62 v62.0.0 golang.org/x/sync v0.7.0 diff --git a/tools/go.sum b/tools/go.sum index a9e50530749..fa703579224 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -6,8 +6,8 @@ github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/getkin/kin-openapi v0.124.0 h1:VSFNMB9C9rTKBnQ/fpyDU8ytMTr4dWI9QovSKj9kz/M= -github.com/getkin/kin-openapi v0.124.0/go.mod h1:wb1aSZA/iWmorQP9KTAS/phLj/t17B5jT7+fS8ed9NM= +github.com/getkin/kin-openapi v0.125.0 h1:jyQCyf2qXS1qvs2U00xQzkGCqYPhEhZDmSmVt65fXno= +github.com/getkin/kin-openapi v0.125.0/go.mod h1:wb1aSZA/iWmorQP9KTAS/phLj/t17B5jT7+fS8ed9NM= github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q= github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs= github.com/go-openapi/swag v0.22.8 h1:/9RjDSQ0vbFR+NyjGMkFTsA1IA0fmhKSThmfGZjicbw= From 42ae4fe2918071bae627539203680b2187a413a3 Mon Sep 17 00:00:00 2001 From: Clemens W Date: Wed, 26 Jun 2024 15:57:36 +0200 Subject: [PATCH 469/751] Add support in rulesets for including or excluding repos based on properties (#3194) --- github/github-accessors.go | 8 + github/github-accessors_test.go | 7 + github/orgs_rules_test.go | 530 ++++++++++++++++++++++++++++++++ github/repos_rules.go | 21 +- 4 files changed, 562 insertions(+), 4 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 5a69f27f8cf..5118791cdd2 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -20878,6 +20878,14 @@ func (r *RulesetConditions) GetRepositoryName() *RulesetRepositoryNamesCondition return r.RepositoryName } +// GetRepositoryProperty returns the RepositoryProperty field. +func (r *RulesetConditions) GetRepositoryProperty() *RulesetRepositoryPropertyConditionParameters { + if r == nil { + return nil + } + return r.RepositoryProperty +} + // GetHRef returns the HRef field if it's non-nil, zero value otherwise. func (r *RulesetLink) GetHRef() string { if r == nil || r.HRef == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index bfe3c61e0f9..03ebada64b1 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -24262,6 +24262,13 @@ func TestRulesetConditions_GetRepositoryName(tt *testing.T) { r.GetRepositoryName() } +func TestRulesetConditions_GetRepositoryProperty(tt *testing.T) { + r := &RulesetConditions{} + r.GetRepositoryProperty() + r = nil + r.GetRepositoryProperty() +} + func TestRulesetLink_GetHRef(tt *testing.T) { var zeroValue string r := &RulesetLink{HRef: &zeroValue} diff --git a/github/orgs_rules_test.go b/github/orgs_rules_test.go index 0ed54ca8d27..d45469f27e7 100644 --- a/github/orgs_rules_test.go +++ b/github/orgs_rules_test.go @@ -395,7 +395,342 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) return resp, err }) } +func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + mux.HandleFunc("/orgs/o/rulesets", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + fmt.Fprint(w, `{ + "id": 21, + "name": "ruleset", + "target": "branch", + "source_type": "Organization", + "source": "o", + "enforcement": "active", + "bypass_actors": [ + { + "actor_id": 234, + "actor_type": "Team" + } + ], + "conditions": { + "repository_property": { + "include": [ + { + "name": "testIncludeProp", + "source": "custom", + "property_values": [ + "true" + ] + } + ], + "exclude": [ + { + "name": "testExcludeProp", + "source": "custom", + "property_values": [ + "false" + ] + } + ] + } + }, + "rules": [ + { + "type": "creation" + }, + { + "type": "update", + "parameters": { + "update_allows_fetch_and_merge": true + } + }, + { + "type": "deletion" + }, + { + "type": "merge_queue" + }, + { + "type": "required_linear_history" + }, + { + "type": "required_deployments", + "parameters": { + "required_deployment_environments": ["test"] + } + }, + { + "type": "required_signatures" + }, + { + "type": "pull_request", + "parameters": { + "dismiss_stale_reviews_on_push": true, + "require_code_owner_review": true, + "require_last_push_approval": true, + "required_approving_review_count": 1, + "required_review_thread_resolution": true + } + }, + { + "type": "required_status_checks", + "parameters": { + "required_status_checks": [ + { + "context": "test", + "integration_id": 1 + } + ], + "strict_required_status_checks_policy": true + } + }, + { + "type": "non_fast_forward" + }, + { + "type": "commit_message_pattern", + "parameters": { + "name": "avoid test commits", + "negate": true, + "operator": "starts_with", + "pattern": "[test]" + } + }, + { + "type": "commit_author_email_pattern", + "parameters": { + "operator": "contains", + "pattern": "github" + } + }, + { + "type": "committer_email_pattern", + "parameters": { + "name": "avoid commit emails", + "negate": true, + "operator": "ends_with", + "pattern": "abc" + } + }, + { + "type": "branch_name_pattern", + "parameters": { + "name": "avoid branch names", + "negate": true, + "operator": "regex", + "pattern": "github$" + } + }, + { + "type": "tag_name_pattern", + "parameters": { + "name": "avoid tag names", + "negate": true, + "operator": "contains", + "pattern": "github" + } + } + ] + }`) + }) + + ctx := context.Background() + ruleset, _, err := client.Organizations.CreateOrganizationRuleset(ctx, "o", &Ruleset{ + ID: Int64(21), + Name: "ruleset", + Target: String("branch"), + SourceType: String("Organization"), + Source: "o", + Enforcement: "active", + BypassActors: []*BypassActor{ + { + ActorID: Int64(234), + ActorType: String("Team"), + }, + }, + Conditions: &RulesetConditions{ + RepositoryProperty: &RulesetRepositoryPropertyConditionParameters{ + Include: []RulesetRepositoryPropertyTargetParameters{ + { + Name: "testIncludeProp", + Values: []string{"true"}, + }, + }, + Exclude: []RulesetRepositoryPropertyTargetParameters{ + { + Name: "testExcludeProp", + Values: []string{"false"}, + }, + }, + }, + }, + Rules: []*RepositoryRule{ + NewCreationRule(), + NewUpdateRule(&UpdateAllowsFetchAndMergeRuleParameters{ + UpdateAllowsFetchAndMerge: true, + }), + NewDeletionRule(), + NewMergeQueueRule(), + NewRequiredLinearHistoryRule(), + NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ + RequiredDeploymentEnvironments: []string{"test"}, + }), + NewRequiredSignaturesRule(), + NewPullRequestRule(&PullRequestRuleParameters{ + RequireCodeOwnerReview: true, + RequireLastPushApproval: true, + RequiredApprovingReviewCount: 1, + RequiredReviewThreadResolution: true, + DismissStaleReviewsOnPush: true, + }), + NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ + RequiredStatusChecks: []RuleRequiredStatusChecks{ + { + Context: "test", + IntegrationID: Int64(1), + }, + }, + StrictRequiredStatusChecksPolicy: true, + }), + NewNonFastForwardRule(), + NewCommitMessagePatternRule(&RulePatternParameters{ + Name: String("avoid test commits"), + Negate: Bool(true), + Operator: "starts_with", + Pattern: "[test]", + }), + NewCommitAuthorEmailPatternRule(&RulePatternParameters{ + Operator: "contains", + Pattern: "github", + }), + NewCommitterEmailPatternRule(&RulePatternParameters{ + Name: String("avoid commit emails"), + Negate: Bool(true), + Operator: "ends_with", + Pattern: "abc", + }), + NewBranchNamePatternRule(&RulePatternParameters{ + Name: String("avoid branch names"), + Negate: Bool(true), + Operator: "regex", + Pattern: "github$", + }), + NewTagNamePatternRule(&RulePatternParameters{ + Name: String("avoid tag names"), + Negate: Bool(true), + Operator: "contains", + Pattern: "github", + }), + }, + }) + if err != nil { + t.Errorf("Organizations.CreateOrganizationRuleset returned error: %v", err) + } + + want := &Ruleset{ + ID: Int64(21), + Name: "ruleset", + Target: String("branch"), + SourceType: String("Organization"), + Source: "o", + Enforcement: "active", + BypassActors: []*BypassActor{ + { + ActorID: Int64(234), + ActorType: String("Team"), + }, + }, + Conditions: &RulesetConditions{ + RepositoryProperty: &RulesetRepositoryPropertyConditionParameters{ + Include: []RulesetRepositoryPropertyTargetParameters{ + { + Name: "testIncludeProp", + Values: []string{"true"}, + }, + }, + Exclude: []RulesetRepositoryPropertyTargetParameters{ + { + Name: "testExcludeProp", + Values: []string{"false"}, + }, + }, + }, + }, + Rules: []*RepositoryRule{ + NewCreationRule(), + NewUpdateRule(&UpdateAllowsFetchAndMergeRuleParameters{ + UpdateAllowsFetchAndMerge: true, + }), + NewDeletionRule(), + NewMergeQueueRule(), + NewRequiredLinearHistoryRule(), + NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ + RequiredDeploymentEnvironments: []string{"test"}, + }), + NewRequiredSignaturesRule(), + NewPullRequestRule(&PullRequestRuleParameters{ + RequireCodeOwnerReview: true, + RequireLastPushApproval: true, + RequiredApprovingReviewCount: 1, + RequiredReviewThreadResolution: true, + DismissStaleReviewsOnPush: true, + }), + NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ + RequiredStatusChecks: []RuleRequiredStatusChecks{ + { + Context: "test", + IntegrationID: Int64(1), + }, + }, + StrictRequiredStatusChecksPolicy: true, + }), + NewNonFastForwardRule(), + NewCommitMessagePatternRule(&RulePatternParameters{ + Name: String("avoid test commits"), + Negate: Bool(true), + Operator: "starts_with", + Pattern: "[test]", + }), + NewCommitAuthorEmailPatternRule(&RulePatternParameters{ + Operator: "contains", + Pattern: "github", + }), + NewCommitterEmailPatternRule(&RulePatternParameters{ + Name: String("avoid commit emails"), + Negate: Bool(true), + Operator: "ends_with", + Pattern: "abc", + }), + NewBranchNamePatternRule(&RulePatternParameters{ + Name: String("avoid branch names"), + Negate: Bool(true), + Operator: "regex", + Pattern: "github$", + }), + NewTagNamePatternRule(&RulePatternParameters{ + Name: String("avoid tag names"), + Negate: Bool(true), + Operator: "contains", + Pattern: "github", + }), + }, + } + if !cmp.Equal(ruleset, want) { + t.Errorf("Organizations.CreateOrganizationRuleset returned %+v, want %+v", ruleset, want) + } + + const methodName = "CreateOrganizationRuleset" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.CreateOrganizationRuleset(ctx, "o", nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { client, mux, _, teardown := setup() defer teardown() @@ -807,6 +1142,94 @@ func TestOrganizationsService_GetOrganizationRuleset(t *testing.T) { }) } +func TestOrganizationsService_GetOrganizationRulesetWithRepoPropCondition(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/rulesets/26110", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "id": 26110, + "name": "test ruleset", + "target": "branch", + "source_type": "Organization", + "source": "o", + "enforcement": "active", + "bypass_mode": "none", + "node_id": "nid", + "_links": { + "self": { + "href": "https://api.github.com/orgs/o/rulesets/26110" + } + }, + "conditions": { + "repository_property": { + "exclude": [], + "include": [ + { + "name": "testIncludeProp", + "source": "custom", + "property_values": [ + "true" + ] + } + ] + } + }, + "rules": [ + { + "type": "creation" + } + ] + }`) + }) + + ctx := context.Background() + rulesets, _, err := client.Organizations.GetOrganizationRuleset(ctx, "o", 26110) + if err != nil { + t.Errorf("Organizations.GetOrganizationRepositoryRuleset returned error: %v", err) + } + + want := &Ruleset{ + ID: Int64(26110), + Name: "test ruleset", + Target: String("branch"), + SourceType: String("Organization"), + Source: "o", + Enforcement: "active", + NodeID: String("nid"), + Links: &RulesetLinks{ + Self: &RulesetLink{HRef: String("https://api.github.com/orgs/o/rulesets/26110")}, + }, + Conditions: &RulesetConditions{ + RepositoryProperty: &RulesetRepositoryPropertyConditionParameters{ + Include: []RulesetRepositoryPropertyTargetParameters{ + { + Name: "testIncludeProp", + Values: []string{"true"}, + }, + }, + Exclude: []RulesetRepositoryPropertyTargetParameters{}, + }, + }, + Rules: []*RepositoryRule{ + NewCreationRule(), + }, + } + if !cmp.Equal(rulesets, want) { + t.Errorf("Organizations.GetOrganizationRuleset returned %+v, want %+v", rulesets, want) + } + + const methodName = "GetOrganizationRuleset" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.GetOrganizationRuleset(ctx, "o", 26110) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} func TestOrganizationsService_UpdateOrganizationRuleset(t *testing.T) { client, mux, _, teardown := setup() defer teardown() @@ -922,6 +1345,113 @@ func TestOrganizationsService_UpdateOrganizationRuleset(t *testing.T) { }) } +func TestOrganizationsService_UpdateOrganizationRulesetWithRepoProp(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/rulesets/26110", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + fmt.Fprint(w, `{ + "id": 26110, + "name": "test ruleset", + "target": "branch", + "source_type": "Organization", + "source": "o", + "enforcement": "active", + "bypass_mode": "none", + "node_id": "nid", + "_links": { + "self": { + "href": "https://api.github.com/orgs/o/rulesets/26110" + } + }, + "conditions": { + "repository_property": { + "exclude": [], + "include": [ + { + "name": "testIncludeProp", + "source": "custom", + "property_values": [ + "true" + ] + } + ] + } + }, + "rules": [ + { + "type": "creation" + } + ] + }`) + }) + + ctx := context.Background() + rulesets, _, err := client.Organizations.UpdateOrganizationRuleset(ctx, "o", 26110, &Ruleset{ + Name: "test ruleset", + Target: String("branch"), + Enforcement: "active", + Conditions: &RulesetConditions{ + RepositoryProperty: &RulesetRepositoryPropertyConditionParameters{ + Include: []RulesetRepositoryPropertyTargetParameters{ + { + Name: "testIncludeProp", + Values: []string{"true"}, + }, + }, + Exclude: []RulesetRepositoryPropertyTargetParameters{}, + }, + }, + Rules: []*RepositoryRule{ + NewCreationRule(), + }, + }) + + if err != nil { + t.Errorf("Organizations.UpdateOrganizationRuleset returned error: %v", err) + } + + want := &Ruleset{ + ID: Int64(26110), + Name: "test ruleset", + Target: String("branch"), + SourceType: String("Organization"), + Source: "o", + Enforcement: "active", + NodeID: String("nid"), + Links: &RulesetLinks{ + Self: &RulesetLink{HRef: String("https://api.github.com/orgs/o/rulesets/26110")}, + }, + Conditions: &RulesetConditions{ + RepositoryProperty: &RulesetRepositoryPropertyConditionParameters{ + Include: []RulesetRepositoryPropertyTargetParameters{ + { + Name: "testIncludeProp", + Values: []string{"true"}, + }, + }, + Exclude: []RulesetRepositoryPropertyTargetParameters{}, + }, + }, + Rules: []*RepositoryRule{ + NewCreationRule(), + }, + } + if !cmp.Equal(rulesets, want) { + t.Errorf("Organizations.UpdateOrganizationRuleset returned %+v, want %+v", rulesets, want) + } + + const methodName = "UpdateOrganizationRuleset" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.UpdateOrganizationRuleset(ctx, "o", 26110, nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} func TestOrganizationsService_DeleteOrganizationRuleset(t *testing.T) { client, mux, _, teardown := setup() defer teardown() diff --git a/github/repos_rules.go b/github/repos_rules.go index 6f046a356a6..e9148f2f03b 100644 --- a/github/repos_rules.go +++ b/github/repos_rules.go @@ -48,12 +48,25 @@ type RulesetRepositoryIDsConditionParameters struct { RepositoryIDs []int64 `json:"repository_ids,omitempty"` } +// RulesetRepositoryPropertyTargetParameters represents a repository_property name and values to be used for targeting. +type RulesetRepositoryPropertyTargetParameters struct { + Name string `json:"name"` + Values []string `json:"property_values"` +} + +// RulesetRepositoryPropertyConditionParameters represents the conditions object for repository_property. +type RulesetRepositoryPropertyConditionParameters struct { + Include []RulesetRepositoryPropertyTargetParameters `json:"include"` + Exclude []RulesetRepositoryPropertyTargetParameters `json:"exclude"` +} + // RulesetConditions represents the conditions object in a ruleset. -// Set either RepositoryName or RepositoryID, not both. +// Set either RepositoryName or RepositoryID or RepositoryProperty, not more than one. type RulesetConditions struct { - RefName *RulesetRefConditionParameters `json:"ref_name,omitempty"` - RepositoryName *RulesetRepositoryNamesConditionParameters `json:"repository_name,omitempty"` - RepositoryID *RulesetRepositoryIDsConditionParameters `json:"repository_id,omitempty"` + RefName *RulesetRefConditionParameters `json:"ref_name,omitempty"` + RepositoryName *RulesetRepositoryNamesConditionParameters `json:"repository_name,omitempty"` + RepositoryID *RulesetRepositoryIDsConditionParameters `json:"repository_id,omitempty"` + RepositoryProperty *RulesetRepositoryPropertyConditionParameters `json:"repository_property,omitempty"` } // RulePatternParameters represents the rule pattern parameters. From dd756703cb6b93cc8dc3e826799128c4e8707db6 Mon Sep 17 00:00:00 2001 From: Matt Simons Date: Tue, 2 Jul 2024 11:25:56 +0100 Subject: [PATCH 470/751] Add support for Enterprise GetRunner (#3185) Fixes: #3182. --- github/enterprise_actions_runners.go | 21 ++++++++++++ github/enterprise_actions_runners_test.go | 40 +++++++++++++++++++++++ 2 files changed, 61 insertions(+) diff --git a/github/enterprise_actions_runners.go b/github/enterprise_actions_runners.go index a5364815324..fa345aea8a9 100644 --- a/github/enterprise_actions_runners.go +++ b/github/enterprise_actions_runners.go @@ -101,6 +101,27 @@ func (s *EnterpriseService) ListRunners(ctx context.Context, enterprise string, return runners, resp, nil } +// GetRunner gets a specific self-hosted runner configured in an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/runners/{runner_id} +func (s *EnterpriseService) GetRunner(ctx context.Context, enterprise string, runnerID int64) (*Runner, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/runners/%v", enterprise, runnerID) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + runner := new(Runner) + resp, err := s.client.Do(ctx, req, runner) + if err != nil { + return nil, resp, err + } + + return runner, resp, nil +} + // RemoveRunner forces the removal of a self-hosted runner from an enterprise using the runner id. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-enterprise diff --git a/github/enterprise_actions_runners_test.go b/github/enterprise_actions_runners_test.go index 3bc3c737b89..d5efc6f7f03 100644 --- a/github/enterprise_actions_runners_test.go +++ b/github/enterprise_actions_runners_test.go @@ -145,6 +145,46 @@ func TestEnterpriseService_ListRunners(t *testing.T) { }) } +func TestEnterpriseService_GetRunner(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/enterprises/e/actions/runners/23", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"id":23,"name":"MBP","os":"macos","status":"online"}`) + }) + + ctx := context.Background() + runner, _, err := client.Enterprise.GetRunner(ctx, "e", 23) + if err != nil { + t.Errorf("Enterprise.GetRunner returned error: %v", err) + } + + want := &Runner{ + ID: Int64(23), + Name: String("MBP"), + OS: String("macos"), + Status: String("online"), + } + if !cmp.Equal(runner, want) { + t.Errorf("Enterprise.GetRunner returned %+v, want %+v", runner, want) + } + + const methodName = "GetRunner" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Enterprise.GetRunner(ctx, "\n", 23) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.GetRunner(ctx, "e", 23) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + func TestEnterpriseService_RemoveRunner(t *testing.T) { client, mux, _, teardown := setup() defer teardown() From c2a2574114fafd952be6be4be28884bed2e4af60 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 15:39:55 -0400 Subject: [PATCH 471/751] Bump golang.org/x/net from 0.26.0 to 0.27.0 in /scrape (#3201) --- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index ab67d8f31e6..b0105d959ff 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -9,7 +9,7 @@ require ( github.com/google/go-cmp v0.6.0 github.com/google/go-github/v61 v61.0.0 github.com/xlzd/gotp v0.1.0 - golang.org/x/net v0.26.0 + golang.org/x/net v0.27.0 ) require ( diff --git a/scrape/go.sum b/scrape/go.sum index 606899bf664..d7a889f5d41 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -21,8 +21,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= +golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= From 63de08b2ada64a19c3d8ef724f6aeaf8c0458b02 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 15:52:21 -0400 Subject: [PATCH 472/751] Bump github.com/getkin/kin-openapi from 0.125.0 to 0.126.0 in /tools (#3202) --- tools/go.mod | 8 ++++---- tools/go.sum | 21 ++++++++++----------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index b2111ca5991..9f3f2cfce4e 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -6,7 +6,7 @@ toolchain go1.22.0 require ( github.com/alecthomas/kong v0.9.0 - github.com/getkin/kin-openapi v0.125.0 + github.com/getkin/kin-openapi v0.126.0 github.com/google/go-cmp v0.6.0 github.com/google/go-github/v62 v62.0.0 golang.org/x/sync v0.7.0 @@ -14,10 +14,10 @@ require ( ) require ( - github.com/go-openapi/jsonpointer v0.20.2 // indirect - github.com/go-openapi/swag v0.22.8 // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect + github.com/go-openapi/swag v0.23.0 // indirect github.com/google/go-querystring v1.1.0 // indirect - github.com/invopop/yaml v0.2.0 // indirect + github.com/invopop/yaml v0.3.1 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect diff --git a/tools/go.sum b/tools/go.sum index fa703579224..3f75ab7255a 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -6,12 +6,12 @@ github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/getkin/kin-openapi v0.125.0 h1:jyQCyf2qXS1qvs2U00xQzkGCqYPhEhZDmSmVt65fXno= -github.com/getkin/kin-openapi v0.125.0/go.mod h1:wb1aSZA/iWmorQP9KTAS/phLj/t17B5jT7+fS8ed9NM= -github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q= -github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs= -github.com/go-openapi/swag v0.22.8 h1:/9RjDSQ0vbFR+NyjGMkFTsA1IA0fmhKSThmfGZjicbw= -github.com/go-openapi/swag v0.22.8/go.mod h1:6QT22icPLEqAM/z/TChgb4WAveCHF92+2gF0CNjHpPI= +github.com/getkin/kin-openapi v0.126.0 h1:c2cSgLnAsS0xYfKsgt5oBV6MYRM/giU8/RtwUY4wyfY= +github.com/getkin/kin-openapi v0.126.0/go.mod h1:7mONz8IwmSRg6RttPu6v8U/OJ+gr+J99qSFNjPGSQqw= +github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= +github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= +github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= +github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -21,8 +21,8 @@ github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= -github.com/invopop/yaml v0.2.0 h1:7zky/qH+O0DwAyoobXUqvVBwgBFRxKoQ/3FjcVpjTMY= -github.com/invopop/yaml v0.2.0/go.mod h1:2XuRLgs/ouIrW3XNzuNj7J3Nvu/Dig5MXvbCEdiBN3Q= +github.com/invopop/yaml v0.3.1 h1:f0+ZpmhfBSS4MhG+4HYseMdJhoeeopbSKbq5Rpeelso= +github.com/invopop/yaml v0.3.1/go.mod h1:PMOp3nn4/12yEZUFfmOuNHJsZToEEOwoWsT+D81KkeA= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -39,8 +39,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= @@ -49,6 +49,5 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From 2204dce82bbe1d8663c1dcbae8ee91175397bf55 Mon Sep 17 00:00:00 2001 From: Matthew William Reidy <48036844+Matthew-Reidy@users.noreply.github.com> Date: Tue, 9 Jul 2024 11:27:08 -0700 Subject: [PATCH 473/751] Allow an empty array of BypassActors in Ruleset struct in CreateRuleset endpoint (#3174) Fixes: #3137. --- github/repos_rules.go | 60 ++++++++++++++++++++++++++++++++++++++ github/repos_rules_test.go | 53 +++++++++++++++++++++++++++++++++ 2 files changed, 113 insertions(+) diff --git a/github/repos_rules.go b/github/repos_rules.go index e9148f2f03b..2827f85af1c 100644 --- a/github/repos_rules.go +++ b/github/repos_rules.go @@ -408,6 +408,24 @@ type Ruleset struct { Rules []*RepositoryRule `json:"rules,omitempty"` } +// rulesetNoOmitBypassActors represents a GitHub ruleset object. The struct does not omit bypassActors if the field is nil or an empty array is passed. +type rulesetNoOmitBypassActors struct { + ID *int64 `json:"id,omitempty"` + Name string `json:"name"` + // Possible values for Target are branch, tag + Target *string `json:"target,omitempty"` + // Possible values for SourceType are: Repository, Organization + SourceType *string `json:"source_type,omitempty"` + Source string `json:"source"` + // Possible values for Enforcement are: disabled, active, evaluate + Enforcement string `json:"enforcement"` + BypassActors []*BypassActor `json:"bypass_actors"` + NodeID *string `json:"node_id,omitempty"` + Links *RulesetLinks `json:"_links,omitempty"` + Conditions *RulesetConditions `json:"conditions,omitempty"` + Rules []*RepositoryRule `json:"rules,omitempty"` +} + // GetRulesForBranch gets all the rules that apply to the specified branch. // // GitHub API docs: https://docs.github.com/rest/repos/rules#get-rules-for-a-branch @@ -520,6 +538,48 @@ func (s *RepositoriesService) UpdateRuleset(ctx context.Context, owner, repo str return ruleset, resp, nil } +// UpdateRulesetNoBypassActor updates a ruleset for the specified repository. +// +// This function is necessary as the UpdateRuleset function does not marshal ByPassActor if passed as nil or an empty array. +// +// GitHub API docs: https://docs.github.com/rest/repos/rules#update-a-repository-ruleset +// +//meta:operation PUT /repos/{owner}/{repo}/rulesets/{ruleset_id} +func (s *RepositoriesService) UpdateRulesetNoBypassActor(ctx context.Context, owner, repo string, rulesetID int64, rs *Ruleset) (*Ruleset, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/rulesets/%v", owner, repo, rulesetID) + + rsNoBypassActor := &rulesetNoOmitBypassActors{} + + if rs != nil { + rsNoBypassActor = &rulesetNoOmitBypassActors{ + ID: rs.ID, + Name: rs.Name, + Target: rs.Target, + SourceType: rs.SourceType, + Source: rs.Source, + Enforcement: rs.Enforcement, + BypassActors: rs.BypassActors, + NodeID: rs.NodeID, + Links: rs.Links, + Conditions: rs.Conditions, + Rules: rs.Rules, + } + } + + req, err := s.client.NewRequest("PUT", u, rsNoBypassActor) + if err != nil { + return nil, nil, err + } + + var ruleSet *Ruleset + resp, err := s.client.Do(ctx, req, &ruleSet) + if err != nil { + return nil, resp, err + } + + return ruleSet, resp, nil +} + // DeleteRuleset deletes a ruleset for the specified repository. // // GitHub API docs: https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset diff --git a/github/repos_rules_test.go b/github/repos_rules_test.go index 23ffd3ed5c1..065d3385a3b 100644 --- a/github/repos_rules_test.go +++ b/github/repos_rules_test.go @@ -525,6 +525,58 @@ func TestRepositoriesService_GetRuleset(t *testing.T) { }) } +func TestRepositoriesService_UpdateRulesetNoBypassActor(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + rs := &Ruleset{ + Name: "ruleset", + Source: "o/repo", + Enforcement: "enabled", + } + + mux.HandleFunc("/repos/o/repo/rulesets/42", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + fmt.Fprint(w, `{ + "id": 42, + "name": "ruleset", + "source_type": "Repository", + "source": "o/repo", + "enforcement": "enabled" + }`) + }) + + ctx := context.Background() + + ruleSet, _, err := client.Repositories.UpdateRulesetNoBypassActor(ctx, "o", "repo", 42, rs) + + if err != nil { + t.Errorf("Repositories.UpdateRulesetNoBypassActor returned error: %v \n", err) + } + + want := &Ruleset{ + ID: Int64(42), + Name: "ruleset", + SourceType: String("Repository"), + Source: "o/repo", + Enforcement: "enabled", + } + + if !cmp.Equal(ruleSet, want) { + t.Errorf("Repositories.UpdateRulesetNoBypassActor returned %+v, want %+v", ruleSet, want) + } + + const methodName = "UpdateRulesetNoBypassActor" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.UpdateRulesetNoBypassActor(ctx, "o", "repo", 42, nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + func TestRepositoriesService_UpdateRuleset(t *testing.T) { client, mux, _, teardown := setup() defer teardown() @@ -556,6 +608,7 @@ func TestRepositoriesService_UpdateRuleset(t *testing.T) { Source: "o/repo", Enforcement: "enabled", } + if !cmp.Equal(ruleSet, want) { t.Errorf("Repositories.UpdateRuleset returned %+v, want %+v", ruleSet, want) } From 0c1bfb40662225c841ef9caf0f38adc09157dbc0 Mon Sep 17 00:00:00 2001 From: Roming22 Date: Wed, 10 Jul 2024 15:37:06 -0400 Subject: [PATCH 474/751] Add support for App Callback URLs (#3204) Fixes: #3203. --- scrape/apps.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scrape/apps.go b/scrape/apps.go index 7bb2d6f30d6..c2fc77c68b5 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -110,11 +110,14 @@ type OAuthApp struct { // AppManifest represents a GitHub App manifest, used for preconfiguring // GitHub App configuration. +// c.f. https://docs.github.com/en/apps/sharing-github-apps/registering-a-github-app-from-a-manifest type AppManifest struct { // The name of the GitHub App. Name *string `json:"name,omitempty"` //Required. The homepage of your GitHub App. URL *string `json:"url,omitempty"` + // The full URL(s) of the endpoint(s) to authenticate users via the GitHub App (Max: 10). + CallbackURLs []string `json:"callback_urls,omitempty"` // Required. The configuration of the GitHub App's webhook. HookAttributes map[string]string `json:"hook_attributes,omitempty"` // The full URL to redirect to after the person installs the GitHub App. From 173aa01e10b0260da38267a51f3b8d3141f76416 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Wed, 10 Jul 2024 16:11:33 -0400 Subject: [PATCH 475/751] Bump version of go-github to v63.0.0 (#3205) --- README.md | 17 +++++++++-------- example/actionpermissions/main.go | 2 +- example/appengine/app.go | 2 +- example/basicauth/main.go | 2 +- .../codespaces/newreposecretwithxcrypto/main.go | 2 +- .../codespaces/newusersecretwithxcrypto/main.go | 2 +- example/commitpr/main.go | 2 +- example/go.mod | 6 +++--- example/listenvironments/main.go | 2 +- example/migrations/main.go | 2 +- example/newfilewithappauth/main.go | 2 +- example/newrepo/main.go | 2 +- example/newreposecretwithlibsodium/go.mod | 4 ++-- example/newreposecretwithlibsodium/main.go | 2 +- example/newreposecretwithxcrypto/main.go | 2 +- example/ratelimit/main.go | 2 +- example/simple/main.go | 2 +- example/tagprotection/main.go | 2 +- example/tokenauth/main.go | 2 +- example/topics/main.go | 2 +- github/doc.go | 2 +- github/examples_test.go | 2 +- github/github.go | 2 +- go.mod | 2 +- test/fields/fields.go | 2 +- test/integration/activity_test.go | 2 +- test/integration/authorizations_test.go | 2 +- test/integration/github_test.go | 2 +- test/integration/repos_test.go | 2 +- test/integration/users_test.go | 2 +- tools/go.mod | 4 ++-- tools/metadata/main.go | 2 +- tools/metadata/main_test.go | 2 +- tools/metadata/metadata.go | 2 +- tools/metadata/openapi.go | 2 +- 35 files changed, 47 insertions(+), 46 deletions(-) diff --git a/README.md b/README.md index cbbcd485db9..8bf15aeec40 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-github # [![go-github release (latest SemVer)](https://img.shields.io/github/v/release/google/go-github?sort=semver)](https://github.com/google/go-github/releases) -[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v62/github) +[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v63/github) [![Test Status](https://github.com/google/go-github/workflows/tests/badge.svg)](https://github.com/google/go-github/actions?query=workflow%3Atests) [![Test Coverage](https://codecov.io/gh/google/go-github/branch/master/graph/badge.svg)](https://codecov.io/gh/google/go-github) [![Discuss at go-github@googlegroups.com](https://img.shields.io/badge/discuss-go--github%40googlegroups.com-blue.svg)](https://groups.google.com/group/go-github) @@ -24,7 +24,7 @@ If you're interested in using the [GraphQL API v4][], the recommended library is go-github is compatible with modern Go releases in module mode, with Go installed: ```bash -go get github.com/google/go-github/v62 +go get github.com/google/go-github/v63 ``` will resolve and add the package to the current development module, along with its dependencies. @@ -32,7 +32,7 @@ will resolve and add the package to the current development module, along with i Alternatively the same can be achieved if you use import in a package: ```go -import "github.com/google/go-github/v62/github" +import "github.com/google/go-github/v63/github" ``` and run `go get` without parameters. @@ -40,13 +40,13 @@ and run `go get` without parameters. Finally, to use the top-of-trunk version of this repo, use the following command: ```bash -go get github.com/google/go-github/v62@master +go get github.com/google/go-github/v63@master ``` ## Usage ## ```go -import "github.com/google/go-github/v62/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) +import "github.com/google/go-github/v63/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled ``` @@ -119,7 +119,7 @@ import ( "net/http" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v62/github" + "github.com/google/go-github/v63/github" ) func main() { @@ -153,7 +153,7 @@ import ( "os" "strconv" - "github.com/google/go-github/v62/github" + "github.com/google/go-github/v63/github" "github.com/jferrl/go-githubauth" "golang.org/x/oauth2" ) @@ -342,7 +342,7 @@ For complete usage of go-github, see the full [package docs][]. [GitHub API v3]: https://docs.github.com/en/rest [personal access token]: https://github.com/blog/1509-personal-api-tokens -[package docs]: https://pkg.go.dev/github.com/google/go-github/v62/github +[package docs]: https://pkg.go.dev/github.com/google/go-github/v63/github [GraphQL API v4]: https://developer.github.com/v4/ [shurcooL/githubv4]: https://github.com/shurcooL/githubv4 [GitHub webhook events]: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads @@ -415,6 +415,7 @@ Versions prior to 48.2.0 are not listed. | go-github Version | GitHub v3 API Version | | ----------------- | --------------------- | +| 63.0.0 | 2022-11-28 | | 62.0.0 | 2022-11-28 | | 61.0.0 | 2022-11-28 | | 60.0.0 | 2022-11-28 | diff --git a/example/actionpermissions/main.go b/example/actionpermissions/main.go index c8b42e8fc89..775add69811 100644 --- a/example/actionpermissions/main.go +++ b/example/actionpermissions/main.go @@ -14,7 +14,7 @@ import ( "log" "os" - "github.com/google/go-github/v62/github" + "github.com/google/go-github/v63/github" ) var ( diff --git a/example/appengine/app.go b/example/appengine/app.go index ff400268f3c..e3e44ae1b84 100644 --- a/example/appengine/app.go +++ b/example/appengine/app.go @@ -12,7 +12,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v62/github" + "github.com/google/go-github/v63/github" "google.golang.org/appengine" "google.golang.org/appengine/log" ) diff --git a/example/basicauth/main.go b/example/basicauth/main.go index 597b5b7e29d..ac02f474c3e 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -21,7 +21,7 @@ import ( "os" "strings" - "github.com/google/go-github/v62/github" + "github.com/google/go-github/v63/github" "golang.org/x/term" ) diff --git a/example/codespaces/newreposecretwithxcrypto/main.go b/example/codespaces/newreposecretwithxcrypto/main.go index aaada76a69e..e97161071ea 100644 --- a/example/codespaces/newreposecretwithxcrypto/main.go +++ b/example/codespaces/newreposecretwithxcrypto/main.go @@ -36,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v62/github" + "github.com/google/go-github/v63/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/codespaces/newusersecretwithxcrypto/main.go b/example/codespaces/newusersecretwithxcrypto/main.go index dbbca4b3e21..5c01d4e3703 100644 --- a/example/codespaces/newusersecretwithxcrypto/main.go +++ b/example/codespaces/newusersecretwithxcrypto/main.go @@ -37,7 +37,7 @@ import ( "log" "os" - "github.com/google/go-github/v62/github" + "github.com/google/go-github/v63/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index 36d71c49fd6..b892cf4b41a 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -33,7 +33,7 @@ import ( "time" "github.com/ProtonMail/go-crypto/openpgp" - "github.com/google/go-github/v62/github" + "github.com/google/go-github/v63/github" ) var ( diff --git a/example/go.mod b/example/go.mod index 4b6cdb2afe8..4dbc8dbf051 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v62/example +module github.com/google/go-github/v63/example go 1.21 @@ -6,7 +6,7 @@ require ( github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-ratelimit v1.0.3 - github.com/google/go-github/v62 v62.0.0 + github.com/google/go-github/v63 v63.0.0 golang.org/x/crypto v0.21.0 golang.org/x/term v0.18.0 google.golang.org/appengine v1.6.7 @@ -24,4 +24,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v62 => ../ +replace github.com/google/go-github/v63 => ../ diff --git a/example/listenvironments/main.go b/example/listenvironments/main.go index e640dec32a7..b0a5762ae8a 100644 --- a/example/listenvironments/main.go +++ b/example/listenvironments/main.go @@ -18,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v62/github" + "github.com/google/go-github/v63/github" ) func main() { diff --git a/example/migrations/main.go b/example/migrations/main.go index 7537e77a49e..2d70c750daa 100644 --- a/example/migrations/main.go +++ b/example/migrations/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v62/github" + "github.com/google/go-github/v63/github" ) func fetchAllUserMigrations() ([]*github.UserMigration, error) { diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index d4a7bc2dda2..aa266463c9f 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -16,7 +16,7 @@ import ( "time" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v62/github" + "github.com/google/go-github/v63/github" ) func main() { diff --git a/example/newrepo/main.go b/example/newrepo/main.go index bbcfddb553a..db895149a98 100644 --- a/example/newrepo/main.go +++ b/example/newrepo/main.go @@ -16,7 +16,7 @@ import ( "log" "os" - "github.com/google/go-github/v62/github" + "github.com/google/go-github/v63/github" ) var ( diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index d5eea34c2a6..730636c5369 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -6,10 +6,10 @@ toolchain go1.22.0 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb - github.com/google/go-github/v62 v62.0.0 + github.com/google/go-github/v63 v63.0.0 ) require github.com/google/go-querystring v1.1.0 // indirect // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v62 => ../.. +replace github.com/google/go-github/v63 => ../.. diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index 1508d6756ff..eb11043a5c7 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -36,7 +36,7 @@ import ( "os" sodium "github.com/GoKillers/libsodium-go/cryptobox" - "github.com/google/go-github/v62/github" + "github.com/google/go-github/v63/github" ) var ( diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index 8cdffa2b5d2..a3dcffdcc48 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -36,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v62/github" + "github.com/google/go-github/v63/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/ratelimit/main.go b/example/ratelimit/main.go index 7bf7c7142bc..ca531dbcf42 100644 --- a/example/ratelimit/main.go +++ b/example/ratelimit/main.go @@ -13,7 +13,7 @@ import ( "fmt" "github.com/gofri/go-github-ratelimit/github_ratelimit" - "github.com/google/go-github/v62/github" + "github.com/google/go-github/v63/github" ) func main() { diff --git a/example/simple/main.go b/example/simple/main.go index 8390377dc6c..7cdb6ca2b0c 100644 --- a/example/simple/main.go +++ b/example/simple/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v62/github" + "github.com/google/go-github/v63/github" ) // Fetch all the public organizations' membership of a user. diff --git a/example/tagprotection/main.go b/example/tagprotection/main.go index 994d53d0a09..2c867e677ee 100644 --- a/example/tagprotection/main.go +++ b/example/tagprotection/main.go @@ -18,7 +18,7 @@ import ( "os" "strings" - "github.com/google/go-github/v62/github" + "github.com/google/go-github/v63/github" "golang.org/x/term" ) diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index 557eb0fa4d2..d6fc018bc89 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -15,7 +15,7 @@ import ( "log" "os" - "github.com/google/go-github/v62/github" + "github.com/google/go-github/v63/github" "golang.org/x/term" ) diff --git a/example/topics/main.go b/example/topics/main.go index 6312588b5de..f096fbbce9c 100644 --- a/example/topics/main.go +++ b/example/topics/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v62/github" + "github.com/google/go-github/v63/github" ) // Fetch and lists all the public topics associated with the specified GitHub topic diff --git a/github/doc.go b/github/doc.go index e0c810871f2..1781a6a4af1 100644 --- a/github/doc.go +++ b/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v62/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v63/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to diff --git a/github/examples_test.go b/github/examples_test.go index 4abc289359e..d8db0303fa6 100644 --- a/github/examples_test.go +++ b/github/examples_test.go @@ -12,7 +12,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v62/github" + "github.com/google/go-github/v63/github" ) func ExampleMarkdownService_Render() { diff --git a/github/github.go b/github/github.go index 28a3c10bb28..cd0c0133396 100644 --- a/github/github.go +++ b/github/github.go @@ -28,7 +28,7 @@ import ( ) const ( - Version = "v62.0.0" + Version = "v63.0.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" diff --git a/go.mod b/go.mod index 8218224b110..0e3f7cf57ae 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v62 +module github.com/google/go-github/v63 require ( github.com/google/go-cmp v0.6.0 diff --git a/test/fields/fields.go b/test/fields/fields.go index 9cdfd8d1f50..e0d292e4acf 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -25,7 +25,7 @@ import ( "reflect" "strings" - "github.com/google/go-github/v62/github" + "github.com/google/go-github/v63/github" ) var ( diff --git a/test/integration/activity_test.go b/test/integration/activity_test.go index 2b9cc9e6302..24eabda8e51 100644 --- a/test/integration/activity_test.go +++ b/test/integration/activity_test.go @@ -12,7 +12,7 @@ import ( "context" "testing" - "github.com/google/go-github/v62/github" + "github.com/google/go-github/v63/github" ) const ( diff --git a/test/integration/authorizations_test.go b/test/integration/authorizations_test.go index 2ea5a6edbcd..8ae59174d78 100644 --- a/test/integration/authorizations_test.go +++ b/test/integration/authorizations_test.go @@ -15,7 +15,7 @@ import ( "testing" "time" - "github.com/google/go-github/v62/github" + "github.com/google/go-github/v63/github" ) const msgEnvMissing = "Skipping test because the required environment variable (%v) is not present." diff --git a/test/integration/github_test.go b/test/integration/github_test.go index 228d3c7b5a2..db47c7a5d64 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -15,7 +15,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v62/github" + "github.com/google/go-github/v63/github" ) var ( diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index f4837877f5b..924a79b4e8d 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -15,7 +15,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v62/github" + "github.com/google/go-github/v63/github" ) func TestRepositories_CRUD(t *testing.T) { diff --git a/test/integration/users_test.go b/test/integration/users_test.go index 6264ca9945d..2bfabc5be49 100644 --- a/test/integration/users_test.go +++ b/test/integration/users_test.go @@ -14,7 +14,7 @@ import ( "math/rand" "testing" - "github.com/google/go-github/v62/github" + "github.com/google/go-github/v63/github" ) func TestUsers_Get(t *testing.T) { diff --git a/tools/go.mod b/tools/go.mod index 9f3f2cfce4e..e29c7b2f622 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -8,7 +8,7 @@ require ( github.com/alecthomas/kong v0.9.0 github.com/getkin/kin-openapi v0.126.0 github.com/google/go-cmp v0.6.0 - github.com/google/go-github/v62 v62.0.0 + github.com/google/go-github/v63 v63.0.0 golang.org/x/sync v0.7.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -25,4 +25,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v62 => ../ +replace github.com/google/go-github/v63 => ../ diff --git a/tools/metadata/main.go b/tools/metadata/main.go index 153e5b76a3e..57039dc95ca 100644 --- a/tools/metadata/main.go +++ b/tools/metadata/main.go @@ -15,7 +15,7 @@ import ( "path/filepath" "github.com/alecthomas/kong" - "github.com/google/go-github/v62/github" + "github.com/google/go-github/v63/github" ) var helpVars = kong.Vars{ diff --git a/tools/metadata/main_test.go b/tools/metadata/main_test.go index 6d1013ae4cf..a1bc295d3a7 100644 --- a/tools/metadata/main_test.go +++ b/tools/metadata/main_test.go @@ -23,7 +23,7 @@ import ( "github.com/alecthomas/kong" "github.com/getkin/kin-openapi/openapi3" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v62/github" + "github.com/google/go-github/v63/github" ) func TestUpdateGo(t *testing.T) { diff --git a/tools/metadata/metadata.go b/tools/metadata/metadata.go index b37784dad94..0f94c658b5d 100644 --- a/tools/metadata/metadata.go +++ b/tools/metadata/metadata.go @@ -24,7 +24,7 @@ import ( "strings" "sync" - "github.com/google/go-github/v62/github" + "github.com/google/go-github/v63/github" "gopkg.in/yaml.v3" ) diff --git a/tools/metadata/openapi.go b/tools/metadata/openapi.go index d3cdbf0522c..f6c2db74329 100644 --- a/tools/metadata/openapi.go +++ b/tools/metadata/openapi.go @@ -14,7 +14,7 @@ import ( "strconv" "github.com/getkin/kin-openapi/openapi3" - "github.com/google/go-github/v62/github" + "github.com/google/go-github/v63/github" "golang.org/x/sync/errgroup" ) From 4583e71d7e3679aadeb3acf63f68c5af1a65e1e2 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Wed, 10 Jul 2024 16:53:13 -0400 Subject: [PATCH 476/751] Bump go-github from v61 to v63 in /scrape (#3206) --- scrape/apps.go | 2 +- scrape/apps_test.go | 2 +- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scrape/apps.go b/scrape/apps.go index c2fc77c68b5..0028a5724f8 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -17,7 +17,7 @@ import ( "strings" "github.com/PuerkitoBio/goquery" - "github.com/google/go-github/v61/github" + "github.com/google/go-github/v63/github" ) // AppRestrictionsEnabled returns whether the specified organization has diff --git a/scrape/apps_test.go b/scrape/apps_test.go index 65c88a787c1..339c685f98e 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v61/github" + "github.com/google/go-github/v63/github" ) func Test_AppRestrictionsEnabled(t *testing.T) { diff --git a/scrape/go.mod b/scrape/go.mod index b0105d959ff..47692f98b7a 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -7,7 +7,7 @@ toolchain go1.22.0 require ( github.com/PuerkitoBio/goquery v1.9.2 github.com/google/go-cmp v0.6.0 - github.com/google/go-github/v61 v61.0.0 + github.com/google/go-github/v63 v63.0.0 github.com/xlzd/gotp v0.1.0 golang.org/x/net v0.27.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index d7a889f5d41..d83a575d92b 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -5,8 +5,8 @@ github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6 github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v61 v61.0.0 h1:VwQCBwhyE9JclCI+22/7mLB1PuU9eowCXKY5pNlu1go= -github.com/google/go-github/v61 v61.0.0/go.mod h1:0WR+KmsWX75G2EbpyGsGmradjo3IiciuI4BmdVCobQY= +github.com/google/go-github/v63 v63.0.0 h1:13xwK/wk9alSokujB9lJkuzdmQuVn2QCPeck76wR3nE= +github.com/google/go-github/v63 v63.0.0/go.mod h1:IqbcrgUmIcEaioWrGYei/09o+ge5vhffGOcxrO0AfmA= 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.1.0 h1:37blvlKCh38s+fkem+fFh7sMnceltoIEBYTVXyoa5Po= From 5f496dddb88539d3e4fd0a1ee30b2f139e6736a7 Mon Sep 17 00:00:00 2001 From: Kevin Burke Date: Tue, 16 Jul 2024 10:32:12 -0700 Subject: [PATCH 477/751] Add doc for NewPullRequest (#3208) --- github/pulls.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/github/pulls.go b/github/pulls.go index 80df9fa688a..b668502691e 100644 --- a/github/pulls.go +++ b/github/pulls.go @@ -250,9 +250,16 @@ func (s *PullRequestsService) GetRaw(ctx context.Context, owner string, repo str // NewPullRequest represents a new pull request to be created. type NewPullRequest struct { - Title *string `json:"title,omitempty"` - Head *string `json:"head,omitempty"` - HeadRepo *string `json:"head_repo,omitempty"` + Title *string `json:"title,omitempty"` + // The name of the branch where your changes are implemented. For + // cross-repository pull requests in the same network, namespace head with + // a user like this: username:branch. + Head *string `json:"head,omitempty"` + HeadRepo *string `json:"head_repo,omitempty"` + // The name of the branch you want the changes pulled into. This should be + // an existing branch on the current repository. You cannot submit a pull + // request to one repository that requests a merge to a base of another + // repository. Base *string `json:"base,omitempty"` Body *string `json:"body,omitempty"` Issue *int `json:"issue,omitempty"` From 9f5309e067525bb5ce199504975b9649464886c8 Mon Sep 17 00:00:00 2001 From: Enrico Candino Date: Fri, 19 Jul 2024 14:44:23 +0200 Subject: [PATCH 478/751] Add Iterators section in README.md (#3212) Fixes: #3209. --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 8bf15aeec40..6c6bcd60da0 100644 --- a/README.md +++ b/README.md @@ -316,6 +316,25 @@ for { } ``` +#### Iterators (**experimental**) + +Go v1.23 introduces the new `iter` package. + +With the `enrichman/gh-iter` package, it is possible to create iterators for `go-github`. The iterator will handle pagination for you, looping through all the available results. + +```go +client := github.NewClient(nil) +var allRepos []*github.Repository + +// create an iterator and start looping through all the results +repos := ghiter.NewFromFn1(client.Repositories.ListByOrg, "github") +for repo := range repos.All() { + allRepos = append(allRepos, repo) +} +``` + +For complete usage of `enrichman/gh-iter`, see the full [package docs](https://github.com/enrichman/gh-iter). + ### Webhooks ### `go-github` provides structs for almost all [GitHub webhook events][] as well as functions to validate them and unmarshal JSON payloads from `http.Request` structs. From d5e03d538ecf2cd70676f3652ed7012e39342198 Mon Sep 17 00:00:00 2001 From: abhishek Date: Mon, 22 Jul 2024 08:08:18 +0530 Subject: [PATCH 479/751] Update CustomOrgRoles and CustomRepoRoles to include all fields returned by the GitHub API (#3216) Fixes: #3214. --- github/github-accessors.go | 64 +++++++++++++++++++ github/github-accessors_test.go | 74 ++++++++++++++++++++++ github/orgs_custom_roles.go | 26 +++++--- github/orgs_custom_roles_test.go | 103 +++++++++++++++++++++++++++++-- 4 files changed, 254 insertions(+), 13 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 5118791cdd2..03c7b3ca9ec 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -4702,6 +4702,22 @@ func (c *CustomDeploymentProtectionRuleRequest) GetIntegrationID() int64 { return *c.IntegrationID } +// GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise. +func (c *CustomOrgRoles) GetBaseRole() string { + if c == nil || c.BaseRole == nil { + return "" + } + return *c.BaseRole +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (c *CustomOrgRoles) GetCreatedAt() Timestamp { + if c == nil || c.CreatedAt == nil { + return Timestamp{} + } + return *c.CreatedAt +} + // GetDescription returns the Description field if it's non-nil, zero value otherwise. func (c *CustomOrgRoles) GetDescription() string { if c == nil || c.Description == nil { @@ -4726,6 +4742,30 @@ func (c *CustomOrgRoles) GetName() string { return *c.Name } +// GetOrg returns the Org field. +func (c *CustomOrgRoles) GetOrg() *Organization { + if c == nil { + return nil + } + return c.Org +} + +// GetSource returns the Source field if it's non-nil, zero value otherwise. +func (c *CustomOrgRoles) GetSource() string { + if c == nil || c.Source == nil { + return "" + } + return *c.Source +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (c *CustomOrgRoles) GetUpdatedAt() Timestamp { + if c == nil || c.UpdatedAt == nil { + return Timestamp{} + } + return *c.UpdatedAt +} + // GetDefaultValue returns the DefaultValue field if it's non-nil, zero value otherwise. func (c *CustomProperty) GetDefaultValue() string { if c == nil || c.DefaultValue == nil { @@ -4782,6 +4822,14 @@ func (c *CustomRepoRoles) GetBaseRole() string { return *c.BaseRole } +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (c *CustomRepoRoles) GetCreatedAt() Timestamp { + if c == nil || c.CreatedAt == nil { + return Timestamp{} + } + return *c.CreatedAt +} + // GetDescription returns the Description field if it's non-nil, zero value otherwise. func (c *CustomRepoRoles) GetDescription() string { if c == nil || c.Description == nil { @@ -4806,6 +4854,22 @@ func (c *CustomRepoRoles) GetName() string { return *c.Name } +// GetOrg returns the Org field. +func (c *CustomRepoRoles) GetOrg() *Organization { + if c == nil { + return nil + } + return c.Org +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (c *CustomRepoRoles) GetUpdatedAt() Timestamp { + if c == nil || c.UpdatedAt == nil { + return Timestamp{} + } + return *c.UpdatedAt +} + // GetQuerySuite returns the QuerySuite field if it's non-nil, zero value otherwise. func (d *DefaultSetupConfiguration) GetQuerySuite() string { if d == nil || d.QuerySuite == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 03ebada64b1..c19d501a4c6 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -5533,6 +5533,26 @@ func TestCustomDeploymentProtectionRuleRequest_GetIntegrationID(tt *testing.T) { c.GetIntegrationID() } +func TestCustomOrgRoles_GetBaseRole(tt *testing.T) { + var zeroValue string + c := &CustomOrgRoles{BaseRole: &zeroValue} + c.GetBaseRole() + c = &CustomOrgRoles{} + c.GetBaseRole() + c = nil + c.GetBaseRole() +} + +func TestCustomOrgRoles_GetCreatedAt(tt *testing.T) { + var zeroValue Timestamp + c := &CustomOrgRoles{CreatedAt: &zeroValue} + c.GetCreatedAt() + c = &CustomOrgRoles{} + c.GetCreatedAt() + c = nil + c.GetCreatedAt() +} + func TestCustomOrgRoles_GetDescription(tt *testing.T) { var zeroValue string c := &CustomOrgRoles{Description: &zeroValue} @@ -5563,6 +5583,33 @@ func TestCustomOrgRoles_GetName(tt *testing.T) { c.GetName() } +func TestCustomOrgRoles_GetOrg(tt *testing.T) { + c := &CustomOrgRoles{} + c.GetOrg() + c = nil + c.GetOrg() +} + +func TestCustomOrgRoles_GetSource(tt *testing.T) { + var zeroValue string + c := &CustomOrgRoles{Source: &zeroValue} + c.GetSource() + c = &CustomOrgRoles{} + c.GetSource() + c = nil + c.GetSource() +} + +func TestCustomOrgRoles_GetUpdatedAt(tt *testing.T) { + var zeroValue Timestamp + c := &CustomOrgRoles{UpdatedAt: &zeroValue} + c.GetUpdatedAt() + c = &CustomOrgRoles{} + c.GetUpdatedAt() + c = nil + c.GetUpdatedAt() +} + func TestCustomProperty_GetDefaultValue(tt *testing.T) { var zeroValue string c := &CustomProperty{DefaultValue: &zeroValue} @@ -5633,6 +5680,16 @@ func TestCustomRepoRoles_GetBaseRole(tt *testing.T) { c.GetBaseRole() } +func TestCustomRepoRoles_GetCreatedAt(tt *testing.T) { + var zeroValue Timestamp + c := &CustomRepoRoles{CreatedAt: &zeroValue} + c.GetCreatedAt() + c = &CustomRepoRoles{} + c.GetCreatedAt() + c = nil + c.GetCreatedAt() +} + func TestCustomRepoRoles_GetDescription(tt *testing.T) { var zeroValue string c := &CustomRepoRoles{Description: &zeroValue} @@ -5663,6 +5720,23 @@ func TestCustomRepoRoles_GetName(tt *testing.T) { c.GetName() } +func TestCustomRepoRoles_GetOrg(tt *testing.T) { + c := &CustomRepoRoles{} + c.GetOrg() + c = nil + c.GetOrg() +} + +func TestCustomRepoRoles_GetUpdatedAt(tt *testing.T) { + var zeroValue Timestamp + c := &CustomRepoRoles{UpdatedAt: &zeroValue} + c.GetUpdatedAt() + c = &CustomRepoRoles{} + c.GetUpdatedAt() + c = nil + c.GetUpdatedAt() +} + func TestDefaultSetupConfiguration_GetQuerySuite(tt *testing.T) { var zeroValue string d := &DefaultSetupConfiguration{QuerySuite: &zeroValue} diff --git a/github/orgs_custom_roles.go b/github/orgs_custom_roles.go index f71cb7aee03..dcbd79efa77 100644 --- a/github/orgs_custom_roles.go +++ b/github/orgs_custom_roles.go @@ -18,10 +18,15 @@ type OrganizationCustomRoles struct { // CustomOrgRoles represents custom organization role available in specified organization. type CustomOrgRoles struct { - ID *int64 `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Description *string `json:"description,omitempty"` - Permissions []string `json:"permissions,omitempty"` + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + Permissions []string `json:"permissions,omitempty"` + Org *Organization `json:"organization,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + Source *string `json:"source,omitempty"` + BaseRole *string `json:"base_role,omitempty"` } // OrganizationCustomRepoRoles represents custom repository roles available in specified organization. @@ -34,11 +39,14 @@ type OrganizationCustomRepoRoles struct { // See https://docs.github.com/enterprise-cloud@latest/organizations/managing-peoples-access-to-your-organization-with-roles/managing-custom-repository-roles-for-an-organization // for more information. type CustomRepoRoles struct { - ID *int64 `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Description *string `json:"description,omitempty"` - BaseRole *string `json:"base_role,omitempty"` - Permissions []string `json:"permissions,omitempty"` + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + BaseRole *string `json:"base_role,omitempty"` + Permissions []string `json:"permissions,omitempty"` + Org *Organization `json:"organization,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` } // CreateOrUpdateOrgRoleOptions represents options required to create or update a custom organization role. diff --git a/github/orgs_custom_roles_test.go b/github/orgs_custom_roles_test.go index c03b5a6d44b..338eac19fc1 100644 --- a/github/orgs_custom_roles_test.go +++ b/github/orgs_custom_roles_test.go @@ -10,6 +10,7 @@ import ( "fmt" "net/http" "testing" + "time" "github.com/google/go-cmp/cmp" ) @@ -20,7 +21,30 @@ func TestOrganizationsService_ListRoles(t *testing.T) { mux.HandleFunc("/orgs/o/organization-roles", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - fmt.Fprint(w, `{"total_count": 1, "roles": [{ "id": 1, "name": "Auditor", "permissions": ["read_audit_logs"]}]}`) + fmt.Fprint(w, `{"total_count": 1, "roles": [ + { + "id": 1, + "name": "Auditor", + "permissions": ["read_audit_logs"], + "organization": { + "login": "l", + "id": 1, + "node_id": "n", + "avatar_url": "a", + "html_url": "h", + "name": "n", + "company": "c", + "blog": "b", + "location": "l", + "email": "e" + }, + "created_at": "2024-07-21T19:33:08Z", + "updated_at": "2024-07-21T19:33:08Z", + "source": "Organization", + "base_role": "admin" + } + ] + }`) }) ctx := context.Background() @@ -29,7 +53,32 @@ func TestOrganizationsService_ListRoles(t *testing.T) { t.Errorf("Organizations.ListRoles returned error: %v", err) } - want := &OrganizationCustomRoles{TotalCount: Int(1), CustomRepoRoles: []*CustomOrgRoles{{ID: Int64(1), Name: String("Auditor"), Permissions: []string{"read_audit_logs"}}}} + want := &OrganizationCustomRoles{ + TotalCount: Int(1), + CustomRepoRoles: []*CustomOrgRoles{ + { + ID: Int64(1), + Name: String("Auditor"), + Permissions: []string{"read_audit_logs"}, + Org: &Organization{ + Login: String("l"), + ID: Int64(1), + NodeID: String("n"), + AvatarURL: String("a"), + HTMLURL: String("h"), + Name: String("n"), + Company: String("c"), + Blog: String("b"), + Location: String("l"), + Email: String("e"), + }, + CreatedAt: &Timestamp{time.Date(2024, time.July, 21, 19, 33, 8, 0, time.UTC)}, + UpdatedAt: &Timestamp{time.Date(2024, time.July, 21, 19, 33, 8, 0, time.UTC)}, + Source: String("Organization"), + BaseRole: String("admin"), + }, + }, + } if !cmp.Equal(apps, want) { t.Errorf("Organizations.ListRoles returned %+v, want %+v", apps, want) } @@ -169,7 +218,29 @@ func TestOrganizationsService_ListCustomRepoRoles(t *testing.T) { mux.HandleFunc("/orgs/o/custom-repository-roles", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - fmt.Fprint(w, `{"total_count": 1, "custom_roles": [{ "id": 1, "name": "Developer", "base_role": "write", "permissions": ["delete_alerts_code_scanning"]}]}`) + fmt.Fprint(w, `{"total_count": 1, "custom_roles": [ + { + "id": 1, + "name": "Developer", + "base_role": "write", + "permissions": ["delete_alerts_code_scanning"], + "organization": { + "login": "l", + "id": 1, + "node_id": "n", + "avatar_url": "a", + "html_url": "h", + "name": "n", + "company": "c", + "blog": "b", + "location": "l", + "email": "e" + }, + "created_at": "2024-07-21T19:33:08Z", + "updated_at": "2024-07-21T19:33:08Z" + } + ] + }`) }) ctx := context.Background() @@ -178,7 +249,31 @@ func TestOrganizationsService_ListCustomRepoRoles(t *testing.T) { t.Errorf("Organizations.ListCustomRepoRoles returned error: %v", err) } - want := &OrganizationCustomRepoRoles{TotalCount: Int(1), CustomRepoRoles: []*CustomRepoRoles{{ID: Int64(1), Name: String("Developer"), BaseRole: String("write"), Permissions: []string{"delete_alerts_code_scanning"}}}} + want := &OrganizationCustomRepoRoles{ + TotalCount: Int(1), + CustomRepoRoles: []*CustomRepoRoles{ + { + ID: Int64(1), + Name: String("Developer"), + BaseRole: String("write"), + Permissions: []string{"delete_alerts_code_scanning"}, + Org: &Organization{ + Login: String("l"), + ID: Int64(1), + NodeID: String("n"), + AvatarURL: String("a"), + HTMLURL: String("h"), + Name: String("n"), + Company: String("c"), + Blog: String("b"), + Location: String("l"), + Email: String("e"), + }, + CreatedAt: &Timestamp{time.Date(2024, time.July, 21, 19, 33, 8, 0, time.UTC)}, + UpdatedAt: &Timestamp{time.Date(2024, time.July, 21, 19, 33, 8, 0, time.UTC)}, + }, + }, + } if !cmp.Equal(apps, want) { t.Errorf("Organizations.ListCustomRepoRoles returned %+v, want %+v", apps, want) } From ff0223da9f9cde807b621166377b4ea7e341463f Mon Sep 17 00:00:00 2001 From: Ary Date: Tue, 23 Jul 2024 18:57:20 -0600 Subject: [PATCH 480/751] feat!: Add support for multi-select Custom Properties (#3200) Fixes #3198. BREAKING CHANGE: CustomPropertyValue.Value is changed from *string to interface{} to support string and []string values. --- github/github-accessors.go | 8 --- github/github-accessors_test.go | 10 ---- github/orgs_properties.go | 39 +++++++++++++- github/orgs_properties_test.go | 92 ++++++++++++++++++++++++++++++++- github/repos_properties_test.go | 22 ++++++-- 5 files changed, 146 insertions(+), 25 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 03c7b3ca9ec..9a96c8ebe0b 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -4806,14 +4806,6 @@ func (c *CustomProperty) GetValuesEditableBy() string { return *c.ValuesEditableBy } -// GetValue returns the Value field if it's non-nil, zero value otherwise. -func (c *CustomPropertyValue) GetValue() string { - if c == nil || c.Value == nil { - return "" - } - return *c.Value -} - // GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise. func (c *CustomRepoRoles) GetBaseRole() string { if c == nil || c.BaseRole == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index c19d501a4c6..c8c2e511b21 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -5660,16 +5660,6 @@ func TestCustomProperty_GetValuesEditableBy(tt *testing.T) { c.GetValuesEditableBy() } -func TestCustomPropertyValue_GetValue(tt *testing.T) { - var zeroValue string - c := &CustomPropertyValue{Value: &zeroValue} - c.GetValue() - c = &CustomPropertyValue{} - c.GetValue() - c = nil - c.GetValue() -} - func TestCustomRepoRoles_GetBaseRole(tt *testing.T) { var zeroValue string c := &CustomRepoRoles{BaseRole: &zeroValue} diff --git a/github/orgs_properties.go b/github/orgs_properties.go index 124b89cb5db..f7416d53008 100644 --- a/github/orgs_properties.go +++ b/github/orgs_properties.go @@ -7,6 +7,7 @@ package github import ( "context" + "encoding/json" "fmt" ) @@ -40,8 +41,42 @@ type RepoCustomPropertyValue struct { // CustomPropertyValue represents a custom property value. type CustomPropertyValue struct { - PropertyName string `json:"property_name"` - Value *string `json:"value,omitempty"` + PropertyName string `json:"property_name"` + Value interface{} `json:"value,omitempty"` +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +// This helps us handle the fact that Value can be either a string, []string, or nil. +func (cpv *CustomPropertyValue) UnmarshalJSON(data []byte) error { + type aliasCustomPropertyValue CustomPropertyValue + aux := &struct { + *aliasCustomPropertyValue + }{ + aliasCustomPropertyValue: (*aliasCustomPropertyValue)(cpv), + } + if err := json.Unmarshal(data, &aux); err != nil { + return err + } + + switch v := aux.Value.(type) { + case nil: + cpv.Value = nil + case string: + cpv.Value = v + case []interface{}: + strSlice := make([]string, len(v)) + for i, item := range v { + if str, ok := item.(string); ok { + strSlice[i] = str + } else { + return fmt.Errorf("non-string value in string array") + } + } + cpv.Value = strSlice + default: + return fmt.Errorf("unexpected value type: %T", v) + } + return nil } // GetAllCustomProperties gets all custom properties that are defined for the specified organization. diff --git a/github/orgs_properties_test.go b/github/orgs_properties_test.go index 59866fd98a7..2ef1f4536b9 100644 --- a/github/orgs_properties_test.go +++ b/github/orgs_properties_test.go @@ -296,6 +296,14 @@ func TestOrganizationsService_ListCustomPropertyValues(t *testing.T) { { "property_name": "service", "value": "web" + }, + { + "property_name": "languages", + "value": ["Go", "JavaScript"] + }, + { + "property_name": "null_property", + "value": null } ] }]`) @@ -318,11 +326,19 @@ func TestOrganizationsService_ListCustomPropertyValues(t *testing.T) { Properties: []*CustomPropertyValue{ { PropertyName: "environment", - Value: String("production"), + Value: "production", }, { PropertyName: "service", - Value: String("web"), + Value: "web", + }, + { + PropertyName: "languages", + Value: []string{"Go", "JavaScript"}, + }, + { + PropertyName: "null_property", + Value: nil, }, }, }, @@ -348,6 +364,78 @@ func TestOrganizationsService_ListCustomPropertyValues(t *testing.T) { }) } +func TestCustomPropertyValue_UnmarshalJSON(t *testing.T) { + tests := map[string]struct { + data string + want *CustomPropertyValue + wantErr bool + }{ + "Invalid JSON": { + data: `{`, + want: &CustomPropertyValue{}, + wantErr: true, + }, + "String value": { + data: `{ + "property_name": "environment", + "value": "production" + }`, + want: &CustomPropertyValue{ + PropertyName: "environment", + Value: "production", + }, + wantErr: false, + }, + "Array of strings value": { + data: `{ + "property_name": "languages", + "value": ["Go", "JavaScript"] + }`, + want: &CustomPropertyValue{ + PropertyName: "languages", + Value: []string{"Go", "JavaScript"}, + }, + wantErr: false, + }, + "Non-string value in array": { + data: `{ + "property_name": "languages", + "value": ["Go", 42] + }`, + want: &CustomPropertyValue{ + PropertyName: "languages", + Value: nil, + }, + wantErr: true, + }, + "Unexpected value type": { + data: `{ + "property_name": "environment", + "value": {"invalid": "type"} + }`, + want: &CustomPropertyValue{ + PropertyName: "environment", + Value: nil, + }, + wantErr: true, + }, + } + + for name, tc := range tests { + t.Run(name, func(t *testing.T) { + cpv := &CustomPropertyValue{} + err := cpv.UnmarshalJSON([]byte(tc.data)) + if (err != nil) != tc.wantErr { + t.Errorf("CustomPropertyValue.UnmarshalJSON error = %v, wantErr %v", err, tc.wantErr) + return + } + if !tc.wantErr && !cmp.Equal(tc.want, cpv) { + t.Errorf("CustomPropertyValue.UnmarshalJSON expected %+v, got %+v", tc.want, cpv) + } + }) + } +} + func TestOrganizationsService_CreateOrUpdateRepoCustomPropertyValues(t *testing.T) { client, mux, _, teardown := setup() defer teardown() diff --git a/github/repos_properties_test.go b/github/repos_properties_test.go index 5ce05c26d7b..4434856c8c2 100644 --- a/github/repos_properties_test.go +++ b/github/repos_properties_test.go @@ -28,6 +28,14 @@ func TestRepositoriesService_GetAllCustomPropertyValues(t *testing.T) { { "property_name": "service", "value": "web" + }, + { + "property_name": "languages", + "value": ["Go", "JavaScript"] + }, + { + "property_name": "null_property", + "value": null } ]`) }) @@ -41,11 +49,19 @@ func TestRepositoriesService_GetAllCustomPropertyValues(t *testing.T) { want := []*CustomPropertyValue{ { PropertyName: "environment", - Value: String("production"), + Value: "production", }, { PropertyName: "service", - Value: String("web"), + Value: "web", + }, + { + PropertyName: "languages", + Value: []string{"Go", "JavaScript"}, + }, + { + PropertyName: "null_property", + Value: nil, }, } @@ -77,7 +93,7 @@ func TestRepositoriesService_CreateOrUpdateCustomProperties(t *testing.T) { RepoCustomProperty := []*CustomPropertyValue{ { PropertyName: "environment", - Value: String("production"), + Value: "production", }, } _, err := client.Repositories.CreateOrUpdateCustomProperties(ctx, "usr", "r", RepoCustomProperty) From 2cdb0eafa1f010eda02de3556e25ae8989214be0 Mon Sep 17 00:00:00 2001 From: Alexey Alekhin Date: Wed, 24 Jul 2024 03:56:37 +0200 Subject: [PATCH 481/751] feat!: Replace ListCursorOptions with ListIDPGroupsOptions in TeamsService.ListIDPGroupsInOrganization (#3197) Fixes #3196. BREAKING CHANGE: Replace ListCursorOptions with ListIDPGroupsOptions in TeamsService.ListIDPGroupsInOrganization --- github/teams.go | 10 +++++++++- github/teams_test.go | 6 +++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/github/teams.go b/github/teams.go index 0f6cc9d16e4..b44e9418c05 100644 --- a/github/teams.go +++ b/github/teams.go @@ -796,6 +796,14 @@ func (s *TeamsService) RemoveTeamProjectBySlug(ctx context.Context, org, slug st return s.client.Do(ctx, req, nil) } +// ListIDPGroupsOptions specifies the optional parameters to the ListIDPGroupsInOrganization method. +type ListIDPGroupsOptions struct { + // Filters the results to return only those that begin with the value specified by this parameter. + Query string `url:"q,omitempty"` + + ListCursorOptions +} + // IDPGroupList represents a list of external identity provider (IDP) groups. type IDPGroupList struct { Groups []*IDPGroup `json:"groups"` @@ -813,7 +821,7 @@ type IDPGroup struct { // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#list-idp-groups-for-an-organization // //meta:operation GET /orgs/{org}/team-sync/groups -func (s *TeamsService) ListIDPGroupsInOrganization(ctx context.Context, org string, opts *ListCursorOptions) (*IDPGroupList, *Response, error) { +func (s *TeamsService) ListIDPGroupsInOrganization(ctx context.Context, org string, opts *ListIDPGroupsOptions) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("orgs/%v/team-sync/groups", org) u, err := addOptions(u, opts) if err != nil { diff --git a/github/teams_test.go b/github/teams_test.go index 516c88f43ae..bb4fa4eac38 100644 --- a/github/teams_test.go +++ b/github/teams_test.go @@ -1302,11 +1302,15 @@ func TestTeamsService_ListIDPGroupsInOrganization(t *testing.T) { testMethod(t, r, "GET") testFormValues(t, r, values{ "page": "url-encoded-next-page-token", + "q": "n", }) fmt.Fprint(w, `{"groups": [{"group_id": "1", "group_name": "n", "group_description": "d"}]}`) }) - opt := &ListCursorOptions{Page: "url-encoded-next-page-token"} + opt := &ListIDPGroupsOptions{ + Query: "n", + ListCursorOptions: ListCursorOptions{Page: "url-encoded-next-page-token"}, + } ctx := context.Background() groups, _, err := client.Teams.ListIDPGroupsInOrganization(ctx, "o", opt) if err != nil { From 020ef00cd841733048f836554efa4347a886bb72 Mon Sep 17 00:00:00 2001 From: Matt Simons Date: Thu, 25 Jul 2024 19:47:30 +0100 Subject: [PATCH 482/751] Revert "Add CommitID, InReplyTo, and SubjectType to DraftReviewComment" (#3218) Fixes: #3219. --- github/github-accessors.go | 24 ------------------------ github/github-accessors_test.go | 30 ------------------------------ github/github-stringify_test.go | 21 +++++++++------------ github/pulls_reviews.go | 9 +++------ 4 files changed, 12 insertions(+), 72 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 9a96c8ebe0b..02f33be3817 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -6606,22 +6606,6 @@ func (d *DraftReviewComment) GetBody() string { return *d.Body } -// GetCommitID returns the CommitID field if it's non-nil, zero value otherwise. -func (d *DraftReviewComment) GetCommitID() string { - if d == nil || d.CommitID == nil { - return "" - } - return *d.CommitID -} - -// GetInReplyTo returns the InReplyTo field if it's non-nil, zero value otherwise. -func (d *DraftReviewComment) GetInReplyTo() int64 { - if d == nil || d.InReplyTo == nil { - return 0 - } - return *d.InReplyTo -} - // GetLine returns the Line field if it's non-nil, zero value otherwise. func (d *DraftReviewComment) GetLine() int { if d == nil || d.Line == nil { @@ -6670,14 +6654,6 @@ func (d *DraftReviewComment) GetStartSide() string { return *d.StartSide } -// GetSubjectType returns the SubjectType field if it's non-nil, zero value otherwise. -func (d *DraftReviewComment) GetSubjectType() string { - if d == nil || d.SubjectType == nil { - return "" - } - return *d.SubjectType -} - // GetRef returns the Ref field. func (e *EditBase) GetRef() *EditRef { if e == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index c8c2e511b21..5ed92364126 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -7727,26 +7727,6 @@ func TestDraftReviewComment_GetBody(tt *testing.T) { d.GetBody() } -func TestDraftReviewComment_GetCommitID(tt *testing.T) { - var zeroValue string - d := &DraftReviewComment{CommitID: &zeroValue} - d.GetCommitID() - d = &DraftReviewComment{} - d.GetCommitID() - d = nil - d.GetCommitID() -} - -func TestDraftReviewComment_GetInReplyTo(tt *testing.T) { - var zeroValue int64 - d := &DraftReviewComment{InReplyTo: &zeroValue} - d.GetInReplyTo() - d = &DraftReviewComment{} - d.GetInReplyTo() - d = nil - d.GetInReplyTo() -} - func TestDraftReviewComment_GetLine(tt *testing.T) { var zeroValue int d := &DraftReviewComment{Line: &zeroValue} @@ -7807,16 +7787,6 @@ func TestDraftReviewComment_GetStartSide(tt *testing.T) { d.GetStartSide() } -func TestDraftReviewComment_GetSubjectType(tt *testing.T) { - var zeroValue string - d := &DraftReviewComment{SubjectType: &zeroValue} - d.GetSubjectType() - d = &DraftReviewComment{} - d.GetSubjectType() - d = nil - d.GetSubjectType() -} - func TestEditBase_GetRef(tt *testing.T) { e := &EditBase{} e.GetRef() diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index c311889c284..8633d837d12 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -388,18 +388,15 @@ func TestDiscussionComment_String(t *testing.T) { func TestDraftReviewComment_String(t *testing.T) { v := DraftReviewComment{ - Path: String(""), - Position: Int(0), - Body: String(""), - CommitID: String(""), - InReplyTo: Int64(0), - SubjectType: String(""), - StartSide: String(""), - Side: String(""), - StartLine: Int(0), - Line: Int(0), - } - want := `github.DraftReviewComment{Path:"", Position:0, Body:"", CommitID:"", InReplyTo:0, SubjectType:"", StartSide:"", Side:"", StartLine:0, Line:0}` + Path: String(""), + Position: Int(0), + Body: String(""), + StartSide: String(""), + Side: String(""), + StartLine: Int(0), + Line: Int(0), + } + want := `github.DraftReviewComment{Path:"", Position:0, Body:"", StartSide:"", Side:"", StartLine:0, Line:0}` if got := v.String(); got != want { t.Errorf("DraftReviewComment.String = %v, want %v", got, want) } diff --git a/github/pulls_reviews.go b/github/pulls_reviews.go index 28450c3d433..27b8dc37d5d 100644 --- a/github/pulls_reviews.go +++ b/github/pulls_reviews.go @@ -35,12 +35,9 @@ func (p PullRequestReview) String() string { // DraftReviewComment represents a comment part of the review. type DraftReviewComment struct { - Path *string `json:"path,omitempty"` - Position *int `json:"position,omitempty"` - Body *string `json:"body,omitempty"` - CommitID *string `json:"commit_id,omitempty"` - InReplyTo *int64 `json:"in_reply_to,omitempty"` - SubjectType *string `json:"subject_type,omitempty"` + Path *string `json:"path,omitempty"` + Position *int `json:"position,omitempty"` + Body *string `json:"body,omitempty"` // The new comfort-fade-preview fields StartSide *string `json:"start_side,omitempty"` From 7f7f1945b43824fc4479c54e4f022174f28552da Mon Sep 17 00:00:00 2001 From: Ary Date: Sat, 27 Jul 2024 14:58:04 -0600 Subject: [PATCH 483/751] Add List fine-grained personal access tokens with access to organization resources API (#3215) Fixes: #3213. --- github/github-accessors.go | 72 +++++++++++ github/github-accessors_test.go | 84 ++++++++++++ github/orgs_personal_access_tokens.go | 131 +++++++++++++++++++ github/orgs_personal_access_tokens_test.go | 141 +++++++++++++++++++++ 4 files changed, 428 insertions(+) diff --git a/github/github-accessors.go b/github/github-accessors.go index 02f33be3817..0b121aac7cb 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -14358,6 +14358,78 @@ func (p *PagesUpdate) GetSource() *PagesSource { return p.Source } +// GetAccessGrantedAt returns the AccessGrantedAt field if it's non-nil, zero value otherwise. +func (p *PersonalAccessToken) GetAccessGrantedAt() Timestamp { + if p == nil || p.AccessGrantedAt == nil { + return Timestamp{} + } + return *p.AccessGrantedAt +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (p *PersonalAccessToken) GetID() int64 { + if p == nil || p.ID == nil { + return 0 + } + return *p.ID +} + +// GetOwner returns the Owner field. +func (p *PersonalAccessToken) GetOwner() *User { + if p == nil { + return nil + } + return p.Owner +} + +// GetPermissions returns the Permissions field. +func (p *PersonalAccessToken) GetPermissions() *PersonalAccessTokenPermissions { + if p == nil { + return nil + } + return p.Permissions +} + +// GetRepositoriesURL returns the RepositoriesURL field if it's non-nil, zero value otherwise. +func (p *PersonalAccessToken) GetRepositoriesURL() string { + if p == nil || p.RepositoriesURL == nil { + return "" + } + return *p.RepositoriesURL +} + +// GetRepositorySelection returns the RepositorySelection field if it's non-nil, zero value otherwise. +func (p *PersonalAccessToken) GetRepositorySelection() string { + if p == nil || p.RepositorySelection == nil { + return "" + } + return *p.RepositorySelection +} + +// GetTokenExpired returns the TokenExpired field if it's non-nil, zero value otherwise. +func (p *PersonalAccessToken) GetTokenExpired() bool { + if p == nil || p.TokenExpired == nil { + return false + } + return *p.TokenExpired +} + +// GetTokenExpiresAt returns the TokenExpiresAt field if it's non-nil, zero value otherwise. +func (p *PersonalAccessToken) GetTokenExpiresAt() Timestamp { + if p == nil || p.TokenExpiresAt == nil { + return Timestamp{} + } + return *p.TokenExpiresAt +} + +// GetTokenLastUsedAt returns the TokenLastUsedAt field if it's non-nil, zero value otherwise. +func (p *PersonalAccessToken) GetTokenLastUsedAt() Timestamp { + if p == nil || p.TokenLastUsedAt == nil { + return Timestamp{} + } + return *p.TokenLastUsedAt +} + // GetOrg returns the Org map if it's non-nil, an empty map otherwise. func (p *PersonalAccessTokenPermissions) GetOrg() map[string]string { if p == nil || p.Org == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 5ed92364126..f41615c9e8e 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -16802,6 +16802,90 @@ func TestPagesUpdate_GetSource(tt *testing.T) { p.GetSource() } +func TestPersonalAccessToken_GetAccessGrantedAt(tt *testing.T) { + var zeroValue Timestamp + p := &PersonalAccessToken{AccessGrantedAt: &zeroValue} + p.GetAccessGrantedAt() + p = &PersonalAccessToken{} + p.GetAccessGrantedAt() + p = nil + p.GetAccessGrantedAt() +} + +func TestPersonalAccessToken_GetID(tt *testing.T) { + var zeroValue int64 + p := &PersonalAccessToken{ID: &zeroValue} + p.GetID() + p = &PersonalAccessToken{} + p.GetID() + p = nil + p.GetID() +} + +func TestPersonalAccessToken_GetOwner(tt *testing.T) { + p := &PersonalAccessToken{} + p.GetOwner() + p = nil + p.GetOwner() +} + +func TestPersonalAccessToken_GetPermissions(tt *testing.T) { + p := &PersonalAccessToken{} + p.GetPermissions() + p = nil + p.GetPermissions() +} + +func TestPersonalAccessToken_GetRepositoriesURL(tt *testing.T) { + var zeroValue string + p := &PersonalAccessToken{RepositoriesURL: &zeroValue} + p.GetRepositoriesURL() + p = &PersonalAccessToken{} + p.GetRepositoriesURL() + p = nil + p.GetRepositoriesURL() +} + +func TestPersonalAccessToken_GetRepositorySelection(tt *testing.T) { + var zeroValue string + p := &PersonalAccessToken{RepositorySelection: &zeroValue} + p.GetRepositorySelection() + p = &PersonalAccessToken{} + p.GetRepositorySelection() + p = nil + p.GetRepositorySelection() +} + +func TestPersonalAccessToken_GetTokenExpired(tt *testing.T) { + var zeroValue bool + p := &PersonalAccessToken{TokenExpired: &zeroValue} + p.GetTokenExpired() + p = &PersonalAccessToken{} + p.GetTokenExpired() + p = nil + p.GetTokenExpired() +} + +func TestPersonalAccessToken_GetTokenExpiresAt(tt *testing.T) { + var zeroValue Timestamp + p := &PersonalAccessToken{TokenExpiresAt: &zeroValue} + p.GetTokenExpiresAt() + p = &PersonalAccessToken{} + p.GetTokenExpiresAt() + p = nil + p.GetTokenExpiresAt() +} + +func TestPersonalAccessToken_GetTokenLastUsedAt(tt *testing.T) { + var zeroValue Timestamp + p := &PersonalAccessToken{TokenLastUsedAt: &zeroValue} + p.GetTokenLastUsedAt() + p = &PersonalAccessToken{} + p.GetTokenLastUsedAt() + p = nil + p.GetTokenLastUsedAt() +} + func TestPersonalAccessTokenPermissions_GetOrg(tt *testing.T) { zeroValue := map[string]string{} p := &PersonalAccessTokenPermissions{Org: zeroValue} diff --git a/github/orgs_personal_access_tokens.go b/github/orgs_personal_access_tokens.go index 0d786114f8c..af083744e85 100644 --- a/github/orgs_personal_access_tokens.go +++ b/github/orgs_personal_access_tokens.go @@ -9,8 +9,106 @@ import ( "context" "fmt" "net/http" + "net/url" + "strings" ) +// PersonalAccessToken represents the minimal representation of an organization programmatic access grant. +// +// GitHub API docs: https://docs.github.com/en/rest/orgs/personal-access-tokens?apiVersion=2022-11-28 +type PersonalAccessToken struct { + // "Unique identifier of the fine-grained personal access token. + // The `pat_id` used to get details about an approved fine-grained personal access token. + ID *int64 `json:"id"` + + // Owner is the GitHub user associated with the token. + Owner *User `json:"owner"` + + // RepositorySelection is the type of repository selection requested. + // Possible values are: "none", "all", "subset". + RepositorySelection *string `json:"repository_selection"` + + // URL to the list of repositories the fine-grained personal access token can access. + // Only follow when `repository_selection` is `subset`. + RepositoriesURL *string `json:"repositories_url"` + + // Permissions are the permissions requested, categorized by type. + Permissions *PersonalAccessTokenPermissions `json:"permissions"` + + // Date and time when the fine-grained personal access token was approved to access the organization. + AccessGrantedAt *Timestamp `json:"access_granted_at"` + + // Whether the associated fine-grained personal access token has expired. + TokenExpired *bool `json:"token_expired"` + + // Date and time when the associated fine-grained personal access token expires. + TokenExpiresAt *Timestamp `json:"token_expires_at"` + + // Date and time when the associated fine-grained personal access token was last used for authentication. + TokenLastUsedAt *Timestamp `json:"token_last_used_at"` +} + +// ListFineGrainedPATOptions specifies optional parameters to ListFineGrainedPersonalAccessTokens. +type ListFineGrainedPATOptions struct { + // The property by which to sort the results. + // Default: created_at + // Value: created_at + Sort string `url:"sort,omitempty"` + + // The direction to sort the results by. + // Default: desc + // Value: asc, desc + Direction string `url:"direction,omitempty"` + + // A list of owner usernames to use to filter the results. + Owner []string `url:"-"` + + // The name of the repository to use to filter the results. + Repository string `url:"repository,omitempty"` + + // The permission to use to filter the results. + Permission string `url:"permission,omitempty"` + + // Only show fine-grained personal access tokens used before the given time. + // This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. + LastUsedBefore string `url:"last_used_before,omitempty"` + + // Only show fine-grained personal access tokens used after the given time. + // This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. + LastUsedAfter string `url:"last_used_after,omitempty"` + + ListOptions +} + +// ListFineGrainedPersonalAccessTokens lists approved fine-grained personal access tokens owned by organization members that can access organization resources. +// Only GitHub Apps can call this API, using the `Personal access tokens` organization permissions (read). +// +// GitHub API docs: https://docs.github.com/rest/orgs/personal-access-tokens#list-fine-grained-personal-access-tokens-with-access-to-organization-resources +// +//meta:operation GET /orgs/{org}/personal-access-tokens +func (s *OrganizationsService) ListFineGrainedPersonalAccessTokens(ctx context.Context, org string, opts *ListFineGrainedPATOptions) ([]*PersonalAccessToken, *Response, error) { + u := fmt.Sprintf("orgs/%v/personal-access-tokens", org) + // The `owner` parameter is a special case that uses the `owner[]=...` format and needs a custom function to format it correctly. + u, err := addListFineGrainedPATOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest(http.MethodGet, u, opts) + if err != nil { + return nil, nil, err + } + + var pats []*PersonalAccessToken + + resp, err := s.client.Do(ctx, req, &pats) + if err != nil { + return nil, resp, err + } + + return pats, resp, nil +} + // ReviewPersonalAccessTokenRequestOptions specifies the parameters to the ReviewPersonalAccessTokenRequest method. type ReviewPersonalAccessTokenRequestOptions struct { Action string `json:"action"` @@ -34,3 +132,36 @@ func (s *OrganizationsService) ReviewPersonalAccessTokenRequest(ctx context.Cont return s.client.Do(ctx, req, nil) } + +// addListFineGrainedPATOptions adds the owner parameter to the URL query string with the correct format if it is set. +// +// GitHub API expects the owner parameter to be a list of strings in the `owner[]=...` format. +// For multiple owner values, the owner parameter is repeated in the query string. +// +// Example: +// owner[]=user1&owner[]=user2 +// This will filter the results to only include fine-grained personal access tokens owned by `user1` and `user2`. +// +// This function ensures the owner parameter is formatted correctly in the URL query string. +func addListFineGrainedPATOptions(s string, opts *ListFineGrainedPATOptions) (string, error) { + u, err := addOptions(s, opts) + if err != nil { + return s, err + } + + if len(opts.Owner) > 0 { + ownerVals := make([]string, len(opts.Owner)) + for i, owner := range opts.Owner { + ownerVals[i] = fmt.Sprintf("owner[]=%s", url.QueryEscape(owner)) + } + ownerQuery := strings.Join(ownerVals, "&") + + if strings.Contains(u, "?") { + u += "&" + ownerQuery + } else { + u += "?" + ownerQuery + } + } + + return u, nil +} diff --git a/github/orgs_personal_access_tokens_test.go b/github/orgs_personal_access_tokens_test.go index 9426385f4a6..83f55023f51 100644 --- a/github/orgs_personal_access_tokens_test.go +++ b/github/orgs_personal_access_tokens_test.go @@ -8,12 +8,153 @@ package github import ( "context" "encoding/json" + "fmt" "net/http" "testing" + "time" "github.com/google/go-cmp/cmp" ) +func TestOrganizationsService_ListFineGrainedPersonalAccessTokens(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/personal-access-tokens", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + expectedQuery := map[string][]string{ + "per_page": {"2"}, + "page": {"2"}, + "sort": {"created_at"}, + "direction": {"desc"}, + "owner[]": {"octocat", "octodog", "otherbot"}, + } + + query := r.URL.Query() + for key, expectedValues := range expectedQuery { + actualValues := query[key] + if len(actualValues) != len(expectedValues) { + t.Errorf("Expected %d values for query param %s, got %d", len(expectedValues), key, len(actualValues)) + } + for i, expectedValue := range expectedValues { + if actualValues[i] != expectedValue { + t.Errorf("Expected query param %s to be %s, got %s", key, expectedValue, actualValues[i]) + } + } + } + + fmt.Fprint(w, ` + [ + { + "id": 25381, + "owner": { + "login": "octocat", + "id": 1, + "node_id": "MDQ6VXNlcjE=", + "avatar_url": "https://github.com/images/error/octocat_happy.gif", + "gravatar_id": "", + "url": "https://api.github.com/users/octocat", + "html_url": "https://github.com/octocat", + "followers_url": "https://api.github.com/users/octocat/followers", + "following_url": "https://api.github.com/users/octocat/following{/other_user}", + "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", + "organizations_url": "https://api.github.com/users/octocat/orgs", + "repos_url": "https://api.github.com/users/octocat/repos", + "events_url": "https://api.github.com/users/octocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/octocat/received_events", + "type": "User", + "site_admin": false + }, + "repository_selection": "all", + "repositories_url": "https://api.github.com/organizations/652551/personal-access-tokens/25381/repositories", + "permissions": { + "organization": { + "members": "read" + }, + "repository": { + "metadata": "read" + } + }, + "access_granted_at": "2023-05-16T08:47:09.000-07:00", + "token_expired": false, + "token_expires_at": "2023-11-16T08:47:09.000-07:00", + "token_last_used_at": null + } + ]`) + }) + + opts := &ListFineGrainedPATOptions{ + ListOptions: ListOptions{Page: 2, PerPage: 2}, + Sort: "created_at", + Direction: "desc", + Owner: []string{"octocat", "octodog", "otherbot"}, + } + ctx := context.Background() + tokens, resp, err := client.Organizations.ListFineGrainedPersonalAccessTokens(ctx, "o", opts) + if err != nil { + t.Errorf("Organizations.ListFineGrainedPersonalAccessTokens returned error: %v", err) + } + + want := []*PersonalAccessToken{ + { + ID: Int64(25381), + Owner: &User{ + Login: String("octocat"), + ID: Int64(1), + NodeID: String("MDQ6VXNlcjE="), + AvatarURL: String("https://github.com/images/error/octocat_happy.gif"), + GravatarID: String(""), + URL: String("https://api.github.com/users/octocat"), + HTMLURL: String("https://github.com/octocat"), + FollowersURL: String("https://api.github.com/users/octocat/followers"), + FollowingURL: String("https://api.github.com/users/octocat/following{/other_user}"), + GistsURL: String("https://api.github.com/users/octocat/gists{/gist_id}"), + StarredURL: String("https://api.github.com/users/octocat/starred{/owner}{/repo}"), + SubscriptionsURL: String("https://api.github.com/users/octocat/subscriptions"), + OrganizationsURL: String("https://api.github.com/users/octocat/orgs"), + ReposURL: String("https://api.github.com/users/octocat/repos"), + EventsURL: String("https://api.github.com/users/octocat/events{/privacy}"), + ReceivedEventsURL: String("https://api.github.com/users/octocat/received_events"), + Type: String("User"), + SiteAdmin: Bool(false), + }, + RepositorySelection: String("all"), + RepositoriesURL: String("https://api.github.com/organizations/652551/personal-access-tokens/25381/repositories"), + Permissions: &PersonalAccessTokenPermissions{ + Org: map[string]string{"members": "read"}, + Repo: map[string]string{"metadata": "read"}, + }, + AccessGrantedAt: &Timestamp{time.Date(2023, time.May, 16, 8, 47, 9, 0, time.FixedZone("PDT", -7*60*60))}, + TokenExpired: Bool(false), + TokenExpiresAt: &Timestamp{time.Date(2023, time.November, 16, 8, 47, 9, 0, time.FixedZone("PDT", -7*60*60))}, + TokenLastUsedAt: nil, + }, + } + if !cmp.Equal(tokens, want) { + t.Errorf("Organizations.ListFineGrainedPersonalAccessTokens returned %+v, want %+v", tokens, want) + } + + if resp == nil { + t.Error("Organizations.ListFineGrainedPersonalAccessTokens returned nil response") + } + + const methodName = "ListFineGrainedPersonalAccessTokens" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.ListFineGrainedPersonalAccessTokens(ctx, "\n", opts) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.ListFineGrainedPersonalAccessTokens(ctx, "o", opts) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + func TestOrganizationsService_ReviewPersonalAccessTokenRequest(t *testing.T) { client, mux, _, teardown := setup() defer teardown() From f8929b80db0aee7b8b88ecb585a256d1bf43bf1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matheus=20Santos=20Ara=C3=BAjo?= Date: Mon, 29 Jul 2024 19:46:45 -0300 Subject: [PATCH 484/751] feat!: Add support for creating GitHub App with organizations (#3222) Fixes: #3210. BREAKING CHANGE: The CreateApp function now requires two arguments: `AppManifest` and `orgName`, to support creating apps with organizations. --- scrape/apps.go | 12 ++++++++++-- scrape/apps_test.go | 21 ++++++++++++++++++++- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/scrape/apps.go b/scrape/apps.go index 0028a5724f8..9f23227661e 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -12,6 +12,7 @@ import ( "bytes" "encoding/json" "errors" + "fmt" "net/http" "strconv" "strings" @@ -134,8 +135,15 @@ type AppManifest struct { } // CreateApp creates a new GitHub App with the given manifest configuration. -func (c *Client) CreateApp(m *AppManifest) (*http.Response, error) { - u, err := c.baseURL.Parse("/settings/apps/new") +// orgName is optional, and if provided, the App will be created within the specified organization. +func (c *Client) CreateApp(m *AppManifest, orgName string) (*http.Response, error) { + url := "/settings/apps/new" + + if orgName != "" { + url = fmt.Sprintf("/organizations/%v/settings/apps/new", orgName) + } + + u, err := c.baseURL.Parse(url) if err != nil { return nil, err } diff --git a/scrape/apps_test.go b/scrape/apps_test.go index 339c685f98e..2b88716b25e 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -97,7 +97,26 @@ func Test_CreateApp(t *testing.T) { HookAttributes: map[string]string{ "url": "https://example.com/hook", }, - }); err != nil { + }, ""); err != nil { t.Fatalf("CreateApp: %v", err) } } + +func Test_CreateAppWithOrg(t *testing.T) { + client, mux, cleanup := setup() + + defer cleanup() + + mux.HandleFunc("/organizations/example/apps/settings/new", func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusCreated) + }) + + if _, err := client.CreateApp(&AppManifest{ + URL: github.String("https://example.com"), + HookAttributes: map[string]string{ + "url": "https://example.com/hook", + }, + }, "example"); err != nil { + t.Fatalf("CreateAppWithOrg: %v", err) + } +} From efd3d99eba9f1d77acd485b0a66d45c68b5f9611 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 15:32:47 -0400 Subject: [PATCH 485/751] Bump github.com/getkin/kin-openapi from 0.126.0 to 0.127.0 in /tools (#3223) --- tools/go.mod | 2 +- tools/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index e29c7b2f622..64b05399527 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -6,7 +6,7 @@ toolchain go1.22.0 require ( github.com/alecthomas/kong v0.9.0 - github.com/getkin/kin-openapi v0.126.0 + github.com/getkin/kin-openapi v0.127.0 github.com/google/go-cmp v0.6.0 github.com/google/go-github/v63 v63.0.0 golang.org/x/sync v0.7.0 diff --git a/tools/go.sum b/tools/go.sum index 3f75ab7255a..ff2c38c69a6 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -6,8 +6,8 @@ github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/getkin/kin-openapi v0.126.0 h1:c2cSgLnAsS0xYfKsgt5oBV6MYRM/giU8/RtwUY4wyfY= -github.com/getkin/kin-openapi v0.126.0/go.mod h1:7mONz8IwmSRg6RttPu6v8U/OJ+gr+J99qSFNjPGSQqw= +github.com/getkin/kin-openapi v0.127.0 h1:Mghqi3Dhryf3F8vR370nN67pAERW+3a95vomb3MAREY= +github.com/getkin/kin-openapi v0.127.0/go.mod h1:OZrfXzUfGrNbsKj+xmFBx6E5c6yH3At/tAKSc2UszXM= github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= From 474a48f2a16e9f8325ef89ae78312529f6646bcd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 15:40:11 -0400 Subject: [PATCH 486/751] Bump golang.org/x/sync from 0.7.0 to 0.8.0 in /tools (#3224) --- tools/go.mod | 2 +- tools/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index 64b05399527..60b47d3f902 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -9,7 +9,7 @@ require ( github.com/getkin/kin-openapi v0.127.0 github.com/google/go-cmp v0.6.0 github.com/google/go-github/v63 v63.0.0 - golang.org/x/sync v0.7.0 + golang.org/x/sync v0.8.0 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/tools/go.sum b/tools/go.sum index ff2c38c69a6..9cff8611b5c 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -43,8 +43,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= From 436e1fd9b52e2dba98a16bc8b07aa4a5bcbf0148 Mon Sep 17 00:00:00 2001 From: Sven Palberg Date: Sun, 11 Aug 2024 03:37:23 +0200 Subject: [PATCH 487/751] feat!: Widen CustomProperties type to map[string]interface{} to align with GitHub API (#3230) Fixes: #3229. BREAKING CHANGE: PushEventRepository.CustomProperties is changed from map[string]string to map[string]interface{}. --- AUTHORS | 1 + github/event_types.go | 76 +++++++++++------------ github/github-accessors.go | 16 ----- github/github-accessors_test.go | 20 ------ github/repos.go | 106 ++++++++++++++++---------------- github/repos_test.go | 47 ++++++++++++++ 6 files changed, 139 insertions(+), 127 deletions(-) diff --git a/AUTHORS b/AUTHORS index 0197b94a23a..075ba8dfa3d 100644 --- a/AUTHORS +++ b/AUTHORS @@ -431,6 +431,7 @@ Steve Teuber Stian Eikeland Suhaib Mujahid sushmita wable +Sven Palberg Szymon Kodrebski Søren Hansen T.J. Corrigan diff --git a/github/event_types.go b/github/event_types.go index e5ae33a5fa0..df8d9e033e2 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -1348,44 +1348,44 @@ func (h HeadCommit) String() string { // PushEventRepository represents the repo object in a PushEvent payload. type PushEventRepository struct { - ID *int64 `json:"id,omitempty"` - NodeID *string `json:"node_id,omitempty"` - Name *string `json:"name,omitempty"` - FullName *string `json:"full_name,omitempty"` - Owner *User `json:"owner,omitempty"` - Private *bool `json:"private,omitempty"` - Description *string `json:"description,omitempty"` - Fork *bool `json:"fork,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - PushedAt *Timestamp `json:"pushed_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - Homepage *string `json:"homepage,omitempty"` - PullsURL *string `json:"pulls_url,omitempty"` - Size *int `json:"size,omitempty"` - StargazersCount *int `json:"stargazers_count,omitempty"` - WatchersCount *int `json:"watchers_count,omitempty"` - Language *string `json:"language,omitempty"` - HasIssues *bool `json:"has_issues,omitempty"` - HasDownloads *bool `json:"has_downloads,omitempty"` - HasWiki *bool `json:"has_wiki,omitempty"` - HasPages *bool `json:"has_pages,omitempty"` - ForksCount *int `json:"forks_count,omitempty"` - Archived *bool `json:"archived,omitempty"` - Disabled *bool `json:"disabled,omitempty"` - OpenIssuesCount *int `json:"open_issues_count,omitempty"` - DefaultBranch *string `json:"default_branch,omitempty"` - MasterBranch *string `json:"master_branch,omitempty"` - Organization *string `json:"organization,omitempty"` - URL *string `json:"url,omitempty"` - ArchiveURL *string `json:"archive_url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - StatusesURL *string `json:"statuses_url,omitempty"` - GitURL *string `json:"git_url,omitempty"` - SSHURL *string `json:"ssh_url,omitempty"` - CloneURL *string `json:"clone_url,omitempty"` - SVNURL *string `json:"svn_url,omitempty"` - Topics []string `json:"topics,omitempty"` - CustomProperties map[string]string `json:"custom_properties,omitempty"` + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Name *string `json:"name,omitempty"` + FullName *string `json:"full_name,omitempty"` + Owner *User `json:"owner,omitempty"` + Private *bool `json:"private,omitempty"` + Description *string `json:"description,omitempty"` + Fork *bool `json:"fork,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + PushedAt *Timestamp `json:"pushed_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + Homepage *string `json:"homepage,omitempty"` + PullsURL *string `json:"pulls_url,omitempty"` + Size *int `json:"size,omitempty"` + StargazersCount *int `json:"stargazers_count,omitempty"` + WatchersCount *int `json:"watchers_count,omitempty"` + Language *string `json:"language,omitempty"` + HasIssues *bool `json:"has_issues,omitempty"` + HasDownloads *bool `json:"has_downloads,omitempty"` + HasWiki *bool `json:"has_wiki,omitempty"` + HasPages *bool `json:"has_pages,omitempty"` + ForksCount *int `json:"forks_count,omitempty"` + Archived *bool `json:"archived,omitempty"` + Disabled *bool `json:"disabled,omitempty"` + OpenIssuesCount *int `json:"open_issues_count,omitempty"` + DefaultBranch *string `json:"default_branch,omitempty"` + MasterBranch *string `json:"master_branch,omitempty"` + Organization *string `json:"organization,omitempty"` + URL *string `json:"url,omitempty"` + ArchiveURL *string `json:"archive_url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + StatusesURL *string `json:"statuses_url,omitempty"` + GitURL *string `json:"git_url,omitempty"` + SSHURL *string `json:"ssh_url,omitempty"` + CloneURL *string `json:"clone_url,omitempty"` + SVNURL *string `json:"svn_url,omitempty"` + Topics []string `json:"topics,omitempty"` + CustomProperties map[string]interface{} `json:"custom_properties,omitempty"` } // PushEventRepoOwner is a basic representation of user/org in a PushEvent payload. diff --git a/github/github-accessors.go b/github/github-accessors.go index 0b121aac7cb..7d4a0782869 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -17726,14 +17726,6 @@ func (p *PushEventRepository) GetCreatedAt() Timestamp { return *p.CreatedAt } -// GetCustomProperties returns the CustomProperties map if it's non-nil, an empty map otherwise. -func (p *PushEventRepository) GetCustomProperties() map[string]string { - if p == nil || p.CustomProperties == nil { - return map[string]string{} - } - return p.CustomProperties -} - // GetDefaultBranch returns the DefaultBranch field if it's non-nil, zero value otherwise. func (p *PushEventRepository) GetDefaultBranch() string { if p == nil || p.DefaultBranch == nil { @@ -18878,14 +18870,6 @@ func (r *Repository) GetCreatedAt() Timestamp { return *r.CreatedAt } -// GetCustomProperties returns the CustomProperties map if it's non-nil, an empty map otherwise. -func (r *Repository) GetCustomProperties() map[string]string { - if r == nil || r.CustomProperties == nil { - return map[string]string{} - } - return r.CustomProperties -} - // GetDefaultBranch returns the DefaultBranch field if it's non-nil, zero value otherwise. func (r *Repository) GetDefaultBranch() string { if r == nil || r.DefaultBranch == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index f41615c9e8e..a401ecc1693 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -20520,16 +20520,6 @@ func TestPushEventRepository_GetCreatedAt(tt *testing.T) { p.GetCreatedAt() } -func TestPushEventRepository_GetCustomProperties(tt *testing.T) { - zeroValue := map[string]string{} - p := &PushEventRepository{CustomProperties: zeroValue} - p.GetCustomProperties() - p = &PushEventRepository{} - p.GetCustomProperties() - p = nil - p.GetCustomProperties() -} - func TestPushEventRepository_GetDefaultBranch(tt *testing.T) { var zeroValue string p := &PushEventRepository{DefaultBranch: &zeroValue} @@ -21891,16 +21881,6 @@ func TestRepository_GetCreatedAt(tt *testing.T) { r.GetCreatedAt() } -func TestRepository_GetCustomProperties(tt *testing.T) { - zeroValue := map[string]string{} - r := &Repository{CustomProperties: zeroValue} - r.GetCustomProperties() - r = &Repository{} - r.GetCustomProperties() - r = nil - r.GetCustomProperties() -} - func TestRepository_GetDefaultBranch(tt *testing.T) { var zeroValue string r := &Repository{DefaultBranch: &zeroValue} diff --git a/github/repos.go b/github/repos.go index 630ce748c94..59ef2329f07 100644 --- a/github/repos.go +++ b/github/repos.go @@ -27,59 +27,59 @@ 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"` - WebCommitSignoffRequired *bool `json:"web_commit_signoff_required,omitempty"` - DeleteBranchOnMerge *bool `json:"delete_branch_on_merge,omitempty"` - UseSquashPRTitleAsDefault *bool `json:"use_squash_pr_title_as_default,omitempty"` - SquashMergeCommitTitle *string `json:"squash_merge_commit_title,omitempty"` // Can be one of: "PR_TITLE", "COMMIT_OR_PR_TITLE" - SquashMergeCommitMessage *string `json:"squash_merge_commit_message,omitempty"` // Can be one of: "PR_BODY", "COMMIT_MESSAGES", "BLANK" - MergeCommitTitle *string `json:"merge_commit_title,omitempty"` // Can be one of: "PR_TITLE", "MERGE_MESSAGE" - MergeCommitMessage *string `json:"merge_commit_message,omitempty"` // Can be one of: "PR_BODY", "PR_TITLE", "BLANK" - Topics []string `json:"topics,omitempty"` - CustomProperties map[string]string `json:"custom_properties,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"` + WebCommitSignoffRequired *bool `json:"web_commit_signoff_required,omitempty"` + DeleteBranchOnMerge *bool `json:"delete_branch_on_merge,omitempty"` + UseSquashPRTitleAsDefault *bool `json:"use_squash_pr_title_as_default,omitempty"` + SquashMergeCommitTitle *string `json:"squash_merge_commit_title,omitempty"` // Can be one of: "PR_TITLE", "COMMIT_OR_PR_TITLE" + SquashMergeCommitMessage *string `json:"squash_merge_commit_message,omitempty"` // Can be one of: "PR_BODY", "COMMIT_MESSAGES", "BLANK" + MergeCommitTitle *string `json:"merge_commit_title,omitempty"` // Can be one of: "PR_TITLE", "MERGE_MESSAGE" + MergeCommitMessage *string `json:"merge_commit_message,omitempty"` // Can be one of: "PR_BODY", "PR_TITLE", "BLANK" + Topics []string `json:"topics,omitempty"` + CustomProperties map[string]interface{} `json:"custom_properties,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"` diff --git a/github/repos_test.go b/github/repos_test.go index e07b1b367d5..f18828067d1 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -14,6 +14,7 @@ import ( "net/url" "strings" "testing" + "time" "github.com/google/go-cmp/cmp" ) @@ -4463,3 +4464,49 @@ func TestRepositoriesService_IsPrivateReportingEnabled(t *testing.T) { return resp, err }) } + +func TestRepository_UnmarshalJSON(t *testing.T) { + var testCases = map[string]struct { + data []byte + wantRepository Repository + wantErr bool + }{ + "Empty": { + data: []byte("{}"), + wantRepository: Repository{}, + wantErr: false, + }, + "Invalid JSON": { + data: []byte("{"), + wantRepository: Repository{}, + wantErr: true, + }, + "Partial project": { + data: []byte(`{"id":10270722,"name":"go-github","private":false,"owner":{"login":"google"},"created_at":"2013-05-24T16:42:58Z","license":{},"topics":["github"],"permissions":{"pull":true},"custom_properties":{},"organization":{"login":"google"}}`), + wantRepository: Repository{ID: Int64(10270722), Name: String("go-github"), Private: Bool(false), Owner: &User{Login: String("google")}, CreatedAt: &Timestamp{time.Date(2013, 5, 24, 16, 42, 58, 0, time.UTC)}, License: &License{}, Topics: []string{"github"}, Permissions: map[string]bool{"pull": true}, CustomProperties: map[string]interface{}{}, Organization: &Organization{Login: String("google")}}, + wantErr: false, + }, + "With custom properties": { + data: []byte(`{"custom_properties":{"boolean":"false","text":"a","single-select":"a","multi-select":["a","b","c"]}}`), + wantRepository: Repository{CustomProperties: map[string]interface{}{"boolean": "false", "text": "a", "single-select": "a", "multi-select": []interface{}{"a", "b", "c"}}}, + wantErr: false, + }, + } + + for name, tt := range testCases { + tt := tt + t.Run(name, func(t *testing.T) { + pk := Repository{} + err := json.Unmarshal(tt.data, &pk) + if err == nil && tt.wantErr { + t.Errorf("Repository.UnmarshalJSON returned nil instead of an error") + } + if err != nil && !tt.wantErr { + t.Errorf("Repository.UnmarshalJSON returned an unexpected error: %+v", err) + } + if !cmp.Equal(tt.wantRepository, pk) { + t.Errorf("Repository.UnmarshalJSON expected repository %+v, got %+v", tt.wantRepository, pk) + } + }) + } +} From f5d28505b514ad93eec931e8ba6bbcf26cf5ad42 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2024 18:48:48 -0400 Subject: [PATCH 488/751] Bump golang.org/x/net from 0.27.0 to 0.28.0 in /scrape (#3234) --- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 47692f98b7a..700a000b92a 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -9,7 +9,7 @@ require ( github.com/google/go-cmp v0.6.0 github.com/google/go-github/v63 v63.0.0 github.com/xlzd/gotp v0.1.0 - golang.org/x/net v0.27.0 + golang.org/x/net v0.28.0 ) require ( diff --git a/scrape/go.sum b/scrape/go.sum index d83a575d92b..fb5ccf4397c 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -21,8 +21,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= -golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= -golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= From 3085a9c1cfcafe720f747faf153c86c56145411f Mon Sep 17 00:00:00 2001 From: Andriyun Date: Mon, 19 Aug 2024 13:00:07 +0200 Subject: [PATCH 489/751] Allow create custom repository/organization roles without permission (#3235) --- github/orgs_custom_roles.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/github/orgs_custom_roles.go b/github/orgs_custom_roles.go index dcbd79efa77..ca0c6d7bcba 100644 --- a/github/orgs_custom_roles.go +++ b/github/orgs_custom_roles.go @@ -53,7 +53,7 @@ type CustomRepoRoles struct { type CreateOrUpdateOrgRoleOptions struct { Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` - Permissions []string `json:"permissions,omitempty"` + Permissions []string `json:"permissions"` } // CreateOrUpdateCustomRepoRoleOptions represents options required to create or update a custom repository role. @@ -61,7 +61,7 @@ type CreateOrUpdateCustomRepoRoleOptions struct { Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` BaseRole *string `json:"base_role,omitempty"` - Permissions []string `json:"permissions,omitempty"` + Permissions []string `json:"permissions"` } // ListRoles lists the custom roles available in this organization. From 3f445924c81ddfa0f0222d75d21e28ab3c5e25d0 Mon Sep 17 00:00:00 2001 From: Graham Hargreaves Date: Mon, 19 Aug 2024 12:02:17 +0100 Subject: [PATCH 490/751] Add support for filepath repository rules (#3233) --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ github/repos_rules.go | 26 ++++++++++++++++++++++++++ github/repos_rules_test.go | 14 ++++++++++++++ 4 files changed, 58 insertions(+) diff --git a/github/github-accessors.go b/github/github-accessors.go index 7d4a0782869..86d3b28613c 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -20846,6 +20846,14 @@ func (r *Rule) GetSeverity() string { return *r.Severity } +// GetRestrictedFilePaths returns the RestrictedFilePaths field if it's non-nil, zero value otherwise. +func (r *RuleFileParameters) GetRestrictedFilePaths() []string { + if r == nil || r.RestrictedFilePaths == nil { + return nil + } + return *r.RestrictedFilePaths +} + // GetName returns the Name field if it's non-nil, zero value otherwise. func (r *RulePatternParameters) GetName() string { if r == nil || r.Name == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index a401ecc1693..11d8a3bff42 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -24225,6 +24225,16 @@ func TestRule_GetSeverity(tt *testing.T) { r.GetSeverity() } +func TestRuleFileParameters_GetRestrictedFilePaths(tt *testing.T) { + var zeroValue []string + r := &RuleFileParameters{RestrictedFilePaths: &zeroValue} + r.GetRestrictedFilePaths() + r = &RuleFileParameters{} + r.GetRestrictedFilePaths() + r = nil + r.GetRestrictedFilePaths() +} + func TestRulePatternParameters_GetName(tt *testing.T) { var zeroValue string r := &RulePatternParameters{Name: &zeroValue} diff --git a/github/repos_rules.go b/github/repos_rules.go index 2827f85af1c..17fa170cf99 100644 --- a/github/repos_rules.go +++ b/github/repos_rules.go @@ -79,6 +79,11 @@ type RulePatternParameters struct { Pattern string `json:"pattern"` } +// RuleFileParameters represents a list of file paths. +type RuleFileParameters struct { + RestrictedFilePaths *[]string `json:"restricted_file_paths"` +} + // UpdateAllowsFetchAndMergeRuleParameters represents the update rule parameters. type UpdateAllowsFetchAndMergeRuleParameters struct { UpdateAllowsFetchAndMerge bool `json:"update_allows_fetch_and_merge"` @@ -213,6 +218,15 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { bytes, _ := json.Marshal(params) rawParams := json.RawMessage(bytes) + r.Parameters = &rawParams + case "file_path_restriction": + params := RuleFileParameters{} + if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { + return err + } + bytes, _ := json.Marshal(params) + rawParams := json.RawMessage(bytes) + r.Parameters = &rawParams default: r.Type = "" @@ -390,6 +404,18 @@ func NewRequiredWorkflowsRule(params *RequiredWorkflowsRuleParameters) (rule *Re } } +// NewFilePathRestrictionRule creates a rule to restrict file paths from being pushed to. +func NewFilePathRestrictionRule(params *RuleFileParameters) (rule *RepositoryRule) { + bytes, _ := json.Marshal(params) + + rawParams := json.RawMessage(bytes) + + return &RepositoryRule{ + Type: "file_path_restriction", + Parameters: &rawParams, + } +} + // Ruleset represents a GitHub ruleset object. type Ruleset struct { ID *int64 `json:"id,omitempty"` diff --git a/github/repos_rules_test.go b/github/repos_rules_test.go index 065d3385a3b..c338e37e335 100644 --- a/github/repos_rules_test.go +++ b/github/repos_rules_test.go @@ -182,6 +182,20 @@ func TestRepositoryRule_UnmarshalJSON(t *testing.T) { }, wantErr: true, }, + "Valid file_path_restriction params": { + data: `{"type":"file_path_restriction","parameters":{"restricted_file_paths":["/a/file"]}}`, + want: NewFilePathRestrictionRule(&RuleFileParameters{ + RestrictedFilePaths: &[]string{"/a/file"}, + }), + }, + "Invalid file_path_restriction params": { + data: `{"type":"file_path_restriction","parameters":{"restricted_file_paths":true}}`, + want: &RepositoryRule{ + Type: "file_path_restriction", + Parameters: nil, + }, + wantErr: true, + }, "Valid pull_request params": { data: `{ "type":"pull_request", From 480e0733536e878fe9c05e6bc404efcecf412e71 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Tue, 20 Aug 2024 22:59:59 -0400 Subject: [PATCH 491/751] Bump version of go-github to v64.0.0 (#3240) --- README.md | 17 +++++++++-------- example/actionpermissions/main.go | 2 +- example/appengine/app.go | 2 +- example/basicauth/main.go | 2 +- .../codespaces/newreposecretwithxcrypto/main.go | 2 +- .../codespaces/newusersecretwithxcrypto/main.go | 2 +- example/commitpr/main.go | 2 +- example/go.mod | 6 +++--- example/listenvironments/main.go | 2 +- example/migrations/main.go | 2 +- example/newfilewithappauth/main.go | 2 +- example/newrepo/main.go | 2 +- example/newreposecretwithlibsodium/go.mod | 4 ++-- example/newreposecretwithlibsodium/main.go | 2 +- example/newreposecretwithxcrypto/main.go | 2 +- example/ratelimit/main.go | 2 +- example/simple/main.go | 2 +- example/tagprotection/main.go | 2 +- example/tokenauth/main.go | 2 +- example/topics/main.go | 2 +- github/doc.go | 2 +- github/examples_test.go | 2 +- github/github.go | 2 +- go.mod | 2 +- test/fields/fields.go | 2 +- test/integration/activity_test.go | 2 +- test/integration/authorizations_test.go | 2 +- test/integration/github_test.go | 2 +- test/integration/repos_test.go | 2 +- test/integration/users_test.go | 2 +- tools/go.mod | 4 ++-- tools/metadata/main.go | 2 +- tools/metadata/main_test.go | 2 +- tools/metadata/metadata.go | 2 +- tools/metadata/openapi.go | 2 +- 35 files changed, 47 insertions(+), 46 deletions(-) diff --git a/README.md b/README.md index 6c6bcd60da0..472ff43970b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-github # [![go-github release (latest SemVer)](https://img.shields.io/github/v/release/google/go-github?sort=semver)](https://github.com/google/go-github/releases) -[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v63/github) +[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v64/github) [![Test Status](https://github.com/google/go-github/workflows/tests/badge.svg)](https://github.com/google/go-github/actions?query=workflow%3Atests) [![Test Coverage](https://codecov.io/gh/google/go-github/branch/master/graph/badge.svg)](https://codecov.io/gh/google/go-github) [![Discuss at go-github@googlegroups.com](https://img.shields.io/badge/discuss-go--github%40googlegroups.com-blue.svg)](https://groups.google.com/group/go-github) @@ -24,7 +24,7 @@ If you're interested in using the [GraphQL API v4][], the recommended library is go-github is compatible with modern Go releases in module mode, with Go installed: ```bash -go get github.com/google/go-github/v63 +go get github.com/google/go-github/v64 ``` will resolve and add the package to the current development module, along with its dependencies. @@ -32,7 +32,7 @@ will resolve and add the package to the current development module, along with i Alternatively the same can be achieved if you use import in a package: ```go -import "github.com/google/go-github/v63/github" +import "github.com/google/go-github/v64/github" ``` and run `go get` without parameters. @@ -40,13 +40,13 @@ and run `go get` without parameters. Finally, to use the top-of-trunk version of this repo, use the following command: ```bash -go get github.com/google/go-github/v63@master +go get github.com/google/go-github/v64@master ``` ## Usage ## ```go -import "github.com/google/go-github/v63/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) +import "github.com/google/go-github/v64/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled ``` @@ -119,7 +119,7 @@ import ( "net/http" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v63/github" + "github.com/google/go-github/v64/github" ) func main() { @@ -153,7 +153,7 @@ import ( "os" "strconv" - "github.com/google/go-github/v63/github" + "github.com/google/go-github/v64/github" "github.com/jferrl/go-githubauth" "golang.org/x/oauth2" ) @@ -361,7 +361,7 @@ For complete usage of go-github, see the full [package docs][]. [GitHub API v3]: https://docs.github.com/en/rest [personal access token]: https://github.com/blog/1509-personal-api-tokens -[package docs]: https://pkg.go.dev/github.com/google/go-github/v63/github +[package docs]: https://pkg.go.dev/github.com/google/go-github/v64/github [GraphQL API v4]: https://developer.github.com/v4/ [shurcooL/githubv4]: https://github.com/shurcooL/githubv4 [GitHub webhook events]: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads @@ -434,6 +434,7 @@ Versions prior to 48.2.0 are not listed. | go-github Version | GitHub v3 API Version | | ----------------- | --------------------- | +| 64.0.0 | 2022-11-28 | | 63.0.0 | 2022-11-28 | | 62.0.0 | 2022-11-28 | | 61.0.0 | 2022-11-28 | diff --git a/example/actionpermissions/main.go b/example/actionpermissions/main.go index 775add69811..5624ee84b09 100644 --- a/example/actionpermissions/main.go +++ b/example/actionpermissions/main.go @@ -14,7 +14,7 @@ import ( "log" "os" - "github.com/google/go-github/v63/github" + "github.com/google/go-github/v64/github" ) var ( diff --git a/example/appengine/app.go b/example/appengine/app.go index e3e44ae1b84..d4a64dd44d9 100644 --- a/example/appengine/app.go +++ b/example/appengine/app.go @@ -12,7 +12,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v63/github" + "github.com/google/go-github/v64/github" "google.golang.org/appengine" "google.golang.org/appengine/log" ) diff --git a/example/basicauth/main.go b/example/basicauth/main.go index ac02f474c3e..45072f51a8b 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -21,7 +21,7 @@ import ( "os" "strings" - "github.com/google/go-github/v63/github" + "github.com/google/go-github/v64/github" "golang.org/x/term" ) diff --git a/example/codespaces/newreposecretwithxcrypto/main.go b/example/codespaces/newreposecretwithxcrypto/main.go index e97161071ea..e0a9d969948 100644 --- a/example/codespaces/newreposecretwithxcrypto/main.go +++ b/example/codespaces/newreposecretwithxcrypto/main.go @@ -36,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v63/github" + "github.com/google/go-github/v64/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/codespaces/newusersecretwithxcrypto/main.go b/example/codespaces/newusersecretwithxcrypto/main.go index 5c01d4e3703..5893224b111 100644 --- a/example/codespaces/newusersecretwithxcrypto/main.go +++ b/example/codespaces/newusersecretwithxcrypto/main.go @@ -37,7 +37,7 @@ import ( "log" "os" - "github.com/google/go-github/v63/github" + "github.com/google/go-github/v64/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index b892cf4b41a..35a5584aec9 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -33,7 +33,7 @@ import ( "time" "github.com/ProtonMail/go-crypto/openpgp" - "github.com/google/go-github/v63/github" + "github.com/google/go-github/v64/github" ) var ( diff --git a/example/go.mod b/example/go.mod index 4dbc8dbf051..9297353ee19 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v63/example +module github.com/google/go-github/v64/example go 1.21 @@ -6,7 +6,7 @@ require ( github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-ratelimit v1.0.3 - github.com/google/go-github/v63 v63.0.0 + github.com/google/go-github/v64 v64.0.0 golang.org/x/crypto v0.21.0 golang.org/x/term v0.18.0 google.golang.org/appengine v1.6.7 @@ -24,4 +24,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v63 => ../ +replace github.com/google/go-github/v64 => ../ diff --git a/example/listenvironments/main.go b/example/listenvironments/main.go index b0a5762ae8a..4edd0e1df69 100644 --- a/example/listenvironments/main.go +++ b/example/listenvironments/main.go @@ -18,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v63/github" + "github.com/google/go-github/v64/github" ) func main() { diff --git a/example/migrations/main.go b/example/migrations/main.go index 2d70c750daa..e56698862be 100644 --- a/example/migrations/main.go +++ b/example/migrations/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v63/github" + "github.com/google/go-github/v64/github" ) func fetchAllUserMigrations() ([]*github.UserMigration, error) { diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index aa266463c9f..3e64b0acbd5 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -16,7 +16,7 @@ import ( "time" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v63/github" + "github.com/google/go-github/v64/github" ) func main() { diff --git a/example/newrepo/main.go b/example/newrepo/main.go index db895149a98..014abe1c70d 100644 --- a/example/newrepo/main.go +++ b/example/newrepo/main.go @@ -16,7 +16,7 @@ import ( "log" "os" - "github.com/google/go-github/v63/github" + "github.com/google/go-github/v64/github" ) var ( diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index 730636c5369..1d2ce6a13c0 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -6,10 +6,10 @@ toolchain go1.22.0 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb - github.com/google/go-github/v63 v63.0.0 + github.com/google/go-github/v64 v64.0.0 ) require github.com/google/go-querystring v1.1.0 // indirect // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v63 => ../.. +replace github.com/google/go-github/v64 => ../.. diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index eb11043a5c7..661dc5f06dd 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -36,7 +36,7 @@ import ( "os" sodium "github.com/GoKillers/libsodium-go/cryptobox" - "github.com/google/go-github/v63/github" + "github.com/google/go-github/v64/github" ) var ( diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index a3dcffdcc48..107acc2d640 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -36,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v63/github" + "github.com/google/go-github/v64/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/ratelimit/main.go b/example/ratelimit/main.go index ca531dbcf42..f111e8d124c 100644 --- a/example/ratelimit/main.go +++ b/example/ratelimit/main.go @@ -13,7 +13,7 @@ import ( "fmt" "github.com/gofri/go-github-ratelimit/github_ratelimit" - "github.com/google/go-github/v63/github" + "github.com/google/go-github/v64/github" ) func main() { diff --git a/example/simple/main.go b/example/simple/main.go index 7cdb6ca2b0c..04456549509 100644 --- a/example/simple/main.go +++ b/example/simple/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v63/github" + "github.com/google/go-github/v64/github" ) // Fetch all the public organizations' membership of a user. diff --git a/example/tagprotection/main.go b/example/tagprotection/main.go index 2c867e677ee..5a356f40e38 100644 --- a/example/tagprotection/main.go +++ b/example/tagprotection/main.go @@ -18,7 +18,7 @@ import ( "os" "strings" - "github.com/google/go-github/v63/github" + "github.com/google/go-github/v64/github" "golang.org/x/term" ) diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index d6fc018bc89..8ad17bee6ef 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -15,7 +15,7 @@ import ( "log" "os" - "github.com/google/go-github/v63/github" + "github.com/google/go-github/v64/github" "golang.org/x/term" ) diff --git a/example/topics/main.go b/example/topics/main.go index f096fbbce9c..aa5226b2067 100644 --- a/example/topics/main.go +++ b/example/topics/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v63/github" + "github.com/google/go-github/v64/github" ) // Fetch and lists all the public topics associated with the specified GitHub topic diff --git a/github/doc.go b/github/doc.go index 1781a6a4af1..234b5068190 100644 --- a/github/doc.go +++ b/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v63/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v64/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to diff --git a/github/examples_test.go b/github/examples_test.go index d8db0303fa6..97a7a1e4075 100644 --- a/github/examples_test.go +++ b/github/examples_test.go @@ -12,7 +12,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v63/github" + "github.com/google/go-github/v64/github" ) func ExampleMarkdownService_Render() { diff --git a/github/github.go b/github/github.go index cd0c0133396..fcf958ef2f8 100644 --- a/github/github.go +++ b/github/github.go @@ -28,7 +28,7 @@ import ( ) const ( - Version = "v63.0.0" + Version = "v64.0.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" diff --git a/go.mod b/go.mod index 0e3f7cf57ae..1a3133d22ec 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v63 +module github.com/google/go-github/v64 require ( github.com/google/go-cmp v0.6.0 diff --git a/test/fields/fields.go b/test/fields/fields.go index e0d292e4acf..7897b2bd4fb 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -25,7 +25,7 @@ import ( "reflect" "strings" - "github.com/google/go-github/v63/github" + "github.com/google/go-github/v64/github" ) var ( diff --git a/test/integration/activity_test.go b/test/integration/activity_test.go index 24eabda8e51..434f7c846c7 100644 --- a/test/integration/activity_test.go +++ b/test/integration/activity_test.go @@ -12,7 +12,7 @@ import ( "context" "testing" - "github.com/google/go-github/v63/github" + "github.com/google/go-github/v64/github" ) const ( diff --git a/test/integration/authorizations_test.go b/test/integration/authorizations_test.go index 8ae59174d78..4dcf30a5a5d 100644 --- a/test/integration/authorizations_test.go +++ b/test/integration/authorizations_test.go @@ -15,7 +15,7 @@ import ( "testing" "time" - "github.com/google/go-github/v63/github" + "github.com/google/go-github/v64/github" ) const msgEnvMissing = "Skipping test because the required environment variable (%v) is not present." diff --git a/test/integration/github_test.go b/test/integration/github_test.go index db47c7a5d64..632772371fd 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -15,7 +15,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v63/github" + "github.com/google/go-github/v64/github" ) var ( diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index 924a79b4e8d..f94df2792e0 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -15,7 +15,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v63/github" + "github.com/google/go-github/v64/github" ) func TestRepositories_CRUD(t *testing.T) { diff --git a/test/integration/users_test.go b/test/integration/users_test.go index 2bfabc5be49..010a2dd5a9f 100644 --- a/test/integration/users_test.go +++ b/test/integration/users_test.go @@ -14,7 +14,7 @@ import ( "math/rand" "testing" - "github.com/google/go-github/v63/github" + "github.com/google/go-github/v64/github" ) func TestUsers_Get(t *testing.T) { diff --git a/tools/go.mod b/tools/go.mod index 60b47d3f902..fbbbf3bff5d 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -8,7 +8,7 @@ require ( github.com/alecthomas/kong v0.9.0 github.com/getkin/kin-openapi v0.127.0 github.com/google/go-cmp v0.6.0 - github.com/google/go-github/v63 v63.0.0 + github.com/google/go-github/v64 v64.0.0 golang.org/x/sync v0.8.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -25,4 +25,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v63 => ../ +replace github.com/google/go-github/v64 => ../ diff --git a/tools/metadata/main.go b/tools/metadata/main.go index 57039dc95ca..99e859b3036 100644 --- a/tools/metadata/main.go +++ b/tools/metadata/main.go @@ -15,7 +15,7 @@ import ( "path/filepath" "github.com/alecthomas/kong" - "github.com/google/go-github/v63/github" + "github.com/google/go-github/v64/github" ) var helpVars = kong.Vars{ diff --git a/tools/metadata/main_test.go b/tools/metadata/main_test.go index a1bc295d3a7..10a007e9f2c 100644 --- a/tools/metadata/main_test.go +++ b/tools/metadata/main_test.go @@ -23,7 +23,7 @@ import ( "github.com/alecthomas/kong" "github.com/getkin/kin-openapi/openapi3" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v63/github" + "github.com/google/go-github/v64/github" ) func TestUpdateGo(t *testing.T) { diff --git a/tools/metadata/metadata.go b/tools/metadata/metadata.go index 0f94c658b5d..1d844a4310a 100644 --- a/tools/metadata/metadata.go +++ b/tools/metadata/metadata.go @@ -24,7 +24,7 @@ import ( "strings" "sync" - "github.com/google/go-github/v63/github" + "github.com/google/go-github/v64/github" "gopkg.in/yaml.v3" ) diff --git a/tools/metadata/openapi.go b/tools/metadata/openapi.go index f6c2db74329..5fedb5ca387 100644 --- a/tools/metadata/openapi.go +++ b/tools/metadata/openapi.go @@ -14,7 +14,7 @@ import ( "strconv" "github.com/getkin/kin-openapi/openapi3" - "github.com/google/go-github/v63/github" + "github.com/google/go-github/v64/github" "golang.org/x/sync/errgroup" ) From 280d3274b2f19d31608ac06ba83f813edf0b5b26 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Tue, 20 Aug 2024 23:12:11 -0400 Subject: [PATCH 492/751] Bump go-github from v63 to v64 in /scrape (#3241) --- scrape/apps.go | 2 +- scrape/apps_test.go | 2 +- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scrape/apps.go b/scrape/apps.go index 9f23227661e..12ca7c0f136 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -18,7 +18,7 @@ import ( "strings" "github.com/PuerkitoBio/goquery" - "github.com/google/go-github/v63/github" + "github.com/google/go-github/v64/github" ) // AppRestrictionsEnabled returns whether the specified organization has diff --git a/scrape/apps_test.go b/scrape/apps_test.go index 2b88716b25e..331c021c82c 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v63/github" + "github.com/google/go-github/v64/github" ) func Test_AppRestrictionsEnabled(t *testing.T) { diff --git a/scrape/go.mod b/scrape/go.mod index 700a000b92a..4b58ef210c5 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -7,7 +7,7 @@ toolchain go1.22.0 require ( github.com/PuerkitoBio/goquery v1.9.2 github.com/google/go-cmp v0.6.0 - github.com/google/go-github/v63 v63.0.0 + github.com/google/go-github/v64 v64.0.0 github.com/xlzd/gotp v0.1.0 golang.org/x/net v0.28.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index fb5ccf4397c..9bdd671927d 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -5,8 +5,8 @@ github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6 github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v63 v63.0.0 h1:13xwK/wk9alSokujB9lJkuzdmQuVn2QCPeck76wR3nE= -github.com/google/go-github/v63 v63.0.0/go.mod h1:IqbcrgUmIcEaioWrGYei/09o+ge5vhffGOcxrO0AfmA= +github.com/google/go-github/v64 v64.0.0 h1:4G61sozmY3eiPAjjoOHponXDBONm+utovTKbyUb2Qdg= +github.com/google/go-github/v64 v64.0.0/go.mod h1:xB3vqMQNdHzilXBiO2I+M7iEFtHf+DP/omBOv6tQzVo= 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.1.0 h1:37blvlKCh38s+fkem+fFh7sMnceltoIEBYTVXyoa5Po= From de03f7b571ecb6bf52c6cfa3c35db71e9de6aafb Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Tue, 20 Aug 2024 23:44:04 -0400 Subject: [PATCH 493/751] Update workflow and tools to use Go 1.23 and 1.22 (#3242) --- .github/workflows/tests.yml | 2 +- .golangci.yml | 6 ++++-- script/lint.sh | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d9e3d3bac02..36ec9b31786 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,7 +24,7 @@ jobs: shell: bash strategy: matrix: - go-version: [1.x, 1.21.x] + go-version: [1.x, 1.22.x] platform: [ubuntu-latest] include: # include windows, but only with the latest Go version, since there diff --git a/.golangci.yml b/.golangci.yml index 79d8481fd63..5f602dd2636 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -23,6 +23,8 @@ linters-settings: # performance issue: see https://github.com/golangci/golangci-lint/issues/4039 # and https://github.com/securego/gosec/issues/1007 - G602 + # int(os.Stdin.Fd()) + - G115 issues: exclude-use-default: false exclude-rules: @@ -43,9 +45,9 @@ issues: text: 'G505: Blocklisted import crypto/sha1: weak cryptographic primitive' # This is adapted from golangci-lint's default exclusions. It disables linting for error checks on - # os.RemoveAll and any function ending in "Close". + # os.RemoveAll, fmt.Fprint*, fmt.Scanf, and any function ending in "Close". - linters: [ errcheck ] - text: Error return value of .(.*Close|os\.Remove(All)?). is not checked + text: Error return value of .(.*Close|fmt\.Fprint.*|fmt\.Scanf|os\.Remove(All)?). is not checked # We don't care about file inclusion via variable in examples or internal tools. - linters: [ gosec ] diff --git a/script/lint.sh b/script/lint.sh index b76758a47d4..ccd0cf1150c 100755 --- a/script/lint.sh +++ b/script/lint.sh @@ -5,7 +5,7 @@ set -e -GOLANGCI_LINT_VERSION="1.54.2" +GOLANGCI_LINT_VERSION="1.60.2" CDPATH="" cd -- "$(dirname -- "$0")/.." BIN="$(pwd -P)"/bin From 90bf4320bf6c2703f1c83918e30c5aaf6c93e795 Mon Sep 17 00:00:00 2001 From: Hi120ki <12624257+hi120ki@users.noreply.github.com> Date: Thu, 22 Aug 2024 00:00:54 +0900 Subject: [PATCH 494/751] Add Organization PAT fields to InstallationPermissions struct (#3243) --- github/apps.go | 82 +++++++++++++++++---------------- github/apps_test.go | 72 +++++++++++++++-------------- github/github-accessors.go | 16 +++++++ github/github-accessors_test.go | 20 ++++++++ 4 files changed, 116 insertions(+), 74 deletions(-) diff --git a/github/apps.go b/github/apps.go index 16ef758cbdd..2f74c2c2639 100644 --- a/github/apps.go +++ b/github/apps.go @@ -77,46 +77,48 @@ type InstallationTokenListRepoOptions struct { // https://docs.github.com/enterprise-server@3.0/rest/apps#create-an-installation-access-token-for-an-app // https://docs.github.com/rest/apps#create-an-installation-access-token-for-an-app type InstallationPermissions struct { - Actions *string `json:"actions,omitempty"` - ActionsVariables *string `json:"actions_variables,omitempty"` - Administration *string `json:"administration,omitempty"` - Blocking *string `json:"blocking,omitempty"` - Checks *string `json:"checks,omitempty"` - Contents *string `json:"contents,omitempty"` - ContentReferences *string `json:"content_references,omitempty"` - Deployments *string `json:"deployments,omitempty"` - Emails *string `json:"emails,omitempty"` - Environments *string `json:"environments,omitempty"` - Followers *string `json:"followers,omitempty"` - Issues *string `json:"issues,omitempty"` - Metadata *string `json:"metadata,omitempty"` - Members *string `json:"members,omitempty"` - OrganizationAdministration *string `json:"organization_administration,omitempty"` - OrganizationCustomProperties *string `json:"organization_custom_properties,omitempty"` - OrganizationCustomRoles *string `json:"organization_custom_roles,omitempty"` - OrganizationCustomOrgRoles *string `json:"organization_custom_org_roles,omitempty"` - OrganizationHooks *string `json:"organization_hooks,omitempty"` - OrganizationPackages *string `json:"organization_packages,omitempty"` - OrganizationPlan *string `json:"organization_plan,omitempty"` - OrganizationPreReceiveHooks *string `json:"organization_pre_receive_hooks,omitempty"` - OrganizationProjects *string `json:"organization_projects,omitempty"` - OrganizationSecrets *string `json:"organization_secrets,omitempty"` - OrganizationSelfHostedRunners *string `json:"organization_self_hosted_runners,omitempty"` - OrganizationUserBlocking *string `json:"organization_user_blocking,omitempty"` - Packages *string `json:"packages,omitempty"` - Pages *string `json:"pages,omitempty"` - PullRequests *string `json:"pull_requests,omitempty"` - RepositoryHooks *string `json:"repository_hooks,omitempty"` - RepositoryProjects *string `json:"repository_projects,omitempty"` - RepositoryPreReceiveHooks *string `json:"repository_pre_receive_hooks,omitempty"` - Secrets *string `json:"secrets,omitempty"` - SecretScanningAlerts *string `json:"secret_scanning_alerts,omitempty"` - SecurityEvents *string `json:"security_events,omitempty"` - SingleFile *string `json:"single_file,omitempty"` - Statuses *string `json:"statuses,omitempty"` - TeamDiscussions *string `json:"team_discussions,omitempty"` - VulnerabilityAlerts *string `json:"vulnerability_alerts,omitempty"` - Workflows *string `json:"workflows,omitempty"` + Actions *string `json:"actions,omitempty"` + ActionsVariables *string `json:"actions_variables,omitempty"` + Administration *string `json:"administration,omitempty"` + Blocking *string `json:"blocking,omitempty"` + Checks *string `json:"checks,omitempty"` + Contents *string `json:"contents,omitempty"` + ContentReferences *string `json:"content_references,omitempty"` + Deployments *string `json:"deployments,omitempty"` + Emails *string `json:"emails,omitempty"` + Environments *string `json:"environments,omitempty"` + Followers *string `json:"followers,omitempty"` + Issues *string `json:"issues,omitempty"` + Metadata *string `json:"metadata,omitempty"` + Members *string `json:"members,omitempty"` + OrganizationAdministration *string `json:"organization_administration,omitempty"` + OrganizationCustomProperties *string `json:"organization_custom_properties,omitempty"` + OrganizationCustomRoles *string `json:"organization_custom_roles,omitempty"` + OrganizationCustomOrgRoles *string `json:"organization_custom_org_roles,omitempty"` + OrganizationHooks *string `json:"organization_hooks,omitempty"` + OrganizationPackages *string `json:"organization_packages,omitempty"` + OrganizationPersonalAccessTokens *string `json:"organization_personal_access_tokens,omitempty"` + OrganizationPersonalAccessTokenRequests *string `json:"organization_personal_access_token_requests,omitempty"` + OrganizationPlan *string `json:"organization_plan,omitempty"` + OrganizationPreReceiveHooks *string `json:"organization_pre_receive_hooks,omitempty"` + OrganizationProjects *string `json:"organization_projects,omitempty"` + OrganizationSecrets *string `json:"organization_secrets,omitempty"` + OrganizationSelfHostedRunners *string `json:"organization_self_hosted_runners,omitempty"` + OrganizationUserBlocking *string `json:"organization_user_blocking,omitempty"` + Packages *string `json:"packages,omitempty"` + Pages *string `json:"pages,omitempty"` + PullRequests *string `json:"pull_requests,omitempty"` + RepositoryHooks *string `json:"repository_hooks,omitempty"` + RepositoryProjects *string `json:"repository_projects,omitempty"` + RepositoryPreReceiveHooks *string `json:"repository_pre_receive_hooks,omitempty"` + Secrets *string `json:"secrets,omitempty"` + SecretScanningAlerts *string `json:"secret_scanning_alerts,omitempty"` + SecurityEvents *string `json:"security_events,omitempty"` + SingleFile *string `json:"single_file,omitempty"` + Statuses *string `json:"statuses,omitempty"` + TeamDiscussions *string `json:"team_discussions,omitempty"` + VulnerabilityAlerts *string `json:"vulnerability_alerts,omitempty"` + Workflows *string `json:"workflows,omitempty"` } // InstallationRequest represents a pending GitHub App installation request. diff --git a/github/apps_test.go b/github/apps_test.go index bb060d7a052..aafc263dca0 100644 --- a/github/apps_test.go +++ b/github/apps_test.go @@ -149,6 +149,8 @@ func TestAppsService_ListInstallations(t *testing.T) { "organization_custom_roles": "write", "organization_hooks": "write", "organization_packages": "write", + "organization_personal_access_tokens": "read", + "organization_personal_access_token_requests": "read", "organization_plan": "read", "organization_pre_receive_hooks": "write", "organization_projects": "read", @@ -197,40 +199,42 @@ func TestAppsService_ListInstallations(t *testing.T) { SingleFileName: String("config.yml"), RepositorySelection: String("selected"), Permissions: &InstallationPermissions{ - Actions: String("read"), - Administration: String("read"), - Checks: String("read"), - Contents: String("read"), - ContentReferences: String("read"), - Deployments: String("read"), - Environments: String("read"), - Issues: String("write"), - Metadata: String("read"), - Members: String("read"), - OrganizationAdministration: String("write"), - OrganizationCustomRoles: String("write"), - OrganizationHooks: String("write"), - OrganizationPackages: String("write"), - OrganizationPlan: String("read"), - OrganizationPreReceiveHooks: String("write"), - OrganizationProjects: String("read"), - OrganizationSecrets: String("read"), - OrganizationSelfHostedRunners: String("read"), - OrganizationUserBlocking: String("write"), - Packages: String("read"), - Pages: String("read"), - PullRequests: String("write"), - RepositoryHooks: String("write"), - RepositoryProjects: String("read"), - RepositoryPreReceiveHooks: String("read"), - Secrets: String("read"), - SecretScanningAlerts: String("read"), - SecurityEvents: String("read"), - SingleFile: String("write"), - Statuses: String("write"), - TeamDiscussions: String("read"), - VulnerabilityAlerts: String("read"), - Workflows: String("write")}, + Actions: String("read"), + Administration: String("read"), + Checks: String("read"), + Contents: String("read"), + ContentReferences: String("read"), + Deployments: String("read"), + Environments: String("read"), + Issues: String("write"), + Metadata: String("read"), + Members: String("read"), + OrganizationAdministration: String("write"), + OrganizationCustomRoles: String("write"), + OrganizationHooks: String("write"), + OrganizationPackages: String("write"), + OrganizationPersonalAccessTokens: String("read"), + OrganizationPersonalAccessTokenRequests: String("read"), + OrganizationPlan: String("read"), + OrganizationPreReceiveHooks: String("write"), + OrganizationProjects: String("read"), + OrganizationSecrets: String("read"), + OrganizationSelfHostedRunners: String("read"), + OrganizationUserBlocking: String("write"), + Packages: String("read"), + Pages: String("read"), + PullRequests: String("write"), + RepositoryHooks: String("write"), + RepositoryProjects: String("read"), + RepositoryPreReceiveHooks: String("read"), + Secrets: String("read"), + SecretScanningAlerts: String("read"), + SecurityEvents: String("read"), + SingleFile: String("write"), + Statuses: String("write"), + TeamDiscussions: String("read"), + VulnerabilityAlerts: String("read"), + Workflows: String("write")}, Events: []string{"push", "pull_request"}, CreatedAt: &date, UpdatedAt: &date, diff --git a/github/github-accessors.go b/github/github-accessors.go index 86d3b28613c..66e9c0baef2 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -9006,6 +9006,22 @@ func (i *InstallationPermissions) GetOrganizationPackages() string { return *i.OrganizationPackages } +// GetOrganizationPersonalAccessTokenRequests returns the OrganizationPersonalAccessTokenRequests field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetOrganizationPersonalAccessTokenRequests() string { + if i == nil || i.OrganizationPersonalAccessTokenRequests == nil { + return "" + } + return *i.OrganizationPersonalAccessTokenRequests +} + +// GetOrganizationPersonalAccessTokens returns the OrganizationPersonalAccessTokens field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetOrganizationPersonalAccessTokens() string { + if i == nil || i.OrganizationPersonalAccessTokens == nil { + return "" + } + return *i.OrganizationPersonalAccessTokens +} + // GetOrganizationPlan returns the OrganizationPlan field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetOrganizationPlan() string { if i == nil || i.OrganizationPlan == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 11d8a3bff42..dde2c80bcf4 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -10562,6 +10562,26 @@ func TestInstallationPermissions_GetOrganizationPackages(tt *testing.T) { i.GetOrganizationPackages() } +func TestInstallationPermissions_GetOrganizationPersonalAccessTokenRequests(tt *testing.T) { + var zeroValue string + i := &InstallationPermissions{OrganizationPersonalAccessTokenRequests: &zeroValue} + i.GetOrganizationPersonalAccessTokenRequests() + i = &InstallationPermissions{} + i.GetOrganizationPersonalAccessTokenRequests() + i = nil + i.GetOrganizationPersonalAccessTokenRequests() +} + +func TestInstallationPermissions_GetOrganizationPersonalAccessTokens(tt *testing.T) { + var zeroValue string + i := &InstallationPermissions{OrganizationPersonalAccessTokens: &zeroValue} + i.GetOrganizationPersonalAccessTokens() + i = &InstallationPermissions{} + i.GetOrganizationPersonalAccessTokens() + i = nil + i.GetOrganizationPersonalAccessTokens() +} + func TestInstallationPermissions_GetOrganizationPlan(tt *testing.T) { var zeroValue string i := &InstallationPermissions{OrganizationPlan: &zeroValue} From 882755a047ea3e09b2f5f4a0e888d9a12cf2852f Mon Sep 17 00:00:00 2001 From: Matt Mencel Date: Thu, 22 Aug 2024 08:25:31 -0500 Subject: [PATCH 495/751] feat: Add do_not_enforce_on_create to required status checks rule params (#3245) Fixes: #3244. --- github/repos_rules.go | 1 + github/repos_rules_test.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/github/repos_rules.go b/github/repos_rules.go index 17fa170cf99..6d394164ced 100644 --- a/github/repos_rules.go +++ b/github/repos_rules.go @@ -111,6 +111,7 @@ type RuleRequiredStatusChecks struct { // RequiredStatusChecksRuleParameters represents the required_status_checks rule parameters. type RequiredStatusChecksRuleParameters struct { + DoNotEnforceOnCreate bool `json:"do_not_enforce_on_create"` RequiredStatusChecks []RuleRequiredStatusChecks `json:"required_status_checks"` StrictRequiredStatusChecksPolicy bool `json:"strict_required_status_checks_policy"` } diff --git a/github/repos_rules_test.go b/github/repos_rules_test.go index c338e37e335..92f7259d0c8 100644 --- a/github/repos_rules_test.go +++ b/github/repos_rules_test.go @@ -224,8 +224,9 @@ func TestRepositoryRule_UnmarshalJSON(t *testing.T) { wantErr: true, }, "Valid required_status_checks params": { - data: `{"type":"required_status_checks","parameters":{"required_status_checks":[{"context":"test","integration_id":1}],"strict_required_status_checks_policy":true}}`, + data: `{"type":"required_status_checks","parameters":{"required_status_checks":[{"context":"test","integration_id":1}],"strict_required_status_checks_policy":true,"do_not_enforce_on_create":true}}`, want: NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ + DoNotEnforceOnCreate: true, RequiredStatusChecks: []RuleRequiredStatusChecks{ { Context: "test", From da7d014676416578b6b29e951cee9aaee4f79919 Mon Sep 17 00:00:00 2001 From: Liam Stanley Date: Mon, 26 Aug 2024 10:54:30 -0400 Subject: [PATCH 496/751] feat!: Fix meta service domains schema structure (#3249) Fixes: #3248. BREAKING CHANGE: `APIMeta.Domains` changed from `map` to `struct`. --- github/github-accessors.go | 16 +++++++++++++ github/github-accessors_test.go | 14 +++++++++++ github/meta.go | 22 ++++++++++++++--- github/meta_test.go | 42 ++++++++++++++++++++++++++++----- 4 files changed, 85 insertions(+), 9 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 66e9c0baef2..10096e44f21 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -662,6 +662,14 @@ func (a *AnalysesListOptions) GetSarifID() string { return *a.SarifID } +// GetDomains returns the Domains field. +func (a *APIMeta) GetDomains() *APIMetaDomains { + if a == nil { + return nil + } + return a.Domains +} + // GetSSHKeyFingerprints returns the SSHKeyFingerprints map if it's non-nil, an empty map otherwise. func (a *APIMeta) GetSSHKeyFingerprints() map[string]string { if a == nil || a.SSHKeyFingerprints == nil { @@ -678,6 +686,14 @@ func (a *APIMeta) GetVerifiablePasswordAuthentication() bool { return *a.VerifiablePasswordAuthentication } +// GetArtifactAttestations returns the ArtifactAttestations field. +func (a *APIMetaDomains) GetArtifactAttestations() *APIMetaArtifactAttestations { + if a == nil { + return nil + } + return a.ArtifactAttestations +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (a *App) GetCreatedAt() Timestamp { if a == nil || a.CreatedAt == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index dde2c80bcf4..aa694fd58e1 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -765,6 +765,13 @@ func TestAnalysesListOptions_GetSarifID(tt *testing.T) { a.GetSarifID() } +func TestAPIMeta_GetDomains(tt *testing.T) { + a := &APIMeta{} + a.GetDomains() + a = nil + a.GetDomains() +} + func TestAPIMeta_GetSSHKeyFingerprints(tt *testing.T) { zeroValue := map[string]string{} a := &APIMeta{SSHKeyFingerprints: zeroValue} @@ -785,6 +792,13 @@ func TestAPIMeta_GetVerifiablePasswordAuthentication(tt *testing.T) { a.GetVerifiablePasswordAuthentication() } +func TestAPIMetaDomains_GetArtifactAttestations(tt *testing.T) { + a := &APIMetaDomains{} + a.GetArtifactAttestations() + a = nil + a.GetArtifactAttestations() +} + func TestApp_GetCreatedAt(tt *testing.T) { var zeroValue Timestamp a := &App{CreatedAt: &zeroValue} diff --git a/github/meta.go b/github/meta.go index e0e355e8cd0..cc90b618b14 100644 --- a/github/meta.go +++ b/github/meta.go @@ -70,9 +70,25 @@ type APIMeta struct { // which serve GitHub APIs. API []string `json:"api,omitempty"` - // A map of GitHub services and their associated domains. Note that many - // of these domains are represented as wildcards (e.g. "*.github.com"). - Domains map[string][]string `json:"domains,omitempty"` + // GitHub services and their associated domains. Note that many of these domains + // are represented as wildcards (e.g. "*.github.com"). + Domains *APIMetaDomains `json:"domains,omitempty"` +} + +// APIMetaDomains represents the domains associated with GitHub services. +type APIMetaDomains struct { + Website []string `json:"website,omitempty"` + Codespaces []string `json:"codespaces,omitempty"` + Copilot []string `json:"copilot,omitempty"` + Packages []string `json:"packages,omitempty"` + Actions []string `json:"actions,omitempty"` + ArtifactAttestations *APIMetaArtifactAttestations `json:"artifact_attestations,omitempty"` +} + +// APIMetaArtifactAttestations represents the artifact attestation services domains. +type APIMetaArtifactAttestations struct { + TrustDomain string `json:"trust_domain,omitempty"` + Services []string `json:"services,omitempty"` } // Get returns information about GitHub.com, the service. Or, if you access diff --git a/github/meta_test.go b/github/meta_test.go index 99cb0b02ceb..836d9931148 100644 --- a/github/meta_test.go +++ b/github/meta_test.go @@ -30,8 +30,23 @@ func TestAPIMeta_Marshal(t *testing.T) { SSHKeys: []string{"k"}, API: []string{"a"}, Web: []string{"w"}, - Domains: map[string][]string{ - "example": {"example.com", "*.example.com"}, + Domains: &APIMetaDomains{ + Website: []string{ + "*.github.com", + "*.github.dev", + "*.github.io", + "*.githubassets.com", + "*.githubusercontent.com", + }, + ArtifactAttestations: &APIMetaArtifactAttestations{ + TrustDomain: "", + Services: []string{ + "*.actions.githubusercontent.com", + "tuf-repo.github.com", + "fulcio.githubapp.com", + "timestamp.githubapp.com", + }, + }, }, } want := `{ @@ -47,7 +62,7 @@ func TestAPIMeta_Marshal(t *testing.T) { "ssh_keys":["k"], "api":["a"], "web":["w"], - "domains":{"example":["example.com","*.example.com"]} + "domains":{"website":["*.github.com","*.github.dev","*.github.io","*.githubassets.com","*.githubusercontent.com"],"artifact_attestations":{"trust_domain":"","services":["*.actions.githubusercontent.com","tuf-repo.github.com","fulcio.githubapp.com","timestamp.githubapp.com"]}} }` testJSONMarshal(t, a, want) @@ -59,7 +74,7 @@ func TestMetaService_Get(t *testing.T) { mux.HandleFunc("/meta", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - fmt.Fprint(w, `{"web":["w"],"api":["a"],"hooks":["h"], "git":["g"], "pages":["p"], "importer":["i"], "github_enterprise_importer": ["gei"], "actions":["a"], "dependabot":["d"], "verifiable_password_authentication": true, "domains":{"example":["example.com","*.example.com"]}}`) + fmt.Fprint(w, `{"web":["w"],"api":["a"],"hooks":["h"], "git":["g"], "pages":["p"], "importer":["i"], "github_enterprise_importer": ["gei"], "actions":["a"], "dependabot":["d"], "verifiable_password_authentication": true, "domains":{"website":["*.github.com","*.github.dev","*.github.io","*.githubassets.com","*.githubusercontent.com"],"artifact_attestations":{"trust_domain":"","services":["*.actions.githubusercontent.com","tuf-repo.github.com","fulcio.githubapp.com","timestamp.githubapp.com"]}}}`) }) ctx := context.Background() @@ -78,8 +93,23 @@ func TestMetaService_Get(t *testing.T) { Dependabot: []string{"d"}, API: []string{"a"}, Web: []string{"w"}, - Domains: map[string][]string{ - "example": {"example.com", "*.example.com"}, + Domains: &APIMetaDomains{ + Website: []string{ + "*.github.com", + "*.github.dev", + "*.github.io", + "*.githubassets.com", + "*.githubusercontent.com", + }, + ArtifactAttestations: &APIMetaArtifactAttestations{ + TrustDomain: "", + Services: []string{ + "*.actions.githubusercontent.com", + "tuf-repo.github.com", + "fulcio.githubapp.com", + "timestamp.githubapp.com", + }, + }, }, VerifiablePasswordAuthentication: Bool(true), From 039fefd9b846570a4f68a94675196b48d0f122ec Mon Sep 17 00:00:00 2001 From: Rez Moss Date: Mon, 26 Aug 2024 11:01:51 -0400 Subject: [PATCH 497/751] feat!: Fix broken SCIMService.ProvisionAndInviteSCIMUser method (#3239) Fixes: #3238. BREAKING CHANGE: `SCIMService.ProvisionAndInviteSCIMUser` now returns a response. --- github/scim.go | 14 ++++++++------ github/scim_test.go | 23 ++++++++++++++++++----- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/github/scim.go b/github/scim.go index 02136d7ef91..4b34c1663cd 100644 --- a/github/scim.go +++ b/github/scim.go @@ -110,19 +110,21 @@ func (s *SCIMService) ListSCIMProvisionedIdentities(ctx context.Context, org str // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#provision-and-invite-a-scim-user // //meta:operation POST /scim/v2/organizations/{org}/Users -func (s *SCIMService) ProvisionAndInviteSCIMUser(ctx context.Context, org string, opts *SCIMUserAttributes) (*Response, error) { +func (s *SCIMService) ProvisionAndInviteSCIMUser(ctx context.Context, org string, opts *SCIMUserAttributes) (*SCIMUserAttributes, *Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users", org) - u, err := addOptions(u, opts) + + req, err := s.client.NewRequest("POST", u, opts) if err != nil { - return nil, err + return nil, nil, err } - req, err := s.client.NewRequest("POST", u, nil) + user := new(SCIMUserAttributes) + resp, err := s.client.Do(ctx, req, user) if err != nil { - return nil, err + return nil, resp, err } - return s.client.Do(ctx, req, nil) + return user, resp, nil } // GetSCIMProvisioningInfoForUser returns SCIM provisioning information for a user. diff --git a/github/scim_test.go b/github/scim_test.go index 9e5274766aa..2ae4f194456 100644 --- a/github/scim_test.go +++ b/github/scim_test.go @@ -127,7 +127,8 @@ func TestSCIMService_ProvisionAndInviteSCIMUser(t *testing.T) { mux.HandleFunc("/scim/v2/organizations/o/Users", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") - w.WriteHeader(http.StatusOK) + w.WriteHeader(http.StatusCreated) + fmt.Fprint(w, `{"id":"1234567890","userName":"userName"}`) }) ctx := context.Background() @@ -143,19 +144,31 @@ func TestSCIMService_ProvisionAndInviteSCIMUser(t *testing.T) { }, }, } - _, err := client.SCIM.ProvisionAndInviteSCIMUser(ctx, "o", opts) + user, _, err := client.SCIM.ProvisionAndInviteSCIMUser(ctx, "o", opts) if err != nil { - t.Errorf("SCIM.ListSCIMProvisionedIdentities returned error: %v", err) + t.Errorf("SCIM.ProvisionAndInviteSCIMUser returned error: %v", err) + } + + want := &SCIMUserAttributes{ + ID: String("1234567890"), + UserName: "userName", + } + if !cmp.Equal(user, want) { + t.Errorf("SCIM.ProvisionAndInviteSCIMUser returned %+v, want %+v", user, want) } const methodName = "ProvisionAndInviteSCIMUser" testBadOptions(t, methodName, func() (err error) { - _, err = client.SCIM.ProvisionAndInviteSCIMUser(ctx, "\n", opts) + _, _, err = client.SCIM.ProvisionAndInviteSCIMUser(ctx, "\n", opts) return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.SCIM.ProvisionAndInviteSCIMUser(ctx, "o", opts) + got, resp, err := client.SCIM.ProvisionAndInviteSCIMUser(ctx, "o", opts) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err }) } From c96ef954c31ce1a9f74675b8ec2c66e24292ea51 Mon Sep 17 00:00:00 2001 From: Rez Moss Date: Mon, 26 Aug 2024 14:33:00 -0400 Subject: [PATCH 498/751] Add Source field to RulesetRepositoryPropertyTargetParameters (#3250) Fixes: #3247. --- github/orgs_rules_test.go | 7 +++++++ github/repos_rules.go | 1 + 2 files changed, 8 insertions(+) diff --git a/github/orgs_rules_test.go b/github/orgs_rules_test.go index d45469f27e7..13d4c76da0c 100644 --- a/github/orgs_rules_test.go +++ b/github/orgs_rules_test.go @@ -555,12 +555,14 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing. Include: []RulesetRepositoryPropertyTargetParameters{ { Name: "testIncludeProp", + Source: "custom", Values: []string{"true"}, }, }, Exclude: []RulesetRepositoryPropertyTargetParameters{ { Name: "testExcludeProp", + Source: "custom", Values: []string{"false"}, }, }, @@ -647,12 +649,14 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing. Include: []RulesetRepositoryPropertyTargetParameters{ { Name: "testIncludeProp", + Source: "custom", Values: []string{"true"}, }, }, Exclude: []RulesetRepositoryPropertyTargetParameters{ { Name: "testExcludeProp", + Source: "custom", Values: []string{"false"}, }, }, @@ -1206,6 +1210,7 @@ func TestOrganizationsService_GetOrganizationRulesetWithRepoPropCondition(t *tes Include: []RulesetRepositoryPropertyTargetParameters{ { Name: "testIncludeProp", + Source: "custom", Values: []string{"true"}, }, }, @@ -1397,6 +1402,7 @@ func TestOrganizationsService_UpdateOrganizationRulesetWithRepoProp(t *testing.T Include: []RulesetRepositoryPropertyTargetParameters{ { Name: "testIncludeProp", + Source: "custom", Values: []string{"true"}, }, }, @@ -1428,6 +1434,7 @@ func TestOrganizationsService_UpdateOrganizationRulesetWithRepoProp(t *testing.T Include: []RulesetRepositoryPropertyTargetParameters{ { Name: "testIncludeProp", + Source: "custom", Values: []string{"true"}, }, }, diff --git a/github/repos_rules.go b/github/repos_rules.go index 6d394164ced..3c6e8f01c92 100644 --- a/github/repos_rules.go +++ b/github/repos_rules.go @@ -52,6 +52,7 @@ type RulesetRepositoryIDsConditionParameters struct { type RulesetRepositoryPropertyTargetParameters struct { Name string `json:"name"` Values []string `json:"property_values"` + Source string `json:"source"` } // RulesetRepositoryPropertyConditionParameters represents the conditions object for repository_property. From 00caddcf95beb14dd993e65964146a18b8da17dc Mon Sep 17 00:00:00 2001 From: Ze Peng Date: Tue, 3 Sep 2024 12:13:46 -0600 Subject: [PATCH 499/751] feat!: Add merge queue parameters to repository ruleset (#3253) Fixes: #3225. BREAKING CHANGE: `NewMergeQueueRule` now takes one parameter: `*MergeQueueRuleParameters`. --- github/orgs_rules_test.go | 15 -------------- github/repos_rules.go | 40 ++++++++++++++++++++++++++++++++++-- github/repos_rules_test.go | 42 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+), 17 deletions(-) diff --git a/github/orgs_rules_test.go b/github/orgs_rules_test.go index 13d4c76da0c..435e7e5827b 100644 --- a/github/orgs_rules_test.go +++ b/github/orgs_rules_test.go @@ -123,9 +123,6 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) { "type": "deletion" }, - { - "type": "merge_queue" - }, { "type": "required_linear_history" }, @@ -241,7 +238,6 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) UpdateAllowsFetchAndMerge: true, }), NewDeletionRule(), - NewMergeQueueRule(), NewRequiredLinearHistoryRule(), NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ RequiredDeploymentEnvironments: []string{"test"}, @@ -328,7 +324,6 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) UpdateAllowsFetchAndMerge: true, }), NewDeletionRule(), - NewMergeQueueRule(), NewRequiredLinearHistoryRule(), NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ RequiredDeploymentEnvironments: []string{"test"}, @@ -449,9 +444,6 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing. { "type": "deletion" }, - { - "type": "merge_queue" - }, { "type": "required_linear_history" }, @@ -574,7 +566,6 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing. UpdateAllowsFetchAndMerge: true, }), NewDeletionRule(), - NewMergeQueueRule(), NewRequiredLinearHistoryRule(), NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ RequiredDeploymentEnvironments: []string{"test"}, @@ -668,7 +659,6 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing. UpdateAllowsFetchAndMerge: true, }), NewDeletionRule(), - NewMergeQueueRule(), NewRequiredLinearHistoryRule(), NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ RequiredDeploymentEnvironments: []string{"test"}, @@ -781,9 +771,6 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { { "type": "deletion" }, - { - "type": "merge_queue" - }, { "type": "required_linear_history" }, @@ -897,7 +884,6 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { UpdateAllowsFetchAndMerge: true, }), NewDeletionRule(), - NewMergeQueueRule(), NewRequiredLinearHistoryRule(), NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ RequiredDeploymentEnvironments: []string{"test"}, @@ -982,7 +968,6 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { UpdateAllowsFetchAndMerge: true, }), NewDeletionRule(), - NewMergeQueueRule(), NewRequiredLinearHistoryRule(), NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ RequiredDeploymentEnvironments: []string{"test"}, diff --git a/github/repos_rules.go b/github/repos_rules.go index 3c6e8f01c92..a90555cc442 100644 --- a/github/repos_rules.go +++ b/github/repos_rules.go @@ -110,6 +110,19 @@ type RuleRequiredStatusChecks struct { IntegrationID *int64 `json:"integration_id,omitempty"` } +// MergeQueueRuleParameters represents the merge_queue rule parameters. +type MergeQueueRuleParameters struct { + CheckResponseTimeoutMinutes int `json:"check_response_timeout_minutes"` + // Possible values for GroupingStrategy are: ALLGREEN, HEADGREEN + GroupingStrategy string `json:"grouping_strategy"` + MaxEntriesToBuild int `json:"max_entries_to_build"` + MaxEntriesToMerge int `json:"max_entries_to_merge"` + // Possible values for MergeMethod are: MERGE, SQUASH, REBASE + MergeMethod string `json:"merge_method"` + MinEntriesToMerge int `json:"min_entries_to_merge"` + MinEntriesToMergeWaitMinutes int `json:"min_entries_to_merge_wait_minutes"` +} + // RequiredStatusChecksRuleParameters represents the required_status_checks rule parameters. type RequiredStatusChecksRuleParameters struct { DoNotEnforceOnCreate bool `json:"do_not_enforce_on_create"` @@ -154,7 +167,7 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { r.Type = RepositoryRule.Type switch RepositoryRule.Type { - case "creation", "deletion", "merge_queue", "non_fast_forward", "required_linear_history", "required_signatures": + case "creation", "deletion", "non_fast_forward", "required_linear_history", "required_signatures": r.Parameters = nil case "update": if RepositoryRule.Parameters == nil { @@ -170,7 +183,20 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { rawParams := json.RawMessage(bytes) r.Parameters = &rawParams + case "merge_queue": + if RepositoryRule.Parameters == nil { + r.Parameters = nil + return nil + } + params := MergeQueueRuleParameters{} + if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { + return err + } + + bytes, _ := json.Marshal(params) + rawParams := json.RawMessage(bytes) + r.Parameters = &rawParams case "required_deployments": params := RequiredDeploymentEnvironmentsRuleParameters{} if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { @@ -240,7 +266,17 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { } // NewMergeQueueRule creates a rule to only allow merges via a merge queue. -func NewMergeQueueRule() (rule *RepositoryRule) { +func NewMergeQueueRule(params *MergeQueueRuleParameters) (rule *RepositoryRule) { + if params != nil { + bytes, _ := json.Marshal(params) + + rawParams := json.RawMessage(bytes) + + return &RepositoryRule{ + Type: "merge_queue", + Parameters: &rawParams, + } + } return &RepositoryRule{ Type: "merge_queue", } diff --git a/github/repos_rules_test.go b/github/repos_rules_test.go index 92f7259d0c8..8e123ed0f8e 100644 --- a/github/repos_rules_test.go +++ b/github/repos_rules_test.go @@ -74,6 +74,48 @@ func TestRepositoryRule_UnmarshalJSON(t *testing.T) { Parameters: nil, }, }, + "Valid merge_queue with params": { + data: `{ + "type":"merge_queue", + "parameters":{ + "check_response_timeout_minutes": 35, + "grouping_strategy": "HEADGREEN", + "max_entries_to_build": 8, + "max_entries_to_merge": 4, + "merge_method": "SQUASH", + "min_entries_to_merge": 2, + "min_entries_to_merge_wait_minutes": 13 + } + }`, + want: NewMergeQueueRule(&MergeQueueRuleParameters{ + CheckResponseTimeoutMinutes: 35, + GroupingStrategy: "HEADGREEN", + MaxEntriesToBuild: 8, + MaxEntriesToMerge: 4, + MergeMethod: "SQUASH", + MinEntriesToMerge: 2, + MinEntriesToMergeWaitMinutes: 13, + }), + }, + "Invalid merge_queue with params": { + data: `{ + "type":"merge_queue", + "parameters":{ + "check_response_timeout_minutes": "35", + "grouping_strategy": "HEADGREEN", + "max_entries_to_build": "8", + "max_entries_to_merge": "4", + "merge_method": "SQUASH", + "min_entries_to_merge": "2", + "min_entries_to_merge_wait_minutes": "13" + } + }`, + want: &RepositoryRule{ + Type: "merge_queue", + Parameters: nil, + }, + wantErr: true, + }, "Valid non_fast_forward": { data: `{"type":"non_fast_forward"}`, want: &RepositoryRule{ From bd3e88900957daa0f450ebbb618c189fbc1a4c8e Mon Sep 17 00:00:00 2001 From: ganeshkumarsv <53483484+ganeshkumarsv@users.noreply.github.com> Date: Thu, 5 Sep 2024 12:03:08 -0400 Subject: [PATCH 500/751] Update active committers struct (#3257) --- github/billing.go | 7 +++++-- github/billing_test.go | 9 ++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/github/billing.go b/github/billing.go index 6d7579b884d..09b1a5d017a 100644 --- a/github/billing.go +++ b/github/billing.go @@ -43,8 +43,11 @@ type StorageBilling struct { // 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"` + TotalAdvancedSecurityCommitters int `json:"total_advanced_security_committers"` + TotalCount int `json:"total_count"` + MaximumAdvancedSecurityCommitters int `json:"maximum_advanced_security_committers"` + PurchasedAdvancedSecurityCommitters int `json:"purchased_advanced_security_committers"` + Repositories []*RepositoryActiveCommitters `json:"repositories,omitempty"` } // RepositoryActiveCommitters represents active committers on each repository. diff --git a/github/billing_test.go b/github/billing_test.go index d7adcb09f72..5c929d5f095 100644 --- a/github/billing_test.go +++ b/github/billing_test.go @@ -436,10 +436,14 @@ func TestBillingService_GetAdvancedSecurityActiveCommittersOrg(t *testing.T) { testMethod(t, r, "GET") fmt.Fprint(w, `{ "total_advanced_security_committers": 2, + "total_count": 2, + "maximum_advanced_security_committers": 3, + "purchased_advanced_security_committers": 4, "repositories": [ { "name": "octocat-org/Hello-World", "advanced_security_committers": 2, + "advanced_security_committers_breakdown": [ { "user_login": "octokitten", @@ -459,7 +463,10 @@ func TestBillingService_GetAdvancedSecurityActiveCommittersOrg(t *testing.T) { } want := &ActiveCommitters{ - TotalAdvancedSecurityCommitters: 2, + TotalAdvancedSecurityCommitters: 2, + TotalCount: 2, + MaximumAdvancedSecurityCommitters: 3, + PurchasedAdvancedSecurityCommitters: 4, Repositories: []*RepositoryActiveCommitters{ { Name: String("octocat-org/Hello-World"), From a1e9d75ccf8b7676daa1c5b2127f8658ea66e5fe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Sep 2024 15:46:38 -0400 Subject: [PATCH 501/751] Bump golang.org/x/net from 0.28.0 to 0.29.0 in /scrape (#3259) --- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 4b58ef210c5..04eff1de445 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -9,7 +9,7 @@ require ( github.com/google/go-cmp v0.6.0 github.com/google/go-github/v64 v64.0.0 github.com/xlzd/gotp v0.1.0 - golang.org/x/net v0.28.0 + golang.org/x/net v0.29.0 ) require ( diff --git a/scrape/go.sum b/scrape/go.sum index 9bdd671927d..f3014057cac 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -21,8 +21,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= -golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= -golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= From 662da6f8e9f32b7da649ad0bfac19948e5acdd85 Mon Sep 17 00:00:00 2001 From: DiegoDev <144474823+CodeDiego15@users.noreply.github.com> Date: Mon, 9 Sep 2024 20:49:43 -0400 Subject: [PATCH 502/751] Add type SponsorshipEvent (#3258) Fixes: #2982. --- github/event_types.go | 24 +++++++++ github/event_types_test.go | 94 +++++++++++++++++++++++++++++++++ github/github-accessors.go | 80 ++++++++++++++++++++++++++++ github/github-accessors_test.go | 82 ++++++++++++++++++++++++++++ github/messages.go | 1 + github/messages_test.go | 4 ++ 6 files changed, 285 insertions(+) diff --git a/github/event_types.go b/github/event_types.go index df8d9e033e2..41d71f8ddf2 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -1821,3 +1821,27 @@ type CodeScanningAlertEvent struct { Installation *Installation `json:"installation,omitempty"` } + +// SponsorshipEvent represents a sponsorship event in GitHub. +// +// GitHub API docs: https://docs.github.com/en/rest/overview/github-event-types?apiVersion=2022-11-28#sponsorshipevent +type SponsorshipEvent struct { + Action *string `json:"action,omitempty"` + EffectiveDate *string `json:"effective_date,omitempty"` + Changes *SponsorshipChanges `json:"changes,omitempty"` + Repository *Repository `json:"repository,omitempty"` + Organization *Organization `json:"organization,omitempty"` + Sender *User `json:"sender,omitempty"` + Installation *Installation `json:"installation,omitempty"` +} + +// SponsorshipChanges represents changes made to the sponsorship. +type SponsorshipChanges struct { + Tier *SponsorshipTier `json:"tier,omitempty"` + PrivacyLevel *string `json:"privacy_level,omitempty"` +} + +// SponsorshipTier represents the tier information of a sponsorship. +type SponsorshipTier struct { + From *string `json:"from,omitempty"` +} diff --git a/github/event_types_test.go b/github/event_types_test.go index 79532d4916a..e2a8a39f147 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -17885,3 +17885,97 @@ func TestCodeScanningAlertEvent_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestSponsorshipEvent_Marshal(t *testing.T) { + testJSONMarshal(t, &SponsorshipEvent{}, "{}") + + u := &SponsorshipEvent{ + Action: String("created"), + EffectiveDate: String("2023-01-01T00:00:00Z"), + Changes: &SponsorshipChanges{ + Tier: &SponsorshipTier{ + From: String("basic"), + }, + PrivacyLevel: String("public"), + }, + Repository: &Repository{ + ID: Int64(12345), + NodeID: String("MDEwOlJlcG9zaXRvcnkxMjM0NQ=="), + Name: String("example-repo"), + }, + Organization: &Organization{ + Login: String("example-org"), + ID: Int64(67890), + }, + Sender: &User{ + Login: String("example-user"), + ID: Int64(1111), + }, + Installation: &Installation{ + ID: Int64(2222), + }, + } + + want := `{ + "action": "created", + "effective_date": "2023-01-01T00:00:00Z", + "changes": { + "tier": { + "from": "basic" + }, + "privacy_level": "public" + }, + "repository": { + "id": 12345, + "node_id": "MDEwOlJlcG9zaXRvcnkxMjM0NQ==", + "name": "example-repo" + }, + "organization": { + "login": "example-org", + "id": 67890 + }, + "sender": { + "login": "example-user", + "id": 1111 + }, + "installation": { + "id": 2222 + } + }` + + testJSONMarshal(t, u, want) +} + +func TestSponsorshipChanges_Marshal(t *testing.T) { + testJSONMarshal(t, &SponsorshipChanges{}, "{}") + + u := &SponsorshipChanges{ + Tier: &SponsorshipTier{ + From: String("premium"), + }, + PrivacyLevel: String("private"), + } + + want := `{ + "tier": { + "from": "premium" + }, + "privacy_level": "private" + }` + + testJSONMarshal(t, u, want) +} + +func TestSponsorshipTier_Marshal(t *testing.T) { + testJSONMarshal(t, &SponsorshipTier{}, "{}") + + u := &SponsorshipTier{ + From: String("gold"), + } + + want := `{ + "from": "gold" + }` + + testJSONMarshal(t, u, want) +} diff --git a/github/github-accessors.go b/github/github-accessors.go index 10096e44f21..1abbabd0b63 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -22398,6 +22398,86 @@ func (s *SourceImportAuthor) GetURL() string { return *s.URL } +// GetPrivacyLevel returns the PrivacyLevel field if it's non-nil, zero value otherwise. +func (s *SponsorshipChanges) GetPrivacyLevel() string { + if s == nil || s.PrivacyLevel == nil { + return "" + } + return *s.PrivacyLevel +} + +// GetTier returns the Tier field. +func (s *SponsorshipChanges) GetTier() *SponsorshipTier { + if s == nil { + return nil + } + return s.Tier +} + +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (s *SponsorshipEvent) GetAction() string { + if s == nil || s.Action == nil { + return "" + } + return *s.Action +} + +// GetChanges returns the Changes field. +func (s *SponsorshipEvent) GetChanges() *SponsorshipChanges { + if s == nil { + return nil + } + return s.Changes +} + +// GetEffectiveDate returns the EffectiveDate field if it's non-nil, zero value otherwise. +func (s *SponsorshipEvent) GetEffectiveDate() string { + if s == nil || s.EffectiveDate == nil { + return "" + } + return *s.EffectiveDate +} + +// GetInstallation returns the Installation field. +func (s *SponsorshipEvent) GetInstallation() *Installation { + if s == nil { + return nil + } + return s.Installation +} + +// GetOrganization returns the Organization field. +func (s *SponsorshipEvent) GetOrganization() *Organization { + if s == nil { + return nil + } + return s.Organization +} + +// GetRepository returns the Repository field. +func (s *SponsorshipEvent) GetRepository() *Repository { + if s == nil { + return nil + } + return s.Repository +} + +// GetSender returns the Sender field. +func (s *SponsorshipEvent) GetSender() *User { + if s == nil { + return nil + } + return s.Sender +} + +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (s *SponsorshipTier) GetFrom() string { + if s == nil || s.From == nil { + return "" + } + return *s.From +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (s *SSHSigningKey) GetCreatedAt() Timestamp { if s == nil || s.CreatedAt == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index aa694fd58e1..6d1419c79f2 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -26018,6 +26018,88 @@ func TestSourceImportAuthor_GetURL(tt *testing.T) { s.GetURL() } +func TestSponsorshipChanges_GetPrivacyLevel(tt *testing.T) { + var zeroValue string + s := &SponsorshipChanges{PrivacyLevel: &zeroValue} + s.GetPrivacyLevel() + s = &SponsorshipChanges{} + s.GetPrivacyLevel() + s = nil + s.GetPrivacyLevel() +} + +func TestSponsorshipChanges_GetTier(tt *testing.T) { + s := &SponsorshipChanges{} + s.GetTier() + s = nil + s.GetTier() +} + +func TestSponsorshipEvent_GetAction(tt *testing.T) { + var zeroValue string + s := &SponsorshipEvent{Action: &zeroValue} + s.GetAction() + s = &SponsorshipEvent{} + s.GetAction() + s = nil + s.GetAction() +} + +func TestSponsorshipEvent_GetChanges(tt *testing.T) { + s := &SponsorshipEvent{} + s.GetChanges() + s = nil + s.GetChanges() +} + +func TestSponsorshipEvent_GetEffectiveDate(tt *testing.T) { + var zeroValue string + s := &SponsorshipEvent{EffectiveDate: &zeroValue} + s.GetEffectiveDate() + s = &SponsorshipEvent{} + s.GetEffectiveDate() + s = nil + s.GetEffectiveDate() +} + +func TestSponsorshipEvent_GetInstallation(tt *testing.T) { + s := &SponsorshipEvent{} + s.GetInstallation() + s = nil + s.GetInstallation() +} + +func TestSponsorshipEvent_GetOrganization(tt *testing.T) { + s := &SponsorshipEvent{} + s.GetOrganization() + s = nil + s.GetOrganization() +} + +func TestSponsorshipEvent_GetRepository(tt *testing.T) { + s := &SponsorshipEvent{} + s.GetRepository() + s = nil + s.GetRepository() +} + +func TestSponsorshipEvent_GetSender(tt *testing.T) { + s := &SponsorshipEvent{} + s.GetSender() + s = nil + s.GetSender() +} + +func TestSponsorshipTier_GetFrom(tt *testing.T) { + var zeroValue string + s := &SponsorshipTier{From: &zeroValue} + s.GetFrom() + s = &SponsorshipTier{} + s.GetFrom() + s = nil + s.GetFrom() +} + func TestSSHSigningKey_GetCreatedAt(tt *testing.T) { var zeroValue Timestamp s := &SSHSigningKey{CreatedAt: &zeroValue} diff --git a/github/messages.go b/github/messages.go index 72edbd9feef..0385d398bda 100644 --- a/github/messages.go +++ b/github/messages.go @@ -102,6 +102,7 @@ var ( "secret_scanning_alert": &SecretScanningAlertEvent{}, "security_advisory": &SecurityAdvisoryEvent{}, "security_and_analysis": &SecurityAndAnalysisEvent{}, + "sponsorship": &SponsorshipEvent{}, "star": &StarEvent{}, "status": &StatusEvent{}, "team": &TeamEvent{}, diff --git a/github/messages_test.go b/github/messages_test.go index 1243d755be8..4783ec683aa 100644 --- a/github/messages_test.go +++ b/github/messages_test.go @@ -468,6 +468,10 @@ func TestParseWebHook(t *testing.T) { payload: &SecurityAndAnalysisEvent{}, messageType: "security_and_analysis", }, + { + payload: &SponsorshipEvent{}, + messageType: "sponsorship", + }, { payload: &StarEvent{}, messageType: "star", From 080468c845d50eeb06c80171f765b897c8b3bc7d Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Mon, 16 Sep 2024 09:26:38 -0400 Subject: [PATCH 503/751] Bump version of go-github to v65.0.0 (#3266) --- README.md | 17 +++++++++-------- example/actionpermissions/main.go | 2 +- example/appengine/app.go | 2 +- example/basicauth/main.go | 2 +- .../codespaces/newreposecretwithxcrypto/main.go | 2 +- .../codespaces/newusersecretwithxcrypto/main.go | 2 +- example/commitpr/main.go | 2 +- example/go.mod | 6 +++--- example/listenvironments/main.go | 2 +- example/migrations/main.go | 2 +- example/newfilewithappauth/main.go | 2 +- example/newrepo/main.go | 2 +- example/newreposecretwithlibsodium/go.mod | 4 ++-- example/newreposecretwithlibsodium/main.go | 2 +- example/newreposecretwithxcrypto/main.go | 2 +- example/ratelimit/main.go | 2 +- example/simple/main.go | 2 +- example/tagprotection/main.go | 2 +- example/tokenauth/main.go | 2 +- example/topics/main.go | 2 +- github/doc.go | 2 +- github/examples_test.go | 2 +- github/github.go | 2 +- go.mod | 2 +- test/fields/fields.go | 2 +- test/integration/activity_test.go | 2 +- test/integration/authorizations_test.go | 2 +- test/integration/github_test.go | 2 +- test/integration/repos_test.go | 2 +- test/integration/users_test.go | 2 +- tools/go.mod | 4 ++-- tools/metadata/main.go | 2 +- tools/metadata/main_test.go | 2 +- tools/metadata/metadata.go | 2 +- tools/metadata/openapi.go | 2 +- 35 files changed, 47 insertions(+), 46 deletions(-) diff --git a/README.md b/README.md index 472ff43970b..6f5c7aaea77 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-github # [![go-github release (latest SemVer)](https://img.shields.io/github/v/release/google/go-github?sort=semver)](https://github.com/google/go-github/releases) -[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v64/github) +[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v65/github) [![Test Status](https://github.com/google/go-github/workflows/tests/badge.svg)](https://github.com/google/go-github/actions?query=workflow%3Atests) [![Test Coverage](https://codecov.io/gh/google/go-github/branch/master/graph/badge.svg)](https://codecov.io/gh/google/go-github) [![Discuss at go-github@googlegroups.com](https://img.shields.io/badge/discuss-go--github%40googlegroups.com-blue.svg)](https://groups.google.com/group/go-github) @@ -24,7 +24,7 @@ If you're interested in using the [GraphQL API v4][], the recommended library is go-github is compatible with modern Go releases in module mode, with Go installed: ```bash -go get github.com/google/go-github/v64 +go get github.com/google/go-github/v65 ``` will resolve and add the package to the current development module, along with its dependencies. @@ -32,7 +32,7 @@ will resolve and add the package to the current development module, along with i Alternatively the same can be achieved if you use import in a package: ```go -import "github.com/google/go-github/v64/github" +import "github.com/google/go-github/v65/github" ``` and run `go get` without parameters. @@ -40,13 +40,13 @@ and run `go get` without parameters. Finally, to use the top-of-trunk version of this repo, use the following command: ```bash -go get github.com/google/go-github/v64@master +go get github.com/google/go-github/v65@master ``` ## Usage ## ```go -import "github.com/google/go-github/v64/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) +import "github.com/google/go-github/v65/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled ``` @@ -119,7 +119,7 @@ import ( "net/http" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v64/github" + "github.com/google/go-github/v65/github" ) func main() { @@ -153,7 +153,7 @@ import ( "os" "strconv" - "github.com/google/go-github/v64/github" + "github.com/google/go-github/v65/github" "github.com/jferrl/go-githubauth" "golang.org/x/oauth2" ) @@ -361,7 +361,7 @@ For complete usage of go-github, see the full [package docs][]. [GitHub API v3]: https://docs.github.com/en/rest [personal access token]: https://github.com/blog/1509-personal-api-tokens -[package docs]: https://pkg.go.dev/github.com/google/go-github/v64/github +[package docs]: https://pkg.go.dev/github.com/google/go-github/v65/github [GraphQL API v4]: https://developer.github.com/v4/ [shurcooL/githubv4]: https://github.com/shurcooL/githubv4 [GitHub webhook events]: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads @@ -434,6 +434,7 @@ Versions prior to 48.2.0 are not listed. | go-github Version | GitHub v3 API Version | | ----------------- | --------------------- | +| 65.0.0 | 2022-11-28 | | 64.0.0 | 2022-11-28 | | 63.0.0 | 2022-11-28 | | 62.0.0 | 2022-11-28 | diff --git a/example/actionpermissions/main.go b/example/actionpermissions/main.go index 5624ee84b09..f92aaaaa36e 100644 --- a/example/actionpermissions/main.go +++ b/example/actionpermissions/main.go @@ -14,7 +14,7 @@ import ( "log" "os" - "github.com/google/go-github/v64/github" + "github.com/google/go-github/v65/github" ) var ( diff --git a/example/appengine/app.go b/example/appengine/app.go index d4a64dd44d9..b45227510a9 100644 --- a/example/appengine/app.go +++ b/example/appengine/app.go @@ -12,7 +12,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v64/github" + "github.com/google/go-github/v65/github" "google.golang.org/appengine" "google.golang.org/appengine/log" ) diff --git a/example/basicauth/main.go b/example/basicauth/main.go index 45072f51a8b..97bc078ad46 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -21,7 +21,7 @@ import ( "os" "strings" - "github.com/google/go-github/v64/github" + "github.com/google/go-github/v65/github" "golang.org/x/term" ) diff --git a/example/codespaces/newreposecretwithxcrypto/main.go b/example/codespaces/newreposecretwithxcrypto/main.go index e0a9d969948..f0f7ea53d49 100644 --- a/example/codespaces/newreposecretwithxcrypto/main.go +++ b/example/codespaces/newreposecretwithxcrypto/main.go @@ -36,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v64/github" + "github.com/google/go-github/v65/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/codespaces/newusersecretwithxcrypto/main.go b/example/codespaces/newusersecretwithxcrypto/main.go index 5893224b111..367d32ac3c9 100644 --- a/example/codespaces/newusersecretwithxcrypto/main.go +++ b/example/codespaces/newusersecretwithxcrypto/main.go @@ -37,7 +37,7 @@ import ( "log" "os" - "github.com/google/go-github/v64/github" + "github.com/google/go-github/v65/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index 35a5584aec9..230b6238dfe 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -33,7 +33,7 @@ import ( "time" "github.com/ProtonMail/go-crypto/openpgp" - "github.com/google/go-github/v64/github" + "github.com/google/go-github/v65/github" ) var ( diff --git a/example/go.mod b/example/go.mod index 9297353ee19..455222888c6 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v64/example +module github.com/google/go-github/v65/example go 1.21 @@ -6,7 +6,7 @@ require ( github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-ratelimit v1.0.3 - github.com/google/go-github/v64 v64.0.0 + github.com/google/go-github/v65 v65.0.0 golang.org/x/crypto v0.21.0 golang.org/x/term v0.18.0 google.golang.org/appengine v1.6.7 @@ -24,4 +24,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v64 => ../ +replace github.com/google/go-github/v65 => ../ diff --git a/example/listenvironments/main.go b/example/listenvironments/main.go index 4edd0e1df69..260e28f0b58 100644 --- a/example/listenvironments/main.go +++ b/example/listenvironments/main.go @@ -18,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v64/github" + "github.com/google/go-github/v65/github" ) func main() { diff --git a/example/migrations/main.go b/example/migrations/main.go index e56698862be..47776157b13 100644 --- a/example/migrations/main.go +++ b/example/migrations/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v64/github" + "github.com/google/go-github/v65/github" ) func fetchAllUserMigrations() ([]*github.UserMigration, error) { diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index 3e64b0acbd5..52f24b3f308 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -16,7 +16,7 @@ import ( "time" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v64/github" + "github.com/google/go-github/v65/github" ) func main() { diff --git a/example/newrepo/main.go b/example/newrepo/main.go index 014abe1c70d..239bf52d544 100644 --- a/example/newrepo/main.go +++ b/example/newrepo/main.go @@ -16,7 +16,7 @@ import ( "log" "os" - "github.com/google/go-github/v64/github" + "github.com/google/go-github/v65/github" ) var ( diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index 1d2ce6a13c0..67612f7e84e 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -6,10 +6,10 @@ toolchain go1.22.0 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb - github.com/google/go-github/v64 v64.0.0 + github.com/google/go-github/v65 v65.0.0 ) require github.com/google/go-querystring v1.1.0 // indirect // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v64 => ../.. +replace github.com/google/go-github/v65 => ../.. diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index 661dc5f06dd..5a5eccdc94f 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -36,7 +36,7 @@ import ( "os" sodium "github.com/GoKillers/libsodium-go/cryptobox" - "github.com/google/go-github/v64/github" + "github.com/google/go-github/v65/github" ) var ( diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index 107acc2d640..5e792d5f608 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -36,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v64/github" + "github.com/google/go-github/v65/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/ratelimit/main.go b/example/ratelimit/main.go index f111e8d124c..8609543073a 100644 --- a/example/ratelimit/main.go +++ b/example/ratelimit/main.go @@ -13,7 +13,7 @@ import ( "fmt" "github.com/gofri/go-github-ratelimit/github_ratelimit" - "github.com/google/go-github/v64/github" + "github.com/google/go-github/v65/github" ) func main() { diff --git a/example/simple/main.go b/example/simple/main.go index 04456549509..7be316c002b 100644 --- a/example/simple/main.go +++ b/example/simple/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v64/github" + "github.com/google/go-github/v65/github" ) // Fetch all the public organizations' membership of a user. diff --git a/example/tagprotection/main.go b/example/tagprotection/main.go index 5a356f40e38..d0fde28a5f1 100644 --- a/example/tagprotection/main.go +++ b/example/tagprotection/main.go @@ -18,7 +18,7 @@ import ( "os" "strings" - "github.com/google/go-github/v64/github" + "github.com/google/go-github/v65/github" "golang.org/x/term" ) diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index 8ad17bee6ef..25b0f2aaba8 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -15,7 +15,7 @@ import ( "log" "os" - "github.com/google/go-github/v64/github" + "github.com/google/go-github/v65/github" "golang.org/x/term" ) diff --git a/example/topics/main.go b/example/topics/main.go index aa5226b2067..be5a0277b38 100644 --- a/example/topics/main.go +++ b/example/topics/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v64/github" + "github.com/google/go-github/v65/github" ) // Fetch and lists all the public topics associated with the specified GitHub topic diff --git a/github/doc.go b/github/doc.go index 234b5068190..f98f84ef20e 100644 --- a/github/doc.go +++ b/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v64/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v65/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to diff --git a/github/examples_test.go b/github/examples_test.go index 97a7a1e4075..9e4e3b6da45 100644 --- a/github/examples_test.go +++ b/github/examples_test.go @@ -12,7 +12,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v64/github" + "github.com/google/go-github/v65/github" ) func ExampleMarkdownService_Render() { diff --git a/github/github.go b/github/github.go index fcf958ef2f8..cceaec03d49 100644 --- a/github/github.go +++ b/github/github.go @@ -28,7 +28,7 @@ import ( ) const ( - Version = "v64.0.0" + Version = "v65.0.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" diff --git a/go.mod b/go.mod index 1a3133d22ec..d1e35fab661 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v64 +module github.com/google/go-github/v65 require ( github.com/google/go-cmp v0.6.0 diff --git a/test/fields/fields.go b/test/fields/fields.go index 7897b2bd4fb..1c64ac5c35f 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -25,7 +25,7 @@ import ( "reflect" "strings" - "github.com/google/go-github/v64/github" + "github.com/google/go-github/v65/github" ) var ( diff --git a/test/integration/activity_test.go b/test/integration/activity_test.go index 434f7c846c7..32d499c8080 100644 --- a/test/integration/activity_test.go +++ b/test/integration/activity_test.go @@ -12,7 +12,7 @@ import ( "context" "testing" - "github.com/google/go-github/v64/github" + "github.com/google/go-github/v65/github" ) const ( diff --git a/test/integration/authorizations_test.go b/test/integration/authorizations_test.go index 4dcf30a5a5d..d1f6224a7df 100644 --- a/test/integration/authorizations_test.go +++ b/test/integration/authorizations_test.go @@ -15,7 +15,7 @@ import ( "testing" "time" - "github.com/google/go-github/v64/github" + "github.com/google/go-github/v65/github" ) const msgEnvMissing = "Skipping test because the required environment variable (%v) is not present." diff --git a/test/integration/github_test.go b/test/integration/github_test.go index 632772371fd..5474724decf 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -15,7 +15,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v64/github" + "github.com/google/go-github/v65/github" ) var ( diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index f94df2792e0..f33ab00f186 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -15,7 +15,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v64/github" + "github.com/google/go-github/v65/github" ) func TestRepositories_CRUD(t *testing.T) { diff --git a/test/integration/users_test.go b/test/integration/users_test.go index 010a2dd5a9f..aa2b9ba9be0 100644 --- a/test/integration/users_test.go +++ b/test/integration/users_test.go @@ -14,7 +14,7 @@ import ( "math/rand" "testing" - "github.com/google/go-github/v64/github" + "github.com/google/go-github/v65/github" ) func TestUsers_Get(t *testing.T) { diff --git a/tools/go.mod b/tools/go.mod index fbbbf3bff5d..08215dadfdb 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -8,7 +8,7 @@ require ( github.com/alecthomas/kong v0.9.0 github.com/getkin/kin-openapi v0.127.0 github.com/google/go-cmp v0.6.0 - github.com/google/go-github/v64 v64.0.0 + github.com/google/go-github/v65 v65.0.0 golang.org/x/sync v0.8.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -25,4 +25,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v64 => ../ +replace github.com/google/go-github/v65 => ../ diff --git a/tools/metadata/main.go b/tools/metadata/main.go index 99e859b3036..4580484e54a 100644 --- a/tools/metadata/main.go +++ b/tools/metadata/main.go @@ -15,7 +15,7 @@ import ( "path/filepath" "github.com/alecthomas/kong" - "github.com/google/go-github/v64/github" + "github.com/google/go-github/v65/github" ) var helpVars = kong.Vars{ diff --git a/tools/metadata/main_test.go b/tools/metadata/main_test.go index 10a007e9f2c..b976a22a8e7 100644 --- a/tools/metadata/main_test.go +++ b/tools/metadata/main_test.go @@ -23,7 +23,7 @@ import ( "github.com/alecthomas/kong" "github.com/getkin/kin-openapi/openapi3" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v64/github" + "github.com/google/go-github/v65/github" ) func TestUpdateGo(t *testing.T) { diff --git a/tools/metadata/metadata.go b/tools/metadata/metadata.go index 1d844a4310a..392306903d0 100644 --- a/tools/metadata/metadata.go +++ b/tools/metadata/metadata.go @@ -24,7 +24,7 @@ import ( "strings" "sync" - "github.com/google/go-github/v64/github" + "github.com/google/go-github/v65/github" "gopkg.in/yaml.v3" ) diff --git a/tools/metadata/openapi.go b/tools/metadata/openapi.go index 5fedb5ca387..dc9e8da1c7e 100644 --- a/tools/metadata/openapi.go +++ b/tools/metadata/openapi.go @@ -14,7 +14,7 @@ import ( "strconv" "github.com/getkin/kin-openapi/openapi3" - "github.com/google/go-github/v64/github" + "github.com/google/go-github/v65/github" "golang.org/x/sync/errgroup" ) From 4d1293254b874c72f4bd6595a49d12edfa4441cf Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Mon, 16 Sep 2024 09:37:20 -0400 Subject: [PATCH 504/751] Bump go-github from v64 to v65 in /scrape (#3267) --- scrape/apps.go | 2 +- scrape/apps_test.go | 2 +- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scrape/apps.go b/scrape/apps.go index 12ca7c0f136..cf294f72f51 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -18,7 +18,7 @@ import ( "strings" "github.com/PuerkitoBio/goquery" - "github.com/google/go-github/v64/github" + "github.com/google/go-github/v65/github" ) // AppRestrictionsEnabled returns whether the specified organization has diff --git a/scrape/apps_test.go b/scrape/apps_test.go index 331c021c82c..741bfbb6127 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v64/github" + "github.com/google/go-github/v65/github" ) func Test_AppRestrictionsEnabled(t *testing.T) { diff --git a/scrape/go.mod b/scrape/go.mod index 04eff1de445..91a05ac4d63 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -7,7 +7,7 @@ toolchain go1.22.0 require ( github.com/PuerkitoBio/goquery v1.9.2 github.com/google/go-cmp v0.6.0 - github.com/google/go-github/v64 v64.0.0 + github.com/google/go-github/v65 v65.0.0 github.com/xlzd/gotp v0.1.0 golang.org/x/net v0.29.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index f3014057cac..fa424ba7a11 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -5,8 +5,8 @@ github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6 github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v64 v64.0.0 h1:4G61sozmY3eiPAjjoOHponXDBONm+utovTKbyUb2Qdg= -github.com/google/go-github/v64 v64.0.0/go.mod h1:xB3vqMQNdHzilXBiO2I+M7iEFtHf+DP/omBOv6tQzVo= +github.com/google/go-github/v65 v65.0.0 h1:pQ7BmO3DZivvFk92geC0jB0q2m3gyn8vnYPgV7GSLhQ= +github.com/google/go-github/v65 v65.0.0/go.mod h1:DvrqWo5hvsdhJvHd4WyVF9ttANN3BniqjP8uTFMNb60= 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.1.0 h1:37blvlKCh38s+fkem+fFh7sMnceltoIEBYTVXyoa5Po= From 603bc4ace6289fe785ecdaf00267af60ea3a03fb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2024 15:26:56 -0400 Subject: [PATCH 505/751] Bump github.com/alecthomas/kong from 0.9.0 to 1.2.1 in /tools (#3268) --- tools/go.mod | 2 +- tools/go.sum | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index 08215dadfdb..1b61373c3e8 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -5,7 +5,7 @@ go 1.21 toolchain go1.22.0 require ( - github.com/alecthomas/kong v0.9.0 + github.com/alecthomas/kong v1.2.1 github.com/getkin/kin-openapi v0.127.0 github.com/google/go-cmp v0.6.0 github.com/google/go-github/v65 v65.0.0 diff --git a/tools/go.sum b/tools/go.sum index 9cff8611b5c..928a46b0694 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -1,7 +1,7 @@ -github.com/alecthomas/assert/v2 v2.6.0 h1:o3WJwILtexrEUk3cUVal3oiQY2tfgr/FHWiz/v2n4FU= -github.com/alecthomas/assert/v2 v2.6.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= -github.com/alecthomas/kong v0.9.0 h1:G5diXxc85KvoV2f0ZRVuMsi45IrBgx9zDNGNj165aPA= -github.com/alecthomas/kong v0.9.0/go.mod h1:Y47y5gKfHp1hDc7CH7OeXgLIpp+Q2m1Ni0L5s3bI8Os= +github.com/alecthomas/assert/v2 v2.10.0 h1:jjRCHsj6hBJhkmhznrCzoNpbA3zqy0fYiUcYZP/GkPY= +github.com/alecthomas/assert/v2 v2.10.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= +github.com/alecthomas/kong v1.2.1 h1:E8jH4Tsgv6wCRX2nGrdPyHDUCSG83WH2qE4XLACD33Q= +github.com/alecthomas/kong v1.2.1/go.mod h1:rKTSFhbdp3Ryefn8x5MOEprnRFQ7nlmMC01GKhehhBM= github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc= github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= From 057ff1b1ae61d4ea6e71b00b712b26b2650772cc Mon Sep 17 00:00:00 2001 From: Daniel Cole <10801604+danhcole@users.noreply.github.com> Date: Tue, 17 Sep 2024 11:18:28 -0400 Subject: [PATCH 506/751] Add 'mark thread as done' functionality (#3265) Fixes #3264. --- github/activity_notifications.go | 17 +++++++++++++++++ github/activity_notifications_test.go | 26 ++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/github/activity_notifications.go b/github/activity_notifications.go index 47f22261dd2..e712323ed43 100644 --- a/github/activity_notifications.go +++ b/github/activity_notifications.go @@ -178,6 +178,23 @@ func (s *ActivityService) MarkThreadRead(ctx context.Context, id string) (*Respo return s.client.Do(ctx, req, nil) } +// MarkThreadDone marks the specified thread as done. +// Marking a thread as "done" is equivalent to marking a notification in your notification inbox on GitHub as done. +// +// GitHub API docs: https://docs.github.com/rest/activity/notifications#mark-a-thread-as-done +// +//meta:operation DELETE /notifications/threads/{thread_id} +func (s *ActivityService) MarkThreadDone(ctx context.Context, id int64) (*Response, error) { + u := fmt.Sprintf("notifications/threads/%v", id) + + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + // GetThreadSubscription checks to see if the authenticated user is subscribed // to a thread. // diff --git a/github/activity_notifications_test.go b/github/activity_notifications_test.go index 815238ebb5e..0c224924cc8 100644 --- a/github/activity_notifications_test.go +++ b/github/activity_notifications_test.go @@ -208,6 +208,32 @@ func TestActivityService_MarkThreadRead(t *testing.T) { }) } +func TestActivityService_MarkThreadDone(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/notifications/threads/1", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + w.WriteHeader(http.StatusResetContent) + }) + + ctx := context.Background() + _, err := client.Activity.MarkThreadDone(ctx, 1) + if err != nil { + t.Errorf("Activity.MarkThreadDone returned error: %v", err) + } + + const methodName = "MarkThreadDone" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Activity.MarkThreadDone(ctx, 0) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Activity.MarkThreadDone(ctx, 1) + }) +} + func TestActivityService_GetThreadSubscription(t *testing.T) { client, mux, _, teardown := setup() defer teardown() From ef170a37fe6e955b0e511c245c211115c9948ba8 Mon Sep 17 00:00:00 2001 From: Mudit Date: Thu, 19 Sep 2024 16:49:59 +0200 Subject: [PATCH 507/751] feat!: Add login query param support to ListCredentialAuthorizations (#3270) BREAKING CHANGE: `ListCredentialAuthorizations` now takes `opts *CredentialAuthorizationsListOptions` instead of `ListOptions`. --- github/orgs_credential_authorizations.go | 12 +++++++++++- github/orgs_credential_authorizations_test.go | 8 ++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/github/orgs_credential_authorizations.go b/github/orgs_credential_authorizations.go index eed0f0c66e0..dca42433c30 100644 --- a/github/orgs_credential_authorizations.go +++ b/github/orgs_credential_authorizations.go @@ -55,13 +55,23 @@ type CredentialAuthorization struct { AuthorizedCredentialExpiresAt *Timestamp `json:"authorized_credential_expires_at,omitempty"` } +// CredentialAuthorizationsListOptions adds the Login option as supported by the +// list SAML SSO authorizations for organizations endpoint alongside paging options +// such as Page and PerPage. +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/orgs#list-saml-sso-authorizations-for-an-organization +type CredentialAuthorizationsListOptions struct { + ListOptions + // For credentials authorizations for an organization, limit the list of authorizations to a specific login (aka github username) + Login string `url:"login,omitempty"` +} + // ListCredentialAuthorizations lists credentials authorized through SAML SSO // for a given organization. Only available with GitHub Enterprise Cloud. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/orgs#list-saml-sso-authorizations-for-an-organization // //meta:operation GET /orgs/{org}/credential-authorizations -func (s *OrganizationsService) ListCredentialAuthorizations(ctx context.Context, org string, opts *ListOptions) ([]*CredentialAuthorization, *Response, error) { +func (s *OrganizationsService) ListCredentialAuthorizations(ctx context.Context, org string, opts *CredentialAuthorizationsListOptions) ([]*CredentialAuthorization, *Response, error) { u := fmt.Sprintf("orgs/%v/credential-authorizations", org) u, err := addOptions(u, opts) if err != nil { diff --git a/github/orgs_credential_authorizations_test.go b/github/orgs_credential_authorizations_test.go index e3986eb5ca2..006ee86c45c 100644 --- a/github/orgs_credential_authorizations_test.go +++ b/github/orgs_credential_authorizations_test.go @@ -21,7 +21,7 @@ func TestOrganizationsService_ListCredentialAuthorizations(t *testing.T) { mux.HandleFunc("/orgs/o/credential-authorizations", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, http.MethodGet) - testFormValues(t, r, values{"per_page": "2", "page": "2"}) + testFormValues(t, r, values{"per_page": "2", "page": "2", "login": "l"}) fmt.Fprint(w, `[ { "login": "l", @@ -34,7 +34,11 @@ func TestOrganizationsService_ListCredentialAuthorizations(t *testing.T) { ]`) }) - opts := &ListOptions{Page: 2, PerPage: 2} + opts := &CredentialAuthorizationsListOptions{ + ListOptions: ListOptions{Page: 2, PerPage: 2}, + Login: "l", + } + ctx := context.Background() creds, _, err := client.Organizations.ListCredentialAuthorizations(ctx, "o", opts) if err != nil { From 23592519310b534946cbb8527ad6a92d5d29ddd0 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Fri, 20 Sep 2024 08:43:03 -0400 Subject: [PATCH 508/751] Update comment for Ruleset (#3275) --- github/repos_rules.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/repos_rules.go b/github/repos_rules.go index a90555cc442..50e75cdba1b 100644 --- a/github/repos_rules.go +++ b/github/repos_rules.go @@ -458,7 +458,7 @@ func NewFilePathRestrictionRule(params *RuleFileParameters) (rule *RepositoryRul type Ruleset struct { ID *int64 `json:"id,omitempty"` Name string `json:"name"` - // Possible values for Target are branch, tag + // Possible values for Target are branch, tag, push Target *string `json:"target,omitempty"` // Possible values for SourceType are: Repository, Organization SourceType *string `json:"source_type,omitempty"` From ba862154cd5d45b673df421231aba474f8f3768d Mon Sep 17 00:00:00 2001 From: Pranav Bansal <55818107+prnvbn@users.noreply.github.com> Date: Sat, 21 Sep 2024 15:05:06 +0100 Subject: [PATCH 509/751] Add missing fields to the checksuite event (#3278) Fixes: #3277. --- github/checks.go | 5 ++++- github/checks_test.go | 8 +++++++- github/github-accessors.go | 24 ++++++++++++++++++++++ github/github-accessors_test.go | 30 ++++++++++++++++++++++++++++ github/github-stringify_test.go | 35 ++++++++++++++++++--------------- 5 files changed, 84 insertions(+), 18 deletions(-) diff --git a/github/checks.go b/github/checks.go index a8618944532..71e50c15f29 100644 --- a/github/checks.go +++ b/github/checks.go @@ -85,7 +85,10 @@ type CheckSuite struct { PullRequests []*PullRequest `json:"pull_requests,omitempty"` // The following fields are only populated by Webhook events. - HeadCommit *Commit `json:"head_commit,omitempty"` + HeadCommit *Commit `json:"head_commit,omitempty"` + LatestCheckRunsCount *int64 `json:"latest_check_runs_count,omitempty"` + Rerequstable *bool `json:"rerequestable,omitempty"` + RunsRerequstable *bool `json:"runs_rerequestable,omitempty"` } func (c CheckRun) String() string { diff --git a/github/checks_test.go b/github/checks_test.go index 2fdd2476e56..48f6370fe96 100644 --- a/github/checks_test.go +++ b/github/checks_test.go @@ -888,6 +888,9 @@ func Test_CheckSuiteMarshal(t *testing.T) { HeadCommit: &Commit{ SHA: String("s"), }, + LatestCheckRunsCount: Int64(1), + Rerequstable: Bool(true), + RunsRerequstable: Bool(true), } w := fmt.Sprintf(`{ @@ -949,7 +952,10 @@ func Test_CheckSuiteMarshal(t *testing.T) { ], "head_commit": { "sha": "s" - } + }, + "latest_check_runs_count": 1, + "rerequestable": true, + "runs_rerequestable": true }`, ts, ts) testJSONMarshal(t, &c, w) diff --git a/github/github-accessors.go b/github/github-accessors.go index 1abbabd0b63..a99a06aa314 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -2286,6 +2286,14 @@ func (c *CheckSuite) GetID() int64 { return *c.ID } +// GetLatestCheckRunsCount returns the LatestCheckRunsCount field if it's non-nil, zero value otherwise. +func (c *CheckSuite) GetLatestCheckRunsCount() int64 { + if c == nil || c.LatestCheckRunsCount == nil { + return 0 + } + return *c.LatestCheckRunsCount +} + // GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. func (c *CheckSuite) GetNodeID() string { if c == nil || c.NodeID == nil { @@ -2302,6 +2310,22 @@ func (c *CheckSuite) GetRepository() *Repository { return c.Repository } +// GetRerequstable returns the Rerequstable field if it's non-nil, zero value otherwise. +func (c *CheckSuite) GetRerequstable() bool { + if c == nil || c.Rerequstable == nil { + return false + } + return *c.Rerequstable +} + +// GetRunsRerequstable returns the RunsRerequstable field if it's non-nil, zero value otherwise. +func (c *CheckSuite) GetRunsRerequstable() bool { + if c == nil || c.RunsRerequstable == nil { + return false + } + return *c.RunsRerequstable +} + // GetStatus returns the Status field if it's non-nil, zero value otherwise. func (c *CheckSuite) GetStatus() string { if c == nil || c.Status == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 6d1419c79f2..2db51bab3dd 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -2708,6 +2708,16 @@ func TestCheckSuite_GetID(tt *testing.T) { c.GetID() } +func TestCheckSuite_GetLatestCheckRunsCount(tt *testing.T) { + var zeroValue int64 + c := &CheckSuite{LatestCheckRunsCount: &zeroValue} + c.GetLatestCheckRunsCount() + c = &CheckSuite{} + c.GetLatestCheckRunsCount() + c = nil + c.GetLatestCheckRunsCount() +} + func TestCheckSuite_GetNodeID(tt *testing.T) { var zeroValue string c := &CheckSuite{NodeID: &zeroValue} @@ -2725,6 +2735,26 @@ func TestCheckSuite_GetRepository(tt *testing.T) { c.GetRepository() } +func TestCheckSuite_GetRerequstable(tt *testing.T) { + var zeroValue bool + c := &CheckSuite{Rerequstable: &zeroValue} + c.GetRerequstable() + c = &CheckSuite{} + c.GetRerequstable() + c = nil + c.GetRerequstable() +} + +func TestCheckSuite_GetRunsRerequstable(tt *testing.T) { + var zeroValue bool + c := &CheckSuite{RunsRerequstable: &zeroValue} + c.GetRunsRerequstable() + c = &CheckSuite{} + c.GetRunsRerequstable() + c = nil + c.GetRunsRerequstable() +} + func TestCheckSuite_GetStatus(tt *testing.T) { var zeroValue string c := &CheckSuite{Status: &zeroValue} diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index 8633d837d12..4a210326f9a 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -182,22 +182,25 @@ func TestCheckRun_String(t *testing.T) { func TestCheckSuite_String(t *testing.T) { v := CheckSuite{ - ID: Int64(0), - NodeID: String(""), - HeadBranch: String(""), - HeadSHA: String(""), - URL: String(""), - BeforeSHA: String(""), - AfterSHA: String(""), - Status: String(""), - Conclusion: String(""), - CreatedAt: &Timestamp{}, - UpdatedAt: &Timestamp{}, - App: &App{}, - Repository: &Repository{}, - HeadCommit: &Commit{}, - } - want := `github.CheckSuite{ID:0, NodeID:"", HeadBranch:"", HeadSHA:"", URL:"", BeforeSHA:"", AfterSHA:"", Status:"", Conclusion:"", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, App:github.App{}, Repository:github.Repository{}, HeadCommit:github.Commit{}}` + ID: Int64(0), + NodeID: String(""), + HeadBranch: String(""), + HeadSHA: String(""), + URL: String(""), + BeforeSHA: String(""), + AfterSHA: String(""), + Status: String(""), + Conclusion: String(""), + CreatedAt: &Timestamp{}, + UpdatedAt: &Timestamp{}, + App: &App{}, + Repository: &Repository{}, + HeadCommit: &Commit{}, + LatestCheckRunsCount: Int64(0), + Rerequstable: Bool(false), + RunsRerequstable: Bool(false), + } + want := `github.CheckSuite{ID:0, NodeID:"", HeadBranch:"", HeadSHA:"", URL:"", BeforeSHA:"", AfterSHA:"", Status:"", Conclusion:"", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, App:github.App{}, Repository:github.Repository{}, HeadCommit:github.Commit{}, LatestCheckRunsCount:0, Rerequstable:false, RunsRerequstable:false}` if got := v.String(); got != want { t.Errorf("CheckSuite.String = %v, want %v", got, want) } From 46f1127c50024fd92c7bb10992e1baaf607ee5e7 Mon Sep 17 00:00:00 2001 From: Felix Luthman <34520175+felixlut@users.noreply.github.com> Date: Sat, 21 Sep 2024 21:25:21 +0200 Subject: [PATCH 510/751] chore: Change golangci-lint output format due to deprecation (#3279) --- script/lint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/lint.sh b/script/lint.sh index ccd0cf1150c..1434cc69042 100755 --- a/script/lint.sh +++ b/script/lint.sh @@ -33,7 +33,7 @@ for dir in $MOD_DIRS; do cd "$dir" # github actions output when running in an action if [ -n "$GITHUB_ACTIONS" ]; then - "$BIN"/golangci-lint run --path-prefix "$dir" --out-format github-actions + "$BIN"/golangci-lint run --path-prefix "$dir" --out-format colored-line-number else "$BIN"/golangci-lint run --path-prefix "$dir" fi From 63c97e6b532f62c65ffa14f28724fb0c4648874c Mon Sep 17 00:00:00 2001 From: Felix Luthman <34520175+felixlut@users.noreply.github.com> Date: Sun, 22 Sep 2024 23:13:36 +0200 Subject: [PATCH 511/751] feat: Support baseRole option for custom organization roles (#3284) Fixes: #3283. --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ github/orgs_custom_roles.go | 1 + 3 files changed, 19 insertions(+) diff --git a/github/github-accessors.go b/github/github-accessors.go index a99a06aa314..a025f781faf 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -4414,6 +4414,14 @@ func (c *CreateOrUpdateCustomRepoRoleOptions) GetName() string { return *c.Name } +// GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise. +func (c *CreateOrUpdateOrgRoleOptions) GetBaseRole() string { + if c == nil || c.BaseRole == nil { + return "" + } + return *c.BaseRole +} + // GetDescription returns the Description field if it's non-nil, zero value otherwise. func (c *CreateOrUpdateOrgRoleOptions) GetDescription() string { if c == nil || c.Description == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 2db51bab3dd..ae380160dc7 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -5179,6 +5179,16 @@ func TestCreateOrUpdateCustomRepoRoleOptions_GetName(tt *testing.T) { c.GetName() } +func TestCreateOrUpdateOrgRoleOptions_GetBaseRole(tt *testing.T) { + var zeroValue string + c := &CreateOrUpdateOrgRoleOptions{BaseRole: &zeroValue} + c.GetBaseRole() + c = &CreateOrUpdateOrgRoleOptions{} + c.GetBaseRole() + c = nil + c.GetBaseRole() +} + func TestCreateOrUpdateOrgRoleOptions_GetDescription(tt *testing.T) { var zeroValue string c := &CreateOrUpdateOrgRoleOptions{Description: &zeroValue} diff --git a/github/orgs_custom_roles.go b/github/orgs_custom_roles.go index ca0c6d7bcba..086c4a824f0 100644 --- a/github/orgs_custom_roles.go +++ b/github/orgs_custom_roles.go @@ -54,6 +54,7 @@ type CreateOrUpdateOrgRoleOptions struct { Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` Permissions []string `json:"permissions"` + BaseRole *string `json:"base_role,omitempty"` } // CreateOrUpdateCustomRepoRoleOptions represents options required to create or update a custom repository role. From 00f8dd30848fd9203bc6d926611966a325a88d16 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Sun, 22 Sep 2024 17:34:30 -0400 Subject: [PATCH 512/751] Update AUTHORS (#3286) --- AUTHORS | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 075ba8dfa3d..d2116450984 100644 --- a/AUTHORS +++ b/AUTHORS @@ -13,7 +13,10 @@ 413x 6543 <6543@obermui.de> Abed Kibbe +Abhijit Hota Abhinav Gupta +abhishek +Abhishek Sharma Abhishek Veeramalla aboy Adam Kohring @@ -35,19 +38,24 @@ Alex Orr Alex Su Alex Unger Alexander Harkness +Alexey Alekhin Alexis Gauthiez Ali Farooq +Alin Balutoiu Allan Guwatudde Allen Sun Amey Sakhadeo Anders Janmyr +Andreas Deininger Andreas Garnæs Andrew Ryabchun Andrew Svoboda +Andriyun Andy Grunwald Andy Hume Andy Lindeman angie pinilla +Anish Rajan anjanashenoy Anshuman Bhartiya Antoine @@ -59,6 +67,7 @@ aprp apurwaj2 Aravind Arda Kuyumcu +Ary Arıl Bozoluk Asier Marruedo Austin Burdine @@ -66,9 +75,11 @@ Austin Dizzy Azuka Okuleye Ben Batha Benjamen Keroack +Benjamin Nater Berkay Tacyildiz Beshr Kayali Beyang Liu +billnapier Billy Keyes Billy Lynch Bingtan Lu @@ -93,6 +104,7 @@ Cami Diez Carl Johnson Carlos Alexandro Becker Carlos Tadeu Panato Junior +Casey ChandanChainani chandresh-pancholi Charles Fenwick Elliott @@ -109,6 +121,7 @@ Christian Muehlhaeuser Christoph Jerolimov Christoph Sassenberg CI Monk +Clemens W Colin Misare Craig Gumbley Craig Peterson @@ -137,6 +150,7 @@ DeviousLab Dhi Aurrahman Diego Lapiduz Diogo Vilela +Dion Gionet Mallet Dmitri Shuralyov dmnlk Don Petersen @@ -149,9 +163,12 @@ Eli Uriegas Elliott Beach Emerson Wood Emil V +Emma Sax Eng Zer Jun +Enrico Candino eperm Erick Fejta +Erik Elkins Erik Nobel erwinvaneyk Evan Anderson @@ -163,6 +180,7 @@ Federico Di Pierro Felix Geisendörfer Filippo Valsorda Florian Forster +Florian Maier Florian Wagner Francesc Gil Francis @@ -178,6 +196,7 @@ Glen Mailer Gnahz Google Inc. Grachev Mikhail +Gregory Oschwald griffin_stewie guangwu Guillaume Jacquet @@ -202,6 +221,7 @@ ishan upadhyay isqua Jacob Valdemar Jake Krammer +Jake Scaltreto Jake White Jameel Haffejee James Bowes @@ -210,6 +230,7 @@ James Loh James Maguire James Turley Jamie West +Jan Guth Jan Kosecki Jan Å vábík Jason Field @@ -224,6 +245,7 @@ Jihoon Chung Jille Timmermans Jimmi Dyson Joan Saum +JoannaaKL Joe Tsai John Barton John Engelman @@ -232,6 +254,7 @@ John Liu Jordan Brockopp Jordan Burandt Jordan Sussman +Jorge Ferrero Jorge Gómez Reus Joshua Bezaleel Abednego João Cerqueira @@ -240,6 +263,7 @@ jpbelanger-mtl Juan Juan Basso Julien Garcia Gonzalez +Julien Midedji Julien Rostand Junya Kono Justin Abrahms @@ -257,6 +281,7 @@ Kevin Burke Kevin Wang Kevin Zhao kgalli +Khanh Ngo Kirill Konrad Malawski Kookheon Kwon @@ -266,10 +291,12 @@ Kshitij Saraogi Kumar Saurabh Kyle Kurz kyokomi +Lachlan Cooper Lars Lehtonen Laurent Verdoïa leopoldwang Liam Galvin +Liam Stanley Lluis Campos Lovro Mažgon Loïs Postula @@ -283,6 +310,8 @@ Luke Kysow Luke Roberts Luke Young lynn [they] +Léo Salé +M. Ryan Rigdon Magnus Kulke Maksim Zhylinski Marc Binder @@ -294,6 +323,7 @@ Martins Sipenko Marwan Sulaiman Masayuki Izumi Mat Geist +Matheus Santos Araújo Matija Horvat Matin Rahmanian Matt @@ -301,6 +331,7 @@ Matt Brender Matt Dainty Matt Gaunt Matt Landis +Matt Mencel Matt Moore Matt Simons Matthew Reidy @@ -312,8 +343,11 @@ MichaÅ‚ Glapa Michelangelo Morrillo Miguel Elias dos Santos Mike Chen +Mishin Nikolai mohammad ali <2018cs92@student.uet.edu.pk> Mohammed AlDujaili +Mohammed Nafees +Mudit Mukundan Senthil Munia Balayil Mustafa Abban @@ -321,16 +355,20 @@ Nadav Kaner Naoki Kanatani Nathan VanBenschoten Navaneeth Suresh +Nayeem Hasan Neal Caffery Neil O'Toole +Nicholas Herring Nick Miyake Nick Platt Nick Spragg Nicolas Chapurlat Nikhita Raghunath +Nikita Pivkin Nilesh Singh Noah Hanjun Lee Noah Zoschke +Noble Varghese ns-cweber nxya Ole Orhagen @@ -358,6 +396,7 @@ Pierce McEntagart Pierre Carrier Piotr Zurek Piyush Chugh +Pj Meyer Pratik Mallya Qais Patankar Quang Le Hong @@ -370,6 +409,7 @@ Rafael Aramizu Gomes Rajat Jindal Rajendra arora Rajkumar +Ramesh Gaikwad Ranbir Singh Ravi Shekhar Jethani RaviTeja Pothana @@ -379,18 +419,23 @@ Reetuparna Mukherjee reeves122 Reinier Timmer Renjith R +Rez Moss +Riaje Ricco Førgaard Richard de Vries Rob Figueiredo Rohit Upadhyay Rojan Dinc +Roming22 Ronak Jain Ronan Pelliard Ross Gustafson Ruben Vereecken +Rufina Talalaeva Russell Boley Ryan Leung Ryan Lower +Ryan Skidmore Ryo Nakao Saaarah Safwan Olaimat @@ -452,6 +497,9 @@ Tingluo Huang tkhandel Tobias Gesellchen Tom Payne +Tomasz Adam Skrzypczak +tomfeigin +Travis Tomsu Trey Tacon tsbkw ttacon @@ -483,7 +531,8 @@ Yurii Soldak Yusef Mohamadi Yusuke Kuoka Zach Latta +Ze Peng zhouhaibing089 六开箱 缘生 -蒋航 \ No newline at end of file +蒋航 From c0f5841f185f36b73c578ccf415f6aecd5259f2c Mon Sep 17 00:00:00 2001 From: Felix Luthman <34520175+felixlut@users.noreply.github.com> Date: Mon, 23 Sep 2024 12:53:16 +0200 Subject: [PATCH 513/751] feat: Support getting an organization role (#3285) Fixes: #3282. --- github/orgs_custom_roles.go | 23 ++++++++ github/orgs_custom_roles_test.go | 99 ++++++++++++++++++++++++++++++++ 2 files changed, 122 insertions(+) diff --git a/github/orgs_custom_roles.go b/github/orgs_custom_roles.go index 086c4a824f0..7743ec572f0 100644 --- a/github/orgs_custom_roles.go +++ b/github/orgs_custom_roles.go @@ -88,6 +88,29 @@ func (s *OrganizationsService) ListRoles(ctx context.Context, org string) (*Orga return customRepoRoles, resp, nil } +// GetOrgRole gets an organization role in this organization. +// In order to get organization roles in an organization, the authenticated user must be an organization owner, or have access via an organization role. +// +// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#get-an-organization-role +// +//meta:operation GET /orgs/{org}/organization-roles/{role_id} +func (s *OrganizationsService) GetOrgRole(ctx context.Context, org string, roleID int64) (*CustomOrgRoles, *Response, error) { + u := fmt.Sprintf("orgs/%v/organization-roles/%v", org, roleID) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + resultingRole := new(CustomOrgRoles) + resp, err := s.client.Do(ctx, req, resultingRole) + if err != nil { + return nil, resp, err + } + + return resultingRole, resp, err +} + // CreateCustomOrgRole creates a custom role in this organization. // In order to create custom roles in an organization, the authenticated user must be an organization owner. // diff --git a/github/orgs_custom_roles_test.go b/github/orgs_custom_roles_test.go index 338eac19fc1..a4268b28f82 100644 --- a/github/orgs_custom_roles_test.go +++ b/github/orgs_custom_roles_test.go @@ -98,6 +98,105 @@ func TestOrganizationsService_ListRoles(t *testing.T) { }) } +func TestOrganizationsService_GetOrgRole(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + // Test built-in org role + mux.HandleFunc("/orgs/o/organization-roles/8132", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "id": 8132, + "name": "all_repo_read", + "description": "Grants read access to all repositories in the organization.", + "permissions": [], + "created_at": `+referenceTimeStr+`, + "updated_at": `+referenceTimeStr+`, + "source": "Predefined", + "base_role": "read" + }`) + }) + + ctx := context.Background() + + gotBuiltInRole, _, err := client.Organizations.GetOrgRole(ctx, "o", 8132) + if err != nil { + t.Errorf("Organizations.GetOrgRole returned error: %v", err) + } + + wantBuiltInRole := &CustomOrgRoles{ + ID: Int64(8132), + Name: String("all_repo_read"), + Description: String("Grants read access to all repositories in the organization."), + Permissions: []string{}, + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + Source: String("Predefined"), + BaseRole: String("read"), + } + + if !cmp.Equal(gotBuiltInRole, wantBuiltInRole) { + t.Errorf("Organizations.GetOrgRole returned %+v, want %+v", gotBuiltInRole, wantBuiltInRole) + } + + // Test custom org role + mux.HandleFunc("/orgs/o/organization-roles/123456", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "id": 123456, + "name": "test-role", + "description": "test-role", + "permissions": [ + "read_organization_custom_org_role", + "read_organization_custom_repo_role", + "write_organization_custom_org_role" + ], + "created_at": `+referenceTimeStr+`, + "updated_at": `+referenceTimeStr+`, + "source": "Organization", + "base_role": null + }`) + }) + + gotCustomRole, _, err := client.Organizations.GetOrgRole(ctx, "o", 123456) + if err != nil { + t.Errorf("Organizations.GetOrgRole returned error: %v", err) + } + + wantCustomRole := &CustomOrgRoles{ + ID: Int64(123456), + Name: String("test-role"), + Description: String("test-role"), + Permissions: []string{ + "read_organization_custom_org_role", + "read_organization_custom_repo_role", + "write_organization_custom_org_role", + }, + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + Source: String("Organization"), + BaseRole: nil, + } + + if !cmp.Equal(gotCustomRole, wantCustomRole) { + t.Errorf("Organizations.GetOrgRole returned %+v, want %+v", gotCustomRole, wantCustomRole) + } + + const methodName = "GetOrgRole" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.GetOrgRole(ctx, "\no", -8132) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.GetOrgRole(ctx, "o", 8132) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + func TestOrganizationsService_CreateCustomOrgRole(t *testing.T) { client, mux, _, teardown := setup() defer teardown() From eda704967b4079bb214c407e17fa3ba5a2a001d7 Mon Sep 17 00:00:00 2001 From: Felix Luthman <34520175+felixlut@users.noreply.github.com> Date: Mon, 23 Sep 2024 15:40:47 +0200 Subject: [PATCH 514/751] feat: Implement organization role assignments for both users and teams (#3281) Fixes: #3280. --- github/orgs_custom_roles.go | 88 +++++++++++++++++++++++ github/orgs_custom_roles_test.go | 116 +++++++++++++++++++++++++++++++ 2 files changed, 204 insertions(+) diff --git a/github/orgs_custom_roles.go b/github/orgs_custom_roles.go index 7743ec572f0..f48fc697ec9 100644 --- a/github/orgs_custom_roles.go +++ b/github/orgs_custom_roles.go @@ -180,6 +180,94 @@ func (s *OrganizationsService) DeleteCustomOrgRole(ctx context.Context, org stri return resp, nil } +// AssignOrgRoleToTeam assigns an existing organization role to a team in this organization. +// In order to assign organization roles in an organization, the authenticated user must be an organization owner. +// +// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-team +// +//meta:operation PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id} +func (s *OrganizationsService) AssignOrgRoleToTeam(ctx context.Context, org, teamSlug string, roleID int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/organization-roles/teams/%v/%v", org, teamSlug, roleID) + + 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 +} + +// RemoveOrgRoleFromTeam removes an existing organization role assignment from a team in this organization. +// In order to remove organization role assignments in an organization, the authenticated user must be an organization owner. +// +// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#remove-an-organization-role-from-a-team +// +//meta:operation DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id} +func (s *OrganizationsService) RemoveOrgRoleFromTeam(ctx context.Context, org, teamSlug string, roleID int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/organization-roles/teams/%v/%v", org, teamSlug, roleID) + + 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 +} + +// AssignOrgRoleToUser assigns an existing organization role to a user in this organization. +// In order to assign organization roles in an organization, the authenticated user must be an organization owner. +// +// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-user +// +//meta:operation PUT /orgs/{org}/organization-roles/users/{username}/{role_id} +func (s *OrganizationsService) AssignOrgRoleToUser(ctx context.Context, org, username string, roleID int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/organization-roles/users/%v/%v", org, username, roleID) + + 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 +} + +// RemoveOrgRoleFromUser removes an existing organization role assignment from a user in this organization. +// In order to remove organization role assignments in an organization, the authenticated user must be an organization owner. +// +// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#remove-an-organization-role-from-a-user +// +//meta:operation DELETE /orgs/{org}/organization-roles/users/{username}/{role_id} +func (s *OrganizationsService) RemoveOrgRoleFromUser(ctx context.Context, org, username string, roleID int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/organization-roles/users/%v/%v", org, username, roleID) + + 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 +} + // ListCustomRepoRoles lists the custom repository roles available in this organization. // In order to see custom repository roles in an organization, the authenticated user must be an organization owner. // diff --git a/github/orgs_custom_roles_test.go b/github/orgs_custom_roles_test.go index a4268b28f82..dad11594bfd 100644 --- a/github/orgs_custom_roles_test.go +++ b/github/orgs_custom_roles_test.go @@ -311,6 +311,122 @@ func TestOrganizationsService_DeleteCustomOrgRole(t *testing.T) { }) } +func TestOrganizationsService_AssignOrgRoleToTeam(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/organization-roles/teams/t/8030", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + w.WriteHeader(http.StatusNoContent) + }) + + ctx := context.Background() + resp, err := client.Organizations.AssignOrgRoleToTeam(ctx, "o", "t", 8030) + if err != nil { + t.Errorf("Organization.AssignOrgRoleToTeam return error: %v", err) + } + if !cmp.Equal(resp.StatusCode, http.StatusNoContent) { + t.Errorf("Organizations.AssignOrgRoleToTeam returned status code %+v, want %+v", resp.StatusCode, http.StatusNoContent) + } + + const methodName = "AssignOrgRoleToTeam" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Organizations.AssignOrgRoleToTeam(ctx, "\no", "\nt", -8030) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Organizations.AssignOrgRoleToTeam(ctx, "o", "t", 8030) + }) +} + +func TestOrganizationsService_RemoveOrgRoleFromTeam(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/organization-roles/teams/t/8030", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + w.WriteHeader(http.StatusNoContent) + }) + + ctx := context.Background() + resp, err := client.Organizations.RemoveOrgRoleFromTeam(ctx, "o", "t", 8030) + if err != nil { + t.Errorf("Organization.RemoveOrgRoleFromTeam return error: %v", err) + } + if !cmp.Equal(resp.StatusCode, http.StatusNoContent) { + t.Errorf("Organizations.RemoveOrgRoleFromTeam returned status code %+v, want %+v", resp.StatusCode, http.StatusNoContent) + } + + const methodName = "RemoveOrgRoleFromTeam" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Organizations.RemoveOrgRoleFromTeam(ctx, "\no", "\nt", -8030) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Organizations.RemoveOrgRoleFromTeam(ctx, "o", "t", 8030) + }) +} + +func TestOrganizationsService_AssignOrgRoleToUser(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/organization-roles/users/t/8030", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + w.WriteHeader(http.StatusNoContent) + }) + + ctx := context.Background() + resp, err := client.Organizations.AssignOrgRoleToUser(ctx, "o", "t", 8030) + if err != nil { + t.Errorf("Organization.AssignOrgRoleToUser return error: %v", err) + } + if !cmp.Equal(resp.StatusCode, http.StatusNoContent) { + t.Errorf("Organizations.AssignOrgRoleToUser returned status code %+v, want %+v", resp.StatusCode, http.StatusNoContent) + } + + const methodName = "AssignOrgRoleToUser" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Organizations.AssignOrgRoleToUser(ctx, "\no", "\nt", -8030) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Organizations.AssignOrgRoleToUser(ctx, "o", "t", 8030) + }) +} + +func TestOrganizationsService_RemoveOrgRoleFromUser(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/organization-roles/users/t/8030", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + w.WriteHeader(http.StatusNoContent) + }) + + ctx := context.Background() + resp, err := client.Organizations.RemoveOrgRoleFromUser(ctx, "o", "t", 8030) + if err != nil { + t.Errorf("Organization.RemoveOrgRoleFromUser return error: %v", err) + } + if !cmp.Equal(resp.StatusCode, http.StatusNoContent) { + t.Errorf("Organizations.RemoveOrgRoleFromUser returned status code %+v, want %+v", resp.StatusCode, http.StatusNoContent) + } + + const methodName = "RemoveOrgRoleFromUser" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Organizations.RemoveOrgRoleFromUser(ctx, "\no", "\nt", -8030) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Organizations.RemoveOrgRoleFromUser(ctx, "o", "t", 8030) + }) +} + func TestOrganizationsService_ListCustomRepoRoles(t *testing.T) { client, mux, _, teardown := setup() defer teardown() From 7fbf488d958e4f2d7d20f7c6a5ec2e3c544bf0a6 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Tue, 24 Sep 2024 17:56:57 +0300 Subject: [PATCH 515/751] chore: Enable gosec G602 rule (#3287) --- .golangci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 5f602dd2636..b452f669096 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -20,9 +20,6 @@ linters-settings: excludes: # duplicates errcheck - G104 - # performance issue: see https://github.com/golangci/golangci-lint/issues/4039 - # and https://github.com/securego/gosec/issues/1007 - - G602 # int(os.Stdin.Fd()) - G115 issues: From 2406067865f4b36a5b994868e4bc3f1922bf8a32 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Tue, 24 Sep 2024 18:05:32 +0300 Subject: [PATCH 516/751] fix: Correct typos in vars, comments, tests (#3289) --- github/actions_artifacts_test.go | 2 +- github/actions_cache.go | 4 ++-- github/actions_runners_test.go | 2 +- github/apps_test.go | 2 +- github/github.go | 2 +- github/issue_import_test.go | 2 +- github/migrations_source_import.go | 2 +- github/orgs_members.go | 2 +- github/repos.go | 4 ++-- github/teams_discussion_comments.go | 6 +++--- github/teams_discussion_comments_test.go | 4 ++-- github/teams_discussions.go | 2 +- github/teams_test.go | 14 +++++++------- github/users_emails.go | 4 ++-- github/users_gpg_keys.go | 2 +- 15 files changed, 27 insertions(+), 27 deletions(-) diff --git a/github/actions_artifacts_test.go b/github/actions_artifacts_test.go index 296e7259c08..61790daf415 100644 --- a/github/actions_artifacts_test.go +++ b/github/actions_artifacts_test.go @@ -267,7 +267,7 @@ func TestActionsService_GetArtifact_notFound(t *testing.T) { } } -func TestActionsSerivice_DownloadArtifact(t *testing.T) { +func TestActionsService_DownloadArtifact(t *testing.T) { client, mux, _, teardown := setup() defer teardown() diff --git a/github/actions_cache.go b/github/actions_cache.go index 271d7d82069..852e9860f1c 100644 --- a/github/actions_cache.go +++ b/github/actions_cache.go @@ -173,7 +173,7 @@ func (s *ActionsService) GetCacheUsageForRepo(ctx context.Context, owner, repo s // refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated. // // Permissions: You must authenticate using an access token with the read:org scope to use this endpoint. -// GitHub Apps must have the organization_admistration:read permission to use this endpoint. +// GitHub Apps must have the organization_administration:read permission to use this endpoint. // // GitHub API docs: https://docs.github.com/rest/actions/cache#list-repositories-with-github-actions-cache-usage-for-an-organization // @@ -203,7 +203,7 @@ func (s *ActionsService) ListCacheUsageByRepoForOrg(ctx context.Context, org str // 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated. // // Permissions: You must authenticate using an access token with the read:org scope to use this endpoint. -// GitHub Apps must have the organization_admistration:read permission to use this endpoint. +// GitHub Apps must have the organization_administration:read permission to use this endpoint. // // GitHub API docs: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-an-organization // diff --git a/github/actions_runners_test.go b/github/actions_runners_test.go index f425e8af7b0..beaf01b3d13 100644 --- a/github/actions_runners_test.go +++ b/github/actions_runners_test.go @@ -536,7 +536,7 @@ func TestActionsService_RemoveOrganizationRunner(t *testing.T) { ctx := context.Background() _, err := client.Actions.RemoveOrganizationRunner(ctx, "o", 21) if err != nil { - t.Errorf("Actions.RemoveOganizationRunner returned error: %v", err) + t.Errorf("Actions.RemoveOrganizationRunner returned error: %v", err) } const methodName = "RemoveOrganizationRunner" diff --git a/github/apps_test.go b/github/apps_test.go index aafc263dca0..9b2e0a59114 100644 --- a/github/apps_test.go +++ b/github/apps_test.go @@ -544,7 +544,7 @@ func TestAppsService_CreateInstallationTokenListReposWithNoOptions(t *testing.T) }) } -func TestAppsService_CreateAttachement(t *testing.T) { +func TestAppsService_CreateAttachment(t *testing.T) { client, mux, _, teardown := setup() defer teardown() diff --git a/github/github.go b/github/github.go index cceaec03d49..f0a862855e1 100644 --- a/github/github.go +++ b/github/github.go @@ -774,7 +774,7 @@ func parseSecondaryRate(r *http.Response) *time.Duration { // According to GitHub support, endpoints might return x-ratelimit-reset instead, // as an integer which represents the number of seconds since epoch UTC, - // represting the time to resume making requests. + // representing the time to resume making requests. if v := r.Header.Get(headerRateReset); v != "" { secondsSinceEpoch, _ := strconv.ParseInt(v, 10, 64) // Error handling is noop. retryAfter := time.Until(time.Unix(secondsSinceEpoch, 0)) diff --git a/github/issue_import_test.go b/github/issue_import_test.go index 17c7c17ffe4..6801c3c0ddb 100644 --- a/github/issue_import_test.go +++ b/github/issue_import_test.go @@ -74,7 +74,7 @@ func TestIssueImportService_Create(t *testing.T) { }) } -func TestIssueImportService_Create_defered(t *testing.T) { +func TestIssueImportService_Create_deferred(t *testing.T) { client, mux, _, teardown := setup() defer teardown() diff --git a/github/migrations_source_import.go b/github/migrations_source_import.go index 3b161232f6a..f484b77d474 100644 --- a/github/migrations_source_import.go +++ b/github/migrations_source_import.go @@ -76,7 +76,7 @@ type Import struct { // Contact GitHub support for more information. // detection_needs_auth - the importer requires authentication for // the originating repository to continue detection. Make an - // UpdatImport request, and include VCSUsername and + // UpdateImport request, and include VCSUsername and // VCSPassword. // detection_found_nothing - the importer didn't recognize any // source control at the URL. diff --git a/github/orgs_members.go b/github/orgs_members.go index 5bc23657fcd..f776766afba 100644 --- a/github/orgs_members.go +++ b/github/orgs_members.go @@ -395,7 +395,7 @@ func (s *OrganizationsService) ListOrgInvitationTeams(ctx context.Context, org, return orgInvitationTeams, resp, nil } -// ListFailedOrgInvitations returns a list of failed inviatations. +// ListFailedOrgInvitations returns a list of failed invitations. // // GitHub API docs: https://docs.github.com/rest/orgs/members#list-failed-organization-invitations // diff --git a/github/repos.go b/github/repos.go index 59ef2329f07..d928771df31 100644 --- a/github/repos.go +++ b/github/repos.go @@ -1363,7 +1363,7 @@ type BypassPullRequestAllowancesRequest struct { // DismissalRestrictions specifies which users and teams can dismiss pull request reviews. type DismissalRestrictions struct { - // The list of users who can dimiss pull request reviews. + // The list of users who can dismiss pull request reviews. Users []*User `json:"users"` // The list of teams which can dismiss pull request reviews. Teams []*Team `json:"teams"` @@ -1372,7 +1372,7 @@ type DismissalRestrictions struct { } // DismissalRestrictionsRequest represents the request to create/edit the -// restriction to allows only specific users, teams or apps to dimiss pull request reviews. It is +// restriction to allows only specific users, teams or apps to dismiss pull request reviews. It is // separate from DismissalRestrictions above because the request structure is // different from the response structure. // Note: Both Users and Teams must be nil, or both must be non-nil. diff --git a/github/teams_discussion_comments.go b/github/teams_discussion_comments.go index ad3818c13fb..eba6fdf46a4 100644 --- a/github/teams_discussion_comments.go +++ b/github/teams_discussion_comments.go @@ -10,7 +10,7 @@ import ( "fmt" ) -// DiscussionComment represents a GitHub dicussion in a team. +// DiscussionComment represents a GitHub discussion in a team. type DiscussionComment struct { Author *User `json:"author,omitempty"` Body *string `json:"body,omitempty"` @@ -145,8 +145,8 @@ func (s *TeamsService) GetCommentBySlug(ctx context.Context, org, slug string, d // GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment // //meta:operation POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments -func (s *TeamsService) CreateCommentByID(ctx context.Context, orgID, teamID int64, discsusionNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { - u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments", orgID, teamID, discsusionNumber) +func (s *TeamsService) CreateCommentByID(ctx context.Context, orgID, teamID int64, discussionNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { + u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments", orgID, teamID, discussionNumber) req, err := s.client.NewRequest("POST", u, comment) if err != nil { return nil, nil, err diff --git a/github/teams_discussion_comments_test.go b/github/teams_discussion_comments_test.go index eaac112bf23..fda0428c658 100644 --- a/github/teams_discussion_comments_test.go +++ b/github/teams_discussion_comments_test.go @@ -26,8 +26,8 @@ func tdcEndpointByID(orgID, teamID, discussionNumber, commentNumber string) stri } // "Team Discussion Comments" endpoint, when using a team slug. -func tdcEndpointBySlug(org, slug, dicsuccionsNumber, commentNumber string) string { - out := fmt.Sprintf("/orgs/%v/teams/%v/discussions/%v/comments", org, slug, dicsuccionsNumber) +func tdcEndpointBySlug(org, slug, discussionNumber, commentNumber string) string { + out := fmt.Sprintf("/orgs/%v/teams/%v/discussions/%v/comments", org, slug, discussionNumber) if commentNumber != "" { return fmt.Sprintf("%v/%v", out, commentNumber) } diff --git a/github/teams_discussions.go b/github/teams_discussions.go index ee78c032a61..b056525f4e9 100644 --- a/github/teams_discussions.go +++ b/github/teams_discussions.go @@ -10,7 +10,7 @@ import ( "fmt" ) -// TeamDiscussion represents a GitHub dicussion in a team. +// TeamDiscussion represents a GitHub discussion in a team. type TeamDiscussion struct { Author *User `json:"author,omitempty"` Body *string `json:"body,omitempty"` diff --git a/github/teams_test.go b/github/teams_test.go index bb4fa4eac38..bf62c3b25fa 100644 --- a/github/teams_test.go +++ b/github/teams_test.go @@ -1700,7 +1700,7 @@ func TestTeams_Marshal(t *testing.T) { "members_count": 1, "repos_count": 1 }, - "ldap_dn": "l" + "ldap_dn": "l" }` testJSONMarshal(t, u, want) @@ -1740,13 +1740,13 @@ func TestIDPGroup_Marshal(t *testing.T) { u := &IDPGroup{ GroupID: String("abc1"), GroupName: String("test group"), - GroupDescription: String("test group descripation"), + GroupDescription: String("test group description"), } want := `{ "group_id": "abc1", "group_name": "test group", - "group_description":"test group descripation" + "group_description":"test group description" }` testJSONMarshal(t, u, want) @@ -2186,12 +2186,12 @@ func TestIDPGroupList_Marshal(t *testing.T) { { GroupID: String("abc1"), GroupName: String("test group"), - GroupDescription: String("test group descripation"), + GroupDescription: String("test group description"), }, { GroupID: String("abc2"), GroupName: String("test group2"), - GroupDescription: String("test group descripation2"), + GroupDescription: String("test group description2"), }, }, } @@ -2201,12 +2201,12 @@ func TestIDPGroupList_Marshal(t *testing.T) { { "group_id": "abc1", "group_name": "test group", - "group_description": "test group descripation" + "group_description": "test group description" }, { "group_id": "abc2", "group_name": "test group2", - "group_description": "test group descripation2" + "group_description": "test group description2" } ] }` diff --git a/github/users_emails.go b/github/users_emails.go index 8386de250b2..189187a74a3 100644 --- a/github/users_emails.go +++ b/github/users_emails.go @@ -86,11 +86,11 @@ func (s *UsersService) DeleteEmails(ctx context.Context, emails []string) (*Resp func (s *UsersService) SetEmailVisibility(ctx context.Context, visibility string) ([]*UserEmail, *Response, error) { u := "user/email/visibility" - updateVisiblilityReq := &UserEmail{ + updateVisibilityReq := &UserEmail{ Visibility: &visibility, } - req, err := s.client.NewRequest("PATCH", u, updateVisiblilityReq) + req, err := s.client.NewRequest("PATCH", u, updateVisibilityReq) if err != nil { return nil, nil, err } diff --git a/github/users_gpg_keys.go b/github/users_gpg_keys.go index de7caaf1bd0..2f296a1ef62 100644 --- a/github/users_gpg_keys.go +++ b/github/users_gpg_keys.go @@ -97,7 +97,7 @@ func (s *UsersService) GetGPGKey(ctx context.Context, id int64) (*GPGKey, *Respo return key, resp, nil } -// CreateGPGKey creates a GPG key. It requires authenticatation via Basic Auth +// CreateGPGKey creates a GPG key. It requires authentication via Basic Auth // or OAuth with at least write:gpg_key scope. // // GitHub API docs: https://docs.github.com/rest/users/gpg-keys#create-a-gpg-key-for-the-authenticated-user From eafd3793741f634a7e2a087bca17b829d08a3c32 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Thu, 26 Sep 2024 14:55:19 +0300 Subject: [PATCH 517/751] fix: Avoid allocation in the stringifyValue (#3292) --- github/strings.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/github/strings.go b/github/strings.go index 147c515e2cf..f5e61aa3265 100644 --- a/github/strings.go +++ b/github/strings.go @@ -27,7 +27,7 @@ func Stringify(message interface{}) string { func stringifyValue(w *bytes.Buffer, val reflect.Value) { if val.Kind() == reflect.Ptr && val.IsNil() { - w.Write([]byte("")) + w.WriteString("") return } @@ -37,20 +37,20 @@ func stringifyValue(w *bytes.Buffer, val reflect.Value) { case reflect.String: fmt.Fprintf(w, `"%s"`, v) case reflect.Slice: - w.Write([]byte{'['}) + w.WriteByte('[') for i := 0; i < v.Len(); i++ { if i > 0 { - w.Write([]byte{' '}) + w.WriteByte(' ') } stringifyValue(w, v.Index(i)) } - w.Write([]byte{']'}) + w.WriteByte(']') return case reflect.Struct: if v.Type().Name() != "" { - w.Write([]byte(v.Type().String())) + w.WriteString(v.Type().String()) } // special handling of Timestamp values @@ -59,7 +59,7 @@ func stringifyValue(w *bytes.Buffer, val reflect.Value) { return } - w.Write([]byte{'{'}) + w.WriteByte('{') var sep bool for i := 0; i < v.NumField(); i++ { @@ -75,17 +75,17 @@ func stringifyValue(w *bytes.Buffer, val reflect.Value) { } if sep { - w.Write([]byte(", ")) + w.WriteString(", ") } else { sep = true } - w.Write([]byte(v.Type().Field(i).Name)) - w.Write([]byte{':'}) + w.WriteString(v.Type().Field(i).Name) + w.WriteByte(':') stringifyValue(w, fv) } - w.Write([]byte{'}'}) + w.WriteByte('}') default: if v.CanInterface() { fmt.Fprint(w, v.Interface()) From dea28a38174785463e183730c27e01dd25729843 Mon Sep 17 00:00:00 2001 From: Guillaume Winter <8502556+DocEmmetBrown@users.noreply.github.com> Date: Thu, 26 Sep 2024 14:03:55 +0200 Subject: [PATCH 518/751] Add CancelInvite method to cancel an org invitation by ID (#3263) --- github/orgs_members.go | 14 ++++++++++++++ github/orgs_members_test.go | 26 ++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/github/orgs_members.go b/github/orgs_members.go index f776766afba..d818d7f9f83 100644 --- a/github/orgs_members.go +++ b/github/orgs_members.go @@ -151,6 +151,20 @@ func (s *OrganizationsService) RemoveMember(ctx context.Context, org, user strin return s.client.Do(ctx, req, nil) } +// CancelInvite cancels an organization invitation. +// +// GitHub API docs: https://docs.github.com/rest/orgs/members#cancel-an-organization-invitation +// +//meta:operation DELETE /orgs/{org}/invitations/{invitation_id} +func (s *OrganizationsService) CancelInvite(ctx context.Context, org string, invitationID int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/invitations/%v", org, invitationID) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + return s.client.Do(ctx, req, nil) +} + // PublicizeMembership publicizes a user's membership in an organization. (A // user cannot publicize the membership for another user.) // diff --git a/github/orgs_members_test.go b/github/orgs_members_test.go index 9526442cda4..3717802a584 100644 --- a/github/orgs_members_test.go +++ b/github/orgs_members_test.go @@ -284,6 +284,32 @@ func TestOrganizationsService_RemoveMember(t *testing.T) { }) } +func TestOrganizationsService_CancelInvite(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/invitations/1", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + w.WriteHeader(http.StatusNoContent) + }) + + ctx := context.Background() + _, err := client.Organizations.CancelInvite(ctx, "o", 1) + if err != nil { + t.Errorf("Organizations.CancelInvite returned error: %v", err) + } + + const methodName = "CancelInvite" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Organizations.CancelInvite(ctx, "\n", 1) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Organizations.CancelInvite(ctx, "o", 1) + }) +} + func TestOrganizationsService_RemoveMember_invalidOrg(t *testing.T) { client, _, _, teardown := setup() defer teardown() From 3d410c20b3a7e4496f5b86b7d85c0a51dbaf782e Mon Sep 17 00:00:00 2001 From: Ryo Shimada <45233435+air-hand@users.noreply.github.com> Date: Thu, 26 Sep 2024 22:28:54 +0900 Subject: [PATCH 519/751] Add support DeploymentReview Event, ReviewCustomDeploymentProtectionRule API, GetPendingDeployments API (#3254) Fixes: #3252. --- github/actions_workflow_runs.go | 64 +++ github/actions_workflow_runs_test.go | 224 ++++++++++ github/event_types.go | 40 ++ github/event_types_test.go | 598 +++++++++++++++++++++++++++ github/github-accessors.go | 240 +++++++++++ github/github-accessors_test.go | 270 ++++++++++++ github/messages.go | 1 + github/messages_test.go | 4 + 8 files changed, 1441 insertions(+) diff --git a/github/actions_workflow_runs.go b/github/actions_workflow_runs.go index d55c01dcd74..122ea1d0e2b 100644 --- a/github/actions_workflow_runs.go +++ b/github/actions_workflow_runs.go @@ -112,6 +112,31 @@ type ReferencedWorkflow struct { Ref *string `json:"ref,omitempty"` } +// PendingDeployment represents the pending_deployments response. +type PendingDeployment struct { + Environment *PendingDeploymentEnvironment `json:"environment,omitempty"` + WaitTimer *int64 `json:"wait_timer,omitempty"` + WaitTimerStartedAt *Timestamp `json:"wait_timer_started_at,omitempty"` + CurrentUserCanApprove *bool `json:"current_user_can_approve,omitempty"` + Reviewers []*RequiredReviewer `json:"reviewers,omitempty"` +} + +// PendingDeploymentEnvironment represents pending deployment environment properties. +type PendingDeploymentEnvironment struct { + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Name *string `json:"name,omitempty"` + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` +} + +// ReviewCustomDeploymentProtectionRuleRequest specifies the parameters to ReviewCustomDeploymentProtectionRule. +type ReviewCustomDeploymentProtectionRuleRequest struct { + EnvironmentName string `json:"environment_name"` + 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 { @@ -388,6 +413,28 @@ func (s *ActionsService) GetWorkflowRunUsageByID(ctx context.Context, owner, rep return workflowRunUsage, resp, nil } +// GetPendingDeployments get all deployment environments for a workflow run that are waiting for protection rules to pass. +// +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-pending-deployments-for-a-workflow-run +// +//meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments +func (s *ActionsService) GetPendingDeployments(ctx context.Context, owner, repo string, runID int64) ([]*PendingDeployment, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/pending_deployments", owner, repo, runID) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var deployments []*PendingDeployment + resp, err := s.client.Do(ctx, req, &deployments) + if err != nil { + return nil, resp, err + } + + return deployments, resp, nil +} + // PendingDeployments approve or reject pending deployments that are waiting on approval by a required reviewer. // // GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run @@ -409,3 +456,20 @@ func (s *ActionsService) PendingDeployments(ctx context.Context, owner, repo str return deployments, resp, nil } + +// ReviewCustomDeploymentProtectionRule approves or rejects custom deployment protection rules provided by a GitHub App for a workflow run. +// +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#review-custom-deployment-protection-rules-for-a-workflow-run +// +//meta:operation POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule +func (s *ActionsService) ReviewCustomDeploymentProtectionRule(ctx context.Context, owner, repo string, runID int64, request *ReviewCustomDeploymentProtectionRuleRequest) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/deployment_protection_rule", owner, repo, runID) + + req, err := s.client.NewRequest("POST", u, request) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req, nil) + return resp, err +} diff --git a/github/actions_workflow_runs_test.go b/github/actions_workflow_runs_test.go index 8e01aa82297..48552a73d25 100644 --- a/github/actions_workflow_runs_test.go +++ b/github/actions_workflow_runs_test.go @@ -571,6 +571,112 @@ func TestActionService_DeleteWorkflowRunLogs(t *testing.T) { }) } +func TestPendingDeployment_Marshal(t *testing.T) { + testJSONMarshal(t, &PendingDeployment{}, "{}") + + u := &PendingDeployment{ + Environment: &PendingDeploymentEnvironment{ + ID: Int64(1), + NodeID: String("nid"), + Name: String("n"), + URL: String("u"), + HTMLURL: String("hu"), + }, + WaitTimer: Int64(100), + WaitTimerStartedAt: &Timestamp{referenceTime}, + CurrentUserCanApprove: Bool(false), + Reviewers: []*RequiredReviewer{ + { + Type: String("User"), + Reviewer: &User{ + Login: String("l"), + }, + }, + { + Type: String("Team"), + Reviewer: &Team{ + Name: String("n"), + }, + }, + }, + } + want := `{ + "environment": { + "id": 1, + "node_id": "nid", + "name": "n", + "url": "u", + "html_url": "hu" + }, + "wait_timer": 100, + "wait_timer_started_at": ` + referenceTimeStr + `, + "current_user_can_approve": false, + "reviewers": [ + { + "type": "User", + "reviewer": { + "login": "l" + } + }, + { + "type": "Team", + "reviewer": { + "name": "n" + } + } + ] + }` + testJSONMarshal(t, u, want) +} + +func TestActionsService_ReviewCustomDeploymentProtectionRule(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/actions/runs/9444496/deployment_protection_rule", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + + w.WriteHeader(http.StatusNoContent) + }) + + request := ReviewCustomDeploymentProtectionRuleRequest{ + EnvironmentName: "production", + State: "approved", + Comment: "Approve deployment", + } + + ctx := context.Background() + if _, err := client.Actions.ReviewCustomDeploymentProtectionRule(ctx, "o", "r", 9444496, &request); err != nil { + t.Errorf("ReviewCustomDeploymentProtectionRule returned error: %v", err) + } + + const methodName = "ReviewCustomDeploymentProtectionRule" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Actions.ReviewCustomDeploymentProtectionRule(ctx, "\n", "\n", 9444496, &request) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Actions.ReviewCustomDeploymentProtectionRule(ctx, "o", "r", 9444496, &request) + }) +} + +func TestReviewCustomDeploymentProtectionRuleRequest_Marshal(t *testing.T) { + testJSONMarshal(t, &ReviewCustomDeploymentProtectionRuleRequest{}, "{}") + + r := &ReviewCustomDeploymentProtectionRuleRequest{ + EnvironmentName: "e", + State: "rejected", + Comment: "c", + } + want := `{ + "environment_name": "e", + "state": "rejected", + "comment": "c" + }` + testJSONMarshal(t, r, want) +} + func TestActionsService_GetWorkflowRunUsageByID(t *testing.T) { client, mux, _, teardown := setup() defer teardown() @@ -1298,3 +1404,121 @@ func TestActionService_PendingDeployments(t *testing.T) { return resp, err }) } + +func TestActionService_GetPendingDeployments(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/actions/runs/399444496/pending_deployments", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `[ + { + "environment": { + "id": 1, + "node_id": "nid", + "name": "n", + "url": "u", + "html_url": "hu" + }, + "wait_timer": 0, + "wait_timer_started_at": `+referenceTimeStr+`, + "current_user_can_approve": false, + "reviewers": [] + }, + { + "environment": { + "id": 2, + "node_id": "nid", + "name": "n", + "url": "u", + "html_url": "hu" + }, + "wait_timer": 13, + "wait_timer_started_at": `+referenceTimeStr+`, + "current_user_can_approve": true, + "reviewers": [ + { + "type": "User", + "reviewer": { + "login": "l" + } + }, + { + "type": "Team", + "reviewer": { + "name": "t", + "slug": "s" + } + } + ] + } + ]`) + }) + + ctx := context.Background() + deployments, _, err := client.Actions.GetPendingDeployments(ctx, "o", "r", 399444496) + if err != nil { + t.Errorf("Actions.GetPendingDeployments returned error: %v", err) + } + + want := []*PendingDeployment{ + { + Environment: &PendingDeploymentEnvironment{ + ID: Int64(1), + NodeID: String("nid"), + Name: String("n"), + URL: String("u"), + HTMLURL: String("hu"), + }, + WaitTimer: Int64(0), + WaitTimerStartedAt: &Timestamp{referenceTime}, + CurrentUserCanApprove: Bool(false), + Reviewers: []*RequiredReviewer{}, + }, + { + Environment: &PendingDeploymentEnvironment{ + ID: Int64(2), + NodeID: String("nid"), + Name: String("n"), + URL: String("u"), + HTMLURL: String("hu"), + }, + WaitTimer: Int64(13), + WaitTimerStartedAt: &Timestamp{referenceTime}, + CurrentUserCanApprove: Bool(true), + Reviewers: []*RequiredReviewer{ + { + Type: String("User"), + Reviewer: &User{ + Login: String("l"), + }, + }, + { + Type: String("Team"), + Reviewer: &Team{ + Name: String("t"), + Slug: String("s"), + }, + }, + }, + }, + } + + if !cmp.Equal(deployments, want) { + t.Errorf("Actions.GetPendingDeployments returned %+v, want %+v", deployments, want) + } + + const methodName = "GetPendingDeployments" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.GetPendingDeployments(ctx, "\n", "\n", 399444496) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.GetPendingDeployments(ctx, "o", "r", 399444496) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} diff --git a/github/event_types.go b/github/event_types.go index 41d71f8ddf2..fbe56b20d06 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -225,6 +225,46 @@ type DeploymentProtectionRuleEvent struct { Installation *Installation `json:"installation,omitempty"` } +// DeploymentReviewEvent represents a deployment review event. +// The Webhook event name is "deployment_review". +// +// GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads?#deployment_review +type DeploymentReviewEvent struct { + // The action performed. Possible values are: "requested", "approved", or "rejected". + Action *string `json:"action,omitempty"` + + // The following will be populated only if requested. + Requester *User `json:"requester,omitempty"` + Environment *string `json:"environment,omitempty"` + + // The following will be populated only if approved or rejected. + Approver *User `json:"approver,omitempty"` + Comment *string `json:"comment,omitempty"` + WorkflowJobRuns []*WorkflowJobRun `json:"workflow_job_runs,omitempty"` + + Enterprise *Enterprise `json:"enterprise,omitempty"` + Installation *Installation `json:"installation,omitempty"` + Organization *Organization `json:"organization,omitempty"` + Repo *Repository `json:"repository,omitempty"` + Reviewers []*RequiredReviewer `json:"reviewers,omitempty"` + Sender *User `json:"sender,omitempty"` + Since *string `json:"since,omitempty"` + WorkflowJobRun *WorkflowJobRun `json:"workflow_job_run,omitempty"` + WorkflowRun *WorkflowRun `json:"workflow_run,omitempty"` +} + +// WorkflowJobRun represents a workflow_job_run in a GitHub DeploymentReviewEvent. +type WorkflowJobRun struct { + Conclusion *string `json:"conclusion,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + Environment *string `json:"environment,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Status *string `json:"status,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` +} + // DeploymentStatusEvent represents a deployment status. // The Webhook event name is "deployment_status". // diff --git a/github/event_types_test.go b/github/event_types_test.go index e2a8a39f147..6f5235efe9e 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -6391,6 +6391,604 @@ func TestDeploymentProtectionRuleEvent_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } +func TestDeploymentReviewEvent_Marshal(t *testing.T) { + testJSONMarshal(t, &DeploymentReviewEvent{}, "{}") + + u := &DeploymentReviewEvent{ + Action: String("a"), + Environment: String("e"), + Requester: &User{ + AvatarURL: String("a"), + Email: String("e"), + EventsURL: String("e"), + FollowersURL: String("f"), + FollowingURL: String("f"), + GistsURL: String("g"), + GravatarID: String("g"), + HTMLURL: String("h"), + ID: Int64(1), + Login: String("l"), + Name: String("n"), + NodeID: String("n"), + OrganizationsURL: String("o"), + ReceivedEventsURL: String("r"), + ReposURL: String("r"), + SiteAdmin: Bool(false), + StarredURL: String("s"), + SubscriptionsURL: String("s"), + Type: String("User"), + URL: String("u"), + }, + Reviewers: []*RequiredReviewer{ + { + Type: String("User"), + Reviewer: &User{ + AvatarURL: String("a"), + Email: String("e"), + EventsURL: String("e"), + FollowersURL: String("f"), + FollowingURL: String("f"), + GistsURL: String("g"), + GravatarID: String("g"), + HTMLURL: String("h"), + ID: Int64(1), + Login: String("l"), + Name: String("n"), + NodeID: String("n"), + OrganizationsURL: String("o"), + ReceivedEventsURL: String("r"), + ReposURL: String("r"), + SiteAdmin: Bool(false), + StarredURL: String("s"), + SubscriptionsURL: String("s"), + Type: String("User"), + URL: String("u"), + }, + }, + { + Type: String("Team"), + Reviewer: &Team{ + ID: Int64(1), + Name: String("n"), + Slug: String("s"), + }, + }, + }, + Enterprise: &Enterprise{ + ID: Int(1), + Slug: String("s"), + Name: String("n"), + NodeID: String("nid"), + AvatarURL: String("au"), + Description: String("d"), + WebsiteURL: String("wu"), + HTMLURL: String("hu"), + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + }, + Installation: &Installation{ + ID: Int64(1), + NodeID: String("nid"), + AppID: Int64(1), + AppSlug: String("as"), + TargetID: Int64(1), + Account: &User{ + Login: String("l"), + ID: Int64(1), + URL: String("u"), + AvatarURL: String("a"), + GravatarID: String("g"), + Name: String("n"), + Company: String("c"), + Blog: String("b"), + Location: String("l"), + Email: String("e"), + Hireable: Bool(true), + Bio: String("b"), + TwitterUsername: String("t"), + PublicRepos: Int(1), + Followers: Int(1), + Following: Int(1), + CreatedAt: &Timestamp{referenceTime}, + SuspendedAt: &Timestamp{referenceTime}, + }, + AccessTokensURL: String("atu"), + RepositoriesURL: String("ru"), + HTMLURL: String("hu"), + TargetType: String("tt"), + SingleFileName: String("sfn"), + RepositorySelection: String("rs"), + Events: []string{"e"}, + SingleFilePaths: []string{"s"}, + Permissions: &InstallationPermissions{ + Actions: String("a"), + Administration: String("ad"), + Checks: String("c"), + Contents: String("co"), + ContentReferences: String("cr"), + Deployments: String("d"), + Environments: String("e"), + Issues: String("i"), + Metadata: String("md"), + Members: String("m"), + OrganizationAdministration: String("oa"), + OrganizationHooks: String("oh"), + OrganizationPlan: String("op"), + OrganizationPreReceiveHooks: String("opr"), + OrganizationProjects: String("op"), + OrganizationSecrets: String("os"), + OrganizationSelfHostedRunners: String("osh"), + OrganizationUserBlocking: String("oub"), + Packages: String("pkg"), + Pages: String("pg"), + PullRequests: String("pr"), + RepositoryHooks: String("rh"), + RepositoryProjects: String("rp"), + RepositoryPreReceiveHooks: String("rprh"), + Secrets: String("s"), + SecretScanningAlerts: String("ssa"), + SecurityEvents: String("se"), + SingleFile: String("sf"), + Statuses: String("s"), + TeamDiscussions: String("td"), + VulnerabilityAlerts: String("va"), + Workflows: String("w"), + }, + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + HasMultipleSingleFiles: Bool(false), + SuspendedBy: &User{ + Login: String("l"), + ID: Int64(1), + URL: String("u"), + AvatarURL: String("a"), + GravatarID: String("g"), + Name: String("n"), + Company: String("c"), + Blog: String("b"), + Location: String("l"), + Email: String("e"), + Hireable: Bool(true), + Bio: String("b"), + TwitterUsername: String("t"), + PublicRepos: Int(1), + Followers: Int(1), + Following: Int(1), + CreatedAt: &Timestamp{referenceTime}, + SuspendedAt: &Timestamp{referenceTime}, + }, + SuspendedAt: &Timestamp{referenceTime}, + }, + Organization: &Organization{ + BillingEmail: String("be"), + Blog: String("b"), + Company: String("c"), + Email: String("e"), + TwitterUsername: String("tu"), + Location: String("loc"), + Name: String("n"), + Description: String("d"), + IsVerified: Bool(true), + HasOrganizationProjects: Bool(true), + HasRepositoryProjects: Bool(true), + DefaultRepoPermission: String("drp"), + MembersCanCreateRepos: Bool(true), + MembersCanCreateInternalRepos: Bool(true), + MembersCanCreatePrivateRepos: Bool(true), + MembersCanCreatePublicRepos: Bool(false), + MembersAllowedRepositoryCreationType: String("marct"), + MembersCanCreatePages: Bool(true), + MembersCanCreatePublicPages: Bool(false), + MembersCanCreatePrivatePages: Bool(true), + }, + Repo: &Repository{ + ID: Int64(1), + URL: String("s"), + Name: String("n"), + }, + Sender: &User{ + Login: String("l"), + ID: Int64(1), + NodeID: String("n"), + URL: String("u"), + ReposURL: String("r"), + EventsURL: String("e"), + AvatarURL: String("a"), + }, + Since: String("s"), + WorkflowJobRun: &WorkflowJobRun{ + ID: Int64(1), + Conclusion: String("c"), + Environment: String("e"), + HTMLURL: String("h"), + Name: String("n"), + Status: String("s"), + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + }, + WorkflowRun: &WorkflowRun{ + ID: Int64(1), + Name: String("n"), + NodeID: String("nid"), + HeadBranch: String("hb"), + HeadSHA: String("hs"), + RunNumber: Int(1), + RunAttempt: Int(1), + Event: String("e"), + Status: String("s"), + Conclusion: String("c"), + WorkflowID: Int64(1), + URL: String("u"), + HTMLURL: String("h"), + PullRequests: []*PullRequest{ + { + URL: String("u"), + ID: Int64(1), + Number: Int(1), + Head: &PullRequestBranch{ + Ref: String("r"), + SHA: String("s"), + Repo: &Repository{ + ID: Int64(1), + URL: String("s"), + Name: String("n"), + }, + }, + Base: &PullRequestBranch{ + Ref: String("r"), + SHA: String("s"), + Repo: &Repository{ + ID: Int64(1), + URL: String("u"), + Name: String("n"), + }, + }, + }, + }, + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + RunStartedAt: &Timestamp{referenceTime}, + JobsURL: String("j"), + LogsURL: String("l"), + CheckSuiteURL: String("c"), + ArtifactsURL: String("a"), + CancelURL: String("c"), + RerunURL: String("r"), + PreviousAttemptURL: String("p"), + HeadCommit: &HeadCommit{ + Message: String("m"), + Author: &CommitAuthor{ + Name: String("n"), + Email: String("e"), + Login: String("l"), + }, + URL: String("u"), + Distinct: Bool(false), + SHA: String("s"), + ID: String("i"), + TreeID: String("tid"), + Timestamp: &Timestamp{referenceTime}, + Committer: &CommitAuthor{ + Name: String("n"), + Email: String("e"), + Login: String("l"), + }, + }, + WorkflowURL: String("w"), + Repository: &Repository{ + ID: Int64(1), + URL: String("u"), + Name: String("n"), + }, + HeadRepository: &Repository{ + ID: Int64(1), + URL: String("u"), + Name: String("n"), + }, + }, + } + + want := `{ + "action": "a", + "requester": { + "login": "l", + "id": 1, + "node_id": "n", + "avatar_url": "a", + "url": "u", + "html_url": "h", + "followers_url": "f", + "following_url": "f", + "gists_url": "g", + "starred_url": "s", + "subscriptions_url": "s", + "organizations_url": "o", + "repos_url": "r", + "events_url": "e", + "received_events_url": "r", + "type": "User", + "site_admin": false, + "name": "n", + "email": "e", + "gravatar_id": "g" + }, + "reviewers": [ + { + "type": "User", + "reviewer": { + "login": "l", + "id": 1, + "node_id": "n", + "avatar_url": "a", + "url": "u", + "html_url": "h", + "followers_url": "f", + "following_url": "f", + "gists_url": "g", + "starred_url": "s", + "subscriptions_url": "s", + "organizations_url": "o", + "repos_url": "r", + "events_url": "e", + "received_events_url": "r", + "type": "User", + "site_admin": false, + "name": "n", + "email": "e", + "gravatar_id": "g" + } + }, + { + "type": "Team", + "reviewer": { + "id": 1, + "name": "n", + "slug": "s" + } + } + ], + "repository": { + "id": 1, + "name": "n", + "url": "s" + }, + "organization": { + "name": "n", + "company": "c", + "blog": "b", + "location": "loc", + "email": "e", + "twitter_username": "tu", + "description": "d", + "billing_email": "be", + "is_verified": true, + "has_organization_projects": true, + "has_repository_projects": true, + "default_repository_permission": "drp", + "members_can_create_repositories": true, + "members_can_create_public_repositories": false, + "members_can_create_private_repositories": true, + "members_can_create_internal_repositories": true, + "members_allowed_repository_creation_type": "marct", + "members_can_create_pages": true, + "members_can_create_public_pages": false, + "members_can_create_private_pages": true + }, + "environment": "e", + "enterprise": { + "id": 1, + "slug": "s", + "name": "n", + "node_id": "nid", + "avatar_url": "au", + "description": "d", + "website_url": "wu", + "html_url": "hu", + "created_at": ` + referenceTimeStr + `, + "updated_at": ` + referenceTimeStr + ` + }, + "sender": { + "login": "l", + "id": 1, + "node_id": "n", + "avatar_url": "a", + "url": "u", + "events_url": "e", + "repos_url": "r" + }, + "installation": { + "id": 1, + "node_id": "nid", + "app_id": 1, + "app_slug": "as", + "target_id": 1, + "account": { + "login": "l", + "id": 1, + "avatar_url": "a", + "gravatar_id": "g", + "name": "n", + "company": "c", + "blog": "b", + "location": "l", + "email": "e", + "hireable": true, + "bio": "b", + "twitter_username": "t", + "public_repos": 1, + "followers": 1, + "following": 1, + "created_at": ` + referenceTimeStr + `, + "suspended_at": ` + referenceTimeStr + `, + "url": "u" + }, + "access_tokens_url": "atu", + "repositories_url": "ru", + "html_url": "hu", + "target_type": "tt", + "single_file_name": "sfn", + "repository_selection": "rs", + "events": [ + "e" + ], + "single_file_paths": [ + "s" + ], + "permissions": { + "actions": "a", + "administration": "ad", + "checks": "c", + "contents": "co", + "content_references": "cr", + "deployments": "d", + "environments": "e", + "issues": "i", + "metadata": "md", + "members": "m", + "organization_administration": "oa", + "organization_hooks": "oh", + "organization_plan": "op", + "organization_pre_receive_hooks": "opr", + "organization_projects": "op", + "organization_secrets": "os", + "organization_self_hosted_runners": "osh", + "organization_user_blocking": "oub", + "packages": "pkg", + "pages": "pg", + "pull_requests": "pr", + "repository_hooks": "rh", + "repository_projects": "rp", + "repository_pre_receive_hooks": "rprh", + "secrets": "s", + "secret_scanning_alerts": "ssa", + "security_events": "se", + "single_file": "sf", + "statuses": "s", + "team_discussions": "td", + "vulnerability_alerts": "va", + "workflows": "w" + }, + "created_at": ` + referenceTimeStr + `, + "updated_at": ` + referenceTimeStr + `, + "has_multiple_single_files": false, + "suspended_by": { + "login": "l", + "id": 1, + "avatar_url": "a", + "gravatar_id": "g", + "name": "n", + "company": "c", + "blog": "b", + "location": "l", + "email": "e", + "hireable": true, + "bio": "b", + "twitter_username": "t", + "public_repos": 1, + "followers": 1, + "following": 1, + "created_at": ` + referenceTimeStr + `, + "suspended_at": ` + referenceTimeStr + `, + "url": "u" + }, + "suspended_at": ` + referenceTimeStr + ` + }, + "since": "s", + "workflow_job_run": { + "conclusion": "c", + "created_at": "2006-01-02T15:04:05Z", + "environment": "e", + "html_url": "h", + "id": 1, + "name": "n", + "status": "s", + "updated_at": "2006-01-02T15:04:05Z" + }, + "workflow_run": { + "id": 1, + "name": "n", + "node_id": "nid", + "head_branch": "hb", + "head_sha": "hs", + "run_number": 1, + "run_attempt": 1, + "event": "e", + "status": "s", + "conclusion": "c", + "workflow_id": 1, + "url": "u", + "html_url": "h", + "pull_requests": [ + { + "id": 1, + "number": 1, + "url": "u", + "head": { + "ref": "r", + "sha": "s", + "repo": { + "id": 1, + "name": "n", + "url": "s" + } + }, + "base": { + "ref": "r", + "sha": "s", + "repo": { + "id": 1, + "name": "n", + "url": "u" + } + } + } + ], + "created_at": ` + referenceTimeStr + `, + "updated_at": ` + referenceTimeStr + `, + "run_started_at": ` + referenceTimeStr + `, + "jobs_url": "j", + "logs_url": "l", + "check_suite_url": "c", + "artifacts_url": "a", + "cancel_url": "c", + "rerun_url": "r", + "previous_attempt_url": "p", + "head_commit": { + "message": "m", + "author": { + "name": "n", + "email": "e", + "username": "l" + }, + "url": "u", + "distinct": false, + "sha": "s", + "id": "i", + "tree_id": "tid", + "timestamp": ` + referenceTimeStr + `, + "committer": { + "name": "n", + "email": "e", + "username": "l" + } + }, + "workflow_url": "w", + "repository": { + "id": 1, + "name": "n", + "url": "u" + }, + "head_repository": { + "id": 1, + "name": "n", + "url": "u" + } + } + }` + + testJSONMarshal(t, u, want) +} + func TestDeploymentStatusEvent_Marshal(t *testing.T) { testJSONMarshal(t, &DeploymentStatusEvent{}, "{}") diff --git a/github/github-accessors.go b/github/github-accessors.go index a025f781faf..f8e303c4362 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -5918,6 +5918,110 @@ func (d *DeploymentRequest) GetTransientEnvironment() bool { return *d.TransientEnvironment } +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (d *DeploymentReviewEvent) GetAction() string { + if d == nil || d.Action == nil { + return "" + } + return *d.Action +} + +// GetApprover returns the Approver field. +func (d *DeploymentReviewEvent) GetApprover() *User { + if d == nil { + return nil + } + return d.Approver +} + +// GetComment returns the Comment field if it's non-nil, zero value otherwise. +func (d *DeploymentReviewEvent) GetComment() string { + if d == nil || d.Comment == nil { + return "" + } + return *d.Comment +} + +// GetEnterprise returns the Enterprise field. +func (d *DeploymentReviewEvent) GetEnterprise() *Enterprise { + if d == nil { + return nil + } + return d.Enterprise +} + +// GetEnvironment returns the Environment field if it's non-nil, zero value otherwise. +func (d *DeploymentReviewEvent) GetEnvironment() string { + if d == nil || d.Environment == nil { + return "" + } + return *d.Environment +} + +// GetInstallation returns the Installation field. +func (d *DeploymentReviewEvent) GetInstallation() *Installation { + if d == nil { + return nil + } + return d.Installation +} + +// GetOrganization returns the Organization field. +func (d *DeploymentReviewEvent) GetOrganization() *Organization { + if d == nil { + return nil + } + return d.Organization +} + +// GetRepo returns the Repo field. +func (d *DeploymentReviewEvent) GetRepo() *Repository { + if d == nil { + return nil + } + return d.Repo +} + +// GetRequester returns the Requester field. +func (d *DeploymentReviewEvent) GetRequester() *User { + if d == nil { + return nil + } + return d.Requester +} + +// GetSender returns the Sender field. +func (d *DeploymentReviewEvent) GetSender() *User { + if d == nil { + return nil + } + return d.Sender +} + +// GetSince returns the Since field if it's non-nil, zero value otherwise. +func (d *DeploymentReviewEvent) GetSince() string { + if d == nil || d.Since == nil { + return "" + } + return *d.Since +} + +// GetWorkflowJobRun returns the WorkflowJobRun field. +func (d *DeploymentReviewEvent) GetWorkflowJobRun() *WorkflowJobRun { + if d == nil { + return nil + } + return d.WorkflowJobRun +} + +// GetWorkflowRun returns the WorkflowRun field. +func (d *DeploymentReviewEvent) GetWorkflowRun() *WorkflowRun { + if d == nil { + return nil + } + return d.WorkflowRun +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (d *DeploymentStatus) GetCreatedAt() Timestamp { if d == nil || d.CreatedAt == nil { @@ -14422,6 +14526,78 @@ func (p *PagesUpdate) GetSource() *PagesSource { return p.Source } +// GetCurrentUserCanApprove returns the CurrentUserCanApprove field if it's non-nil, zero value otherwise. +func (p *PendingDeployment) GetCurrentUserCanApprove() bool { + if p == nil || p.CurrentUserCanApprove == nil { + return false + } + return *p.CurrentUserCanApprove +} + +// GetEnvironment returns the Environment field. +func (p *PendingDeployment) GetEnvironment() *PendingDeploymentEnvironment { + if p == nil { + return nil + } + return p.Environment +} + +// GetWaitTimer returns the WaitTimer field if it's non-nil, zero value otherwise. +func (p *PendingDeployment) GetWaitTimer() int64 { + if p == nil || p.WaitTimer == nil { + return 0 + } + return *p.WaitTimer +} + +// GetWaitTimerStartedAt returns the WaitTimerStartedAt field if it's non-nil, zero value otherwise. +func (p *PendingDeployment) GetWaitTimerStartedAt() Timestamp { + if p == nil || p.WaitTimerStartedAt == nil { + return Timestamp{} + } + return *p.WaitTimerStartedAt +} + +// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. +func (p *PendingDeploymentEnvironment) GetHTMLURL() string { + if p == nil || p.HTMLURL == nil { + return "" + } + return *p.HTMLURL +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (p *PendingDeploymentEnvironment) GetID() int64 { + if p == nil || p.ID == nil { + return 0 + } + return *p.ID +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (p *PendingDeploymentEnvironment) GetName() string { + if p == nil || p.Name == nil { + return "" + } + return *p.Name +} + +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (p *PendingDeploymentEnvironment) GetNodeID() string { + if p == nil || p.NodeID == nil { + return "" + } + return *p.NodeID +} + +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (p *PendingDeploymentEnvironment) GetURL() string { + if p == nil || p.URL == nil { + return "" + } + return *p.URL +} + // GetAccessGrantedAt returns the AccessGrantedAt field if it's non-nil, zero value otherwise. func (p *PersonalAccessToken) GetAccessGrantedAt() Timestamp { if p == nil || p.AccessGrantedAt == nil { @@ -25438,6 +25614,70 @@ func (w *WorkflowJobEvent) GetWorkflowJob() *WorkflowJob { return w.WorkflowJob } +// GetConclusion returns the Conclusion field if it's non-nil, zero value otherwise. +func (w *WorkflowJobRun) GetConclusion() string { + if w == nil || w.Conclusion == nil { + return "" + } + return *w.Conclusion +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (w *WorkflowJobRun) GetCreatedAt() Timestamp { + if w == nil || w.CreatedAt == nil { + return Timestamp{} + } + return *w.CreatedAt +} + +// GetEnvironment returns the Environment field if it's non-nil, zero value otherwise. +func (w *WorkflowJobRun) GetEnvironment() string { + if w == nil || w.Environment == nil { + return "" + } + return *w.Environment +} + +// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. +func (w *WorkflowJobRun) GetHTMLURL() string { + if w == nil || w.HTMLURL == nil { + return "" + } + return *w.HTMLURL +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (w *WorkflowJobRun) GetID() int64 { + if w == nil || w.ID == nil { + return 0 + } + return *w.ID +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (w *WorkflowJobRun) GetName() string { + if w == nil || w.Name == nil { + return "" + } + return *w.Name +} + +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (w *WorkflowJobRun) GetStatus() string { + if w == nil || w.Status == nil { + return "" + } + return *w.Status +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (w *WorkflowJobRun) GetUpdatedAt() Timestamp { + if w == nil || w.UpdatedAt == nil { + return Timestamp{} + } + return *w.UpdatedAt +} + // GetActor returns the Actor field. func (w *WorkflowRun) GetActor() *User { if w == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index ae380160dc7..8af9a9b54d2 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -6927,6 +6927,109 @@ func TestDeploymentRequest_GetTransientEnvironment(tt *testing.T) { d.GetTransientEnvironment() } +func TestDeploymentReviewEvent_GetAction(tt *testing.T) { + var zeroValue string + d := &DeploymentReviewEvent{Action: &zeroValue} + d.GetAction() + d = &DeploymentReviewEvent{} + d.GetAction() + d = nil + d.GetAction() +} + +func TestDeploymentReviewEvent_GetApprover(tt *testing.T) { + d := &DeploymentReviewEvent{} + d.GetApprover() + d = nil + d.GetApprover() +} + +func TestDeploymentReviewEvent_GetComment(tt *testing.T) { + var zeroValue string + d := &DeploymentReviewEvent{Comment: &zeroValue} + d.GetComment() + d = &DeploymentReviewEvent{} + d.GetComment() + d = nil + d.GetComment() +} + +func TestDeploymentReviewEvent_GetEnterprise(tt *testing.T) { + d := &DeploymentReviewEvent{} + d.GetEnterprise() + d = nil + d.GetEnterprise() +} + +func TestDeploymentReviewEvent_GetEnvironment(tt *testing.T) { + var zeroValue string + d := &DeploymentReviewEvent{Environment: &zeroValue} + d.GetEnvironment() + d = &DeploymentReviewEvent{} + d.GetEnvironment() + d = nil + d.GetEnvironment() +} + +func TestDeploymentReviewEvent_GetInstallation(tt *testing.T) { + d := &DeploymentReviewEvent{} + d.GetInstallation() + d = nil + d.GetInstallation() +} + +func TestDeploymentReviewEvent_GetOrganization(tt *testing.T) { + d := &DeploymentReviewEvent{} + d.GetOrganization() + d = nil + d.GetOrganization() +} + +func TestDeploymentReviewEvent_GetRepo(tt *testing.T) { + d := &DeploymentReviewEvent{} + d.GetRepo() + d = nil + d.GetRepo() +} + +func TestDeploymentReviewEvent_GetRequester(tt *testing.T) { + d := &DeploymentReviewEvent{} + d.GetRequester() + d = nil + d.GetRequester() +} + +func TestDeploymentReviewEvent_GetSender(tt *testing.T) { + d := &DeploymentReviewEvent{} + d.GetSender() + d = nil + d.GetSender() +} + +func TestDeploymentReviewEvent_GetSince(tt *testing.T) { + var zeroValue string + d := &DeploymentReviewEvent{Since: &zeroValue} + d.GetSince() + d = &DeploymentReviewEvent{} + d.GetSince() + d = nil + d.GetSince() +} + +func TestDeploymentReviewEvent_GetWorkflowJobRun(tt *testing.T) { + d := &DeploymentReviewEvent{} + d.GetWorkflowJobRun() + d = nil + d.GetWorkflowJobRun() +} + +func TestDeploymentReviewEvent_GetWorkflowRun(tt *testing.T) { + d := &DeploymentReviewEvent{} + d.GetWorkflowRun() + d = nil + d.GetWorkflowRun() +} + func TestDeploymentStatus_GetCreatedAt(tt *testing.T) { var zeroValue Timestamp d := &DeploymentStatus{CreatedAt: &zeroValue} @@ -16876,6 +16979,93 @@ func TestPagesUpdate_GetSource(tt *testing.T) { p.GetSource() } +func TestPendingDeployment_GetCurrentUserCanApprove(tt *testing.T) { + var zeroValue bool + p := &PendingDeployment{CurrentUserCanApprove: &zeroValue} + p.GetCurrentUserCanApprove() + p = &PendingDeployment{} + p.GetCurrentUserCanApprove() + p = nil + p.GetCurrentUserCanApprove() +} + +func TestPendingDeployment_GetEnvironment(tt *testing.T) { + p := &PendingDeployment{} + p.GetEnvironment() + p = nil + p.GetEnvironment() +} + +func TestPendingDeployment_GetWaitTimer(tt *testing.T) { + var zeroValue int64 + p := &PendingDeployment{WaitTimer: &zeroValue} + p.GetWaitTimer() + p = &PendingDeployment{} + p.GetWaitTimer() + p = nil + p.GetWaitTimer() +} + +func TestPendingDeployment_GetWaitTimerStartedAt(tt *testing.T) { + var zeroValue Timestamp + p := &PendingDeployment{WaitTimerStartedAt: &zeroValue} + p.GetWaitTimerStartedAt() + p = &PendingDeployment{} + p.GetWaitTimerStartedAt() + p = nil + p.GetWaitTimerStartedAt() +} + +func TestPendingDeploymentEnvironment_GetHTMLURL(tt *testing.T) { + var zeroValue string + p := &PendingDeploymentEnvironment{HTMLURL: &zeroValue} + p.GetHTMLURL() + p = &PendingDeploymentEnvironment{} + p.GetHTMLURL() + p = nil + p.GetHTMLURL() +} + +func TestPendingDeploymentEnvironment_GetID(tt *testing.T) { + var zeroValue int64 + p := &PendingDeploymentEnvironment{ID: &zeroValue} + p.GetID() + p = &PendingDeploymentEnvironment{} + p.GetID() + p = nil + p.GetID() +} + +func TestPendingDeploymentEnvironment_GetName(tt *testing.T) { + var zeroValue string + p := &PendingDeploymentEnvironment{Name: &zeroValue} + p.GetName() + p = &PendingDeploymentEnvironment{} + p.GetName() + p = nil + p.GetName() +} + +func TestPendingDeploymentEnvironment_GetNodeID(tt *testing.T) { + var zeroValue string + p := &PendingDeploymentEnvironment{NodeID: &zeroValue} + p.GetNodeID() + p = &PendingDeploymentEnvironment{} + p.GetNodeID() + p = nil + p.GetNodeID() +} + +func TestPendingDeploymentEnvironment_GetURL(tt *testing.T) { + var zeroValue string + p := &PendingDeploymentEnvironment{URL: &zeroValue} + p.GetURL() + p = &PendingDeploymentEnvironment{} + p.GetURL() + p = nil + p.GetURL() +} + func TestPersonalAccessToken_GetAccessGrantedAt(tt *testing.T) { var zeroValue Timestamp p := &PersonalAccessToken{AccessGrantedAt: &zeroValue} @@ -29587,6 +29777,86 @@ func TestWorkflowJobEvent_GetWorkflowJob(tt *testing.T) { w.GetWorkflowJob() } +func TestWorkflowJobRun_GetConclusion(tt *testing.T) { + var zeroValue string + w := &WorkflowJobRun{Conclusion: &zeroValue} + w.GetConclusion() + w = &WorkflowJobRun{} + w.GetConclusion() + w = nil + w.GetConclusion() +} + +func TestWorkflowJobRun_GetCreatedAt(tt *testing.T) { + var zeroValue Timestamp + w := &WorkflowJobRun{CreatedAt: &zeroValue} + w.GetCreatedAt() + w = &WorkflowJobRun{} + w.GetCreatedAt() + w = nil + w.GetCreatedAt() +} + +func TestWorkflowJobRun_GetEnvironment(tt *testing.T) { + var zeroValue string + w := &WorkflowJobRun{Environment: &zeroValue} + w.GetEnvironment() + w = &WorkflowJobRun{} + w.GetEnvironment() + w = nil + w.GetEnvironment() +} + +func TestWorkflowJobRun_GetHTMLURL(tt *testing.T) { + var zeroValue string + w := &WorkflowJobRun{HTMLURL: &zeroValue} + w.GetHTMLURL() + w = &WorkflowJobRun{} + w.GetHTMLURL() + w = nil + w.GetHTMLURL() +} + +func TestWorkflowJobRun_GetID(tt *testing.T) { + var zeroValue int64 + w := &WorkflowJobRun{ID: &zeroValue} + w.GetID() + w = &WorkflowJobRun{} + w.GetID() + w = nil + w.GetID() +} + +func TestWorkflowJobRun_GetName(tt *testing.T) { + var zeroValue string + w := &WorkflowJobRun{Name: &zeroValue} + w.GetName() + w = &WorkflowJobRun{} + w.GetName() + w = nil + w.GetName() +} + +func TestWorkflowJobRun_GetStatus(tt *testing.T) { + var zeroValue string + w := &WorkflowJobRun{Status: &zeroValue} + w.GetStatus() + w = &WorkflowJobRun{} + w.GetStatus() + w = nil + w.GetStatus() +} + +func TestWorkflowJobRun_GetUpdatedAt(tt *testing.T) { + var zeroValue Timestamp + w := &WorkflowJobRun{UpdatedAt: &zeroValue} + w.GetUpdatedAt() + w = &WorkflowJobRun{} + w.GetUpdatedAt() + w = nil + w.GetUpdatedAt() +} + func TestWorkflowRun_GetActor(tt *testing.T) { w := &WorkflowRun{} w.GetActor() diff --git a/github/messages.go b/github/messages.go index 0385d398bda..30c4fca9304 100644 --- a/github/messages.go +++ b/github/messages.go @@ -57,6 +57,7 @@ var ( "dependabot_alert": &DependabotAlertEvent{}, "deploy_key": &DeployKeyEvent{}, "deployment": &DeploymentEvent{}, + "deployment_review": &DeploymentReviewEvent{}, "deployment_status": &DeploymentStatusEvent{}, "deployment_protection_rule": &DeploymentProtectionRuleEvent{}, "discussion": &DiscussionEvent{}, diff --git a/github/messages_test.go b/github/messages_test.go index 4783ec683aa..322505f65c6 100644 --- a/github/messages_test.go +++ b/github/messages_test.go @@ -300,6 +300,10 @@ func TestParseWebHook(t *testing.T) { payload: &DeploymentProtectionRuleEvent{}, messageType: "deployment_protection_rule", }, + { + payload: &DeploymentReviewEvent{}, + messageType: "deployment_review", + }, { payload: &DeploymentStatusEvent{}, messageType: "deployment_status", From 8faa07c57f3c45265b6e83450c131f465ecad5a4 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Tue, 1 Oct 2024 13:51:37 +0300 Subject: [PATCH 520/751] refactor: Simplify temp file creation in tests (#3290) --- github/github_test.go | 30 ++++++++++++------------------ github/repos_releases_test.go | 7 +------ 2 files changed, 13 insertions(+), 24 deletions(-) diff --git a/github/github_test.go b/github/github_test.go index 8c6c38a84f0..5f5aba276d3 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -15,7 +15,7 @@ import ( "net/http/httptest" "net/url" "os" - "path" + "path/filepath" "reflect" "strconv" "strings" @@ -68,29 +68,23 @@ func setup() (client *Client, mux *http.ServeMux, serverURL string, teardown fun // openTestFile creates a new file with the given name and content for testing. // In order to ensure the exact file name, this function will create a new temp -// directory, and create the file in that directory. It is the caller's -// responsibility to remove the directory and its contents when no longer needed. -func openTestFile(name, content string) (file *os.File, dir string, err error) { - dir, err = os.MkdirTemp("", "go-github") +// directory, and create the file in that directory. The file is automatically +// cleaned up after the test. +func openTestFile(t *testing.T, name, content string) *os.File { + t.Helper() + fname := filepath.Join(t.TempDir(), name) + err := os.WriteFile(fname, []byte(content), 0600) if err != nil { - return nil, dir, err + t.Fatal(err) } - - file, err = os.OpenFile(path.Join(dir, name), os.O_RDWR|os.O_CREATE|os.O_EXCL, 0600) + file, err := os.Open(fname) if err != nil { - return nil, dir, err + t.Fatal(err) } - fmt.Fprint(file, content) - - // close and re-open the file to keep file.Stat() happy - file.Close() - file, err = os.Open(file.Name()) - if err != nil { - return nil, dir, err - } + t.Cleanup(func() { file.Close() }) - return file, dir, err + return file } func testMethod(t *testing.T, r *http.Request, want string) { diff --git a/github/repos_releases_test.go b/github/repos_releases_test.go index d7efd096d21..2cca2bd570e 100644 --- a/github/repos_releases_test.go +++ b/github/repos_releases_test.go @@ -12,7 +12,6 @@ import ( "fmt" "io" "net/http" - "os" "strings" "testing" @@ -707,11 +706,7 @@ func TestRepositoriesService_UploadReleaseAsset(t *testing.T) { fmt.Fprintf(w, `{"id":1}`) }) - file, dir, err := openTestFile(test.fileName, "Upload me !\n") - if err != nil { - t.Fatalf("Unable to create temp file: %v", err) - } - defer os.RemoveAll(dir) + file := openTestFile(t, test.fileName, "Upload me !\n") ctx := context.Background() asset, _, err := client.Repositories.UploadReleaseAsset(ctx, "o", "r", int64(key), test.uploadOpts, file) From cd59fac03d908b76813ab90cb5a4deef5d3e78a6 Mon Sep 17 00:00:00 2001 From: Felix Luthman <34520175+felixlut@users.noreply.github.com> Date: Tue, 1 Oct 2024 12:57:31 +0200 Subject: [PATCH 521/751] refactor: Refactor org_custom_roles.go into multiple files (#3291) --- github/orgs_custom_repository_roles.go | 131 +++++++++++ github/orgs_custom_repository_roles_test.go | 208 ++++++++++++++++++ ...om_roles.go => orgs_organization_roles.go} | 120 ---------- ...est.go => orgs_organization_roles_test.go} | 192 ---------------- 4 files changed, 339 insertions(+), 312 deletions(-) create mode 100644 github/orgs_custom_repository_roles.go create mode 100644 github/orgs_custom_repository_roles_test.go rename github/{orgs_custom_roles.go => orgs_organization_roles.go} (68%) rename github/{orgs_custom_roles_test.go => orgs_organization_roles_test.go} (72%) diff --git a/github/orgs_custom_repository_roles.go b/github/orgs_custom_repository_roles.go new file mode 100644 index 00000000000..2295e1b8a70 --- /dev/null +++ b/github/orgs_custom_repository_roles.go @@ -0,0 +1,131 @@ +// Copyright 2024 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" +) + +// OrganizationCustomRepoRoles represents custom repository roles available in specified organization. +type OrganizationCustomRepoRoles struct { + TotalCount *int `json:"total_count,omitempty"` + CustomRepoRoles []*CustomRepoRoles `json:"custom_roles,omitempty"` +} + +// CustomRepoRoles represents custom repository roles for an organization. +// See https://docs.github.com/enterprise-cloud@latest/organizations/managing-peoples-access-to-your-organization-with-roles/managing-custom-repository-roles-for-an-organization +// for more information. +type CustomRepoRoles struct { + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + BaseRole *string `json:"base_role,omitempty"` + Permissions []string `json:"permissions,omitempty"` + Org *Organization `json:"organization,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` +} + +// CreateOrUpdateCustomRepoRoleOptions represents options required to create or update a custom repository role. +type CreateOrUpdateCustomRepoRoleOptions struct { + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + BaseRole *string `json:"base_role,omitempty"` + Permissions []string `json:"permissions"` +} + +// ListCustomRepoRoles lists the custom repository roles available in this organization. +// In order to see custom repository roles in an organization, the authenticated user must be an organization owner. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization +// +//meta:operation GET /orgs/{org}/custom-repository-roles +func (s *OrganizationsService) ListCustomRepoRoles(ctx context.Context, org string) (*OrganizationCustomRepoRoles, *Response, error) { + u := fmt.Sprintf("orgs/%v/custom-repository-roles", org) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + customRepoRoles := new(OrganizationCustomRepoRoles) + resp, err := s.client.Do(ctx, req, customRepoRoles) + if err != nil { + return nil, resp, err + } + + return customRepoRoles, resp, nil +} + +// CreateCustomRepoRole creates a custom repository role in this organization. +// In order to create custom repository roles in an organization, the authenticated user must be an organization owner. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#create-a-custom-repository-role +// +//meta:operation POST /orgs/{org}/custom-repository-roles +func (s *OrganizationsService) CreateCustomRepoRole(ctx context.Context, org string, opts *CreateOrUpdateCustomRepoRoleOptions) (*CustomRepoRoles, *Response, error) { + u := fmt.Sprintf("orgs/%v/custom-repository-roles", org) + + req, err := s.client.NewRequest("POST", u, opts) + if err != nil { + return nil, nil, err + } + + resultingRole := new(CustomRepoRoles) + resp, err := s.client.Do(ctx, req, resultingRole) + if err != nil { + return nil, resp, err + } + + return resultingRole, resp, err +} + +// UpdateCustomRepoRole updates a custom repository role in this organization. +// In order to update custom repository roles in an organization, the authenticated user must be an organization owner. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#update-a-custom-repository-role +// +//meta:operation PATCH /orgs/{org}/custom-repository-roles/{role_id} +func (s *OrganizationsService) UpdateCustomRepoRole(ctx context.Context, org string, roleID int64, opts *CreateOrUpdateCustomRepoRoleOptions) (*CustomRepoRoles, *Response, error) { + u := fmt.Sprintf("orgs/%v/custom-repository-roles/%v", org, roleID) + + req, err := s.client.NewRequest("PATCH", u, opts) + if err != nil { + return nil, nil, err + } + + resultingRole := new(CustomRepoRoles) + resp, err := s.client.Do(ctx, req, resultingRole) + if err != nil { + return nil, resp, err + } + + return resultingRole, resp, err +} + +// DeleteCustomRepoRole deletes an existing custom repository role in this organization. +// In order to delete custom repository roles in an organization, the authenticated user must be an organization owner. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#delete-a-custom-repository-role +// +//meta:operation DELETE /orgs/{org}/custom-repository-roles/{role_id} +func (s *OrganizationsService) DeleteCustomRepoRole(ctx context.Context, org string, roleID int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/custom-repository-roles/%v", org, roleID) + + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + resultingRole := new(CustomRepoRoles) + resp, err := s.client.Do(ctx, req, resultingRole) + if err != nil { + return resp, err + } + + return resp, nil +} diff --git a/github/orgs_custom_repository_roles_test.go b/github/orgs_custom_repository_roles_test.go new file mode 100644 index 00000000000..58a7c97c99a --- /dev/null +++ b/github/orgs_custom_repository_roles_test.go @@ -0,0 +1,208 @@ +// Copyright 2024 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" + "time" + + "github.com/google/go-cmp/cmp" +) + +func TestOrganizationsService_ListCustomRepoRoles(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/custom-repository-roles", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"total_count": 1, "custom_roles": [ + { + "id": 1, + "name": "Developer", + "base_role": "write", + "permissions": ["delete_alerts_code_scanning"], + "organization": { + "login": "l", + "id": 1, + "node_id": "n", + "avatar_url": "a", + "html_url": "h", + "name": "n", + "company": "c", + "blog": "b", + "location": "l", + "email": "e" + }, + "created_at": "2024-07-21T19:33:08Z", + "updated_at": "2024-07-21T19:33:08Z" + } + ] + }`) + }) + + ctx := context.Background() + apps, _, err := client.Organizations.ListCustomRepoRoles(ctx, "o") + if err != nil { + t.Errorf("Organizations.ListCustomRepoRoles returned error: %v", err) + } + + want := &OrganizationCustomRepoRoles{ + TotalCount: Int(1), + CustomRepoRoles: []*CustomRepoRoles{ + { + ID: Int64(1), + Name: String("Developer"), + BaseRole: String("write"), + Permissions: []string{"delete_alerts_code_scanning"}, + Org: &Organization{ + Login: String("l"), + ID: Int64(1), + NodeID: String("n"), + AvatarURL: String("a"), + HTMLURL: String("h"), + Name: String("n"), + Company: String("c"), + Blog: String("b"), + Location: String("l"), + Email: String("e"), + }, + CreatedAt: &Timestamp{time.Date(2024, time.July, 21, 19, 33, 8, 0, time.UTC)}, + UpdatedAt: &Timestamp{time.Date(2024, time.July, 21, 19, 33, 8, 0, time.UTC)}, + }, + }, + } + if !cmp.Equal(apps, want) { + t.Errorf("Organizations.ListCustomRepoRoles returned %+v, want %+v", apps, want) + } + + const methodName = "ListCustomRepoRoles" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.ListCustomRepoRoles(ctx, "\no") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.ListCustomRepoRoles(ctx, "o") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_CreateCustomRepoRole(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/custom-repository-roles", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + fmt.Fprint(w, `{"id":8030,"name":"Labeler","description":"A role for issue and PR labelers","base_role":"read","permissions":["add_label"]}`) + }) + + ctx := context.Background() + + opts := &CreateOrUpdateCustomRepoRoleOptions{ + Name: String("Labeler"), + Description: String("A role for issue and PR labelers"), + BaseRole: String("read"), + Permissions: []string{"add_label"}, + } + apps, _, err := client.Organizations.CreateCustomRepoRole(ctx, "o", opts) + if err != nil { + t.Errorf("Organizations.CreateCustomRepoRole returned error: %v", err) + } + + want := &CustomRepoRoles{ID: Int64(8030), Name: String("Labeler"), BaseRole: String("read"), Permissions: []string{"add_label"}, Description: String("A role for issue and PR labelers")} + + if !cmp.Equal(apps, want) { + t.Errorf("Organizations.CreateCustomRepoRole returned %+v, want %+v", apps, want) + } + + const methodName = "CreateCustomRepoRole" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.CreateCustomRepoRole(ctx, "\no", nil) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.CreateCustomRepoRole(ctx, "o", nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_UpdateCustomRepoRole(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/custom-repository-roles/8030", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PATCH") + fmt.Fprint(w, `{"id":8030,"name":"Updated Name","description":"Updated Description","base_role":"read","permissions":["add_label"]}`) + }) + + ctx := context.Background() + + opts := &CreateOrUpdateCustomRepoRoleOptions{ + Name: String("Updated Name"), + Description: String("Updated Description"), + } + apps, _, err := client.Organizations.UpdateCustomRepoRole(ctx, "o", 8030, opts) + if err != nil { + t.Errorf("Organizations.UpdateCustomRepoRole returned error: %v", err) + } + + want := &CustomRepoRoles{ID: Int64(8030), Name: String("Updated Name"), BaseRole: String("read"), Permissions: []string{"add_label"}, Description: String("Updated Description")} + + if !cmp.Equal(apps, want) { + t.Errorf("Organizations.UpdateCustomRepoRole returned %+v, want %+v", apps, want) + } + + const methodName = "UpdateCustomRepoRole" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.UpdateCustomRepoRole(ctx, "\no", 8030, nil) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.UpdateCustomRepoRole(ctx, "o", 8030, nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_DeleteCustomRepoRole(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/custom-repository-roles/8030", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + w.WriteHeader(http.StatusNoContent) + }) + + ctx := context.Background() + + resp, err := client.Organizations.DeleteCustomRepoRole(ctx, "o", 8030) + if err != nil { + t.Errorf("Organizations.DeleteCustomRepoRole returned error: %v", err) + } + + if !cmp.Equal(resp.StatusCode, 204) { + t.Errorf("Organizations.DeleteCustomRepoRole returned status code %+v, want %+v", resp.StatusCode, "204") + } + + const methodName = "DeleteCustomRepoRole" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Organizations.DeleteCustomRepoRole(ctx, "\no", 8030) + return err + }) +} diff --git a/github/orgs_custom_roles.go b/github/orgs_organization_roles.go similarity index 68% rename from github/orgs_custom_roles.go rename to github/orgs_organization_roles.go index f48fc697ec9..695c4dade6f 100644 --- a/github/orgs_custom_roles.go +++ b/github/orgs_organization_roles.go @@ -29,26 +29,6 @@ type CustomOrgRoles struct { BaseRole *string `json:"base_role,omitempty"` } -// OrganizationCustomRepoRoles represents custom repository roles available in specified organization. -type OrganizationCustomRepoRoles struct { - TotalCount *int `json:"total_count,omitempty"` - CustomRepoRoles []*CustomRepoRoles `json:"custom_roles,omitempty"` -} - -// CustomRepoRoles represents custom repository roles for an organization. -// See https://docs.github.com/enterprise-cloud@latest/organizations/managing-peoples-access-to-your-organization-with-roles/managing-custom-repository-roles-for-an-organization -// for more information. -type CustomRepoRoles struct { - ID *int64 `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Description *string `json:"description,omitempty"` - BaseRole *string `json:"base_role,omitempty"` - Permissions []string `json:"permissions,omitempty"` - Org *Organization `json:"organization,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` -} - // CreateOrUpdateOrgRoleOptions represents options required to create or update a custom organization role. type CreateOrUpdateOrgRoleOptions struct { Name *string `json:"name,omitempty"` @@ -57,14 +37,6 @@ type CreateOrUpdateOrgRoleOptions struct { BaseRole *string `json:"base_role,omitempty"` } -// CreateOrUpdateCustomRepoRoleOptions represents options required to create or update a custom repository role. -type CreateOrUpdateCustomRepoRoleOptions struct { - Name *string `json:"name,omitempty"` - Description *string `json:"description,omitempty"` - BaseRole *string `json:"base_role,omitempty"` - Permissions []string `json:"permissions"` -} - // ListRoles lists the custom roles available in this organization. // In order to see custom roles in an organization, the authenticated user must be an organization owner. // @@ -268,98 +240,6 @@ func (s *OrganizationsService) RemoveOrgRoleFromUser(ctx context.Context, org, u return resp, nil } -// ListCustomRepoRoles lists the custom repository roles available in this organization. -// In order to see custom repository roles in an organization, the authenticated user must be an organization owner. -// -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization -// -//meta:operation GET /orgs/{org}/custom-repository-roles -func (s *OrganizationsService) ListCustomRepoRoles(ctx context.Context, org string) (*OrganizationCustomRepoRoles, *Response, error) { - u := fmt.Sprintf("orgs/%v/custom-repository-roles", org) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - customRepoRoles := new(OrganizationCustomRepoRoles) - resp, err := s.client.Do(ctx, req, customRepoRoles) - if err != nil { - return nil, resp, err - } - - return customRepoRoles, resp, nil -} - -// CreateCustomRepoRole creates a custom repository role in this organization. -// In order to create custom repository roles in an organization, the authenticated user must be an organization owner. -// -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#create-a-custom-repository-role -// -//meta:operation POST /orgs/{org}/custom-repository-roles -func (s *OrganizationsService) CreateCustomRepoRole(ctx context.Context, org string, opts *CreateOrUpdateCustomRepoRoleOptions) (*CustomRepoRoles, *Response, error) { - u := fmt.Sprintf("orgs/%v/custom-repository-roles", org) - - req, err := s.client.NewRequest("POST", u, opts) - if err != nil { - return nil, nil, err - } - - resultingRole := new(CustomRepoRoles) - resp, err := s.client.Do(ctx, req, resultingRole) - if err != nil { - return nil, resp, err - } - - return resultingRole, resp, err -} - -// UpdateCustomRepoRole updates a custom repository role in this organization. -// In order to update custom repository roles in an organization, the authenticated user must be an organization owner. -// -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#update-a-custom-repository-role -// -//meta:operation PATCH /orgs/{org}/custom-repository-roles/{role_id} -func (s *OrganizationsService) UpdateCustomRepoRole(ctx context.Context, org string, roleID int64, opts *CreateOrUpdateCustomRepoRoleOptions) (*CustomRepoRoles, *Response, error) { - u := fmt.Sprintf("orgs/%v/custom-repository-roles/%v", org, roleID) - - req, err := s.client.NewRequest("PATCH", u, opts) - if err != nil { - return nil, nil, err - } - - resultingRole := new(CustomRepoRoles) - resp, err := s.client.Do(ctx, req, resultingRole) - if err != nil { - return nil, resp, err - } - - return resultingRole, resp, err -} - -// DeleteCustomRepoRole deletes an existing custom repository role in this organization. -// In order to delete custom repository roles in an organization, the authenticated user must be an organization owner. -// -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#delete-a-custom-repository-role -// -//meta:operation DELETE /orgs/{org}/custom-repository-roles/{role_id} -func (s *OrganizationsService) DeleteCustomRepoRole(ctx context.Context, org string, roleID int64) (*Response, error) { - u := fmt.Sprintf("orgs/%v/custom-repository-roles/%v", org, roleID) - - req, err := s.client.NewRequest("DELETE", u, nil) - if err != nil { - return nil, err - } - - resultingRole := new(CustomRepoRoles) - resp, err := s.client.Do(ctx, req, resultingRole) - if err != nil { - return resp, err - } - - return resp, nil -} - // ListTeamsAssignedToOrgRole returns all teams assigned to a specific organization role. // In order to list teams assigned to an organization role, the authenticated user must be an organization owner. // diff --git a/github/orgs_custom_roles_test.go b/github/orgs_organization_roles_test.go similarity index 72% rename from github/orgs_custom_roles_test.go rename to github/orgs_organization_roles_test.go index dad11594bfd..3e2998fd4f3 100644 --- a/github/orgs_custom_roles_test.go +++ b/github/orgs_organization_roles_test.go @@ -427,198 +427,6 @@ func TestOrganizationsService_RemoveOrgRoleFromUser(t *testing.T) { }) } -func TestOrganizationsService_ListCustomRepoRoles(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - mux.HandleFunc("/orgs/o/custom-repository-roles", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - fmt.Fprint(w, `{"total_count": 1, "custom_roles": [ - { - "id": 1, - "name": "Developer", - "base_role": "write", - "permissions": ["delete_alerts_code_scanning"], - "organization": { - "login": "l", - "id": 1, - "node_id": "n", - "avatar_url": "a", - "html_url": "h", - "name": "n", - "company": "c", - "blog": "b", - "location": "l", - "email": "e" - }, - "created_at": "2024-07-21T19:33:08Z", - "updated_at": "2024-07-21T19:33:08Z" - } - ] - }`) - }) - - ctx := context.Background() - apps, _, err := client.Organizations.ListCustomRepoRoles(ctx, "o") - if err != nil { - t.Errorf("Organizations.ListCustomRepoRoles returned error: %v", err) - } - - want := &OrganizationCustomRepoRoles{ - TotalCount: Int(1), - CustomRepoRoles: []*CustomRepoRoles{ - { - ID: Int64(1), - Name: String("Developer"), - BaseRole: String("write"), - Permissions: []string{"delete_alerts_code_scanning"}, - Org: &Organization{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - AvatarURL: String("a"), - HTMLURL: String("h"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - }, - CreatedAt: &Timestamp{time.Date(2024, time.July, 21, 19, 33, 8, 0, time.UTC)}, - UpdatedAt: &Timestamp{time.Date(2024, time.July, 21, 19, 33, 8, 0, time.UTC)}, - }, - }, - } - if !cmp.Equal(apps, want) { - t.Errorf("Organizations.ListCustomRepoRoles returned %+v, want %+v", apps, want) - } - - const methodName = "ListCustomRepoRoles" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Organizations.ListCustomRepoRoles(ctx, "\no") - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Organizations.ListCustomRepoRoles(ctx, "o") - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestOrganizationsService_CreateCustomRepoRole(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - mux.HandleFunc("/orgs/o/custom-repository-roles", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "POST") - fmt.Fprint(w, `{"id":8030,"name":"Labeler","description":"A role for issue and PR labelers","base_role":"read","permissions":["add_label"]}`) - }) - - ctx := context.Background() - - opts := &CreateOrUpdateCustomRepoRoleOptions{ - Name: String("Labeler"), - Description: String("A role for issue and PR labelers"), - BaseRole: String("read"), - Permissions: []string{"add_label"}, - } - apps, _, err := client.Organizations.CreateCustomRepoRole(ctx, "o", opts) - if err != nil { - t.Errorf("Organizations.CreateCustomRepoRole returned error: %v", err) - } - - want := &CustomRepoRoles{ID: Int64(8030), Name: String("Labeler"), BaseRole: String("read"), Permissions: []string{"add_label"}, Description: String("A role for issue and PR labelers")} - - if !cmp.Equal(apps, want) { - t.Errorf("Organizations.CreateCustomRepoRole returned %+v, want %+v", apps, want) - } - - const methodName = "CreateCustomRepoRole" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Organizations.CreateCustomRepoRole(ctx, "\no", nil) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Organizations.CreateCustomRepoRole(ctx, "o", nil) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestOrganizationsService_UpdateCustomRepoRole(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - mux.HandleFunc("/orgs/o/custom-repository-roles/8030", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "PATCH") - fmt.Fprint(w, `{"id":8030,"name":"Updated Name","description":"Updated Description","base_role":"read","permissions":["add_label"]}`) - }) - - ctx := context.Background() - - opts := &CreateOrUpdateCustomRepoRoleOptions{ - Name: String("Updated Name"), - Description: String("Updated Description"), - } - apps, _, err := client.Organizations.UpdateCustomRepoRole(ctx, "o", 8030, opts) - if err != nil { - t.Errorf("Organizations.UpdateCustomRepoRole returned error: %v", err) - } - - want := &CustomRepoRoles{ID: Int64(8030), Name: String("Updated Name"), BaseRole: String("read"), Permissions: []string{"add_label"}, Description: String("Updated Description")} - - if !cmp.Equal(apps, want) { - t.Errorf("Organizations.UpdateCustomRepoRole returned %+v, want %+v", apps, want) - } - - const methodName = "UpdateCustomRepoRole" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Organizations.UpdateCustomRepoRole(ctx, "\no", 8030, nil) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Organizations.UpdateCustomRepoRole(ctx, "o", 8030, nil) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestOrganizationsService_DeleteCustomRepoRole(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() - - mux.HandleFunc("/orgs/o/custom-repository-roles/8030", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "DELETE") - w.WriteHeader(http.StatusNoContent) - }) - - ctx := context.Background() - - resp, err := client.Organizations.DeleteCustomRepoRole(ctx, "o", 8030) - if err != nil { - t.Errorf("Organizations.DeleteCustomRepoRole returned error: %v", err) - } - - if !cmp.Equal(resp.StatusCode, 204) { - t.Errorf("Organizations.DeleteCustomRepoRole returned status code %+v, want %+v", resp.StatusCode, "204") - } - - const methodName = "DeleteCustomRepoRole" - testBadOptions(t, methodName, func() (err error) { - _, err = client.Organizations.DeleteCustomRepoRole(ctx, "\no", 8030) - return err - }) -} - func TestOrganizationsService_ListTeamsAssignedToOrgRole(t *testing.T) { client, mux, _, teardown := setup() defer teardown() From 0024ad29cef7058e5deb86dee1b5541fae1bc3c8 Mon Sep 17 00:00:00 2001 From: Ross Gustafson Date: Tue, 1 Oct 2024 13:25:09 +0100 Subject: [PATCH 522/751] feat: Implement missing push rules (#3294) Fixes: #3274. --- github/repos_rules.go | 78 ++++++++++++++++++++++ github/repos_rules_test.go | 130 +++++++++++++++++++++++++++++++++++++ 2 files changed, 208 insertions(+) diff --git a/github/repos_rules.go b/github/repos_rules.go index 50e75cdba1b..d09bb71d103 100644 --- a/github/repos_rules.go +++ b/github/repos_rules.go @@ -85,6 +85,21 @@ type RuleFileParameters struct { RestrictedFilePaths *[]string `json:"restricted_file_paths"` } +// RuleMaxFilePathLengthParameters represents the max_file_path_length rule parameters. +type RuleMaxFilePathLengthParameters struct { + MaxFilePathLength int `json:"max_file_path_length"` +} + +// RuleFileExtensionRestrictionParameters represents the file_extension_restriction rule parameters. +type RuleFileExtensionRestrictionParameters struct { + RestrictedFileExtensions []string `json:"restricted_file_extensions"` +} + +// RuleMaxFileSizeParameters represents the max_file_size rule parameters. +type RuleMaxFileSizeParameters struct { + MaxFileSize int64 `json:"max_file_size"` +} + // UpdateAllowsFetchAndMergeRuleParameters represents the update rule parameters. type UpdateAllowsFetchAndMergeRuleParameters struct { UpdateAllowsFetchAndMerge bool `json:"update_allows_fetch_and_merge"` @@ -255,6 +270,33 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { bytes, _ := json.Marshal(params) rawParams := json.RawMessage(bytes) + r.Parameters = &rawParams + case "max_file_path_length": + params := RuleMaxFilePathLengthParameters{} + if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { + return err + } + bytes, _ := json.Marshal(params) + rawParams := json.RawMessage(bytes) + + r.Parameters = &rawParams + case "file_extension_restriction": + params := RuleFileExtensionRestrictionParameters{} + if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { + return err + } + bytes, _ := json.Marshal(params) + rawParams := json.RawMessage(bytes) + + r.Parameters = &rawParams + case "max_file_size": + params := RuleMaxFileSizeParameters{} + if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { + return err + } + bytes, _ := json.Marshal(params) + rawParams := json.RawMessage(bytes) + r.Parameters = &rawParams default: r.Type = "" @@ -454,6 +496,42 @@ func NewFilePathRestrictionRule(params *RuleFileParameters) (rule *RepositoryRul } } +// NewMaxFilePathLengthRule creates a rule to restrict file paths longer than the limit from being pushed. +func NewMaxFilePathLengthRule(params *RuleMaxFilePathLengthParameters) (rule *RepositoryRule) { + bytes, _ := json.Marshal(params) + + rawParams := json.RawMessage(bytes) + + return &RepositoryRule{ + Type: "max_file_path_length", + Parameters: &rawParams, + } +} + +// NewFileExtensionRestrictionRule creates a rule to restrict file extensions from being pushed to a commit. +func NewFileExtensionRestrictionRule(params *RuleFileExtensionRestrictionParameters) (rule *RepositoryRule) { + bytes, _ := json.Marshal(params) + + rawParams := json.RawMessage(bytes) + + return &RepositoryRule{ + Type: "file_extension_restriction", + Parameters: &rawParams, + } +} + +// NewMaxFileSizeRule creates a rule to restrict file sizes from being pushed to a commit. +func NewMaxFileSizeRule(params *RuleMaxFileSizeParameters) (rule *RepositoryRule) { + bytes, _ := json.Marshal(params) + + rawParams := json.RawMessage(bytes) + + return &RepositoryRule{ + Type: "max_file_size", + Parameters: &rawParams, + } +} + // Ruleset represents a GitHub ruleset object. type Ruleset struct { ID *int64 `json:"id,omitempty"` diff --git a/github/repos_rules_test.go b/github/repos_rules_test.go index 8e123ed0f8e..6daf753432e 100644 --- a/github/repos_rules_test.go +++ b/github/repos_rules_test.go @@ -312,6 +312,48 @@ func TestRepositoryRule_UnmarshalJSON(t *testing.T) { }, wantErr: true, }, + "Valid max_file_path_length params": { + data: `{"type":"max_file_path_length","parameters":{"max_file_path_length": 255}}`, + want: NewMaxFilePathLengthRule(&RuleMaxFilePathLengthParameters{ + MaxFilePathLength: 255, + }), + }, + "Invalid max_file_path_length params": { + data: `{"type":"max_file_path_length","parameters":{"max_file_path_length": "255"}}`, + want: &RepositoryRule{ + Type: "max_file_path_length", + Parameters: nil, + }, + wantErr: true, + }, + "Valid file_extension_restriction params": { + data: `{"type":"file_extension_restriction","parameters":{"restricted_file_extensions":[".exe"]}}`, + want: NewFileExtensionRestrictionRule(&RuleFileExtensionRestrictionParameters{ + RestrictedFileExtensions: []string{".exe"}, + }), + }, + "Invalid file_extension_restriction params": { + data: `{"type":"file_extension_restriction","parameters":{"restricted_file_extensions":true}}`, + want: &RepositoryRule{ + Type: "file_extension_restriction", + Parameters: nil, + }, + wantErr: true, + }, + "Valid max_file_size params": { + data: `{"type":"max_file_size","parameters":{"max_file_size": 1024}}`, + want: NewMaxFileSizeRule(&RuleMaxFileSizeParameters{ + MaxFileSize: 1024, + }), + }, + "Invalid max_file_size params": { + data: `{"type":"max_file_size","parameters":{"max_file_size": "1024"}}`, + want: &RepositoryRule{ + Type: "max_file_size", + Parameters: nil, + }, + wantErr: true, + }, } for name, tc := range tests { @@ -539,6 +581,94 @@ func TestRepositoriesService_CreateRuleset(t *testing.T) { }) } +func TestRepositoriesService_CreateRulesetWithPushRules(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/repo/rulesets", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + fmt.Fprint(w, `{ + "id": 42, + "name": "ruleset", + "source_type": "Repository", + "source": "o/repo", + "enforcement": "enabled", + "target": "push", + "rules": [ + { + "type": "file_path_restriction", + "parameters": { + "restricted_file_paths": ["/a/file"] + } + }, + { + "type": "max_file_path_length", + "parameters": { + "max_file_path_length": 255 + } + }, + { + "type": "file_extension_restriction", + "parameters": { + "restricted_file_extensions": [".exe"] + } + }, + { + "type": "max_file_size", + "parameters": { + "max_file_size": 1024 + } + } + ] + }`) + }) + + ctx := context.Background() + ruleSet, _, err := client.Repositories.CreateRuleset(ctx, "o", "repo", &Ruleset{ + Name: "ruleset", + Enforcement: "enabled", + }) + if err != nil { + t.Errorf("Repositories.CreateRuleset returned error: %v", err) + } + + want := &Ruleset{ + ID: Int64(42), + Name: "ruleset", + SourceType: String("Repository"), + Source: "o/repo", + Target: String("push"), + Enforcement: "enabled", + Rules: []*RepositoryRule{ + NewFilePathRestrictionRule(&RuleFileParameters{ + RestrictedFilePaths: &[]string{"/a/file"}, + }), + NewMaxFilePathLengthRule(&RuleMaxFilePathLengthParameters{ + MaxFilePathLength: 255, + }), + NewFileExtensionRestrictionRule(&RuleFileExtensionRestrictionParameters{ + RestrictedFileExtensions: []string{".exe"}, + }), + NewMaxFileSizeRule(&RuleMaxFileSizeParameters{ + MaxFileSize: 1024, + }), + }, + } + if !cmp.Equal(ruleSet, want) { + t.Errorf("Repositories.CreateRuleset returned %+v, want %+v", ruleSet, want) + } + + const methodName = "CreateRuleset" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.CreateRuleset(ctx, "o", "repo", &Ruleset{}) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + func TestRepositoriesService_GetRuleset(t *testing.T) { client, mux, _, teardown := setup() defer teardown() From e56d378b96d141accab28bddc838fabd440b4dbd Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Tue, 1 Oct 2024 11:52:30 -0400 Subject: [PATCH 523/751] refactor: Do not call teardown manually in tests (#3296) --- github/actions_artifacts_test.go | 63 +-- github/actions_cache_test.go | 75 ++-- github/actions_oidc_test.go | 15 +- github/actions_permissions_enterprise_test.go | 32 +- github/actions_permissions_orgs_test.go | 32 +- github/actions_required_workflows_test.go | 40 +- github/actions_runner_groups_test.go | 44 +-- github/actions_runners_test.go | 42 +- github/actions_secrets_test.go | 67 ++-- github/actions_variables_test.go | 60 +-- github/actions_workflow_jobs_test.go | 21 +- github/actions_workflow_runs_test.go | 63 +-- github/actions_workflows_test.go | 33 +- github/activity_events_test.go | 48 +-- github/activity_notifications_test.go | 30 +- github/activity_star_test.go | 33 +- github/activity_test.go | 3 +- github/activity_watching_test.go | 24 +- github/admin_orgs_test.go | 9 +- github/admin_stats_test.go | 3 +- github/admin_test.go | 6 +- github/admin_users_test.go | 12 +- github/apps_hooks_deliveries_test.go | 9 +- github/apps_hooks_test.go | 6 +- github/apps_installation_test.go | 15 +- github/apps_manifest_test.go | 3 +- github/apps_marketplace_test.go | 24 +- github/apps_test.go | 54 +-- github/authorizations_test.go | 18 +- github/billing_test.go | 43 +- github/checks_test.go | 40 +- github/code-scanning_test.go | 46 +-- github/codesofconduct_test.go | 6 +- github/codespaces_secrets_test.go | 30 +- github/codespaces_test.go | 21 +- github/copilot_test.go | 21 +- github/dependabot_alerts_test.go | 12 +- github/dependabot_secrets_test.go | 45 +-- github/dependency_graph_snapshots_test.go | 3 +- github/dependency_graph_test.go | 3 +- github/emojis_test.go | 3 +- .../enterprise_actions_runner_groups_test.go | 44 +-- github/enterprise_actions_runners_test.go | 18 +- github/enterprise_audit_log_test.go | 3 +- ...erprise_code_security_and_analysis_test.go | 9 +- github/gists_comments_test.go | 30 +- github/gists_test.go | 81 ++-- github/git_blobs_test.go | 15 +- github/git_commits_test.go | 25 +- github/git_refs_test.go | 36 +- github/git_tags_test.go | 6 +- github/git_trees_test.go | 18 +- github/github_test.go | 76 ++-- github/gitignore_test.go | 9 +- github/interactions_orgs_test.go | 9 +- github/interactions_repos_test.go | 9 +- github/issue_import_test.go | 27 +- github/issues_assignees_test.go | 24 +- github/issues_comments_test.go | 33 +- github/issues_events_test.go | 9 +- github/issues_labels_test.go | 66 ++-- github/issues_milestones_test.go | 30 +- github/issues_test.go | 52 +-- github/issues_timeline_test.go | 3 +- github/licenses_test.go | 9 +- github/markdown_test.go | 3 +- github/meta_test.go | 9 +- github/migrations_source_import_test.go | 24 +- github/migrations_test.go | 18 +- github/migrations_user_test.go | 18 +- github/orgs_actions_allowed_test.go | 7 +- github/orgs_actions_permissions_test.go | 6 +- github/orgs_audit_log_test.go | 3 +- github/orgs_credential_authorizations_test.go | 6 +- github/orgs_custom_repository_roles_test.go | 12 +- github/orgs_hooks_configuration_test.go | 12 +- github/orgs_hooks_deliveries_test.go | 18 +- github/orgs_hooks_test.go | 30 +- github/orgs_members_test.go | 79 ++-- github/orgs_organization_roles_test.go | 33 +- github/orgs_outside_collaborators_test.go | 21 +- github/orgs_packages_test.go | 24 +- github/orgs_personal_access_tokens_test.go | 6 +- github/orgs_projects_test.go | 6 +- github/orgs_properties_test.go | 21 +- github/orgs_rules_test.go | 27 +- github/orgs_security_managers_test.go | 24 +- github/orgs_test.go | 39 +- github/orgs_users_blocking_test.go | 12 +- github/projects_test.go | 66 ++-- github/pulls_comments_test.go | 36 +- github/pulls_reviewers_test.go | 12 +- github/pulls_reviews_test.go | 54 +-- github/pulls_test.go | 67 ++-- github/rate_limit_test.go | 9 +- github/reactions_test.go | 92 ++--- github/repos_actions_access_test.go | 6 +- github/repos_actions_allowed_test.go | 7 +- github/repos_actions_permissions_test.go | 12 +- github/repos_autolinks_test.go | 12 +- github/repos_codeowners_test.go | 6 +- github/repos_collaborators_test.go | 36 +- github/repos_comments_test.go | 36 +- github/repos_commits_test.go | 369 +++++++++--------- github/repos_community_health_test.go | 3 +- github/repos_contents_test.go | 88 ++--- .../repos_deployment_branch_policies_test.go | 15 +- .../repos_deployment_protection_rules_test.go | 15 +- github/repos_deployments_test.go | 21 +- github/repos_environments_test.go | 18 +- github/repos_forks_test.go | 15 +- github/repos_hooks_configuration_test.go | 12 +- github/repos_hooks_deliveries_test.go | 15 +- github/repos_hooks_test.go | 50 +-- github/repos_invitations_test.go | 9 +- github/repos_keys_test.go | 24 +- github/repos_lfs_test.go | 6 +- github/repos_merging_test.go | 6 +- github/repos_pages_test.go | 39 +- github/repos_prereceive_hooks_test.go | 24 +- github/repos_projects_test.go | 6 +- github/repos_properties_test.go | 6 +- github/repos_releases_test.go | 54 +-- github/repos_rules_test.go | 27 +- github/repos_stats_test.go | 18 +- github/repos_statuses_test.go | 15 +- github/repos_tags_test.go | 12 +- github/repos_test.go | 252 ++++-------- github/repos_traffic_test.go | 14 +- github/scim_test.go | 20 +- github/search_test.go | 56 +-- github/secret_scanning_test.go | 25 +- github/security_advisories_test.go | 42 +- github/teams_discussion_comments_test.go | 15 +- github/teams_discussions_test.go | 32 +- github/teams_members_test.go | 75 ++-- github/teams_test.go | 189 +++------ github/users_administration_test.go | 15 +- github/users_blocking_test.go | 12 +- github/users_emails_test.go | 12 +- github/users_followers_test.go | 45 +-- github/users_gpg_keys_test.go | 18 +- github/users_keys_test.go | 18 +- github/users_packages_test.go | 48 +-- github/users_projects_test.go | 6 +- github/users_ssh_signing_keys_test.go | 18 +- github/users_test.go | 33 +- scrape/apps_test.go | 13 +- scrape/forms_test.go | 3 +- scrape/scrape_test.go | 7 +- 150 files changed, 1614 insertions(+), 2928 deletions(-) diff --git a/github/actions_artifacts_test.go b/github/actions_artifacts_test.go index 61790daf415..1b49aaa3dfa 100644 --- a/github/actions_artifacts_test.go +++ b/github/actions_artifacts_test.go @@ -17,8 +17,7 @@ import ( ) func TestActionsService_ListArtifacts(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/artifacts", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -59,8 +58,7 @@ func TestActionsService_ListArtifacts(t *testing.T) { } func TestActionsService_ListArtifacts_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Actions.ListArtifacts(ctx, "%", "r", nil) @@ -68,8 +66,7 @@ func TestActionsService_ListArtifacts_invalidOwner(t *testing.T) { } func TestActionsService_ListArtifacts_invalidRepo(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Actions.ListArtifacts(ctx, "o", "%", nil) @@ -77,8 +74,7 @@ func TestActionsService_ListArtifacts_invalidRepo(t *testing.T) { } func TestActionsService_ListArtifacts_notFound(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/artifacts", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -99,8 +95,7 @@ func TestActionsService_ListArtifacts_notFound(t *testing.T) { } func TestActionsService_ListWorkflowRunArtifacts(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/1/artifacts", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -141,8 +136,7 @@ func TestActionsService_ListWorkflowRunArtifacts(t *testing.T) { } func TestActionsService_ListWorkflowRunArtifacts_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Actions.ListWorkflowRunArtifacts(ctx, "%", "r", 1, nil) @@ -150,8 +144,7 @@ func TestActionsService_ListWorkflowRunArtifacts_invalidOwner(t *testing.T) { } func TestActionsService_ListWorkflowRunArtifacts_invalidRepo(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Actions.ListWorkflowRunArtifacts(ctx, "o", "%", 1, nil) @@ -159,8 +152,7 @@ func TestActionsService_ListWorkflowRunArtifacts_invalidRepo(t *testing.T) { } func TestActionsService_ListWorkflowRunArtifacts_notFound(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/1/artifacts", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -181,8 +173,7 @@ func TestActionsService_ListWorkflowRunArtifacts_notFound(t *testing.T) { } func TestActionsService_GetArtifact(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/artifacts/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -228,8 +219,7 @@ func TestActionsService_GetArtifact(t *testing.T) { } func TestActionsService_GetArtifact_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Actions.GetArtifact(ctx, "%", "r", 1) @@ -237,8 +227,7 @@ func TestActionsService_GetArtifact_invalidOwner(t *testing.T) { } func TestActionsService_GetArtifact_invalidRepo(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Actions.GetArtifact(ctx, "o", "%", 1) @@ -246,8 +235,7 @@ func TestActionsService_GetArtifact_invalidRepo(t *testing.T) { } func TestActionsService_GetArtifact_notFound(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/artifacts/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -268,8 +256,7 @@ func TestActionsService_GetArtifact_notFound(t *testing.T) { } func TestActionsService_DownloadArtifact(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/artifacts/1/zip", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -307,8 +294,7 @@ func TestActionsService_DownloadArtifact(t *testing.T) { } func TestActionsService_DownloadArtifact_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Actions.DownloadArtifact(ctx, "%", "r", 1, 1) @@ -316,8 +302,7 @@ func TestActionsService_DownloadArtifact_invalidOwner(t *testing.T) { } func TestActionsService_DownloadArtifact_invalidRepo(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Actions.DownloadArtifact(ctx, "o", "%", 1, 1) @@ -325,8 +310,7 @@ func TestActionsService_DownloadArtifact_invalidRepo(t *testing.T) { } func TestActionsService_DownloadArtifact_StatusMovedPermanently_dontFollowRedirects(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/artifacts/1/zip", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -341,8 +325,7 @@ func TestActionsService_DownloadArtifact_StatusMovedPermanently_dontFollowRedire } func TestActionsService_DownloadArtifact_StatusMovedPermanently_followRedirects(t *testing.T) { - client, mux, serverURL, teardown := setup() - defer teardown() + client, mux, serverURL := setup(t) mux.HandleFunc("/repos/o/r/actions/artifacts/1/zip", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -369,8 +352,7 @@ func TestActionsService_DownloadArtifact_StatusMovedPermanently_followRedirects( } func TestActionsService_DeleteArtifact(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/artifacts/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -394,8 +376,7 @@ func TestActionsService_DeleteArtifact(t *testing.T) { } func TestActionsService_DeleteArtifact_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Actions.DeleteArtifact(ctx, "%", "r", 1) @@ -403,8 +384,7 @@ func TestActionsService_DeleteArtifact_invalidOwner(t *testing.T) { } func TestActionsService_DeleteArtifact_invalidRepo(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Actions.DeleteArtifact(ctx, "o", "%", 1) @@ -412,8 +392,7 @@ func TestActionsService_DeleteArtifact_invalidRepo(t *testing.T) { } func TestActionsService_DeleteArtifact_notFound(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/artifacts/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") diff --git a/github/actions_cache_test.go b/github/actions_cache_test.go index c13b772691c..0b37961e63d 100644 --- a/github/actions_cache_test.go +++ b/github/actions_cache_test.go @@ -15,8 +15,7 @@ import ( ) func TestActionsService_ListCaches(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/caches", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -57,8 +56,7 @@ func TestActionsService_ListCaches(t *testing.T) { } func TestActionsService_ListCaches_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Actions.ListCaches(ctx, "%", "r", nil) @@ -66,8 +64,7 @@ func TestActionsService_ListCaches_invalidOwner(t *testing.T) { } func TestActionsService_ListCaches_invalidRepo(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Actions.ListCaches(ctx, "o", "%", nil) @@ -75,8 +72,7 @@ func TestActionsService_ListCaches_invalidRepo(t *testing.T) { } func TestActionsService_ListCaches_notFound(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/caches", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -97,8 +93,7 @@ func TestActionsService_ListCaches_notFound(t *testing.T) { } func TestActionsService_DeleteCachesByKey(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/caches", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -123,8 +118,7 @@ func TestActionsService_DeleteCachesByKey(t *testing.T) { } func TestActionsService_DeleteCachesByKey_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Actions.DeleteCachesByKey(ctx, "%", "r", "1", String("main")) @@ -132,16 +126,14 @@ func TestActionsService_DeleteCachesByKey_invalidOwner(t *testing.T) { } func TestActionsService_DeleteCachesByKey_invalidRepo(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Actions.DeleteCachesByKey(ctx, "o", "%", "1", String("main")) testURLParseError(t, err) } func TestActionsService_DeleteCachesByKey_notFound(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/artifacts/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -159,8 +151,7 @@ func TestActionsService_DeleteCachesByKey_notFound(t *testing.T) { } func TestActionsService_DeleteCachesByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/caches/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -184,8 +175,7 @@ func TestActionsService_DeleteCachesByID(t *testing.T) { } func TestActionsService_DeleteCachesByID_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Actions.DeleteCachesByID(ctx, "%", "r", 1) @@ -193,8 +183,7 @@ func TestActionsService_DeleteCachesByID_invalidOwner(t *testing.T) { } func TestActionsService_DeleteCachesByID_invalidRepo(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Actions.DeleteCachesByID(ctx, "o", "%", 1) @@ -202,8 +191,7 @@ func TestActionsService_DeleteCachesByID_invalidRepo(t *testing.T) { } func TestActionsService_DeleteCachesByID_notFound(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("repos/o/r/actions/caches/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -221,8 +209,7 @@ func TestActionsService_DeleteCachesByID_notFound(t *testing.T) { } func TestActionsService_GetCacheUsageForRepo(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/cache/usage", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -262,8 +249,7 @@ func TestActionsService_GetCacheUsageForRepo(t *testing.T) { } func TestActionsService_GetCacheUsageForRepo_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Actions.GetCacheUsageForRepo(ctx, "%", "r") @@ -271,8 +257,7 @@ func TestActionsService_GetCacheUsageForRepo_invalidOwner(t *testing.T) { } func TestActionsService_GetCacheUsageForRepo_invalidRepo(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Actions.GetCacheUsageForRepo(ctx, "o", "%") @@ -280,8 +265,7 @@ func TestActionsService_GetCacheUsageForRepo_invalidRepo(t *testing.T) { } func TestActionsService_GetCacheUsageForRepo_notFound(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/cache/usage", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -302,8 +286,7 @@ func TestActionsService_GetCacheUsageForRepo_notFound(t *testing.T) { } func TestActionsService_ListCacheUsageByRepoForOrg(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/cache/usage-by-repository", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -344,8 +327,7 @@ func TestActionsService_ListCacheUsageByRepoForOrg(t *testing.T) { } func TestActionsService_ListCacheUsageByRepoForOrg_invalidOrganization(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Actions.ListCacheUsageByRepoForOrg(ctx, "%", nil) @@ -353,8 +335,7 @@ func TestActionsService_ListCacheUsageByRepoForOrg_invalidOrganization(t *testin } func TestActionsService_ListCacheUsageByRepoForOrg_notFound(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/cache/usage-by-repository", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -375,8 +356,7 @@ func TestActionsService_ListCacheUsageByRepoForOrg_notFound(t *testing.T) { } func TestActionsService_GetCacheUsageForOrg(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/cache/usage", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -415,8 +395,7 @@ func TestActionsService_GetCacheUsageForOrg(t *testing.T) { } func TestActionsService_GetCacheUsageForOrg_invalidOrganization(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Actions.GetTotalCacheUsageForOrg(ctx, "%") @@ -424,8 +403,7 @@ func TestActionsService_GetCacheUsageForOrg_invalidOrganization(t *testing.T) { } func TestActionsService_GetCacheUsageForOrg_notFound(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/cache/usage", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -446,8 +424,7 @@ func TestActionsService_GetCacheUsageForOrg_notFound(t *testing.T) { } func TestActionsService_GetCacheUsageForEnterprise(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/actions/cache/usage", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -486,8 +463,7 @@ func TestActionsService_GetCacheUsageForEnterprise(t *testing.T) { } func TestActionsService_GetCacheUsageForEnterprise_invalidEnterprise(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Actions.GetTotalCacheUsageForEnterprise(ctx, "%") @@ -495,8 +471,7 @@ func TestActionsService_GetCacheUsageForEnterprise_invalidEnterprise(t *testing. } func TestActionsService_GetCacheUsageForEnterprise_notFound(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/actions/cache/usage", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") diff --git a/github/actions_oidc_test.go b/github/actions_oidc_test.go index a1eee7c3157..285e3aea328 100644 --- a/github/actions_oidc_test.go +++ b/github/actions_oidc_test.go @@ -15,8 +15,7 @@ import ( ) func TestActionsService_GetOrgOIDCSubjectClaimCustomTemplate(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/oidc/customization/sub", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -50,8 +49,7 @@ func TestActionsService_GetOrgOIDCSubjectClaimCustomTemplate(t *testing.T) { } func TestActionsService_GetRepoOIDCSubjectClaimCustomTemplate(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/oidc/customization/sub", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -85,8 +83,7 @@ func TestActionsService_GetRepoOIDCSubjectClaimCustomTemplate(t *testing.T) { } func TestActionsService_SetOrgOIDCSubjectClaimCustomTemplate(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/oidc/customization/sub", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -117,8 +114,7 @@ func TestActionsService_SetOrgOIDCSubjectClaimCustomTemplate(t *testing.T) { } func TestActionsService_SetRepoOIDCSubjectClaimCustomTemplate(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/oidc/customization/sub", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -150,8 +146,7 @@ func TestActionsService_SetRepoOIDCSubjectClaimCustomTemplate(t *testing.T) { } func TestActionService_SetRepoOIDCSubjectClaimCustomTemplateToDefault(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/oidc/customization/sub", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") diff --git a/github/actions_permissions_enterprise_test.go b/github/actions_permissions_enterprise_test.go index 70f7d2c0979..5ed326ad0a8 100644 --- a/github/actions_permissions_enterprise_test.go +++ b/github/actions_permissions_enterprise_test.go @@ -16,8 +16,7 @@ import ( ) func TestActionsService_GetActionsPermissionsInEnterprise(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/actions/permissions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -50,8 +49,7 @@ func TestActionsService_GetActionsPermissionsInEnterprise(t *testing.T) { } func TestActionsService_EditActionsPermissionsInEnterprise(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &ActionsPermissionsEnterprise{EnabledOrganizations: String("all"), AllowedActions: String("selected")} @@ -94,8 +92,7 @@ func TestActionsService_EditActionsPermissionsInEnterprise(t *testing.T) { } func TestActionsService_ListEnabledOrgsInEnterprise(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/actions/permissions/organizations", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -138,8 +135,7 @@ func TestActionsService_ListEnabledOrgsInEnterprise(t *testing.T) { } func TestActionsService_SetEnabledOrgsInEnterprise(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/actions/permissions/organizations", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -167,8 +163,7 @@ func TestActionsService_SetEnabledOrgsInEnterprise(t *testing.T) { } func TestActionsService_AddEnabledOrgInEnterprise(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/actions/permissions/organizations/123", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -194,8 +189,7 @@ func TestActionsService_AddEnabledOrgInEnterprise(t *testing.T) { } func TestActionsService_RemoveEnabledOrgInEnterprise(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/actions/permissions/organizations/123", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -221,8 +215,7 @@ func TestActionsService_RemoveEnabledOrgInEnterprise(t *testing.T) { } func TestActionsService_GetActionsAllowedInEnterprise(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/actions/permissions/selected-actions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -255,8 +248,8 @@ func TestActionsService_GetActionsAllowedInEnterprise(t *testing.T) { } func TestActionsService_EditActionsAllowedInEnterprise(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + input := &ActionsAllowed{GithubOwnedAllowed: Bool(true), VerifiedAllowed: Bool(false), PatternsAllowed: []string{"a/b"}} mux.HandleFunc("/enterprises/e/actions/permissions/selected-actions", func(w http.ResponseWriter, r *http.Request) { @@ -298,8 +291,7 @@ func TestActionsService_EditActionsAllowedInEnterprise(t *testing.T) { } func TestActionsService_GetDefaultWorkflowPermissionsInEnterprise(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/actions/permissions/workflow", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -332,8 +324,8 @@ func TestActionsService_GetDefaultWorkflowPermissionsInEnterprise(t *testing.T) } func TestActionsService_EditDefaultWorkflowPermissionsInEnterprise(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + input := &DefaultWorkflowPermissionEnterprise{DefaultWorkflowPermissions: String("read"), CanApprovePullRequestReviews: Bool(true)} mux.HandleFunc("/enterprises/e/actions/permissions/workflow", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/actions_permissions_orgs_test.go b/github/actions_permissions_orgs_test.go index fd35c519645..3056409fb70 100644 --- a/github/actions_permissions_orgs_test.go +++ b/github/actions_permissions_orgs_test.go @@ -16,8 +16,7 @@ import ( ) func TestActionsService_GetActionsPermissions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/permissions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -50,8 +49,7 @@ func TestActionsService_GetActionsPermissions(t *testing.T) { } func TestActionsService_EditActionsPermissions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &ActionsPermissions{EnabledRepositories: String("all"), AllowedActions: String("selected")} @@ -94,8 +92,7 @@ func TestActionsService_EditActionsPermissions(t *testing.T) { } func TestActionsService_ListEnabledReposInOrg(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/permissions/repositories", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -138,8 +135,7 @@ func TestActionsService_ListEnabledReposInOrg(t *testing.T) { } func TestActionsService_SetEnabledReposInOrg(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/permissions/repositories", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -167,8 +163,7 @@ func TestActionsService_SetEnabledReposInOrg(t *testing.T) { } func TestActionsService_AddEnabledReposInOrg(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/permissions/repositories/123", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -194,8 +189,7 @@ func TestActionsService_AddEnabledReposInOrg(t *testing.T) { } func TestActionsService_RemoveEnabledReposInOrg(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/permissions/repositories/123", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -221,8 +215,7 @@ func TestActionsService_RemoveEnabledReposInOrg(t *testing.T) { } func TestActionsService_GetActionsAllowed(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/permissions/selected-actions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -255,8 +248,8 @@ func TestActionsService_GetActionsAllowed(t *testing.T) { } func TestActionsService_EditActionsAllowed(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + input := &ActionsAllowed{GithubOwnedAllowed: Bool(true), VerifiedAllowed: Bool(false), PatternsAllowed: []string{"a/b"}} mux.HandleFunc("/orgs/o/actions/permissions/selected-actions", func(w http.ResponseWriter, r *http.Request) { @@ -336,8 +329,7 @@ func TestActionsPermissions_Marshal(t *testing.T) { } func TestActionsService_GetDefaultWorkflowPermissionsInOrganization(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/permissions/workflow", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -370,8 +362,8 @@ func TestActionsService_GetDefaultWorkflowPermissionsInOrganization(t *testing.T } func TestActionsService_EditDefaultWorkflowPermissionsInOrganization(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + input := &DefaultWorkflowPermissionOrganization{DefaultWorkflowPermissions: String("read"), CanApprovePullRequestReviews: Bool(true)} mux.HandleFunc("/orgs/o/actions/permissions/workflow", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/actions_required_workflows_test.go b/github/actions_required_workflows_test.go index a9d63603af9..8d4afe0fa6f 100644 --- a/github/actions_required_workflows_test.go +++ b/github/actions_required_workflows_test.go @@ -16,8 +16,8 @@ import ( ) func TestActionsService_ListOrgRequiredWorkflows(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + mux.HandleFunc("/orgs/o/actions/required_workflows", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") testFormValues(t, r, values{"per_page": "2", "page": "2"}) @@ -80,8 +80,8 @@ func TestActionsService_ListOrgRequiredWorkflows(t *testing.T) { } func TestActionsService_CreateRequiredWorkflow(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + mux.HandleFunc("/orgs/o/actions/required_workflows", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") testHeader(t, r, "Content-Type", "application/json") @@ -145,8 +145,8 @@ func TestActionsService_CreateRequiredWorkflow(t *testing.T) { } func TestActionsService_GetRequiredWorkflowByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + mux.HandleFunc("/orgs/o/actions/required_workflows/12345", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `{ @@ -195,8 +195,8 @@ func TestActionsService_GetRequiredWorkflowByID(t *testing.T) { } func TestActionsService_UpdateRequiredWorkflow(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + mux.HandleFunc("/orgs/o/actions/required_workflows/12345", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") testHeader(t, r, "Content-Type", "application/json") @@ -262,8 +262,8 @@ func TestActionsService_UpdateRequiredWorkflow(t *testing.T) { } func TestActionsService_DeleteRequiredWorkflow(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + mux.HandleFunc("/orgs/o/actions/required_workflows/12345", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") w.WriteHeader(http.StatusNoContent) @@ -287,8 +287,8 @@ func TestActionsService_DeleteRequiredWorkflow(t *testing.T) { } func TestActionsService_ListRequiredWorkflowSelectedRepos(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + mux.HandleFunc("/orgs/o/actions/required_workflows/12345/repositories", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") testFormValues(t, r, values{"per_page": "2", "page": "2"}) @@ -333,8 +333,8 @@ func TestActionsService_ListRequiredWorkflowSelectedRepos(t *testing.T) { } func TestActionsService_SetRequiredWorkflowSelectedRepos(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + mux.HandleFunc("/orgs/o/actions/required_workflows/12345/repositories", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") testHeader(t, r, "Content-Type", "application/json") @@ -360,8 +360,8 @@ func TestActionsService_SetRequiredWorkflowSelectedRepos(t *testing.T) { } func TestActionsService_AddRepoToRequiredWorkflow(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + mux.HandleFunc("/orgs/o/actions/required_workflows/12345/repositories/32", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") w.WriteHeader(http.StatusNoContent) @@ -385,8 +385,8 @@ func TestActionsService_AddRepoToRequiredWorkflow(t *testing.T) { } func TestActionsService_RemoveRepoFromRequiredWorkflow(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + mux.HandleFunc("/orgs/o/actions/required_workflows/12345/repositories/32", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") w.WriteHeader(http.StatusNoContent) @@ -410,8 +410,8 @@ func TestActionsService_RemoveRepoFromRequiredWorkflow(t *testing.T) { } func TestActionsService_ListRepoRequiredWorkflows(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + mux.HandleFunc("/repos/o/r/actions/required_workflows", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") testFormValues(t, r, values{"per_page": "2", "page": "2"}) diff --git a/github/actions_runner_groups_test.go b/github/actions_runner_groups_test.go index 16d92ed7c64..1301cd02654 100644 --- a/github/actions_runner_groups_test.go +++ b/github/actions_runner_groups_test.go @@ -15,8 +15,7 @@ import ( ) func TestActionsService_ListOrganizationRunnerGroups(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runner-groups", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -59,8 +58,7 @@ func TestActionsService_ListOrganizationRunnerGroups(t *testing.T) { } func TestActionsService_ListOrganizationRunnerGroupsVisibleToRepo(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runner-groups", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -103,8 +101,7 @@ func TestActionsService_ListOrganizationRunnerGroupsVisibleToRepo(t *testing.T) } func TestActionsService_GetOrganizationRunnerGroup(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runner-groups/2", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -150,8 +147,7 @@ func TestActionsService_GetOrganizationRunnerGroup(t *testing.T) { } func TestActionsService_DeleteOrganizationRunnerGroup(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runner-groups/2", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -175,8 +171,7 @@ func TestActionsService_DeleteOrganizationRunnerGroup(t *testing.T) { } func TestActionsService_CreateOrganizationRunnerGroup(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runner-groups", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -229,8 +224,7 @@ func TestActionsService_CreateOrganizationRunnerGroup(t *testing.T) { } func TestActionsService_UpdateOrganizationRunnerGroup(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runner-groups/2", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") @@ -283,8 +277,7 @@ func TestActionsService_UpdateOrganizationRunnerGroup(t *testing.T) { } func TestActionsService_ListRepositoryAccessRunnerGroup(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runner-groups/2/repositories", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -325,8 +318,7 @@ func TestActionsService_ListRepositoryAccessRunnerGroup(t *testing.T) { } func TestActionsService_SetRepositoryAccessRunnerGroup(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runner-groups/2/repositories", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -357,8 +349,7 @@ func TestActionsService_SetRepositoryAccessRunnerGroup(t *testing.T) { } func TestActionsService_AddRepositoryAccessRunnerGroup(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runner-groups/2/repositories/42", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -382,8 +373,7 @@ func TestActionsService_AddRepositoryAccessRunnerGroup(t *testing.T) { } func TestActionsService_RemoveRepositoryAccessRunnerGroup(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runner-groups/2/repositories/42", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -407,8 +397,7 @@ func TestActionsService_RemoveRepositoryAccessRunnerGroup(t *testing.T) { } func TestActionsService_ListRunnerGroupRunners(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runner-groups/2/runners", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -450,8 +439,7 @@ func TestActionsService_ListRunnerGroupRunners(t *testing.T) { } func TestActionsService_SetRunnerGroupRunners(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runner-groups/2/runners", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -482,8 +470,7 @@ func TestActionsService_SetRunnerGroupRunners(t *testing.T) { } func TestActionsService_AddRunnerGroupRunners(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runner-groups/2/runners/42", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -507,8 +494,7 @@ func TestActionsService_AddRunnerGroupRunners(t *testing.T) { } func TestActionsService_RemoveRunnerGroupRunners(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runner-groups/2/runners/42", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -597,7 +583,7 @@ func TestRunnerGroups_Marshal(t *testing.T) { "allows_public_repositories": true, "restricted_to_workflows": false, "selected_workflows": [] - }] + }] }` testJSONMarshal(t, u, want) diff --git a/github/actions_runners_test.go b/github/actions_runners_test.go index beaf01b3d13..647ea13ed0b 100644 --- a/github/actions_runners_test.go +++ b/github/actions_runners_test.go @@ -17,8 +17,7 @@ import ( ) func TestActionsService_ListRunnerApplicationDownloads(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runners/downloads", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -58,8 +57,7 @@ func TestActionsService_ListRunnerApplicationDownloads(t *testing.T) { } func TestActionsService_GenerateOrgJITConfig(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &GenerateJITConfigRequest{Name: "test", RunnerGroupID: 1, Labels: []string{"one", "two"}} @@ -102,8 +100,7 @@ func TestActionsService_GenerateOrgJITConfig(t *testing.T) { } func TestActionsService_GenerateRepoJITConfig(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &GenerateJITConfigRequest{Name: "test", RunnerGroupID: 1, Labels: []string{"one", "two"}} @@ -146,8 +143,7 @@ func TestActionsService_GenerateRepoJITConfig(t *testing.T) { } func TestActionsService_CreateRegistrationToken(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runners/registration-token", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -183,8 +179,7 @@ func TestActionsService_CreateRegistrationToken(t *testing.T) { } func TestActionsService_ListRunners(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runners", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -228,8 +223,7 @@ func TestActionsService_ListRunners(t *testing.T) { } func TestActionsService_GetRunner(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runners/23", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -268,8 +262,7 @@ func TestActionsService_GetRunner(t *testing.T) { } func TestActionsService_CreateRemoveToken(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runners/remove-token", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -303,8 +296,7 @@ func TestActionsService_CreateRemoveToken(t *testing.T) { } func TestActionsService_RemoveRunner(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runners/21", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -328,8 +320,7 @@ func TestActionsService_RemoveRunner(t *testing.T) { } func TestActionsService_ListOrganizationRunnerApplicationDownloads(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runners/downloads", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -369,8 +360,7 @@ func TestActionsService_ListOrganizationRunnerApplicationDownloads(t *testing.T) } func TestActionsService_CreateOrganizationRegistrationToken(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runners/registration-token", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -406,8 +396,7 @@ func TestActionsService_CreateOrganizationRegistrationToken(t *testing.T) { } func TestActionsService_ListOrganizationRunners(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runners", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -451,8 +440,7 @@ func TestActionsService_ListOrganizationRunners(t *testing.T) { } func TestActionsService_GetOrganizationRunner(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runners/23", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -491,8 +479,7 @@ func TestActionsService_GetOrganizationRunner(t *testing.T) { } func TestActionsService_CreateOrganizationRemoveToken(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runners/remove-token", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -526,8 +513,7 @@ func TestActionsService_CreateOrganizationRemoveToken(t *testing.T) { } func TestActionsService_RemoveOrganizationRunner(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runners/21", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") diff --git a/github/actions_secrets_test.go b/github/actions_secrets_test.go index a2ac169cd24..6c7c5d52a4b 100644 --- a/github/actions_secrets_test.go +++ b/github/actions_secrets_test.go @@ -93,8 +93,7 @@ func TestPublicKey_UnmarshalJSON(t *testing.T) { } func TestActionsService_GetRepoPublicKey(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/secrets/public-key", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -128,8 +127,7 @@ func TestActionsService_GetRepoPublicKey(t *testing.T) { } func TestActionsService_GetRepoPublicKeyNumeric(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/secrets/public-key", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -163,8 +161,7 @@ func TestActionsService_GetRepoPublicKeyNumeric(t *testing.T) { } func TestActionsService_ListRepoSecrets(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/secrets", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -206,8 +203,7 @@ func TestActionsService_ListRepoSecrets(t *testing.T) { } func TestActionsService_ListRepoOrgSecrets(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/organization-secrets", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -249,8 +245,7 @@ func TestActionsService_ListRepoOrgSecrets(t *testing.T) { } func TestActionsService_GetRepoSecret(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -288,8 +283,7 @@ func TestActionsService_GetRepoSecret(t *testing.T) { } func TestActionsService_CreateOrUpdateRepoSecret(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -321,8 +315,7 @@ func TestActionsService_CreateOrUpdateRepoSecret(t *testing.T) { } func TestActionsService_DeleteRepoSecret(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -346,8 +339,7 @@ func TestActionsService_DeleteRepoSecret(t *testing.T) { } func TestActionsService_GetOrgPublicKey(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/secrets/public-key", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -381,8 +373,7 @@ func TestActionsService_GetOrgPublicKey(t *testing.T) { } func TestActionsService_ListOrgSecrets(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/secrets", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -425,8 +416,7 @@ func TestActionsService_ListOrgSecrets(t *testing.T) { } func TestActionsService_GetOrgSecret(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -466,8 +456,7 @@ func TestActionsService_GetOrgSecret(t *testing.T) { } func TestActionsService_CreateOrUpdateOrgSecret(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -501,8 +490,7 @@ func TestActionsService_CreateOrUpdateOrgSecret(t *testing.T) { } func TestActionsService_ListSelectedReposForOrgSecret(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/secrets/NAME/repositories", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -542,8 +530,7 @@ func TestActionsService_ListSelectedReposForOrgSecret(t *testing.T) { } func TestActionsService_SetSelectedReposForOrgSecret(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/secrets/NAME/repositories", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -569,8 +556,7 @@ func TestActionsService_SetSelectedReposForOrgSecret(t *testing.T) { } func TestActionsService_AddSelectedRepoToOrgSecret(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/secrets/NAME/repositories/1234", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -595,8 +581,7 @@ func TestActionsService_AddSelectedRepoToOrgSecret(t *testing.T) { } func TestActionsService_RemoveSelectedRepoFromOrgSecret(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/secrets/NAME/repositories/1234", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -621,8 +606,7 @@ func TestActionsService_RemoveSelectedRepoFromOrgSecret(t *testing.T) { } func TestActionsService_DeleteOrgSecret(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -646,8 +630,8 @@ func TestActionsService_DeleteOrgSecret(t *testing.T) { } func TestActionsService_GetEnvPublicKey(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + mux.HandleFunc("/repositories/1/environments/e/secrets/public-key", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `{"key_id":"1234","key":"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234"}`) @@ -680,8 +664,7 @@ func TestActionsService_GetEnvPublicKey(t *testing.T) { } func TestActionsService_GetEnvPublicKeyNumeric(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repositories/1/environments/e/secrets/public-key", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -715,8 +698,7 @@ func TestActionsService_GetEnvPublicKeyNumeric(t *testing.T) { } func TestActionsService_ListEnvSecrets(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repositories/1/environments/e/secrets", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -758,8 +740,7 @@ func TestActionsService_ListEnvSecrets(t *testing.T) { } func TestActionsService_GetEnvSecret(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repositories/1/environments/e/secrets/secret", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -797,8 +778,7 @@ func TestActionsService_GetEnvSecret(t *testing.T) { } func TestActionsService_CreateOrUpdateEnvSecret(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repositories/1/environments/e/secrets/secret", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -830,8 +810,7 @@ func TestActionsService_CreateOrUpdateEnvSecret(t *testing.T) { } func TestActionsService_DeleteEnvSecret(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repositories/1/environments/e/secrets/secret", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") diff --git a/github/actions_variables_test.go b/github/actions_variables_test.go index 37c1a2613ac..1aaf65ebe17 100644 --- a/github/actions_variables_test.go +++ b/github/actions_variables_test.go @@ -16,8 +16,7 @@ import ( ) func TestActionsService_ListRepoVariables(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/variables", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -59,8 +58,7 @@ func TestActionsService_ListRepoVariables(t *testing.T) { } func TestActionsService_ListRepoOrgVariables(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/organization-variables", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -102,8 +100,7 @@ func TestActionsService_ListRepoOrgVariables(t *testing.T) { } func TestActionsService_GetRepoVariable(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/variables/NAME", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -142,8 +139,7 @@ func TestActionsService_GetRepoVariable(t *testing.T) { } func TestActionsService_CreateRepoVariable(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/variables", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -174,8 +170,7 @@ func TestActionsService_CreateRepoVariable(t *testing.T) { } func TestActionsService_UpdateRepoVariable(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/variables/NAME", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") @@ -206,8 +201,7 @@ func TestActionsService_UpdateRepoVariable(t *testing.T) { } func TestActionsService_DeleteRepoVariable(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/variables/NAME", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -231,8 +225,7 @@ func TestActionsService_DeleteRepoVariable(t *testing.T) { } func TestActionsService_ListOrgVariables(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/variables", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -275,8 +268,7 @@ func TestActionsService_ListOrgVariables(t *testing.T) { } func TestActionsService_GetOrgVariable(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/variables/NAME", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -317,8 +309,7 @@ func TestActionsService_GetOrgVariable(t *testing.T) { } func TestActionsService_CreateOrgVariable(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/variables", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -351,8 +342,7 @@ func TestActionsService_CreateOrgVariable(t *testing.T) { } func TestActionsService_UpdateOrgVariable(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/variables/NAME", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") @@ -385,8 +375,7 @@ func TestActionsService_UpdateOrgVariable(t *testing.T) { } func TestActionsService_ListSelectedReposForOrgVariable(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/variables/NAME/repositories", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -426,8 +415,7 @@ func TestActionsService_ListSelectedReposForOrgVariable(t *testing.T) { } func TestActionsService_SetSelectedReposForOrgSVariable(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/variables/NAME/repositories", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -453,8 +441,7 @@ func TestActionsService_SetSelectedReposForOrgSVariable(t *testing.T) { } func TestActionsService_AddSelectedRepoToOrgVariable(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/variables/NAME/repositories/1234", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -479,8 +466,7 @@ func TestActionsService_AddSelectedRepoToOrgVariable(t *testing.T) { } func TestActionsService_RemoveSelectedRepoFromOrgVariable(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/variables/NAME/repositories/1234", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -505,8 +491,7 @@ func TestActionsService_RemoveSelectedRepoFromOrgVariable(t *testing.T) { } func TestActionsService_DeleteOrgVariable(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/variables/NAME", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -530,8 +515,7 @@ func TestActionsService_DeleteOrgVariable(t *testing.T) { } func TestActionsService_ListEnvVariables(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/usr/1/environments/e/variables", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -573,8 +557,7 @@ func TestActionsService_ListEnvVariables(t *testing.T) { } func TestActionsService_GetEnvVariable(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/usr/1/environments/e/variables/variable", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -613,8 +596,7 @@ func TestActionsService_GetEnvVariable(t *testing.T) { } func TestActionsService_CreateEnvVariable(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/usr/1/environments/e/variables", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -645,8 +627,7 @@ func TestActionsService_CreateEnvVariable(t *testing.T) { } func TestActionsService_UpdateEnvVariable(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/usr/1/environments/e/variables/variable", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") @@ -677,8 +658,7 @@ func TestActionsService_UpdateEnvVariable(t *testing.T) { } func TestActionsService_DeleteEnvVariable(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/usr/1/environments/e/variables/variable", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") diff --git a/github/actions_workflow_jobs_test.go b/github/actions_workflow_jobs_test.go index 4e46b1377b9..292c5433a50 100644 --- a/github/actions_workflow_jobs_test.go +++ b/github/actions_workflow_jobs_test.go @@ -18,8 +18,7 @@ import ( ) func TestActionsService_ListWorkflowJobs(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/29679449/jobs", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -61,8 +60,7 @@ func TestActionsService_ListWorkflowJobs(t *testing.T) { } func TestActionsService_ListWorkflowJobs_Filter(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/29679449/jobs", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -90,8 +88,7 @@ func TestActionsService_ListWorkflowJobs_Filter(t *testing.T) { } func TestActionsService_ListWorkflowJobsAttempt(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/29679449/attempts/1/jobs", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -144,8 +141,7 @@ func TestActionsService_ListWorkflowJobsAttempt(t *testing.T) { } func TestActionsService_GetWorkflowJobByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/jobs/399444496", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -183,8 +179,7 @@ func TestActionsService_GetWorkflowJobByID(t *testing.T) { } func TestActionsService_GetWorkflowJobLogs(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/jobs/399444496/logs", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -221,8 +216,7 @@ func TestActionsService_GetWorkflowJobLogs(t *testing.T) { } func TestActionsService_GetWorkflowJobLogs_StatusMovedPermanently_dontFollowRedirects(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/jobs/399444496/logs", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -237,8 +231,7 @@ func TestActionsService_GetWorkflowJobLogs_StatusMovedPermanently_dontFollowRedi } func TestActionsService_GetWorkflowJobLogs_StatusMovedPermanently_followRedirects(t *testing.T) { - client, mux, serverURL, teardown := setup() - defer teardown() + client, mux, serverURL := setup(t) // Mock a redirect link, which leads to an archive link mux.HandleFunc("/repos/o/r/actions/jobs/399444496/logs", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/actions_workflow_runs_test.go b/github/actions_workflow_runs_test.go index 48552a73d25..bba59e3ff64 100644 --- a/github/actions_workflow_runs_test.go +++ b/github/actions_workflow_runs_test.go @@ -18,8 +18,7 @@ import ( ) func TestActionsService_ListWorkflowRunsByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/workflows/29679449/runs", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -61,8 +60,7 @@ func TestActionsService_ListWorkflowRunsByID(t *testing.T) { } func TestActionsService_ListWorkflowRunsFileName(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/workflows/29679449/runs", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -104,8 +102,7 @@ func TestActionsService_ListWorkflowRunsFileName(t *testing.T) { } func TestActionsService_GetWorkflowRunByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/29679449", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -145,8 +142,7 @@ func TestActionsService_GetWorkflowRunByID(t *testing.T) { } func TestActionsService_GetWorkflowRunAttempt(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/29679449/attempts/3", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -189,8 +185,7 @@ func TestActionsService_GetWorkflowRunAttempt(t *testing.T) { } func TestActionsService_GetWorkflowRunAttemptLogs(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/399444496/attempts/2/logs", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -218,8 +213,7 @@ func TestActionsService_GetWorkflowRunAttemptLogs(t *testing.T) { } func TestActionsService_GetWorkflowRunAttemptLogs_StatusMovedPermanently_dontFollowRedirects(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/399444496/attempts/2/logs", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -234,8 +228,7 @@ func TestActionsService_GetWorkflowRunAttemptLogs_StatusMovedPermanently_dontFol } func TestActionsService_GetWorkflowRunAttemptLogs_StatusMovedPermanently_followRedirects(t *testing.T) { - client, mux, serverURL, teardown := setup() - defer teardown() + client, mux, serverURL := setup(t) // Mock a redirect link, which leads to an archive link mux.HandleFunc("/repos/o/r/actions/runs/399444496/attempts/2/logs", func(w http.ResponseWriter, r *http.Request) { @@ -272,8 +265,7 @@ func TestActionsService_GetWorkflowRunAttemptLogs_StatusMovedPermanently_followR } func TestActionsService_RerunWorkflowRunByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/3434/rerun", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -301,8 +293,7 @@ func TestActionsService_RerunWorkflowRunByID(t *testing.T) { } func TestActionsService_RerunFailedJobsByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/3434/rerun-failed-jobs", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -330,8 +321,7 @@ func TestActionsService_RerunFailedJobsByID(t *testing.T) { } func TestActionsService_RerunJobByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/jobs/3434/rerun", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -359,8 +349,7 @@ func TestActionsService_RerunJobByID(t *testing.T) { } func TestActionsService_CancelWorkflowRunByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/3434/cancel", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -388,8 +377,7 @@ func TestActionsService_CancelWorkflowRunByID(t *testing.T) { } func TestActionsService_GetWorkflowRunLogs(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/399444496/logs", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -417,8 +405,7 @@ func TestActionsService_GetWorkflowRunLogs(t *testing.T) { } func TestActionsService_GetWorkflowRunLogs_StatusMovedPermanently_dontFollowRedirects(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/399444496/logs", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -433,8 +420,7 @@ func TestActionsService_GetWorkflowRunLogs_StatusMovedPermanently_dontFollowRedi } func TestActionsService_GetWorkflowRunLogs_StatusMovedPermanently_followRedirects(t *testing.T) { - client, mux, serverURL, teardown := setup() - defer teardown() + client, mux, serverURL := setup(t) // Mock a redirect link, which leads to an archive link mux.HandleFunc("/repos/o/r/actions/runs/399444496/logs", func(w http.ResponseWriter, r *http.Request) { @@ -471,8 +457,7 @@ func TestActionsService_GetWorkflowRunLogs_StatusMovedPermanently_followRedirect } func TestActionService_ListRepositoryWorkflowRuns(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -520,8 +505,7 @@ func TestActionService_ListRepositoryWorkflowRuns(t *testing.T) { } func TestActionService_DeleteWorkflowRun(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/399444496", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -546,8 +530,7 @@ func TestActionService_DeleteWorkflowRun(t *testing.T) { } func TestActionService_DeleteWorkflowRunLogs(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/399444496/logs", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -630,8 +613,7 @@ func TestPendingDeployment_Marshal(t *testing.T) { } func TestActionsService_ReviewCustomDeploymentProtectionRule(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/9444496/deployment_protection_rule", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -678,8 +660,7 @@ func TestReviewCustomDeploymentProtectionRuleRequest_Marshal(t *testing.T) { } func TestActionsService_GetWorkflowRunUsageByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/29679449/timing", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -1362,8 +1343,7 @@ func TestWorkflowRunUsage_Marshal(t *testing.T) { } func TestActionService_PendingDeployments(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &PendingDeploymentsRequest{EnvironmentIDs: []int64{3, 4}, State: "approved", Comment: ""} @@ -1406,8 +1386,7 @@ func TestActionService_PendingDeployments(t *testing.T) { } func TestActionService_GetPendingDeployments(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/399444496/pending_deployments", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") diff --git a/github/actions_workflows_test.go b/github/actions_workflows_test.go index 66ad164f4ac..6661c1ede14 100644 --- a/github/actions_workflows_test.go +++ b/github/actions_workflows_test.go @@ -17,8 +17,7 @@ import ( ) func TestActionsService_ListWorkflows(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/workflows", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -60,8 +59,7 @@ func TestActionsService_ListWorkflows(t *testing.T) { } func TestActionsService_GetWorkflowByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/workflows/72844", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -99,8 +97,7 @@ func TestActionsService_GetWorkflowByID(t *testing.T) { } func TestActionsService_GetWorkflowByFileName(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/workflows/main.yml", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -138,8 +135,7 @@ func TestActionsService_GetWorkflowByFileName(t *testing.T) { } func TestActionsService_GetWorkflowUsageByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/workflows/72844/timing", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -185,8 +181,7 @@ func TestActionsService_GetWorkflowUsageByID(t *testing.T) { } func TestActionsService_GetWorkflowUsageByFileName(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/workflows/main.yml/timing", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -232,8 +227,7 @@ func TestActionsService_GetWorkflowUsageByFileName(t *testing.T) { } func TestActionsService_CreateWorkflowDispatchEventByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) event := CreateWorkflowDispatchEventRequest{ Ref: "d4cfb6e7", @@ -276,8 +270,7 @@ func TestActionsService_CreateWorkflowDispatchEventByID(t *testing.T) { } func TestActionsService_CreateWorkflowDispatchEventByFileName(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) event := CreateWorkflowDispatchEventRequest{ Ref: "d4cfb6e7", @@ -320,8 +313,7 @@ func TestActionsService_CreateWorkflowDispatchEventByFileName(t *testing.T) { } func TestActionsService_EnableWorkflowByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/workflows/72844/enable", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -355,8 +347,7 @@ func TestActionsService_EnableWorkflowByID(t *testing.T) { } func TestActionsService_EnableWorkflowByFilename(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/workflows/main.yml/enable", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -390,8 +381,7 @@ func TestActionsService_EnableWorkflowByFilename(t *testing.T) { } func TestActionsService_DisableWorkflowByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/workflows/72844/disable", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -425,8 +415,7 @@ func TestActionsService_DisableWorkflowByID(t *testing.T) { } func TestActionsService_DisableWorkflowByFileName(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/workflows/main.yml/disable", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") diff --git a/github/activity_events_test.go b/github/activity_events_test.go index cc8357b7e2a..b7588649cc6 100644 --- a/github/activity_events_test.go +++ b/github/activity_events_test.go @@ -16,8 +16,7 @@ import ( ) func TestActivityService_ListEvents(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/events", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -50,8 +49,7 @@ func TestActivityService_ListEvents(t *testing.T) { } func TestActivityService_ListRepositoryEvents(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/events", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -89,8 +87,7 @@ func TestActivityService_ListRepositoryEvents(t *testing.T) { } func TestActivityService_ListRepositoryEvents_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Activity.ListRepositoryEvents(ctx, "%", "%", nil) @@ -98,8 +95,7 @@ func TestActivityService_ListRepositoryEvents_invalidOwner(t *testing.T) { } func TestActivityService_ListIssueEventsForRepository(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/events", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -137,8 +133,7 @@ func TestActivityService_ListIssueEventsForRepository(t *testing.T) { } func TestActivityService_ListIssueEventsForRepository_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Activity.ListIssueEventsForRepository(ctx, "%", "%", nil) @@ -146,8 +141,7 @@ func TestActivityService_ListIssueEventsForRepository_invalidOwner(t *testing.T) } func TestActivityService_ListEventsForRepoNetwork(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/networks/o/r/events", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -185,8 +179,7 @@ func TestActivityService_ListEventsForRepoNetwork(t *testing.T) { } func TestActivityService_ListEventsForRepoNetwork_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Activity.ListEventsForRepoNetwork(ctx, "%", "%", nil) @@ -194,8 +187,7 @@ func TestActivityService_ListEventsForRepoNetwork_invalidOwner(t *testing.T) { } func TestActivityService_ListEventsForOrganization(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/events", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -233,8 +225,7 @@ func TestActivityService_ListEventsForOrganization(t *testing.T) { } func TestActivityService_ListEventsForOrganization_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Activity.ListEventsForOrganization(ctx, "%", nil) @@ -242,8 +233,7 @@ func TestActivityService_ListEventsForOrganization_invalidOrg(t *testing.T) { } func TestActivityService_ListEventsPerformedByUser_all(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/events", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -281,8 +271,7 @@ func TestActivityService_ListEventsPerformedByUser_all(t *testing.T) { } func TestActivityService_ListEventsPerformedByUser_publicOnly(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/events/public", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -302,8 +291,7 @@ func TestActivityService_ListEventsPerformedByUser_publicOnly(t *testing.T) { } func TestActivityService_ListEventsPerformedByUser_invalidUser(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Activity.ListEventsPerformedByUser(ctx, "%", false, nil) @@ -311,8 +299,7 @@ func TestActivityService_ListEventsPerformedByUser_invalidUser(t *testing.T) { } func TestActivityService_ListEventsReceivedByUser_all(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/received_events", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -350,8 +337,7 @@ func TestActivityService_ListEventsReceivedByUser_all(t *testing.T) { } func TestActivityService_ListEventsReceivedByUser_publicOnly(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/received_events/public", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -371,8 +357,7 @@ func TestActivityService_ListEventsReceivedByUser_publicOnly(t *testing.T) { } func TestActivityService_ListEventsReceivedByUser_invalidUser(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Activity.ListEventsReceivedByUser(ctx, "%", false, nil) @@ -380,8 +365,7 @@ func TestActivityService_ListEventsReceivedByUser_invalidUser(t *testing.T) { } func TestActivityService_ListUserEventsForOrganization(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/events/orgs/o", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") diff --git a/github/activity_notifications_test.go b/github/activity_notifications_test.go index 0c224924cc8..d6b941776fe 100644 --- a/github/activity_notifications_test.go +++ b/github/activity_notifications_test.go @@ -17,8 +17,7 @@ import ( ) func TestActivityService_ListNotification(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/notifications", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -60,8 +59,7 @@ func TestActivityService_ListNotification(t *testing.T) { } func TestActivityService_ListRepositoryNotifications(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/notifications", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -95,8 +93,7 @@ func TestActivityService_ListRepositoryNotifications(t *testing.T) { } func TestActivityService_MarkNotificationsRead(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/notifications", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -119,8 +116,7 @@ func TestActivityService_MarkNotificationsRead(t *testing.T) { } func TestActivityService_MarkRepositoryNotificationsRead(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/notifications", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -148,8 +144,7 @@ func TestActivityService_MarkRepositoryNotificationsRead(t *testing.T) { } func TestActivityService_GetThread(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/notifications/threads/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -183,8 +178,7 @@ func TestActivityService_GetThread(t *testing.T) { } func TestActivityService_MarkThreadRead(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/notifications/threads/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") @@ -209,8 +203,7 @@ func TestActivityService_MarkThreadRead(t *testing.T) { } func TestActivityService_MarkThreadDone(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/notifications/threads/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -235,8 +228,7 @@ func TestActivityService_MarkThreadDone(t *testing.T) { } func TestActivityService_GetThreadSubscription(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/notifications/threads/1/subscription", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -270,8 +262,7 @@ func TestActivityService_GetThreadSubscription(t *testing.T) { } func TestActivityService_SetThreadSubscription(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &Subscription{Subscribed: Bool(true)} @@ -314,8 +305,7 @@ func TestActivityService_SetThreadSubscription(t *testing.T) { } func TestActivityService_DeleteThreadSubscription(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/notifications/threads/1/subscription", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") diff --git a/github/activity_star_test.go b/github/activity_star_test.go index 122c399366d..9943fad4792 100644 --- a/github/activity_star_test.go +++ b/github/activity_star_test.go @@ -17,8 +17,7 @@ import ( ) func TestActivityService_ListStargazers(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/stargazers", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -57,8 +56,7 @@ func TestActivityService_ListStargazers(t *testing.T) { } func TestActivityService_ListStarred_authenticatedUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/starred", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -93,8 +91,7 @@ func TestActivityService_ListStarred_authenticatedUser(t *testing.T) { } func TestActivityService_ListStarred_specifiedUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/starred", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -135,8 +132,7 @@ func TestActivityService_ListStarred_specifiedUser(t *testing.T) { } func TestActivityService_ListStarred_invalidUser(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Activity.ListStarred(ctx, "%", nil) @@ -144,8 +140,7 @@ func TestActivityService_ListStarred_invalidUser(t *testing.T) { } func TestActivityService_IsStarred_hasStar(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/starred/o/r", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -177,8 +172,7 @@ func TestActivityService_IsStarred_hasStar(t *testing.T) { } func TestActivityService_IsStarred_noStar(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/starred/o/r", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -210,8 +204,7 @@ func TestActivityService_IsStarred_noStar(t *testing.T) { } func TestActivityService_IsStarred_invalidID(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Activity.IsStarred(ctx, "%", "%") @@ -219,8 +212,7 @@ func TestActivityService_IsStarred_invalidID(t *testing.T) { } func TestActivityService_Star(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/starred/o/r", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -244,8 +236,7 @@ func TestActivityService_Star(t *testing.T) { } func TestActivityService_Star_invalidID(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Activity.Star(ctx, "%", "%") @@ -253,8 +244,7 @@ func TestActivityService_Star_invalidID(t *testing.T) { } func TestActivityService_Unstar(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/starred/o/r", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -278,8 +268,7 @@ func TestActivityService_Unstar(t *testing.T) { } func TestActivityService_Unstar_invalidID(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Activity.Unstar(ctx, "%", "%") diff --git a/github/activity_test.go b/github/activity_test.go index e2d800220d8..9c50e6c4b48 100644 --- a/github/activity_test.go +++ b/github/activity_test.go @@ -14,8 +14,7 @@ import ( ) func TestActivityService_List(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/feeds", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") diff --git a/github/activity_watching_test.go b/github/activity_watching_test.go index da43f5a481e..081d7600f1a 100644 --- a/github/activity_watching_test.go +++ b/github/activity_watching_test.go @@ -16,8 +16,7 @@ import ( ) func TestActivityService_ListWatchers(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/subscribers", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -55,8 +54,7 @@ func TestActivityService_ListWatchers(t *testing.T) { } func TestActivityService_ListWatched_authenticatedUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/subscriptions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -93,8 +91,7 @@ func TestActivityService_ListWatched_authenticatedUser(t *testing.T) { } func TestActivityService_ListWatched_specifiedUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/subscriptions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -117,8 +114,7 @@ func TestActivityService_ListWatched_specifiedUser(t *testing.T) { } func TestActivityService_GetRepositorySubscription_true(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/subscription", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -152,8 +148,7 @@ func TestActivityService_GetRepositorySubscription_true(t *testing.T) { } func TestActivityService_GetRepositorySubscription_false(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/subscription", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -173,8 +168,7 @@ func TestActivityService_GetRepositorySubscription_false(t *testing.T) { } func TestActivityService_GetRepositorySubscription_error(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/subscription", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -189,8 +183,7 @@ func TestActivityService_GetRepositorySubscription_error(t *testing.T) { } func TestActivityService_SetRepositorySubscription(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &Subscription{Subscribed: Bool(true)} @@ -233,8 +226,7 @@ func TestActivityService_SetRepositorySubscription(t *testing.T) { } func TestActivityService_DeleteRepositorySubscription(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/subscription", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") diff --git a/github/admin_orgs_test.go b/github/admin_orgs_test.go index 55963441c7a..860c21f1ebb 100644 --- a/github/admin_orgs_test.go +++ b/github/admin_orgs_test.go @@ -16,8 +16,7 @@ import ( ) func TestAdminOrgs_Create(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &Organization{ Login: String("github"), @@ -58,8 +57,7 @@ func TestAdminOrgs_Create(t *testing.T) { } func TestAdminOrgs_Rename(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &Organization{ Login: String("o"), @@ -100,8 +98,7 @@ func TestAdminOrgs_Rename(t *testing.T) { } func TestAdminOrgs_RenameByName(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/admin/organizations/o", func(w http.ResponseWriter, r *http.Request) { v := new(renameOrgRequest) diff --git a/github/admin_stats_test.go b/github/admin_stats_test.go index dab2bc21fce..55a2ee7b51d 100644 --- a/github/admin_stats_test.go +++ b/github/admin_stats_test.go @@ -10,8 +10,7 @@ import ( ) func TestAdminService_GetAdminStats(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/enterprise/stats/all", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") diff --git a/github/admin_test.go b/github/admin_test.go index dbe0bd2802b..29f8b0c50bc 100644 --- a/github/admin_test.go +++ b/github/admin_test.go @@ -16,8 +16,7 @@ import ( ) func TestAdminService_UpdateUserLDAPMapping(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &UserLDAPMapping{ LDAPDN: String("uid=asdf,ou=users,dc=github,dc=com"), @@ -64,8 +63,7 @@ func TestAdminService_UpdateUserLDAPMapping(t *testing.T) { } func TestAdminService_UpdateTeamLDAPMapping(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &TeamLDAPMapping{ LDAPDN: String("cn=Enterprise Ops,ou=teams,dc=github,dc=com"), diff --git a/github/admin_users_test.go b/github/admin_users_test.go index d29a7e672f1..7eb3ec6e702 100644 --- a/github/admin_users_test.go +++ b/github/admin_users_test.go @@ -17,8 +17,7 @@ import ( ) func TestAdminUsers_Create(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/admin/users", func(w http.ResponseWriter, r *http.Request) { v := new(CreateUserRequest) @@ -63,8 +62,7 @@ func TestAdminUsers_Create(t *testing.T) { } func TestAdminUsers_Delete(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/admin/users/github", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -88,8 +86,7 @@ func TestAdminUsers_Delete(t *testing.T) { } func TestUserImpersonation_Create(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/admin/users/github/authorizations", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -160,8 +157,7 @@ func TestUserImpersonation_Create(t *testing.T) { } func TestUserImpersonation_Delete(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/admin/users/github/authorizations", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") diff --git a/github/apps_hooks_deliveries_test.go b/github/apps_hooks_deliveries_test.go index 38e25540cf6..c2952f0c8db 100644 --- a/github/apps_hooks_deliveries_test.go +++ b/github/apps_hooks_deliveries_test.go @@ -15,8 +15,7 @@ import ( ) func TestAppsService_ListHookDeliveries(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/app/hook/deliveries", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -49,8 +48,7 @@ func TestAppsService_ListHookDeliveries(t *testing.T) { } func TestAppsService_GetHookDelivery(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/app/hook/deliveries/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -84,8 +82,7 @@ func TestAppsService_GetHookDelivery(t *testing.T) { } func TestAppsService_RedeliverHookDelivery(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/app/hook/deliveries/1/attempts", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") diff --git a/github/apps_hooks_test.go b/github/apps_hooks_test.go index b00a74b73e9..1646c311175 100644 --- a/github/apps_hooks_test.go +++ b/github/apps_hooks_test.go @@ -15,8 +15,7 @@ import ( ) func TestAppsService_GetHookConfig(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/app/hook/config", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -55,8 +54,7 @@ func TestAppsService_GetHookConfig(t *testing.T) { } func TestAppsService_UpdateHookConfig(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &HookConfig{ ContentType: String("json"), diff --git a/github/apps_installation_test.go b/github/apps_installation_test.go index 56f0ad9e81d..09d54a8cd8f 100644 --- a/github/apps_installation_test.go +++ b/github/apps_installation_test.go @@ -16,8 +16,7 @@ import ( ) func TestAppsService_ListRepos(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) wantAcceptHeaders := []string{ mediaTypeTopicsPreview, @@ -57,8 +56,7 @@ func TestAppsService_ListRepos(t *testing.T) { } func TestAppsService_ListUserRepos(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) wantAcceptHeaders := []string{ mediaTypeTopicsPreview, @@ -103,8 +101,7 @@ func TestAppsService_ListUserRepos(t *testing.T) { } func TestAppsService_AddRepository(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/installations/1/repositories/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -133,8 +130,7 @@ func TestAppsService_AddRepository(t *testing.T) { } func TestAppsService_RemoveRepository(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/installations/1/repositories/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -154,8 +150,7 @@ func TestAppsService_RemoveRepository(t *testing.T) { } func TestAppsService_RevokeInstallationToken(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/installation/token", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") diff --git a/github/apps_manifest_test.go b/github/apps_manifest_test.go index 833982e4850..9ac57983710 100644 --- a/github/apps_manifest_test.go +++ b/github/apps_manifest_test.go @@ -26,8 +26,7 @@ const ( ) func TestGetConfig(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/app-manifests/code/conversions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") diff --git a/github/apps_marketplace_test.go b/github/apps_marketplace_test.go index dcf5eb89ca1..bc4e2e88a05 100644 --- a/github/apps_marketplace_test.go +++ b/github/apps_marketplace_test.go @@ -15,8 +15,7 @@ import ( ) func TestMarketplaceService_ListPlans(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/marketplace_listing/plans", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -51,8 +50,7 @@ func TestMarketplaceService_ListPlans(t *testing.T) { } func TestMarketplaceService_Stubbed_ListPlans(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/marketplace_listing/stubbed/plans", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -74,8 +72,7 @@ func TestMarketplaceService_Stubbed_ListPlans(t *testing.T) { } func TestMarketplaceService_ListPlanAccountsForPlan(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/marketplace_listing/plans/1/accounts", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -106,8 +103,7 @@ func TestMarketplaceService_ListPlanAccountsForPlan(t *testing.T) { } func TestMarketplaceService_Stubbed_ListPlanAccountsForPlan(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/marketplace_listing/stubbed/plans/1/accounts", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -129,8 +125,7 @@ func TestMarketplaceService_Stubbed_ListPlanAccountsForPlan(t *testing.T) { } func TestMarketplaceService_GetPlanAccountForAccount(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/marketplace_listing/accounts/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -160,8 +155,7 @@ func TestMarketplaceService_GetPlanAccountForAccount(t *testing.T) { } func TestMarketplaceService_Stubbed_GetPlanAccountForAccount(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/marketplace_listing/stubbed/accounts/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -182,8 +176,7 @@ func TestMarketplaceService_Stubbed_GetPlanAccountForAccount(t *testing.T) { } func TestMarketplaceService_ListMarketplacePurchasesForUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/marketplace_purchases", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -214,8 +207,7 @@ func TestMarketplaceService_ListMarketplacePurchasesForUser(t *testing.T) { } func TestMarketplaceService_Stubbed_ListMarketplacePurchasesForUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/marketplace_purchases/stubbed", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") diff --git a/github/apps_test.go b/github/apps_test.go index 9b2e0a59114..8557a93e666 100644 --- a/github/apps_test.go +++ b/github/apps_test.go @@ -17,8 +17,7 @@ import ( ) func TestAppsService_Get_authenticatedApp(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/app", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -52,8 +51,7 @@ func TestAppsService_Get_authenticatedApp(t *testing.T) { } func TestAppsService_Get_specifiedApp(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/apps/a", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -73,8 +71,7 @@ func TestAppsService_Get_specifiedApp(t *testing.T) { } func TestAppsService_ListInstallationRequests(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/app/installation-requests", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -120,8 +117,7 @@ func TestAppsService_ListInstallationRequests(t *testing.T) { } func TestAppsService_ListInstallations(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/app/installations", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -254,8 +250,7 @@ func TestAppsService_ListInstallations(t *testing.T) { } func TestAppsService_GetInstallation(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/app/installations/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -289,8 +284,7 @@ func TestAppsService_GetInstallation(t *testing.T) { } func TestAppsService_ListUserInstallations(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/installations", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -324,8 +318,7 @@ func TestAppsService_ListUserInstallations(t *testing.T) { } func TestAppsService_SuspendInstallation(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/app/installations/1/suspended", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -350,8 +343,7 @@ func TestAppsService_SuspendInstallation(t *testing.T) { } func TestAppsService_UnsuspendInstallation(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/app/installations/1/suspended", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -376,8 +368,7 @@ func TestAppsService_UnsuspendInstallation(t *testing.T) { } func TestAppsService_DeleteInstallation(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/app/installations/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -402,8 +393,7 @@ func TestAppsService_DeleteInstallation(t *testing.T) { } func TestAppsService_CreateInstallationToken(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/app/installations/1/access_tokens", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -437,8 +427,7 @@ func TestAppsService_CreateInstallationToken(t *testing.T) { } func TestAppsService_CreateInstallationTokenWithOptions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) installationTokenOptions := &InstallationTokenOptions{ RepositoryIDs: []int64{1234}, @@ -474,8 +463,7 @@ func TestAppsService_CreateInstallationTokenWithOptions(t *testing.T) { } func TestAppsService_CreateInstallationTokenListReposWithOptions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) installationTokenListRepoOptions := &InstallationTokenListRepoOptions{ Repositories: []string{"foo"}, @@ -510,8 +498,7 @@ func TestAppsService_CreateInstallationTokenListReposWithOptions(t *testing.T) { } func TestAppsService_CreateInstallationTokenListReposWithNoOptions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/app/installations/1/access_tokens", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -545,8 +532,7 @@ func TestAppsService_CreateInstallationTokenListReposWithNoOptions(t *testing.T) } func TestAppsService_CreateAttachment(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/content_references/11/attachments", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -583,8 +569,7 @@ func TestAppsService_CreateAttachment(t *testing.T) { } func TestAppsService_FindOrganizationInstallation(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/installation", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -618,8 +603,7 @@ func TestAppsService_FindOrganizationInstallation(t *testing.T) { } func TestAppsService_FindRepositoryInstallation(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/installation", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -653,8 +637,7 @@ func TestAppsService_FindRepositoryInstallation(t *testing.T) { } func TestAppsService_FindRepositoryInstallationByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repositories/1/installation", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -688,8 +671,7 @@ func TestAppsService_FindRepositoryInstallationByID(t *testing.T) { } func TestAppsService_FindUserInstallation(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/installation", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") diff --git a/github/authorizations_test.go b/github/authorizations_test.go index bd7ff29d811..99d99db01a5 100644 --- a/github/authorizations_test.go +++ b/github/authorizations_test.go @@ -15,8 +15,7 @@ import ( ) func TestAuthorizationsService_Check(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/applications/id/token", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -52,8 +51,7 @@ func TestAuthorizationsService_Check(t *testing.T) { } func TestAuthorizationsService_Reset(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/applications/id/token", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") @@ -89,8 +87,7 @@ func TestAuthorizationsService_Reset(t *testing.T) { } func TestAuthorizationsService_Revoke(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/applications/id/token", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -117,8 +114,7 @@ func TestAuthorizationsService_Revoke(t *testing.T) { } func TestDeleteGrant(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/applications/id/grant", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -144,8 +140,7 @@ func TestDeleteGrant(t *testing.T) { } func TestAuthorizationsService_CreateImpersonation(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/admin/users/u/authorizations", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -180,8 +175,7 @@ func TestAuthorizationsService_CreateImpersonation(t *testing.T) { } func TestAuthorizationsService_DeleteImpersonation(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/admin/users/u/authorizations", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") diff --git a/github/billing_test.go b/github/billing_test.go index 5c929d5f095..5db4344b6a9 100644 --- a/github/billing_test.go +++ b/github/billing_test.go @@ -15,8 +15,7 @@ import ( ) func TestBillingService_GetActionsBillingOrg(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/settings/billing/actions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -68,8 +67,7 @@ func TestBillingService_GetActionsBillingOrg(t *testing.T) { } func TestBillingService_GetActionsBillingOrg_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Billing.GetActionsBillingOrg(ctx, "%") @@ -77,8 +75,7 @@ func TestBillingService_GetActionsBillingOrg_invalidOrg(t *testing.T) { } func TestBillingService_GetPackagesBillingOrg(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/settings/billing/packages", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -120,8 +117,7 @@ func TestBillingService_GetPackagesBillingOrg(t *testing.T) { } func TestBillingService_GetPackagesBillingOrg_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Billing.GetPackagesBillingOrg(ctx, "%") @@ -129,8 +125,7 @@ func TestBillingService_GetPackagesBillingOrg_invalidOrg(t *testing.T) { } func TestBillingService_GetStorageBillingOrg(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/settings/billing/shared-storage", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -172,8 +167,7 @@ func TestBillingService_GetStorageBillingOrg(t *testing.T) { } func TestBillingService_GetStorageBillingOrg_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Billing.GetStorageBillingOrg(ctx, "%") @@ -181,8 +175,7 @@ func TestBillingService_GetStorageBillingOrg_invalidOrg(t *testing.T) { } func TestBillingService_GetActionsBillingUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/settings/billing/actions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -234,8 +227,7 @@ func TestBillingService_GetActionsBillingUser(t *testing.T) { } func TestBillingService_GetActionsBillingUser_invalidUser(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Billing.GetActionsBillingUser(ctx, "%") @@ -243,8 +235,7 @@ func TestBillingService_GetActionsBillingUser_invalidUser(t *testing.T) { } func TestBillingService_GetPackagesBillingUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/settings/billing/packages", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -286,8 +277,7 @@ func TestBillingService_GetPackagesBillingUser(t *testing.T) { } func TestBillingService_GetPackagesBillingUser_invalidUser(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Billing.GetPackagesBillingUser(ctx, "%") @@ -295,8 +285,7 @@ func TestBillingService_GetPackagesBillingUser_invalidUser(t *testing.T) { } func TestBillingService_GetStorageBillingUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/settings/billing/shared-storage", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -338,8 +327,7 @@ func TestBillingService_GetStorageBillingUser(t *testing.T) { } func TestBillingService_GetStorageBillingUser_invalidUser(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Billing.GetStorageBillingUser(ctx, "%") @@ -429,8 +417,7 @@ func TestStorageBilling_Marshal(t *testing.T) { } func TestBillingService_GetAdvancedSecurityActiveCommittersOrg(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/settings/billing/advanced-security", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -443,7 +430,6 @@ func TestBillingService_GetAdvancedSecurityActiveCommittersOrg(t *testing.T) { { "name": "octocat-org/Hello-World", "advanced_security_committers": 2, - "advanced_security_committers_breakdown": [ { "user_login": "octokitten", @@ -500,8 +486,7 @@ func TestBillingService_GetAdvancedSecurityActiveCommittersOrg(t *testing.T) { } func TestBillingService_GetAdvancedSecurityActiveCommittersOrg_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Billing.GetAdvancedSecurityActiveCommittersOrg(ctx, "%", nil) diff --git a/github/checks_test.go b/github/checks_test.go index 48f6370fe96..2ed7b0f8d17 100644 --- a/github/checks_test.go +++ b/github/checks_test.go @@ -16,8 +16,7 @@ import ( ) func TestChecksService_GetCheckRun(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/check-runs/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -66,8 +65,7 @@ func TestChecksService_GetCheckRun(t *testing.T) { } func TestChecksService_GetCheckSuite(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/check-suites/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -115,8 +113,7 @@ func TestChecksService_GetCheckSuite(t *testing.T) { } func TestChecksService_CreateCheckRun(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/check-runs", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -182,8 +179,7 @@ func TestChecksService_CreateCheckRun(t *testing.T) { } func TestChecksService_ListCheckRunAnnotations(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/check-runs/1/annotations", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -196,7 +192,7 @@ func TestChecksService_ListCheckRunAnnotations(t *testing.T) { "start_line": 2, "end_line": 2, "start_column": 1, - "end_column": 5, + "end_column": 5, "annotation_level": "warning", "message": "Check your spelling for 'banaas'.", "title": "Spell check", @@ -242,8 +238,7 @@ func TestChecksService_ListCheckRunAnnotations(t *testing.T) { } func TestChecksService_UpdateCheckRun(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/check-runs/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") @@ -251,7 +246,7 @@ func TestChecksService_UpdateCheckRun(t *testing.T) { fmt.Fprint(w, `{ "id": 1, "name":"testUpdateCheckRun", - "status": "completed", + "status": "completed", "conclusion": "neutral", "started_at": "2018-05-04T01:14:52Z", "completed_at": "2018-05-04T01:14:52Z", @@ -308,8 +303,7 @@ func TestChecksService_UpdateCheckRun(t *testing.T) { } func TestChecksService_ListCheckRunsForRef(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/commits/master/check-runs", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -380,8 +374,7 @@ func TestChecksService_ListCheckRunsForRef(t *testing.T) { } func TestChecksService_ListCheckRunsCheckSuite(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/check-suites/1/check-runs", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -447,8 +440,7 @@ func TestChecksService_ListCheckRunsCheckSuite(t *testing.T) { } func TestChecksService_ListCheckSuiteForRef(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/commits/master/check-suites", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -513,8 +505,7 @@ func TestChecksService_ListCheckSuiteForRef(t *testing.T) { } func TestChecksService_SetCheckSuitePreferences(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/check-suites/preferences", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") @@ -560,8 +551,7 @@ func TestChecksService_SetCheckSuitePreferences(t *testing.T) { } func TestChecksService_CreateCheckSuite(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/check-suites", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -616,8 +606,7 @@ func TestChecksService_CreateCheckSuite(t *testing.T) { } func TestChecksService_ReRequestCheckSuite(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/check-suites/1/rerequest", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -1726,8 +1715,7 @@ func TestCheckSuitePreferenceResults_Marshal(t *testing.T) { } func TestChecksService_ReRequestCheckRun(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/check-runs/1/rerequest", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") diff --git a/github/code-scanning_test.go b/github/code-scanning_test.go index 1edbebae0fa..f9c3154ce25 100644 --- a/github/code-scanning_test.go +++ b/github/code-scanning_test.go @@ -55,8 +55,7 @@ func TestCodeScanningService_Alert_ID(t *testing.T) { } func TestCodeScanningService_UploadSarif(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) expectedSarifID := &SarifID{ ID: String("testid"), @@ -100,8 +99,7 @@ func TestCodeScanningService_UploadSarif(t *testing.T) { } func TestCodeScanningService_GetSARIF(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/code-scanning/sarifs/abc", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -141,8 +139,7 @@ func TestCodeScanningService_GetSARIF(t *testing.T) { } func TestCodeScanningService_ListAlertsForOrg(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/code-scanning/alerts", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -345,8 +342,7 @@ func TestCodeScanningService_ListAlertsForOrg(t *testing.T) { } func TestCodeScanningService_ListAlertsForOrgLisCursorOptions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/code-scanning/alerts", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -471,8 +467,7 @@ func TestCodeScanningService_ListAlertsForOrgLisCursorOptions(t *testing.T) { } func TestCodeScanningService_ListAlertsForRepo(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/code-scanning/alerts", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -665,8 +660,8 @@ func TestCodeScanningService_ListAlertsForRepo(t *testing.T) { } func TestCodeScanningService_UpdateAlert(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + mux.HandleFunc("/repos/o/r/code-scanning/alerts/88", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") fmt.Fprint(w, `{"rule_id":"js/useless-expression", @@ -782,8 +777,7 @@ func TestCodeScanningService_UpdateAlert(t *testing.T) { } func TestCodeScanningService_ListAlertInstances(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/code-scanning/alerts/88/instances", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -861,8 +855,7 @@ func TestCodeScanningService_ListAlertInstances(t *testing.T) { } func TestCodeScanningService_GetAlert(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/code-scanning/alerts/88", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -1111,8 +1104,7 @@ func TestMessage_Marshal(t *testing.T) { } func TestCodeScanningService_ListAnalysesForRepo(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/code-scanning/analyses", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -1235,8 +1227,7 @@ func TestCodeScanningService_ListAnalysesForRepo(t *testing.T) { } func TestCodeScanningService_GetAnalysis(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/code-scanning/analyses/3602840", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -1311,8 +1302,7 @@ func TestCodeScanningService_GetAnalysis(t *testing.T) { } func TestCodeScanningService_DeleteAnalysis(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/code-scanning/analyses/40", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -1352,8 +1342,7 @@ func TestCodeScanningService_DeleteAnalysis(t *testing.T) { } func TestCodeScanningService_ListCodeQLDatabases(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/code-scanning/codeql/databases", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -1451,8 +1440,7 @@ func TestCodeScanningService_ListCodeQLDatabases(t *testing.T) { } func TestCodeScanningService_GetCodeQLDatabase(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/code-scanning/codeql/databases/lang", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -1546,8 +1534,7 @@ func TestCodeScanningService_GetCodeQLDatabase(t *testing.T) { } func TestCodeScanningService_GetDefaultSetupConfiguration(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/code-scanning/default-setup", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -1599,8 +1586,7 @@ func TestCodeScanningService_GetDefaultSetupConfiguration(t *testing.T) { } func TestCodeScanningService_UpdateDefaultSetupConfiguration(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/code-scanning/default-setup", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") diff --git a/github/codesofconduct_test.go b/github/codesofconduct_test.go index 71ef31f7afd..f4b17eb4761 100644 --- a/github/codesofconduct_test.go +++ b/github/codesofconduct_test.go @@ -15,8 +15,7 @@ import ( ) func TestCodesOfConductService_List(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/codes_of_conduct", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -53,8 +52,7 @@ func TestCodesOfConductService_List(t *testing.T) { } func TestCodesOfConductService_Get(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/codes_of_conduct/k", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") diff --git a/github/codespaces_secrets_test.go b/github/codespaces_secrets_test.go index 33c0ad99c81..4a5cdfd3e60 100644 --- a/github/codespaces_secrets_test.go +++ b/github/codespaces_secrets_test.go @@ -77,8 +77,7 @@ func TestCodespacesService_ListSecrets(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) tt.handleFunc(mux) @@ -175,8 +174,7 @@ func TestCodespacesService_GetSecret(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) tt.handleFunc(mux) @@ -273,8 +271,7 @@ func TestCodespacesService_CreateOrUpdateSecret(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) tt.handleFunc(mux) @@ -358,8 +355,7 @@ func TestCodespacesService_DeleteSecret(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) tt.handleFunc(mux) @@ -442,8 +438,7 @@ func TestCodespacesService_GetPublicKey(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) tt.handleFunc(mux) @@ -519,8 +514,7 @@ func TestCodespacesService_ListSelectedReposForSecret(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) tt.handleFunc(mux) @@ -604,8 +598,7 @@ func TestCodespacesService_SetSelectedReposForSecret(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) tt.handleFunc(mux) @@ -670,8 +663,7 @@ func TestCodespacesService_AddSelectedReposForSecret(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) tt.handleFunc(mux) @@ -736,8 +728,7 @@ func TestCodespacesService_RemoveSelectedReposFromSecret(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) tt.handleFunc(mux) @@ -762,8 +753,7 @@ func TestCodespacesService_RemoveSelectedReposFromSecret(t *testing.T) { } // func TestActionsService_ListSelectedReposForOrgSecret(t *testing.T) { -// client, mux, _, teardown := setup() -// defer teardown() +// client, mux, _ := setup(t) // mux.HandleFunc("/orgs/o/actions/secrets/NAME/repositories", func(w http.ResponseWriter, r *http.Request) { // testMethod(t, r, "GET") diff --git a/github/codespaces_test.go b/github/codespaces_test.go index 8b75731be6c..03ca709c6fe 100644 --- a/github/codespaces_test.go +++ b/github/codespaces_test.go @@ -16,8 +16,7 @@ import ( ) func TestCodespacesService_ListInRepo(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/owner/repo/codespaces", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -101,8 +100,7 @@ func TestCodespacesService_ListInRepo(t *testing.T) { } func TestCodespacesService_List(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/codespaces", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -144,8 +142,8 @@ func TestCodespacesService_List(t *testing.T) { } func TestCodespacesService_CreateInRepo(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + mux.HandleFunc("/repos/owner/repo/codespaces", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") testHeader(t, r, "Content-Type", "application/json") @@ -190,8 +188,8 @@ func TestCodespacesService_CreateInRepo(t *testing.T) { } func TestCodespacesService_Start(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + mux.HandleFunc("/user/codespaces/codespace_1/start", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") fmt.Fprint(w, `{"id":1, "repository": {"id": 1296269}}`) @@ -228,8 +226,8 @@ func TestCodespacesService_Start(t *testing.T) { } func TestCodespacesService_Stop(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + mux.HandleFunc("/user/codespaces/codespace_1/stop", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") fmt.Fprint(w, `{"id":1, "repository": {"id": 1296269}}`) @@ -266,8 +264,7 @@ func TestCodespacesService_Stop(t *testing.T) { } func TestCodespacesService_Delete(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/codespaces/codespace_1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") diff --git a/github/copilot_test.go b/github/copilot_test.go index 008630ab273..355ff130c85 100644 --- a/github/copilot_test.go +++ b/github/copilot_test.go @@ -272,8 +272,7 @@ func TestCopilotService_GetSeatDetailsOrganization(t *testing.T) { } func TestCopilotService_GetCopilotBilling(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/copilot/billing", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -331,8 +330,7 @@ func TestCopilotService_GetCopilotBilling(t *testing.T) { } func TestCopilotService_ListCopilotSeats(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/copilot/billing/seats", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -604,8 +602,7 @@ func TestCopilotService_ListCopilotSeats(t *testing.T) { } func TestCopilotService_AddCopilotTeams(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/copilot/billing/selected_teams", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -642,8 +639,7 @@ func TestCopilotService_AddCopilotTeams(t *testing.T) { } func TestCopilotService_RemoveCopilotTeams(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/copilot/billing/selected_teams", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -680,8 +676,7 @@ func TestCopilotService_RemoveCopilotTeams(t *testing.T) { } func TestCopilotService_AddCopilotUsers(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/copilot/billing/selected_users", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -718,8 +713,7 @@ func TestCopilotService_AddCopilotUsers(t *testing.T) { } func TestCopilotService_RemoveCopilotUsers(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/copilot/billing/selected_users", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -756,8 +750,7 @@ func TestCopilotService_RemoveCopilotUsers(t *testing.T) { } func TestCopilotService_GetSeatDetails(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/members/u/copilot", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") diff --git a/github/dependabot_alerts_test.go b/github/dependabot_alerts_test.go index 45fd11ee41c..99e33f31128 100644 --- a/github/dependabot_alerts_test.go +++ b/github/dependabot_alerts_test.go @@ -15,8 +15,7 @@ import ( ) func TestDependabotService_ListRepoAlerts(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/dependabot/alerts", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -55,8 +54,7 @@ func TestDependabotService_ListRepoAlerts(t *testing.T) { } func TestDependabotService_GetRepoAlert(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/dependabot/alerts/42", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -93,8 +91,7 @@ func TestDependabotService_GetRepoAlert(t *testing.T) { } func TestDependabotService_ListOrgAlerts(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/dependabot/alerts", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -133,8 +130,7 @@ func TestDependabotService_ListOrgAlerts(t *testing.T) { } func TestDependabotService_UpdateAlert(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) state := String("dismissed") dismissedReason := String("no_bandwidth") diff --git a/github/dependabot_secrets_test.go b/github/dependabot_secrets_test.go index d48328846c8..9965c811078 100644 --- a/github/dependabot_secrets_test.go +++ b/github/dependabot_secrets_test.go @@ -16,8 +16,7 @@ import ( ) func TestDependabotService_GetRepoPublicKey(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/dependabot/secrets/public-key", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -51,8 +50,7 @@ func TestDependabotService_GetRepoPublicKey(t *testing.T) { } func TestDependabotService_GetRepoPublicKeyNumeric(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/dependabot/secrets/public-key", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -86,8 +84,7 @@ func TestDependabotService_GetRepoPublicKeyNumeric(t *testing.T) { } func TestDependabotService_ListRepoSecrets(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/dependabot/secrets", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -129,8 +126,7 @@ func TestDependabotService_ListRepoSecrets(t *testing.T) { } func TestDependabotService_GetRepoSecret(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/dependabot/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -168,8 +164,7 @@ func TestDependabotService_GetRepoSecret(t *testing.T) { } func TestDependabotService_CreateOrUpdateRepoSecret(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/dependabot/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -201,8 +196,7 @@ func TestDependabotService_CreateOrUpdateRepoSecret(t *testing.T) { } func TestDependabotService_DeleteRepoSecret(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/dependabot/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -226,8 +220,7 @@ func TestDependabotService_DeleteRepoSecret(t *testing.T) { } func TestDependabotService_GetOrgPublicKey(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/dependabot/secrets/public-key", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -261,8 +254,7 @@ func TestDependabotService_GetOrgPublicKey(t *testing.T) { } func TestDependabotService_ListOrgSecrets(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/dependabot/secrets", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -305,8 +297,7 @@ func TestDependabotService_ListOrgSecrets(t *testing.T) { } func TestDependabotService_GetOrgSecret(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/dependabot/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -346,8 +337,7 @@ func TestDependabotService_GetOrgSecret(t *testing.T) { } func TestDependabotService_CreateOrUpdateOrgSecret(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/dependabot/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -381,8 +371,7 @@ func TestDependabotService_CreateOrUpdateOrgSecret(t *testing.T) { } func TestDependabotService_ListSelectedReposForOrgSecret(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/dependabot/secrets/NAME/repositories", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -422,8 +411,7 @@ func TestDependabotService_ListSelectedReposForOrgSecret(t *testing.T) { } func TestDependabotService_SetSelectedReposForOrgSecret(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/dependabot/secrets/NAME/repositories", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -449,8 +437,7 @@ func TestDependabotService_SetSelectedReposForOrgSecret(t *testing.T) { } func TestDependabotService_AddSelectedRepoToOrgSecret(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/dependabot/secrets/NAME/repositories/1234", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -475,8 +462,7 @@ func TestDependabotService_AddSelectedRepoToOrgSecret(t *testing.T) { } func TestDependabotService_RemoveSelectedRepoFromOrgSecret(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/dependabot/secrets/NAME/repositories/1234", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -501,8 +487,7 @@ func TestDependabotService_RemoveSelectedRepoFromOrgSecret(t *testing.T) { } func TestDependabotService_DeleteOrgSecret(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/dependabot/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") diff --git a/github/dependency_graph_snapshots_test.go b/github/dependency_graph_snapshots_test.go index ed70ed574d2..c58edde617f 100644 --- a/github/dependency_graph_snapshots_test.go +++ b/github/dependency_graph_snapshots_test.go @@ -16,8 +16,7 @@ import ( ) func TestDependencyGraphService_CreateSnapshot(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/dependency-graph/snapshots", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") diff --git a/github/dependency_graph_test.go b/github/dependency_graph_test.go index 73cf07f7161..e75df13ac29 100644 --- a/github/dependency_graph_test.go +++ b/github/dependency_graph_test.go @@ -16,8 +16,7 @@ import ( ) func TestDependencyGraphService_GetSBOM(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/owner/repo/dependency-graph/sbom", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") diff --git a/github/emojis_test.go b/github/emojis_test.go index 79c890e36d1..474cace8bc2 100644 --- a/github/emojis_test.go +++ b/github/emojis_test.go @@ -15,8 +15,7 @@ import ( ) func TestEmojisService_List(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/emojis", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") diff --git a/github/enterprise_actions_runner_groups_test.go b/github/enterprise_actions_runner_groups_test.go index 36036e419c2..562a5884b01 100644 --- a/github/enterprise_actions_runner_groups_test.go +++ b/github/enterprise_actions_runner_groups_test.go @@ -15,8 +15,7 @@ import ( ) func TestEnterpriseService_ListRunnerGroups(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/enterprises/o/actions/runner-groups", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -59,8 +58,7 @@ func TestEnterpriseService_ListRunnerGroups(t *testing.T) { } func TestEnterpriseService_ListRunnerGroupsVisibleToOrganization(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/enterprises/o/actions/runner-groups", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -103,8 +101,7 @@ func TestEnterpriseService_ListRunnerGroupsVisibleToOrganization(t *testing.T) { } func TestEnterpriseService_GetRunnerGroup(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/enterprises/o/actions/runner-groups/2", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -150,8 +147,7 @@ func TestEnterpriseService_GetRunnerGroup(t *testing.T) { } func TestEnterpriseService_DeleteRunnerGroup(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/enterprises/o/actions/runner-groups/2", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -175,8 +171,7 @@ func TestEnterpriseService_DeleteRunnerGroup(t *testing.T) { } func TestEnterpriseService_CreateRunnerGroup(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/enterprises/o/actions/runner-groups", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -229,8 +224,7 @@ func TestEnterpriseService_CreateRunnerGroup(t *testing.T) { } func TestEnterpriseService_UpdateRunnerGroup(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/enterprises/o/actions/runner-groups/2", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") @@ -283,8 +277,7 @@ func TestEnterpriseService_UpdateRunnerGroup(t *testing.T) { } func TestEnterpriseService_ListOrganizationAccessRunnerGroup(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/enterprises/o/actions/runner-groups/2/organizations", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -325,8 +318,7 @@ func TestEnterpriseService_ListOrganizationAccessRunnerGroup(t *testing.T) { } func TestEnterpriseService_SetOrganizationAccessRunnerGroup(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/enterprises/o/actions/runner-groups/2/organizations", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -357,8 +349,7 @@ func TestEnterpriseService_SetOrganizationAccessRunnerGroup(t *testing.T) { } func TestEnterpriseService_AddOrganizationAccessRunnerGroup(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/enterprises/o/actions/runner-groups/2/organizations/42", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -382,8 +373,7 @@ func TestEnterpriseService_AddOrganizationAccessRunnerGroup(t *testing.T) { } func TestEnterpriseService_RemoveOrganizationAccessRunnerGroup(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/enterprises/o/actions/runner-groups/2/organizations/42", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -407,8 +397,7 @@ func TestEnterpriseService_RemoveOrganizationAccessRunnerGroup(t *testing.T) { } func TestEnterpriseService_ListEnterpriseRunnerGroupRunners(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/enterprises/o/actions/runner-groups/2/runners", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -450,8 +439,7 @@ func TestEnterpriseService_ListEnterpriseRunnerGroupRunners(t *testing.T) { } func TestEnterpriseService_SetEnterpriseRunnerGroupRunners(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/enterprises/o/actions/runner-groups/2/runners", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -482,8 +470,7 @@ func TestEnterpriseService_SetEnterpriseRunnerGroupRunners(t *testing.T) { } func TestEnterpriseService_AddEnterpriseRunnerGroupRunners(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/enterprises/o/actions/runner-groups/2/runners/42", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -507,8 +494,7 @@ func TestEnterpriseService_AddEnterpriseRunnerGroupRunners(t *testing.T) { } func TestEnterpriseService_RemoveEnterpriseRunnerGroupRunners(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/enterprises/o/actions/runner-groups/2/runners/42", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -597,7 +583,7 @@ func TestEnterpriseRunnerGroups_Marshal(t *testing.T) { "allows_public_repositories": true, "restricted_to_workflows": false, "selected_workflows": [] - }] + }] }` testJSONMarshal(t, u, want) diff --git a/github/enterprise_actions_runners_test.go b/github/enterprise_actions_runners_test.go index d5efc6f7f03..e1adba8fa4b 100644 --- a/github/enterprise_actions_runners_test.go +++ b/github/enterprise_actions_runners_test.go @@ -17,8 +17,7 @@ import ( ) func TestEnterpriseService_GenerateEnterpriseJITConfig(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &GenerateJITConfigRequest{Name: "test", RunnerGroupID: 1, Labels: []string{"one", "two"}} @@ -64,8 +63,7 @@ func TestEnterpriseService_GenerateEnterpriseJITConfig(t *testing.T) { } func TestEnterpriseService_CreateRegistrationToken(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/actions/runners/registration-token", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -101,8 +99,7 @@ func TestEnterpriseService_CreateRegistrationToken(t *testing.T) { } func TestEnterpriseService_ListRunners(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/actions/runners", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -146,8 +143,7 @@ func TestEnterpriseService_ListRunners(t *testing.T) { } func TestEnterpriseService_GetRunner(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/actions/runners/23", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -186,8 +182,7 @@ func TestEnterpriseService_GetRunner(t *testing.T) { } func TestEnterpriseService_RemoveRunner(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/enterprises/o/actions/runners/21", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -211,8 +206,7 @@ func TestEnterpriseService_RemoveRunner(t *testing.T) { } func TestEnterpriseService_ListRunnerApplicationDownloads(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/enterprises/o/actions/runners/downloads", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") diff --git a/github/enterprise_audit_log_test.go b/github/enterprise_audit_log_test.go index 1ae94babb75..15fdce4d8f0 100644 --- a/github/enterprise_audit_log_test.go +++ b/github/enterprise_audit_log_test.go @@ -14,8 +14,7 @@ import ( ) func TestEnterpriseService_GetAuditLog(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/audit-log", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") diff --git a/github/enterprise_code_security_and_analysis_test.go b/github/enterprise_code_security_and_analysis_test.go index 17bbe18beae..d3453e29747 100644 --- a/github/enterprise_code_security_and_analysis_test.go +++ b/github/enterprise_code_security_and_analysis_test.go @@ -16,8 +16,7 @@ import ( ) func TestEnterpriseService_GetCodeSecurityAndAnalysis(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/code_security_and_analysis", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -67,8 +66,7 @@ func TestEnterpriseService_GetCodeSecurityAndAnalysis(t *testing.T) { } func TestEnterpriseService_UpdateCodeSecurityAndAnalysis(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &EnterpriseSecurityAnalysisSettings{ AdvancedSecurityEnabledForNewRepositories: Bool(true), @@ -108,8 +106,7 @@ func TestEnterpriseService_UpdateCodeSecurityAndAnalysis(t *testing.T) { } func TestEnterpriseService_EnableAdvancedSecurity(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/advanced_security/enable_all", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") diff --git a/github/gists_comments_test.go b/github/gists_comments_test.go index 593c9eeddc6..df6188f43c2 100644 --- a/github/gists_comments_test.go +++ b/github/gists_comments_test.go @@ -72,8 +72,7 @@ func TestGistComments_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } func TestGistsService_ListComments(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/gists/1/comments", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -109,8 +108,7 @@ func TestGistsService_ListComments(t *testing.T) { } func TestGistsService_ListComments_invalidID(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Gists.ListComments(ctx, "%", nil) @@ -118,8 +116,7 @@ func TestGistsService_ListComments_invalidID(t *testing.T) { } func TestGistsService_GetComment(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/gists/1/comments/2", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -153,8 +150,7 @@ func TestGistsService_GetComment(t *testing.T) { } func TestGistsService_GetComment_invalidID(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Gists.GetComment(ctx, "%", 1) @@ -162,8 +158,7 @@ func TestGistsService_GetComment_invalidID(t *testing.T) { } func TestGistsService_CreateComment(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &GistComment{ID: Int64(1), Body: String("b")} @@ -206,8 +201,7 @@ func TestGistsService_CreateComment(t *testing.T) { } func TestGistsService_CreateComment_invalidID(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Gists.CreateComment(ctx, "%", nil) @@ -215,8 +209,7 @@ func TestGistsService_CreateComment_invalidID(t *testing.T) { } func TestGistsService_EditComment(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &GistComment{ID: Int64(1), Body: String("b")} @@ -259,8 +252,7 @@ func TestGistsService_EditComment(t *testing.T) { } func TestGistsService_EditComment_invalidID(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Gists.EditComment(ctx, "%", 1, nil) @@ -268,8 +260,7 @@ func TestGistsService_EditComment_invalidID(t *testing.T) { } func TestGistsService_DeleteComment(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/gists/1/comments/2", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -293,8 +284,7 @@ func TestGistsService_DeleteComment(t *testing.T) { } func TestGistsService_DeleteComment_invalidID(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Gists.DeleteComment(ctx, "%", 1) diff --git a/github/gists_test.go b/github/gists_test.go index 995363ec4cc..cd62d0ca4ae 100644 --- a/github/gists_test.go +++ b/github/gists_test.go @@ -226,8 +226,7 @@ func TestGistFork_Marshal(t *testing.T) { } func TestGistsService_List_specifiedUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) since := "2013-01-01T00:00:00Z" @@ -267,8 +266,7 @@ func TestGistsService_List_specifiedUser(t *testing.T) { } func TestGistsService_List_authenticatedUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/gists", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -302,8 +300,7 @@ func TestGistsService_List_authenticatedUser(t *testing.T) { } func TestGistsService_List_invalidUser(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Gists.List(ctx, "%", nil) @@ -311,8 +308,7 @@ func TestGistsService_List_invalidUser(t *testing.T) { } func TestGistsService_ListAll(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) since := "2013-01-01T00:00:00Z" @@ -347,8 +343,7 @@ func TestGistsService_ListAll(t *testing.T) { } func TestGistsService_ListStarred(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) since := "2013-01-01T00:00:00Z" @@ -383,8 +378,7 @@ func TestGistsService_ListStarred(t *testing.T) { } func TestGistsService_Get(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/gists/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -418,8 +412,7 @@ func TestGistsService_Get(t *testing.T) { } func TestGistsService_Get_invalidID(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Gists.Get(ctx, "%") @@ -427,8 +420,7 @@ func TestGistsService_Get_invalidID(t *testing.T) { } func TestGistsService_GetRevision(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/gists/1/s", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -462,8 +454,7 @@ func TestGistsService_GetRevision(t *testing.T) { } func TestGistsService_GetRevision_invalidID(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Gists.GetRevision(ctx, "%", "%") @@ -471,8 +462,7 @@ func TestGistsService_GetRevision_invalidID(t *testing.T) { } func TestGistsService_Create(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &Gist{ Description: String("Gist description"), @@ -534,8 +524,7 @@ func TestGistsService_Create(t *testing.T) { } func TestGistsService_Edit(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &Gist{ Description: String("New description"), @@ -605,8 +594,7 @@ func TestGistsService_Edit(t *testing.T) { } func TestGistsService_Edit_invalidID(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Gists.Edit(ctx, "%", nil) @@ -614,8 +602,7 @@ func TestGistsService_Edit_invalidID(t *testing.T) { } func TestGistsService_ListCommits(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/gists/1/commits", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -676,8 +663,7 @@ func TestGistsService_ListCommits(t *testing.T) { } func TestGistsService_ListCommits_withOptions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/gists/1/commits", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -709,8 +695,7 @@ func TestGistsService_ListCommits_withOptions(t *testing.T) { } func TestGistsService_ListCommits_invalidID(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Gists.ListCommits(ctx, "%", nil) @@ -718,8 +703,7 @@ func TestGistsService_ListCommits_invalidID(t *testing.T) { } func TestGistsService_Delete(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/gists/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -743,8 +727,7 @@ func TestGistsService_Delete(t *testing.T) { } func TestGistsService_Delete_invalidID(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Gists.Delete(ctx, "%") @@ -752,8 +735,7 @@ func TestGistsService_Delete_invalidID(t *testing.T) { } func TestGistsService_Star(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/gists/1/star", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -777,8 +759,7 @@ func TestGistsService_Star(t *testing.T) { } func TestGistsService_Star_invalidID(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Gists.Star(ctx, "%") @@ -786,8 +767,7 @@ func TestGistsService_Star_invalidID(t *testing.T) { } func TestGistsService_Unstar(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/gists/1/star", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -811,8 +791,7 @@ func TestGistsService_Unstar(t *testing.T) { } func TestGistsService_Unstar_invalidID(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Gists.Unstar(ctx, "%") @@ -820,8 +799,7 @@ func TestGistsService_Unstar_invalidID(t *testing.T) { } func TestGistsService_IsStarred_hasStar(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/gists/1/star", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -853,8 +831,7 @@ func TestGistsService_IsStarred_hasStar(t *testing.T) { } func TestGistsService_IsStarred_noStar(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/gists/1/star", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -886,8 +863,7 @@ func TestGistsService_IsStarred_noStar(t *testing.T) { } func TestGistsService_IsStarred_invalidID(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Gists.IsStarred(ctx, "%") @@ -895,8 +871,7 @@ func TestGistsService_IsStarred_invalidID(t *testing.T) { } func TestGistsService_Fork(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/gists/1/forks", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -930,8 +905,7 @@ func TestGistsService_Fork(t *testing.T) { } func TestGistsService_ListForks(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/gists/1/forks", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -981,8 +955,7 @@ func TestGistsService_ListForks(t *testing.T) { } func TestGistsService_ListForks_withOptions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/gists/1/forks", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") diff --git a/github/git_blobs_test.go b/github/git_blobs_test.go index 94cdd34e7a3..729e36b0fbb 100644 --- a/github/git_blobs_test.go +++ b/github/git_blobs_test.go @@ -17,8 +17,7 @@ import ( ) func TestGitService_GetBlob(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/git/blobs/s", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -60,8 +59,7 @@ func TestGitService_GetBlob(t *testing.T) { } func TestGitService_GetBlob_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Git.GetBlob(ctx, "%", "%", "%") @@ -69,8 +67,7 @@ func TestGitService_GetBlob_invalidOwner(t *testing.T) { } func TestGitService_GetBlobRaw(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/git/blobs/s", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -106,8 +103,7 @@ func TestGitService_GetBlobRaw(t *testing.T) { } func TestGitService_CreateBlob(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &Blob{ SHA: String("s"), @@ -163,8 +159,7 @@ func TestGitService_CreateBlob(t *testing.T) { } func TestGitService_CreateBlob_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Git.CreateBlob(ctx, "%", "%", &Blob{}) diff --git a/github/git_commits_test.go b/github/git_commits_test.go index bc25206b495..f965a8a1e4a 100644 --- a/github/git_commits_test.go +++ b/github/git_commits_test.go @@ -137,8 +137,7 @@ func TestCommit_Marshal(t *testing.T) { } func TestGitService_GetCommit(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/git/commits/s", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -172,8 +171,7 @@ func TestGitService_GetCommit(t *testing.T) { } func TestGitService_GetCommit_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Git.GetCommit(ctx, "%", "%", "%") @@ -181,8 +179,7 @@ func TestGitService_GetCommit_invalidOwner(t *testing.T) { } func TestGitService_CreateCommit(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &Commit{ Message: String("Commit Message."), @@ -234,8 +231,7 @@ func TestGitService_CreateCommit(t *testing.T) { } func TestGitService_CreateSignedCommit(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) signature := "----- BEGIN PGP SIGNATURE -----\n\naaaa\naaaa\n----- END PGP SIGNATURE -----" @@ -293,8 +289,7 @@ func TestGitService_CreateSignedCommit(t *testing.T) { } func TestGitService_CreateSignedCommitWithInvalidParams(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) input := &Commit{} @@ -307,8 +302,7 @@ func TestGitService_CreateSignedCommitWithInvalidParams(t *testing.T) { } func TestGitService_CreateCommitWithNilCommit(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Git.CreateCommit(ctx, "o", "r", nil, nil) @@ -318,8 +312,8 @@ func TestGitService_CreateCommitWithNilCommit(t *testing.T) { } func TestGitService_CreateCommit_WithSigner(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + signature := "my voice is my password" date := time.Date(2017, time.May, 4, 0, 3, 43, 0, time.FixedZone("CEST", 2*3600)) author := CommitAuthor{ @@ -507,8 +501,7 @@ Commit Message.` } func TestGitService_CreateCommit_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Git.CreateCommit(ctx, "%", "%", &Commit{}, nil) diff --git a/github/git_refs_test.go b/github/git_refs_test.go index 1014a44aa5b..357e4a4a4b4 100644 --- a/github/git_refs_test.go +++ b/github/git_refs_test.go @@ -17,8 +17,7 @@ import ( ) func TestGitService_GetRef_singleRef(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/git/ref/heads/b", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -74,8 +73,7 @@ func TestGitService_GetRef_singleRef(t *testing.T) { } func TestGitService_GetRef_noRefs(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/git/refs/heads/b", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -110,8 +108,7 @@ func TestGitService_GetRef_noRefs(t *testing.T) { } func TestGitService_ListMatchingRefs_singleRef(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/git/matching-refs/heads/b", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -172,8 +169,7 @@ func TestGitService_ListMatchingRefs_singleRef(t *testing.T) { } func TestGitService_ListMatchingRefs_multipleRefs(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/git/matching-refs/heads/b", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -237,8 +233,7 @@ func TestGitService_ListMatchingRefs_multipleRefs(t *testing.T) { } func TestGitService_ListMatchingRefs_noRefs(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/git/matching-refs/heads/b", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -272,8 +267,7 @@ func TestGitService_ListMatchingRefs_noRefs(t *testing.T) { } func TestGitService_ListMatchingRefs_allRefs(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/git/matching-refs/", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -346,8 +340,7 @@ func TestGitService_ListMatchingRefs_allRefs(t *testing.T) { } func TestGitService_ListMatchingRefs_options(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/git/matching-refs/t", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -383,8 +376,7 @@ func TestGitService_ListMatchingRefs_options(t *testing.T) { } func TestGitService_CreateRef(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) args := &createRefRequest{ Ref: String("refs/heads/b"), @@ -472,8 +464,7 @@ func TestGitService_CreateRef(t *testing.T) { } func TestGitService_UpdateRef(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) args := &updateRefRequest{ SHA: String("aa218f56b14c9653891f9e74264a383fa43fefbd"), @@ -553,8 +544,7 @@ func TestGitService_UpdateRef(t *testing.T) { } func TestGitService_DeleteRef(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/git/refs/heads/b", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -583,8 +573,7 @@ func TestGitService_DeleteRef(t *testing.T) { } func TestGitService_GetRef_pathEscape(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/git/ref/heads/b", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -625,8 +614,7 @@ func TestGitService_GetRef_pathEscape(t *testing.T) { } func TestGitService_UpdateRef_pathEscape(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) args := &updateRefRequest{ SHA: String("aa218f56b14c9653891f9e74264a383fa43fefbd"), diff --git a/github/git_tags_test.go b/github/git_tags_test.go index 44084141a06..59bdbb422d8 100644 --- a/github/git_tags_test.go +++ b/github/git_tags_test.go @@ -16,8 +16,7 @@ import ( ) func TestGitService_GetTag(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/git/tags/s", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -51,8 +50,7 @@ func TestGitService_GetTag(t *testing.T) { } func TestGitService_CreateTag(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &createTagRequest{Tag: String("t"), Object: String("s")} diff --git a/github/git_trees_test.go b/github/git_trees_test.go index 25e5f2aeec6..af339d873db 100644 --- a/github/git_trees_test.go +++ b/github/git_trees_test.go @@ -37,8 +37,7 @@ func TestMarshalJSON_withNilContentAndSHA(t *testing.T) { } func TestGitService_GetTree(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/git/trees/s", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -84,8 +83,7 @@ func TestGitService_GetTree(t *testing.T) { } func TestGitService_GetTree_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Git.GetTree(ctx, "%", "%", "%", false) @@ -93,8 +91,7 @@ func TestGitService_GetTree_invalidOwner(t *testing.T) { } func TestGitService_CreateTree(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := []*TreeEntry{ { @@ -172,8 +169,7 @@ func TestGitService_CreateTree(t *testing.T) { } func TestGitService_CreateTree_Content(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := []*TreeEntry{ { @@ -253,8 +249,7 @@ func TestGitService_CreateTree_Content(t *testing.T) { } func TestGitService_CreateTree_Delete(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := []*TreeEntry{ { @@ -333,8 +328,7 @@ func TestGitService_CreateTree_Delete(t *testing.T) { } func TestGitService_CreateTree_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Git.CreateTree(ctx, "%", "%", "", nil) diff --git a/github/github_test.go b/github/github_test.go index 5f5aba276d3..00b8e43f91f 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -34,7 +34,8 @@ const ( // setup sets up a test HTTP server along with a github.Client that is // configured to talk to that test server. Tests should register handlers on // mux which provide mock responses for the API method being tested. -func setup() (client *Client, mux *http.ServeMux, serverURL string, teardown func()) { +func setup(t *testing.T) (client *Client, mux *http.ServeMux, serverURL string) { + t.Helper() // mux is the HTTP request multiplexer used with the test server. mux = http.NewServeMux() @@ -63,7 +64,9 @@ func setup() (client *Client, mux *http.ServeMux, serverURL string, teardown fun client.BaseURL = url client.UploadURL = url - return client, mux, server.URL, server.Close + t.Cleanup(server.Close) + + return client, mux, server.URL } // openTestFile creates a new file with the given name and content for testing. @@ -246,8 +249,7 @@ func testNewRequestAndDoFailureCategory(t *testing.T, methodName string, client // Test that all error response types contain the status code. func testErrorResponseForStatusCode(t *testing.T, code int) { t.Helper() - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/hooks", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -992,8 +994,7 @@ func TestResponse_populateSinceValues_invalid(t *testing.T) { } func TestDo(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) type foo struct { A string @@ -1017,8 +1018,7 @@ func TestDo(t *testing.T) { } func TestDo_nilContext(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) req, _ := client.NewRequest("GET", ".", nil) _, err := client.Do(nil, req, nil) @@ -1029,8 +1029,7 @@ func TestDo_nilContext(t *testing.T) { } func TestDo_httpError(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { http.Error(w, "Bad Request", 400) @@ -1052,8 +1051,7 @@ func TestDo_httpError(t *testing.T) { // function. A redirect loop is pretty unlikely to occur within the GitHub // API, but does allow us to exercise the right code path. func TestDo_redirectLoop(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { http.Redirect(w, r, baseURLPath, http.StatusFound) @@ -1095,8 +1093,7 @@ func TestDo_sanitizeURL(t *testing.T) { } func TestDo_rateLimit(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { w.Header().Set(headerRateLimit, "60") @@ -1200,8 +1197,7 @@ func TestDo_rateLimitCategory(t *testing.T) { // ensure rate limit is still parsed, even for error responses func TestDo_rateLimit_errorResponse(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { w.Header().Set(headerRateLimit, "60") @@ -1233,8 +1229,7 @@ func TestDo_rateLimit_errorResponse(t *testing.T) { // Ensure *RateLimitError is returned when API rate limit is exceeded. func TestDo_rateLimit_rateLimitError(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { w.Header().Set(headerRateLimit, "60") @@ -1273,8 +1268,7 @@ func TestDo_rateLimit_rateLimitError(t *testing.T) { // Ensure a network call is not made when it's known that API rate limit is still exceeded. func TestDo_rateLimit_noNetworkCall(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) reset := time.Now().UTC().Add(time.Minute).Round(time.Second) // Rate reset is a minute from now, with 1 second precision. @@ -1331,8 +1325,7 @@ func TestDo_rateLimit_noNetworkCall(t *testing.T) { // Ignore rate limit headers if the response was served from cache. func TestDo_rateLimit_ignoredFromCache(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) reset := time.Now().UTC().Add(time.Minute).Round(time.Second) // Rate reset is a minute from now, with 1 second precision. @@ -1377,8 +1370,7 @@ func TestDo_rateLimit_ignoredFromCache(t *testing.T) { // Ensure sleeps until the rate limit is reset when the client is rate limited. func TestDo_rateLimit_sleepUntilResponseResetLimit(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) reset := time.Now().UTC().Add(time.Second) @@ -1418,8 +1410,7 @@ func TestDo_rateLimit_sleepUntilResponseResetLimit(t *testing.T) { // Ensure tries to sleep until the rate limit is reset when the client is rate limited, but only once. func TestDo_rateLimit_sleepUntilResponseResetLimitRetryOnce(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) reset := time.Now().UTC().Add(time.Second) @@ -1450,8 +1441,7 @@ func TestDo_rateLimit_sleepUntilResponseResetLimitRetryOnce(t *testing.T) { // Ensure a network call is not made when it's known that API rate limit is still exceeded. func TestDo_rateLimit_sleepUntilClientResetLimit(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) reset := time.Now().UTC().Add(time.Second) client.rateLimits[CoreCategory] = Rate{Limit: 5000, Remaining: 0, Reset: Timestamp{reset}} @@ -1481,8 +1471,7 @@ func TestDo_rateLimit_sleepUntilClientResetLimit(t *testing.T) { // Ensure sleep is aborted when the context is cancelled. func TestDo_rateLimit_abortSleepContextCancelled(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) // We use a 1 minute reset time to ensure the sleep is not completed. reset := time.Now().UTC().Add(time.Minute) @@ -1514,8 +1503,7 @@ func TestDo_rateLimit_abortSleepContextCancelled(t *testing.T) { // Ensure sleep is aborted when the context is cancelled on initial request. func TestDo_rateLimit_abortSleepContextCancelledClientLimit(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) reset := time.Now().UTC().Add(time.Minute) client.rateLimits[CoreCategory] = Rate{Limit: 5000, Remaining: 0, Reset: Timestamp{reset}} @@ -1548,8 +1536,7 @@ func TestDo_rateLimit_abortSleepContextCancelledClientLimit(t *testing.T) { // Ensure *AbuseRateLimitError is returned when the response indicates that // the client has triggered an abuse detection mechanism. func TestDo_rateLimit_abuseRateLimitError(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=utf-8") @@ -1581,8 +1568,7 @@ func TestDo_rateLimit_abuseRateLimitError(t *testing.T) { // Ensure *AbuseRateLimitError is returned when the response indicates that // the client has triggered an abuse detection mechanism on GitHub Enterprise. func TestDo_rateLimit_abuseRateLimitErrorEnterprise(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=utf-8") @@ -1615,8 +1601,7 @@ func TestDo_rateLimit_abuseRateLimitErrorEnterprise(t *testing.T) { // Ensure *AbuseRateLimitError.RetryAfter is parsed correctly for the Retry-After header. func TestDo_rateLimit_abuseRateLimitError_retryAfter(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=utf-8") @@ -1668,8 +1653,7 @@ func TestDo_rateLimit_abuseRateLimitError_retryAfter(t *testing.T) { // Ensure *AbuseRateLimitError.RetryAfter is parsed correctly for the x-ratelimit-reset header. func TestDo_rateLimit_abuseRateLimitError_xRateLimitReset(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) // x-ratelimit-reset value of 123 seconds into the future. blockUntil := time.Now().Add(time.Duration(123) * time.Second).Unix() @@ -1725,8 +1709,7 @@ func TestDo_rateLimit_abuseRateLimitError_xRateLimitReset(t *testing.T) { } func TestDo_noContent(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusNoContent) @@ -2344,8 +2327,7 @@ func TestSetCredentialsAsHeaders(t *testing.T) { } func TestUnauthenticatedRateLimitedTransport(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) clientID, clientSecret := "id", "secret" mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { @@ -2415,8 +2397,7 @@ func TestUnauthenticatedRateLimitedTransport_transport(t *testing.T) { } func TestBasicAuthTransport(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) username, password, otp := "u", "p", "123456" @@ -2579,8 +2560,7 @@ func TestAddOptions_QueryValues(t *testing.T) { } func TestBareDo_returnsOpenBody(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) expectedBody := "Hello from the other side !" diff --git a/github/gitignore_test.go b/github/gitignore_test.go index 61ee4d52e58..300c06d3582 100644 --- a/github/gitignore_test.go +++ b/github/gitignore_test.go @@ -15,8 +15,7 @@ import ( ) func TestGitignoresService_List(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/gitignore/templates", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -45,8 +44,7 @@ func TestGitignoresService_List(t *testing.T) { } func TestGitignoresService_Get(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/gitignore/templates/name", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -80,8 +78,7 @@ func TestGitignoresService_Get(t *testing.T) { } func TestGitignoresService_Get_invalidTemplate(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Gitignores.Get(ctx, "%") diff --git a/github/interactions_orgs_test.go b/github/interactions_orgs_test.go index f014bd5feed..264d9635e64 100644 --- a/github/interactions_orgs_test.go +++ b/github/interactions_orgs_test.go @@ -16,8 +16,7 @@ import ( ) func TestInteractionsService_GetRestrictionsForOrgs(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/interaction-limits", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -52,8 +51,7 @@ func TestInteractionsService_GetRestrictionsForOrgs(t *testing.T) { } func TestInteractionsService_UpdateRestrictionsForOrg(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &InteractionRestriction{Limit: String("existing_users")} @@ -96,8 +94,7 @@ func TestInteractionsService_UpdateRestrictionsForOrg(t *testing.T) { } func TestInteractionsService_RemoveRestrictionsFromOrg(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/interaction-limits", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") diff --git a/github/interactions_repos_test.go b/github/interactions_repos_test.go index fd48ae7130d..432790f4203 100644 --- a/github/interactions_repos_test.go +++ b/github/interactions_repos_test.go @@ -16,8 +16,7 @@ import ( ) func TestInteractionsService_GetRestrictionsForRepo(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/interaction-limits", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -52,8 +51,7 @@ func TestInteractionsService_GetRestrictionsForRepo(t *testing.T) { } func TestInteractionsService_UpdateRestrictionsForRepo(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &InteractionRestriction{Limit: String("existing_users")} @@ -96,8 +94,7 @@ func TestInteractionsService_UpdateRestrictionsForRepo(t *testing.T) { } func TestInteractionsService_RemoveRestrictionsFromRepo(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/interaction-limits", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") diff --git a/github/issue_import_test.go b/github/issue_import_test.go index 6801c3c0ddb..97960994034 100644 --- a/github/issue_import_test.go +++ b/github/issue_import_test.go @@ -17,8 +17,7 @@ import ( ) func TestIssueImportService_Create(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) createdAt := time.Date(2020, time.August, 11, 15, 30, 0, 0, time.UTC) input := &IssueImportRequest{ @@ -75,8 +74,7 @@ func TestIssueImportService_Create(t *testing.T) { } func TestIssueImportService_Create_deferred(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) createdAt := time.Date(2020, time.August, 11, 15, 30, 0, 0, time.UTC) input := &IssueImportRequest{ @@ -121,8 +119,7 @@ func TestIssueImportService_Create_deferred(t *testing.T) { } func TestIssueImportService_Create_badResponse(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) createdAt := time.Date(2020, time.August, 11, 15, 30, 0, 0, time.UTC) input := &IssueImportRequest{ @@ -162,8 +159,7 @@ func TestIssueImportService_Create_badResponse(t *testing.T) { } func TestIssueImportService_Create_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.IssueImport.Create(ctx, "%", "r", nil) @@ -171,8 +167,7 @@ func TestIssueImportService_Create_invalidOwner(t *testing.T) { } func TestIssueImportService_CheckStatus(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/import/issues/3", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -208,8 +203,7 @@ func TestIssueImportService_CheckStatus(t *testing.T) { } func TestIssueImportService_CheckStatus_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.IssueImport.CheckStatus(ctx, "%", "r", 1) @@ -217,8 +211,7 @@ func TestIssueImportService_CheckStatus_invalidOwner(t *testing.T) { } func TestIssueImportService_CheckStatusSince(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/import/issues", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -254,8 +247,7 @@ func TestIssueImportService_CheckStatusSince(t *testing.T) { } func TestIssueImportService_CheckStatusSince_badResponse(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/import/issues", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -271,8 +263,7 @@ func TestIssueImportService_CheckStatusSince_badResponse(t *testing.T) { } func TestIssueImportService_CheckStatusSince_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.IssueImport.CheckStatusSince(ctx, "%", "r", Timestamp{time.Now()}) diff --git a/github/issues_assignees_test.go b/github/issues_assignees_test.go index 5273136143e..3da9d5ff1bd 100644 --- a/github/issues_assignees_test.go +++ b/github/issues_assignees_test.go @@ -16,8 +16,7 @@ import ( ) func TestIssuesService_ListAssignees(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/assignees", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -53,8 +52,7 @@ func TestIssuesService_ListAssignees(t *testing.T) { } func TestIssuesService_ListAssignees_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Issues.ListAssignees(ctx, "%", "r", nil) @@ -62,8 +60,7 @@ func TestIssuesService_ListAssignees_invalidOwner(t *testing.T) { } func TestIssuesService_IsAssignee_true(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/assignees/u", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -94,8 +91,7 @@ func TestIssuesService_IsAssignee_true(t *testing.T) { } func TestIssuesService_IsAssignee_false(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/assignees/u", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -127,8 +123,7 @@ func TestIssuesService_IsAssignee_false(t *testing.T) { } func TestIssuesService_IsAssignee_error(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/assignees/u", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -160,8 +155,7 @@ func TestIssuesService_IsAssignee_error(t *testing.T) { } func TestIssuesService_IsAssignee_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Issues.IsAssignee(ctx, "%", "r", "u") @@ -169,8 +163,7 @@ func TestIssuesService_IsAssignee_invalidOwner(t *testing.T) { } func TestIssuesService_AddAssignees(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/1/assignees", func(w http.ResponseWriter, r *http.Request) { var assignees struct { @@ -213,8 +206,7 @@ func TestIssuesService_AddAssignees(t *testing.T) { } func TestIssuesService_RemoveAssignees(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/1/assignees", func(w http.ResponseWriter, r *http.Request) { var assignees struct { diff --git a/github/issues_comments_test.go b/github/issues_comments_test.go index 70f923481b5..81c575c4db9 100644 --- a/github/issues_comments_test.go +++ b/github/issues_comments_test.go @@ -17,8 +17,7 @@ import ( ) func TestIssuesService_ListComments_allIssues(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/comments", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -66,8 +65,7 @@ func TestIssuesService_ListComments_allIssues(t *testing.T) { } func TestIssuesService_ListComments_specificIssue(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/1/comments", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -102,8 +100,7 @@ func TestIssuesService_ListComments_specificIssue(t *testing.T) { } func TestIssuesService_ListComments_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Issues.ListComments(ctx, "%", "r", 1, nil) @@ -111,8 +108,7 @@ func TestIssuesService_ListComments_invalidOwner(t *testing.T) { } func TestIssuesService_GetComment(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/comments/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -147,8 +143,7 @@ func TestIssuesService_GetComment(t *testing.T) { } func TestIssuesService_GetComment_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Issues.GetComment(ctx, "%", "r", 1) @@ -156,8 +151,7 @@ func TestIssuesService_GetComment_invalidOrg(t *testing.T) { } func TestIssuesService_CreateComment(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &IssueComment{Body: String("b")} @@ -200,8 +194,7 @@ func TestIssuesService_CreateComment(t *testing.T) { } func TestIssuesService_CreateComment_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Issues.CreateComment(ctx, "%", "r", 1, nil) @@ -209,8 +202,7 @@ func TestIssuesService_CreateComment_invalidOrg(t *testing.T) { } func TestIssuesService_EditComment(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &IssueComment{Body: String("b")} @@ -253,8 +245,7 @@ func TestIssuesService_EditComment(t *testing.T) { } func TestIssuesService_EditComment_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Issues.EditComment(ctx, "%", "r", 1, nil) @@ -262,8 +253,7 @@ func TestIssuesService_EditComment_invalidOwner(t *testing.T) { } func TestIssuesService_DeleteComment(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/comments/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -287,8 +277,7 @@ func TestIssuesService_DeleteComment(t *testing.T) { } func TestIssuesService_DeleteComment_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Issues.DeleteComment(ctx, "%", "r", 1) diff --git a/github/issues_events_test.go b/github/issues_events_test.go index e8118b6ddcd..e67de51c176 100644 --- a/github/issues_events_test.go +++ b/github/issues_events_test.go @@ -15,8 +15,7 @@ import ( ) func TestIssuesService_ListIssueEvents(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/1/events", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -56,8 +55,7 @@ func TestIssuesService_ListIssueEvents(t *testing.T) { } func TestIssuesService_ListRepositoryEvents(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/events", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -96,8 +94,7 @@ func TestIssuesService_ListRepositoryEvents(t *testing.T) { } func TestIssuesService_GetEvent(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/events/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") diff --git a/github/issues_labels_test.go b/github/issues_labels_test.go index 88b7be7168e..48f3e519b50 100644 --- a/github/issues_labels_test.go +++ b/github/issues_labels_test.go @@ -16,8 +16,7 @@ import ( ) func TestIssuesService_ListLabels(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/labels", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -53,8 +52,7 @@ func TestIssuesService_ListLabels(t *testing.T) { } func TestIssuesService_ListLabels_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Issues.ListLabels(ctx, "%", "%", nil) @@ -62,8 +60,7 @@ func TestIssuesService_ListLabels_invalidOwner(t *testing.T) { } func TestIssuesService_GetLabel(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/labels/n", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -97,8 +94,7 @@ func TestIssuesService_GetLabel(t *testing.T) { } func TestIssuesService_GetLabel_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Issues.GetLabel(ctx, "%", "%", "%") @@ -106,8 +102,7 @@ func TestIssuesService_GetLabel_invalidOwner(t *testing.T) { } func TestIssuesService_CreateLabel(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &Label{Name: String("n")} @@ -150,8 +145,7 @@ func TestIssuesService_CreateLabel(t *testing.T) { } func TestIssuesService_CreateLabel_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Issues.CreateLabel(ctx, "%", "%", nil) @@ -159,8 +153,7 @@ func TestIssuesService_CreateLabel_invalidOwner(t *testing.T) { } func TestIssuesService_EditLabel(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &Label{Name: String("z")} @@ -203,8 +196,7 @@ func TestIssuesService_EditLabel(t *testing.T) { } func TestIssuesService_EditLabel_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Issues.EditLabel(ctx, "%", "%", "%", nil) @@ -212,8 +204,7 @@ func TestIssuesService_EditLabel_invalidOwner(t *testing.T) { } func TestIssuesService_DeleteLabel(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/labels/n", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -237,8 +228,7 @@ func TestIssuesService_DeleteLabel(t *testing.T) { } func TestIssuesService_DeleteLabel_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Issues.DeleteLabel(ctx, "%", "%", "%") @@ -246,8 +236,7 @@ func TestIssuesService_DeleteLabel_invalidOwner(t *testing.T) { } func TestIssuesService_ListLabelsByIssue(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/1/labels", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -286,8 +275,7 @@ func TestIssuesService_ListLabelsByIssue(t *testing.T) { } func TestIssuesService_ListLabelsByIssue_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Issues.ListLabelsByIssue(ctx, "%", "%", 1, nil) @@ -295,8 +283,7 @@ func TestIssuesService_ListLabelsByIssue_invalidOwner(t *testing.T) { } func TestIssuesService_AddLabelsToIssue(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := []string{"a", "b"} @@ -339,8 +326,7 @@ func TestIssuesService_AddLabelsToIssue(t *testing.T) { } func TestIssuesService_AddLabelsToIssue_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Issues.AddLabelsToIssue(ctx, "%", "%", 1, nil) @@ -348,8 +334,7 @@ func TestIssuesService_AddLabelsToIssue_invalidOwner(t *testing.T) { } func TestIssuesService_RemoveLabelForIssue(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/1/labels/l", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -373,8 +358,7 @@ func TestIssuesService_RemoveLabelForIssue(t *testing.T) { } func TestIssuesService_RemoveLabelForIssue_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Issues.RemoveLabelForIssue(ctx, "%", "%", 1, "%") @@ -382,8 +366,7 @@ func TestIssuesService_RemoveLabelForIssue_invalidOwner(t *testing.T) { } func TestIssuesService_ReplaceLabelsForIssue(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := []string{"a", "b"} @@ -426,8 +409,7 @@ func TestIssuesService_ReplaceLabelsForIssue(t *testing.T) { } func TestIssuesService_ReplaceLabelsForIssue_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Issues.ReplaceLabelsForIssue(ctx, "%", "%", 1, nil) @@ -435,8 +417,7 @@ func TestIssuesService_ReplaceLabelsForIssue_invalidOwner(t *testing.T) { } func TestIssuesService_RemoveLabelsForIssue(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/1/labels", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -460,8 +441,7 @@ func TestIssuesService_RemoveLabelsForIssue(t *testing.T) { } func TestIssuesService_RemoveLabelsForIssue_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Issues.RemoveLabelsForIssue(ctx, "%", "%", 1) @@ -469,8 +449,7 @@ func TestIssuesService_RemoveLabelsForIssue_invalidOwner(t *testing.T) { } func TestIssuesService_ListLabelsForMilestone(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/milestones/1/labels", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -506,8 +485,7 @@ func TestIssuesService_ListLabelsForMilestone(t *testing.T) { } func TestIssuesService_ListLabelsForMilestone_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Issues.ListLabelsForMilestone(ctx, "%", "%", 1, nil) diff --git a/github/issues_milestones_test.go b/github/issues_milestones_test.go index decaf2c1127..ca4ea9f8c76 100644 --- a/github/issues_milestones_test.go +++ b/github/issues_milestones_test.go @@ -16,8 +16,7 @@ import ( ) func TestIssuesService_ListMilestones(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/milestones", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -58,8 +57,7 @@ func TestIssuesService_ListMilestones(t *testing.T) { } func TestIssuesService_ListMilestones_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Issues.ListMilestones(ctx, "%", "r", nil) @@ -67,8 +65,7 @@ func TestIssuesService_ListMilestones_invalidOwner(t *testing.T) { } func TestIssuesService_GetMilestone(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/milestones/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -102,8 +99,7 @@ func TestIssuesService_GetMilestone(t *testing.T) { } func TestIssuesService_GetMilestone_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Issues.GetMilestone(ctx, "%", "r", 1) @@ -111,8 +107,7 @@ func TestIssuesService_GetMilestone_invalidOwner(t *testing.T) { } func TestIssuesService_CreateMilestone(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &Milestone{Title: String("t")} @@ -155,8 +150,7 @@ func TestIssuesService_CreateMilestone(t *testing.T) { } func TestIssuesService_CreateMilestone_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Issues.CreateMilestone(ctx, "%", "r", nil) @@ -164,8 +158,7 @@ func TestIssuesService_CreateMilestone_invalidOwner(t *testing.T) { } func TestIssuesService_EditMilestone(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &Milestone{Title: String("t")} @@ -208,8 +201,7 @@ func TestIssuesService_EditMilestone(t *testing.T) { } func TestIssuesService_EditMilestone_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Issues.EditMilestone(ctx, "%", "r", 1, nil) @@ -217,8 +209,7 @@ func TestIssuesService_EditMilestone_invalidOwner(t *testing.T) { } func TestIssuesService_DeleteMilestone(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/milestones/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -242,8 +233,7 @@ func TestIssuesService_DeleteMilestone(t *testing.T) { } func TestIssuesService_DeleteMilestone_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Issues.DeleteMilestone(ctx, "%", "r", 1) diff --git a/github/issues_test.go b/github/issues_test.go index d64ef88d72f..722d4e31a08 100644 --- a/github/issues_test.go +++ b/github/issues_test.go @@ -17,8 +17,7 @@ import ( ) func TestIssuesService_List_all(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/issues", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -63,8 +62,7 @@ func TestIssuesService_List_all(t *testing.T) { } func TestIssuesService_List_owned(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/issues", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -85,8 +83,7 @@ func TestIssuesService_List_owned(t *testing.T) { } func TestIssuesService_ListByOrg(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/issues", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -121,8 +118,7 @@ func TestIssuesService_ListByOrg(t *testing.T) { } func TestIssuesService_ListByOrg_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Issues.ListByOrg(ctx, "%", nil) @@ -130,8 +126,7 @@ func TestIssuesService_ListByOrg_invalidOrg(t *testing.T) { } func TestIssuesService_ListByOrg_badOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Issues.ListByOrg(ctx, "\n", nil) @@ -139,8 +134,7 @@ func TestIssuesService_ListByOrg_badOrg(t *testing.T) { } func TestIssuesService_ListByRepo(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -191,8 +185,7 @@ func TestIssuesService_ListByRepo(t *testing.T) { } func TestIssuesService_ListByRepo_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Issues.ListByRepo(ctx, "%", "r", nil) @@ -200,8 +193,7 @@ func TestIssuesService_ListByRepo_invalidOwner(t *testing.T) { } func TestIssuesService_Get(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -244,8 +236,7 @@ func TestIssuesService_Get(t *testing.T) { } func TestIssuesService_Get_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Issues.Get(ctx, "%", "r", 1) @@ -253,8 +244,7 @@ func TestIssuesService_Get_invalidOwner(t *testing.T) { } func TestIssuesService_Create(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &IssueRequest{ Title: String("t"), @@ -302,8 +292,7 @@ func TestIssuesService_Create(t *testing.T) { } func TestIssuesService_Create_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Issues.Create(ctx, "%", "r", nil) @@ -311,8 +300,7 @@ func TestIssuesService_Create_invalidOwner(t *testing.T) { } func TestIssuesService_Edit(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &IssueRequest{Title: String("t")} @@ -355,8 +343,8 @@ func TestIssuesService_Edit(t *testing.T) { } func TestIssuesService_RemoveMilestone(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + mux.HandleFunc("/repos/o/r/issues/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") fmt.Fprint(w, `{"number":1}`) @@ -389,8 +377,7 @@ func TestIssuesService_RemoveMilestone(t *testing.T) { } func TestIssuesService_Edit_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Issues.Edit(ctx, "%", "r", 1, nil) @@ -398,8 +385,7 @@ func TestIssuesService_Edit_invalidOwner(t *testing.T) { } func TestIssuesService_Lock(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/1/lock", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -424,8 +410,7 @@ func TestIssuesService_Lock(t *testing.T) { } func TestIssuesService_LockWithReason(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/1/lock", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -441,8 +426,7 @@ func TestIssuesService_LockWithReason(t *testing.T) { } func TestIssuesService_Unlock(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/1/lock", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") diff --git a/github/issues_timeline_test.go b/github/issues_timeline_test.go index 27c7c115e7b..5a2b78622c5 100644 --- a/github/issues_timeline_test.go +++ b/github/issues_timeline_test.go @@ -16,8 +16,7 @@ import ( ) func TestIssuesService_ListIssueTimeline(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) wantAcceptHeaders := []string{mediaTypeTimelinePreview, mediaTypeProjectCardDetailsPreview} mux.HandleFunc("/repos/o/r/issues/1/timeline", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/licenses_test.go b/github/licenses_test.go index aaaac15cbac..30b03669789 100644 --- a/github/licenses_test.go +++ b/github/licenses_test.go @@ -109,8 +109,7 @@ func TestLicense_Marshal(t *testing.T) { } func TestLicensesService_List(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/licenses", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -145,8 +144,7 @@ func TestLicensesService_List(t *testing.T) { } func TestLicensesService_Get(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/licenses/mit", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -180,8 +178,7 @@ func TestLicensesService_Get(t *testing.T) { } func TestLicensesService_Get_invalidTemplate(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Licenses.Get(ctx, "%") diff --git a/github/markdown_test.go b/github/markdown_test.go index 2b6e7eee48e..709a5b61657 100644 --- a/github/markdown_test.go +++ b/github/markdown_test.go @@ -16,8 +16,7 @@ import ( ) func TestMarkdownService_Markdown(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &markdownRenderRequest{ Text: String("# text #"), diff --git a/github/meta_test.go b/github/meta_test.go index 836d9931148..c529634f5aa 100644 --- a/github/meta_test.go +++ b/github/meta_test.go @@ -69,8 +69,7 @@ func TestAPIMeta_Marshal(t *testing.T) { } func TestMetaService_Get(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/meta", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -129,8 +128,7 @@ func TestMetaService_Get(t *testing.T) { } func TestMetaService_Octocat(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := "input" output := "sample text" @@ -163,8 +161,7 @@ func TestMetaService_Octocat(t *testing.T) { } func TestMetaService_Zen(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) output := "sample text" diff --git a/github/migrations_source_import_test.go b/github/migrations_source_import_test.go index d357ff10b8a..f7225c851be 100644 --- a/github/migrations_source_import_test.go +++ b/github/migrations_source_import_test.go @@ -16,8 +16,7 @@ import ( ) func TestMigrationService_StartImport(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &Import{ VCS: String("git"), @@ -65,8 +64,7 @@ func TestMigrationService_StartImport(t *testing.T) { } func TestMigrationService_ImportProgress(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/import", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -99,8 +97,7 @@ func TestMigrationService_ImportProgress(t *testing.T) { } func TestMigrationService_UpdateImport(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &Import{ VCS: String("git"), @@ -148,8 +145,7 @@ func TestMigrationService_UpdateImport(t *testing.T) { } func TestMigrationService_CommitAuthors(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/import/authors", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -185,8 +181,7 @@ func TestMigrationService_CommitAuthors(t *testing.T) { } func TestMigrationService_MapCommitAuthor(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &SourceImportAuthor{Name: String("n"), Email: String("e")} @@ -228,8 +223,7 @@ func TestMigrationService_MapCommitAuthor(t *testing.T) { } func TestMigrationService_SetLFSPreference(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &Import{UseLFS: String("opt_in")} @@ -272,8 +266,7 @@ func TestMigrationService_SetLFSPreference(t *testing.T) { } func TestMigrationService_LargeFiles(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/import/large_files", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -309,8 +302,7 @@ func TestMigrationService_LargeFiles(t *testing.T) { } func TestMigrationService_CancelImport(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/import", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") diff --git a/github/migrations_test.go b/github/migrations_test.go index 7ddc6300a8a..254532eeafa 100644 --- a/github/migrations_test.go +++ b/github/migrations_test.go @@ -16,8 +16,7 @@ import ( ) func TestMigrationService_StartMigration(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/migrations", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -56,8 +55,7 @@ func TestMigrationService_StartMigration(t *testing.T) { } func TestMigrationService_ListMigrations(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/migrations", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -92,8 +90,7 @@ func TestMigrationService_ListMigrations(t *testing.T) { } func TestMigrationService_MigrationStatus(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/migrations/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -128,8 +125,7 @@ func TestMigrationService_MigrationStatus(t *testing.T) { } func TestMigrationService_MigrationArchiveURL(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/migrations/1/archive", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -161,8 +157,7 @@ func TestMigrationService_MigrationArchiveURL(t *testing.T) { } func TestMigrationService_DeleteMigration(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/migrations/1/archive", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -188,8 +183,7 @@ func TestMigrationService_DeleteMigration(t *testing.T) { } func TestMigrationService_UnlockRepo(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/migrations/1/repos/r/lock", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") diff --git a/github/migrations_user_test.go b/github/migrations_user_test.go index 0a303ce6348..6de854f491e 100644 --- a/github/migrations_user_test.go +++ b/github/migrations_user_test.go @@ -16,8 +16,7 @@ import ( ) func TestMigrationService_StartUserMigration(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/migrations", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -54,8 +53,7 @@ func TestMigrationService_StartUserMigration(t *testing.T) { } func TestMigrationService_ListUserMigrations(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/migrations", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -87,8 +85,7 @@ func TestMigrationService_ListUserMigrations(t *testing.T) { } func TestMigrationService_UserMigrationStatus(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/migrations/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -120,8 +117,7 @@ func TestMigrationService_UserMigrationStatus(t *testing.T) { } func TestMigrationService_UserMigrationArchiveURL(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/migrations/1/archive", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -149,8 +145,7 @@ func TestMigrationService_UserMigrationArchiveURL(t *testing.T) { } func TestMigrationService_DeleteUserMigration(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/migrations/1/archive", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -181,8 +176,7 @@ func TestMigrationService_DeleteUserMigration(t *testing.T) { } func TestMigrationService_UnlockUserRepo(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/migrations/1/repos/r/lock", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") diff --git a/github/orgs_actions_allowed_test.go b/github/orgs_actions_allowed_test.go index de4c6d5a0bc..49329eb71a5 100644 --- a/github/orgs_actions_allowed_test.go +++ b/github/orgs_actions_allowed_test.go @@ -16,8 +16,7 @@ import ( ) func TestOrganizationsService_GetActionsAllowed(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/permissions/selected-actions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -50,8 +49,8 @@ func TestOrganizationsService_GetActionsAllowed(t *testing.T) { } func TestOrganizationsService_EditActionsAllowed(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + input := &ActionsAllowed{GithubOwnedAllowed: Bool(true), VerifiedAllowed: Bool(false), PatternsAllowed: []string{"a/b"}} mux.HandleFunc("/orgs/o/actions/permissions/selected-actions", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/orgs_actions_permissions_test.go b/github/orgs_actions_permissions_test.go index d35965eccb1..07df41a2e4b 100644 --- a/github/orgs_actions_permissions_test.go +++ b/github/orgs_actions_permissions_test.go @@ -16,8 +16,7 @@ import ( ) func TestOrganizationsService_GetActionsPermissions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/permissions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -50,8 +49,7 @@ func TestOrganizationsService_GetActionsPermissions(t *testing.T) { } func TestOrganizationsService_EditActionsPermissions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &ActionsPermissions{EnabledRepositories: String("all"), AllowedActions: String("selected")} diff --git a/github/orgs_audit_log_test.go b/github/orgs_audit_log_test.go index feebd0affc7..14b42fdfd3e 100644 --- a/github/orgs_audit_log_test.go +++ b/github/orgs_audit_log_test.go @@ -15,8 +15,7 @@ import ( ) func TestOrganizationService_GetAuditLog(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/audit-log", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") diff --git a/github/orgs_credential_authorizations_test.go b/github/orgs_credential_authorizations_test.go index 006ee86c45c..2750a47aca2 100644 --- a/github/orgs_credential_authorizations_test.go +++ b/github/orgs_credential_authorizations_test.go @@ -16,8 +16,7 @@ import ( ) func TestOrganizationsService_ListCredentialAuthorizations(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/credential-authorizations", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, http.MethodGet) @@ -73,8 +72,7 @@ func TestOrganizationsService_ListCredentialAuthorizations(t *testing.T) { } func TestOrganizationsService_RemoveCredentialAuthorization(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/credential-authorizations/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, http.MethodDelete) diff --git a/github/orgs_custom_repository_roles_test.go b/github/orgs_custom_repository_roles_test.go index 58a7c97c99a..eb2a3ae154f 100644 --- a/github/orgs_custom_repository_roles_test.go +++ b/github/orgs_custom_repository_roles_test.go @@ -16,8 +16,7 @@ import ( ) func TestOrganizationsService_ListCustomRepoRoles(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/custom-repository-roles", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -97,8 +96,7 @@ func TestOrganizationsService_ListCustomRepoRoles(t *testing.T) { } func TestOrganizationsService_CreateCustomRepoRole(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/custom-repository-roles", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -140,8 +138,7 @@ func TestOrganizationsService_CreateCustomRepoRole(t *testing.T) { } func TestOrganizationsService_UpdateCustomRepoRole(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/custom-repository-roles/8030", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") @@ -181,8 +178,7 @@ func TestOrganizationsService_UpdateCustomRepoRole(t *testing.T) { } func TestOrganizationsService_DeleteCustomRepoRole(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/custom-repository-roles/8030", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") diff --git a/github/orgs_hooks_configuration_test.go b/github/orgs_hooks_configuration_test.go index 337c721f59e..47d6ea30ad4 100644 --- a/github/orgs_hooks_configuration_test.go +++ b/github/orgs_hooks_configuration_test.go @@ -16,8 +16,7 @@ import ( ) func TestOrganizationsService_GetHookConfiguration(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/hooks/1/config", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -56,8 +55,7 @@ func TestOrganizationsService_GetHookConfiguration(t *testing.T) { } func TestOrganizationsService_GetHookConfiguration_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Organizations.GetHookConfiguration(ctx, "%", 1) @@ -65,8 +63,7 @@ func TestOrganizationsService_GetHookConfiguration_invalidOrg(t *testing.T) { } func TestOrganizationsService_EditHookConfiguration(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &HookConfig{} @@ -114,8 +111,7 @@ func TestOrganizationsService_EditHookConfiguration(t *testing.T) { } func TestOrganizationsService_EditHookConfiguration_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Organizations.EditHookConfiguration(ctx, "%", 1, nil) diff --git a/github/orgs_hooks_deliveries_test.go b/github/orgs_hooks_deliveries_test.go index cd0bd109a91..7a1cc8b3fac 100644 --- a/github/orgs_hooks_deliveries_test.go +++ b/github/orgs_hooks_deliveries_test.go @@ -15,8 +15,7 @@ import ( ) func TestOrganizationsService_ListHookDeliveries(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/hooks/1/deliveries", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -53,8 +52,7 @@ func TestOrganizationsService_ListHookDeliveries(t *testing.T) { } func TestOrganizationsService_ListHookDeliveries_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Organizations.ListHookDeliveries(ctx, "%", 1, nil) @@ -62,8 +60,7 @@ func TestOrganizationsService_ListHookDeliveries_invalidOwner(t *testing.T) { } func TestOrganizationsService_GetHookDelivery(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/hooks/1/deliveries/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -97,8 +94,7 @@ func TestOrganizationsService_GetHookDelivery(t *testing.T) { } func TestOrganizationsService_GetHookDelivery_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Organizations.GetHookDelivery(ctx, "%", 1, 1) @@ -106,8 +102,7 @@ func TestOrganizationsService_GetHookDelivery_invalidOwner(t *testing.T) { } func TestOrganizationsService_RedeliverHookDelivery(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/hooks/1/deliveries/1/attempts", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -141,8 +136,7 @@ func TestOrganizationsService_RedeliverHookDelivery(t *testing.T) { } func TestOrganizationsService_RedeliverHookDelivery_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Organizations.RedeliverHookDelivery(ctx, "%", 1, 1) diff --git a/github/orgs_hooks_test.go b/github/orgs_hooks_test.go index 843f60e1e32..3f494bf836a 100644 --- a/github/orgs_hooks_test.go +++ b/github/orgs_hooks_test.go @@ -16,8 +16,7 @@ import ( ) func TestOrganizationsService_ListHooks(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/hooks", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -54,8 +53,7 @@ func TestOrganizationsService_ListHooks(t *testing.T) { } func TestOrganizationsService_ListHooks_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Organizations.ListHooks(ctx, "%", nil) @@ -63,8 +61,7 @@ func TestOrganizationsService_ListHooks_invalidOrg(t *testing.T) { } func TestOrganizationsService_CreateHook(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &Hook{CreatedAt: &Timestamp{referenceTime}} @@ -108,8 +105,7 @@ func TestOrganizationsService_CreateHook(t *testing.T) { } func TestOrganizationsService_GetHook(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/hooks/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -143,8 +139,7 @@ func TestOrganizationsService_GetHook(t *testing.T) { } func TestOrganizationsService_GetHook_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Organizations.GetHook(ctx, "%", 1) @@ -152,8 +147,7 @@ func TestOrganizationsService_GetHook_invalidOrg(t *testing.T) { } func TestOrganizationsService_EditHook(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &Hook{} @@ -196,8 +190,7 @@ func TestOrganizationsService_EditHook(t *testing.T) { } func TestOrganizationsService_EditHook_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Organizations.EditHook(ctx, "%", 1, nil) @@ -205,8 +198,7 @@ func TestOrganizationsService_EditHook_invalidOrg(t *testing.T) { } func TestOrganizationsService_PingHook(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/hooks/1/pings", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -230,8 +222,7 @@ func TestOrganizationsService_PingHook(t *testing.T) { } func TestOrganizationsService_DeleteHook(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/hooks/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -255,8 +246,7 @@ func TestOrganizationsService_DeleteHook(t *testing.T) { } func TestOrganizationsService_DeleteHook_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Organizations.DeleteHook(ctx, "%", 1) diff --git a/github/orgs_members_test.go b/github/orgs_members_test.go index 3717802a584..eeb494e611f 100644 --- a/github/orgs_members_test.go +++ b/github/orgs_members_test.go @@ -17,8 +17,7 @@ import ( ) func TestOrganizationsService_ListMembers(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/members", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -63,8 +62,7 @@ func TestOrganizationsService_ListMembers(t *testing.T) { } func TestOrganizationsService_ListMembers_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Organizations.ListMembers(ctx, "%", nil) @@ -72,8 +70,7 @@ func TestOrganizationsService_ListMembers_invalidOrg(t *testing.T) { } func TestOrganizationsService_ListMembers_public(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/public_members", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -94,8 +91,7 @@ func TestOrganizationsService_ListMembers_public(t *testing.T) { } func TestOrganizationsService_IsMember(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/members/u", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -128,8 +124,7 @@ func TestOrganizationsService_IsMember(t *testing.T) { // ensure that a 404 response is interpreted as "false" and not an error func TestOrganizationsService_IsMember_notMember(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/members/u", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -149,8 +144,7 @@ func TestOrganizationsService_IsMember_notMember(t *testing.T) { // ensure that a 400 response is interpreted as an actual error, and not simply // as "false" like the above case of a 404 func TestOrganizationsService_IsMember_error(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/members/u", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -168,8 +162,7 @@ func TestOrganizationsService_IsMember_error(t *testing.T) { } func TestOrganizationsService_IsMember_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Organizations.IsMember(ctx, "%", "u") @@ -177,8 +170,7 @@ func TestOrganizationsService_IsMember_invalidOrg(t *testing.T) { } func TestOrganizationsService_IsPublicMember(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/public_members/u", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -211,8 +203,7 @@ func TestOrganizationsService_IsPublicMember(t *testing.T) { // ensure that a 404 response is interpreted as "false" and not an error func TestOrganizationsService_IsPublicMember_notMember(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/public_members/u", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -232,8 +223,7 @@ func TestOrganizationsService_IsPublicMember_notMember(t *testing.T) { // ensure that a 400 response is interpreted as an actual error, and not simply // as "false" like the above case of a 404 func TestOrganizationsService_IsPublicMember_error(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/public_members/u", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -251,8 +241,7 @@ func TestOrganizationsService_IsPublicMember_error(t *testing.T) { } func TestOrganizationsService_IsPublicMember_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Organizations.IsPublicMember(ctx, "%", "u") @@ -260,8 +249,7 @@ func TestOrganizationsService_IsPublicMember_invalidOrg(t *testing.T) { } func TestOrganizationsService_RemoveMember(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/members/u", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -285,8 +273,7 @@ func TestOrganizationsService_RemoveMember(t *testing.T) { } func TestOrganizationsService_CancelInvite(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/invitations/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -311,8 +298,7 @@ func TestOrganizationsService_CancelInvite(t *testing.T) { } func TestOrganizationsService_RemoveMember_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Organizations.RemoveMember(ctx, "%", "u") @@ -320,8 +306,7 @@ func TestOrganizationsService_RemoveMember_invalidOrg(t *testing.T) { } func TestOrganizationsService_PublicizeMembership(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/public_members/u", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -345,8 +330,7 @@ func TestOrganizationsService_PublicizeMembership(t *testing.T) { } func TestOrganizationsService_ConcealMembership(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/public_members/u", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -370,8 +354,7 @@ func TestOrganizationsService_ConcealMembership(t *testing.T) { } func TestOrganizationsService_ListOrgMemberships(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/memberships/orgs", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -408,8 +391,7 @@ func TestOrganizationsService_ListOrgMemberships(t *testing.T) { } func TestOrganizationsService_GetOrgMembership_AuthenticatedUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/memberships/orgs/o", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -443,8 +425,7 @@ func TestOrganizationsService_GetOrgMembership_AuthenticatedUser(t *testing.T) { } func TestOrganizationsService_GetOrgMembership_SpecifiedUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/memberships/u", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -464,8 +445,7 @@ func TestOrganizationsService_GetOrgMembership_SpecifiedUser(t *testing.T) { } func TestOrganizationsService_EditOrgMembership_AuthenticatedUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &Membership{State: String("active")} @@ -508,8 +488,7 @@ func TestOrganizationsService_EditOrgMembership_AuthenticatedUser(t *testing.T) } func TestOrganizationsService_EditOrgMembership_SpecifiedUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &Membership{State: String("active")} @@ -538,8 +517,7 @@ func TestOrganizationsService_EditOrgMembership_SpecifiedUser(t *testing.T) { } func TestOrganizationsService_RemoveOrgMembership(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/memberships/u", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -564,8 +542,7 @@ func TestOrganizationsService_RemoveOrgMembership(t *testing.T) { } func TestOrganizationsService_ListPendingOrgInvitations(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/invitations", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -660,8 +637,8 @@ func TestOrganizationsService_ListPendingOrgInvitations(t *testing.T) { } func TestOrganizationsService_CreateOrgInvitation(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + input := &CreateOrgInvitationOptions{ Email: String("octocat@github.com"), Role: String("direct_member"), @@ -710,8 +687,7 @@ func TestOrganizationsService_CreateOrgInvitation(t *testing.T) { } func TestOrganizationsService_ListOrgInvitationTeams(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/invitations/22/teams", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -772,8 +748,7 @@ func TestOrganizationsService_ListOrgInvitationTeams(t *testing.T) { } func TestOrganizationsService_ListFailedOrgInvitations(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/failed_invitations", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") diff --git a/github/orgs_organization_roles_test.go b/github/orgs_organization_roles_test.go index 3e2998fd4f3..0afef53e452 100644 --- a/github/orgs_organization_roles_test.go +++ b/github/orgs_organization_roles_test.go @@ -16,8 +16,7 @@ import ( ) func TestOrganizationsService_ListRoles(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/organization-roles", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -99,8 +98,7 @@ func TestOrganizationsService_ListRoles(t *testing.T) { } func TestOrganizationsService_GetOrgRole(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) // Test built-in org role mux.HandleFunc("/orgs/o/organization-roles/8132", func(w http.ResponseWriter, r *http.Request) { @@ -198,8 +196,7 @@ func TestOrganizationsService_GetOrgRole(t *testing.T) { } func TestOrganizationsService_CreateCustomOrgRole(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/organization-roles", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -240,8 +237,7 @@ func TestOrganizationsService_CreateCustomOrgRole(t *testing.T) { } func TestOrganizationsService_UpdateCustomOrgRole(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/organization-roles/8030", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") @@ -281,8 +277,7 @@ func TestOrganizationsService_UpdateCustomOrgRole(t *testing.T) { } func TestOrganizationsService_DeleteCustomOrgRole(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/organization-roles/8030", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -312,8 +307,7 @@ func TestOrganizationsService_DeleteCustomOrgRole(t *testing.T) { } func TestOrganizationsService_AssignOrgRoleToTeam(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/organization-roles/teams/t/8030", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -341,8 +335,7 @@ func TestOrganizationsService_AssignOrgRoleToTeam(t *testing.T) { } func TestOrganizationsService_RemoveOrgRoleFromTeam(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/organization-roles/teams/t/8030", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -370,8 +363,7 @@ func TestOrganizationsService_RemoveOrgRoleFromTeam(t *testing.T) { } func TestOrganizationsService_AssignOrgRoleToUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/organization-roles/users/t/8030", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -399,8 +391,7 @@ func TestOrganizationsService_AssignOrgRoleToUser(t *testing.T) { } func TestOrganizationsService_RemoveOrgRoleFromUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/organization-roles/users/t/8030", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -428,8 +419,7 @@ func TestOrganizationsService_RemoveOrgRoleFromUser(t *testing.T) { } func TestOrganizationsService_ListTeamsAssignedToOrgRole(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/organization-roles/1729/teams", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -463,8 +453,7 @@ func TestOrganizationsService_ListTeamsAssignedToOrgRole(t *testing.T) { } func TestOrganizationsService_ListUsersAssignedToOrgRole(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/organization-roles/1729/users", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") diff --git a/github/orgs_outside_collaborators_test.go b/github/orgs_outside_collaborators_test.go index ffcedfa3ca1..75212aa5787 100644 --- a/github/orgs_outside_collaborators_test.go +++ b/github/orgs_outside_collaborators_test.go @@ -15,8 +15,7 @@ import ( ) func TestOrganizationsService_ListOutsideCollaborators(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/outside_collaborators", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -58,8 +57,7 @@ func TestOrganizationsService_ListOutsideCollaborators(t *testing.T) { } func TestOrganizationsService_ListOutsideCollaborators_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Organizations.ListOutsideCollaborators(ctx, "%", nil) @@ -67,8 +65,7 @@ func TestOrganizationsService_ListOutsideCollaborators_invalidOrg(t *testing.T) } func TestOrganizationsService_RemoveOutsideCollaborator(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) handler := func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -93,8 +90,7 @@ func TestOrganizationsService_RemoveOutsideCollaborator(t *testing.T) { } func TestOrganizationsService_RemoveOutsideCollaborator_NonMember(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) handler := func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -112,8 +108,7 @@ func TestOrganizationsService_RemoveOutsideCollaborator_NonMember(t *testing.T) } func TestOrganizationsService_RemoveOutsideCollaborator_Member(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) handler := func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -131,8 +126,7 @@ func TestOrganizationsService_RemoveOutsideCollaborator_Member(t *testing.T) { } func TestOrganizationsService_ConvertMemberToOutsideCollaborator(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) handler := func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -157,8 +151,7 @@ func TestOrganizationsService_ConvertMemberToOutsideCollaborator(t *testing.T) { } func TestOrganizationsService_ConvertMemberToOutsideCollaborator_NonMemberOrLastOwner(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) handler := func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") diff --git a/github/orgs_packages_test.go b/github/orgs_packages_test.go index 097cae76282..e02000afedf 100644 --- a/github/orgs_packages_test.go +++ b/github/orgs_packages_test.go @@ -15,8 +15,7 @@ import ( ) func TestOrganizationsService_ListPackages(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/packages", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -114,8 +113,7 @@ func TestOrganizationsService_ListPackages(t *testing.T) { } func TestOrganizationsService_GetPackage(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) // don't url escape the package name here since mux will convert it to a slash automatically mux.HandleFunc("/orgs/o/packages/container/hello/hello_docker", func(w http.ResponseWriter, r *http.Request) { @@ -173,8 +171,7 @@ func TestOrganizationsService_GetPackage(t *testing.T) { } func TestOrganizationsService_DeletePackage(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) // don't url escape the package name here since mux will convert it to a slash automatically mux.HandleFunc("/orgs/o/packages/container/hello/hello_docker", func(w http.ResponseWriter, r *http.Request) { @@ -203,8 +200,7 @@ func TestOrganizationsService_DeletePackage(t *testing.T) { } func TestOrganizationsService_RestorePackage(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) // don't url escape the package name here since mux will convert it to a slash automatically mux.HandleFunc("/orgs/o/packages/container/hello/hello_docker/restore", func(w http.ResponseWriter, r *http.Request) { @@ -229,8 +225,7 @@ func TestOrganizationsService_RestorePackage(t *testing.T) { } func TestOrganizationsService_ListPackagesVersions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) // don't url escape the package name here since mux will convert it to a slash automatically mux.HandleFunc("/orgs/o/packages/container/hello/hello_docker/versions", func(w http.ResponseWriter, r *http.Request) { @@ -303,8 +298,7 @@ func TestOrganizationsService_ListPackagesVersions(t *testing.T) { } func TestOrganizationsService_PackageGetVersion(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) // don't url escape the package name here since mux will convert it to a slash automatically mux.HandleFunc("/orgs/o/packages/container/hello/hello_docker/versions/45763", func(w http.ResponseWriter, r *http.Request) { @@ -373,8 +367,7 @@ func TestOrganizationsService_PackageGetVersion(t *testing.T) { } func TestOrganizationsService_PackageDeleteVersion(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) // don't url escape the package name here since mux will convert it to a slash automatically mux.HandleFunc("/orgs/o/packages/container/hello/hello_docker/versions/45763", func(w http.ResponseWriter, r *http.Request) { @@ -399,8 +392,7 @@ func TestOrganizationsService_PackageDeleteVersion(t *testing.T) { } func TestOrganizationsService_PackageRestoreVersion(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) // don't url escape the package name here since mux will convert it to a slash automatically mux.HandleFunc("/orgs/o/packages/container/hello/hello_docker/versions/45763/restore", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/orgs_personal_access_tokens_test.go b/github/orgs_personal_access_tokens_test.go index 83f55023f51..680be354980 100644 --- a/github/orgs_personal_access_tokens_test.go +++ b/github/orgs_personal_access_tokens_test.go @@ -17,8 +17,7 @@ import ( ) func TestOrganizationsService_ListFineGrainedPersonalAccessTokens(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/personal-access-tokens", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -156,8 +155,7 @@ func TestOrganizationsService_ListFineGrainedPersonalAccessTokens(t *testing.T) } func TestOrganizationsService_ReviewPersonalAccessTokenRequest(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := ReviewPersonalAccessTokenRequestOptions{ Action: "a", diff --git a/github/orgs_projects_test.go b/github/orgs_projects_test.go index 0853ed9b971..7e8cd361902 100644 --- a/github/orgs_projects_test.go +++ b/github/orgs_projects_test.go @@ -16,8 +16,7 @@ import ( ) func TestOrganizationsService_ListProjects(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/projects", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -54,8 +53,7 @@ func TestOrganizationsService_ListProjects(t *testing.T) { } func TestOrganizationsService_CreateProject(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &ProjectOptions{Name: String("Project Name"), Body: String("Project body.")} diff --git a/github/orgs_properties_test.go b/github/orgs_properties_test.go index 2ef1f4536b9..efbcb381133 100644 --- a/github/orgs_properties_test.go +++ b/github/orgs_properties_test.go @@ -15,8 +15,7 @@ import ( ) func TestOrganizationsService_GetAllCustomProperties(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/properties/schema", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -87,8 +86,7 @@ func TestOrganizationsService_GetAllCustomProperties(t *testing.T) { } func TestOrganizationsService_CreateOrUpdateCustomProperties(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/properties/schema", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") @@ -150,8 +148,7 @@ func TestOrganizationsService_CreateOrUpdateCustomProperties(t *testing.T) { } func TestOrganizationsService_GetCustomProperty(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/properties/schema/name", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -200,8 +197,7 @@ func TestOrganizationsService_GetCustomProperty(t *testing.T) { } func TestOrganizationsService_CreateOrUpdateCustomProperty(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/properties/schema/name", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -257,8 +253,7 @@ func TestOrganizationsService_CreateOrUpdateCustomProperty(t *testing.T) { } func TestOrganizationsService_RemoveCustomProperty(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/properties/schema/name", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -278,8 +273,7 @@ func TestOrganizationsService_RemoveCustomProperty(t *testing.T) { } func TestOrganizationsService_ListCustomPropertyValues(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/properties/values", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -437,8 +431,7 @@ func TestCustomPropertyValue_UnmarshalJSON(t *testing.T) { } func TestOrganizationsService_CreateOrUpdateRepoCustomPropertyValues(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/properties/values", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") diff --git a/github/orgs_rules_test.go b/github/orgs_rules_test.go index 435e7e5827b..67e86ac1c00 100644 --- a/github/orgs_rules_test.go +++ b/github/orgs_rules_test.go @@ -15,8 +15,7 @@ import ( ) func TestOrganizationsService_GetAllOrganizationRulesets(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/rulesets", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -71,8 +70,7 @@ func TestOrganizationsService_GetAllOrganizationRulesets(t *testing.T) { } func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/rulesets", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -391,8 +389,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) }) } func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/rulesets", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -726,8 +723,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing. }) } func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/rulesets", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -1036,8 +1032,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { } func TestOrganizationsService_GetOrganizationRuleset(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/rulesets/26110", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -1132,8 +1127,7 @@ func TestOrganizationsService_GetOrganizationRuleset(t *testing.T) { } func TestOrganizationsService_GetOrganizationRulesetWithRepoPropCondition(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/rulesets/26110", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -1221,8 +1215,7 @@ func TestOrganizationsService_GetOrganizationRulesetWithRepoPropCondition(t *tes }) } func TestOrganizationsService_UpdateOrganizationRuleset(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/rulesets/26110", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -1336,8 +1329,7 @@ func TestOrganizationsService_UpdateOrganizationRuleset(t *testing.T) { } func TestOrganizationsService_UpdateOrganizationRulesetWithRepoProp(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/rulesets/26110", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -1445,8 +1437,7 @@ func TestOrganizationsService_UpdateOrganizationRulesetWithRepoProp(t *testing.T }) } func TestOrganizationsService_DeleteOrganizationRuleset(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/rulesets/26110", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") diff --git a/github/orgs_security_managers_test.go b/github/orgs_security_managers_test.go index 87fd9c69aa8..63403d79bc6 100644 --- a/github/orgs_security_managers_test.go +++ b/github/orgs_security_managers_test.go @@ -15,8 +15,7 @@ import ( ) func TestOrganizationsService_ListSecurityManagerTeams(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/security-managers", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -50,8 +49,7 @@ func TestOrganizationsService_ListSecurityManagerTeams(t *testing.T) { } func TestOrganizationsService_ListSecurityManagerTeams_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Organizations.ListSecurityManagerTeams(ctx, "%") @@ -59,8 +57,7 @@ func TestOrganizationsService_ListSecurityManagerTeams_invalidOrg(t *testing.T) } func TestOrganizationsService_AddSecurityManagerTeam(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/security-managers/teams/t", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -84,8 +81,7 @@ func TestOrganizationsService_AddSecurityManagerTeam(t *testing.T) { } func TestOrganizationsService_AddSecurityManagerTeam_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Organizations.AddSecurityManagerTeam(ctx, "%", "t") @@ -93,8 +89,7 @@ func TestOrganizationsService_AddSecurityManagerTeam_invalidOrg(t *testing.T) { } func TestOrganizationsService_AddSecurityManagerTeam_invalidTeam(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Organizations.AddSecurityManagerTeam(ctx, "%", "t") @@ -102,8 +97,7 @@ func TestOrganizationsService_AddSecurityManagerTeam_invalidTeam(t *testing.T) { } func TestOrganizationsService_RemoveSecurityManagerTeam(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/security-managers/teams/t", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -127,8 +121,7 @@ func TestOrganizationsService_RemoveSecurityManagerTeam(t *testing.T) { } func TestOrganizationsService_RemoveSecurityManagerTeam_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Organizations.RemoveSecurityManagerTeam(ctx, "%", "t") @@ -136,8 +129,7 @@ func TestOrganizationsService_RemoveSecurityManagerTeam_invalidOrg(t *testing.T) } func TestOrganizationsService_RemoveSecurityManagerTeam_invalidTeam(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Organizations.RemoveSecurityManagerTeam(ctx, "%", "t") diff --git a/github/orgs_test.go b/github/orgs_test.go index 98a6b5257e1..59e6257464b 100644 --- a/github/orgs_test.go +++ b/github/orgs_test.go @@ -68,8 +68,7 @@ func TestOrganization_Marshal(t *testing.T) { } func TestOrganizationsService_ListAll(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) since := int64(1342004) mux.HandleFunc("/organizations", func(w http.ResponseWriter, r *http.Request) { @@ -101,8 +100,7 @@ func TestOrganizationsService_ListAll(t *testing.T) { } func TestOrganizationsService_List_authenticatedUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/orgs", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -136,8 +134,7 @@ func TestOrganizationsService_List_authenticatedUser(t *testing.T) { } func TestOrganizationsService_List_specifiedUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/orgs", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -173,8 +170,7 @@ func TestOrganizationsService_List_specifiedUser(t *testing.T) { } func TestOrganizationsService_List_invalidUser(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Organizations.List(ctx, "%", nil) @@ -182,8 +178,7 @@ func TestOrganizationsService_List_invalidUser(t *testing.T) { } func TestOrganizationsService_Get(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -218,8 +213,7 @@ func TestOrganizationsService_Get(t *testing.T) { } func TestOrganizationsService_Get_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Organizations.Get(ctx, "%") @@ -227,8 +221,7 @@ func TestOrganizationsService_Get_invalidOrg(t *testing.T) { } func TestOrganizationsService_GetByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/organizations/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -262,8 +255,7 @@ func TestOrganizationsService_GetByID(t *testing.T) { } func TestOrganizationsService_Edit(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &Organization{Login: String("l")} @@ -307,8 +299,7 @@ func TestOrganizationsService_Edit(t *testing.T) { } func TestOrganizationsService_Edit_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Organizations.Edit(ctx, "%", nil) @@ -316,8 +307,7 @@ func TestOrganizationsService_Edit_invalidOrg(t *testing.T) { } func TestOrganizationsService_Delete(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -341,8 +331,7 @@ func TestOrganizationsService_Delete(t *testing.T) { } func TestOrganizationsService_ListInstallations(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/installations", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -376,8 +365,7 @@ func TestOrganizationsService_ListInstallations(t *testing.T) { } func TestOrganizationsService_ListInstallations_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Organizations.ListInstallations(ctx, "%", nil) @@ -385,8 +373,7 @@ func TestOrganizationsService_ListInstallations_invalidOrg(t *testing.T) { } func TestOrganizationsService_ListInstallations_withListOptions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/installations", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") diff --git a/github/orgs_users_blocking_test.go b/github/orgs_users_blocking_test.go index 7d5b63b3d33..46c7e6bd410 100644 --- a/github/orgs_users_blocking_test.go +++ b/github/orgs_users_blocking_test.go @@ -15,8 +15,7 @@ import ( ) func TestOrganizationsService_ListBlockedUsers(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/blocks", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -55,8 +54,7 @@ func TestOrganizationsService_ListBlockedUsers(t *testing.T) { } func TestOrganizationsService_IsBlocked(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/blocks/u", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -89,8 +87,7 @@ func TestOrganizationsService_IsBlocked(t *testing.T) { } func TestOrganizationsService_BlockUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/blocks/u", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -116,8 +113,7 @@ func TestOrganizationsService_BlockUser(t *testing.T) { } func TestOrganizationsService_UnblockUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/blocks/u", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") diff --git a/github/projects_test.go b/github/projects_test.go index 369e121ae03..029e89ca0b6 100644 --- a/github/projects_test.go +++ b/github/projects_test.go @@ -85,8 +85,7 @@ func TestProject_Marshal(t *testing.T) { } func TestProjectsService_UpdateProject(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &ProjectOptions{ Name: String("Project Name"), @@ -137,8 +136,7 @@ func TestProjectsService_UpdateProject(t *testing.T) { } func TestProjectsService_GetProject(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/projects/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -173,8 +171,7 @@ func TestProjectsService_GetProject(t *testing.T) { } func TestProjectsService_DeleteProject(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/projects/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -199,8 +196,7 @@ func TestProjectsService_DeleteProject(t *testing.T) { } func TestProjectsService_ListProjectColumns(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) wantAcceptHeaders := []string{mediaTypeProjectsPreview} mux.HandleFunc("/projects/1/columns", func(w http.ResponseWriter, r *http.Request) { @@ -238,8 +234,7 @@ func TestProjectsService_ListProjectColumns(t *testing.T) { } func TestProjectsService_GetProjectColumn(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/projects/columns/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -274,8 +269,7 @@ func TestProjectsService_GetProjectColumn(t *testing.T) { } func TestProjectsService_CreateProjectColumn(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &ProjectColumnOptions{Name: "Column Name"} @@ -319,8 +313,7 @@ func TestProjectsService_CreateProjectColumn(t *testing.T) { } func TestProjectsService_UpdateProjectColumn(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &ProjectColumnOptions{Name: "Column Name"} @@ -364,8 +357,7 @@ func TestProjectsService_UpdateProjectColumn(t *testing.T) { } func TestProjectsService_DeleteProjectColumn(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/projects/columns/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -390,8 +382,7 @@ func TestProjectsService_DeleteProjectColumn(t *testing.T) { } func TestProjectsService_MoveProjectColumn(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &ProjectColumnMoveOptions{Position: "after:12345"} @@ -424,8 +415,7 @@ func TestProjectsService_MoveProjectColumn(t *testing.T) { } func TestProjectsService_ListProjectCards(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/projects/columns/1/cards", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -466,8 +456,7 @@ func TestProjectsService_ListProjectCards(t *testing.T) { } func TestProjectsService_GetProjectCard(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/projects/columns/cards/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -502,8 +491,7 @@ func TestProjectsService_GetProjectCard(t *testing.T) { } func TestProjectsService_CreateProjectCard(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &ProjectCardOptions{ ContentID: 12345, @@ -550,8 +538,7 @@ func TestProjectsService_CreateProjectCard(t *testing.T) { } func TestProjectsService_UpdateProjectCard(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &ProjectCardOptions{ ContentID: 12345, @@ -598,8 +585,7 @@ func TestProjectsService_UpdateProjectCard(t *testing.T) { } func TestProjectsService_DeleteProjectCard(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/projects/columns/cards/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -624,8 +610,7 @@ func TestProjectsService_DeleteProjectCard(t *testing.T) { } func TestProjectsService_MoveProjectCard(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &ProjectCardMoveOptions{Position: "after:12345"} @@ -658,8 +643,7 @@ func TestProjectsService_MoveProjectCard(t *testing.T) { } func TestProjectsService_AddProjectCollaborator(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) opt := &ProjectCollaboratorOptions{ Permission: String("admin"), @@ -696,8 +680,7 @@ func TestProjectsService_AddProjectCollaborator(t *testing.T) { } func TestProjectsService_AddCollaborator_invalidUser(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Projects.AddProjectCollaborator(ctx, 1, "%", nil) @@ -705,8 +688,7 @@ func TestProjectsService_AddCollaborator_invalidUser(t *testing.T) { } func TestProjectsService_RemoveCollaborator(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/projects/1/collaborators/u", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -732,8 +714,7 @@ func TestProjectsService_RemoveCollaborator(t *testing.T) { } func TestProjectsService_RemoveCollaborator_invalidUser(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Projects.RemoveProjectCollaborator(ctx, 1, "%") @@ -741,8 +722,7 @@ func TestProjectsService_RemoveCollaborator_invalidUser(t *testing.T) { } func TestProjectsService_ListCollaborators(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/projects/1/collaborators", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -781,8 +761,7 @@ func TestProjectsService_ListCollaborators(t *testing.T) { } func TestProjectsService_ListCollaborators_withAffiliation(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/projects/1/collaborators", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -808,8 +787,7 @@ func TestProjectsService_ListCollaborators_withAffiliation(t *testing.T) { } func TestProjectsService_ReviewProjectCollaboratorPermission(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/projects/1/collaborators/u/permission", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") diff --git a/github/pulls_comments_test.go b/github/pulls_comments_test.go index 828651b84ac..148901badae 100644 --- a/github/pulls_comments_test.go +++ b/github/pulls_comments_test.go @@ -134,8 +134,7 @@ func TestPullComments_Marshal(t *testing.T) { } func TestPullRequestsService_ListComments_allPulls(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) wantAcceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeMultiLineCommentsPreview} mux.HandleFunc("/repos/o/r/pulls/comments", func(w http.ResponseWriter, r *http.Request) { @@ -183,8 +182,7 @@ func TestPullRequestsService_ListComments_allPulls(t *testing.T) { } func TestPullRequestsService_ListComments_specificPull(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) wantAcceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeMultiLineCommentsPreview} mux.HandleFunc("/repos/o/r/pulls/1/comments", func(w http.ResponseWriter, r *http.Request) { @@ -206,8 +204,7 @@ func TestPullRequestsService_ListComments_specificPull(t *testing.T) { } func TestPullRequestsService_ListComments_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.PullRequests.ListComments(ctx, "%", "r", 1, nil) @@ -215,8 +212,7 @@ func TestPullRequestsService_ListComments_invalidOwner(t *testing.T) { } func TestPullRequestsService_GetComment(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) wantAcceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeMultiLineCommentsPreview} mux.HandleFunc("/repos/o/r/pulls/comments/1", func(w http.ResponseWriter, r *http.Request) { @@ -252,8 +248,7 @@ func TestPullRequestsService_GetComment(t *testing.T) { } func TestPullRequestsService_GetComment_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.PullRequests.GetComment(ctx, "%", "r", 1) @@ -261,8 +256,7 @@ func TestPullRequestsService_GetComment_invalidOwner(t *testing.T) { } func TestPullRequestsService_CreateComment(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &PullRequestComment{Body: String("b")} @@ -308,8 +302,7 @@ func TestPullRequestsService_CreateComment(t *testing.T) { } func TestPullRequestsService_CreateComment_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.PullRequests.CreateComment(ctx, "%", "r", 1, nil) @@ -317,8 +310,7 @@ func TestPullRequestsService_CreateComment_invalidOwner(t *testing.T) { } func TestPullRequestsService_CreateCommentInReplyTo(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &PullRequestComment{Body: String("b")} @@ -361,8 +353,7 @@ func TestPullRequestsService_CreateCommentInReplyTo(t *testing.T) { } func TestPullRequestsService_EditComment(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &PullRequestComment{Body: String("b")} @@ -405,8 +396,7 @@ func TestPullRequestsService_EditComment(t *testing.T) { } func TestPullRequestsService_EditComment_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.PullRequests.EditComment(ctx, "%", "r", 1, nil) @@ -414,8 +404,7 @@ func TestPullRequestsService_EditComment_invalidOwner(t *testing.T) { } func TestPullRequestsService_DeleteComment(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/comments/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -439,8 +428,7 @@ func TestPullRequestsService_DeleteComment(t *testing.T) { } func TestPullRequestsService_DeleteComment_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.PullRequests.DeleteComment(ctx, "%", "r", 1) diff --git a/github/pulls_reviewers_test.go b/github/pulls_reviewers_test.go index 60502445390..b97fbbec189 100644 --- a/github/pulls_reviewers_test.go +++ b/github/pulls_reviewers_test.go @@ -119,8 +119,7 @@ func TestReviewers_Marshal(t *testing.T) { } func TestRequestReviewers(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1/requested_reviewers", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -150,8 +149,7 @@ func TestRequestReviewers(t *testing.T) { } func TestRemoveReviewers(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1/requested_reviewers", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -171,8 +169,7 @@ func TestRemoveReviewers(t *testing.T) { } func TestListReviewers(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1/requested_reviewers", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -214,8 +211,7 @@ func TestListReviewers(t *testing.T) { } func TestListReviewers_withOptions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1/requested_reviewers", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") diff --git a/github/pulls_reviews_test.go b/github/pulls_reviews_test.go index bafa9f06a3b..ce7b7857de5 100644 --- a/github/pulls_reviews_test.go +++ b/github/pulls_reviews_test.go @@ -16,8 +16,7 @@ import ( ) func TestPullRequestsService_ListReviews(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1/reviews", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -58,8 +57,7 @@ func TestPullRequestsService_ListReviews(t *testing.T) { } func TestPullRequestsService_ListReviews_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.PullRequests.ListReviews(ctx, "%", "r", 1, nil) @@ -67,8 +65,7 @@ func TestPullRequestsService_ListReviews_invalidOwner(t *testing.T) { } func TestPullRequestsService_GetReview(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1/reviews/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -102,8 +99,7 @@ func TestPullRequestsService_GetReview(t *testing.T) { } func TestPullRequestsService_GetReview_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.PullRequests.GetReview(ctx, "%", "r", 1, 1) @@ -111,8 +107,7 @@ func TestPullRequestsService_GetReview_invalidOwner(t *testing.T) { } func TestPullRequestsService_DeletePendingReview(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1/reviews/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -146,8 +141,7 @@ func TestPullRequestsService_DeletePendingReview(t *testing.T) { } func TestPullRequestsService_DeletePendingReview_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.PullRequests.DeletePendingReview(ctx, "%", "r", 1, 1) @@ -155,8 +149,7 @@ func TestPullRequestsService_DeletePendingReview_invalidOwner(t *testing.T) { } func TestPullRequestsService_ListReviewComments(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1/reviews/1/comments", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -193,8 +186,7 @@ func TestPullRequestsService_ListReviewComments(t *testing.T) { } func TestPullRequestsService_ListReviewComments_withOptions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1/reviews/1/comments", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -345,8 +337,7 @@ func TestPullRequestReviewRequest_isComfortFadePreview(t *testing.T) { } func TestPullRequestsService_ListReviewComments_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.PullRequests.ListReviewComments(ctx, "%", "r", 1, 1, nil) @@ -354,8 +345,7 @@ func TestPullRequestsService_ListReviewComments_invalidOwner(t *testing.T) { } func TestPullRequestsService_CreateReview(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &PullRequestReviewRequest{ CommitID: String("commit_id"), @@ -402,8 +392,7 @@ func TestPullRequestsService_CreateReview(t *testing.T) { } func TestPullRequestsService_CreateReview_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.PullRequests.CreateReview(ctx, "%", "r", 1, &PullRequestReviewRequest{}) @@ -411,8 +400,7 @@ func TestPullRequestsService_CreateReview_invalidOwner(t *testing.T) { } func TestPullRequestsService_CreateReview_badReview(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() @@ -440,8 +428,7 @@ func TestPullRequestsService_CreateReview_badReview(t *testing.T) { } func TestPullRequestsService_CreateReview_addHeader(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) path := "path/to/file.go" body := "this is a comment body" @@ -487,8 +474,7 @@ func TestPullRequestsService_CreateReview_addHeader(t *testing.T) { } func TestPullRequestsService_UpdateReview(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1/reviews/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -522,8 +508,7 @@ func TestPullRequestsService_UpdateReview(t *testing.T) { } func TestPullRequestsService_SubmitReview(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &PullRequestReviewRequest{ Body: String("b"), @@ -569,8 +554,7 @@ func TestPullRequestsService_SubmitReview(t *testing.T) { } func TestPullRequestsService_SubmitReview_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.PullRequests.SubmitReview(ctx, "%", "r", 1, 1, &PullRequestReviewRequest{}) @@ -578,8 +562,7 @@ func TestPullRequestsService_SubmitReview_invalidOwner(t *testing.T) { } func TestPullRequestsService_DismissReview(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &PullRequestReviewDismissalRequest{Message: String("m")} @@ -622,8 +605,7 @@ func TestPullRequestsService_DismissReview(t *testing.T) { } func TestPullRequestsService_DismissReview_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.PullRequests.DismissReview(ctx, "%", "r", 1, 1, &PullRequestReviewDismissalRequest{}) diff --git a/github/pulls_test.go b/github/pulls_test.go index 5a9582b896e..0f9058cca84 100644 --- a/github/pulls_test.go +++ b/github/pulls_test.go @@ -18,8 +18,7 @@ import ( ) func TestPullRequestsService_List(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -62,8 +61,7 @@ func TestPullRequestsService_List(t *testing.T) { } func TestPullRequestsService_ListPullRequestsWithCommit(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/commits/sha/pulls", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -102,8 +100,7 @@ func TestPullRequestsService_ListPullRequestsWithCommit(t *testing.T) { } func TestPullRequestsService_List_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.PullRequests.List(ctx, "%", "r", nil) @@ -111,8 +108,7 @@ func TestPullRequestsService_List_invalidOwner(t *testing.T) { } func TestPullRequestsService_Get(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -146,8 +142,7 @@ func TestPullRequestsService_Get(t *testing.T) { } func TestPullRequestsService_GetRaw_diff(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) const rawStr = "@@diff content" @@ -183,8 +178,7 @@ func TestPullRequestsService_GetRaw_diff(t *testing.T) { } func TestPullRequestsService_GetRaw_patch(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) const rawStr = "@@patch content" @@ -206,8 +200,7 @@ func TestPullRequestsService_GetRaw_patch(t *testing.T) { } func TestPullRequestsService_GetRaw_invalid(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.PullRequests.GetRaw(ctx, "o", "r", 1, RawOptions{100}) @@ -220,8 +213,7 @@ func TestPullRequestsService_GetRaw_invalid(t *testing.T) { } func TestPullRequestsService_Get_links(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -274,8 +266,7 @@ func TestPullRequestsService_Get_links(t *testing.T) { } func TestPullRequestsService_Get_headAndBase(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -305,8 +296,7 @@ func TestPullRequestsService_Get_headAndBase(t *testing.T) { } func TestPullRequestsService_Get_urlFields(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -345,8 +335,7 @@ func TestPullRequestsService_Get_urlFields(t *testing.T) { } func TestPullRequestsService_Get_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.PullRequests.Get(ctx, "%", "r", 1) @@ -354,8 +343,7 @@ func TestPullRequestsService_Get_invalidOwner(t *testing.T) { } func TestPullRequestsService_Create(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &NewPullRequest{Title: String("t")} @@ -398,8 +386,7 @@ func TestPullRequestsService_Create(t *testing.T) { } func TestPullRequestsService_Create_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.PullRequests.Create(ctx, "%", "r", nil) @@ -407,8 +394,7 @@ func TestPullRequestsService_Create_invalidOwner(t *testing.T) { } func TestPullRequestsService_UpdateBranch(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1/update-branch", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -455,8 +441,7 @@ func TestPullRequestsService_UpdateBranch(t *testing.T) { } func TestPullRequestsService_Edit(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) tests := []struct { input *PullRequest @@ -516,8 +501,7 @@ func TestPullRequestsService_Edit(t *testing.T) { } func TestPullRequestsService_Edit_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.PullRequests.Edit(ctx, "%", "r", 1, &PullRequest{}) @@ -525,8 +509,7 @@ func TestPullRequestsService_Edit_invalidOwner(t *testing.T) { } func TestPullRequestsService_ListCommits(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1/commits", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -597,8 +580,7 @@ func TestPullRequestsService_ListCommits(t *testing.T) { } func TestPullRequestsService_ListFiles(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1/files", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -674,8 +656,7 @@ func TestPullRequestsService_ListFiles(t *testing.T) { } func TestPullRequestsService_IsMerged(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1/merge", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -709,8 +690,7 @@ func TestPullRequestsService_IsMerged(t *testing.T) { } func TestPullRequestsService_Merge(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1/merge", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -755,8 +735,7 @@ func TestPullRequestsService_Merge(t *testing.T) { // Test that different merge options produce expected PUT requests. See issue https://github.com/google/go-github/issues/500. func TestPullRequestsService_Merge_options(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) tests := []struct { options *PullRequestOptions @@ -810,8 +789,8 @@ func TestPullRequestsService_Merge_options(t *testing.T) { } func TestPullRequestsService_Merge_Blank_Message(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + madeRequest := false expectedBody := "" mux.HandleFunc("/repos/o/r/pulls/1/merge", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/rate_limit_test.go b/github/rate_limit_test.go index 6ff87824dda..fb715f9e51e 100644 --- a/github/rate_limit_test.go +++ b/github/rate_limit_test.go @@ -36,8 +36,7 @@ func TestRateLimits_String(t *testing.T) { } func TestRateLimits(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/rate_limit", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -180,8 +179,7 @@ func TestRateLimits(t *testing.T) { } func TestRateLimits_coverage(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() @@ -193,8 +191,7 @@ func TestRateLimits_coverage(t *testing.T) { } func TestRateLimits_overQuota(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) client.rateLimits[CoreCategory] = Rate{ Limit: 1, diff --git a/github/reactions_test.go b/github/reactions_test.go index e77631e99a1..e2c759c9697 100644 --- a/github/reactions_test.go +++ b/github/reactions_test.go @@ -58,7 +58,7 @@ func TestReactions_Marshal(t *testing.T) { "heart": 1, "hooray": 1, "rocket": 1, - "eyes": 1, + "eyes": 1, "url": "u" }` @@ -66,8 +66,7 @@ func TestReactions_Marshal(t *testing.T) { } func TestReactionsService_ListCommentReactions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/comments/1/reactions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -104,8 +103,7 @@ func TestReactionsService_ListCommentReactions(t *testing.T) { } func TestReactionsService_CreateCommentReaction(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/comments/1/reactions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -141,8 +139,7 @@ func TestReactionsService_CreateCommentReaction(t *testing.T) { } func TestReactionsService_ListIssueReactions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/1/reactions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -164,8 +161,7 @@ func TestReactionsService_ListIssueReactions(t *testing.T) { } func TestReactionsService_ListIssueReactions_coverage(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() @@ -185,8 +181,7 @@ func TestReactionsService_ListIssueReactions_coverage(t *testing.T) { } func TestReactionsService_CreateIssueReaction(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/1/reactions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -222,8 +217,7 @@ func TestReactionsService_CreateIssueReaction(t *testing.T) { } func TestReactionsService_ListIssueCommentReactions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/comments/1/reactions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -245,8 +239,7 @@ func TestReactionsService_ListIssueCommentReactions(t *testing.T) { } func TestReactionsService_ListIssueCommentReactions_coverage(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() @@ -266,8 +259,7 @@ func TestReactionsService_ListIssueCommentReactions_coverage(t *testing.T) { } func TestReactionsService_CreateIssueCommentReaction(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/comments/1/reactions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -303,8 +295,7 @@ func TestReactionsService_CreateIssueCommentReaction(t *testing.T) { } func TestReactionsService_ListPullRequestCommentReactions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/comments/1/reactions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -326,8 +317,7 @@ func TestReactionsService_ListPullRequestCommentReactions(t *testing.T) { } func TestReactionsService_ListPullRequestCommentReactions_coverage(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() @@ -347,8 +337,7 @@ func TestReactionsService_ListPullRequestCommentReactions_coverage(t *testing.T) } func TestReactionsService_CreatePullRequestCommentReaction(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/comments/1/reactions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -384,8 +373,7 @@ func TestReactionsService_CreatePullRequestCommentReaction(t *testing.T) { } func TestReactionsService_ListTeamDiscussionReactions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/teams/1/discussions/2/reactions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -407,8 +395,7 @@ func TestReactionsService_ListTeamDiscussionReactions(t *testing.T) { } func TestReactionsService_ListTeamDiscussionReactions_coverage(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() @@ -428,8 +415,7 @@ func TestReactionsService_ListTeamDiscussionReactions_coverage(t *testing.T) { } func TestReactionsService_CreateTeamDiscussionReaction(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/teams/1/discussions/2/reactions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -465,8 +451,7 @@ func TestReactionsService_CreateTeamDiscussionReaction(t *testing.T) { } func TestReactionService_ListTeamDiscussionCommentReactions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/teams/1/discussions/2/comments/3/reactions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -488,8 +473,7 @@ func TestReactionService_ListTeamDiscussionCommentReactions(t *testing.T) { } func TestReactionService_ListTeamDiscussionCommentReactions_coverage(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() @@ -509,8 +493,7 @@ func TestReactionService_ListTeamDiscussionCommentReactions_coverage(t *testing. } func TestReactionService_CreateTeamDiscussionCommentReaction(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/teams/1/discussions/2/comments/3/reactions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -546,8 +529,7 @@ func TestReactionService_CreateTeamDiscussionCommentReaction(t *testing.T) { } func TestReactionsService_DeleteCommitCommentReaction(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/comments/1/reactions/2", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -573,8 +555,7 @@ func TestReactionsService_DeleteCommitCommentReaction(t *testing.T) { } func TestReactionsService_DeleteCommitCommentReactionByRepoID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repositories/1/comments/2/reactions/3", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -600,8 +581,7 @@ func TestReactionsService_DeleteCommitCommentReactionByRepoID(t *testing.T) { } func TestReactionsService_DeleteIssueReaction(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/1/reactions/2", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -627,8 +607,7 @@ func TestReactionsService_DeleteIssueReaction(t *testing.T) { } func TestReactionsService_DeleteIssueReactionByRepoID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repositories/1/issues/2/reactions/3", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -654,8 +633,7 @@ func TestReactionsService_DeleteIssueReactionByRepoID(t *testing.T) { } func TestReactionsService_DeleteIssueCommentReaction(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/comments/1/reactions/2", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -681,8 +659,7 @@ func TestReactionsService_DeleteIssueCommentReaction(t *testing.T) { } func TestReactionsService_DeleteIssueCommentReactionByRepoID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repositories/1/issues/comments/2/reactions/3", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -708,8 +685,7 @@ func TestReactionsService_DeleteIssueCommentReactionByRepoID(t *testing.T) { } func TestReactionsService_DeletePullRequestCommentReaction(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/comments/1/reactions/2", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -735,8 +711,7 @@ func TestReactionsService_DeletePullRequestCommentReaction(t *testing.T) { } func TestReactionsService_DeletePullRequestCommentReactionByRepoID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repositories/1/pulls/comments/2/reactions/3", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -762,8 +737,7 @@ func TestReactionsService_DeletePullRequestCommentReactionByRepoID(t *testing.T) } func TestReactionsService_DeleteTeamDiscussionReaction(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s/discussions/1/reactions/2", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -789,8 +763,7 @@ func TestReactionsService_DeleteTeamDiscussionReaction(t *testing.T) { } func TestReactionsService_DeleteTeamDiscussionReactionByTeamIDAndOrgID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/2/discussions/3/reactions/4", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -816,8 +789,7 @@ func TestReactionsService_DeleteTeamDiscussionReactionByTeamIDAndOrgID(t *testin } func TestReactionsService_DeleteTeamDiscussionCommentReaction(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s/discussions/1/comments/2/reactions/3", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -843,8 +815,7 @@ func TestReactionsService_DeleteTeamDiscussionCommentReaction(t *testing.T) { } func TestReactionsService_DeleteTeamDiscussionCommentReactionByTeamIDAndOrgID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/2/discussions/3/comments/4/reactions/5", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -870,8 +841,7 @@ func TestReactionsService_DeleteTeamDiscussionCommentReactionByTeamIDAndOrgID(t } func TestReactionService_CreateReleaseReaction(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/releases/1/reactions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") diff --git a/github/repos_actions_access_test.go b/github/repos_actions_access_test.go index accfe2abf13..ae80790e790 100644 --- a/github/repos_actions_access_test.go +++ b/github/repos_actions_access_test.go @@ -16,8 +16,7 @@ import ( ) func TestRepositoriesService_GetActionsAccessLevel(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/permissions/access", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -50,8 +49,7 @@ func TestRepositoriesService_GetActionsAccessLevel(t *testing.T) { } func TestRepositoriesService_EditActionsAccessLevel(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &RepositoryActionsAccessLevel{AccessLevel: String("organization")} diff --git a/github/repos_actions_allowed_test.go b/github/repos_actions_allowed_test.go index 62ff11d966c..0ea6e731af8 100644 --- a/github/repos_actions_allowed_test.go +++ b/github/repos_actions_allowed_test.go @@ -16,8 +16,7 @@ import ( ) func TestRepositoryService_GetActionsAllowed(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/permissions/selected-actions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -50,8 +49,8 @@ func TestRepositoryService_GetActionsAllowed(t *testing.T) { } func TestRepositoriesService_EditActionsAllowed(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + input := &ActionsAllowed{GithubOwnedAllowed: Bool(true), VerifiedAllowed: Bool(false), PatternsAllowed: []string{"a/b"}} mux.HandleFunc("/repos/o/r/actions/permissions/selected-actions", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/repos_actions_permissions_test.go b/github/repos_actions_permissions_test.go index 9959a6e7685..bfda30646f8 100644 --- a/github/repos_actions_permissions_test.go +++ b/github/repos_actions_permissions_test.go @@ -16,8 +16,7 @@ import ( ) func TestRepositoriesService_GetActionsPermissions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/permissions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -50,8 +49,7 @@ func TestRepositoriesService_GetActionsPermissions(t *testing.T) { } func TestRepositoriesService_EditActionsPermissions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &ActionsPermissionsRepository{Enabled: Bool(true), AllowedActions: String("selected")} @@ -112,8 +110,7 @@ func TestActionsPermissionsRepository_Marshal(t *testing.T) { } func TestRepositoriesService_GetDefaultWorkflowPermissions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/permissions/workflow", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -146,8 +143,7 @@ func TestRepositoriesService_GetDefaultWorkflowPermissions(t *testing.T) { } func TestRepositoriesService_EditDefaultWorkflowPermissions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &DefaultWorkflowPermissionRepository{DefaultWorkflowPermissions: String("read"), CanApprovePullRequestReviews: Bool(true)} diff --git a/github/repos_autolinks_test.go b/github/repos_autolinks_test.go index 37de5b5f5a7..10011e315fd 100644 --- a/github/repos_autolinks_test.go +++ b/github/repos_autolinks_test.go @@ -16,8 +16,7 @@ import ( ) func TestRepositoriesService_ListAutolinks(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/autolinks", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -59,8 +58,7 @@ func TestRepositoriesService_ListAutolinks(t *testing.T) { } func TestRepositoriesService_AddAutolink(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) opt := &AutolinkOptions{ KeyPrefix: String("TICKET-"), @@ -114,8 +112,7 @@ func TestRepositoriesService_AddAutolink(t *testing.T) { } func TestRepositoriesService_GetAutolink(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/autolinks/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -144,8 +141,7 @@ func TestRepositoriesService_GetAutolink(t *testing.T) { } func TestRepositoriesService_DeleteAutolink(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/autolinks/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") diff --git a/github/repos_codeowners_test.go b/github/repos_codeowners_test.go index 84f0ee462bb..59709a71bb2 100644 --- a/github/repos_codeowners_test.go +++ b/github/repos_codeowners_test.go @@ -15,8 +15,7 @@ import ( ) func TestRepositoriesService_GetCodeownersErrors_noRef(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/codeowners/errors", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -76,8 +75,7 @@ func TestRepositoriesService_GetCodeownersErrors_noRef(t *testing.T) { } func TestRepositoriesService_GetCodeownersErrors_specificRef(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/codeowners/errors", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") diff --git a/github/repos_collaborators_test.go b/github/repos_collaborators_test.go index 5aa0ad90f70..2943448a574 100644 --- a/github/repos_collaborators_test.go +++ b/github/repos_collaborators_test.go @@ -16,8 +16,7 @@ import ( ) func TestRepositoriesService_ListCollaborators(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/collaborators", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -55,8 +54,7 @@ func TestRepositoriesService_ListCollaborators(t *testing.T) { } func TestRepositoriesService_ListCollaborators_withAffiliation(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/collaborators", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -95,8 +93,7 @@ func TestRepositoriesService_ListCollaborators_withAffiliation(t *testing.T) { } func TestRepositoriesService_ListCollaborators_withPermission(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/collaborators", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -135,8 +132,7 @@ func TestRepositoriesService_ListCollaborators_withPermission(t *testing.T) { } func TestRepositoriesService_ListCollaborators_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Repositories.ListCollaborators(ctx, "%", "%", nil) @@ -144,8 +140,7 @@ func TestRepositoriesService_ListCollaborators_invalidOwner(t *testing.T) { } func TestRepositoriesService_IsCollaborator_True(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/collaborators/u", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -178,8 +173,7 @@ func TestRepositoriesService_IsCollaborator_True(t *testing.T) { } func TestRepositoriesService_IsCollaborator_False(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/collaborators/u", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -212,8 +206,7 @@ func TestRepositoriesService_IsCollaborator_False(t *testing.T) { } func TestRepositoriesService_IsCollaborator_invalidUser(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Repositories.IsCollaborator(ctx, "%", "%", "%") @@ -221,8 +214,7 @@ func TestRepositoriesService_IsCollaborator_invalidUser(t *testing.T) { } func TestRepositoryService_GetPermissionLevel(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/collaborators/u/permission", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -262,8 +254,7 @@ func TestRepositoryService_GetPermissionLevel(t *testing.T) { } func TestRepositoriesService_AddCollaborator(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) opt := &RepositoryAddCollaboratorOptions{Permission: "admin"} mux.HandleFunc("/repos/o/r/collaborators/u", func(w http.ResponseWriter, r *http.Request) { @@ -319,8 +310,7 @@ func TestRepositoriesService_AddCollaborator(t *testing.T) { } func TestRepositoriesService_AddCollaborator_invalidUser(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Repositories.AddCollaborator(ctx, "%", "%", "%", nil) @@ -328,8 +318,7 @@ func TestRepositoriesService_AddCollaborator_invalidUser(t *testing.T) { } func TestRepositoriesService_RemoveCollaborator(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/collaborators/u", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -354,8 +343,7 @@ func TestRepositoriesService_RemoveCollaborator(t *testing.T) { } func TestRepositoriesService_RemoveCollaborator_invalidUser(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Repositories.RemoveCollaborator(ctx, "%", "%", "%") diff --git a/github/repos_comments_test.go b/github/repos_comments_test.go index 00871cd72fb..57033487ed9 100644 --- a/github/repos_comments_test.go +++ b/github/repos_comments_test.go @@ -16,8 +16,7 @@ import ( ) func TestRepositoriesService_ListComments(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/comments", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -54,8 +53,7 @@ func TestRepositoriesService_ListComments(t *testing.T) { } func TestRepositoriesService_ListComments_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Repositories.ListComments(ctx, "%", "%", nil) @@ -63,8 +61,7 @@ func TestRepositoriesService_ListComments_invalidOwner(t *testing.T) { } func TestRepositoriesService_ListCommitComments(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/commits/s/comments", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -101,8 +98,7 @@ func TestRepositoriesService_ListCommitComments(t *testing.T) { } func TestRepositoriesService_ListCommitComments_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Repositories.ListCommitComments(ctx, "%", "%", "%", nil) @@ -110,8 +106,7 @@ func TestRepositoriesService_ListCommitComments_invalidOwner(t *testing.T) { } func TestRepositoriesService_CreateComment(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &RepositoryComment{Body: String("b")} @@ -154,8 +149,7 @@ func TestRepositoriesService_CreateComment(t *testing.T) { } func TestRepositoriesService_CreateComment_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Repositories.CreateComment(ctx, "%", "%", "%", nil) @@ -163,8 +157,7 @@ func TestRepositoriesService_CreateComment_invalidOwner(t *testing.T) { } func TestRepositoriesService_GetComment(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/comments/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -199,8 +192,7 @@ func TestRepositoriesService_GetComment(t *testing.T) { } func TestRepositoriesService_GetComment_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Repositories.GetComment(ctx, "%", "%", 1) @@ -208,8 +200,7 @@ func TestRepositoriesService_GetComment_invalidOwner(t *testing.T) { } func TestRepositoriesService_UpdateComment(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &RepositoryComment{Body: String("b")} @@ -252,8 +243,7 @@ func TestRepositoriesService_UpdateComment(t *testing.T) { } func TestRepositoriesService_UpdateComment_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Repositories.UpdateComment(ctx, "%", "%", 1, nil) @@ -261,8 +251,7 @@ func TestRepositoriesService_UpdateComment_invalidOwner(t *testing.T) { } func TestRepositoriesService_DeleteComment(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/comments/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -286,8 +275,7 @@ func TestRepositoriesService_DeleteComment(t *testing.T) { } func TestRepositoriesService_DeleteComment_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Repositories.DeleteComment(ctx, "%", "%", 1) diff --git a/github/repos_commits_test.go b/github/repos_commits_test.go index 8fa8eb9f401..99428aa9b3b 100644 --- a/github/repos_commits_test.go +++ b/github/repos_commits_test.go @@ -18,8 +18,7 @@ import ( ) func TestRepositoriesService_ListCommits(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) // given mux.HandleFunc("/repos/o/r/commits", func(w http.ResponseWriter, r *http.Request) { @@ -69,8 +68,7 @@ func TestRepositoriesService_ListCommits(t *testing.T) { } func TestRepositoriesService_GetCommit(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/commits/s", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -160,8 +158,7 @@ func TestRepositoriesService_GetCommit(t *testing.T) { } func TestRepositoriesService_GetCommitRaw_diff(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) const rawStr = "@@diff content" @@ -197,8 +194,7 @@ func TestRepositoriesService_GetCommitRaw_diff(t *testing.T) { } func TestRepositoriesService_GetCommitRaw_patch(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) const rawStr = "@@patch content" @@ -220,8 +216,7 @@ func TestRepositoriesService_GetCommitRaw_patch(t *testing.T) { } func TestRepositoriesService_GetCommitRaw_invalid(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Repositories.GetCommitRaw(ctx, "o", "r", "s", RawOptions{100}) @@ -234,8 +229,8 @@ func TestRepositoriesService_GetCommitRaw_invalid(t *testing.T) { } func TestRepositoriesService_GetCommitSHA1(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + const sha1 = "01234abcde" mux.HandleFunc("/repos/o/r/commits/master", func(w http.ResponseWriter, r *http.Request) { @@ -290,8 +285,8 @@ func TestRepositoriesService_GetCommitSHA1(t *testing.T) { } func TestRepositoriesService_NonAlphabetCharacter_GetCommitSHA1(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + const sha1 = "01234abcde" mux.HandleFunc("/repos/o/r/commits/master%20hash", func(w http.ResponseWriter, r *http.Request) { @@ -330,8 +325,8 @@ func TestRepositoriesService_NonAlphabetCharacter_GetCommitSHA1(t *testing.T) { } func TestRepositoriesService_TrailingPercent_GetCommitSHA1(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + const sha1 = "01234abcde" mux.HandleFunc("/repos/o/r/commits/comm%", func(w http.ResponseWriter, r *http.Request) { @@ -379,87 +374,70 @@ func TestRepositoriesService_CompareCommits(t *testing.T) { {base: "`~!@#$%^&*()_+-=[]\\{}|;':\",./<>?/*-+123base", head: "head123`~!@#$%^&*()_+-=[]\\{}|;':\",./<>?/*-+"}, } - for _, sample := range testCases { - client, mux, _, teardown := setup() - - base := sample.base - head := sample.head - escapedBase := url.QueryEscape(base) - escapedHead := url.QueryEscape(head) - - pattern := fmt.Sprintf("/repos/o/r/compare/%v...%v", base, head) - - mux.HandleFunc(pattern, func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - testFormValues(t, r, values{"per_page": "2", "page": "2"}) - fmt.Fprintf(w, `{ - "base_commit": { - "sha": "s", - "commit": { - "author": { "name": "n" }, - "committer": { "name": "n" }, - "message": "m", - "tree": { "sha": "t" } - }, - "author": { "login": "l" }, - "committer": { "login": "l" }, - "parents": [ { "sha": "s" } ] - }, - "status": "s", - "ahead_by": 1, - "behind_by": 2, - "total_commits": 1, - "commits": [ - { - "sha": "s", - "commit": { "author": { "name": "n" } }, - "author": { "login": "l" }, - "committer": { "login": "l" }, - "parents": [ { "sha": "s" } ] - } - ], - "files": [ { "filename": "f" } ], - "html_url": "https://github.com/o/r/compare/%[1]v...%[2]v", - "permalink_url": "https://github.com/o/r/compare/o:bbcd538c8e72b8c175046e27cc8f907076331401...o:0328041d1152db8ae77652d1618a02e57f745f17", - "diff_url": "https://github.com/o/r/compare/%[1]v...%[2]v.diff", - "patch_url": "https://github.com/o/r/compare/%[1]v...%[2]v.patch", - "url": "https://api.github.com/repos/o/r/compare/%[1]v...%[2]v" - }`, escapedBase, escapedHead) - }) + for i, sample := range testCases { + t.Run(fmt.Sprintf("case #%v", i+1), func(t *testing.T) { + client, mux, _ := setup(t) + + base := sample.base + head := sample.head + escapedBase := url.QueryEscape(base) + escapedHead := url.QueryEscape(head) + + pattern := fmt.Sprintf("/repos/o/r/compare/%v...%v", base, head) + + mux.HandleFunc(pattern, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{"per_page": "2", "page": "2"}) + fmt.Fprintf(w, `{ + "base_commit": { + "sha": "s", + "commit": { + "author": { "name": "n" }, + "committer": { "name": "n" }, + "message": "m", + "tree": { "sha": "t" } + }, + "author": { "login": "l" }, + "committer": { "login": "l" }, + "parents": [ { "sha": "s" } ] + }, + "status": "s", + "ahead_by": 1, + "behind_by": 2, + "total_commits": 1, + "commits": [ + { + "sha": "s", + "commit": { "author": { "name": "n" } }, + "author": { "login": "l" }, + "committer": { "login": "l" }, + "parents": [ { "sha": "s" } ] + } + ], + "files": [ { "filename": "f" } ], + "html_url": "https://github.com/o/r/compare/%[1]v...%[2]v", + "permalink_url": "https://github.com/o/r/compare/o:bbcd538c8e72b8c175046e27cc8f907076331401...o:0328041d1152db8ae77652d1618a02e57f745f17", + "diff_url": "https://github.com/o/r/compare/%[1]v...%[2]v.diff", + "patch_url": "https://github.com/o/r/compare/%[1]v...%[2]v.patch", + "url": "https://api.github.com/repos/o/r/compare/%[1]v...%[2]v" +}`, escapedBase, escapedHead) + }) - opts := &ListOptions{Page: 2, PerPage: 2} - ctx := context.Background() - got, _, err := client.Repositories.CompareCommits(ctx, "o", "r", base, head, opts) - if err != nil { - t.Errorf("Repositories.CompareCommits returned error: %v", err) - } + opts := &ListOptions{Page: 2, PerPage: 2} + ctx := context.Background() + got, _, err := client.Repositories.CompareCommits(ctx, "o", "r", base, head, opts) + if err != nil { + t.Errorf("Repositories.CompareCommits returned error: %v", err) + } - want := &CommitsComparison{ - BaseCommit: &RepositoryCommit{ - SHA: String("s"), - Commit: &Commit{ - Author: &CommitAuthor{Name: String("n")}, - Committer: &CommitAuthor{Name: String("n")}, - Message: String("m"), - Tree: &Tree{SHA: String("t")}, - }, - Author: &User{Login: String("l")}, - Committer: &User{Login: String("l")}, - Parents: []*Commit{ - { - SHA: String("s"), - }, - }, - }, - Status: String("s"), - AheadBy: Int(1), - BehindBy: Int(2), - TotalCommits: Int(1), - Commits: []*RepositoryCommit{ - { + want := &CommitsComparison{ + BaseCommit: &RepositoryCommit{ SHA: String("s"), Commit: &Commit{ - Author: &CommitAuthor{Name: String("n")}, + Author: &CommitAuthor{Name: String("n")}, + Committer: &CommitAuthor{Name: String("n")}, + Message: String("m"), + Tree: &Tree{SHA: String("t")}, }, Author: &User{Login: String("l")}, Committer: &User{Login: String("l")}, @@ -469,38 +447,55 @@ func TestRepositoriesService_CompareCommits(t *testing.T) { }, }, }, - }, - Files: []*CommitFile{ - { - Filename: String("f"), + Status: String("s"), + AheadBy: Int(1), + BehindBy: Int(2), + TotalCommits: Int(1), + Commits: []*RepositoryCommit{ + { + SHA: String("s"), + Commit: &Commit{ + Author: &CommitAuthor{Name: String("n")}, + }, + Author: &User{Login: String("l")}, + Committer: &User{Login: String("l")}, + Parents: []*Commit{ + { + SHA: String("s"), + }, + }, + }, }, - }, - HTMLURL: String(fmt.Sprintf("https://github.com/o/r/compare/%v...%v", escapedBase, escapedHead)), - PermalinkURL: String("https://github.com/o/r/compare/o:bbcd538c8e72b8c175046e27cc8f907076331401...o:0328041d1152db8ae77652d1618a02e57f745f17"), - DiffURL: String(fmt.Sprintf("https://github.com/o/r/compare/%v...%v.diff", escapedBase, escapedHead)), - PatchURL: String(fmt.Sprintf("https://github.com/o/r/compare/%v...%v.patch", escapedBase, escapedHead)), - URL: String(fmt.Sprintf("https://api.github.com/repos/o/r/compare/%v...%v", escapedBase, escapedHead)), - } + Files: []*CommitFile{ + { + Filename: String("f"), + }, + }, + HTMLURL: String(fmt.Sprintf("https://github.com/o/r/compare/%v...%v", escapedBase, escapedHead)), + PermalinkURL: String("https://github.com/o/r/compare/o:bbcd538c8e72b8c175046e27cc8f907076331401...o:0328041d1152db8ae77652d1618a02e57f745f17"), + DiffURL: String(fmt.Sprintf("https://github.com/o/r/compare/%v...%v.diff", escapedBase, escapedHead)), + PatchURL: String(fmt.Sprintf("https://github.com/o/r/compare/%v...%v.patch", escapedBase, escapedHead)), + URL: String(fmt.Sprintf("https://api.github.com/repos/o/r/compare/%v...%v", escapedBase, escapedHead)), + } - if !cmp.Equal(got, want) { - t.Errorf("Repositories.CompareCommits returned \n%+v, want \n%+v", got, want) - } + if !cmp.Equal(got, want) { + t.Errorf("Repositories.CompareCommits returned \n%+v, want \n%+v", got, want) + } - const methodName = "CompareCommits" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.CompareCommits(ctx, "\n", "\n", "\n", "\n", opts) - return err - }) + const methodName = "CompareCommits" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.CompareCommits(ctx, "\n", "\n", "\n", "\n", opts) + return err + }) - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.CompareCommits(ctx, "o", "r", base, head, opts) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.CompareCommits(ctx, "o", "r", base, head, opts) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) }) - - teardown() } } @@ -514,45 +509,45 @@ func TestRepositoriesService_CompareCommitsRaw_diff(t *testing.T) { {base: "`~!@#$%^&*()_+-=[]\\{}|;':\",./<>?/*-+123base", head: "head123`~!@#$%^&*()_+-=[]\\{}|;':\",./<>?/*-+"}, } - for _, sample := range testCases { - client, mux, _, teardown := setup() + for i, sample := range testCases { + t.Run(fmt.Sprintf("case #%v", i+1), func(t *testing.T) { + client, mux, _ := setup(t) - base := sample.base - head := sample.head - pattern := fmt.Sprintf("/repos/o/r/compare/%v...%v", base, head) - const rawStr = "@@diff content" + base := sample.base + head := sample.head + pattern := fmt.Sprintf("/repos/o/r/compare/%v...%v", base, head) + const rawStr = "@@diff content" - mux.HandleFunc(pattern, func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - testHeader(t, r, "Accept", mediaTypeV3Diff) - fmt.Fprint(w, rawStr) - }) + mux.HandleFunc(pattern, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testHeader(t, r, "Accept", mediaTypeV3Diff) + fmt.Fprint(w, rawStr) + }) - ctx := context.Background() - got, _, err := client.Repositories.CompareCommitsRaw(ctx, "o", "r", base, head, RawOptions{Type: Diff}) - if err != nil { - t.Fatalf("Repositories.GetCommitRaw returned error: %v", err) - } - want := rawStr - if got != want { - t.Errorf("Repositories.GetCommitRaw returned %s want %s", got, want) - } + ctx := context.Background() + got, _, err := client.Repositories.CompareCommitsRaw(ctx, "o", "r", base, head, RawOptions{Type: Diff}) + if err != nil { + t.Fatalf("Repositories.GetCommitRaw returned error: %v", err) + } + want := rawStr + if got != want { + t.Errorf("Repositories.GetCommitRaw returned %s want %s", got, want) + } - const methodName = "CompareCommitsRaw" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.CompareCommitsRaw(ctx, "\n", "\n", "\n", "\n", RawOptions{Type: Diff}) - return err - }) + const methodName = "CompareCommitsRaw" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.CompareCommitsRaw(ctx, "\n", "\n", "\n", "\n", RawOptions{Type: Diff}) + return err + }) - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.CompareCommitsRaw(ctx, "o", "r", base, head, RawOptions{Type: Diff}) - if got != "" { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want ''", methodName, got) - } - return resp, err + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.CompareCommitsRaw(ctx, "o", "r", base, head, RawOptions{Type: Diff}) + if got != "" { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want ''", methodName, got) + } + return resp, err + }) }) - - teardown() } } @@ -566,31 +561,31 @@ func TestRepositoriesService_CompareCommitsRaw_patch(t *testing.T) { {base: "`~!@#$%^&*()_+-=[]\\{}|;':\",./<>?/*-+123base", head: "head123`~!@#$%^&*()_+-=[]\\{}|;':\",./<>?/*-+"}, } - for _, sample := range testCases { - client, mux, _, teardown := setup() - - base := sample.base - head := sample.head - pattern := fmt.Sprintf("/repos/o/r/compare/%v...%v", base, head) - const rawStr = "@@patch content" + for i, sample := range testCases { + t.Run(fmt.Sprintf("case #%v", i+1), func(t *testing.T) { + client, mux, _ := setup(t) - mux.HandleFunc(pattern, func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - testHeader(t, r, "Accept", mediaTypeV3Patch) - fmt.Fprint(w, rawStr) - }) + base := sample.base + head := sample.head + pattern := fmt.Sprintf("/repos/o/r/compare/%v...%v", base, head) + const rawStr = "@@patch content" - ctx := context.Background() - got, _, err := client.Repositories.CompareCommitsRaw(ctx, "o", "r", base, head, RawOptions{Type: Patch}) - if err != nil { - t.Fatalf("Repositories.GetCommitRaw returned error: %v", err) - } - want := rawStr - if got != want { - t.Errorf("Repositories.GetCommitRaw returned %s want %s", got, want) - } + mux.HandleFunc(pattern, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testHeader(t, r, "Accept", mediaTypeV3Patch) + fmt.Fprint(w, rawStr) + }) - teardown() + ctx := context.Background() + got, _, err := client.Repositories.CompareCommitsRaw(ctx, "o", "r", base, head, RawOptions{Type: Patch}) + if err != nil { + t.Fatalf("Repositories.GetCommitRaw returned error: %v", err) + } + want := rawStr + if got != want { + t.Errorf("Repositories.GetCommitRaw returned %s want %s", got, want) + } + }) } } @@ -606,22 +601,22 @@ func TestRepositoriesService_CompareCommitsRaw_invalid(t *testing.T) { {base: "`~!@#$%^&*()_+-=[]\\{}|;':\",./<>?/*-+123base", head: "head123`~!@#$%^&*()_+-=[]\\{}|;':\",./<>?/*-+"}, } - for _, sample := range testCases { - client, _, _, teardown := setup() - _, _, err := client.Repositories.CompareCommitsRaw(ctx, "o", "r", sample.base, sample.head, RawOptions{100}) - if err == nil { - t.Fatal("Repositories.GetCommitRaw should return error") - } - if !strings.Contains(err.Error(), "unsupported raw type") { - t.Error("Repositories.GetCommitRaw should return unsupported raw type error") - } - teardown() + for i, sample := range testCases { + t.Run(fmt.Sprintf("case #%v", i+1), func(t *testing.T) { + client, _, _ := setup(t) + _, _, err := client.Repositories.CompareCommitsRaw(ctx, "o", "r", sample.base, sample.head, RawOptions{100}) + if err == nil { + t.Fatal("Repositories.GetCommitRaw should return error") + } + if !strings.Contains(err.Error(), "unsupported raw type") { + t.Error("Repositories.GetCommitRaw should return unsupported raw type error") + } + }) } } func TestRepositoriesService_ListBranchesHeadCommit(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/commits/s/branches-where-head", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") diff --git a/github/repos_community_health_test.go b/github/repos_community_health_test.go index 6ff88bda5aa..c5af84f8075 100644 --- a/github/repos_community_health_test.go +++ b/github/repos_community_health_test.go @@ -16,8 +16,7 @@ import ( ) func TestRepositoriesService_GetCommunityHealthMetrics(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/community/profile", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") diff --git a/github/repos_contents_test.go b/github/repos_contents_test.go index 6310e739538..0e30c1bc13d 100644 --- a/github/repos_contents_test.go +++ b/github/repos_contents_test.go @@ -88,8 +88,8 @@ func stringOrNil(s *string) string { } func TestRepositoriesService_GetReadme(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + mux.HandleFunc("/repos/o/r/readme", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `{ @@ -126,8 +126,8 @@ func TestRepositoriesService_GetReadme(t *testing.T) { } func TestRepositoriesService_DownloadContents_Success(t *testing.T) { - client, mux, serverURL, teardown := setup() - defer teardown() + client, mux, serverURL := setup(t) + mux.HandleFunc("/repos/o/r/contents/d", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `[{ @@ -177,8 +177,8 @@ func TestRepositoriesService_DownloadContents_Success(t *testing.T) { } func TestRepositoriesService_DownloadContents_FailedResponse(t *testing.T) { - client, mux, serverURL, teardown := setup() - defer teardown() + client, mux, serverURL := setup(t) + mux.HandleFunc("/repos/o/r/contents/d", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `[{ @@ -215,8 +215,8 @@ func TestRepositoriesService_DownloadContents_FailedResponse(t *testing.T) { } func TestRepositoriesService_DownloadContents_NoDownloadURL(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + mux.HandleFunc("/repos/o/r/contents/d", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `[{ @@ -237,8 +237,8 @@ func TestRepositoriesService_DownloadContents_NoDownloadURL(t *testing.T) { } func TestRepositoriesService_DownloadContents_NoFile(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + mux.HandleFunc("/repos/o/r/contents/d", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `[]`) @@ -256,8 +256,8 @@ func TestRepositoriesService_DownloadContents_NoFile(t *testing.T) { } func TestRepositoriesService_DownloadContentsWithMeta_Success(t *testing.T) { - client, mux, serverURL, teardown := setup() - defer teardown() + client, mux, serverURL := setup(t) + mux.HandleFunc("/repos/o/r/contents/d", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `[{ @@ -318,8 +318,8 @@ func TestRepositoriesService_DownloadContentsWithMeta_Success(t *testing.T) { } func TestRepositoriesService_DownloadContentsWithMeta_FailedResponse(t *testing.T) { - client, mux, serverURL, teardown := setup() - defer teardown() + client, mux, serverURL := setup(t) + mux.HandleFunc("/repos/o/r/contents/d", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `[{ @@ -364,8 +364,8 @@ func TestRepositoriesService_DownloadContentsWithMeta_FailedResponse(t *testing. } func TestRepositoriesService_DownloadContentsWithMeta_NoDownloadURL(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + mux.HandleFunc("/repos/o/r/contents/d", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `[{ @@ -386,8 +386,8 @@ func TestRepositoriesService_DownloadContentsWithMeta_NoDownloadURL(t *testing.T } func TestRepositoriesService_DownloadContentsWithMeta_NoFile(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + mux.HandleFunc("/repos/o/r/contents/d", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `[]`) @@ -405,8 +405,8 @@ func TestRepositoriesService_DownloadContentsWithMeta_NoFile(t *testing.T) { } func TestRepositoriesService_GetContents_File(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + mux.HandleFunc("/repos/o/r/contents/p", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `{ @@ -443,8 +443,8 @@ func TestRepositoriesService_GetContents_File(t *testing.T) { } func TestRepositoriesService_GetContents_FilenameNeedsEscape(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + mux.HandleFunc("/repos/o/r/contents/p#?%/中.go", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `{}`) @@ -457,8 +457,8 @@ func TestRepositoriesService_GetContents_FilenameNeedsEscape(t *testing.T) { } func TestRepositoriesService_GetContents_DirectoryWithSpaces(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + mux.HandleFunc("/repos/o/r/contents/some directory/file.go", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `{}`) @@ -471,8 +471,8 @@ func TestRepositoriesService_GetContents_DirectoryWithSpaces(t *testing.T) { } func TestRepositoriesService_GetContents_PathWithParent(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + mux.HandleFunc("/repos/o/r/contents/some/../directory/file.go", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `{}`) @@ -485,8 +485,8 @@ func TestRepositoriesService_GetContents_PathWithParent(t *testing.T) { } func TestRepositoriesService_GetContents_DirectoryWithPlusChars(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + mux.HandleFunc("/repos/o/r/contents/some directory+name/file.go", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `{}`) @@ -499,8 +499,8 @@ func TestRepositoriesService_GetContents_DirectoryWithPlusChars(t *testing.T) { } func TestRepositoriesService_GetContents_Directory(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + mux.HandleFunc("/repos/o/r/contents/p", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `[{ @@ -528,8 +528,8 @@ func TestRepositoriesService_GetContents_Directory(t *testing.T) { } func TestRepositoriesService_CreateFile(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + mux.HandleFunc("/repos/o/r/contents/p", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") fmt.Fprint(w, `{ @@ -581,8 +581,8 @@ func TestRepositoriesService_CreateFile(t *testing.T) { } func TestRepositoriesService_UpdateFile(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + mux.HandleFunc("/repos/o/r/contents/p", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") fmt.Fprint(w, `{ @@ -636,8 +636,8 @@ func TestRepositoriesService_UpdateFile(t *testing.T) { } func TestRepositoriesService_DeleteFile(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + mux.HandleFunc("/repos/o/r/contents/p", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") fmt.Fprint(w, `{ @@ -687,8 +687,8 @@ func TestRepositoriesService_DeleteFile(t *testing.T) { } func TestRepositoriesService_GetArchiveLink(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + mux.HandleFunc("/repos/o/r/tarball/yo", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") http.Redirect(w, r, "http://github.com/a", http.StatusFound) @@ -723,8 +723,8 @@ func TestRepositoriesService_GetArchiveLink(t *testing.T) { } func TestRepositoriesService_GetArchiveLink_StatusMovedPermanently_dontFollowRedirects(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + mux.HandleFunc("/repos/o/r/tarball", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") http.Redirect(w, r, "http://github.com/a", http.StatusMovedPermanently) @@ -737,8 +737,8 @@ func TestRepositoriesService_GetArchiveLink_StatusMovedPermanently_dontFollowRed } func TestRepositoriesService_GetArchiveLink_StatusMovedPermanently_followRedirects(t *testing.T) { - client, mux, serverURL, teardown := setup() - defer teardown() + client, mux, serverURL := setup(t) + // Mock a redirect link, which leads to an archive link mux.HandleFunc("/repos/o/r/tarball", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -764,8 +764,8 @@ func TestRepositoriesService_GetArchiveLink_StatusMovedPermanently_followRedirec } func TestRepositoriesService_GetContents_NoTrailingSlashInDirectoryApiPath(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) + mux.HandleFunc("/repos/o/r/contents/.github", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") query := r.URL.Query() diff --git a/github/repos_deployment_branch_policies_test.go b/github/repos_deployment_branch_policies_test.go index 9d2acd199d3..047d77a77fb 100644 --- a/github/repos_deployment_branch_policies_test.go +++ b/github/repos_deployment_branch_policies_test.go @@ -14,8 +14,7 @@ import ( ) func TestRepositoriesService_ListDeploymentBranchPolicies(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/environments/e/deployment-branch-policies", func(w http.ResponseWriter, r *http.Request) { fmt.Fprint(w, `{"total_count":2, "branch_policies":[{"id":1}, {"id": 2}]}`) @@ -49,8 +48,7 @@ func TestRepositoriesService_ListDeploymentBranchPolicies(t *testing.T) { } func TestRepositoriesService_GetDeploymentBranchPolicy(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/environments/e/deployment-branch-policies/1", func(w http.ResponseWriter, r *http.Request) { fmt.Fprint(w, `{"id":1}`) @@ -78,8 +76,7 @@ func TestRepositoriesService_GetDeploymentBranchPolicy(t *testing.T) { } func TestRepositoriesService_CreateDeploymentBranchPolicy(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/environments/e/deployment-branch-policies", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -108,8 +105,7 @@ func TestRepositoriesService_CreateDeploymentBranchPolicy(t *testing.T) { } func TestRepositoriesService_UpdateDeploymentBranchPolicy(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/environments/e/deployment-branch-policies/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -138,8 +134,7 @@ func TestRepositoriesService_UpdateDeploymentBranchPolicy(t *testing.T) { } func TestRepositoriesService_DeleteDeploymentBranchPolicy(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/environments/e/deployment-branch-policies/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") diff --git a/github/repos_deployment_protection_rules_test.go b/github/repos_deployment_protection_rules_test.go index d5a6b87acc7..b0073c1ac64 100644 --- a/github/repos_deployment_protection_rules_test.go +++ b/github/repos_deployment_protection_rules_test.go @@ -17,8 +17,7 @@ import ( ) func TestRepositoriesService_GetAllDeploymentProtectionRules(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/environments/e/deployment_protection_rules", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -53,8 +52,7 @@ func TestRepositoriesService_GetAllDeploymentProtectionRules(t *testing.T) { } func TestRepositoriesService_CreateCustomDeploymentProtectionRule(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &CustomDeploymentProtectionRuleRequest{ IntegrationID: Int64(5), @@ -110,8 +108,7 @@ func TestRepositoriesService_CreateCustomDeploymentProtectionRule(t *testing.T) } func TestRepositoriesService_ListCustomDeploymentRuleIntegrations(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/environments/e/deployment_protection_rules/apps", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -146,8 +143,7 @@ func TestRepositoriesService_ListCustomDeploymentRuleIntegrations(t *testing.T) } func TestRepositoriesService_GetCustomDeploymentProtectionRule(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/environments/e/deployment_protection_rules/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -187,8 +183,7 @@ func TestRepositoriesService_GetCustomDeploymentProtectionRule(t *testing.T) { } func TestRepositoriesService_DisableCustomDeploymentProtectionRule(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/environments/e/deployment_protection_rules/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") diff --git a/github/repos_deployments_test.go b/github/repos_deployments_test.go index 4ee2c4f1c32..3c87bb8524a 100644 --- a/github/repos_deployments_test.go +++ b/github/repos_deployments_test.go @@ -17,8 +17,7 @@ import ( ) func TestRepositoriesService_ListDeployments(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/deployments", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -54,8 +53,7 @@ func TestRepositoriesService_ListDeployments(t *testing.T) { } func TestRepositoriesService_GetDeployment(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/deployments/3", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -90,8 +88,7 @@ func TestRepositoriesService_GetDeployment(t *testing.T) { } func TestRepositoriesService_CreateDeployment(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &DeploymentRequest{Ref: String("1111"), Task: String("deploy"), TransientEnvironment: Bool(true)} @@ -136,8 +133,7 @@ func TestRepositoriesService_CreateDeployment(t *testing.T) { } func TestRepositoriesService_DeleteDeployment(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/deployments/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -173,8 +169,7 @@ func TestRepositoriesService_DeleteDeployment(t *testing.T) { } func TestRepositoriesService_ListDeploymentStatuses(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) wantAcceptHeaders := []string{mediaTypeDeploymentStatusPreview, mediaTypeExpandDeploymentStatusPreview} mux.HandleFunc("/repos/o/r/deployments/1/statuses", func(w http.ResponseWriter, r *http.Request) { @@ -212,8 +207,7 @@ func TestRepositoriesService_ListDeploymentStatuses(t *testing.T) { } func TestRepositoriesService_GetDeploymentStatus(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) wantAcceptHeaders := []string{mediaTypeDeploymentStatusPreview, mediaTypeExpandDeploymentStatusPreview} mux.HandleFunc("/repos/o/r/deployments/3/statuses/4", func(w http.ResponseWriter, r *http.Request) { @@ -249,8 +243,7 @@ func TestRepositoriesService_GetDeploymentStatus(t *testing.T) { } func TestRepositoriesService_CreateDeploymentStatus(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &DeploymentStatusRequest{State: String("inactive"), Description: String("deploy"), AutoInactive: Bool(false)} diff --git a/github/repos_environments_test.go b/github/repos_environments_test.go index 870c99003a4..8d093fe272e 100644 --- a/github/repos_environments_test.go +++ b/github/repos_environments_test.go @@ -100,8 +100,7 @@ func TestCreateUpdateEnvironment_MarshalJSON(t *testing.T) { } func TestRepositoriesService_ListEnvironments(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/environments", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -140,8 +139,7 @@ func TestRepositoriesService_ListEnvironments(t *testing.T) { } func TestRepositoriesService_GetEnvironment(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/environments/e", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -175,8 +173,7 @@ func TestRepositoriesService_GetEnvironment(t *testing.T) { } func TestRepositoriesService_CreateEnvironment(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &CreateUpdateEnvironment{ WaitTimer: Int(30), @@ -221,8 +218,7 @@ func TestRepositoriesService_CreateEnvironment(t *testing.T) { } func TestRepositoriesService_CreateEnvironment_noEnterprise(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &CreateUpdateEnvironment{} callCount := 0 @@ -257,8 +253,7 @@ func TestRepositoriesService_CreateEnvironment_noEnterprise(t *testing.T) { } func TestRepositoriesService_createNewEnvNoEnterprise(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &CreateUpdateEnvironment{ DeploymentBranchPolicy: &BranchPolicy{ @@ -325,8 +320,7 @@ func TestRepositoriesService_createNewEnvNoEnterprise(t *testing.T) { } func TestRepositoriesService_DeleteEnvironment(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/environments/e", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") diff --git a/github/repos_forks_test.go b/github/repos_forks_test.go index d1a17f62d1b..e4fa5460540 100644 --- a/github/repos_forks_test.go +++ b/github/repos_forks_test.go @@ -15,8 +15,7 @@ import ( ) func TestRepositoriesService_ListForks(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/forks", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -59,8 +58,7 @@ func TestRepositoriesService_ListForks(t *testing.T) { } func TestRepositoriesService_ListForks_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Repositories.ListForks(ctx, "%", "r", nil) @@ -68,8 +66,7 @@ func TestRepositoriesService_ListForks_invalidOwner(t *testing.T) { } func TestRepositoriesService_CreateFork(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/forks", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -105,8 +102,7 @@ func TestRepositoriesService_CreateFork(t *testing.T) { } func TestRepositoriesService_CreateFork_deferred(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/forks", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -130,8 +126,7 @@ func TestRepositoriesService_CreateFork_deferred(t *testing.T) { } func TestRepositoriesService_CreateFork_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Repositories.CreateFork(ctx, "%", "r", nil) diff --git a/github/repos_hooks_configuration_test.go b/github/repos_hooks_configuration_test.go index 27c43d225d8..c6c54cc3e00 100644 --- a/github/repos_hooks_configuration_test.go +++ b/github/repos_hooks_configuration_test.go @@ -16,8 +16,7 @@ import ( ) func TestRepositoriesService_GetHookConfiguration(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/hooks/1/config", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -56,8 +55,7 @@ func TestRepositoriesService_GetHookConfiguration(t *testing.T) { } func TestRepositoriesService_GetHookConfiguration_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Repositories.GetHookConfiguration(ctx, "%", "%", 1) @@ -65,8 +63,7 @@ func TestRepositoriesService_GetHookConfiguration_invalidOrg(t *testing.T) { } func TestRepositoriesService_EditHookConfiguration(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &HookConfig{} @@ -114,8 +111,7 @@ func TestRepositoriesService_EditHookConfiguration(t *testing.T) { } func TestRepositoriesService_EditHookConfiguration_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Repositories.EditHookConfiguration(ctx, "%", "%", 1, nil) diff --git a/github/repos_hooks_deliveries_test.go b/github/repos_hooks_deliveries_test.go index 057d7121df4..9f6e1d3bed0 100644 --- a/github/repos_hooks_deliveries_test.go +++ b/github/repos_hooks_deliveries_test.go @@ -17,8 +17,7 @@ import ( ) func TestRepositoriesService_ListHookDeliveries(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/hooks/1/deliveries", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -55,8 +54,7 @@ func TestRepositoriesService_ListHookDeliveries(t *testing.T) { } func TestRepositoriesService_ListHookDeliveries_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Repositories.ListHookDeliveries(ctx, "%", "%", 1, nil) @@ -64,8 +62,7 @@ func TestRepositoriesService_ListHookDeliveries_invalidOwner(t *testing.T) { } func TestRepositoriesService_GetHookDelivery(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/hooks/1/deliveries/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -99,8 +96,7 @@ func TestRepositoriesService_GetHookDelivery(t *testing.T) { } func TestRepositoriesService_GetHookDelivery_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Repositories.GetHookDelivery(ctx, "%", "%", 1, 1) @@ -108,8 +104,7 @@ func TestRepositoriesService_GetHookDelivery_invalidOwner(t *testing.T) { } func TestRepositoriesService_RedeliverHookDelivery(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/hooks/1/deliveries/1/attempts", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") diff --git a/github/repos_hooks_test.go b/github/repos_hooks_test.go index bda277af735..a56e68f39ed 100644 --- a/github/repos_hooks_test.go +++ b/github/repos_hooks_test.go @@ -16,8 +16,7 @@ import ( ) func TestRepositoriesService_CreateHook(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &Hook{CreatedAt: &Timestamp{referenceTime}} @@ -61,8 +60,7 @@ func TestRepositoriesService_CreateHook(t *testing.T) { } func TestRepositoriesService_ListHooks(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/hooks", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -99,8 +97,7 @@ func TestRepositoriesService_ListHooks(t *testing.T) { } func TestRepositoriesService_ListHooks_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Repositories.ListHooks(ctx, "%", "%", nil) @@ -116,8 +113,7 @@ func TestRepositoriesService_ListHooks_404_code(t *testing.T) { } func TestRepositoriesService_GetHook(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/hooks/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -151,8 +147,7 @@ func TestRepositoriesService_GetHook(t *testing.T) { } func TestRepositoriesService_GetHook_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Repositories.GetHook(ctx, "%", "%", 1) @@ -160,8 +155,7 @@ func TestRepositoriesService_GetHook_invalidOwner(t *testing.T) { } func TestRepositoriesService_EditHook(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &Hook{} @@ -204,8 +198,7 @@ func TestRepositoriesService_EditHook(t *testing.T) { } func TestRepositoriesService_EditHook_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Repositories.EditHook(ctx, "%", "%", 1, nil) @@ -213,8 +206,7 @@ func TestRepositoriesService_EditHook_invalidOwner(t *testing.T) { } func TestRepositoriesService_DeleteHook(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/hooks/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -238,8 +230,7 @@ func TestRepositoriesService_DeleteHook(t *testing.T) { } func TestRepositoriesService_DeleteHook_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Repositories.DeleteHook(ctx, "%", "%", 1) @@ -247,8 +238,7 @@ func TestRepositoriesService_DeleteHook_invalidOwner(t *testing.T) { } func TestRepositoriesService_PingHook(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/hooks/1/pings", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -272,8 +262,7 @@ func TestRepositoriesService_PingHook(t *testing.T) { } func TestRepositoriesService_TestHook(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/hooks/1/tests", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -297,8 +286,7 @@ func TestRepositoriesService_TestHook(t *testing.T) { } func TestRepositoriesService_TestHook_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Repositories.TestHook(ctx, "%", "%", 1) @@ -386,7 +374,7 @@ func TestBranchWebHookPayload_Marshal(t *testing.T) { "email": "abc@gmail.com", "name": "abc", "username": "abc_12" - }, + }, "id": "1", "message": "WebHookCommit", "modified": ["abc", "efg", "erd"], @@ -407,7 +395,7 @@ func TestBranchWebHookPayload_Marshal(t *testing.T) { "email": "abc@gmail.com", "name": "abc", "username": "abc_12" - }, + }, "id": "1", "message": "WebHookCommit", "modified": ["abc", "efg", "erd"], @@ -485,7 +473,7 @@ func TestBranchWebHookCommit_Marshal(t *testing.T) { "email": "abc@gmail.com", "name": "abc", "username": "abc_12" - }, + }, "id": "1", "message": "WebHookCommit", "modified": ["abc", "efg", "erd"], @@ -553,15 +541,14 @@ func TestBranchHook_Marshal(t *testing.T) { "content_type": "json" }, "events": ["1","2","3"], - "active": true + "active": true }` testJSONMarshal(t, v, want) } func TestRepositoriesService_Subscribe(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/hub", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, http.MethodPost) @@ -593,8 +580,7 @@ func TestRepositoriesService_Subscribe(t *testing.T) { } func TestRepositoriesService_Unsubscribe(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/hub", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, http.MethodPost) diff --git a/github/repos_invitations_test.go b/github/repos_invitations_test.go index 74bda793753..b32a2690595 100644 --- a/github/repos_invitations_test.go +++ b/github/repos_invitations_test.go @@ -15,8 +15,7 @@ import ( ) func TestRepositoriesService_ListInvitations(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/invitations", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -52,8 +51,7 @@ func TestRepositoriesService_ListInvitations(t *testing.T) { } func TestRepositoriesService_DeleteInvitation(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/invitations/2", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -78,8 +76,7 @@ func TestRepositoriesService_DeleteInvitation(t *testing.T) { } func TestRepositoriesService_UpdateInvitation(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/invitations/2", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") diff --git a/github/repos_keys_test.go b/github/repos_keys_test.go index 8c29c126ee0..c1429b7d9bc 100644 --- a/github/repos_keys_test.go +++ b/github/repos_keys_test.go @@ -16,8 +16,7 @@ import ( ) func TestRepositoriesService_ListKeys(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/keys", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -53,8 +52,7 @@ func TestRepositoriesService_ListKeys(t *testing.T) { } func TestRepositoriesService_ListKeys_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Repositories.ListKeys(ctx, "%", "%", nil) @@ -62,8 +60,7 @@ func TestRepositoriesService_ListKeys_invalidOwner(t *testing.T) { } func TestRepositoriesService_GetKey(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/keys/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -97,8 +94,7 @@ func TestRepositoriesService_GetKey(t *testing.T) { } func TestRepositoriesService_GetKey_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Repositories.GetKey(ctx, "%", "%", 1) @@ -106,8 +102,7 @@ func TestRepositoriesService_GetKey_invalidOwner(t *testing.T) { } func TestRepositoriesService_CreateKey(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &Key{Key: String("k"), Title: String("t")} @@ -150,8 +145,7 @@ func TestRepositoriesService_CreateKey(t *testing.T) { } func TestRepositoriesService_CreateKey_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Repositories.CreateKey(ctx, "%", "%", nil) @@ -159,8 +153,7 @@ func TestRepositoriesService_CreateKey_invalidOwner(t *testing.T) { } func TestRepositoriesService_DeleteKey(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/keys/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -184,8 +177,7 @@ func TestRepositoriesService_DeleteKey(t *testing.T) { } func TestRepositoriesService_DeleteKey_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Repositories.DeleteKey(ctx, "%", "%", 1) diff --git a/github/repos_lfs_test.go b/github/repos_lfs_test.go index f171b6e36af..a503adfd830 100644 --- a/github/repos_lfs_test.go +++ b/github/repos_lfs_test.go @@ -12,8 +12,7 @@ import ( ) func TestRepositoriesService_EnableLFS(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/lfs", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -38,8 +37,7 @@ func TestRepositoriesService_EnableLFS(t *testing.T) { } func TestRepositoriesService_DisableLFS(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/lfs", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") diff --git a/github/repos_merging_test.go b/github/repos_merging_test.go index b4c50178ab9..1303fa21d6b 100644 --- a/github/repos_merging_test.go +++ b/github/repos_merging_test.go @@ -16,8 +16,7 @@ import ( ) func TestRepositoriesService_Merge(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &RepositoryMergeRequest{ Base: String("b"), @@ -82,8 +81,7 @@ func TestRepositoryMergeRequest_Marshal(t *testing.T) { } func TestRepositoriesService_MergeUpstream(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &RepoMergeUpstreamRequest{ Branch: String("b"), diff --git a/github/repos_pages_test.go b/github/repos_pages_test.go index 5dd735c00fb..4b134982111 100644 --- a/github/repos_pages_test.go +++ b/github/repos_pages_test.go @@ -18,8 +18,7 @@ import ( ) func TestRepositoriesService_EnablePagesLegacy(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &Pages{ BuildType: String("legacy"), @@ -72,8 +71,7 @@ func TestRepositoriesService_EnablePagesLegacy(t *testing.T) { } func TestRepositoriesService_EnablePagesWorkflow(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &Pages{ BuildType: String("workflow"), @@ -122,8 +120,7 @@ func TestRepositoriesService_EnablePagesWorkflow(t *testing.T) { } func TestRepositoriesService_UpdatePagesLegacy(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &PagesUpdate{ CNAME: String("www.my-domain.com"), @@ -162,8 +159,7 @@ func TestRepositoriesService_UpdatePagesLegacy(t *testing.T) { } func TestRepositoriesService_UpdatePagesWorkflow(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &PagesUpdate{ CNAME: String("www.my-domain.com"), @@ -201,8 +197,7 @@ func TestRepositoriesService_UpdatePagesWorkflow(t *testing.T) { } func TestRepositoriesService_UpdatePages_NullCNAME(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &PagesUpdate{ Source: &PagesSource{Branch: String("gh-pages")}, @@ -230,8 +225,7 @@ func TestRepositoriesService_UpdatePages_NullCNAME(t *testing.T) { } func TestRepositoriesService_DisablePages(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pages", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -256,8 +250,7 @@ func TestRepositoriesService_DisablePages(t *testing.T) { } func TestRepositoriesService_GetPagesInfo(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pages", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -291,8 +284,7 @@ func TestRepositoriesService_GetPagesInfo(t *testing.T) { } func TestRepositoriesService_ListPagesBuilds(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pages/builds", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -326,8 +318,7 @@ func TestRepositoriesService_ListPagesBuilds(t *testing.T) { } func TestRepositoriesService_ListPagesBuilds_withOptions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pages/builds", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -345,8 +336,7 @@ func TestRepositoriesService_ListPagesBuilds_withOptions(t *testing.T) { } func TestRepositoriesService_GetLatestPagesBuild(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pages/builds/latest", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -380,8 +370,7 @@ func TestRepositoriesService_GetLatestPagesBuild(t *testing.T) { } func TestRepositoriesService_GetPageBuild(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pages/builds/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -415,8 +404,7 @@ func TestRepositoriesService_GetPageBuild(t *testing.T) { } func TestRepositoriesService_RequestPageBuild(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pages/builds", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -450,8 +438,7 @@ func TestRepositoriesService_RequestPageBuild(t *testing.T) { } func TestRepositoriesService_GetPageHealthCheck(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pages/health", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") diff --git a/github/repos_prereceive_hooks_test.go b/github/repos_prereceive_hooks_test.go index b286068047b..807ec1d0808 100644 --- a/github/repos_prereceive_hooks_test.go +++ b/github/repos_prereceive_hooks_test.go @@ -16,8 +16,7 @@ import ( ) func TestRepositoriesService_ListPreReceiveHooks(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pre-receive-hooks", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -55,8 +54,7 @@ func TestRepositoriesService_ListPreReceiveHooks(t *testing.T) { } func TestRepositoriesService_ListPreReceiveHooks_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Repositories.ListPreReceiveHooks(ctx, "%", "%", nil) @@ -64,8 +62,7 @@ func TestRepositoriesService_ListPreReceiveHooks_invalidOwner(t *testing.T) { } func TestRepositoriesService_GetPreReceiveHook(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pre-receive-hooks/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -100,8 +97,7 @@ func TestRepositoriesService_GetPreReceiveHook(t *testing.T) { } func TestRepositoriesService_GetPreReceiveHook_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Repositories.GetPreReceiveHook(ctx, "%", "%", 1) @@ -109,8 +105,7 @@ func TestRepositoriesService_GetPreReceiveHook_invalidOwner(t *testing.T) { } func TestRepositoriesService_UpdatePreReceiveHook(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &PreReceiveHook{} @@ -153,8 +148,7 @@ func TestRepositoriesService_UpdatePreReceiveHook(t *testing.T) { } func TestRepositoriesService_PreReceiveHook_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Repositories.UpdatePreReceiveHook(ctx, "%", "%", 1, nil) @@ -162,8 +156,7 @@ func TestRepositoriesService_PreReceiveHook_invalidOwner(t *testing.T) { } func TestRepositoriesService_DeletePreReceiveHook(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pre-receive-hooks/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -187,8 +180,7 @@ func TestRepositoriesService_DeletePreReceiveHook(t *testing.T) { } func TestRepositoriesService_DeletePreReceiveHook_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Repositories.DeletePreReceiveHook(ctx, "%", "%", 1) diff --git a/github/repos_projects_test.go b/github/repos_projects_test.go index f3818414219..b0e02738330 100644 --- a/github/repos_projects_test.go +++ b/github/repos_projects_test.go @@ -16,8 +16,7 @@ import ( ) func TestRepositoriesService_ListProjects(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/projects", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -54,8 +53,7 @@ func TestRepositoriesService_ListProjects(t *testing.T) { } func TestRepositoriesService_CreateProject(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &ProjectOptions{Name: String("Project Name"), Body: String("Project body.")} diff --git a/github/repos_properties_test.go b/github/repos_properties_test.go index 4434856c8c2..012d7c548d9 100644 --- a/github/repos_properties_test.go +++ b/github/repos_properties_test.go @@ -15,8 +15,7 @@ import ( ) func TestRepositoriesService_GetAllCustomPropertyValues(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/properties/values", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -81,8 +80,7 @@ func TestRepositoriesService_GetAllCustomPropertyValues(t *testing.T) { } func TestRepositoriesService_CreateOrUpdateCustomProperties(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/usr/r/properties/values", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") diff --git a/github/repos_releases_test.go b/github/repos_releases_test.go index 2cca2bd570e..dcd5066c12d 100644 --- a/github/repos_releases_test.go +++ b/github/repos_releases_test.go @@ -19,8 +19,7 @@ import ( ) func TestRepositoriesService_ListReleases(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/releases", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -55,8 +54,7 @@ func TestRepositoriesService_ListReleases(t *testing.T) { } func TestRepositoriesService_GenerateReleaseNotes(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/releases/generate-notes", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -96,8 +94,7 @@ func TestRepositoriesService_GenerateReleaseNotes(t *testing.T) { } func TestRepositoriesService_GetRelease(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/releases/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -131,8 +128,7 @@ func TestRepositoriesService_GetRelease(t *testing.T) { } func TestRepositoriesService_GetLatestRelease(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/releases/latest", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -166,8 +162,7 @@ func TestRepositoriesService_GetLatestRelease(t *testing.T) { } func TestRepositoriesService_GetReleaseByTag(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/releases/tags/foo", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -201,8 +196,7 @@ func TestRepositoriesService_GetReleaseByTag(t *testing.T) { } func TestRepositoriesService_CreateRelease(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &RepositoryRelease{ Name: String("v1.0"), @@ -266,8 +260,7 @@ func TestRepositoriesService_CreateRelease(t *testing.T) { } func TestRepositoriesService_EditRelease(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &RepositoryRelease{ Name: String("n"), @@ -329,8 +322,7 @@ func TestRepositoriesService_EditRelease(t *testing.T) { } func TestRepositoriesService_DeleteRelease(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/releases/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -354,8 +346,7 @@ func TestRepositoriesService_DeleteRelease(t *testing.T) { } func TestRepositoriesService_ListReleaseAssets(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/releases/1/assets", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -390,8 +381,7 @@ func TestRepositoriesService_ListReleaseAssets(t *testing.T) { } func TestRepositoriesService_GetReleaseAsset(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/releases/assets/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -424,8 +414,7 @@ func TestRepositoriesService_GetReleaseAsset(t *testing.T) { } func TestRepositoriesService_DownloadReleaseAsset_Stream(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/releases/assets/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -457,8 +446,7 @@ func TestRepositoriesService_DownloadReleaseAsset_Stream(t *testing.T) { } func TestRepositoriesService_DownloadReleaseAsset_Redirect(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/releases/assets/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -478,8 +466,7 @@ func TestRepositoriesService_DownloadReleaseAsset_Redirect(t *testing.T) { } func TestRepositoriesService_DownloadReleaseAsset_FollowRedirect(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/releases/assets/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -512,8 +499,7 @@ func TestRepositoriesService_DownloadReleaseAsset_FollowRedirect(t *testing.T) { } func TestRepositoriesService_DownloadReleaseAsset_FollowRedirectToError(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/releases/assets/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -542,8 +528,7 @@ func TestRepositoriesService_DownloadReleaseAsset_FollowRedirectToError(t *testi } func TestRepositoriesService_DownloadReleaseAsset_APIError(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/releases/assets/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -569,8 +554,7 @@ func TestRepositoriesService_DownloadReleaseAsset_APIError(t *testing.T) { } func TestRepositoriesService_EditReleaseAsset(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &ReleaseAsset{Name: String("n")} @@ -611,8 +595,7 @@ func TestRepositoriesService_EditReleaseAsset(t *testing.T) { } func TestRepositoriesService_DeleteReleaseAsset(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/releases/assets/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -691,8 +674,7 @@ func TestRepositoriesService_UploadReleaseAsset(t *testing.T) { }, } - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) for key, test := range uploadTests { releaseEndpoint := fmt.Sprintf("/repos/o/r/releases/%d/assets", key) diff --git a/github/repos_rules_test.go b/github/repos_rules_test.go index 6daf753432e..0c4c4072069 100644 --- a/github/repos_rules_test.go +++ b/github/repos_rules_test.go @@ -375,8 +375,7 @@ func TestRepositoryRule_UnmarshalJSON(t *testing.T) { } func TestRepositoriesService_GetRulesForBranch(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/repo/rules/branches/branch", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -436,8 +435,7 @@ func TestRepositoriesService_GetRulesForBranch(t *testing.T) { } func TestRepositoriesService_GetRulesForBranchEmptyUpdateRule(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/repo/rules/branches/branch", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -475,8 +473,7 @@ func TestRepositoriesService_GetRulesForBranchEmptyUpdateRule(t *testing.T) { } func TestRepositoriesService_GetAllRulesets(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/repo/rulesets", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -536,8 +533,7 @@ func TestRepositoriesService_GetAllRulesets(t *testing.T) { } func TestRepositoriesService_CreateRuleset(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/repo/rulesets", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -582,8 +578,7 @@ func TestRepositoriesService_CreateRuleset(t *testing.T) { } func TestRepositoriesService_CreateRulesetWithPushRules(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/repo/rulesets", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -670,8 +665,7 @@ func TestRepositoriesService_CreateRulesetWithPushRules(t *testing.T) { } func TestRepositoriesService_GetRuleset(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/repo/rulesets/42", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -713,8 +707,7 @@ func TestRepositoriesService_GetRuleset(t *testing.T) { } func TestRepositoriesService_UpdateRulesetNoBypassActor(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) rs := &Ruleset{ Name: "ruleset", @@ -765,8 +758,7 @@ func TestRepositoriesService_UpdateRulesetNoBypassActor(t *testing.T) { } func TestRepositoriesService_UpdateRuleset(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/repo/rulesets/42", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -812,8 +804,7 @@ func TestRepositoriesService_UpdateRuleset(t *testing.T) { } func TestRepositoriesService_DeleteRuleset(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/repo/rulesets/42", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") diff --git a/github/repos_stats_test.go b/github/repos_stats_test.go index 1babaca6e2a..4d8511cc505 100644 --- a/github/repos_stats_test.go +++ b/github/repos_stats_test.go @@ -16,8 +16,7 @@ import ( ) func TestRepositoriesService_ListContributorsStats(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/stats/contributors", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -87,8 +86,7 @@ func TestRepositoriesService_ListContributorsStats(t *testing.T) { } func TestRepositoriesService_ListCommitActivity(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/stats/commit_activity", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -138,8 +136,7 @@ func TestRepositoriesService_ListCommitActivity(t *testing.T) { } func TestRepositoriesService_ListCodeFrequency(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/stats/code_frequency", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -179,8 +176,7 @@ func TestRepositoriesService_ListCodeFrequency(t *testing.T) { } func TestRepositoriesService_Participation(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/stats/participation", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -244,8 +240,7 @@ func TestRepositoriesService_Participation(t *testing.T) { } func TestRepositoriesService_ListPunchCard(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/stats/punch_card", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -289,8 +284,7 @@ func TestRepositoriesService_ListPunchCard(t *testing.T) { } func TestRepositoriesService_AcceptedError(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/stats/contributors", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") diff --git a/github/repos_statuses_test.go b/github/repos_statuses_test.go index cd9b0db70bb..e586a7a29ef 100644 --- a/github/repos_statuses_test.go +++ b/github/repos_statuses_test.go @@ -16,8 +16,7 @@ import ( ) func TestRepositoriesService_ListStatuses(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/commits/r/statuses", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -53,8 +52,7 @@ func TestRepositoriesService_ListStatuses(t *testing.T) { } func TestRepositoriesService_ListStatuses_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Repositories.ListStatuses(ctx, "%", "r", "r", nil) @@ -62,8 +60,7 @@ func TestRepositoriesService_ListStatuses_invalidOwner(t *testing.T) { } func TestRepositoriesService_CreateStatus(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &RepoStatus{State: String("s"), TargetURL: String("t"), Description: String("d")} @@ -105,8 +102,7 @@ func TestRepositoriesService_CreateStatus(t *testing.T) { } func TestRepositoriesService_CreateStatus_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Repositories.CreateStatus(ctx, "%", "r", "r", nil) @@ -114,8 +110,7 @@ func TestRepositoriesService_CreateStatus_invalidOwner(t *testing.T) { } func TestRepositoriesService_GetCombinedStatus(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/commits/r/status", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") diff --git a/github/repos_tags_test.go b/github/repos_tags_test.go index 0195706fe69..577ce56b3dd 100644 --- a/github/repos_tags_test.go +++ b/github/repos_tags_test.go @@ -16,8 +16,7 @@ import ( ) func TestRepositoriesService_ListTagProtection(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/tags/protection", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -52,8 +51,7 @@ func TestRepositoriesService_ListTagProtection(t *testing.T) { } func TestRepositoriesService_ListTagProtection_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Repositories.ListTagProtection(ctx, "%", "r") @@ -61,8 +59,7 @@ func TestRepositoriesService_ListTagProtection_invalidOwner(t *testing.T) { } func TestRepositoriesService_CreateTagProtection(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) pattern := "tag*" @@ -106,8 +103,7 @@ func TestRepositoriesService_CreateTagProtection(t *testing.T) { } func TestRepositoriesService_DeleteTagProtection(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/tags/protection/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") diff --git a/github/repos_test.go b/github/repos_test.go index f18828067d1..0059a20993c 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -20,8 +20,7 @@ import ( ) func TestRepositoriesService_ListByAuthenticatedUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/repos", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -51,8 +50,7 @@ func TestRepositoriesService_ListByAuthenticatedUser(t *testing.T) { } func TestRepositoriesService_ListByUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/repos", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -96,8 +94,7 @@ func TestRepositoriesService_ListByUser(t *testing.T) { } func TestRepositoriesService_ListByUser_type(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/repos", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -123,8 +120,7 @@ func TestRepositoriesService_ListByUser_type(t *testing.T) { } func TestRepositoriesService_ListByUser_invalidUser(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Repositories.ListByUser(ctx, "%", nil) @@ -132,8 +128,7 @@ func TestRepositoriesService_ListByUser_invalidUser(t *testing.T) { } func TestRepositoriesService_ListByOrg(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) wantAcceptHeaders := []string{mediaTypeTopicsPreview, mediaTypeRepositoryVisibilityPreview} mux.HandleFunc("/orgs/o/repos", func(w http.ResponseWriter, r *http.Request) { @@ -177,8 +172,7 @@ func TestRepositoriesService_ListByOrg(t *testing.T) { } func TestRepositoriesService_ListByOrg_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Repositories.ListByOrg(ctx, "%", nil) @@ -186,8 +180,7 @@ func TestRepositoriesService_ListByOrg_invalidOrg(t *testing.T) { } func TestRepositoriesService_ListAll(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repositories", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -220,8 +213,7 @@ func TestRepositoriesService_ListAll(t *testing.T) { } func TestRepositoriesService_Create_user(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &Repository{ Name: String("n"), @@ -270,8 +262,7 @@ func TestRepositoriesService_Create_user(t *testing.T) { } func TestRepositoriesService_Create_org(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &Repository{ Name: String("n"), @@ -306,8 +297,7 @@ func TestRepositoriesService_Create_org(t *testing.T) { } func TestRepositoriesService_CreateFromTemplate(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) templateRepoReq := &TemplateRepoRequest{ Name: String("n"), @@ -354,8 +344,7 @@ func TestRepositoriesService_CreateFromTemplate(t *testing.T) { } func TestRepositoriesService_Get(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) wantAcceptHeaders := []string{mediaTypeCodesOfConductPreview, mediaTypeTopicsPreview, mediaTypeRepositoryTemplatePreview, mediaTypeRepositoryVisibilityPreview} mux.HandleFunc("/repos/o/r", func(w http.ResponseWriter, r *http.Request) { @@ -391,8 +380,7 @@ func TestRepositoriesService_Get(t *testing.T) { } func TestRepositoriesService_GetCodeOfConduct(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -440,8 +428,7 @@ func TestRepositoriesService_GetCodeOfConduct(t *testing.T) { } func TestRepositoriesService_GetByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repositories/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -470,8 +457,7 @@ func TestRepositoriesService_GetByID(t *testing.T) { } func TestRepositoriesService_Edit(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) i := true input := &Repository{HasIssues: &i} @@ -516,8 +502,7 @@ func TestRepositoriesService_Edit(t *testing.T) { } func TestRepositoriesService_Delete(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -541,8 +526,7 @@ func TestRepositoriesService_Delete(t *testing.T) { } func TestRepositoriesService_Get_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Repositories.Get(ctx, "%", "r") @@ -550,8 +534,7 @@ func TestRepositoriesService_Get_invalidOwner(t *testing.T) { } func TestRepositoriesService_Edit_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Repositories.Edit(ctx, "%", "r", nil) @@ -559,8 +542,7 @@ func TestRepositoriesService_Edit_invalidOwner(t *testing.T) { } func TestRepositoriesService_GetVulnerabilityAlerts(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/vulnerability-alerts", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -595,8 +577,7 @@ func TestRepositoriesService_GetVulnerabilityAlerts(t *testing.T) { } func TestRepositoriesService_EnableVulnerabilityAlerts(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/vulnerability-alerts", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -622,8 +603,7 @@ func TestRepositoriesService_EnableVulnerabilityAlerts(t *testing.T) { } func TestRepositoriesService_DisableVulnerabilityAlerts(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/vulnerability-alerts", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -649,8 +629,7 @@ func TestRepositoriesService_DisableVulnerabilityAlerts(t *testing.T) { } func TestRepositoriesService_EnableAutomatedSecurityFixes(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/automated-security-fixes", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -665,8 +644,7 @@ func TestRepositoriesService_EnableAutomatedSecurityFixes(t *testing.T) { } func TestRepositoriesService_GetAutomatedSecurityFixes(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/automated-security-fixes", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -702,8 +680,7 @@ func TestRepositoriesService_GetAutomatedSecurityFixes(t *testing.T) { } func TestRepositoriesService_DisableAutomatedSecurityFixes(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/automated-security-fixes", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -718,8 +695,7 @@ func TestRepositoriesService_DisableAutomatedSecurityFixes(t *testing.T) { } func TestRepositoriesService_ListContributors(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/contributors", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -758,8 +734,7 @@ func TestRepositoriesService_ListContributors(t *testing.T) { } func TestRepositoriesService_ListLanguages(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/languages", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -793,8 +768,7 @@ func TestRepositoriesService_ListLanguages(t *testing.T) { } func TestRepositoriesService_ListTeams(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/teams", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -830,8 +804,7 @@ func TestRepositoriesService_ListTeams(t *testing.T) { } func TestRepositoriesService_ListTags(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/tags", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -877,8 +850,7 @@ func TestRepositoriesService_ListTags(t *testing.T) { } func TestRepositoriesService_ListBranches(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/branches", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -917,8 +889,7 @@ func TestRepositoriesService_ListBranches(t *testing.T) { } func TestRepositoriesService_GetBranch(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) tests := []struct { branch string @@ -979,8 +950,7 @@ func TestRepositoriesService_GetBranch_BadJSONResponse(t *testing.T) { for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -996,8 +966,7 @@ func TestRepositoriesService_GetBranch_BadJSONResponse(t *testing.T) { } func TestRepositoriesService_GetBranch_StatusMovedPermanently_followRedirects(t *testing.T) { - client, mux, serverURL, teardown := setup() - defer teardown() + client, mux, serverURL := setup(t) mux.HandleFunc("/repos/o/r/branches/b", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -1048,8 +1017,7 @@ func TestRepositoriesService_GetBranch_notFound(t *testing.T) { for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -1089,8 +1057,7 @@ func TestRepositoriesService_RenameBranch(t *testing.T) { for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) renameBranchReq := "nn" @@ -1147,8 +1114,7 @@ func TestRepositoriesService_GetBranchProtection(t *testing.T) { for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -1292,8 +1258,7 @@ func TestRepositoriesService_GetBranchProtection(t *testing.T) { } func TestRepositoriesService_GetBranchProtection_noDismissalRestrictions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) tests := []struct { branch string @@ -1388,8 +1353,7 @@ func TestRepositoriesService_GetBranchProtection_branchNotProtected(t *testing.T for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -1426,8 +1390,7 @@ func TestRepositoriesService_UpdateBranchProtection_Contexts(t *testing.T) { for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &ProtectionRequest{ RequiredStatusChecks: &RequiredStatusChecks{ @@ -1614,8 +1577,7 @@ func TestRepositoriesService_UpdateBranchProtection_EmptyContexts(t *testing.T) for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &ProtectionRequest{ RequiredStatusChecks: &RequiredStatusChecks{ @@ -1792,8 +1754,7 @@ func TestRepositoriesService_UpdateBranchProtection_Checks(t *testing.T) { for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &ProtectionRequest{ RequiredStatusChecks: &RequiredStatusChecks{ @@ -1949,8 +1910,7 @@ func TestRepositoriesService_UpdateBranchProtection_EmptyChecks(t *testing.T) { for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &ProtectionRequest{ RequiredStatusChecks: &RequiredStatusChecks{ @@ -2092,8 +2052,7 @@ func TestRepositoriesService_UpdateBranchProtection_StrictNoChecks(t *testing.T) for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &ProtectionRequest{ RequiredStatusChecks: &RequiredStatusChecks{ @@ -2234,8 +2193,7 @@ func TestRepositoriesService_UpdateBranchProtection_RequireLastPushApproval(t *t for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &ProtectionRequest{ RequiredPullRequestReviews: &PullRequestReviewsEnforcementRequest{ @@ -2288,8 +2246,7 @@ func TestRepositoriesService_RemoveBranchProtection(t *testing.T) { for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -2316,8 +2273,7 @@ func TestRepositoriesService_RemoveBranchProtection(t *testing.T) { } func TestRepositoriesService_ListLanguages_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Repositories.ListLanguages(ctx, "%", "%") @@ -2325,8 +2281,7 @@ func TestRepositoriesService_ListLanguages_invalidOwner(t *testing.T) { } func TestRepositoriesService_License(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/license", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -2381,8 +2336,7 @@ func TestRepositoriesService_GetRequiredStatusChecks(t *testing.T) { for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -2459,8 +2413,7 @@ func TestRepositoriesService_GetRequiredStatusChecks_branchNotProtected(t *testi for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -2497,8 +2450,7 @@ func TestRepositoriesService_UpdateRequiredStatusChecks_Contexts(t *testing.T) { for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &RequiredStatusChecksRequest{ Strict: Bool(true), @@ -2573,8 +2525,7 @@ func TestRepositoriesService_UpdateRequiredStatusChecks_Checks(t *testing.T) { for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) appID := int64(123) noAppID := int64(-1) @@ -2664,8 +2615,7 @@ func TestRepositoriesService_RemoveRequiredStatusChecks(t *testing.T) { for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -2703,8 +2653,7 @@ func TestRepositoriesService_ListRequiredStatusChecksContexts(t *testing.T) { for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -2750,8 +2699,7 @@ func TestRepositoriesService_ListRequiredStatusChecksContexts_branchNotProtected for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -2788,8 +2736,7 @@ func TestRepositoriesService_GetPullRequestReviewEnforcement(t *testing.T) { for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -2862,8 +2809,7 @@ func TestRepositoriesService_UpdatePullRequestReviewEnforcement(t *testing.T) { for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &PullRequestReviewsEnforcementUpdate{ DismissalRestrictionsRequest: &DismissalRestrictionsRequest{ @@ -2949,8 +2895,7 @@ func TestRepositoriesService_DisableDismissalRestrictions(t *testing.T) { for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") @@ -3004,8 +2949,7 @@ func TestRepositoriesService_RemovePullRequestReviewEnforcement(t *testing.T) { for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -3042,8 +2986,7 @@ func TestRepositoriesService_GetAdminEnforcement(t *testing.T) { for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -3093,8 +3036,7 @@ func TestRepositoriesService_AddAdminEnforcement(t *testing.T) { for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -3143,8 +3085,7 @@ func TestRepositoriesService_RemoveAdminEnforcement(t *testing.T) { for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -3181,8 +3122,7 @@ func TestRepositoriesService_GetSignaturesProtectedBranch(t *testing.T) { for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -3233,8 +3173,7 @@ func TestRepositoriesService_RequireSignaturesOnProtectedBranch(t *testing.T) { for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -3285,8 +3224,7 @@ func TestRepositoriesService_OptionalSignaturesOnProtectedBranch(t *testing.T) { for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -3361,8 +3299,7 @@ func TestPullRequestReviewsEnforcementRequest_MarshalJSON_nilDismissalRestirctio } func TestRepositoriesService_ListAllTopics(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/topics", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -3397,8 +3334,7 @@ func TestRepositoriesService_ListAllTopics(t *testing.T) { } func TestRepositoriesService_ListAllTopics_emptyTopics(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/topics", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -3419,8 +3355,7 @@ func TestRepositoriesService_ListAllTopics_emptyTopics(t *testing.T) { } func TestRepositoriesService_ReplaceAllTopics(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/topics", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -3455,8 +3390,7 @@ func TestRepositoriesService_ReplaceAllTopics(t *testing.T) { } func TestRepositoriesService_ReplaceAllTopics_nilSlice(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/topics", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -3478,8 +3412,7 @@ func TestRepositoriesService_ReplaceAllTopics_nilSlice(t *testing.T) { } func TestRepositoriesService_ReplaceAllTopics_emptySlice(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/topics", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -3511,8 +3444,7 @@ func TestRepositoriesService_ListAppRestrictions(t *testing.T) { for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -3552,8 +3484,7 @@ func TestRepositoriesService_ReplaceAppRestrictions(t *testing.T) { for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -3602,8 +3533,7 @@ func TestRepositoriesService_AddAppRestrictions(t *testing.T) { for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -3652,8 +3582,7 @@ func TestRepositoriesService_RemoveAppRestrictions(t *testing.T) { for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -3698,8 +3627,7 @@ func TestRepositoriesService_ListTeamRestrictions(t *testing.T) { for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -3739,8 +3667,7 @@ func TestRepositoriesService_ReplaceTeamRestrictions(t *testing.T) { for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -3789,8 +3716,7 @@ func TestRepositoriesService_AddTeamRestrictions(t *testing.T) { for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -3839,8 +3765,7 @@ func TestRepositoriesService_RemoveTeamRestrictions(t *testing.T) { for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -3885,8 +3810,7 @@ func TestRepositoriesService_ListUserRestrictions(t *testing.T) { for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -3926,8 +3850,7 @@ func TestRepositoriesService_ReplaceUserRestrictions(t *testing.T) { for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -3976,8 +3899,7 @@ func TestRepositoriesService_AddUserRestrictions(t *testing.T) { for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -4026,8 +3948,7 @@ func TestRepositoriesService_RemoveUserRestrictions(t *testing.T) { for _, test := range tests { t.Run(test.branch, func(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -4062,8 +3983,7 @@ func TestRepositoriesService_RemoveUserRestrictions(t *testing.T) { } func TestRepositoriesService_Transfer(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := TransferRequest{NewOwner: "a", NewName: String("b"), TeamID: []int64{123}} @@ -4106,8 +4026,7 @@ func TestRepositoriesService_Transfer(t *testing.T) { } func TestRepositoriesService_Dispatch(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) var input DispatchRequestOptions @@ -4381,8 +4300,7 @@ func TestRepositoryTag_Marshal(t *testing.T) { } func TestRepositoriesService_EnablePrivateReporting(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/owner/repo/private-vulnerability-reporting", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -4407,8 +4325,7 @@ func TestRepositoriesService_EnablePrivateReporting(t *testing.T) { } func TestRepositoriesService_DisablePrivateReporting(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/owner/repo/private-vulnerability-reporting", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -4433,8 +4350,7 @@ func TestRepositoriesService_DisablePrivateReporting(t *testing.T) { } func TestRepositoriesService_IsPrivateReportingEnabled(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/owner/repo/private-vulnerability-reporting", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") diff --git a/github/repos_traffic_test.go b/github/repos_traffic_test.go index e63f9181994..1ee91fabb35 100644 --- a/github/repos_traffic_test.go +++ b/github/repos_traffic_test.go @@ -16,8 +16,7 @@ import ( ) func TestRepositoriesService_ListTrafficReferrers(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/traffic/popular/referrers", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -58,8 +57,7 @@ func TestRepositoriesService_ListTrafficReferrers(t *testing.T) { } func TestRepositoriesService_ListTrafficPaths(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/traffic/popular/paths", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -102,8 +100,7 @@ func TestRepositoriesService_ListTrafficPaths(t *testing.T) { } func TestRepositoriesService_ListTrafficViews(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/traffic/views", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -152,8 +149,7 @@ func TestRepositoriesService_ListTrafficViews(t *testing.T) { } func TestRepositoriesService_ListTrafficClones(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/traffic/clones", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -300,7 +296,7 @@ func TestTrafficData_Marshal(t *testing.T) { Uniques: Int(6), } - want := `{ + want := `{ "timestamp": "2016-05-31T16:00:00.000Z", "count": 7, "uniques": 6 diff --git a/github/scim_test.go b/github/scim_test.go index 2ae4f194456..ce3315f2f20 100644 --- a/github/scim_test.go +++ b/github/scim_test.go @@ -16,8 +16,7 @@ import ( ) func TestSCIMService_ListSCIMProvisionedIdentities(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/scim/v2/organizations/o/Users", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -122,8 +121,7 @@ func TestSCIMService_ListSCIMProvisionedIdentities(t *testing.T) { } func TestSCIMService_ProvisionAndInviteSCIMUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/scim/v2/organizations/o/Users", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -173,8 +171,7 @@ func TestSCIMService_ProvisionAndInviteSCIMUser(t *testing.T) { } func TestSCIMService_GetSCIMProvisioningInfoForUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/scim/v2/organizations/o/Users/123", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -266,8 +263,7 @@ func TestSCIMService_GetSCIMProvisioningInfoForUser(t *testing.T) { } func TestSCIMService_UpdateProvisionedOrgMembership(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/scim/v2/organizations/o/Users/123", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -304,8 +300,7 @@ func TestSCIMService_UpdateProvisionedOrgMembership(t *testing.T) { } func TestSCIMService_UpdateAttributeForSCIMUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/scim/v2/organizations/o/Users/123", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") @@ -331,8 +326,7 @@ func TestSCIMService_UpdateAttributeForSCIMUser(t *testing.T) { } func TestSCIMService_DeleteSCIMUserFromOrg(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/scim/v2/organizations/o/Users/123", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -489,7 +483,7 @@ func TestSCIMUserName_Marshal(t *testing.T) { want := `{ "givenName": "Name1", "familyName": "Fname", - "formatted": "formatted name" + "formatted": "formatted name" }` testJSONMarshal(t, u, want) } diff --git a/github/search_test.go b/github/search_test.go index b7461753605..36e1c945937 100644 --- a/github/search_test.go +++ b/github/search_test.go @@ -16,8 +16,7 @@ import ( ) func TestSearchService_Repositories(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/search/repositories", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -50,8 +49,7 @@ func TestSearchService_Repositories(t *testing.T) { } func TestSearchService_Repositories_coverage(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() @@ -63,8 +61,7 @@ func TestSearchService_Repositories_coverage(t *testing.T) { } func TestSearchService_RepositoriesTextMatch(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/search/repositories", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -142,8 +139,7 @@ func TestSearchService_RepositoriesTextMatch(t *testing.T) { } func TestSearchService_Topics(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/search/topics", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -174,8 +170,7 @@ func TestSearchService_Topics(t *testing.T) { } func TestSearchService_Topics_coverage(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() @@ -187,8 +182,7 @@ func TestSearchService_Topics_coverage(t *testing.T) { } func TestSearchService_Commits(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/search/commits", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -219,8 +213,7 @@ func TestSearchService_Commits(t *testing.T) { } func TestSearchService_Commits_coverage(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() @@ -232,8 +225,7 @@ func TestSearchService_Commits_coverage(t *testing.T) { } func TestSearchService_Issues(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/search/issues", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -266,8 +258,7 @@ func TestSearchService_Issues(t *testing.T) { } func TestSearchService_Issues_coverage(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() @@ -279,8 +270,7 @@ func TestSearchService_Issues_coverage(t *testing.T) { } func TestSearchService_Issues_withQualifiersNoOpts(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) const q = "gopher is:issue label:bug language:c++ pushed:>=2018-01-01 stars:>=200" @@ -317,8 +307,7 @@ func TestSearchService_Issues_withQualifiersNoOpts(t *testing.T) { } func TestSearchService_Issues_withQualifiersAndOpts(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) const q = "gopher is:issue label:bug language:c++ pushed:>=2018-01-01 stars:>=200" @@ -356,8 +345,7 @@ func TestSearchService_Issues_withQualifiersAndOpts(t *testing.T) { } func TestSearchService_Users(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/search/users", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -390,8 +378,7 @@ func TestSearchService_Users(t *testing.T) { } func TestSearchService_Users_coverage(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() @@ -403,8 +390,7 @@ func TestSearchService_Users_coverage(t *testing.T) { } func TestSearchService_Code(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/search/code", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -437,8 +423,7 @@ func TestSearchService_Code(t *testing.T) { } func TestSearchService_Code_coverage(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() @@ -450,8 +435,7 @@ func TestSearchService_Code_coverage(t *testing.T) { } func TestSearchService_CodeTextMatch(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/search/code", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -512,8 +496,7 @@ func TestSearchService_CodeTextMatch(t *testing.T) { } func TestSearchService_Labels(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/search/labels", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -550,8 +533,7 @@ func TestSearchService_Labels(t *testing.T) { } func TestSearchService_Labels_coverage(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() @@ -759,7 +741,7 @@ func TestSearchOptions_Marshal(t *testing.T) { }, } - want := `{ + want := `{ "sort": "author-date", "order": "asc", "page": 1, diff --git a/github/secret_scanning_test.go b/github/secret_scanning_test.go index 1c8ad82bfcb..c9336f0fb87 100644 --- a/github/secret_scanning_test.go +++ b/github/secret_scanning_test.go @@ -17,8 +17,7 @@ import ( ) func TestSecretScanningService_ListAlertsForEnterprise(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/secret-scanning/alerts", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -92,8 +91,7 @@ func TestSecretScanningService_ListAlertsForEnterprise(t *testing.T) { } func TestSecretScanningService_ListAlertsForOrg(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/secret-scanning/alerts", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -157,8 +155,7 @@ func TestSecretScanningService_ListAlertsForOrg(t *testing.T) { } func TestSecretScanningService_ListAlertsForOrgListOptions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/secret-scanning/alerts", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -224,8 +221,7 @@ func TestSecretScanningService_ListAlertsForOrgListOptions(t *testing.T) { } func TestSecretScanningService_ListAlertsForRepo(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/secret-scanning/alerts", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -289,8 +285,7 @@ func TestSecretScanningService_ListAlertsForRepo(t *testing.T) { } func TestSecretScanningService_GetAlert(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/secret-scanning/alerts/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -350,8 +345,7 @@ func TestSecretScanningService_GetAlert(t *testing.T) { } func TestSecretScanningService_UpdateAlert(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/secret-scanning/alerts/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") @@ -421,8 +415,7 @@ func TestSecretScanningService_UpdateAlert(t *testing.T) { } func TestSecretScanningService_ListLocationsForAlert(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/secret-scanning/alerts/1/locations", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -560,7 +553,7 @@ func TestSecretScanningAlertLocation_Marshal(t *testing.T) { "blob_url": "https://api.github.com/repos/o/r/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b", "commit_sha": "test_sha", "commit_url": "https://api.github.com/repos/o/r/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b" - } + } }` testJSONMarshal(t, u, want) @@ -590,7 +583,7 @@ func TestSecretScanningAlertLocationDetails_Marshal(t *testing.T) { "blob_sha": "test_sha", "blob_url": "https://api.github.com/repos/o/r/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b", "commit_sha": "test_sha", - "commit_url": "https://api.github.com/repos/o/r/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b" + "commit_url": "https://api.github.com/repos/o/r/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b" }` testJSONMarshal(t, u, want) diff --git a/github/security_advisories_test.go b/github/security_advisories_test.go index b43ef7f990a..614174f1ab8 100644 --- a/github/security_advisories_test.go +++ b/github/security_advisories_test.go @@ -17,8 +17,7 @@ import ( ) func TestSecurityAdvisoriesService_RequestCVE(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/security-advisories/ghsa_id_ok/cve", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -57,8 +56,7 @@ func TestSecurityAdvisoriesService_RequestCVE(t *testing.T) { } func TestSecurityAdvisoriesService_CreateTemporaryPrivateFork(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/security-advisories/ghsa_id/forks", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -292,8 +290,7 @@ func TestSecurityAdvisoriesService_CreateTemporaryPrivateFork(t *testing.T) { } func TestSecurityAdvisoriesService_CreateTemporaryPrivateFork_deferred(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/security-advisories/ghsa_id/forks", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -514,8 +511,7 @@ func TestSecurityAdvisoriesService_CreateTemporaryPrivateFork_deferred(t *testin } func TestSecurityAdvisoriesService_CreateTemporaryPrivateFork_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.SecurityAdvisories.CreateTemporaryPrivateFork(ctx, "%", "r", "ghsa_id") @@ -523,8 +519,7 @@ func TestSecurityAdvisoriesService_CreateTemporaryPrivateFork_invalidOwner(t *te } func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisoriesForOrg_BadRequest(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/security-advisories", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -546,8 +541,7 @@ func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisoriesForOrg_BadReq } func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisoriesForOrg_NotFound(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/security-advisories", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -576,8 +570,7 @@ func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisoriesForOrg_NotFou } func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisoriesForOrg_UnmarshalError(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/security-advisories", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -602,8 +595,7 @@ func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisoriesForOrg_Unmars } func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisoriesForOrg(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/security-advisories", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -654,8 +646,7 @@ func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisoriesForOrg(t *tes } func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisories_BadRequest(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/security-advisories", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -677,8 +668,7 @@ func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisories_BadRequest(t } func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisories_NotFound(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/security-advisories", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -707,8 +697,7 @@ func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisories_NotFound(t * } func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisories_UnmarshalError(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/security-advisories", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -733,8 +722,7 @@ func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisories_UnmarshalErr } func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisories(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/security-advisories", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -785,8 +773,7 @@ func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisories(t *testing.T } func TestListGlobalSecurityAdvisories(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/advisories", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -971,8 +958,7 @@ func TestListGlobalSecurityAdvisories(t *testing.T) { } func TestGetGlobalSecurityAdvisories(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/advisories/GHSA-xoxo-1234-xoxo", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") diff --git a/github/teams_discussion_comments_test.go b/github/teams_discussion_comments_test.go index fda0428c658..adc30aa99a5 100644 --- a/github/teams_discussion_comments_test.go +++ b/github/teams_discussion_comments_test.go @@ -35,8 +35,7 @@ func tdcEndpointBySlug(org, slug, discussionNumber, commentNumber string) string } func TestTeamsService_ListComments(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) handleFunc := func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -176,8 +175,7 @@ func TestTeamsService_ListComments(t *testing.T) { } func TestTeamsService_GetComment(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) handlerFunc := func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -240,8 +238,7 @@ func TestTeamsService_GetComment(t *testing.T) { } func TestTeamsService_CreateComment(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := DiscussionComment{Body: String("c")} @@ -313,8 +310,7 @@ func TestTeamsService_CreateComment(t *testing.T) { } func TestTeamsService_EditComment(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := DiscussionComment{Body: String("e")} handlerFunc := func(w http.ResponseWriter, r *http.Request) { @@ -385,8 +381,7 @@ func TestTeamsService_EditComment(t *testing.T) { } func TestTeamsService_DeleteComment(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) handlerFunc := func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") diff --git a/github/teams_discussions_test.go b/github/teams_discussions_test.go index a9c7434ec1f..4db4039b7ce 100644 --- a/github/teams_discussions_test.go +++ b/github/teams_discussions_test.go @@ -17,8 +17,7 @@ import ( ) func TestTeamsService_ListDiscussionsByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/2/discussions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -132,8 +131,7 @@ func TestTeamsService_ListDiscussionsByID(t *testing.T) { } func TestTeamsService_ListDiscussionsBySlug(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s/discussions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -247,8 +245,7 @@ func TestTeamsService_ListDiscussionsBySlug(t *testing.T) { } func TestTeamsService_GetDiscussionByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/2/discussions/3", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -282,8 +279,7 @@ func TestTeamsService_GetDiscussionByID(t *testing.T) { } func TestTeamsService_GetDiscussionBySlug(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s/discussions/3", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -317,8 +313,7 @@ func TestTeamsService_GetDiscussionBySlug(t *testing.T) { } func TestTeamsService_CreateDiscussionByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := TeamDiscussion{Title: String("c_t"), Body: String("c_b")} @@ -361,8 +356,7 @@ func TestTeamsService_CreateDiscussionByID(t *testing.T) { } func TestTeamsService_CreateDiscussionBySlug(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := TeamDiscussion{Title: String("c_t"), Body: String("c_b")} @@ -405,8 +399,7 @@ func TestTeamsService_CreateDiscussionBySlug(t *testing.T) { } func TestTeamsService_EditDiscussionByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := TeamDiscussion{Title: String("e_t"), Body: String("e_b")} @@ -449,8 +442,7 @@ func TestTeamsService_EditDiscussionByID(t *testing.T) { } func TestTeamsService_EditDiscussionBySlug(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := TeamDiscussion{Title: String("e_t"), Body: String("e_b")} @@ -493,8 +485,7 @@ func TestTeamsService_EditDiscussionBySlug(t *testing.T) { } func TestTeamsService_DeleteDiscussionByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/2/discussions/3", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -518,8 +509,7 @@ func TestTeamsService_DeleteDiscussionByID(t *testing.T) { } func TestTeamsService_DeleteDiscussionBySlug(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s/discussions/3", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -593,7 +583,7 @@ func TestTeamDiscussion_Marshal(t *testing.T) { "gravatar_id": "", "url": "https://api.github.com/users/author", "created_at": ` + referenceTimeStr + `, - "suspended_at": ` + referenceTimeStr + ` + "suspended_at": ` + referenceTimeStr + ` }, "body": "test", "body_html": "

    test

    ", diff --git a/github/teams_members_test.go b/github/teams_members_test.go index bdaf1d72173..5044cfd4971 100644 --- a/github/teams_members_test.go +++ b/github/teams_members_test.go @@ -16,8 +16,7 @@ import ( ) func TestTeamsService__ListTeamMembersByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/2/members", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -53,8 +52,7 @@ func TestTeamsService__ListTeamMembersByID(t *testing.T) { } func TestTeamsService__ListTeamMembersByID_notFound(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/2/members", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -91,8 +89,7 @@ func TestTeamsService__ListTeamMembersByID_notFound(t *testing.T) { } func TestTeamsService__ListTeamMembersBySlug(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s/members", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -128,8 +125,7 @@ func TestTeamsService__ListTeamMembersBySlug(t *testing.T) { } func TestTeamsService__ListTeamMembersBySlug_notFound(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s/members", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -166,8 +162,7 @@ func TestTeamsService__ListTeamMembersBySlug_notFound(t *testing.T) { } func TestTeamsService__ListTeamMembersBySlug_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Teams.ListTeamMembersBySlug(ctx, "%", "s", nil) @@ -175,8 +170,7 @@ func TestTeamsService__ListTeamMembersBySlug_invalidOrg(t *testing.T) { } func TestTeamsService__GetTeamMembershipByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/2/memberships/u", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -210,8 +204,7 @@ func TestTeamsService__GetTeamMembershipByID(t *testing.T) { } func TestTeamsService__GetTeamMembershipByID_notFound(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/2/memberships/u", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -246,8 +239,7 @@ func TestTeamsService__GetTeamMembershipByID_notFound(t *testing.T) { } func TestTeamsService__GetTeamMembershipBySlug(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s/memberships/u", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -281,8 +273,7 @@ func TestTeamsService__GetTeamMembershipBySlug(t *testing.T) { } func TestTeamsService__GetTeamMembershipBySlug_notFound(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s/memberships/u", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -317,8 +308,7 @@ func TestTeamsService__GetTeamMembershipBySlug_notFound(t *testing.T) { } func TestTeamsService__GetTeamMembershipBySlug_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Teams.GetTeamMembershipBySlug(ctx, "%s", "s", "u") @@ -326,8 +316,7 @@ func TestTeamsService__GetTeamMembershipBySlug_invalidOrg(t *testing.T) { } func TestTeamsService__AddTeamMembershipByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) opt := &TeamAddTeamMembershipOptions{Role: "maintainer"} @@ -370,8 +359,7 @@ func TestTeamsService__AddTeamMembershipByID(t *testing.T) { } func TestTeamsService__AddTeamMembershipByID_notFound(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) opt := &TeamAddTeamMembershipOptions{Role: "maintainer"} @@ -415,8 +403,7 @@ func TestTeamsService__AddTeamMembershipByID_notFound(t *testing.T) { } func TestTeamsService__AddTeamMembershipBySlug(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) opt := &TeamAddTeamMembershipOptions{Role: "maintainer"} @@ -459,8 +446,7 @@ func TestTeamsService__AddTeamMembershipBySlug(t *testing.T) { } func TestTeamsService__AddTeamMembershipBySlug_notFound(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) opt := &TeamAddTeamMembershipOptions{Role: "maintainer"} @@ -504,8 +490,7 @@ func TestTeamsService__AddTeamMembershipBySlug_notFound(t *testing.T) { } func TestTeamsService__AddTeamMembershipBySlug_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Teams.AddTeamMembershipBySlug(ctx, "%", "s", "u", nil) @@ -513,8 +498,7 @@ func TestTeamsService__AddTeamMembershipBySlug_invalidOrg(t *testing.T) { } func TestTeamsService__RemoveTeamMembershipByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/2/memberships/u", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -539,8 +523,7 @@ func TestTeamsService__RemoveTeamMembershipByID(t *testing.T) { } func TestTeamsService__RemoveTeamMembershipByID_notFound(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/2/memberships/u", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -568,8 +551,7 @@ func TestTeamsService__RemoveTeamMembershipByID_notFound(t *testing.T) { } func TestTeamsService__RemoveTeamMembershipBySlug(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s/memberships/u", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -594,8 +576,7 @@ func TestTeamsService__RemoveTeamMembershipBySlug(t *testing.T) { } func TestTeamsService__RemoveTeamMembershipBySlug_notFound(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s/memberships/u", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -623,8 +604,7 @@ func TestTeamsService__RemoveTeamMembershipBySlug_notFound(t *testing.T) { } func TestTeamsService__RemoveTeamMembershipBySlug_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Teams.RemoveTeamMembershipBySlug(ctx, "%", "s", "u") @@ -632,8 +612,7 @@ func TestTeamsService__RemoveTeamMembershipBySlug_invalidOrg(t *testing.T) { } func TestTeamsService__ListPendingTeamInvitationsByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/2/invitations", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -669,8 +648,7 @@ func TestTeamsService__ListPendingTeamInvitationsByID(t *testing.T) { } func TestTeamsService__ListPendingTeamInvitationsByID_notFound(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/2/invitations", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -707,8 +685,7 @@ func TestTeamsService__ListPendingTeamInvitationsByID_notFound(t *testing.T) { } func TestTeamsService__ListPendingTeamInvitationsBySlug(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s/invitations", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -744,8 +721,7 @@ func TestTeamsService__ListPendingTeamInvitationsBySlug(t *testing.T) { } func TestTeamsService__ListPendingTeamInvitationsBySlug_notFound(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s/invitations", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -782,8 +758,7 @@ func TestTeamsService__ListPendingTeamInvitationsBySlug_notFound(t *testing.T) { } func TestTeamsService__ListPendingTeamInvitationsBySlug_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Teams.ListPendingTeamInvitationsBySlug(ctx, "%", "s", nil) diff --git a/github/teams_test.go b/github/teams_test.go index bf62c3b25fa..5e3f1f6df28 100644 --- a/github/teams_test.go +++ b/github/teams_test.go @@ -19,8 +19,7 @@ import ( ) func TestTeamsService_ListTeams(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -56,8 +55,7 @@ func TestTeamsService_ListTeams(t *testing.T) { } func TestTeamsService_ListTeams_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Teams.ListTeams(ctx, "%", nil) @@ -65,8 +63,7 @@ func TestTeamsService_ListTeams_invalidOrg(t *testing.T) { } func TestTeamsService_GetTeamByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -100,8 +97,7 @@ func TestTeamsService_GetTeamByID(t *testing.T) { } func TestTeamsService_GetTeamByID_notFound(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/2", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -122,8 +118,7 @@ func TestTeamsService_GetTeamByID_notFound(t *testing.T) { } func TestTeamsService_GetTeamBySlug(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -157,8 +152,7 @@ func TestTeamsService_GetTeamBySlug(t *testing.T) { } func TestTeamsService_GetTeamBySlug_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Teams.GetTeamBySlug(ctx, "%", "s") @@ -166,8 +160,7 @@ func TestTeamsService_GetTeamBySlug_invalidOrg(t *testing.T) { } func TestTeamsService_GetTeamBySlug_notFound(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -188,8 +181,7 @@ func TestTeamsService_GetTeamBySlug_notFound(t *testing.T) { } func TestTeamsService_CreateTeam(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := NewTeam{Name: "n", Privacy: String("closed"), RepoNames: []string{"r"}} @@ -232,8 +224,7 @@ func TestTeamsService_CreateTeam(t *testing.T) { } func TestTeamsService_CreateTeam_invalidOrg(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Teams.CreateTeam(ctx, "%", NewTeam{}) @@ -241,8 +232,7 @@ func TestTeamsService_CreateTeam_invalidOrg(t *testing.T) { } func TestTeamsService_EditTeamByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := NewTeam{Name: "n", Privacy: String("closed")} @@ -285,8 +275,7 @@ func TestTeamsService_EditTeamByID(t *testing.T) { } func TestTeamsService_EditTeamByID_RemoveParent(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := NewTeam{Name: "n", Privacy: String("closed")} var body string @@ -325,8 +314,7 @@ func TestTeamsService_EditTeamByID_RemoveParent(t *testing.T) { } func TestTeamsService_EditTeamBySlug(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := NewTeam{Name: "n", Privacy: String("closed")} @@ -369,8 +357,7 @@ func TestTeamsService_EditTeamBySlug(t *testing.T) { } func TestTeamsService_EditTeamBySlug_RemoveParent(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := NewTeam{Name: "n", Privacy: String("closed")} var body string @@ -409,8 +396,7 @@ func TestTeamsService_EditTeamBySlug_RemoveParent(t *testing.T) { } func TestTeamsService_DeleteTeamByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -434,8 +420,7 @@ func TestTeamsService_DeleteTeamByID(t *testing.T) { } func TestTeamsService_DeleteTeamBySlug(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -459,8 +444,7 @@ func TestTeamsService_DeleteTeamBySlug(t *testing.T) { } func TestTeamsService_ListChildTeamsByParentID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/2/teams", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -496,8 +480,7 @@ func TestTeamsService_ListChildTeamsByParentID(t *testing.T) { } func TestTeamsService_ListChildTeamsByParentSlug(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s/teams", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -533,8 +516,7 @@ func TestTeamsService_ListChildTeamsByParentSlug(t *testing.T) { } func TestTeamsService_ListTeamReposByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/1/repos", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -572,8 +554,7 @@ func TestTeamsService_ListTeamReposByID(t *testing.T) { } func TestTeamsService_ListTeamReposBySlug(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s/repos", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -611,8 +592,7 @@ func TestTeamsService_ListTeamReposBySlug(t *testing.T) { } func TestTeamsService_IsTeamRepoByID_true(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/1/repos/owner/repo", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -648,8 +628,7 @@ func TestTeamsService_IsTeamRepoByID_true(t *testing.T) { } func TestTeamsService_IsTeamRepoBySlug_true(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/org/teams/slug/repos/owner/repo", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -685,8 +664,7 @@ func TestTeamsService_IsTeamRepoBySlug_true(t *testing.T) { } func TestTeamsService_IsTeamRepoByID_false(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/1/repos/owner/repo", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -707,8 +685,7 @@ func TestTeamsService_IsTeamRepoByID_false(t *testing.T) { } func TestTeamsService_IsTeamRepoBySlug_false(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/org/teams/slug/repos/o/r", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -729,8 +706,7 @@ func TestTeamsService_IsTeamRepoBySlug_false(t *testing.T) { } func TestTeamsService_IsTeamRepoByID_error(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/1/repos/owner/repo", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -751,8 +727,7 @@ func TestTeamsService_IsTeamRepoByID_error(t *testing.T) { } func TestTeamsService_IsTeamRepoBySlug_error(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/org/teams/slug/repos/owner/repo", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -773,8 +748,7 @@ func TestTeamsService_IsTeamRepoBySlug_error(t *testing.T) { } func TestTeamsService_IsTeamRepoByID_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Teams.IsTeamRepoByID(ctx, 1, 1, "%", "r") @@ -782,8 +756,7 @@ func TestTeamsService_IsTeamRepoByID_invalidOwner(t *testing.T) { } func TestTeamsService_IsTeamRepoBySlug_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Teams.IsTeamRepoBySlug(ctx, "o", "s", "%", "r") @@ -791,8 +764,7 @@ func TestTeamsService_IsTeamRepoBySlug_invalidOwner(t *testing.T) { } func TestTeamsService_AddTeamRepoByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) opt := &TeamAddTeamRepoOptions{Permission: "admin"} @@ -826,8 +798,7 @@ func TestTeamsService_AddTeamRepoByID(t *testing.T) { } func TestTeamsService_AddTeamRepoBySlug(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) opt := &TeamAddTeamRepoOptions{Permission: "admin"} @@ -861,8 +832,7 @@ func TestTeamsService_AddTeamRepoBySlug(t *testing.T) { } func TestTeamsService_AddTeamRepoByID_noAccess(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/1/repos/owner/repo", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -877,8 +847,7 @@ func TestTeamsService_AddTeamRepoByID_noAccess(t *testing.T) { } func TestTeamsService_AddTeamRepoBySlug_noAccess(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/org/teams/slug/repos/o/r", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -893,8 +862,7 @@ func TestTeamsService_AddTeamRepoBySlug_noAccess(t *testing.T) { } func TestTeamsService_AddTeamRepoByID_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Teams.AddTeamRepoByID(ctx, 1, 1, "%", "r", nil) @@ -902,8 +870,7 @@ func TestTeamsService_AddTeamRepoByID_invalidOwner(t *testing.T) { } func TestTeamsService_AddTeamRepoBySlug_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Teams.AddTeamRepoBySlug(ctx, "o", "s", "%", "r", nil) @@ -911,8 +878,7 @@ func TestTeamsService_AddTeamRepoBySlug_invalidOwner(t *testing.T) { } func TestTeamsService_RemoveTeamRepoByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/1/repos/owner/repo", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -937,8 +903,7 @@ func TestTeamsService_RemoveTeamRepoByID(t *testing.T) { } func TestTeamsService_RemoveTeamRepoBySlug(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/org/teams/slug/repos/owner/repo", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -963,8 +928,7 @@ func TestTeamsService_RemoveTeamRepoBySlug(t *testing.T) { } func TestTeamsService_RemoveTeamRepoByID_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Teams.RemoveTeamRepoByID(ctx, 1, 1, "%", "r") @@ -972,8 +936,7 @@ func TestTeamsService_RemoveTeamRepoByID_invalidOwner(t *testing.T) { } func TestTeamsService_RemoveTeamRepoBySlug_invalidOwner(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Teams.RemoveTeamRepoBySlug(ctx, "o", "s", "%", "r") @@ -981,8 +944,7 @@ func TestTeamsService_RemoveTeamRepoBySlug_invalidOwner(t *testing.T) { } func TestTeamsService_ListUserTeams(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/teams", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -1013,8 +975,7 @@ func TestTeamsService_ListUserTeams(t *testing.T) { } func TestTeamsService_ListProjectsByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) wantAcceptHeaders := []string{mediaTypeProjectsPreview} mux.HandleFunc("/organizations/1/team/1/projects", func(w http.ResponseWriter, r *http.Request) { @@ -1050,8 +1011,7 @@ func TestTeamsService_ListProjectsByID(t *testing.T) { } func TestTeamsService_ListProjectsBySlug(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) wantAcceptHeaders := []string{mediaTypeProjectsPreview} mux.HandleFunc("/orgs/o/teams/s/projects", func(w http.ResponseWriter, r *http.Request) { @@ -1087,8 +1047,7 @@ func TestTeamsService_ListProjectsBySlug(t *testing.T) { } func TestTeamsService_ReviewProjectsByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) wantAcceptHeaders := []string{mediaTypeProjectsPreview} mux.HandleFunc("/organizations/1/team/1/projects/1", func(w http.ResponseWriter, r *http.Request) { @@ -1124,8 +1083,7 @@ func TestTeamsService_ReviewProjectsByID(t *testing.T) { } func TestTeamsService_ReviewProjectsBySlug(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) wantAcceptHeaders := []string{mediaTypeProjectsPreview} mux.HandleFunc("/orgs/o/teams/s/projects/1", func(w http.ResponseWriter, r *http.Request) { @@ -1161,8 +1119,7 @@ func TestTeamsService_ReviewProjectsBySlug(t *testing.T) { } func TestTeamsService_AddTeamProjectByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) opt := &TeamProjectOptions{ Permission: String("admin"), @@ -1200,8 +1157,7 @@ func TestTeamsService_AddTeamProjectByID(t *testing.T) { } func TestTeamsService_AddTeamProjectBySlug(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) opt := &TeamProjectOptions{ Permission: String("admin"), @@ -1239,8 +1195,7 @@ func TestTeamsService_AddTeamProjectBySlug(t *testing.T) { } func TestTeamsService_RemoveTeamProjectByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) wantAcceptHeaders := []string{mediaTypeProjectsPreview} mux.HandleFunc("/organizations/1/team/1/projects/1", func(w http.ResponseWriter, r *http.Request) { @@ -1267,8 +1222,7 @@ func TestTeamsService_RemoveTeamProjectByID(t *testing.T) { } func TestTeamsService_RemoveTeamProjectBySlug(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) wantAcceptHeaders := []string{mediaTypeProjectsPreview} mux.HandleFunc("/orgs/o/teams/s/projects/1", func(w http.ResponseWriter, r *http.Request) { @@ -1295,8 +1249,7 @@ func TestTeamsService_RemoveTeamProjectBySlug(t *testing.T) { } func TestTeamsService_ListIDPGroupsInOrganization(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/team-sync/groups", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -1346,8 +1299,7 @@ func TestTeamsService_ListIDPGroupsInOrganization(t *testing.T) { } func TestTeamsService_ListIDPGroupsForTeamByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/1/team-sync/group-mappings", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -1389,8 +1341,7 @@ func TestTeamsService_ListIDPGroupsForTeamByID(t *testing.T) { } func TestTeamsService_ListIDPGroupsForTeamBySlug(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/slug/team-sync/group-mappings", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -1432,8 +1383,7 @@ func TestTeamsService_ListIDPGroupsForTeamBySlug(t *testing.T) { } func TestTeamsService_CreateOrUpdateIDPGroupConnectionsByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/1/team-sync/group-mappings", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") @@ -1485,8 +1435,7 @@ func TestTeamsService_CreateOrUpdateIDPGroupConnectionsByID(t *testing.T) { } func TestTeamsService_CreateOrUpdateIDPGroupConnectionsBySlug(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/slug/team-sync/group-mappings", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") @@ -1537,8 +1486,7 @@ func TestTeamsService_CreateOrUpdateIDPGroupConnectionsBySlug(t *testing.T) { }) } func TestTeamsService_CreateOrUpdateIDPGroupConnectionsByID_empty(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/1/team-sync/group-mappings", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") @@ -1564,8 +1512,7 @@ func TestTeamsService_CreateOrUpdateIDPGroupConnectionsByID_empty(t *testing.T) } func TestTeamsService_CreateOrUpdateIDPGroupConnectionsBySlug_empty(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/slug/team-sync/group-mappings", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") @@ -1753,8 +1700,7 @@ func TestIDPGroup_Marshal(t *testing.T) { } func TestTeamsService_GetExternalGroup(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/external-group/123", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -1844,8 +1790,7 @@ func TestTeamsService_GetExternalGroup(t *testing.T) { } func TestTeamsService_GetExternalGroup_notFound(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/external-group/123", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -1866,8 +1811,7 @@ func TestTeamsService_GetExternalGroup_notFound(t *testing.T) { } func TestTeamsService_ListExternalGroups(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/external-groups", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -1920,8 +1864,7 @@ func TestTeamsService_ListExternalGroups(t *testing.T) { } func TestTeamsService_ListExternalGroups_notFound(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/external-groups", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -1942,8 +1885,7 @@ func TestTeamsService_ListExternalGroups_notFound(t *testing.T) { } func TestTeamsService_ListExternalGroupsForTeamBySlug(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/t/external-groups", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -1993,8 +1935,7 @@ func TestTeamsService_ListExternalGroupsForTeamBySlug(t *testing.T) { } func TestTeamsService_ListExternalGroupsForTeamBySlug_notFound(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/t/external-groups", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -2015,8 +1956,7 @@ func TestTeamsService_ListExternalGroupsForTeamBySlug_notFound(t *testing.T) { } func TestTeamsService_UpdateConnectedExternalGroup(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/t/external-groups", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") @@ -2109,8 +2049,7 @@ func TestTeamsService_UpdateConnectedExternalGroup(t *testing.T) { } func TestTeamsService_UpdateConnectedExternalGroup_notFound(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/t/external-groups", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") @@ -2134,8 +2073,7 @@ func TestTeamsService_UpdateConnectedExternalGroup_notFound(t *testing.T) { } func TestTeamsService_RemoveConnectedExternalGroup(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/t/external-groups", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -2160,8 +2098,7 @@ func TestTeamsService_RemoveConnectedExternalGroup(t *testing.T) { } func TestTeamsService_RemoveConnectedExternalGroup_notFound(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/t/external-groups", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") diff --git a/github/users_administration_test.go b/github/users_administration_test.go index 3400edfccac..57e9807f51e 100644 --- a/github/users_administration_test.go +++ b/github/users_administration_test.go @@ -15,8 +15,7 @@ import ( ) func TestUsersService_PromoteSiteAdmin(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/site_admin", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -41,8 +40,7 @@ func TestUsersService_PromoteSiteAdmin(t *testing.T) { } func TestUsersService_DemoteSiteAdmin(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/site_admin", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -67,8 +65,7 @@ func TestUsersService_DemoteSiteAdmin(t *testing.T) { } func TestUsersService_Suspend(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/suspended", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -93,8 +90,7 @@ func TestUsersService_Suspend(t *testing.T) { } func TestUsersServiceReason_Suspend(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &UserSuspendOptions{Reason: String("test")} @@ -118,8 +114,7 @@ func TestUsersServiceReason_Suspend(t *testing.T) { } func TestUsersService_Unsuspend(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/suspended", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") diff --git a/github/users_blocking_test.go b/github/users_blocking_test.go index 55d8678495c..db94fd434d6 100644 --- a/github/users_blocking_test.go +++ b/github/users_blocking_test.go @@ -15,8 +15,7 @@ import ( ) func TestUsersService_ListBlockedUsers(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/blocks", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -50,8 +49,7 @@ func TestUsersService_ListBlockedUsers(t *testing.T) { } func TestUsersService_IsBlocked(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/blocks/u", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -84,8 +82,7 @@ func TestUsersService_IsBlocked(t *testing.T) { } func TestUsersService_BlockUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/blocks/u", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -111,8 +108,7 @@ func TestUsersService_BlockUser(t *testing.T) { } func TestUsersService_UnblockUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/blocks/u", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") diff --git a/github/users_emails_test.go b/github/users_emails_test.go index 9f7f92bc4dc..312137d39e9 100644 --- a/github/users_emails_test.go +++ b/github/users_emails_test.go @@ -16,8 +16,7 @@ import ( ) func TestUsersService_ListEmails(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/emails", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -52,8 +51,7 @@ func TestUsersService_ListEmails(t *testing.T) { } func TestUsersService_AddEmails(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := []string{"new@example.com"} @@ -94,8 +92,7 @@ func TestUsersService_AddEmails(t *testing.T) { } func TestUsersService_DeleteEmails(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := []string{"user@example.com"} @@ -142,8 +139,7 @@ func TestUserEmail_Marshal(t *testing.T) { } func TestUsersService_SetEmailVisibility(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &UserEmail{Visibility: String("private")} diff --git a/github/users_followers_test.go b/github/users_followers_test.go index 020a106cf7b..e7261488cc9 100644 --- a/github/users_followers_test.go +++ b/github/users_followers_test.go @@ -15,8 +15,7 @@ import ( ) func TestUsersService_ListFollowers_authenticatedUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/followers", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -52,8 +51,7 @@ func TestUsersService_ListFollowers_authenticatedUser(t *testing.T) { } func TestUsersService_ListFollowers_specifiedUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/followers", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -87,8 +85,7 @@ func TestUsersService_ListFollowers_specifiedUser(t *testing.T) { } func TestUsersService_ListFollowers_invalidUser(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Users.ListFollowers(ctx, "%", nil) @@ -96,8 +93,7 @@ func TestUsersService_ListFollowers_invalidUser(t *testing.T) { } func TestUsersService_ListFollowing_authenticatedUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/following", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -133,8 +129,7 @@ func TestUsersService_ListFollowing_authenticatedUser(t *testing.T) { } func TestUsersService_ListFollowing_specifiedUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/following", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -168,8 +163,7 @@ func TestUsersService_ListFollowing_specifiedUser(t *testing.T) { } func TestUsersService_ListFollowing_invalidUser(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Users.ListFollowing(ctx, "%", nil) @@ -177,8 +171,7 @@ func TestUsersService_ListFollowing_invalidUser(t *testing.T) { } func TestUsersService_IsFollowing_authenticatedUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/following/t", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -210,8 +203,7 @@ func TestUsersService_IsFollowing_authenticatedUser(t *testing.T) { } func TestUsersService_IsFollowing_specifiedUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/following/t", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -243,8 +235,7 @@ func TestUsersService_IsFollowing_specifiedUser(t *testing.T) { } func TestUsersService_IsFollowing_false(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/following/t", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -276,8 +267,7 @@ func TestUsersService_IsFollowing_false(t *testing.T) { } func TestUsersService_IsFollowing_error(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/following/t", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -309,8 +299,7 @@ func TestUsersService_IsFollowing_error(t *testing.T) { } func TestUsersService_IsFollowing_invalidUser(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Users.IsFollowing(ctx, "%", "%") @@ -318,8 +307,7 @@ func TestUsersService_IsFollowing_invalidUser(t *testing.T) { } func TestUsersService_Follow(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/following/u", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") @@ -343,8 +331,7 @@ func TestUsersService_Follow(t *testing.T) { } func TestUsersService_Follow_invalidUser(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Users.Follow(ctx, "%") @@ -352,8 +339,7 @@ func TestUsersService_Follow_invalidUser(t *testing.T) { } func TestUsersService_Unfollow(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/following/u", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -377,8 +363,7 @@ func TestUsersService_Unfollow(t *testing.T) { } func TestUsersService_Unfollow_invalidUser(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, err := client.Users.Unfollow(ctx, "%") diff --git a/github/users_gpg_keys_test.go b/github/users_gpg_keys_test.go index e0d581fbbc0..f2ee507948e 100644 --- a/github/users_gpg_keys_test.go +++ b/github/users_gpg_keys_test.go @@ -16,8 +16,7 @@ import ( ) func TestUsersService_ListGPGKeys_authenticatedUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/gpg_keys", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -53,8 +52,7 @@ func TestUsersService_ListGPGKeys_authenticatedUser(t *testing.T) { } func TestUsersService_ListGPGKeys_specifiedUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/gpg_keys", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -74,8 +72,7 @@ func TestUsersService_ListGPGKeys_specifiedUser(t *testing.T) { } func TestUsersService_ListGPGKeys_invalidUser(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Users.ListGPGKeys(ctx, "%", nil) @@ -83,8 +80,7 @@ func TestUsersService_ListGPGKeys_invalidUser(t *testing.T) { } func TestUsersService_GetGPGKey(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/gpg_keys/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -118,8 +114,7 @@ func TestUsersService_GetGPGKey(t *testing.T) { } func TestUsersService_CreateGPGKey(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := ` -----BEGIN PGP PUBLIC KEY BLOCK----- @@ -166,8 +161,7 @@ mQINBFcEd9kBEACo54TDbGhKlXKWMvJgecEUKPPcv7XdnpKdGb3LRw5MvFwT0V0f } func TestUsersService_DeleteGPGKey(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/gpg_keys/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") diff --git a/github/users_keys_test.go b/github/users_keys_test.go index f3a8218e598..02c8a0f2be1 100644 --- a/github/users_keys_test.go +++ b/github/users_keys_test.go @@ -16,8 +16,7 @@ import ( ) func TestUsersService_ListKeys_authenticatedUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/keys", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -53,8 +52,7 @@ func TestUsersService_ListKeys_authenticatedUser(t *testing.T) { } func TestUsersService_ListKeys_specifiedUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/keys", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -74,8 +72,7 @@ func TestUsersService_ListKeys_specifiedUser(t *testing.T) { } func TestUsersService_ListKeys_invalidUser(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Users.ListKeys(ctx, "%", nil) @@ -83,8 +80,7 @@ func TestUsersService_ListKeys_invalidUser(t *testing.T) { } func TestUsersService_GetKey(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/keys/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -118,8 +114,7 @@ func TestUsersService_GetKey(t *testing.T) { } func TestUsersService_CreateKey(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &Key{Key: String("k"), Title: String("t")} @@ -157,8 +152,7 @@ func TestUsersService_CreateKey(t *testing.T) { } func TestUsersService_DeleteKey(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/keys/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") diff --git a/github/users_packages_test.go b/github/users_packages_test.go index a087759334e..22f7a2302dc 100644 --- a/github/users_packages_test.go +++ b/github/users_packages_test.go @@ -15,8 +15,7 @@ import ( ) func TestUsersService_Authenticated_ListPackages(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/packages", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -71,8 +70,7 @@ func TestUsersService_Authenticated_ListPackages(t *testing.T) { } func TestUsersService_specifiedUser_ListPackages(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/packages", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -127,8 +125,7 @@ func TestUsersService_specifiedUser_ListPackages(t *testing.T) { } func TestUsersService_specifiedUser_GetPackage(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/packages/container/hello_docker", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -182,8 +179,7 @@ func TestUsersService_specifiedUser_GetPackage(t *testing.T) { } func TestUsersService_Authenticated_GetPackage(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/packages/container/hello_docker", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -237,8 +233,7 @@ func TestUsersService_Authenticated_GetPackage(t *testing.T) { } func TestUsersService_Authenticated_DeletePackage(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/packages/container/hello_docker", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -262,8 +257,7 @@ func TestUsersService_Authenticated_DeletePackage(t *testing.T) { } func TestUsersService_specifiedUser_DeletePackage(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/packages/container/hello_docker", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -287,8 +281,7 @@ func TestUsersService_specifiedUser_DeletePackage(t *testing.T) { } func TestUsersService_Authenticated_RestorePackage(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/packages/container/hello_docker/restore", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -312,8 +305,7 @@ func TestUsersService_Authenticated_RestorePackage(t *testing.T) { } func TestUsersService_specifiedUser_RestorePackage(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/packages/container/hello_docker/restore", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -337,8 +329,7 @@ func TestUsersService_specifiedUser_RestorePackage(t *testing.T) { } func TestUsersService_Authenticated_ListPackagesVersions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/packages/container/hello_docker/versions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -406,8 +397,7 @@ func TestUsersService_Authenticated_ListPackagesVersions(t *testing.T) { } func TestUsersService_specifiedUser_ListPackagesVersions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/packages/container/hello_docker/versions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -475,8 +465,7 @@ func TestUsersService_specifiedUser_ListPackagesVersions(t *testing.T) { } func TestUsersService_Authenticated_PackageGetVersion(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/packages/container/hello_docker/versions/45763", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -541,8 +530,7 @@ func TestUsersService_Authenticated_PackageGetVersion(t *testing.T) { } func TestUsersService_specifiedUser_PackageGetVersion(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/packages/container/hello_docker/versions/45763", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -607,8 +595,7 @@ func TestUsersService_specifiedUser_PackageGetVersion(t *testing.T) { } func TestUsersService_Authenticated_PackageDeleteVersion(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/packages/container/hello_docker/versions/45763", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -632,8 +619,7 @@ func TestUsersService_Authenticated_PackageDeleteVersion(t *testing.T) { } func TestUsersService_specifiedUser_PackageDeleteVersion(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/packages/container/hello_docker/versions/45763", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") @@ -657,8 +643,7 @@ func TestUsersService_specifiedUser_PackageDeleteVersion(t *testing.T) { } func TestUsersService_Authenticated_PackageRestoreVersion(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/packages/container/hello_docker/versions/45763/restore", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -682,8 +667,7 @@ func TestUsersService_Authenticated_PackageRestoreVersion(t *testing.T) { } func TestUsersService_specifiedUser_PackageRestoreVersion(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/packages/container/hello_docker/versions/45763/restore", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") diff --git a/github/users_projects_test.go b/github/users_projects_test.go index 1a298dedaab..6697887610b 100644 --- a/github/users_projects_test.go +++ b/github/users_projects_test.go @@ -16,8 +16,7 @@ import ( ) func TestUsersService_ListProjects(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/projects", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -54,8 +53,7 @@ func TestUsersService_ListProjects(t *testing.T) { } func TestUsersService_CreateProject(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &CreateUserProjectOptions{Name: "Project Name", Body: String("Project body.")} diff --git a/github/users_ssh_signing_keys_test.go b/github/users_ssh_signing_keys_test.go index c7093d7f61e..4b8dd251217 100644 --- a/github/users_ssh_signing_keys_test.go +++ b/github/users_ssh_signing_keys_test.go @@ -16,8 +16,7 @@ import ( ) func TestUsersService_ListSSHSigningKeys_authenticatedUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/ssh_signing_keys", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -53,8 +52,7 @@ func TestUsersService_ListSSHSigningKeys_authenticatedUser(t *testing.T) { } func TestUsersService_ListSSHSigningKeys_specifiedUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/ssh_signing_keys", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -74,8 +72,7 @@ func TestUsersService_ListSSHSigningKeys_specifiedUser(t *testing.T) { } func TestUsersService_ListSSHSigningKeys_invalidUser(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Users.ListSSHSigningKeys(ctx, "%", nil) @@ -83,8 +80,7 @@ func TestUsersService_ListSSHSigningKeys_invalidUser(t *testing.T) { } func TestUsersService_GetSSHSigningKey(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/ssh_signing_keys/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -118,8 +114,7 @@ func TestUsersService_GetSSHSigningKey(t *testing.T) { } func TestUsersService_CreateSSHSigningKey(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &Key{Key: String("k"), Title: String("t")} @@ -157,8 +152,7 @@ func TestUsersService_CreateSSHSigningKey(t *testing.T) { } func TestUsersService_DeleteSSHSigningKey(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/ssh_signing_keys/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") diff --git a/github/users_test.go b/github/users_test.go index 80020007e4a..03c9724378f 100644 --- a/github/users_test.go +++ b/github/users_test.go @@ -145,8 +145,7 @@ func TestUser_Marshal(t *testing.T) { } func TestUsersService_Get_authenticatedUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -180,8 +179,7 @@ func TestUsersService_Get_authenticatedUser(t *testing.T) { } func TestUsersService_Get_specifiedUser(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -201,8 +199,7 @@ func TestUsersService_Get_specifiedUser(t *testing.T) { } func TestUsersService_Get_invalidUser(t *testing.T) { - client, _, _, teardown := setup() - defer teardown() + client, _, _ := setup(t) ctx := context.Background() _, _, err := client.Users.Get(ctx, "%") @@ -210,8 +207,7 @@ func TestUsersService_Get_invalidUser(t *testing.T) { } func TestUsersService_GetByID(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -245,8 +241,7 @@ func TestUsersService_GetByID(t *testing.T) { } func TestUsersService_Edit(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) input := &User{Name: String("n")} @@ -284,8 +279,7 @@ func TestUsersService_Edit(t *testing.T) { } func TestUsersService_GetHovercard(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users/u/hovercard", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -321,8 +315,7 @@ func TestUsersService_GetHovercard(t *testing.T) { } func TestUsersService_ListAll(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/users", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -353,8 +346,7 @@ func TestUsersService_ListAll(t *testing.T) { } func TestUsersService_ListInvitations(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/repository_invitations", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -383,8 +375,7 @@ func TestUsersService_ListInvitations(t *testing.T) { } func TestUsersService_ListInvitations_withOptions(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/repository_invitations", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -402,8 +393,7 @@ func TestUsersService_ListInvitations_withOptions(t *testing.T) { } func TestUsersService_AcceptInvitation(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/repository_invitations/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") @@ -427,8 +417,7 @@ func TestUsersService_AcceptInvitation(t *testing.T) { } func TestUsersService_DeclineInvitation(t *testing.T) { - client, mux, _, teardown := setup() - defer teardown() + client, mux, _ := setup(t) mux.HandleFunc("/user/repository_invitations/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") diff --git a/scrape/apps_test.go b/scrape/apps_test.go index 741bfbb6127..577ff8b2cd1 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -29,8 +29,7 @@ func Test_AppRestrictionsEnabled(t *testing.T) { for _, tt := range tests { t.Run(tt.description, func(t *testing.T) { - client, mux, cleanup := setup() - defer cleanup() + client, mux := setup(t) mux.HandleFunc("/organizations/o/settings/oauth_application_policy", func(w http.ResponseWriter, r *http.Request) { copyTestFile(t, w, tt.testFile) @@ -48,8 +47,7 @@ func Test_AppRestrictionsEnabled(t *testing.T) { } func Test_ListOAuthApps(t *testing.T) { - client, mux, cleanup := setup() - defer cleanup() + client, mux := setup(t) mux.HandleFunc("/organizations/e/settings/oauth_application_policy", func(w http.ResponseWriter, r *http.Request) { copyTestFile(t, w, "access-restrictions-enabled.html") @@ -85,8 +83,7 @@ func Test_ListOAuthApps(t *testing.T) { } func Test_CreateApp(t *testing.T) { - client, mux, cleanup := setup() - defer cleanup() + client, mux := setup(t) mux.HandleFunc("/apps/settings/new", func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusCreated) @@ -103,9 +100,7 @@ func Test_CreateApp(t *testing.T) { } func Test_CreateAppWithOrg(t *testing.T) { - client, mux, cleanup := setup() - - defer cleanup() + client, mux := setup(t) mux.HandleFunc("/organizations/example/apps/settings/new", func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusCreated) diff --git a/scrape/forms_test.go b/scrape/forms_test.go index b9bd60cb218..40486c64587 100644 --- a/scrape/forms_test.go +++ b/scrape/forms_test.go @@ -83,8 +83,7 @@ func Test_ParseForms(t *testing.T) { } func Test_FetchAndSumbitForm(t *testing.T) { - client, mux, cleanup := setup() - defer cleanup() + client, mux := setup(t) var submitted bool mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { diff --git a/scrape/scrape_test.go b/scrape/scrape_test.go index f2b928dd9aa..24bab0a27b5 100644 --- a/scrape/scrape_test.go +++ b/scrape/scrape_test.go @@ -12,14 +12,17 @@ import ( // setup a test HTTP server along with a scrape.Client that is configured to // talk to that test server. Tests should register handlers on the mux which // provide mock responses for the GitHub pages being tested. -func setup() (client *Client, mux *http.ServeMux, cleanup func()) { +func setup(t *testing.T) (client *Client, mux *http.ServeMux) { + t.Helper() mux = http.NewServeMux() server := httptest.NewServer(mux) client = NewClient(nil) client.baseURL, _ = url.Parse(server.URL + "/") - return client, mux, server.Close + t.Cleanup(server.Close) + + return client, mux } func copyTestFile(t *testing.T, w io.Writer, filename string) { From 54eecb8b67bd5bdf33b8caa714ccd6ae36b7b978 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Thu, 3 Oct 2024 23:29:58 +0300 Subject: [PATCH 524/751] docs: Replace godoc.org with pkg.go.dev (#3301) --- example/commitpr/main.go | 4 ++-- github/doc.go | 2 +- github/examples_test.go | 6 +++--- scrape/README.md | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index 230b6238dfe..02c80a4ec20 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -13,7 +13,7 @@ // // Note, if you want to push a single file, you probably prefer to use the // content API. An example is available here: -// https://godoc.org/github.com/google/go-github/github#example-RepositoriesService-CreateFile +// https://pkg.go.dev/github.com/google/go-github/github#example-RepositoriesService-CreateFile // // Note, for this to work at least 1 commit is needed, so you if you use this // after creating a repository you might want to make sure you set `AutoInit` to @@ -168,7 +168,7 @@ func pushCommit(ref *github.Reference, tree *github.Tree) (err error) { return err } -// createPR creates a pull request. Based on: https://godoc.org/github.com/google/go-github/github#example-PullRequestsService-Create +// createPR creates a pull request. Based on: https://pkg.go.dev/github.com/google/go-github/github#example-PullRequestsService-Create func createPR() (err error) { if *prSubject == "" { return errors.New("missing `-pr-title` flag; skipping PR creation") diff --git a/github/doc.go b/github/doc.go index f98f84ef20e..bda83934784 100644 --- a/github/doc.go +++ b/github/doc.go @@ -31,7 +31,7 @@ The services of a client divide the API into logical chunks and correspond to the structure of the GitHub API documentation at https://docs.github.com/rest . -NOTE: Using the https://godoc.org/context package, one can easily +NOTE: Using the https://pkg.go.dev/context package, one can easily pass cancelation signals and deadlines to various services of the client for handling a request. In case there is no context available, then context.Background() can be used as a starting point. diff --git a/github/examples_test.go b/github/examples_test.go index 9e4e3b6da45..b54be8bf0da 100644 --- a/github/examples_test.go +++ b/github/examples_test.go @@ -72,7 +72,7 @@ func ExampleRepositoriesService_CreateFile() { // so you will need to modify the example to provide an oauth client to // github.NewClient() instead of nil. See the following documentation for more // information on how to authenticate with the client: - // https://godoc.org/github.com/google/go-github/github#hdr-Authentication + // https://pkg.go.dev/github.com/google/go-github/github#hdr-Authentication client := github.NewClient(nil) ctx := context.Background() @@ -117,7 +117,7 @@ func ExamplePullRequestsService_Create() { // so you will need to modify the example to provide an oauth client to // github.NewClient() instead of nil. See the following documentation for more // information on how to authenticate with the client: - // https://godoc.org/github.com/google/go-github/github#hdr-Authentication + // https://pkg.go.dev/github.com/google/go-github/github#hdr-Authentication client := github.NewClient(nil) newPR := &github.NewPullRequest{ @@ -146,7 +146,7 @@ func ExampleTeamsService_ListTeams() { // the example to provide an oauth client to github.NewClient() instead of nil. // See the following documentation for more information on how to authenticate // with the client: - // https://godoc.org/github.com/google/go-github/github#hdr-Authentication + // https://pkg.go.dev/github.com/google/go-github/github#hdr-Authentication client := github.NewClient(nil) teamName := "Developers team" diff --git a/scrape/README.md b/scrape/README.md index 5d6180da051..65b78bbfcf1 100644 --- a/scrape/README.md +++ b/scrape/README.md @@ -1,4 +1,4 @@ -[![GoDoc](https://godoc.org/github.com/google/go-github/scrape?status.svg)](https://godoc.org/github.com/google/go-github/scrape) +[![Go Reference](https://pkg.go.dev/badge/github.com/google/go-github/scrape.svg)](https://pkg.go.dev/github.com/google/go-github/scrape) The scrape package provides an experimental client for accessing additional GitHub data via screen scraping. It is designed to be a client of last resort From c0f593dd30fb1c436f1faa739b871c68e4637f98 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Thu, 3 Oct 2024 23:35:13 +0300 Subject: [PATCH 525/751] refactor: Remove redundant local vars in examples (#3303) --- example/basicauth/main.go | 5 ++--- example/codespaces/newreposecretwithxcrypto/main.go | 3 +-- example/codespaces/newusersecretwithxcrypto/main.go | 3 +-- example/newreposecretwithlibsodium/main.go | 3 +-- example/newreposecretwithxcrypto/main.go | 3 +-- example/tagprotection/main.go | 5 ++--- example/tokenauth/main.go | 5 ++--- 7 files changed, 10 insertions(+), 17 deletions(-) diff --git a/example/basicauth/main.go b/example/basicauth/main.go index 97bc078ad46..c23f81fc896 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -31,12 +31,11 @@ func main() { username, _ := r.ReadString('\n') fmt.Print("GitHub Password: ") - bytePassword, _ := term.ReadPassword(int(os.Stdin.Fd())) - password := string(bytePassword) + password, _ := term.ReadPassword(int(os.Stdin.Fd())) tp := github.BasicAuthTransport{ Username: strings.TrimSpace(username), - Password: strings.TrimSpace(password), + Password: strings.TrimSpace(string(password)), } client := github.NewClient(tp.Client()) diff --git a/example/codespaces/newreposecretwithxcrypto/main.go b/example/codespaces/newreposecretwithxcrypto/main.go index f0f7ea53d49..3cef6e8e1c2 100644 --- a/example/codespaces/newreposecretwithxcrypto/main.go +++ b/example/codespaces/newreposecretwithxcrypto/main.go @@ -147,8 +147,7 @@ func encryptSecretWithPublicKey(publicKey *github.PublicKey, secretName string, var boxKey [32]byte copy(boxKey[:], decodedPublicKey) - secretBytes := []byte(secretValue) - encryptedBytes, err := box.SealAnonymous([]byte{}, secretBytes, &boxKey, crypto_rand.Reader) + encryptedBytes, err := box.SealAnonymous([]byte{}, []byte(secretValue), &boxKey, crypto_rand.Reader) if err != nil { return nil, fmt.Errorf("box.SealAnonymous failed with error %w", err) } diff --git a/example/codespaces/newusersecretwithxcrypto/main.go b/example/codespaces/newusersecretwithxcrypto/main.go index 367d32ac3c9..c25aa794430 100644 --- a/example/codespaces/newusersecretwithxcrypto/main.go +++ b/example/codespaces/newusersecretwithxcrypto/main.go @@ -154,8 +154,7 @@ func encryptSecretWithPublicKey(publicKey *github.PublicKey, secretName string, var boxKey [32]byte copy(boxKey[:], decodedPublicKey) - secretBytes := []byte(secretValue) - encryptedBytes, err := box.SealAnonymous([]byte{}, secretBytes, &boxKey, crypto_rand.Reader) + encryptedBytes, err := box.SealAnonymous([]byte{}, []byte(secretValue), &boxKey, crypto_rand.Reader) if err != nil { return nil, fmt.Errorf("box.SealAnonymous failed with error %w", err) } diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index 5a5eccdc94f..bc754bdf041 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -142,8 +142,7 @@ func encryptSecretWithPublicKey(publicKey *github.PublicKey, secretName string, return nil, fmt.Errorf("base64.StdEncoding.DecodeString was unable to decode public key: %v", err) } - secretBytes := []byte(secretValue) - encryptedBytes, exit := sodium.CryptoBoxSeal(secretBytes, decodedPublicKey) + encryptedBytes, exit := sodium.CryptoBoxSeal([]byte(secretValue), decodedPublicKey) if exit != 0 { return nil, errors.New("sodium.CryptoBoxSeal exited with non zero exit code") } diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index 5e792d5f608..48f16b1c363 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -147,8 +147,7 @@ func encryptSecretWithPublicKey(publicKey *github.PublicKey, secretName string, var boxKey [32]byte copy(boxKey[:], decodedPublicKey) - secretBytes := []byte(secretValue) - encryptedBytes, err := box.SealAnonymous([]byte{}, secretBytes, &boxKey, crypto_rand.Reader) + encryptedBytes, err := box.SealAnonymous([]byte{}, []byte(secretValue), &boxKey, crypto_rand.Reader) if err != nil { return nil, fmt.Errorf("box.SealAnonymous failed with error %w", err) } diff --git a/example/tagprotection/main.go b/example/tagprotection/main.go index d0fde28a5f1..c66f4f67941 100644 --- a/example/tagprotection/main.go +++ b/example/tagprotection/main.go @@ -38,12 +38,11 @@ func main() { pattern = strings.TrimSpace(pattern) fmt.Print("GitHub Token: ") - byteToken, _ := term.ReadPassword(int(os.Stdin.Fd())) + token, _ := term.ReadPassword(int(os.Stdin.Fd())) println() - token := string(byteToken) ctx := context.Background() - client := github.NewClient(nil).WithAuthToken(token) + client := github.NewClient(nil).WithAuthToken(string(token)) // create new tag protection if pattern != "" { diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index 25b0f2aaba8..a10dc3bbca4 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -21,12 +21,11 @@ import ( func main() { fmt.Print("GitHub Token: ") - byteToken, _ := term.ReadPassword(int(os.Stdin.Fd())) + token, _ := term.ReadPassword(int(os.Stdin.Fd())) println() - token := string(byteToken) ctx := context.Background() - client := github.NewClient(nil).WithAuthToken(token) + client := github.NewClient(nil).WithAuthToken(string(token)) user, resp, err := client.Users.Get(ctx, "") if err != nil { From 7824d70fc4db32c794d0c327d93751a1a05c3065 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Fri, 4 Oct 2024 15:45:50 +0300 Subject: [PATCH 526/751] fix: Add missing NotificationSetting to newTeamNoParent (#3302) --- github/teams.go | 28 +++++++++++++++------------- github/teams_test.go | 8 ++++---- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/github/teams.go b/github/teams.go index b44e9418c05..10dbebcbbe6 100644 --- a/github/teams.go +++ b/github/teams.go @@ -206,13 +206,14 @@ func (s *TeamsService) CreateTeam(ctx context.Context, org string, team NewTeam) // "parent_team_id" field will be null. It is for internal use // only and should not be exported. type newTeamNoParent struct { - Name string `json:"name"` - Description *string `json:"description,omitempty"` - Maintainers []string `json:"maintainers,omitempty"` - RepoNames []string `json:"repo_names,omitempty"` - ParentTeamID *int64 `json:"parent_team_id"` // This will be "null" - Privacy *string `json:"privacy,omitempty"` - LDAPDN *string `json:"ldap_dn,omitempty"` + Name string `json:"name"` + Description *string `json:"description,omitempty"` + Maintainers []string `json:"maintainers,omitempty"` + RepoNames []string `json:"repo_names,omitempty"` + ParentTeamID *int64 `json:"parent_team_id"` // This will be "null" + NotificationSetting *string `json:"notification_setting,omitempty"` + Privacy *string `json:"privacy,omitempty"` + LDAPDN *string `json:"ldap_dn,omitempty"` } // copyNewTeamWithoutParent is used to set the "parent_team_id" @@ -220,12 +221,13 @@ type newTeamNoParent struct { // It is for internal use only and should not be exported. func copyNewTeamWithoutParent(team *NewTeam) *newTeamNoParent { return &newTeamNoParent{ - Name: team.Name, - Description: team.Description, - Maintainers: team.Maintainers, - RepoNames: team.RepoNames, - Privacy: team.Privacy, - LDAPDN: team.LDAPDN, + Name: team.Name, + Description: team.Description, + Maintainers: team.Maintainers, + RepoNames: team.RepoNames, + NotificationSetting: team.NotificationSetting, + Privacy: team.Privacy, + LDAPDN: team.LDAPDN, } } diff --git a/github/teams_test.go b/github/teams_test.go index 5e3f1f6df28..74a01cbb9e3 100644 --- a/github/teams_test.go +++ b/github/teams_test.go @@ -277,7 +277,7 @@ func TestTeamsService_EditTeamByID(t *testing.T) { func TestTeamsService_EditTeamByID_RemoveParent(t *testing.T) { client, mux, _ := setup(t) - input := NewTeam{Name: "n", Privacy: String("closed")} + input := NewTeam{Name: "n", NotificationSetting: String("notifications_enabled"), Privacy: String("closed")} var body string mux.HandleFunc("/organizations/1/team/1", func(w http.ResponseWriter, r *http.Request) { @@ -308,7 +308,7 @@ func TestTeamsService_EditTeamByID_RemoveParent(t *testing.T) { t.Errorf("Teams.EditTeamByID returned %+v, want %+v", team, want) } - if want := `{"name":"n","parent_team_id":null,"privacy":"closed"}` + "\n"; body != want { + if want := `{"name":"n","parent_team_id":null,"notification_setting":"notifications_enabled","privacy":"closed"}` + "\n"; body != want { t.Errorf("Teams.EditTeamByID body = %+v, want %+v", body, want) } } @@ -359,7 +359,7 @@ func TestTeamsService_EditTeamBySlug(t *testing.T) { func TestTeamsService_EditTeamBySlug_RemoveParent(t *testing.T) { client, mux, _ := setup(t) - input := NewTeam{Name: "n", Privacy: String("closed")} + input := NewTeam{Name: "n", NotificationSetting: String("notifications_disabled"), Privacy: String("closed")} var body string mux.HandleFunc("/orgs/o/teams/s", func(w http.ResponseWriter, r *http.Request) { @@ -390,7 +390,7 @@ func TestTeamsService_EditTeamBySlug_RemoveParent(t *testing.T) { t.Errorf("Teams.EditTeam returned %+v, want %+v", team, want) } - if want := `{"name":"n","parent_team_id":null,"privacy":"closed"}` + "\n"; body != want { + if want := `{"name":"n","parent_team_id":null,"notification_setting":"notifications_disabled","privacy":"closed"}` + "\n"; body != want { t.Errorf("Teams.EditTeam body = %+v, want %+v", body, want) } } From 4fcbdf89b49255cf6d7c41fc7c87fd2b070b5374 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Fri, 4 Oct 2024 19:21:17 +0300 Subject: [PATCH 527/751] docs: Improve formatting in README (#3300) --- README.md | 75 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 38 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 6f5c7aaea77..585790b7588 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-github # [![go-github release (latest SemVer)](https://img.shields.io/github/v/release/google/go-github?sort=semver)](https://github.com/google/go-github/releases) -[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v65/github) +[![Go Reference](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v65/github) [![Test Status](https://github.com/google/go-github/workflows/tests/badge.svg)](https://github.com/google/go-github/actions?query=workflow%3Atests) [![Test Coverage](https://codecov.io/gh/google/go-github/branch/master/graph/badge.svg)](https://codecov.io/gh/google/go-github) [![Discuss at go-github@googlegroups.com](https://img.shields.io/badge/discuss-go--github%40googlegroups.com-blue.svg)](https://groups.google.com/group/go-github) @@ -9,7 +9,7 @@ go-github is a Go client library for accessing the [GitHub API v3][]. -Currently, **go-github requires Go version 1.13 or greater**. go-github tracks +Currently, **go-github tests against Go version 1.22 and greater**. go-github tracks [Go's version support policy][support-policy]. We do our best not to break older versions of Go if we don't have to, but due to tooling constraints, we don't always test older versions. @@ -71,10 +71,9 @@ repos, _, err := client.Repositories.ListByOrg(context.Background(), "github", o ``` The services of a client divide the API into logical chunks and correspond to -the structure of the GitHub API documentation at -https://docs.github.com/en/rest . +the structure of the [GitHub API documentation](https://docs.github.com/en/rest). -NOTE: Using the [context](https://godoc.org/context) package, one can easily +NOTE: Using the [context](https://pkg.go.dev/context) package, one can easily pass cancelation signals and deadlines to various services of the client for handling a request. In case there is no context available, then `context.Background()` can be used as a starting point. @@ -97,11 +96,12 @@ include the specified OAuth token. Therefore, authenticated clients should almost never be shared between different users. For API methods that require HTTP Basic Authentication, use the -[`BasicAuthTransport`](https://godoc.org/github.com/google/go-github/github#BasicAuthTransport). +[`BasicAuthTransport`](https://pkg.go.dev/github.com/google/go-github/github#BasicAuthTransport). #### As a GitHub App #### -GitHub Apps authentication can be provided by different pkgs like [ghinstallation](https://github.com/bradleyfalzon/ghinstallation) or [go-githubauth](https://github.com/jferrl/go-githubauth). +GitHub Apps authentication can be provided by different pkgs like [bradleyfalzon/ghinstallation](https://github.com/bradleyfalzon/ghinstallation) +or [jferrl/go-githubauth](https://github.com/jferrl/go-githubauth). > **Note**: Most endpoints (ex. [`GET /rate_limit`]) require access token authentication > while a few others (ex. [`GET /app/hook/deliveries`]) require [JWT] authentication. @@ -148,33 +148,33 @@ Other example using `go-githubauth`: package main import ( - "context" - "fmt" - "os" - "strconv" - - "github.com/google/go-github/v65/github" - "github.com/jferrl/go-githubauth" - "golang.org/x/oauth2" + "context" + "fmt" + "os" + "strconv" + + "github.com/google/go-github/v65/github" + "github.com/jferrl/go-githubauth" + "golang.org/x/oauth2" ) func main() { - privateKey := []byte(os.Getenv("GITHUB_APP_PRIVATE_KEY")) + privateKey := []byte(os.Getenv("GITHUB_APP_PRIVATE_KEY")) - appTokenSource, err := githubauth.NewApplicationTokenSource(1112, privateKey) - if err != nil { - fmt.Println("Error creating application token source:", err) - return - } + appTokenSource, err := githubauth.NewApplicationTokenSource(1112, privateKey) + if err != nil { + fmt.Println("Error creating application token source:", err) + return + } - installationTokenSource := githubauth.NewInstallationTokenSource(1113, appTokenSource) + installationTokenSource := githubauth.NewInstallationTokenSource(1113, appTokenSource) - // oauth2.NewClient uses oauth2.ReuseTokenSource to reuse the token until it expires. - // The token will be automatically refreshed when it expires. - // InstallationTokenSource has the mechanism to refresh the token when it expires. - httpClient := oauth2.NewClient(context.Background(), installationTokenSource) + // oauth2.NewClient uses oauth2.ReuseTokenSource to reuse the token until it expires. + // The token will be automatically refreshed when it expires. + // InstallationTokenSource has the mechanism to refresh the token when it expires. + httpClient := oauth2.NewClient(context.Background(), installationTokenSource) - client := github.NewClient(httpClient) + client := github.NewClient(httpClient) } ``` @@ -205,8 +205,8 @@ if _, ok := err.(*github.RateLimitError); ok { } ``` -Learn more about GitHub rate limiting at -https://docs.github.com/en/rest/rate-limit . +Learn more about GitHub rate limiting in +["REST API endpoints for rate limits"](https://docs.github.com/en/rest/rate-limit). In addition to these rate limits, GitHub imposes a secondary rate limit on all API clients. This rate limit prevents clients from making too many concurrent requests. @@ -226,11 +226,11 @@ Alternatively, you can block until the rate limit is reset by using the `context repos, _, err := client.Repositories.List(context.WithValue(ctx, github.SleepUntilPrimaryRateLimitResetWhenRateLimited, true), "", nil) ``` -You can use [go-github-ratelimit](https://github.com/gofri/go-github-ratelimit) to handle +You can use [gofri/go-github-ratelimit](https://github.com/gofri/go-github-ratelimit) to handle secondary rate limit sleep-and-retry for you. -Learn more about GitHub secondary rate limiting at -https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#about-secondary-rate-limits . +Learn more about GitHub secondary rate limiting in +["About secondary rate limits"](https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#about-secondary-rate-limits). ### Accepted Status ### @@ -255,7 +255,7 @@ The GitHub API has good support for conditional requests which will help prevent you from burning through your rate limit, as well as help speed up your application. `go-github` does not handle conditional requests directly, but is instead designed to work with a caching `http.Transport`. We recommend using -https://github.com/gregjones/httpcache for that. For example: +[gregjones/httpcache](https://github.com/gregjones/httpcache) for that. For example: ```go import "github.com/gregjones/httpcache" @@ -265,8 +265,8 @@ import "github.com/gregjones/httpcache" ).WithAuthToken(os.Getenv("GITHUB_TOKEN")) ``` -Learn more about GitHub conditional requests at -https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api?apiVersion=2022-11-28#use-conditional-requests-if-appropriate +Learn more about GitHub conditional requests in +["Use conditional requests if appropriate"](https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api?apiVersion=2022-11-28#use-conditional-requests-if-appropriate). ### Creating and Updating Resources ### @@ -316,7 +316,7 @@ for { } ``` -#### Iterators (**experimental**) +#### Iterators (**experimental**) #### Go v1.23 introduces the new `iter` package. @@ -367,7 +367,7 @@ For complete usage of go-github, see the full [package docs][]. [GitHub webhook events]: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads [cbrgm/githubevents]: https://github.com/cbrgm/githubevents -### Testing code that uses `go-github` +### Testing code that uses `go-github` ### The repo [migueleliasweb/go-github-mock](https://github.com/migueleliasweb/go-github-mock) provides a way to mock responses. Check the repo for more details. @@ -376,6 +376,7 @@ The repo [migueleliasweb/go-github-mock](https://github.com/migueleliasweb/go-gi You can run integration tests from the `test` directory. See the integration tests [README](test/README.md). ## Contributing ## + I would like to cover the entire GitHub API and contributions are of course always welcome. The calling pattern is pretty well established, so adding new methods is relatively straightforward. See [`CONTRIBUTING.md`](CONTRIBUTING.md) for details. From 522c3eef52c08ef31ddba941cc37d98fc1c8b5bc Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Sat, 5 Oct 2024 14:08:59 +0300 Subject: [PATCH 528/751] docs: Fix typo in test comment (#3307) --- github/copilot_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/copilot_test.go b/github/copilot_test.go index 355ff130c85..22b6e8eddae 100644 --- a/github/copilot_test.go +++ b/github/copilot_test.go @@ -16,7 +16,7 @@ import ( "github.com/google/go-cmp/cmp" ) -// Test invalid JSON responses, vlaid responses are covered in the other tests +// Test invalid JSON responses, valid responses are covered in the other tests func TestCopilotSeatDetails_UnmarshalJSON(t *testing.T) { tests := []struct { name string From dc884c26cadb3bd388a4bf9ec5210353995e5784 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Sat, 5 Oct 2024 07:29:05 -0400 Subject: [PATCH 529/751] Add t.Parallel to unit tests (#3297) --- .golangci.yml | 6 + github/actions_artifacts_test.go | 23 + github/actions_cache_test.go | 30 + github/actions_oidc_test.go | 6 + github/actions_permissions_enterprise_test.go | 10 + github/actions_permissions_orgs_test.go | 12 + github/actions_required_workflows_test.go | 10 + github/actions_runner_groups_test.go | 20 + github/actions_runners_test.go | 21 + github/actions_secrets_test.go | 29 + github/actions_variables_test.go | 21 + github/actions_workflow_jobs_test.go | 10 + github/actions_workflow_runs_test.go | 28 + github/actions_workflows_test.go | 17 + github/activity_events_test.go | 19 + github/activity_notifications_test.go | 13 + github/activity_star_test.go | 13 + github/activity_test.go | 4 + github/activity_watching_test.go | 9 + github/admin_orgs_test.go | 6 + github/admin_stats_test.go | 13 + github/admin_test.go | 7 + github/admin_users_test.go | 8 + github/apps_hooks_deliveries_test.go | 3 + github/apps_hooks_test.go | 2 + github/apps_installation_test.go | 6 + github/apps_manifest_test.go | 2 + github/apps_marketplace_test.go | 12 + github/apps_test.go | 25 + github/authorizations_test.go | 11 + github/billing_test.go | 18 + github/checks_test.go | 27 + github/code-scanning_test.go | 21 + github/codesofconduct_test.go | 3 + github/codespaces_secrets_test.go | 27 + github/codespaces_test.go | 6 + github/copilot_test.go | 13 + github/dependabot_alerts_test.go | 4 + github/dependabot_secrets_test.go | 15 + github/dependency_graph_snapshots_test.go | 1 + github/dependency_graph_test.go | 1 + github/emojis_test.go | 1 + .../enterprise_actions_runner_groups_test.go | 19 + github/enterprise_actions_runners_test.go | 6 + github/enterprise_audit_log_test.go | 1 + ...erprise_code_security_and_analysis_test.go | 3 + github/event_test.go | 4 + github/event_types_test.go | 99 + github/gen-accessors.go | 3 + github/gen-stringify-test.go | 1 + github/gists_comments_test.go | 11 + github/gists_test.go | 31 + github/git_blobs_test.go | 6 + github/git_commits_test.go | 21 + github/git_refs_test.go | 16 + github/git_tags_test.go | 4 + github/git_trees_test.go | 11 + github/github-accessors_test.go | 3258 +++++++++++++++++ github/github-stringify_test.go | 111 + github/github_test.go | 101 + github/gitignore_test.go | 4 + github/interactions_orgs_test.go | 3 + github/interactions_repos_test.go | 3 + github/interactions_test.go | 1 + github/issue_import_test.go | 14 + github/issues_assignees_test.go | 8 + github/issues_comments_test.go | 12 + github/issues_events_test.go | 6 + github/issues_labels_test.go | 23 + github/issues_milestones_test.go | 11 + github/issues_test.go | 22 + github/issues_timeline_test.go | 3 + github/licenses_test.go | 5 + github/markdown_test.go | 2 + github/messages_test.go | 19 + github/meta_test.go | 4 + github/migrations_source_import_test.go | 11 + github/migrations_test.go | 8 + github/migrations_user_test.go | 8 + github/orgs_actions_allowed_test.go | 2 + github/orgs_actions_permissions_test.go | 2 + github/orgs_audit_log_test.go | 4 + github/orgs_credential_authorizations_test.go | 2 + github/orgs_custom_repository_roles_test.go | 4 + github/orgs_hooks_configuration_test.go | 4 + github/orgs_hooks_deliveries_test.go | 6 + github/orgs_hooks_test.go | 10 + github/orgs_members_test.go | 28 + github/orgs_organization_roles_test.go | 11 + github/orgs_outside_collaborators_test.go | 7 + github/orgs_packages_test.go | 8 + github/orgs_personal_access_tokens_test.go | 3 + github/orgs_projects_test.go | 2 + github/orgs_properties_test.go | 10 + github/orgs_rules_test.go | 13 + github/orgs_security_managers_test.go | 8 + github/orgs_test.go | 16 + github/orgs_users_blocking_test.go | 4 + github/packages_test.go | 5 + github/projects_test.go | 32 + github/pulls_comments_test.go | 13 + github/pulls_reviewers_test.go | 6 + github/pulls_reviews_test.go | 25 + github/pulls_test.go | 33 + github/pulls_threads_test.go | 1 + github/rate_limit_test.go | 6 + github/reactions_test.go | 32 + github/repos_actions_access_test.go | 3 + github/repos_actions_allowed_test.go | 2 + github/repos_actions_permissions_test.go | 5 + github/repos_autolinks_test.go | 6 + github/repos_codeowners_test.go | 3 + github/repos_collaborators_test.go | 15 + github/repos_comments_test.go | 13 + github/repos_commits_test.go | 26 + github/repos_community_health_test.go | 4 + github/repos_contents_test.go | 26 + .../repos_deployment_branch_policies_test.go | 5 + .../repos_deployment_protection_rules_test.go | 5 + github/repos_deployments_test.go | 11 + github/repos_environments_test.go | 14 + github/repos_forks_test.go | 5 + github/repos_hooks_configuration_test.go | 4 + github/repos_hooks_deliveries_test.go | 13 + github/repos_hooks_test.go | 21 + github/repos_invitations_test.go | 4 + github/repos_keys_test.go | 8 + github/repos_lfs_test.go | 2 + github/repos_merging_test.go | 4 + github/repos_pages_test.go | 20 + github/repos_prereceive_hooks_test.go | 9 + github/repos_projects_test.go | 2 + github/repos_properties_test.go | 2 + github/repos_releases_test.go | 22 + github/repos_rules_test.go | 12 + github/repos_stats_test.go | 10 + github/repos_statuses_test.go | 7 + github/repos_tags_test.go | 5 + github/repos_test.go | 179 + github/repos_traffic_test.go | 10 + github/scim_test.go | 13 + github/search_test.go | 31 + github/secret_scanning_test.go | 11 + github/security_advisories_test.go | 19 + github/strings_test.go | 2 + github/teams_discussion_comments_test.go | 6 + github/teams_discussions_test.go | 11 + github/teams_members_test.go | 27 + github/teams_test.go | 73 + github/timestamp_test.go | 7 + github/users_administration_test.go | 6 + github/users_blocking_test.go | 4 + github/users_emails_test.go | 5 + github/users_followers_test.go | 15 + github/users_gpg_keys_test.go | 8 + github/users_keys_test.go | 7 + github/users_packages_test.go | 16 + github/users_projects_test.go | 3 + github/users_ssh_signing_keys_test.go | 7 + github/users_test.go | 16 + scrape/apps_test.go | 6 + scrape/forms_test.go | 4 + script/lint.sh | 2 +- tools/metadata/main_test.go | 6 + tools/metadata/metadata_test.go | 3 + 165 files changed, 5487 insertions(+), 1 deletion(-) diff --git a/.golangci.yml b/.golangci.yml index b452f669096..2bfeaaa24dc 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -11,7 +11,9 @@ linters: - gosec - misspell - nakedret + - paralleltest - stylecheck + - tparallel - unconvert - unparam - whitespace @@ -50,3 +52,7 @@ issues: - linters: [ gosec ] text: 'G304: Potential file inclusion via variable' path: '^(example|tools)\/' + + # We don't run parallel integration tests + - linters: [ paralleltest, tparallel ] + path: '^test/integration' diff --git a/github/actions_artifacts_test.go b/github/actions_artifacts_test.go index 1b49aaa3dfa..c592283d0cd 100644 --- a/github/actions_artifacts_test.go +++ b/github/actions_artifacts_test.go @@ -17,6 +17,7 @@ import ( ) func TestActionsService_ListArtifacts(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/artifacts", func(w http.ResponseWriter, r *http.Request) { @@ -58,6 +59,7 @@ func TestActionsService_ListArtifacts(t *testing.T) { } func TestActionsService_ListArtifacts_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -66,6 +68,7 @@ func TestActionsService_ListArtifacts_invalidOwner(t *testing.T) { } func TestActionsService_ListArtifacts_invalidRepo(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -74,6 +77,7 @@ func TestActionsService_ListArtifacts_invalidRepo(t *testing.T) { } func TestActionsService_ListArtifacts_notFound(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/artifacts", func(w http.ResponseWriter, r *http.Request) { @@ -95,6 +99,7 @@ func TestActionsService_ListArtifacts_notFound(t *testing.T) { } func TestActionsService_ListWorkflowRunArtifacts(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/1/artifacts", func(w http.ResponseWriter, r *http.Request) { @@ -136,6 +141,7 @@ func TestActionsService_ListWorkflowRunArtifacts(t *testing.T) { } func TestActionsService_ListWorkflowRunArtifacts_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -144,6 +150,7 @@ func TestActionsService_ListWorkflowRunArtifacts_invalidOwner(t *testing.T) { } func TestActionsService_ListWorkflowRunArtifacts_invalidRepo(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -152,6 +159,7 @@ func TestActionsService_ListWorkflowRunArtifacts_invalidRepo(t *testing.T) { } func TestActionsService_ListWorkflowRunArtifacts_notFound(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/1/artifacts", func(w http.ResponseWriter, r *http.Request) { @@ -173,6 +181,7 @@ func TestActionsService_ListWorkflowRunArtifacts_notFound(t *testing.T) { } func TestActionsService_GetArtifact(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/artifacts/1", func(w http.ResponseWriter, r *http.Request) { @@ -219,6 +228,7 @@ func TestActionsService_GetArtifact(t *testing.T) { } func TestActionsService_GetArtifact_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -227,6 +237,7 @@ func TestActionsService_GetArtifact_invalidOwner(t *testing.T) { } func TestActionsService_GetArtifact_invalidRepo(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -235,6 +246,7 @@ func TestActionsService_GetArtifact_invalidRepo(t *testing.T) { } func TestActionsService_GetArtifact_notFound(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/artifacts/1", func(w http.ResponseWriter, r *http.Request) { @@ -256,6 +268,7 @@ func TestActionsService_GetArtifact_notFound(t *testing.T) { } func TestActionsService_DownloadArtifact(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/artifacts/1/zip", func(w http.ResponseWriter, r *http.Request) { @@ -294,6 +307,7 @@ func TestActionsService_DownloadArtifact(t *testing.T) { } func TestActionsService_DownloadArtifact_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -302,6 +316,7 @@ func TestActionsService_DownloadArtifact_invalidOwner(t *testing.T) { } func TestActionsService_DownloadArtifact_invalidRepo(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -310,6 +325,7 @@ func TestActionsService_DownloadArtifact_invalidRepo(t *testing.T) { } func TestActionsService_DownloadArtifact_StatusMovedPermanently_dontFollowRedirects(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/artifacts/1/zip", func(w http.ResponseWriter, r *http.Request) { @@ -325,6 +341,7 @@ func TestActionsService_DownloadArtifact_StatusMovedPermanently_dontFollowRedire } func TestActionsService_DownloadArtifact_StatusMovedPermanently_followRedirects(t *testing.T) { + t.Parallel() client, mux, serverURL := setup(t) mux.HandleFunc("/repos/o/r/actions/artifacts/1/zip", func(w http.ResponseWriter, r *http.Request) { @@ -352,6 +369,7 @@ func TestActionsService_DownloadArtifact_StatusMovedPermanently_followRedirects( } func TestActionsService_DeleteArtifact(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/artifacts/1", func(w http.ResponseWriter, r *http.Request) { @@ -376,6 +394,7 @@ func TestActionsService_DeleteArtifact(t *testing.T) { } func TestActionsService_DeleteArtifact_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -384,6 +403,7 @@ func TestActionsService_DeleteArtifact_invalidOwner(t *testing.T) { } func TestActionsService_DeleteArtifact_invalidRepo(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -392,6 +412,7 @@ func TestActionsService_DeleteArtifact_invalidRepo(t *testing.T) { } func TestActionsService_DeleteArtifact_notFound(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/artifacts/1", func(w http.ResponseWriter, r *http.Request) { @@ -410,6 +431,7 @@ func TestActionsService_DeleteArtifact_notFound(t *testing.T) { } func TestArtifact_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Artifact{}, "{}") u := &Artifact{ @@ -456,6 +478,7 @@ func TestArtifact_Marshal(t *testing.T) { } func TestArtifactList_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ArtifactList{}, "{}") u := &ArtifactList{ diff --git a/github/actions_cache_test.go b/github/actions_cache_test.go index 0b37961e63d..cac64065c0f 100644 --- a/github/actions_cache_test.go +++ b/github/actions_cache_test.go @@ -15,6 +15,7 @@ import ( ) func TestActionsService_ListCaches(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/caches", func(w http.ResponseWriter, r *http.Request) { @@ -56,6 +57,7 @@ func TestActionsService_ListCaches(t *testing.T) { } func TestActionsService_ListCaches_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -64,6 +66,7 @@ func TestActionsService_ListCaches_invalidOwner(t *testing.T) { } func TestActionsService_ListCaches_invalidRepo(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -72,6 +75,7 @@ func TestActionsService_ListCaches_invalidRepo(t *testing.T) { } func TestActionsService_ListCaches_notFound(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/caches", func(w http.ResponseWriter, r *http.Request) { @@ -93,6 +97,7 @@ func TestActionsService_ListCaches_notFound(t *testing.T) { } func TestActionsService_DeleteCachesByKey(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/caches", func(w http.ResponseWriter, r *http.Request) { @@ -118,6 +123,7 @@ func TestActionsService_DeleteCachesByKey(t *testing.T) { } func TestActionsService_DeleteCachesByKey_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -126,6 +132,7 @@ func TestActionsService_DeleteCachesByKey_invalidOwner(t *testing.T) { } func TestActionsService_DeleteCachesByKey_invalidRepo(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -133,6 +140,7 @@ func TestActionsService_DeleteCachesByKey_invalidRepo(t *testing.T) { testURLParseError(t, err) } func TestActionsService_DeleteCachesByKey_notFound(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/artifacts/1", func(w http.ResponseWriter, r *http.Request) { @@ -151,6 +159,7 @@ func TestActionsService_DeleteCachesByKey_notFound(t *testing.T) { } func TestActionsService_DeleteCachesByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/caches/1", func(w http.ResponseWriter, r *http.Request) { @@ -175,6 +184,7 @@ func TestActionsService_DeleteCachesByID(t *testing.T) { } func TestActionsService_DeleteCachesByID_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -183,6 +193,7 @@ func TestActionsService_DeleteCachesByID_invalidOwner(t *testing.T) { } func TestActionsService_DeleteCachesByID_invalidRepo(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -191,6 +202,7 @@ func TestActionsService_DeleteCachesByID_invalidRepo(t *testing.T) { } func TestActionsService_DeleteCachesByID_notFound(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("repos/o/r/actions/caches/1", func(w http.ResponseWriter, r *http.Request) { @@ -209,6 +221,7 @@ func TestActionsService_DeleteCachesByID_notFound(t *testing.T) { } func TestActionsService_GetCacheUsageForRepo(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/cache/usage", func(w http.ResponseWriter, r *http.Request) { @@ -249,6 +262,7 @@ func TestActionsService_GetCacheUsageForRepo(t *testing.T) { } func TestActionsService_GetCacheUsageForRepo_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -257,6 +271,7 @@ func TestActionsService_GetCacheUsageForRepo_invalidOwner(t *testing.T) { } func TestActionsService_GetCacheUsageForRepo_invalidRepo(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -265,6 +280,7 @@ func TestActionsService_GetCacheUsageForRepo_invalidRepo(t *testing.T) { } func TestActionsService_GetCacheUsageForRepo_notFound(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/cache/usage", func(w http.ResponseWriter, r *http.Request) { @@ -286,6 +302,7 @@ func TestActionsService_GetCacheUsageForRepo_notFound(t *testing.T) { } func TestActionsService_ListCacheUsageByRepoForOrg(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/cache/usage-by-repository", func(w http.ResponseWriter, r *http.Request) { @@ -327,6 +344,7 @@ func TestActionsService_ListCacheUsageByRepoForOrg(t *testing.T) { } func TestActionsService_ListCacheUsageByRepoForOrg_invalidOrganization(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -335,6 +353,7 @@ func TestActionsService_ListCacheUsageByRepoForOrg_invalidOrganization(t *testin } func TestActionsService_ListCacheUsageByRepoForOrg_notFound(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/cache/usage-by-repository", func(w http.ResponseWriter, r *http.Request) { @@ -356,6 +375,7 @@ func TestActionsService_ListCacheUsageByRepoForOrg_notFound(t *testing.T) { } func TestActionsService_GetCacheUsageForOrg(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/cache/usage", func(w http.ResponseWriter, r *http.Request) { @@ -395,6 +415,7 @@ func TestActionsService_GetCacheUsageForOrg(t *testing.T) { } func TestActionsService_GetCacheUsageForOrg_invalidOrganization(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -403,6 +424,7 @@ func TestActionsService_GetCacheUsageForOrg_invalidOrganization(t *testing.T) { } func TestActionsService_GetCacheUsageForOrg_notFound(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/cache/usage", func(w http.ResponseWriter, r *http.Request) { @@ -424,6 +446,7 @@ func TestActionsService_GetCacheUsageForOrg_notFound(t *testing.T) { } func TestActionsService_GetCacheUsageForEnterprise(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/actions/cache/usage", func(w http.ResponseWriter, r *http.Request) { @@ -463,6 +486,7 @@ func TestActionsService_GetCacheUsageForEnterprise(t *testing.T) { } func TestActionsService_GetCacheUsageForEnterprise_invalidEnterprise(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -471,6 +495,7 @@ func TestActionsService_GetCacheUsageForEnterprise_invalidEnterprise(t *testing. } func TestActionsService_GetCacheUsageForEnterprise_notFound(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/actions/cache/usage", func(w http.ResponseWriter, r *http.Request) { @@ -492,6 +517,7 @@ func TestActionsService_GetCacheUsageForEnterprise_notFound(t *testing.T) { } func TestActionsCache_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ActionsCache{}, "{}") u := &ActionsCache{ @@ -518,6 +544,7 @@ func TestActionsCache_Marshal(t *testing.T) { } func TestActionsCacheList_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ActionsCacheList{}, "{}") u := &ActionsCacheList{ @@ -562,6 +589,7 @@ func TestActionsCacheList_Marshal(t *testing.T) { } func TestActionsCacheUsage_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ActionsCacheUsage{}, "{}") u := &ActionsCacheUsage{ @@ -580,6 +608,7 @@ func TestActionsCacheUsage_Marshal(t *testing.T) { } func TestActionsCacheUsageList_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ActionsCacheUsageList{}, "{}") u := &ActionsCacheUsageList{ @@ -606,6 +635,7 @@ func TestActionsCacheUsageList_Marshal(t *testing.T) { } func TestTotalCacheUsage_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &TotalCacheUsage{}, "{}") u := &TotalCacheUsage{ diff --git a/github/actions_oidc_test.go b/github/actions_oidc_test.go index 285e3aea328..4ad00a75371 100644 --- a/github/actions_oidc_test.go +++ b/github/actions_oidc_test.go @@ -15,6 +15,7 @@ import ( ) func TestActionsService_GetOrgOIDCSubjectClaimCustomTemplate(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/oidc/customization/sub", func(w http.ResponseWriter, r *http.Request) { @@ -49,6 +50,7 @@ func TestActionsService_GetOrgOIDCSubjectClaimCustomTemplate(t *testing.T) { } func TestActionsService_GetRepoOIDCSubjectClaimCustomTemplate(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/oidc/customization/sub", func(w http.ResponseWriter, r *http.Request) { @@ -83,6 +85,7 @@ func TestActionsService_GetRepoOIDCSubjectClaimCustomTemplate(t *testing.T) { } func TestActionsService_SetOrgOIDCSubjectClaimCustomTemplate(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/oidc/customization/sub", func(w http.ResponseWriter, r *http.Request) { @@ -114,6 +117,7 @@ func TestActionsService_SetOrgOIDCSubjectClaimCustomTemplate(t *testing.T) { } func TestActionsService_SetRepoOIDCSubjectClaimCustomTemplate(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/oidc/customization/sub", func(w http.ResponseWriter, r *http.Request) { @@ -146,6 +150,7 @@ func TestActionsService_SetRepoOIDCSubjectClaimCustomTemplate(t *testing.T) { } func TestActionService_SetRepoOIDCSubjectClaimCustomTemplateToDefault(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/oidc/customization/sub", func(w http.ResponseWriter, r *http.Request) { @@ -176,6 +181,7 @@ func TestActionService_SetRepoOIDCSubjectClaimCustomTemplateToDefault(t *testing } func TestOIDCSubjectClaimCustomTemplate_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &OIDCSubjectClaimCustomTemplate{}, "{}") u := &OIDCSubjectClaimCustomTemplate{ diff --git a/github/actions_permissions_enterprise_test.go b/github/actions_permissions_enterprise_test.go index 5ed326ad0a8..3ec9ab1163a 100644 --- a/github/actions_permissions_enterprise_test.go +++ b/github/actions_permissions_enterprise_test.go @@ -16,6 +16,7 @@ import ( ) func TestActionsService_GetActionsPermissionsInEnterprise(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/actions/permissions", func(w http.ResponseWriter, r *http.Request) { @@ -49,6 +50,7 @@ func TestActionsService_GetActionsPermissionsInEnterprise(t *testing.T) { } func TestActionsService_EditActionsPermissionsInEnterprise(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &ActionsPermissionsEnterprise{EnabledOrganizations: String("all"), AllowedActions: String("selected")} @@ -92,6 +94,7 @@ func TestActionsService_EditActionsPermissionsInEnterprise(t *testing.T) { } func TestActionsService_ListEnabledOrgsInEnterprise(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/actions/permissions/organizations", func(w http.ResponseWriter, r *http.Request) { @@ -135,6 +138,7 @@ func TestActionsService_ListEnabledOrgsInEnterprise(t *testing.T) { } func TestActionsService_SetEnabledOrgsInEnterprise(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/actions/permissions/organizations", func(w http.ResponseWriter, r *http.Request) { @@ -163,6 +167,7 @@ func TestActionsService_SetEnabledOrgsInEnterprise(t *testing.T) { } func TestActionsService_AddEnabledOrgInEnterprise(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/actions/permissions/organizations/123", func(w http.ResponseWriter, r *http.Request) { @@ -189,6 +194,7 @@ func TestActionsService_AddEnabledOrgInEnterprise(t *testing.T) { } func TestActionsService_RemoveEnabledOrgInEnterprise(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/actions/permissions/organizations/123", func(w http.ResponseWriter, r *http.Request) { @@ -215,6 +221,7 @@ func TestActionsService_RemoveEnabledOrgInEnterprise(t *testing.T) { } func TestActionsService_GetActionsAllowedInEnterprise(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/actions/permissions/selected-actions", func(w http.ResponseWriter, r *http.Request) { @@ -248,6 +255,7 @@ func TestActionsService_GetActionsAllowedInEnterprise(t *testing.T) { } func TestActionsService_EditActionsAllowedInEnterprise(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &ActionsAllowed{GithubOwnedAllowed: Bool(true), VerifiedAllowed: Bool(false), PatternsAllowed: []string{"a/b"}} @@ -291,6 +299,7 @@ func TestActionsService_EditActionsAllowedInEnterprise(t *testing.T) { } func TestActionsService_GetDefaultWorkflowPermissionsInEnterprise(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/actions/permissions/workflow", func(w http.ResponseWriter, r *http.Request) { @@ -324,6 +333,7 @@ func TestActionsService_GetDefaultWorkflowPermissionsInEnterprise(t *testing.T) } func TestActionsService_EditDefaultWorkflowPermissionsInEnterprise(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &DefaultWorkflowPermissionEnterprise{DefaultWorkflowPermissions: String("read"), CanApprovePullRequestReviews: Bool(true)} diff --git a/github/actions_permissions_orgs_test.go b/github/actions_permissions_orgs_test.go index 3056409fb70..4b778400fcb 100644 --- a/github/actions_permissions_orgs_test.go +++ b/github/actions_permissions_orgs_test.go @@ -16,6 +16,7 @@ import ( ) func TestActionsService_GetActionsPermissions(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/permissions", func(w http.ResponseWriter, r *http.Request) { @@ -49,6 +50,7 @@ func TestActionsService_GetActionsPermissions(t *testing.T) { } func TestActionsService_EditActionsPermissions(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &ActionsPermissions{EnabledRepositories: String("all"), AllowedActions: String("selected")} @@ -92,6 +94,7 @@ func TestActionsService_EditActionsPermissions(t *testing.T) { } func TestActionsService_ListEnabledReposInOrg(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/permissions/repositories", func(w http.ResponseWriter, r *http.Request) { @@ -135,6 +138,7 @@ func TestActionsService_ListEnabledReposInOrg(t *testing.T) { } func TestActionsService_SetEnabledReposInOrg(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/permissions/repositories", func(w http.ResponseWriter, r *http.Request) { @@ -163,6 +167,7 @@ func TestActionsService_SetEnabledReposInOrg(t *testing.T) { } func TestActionsService_AddEnabledReposInOrg(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/permissions/repositories/123", func(w http.ResponseWriter, r *http.Request) { @@ -189,6 +194,7 @@ func TestActionsService_AddEnabledReposInOrg(t *testing.T) { } func TestActionsService_RemoveEnabledReposInOrg(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/permissions/repositories/123", func(w http.ResponseWriter, r *http.Request) { @@ -215,6 +221,7 @@ func TestActionsService_RemoveEnabledReposInOrg(t *testing.T) { } func TestActionsService_GetActionsAllowed(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/permissions/selected-actions", func(w http.ResponseWriter, r *http.Request) { @@ -248,6 +255,7 @@ func TestActionsService_GetActionsAllowed(t *testing.T) { } func TestActionsService_EditActionsAllowed(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &ActionsAllowed{GithubOwnedAllowed: Bool(true), VerifiedAllowed: Bool(false), PatternsAllowed: []string{"a/b"}} @@ -291,6 +299,7 @@ func TestActionsService_EditActionsAllowed(t *testing.T) { } func TestActionsAllowed_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ActionsAllowed{}, "{}") u := &ActionsAllowed{ @@ -311,6 +320,7 @@ func TestActionsAllowed_Marshal(t *testing.T) { } func TestActionsPermissions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ActionsPermissions{}, "{}") u := &ActionsPermissions{ @@ -329,6 +339,7 @@ func TestActionsPermissions_Marshal(t *testing.T) { } func TestActionsService_GetDefaultWorkflowPermissionsInOrganization(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/permissions/workflow", func(w http.ResponseWriter, r *http.Request) { @@ -362,6 +373,7 @@ func TestActionsService_GetDefaultWorkflowPermissionsInOrganization(t *testing.T } func TestActionsService_EditDefaultWorkflowPermissionsInOrganization(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &DefaultWorkflowPermissionOrganization{DefaultWorkflowPermissions: String("read"), CanApprovePullRequestReviews: Bool(true)} diff --git a/github/actions_required_workflows_test.go b/github/actions_required_workflows_test.go index 8d4afe0fa6f..98c9b90751e 100644 --- a/github/actions_required_workflows_test.go +++ b/github/actions_required_workflows_test.go @@ -16,6 +16,7 @@ import ( ) func TestActionsService_ListOrgRequiredWorkflows(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/required_workflows", func(w http.ResponseWriter, r *http.Request) { @@ -80,6 +81,7 @@ func TestActionsService_ListOrgRequiredWorkflows(t *testing.T) { } func TestActionsService_CreateRequiredWorkflow(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/required_workflows", func(w http.ResponseWriter, r *http.Request) { @@ -145,6 +147,7 @@ func TestActionsService_CreateRequiredWorkflow(t *testing.T) { } func TestActionsService_GetRequiredWorkflowByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/required_workflows/12345", func(w http.ResponseWriter, r *http.Request) { @@ -195,6 +198,7 @@ func TestActionsService_GetRequiredWorkflowByID(t *testing.T) { } func TestActionsService_UpdateRequiredWorkflow(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/required_workflows/12345", func(w http.ResponseWriter, r *http.Request) { @@ -262,6 +266,7 @@ func TestActionsService_UpdateRequiredWorkflow(t *testing.T) { } func TestActionsService_DeleteRequiredWorkflow(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/required_workflows/12345", func(w http.ResponseWriter, r *http.Request) { @@ -287,6 +292,7 @@ func TestActionsService_DeleteRequiredWorkflow(t *testing.T) { } func TestActionsService_ListRequiredWorkflowSelectedRepos(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/required_workflows/12345/repositories", func(w http.ResponseWriter, r *http.Request) { @@ -333,6 +339,7 @@ func TestActionsService_ListRequiredWorkflowSelectedRepos(t *testing.T) { } func TestActionsService_SetRequiredWorkflowSelectedRepos(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/required_workflows/12345/repositories", func(w http.ResponseWriter, r *http.Request) { @@ -360,6 +367,7 @@ func TestActionsService_SetRequiredWorkflowSelectedRepos(t *testing.T) { } func TestActionsService_AddRepoToRequiredWorkflow(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/required_workflows/12345/repositories/32", func(w http.ResponseWriter, r *http.Request) { @@ -385,6 +393,7 @@ func TestActionsService_AddRepoToRequiredWorkflow(t *testing.T) { } func TestActionsService_RemoveRepoFromRequiredWorkflow(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/required_workflows/12345/repositories/32", func(w http.ResponseWriter, r *http.Request) { @@ -410,6 +419,7 @@ func TestActionsService_RemoveRepoFromRequiredWorkflow(t *testing.T) { } func TestActionsService_ListRepoRequiredWorkflows(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/required_workflows", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/actions_runner_groups_test.go b/github/actions_runner_groups_test.go index 1301cd02654..c051bbc1213 100644 --- a/github/actions_runner_groups_test.go +++ b/github/actions_runner_groups_test.go @@ -15,6 +15,7 @@ import ( ) func TestActionsService_ListOrganizationRunnerGroups(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runner-groups", func(w http.ResponseWriter, r *http.Request) { @@ -58,6 +59,7 @@ func TestActionsService_ListOrganizationRunnerGroups(t *testing.T) { } func TestActionsService_ListOrganizationRunnerGroupsVisibleToRepo(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runner-groups", func(w http.ResponseWriter, r *http.Request) { @@ -101,6 +103,7 @@ func TestActionsService_ListOrganizationRunnerGroupsVisibleToRepo(t *testing.T) } func TestActionsService_GetOrganizationRunnerGroup(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runner-groups/2", func(w http.ResponseWriter, r *http.Request) { @@ -147,6 +150,7 @@ func TestActionsService_GetOrganizationRunnerGroup(t *testing.T) { } func TestActionsService_DeleteOrganizationRunnerGroup(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runner-groups/2", func(w http.ResponseWriter, r *http.Request) { @@ -171,6 +175,7 @@ func TestActionsService_DeleteOrganizationRunnerGroup(t *testing.T) { } func TestActionsService_CreateOrganizationRunnerGroup(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runner-groups", func(w http.ResponseWriter, r *http.Request) { @@ -224,6 +229,7 @@ func TestActionsService_CreateOrganizationRunnerGroup(t *testing.T) { } func TestActionsService_UpdateOrganizationRunnerGroup(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runner-groups/2", func(w http.ResponseWriter, r *http.Request) { @@ -277,6 +283,7 @@ func TestActionsService_UpdateOrganizationRunnerGroup(t *testing.T) { } func TestActionsService_ListRepositoryAccessRunnerGroup(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runner-groups/2/repositories", func(w http.ResponseWriter, r *http.Request) { @@ -318,6 +325,7 @@ func TestActionsService_ListRepositoryAccessRunnerGroup(t *testing.T) { } func TestActionsService_SetRepositoryAccessRunnerGroup(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runner-groups/2/repositories", func(w http.ResponseWriter, r *http.Request) { @@ -349,6 +357,7 @@ func TestActionsService_SetRepositoryAccessRunnerGroup(t *testing.T) { } func TestActionsService_AddRepositoryAccessRunnerGroup(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runner-groups/2/repositories/42", func(w http.ResponseWriter, r *http.Request) { @@ -373,6 +382,7 @@ func TestActionsService_AddRepositoryAccessRunnerGroup(t *testing.T) { } func TestActionsService_RemoveRepositoryAccessRunnerGroup(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runner-groups/2/repositories/42", func(w http.ResponseWriter, r *http.Request) { @@ -397,6 +407,7 @@ func TestActionsService_RemoveRepositoryAccessRunnerGroup(t *testing.T) { } func TestActionsService_ListRunnerGroupRunners(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runner-groups/2/runners", func(w http.ResponseWriter, r *http.Request) { @@ -439,6 +450,7 @@ func TestActionsService_ListRunnerGroupRunners(t *testing.T) { } func TestActionsService_SetRunnerGroupRunners(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runner-groups/2/runners", func(w http.ResponseWriter, r *http.Request) { @@ -470,6 +482,7 @@ func TestActionsService_SetRunnerGroupRunners(t *testing.T) { } func TestActionsService_AddRunnerGroupRunners(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runner-groups/2/runners/42", func(w http.ResponseWriter, r *http.Request) { @@ -494,6 +507,7 @@ func TestActionsService_AddRunnerGroupRunners(t *testing.T) { } func TestActionsService_RemoveRunnerGroupRunners(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runner-groups/2/runners/42", func(w http.ResponseWriter, r *http.Request) { @@ -518,6 +532,7 @@ func TestActionsService_RemoveRunnerGroupRunners(t *testing.T) { } func TestRunnerGroup_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &RunnerGroup{}, "{}") u := &RunnerGroup{ @@ -550,6 +565,7 @@ func TestRunnerGroup_Marshal(t *testing.T) { } func TestRunnerGroups_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &RunnerGroups{}, "{}") u := &RunnerGroups{ @@ -590,6 +606,7 @@ func TestRunnerGroups_Marshal(t *testing.T) { } func TestCreateRunnerGroupRequest_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &CreateRunnerGroupRequest{}, "{}") u := &CreateRunnerGroupRequest{ @@ -616,6 +633,7 @@ func TestCreateRunnerGroupRequest_Marshal(t *testing.T) { } func TestUpdateRunnerGroupRequest_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &UpdateRunnerGroupRequest{}, "{}") u := &UpdateRunnerGroupRequest{ @@ -638,6 +656,7 @@ func TestUpdateRunnerGroupRequest_Marshal(t *testing.T) { } func TestSetRepoAccessRunnerGroupRequest_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &SetRepoAccessRunnerGroupRequest{}, "{}") u := &SetRepoAccessRunnerGroupRequest{ @@ -652,6 +671,7 @@ func TestSetRepoAccessRunnerGroupRequest_Marshal(t *testing.T) { } func TestSetRunnerGroupRunnersRequest_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &SetRunnerGroupRunnersRequest{}, "{}") u := &SetRunnerGroupRunnersRequest{ diff --git a/github/actions_runners_test.go b/github/actions_runners_test.go index 647ea13ed0b..06b824da45b 100644 --- a/github/actions_runners_test.go +++ b/github/actions_runners_test.go @@ -17,6 +17,7 @@ import ( ) func TestActionsService_ListRunnerApplicationDownloads(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runners/downloads", func(w http.ResponseWriter, r *http.Request) { @@ -57,6 +58,7 @@ func TestActionsService_ListRunnerApplicationDownloads(t *testing.T) { } func TestActionsService_GenerateOrgJITConfig(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &GenerateJITConfigRequest{Name: "test", RunnerGroupID: 1, Labels: []string{"one", "two"}} @@ -100,6 +102,7 @@ func TestActionsService_GenerateOrgJITConfig(t *testing.T) { } func TestActionsService_GenerateRepoJITConfig(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &GenerateJITConfigRequest{Name: "test", RunnerGroupID: 1, Labels: []string{"one", "two"}} @@ -143,6 +146,7 @@ func TestActionsService_GenerateRepoJITConfig(t *testing.T) { } func TestActionsService_CreateRegistrationToken(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runners/registration-token", func(w http.ResponseWriter, r *http.Request) { @@ -179,6 +183,7 @@ func TestActionsService_CreateRegistrationToken(t *testing.T) { } func TestActionsService_ListRunners(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runners", func(w http.ResponseWriter, r *http.Request) { @@ -223,6 +228,7 @@ func TestActionsService_ListRunners(t *testing.T) { } func TestActionsService_GetRunner(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runners/23", func(w http.ResponseWriter, r *http.Request) { @@ -262,6 +268,7 @@ func TestActionsService_GetRunner(t *testing.T) { } func TestActionsService_CreateRemoveToken(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runners/remove-token", func(w http.ResponseWriter, r *http.Request) { @@ -296,6 +303,7 @@ func TestActionsService_CreateRemoveToken(t *testing.T) { } func TestActionsService_RemoveRunner(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runners/21", func(w http.ResponseWriter, r *http.Request) { @@ -320,6 +328,7 @@ func TestActionsService_RemoveRunner(t *testing.T) { } func TestActionsService_ListOrganizationRunnerApplicationDownloads(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runners/downloads", func(w http.ResponseWriter, r *http.Request) { @@ -360,6 +369,7 @@ func TestActionsService_ListOrganizationRunnerApplicationDownloads(t *testing.T) } func TestActionsService_CreateOrganizationRegistrationToken(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runners/registration-token", func(w http.ResponseWriter, r *http.Request) { @@ -396,6 +406,7 @@ func TestActionsService_CreateOrganizationRegistrationToken(t *testing.T) { } func TestActionsService_ListOrganizationRunners(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runners", func(w http.ResponseWriter, r *http.Request) { @@ -440,6 +451,7 @@ func TestActionsService_ListOrganizationRunners(t *testing.T) { } func TestActionsService_GetOrganizationRunner(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runners/23", func(w http.ResponseWriter, r *http.Request) { @@ -479,6 +491,7 @@ func TestActionsService_GetOrganizationRunner(t *testing.T) { } func TestActionsService_CreateOrganizationRemoveToken(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runners/remove-token", func(w http.ResponseWriter, r *http.Request) { @@ -513,6 +526,7 @@ func TestActionsService_CreateOrganizationRemoveToken(t *testing.T) { } func TestActionsService_RemoveOrganizationRunner(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/runners/21", func(w http.ResponseWriter, r *http.Request) { @@ -537,6 +551,7 @@ func TestActionsService_RemoveOrganizationRunner(t *testing.T) { } func TestRunnerApplicationDownload_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &RunnerApplicationDownload{}, "{}") u := &RunnerApplicationDownload{ @@ -561,6 +576,7 @@ func TestRunnerApplicationDownload_Marshal(t *testing.T) { } func TestActionsEnabledOnOrgRepos_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ActionsEnabledOnOrgRepos{}, "{}") u := &ActionsEnabledOnOrgRepos{ @@ -589,6 +605,7 @@ func TestActionsEnabledOnOrgRepos_Marshal(t *testing.T) { } func TestRegistrationToken_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &RegistrationToken{}, "{}") u := &RegistrationToken{ @@ -605,6 +622,7 @@ func TestRegistrationToken_Marshal(t *testing.T) { } func TestRunnerLabels_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &RunnerLabels{}, "{}") u := &RunnerLabels{ @@ -623,6 +641,7 @@ func TestRunnerLabels_Marshal(t *testing.T) { } func TestRunner_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Runner{}, "{}") u := &Runner{ @@ -659,6 +678,7 @@ func TestRunner_Marshal(t *testing.T) { } func TestRunners_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Runners{}, "{}") u := &Runners{ @@ -705,6 +725,7 @@ func TestRunners_Marshal(t *testing.T) { } func TestRemoveToken_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &RemoveToken{}, "{}") u := &RemoveToken{ diff --git a/github/actions_secrets_test.go b/github/actions_secrets_test.go index 6c7c5d52a4b..e4cfc68e3db 100644 --- a/github/actions_secrets_test.go +++ b/github/actions_secrets_test.go @@ -17,6 +17,7 @@ import ( ) func TestPublicKey_UnmarshalJSON(t *testing.T) { + t.Parallel() var testCases = map[string]struct { data []byte wantPublicKey PublicKey @@ -77,6 +78,7 @@ func TestPublicKey_UnmarshalJSON(t *testing.T) { for name, tt := range testCases { tt := tt t.Run(name, func(t *testing.T) { + t.Parallel() pk := PublicKey{} err := json.Unmarshal(tt.data, &pk) if err == nil && tt.wantErr { @@ -93,6 +95,7 @@ func TestPublicKey_UnmarshalJSON(t *testing.T) { } func TestActionsService_GetRepoPublicKey(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/secrets/public-key", func(w http.ResponseWriter, r *http.Request) { @@ -127,6 +130,7 @@ func TestActionsService_GetRepoPublicKey(t *testing.T) { } func TestActionsService_GetRepoPublicKeyNumeric(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/secrets/public-key", func(w http.ResponseWriter, r *http.Request) { @@ -161,6 +165,7 @@ func TestActionsService_GetRepoPublicKeyNumeric(t *testing.T) { } func TestActionsService_ListRepoSecrets(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/secrets", func(w http.ResponseWriter, r *http.Request) { @@ -203,6 +208,7 @@ func TestActionsService_ListRepoSecrets(t *testing.T) { } func TestActionsService_ListRepoOrgSecrets(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/organization-secrets", func(w http.ResponseWriter, r *http.Request) { @@ -245,6 +251,7 @@ func TestActionsService_ListRepoOrgSecrets(t *testing.T) { } func TestActionsService_GetRepoSecret(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { @@ -283,6 +290,7 @@ func TestActionsService_GetRepoSecret(t *testing.T) { } func TestActionsService_CreateOrUpdateRepoSecret(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { @@ -315,6 +323,7 @@ func TestActionsService_CreateOrUpdateRepoSecret(t *testing.T) { } func TestActionsService_DeleteRepoSecret(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { @@ -339,6 +348,7 @@ func TestActionsService_DeleteRepoSecret(t *testing.T) { } func TestActionsService_GetOrgPublicKey(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/secrets/public-key", func(w http.ResponseWriter, r *http.Request) { @@ -373,6 +383,7 @@ func TestActionsService_GetOrgPublicKey(t *testing.T) { } func TestActionsService_ListOrgSecrets(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/secrets", func(w http.ResponseWriter, r *http.Request) { @@ -416,6 +427,7 @@ func TestActionsService_ListOrgSecrets(t *testing.T) { } func TestActionsService_GetOrgSecret(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { @@ -456,6 +468,7 @@ func TestActionsService_GetOrgSecret(t *testing.T) { } func TestActionsService_CreateOrUpdateOrgSecret(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { @@ -490,6 +503,7 @@ func TestActionsService_CreateOrUpdateOrgSecret(t *testing.T) { } func TestActionsService_ListSelectedReposForOrgSecret(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/secrets/NAME/repositories", func(w http.ResponseWriter, r *http.Request) { @@ -530,6 +544,7 @@ func TestActionsService_ListSelectedReposForOrgSecret(t *testing.T) { } func TestActionsService_SetSelectedReposForOrgSecret(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/secrets/NAME/repositories", func(w http.ResponseWriter, r *http.Request) { @@ -556,6 +571,7 @@ func TestActionsService_SetSelectedReposForOrgSecret(t *testing.T) { } func TestActionsService_AddSelectedRepoToOrgSecret(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/secrets/NAME/repositories/1234", func(w http.ResponseWriter, r *http.Request) { @@ -581,6 +597,7 @@ func TestActionsService_AddSelectedRepoToOrgSecret(t *testing.T) { } func TestActionsService_RemoveSelectedRepoFromOrgSecret(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/secrets/NAME/repositories/1234", func(w http.ResponseWriter, r *http.Request) { @@ -606,6 +623,7 @@ func TestActionsService_RemoveSelectedRepoFromOrgSecret(t *testing.T) { } func TestActionsService_DeleteOrgSecret(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { @@ -630,6 +648,7 @@ func TestActionsService_DeleteOrgSecret(t *testing.T) { } func TestActionsService_GetEnvPublicKey(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repositories/1/environments/e/secrets/public-key", func(w http.ResponseWriter, r *http.Request) { @@ -664,6 +683,7 @@ func TestActionsService_GetEnvPublicKey(t *testing.T) { } func TestActionsService_GetEnvPublicKeyNumeric(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repositories/1/environments/e/secrets/public-key", func(w http.ResponseWriter, r *http.Request) { @@ -698,6 +718,7 @@ func TestActionsService_GetEnvPublicKeyNumeric(t *testing.T) { } func TestActionsService_ListEnvSecrets(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repositories/1/environments/e/secrets", func(w http.ResponseWriter, r *http.Request) { @@ -740,6 +761,7 @@ func TestActionsService_ListEnvSecrets(t *testing.T) { } func TestActionsService_GetEnvSecret(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repositories/1/environments/e/secrets/secret", func(w http.ResponseWriter, r *http.Request) { @@ -778,6 +800,7 @@ func TestActionsService_GetEnvSecret(t *testing.T) { } func TestActionsService_CreateOrUpdateEnvSecret(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repositories/1/environments/e/secrets/secret", func(w http.ResponseWriter, r *http.Request) { @@ -810,6 +833,7 @@ func TestActionsService_CreateOrUpdateEnvSecret(t *testing.T) { } func TestActionsService_DeleteEnvSecret(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repositories/1/environments/e/secrets/secret", func(w http.ResponseWriter, r *http.Request) { @@ -834,6 +858,7 @@ func TestActionsService_DeleteEnvSecret(t *testing.T) { } func TestPublicKey_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PublicKey{}, "{}") u := &PublicKey{ @@ -850,6 +875,7 @@ func TestPublicKey_Marshal(t *testing.T) { } func TestSecret_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Secret{}, "{}") u := &Secret{ @@ -872,6 +898,7 @@ func TestSecret_Marshal(t *testing.T) { } func TestSecrets_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Secrets{}, "{}") u := &Secrets{ @@ -903,6 +930,7 @@ func TestSecrets_Marshal(t *testing.T) { } func TestEncryptedSecret_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &EncryptedSecret{}, "{}") u := &EncryptedSecret{ @@ -924,6 +952,7 @@ func TestEncryptedSecret_Marshal(t *testing.T) { } func TestSelectedReposList_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &SelectedReposList{}, "{}") u := &SelectedReposList{ diff --git a/github/actions_variables_test.go b/github/actions_variables_test.go index 1aaf65ebe17..14ce9ee2827 100644 --- a/github/actions_variables_test.go +++ b/github/actions_variables_test.go @@ -16,6 +16,7 @@ import ( ) func TestActionsService_ListRepoVariables(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/variables", func(w http.ResponseWriter, r *http.Request) { @@ -58,6 +59,7 @@ func TestActionsService_ListRepoVariables(t *testing.T) { } func TestActionsService_ListRepoOrgVariables(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/organization-variables", func(w http.ResponseWriter, r *http.Request) { @@ -100,6 +102,7 @@ func TestActionsService_ListRepoOrgVariables(t *testing.T) { } func TestActionsService_GetRepoVariable(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/variables/NAME", func(w http.ResponseWriter, r *http.Request) { @@ -139,6 +142,7 @@ func TestActionsService_GetRepoVariable(t *testing.T) { } func TestActionsService_CreateRepoVariable(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/variables", func(w http.ResponseWriter, r *http.Request) { @@ -170,6 +174,7 @@ func TestActionsService_CreateRepoVariable(t *testing.T) { } func TestActionsService_UpdateRepoVariable(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/variables/NAME", func(w http.ResponseWriter, r *http.Request) { @@ -201,6 +206,7 @@ func TestActionsService_UpdateRepoVariable(t *testing.T) { } func TestActionsService_DeleteRepoVariable(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/variables/NAME", func(w http.ResponseWriter, r *http.Request) { @@ -225,6 +231,7 @@ func TestActionsService_DeleteRepoVariable(t *testing.T) { } func TestActionsService_ListOrgVariables(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/variables", func(w http.ResponseWriter, r *http.Request) { @@ -268,6 +275,7 @@ func TestActionsService_ListOrgVariables(t *testing.T) { } func TestActionsService_GetOrgVariable(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/variables/NAME", func(w http.ResponseWriter, r *http.Request) { @@ -309,6 +317,7 @@ func TestActionsService_GetOrgVariable(t *testing.T) { } func TestActionsService_CreateOrgVariable(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/variables", func(w http.ResponseWriter, r *http.Request) { @@ -342,6 +351,7 @@ func TestActionsService_CreateOrgVariable(t *testing.T) { } func TestActionsService_UpdateOrgVariable(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/variables/NAME", func(w http.ResponseWriter, r *http.Request) { @@ -375,6 +385,7 @@ func TestActionsService_UpdateOrgVariable(t *testing.T) { } func TestActionsService_ListSelectedReposForOrgVariable(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/variables/NAME/repositories", func(w http.ResponseWriter, r *http.Request) { @@ -415,6 +426,7 @@ func TestActionsService_ListSelectedReposForOrgVariable(t *testing.T) { } func TestActionsService_SetSelectedReposForOrgSVariable(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/variables/NAME/repositories", func(w http.ResponseWriter, r *http.Request) { @@ -441,6 +453,7 @@ func TestActionsService_SetSelectedReposForOrgSVariable(t *testing.T) { } func TestActionsService_AddSelectedRepoToOrgVariable(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/variables/NAME/repositories/1234", func(w http.ResponseWriter, r *http.Request) { @@ -466,6 +479,7 @@ func TestActionsService_AddSelectedRepoToOrgVariable(t *testing.T) { } func TestActionsService_RemoveSelectedRepoFromOrgVariable(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/variables/NAME/repositories/1234", func(w http.ResponseWriter, r *http.Request) { @@ -491,6 +505,7 @@ func TestActionsService_RemoveSelectedRepoFromOrgVariable(t *testing.T) { } func TestActionsService_DeleteOrgVariable(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/variables/NAME", func(w http.ResponseWriter, r *http.Request) { @@ -515,6 +530,7 @@ func TestActionsService_DeleteOrgVariable(t *testing.T) { } func TestActionsService_ListEnvVariables(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/usr/1/environments/e/variables", func(w http.ResponseWriter, r *http.Request) { @@ -557,6 +573,7 @@ func TestActionsService_ListEnvVariables(t *testing.T) { } func TestActionsService_GetEnvVariable(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/usr/1/environments/e/variables/variable", func(w http.ResponseWriter, r *http.Request) { @@ -596,6 +613,7 @@ func TestActionsService_GetEnvVariable(t *testing.T) { } func TestActionsService_CreateEnvVariable(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/usr/1/environments/e/variables", func(w http.ResponseWriter, r *http.Request) { @@ -627,6 +645,7 @@ func TestActionsService_CreateEnvVariable(t *testing.T) { } func TestActionsService_UpdateEnvVariable(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/usr/1/environments/e/variables/variable", func(w http.ResponseWriter, r *http.Request) { @@ -658,6 +677,7 @@ func TestActionsService_UpdateEnvVariable(t *testing.T) { } func TestActionsService_DeleteEnvVariable(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/usr/1/environments/e/variables/variable", func(w http.ResponseWriter, r *http.Request) { @@ -682,6 +702,7 @@ func TestActionsService_DeleteEnvVariable(t *testing.T) { } func TestActionVariable_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ActionsVariable{}, "{}") av := &ActionsVariable{ diff --git a/github/actions_workflow_jobs_test.go b/github/actions_workflow_jobs_test.go index 292c5433a50..f8bb9481b31 100644 --- a/github/actions_workflow_jobs_test.go +++ b/github/actions_workflow_jobs_test.go @@ -18,6 +18,7 @@ import ( ) func TestActionsService_ListWorkflowJobs(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/29679449/jobs", func(w http.ResponseWriter, r *http.Request) { @@ -60,6 +61,7 @@ func TestActionsService_ListWorkflowJobs(t *testing.T) { } func TestActionsService_ListWorkflowJobs_Filter(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/29679449/jobs", func(w http.ResponseWriter, r *http.Request) { @@ -88,6 +90,7 @@ func TestActionsService_ListWorkflowJobs_Filter(t *testing.T) { } func TestActionsService_ListWorkflowJobsAttempt(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/29679449/attempts/1/jobs", func(w http.ResponseWriter, r *http.Request) { @@ -141,6 +144,7 @@ func TestActionsService_ListWorkflowJobsAttempt(t *testing.T) { } func TestActionsService_GetWorkflowJobByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/jobs/399444496", func(w http.ResponseWriter, r *http.Request) { @@ -179,6 +183,7 @@ func TestActionsService_GetWorkflowJobByID(t *testing.T) { } func TestActionsService_GetWorkflowJobLogs(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/jobs/399444496/logs", func(w http.ResponseWriter, r *http.Request) { @@ -216,6 +221,7 @@ func TestActionsService_GetWorkflowJobLogs(t *testing.T) { } func TestActionsService_GetWorkflowJobLogs_StatusMovedPermanently_dontFollowRedirects(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/jobs/399444496/logs", func(w http.ResponseWriter, r *http.Request) { @@ -231,6 +237,7 @@ func TestActionsService_GetWorkflowJobLogs_StatusMovedPermanently_dontFollowRedi } func TestActionsService_GetWorkflowJobLogs_StatusMovedPermanently_followRedirects(t *testing.T) { + t.Parallel() client, mux, serverURL := setup(t) // Mock a redirect link, which leads to an archive link @@ -262,6 +269,7 @@ func TestActionsService_GetWorkflowJobLogs_StatusMovedPermanently_followRedirect } func TestTaskStep_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &TaskStep{}, "{}") u := &TaskStep{ @@ -286,6 +294,7 @@ func TestTaskStep_Marshal(t *testing.T) { } func TestWorkflowJob_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &WorkflowJob{}, "{}") u := &WorkflowJob{ @@ -348,6 +357,7 @@ func TestWorkflowJob_Marshal(t *testing.T) { } func TestJobs_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Jobs{}, "{}") u := &Jobs{ diff --git a/github/actions_workflow_runs_test.go b/github/actions_workflow_runs_test.go index bba59e3ff64..ea6583ef583 100644 --- a/github/actions_workflow_runs_test.go +++ b/github/actions_workflow_runs_test.go @@ -18,6 +18,7 @@ import ( ) func TestActionsService_ListWorkflowRunsByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/workflows/29679449/runs", func(w http.ResponseWriter, r *http.Request) { @@ -60,6 +61,7 @@ func TestActionsService_ListWorkflowRunsByID(t *testing.T) { } func TestActionsService_ListWorkflowRunsFileName(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/workflows/29679449/runs", func(w http.ResponseWriter, r *http.Request) { @@ -102,6 +104,7 @@ func TestActionsService_ListWorkflowRunsFileName(t *testing.T) { } func TestActionsService_GetWorkflowRunByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/29679449", func(w http.ResponseWriter, r *http.Request) { @@ -142,6 +145,7 @@ func TestActionsService_GetWorkflowRunByID(t *testing.T) { } func TestActionsService_GetWorkflowRunAttempt(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/29679449/attempts/3", func(w http.ResponseWriter, r *http.Request) { @@ -185,6 +189,7 @@ func TestActionsService_GetWorkflowRunAttempt(t *testing.T) { } func TestActionsService_GetWorkflowRunAttemptLogs(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/399444496/attempts/2/logs", func(w http.ResponseWriter, r *http.Request) { @@ -213,6 +218,7 @@ func TestActionsService_GetWorkflowRunAttemptLogs(t *testing.T) { } func TestActionsService_GetWorkflowRunAttemptLogs_StatusMovedPermanently_dontFollowRedirects(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/399444496/attempts/2/logs", func(w http.ResponseWriter, r *http.Request) { @@ -228,6 +234,7 @@ func TestActionsService_GetWorkflowRunAttemptLogs_StatusMovedPermanently_dontFol } func TestActionsService_GetWorkflowRunAttemptLogs_StatusMovedPermanently_followRedirects(t *testing.T) { + t.Parallel() client, mux, serverURL := setup(t) // Mock a redirect link, which leads to an archive link @@ -265,6 +272,7 @@ func TestActionsService_GetWorkflowRunAttemptLogs_StatusMovedPermanently_followR } func TestActionsService_RerunWorkflowRunByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/3434/rerun", func(w http.ResponseWriter, r *http.Request) { @@ -293,6 +301,7 @@ func TestActionsService_RerunWorkflowRunByID(t *testing.T) { } func TestActionsService_RerunFailedJobsByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/3434/rerun-failed-jobs", func(w http.ResponseWriter, r *http.Request) { @@ -321,6 +330,7 @@ func TestActionsService_RerunFailedJobsByID(t *testing.T) { } func TestActionsService_RerunJobByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/jobs/3434/rerun", func(w http.ResponseWriter, r *http.Request) { @@ -349,6 +359,7 @@ func TestActionsService_RerunJobByID(t *testing.T) { } func TestActionsService_CancelWorkflowRunByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/3434/cancel", func(w http.ResponseWriter, r *http.Request) { @@ -377,6 +388,7 @@ func TestActionsService_CancelWorkflowRunByID(t *testing.T) { } func TestActionsService_GetWorkflowRunLogs(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/399444496/logs", func(w http.ResponseWriter, r *http.Request) { @@ -405,6 +417,7 @@ func TestActionsService_GetWorkflowRunLogs(t *testing.T) { } func TestActionsService_GetWorkflowRunLogs_StatusMovedPermanently_dontFollowRedirects(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/399444496/logs", func(w http.ResponseWriter, r *http.Request) { @@ -420,6 +433,7 @@ func TestActionsService_GetWorkflowRunLogs_StatusMovedPermanently_dontFollowRedi } func TestActionsService_GetWorkflowRunLogs_StatusMovedPermanently_followRedirects(t *testing.T) { + t.Parallel() client, mux, serverURL := setup(t) // Mock a redirect link, which leads to an archive link @@ -457,6 +471,7 @@ func TestActionsService_GetWorkflowRunLogs_StatusMovedPermanently_followRedirect } func TestActionService_ListRepositoryWorkflowRuns(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs", func(w http.ResponseWriter, r *http.Request) { @@ -505,6 +520,7 @@ func TestActionService_ListRepositoryWorkflowRuns(t *testing.T) { } func TestActionService_DeleteWorkflowRun(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/399444496", func(w http.ResponseWriter, r *http.Request) { @@ -530,6 +546,7 @@ func TestActionService_DeleteWorkflowRun(t *testing.T) { } func TestActionService_DeleteWorkflowRunLogs(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/399444496/logs", func(w http.ResponseWriter, r *http.Request) { @@ -555,6 +572,7 @@ func TestActionService_DeleteWorkflowRunLogs(t *testing.T) { } func TestPendingDeployment_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PendingDeployment{}, "{}") u := &PendingDeployment{ @@ -613,6 +631,7 @@ func TestPendingDeployment_Marshal(t *testing.T) { } func TestActionsService_ReviewCustomDeploymentProtectionRule(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/9444496/deployment_protection_rule", func(w http.ResponseWriter, r *http.Request) { @@ -644,6 +663,7 @@ func TestActionsService_ReviewCustomDeploymentProtectionRule(t *testing.T) { } func TestReviewCustomDeploymentProtectionRuleRequest_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ReviewCustomDeploymentProtectionRuleRequest{}, "{}") r := &ReviewCustomDeploymentProtectionRuleRequest{ @@ -660,6 +680,7 @@ func TestReviewCustomDeploymentProtectionRuleRequest_Marshal(t *testing.T) { } func TestActionsService_GetWorkflowRunUsageByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/29679449/timing", func(w http.ResponseWriter, r *http.Request) { @@ -727,6 +748,7 @@ func TestActionsService_GetWorkflowRunUsageByID(t *testing.T) { } func TestWorkflowRun_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &WorkflowRun{}, "{}") u := &WorkflowRun{ @@ -991,6 +1013,7 @@ func TestWorkflowRun_Marshal(t *testing.T) { } func TestWorkflowRuns_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &WorkflowRuns{}, "{}") u := &WorkflowRuns{ @@ -1249,6 +1272,7 @@ func TestWorkflowRuns_Marshal(t *testing.T) { } func TestWorkflowRunBill_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &WorkflowRunBill{}, "{}") u := &WorkflowRunBill{ @@ -1265,6 +1289,7 @@ func TestWorkflowRunBill_Marshal(t *testing.T) { } func TestWorkflowRunBillMap_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &WorkflowRunBillMap{}, "{}") u := &WorkflowRunBillMap{ @@ -1301,6 +1326,7 @@ func TestWorkflowRunBillMap_Marshal(t *testing.T) { } func TestWorkflowRunUsage_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &WorkflowRunUsage{}, "{}") u := &WorkflowRunUsage{ @@ -1343,6 +1369,7 @@ func TestWorkflowRunUsage_Marshal(t *testing.T) { } func TestActionService_PendingDeployments(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &PendingDeploymentsRequest{EnvironmentIDs: []int64{3, 4}, State: "approved", Comment: ""} @@ -1386,6 +1413,7 @@ func TestActionService_PendingDeployments(t *testing.T) { } func TestActionService_GetPendingDeployments(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/runs/399444496/pending_deployments", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/actions_workflows_test.go b/github/actions_workflows_test.go index 6661c1ede14..7a42cabde23 100644 --- a/github/actions_workflows_test.go +++ b/github/actions_workflows_test.go @@ -17,6 +17,7 @@ import ( ) func TestActionsService_ListWorkflows(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/workflows", func(w http.ResponseWriter, r *http.Request) { @@ -59,6 +60,7 @@ func TestActionsService_ListWorkflows(t *testing.T) { } func TestActionsService_GetWorkflowByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/workflows/72844", func(w http.ResponseWriter, r *http.Request) { @@ -97,6 +99,7 @@ func TestActionsService_GetWorkflowByID(t *testing.T) { } func TestActionsService_GetWorkflowByFileName(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/workflows/main.yml", func(w http.ResponseWriter, r *http.Request) { @@ -135,6 +138,7 @@ func TestActionsService_GetWorkflowByFileName(t *testing.T) { } func TestActionsService_GetWorkflowUsageByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/workflows/72844/timing", func(w http.ResponseWriter, r *http.Request) { @@ -181,6 +185,7 @@ func TestActionsService_GetWorkflowUsageByID(t *testing.T) { } func TestActionsService_GetWorkflowUsageByFileName(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/workflows/main.yml/timing", func(w http.ResponseWriter, r *http.Request) { @@ -227,6 +232,7 @@ func TestActionsService_GetWorkflowUsageByFileName(t *testing.T) { } func TestActionsService_CreateWorkflowDispatchEventByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) event := CreateWorkflowDispatchEventRequest{ @@ -270,6 +276,7 @@ func TestActionsService_CreateWorkflowDispatchEventByID(t *testing.T) { } func TestActionsService_CreateWorkflowDispatchEventByFileName(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) event := CreateWorkflowDispatchEventRequest{ @@ -313,6 +320,7 @@ func TestActionsService_CreateWorkflowDispatchEventByFileName(t *testing.T) { } func TestActionsService_EnableWorkflowByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/workflows/72844/enable", func(w http.ResponseWriter, r *http.Request) { @@ -347,6 +355,7 @@ func TestActionsService_EnableWorkflowByID(t *testing.T) { } func TestActionsService_EnableWorkflowByFilename(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/workflows/main.yml/enable", func(w http.ResponseWriter, r *http.Request) { @@ -381,6 +390,7 @@ func TestActionsService_EnableWorkflowByFilename(t *testing.T) { } func TestActionsService_DisableWorkflowByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/workflows/72844/disable", func(w http.ResponseWriter, r *http.Request) { @@ -415,6 +425,7 @@ func TestActionsService_DisableWorkflowByID(t *testing.T) { } func TestActionsService_DisableWorkflowByFileName(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/workflows/main.yml/disable", func(w http.ResponseWriter, r *http.Request) { @@ -449,6 +460,7 @@ func TestActionsService_DisableWorkflowByFileName(t *testing.T) { } func TestWorkflow_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Workflow{}, "{}") u := &Workflow{ @@ -481,6 +493,7 @@ func TestWorkflow_Marshal(t *testing.T) { } func TestWorkflows_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Workflows{}, "{}") u := &Workflows{ @@ -521,6 +534,7 @@ func TestWorkflows_Marshal(t *testing.T) { } func TestWorkflowBill_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &WorkflowBill{}, "{}") u := &WorkflowBill{ @@ -535,6 +549,7 @@ func TestWorkflowBill_Marshal(t *testing.T) { } func TestWorkflowBillMap_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &WorkflowBillMap{}, "{}") u := &WorkflowBillMap{ @@ -565,6 +580,7 @@ func TestWorkflowBillMap_Marshal(t *testing.T) { } func TestWorkflowUsage_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &WorkflowUsage{}, "{}") u := &WorkflowUsage{ @@ -599,6 +615,7 @@ func TestWorkflowUsage_Marshal(t *testing.T) { } func TestCreateWorkflowDispatchEventRequest_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &CreateWorkflowDispatchEventRequest{}, "{}") inputs := make(map[string]interface{}, 0) diff --git a/github/activity_events_test.go b/github/activity_events_test.go index b7588649cc6..d9025725b6a 100644 --- a/github/activity_events_test.go +++ b/github/activity_events_test.go @@ -16,6 +16,7 @@ import ( ) func TestActivityService_ListEvents(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/events", func(w http.ResponseWriter, r *http.Request) { @@ -49,6 +50,7 @@ func TestActivityService_ListEvents(t *testing.T) { } func TestActivityService_ListRepositoryEvents(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/events", func(w http.ResponseWriter, r *http.Request) { @@ -87,6 +89,7 @@ func TestActivityService_ListRepositoryEvents(t *testing.T) { } func TestActivityService_ListRepositoryEvents_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -95,6 +98,7 @@ func TestActivityService_ListRepositoryEvents_invalidOwner(t *testing.T) { } func TestActivityService_ListIssueEventsForRepository(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/events", func(w http.ResponseWriter, r *http.Request) { @@ -133,6 +137,7 @@ func TestActivityService_ListIssueEventsForRepository(t *testing.T) { } func TestActivityService_ListIssueEventsForRepository_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -141,6 +146,7 @@ func TestActivityService_ListIssueEventsForRepository_invalidOwner(t *testing.T) } func TestActivityService_ListEventsForRepoNetwork(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/networks/o/r/events", func(w http.ResponseWriter, r *http.Request) { @@ -179,6 +185,7 @@ func TestActivityService_ListEventsForRepoNetwork(t *testing.T) { } func TestActivityService_ListEventsForRepoNetwork_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -187,6 +194,7 @@ func TestActivityService_ListEventsForRepoNetwork_invalidOwner(t *testing.T) { } func TestActivityService_ListEventsForOrganization(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/events", func(w http.ResponseWriter, r *http.Request) { @@ -225,6 +233,7 @@ func TestActivityService_ListEventsForOrganization(t *testing.T) { } func TestActivityService_ListEventsForOrganization_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -233,6 +242,7 @@ func TestActivityService_ListEventsForOrganization_invalidOrg(t *testing.T) { } func TestActivityService_ListEventsPerformedByUser_all(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/events", func(w http.ResponseWriter, r *http.Request) { @@ -271,6 +281,7 @@ func TestActivityService_ListEventsPerformedByUser_all(t *testing.T) { } func TestActivityService_ListEventsPerformedByUser_publicOnly(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/events/public", func(w http.ResponseWriter, r *http.Request) { @@ -291,6 +302,7 @@ func TestActivityService_ListEventsPerformedByUser_publicOnly(t *testing.T) { } func TestActivityService_ListEventsPerformedByUser_invalidUser(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -299,6 +311,7 @@ func TestActivityService_ListEventsPerformedByUser_invalidUser(t *testing.T) { } func TestActivityService_ListEventsReceivedByUser_all(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/received_events", func(w http.ResponseWriter, r *http.Request) { @@ -337,6 +350,7 @@ func TestActivityService_ListEventsReceivedByUser_all(t *testing.T) { } func TestActivityService_ListEventsReceivedByUser_publicOnly(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/received_events/public", func(w http.ResponseWriter, r *http.Request) { @@ -357,6 +371,7 @@ func TestActivityService_ListEventsReceivedByUser_publicOnly(t *testing.T) { } func TestActivityService_ListEventsReceivedByUser_invalidUser(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -365,6 +380,7 @@ func TestActivityService_ListEventsReceivedByUser_invalidUser(t *testing.T) { } func TestActivityService_ListUserEventsForOrganization(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/events/orgs/o", func(w http.ResponseWriter, r *http.Request) { @@ -403,6 +419,7 @@ func TestActivityService_ListUserEventsForOrganization(t *testing.T) { } func TestActivityService_EventParsePayload_typed(t *testing.T) { + t.Parallel() raw := []byte(`{"type": "PushEvent","payload":{"push_id": 1}}`) var event *Event if err := json.Unmarshal(raw, &event); err != nil { @@ -423,6 +440,7 @@ func TestActivityService_EventParsePayload_typed(t *testing.T) { // interface{} value (instead of being discarded or throwing an error), for // forward compatibility with new event types. func TestActivityService_EventParsePayload_untyped(t *testing.T) { + t.Parallel() raw := []byte(`{"type": "UnrecognizedEvent","payload":{"field": "val"}}`) var event *Event if err := json.Unmarshal(raw, &event); err != nil { @@ -440,6 +458,7 @@ func TestActivityService_EventParsePayload_untyped(t *testing.T) { } func TestActivityService_EventParsePayload_installation(t *testing.T) { + t.Parallel() raw := []byte(`{"type": "PullRequestEvent","payload":{"installation":{"id":1}}}`) var event *Event if err := json.Unmarshal(raw, &event); err != nil { diff --git a/github/activity_notifications_test.go b/github/activity_notifications_test.go index d6b941776fe..03ecc8f66c7 100644 --- a/github/activity_notifications_test.go +++ b/github/activity_notifications_test.go @@ -17,6 +17,7 @@ import ( ) func TestActivityService_ListNotification(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/notifications", func(w http.ResponseWriter, r *http.Request) { @@ -59,6 +60,7 @@ func TestActivityService_ListNotification(t *testing.T) { } func TestActivityService_ListRepositoryNotifications(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/notifications", func(w http.ResponseWriter, r *http.Request) { @@ -93,6 +95,7 @@ func TestActivityService_ListRepositoryNotifications(t *testing.T) { } func TestActivityService_MarkNotificationsRead(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/notifications", func(w http.ResponseWriter, r *http.Request) { @@ -116,6 +119,7 @@ func TestActivityService_MarkNotificationsRead(t *testing.T) { } func TestActivityService_MarkRepositoryNotificationsRead(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/notifications", func(w http.ResponseWriter, r *http.Request) { @@ -144,6 +148,7 @@ func TestActivityService_MarkRepositoryNotificationsRead(t *testing.T) { } func TestActivityService_GetThread(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/notifications/threads/1", func(w http.ResponseWriter, r *http.Request) { @@ -178,6 +183,7 @@ func TestActivityService_GetThread(t *testing.T) { } func TestActivityService_MarkThreadRead(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/notifications/threads/1", func(w http.ResponseWriter, r *http.Request) { @@ -203,6 +209,7 @@ func TestActivityService_MarkThreadRead(t *testing.T) { } func TestActivityService_MarkThreadDone(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/notifications/threads/1", func(w http.ResponseWriter, r *http.Request) { @@ -228,6 +235,7 @@ func TestActivityService_MarkThreadDone(t *testing.T) { } func TestActivityService_GetThreadSubscription(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/notifications/threads/1/subscription", func(w http.ResponseWriter, r *http.Request) { @@ -262,6 +270,7 @@ func TestActivityService_GetThreadSubscription(t *testing.T) { } func TestActivityService_SetThreadSubscription(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &Subscription{Subscribed: Bool(true)} @@ -305,6 +314,7 @@ func TestActivityService_SetThreadSubscription(t *testing.T) { } func TestActivityService_DeleteThreadSubscription(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/notifications/threads/1/subscription", func(w http.ResponseWriter, r *http.Request) { @@ -330,6 +340,7 @@ func TestActivityService_DeleteThreadSubscription(t *testing.T) { } func TestNotification_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Notification{}, "{}") u := &Notification{ @@ -376,6 +387,7 @@ func TestNotification_Marshal(t *testing.T) { } func TestNotificationSubject_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &NotificationSubject{}, "{}") u := &NotificationSubject{ @@ -396,6 +408,7 @@ func TestNotificationSubject_Marshal(t *testing.T) { } func TestMarkReadOptions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &markReadOptions{}, "{}") u := &markReadOptions{ diff --git a/github/activity_star_test.go b/github/activity_star_test.go index 9943fad4792..ceb9e94ef65 100644 --- a/github/activity_star_test.go +++ b/github/activity_star_test.go @@ -17,6 +17,7 @@ import ( ) func TestActivityService_ListStargazers(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/stargazers", func(w http.ResponseWriter, r *http.Request) { @@ -56,6 +57,7 @@ func TestActivityService_ListStargazers(t *testing.T) { } func TestActivityService_ListStarred_authenticatedUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/starred", func(w http.ResponseWriter, r *http.Request) { @@ -91,6 +93,7 @@ func TestActivityService_ListStarred_authenticatedUser(t *testing.T) { } func TestActivityService_ListStarred_specifiedUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/starred", func(w http.ResponseWriter, r *http.Request) { @@ -132,6 +135,7 @@ func TestActivityService_ListStarred_specifiedUser(t *testing.T) { } func TestActivityService_ListStarred_invalidUser(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -140,6 +144,7 @@ func TestActivityService_ListStarred_invalidUser(t *testing.T) { } func TestActivityService_IsStarred_hasStar(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/starred/o/r", func(w http.ResponseWriter, r *http.Request) { @@ -172,6 +177,7 @@ func TestActivityService_IsStarred_hasStar(t *testing.T) { } func TestActivityService_IsStarred_noStar(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/starred/o/r", func(w http.ResponseWriter, r *http.Request) { @@ -204,6 +210,7 @@ func TestActivityService_IsStarred_noStar(t *testing.T) { } func TestActivityService_IsStarred_invalidID(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -212,6 +219,7 @@ func TestActivityService_IsStarred_invalidID(t *testing.T) { } func TestActivityService_Star(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/starred/o/r", func(w http.ResponseWriter, r *http.Request) { @@ -236,6 +244,7 @@ func TestActivityService_Star(t *testing.T) { } func TestActivityService_Star_invalidID(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -244,6 +253,7 @@ func TestActivityService_Star_invalidID(t *testing.T) { } func TestActivityService_Unstar(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/starred/o/r", func(w http.ResponseWriter, r *http.Request) { @@ -268,6 +278,7 @@ func TestActivityService_Unstar(t *testing.T) { } func TestActivityService_Unstar_invalidID(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -276,6 +287,7 @@ func TestActivityService_Unstar_invalidID(t *testing.T) { } func TestStarredRepository_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &StarredRepository{}, "{}") u := &StarredRepository{ @@ -300,6 +312,7 @@ func TestStarredRepository_Marshal(t *testing.T) { } func TestStargazer_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Stargazer{}, "{}") u := &Stargazer{ diff --git a/github/activity_test.go b/github/activity_test.go index 9c50e6c4b48..dc8d41c9a97 100644 --- a/github/activity_test.go +++ b/github/activity_test.go @@ -14,6 +14,7 @@ import ( ) func TestActivityService_List(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/feeds", func(w http.ResponseWriter, r *http.Request) { @@ -131,6 +132,7 @@ var wantFeeds = &Feeds{ } func TestFeedLink_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &FeedLink{}, "{}") u := &FeedLink{ @@ -147,6 +149,7 @@ func TestFeedLink_Marshal(t *testing.T) { } func TestFeeds_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Feeds{}, "{}") u := &Feeds{ @@ -237,6 +240,7 @@ func TestFeeds_Marshal(t *testing.T) { } func TestFeedLinks_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &FeedLinks{}, "{}") u := &FeedLinks{ diff --git a/github/activity_watching_test.go b/github/activity_watching_test.go index 081d7600f1a..98a9f5000c5 100644 --- a/github/activity_watching_test.go +++ b/github/activity_watching_test.go @@ -16,6 +16,7 @@ import ( ) func TestActivityService_ListWatchers(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/subscribers", func(w http.ResponseWriter, r *http.Request) { @@ -54,6 +55,7 @@ func TestActivityService_ListWatchers(t *testing.T) { } func TestActivityService_ListWatched_authenticatedUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/subscriptions", func(w http.ResponseWriter, r *http.Request) { @@ -91,6 +93,7 @@ func TestActivityService_ListWatched_authenticatedUser(t *testing.T) { } func TestActivityService_ListWatched_specifiedUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/subscriptions", func(w http.ResponseWriter, r *http.Request) { @@ -114,6 +117,7 @@ func TestActivityService_ListWatched_specifiedUser(t *testing.T) { } func TestActivityService_GetRepositorySubscription_true(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/subscription", func(w http.ResponseWriter, r *http.Request) { @@ -148,6 +152,7 @@ func TestActivityService_GetRepositorySubscription_true(t *testing.T) { } func TestActivityService_GetRepositorySubscription_false(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/subscription", func(w http.ResponseWriter, r *http.Request) { @@ -168,6 +173,7 @@ func TestActivityService_GetRepositorySubscription_false(t *testing.T) { } func TestActivityService_GetRepositorySubscription_error(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/subscription", func(w http.ResponseWriter, r *http.Request) { @@ -183,6 +189,7 @@ func TestActivityService_GetRepositorySubscription_error(t *testing.T) { } func TestActivityService_SetRepositorySubscription(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &Subscription{Subscribed: Bool(true)} @@ -226,6 +233,7 @@ func TestActivityService_SetRepositorySubscription(t *testing.T) { } func TestActivityService_DeleteRepositorySubscription(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/subscription", func(w http.ResponseWriter, r *http.Request) { @@ -251,6 +259,7 @@ func TestActivityService_DeleteRepositorySubscription(t *testing.T) { } func TestSubscription_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Subscription{}, "{}") u := &Subscription{ diff --git a/github/admin_orgs_test.go b/github/admin_orgs_test.go index 860c21f1ebb..48f10089c9b 100644 --- a/github/admin_orgs_test.go +++ b/github/admin_orgs_test.go @@ -16,6 +16,7 @@ import ( ) func TestAdminOrgs_Create(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &Organization{ @@ -57,6 +58,7 @@ func TestAdminOrgs_Create(t *testing.T) { } func TestAdminOrgs_Rename(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &Organization{ @@ -98,6 +100,7 @@ func TestAdminOrgs_Rename(t *testing.T) { } func TestAdminOrgs_RenameByName(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/admin/organizations/o", func(w http.ResponseWriter, r *http.Request) { @@ -140,6 +143,7 @@ func TestAdminOrgs_RenameByName(t *testing.T) { } func TestCreateOrgRequest_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &createOrgRequest{}, "{}") u := &createOrgRequest{ @@ -156,6 +160,7 @@ func TestCreateOrgRequest_Marshal(t *testing.T) { } func TestRenameOrgRequest_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &renameOrgRequest{}, "{}") u := &renameOrgRequest{ @@ -170,6 +175,7 @@ func TestRenameOrgRequest_Marshal(t *testing.T) { } func TestRenameOrgResponse_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &renameOrgRequest{}, "{}") u := &RenameOrgResponse{ diff --git a/github/admin_stats_test.go b/github/admin_stats_test.go index 55a2ee7b51d..e12f6df5fcf 100644 --- a/github/admin_stats_test.go +++ b/github/admin_stats_test.go @@ -10,6 +10,7 @@ import ( ) func TestAdminService_GetAdminStats(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprise/stats/all", func(w http.ResponseWriter, r *http.Request) { @@ -96,6 +97,7 @@ func TestAdminService_GetAdminStats(t *testing.T) { } func TestAdminService_Stringify(t *testing.T) { + t.Parallel() want := "github.AdminStats{Issues:github.IssueStats{TotalIssues:179, OpenIssues:83, ClosedIssues:96}, Hooks:github.HookStats{TotalHooks:27, ActiveHooks:23, InactiveHooks:4}, Milestones:github.MilestoneStats{TotalMilestones:7, OpenMilestones:6, ClosedMilestones:1}, Orgs:github.OrgStats{TotalOrgs:33, DisabledOrgs:0, TotalTeams:60, TotalTeamMembers:314}, Comments:github.CommentStats{TotalCommitComments:6, TotalGistComments:28, TotalIssueComments:366, TotalPullRequestComments:30}, Pages:github.PageStats{TotalPages:36}, Users:github.UserStats{TotalUsers:254, AdminUsers:45, SuspendedUsers:21}, Gists:github.GistStats{TotalGists:178, PrivateGists:151, PublicGists:25}, Pulls:github.PullStats{TotalPulls:86, MergedPulls:60, MergablePulls:21, UnmergablePulls:3}, Repos:github.RepoStats{TotalRepos:212, RootRepos:194, ForkRepos:18, OrgRepos:51, TotalPushes:3082, TotalWikis:15}}" if got := testAdminStats.String(); got != want { t.Errorf("testAdminStats.String = %q, want %q", got, want) @@ -210,6 +212,7 @@ var testAdminStats = &AdminStats{ } func TestIssueStats_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &IssueStats{}, "{}") u := &IssueStats{ @@ -228,6 +231,7 @@ func TestIssueStats_Marshal(t *testing.T) { } func TestHookStats_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &HookStats{}, "{}") u := &HookStats{ @@ -246,6 +250,7 @@ func TestHookStats_Marshal(t *testing.T) { } func TestMilestoneStats_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &MilestoneStats{}, "{}") u := &MilestoneStats{ @@ -264,6 +269,7 @@ func TestMilestoneStats_Marshal(t *testing.T) { } func TestOrgStats_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &OrgStats{}, "{}") u := &OrgStats{ @@ -284,6 +290,7 @@ func TestOrgStats_Marshal(t *testing.T) { } func TestCommentStats_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &CommentStats{}, "{}") u := &CommentStats{ @@ -304,6 +311,7 @@ func TestCommentStats_Marshal(t *testing.T) { } func TestPageStats_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PageStats{}, "{}") u := &PageStats{ @@ -318,6 +326,7 @@ func TestPageStats_Marshal(t *testing.T) { } func TestUserStats_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &UserStats{}, "{}") u := &UserStats{ @@ -336,6 +345,7 @@ func TestUserStats_Marshal(t *testing.T) { } func TestGistStats_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &GistStats{}, "{}") u := &GistStats{ @@ -354,6 +364,7 @@ func TestGistStats_Marshal(t *testing.T) { } func TestPullStats_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PullStats{}, "{}") u := &PullStats{ @@ -374,6 +385,7 @@ func TestPullStats_Marshal(t *testing.T) { } func TestRepoStats_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &RepoStats{}, "{}") u := &RepoStats{ @@ -398,6 +410,7 @@ func TestRepoStats_Marshal(t *testing.T) { } func TestAdminStats_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &AdminStats{}, "{}") u := &AdminStats{ diff --git a/github/admin_test.go b/github/admin_test.go index 29f8b0c50bc..ae5b86b8998 100644 --- a/github/admin_test.go +++ b/github/admin_test.go @@ -16,6 +16,7 @@ import ( ) func TestAdminService_UpdateUserLDAPMapping(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &UserLDAPMapping{ @@ -63,6 +64,7 @@ func TestAdminService_UpdateUserLDAPMapping(t *testing.T) { } func TestAdminService_UpdateTeamLDAPMapping(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &TeamLDAPMapping{ @@ -110,6 +112,7 @@ func TestAdminService_UpdateTeamLDAPMapping(t *testing.T) { } func TestAdminService_TeamLDAPMapping_String(t *testing.T) { + t.Parallel() v := &TeamLDAPMapping{ ID: Int64(1), LDAPDN: String("a"), @@ -130,6 +133,7 @@ func TestAdminService_TeamLDAPMapping_String(t *testing.T) { } func TestAdminService_UserLDAPMapping_String(t *testing.T) { + t.Parallel() v := &UserLDAPMapping{ ID: Int64(1), LDAPDN: String("a"), @@ -157,6 +161,7 @@ func TestAdminService_UserLDAPMapping_String(t *testing.T) { } func TestTeamLDAPMapping_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &TeamLDAPMapping{}, "{}") u := &TeamLDAPMapping{ @@ -189,6 +194,7 @@ func TestTeamLDAPMapping_Marshal(t *testing.T) { } func TestUserLDAPMapping_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &UserLDAPMapping{}, "{}") u := &UserLDAPMapping{ @@ -235,6 +241,7 @@ func TestUserLDAPMapping_Marshal(t *testing.T) { } func TestEnterprise_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Enterprise{}, "{}") u := &Enterprise{ diff --git a/github/admin_users_test.go b/github/admin_users_test.go index 7eb3ec6e702..e0094255858 100644 --- a/github/admin_users_test.go +++ b/github/admin_users_test.go @@ -17,6 +17,7 @@ import ( ) func TestAdminUsers_Create(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/admin/users", func(w http.ResponseWriter, r *http.Request) { @@ -62,6 +63,7 @@ func TestAdminUsers_Create(t *testing.T) { } func TestAdminUsers_Delete(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/admin/users/github", func(w http.ResponseWriter, r *http.Request) { @@ -86,6 +88,7 @@ func TestAdminUsers_Delete(t *testing.T) { } func TestUserImpersonation_Create(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/admin/users/github/authorizations", func(w http.ResponseWriter, r *http.Request) { @@ -157,6 +160,7 @@ func TestUserImpersonation_Create(t *testing.T) { } func TestUserImpersonation_Delete(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/admin/users/github/authorizations", func(w http.ResponseWriter, r *http.Request) { @@ -181,6 +185,7 @@ func TestUserImpersonation_Delete(t *testing.T) { } func TestCreateUserRequest_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &CreateUserRequest{}, "{}") u := &CreateUserRequest{ @@ -197,6 +202,7 @@ func TestCreateUserRequest_Marshal(t *testing.T) { } func TestImpersonateUserOptions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ImpersonateUserOptions{}, "{}") u := &ImpersonateUserOptions{ @@ -213,6 +219,7 @@ func TestImpersonateUserOptions_Marshal(t *testing.T) { } func TestOAuthAPP_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &OAuthAPP{}, "{}") u := &OAuthAPP{ @@ -231,6 +238,7 @@ func TestOAuthAPP_Marshal(t *testing.T) { } func TestUserAuthorization_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &UserAuthorization{}, "{}") u := &UserAuthorization{ diff --git a/github/apps_hooks_deliveries_test.go b/github/apps_hooks_deliveries_test.go index c2952f0c8db..2fdc2c6c83c 100644 --- a/github/apps_hooks_deliveries_test.go +++ b/github/apps_hooks_deliveries_test.go @@ -15,6 +15,7 @@ import ( ) func TestAppsService_ListHookDeliveries(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/app/hook/deliveries", func(w http.ResponseWriter, r *http.Request) { @@ -48,6 +49,7 @@ func TestAppsService_ListHookDeliveries(t *testing.T) { } func TestAppsService_GetHookDelivery(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/app/hook/deliveries/1", func(w http.ResponseWriter, r *http.Request) { @@ -82,6 +84,7 @@ func TestAppsService_GetHookDelivery(t *testing.T) { } func TestAppsService_RedeliverHookDelivery(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/app/hook/deliveries/1/attempts", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/apps_hooks_test.go b/github/apps_hooks_test.go index 1646c311175..e55b995193c 100644 --- a/github/apps_hooks_test.go +++ b/github/apps_hooks_test.go @@ -15,6 +15,7 @@ import ( ) func TestAppsService_GetHookConfig(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/app/hook/config", func(w http.ResponseWriter, r *http.Request) { @@ -54,6 +55,7 @@ func TestAppsService_GetHookConfig(t *testing.T) { } func TestAppsService_UpdateHookConfig(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &HookConfig{ diff --git a/github/apps_installation_test.go b/github/apps_installation_test.go index 09d54a8cd8f..0a121bfd6cb 100644 --- a/github/apps_installation_test.go +++ b/github/apps_installation_test.go @@ -16,6 +16,7 @@ import ( ) func TestAppsService_ListRepos(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) wantAcceptHeaders := []string{ @@ -56,6 +57,7 @@ func TestAppsService_ListRepos(t *testing.T) { } func TestAppsService_ListUserRepos(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) wantAcceptHeaders := []string{ @@ -101,6 +103,7 @@ func TestAppsService_ListUserRepos(t *testing.T) { } func TestAppsService_AddRepository(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/installations/1/repositories/1", func(w http.ResponseWriter, r *http.Request) { @@ -130,6 +133,7 @@ func TestAppsService_AddRepository(t *testing.T) { } func TestAppsService_RemoveRepository(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/installations/1/repositories/1", func(w http.ResponseWriter, r *http.Request) { @@ -150,6 +154,7 @@ func TestAppsService_RemoveRepository(t *testing.T) { } func TestAppsService_RevokeInstallationToken(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/installation/token", func(w http.ResponseWriter, r *http.Request) { @@ -170,6 +175,7 @@ func TestAppsService_RevokeInstallationToken(t *testing.T) { } func TestListRepositories_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ListRepositories{}, "{}") u := &ListRepositories{ diff --git a/github/apps_manifest_test.go b/github/apps_manifest_test.go index 9ac57983710..35e5db2fd96 100644 --- a/github/apps_manifest_test.go +++ b/github/apps_manifest_test.go @@ -26,6 +26,7 @@ const ( ) func TestGetConfig(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/app-manifests/code/conversions", func(w http.ResponseWriter, r *http.Request) { @@ -67,6 +68,7 @@ func TestGetConfig(t *testing.T) { } func TestAppConfig_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &AppConfig{}, "{}") u := &AppConfig{ diff --git a/github/apps_marketplace_test.go b/github/apps_marketplace_test.go index bc4e2e88a05..3780bad0965 100644 --- a/github/apps_marketplace_test.go +++ b/github/apps_marketplace_test.go @@ -15,6 +15,7 @@ import ( ) func TestMarketplaceService_ListPlans(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/marketplace_listing/plans", func(w http.ResponseWriter, r *http.Request) { @@ -50,6 +51,7 @@ func TestMarketplaceService_ListPlans(t *testing.T) { } func TestMarketplaceService_Stubbed_ListPlans(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/marketplace_listing/stubbed/plans", func(w http.ResponseWriter, r *http.Request) { @@ -72,6 +74,7 @@ func TestMarketplaceService_Stubbed_ListPlans(t *testing.T) { } func TestMarketplaceService_ListPlanAccountsForPlan(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/marketplace_listing/plans/1/accounts", func(w http.ResponseWriter, r *http.Request) { @@ -103,6 +106,7 @@ func TestMarketplaceService_ListPlanAccountsForPlan(t *testing.T) { } func TestMarketplaceService_Stubbed_ListPlanAccountsForPlan(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/marketplace_listing/stubbed/plans/1/accounts", func(w http.ResponseWriter, r *http.Request) { @@ -125,6 +129,7 @@ func TestMarketplaceService_Stubbed_ListPlanAccountsForPlan(t *testing.T) { } func TestMarketplaceService_GetPlanAccountForAccount(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/marketplace_listing/accounts/1", func(w http.ResponseWriter, r *http.Request) { @@ -155,6 +160,7 @@ func TestMarketplaceService_GetPlanAccountForAccount(t *testing.T) { } func TestMarketplaceService_Stubbed_GetPlanAccountForAccount(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/marketplace_listing/stubbed/accounts/1", func(w http.ResponseWriter, r *http.Request) { @@ -176,6 +182,7 @@ func TestMarketplaceService_Stubbed_GetPlanAccountForAccount(t *testing.T) { } func TestMarketplaceService_ListMarketplacePurchasesForUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/marketplace_purchases", func(w http.ResponseWriter, r *http.Request) { @@ -207,6 +214,7 @@ func TestMarketplaceService_ListMarketplacePurchasesForUser(t *testing.T) { } func TestMarketplaceService_Stubbed_ListMarketplacePurchasesForUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/marketplace_purchases/stubbed", func(w http.ResponseWriter, r *http.Request) { @@ -229,6 +237,7 @@ func TestMarketplaceService_Stubbed_ListMarketplacePurchasesForUser(t *testing.T } func TestMarketplacePlan_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &MarketplacePlan{}, "{}") u := &MarketplacePlan{ @@ -267,6 +276,7 @@ func TestMarketplacePlan_Marshal(t *testing.T) { } func TestMarketplacePurchase_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &MarketplacePurchase{}, "{}") u := &MarketplacePurchase{ @@ -321,6 +331,7 @@ func TestMarketplacePurchase_Marshal(t *testing.T) { } func TestMarketplacePendingChange_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &MarketplacePendingChange{}, "{}") u := &MarketplacePendingChange{ @@ -369,6 +380,7 @@ func TestMarketplacePendingChange_Marshal(t *testing.T) { } func TestMarketplacePlanAccount_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &MarketplacePlanAccount{}, "{}") u := &MarketplacePlanAccount{ diff --git a/github/apps_test.go b/github/apps_test.go index 8557a93e666..8356e63634f 100644 --- a/github/apps_test.go +++ b/github/apps_test.go @@ -17,6 +17,7 @@ import ( ) func TestAppsService_Get_authenticatedApp(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/app", func(w http.ResponseWriter, r *http.Request) { @@ -51,6 +52,7 @@ func TestAppsService_Get_authenticatedApp(t *testing.T) { } func TestAppsService_Get_specifiedApp(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/apps/a", func(w http.ResponseWriter, r *http.Request) { @@ -71,6 +73,7 @@ func TestAppsService_Get_specifiedApp(t *testing.T) { } func TestAppsService_ListInstallationRequests(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/app/installation-requests", func(w http.ResponseWriter, r *http.Request) { @@ -117,6 +120,7 @@ func TestAppsService_ListInstallationRequests(t *testing.T) { } func TestAppsService_ListInstallations(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/app/installations", func(w http.ResponseWriter, r *http.Request) { @@ -250,6 +254,7 @@ func TestAppsService_ListInstallations(t *testing.T) { } func TestAppsService_GetInstallation(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/app/installations/1", func(w http.ResponseWriter, r *http.Request) { @@ -284,6 +289,7 @@ func TestAppsService_GetInstallation(t *testing.T) { } func TestAppsService_ListUserInstallations(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/installations", func(w http.ResponseWriter, r *http.Request) { @@ -318,6 +324,7 @@ func TestAppsService_ListUserInstallations(t *testing.T) { } func TestAppsService_SuspendInstallation(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/app/installations/1/suspended", func(w http.ResponseWriter, r *http.Request) { @@ -343,6 +350,7 @@ func TestAppsService_SuspendInstallation(t *testing.T) { } func TestAppsService_UnsuspendInstallation(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/app/installations/1/suspended", func(w http.ResponseWriter, r *http.Request) { @@ -368,6 +376,7 @@ func TestAppsService_UnsuspendInstallation(t *testing.T) { } func TestAppsService_DeleteInstallation(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/app/installations/1", func(w http.ResponseWriter, r *http.Request) { @@ -393,6 +402,7 @@ func TestAppsService_DeleteInstallation(t *testing.T) { } func TestAppsService_CreateInstallationToken(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/app/installations/1/access_tokens", func(w http.ResponseWriter, r *http.Request) { @@ -427,6 +437,7 @@ func TestAppsService_CreateInstallationToken(t *testing.T) { } func TestAppsService_CreateInstallationTokenWithOptions(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) installationTokenOptions := &InstallationTokenOptions{ @@ -463,6 +474,7 @@ func TestAppsService_CreateInstallationTokenWithOptions(t *testing.T) { } func TestAppsService_CreateInstallationTokenListReposWithOptions(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) installationTokenListRepoOptions := &InstallationTokenListRepoOptions{ @@ -498,6 +510,7 @@ func TestAppsService_CreateInstallationTokenListReposWithOptions(t *testing.T) { } func TestAppsService_CreateInstallationTokenListReposWithNoOptions(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/app/installations/1/access_tokens", func(w http.ResponseWriter, r *http.Request) { @@ -532,6 +545,7 @@ func TestAppsService_CreateInstallationTokenListReposWithNoOptions(t *testing.T) } func TestAppsService_CreateAttachment(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/content_references/11/attachments", func(w http.ResponseWriter, r *http.Request) { @@ -569,6 +583,7 @@ func TestAppsService_CreateAttachment(t *testing.T) { } func TestAppsService_FindOrganizationInstallation(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/installation", func(w http.ResponseWriter, r *http.Request) { @@ -603,6 +618,7 @@ func TestAppsService_FindOrganizationInstallation(t *testing.T) { } func TestAppsService_FindRepositoryInstallation(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/installation", func(w http.ResponseWriter, r *http.Request) { @@ -637,6 +653,7 @@ func TestAppsService_FindRepositoryInstallation(t *testing.T) { } func TestAppsService_FindRepositoryInstallationByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repositories/1/installation", func(w http.ResponseWriter, r *http.Request) { @@ -671,6 +688,7 @@ func TestAppsService_FindRepositoryInstallationByID(t *testing.T) { } func TestAppsService_FindUserInstallation(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/installation", func(w http.ResponseWriter, r *http.Request) { @@ -705,6 +723,7 @@ func TestAppsService_FindUserInstallation(t *testing.T) { } func TestContentReference_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ContentReference{}, "{}") u := &ContentReference{ @@ -723,6 +742,7 @@ func TestContentReference_Marshal(t *testing.T) { } func TestAttachment_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Attachment{}, "{}") u := &Attachment{ @@ -741,6 +761,7 @@ func TestAttachment_Marshal(t *testing.T) { } func TestInstallationPermissions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &InstallationPermissions{}, "{}") u := &InstallationPermissions{ @@ -819,6 +840,7 @@ func TestInstallationPermissions_Marshal(t *testing.T) { } func TestInstallation_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Installation{}, "{}") u := &Installation{ @@ -1021,6 +1043,7 @@ func TestInstallation_Marshal(t *testing.T) { } func TestInstallationTokenOptions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &InstallationTokenOptions{}, "{}") u := &InstallationTokenOptions{ @@ -1107,6 +1130,7 @@ func TestInstallationTokenOptions_Marshal(t *testing.T) { } func TestInstallationToken_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &InstallationToken{}, "{}") u := &InstallationToken{ @@ -1209,6 +1233,7 @@ func TestInstallationToken_Marshal(t *testing.T) { } func TestApp_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &App{}, "{}") u := &App{ diff --git a/github/authorizations_test.go b/github/authorizations_test.go index 99d99db01a5..6c644996515 100644 --- a/github/authorizations_test.go +++ b/github/authorizations_test.go @@ -15,6 +15,7 @@ import ( ) func TestAuthorizationsService_Check(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/applications/id/token", func(w http.ResponseWriter, r *http.Request) { @@ -51,6 +52,7 @@ func TestAuthorizationsService_Check(t *testing.T) { } func TestAuthorizationsService_Reset(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/applications/id/token", func(w http.ResponseWriter, r *http.Request) { @@ -87,6 +89,7 @@ func TestAuthorizationsService_Reset(t *testing.T) { } func TestAuthorizationsService_Revoke(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/applications/id/token", func(w http.ResponseWriter, r *http.Request) { @@ -114,6 +117,7 @@ func TestAuthorizationsService_Revoke(t *testing.T) { } func TestDeleteGrant(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/applications/id/grant", func(w http.ResponseWriter, r *http.Request) { @@ -140,6 +144,7 @@ func TestDeleteGrant(t *testing.T) { } func TestAuthorizationsService_CreateImpersonation(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/admin/users/u/authorizations", func(w http.ResponseWriter, r *http.Request) { @@ -175,6 +180,7 @@ func TestAuthorizationsService_CreateImpersonation(t *testing.T) { } func TestAuthorizationsService_DeleteImpersonation(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/admin/users/u/authorizations", func(w http.ResponseWriter, r *http.Request) { @@ -199,6 +205,7 @@ func TestAuthorizationsService_DeleteImpersonation(t *testing.T) { } func TestAuthorizationUpdateRequest_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &AuthorizationUpdateRequest{}, "{}") u := &AuthorizationUpdateRequest{ @@ -223,6 +230,7 @@ func TestAuthorizationUpdateRequest_Marshal(t *testing.T) { } func TestAuthorizationRequest_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &AuthorizationRequest{}, "{}") u := &AuthorizationRequest{ @@ -247,6 +255,7 @@ func TestAuthorizationRequest_Marshal(t *testing.T) { } func TestAuthorizationApp_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &AuthorizationApp{}, "{}") u := &AuthorizationApp{ @@ -265,6 +274,7 @@ func TestAuthorizationApp_Marshal(t *testing.T) { } func TestGrant_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Grant{}, "{}") u := &Grant{ @@ -297,6 +307,7 @@ func TestGrant_Marshal(t *testing.T) { } func TestAuthorization_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Authorization{}, "{}") u := &Authorization{ diff --git a/github/billing_test.go b/github/billing_test.go index 5db4344b6a9..716f50d3c6b 100644 --- a/github/billing_test.go +++ b/github/billing_test.go @@ -15,6 +15,7 @@ import ( ) func TestBillingService_GetActionsBillingOrg(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/settings/billing/actions", func(w http.ResponseWriter, r *http.Request) { @@ -67,6 +68,7 @@ func TestBillingService_GetActionsBillingOrg(t *testing.T) { } func TestBillingService_GetActionsBillingOrg_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -75,6 +77,7 @@ func TestBillingService_GetActionsBillingOrg_invalidOrg(t *testing.T) { } func TestBillingService_GetPackagesBillingOrg(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/settings/billing/packages", func(w http.ResponseWriter, r *http.Request) { @@ -117,6 +120,7 @@ func TestBillingService_GetPackagesBillingOrg(t *testing.T) { } func TestBillingService_GetPackagesBillingOrg_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -125,6 +129,7 @@ func TestBillingService_GetPackagesBillingOrg_invalidOrg(t *testing.T) { } func TestBillingService_GetStorageBillingOrg(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/settings/billing/shared-storage", func(w http.ResponseWriter, r *http.Request) { @@ -167,6 +172,7 @@ func TestBillingService_GetStorageBillingOrg(t *testing.T) { } func TestBillingService_GetStorageBillingOrg_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -175,6 +181,7 @@ func TestBillingService_GetStorageBillingOrg_invalidOrg(t *testing.T) { } func TestBillingService_GetActionsBillingUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/settings/billing/actions", func(w http.ResponseWriter, r *http.Request) { @@ -227,6 +234,7 @@ func TestBillingService_GetActionsBillingUser(t *testing.T) { } func TestBillingService_GetActionsBillingUser_invalidUser(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -235,6 +243,7 @@ func TestBillingService_GetActionsBillingUser_invalidUser(t *testing.T) { } func TestBillingService_GetPackagesBillingUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/settings/billing/packages", func(w http.ResponseWriter, r *http.Request) { @@ -277,6 +286,7 @@ func TestBillingService_GetPackagesBillingUser(t *testing.T) { } func TestBillingService_GetPackagesBillingUser_invalidUser(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -285,6 +295,7 @@ func TestBillingService_GetPackagesBillingUser_invalidUser(t *testing.T) { } func TestBillingService_GetStorageBillingUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/settings/billing/shared-storage", func(w http.ResponseWriter, r *http.Request) { @@ -327,6 +338,7 @@ func TestBillingService_GetStorageBillingUser(t *testing.T) { } func TestBillingService_GetStorageBillingUser_invalidUser(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -335,6 +347,7 @@ func TestBillingService_GetStorageBillingUser_invalidUser(t *testing.T) { } func TestMinutesUsedBreakdown_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &MinutesUsedBreakdown{}, "{}") u := &MinutesUsedBreakdown{ @@ -353,6 +366,7 @@ func TestMinutesUsedBreakdown_Marshal(t *testing.T) { } func TestActionBilling_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &MinutesUsedBreakdown{}, "{}") u := &ActionBilling{ @@ -381,6 +395,7 @@ func TestActionBilling_Marshal(t *testing.T) { } func TestPackageBilling_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PackageBilling{}, "{}") u := &PackageBilling{ @@ -399,6 +414,7 @@ func TestPackageBilling_Marshal(t *testing.T) { } func TestStorageBilling_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &StorageBilling{}, "{}") u := &StorageBilling{ @@ -417,6 +433,7 @@ func TestStorageBilling_Marshal(t *testing.T) { } func TestBillingService_GetAdvancedSecurityActiveCommittersOrg(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/settings/billing/advanced-security", func(w http.ResponseWriter, r *http.Request) { @@ -486,6 +503,7 @@ func TestBillingService_GetAdvancedSecurityActiveCommittersOrg(t *testing.T) { } func TestBillingService_GetAdvancedSecurityActiveCommittersOrg_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() diff --git a/github/checks_test.go b/github/checks_test.go index 2ed7b0f8d17..08e934c8d8a 100644 --- a/github/checks_test.go +++ b/github/checks_test.go @@ -16,6 +16,7 @@ import ( ) func TestChecksService_GetCheckRun(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/check-runs/1", func(w http.ResponseWriter, r *http.Request) { @@ -65,6 +66,7 @@ func TestChecksService_GetCheckRun(t *testing.T) { } func TestChecksService_GetCheckSuite(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/check-suites/1", func(w http.ResponseWriter, r *http.Request) { @@ -113,6 +115,7 @@ func TestChecksService_GetCheckSuite(t *testing.T) { } func TestChecksService_CreateCheckRun(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/check-runs", func(w http.ResponseWriter, r *http.Request) { @@ -179,6 +182,7 @@ func TestChecksService_CreateCheckRun(t *testing.T) { } func TestChecksService_ListCheckRunAnnotations(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/check-runs/1/annotations", func(w http.ResponseWriter, r *http.Request) { @@ -238,6 +242,7 @@ func TestChecksService_ListCheckRunAnnotations(t *testing.T) { } func TestChecksService_UpdateCheckRun(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/check-runs/1", func(w http.ResponseWriter, r *http.Request) { @@ -303,6 +308,7 @@ func TestChecksService_UpdateCheckRun(t *testing.T) { } func TestChecksService_ListCheckRunsForRef(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/commits/master/check-runs", func(w http.ResponseWriter, r *http.Request) { @@ -374,6 +380,7 @@ func TestChecksService_ListCheckRunsForRef(t *testing.T) { } func TestChecksService_ListCheckRunsCheckSuite(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/check-suites/1/check-runs", func(w http.ResponseWriter, r *http.Request) { @@ -440,6 +447,7 @@ func TestChecksService_ListCheckRunsCheckSuite(t *testing.T) { } func TestChecksService_ListCheckSuiteForRef(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/commits/master/check-suites", func(w http.ResponseWriter, r *http.Request) { @@ -505,6 +513,7 @@ func TestChecksService_ListCheckSuiteForRef(t *testing.T) { } func TestChecksService_SetCheckSuitePreferences(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/check-suites/preferences", func(w http.ResponseWriter, r *http.Request) { @@ -551,6 +560,7 @@ func TestChecksService_SetCheckSuitePreferences(t *testing.T) { } func TestChecksService_CreateCheckSuite(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/check-suites", func(w http.ResponseWriter, r *http.Request) { @@ -606,6 +616,7 @@ func TestChecksService_CreateCheckSuite(t *testing.T) { } func TestChecksService_ReRequestCheckSuite(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/check-suites/1/rerequest", func(w http.ResponseWriter, r *http.Request) { @@ -630,6 +641,7 @@ func TestChecksService_ReRequestCheckSuite(t *testing.T) { } func Test_CheckRunMarshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &CheckRun{}, "{}") now := time.Now() @@ -812,6 +824,7 @@ func Test_CheckRunMarshal(t *testing.T) { } func Test_CheckSuiteMarshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &CheckSuite{}, "{}") now := time.Now() @@ -951,6 +964,7 @@ func Test_CheckSuiteMarshal(t *testing.T) { } func TestCheckRunAnnotation_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &CheckRunAnnotation{}, "{}") u := &CheckRunAnnotation{ @@ -981,6 +995,7 @@ func TestCheckRunAnnotation_Marshal(t *testing.T) { } func TestCheckRunImage_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &CheckRunImage{}, "{}") u := &CheckRunImage{ @@ -999,6 +1014,7 @@ func TestCheckRunImage_Marshal(t *testing.T) { } func TestCheckRunAction_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &CheckRunAction{}, "{}") u := &CheckRunAction{ @@ -1017,6 +1033,7 @@ func TestCheckRunAction_Marshal(t *testing.T) { } func TestAutoTriggerCheck_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &AutoTriggerCheck{}, "{}") u := &AutoTriggerCheck{ @@ -1033,6 +1050,7 @@ func TestAutoTriggerCheck_Marshal(t *testing.T) { } func TestCreateCheckSuiteOptions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &CreateCheckSuiteOptions{}, "{}") u := &CreateCheckSuiteOptions{ @@ -1049,6 +1067,7 @@ func TestCreateCheckSuiteOptions_Marshal(t *testing.T) { } func TestCheckRunOutput_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &CheckRunOutput{}, "{}") u := &CheckRunOutput{ @@ -1111,6 +1130,7 @@ func TestCheckRunOutput_Marshal(t *testing.T) { } func TestCreateCheckRunOptions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &CreateCheckRunOptions{}, "{}") u := &CreateCheckRunOptions{ @@ -1207,6 +1227,7 @@ func TestCreateCheckRunOptions_Marshal(t *testing.T) { } func TestUpdateCheckRunOptions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &UpdateCheckRunOptions{}, "{}") u := &UpdateCheckRunOptions{ @@ -1299,6 +1320,7 @@ func TestUpdateCheckRunOptions_Marshal(t *testing.T) { } func TestListCheckRunsResults_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ListCheckRunsResults{}, "{}") l := &ListCheckRunsResults{ @@ -1489,6 +1511,7 @@ func TestListCheckRunsResults_Marshal(t *testing.T) { } func TestListCheckSuiteResults_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ListCheckSuiteResults{}, "{}") l := &ListCheckSuiteResults{ @@ -1629,6 +1652,7 @@ func TestListCheckSuiteResults_Marshal(t *testing.T) { } func TestCheckSuitePreferenceOptions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &CheckSuitePreferenceOptions{}, "{}") u := &CheckSuitePreferenceOptions{ @@ -1653,6 +1677,7 @@ func TestCheckSuitePreferenceOptions_Marshal(t *testing.T) { } func TestPreferenceList_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PreferenceList{}, "{}") u := &PreferenceList{ @@ -1677,6 +1702,7 @@ func TestPreferenceList_Marshal(t *testing.T) { } func TestCheckSuitePreferenceResults_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &CheckSuitePreferenceResults{}, "{}") u := &CheckSuitePreferenceResults{ @@ -1715,6 +1741,7 @@ func TestCheckSuitePreferenceResults_Marshal(t *testing.T) { } func TestChecksService_ReRequestCheckRun(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/check-runs/1/rerequest", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/code-scanning_test.go b/github/code-scanning_test.go index f9c3154ce25..64cb49a1aed 100644 --- a/github/code-scanning_test.go +++ b/github/code-scanning_test.go @@ -17,6 +17,7 @@ import ( ) func TestCodeScanningService_Alert_ID(t *testing.T) { + t.Parallel() // Test: nil Alert ID == 0 var a *Alert id := a.ID() @@ -55,6 +56,7 @@ func TestCodeScanningService_Alert_ID(t *testing.T) { } func TestCodeScanningService_UploadSarif(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) expectedSarifID := &SarifID{ @@ -99,6 +101,7 @@ func TestCodeScanningService_UploadSarif(t *testing.T) { } func TestCodeScanningService_GetSARIF(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/code-scanning/sarifs/abc", func(w http.ResponseWriter, r *http.Request) { @@ -139,6 +142,7 @@ func TestCodeScanningService_GetSARIF(t *testing.T) { } func TestCodeScanningService_ListAlertsForOrg(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/code-scanning/alerts", func(w http.ResponseWriter, r *http.Request) { @@ -342,6 +346,7 @@ func TestCodeScanningService_ListAlertsForOrg(t *testing.T) { } func TestCodeScanningService_ListAlertsForOrgLisCursorOptions(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/code-scanning/alerts", func(w http.ResponseWriter, r *http.Request) { @@ -467,6 +472,7 @@ func TestCodeScanningService_ListAlertsForOrgLisCursorOptions(t *testing.T) { } func TestCodeScanningService_ListAlertsForRepo(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/code-scanning/alerts", func(w http.ResponseWriter, r *http.Request) { @@ -660,6 +666,7 @@ func TestCodeScanningService_ListAlertsForRepo(t *testing.T) { } func TestCodeScanningService_UpdateAlert(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/code-scanning/alerts/88", func(w http.ResponseWriter, r *http.Request) { @@ -777,6 +784,7 @@ func TestCodeScanningService_UpdateAlert(t *testing.T) { } func TestCodeScanningService_ListAlertInstances(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/code-scanning/alerts/88/instances", func(w http.ResponseWriter, r *http.Request) { @@ -855,6 +863,7 @@ func TestCodeScanningService_ListAlertInstances(t *testing.T) { } func TestCodeScanningService_GetAlert(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/code-scanning/alerts/88", func(w http.ResponseWriter, r *http.Request) { @@ -966,6 +975,7 @@ func TestCodeScanningService_GetAlert(t *testing.T) { } func TestAlert_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Alert{}, "{}") u := &Alert{ @@ -1022,6 +1032,7 @@ func TestAlert_Marshal(t *testing.T) { } func TestLocation_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Location{}, "{}") u := &Location{ @@ -1044,6 +1055,7 @@ func TestLocation_Marshal(t *testing.T) { } func TestRule_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Rule{}, "{}") u := &Rule{ @@ -1072,6 +1084,7 @@ func TestRule_Marshal(t *testing.T) { } func TestTool_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Tool{}, "{}") u := &Tool{ @@ -1090,6 +1103,7 @@ func TestTool_Marshal(t *testing.T) { } func TestMessage_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Message{}, "{}") u := &Message{ @@ -1104,6 +1118,7 @@ func TestMessage_Marshal(t *testing.T) { } func TestCodeScanningService_ListAnalysesForRepo(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/code-scanning/analyses", func(w http.ResponseWriter, r *http.Request) { @@ -1227,6 +1242,7 @@ func TestCodeScanningService_ListAnalysesForRepo(t *testing.T) { } func TestCodeScanningService_GetAnalysis(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/code-scanning/analyses/3602840", func(w http.ResponseWriter, r *http.Request) { @@ -1302,6 +1318,7 @@ func TestCodeScanningService_GetAnalysis(t *testing.T) { } func TestCodeScanningService_DeleteAnalysis(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/code-scanning/analyses/40", func(w http.ResponseWriter, r *http.Request) { @@ -1342,6 +1359,7 @@ func TestCodeScanningService_DeleteAnalysis(t *testing.T) { } func TestCodeScanningService_ListCodeQLDatabases(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/code-scanning/codeql/databases", func(w http.ResponseWriter, r *http.Request) { @@ -1440,6 +1458,7 @@ func TestCodeScanningService_ListCodeQLDatabases(t *testing.T) { } func TestCodeScanningService_GetCodeQLDatabase(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/code-scanning/codeql/databases/lang", func(w http.ResponseWriter, r *http.Request) { @@ -1534,6 +1553,7 @@ func TestCodeScanningService_GetCodeQLDatabase(t *testing.T) { } func TestCodeScanningService_GetDefaultSetupConfiguration(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/code-scanning/default-setup", func(w http.ResponseWriter, r *http.Request) { @@ -1586,6 +1606,7 @@ func TestCodeScanningService_GetDefaultSetupConfiguration(t *testing.T) { } func TestCodeScanningService_UpdateDefaultSetupConfiguration(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/code-scanning/default-setup", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/codesofconduct_test.go b/github/codesofconduct_test.go index f4b17eb4761..7d237791b13 100644 --- a/github/codesofconduct_test.go +++ b/github/codesofconduct_test.go @@ -15,6 +15,7 @@ import ( ) func TestCodesOfConductService_List(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/codes_of_conduct", func(w http.ResponseWriter, r *http.Request) { @@ -52,6 +53,7 @@ func TestCodesOfConductService_List(t *testing.T) { } func TestCodesOfConductService_Get(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/codes_of_conduct/k", func(w http.ResponseWriter, r *http.Request) { @@ -95,6 +97,7 @@ func TestCodesOfConductService_Get(t *testing.T) { } func TestCodeOfConduct_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &CodeOfConduct{}, "{}") a := &CodeOfConduct{ diff --git a/github/codespaces_secrets_test.go b/github/codespaces_secrets_test.go index 4a5cdfd3e60..9199a93b935 100644 --- a/github/codespaces_secrets_test.go +++ b/github/codespaces_secrets_test.go @@ -16,6 +16,7 @@ import ( ) func TestCodespacesService_ListSecrets(t *testing.T) { + t.Parallel() type test struct { name string handleFunc func(*http.ServeMux) @@ -76,7 +77,9 @@ func TestCodespacesService_ListSecrets(t *testing.T) { } for _, tt := range tests { + tt := tt t.Run(tt.name, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) tt.handleFunc(mux) @@ -117,6 +120,7 @@ func TestCodespacesService_ListSecrets(t *testing.T) { } func TestCodespacesService_GetSecret(t *testing.T) { + t.Parallel() type test struct { name string handleFunc func(*http.ServeMux) @@ -173,7 +177,9 @@ func TestCodespacesService_GetSecret(t *testing.T) { } for _, tt := range tests { + tt := tt t.Run(tt.name, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) tt.handleFunc(mux) @@ -208,6 +214,7 @@ func TestCodespacesService_GetSecret(t *testing.T) { } func TestCodespacesService_CreateOrUpdateSecret(t *testing.T) { + t.Parallel() type test struct { name string handleFunc func(*http.ServeMux) @@ -270,7 +277,9 @@ func TestCodespacesService_CreateOrUpdateSecret(t *testing.T) { } for _, tt := range tests { + tt := tt t.Run(tt.name, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) tt.handleFunc(mux) @@ -301,6 +310,7 @@ func TestCodespacesService_CreateOrUpdateSecret(t *testing.T) { } func TestCodespacesService_DeleteSecret(t *testing.T) { + t.Parallel() type test struct { name string handleFunc func(*http.ServeMux) @@ -354,7 +364,9 @@ func TestCodespacesService_DeleteSecret(t *testing.T) { } for _, tt := range tests { + tt := tt t.Run(tt.name, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) tt.handleFunc(mux) @@ -380,6 +392,7 @@ func TestCodespacesService_DeleteSecret(t *testing.T) { } func TestCodespacesService_GetPublicKey(t *testing.T) { + t.Parallel() type test struct { name string handleFunc func(*http.ServeMux) @@ -437,7 +450,9 @@ func TestCodespacesService_GetPublicKey(t *testing.T) { } for _, tt := range tests { + tt := tt t.Run(tt.name, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) tt.handleFunc(mux) @@ -472,6 +487,7 @@ func TestCodespacesService_GetPublicKey(t *testing.T) { } func TestCodespacesService_ListSelectedReposForSecret(t *testing.T) { + t.Parallel() type test struct { name string handleFunc func(*http.ServeMux) @@ -513,7 +529,9 @@ func TestCodespacesService_ListSelectedReposForSecret(t *testing.T) { } for _, tt := range tests { + tt := tt t.Run(tt.name, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) tt.handleFunc(mux) @@ -554,6 +572,7 @@ func TestCodespacesService_ListSelectedReposForSecret(t *testing.T) { } func TestCodespacesService_SetSelectedReposForSecret(t *testing.T) { + t.Parallel() type test struct { name string handleFunc func(*http.ServeMux) @@ -597,7 +616,9 @@ func TestCodespacesService_SetSelectedReposForSecret(t *testing.T) { } for _, tt := range tests { + tt := tt t.Run(tt.name, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) tt.handleFunc(mux) @@ -623,6 +644,7 @@ func TestCodespacesService_SetSelectedReposForSecret(t *testing.T) { } func TestCodespacesService_AddSelectedReposForSecret(t *testing.T) { + t.Parallel() type test struct { name string handleFunc func(*http.ServeMux) @@ -662,7 +684,9 @@ func TestCodespacesService_AddSelectedReposForSecret(t *testing.T) { } for _, tt := range tests { + tt := tt t.Run(tt.name, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) tt.handleFunc(mux) @@ -688,6 +712,7 @@ func TestCodespacesService_AddSelectedReposForSecret(t *testing.T) { } func TestCodespacesService_RemoveSelectedReposFromSecret(t *testing.T) { + t.Parallel() type test struct { name string handleFunc func(*http.ServeMux) @@ -727,7 +752,9 @@ func TestCodespacesService_RemoveSelectedReposFromSecret(t *testing.T) { } for _, tt := range tests { + tt := tt t.Run(tt.name, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) tt.handleFunc(mux) diff --git a/github/codespaces_test.go b/github/codespaces_test.go index 03ca709c6fe..13ceb92a057 100644 --- a/github/codespaces_test.go +++ b/github/codespaces_test.go @@ -16,6 +16,7 @@ import ( ) func TestCodespacesService_ListInRepo(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/owner/repo/codespaces", func(w http.ResponseWriter, r *http.Request) { @@ -100,6 +101,7 @@ func TestCodespacesService_ListInRepo(t *testing.T) { } func TestCodespacesService_List(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/codespaces", func(w http.ResponseWriter, r *http.Request) { @@ -142,6 +144,7 @@ func TestCodespacesService_List(t *testing.T) { } func TestCodespacesService_CreateInRepo(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/owner/repo/codespaces", func(w http.ResponseWriter, r *http.Request) { @@ -188,6 +191,7 @@ func TestCodespacesService_CreateInRepo(t *testing.T) { } func TestCodespacesService_Start(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/codespaces/codespace_1/start", func(w http.ResponseWriter, r *http.Request) { @@ -226,6 +230,7 @@ func TestCodespacesService_Start(t *testing.T) { } func TestCodespacesService_Stop(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/codespaces/codespace_1/stop", func(w http.ResponseWriter, r *http.Request) { @@ -264,6 +269,7 @@ func TestCodespacesService_Stop(t *testing.T) { } func TestCodespacesService_Delete(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/codespaces/codespace_1", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/copilot_test.go b/github/copilot_test.go index 22b6e8eddae..7b82390af86 100644 --- a/github/copilot_test.go +++ b/github/copilot_test.go @@ -18,6 +18,7 @@ import ( // Test invalid JSON responses, valid responses are covered in the other tests func TestCopilotSeatDetails_UnmarshalJSON(t *testing.T) { + t.Parallel() tests := []struct { name string data string @@ -112,9 +113,11 @@ func TestCopilotSeatDetails_UnmarshalJSON(t *testing.T) { } for _, tc := range tests { + tc := tc seatDetails := &CopilotSeatDetails{} t.Run(tc.name, func(t *testing.T) { + t.Parallel() err := json.Unmarshal([]byte(tc.data), seatDetails) if err == nil && tc.wantErr { t.Errorf("CopilotSeatDetails.UnmarshalJSON returned nil instead of an error") @@ -130,6 +133,7 @@ func TestCopilotSeatDetails_UnmarshalJSON(t *testing.T) { } func TestCopilotService_GetSeatDetailsUser(t *testing.T) { + t.Parallel() data := `{ "assignee": { "type": "User", @@ -178,6 +182,7 @@ func TestCopilotService_GetSeatDetailsUser(t *testing.T) { } func TestCopilotService_GetSeatDetailsTeam(t *testing.T) { + t.Parallel() data := `{ "assignee": { "type": "Team", @@ -225,6 +230,7 @@ func TestCopilotService_GetSeatDetailsTeam(t *testing.T) { } func TestCopilotService_GetSeatDetailsOrganization(t *testing.T) { + t.Parallel() data := `{ "assignee": { "type": "Organization", @@ -272,6 +278,7 @@ func TestCopilotService_GetSeatDetailsOrganization(t *testing.T) { } func TestCopilotService_GetCopilotBilling(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/copilot/billing", func(w http.ResponseWriter, r *http.Request) { @@ -330,6 +337,7 @@ func TestCopilotService_GetCopilotBilling(t *testing.T) { } func TestCopilotService_ListCopilotSeats(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/copilot/billing/seats", func(w http.ResponseWriter, r *http.Request) { @@ -602,6 +610,7 @@ func TestCopilotService_ListCopilotSeats(t *testing.T) { } func TestCopilotService_AddCopilotTeams(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/copilot/billing/selected_teams", func(w http.ResponseWriter, r *http.Request) { @@ -639,6 +648,7 @@ func TestCopilotService_AddCopilotTeams(t *testing.T) { } func TestCopilotService_RemoveCopilotTeams(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/copilot/billing/selected_teams", func(w http.ResponseWriter, r *http.Request) { @@ -676,6 +686,7 @@ func TestCopilotService_RemoveCopilotTeams(t *testing.T) { } func TestCopilotService_AddCopilotUsers(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/copilot/billing/selected_users", func(w http.ResponseWriter, r *http.Request) { @@ -713,6 +724,7 @@ func TestCopilotService_AddCopilotUsers(t *testing.T) { } func TestCopilotService_RemoveCopilotUsers(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/copilot/billing/selected_users", func(w http.ResponseWriter, r *http.Request) { @@ -750,6 +762,7 @@ func TestCopilotService_RemoveCopilotUsers(t *testing.T) { } func TestCopilotService_GetSeatDetails(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/members/u/copilot", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/dependabot_alerts_test.go b/github/dependabot_alerts_test.go index 99e33f31128..e5c31875a77 100644 --- a/github/dependabot_alerts_test.go +++ b/github/dependabot_alerts_test.go @@ -15,6 +15,7 @@ import ( ) func TestDependabotService_ListRepoAlerts(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/dependabot/alerts", func(w http.ResponseWriter, r *http.Request) { @@ -54,6 +55,7 @@ func TestDependabotService_ListRepoAlerts(t *testing.T) { } func TestDependabotService_GetRepoAlert(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/dependabot/alerts/42", func(w http.ResponseWriter, r *http.Request) { @@ -91,6 +93,7 @@ func TestDependabotService_GetRepoAlert(t *testing.T) { } func TestDependabotService_ListOrgAlerts(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/dependabot/alerts", func(w http.ResponseWriter, r *http.Request) { @@ -130,6 +133,7 @@ func TestDependabotService_ListOrgAlerts(t *testing.T) { } func TestDependabotService_UpdateAlert(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) state := String("dismissed") diff --git a/github/dependabot_secrets_test.go b/github/dependabot_secrets_test.go index 9965c811078..7b7ea5f85a1 100644 --- a/github/dependabot_secrets_test.go +++ b/github/dependabot_secrets_test.go @@ -16,6 +16,7 @@ import ( ) func TestDependabotService_GetRepoPublicKey(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/dependabot/secrets/public-key", func(w http.ResponseWriter, r *http.Request) { @@ -50,6 +51,7 @@ func TestDependabotService_GetRepoPublicKey(t *testing.T) { } func TestDependabotService_GetRepoPublicKeyNumeric(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/dependabot/secrets/public-key", func(w http.ResponseWriter, r *http.Request) { @@ -84,6 +86,7 @@ func TestDependabotService_GetRepoPublicKeyNumeric(t *testing.T) { } func TestDependabotService_ListRepoSecrets(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/dependabot/secrets", func(w http.ResponseWriter, r *http.Request) { @@ -126,6 +129,7 @@ func TestDependabotService_ListRepoSecrets(t *testing.T) { } func TestDependabotService_GetRepoSecret(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/dependabot/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { @@ -164,6 +168,7 @@ func TestDependabotService_GetRepoSecret(t *testing.T) { } func TestDependabotService_CreateOrUpdateRepoSecret(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/dependabot/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { @@ -196,6 +201,7 @@ func TestDependabotService_CreateOrUpdateRepoSecret(t *testing.T) { } func TestDependabotService_DeleteRepoSecret(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/dependabot/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { @@ -220,6 +226,7 @@ func TestDependabotService_DeleteRepoSecret(t *testing.T) { } func TestDependabotService_GetOrgPublicKey(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/dependabot/secrets/public-key", func(w http.ResponseWriter, r *http.Request) { @@ -254,6 +261,7 @@ func TestDependabotService_GetOrgPublicKey(t *testing.T) { } func TestDependabotService_ListOrgSecrets(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/dependabot/secrets", func(w http.ResponseWriter, r *http.Request) { @@ -297,6 +305,7 @@ func TestDependabotService_ListOrgSecrets(t *testing.T) { } func TestDependabotService_GetOrgSecret(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/dependabot/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { @@ -337,6 +346,7 @@ func TestDependabotService_GetOrgSecret(t *testing.T) { } func TestDependabotService_CreateOrUpdateOrgSecret(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/dependabot/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { @@ -371,6 +381,7 @@ func TestDependabotService_CreateOrUpdateOrgSecret(t *testing.T) { } func TestDependabotService_ListSelectedReposForOrgSecret(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/dependabot/secrets/NAME/repositories", func(w http.ResponseWriter, r *http.Request) { @@ -411,6 +422,7 @@ func TestDependabotService_ListSelectedReposForOrgSecret(t *testing.T) { } func TestDependabotService_SetSelectedReposForOrgSecret(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/dependabot/secrets/NAME/repositories", func(w http.ResponseWriter, r *http.Request) { @@ -437,6 +449,7 @@ func TestDependabotService_SetSelectedReposForOrgSecret(t *testing.T) { } func TestDependabotService_AddSelectedRepoToOrgSecret(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/dependabot/secrets/NAME/repositories/1234", func(w http.ResponseWriter, r *http.Request) { @@ -462,6 +475,7 @@ func TestDependabotService_AddSelectedRepoToOrgSecret(t *testing.T) { } func TestDependabotService_RemoveSelectedRepoFromOrgSecret(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/dependabot/secrets/NAME/repositories/1234", func(w http.ResponseWriter, r *http.Request) { @@ -487,6 +501,7 @@ func TestDependabotService_RemoveSelectedRepoFromOrgSecret(t *testing.T) { } func TestDependabotService_DeleteOrgSecret(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/dependabot/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/dependency_graph_snapshots_test.go b/github/dependency_graph_snapshots_test.go index c58edde617f..604edeca91a 100644 --- a/github/dependency_graph_snapshots_test.go +++ b/github/dependency_graph_snapshots_test.go @@ -16,6 +16,7 @@ import ( ) func TestDependencyGraphService_CreateSnapshot(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/dependency-graph/snapshots", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/dependency_graph_test.go b/github/dependency_graph_test.go index e75df13ac29..0bef36df28d 100644 --- a/github/dependency_graph_test.go +++ b/github/dependency_graph_test.go @@ -16,6 +16,7 @@ import ( ) func TestDependencyGraphService_GetSBOM(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/owner/repo/dependency-graph/sbom", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/emojis_test.go b/github/emojis_test.go index 474cace8bc2..8f7bed5c4c3 100644 --- a/github/emojis_test.go +++ b/github/emojis_test.go @@ -15,6 +15,7 @@ import ( ) func TestEmojisService_List(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/emojis", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/enterprise_actions_runner_groups_test.go b/github/enterprise_actions_runner_groups_test.go index 562a5884b01..7612ba55909 100644 --- a/github/enterprise_actions_runner_groups_test.go +++ b/github/enterprise_actions_runner_groups_test.go @@ -15,6 +15,7 @@ import ( ) func TestEnterpriseService_ListRunnerGroups(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/o/actions/runner-groups", func(w http.ResponseWriter, r *http.Request) { @@ -58,6 +59,7 @@ func TestEnterpriseService_ListRunnerGroups(t *testing.T) { } func TestEnterpriseService_ListRunnerGroupsVisibleToOrganization(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/o/actions/runner-groups", func(w http.ResponseWriter, r *http.Request) { @@ -101,6 +103,7 @@ func TestEnterpriseService_ListRunnerGroupsVisibleToOrganization(t *testing.T) { } func TestEnterpriseService_GetRunnerGroup(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/o/actions/runner-groups/2", func(w http.ResponseWriter, r *http.Request) { @@ -147,6 +150,7 @@ func TestEnterpriseService_GetRunnerGroup(t *testing.T) { } func TestEnterpriseService_DeleteRunnerGroup(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/o/actions/runner-groups/2", func(w http.ResponseWriter, r *http.Request) { @@ -171,6 +175,7 @@ func TestEnterpriseService_DeleteRunnerGroup(t *testing.T) { } func TestEnterpriseService_CreateRunnerGroup(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/o/actions/runner-groups", func(w http.ResponseWriter, r *http.Request) { @@ -224,6 +229,7 @@ func TestEnterpriseService_CreateRunnerGroup(t *testing.T) { } func TestEnterpriseService_UpdateRunnerGroup(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/o/actions/runner-groups/2", func(w http.ResponseWriter, r *http.Request) { @@ -277,6 +283,7 @@ func TestEnterpriseService_UpdateRunnerGroup(t *testing.T) { } func TestEnterpriseService_ListOrganizationAccessRunnerGroup(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/o/actions/runner-groups/2/organizations", func(w http.ResponseWriter, r *http.Request) { @@ -318,6 +325,7 @@ func TestEnterpriseService_ListOrganizationAccessRunnerGroup(t *testing.T) { } func TestEnterpriseService_SetOrganizationAccessRunnerGroup(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/o/actions/runner-groups/2/organizations", func(w http.ResponseWriter, r *http.Request) { @@ -349,6 +357,7 @@ func TestEnterpriseService_SetOrganizationAccessRunnerGroup(t *testing.T) { } func TestEnterpriseService_AddOrganizationAccessRunnerGroup(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/o/actions/runner-groups/2/organizations/42", func(w http.ResponseWriter, r *http.Request) { @@ -373,6 +382,7 @@ func TestEnterpriseService_AddOrganizationAccessRunnerGroup(t *testing.T) { } func TestEnterpriseService_RemoveOrganizationAccessRunnerGroup(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/o/actions/runner-groups/2/organizations/42", func(w http.ResponseWriter, r *http.Request) { @@ -397,6 +407,7 @@ func TestEnterpriseService_RemoveOrganizationAccessRunnerGroup(t *testing.T) { } func TestEnterpriseService_ListEnterpriseRunnerGroupRunners(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/o/actions/runner-groups/2/runners", func(w http.ResponseWriter, r *http.Request) { @@ -439,6 +450,7 @@ func TestEnterpriseService_ListEnterpriseRunnerGroupRunners(t *testing.T) { } func TestEnterpriseService_SetEnterpriseRunnerGroupRunners(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/o/actions/runner-groups/2/runners", func(w http.ResponseWriter, r *http.Request) { @@ -470,6 +482,7 @@ func TestEnterpriseService_SetEnterpriseRunnerGroupRunners(t *testing.T) { } func TestEnterpriseService_AddEnterpriseRunnerGroupRunners(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/o/actions/runner-groups/2/runners/42", func(w http.ResponseWriter, r *http.Request) { @@ -494,6 +507,7 @@ func TestEnterpriseService_AddEnterpriseRunnerGroupRunners(t *testing.T) { } func TestEnterpriseService_RemoveEnterpriseRunnerGroupRunners(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/o/actions/runner-groups/2/runners/42", func(w http.ResponseWriter, r *http.Request) { @@ -518,6 +532,7 @@ func TestEnterpriseService_RemoveEnterpriseRunnerGroupRunners(t *testing.T) { } func TestEnterpriseRunnerGroup_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &EnterpriseRunnerGroup{}, "{}") u := &EnterpriseRunnerGroup{ @@ -550,6 +565,7 @@ func TestEnterpriseRunnerGroup_Marshal(t *testing.T) { } func TestEnterpriseRunnerGroups_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &EnterpriseRunnerGroups{}, "{}") u := &EnterpriseRunnerGroups{ @@ -590,6 +606,7 @@ func TestEnterpriseRunnerGroups_Marshal(t *testing.T) { } func TestCreateEnterpriseRunnerGroupRequest_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &CreateEnterpriseRunnerGroupRequest{}, "{}") u := &CreateEnterpriseRunnerGroupRequest{ @@ -616,6 +633,7 @@ func TestCreateEnterpriseRunnerGroupRequest_Marshal(t *testing.T) { } func TestUpdateEnterpriseRunnerGroupRequest_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &UpdateEnterpriseRunnerGroupRequest{}, "{}") u := &UpdateEnterpriseRunnerGroupRequest{ @@ -638,6 +656,7 @@ func TestUpdateEnterpriseRunnerGroupRequest_Marshal(t *testing.T) { } func TestSetOrgAccessRunnerGroupRequest_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &SetOrgAccessRunnerGroupRequest{}, "{}") u := &SetOrgAccessRunnerGroupRequest{ diff --git a/github/enterprise_actions_runners_test.go b/github/enterprise_actions_runners_test.go index e1adba8fa4b..114ece8745d 100644 --- a/github/enterprise_actions_runners_test.go +++ b/github/enterprise_actions_runners_test.go @@ -17,6 +17,7 @@ import ( ) func TestEnterpriseService_GenerateEnterpriseJITConfig(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &GenerateJITConfigRequest{Name: "test", RunnerGroupID: 1, Labels: []string{"one", "two"}} @@ -63,6 +64,7 @@ func TestEnterpriseService_GenerateEnterpriseJITConfig(t *testing.T) { } func TestEnterpriseService_CreateRegistrationToken(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/actions/runners/registration-token", func(w http.ResponseWriter, r *http.Request) { @@ -99,6 +101,7 @@ func TestEnterpriseService_CreateRegistrationToken(t *testing.T) { } func TestEnterpriseService_ListRunners(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/actions/runners", func(w http.ResponseWriter, r *http.Request) { @@ -143,6 +146,7 @@ func TestEnterpriseService_ListRunners(t *testing.T) { } func TestEnterpriseService_GetRunner(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/actions/runners/23", func(w http.ResponseWriter, r *http.Request) { @@ -182,6 +186,7 @@ func TestEnterpriseService_GetRunner(t *testing.T) { } func TestEnterpriseService_RemoveRunner(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/o/actions/runners/21", func(w http.ResponseWriter, r *http.Request) { @@ -206,6 +211,7 @@ func TestEnterpriseService_RemoveRunner(t *testing.T) { } func TestEnterpriseService_ListRunnerApplicationDownloads(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/o/actions/runners/downloads", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/enterprise_audit_log_test.go b/github/enterprise_audit_log_test.go index 15fdce4d8f0..77a4dc162cc 100644 --- a/github/enterprise_audit_log_test.go +++ b/github/enterprise_audit_log_test.go @@ -14,6 +14,7 @@ import ( ) func TestEnterpriseService_GetAuditLog(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/audit-log", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/enterprise_code_security_and_analysis_test.go b/github/enterprise_code_security_and_analysis_test.go index d3453e29747..2cf5c310323 100644 --- a/github/enterprise_code_security_and_analysis_test.go +++ b/github/enterprise_code_security_and_analysis_test.go @@ -16,6 +16,7 @@ import ( ) func TestEnterpriseService_GetCodeSecurityAndAnalysis(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/code_security_and_analysis", func(w http.ResponseWriter, r *http.Request) { @@ -66,6 +67,7 @@ func TestEnterpriseService_GetCodeSecurityAndAnalysis(t *testing.T) { } func TestEnterpriseService_UpdateCodeSecurityAndAnalysis(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &EnterpriseSecurityAnalysisSettings{ @@ -106,6 +108,7 @@ func TestEnterpriseService_UpdateCodeSecurityAndAnalysis(t *testing.T) { } func TestEnterpriseService_EnableAdvancedSecurity(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/advanced_security/enable_all", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/event_test.go b/github/event_test.go index 66a6bcd7e45..7d5ad54e514 100644 --- a/github/event_test.go +++ b/github/event_test.go @@ -11,6 +11,7 @@ import ( ) func TestPayload_Panic(t *testing.T) { + t.Parallel() defer func() { if r := recover(); r == nil { t.Errorf("Payload did not panic but should have") @@ -24,6 +25,7 @@ func TestPayload_Panic(t *testing.T) { } func TestPayload_NoPanic(t *testing.T) { + t.Parallel() name := "UserEvent" body := json.RawMessage("{}") e := &Event{Type: &name, RawPayload: &body} @@ -31,6 +33,7 @@ func TestPayload_NoPanic(t *testing.T) { } func TestEmptyEvent_NoPanic(t *testing.T) { + t.Parallel() e := &Event{} if _, err := e.ParsePayload(); err == nil { t.Error("ParsePayload unexpectedly succeeded on empty event") @@ -43,6 +46,7 @@ func TestEmptyEvent_NoPanic(t *testing.T) { } func TestEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Event{}, "{}") l := make(map[string]interface{}) diff --git a/github/event_types_test.go b/github/event_types_test.go index 6f5235efe9e..474c9ceb3dc 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -11,6 +11,7 @@ import ( ) func TestEditChange_Marshal_TitleChange(t *testing.T) { + t.Parallel() testJSONMarshal(t, &EditChange{}, "{}") u := &EditChange{ @@ -31,6 +32,7 @@ func TestEditChange_Marshal_TitleChange(t *testing.T) { } func TestEditChange_Marshal_BodyChange(t *testing.T) { + t.Parallel() testJSONMarshal(t, &EditChange{}, "{}") u := &EditChange{ @@ -51,6 +53,7 @@ func TestEditChange_Marshal_BodyChange(t *testing.T) { } func TestEditChange_Marshal_BaseChange(t *testing.T) { + t.Parallel() testJSONMarshal(t, &EditChange{}, "{}") Base := EditBase{ @@ -83,6 +86,7 @@ func TestEditChange_Marshal_BaseChange(t *testing.T) { } func TestEditChange_Marshal_Repo(t *testing.T) { + t.Parallel() testJSONMarshal(t, &EditChange{}, "{}") u := &EditChange{ @@ -114,6 +118,7 @@ func TestEditChange_Marshal_Repo(t *testing.T) { } func TestEditChange_Marshal_TransferFromUser(t *testing.T) { + t.Parallel() testJSONMarshal(t, &EditChange{}, "{}") u := &EditChange{ @@ -152,6 +157,7 @@ func TestEditChange_Marshal_TransferFromUser(t *testing.T) { } func TestEditChange_Marshal_TransferFromOrg(t *testing.T) { + t.Parallel() testJSONMarshal(t, &EditChange{}, "{}") u := &EditChange{ @@ -190,6 +196,7 @@ func TestEditChange_Marshal_TransferFromOrg(t *testing.T) { } func TestProjectChange_Marshal_NameChange(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ProjectChange{}, "{}") u := &ProjectChange{ @@ -207,6 +214,7 @@ func TestProjectChange_Marshal_NameChange(t *testing.T) { } func TestProjectChange_Marshal_BodyChange(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ProjectChange{}, "{}") u := &ProjectChange{ @@ -224,6 +232,7 @@ func TestProjectChange_Marshal_BodyChange(t *testing.T) { } func TestProjectCardChange_Marshal_NoteChange(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ProjectCardChange{}, "{}") u := &ProjectCardChange{ @@ -240,6 +249,7 @@ func TestProjectCardChange_Marshal_NoteChange(t *testing.T) { } func TestProjectColumnChange_Marshal_NameChange(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ProjectColumnChange{}, "{}") u := &ProjectColumnChange{ @@ -256,6 +266,7 @@ func TestProjectColumnChange_Marshal_NameChange(t *testing.T) { } func TestTeamAddEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &TeamAddEvent{}, "{}") u := &TeamAddEvent{ @@ -608,6 +619,7 @@ func TestTeamAddEvent_Marshal(t *testing.T) { } func TestStarEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &StarEvent{}, "{}") u := &StarEvent{ @@ -696,6 +708,7 @@ func TestStarEvent_Marshal(t *testing.T) { } func TestTeamEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &TeamEvent{}, "{}") u := &TeamEvent{ @@ -1090,6 +1103,7 @@ func TestTeamEvent_Marshal(t *testing.T) { } func TestInstallationRepositoriesEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &InstallationRepositoriesEvent{}, "{}") u := &InstallationRepositoriesEvent{ @@ -1342,6 +1356,7 @@ func TestInstallationRepositoriesEvent_Marshal(t *testing.T) { } func TestInstallationTargetEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &InstallationTargetEvent{}, "{}") u := &InstallationTargetEvent{ @@ -1678,6 +1693,7 @@ func TestInstallationTargetEvent_Marshal(t *testing.T) { } func TestEditTitle_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &EditTitle{}, "{}") u := &EditTitle{ @@ -1692,6 +1708,7 @@ func TestEditTitle_Marshal(t *testing.T) { } func TestEditBody_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &EditBody{}, "{}") u := &EditBody{ @@ -1706,6 +1723,7 @@ func TestEditBody_Marshal(t *testing.T) { } func TestEditBase_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &EditBase{}, "{}") u := &EditBase{ @@ -1730,6 +1748,7 @@ func TestEditBase_Marshal(t *testing.T) { } func TestEditRef_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &EditRef{}, "{}") u := &EditRef{ @@ -1744,6 +1763,7 @@ func TestEditRef_Marshal(t *testing.T) { } func TestEditSHA_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &EditSHA{}, "{}") u := &EditSHA{ @@ -1758,6 +1778,7 @@ func TestEditSHA_Marshal(t *testing.T) { } func TestProjectName_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ProjectName{}, "{}") u := &ProjectName{ @@ -1772,6 +1793,7 @@ func TestProjectName_Marshal(t *testing.T) { } func TestProjectBody_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ProjectBody{}, "{}") u := &ProjectBody{ @@ -1786,6 +1808,7 @@ func TestProjectBody_Marshal(t *testing.T) { } func TestProjectCardNote_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ProjectCardNote{}, "{}") u := &ProjectCardNote{ @@ -1800,6 +1823,7 @@ func TestProjectCardNote_Marshal(t *testing.T) { } func TestProjectColumnName_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ProjectColumnName{}, "{}") u := &ProjectColumnName{ @@ -1814,6 +1838,7 @@ func TestProjectColumnName_Marshal(t *testing.T) { } func TestTeamDescription_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &TeamDescription{}, "{}") u := &TeamDescription{ @@ -1828,6 +1853,7 @@ func TestTeamDescription_Marshal(t *testing.T) { } func TestTeamName_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &TeamName{}, "{}") u := &TeamName{ @@ -1842,6 +1868,7 @@ func TestTeamName_Marshal(t *testing.T) { } func TestTeamPrivacy_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &TeamPrivacy{}, "{}") u := &TeamPrivacy{ @@ -1856,6 +1883,7 @@ func TestTeamPrivacy_Marshal(t *testing.T) { } func TestTeamRepository_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &TeamRepository{}, "{}") u := &TeamRepository{ @@ -1882,6 +1910,7 @@ func TestTeamRepository_Marshal(t *testing.T) { } func TestTeamPermissions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &TeamPermissions{}, "{}") u := &TeamPermissions{ @@ -1904,6 +1933,7 @@ func TestTeamPermissions_Marshal(t *testing.T) { } func TestTeamPermissionsFrom_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &TeamPermissionsFrom{}, "{}") u := &TeamPermissionsFrom{ @@ -1922,6 +1952,7 @@ func TestTeamPermissionsFrom_Marshal(t *testing.T) { } func TestRepositoryVulnerabilityAlert_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &RepositoryVulnerabilityAlert{}, "{}") u := &RepositoryVulnerabilityAlert{ @@ -1968,6 +1999,7 @@ func TestRepositoryVulnerabilityAlert_Marshal(t *testing.T) { } func TestPage_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Page{}, "{}") u := &Page{ @@ -1992,6 +2024,7 @@ func TestPage_Marshal(t *testing.T) { } func TestTeamChange_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &TeamChange{}, "{}") u := &TeamChange{ @@ -2040,6 +2073,7 @@ func TestTeamChange_Marshal(t *testing.T) { } func TestIssueCommentEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &IssueCommentEvent{}, "{}") u := &IssueCommentEvent{ @@ -2356,6 +2390,7 @@ func TestIssueCommentEvent_Marshal(t *testing.T) { } func TestIssuesEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &IssuesEvent{}, "{}") u := &IssuesEvent{ @@ -2646,6 +2681,7 @@ func TestIssuesEvent_Marshal(t *testing.T) { } func TestLabelEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &LabelEvent{}, "{}") u := &LabelEvent{ @@ -2940,6 +2976,7 @@ func TestLabelEvent_Marshal(t *testing.T) { } func TestMilestoneEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &MilestoneEvent{}, "{}") u := &MilestoneEvent{ @@ -3252,6 +3289,7 @@ func TestMilestoneEvent_Marshal(t *testing.T) { } func TestPublicEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PublicEvent{}, "{}") u := &PublicEvent{ @@ -3482,6 +3520,7 @@ func TestPublicEvent_Marshal(t *testing.T) { } func TestPullRequestReviewEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PullRequestReviewEvent{}, "{}") u := &PullRequestReviewEvent{ @@ -3766,6 +3805,7 @@ func TestPullRequestReviewEvent_Marshal(t *testing.T) { } func TestPushEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PushEvent{}, "{}") u := &PushEvent{ @@ -4082,6 +4122,7 @@ func TestPushEvent_Marshal(t *testing.T) { } func TestStatusEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &StatusEvent{}, "{}") u := &StatusEvent{ @@ -4340,6 +4381,7 @@ func TestStatusEvent_Marshal(t *testing.T) { } func TestMarketplacePurchaseEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &MarketplacePurchaseEvent{}, "{}") u := &MarketplacePurchaseEvent{ @@ -4660,6 +4702,7 @@ func TestMarketplacePurchaseEvent_Marshal(t *testing.T) { } func TestOrganizationEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &OrganizationEvent{}, "{}") u := &OrganizationEvent{ @@ -5004,6 +5047,7 @@ func TestOrganizationEvent_Marshal(t *testing.T) { } func TestPageBuildEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PageBuildEvent{}, "{}") u := &PageBuildEvent{ @@ -5240,6 +5284,7 @@ func TestPageBuildEvent_Marshal(t *testing.T) { } func TestCommitCommentEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &CommitCommentEvent{}, "{}") u := &CommitCommentEvent{ @@ -5538,6 +5583,7 @@ func TestCommitCommentEvent_Marshal(t *testing.T) { } func TestDeploymentEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &DeploymentEvent{}, "{}") l := make(map[string]interface{}) @@ -6007,6 +6053,7 @@ func TestDeploymentEvent_Marshal(t *testing.T) { } func TestDeploymentProtectionRuleEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &DeploymentProtectionRuleEvent{}, "{}") l := make(map[string]interface{}) @@ -6392,6 +6439,7 @@ func TestDeploymentProtectionRuleEvent_Marshal(t *testing.T) { } func TestDeploymentReviewEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &DeploymentReviewEvent{}, "{}") u := &DeploymentReviewEvent{ @@ -6990,6 +7038,7 @@ func TestDeploymentReviewEvent_Marshal(t *testing.T) { } func TestDeploymentStatusEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &DeploymentStatusEvent{}, "{}") l := make(map[string]interface{}) @@ -7323,6 +7372,7 @@ func TestDeploymentStatusEvent_Marshal(t *testing.T) { } func TestDiscussionCommentEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &DiscussionCommentEvent{}, "{}") u := &DiscussionCommentEvent{ @@ -7737,6 +7787,7 @@ func TestDiscussionCommentEvent_Marshal(t *testing.T) { } func TestDiscussionEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &DiscussionEvent{}, "{}") u := &DiscussionEvent{ @@ -8083,6 +8134,7 @@ func TestDiscussionEvent_Marshal(t *testing.T) { } func TestPackageEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PackageEvent{}, "{}") u := &PackageEvent{ @@ -8211,6 +8263,7 @@ func TestPackageEvent_Marshal(t *testing.T) { } func TestPersonalAccessTokenRequestEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PersonalAccessTokenRequestEvent{}, "{}") event := &PersonalAccessTokenRequestEvent{ @@ -8285,6 +8338,7 @@ func TestPersonalAccessTokenRequestEvent_Marshal(t *testing.T) { } func TestPingEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PingEvent{}, "{}") l := make(map[string]interface{}) @@ -8529,6 +8583,7 @@ func TestPingEvent_Marshal(t *testing.T) { } func TestRepositoryDispatchEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &RepositoryDispatchEvent{}, "{}") l := make(map[string]interface{}) @@ -8817,6 +8872,7 @@ func TestRepositoryDispatchEvent_Marshal(t *testing.T) { } func TestRepositoryImportEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &RepositoryImportEvent{}, "{}") u := &RepositoryImportEvent{ @@ -8903,6 +8959,7 @@ func TestRepositoryImportEvent_Marshal(t *testing.T) { } func TestRepositoryEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &RepositoryEvent{}, "{}") u := &RepositoryEvent{ @@ -9179,6 +9236,7 @@ func TestRepositoryEvent_Marshal(t *testing.T) { } func TestReleaseEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ReleaseEvent{}, "{}") u := &ReleaseEvent{ @@ -9449,6 +9507,7 @@ func TestReleaseEvent_Marshal(t *testing.T) { } func TestContentReferenceEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ContentReferenceEvent{}, "{}") u := &ContentReferenceEvent{ @@ -9691,6 +9750,7 @@ func TestContentReferenceEvent_Marshal(t *testing.T) { } func TestMemberEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &MemberEvent{}, "{}") u := &MemberEvent{ @@ -9961,6 +10021,7 @@ func TestMemberEvent_Marshal(t *testing.T) { } func TestMembershipEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &MembershipEvent{}, "{}") u := &MembershipEvent{ @@ -10325,6 +10386,7 @@ func TestMembershipEvent_Marshal(t *testing.T) { } func TestMergeGroupEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &MergeGroupEvent{}, "{}") u := &MergeGroupEvent{ @@ -10617,6 +10679,7 @@ func TestMergeGroupEvent_Marshal(t *testing.T) { } func TestOrgBlockEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &OrgBlockEvent{}, "{}") u := &OrgBlockEvent{ @@ -10901,6 +10964,7 @@ func TestOrgBlockEvent_Marshal(t *testing.T) { } func TestGollumEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &GollumEvent{}, "{}") u := &GollumEvent{ @@ -11151,6 +11215,7 @@ func TestGollumEvent_Marshal(t *testing.T) { } func TestWorkflowRunEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &WorkflowRunEvent{}, "{}") u := &WorkflowRunEvent{ @@ -11421,6 +11486,7 @@ func TestWorkflowRunEvent_Marshal(t *testing.T) { } func TestWorkflowDispatchEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &WorkflowDispatchEvent{}, "{}") i := make(map[string]interface{}) @@ -11517,6 +11583,7 @@ func TestWorkflowDispatchEvent_Marshal(t *testing.T) { } func TestWatchEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &WatchEvent{}, "{}") u := &WatchEvent{ @@ -11749,6 +11816,7 @@ func TestWatchEvent_Marshal(t *testing.T) { } func TestUserEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &UserEvent{}, "{}") u := &UserEvent{ @@ -11824,6 +11892,7 @@ func TestUserEvent_Marshal(t *testing.T) { } func TestCheckRunEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &CheckRunEvent{}, "{}") r := &CheckRunEvent{ @@ -12278,6 +12347,7 @@ func TestCheckRunEvent_Marshal(t *testing.T) { } func TestCheckSuiteEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &CheckSuiteEvent{}, "{}") r := &CheckSuiteEvent{ @@ -12676,6 +12746,7 @@ func TestCheckSuiteEvent_Marshal(t *testing.T) { } func TestDeployKeyEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &DeployKeyEvent{}, "{}") u := &DeployKeyEvent{ @@ -12780,6 +12851,7 @@ func TestDeployKeyEvent_Marshal(t *testing.T) { } func TestMetaEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &MetaEvent{}, "{}") v := make(map[string]interface{}) @@ -12836,6 +12908,7 @@ func TestMetaEvent_Marshal(t *testing.T) { } func TestRequestedAction_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &RequestedAction{}, "{}") r := &RequestedAction{ @@ -12850,6 +12923,7 @@ func TestRequestedAction_Marshal(t *testing.T) { } func TestCreateEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &CreateEvent{}, "{}") r := &CreateEvent{ @@ -13090,6 +13164,7 @@ func TestCreateEvent_Marshal(t *testing.T) { } func TestDeleteEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &DeleteEvent{}, "{}") r := &DeleteEvent{ @@ -13326,6 +13401,7 @@ func TestDeleteEvent_Marshal(t *testing.T) { } func TestDependabotAlertEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &DependabotAlertEvent{}, "{}") e := &DependabotAlertEvent{ @@ -13787,6 +13863,7 @@ func TestDependabotAlertEvent_Marshal(t *testing.T) { } func TestForkEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ForkEvent{}, "{}") u := &ForkEvent{ @@ -14027,6 +14104,7 @@ func TestForkEvent_Marshal(t *testing.T) { } func TestGitHubAppAuthorizationEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &GitHubAppAuthorizationEvent{}, "{}") u := &GitHubAppAuthorizationEvent{ @@ -14059,6 +14137,7 @@ func TestGitHubAppAuthorizationEvent_Marshal(t *testing.T) { } func TestInstallationEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &InstallationEvent{}, "{}") u := &InstallationEvent{ @@ -14295,6 +14374,7 @@ func TestInstallationEvent_Marshal(t *testing.T) { } func TestHeadCommit_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &HeadCommit{}, "{}") u := &HeadCommit{ @@ -14357,6 +14437,7 @@ func TestHeadCommit_Marshal(t *testing.T) { } func TestPushEventRepository_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PushEventRepository{}, "{}") u := &PushEventRepository{ @@ -14475,6 +14556,7 @@ func TestPushEventRepository_Marshal(t *testing.T) { } func TestPushEventRepoOwner_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PushEventRepoOwner{}, "{}") u := &PushEventRepoOwner{ @@ -14491,6 +14573,7 @@ func TestPushEventRepoOwner_Marshal(t *testing.T) { } func TestProjectEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ProjectEvent{}, "{}") u := &ProjectEvent{ @@ -14783,6 +14866,7 @@ func TestProjectEvent_Marshal(t *testing.T) { } func TestProjectCardEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ProjectCardEvent{}, "{}") u := &ProjectCardEvent{ @@ -15073,6 +15157,7 @@ func TestProjectCardEvent_Marshal(t *testing.T) { } func TestProjectColumnEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ProjectColumnEvent{}, "{}") u := &ProjectColumnEvent{ @@ -15363,6 +15448,7 @@ func TestProjectColumnEvent_Marshal(t *testing.T) { } func TestProjectV2Event_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ProjectV2Event{}, "{}") u := &ProjectV2Event{ @@ -15573,6 +15659,7 @@ func TestProjectV2Event_Marshal(t *testing.T) { } func TestProjectV2ItemEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ProjectV2ItemEvent{}, "{}") u := &ProjectV2ItemEvent{ @@ -15753,6 +15840,7 @@ func TestProjectV2ItemEvent_Marshal(t *testing.T) { } func TestPullRequestEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PullRequestEvent{}, "{}") u := &PullRequestEvent{ @@ -16133,6 +16221,7 @@ func TestPullRequestEvent_Marshal(t *testing.T) { } func TestPullRequestReviewCommentEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PullRequestReviewCommentEvent{}, "{}") u := &PullRequestReviewCommentEvent{ @@ -16405,6 +16494,7 @@ func TestPullRequestReviewCommentEvent_Marshal(t *testing.T) { } func TestPullRequestReviewThreadEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PullRequestReviewThreadEvent{}, "{}") u := &PullRequestReviewThreadEvent{ @@ -16654,6 +16744,7 @@ func TestPullRequestReviewThreadEvent_Marshal(t *testing.T) { } func TestPullRequestTargetEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PullRequestTargetEvent{}, "{}") u := &PullRequestTargetEvent{ @@ -17034,6 +17125,7 @@ func TestPullRequestTargetEvent_Marshal(t *testing.T) { } func TestRepositoryVulnerabilityAlertEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &RepositoryVulnerabilityAlertEvent{}, "{}") u := &RepositoryVulnerabilityAlertEvent{ @@ -17096,6 +17188,7 @@ func TestRepositoryVulnerabilityAlertEvent_Marshal(t *testing.T) { } func TestSecretScanningAlertEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &SecretScanningAlertEvent{}, "{}") u := &SecretScanningAlertEvent{ @@ -17426,6 +17519,7 @@ func TestSecretScanningAlertEvent_Marshal(t *testing.T) { } func TestSecurityAdvisoryEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &SecurityAdvisoryEvent{}, "{}") u := &SecurityAdvisoryEvent{ Action: String("published"), @@ -17811,6 +17905,7 @@ func TestSecurityAdvisoryEvent_Marshal(t *testing.T) { } func TestSecurityAndAnalysisEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &SecurityAndAnalysisEvent{}, "{}") u := &SecurityAndAnalysisEvent{ @@ -18146,6 +18241,7 @@ func TestSecurityAndAnalysisEvent_Marshal(t *testing.T) { } func TestCodeScanningAlertEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &CodeScanningAlertEvent{}, "{}") u := &CodeScanningAlertEvent{ @@ -18485,6 +18581,7 @@ func TestCodeScanningAlertEvent_Marshal(t *testing.T) { } func TestSponsorshipEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &SponsorshipEvent{}, "{}") u := &SponsorshipEvent{ @@ -18545,6 +18642,7 @@ func TestSponsorshipEvent_Marshal(t *testing.T) { } func TestSponsorshipChanges_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &SponsorshipChanges{}, "{}") u := &SponsorshipChanges{ @@ -18565,6 +18663,7 @@ func TestSponsorshipChanges_Marshal(t *testing.T) { } func TestSponsorshipTier_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &SponsorshipTier{}, "{}") u := &SponsorshipTier{ diff --git a/github/gen-accessors.go b/github/gen-accessors.go index 4bc22acdc15..b3d78b837a4 100644 --- a/github/gen-accessors.go +++ b/github/gen-accessors.go @@ -418,6 +418,7 @@ import ( {{range .Getters}} {{if .NamedStruct}} func Test{{.ReceiverType}}_Get{{.FieldName}}(tt *testing.T) { + tt.Parallel() {{.ReceiverVar}} := &{{.ReceiverType}}{} {{.ReceiverVar}}.Get{{.FieldName}}() {{.ReceiverVar}} = nil @@ -425,6 +426,7 @@ func Test{{.ReceiverType}}_Get{{.FieldName}}(tt *testing.T) { } {{else if or .MapType .ArrayType}} func Test{{.ReceiverType}}_Get{{.FieldName}}(tt *testing.T) { + tt.Parallel() zeroValue := {{.FieldType}}{} {{.ReceiverVar}} := &{{.ReceiverType}}{ {{.FieldName}}: zeroValue } {{.ReceiverVar}}.Get{{.FieldName}}() @@ -435,6 +437,7 @@ func Test{{.ReceiverType}}_Get{{.FieldName}}(tt *testing.T) { } {{else}} func Test{{.ReceiverType}}_Get{{.FieldName}}(tt *testing.T) { + tt.Parallel() var zeroValue {{.FieldType}} {{.ReceiverVar}} := &{{.ReceiverType}}{ {{.FieldName}}: &zeroValue } {{.ReceiverVar}}.Get{{.FieldName}}() diff --git a/github/gen-stringify-test.go b/github/gen-stringify-test.go index 5a42082b93d..44e70d5db25 100644 --- a/github/gen-stringify-test.go +++ b/github/gen-stringify-test.go @@ -404,6 +404,7 @@ import ( func Float64(v float64) *float64 { return &v } {{range $key, $value := .StructFields}} func Test{{ $key }}_String(t *testing.T) { + t.Parallel() v := {{ $key }}{ {{range .}}{{if .NamedStruct}} {{ .FieldName }}: &{{ .FieldType }}{},{{else}} {{ .FieldName }}: {{.ZeroValue}},{{end}}{{end}} diff --git a/github/gists_comments_test.go b/github/gists_comments_test.go index df6188f43c2..a6a0a5cd1fc 100644 --- a/github/gists_comments_test.go +++ b/github/gists_comments_test.go @@ -17,6 +17,7 @@ import ( ) func TestGistComments_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &GistComment{}, "{}") createdAt := time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC) @@ -72,6 +73,7 @@ func TestGistComments_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } func TestGistsService_ListComments(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/gists/1/comments", func(w http.ResponseWriter, r *http.Request) { @@ -108,6 +110,7 @@ func TestGistsService_ListComments(t *testing.T) { } func TestGistsService_ListComments_invalidID(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -116,6 +119,7 @@ func TestGistsService_ListComments_invalidID(t *testing.T) { } func TestGistsService_GetComment(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/gists/1/comments/2", func(w http.ResponseWriter, r *http.Request) { @@ -150,6 +154,7 @@ func TestGistsService_GetComment(t *testing.T) { } func TestGistsService_GetComment_invalidID(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -158,6 +163,7 @@ func TestGistsService_GetComment_invalidID(t *testing.T) { } func TestGistsService_CreateComment(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &GistComment{ID: Int64(1), Body: String("b")} @@ -201,6 +207,7 @@ func TestGistsService_CreateComment(t *testing.T) { } func TestGistsService_CreateComment_invalidID(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -209,6 +216,7 @@ func TestGistsService_CreateComment_invalidID(t *testing.T) { } func TestGistsService_EditComment(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &GistComment{ID: Int64(1), Body: String("b")} @@ -252,6 +260,7 @@ func TestGistsService_EditComment(t *testing.T) { } func TestGistsService_EditComment_invalidID(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -260,6 +269,7 @@ func TestGistsService_EditComment_invalidID(t *testing.T) { } func TestGistsService_DeleteComment(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/gists/1/comments/2", func(w http.ResponseWriter, r *http.Request) { @@ -284,6 +294,7 @@ func TestGistsService_DeleteComment(t *testing.T) { } func TestGistsService_DeleteComment_invalidID(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() diff --git a/github/gists_test.go b/github/gists_test.go index cd62d0ca4ae..26c0a2bd8d1 100644 --- a/github/gists_test.go +++ b/github/gists_test.go @@ -17,6 +17,7 @@ import ( ) func TestGist_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Gist{}, "{}") createdAt := time.Date(2010, time.February, 10, 10, 10, 0, 0, time.UTC) @@ -106,6 +107,7 @@ func TestGist_Marshal(t *testing.T) { } func TestGistCommit_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &GistCommit{}, "{}") u := &GistCommit{ @@ -170,6 +172,7 @@ func TestGistCommit_Marshal(t *testing.T) { } func TestGistFork_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &GistFork{}, "{}") u := &GistFork{ @@ -226,6 +229,7 @@ func TestGistFork_Marshal(t *testing.T) { } func TestGistsService_List_specifiedUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) since := "2013-01-01T00:00:00Z" @@ -266,6 +270,7 @@ func TestGistsService_List_specifiedUser(t *testing.T) { } func TestGistsService_List_authenticatedUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/gists", func(w http.ResponseWriter, r *http.Request) { @@ -300,6 +305,7 @@ func TestGistsService_List_authenticatedUser(t *testing.T) { } func TestGistsService_List_invalidUser(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -308,6 +314,7 @@ func TestGistsService_List_invalidUser(t *testing.T) { } func TestGistsService_ListAll(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) since := "2013-01-01T00:00:00Z" @@ -343,6 +350,7 @@ func TestGistsService_ListAll(t *testing.T) { } func TestGistsService_ListStarred(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) since := "2013-01-01T00:00:00Z" @@ -378,6 +386,7 @@ func TestGistsService_ListStarred(t *testing.T) { } func TestGistsService_Get(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/gists/1", func(w http.ResponseWriter, r *http.Request) { @@ -412,6 +421,7 @@ func TestGistsService_Get(t *testing.T) { } func TestGistsService_Get_invalidID(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -420,6 +430,7 @@ func TestGistsService_Get_invalidID(t *testing.T) { } func TestGistsService_GetRevision(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/gists/1/s", func(w http.ResponseWriter, r *http.Request) { @@ -454,6 +465,7 @@ func TestGistsService_GetRevision(t *testing.T) { } func TestGistsService_GetRevision_invalidID(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -462,6 +474,7 @@ func TestGistsService_GetRevision_invalidID(t *testing.T) { } func TestGistsService_Create(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &Gist{ @@ -524,6 +537,7 @@ func TestGistsService_Create(t *testing.T) { } func TestGistsService_Edit(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &Gist{ @@ -594,6 +608,7 @@ func TestGistsService_Edit(t *testing.T) { } func TestGistsService_Edit_invalidID(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -602,6 +617,7 @@ func TestGistsService_Edit_invalidID(t *testing.T) { } func TestGistsService_ListCommits(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/gists/1/commits", func(w http.ResponseWriter, r *http.Request) { @@ -663,6 +679,7 @@ func TestGistsService_ListCommits(t *testing.T) { } func TestGistsService_ListCommits_withOptions(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/gists/1/commits", func(w http.ResponseWriter, r *http.Request) { @@ -695,6 +712,7 @@ func TestGistsService_ListCommits_withOptions(t *testing.T) { } func TestGistsService_ListCommits_invalidID(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -703,6 +721,7 @@ func TestGistsService_ListCommits_invalidID(t *testing.T) { } func TestGistsService_Delete(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/gists/1", func(w http.ResponseWriter, r *http.Request) { @@ -727,6 +746,7 @@ func TestGistsService_Delete(t *testing.T) { } func TestGistsService_Delete_invalidID(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -735,6 +755,7 @@ func TestGistsService_Delete_invalidID(t *testing.T) { } func TestGistsService_Star(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/gists/1/star", func(w http.ResponseWriter, r *http.Request) { @@ -759,6 +780,7 @@ func TestGistsService_Star(t *testing.T) { } func TestGistsService_Star_invalidID(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -767,6 +789,7 @@ func TestGistsService_Star_invalidID(t *testing.T) { } func TestGistsService_Unstar(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/gists/1/star", func(w http.ResponseWriter, r *http.Request) { @@ -791,6 +814,7 @@ func TestGistsService_Unstar(t *testing.T) { } func TestGistsService_Unstar_invalidID(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -799,6 +823,7 @@ func TestGistsService_Unstar_invalidID(t *testing.T) { } func TestGistsService_IsStarred_hasStar(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/gists/1/star", func(w http.ResponseWriter, r *http.Request) { @@ -831,6 +856,7 @@ func TestGistsService_IsStarred_hasStar(t *testing.T) { } func TestGistsService_IsStarred_noStar(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/gists/1/star", func(w http.ResponseWriter, r *http.Request) { @@ -863,6 +889,7 @@ func TestGistsService_IsStarred_noStar(t *testing.T) { } func TestGistsService_IsStarred_invalidID(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -871,6 +898,7 @@ func TestGistsService_IsStarred_invalidID(t *testing.T) { } func TestGistsService_Fork(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/gists/1/forks", func(w http.ResponseWriter, r *http.Request) { @@ -905,6 +933,7 @@ func TestGistsService_Fork(t *testing.T) { } func TestGistsService_ListForks(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/gists/1/forks", func(w http.ResponseWriter, r *http.Request) { @@ -955,6 +984,7 @@ func TestGistsService_ListForks(t *testing.T) { } func TestGistsService_ListForks_withOptions(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/gists/1/forks", func(w http.ResponseWriter, r *http.Request) { @@ -992,6 +1022,7 @@ func TestGistsService_ListForks_withOptions(t *testing.T) { } func TestGistFile_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &GistFile{}, "{}") u := &GistFile{ diff --git a/github/git_blobs_test.go b/github/git_blobs_test.go index 729e36b0fbb..710171bc2ce 100644 --- a/github/git_blobs_test.go +++ b/github/git_blobs_test.go @@ -17,6 +17,7 @@ import ( ) func TestGitService_GetBlob(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/git/blobs/s", func(w http.ResponseWriter, r *http.Request) { @@ -59,6 +60,7 @@ func TestGitService_GetBlob(t *testing.T) { } func TestGitService_GetBlob_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -67,6 +69,7 @@ func TestGitService_GetBlob_invalidOwner(t *testing.T) { } func TestGitService_GetBlobRaw(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/git/blobs/s", func(w http.ResponseWriter, r *http.Request) { @@ -103,6 +106,7 @@ func TestGitService_GetBlobRaw(t *testing.T) { } func TestGitService_CreateBlob(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &Blob{ @@ -159,6 +163,7 @@ func TestGitService_CreateBlob(t *testing.T) { } func TestGitService_CreateBlob_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -167,6 +172,7 @@ func TestGitService_CreateBlob_invalidOwner(t *testing.T) { } func TestBlob_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Blob{}, "{}") u := &Blob{ diff --git a/github/git_commits_test.go b/github/git_commits_test.go index f965a8a1e4a..d99787fab1c 100644 --- a/github/git_commits_test.go +++ b/github/git_commits_test.go @@ -38,6 +38,7 @@ func uncalledSigner(t *testing.T) MessageSignerFunc { } func TestCommit_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Commit{}, "{}") u := &Commit{ @@ -137,6 +138,7 @@ func TestCommit_Marshal(t *testing.T) { } func TestGitService_GetCommit(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/git/commits/s", func(w http.ResponseWriter, r *http.Request) { @@ -171,6 +173,7 @@ func TestGitService_GetCommit(t *testing.T) { } func TestGitService_GetCommit_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -179,6 +182,7 @@ func TestGitService_GetCommit_invalidOwner(t *testing.T) { } func TestGitService_CreateCommit(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &Commit{ @@ -231,6 +235,7 @@ func TestGitService_CreateCommit(t *testing.T) { } func TestGitService_CreateSignedCommit(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) signature := "----- BEGIN PGP SIGNATURE -----\n\naaaa\naaaa\n----- END PGP SIGNATURE -----" @@ -289,6 +294,7 @@ func TestGitService_CreateSignedCommit(t *testing.T) { } func TestGitService_CreateSignedCommitWithInvalidParams(t *testing.T) { + t.Parallel() client, _, _ := setup(t) input := &Commit{} @@ -302,6 +308,7 @@ func TestGitService_CreateSignedCommitWithInvalidParams(t *testing.T) { } func TestGitService_CreateCommitWithNilCommit(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -312,6 +319,7 @@ func TestGitService_CreateCommitWithNilCommit(t *testing.T) { } func TestGitService_CreateCommit_WithSigner(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) signature := "my voice is my password" @@ -362,6 +370,7 @@ Commit Message.` } func TestGitService_createSignature_nilSigner(t *testing.T) { + t.Parallel() a := &createCommit{ Message: String("Commit Message."), Tree: String("t"), @@ -376,6 +385,7 @@ func TestGitService_createSignature_nilSigner(t *testing.T) { } func TestGitService_createSignature_nilCommit(t *testing.T) { + t.Parallel() _, err := createSignature(uncalledSigner(t), nil) if err == nil { @@ -384,6 +394,7 @@ func TestGitService_createSignature_nilCommit(t *testing.T) { } func TestGitService_createSignature_signerError(t *testing.T) { + t.Parallel() a := &createCommit{ Message: String("Commit Message."), Tree: String("t"), @@ -400,6 +411,7 @@ func TestGitService_createSignature_signerError(t *testing.T) { } func TestGitService_createSignatureMessage_nilCommit(t *testing.T) { + t.Parallel() _, err := createSignatureMessage(nil) if err == nil { t.Errorf("Expected error to be returned due to nil key") @@ -407,6 +419,7 @@ func TestGitService_createSignatureMessage_nilCommit(t *testing.T) { } func TestGitService_createSignatureMessage_nilMessage(t *testing.T) { + t.Parallel() date, _ := time.Parse("Mon Jan 02 15:04:05 2006 -0700", "Thu May 04 00:03:43 2017 +0200") _, err := createSignatureMessage(&createCommit{ @@ -424,6 +437,7 @@ func TestGitService_createSignatureMessage_nilMessage(t *testing.T) { } func TestGitService_createSignatureMessage_emptyMessage(t *testing.T) { + t.Parallel() date, _ := time.Parse("Mon Jan 02 15:04:05 2006 -0700", "Thu May 04 00:03:43 2017 +0200") emptyString := "" _, err := createSignatureMessage(&createCommit{ @@ -441,6 +455,7 @@ func TestGitService_createSignatureMessage_emptyMessage(t *testing.T) { } func TestGitService_createSignatureMessage_nilAuthor(t *testing.T) { + t.Parallel() _, err := createSignatureMessage(&createCommit{ Message: String("Commit Message."), Parents: []string{"p"}, @@ -452,6 +467,7 @@ func TestGitService_createSignatureMessage_nilAuthor(t *testing.T) { } func TestGitService_createSignatureMessage_withoutTree(t *testing.T) { + t.Parallel() date, _ := time.Parse("Mon Jan 02 15:04:05 2006 -0700", "Thu May 04 00:03:43 2017 +0200") msg, _ := createSignatureMessage(&createCommit{ @@ -474,6 +490,7 @@ Commit Message.` } func TestGitService_createSignatureMessage_withoutCommitter(t *testing.T) { + t.Parallel() date, _ := time.Parse("Mon Jan 02 15:04:05 2006 -0700", "Thu May 04 00:03:43 2017 +0200") msg, _ := createSignatureMessage(&createCommit{ @@ -501,6 +518,7 @@ Commit Message.` } func TestGitService_CreateCommit_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -509,6 +527,7 @@ func TestGitService_CreateCommit_invalidOwner(t *testing.T) { } func TestSignatureVerification_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &SignatureVerification{}, "{}") u := &SignatureVerification{ @@ -529,6 +548,7 @@ func TestSignatureVerification_Marshal(t *testing.T) { } func TestCommitAuthor_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &CommitAuthor{}, "{}") u := &CommitAuthor{ @@ -549,6 +569,7 @@ func TestCommitAuthor_Marshal(t *testing.T) { } func TestCreateCommit_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &createCommit{}, "{}") u := &createCommit{ diff --git a/github/git_refs_test.go b/github/git_refs_test.go index 357e4a4a4b4..0c552f434f3 100644 --- a/github/git_refs_test.go +++ b/github/git_refs_test.go @@ -17,6 +17,7 @@ import ( ) func TestGitService_GetRef_singleRef(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/git/ref/heads/b", func(w http.ResponseWriter, r *http.Request) { @@ -73,6 +74,7 @@ func TestGitService_GetRef_singleRef(t *testing.T) { } func TestGitService_GetRef_noRefs(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/git/refs/heads/b", func(w http.ResponseWriter, r *http.Request) { @@ -108,6 +110,7 @@ func TestGitService_GetRef_noRefs(t *testing.T) { } func TestGitService_ListMatchingRefs_singleRef(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/git/matching-refs/heads/b", func(w http.ResponseWriter, r *http.Request) { @@ -169,6 +172,7 @@ func TestGitService_ListMatchingRefs_singleRef(t *testing.T) { } func TestGitService_ListMatchingRefs_multipleRefs(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/git/matching-refs/heads/b", func(w http.ResponseWriter, r *http.Request) { @@ -233,6 +237,7 @@ func TestGitService_ListMatchingRefs_multipleRefs(t *testing.T) { } func TestGitService_ListMatchingRefs_noRefs(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/git/matching-refs/heads/b", func(w http.ResponseWriter, r *http.Request) { @@ -267,6 +272,7 @@ func TestGitService_ListMatchingRefs_noRefs(t *testing.T) { } func TestGitService_ListMatchingRefs_allRefs(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/git/matching-refs/", func(w http.ResponseWriter, r *http.Request) { @@ -340,6 +346,7 @@ func TestGitService_ListMatchingRefs_allRefs(t *testing.T) { } func TestGitService_ListMatchingRefs_options(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/git/matching-refs/t", func(w http.ResponseWriter, r *http.Request) { @@ -376,6 +383,7 @@ func TestGitService_ListMatchingRefs_options(t *testing.T) { } func TestGitService_CreateRef(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) args := &createRefRequest{ @@ -464,6 +472,7 @@ func TestGitService_CreateRef(t *testing.T) { } func TestGitService_UpdateRef(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) args := &updateRefRequest{ @@ -544,6 +553,7 @@ func TestGitService_UpdateRef(t *testing.T) { } func TestGitService_DeleteRef(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/git/refs/heads/b", func(w http.ResponseWriter, r *http.Request) { @@ -573,6 +583,7 @@ func TestGitService_DeleteRef(t *testing.T) { } func TestGitService_GetRef_pathEscape(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/git/ref/heads/b", func(w http.ResponseWriter, r *http.Request) { @@ -614,6 +625,7 @@ func TestGitService_GetRef_pathEscape(t *testing.T) { } func TestGitService_UpdateRef_pathEscape(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) args := &updateRefRequest{ @@ -665,6 +677,7 @@ func TestGitService_UpdateRef_pathEscape(t *testing.T) { } func TestReference_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Reference{}, "{}") u := &Reference{ @@ -693,6 +706,7 @@ func TestReference_Marshal(t *testing.T) { } func TestGitObject_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &GitObject{}, "{}") u := &GitObject{ @@ -711,6 +725,7 @@ func TestGitObject_Marshal(t *testing.T) { } func TestCreateRefRequest_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &createRefRequest{}, "{}") u := &createRefRequest{ @@ -727,6 +742,7 @@ func TestCreateRefRequest_Marshal(t *testing.T) { } func TestUpdateRefRequest_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &updateRefRequest{}, "{}") u := &updateRefRequest{ diff --git a/github/git_tags_test.go b/github/git_tags_test.go index 59bdbb422d8..d1495c8b549 100644 --- a/github/git_tags_test.go +++ b/github/git_tags_test.go @@ -16,6 +16,7 @@ import ( ) func TestGitService_GetTag(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/git/tags/s", func(w http.ResponseWriter, r *http.Request) { @@ -50,6 +51,7 @@ func TestGitService_GetTag(t *testing.T) { } func TestGitService_CreateTag(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &createTagRequest{Tag: String("t"), Object: String("s")} @@ -97,6 +99,7 @@ func TestGitService_CreateTag(t *testing.T) { } func TestTag_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Tag{}, "{}") u := &Tag{ @@ -153,6 +156,7 @@ func TestTag_Marshal(t *testing.T) { } func TestCreateTagRequest_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &createTagRequest{}, "{}") u := &createTagRequest{ diff --git a/github/git_trees_test.go b/github/git_trees_test.go index af339d873db..591ff0c1c0f 100644 --- a/github/git_trees_test.go +++ b/github/git_trees_test.go @@ -17,6 +17,7 @@ import ( ) func TestMarshalJSON_withNilContentAndSHA(t *testing.T) { + t.Parallel() te := &TreeEntry{ Path: String("path"), Mode: String("mode"), @@ -37,6 +38,7 @@ func TestMarshalJSON_withNilContentAndSHA(t *testing.T) { } func TestGitService_GetTree(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/git/trees/s", func(w http.ResponseWriter, r *http.Request) { @@ -83,6 +85,7 @@ func TestGitService_GetTree(t *testing.T) { } func TestGitService_GetTree_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -91,6 +94,7 @@ func TestGitService_GetTree_invalidOwner(t *testing.T) { } func TestGitService_CreateTree(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := []*TreeEntry{ @@ -169,6 +173,7 @@ func TestGitService_CreateTree(t *testing.T) { } func TestGitService_CreateTree_Content(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := []*TreeEntry{ @@ -249,6 +254,7 @@ func TestGitService_CreateTree_Content(t *testing.T) { } func TestGitService_CreateTree_Delete(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := []*TreeEntry{ @@ -328,6 +334,7 @@ func TestGitService_CreateTree_Delete(t *testing.T) { } func TestGitService_CreateTree_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -336,6 +343,7 @@ func TestGitService_CreateTree_invalidOwner(t *testing.T) { } func TestTree_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Tree{}, "{}") u := &Tree{ @@ -374,6 +382,7 @@ func TestTree_Marshal(t *testing.T) { } func TestTreeEntry_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &TreeEntry{}, "{}") u := &TreeEntry{ @@ -400,6 +409,7 @@ func TestTreeEntry_Marshal(t *testing.T) { } func TestTreeEntryWithFileDelete_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &treeEntryWithFileDelete{}, "{}") u := &treeEntryWithFileDelete{ @@ -426,6 +436,7 @@ func TestTreeEntryWithFileDelete_Marshal(t *testing.T) { } func TestCreateTree_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &createTree{}, "{}") u := &createTree{ diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 8af9a9b54d2..b9b4b08b256 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -16,6 +16,7 @@ import ( ) func TestAbuseRateLimitError_GetRetryAfter(tt *testing.T) { + tt.Parallel() var zeroValue time.Duration a := &AbuseRateLimitError{RetryAfter: &zeroValue} a.GetRetryAfter() @@ -26,6 +27,7 @@ func TestAbuseRateLimitError_GetRetryAfter(tt *testing.T) { } func TestActionsAllowed_GetGithubOwnedAllowed(tt *testing.T) { + tt.Parallel() var zeroValue bool a := &ActionsAllowed{GithubOwnedAllowed: &zeroValue} a.GetGithubOwnedAllowed() @@ -36,6 +38,7 @@ func TestActionsAllowed_GetGithubOwnedAllowed(tt *testing.T) { } func TestActionsAllowed_GetVerifiedAllowed(tt *testing.T) { + tt.Parallel() var zeroValue bool a := &ActionsAllowed{VerifiedAllowed: &zeroValue} a.GetVerifiedAllowed() @@ -46,6 +49,7 @@ func TestActionsAllowed_GetVerifiedAllowed(tt *testing.T) { } func TestActionsCache_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp a := &ActionsCache{CreatedAt: &zeroValue} a.GetCreatedAt() @@ -56,6 +60,7 @@ func TestActionsCache_GetCreatedAt(tt *testing.T) { } func TestActionsCache_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 a := &ActionsCache{ID: &zeroValue} a.GetID() @@ -66,6 +71,7 @@ func TestActionsCache_GetID(tt *testing.T) { } func TestActionsCache_GetKey(tt *testing.T) { + tt.Parallel() var zeroValue string a := &ActionsCache{Key: &zeroValue} a.GetKey() @@ -76,6 +82,7 @@ func TestActionsCache_GetKey(tt *testing.T) { } func TestActionsCache_GetLastAccessedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp a := &ActionsCache{LastAccessedAt: &zeroValue} a.GetLastAccessedAt() @@ -86,6 +93,7 @@ func TestActionsCache_GetLastAccessedAt(tt *testing.T) { } func TestActionsCache_GetRef(tt *testing.T) { + tt.Parallel() var zeroValue string a := &ActionsCache{Ref: &zeroValue} a.GetRef() @@ -96,6 +104,7 @@ func TestActionsCache_GetRef(tt *testing.T) { } func TestActionsCache_GetSizeInBytes(tt *testing.T) { + tt.Parallel() var zeroValue int64 a := &ActionsCache{SizeInBytes: &zeroValue} a.GetSizeInBytes() @@ -106,6 +115,7 @@ func TestActionsCache_GetSizeInBytes(tt *testing.T) { } func TestActionsCache_GetVersion(tt *testing.T) { + tt.Parallel() var zeroValue string a := &ActionsCache{Version: &zeroValue} a.GetVersion() @@ -116,6 +126,7 @@ func TestActionsCache_GetVersion(tt *testing.T) { } func TestActionsCacheListOptions_GetDirection(tt *testing.T) { + tt.Parallel() var zeroValue string a := &ActionsCacheListOptions{Direction: &zeroValue} a.GetDirection() @@ -126,6 +137,7 @@ func TestActionsCacheListOptions_GetDirection(tt *testing.T) { } func TestActionsCacheListOptions_GetKey(tt *testing.T) { + tt.Parallel() var zeroValue string a := &ActionsCacheListOptions{Key: &zeroValue} a.GetKey() @@ -136,6 +148,7 @@ func TestActionsCacheListOptions_GetKey(tt *testing.T) { } func TestActionsCacheListOptions_GetRef(tt *testing.T) { + tt.Parallel() var zeroValue string a := &ActionsCacheListOptions{Ref: &zeroValue} a.GetRef() @@ -146,6 +159,7 @@ func TestActionsCacheListOptions_GetRef(tt *testing.T) { } func TestActionsCacheListOptions_GetSort(tt *testing.T) { + tt.Parallel() var zeroValue string a := &ActionsCacheListOptions{Sort: &zeroValue} a.GetSort() @@ -156,6 +170,7 @@ func TestActionsCacheListOptions_GetSort(tt *testing.T) { } func TestActionsPermissions_GetAllowedActions(tt *testing.T) { + tt.Parallel() var zeroValue string a := &ActionsPermissions{AllowedActions: &zeroValue} a.GetAllowedActions() @@ -166,6 +181,7 @@ func TestActionsPermissions_GetAllowedActions(tt *testing.T) { } func TestActionsPermissions_GetEnabledRepositories(tt *testing.T) { + tt.Parallel() var zeroValue string a := &ActionsPermissions{EnabledRepositories: &zeroValue} a.GetEnabledRepositories() @@ -176,6 +192,7 @@ func TestActionsPermissions_GetEnabledRepositories(tt *testing.T) { } func TestActionsPermissions_GetSelectedActionsURL(tt *testing.T) { + tt.Parallel() var zeroValue string a := &ActionsPermissions{SelectedActionsURL: &zeroValue} a.GetSelectedActionsURL() @@ -186,6 +203,7 @@ func TestActionsPermissions_GetSelectedActionsURL(tt *testing.T) { } func TestActionsPermissionsEnterprise_GetAllowedActions(tt *testing.T) { + tt.Parallel() var zeroValue string a := &ActionsPermissionsEnterprise{AllowedActions: &zeroValue} a.GetAllowedActions() @@ -196,6 +214,7 @@ func TestActionsPermissionsEnterprise_GetAllowedActions(tt *testing.T) { } func TestActionsPermissionsEnterprise_GetEnabledOrganizations(tt *testing.T) { + tt.Parallel() var zeroValue string a := &ActionsPermissionsEnterprise{EnabledOrganizations: &zeroValue} a.GetEnabledOrganizations() @@ -206,6 +225,7 @@ func TestActionsPermissionsEnterprise_GetEnabledOrganizations(tt *testing.T) { } func TestActionsPermissionsEnterprise_GetSelectedActionsURL(tt *testing.T) { + tt.Parallel() var zeroValue string a := &ActionsPermissionsEnterprise{SelectedActionsURL: &zeroValue} a.GetSelectedActionsURL() @@ -216,6 +236,7 @@ func TestActionsPermissionsEnterprise_GetSelectedActionsURL(tt *testing.T) { } func TestActionsPermissionsRepository_GetAllowedActions(tt *testing.T) { + tt.Parallel() var zeroValue string a := &ActionsPermissionsRepository{AllowedActions: &zeroValue} a.GetAllowedActions() @@ -226,6 +247,7 @@ func TestActionsPermissionsRepository_GetAllowedActions(tt *testing.T) { } func TestActionsPermissionsRepository_GetEnabled(tt *testing.T) { + tt.Parallel() var zeroValue bool a := &ActionsPermissionsRepository{Enabled: &zeroValue} a.GetEnabled() @@ -236,6 +258,7 @@ func TestActionsPermissionsRepository_GetEnabled(tt *testing.T) { } func TestActionsPermissionsRepository_GetSelectedActionsURL(tt *testing.T) { + tt.Parallel() var zeroValue string a := &ActionsPermissionsRepository{SelectedActionsURL: &zeroValue} a.GetSelectedActionsURL() @@ -246,6 +269,7 @@ func TestActionsPermissionsRepository_GetSelectedActionsURL(tt *testing.T) { } func TestActionsVariable_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp a := &ActionsVariable{CreatedAt: &zeroValue} a.GetCreatedAt() @@ -256,6 +280,7 @@ func TestActionsVariable_GetCreatedAt(tt *testing.T) { } func TestActionsVariable_GetSelectedRepositoriesURL(tt *testing.T) { + tt.Parallel() var zeroValue string a := &ActionsVariable{SelectedRepositoriesURL: &zeroValue} a.GetSelectedRepositoriesURL() @@ -266,6 +291,7 @@ func TestActionsVariable_GetSelectedRepositoriesURL(tt *testing.T) { } func TestActionsVariable_GetSelectedRepositoryIDs(tt *testing.T) { + tt.Parallel() a := &ActionsVariable{} a.GetSelectedRepositoryIDs() a = nil @@ -273,6 +299,7 @@ func TestActionsVariable_GetSelectedRepositoryIDs(tt *testing.T) { } func TestActionsVariable_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp a := &ActionsVariable{UpdatedAt: &zeroValue} a.GetUpdatedAt() @@ -283,6 +310,7 @@ func TestActionsVariable_GetUpdatedAt(tt *testing.T) { } func TestActionsVariable_GetVisibility(tt *testing.T) { + tt.Parallel() var zeroValue string a := &ActionsVariable{Visibility: &zeroValue} a.GetVisibility() @@ -293,6 +321,7 @@ func TestActionsVariable_GetVisibility(tt *testing.T) { } func TestActorLocation_GetCountryCode(tt *testing.T) { + tt.Parallel() var zeroValue string a := &ActorLocation{CountryCode: &zeroValue} a.GetCountryCode() @@ -303,6 +332,7 @@ func TestActorLocation_GetCountryCode(tt *testing.T) { } func TestAdminEnforcedChanges_GetFrom(tt *testing.T) { + tt.Parallel() var zeroValue bool a := &AdminEnforcedChanges{From: &zeroValue} a.GetFrom() @@ -313,6 +343,7 @@ func TestAdminEnforcedChanges_GetFrom(tt *testing.T) { } func TestAdminEnforcement_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AdminEnforcement{URL: &zeroValue} a.GetURL() @@ -323,6 +354,7 @@ func TestAdminEnforcement_GetURL(tt *testing.T) { } func TestAdminStats_GetComments(tt *testing.T) { + tt.Parallel() a := &AdminStats{} a.GetComments() a = nil @@ -330,6 +362,7 @@ func TestAdminStats_GetComments(tt *testing.T) { } func TestAdminStats_GetGists(tt *testing.T) { + tt.Parallel() a := &AdminStats{} a.GetGists() a = nil @@ -337,6 +370,7 @@ func TestAdminStats_GetGists(tt *testing.T) { } func TestAdminStats_GetHooks(tt *testing.T) { + tt.Parallel() a := &AdminStats{} a.GetHooks() a = nil @@ -344,6 +378,7 @@ func TestAdminStats_GetHooks(tt *testing.T) { } func TestAdminStats_GetIssues(tt *testing.T) { + tt.Parallel() a := &AdminStats{} a.GetIssues() a = nil @@ -351,6 +386,7 @@ func TestAdminStats_GetIssues(tt *testing.T) { } func TestAdminStats_GetMilestones(tt *testing.T) { + tt.Parallel() a := &AdminStats{} a.GetMilestones() a = nil @@ -358,6 +394,7 @@ func TestAdminStats_GetMilestones(tt *testing.T) { } func TestAdminStats_GetOrgs(tt *testing.T) { + tt.Parallel() a := &AdminStats{} a.GetOrgs() a = nil @@ -365,6 +402,7 @@ func TestAdminStats_GetOrgs(tt *testing.T) { } func TestAdminStats_GetPages(tt *testing.T) { + tt.Parallel() a := &AdminStats{} a.GetPages() a = nil @@ -372,6 +410,7 @@ func TestAdminStats_GetPages(tt *testing.T) { } func TestAdminStats_GetPulls(tt *testing.T) { + tt.Parallel() a := &AdminStats{} a.GetPulls() a = nil @@ -379,6 +418,7 @@ func TestAdminStats_GetPulls(tt *testing.T) { } func TestAdminStats_GetRepos(tt *testing.T) { + tt.Parallel() a := &AdminStats{} a.GetRepos() a = nil @@ -386,6 +426,7 @@ func TestAdminStats_GetRepos(tt *testing.T) { } func TestAdminStats_GetUsers(tt *testing.T) { + tt.Parallel() a := &AdminStats{} a.GetUsers() a = nil @@ -393,6 +434,7 @@ func TestAdminStats_GetUsers(tt *testing.T) { } func TestAdvancedSecurity_GetStatus(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AdvancedSecurity{Status: &zeroValue} a.GetStatus() @@ -403,6 +445,7 @@ func TestAdvancedSecurity_GetStatus(tt *testing.T) { } func TestAdvancedSecurityCommittersBreakdown_GetLastPushedDate(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AdvancedSecurityCommittersBreakdown{LastPushedDate: &zeroValue} a.GetLastPushedDate() @@ -413,6 +456,7 @@ func TestAdvancedSecurityCommittersBreakdown_GetLastPushedDate(tt *testing.T) { } func TestAdvancedSecurityCommittersBreakdown_GetUserLogin(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AdvancedSecurityCommittersBreakdown{UserLogin: &zeroValue} a.GetUserLogin() @@ -423,6 +467,7 @@ func TestAdvancedSecurityCommittersBreakdown_GetUserLogin(tt *testing.T) { } func TestAdvisoryCVSS_GetScore(tt *testing.T) { + tt.Parallel() a := &AdvisoryCVSS{} a.GetScore() a = nil @@ -430,6 +475,7 @@ func TestAdvisoryCVSS_GetScore(tt *testing.T) { } func TestAdvisoryCVSS_GetVectorString(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AdvisoryCVSS{VectorString: &zeroValue} a.GetVectorString() @@ -440,6 +486,7 @@ func TestAdvisoryCVSS_GetVectorString(tt *testing.T) { } func TestAdvisoryCWEs_GetCWEID(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AdvisoryCWEs{CWEID: &zeroValue} a.GetCWEID() @@ -450,6 +497,7 @@ func TestAdvisoryCWEs_GetCWEID(tt *testing.T) { } func TestAdvisoryCWEs_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AdvisoryCWEs{Name: &zeroValue} a.GetName() @@ -460,6 +508,7 @@ func TestAdvisoryCWEs_GetName(tt *testing.T) { } func TestAdvisoryIdentifier_GetType(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AdvisoryIdentifier{Type: &zeroValue} a.GetType() @@ -470,6 +519,7 @@ func TestAdvisoryIdentifier_GetType(tt *testing.T) { } func TestAdvisoryIdentifier_GetValue(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AdvisoryIdentifier{Value: &zeroValue} a.GetValue() @@ -480,6 +530,7 @@ func TestAdvisoryIdentifier_GetValue(tt *testing.T) { } func TestAdvisoryReference_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AdvisoryReference{URL: &zeroValue} a.GetURL() @@ -490,6 +541,7 @@ func TestAdvisoryReference_GetURL(tt *testing.T) { } func TestAdvisoryVulnerability_GetFirstPatchedVersion(tt *testing.T) { + tt.Parallel() a := &AdvisoryVulnerability{} a.GetFirstPatchedVersion() a = nil @@ -497,6 +549,7 @@ func TestAdvisoryVulnerability_GetFirstPatchedVersion(tt *testing.T) { } func TestAdvisoryVulnerability_GetPackage(tt *testing.T) { + tt.Parallel() a := &AdvisoryVulnerability{} a.GetPackage() a = nil @@ -504,6 +557,7 @@ func TestAdvisoryVulnerability_GetPackage(tt *testing.T) { } func TestAdvisoryVulnerability_GetPatchedVersions(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AdvisoryVulnerability{PatchedVersions: &zeroValue} a.GetPatchedVersions() @@ -514,6 +568,7 @@ func TestAdvisoryVulnerability_GetPatchedVersions(tt *testing.T) { } func TestAdvisoryVulnerability_GetSeverity(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AdvisoryVulnerability{Severity: &zeroValue} a.GetSeverity() @@ -524,6 +579,7 @@ func TestAdvisoryVulnerability_GetSeverity(tt *testing.T) { } func TestAdvisoryVulnerability_GetVulnerableVersionRange(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AdvisoryVulnerability{VulnerableVersionRange: &zeroValue} a.GetVulnerableVersionRange() @@ -534,6 +590,7 @@ func TestAdvisoryVulnerability_GetVulnerableVersionRange(tt *testing.T) { } func TestAlert_GetClosedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp a := &Alert{ClosedAt: &zeroValue} a.GetClosedAt() @@ -544,6 +601,7 @@ func TestAlert_GetClosedAt(tt *testing.T) { } func TestAlert_GetClosedBy(tt *testing.T) { + tt.Parallel() a := &Alert{} a.GetClosedBy() a = nil @@ -551,6 +609,7 @@ func TestAlert_GetClosedBy(tt *testing.T) { } func TestAlert_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp a := &Alert{CreatedAt: &zeroValue} a.GetCreatedAt() @@ -561,6 +620,7 @@ func TestAlert_GetCreatedAt(tt *testing.T) { } func TestAlert_GetDismissedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp a := &Alert{DismissedAt: &zeroValue} a.GetDismissedAt() @@ -571,6 +631,7 @@ func TestAlert_GetDismissedAt(tt *testing.T) { } func TestAlert_GetDismissedBy(tt *testing.T) { + tt.Parallel() a := &Alert{} a.GetDismissedBy() a = nil @@ -578,6 +639,7 @@ func TestAlert_GetDismissedBy(tt *testing.T) { } func TestAlert_GetDismissedComment(tt *testing.T) { + tt.Parallel() var zeroValue string a := &Alert{DismissedComment: &zeroValue} a.GetDismissedComment() @@ -588,6 +650,7 @@ func TestAlert_GetDismissedComment(tt *testing.T) { } func TestAlert_GetDismissedReason(tt *testing.T) { + tt.Parallel() var zeroValue string a := &Alert{DismissedReason: &zeroValue} a.GetDismissedReason() @@ -598,6 +661,7 @@ func TestAlert_GetDismissedReason(tt *testing.T) { } func TestAlert_GetFixedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp a := &Alert{FixedAt: &zeroValue} a.GetFixedAt() @@ -608,6 +672,7 @@ func TestAlert_GetFixedAt(tt *testing.T) { } func TestAlert_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string a := &Alert{HTMLURL: &zeroValue} a.GetHTMLURL() @@ -618,6 +683,7 @@ func TestAlert_GetHTMLURL(tt *testing.T) { } func TestAlert_GetInstancesURL(tt *testing.T) { + tt.Parallel() var zeroValue string a := &Alert{InstancesURL: &zeroValue} a.GetInstancesURL() @@ -628,6 +694,7 @@ func TestAlert_GetInstancesURL(tt *testing.T) { } func TestAlert_GetMostRecentInstance(tt *testing.T) { + tt.Parallel() a := &Alert{} a.GetMostRecentInstance() a = nil @@ -635,6 +702,7 @@ func TestAlert_GetMostRecentInstance(tt *testing.T) { } func TestAlert_GetNumber(tt *testing.T) { + tt.Parallel() var zeroValue int a := &Alert{Number: &zeroValue} a.GetNumber() @@ -645,6 +713,7 @@ func TestAlert_GetNumber(tt *testing.T) { } func TestAlert_GetRepository(tt *testing.T) { + tt.Parallel() a := &Alert{} a.GetRepository() a = nil @@ -652,6 +721,7 @@ func TestAlert_GetRepository(tt *testing.T) { } func TestAlert_GetRule(tt *testing.T) { + tt.Parallel() a := &Alert{} a.GetRule() a = nil @@ -659,6 +729,7 @@ func TestAlert_GetRule(tt *testing.T) { } func TestAlert_GetRuleDescription(tt *testing.T) { + tt.Parallel() var zeroValue string a := &Alert{RuleDescription: &zeroValue} a.GetRuleDescription() @@ -669,6 +740,7 @@ func TestAlert_GetRuleDescription(tt *testing.T) { } func TestAlert_GetRuleID(tt *testing.T) { + tt.Parallel() var zeroValue string a := &Alert{RuleID: &zeroValue} a.GetRuleID() @@ -679,6 +751,7 @@ func TestAlert_GetRuleID(tt *testing.T) { } func TestAlert_GetRuleSeverity(tt *testing.T) { + tt.Parallel() var zeroValue string a := &Alert{RuleSeverity: &zeroValue} a.GetRuleSeverity() @@ -689,6 +762,7 @@ func TestAlert_GetRuleSeverity(tt *testing.T) { } func TestAlert_GetState(tt *testing.T) { + tt.Parallel() var zeroValue string a := &Alert{State: &zeroValue} a.GetState() @@ -699,6 +773,7 @@ func TestAlert_GetState(tt *testing.T) { } func TestAlert_GetTool(tt *testing.T) { + tt.Parallel() a := &Alert{} a.GetTool() a = nil @@ -706,6 +781,7 @@ func TestAlert_GetTool(tt *testing.T) { } func TestAlert_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp a := &Alert{UpdatedAt: &zeroValue} a.GetUpdatedAt() @@ -716,6 +792,7 @@ func TestAlert_GetUpdatedAt(tt *testing.T) { } func TestAlert_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string a := &Alert{URL: &zeroValue} a.GetURL() @@ -726,6 +803,7 @@ func TestAlert_GetURL(tt *testing.T) { } func TestAllowDeletionsEnforcementLevelChanges_GetFrom(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AllowDeletionsEnforcementLevelChanges{From: &zeroValue} a.GetFrom() @@ -736,6 +814,7 @@ func TestAllowDeletionsEnforcementLevelChanges_GetFrom(tt *testing.T) { } func TestAllowForkSyncing_GetEnabled(tt *testing.T) { + tt.Parallel() var zeroValue bool a := &AllowForkSyncing{Enabled: &zeroValue} a.GetEnabled() @@ -746,6 +825,7 @@ func TestAllowForkSyncing_GetEnabled(tt *testing.T) { } func TestAnalysesListOptions_GetRef(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AnalysesListOptions{Ref: &zeroValue} a.GetRef() @@ -756,6 +836,7 @@ func TestAnalysesListOptions_GetRef(tt *testing.T) { } func TestAnalysesListOptions_GetSarifID(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AnalysesListOptions{SarifID: &zeroValue} a.GetSarifID() @@ -766,6 +847,7 @@ func TestAnalysesListOptions_GetSarifID(tt *testing.T) { } func TestAPIMeta_GetDomains(tt *testing.T) { + tt.Parallel() a := &APIMeta{} a.GetDomains() a = nil @@ -773,6 +855,7 @@ func TestAPIMeta_GetDomains(tt *testing.T) { } func TestAPIMeta_GetSSHKeyFingerprints(tt *testing.T) { + tt.Parallel() zeroValue := map[string]string{} a := &APIMeta{SSHKeyFingerprints: zeroValue} a.GetSSHKeyFingerprints() @@ -783,6 +866,7 @@ func TestAPIMeta_GetSSHKeyFingerprints(tt *testing.T) { } func TestAPIMeta_GetVerifiablePasswordAuthentication(tt *testing.T) { + tt.Parallel() var zeroValue bool a := &APIMeta{VerifiablePasswordAuthentication: &zeroValue} a.GetVerifiablePasswordAuthentication() @@ -793,6 +877,7 @@ func TestAPIMeta_GetVerifiablePasswordAuthentication(tt *testing.T) { } func TestAPIMetaDomains_GetArtifactAttestations(tt *testing.T) { + tt.Parallel() a := &APIMetaDomains{} a.GetArtifactAttestations() a = nil @@ -800,6 +885,7 @@ func TestAPIMetaDomains_GetArtifactAttestations(tt *testing.T) { } func TestApp_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp a := &App{CreatedAt: &zeroValue} a.GetCreatedAt() @@ -810,6 +896,7 @@ func TestApp_GetCreatedAt(tt *testing.T) { } func TestApp_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string a := &App{Description: &zeroValue} a.GetDescription() @@ -820,6 +907,7 @@ func TestApp_GetDescription(tt *testing.T) { } func TestApp_GetExternalURL(tt *testing.T) { + tt.Parallel() var zeroValue string a := &App{ExternalURL: &zeroValue} a.GetExternalURL() @@ -830,6 +918,7 @@ func TestApp_GetExternalURL(tt *testing.T) { } func TestApp_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string a := &App{HTMLURL: &zeroValue} a.GetHTMLURL() @@ -840,6 +929,7 @@ func TestApp_GetHTMLURL(tt *testing.T) { } func TestApp_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 a := &App{ID: &zeroValue} a.GetID() @@ -850,6 +940,7 @@ func TestApp_GetID(tt *testing.T) { } func TestApp_GetInstallationsCount(tt *testing.T) { + tt.Parallel() var zeroValue int a := &App{InstallationsCount: &zeroValue} a.GetInstallationsCount() @@ -860,6 +951,7 @@ func TestApp_GetInstallationsCount(tt *testing.T) { } func TestApp_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string a := &App{Name: &zeroValue} a.GetName() @@ -870,6 +962,7 @@ func TestApp_GetName(tt *testing.T) { } func TestApp_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string a := &App{NodeID: &zeroValue} a.GetNodeID() @@ -880,6 +973,7 @@ func TestApp_GetNodeID(tt *testing.T) { } func TestApp_GetOwner(tt *testing.T) { + tt.Parallel() a := &App{} a.GetOwner() a = nil @@ -887,6 +981,7 @@ func TestApp_GetOwner(tt *testing.T) { } func TestApp_GetPermissions(tt *testing.T) { + tt.Parallel() a := &App{} a.GetPermissions() a = nil @@ -894,6 +989,7 @@ func TestApp_GetPermissions(tt *testing.T) { } func TestApp_GetSlug(tt *testing.T) { + tt.Parallel() var zeroValue string a := &App{Slug: &zeroValue} a.GetSlug() @@ -904,6 +1000,7 @@ func TestApp_GetSlug(tt *testing.T) { } func TestApp_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp a := &App{UpdatedAt: &zeroValue} a.GetUpdatedAt() @@ -914,6 +1011,7 @@ func TestApp_GetUpdatedAt(tt *testing.T) { } func TestAppConfig_GetClientID(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AppConfig{ClientID: &zeroValue} a.GetClientID() @@ -924,6 +1022,7 @@ func TestAppConfig_GetClientID(tt *testing.T) { } func TestAppConfig_GetClientSecret(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AppConfig{ClientSecret: &zeroValue} a.GetClientSecret() @@ -934,6 +1033,7 @@ func TestAppConfig_GetClientSecret(tt *testing.T) { } func TestAppConfig_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp a := &AppConfig{CreatedAt: &zeroValue} a.GetCreatedAt() @@ -944,6 +1044,7 @@ func TestAppConfig_GetCreatedAt(tt *testing.T) { } func TestAppConfig_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AppConfig{Description: &zeroValue} a.GetDescription() @@ -954,6 +1055,7 @@ func TestAppConfig_GetDescription(tt *testing.T) { } func TestAppConfig_GetExternalURL(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AppConfig{ExternalURL: &zeroValue} a.GetExternalURL() @@ -964,6 +1066,7 @@ func TestAppConfig_GetExternalURL(tt *testing.T) { } func TestAppConfig_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AppConfig{HTMLURL: &zeroValue} a.GetHTMLURL() @@ -974,6 +1077,7 @@ func TestAppConfig_GetHTMLURL(tt *testing.T) { } func TestAppConfig_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 a := &AppConfig{ID: &zeroValue} a.GetID() @@ -984,6 +1088,7 @@ func TestAppConfig_GetID(tt *testing.T) { } func TestAppConfig_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AppConfig{Name: &zeroValue} a.GetName() @@ -994,6 +1099,7 @@ func TestAppConfig_GetName(tt *testing.T) { } func TestAppConfig_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AppConfig{NodeID: &zeroValue} a.GetNodeID() @@ -1004,6 +1110,7 @@ func TestAppConfig_GetNodeID(tt *testing.T) { } func TestAppConfig_GetOwner(tt *testing.T) { + tt.Parallel() a := &AppConfig{} a.GetOwner() a = nil @@ -1011,6 +1118,7 @@ func TestAppConfig_GetOwner(tt *testing.T) { } func TestAppConfig_GetPEM(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AppConfig{PEM: &zeroValue} a.GetPEM() @@ -1021,6 +1129,7 @@ func TestAppConfig_GetPEM(tt *testing.T) { } func TestAppConfig_GetSlug(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AppConfig{Slug: &zeroValue} a.GetSlug() @@ -1031,6 +1140,7 @@ func TestAppConfig_GetSlug(tt *testing.T) { } func TestAppConfig_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp a := &AppConfig{UpdatedAt: &zeroValue} a.GetUpdatedAt() @@ -1041,6 +1151,7 @@ func TestAppConfig_GetUpdatedAt(tt *testing.T) { } func TestAppConfig_GetWebhookSecret(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AppConfig{WebhookSecret: &zeroValue} a.GetWebhookSecret() @@ -1051,6 +1162,7 @@ func TestAppConfig_GetWebhookSecret(tt *testing.T) { } func TestArchivedAt_GetFrom(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp a := &ArchivedAt{From: &zeroValue} a.GetFrom() @@ -1061,6 +1173,7 @@ func TestArchivedAt_GetFrom(tt *testing.T) { } func TestArchivedAt_GetTo(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp a := &ArchivedAt{To: &zeroValue} a.GetTo() @@ -1071,6 +1184,7 @@ func TestArchivedAt_GetTo(tt *testing.T) { } func TestArtifact_GetArchiveDownloadURL(tt *testing.T) { + tt.Parallel() var zeroValue string a := &Artifact{ArchiveDownloadURL: &zeroValue} a.GetArchiveDownloadURL() @@ -1081,6 +1195,7 @@ func TestArtifact_GetArchiveDownloadURL(tt *testing.T) { } func TestArtifact_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp a := &Artifact{CreatedAt: &zeroValue} a.GetCreatedAt() @@ -1091,6 +1206,7 @@ func TestArtifact_GetCreatedAt(tt *testing.T) { } func TestArtifact_GetExpired(tt *testing.T) { + tt.Parallel() var zeroValue bool a := &Artifact{Expired: &zeroValue} a.GetExpired() @@ -1101,6 +1217,7 @@ func TestArtifact_GetExpired(tt *testing.T) { } func TestArtifact_GetExpiresAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp a := &Artifact{ExpiresAt: &zeroValue} a.GetExpiresAt() @@ -1111,6 +1228,7 @@ func TestArtifact_GetExpiresAt(tt *testing.T) { } func TestArtifact_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 a := &Artifact{ID: &zeroValue} a.GetID() @@ -1121,6 +1239,7 @@ func TestArtifact_GetID(tt *testing.T) { } func TestArtifact_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string a := &Artifact{Name: &zeroValue} a.GetName() @@ -1131,6 +1250,7 @@ func TestArtifact_GetName(tt *testing.T) { } func TestArtifact_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string a := &Artifact{NodeID: &zeroValue} a.GetNodeID() @@ -1141,6 +1261,7 @@ func TestArtifact_GetNodeID(tt *testing.T) { } func TestArtifact_GetSizeInBytes(tt *testing.T) { + tt.Parallel() var zeroValue int64 a := &Artifact{SizeInBytes: &zeroValue} a.GetSizeInBytes() @@ -1151,6 +1272,7 @@ func TestArtifact_GetSizeInBytes(tt *testing.T) { } func TestArtifact_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp a := &Artifact{UpdatedAt: &zeroValue} a.GetUpdatedAt() @@ -1161,6 +1283,7 @@ func TestArtifact_GetUpdatedAt(tt *testing.T) { } func TestArtifact_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string a := &Artifact{URL: &zeroValue} a.GetURL() @@ -1171,6 +1294,7 @@ func TestArtifact_GetURL(tt *testing.T) { } func TestArtifact_GetWorkflowRun(tt *testing.T) { + tt.Parallel() a := &Artifact{} a.GetWorkflowRun() a = nil @@ -1178,6 +1302,7 @@ func TestArtifact_GetWorkflowRun(tt *testing.T) { } func TestArtifactList_GetTotalCount(tt *testing.T) { + tt.Parallel() var zeroValue int64 a := &ArtifactList{TotalCount: &zeroValue} a.GetTotalCount() @@ -1188,6 +1313,7 @@ func TestArtifactList_GetTotalCount(tt *testing.T) { } func TestArtifactWorkflowRun_GetHeadBranch(tt *testing.T) { + tt.Parallel() var zeroValue string a := &ArtifactWorkflowRun{HeadBranch: &zeroValue} a.GetHeadBranch() @@ -1198,6 +1324,7 @@ func TestArtifactWorkflowRun_GetHeadBranch(tt *testing.T) { } func TestArtifactWorkflowRun_GetHeadRepositoryID(tt *testing.T) { + tt.Parallel() var zeroValue int64 a := &ArtifactWorkflowRun{HeadRepositoryID: &zeroValue} a.GetHeadRepositoryID() @@ -1208,6 +1335,7 @@ func TestArtifactWorkflowRun_GetHeadRepositoryID(tt *testing.T) { } func TestArtifactWorkflowRun_GetHeadSHA(tt *testing.T) { + tt.Parallel() var zeroValue string a := &ArtifactWorkflowRun{HeadSHA: &zeroValue} a.GetHeadSHA() @@ -1218,6 +1346,7 @@ func TestArtifactWorkflowRun_GetHeadSHA(tt *testing.T) { } func TestArtifactWorkflowRun_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 a := &ArtifactWorkflowRun{ID: &zeroValue} a.GetID() @@ -1228,6 +1357,7 @@ func TestArtifactWorkflowRun_GetID(tt *testing.T) { } func TestArtifactWorkflowRun_GetRepositoryID(tt *testing.T) { + tt.Parallel() var zeroValue int64 a := &ArtifactWorkflowRun{RepositoryID: &zeroValue} a.GetRepositoryID() @@ -1238,6 +1368,7 @@ func TestArtifactWorkflowRun_GetRepositoryID(tt *testing.T) { } func TestAttachment_GetBody(tt *testing.T) { + tt.Parallel() var zeroValue string a := &Attachment{Body: &zeroValue} a.GetBody() @@ -1248,6 +1379,7 @@ func TestAttachment_GetBody(tt *testing.T) { } func TestAttachment_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 a := &Attachment{ID: &zeroValue} a.GetID() @@ -1258,6 +1390,7 @@ func TestAttachment_GetID(tt *testing.T) { } func TestAttachment_GetTitle(tt *testing.T) { + tt.Parallel() var zeroValue string a := &Attachment{Title: &zeroValue} a.GetTitle() @@ -1268,6 +1401,7 @@ func TestAttachment_GetTitle(tt *testing.T) { } func TestAuditEntry_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AuditEntry{Action: &zeroValue} a.GetAction() @@ -1278,6 +1412,7 @@ func TestAuditEntry_GetAction(tt *testing.T) { } func TestAuditEntry_GetActor(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AuditEntry{Actor: &zeroValue} a.GetActor() @@ -1288,6 +1423,7 @@ func TestAuditEntry_GetActor(tt *testing.T) { } func TestAuditEntry_GetActorID(tt *testing.T) { + tt.Parallel() var zeroValue int64 a := &AuditEntry{ActorID: &zeroValue} a.GetActorID() @@ -1298,6 +1434,7 @@ func TestAuditEntry_GetActorID(tt *testing.T) { } func TestAuditEntry_GetActorLocation(tt *testing.T) { + tt.Parallel() a := &AuditEntry{} a.GetActorLocation() a = nil @@ -1305,6 +1442,7 @@ func TestAuditEntry_GetActorLocation(tt *testing.T) { } func TestAuditEntry_GetBusiness(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AuditEntry{Business: &zeroValue} a.GetBusiness() @@ -1315,6 +1453,7 @@ func TestAuditEntry_GetBusiness(tt *testing.T) { } func TestAuditEntry_GetBusinessID(tt *testing.T) { + tt.Parallel() var zeroValue int64 a := &AuditEntry{BusinessID: &zeroValue} a.GetBusinessID() @@ -1325,6 +1464,7 @@ func TestAuditEntry_GetBusinessID(tt *testing.T) { } func TestAuditEntry_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp a := &AuditEntry{CreatedAt: &zeroValue} a.GetCreatedAt() @@ -1335,6 +1475,7 @@ func TestAuditEntry_GetCreatedAt(tt *testing.T) { } func TestAuditEntry_GetDocumentID(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AuditEntry{DocumentID: &zeroValue} a.GetDocumentID() @@ -1345,6 +1486,7 @@ func TestAuditEntry_GetDocumentID(tt *testing.T) { } func TestAuditEntry_GetExternalIdentityNameID(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AuditEntry{ExternalIdentityNameID: &zeroValue} a.GetExternalIdentityNameID() @@ -1355,6 +1497,7 @@ func TestAuditEntry_GetExternalIdentityNameID(tt *testing.T) { } func TestAuditEntry_GetExternalIdentityUsername(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AuditEntry{ExternalIdentityUsername: &zeroValue} a.GetExternalIdentityUsername() @@ -1365,6 +1508,7 @@ func TestAuditEntry_GetExternalIdentityUsername(tt *testing.T) { } func TestAuditEntry_GetHashedToken(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AuditEntry{HashedToken: &zeroValue} a.GetHashedToken() @@ -1375,6 +1519,7 @@ func TestAuditEntry_GetHashedToken(tt *testing.T) { } func TestAuditEntry_GetOrg(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AuditEntry{Org: &zeroValue} a.GetOrg() @@ -1385,6 +1530,7 @@ func TestAuditEntry_GetOrg(tt *testing.T) { } func TestAuditEntry_GetOrgID(tt *testing.T) { + tt.Parallel() var zeroValue int64 a := &AuditEntry{OrgID: &zeroValue} a.GetOrgID() @@ -1395,6 +1541,7 @@ func TestAuditEntry_GetOrgID(tt *testing.T) { } func TestAuditEntry_GetTimestamp(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp a := &AuditEntry{Timestamp: &zeroValue} a.GetTimestamp() @@ -1405,6 +1552,7 @@ func TestAuditEntry_GetTimestamp(tt *testing.T) { } func TestAuditEntry_GetTokenID(tt *testing.T) { + tt.Parallel() var zeroValue int64 a := &AuditEntry{TokenID: &zeroValue} a.GetTokenID() @@ -1415,6 +1563,7 @@ func TestAuditEntry_GetTokenID(tt *testing.T) { } func TestAuditEntry_GetTokenScopes(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AuditEntry{TokenScopes: &zeroValue} a.GetTokenScopes() @@ -1425,6 +1574,7 @@ func TestAuditEntry_GetTokenScopes(tt *testing.T) { } func TestAuditEntry_GetUser(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AuditEntry{User: &zeroValue} a.GetUser() @@ -1435,6 +1585,7 @@ func TestAuditEntry_GetUser(tt *testing.T) { } func TestAuditEntry_GetUserID(tt *testing.T) { + tt.Parallel() var zeroValue int64 a := &AuditEntry{UserID: &zeroValue} a.GetUserID() @@ -1445,6 +1596,7 @@ func TestAuditEntry_GetUserID(tt *testing.T) { } func TestAuthorization_GetApp(tt *testing.T) { + tt.Parallel() a := &Authorization{} a.GetApp() a = nil @@ -1452,6 +1604,7 @@ func TestAuthorization_GetApp(tt *testing.T) { } func TestAuthorization_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp a := &Authorization{CreatedAt: &zeroValue} a.GetCreatedAt() @@ -1462,6 +1615,7 @@ func TestAuthorization_GetCreatedAt(tt *testing.T) { } func TestAuthorization_GetFingerprint(tt *testing.T) { + tt.Parallel() var zeroValue string a := &Authorization{Fingerprint: &zeroValue} a.GetFingerprint() @@ -1472,6 +1626,7 @@ func TestAuthorization_GetFingerprint(tt *testing.T) { } func TestAuthorization_GetHashedToken(tt *testing.T) { + tt.Parallel() var zeroValue string a := &Authorization{HashedToken: &zeroValue} a.GetHashedToken() @@ -1482,6 +1637,7 @@ func TestAuthorization_GetHashedToken(tt *testing.T) { } func TestAuthorization_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 a := &Authorization{ID: &zeroValue} a.GetID() @@ -1492,6 +1648,7 @@ func TestAuthorization_GetID(tt *testing.T) { } func TestAuthorization_GetNote(tt *testing.T) { + tt.Parallel() var zeroValue string a := &Authorization{Note: &zeroValue} a.GetNote() @@ -1502,6 +1659,7 @@ func TestAuthorization_GetNote(tt *testing.T) { } func TestAuthorization_GetNoteURL(tt *testing.T) { + tt.Parallel() var zeroValue string a := &Authorization{NoteURL: &zeroValue} a.GetNoteURL() @@ -1512,6 +1670,7 @@ func TestAuthorization_GetNoteURL(tt *testing.T) { } func TestAuthorization_GetToken(tt *testing.T) { + tt.Parallel() var zeroValue string a := &Authorization{Token: &zeroValue} a.GetToken() @@ -1522,6 +1681,7 @@ func TestAuthorization_GetToken(tt *testing.T) { } func TestAuthorization_GetTokenLastEight(tt *testing.T) { + tt.Parallel() var zeroValue string a := &Authorization{TokenLastEight: &zeroValue} a.GetTokenLastEight() @@ -1532,6 +1692,7 @@ func TestAuthorization_GetTokenLastEight(tt *testing.T) { } func TestAuthorization_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp a := &Authorization{UpdatedAt: &zeroValue} a.GetUpdatedAt() @@ -1542,6 +1703,7 @@ func TestAuthorization_GetUpdatedAt(tt *testing.T) { } func TestAuthorization_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string a := &Authorization{URL: &zeroValue} a.GetURL() @@ -1552,6 +1714,7 @@ func TestAuthorization_GetURL(tt *testing.T) { } func TestAuthorization_GetUser(tt *testing.T) { + tt.Parallel() a := &Authorization{} a.GetUser() a = nil @@ -1559,6 +1722,7 @@ func TestAuthorization_GetUser(tt *testing.T) { } func TestAuthorizationApp_GetClientID(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AuthorizationApp{ClientID: &zeroValue} a.GetClientID() @@ -1569,6 +1733,7 @@ func TestAuthorizationApp_GetClientID(tt *testing.T) { } func TestAuthorizationApp_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AuthorizationApp{Name: &zeroValue} a.GetName() @@ -1579,6 +1744,7 @@ func TestAuthorizationApp_GetName(tt *testing.T) { } func TestAuthorizationApp_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AuthorizationApp{URL: &zeroValue} a.GetURL() @@ -1589,6 +1755,7 @@ func TestAuthorizationApp_GetURL(tt *testing.T) { } func TestAuthorizationRequest_GetClientID(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AuthorizationRequest{ClientID: &zeroValue} a.GetClientID() @@ -1599,6 +1766,7 @@ func TestAuthorizationRequest_GetClientID(tt *testing.T) { } func TestAuthorizationRequest_GetClientSecret(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AuthorizationRequest{ClientSecret: &zeroValue} a.GetClientSecret() @@ -1609,6 +1777,7 @@ func TestAuthorizationRequest_GetClientSecret(tt *testing.T) { } func TestAuthorizationRequest_GetFingerprint(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AuthorizationRequest{Fingerprint: &zeroValue} a.GetFingerprint() @@ -1619,6 +1788,7 @@ func TestAuthorizationRequest_GetFingerprint(tt *testing.T) { } func TestAuthorizationRequest_GetNote(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AuthorizationRequest{Note: &zeroValue} a.GetNote() @@ -1629,6 +1799,7 @@ func TestAuthorizationRequest_GetNote(tt *testing.T) { } func TestAuthorizationRequest_GetNoteURL(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AuthorizationRequest{NoteURL: &zeroValue} a.GetNoteURL() @@ -1639,6 +1810,7 @@ func TestAuthorizationRequest_GetNoteURL(tt *testing.T) { } func TestAuthorizationUpdateRequest_GetFingerprint(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AuthorizationUpdateRequest{Fingerprint: &zeroValue} a.GetFingerprint() @@ -1649,6 +1821,7 @@ func TestAuthorizationUpdateRequest_GetFingerprint(tt *testing.T) { } func TestAuthorizationUpdateRequest_GetNote(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AuthorizationUpdateRequest{Note: &zeroValue} a.GetNote() @@ -1659,6 +1832,7 @@ func TestAuthorizationUpdateRequest_GetNote(tt *testing.T) { } func TestAuthorizationUpdateRequest_GetNoteURL(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AuthorizationUpdateRequest{NoteURL: &zeroValue} a.GetNoteURL() @@ -1669,6 +1843,7 @@ func TestAuthorizationUpdateRequest_GetNoteURL(tt *testing.T) { } func TestAuthorizedActorsOnly_GetFrom(tt *testing.T) { + tt.Parallel() var zeroValue bool a := &AuthorizedActorsOnly{From: &zeroValue} a.GetFrom() @@ -1679,6 +1854,7 @@ func TestAuthorizedActorsOnly_GetFrom(tt *testing.T) { } func TestAuthorizedDismissalActorsOnlyChanges_GetFrom(tt *testing.T) { + tt.Parallel() var zeroValue bool a := &AuthorizedDismissalActorsOnlyChanges{From: &zeroValue} a.GetFrom() @@ -1689,6 +1865,7 @@ func TestAuthorizedDismissalActorsOnlyChanges_GetFrom(tt *testing.T) { } func TestAutolink_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 a := &Autolink{ID: &zeroValue} a.GetID() @@ -1699,6 +1876,7 @@ func TestAutolink_GetID(tt *testing.T) { } func TestAutolink_GetIsAlphanumeric(tt *testing.T) { + tt.Parallel() var zeroValue bool a := &Autolink{IsAlphanumeric: &zeroValue} a.GetIsAlphanumeric() @@ -1709,6 +1887,7 @@ func TestAutolink_GetIsAlphanumeric(tt *testing.T) { } func TestAutolink_GetKeyPrefix(tt *testing.T) { + tt.Parallel() var zeroValue string a := &Autolink{KeyPrefix: &zeroValue} a.GetKeyPrefix() @@ -1719,6 +1898,7 @@ func TestAutolink_GetKeyPrefix(tt *testing.T) { } func TestAutolink_GetURLTemplate(tt *testing.T) { + tt.Parallel() var zeroValue string a := &Autolink{URLTemplate: &zeroValue} a.GetURLTemplate() @@ -1729,6 +1909,7 @@ func TestAutolink_GetURLTemplate(tt *testing.T) { } func TestAutolinkOptions_GetIsAlphanumeric(tt *testing.T) { + tt.Parallel() var zeroValue bool a := &AutolinkOptions{IsAlphanumeric: &zeroValue} a.GetIsAlphanumeric() @@ -1739,6 +1920,7 @@ func TestAutolinkOptions_GetIsAlphanumeric(tt *testing.T) { } func TestAutolinkOptions_GetKeyPrefix(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AutolinkOptions{KeyPrefix: &zeroValue} a.GetKeyPrefix() @@ -1749,6 +1931,7 @@ func TestAutolinkOptions_GetKeyPrefix(tt *testing.T) { } func TestAutolinkOptions_GetURLTemplate(tt *testing.T) { + tt.Parallel() var zeroValue string a := &AutolinkOptions{URLTemplate: &zeroValue} a.GetURLTemplate() @@ -1759,6 +1942,7 @@ func TestAutolinkOptions_GetURLTemplate(tt *testing.T) { } func TestAutomatedSecurityFixes_GetEnabled(tt *testing.T) { + tt.Parallel() var zeroValue bool a := &AutomatedSecurityFixes{Enabled: &zeroValue} a.GetEnabled() @@ -1769,6 +1953,7 @@ func TestAutomatedSecurityFixes_GetEnabled(tt *testing.T) { } func TestAutomatedSecurityFixes_GetPaused(tt *testing.T) { + tt.Parallel() var zeroValue bool a := &AutomatedSecurityFixes{Paused: &zeroValue} a.GetPaused() @@ -1779,6 +1964,7 @@ func TestAutomatedSecurityFixes_GetPaused(tt *testing.T) { } func TestAutoTriggerCheck_GetAppID(tt *testing.T) { + tt.Parallel() var zeroValue int64 a := &AutoTriggerCheck{AppID: &zeroValue} a.GetAppID() @@ -1789,6 +1975,7 @@ func TestAutoTriggerCheck_GetAppID(tt *testing.T) { } func TestAutoTriggerCheck_GetSetting(tt *testing.T) { + tt.Parallel() var zeroValue bool a := &AutoTriggerCheck{Setting: &zeroValue} a.GetSetting() @@ -1799,6 +1986,7 @@ func TestAutoTriggerCheck_GetSetting(tt *testing.T) { } func TestBlob_GetContent(tt *testing.T) { + tt.Parallel() var zeroValue string b := &Blob{Content: &zeroValue} b.GetContent() @@ -1809,6 +1997,7 @@ func TestBlob_GetContent(tt *testing.T) { } func TestBlob_GetEncoding(tt *testing.T) { + tt.Parallel() var zeroValue string b := &Blob{Encoding: &zeroValue} b.GetEncoding() @@ -1819,6 +2008,7 @@ func TestBlob_GetEncoding(tt *testing.T) { } func TestBlob_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string b := &Blob{NodeID: &zeroValue} b.GetNodeID() @@ -1829,6 +2019,7 @@ func TestBlob_GetNodeID(tt *testing.T) { } func TestBlob_GetSHA(tt *testing.T) { + tt.Parallel() var zeroValue string b := &Blob{SHA: &zeroValue} b.GetSHA() @@ -1839,6 +2030,7 @@ func TestBlob_GetSHA(tt *testing.T) { } func TestBlob_GetSize(tt *testing.T) { + tt.Parallel() var zeroValue int b := &Blob{Size: &zeroValue} b.GetSize() @@ -1849,6 +2041,7 @@ func TestBlob_GetSize(tt *testing.T) { } func TestBlob_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string b := &Blob{URL: &zeroValue} b.GetURL() @@ -1859,6 +2052,7 @@ func TestBlob_GetURL(tt *testing.T) { } func TestBlockCreations_GetEnabled(tt *testing.T) { + tt.Parallel() var zeroValue bool b := &BlockCreations{Enabled: &zeroValue} b.GetEnabled() @@ -1869,6 +2063,7 @@ func TestBlockCreations_GetEnabled(tt *testing.T) { } func TestBranch_GetCommit(tt *testing.T) { + tt.Parallel() b := &Branch{} b.GetCommit() b = nil @@ -1876,6 +2071,7 @@ func TestBranch_GetCommit(tt *testing.T) { } func TestBranch_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string b := &Branch{Name: &zeroValue} b.GetName() @@ -1886,6 +2082,7 @@ func TestBranch_GetName(tt *testing.T) { } func TestBranch_GetProtected(tt *testing.T) { + tt.Parallel() var zeroValue bool b := &Branch{Protected: &zeroValue} b.GetProtected() @@ -1896,6 +2093,7 @@ func TestBranch_GetProtected(tt *testing.T) { } func TestBranch_GetProtection(tt *testing.T) { + tt.Parallel() b := &Branch{} b.GetProtection() b = nil @@ -1903,6 +2101,7 @@ func TestBranch_GetProtection(tt *testing.T) { } func TestBranchCommit_GetCommit(tt *testing.T) { + tt.Parallel() b := &BranchCommit{} b.GetCommit() b = nil @@ -1910,6 +2109,7 @@ func TestBranchCommit_GetCommit(tt *testing.T) { } func TestBranchCommit_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string b := &BranchCommit{Name: &zeroValue} b.GetName() @@ -1920,6 +2120,7 @@ func TestBranchCommit_GetName(tt *testing.T) { } func TestBranchCommit_GetProtected(tt *testing.T) { + tt.Parallel() var zeroValue bool b := &BranchCommit{Protected: &zeroValue} b.GetProtected() @@ -1930,6 +2131,7 @@ func TestBranchCommit_GetProtected(tt *testing.T) { } func TestBranchListOptions_GetProtected(tt *testing.T) { + tt.Parallel() var zeroValue bool b := &BranchListOptions{Protected: &zeroValue} b.GetProtected() @@ -1940,6 +2142,7 @@ func TestBranchListOptions_GetProtected(tt *testing.T) { } func TestBranchPolicy_GetCustomBranchPolicies(tt *testing.T) { + tt.Parallel() var zeroValue bool b := &BranchPolicy{CustomBranchPolicies: &zeroValue} b.GetCustomBranchPolicies() @@ -1950,6 +2153,7 @@ func TestBranchPolicy_GetCustomBranchPolicies(tt *testing.T) { } func TestBranchPolicy_GetProtectedBranches(tt *testing.T) { + tt.Parallel() var zeroValue bool b := &BranchPolicy{ProtectedBranches: &zeroValue} b.GetProtectedBranches() @@ -1960,6 +2164,7 @@ func TestBranchPolicy_GetProtectedBranches(tt *testing.T) { } func TestBranchProtectionRule_GetAdminEnforced(tt *testing.T) { + tt.Parallel() var zeroValue bool b := &BranchProtectionRule{AdminEnforced: &zeroValue} b.GetAdminEnforced() @@ -1970,6 +2175,7 @@ func TestBranchProtectionRule_GetAdminEnforced(tt *testing.T) { } func TestBranchProtectionRule_GetAllowDeletionsEnforcementLevel(tt *testing.T) { + tt.Parallel() var zeroValue string b := &BranchProtectionRule{AllowDeletionsEnforcementLevel: &zeroValue} b.GetAllowDeletionsEnforcementLevel() @@ -1980,6 +2186,7 @@ func TestBranchProtectionRule_GetAllowDeletionsEnforcementLevel(tt *testing.T) { } func TestBranchProtectionRule_GetAllowForcePushesEnforcementLevel(tt *testing.T) { + tt.Parallel() var zeroValue string b := &BranchProtectionRule{AllowForcePushesEnforcementLevel: &zeroValue} b.GetAllowForcePushesEnforcementLevel() @@ -1990,6 +2197,7 @@ func TestBranchProtectionRule_GetAllowForcePushesEnforcementLevel(tt *testing.T) } func TestBranchProtectionRule_GetAuthorizedActorsOnly(tt *testing.T) { + tt.Parallel() var zeroValue bool b := &BranchProtectionRule{AuthorizedActorsOnly: &zeroValue} b.GetAuthorizedActorsOnly() @@ -2000,6 +2208,7 @@ func TestBranchProtectionRule_GetAuthorizedActorsOnly(tt *testing.T) { } func TestBranchProtectionRule_GetAuthorizedDismissalActorsOnly(tt *testing.T) { + tt.Parallel() var zeroValue bool b := &BranchProtectionRule{AuthorizedDismissalActorsOnly: &zeroValue} b.GetAuthorizedDismissalActorsOnly() @@ -2010,6 +2219,7 @@ func TestBranchProtectionRule_GetAuthorizedDismissalActorsOnly(tt *testing.T) { } func TestBranchProtectionRule_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp b := &BranchProtectionRule{CreatedAt: &zeroValue} b.GetCreatedAt() @@ -2020,6 +2230,7 @@ func TestBranchProtectionRule_GetCreatedAt(tt *testing.T) { } func TestBranchProtectionRule_GetDismissStaleReviewsOnPush(tt *testing.T) { + tt.Parallel() var zeroValue bool b := &BranchProtectionRule{DismissStaleReviewsOnPush: &zeroValue} b.GetDismissStaleReviewsOnPush() @@ -2030,6 +2241,7 @@ func TestBranchProtectionRule_GetDismissStaleReviewsOnPush(tt *testing.T) { } func TestBranchProtectionRule_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 b := &BranchProtectionRule{ID: &zeroValue} b.GetID() @@ -2040,6 +2252,7 @@ func TestBranchProtectionRule_GetID(tt *testing.T) { } func TestBranchProtectionRule_GetIgnoreApprovalsFromContributors(tt *testing.T) { + tt.Parallel() var zeroValue bool b := &BranchProtectionRule{IgnoreApprovalsFromContributors: &zeroValue} b.GetIgnoreApprovalsFromContributors() @@ -2050,6 +2263,7 @@ func TestBranchProtectionRule_GetIgnoreApprovalsFromContributors(tt *testing.T) } func TestBranchProtectionRule_GetLinearHistoryRequirementEnforcementLevel(tt *testing.T) { + tt.Parallel() var zeroValue string b := &BranchProtectionRule{LinearHistoryRequirementEnforcementLevel: &zeroValue} b.GetLinearHistoryRequirementEnforcementLevel() @@ -2060,6 +2274,7 @@ func TestBranchProtectionRule_GetLinearHistoryRequirementEnforcementLevel(tt *te } func TestBranchProtectionRule_GetMergeQueueEnforcementLevel(tt *testing.T) { + tt.Parallel() var zeroValue string b := &BranchProtectionRule{MergeQueueEnforcementLevel: &zeroValue} b.GetMergeQueueEnforcementLevel() @@ -2070,6 +2285,7 @@ func TestBranchProtectionRule_GetMergeQueueEnforcementLevel(tt *testing.T) { } func TestBranchProtectionRule_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string b := &BranchProtectionRule{Name: &zeroValue} b.GetName() @@ -2080,6 +2296,7 @@ func TestBranchProtectionRule_GetName(tt *testing.T) { } func TestBranchProtectionRule_GetPullRequestReviewsEnforcementLevel(tt *testing.T) { + tt.Parallel() var zeroValue string b := &BranchProtectionRule{PullRequestReviewsEnforcementLevel: &zeroValue} b.GetPullRequestReviewsEnforcementLevel() @@ -2090,6 +2307,7 @@ func TestBranchProtectionRule_GetPullRequestReviewsEnforcementLevel(tt *testing. } func TestBranchProtectionRule_GetRepositoryID(tt *testing.T) { + tt.Parallel() var zeroValue int64 b := &BranchProtectionRule{RepositoryID: &zeroValue} b.GetRepositoryID() @@ -2100,6 +2318,7 @@ func TestBranchProtectionRule_GetRepositoryID(tt *testing.T) { } func TestBranchProtectionRule_GetRequireCodeOwnerReview(tt *testing.T) { + tt.Parallel() var zeroValue bool b := &BranchProtectionRule{RequireCodeOwnerReview: &zeroValue} b.GetRequireCodeOwnerReview() @@ -2110,6 +2329,7 @@ func TestBranchProtectionRule_GetRequireCodeOwnerReview(tt *testing.T) { } func TestBranchProtectionRule_GetRequiredApprovingReviewCount(tt *testing.T) { + tt.Parallel() var zeroValue int b := &BranchProtectionRule{RequiredApprovingReviewCount: &zeroValue} b.GetRequiredApprovingReviewCount() @@ -2120,6 +2340,7 @@ func TestBranchProtectionRule_GetRequiredApprovingReviewCount(tt *testing.T) { } func TestBranchProtectionRule_GetRequiredConversationResolutionLevel(tt *testing.T) { + tt.Parallel() var zeroValue string b := &BranchProtectionRule{RequiredConversationResolutionLevel: &zeroValue} b.GetRequiredConversationResolutionLevel() @@ -2130,6 +2351,7 @@ func TestBranchProtectionRule_GetRequiredConversationResolutionLevel(tt *testing } func TestBranchProtectionRule_GetRequiredDeploymentsEnforcementLevel(tt *testing.T) { + tt.Parallel() var zeroValue string b := &BranchProtectionRule{RequiredDeploymentsEnforcementLevel: &zeroValue} b.GetRequiredDeploymentsEnforcementLevel() @@ -2140,6 +2362,7 @@ func TestBranchProtectionRule_GetRequiredDeploymentsEnforcementLevel(tt *testing } func TestBranchProtectionRule_GetRequiredStatusChecksEnforcementLevel(tt *testing.T) { + tt.Parallel() var zeroValue string b := &BranchProtectionRule{RequiredStatusChecksEnforcementLevel: &zeroValue} b.GetRequiredStatusChecksEnforcementLevel() @@ -2150,6 +2373,7 @@ func TestBranchProtectionRule_GetRequiredStatusChecksEnforcementLevel(tt *testin } func TestBranchProtectionRule_GetSignatureRequirementEnforcementLevel(tt *testing.T) { + tt.Parallel() var zeroValue string b := &BranchProtectionRule{SignatureRequirementEnforcementLevel: &zeroValue} b.GetSignatureRequirementEnforcementLevel() @@ -2160,6 +2384,7 @@ func TestBranchProtectionRule_GetSignatureRequirementEnforcementLevel(tt *testin } func TestBranchProtectionRule_GetStrictRequiredStatusChecksPolicy(tt *testing.T) { + tt.Parallel() var zeroValue bool b := &BranchProtectionRule{StrictRequiredStatusChecksPolicy: &zeroValue} b.GetStrictRequiredStatusChecksPolicy() @@ -2170,6 +2395,7 @@ func TestBranchProtectionRule_GetStrictRequiredStatusChecksPolicy(tt *testing.T) } func TestBranchProtectionRule_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp b := &BranchProtectionRule{UpdatedAt: &zeroValue} b.GetUpdatedAt() @@ -2180,6 +2406,7 @@ func TestBranchProtectionRule_GetUpdatedAt(tt *testing.T) { } func TestBranchProtectionRuleEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string b := &BranchProtectionRuleEvent{Action: &zeroValue} b.GetAction() @@ -2190,6 +2417,7 @@ func TestBranchProtectionRuleEvent_GetAction(tt *testing.T) { } func TestBranchProtectionRuleEvent_GetChanges(tt *testing.T) { + tt.Parallel() b := &BranchProtectionRuleEvent{} b.GetChanges() b = nil @@ -2197,6 +2425,7 @@ func TestBranchProtectionRuleEvent_GetChanges(tt *testing.T) { } func TestBranchProtectionRuleEvent_GetInstallation(tt *testing.T) { + tt.Parallel() b := &BranchProtectionRuleEvent{} b.GetInstallation() b = nil @@ -2204,6 +2433,7 @@ func TestBranchProtectionRuleEvent_GetInstallation(tt *testing.T) { } func TestBranchProtectionRuleEvent_GetOrg(tt *testing.T) { + tt.Parallel() b := &BranchProtectionRuleEvent{} b.GetOrg() b = nil @@ -2211,6 +2441,7 @@ func TestBranchProtectionRuleEvent_GetOrg(tt *testing.T) { } func TestBranchProtectionRuleEvent_GetRepo(tt *testing.T) { + tt.Parallel() b := &BranchProtectionRuleEvent{} b.GetRepo() b = nil @@ -2218,6 +2449,7 @@ func TestBranchProtectionRuleEvent_GetRepo(tt *testing.T) { } func TestBranchProtectionRuleEvent_GetRule(tt *testing.T) { + tt.Parallel() b := &BranchProtectionRuleEvent{} b.GetRule() b = nil @@ -2225,6 +2457,7 @@ func TestBranchProtectionRuleEvent_GetRule(tt *testing.T) { } func TestBranchProtectionRuleEvent_GetSender(tt *testing.T) { + tt.Parallel() b := &BranchProtectionRuleEvent{} b.GetSender() b = nil @@ -2232,6 +2465,7 @@ func TestBranchProtectionRuleEvent_GetSender(tt *testing.T) { } func TestBypassActor_GetActorID(tt *testing.T) { + tt.Parallel() var zeroValue int64 b := &BypassActor{ActorID: &zeroValue} b.GetActorID() @@ -2242,6 +2476,7 @@ func TestBypassActor_GetActorID(tt *testing.T) { } func TestBypassActor_GetActorType(tt *testing.T) { + tt.Parallel() var zeroValue string b := &BypassActor{ActorType: &zeroValue} b.GetActorType() @@ -2252,6 +2487,7 @@ func TestBypassActor_GetActorType(tt *testing.T) { } func TestBypassActor_GetBypassMode(tt *testing.T) { + tt.Parallel() var zeroValue string b := &BypassActor{BypassMode: &zeroValue} b.GetBypassMode() @@ -2262,6 +2498,7 @@ func TestBypassActor_GetBypassMode(tt *testing.T) { } func TestCheckRun_GetApp(tt *testing.T) { + tt.Parallel() c := &CheckRun{} c.GetApp() c = nil @@ -2269,6 +2506,7 @@ func TestCheckRun_GetApp(tt *testing.T) { } func TestCheckRun_GetCheckSuite(tt *testing.T) { + tt.Parallel() c := &CheckRun{} c.GetCheckSuite() c = nil @@ -2276,6 +2514,7 @@ func TestCheckRun_GetCheckSuite(tt *testing.T) { } func TestCheckRun_GetCompletedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp c := &CheckRun{CompletedAt: &zeroValue} c.GetCompletedAt() @@ -2286,6 +2525,7 @@ func TestCheckRun_GetCompletedAt(tt *testing.T) { } func TestCheckRun_GetConclusion(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CheckRun{Conclusion: &zeroValue} c.GetConclusion() @@ -2296,6 +2536,7 @@ func TestCheckRun_GetConclusion(tt *testing.T) { } func TestCheckRun_GetDetailsURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CheckRun{DetailsURL: &zeroValue} c.GetDetailsURL() @@ -2306,6 +2547,7 @@ func TestCheckRun_GetDetailsURL(tt *testing.T) { } func TestCheckRun_GetExternalID(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CheckRun{ExternalID: &zeroValue} c.GetExternalID() @@ -2316,6 +2558,7 @@ func TestCheckRun_GetExternalID(tt *testing.T) { } func TestCheckRun_GetHeadSHA(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CheckRun{HeadSHA: &zeroValue} c.GetHeadSHA() @@ -2326,6 +2569,7 @@ func TestCheckRun_GetHeadSHA(tt *testing.T) { } func TestCheckRun_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CheckRun{HTMLURL: &zeroValue} c.GetHTMLURL() @@ -2336,6 +2580,7 @@ func TestCheckRun_GetHTMLURL(tt *testing.T) { } func TestCheckRun_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 c := &CheckRun{ID: &zeroValue} c.GetID() @@ -2346,6 +2591,7 @@ func TestCheckRun_GetID(tt *testing.T) { } func TestCheckRun_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CheckRun{Name: &zeroValue} c.GetName() @@ -2356,6 +2602,7 @@ func TestCheckRun_GetName(tt *testing.T) { } func TestCheckRun_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CheckRun{NodeID: &zeroValue} c.GetNodeID() @@ -2366,6 +2613,7 @@ func TestCheckRun_GetNodeID(tt *testing.T) { } func TestCheckRun_GetOutput(tt *testing.T) { + tt.Parallel() c := &CheckRun{} c.GetOutput() c = nil @@ -2373,6 +2621,7 @@ func TestCheckRun_GetOutput(tt *testing.T) { } func TestCheckRun_GetStartedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp c := &CheckRun{StartedAt: &zeroValue} c.GetStartedAt() @@ -2383,6 +2632,7 @@ func TestCheckRun_GetStartedAt(tt *testing.T) { } func TestCheckRun_GetStatus(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CheckRun{Status: &zeroValue} c.GetStatus() @@ -2393,6 +2643,7 @@ func TestCheckRun_GetStatus(tt *testing.T) { } func TestCheckRun_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CheckRun{URL: &zeroValue} c.GetURL() @@ -2403,6 +2654,7 @@ func TestCheckRun_GetURL(tt *testing.T) { } func TestCheckRunAnnotation_GetAnnotationLevel(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CheckRunAnnotation{AnnotationLevel: &zeroValue} c.GetAnnotationLevel() @@ -2413,6 +2665,7 @@ func TestCheckRunAnnotation_GetAnnotationLevel(tt *testing.T) { } func TestCheckRunAnnotation_GetEndColumn(tt *testing.T) { + tt.Parallel() var zeroValue int c := &CheckRunAnnotation{EndColumn: &zeroValue} c.GetEndColumn() @@ -2423,6 +2676,7 @@ func TestCheckRunAnnotation_GetEndColumn(tt *testing.T) { } func TestCheckRunAnnotation_GetEndLine(tt *testing.T) { + tt.Parallel() var zeroValue int c := &CheckRunAnnotation{EndLine: &zeroValue} c.GetEndLine() @@ -2433,6 +2687,7 @@ func TestCheckRunAnnotation_GetEndLine(tt *testing.T) { } func TestCheckRunAnnotation_GetMessage(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CheckRunAnnotation{Message: &zeroValue} c.GetMessage() @@ -2443,6 +2698,7 @@ func TestCheckRunAnnotation_GetMessage(tt *testing.T) { } func TestCheckRunAnnotation_GetPath(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CheckRunAnnotation{Path: &zeroValue} c.GetPath() @@ -2453,6 +2709,7 @@ func TestCheckRunAnnotation_GetPath(tt *testing.T) { } func TestCheckRunAnnotation_GetRawDetails(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CheckRunAnnotation{RawDetails: &zeroValue} c.GetRawDetails() @@ -2463,6 +2720,7 @@ func TestCheckRunAnnotation_GetRawDetails(tt *testing.T) { } func TestCheckRunAnnotation_GetStartColumn(tt *testing.T) { + tt.Parallel() var zeroValue int c := &CheckRunAnnotation{StartColumn: &zeroValue} c.GetStartColumn() @@ -2473,6 +2731,7 @@ func TestCheckRunAnnotation_GetStartColumn(tt *testing.T) { } func TestCheckRunAnnotation_GetStartLine(tt *testing.T) { + tt.Parallel() var zeroValue int c := &CheckRunAnnotation{StartLine: &zeroValue} c.GetStartLine() @@ -2483,6 +2742,7 @@ func TestCheckRunAnnotation_GetStartLine(tt *testing.T) { } func TestCheckRunAnnotation_GetTitle(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CheckRunAnnotation{Title: &zeroValue} c.GetTitle() @@ -2493,6 +2753,7 @@ func TestCheckRunAnnotation_GetTitle(tt *testing.T) { } func TestCheckRunEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CheckRunEvent{Action: &zeroValue} c.GetAction() @@ -2503,6 +2764,7 @@ func TestCheckRunEvent_GetAction(tt *testing.T) { } func TestCheckRunEvent_GetCheckRun(tt *testing.T) { + tt.Parallel() c := &CheckRunEvent{} c.GetCheckRun() c = nil @@ -2510,6 +2772,7 @@ func TestCheckRunEvent_GetCheckRun(tt *testing.T) { } func TestCheckRunEvent_GetInstallation(tt *testing.T) { + tt.Parallel() c := &CheckRunEvent{} c.GetInstallation() c = nil @@ -2517,6 +2780,7 @@ func TestCheckRunEvent_GetInstallation(tt *testing.T) { } func TestCheckRunEvent_GetOrg(tt *testing.T) { + tt.Parallel() c := &CheckRunEvent{} c.GetOrg() c = nil @@ -2524,6 +2788,7 @@ func TestCheckRunEvent_GetOrg(tt *testing.T) { } func TestCheckRunEvent_GetRepo(tt *testing.T) { + tt.Parallel() c := &CheckRunEvent{} c.GetRepo() c = nil @@ -2531,6 +2796,7 @@ func TestCheckRunEvent_GetRepo(tt *testing.T) { } func TestCheckRunEvent_GetRequestedAction(tt *testing.T) { + tt.Parallel() c := &CheckRunEvent{} c.GetRequestedAction() c = nil @@ -2538,6 +2804,7 @@ func TestCheckRunEvent_GetRequestedAction(tt *testing.T) { } func TestCheckRunEvent_GetSender(tt *testing.T) { + tt.Parallel() c := &CheckRunEvent{} c.GetSender() c = nil @@ -2545,6 +2812,7 @@ func TestCheckRunEvent_GetSender(tt *testing.T) { } func TestCheckRunImage_GetAlt(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CheckRunImage{Alt: &zeroValue} c.GetAlt() @@ -2555,6 +2823,7 @@ func TestCheckRunImage_GetAlt(tt *testing.T) { } func TestCheckRunImage_GetCaption(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CheckRunImage{Caption: &zeroValue} c.GetCaption() @@ -2565,6 +2834,7 @@ func TestCheckRunImage_GetCaption(tt *testing.T) { } func TestCheckRunImage_GetImageURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CheckRunImage{ImageURL: &zeroValue} c.GetImageURL() @@ -2575,6 +2845,7 @@ func TestCheckRunImage_GetImageURL(tt *testing.T) { } func TestCheckRunOutput_GetAnnotationsCount(tt *testing.T) { + tt.Parallel() var zeroValue int c := &CheckRunOutput{AnnotationsCount: &zeroValue} c.GetAnnotationsCount() @@ -2585,6 +2856,7 @@ func TestCheckRunOutput_GetAnnotationsCount(tt *testing.T) { } func TestCheckRunOutput_GetAnnotationsURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CheckRunOutput{AnnotationsURL: &zeroValue} c.GetAnnotationsURL() @@ -2595,6 +2867,7 @@ func TestCheckRunOutput_GetAnnotationsURL(tt *testing.T) { } func TestCheckRunOutput_GetSummary(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CheckRunOutput{Summary: &zeroValue} c.GetSummary() @@ -2605,6 +2878,7 @@ func TestCheckRunOutput_GetSummary(tt *testing.T) { } func TestCheckRunOutput_GetText(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CheckRunOutput{Text: &zeroValue} c.GetText() @@ -2615,6 +2889,7 @@ func TestCheckRunOutput_GetText(tt *testing.T) { } func TestCheckRunOutput_GetTitle(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CheckRunOutput{Title: &zeroValue} c.GetTitle() @@ -2625,6 +2900,7 @@ func TestCheckRunOutput_GetTitle(tt *testing.T) { } func TestCheckSuite_GetAfterSHA(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CheckSuite{AfterSHA: &zeroValue} c.GetAfterSHA() @@ -2635,6 +2911,7 @@ func TestCheckSuite_GetAfterSHA(tt *testing.T) { } func TestCheckSuite_GetApp(tt *testing.T) { + tt.Parallel() c := &CheckSuite{} c.GetApp() c = nil @@ -2642,6 +2919,7 @@ func TestCheckSuite_GetApp(tt *testing.T) { } func TestCheckSuite_GetBeforeSHA(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CheckSuite{BeforeSHA: &zeroValue} c.GetBeforeSHA() @@ -2652,6 +2930,7 @@ func TestCheckSuite_GetBeforeSHA(tt *testing.T) { } func TestCheckSuite_GetConclusion(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CheckSuite{Conclusion: &zeroValue} c.GetConclusion() @@ -2662,6 +2941,7 @@ func TestCheckSuite_GetConclusion(tt *testing.T) { } func TestCheckSuite_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp c := &CheckSuite{CreatedAt: &zeroValue} c.GetCreatedAt() @@ -2672,6 +2952,7 @@ func TestCheckSuite_GetCreatedAt(tt *testing.T) { } func TestCheckSuite_GetHeadBranch(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CheckSuite{HeadBranch: &zeroValue} c.GetHeadBranch() @@ -2682,6 +2963,7 @@ func TestCheckSuite_GetHeadBranch(tt *testing.T) { } func TestCheckSuite_GetHeadCommit(tt *testing.T) { + tt.Parallel() c := &CheckSuite{} c.GetHeadCommit() c = nil @@ -2689,6 +2971,7 @@ func TestCheckSuite_GetHeadCommit(tt *testing.T) { } func TestCheckSuite_GetHeadSHA(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CheckSuite{HeadSHA: &zeroValue} c.GetHeadSHA() @@ -2699,6 +2982,7 @@ func TestCheckSuite_GetHeadSHA(tt *testing.T) { } func TestCheckSuite_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 c := &CheckSuite{ID: &zeroValue} c.GetID() @@ -2709,6 +2993,7 @@ func TestCheckSuite_GetID(tt *testing.T) { } func TestCheckSuite_GetLatestCheckRunsCount(tt *testing.T) { + tt.Parallel() var zeroValue int64 c := &CheckSuite{LatestCheckRunsCount: &zeroValue} c.GetLatestCheckRunsCount() @@ -2719,6 +3004,7 @@ func TestCheckSuite_GetLatestCheckRunsCount(tt *testing.T) { } func TestCheckSuite_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CheckSuite{NodeID: &zeroValue} c.GetNodeID() @@ -2729,6 +3015,7 @@ func TestCheckSuite_GetNodeID(tt *testing.T) { } func TestCheckSuite_GetRepository(tt *testing.T) { + tt.Parallel() c := &CheckSuite{} c.GetRepository() c = nil @@ -2736,6 +3023,7 @@ func TestCheckSuite_GetRepository(tt *testing.T) { } func TestCheckSuite_GetRerequstable(tt *testing.T) { + tt.Parallel() var zeroValue bool c := &CheckSuite{Rerequstable: &zeroValue} c.GetRerequstable() @@ -2746,6 +3034,7 @@ func TestCheckSuite_GetRerequstable(tt *testing.T) { } func TestCheckSuite_GetRunsRerequstable(tt *testing.T) { + tt.Parallel() var zeroValue bool c := &CheckSuite{RunsRerequstable: &zeroValue} c.GetRunsRerequstable() @@ -2756,6 +3045,7 @@ func TestCheckSuite_GetRunsRerequstable(tt *testing.T) { } func TestCheckSuite_GetStatus(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CheckSuite{Status: &zeroValue} c.GetStatus() @@ -2766,6 +3056,7 @@ func TestCheckSuite_GetStatus(tt *testing.T) { } func TestCheckSuite_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp c := &CheckSuite{UpdatedAt: &zeroValue} c.GetUpdatedAt() @@ -2776,6 +3067,7 @@ func TestCheckSuite_GetUpdatedAt(tt *testing.T) { } func TestCheckSuite_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CheckSuite{URL: &zeroValue} c.GetURL() @@ -2786,6 +3078,7 @@ func TestCheckSuite_GetURL(tt *testing.T) { } func TestCheckSuiteEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CheckSuiteEvent{Action: &zeroValue} c.GetAction() @@ -2796,6 +3089,7 @@ func TestCheckSuiteEvent_GetAction(tt *testing.T) { } func TestCheckSuiteEvent_GetCheckSuite(tt *testing.T) { + tt.Parallel() c := &CheckSuiteEvent{} c.GetCheckSuite() c = nil @@ -2803,6 +3097,7 @@ func TestCheckSuiteEvent_GetCheckSuite(tt *testing.T) { } func TestCheckSuiteEvent_GetInstallation(tt *testing.T) { + tt.Parallel() c := &CheckSuiteEvent{} c.GetInstallation() c = nil @@ -2810,6 +3105,7 @@ func TestCheckSuiteEvent_GetInstallation(tt *testing.T) { } func TestCheckSuiteEvent_GetOrg(tt *testing.T) { + tt.Parallel() c := &CheckSuiteEvent{} c.GetOrg() c = nil @@ -2817,6 +3113,7 @@ func TestCheckSuiteEvent_GetOrg(tt *testing.T) { } func TestCheckSuiteEvent_GetRepo(tt *testing.T) { + tt.Parallel() c := &CheckSuiteEvent{} c.GetRepo() c = nil @@ -2824,6 +3121,7 @@ func TestCheckSuiteEvent_GetRepo(tt *testing.T) { } func TestCheckSuiteEvent_GetSender(tt *testing.T) { + tt.Parallel() c := &CheckSuiteEvent{} c.GetSender() c = nil @@ -2831,6 +3129,7 @@ func TestCheckSuiteEvent_GetSender(tt *testing.T) { } func TestCheckSuitePreferenceResults_GetPreferences(tt *testing.T) { + tt.Parallel() c := &CheckSuitePreferenceResults{} c.GetPreferences() c = nil @@ -2838,6 +3137,7 @@ func TestCheckSuitePreferenceResults_GetPreferences(tt *testing.T) { } func TestCheckSuitePreferenceResults_GetRepository(tt *testing.T) { + tt.Parallel() c := &CheckSuitePreferenceResults{} c.GetRepository() c = nil @@ -2845,6 +3145,7 @@ func TestCheckSuitePreferenceResults_GetRepository(tt *testing.T) { } func TestCodeOfConduct_GetBody(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CodeOfConduct{Body: &zeroValue} c.GetBody() @@ -2855,6 +3156,7 @@ func TestCodeOfConduct_GetBody(tt *testing.T) { } func TestCodeOfConduct_GetKey(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CodeOfConduct{Key: &zeroValue} c.GetKey() @@ -2865,6 +3167,7 @@ func TestCodeOfConduct_GetKey(tt *testing.T) { } func TestCodeOfConduct_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CodeOfConduct{Name: &zeroValue} c.GetName() @@ -2875,6 +3178,7 @@ func TestCodeOfConduct_GetName(tt *testing.T) { } func TestCodeOfConduct_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CodeOfConduct{URL: &zeroValue} c.GetURL() @@ -2885,6 +3189,7 @@ func TestCodeOfConduct_GetURL(tt *testing.T) { } func TestCodeownersError_GetSuggestion(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CodeownersError{Suggestion: &zeroValue} c.GetSuggestion() @@ -2895,6 +3200,7 @@ func TestCodeownersError_GetSuggestion(tt *testing.T) { } func TestCodeQLDatabase_GetContentType(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CodeQLDatabase{ContentType: &zeroValue} c.GetContentType() @@ -2905,6 +3211,7 @@ func TestCodeQLDatabase_GetContentType(tt *testing.T) { } func TestCodeQLDatabase_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp c := &CodeQLDatabase{CreatedAt: &zeroValue} c.GetCreatedAt() @@ -2915,6 +3222,7 @@ func TestCodeQLDatabase_GetCreatedAt(tt *testing.T) { } func TestCodeQLDatabase_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 c := &CodeQLDatabase{ID: &zeroValue} c.GetID() @@ -2925,6 +3233,7 @@ func TestCodeQLDatabase_GetID(tt *testing.T) { } func TestCodeQLDatabase_GetLanguage(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CodeQLDatabase{Language: &zeroValue} c.GetLanguage() @@ -2935,6 +3244,7 @@ func TestCodeQLDatabase_GetLanguage(tt *testing.T) { } func TestCodeQLDatabase_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CodeQLDatabase{Name: &zeroValue} c.GetName() @@ -2945,6 +3255,7 @@ func TestCodeQLDatabase_GetName(tt *testing.T) { } func TestCodeQLDatabase_GetSize(tt *testing.T) { + tt.Parallel() var zeroValue int64 c := &CodeQLDatabase{Size: &zeroValue} c.GetSize() @@ -2955,6 +3266,7 @@ func TestCodeQLDatabase_GetSize(tt *testing.T) { } func TestCodeQLDatabase_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp c := &CodeQLDatabase{UpdatedAt: &zeroValue} c.GetUpdatedAt() @@ -2965,6 +3277,7 @@ func TestCodeQLDatabase_GetUpdatedAt(tt *testing.T) { } func TestCodeQLDatabase_GetUploader(tt *testing.T) { + tt.Parallel() c := &CodeQLDatabase{} c.GetUploader() c = nil @@ -2972,6 +3285,7 @@ func TestCodeQLDatabase_GetUploader(tt *testing.T) { } func TestCodeQLDatabase_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CodeQLDatabase{URL: &zeroValue} c.GetURL() @@ -2982,6 +3296,7 @@ func TestCodeQLDatabase_GetURL(tt *testing.T) { } func TestCodeResult_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CodeResult{HTMLURL: &zeroValue} c.GetHTMLURL() @@ -2992,6 +3307,7 @@ func TestCodeResult_GetHTMLURL(tt *testing.T) { } func TestCodeResult_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CodeResult{Name: &zeroValue} c.GetName() @@ -3002,6 +3318,7 @@ func TestCodeResult_GetName(tt *testing.T) { } func TestCodeResult_GetPath(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CodeResult{Path: &zeroValue} c.GetPath() @@ -3012,6 +3329,7 @@ func TestCodeResult_GetPath(tt *testing.T) { } func TestCodeResult_GetRepository(tt *testing.T) { + tt.Parallel() c := &CodeResult{} c.GetRepository() c = nil @@ -3019,6 +3337,7 @@ func TestCodeResult_GetRepository(tt *testing.T) { } func TestCodeResult_GetSHA(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CodeResult{SHA: &zeroValue} c.GetSHA() @@ -3029,6 +3348,7 @@ func TestCodeResult_GetSHA(tt *testing.T) { } func TestCodeScanningAlertEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CodeScanningAlertEvent{Action: &zeroValue} c.GetAction() @@ -3039,6 +3359,7 @@ func TestCodeScanningAlertEvent_GetAction(tt *testing.T) { } func TestCodeScanningAlertEvent_GetAlert(tt *testing.T) { + tt.Parallel() c := &CodeScanningAlertEvent{} c.GetAlert() c = nil @@ -3046,6 +3367,7 @@ func TestCodeScanningAlertEvent_GetAlert(tt *testing.T) { } func TestCodeScanningAlertEvent_GetCommitOID(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CodeScanningAlertEvent{CommitOID: &zeroValue} c.GetCommitOID() @@ -3056,6 +3378,7 @@ func TestCodeScanningAlertEvent_GetCommitOID(tt *testing.T) { } func TestCodeScanningAlertEvent_GetInstallation(tt *testing.T) { + tt.Parallel() c := &CodeScanningAlertEvent{} c.GetInstallation() c = nil @@ -3063,6 +3386,7 @@ func TestCodeScanningAlertEvent_GetInstallation(tt *testing.T) { } func TestCodeScanningAlertEvent_GetOrg(tt *testing.T) { + tt.Parallel() c := &CodeScanningAlertEvent{} c.GetOrg() c = nil @@ -3070,6 +3394,7 @@ func TestCodeScanningAlertEvent_GetOrg(tt *testing.T) { } func TestCodeScanningAlertEvent_GetRef(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CodeScanningAlertEvent{Ref: &zeroValue} c.GetRef() @@ -3080,6 +3405,7 @@ func TestCodeScanningAlertEvent_GetRef(tt *testing.T) { } func TestCodeScanningAlertEvent_GetRepo(tt *testing.T) { + tt.Parallel() c := &CodeScanningAlertEvent{} c.GetRepo() c = nil @@ -3087,6 +3413,7 @@ func TestCodeScanningAlertEvent_GetRepo(tt *testing.T) { } func TestCodeScanningAlertEvent_GetSender(tt *testing.T) { + tt.Parallel() c := &CodeScanningAlertEvent{} c.GetSender() c = nil @@ -3094,6 +3421,7 @@ func TestCodeScanningAlertEvent_GetSender(tt *testing.T) { } func TestCodeScanningAlertState_GetDismissedComment(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CodeScanningAlertState{DismissedComment: &zeroValue} c.GetDismissedComment() @@ -3104,6 +3432,7 @@ func TestCodeScanningAlertState_GetDismissedComment(tt *testing.T) { } func TestCodeScanningAlertState_GetDismissedReason(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CodeScanningAlertState{DismissedReason: &zeroValue} c.GetDismissedReason() @@ -3114,6 +3443,7 @@ func TestCodeScanningAlertState_GetDismissedReason(tt *testing.T) { } func TestCodeSearchResult_GetIncompleteResults(tt *testing.T) { + tt.Parallel() var zeroValue bool c := &CodeSearchResult{IncompleteResults: &zeroValue} c.GetIncompleteResults() @@ -3124,6 +3454,7 @@ func TestCodeSearchResult_GetIncompleteResults(tt *testing.T) { } func TestCodeSearchResult_GetTotal(tt *testing.T) { + tt.Parallel() var zeroValue int c := &CodeSearchResult{Total: &zeroValue} c.GetTotal() @@ -3134,6 +3465,7 @@ func TestCodeSearchResult_GetTotal(tt *testing.T) { } func TestCodespace_GetBillableOwner(tt *testing.T) { + tt.Parallel() c := &Codespace{} c.GetBillableOwner() c = nil @@ -3141,6 +3473,7 @@ func TestCodespace_GetBillableOwner(tt *testing.T) { } func TestCodespace_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp c := &Codespace{CreatedAt: &zeroValue} c.GetCreatedAt() @@ -3151,6 +3484,7 @@ func TestCodespace_GetCreatedAt(tt *testing.T) { } func TestCodespace_GetDevcontainerPath(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Codespace{DevcontainerPath: &zeroValue} c.GetDevcontainerPath() @@ -3161,6 +3495,7 @@ func TestCodespace_GetDevcontainerPath(tt *testing.T) { } func TestCodespace_GetDisplayName(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Codespace{DisplayName: &zeroValue} c.GetDisplayName() @@ -3171,6 +3506,7 @@ func TestCodespace_GetDisplayName(tt *testing.T) { } func TestCodespace_GetEnvironmentID(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Codespace{EnvironmentID: &zeroValue} c.GetEnvironmentID() @@ -3181,6 +3517,7 @@ func TestCodespace_GetEnvironmentID(tt *testing.T) { } func TestCodespace_GetGitStatus(tt *testing.T) { + tt.Parallel() c := &Codespace{} c.GetGitStatus() c = nil @@ -3188,6 +3525,7 @@ func TestCodespace_GetGitStatus(tt *testing.T) { } func TestCodespace_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 c := &Codespace{ID: &zeroValue} c.GetID() @@ -3198,6 +3536,7 @@ func TestCodespace_GetID(tt *testing.T) { } func TestCodespace_GetIdleTimeoutMinutes(tt *testing.T) { + tt.Parallel() var zeroValue int c := &Codespace{IdleTimeoutMinutes: &zeroValue} c.GetIdleTimeoutMinutes() @@ -3208,6 +3547,7 @@ func TestCodespace_GetIdleTimeoutMinutes(tt *testing.T) { } func TestCodespace_GetIdleTimeoutNotice(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Codespace{IdleTimeoutNotice: &zeroValue} c.GetIdleTimeoutNotice() @@ -3218,6 +3558,7 @@ func TestCodespace_GetIdleTimeoutNotice(tt *testing.T) { } func TestCodespace_GetLastKnownStopNotice(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Codespace{LastKnownStopNotice: &zeroValue} c.GetLastKnownStopNotice() @@ -3228,6 +3569,7 @@ func TestCodespace_GetLastKnownStopNotice(tt *testing.T) { } func TestCodespace_GetLastUsedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp c := &Codespace{LastUsedAt: &zeroValue} c.GetLastUsedAt() @@ -3238,6 +3580,7 @@ func TestCodespace_GetLastUsedAt(tt *testing.T) { } func TestCodespace_GetLocation(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Codespace{Location: &zeroValue} c.GetLocation() @@ -3248,6 +3591,7 @@ func TestCodespace_GetLocation(tt *testing.T) { } func TestCodespace_GetMachine(tt *testing.T) { + tt.Parallel() c := &Codespace{} c.GetMachine() c = nil @@ -3255,6 +3599,7 @@ func TestCodespace_GetMachine(tt *testing.T) { } func TestCodespace_GetMachinesURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Codespace{MachinesURL: &zeroValue} c.GetMachinesURL() @@ -3265,6 +3610,7 @@ func TestCodespace_GetMachinesURL(tt *testing.T) { } func TestCodespace_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Codespace{Name: &zeroValue} c.GetName() @@ -3275,6 +3621,7 @@ func TestCodespace_GetName(tt *testing.T) { } func TestCodespace_GetOwner(tt *testing.T) { + tt.Parallel() c := &Codespace{} c.GetOwner() c = nil @@ -3282,6 +3629,7 @@ func TestCodespace_GetOwner(tt *testing.T) { } func TestCodespace_GetPendingOperation(tt *testing.T) { + tt.Parallel() var zeroValue bool c := &Codespace{PendingOperation: &zeroValue} c.GetPendingOperation() @@ -3292,6 +3640,7 @@ func TestCodespace_GetPendingOperation(tt *testing.T) { } func TestCodespace_GetPendingOperationDisabledReason(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Codespace{PendingOperationDisabledReason: &zeroValue} c.GetPendingOperationDisabledReason() @@ -3302,6 +3651,7 @@ func TestCodespace_GetPendingOperationDisabledReason(tt *testing.T) { } func TestCodespace_GetPrebuild(tt *testing.T) { + tt.Parallel() var zeroValue bool c := &Codespace{Prebuild: &zeroValue} c.GetPrebuild() @@ -3312,6 +3662,7 @@ func TestCodespace_GetPrebuild(tt *testing.T) { } func TestCodespace_GetPullsURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Codespace{PullsURL: &zeroValue} c.GetPullsURL() @@ -3322,6 +3673,7 @@ func TestCodespace_GetPullsURL(tt *testing.T) { } func TestCodespace_GetRepository(tt *testing.T) { + tt.Parallel() c := &Codespace{} c.GetRepository() c = nil @@ -3329,6 +3681,7 @@ func TestCodespace_GetRepository(tt *testing.T) { } func TestCodespace_GetRetentionExpiresAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp c := &Codespace{RetentionExpiresAt: &zeroValue} c.GetRetentionExpiresAt() @@ -3339,6 +3692,7 @@ func TestCodespace_GetRetentionExpiresAt(tt *testing.T) { } func TestCodespace_GetRetentionPeriodMinutes(tt *testing.T) { + tt.Parallel() var zeroValue int c := &Codespace{RetentionPeriodMinutes: &zeroValue} c.GetRetentionPeriodMinutes() @@ -3349,6 +3703,7 @@ func TestCodespace_GetRetentionPeriodMinutes(tt *testing.T) { } func TestCodespace_GetRuntimeConstraints(tt *testing.T) { + tt.Parallel() c := &Codespace{} c.GetRuntimeConstraints() c = nil @@ -3356,6 +3711,7 @@ func TestCodespace_GetRuntimeConstraints(tt *testing.T) { } func TestCodespace_GetStartURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Codespace{StartURL: &zeroValue} c.GetStartURL() @@ -3366,6 +3722,7 @@ func TestCodespace_GetStartURL(tt *testing.T) { } func TestCodespace_GetState(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Codespace{State: &zeroValue} c.GetState() @@ -3376,6 +3733,7 @@ func TestCodespace_GetState(tt *testing.T) { } func TestCodespace_GetStopURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Codespace{StopURL: &zeroValue} c.GetStopURL() @@ -3386,6 +3744,7 @@ func TestCodespace_GetStopURL(tt *testing.T) { } func TestCodespace_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp c := &Codespace{UpdatedAt: &zeroValue} c.GetUpdatedAt() @@ -3396,6 +3755,7 @@ func TestCodespace_GetUpdatedAt(tt *testing.T) { } func TestCodespace_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Codespace{URL: &zeroValue} c.GetURL() @@ -3406,6 +3766,7 @@ func TestCodespace_GetURL(tt *testing.T) { } func TestCodespace_GetWebURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Codespace{WebURL: &zeroValue} c.GetWebURL() @@ -3416,6 +3777,7 @@ func TestCodespace_GetWebURL(tt *testing.T) { } func TestCodespacesGitStatus_GetAhead(tt *testing.T) { + tt.Parallel() var zeroValue int c := &CodespacesGitStatus{Ahead: &zeroValue} c.GetAhead() @@ -3426,6 +3788,7 @@ func TestCodespacesGitStatus_GetAhead(tt *testing.T) { } func TestCodespacesGitStatus_GetBehind(tt *testing.T) { + tt.Parallel() var zeroValue int c := &CodespacesGitStatus{Behind: &zeroValue} c.GetBehind() @@ -3436,6 +3799,7 @@ func TestCodespacesGitStatus_GetBehind(tt *testing.T) { } func TestCodespacesGitStatus_GetHasUncommittedChanges(tt *testing.T) { + tt.Parallel() var zeroValue bool c := &CodespacesGitStatus{HasUncommittedChanges: &zeroValue} c.GetHasUncommittedChanges() @@ -3446,6 +3810,7 @@ func TestCodespacesGitStatus_GetHasUncommittedChanges(tt *testing.T) { } func TestCodespacesGitStatus_GetHasUnpushedChanges(tt *testing.T) { + tt.Parallel() var zeroValue bool c := &CodespacesGitStatus{HasUnpushedChanges: &zeroValue} c.GetHasUnpushedChanges() @@ -3456,6 +3821,7 @@ func TestCodespacesGitStatus_GetHasUnpushedChanges(tt *testing.T) { } func TestCodespacesGitStatus_GetRef(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CodespacesGitStatus{Ref: &zeroValue} c.GetRef() @@ -3466,6 +3832,7 @@ func TestCodespacesGitStatus_GetRef(tt *testing.T) { } func TestCodespacesMachine_GetCPUs(tt *testing.T) { + tt.Parallel() var zeroValue int c := &CodespacesMachine{CPUs: &zeroValue} c.GetCPUs() @@ -3476,6 +3843,7 @@ func TestCodespacesMachine_GetCPUs(tt *testing.T) { } func TestCodespacesMachine_GetDisplayName(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CodespacesMachine{DisplayName: &zeroValue} c.GetDisplayName() @@ -3486,6 +3854,7 @@ func TestCodespacesMachine_GetDisplayName(tt *testing.T) { } func TestCodespacesMachine_GetMemoryInBytes(tt *testing.T) { + tt.Parallel() var zeroValue int64 c := &CodespacesMachine{MemoryInBytes: &zeroValue} c.GetMemoryInBytes() @@ -3496,6 +3865,7 @@ func TestCodespacesMachine_GetMemoryInBytes(tt *testing.T) { } func TestCodespacesMachine_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CodespacesMachine{Name: &zeroValue} c.GetName() @@ -3506,6 +3876,7 @@ func TestCodespacesMachine_GetName(tt *testing.T) { } func TestCodespacesMachine_GetOperatingSystem(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CodespacesMachine{OperatingSystem: &zeroValue} c.GetOperatingSystem() @@ -3516,6 +3887,7 @@ func TestCodespacesMachine_GetOperatingSystem(tt *testing.T) { } func TestCodespacesMachine_GetPrebuildAvailability(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CodespacesMachine{PrebuildAvailability: &zeroValue} c.GetPrebuildAvailability() @@ -3526,6 +3898,7 @@ func TestCodespacesMachine_GetPrebuildAvailability(tt *testing.T) { } func TestCodespacesMachine_GetStorageInBytes(tt *testing.T) { + tt.Parallel() var zeroValue int64 c := &CodespacesMachine{StorageInBytes: &zeroValue} c.GetStorageInBytes() @@ -3536,6 +3909,7 @@ func TestCodespacesMachine_GetStorageInBytes(tt *testing.T) { } func TestCollaboratorInvitation_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp c := &CollaboratorInvitation{CreatedAt: &zeroValue} c.GetCreatedAt() @@ -3546,6 +3920,7 @@ func TestCollaboratorInvitation_GetCreatedAt(tt *testing.T) { } func TestCollaboratorInvitation_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CollaboratorInvitation{HTMLURL: &zeroValue} c.GetHTMLURL() @@ -3556,6 +3931,7 @@ func TestCollaboratorInvitation_GetHTMLURL(tt *testing.T) { } func TestCollaboratorInvitation_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 c := &CollaboratorInvitation{ID: &zeroValue} c.GetID() @@ -3566,6 +3942,7 @@ func TestCollaboratorInvitation_GetID(tt *testing.T) { } func TestCollaboratorInvitation_GetInvitee(tt *testing.T) { + tt.Parallel() c := &CollaboratorInvitation{} c.GetInvitee() c = nil @@ -3573,6 +3950,7 @@ func TestCollaboratorInvitation_GetInvitee(tt *testing.T) { } func TestCollaboratorInvitation_GetInviter(tt *testing.T) { + tt.Parallel() c := &CollaboratorInvitation{} c.GetInviter() c = nil @@ -3580,6 +3958,7 @@ func TestCollaboratorInvitation_GetInviter(tt *testing.T) { } func TestCollaboratorInvitation_GetPermissions(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CollaboratorInvitation{Permissions: &zeroValue} c.GetPermissions() @@ -3590,6 +3969,7 @@ func TestCollaboratorInvitation_GetPermissions(tt *testing.T) { } func TestCollaboratorInvitation_GetRepo(tt *testing.T) { + tt.Parallel() c := &CollaboratorInvitation{} c.GetRepo() c = nil @@ -3597,6 +3977,7 @@ func TestCollaboratorInvitation_GetRepo(tt *testing.T) { } func TestCollaboratorInvitation_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CollaboratorInvitation{URL: &zeroValue} c.GetURL() @@ -3607,6 +3988,7 @@ func TestCollaboratorInvitation_GetURL(tt *testing.T) { } func TestCombinedStatus_GetCommitURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CombinedStatus{CommitURL: &zeroValue} c.GetCommitURL() @@ -3617,6 +3999,7 @@ func TestCombinedStatus_GetCommitURL(tt *testing.T) { } func TestCombinedStatus_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CombinedStatus{Name: &zeroValue} c.GetName() @@ -3627,6 +4010,7 @@ func TestCombinedStatus_GetName(tt *testing.T) { } func TestCombinedStatus_GetRepositoryURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CombinedStatus{RepositoryURL: &zeroValue} c.GetRepositoryURL() @@ -3637,6 +4021,7 @@ func TestCombinedStatus_GetRepositoryURL(tt *testing.T) { } func TestCombinedStatus_GetSHA(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CombinedStatus{SHA: &zeroValue} c.GetSHA() @@ -3647,6 +4032,7 @@ func TestCombinedStatus_GetSHA(tt *testing.T) { } func TestCombinedStatus_GetState(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CombinedStatus{State: &zeroValue} c.GetState() @@ -3657,6 +4043,7 @@ func TestCombinedStatus_GetState(tt *testing.T) { } func TestCombinedStatus_GetTotalCount(tt *testing.T) { + tt.Parallel() var zeroValue int c := &CombinedStatus{TotalCount: &zeroValue} c.GetTotalCount() @@ -3667,6 +4054,7 @@ func TestCombinedStatus_GetTotalCount(tt *testing.T) { } func TestComment_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp c := &Comment{CreatedAt: &zeroValue} c.GetCreatedAt() @@ -3677,6 +4065,7 @@ func TestComment_GetCreatedAt(tt *testing.T) { } func TestCommentDiscussion_GetAuthorAssociation(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CommentDiscussion{AuthorAssociation: &zeroValue} c.GetAuthorAssociation() @@ -3687,6 +4076,7 @@ func TestCommentDiscussion_GetAuthorAssociation(tt *testing.T) { } func TestCommentDiscussion_GetBody(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CommentDiscussion{Body: &zeroValue} c.GetBody() @@ -3697,6 +4087,7 @@ func TestCommentDiscussion_GetBody(tt *testing.T) { } func TestCommentDiscussion_GetChildCommentCount(tt *testing.T) { + tt.Parallel() var zeroValue int c := &CommentDiscussion{ChildCommentCount: &zeroValue} c.GetChildCommentCount() @@ -3707,6 +4098,7 @@ func TestCommentDiscussion_GetChildCommentCount(tt *testing.T) { } func TestCommentDiscussion_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp c := &CommentDiscussion{CreatedAt: &zeroValue} c.GetCreatedAt() @@ -3717,6 +4109,7 @@ func TestCommentDiscussion_GetCreatedAt(tt *testing.T) { } func TestCommentDiscussion_GetDiscussionID(tt *testing.T) { + tt.Parallel() var zeroValue int64 c := &CommentDiscussion{DiscussionID: &zeroValue} c.GetDiscussionID() @@ -3727,6 +4120,7 @@ func TestCommentDiscussion_GetDiscussionID(tt *testing.T) { } func TestCommentDiscussion_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CommentDiscussion{HTMLURL: &zeroValue} c.GetHTMLURL() @@ -3737,6 +4131,7 @@ func TestCommentDiscussion_GetHTMLURL(tt *testing.T) { } func TestCommentDiscussion_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 c := &CommentDiscussion{ID: &zeroValue} c.GetID() @@ -3747,6 +4142,7 @@ func TestCommentDiscussion_GetID(tt *testing.T) { } func TestCommentDiscussion_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CommentDiscussion{NodeID: &zeroValue} c.GetNodeID() @@ -3757,6 +4153,7 @@ func TestCommentDiscussion_GetNodeID(tt *testing.T) { } func TestCommentDiscussion_GetParentID(tt *testing.T) { + tt.Parallel() var zeroValue int64 c := &CommentDiscussion{ParentID: &zeroValue} c.GetParentID() @@ -3767,6 +4164,7 @@ func TestCommentDiscussion_GetParentID(tt *testing.T) { } func TestCommentDiscussion_GetReactions(tt *testing.T) { + tt.Parallel() c := &CommentDiscussion{} c.GetReactions() c = nil @@ -3774,6 +4172,7 @@ func TestCommentDiscussion_GetReactions(tt *testing.T) { } func TestCommentDiscussion_GetRepositoryURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CommentDiscussion{RepositoryURL: &zeroValue} c.GetRepositoryURL() @@ -3784,6 +4183,7 @@ func TestCommentDiscussion_GetRepositoryURL(tt *testing.T) { } func TestCommentDiscussion_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp c := &CommentDiscussion{UpdatedAt: &zeroValue} c.GetUpdatedAt() @@ -3794,6 +4194,7 @@ func TestCommentDiscussion_GetUpdatedAt(tt *testing.T) { } func TestCommentDiscussion_GetUser(tt *testing.T) { + tt.Parallel() c := &CommentDiscussion{} c.GetUser() c = nil @@ -3801,6 +4202,7 @@ func TestCommentDiscussion_GetUser(tt *testing.T) { } func TestCommentStats_GetTotalCommitComments(tt *testing.T) { + tt.Parallel() var zeroValue int c := &CommentStats{TotalCommitComments: &zeroValue} c.GetTotalCommitComments() @@ -3811,6 +4213,7 @@ func TestCommentStats_GetTotalCommitComments(tt *testing.T) { } func TestCommentStats_GetTotalGistComments(tt *testing.T) { + tt.Parallel() var zeroValue int c := &CommentStats{TotalGistComments: &zeroValue} c.GetTotalGistComments() @@ -3821,6 +4224,7 @@ func TestCommentStats_GetTotalGistComments(tt *testing.T) { } func TestCommentStats_GetTotalIssueComments(tt *testing.T) { + tt.Parallel() var zeroValue int c := &CommentStats{TotalIssueComments: &zeroValue} c.GetTotalIssueComments() @@ -3831,6 +4235,7 @@ func TestCommentStats_GetTotalIssueComments(tt *testing.T) { } func TestCommentStats_GetTotalPullRequestComments(tt *testing.T) { + tt.Parallel() var zeroValue int c := &CommentStats{TotalPullRequestComments: &zeroValue} c.GetTotalPullRequestComments() @@ -3841,6 +4246,7 @@ func TestCommentStats_GetTotalPullRequestComments(tt *testing.T) { } func TestCommit_GetAuthor(tt *testing.T) { + tt.Parallel() c := &Commit{} c.GetAuthor() c = nil @@ -3848,6 +4254,7 @@ func TestCommit_GetAuthor(tt *testing.T) { } func TestCommit_GetCommentCount(tt *testing.T) { + tt.Parallel() var zeroValue int c := &Commit{CommentCount: &zeroValue} c.GetCommentCount() @@ -3858,6 +4265,7 @@ func TestCommit_GetCommentCount(tt *testing.T) { } func TestCommit_GetCommitter(tt *testing.T) { + tt.Parallel() c := &Commit{} c.GetCommitter() c = nil @@ -3865,6 +4273,7 @@ func TestCommit_GetCommitter(tt *testing.T) { } func TestCommit_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Commit{HTMLURL: &zeroValue} c.GetHTMLURL() @@ -3875,6 +4284,7 @@ func TestCommit_GetHTMLURL(tt *testing.T) { } func TestCommit_GetMessage(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Commit{Message: &zeroValue} c.GetMessage() @@ -3885,6 +4295,7 @@ func TestCommit_GetMessage(tt *testing.T) { } func TestCommit_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Commit{NodeID: &zeroValue} c.GetNodeID() @@ -3895,6 +4306,7 @@ func TestCommit_GetNodeID(tt *testing.T) { } func TestCommit_GetSHA(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Commit{SHA: &zeroValue} c.GetSHA() @@ -3905,6 +4317,7 @@ func TestCommit_GetSHA(tt *testing.T) { } func TestCommit_GetStats(tt *testing.T) { + tt.Parallel() c := &Commit{} c.GetStats() c = nil @@ -3912,6 +4325,7 @@ func TestCommit_GetStats(tt *testing.T) { } func TestCommit_GetTree(tt *testing.T) { + tt.Parallel() c := &Commit{} c.GetTree() c = nil @@ -3919,6 +4333,7 @@ func TestCommit_GetTree(tt *testing.T) { } func TestCommit_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Commit{URL: &zeroValue} c.GetURL() @@ -3929,6 +4344,7 @@ func TestCommit_GetURL(tt *testing.T) { } func TestCommit_GetVerification(tt *testing.T) { + tt.Parallel() c := &Commit{} c.GetVerification() c = nil @@ -3936,6 +4352,7 @@ func TestCommit_GetVerification(tt *testing.T) { } func TestCommitAuthor_GetDate(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp c := &CommitAuthor{Date: &zeroValue} c.GetDate() @@ -3946,6 +4363,7 @@ func TestCommitAuthor_GetDate(tt *testing.T) { } func TestCommitAuthor_GetEmail(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CommitAuthor{Email: &zeroValue} c.GetEmail() @@ -3956,6 +4374,7 @@ func TestCommitAuthor_GetEmail(tt *testing.T) { } func TestCommitAuthor_GetLogin(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CommitAuthor{Login: &zeroValue} c.GetLogin() @@ -3966,6 +4385,7 @@ func TestCommitAuthor_GetLogin(tt *testing.T) { } func TestCommitAuthor_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CommitAuthor{Name: &zeroValue} c.GetName() @@ -3976,6 +4396,7 @@ func TestCommitAuthor_GetName(tt *testing.T) { } func TestCommitCommentEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CommitCommentEvent{Action: &zeroValue} c.GetAction() @@ -3986,6 +4407,7 @@ func TestCommitCommentEvent_GetAction(tt *testing.T) { } func TestCommitCommentEvent_GetComment(tt *testing.T) { + tt.Parallel() c := &CommitCommentEvent{} c.GetComment() c = nil @@ -3993,6 +4415,7 @@ func TestCommitCommentEvent_GetComment(tt *testing.T) { } func TestCommitCommentEvent_GetInstallation(tt *testing.T) { + tt.Parallel() c := &CommitCommentEvent{} c.GetInstallation() c = nil @@ -4000,6 +4423,7 @@ func TestCommitCommentEvent_GetInstallation(tt *testing.T) { } func TestCommitCommentEvent_GetOrg(tt *testing.T) { + tt.Parallel() c := &CommitCommentEvent{} c.GetOrg() c = nil @@ -4007,6 +4431,7 @@ func TestCommitCommentEvent_GetOrg(tt *testing.T) { } func TestCommitCommentEvent_GetRepo(tt *testing.T) { + tt.Parallel() c := &CommitCommentEvent{} c.GetRepo() c = nil @@ -4014,6 +4439,7 @@ func TestCommitCommentEvent_GetRepo(tt *testing.T) { } func TestCommitCommentEvent_GetSender(tt *testing.T) { + tt.Parallel() c := &CommitCommentEvent{} c.GetSender() c = nil @@ -4021,6 +4447,7 @@ func TestCommitCommentEvent_GetSender(tt *testing.T) { } func TestCommitFile_GetAdditions(tt *testing.T) { + tt.Parallel() var zeroValue int c := &CommitFile{Additions: &zeroValue} c.GetAdditions() @@ -4031,6 +4458,7 @@ func TestCommitFile_GetAdditions(tt *testing.T) { } func TestCommitFile_GetBlobURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CommitFile{BlobURL: &zeroValue} c.GetBlobURL() @@ -4041,6 +4469,7 @@ func TestCommitFile_GetBlobURL(tt *testing.T) { } func TestCommitFile_GetChanges(tt *testing.T) { + tt.Parallel() var zeroValue int c := &CommitFile{Changes: &zeroValue} c.GetChanges() @@ -4051,6 +4480,7 @@ func TestCommitFile_GetChanges(tt *testing.T) { } func TestCommitFile_GetContentsURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CommitFile{ContentsURL: &zeroValue} c.GetContentsURL() @@ -4061,6 +4491,7 @@ func TestCommitFile_GetContentsURL(tt *testing.T) { } func TestCommitFile_GetDeletions(tt *testing.T) { + tt.Parallel() var zeroValue int c := &CommitFile{Deletions: &zeroValue} c.GetDeletions() @@ -4071,6 +4502,7 @@ func TestCommitFile_GetDeletions(tt *testing.T) { } func TestCommitFile_GetFilename(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CommitFile{Filename: &zeroValue} c.GetFilename() @@ -4081,6 +4513,7 @@ func TestCommitFile_GetFilename(tt *testing.T) { } func TestCommitFile_GetPatch(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CommitFile{Patch: &zeroValue} c.GetPatch() @@ -4091,6 +4524,7 @@ func TestCommitFile_GetPatch(tt *testing.T) { } func TestCommitFile_GetPreviousFilename(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CommitFile{PreviousFilename: &zeroValue} c.GetPreviousFilename() @@ -4101,6 +4535,7 @@ func TestCommitFile_GetPreviousFilename(tt *testing.T) { } func TestCommitFile_GetRawURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CommitFile{RawURL: &zeroValue} c.GetRawURL() @@ -4111,6 +4546,7 @@ func TestCommitFile_GetRawURL(tt *testing.T) { } func TestCommitFile_GetSHA(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CommitFile{SHA: &zeroValue} c.GetSHA() @@ -4121,6 +4557,7 @@ func TestCommitFile_GetSHA(tt *testing.T) { } func TestCommitFile_GetStatus(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CommitFile{Status: &zeroValue} c.GetStatus() @@ -4131,6 +4568,7 @@ func TestCommitFile_GetStatus(tt *testing.T) { } func TestCommitResult_GetAuthor(tt *testing.T) { + tt.Parallel() c := &CommitResult{} c.GetAuthor() c = nil @@ -4138,6 +4576,7 @@ func TestCommitResult_GetAuthor(tt *testing.T) { } func TestCommitResult_GetCommentsURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CommitResult{CommentsURL: &zeroValue} c.GetCommentsURL() @@ -4148,6 +4587,7 @@ func TestCommitResult_GetCommentsURL(tt *testing.T) { } func TestCommitResult_GetCommit(tt *testing.T) { + tt.Parallel() c := &CommitResult{} c.GetCommit() c = nil @@ -4155,6 +4595,7 @@ func TestCommitResult_GetCommit(tt *testing.T) { } func TestCommitResult_GetCommitter(tt *testing.T) { + tt.Parallel() c := &CommitResult{} c.GetCommitter() c = nil @@ -4162,6 +4603,7 @@ func TestCommitResult_GetCommitter(tt *testing.T) { } func TestCommitResult_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CommitResult{HTMLURL: &zeroValue} c.GetHTMLURL() @@ -4172,6 +4614,7 @@ func TestCommitResult_GetHTMLURL(tt *testing.T) { } func TestCommitResult_GetRepository(tt *testing.T) { + tt.Parallel() c := &CommitResult{} c.GetRepository() c = nil @@ -4179,6 +4622,7 @@ func TestCommitResult_GetRepository(tt *testing.T) { } func TestCommitResult_GetScore(tt *testing.T) { + tt.Parallel() c := &CommitResult{} c.GetScore() c = nil @@ -4186,6 +4630,7 @@ func TestCommitResult_GetScore(tt *testing.T) { } func TestCommitResult_GetSHA(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CommitResult{SHA: &zeroValue} c.GetSHA() @@ -4196,6 +4641,7 @@ func TestCommitResult_GetSHA(tt *testing.T) { } func TestCommitResult_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CommitResult{URL: &zeroValue} c.GetURL() @@ -4206,6 +4652,7 @@ func TestCommitResult_GetURL(tt *testing.T) { } func TestCommitsComparison_GetAheadBy(tt *testing.T) { + tt.Parallel() var zeroValue int c := &CommitsComparison{AheadBy: &zeroValue} c.GetAheadBy() @@ -4216,6 +4663,7 @@ func TestCommitsComparison_GetAheadBy(tt *testing.T) { } func TestCommitsComparison_GetBaseCommit(tt *testing.T) { + tt.Parallel() c := &CommitsComparison{} c.GetBaseCommit() c = nil @@ -4223,6 +4671,7 @@ func TestCommitsComparison_GetBaseCommit(tt *testing.T) { } func TestCommitsComparison_GetBehindBy(tt *testing.T) { + tt.Parallel() var zeroValue int c := &CommitsComparison{BehindBy: &zeroValue} c.GetBehindBy() @@ -4233,6 +4682,7 @@ func TestCommitsComparison_GetBehindBy(tt *testing.T) { } func TestCommitsComparison_GetDiffURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CommitsComparison{DiffURL: &zeroValue} c.GetDiffURL() @@ -4243,6 +4693,7 @@ func TestCommitsComparison_GetDiffURL(tt *testing.T) { } func TestCommitsComparison_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CommitsComparison{HTMLURL: &zeroValue} c.GetHTMLURL() @@ -4253,6 +4704,7 @@ func TestCommitsComparison_GetHTMLURL(tt *testing.T) { } func TestCommitsComparison_GetMergeBaseCommit(tt *testing.T) { + tt.Parallel() c := &CommitsComparison{} c.GetMergeBaseCommit() c = nil @@ -4260,6 +4712,7 @@ func TestCommitsComparison_GetMergeBaseCommit(tt *testing.T) { } func TestCommitsComparison_GetPatchURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CommitsComparison{PatchURL: &zeroValue} c.GetPatchURL() @@ -4270,6 +4723,7 @@ func TestCommitsComparison_GetPatchURL(tt *testing.T) { } func TestCommitsComparison_GetPermalinkURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CommitsComparison{PermalinkURL: &zeroValue} c.GetPermalinkURL() @@ -4280,6 +4734,7 @@ func TestCommitsComparison_GetPermalinkURL(tt *testing.T) { } func TestCommitsComparison_GetStatus(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CommitsComparison{Status: &zeroValue} c.GetStatus() @@ -4290,6 +4745,7 @@ func TestCommitsComparison_GetStatus(tt *testing.T) { } func TestCommitsComparison_GetTotalCommits(tt *testing.T) { + tt.Parallel() var zeroValue int c := &CommitsComparison{TotalCommits: &zeroValue} c.GetTotalCommits() @@ -4300,6 +4756,7 @@ func TestCommitsComparison_GetTotalCommits(tt *testing.T) { } func TestCommitsComparison_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CommitsComparison{URL: &zeroValue} c.GetURL() @@ -4310,6 +4767,7 @@ func TestCommitsComparison_GetURL(tt *testing.T) { } func TestCommitsSearchResult_GetIncompleteResults(tt *testing.T) { + tt.Parallel() var zeroValue bool c := &CommitsSearchResult{IncompleteResults: &zeroValue} c.GetIncompleteResults() @@ -4320,6 +4778,7 @@ func TestCommitsSearchResult_GetIncompleteResults(tt *testing.T) { } func TestCommitsSearchResult_GetTotal(tt *testing.T) { + tt.Parallel() var zeroValue int c := &CommitsSearchResult{Total: &zeroValue} c.GetTotal() @@ -4330,6 +4789,7 @@ func TestCommitsSearchResult_GetTotal(tt *testing.T) { } func TestCommitStats_GetAdditions(tt *testing.T) { + tt.Parallel() var zeroValue int c := &CommitStats{Additions: &zeroValue} c.GetAdditions() @@ -4340,6 +4800,7 @@ func TestCommitStats_GetAdditions(tt *testing.T) { } func TestCommitStats_GetDeletions(tt *testing.T) { + tt.Parallel() var zeroValue int c := &CommitStats{Deletions: &zeroValue} c.GetDeletions() @@ -4350,6 +4811,7 @@ func TestCommitStats_GetDeletions(tt *testing.T) { } func TestCommitStats_GetTotal(tt *testing.T) { + tt.Parallel() var zeroValue int c := &CommitStats{Total: &zeroValue} c.GetTotal() @@ -4360,6 +4822,7 @@ func TestCommitStats_GetTotal(tt *testing.T) { } func TestCommunityHealthFiles_GetCodeOfConduct(tt *testing.T) { + tt.Parallel() c := &CommunityHealthFiles{} c.GetCodeOfConduct() c = nil @@ -4367,6 +4830,7 @@ func TestCommunityHealthFiles_GetCodeOfConduct(tt *testing.T) { } func TestCommunityHealthFiles_GetCodeOfConductFile(tt *testing.T) { + tt.Parallel() c := &CommunityHealthFiles{} c.GetCodeOfConductFile() c = nil @@ -4374,6 +4838,7 @@ func TestCommunityHealthFiles_GetCodeOfConductFile(tt *testing.T) { } func TestCommunityHealthFiles_GetContributing(tt *testing.T) { + tt.Parallel() c := &CommunityHealthFiles{} c.GetContributing() c = nil @@ -4381,6 +4846,7 @@ func TestCommunityHealthFiles_GetContributing(tt *testing.T) { } func TestCommunityHealthFiles_GetIssueTemplate(tt *testing.T) { + tt.Parallel() c := &CommunityHealthFiles{} c.GetIssueTemplate() c = nil @@ -4388,6 +4854,7 @@ func TestCommunityHealthFiles_GetIssueTemplate(tt *testing.T) { } func TestCommunityHealthFiles_GetLicense(tt *testing.T) { + tt.Parallel() c := &CommunityHealthFiles{} c.GetLicense() c = nil @@ -4395,6 +4862,7 @@ func TestCommunityHealthFiles_GetLicense(tt *testing.T) { } func TestCommunityHealthFiles_GetPullRequestTemplate(tt *testing.T) { + tt.Parallel() c := &CommunityHealthFiles{} c.GetPullRequestTemplate() c = nil @@ -4402,6 +4870,7 @@ func TestCommunityHealthFiles_GetPullRequestTemplate(tt *testing.T) { } func TestCommunityHealthFiles_GetReadme(tt *testing.T) { + tt.Parallel() c := &CommunityHealthFiles{} c.GetReadme() c = nil @@ -4409,6 +4878,7 @@ func TestCommunityHealthFiles_GetReadme(tt *testing.T) { } func TestCommunityHealthMetrics_GetContentReportsEnabled(tt *testing.T) { + tt.Parallel() var zeroValue bool c := &CommunityHealthMetrics{ContentReportsEnabled: &zeroValue} c.GetContentReportsEnabled() @@ -4419,6 +4889,7 @@ func TestCommunityHealthMetrics_GetContentReportsEnabled(tt *testing.T) { } func TestCommunityHealthMetrics_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CommunityHealthMetrics{Description: &zeroValue} c.GetDescription() @@ -4429,6 +4900,7 @@ func TestCommunityHealthMetrics_GetDescription(tt *testing.T) { } func TestCommunityHealthMetrics_GetDocumentation(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CommunityHealthMetrics{Documentation: &zeroValue} c.GetDocumentation() @@ -4439,6 +4911,7 @@ func TestCommunityHealthMetrics_GetDocumentation(tt *testing.T) { } func TestCommunityHealthMetrics_GetFiles(tt *testing.T) { + tt.Parallel() c := &CommunityHealthMetrics{} c.GetFiles() c = nil @@ -4446,6 +4919,7 @@ func TestCommunityHealthMetrics_GetFiles(tt *testing.T) { } func TestCommunityHealthMetrics_GetHealthPercentage(tt *testing.T) { + tt.Parallel() var zeroValue int c := &CommunityHealthMetrics{HealthPercentage: &zeroValue} c.GetHealthPercentage() @@ -4456,6 +4930,7 @@ func TestCommunityHealthMetrics_GetHealthPercentage(tt *testing.T) { } func TestCommunityHealthMetrics_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp c := &CommunityHealthMetrics{UpdatedAt: &zeroValue} c.GetUpdatedAt() @@ -4466,6 +4941,7 @@ func TestCommunityHealthMetrics_GetUpdatedAt(tt *testing.T) { } func TestContentReference_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 c := &ContentReference{ID: &zeroValue} c.GetID() @@ -4476,6 +4952,7 @@ func TestContentReference_GetID(tt *testing.T) { } func TestContentReference_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string c := &ContentReference{NodeID: &zeroValue} c.GetNodeID() @@ -4486,6 +4963,7 @@ func TestContentReference_GetNodeID(tt *testing.T) { } func TestContentReference_GetReference(tt *testing.T) { + tt.Parallel() var zeroValue string c := &ContentReference{Reference: &zeroValue} c.GetReference() @@ -4496,6 +4974,7 @@ func TestContentReference_GetReference(tt *testing.T) { } func TestContentReferenceEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string c := &ContentReferenceEvent{Action: &zeroValue} c.GetAction() @@ -4506,6 +4985,7 @@ func TestContentReferenceEvent_GetAction(tt *testing.T) { } func TestContentReferenceEvent_GetContentReference(tt *testing.T) { + tt.Parallel() c := &ContentReferenceEvent{} c.GetContentReference() c = nil @@ -4513,6 +4993,7 @@ func TestContentReferenceEvent_GetContentReference(tt *testing.T) { } func TestContentReferenceEvent_GetInstallation(tt *testing.T) { + tt.Parallel() c := &ContentReferenceEvent{} c.GetInstallation() c = nil @@ -4520,6 +5001,7 @@ func TestContentReferenceEvent_GetInstallation(tt *testing.T) { } func TestContentReferenceEvent_GetRepo(tt *testing.T) { + tt.Parallel() c := &ContentReferenceEvent{} c.GetRepo() c = nil @@ -4527,6 +5009,7 @@ func TestContentReferenceEvent_GetRepo(tt *testing.T) { } func TestContentReferenceEvent_GetSender(tt *testing.T) { + tt.Parallel() c := &ContentReferenceEvent{} c.GetSender() c = nil @@ -4534,6 +5017,7 @@ func TestContentReferenceEvent_GetSender(tt *testing.T) { } func TestContributor_GetAvatarURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Contributor{AvatarURL: &zeroValue} c.GetAvatarURL() @@ -4544,6 +5028,7 @@ func TestContributor_GetAvatarURL(tt *testing.T) { } func TestContributor_GetContributions(tt *testing.T) { + tt.Parallel() var zeroValue int c := &Contributor{Contributions: &zeroValue} c.GetContributions() @@ -4554,6 +5039,7 @@ func TestContributor_GetContributions(tt *testing.T) { } func TestContributor_GetEmail(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Contributor{Email: &zeroValue} c.GetEmail() @@ -4564,6 +5050,7 @@ func TestContributor_GetEmail(tt *testing.T) { } func TestContributor_GetEventsURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Contributor{EventsURL: &zeroValue} c.GetEventsURL() @@ -4574,6 +5061,7 @@ func TestContributor_GetEventsURL(tt *testing.T) { } func TestContributor_GetFollowersURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Contributor{FollowersURL: &zeroValue} c.GetFollowersURL() @@ -4584,6 +5072,7 @@ func TestContributor_GetFollowersURL(tt *testing.T) { } func TestContributor_GetFollowingURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Contributor{FollowingURL: &zeroValue} c.GetFollowingURL() @@ -4594,6 +5083,7 @@ func TestContributor_GetFollowingURL(tt *testing.T) { } func TestContributor_GetGistsURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Contributor{GistsURL: &zeroValue} c.GetGistsURL() @@ -4604,6 +5094,7 @@ func TestContributor_GetGistsURL(tt *testing.T) { } func TestContributor_GetGravatarID(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Contributor{GravatarID: &zeroValue} c.GetGravatarID() @@ -4614,6 +5105,7 @@ func TestContributor_GetGravatarID(tt *testing.T) { } func TestContributor_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Contributor{HTMLURL: &zeroValue} c.GetHTMLURL() @@ -4624,6 +5116,7 @@ func TestContributor_GetHTMLURL(tt *testing.T) { } func TestContributor_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 c := &Contributor{ID: &zeroValue} c.GetID() @@ -4634,6 +5127,7 @@ func TestContributor_GetID(tt *testing.T) { } func TestContributor_GetLogin(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Contributor{Login: &zeroValue} c.GetLogin() @@ -4644,6 +5138,7 @@ func TestContributor_GetLogin(tt *testing.T) { } func TestContributor_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Contributor{Name: &zeroValue} c.GetName() @@ -4654,6 +5149,7 @@ func TestContributor_GetName(tt *testing.T) { } func TestContributor_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Contributor{NodeID: &zeroValue} c.GetNodeID() @@ -4664,6 +5160,7 @@ func TestContributor_GetNodeID(tt *testing.T) { } func TestContributor_GetOrganizationsURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Contributor{OrganizationsURL: &zeroValue} c.GetOrganizationsURL() @@ -4674,6 +5171,7 @@ func TestContributor_GetOrganizationsURL(tt *testing.T) { } func TestContributor_GetReceivedEventsURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Contributor{ReceivedEventsURL: &zeroValue} c.GetReceivedEventsURL() @@ -4684,6 +5182,7 @@ func TestContributor_GetReceivedEventsURL(tt *testing.T) { } func TestContributor_GetReposURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Contributor{ReposURL: &zeroValue} c.GetReposURL() @@ -4694,6 +5193,7 @@ func TestContributor_GetReposURL(tt *testing.T) { } func TestContributor_GetSiteAdmin(tt *testing.T) { + tt.Parallel() var zeroValue bool c := &Contributor{SiteAdmin: &zeroValue} c.GetSiteAdmin() @@ -4704,6 +5204,7 @@ func TestContributor_GetSiteAdmin(tt *testing.T) { } func TestContributor_GetStarredURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Contributor{StarredURL: &zeroValue} c.GetStarredURL() @@ -4714,6 +5215,7 @@ func TestContributor_GetStarredURL(tt *testing.T) { } func TestContributor_GetSubscriptionsURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Contributor{SubscriptionsURL: &zeroValue} c.GetSubscriptionsURL() @@ -4724,6 +5226,7 @@ func TestContributor_GetSubscriptionsURL(tt *testing.T) { } func TestContributor_GetType(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Contributor{Type: &zeroValue} c.GetType() @@ -4734,6 +5237,7 @@ func TestContributor_GetType(tt *testing.T) { } func TestContributor_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Contributor{URL: &zeroValue} c.GetURL() @@ -4744,6 +5248,7 @@ func TestContributor_GetURL(tt *testing.T) { } func TestContributorStats_GetAuthor(tt *testing.T) { + tt.Parallel() c := &ContributorStats{} c.GetAuthor() c = nil @@ -4751,6 +5256,7 @@ func TestContributorStats_GetAuthor(tt *testing.T) { } func TestContributorStats_GetTotal(tt *testing.T) { + tt.Parallel() var zeroValue int c := &ContributorStats{Total: &zeroValue} c.GetTotal() @@ -4761,6 +5267,7 @@ func TestContributorStats_GetTotal(tt *testing.T) { } func TestCopilotOrganizationDetails_GetSeatBreakdown(tt *testing.T) { + tt.Parallel() c := &CopilotOrganizationDetails{} c.GetSeatBreakdown() c = nil @@ -4768,6 +5275,7 @@ func TestCopilotOrganizationDetails_GetSeatBreakdown(tt *testing.T) { } func TestCopilotSeatDetails_GetAssigningTeam(tt *testing.T) { + tt.Parallel() c := &CopilotSeatDetails{} c.GetAssigningTeam() c = nil @@ -4775,6 +5283,7 @@ func TestCopilotSeatDetails_GetAssigningTeam(tt *testing.T) { } func TestCopilotSeatDetails_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp c := &CopilotSeatDetails{CreatedAt: &zeroValue} c.GetCreatedAt() @@ -4785,6 +5294,7 @@ func TestCopilotSeatDetails_GetCreatedAt(tt *testing.T) { } func TestCopilotSeatDetails_GetLastActivityAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp c := &CopilotSeatDetails{LastActivityAt: &zeroValue} c.GetLastActivityAt() @@ -4795,6 +5305,7 @@ func TestCopilotSeatDetails_GetLastActivityAt(tt *testing.T) { } func TestCopilotSeatDetails_GetLastActivityEditor(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CopilotSeatDetails{LastActivityEditor: &zeroValue} c.GetLastActivityEditor() @@ -4805,6 +5316,7 @@ func TestCopilotSeatDetails_GetLastActivityEditor(tt *testing.T) { } func TestCopilotSeatDetails_GetPendingCancellationDate(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CopilotSeatDetails{PendingCancellationDate: &zeroValue} c.GetPendingCancellationDate() @@ -4815,6 +5327,7 @@ func TestCopilotSeatDetails_GetPendingCancellationDate(tt *testing.T) { } func TestCopilotSeatDetails_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp c := &CopilotSeatDetails{UpdatedAt: &zeroValue} c.GetUpdatedAt() @@ -4825,6 +5338,7 @@ func TestCopilotSeatDetails_GetUpdatedAt(tt *testing.T) { } func TestCreateCheckRunOptions_GetCompletedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp c := &CreateCheckRunOptions{CompletedAt: &zeroValue} c.GetCompletedAt() @@ -4835,6 +5349,7 @@ func TestCreateCheckRunOptions_GetCompletedAt(tt *testing.T) { } func TestCreateCheckRunOptions_GetConclusion(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CreateCheckRunOptions{Conclusion: &zeroValue} c.GetConclusion() @@ -4845,6 +5360,7 @@ func TestCreateCheckRunOptions_GetConclusion(tt *testing.T) { } func TestCreateCheckRunOptions_GetDetailsURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CreateCheckRunOptions{DetailsURL: &zeroValue} c.GetDetailsURL() @@ -4855,6 +5371,7 @@ func TestCreateCheckRunOptions_GetDetailsURL(tt *testing.T) { } func TestCreateCheckRunOptions_GetExternalID(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CreateCheckRunOptions{ExternalID: &zeroValue} c.GetExternalID() @@ -4865,6 +5382,7 @@ func TestCreateCheckRunOptions_GetExternalID(tt *testing.T) { } func TestCreateCheckRunOptions_GetOutput(tt *testing.T) { + tt.Parallel() c := &CreateCheckRunOptions{} c.GetOutput() c = nil @@ -4872,6 +5390,7 @@ func TestCreateCheckRunOptions_GetOutput(tt *testing.T) { } func TestCreateCheckRunOptions_GetStartedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp c := &CreateCheckRunOptions{StartedAt: &zeroValue} c.GetStartedAt() @@ -4882,6 +5401,7 @@ func TestCreateCheckRunOptions_GetStartedAt(tt *testing.T) { } func TestCreateCheckRunOptions_GetStatus(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CreateCheckRunOptions{Status: &zeroValue} c.GetStatus() @@ -4892,6 +5412,7 @@ func TestCreateCheckRunOptions_GetStatus(tt *testing.T) { } func TestCreateCheckSuiteOptions_GetHeadBranch(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CreateCheckSuiteOptions{HeadBranch: &zeroValue} c.GetHeadBranch() @@ -4902,6 +5423,7 @@ func TestCreateCheckSuiteOptions_GetHeadBranch(tt *testing.T) { } func TestCreateCodespaceOptions_GetClientIP(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CreateCodespaceOptions{ClientIP: &zeroValue} c.GetClientIP() @@ -4912,6 +5434,7 @@ func TestCreateCodespaceOptions_GetClientIP(tt *testing.T) { } func TestCreateCodespaceOptions_GetDevcontainerPath(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CreateCodespaceOptions{DevcontainerPath: &zeroValue} c.GetDevcontainerPath() @@ -4922,6 +5445,7 @@ func TestCreateCodespaceOptions_GetDevcontainerPath(tt *testing.T) { } func TestCreateCodespaceOptions_GetDisplayName(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CreateCodespaceOptions{DisplayName: &zeroValue} c.GetDisplayName() @@ -4932,6 +5456,7 @@ func TestCreateCodespaceOptions_GetDisplayName(tt *testing.T) { } func TestCreateCodespaceOptions_GetGeo(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CreateCodespaceOptions{Geo: &zeroValue} c.GetGeo() @@ -4942,6 +5467,7 @@ func TestCreateCodespaceOptions_GetGeo(tt *testing.T) { } func TestCreateCodespaceOptions_GetIdleTimeoutMinutes(tt *testing.T) { + tt.Parallel() var zeroValue int c := &CreateCodespaceOptions{IdleTimeoutMinutes: &zeroValue} c.GetIdleTimeoutMinutes() @@ -4952,6 +5478,7 @@ func TestCreateCodespaceOptions_GetIdleTimeoutMinutes(tt *testing.T) { } func TestCreateCodespaceOptions_GetMachine(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CreateCodespaceOptions{Machine: &zeroValue} c.GetMachine() @@ -4962,6 +5489,7 @@ func TestCreateCodespaceOptions_GetMachine(tt *testing.T) { } func TestCreateCodespaceOptions_GetMultiRepoPermissionsOptOut(tt *testing.T) { + tt.Parallel() var zeroValue bool c := &CreateCodespaceOptions{MultiRepoPermissionsOptOut: &zeroValue} c.GetMultiRepoPermissionsOptOut() @@ -4972,6 +5500,7 @@ func TestCreateCodespaceOptions_GetMultiRepoPermissionsOptOut(tt *testing.T) { } func TestCreateCodespaceOptions_GetRef(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CreateCodespaceOptions{Ref: &zeroValue} c.GetRef() @@ -4982,6 +5511,7 @@ func TestCreateCodespaceOptions_GetRef(tt *testing.T) { } func TestCreateCodespaceOptions_GetRetentionPeriodMinutes(tt *testing.T) { + tt.Parallel() var zeroValue int c := &CreateCodespaceOptions{RetentionPeriodMinutes: &zeroValue} c.GetRetentionPeriodMinutes() @@ -4992,6 +5522,7 @@ func TestCreateCodespaceOptions_GetRetentionPeriodMinutes(tt *testing.T) { } func TestCreateCodespaceOptions_GetWorkingDirectory(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CreateCodespaceOptions{WorkingDirectory: &zeroValue} c.GetWorkingDirectory() @@ -5002,6 +5533,7 @@ func TestCreateCodespaceOptions_GetWorkingDirectory(tt *testing.T) { } func TestCreateEnterpriseRunnerGroupRequest_GetAllowsPublicRepositories(tt *testing.T) { + tt.Parallel() var zeroValue bool c := &CreateEnterpriseRunnerGroupRequest{AllowsPublicRepositories: &zeroValue} c.GetAllowsPublicRepositories() @@ -5012,6 +5544,7 @@ func TestCreateEnterpriseRunnerGroupRequest_GetAllowsPublicRepositories(tt *test } func TestCreateEnterpriseRunnerGroupRequest_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CreateEnterpriseRunnerGroupRequest{Name: &zeroValue} c.GetName() @@ -5022,6 +5555,7 @@ func TestCreateEnterpriseRunnerGroupRequest_GetName(tt *testing.T) { } func TestCreateEnterpriseRunnerGroupRequest_GetRestrictedToWorkflows(tt *testing.T) { + tt.Parallel() var zeroValue bool c := &CreateEnterpriseRunnerGroupRequest{RestrictedToWorkflows: &zeroValue} c.GetRestrictedToWorkflows() @@ -5032,6 +5566,7 @@ func TestCreateEnterpriseRunnerGroupRequest_GetRestrictedToWorkflows(tt *testing } func TestCreateEnterpriseRunnerGroupRequest_GetVisibility(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CreateEnterpriseRunnerGroupRequest{Visibility: &zeroValue} c.GetVisibility() @@ -5042,6 +5577,7 @@ func TestCreateEnterpriseRunnerGroupRequest_GetVisibility(tt *testing.T) { } func TestCreateEvent_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CreateEvent{Description: &zeroValue} c.GetDescription() @@ -5052,6 +5588,7 @@ func TestCreateEvent_GetDescription(tt *testing.T) { } func TestCreateEvent_GetInstallation(tt *testing.T) { + tt.Parallel() c := &CreateEvent{} c.GetInstallation() c = nil @@ -5059,6 +5596,7 @@ func TestCreateEvent_GetInstallation(tt *testing.T) { } func TestCreateEvent_GetMasterBranch(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CreateEvent{MasterBranch: &zeroValue} c.GetMasterBranch() @@ -5069,6 +5607,7 @@ func TestCreateEvent_GetMasterBranch(tt *testing.T) { } func TestCreateEvent_GetOrg(tt *testing.T) { + tt.Parallel() c := &CreateEvent{} c.GetOrg() c = nil @@ -5076,6 +5615,7 @@ func TestCreateEvent_GetOrg(tt *testing.T) { } func TestCreateEvent_GetPusherType(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CreateEvent{PusherType: &zeroValue} c.GetPusherType() @@ -5086,6 +5626,7 @@ func TestCreateEvent_GetPusherType(tt *testing.T) { } func TestCreateEvent_GetRef(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CreateEvent{Ref: &zeroValue} c.GetRef() @@ -5096,6 +5637,7 @@ func TestCreateEvent_GetRef(tt *testing.T) { } func TestCreateEvent_GetRefType(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CreateEvent{RefType: &zeroValue} c.GetRefType() @@ -5106,6 +5648,7 @@ func TestCreateEvent_GetRefType(tt *testing.T) { } func TestCreateEvent_GetRepo(tt *testing.T) { + tt.Parallel() c := &CreateEvent{} c.GetRepo() c = nil @@ -5113,6 +5656,7 @@ func TestCreateEvent_GetRepo(tt *testing.T) { } func TestCreateEvent_GetSender(tt *testing.T) { + tt.Parallel() c := &CreateEvent{} c.GetSender() c = nil @@ -5120,6 +5664,7 @@ func TestCreateEvent_GetSender(tt *testing.T) { } func TestCreateOrgInvitationOptions_GetEmail(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CreateOrgInvitationOptions{Email: &zeroValue} c.GetEmail() @@ -5130,6 +5675,7 @@ func TestCreateOrgInvitationOptions_GetEmail(tt *testing.T) { } func TestCreateOrgInvitationOptions_GetInviteeID(tt *testing.T) { + tt.Parallel() var zeroValue int64 c := &CreateOrgInvitationOptions{InviteeID: &zeroValue} c.GetInviteeID() @@ -5140,6 +5686,7 @@ func TestCreateOrgInvitationOptions_GetInviteeID(tt *testing.T) { } func TestCreateOrgInvitationOptions_GetRole(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CreateOrgInvitationOptions{Role: &zeroValue} c.GetRole() @@ -5150,6 +5697,7 @@ func TestCreateOrgInvitationOptions_GetRole(tt *testing.T) { } func TestCreateOrUpdateCustomRepoRoleOptions_GetBaseRole(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CreateOrUpdateCustomRepoRoleOptions{BaseRole: &zeroValue} c.GetBaseRole() @@ -5160,6 +5708,7 @@ func TestCreateOrUpdateCustomRepoRoleOptions_GetBaseRole(tt *testing.T) { } func TestCreateOrUpdateCustomRepoRoleOptions_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CreateOrUpdateCustomRepoRoleOptions{Description: &zeroValue} c.GetDescription() @@ -5170,6 +5719,7 @@ func TestCreateOrUpdateCustomRepoRoleOptions_GetDescription(tt *testing.T) { } func TestCreateOrUpdateCustomRepoRoleOptions_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CreateOrUpdateCustomRepoRoleOptions{Name: &zeroValue} c.GetName() @@ -5180,6 +5730,7 @@ func TestCreateOrUpdateCustomRepoRoleOptions_GetName(tt *testing.T) { } func TestCreateOrUpdateOrgRoleOptions_GetBaseRole(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CreateOrUpdateOrgRoleOptions{BaseRole: &zeroValue} c.GetBaseRole() @@ -5190,6 +5741,7 @@ func TestCreateOrUpdateOrgRoleOptions_GetBaseRole(tt *testing.T) { } func TestCreateOrUpdateOrgRoleOptions_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CreateOrUpdateOrgRoleOptions{Description: &zeroValue} c.GetDescription() @@ -5200,6 +5752,7 @@ func TestCreateOrUpdateOrgRoleOptions_GetDescription(tt *testing.T) { } func TestCreateOrUpdateOrgRoleOptions_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CreateOrUpdateOrgRoleOptions{Name: &zeroValue} c.GetName() @@ -5210,6 +5763,7 @@ func TestCreateOrUpdateOrgRoleOptions_GetName(tt *testing.T) { } func TestCreateProtectedChanges_GetFrom(tt *testing.T) { + tt.Parallel() var zeroValue bool c := &CreateProtectedChanges{From: &zeroValue} c.GetFrom() @@ -5220,6 +5774,7 @@ func TestCreateProtectedChanges_GetFrom(tt *testing.T) { } func TestCreateRunnerGroupRequest_GetAllowsPublicRepositories(tt *testing.T) { + tt.Parallel() var zeroValue bool c := &CreateRunnerGroupRequest{AllowsPublicRepositories: &zeroValue} c.GetAllowsPublicRepositories() @@ -5230,6 +5785,7 @@ func TestCreateRunnerGroupRequest_GetAllowsPublicRepositories(tt *testing.T) { } func TestCreateRunnerGroupRequest_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CreateRunnerGroupRequest{Name: &zeroValue} c.GetName() @@ -5240,6 +5796,7 @@ func TestCreateRunnerGroupRequest_GetName(tt *testing.T) { } func TestCreateRunnerGroupRequest_GetRestrictedToWorkflows(tt *testing.T) { + tt.Parallel() var zeroValue bool c := &CreateRunnerGroupRequest{RestrictedToWorkflows: &zeroValue} c.GetRestrictedToWorkflows() @@ -5250,6 +5807,7 @@ func TestCreateRunnerGroupRequest_GetRestrictedToWorkflows(tt *testing.T) { } func TestCreateRunnerGroupRequest_GetVisibility(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CreateRunnerGroupRequest{Visibility: &zeroValue} c.GetVisibility() @@ -5260,6 +5818,7 @@ func TestCreateRunnerGroupRequest_GetVisibility(tt *testing.T) { } func TestCreateUpdateEnvironment_GetCanAdminsBypass(tt *testing.T) { + tt.Parallel() var zeroValue bool c := &CreateUpdateEnvironment{CanAdminsBypass: &zeroValue} c.GetCanAdminsBypass() @@ -5270,6 +5829,7 @@ func TestCreateUpdateEnvironment_GetCanAdminsBypass(tt *testing.T) { } func TestCreateUpdateEnvironment_GetDeploymentBranchPolicy(tt *testing.T) { + tt.Parallel() c := &CreateUpdateEnvironment{} c.GetDeploymentBranchPolicy() c = nil @@ -5277,6 +5837,7 @@ func TestCreateUpdateEnvironment_GetDeploymentBranchPolicy(tt *testing.T) { } func TestCreateUpdateEnvironment_GetPreventSelfReview(tt *testing.T) { + tt.Parallel() var zeroValue bool c := &CreateUpdateEnvironment{PreventSelfReview: &zeroValue} c.GetPreventSelfReview() @@ -5287,6 +5848,7 @@ func TestCreateUpdateEnvironment_GetPreventSelfReview(tt *testing.T) { } func TestCreateUpdateEnvironment_GetWaitTimer(tt *testing.T) { + tt.Parallel() var zeroValue int c := &CreateUpdateEnvironment{WaitTimer: &zeroValue} c.GetWaitTimer() @@ -5297,6 +5859,7 @@ func TestCreateUpdateEnvironment_GetWaitTimer(tt *testing.T) { } func TestCreateUpdateRequiredWorkflowOptions_GetRepositoryID(tt *testing.T) { + tt.Parallel() var zeroValue int64 c := &CreateUpdateRequiredWorkflowOptions{RepositoryID: &zeroValue} c.GetRepositoryID() @@ -5307,6 +5870,7 @@ func TestCreateUpdateRequiredWorkflowOptions_GetRepositoryID(tt *testing.T) { } func TestCreateUpdateRequiredWorkflowOptions_GetScope(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CreateUpdateRequiredWorkflowOptions{Scope: &zeroValue} c.GetScope() @@ -5317,6 +5881,7 @@ func TestCreateUpdateRequiredWorkflowOptions_GetScope(tt *testing.T) { } func TestCreateUpdateRequiredWorkflowOptions_GetSelectedRepositoryIDs(tt *testing.T) { + tt.Parallel() c := &CreateUpdateRequiredWorkflowOptions{} c.GetSelectedRepositoryIDs() c = nil @@ -5324,6 +5889,7 @@ func TestCreateUpdateRequiredWorkflowOptions_GetSelectedRepositoryIDs(tt *testin } func TestCreateUpdateRequiredWorkflowOptions_GetWorkflowFilePath(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CreateUpdateRequiredWorkflowOptions{WorkflowFilePath: &zeroValue} c.GetWorkflowFilePath() @@ -5334,6 +5900,7 @@ func TestCreateUpdateRequiredWorkflowOptions_GetWorkflowFilePath(tt *testing.T) } func TestCreateUserProjectOptions_GetBody(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CreateUserProjectOptions{Body: &zeroValue} c.GetBody() @@ -5344,6 +5911,7 @@ func TestCreateUserProjectOptions_GetBody(tt *testing.T) { } func TestCreateUserRequest_GetEmail(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CreateUserRequest{Email: &zeroValue} c.GetEmail() @@ -5354,6 +5922,7 @@ func TestCreateUserRequest_GetEmail(tt *testing.T) { } func TestCreateUserRequest_GetSuspended(tt *testing.T) { + tt.Parallel() var zeroValue bool c := &CreateUserRequest{Suspended: &zeroValue} c.GetSuspended() @@ -5364,6 +5933,7 @@ func TestCreateUserRequest_GetSuspended(tt *testing.T) { } func TestCreationInfo_GetCreated(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp c := &CreationInfo{Created: &zeroValue} c.GetCreated() @@ -5374,6 +5944,7 @@ func TestCreationInfo_GetCreated(tt *testing.T) { } func TestCredentialAuthorization_GetAuthorizedCredentialExpiresAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp c := &CredentialAuthorization{AuthorizedCredentialExpiresAt: &zeroValue} c.GetAuthorizedCredentialExpiresAt() @@ -5384,6 +5955,7 @@ func TestCredentialAuthorization_GetAuthorizedCredentialExpiresAt(tt *testing.T) } func TestCredentialAuthorization_GetAuthorizedCredentialID(tt *testing.T) { + tt.Parallel() var zeroValue int64 c := &CredentialAuthorization{AuthorizedCredentialID: &zeroValue} c.GetAuthorizedCredentialID() @@ -5394,6 +5966,7 @@ func TestCredentialAuthorization_GetAuthorizedCredentialID(tt *testing.T) { } func TestCredentialAuthorization_GetAuthorizedCredentialNote(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CredentialAuthorization{AuthorizedCredentialNote: &zeroValue} c.GetAuthorizedCredentialNote() @@ -5404,6 +5977,7 @@ func TestCredentialAuthorization_GetAuthorizedCredentialNote(tt *testing.T) { } func TestCredentialAuthorization_GetAuthorizedCredentialTitle(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CredentialAuthorization{AuthorizedCredentialTitle: &zeroValue} c.GetAuthorizedCredentialTitle() @@ -5414,6 +5988,7 @@ func TestCredentialAuthorization_GetAuthorizedCredentialTitle(tt *testing.T) { } func TestCredentialAuthorization_GetCredentialAccessedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp c := &CredentialAuthorization{CredentialAccessedAt: &zeroValue} c.GetCredentialAccessedAt() @@ -5424,6 +5999,7 @@ func TestCredentialAuthorization_GetCredentialAccessedAt(tt *testing.T) { } func TestCredentialAuthorization_GetCredentialAuthorizedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp c := &CredentialAuthorization{CredentialAuthorizedAt: &zeroValue} c.GetCredentialAuthorizedAt() @@ -5434,6 +6010,7 @@ func TestCredentialAuthorization_GetCredentialAuthorizedAt(tt *testing.T) { } func TestCredentialAuthorization_GetCredentialID(tt *testing.T) { + tt.Parallel() var zeroValue int64 c := &CredentialAuthorization{CredentialID: &zeroValue} c.GetCredentialID() @@ -5444,6 +6021,7 @@ func TestCredentialAuthorization_GetCredentialID(tt *testing.T) { } func TestCredentialAuthorization_GetCredentialType(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CredentialAuthorization{CredentialType: &zeroValue} c.GetCredentialType() @@ -5454,6 +6032,7 @@ func TestCredentialAuthorization_GetCredentialType(tt *testing.T) { } func TestCredentialAuthorization_GetFingerprint(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CredentialAuthorization{Fingerprint: &zeroValue} c.GetFingerprint() @@ -5464,6 +6043,7 @@ func TestCredentialAuthorization_GetFingerprint(tt *testing.T) { } func TestCredentialAuthorization_GetLogin(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CredentialAuthorization{Login: &zeroValue} c.GetLogin() @@ -5474,6 +6054,7 @@ func TestCredentialAuthorization_GetLogin(tt *testing.T) { } func TestCredentialAuthorization_GetTokenLastEight(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CredentialAuthorization{TokenLastEight: &zeroValue} c.GetTokenLastEight() @@ -5484,6 +6065,7 @@ func TestCredentialAuthorization_GetTokenLastEight(tt *testing.T) { } func TestCredit_GetType(tt *testing.T) { + tt.Parallel() var zeroValue string c := &Credit{Type: &zeroValue} c.GetType() @@ -5494,6 +6076,7 @@ func TestCredit_GetType(tt *testing.T) { } func TestCredit_GetUser(tt *testing.T) { + tt.Parallel() c := &Credit{} c.GetUser() c = nil @@ -5501,6 +6084,7 @@ func TestCredit_GetUser(tt *testing.T) { } func TestCustomDeploymentProtectionRule_GetApp(tt *testing.T) { + tt.Parallel() c := &CustomDeploymentProtectionRule{} c.GetApp() c = nil @@ -5508,6 +6092,7 @@ func TestCustomDeploymentProtectionRule_GetApp(tt *testing.T) { } func TestCustomDeploymentProtectionRule_GetEnabled(tt *testing.T) { + tt.Parallel() var zeroValue bool c := &CustomDeploymentProtectionRule{Enabled: &zeroValue} c.GetEnabled() @@ -5518,6 +6103,7 @@ func TestCustomDeploymentProtectionRule_GetEnabled(tt *testing.T) { } func TestCustomDeploymentProtectionRule_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 c := &CustomDeploymentProtectionRule{ID: &zeroValue} c.GetID() @@ -5528,6 +6114,7 @@ func TestCustomDeploymentProtectionRule_GetID(tt *testing.T) { } func TestCustomDeploymentProtectionRule_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CustomDeploymentProtectionRule{NodeID: &zeroValue} c.GetNodeID() @@ -5538,6 +6125,7 @@ func TestCustomDeploymentProtectionRule_GetNodeID(tt *testing.T) { } func TestCustomDeploymentProtectionRuleApp_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 c := &CustomDeploymentProtectionRuleApp{ID: &zeroValue} c.GetID() @@ -5548,6 +6136,7 @@ func TestCustomDeploymentProtectionRuleApp_GetID(tt *testing.T) { } func TestCustomDeploymentProtectionRuleApp_GetIntegrationURL(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CustomDeploymentProtectionRuleApp{IntegrationURL: &zeroValue} c.GetIntegrationURL() @@ -5558,6 +6147,7 @@ func TestCustomDeploymentProtectionRuleApp_GetIntegrationURL(tt *testing.T) { } func TestCustomDeploymentProtectionRuleApp_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CustomDeploymentProtectionRuleApp{NodeID: &zeroValue} c.GetNodeID() @@ -5568,6 +6158,7 @@ func TestCustomDeploymentProtectionRuleApp_GetNodeID(tt *testing.T) { } func TestCustomDeploymentProtectionRuleApp_GetSlug(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CustomDeploymentProtectionRuleApp{Slug: &zeroValue} c.GetSlug() @@ -5578,6 +6169,7 @@ func TestCustomDeploymentProtectionRuleApp_GetSlug(tt *testing.T) { } func TestCustomDeploymentProtectionRuleRequest_GetIntegrationID(tt *testing.T) { + tt.Parallel() var zeroValue int64 c := &CustomDeploymentProtectionRuleRequest{IntegrationID: &zeroValue} c.GetIntegrationID() @@ -5588,6 +6180,7 @@ func TestCustomDeploymentProtectionRuleRequest_GetIntegrationID(tt *testing.T) { } func TestCustomOrgRoles_GetBaseRole(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CustomOrgRoles{BaseRole: &zeroValue} c.GetBaseRole() @@ -5598,6 +6191,7 @@ func TestCustomOrgRoles_GetBaseRole(tt *testing.T) { } func TestCustomOrgRoles_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp c := &CustomOrgRoles{CreatedAt: &zeroValue} c.GetCreatedAt() @@ -5608,6 +6202,7 @@ func TestCustomOrgRoles_GetCreatedAt(tt *testing.T) { } func TestCustomOrgRoles_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CustomOrgRoles{Description: &zeroValue} c.GetDescription() @@ -5618,6 +6213,7 @@ func TestCustomOrgRoles_GetDescription(tt *testing.T) { } func TestCustomOrgRoles_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 c := &CustomOrgRoles{ID: &zeroValue} c.GetID() @@ -5628,6 +6224,7 @@ func TestCustomOrgRoles_GetID(tt *testing.T) { } func TestCustomOrgRoles_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CustomOrgRoles{Name: &zeroValue} c.GetName() @@ -5638,6 +6235,7 @@ func TestCustomOrgRoles_GetName(tt *testing.T) { } func TestCustomOrgRoles_GetOrg(tt *testing.T) { + tt.Parallel() c := &CustomOrgRoles{} c.GetOrg() c = nil @@ -5645,6 +6243,7 @@ func TestCustomOrgRoles_GetOrg(tt *testing.T) { } func TestCustomOrgRoles_GetSource(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CustomOrgRoles{Source: &zeroValue} c.GetSource() @@ -5655,6 +6254,7 @@ func TestCustomOrgRoles_GetSource(tt *testing.T) { } func TestCustomOrgRoles_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp c := &CustomOrgRoles{UpdatedAt: &zeroValue} c.GetUpdatedAt() @@ -5665,6 +6265,7 @@ func TestCustomOrgRoles_GetUpdatedAt(tt *testing.T) { } func TestCustomProperty_GetDefaultValue(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CustomProperty{DefaultValue: &zeroValue} c.GetDefaultValue() @@ -5675,6 +6276,7 @@ func TestCustomProperty_GetDefaultValue(tt *testing.T) { } func TestCustomProperty_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CustomProperty{Description: &zeroValue} c.GetDescription() @@ -5685,6 +6287,7 @@ func TestCustomProperty_GetDescription(tt *testing.T) { } func TestCustomProperty_GetPropertyName(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CustomProperty{PropertyName: &zeroValue} c.GetPropertyName() @@ -5695,6 +6298,7 @@ func TestCustomProperty_GetPropertyName(tt *testing.T) { } func TestCustomProperty_GetRequired(tt *testing.T) { + tt.Parallel() var zeroValue bool c := &CustomProperty{Required: &zeroValue} c.GetRequired() @@ -5705,6 +6309,7 @@ func TestCustomProperty_GetRequired(tt *testing.T) { } func TestCustomProperty_GetValuesEditableBy(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CustomProperty{ValuesEditableBy: &zeroValue} c.GetValuesEditableBy() @@ -5715,6 +6320,7 @@ func TestCustomProperty_GetValuesEditableBy(tt *testing.T) { } func TestCustomRepoRoles_GetBaseRole(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CustomRepoRoles{BaseRole: &zeroValue} c.GetBaseRole() @@ -5725,6 +6331,7 @@ func TestCustomRepoRoles_GetBaseRole(tt *testing.T) { } func TestCustomRepoRoles_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp c := &CustomRepoRoles{CreatedAt: &zeroValue} c.GetCreatedAt() @@ -5735,6 +6342,7 @@ func TestCustomRepoRoles_GetCreatedAt(tt *testing.T) { } func TestCustomRepoRoles_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CustomRepoRoles{Description: &zeroValue} c.GetDescription() @@ -5745,6 +6353,7 @@ func TestCustomRepoRoles_GetDescription(tt *testing.T) { } func TestCustomRepoRoles_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 c := &CustomRepoRoles{ID: &zeroValue} c.GetID() @@ -5755,6 +6364,7 @@ func TestCustomRepoRoles_GetID(tt *testing.T) { } func TestCustomRepoRoles_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string c := &CustomRepoRoles{Name: &zeroValue} c.GetName() @@ -5765,6 +6375,7 @@ func TestCustomRepoRoles_GetName(tt *testing.T) { } func TestCustomRepoRoles_GetOrg(tt *testing.T) { + tt.Parallel() c := &CustomRepoRoles{} c.GetOrg() c = nil @@ -5772,6 +6383,7 @@ func TestCustomRepoRoles_GetOrg(tt *testing.T) { } func TestCustomRepoRoles_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp c := &CustomRepoRoles{UpdatedAt: &zeroValue} c.GetUpdatedAt() @@ -5782,6 +6394,7 @@ func TestCustomRepoRoles_GetUpdatedAt(tt *testing.T) { } func TestDefaultSetupConfiguration_GetQuerySuite(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DefaultSetupConfiguration{QuerySuite: &zeroValue} d.GetQuerySuite() @@ -5792,6 +6405,7 @@ func TestDefaultSetupConfiguration_GetQuerySuite(tt *testing.T) { } func TestDefaultSetupConfiguration_GetState(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DefaultSetupConfiguration{State: &zeroValue} d.GetState() @@ -5802,6 +6416,7 @@ func TestDefaultSetupConfiguration_GetState(tt *testing.T) { } func TestDefaultSetupConfiguration_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp d := &DefaultSetupConfiguration{UpdatedAt: &zeroValue} d.GetUpdatedAt() @@ -5812,6 +6427,7 @@ func TestDefaultSetupConfiguration_GetUpdatedAt(tt *testing.T) { } func TestDefaultWorkflowPermissionEnterprise_GetCanApprovePullRequestReviews(tt *testing.T) { + tt.Parallel() var zeroValue bool d := &DefaultWorkflowPermissionEnterprise{CanApprovePullRequestReviews: &zeroValue} d.GetCanApprovePullRequestReviews() @@ -5822,6 +6438,7 @@ func TestDefaultWorkflowPermissionEnterprise_GetCanApprovePullRequestReviews(tt } func TestDefaultWorkflowPermissionEnterprise_GetDefaultWorkflowPermissions(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DefaultWorkflowPermissionEnterprise{DefaultWorkflowPermissions: &zeroValue} d.GetDefaultWorkflowPermissions() @@ -5832,6 +6449,7 @@ func TestDefaultWorkflowPermissionEnterprise_GetDefaultWorkflowPermissions(tt *t } func TestDefaultWorkflowPermissionOrganization_GetCanApprovePullRequestReviews(tt *testing.T) { + tt.Parallel() var zeroValue bool d := &DefaultWorkflowPermissionOrganization{CanApprovePullRequestReviews: &zeroValue} d.GetCanApprovePullRequestReviews() @@ -5842,6 +6460,7 @@ func TestDefaultWorkflowPermissionOrganization_GetCanApprovePullRequestReviews(t } func TestDefaultWorkflowPermissionOrganization_GetDefaultWorkflowPermissions(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DefaultWorkflowPermissionOrganization{DefaultWorkflowPermissions: &zeroValue} d.GetDefaultWorkflowPermissions() @@ -5852,6 +6471,7 @@ func TestDefaultWorkflowPermissionOrganization_GetDefaultWorkflowPermissions(tt } func TestDefaultWorkflowPermissionRepository_GetCanApprovePullRequestReviews(tt *testing.T) { + tt.Parallel() var zeroValue bool d := &DefaultWorkflowPermissionRepository{CanApprovePullRequestReviews: &zeroValue} d.GetCanApprovePullRequestReviews() @@ -5862,6 +6482,7 @@ func TestDefaultWorkflowPermissionRepository_GetCanApprovePullRequestReviews(tt } func TestDefaultWorkflowPermissionRepository_GetDefaultWorkflowPermissions(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DefaultWorkflowPermissionRepository{DefaultWorkflowPermissions: &zeroValue} d.GetDefaultWorkflowPermissions() @@ -5872,6 +6493,7 @@ func TestDefaultWorkflowPermissionRepository_GetDefaultWorkflowPermissions(tt *t } func TestDeleteAnalysis_GetConfirmDeleteURL(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeleteAnalysis{ConfirmDeleteURL: &zeroValue} d.GetConfirmDeleteURL() @@ -5882,6 +6504,7 @@ func TestDeleteAnalysis_GetConfirmDeleteURL(tt *testing.T) { } func TestDeleteAnalysis_GetNextAnalysisURL(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeleteAnalysis{NextAnalysisURL: &zeroValue} d.GetNextAnalysisURL() @@ -5892,6 +6515,7 @@ func TestDeleteAnalysis_GetNextAnalysisURL(tt *testing.T) { } func TestDeleteEvent_GetInstallation(tt *testing.T) { + tt.Parallel() d := &DeleteEvent{} d.GetInstallation() d = nil @@ -5899,6 +6523,7 @@ func TestDeleteEvent_GetInstallation(tt *testing.T) { } func TestDeleteEvent_GetOrg(tt *testing.T) { + tt.Parallel() d := &DeleteEvent{} d.GetOrg() d = nil @@ -5906,6 +6531,7 @@ func TestDeleteEvent_GetOrg(tt *testing.T) { } func TestDeleteEvent_GetPusherType(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeleteEvent{PusherType: &zeroValue} d.GetPusherType() @@ -5916,6 +6542,7 @@ func TestDeleteEvent_GetPusherType(tt *testing.T) { } func TestDeleteEvent_GetRef(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeleteEvent{Ref: &zeroValue} d.GetRef() @@ -5926,6 +6553,7 @@ func TestDeleteEvent_GetRef(tt *testing.T) { } func TestDeleteEvent_GetRefType(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeleteEvent{RefType: &zeroValue} d.GetRefType() @@ -5936,6 +6564,7 @@ func TestDeleteEvent_GetRefType(tt *testing.T) { } func TestDeleteEvent_GetRepo(tt *testing.T) { + tt.Parallel() d := &DeleteEvent{} d.GetRepo() d = nil @@ -5943,6 +6572,7 @@ func TestDeleteEvent_GetRepo(tt *testing.T) { } func TestDeleteEvent_GetSender(tt *testing.T) { + tt.Parallel() d := &DeleteEvent{} d.GetSender() d = nil @@ -5950,6 +6580,7 @@ func TestDeleteEvent_GetSender(tt *testing.T) { } func TestDependabotAlert_GetAutoDismissedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp d := &DependabotAlert{AutoDismissedAt: &zeroValue} d.GetAutoDismissedAt() @@ -5960,6 +6591,7 @@ func TestDependabotAlert_GetAutoDismissedAt(tt *testing.T) { } func TestDependabotAlert_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp d := &DependabotAlert{CreatedAt: &zeroValue} d.GetCreatedAt() @@ -5970,6 +6602,7 @@ func TestDependabotAlert_GetCreatedAt(tt *testing.T) { } func TestDependabotAlert_GetDependency(tt *testing.T) { + tt.Parallel() d := &DependabotAlert{} d.GetDependency() d = nil @@ -5977,6 +6610,7 @@ func TestDependabotAlert_GetDependency(tt *testing.T) { } func TestDependabotAlert_GetDismissedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp d := &DependabotAlert{DismissedAt: &zeroValue} d.GetDismissedAt() @@ -5987,6 +6621,7 @@ func TestDependabotAlert_GetDismissedAt(tt *testing.T) { } func TestDependabotAlert_GetDismissedBy(tt *testing.T) { + tt.Parallel() d := &DependabotAlert{} d.GetDismissedBy() d = nil @@ -5994,6 +6629,7 @@ func TestDependabotAlert_GetDismissedBy(tt *testing.T) { } func TestDependabotAlert_GetDismissedComment(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DependabotAlert{DismissedComment: &zeroValue} d.GetDismissedComment() @@ -6004,6 +6640,7 @@ func TestDependabotAlert_GetDismissedComment(tt *testing.T) { } func TestDependabotAlert_GetDismissedReason(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DependabotAlert{DismissedReason: &zeroValue} d.GetDismissedReason() @@ -6014,6 +6651,7 @@ func TestDependabotAlert_GetDismissedReason(tt *testing.T) { } func TestDependabotAlert_GetFixedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp d := &DependabotAlert{FixedAt: &zeroValue} d.GetFixedAt() @@ -6024,6 +6662,7 @@ func TestDependabotAlert_GetFixedAt(tt *testing.T) { } func TestDependabotAlert_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DependabotAlert{HTMLURL: &zeroValue} d.GetHTMLURL() @@ -6034,6 +6673,7 @@ func TestDependabotAlert_GetHTMLURL(tt *testing.T) { } func TestDependabotAlert_GetNumber(tt *testing.T) { + tt.Parallel() var zeroValue int d := &DependabotAlert{Number: &zeroValue} d.GetNumber() @@ -6044,6 +6684,7 @@ func TestDependabotAlert_GetNumber(tt *testing.T) { } func TestDependabotAlert_GetRepository(tt *testing.T) { + tt.Parallel() d := &DependabotAlert{} d.GetRepository() d = nil @@ -6051,6 +6692,7 @@ func TestDependabotAlert_GetRepository(tt *testing.T) { } func TestDependabotAlert_GetSecurityAdvisory(tt *testing.T) { + tt.Parallel() d := &DependabotAlert{} d.GetSecurityAdvisory() d = nil @@ -6058,6 +6700,7 @@ func TestDependabotAlert_GetSecurityAdvisory(tt *testing.T) { } func TestDependabotAlert_GetSecurityVulnerability(tt *testing.T) { + tt.Parallel() d := &DependabotAlert{} d.GetSecurityVulnerability() d = nil @@ -6065,6 +6708,7 @@ func TestDependabotAlert_GetSecurityVulnerability(tt *testing.T) { } func TestDependabotAlert_GetState(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DependabotAlert{State: &zeroValue} d.GetState() @@ -6075,6 +6719,7 @@ func TestDependabotAlert_GetState(tt *testing.T) { } func TestDependabotAlert_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp d := &DependabotAlert{UpdatedAt: &zeroValue} d.GetUpdatedAt() @@ -6085,6 +6730,7 @@ func TestDependabotAlert_GetUpdatedAt(tt *testing.T) { } func TestDependabotAlert_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DependabotAlert{URL: &zeroValue} d.GetURL() @@ -6095,6 +6741,7 @@ func TestDependabotAlert_GetURL(tt *testing.T) { } func TestDependabotAlertEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DependabotAlertEvent{Action: &zeroValue} d.GetAction() @@ -6105,6 +6752,7 @@ func TestDependabotAlertEvent_GetAction(tt *testing.T) { } func TestDependabotAlertEvent_GetAlert(tt *testing.T) { + tt.Parallel() d := &DependabotAlertEvent{} d.GetAlert() d = nil @@ -6112,6 +6760,7 @@ func TestDependabotAlertEvent_GetAlert(tt *testing.T) { } func TestDependabotAlertEvent_GetEnterprise(tt *testing.T) { + tt.Parallel() d := &DependabotAlertEvent{} d.GetEnterprise() d = nil @@ -6119,6 +6768,7 @@ func TestDependabotAlertEvent_GetEnterprise(tt *testing.T) { } func TestDependabotAlertEvent_GetInstallation(tt *testing.T) { + tt.Parallel() d := &DependabotAlertEvent{} d.GetInstallation() d = nil @@ -6126,6 +6776,7 @@ func TestDependabotAlertEvent_GetInstallation(tt *testing.T) { } func TestDependabotAlertEvent_GetOrganization(tt *testing.T) { + tt.Parallel() d := &DependabotAlertEvent{} d.GetOrganization() d = nil @@ -6133,6 +6784,7 @@ func TestDependabotAlertEvent_GetOrganization(tt *testing.T) { } func TestDependabotAlertEvent_GetRepo(tt *testing.T) { + tt.Parallel() d := &DependabotAlertEvent{} d.GetRepo() d = nil @@ -6140,6 +6792,7 @@ func TestDependabotAlertEvent_GetRepo(tt *testing.T) { } func TestDependabotAlertEvent_GetSender(tt *testing.T) { + tt.Parallel() d := &DependabotAlertEvent{} d.GetSender() d = nil @@ -6147,6 +6800,7 @@ func TestDependabotAlertEvent_GetSender(tt *testing.T) { } func TestDependabotAlertState_GetDismissedComment(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DependabotAlertState{DismissedComment: &zeroValue} d.GetDismissedComment() @@ -6157,6 +6811,7 @@ func TestDependabotAlertState_GetDismissedComment(tt *testing.T) { } func TestDependabotAlertState_GetDismissedReason(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DependabotAlertState{DismissedReason: &zeroValue} d.GetDismissedReason() @@ -6167,6 +6822,7 @@ func TestDependabotAlertState_GetDismissedReason(tt *testing.T) { } func TestDependabotSecurityAdvisory_GetCVEID(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DependabotSecurityAdvisory{CVEID: &zeroValue} d.GetCVEID() @@ -6177,6 +6833,7 @@ func TestDependabotSecurityAdvisory_GetCVEID(tt *testing.T) { } func TestDependabotSecurityAdvisory_GetCVSS(tt *testing.T) { + tt.Parallel() d := &DependabotSecurityAdvisory{} d.GetCVSS() d = nil @@ -6184,6 +6841,7 @@ func TestDependabotSecurityAdvisory_GetCVSS(tt *testing.T) { } func TestDependabotSecurityAdvisory_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DependabotSecurityAdvisory{Description: &zeroValue} d.GetDescription() @@ -6194,6 +6852,7 @@ func TestDependabotSecurityAdvisory_GetDescription(tt *testing.T) { } func TestDependabotSecurityAdvisory_GetGHSAID(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DependabotSecurityAdvisory{GHSAID: &zeroValue} d.GetGHSAID() @@ -6204,6 +6863,7 @@ func TestDependabotSecurityAdvisory_GetGHSAID(tt *testing.T) { } func TestDependabotSecurityAdvisory_GetPublishedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp d := &DependabotSecurityAdvisory{PublishedAt: &zeroValue} d.GetPublishedAt() @@ -6214,6 +6874,7 @@ func TestDependabotSecurityAdvisory_GetPublishedAt(tt *testing.T) { } func TestDependabotSecurityAdvisory_GetSeverity(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DependabotSecurityAdvisory{Severity: &zeroValue} d.GetSeverity() @@ -6224,6 +6885,7 @@ func TestDependabotSecurityAdvisory_GetSeverity(tt *testing.T) { } func TestDependabotSecurityAdvisory_GetSummary(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DependabotSecurityAdvisory{Summary: &zeroValue} d.GetSummary() @@ -6234,6 +6896,7 @@ func TestDependabotSecurityAdvisory_GetSummary(tt *testing.T) { } func TestDependabotSecurityAdvisory_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp d := &DependabotSecurityAdvisory{UpdatedAt: &zeroValue} d.GetUpdatedAt() @@ -6244,6 +6907,7 @@ func TestDependabotSecurityAdvisory_GetUpdatedAt(tt *testing.T) { } func TestDependabotSecurityAdvisory_GetWithdrawnAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp d := &DependabotSecurityAdvisory{WithdrawnAt: &zeroValue} d.GetWithdrawnAt() @@ -6254,6 +6918,7 @@ func TestDependabotSecurityAdvisory_GetWithdrawnAt(tt *testing.T) { } func TestDependabotSecurityUpdates_GetStatus(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DependabotSecurityUpdates{Status: &zeroValue} d.GetStatus() @@ -6264,6 +6929,7 @@ func TestDependabotSecurityUpdates_GetStatus(tt *testing.T) { } func TestDependency_GetManifestPath(tt *testing.T) { + tt.Parallel() var zeroValue string d := &Dependency{ManifestPath: &zeroValue} d.GetManifestPath() @@ -6274,6 +6940,7 @@ func TestDependency_GetManifestPath(tt *testing.T) { } func TestDependency_GetPackage(tt *testing.T) { + tt.Parallel() d := &Dependency{} d.GetPackage() d = nil @@ -6281,6 +6948,7 @@ func TestDependency_GetPackage(tt *testing.T) { } func TestDependency_GetScope(tt *testing.T) { + tt.Parallel() var zeroValue string d := &Dependency{Scope: &zeroValue} d.GetScope() @@ -6291,6 +6959,7 @@ func TestDependency_GetScope(tt *testing.T) { } func TestDependencyGraphSnapshot_GetDetector(tt *testing.T) { + tt.Parallel() d := &DependencyGraphSnapshot{} d.GetDetector() d = nil @@ -6298,6 +6967,7 @@ func TestDependencyGraphSnapshot_GetDetector(tt *testing.T) { } func TestDependencyGraphSnapshot_GetJob(tt *testing.T) { + tt.Parallel() d := &DependencyGraphSnapshot{} d.GetJob() d = nil @@ -6305,6 +6975,7 @@ func TestDependencyGraphSnapshot_GetJob(tt *testing.T) { } func TestDependencyGraphSnapshot_GetRef(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DependencyGraphSnapshot{Ref: &zeroValue} d.GetRef() @@ -6315,6 +6986,7 @@ func TestDependencyGraphSnapshot_GetRef(tt *testing.T) { } func TestDependencyGraphSnapshot_GetScanned(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp d := &DependencyGraphSnapshot{Scanned: &zeroValue} d.GetScanned() @@ -6325,6 +6997,7 @@ func TestDependencyGraphSnapshot_GetScanned(tt *testing.T) { } func TestDependencyGraphSnapshot_GetSha(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DependencyGraphSnapshot{Sha: &zeroValue} d.GetSha() @@ -6335,6 +7008,7 @@ func TestDependencyGraphSnapshot_GetSha(tt *testing.T) { } func TestDependencyGraphSnapshotCreationData_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp d := &DependencyGraphSnapshotCreationData{CreatedAt: &zeroValue} d.GetCreatedAt() @@ -6345,6 +7019,7 @@ func TestDependencyGraphSnapshotCreationData_GetCreatedAt(tt *testing.T) { } func TestDependencyGraphSnapshotCreationData_GetMessage(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DependencyGraphSnapshotCreationData{Message: &zeroValue} d.GetMessage() @@ -6355,6 +7030,7 @@ func TestDependencyGraphSnapshotCreationData_GetMessage(tt *testing.T) { } func TestDependencyGraphSnapshotCreationData_GetResult(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DependencyGraphSnapshotCreationData{Result: &zeroValue} d.GetResult() @@ -6365,6 +7041,7 @@ func TestDependencyGraphSnapshotCreationData_GetResult(tt *testing.T) { } func TestDependencyGraphSnapshotDetector_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DependencyGraphSnapshotDetector{Name: &zeroValue} d.GetName() @@ -6375,6 +7052,7 @@ func TestDependencyGraphSnapshotDetector_GetName(tt *testing.T) { } func TestDependencyGraphSnapshotDetector_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DependencyGraphSnapshotDetector{URL: &zeroValue} d.GetURL() @@ -6385,6 +7063,7 @@ func TestDependencyGraphSnapshotDetector_GetURL(tt *testing.T) { } func TestDependencyGraphSnapshotDetector_GetVersion(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DependencyGraphSnapshotDetector{Version: &zeroValue} d.GetVersion() @@ -6395,6 +7074,7 @@ func TestDependencyGraphSnapshotDetector_GetVersion(tt *testing.T) { } func TestDependencyGraphSnapshotJob_GetCorrelator(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DependencyGraphSnapshotJob{Correlator: &zeroValue} d.GetCorrelator() @@ -6405,6 +7085,7 @@ func TestDependencyGraphSnapshotJob_GetCorrelator(tt *testing.T) { } func TestDependencyGraphSnapshotJob_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DependencyGraphSnapshotJob{HTMLURL: &zeroValue} d.GetHTMLURL() @@ -6415,6 +7096,7 @@ func TestDependencyGraphSnapshotJob_GetHTMLURL(tt *testing.T) { } func TestDependencyGraphSnapshotJob_GetID(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DependencyGraphSnapshotJob{ID: &zeroValue} d.GetID() @@ -6425,6 +7107,7 @@ func TestDependencyGraphSnapshotJob_GetID(tt *testing.T) { } func TestDependencyGraphSnapshotManifest_GetFile(tt *testing.T) { + tt.Parallel() d := &DependencyGraphSnapshotManifest{} d.GetFile() d = nil @@ -6432,6 +7115,7 @@ func TestDependencyGraphSnapshotManifest_GetFile(tt *testing.T) { } func TestDependencyGraphSnapshotManifest_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DependencyGraphSnapshotManifest{Name: &zeroValue} d.GetName() @@ -6442,6 +7126,7 @@ func TestDependencyGraphSnapshotManifest_GetName(tt *testing.T) { } func TestDependencyGraphSnapshotManifestFile_GetSourceLocation(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DependencyGraphSnapshotManifestFile{SourceLocation: &zeroValue} d.GetSourceLocation() @@ -6452,6 +7137,7 @@ func TestDependencyGraphSnapshotManifestFile_GetSourceLocation(tt *testing.T) { } func TestDependencyGraphSnapshotResolvedDependency_GetPackageURL(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DependencyGraphSnapshotResolvedDependency{PackageURL: &zeroValue} d.GetPackageURL() @@ -6462,6 +7148,7 @@ func TestDependencyGraphSnapshotResolvedDependency_GetPackageURL(tt *testing.T) } func TestDependencyGraphSnapshotResolvedDependency_GetRelationship(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DependencyGraphSnapshotResolvedDependency{Relationship: &zeroValue} d.GetRelationship() @@ -6472,6 +7159,7 @@ func TestDependencyGraphSnapshotResolvedDependency_GetRelationship(tt *testing.T } func TestDependencyGraphSnapshotResolvedDependency_GetScope(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DependencyGraphSnapshotResolvedDependency{Scope: &zeroValue} d.GetScope() @@ -6482,6 +7170,7 @@ func TestDependencyGraphSnapshotResolvedDependency_GetScope(tt *testing.T) { } func TestDeployKeyEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeployKeyEvent{Action: &zeroValue} d.GetAction() @@ -6492,6 +7181,7 @@ func TestDeployKeyEvent_GetAction(tt *testing.T) { } func TestDeployKeyEvent_GetInstallation(tt *testing.T) { + tt.Parallel() d := &DeployKeyEvent{} d.GetInstallation() d = nil @@ -6499,6 +7189,7 @@ func TestDeployKeyEvent_GetInstallation(tt *testing.T) { } func TestDeployKeyEvent_GetKey(tt *testing.T) { + tt.Parallel() d := &DeployKeyEvent{} d.GetKey() d = nil @@ -6506,6 +7197,7 @@ func TestDeployKeyEvent_GetKey(tt *testing.T) { } func TestDeployKeyEvent_GetOrganization(tt *testing.T) { + tt.Parallel() d := &DeployKeyEvent{} d.GetOrganization() d = nil @@ -6513,6 +7205,7 @@ func TestDeployKeyEvent_GetOrganization(tt *testing.T) { } func TestDeployKeyEvent_GetRepo(tt *testing.T) { + tt.Parallel() d := &DeployKeyEvent{} d.GetRepo() d = nil @@ -6520,6 +7213,7 @@ func TestDeployKeyEvent_GetRepo(tt *testing.T) { } func TestDeployKeyEvent_GetSender(tt *testing.T) { + tt.Parallel() d := &DeployKeyEvent{} d.GetSender() d = nil @@ -6527,6 +7221,7 @@ func TestDeployKeyEvent_GetSender(tt *testing.T) { } func TestDeployment_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp d := &Deployment{CreatedAt: &zeroValue} d.GetCreatedAt() @@ -6537,6 +7232,7 @@ func TestDeployment_GetCreatedAt(tt *testing.T) { } func TestDeployment_GetCreator(tt *testing.T) { + tt.Parallel() d := &Deployment{} d.GetCreator() d = nil @@ -6544,6 +7240,7 @@ func TestDeployment_GetCreator(tt *testing.T) { } func TestDeployment_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string d := &Deployment{Description: &zeroValue} d.GetDescription() @@ -6554,6 +7251,7 @@ func TestDeployment_GetDescription(tt *testing.T) { } func TestDeployment_GetEnvironment(tt *testing.T) { + tt.Parallel() var zeroValue string d := &Deployment{Environment: &zeroValue} d.GetEnvironment() @@ -6564,6 +7262,7 @@ func TestDeployment_GetEnvironment(tt *testing.T) { } func TestDeployment_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 d := &Deployment{ID: &zeroValue} d.GetID() @@ -6574,6 +7273,7 @@ func TestDeployment_GetID(tt *testing.T) { } func TestDeployment_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string d := &Deployment{NodeID: &zeroValue} d.GetNodeID() @@ -6584,6 +7284,7 @@ func TestDeployment_GetNodeID(tt *testing.T) { } func TestDeployment_GetRef(tt *testing.T) { + tt.Parallel() var zeroValue string d := &Deployment{Ref: &zeroValue} d.GetRef() @@ -6594,6 +7295,7 @@ func TestDeployment_GetRef(tt *testing.T) { } func TestDeployment_GetRepositoryURL(tt *testing.T) { + tt.Parallel() var zeroValue string d := &Deployment{RepositoryURL: &zeroValue} d.GetRepositoryURL() @@ -6604,6 +7306,7 @@ func TestDeployment_GetRepositoryURL(tt *testing.T) { } func TestDeployment_GetSHA(tt *testing.T) { + tt.Parallel() var zeroValue string d := &Deployment{SHA: &zeroValue} d.GetSHA() @@ -6614,6 +7317,7 @@ func TestDeployment_GetSHA(tt *testing.T) { } func TestDeployment_GetStatusesURL(tt *testing.T) { + tt.Parallel() var zeroValue string d := &Deployment{StatusesURL: &zeroValue} d.GetStatusesURL() @@ -6624,6 +7328,7 @@ func TestDeployment_GetStatusesURL(tt *testing.T) { } func TestDeployment_GetTask(tt *testing.T) { + tt.Parallel() var zeroValue string d := &Deployment{Task: &zeroValue} d.GetTask() @@ -6634,6 +7339,7 @@ func TestDeployment_GetTask(tt *testing.T) { } func TestDeployment_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp d := &Deployment{UpdatedAt: &zeroValue} d.GetUpdatedAt() @@ -6644,6 +7350,7 @@ func TestDeployment_GetUpdatedAt(tt *testing.T) { } func TestDeployment_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string d := &Deployment{URL: &zeroValue} d.GetURL() @@ -6654,6 +7361,7 @@ func TestDeployment_GetURL(tt *testing.T) { } func TestDeploymentBranchPolicy_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 d := &DeploymentBranchPolicy{ID: &zeroValue} d.GetID() @@ -6664,6 +7372,7 @@ func TestDeploymentBranchPolicy_GetID(tt *testing.T) { } func TestDeploymentBranchPolicy_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeploymentBranchPolicy{Name: &zeroValue} d.GetName() @@ -6674,6 +7383,7 @@ func TestDeploymentBranchPolicy_GetName(tt *testing.T) { } func TestDeploymentBranchPolicy_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeploymentBranchPolicy{NodeID: &zeroValue} d.GetNodeID() @@ -6684,6 +7394,7 @@ func TestDeploymentBranchPolicy_GetNodeID(tt *testing.T) { } func TestDeploymentBranchPolicy_GetType(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeploymentBranchPolicy{Type: &zeroValue} d.GetType() @@ -6694,6 +7405,7 @@ func TestDeploymentBranchPolicy_GetType(tt *testing.T) { } func TestDeploymentBranchPolicyRequest_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeploymentBranchPolicyRequest{Name: &zeroValue} d.GetName() @@ -6704,6 +7416,7 @@ func TestDeploymentBranchPolicyRequest_GetName(tt *testing.T) { } func TestDeploymentBranchPolicyRequest_GetType(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeploymentBranchPolicyRequest{Type: &zeroValue} d.GetType() @@ -6714,6 +7427,7 @@ func TestDeploymentBranchPolicyRequest_GetType(tt *testing.T) { } func TestDeploymentBranchPolicyResponse_GetTotalCount(tt *testing.T) { + tt.Parallel() var zeroValue int d := &DeploymentBranchPolicyResponse{TotalCount: &zeroValue} d.GetTotalCount() @@ -6724,6 +7438,7 @@ func TestDeploymentBranchPolicyResponse_GetTotalCount(tt *testing.T) { } func TestDeploymentEvent_GetDeployment(tt *testing.T) { + tt.Parallel() d := &DeploymentEvent{} d.GetDeployment() d = nil @@ -6731,6 +7446,7 @@ func TestDeploymentEvent_GetDeployment(tt *testing.T) { } func TestDeploymentEvent_GetInstallation(tt *testing.T) { + tt.Parallel() d := &DeploymentEvent{} d.GetInstallation() d = nil @@ -6738,6 +7454,7 @@ func TestDeploymentEvent_GetInstallation(tt *testing.T) { } func TestDeploymentEvent_GetOrg(tt *testing.T) { + tt.Parallel() d := &DeploymentEvent{} d.GetOrg() d = nil @@ -6745,6 +7462,7 @@ func TestDeploymentEvent_GetOrg(tt *testing.T) { } func TestDeploymentEvent_GetRepo(tt *testing.T) { + tt.Parallel() d := &DeploymentEvent{} d.GetRepo() d = nil @@ -6752,6 +7470,7 @@ func TestDeploymentEvent_GetRepo(tt *testing.T) { } func TestDeploymentEvent_GetSender(tt *testing.T) { + tt.Parallel() d := &DeploymentEvent{} d.GetSender() d = nil @@ -6759,6 +7478,7 @@ func TestDeploymentEvent_GetSender(tt *testing.T) { } func TestDeploymentEvent_GetWorkflow(tt *testing.T) { + tt.Parallel() d := &DeploymentEvent{} d.GetWorkflow() d = nil @@ -6766,6 +7486,7 @@ func TestDeploymentEvent_GetWorkflow(tt *testing.T) { } func TestDeploymentEvent_GetWorkflowRun(tt *testing.T) { + tt.Parallel() d := &DeploymentEvent{} d.GetWorkflowRun() d = nil @@ -6773,6 +7494,7 @@ func TestDeploymentEvent_GetWorkflowRun(tt *testing.T) { } func TestDeploymentProtectionRuleEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeploymentProtectionRuleEvent{Action: &zeroValue} d.GetAction() @@ -6783,6 +7505,7 @@ func TestDeploymentProtectionRuleEvent_GetAction(tt *testing.T) { } func TestDeploymentProtectionRuleEvent_GetDeployment(tt *testing.T) { + tt.Parallel() d := &DeploymentProtectionRuleEvent{} d.GetDeployment() d = nil @@ -6790,6 +7513,7 @@ func TestDeploymentProtectionRuleEvent_GetDeployment(tt *testing.T) { } func TestDeploymentProtectionRuleEvent_GetDeploymentCallbackURL(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeploymentProtectionRuleEvent{DeploymentCallbackURL: &zeroValue} d.GetDeploymentCallbackURL() @@ -6800,6 +7524,7 @@ func TestDeploymentProtectionRuleEvent_GetDeploymentCallbackURL(tt *testing.T) { } func TestDeploymentProtectionRuleEvent_GetEnvironment(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeploymentProtectionRuleEvent{Environment: &zeroValue} d.GetEnvironment() @@ -6810,6 +7535,7 @@ func TestDeploymentProtectionRuleEvent_GetEnvironment(tt *testing.T) { } func TestDeploymentProtectionRuleEvent_GetEvent(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeploymentProtectionRuleEvent{Event: &zeroValue} d.GetEvent() @@ -6820,6 +7546,7 @@ func TestDeploymentProtectionRuleEvent_GetEvent(tt *testing.T) { } func TestDeploymentProtectionRuleEvent_GetInstallation(tt *testing.T) { + tt.Parallel() d := &DeploymentProtectionRuleEvent{} d.GetInstallation() d = nil @@ -6827,6 +7554,7 @@ func TestDeploymentProtectionRuleEvent_GetInstallation(tt *testing.T) { } func TestDeploymentProtectionRuleEvent_GetOrganization(tt *testing.T) { + tt.Parallel() d := &DeploymentProtectionRuleEvent{} d.GetOrganization() d = nil @@ -6834,6 +7562,7 @@ func TestDeploymentProtectionRuleEvent_GetOrganization(tt *testing.T) { } func TestDeploymentProtectionRuleEvent_GetRepo(tt *testing.T) { + tt.Parallel() d := &DeploymentProtectionRuleEvent{} d.GetRepo() d = nil @@ -6841,6 +7570,7 @@ func TestDeploymentProtectionRuleEvent_GetRepo(tt *testing.T) { } func TestDeploymentProtectionRuleEvent_GetSender(tt *testing.T) { + tt.Parallel() d := &DeploymentProtectionRuleEvent{} d.GetSender() d = nil @@ -6848,6 +7578,7 @@ func TestDeploymentProtectionRuleEvent_GetSender(tt *testing.T) { } func TestDeploymentRequest_GetAutoMerge(tt *testing.T) { + tt.Parallel() var zeroValue bool d := &DeploymentRequest{AutoMerge: &zeroValue} d.GetAutoMerge() @@ -6858,6 +7589,7 @@ func TestDeploymentRequest_GetAutoMerge(tt *testing.T) { } func TestDeploymentRequest_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeploymentRequest{Description: &zeroValue} d.GetDescription() @@ -6868,6 +7600,7 @@ func TestDeploymentRequest_GetDescription(tt *testing.T) { } func TestDeploymentRequest_GetEnvironment(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeploymentRequest{Environment: &zeroValue} d.GetEnvironment() @@ -6878,6 +7611,7 @@ func TestDeploymentRequest_GetEnvironment(tt *testing.T) { } func TestDeploymentRequest_GetProductionEnvironment(tt *testing.T) { + tt.Parallel() var zeroValue bool d := &DeploymentRequest{ProductionEnvironment: &zeroValue} d.GetProductionEnvironment() @@ -6888,6 +7622,7 @@ func TestDeploymentRequest_GetProductionEnvironment(tt *testing.T) { } func TestDeploymentRequest_GetRef(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeploymentRequest{Ref: &zeroValue} d.GetRef() @@ -6898,6 +7633,7 @@ func TestDeploymentRequest_GetRef(tt *testing.T) { } func TestDeploymentRequest_GetRequiredContexts(tt *testing.T) { + tt.Parallel() var zeroValue []string d := &DeploymentRequest{RequiredContexts: &zeroValue} d.GetRequiredContexts() @@ -6908,6 +7644,7 @@ func TestDeploymentRequest_GetRequiredContexts(tt *testing.T) { } func TestDeploymentRequest_GetTask(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeploymentRequest{Task: &zeroValue} d.GetTask() @@ -6918,6 +7655,7 @@ func TestDeploymentRequest_GetTask(tt *testing.T) { } func TestDeploymentRequest_GetTransientEnvironment(tt *testing.T) { + tt.Parallel() var zeroValue bool d := &DeploymentRequest{TransientEnvironment: &zeroValue} d.GetTransientEnvironment() @@ -6928,6 +7666,7 @@ func TestDeploymentRequest_GetTransientEnvironment(tt *testing.T) { } func TestDeploymentReviewEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeploymentReviewEvent{Action: &zeroValue} d.GetAction() @@ -6938,6 +7677,7 @@ func TestDeploymentReviewEvent_GetAction(tt *testing.T) { } func TestDeploymentReviewEvent_GetApprover(tt *testing.T) { + tt.Parallel() d := &DeploymentReviewEvent{} d.GetApprover() d = nil @@ -6945,6 +7685,7 @@ func TestDeploymentReviewEvent_GetApprover(tt *testing.T) { } func TestDeploymentReviewEvent_GetComment(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeploymentReviewEvent{Comment: &zeroValue} d.GetComment() @@ -6955,6 +7696,7 @@ func TestDeploymentReviewEvent_GetComment(tt *testing.T) { } func TestDeploymentReviewEvent_GetEnterprise(tt *testing.T) { + tt.Parallel() d := &DeploymentReviewEvent{} d.GetEnterprise() d = nil @@ -6962,6 +7704,7 @@ func TestDeploymentReviewEvent_GetEnterprise(tt *testing.T) { } func TestDeploymentReviewEvent_GetEnvironment(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeploymentReviewEvent{Environment: &zeroValue} d.GetEnvironment() @@ -6972,6 +7715,7 @@ func TestDeploymentReviewEvent_GetEnvironment(tt *testing.T) { } func TestDeploymentReviewEvent_GetInstallation(tt *testing.T) { + tt.Parallel() d := &DeploymentReviewEvent{} d.GetInstallation() d = nil @@ -6979,6 +7723,7 @@ func TestDeploymentReviewEvent_GetInstallation(tt *testing.T) { } func TestDeploymentReviewEvent_GetOrganization(tt *testing.T) { + tt.Parallel() d := &DeploymentReviewEvent{} d.GetOrganization() d = nil @@ -6986,6 +7731,7 @@ func TestDeploymentReviewEvent_GetOrganization(tt *testing.T) { } func TestDeploymentReviewEvent_GetRepo(tt *testing.T) { + tt.Parallel() d := &DeploymentReviewEvent{} d.GetRepo() d = nil @@ -6993,6 +7739,7 @@ func TestDeploymentReviewEvent_GetRepo(tt *testing.T) { } func TestDeploymentReviewEvent_GetRequester(tt *testing.T) { + tt.Parallel() d := &DeploymentReviewEvent{} d.GetRequester() d = nil @@ -7000,6 +7747,7 @@ func TestDeploymentReviewEvent_GetRequester(tt *testing.T) { } func TestDeploymentReviewEvent_GetSender(tt *testing.T) { + tt.Parallel() d := &DeploymentReviewEvent{} d.GetSender() d = nil @@ -7007,6 +7755,7 @@ func TestDeploymentReviewEvent_GetSender(tt *testing.T) { } func TestDeploymentReviewEvent_GetSince(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeploymentReviewEvent{Since: &zeroValue} d.GetSince() @@ -7017,6 +7766,7 @@ func TestDeploymentReviewEvent_GetSince(tt *testing.T) { } func TestDeploymentReviewEvent_GetWorkflowJobRun(tt *testing.T) { + tt.Parallel() d := &DeploymentReviewEvent{} d.GetWorkflowJobRun() d = nil @@ -7024,6 +7774,7 @@ func TestDeploymentReviewEvent_GetWorkflowJobRun(tt *testing.T) { } func TestDeploymentReviewEvent_GetWorkflowRun(tt *testing.T) { + tt.Parallel() d := &DeploymentReviewEvent{} d.GetWorkflowRun() d = nil @@ -7031,6 +7782,7 @@ func TestDeploymentReviewEvent_GetWorkflowRun(tt *testing.T) { } func TestDeploymentStatus_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp d := &DeploymentStatus{CreatedAt: &zeroValue} d.GetCreatedAt() @@ -7041,6 +7793,7 @@ func TestDeploymentStatus_GetCreatedAt(tt *testing.T) { } func TestDeploymentStatus_GetCreator(tt *testing.T) { + tt.Parallel() d := &DeploymentStatus{} d.GetCreator() d = nil @@ -7048,6 +7801,7 @@ func TestDeploymentStatus_GetCreator(tt *testing.T) { } func TestDeploymentStatus_GetDeploymentURL(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeploymentStatus{DeploymentURL: &zeroValue} d.GetDeploymentURL() @@ -7058,6 +7812,7 @@ func TestDeploymentStatus_GetDeploymentURL(tt *testing.T) { } func TestDeploymentStatus_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeploymentStatus{Description: &zeroValue} d.GetDescription() @@ -7068,6 +7823,7 @@ func TestDeploymentStatus_GetDescription(tt *testing.T) { } func TestDeploymentStatus_GetEnvironment(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeploymentStatus{Environment: &zeroValue} d.GetEnvironment() @@ -7078,6 +7834,7 @@ func TestDeploymentStatus_GetEnvironment(tt *testing.T) { } func TestDeploymentStatus_GetEnvironmentURL(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeploymentStatus{EnvironmentURL: &zeroValue} d.GetEnvironmentURL() @@ -7088,6 +7845,7 @@ func TestDeploymentStatus_GetEnvironmentURL(tt *testing.T) { } func TestDeploymentStatus_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 d := &DeploymentStatus{ID: &zeroValue} d.GetID() @@ -7098,6 +7856,7 @@ func TestDeploymentStatus_GetID(tt *testing.T) { } func TestDeploymentStatus_GetLogURL(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeploymentStatus{LogURL: &zeroValue} d.GetLogURL() @@ -7108,6 +7867,7 @@ func TestDeploymentStatus_GetLogURL(tt *testing.T) { } func TestDeploymentStatus_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeploymentStatus{NodeID: &zeroValue} d.GetNodeID() @@ -7118,6 +7878,7 @@ func TestDeploymentStatus_GetNodeID(tt *testing.T) { } func TestDeploymentStatus_GetRepositoryURL(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeploymentStatus{RepositoryURL: &zeroValue} d.GetRepositoryURL() @@ -7128,6 +7889,7 @@ func TestDeploymentStatus_GetRepositoryURL(tt *testing.T) { } func TestDeploymentStatus_GetState(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeploymentStatus{State: &zeroValue} d.GetState() @@ -7138,6 +7900,7 @@ func TestDeploymentStatus_GetState(tt *testing.T) { } func TestDeploymentStatus_GetTargetURL(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeploymentStatus{TargetURL: &zeroValue} d.GetTargetURL() @@ -7148,6 +7911,7 @@ func TestDeploymentStatus_GetTargetURL(tt *testing.T) { } func TestDeploymentStatus_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp d := &DeploymentStatus{UpdatedAt: &zeroValue} d.GetUpdatedAt() @@ -7158,6 +7922,7 @@ func TestDeploymentStatus_GetUpdatedAt(tt *testing.T) { } func TestDeploymentStatus_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeploymentStatus{URL: &zeroValue} d.GetURL() @@ -7168,6 +7933,7 @@ func TestDeploymentStatus_GetURL(tt *testing.T) { } func TestDeploymentStatusEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeploymentStatusEvent{Action: &zeroValue} d.GetAction() @@ -7178,6 +7944,7 @@ func TestDeploymentStatusEvent_GetAction(tt *testing.T) { } func TestDeploymentStatusEvent_GetDeployment(tt *testing.T) { + tt.Parallel() d := &DeploymentStatusEvent{} d.GetDeployment() d = nil @@ -7185,6 +7952,7 @@ func TestDeploymentStatusEvent_GetDeployment(tt *testing.T) { } func TestDeploymentStatusEvent_GetDeploymentStatus(tt *testing.T) { + tt.Parallel() d := &DeploymentStatusEvent{} d.GetDeploymentStatus() d = nil @@ -7192,6 +7960,7 @@ func TestDeploymentStatusEvent_GetDeploymentStatus(tt *testing.T) { } func TestDeploymentStatusEvent_GetInstallation(tt *testing.T) { + tt.Parallel() d := &DeploymentStatusEvent{} d.GetInstallation() d = nil @@ -7199,6 +7968,7 @@ func TestDeploymentStatusEvent_GetInstallation(tt *testing.T) { } func TestDeploymentStatusEvent_GetOrg(tt *testing.T) { + tt.Parallel() d := &DeploymentStatusEvent{} d.GetOrg() d = nil @@ -7206,6 +7976,7 @@ func TestDeploymentStatusEvent_GetOrg(tt *testing.T) { } func TestDeploymentStatusEvent_GetRepo(tt *testing.T) { + tt.Parallel() d := &DeploymentStatusEvent{} d.GetRepo() d = nil @@ -7213,6 +7984,7 @@ func TestDeploymentStatusEvent_GetRepo(tt *testing.T) { } func TestDeploymentStatusEvent_GetSender(tt *testing.T) { + tt.Parallel() d := &DeploymentStatusEvent{} d.GetSender() d = nil @@ -7220,6 +7992,7 @@ func TestDeploymentStatusEvent_GetSender(tt *testing.T) { } func TestDeploymentStatusRequest_GetAutoInactive(tt *testing.T) { + tt.Parallel() var zeroValue bool d := &DeploymentStatusRequest{AutoInactive: &zeroValue} d.GetAutoInactive() @@ -7230,6 +8003,7 @@ func TestDeploymentStatusRequest_GetAutoInactive(tt *testing.T) { } func TestDeploymentStatusRequest_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeploymentStatusRequest{Description: &zeroValue} d.GetDescription() @@ -7240,6 +8014,7 @@ func TestDeploymentStatusRequest_GetDescription(tt *testing.T) { } func TestDeploymentStatusRequest_GetEnvironment(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeploymentStatusRequest{Environment: &zeroValue} d.GetEnvironment() @@ -7250,6 +8025,7 @@ func TestDeploymentStatusRequest_GetEnvironment(tt *testing.T) { } func TestDeploymentStatusRequest_GetEnvironmentURL(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeploymentStatusRequest{EnvironmentURL: &zeroValue} d.GetEnvironmentURL() @@ -7260,6 +8036,7 @@ func TestDeploymentStatusRequest_GetEnvironmentURL(tt *testing.T) { } func TestDeploymentStatusRequest_GetLogURL(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeploymentStatusRequest{LogURL: &zeroValue} d.GetLogURL() @@ -7270,6 +8047,7 @@ func TestDeploymentStatusRequest_GetLogURL(tt *testing.T) { } func TestDeploymentStatusRequest_GetState(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DeploymentStatusRequest{State: &zeroValue} d.GetState() @@ -7280,6 +8058,7 @@ func TestDeploymentStatusRequest_GetState(tt *testing.T) { } func TestDiscussion_GetActiveLockReason(tt *testing.T) { + tt.Parallel() var zeroValue string d := &Discussion{ActiveLockReason: &zeroValue} d.GetActiveLockReason() @@ -7290,6 +8069,7 @@ func TestDiscussion_GetActiveLockReason(tt *testing.T) { } func TestDiscussion_GetAnswerChosenAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp d := &Discussion{AnswerChosenAt: &zeroValue} d.GetAnswerChosenAt() @@ -7300,6 +8080,7 @@ func TestDiscussion_GetAnswerChosenAt(tt *testing.T) { } func TestDiscussion_GetAnswerChosenBy(tt *testing.T) { + tt.Parallel() var zeroValue string d := &Discussion{AnswerChosenBy: &zeroValue} d.GetAnswerChosenBy() @@ -7310,6 +8091,7 @@ func TestDiscussion_GetAnswerChosenBy(tt *testing.T) { } func TestDiscussion_GetAnswerHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string d := &Discussion{AnswerHTMLURL: &zeroValue} d.GetAnswerHTMLURL() @@ -7320,6 +8102,7 @@ func TestDiscussion_GetAnswerHTMLURL(tt *testing.T) { } func TestDiscussion_GetAuthorAssociation(tt *testing.T) { + tt.Parallel() var zeroValue string d := &Discussion{AuthorAssociation: &zeroValue} d.GetAuthorAssociation() @@ -7330,6 +8113,7 @@ func TestDiscussion_GetAuthorAssociation(tt *testing.T) { } func TestDiscussion_GetBody(tt *testing.T) { + tt.Parallel() var zeroValue string d := &Discussion{Body: &zeroValue} d.GetBody() @@ -7340,6 +8124,7 @@ func TestDiscussion_GetBody(tt *testing.T) { } func TestDiscussion_GetComments(tt *testing.T) { + tt.Parallel() var zeroValue int d := &Discussion{Comments: &zeroValue} d.GetComments() @@ -7350,6 +8135,7 @@ func TestDiscussion_GetComments(tt *testing.T) { } func TestDiscussion_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp d := &Discussion{CreatedAt: &zeroValue} d.GetCreatedAt() @@ -7360,6 +8146,7 @@ func TestDiscussion_GetCreatedAt(tt *testing.T) { } func TestDiscussion_GetDiscussionCategory(tt *testing.T) { + tt.Parallel() d := &Discussion{} d.GetDiscussionCategory() d = nil @@ -7367,6 +8154,7 @@ func TestDiscussion_GetDiscussionCategory(tt *testing.T) { } func TestDiscussion_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string d := &Discussion{HTMLURL: &zeroValue} d.GetHTMLURL() @@ -7377,6 +8165,7 @@ func TestDiscussion_GetHTMLURL(tt *testing.T) { } func TestDiscussion_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 d := &Discussion{ID: &zeroValue} d.GetID() @@ -7387,6 +8176,7 @@ func TestDiscussion_GetID(tt *testing.T) { } func TestDiscussion_GetLocked(tt *testing.T) { + tt.Parallel() var zeroValue bool d := &Discussion{Locked: &zeroValue} d.GetLocked() @@ -7397,6 +8187,7 @@ func TestDiscussion_GetLocked(tt *testing.T) { } func TestDiscussion_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string d := &Discussion{NodeID: &zeroValue} d.GetNodeID() @@ -7407,6 +8198,7 @@ func TestDiscussion_GetNodeID(tt *testing.T) { } func TestDiscussion_GetNumber(tt *testing.T) { + tt.Parallel() var zeroValue int d := &Discussion{Number: &zeroValue} d.GetNumber() @@ -7417,6 +8209,7 @@ func TestDiscussion_GetNumber(tt *testing.T) { } func TestDiscussion_GetRepositoryURL(tt *testing.T) { + tt.Parallel() var zeroValue string d := &Discussion{RepositoryURL: &zeroValue} d.GetRepositoryURL() @@ -7427,6 +8220,7 @@ func TestDiscussion_GetRepositoryURL(tt *testing.T) { } func TestDiscussion_GetState(tt *testing.T) { + tt.Parallel() var zeroValue string d := &Discussion{State: &zeroValue} d.GetState() @@ -7437,6 +8231,7 @@ func TestDiscussion_GetState(tt *testing.T) { } func TestDiscussion_GetTitle(tt *testing.T) { + tt.Parallel() var zeroValue string d := &Discussion{Title: &zeroValue} d.GetTitle() @@ -7447,6 +8242,7 @@ func TestDiscussion_GetTitle(tt *testing.T) { } func TestDiscussion_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp d := &Discussion{UpdatedAt: &zeroValue} d.GetUpdatedAt() @@ -7457,6 +8253,7 @@ func TestDiscussion_GetUpdatedAt(tt *testing.T) { } func TestDiscussion_GetUser(tt *testing.T) { + tt.Parallel() d := &Discussion{} d.GetUser() d = nil @@ -7464,6 +8261,7 @@ func TestDiscussion_GetUser(tt *testing.T) { } func TestDiscussionCategory_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp d := &DiscussionCategory{CreatedAt: &zeroValue} d.GetCreatedAt() @@ -7474,6 +8272,7 @@ func TestDiscussionCategory_GetCreatedAt(tt *testing.T) { } func TestDiscussionCategory_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DiscussionCategory{Description: &zeroValue} d.GetDescription() @@ -7484,6 +8283,7 @@ func TestDiscussionCategory_GetDescription(tt *testing.T) { } func TestDiscussionCategory_GetEmoji(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DiscussionCategory{Emoji: &zeroValue} d.GetEmoji() @@ -7494,6 +8294,7 @@ func TestDiscussionCategory_GetEmoji(tt *testing.T) { } func TestDiscussionCategory_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 d := &DiscussionCategory{ID: &zeroValue} d.GetID() @@ -7504,6 +8305,7 @@ func TestDiscussionCategory_GetID(tt *testing.T) { } func TestDiscussionCategory_GetIsAnswerable(tt *testing.T) { + tt.Parallel() var zeroValue bool d := &DiscussionCategory{IsAnswerable: &zeroValue} d.GetIsAnswerable() @@ -7514,6 +8316,7 @@ func TestDiscussionCategory_GetIsAnswerable(tt *testing.T) { } func TestDiscussionCategory_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DiscussionCategory{Name: &zeroValue} d.GetName() @@ -7524,6 +8327,7 @@ func TestDiscussionCategory_GetName(tt *testing.T) { } func TestDiscussionCategory_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DiscussionCategory{NodeID: &zeroValue} d.GetNodeID() @@ -7534,6 +8338,7 @@ func TestDiscussionCategory_GetNodeID(tt *testing.T) { } func TestDiscussionCategory_GetRepositoryID(tt *testing.T) { + tt.Parallel() var zeroValue int64 d := &DiscussionCategory{RepositoryID: &zeroValue} d.GetRepositoryID() @@ -7544,6 +8349,7 @@ func TestDiscussionCategory_GetRepositoryID(tt *testing.T) { } func TestDiscussionCategory_GetSlug(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DiscussionCategory{Slug: &zeroValue} d.GetSlug() @@ -7554,6 +8360,7 @@ func TestDiscussionCategory_GetSlug(tt *testing.T) { } func TestDiscussionCategory_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp d := &DiscussionCategory{UpdatedAt: &zeroValue} d.GetUpdatedAt() @@ -7564,6 +8371,7 @@ func TestDiscussionCategory_GetUpdatedAt(tt *testing.T) { } func TestDiscussionComment_GetAuthor(tt *testing.T) { + tt.Parallel() d := &DiscussionComment{} d.GetAuthor() d = nil @@ -7571,6 +8379,7 @@ func TestDiscussionComment_GetAuthor(tt *testing.T) { } func TestDiscussionComment_GetBody(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DiscussionComment{Body: &zeroValue} d.GetBody() @@ -7581,6 +8390,7 @@ func TestDiscussionComment_GetBody(tt *testing.T) { } func TestDiscussionComment_GetBodyHTML(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DiscussionComment{BodyHTML: &zeroValue} d.GetBodyHTML() @@ -7591,6 +8401,7 @@ func TestDiscussionComment_GetBodyHTML(tt *testing.T) { } func TestDiscussionComment_GetBodyVersion(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DiscussionComment{BodyVersion: &zeroValue} d.GetBodyVersion() @@ -7601,6 +8412,7 @@ func TestDiscussionComment_GetBodyVersion(tt *testing.T) { } func TestDiscussionComment_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp d := &DiscussionComment{CreatedAt: &zeroValue} d.GetCreatedAt() @@ -7611,6 +8423,7 @@ func TestDiscussionComment_GetCreatedAt(tt *testing.T) { } func TestDiscussionComment_GetDiscussionURL(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DiscussionComment{DiscussionURL: &zeroValue} d.GetDiscussionURL() @@ -7621,6 +8434,7 @@ func TestDiscussionComment_GetDiscussionURL(tt *testing.T) { } func TestDiscussionComment_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DiscussionComment{HTMLURL: &zeroValue} d.GetHTMLURL() @@ -7631,6 +8445,7 @@ func TestDiscussionComment_GetHTMLURL(tt *testing.T) { } func TestDiscussionComment_GetLastEditedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp d := &DiscussionComment{LastEditedAt: &zeroValue} d.GetLastEditedAt() @@ -7641,6 +8456,7 @@ func TestDiscussionComment_GetLastEditedAt(tt *testing.T) { } func TestDiscussionComment_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DiscussionComment{NodeID: &zeroValue} d.GetNodeID() @@ -7651,6 +8467,7 @@ func TestDiscussionComment_GetNodeID(tt *testing.T) { } func TestDiscussionComment_GetNumber(tt *testing.T) { + tt.Parallel() var zeroValue int d := &DiscussionComment{Number: &zeroValue} d.GetNumber() @@ -7661,6 +8478,7 @@ func TestDiscussionComment_GetNumber(tt *testing.T) { } func TestDiscussionComment_GetReactions(tt *testing.T) { + tt.Parallel() d := &DiscussionComment{} d.GetReactions() d = nil @@ -7668,6 +8486,7 @@ func TestDiscussionComment_GetReactions(tt *testing.T) { } func TestDiscussionComment_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp d := &DiscussionComment{UpdatedAt: &zeroValue} d.GetUpdatedAt() @@ -7678,6 +8497,7 @@ func TestDiscussionComment_GetUpdatedAt(tt *testing.T) { } func TestDiscussionComment_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DiscussionComment{URL: &zeroValue} d.GetURL() @@ -7688,6 +8508,7 @@ func TestDiscussionComment_GetURL(tt *testing.T) { } func TestDiscussionCommentEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DiscussionCommentEvent{Action: &zeroValue} d.GetAction() @@ -7698,6 +8519,7 @@ func TestDiscussionCommentEvent_GetAction(tt *testing.T) { } func TestDiscussionCommentEvent_GetComment(tt *testing.T) { + tt.Parallel() d := &DiscussionCommentEvent{} d.GetComment() d = nil @@ -7705,6 +8527,7 @@ func TestDiscussionCommentEvent_GetComment(tt *testing.T) { } func TestDiscussionCommentEvent_GetDiscussion(tt *testing.T) { + tt.Parallel() d := &DiscussionCommentEvent{} d.GetDiscussion() d = nil @@ -7712,6 +8535,7 @@ func TestDiscussionCommentEvent_GetDiscussion(tt *testing.T) { } func TestDiscussionCommentEvent_GetInstallation(tt *testing.T) { + tt.Parallel() d := &DiscussionCommentEvent{} d.GetInstallation() d = nil @@ -7719,6 +8543,7 @@ func TestDiscussionCommentEvent_GetInstallation(tt *testing.T) { } func TestDiscussionCommentEvent_GetOrg(tt *testing.T) { + tt.Parallel() d := &DiscussionCommentEvent{} d.GetOrg() d = nil @@ -7726,6 +8551,7 @@ func TestDiscussionCommentEvent_GetOrg(tt *testing.T) { } func TestDiscussionCommentEvent_GetRepo(tt *testing.T) { + tt.Parallel() d := &DiscussionCommentEvent{} d.GetRepo() d = nil @@ -7733,6 +8559,7 @@ func TestDiscussionCommentEvent_GetRepo(tt *testing.T) { } func TestDiscussionCommentEvent_GetSender(tt *testing.T) { + tt.Parallel() d := &DiscussionCommentEvent{} d.GetSender() d = nil @@ -7740,6 +8567,7 @@ func TestDiscussionCommentEvent_GetSender(tt *testing.T) { } func TestDiscussionEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DiscussionEvent{Action: &zeroValue} d.GetAction() @@ -7750,6 +8578,7 @@ func TestDiscussionEvent_GetAction(tt *testing.T) { } func TestDiscussionEvent_GetDiscussion(tt *testing.T) { + tt.Parallel() d := &DiscussionEvent{} d.GetDiscussion() d = nil @@ -7757,6 +8586,7 @@ func TestDiscussionEvent_GetDiscussion(tt *testing.T) { } func TestDiscussionEvent_GetInstallation(tt *testing.T) { + tt.Parallel() d := &DiscussionEvent{} d.GetInstallation() d = nil @@ -7764,6 +8594,7 @@ func TestDiscussionEvent_GetInstallation(tt *testing.T) { } func TestDiscussionEvent_GetOrg(tt *testing.T) { + tt.Parallel() d := &DiscussionEvent{} d.GetOrg() d = nil @@ -7771,6 +8602,7 @@ func TestDiscussionEvent_GetOrg(tt *testing.T) { } func TestDiscussionEvent_GetRepo(tt *testing.T) { + tt.Parallel() d := &DiscussionEvent{} d.GetRepo() d = nil @@ -7778,6 +8610,7 @@ func TestDiscussionEvent_GetRepo(tt *testing.T) { } func TestDiscussionEvent_GetSender(tt *testing.T) { + tt.Parallel() d := &DiscussionEvent{} d.GetSender() d = nil @@ -7785,6 +8618,7 @@ func TestDiscussionEvent_GetSender(tt *testing.T) { } func TestDismissalRestrictionsRequest_GetApps(tt *testing.T) { + tt.Parallel() var zeroValue []string d := &DismissalRestrictionsRequest{Apps: &zeroValue} d.GetApps() @@ -7795,6 +8629,7 @@ func TestDismissalRestrictionsRequest_GetApps(tt *testing.T) { } func TestDismissalRestrictionsRequest_GetTeams(tt *testing.T) { + tt.Parallel() var zeroValue []string d := &DismissalRestrictionsRequest{Teams: &zeroValue} d.GetTeams() @@ -7805,6 +8640,7 @@ func TestDismissalRestrictionsRequest_GetTeams(tt *testing.T) { } func TestDismissalRestrictionsRequest_GetUsers(tt *testing.T) { + tt.Parallel() var zeroValue []string d := &DismissalRestrictionsRequest{Users: &zeroValue} d.GetUsers() @@ -7815,6 +8651,7 @@ func TestDismissalRestrictionsRequest_GetUsers(tt *testing.T) { } func TestDismissedReview_GetDismissalCommitID(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DismissedReview{DismissalCommitID: &zeroValue} d.GetDismissalCommitID() @@ -7825,6 +8662,7 @@ func TestDismissedReview_GetDismissalCommitID(tt *testing.T) { } func TestDismissedReview_GetDismissalMessage(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DismissedReview{DismissalMessage: &zeroValue} d.GetDismissalMessage() @@ -7835,6 +8673,7 @@ func TestDismissedReview_GetDismissalMessage(tt *testing.T) { } func TestDismissedReview_GetReviewID(tt *testing.T) { + tt.Parallel() var zeroValue int64 d := &DismissedReview{ReviewID: &zeroValue} d.GetReviewID() @@ -7845,6 +8684,7 @@ func TestDismissedReview_GetReviewID(tt *testing.T) { } func TestDismissedReview_GetState(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DismissedReview{State: &zeroValue} d.GetState() @@ -7855,6 +8695,7 @@ func TestDismissedReview_GetState(tt *testing.T) { } func TestDismissStaleReviewsOnPushChanges_GetFrom(tt *testing.T) { + tt.Parallel() var zeroValue bool d := &DismissStaleReviewsOnPushChanges{From: &zeroValue} d.GetFrom() @@ -7865,6 +8706,7 @@ func TestDismissStaleReviewsOnPushChanges_GetFrom(tt *testing.T) { } func TestDispatchRequestOptions_GetClientPayload(tt *testing.T) { + tt.Parallel() var zeroValue json.RawMessage d := &DispatchRequestOptions{ClientPayload: &zeroValue} d.GetClientPayload() @@ -7875,6 +8717,7 @@ func TestDispatchRequestOptions_GetClientPayload(tt *testing.T) { } func TestDraftReviewComment_GetBody(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DraftReviewComment{Body: &zeroValue} d.GetBody() @@ -7885,6 +8728,7 @@ func TestDraftReviewComment_GetBody(tt *testing.T) { } func TestDraftReviewComment_GetLine(tt *testing.T) { + tt.Parallel() var zeroValue int d := &DraftReviewComment{Line: &zeroValue} d.GetLine() @@ -7895,6 +8739,7 @@ func TestDraftReviewComment_GetLine(tt *testing.T) { } func TestDraftReviewComment_GetPath(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DraftReviewComment{Path: &zeroValue} d.GetPath() @@ -7905,6 +8750,7 @@ func TestDraftReviewComment_GetPath(tt *testing.T) { } func TestDraftReviewComment_GetPosition(tt *testing.T) { + tt.Parallel() var zeroValue int d := &DraftReviewComment{Position: &zeroValue} d.GetPosition() @@ -7915,6 +8761,7 @@ func TestDraftReviewComment_GetPosition(tt *testing.T) { } func TestDraftReviewComment_GetSide(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DraftReviewComment{Side: &zeroValue} d.GetSide() @@ -7925,6 +8772,7 @@ func TestDraftReviewComment_GetSide(tt *testing.T) { } func TestDraftReviewComment_GetStartLine(tt *testing.T) { + tt.Parallel() var zeroValue int d := &DraftReviewComment{StartLine: &zeroValue} d.GetStartLine() @@ -7935,6 +8783,7 @@ func TestDraftReviewComment_GetStartLine(tt *testing.T) { } func TestDraftReviewComment_GetStartSide(tt *testing.T) { + tt.Parallel() var zeroValue string d := &DraftReviewComment{StartSide: &zeroValue} d.GetStartSide() @@ -7945,6 +8794,7 @@ func TestDraftReviewComment_GetStartSide(tt *testing.T) { } func TestEditBase_GetRef(tt *testing.T) { + tt.Parallel() e := &EditBase{} e.GetRef() e = nil @@ -7952,6 +8802,7 @@ func TestEditBase_GetRef(tt *testing.T) { } func TestEditBase_GetSHA(tt *testing.T) { + tt.Parallel() e := &EditBase{} e.GetSHA() e = nil @@ -7959,6 +8810,7 @@ func TestEditBase_GetSHA(tt *testing.T) { } func TestEditBody_GetFrom(tt *testing.T) { + tt.Parallel() var zeroValue string e := &EditBody{From: &zeroValue} e.GetFrom() @@ -7969,6 +8821,7 @@ func TestEditBody_GetFrom(tt *testing.T) { } func TestEditChange_GetBase(tt *testing.T) { + tt.Parallel() e := &EditChange{} e.GetBase() e = nil @@ -7976,6 +8829,7 @@ func TestEditChange_GetBase(tt *testing.T) { } func TestEditChange_GetBody(tt *testing.T) { + tt.Parallel() e := &EditChange{} e.GetBody() e = nil @@ -7983,6 +8837,7 @@ func TestEditChange_GetBody(tt *testing.T) { } func TestEditChange_GetDefaultBranch(tt *testing.T) { + tt.Parallel() e := &EditChange{} e.GetDefaultBranch() e = nil @@ -7990,6 +8845,7 @@ func TestEditChange_GetDefaultBranch(tt *testing.T) { } func TestEditChange_GetOwner(tt *testing.T) { + tt.Parallel() e := &EditChange{} e.GetOwner() e = nil @@ -7997,6 +8853,7 @@ func TestEditChange_GetOwner(tt *testing.T) { } func TestEditChange_GetRepo(tt *testing.T) { + tt.Parallel() e := &EditChange{} e.GetRepo() e = nil @@ -8004,6 +8861,7 @@ func TestEditChange_GetRepo(tt *testing.T) { } func TestEditChange_GetTitle(tt *testing.T) { + tt.Parallel() e := &EditChange{} e.GetTitle() e = nil @@ -8011,6 +8869,7 @@ func TestEditChange_GetTitle(tt *testing.T) { } func TestEditChange_GetTopics(tt *testing.T) { + tt.Parallel() e := &EditChange{} e.GetTopics() e = nil @@ -8018,6 +8877,7 @@ func TestEditChange_GetTopics(tt *testing.T) { } func TestEditDefaultBranch_GetFrom(tt *testing.T) { + tt.Parallel() var zeroValue string e := &EditDefaultBranch{From: &zeroValue} e.GetFrom() @@ -8028,6 +8888,7 @@ func TestEditDefaultBranch_GetFrom(tt *testing.T) { } func TestEditOwner_GetOwnerInfo(tt *testing.T) { + tt.Parallel() e := &EditOwner{} e.GetOwnerInfo() e = nil @@ -8035,6 +8896,7 @@ func TestEditOwner_GetOwnerInfo(tt *testing.T) { } func TestEditRef_GetFrom(tt *testing.T) { + tt.Parallel() var zeroValue string e := &EditRef{From: &zeroValue} e.GetFrom() @@ -8045,6 +8907,7 @@ func TestEditRef_GetFrom(tt *testing.T) { } func TestEditRepo_GetName(tt *testing.T) { + tt.Parallel() e := &EditRepo{} e.GetName() e = nil @@ -8052,6 +8915,7 @@ func TestEditRepo_GetName(tt *testing.T) { } func TestEditSHA_GetFrom(tt *testing.T) { + tt.Parallel() var zeroValue string e := &EditSHA{From: &zeroValue} e.GetFrom() @@ -8062,6 +8926,7 @@ func TestEditSHA_GetFrom(tt *testing.T) { } func TestEditTitle_GetFrom(tt *testing.T) { + tt.Parallel() var zeroValue string e := &EditTitle{From: &zeroValue} e.GetFrom() @@ -8072,6 +8937,7 @@ func TestEditTitle_GetFrom(tt *testing.T) { } func TestEnterprise_GetAvatarURL(tt *testing.T) { + tt.Parallel() var zeroValue string e := &Enterprise{AvatarURL: &zeroValue} e.GetAvatarURL() @@ -8082,6 +8948,7 @@ func TestEnterprise_GetAvatarURL(tt *testing.T) { } func TestEnterprise_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp e := &Enterprise{CreatedAt: &zeroValue} e.GetCreatedAt() @@ -8092,6 +8959,7 @@ func TestEnterprise_GetCreatedAt(tt *testing.T) { } func TestEnterprise_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string e := &Enterprise{Description: &zeroValue} e.GetDescription() @@ -8102,6 +8970,7 @@ func TestEnterprise_GetDescription(tt *testing.T) { } func TestEnterprise_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string e := &Enterprise{HTMLURL: &zeroValue} e.GetHTMLURL() @@ -8112,6 +8981,7 @@ func TestEnterprise_GetHTMLURL(tt *testing.T) { } func TestEnterprise_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int e := &Enterprise{ID: &zeroValue} e.GetID() @@ -8122,6 +8992,7 @@ func TestEnterprise_GetID(tt *testing.T) { } func TestEnterprise_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string e := &Enterprise{Name: &zeroValue} e.GetName() @@ -8132,6 +9003,7 @@ func TestEnterprise_GetName(tt *testing.T) { } func TestEnterprise_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string e := &Enterprise{NodeID: &zeroValue} e.GetNodeID() @@ -8142,6 +9014,7 @@ func TestEnterprise_GetNodeID(tt *testing.T) { } func TestEnterprise_GetSlug(tt *testing.T) { + tt.Parallel() var zeroValue string e := &Enterprise{Slug: &zeroValue} e.GetSlug() @@ -8152,6 +9025,7 @@ func TestEnterprise_GetSlug(tt *testing.T) { } func TestEnterprise_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp e := &Enterprise{UpdatedAt: &zeroValue} e.GetUpdatedAt() @@ -8162,6 +9036,7 @@ func TestEnterprise_GetUpdatedAt(tt *testing.T) { } func TestEnterprise_GetWebsiteURL(tt *testing.T) { + tt.Parallel() var zeroValue string e := &Enterprise{WebsiteURL: &zeroValue} e.GetWebsiteURL() @@ -8172,6 +9047,7 @@ func TestEnterprise_GetWebsiteURL(tt *testing.T) { } func TestEnterpriseRunnerGroup_GetAllowsPublicRepositories(tt *testing.T) { + tt.Parallel() var zeroValue bool e := &EnterpriseRunnerGroup{AllowsPublicRepositories: &zeroValue} e.GetAllowsPublicRepositories() @@ -8182,6 +9058,7 @@ func TestEnterpriseRunnerGroup_GetAllowsPublicRepositories(tt *testing.T) { } func TestEnterpriseRunnerGroup_GetDefault(tt *testing.T) { + tt.Parallel() var zeroValue bool e := &EnterpriseRunnerGroup{Default: &zeroValue} e.GetDefault() @@ -8192,6 +9069,7 @@ func TestEnterpriseRunnerGroup_GetDefault(tt *testing.T) { } func TestEnterpriseRunnerGroup_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 e := &EnterpriseRunnerGroup{ID: &zeroValue} e.GetID() @@ -8202,6 +9080,7 @@ func TestEnterpriseRunnerGroup_GetID(tt *testing.T) { } func TestEnterpriseRunnerGroup_GetInherited(tt *testing.T) { + tt.Parallel() var zeroValue bool e := &EnterpriseRunnerGroup{Inherited: &zeroValue} e.GetInherited() @@ -8212,6 +9091,7 @@ func TestEnterpriseRunnerGroup_GetInherited(tt *testing.T) { } func TestEnterpriseRunnerGroup_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string e := &EnterpriseRunnerGroup{Name: &zeroValue} e.GetName() @@ -8222,6 +9102,7 @@ func TestEnterpriseRunnerGroup_GetName(tt *testing.T) { } func TestEnterpriseRunnerGroup_GetRestrictedToWorkflows(tt *testing.T) { + tt.Parallel() var zeroValue bool e := &EnterpriseRunnerGroup{RestrictedToWorkflows: &zeroValue} e.GetRestrictedToWorkflows() @@ -8232,6 +9113,7 @@ func TestEnterpriseRunnerGroup_GetRestrictedToWorkflows(tt *testing.T) { } func TestEnterpriseRunnerGroup_GetRunnersURL(tt *testing.T) { + tt.Parallel() var zeroValue string e := &EnterpriseRunnerGroup{RunnersURL: &zeroValue} e.GetRunnersURL() @@ -8242,6 +9124,7 @@ func TestEnterpriseRunnerGroup_GetRunnersURL(tt *testing.T) { } func TestEnterpriseRunnerGroup_GetSelectedOrganizationsURL(tt *testing.T) { + tt.Parallel() var zeroValue string e := &EnterpriseRunnerGroup{SelectedOrganizationsURL: &zeroValue} e.GetSelectedOrganizationsURL() @@ -8252,6 +9135,7 @@ func TestEnterpriseRunnerGroup_GetSelectedOrganizationsURL(tt *testing.T) { } func TestEnterpriseRunnerGroup_GetVisibility(tt *testing.T) { + tt.Parallel() var zeroValue string e := &EnterpriseRunnerGroup{Visibility: &zeroValue} e.GetVisibility() @@ -8262,6 +9146,7 @@ func TestEnterpriseRunnerGroup_GetVisibility(tt *testing.T) { } func TestEnterpriseRunnerGroup_GetWorkflowRestrictionsReadOnly(tt *testing.T) { + tt.Parallel() var zeroValue bool e := &EnterpriseRunnerGroup{WorkflowRestrictionsReadOnly: &zeroValue} e.GetWorkflowRestrictionsReadOnly() @@ -8272,6 +9157,7 @@ func TestEnterpriseRunnerGroup_GetWorkflowRestrictionsReadOnly(tt *testing.T) { } func TestEnterpriseRunnerGroups_GetTotalCount(tt *testing.T) { + tt.Parallel() var zeroValue int e := &EnterpriseRunnerGroups{TotalCount: &zeroValue} e.GetTotalCount() @@ -8282,6 +9168,7 @@ func TestEnterpriseRunnerGroups_GetTotalCount(tt *testing.T) { } func TestEnterpriseSecurityAnalysisSettings_GetAdvancedSecurityEnabledForNewRepositories(tt *testing.T) { + tt.Parallel() var zeroValue bool e := &EnterpriseSecurityAnalysisSettings{AdvancedSecurityEnabledForNewRepositories: &zeroValue} e.GetAdvancedSecurityEnabledForNewRepositories() @@ -8292,6 +9179,7 @@ func TestEnterpriseSecurityAnalysisSettings_GetAdvancedSecurityEnabledForNewRepo } func TestEnterpriseSecurityAnalysisSettings_GetSecretScanningEnabledForNewRepositories(tt *testing.T) { + tt.Parallel() var zeroValue bool e := &EnterpriseSecurityAnalysisSettings{SecretScanningEnabledForNewRepositories: &zeroValue} e.GetSecretScanningEnabledForNewRepositories() @@ -8302,6 +9190,7 @@ func TestEnterpriseSecurityAnalysisSettings_GetSecretScanningEnabledForNewReposi } func TestEnterpriseSecurityAnalysisSettings_GetSecretScanningPushProtectionCustomLink(tt *testing.T) { + tt.Parallel() var zeroValue string e := &EnterpriseSecurityAnalysisSettings{SecretScanningPushProtectionCustomLink: &zeroValue} e.GetSecretScanningPushProtectionCustomLink() @@ -8312,6 +9201,7 @@ func TestEnterpriseSecurityAnalysisSettings_GetSecretScanningPushProtectionCusto } func TestEnterpriseSecurityAnalysisSettings_GetSecretScanningPushProtectionEnabledForNewRepositories(tt *testing.T) { + tt.Parallel() var zeroValue bool e := &EnterpriseSecurityAnalysisSettings{SecretScanningPushProtectionEnabledForNewRepositories: &zeroValue} e.GetSecretScanningPushProtectionEnabledForNewRepositories() @@ -8322,6 +9212,7 @@ func TestEnterpriseSecurityAnalysisSettings_GetSecretScanningPushProtectionEnabl } func TestEnterpriseSecurityAnalysisSettings_GetSecretScanningValidityChecksEnabled(tt *testing.T) { + tt.Parallel() var zeroValue bool e := &EnterpriseSecurityAnalysisSettings{SecretScanningValidityChecksEnabled: &zeroValue} e.GetSecretScanningValidityChecksEnabled() @@ -8332,6 +9223,7 @@ func TestEnterpriseSecurityAnalysisSettings_GetSecretScanningValidityChecksEnabl } func TestEnvironment_GetCanAdminsBypass(tt *testing.T) { + tt.Parallel() var zeroValue bool e := &Environment{CanAdminsBypass: &zeroValue} e.GetCanAdminsBypass() @@ -8342,6 +9234,7 @@ func TestEnvironment_GetCanAdminsBypass(tt *testing.T) { } func TestEnvironment_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp e := &Environment{CreatedAt: &zeroValue} e.GetCreatedAt() @@ -8352,6 +9245,7 @@ func TestEnvironment_GetCreatedAt(tt *testing.T) { } func TestEnvironment_GetDeploymentBranchPolicy(tt *testing.T) { + tt.Parallel() e := &Environment{} e.GetDeploymentBranchPolicy() e = nil @@ -8359,6 +9253,7 @@ func TestEnvironment_GetDeploymentBranchPolicy(tt *testing.T) { } func TestEnvironment_GetEnvironmentName(tt *testing.T) { + tt.Parallel() var zeroValue string e := &Environment{EnvironmentName: &zeroValue} e.GetEnvironmentName() @@ -8369,6 +9264,7 @@ func TestEnvironment_GetEnvironmentName(tt *testing.T) { } func TestEnvironment_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string e := &Environment{HTMLURL: &zeroValue} e.GetHTMLURL() @@ -8379,6 +9275,7 @@ func TestEnvironment_GetHTMLURL(tt *testing.T) { } func TestEnvironment_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 e := &Environment{ID: &zeroValue} e.GetID() @@ -8389,6 +9286,7 @@ func TestEnvironment_GetID(tt *testing.T) { } func TestEnvironment_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string e := &Environment{Name: &zeroValue} e.GetName() @@ -8399,6 +9297,7 @@ func TestEnvironment_GetName(tt *testing.T) { } func TestEnvironment_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string e := &Environment{NodeID: &zeroValue} e.GetNodeID() @@ -8409,6 +9308,7 @@ func TestEnvironment_GetNodeID(tt *testing.T) { } func TestEnvironment_GetOwner(tt *testing.T) { + tt.Parallel() var zeroValue string e := &Environment{Owner: &zeroValue} e.GetOwner() @@ -8419,6 +9319,7 @@ func TestEnvironment_GetOwner(tt *testing.T) { } func TestEnvironment_GetRepo(tt *testing.T) { + tt.Parallel() var zeroValue string e := &Environment{Repo: &zeroValue} e.GetRepo() @@ -8429,6 +9330,7 @@ func TestEnvironment_GetRepo(tt *testing.T) { } func TestEnvironment_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp e := &Environment{UpdatedAt: &zeroValue} e.GetUpdatedAt() @@ -8439,6 +9341,7 @@ func TestEnvironment_GetUpdatedAt(tt *testing.T) { } func TestEnvironment_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string e := &Environment{URL: &zeroValue} e.GetURL() @@ -8449,6 +9352,7 @@ func TestEnvironment_GetURL(tt *testing.T) { } func TestEnvironment_GetWaitTimer(tt *testing.T) { + tt.Parallel() var zeroValue int e := &Environment{WaitTimer: &zeroValue} e.GetWaitTimer() @@ -8459,6 +9363,7 @@ func TestEnvironment_GetWaitTimer(tt *testing.T) { } func TestEnvResponse_GetTotalCount(tt *testing.T) { + tt.Parallel() var zeroValue int e := &EnvResponse{TotalCount: &zeroValue} e.GetTotalCount() @@ -8469,6 +9374,7 @@ func TestEnvResponse_GetTotalCount(tt *testing.T) { } func TestEnvReviewers_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 e := &EnvReviewers{ID: &zeroValue} e.GetID() @@ -8479,6 +9385,7 @@ func TestEnvReviewers_GetID(tt *testing.T) { } func TestEnvReviewers_GetType(tt *testing.T) { + tt.Parallel() var zeroValue string e := &EnvReviewers{Type: &zeroValue} e.GetType() @@ -8489,6 +9396,7 @@ func TestEnvReviewers_GetType(tt *testing.T) { } func TestErrorBlock_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp e := &ErrorBlock{CreatedAt: &zeroValue} e.GetCreatedAt() @@ -8499,6 +9407,7 @@ func TestErrorBlock_GetCreatedAt(tt *testing.T) { } func TestErrorResponse_GetBlock(tt *testing.T) { + tt.Parallel() e := &ErrorResponse{} e.GetBlock() e = nil @@ -8506,6 +9415,7 @@ func TestErrorResponse_GetBlock(tt *testing.T) { } func TestEvent_GetActor(tt *testing.T) { + tt.Parallel() e := &Event{} e.GetActor() e = nil @@ -8513,6 +9423,7 @@ func TestEvent_GetActor(tt *testing.T) { } func TestEvent_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp e := &Event{CreatedAt: &zeroValue} e.GetCreatedAt() @@ -8523,6 +9434,7 @@ func TestEvent_GetCreatedAt(tt *testing.T) { } func TestEvent_GetID(tt *testing.T) { + tt.Parallel() var zeroValue string e := &Event{ID: &zeroValue} e.GetID() @@ -8533,6 +9445,7 @@ func TestEvent_GetID(tt *testing.T) { } func TestEvent_GetOrg(tt *testing.T) { + tt.Parallel() e := &Event{} e.GetOrg() e = nil @@ -8540,6 +9453,7 @@ func TestEvent_GetOrg(tt *testing.T) { } func TestEvent_GetPublic(tt *testing.T) { + tt.Parallel() var zeroValue bool e := &Event{Public: &zeroValue} e.GetPublic() @@ -8550,6 +9464,7 @@ func TestEvent_GetPublic(tt *testing.T) { } func TestEvent_GetRawPayload(tt *testing.T) { + tt.Parallel() var zeroValue json.RawMessage e := &Event{RawPayload: &zeroValue} e.GetRawPayload() @@ -8560,6 +9475,7 @@ func TestEvent_GetRawPayload(tt *testing.T) { } func TestEvent_GetRepo(tt *testing.T) { + tt.Parallel() e := &Event{} e.GetRepo() e = nil @@ -8567,6 +9483,7 @@ func TestEvent_GetRepo(tt *testing.T) { } func TestEvent_GetType(tt *testing.T) { + tt.Parallel() var zeroValue string e := &Event{Type: &zeroValue} e.GetType() @@ -8577,6 +9494,7 @@ func TestEvent_GetType(tt *testing.T) { } func TestExternalGroup_GetGroupID(tt *testing.T) { + tt.Parallel() var zeroValue int64 e := &ExternalGroup{GroupID: &zeroValue} e.GetGroupID() @@ -8587,6 +9505,7 @@ func TestExternalGroup_GetGroupID(tt *testing.T) { } func TestExternalGroup_GetGroupName(tt *testing.T) { + tt.Parallel() var zeroValue string e := &ExternalGroup{GroupName: &zeroValue} e.GetGroupName() @@ -8597,6 +9516,7 @@ func TestExternalGroup_GetGroupName(tt *testing.T) { } func TestExternalGroup_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp e := &ExternalGroup{UpdatedAt: &zeroValue} e.GetUpdatedAt() @@ -8607,6 +9527,7 @@ func TestExternalGroup_GetUpdatedAt(tt *testing.T) { } func TestExternalGroupMember_GetMemberEmail(tt *testing.T) { + tt.Parallel() var zeroValue string e := &ExternalGroupMember{MemberEmail: &zeroValue} e.GetMemberEmail() @@ -8617,6 +9538,7 @@ func TestExternalGroupMember_GetMemberEmail(tt *testing.T) { } func TestExternalGroupMember_GetMemberID(tt *testing.T) { + tt.Parallel() var zeroValue int64 e := &ExternalGroupMember{MemberID: &zeroValue} e.GetMemberID() @@ -8627,6 +9549,7 @@ func TestExternalGroupMember_GetMemberID(tt *testing.T) { } func TestExternalGroupMember_GetMemberLogin(tt *testing.T) { + tt.Parallel() var zeroValue string e := &ExternalGroupMember{MemberLogin: &zeroValue} e.GetMemberLogin() @@ -8637,6 +9560,7 @@ func TestExternalGroupMember_GetMemberLogin(tt *testing.T) { } func TestExternalGroupMember_GetMemberName(tt *testing.T) { + tt.Parallel() var zeroValue string e := &ExternalGroupMember{MemberName: &zeroValue} e.GetMemberName() @@ -8647,6 +9571,7 @@ func TestExternalGroupMember_GetMemberName(tt *testing.T) { } func TestExternalGroupTeam_GetTeamID(tt *testing.T) { + tt.Parallel() var zeroValue int64 e := &ExternalGroupTeam{TeamID: &zeroValue} e.GetTeamID() @@ -8657,6 +9582,7 @@ func TestExternalGroupTeam_GetTeamID(tt *testing.T) { } func TestExternalGroupTeam_GetTeamName(tt *testing.T) { + tt.Parallel() var zeroValue string e := &ExternalGroupTeam{TeamName: &zeroValue} e.GetTeamName() @@ -8667,6 +9593,7 @@ func TestExternalGroupTeam_GetTeamName(tt *testing.T) { } func TestFeedLink_GetHRef(tt *testing.T) { + tt.Parallel() var zeroValue string f := &FeedLink{HRef: &zeroValue} f.GetHRef() @@ -8677,6 +9604,7 @@ func TestFeedLink_GetHRef(tt *testing.T) { } func TestFeedLink_GetType(tt *testing.T) { + tt.Parallel() var zeroValue string f := &FeedLink{Type: &zeroValue} f.GetType() @@ -8687,6 +9615,7 @@ func TestFeedLink_GetType(tt *testing.T) { } func TestFeedLinks_GetCurrentUser(tt *testing.T) { + tt.Parallel() f := &FeedLinks{} f.GetCurrentUser() f = nil @@ -8694,6 +9623,7 @@ func TestFeedLinks_GetCurrentUser(tt *testing.T) { } func TestFeedLinks_GetCurrentUserActor(tt *testing.T) { + tt.Parallel() f := &FeedLinks{} f.GetCurrentUserActor() f = nil @@ -8701,6 +9631,7 @@ func TestFeedLinks_GetCurrentUserActor(tt *testing.T) { } func TestFeedLinks_GetCurrentUserOrganization(tt *testing.T) { + tt.Parallel() f := &FeedLinks{} f.GetCurrentUserOrganization() f = nil @@ -8708,6 +9639,7 @@ func TestFeedLinks_GetCurrentUserOrganization(tt *testing.T) { } func TestFeedLinks_GetCurrentUserPublic(tt *testing.T) { + tt.Parallel() f := &FeedLinks{} f.GetCurrentUserPublic() f = nil @@ -8715,6 +9647,7 @@ func TestFeedLinks_GetCurrentUserPublic(tt *testing.T) { } func TestFeedLinks_GetTimeline(tt *testing.T) { + tt.Parallel() f := &FeedLinks{} f.GetTimeline() f = nil @@ -8722,6 +9655,7 @@ func TestFeedLinks_GetTimeline(tt *testing.T) { } func TestFeedLinks_GetUser(tt *testing.T) { + tt.Parallel() f := &FeedLinks{} f.GetUser() f = nil @@ -8729,6 +9663,7 @@ func TestFeedLinks_GetUser(tt *testing.T) { } func TestFeeds_GetCurrentUserActorURL(tt *testing.T) { + tt.Parallel() var zeroValue string f := &Feeds{CurrentUserActorURL: &zeroValue} f.GetCurrentUserActorURL() @@ -8739,6 +9674,7 @@ func TestFeeds_GetCurrentUserActorURL(tt *testing.T) { } func TestFeeds_GetCurrentUserOrganizationURL(tt *testing.T) { + tt.Parallel() var zeroValue string f := &Feeds{CurrentUserOrganizationURL: &zeroValue} f.GetCurrentUserOrganizationURL() @@ -8749,6 +9685,7 @@ func TestFeeds_GetCurrentUserOrganizationURL(tt *testing.T) { } func TestFeeds_GetCurrentUserPublicURL(tt *testing.T) { + tt.Parallel() var zeroValue string f := &Feeds{CurrentUserPublicURL: &zeroValue} f.GetCurrentUserPublicURL() @@ -8759,6 +9696,7 @@ func TestFeeds_GetCurrentUserPublicURL(tt *testing.T) { } func TestFeeds_GetCurrentUserURL(tt *testing.T) { + tt.Parallel() var zeroValue string f := &Feeds{CurrentUserURL: &zeroValue} f.GetCurrentUserURL() @@ -8769,6 +9707,7 @@ func TestFeeds_GetCurrentUserURL(tt *testing.T) { } func TestFeeds_GetLinks(tt *testing.T) { + tt.Parallel() f := &Feeds{} f.GetLinks() f = nil @@ -8776,6 +9715,7 @@ func TestFeeds_GetLinks(tt *testing.T) { } func TestFeeds_GetTimelineURL(tt *testing.T) { + tt.Parallel() var zeroValue string f := &Feeds{TimelineURL: &zeroValue} f.GetTimelineURL() @@ -8786,6 +9726,7 @@ func TestFeeds_GetTimelineURL(tt *testing.T) { } func TestFeeds_GetUserURL(tt *testing.T) { + tt.Parallel() var zeroValue string f := &Feeds{UserURL: &zeroValue} f.GetUserURL() @@ -8796,6 +9737,7 @@ func TestFeeds_GetUserURL(tt *testing.T) { } func TestFirstPatchedVersion_GetIdentifier(tt *testing.T) { + tt.Parallel() var zeroValue string f := &FirstPatchedVersion{Identifier: &zeroValue} f.GetIdentifier() @@ -8806,6 +9748,7 @@ func TestFirstPatchedVersion_GetIdentifier(tt *testing.T) { } func TestForkEvent_GetForkee(tt *testing.T) { + tt.Parallel() f := &ForkEvent{} f.GetForkee() f = nil @@ -8813,6 +9756,7 @@ func TestForkEvent_GetForkee(tt *testing.T) { } func TestForkEvent_GetInstallation(tt *testing.T) { + tt.Parallel() f := &ForkEvent{} f.GetInstallation() f = nil @@ -8820,6 +9764,7 @@ func TestForkEvent_GetInstallation(tt *testing.T) { } func TestForkEvent_GetRepo(tt *testing.T) { + tt.Parallel() f := &ForkEvent{} f.GetRepo() f = nil @@ -8827,6 +9772,7 @@ func TestForkEvent_GetRepo(tt *testing.T) { } func TestForkEvent_GetSender(tt *testing.T) { + tt.Parallel() f := &ForkEvent{} f.GetSender() f = nil @@ -8834,6 +9780,7 @@ func TestForkEvent_GetSender(tt *testing.T) { } func TestGenerateJITConfigRequest_GetWorkFolder(tt *testing.T) { + tt.Parallel() var zeroValue string g := &GenerateJITConfigRequest{WorkFolder: &zeroValue} g.GetWorkFolder() @@ -8844,6 +9791,7 @@ func TestGenerateJITConfigRequest_GetWorkFolder(tt *testing.T) { } func TestGenerateNotesOptions_GetPreviousTagName(tt *testing.T) { + tt.Parallel() var zeroValue string g := &GenerateNotesOptions{PreviousTagName: &zeroValue} g.GetPreviousTagName() @@ -8854,6 +9802,7 @@ func TestGenerateNotesOptions_GetPreviousTagName(tt *testing.T) { } func TestGenerateNotesOptions_GetTargetCommitish(tt *testing.T) { + tt.Parallel() var zeroValue string g := &GenerateNotesOptions{TargetCommitish: &zeroValue} g.GetTargetCommitish() @@ -8864,6 +9813,7 @@ func TestGenerateNotesOptions_GetTargetCommitish(tt *testing.T) { } func TestGetAuditLogOptions_GetInclude(tt *testing.T) { + tt.Parallel() var zeroValue string g := &GetAuditLogOptions{Include: &zeroValue} g.GetInclude() @@ -8874,6 +9824,7 @@ func TestGetAuditLogOptions_GetInclude(tt *testing.T) { } func TestGetAuditLogOptions_GetOrder(tt *testing.T) { + tt.Parallel() var zeroValue string g := &GetAuditLogOptions{Order: &zeroValue} g.GetOrder() @@ -8884,6 +9835,7 @@ func TestGetAuditLogOptions_GetOrder(tt *testing.T) { } func TestGetAuditLogOptions_GetPhrase(tt *testing.T) { + tt.Parallel() var zeroValue string g := &GetAuditLogOptions{Phrase: &zeroValue} g.GetPhrase() @@ -8894,6 +9846,7 @@ func TestGetAuditLogOptions_GetPhrase(tt *testing.T) { } func TestGist_GetComments(tt *testing.T) { + tt.Parallel() var zeroValue int g := &Gist{Comments: &zeroValue} g.GetComments() @@ -8904,6 +9857,7 @@ func TestGist_GetComments(tt *testing.T) { } func TestGist_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp g := &Gist{CreatedAt: &zeroValue} g.GetCreatedAt() @@ -8914,6 +9868,7 @@ func TestGist_GetCreatedAt(tt *testing.T) { } func TestGist_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string g := &Gist{Description: &zeroValue} g.GetDescription() @@ -8924,6 +9879,7 @@ func TestGist_GetDescription(tt *testing.T) { } func TestGist_GetFiles(tt *testing.T) { + tt.Parallel() zeroValue := map[GistFilename]GistFile{} g := &Gist{Files: zeroValue} g.GetFiles() @@ -8934,6 +9890,7 @@ func TestGist_GetFiles(tt *testing.T) { } func TestGist_GetGitPullURL(tt *testing.T) { + tt.Parallel() var zeroValue string g := &Gist{GitPullURL: &zeroValue} g.GetGitPullURL() @@ -8944,6 +9901,7 @@ func TestGist_GetGitPullURL(tt *testing.T) { } func TestGist_GetGitPushURL(tt *testing.T) { + tt.Parallel() var zeroValue string g := &Gist{GitPushURL: &zeroValue} g.GetGitPushURL() @@ -8954,6 +9912,7 @@ func TestGist_GetGitPushURL(tt *testing.T) { } func TestGist_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string g := &Gist{HTMLURL: &zeroValue} g.GetHTMLURL() @@ -8964,6 +9923,7 @@ func TestGist_GetHTMLURL(tt *testing.T) { } func TestGist_GetID(tt *testing.T) { + tt.Parallel() var zeroValue string g := &Gist{ID: &zeroValue} g.GetID() @@ -8974,6 +9934,7 @@ func TestGist_GetID(tt *testing.T) { } func TestGist_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string g := &Gist{NodeID: &zeroValue} g.GetNodeID() @@ -8984,6 +9945,7 @@ func TestGist_GetNodeID(tt *testing.T) { } func TestGist_GetOwner(tt *testing.T) { + tt.Parallel() g := &Gist{} g.GetOwner() g = nil @@ -8991,6 +9953,7 @@ func TestGist_GetOwner(tt *testing.T) { } func TestGist_GetPublic(tt *testing.T) { + tt.Parallel() var zeroValue bool g := &Gist{Public: &zeroValue} g.GetPublic() @@ -9001,6 +9964,7 @@ func TestGist_GetPublic(tt *testing.T) { } func TestGist_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp g := &Gist{UpdatedAt: &zeroValue} g.GetUpdatedAt() @@ -9011,6 +9975,7 @@ func TestGist_GetUpdatedAt(tt *testing.T) { } func TestGistComment_GetBody(tt *testing.T) { + tt.Parallel() var zeroValue string g := &GistComment{Body: &zeroValue} g.GetBody() @@ -9021,6 +9986,7 @@ func TestGistComment_GetBody(tt *testing.T) { } func TestGistComment_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp g := &GistComment{CreatedAt: &zeroValue} g.GetCreatedAt() @@ -9031,6 +9997,7 @@ func TestGistComment_GetCreatedAt(tt *testing.T) { } func TestGistComment_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 g := &GistComment{ID: &zeroValue} g.GetID() @@ -9041,6 +10008,7 @@ func TestGistComment_GetID(tt *testing.T) { } func TestGistComment_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string g := &GistComment{URL: &zeroValue} g.GetURL() @@ -9051,6 +10019,7 @@ func TestGistComment_GetURL(tt *testing.T) { } func TestGistComment_GetUser(tt *testing.T) { + tt.Parallel() g := &GistComment{} g.GetUser() g = nil @@ -9058,6 +10027,7 @@ func TestGistComment_GetUser(tt *testing.T) { } func TestGistCommit_GetChangeStatus(tt *testing.T) { + tt.Parallel() g := &GistCommit{} g.GetChangeStatus() g = nil @@ -9065,6 +10035,7 @@ func TestGistCommit_GetChangeStatus(tt *testing.T) { } func TestGistCommit_GetCommittedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp g := &GistCommit{CommittedAt: &zeroValue} g.GetCommittedAt() @@ -9075,6 +10046,7 @@ func TestGistCommit_GetCommittedAt(tt *testing.T) { } func TestGistCommit_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string g := &GistCommit{NodeID: &zeroValue} g.GetNodeID() @@ -9085,6 +10057,7 @@ func TestGistCommit_GetNodeID(tt *testing.T) { } func TestGistCommit_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string g := &GistCommit{URL: &zeroValue} g.GetURL() @@ -9095,6 +10068,7 @@ func TestGistCommit_GetURL(tt *testing.T) { } func TestGistCommit_GetUser(tt *testing.T) { + tt.Parallel() g := &GistCommit{} g.GetUser() g = nil @@ -9102,6 +10076,7 @@ func TestGistCommit_GetUser(tt *testing.T) { } func TestGistCommit_GetVersion(tt *testing.T) { + tt.Parallel() var zeroValue string g := &GistCommit{Version: &zeroValue} g.GetVersion() @@ -9112,6 +10087,7 @@ func TestGistCommit_GetVersion(tt *testing.T) { } func TestGistFile_GetContent(tt *testing.T) { + tt.Parallel() var zeroValue string g := &GistFile{Content: &zeroValue} g.GetContent() @@ -9122,6 +10098,7 @@ func TestGistFile_GetContent(tt *testing.T) { } func TestGistFile_GetFilename(tt *testing.T) { + tt.Parallel() var zeroValue string g := &GistFile{Filename: &zeroValue} g.GetFilename() @@ -9132,6 +10109,7 @@ func TestGistFile_GetFilename(tt *testing.T) { } func TestGistFile_GetLanguage(tt *testing.T) { + tt.Parallel() var zeroValue string g := &GistFile{Language: &zeroValue} g.GetLanguage() @@ -9142,6 +10120,7 @@ func TestGistFile_GetLanguage(tt *testing.T) { } func TestGistFile_GetRawURL(tt *testing.T) { + tt.Parallel() var zeroValue string g := &GistFile{RawURL: &zeroValue} g.GetRawURL() @@ -9152,6 +10131,7 @@ func TestGistFile_GetRawURL(tt *testing.T) { } func TestGistFile_GetSize(tt *testing.T) { + tt.Parallel() var zeroValue int g := &GistFile{Size: &zeroValue} g.GetSize() @@ -9162,6 +10142,7 @@ func TestGistFile_GetSize(tt *testing.T) { } func TestGistFile_GetType(tt *testing.T) { + tt.Parallel() var zeroValue string g := &GistFile{Type: &zeroValue} g.GetType() @@ -9172,6 +10153,7 @@ func TestGistFile_GetType(tt *testing.T) { } func TestGistFork_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp g := &GistFork{CreatedAt: &zeroValue} g.GetCreatedAt() @@ -9182,6 +10164,7 @@ func TestGistFork_GetCreatedAt(tt *testing.T) { } func TestGistFork_GetID(tt *testing.T) { + tt.Parallel() var zeroValue string g := &GistFork{ID: &zeroValue} g.GetID() @@ -9192,6 +10175,7 @@ func TestGistFork_GetID(tt *testing.T) { } func TestGistFork_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string g := &GistFork{NodeID: &zeroValue} g.GetNodeID() @@ -9202,6 +10186,7 @@ func TestGistFork_GetNodeID(tt *testing.T) { } func TestGistFork_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp g := &GistFork{UpdatedAt: &zeroValue} g.GetUpdatedAt() @@ -9212,6 +10197,7 @@ func TestGistFork_GetUpdatedAt(tt *testing.T) { } func TestGistFork_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string g := &GistFork{URL: &zeroValue} g.GetURL() @@ -9222,6 +10208,7 @@ func TestGistFork_GetURL(tt *testing.T) { } func TestGistFork_GetUser(tt *testing.T) { + tt.Parallel() g := &GistFork{} g.GetUser() g = nil @@ -9229,6 +10216,7 @@ func TestGistFork_GetUser(tt *testing.T) { } func TestGistStats_GetPrivateGists(tt *testing.T) { + tt.Parallel() var zeroValue int g := &GistStats{PrivateGists: &zeroValue} g.GetPrivateGists() @@ -9239,6 +10227,7 @@ func TestGistStats_GetPrivateGists(tt *testing.T) { } func TestGistStats_GetPublicGists(tt *testing.T) { + tt.Parallel() var zeroValue int g := &GistStats{PublicGists: &zeroValue} g.GetPublicGists() @@ -9249,6 +10238,7 @@ func TestGistStats_GetPublicGists(tt *testing.T) { } func TestGistStats_GetTotalGists(tt *testing.T) { + tt.Parallel() var zeroValue int g := &GistStats{TotalGists: &zeroValue} g.GetTotalGists() @@ -9259,6 +10249,7 @@ func TestGistStats_GetTotalGists(tt *testing.T) { } func TestGitHubAppAuthorizationEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string g := &GitHubAppAuthorizationEvent{Action: &zeroValue} g.GetAction() @@ -9269,6 +10260,7 @@ func TestGitHubAppAuthorizationEvent_GetAction(tt *testing.T) { } func TestGitHubAppAuthorizationEvent_GetInstallation(tt *testing.T) { + tt.Parallel() g := &GitHubAppAuthorizationEvent{} g.GetInstallation() g = nil @@ -9276,6 +10268,7 @@ func TestGitHubAppAuthorizationEvent_GetInstallation(tt *testing.T) { } func TestGitHubAppAuthorizationEvent_GetSender(tt *testing.T) { + tt.Parallel() g := &GitHubAppAuthorizationEvent{} g.GetSender() g = nil @@ -9283,6 +10276,7 @@ func TestGitHubAppAuthorizationEvent_GetSender(tt *testing.T) { } func TestGitignore_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string g := &Gitignore{Name: &zeroValue} g.GetName() @@ -9293,6 +10287,7 @@ func TestGitignore_GetName(tt *testing.T) { } func TestGitignore_GetSource(tt *testing.T) { + tt.Parallel() var zeroValue string g := &Gitignore{Source: &zeroValue} g.GetSource() @@ -9303,6 +10298,7 @@ func TestGitignore_GetSource(tt *testing.T) { } func TestGitObject_GetSHA(tt *testing.T) { + tt.Parallel() var zeroValue string g := &GitObject{SHA: &zeroValue} g.GetSHA() @@ -9313,6 +10309,7 @@ func TestGitObject_GetSHA(tt *testing.T) { } func TestGitObject_GetType(tt *testing.T) { + tt.Parallel() var zeroValue string g := &GitObject{Type: &zeroValue} g.GetType() @@ -9323,6 +10320,7 @@ func TestGitObject_GetType(tt *testing.T) { } func TestGitObject_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string g := &GitObject{URL: &zeroValue} g.GetURL() @@ -9333,6 +10331,7 @@ func TestGitObject_GetURL(tt *testing.T) { } func TestGlobalSecurityAdvisory_GetGithubReviewedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp g := &GlobalSecurityAdvisory{GithubReviewedAt: &zeroValue} g.GetGithubReviewedAt() @@ -9343,6 +10342,7 @@ func TestGlobalSecurityAdvisory_GetGithubReviewedAt(tt *testing.T) { } func TestGlobalSecurityAdvisory_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 g := &GlobalSecurityAdvisory{ID: &zeroValue} g.GetID() @@ -9353,6 +10353,7 @@ func TestGlobalSecurityAdvisory_GetID(tt *testing.T) { } func TestGlobalSecurityAdvisory_GetNVDPublishedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp g := &GlobalSecurityAdvisory{NVDPublishedAt: &zeroValue} g.GetNVDPublishedAt() @@ -9363,6 +10364,7 @@ func TestGlobalSecurityAdvisory_GetNVDPublishedAt(tt *testing.T) { } func TestGlobalSecurityAdvisory_GetRepositoryAdvisoryURL(tt *testing.T) { + tt.Parallel() var zeroValue string g := &GlobalSecurityAdvisory{RepositoryAdvisoryURL: &zeroValue} g.GetRepositoryAdvisoryURL() @@ -9373,6 +10375,7 @@ func TestGlobalSecurityAdvisory_GetRepositoryAdvisoryURL(tt *testing.T) { } func TestGlobalSecurityAdvisory_GetSourceCodeLocation(tt *testing.T) { + tt.Parallel() var zeroValue string g := &GlobalSecurityAdvisory{SourceCodeLocation: &zeroValue} g.GetSourceCodeLocation() @@ -9383,6 +10386,7 @@ func TestGlobalSecurityAdvisory_GetSourceCodeLocation(tt *testing.T) { } func TestGlobalSecurityAdvisory_GetType(tt *testing.T) { + tt.Parallel() var zeroValue string g := &GlobalSecurityAdvisory{Type: &zeroValue} g.GetType() @@ -9393,6 +10397,7 @@ func TestGlobalSecurityAdvisory_GetType(tt *testing.T) { } func TestGlobalSecurityVulnerability_GetFirstPatchedVersion(tt *testing.T) { + tt.Parallel() var zeroValue string g := &GlobalSecurityVulnerability{FirstPatchedVersion: &zeroValue} g.GetFirstPatchedVersion() @@ -9403,6 +10408,7 @@ func TestGlobalSecurityVulnerability_GetFirstPatchedVersion(tt *testing.T) { } func TestGlobalSecurityVulnerability_GetPackage(tt *testing.T) { + tt.Parallel() g := &GlobalSecurityVulnerability{} g.GetPackage() g = nil @@ -9410,6 +10416,7 @@ func TestGlobalSecurityVulnerability_GetPackage(tt *testing.T) { } func TestGlobalSecurityVulnerability_GetVulnerableVersionRange(tt *testing.T) { + tt.Parallel() var zeroValue string g := &GlobalSecurityVulnerability{VulnerableVersionRange: &zeroValue} g.GetVulnerableVersionRange() @@ -9420,6 +10427,7 @@ func TestGlobalSecurityVulnerability_GetVulnerableVersionRange(tt *testing.T) { } func TestGollumEvent_GetInstallation(tt *testing.T) { + tt.Parallel() g := &GollumEvent{} g.GetInstallation() g = nil @@ -9427,6 +10435,7 @@ func TestGollumEvent_GetInstallation(tt *testing.T) { } func TestGollumEvent_GetOrg(tt *testing.T) { + tt.Parallel() g := &GollumEvent{} g.GetOrg() g = nil @@ -9434,6 +10443,7 @@ func TestGollumEvent_GetOrg(tt *testing.T) { } func TestGollumEvent_GetRepo(tt *testing.T) { + tt.Parallel() g := &GollumEvent{} g.GetRepo() g = nil @@ -9441,6 +10451,7 @@ func TestGollumEvent_GetRepo(tt *testing.T) { } func TestGollumEvent_GetSender(tt *testing.T) { + tt.Parallel() g := &GollumEvent{} g.GetSender() g = nil @@ -9448,6 +10459,7 @@ func TestGollumEvent_GetSender(tt *testing.T) { } func TestGPGEmail_GetEmail(tt *testing.T) { + tt.Parallel() var zeroValue string g := &GPGEmail{Email: &zeroValue} g.GetEmail() @@ -9458,6 +10470,7 @@ func TestGPGEmail_GetEmail(tt *testing.T) { } func TestGPGEmail_GetVerified(tt *testing.T) { + tt.Parallel() var zeroValue bool g := &GPGEmail{Verified: &zeroValue} g.GetVerified() @@ -9468,6 +10481,7 @@ func TestGPGEmail_GetVerified(tt *testing.T) { } func TestGPGKey_GetCanCertify(tt *testing.T) { + tt.Parallel() var zeroValue bool g := &GPGKey{CanCertify: &zeroValue} g.GetCanCertify() @@ -9478,6 +10492,7 @@ func TestGPGKey_GetCanCertify(tt *testing.T) { } func TestGPGKey_GetCanEncryptComms(tt *testing.T) { + tt.Parallel() var zeroValue bool g := &GPGKey{CanEncryptComms: &zeroValue} g.GetCanEncryptComms() @@ -9488,6 +10503,7 @@ func TestGPGKey_GetCanEncryptComms(tt *testing.T) { } func TestGPGKey_GetCanEncryptStorage(tt *testing.T) { + tt.Parallel() var zeroValue bool g := &GPGKey{CanEncryptStorage: &zeroValue} g.GetCanEncryptStorage() @@ -9498,6 +10514,7 @@ func TestGPGKey_GetCanEncryptStorage(tt *testing.T) { } func TestGPGKey_GetCanSign(tt *testing.T) { + tt.Parallel() var zeroValue bool g := &GPGKey{CanSign: &zeroValue} g.GetCanSign() @@ -9508,6 +10525,7 @@ func TestGPGKey_GetCanSign(tt *testing.T) { } func TestGPGKey_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp g := &GPGKey{CreatedAt: &zeroValue} g.GetCreatedAt() @@ -9518,6 +10536,7 @@ func TestGPGKey_GetCreatedAt(tt *testing.T) { } func TestGPGKey_GetExpiresAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp g := &GPGKey{ExpiresAt: &zeroValue} g.GetExpiresAt() @@ -9528,6 +10547,7 @@ func TestGPGKey_GetExpiresAt(tt *testing.T) { } func TestGPGKey_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 g := &GPGKey{ID: &zeroValue} g.GetID() @@ -9538,6 +10558,7 @@ func TestGPGKey_GetID(tt *testing.T) { } func TestGPGKey_GetKeyID(tt *testing.T) { + tt.Parallel() var zeroValue string g := &GPGKey{KeyID: &zeroValue} g.GetKeyID() @@ -9548,6 +10569,7 @@ func TestGPGKey_GetKeyID(tt *testing.T) { } func TestGPGKey_GetPrimaryKeyID(tt *testing.T) { + tt.Parallel() var zeroValue int64 g := &GPGKey{PrimaryKeyID: &zeroValue} g.GetPrimaryKeyID() @@ -9558,6 +10580,7 @@ func TestGPGKey_GetPrimaryKeyID(tt *testing.T) { } func TestGPGKey_GetPublicKey(tt *testing.T) { + tt.Parallel() var zeroValue string g := &GPGKey{PublicKey: &zeroValue} g.GetPublicKey() @@ -9568,6 +10591,7 @@ func TestGPGKey_GetPublicKey(tt *testing.T) { } func TestGPGKey_GetRawKey(tt *testing.T) { + tt.Parallel() var zeroValue string g := &GPGKey{RawKey: &zeroValue} g.GetRawKey() @@ -9578,6 +10602,7 @@ func TestGPGKey_GetRawKey(tt *testing.T) { } func TestGrant_GetApp(tt *testing.T) { + tt.Parallel() g := &Grant{} g.GetApp() g = nil @@ -9585,6 +10610,7 @@ func TestGrant_GetApp(tt *testing.T) { } func TestGrant_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp g := &Grant{CreatedAt: &zeroValue} g.GetCreatedAt() @@ -9595,6 +10621,7 @@ func TestGrant_GetCreatedAt(tt *testing.T) { } func TestGrant_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 g := &Grant{ID: &zeroValue} g.GetID() @@ -9605,6 +10632,7 @@ func TestGrant_GetID(tt *testing.T) { } func TestGrant_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp g := &Grant{UpdatedAt: &zeroValue} g.GetUpdatedAt() @@ -9615,6 +10643,7 @@ func TestGrant_GetUpdatedAt(tt *testing.T) { } func TestGrant_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string g := &Grant{URL: &zeroValue} g.GetURL() @@ -9625,6 +10654,7 @@ func TestGrant_GetURL(tt *testing.T) { } func TestHeadCommit_GetAuthor(tt *testing.T) { + tt.Parallel() h := &HeadCommit{} h.GetAuthor() h = nil @@ -9632,6 +10662,7 @@ func TestHeadCommit_GetAuthor(tt *testing.T) { } func TestHeadCommit_GetCommitter(tt *testing.T) { + tt.Parallel() h := &HeadCommit{} h.GetCommitter() h = nil @@ -9639,6 +10670,7 @@ func TestHeadCommit_GetCommitter(tt *testing.T) { } func TestHeadCommit_GetDistinct(tt *testing.T) { + tt.Parallel() var zeroValue bool h := &HeadCommit{Distinct: &zeroValue} h.GetDistinct() @@ -9649,6 +10681,7 @@ func TestHeadCommit_GetDistinct(tt *testing.T) { } func TestHeadCommit_GetID(tt *testing.T) { + tt.Parallel() var zeroValue string h := &HeadCommit{ID: &zeroValue} h.GetID() @@ -9659,6 +10692,7 @@ func TestHeadCommit_GetID(tt *testing.T) { } func TestHeadCommit_GetMessage(tt *testing.T) { + tt.Parallel() var zeroValue string h := &HeadCommit{Message: &zeroValue} h.GetMessage() @@ -9669,6 +10703,7 @@ func TestHeadCommit_GetMessage(tt *testing.T) { } func TestHeadCommit_GetSHA(tt *testing.T) { + tt.Parallel() var zeroValue string h := &HeadCommit{SHA: &zeroValue} h.GetSHA() @@ -9679,6 +10714,7 @@ func TestHeadCommit_GetSHA(tt *testing.T) { } func TestHeadCommit_GetTimestamp(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp h := &HeadCommit{Timestamp: &zeroValue} h.GetTimestamp() @@ -9689,6 +10725,7 @@ func TestHeadCommit_GetTimestamp(tt *testing.T) { } func TestHeadCommit_GetTreeID(tt *testing.T) { + tt.Parallel() var zeroValue string h := &HeadCommit{TreeID: &zeroValue} h.GetTreeID() @@ -9699,6 +10736,7 @@ func TestHeadCommit_GetTreeID(tt *testing.T) { } func TestHeadCommit_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string h := &HeadCommit{URL: &zeroValue} h.GetURL() @@ -9709,6 +10747,7 @@ func TestHeadCommit_GetURL(tt *testing.T) { } func TestHook_GetActive(tt *testing.T) { + tt.Parallel() var zeroValue bool h := &Hook{Active: &zeroValue} h.GetActive() @@ -9719,6 +10758,7 @@ func TestHook_GetActive(tt *testing.T) { } func TestHook_GetConfig(tt *testing.T) { + tt.Parallel() h := &Hook{} h.GetConfig() h = nil @@ -9726,6 +10766,7 @@ func TestHook_GetConfig(tt *testing.T) { } func TestHook_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp h := &Hook{CreatedAt: &zeroValue} h.GetCreatedAt() @@ -9736,6 +10777,7 @@ func TestHook_GetCreatedAt(tt *testing.T) { } func TestHook_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 h := &Hook{ID: &zeroValue} h.GetID() @@ -9746,6 +10788,7 @@ func TestHook_GetID(tt *testing.T) { } func TestHook_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string h := &Hook{Name: &zeroValue} h.GetName() @@ -9756,6 +10799,7 @@ func TestHook_GetName(tt *testing.T) { } func TestHook_GetPingURL(tt *testing.T) { + tt.Parallel() var zeroValue string h := &Hook{PingURL: &zeroValue} h.GetPingURL() @@ -9766,6 +10810,7 @@ func TestHook_GetPingURL(tt *testing.T) { } func TestHook_GetTestURL(tt *testing.T) { + tt.Parallel() var zeroValue string h := &Hook{TestURL: &zeroValue} h.GetTestURL() @@ -9776,6 +10821,7 @@ func TestHook_GetTestURL(tt *testing.T) { } func TestHook_GetType(tt *testing.T) { + tt.Parallel() var zeroValue string h := &Hook{Type: &zeroValue} h.GetType() @@ -9786,6 +10832,7 @@ func TestHook_GetType(tt *testing.T) { } func TestHook_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp h := &Hook{UpdatedAt: &zeroValue} h.GetUpdatedAt() @@ -9796,6 +10843,7 @@ func TestHook_GetUpdatedAt(tt *testing.T) { } func TestHook_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string h := &Hook{URL: &zeroValue} h.GetURL() @@ -9806,6 +10854,7 @@ func TestHook_GetURL(tt *testing.T) { } func TestHookConfig_GetContentType(tt *testing.T) { + tt.Parallel() var zeroValue string h := &HookConfig{ContentType: &zeroValue} h.GetContentType() @@ -9816,6 +10865,7 @@ func TestHookConfig_GetContentType(tt *testing.T) { } func TestHookConfig_GetInsecureSSL(tt *testing.T) { + tt.Parallel() var zeroValue string h := &HookConfig{InsecureSSL: &zeroValue} h.GetInsecureSSL() @@ -9826,6 +10876,7 @@ func TestHookConfig_GetInsecureSSL(tt *testing.T) { } func TestHookConfig_GetSecret(tt *testing.T) { + tt.Parallel() var zeroValue string h := &HookConfig{Secret: &zeroValue} h.GetSecret() @@ -9836,6 +10887,7 @@ func TestHookConfig_GetSecret(tt *testing.T) { } func TestHookConfig_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string h := &HookConfig{URL: &zeroValue} h.GetURL() @@ -9846,6 +10898,7 @@ func TestHookConfig_GetURL(tt *testing.T) { } func TestHookDelivery_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string h := &HookDelivery{Action: &zeroValue} h.GetAction() @@ -9856,6 +10909,7 @@ func TestHookDelivery_GetAction(tt *testing.T) { } func TestHookDelivery_GetDeliveredAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp h := &HookDelivery{DeliveredAt: &zeroValue} h.GetDeliveredAt() @@ -9866,6 +10920,7 @@ func TestHookDelivery_GetDeliveredAt(tt *testing.T) { } func TestHookDelivery_GetDuration(tt *testing.T) { + tt.Parallel() h := &HookDelivery{} h.GetDuration() h = nil @@ -9873,6 +10928,7 @@ func TestHookDelivery_GetDuration(tt *testing.T) { } func TestHookDelivery_GetEvent(tt *testing.T) { + tt.Parallel() var zeroValue string h := &HookDelivery{Event: &zeroValue} h.GetEvent() @@ -9883,6 +10939,7 @@ func TestHookDelivery_GetEvent(tt *testing.T) { } func TestHookDelivery_GetGUID(tt *testing.T) { + tt.Parallel() var zeroValue string h := &HookDelivery{GUID: &zeroValue} h.GetGUID() @@ -9893,6 +10950,7 @@ func TestHookDelivery_GetGUID(tt *testing.T) { } func TestHookDelivery_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 h := &HookDelivery{ID: &zeroValue} h.GetID() @@ -9903,6 +10961,7 @@ func TestHookDelivery_GetID(tt *testing.T) { } func TestHookDelivery_GetInstallationID(tt *testing.T) { + tt.Parallel() var zeroValue int64 h := &HookDelivery{InstallationID: &zeroValue} h.GetInstallationID() @@ -9913,6 +10972,7 @@ func TestHookDelivery_GetInstallationID(tt *testing.T) { } func TestHookDelivery_GetRedelivery(tt *testing.T) { + tt.Parallel() var zeroValue bool h := &HookDelivery{Redelivery: &zeroValue} h.GetRedelivery() @@ -9923,6 +10983,7 @@ func TestHookDelivery_GetRedelivery(tt *testing.T) { } func TestHookDelivery_GetRepositoryID(tt *testing.T) { + tt.Parallel() var zeroValue int64 h := &HookDelivery{RepositoryID: &zeroValue} h.GetRepositoryID() @@ -9933,6 +10994,7 @@ func TestHookDelivery_GetRepositoryID(tt *testing.T) { } func TestHookDelivery_GetRequest(tt *testing.T) { + tt.Parallel() h := &HookDelivery{} h.GetRequest() h = nil @@ -9940,6 +11002,7 @@ func TestHookDelivery_GetRequest(tt *testing.T) { } func TestHookDelivery_GetResponse(tt *testing.T) { + tt.Parallel() h := &HookDelivery{} h.GetResponse() h = nil @@ -9947,6 +11010,7 @@ func TestHookDelivery_GetResponse(tt *testing.T) { } func TestHookDelivery_GetStatus(tt *testing.T) { + tt.Parallel() var zeroValue string h := &HookDelivery{Status: &zeroValue} h.GetStatus() @@ -9957,6 +11021,7 @@ func TestHookDelivery_GetStatus(tt *testing.T) { } func TestHookDelivery_GetStatusCode(tt *testing.T) { + tt.Parallel() var zeroValue int h := &HookDelivery{StatusCode: &zeroValue} h.GetStatusCode() @@ -9967,6 +11032,7 @@ func TestHookDelivery_GetStatusCode(tt *testing.T) { } func TestHookRequest_GetHeaders(tt *testing.T) { + tt.Parallel() zeroValue := map[string]string{} h := &HookRequest{Headers: zeroValue} h.GetHeaders() @@ -9977,6 +11043,7 @@ func TestHookRequest_GetHeaders(tt *testing.T) { } func TestHookRequest_GetRawPayload(tt *testing.T) { + tt.Parallel() var zeroValue json.RawMessage h := &HookRequest{RawPayload: &zeroValue} h.GetRawPayload() @@ -9987,6 +11054,7 @@ func TestHookRequest_GetRawPayload(tt *testing.T) { } func TestHookResponse_GetHeaders(tt *testing.T) { + tt.Parallel() zeroValue := map[string]string{} h := &HookResponse{Headers: zeroValue} h.GetHeaders() @@ -9997,6 +11065,7 @@ func TestHookResponse_GetHeaders(tt *testing.T) { } func TestHookResponse_GetRawPayload(tt *testing.T) { + tt.Parallel() var zeroValue json.RawMessage h := &HookResponse{RawPayload: &zeroValue} h.GetRawPayload() @@ -10007,6 +11076,7 @@ func TestHookResponse_GetRawPayload(tt *testing.T) { } func TestHookStats_GetActiveHooks(tt *testing.T) { + tt.Parallel() var zeroValue int h := &HookStats{ActiveHooks: &zeroValue} h.GetActiveHooks() @@ -10017,6 +11087,7 @@ func TestHookStats_GetActiveHooks(tt *testing.T) { } func TestHookStats_GetInactiveHooks(tt *testing.T) { + tt.Parallel() var zeroValue int h := &HookStats{InactiveHooks: &zeroValue} h.GetInactiveHooks() @@ -10027,6 +11098,7 @@ func TestHookStats_GetInactiveHooks(tt *testing.T) { } func TestHookStats_GetTotalHooks(tt *testing.T) { + tt.Parallel() var zeroValue int h := &HookStats{TotalHooks: &zeroValue} h.GetTotalHooks() @@ -10037,6 +11109,7 @@ func TestHookStats_GetTotalHooks(tt *testing.T) { } func TestIDPGroup_GetGroupDescription(tt *testing.T) { + tt.Parallel() var zeroValue string i := &IDPGroup{GroupDescription: &zeroValue} i.GetGroupDescription() @@ -10047,6 +11120,7 @@ func TestIDPGroup_GetGroupDescription(tt *testing.T) { } func TestIDPGroup_GetGroupID(tt *testing.T) { + tt.Parallel() var zeroValue string i := &IDPGroup{GroupID: &zeroValue} i.GetGroupID() @@ -10057,6 +11131,7 @@ func TestIDPGroup_GetGroupID(tt *testing.T) { } func TestIDPGroup_GetGroupName(tt *testing.T) { + tt.Parallel() var zeroValue string i := &IDPGroup{GroupName: &zeroValue} i.GetGroupName() @@ -10067,6 +11142,7 @@ func TestIDPGroup_GetGroupName(tt *testing.T) { } func TestImport_GetAuthorsCount(tt *testing.T) { + tt.Parallel() var zeroValue int i := &Import{AuthorsCount: &zeroValue} i.GetAuthorsCount() @@ -10077,6 +11153,7 @@ func TestImport_GetAuthorsCount(tt *testing.T) { } func TestImport_GetAuthorsURL(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Import{AuthorsURL: &zeroValue} i.GetAuthorsURL() @@ -10087,6 +11164,7 @@ func TestImport_GetAuthorsURL(tt *testing.T) { } func TestImport_GetCommitCount(tt *testing.T) { + tt.Parallel() var zeroValue int i := &Import{CommitCount: &zeroValue} i.GetCommitCount() @@ -10097,6 +11175,7 @@ func TestImport_GetCommitCount(tt *testing.T) { } func TestImport_GetFailedStep(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Import{FailedStep: &zeroValue} i.GetFailedStep() @@ -10107,6 +11186,7 @@ func TestImport_GetFailedStep(tt *testing.T) { } func TestImport_GetHasLargeFiles(tt *testing.T) { + tt.Parallel() var zeroValue bool i := &Import{HasLargeFiles: &zeroValue} i.GetHasLargeFiles() @@ -10117,6 +11197,7 @@ func TestImport_GetHasLargeFiles(tt *testing.T) { } func TestImport_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Import{HTMLURL: &zeroValue} i.GetHTMLURL() @@ -10127,6 +11208,7 @@ func TestImport_GetHTMLURL(tt *testing.T) { } func TestImport_GetHumanName(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Import{HumanName: &zeroValue} i.GetHumanName() @@ -10137,6 +11219,7 @@ func TestImport_GetHumanName(tt *testing.T) { } func TestImport_GetLargeFilesCount(tt *testing.T) { + tt.Parallel() var zeroValue int i := &Import{LargeFilesCount: &zeroValue} i.GetLargeFilesCount() @@ -10147,6 +11230,7 @@ func TestImport_GetLargeFilesCount(tt *testing.T) { } func TestImport_GetLargeFilesSize(tt *testing.T) { + tt.Parallel() var zeroValue int i := &Import{LargeFilesSize: &zeroValue} i.GetLargeFilesSize() @@ -10157,6 +11241,7 @@ func TestImport_GetLargeFilesSize(tt *testing.T) { } func TestImport_GetMessage(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Import{Message: &zeroValue} i.GetMessage() @@ -10167,6 +11252,7 @@ func TestImport_GetMessage(tt *testing.T) { } func TestImport_GetPercent(tt *testing.T) { + tt.Parallel() var zeroValue int i := &Import{Percent: &zeroValue} i.GetPercent() @@ -10177,6 +11263,7 @@ func TestImport_GetPercent(tt *testing.T) { } func TestImport_GetPushPercent(tt *testing.T) { + tt.Parallel() var zeroValue int i := &Import{PushPercent: &zeroValue} i.GetPushPercent() @@ -10187,6 +11274,7 @@ func TestImport_GetPushPercent(tt *testing.T) { } func TestImport_GetRepositoryURL(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Import{RepositoryURL: &zeroValue} i.GetRepositoryURL() @@ -10197,6 +11285,7 @@ func TestImport_GetRepositoryURL(tt *testing.T) { } func TestImport_GetStatus(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Import{Status: &zeroValue} i.GetStatus() @@ -10207,6 +11296,7 @@ func TestImport_GetStatus(tt *testing.T) { } func TestImport_GetStatusText(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Import{StatusText: &zeroValue} i.GetStatusText() @@ -10217,6 +11307,7 @@ func TestImport_GetStatusText(tt *testing.T) { } func TestImport_GetTFVCProject(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Import{TFVCProject: &zeroValue} i.GetTFVCProject() @@ -10227,6 +11318,7 @@ func TestImport_GetTFVCProject(tt *testing.T) { } func TestImport_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Import{URL: &zeroValue} i.GetURL() @@ -10237,6 +11329,7 @@ func TestImport_GetURL(tt *testing.T) { } func TestImport_GetUseLFS(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Import{UseLFS: &zeroValue} i.GetUseLFS() @@ -10247,6 +11340,7 @@ func TestImport_GetUseLFS(tt *testing.T) { } func TestImport_GetVCS(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Import{VCS: &zeroValue} i.GetVCS() @@ -10257,6 +11351,7 @@ func TestImport_GetVCS(tt *testing.T) { } func TestImport_GetVCSPassword(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Import{VCSPassword: &zeroValue} i.GetVCSPassword() @@ -10267,6 +11362,7 @@ func TestImport_GetVCSPassword(tt *testing.T) { } func TestImport_GetVCSURL(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Import{VCSURL: &zeroValue} i.GetVCSURL() @@ -10277,6 +11373,7 @@ func TestImport_GetVCSURL(tt *testing.T) { } func TestImport_GetVCSUsername(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Import{VCSUsername: &zeroValue} i.GetVCSUsername() @@ -10287,6 +11384,7 @@ func TestImport_GetVCSUsername(tt *testing.T) { } func TestInstallation_GetAccessTokensURL(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Installation{AccessTokensURL: &zeroValue} i.GetAccessTokensURL() @@ -10297,6 +11395,7 @@ func TestInstallation_GetAccessTokensURL(tt *testing.T) { } func TestInstallation_GetAccount(tt *testing.T) { + tt.Parallel() i := &Installation{} i.GetAccount() i = nil @@ -10304,6 +11403,7 @@ func TestInstallation_GetAccount(tt *testing.T) { } func TestInstallation_GetAppID(tt *testing.T) { + tt.Parallel() var zeroValue int64 i := &Installation{AppID: &zeroValue} i.GetAppID() @@ -10314,6 +11414,7 @@ func TestInstallation_GetAppID(tt *testing.T) { } func TestInstallation_GetAppSlug(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Installation{AppSlug: &zeroValue} i.GetAppSlug() @@ -10324,6 +11425,7 @@ func TestInstallation_GetAppSlug(tt *testing.T) { } func TestInstallation_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp i := &Installation{CreatedAt: &zeroValue} i.GetCreatedAt() @@ -10334,6 +11436,7 @@ func TestInstallation_GetCreatedAt(tt *testing.T) { } func TestInstallation_GetHasMultipleSingleFiles(tt *testing.T) { + tt.Parallel() var zeroValue bool i := &Installation{HasMultipleSingleFiles: &zeroValue} i.GetHasMultipleSingleFiles() @@ -10344,6 +11447,7 @@ func TestInstallation_GetHasMultipleSingleFiles(tt *testing.T) { } func TestInstallation_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Installation{HTMLURL: &zeroValue} i.GetHTMLURL() @@ -10354,6 +11458,7 @@ func TestInstallation_GetHTMLURL(tt *testing.T) { } func TestInstallation_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 i := &Installation{ID: &zeroValue} i.GetID() @@ -10364,6 +11469,7 @@ func TestInstallation_GetID(tt *testing.T) { } func TestInstallation_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Installation{NodeID: &zeroValue} i.GetNodeID() @@ -10374,6 +11480,7 @@ func TestInstallation_GetNodeID(tt *testing.T) { } func TestInstallation_GetPermissions(tt *testing.T) { + tt.Parallel() i := &Installation{} i.GetPermissions() i = nil @@ -10381,6 +11488,7 @@ func TestInstallation_GetPermissions(tt *testing.T) { } func TestInstallation_GetRepositoriesURL(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Installation{RepositoriesURL: &zeroValue} i.GetRepositoriesURL() @@ -10391,6 +11499,7 @@ func TestInstallation_GetRepositoriesURL(tt *testing.T) { } func TestInstallation_GetRepositorySelection(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Installation{RepositorySelection: &zeroValue} i.GetRepositorySelection() @@ -10401,6 +11510,7 @@ func TestInstallation_GetRepositorySelection(tt *testing.T) { } func TestInstallation_GetSingleFileName(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Installation{SingleFileName: &zeroValue} i.GetSingleFileName() @@ -10411,6 +11521,7 @@ func TestInstallation_GetSingleFileName(tt *testing.T) { } func TestInstallation_GetSuspendedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp i := &Installation{SuspendedAt: &zeroValue} i.GetSuspendedAt() @@ -10421,6 +11532,7 @@ func TestInstallation_GetSuspendedAt(tt *testing.T) { } func TestInstallation_GetSuspendedBy(tt *testing.T) { + tt.Parallel() i := &Installation{} i.GetSuspendedBy() i = nil @@ -10428,6 +11540,7 @@ func TestInstallation_GetSuspendedBy(tt *testing.T) { } func TestInstallation_GetTargetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 i := &Installation{TargetID: &zeroValue} i.GetTargetID() @@ -10438,6 +11551,7 @@ func TestInstallation_GetTargetID(tt *testing.T) { } func TestInstallation_GetTargetType(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Installation{TargetType: &zeroValue} i.GetTargetType() @@ -10448,6 +11562,7 @@ func TestInstallation_GetTargetType(tt *testing.T) { } func TestInstallation_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp i := &Installation{UpdatedAt: &zeroValue} i.GetUpdatedAt() @@ -10458,6 +11573,7 @@ func TestInstallation_GetUpdatedAt(tt *testing.T) { } func TestInstallationChanges_GetLogin(tt *testing.T) { + tt.Parallel() i := &InstallationChanges{} i.GetLogin() i = nil @@ -10465,6 +11581,7 @@ func TestInstallationChanges_GetLogin(tt *testing.T) { } func TestInstallationChanges_GetSlug(tt *testing.T) { + tt.Parallel() i := &InstallationChanges{} i.GetSlug() i = nil @@ -10472,6 +11589,7 @@ func TestInstallationChanges_GetSlug(tt *testing.T) { } func TestInstallationEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationEvent{Action: &zeroValue} i.GetAction() @@ -10482,6 +11600,7 @@ func TestInstallationEvent_GetAction(tt *testing.T) { } func TestInstallationEvent_GetInstallation(tt *testing.T) { + tt.Parallel() i := &InstallationEvent{} i.GetInstallation() i = nil @@ -10489,6 +11608,7 @@ func TestInstallationEvent_GetInstallation(tt *testing.T) { } func TestInstallationEvent_GetOrg(tt *testing.T) { + tt.Parallel() i := &InstallationEvent{} i.GetOrg() i = nil @@ -10496,6 +11616,7 @@ func TestInstallationEvent_GetOrg(tt *testing.T) { } func TestInstallationEvent_GetRequester(tt *testing.T) { + tt.Parallel() i := &InstallationEvent{} i.GetRequester() i = nil @@ -10503,6 +11624,7 @@ func TestInstallationEvent_GetRequester(tt *testing.T) { } func TestInstallationEvent_GetSender(tt *testing.T) { + tt.Parallel() i := &InstallationEvent{} i.GetSender() i = nil @@ -10510,6 +11632,7 @@ func TestInstallationEvent_GetSender(tt *testing.T) { } func TestInstallationLoginChange_GetFrom(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationLoginChange{From: &zeroValue} i.GetFrom() @@ -10520,6 +11643,7 @@ func TestInstallationLoginChange_GetFrom(tt *testing.T) { } func TestInstallationPermissions_GetActions(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{Actions: &zeroValue} i.GetActions() @@ -10530,6 +11654,7 @@ func TestInstallationPermissions_GetActions(tt *testing.T) { } func TestInstallationPermissions_GetActionsVariables(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{ActionsVariables: &zeroValue} i.GetActionsVariables() @@ -10540,6 +11665,7 @@ func TestInstallationPermissions_GetActionsVariables(tt *testing.T) { } func TestInstallationPermissions_GetAdministration(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{Administration: &zeroValue} i.GetAdministration() @@ -10550,6 +11676,7 @@ func TestInstallationPermissions_GetAdministration(tt *testing.T) { } func TestInstallationPermissions_GetBlocking(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{Blocking: &zeroValue} i.GetBlocking() @@ -10560,6 +11687,7 @@ func TestInstallationPermissions_GetBlocking(tt *testing.T) { } func TestInstallationPermissions_GetChecks(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{Checks: &zeroValue} i.GetChecks() @@ -10570,6 +11698,7 @@ func TestInstallationPermissions_GetChecks(tt *testing.T) { } func TestInstallationPermissions_GetContentReferences(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{ContentReferences: &zeroValue} i.GetContentReferences() @@ -10580,6 +11709,7 @@ func TestInstallationPermissions_GetContentReferences(tt *testing.T) { } func TestInstallationPermissions_GetContents(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{Contents: &zeroValue} i.GetContents() @@ -10590,6 +11720,7 @@ func TestInstallationPermissions_GetContents(tt *testing.T) { } func TestInstallationPermissions_GetDeployments(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{Deployments: &zeroValue} i.GetDeployments() @@ -10600,6 +11731,7 @@ func TestInstallationPermissions_GetDeployments(tt *testing.T) { } func TestInstallationPermissions_GetEmails(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{Emails: &zeroValue} i.GetEmails() @@ -10610,6 +11742,7 @@ func TestInstallationPermissions_GetEmails(tt *testing.T) { } func TestInstallationPermissions_GetEnvironments(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{Environments: &zeroValue} i.GetEnvironments() @@ -10620,6 +11753,7 @@ func TestInstallationPermissions_GetEnvironments(tt *testing.T) { } func TestInstallationPermissions_GetFollowers(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{Followers: &zeroValue} i.GetFollowers() @@ -10630,6 +11764,7 @@ func TestInstallationPermissions_GetFollowers(tt *testing.T) { } func TestInstallationPermissions_GetIssues(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{Issues: &zeroValue} i.GetIssues() @@ -10640,6 +11775,7 @@ func TestInstallationPermissions_GetIssues(tt *testing.T) { } func TestInstallationPermissions_GetMembers(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{Members: &zeroValue} i.GetMembers() @@ -10650,6 +11786,7 @@ func TestInstallationPermissions_GetMembers(tt *testing.T) { } func TestInstallationPermissions_GetMetadata(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{Metadata: &zeroValue} i.GetMetadata() @@ -10660,6 +11797,7 @@ func TestInstallationPermissions_GetMetadata(tt *testing.T) { } func TestInstallationPermissions_GetOrganizationAdministration(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{OrganizationAdministration: &zeroValue} i.GetOrganizationAdministration() @@ -10670,6 +11808,7 @@ func TestInstallationPermissions_GetOrganizationAdministration(tt *testing.T) { } func TestInstallationPermissions_GetOrganizationCustomOrgRoles(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{OrganizationCustomOrgRoles: &zeroValue} i.GetOrganizationCustomOrgRoles() @@ -10680,6 +11819,7 @@ func TestInstallationPermissions_GetOrganizationCustomOrgRoles(tt *testing.T) { } func TestInstallationPermissions_GetOrganizationCustomProperties(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{OrganizationCustomProperties: &zeroValue} i.GetOrganizationCustomProperties() @@ -10690,6 +11830,7 @@ func TestInstallationPermissions_GetOrganizationCustomProperties(tt *testing.T) } func TestInstallationPermissions_GetOrganizationCustomRoles(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{OrganizationCustomRoles: &zeroValue} i.GetOrganizationCustomRoles() @@ -10700,6 +11841,7 @@ func TestInstallationPermissions_GetOrganizationCustomRoles(tt *testing.T) { } func TestInstallationPermissions_GetOrganizationHooks(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{OrganizationHooks: &zeroValue} i.GetOrganizationHooks() @@ -10710,6 +11852,7 @@ func TestInstallationPermissions_GetOrganizationHooks(tt *testing.T) { } func TestInstallationPermissions_GetOrganizationPackages(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{OrganizationPackages: &zeroValue} i.GetOrganizationPackages() @@ -10720,6 +11863,7 @@ func TestInstallationPermissions_GetOrganizationPackages(tt *testing.T) { } func TestInstallationPermissions_GetOrganizationPersonalAccessTokenRequests(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{OrganizationPersonalAccessTokenRequests: &zeroValue} i.GetOrganizationPersonalAccessTokenRequests() @@ -10730,6 +11874,7 @@ func TestInstallationPermissions_GetOrganizationPersonalAccessTokenRequests(tt * } func TestInstallationPermissions_GetOrganizationPersonalAccessTokens(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{OrganizationPersonalAccessTokens: &zeroValue} i.GetOrganizationPersonalAccessTokens() @@ -10740,6 +11885,7 @@ func TestInstallationPermissions_GetOrganizationPersonalAccessTokens(tt *testing } func TestInstallationPermissions_GetOrganizationPlan(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{OrganizationPlan: &zeroValue} i.GetOrganizationPlan() @@ -10750,6 +11896,7 @@ func TestInstallationPermissions_GetOrganizationPlan(tt *testing.T) { } func TestInstallationPermissions_GetOrganizationPreReceiveHooks(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{OrganizationPreReceiveHooks: &zeroValue} i.GetOrganizationPreReceiveHooks() @@ -10760,6 +11907,7 @@ func TestInstallationPermissions_GetOrganizationPreReceiveHooks(tt *testing.T) { } func TestInstallationPermissions_GetOrganizationProjects(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{OrganizationProjects: &zeroValue} i.GetOrganizationProjects() @@ -10770,6 +11918,7 @@ func TestInstallationPermissions_GetOrganizationProjects(tt *testing.T) { } func TestInstallationPermissions_GetOrganizationSecrets(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{OrganizationSecrets: &zeroValue} i.GetOrganizationSecrets() @@ -10780,6 +11929,7 @@ func TestInstallationPermissions_GetOrganizationSecrets(tt *testing.T) { } func TestInstallationPermissions_GetOrganizationSelfHostedRunners(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{OrganizationSelfHostedRunners: &zeroValue} i.GetOrganizationSelfHostedRunners() @@ -10790,6 +11940,7 @@ func TestInstallationPermissions_GetOrganizationSelfHostedRunners(tt *testing.T) } func TestInstallationPermissions_GetOrganizationUserBlocking(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{OrganizationUserBlocking: &zeroValue} i.GetOrganizationUserBlocking() @@ -10800,6 +11951,7 @@ func TestInstallationPermissions_GetOrganizationUserBlocking(tt *testing.T) { } func TestInstallationPermissions_GetPackages(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{Packages: &zeroValue} i.GetPackages() @@ -10810,6 +11962,7 @@ func TestInstallationPermissions_GetPackages(tt *testing.T) { } func TestInstallationPermissions_GetPages(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{Pages: &zeroValue} i.GetPages() @@ -10820,6 +11973,7 @@ func TestInstallationPermissions_GetPages(tt *testing.T) { } func TestInstallationPermissions_GetPullRequests(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{PullRequests: &zeroValue} i.GetPullRequests() @@ -10830,6 +11984,7 @@ func TestInstallationPermissions_GetPullRequests(tt *testing.T) { } func TestInstallationPermissions_GetRepositoryHooks(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{RepositoryHooks: &zeroValue} i.GetRepositoryHooks() @@ -10840,6 +11995,7 @@ func TestInstallationPermissions_GetRepositoryHooks(tt *testing.T) { } func TestInstallationPermissions_GetRepositoryPreReceiveHooks(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{RepositoryPreReceiveHooks: &zeroValue} i.GetRepositoryPreReceiveHooks() @@ -10850,6 +12006,7 @@ func TestInstallationPermissions_GetRepositoryPreReceiveHooks(tt *testing.T) { } func TestInstallationPermissions_GetRepositoryProjects(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{RepositoryProjects: &zeroValue} i.GetRepositoryProjects() @@ -10860,6 +12017,7 @@ func TestInstallationPermissions_GetRepositoryProjects(tt *testing.T) { } func TestInstallationPermissions_GetSecrets(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{Secrets: &zeroValue} i.GetSecrets() @@ -10870,6 +12028,7 @@ func TestInstallationPermissions_GetSecrets(tt *testing.T) { } func TestInstallationPermissions_GetSecretScanningAlerts(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{SecretScanningAlerts: &zeroValue} i.GetSecretScanningAlerts() @@ -10880,6 +12039,7 @@ func TestInstallationPermissions_GetSecretScanningAlerts(tt *testing.T) { } func TestInstallationPermissions_GetSecurityEvents(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{SecurityEvents: &zeroValue} i.GetSecurityEvents() @@ -10890,6 +12050,7 @@ func TestInstallationPermissions_GetSecurityEvents(tt *testing.T) { } func TestInstallationPermissions_GetSingleFile(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{SingleFile: &zeroValue} i.GetSingleFile() @@ -10900,6 +12061,7 @@ func TestInstallationPermissions_GetSingleFile(tt *testing.T) { } func TestInstallationPermissions_GetStatuses(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{Statuses: &zeroValue} i.GetStatuses() @@ -10910,6 +12072,7 @@ func TestInstallationPermissions_GetStatuses(tt *testing.T) { } func TestInstallationPermissions_GetTeamDiscussions(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{TeamDiscussions: &zeroValue} i.GetTeamDiscussions() @@ -10920,6 +12083,7 @@ func TestInstallationPermissions_GetTeamDiscussions(tt *testing.T) { } func TestInstallationPermissions_GetVulnerabilityAlerts(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{VulnerabilityAlerts: &zeroValue} i.GetVulnerabilityAlerts() @@ -10930,6 +12094,7 @@ func TestInstallationPermissions_GetVulnerabilityAlerts(tt *testing.T) { } func TestInstallationPermissions_GetWorkflows(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationPermissions{Workflows: &zeroValue} i.GetWorkflows() @@ -10940,6 +12105,7 @@ func TestInstallationPermissions_GetWorkflows(tt *testing.T) { } func TestInstallationRepositoriesEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationRepositoriesEvent{Action: &zeroValue} i.GetAction() @@ -10950,6 +12116,7 @@ func TestInstallationRepositoriesEvent_GetAction(tt *testing.T) { } func TestInstallationRepositoriesEvent_GetInstallation(tt *testing.T) { + tt.Parallel() i := &InstallationRepositoriesEvent{} i.GetInstallation() i = nil @@ -10957,6 +12124,7 @@ func TestInstallationRepositoriesEvent_GetInstallation(tt *testing.T) { } func TestInstallationRepositoriesEvent_GetOrg(tt *testing.T) { + tt.Parallel() i := &InstallationRepositoriesEvent{} i.GetOrg() i = nil @@ -10964,6 +12132,7 @@ func TestInstallationRepositoriesEvent_GetOrg(tt *testing.T) { } func TestInstallationRepositoriesEvent_GetRepositorySelection(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationRepositoriesEvent{RepositorySelection: &zeroValue} i.GetRepositorySelection() @@ -10974,6 +12143,7 @@ func TestInstallationRepositoriesEvent_GetRepositorySelection(tt *testing.T) { } func TestInstallationRepositoriesEvent_GetSender(tt *testing.T) { + tt.Parallel() i := &InstallationRepositoriesEvent{} i.GetSender() i = nil @@ -10981,6 +12151,7 @@ func TestInstallationRepositoriesEvent_GetSender(tt *testing.T) { } func TestInstallationRequest_GetAccount(tt *testing.T) { + tt.Parallel() i := &InstallationRequest{} i.GetAccount() i = nil @@ -10988,6 +12159,7 @@ func TestInstallationRequest_GetAccount(tt *testing.T) { } func TestInstallationRequest_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp i := &InstallationRequest{CreatedAt: &zeroValue} i.GetCreatedAt() @@ -10998,6 +12170,7 @@ func TestInstallationRequest_GetCreatedAt(tt *testing.T) { } func TestInstallationRequest_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 i := &InstallationRequest{ID: &zeroValue} i.GetID() @@ -11008,6 +12181,7 @@ func TestInstallationRequest_GetID(tt *testing.T) { } func TestInstallationRequest_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationRequest{NodeID: &zeroValue} i.GetNodeID() @@ -11018,6 +12192,7 @@ func TestInstallationRequest_GetNodeID(tt *testing.T) { } func TestInstallationRequest_GetRequester(tt *testing.T) { + tt.Parallel() i := &InstallationRequest{} i.GetRequester() i = nil @@ -11025,6 +12200,7 @@ func TestInstallationRequest_GetRequester(tt *testing.T) { } func TestInstallationSlugChange_GetFrom(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationSlugChange{From: &zeroValue} i.GetFrom() @@ -11035,6 +12211,7 @@ func TestInstallationSlugChange_GetFrom(tt *testing.T) { } func TestInstallationTargetEvent_GetAccount(tt *testing.T) { + tt.Parallel() i := &InstallationTargetEvent{} i.GetAccount() i = nil @@ -11042,6 +12219,7 @@ func TestInstallationTargetEvent_GetAccount(tt *testing.T) { } func TestInstallationTargetEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationTargetEvent{Action: &zeroValue} i.GetAction() @@ -11052,6 +12230,7 @@ func TestInstallationTargetEvent_GetAction(tt *testing.T) { } func TestInstallationTargetEvent_GetChanges(tt *testing.T) { + tt.Parallel() i := &InstallationTargetEvent{} i.GetChanges() i = nil @@ -11059,6 +12238,7 @@ func TestInstallationTargetEvent_GetChanges(tt *testing.T) { } func TestInstallationTargetEvent_GetEnterprise(tt *testing.T) { + tt.Parallel() i := &InstallationTargetEvent{} i.GetEnterprise() i = nil @@ -11066,6 +12246,7 @@ func TestInstallationTargetEvent_GetEnterprise(tt *testing.T) { } func TestInstallationTargetEvent_GetInstallation(tt *testing.T) { + tt.Parallel() i := &InstallationTargetEvent{} i.GetInstallation() i = nil @@ -11073,6 +12254,7 @@ func TestInstallationTargetEvent_GetInstallation(tt *testing.T) { } func TestInstallationTargetEvent_GetOrganization(tt *testing.T) { + tt.Parallel() i := &InstallationTargetEvent{} i.GetOrganization() i = nil @@ -11080,6 +12262,7 @@ func TestInstallationTargetEvent_GetOrganization(tt *testing.T) { } func TestInstallationTargetEvent_GetRepository(tt *testing.T) { + tt.Parallel() i := &InstallationTargetEvent{} i.GetRepository() i = nil @@ -11087,6 +12270,7 @@ func TestInstallationTargetEvent_GetRepository(tt *testing.T) { } func TestInstallationTargetEvent_GetSender(tt *testing.T) { + tt.Parallel() i := &InstallationTargetEvent{} i.GetSender() i = nil @@ -11094,6 +12278,7 @@ func TestInstallationTargetEvent_GetSender(tt *testing.T) { } func TestInstallationTargetEvent_GetTargetType(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationTargetEvent{TargetType: &zeroValue} i.GetTargetType() @@ -11104,6 +12289,7 @@ func TestInstallationTargetEvent_GetTargetType(tt *testing.T) { } func TestInstallationToken_GetExpiresAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp i := &InstallationToken{ExpiresAt: &zeroValue} i.GetExpiresAt() @@ -11114,6 +12300,7 @@ func TestInstallationToken_GetExpiresAt(tt *testing.T) { } func TestInstallationToken_GetPermissions(tt *testing.T) { + tt.Parallel() i := &InstallationToken{} i.GetPermissions() i = nil @@ -11121,6 +12308,7 @@ func TestInstallationToken_GetPermissions(tt *testing.T) { } func TestInstallationToken_GetToken(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InstallationToken{Token: &zeroValue} i.GetToken() @@ -11131,6 +12319,7 @@ func TestInstallationToken_GetToken(tt *testing.T) { } func TestInstallationTokenListRepoOptions_GetPermissions(tt *testing.T) { + tt.Parallel() i := &InstallationTokenListRepoOptions{} i.GetPermissions() i = nil @@ -11138,6 +12327,7 @@ func TestInstallationTokenListRepoOptions_GetPermissions(tt *testing.T) { } func TestInstallationTokenOptions_GetPermissions(tt *testing.T) { + tt.Parallel() i := &InstallationTokenOptions{} i.GetPermissions() i = nil @@ -11145,6 +12335,7 @@ func TestInstallationTokenOptions_GetPermissions(tt *testing.T) { } func TestInteractionRestriction_GetExpiresAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp i := &InteractionRestriction{ExpiresAt: &zeroValue} i.GetExpiresAt() @@ -11155,6 +12346,7 @@ func TestInteractionRestriction_GetExpiresAt(tt *testing.T) { } func TestInteractionRestriction_GetLimit(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InteractionRestriction{Limit: &zeroValue} i.GetLimit() @@ -11165,6 +12357,7 @@ func TestInteractionRestriction_GetLimit(tt *testing.T) { } func TestInteractionRestriction_GetOrigin(tt *testing.T) { + tt.Parallel() var zeroValue string i := &InteractionRestriction{Origin: &zeroValue} i.GetOrigin() @@ -11175,6 +12368,7 @@ func TestInteractionRestriction_GetOrigin(tt *testing.T) { } func TestInvitation_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp i := &Invitation{CreatedAt: &zeroValue} i.GetCreatedAt() @@ -11185,6 +12379,7 @@ func TestInvitation_GetCreatedAt(tt *testing.T) { } func TestInvitation_GetEmail(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Invitation{Email: &zeroValue} i.GetEmail() @@ -11195,6 +12390,7 @@ func TestInvitation_GetEmail(tt *testing.T) { } func TestInvitation_GetFailedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp i := &Invitation{FailedAt: &zeroValue} i.GetFailedAt() @@ -11205,6 +12401,7 @@ func TestInvitation_GetFailedAt(tt *testing.T) { } func TestInvitation_GetFailedReason(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Invitation{FailedReason: &zeroValue} i.GetFailedReason() @@ -11215,6 +12412,7 @@ func TestInvitation_GetFailedReason(tt *testing.T) { } func TestInvitation_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 i := &Invitation{ID: &zeroValue} i.GetID() @@ -11225,6 +12423,7 @@ func TestInvitation_GetID(tt *testing.T) { } func TestInvitation_GetInvitationTeamURL(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Invitation{InvitationTeamURL: &zeroValue} i.GetInvitationTeamURL() @@ -11235,6 +12434,7 @@ func TestInvitation_GetInvitationTeamURL(tt *testing.T) { } func TestInvitation_GetInviter(tt *testing.T) { + tt.Parallel() i := &Invitation{} i.GetInviter() i = nil @@ -11242,6 +12442,7 @@ func TestInvitation_GetInviter(tt *testing.T) { } func TestInvitation_GetLogin(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Invitation{Login: &zeroValue} i.GetLogin() @@ -11252,6 +12453,7 @@ func TestInvitation_GetLogin(tt *testing.T) { } func TestInvitation_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Invitation{NodeID: &zeroValue} i.GetNodeID() @@ -11262,6 +12464,7 @@ func TestInvitation_GetNodeID(tt *testing.T) { } func TestInvitation_GetRole(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Invitation{Role: &zeroValue} i.GetRole() @@ -11272,6 +12475,7 @@ func TestInvitation_GetRole(tt *testing.T) { } func TestInvitation_GetTeamCount(tt *testing.T) { + tt.Parallel() var zeroValue int i := &Invitation{TeamCount: &zeroValue} i.GetTeamCount() @@ -11282,6 +12486,7 @@ func TestInvitation_GetTeamCount(tt *testing.T) { } func TestIssue_GetActiveLockReason(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Issue{ActiveLockReason: &zeroValue} i.GetActiveLockReason() @@ -11292,6 +12497,7 @@ func TestIssue_GetActiveLockReason(tt *testing.T) { } func TestIssue_GetAssignee(tt *testing.T) { + tt.Parallel() i := &Issue{} i.GetAssignee() i = nil @@ -11299,6 +12505,7 @@ func TestIssue_GetAssignee(tt *testing.T) { } func TestIssue_GetAuthorAssociation(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Issue{AuthorAssociation: &zeroValue} i.GetAuthorAssociation() @@ -11309,6 +12516,7 @@ func TestIssue_GetAuthorAssociation(tt *testing.T) { } func TestIssue_GetBody(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Issue{Body: &zeroValue} i.GetBody() @@ -11319,6 +12527,7 @@ func TestIssue_GetBody(tt *testing.T) { } func TestIssue_GetClosedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp i := &Issue{ClosedAt: &zeroValue} i.GetClosedAt() @@ -11329,6 +12538,7 @@ func TestIssue_GetClosedAt(tt *testing.T) { } func TestIssue_GetClosedBy(tt *testing.T) { + tt.Parallel() i := &Issue{} i.GetClosedBy() i = nil @@ -11336,6 +12546,7 @@ func TestIssue_GetClosedBy(tt *testing.T) { } func TestIssue_GetComments(tt *testing.T) { + tt.Parallel() var zeroValue int i := &Issue{Comments: &zeroValue} i.GetComments() @@ -11346,6 +12557,7 @@ func TestIssue_GetComments(tt *testing.T) { } func TestIssue_GetCommentsURL(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Issue{CommentsURL: &zeroValue} i.GetCommentsURL() @@ -11356,6 +12568,7 @@ func TestIssue_GetCommentsURL(tt *testing.T) { } func TestIssue_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp i := &Issue{CreatedAt: &zeroValue} i.GetCreatedAt() @@ -11366,6 +12579,7 @@ func TestIssue_GetCreatedAt(tt *testing.T) { } func TestIssue_GetDraft(tt *testing.T) { + tt.Parallel() var zeroValue bool i := &Issue{Draft: &zeroValue} i.GetDraft() @@ -11376,6 +12590,7 @@ func TestIssue_GetDraft(tt *testing.T) { } func TestIssue_GetEventsURL(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Issue{EventsURL: &zeroValue} i.GetEventsURL() @@ -11386,6 +12601,7 @@ func TestIssue_GetEventsURL(tt *testing.T) { } func TestIssue_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Issue{HTMLURL: &zeroValue} i.GetHTMLURL() @@ -11396,6 +12612,7 @@ func TestIssue_GetHTMLURL(tt *testing.T) { } func TestIssue_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 i := &Issue{ID: &zeroValue} i.GetID() @@ -11406,6 +12623,7 @@ func TestIssue_GetID(tt *testing.T) { } func TestIssue_GetLabelsURL(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Issue{LabelsURL: &zeroValue} i.GetLabelsURL() @@ -11416,6 +12634,7 @@ func TestIssue_GetLabelsURL(tt *testing.T) { } func TestIssue_GetLocked(tt *testing.T) { + tt.Parallel() var zeroValue bool i := &Issue{Locked: &zeroValue} i.GetLocked() @@ -11426,6 +12645,7 @@ func TestIssue_GetLocked(tt *testing.T) { } func TestIssue_GetMilestone(tt *testing.T) { + tt.Parallel() i := &Issue{} i.GetMilestone() i = nil @@ -11433,6 +12653,7 @@ func TestIssue_GetMilestone(tt *testing.T) { } func TestIssue_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Issue{NodeID: &zeroValue} i.GetNodeID() @@ -11443,6 +12664,7 @@ func TestIssue_GetNodeID(tt *testing.T) { } func TestIssue_GetNumber(tt *testing.T) { + tt.Parallel() var zeroValue int i := &Issue{Number: &zeroValue} i.GetNumber() @@ -11453,6 +12675,7 @@ func TestIssue_GetNumber(tt *testing.T) { } func TestIssue_GetPullRequestLinks(tt *testing.T) { + tt.Parallel() i := &Issue{} i.GetPullRequestLinks() i = nil @@ -11460,6 +12683,7 @@ func TestIssue_GetPullRequestLinks(tt *testing.T) { } func TestIssue_GetReactions(tt *testing.T) { + tt.Parallel() i := &Issue{} i.GetReactions() i = nil @@ -11467,6 +12691,7 @@ func TestIssue_GetReactions(tt *testing.T) { } func TestIssue_GetRepository(tt *testing.T) { + tt.Parallel() i := &Issue{} i.GetRepository() i = nil @@ -11474,6 +12699,7 @@ func TestIssue_GetRepository(tt *testing.T) { } func TestIssue_GetRepositoryURL(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Issue{RepositoryURL: &zeroValue} i.GetRepositoryURL() @@ -11484,6 +12710,7 @@ func TestIssue_GetRepositoryURL(tt *testing.T) { } func TestIssue_GetState(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Issue{State: &zeroValue} i.GetState() @@ -11494,6 +12721,7 @@ func TestIssue_GetState(tt *testing.T) { } func TestIssue_GetStateReason(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Issue{StateReason: &zeroValue} i.GetStateReason() @@ -11504,6 +12732,7 @@ func TestIssue_GetStateReason(tt *testing.T) { } func TestIssue_GetTitle(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Issue{Title: &zeroValue} i.GetTitle() @@ -11514,6 +12743,7 @@ func TestIssue_GetTitle(tt *testing.T) { } func TestIssue_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp i := &Issue{UpdatedAt: &zeroValue} i.GetUpdatedAt() @@ -11524,6 +12754,7 @@ func TestIssue_GetUpdatedAt(tt *testing.T) { } func TestIssue_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string i := &Issue{URL: &zeroValue} i.GetURL() @@ -11534,6 +12765,7 @@ func TestIssue_GetURL(tt *testing.T) { } func TestIssue_GetUser(tt *testing.T) { + tt.Parallel() i := &Issue{} i.GetUser() i = nil @@ -11541,6 +12773,7 @@ func TestIssue_GetUser(tt *testing.T) { } func TestIssueComment_GetAuthorAssociation(tt *testing.T) { + tt.Parallel() var zeroValue string i := &IssueComment{AuthorAssociation: &zeroValue} i.GetAuthorAssociation() @@ -11551,6 +12784,7 @@ func TestIssueComment_GetAuthorAssociation(tt *testing.T) { } func TestIssueComment_GetBody(tt *testing.T) { + tt.Parallel() var zeroValue string i := &IssueComment{Body: &zeroValue} i.GetBody() @@ -11561,6 +12795,7 @@ func TestIssueComment_GetBody(tt *testing.T) { } func TestIssueComment_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp i := &IssueComment{CreatedAt: &zeroValue} i.GetCreatedAt() @@ -11571,6 +12806,7 @@ func TestIssueComment_GetCreatedAt(tt *testing.T) { } func TestIssueComment_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string i := &IssueComment{HTMLURL: &zeroValue} i.GetHTMLURL() @@ -11581,6 +12817,7 @@ func TestIssueComment_GetHTMLURL(tt *testing.T) { } func TestIssueComment_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 i := &IssueComment{ID: &zeroValue} i.GetID() @@ -11591,6 +12828,7 @@ func TestIssueComment_GetID(tt *testing.T) { } func TestIssueComment_GetIssueURL(tt *testing.T) { + tt.Parallel() var zeroValue string i := &IssueComment{IssueURL: &zeroValue} i.GetIssueURL() @@ -11601,6 +12839,7 @@ func TestIssueComment_GetIssueURL(tt *testing.T) { } func TestIssueComment_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string i := &IssueComment{NodeID: &zeroValue} i.GetNodeID() @@ -11611,6 +12850,7 @@ func TestIssueComment_GetNodeID(tt *testing.T) { } func TestIssueComment_GetReactions(tt *testing.T) { + tt.Parallel() i := &IssueComment{} i.GetReactions() i = nil @@ -11618,6 +12858,7 @@ func TestIssueComment_GetReactions(tt *testing.T) { } func TestIssueComment_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp i := &IssueComment{UpdatedAt: &zeroValue} i.GetUpdatedAt() @@ -11628,6 +12869,7 @@ func TestIssueComment_GetUpdatedAt(tt *testing.T) { } func TestIssueComment_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string i := &IssueComment{URL: &zeroValue} i.GetURL() @@ -11638,6 +12880,7 @@ func TestIssueComment_GetURL(tt *testing.T) { } func TestIssueComment_GetUser(tt *testing.T) { + tt.Parallel() i := &IssueComment{} i.GetUser() i = nil @@ -11645,6 +12888,7 @@ func TestIssueComment_GetUser(tt *testing.T) { } func TestIssueCommentEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string i := &IssueCommentEvent{Action: &zeroValue} i.GetAction() @@ -11655,6 +12899,7 @@ func TestIssueCommentEvent_GetAction(tt *testing.T) { } func TestIssueCommentEvent_GetChanges(tt *testing.T) { + tt.Parallel() i := &IssueCommentEvent{} i.GetChanges() i = nil @@ -11662,6 +12907,7 @@ func TestIssueCommentEvent_GetChanges(tt *testing.T) { } func TestIssueCommentEvent_GetComment(tt *testing.T) { + tt.Parallel() i := &IssueCommentEvent{} i.GetComment() i = nil @@ -11669,6 +12915,7 @@ func TestIssueCommentEvent_GetComment(tt *testing.T) { } func TestIssueCommentEvent_GetInstallation(tt *testing.T) { + tt.Parallel() i := &IssueCommentEvent{} i.GetInstallation() i = nil @@ -11676,6 +12923,7 @@ func TestIssueCommentEvent_GetInstallation(tt *testing.T) { } func TestIssueCommentEvent_GetIssue(tt *testing.T) { + tt.Parallel() i := &IssueCommentEvent{} i.GetIssue() i = nil @@ -11683,6 +12931,7 @@ func TestIssueCommentEvent_GetIssue(tt *testing.T) { } func TestIssueCommentEvent_GetOrganization(tt *testing.T) { + tt.Parallel() i := &IssueCommentEvent{} i.GetOrganization() i = nil @@ -11690,6 +12939,7 @@ func TestIssueCommentEvent_GetOrganization(tt *testing.T) { } func TestIssueCommentEvent_GetRepo(tt *testing.T) { + tt.Parallel() i := &IssueCommentEvent{} i.GetRepo() i = nil @@ -11697,6 +12947,7 @@ func TestIssueCommentEvent_GetRepo(tt *testing.T) { } func TestIssueCommentEvent_GetSender(tt *testing.T) { + tt.Parallel() i := &IssueCommentEvent{} i.GetSender() i = nil @@ -11704,6 +12955,7 @@ func TestIssueCommentEvent_GetSender(tt *testing.T) { } func TestIssueEvent_GetActor(tt *testing.T) { + tt.Parallel() i := &IssueEvent{} i.GetActor() i = nil @@ -11711,6 +12963,7 @@ func TestIssueEvent_GetActor(tt *testing.T) { } func TestIssueEvent_GetAssignee(tt *testing.T) { + tt.Parallel() i := &IssueEvent{} i.GetAssignee() i = nil @@ -11718,6 +12971,7 @@ func TestIssueEvent_GetAssignee(tt *testing.T) { } func TestIssueEvent_GetAssigner(tt *testing.T) { + tt.Parallel() i := &IssueEvent{} i.GetAssigner() i = nil @@ -11725,6 +12979,7 @@ func TestIssueEvent_GetAssigner(tt *testing.T) { } func TestIssueEvent_GetCommitID(tt *testing.T) { + tt.Parallel() var zeroValue string i := &IssueEvent{CommitID: &zeroValue} i.GetCommitID() @@ -11735,6 +12990,7 @@ func TestIssueEvent_GetCommitID(tt *testing.T) { } func TestIssueEvent_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp i := &IssueEvent{CreatedAt: &zeroValue} i.GetCreatedAt() @@ -11745,6 +13001,7 @@ func TestIssueEvent_GetCreatedAt(tt *testing.T) { } func TestIssueEvent_GetDismissedReview(tt *testing.T) { + tt.Parallel() i := &IssueEvent{} i.GetDismissedReview() i = nil @@ -11752,6 +13009,7 @@ func TestIssueEvent_GetDismissedReview(tt *testing.T) { } func TestIssueEvent_GetEvent(tt *testing.T) { + tt.Parallel() var zeroValue string i := &IssueEvent{Event: &zeroValue} i.GetEvent() @@ -11762,6 +13020,7 @@ func TestIssueEvent_GetEvent(tt *testing.T) { } func TestIssueEvent_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 i := &IssueEvent{ID: &zeroValue} i.GetID() @@ -11772,6 +13031,7 @@ func TestIssueEvent_GetID(tt *testing.T) { } func TestIssueEvent_GetIssue(tt *testing.T) { + tt.Parallel() i := &IssueEvent{} i.GetIssue() i = nil @@ -11779,6 +13039,7 @@ func TestIssueEvent_GetIssue(tt *testing.T) { } func TestIssueEvent_GetLabel(tt *testing.T) { + tt.Parallel() i := &IssueEvent{} i.GetLabel() i = nil @@ -11786,6 +13047,7 @@ func TestIssueEvent_GetLabel(tt *testing.T) { } func TestIssueEvent_GetLockReason(tt *testing.T) { + tt.Parallel() var zeroValue string i := &IssueEvent{LockReason: &zeroValue} i.GetLockReason() @@ -11796,6 +13058,7 @@ func TestIssueEvent_GetLockReason(tt *testing.T) { } func TestIssueEvent_GetMilestone(tt *testing.T) { + tt.Parallel() i := &IssueEvent{} i.GetMilestone() i = nil @@ -11803,6 +13066,7 @@ func TestIssueEvent_GetMilestone(tt *testing.T) { } func TestIssueEvent_GetPerformedViaGithubApp(tt *testing.T) { + tt.Parallel() i := &IssueEvent{} i.GetPerformedViaGithubApp() i = nil @@ -11810,6 +13074,7 @@ func TestIssueEvent_GetPerformedViaGithubApp(tt *testing.T) { } func TestIssueEvent_GetProjectCard(tt *testing.T) { + tt.Parallel() i := &IssueEvent{} i.GetProjectCard() i = nil @@ -11817,6 +13082,7 @@ func TestIssueEvent_GetProjectCard(tt *testing.T) { } func TestIssueEvent_GetRename(tt *testing.T) { + tt.Parallel() i := &IssueEvent{} i.GetRename() i = nil @@ -11824,6 +13090,7 @@ func TestIssueEvent_GetRename(tt *testing.T) { } func TestIssueEvent_GetRepository(tt *testing.T) { + tt.Parallel() i := &IssueEvent{} i.GetRepository() i = nil @@ -11831,6 +13098,7 @@ func TestIssueEvent_GetRepository(tt *testing.T) { } func TestIssueEvent_GetRequestedReviewer(tt *testing.T) { + tt.Parallel() i := &IssueEvent{} i.GetRequestedReviewer() i = nil @@ -11838,6 +13106,7 @@ func TestIssueEvent_GetRequestedReviewer(tt *testing.T) { } func TestIssueEvent_GetRequestedTeam(tt *testing.T) { + tt.Parallel() i := &IssueEvent{} i.GetRequestedTeam() i = nil @@ -11845,6 +13114,7 @@ func TestIssueEvent_GetRequestedTeam(tt *testing.T) { } func TestIssueEvent_GetReviewRequester(tt *testing.T) { + tt.Parallel() i := &IssueEvent{} i.GetReviewRequester() i = nil @@ -11852,6 +13122,7 @@ func TestIssueEvent_GetReviewRequester(tt *testing.T) { } func TestIssueEvent_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string i := &IssueEvent{URL: &zeroValue} i.GetURL() @@ -11862,6 +13133,7 @@ func TestIssueEvent_GetURL(tt *testing.T) { } func TestIssueImport_GetAssignee(tt *testing.T) { + tt.Parallel() var zeroValue string i := &IssueImport{Assignee: &zeroValue} i.GetAssignee() @@ -11872,6 +13144,7 @@ func TestIssueImport_GetAssignee(tt *testing.T) { } func TestIssueImport_GetClosed(tt *testing.T) { + tt.Parallel() var zeroValue bool i := &IssueImport{Closed: &zeroValue} i.GetClosed() @@ -11882,6 +13155,7 @@ func TestIssueImport_GetClosed(tt *testing.T) { } func TestIssueImport_GetClosedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp i := &IssueImport{ClosedAt: &zeroValue} i.GetClosedAt() @@ -11892,6 +13166,7 @@ func TestIssueImport_GetClosedAt(tt *testing.T) { } func TestIssueImport_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp i := &IssueImport{CreatedAt: &zeroValue} i.GetCreatedAt() @@ -11902,6 +13177,7 @@ func TestIssueImport_GetCreatedAt(tt *testing.T) { } func TestIssueImport_GetMilestone(tt *testing.T) { + tt.Parallel() var zeroValue int i := &IssueImport{Milestone: &zeroValue} i.GetMilestone() @@ -11912,6 +13188,7 @@ func TestIssueImport_GetMilestone(tt *testing.T) { } func TestIssueImport_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp i := &IssueImport{UpdatedAt: &zeroValue} i.GetUpdatedAt() @@ -11922,6 +13199,7 @@ func TestIssueImport_GetUpdatedAt(tt *testing.T) { } func TestIssueImportError_GetCode(tt *testing.T) { + tt.Parallel() var zeroValue string i := &IssueImportError{Code: &zeroValue} i.GetCode() @@ -11932,6 +13210,7 @@ func TestIssueImportError_GetCode(tt *testing.T) { } func TestIssueImportError_GetField(tt *testing.T) { + tt.Parallel() var zeroValue string i := &IssueImportError{Field: &zeroValue} i.GetField() @@ -11942,6 +13221,7 @@ func TestIssueImportError_GetField(tt *testing.T) { } func TestIssueImportError_GetLocation(tt *testing.T) { + tt.Parallel() var zeroValue string i := &IssueImportError{Location: &zeroValue} i.GetLocation() @@ -11952,6 +13232,7 @@ func TestIssueImportError_GetLocation(tt *testing.T) { } func TestIssueImportError_GetResource(tt *testing.T) { + tt.Parallel() var zeroValue string i := &IssueImportError{Resource: &zeroValue} i.GetResource() @@ -11962,6 +13243,7 @@ func TestIssueImportError_GetResource(tt *testing.T) { } func TestIssueImportError_GetValue(tt *testing.T) { + tt.Parallel() var zeroValue string i := &IssueImportError{Value: &zeroValue} i.GetValue() @@ -11972,6 +13254,7 @@ func TestIssueImportError_GetValue(tt *testing.T) { } func TestIssueImportResponse_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp i := &IssueImportResponse{CreatedAt: &zeroValue} i.GetCreatedAt() @@ -11982,6 +13265,7 @@ func TestIssueImportResponse_GetCreatedAt(tt *testing.T) { } func TestIssueImportResponse_GetDocumentationURL(tt *testing.T) { + tt.Parallel() var zeroValue string i := &IssueImportResponse{DocumentationURL: &zeroValue} i.GetDocumentationURL() @@ -11992,6 +13276,7 @@ func TestIssueImportResponse_GetDocumentationURL(tt *testing.T) { } func TestIssueImportResponse_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int i := &IssueImportResponse{ID: &zeroValue} i.GetID() @@ -12002,6 +13287,7 @@ func TestIssueImportResponse_GetID(tt *testing.T) { } func TestIssueImportResponse_GetImportIssuesURL(tt *testing.T) { + tt.Parallel() var zeroValue string i := &IssueImportResponse{ImportIssuesURL: &zeroValue} i.GetImportIssuesURL() @@ -12012,6 +13298,7 @@ func TestIssueImportResponse_GetImportIssuesURL(tt *testing.T) { } func TestIssueImportResponse_GetMessage(tt *testing.T) { + tt.Parallel() var zeroValue string i := &IssueImportResponse{Message: &zeroValue} i.GetMessage() @@ -12022,6 +13309,7 @@ func TestIssueImportResponse_GetMessage(tt *testing.T) { } func TestIssueImportResponse_GetRepositoryURL(tt *testing.T) { + tt.Parallel() var zeroValue string i := &IssueImportResponse{RepositoryURL: &zeroValue} i.GetRepositoryURL() @@ -12032,6 +13320,7 @@ func TestIssueImportResponse_GetRepositoryURL(tt *testing.T) { } func TestIssueImportResponse_GetStatus(tt *testing.T) { + tt.Parallel() var zeroValue string i := &IssueImportResponse{Status: &zeroValue} i.GetStatus() @@ -12042,6 +13331,7 @@ func TestIssueImportResponse_GetStatus(tt *testing.T) { } func TestIssueImportResponse_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp i := &IssueImportResponse{UpdatedAt: &zeroValue} i.GetUpdatedAt() @@ -12052,6 +13342,7 @@ func TestIssueImportResponse_GetUpdatedAt(tt *testing.T) { } func TestIssueImportResponse_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string i := &IssueImportResponse{URL: &zeroValue} i.GetURL() @@ -12062,6 +13353,7 @@ func TestIssueImportResponse_GetURL(tt *testing.T) { } func TestIssueListCommentsOptions_GetDirection(tt *testing.T) { + tt.Parallel() var zeroValue string i := &IssueListCommentsOptions{Direction: &zeroValue} i.GetDirection() @@ -12072,6 +13364,7 @@ func TestIssueListCommentsOptions_GetDirection(tt *testing.T) { } func TestIssueListCommentsOptions_GetSince(tt *testing.T) { + tt.Parallel() var zeroValue time.Time i := &IssueListCommentsOptions{Since: &zeroValue} i.GetSince() @@ -12082,6 +13375,7 @@ func TestIssueListCommentsOptions_GetSince(tt *testing.T) { } func TestIssueListCommentsOptions_GetSort(tt *testing.T) { + tt.Parallel() var zeroValue string i := &IssueListCommentsOptions{Sort: &zeroValue} i.GetSort() @@ -12092,6 +13386,7 @@ func TestIssueListCommentsOptions_GetSort(tt *testing.T) { } func TestIssueRequest_GetAssignee(tt *testing.T) { + tt.Parallel() var zeroValue string i := &IssueRequest{Assignee: &zeroValue} i.GetAssignee() @@ -12102,6 +13397,7 @@ func TestIssueRequest_GetAssignee(tt *testing.T) { } func TestIssueRequest_GetAssignees(tt *testing.T) { + tt.Parallel() var zeroValue []string i := &IssueRequest{Assignees: &zeroValue} i.GetAssignees() @@ -12112,6 +13408,7 @@ func TestIssueRequest_GetAssignees(tt *testing.T) { } func TestIssueRequest_GetBody(tt *testing.T) { + tt.Parallel() var zeroValue string i := &IssueRequest{Body: &zeroValue} i.GetBody() @@ -12122,6 +13419,7 @@ func TestIssueRequest_GetBody(tt *testing.T) { } func TestIssueRequest_GetLabels(tt *testing.T) { + tt.Parallel() var zeroValue []string i := &IssueRequest{Labels: &zeroValue} i.GetLabels() @@ -12132,6 +13430,7 @@ func TestIssueRequest_GetLabels(tt *testing.T) { } func TestIssueRequest_GetMilestone(tt *testing.T) { + tt.Parallel() var zeroValue int i := &IssueRequest{Milestone: &zeroValue} i.GetMilestone() @@ -12142,6 +13441,7 @@ func TestIssueRequest_GetMilestone(tt *testing.T) { } func TestIssueRequest_GetState(tt *testing.T) { + tt.Parallel() var zeroValue string i := &IssueRequest{State: &zeroValue} i.GetState() @@ -12152,6 +13452,7 @@ func TestIssueRequest_GetState(tt *testing.T) { } func TestIssueRequest_GetStateReason(tt *testing.T) { + tt.Parallel() var zeroValue string i := &IssueRequest{StateReason: &zeroValue} i.GetStateReason() @@ -12162,6 +13463,7 @@ func TestIssueRequest_GetStateReason(tt *testing.T) { } func TestIssueRequest_GetTitle(tt *testing.T) { + tt.Parallel() var zeroValue string i := &IssueRequest{Title: &zeroValue} i.GetTitle() @@ -12172,6 +13474,7 @@ func TestIssueRequest_GetTitle(tt *testing.T) { } func TestIssuesEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string i := &IssuesEvent{Action: &zeroValue} i.GetAction() @@ -12182,6 +13485,7 @@ func TestIssuesEvent_GetAction(tt *testing.T) { } func TestIssuesEvent_GetAssignee(tt *testing.T) { + tt.Parallel() i := &IssuesEvent{} i.GetAssignee() i = nil @@ -12189,6 +13493,7 @@ func TestIssuesEvent_GetAssignee(tt *testing.T) { } func TestIssuesEvent_GetChanges(tt *testing.T) { + tt.Parallel() i := &IssuesEvent{} i.GetChanges() i = nil @@ -12196,6 +13501,7 @@ func TestIssuesEvent_GetChanges(tt *testing.T) { } func TestIssuesEvent_GetInstallation(tt *testing.T) { + tt.Parallel() i := &IssuesEvent{} i.GetInstallation() i = nil @@ -12203,6 +13509,7 @@ func TestIssuesEvent_GetInstallation(tt *testing.T) { } func TestIssuesEvent_GetIssue(tt *testing.T) { + tt.Parallel() i := &IssuesEvent{} i.GetIssue() i = nil @@ -12210,6 +13517,7 @@ func TestIssuesEvent_GetIssue(tt *testing.T) { } func TestIssuesEvent_GetLabel(tt *testing.T) { + tt.Parallel() i := &IssuesEvent{} i.GetLabel() i = nil @@ -12217,6 +13525,7 @@ func TestIssuesEvent_GetLabel(tt *testing.T) { } func TestIssuesEvent_GetMilestone(tt *testing.T) { + tt.Parallel() i := &IssuesEvent{} i.GetMilestone() i = nil @@ -12224,6 +13533,7 @@ func TestIssuesEvent_GetMilestone(tt *testing.T) { } func TestIssuesEvent_GetOrg(tt *testing.T) { + tt.Parallel() i := &IssuesEvent{} i.GetOrg() i = nil @@ -12231,6 +13541,7 @@ func TestIssuesEvent_GetOrg(tt *testing.T) { } func TestIssuesEvent_GetRepo(tt *testing.T) { + tt.Parallel() i := &IssuesEvent{} i.GetRepo() i = nil @@ -12238,6 +13549,7 @@ func TestIssuesEvent_GetRepo(tt *testing.T) { } func TestIssuesEvent_GetSender(tt *testing.T) { + tt.Parallel() i := &IssuesEvent{} i.GetSender() i = nil @@ -12245,6 +13557,7 @@ func TestIssuesEvent_GetSender(tt *testing.T) { } func TestIssuesSearchResult_GetIncompleteResults(tt *testing.T) { + tt.Parallel() var zeroValue bool i := &IssuesSearchResult{IncompleteResults: &zeroValue} i.GetIncompleteResults() @@ -12255,6 +13568,7 @@ func TestIssuesSearchResult_GetIncompleteResults(tt *testing.T) { } func TestIssuesSearchResult_GetTotal(tt *testing.T) { + tt.Parallel() var zeroValue int i := &IssuesSearchResult{Total: &zeroValue} i.GetTotal() @@ -12265,6 +13579,7 @@ func TestIssuesSearchResult_GetTotal(tt *testing.T) { } func TestIssueStats_GetClosedIssues(tt *testing.T) { + tt.Parallel() var zeroValue int i := &IssueStats{ClosedIssues: &zeroValue} i.GetClosedIssues() @@ -12275,6 +13590,7 @@ func TestIssueStats_GetClosedIssues(tt *testing.T) { } func TestIssueStats_GetOpenIssues(tt *testing.T) { + tt.Parallel() var zeroValue int i := &IssueStats{OpenIssues: &zeroValue} i.GetOpenIssues() @@ -12285,6 +13601,7 @@ func TestIssueStats_GetOpenIssues(tt *testing.T) { } func TestIssueStats_GetTotalIssues(tt *testing.T) { + tt.Parallel() var zeroValue int i := &IssueStats{TotalIssues: &zeroValue} i.GetTotalIssues() @@ -12295,6 +13612,7 @@ func TestIssueStats_GetTotalIssues(tt *testing.T) { } func TestJITRunnerConfig_GetEncodedJITConfig(tt *testing.T) { + tt.Parallel() var zeroValue string j := &JITRunnerConfig{EncodedJITConfig: &zeroValue} j.GetEncodedJITConfig() @@ -12305,6 +13623,7 @@ func TestJITRunnerConfig_GetEncodedJITConfig(tt *testing.T) { } func TestJITRunnerConfig_GetRunner(tt *testing.T) { + tt.Parallel() j := &JITRunnerConfig{} j.GetRunner() j = nil @@ -12312,6 +13631,7 @@ func TestJITRunnerConfig_GetRunner(tt *testing.T) { } func TestJobs_GetTotalCount(tt *testing.T) { + tt.Parallel() var zeroValue int j := &Jobs{TotalCount: &zeroValue} j.GetTotalCount() @@ -12322,6 +13642,7 @@ func TestJobs_GetTotalCount(tt *testing.T) { } func TestKey_GetAddedBy(tt *testing.T) { + tt.Parallel() var zeroValue string k := &Key{AddedBy: &zeroValue} k.GetAddedBy() @@ -12332,6 +13653,7 @@ func TestKey_GetAddedBy(tt *testing.T) { } func TestKey_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp k := &Key{CreatedAt: &zeroValue} k.GetCreatedAt() @@ -12342,6 +13664,7 @@ func TestKey_GetCreatedAt(tt *testing.T) { } func TestKey_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 k := &Key{ID: &zeroValue} k.GetID() @@ -12352,6 +13675,7 @@ func TestKey_GetID(tt *testing.T) { } func TestKey_GetKey(tt *testing.T) { + tt.Parallel() var zeroValue string k := &Key{Key: &zeroValue} k.GetKey() @@ -12362,6 +13686,7 @@ func TestKey_GetKey(tt *testing.T) { } func TestKey_GetLastUsed(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp k := &Key{LastUsed: &zeroValue} k.GetLastUsed() @@ -12372,6 +13697,7 @@ func TestKey_GetLastUsed(tt *testing.T) { } func TestKey_GetReadOnly(tt *testing.T) { + tt.Parallel() var zeroValue bool k := &Key{ReadOnly: &zeroValue} k.GetReadOnly() @@ -12382,6 +13708,7 @@ func TestKey_GetReadOnly(tt *testing.T) { } func TestKey_GetTitle(tt *testing.T) { + tt.Parallel() var zeroValue string k := &Key{Title: &zeroValue} k.GetTitle() @@ -12392,6 +13719,7 @@ func TestKey_GetTitle(tt *testing.T) { } func TestKey_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string k := &Key{URL: &zeroValue} k.GetURL() @@ -12402,6 +13730,7 @@ func TestKey_GetURL(tt *testing.T) { } func TestKey_GetVerified(tt *testing.T) { + tt.Parallel() var zeroValue bool k := &Key{Verified: &zeroValue} k.GetVerified() @@ -12412,6 +13741,7 @@ func TestKey_GetVerified(tt *testing.T) { } func TestLabel_GetColor(tt *testing.T) { + tt.Parallel() var zeroValue string l := &Label{Color: &zeroValue} l.GetColor() @@ -12422,6 +13752,7 @@ func TestLabel_GetColor(tt *testing.T) { } func TestLabel_GetDefault(tt *testing.T) { + tt.Parallel() var zeroValue bool l := &Label{Default: &zeroValue} l.GetDefault() @@ -12432,6 +13763,7 @@ func TestLabel_GetDefault(tt *testing.T) { } func TestLabel_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string l := &Label{Description: &zeroValue} l.GetDescription() @@ -12442,6 +13774,7 @@ func TestLabel_GetDescription(tt *testing.T) { } func TestLabel_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 l := &Label{ID: &zeroValue} l.GetID() @@ -12452,6 +13785,7 @@ func TestLabel_GetID(tt *testing.T) { } func TestLabel_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string l := &Label{Name: &zeroValue} l.GetName() @@ -12462,6 +13796,7 @@ func TestLabel_GetName(tt *testing.T) { } func TestLabel_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string l := &Label{NodeID: &zeroValue} l.GetNodeID() @@ -12472,6 +13807,7 @@ func TestLabel_GetNodeID(tt *testing.T) { } func TestLabel_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string l := &Label{URL: &zeroValue} l.GetURL() @@ -12482,6 +13818,7 @@ func TestLabel_GetURL(tt *testing.T) { } func TestLabelEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string l := &LabelEvent{Action: &zeroValue} l.GetAction() @@ -12492,6 +13829,7 @@ func TestLabelEvent_GetAction(tt *testing.T) { } func TestLabelEvent_GetChanges(tt *testing.T) { + tt.Parallel() l := &LabelEvent{} l.GetChanges() l = nil @@ -12499,6 +13837,7 @@ func TestLabelEvent_GetChanges(tt *testing.T) { } func TestLabelEvent_GetInstallation(tt *testing.T) { + tt.Parallel() l := &LabelEvent{} l.GetInstallation() l = nil @@ -12506,6 +13845,7 @@ func TestLabelEvent_GetInstallation(tt *testing.T) { } func TestLabelEvent_GetLabel(tt *testing.T) { + tt.Parallel() l := &LabelEvent{} l.GetLabel() l = nil @@ -12513,6 +13853,7 @@ func TestLabelEvent_GetLabel(tt *testing.T) { } func TestLabelEvent_GetOrg(tt *testing.T) { + tt.Parallel() l := &LabelEvent{} l.GetOrg() l = nil @@ -12520,6 +13861,7 @@ func TestLabelEvent_GetOrg(tt *testing.T) { } func TestLabelEvent_GetRepo(tt *testing.T) { + tt.Parallel() l := &LabelEvent{} l.GetRepo() l = nil @@ -12527,6 +13869,7 @@ func TestLabelEvent_GetRepo(tt *testing.T) { } func TestLabelEvent_GetSender(tt *testing.T) { + tt.Parallel() l := &LabelEvent{} l.GetSender() l = nil @@ -12534,6 +13877,7 @@ func TestLabelEvent_GetSender(tt *testing.T) { } func TestLabelResult_GetColor(tt *testing.T) { + tt.Parallel() var zeroValue string l := &LabelResult{Color: &zeroValue} l.GetColor() @@ -12544,6 +13888,7 @@ func TestLabelResult_GetColor(tt *testing.T) { } func TestLabelResult_GetDefault(tt *testing.T) { + tt.Parallel() var zeroValue bool l := &LabelResult{Default: &zeroValue} l.GetDefault() @@ -12554,6 +13899,7 @@ func TestLabelResult_GetDefault(tt *testing.T) { } func TestLabelResult_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string l := &LabelResult{Description: &zeroValue} l.GetDescription() @@ -12564,6 +13910,7 @@ func TestLabelResult_GetDescription(tt *testing.T) { } func TestLabelResult_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 l := &LabelResult{ID: &zeroValue} l.GetID() @@ -12574,6 +13921,7 @@ func TestLabelResult_GetID(tt *testing.T) { } func TestLabelResult_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string l := &LabelResult{Name: &zeroValue} l.GetName() @@ -12584,6 +13932,7 @@ func TestLabelResult_GetName(tt *testing.T) { } func TestLabelResult_GetScore(tt *testing.T) { + tt.Parallel() l := &LabelResult{} l.GetScore() l = nil @@ -12591,6 +13940,7 @@ func TestLabelResult_GetScore(tt *testing.T) { } func TestLabelResult_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string l := &LabelResult{URL: &zeroValue} l.GetURL() @@ -12601,6 +13951,7 @@ func TestLabelResult_GetURL(tt *testing.T) { } func TestLabelsSearchResult_GetIncompleteResults(tt *testing.T) { + tt.Parallel() var zeroValue bool l := &LabelsSearchResult{IncompleteResults: &zeroValue} l.GetIncompleteResults() @@ -12611,6 +13962,7 @@ func TestLabelsSearchResult_GetIncompleteResults(tt *testing.T) { } func TestLabelsSearchResult_GetTotal(tt *testing.T) { + tt.Parallel() var zeroValue int l := &LabelsSearchResult{Total: &zeroValue} l.GetTotal() @@ -12621,6 +13973,7 @@ func TestLabelsSearchResult_GetTotal(tt *testing.T) { } func TestLargeFile_GetOID(tt *testing.T) { + tt.Parallel() var zeroValue string l := &LargeFile{OID: &zeroValue} l.GetOID() @@ -12631,6 +13984,7 @@ func TestLargeFile_GetOID(tt *testing.T) { } func TestLargeFile_GetPath(tt *testing.T) { + tt.Parallel() var zeroValue string l := &LargeFile{Path: &zeroValue} l.GetPath() @@ -12641,6 +13995,7 @@ func TestLargeFile_GetPath(tt *testing.T) { } func TestLargeFile_GetRefName(tt *testing.T) { + tt.Parallel() var zeroValue string l := &LargeFile{RefName: &zeroValue} l.GetRefName() @@ -12651,6 +14006,7 @@ func TestLargeFile_GetRefName(tt *testing.T) { } func TestLargeFile_GetSize(tt *testing.T) { + tt.Parallel() var zeroValue int l := &LargeFile{Size: &zeroValue} l.GetSize() @@ -12661,6 +14017,7 @@ func TestLargeFile_GetSize(tt *testing.T) { } func TestLicense_GetBody(tt *testing.T) { + tt.Parallel() var zeroValue string l := &License{Body: &zeroValue} l.GetBody() @@ -12671,6 +14028,7 @@ func TestLicense_GetBody(tt *testing.T) { } func TestLicense_GetConditions(tt *testing.T) { + tt.Parallel() var zeroValue []string l := &License{Conditions: &zeroValue} l.GetConditions() @@ -12681,6 +14039,7 @@ func TestLicense_GetConditions(tt *testing.T) { } func TestLicense_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string l := &License{Description: &zeroValue} l.GetDescription() @@ -12691,6 +14050,7 @@ func TestLicense_GetDescription(tt *testing.T) { } func TestLicense_GetFeatured(tt *testing.T) { + tt.Parallel() var zeroValue bool l := &License{Featured: &zeroValue} l.GetFeatured() @@ -12701,6 +14061,7 @@ func TestLicense_GetFeatured(tt *testing.T) { } func TestLicense_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string l := &License{HTMLURL: &zeroValue} l.GetHTMLURL() @@ -12711,6 +14072,7 @@ func TestLicense_GetHTMLURL(tt *testing.T) { } func TestLicense_GetImplementation(tt *testing.T) { + tt.Parallel() var zeroValue string l := &License{Implementation: &zeroValue} l.GetImplementation() @@ -12721,6 +14083,7 @@ func TestLicense_GetImplementation(tt *testing.T) { } func TestLicense_GetKey(tt *testing.T) { + tt.Parallel() var zeroValue string l := &License{Key: &zeroValue} l.GetKey() @@ -12731,6 +14094,7 @@ func TestLicense_GetKey(tt *testing.T) { } func TestLicense_GetLimitations(tt *testing.T) { + tt.Parallel() var zeroValue []string l := &License{Limitations: &zeroValue} l.GetLimitations() @@ -12741,6 +14105,7 @@ func TestLicense_GetLimitations(tt *testing.T) { } func TestLicense_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string l := &License{Name: &zeroValue} l.GetName() @@ -12751,6 +14116,7 @@ func TestLicense_GetName(tt *testing.T) { } func TestLicense_GetPermissions(tt *testing.T) { + tt.Parallel() var zeroValue []string l := &License{Permissions: &zeroValue} l.GetPermissions() @@ -12761,6 +14127,7 @@ func TestLicense_GetPermissions(tt *testing.T) { } func TestLicense_GetSPDXID(tt *testing.T) { + tt.Parallel() var zeroValue string l := &License{SPDXID: &zeroValue} l.GetSPDXID() @@ -12771,6 +14138,7 @@ func TestLicense_GetSPDXID(tt *testing.T) { } func TestLicense_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string l := &License{URL: &zeroValue} l.GetURL() @@ -12781,6 +14149,7 @@ func TestLicense_GetURL(tt *testing.T) { } func TestLinearHistoryRequirementEnforcementLevelChanges_GetFrom(tt *testing.T) { + tt.Parallel() var zeroValue string l := &LinearHistoryRequirementEnforcementLevelChanges{From: &zeroValue} l.GetFrom() @@ -12791,6 +14160,7 @@ func TestLinearHistoryRequirementEnforcementLevelChanges_GetFrom(tt *testing.T) } func TestListAlertsOptions_GetDirection(tt *testing.T) { + tt.Parallel() var zeroValue string l := &ListAlertsOptions{Direction: &zeroValue} l.GetDirection() @@ -12801,6 +14171,7 @@ func TestListAlertsOptions_GetDirection(tt *testing.T) { } func TestListAlertsOptions_GetEcosystem(tt *testing.T) { + tt.Parallel() var zeroValue string l := &ListAlertsOptions{Ecosystem: &zeroValue} l.GetEcosystem() @@ -12811,6 +14182,7 @@ func TestListAlertsOptions_GetEcosystem(tt *testing.T) { } func TestListAlertsOptions_GetPackage(tt *testing.T) { + tt.Parallel() var zeroValue string l := &ListAlertsOptions{Package: &zeroValue} l.GetPackage() @@ -12821,6 +14193,7 @@ func TestListAlertsOptions_GetPackage(tt *testing.T) { } func TestListAlertsOptions_GetScope(tt *testing.T) { + tt.Parallel() var zeroValue string l := &ListAlertsOptions{Scope: &zeroValue} l.GetScope() @@ -12831,6 +14204,7 @@ func TestListAlertsOptions_GetScope(tt *testing.T) { } func TestListAlertsOptions_GetSeverity(tt *testing.T) { + tt.Parallel() var zeroValue string l := &ListAlertsOptions{Severity: &zeroValue} l.GetSeverity() @@ -12841,6 +14215,7 @@ func TestListAlertsOptions_GetSeverity(tt *testing.T) { } func TestListAlertsOptions_GetSort(tt *testing.T) { + tt.Parallel() var zeroValue string l := &ListAlertsOptions{Sort: &zeroValue} l.GetSort() @@ -12851,6 +14226,7 @@ func TestListAlertsOptions_GetSort(tt *testing.T) { } func TestListAlertsOptions_GetState(tt *testing.T) { + tt.Parallel() var zeroValue string l := &ListAlertsOptions{State: &zeroValue} l.GetState() @@ -12861,6 +14237,7 @@ func TestListAlertsOptions_GetState(tt *testing.T) { } func TestListCheckRunsOptions_GetAppID(tt *testing.T) { + tt.Parallel() var zeroValue int64 l := &ListCheckRunsOptions{AppID: &zeroValue} l.GetAppID() @@ -12871,6 +14248,7 @@ func TestListCheckRunsOptions_GetAppID(tt *testing.T) { } func TestListCheckRunsOptions_GetCheckName(tt *testing.T) { + tt.Parallel() var zeroValue string l := &ListCheckRunsOptions{CheckName: &zeroValue} l.GetCheckName() @@ -12881,6 +14259,7 @@ func TestListCheckRunsOptions_GetCheckName(tt *testing.T) { } func TestListCheckRunsOptions_GetFilter(tt *testing.T) { + tt.Parallel() var zeroValue string l := &ListCheckRunsOptions{Filter: &zeroValue} l.GetFilter() @@ -12891,6 +14270,7 @@ func TestListCheckRunsOptions_GetFilter(tt *testing.T) { } func TestListCheckRunsOptions_GetStatus(tt *testing.T) { + tt.Parallel() var zeroValue string l := &ListCheckRunsOptions{Status: &zeroValue} l.GetStatus() @@ -12901,6 +14281,7 @@ func TestListCheckRunsOptions_GetStatus(tt *testing.T) { } func TestListCheckRunsResults_GetTotal(tt *testing.T) { + tt.Parallel() var zeroValue int l := &ListCheckRunsResults{Total: &zeroValue} l.GetTotal() @@ -12911,6 +14292,7 @@ func TestListCheckRunsResults_GetTotal(tt *testing.T) { } func TestListCheckSuiteOptions_GetAppID(tt *testing.T) { + tt.Parallel() var zeroValue int l := &ListCheckSuiteOptions{AppID: &zeroValue} l.GetAppID() @@ -12921,6 +14303,7 @@ func TestListCheckSuiteOptions_GetAppID(tt *testing.T) { } func TestListCheckSuiteOptions_GetCheckName(tt *testing.T) { + tt.Parallel() var zeroValue string l := &ListCheckSuiteOptions{CheckName: &zeroValue} l.GetCheckName() @@ -12931,6 +14314,7 @@ func TestListCheckSuiteOptions_GetCheckName(tt *testing.T) { } func TestListCheckSuiteResults_GetTotal(tt *testing.T) { + tt.Parallel() var zeroValue int l := &ListCheckSuiteResults{Total: &zeroValue} l.GetTotal() @@ -12941,6 +14325,7 @@ func TestListCheckSuiteResults_GetTotal(tt *testing.T) { } func TestListCodespaces_GetTotalCount(tt *testing.T) { + tt.Parallel() var zeroValue int l := &ListCodespaces{TotalCount: &zeroValue} l.GetTotalCount() @@ -12951,6 +14336,7 @@ func TestListCodespaces_GetTotalCount(tt *testing.T) { } func TestListCollaboratorOptions_GetAffiliation(tt *testing.T) { + tt.Parallel() var zeroValue string l := &ListCollaboratorOptions{Affiliation: &zeroValue} l.GetAffiliation() @@ -12961,6 +14347,7 @@ func TestListCollaboratorOptions_GetAffiliation(tt *testing.T) { } func TestListCustomDeploymentRuleIntegrationsResponse_GetTotalCount(tt *testing.T) { + tt.Parallel() var zeroValue int l := &ListCustomDeploymentRuleIntegrationsResponse{TotalCount: &zeroValue} l.GetTotalCount() @@ -12971,6 +14358,7 @@ func TestListCustomDeploymentRuleIntegrationsResponse_GetTotalCount(tt *testing. } func TestListDeploymentProtectionRuleResponse_GetTotalCount(tt *testing.T) { + tt.Parallel() var zeroValue int l := &ListDeploymentProtectionRuleResponse{TotalCount: &zeroValue} l.GetTotalCount() @@ -12981,6 +14369,7 @@ func TestListDeploymentProtectionRuleResponse_GetTotalCount(tt *testing.T) { } func TestListExternalGroupsOptions_GetDisplayName(tt *testing.T) { + tt.Parallel() var zeroValue string l := &ListExternalGroupsOptions{DisplayName: &zeroValue} l.GetDisplayName() @@ -12991,6 +14380,7 @@ func TestListExternalGroupsOptions_GetDisplayName(tt *testing.T) { } func TestListGlobalSecurityAdvisoriesOptions_GetAffects(tt *testing.T) { + tt.Parallel() var zeroValue string l := &ListGlobalSecurityAdvisoriesOptions{Affects: &zeroValue} l.GetAffects() @@ -13001,6 +14391,7 @@ func TestListGlobalSecurityAdvisoriesOptions_GetAffects(tt *testing.T) { } func TestListGlobalSecurityAdvisoriesOptions_GetCVEID(tt *testing.T) { + tt.Parallel() var zeroValue string l := &ListGlobalSecurityAdvisoriesOptions{CVEID: &zeroValue} l.GetCVEID() @@ -13011,6 +14402,7 @@ func TestListGlobalSecurityAdvisoriesOptions_GetCVEID(tt *testing.T) { } func TestListGlobalSecurityAdvisoriesOptions_GetEcosystem(tt *testing.T) { + tt.Parallel() var zeroValue string l := &ListGlobalSecurityAdvisoriesOptions{Ecosystem: &zeroValue} l.GetEcosystem() @@ -13021,6 +14413,7 @@ func TestListGlobalSecurityAdvisoriesOptions_GetEcosystem(tt *testing.T) { } func TestListGlobalSecurityAdvisoriesOptions_GetGHSAID(tt *testing.T) { + tt.Parallel() var zeroValue string l := &ListGlobalSecurityAdvisoriesOptions{GHSAID: &zeroValue} l.GetGHSAID() @@ -13031,6 +14424,7 @@ func TestListGlobalSecurityAdvisoriesOptions_GetGHSAID(tt *testing.T) { } func TestListGlobalSecurityAdvisoriesOptions_GetIsWithdrawn(tt *testing.T) { + tt.Parallel() var zeroValue bool l := &ListGlobalSecurityAdvisoriesOptions{IsWithdrawn: &zeroValue} l.GetIsWithdrawn() @@ -13041,6 +14435,7 @@ func TestListGlobalSecurityAdvisoriesOptions_GetIsWithdrawn(tt *testing.T) { } func TestListGlobalSecurityAdvisoriesOptions_GetModified(tt *testing.T) { + tt.Parallel() var zeroValue string l := &ListGlobalSecurityAdvisoriesOptions{Modified: &zeroValue} l.GetModified() @@ -13051,6 +14446,7 @@ func TestListGlobalSecurityAdvisoriesOptions_GetModified(tt *testing.T) { } func TestListGlobalSecurityAdvisoriesOptions_GetPublished(tt *testing.T) { + tt.Parallel() var zeroValue string l := &ListGlobalSecurityAdvisoriesOptions{Published: &zeroValue} l.GetPublished() @@ -13061,6 +14457,7 @@ func TestListGlobalSecurityAdvisoriesOptions_GetPublished(tt *testing.T) { } func TestListGlobalSecurityAdvisoriesOptions_GetSeverity(tt *testing.T) { + tt.Parallel() var zeroValue string l := &ListGlobalSecurityAdvisoriesOptions{Severity: &zeroValue} l.GetSeverity() @@ -13071,6 +14468,7 @@ func TestListGlobalSecurityAdvisoriesOptions_GetSeverity(tt *testing.T) { } func TestListGlobalSecurityAdvisoriesOptions_GetType(tt *testing.T) { + tt.Parallel() var zeroValue string l := &ListGlobalSecurityAdvisoriesOptions{Type: &zeroValue} l.GetType() @@ -13081,6 +14479,7 @@ func TestListGlobalSecurityAdvisoriesOptions_GetType(tt *testing.T) { } func TestListGlobalSecurityAdvisoriesOptions_GetUpdated(tt *testing.T) { + tt.Parallel() var zeroValue string l := &ListGlobalSecurityAdvisoriesOptions{Updated: &zeroValue} l.GetUpdated() @@ -13091,6 +14490,7 @@ func TestListGlobalSecurityAdvisoriesOptions_GetUpdated(tt *testing.T) { } func TestListOrganizations_GetTotalCount(tt *testing.T) { + tt.Parallel() var zeroValue int l := &ListOrganizations{TotalCount: &zeroValue} l.GetTotalCount() @@ -13101,6 +14501,7 @@ func TestListOrganizations_GetTotalCount(tt *testing.T) { } func TestListRepositories_GetTotalCount(tt *testing.T) { + tt.Parallel() var zeroValue int l := &ListRepositories{TotalCount: &zeroValue} l.GetTotalCount() @@ -13111,6 +14512,7 @@ func TestListRepositories_GetTotalCount(tt *testing.T) { } func TestListRunnersOptions_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string l := &ListRunnersOptions{Name: &zeroValue} l.GetName() @@ -13121,6 +14523,7 @@ func TestListRunnersOptions_GetName(tt *testing.T) { } func TestListSCIMProvisionedIdentitiesOptions_GetCount(tt *testing.T) { + tt.Parallel() var zeroValue int l := &ListSCIMProvisionedIdentitiesOptions{Count: &zeroValue} l.GetCount() @@ -13131,6 +14534,7 @@ func TestListSCIMProvisionedIdentitiesOptions_GetCount(tt *testing.T) { } func TestListSCIMProvisionedIdentitiesOptions_GetFilter(tt *testing.T) { + tt.Parallel() var zeroValue string l := &ListSCIMProvisionedIdentitiesOptions{Filter: &zeroValue} l.GetFilter() @@ -13141,6 +14545,7 @@ func TestListSCIMProvisionedIdentitiesOptions_GetFilter(tt *testing.T) { } func TestListSCIMProvisionedIdentitiesOptions_GetStartIndex(tt *testing.T) { + tt.Parallel() var zeroValue int l := &ListSCIMProvisionedIdentitiesOptions{StartIndex: &zeroValue} l.GetStartIndex() @@ -13151,6 +14556,7 @@ func TestListSCIMProvisionedIdentitiesOptions_GetStartIndex(tt *testing.T) { } func TestLocation_GetEndColumn(tt *testing.T) { + tt.Parallel() var zeroValue int l := &Location{EndColumn: &zeroValue} l.GetEndColumn() @@ -13161,6 +14567,7 @@ func TestLocation_GetEndColumn(tt *testing.T) { } func TestLocation_GetEndLine(tt *testing.T) { + tt.Parallel() var zeroValue int l := &Location{EndLine: &zeroValue} l.GetEndLine() @@ -13171,6 +14578,7 @@ func TestLocation_GetEndLine(tt *testing.T) { } func TestLocation_GetPath(tt *testing.T) { + tt.Parallel() var zeroValue string l := &Location{Path: &zeroValue} l.GetPath() @@ -13181,6 +14589,7 @@ func TestLocation_GetPath(tt *testing.T) { } func TestLocation_GetStartColumn(tt *testing.T) { + tt.Parallel() var zeroValue int l := &Location{StartColumn: &zeroValue} l.GetStartColumn() @@ -13191,6 +14600,7 @@ func TestLocation_GetStartColumn(tt *testing.T) { } func TestLocation_GetStartLine(tt *testing.T) { + tt.Parallel() var zeroValue int l := &Location{StartLine: &zeroValue} l.GetStartLine() @@ -13201,6 +14611,7 @@ func TestLocation_GetStartLine(tt *testing.T) { } func TestLockBranch_GetEnabled(tt *testing.T) { + tt.Parallel() var zeroValue bool l := &LockBranch{Enabled: &zeroValue} l.GetEnabled() @@ -13211,6 +14622,7 @@ func TestLockBranch_GetEnabled(tt *testing.T) { } func TestMarketplacePendingChange_GetEffectiveDate(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp m := &MarketplacePendingChange{EffectiveDate: &zeroValue} m.GetEffectiveDate() @@ -13221,6 +14633,7 @@ func TestMarketplacePendingChange_GetEffectiveDate(tt *testing.T) { } func TestMarketplacePendingChange_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 m := &MarketplacePendingChange{ID: &zeroValue} m.GetID() @@ -13231,6 +14644,7 @@ func TestMarketplacePendingChange_GetID(tt *testing.T) { } func TestMarketplacePendingChange_GetPlan(tt *testing.T) { + tt.Parallel() m := &MarketplacePendingChange{} m.GetPlan() m = nil @@ -13238,6 +14652,7 @@ func TestMarketplacePendingChange_GetPlan(tt *testing.T) { } func TestMarketplacePendingChange_GetUnitCount(tt *testing.T) { + tt.Parallel() var zeroValue int m := &MarketplacePendingChange{UnitCount: &zeroValue} m.GetUnitCount() @@ -13248,6 +14663,7 @@ func TestMarketplacePendingChange_GetUnitCount(tt *testing.T) { } func TestMarketplacePlan_GetAccountsURL(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MarketplacePlan{AccountsURL: &zeroValue} m.GetAccountsURL() @@ -13258,6 +14674,7 @@ func TestMarketplacePlan_GetAccountsURL(tt *testing.T) { } func TestMarketplacePlan_GetBullets(tt *testing.T) { + tt.Parallel() var zeroValue []string m := &MarketplacePlan{Bullets: &zeroValue} m.GetBullets() @@ -13268,6 +14685,7 @@ func TestMarketplacePlan_GetBullets(tt *testing.T) { } func TestMarketplacePlan_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MarketplacePlan{Description: &zeroValue} m.GetDescription() @@ -13278,6 +14696,7 @@ func TestMarketplacePlan_GetDescription(tt *testing.T) { } func TestMarketplacePlan_GetHasFreeTrial(tt *testing.T) { + tt.Parallel() var zeroValue bool m := &MarketplacePlan{HasFreeTrial: &zeroValue} m.GetHasFreeTrial() @@ -13288,6 +14707,7 @@ func TestMarketplacePlan_GetHasFreeTrial(tt *testing.T) { } func TestMarketplacePlan_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 m := &MarketplacePlan{ID: &zeroValue} m.GetID() @@ -13298,6 +14718,7 @@ func TestMarketplacePlan_GetID(tt *testing.T) { } func TestMarketplacePlan_GetMonthlyPriceInCents(tt *testing.T) { + tt.Parallel() var zeroValue int m := &MarketplacePlan{MonthlyPriceInCents: &zeroValue} m.GetMonthlyPriceInCents() @@ -13308,6 +14729,7 @@ func TestMarketplacePlan_GetMonthlyPriceInCents(tt *testing.T) { } func TestMarketplacePlan_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MarketplacePlan{Name: &zeroValue} m.GetName() @@ -13318,6 +14740,7 @@ func TestMarketplacePlan_GetName(tt *testing.T) { } func TestMarketplacePlan_GetNumber(tt *testing.T) { + tt.Parallel() var zeroValue int m := &MarketplacePlan{Number: &zeroValue} m.GetNumber() @@ -13328,6 +14751,7 @@ func TestMarketplacePlan_GetNumber(tt *testing.T) { } func TestMarketplacePlan_GetPriceModel(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MarketplacePlan{PriceModel: &zeroValue} m.GetPriceModel() @@ -13338,6 +14762,7 @@ func TestMarketplacePlan_GetPriceModel(tt *testing.T) { } func TestMarketplacePlan_GetState(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MarketplacePlan{State: &zeroValue} m.GetState() @@ -13348,6 +14773,7 @@ func TestMarketplacePlan_GetState(tt *testing.T) { } func TestMarketplacePlan_GetUnitName(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MarketplacePlan{UnitName: &zeroValue} m.GetUnitName() @@ -13358,6 +14784,7 @@ func TestMarketplacePlan_GetUnitName(tt *testing.T) { } func TestMarketplacePlan_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MarketplacePlan{URL: &zeroValue} m.GetURL() @@ -13368,6 +14795,7 @@ func TestMarketplacePlan_GetURL(tt *testing.T) { } func TestMarketplacePlan_GetYearlyPriceInCents(tt *testing.T) { + tt.Parallel() var zeroValue int m := &MarketplacePlan{YearlyPriceInCents: &zeroValue} m.GetYearlyPriceInCents() @@ -13378,6 +14806,7 @@ func TestMarketplacePlan_GetYearlyPriceInCents(tt *testing.T) { } func TestMarketplacePlanAccount_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 m := &MarketplacePlanAccount{ID: &zeroValue} m.GetID() @@ -13388,6 +14817,7 @@ func TestMarketplacePlanAccount_GetID(tt *testing.T) { } func TestMarketplacePlanAccount_GetLogin(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MarketplacePlanAccount{Login: &zeroValue} m.GetLogin() @@ -13398,6 +14828,7 @@ func TestMarketplacePlanAccount_GetLogin(tt *testing.T) { } func TestMarketplacePlanAccount_GetMarketplacePendingChange(tt *testing.T) { + tt.Parallel() m := &MarketplacePlanAccount{} m.GetMarketplacePendingChange() m = nil @@ -13405,6 +14836,7 @@ func TestMarketplacePlanAccount_GetMarketplacePendingChange(tt *testing.T) { } func TestMarketplacePlanAccount_GetMarketplacePurchase(tt *testing.T) { + tt.Parallel() m := &MarketplacePlanAccount{} m.GetMarketplacePurchase() m = nil @@ -13412,6 +14844,7 @@ func TestMarketplacePlanAccount_GetMarketplacePurchase(tt *testing.T) { } func TestMarketplacePlanAccount_GetOrganizationBillingEmail(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MarketplacePlanAccount{OrganizationBillingEmail: &zeroValue} m.GetOrganizationBillingEmail() @@ -13422,6 +14855,7 @@ func TestMarketplacePlanAccount_GetOrganizationBillingEmail(tt *testing.T) { } func TestMarketplacePlanAccount_GetType(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MarketplacePlanAccount{Type: &zeroValue} m.GetType() @@ -13432,6 +14866,7 @@ func TestMarketplacePlanAccount_GetType(tt *testing.T) { } func TestMarketplacePlanAccount_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MarketplacePlanAccount{URL: &zeroValue} m.GetURL() @@ -13442,6 +14877,7 @@ func TestMarketplacePlanAccount_GetURL(tt *testing.T) { } func TestMarketplacePurchase_GetAccount(tt *testing.T) { + tt.Parallel() m := &MarketplacePurchase{} m.GetAccount() m = nil @@ -13449,6 +14885,7 @@ func TestMarketplacePurchase_GetAccount(tt *testing.T) { } func TestMarketplacePurchase_GetBillingCycle(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MarketplacePurchase{BillingCycle: &zeroValue} m.GetBillingCycle() @@ -13459,6 +14896,7 @@ func TestMarketplacePurchase_GetBillingCycle(tt *testing.T) { } func TestMarketplacePurchase_GetFreeTrialEndsOn(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp m := &MarketplacePurchase{FreeTrialEndsOn: &zeroValue} m.GetFreeTrialEndsOn() @@ -13469,6 +14907,7 @@ func TestMarketplacePurchase_GetFreeTrialEndsOn(tt *testing.T) { } func TestMarketplacePurchase_GetNextBillingDate(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp m := &MarketplacePurchase{NextBillingDate: &zeroValue} m.GetNextBillingDate() @@ -13479,6 +14918,7 @@ func TestMarketplacePurchase_GetNextBillingDate(tt *testing.T) { } func TestMarketplacePurchase_GetOnFreeTrial(tt *testing.T) { + tt.Parallel() var zeroValue bool m := &MarketplacePurchase{OnFreeTrial: &zeroValue} m.GetOnFreeTrial() @@ -13489,6 +14929,7 @@ func TestMarketplacePurchase_GetOnFreeTrial(tt *testing.T) { } func TestMarketplacePurchase_GetPlan(tt *testing.T) { + tt.Parallel() m := &MarketplacePurchase{} m.GetPlan() m = nil @@ -13496,6 +14937,7 @@ func TestMarketplacePurchase_GetPlan(tt *testing.T) { } func TestMarketplacePurchase_GetUnitCount(tt *testing.T) { + tt.Parallel() var zeroValue int m := &MarketplacePurchase{UnitCount: &zeroValue} m.GetUnitCount() @@ -13506,6 +14948,7 @@ func TestMarketplacePurchase_GetUnitCount(tt *testing.T) { } func TestMarketplacePurchase_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp m := &MarketplacePurchase{UpdatedAt: &zeroValue} m.GetUpdatedAt() @@ -13516,6 +14959,7 @@ func TestMarketplacePurchase_GetUpdatedAt(tt *testing.T) { } func TestMarketplacePurchaseAccount_GetEmail(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MarketplacePurchaseAccount{Email: &zeroValue} m.GetEmail() @@ -13526,6 +14970,7 @@ func TestMarketplacePurchaseAccount_GetEmail(tt *testing.T) { } func TestMarketplacePurchaseAccount_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 m := &MarketplacePurchaseAccount{ID: &zeroValue} m.GetID() @@ -13536,6 +14981,7 @@ func TestMarketplacePurchaseAccount_GetID(tt *testing.T) { } func TestMarketplacePurchaseAccount_GetLogin(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MarketplacePurchaseAccount{Login: &zeroValue} m.GetLogin() @@ -13546,6 +14992,7 @@ func TestMarketplacePurchaseAccount_GetLogin(tt *testing.T) { } func TestMarketplacePurchaseAccount_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MarketplacePurchaseAccount{NodeID: &zeroValue} m.GetNodeID() @@ -13556,6 +15003,7 @@ func TestMarketplacePurchaseAccount_GetNodeID(tt *testing.T) { } func TestMarketplacePurchaseAccount_GetOrganizationBillingEmail(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MarketplacePurchaseAccount{OrganizationBillingEmail: &zeroValue} m.GetOrganizationBillingEmail() @@ -13566,6 +15014,7 @@ func TestMarketplacePurchaseAccount_GetOrganizationBillingEmail(tt *testing.T) { } func TestMarketplacePurchaseAccount_GetType(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MarketplacePurchaseAccount{Type: &zeroValue} m.GetType() @@ -13576,6 +15025,7 @@ func TestMarketplacePurchaseAccount_GetType(tt *testing.T) { } func TestMarketplacePurchaseAccount_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MarketplacePurchaseAccount{URL: &zeroValue} m.GetURL() @@ -13586,6 +15036,7 @@ func TestMarketplacePurchaseAccount_GetURL(tt *testing.T) { } func TestMarketplacePurchaseEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MarketplacePurchaseEvent{Action: &zeroValue} m.GetAction() @@ -13596,6 +15047,7 @@ func TestMarketplacePurchaseEvent_GetAction(tt *testing.T) { } func TestMarketplacePurchaseEvent_GetEffectiveDate(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp m := &MarketplacePurchaseEvent{EffectiveDate: &zeroValue} m.GetEffectiveDate() @@ -13606,6 +15058,7 @@ func TestMarketplacePurchaseEvent_GetEffectiveDate(tt *testing.T) { } func TestMarketplacePurchaseEvent_GetInstallation(tt *testing.T) { + tt.Parallel() m := &MarketplacePurchaseEvent{} m.GetInstallation() m = nil @@ -13613,6 +15066,7 @@ func TestMarketplacePurchaseEvent_GetInstallation(tt *testing.T) { } func TestMarketplacePurchaseEvent_GetMarketplacePurchase(tt *testing.T) { + tt.Parallel() m := &MarketplacePurchaseEvent{} m.GetMarketplacePurchase() m = nil @@ -13620,6 +15074,7 @@ func TestMarketplacePurchaseEvent_GetMarketplacePurchase(tt *testing.T) { } func TestMarketplacePurchaseEvent_GetOrg(tt *testing.T) { + tt.Parallel() m := &MarketplacePurchaseEvent{} m.GetOrg() m = nil @@ -13627,6 +15082,7 @@ func TestMarketplacePurchaseEvent_GetOrg(tt *testing.T) { } func TestMarketplacePurchaseEvent_GetPreviousMarketplacePurchase(tt *testing.T) { + tt.Parallel() m := &MarketplacePurchaseEvent{} m.GetPreviousMarketplacePurchase() m = nil @@ -13634,6 +15090,7 @@ func TestMarketplacePurchaseEvent_GetPreviousMarketplacePurchase(tt *testing.T) } func TestMarketplacePurchaseEvent_GetSender(tt *testing.T) { + tt.Parallel() m := &MarketplacePurchaseEvent{} m.GetSender() m = nil @@ -13641,6 +15098,7 @@ func TestMarketplacePurchaseEvent_GetSender(tt *testing.T) { } func TestMatch_GetText(tt *testing.T) { + tt.Parallel() var zeroValue string m := &Match{Text: &zeroValue} m.GetText() @@ -13651,6 +15109,7 @@ func TestMatch_GetText(tt *testing.T) { } func TestMemberChanges_GetPermission(tt *testing.T) { + tt.Parallel() m := &MemberChanges{} m.GetPermission() m = nil @@ -13658,6 +15117,7 @@ func TestMemberChanges_GetPermission(tt *testing.T) { } func TestMemberChanges_GetRoleName(tt *testing.T) { + tt.Parallel() m := &MemberChanges{} m.GetRoleName() m = nil @@ -13665,6 +15125,7 @@ func TestMemberChanges_GetRoleName(tt *testing.T) { } func TestMemberChangesPermission_GetFrom(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MemberChangesPermission{From: &zeroValue} m.GetFrom() @@ -13675,6 +15136,7 @@ func TestMemberChangesPermission_GetFrom(tt *testing.T) { } func TestMemberChangesPermission_GetTo(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MemberChangesPermission{To: &zeroValue} m.GetTo() @@ -13685,6 +15147,7 @@ func TestMemberChangesPermission_GetTo(tt *testing.T) { } func TestMemberChangesRoleName_GetFrom(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MemberChangesRoleName{From: &zeroValue} m.GetFrom() @@ -13695,6 +15158,7 @@ func TestMemberChangesRoleName_GetFrom(tt *testing.T) { } func TestMemberChangesRoleName_GetTo(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MemberChangesRoleName{To: &zeroValue} m.GetTo() @@ -13705,6 +15169,7 @@ func TestMemberChangesRoleName_GetTo(tt *testing.T) { } func TestMemberEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MemberEvent{Action: &zeroValue} m.GetAction() @@ -13715,6 +15180,7 @@ func TestMemberEvent_GetAction(tt *testing.T) { } func TestMemberEvent_GetChanges(tt *testing.T) { + tt.Parallel() m := &MemberEvent{} m.GetChanges() m = nil @@ -13722,6 +15188,7 @@ func TestMemberEvent_GetChanges(tt *testing.T) { } func TestMemberEvent_GetInstallation(tt *testing.T) { + tt.Parallel() m := &MemberEvent{} m.GetInstallation() m = nil @@ -13729,6 +15196,7 @@ func TestMemberEvent_GetInstallation(tt *testing.T) { } func TestMemberEvent_GetMember(tt *testing.T) { + tt.Parallel() m := &MemberEvent{} m.GetMember() m = nil @@ -13736,6 +15204,7 @@ func TestMemberEvent_GetMember(tt *testing.T) { } func TestMemberEvent_GetOrg(tt *testing.T) { + tt.Parallel() m := &MemberEvent{} m.GetOrg() m = nil @@ -13743,6 +15212,7 @@ func TestMemberEvent_GetOrg(tt *testing.T) { } func TestMemberEvent_GetRepo(tt *testing.T) { + tt.Parallel() m := &MemberEvent{} m.GetRepo() m = nil @@ -13750,6 +15220,7 @@ func TestMemberEvent_GetRepo(tt *testing.T) { } func TestMemberEvent_GetSender(tt *testing.T) { + tt.Parallel() m := &MemberEvent{} m.GetSender() m = nil @@ -13757,6 +15228,7 @@ func TestMemberEvent_GetSender(tt *testing.T) { } func TestMembership_GetOrganization(tt *testing.T) { + tt.Parallel() m := &Membership{} m.GetOrganization() m = nil @@ -13764,6 +15236,7 @@ func TestMembership_GetOrganization(tt *testing.T) { } func TestMembership_GetOrganizationURL(tt *testing.T) { + tt.Parallel() var zeroValue string m := &Membership{OrganizationURL: &zeroValue} m.GetOrganizationURL() @@ -13774,6 +15247,7 @@ func TestMembership_GetOrganizationURL(tt *testing.T) { } func TestMembership_GetRole(tt *testing.T) { + tt.Parallel() var zeroValue string m := &Membership{Role: &zeroValue} m.GetRole() @@ -13784,6 +15258,7 @@ func TestMembership_GetRole(tt *testing.T) { } func TestMembership_GetState(tt *testing.T) { + tt.Parallel() var zeroValue string m := &Membership{State: &zeroValue} m.GetState() @@ -13794,6 +15269,7 @@ func TestMembership_GetState(tt *testing.T) { } func TestMembership_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string m := &Membership{URL: &zeroValue} m.GetURL() @@ -13804,6 +15280,7 @@ func TestMembership_GetURL(tt *testing.T) { } func TestMembership_GetUser(tt *testing.T) { + tt.Parallel() m := &Membership{} m.GetUser() m = nil @@ -13811,6 +15288,7 @@ func TestMembership_GetUser(tt *testing.T) { } func TestMembershipEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MembershipEvent{Action: &zeroValue} m.GetAction() @@ -13821,6 +15299,7 @@ func TestMembershipEvent_GetAction(tt *testing.T) { } func TestMembershipEvent_GetInstallation(tt *testing.T) { + tt.Parallel() m := &MembershipEvent{} m.GetInstallation() m = nil @@ -13828,6 +15307,7 @@ func TestMembershipEvent_GetInstallation(tt *testing.T) { } func TestMembershipEvent_GetMember(tt *testing.T) { + tt.Parallel() m := &MembershipEvent{} m.GetMember() m = nil @@ -13835,6 +15315,7 @@ func TestMembershipEvent_GetMember(tt *testing.T) { } func TestMembershipEvent_GetOrg(tt *testing.T) { + tt.Parallel() m := &MembershipEvent{} m.GetOrg() m = nil @@ -13842,6 +15323,7 @@ func TestMembershipEvent_GetOrg(tt *testing.T) { } func TestMembershipEvent_GetScope(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MembershipEvent{Scope: &zeroValue} m.GetScope() @@ -13852,6 +15334,7 @@ func TestMembershipEvent_GetScope(tt *testing.T) { } func TestMembershipEvent_GetSender(tt *testing.T) { + tt.Parallel() m := &MembershipEvent{} m.GetSender() m = nil @@ -13859,6 +15342,7 @@ func TestMembershipEvent_GetSender(tt *testing.T) { } func TestMembershipEvent_GetTeam(tt *testing.T) { + tt.Parallel() m := &MembershipEvent{} m.GetTeam() m = nil @@ -13866,6 +15350,7 @@ func TestMembershipEvent_GetTeam(tt *testing.T) { } func TestMergeGroup_GetBaseRef(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MergeGroup{BaseRef: &zeroValue} m.GetBaseRef() @@ -13876,6 +15361,7 @@ func TestMergeGroup_GetBaseRef(tt *testing.T) { } func TestMergeGroup_GetBaseSHA(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MergeGroup{BaseSHA: &zeroValue} m.GetBaseSHA() @@ -13886,6 +15372,7 @@ func TestMergeGroup_GetBaseSHA(tt *testing.T) { } func TestMergeGroup_GetHeadCommit(tt *testing.T) { + tt.Parallel() m := &MergeGroup{} m.GetHeadCommit() m = nil @@ -13893,6 +15380,7 @@ func TestMergeGroup_GetHeadCommit(tt *testing.T) { } func TestMergeGroup_GetHeadRef(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MergeGroup{HeadRef: &zeroValue} m.GetHeadRef() @@ -13903,6 +15391,7 @@ func TestMergeGroup_GetHeadRef(tt *testing.T) { } func TestMergeGroup_GetHeadSHA(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MergeGroup{HeadSHA: &zeroValue} m.GetHeadSHA() @@ -13913,6 +15402,7 @@ func TestMergeGroup_GetHeadSHA(tt *testing.T) { } func TestMergeGroupEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MergeGroupEvent{Action: &zeroValue} m.GetAction() @@ -13923,6 +15413,7 @@ func TestMergeGroupEvent_GetAction(tt *testing.T) { } func TestMergeGroupEvent_GetInstallation(tt *testing.T) { + tt.Parallel() m := &MergeGroupEvent{} m.GetInstallation() m = nil @@ -13930,6 +15421,7 @@ func TestMergeGroupEvent_GetInstallation(tt *testing.T) { } func TestMergeGroupEvent_GetMergeGroup(tt *testing.T) { + tt.Parallel() m := &MergeGroupEvent{} m.GetMergeGroup() m = nil @@ -13937,6 +15429,7 @@ func TestMergeGroupEvent_GetMergeGroup(tt *testing.T) { } func TestMergeGroupEvent_GetOrg(tt *testing.T) { + tt.Parallel() m := &MergeGroupEvent{} m.GetOrg() m = nil @@ -13944,6 +15437,7 @@ func TestMergeGroupEvent_GetOrg(tt *testing.T) { } func TestMergeGroupEvent_GetRepo(tt *testing.T) { + tt.Parallel() m := &MergeGroupEvent{} m.GetRepo() m = nil @@ -13951,6 +15445,7 @@ func TestMergeGroupEvent_GetRepo(tt *testing.T) { } func TestMergeGroupEvent_GetSender(tt *testing.T) { + tt.Parallel() m := &MergeGroupEvent{} m.GetSender() m = nil @@ -13958,6 +15453,7 @@ func TestMergeGroupEvent_GetSender(tt *testing.T) { } func TestMessage_GetText(tt *testing.T) { + tt.Parallel() var zeroValue string m := &Message{Text: &zeroValue} m.GetText() @@ -13968,6 +15464,7 @@ func TestMessage_GetText(tt *testing.T) { } func TestMetaEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MetaEvent{Action: &zeroValue} m.GetAction() @@ -13978,6 +15475,7 @@ func TestMetaEvent_GetAction(tt *testing.T) { } func TestMetaEvent_GetHook(tt *testing.T) { + tt.Parallel() m := &MetaEvent{} m.GetHook() m = nil @@ -13985,6 +15483,7 @@ func TestMetaEvent_GetHook(tt *testing.T) { } func TestMetaEvent_GetHookID(tt *testing.T) { + tt.Parallel() var zeroValue int64 m := &MetaEvent{HookID: &zeroValue} m.GetHookID() @@ -13995,6 +15494,7 @@ func TestMetaEvent_GetHookID(tt *testing.T) { } func TestMetaEvent_GetInstallation(tt *testing.T) { + tt.Parallel() m := &MetaEvent{} m.GetInstallation() m = nil @@ -14002,6 +15502,7 @@ func TestMetaEvent_GetInstallation(tt *testing.T) { } func TestMetaEvent_GetOrg(tt *testing.T) { + tt.Parallel() m := &MetaEvent{} m.GetOrg() m = nil @@ -14009,6 +15510,7 @@ func TestMetaEvent_GetOrg(tt *testing.T) { } func TestMetaEvent_GetRepo(tt *testing.T) { + tt.Parallel() m := &MetaEvent{} m.GetRepo() m = nil @@ -14016,6 +15518,7 @@ func TestMetaEvent_GetRepo(tt *testing.T) { } func TestMetaEvent_GetSender(tt *testing.T) { + tt.Parallel() m := &MetaEvent{} m.GetSender() m = nil @@ -14023,6 +15526,7 @@ func TestMetaEvent_GetSender(tt *testing.T) { } func TestMetric_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string m := &Metric{HTMLURL: &zeroValue} m.GetHTMLURL() @@ -14033,6 +15537,7 @@ func TestMetric_GetHTMLURL(tt *testing.T) { } func TestMetric_GetKey(tt *testing.T) { + tt.Parallel() var zeroValue string m := &Metric{Key: &zeroValue} m.GetKey() @@ -14043,6 +15548,7 @@ func TestMetric_GetKey(tt *testing.T) { } func TestMetric_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string m := &Metric{Name: &zeroValue} m.GetName() @@ -14053,6 +15559,7 @@ func TestMetric_GetName(tt *testing.T) { } func TestMetric_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string m := &Metric{NodeID: &zeroValue} m.GetNodeID() @@ -14063,6 +15570,7 @@ func TestMetric_GetNodeID(tt *testing.T) { } func TestMetric_GetSPDXID(tt *testing.T) { + tt.Parallel() var zeroValue string m := &Metric{SPDXID: &zeroValue} m.GetSPDXID() @@ -14073,6 +15581,7 @@ func TestMetric_GetSPDXID(tt *testing.T) { } func TestMetric_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string m := &Metric{URL: &zeroValue} m.GetURL() @@ -14083,6 +15592,7 @@ func TestMetric_GetURL(tt *testing.T) { } func TestMigration_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue string m := &Migration{CreatedAt: &zeroValue} m.GetCreatedAt() @@ -14093,6 +15603,7 @@ func TestMigration_GetCreatedAt(tt *testing.T) { } func TestMigration_GetExcludeAttachments(tt *testing.T) { + tt.Parallel() var zeroValue bool m := &Migration{ExcludeAttachments: &zeroValue} m.GetExcludeAttachments() @@ -14103,6 +15614,7 @@ func TestMigration_GetExcludeAttachments(tt *testing.T) { } func TestMigration_GetGUID(tt *testing.T) { + tt.Parallel() var zeroValue string m := &Migration{GUID: &zeroValue} m.GetGUID() @@ -14113,6 +15625,7 @@ func TestMigration_GetGUID(tt *testing.T) { } func TestMigration_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 m := &Migration{ID: &zeroValue} m.GetID() @@ -14123,6 +15636,7 @@ func TestMigration_GetID(tt *testing.T) { } func TestMigration_GetLockRepositories(tt *testing.T) { + tt.Parallel() var zeroValue bool m := &Migration{LockRepositories: &zeroValue} m.GetLockRepositories() @@ -14133,6 +15647,7 @@ func TestMigration_GetLockRepositories(tt *testing.T) { } func TestMigration_GetState(tt *testing.T) { + tt.Parallel() var zeroValue string m := &Migration{State: &zeroValue} m.GetState() @@ -14143,6 +15658,7 @@ func TestMigration_GetState(tt *testing.T) { } func TestMigration_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue string m := &Migration{UpdatedAt: &zeroValue} m.GetUpdatedAt() @@ -14153,6 +15669,7 @@ func TestMigration_GetUpdatedAt(tt *testing.T) { } func TestMigration_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string m := &Migration{URL: &zeroValue} m.GetURL() @@ -14163,6 +15680,7 @@ func TestMigration_GetURL(tt *testing.T) { } func TestMilestone_GetClosedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp m := &Milestone{ClosedAt: &zeroValue} m.GetClosedAt() @@ -14173,6 +15691,7 @@ func TestMilestone_GetClosedAt(tt *testing.T) { } func TestMilestone_GetClosedIssues(tt *testing.T) { + tt.Parallel() var zeroValue int m := &Milestone{ClosedIssues: &zeroValue} m.GetClosedIssues() @@ -14183,6 +15702,7 @@ func TestMilestone_GetClosedIssues(tt *testing.T) { } func TestMilestone_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp m := &Milestone{CreatedAt: &zeroValue} m.GetCreatedAt() @@ -14193,6 +15713,7 @@ func TestMilestone_GetCreatedAt(tt *testing.T) { } func TestMilestone_GetCreator(tt *testing.T) { + tt.Parallel() m := &Milestone{} m.GetCreator() m = nil @@ -14200,6 +15721,7 @@ func TestMilestone_GetCreator(tt *testing.T) { } func TestMilestone_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string m := &Milestone{Description: &zeroValue} m.GetDescription() @@ -14210,6 +15732,7 @@ func TestMilestone_GetDescription(tt *testing.T) { } func TestMilestone_GetDueOn(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp m := &Milestone{DueOn: &zeroValue} m.GetDueOn() @@ -14220,6 +15743,7 @@ func TestMilestone_GetDueOn(tt *testing.T) { } func TestMilestone_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string m := &Milestone{HTMLURL: &zeroValue} m.GetHTMLURL() @@ -14230,6 +15754,7 @@ func TestMilestone_GetHTMLURL(tt *testing.T) { } func TestMilestone_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 m := &Milestone{ID: &zeroValue} m.GetID() @@ -14240,6 +15765,7 @@ func TestMilestone_GetID(tt *testing.T) { } func TestMilestone_GetLabelsURL(tt *testing.T) { + tt.Parallel() var zeroValue string m := &Milestone{LabelsURL: &zeroValue} m.GetLabelsURL() @@ -14250,6 +15776,7 @@ func TestMilestone_GetLabelsURL(tt *testing.T) { } func TestMilestone_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string m := &Milestone{NodeID: &zeroValue} m.GetNodeID() @@ -14260,6 +15787,7 @@ func TestMilestone_GetNodeID(tt *testing.T) { } func TestMilestone_GetNumber(tt *testing.T) { + tt.Parallel() var zeroValue int m := &Milestone{Number: &zeroValue} m.GetNumber() @@ -14270,6 +15798,7 @@ func TestMilestone_GetNumber(tt *testing.T) { } func TestMilestone_GetOpenIssues(tt *testing.T) { + tt.Parallel() var zeroValue int m := &Milestone{OpenIssues: &zeroValue} m.GetOpenIssues() @@ -14280,6 +15809,7 @@ func TestMilestone_GetOpenIssues(tt *testing.T) { } func TestMilestone_GetState(tt *testing.T) { + tt.Parallel() var zeroValue string m := &Milestone{State: &zeroValue} m.GetState() @@ -14290,6 +15820,7 @@ func TestMilestone_GetState(tt *testing.T) { } func TestMilestone_GetTitle(tt *testing.T) { + tt.Parallel() var zeroValue string m := &Milestone{Title: &zeroValue} m.GetTitle() @@ -14300,6 +15831,7 @@ func TestMilestone_GetTitle(tt *testing.T) { } func TestMilestone_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp m := &Milestone{UpdatedAt: &zeroValue} m.GetUpdatedAt() @@ -14310,6 +15842,7 @@ func TestMilestone_GetUpdatedAt(tt *testing.T) { } func TestMilestone_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string m := &Milestone{URL: &zeroValue} m.GetURL() @@ -14320,6 +15853,7 @@ func TestMilestone_GetURL(tt *testing.T) { } func TestMilestoneEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MilestoneEvent{Action: &zeroValue} m.GetAction() @@ -14330,6 +15864,7 @@ func TestMilestoneEvent_GetAction(tt *testing.T) { } func TestMilestoneEvent_GetChanges(tt *testing.T) { + tt.Parallel() m := &MilestoneEvent{} m.GetChanges() m = nil @@ -14337,6 +15872,7 @@ func TestMilestoneEvent_GetChanges(tt *testing.T) { } func TestMilestoneEvent_GetInstallation(tt *testing.T) { + tt.Parallel() m := &MilestoneEvent{} m.GetInstallation() m = nil @@ -14344,6 +15880,7 @@ func TestMilestoneEvent_GetInstallation(tt *testing.T) { } func TestMilestoneEvent_GetMilestone(tt *testing.T) { + tt.Parallel() m := &MilestoneEvent{} m.GetMilestone() m = nil @@ -14351,6 +15888,7 @@ func TestMilestoneEvent_GetMilestone(tt *testing.T) { } func TestMilestoneEvent_GetOrg(tt *testing.T) { + tt.Parallel() m := &MilestoneEvent{} m.GetOrg() m = nil @@ -14358,6 +15896,7 @@ func TestMilestoneEvent_GetOrg(tt *testing.T) { } func TestMilestoneEvent_GetRepo(tt *testing.T) { + tt.Parallel() m := &MilestoneEvent{} m.GetRepo() m = nil @@ -14365,6 +15904,7 @@ func TestMilestoneEvent_GetRepo(tt *testing.T) { } func TestMilestoneEvent_GetSender(tt *testing.T) { + tt.Parallel() m := &MilestoneEvent{} m.GetSender() m = nil @@ -14372,6 +15912,7 @@ func TestMilestoneEvent_GetSender(tt *testing.T) { } func TestMilestoneStats_GetClosedMilestones(tt *testing.T) { + tt.Parallel() var zeroValue int m := &MilestoneStats{ClosedMilestones: &zeroValue} m.GetClosedMilestones() @@ -14382,6 +15923,7 @@ func TestMilestoneStats_GetClosedMilestones(tt *testing.T) { } func TestMilestoneStats_GetOpenMilestones(tt *testing.T) { + tt.Parallel() var zeroValue int m := &MilestoneStats{OpenMilestones: &zeroValue} m.GetOpenMilestones() @@ -14392,6 +15934,7 @@ func TestMilestoneStats_GetOpenMilestones(tt *testing.T) { } func TestMilestoneStats_GetTotalMilestones(tt *testing.T) { + tt.Parallel() var zeroValue int m := &MilestoneStats{TotalMilestones: &zeroValue} m.GetTotalMilestones() @@ -14402,6 +15945,7 @@ func TestMilestoneStats_GetTotalMilestones(tt *testing.T) { } func TestMostRecentInstance_GetAnalysisKey(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MostRecentInstance{AnalysisKey: &zeroValue} m.GetAnalysisKey() @@ -14412,6 +15956,7 @@ func TestMostRecentInstance_GetAnalysisKey(tt *testing.T) { } func TestMostRecentInstance_GetCategory(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MostRecentInstance{Category: &zeroValue} m.GetCategory() @@ -14422,6 +15967,7 @@ func TestMostRecentInstance_GetCategory(tt *testing.T) { } func TestMostRecentInstance_GetCommitSHA(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MostRecentInstance{CommitSHA: &zeroValue} m.GetCommitSHA() @@ -14432,6 +15978,7 @@ func TestMostRecentInstance_GetCommitSHA(tt *testing.T) { } func TestMostRecentInstance_GetEnvironment(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MostRecentInstance{Environment: &zeroValue} m.GetEnvironment() @@ -14442,6 +15989,7 @@ func TestMostRecentInstance_GetEnvironment(tt *testing.T) { } func TestMostRecentInstance_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MostRecentInstance{HTMLURL: &zeroValue} m.GetHTMLURL() @@ -14452,6 +16000,7 @@ func TestMostRecentInstance_GetHTMLURL(tt *testing.T) { } func TestMostRecentInstance_GetLocation(tt *testing.T) { + tt.Parallel() m := &MostRecentInstance{} m.GetLocation() m = nil @@ -14459,6 +16008,7 @@ func TestMostRecentInstance_GetLocation(tt *testing.T) { } func TestMostRecentInstance_GetMessage(tt *testing.T) { + tt.Parallel() m := &MostRecentInstance{} m.GetMessage() m = nil @@ -14466,6 +16016,7 @@ func TestMostRecentInstance_GetMessage(tt *testing.T) { } func TestMostRecentInstance_GetRef(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MostRecentInstance{Ref: &zeroValue} m.GetRef() @@ -14476,6 +16027,7 @@ func TestMostRecentInstance_GetRef(tt *testing.T) { } func TestMostRecentInstance_GetState(tt *testing.T) { + tt.Parallel() var zeroValue string m := &MostRecentInstance{State: &zeroValue} m.GetState() @@ -14486,6 +16038,7 @@ func TestMostRecentInstance_GetState(tt *testing.T) { } func TestNewPullRequest_GetBase(tt *testing.T) { + tt.Parallel() var zeroValue string n := &NewPullRequest{Base: &zeroValue} n.GetBase() @@ -14496,6 +16049,7 @@ func TestNewPullRequest_GetBase(tt *testing.T) { } func TestNewPullRequest_GetBody(tt *testing.T) { + tt.Parallel() var zeroValue string n := &NewPullRequest{Body: &zeroValue} n.GetBody() @@ -14506,6 +16060,7 @@ func TestNewPullRequest_GetBody(tt *testing.T) { } func TestNewPullRequest_GetDraft(tt *testing.T) { + tt.Parallel() var zeroValue bool n := &NewPullRequest{Draft: &zeroValue} n.GetDraft() @@ -14516,6 +16071,7 @@ func TestNewPullRequest_GetDraft(tt *testing.T) { } func TestNewPullRequest_GetHead(tt *testing.T) { + tt.Parallel() var zeroValue string n := &NewPullRequest{Head: &zeroValue} n.GetHead() @@ -14526,6 +16082,7 @@ func TestNewPullRequest_GetHead(tt *testing.T) { } func TestNewPullRequest_GetHeadRepo(tt *testing.T) { + tt.Parallel() var zeroValue string n := &NewPullRequest{HeadRepo: &zeroValue} n.GetHeadRepo() @@ -14536,6 +16093,7 @@ func TestNewPullRequest_GetHeadRepo(tt *testing.T) { } func TestNewPullRequest_GetIssue(tt *testing.T) { + tt.Parallel() var zeroValue int n := &NewPullRequest{Issue: &zeroValue} n.GetIssue() @@ -14546,6 +16104,7 @@ func TestNewPullRequest_GetIssue(tt *testing.T) { } func TestNewPullRequest_GetMaintainerCanModify(tt *testing.T) { + tt.Parallel() var zeroValue bool n := &NewPullRequest{MaintainerCanModify: &zeroValue} n.GetMaintainerCanModify() @@ -14556,6 +16115,7 @@ func TestNewPullRequest_GetMaintainerCanModify(tt *testing.T) { } func TestNewPullRequest_GetTitle(tt *testing.T) { + tt.Parallel() var zeroValue string n := &NewPullRequest{Title: &zeroValue} n.GetTitle() @@ -14566,6 +16126,7 @@ func TestNewPullRequest_GetTitle(tt *testing.T) { } func TestNewTeam_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string n := &NewTeam{Description: &zeroValue} n.GetDescription() @@ -14576,6 +16137,7 @@ func TestNewTeam_GetDescription(tt *testing.T) { } func TestNewTeam_GetLDAPDN(tt *testing.T) { + tt.Parallel() var zeroValue string n := &NewTeam{LDAPDN: &zeroValue} n.GetLDAPDN() @@ -14586,6 +16148,7 @@ func TestNewTeam_GetLDAPDN(tt *testing.T) { } func TestNewTeam_GetNotificationSetting(tt *testing.T) { + tt.Parallel() var zeroValue string n := &NewTeam{NotificationSetting: &zeroValue} n.GetNotificationSetting() @@ -14596,6 +16159,7 @@ func TestNewTeam_GetNotificationSetting(tt *testing.T) { } func TestNewTeam_GetParentTeamID(tt *testing.T) { + tt.Parallel() var zeroValue int64 n := &NewTeam{ParentTeamID: &zeroValue} n.GetParentTeamID() @@ -14606,6 +16170,7 @@ func TestNewTeam_GetParentTeamID(tt *testing.T) { } func TestNewTeam_GetPermission(tt *testing.T) { + tt.Parallel() var zeroValue string n := &NewTeam{Permission: &zeroValue} n.GetPermission() @@ -14616,6 +16181,7 @@ func TestNewTeam_GetPermission(tt *testing.T) { } func TestNewTeam_GetPrivacy(tt *testing.T) { + tt.Parallel() var zeroValue string n := &NewTeam{Privacy: &zeroValue} n.GetPrivacy() @@ -14626,6 +16192,7 @@ func TestNewTeam_GetPrivacy(tt *testing.T) { } func TestNotification_GetID(tt *testing.T) { + tt.Parallel() var zeroValue string n := &Notification{ID: &zeroValue} n.GetID() @@ -14636,6 +16203,7 @@ func TestNotification_GetID(tt *testing.T) { } func TestNotification_GetLastReadAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp n := &Notification{LastReadAt: &zeroValue} n.GetLastReadAt() @@ -14646,6 +16214,7 @@ func TestNotification_GetLastReadAt(tt *testing.T) { } func TestNotification_GetReason(tt *testing.T) { + tt.Parallel() var zeroValue string n := &Notification{Reason: &zeroValue} n.GetReason() @@ -14656,6 +16225,7 @@ func TestNotification_GetReason(tt *testing.T) { } func TestNotification_GetRepository(tt *testing.T) { + tt.Parallel() n := &Notification{} n.GetRepository() n = nil @@ -14663,6 +16233,7 @@ func TestNotification_GetRepository(tt *testing.T) { } func TestNotification_GetSubject(tt *testing.T) { + tt.Parallel() n := &Notification{} n.GetSubject() n = nil @@ -14670,6 +16241,7 @@ func TestNotification_GetSubject(tt *testing.T) { } func TestNotification_GetUnread(tt *testing.T) { + tt.Parallel() var zeroValue bool n := &Notification{Unread: &zeroValue} n.GetUnread() @@ -14680,6 +16252,7 @@ func TestNotification_GetUnread(tt *testing.T) { } func TestNotification_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp n := &Notification{UpdatedAt: &zeroValue} n.GetUpdatedAt() @@ -14690,6 +16263,7 @@ func TestNotification_GetUpdatedAt(tt *testing.T) { } func TestNotification_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string n := &Notification{URL: &zeroValue} n.GetURL() @@ -14700,6 +16274,7 @@ func TestNotification_GetURL(tt *testing.T) { } func TestNotificationSubject_GetLatestCommentURL(tt *testing.T) { + tt.Parallel() var zeroValue string n := &NotificationSubject{LatestCommentURL: &zeroValue} n.GetLatestCommentURL() @@ -14710,6 +16285,7 @@ func TestNotificationSubject_GetLatestCommentURL(tt *testing.T) { } func TestNotificationSubject_GetTitle(tt *testing.T) { + tt.Parallel() var zeroValue string n := &NotificationSubject{Title: &zeroValue} n.GetTitle() @@ -14720,6 +16296,7 @@ func TestNotificationSubject_GetTitle(tt *testing.T) { } func TestNotificationSubject_GetType(tt *testing.T) { + tt.Parallel() var zeroValue string n := &NotificationSubject{Type: &zeroValue} n.GetType() @@ -14730,6 +16307,7 @@ func TestNotificationSubject_GetType(tt *testing.T) { } func TestNotificationSubject_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string n := &NotificationSubject{URL: &zeroValue} n.GetURL() @@ -14740,6 +16318,7 @@ func TestNotificationSubject_GetURL(tt *testing.T) { } func TestOAuthAPP_GetClientID(tt *testing.T) { + tt.Parallel() var zeroValue string o := &OAuthAPP{ClientID: &zeroValue} o.GetClientID() @@ -14750,6 +16329,7 @@ func TestOAuthAPP_GetClientID(tt *testing.T) { } func TestOAuthAPP_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string o := &OAuthAPP{Name: &zeroValue} o.GetName() @@ -14760,6 +16340,7 @@ func TestOAuthAPP_GetName(tt *testing.T) { } func TestOAuthAPP_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string o := &OAuthAPP{URL: &zeroValue} o.GetURL() @@ -14770,6 +16351,7 @@ func TestOAuthAPP_GetURL(tt *testing.T) { } func TestOIDCSubjectClaimCustomTemplate_GetUseDefault(tt *testing.T) { + tt.Parallel() var zeroValue bool o := &OIDCSubjectClaimCustomTemplate{UseDefault: &zeroValue} o.GetUseDefault() @@ -14780,6 +16362,7 @@ func TestOIDCSubjectClaimCustomTemplate_GetUseDefault(tt *testing.T) { } func TestOrganization_GetAdvancedSecurityEnabledForNewRepos(tt *testing.T) { + tt.Parallel() var zeroValue bool o := &Organization{AdvancedSecurityEnabledForNewRepos: &zeroValue} o.GetAdvancedSecurityEnabledForNewRepos() @@ -14790,6 +16373,7 @@ func TestOrganization_GetAdvancedSecurityEnabledForNewRepos(tt *testing.T) { } func TestOrganization_GetAvatarURL(tt *testing.T) { + tt.Parallel() var zeroValue string o := &Organization{AvatarURL: &zeroValue} o.GetAvatarURL() @@ -14800,6 +16384,7 @@ func TestOrganization_GetAvatarURL(tt *testing.T) { } func TestOrganization_GetBillingEmail(tt *testing.T) { + tt.Parallel() var zeroValue string o := &Organization{BillingEmail: &zeroValue} o.GetBillingEmail() @@ -14810,6 +16395,7 @@ func TestOrganization_GetBillingEmail(tt *testing.T) { } func TestOrganization_GetBlog(tt *testing.T) { + tt.Parallel() var zeroValue string o := &Organization{Blog: &zeroValue} o.GetBlog() @@ -14820,6 +16406,7 @@ func TestOrganization_GetBlog(tt *testing.T) { } func TestOrganization_GetCollaborators(tt *testing.T) { + tt.Parallel() var zeroValue int o := &Organization{Collaborators: &zeroValue} o.GetCollaborators() @@ -14830,6 +16417,7 @@ func TestOrganization_GetCollaborators(tt *testing.T) { } func TestOrganization_GetCompany(tt *testing.T) { + tt.Parallel() var zeroValue string o := &Organization{Company: &zeroValue} o.GetCompany() @@ -14840,6 +16428,7 @@ func TestOrganization_GetCompany(tt *testing.T) { } func TestOrganization_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp o := &Organization{CreatedAt: &zeroValue} o.GetCreatedAt() @@ -14850,6 +16439,7 @@ func TestOrganization_GetCreatedAt(tt *testing.T) { } func TestOrganization_GetDefaultRepoPermission(tt *testing.T) { + tt.Parallel() var zeroValue string o := &Organization{DefaultRepoPermission: &zeroValue} o.GetDefaultRepoPermission() @@ -14860,6 +16450,7 @@ func TestOrganization_GetDefaultRepoPermission(tt *testing.T) { } func TestOrganization_GetDefaultRepoSettings(tt *testing.T) { + tt.Parallel() var zeroValue string o := &Organization{DefaultRepoSettings: &zeroValue} o.GetDefaultRepoSettings() @@ -14870,6 +16461,7 @@ func TestOrganization_GetDefaultRepoSettings(tt *testing.T) { } func TestOrganization_GetDependabotAlertsEnabledForNewRepos(tt *testing.T) { + tt.Parallel() var zeroValue bool o := &Organization{DependabotAlertsEnabledForNewRepos: &zeroValue} o.GetDependabotAlertsEnabledForNewRepos() @@ -14880,6 +16472,7 @@ func TestOrganization_GetDependabotAlertsEnabledForNewRepos(tt *testing.T) { } func TestOrganization_GetDependabotSecurityUpdatesEnabledForNewRepos(tt *testing.T) { + tt.Parallel() var zeroValue bool o := &Organization{DependabotSecurityUpdatesEnabledForNewRepos: &zeroValue} o.GetDependabotSecurityUpdatesEnabledForNewRepos() @@ -14890,6 +16483,7 @@ func TestOrganization_GetDependabotSecurityUpdatesEnabledForNewRepos(tt *testing } func TestOrganization_GetDependencyGraphEnabledForNewRepos(tt *testing.T) { + tt.Parallel() var zeroValue bool o := &Organization{DependencyGraphEnabledForNewRepos: &zeroValue} o.GetDependencyGraphEnabledForNewRepos() @@ -14900,6 +16494,7 @@ func TestOrganization_GetDependencyGraphEnabledForNewRepos(tt *testing.T) { } func TestOrganization_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string o := &Organization{Description: &zeroValue} o.GetDescription() @@ -14910,6 +16505,7 @@ func TestOrganization_GetDescription(tt *testing.T) { } func TestOrganization_GetDiskUsage(tt *testing.T) { + tt.Parallel() var zeroValue int o := &Organization{DiskUsage: &zeroValue} o.GetDiskUsage() @@ -14920,6 +16516,7 @@ func TestOrganization_GetDiskUsage(tt *testing.T) { } func TestOrganization_GetEmail(tt *testing.T) { + tt.Parallel() var zeroValue string o := &Organization{Email: &zeroValue} o.GetEmail() @@ -14930,6 +16527,7 @@ func TestOrganization_GetEmail(tt *testing.T) { } func TestOrganization_GetEventsURL(tt *testing.T) { + tt.Parallel() var zeroValue string o := &Organization{EventsURL: &zeroValue} o.GetEventsURL() @@ -14940,6 +16538,7 @@ func TestOrganization_GetEventsURL(tt *testing.T) { } func TestOrganization_GetFollowers(tt *testing.T) { + tt.Parallel() var zeroValue int o := &Organization{Followers: &zeroValue} o.GetFollowers() @@ -14950,6 +16549,7 @@ func TestOrganization_GetFollowers(tt *testing.T) { } func TestOrganization_GetFollowing(tt *testing.T) { + tt.Parallel() var zeroValue int o := &Organization{Following: &zeroValue} o.GetFollowing() @@ -14960,6 +16560,7 @@ func TestOrganization_GetFollowing(tt *testing.T) { } func TestOrganization_GetHasOrganizationProjects(tt *testing.T) { + tt.Parallel() var zeroValue bool o := &Organization{HasOrganizationProjects: &zeroValue} o.GetHasOrganizationProjects() @@ -14970,6 +16571,7 @@ func TestOrganization_GetHasOrganizationProjects(tt *testing.T) { } func TestOrganization_GetHasRepositoryProjects(tt *testing.T) { + tt.Parallel() var zeroValue bool o := &Organization{HasRepositoryProjects: &zeroValue} o.GetHasRepositoryProjects() @@ -14980,6 +16582,7 @@ func TestOrganization_GetHasRepositoryProjects(tt *testing.T) { } func TestOrganization_GetHooksURL(tt *testing.T) { + tt.Parallel() var zeroValue string o := &Organization{HooksURL: &zeroValue} o.GetHooksURL() @@ -14990,6 +16593,7 @@ func TestOrganization_GetHooksURL(tt *testing.T) { } func TestOrganization_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string o := &Organization{HTMLURL: &zeroValue} o.GetHTMLURL() @@ -15000,6 +16604,7 @@ func TestOrganization_GetHTMLURL(tt *testing.T) { } func TestOrganization_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 o := &Organization{ID: &zeroValue} o.GetID() @@ -15010,6 +16615,7 @@ func TestOrganization_GetID(tt *testing.T) { } func TestOrganization_GetIssuesURL(tt *testing.T) { + tt.Parallel() var zeroValue string o := &Organization{IssuesURL: &zeroValue} o.GetIssuesURL() @@ -15020,6 +16626,7 @@ func TestOrganization_GetIssuesURL(tt *testing.T) { } func TestOrganization_GetIsVerified(tt *testing.T) { + tt.Parallel() var zeroValue bool o := &Organization{IsVerified: &zeroValue} o.GetIsVerified() @@ -15030,6 +16637,7 @@ func TestOrganization_GetIsVerified(tt *testing.T) { } func TestOrganization_GetLocation(tt *testing.T) { + tt.Parallel() var zeroValue string o := &Organization{Location: &zeroValue} o.GetLocation() @@ -15040,6 +16648,7 @@ func TestOrganization_GetLocation(tt *testing.T) { } func TestOrganization_GetLogin(tt *testing.T) { + tt.Parallel() var zeroValue string o := &Organization{Login: &zeroValue} o.GetLogin() @@ -15050,6 +16659,7 @@ func TestOrganization_GetLogin(tt *testing.T) { } func TestOrganization_GetMembersAllowedRepositoryCreationType(tt *testing.T) { + tt.Parallel() var zeroValue string o := &Organization{MembersAllowedRepositoryCreationType: &zeroValue} o.GetMembersAllowedRepositoryCreationType() @@ -15060,6 +16670,7 @@ func TestOrganization_GetMembersAllowedRepositoryCreationType(tt *testing.T) { } func TestOrganization_GetMembersCanCreateInternalRepos(tt *testing.T) { + tt.Parallel() var zeroValue bool o := &Organization{MembersCanCreateInternalRepos: &zeroValue} o.GetMembersCanCreateInternalRepos() @@ -15070,6 +16681,7 @@ func TestOrganization_GetMembersCanCreateInternalRepos(tt *testing.T) { } func TestOrganization_GetMembersCanCreatePages(tt *testing.T) { + tt.Parallel() var zeroValue bool o := &Organization{MembersCanCreatePages: &zeroValue} o.GetMembersCanCreatePages() @@ -15080,6 +16692,7 @@ func TestOrganization_GetMembersCanCreatePages(tt *testing.T) { } func TestOrganization_GetMembersCanCreatePrivatePages(tt *testing.T) { + tt.Parallel() var zeroValue bool o := &Organization{MembersCanCreatePrivatePages: &zeroValue} o.GetMembersCanCreatePrivatePages() @@ -15090,6 +16703,7 @@ func TestOrganization_GetMembersCanCreatePrivatePages(tt *testing.T) { } func TestOrganization_GetMembersCanCreatePrivateRepos(tt *testing.T) { + tt.Parallel() var zeroValue bool o := &Organization{MembersCanCreatePrivateRepos: &zeroValue} o.GetMembersCanCreatePrivateRepos() @@ -15100,6 +16714,7 @@ func TestOrganization_GetMembersCanCreatePrivateRepos(tt *testing.T) { } func TestOrganization_GetMembersCanCreatePublicPages(tt *testing.T) { + tt.Parallel() var zeroValue bool o := &Organization{MembersCanCreatePublicPages: &zeroValue} o.GetMembersCanCreatePublicPages() @@ -15110,6 +16725,7 @@ func TestOrganization_GetMembersCanCreatePublicPages(tt *testing.T) { } func TestOrganization_GetMembersCanCreatePublicRepos(tt *testing.T) { + tt.Parallel() var zeroValue bool o := &Organization{MembersCanCreatePublicRepos: &zeroValue} o.GetMembersCanCreatePublicRepos() @@ -15120,6 +16736,7 @@ func TestOrganization_GetMembersCanCreatePublicRepos(tt *testing.T) { } func TestOrganization_GetMembersCanCreateRepos(tt *testing.T) { + tt.Parallel() var zeroValue bool o := &Organization{MembersCanCreateRepos: &zeroValue} o.GetMembersCanCreateRepos() @@ -15130,6 +16747,7 @@ func TestOrganization_GetMembersCanCreateRepos(tt *testing.T) { } func TestOrganization_GetMembersCanForkPrivateRepos(tt *testing.T) { + tt.Parallel() var zeroValue bool o := &Organization{MembersCanForkPrivateRepos: &zeroValue} o.GetMembersCanForkPrivateRepos() @@ -15140,6 +16758,7 @@ func TestOrganization_GetMembersCanForkPrivateRepos(tt *testing.T) { } func TestOrganization_GetMembersURL(tt *testing.T) { + tt.Parallel() var zeroValue string o := &Organization{MembersURL: &zeroValue} o.GetMembersURL() @@ -15150,6 +16769,7 @@ func TestOrganization_GetMembersURL(tt *testing.T) { } func TestOrganization_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string o := &Organization{Name: &zeroValue} o.GetName() @@ -15160,6 +16780,7 @@ func TestOrganization_GetName(tt *testing.T) { } func TestOrganization_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string o := &Organization{NodeID: &zeroValue} o.GetNodeID() @@ -15170,6 +16791,7 @@ func TestOrganization_GetNodeID(tt *testing.T) { } func TestOrganization_GetOwnedPrivateRepos(tt *testing.T) { + tt.Parallel() var zeroValue int64 o := &Organization{OwnedPrivateRepos: &zeroValue} o.GetOwnedPrivateRepos() @@ -15180,6 +16802,7 @@ func TestOrganization_GetOwnedPrivateRepos(tt *testing.T) { } func TestOrganization_GetPlan(tt *testing.T) { + tt.Parallel() o := &Organization{} o.GetPlan() o = nil @@ -15187,6 +16810,7 @@ func TestOrganization_GetPlan(tt *testing.T) { } func TestOrganization_GetPrivateGists(tt *testing.T) { + tt.Parallel() var zeroValue int o := &Organization{PrivateGists: &zeroValue} o.GetPrivateGists() @@ -15197,6 +16821,7 @@ func TestOrganization_GetPrivateGists(tt *testing.T) { } func TestOrganization_GetPublicGists(tt *testing.T) { + tt.Parallel() var zeroValue int o := &Organization{PublicGists: &zeroValue} o.GetPublicGists() @@ -15207,6 +16832,7 @@ func TestOrganization_GetPublicGists(tt *testing.T) { } func TestOrganization_GetPublicMembersURL(tt *testing.T) { + tt.Parallel() var zeroValue string o := &Organization{PublicMembersURL: &zeroValue} o.GetPublicMembersURL() @@ -15217,6 +16843,7 @@ func TestOrganization_GetPublicMembersURL(tt *testing.T) { } func TestOrganization_GetPublicRepos(tt *testing.T) { + tt.Parallel() var zeroValue int o := &Organization{PublicRepos: &zeroValue} o.GetPublicRepos() @@ -15227,6 +16854,7 @@ func TestOrganization_GetPublicRepos(tt *testing.T) { } func TestOrganization_GetReposURL(tt *testing.T) { + tt.Parallel() var zeroValue string o := &Organization{ReposURL: &zeroValue} o.GetReposURL() @@ -15237,6 +16865,7 @@ func TestOrganization_GetReposURL(tt *testing.T) { } func TestOrganization_GetSecretScanningEnabledForNewRepos(tt *testing.T) { + tt.Parallel() var zeroValue bool o := &Organization{SecretScanningEnabledForNewRepos: &zeroValue} o.GetSecretScanningEnabledForNewRepos() @@ -15247,6 +16876,7 @@ func TestOrganization_GetSecretScanningEnabledForNewRepos(tt *testing.T) { } func TestOrganization_GetSecretScanningPushProtectionEnabledForNewRepos(tt *testing.T) { + tt.Parallel() var zeroValue bool o := &Organization{SecretScanningPushProtectionEnabledForNewRepos: &zeroValue} o.GetSecretScanningPushProtectionEnabledForNewRepos() @@ -15257,6 +16887,7 @@ func TestOrganization_GetSecretScanningPushProtectionEnabledForNewRepos(tt *test } func TestOrganization_GetSecretScanningValidityChecksEnabled(tt *testing.T) { + tt.Parallel() var zeroValue bool o := &Organization{SecretScanningValidityChecksEnabled: &zeroValue} o.GetSecretScanningValidityChecksEnabled() @@ -15267,6 +16898,7 @@ func TestOrganization_GetSecretScanningValidityChecksEnabled(tt *testing.T) { } func TestOrganization_GetTotalPrivateRepos(tt *testing.T) { + tt.Parallel() var zeroValue int64 o := &Organization{TotalPrivateRepos: &zeroValue} o.GetTotalPrivateRepos() @@ -15277,6 +16909,7 @@ func TestOrganization_GetTotalPrivateRepos(tt *testing.T) { } func TestOrganization_GetTwitterUsername(tt *testing.T) { + tt.Parallel() var zeroValue string o := &Organization{TwitterUsername: &zeroValue} o.GetTwitterUsername() @@ -15287,6 +16920,7 @@ func TestOrganization_GetTwitterUsername(tt *testing.T) { } func TestOrganization_GetTwoFactorRequirementEnabled(tt *testing.T) { + tt.Parallel() var zeroValue bool o := &Organization{TwoFactorRequirementEnabled: &zeroValue} o.GetTwoFactorRequirementEnabled() @@ -15297,6 +16931,7 @@ func TestOrganization_GetTwoFactorRequirementEnabled(tt *testing.T) { } func TestOrganization_GetType(tt *testing.T) { + tt.Parallel() var zeroValue string o := &Organization{Type: &zeroValue} o.GetType() @@ -15307,6 +16942,7 @@ func TestOrganization_GetType(tt *testing.T) { } func TestOrganization_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp o := &Organization{UpdatedAt: &zeroValue} o.GetUpdatedAt() @@ -15317,6 +16953,7 @@ func TestOrganization_GetUpdatedAt(tt *testing.T) { } func TestOrganization_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string o := &Organization{URL: &zeroValue} o.GetURL() @@ -15327,6 +16964,7 @@ func TestOrganization_GetURL(tt *testing.T) { } func TestOrganization_GetWebCommitSignoffRequired(tt *testing.T) { + tt.Parallel() var zeroValue bool o := &Organization{WebCommitSignoffRequired: &zeroValue} o.GetWebCommitSignoffRequired() @@ -15337,6 +16975,7 @@ func TestOrganization_GetWebCommitSignoffRequired(tt *testing.T) { } func TestOrganizationCustomRepoRoles_GetTotalCount(tt *testing.T) { + tt.Parallel() var zeroValue int o := &OrganizationCustomRepoRoles{TotalCount: &zeroValue} o.GetTotalCount() @@ -15347,6 +16986,7 @@ func TestOrganizationCustomRepoRoles_GetTotalCount(tt *testing.T) { } func TestOrganizationCustomRoles_GetTotalCount(tt *testing.T) { + tt.Parallel() var zeroValue int o := &OrganizationCustomRoles{TotalCount: &zeroValue} o.GetTotalCount() @@ -15357,6 +16997,7 @@ func TestOrganizationCustomRoles_GetTotalCount(tt *testing.T) { } func TestOrganizationEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string o := &OrganizationEvent{Action: &zeroValue} o.GetAction() @@ -15367,6 +17008,7 @@ func TestOrganizationEvent_GetAction(tt *testing.T) { } func TestOrganizationEvent_GetInstallation(tt *testing.T) { + tt.Parallel() o := &OrganizationEvent{} o.GetInstallation() o = nil @@ -15374,6 +17016,7 @@ func TestOrganizationEvent_GetInstallation(tt *testing.T) { } func TestOrganizationEvent_GetInvitation(tt *testing.T) { + tt.Parallel() o := &OrganizationEvent{} o.GetInvitation() o = nil @@ -15381,6 +17024,7 @@ func TestOrganizationEvent_GetInvitation(tt *testing.T) { } func TestOrganizationEvent_GetMembership(tt *testing.T) { + tt.Parallel() o := &OrganizationEvent{} o.GetMembership() o = nil @@ -15388,6 +17032,7 @@ func TestOrganizationEvent_GetMembership(tt *testing.T) { } func TestOrganizationEvent_GetOrganization(tt *testing.T) { + tt.Parallel() o := &OrganizationEvent{} o.GetOrganization() o = nil @@ -15395,6 +17040,7 @@ func TestOrganizationEvent_GetOrganization(tt *testing.T) { } func TestOrganizationEvent_GetSender(tt *testing.T) { + tt.Parallel() o := &OrganizationEvent{} o.GetSender() o = nil @@ -15402,6 +17048,7 @@ func TestOrganizationEvent_GetSender(tt *testing.T) { } func TestOrganizationInstallations_GetTotalCount(tt *testing.T) { + tt.Parallel() var zeroValue int o := &OrganizationInstallations{TotalCount: &zeroValue} o.GetTotalCount() @@ -15412,6 +17059,7 @@ func TestOrganizationInstallations_GetTotalCount(tt *testing.T) { } func TestOrgBlockEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string o := &OrgBlockEvent{Action: &zeroValue} o.GetAction() @@ -15422,6 +17070,7 @@ func TestOrgBlockEvent_GetAction(tt *testing.T) { } func TestOrgBlockEvent_GetBlockedUser(tt *testing.T) { + tt.Parallel() o := &OrgBlockEvent{} o.GetBlockedUser() o = nil @@ -15429,6 +17078,7 @@ func TestOrgBlockEvent_GetBlockedUser(tt *testing.T) { } func TestOrgBlockEvent_GetInstallation(tt *testing.T) { + tt.Parallel() o := &OrgBlockEvent{} o.GetInstallation() o = nil @@ -15436,6 +17086,7 @@ func TestOrgBlockEvent_GetInstallation(tt *testing.T) { } func TestOrgBlockEvent_GetOrganization(tt *testing.T) { + tt.Parallel() o := &OrgBlockEvent{} o.GetOrganization() o = nil @@ -15443,6 +17094,7 @@ func TestOrgBlockEvent_GetOrganization(tt *testing.T) { } func TestOrgBlockEvent_GetSender(tt *testing.T) { + tt.Parallel() o := &OrgBlockEvent{} o.GetSender() o = nil @@ -15450,6 +17102,7 @@ func TestOrgBlockEvent_GetSender(tt *testing.T) { } func TestOrgRequiredWorkflow_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp o := &OrgRequiredWorkflow{CreatedAt: &zeroValue} o.GetCreatedAt() @@ -15460,6 +17113,7 @@ func TestOrgRequiredWorkflow_GetCreatedAt(tt *testing.T) { } func TestOrgRequiredWorkflow_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 o := &OrgRequiredWorkflow{ID: &zeroValue} o.GetID() @@ -15470,6 +17124,7 @@ func TestOrgRequiredWorkflow_GetID(tt *testing.T) { } func TestOrgRequiredWorkflow_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string o := &OrgRequiredWorkflow{Name: &zeroValue} o.GetName() @@ -15480,6 +17135,7 @@ func TestOrgRequiredWorkflow_GetName(tt *testing.T) { } func TestOrgRequiredWorkflow_GetPath(tt *testing.T) { + tt.Parallel() var zeroValue string o := &OrgRequiredWorkflow{Path: &zeroValue} o.GetPath() @@ -15490,6 +17146,7 @@ func TestOrgRequiredWorkflow_GetPath(tt *testing.T) { } func TestOrgRequiredWorkflow_GetRef(tt *testing.T) { + tt.Parallel() var zeroValue string o := &OrgRequiredWorkflow{Ref: &zeroValue} o.GetRef() @@ -15500,6 +17157,7 @@ func TestOrgRequiredWorkflow_GetRef(tt *testing.T) { } func TestOrgRequiredWorkflow_GetRepository(tt *testing.T) { + tt.Parallel() o := &OrgRequiredWorkflow{} o.GetRepository() o = nil @@ -15507,6 +17165,7 @@ func TestOrgRequiredWorkflow_GetRepository(tt *testing.T) { } func TestOrgRequiredWorkflow_GetScope(tt *testing.T) { + tt.Parallel() var zeroValue string o := &OrgRequiredWorkflow{Scope: &zeroValue} o.GetScope() @@ -15517,6 +17176,7 @@ func TestOrgRequiredWorkflow_GetScope(tt *testing.T) { } func TestOrgRequiredWorkflow_GetSelectedRepositoriesURL(tt *testing.T) { + tt.Parallel() var zeroValue string o := &OrgRequiredWorkflow{SelectedRepositoriesURL: &zeroValue} o.GetSelectedRepositoriesURL() @@ -15527,6 +17187,7 @@ func TestOrgRequiredWorkflow_GetSelectedRepositoriesURL(tt *testing.T) { } func TestOrgRequiredWorkflow_GetState(tt *testing.T) { + tt.Parallel() var zeroValue string o := &OrgRequiredWorkflow{State: &zeroValue} o.GetState() @@ -15537,6 +17198,7 @@ func TestOrgRequiredWorkflow_GetState(tt *testing.T) { } func TestOrgRequiredWorkflow_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp o := &OrgRequiredWorkflow{UpdatedAt: &zeroValue} o.GetUpdatedAt() @@ -15547,6 +17209,7 @@ func TestOrgRequiredWorkflow_GetUpdatedAt(tt *testing.T) { } func TestOrgRequiredWorkflows_GetTotalCount(tt *testing.T) { + tt.Parallel() var zeroValue int o := &OrgRequiredWorkflows{TotalCount: &zeroValue} o.GetTotalCount() @@ -15557,6 +17220,7 @@ func TestOrgRequiredWorkflows_GetTotalCount(tt *testing.T) { } func TestOrgStats_GetDisabledOrgs(tt *testing.T) { + tt.Parallel() var zeroValue int o := &OrgStats{DisabledOrgs: &zeroValue} o.GetDisabledOrgs() @@ -15567,6 +17231,7 @@ func TestOrgStats_GetDisabledOrgs(tt *testing.T) { } func TestOrgStats_GetTotalOrgs(tt *testing.T) { + tt.Parallel() var zeroValue int o := &OrgStats{TotalOrgs: &zeroValue} o.GetTotalOrgs() @@ -15577,6 +17242,7 @@ func TestOrgStats_GetTotalOrgs(tt *testing.T) { } func TestOrgStats_GetTotalTeamMembers(tt *testing.T) { + tt.Parallel() var zeroValue int o := &OrgStats{TotalTeamMembers: &zeroValue} o.GetTotalTeamMembers() @@ -15587,6 +17253,7 @@ func TestOrgStats_GetTotalTeamMembers(tt *testing.T) { } func TestOrgStats_GetTotalTeams(tt *testing.T) { + tt.Parallel() var zeroValue int o := &OrgStats{TotalTeams: &zeroValue} o.GetTotalTeams() @@ -15597,6 +17264,7 @@ func TestOrgStats_GetTotalTeams(tt *testing.T) { } func TestOwnerInfo_GetOrg(tt *testing.T) { + tt.Parallel() o := &OwnerInfo{} o.GetOrg() o = nil @@ -15604,6 +17272,7 @@ func TestOwnerInfo_GetOrg(tt *testing.T) { } func TestOwnerInfo_GetUser(tt *testing.T) { + tt.Parallel() o := &OwnerInfo{} o.GetUser() o = nil @@ -15611,6 +17280,7 @@ func TestOwnerInfo_GetUser(tt *testing.T) { } func TestPackage_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &Package{CreatedAt: &zeroValue} p.GetCreatedAt() @@ -15621,6 +17291,7 @@ func TestPackage_GetCreatedAt(tt *testing.T) { } func TestPackage_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &Package{HTMLURL: &zeroValue} p.GetHTMLURL() @@ -15631,6 +17302,7 @@ func TestPackage_GetHTMLURL(tt *testing.T) { } func TestPackage_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 p := &Package{ID: &zeroValue} p.GetID() @@ -15641,6 +17313,7 @@ func TestPackage_GetID(tt *testing.T) { } func TestPackage_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string p := &Package{Name: &zeroValue} p.GetName() @@ -15651,6 +17324,7 @@ func TestPackage_GetName(tt *testing.T) { } func TestPackage_GetOwner(tt *testing.T) { + tt.Parallel() p := &Package{} p.GetOwner() p = nil @@ -15658,6 +17332,7 @@ func TestPackage_GetOwner(tt *testing.T) { } func TestPackage_GetPackageType(tt *testing.T) { + tt.Parallel() var zeroValue string p := &Package{PackageType: &zeroValue} p.GetPackageType() @@ -15668,6 +17343,7 @@ func TestPackage_GetPackageType(tt *testing.T) { } func TestPackage_GetPackageVersion(tt *testing.T) { + tt.Parallel() p := &Package{} p.GetPackageVersion() p = nil @@ -15675,6 +17351,7 @@ func TestPackage_GetPackageVersion(tt *testing.T) { } func TestPackage_GetRegistry(tt *testing.T) { + tt.Parallel() p := &Package{} p.GetRegistry() p = nil @@ -15682,6 +17359,7 @@ func TestPackage_GetRegistry(tt *testing.T) { } func TestPackage_GetRepository(tt *testing.T) { + tt.Parallel() p := &Package{} p.GetRepository() p = nil @@ -15689,6 +17367,7 @@ func TestPackage_GetRepository(tt *testing.T) { } func TestPackage_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &Package{UpdatedAt: &zeroValue} p.GetUpdatedAt() @@ -15699,6 +17378,7 @@ func TestPackage_GetUpdatedAt(tt *testing.T) { } func TestPackage_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &Package{URL: &zeroValue} p.GetURL() @@ -15709,6 +17389,7 @@ func TestPackage_GetURL(tt *testing.T) { } func TestPackage_GetVersionCount(tt *testing.T) { + tt.Parallel() var zeroValue int64 p := &Package{VersionCount: &zeroValue} p.GetVersionCount() @@ -15719,6 +17400,7 @@ func TestPackage_GetVersionCount(tt *testing.T) { } func TestPackage_GetVisibility(tt *testing.T) { + tt.Parallel() var zeroValue string p := &Package{Visibility: &zeroValue} p.GetVisibility() @@ -15729,6 +17411,7 @@ func TestPackage_GetVisibility(tt *testing.T) { } func TestPackageEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PackageEvent{Action: &zeroValue} p.GetAction() @@ -15739,6 +17422,7 @@ func TestPackageEvent_GetAction(tt *testing.T) { } func TestPackageEvent_GetInstallation(tt *testing.T) { + tt.Parallel() p := &PackageEvent{} p.GetInstallation() p = nil @@ -15746,6 +17430,7 @@ func TestPackageEvent_GetInstallation(tt *testing.T) { } func TestPackageEvent_GetOrg(tt *testing.T) { + tt.Parallel() p := &PackageEvent{} p.GetOrg() p = nil @@ -15753,6 +17438,7 @@ func TestPackageEvent_GetOrg(tt *testing.T) { } func TestPackageEvent_GetPackage(tt *testing.T) { + tt.Parallel() p := &PackageEvent{} p.GetPackage() p = nil @@ -15760,6 +17446,7 @@ func TestPackageEvent_GetPackage(tt *testing.T) { } func TestPackageEvent_GetRepo(tt *testing.T) { + tt.Parallel() p := &PackageEvent{} p.GetRepo() p = nil @@ -15767,6 +17454,7 @@ func TestPackageEvent_GetRepo(tt *testing.T) { } func TestPackageEvent_GetSender(tt *testing.T) { + tt.Parallel() p := &PackageEvent{} p.GetSender() p = nil @@ -15774,6 +17462,7 @@ func TestPackageEvent_GetSender(tt *testing.T) { } func TestPackageFile_GetAuthor(tt *testing.T) { + tt.Parallel() p := &PackageFile{} p.GetAuthor() p = nil @@ -15781,6 +17470,7 @@ func TestPackageFile_GetAuthor(tt *testing.T) { } func TestPackageFile_GetContentType(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PackageFile{ContentType: &zeroValue} p.GetContentType() @@ -15791,6 +17481,7 @@ func TestPackageFile_GetContentType(tt *testing.T) { } func TestPackageFile_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &PackageFile{CreatedAt: &zeroValue} p.GetCreatedAt() @@ -15801,6 +17492,7 @@ func TestPackageFile_GetCreatedAt(tt *testing.T) { } func TestPackageFile_GetDownloadURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PackageFile{DownloadURL: &zeroValue} p.GetDownloadURL() @@ -15811,6 +17503,7 @@ func TestPackageFile_GetDownloadURL(tt *testing.T) { } func TestPackageFile_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 p := &PackageFile{ID: &zeroValue} p.GetID() @@ -15821,6 +17514,7 @@ func TestPackageFile_GetID(tt *testing.T) { } func TestPackageFile_GetMD5(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PackageFile{MD5: &zeroValue} p.GetMD5() @@ -15831,6 +17525,7 @@ func TestPackageFile_GetMD5(tt *testing.T) { } func TestPackageFile_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PackageFile{Name: &zeroValue} p.GetName() @@ -15841,6 +17536,7 @@ func TestPackageFile_GetName(tt *testing.T) { } func TestPackageFile_GetSHA1(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PackageFile{SHA1: &zeroValue} p.GetSHA1() @@ -15851,6 +17547,7 @@ func TestPackageFile_GetSHA1(tt *testing.T) { } func TestPackageFile_GetSHA256(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PackageFile{SHA256: &zeroValue} p.GetSHA256() @@ -15861,6 +17558,7 @@ func TestPackageFile_GetSHA256(tt *testing.T) { } func TestPackageFile_GetSize(tt *testing.T) { + tt.Parallel() var zeroValue int64 p := &PackageFile{Size: &zeroValue} p.GetSize() @@ -15871,6 +17569,7 @@ func TestPackageFile_GetSize(tt *testing.T) { } func TestPackageFile_GetState(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PackageFile{State: &zeroValue} p.GetState() @@ -15881,6 +17580,7 @@ func TestPackageFile_GetState(tt *testing.T) { } func TestPackageFile_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &PackageFile{UpdatedAt: &zeroValue} p.GetUpdatedAt() @@ -15891,6 +17591,7 @@ func TestPackageFile_GetUpdatedAt(tt *testing.T) { } func TestPackageListOptions_GetPackageType(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PackageListOptions{PackageType: &zeroValue} p.GetPackageType() @@ -15901,6 +17602,7 @@ func TestPackageListOptions_GetPackageType(tt *testing.T) { } func TestPackageListOptions_GetState(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PackageListOptions{State: &zeroValue} p.GetState() @@ -15911,6 +17613,7 @@ func TestPackageListOptions_GetState(tt *testing.T) { } func TestPackageListOptions_GetVisibility(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PackageListOptions{Visibility: &zeroValue} p.GetVisibility() @@ -15921,6 +17624,7 @@ func TestPackageListOptions_GetVisibility(tt *testing.T) { } func TestPackageMetadata_GetContainer(tt *testing.T) { + tt.Parallel() p := &PackageMetadata{} p.GetContainer() p = nil @@ -15928,6 +17632,7 @@ func TestPackageMetadata_GetContainer(tt *testing.T) { } func TestPackageMetadata_GetPackageType(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PackageMetadata{PackageType: &zeroValue} p.GetPackageType() @@ -15938,6 +17643,7 @@ func TestPackageMetadata_GetPackageType(tt *testing.T) { } func TestPackageRegistry_GetAboutURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PackageRegistry{AboutURL: &zeroValue} p.GetAboutURL() @@ -15948,6 +17654,7 @@ func TestPackageRegistry_GetAboutURL(tt *testing.T) { } func TestPackageRegistry_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PackageRegistry{Name: &zeroValue} p.GetName() @@ -15958,6 +17665,7 @@ func TestPackageRegistry_GetName(tt *testing.T) { } func TestPackageRegistry_GetType(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PackageRegistry{Type: &zeroValue} p.GetType() @@ -15968,6 +17676,7 @@ func TestPackageRegistry_GetType(tt *testing.T) { } func TestPackageRegistry_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PackageRegistry{URL: &zeroValue} p.GetURL() @@ -15978,6 +17687,7 @@ func TestPackageRegistry_GetURL(tt *testing.T) { } func TestPackageRegistry_GetVendor(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PackageRegistry{Vendor: &zeroValue} p.GetVendor() @@ -15988,6 +17698,7 @@ func TestPackageRegistry_GetVendor(tt *testing.T) { } func TestPackageRelease_GetAuthor(tt *testing.T) { + tt.Parallel() p := &PackageRelease{} p.GetAuthor() p = nil @@ -15995,6 +17706,7 @@ func TestPackageRelease_GetAuthor(tt *testing.T) { } func TestPackageRelease_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &PackageRelease{CreatedAt: &zeroValue} p.GetCreatedAt() @@ -16005,6 +17717,7 @@ func TestPackageRelease_GetCreatedAt(tt *testing.T) { } func TestPackageRelease_GetDraft(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PackageRelease{Draft: &zeroValue} p.GetDraft() @@ -16015,6 +17728,7 @@ func TestPackageRelease_GetDraft(tt *testing.T) { } func TestPackageRelease_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PackageRelease{HTMLURL: &zeroValue} p.GetHTMLURL() @@ -16025,6 +17739,7 @@ func TestPackageRelease_GetHTMLURL(tt *testing.T) { } func TestPackageRelease_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 p := &PackageRelease{ID: &zeroValue} p.GetID() @@ -16035,6 +17750,7 @@ func TestPackageRelease_GetID(tt *testing.T) { } func TestPackageRelease_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PackageRelease{Name: &zeroValue} p.GetName() @@ -16045,6 +17761,7 @@ func TestPackageRelease_GetName(tt *testing.T) { } func TestPackageRelease_GetPrerelease(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PackageRelease{Prerelease: &zeroValue} p.GetPrerelease() @@ -16055,6 +17772,7 @@ func TestPackageRelease_GetPrerelease(tt *testing.T) { } func TestPackageRelease_GetPublishedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &PackageRelease{PublishedAt: &zeroValue} p.GetPublishedAt() @@ -16065,6 +17783,7 @@ func TestPackageRelease_GetPublishedAt(tt *testing.T) { } func TestPackageRelease_GetTagName(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PackageRelease{TagName: &zeroValue} p.GetTagName() @@ -16075,6 +17794,7 @@ func TestPackageRelease_GetTagName(tt *testing.T) { } func TestPackageRelease_GetTargetCommitish(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PackageRelease{TargetCommitish: &zeroValue} p.GetTargetCommitish() @@ -16085,6 +17805,7 @@ func TestPackageRelease_GetTargetCommitish(tt *testing.T) { } func TestPackageRelease_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PackageRelease{URL: &zeroValue} p.GetURL() @@ -16095,6 +17816,7 @@ func TestPackageRelease_GetURL(tt *testing.T) { } func TestPackageVersion_GetAuthor(tt *testing.T) { + tt.Parallel() p := &PackageVersion{} p.GetAuthor() p = nil @@ -16102,6 +17824,7 @@ func TestPackageVersion_GetAuthor(tt *testing.T) { } func TestPackageVersion_GetBody(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PackageVersion{Body: &zeroValue} p.GetBody() @@ -16112,6 +17835,7 @@ func TestPackageVersion_GetBody(tt *testing.T) { } func TestPackageVersion_GetBodyHTML(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PackageVersion{BodyHTML: &zeroValue} p.GetBodyHTML() @@ -16122,6 +17846,7 @@ func TestPackageVersion_GetBodyHTML(tt *testing.T) { } func TestPackageVersion_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &PackageVersion{CreatedAt: &zeroValue} p.GetCreatedAt() @@ -16132,6 +17857,7 @@ func TestPackageVersion_GetCreatedAt(tt *testing.T) { } func TestPackageVersion_GetDraft(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PackageVersion{Draft: &zeroValue} p.GetDraft() @@ -16142,6 +17868,7 @@ func TestPackageVersion_GetDraft(tt *testing.T) { } func TestPackageVersion_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PackageVersion{HTMLURL: &zeroValue} p.GetHTMLURL() @@ -16152,6 +17879,7 @@ func TestPackageVersion_GetHTMLURL(tt *testing.T) { } func TestPackageVersion_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 p := &PackageVersion{ID: &zeroValue} p.GetID() @@ -16162,6 +17890,7 @@ func TestPackageVersion_GetID(tt *testing.T) { } func TestPackageVersion_GetInstallationCommand(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PackageVersion{InstallationCommand: &zeroValue} p.GetInstallationCommand() @@ -16172,6 +17901,7 @@ func TestPackageVersion_GetInstallationCommand(tt *testing.T) { } func TestPackageVersion_GetManifest(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PackageVersion{Manifest: &zeroValue} p.GetManifest() @@ -16182,6 +17912,7 @@ func TestPackageVersion_GetManifest(tt *testing.T) { } func TestPackageVersion_GetMetadata(tt *testing.T) { + tt.Parallel() p := &PackageVersion{} p.GetMetadata() p = nil @@ -16189,6 +17920,7 @@ func TestPackageVersion_GetMetadata(tt *testing.T) { } func TestPackageVersion_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PackageVersion{Name: &zeroValue} p.GetName() @@ -16199,6 +17931,7 @@ func TestPackageVersion_GetName(tt *testing.T) { } func TestPackageVersion_GetPackageHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PackageVersion{PackageHTMLURL: &zeroValue} p.GetPackageHTMLURL() @@ -16209,6 +17942,7 @@ func TestPackageVersion_GetPackageHTMLURL(tt *testing.T) { } func TestPackageVersion_GetPrerelease(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PackageVersion{Prerelease: &zeroValue} p.GetPrerelease() @@ -16219,6 +17953,7 @@ func TestPackageVersion_GetPrerelease(tt *testing.T) { } func TestPackageVersion_GetRelease(tt *testing.T) { + tt.Parallel() p := &PackageVersion{} p.GetRelease() p = nil @@ -16226,6 +17961,7 @@ func TestPackageVersion_GetRelease(tt *testing.T) { } func TestPackageVersion_GetSummary(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PackageVersion{Summary: &zeroValue} p.GetSummary() @@ -16236,6 +17972,7 @@ func TestPackageVersion_GetSummary(tt *testing.T) { } func TestPackageVersion_GetTagName(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PackageVersion{TagName: &zeroValue} p.GetTagName() @@ -16246,6 +17983,7 @@ func TestPackageVersion_GetTagName(tt *testing.T) { } func TestPackageVersion_GetTargetCommitish(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PackageVersion{TargetCommitish: &zeroValue} p.GetTargetCommitish() @@ -16256,6 +17994,7 @@ func TestPackageVersion_GetTargetCommitish(tt *testing.T) { } func TestPackageVersion_GetTargetOID(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PackageVersion{TargetOID: &zeroValue} p.GetTargetOID() @@ -16266,6 +18005,7 @@ func TestPackageVersion_GetTargetOID(tt *testing.T) { } func TestPackageVersion_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &PackageVersion{UpdatedAt: &zeroValue} p.GetUpdatedAt() @@ -16276,6 +18016,7 @@ func TestPackageVersion_GetUpdatedAt(tt *testing.T) { } func TestPackageVersion_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PackageVersion{URL: &zeroValue} p.GetURL() @@ -16286,6 +18027,7 @@ func TestPackageVersion_GetURL(tt *testing.T) { } func TestPackageVersion_GetVersion(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PackageVersion{Version: &zeroValue} p.GetVersion() @@ -16296,6 +18038,7 @@ func TestPackageVersion_GetVersion(tt *testing.T) { } func TestPage_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string p := &Page{Action: &zeroValue} p.GetAction() @@ -16306,6 +18049,7 @@ func TestPage_GetAction(tt *testing.T) { } func TestPage_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &Page{HTMLURL: &zeroValue} p.GetHTMLURL() @@ -16316,6 +18060,7 @@ func TestPage_GetHTMLURL(tt *testing.T) { } func TestPage_GetPageName(tt *testing.T) { + tt.Parallel() var zeroValue string p := &Page{PageName: &zeroValue} p.GetPageName() @@ -16326,6 +18071,7 @@ func TestPage_GetPageName(tt *testing.T) { } func TestPage_GetSHA(tt *testing.T) { + tt.Parallel() var zeroValue string p := &Page{SHA: &zeroValue} p.GetSHA() @@ -16336,6 +18082,7 @@ func TestPage_GetSHA(tt *testing.T) { } func TestPage_GetSummary(tt *testing.T) { + tt.Parallel() var zeroValue string p := &Page{Summary: &zeroValue} p.GetSummary() @@ -16346,6 +18093,7 @@ func TestPage_GetSummary(tt *testing.T) { } func TestPage_GetTitle(tt *testing.T) { + tt.Parallel() var zeroValue string p := &Page{Title: &zeroValue} p.GetTitle() @@ -16356,6 +18104,7 @@ func TestPage_GetTitle(tt *testing.T) { } func TestPageBuildEvent_GetBuild(tt *testing.T) { + tt.Parallel() p := &PageBuildEvent{} p.GetBuild() p = nil @@ -16363,6 +18112,7 @@ func TestPageBuildEvent_GetBuild(tt *testing.T) { } func TestPageBuildEvent_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 p := &PageBuildEvent{ID: &zeroValue} p.GetID() @@ -16373,6 +18123,7 @@ func TestPageBuildEvent_GetID(tt *testing.T) { } func TestPageBuildEvent_GetInstallation(tt *testing.T) { + tt.Parallel() p := &PageBuildEvent{} p.GetInstallation() p = nil @@ -16380,6 +18131,7 @@ func TestPageBuildEvent_GetInstallation(tt *testing.T) { } func TestPageBuildEvent_GetOrg(tt *testing.T) { + tt.Parallel() p := &PageBuildEvent{} p.GetOrg() p = nil @@ -16387,6 +18139,7 @@ func TestPageBuildEvent_GetOrg(tt *testing.T) { } func TestPageBuildEvent_GetRepo(tt *testing.T) { + tt.Parallel() p := &PageBuildEvent{} p.GetRepo() p = nil @@ -16394,6 +18147,7 @@ func TestPageBuildEvent_GetRepo(tt *testing.T) { } func TestPageBuildEvent_GetSender(tt *testing.T) { + tt.Parallel() p := &PageBuildEvent{} p.GetSender() p = nil @@ -16401,6 +18155,7 @@ func TestPageBuildEvent_GetSender(tt *testing.T) { } func TestPages_GetBuildType(tt *testing.T) { + tt.Parallel() var zeroValue string p := &Pages{BuildType: &zeroValue} p.GetBuildType() @@ -16411,6 +18166,7 @@ func TestPages_GetBuildType(tt *testing.T) { } func TestPages_GetCNAME(tt *testing.T) { + tt.Parallel() var zeroValue string p := &Pages{CNAME: &zeroValue} p.GetCNAME() @@ -16421,6 +18177,7 @@ func TestPages_GetCNAME(tt *testing.T) { } func TestPages_GetCustom404(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &Pages{Custom404: &zeroValue} p.GetCustom404() @@ -16431,6 +18188,7 @@ func TestPages_GetCustom404(tt *testing.T) { } func TestPages_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &Pages{HTMLURL: &zeroValue} p.GetHTMLURL() @@ -16441,6 +18199,7 @@ func TestPages_GetHTMLURL(tt *testing.T) { } func TestPages_GetHTTPSCertificate(tt *testing.T) { + tt.Parallel() p := &Pages{} p.GetHTTPSCertificate() p = nil @@ -16448,6 +18207,7 @@ func TestPages_GetHTTPSCertificate(tt *testing.T) { } func TestPages_GetHTTPSEnforced(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &Pages{HTTPSEnforced: &zeroValue} p.GetHTTPSEnforced() @@ -16458,6 +18218,7 @@ func TestPages_GetHTTPSEnforced(tt *testing.T) { } func TestPages_GetPublic(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &Pages{Public: &zeroValue} p.GetPublic() @@ -16468,6 +18229,7 @@ func TestPages_GetPublic(tt *testing.T) { } func TestPages_GetSource(tt *testing.T) { + tt.Parallel() p := &Pages{} p.GetSource() p = nil @@ -16475,6 +18237,7 @@ func TestPages_GetSource(tt *testing.T) { } func TestPages_GetStatus(tt *testing.T) { + tt.Parallel() var zeroValue string p := &Pages{Status: &zeroValue} p.GetStatus() @@ -16485,6 +18248,7 @@ func TestPages_GetStatus(tt *testing.T) { } func TestPages_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &Pages{URL: &zeroValue} p.GetURL() @@ -16495,6 +18259,7 @@ func TestPages_GetURL(tt *testing.T) { } func TestPagesBuild_GetCommit(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PagesBuild{Commit: &zeroValue} p.GetCommit() @@ -16505,6 +18270,7 @@ func TestPagesBuild_GetCommit(tt *testing.T) { } func TestPagesBuild_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &PagesBuild{CreatedAt: &zeroValue} p.GetCreatedAt() @@ -16515,6 +18281,7 @@ func TestPagesBuild_GetCreatedAt(tt *testing.T) { } func TestPagesBuild_GetDuration(tt *testing.T) { + tt.Parallel() var zeroValue int p := &PagesBuild{Duration: &zeroValue} p.GetDuration() @@ -16525,6 +18292,7 @@ func TestPagesBuild_GetDuration(tt *testing.T) { } func TestPagesBuild_GetError(tt *testing.T) { + tt.Parallel() p := &PagesBuild{} p.GetError() p = nil @@ -16532,6 +18300,7 @@ func TestPagesBuild_GetError(tt *testing.T) { } func TestPagesBuild_GetPusher(tt *testing.T) { + tt.Parallel() p := &PagesBuild{} p.GetPusher() p = nil @@ -16539,6 +18308,7 @@ func TestPagesBuild_GetPusher(tt *testing.T) { } func TestPagesBuild_GetStatus(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PagesBuild{Status: &zeroValue} p.GetStatus() @@ -16549,6 +18319,7 @@ func TestPagesBuild_GetStatus(tt *testing.T) { } func TestPagesBuild_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &PagesBuild{UpdatedAt: &zeroValue} p.GetUpdatedAt() @@ -16559,6 +18330,7 @@ func TestPagesBuild_GetUpdatedAt(tt *testing.T) { } func TestPagesBuild_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PagesBuild{URL: &zeroValue} p.GetURL() @@ -16569,6 +18341,7 @@ func TestPagesBuild_GetURL(tt *testing.T) { } func TestPagesDomain_GetCAAError(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PagesDomain{CAAError: &zeroValue} p.GetCAAError() @@ -16579,6 +18352,7 @@ func TestPagesDomain_GetCAAError(tt *testing.T) { } func TestPagesDomain_GetDNSResolves(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PagesDomain{DNSResolves: &zeroValue} p.GetDNSResolves() @@ -16589,6 +18363,7 @@ func TestPagesDomain_GetDNSResolves(tt *testing.T) { } func TestPagesDomain_GetEnforcesHTTPS(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PagesDomain{EnforcesHTTPS: &zeroValue} p.GetEnforcesHTTPS() @@ -16599,6 +18374,7 @@ func TestPagesDomain_GetEnforcesHTTPS(tt *testing.T) { } func TestPagesDomain_GetHasCNAMERecord(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PagesDomain{HasCNAMERecord: &zeroValue} p.GetHasCNAMERecord() @@ -16609,6 +18385,7 @@ func TestPagesDomain_GetHasCNAMERecord(tt *testing.T) { } func TestPagesDomain_GetHasMXRecordsPresent(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PagesDomain{HasMXRecordsPresent: &zeroValue} p.GetHasMXRecordsPresent() @@ -16619,6 +18396,7 @@ func TestPagesDomain_GetHasMXRecordsPresent(tt *testing.T) { } func TestPagesDomain_GetHost(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PagesDomain{Host: &zeroValue} p.GetHost() @@ -16629,6 +18407,7 @@ func TestPagesDomain_GetHost(tt *testing.T) { } func TestPagesDomain_GetHTTPSError(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PagesDomain{HTTPSError: &zeroValue} p.GetHTTPSError() @@ -16639,6 +18418,7 @@ func TestPagesDomain_GetHTTPSError(tt *testing.T) { } func TestPagesDomain_GetIsApexDomain(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PagesDomain{IsApexDomain: &zeroValue} p.GetIsApexDomain() @@ -16649,6 +18429,7 @@ func TestPagesDomain_GetIsApexDomain(tt *testing.T) { } func TestPagesDomain_GetIsARecord(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PagesDomain{IsARecord: &zeroValue} p.GetIsARecord() @@ -16659,6 +18440,7 @@ func TestPagesDomain_GetIsARecord(tt *testing.T) { } func TestPagesDomain_GetIsCloudflareIP(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PagesDomain{IsCloudflareIP: &zeroValue} p.GetIsCloudflareIP() @@ -16669,6 +18451,7 @@ func TestPagesDomain_GetIsCloudflareIP(tt *testing.T) { } func TestPagesDomain_GetIsCNAMEToFastly(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PagesDomain{IsCNAMEToFastly: &zeroValue} p.GetIsCNAMEToFastly() @@ -16679,6 +18462,7 @@ func TestPagesDomain_GetIsCNAMEToFastly(tt *testing.T) { } func TestPagesDomain_GetIsCNAMEToGithubUserDomain(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PagesDomain{IsCNAMEToGithubUserDomain: &zeroValue} p.GetIsCNAMEToGithubUserDomain() @@ -16689,6 +18473,7 @@ func TestPagesDomain_GetIsCNAMEToGithubUserDomain(tt *testing.T) { } func TestPagesDomain_GetIsCNAMEToPagesDotGithubDotCom(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PagesDomain{IsCNAMEToPagesDotGithubDotCom: &zeroValue} p.GetIsCNAMEToPagesDotGithubDotCom() @@ -16699,6 +18484,7 @@ func TestPagesDomain_GetIsCNAMEToPagesDotGithubDotCom(tt *testing.T) { } func TestPagesDomain_GetIsFastlyIP(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PagesDomain{IsFastlyIP: &zeroValue} p.GetIsFastlyIP() @@ -16709,6 +18495,7 @@ func TestPagesDomain_GetIsFastlyIP(tt *testing.T) { } func TestPagesDomain_GetIsHTTPSEligible(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PagesDomain{IsHTTPSEligible: &zeroValue} p.GetIsHTTPSEligible() @@ -16719,6 +18506,7 @@ func TestPagesDomain_GetIsHTTPSEligible(tt *testing.T) { } func TestPagesDomain_GetIsNonGithubPagesIPPresent(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PagesDomain{IsNonGithubPagesIPPresent: &zeroValue} p.GetIsNonGithubPagesIPPresent() @@ -16729,6 +18517,7 @@ func TestPagesDomain_GetIsNonGithubPagesIPPresent(tt *testing.T) { } func TestPagesDomain_GetIsOldIPAddress(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PagesDomain{IsOldIPAddress: &zeroValue} p.GetIsOldIPAddress() @@ -16739,6 +18528,7 @@ func TestPagesDomain_GetIsOldIPAddress(tt *testing.T) { } func TestPagesDomain_GetIsPagesDomain(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PagesDomain{IsPagesDomain: &zeroValue} p.GetIsPagesDomain() @@ -16749,6 +18539,7 @@ func TestPagesDomain_GetIsPagesDomain(tt *testing.T) { } func TestPagesDomain_GetIsPointedToGithubPagesIP(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PagesDomain{IsPointedToGithubPagesIP: &zeroValue} p.GetIsPointedToGithubPagesIP() @@ -16759,6 +18550,7 @@ func TestPagesDomain_GetIsPointedToGithubPagesIP(tt *testing.T) { } func TestPagesDomain_GetIsProxied(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PagesDomain{IsProxied: &zeroValue} p.GetIsProxied() @@ -16769,6 +18561,7 @@ func TestPagesDomain_GetIsProxied(tt *testing.T) { } func TestPagesDomain_GetIsServedByPages(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PagesDomain{IsServedByPages: &zeroValue} p.GetIsServedByPages() @@ -16779,6 +18572,7 @@ func TestPagesDomain_GetIsServedByPages(tt *testing.T) { } func TestPagesDomain_GetIsValid(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PagesDomain{IsValid: &zeroValue} p.GetIsValid() @@ -16789,6 +18583,7 @@ func TestPagesDomain_GetIsValid(tt *testing.T) { } func TestPagesDomain_GetIsValidDomain(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PagesDomain{IsValidDomain: &zeroValue} p.GetIsValidDomain() @@ -16799,6 +18594,7 @@ func TestPagesDomain_GetIsValidDomain(tt *testing.T) { } func TestPagesDomain_GetNameservers(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PagesDomain{Nameservers: &zeroValue} p.GetNameservers() @@ -16809,6 +18605,7 @@ func TestPagesDomain_GetNameservers(tt *testing.T) { } func TestPagesDomain_GetReason(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PagesDomain{Reason: &zeroValue} p.GetReason() @@ -16819,6 +18616,7 @@ func TestPagesDomain_GetReason(tt *testing.T) { } func TestPagesDomain_GetRespondsToHTTPS(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PagesDomain{RespondsToHTTPS: &zeroValue} p.GetRespondsToHTTPS() @@ -16829,6 +18627,7 @@ func TestPagesDomain_GetRespondsToHTTPS(tt *testing.T) { } func TestPagesDomain_GetShouldBeARecord(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PagesDomain{ShouldBeARecord: &zeroValue} p.GetShouldBeARecord() @@ -16839,6 +18638,7 @@ func TestPagesDomain_GetShouldBeARecord(tt *testing.T) { } func TestPagesDomain_GetURI(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PagesDomain{URI: &zeroValue} p.GetURI() @@ -16849,6 +18649,7 @@ func TestPagesDomain_GetURI(tt *testing.T) { } func TestPagesError_GetMessage(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PagesError{Message: &zeroValue} p.GetMessage() @@ -16859,6 +18660,7 @@ func TestPagesError_GetMessage(tt *testing.T) { } func TestPagesHealthCheckResponse_GetAltDomain(tt *testing.T) { + tt.Parallel() p := &PagesHealthCheckResponse{} p.GetAltDomain() p = nil @@ -16866,6 +18668,7 @@ func TestPagesHealthCheckResponse_GetAltDomain(tt *testing.T) { } func TestPagesHealthCheckResponse_GetDomain(tt *testing.T) { + tt.Parallel() p := &PagesHealthCheckResponse{} p.GetDomain() p = nil @@ -16873,6 +18676,7 @@ func TestPagesHealthCheckResponse_GetDomain(tt *testing.T) { } func TestPagesHTTPSCertificate_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PagesHTTPSCertificate{Description: &zeroValue} p.GetDescription() @@ -16883,6 +18687,7 @@ func TestPagesHTTPSCertificate_GetDescription(tt *testing.T) { } func TestPagesHTTPSCertificate_GetExpiresAt(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PagesHTTPSCertificate{ExpiresAt: &zeroValue} p.GetExpiresAt() @@ -16893,6 +18698,7 @@ func TestPagesHTTPSCertificate_GetExpiresAt(tt *testing.T) { } func TestPagesHTTPSCertificate_GetState(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PagesHTTPSCertificate{State: &zeroValue} p.GetState() @@ -16903,6 +18709,7 @@ func TestPagesHTTPSCertificate_GetState(tt *testing.T) { } func TestPagesSource_GetBranch(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PagesSource{Branch: &zeroValue} p.GetBranch() @@ -16913,6 +18720,7 @@ func TestPagesSource_GetBranch(tt *testing.T) { } func TestPagesSource_GetPath(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PagesSource{Path: &zeroValue} p.GetPath() @@ -16923,6 +18731,7 @@ func TestPagesSource_GetPath(tt *testing.T) { } func TestPageStats_GetTotalPages(tt *testing.T) { + tt.Parallel() var zeroValue int p := &PageStats{TotalPages: &zeroValue} p.GetTotalPages() @@ -16933,6 +18742,7 @@ func TestPageStats_GetTotalPages(tt *testing.T) { } func TestPagesUpdate_GetBuildType(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PagesUpdate{BuildType: &zeroValue} p.GetBuildType() @@ -16943,6 +18753,7 @@ func TestPagesUpdate_GetBuildType(tt *testing.T) { } func TestPagesUpdate_GetCNAME(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PagesUpdate{CNAME: &zeroValue} p.GetCNAME() @@ -16953,6 +18764,7 @@ func TestPagesUpdate_GetCNAME(tt *testing.T) { } func TestPagesUpdate_GetHTTPSEnforced(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PagesUpdate{HTTPSEnforced: &zeroValue} p.GetHTTPSEnforced() @@ -16963,6 +18775,7 @@ func TestPagesUpdate_GetHTTPSEnforced(tt *testing.T) { } func TestPagesUpdate_GetPublic(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PagesUpdate{Public: &zeroValue} p.GetPublic() @@ -16973,6 +18786,7 @@ func TestPagesUpdate_GetPublic(tt *testing.T) { } func TestPagesUpdate_GetSource(tt *testing.T) { + tt.Parallel() p := &PagesUpdate{} p.GetSource() p = nil @@ -16980,6 +18794,7 @@ func TestPagesUpdate_GetSource(tt *testing.T) { } func TestPendingDeployment_GetCurrentUserCanApprove(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PendingDeployment{CurrentUserCanApprove: &zeroValue} p.GetCurrentUserCanApprove() @@ -16990,6 +18805,7 @@ func TestPendingDeployment_GetCurrentUserCanApprove(tt *testing.T) { } func TestPendingDeployment_GetEnvironment(tt *testing.T) { + tt.Parallel() p := &PendingDeployment{} p.GetEnvironment() p = nil @@ -16997,6 +18813,7 @@ func TestPendingDeployment_GetEnvironment(tt *testing.T) { } func TestPendingDeployment_GetWaitTimer(tt *testing.T) { + tt.Parallel() var zeroValue int64 p := &PendingDeployment{WaitTimer: &zeroValue} p.GetWaitTimer() @@ -17007,6 +18824,7 @@ func TestPendingDeployment_GetWaitTimer(tt *testing.T) { } func TestPendingDeployment_GetWaitTimerStartedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &PendingDeployment{WaitTimerStartedAt: &zeroValue} p.GetWaitTimerStartedAt() @@ -17017,6 +18835,7 @@ func TestPendingDeployment_GetWaitTimerStartedAt(tt *testing.T) { } func TestPendingDeploymentEnvironment_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PendingDeploymentEnvironment{HTMLURL: &zeroValue} p.GetHTMLURL() @@ -17027,6 +18846,7 @@ func TestPendingDeploymentEnvironment_GetHTMLURL(tt *testing.T) { } func TestPendingDeploymentEnvironment_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 p := &PendingDeploymentEnvironment{ID: &zeroValue} p.GetID() @@ -17037,6 +18857,7 @@ func TestPendingDeploymentEnvironment_GetID(tt *testing.T) { } func TestPendingDeploymentEnvironment_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PendingDeploymentEnvironment{Name: &zeroValue} p.GetName() @@ -17047,6 +18868,7 @@ func TestPendingDeploymentEnvironment_GetName(tt *testing.T) { } func TestPendingDeploymentEnvironment_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PendingDeploymentEnvironment{NodeID: &zeroValue} p.GetNodeID() @@ -17057,6 +18879,7 @@ func TestPendingDeploymentEnvironment_GetNodeID(tt *testing.T) { } func TestPendingDeploymentEnvironment_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PendingDeploymentEnvironment{URL: &zeroValue} p.GetURL() @@ -17067,6 +18890,7 @@ func TestPendingDeploymentEnvironment_GetURL(tt *testing.T) { } func TestPersonalAccessToken_GetAccessGrantedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &PersonalAccessToken{AccessGrantedAt: &zeroValue} p.GetAccessGrantedAt() @@ -17077,6 +18901,7 @@ func TestPersonalAccessToken_GetAccessGrantedAt(tt *testing.T) { } func TestPersonalAccessToken_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 p := &PersonalAccessToken{ID: &zeroValue} p.GetID() @@ -17087,6 +18912,7 @@ func TestPersonalAccessToken_GetID(tt *testing.T) { } func TestPersonalAccessToken_GetOwner(tt *testing.T) { + tt.Parallel() p := &PersonalAccessToken{} p.GetOwner() p = nil @@ -17094,6 +18920,7 @@ func TestPersonalAccessToken_GetOwner(tt *testing.T) { } func TestPersonalAccessToken_GetPermissions(tt *testing.T) { + tt.Parallel() p := &PersonalAccessToken{} p.GetPermissions() p = nil @@ -17101,6 +18928,7 @@ func TestPersonalAccessToken_GetPermissions(tt *testing.T) { } func TestPersonalAccessToken_GetRepositoriesURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PersonalAccessToken{RepositoriesURL: &zeroValue} p.GetRepositoriesURL() @@ -17111,6 +18939,7 @@ func TestPersonalAccessToken_GetRepositoriesURL(tt *testing.T) { } func TestPersonalAccessToken_GetRepositorySelection(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PersonalAccessToken{RepositorySelection: &zeroValue} p.GetRepositorySelection() @@ -17121,6 +18950,7 @@ func TestPersonalAccessToken_GetRepositorySelection(tt *testing.T) { } func TestPersonalAccessToken_GetTokenExpired(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PersonalAccessToken{TokenExpired: &zeroValue} p.GetTokenExpired() @@ -17131,6 +18961,7 @@ func TestPersonalAccessToken_GetTokenExpired(tt *testing.T) { } func TestPersonalAccessToken_GetTokenExpiresAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &PersonalAccessToken{TokenExpiresAt: &zeroValue} p.GetTokenExpiresAt() @@ -17141,6 +18972,7 @@ func TestPersonalAccessToken_GetTokenExpiresAt(tt *testing.T) { } func TestPersonalAccessToken_GetTokenLastUsedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &PersonalAccessToken{TokenLastUsedAt: &zeroValue} p.GetTokenLastUsedAt() @@ -17151,6 +18983,7 @@ func TestPersonalAccessToken_GetTokenLastUsedAt(tt *testing.T) { } func TestPersonalAccessTokenPermissions_GetOrg(tt *testing.T) { + tt.Parallel() zeroValue := map[string]string{} p := &PersonalAccessTokenPermissions{Org: zeroValue} p.GetOrg() @@ -17161,6 +18994,7 @@ func TestPersonalAccessTokenPermissions_GetOrg(tt *testing.T) { } func TestPersonalAccessTokenPermissions_GetOther(tt *testing.T) { + tt.Parallel() zeroValue := map[string]string{} p := &PersonalAccessTokenPermissions{Other: zeroValue} p.GetOther() @@ -17171,6 +19005,7 @@ func TestPersonalAccessTokenPermissions_GetOther(tt *testing.T) { } func TestPersonalAccessTokenPermissions_GetRepo(tt *testing.T) { + tt.Parallel() zeroValue := map[string]string{} p := &PersonalAccessTokenPermissions{Repo: zeroValue} p.GetRepo() @@ -17181,6 +19016,7 @@ func TestPersonalAccessTokenPermissions_GetRepo(tt *testing.T) { } func TestPersonalAccessTokenRequest_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &PersonalAccessTokenRequest{CreatedAt: &zeroValue} p.GetCreatedAt() @@ -17191,6 +19027,7 @@ func TestPersonalAccessTokenRequest_GetCreatedAt(tt *testing.T) { } func TestPersonalAccessTokenRequest_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 p := &PersonalAccessTokenRequest{ID: &zeroValue} p.GetID() @@ -17201,6 +19038,7 @@ func TestPersonalAccessTokenRequest_GetID(tt *testing.T) { } func TestPersonalAccessTokenRequest_GetOrg(tt *testing.T) { + tt.Parallel() p := &PersonalAccessTokenRequest{} p.GetOrg() p = nil @@ -17208,6 +19046,7 @@ func TestPersonalAccessTokenRequest_GetOrg(tt *testing.T) { } func TestPersonalAccessTokenRequest_GetOwner(tt *testing.T) { + tt.Parallel() p := &PersonalAccessTokenRequest{} p.GetOwner() p = nil @@ -17215,6 +19054,7 @@ func TestPersonalAccessTokenRequest_GetOwner(tt *testing.T) { } func TestPersonalAccessTokenRequest_GetPermissionsAdded(tt *testing.T) { + tt.Parallel() p := &PersonalAccessTokenRequest{} p.GetPermissionsAdded() p = nil @@ -17222,6 +19062,7 @@ func TestPersonalAccessTokenRequest_GetPermissionsAdded(tt *testing.T) { } func TestPersonalAccessTokenRequest_GetPermissionsResult(tt *testing.T) { + tt.Parallel() p := &PersonalAccessTokenRequest{} p.GetPermissionsResult() p = nil @@ -17229,6 +19070,7 @@ func TestPersonalAccessTokenRequest_GetPermissionsResult(tt *testing.T) { } func TestPersonalAccessTokenRequest_GetPermissionsUpgraded(tt *testing.T) { + tt.Parallel() p := &PersonalAccessTokenRequest{} p.GetPermissionsUpgraded() p = nil @@ -17236,6 +19078,7 @@ func TestPersonalAccessTokenRequest_GetPermissionsUpgraded(tt *testing.T) { } func TestPersonalAccessTokenRequest_GetRepositoryCount(tt *testing.T) { + tt.Parallel() var zeroValue int64 p := &PersonalAccessTokenRequest{RepositoryCount: &zeroValue} p.GetRepositoryCount() @@ -17246,6 +19089,7 @@ func TestPersonalAccessTokenRequest_GetRepositoryCount(tt *testing.T) { } func TestPersonalAccessTokenRequest_GetRepositorySelection(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PersonalAccessTokenRequest{RepositorySelection: &zeroValue} p.GetRepositorySelection() @@ -17256,6 +19100,7 @@ func TestPersonalAccessTokenRequest_GetRepositorySelection(tt *testing.T) { } func TestPersonalAccessTokenRequest_GetTokenExpired(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PersonalAccessTokenRequest{TokenExpired: &zeroValue} p.GetTokenExpired() @@ -17266,6 +19111,7 @@ func TestPersonalAccessTokenRequest_GetTokenExpired(tt *testing.T) { } func TestPersonalAccessTokenRequest_GetTokenExpiresAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &PersonalAccessTokenRequest{TokenExpiresAt: &zeroValue} p.GetTokenExpiresAt() @@ -17276,6 +19122,7 @@ func TestPersonalAccessTokenRequest_GetTokenExpiresAt(tt *testing.T) { } func TestPersonalAccessTokenRequest_GetTokenLastUsedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &PersonalAccessTokenRequest{TokenLastUsedAt: &zeroValue} p.GetTokenLastUsedAt() @@ -17286,6 +19133,7 @@ func TestPersonalAccessTokenRequest_GetTokenLastUsedAt(tt *testing.T) { } func TestPersonalAccessTokenRequestEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PersonalAccessTokenRequestEvent{Action: &zeroValue} p.GetAction() @@ -17296,6 +19144,7 @@ func TestPersonalAccessTokenRequestEvent_GetAction(tt *testing.T) { } func TestPersonalAccessTokenRequestEvent_GetInstallation(tt *testing.T) { + tt.Parallel() p := &PersonalAccessTokenRequestEvent{} p.GetInstallation() p = nil @@ -17303,6 +19152,7 @@ func TestPersonalAccessTokenRequestEvent_GetInstallation(tt *testing.T) { } func TestPersonalAccessTokenRequestEvent_GetOrg(tt *testing.T) { + tt.Parallel() p := &PersonalAccessTokenRequestEvent{} p.GetOrg() p = nil @@ -17310,6 +19160,7 @@ func TestPersonalAccessTokenRequestEvent_GetOrg(tt *testing.T) { } func TestPersonalAccessTokenRequestEvent_GetPersonalAccessTokenRequest(tt *testing.T) { + tt.Parallel() p := &PersonalAccessTokenRequestEvent{} p.GetPersonalAccessTokenRequest() p = nil @@ -17317,6 +19168,7 @@ func TestPersonalAccessTokenRequestEvent_GetPersonalAccessTokenRequest(tt *testi } func TestPersonalAccessTokenRequestEvent_GetSender(tt *testing.T) { + tt.Parallel() p := &PersonalAccessTokenRequestEvent{} p.GetSender() p = nil @@ -17324,6 +19176,7 @@ func TestPersonalAccessTokenRequestEvent_GetSender(tt *testing.T) { } func TestPingEvent_GetHook(tt *testing.T) { + tt.Parallel() p := &PingEvent{} p.GetHook() p = nil @@ -17331,6 +19184,7 @@ func TestPingEvent_GetHook(tt *testing.T) { } func TestPingEvent_GetHookID(tt *testing.T) { + tt.Parallel() var zeroValue int64 p := &PingEvent{HookID: &zeroValue} p.GetHookID() @@ -17341,6 +19195,7 @@ func TestPingEvent_GetHookID(tt *testing.T) { } func TestPingEvent_GetInstallation(tt *testing.T) { + tt.Parallel() p := &PingEvent{} p.GetInstallation() p = nil @@ -17348,6 +19203,7 @@ func TestPingEvent_GetInstallation(tt *testing.T) { } func TestPingEvent_GetOrg(tt *testing.T) { + tt.Parallel() p := &PingEvent{} p.GetOrg() p = nil @@ -17355,6 +19211,7 @@ func TestPingEvent_GetOrg(tt *testing.T) { } func TestPingEvent_GetRepo(tt *testing.T) { + tt.Parallel() p := &PingEvent{} p.GetRepo() p = nil @@ -17362,6 +19219,7 @@ func TestPingEvent_GetRepo(tt *testing.T) { } func TestPingEvent_GetSender(tt *testing.T) { + tt.Parallel() p := &PingEvent{} p.GetSender() p = nil @@ -17369,6 +19227,7 @@ func TestPingEvent_GetSender(tt *testing.T) { } func TestPingEvent_GetZen(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PingEvent{Zen: &zeroValue} p.GetZen() @@ -17379,6 +19238,7 @@ func TestPingEvent_GetZen(tt *testing.T) { } func TestPlan_GetCollaborators(tt *testing.T) { + tt.Parallel() var zeroValue int p := &Plan{Collaborators: &zeroValue} p.GetCollaborators() @@ -17389,6 +19249,7 @@ func TestPlan_GetCollaborators(tt *testing.T) { } func TestPlan_GetFilledSeats(tt *testing.T) { + tt.Parallel() var zeroValue int p := &Plan{FilledSeats: &zeroValue} p.GetFilledSeats() @@ -17399,6 +19260,7 @@ func TestPlan_GetFilledSeats(tt *testing.T) { } func TestPlan_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string p := &Plan{Name: &zeroValue} p.GetName() @@ -17409,6 +19271,7 @@ func TestPlan_GetName(tt *testing.T) { } func TestPlan_GetPrivateRepos(tt *testing.T) { + tt.Parallel() var zeroValue int64 p := &Plan{PrivateRepos: &zeroValue} p.GetPrivateRepos() @@ -17419,6 +19282,7 @@ func TestPlan_GetPrivateRepos(tt *testing.T) { } func TestPlan_GetSeats(tt *testing.T) { + tt.Parallel() var zeroValue int p := &Plan{Seats: &zeroValue} p.GetSeats() @@ -17429,6 +19293,7 @@ func TestPlan_GetSeats(tt *testing.T) { } func TestPlan_GetSpace(tt *testing.T) { + tt.Parallel() var zeroValue int p := &Plan{Space: &zeroValue} p.GetSpace() @@ -17439,6 +19304,7 @@ func TestPlan_GetSpace(tt *testing.T) { } func TestPreReceiveHook_GetConfigURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PreReceiveHook{ConfigURL: &zeroValue} p.GetConfigURL() @@ -17449,6 +19315,7 @@ func TestPreReceiveHook_GetConfigURL(tt *testing.T) { } func TestPreReceiveHook_GetEnforcement(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PreReceiveHook{Enforcement: &zeroValue} p.GetEnforcement() @@ -17459,6 +19326,7 @@ func TestPreReceiveHook_GetEnforcement(tt *testing.T) { } func TestPreReceiveHook_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 p := &PreReceiveHook{ID: &zeroValue} p.GetID() @@ -17469,6 +19337,7 @@ func TestPreReceiveHook_GetID(tt *testing.T) { } func TestPreReceiveHook_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PreReceiveHook{Name: &zeroValue} p.GetName() @@ -17479,6 +19348,7 @@ func TestPreReceiveHook_GetName(tt *testing.T) { } func TestPRLink_GetHRef(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PRLink{HRef: &zeroValue} p.GetHRef() @@ -17489,6 +19359,7 @@ func TestPRLink_GetHRef(tt *testing.T) { } func TestPRLinks_GetComments(tt *testing.T) { + tt.Parallel() p := &PRLinks{} p.GetComments() p = nil @@ -17496,6 +19367,7 @@ func TestPRLinks_GetComments(tt *testing.T) { } func TestPRLinks_GetCommits(tt *testing.T) { + tt.Parallel() p := &PRLinks{} p.GetCommits() p = nil @@ -17503,6 +19375,7 @@ func TestPRLinks_GetCommits(tt *testing.T) { } func TestPRLinks_GetHTML(tt *testing.T) { + tt.Parallel() p := &PRLinks{} p.GetHTML() p = nil @@ -17510,6 +19383,7 @@ func TestPRLinks_GetHTML(tt *testing.T) { } func TestPRLinks_GetIssue(tt *testing.T) { + tt.Parallel() p := &PRLinks{} p.GetIssue() p = nil @@ -17517,6 +19391,7 @@ func TestPRLinks_GetIssue(tt *testing.T) { } func TestPRLinks_GetReviewComment(tt *testing.T) { + tt.Parallel() p := &PRLinks{} p.GetReviewComment() p = nil @@ -17524,6 +19399,7 @@ func TestPRLinks_GetReviewComment(tt *testing.T) { } func TestPRLinks_GetReviewComments(tt *testing.T) { + tt.Parallel() p := &PRLinks{} p.GetReviewComments() p = nil @@ -17531,6 +19407,7 @@ func TestPRLinks_GetReviewComments(tt *testing.T) { } func TestPRLinks_GetSelf(tt *testing.T) { + tt.Parallel() p := &PRLinks{} p.GetSelf() p = nil @@ -17538,6 +19415,7 @@ func TestPRLinks_GetSelf(tt *testing.T) { } func TestPRLinks_GetStatuses(tt *testing.T) { + tt.Parallel() p := &PRLinks{} p.GetStatuses() p = nil @@ -17545,6 +19423,7 @@ func TestPRLinks_GetStatuses(tt *testing.T) { } func TestProject_GetBody(tt *testing.T) { + tt.Parallel() var zeroValue string p := &Project{Body: &zeroValue} p.GetBody() @@ -17555,6 +19434,7 @@ func TestProject_GetBody(tt *testing.T) { } func TestProject_GetColumnsURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &Project{ColumnsURL: &zeroValue} p.GetColumnsURL() @@ -17565,6 +19445,7 @@ func TestProject_GetColumnsURL(tt *testing.T) { } func TestProject_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &Project{CreatedAt: &zeroValue} p.GetCreatedAt() @@ -17575,6 +19456,7 @@ func TestProject_GetCreatedAt(tt *testing.T) { } func TestProject_GetCreator(tt *testing.T) { + tt.Parallel() p := &Project{} p.GetCreator() p = nil @@ -17582,6 +19464,7 @@ func TestProject_GetCreator(tt *testing.T) { } func TestProject_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &Project{HTMLURL: &zeroValue} p.GetHTMLURL() @@ -17592,6 +19475,7 @@ func TestProject_GetHTMLURL(tt *testing.T) { } func TestProject_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 p := &Project{ID: &zeroValue} p.GetID() @@ -17602,6 +19486,7 @@ func TestProject_GetID(tt *testing.T) { } func TestProject_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string p := &Project{Name: &zeroValue} p.GetName() @@ -17612,6 +19497,7 @@ func TestProject_GetName(tt *testing.T) { } func TestProject_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string p := &Project{NodeID: &zeroValue} p.GetNodeID() @@ -17622,6 +19508,7 @@ func TestProject_GetNodeID(tt *testing.T) { } func TestProject_GetNumber(tt *testing.T) { + tt.Parallel() var zeroValue int p := &Project{Number: &zeroValue} p.GetNumber() @@ -17632,6 +19519,7 @@ func TestProject_GetNumber(tt *testing.T) { } func TestProject_GetOrganizationPermission(tt *testing.T) { + tt.Parallel() var zeroValue string p := &Project{OrganizationPermission: &zeroValue} p.GetOrganizationPermission() @@ -17642,6 +19530,7 @@ func TestProject_GetOrganizationPermission(tt *testing.T) { } func TestProject_GetOwnerURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &Project{OwnerURL: &zeroValue} p.GetOwnerURL() @@ -17652,6 +19541,7 @@ func TestProject_GetOwnerURL(tt *testing.T) { } func TestProject_GetPrivate(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &Project{Private: &zeroValue} p.GetPrivate() @@ -17662,6 +19552,7 @@ func TestProject_GetPrivate(tt *testing.T) { } func TestProject_GetState(tt *testing.T) { + tt.Parallel() var zeroValue string p := &Project{State: &zeroValue} p.GetState() @@ -17672,6 +19563,7 @@ func TestProject_GetState(tt *testing.T) { } func TestProject_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &Project{UpdatedAt: &zeroValue} p.GetUpdatedAt() @@ -17682,6 +19574,7 @@ func TestProject_GetUpdatedAt(tt *testing.T) { } func TestProject_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &Project{URL: &zeroValue} p.GetURL() @@ -17692,6 +19585,7 @@ func TestProject_GetURL(tt *testing.T) { } func TestProjectBody_GetFrom(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectBody{From: &zeroValue} p.GetFrom() @@ -17702,6 +19596,7 @@ func TestProjectBody_GetFrom(tt *testing.T) { } func TestProjectCard_GetArchived(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &ProjectCard{Archived: &zeroValue} p.GetArchived() @@ -17712,6 +19607,7 @@ func TestProjectCard_GetArchived(tt *testing.T) { } func TestProjectCard_GetColumnID(tt *testing.T) { + tt.Parallel() var zeroValue int64 p := &ProjectCard{ColumnID: &zeroValue} p.GetColumnID() @@ -17722,6 +19618,7 @@ func TestProjectCard_GetColumnID(tt *testing.T) { } func TestProjectCard_GetColumnName(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectCard{ColumnName: &zeroValue} p.GetColumnName() @@ -17732,6 +19629,7 @@ func TestProjectCard_GetColumnName(tt *testing.T) { } func TestProjectCard_GetColumnURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectCard{ColumnURL: &zeroValue} p.GetColumnURL() @@ -17742,6 +19640,7 @@ func TestProjectCard_GetColumnURL(tt *testing.T) { } func TestProjectCard_GetContentURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectCard{ContentURL: &zeroValue} p.GetContentURL() @@ -17752,6 +19651,7 @@ func TestProjectCard_GetContentURL(tt *testing.T) { } func TestProjectCard_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &ProjectCard{CreatedAt: &zeroValue} p.GetCreatedAt() @@ -17762,6 +19662,7 @@ func TestProjectCard_GetCreatedAt(tt *testing.T) { } func TestProjectCard_GetCreator(tt *testing.T) { + tt.Parallel() p := &ProjectCard{} p.GetCreator() p = nil @@ -17769,6 +19670,7 @@ func TestProjectCard_GetCreator(tt *testing.T) { } func TestProjectCard_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 p := &ProjectCard{ID: &zeroValue} p.GetID() @@ -17779,6 +19681,7 @@ func TestProjectCard_GetID(tt *testing.T) { } func TestProjectCard_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectCard{NodeID: &zeroValue} p.GetNodeID() @@ -17789,6 +19692,7 @@ func TestProjectCard_GetNodeID(tt *testing.T) { } func TestProjectCard_GetNote(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectCard{Note: &zeroValue} p.GetNote() @@ -17799,6 +19703,7 @@ func TestProjectCard_GetNote(tt *testing.T) { } func TestProjectCard_GetPreviousColumnName(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectCard{PreviousColumnName: &zeroValue} p.GetPreviousColumnName() @@ -17809,6 +19714,7 @@ func TestProjectCard_GetPreviousColumnName(tt *testing.T) { } func TestProjectCard_GetProjectID(tt *testing.T) { + tt.Parallel() var zeroValue int64 p := &ProjectCard{ProjectID: &zeroValue} p.GetProjectID() @@ -17819,6 +19725,7 @@ func TestProjectCard_GetProjectID(tt *testing.T) { } func TestProjectCard_GetProjectURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectCard{ProjectURL: &zeroValue} p.GetProjectURL() @@ -17829,6 +19736,7 @@ func TestProjectCard_GetProjectURL(tt *testing.T) { } func TestProjectCard_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &ProjectCard{UpdatedAt: &zeroValue} p.GetUpdatedAt() @@ -17839,6 +19747,7 @@ func TestProjectCard_GetUpdatedAt(tt *testing.T) { } func TestProjectCard_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectCard{URL: &zeroValue} p.GetURL() @@ -17849,6 +19758,7 @@ func TestProjectCard_GetURL(tt *testing.T) { } func TestProjectCardChange_GetNote(tt *testing.T) { + tt.Parallel() p := &ProjectCardChange{} p.GetNote() p = nil @@ -17856,6 +19766,7 @@ func TestProjectCardChange_GetNote(tt *testing.T) { } func TestProjectCardEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectCardEvent{Action: &zeroValue} p.GetAction() @@ -17866,6 +19777,7 @@ func TestProjectCardEvent_GetAction(tt *testing.T) { } func TestProjectCardEvent_GetAfterID(tt *testing.T) { + tt.Parallel() var zeroValue int64 p := &ProjectCardEvent{AfterID: &zeroValue} p.GetAfterID() @@ -17876,6 +19788,7 @@ func TestProjectCardEvent_GetAfterID(tt *testing.T) { } func TestProjectCardEvent_GetChanges(tt *testing.T) { + tt.Parallel() p := &ProjectCardEvent{} p.GetChanges() p = nil @@ -17883,6 +19796,7 @@ func TestProjectCardEvent_GetChanges(tt *testing.T) { } func TestProjectCardEvent_GetInstallation(tt *testing.T) { + tt.Parallel() p := &ProjectCardEvent{} p.GetInstallation() p = nil @@ -17890,6 +19804,7 @@ func TestProjectCardEvent_GetInstallation(tt *testing.T) { } func TestProjectCardEvent_GetOrg(tt *testing.T) { + tt.Parallel() p := &ProjectCardEvent{} p.GetOrg() p = nil @@ -17897,6 +19812,7 @@ func TestProjectCardEvent_GetOrg(tt *testing.T) { } func TestProjectCardEvent_GetProjectCard(tt *testing.T) { + tt.Parallel() p := &ProjectCardEvent{} p.GetProjectCard() p = nil @@ -17904,6 +19820,7 @@ func TestProjectCardEvent_GetProjectCard(tt *testing.T) { } func TestProjectCardEvent_GetRepo(tt *testing.T) { + tt.Parallel() p := &ProjectCardEvent{} p.GetRepo() p = nil @@ -17911,6 +19828,7 @@ func TestProjectCardEvent_GetRepo(tt *testing.T) { } func TestProjectCardEvent_GetSender(tt *testing.T) { + tt.Parallel() p := &ProjectCardEvent{} p.GetSender() p = nil @@ -17918,6 +19836,7 @@ func TestProjectCardEvent_GetSender(tt *testing.T) { } func TestProjectCardListOptions_GetArchivedState(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectCardListOptions{ArchivedState: &zeroValue} p.GetArchivedState() @@ -17928,6 +19847,7 @@ func TestProjectCardListOptions_GetArchivedState(tt *testing.T) { } func TestProjectCardNote_GetFrom(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectCardNote{From: &zeroValue} p.GetFrom() @@ -17938,6 +19858,7 @@ func TestProjectCardNote_GetFrom(tt *testing.T) { } func TestProjectCardOptions_GetArchived(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &ProjectCardOptions{Archived: &zeroValue} p.GetArchived() @@ -17948,6 +19869,7 @@ func TestProjectCardOptions_GetArchived(tt *testing.T) { } func TestProjectChange_GetBody(tt *testing.T) { + tt.Parallel() p := &ProjectChange{} p.GetBody() p = nil @@ -17955,6 +19877,7 @@ func TestProjectChange_GetBody(tt *testing.T) { } func TestProjectChange_GetName(tt *testing.T) { + tt.Parallel() p := &ProjectChange{} p.GetName() p = nil @@ -17962,6 +19885,7 @@ func TestProjectChange_GetName(tt *testing.T) { } func TestProjectCollaboratorOptions_GetPermission(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectCollaboratorOptions{Permission: &zeroValue} p.GetPermission() @@ -17972,6 +19896,7 @@ func TestProjectCollaboratorOptions_GetPermission(tt *testing.T) { } func TestProjectColumn_GetCardsURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectColumn{CardsURL: &zeroValue} p.GetCardsURL() @@ -17982,6 +19907,7 @@ func TestProjectColumn_GetCardsURL(tt *testing.T) { } func TestProjectColumn_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &ProjectColumn{CreatedAt: &zeroValue} p.GetCreatedAt() @@ -17992,6 +19918,7 @@ func TestProjectColumn_GetCreatedAt(tt *testing.T) { } func TestProjectColumn_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 p := &ProjectColumn{ID: &zeroValue} p.GetID() @@ -18002,6 +19929,7 @@ func TestProjectColumn_GetID(tt *testing.T) { } func TestProjectColumn_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectColumn{Name: &zeroValue} p.GetName() @@ -18012,6 +19940,7 @@ func TestProjectColumn_GetName(tt *testing.T) { } func TestProjectColumn_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectColumn{NodeID: &zeroValue} p.GetNodeID() @@ -18022,6 +19951,7 @@ func TestProjectColumn_GetNodeID(tt *testing.T) { } func TestProjectColumn_GetProjectURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectColumn{ProjectURL: &zeroValue} p.GetProjectURL() @@ -18032,6 +19962,7 @@ func TestProjectColumn_GetProjectURL(tt *testing.T) { } func TestProjectColumn_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &ProjectColumn{UpdatedAt: &zeroValue} p.GetUpdatedAt() @@ -18042,6 +19973,7 @@ func TestProjectColumn_GetUpdatedAt(tt *testing.T) { } func TestProjectColumn_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectColumn{URL: &zeroValue} p.GetURL() @@ -18052,6 +19984,7 @@ func TestProjectColumn_GetURL(tt *testing.T) { } func TestProjectColumnChange_GetName(tt *testing.T) { + tt.Parallel() p := &ProjectColumnChange{} p.GetName() p = nil @@ -18059,6 +19992,7 @@ func TestProjectColumnChange_GetName(tt *testing.T) { } func TestProjectColumnEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectColumnEvent{Action: &zeroValue} p.GetAction() @@ -18069,6 +20003,7 @@ func TestProjectColumnEvent_GetAction(tt *testing.T) { } func TestProjectColumnEvent_GetAfterID(tt *testing.T) { + tt.Parallel() var zeroValue int64 p := &ProjectColumnEvent{AfterID: &zeroValue} p.GetAfterID() @@ -18079,6 +20014,7 @@ func TestProjectColumnEvent_GetAfterID(tt *testing.T) { } func TestProjectColumnEvent_GetChanges(tt *testing.T) { + tt.Parallel() p := &ProjectColumnEvent{} p.GetChanges() p = nil @@ -18086,6 +20022,7 @@ func TestProjectColumnEvent_GetChanges(tt *testing.T) { } func TestProjectColumnEvent_GetInstallation(tt *testing.T) { + tt.Parallel() p := &ProjectColumnEvent{} p.GetInstallation() p = nil @@ -18093,6 +20030,7 @@ func TestProjectColumnEvent_GetInstallation(tt *testing.T) { } func TestProjectColumnEvent_GetOrg(tt *testing.T) { + tt.Parallel() p := &ProjectColumnEvent{} p.GetOrg() p = nil @@ -18100,6 +20038,7 @@ func TestProjectColumnEvent_GetOrg(tt *testing.T) { } func TestProjectColumnEvent_GetProjectColumn(tt *testing.T) { + tt.Parallel() p := &ProjectColumnEvent{} p.GetProjectColumn() p = nil @@ -18107,6 +20046,7 @@ func TestProjectColumnEvent_GetProjectColumn(tt *testing.T) { } func TestProjectColumnEvent_GetRepo(tt *testing.T) { + tt.Parallel() p := &ProjectColumnEvent{} p.GetRepo() p = nil @@ -18114,6 +20054,7 @@ func TestProjectColumnEvent_GetRepo(tt *testing.T) { } func TestProjectColumnEvent_GetSender(tt *testing.T) { + tt.Parallel() p := &ProjectColumnEvent{} p.GetSender() p = nil @@ -18121,6 +20062,7 @@ func TestProjectColumnEvent_GetSender(tt *testing.T) { } func TestProjectColumnName_GetFrom(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectColumnName{From: &zeroValue} p.GetFrom() @@ -18131,6 +20073,7 @@ func TestProjectColumnName_GetFrom(tt *testing.T) { } func TestProjectEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectEvent{Action: &zeroValue} p.GetAction() @@ -18141,6 +20084,7 @@ func TestProjectEvent_GetAction(tt *testing.T) { } func TestProjectEvent_GetChanges(tt *testing.T) { + tt.Parallel() p := &ProjectEvent{} p.GetChanges() p = nil @@ -18148,6 +20092,7 @@ func TestProjectEvent_GetChanges(tt *testing.T) { } func TestProjectEvent_GetInstallation(tt *testing.T) { + tt.Parallel() p := &ProjectEvent{} p.GetInstallation() p = nil @@ -18155,6 +20100,7 @@ func TestProjectEvent_GetInstallation(tt *testing.T) { } func TestProjectEvent_GetOrg(tt *testing.T) { + tt.Parallel() p := &ProjectEvent{} p.GetOrg() p = nil @@ -18162,6 +20108,7 @@ func TestProjectEvent_GetOrg(tt *testing.T) { } func TestProjectEvent_GetProject(tt *testing.T) { + tt.Parallel() p := &ProjectEvent{} p.GetProject() p = nil @@ -18169,6 +20116,7 @@ func TestProjectEvent_GetProject(tt *testing.T) { } func TestProjectEvent_GetRepo(tt *testing.T) { + tt.Parallel() p := &ProjectEvent{} p.GetRepo() p = nil @@ -18176,6 +20124,7 @@ func TestProjectEvent_GetRepo(tt *testing.T) { } func TestProjectEvent_GetSender(tt *testing.T) { + tt.Parallel() p := &ProjectEvent{} p.GetSender() p = nil @@ -18183,6 +20132,7 @@ func TestProjectEvent_GetSender(tt *testing.T) { } func TestProjectName_GetFrom(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectName{From: &zeroValue} p.GetFrom() @@ -18193,6 +20143,7 @@ func TestProjectName_GetFrom(tt *testing.T) { } func TestProjectOptions_GetBody(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectOptions{Body: &zeroValue} p.GetBody() @@ -18203,6 +20154,7 @@ func TestProjectOptions_GetBody(tt *testing.T) { } func TestProjectOptions_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectOptions{Name: &zeroValue} p.GetName() @@ -18213,6 +20165,7 @@ func TestProjectOptions_GetName(tt *testing.T) { } func TestProjectOptions_GetOrganizationPermission(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectOptions{OrganizationPermission: &zeroValue} p.GetOrganizationPermission() @@ -18223,6 +20176,7 @@ func TestProjectOptions_GetOrganizationPermission(tt *testing.T) { } func TestProjectOptions_GetPrivate(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &ProjectOptions{Private: &zeroValue} p.GetPrivate() @@ -18233,6 +20187,7 @@ func TestProjectOptions_GetPrivate(tt *testing.T) { } func TestProjectOptions_GetState(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectOptions{State: &zeroValue} p.GetState() @@ -18243,6 +20198,7 @@ func TestProjectOptions_GetState(tt *testing.T) { } func TestProjectPermissionLevel_GetPermission(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectPermissionLevel{Permission: &zeroValue} p.GetPermission() @@ -18253,6 +20209,7 @@ func TestProjectPermissionLevel_GetPermission(tt *testing.T) { } func TestProjectPermissionLevel_GetUser(tt *testing.T) { + tt.Parallel() p := &ProjectPermissionLevel{} p.GetUser() p = nil @@ -18260,6 +20217,7 @@ func TestProjectPermissionLevel_GetUser(tt *testing.T) { } func TestProjectsV2_GetClosedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &ProjectsV2{ClosedAt: &zeroValue} p.GetClosedAt() @@ -18270,6 +20228,7 @@ func TestProjectsV2_GetClosedAt(tt *testing.T) { } func TestProjectsV2_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &ProjectsV2{CreatedAt: &zeroValue} p.GetCreatedAt() @@ -18280,6 +20239,7 @@ func TestProjectsV2_GetCreatedAt(tt *testing.T) { } func TestProjectsV2_GetCreator(tt *testing.T) { + tt.Parallel() p := &ProjectsV2{} p.GetCreator() p = nil @@ -18287,6 +20247,7 @@ func TestProjectsV2_GetCreator(tt *testing.T) { } func TestProjectsV2_GetDeletedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &ProjectsV2{DeletedAt: &zeroValue} p.GetDeletedAt() @@ -18297,6 +20258,7 @@ func TestProjectsV2_GetDeletedAt(tt *testing.T) { } func TestProjectsV2_GetDeletedBy(tt *testing.T) { + tt.Parallel() p := &ProjectsV2{} p.GetDeletedBy() p = nil @@ -18304,6 +20266,7 @@ func TestProjectsV2_GetDeletedBy(tt *testing.T) { } func TestProjectsV2_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectsV2{Description: &zeroValue} p.GetDescription() @@ -18314,6 +20277,7 @@ func TestProjectsV2_GetDescription(tt *testing.T) { } func TestProjectsV2_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 p := &ProjectsV2{ID: &zeroValue} p.GetID() @@ -18324,6 +20288,7 @@ func TestProjectsV2_GetID(tt *testing.T) { } func TestProjectsV2_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectsV2{NodeID: &zeroValue} p.GetNodeID() @@ -18334,6 +20299,7 @@ func TestProjectsV2_GetNodeID(tt *testing.T) { } func TestProjectsV2_GetNumber(tt *testing.T) { + tt.Parallel() var zeroValue int p := &ProjectsV2{Number: &zeroValue} p.GetNumber() @@ -18344,6 +20310,7 @@ func TestProjectsV2_GetNumber(tt *testing.T) { } func TestProjectsV2_GetOwner(tt *testing.T) { + tt.Parallel() p := &ProjectsV2{} p.GetOwner() p = nil @@ -18351,6 +20318,7 @@ func TestProjectsV2_GetOwner(tt *testing.T) { } func TestProjectsV2_GetPublic(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &ProjectsV2{Public: &zeroValue} p.GetPublic() @@ -18361,6 +20329,7 @@ func TestProjectsV2_GetPublic(tt *testing.T) { } func TestProjectsV2_GetShortDescription(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectsV2{ShortDescription: &zeroValue} p.GetShortDescription() @@ -18371,6 +20340,7 @@ func TestProjectsV2_GetShortDescription(tt *testing.T) { } func TestProjectsV2_GetTitle(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectsV2{Title: &zeroValue} p.GetTitle() @@ -18381,6 +20351,7 @@ func TestProjectsV2_GetTitle(tt *testing.T) { } func TestProjectsV2_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &ProjectsV2{UpdatedAt: &zeroValue} p.GetUpdatedAt() @@ -18391,6 +20362,7 @@ func TestProjectsV2_GetUpdatedAt(tt *testing.T) { } func TestProjectV2Event_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectV2Event{Action: &zeroValue} p.GetAction() @@ -18401,6 +20373,7 @@ func TestProjectV2Event_GetAction(tt *testing.T) { } func TestProjectV2Event_GetInstallation(tt *testing.T) { + tt.Parallel() p := &ProjectV2Event{} p.GetInstallation() p = nil @@ -18408,6 +20381,7 @@ func TestProjectV2Event_GetInstallation(tt *testing.T) { } func TestProjectV2Event_GetOrg(tt *testing.T) { + tt.Parallel() p := &ProjectV2Event{} p.GetOrg() p = nil @@ -18415,6 +20389,7 @@ func TestProjectV2Event_GetOrg(tt *testing.T) { } func TestProjectV2Event_GetProjectsV2(tt *testing.T) { + tt.Parallel() p := &ProjectV2Event{} p.GetProjectsV2() p = nil @@ -18422,6 +20397,7 @@ func TestProjectV2Event_GetProjectsV2(tt *testing.T) { } func TestProjectV2Event_GetSender(tt *testing.T) { + tt.Parallel() p := &ProjectV2Event{} p.GetSender() p = nil @@ -18429,6 +20405,7 @@ func TestProjectV2Event_GetSender(tt *testing.T) { } func TestProjectV2Item_GetArchivedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &ProjectV2Item{ArchivedAt: &zeroValue} p.GetArchivedAt() @@ -18439,6 +20416,7 @@ func TestProjectV2Item_GetArchivedAt(tt *testing.T) { } func TestProjectV2Item_GetContentNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectV2Item{ContentNodeID: &zeroValue} p.GetContentNodeID() @@ -18449,6 +20427,7 @@ func TestProjectV2Item_GetContentNodeID(tt *testing.T) { } func TestProjectV2Item_GetContentType(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectV2Item{ContentType: &zeroValue} p.GetContentType() @@ -18459,6 +20438,7 @@ func TestProjectV2Item_GetContentType(tt *testing.T) { } func TestProjectV2Item_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &ProjectV2Item{CreatedAt: &zeroValue} p.GetCreatedAt() @@ -18469,6 +20449,7 @@ func TestProjectV2Item_GetCreatedAt(tt *testing.T) { } func TestProjectV2Item_GetCreator(tt *testing.T) { + tt.Parallel() p := &ProjectV2Item{} p.GetCreator() p = nil @@ -18476,6 +20457,7 @@ func TestProjectV2Item_GetCreator(tt *testing.T) { } func TestProjectV2Item_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 p := &ProjectV2Item{ID: &zeroValue} p.GetID() @@ -18486,6 +20468,7 @@ func TestProjectV2Item_GetID(tt *testing.T) { } func TestProjectV2Item_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectV2Item{NodeID: &zeroValue} p.GetNodeID() @@ -18496,6 +20479,7 @@ func TestProjectV2Item_GetNodeID(tt *testing.T) { } func TestProjectV2Item_GetProjectNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectV2Item{ProjectNodeID: &zeroValue} p.GetProjectNodeID() @@ -18506,6 +20490,7 @@ func TestProjectV2Item_GetProjectNodeID(tt *testing.T) { } func TestProjectV2Item_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &ProjectV2Item{UpdatedAt: &zeroValue} p.GetUpdatedAt() @@ -18516,6 +20501,7 @@ func TestProjectV2Item_GetUpdatedAt(tt *testing.T) { } func TestProjectV2ItemChange_GetArchivedAt(tt *testing.T) { + tt.Parallel() p := &ProjectV2ItemChange{} p.GetArchivedAt() p = nil @@ -18523,6 +20509,7 @@ func TestProjectV2ItemChange_GetArchivedAt(tt *testing.T) { } func TestProjectV2ItemEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProjectV2ItemEvent{Action: &zeroValue} p.GetAction() @@ -18533,6 +20520,7 @@ func TestProjectV2ItemEvent_GetAction(tt *testing.T) { } func TestProjectV2ItemEvent_GetChanges(tt *testing.T) { + tt.Parallel() p := &ProjectV2ItemEvent{} p.GetChanges() p = nil @@ -18540,6 +20528,7 @@ func TestProjectV2ItemEvent_GetChanges(tt *testing.T) { } func TestProjectV2ItemEvent_GetInstallation(tt *testing.T) { + tt.Parallel() p := &ProjectV2ItemEvent{} p.GetInstallation() p = nil @@ -18547,6 +20536,7 @@ func TestProjectV2ItemEvent_GetInstallation(tt *testing.T) { } func TestProjectV2ItemEvent_GetOrg(tt *testing.T) { + tt.Parallel() p := &ProjectV2ItemEvent{} p.GetOrg() p = nil @@ -18554,6 +20544,7 @@ func TestProjectV2ItemEvent_GetOrg(tt *testing.T) { } func TestProjectV2ItemEvent_GetProjectV2Item(tt *testing.T) { + tt.Parallel() p := &ProjectV2ItemEvent{} p.GetProjectV2Item() p = nil @@ -18561,6 +20552,7 @@ func TestProjectV2ItemEvent_GetProjectV2Item(tt *testing.T) { } func TestProjectV2ItemEvent_GetSender(tt *testing.T) { + tt.Parallel() p := &ProjectV2ItemEvent{} p.GetSender() p = nil @@ -18568,6 +20560,7 @@ func TestProjectV2ItemEvent_GetSender(tt *testing.T) { } func TestProtection_GetAllowDeletions(tt *testing.T) { + tt.Parallel() p := &Protection{} p.GetAllowDeletions() p = nil @@ -18575,6 +20568,7 @@ func TestProtection_GetAllowDeletions(tt *testing.T) { } func TestProtection_GetAllowForcePushes(tt *testing.T) { + tt.Parallel() p := &Protection{} p.GetAllowForcePushes() p = nil @@ -18582,6 +20576,7 @@ func TestProtection_GetAllowForcePushes(tt *testing.T) { } func TestProtection_GetAllowForkSyncing(tt *testing.T) { + tt.Parallel() p := &Protection{} p.GetAllowForkSyncing() p = nil @@ -18589,6 +20584,7 @@ func TestProtection_GetAllowForkSyncing(tt *testing.T) { } func TestProtection_GetBlockCreations(tt *testing.T) { + tt.Parallel() p := &Protection{} p.GetBlockCreations() p = nil @@ -18596,6 +20592,7 @@ func TestProtection_GetBlockCreations(tt *testing.T) { } func TestProtection_GetEnforceAdmins(tt *testing.T) { + tt.Parallel() p := &Protection{} p.GetEnforceAdmins() p = nil @@ -18603,6 +20600,7 @@ func TestProtection_GetEnforceAdmins(tt *testing.T) { } func TestProtection_GetLockBranch(tt *testing.T) { + tt.Parallel() p := &Protection{} p.GetLockBranch() p = nil @@ -18610,6 +20608,7 @@ func TestProtection_GetLockBranch(tt *testing.T) { } func TestProtection_GetRequiredConversationResolution(tt *testing.T) { + tt.Parallel() p := &Protection{} p.GetRequiredConversationResolution() p = nil @@ -18617,6 +20616,7 @@ func TestProtection_GetRequiredConversationResolution(tt *testing.T) { } func TestProtection_GetRequiredPullRequestReviews(tt *testing.T) { + tt.Parallel() p := &Protection{} p.GetRequiredPullRequestReviews() p = nil @@ -18624,6 +20624,7 @@ func TestProtection_GetRequiredPullRequestReviews(tt *testing.T) { } func TestProtection_GetRequiredSignatures(tt *testing.T) { + tt.Parallel() p := &Protection{} p.GetRequiredSignatures() p = nil @@ -18631,6 +20632,7 @@ func TestProtection_GetRequiredSignatures(tt *testing.T) { } func TestProtection_GetRequiredStatusChecks(tt *testing.T) { + tt.Parallel() p := &Protection{} p.GetRequiredStatusChecks() p = nil @@ -18638,6 +20640,7 @@ func TestProtection_GetRequiredStatusChecks(tt *testing.T) { } func TestProtection_GetRequireLinearHistory(tt *testing.T) { + tt.Parallel() p := &Protection{} p.GetRequireLinearHistory() p = nil @@ -18645,6 +20648,7 @@ func TestProtection_GetRequireLinearHistory(tt *testing.T) { } func TestProtection_GetRestrictions(tt *testing.T) { + tt.Parallel() p := &Protection{} p.GetRestrictions() p = nil @@ -18652,6 +20656,7 @@ func TestProtection_GetRestrictions(tt *testing.T) { } func TestProtection_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &Protection{URL: &zeroValue} p.GetURL() @@ -18662,6 +20667,7 @@ func TestProtection_GetURL(tt *testing.T) { } func TestProtectionChanges_GetAdminEnforced(tt *testing.T) { + tt.Parallel() p := &ProtectionChanges{} p.GetAdminEnforced() p = nil @@ -18669,6 +20675,7 @@ func TestProtectionChanges_GetAdminEnforced(tt *testing.T) { } func TestProtectionChanges_GetAllowDeletionsEnforcementLevel(tt *testing.T) { + tt.Parallel() p := &ProtectionChanges{} p.GetAllowDeletionsEnforcementLevel() p = nil @@ -18676,6 +20683,7 @@ func TestProtectionChanges_GetAllowDeletionsEnforcementLevel(tt *testing.T) { } func TestProtectionChanges_GetAuthorizedActorNames(tt *testing.T) { + tt.Parallel() p := &ProtectionChanges{} p.GetAuthorizedActorNames() p = nil @@ -18683,6 +20691,7 @@ func TestProtectionChanges_GetAuthorizedActorNames(tt *testing.T) { } func TestProtectionChanges_GetAuthorizedActorsOnly(tt *testing.T) { + tt.Parallel() p := &ProtectionChanges{} p.GetAuthorizedActorsOnly() p = nil @@ -18690,6 +20699,7 @@ func TestProtectionChanges_GetAuthorizedActorsOnly(tt *testing.T) { } func TestProtectionChanges_GetAuthorizedDismissalActorsOnly(tt *testing.T) { + tt.Parallel() p := &ProtectionChanges{} p.GetAuthorizedDismissalActorsOnly() p = nil @@ -18697,6 +20707,7 @@ func TestProtectionChanges_GetAuthorizedDismissalActorsOnly(tt *testing.T) { } func TestProtectionChanges_GetCreateProtected(tt *testing.T) { + tt.Parallel() p := &ProtectionChanges{} p.GetCreateProtected() p = nil @@ -18704,6 +20715,7 @@ func TestProtectionChanges_GetCreateProtected(tt *testing.T) { } func TestProtectionChanges_GetDismissStaleReviewsOnPush(tt *testing.T) { + tt.Parallel() p := &ProtectionChanges{} p.GetDismissStaleReviewsOnPush() p = nil @@ -18711,6 +20723,7 @@ func TestProtectionChanges_GetDismissStaleReviewsOnPush(tt *testing.T) { } func TestProtectionChanges_GetLinearHistoryRequirementEnforcementLevel(tt *testing.T) { + tt.Parallel() p := &ProtectionChanges{} p.GetLinearHistoryRequirementEnforcementLevel() p = nil @@ -18718,6 +20731,7 @@ func TestProtectionChanges_GetLinearHistoryRequirementEnforcementLevel(tt *testi } func TestProtectionChanges_GetPullRequestReviewsEnforcementLevel(tt *testing.T) { + tt.Parallel() p := &ProtectionChanges{} p.GetPullRequestReviewsEnforcementLevel() p = nil @@ -18725,6 +20739,7 @@ func TestProtectionChanges_GetPullRequestReviewsEnforcementLevel(tt *testing.T) } func TestProtectionChanges_GetRequireCodeOwnerReview(tt *testing.T) { + tt.Parallel() p := &ProtectionChanges{} p.GetRequireCodeOwnerReview() p = nil @@ -18732,6 +20747,7 @@ func TestProtectionChanges_GetRequireCodeOwnerReview(tt *testing.T) { } func TestProtectionChanges_GetRequiredConversationResolutionLevel(tt *testing.T) { + tt.Parallel() p := &ProtectionChanges{} p.GetRequiredConversationResolutionLevel() p = nil @@ -18739,6 +20755,7 @@ func TestProtectionChanges_GetRequiredConversationResolutionLevel(tt *testing.T) } func TestProtectionChanges_GetRequiredDeploymentsEnforcementLevel(tt *testing.T) { + tt.Parallel() p := &ProtectionChanges{} p.GetRequiredDeploymentsEnforcementLevel() p = nil @@ -18746,6 +20763,7 @@ func TestProtectionChanges_GetRequiredDeploymentsEnforcementLevel(tt *testing.T) } func TestProtectionChanges_GetRequiredStatusChecks(tt *testing.T) { + tt.Parallel() p := &ProtectionChanges{} p.GetRequiredStatusChecks() p = nil @@ -18753,6 +20771,7 @@ func TestProtectionChanges_GetRequiredStatusChecks(tt *testing.T) { } func TestProtectionChanges_GetRequiredStatusChecksEnforcementLevel(tt *testing.T) { + tt.Parallel() p := &ProtectionChanges{} p.GetRequiredStatusChecksEnforcementLevel() p = nil @@ -18760,6 +20779,7 @@ func TestProtectionChanges_GetRequiredStatusChecksEnforcementLevel(tt *testing.T } func TestProtectionChanges_GetSignatureRequirementEnforcementLevel(tt *testing.T) { + tt.Parallel() p := &ProtectionChanges{} p.GetSignatureRequirementEnforcementLevel() p = nil @@ -18767,6 +20787,7 @@ func TestProtectionChanges_GetSignatureRequirementEnforcementLevel(tt *testing.T } func TestProtectionRequest_GetAllowDeletions(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &ProtectionRequest{AllowDeletions: &zeroValue} p.GetAllowDeletions() @@ -18777,6 +20798,7 @@ func TestProtectionRequest_GetAllowDeletions(tt *testing.T) { } func TestProtectionRequest_GetAllowForcePushes(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &ProtectionRequest{AllowForcePushes: &zeroValue} p.GetAllowForcePushes() @@ -18787,6 +20809,7 @@ func TestProtectionRequest_GetAllowForcePushes(tt *testing.T) { } func TestProtectionRequest_GetAllowForkSyncing(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &ProtectionRequest{AllowForkSyncing: &zeroValue} p.GetAllowForkSyncing() @@ -18797,6 +20820,7 @@ func TestProtectionRequest_GetAllowForkSyncing(tt *testing.T) { } func TestProtectionRequest_GetBlockCreations(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &ProtectionRequest{BlockCreations: &zeroValue} p.GetBlockCreations() @@ -18807,6 +20831,7 @@ func TestProtectionRequest_GetBlockCreations(tt *testing.T) { } func TestProtectionRequest_GetLockBranch(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &ProtectionRequest{LockBranch: &zeroValue} p.GetLockBranch() @@ -18817,6 +20842,7 @@ func TestProtectionRequest_GetLockBranch(tt *testing.T) { } func TestProtectionRequest_GetRequiredConversationResolution(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &ProtectionRequest{RequiredConversationResolution: &zeroValue} p.GetRequiredConversationResolution() @@ -18827,6 +20853,7 @@ func TestProtectionRequest_GetRequiredConversationResolution(tt *testing.T) { } func TestProtectionRequest_GetRequiredPullRequestReviews(tt *testing.T) { + tt.Parallel() p := &ProtectionRequest{} p.GetRequiredPullRequestReviews() p = nil @@ -18834,6 +20861,7 @@ func TestProtectionRequest_GetRequiredPullRequestReviews(tt *testing.T) { } func TestProtectionRequest_GetRequiredStatusChecks(tt *testing.T) { + tt.Parallel() p := &ProtectionRequest{} p.GetRequiredStatusChecks() p = nil @@ -18841,6 +20869,7 @@ func TestProtectionRequest_GetRequiredStatusChecks(tt *testing.T) { } func TestProtectionRequest_GetRequireLinearHistory(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &ProtectionRequest{RequireLinearHistory: &zeroValue} p.GetRequireLinearHistory() @@ -18851,6 +20880,7 @@ func TestProtectionRequest_GetRequireLinearHistory(tt *testing.T) { } func TestProtectionRequest_GetRestrictions(tt *testing.T) { + tt.Parallel() p := &ProtectionRequest{} p.GetRestrictions() p = nil @@ -18858,6 +20888,7 @@ func TestProtectionRequest_GetRestrictions(tt *testing.T) { } func TestProtectionRule_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 p := &ProtectionRule{ID: &zeroValue} p.GetID() @@ -18868,6 +20899,7 @@ func TestProtectionRule_GetID(tt *testing.T) { } func TestProtectionRule_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProtectionRule{NodeID: &zeroValue} p.GetNodeID() @@ -18878,6 +20910,7 @@ func TestProtectionRule_GetNodeID(tt *testing.T) { } func TestProtectionRule_GetPreventSelfReview(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &ProtectionRule{PreventSelfReview: &zeroValue} p.GetPreventSelfReview() @@ -18888,6 +20921,7 @@ func TestProtectionRule_GetPreventSelfReview(tt *testing.T) { } func TestProtectionRule_GetType(tt *testing.T) { + tt.Parallel() var zeroValue string p := &ProtectionRule{Type: &zeroValue} p.GetType() @@ -18898,6 +20932,7 @@ func TestProtectionRule_GetType(tt *testing.T) { } func TestProtectionRule_GetWaitTimer(tt *testing.T) { + tt.Parallel() var zeroValue int p := &ProtectionRule{WaitTimer: &zeroValue} p.GetWaitTimer() @@ -18908,6 +20943,7 @@ func TestProtectionRule_GetWaitTimer(tt *testing.T) { } func TestPublicEvent_GetInstallation(tt *testing.T) { + tt.Parallel() p := &PublicEvent{} p.GetInstallation() p = nil @@ -18915,6 +20951,7 @@ func TestPublicEvent_GetInstallation(tt *testing.T) { } func TestPublicEvent_GetOrg(tt *testing.T) { + tt.Parallel() p := &PublicEvent{} p.GetOrg() p = nil @@ -18922,6 +20959,7 @@ func TestPublicEvent_GetOrg(tt *testing.T) { } func TestPublicEvent_GetRepo(tt *testing.T) { + tt.Parallel() p := &PublicEvent{} p.GetRepo() p = nil @@ -18929,6 +20967,7 @@ func TestPublicEvent_GetRepo(tt *testing.T) { } func TestPublicEvent_GetSender(tt *testing.T) { + tt.Parallel() p := &PublicEvent{} p.GetSender() p = nil @@ -18936,6 +20975,7 @@ func TestPublicEvent_GetSender(tt *testing.T) { } func TestPublicKey_GetKey(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PublicKey{Key: &zeroValue} p.GetKey() @@ -18946,6 +20986,7 @@ func TestPublicKey_GetKey(tt *testing.T) { } func TestPublicKey_GetKeyID(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PublicKey{KeyID: &zeroValue} p.GetKeyID() @@ -18956,6 +20997,7 @@ func TestPublicKey_GetKeyID(tt *testing.T) { } func TestPullRequest_GetActiveLockReason(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequest{ActiveLockReason: &zeroValue} p.GetActiveLockReason() @@ -18966,6 +21008,7 @@ func TestPullRequest_GetActiveLockReason(tt *testing.T) { } func TestPullRequest_GetAdditions(tt *testing.T) { + tt.Parallel() var zeroValue int p := &PullRequest{Additions: &zeroValue} p.GetAdditions() @@ -18976,6 +21019,7 @@ func TestPullRequest_GetAdditions(tt *testing.T) { } func TestPullRequest_GetAssignee(tt *testing.T) { + tt.Parallel() p := &PullRequest{} p.GetAssignee() p = nil @@ -18983,6 +21027,7 @@ func TestPullRequest_GetAssignee(tt *testing.T) { } func TestPullRequest_GetAuthorAssociation(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequest{AuthorAssociation: &zeroValue} p.GetAuthorAssociation() @@ -18993,6 +21038,7 @@ func TestPullRequest_GetAuthorAssociation(tt *testing.T) { } func TestPullRequest_GetAutoMerge(tt *testing.T) { + tt.Parallel() p := &PullRequest{} p.GetAutoMerge() p = nil @@ -19000,6 +21046,7 @@ func TestPullRequest_GetAutoMerge(tt *testing.T) { } func TestPullRequest_GetBase(tt *testing.T) { + tt.Parallel() p := &PullRequest{} p.GetBase() p = nil @@ -19007,6 +21054,7 @@ func TestPullRequest_GetBase(tt *testing.T) { } func TestPullRequest_GetBody(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequest{Body: &zeroValue} p.GetBody() @@ -19017,6 +21065,7 @@ func TestPullRequest_GetBody(tt *testing.T) { } func TestPullRequest_GetChangedFiles(tt *testing.T) { + tt.Parallel() var zeroValue int p := &PullRequest{ChangedFiles: &zeroValue} p.GetChangedFiles() @@ -19027,6 +21076,7 @@ func TestPullRequest_GetChangedFiles(tt *testing.T) { } func TestPullRequest_GetClosedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &PullRequest{ClosedAt: &zeroValue} p.GetClosedAt() @@ -19037,6 +21087,7 @@ func TestPullRequest_GetClosedAt(tt *testing.T) { } func TestPullRequest_GetComments(tt *testing.T) { + tt.Parallel() var zeroValue int p := &PullRequest{Comments: &zeroValue} p.GetComments() @@ -19047,6 +21098,7 @@ func TestPullRequest_GetComments(tt *testing.T) { } func TestPullRequest_GetCommentsURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequest{CommentsURL: &zeroValue} p.GetCommentsURL() @@ -19057,6 +21109,7 @@ func TestPullRequest_GetCommentsURL(tt *testing.T) { } func TestPullRequest_GetCommits(tt *testing.T) { + tt.Parallel() var zeroValue int p := &PullRequest{Commits: &zeroValue} p.GetCommits() @@ -19067,6 +21120,7 @@ func TestPullRequest_GetCommits(tt *testing.T) { } func TestPullRequest_GetCommitsURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequest{CommitsURL: &zeroValue} p.GetCommitsURL() @@ -19077,6 +21131,7 @@ func TestPullRequest_GetCommitsURL(tt *testing.T) { } func TestPullRequest_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &PullRequest{CreatedAt: &zeroValue} p.GetCreatedAt() @@ -19087,6 +21142,7 @@ func TestPullRequest_GetCreatedAt(tt *testing.T) { } func TestPullRequest_GetDeletions(tt *testing.T) { + tt.Parallel() var zeroValue int p := &PullRequest{Deletions: &zeroValue} p.GetDeletions() @@ -19097,6 +21153,7 @@ func TestPullRequest_GetDeletions(tt *testing.T) { } func TestPullRequest_GetDiffURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequest{DiffURL: &zeroValue} p.GetDiffURL() @@ -19107,6 +21164,7 @@ func TestPullRequest_GetDiffURL(tt *testing.T) { } func TestPullRequest_GetDraft(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PullRequest{Draft: &zeroValue} p.GetDraft() @@ -19117,6 +21175,7 @@ func TestPullRequest_GetDraft(tt *testing.T) { } func TestPullRequest_GetHead(tt *testing.T) { + tt.Parallel() p := &PullRequest{} p.GetHead() p = nil @@ -19124,6 +21183,7 @@ func TestPullRequest_GetHead(tt *testing.T) { } func TestPullRequest_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequest{HTMLURL: &zeroValue} p.GetHTMLURL() @@ -19134,6 +21194,7 @@ func TestPullRequest_GetHTMLURL(tt *testing.T) { } func TestPullRequest_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 p := &PullRequest{ID: &zeroValue} p.GetID() @@ -19144,6 +21205,7 @@ func TestPullRequest_GetID(tt *testing.T) { } func TestPullRequest_GetIssueURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequest{IssueURL: &zeroValue} p.GetIssueURL() @@ -19154,6 +21216,7 @@ func TestPullRequest_GetIssueURL(tt *testing.T) { } func TestPullRequest_GetLinks(tt *testing.T) { + tt.Parallel() p := &PullRequest{} p.GetLinks() p = nil @@ -19161,6 +21224,7 @@ func TestPullRequest_GetLinks(tt *testing.T) { } func TestPullRequest_GetLocked(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PullRequest{Locked: &zeroValue} p.GetLocked() @@ -19171,6 +21235,7 @@ func TestPullRequest_GetLocked(tt *testing.T) { } func TestPullRequest_GetMaintainerCanModify(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PullRequest{MaintainerCanModify: &zeroValue} p.GetMaintainerCanModify() @@ -19181,6 +21246,7 @@ func TestPullRequest_GetMaintainerCanModify(tt *testing.T) { } func TestPullRequest_GetMergeable(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PullRequest{Mergeable: &zeroValue} p.GetMergeable() @@ -19191,6 +21257,7 @@ func TestPullRequest_GetMergeable(tt *testing.T) { } func TestPullRequest_GetMergeableState(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequest{MergeableState: &zeroValue} p.GetMergeableState() @@ -19201,6 +21268,7 @@ func TestPullRequest_GetMergeableState(tt *testing.T) { } func TestPullRequest_GetMergeCommitSHA(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequest{MergeCommitSHA: &zeroValue} p.GetMergeCommitSHA() @@ -19211,6 +21279,7 @@ func TestPullRequest_GetMergeCommitSHA(tt *testing.T) { } func TestPullRequest_GetMerged(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PullRequest{Merged: &zeroValue} p.GetMerged() @@ -19221,6 +21290,7 @@ func TestPullRequest_GetMerged(tt *testing.T) { } func TestPullRequest_GetMergedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &PullRequest{MergedAt: &zeroValue} p.GetMergedAt() @@ -19231,6 +21301,7 @@ func TestPullRequest_GetMergedAt(tt *testing.T) { } func TestPullRequest_GetMergedBy(tt *testing.T) { + tt.Parallel() p := &PullRequest{} p.GetMergedBy() p = nil @@ -19238,6 +21309,7 @@ func TestPullRequest_GetMergedBy(tt *testing.T) { } func TestPullRequest_GetMilestone(tt *testing.T) { + tt.Parallel() p := &PullRequest{} p.GetMilestone() p = nil @@ -19245,6 +21317,7 @@ func TestPullRequest_GetMilestone(tt *testing.T) { } func TestPullRequest_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequest{NodeID: &zeroValue} p.GetNodeID() @@ -19255,6 +21328,7 @@ func TestPullRequest_GetNodeID(tt *testing.T) { } func TestPullRequest_GetNumber(tt *testing.T) { + tt.Parallel() var zeroValue int p := &PullRequest{Number: &zeroValue} p.GetNumber() @@ -19265,6 +21339,7 @@ func TestPullRequest_GetNumber(tt *testing.T) { } func TestPullRequest_GetPatchURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequest{PatchURL: &zeroValue} p.GetPatchURL() @@ -19275,6 +21350,7 @@ func TestPullRequest_GetPatchURL(tt *testing.T) { } func TestPullRequest_GetRebaseable(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PullRequest{Rebaseable: &zeroValue} p.GetRebaseable() @@ -19285,6 +21361,7 @@ func TestPullRequest_GetRebaseable(tt *testing.T) { } func TestPullRequest_GetReviewComments(tt *testing.T) { + tt.Parallel() var zeroValue int p := &PullRequest{ReviewComments: &zeroValue} p.GetReviewComments() @@ -19295,6 +21372,7 @@ func TestPullRequest_GetReviewComments(tt *testing.T) { } func TestPullRequest_GetReviewCommentsURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequest{ReviewCommentsURL: &zeroValue} p.GetReviewCommentsURL() @@ -19305,6 +21383,7 @@ func TestPullRequest_GetReviewCommentsURL(tt *testing.T) { } func TestPullRequest_GetReviewCommentURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequest{ReviewCommentURL: &zeroValue} p.GetReviewCommentURL() @@ -19315,6 +21394,7 @@ func TestPullRequest_GetReviewCommentURL(tt *testing.T) { } func TestPullRequest_GetState(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequest{State: &zeroValue} p.GetState() @@ -19325,6 +21405,7 @@ func TestPullRequest_GetState(tt *testing.T) { } func TestPullRequest_GetStatusesURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequest{StatusesURL: &zeroValue} p.GetStatusesURL() @@ -19335,6 +21416,7 @@ func TestPullRequest_GetStatusesURL(tt *testing.T) { } func TestPullRequest_GetTitle(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequest{Title: &zeroValue} p.GetTitle() @@ -19345,6 +21427,7 @@ func TestPullRequest_GetTitle(tt *testing.T) { } func TestPullRequest_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &PullRequest{UpdatedAt: &zeroValue} p.GetUpdatedAt() @@ -19355,6 +21438,7 @@ func TestPullRequest_GetUpdatedAt(tt *testing.T) { } func TestPullRequest_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequest{URL: &zeroValue} p.GetURL() @@ -19365,6 +21449,7 @@ func TestPullRequest_GetURL(tt *testing.T) { } func TestPullRequest_GetUser(tt *testing.T) { + tt.Parallel() p := &PullRequest{} p.GetUser() p = nil @@ -19372,6 +21457,7 @@ func TestPullRequest_GetUser(tt *testing.T) { } func TestPullRequestAutoMerge_GetCommitMessage(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestAutoMerge{CommitMessage: &zeroValue} p.GetCommitMessage() @@ -19382,6 +21468,7 @@ func TestPullRequestAutoMerge_GetCommitMessage(tt *testing.T) { } func TestPullRequestAutoMerge_GetCommitTitle(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestAutoMerge{CommitTitle: &zeroValue} p.GetCommitTitle() @@ -19392,6 +21479,7 @@ func TestPullRequestAutoMerge_GetCommitTitle(tt *testing.T) { } func TestPullRequestAutoMerge_GetEnabledBy(tt *testing.T) { + tt.Parallel() p := &PullRequestAutoMerge{} p.GetEnabledBy() p = nil @@ -19399,6 +21487,7 @@ func TestPullRequestAutoMerge_GetEnabledBy(tt *testing.T) { } func TestPullRequestAutoMerge_GetMergeMethod(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestAutoMerge{MergeMethod: &zeroValue} p.GetMergeMethod() @@ -19409,6 +21498,7 @@ func TestPullRequestAutoMerge_GetMergeMethod(tt *testing.T) { } func TestPullRequestBranch_GetLabel(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestBranch{Label: &zeroValue} p.GetLabel() @@ -19419,6 +21509,7 @@ func TestPullRequestBranch_GetLabel(tt *testing.T) { } func TestPullRequestBranch_GetRef(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestBranch{Ref: &zeroValue} p.GetRef() @@ -19429,6 +21520,7 @@ func TestPullRequestBranch_GetRef(tt *testing.T) { } func TestPullRequestBranch_GetRepo(tt *testing.T) { + tt.Parallel() p := &PullRequestBranch{} p.GetRepo() p = nil @@ -19436,6 +21528,7 @@ func TestPullRequestBranch_GetRepo(tt *testing.T) { } func TestPullRequestBranch_GetSHA(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestBranch{SHA: &zeroValue} p.GetSHA() @@ -19446,6 +21539,7 @@ func TestPullRequestBranch_GetSHA(tt *testing.T) { } func TestPullRequestBranch_GetUser(tt *testing.T) { + tt.Parallel() p := &PullRequestBranch{} p.GetUser() p = nil @@ -19453,6 +21547,7 @@ func TestPullRequestBranch_GetUser(tt *testing.T) { } func TestPullRequestBranchUpdateOptions_GetExpectedHeadSHA(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestBranchUpdateOptions{ExpectedHeadSHA: &zeroValue} p.GetExpectedHeadSHA() @@ -19463,6 +21558,7 @@ func TestPullRequestBranchUpdateOptions_GetExpectedHeadSHA(tt *testing.T) { } func TestPullRequestBranchUpdateResponse_GetMessage(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestBranchUpdateResponse{Message: &zeroValue} p.GetMessage() @@ -19473,6 +21569,7 @@ func TestPullRequestBranchUpdateResponse_GetMessage(tt *testing.T) { } func TestPullRequestBranchUpdateResponse_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestBranchUpdateResponse{URL: &zeroValue} p.GetURL() @@ -19483,6 +21580,7 @@ func TestPullRequestBranchUpdateResponse_GetURL(tt *testing.T) { } func TestPullRequestComment_GetAuthorAssociation(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestComment{AuthorAssociation: &zeroValue} p.GetAuthorAssociation() @@ -19493,6 +21591,7 @@ func TestPullRequestComment_GetAuthorAssociation(tt *testing.T) { } func TestPullRequestComment_GetBody(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestComment{Body: &zeroValue} p.GetBody() @@ -19503,6 +21602,7 @@ func TestPullRequestComment_GetBody(tt *testing.T) { } func TestPullRequestComment_GetCommitID(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestComment{CommitID: &zeroValue} p.GetCommitID() @@ -19513,6 +21613,7 @@ func TestPullRequestComment_GetCommitID(tt *testing.T) { } func TestPullRequestComment_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &PullRequestComment{CreatedAt: &zeroValue} p.GetCreatedAt() @@ -19523,6 +21624,7 @@ func TestPullRequestComment_GetCreatedAt(tt *testing.T) { } func TestPullRequestComment_GetDiffHunk(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestComment{DiffHunk: &zeroValue} p.GetDiffHunk() @@ -19533,6 +21635,7 @@ func TestPullRequestComment_GetDiffHunk(tt *testing.T) { } func TestPullRequestComment_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestComment{HTMLURL: &zeroValue} p.GetHTMLURL() @@ -19543,6 +21646,7 @@ func TestPullRequestComment_GetHTMLURL(tt *testing.T) { } func TestPullRequestComment_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 p := &PullRequestComment{ID: &zeroValue} p.GetID() @@ -19553,6 +21657,7 @@ func TestPullRequestComment_GetID(tt *testing.T) { } func TestPullRequestComment_GetInReplyTo(tt *testing.T) { + tt.Parallel() var zeroValue int64 p := &PullRequestComment{InReplyTo: &zeroValue} p.GetInReplyTo() @@ -19563,6 +21668,7 @@ func TestPullRequestComment_GetInReplyTo(tt *testing.T) { } func TestPullRequestComment_GetLine(tt *testing.T) { + tt.Parallel() var zeroValue int p := &PullRequestComment{Line: &zeroValue} p.GetLine() @@ -19573,6 +21679,7 @@ func TestPullRequestComment_GetLine(tt *testing.T) { } func TestPullRequestComment_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestComment{NodeID: &zeroValue} p.GetNodeID() @@ -19583,6 +21690,7 @@ func TestPullRequestComment_GetNodeID(tt *testing.T) { } func TestPullRequestComment_GetOriginalCommitID(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestComment{OriginalCommitID: &zeroValue} p.GetOriginalCommitID() @@ -19593,6 +21701,7 @@ func TestPullRequestComment_GetOriginalCommitID(tt *testing.T) { } func TestPullRequestComment_GetOriginalLine(tt *testing.T) { + tt.Parallel() var zeroValue int p := &PullRequestComment{OriginalLine: &zeroValue} p.GetOriginalLine() @@ -19603,6 +21712,7 @@ func TestPullRequestComment_GetOriginalLine(tt *testing.T) { } func TestPullRequestComment_GetOriginalPosition(tt *testing.T) { + tt.Parallel() var zeroValue int p := &PullRequestComment{OriginalPosition: &zeroValue} p.GetOriginalPosition() @@ -19613,6 +21723,7 @@ func TestPullRequestComment_GetOriginalPosition(tt *testing.T) { } func TestPullRequestComment_GetOriginalStartLine(tt *testing.T) { + tt.Parallel() var zeroValue int p := &PullRequestComment{OriginalStartLine: &zeroValue} p.GetOriginalStartLine() @@ -19623,6 +21734,7 @@ func TestPullRequestComment_GetOriginalStartLine(tt *testing.T) { } func TestPullRequestComment_GetPath(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestComment{Path: &zeroValue} p.GetPath() @@ -19633,6 +21745,7 @@ func TestPullRequestComment_GetPath(tt *testing.T) { } func TestPullRequestComment_GetPosition(tt *testing.T) { + tt.Parallel() var zeroValue int p := &PullRequestComment{Position: &zeroValue} p.GetPosition() @@ -19643,6 +21756,7 @@ func TestPullRequestComment_GetPosition(tt *testing.T) { } func TestPullRequestComment_GetPullRequestReviewID(tt *testing.T) { + tt.Parallel() var zeroValue int64 p := &PullRequestComment{PullRequestReviewID: &zeroValue} p.GetPullRequestReviewID() @@ -19653,6 +21767,7 @@ func TestPullRequestComment_GetPullRequestReviewID(tt *testing.T) { } func TestPullRequestComment_GetPullRequestURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestComment{PullRequestURL: &zeroValue} p.GetPullRequestURL() @@ -19663,6 +21778,7 @@ func TestPullRequestComment_GetPullRequestURL(tt *testing.T) { } func TestPullRequestComment_GetReactions(tt *testing.T) { + tt.Parallel() p := &PullRequestComment{} p.GetReactions() p = nil @@ -19670,6 +21786,7 @@ func TestPullRequestComment_GetReactions(tt *testing.T) { } func TestPullRequestComment_GetSide(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestComment{Side: &zeroValue} p.GetSide() @@ -19680,6 +21797,7 @@ func TestPullRequestComment_GetSide(tt *testing.T) { } func TestPullRequestComment_GetStartLine(tt *testing.T) { + tt.Parallel() var zeroValue int p := &PullRequestComment{StartLine: &zeroValue} p.GetStartLine() @@ -19690,6 +21808,7 @@ func TestPullRequestComment_GetStartLine(tt *testing.T) { } func TestPullRequestComment_GetStartSide(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestComment{StartSide: &zeroValue} p.GetStartSide() @@ -19700,6 +21819,7 @@ func TestPullRequestComment_GetStartSide(tt *testing.T) { } func TestPullRequestComment_GetSubjectType(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestComment{SubjectType: &zeroValue} p.GetSubjectType() @@ -19710,6 +21830,7 @@ func TestPullRequestComment_GetSubjectType(tt *testing.T) { } func TestPullRequestComment_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &PullRequestComment{UpdatedAt: &zeroValue} p.GetUpdatedAt() @@ -19720,6 +21841,7 @@ func TestPullRequestComment_GetUpdatedAt(tt *testing.T) { } func TestPullRequestComment_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestComment{URL: &zeroValue} p.GetURL() @@ -19730,6 +21852,7 @@ func TestPullRequestComment_GetURL(tt *testing.T) { } func TestPullRequestComment_GetUser(tt *testing.T) { + tt.Parallel() p := &PullRequestComment{} p.GetUser() p = nil @@ -19737,6 +21860,7 @@ func TestPullRequestComment_GetUser(tt *testing.T) { } func TestPullRequestEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestEvent{Action: &zeroValue} p.GetAction() @@ -19747,6 +21871,7 @@ func TestPullRequestEvent_GetAction(tt *testing.T) { } func TestPullRequestEvent_GetAfter(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestEvent{After: &zeroValue} p.GetAfter() @@ -19757,6 +21882,7 @@ func TestPullRequestEvent_GetAfter(tt *testing.T) { } func TestPullRequestEvent_GetAssignee(tt *testing.T) { + tt.Parallel() p := &PullRequestEvent{} p.GetAssignee() p = nil @@ -19764,6 +21890,7 @@ func TestPullRequestEvent_GetAssignee(tt *testing.T) { } func TestPullRequestEvent_GetBefore(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestEvent{Before: &zeroValue} p.GetBefore() @@ -19774,6 +21901,7 @@ func TestPullRequestEvent_GetBefore(tt *testing.T) { } func TestPullRequestEvent_GetChanges(tt *testing.T) { + tt.Parallel() p := &PullRequestEvent{} p.GetChanges() p = nil @@ -19781,6 +21909,7 @@ func TestPullRequestEvent_GetChanges(tt *testing.T) { } func TestPullRequestEvent_GetInstallation(tt *testing.T) { + tt.Parallel() p := &PullRequestEvent{} p.GetInstallation() p = nil @@ -19788,6 +21917,7 @@ func TestPullRequestEvent_GetInstallation(tt *testing.T) { } func TestPullRequestEvent_GetLabel(tt *testing.T) { + tt.Parallel() p := &PullRequestEvent{} p.GetLabel() p = nil @@ -19795,6 +21925,7 @@ func TestPullRequestEvent_GetLabel(tt *testing.T) { } func TestPullRequestEvent_GetNumber(tt *testing.T) { + tt.Parallel() var zeroValue int p := &PullRequestEvent{Number: &zeroValue} p.GetNumber() @@ -19805,6 +21936,7 @@ func TestPullRequestEvent_GetNumber(tt *testing.T) { } func TestPullRequestEvent_GetOrganization(tt *testing.T) { + tt.Parallel() p := &PullRequestEvent{} p.GetOrganization() p = nil @@ -19812,6 +21944,7 @@ func TestPullRequestEvent_GetOrganization(tt *testing.T) { } func TestPullRequestEvent_GetPerformedViaGithubApp(tt *testing.T) { + tt.Parallel() p := &PullRequestEvent{} p.GetPerformedViaGithubApp() p = nil @@ -19819,6 +21952,7 @@ func TestPullRequestEvent_GetPerformedViaGithubApp(tt *testing.T) { } func TestPullRequestEvent_GetPullRequest(tt *testing.T) { + tt.Parallel() p := &PullRequestEvent{} p.GetPullRequest() p = nil @@ -19826,6 +21960,7 @@ func TestPullRequestEvent_GetPullRequest(tt *testing.T) { } func TestPullRequestEvent_GetRepo(tt *testing.T) { + tt.Parallel() p := &PullRequestEvent{} p.GetRepo() p = nil @@ -19833,6 +21968,7 @@ func TestPullRequestEvent_GetRepo(tt *testing.T) { } func TestPullRequestEvent_GetRequestedReviewer(tt *testing.T) { + tt.Parallel() p := &PullRequestEvent{} p.GetRequestedReviewer() p = nil @@ -19840,6 +21976,7 @@ func TestPullRequestEvent_GetRequestedReviewer(tt *testing.T) { } func TestPullRequestEvent_GetRequestedTeam(tt *testing.T) { + tt.Parallel() p := &PullRequestEvent{} p.GetRequestedTeam() p = nil @@ -19847,6 +21984,7 @@ func TestPullRequestEvent_GetRequestedTeam(tt *testing.T) { } func TestPullRequestEvent_GetSender(tt *testing.T) { + tt.Parallel() p := &PullRequestEvent{} p.GetSender() p = nil @@ -19854,6 +21992,7 @@ func TestPullRequestEvent_GetSender(tt *testing.T) { } func TestPullRequestLinks_GetDiffURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestLinks{DiffURL: &zeroValue} p.GetDiffURL() @@ -19864,6 +22003,7 @@ func TestPullRequestLinks_GetDiffURL(tt *testing.T) { } func TestPullRequestLinks_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestLinks{HTMLURL: &zeroValue} p.GetHTMLURL() @@ -19874,6 +22014,7 @@ func TestPullRequestLinks_GetHTMLURL(tt *testing.T) { } func TestPullRequestLinks_GetMergedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &PullRequestLinks{MergedAt: &zeroValue} p.GetMergedAt() @@ -19884,6 +22025,7 @@ func TestPullRequestLinks_GetMergedAt(tt *testing.T) { } func TestPullRequestLinks_GetPatchURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestLinks{PatchURL: &zeroValue} p.GetPatchURL() @@ -19894,6 +22036,7 @@ func TestPullRequestLinks_GetPatchURL(tt *testing.T) { } func TestPullRequestLinks_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestLinks{URL: &zeroValue} p.GetURL() @@ -19904,6 +22047,7 @@ func TestPullRequestLinks_GetURL(tt *testing.T) { } func TestPullRequestMergeResult_GetMerged(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PullRequestMergeResult{Merged: &zeroValue} p.GetMerged() @@ -19914,6 +22058,7 @@ func TestPullRequestMergeResult_GetMerged(tt *testing.T) { } func TestPullRequestMergeResult_GetMessage(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestMergeResult{Message: &zeroValue} p.GetMessage() @@ -19924,6 +22069,7 @@ func TestPullRequestMergeResult_GetMessage(tt *testing.T) { } func TestPullRequestMergeResult_GetSHA(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestMergeResult{SHA: &zeroValue} p.GetSHA() @@ -19934,6 +22080,7 @@ func TestPullRequestMergeResult_GetSHA(tt *testing.T) { } func TestPullRequestReview_GetAuthorAssociation(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestReview{AuthorAssociation: &zeroValue} p.GetAuthorAssociation() @@ -19944,6 +22091,7 @@ func TestPullRequestReview_GetAuthorAssociation(tt *testing.T) { } func TestPullRequestReview_GetBody(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestReview{Body: &zeroValue} p.GetBody() @@ -19954,6 +22102,7 @@ func TestPullRequestReview_GetBody(tt *testing.T) { } func TestPullRequestReview_GetCommitID(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestReview{CommitID: &zeroValue} p.GetCommitID() @@ -19964,6 +22113,7 @@ func TestPullRequestReview_GetCommitID(tt *testing.T) { } func TestPullRequestReview_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestReview{HTMLURL: &zeroValue} p.GetHTMLURL() @@ -19974,6 +22124,7 @@ func TestPullRequestReview_GetHTMLURL(tt *testing.T) { } func TestPullRequestReview_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 p := &PullRequestReview{ID: &zeroValue} p.GetID() @@ -19984,6 +22135,7 @@ func TestPullRequestReview_GetID(tt *testing.T) { } func TestPullRequestReview_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestReview{NodeID: &zeroValue} p.GetNodeID() @@ -19994,6 +22146,7 @@ func TestPullRequestReview_GetNodeID(tt *testing.T) { } func TestPullRequestReview_GetPullRequestURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestReview{PullRequestURL: &zeroValue} p.GetPullRequestURL() @@ -20004,6 +22157,7 @@ func TestPullRequestReview_GetPullRequestURL(tt *testing.T) { } func TestPullRequestReview_GetState(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestReview{State: &zeroValue} p.GetState() @@ -20014,6 +22168,7 @@ func TestPullRequestReview_GetState(tt *testing.T) { } func TestPullRequestReview_GetSubmittedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &PullRequestReview{SubmittedAt: &zeroValue} p.GetSubmittedAt() @@ -20024,6 +22179,7 @@ func TestPullRequestReview_GetSubmittedAt(tt *testing.T) { } func TestPullRequestReview_GetUser(tt *testing.T) { + tt.Parallel() p := &PullRequestReview{} p.GetUser() p = nil @@ -20031,6 +22187,7 @@ func TestPullRequestReview_GetUser(tt *testing.T) { } func TestPullRequestReviewCommentEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestReviewCommentEvent{Action: &zeroValue} p.GetAction() @@ -20041,6 +22198,7 @@ func TestPullRequestReviewCommentEvent_GetAction(tt *testing.T) { } func TestPullRequestReviewCommentEvent_GetChanges(tt *testing.T) { + tt.Parallel() p := &PullRequestReviewCommentEvent{} p.GetChanges() p = nil @@ -20048,6 +22206,7 @@ func TestPullRequestReviewCommentEvent_GetChanges(tt *testing.T) { } func TestPullRequestReviewCommentEvent_GetComment(tt *testing.T) { + tt.Parallel() p := &PullRequestReviewCommentEvent{} p.GetComment() p = nil @@ -20055,6 +22214,7 @@ func TestPullRequestReviewCommentEvent_GetComment(tt *testing.T) { } func TestPullRequestReviewCommentEvent_GetInstallation(tt *testing.T) { + tt.Parallel() p := &PullRequestReviewCommentEvent{} p.GetInstallation() p = nil @@ -20062,6 +22222,7 @@ func TestPullRequestReviewCommentEvent_GetInstallation(tt *testing.T) { } func TestPullRequestReviewCommentEvent_GetOrg(tt *testing.T) { + tt.Parallel() p := &PullRequestReviewCommentEvent{} p.GetOrg() p = nil @@ -20069,6 +22230,7 @@ func TestPullRequestReviewCommentEvent_GetOrg(tt *testing.T) { } func TestPullRequestReviewCommentEvent_GetPullRequest(tt *testing.T) { + tt.Parallel() p := &PullRequestReviewCommentEvent{} p.GetPullRequest() p = nil @@ -20076,6 +22238,7 @@ func TestPullRequestReviewCommentEvent_GetPullRequest(tt *testing.T) { } func TestPullRequestReviewCommentEvent_GetRepo(tt *testing.T) { + tt.Parallel() p := &PullRequestReviewCommentEvent{} p.GetRepo() p = nil @@ -20083,6 +22246,7 @@ func TestPullRequestReviewCommentEvent_GetRepo(tt *testing.T) { } func TestPullRequestReviewCommentEvent_GetSender(tt *testing.T) { + tt.Parallel() p := &PullRequestReviewCommentEvent{} p.GetSender() p = nil @@ -20090,6 +22254,7 @@ func TestPullRequestReviewCommentEvent_GetSender(tt *testing.T) { } func TestPullRequestReviewDismissalRequest_GetMessage(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestReviewDismissalRequest{Message: &zeroValue} p.GetMessage() @@ -20100,6 +22265,7 @@ func TestPullRequestReviewDismissalRequest_GetMessage(tt *testing.T) { } func TestPullRequestReviewEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestReviewEvent{Action: &zeroValue} p.GetAction() @@ -20110,6 +22276,7 @@ func TestPullRequestReviewEvent_GetAction(tt *testing.T) { } func TestPullRequestReviewEvent_GetInstallation(tt *testing.T) { + tt.Parallel() p := &PullRequestReviewEvent{} p.GetInstallation() p = nil @@ -20117,6 +22284,7 @@ func TestPullRequestReviewEvent_GetInstallation(tt *testing.T) { } func TestPullRequestReviewEvent_GetOrganization(tt *testing.T) { + tt.Parallel() p := &PullRequestReviewEvent{} p.GetOrganization() p = nil @@ -20124,6 +22292,7 @@ func TestPullRequestReviewEvent_GetOrganization(tt *testing.T) { } func TestPullRequestReviewEvent_GetPullRequest(tt *testing.T) { + tt.Parallel() p := &PullRequestReviewEvent{} p.GetPullRequest() p = nil @@ -20131,6 +22300,7 @@ func TestPullRequestReviewEvent_GetPullRequest(tt *testing.T) { } func TestPullRequestReviewEvent_GetRepo(tt *testing.T) { + tt.Parallel() p := &PullRequestReviewEvent{} p.GetRepo() p = nil @@ -20138,6 +22308,7 @@ func TestPullRequestReviewEvent_GetRepo(tt *testing.T) { } func TestPullRequestReviewEvent_GetReview(tt *testing.T) { + tt.Parallel() p := &PullRequestReviewEvent{} p.GetReview() p = nil @@ -20145,6 +22316,7 @@ func TestPullRequestReviewEvent_GetReview(tt *testing.T) { } func TestPullRequestReviewEvent_GetSender(tt *testing.T) { + tt.Parallel() p := &PullRequestReviewEvent{} p.GetSender() p = nil @@ -20152,6 +22324,7 @@ func TestPullRequestReviewEvent_GetSender(tt *testing.T) { } func TestPullRequestReviewRequest_GetBody(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestReviewRequest{Body: &zeroValue} p.GetBody() @@ -20162,6 +22335,7 @@ func TestPullRequestReviewRequest_GetBody(tt *testing.T) { } func TestPullRequestReviewRequest_GetCommitID(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestReviewRequest{CommitID: &zeroValue} p.GetCommitID() @@ -20172,6 +22346,7 @@ func TestPullRequestReviewRequest_GetCommitID(tt *testing.T) { } func TestPullRequestReviewRequest_GetEvent(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestReviewRequest{Event: &zeroValue} p.GetEvent() @@ -20182,6 +22357,7 @@ func TestPullRequestReviewRequest_GetEvent(tt *testing.T) { } func TestPullRequestReviewRequest_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestReviewRequest{NodeID: &zeroValue} p.GetNodeID() @@ -20192,6 +22368,7 @@ func TestPullRequestReviewRequest_GetNodeID(tt *testing.T) { } func TestPullRequestReviewsEnforcement_GetBypassPullRequestAllowances(tt *testing.T) { + tt.Parallel() p := &PullRequestReviewsEnforcement{} p.GetBypassPullRequestAllowances() p = nil @@ -20199,6 +22376,7 @@ func TestPullRequestReviewsEnforcement_GetBypassPullRequestAllowances(tt *testin } func TestPullRequestReviewsEnforcement_GetDismissalRestrictions(tt *testing.T) { + tt.Parallel() p := &PullRequestReviewsEnforcement{} p.GetDismissalRestrictions() p = nil @@ -20206,6 +22384,7 @@ func TestPullRequestReviewsEnforcement_GetDismissalRestrictions(tt *testing.T) { } func TestPullRequestReviewsEnforcementLevelChanges_GetFrom(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestReviewsEnforcementLevelChanges{From: &zeroValue} p.GetFrom() @@ -20216,6 +22395,7 @@ func TestPullRequestReviewsEnforcementLevelChanges_GetFrom(tt *testing.T) { } func TestPullRequestReviewsEnforcementRequest_GetBypassPullRequestAllowancesRequest(tt *testing.T) { + tt.Parallel() p := &PullRequestReviewsEnforcementRequest{} p.GetBypassPullRequestAllowancesRequest() p = nil @@ -20223,6 +22403,7 @@ func TestPullRequestReviewsEnforcementRequest_GetBypassPullRequestAllowancesRequ } func TestPullRequestReviewsEnforcementRequest_GetDismissalRestrictionsRequest(tt *testing.T) { + tt.Parallel() p := &PullRequestReviewsEnforcementRequest{} p.GetDismissalRestrictionsRequest() p = nil @@ -20230,6 +22411,7 @@ func TestPullRequestReviewsEnforcementRequest_GetDismissalRestrictionsRequest(tt } func TestPullRequestReviewsEnforcementRequest_GetRequireLastPushApproval(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PullRequestReviewsEnforcementRequest{RequireLastPushApproval: &zeroValue} p.GetRequireLastPushApproval() @@ -20240,6 +22422,7 @@ func TestPullRequestReviewsEnforcementRequest_GetRequireLastPushApproval(tt *tes } func TestPullRequestReviewsEnforcementUpdate_GetBypassPullRequestAllowancesRequest(tt *testing.T) { + tt.Parallel() p := &PullRequestReviewsEnforcementUpdate{} p.GetBypassPullRequestAllowancesRequest() p = nil @@ -20247,6 +22430,7 @@ func TestPullRequestReviewsEnforcementUpdate_GetBypassPullRequestAllowancesReque } func TestPullRequestReviewsEnforcementUpdate_GetDismissalRestrictionsRequest(tt *testing.T) { + tt.Parallel() p := &PullRequestReviewsEnforcementUpdate{} p.GetDismissalRestrictionsRequest() p = nil @@ -20254,6 +22438,7 @@ func TestPullRequestReviewsEnforcementUpdate_GetDismissalRestrictionsRequest(tt } func TestPullRequestReviewsEnforcementUpdate_GetDismissStaleReviews(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PullRequestReviewsEnforcementUpdate{DismissStaleReviews: &zeroValue} p.GetDismissStaleReviews() @@ -20264,6 +22449,7 @@ func TestPullRequestReviewsEnforcementUpdate_GetDismissStaleReviews(tt *testing. } func TestPullRequestReviewsEnforcementUpdate_GetRequireCodeOwnerReviews(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PullRequestReviewsEnforcementUpdate{RequireCodeOwnerReviews: &zeroValue} p.GetRequireCodeOwnerReviews() @@ -20274,6 +22460,7 @@ func TestPullRequestReviewsEnforcementUpdate_GetRequireCodeOwnerReviews(tt *test } func TestPullRequestReviewsEnforcementUpdate_GetRequireLastPushApproval(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PullRequestReviewsEnforcementUpdate{RequireLastPushApproval: &zeroValue} p.GetRequireLastPushApproval() @@ -20284,6 +22471,7 @@ func TestPullRequestReviewsEnforcementUpdate_GetRequireLastPushApproval(tt *test } func TestPullRequestReviewThreadEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestReviewThreadEvent{Action: &zeroValue} p.GetAction() @@ -20294,6 +22482,7 @@ func TestPullRequestReviewThreadEvent_GetAction(tt *testing.T) { } func TestPullRequestReviewThreadEvent_GetInstallation(tt *testing.T) { + tt.Parallel() p := &PullRequestReviewThreadEvent{} p.GetInstallation() p = nil @@ -20301,6 +22490,7 @@ func TestPullRequestReviewThreadEvent_GetInstallation(tt *testing.T) { } func TestPullRequestReviewThreadEvent_GetOrg(tt *testing.T) { + tt.Parallel() p := &PullRequestReviewThreadEvent{} p.GetOrg() p = nil @@ -20308,6 +22498,7 @@ func TestPullRequestReviewThreadEvent_GetOrg(tt *testing.T) { } func TestPullRequestReviewThreadEvent_GetPullRequest(tt *testing.T) { + tt.Parallel() p := &PullRequestReviewThreadEvent{} p.GetPullRequest() p = nil @@ -20315,6 +22506,7 @@ func TestPullRequestReviewThreadEvent_GetPullRequest(tt *testing.T) { } func TestPullRequestReviewThreadEvent_GetRepo(tt *testing.T) { + tt.Parallel() p := &PullRequestReviewThreadEvent{} p.GetRepo() p = nil @@ -20322,6 +22514,7 @@ func TestPullRequestReviewThreadEvent_GetRepo(tt *testing.T) { } func TestPullRequestReviewThreadEvent_GetSender(tt *testing.T) { + tt.Parallel() p := &PullRequestReviewThreadEvent{} p.GetSender() p = nil @@ -20329,6 +22522,7 @@ func TestPullRequestReviewThreadEvent_GetSender(tt *testing.T) { } func TestPullRequestReviewThreadEvent_GetThread(tt *testing.T) { + tt.Parallel() p := &PullRequestReviewThreadEvent{} p.GetThread() p = nil @@ -20336,6 +22530,7 @@ func TestPullRequestReviewThreadEvent_GetThread(tt *testing.T) { } func TestPullRequestTargetEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestTargetEvent{Action: &zeroValue} p.GetAction() @@ -20346,6 +22541,7 @@ func TestPullRequestTargetEvent_GetAction(tt *testing.T) { } func TestPullRequestTargetEvent_GetAfter(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestTargetEvent{After: &zeroValue} p.GetAfter() @@ -20356,6 +22552,7 @@ func TestPullRequestTargetEvent_GetAfter(tt *testing.T) { } func TestPullRequestTargetEvent_GetAssignee(tt *testing.T) { + tt.Parallel() p := &PullRequestTargetEvent{} p.GetAssignee() p = nil @@ -20363,6 +22560,7 @@ func TestPullRequestTargetEvent_GetAssignee(tt *testing.T) { } func TestPullRequestTargetEvent_GetBefore(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestTargetEvent{Before: &zeroValue} p.GetBefore() @@ -20373,6 +22571,7 @@ func TestPullRequestTargetEvent_GetBefore(tt *testing.T) { } func TestPullRequestTargetEvent_GetChanges(tt *testing.T) { + tt.Parallel() p := &PullRequestTargetEvent{} p.GetChanges() p = nil @@ -20380,6 +22579,7 @@ func TestPullRequestTargetEvent_GetChanges(tt *testing.T) { } func TestPullRequestTargetEvent_GetInstallation(tt *testing.T) { + tt.Parallel() p := &PullRequestTargetEvent{} p.GetInstallation() p = nil @@ -20387,6 +22587,7 @@ func TestPullRequestTargetEvent_GetInstallation(tt *testing.T) { } func TestPullRequestTargetEvent_GetLabel(tt *testing.T) { + tt.Parallel() p := &PullRequestTargetEvent{} p.GetLabel() p = nil @@ -20394,6 +22595,7 @@ func TestPullRequestTargetEvent_GetLabel(tt *testing.T) { } func TestPullRequestTargetEvent_GetNumber(tt *testing.T) { + tt.Parallel() var zeroValue int p := &PullRequestTargetEvent{Number: &zeroValue} p.GetNumber() @@ -20404,6 +22606,7 @@ func TestPullRequestTargetEvent_GetNumber(tt *testing.T) { } func TestPullRequestTargetEvent_GetOrganization(tt *testing.T) { + tt.Parallel() p := &PullRequestTargetEvent{} p.GetOrganization() p = nil @@ -20411,6 +22614,7 @@ func TestPullRequestTargetEvent_GetOrganization(tt *testing.T) { } func TestPullRequestTargetEvent_GetPerformedViaGithubApp(tt *testing.T) { + tt.Parallel() p := &PullRequestTargetEvent{} p.GetPerformedViaGithubApp() p = nil @@ -20418,6 +22622,7 @@ func TestPullRequestTargetEvent_GetPerformedViaGithubApp(tt *testing.T) { } func TestPullRequestTargetEvent_GetPullRequest(tt *testing.T) { + tt.Parallel() p := &PullRequestTargetEvent{} p.GetPullRequest() p = nil @@ -20425,6 +22630,7 @@ func TestPullRequestTargetEvent_GetPullRequest(tt *testing.T) { } func TestPullRequestTargetEvent_GetRepo(tt *testing.T) { + tt.Parallel() p := &PullRequestTargetEvent{} p.GetRepo() p = nil @@ -20432,6 +22638,7 @@ func TestPullRequestTargetEvent_GetRepo(tt *testing.T) { } func TestPullRequestTargetEvent_GetRequestedReviewer(tt *testing.T) { + tt.Parallel() p := &PullRequestTargetEvent{} p.GetRequestedReviewer() p = nil @@ -20439,6 +22646,7 @@ func TestPullRequestTargetEvent_GetRequestedReviewer(tt *testing.T) { } func TestPullRequestTargetEvent_GetRequestedTeam(tt *testing.T) { + tt.Parallel() p := &PullRequestTargetEvent{} p.GetRequestedTeam() p = nil @@ -20446,6 +22654,7 @@ func TestPullRequestTargetEvent_GetRequestedTeam(tt *testing.T) { } func TestPullRequestTargetEvent_GetSender(tt *testing.T) { + tt.Parallel() p := &PullRequestTargetEvent{} p.GetSender() p = nil @@ -20453,6 +22662,7 @@ func TestPullRequestTargetEvent_GetSender(tt *testing.T) { } func TestPullRequestThread_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 p := &PullRequestThread{ID: &zeroValue} p.GetID() @@ -20463,6 +22673,7 @@ func TestPullRequestThread_GetID(tt *testing.T) { } func TestPullRequestThread_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PullRequestThread{NodeID: &zeroValue} p.GetNodeID() @@ -20473,6 +22684,7 @@ func TestPullRequestThread_GetNodeID(tt *testing.T) { } func TestPullStats_GetMergablePulls(tt *testing.T) { + tt.Parallel() var zeroValue int p := &PullStats{MergablePulls: &zeroValue} p.GetMergablePulls() @@ -20483,6 +22695,7 @@ func TestPullStats_GetMergablePulls(tt *testing.T) { } func TestPullStats_GetMergedPulls(tt *testing.T) { + tt.Parallel() var zeroValue int p := &PullStats{MergedPulls: &zeroValue} p.GetMergedPulls() @@ -20493,6 +22706,7 @@ func TestPullStats_GetMergedPulls(tt *testing.T) { } func TestPullStats_GetTotalPulls(tt *testing.T) { + tt.Parallel() var zeroValue int p := &PullStats{TotalPulls: &zeroValue} p.GetTotalPulls() @@ -20503,6 +22717,7 @@ func TestPullStats_GetTotalPulls(tt *testing.T) { } func TestPullStats_GetUnmergablePulls(tt *testing.T) { + tt.Parallel() var zeroValue int p := &PullStats{UnmergablePulls: &zeroValue} p.GetUnmergablePulls() @@ -20513,6 +22728,7 @@ func TestPullStats_GetUnmergablePulls(tt *testing.T) { } func TestPunchCard_GetCommits(tt *testing.T) { + tt.Parallel() var zeroValue int p := &PunchCard{Commits: &zeroValue} p.GetCommits() @@ -20523,6 +22739,7 @@ func TestPunchCard_GetCommits(tt *testing.T) { } func TestPunchCard_GetDay(tt *testing.T) { + tt.Parallel() var zeroValue int p := &PunchCard{Day: &zeroValue} p.GetDay() @@ -20533,6 +22750,7 @@ func TestPunchCard_GetDay(tt *testing.T) { } func TestPunchCard_GetHour(tt *testing.T) { + tt.Parallel() var zeroValue int p := &PunchCard{Hour: &zeroValue} p.GetHour() @@ -20543,6 +22761,7 @@ func TestPunchCard_GetHour(tt *testing.T) { } func TestPushEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PushEvent{Action: &zeroValue} p.GetAction() @@ -20553,6 +22772,7 @@ func TestPushEvent_GetAction(tt *testing.T) { } func TestPushEvent_GetAfter(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PushEvent{After: &zeroValue} p.GetAfter() @@ -20563,6 +22783,7 @@ func TestPushEvent_GetAfter(tt *testing.T) { } func TestPushEvent_GetBaseRef(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PushEvent{BaseRef: &zeroValue} p.GetBaseRef() @@ -20573,6 +22794,7 @@ func TestPushEvent_GetBaseRef(tt *testing.T) { } func TestPushEvent_GetBefore(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PushEvent{Before: &zeroValue} p.GetBefore() @@ -20583,6 +22805,7 @@ func TestPushEvent_GetBefore(tt *testing.T) { } func TestPushEvent_GetCommits(tt *testing.T) { + tt.Parallel() zeroValue := []*HeadCommit{} p := &PushEvent{Commits: zeroValue} p.GetCommits() @@ -20593,6 +22816,7 @@ func TestPushEvent_GetCommits(tt *testing.T) { } func TestPushEvent_GetCompare(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PushEvent{Compare: &zeroValue} p.GetCompare() @@ -20603,6 +22827,7 @@ func TestPushEvent_GetCompare(tt *testing.T) { } func TestPushEvent_GetCreated(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PushEvent{Created: &zeroValue} p.GetCreated() @@ -20613,6 +22838,7 @@ func TestPushEvent_GetCreated(tt *testing.T) { } func TestPushEvent_GetDeleted(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PushEvent{Deleted: &zeroValue} p.GetDeleted() @@ -20623,6 +22849,7 @@ func TestPushEvent_GetDeleted(tt *testing.T) { } func TestPushEvent_GetDistinctSize(tt *testing.T) { + tt.Parallel() var zeroValue int p := &PushEvent{DistinctSize: &zeroValue} p.GetDistinctSize() @@ -20633,6 +22860,7 @@ func TestPushEvent_GetDistinctSize(tt *testing.T) { } func TestPushEvent_GetForced(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PushEvent{Forced: &zeroValue} p.GetForced() @@ -20643,6 +22871,7 @@ func TestPushEvent_GetForced(tt *testing.T) { } func TestPushEvent_GetHead(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PushEvent{Head: &zeroValue} p.GetHead() @@ -20653,6 +22882,7 @@ func TestPushEvent_GetHead(tt *testing.T) { } func TestPushEvent_GetHeadCommit(tt *testing.T) { + tt.Parallel() p := &PushEvent{} p.GetHeadCommit() p = nil @@ -20660,6 +22890,7 @@ func TestPushEvent_GetHeadCommit(tt *testing.T) { } func TestPushEvent_GetInstallation(tt *testing.T) { + tt.Parallel() p := &PushEvent{} p.GetInstallation() p = nil @@ -20667,6 +22898,7 @@ func TestPushEvent_GetInstallation(tt *testing.T) { } func TestPushEvent_GetOrganization(tt *testing.T) { + tt.Parallel() p := &PushEvent{} p.GetOrganization() p = nil @@ -20674,6 +22906,7 @@ func TestPushEvent_GetOrganization(tt *testing.T) { } func TestPushEvent_GetPusher(tt *testing.T) { + tt.Parallel() p := &PushEvent{} p.GetPusher() p = nil @@ -20681,6 +22914,7 @@ func TestPushEvent_GetPusher(tt *testing.T) { } func TestPushEvent_GetPushID(tt *testing.T) { + tt.Parallel() var zeroValue int64 p := &PushEvent{PushID: &zeroValue} p.GetPushID() @@ -20691,6 +22925,7 @@ func TestPushEvent_GetPushID(tt *testing.T) { } func TestPushEvent_GetRef(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PushEvent{Ref: &zeroValue} p.GetRef() @@ -20701,6 +22936,7 @@ func TestPushEvent_GetRef(tt *testing.T) { } func TestPushEvent_GetRepo(tt *testing.T) { + tt.Parallel() p := &PushEvent{} p.GetRepo() p = nil @@ -20708,6 +22944,7 @@ func TestPushEvent_GetRepo(tt *testing.T) { } func TestPushEvent_GetSender(tt *testing.T) { + tt.Parallel() p := &PushEvent{} p.GetSender() p = nil @@ -20715,6 +22952,7 @@ func TestPushEvent_GetSender(tt *testing.T) { } func TestPushEvent_GetSize(tt *testing.T) { + tt.Parallel() var zeroValue int p := &PushEvent{Size: &zeroValue} p.GetSize() @@ -20725,6 +22963,7 @@ func TestPushEvent_GetSize(tt *testing.T) { } func TestPushEventRepoOwner_GetEmail(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PushEventRepoOwner{Email: &zeroValue} p.GetEmail() @@ -20735,6 +22974,7 @@ func TestPushEventRepoOwner_GetEmail(tt *testing.T) { } func TestPushEventRepoOwner_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PushEventRepoOwner{Name: &zeroValue} p.GetName() @@ -20745,6 +22985,7 @@ func TestPushEventRepoOwner_GetName(tt *testing.T) { } func TestPushEventRepository_GetArchived(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PushEventRepository{Archived: &zeroValue} p.GetArchived() @@ -20755,6 +22996,7 @@ func TestPushEventRepository_GetArchived(tt *testing.T) { } func TestPushEventRepository_GetArchiveURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PushEventRepository{ArchiveURL: &zeroValue} p.GetArchiveURL() @@ -20765,6 +23007,7 @@ func TestPushEventRepository_GetArchiveURL(tt *testing.T) { } func TestPushEventRepository_GetCloneURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PushEventRepository{CloneURL: &zeroValue} p.GetCloneURL() @@ -20775,6 +23018,7 @@ func TestPushEventRepository_GetCloneURL(tt *testing.T) { } func TestPushEventRepository_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &PushEventRepository{CreatedAt: &zeroValue} p.GetCreatedAt() @@ -20785,6 +23029,7 @@ func TestPushEventRepository_GetCreatedAt(tt *testing.T) { } func TestPushEventRepository_GetDefaultBranch(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PushEventRepository{DefaultBranch: &zeroValue} p.GetDefaultBranch() @@ -20795,6 +23040,7 @@ func TestPushEventRepository_GetDefaultBranch(tt *testing.T) { } func TestPushEventRepository_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PushEventRepository{Description: &zeroValue} p.GetDescription() @@ -20805,6 +23051,7 @@ func TestPushEventRepository_GetDescription(tt *testing.T) { } func TestPushEventRepository_GetDisabled(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PushEventRepository{Disabled: &zeroValue} p.GetDisabled() @@ -20815,6 +23062,7 @@ func TestPushEventRepository_GetDisabled(tt *testing.T) { } func TestPushEventRepository_GetFork(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PushEventRepository{Fork: &zeroValue} p.GetFork() @@ -20825,6 +23073,7 @@ func TestPushEventRepository_GetFork(tt *testing.T) { } func TestPushEventRepository_GetForksCount(tt *testing.T) { + tt.Parallel() var zeroValue int p := &PushEventRepository{ForksCount: &zeroValue} p.GetForksCount() @@ -20835,6 +23084,7 @@ func TestPushEventRepository_GetForksCount(tt *testing.T) { } func TestPushEventRepository_GetFullName(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PushEventRepository{FullName: &zeroValue} p.GetFullName() @@ -20845,6 +23095,7 @@ func TestPushEventRepository_GetFullName(tt *testing.T) { } func TestPushEventRepository_GetGitURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PushEventRepository{GitURL: &zeroValue} p.GetGitURL() @@ -20855,6 +23106,7 @@ func TestPushEventRepository_GetGitURL(tt *testing.T) { } func TestPushEventRepository_GetHasDownloads(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PushEventRepository{HasDownloads: &zeroValue} p.GetHasDownloads() @@ -20865,6 +23117,7 @@ func TestPushEventRepository_GetHasDownloads(tt *testing.T) { } func TestPushEventRepository_GetHasIssues(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PushEventRepository{HasIssues: &zeroValue} p.GetHasIssues() @@ -20875,6 +23128,7 @@ func TestPushEventRepository_GetHasIssues(tt *testing.T) { } func TestPushEventRepository_GetHasPages(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PushEventRepository{HasPages: &zeroValue} p.GetHasPages() @@ -20885,6 +23139,7 @@ func TestPushEventRepository_GetHasPages(tt *testing.T) { } func TestPushEventRepository_GetHasWiki(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PushEventRepository{HasWiki: &zeroValue} p.GetHasWiki() @@ -20895,6 +23150,7 @@ func TestPushEventRepository_GetHasWiki(tt *testing.T) { } func TestPushEventRepository_GetHomepage(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PushEventRepository{Homepage: &zeroValue} p.GetHomepage() @@ -20905,6 +23161,7 @@ func TestPushEventRepository_GetHomepage(tt *testing.T) { } func TestPushEventRepository_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PushEventRepository{HTMLURL: &zeroValue} p.GetHTMLURL() @@ -20915,6 +23172,7 @@ func TestPushEventRepository_GetHTMLURL(tt *testing.T) { } func TestPushEventRepository_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 p := &PushEventRepository{ID: &zeroValue} p.GetID() @@ -20925,6 +23183,7 @@ func TestPushEventRepository_GetID(tt *testing.T) { } func TestPushEventRepository_GetLanguage(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PushEventRepository{Language: &zeroValue} p.GetLanguage() @@ -20935,6 +23194,7 @@ func TestPushEventRepository_GetLanguage(tt *testing.T) { } func TestPushEventRepository_GetMasterBranch(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PushEventRepository{MasterBranch: &zeroValue} p.GetMasterBranch() @@ -20945,6 +23205,7 @@ func TestPushEventRepository_GetMasterBranch(tt *testing.T) { } func TestPushEventRepository_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PushEventRepository{Name: &zeroValue} p.GetName() @@ -20955,6 +23216,7 @@ func TestPushEventRepository_GetName(tt *testing.T) { } func TestPushEventRepository_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PushEventRepository{NodeID: &zeroValue} p.GetNodeID() @@ -20965,6 +23227,7 @@ func TestPushEventRepository_GetNodeID(tt *testing.T) { } func TestPushEventRepository_GetOpenIssuesCount(tt *testing.T) { + tt.Parallel() var zeroValue int p := &PushEventRepository{OpenIssuesCount: &zeroValue} p.GetOpenIssuesCount() @@ -20975,6 +23238,7 @@ func TestPushEventRepository_GetOpenIssuesCount(tt *testing.T) { } func TestPushEventRepository_GetOrganization(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PushEventRepository{Organization: &zeroValue} p.GetOrganization() @@ -20985,6 +23249,7 @@ func TestPushEventRepository_GetOrganization(tt *testing.T) { } func TestPushEventRepository_GetOwner(tt *testing.T) { + tt.Parallel() p := &PushEventRepository{} p.GetOwner() p = nil @@ -20992,6 +23257,7 @@ func TestPushEventRepository_GetOwner(tt *testing.T) { } func TestPushEventRepository_GetPrivate(tt *testing.T) { + tt.Parallel() var zeroValue bool p := &PushEventRepository{Private: &zeroValue} p.GetPrivate() @@ -21002,6 +23268,7 @@ func TestPushEventRepository_GetPrivate(tt *testing.T) { } func TestPushEventRepository_GetPullsURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PushEventRepository{PullsURL: &zeroValue} p.GetPullsURL() @@ -21012,6 +23279,7 @@ func TestPushEventRepository_GetPullsURL(tt *testing.T) { } func TestPushEventRepository_GetPushedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &PushEventRepository{PushedAt: &zeroValue} p.GetPushedAt() @@ -21022,6 +23290,7 @@ func TestPushEventRepository_GetPushedAt(tt *testing.T) { } func TestPushEventRepository_GetSize(tt *testing.T) { + tt.Parallel() var zeroValue int p := &PushEventRepository{Size: &zeroValue} p.GetSize() @@ -21032,6 +23301,7 @@ func TestPushEventRepository_GetSize(tt *testing.T) { } func TestPushEventRepository_GetSSHURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PushEventRepository{SSHURL: &zeroValue} p.GetSSHURL() @@ -21042,6 +23312,7 @@ func TestPushEventRepository_GetSSHURL(tt *testing.T) { } func TestPushEventRepository_GetStargazersCount(tt *testing.T) { + tt.Parallel() var zeroValue int p := &PushEventRepository{StargazersCount: &zeroValue} p.GetStargazersCount() @@ -21052,6 +23323,7 @@ func TestPushEventRepository_GetStargazersCount(tt *testing.T) { } func TestPushEventRepository_GetStatusesURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PushEventRepository{StatusesURL: &zeroValue} p.GetStatusesURL() @@ -21062,6 +23334,7 @@ func TestPushEventRepository_GetStatusesURL(tt *testing.T) { } func TestPushEventRepository_GetSVNURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PushEventRepository{SVNURL: &zeroValue} p.GetSVNURL() @@ -21072,6 +23345,7 @@ func TestPushEventRepository_GetSVNURL(tt *testing.T) { } func TestPushEventRepository_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp p := &PushEventRepository{UpdatedAt: &zeroValue} p.GetUpdatedAt() @@ -21082,6 +23356,7 @@ func TestPushEventRepository_GetUpdatedAt(tt *testing.T) { } func TestPushEventRepository_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string p := &PushEventRepository{URL: &zeroValue} p.GetURL() @@ -21092,6 +23367,7 @@ func TestPushEventRepository_GetURL(tt *testing.T) { } func TestPushEventRepository_GetWatchersCount(tt *testing.T) { + tt.Parallel() var zeroValue int p := &PushEventRepository{WatchersCount: &zeroValue} p.GetWatchersCount() @@ -21102,6 +23378,7 @@ func TestPushEventRepository_GetWatchersCount(tt *testing.T) { } func TestRateLimits_GetActionsRunnerRegistration(tt *testing.T) { + tt.Parallel() r := &RateLimits{} r.GetActionsRunnerRegistration() r = nil @@ -21109,6 +23386,7 @@ func TestRateLimits_GetActionsRunnerRegistration(tt *testing.T) { } func TestRateLimits_GetAuditLog(tt *testing.T) { + tt.Parallel() r := &RateLimits{} r.GetAuditLog() r = nil @@ -21116,6 +23394,7 @@ func TestRateLimits_GetAuditLog(tt *testing.T) { } func TestRateLimits_GetCodeScanningUpload(tt *testing.T) { + tt.Parallel() r := &RateLimits{} r.GetCodeScanningUpload() r = nil @@ -21123,6 +23402,7 @@ func TestRateLimits_GetCodeScanningUpload(tt *testing.T) { } func TestRateLimits_GetCodeSearch(tt *testing.T) { + tt.Parallel() r := &RateLimits{} r.GetCodeSearch() r = nil @@ -21130,6 +23410,7 @@ func TestRateLimits_GetCodeSearch(tt *testing.T) { } func TestRateLimits_GetCore(tt *testing.T) { + tt.Parallel() r := &RateLimits{} r.GetCore() r = nil @@ -21137,6 +23418,7 @@ func TestRateLimits_GetCore(tt *testing.T) { } func TestRateLimits_GetDependencySnapshots(tt *testing.T) { + tt.Parallel() r := &RateLimits{} r.GetDependencySnapshots() r = nil @@ -21144,6 +23426,7 @@ func TestRateLimits_GetDependencySnapshots(tt *testing.T) { } func TestRateLimits_GetGraphQL(tt *testing.T) { + tt.Parallel() r := &RateLimits{} r.GetGraphQL() r = nil @@ -21151,6 +23434,7 @@ func TestRateLimits_GetGraphQL(tt *testing.T) { } func TestRateLimits_GetIntegrationManifest(tt *testing.T) { + tt.Parallel() r := &RateLimits{} r.GetIntegrationManifest() r = nil @@ -21158,6 +23442,7 @@ func TestRateLimits_GetIntegrationManifest(tt *testing.T) { } func TestRateLimits_GetSCIM(tt *testing.T) { + tt.Parallel() r := &RateLimits{} r.GetSCIM() r = nil @@ -21165,6 +23450,7 @@ func TestRateLimits_GetSCIM(tt *testing.T) { } func TestRateLimits_GetSearch(tt *testing.T) { + tt.Parallel() r := &RateLimits{} r.GetSearch() r = nil @@ -21172,6 +23458,7 @@ func TestRateLimits_GetSearch(tt *testing.T) { } func TestRateLimits_GetSourceImport(tt *testing.T) { + tt.Parallel() r := &RateLimits{} r.GetSourceImport() r = nil @@ -21179,6 +23466,7 @@ func TestRateLimits_GetSourceImport(tt *testing.T) { } func TestReaction_GetContent(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Reaction{Content: &zeroValue} r.GetContent() @@ -21189,6 +23477,7 @@ func TestReaction_GetContent(tt *testing.T) { } func TestReaction_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 r := &Reaction{ID: &zeroValue} r.GetID() @@ -21199,6 +23488,7 @@ func TestReaction_GetID(tt *testing.T) { } func TestReaction_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Reaction{NodeID: &zeroValue} r.GetNodeID() @@ -21209,6 +23499,7 @@ func TestReaction_GetNodeID(tt *testing.T) { } func TestReaction_GetUser(tt *testing.T) { + tt.Parallel() r := &Reaction{} r.GetUser() r = nil @@ -21216,6 +23507,7 @@ func TestReaction_GetUser(tt *testing.T) { } func TestReactions_GetConfused(tt *testing.T) { + tt.Parallel() var zeroValue int r := &Reactions{Confused: &zeroValue} r.GetConfused() @@ -21226,6 +23518,7 @@ func TestReactions_GetConfused(tt *testing.T) { } func TestReactions_GetEyes(tt *testing.T) { + tt.Parallel() var zeroValue int r := &Reactions{Eyes: &zeroValue} r.GetEyes() @@ -21236,6 +23529,7 @@ func TestReactions_GetEyes(tt *testing.T) { } func TestReactions_GetHeart(tt *testing.T) { + tt.Parallel() var zeroValue int r := &Reactions{Heart: &zeroValue} r.GetHeart() @@ -21246,6 +23540,7 @@ func TestReactions_GetHeart(tt *testing.T) { } func TestReactions_GetHooray(tt *testing.T) { + tt.Parallel() var zeroValue int r := &Reactions{Hooray: &zeroValue} r.GetHooray() @@ -21256,6 +23551,7 @@ func TestReactions_GetHooray(tt *testing.T) { } func TestReactions_GetLaugh(tt *testing.T) { + tt.Parallel() var zeroValue int r := &Reactions{Laugh: &zeroValue} r.GetLaugh() @@ -21266,6 +23562,7 @@ func TestReactions_GetLaugh(tt *testing.T) { } func TestReactions_GetMinusOne(tt *testing.T) { + tt.Parallel() var zeroValue int r := &Reactions{MinusOne: &zeroValue} r.GetMinusOne() @@ -21276,6 +23573,7 @@ func TestReactions_GetMinusOne(tt *testing.T) { } func TestReactions_GetPlusOne(tt *testing.T) { + tt.Parallel() var zeroValue int r := &Reactions{PlusOne: &zeroValue} r.GetPlusOne() @@ -21286,6 +23584,7 @@ func TestReactions_GetPlusOne(tt *testing.T) { } func TestReactions_GetRocket(tt *testing.T) { + tt.Parallel() var zeroValue int r := &Reactions{Rocket: &zeroValue} r.GetRocket() @@ -21296,6 +23595,7 @@ func TestReactions_GetRocket(tt *testing.T) { } func TestReactions_GetTotalCount(tt *testing.T) { + tt.Parallel() var zeroValue int r := &Reactions{TotalCount: &zeroValue} r.GetTotalCount() @@ -21306,6 +23606,7 @@ func TestReactions_GetTotalCount(tt *testing.T) { } func TestReactions_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Reactions{URL: &zeroValue} r.GetURL() @@ -21316,6 +23617,7 @@ func TestReactions_GetURL(tt *testing.T) { } func TestReference_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Reference{NodeID: &zeroValue} r.GetNodeID() @@ -21326,6 +23628,7 @@ func TestReference_GetNodeID(tt *testing.T) { } func TestReference_GetObject(tt *testing.T) { + tt.Parallel() r := &Reference{} r.GetObject() r = nil @@ -21333,6 +23636,7 @@ func TestReference_GetObject(tt *testing.T) { } func TestReference_GetRef(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Reference{Ref: &zeroValue} r.GetRef() @@ -21343,6 +23647,7 @@ func TestReference_GetRef(tt *testing.T) { } func TestReference_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Reference{URL: &zeroValue} r.GetURL() @@ -21353,6 +23658,7 @@ func TestReference_GetURL(tt *testing.T) { } func TestReferencedWorkflow_GetPath(tt *testing.T) { + tt.Parallel() var zeroValue string r := &ReferencedWorkflow{Path: &zeroValue} r.GetPath() @@ -21363,6 +23669,7 @@ func TestReferencedWorkflow_GetPath(tt *testing.T) { } func TestReferencedWorkflow_GetRef(tt *testing.T) { + tt.Parallel() var zeroValue string r := &ReferencedWorkflow{Ref: &zeroValue} r.GetRef() @@ -21373,6 +23680,7 @@ func TestReferencedWorkflow_GetRef(tt *testing.T) { } func TestReferencedWorkflow_GetSHA(tt *testing.T) { + tt.Parallel() var zeroValue string r := &ReferencedWorkflow{SHA: &zeroValue} r.GetSHA() @@ -21383,6 +23691,7 @@ func TestReferencedWorkflow_GetSHA(tt *testing.T) { } func TestRegistrationToken_GetExpiresAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp r := &RegistrationToken{ExpiresAt: &zeroValue} r.GetExpiresAt() @@ -21393,6 +23702,7 @@ func TestRegistrationToken_GetExpiresAt(tt *testing.T) { } func TestRegistrationToken_GetToken(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RegistrationToken{Token: &zeroValue} r.GetToken() @@ -21403,6 +23713,7 @@ func TestRegistrationToken_GetToken(tt *testing.T) { } func TestReleaseAsset_GetBrowserDownloadURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &ReleaseAsset{BrowserDownloadURL: &zeroValue} r.GetBrowserDownloadURL() @@ -21413,6 +23724,7 @@ func TestReleaseAsset_GetBrowserDownloadURL(tt *testing.T) { } func TestReleaseAsset_GetContentType(tt *testing.T) { + tt.Parallel() var zeroValue string r := &ReleaseAsset{ContentType: &zeroValue} r.GetContentType() @@ -21423,6 +23735,7 @@ func TestReleaseAsset_GetContentType(tt *testing.T) { } func TestReleaseAsset_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp r := &ReleaseAsset{CreatedAt: &zeroValue} r.GetCreatedAt() @@ -21433,6 +23746,7 @@ func TestReleaseAsset_GetCreatedAt(tt *testing.T) { } func TestReleaseAsset_GetDownloadCount(tt *testing.T) { + tt.Parallel() var zeroValue int r := &ReleaseAsset{DownloadCount: &zeroValue} r.GetDownloadCount() @@ -21443,6 +23757,7 @@ func TestReleaseAsset_GetDownloadCount(tt *testing.T) { } func TestReleaseAsset_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 r := &ReleaseAsset{ID: &zeroValue} r.GetID() @@ -21453,6 +23768,7 @@ func TestReleaseAsset_GetID(tt *testing.T) { } func TestReleaseAsset_GetLabel(tt *testing.T) { + tt.Parallel() var zeroValue string r := &ReleaseAsset{Label: &zeroValue} r.GetLabel() @@ -21463,6 +23779,7 @@ func TestReleaseAsset_GetLabel(tt *testing.T) { } func TestReleaseAsset_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string r := &ReleaseAsset{Name: &zeroValue} r.GetName() @@ -21473,6 +23790,7 @@ func TestReleaseAsset_GetName(tt *testing.T) { } func TestReleaseAsset_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string r := &ReleaseAsset{NodeID: &zeroValue} r.GetNodeID() @@ -21483,6 +23801,7 @@ func TestReleaseAsset_GetNodeID(tt *testing.T) { } func TestReleaseAsset_GetSize(tt *testing.T) { + tt.Parallel() var zeroValue int r := &ReleaseAsset{Size: &zeroValue} r.GetSize() @@ -21493,6 +23812,7 @@ func TestReleaseAsset_GetSize(tt *testing.T) { } func TestReleaseAsset_GetState(tt *testing.T) { + tt.Parallel() var zeroValue string r := &ReleaseAsset{State: &zeroValue} r.GetState() @@ -21503,6 +23823,7 @@ func TestReleaseAsset_GetState(tt *testing.T) { } func TestReleaseAsset_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp r := &ReleaseAsset{UpdatedAt: &zeroValue} r.GetUpdatedAt() @@ -21513,6 +23834,7 @@ func TestReleaseAsset_GetUpdatedAt(tt *testing.T) { } func TestReleaseAsset_GetUploader(tt *testing.T) { + tt.Parallel() r := &ReleaseAsset{} r.GetUploader() r = nil @@ -21520,6 +23842,7 @@ func TestReleaseAsset_GetUploader(tt *testing.T) { } func TestReleaseAsset_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &ReleaseAsset{URL: &zeroValue} r.GetURL() @@ -21530,6 +23853,7 @@ func TestReleaseAsset_GetURL(tt *testing.T) { } func TestReleaseEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string r := &ReleaseEvent{Action: &zeroValue} r.GetAction() @@ -21540,6 +23864,7 @@ func TestReleaseEvent_GetAction(tt *testing.T) { } func TestReleaseEvent_GetInstallation(tt *testing.T) { + tt.Parallel() r := &ReleaseEvent{} r.GetInstallation() r = nil @@ -21547,6 +23872,7 @@ func TestReleaseEvent_GetInstallation(tt *testing.T) { } func TestReleaseEvent_GetOrg(tt *testing.T) { + tt.Parallel() r := &ReleaseEvent{} r.GetOrg() r = nil @@ -21554,6 +23880,7 @@ func TestReleaseEvent_GetOrg(tt *testing.T) { } func TestReleaseEvent_GetRelease(tt *testing.T) { + tt.Parallel() r := &ReleaseEvent{} r.GetRelease() r = nil @@ -21561,6 +23888,7 @@ func TestReleaseEvent_GetRelease(tt *testing.T) { } func TestReleaseEvent_GetRepo(tt *testing.T) { + tt.Parallel() r := &ReleaseEvent{} r.GetRepo() r = nil @@ -21568,6 +23896,7 @@ func TestReleaseEvent_GetRepo(tt *testing.T) { } func TestReleaseEvent_GetSender(tt *testing.T) { + tt.Parallel() r := &ReleaseEvent{} r.GetSender() r = nil @@ -21575,6 +23904,7 @@ func TestReleaseEvent_GetSender(tt *testing.T) { } func TestRemoveToken_GetExpiresAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp r := &RemoveToken{ExpiresAt: &zeroValue} r.GetExpiresAt() @@ -21585,6 +23915,7 @@ func TestRemoveToken_GetExpiresAt(tt *testing.T) { } func TestRemoveToken_GetToken(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RemoveToken{Token: &zeroValue} r.GetToken() @@ -21595,6 +23926,7 @@ func TestRemoveToken_GetToken(tt *testing.T) { } func TestRename_GetFrom(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Rename{From: &zeroValue} r.GetFrom() @@ -21605,6 +23937,7 @@ func TestRename_GetFrom(tt *testing.T) { } func TestRename_GetTo(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Rename{To: &zeroValue} r.GetTo() @@ -21615,6 +23948,7 @@ func TestRename_GetTo(tt *testing.T) { } func TestRenameOrgResponse_GetMessage(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RenameOrgResponse{Message: &zeroValue} r.GetMessage() @@ -21625,6 +23959,7 @@ func TestRenameOrgResponse_GetMessage(tt *testing.T) { } func TestRenameOrgResponse_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RenameOrgResponse{URL: &zeroValue} r.GetURL() @@ -21635,6 +23970,7 @@ func TestRenameOrgResponse_GetURL(tt *testing.T) { } func TestRepoAdvisoryCredit_GetLogin(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepoAdvisoryCredit{Login: &zeroValue} r.GetLogin() @@ -21645,6 +23981,7 @@ func TestRepoAdvisoryCredit_GetLogin(tt *testing.T) { } func TestRepoAdvisoryCredit_GetType(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepoAdvisoryCredit{Type: &zeroValue} r.GetType() @@ -21655,6 +23992,7 @@ func TestRepoAdvisoryCredit_GetType(tt *testing.T) { } func TestRepoAdvisoryCreditDetailed_GetState(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepoAdvisoryCreditDetailed{State: &zeroValue} r.GetState() @@ -21665,6 +24003,7 @@ func TestRepoAdvisoryCreditDetailed_GetState(tt *testing.T) { } func TestRepoAdvisoryCreditDetailed_GetType(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepoAdvisoryCreditDetailed{Type: &zeroValue} r.GetType() @@ -21675,6 +24014,7 @@ func TestRepoAdvisoryCreditDetailed_GetType(tt *testing.T) { } func TestRepoAdvisoryCreditDetailed_GetUser(tt *testing.T) { + tt.Parallel() r := &RepoAdvisoryCreditDetailed{} r.GetUser() r = nil @@ -21682,6 +24022,7 @@ func TestRepoAdvisoryCreditDetailed_GetUser(tt *testing.T) { } func TestRepoDependencies_GetDownloadLocation(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepoDependencies{DownloadLocation: &zeroValue} r.GetDownloadLocation() @@ -21692,6 +24033,7 @@ func TestRepoDependencies_GetDownloadLocation(tt *testing.T) { } func TestRepoDependencies_GetFilesAnalyzed(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &RepoDependencies{FilesAnalyzed: &zeroValue} r.GetFilesAnalyzed() @@ -21702,6 +24044,7 @@ func TestRepoDependencies_GetFilesAnalyzed(tt *testing.T) { } func TestRepoDependencies_GetLicenseConcluded(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepoDependencies{LicenseConcluded: &zeroValue} r.GetLicenseConcluded() @@ -21712,6 +24055,7 @@ func TestRepoDependencies_GetLicenseConcluded(tt *testing.T) { } func TestRepoDependencies_GetLicenseDeclared(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepoDependencies{LicenseDeclared: &zeroValue} r.GetLicenseDeclared() @@ -21722,6 +24066,7 @@ func TestRepoDependencies_GetLicenseDeclared(tt *testing.T) { } func TestRepoDependencies_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepoDependencies{Name: &zeroValue} r.GetName() @@ -21732,6 +24077,7 @@ func TestRepoDependencies_GetName(tt *testing.T) { } func TestRepoDependencies_GetSPDXID(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepoDependencies{SPDXID: &zeroValue} r.GetSPDXID() @@ -21742,6 +24088,7 @@ func TestRepoDependencies_GetSPDXID(tt *testing.T) { } func TestRepoDependencies_GetVersionInfo(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepoDependencies{VersionInfo: &zeroValue} r.GetVersionInfo() @@ -21752,6 +24099,7 @@ func TestRepoDependencies_GetVersionInfo(tt *testing.T) { } func TestRepoMergeUpstreamRequest_GetBranch(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepoMergeUpstreamRequest{Branch: &zeroValue} r.GetBranch() @@ -21762,6 +24110,7 @@ func TestRepoMergeUpstreamRequest_GetBranch(tt *testing.T) { } func TestRepoMergeUpstreamResult_GetBaseBranch(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepoMergeUpstreamResult{BaseBranch: &zeroValue} r.GetBaseBranch() @@ -21772,6 +24121,7 @@ func TestRepoMergeUpstreamResult_GetBaseBranch(tt *testing.T) { } func TestRepoMergeUpstreamResult_GetMergeType(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepoMergeUpstreamResult{MergeType: &zeroValue} r.GetMergeType() @@ -21782,6 +24132,7 @@ func TestRepoMergeUpstreamResult_GetMergeType(tt *testing.T) { } func TestRepoMergeUpstreamResult_GetMessage(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepoMergeUpstreamResult{Message: &zeroValue} r.GetMessage() @@ -21792,6 +24143,7 @@ func TestRepoMergeUpstreamResult_GetMessage(tt *testing.T) { } func TestRepoName_GetFrom(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepoName{From: &zeroValue} r.GetFrom() @@ -21802,6 +24154,7 @@ func TestRepoName_GetFrom(tt *testing.T) { } func TestRepoRequiredWorkflow_GetBadgeURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepoRequiredWorkflow{BadgeURL: &zeroValue} r.GetBadgeURL() @@ -21812,6 +24165,7 @@ func TestRepoRequiredWorkflow_GetBadgeURL(tt *testing.T) { } func TestRepoRequiredWorkflow_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp r := &RepoRequiredWorkflow{CreatedAt: &zeroValue} r.GetCreatedAt() @@ -21822,6 +24176,7 @@ func TestRepoRequiredWorkflow_GetCreatedAt(tt *testing.T) { } func TestRepoRequiredWorkflow_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepoRequiredWorkflow{HTMLURL: &zeroValue} r.GetHTMLURL() @@ -21832,6 +24187,7 @@ func TestRepoRequiredWorkflow_GetHTMLURL(tt *testing.T) { } func TestRepoRequiredWorkflow_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 r := &RepoRequiredWorkflow{ID: &zeroValue} r.GetID() @@ -21842,6 +24198,7 @@ func TestRepoRequiredWorkflow_GetID(tt *testing.T) { } func TestRepoRequiredWorkflow_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepoRequiredWorkflow{Name: &zeroValue} r.GetName() @@ -21852,6 +24209,7 @@ func TestRepoRequiredWorkflow_GetName(tt *testing.T) { } func TestRepoRequiredWorkflow_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepoRequiredWorkflow{NodeID: &zeroValue} r.GetNodeID() @@ -21862,6 +24220,7 @@ func TestRepoRequiredWorkflow_GetNodeID(tt *testing.T) { } func TestRepoRequiredWorkflow_GetPath(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepoRequiredWorkflow{Path: &zeroValue} r.GetPath() @@ -21872,6 +24231,7 @@ func TestRepoRequiredWorkflow_GetPath(tt *testing.T) { } func TestRepoRequiredWorkflow_GetSourceRepository(tt *testing.T) { + tt.Parallel() r := &RepoRequiredWorkflow{} r.GetSourceRepository() r = nil @@ -21879,6 +24239,7 @@ func TestRepoRequiredWorkflow_GetSourceRepository(tt *testing.T) { } func TestRepoRequiredWorkflow_GetState(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepoRequiredWorkflow{State: &zeroValue} r.GetState() @@ -21889,6 +24250,7 @@ func TestRepoRequiredWorkflow_GetState(tt *testing.T) { } func TestRepoRequiredWorkflow_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp r := &RepoRequiredWorkflow{UpdatedAt: &zeroValue} r.GetUpdatedAt() @@ -21899,6 +24261,7 @@ func TestRepoRequiredWorkflow_GetUpdatedAt(tt *testing.T) { } func TestRepoRequiredWorkflow_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepoRequiredWorkflow{URL: &zeroValue} r.GetURL() @@ -21909,6 +24272,7 @@ func TestRepoRequiredWorkflow_GetURL(tt *testing.T) { } func TestRepoRequiredWorkflows_GetTotalCount(tt *testing.T) { + tt.Parallel() var zeroValue int r := &RepoRequiredWorkflows{TotalCount: &zeroValue} r.GetTotalCount() @@ -21919,6 +24283,7 @@ func TestRepoRequiredWorkflows_GetTotalCount(tt *testing.T) { } func TestRepositoriesSearchResult_GetIncompleteResults(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &RepositoriesSearchResult{IncompleteResults: &zeroValue} r.GetIncompleteResults() @@ -21929,6 +24294,7 @@ func TestRepositoriesSearchResult_GetIncompleteResults(tt *testing.T) { } func TestRepositoriesSearchResult_GetTotal(tt *testing.T) { + tt.Parallel() var zeroValue int r := &RepositoriesSearchResult{Total: &zeroValue} r.GetTotal() @@ -21939,6 +24305,7 @@ func TestRepositoriesSearchResult_GetTotal(tt *testing.T) { } func TestRepository_GetAllowAutoMerge(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &Repository{AllowAutoMerge: &zeroValue} r.GetAllowAutoMerge() @@ -21949,6 +24316,7 @@ func TestRepository_GetAllowAutoMerge(tt *testing.T) { } func TestRepository_GetAllowForking(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &Repository{AllowForking: &zeroValue} r.GetAllowForking() @@ -21959,6 +24327,7 @@ func TestRepository_GetAllowForking(tt *testing.T) { } func TestRepository_GetAllowMergeCommit(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &Repository{AllowMergeCommit: &zeroValue} r.GetAllowMergeCommit() @@ -21969,6 +24338,7 @@ func TestRepository_GetAllowMergeCommit(tt *testing.T) { } func TestRepository_GetAllowRebaseMerge(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &Repository{AllowRebaseMerge: &zeroValue} r.GetAllowRebaseMerge() @@ -21979,6 +24349,7 @@ func TestRepository_GetAllowRebaseMerge(tt *testing.T) { } func TestRepository_GetAllowSquashMerge(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &Repository{AllowSquashMerge: &zeroValue} r.GetAllowSquashMerge() @@ -21989,6 +24360,7 @@ func TestRepository_GetAllowSquashMerge(tt *testing.T) { } func TestRepository_GetAllowUpdateBranch(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &Repository{AllowUpdateBranch: &zeroValue} r.GetAllowUpdateBranch() @@ -21999,6 +24371,7 @@ func TestRepository_GetAllowUpdateBranch(tt *testing.T) { } func TestRepository_GetArchived(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &Repository{Archived: &zeroValue} r.GetArchived() @@ -22009,6 +24382,7 @@ func TestRepository_GetArchived(tt *testing.T) { } func TestRepository_GetArchiveURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{ArchiveURL: &zeroValue} r.GetArchiveURL() @@ -22019,6 +24393,7 @@ func TestRepository_GetArchiveURL(tt *testing.T) { } func TestRepository_GetAssigneesURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{AssigneesURL: &zeroValue} r.GetAssigneesURL() @@ -22029,6 +24404,7 @@ func TestRepository_GetAssigneesURL(tt *testing.T) { } func TestRepository_GetAutoInit(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &Repository{AutoInit: &zeroValue} r.GetAutoInit() @@ -22039,6 +24415,7 @@ func TestRepository_GetAutoInit(tt *testing.T) { } func TestRepository_GetBlobsURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{BlobsURL: &zeroValue} r.GetBlobsURL() @@ -22049,6 +24426,7 @@ func TestRepository_GetBlobsURL(tt *testing.T) { } func TestRepository_GetBranchesURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{BranchesURL: &zeroValue} r.GetBranchesURL() @@ -22059,6 +24437,7 @@ func TestRepository_GetBranchesURL(tt *testing.T) { } func TestRepository_GetCloneURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{CloneURL: &zeroValue} r.GetCloneURL() @@ -22069,6 +24448,7 @@ func TestRepository_GetCloneURL(tt *testing.T) { } func TestRepository_GetCodeOfConduct(tt *testing.T) { + tt.Parallel() r := &Repository{} r.GetCodeOfConduct() r = nil @@ -22076,6 +24456,7 @@ func TestRepository_GetCodeOfConduct(tt *testing.T) { } func TestRepository_GetCollaboratorsURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{CollaboratorsURL: &zeroValue} r.GetCollaboratorsURL() @@ -22086,6 +24467,7 @@ func TestRepository_GetCollaboratorsURL(tt *testing.T) { } func TestRepository_GetCommentsURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{CommentsURL: &zeroValue} r.GetCommentsURL() @@ -22096,6 +24478,7 @@ func TestRepository_GetCommentsURL(tt *testing.T) { } func TestRepository_GetCommitsURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{CommitsURL: &zeroValue} r.GetCommitsURL() @@ -22106,6 +24489,7 @@ func TestRepository_GetCommitsURL(tt *testing.T) { } func TestRepository_GetCompareURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{CompareURL: &zeroValue} r.GetCompareURL() @@ -22116,6 +24500,7 @@ func TestRepository_GetCompareURL(tt *testing.T) { } func TestRepository_GetContentsURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{ContentsURL: &zeroValue} r.GetContentsURL() @@ -22126,6 +24511,7 @@ func TestRepository_GetContentsURL(tt *testing.T) { } func TestRepository_GetContributorsURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{ContributorsURL: &zeroValue} r.GetContributorsURL() @@ -22136,6 +24522,7 @@ func TestRepository_GetContributorsURL(tt *testing.T) { } func TestRepository_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp r := &Repository{CreatedAt: &zeroValue} r.GetCreatedAt() @@ -22146,6 +24533,7 @@ func TestRepository_GetCreatedAt(tt *testing.T) { } func TestRepository_GetDefaultBranch(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{DefaultBranch: &zeroValue} r.GetDefaultBranch() @@ -22156,6 +24544,7 @@ func TestRepository_GetDefaultBranch(tt *testing.T) { } func TestRepository_GetDeleteBranchOnMerge(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &Repository{DeleteBranchOnMerge: &zeroValue} r.GetDeleteBranchOnMerge() @@ -22166,6 +24555,7 @@ func TestRepository_GetDeleteBranchOnMerge(tt *testing.T) { } func TestRepository_GetDeploymentsURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{DeploymentsURL: &zeroValue} r.GetDeploymentsURL() @@ -22176,6 +24566,7 @@ func TestRepository_GetDeploymentsURL(tt *testing.T) { } func TestRepository_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{Description: &zeroValue} r.GetDescription() @@ -22186,6 +24577,7 @@ func TestRepository_GetDescription(tt *testing.T) { } func TestRepository_GetDisabled(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &Repository{Disabled: &zeroValue} r.GetDisabled() @@ -22196,6 +24588,7 @@ func TestRepository_GetDisabled(tt *testing.T) { } func TestRepository_GetDownloadsURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{DownloadsURL: &zeroValue} r.GetDownloadsURL() @@ -22206,6 +24599,7 @@ func TestRepository_GetDownloadsURL(tt *testing.T) { } func TestRepository_GetEventsURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{EventsURL: &zeroValue} r.GetEventsURL() @@ -22216,6 +24610,7 @@ func TestRepository_GetEventsURL(tt *testing.T) { } func TestRepository_GetFork(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &Repository{Fork: &zeroValue} r.GetFork() @@ -22226,6 +24621,7 @@ func TestRepository_GetFork(tt *testing.T) { } func TestRepository_GetForksCount(tt *testing.T) { + tt.Parallel() var zeroValue int r := &Repository{ForksCount: &zeroValue} r.GetForksCount() @@ -22236,6 +24632,7 @@ func TestRepository_GetForksCount(tt *testing.T) { } func TestRepository_GetForksURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{ForksURL: &zeroValue} r.GetForksURL() @@ -22246,6 +24643,7 @@ func TestRepository_GetForksURL(tt *testing.T) { } func TestRepository_GetFullName(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{FullName: &zeroValue} r.GetFullName() @@ -22256,6 +24654,7 @@ func TestRepository_GetFullName(tt *testing.T) { } func TestRepository_GetGitCommitsURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{GitCommitsURL: &zeroValue} r.GetGitCommitsURL() @@ -22266,6 +24665,7 @@ func TestRepository_GetGitCommitsURL(tt *testing.T) { } func TestRepository_GetGitignoreTemplate(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{GitignoreTemplate: &zeroValue} r.GetGitignoreTemplate() @@ -22276,6 +24676,7 @@ func TestRepository_GetGitignoreTemplate(tt *testing.T) { } func TestRepository_GetGitRefsURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{GitRefsURL: &zeroValue} r.GetGitRefsURL() @@ -22286,6 +24687,7 @@ func TestRepository_GetGitRefsURL(tt *testing.T) { } func TestRepository_GetGitTagsURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{GitTagsURL: &zeroValue} r.GetGitTagsURL() @@ -22296,6 +24698,7 @@ func TestRepository_GetGitTagsURL(tt *testing.T) { } func TestRepository_GetGitURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{GitURL: &zeroValue} r.GetGitURL() @@ -22306,6 +24709,7 @@ func TestRepository_GetGitURL(tt *testing.T) { } func TestRepository_GetHasDiscussions(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &Repository{HasDiscussions: &zeroValue} r.GetHasDiscussions() @@ -22316,6 +24720,7 @@ func TestRepository_GetHasDiscussions(tt *testing.T) { } func TestRepository_GetHasDownloads(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &Repository{HasDownloads: &zeroValue} r.GetHasDownloads() @@ -22326,6 +24731,7 @@ func TestRepository_GetHasDownloads(tt *testing.T) { } func TestRepository_GetHasIssues(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &Repository{HasIssues: &zeroValue} r.GetHasIssues() @@ -22336,6 +24742,7 @@ func TestRepository_GetHasIssues(tt *testing.T) { } func TestRepository_GetHasPages(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &Repository{HasPages: &zeroValue} r.GetHasPages() @@ -22346,6 +24753,7 @@ func TestRepository_GetHasPages(tt *testing.T) { } func TestRepository_GetHasProjects(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &Repository{HasProjects: &zeroValue} r.GetHasProjects() @@ -22356,6 +24764,7 @@ func TestRepository_GetHasProjects(tt *testing.T) { } func TestRepository_GetHasWiki(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &Repository{HasWiki: &zeroValue} r.GetHasWiki() @@ -22366,6 +24775,7 @@ func TestRepository_GetHasWiki(tt *testing.T) { } func TestRepository_GetHomepage(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{Homepage: &zeroValue} r.GetHomepage() @@ -22376,6 +24786,7 @@ func TestRepository_GetHomepage(tt *testing.T) { } func TestRepository_GetHooksURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{HooksURL: &zeroValue} r.GetHooksURL() @@ -22386,6 +24797,7 @@ func TestRepository_GetHooksURL(tt *testing.T) { } func TestRepository_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{HTMLURL: &zeroValue} r.GetHTMLURL() @@ -22396,6 +24808,7 @@ func TestRepository_GetHTMLURL(tt *testing.T) { } func TestRepository_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 r := &Repository{ID: &zeroValue} r.GetID() @@ -22406,6 +24819,7 @@ func TestRepository_GetID(tt *testing.T) { } func TestRepository_GetIssueCommentURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{IssueCommentURL: &zeroValue} r.GetIssueCommentURL() @@ -22416,6 +24830,7 @@ func TestRepository_GetIssueCommentURL(tt *testing.T) { } func TestRepository_GetIssueEventsURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{IssueEventsURL: &zeroValue} r.GetIssueEventsURL() @@ -22426,6 +24841,7 @@ func TestRepository_GetIssueEventsURL(tt *testing.T) { } func TestRepository_GetIssuesURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{IssuesURL: &zeroValue} r.GetIssuesURL() @@ -22436,6 +24852,7 @@ func TestRepository_GetIssuesURL(tt *testing.T) { } func TestRepository_GetIsTemplate(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &Repository{IsTemplate: &zeroValue} r.GetIsTemplate() @@ -22446,6 +24863,7 @@ func TestRepository_GetIsTemplate(tt *testing.T) { } func TestRepository_GetKeysURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{KeysURL: &zeroValue} r.GetKeysURL() @@ -22456,6 +24874,7 @@ func TestRepository_GetKeysURL(tt *testing.T) { } func TestRepository_GetLabelsURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{LabelsURL: &zeroValue} r.GetLabelsURL() @@ -22466,6 +24885,7 @@ func TestRepository_GetLabelsURL(tt *testing.T) { } func TestRepository_GetLanguage(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{Language: &zeroValue} r.GetLanguage() @@ -22476,6 +24896,7 @@ func TestRepository_GetLanguage(tt *testing.T) { } func TestRepository_GetLanguagesURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{LanguagesURL: &zeroValue} r.GetLanguagesURL() @@ -22486,6 +24907,7 @@ func TestRepository_GetLanguagesURL(tt *testing.T) { } func TestRepository_GetLicense(tt *testing.T) { + tt.Parallel() r := &Repository{} r.GetLicense() r = nil @@ -22493,6 +24915,7 @@ func TestRepository_GetLicense(tt *testing.T) { } func TestRepository_GetLicenseTemplate(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{LicenseTemplate: &zeroValue} r.GetLicenseTemplate() @@ -22503,6 +24926,7 @@ func TestRepository_GetLicenseTemplate(tt *testing.T) { } func TestRepository_GetMasterBranch(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{MasterBranch: &zeroValue} r.GetMasterBranch() @@ -22513,6 +24937,7 @@ func TestRepository_GetMasterBranch(tt *testing.T) { } func TestRepository_GetMergeCommitMessage(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{MergeCommitMessage: &zeroValue} r.GetMergeCommitMessage() @@ -22523,6 +24948,7 @@ func TestRepository_GetMergeCommitMessage(tt *testing.T) { } func TestRepository_GetMergeCommitTitle(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{MergeCommitTitle: &zeroValue} r.GetMergeCommitTitle() @@ -22533,6 +24959,7 @@ func TestRepository_GetMergeCommitTitle(tt *testing.T) { } func TestRepository_GetMergesURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{MergesURL: &zeroValue} r.GetMergesURL() @@ -22543,6 +24970,7 @@ func TestRepository_GetMergesURL(tt *testing.T) { } func TestRepository_GetMilestonesURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{MilestonesURL: &zeroValue} r.GetMilestonesURL() @@ -22553,6 +24981,7 @@ func TestRepository_GetMilestonesURL(tt *testing.T) { } func TestRepository_GetMirrorURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{MirrorURL: &zeroValue} r.GetMirrorURL() @@ -22563,6 +24992,7 @@ func TestRepository_GetMirrorURL(tt *testing.T) { } func TestRepository_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{Name: &zeroValue} r.GetName() @@ -22573,6 +25003,7 @@ func TestRepository_GetName(tt *testing.T) { } func TestRepository_GetNetworkCount(tt *testing.T) { + tt.Parallel() var zeroValue int r := &Repository{NetworkCount: &zeroValue} r.GetNetworkCount() @@ -22583,6 +25014,7 @@ func TestRepository_GetNetworkCount(tt *testing.T) { } func TestRepository_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{NodeID: &zeroValue} r.GetNodeID() @@ -22593,6 +25025,7 @@ func TestRepository_GetNodeID(tt *testing.T) { } func TestRepository_GetNotificationsURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{NotificationsURL: &zeroValue} r.GetNotificationsURL() @@ -22603,6 +25036,7 @@ func TestRepository_GetNotificationsURL(tt *testing.T) { } func TestRepository_GetOpenIssues(tt *testing.T) { + tt.Parallel() var zeroValue int r := &Repository{OpenIssues: &zeroValue} r.GetOpenIssues() @@ -22613,6 +25047,7 @@ func TestRepository_GetOpenIssues(tt *testing.T) { } func TestRepository_GetOpenIssuesCount(tt *testing.T) { + tt.Parallel() var zeroValue int r := &Repository{OpenIssuesCount: &zeroValue} r.GetOpenIssuesCount() @@ -22623,6 +25058,7 @@ func TestRepository_GetOpenIssuesCount(tt *testing.T) { } func TestRepository_GetOrganization(tt *testing.T) { + tt.Parallel() r := &Repository{} r.GetOrganization() r = nil @@ -22630,6 +25066,7 @@ func TestRepository_GetOrganization(tt *testing.T) { } func TestRepository_GetOwner(tt *testing.T) { + tt.Parallel() r := &Repository{} r.GetOwner() r = nil @@ -22637,6 +25074,7 @@ func TestRepository_GetOwner(tt *testing.T) { } func TestRepository_GetParent(tt *testing.T) { + tt.Parallel() r := &Repository{} r.GetParent() r = nil @@ -22644,6 +25082,7 @@ func TestRepository_GetParent(tt *testing.T) { } func TestRepository_GetPermissions(tt *testing.T) { + tt.Parallel() zeroValue := map[string]bool{} r := &Repository{Permissions: zeroValue} r.GetPermissions() @@ -22654,6 +25093,7 @@ func TestRepository_GetPermissions(tt *testing.T) { } func TestRepository_GetPrivate(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &Repository{Private: &zeroValue} r.GetPrivate() @@ -22664,6 +25104,7 @@ func TestRepository_GetPrivate(tt *testing.T) { } func TestRepository_GetPullsURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{PullsURL: &zeroValue} r.GetPullsURL() @@ -22674,6 +25115,7 @@ func TestRepository_GetPullsURL(tt *testing.T) { } func TestRepository_GetPushedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp r := &Repository{PushedAt: &zeroValue} r.GetPushedAt() @@ -22684,6 +25126,7 @@ func TestRepository_GetPushedAt(tt *testing.T) { } func TestRepository_GetReleasesURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{ReleasesURL: &zeroValue} r.GetReleasesURL() @@ -22694,6 +25137,7 @@ func TestRepository_GetReleasesURL(tt *testing.T) { } func TestRepository_GetRoleName(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{RoleName: &zeroValue} r.GetRoleName() @@ -22704,6 +25148,7 @@ func TestRepository_GetRoleName(tt *testing.T) { } func TestRepository_GetSecurityAndAnalysis(tt *testing.T) { + tt.Parallel() r := &Repository{} r.GetSecurityAndAnalysis() r = nil @@ -22711,6 +25156,7 @@ func TestRepository_GetSecurityAndAnalysis(tt *testing.T) { } func TestRepository_GetSize(tt *testing.T) { + tt.Parallel() var zeroValue int r := &Repository{Size: &zeroValue} r.GetSize() @@ -22721,6 +25167,7 @@ func TestRepository_GetSize(tt *testing.T) { } func TestRepository_GetSource(tt *testing.T) { + tt.Parallel() r := &Repository{} r.GetSource() r = nil @@ -22728,6 +25175,7 @@ func TestRepository_GetSource(tt *testing.T) { } func TestRepository_GetSquashMergeCommitMessage(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{SquashMergeCommitMessage: &zeroValue} r.GetSquashMergeCommitMessage() @@ -22738,6 +25186,7 @@ func TestRepository_GetSquashMergeCommitMessage(tt *testing.T) { } func TestRepository_GetSquashMergeCommitTitle(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{SquashMergeCommitTitle: &zeroValue} r.GetSquashMergeCommitTitle() @@ -22748,6 +25197,7 @@ func TestRepository_GetSquashMergeCommitTitle(tt *testing.T) { } func TestRepository_GetSSHURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{SSHURL: &zeroValue} r.GetSSHURL() @@ -22758,6 +25208,7 @@ func TestRepository_GetSSHURL(tt *testing.T) { } func TestRepository_GetStargazersCount(tt *testing.T) { + tt.Parallel() var zeroValue int r := &Repository{StargazersCount: &zeroValue} r.GetStargazersCount() @@ -22768,6 +25219,7 @@ func TestRepository_GetStargazersCount(tt *testing.T) { } func TestRepository_GetStargazersURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{StargazersURL: &zeroValue} r.GetStargazersURL() @@ -22778,6 +25230,7 @@ func TestRepository_GetStargazersURL(tt *testing.T) { } func TestRepository_GetStatusesURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{StatusesURL: &zeroValue} r.GetStatusesURL() @@ -22788,6 +25241,7 @@ func TestRepository_GetStatusesURL(tt *testing.T) { } func TestRepository_GetSubscribersCount(tt *testing.T) { + tt.Parallel() var zeroValue int r := &Repository{SubscribersCount: &zeroValue} r.GetSubscribersCount() @@ -22798,6 +25252,7 @@ func TestRepository_GetSubscribersCount(tt *testing.T) { } func TestRepository_GetSubscribersURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{SubscribersURL: &zeroValue} r.GetSubscribersURL() @@ -22808,6 +25263,7 @@ func TestRepository_GetSubscribersURL(tt *testing.T) { } func TestRepository_GetSubscriptionURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{SubscriptionURL: &zeroValue} r.GetSubscriptionURL() @@ -22818,6 +25274,7 @@ func TestRepository_GetSubscriptionURL(tt *testing.T) { } func TestRepository_GetSVNURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{SVNURL: &zeroValue} r.GetSVNURL() @@ -22828,6 +25285,7 @@ func TestRepository_GetSVNURL(tt *testing.T) { } func TestRepository_GetTagsURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{TagsURL: &zeroValue} r.GetTagsURL() @@ -22838,6 +25296,7 @@ func TestRepository_GetTagsURL(tt *testing.T) { } func TestRepository_GetTeamID(tt *testing.T) { + tt.Parallel() var zeroValue int64 r := &Repository{TeamID: &zeroValue} r.GetTeamID() @@ -22848,6 +25307,7 @@ func TestRepository_GetTeamID(tt *testing.T) { } func TestRepository_GetTeamsURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{TeamsURL: &zeroValue} r.GetTeamsURL() @@ -22858,6 +25318,7 @@ func TestRepository_GetTeamsURL(tt *testing.T) { } func TestRepository_GetTemplateRepository(tt *testing.T) { + tt.Parallel() r := &Repository{} r.GetTemplateRepository() r = nil @@ -22865,6 +25326,7 @@ func TestRepository_GetTemplateRepository(tt *testing.T) { } func TestRepository_GetTreesURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{TreesURL: &zeroValue} r.GetTreesURL() @@ -22875,6 +25337,7 @@ func TestRepository_GetTreesURL(tt *testing.T) { } func TestRepository_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp r := &Repository{UpdatedAt: &zeroValue} r.GetUpdatedAt() @@ -22885,6 +25348,7 @@ func TestRepository_GetUpdatedAt(tt *testing.T) { } func TestRepository_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{URL: &zeroValue} r.GetURL() @@ -22895,6 +25359,7 @@ func TestRepository_GetURL(tt *testing.T) { } func TestRepository_GetUseSquashPRTitleAsDefault(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &Repository{UseSquashPRTitleAsDefault: &zeroValue} r.GetUseSquashPRTitleAsDefault() @@ -22905,6 +25370,7 @@ func TestRepository_GetUseSquashPRTitleAsDefault(tt *testing.T) { } func TestRepository_GetVisibility(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Repository{Visibility: &zeroValue} r.GetVisibility() @@ -22915,6 +25381,7 @@ func TestRepository_GetVisibility(tt *testing.T) { } func TestRepository_GetWatchers(tt *testing.T) { + tt.Parallel() var zeroValue int r := &Repository{Watchers: &zeroValue} r.GetWatchers() @@ -22925,6 +25392,7 @@ func TestRepository_GetWatchers(tt *testing.T) { } func TestRepository_GetWatchersCount(tt *testing.T) { + tt.Parallel() var zeroValue int r := &Repository{WatchersCount: &zeroValue} r.GetWatchersCount() @@ -22935,6 +25403,7 @@ func TestRepository_GetWatchersCount(tt *testing.T) { } func TestRepository_GetWebCommitSignoffRequired(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &Repository{WebCommitSignoffRequired: &zeroValue} r.GetWebCommitSignoffRequired() @@ -22945,6 +25414,7 @@ func TestRepository_GetWebCommitSignoffRequired(tt *testing.T) { } func TestRepositoryActionsAccessLevel_GetAccessLevel(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryActionsAccessLevel{AccessLevel: &zeroValue} r.GetAccessLevel() @@ -22955,6 +25425,7 @@ func TestRepositoryActionsAccessLevel_GetAccessLevel(tt *testing.T) { } func TestRepositoryActiveCommitters_GetAdvancedSecurityCommitters(tt *testing.T) { + tt.Parallel() var zeroValue int r := &RepositoryActiveCommitters{AdvancedSecurityCommitters: &zeroValue} r.GetAdvancedSecurityCommitters() @@ -22965,6 +25436,7 @@ func TestRepositoryActiveCommitters_GetAdvancedSecurityCommitters(tt *testing.T) } func TestRepositoryActiveCommitters_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryActiveCommitters{Name: &zeroValue} r.GetName() @@ -22975,6 +25447,7 @@ func TestRepositoryActiveCommitters_GetName(tt *testing.T) { } func TestRepositoryComment_GetBody(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryComment{Body: &zeroValue} r.GetBody() @@ -22985,6 +25458,7 @@ func TestRepositoryComment_GetBody(tt *testing.T) { } func TestRepositoryComment_GetCommitID(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryComment{CommitID: &zeroValue} r.GetCommitID() @@ -22995,6 +25469,7 @@ func TestRepositoryComment_GetCommitID(tt *testing.T) { } func TestRepositoryComment_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp r := &RepositoryComment{CreatedAt: &zeroValue} r.GetCreatedAt() @@ -23005,6 +25480,7 @@ func TestRepositoryComment_GetCreatedAt(tt *testing.T) { } func TestRepositoryComment_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryComment{HTMLURL: &zeroValue} r.GetHTMLURL() @@ -23015,6 +25491,7 @@ func TestRepositoryComment_GetHTMLURL(tt *testing.T) { } func TestRepositoryComment_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 r := &RepositoryComment{ID: &zeroValue} r.GetID() @@ -23025,6 +25502,7 @@ func TestRepositoryComment_GetID(tt *testing.T) { } func TestRepositoryComment_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryComment{NodeID: &zeroValue} r.GetNodeID() @@ -23035,6 +25513,7 @@ func TestRepositoryComment_GetNodeID(tt *testing.T) { } func TestRepositoryComment_GetPath(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryComment{Path: &zeroValue} r.GetPath() @@ -23045,6 +25524,7 @@ func TestRepositoryComment_GetPath(tt *testing.T) { } func TestRepositoryComment_GetPosition(tt *testing.T) { + tt.Parallel() var zeroValue int r := &RepositoryComment{Position: &zeroValue} r.GetPosition() @@ -23055,6 +25535,7 @@ func TestRepositoryComment_GetPosition(tt *testing.T) { } func TestRepositoryComment_GetReactions(tt *testing.T) { + tt.Parallel() r := &RepositoryComment{} r.GetReactions() r = nil @@ -23062,6 +25543,7 @@ func TestRepositoryComment_GetReactions(tt *testing.T) { } func TestRepositoryComment_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp r := &RepositoryComment{UpdatedAt: &zeroValue} r.GetUpdatedAt() @@ -23072,6 +25554,7 @@ func TestRepositoryComment_GetUpdatedAt(tt *testing.T) { } func TestRepositoryComment_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryComment{URL: &zeroValue} r.GetURL() @@ -23082,6 +25565,7 @@ func TestRepositoryComment_GetURL(tt *testing.T) { } func TestRepositoryComment_GetUser(tt *testing.T) { + tt.Parallel() r := &RepositoryComment{} r.GetUser() r = nil @@ -23089,6 +25573,7 @@ func TestRepositoryComment_GetUser(tt *testing.T) { } func TestRepositoryCommit_GetAuthor(tt *testing.T) { + tt.Parallel() r := &RepositoryCommit{} r.GetAuthor() r = nil @@ -23096,6 +25581,7 @@ func TestRepositoryCommit_GetAuthor(tt *testing.T) { } func TestRepositoryCommit_GetCommentsURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryCommit{CommentsURL: &zeroValue} r.GetCommentsURL() @@ -23106,6 +25592,7 @@ func TestRepositoryCommit_GetCommentsURL(tt *testing.T) { } func TestRepositoryCommit_GetCommit(tt *testing.T) { + tt.Parallel() r := &RepositoryCommit{} r.GetCommit() r = nil @@ -23113,6 +25600,7 @@ func TestRepositoryCommit_GetCommit(tt *testing.T) { } func TestRepositoryCommit_GetCommitter(tt *testing.T) { + tt.Parallel() r := &RepositoryCommit{} r.GetCommitter() r = nil @@ -23120,6 +25608,7 @@ func TestRepositoryCommit_GetCommitter(tt *testing.T) { } func TestRepositoryCommit_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryCommit{HTMLURL: &zeroValue} r.GetHTMLURL() @@ -23130,6 +25619,7 @@ func TestRepositoryCommit_GetHTMLURL(tt *testing.T) { } func TestRepositoryCommit_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryCommit{NodeID: &zeroValue} r.GetNodeID() @@ -23140,6 +25630,7 @@ func TestRepositoryCommit_GetNodeID(tt *testing.T) { } func TestRepositoryCommit_GetSHA(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryCommit{SHA: &zeroValue} r.GetSHA() @@ -23150,6 +25641,7 @@ func TestRepositoryCommit_GetSHA(tt *testing.T) { } func TestRepositoryCommit_GetStats(tt *testing.T) { + tt.Parallel() r := &RepositoryCommit{} r.GetStats() r = nil @@ -23157,6 +25649,7 @@ func TestRepositoryCommit_GetStats(tt *testing.T) { } func TestRepositoryCommit_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryCommit{URL: &zeroValue} r.GetURL() @@ -23167,6 +25660,7 @@ func TestRepositoryCommit_GetURL(tt *testing.T) { } func TestRepositoryContent_GetDownloadURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryContent{DownloadURL: &zeroValue} r.GetDownloadURL() @@ -23177,6 +25671,7 @@ func TestRepositoryContent_GetDownloadURL(tt *testing.T) { } func TestRepositoryContent_GetEncoding(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryContent{Encoding: &zeroValue} r.GetEncoding() @@ -23187,6 +25682,7 @@ func TestRepositoryContent_GetEncoding(tt *testing.T) { } func TestRepositoryContent_GetGitURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryContent{GitURL: &zeroValue} r.GetGitURL() @@ -23197,6 +25693,7 @@ func TestRepositoryContent_GetGitURL(tt *testing.T) { } func TestRepositoryContent_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryContent{HTMLURL: &zeroValue} r.GetHTMLURL() @@ -23207,6 +25704,7 @@ func TestRepositoryContent_GetHTMLURL(tt *testing.T) { } func TestRepositoryContent_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryContent{Name: &zeroValue} r.GetName() @@ -23217,6 +25715,7 @@ func TestRepositoryContent_GetName(tt *testing.T) { } func TestRepositoryContent_GetPath(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryContent{Path: &zeroValue} r.GetPath() @@ -23227,6 +25726,7 @@ func TestRepositoryContent_GetPath(tt *testing.T) { } func TestRepositoryContent_GetSHA(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryContent{SHA: &zeroValue} r.GetSHA() @@ -23237,6 +25737,7 @@ func TestRepositoryContent_GetSHA(tt *testing.T) { } func TestRepositoryContent_GetSize(tt *testing.T) { + tt.Parallel() var zeroValue int r := &RepositoryContent{Size: &zeroValue} r.GetSize() @@ -23247,6 +25748,7 @@ func TestRepositoryContent_GetSize(tt *testing.T) { } func TestRepositoryContent_GetSubmoduleGitURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryContent{SubmoduleGitURL: &zeroValue} r.GetSubmoduleGitURL() @@ -23257,6 +25759,7 @@ func TestRepositoryContent_GetSubmoduleGitURL(tt *testing.T) { } func TestRepositoryContent_GetTarget(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryContent{Target: &zeroValue} r.GetTarget() @@ -23267,6 +25770,7 @@ func TestRepositoryContent_GetTarget(tt *testing.T) { } func TestRepositoryContent_GetType(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryContent{Type: &zeroValue} r.GetType() @@ -23277,6 +25781,7 @@ func TestRepositoryContent_GetType(tt *testing.T) { } func TestRepositoryContent_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryContent{URL: &zeroValue} r.GetURL() @@ -23287,6 +25792,7 @@ func TestRepositoryContent_GetURL(tt *testing.T) { } func TestRepositoryContentFileOptions_GetAuthor(tt *testing.T) { + tt.Parallel() r := &RepositoryContentFileOptions{} r.GetAuthor() r = nil @@ -23294,6 +25800,7 @@ func TestRepositoryContentFileOptions_GetAuthor(tt *testing.T) { } func TestRepositoryContentFileOptions_GetBranch(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryContentFileOptions{Branch: &zeroValue} r.GetBranch() @@ -23304,6 +25811,7 @@ func TestRepositoryContentFileOptions_GetBranch(tt *testing.T) { } func TestRepositoryContentFileOptions_GetCommitter(tt *testing.T) { + tt.Parallel() r := &RepositoryContentFileOptions{} r.GetCommitter() r = nil @@ -23311,6 +25819,7 @@ func TestRepositoryContentFileOptions_GetCommitter(tt *testing.T) { } func TestRepositoryContentFileOptions_GetMessage(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryContentFileOptions{Message: &zeroValue} r.GetMessage() @@ -23321,6 +25830,7 @@ func TestRepositoryContentFileOptions_GetMessage(tt *testing.T) { } func TestRepositoryContentFileOptions_GetSHA(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryContentFileOptions{SHA: &zeroValue} r.GetSHA() @@ -23331,6 +25841,7 @@ func TestRepositoryContentFileOptions_GetSHA(tt *testing.T) { } func TestRepositoryContentResponse_GetContent(tt *testing.T) { + tt.Parallel() r := &RepositoryContentResponse{} r.GetContent() r = nil @@ -23338,6 +25849,7 @@ func TestRepositoryContentResponse_GetContent(tt *testing.T) { } func TestRepositoryDispatchEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryDispatchEvent{Action: &zeroValue} r.GetAction() @@ -23348,6 +25860,7 @@ func TestRepositoryDispatchEvent_GetAction(tt *testing.T) { } func TestRepositoryDispatchEvent_GetBranch(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryDispatchEvent{Branch: &zeroValue} r.GetBranch() @@ -23358,6 +25871,7 @@ func TestRepositoryDispatchEvent_GetBranch(tt *testing.T) { } func TestRepositoryDispatchEvent_GetInstallation(tt *testing.T) { + tt.Parallel() r := &RepositoryDispatchEvent{} r.GetInstallation() r = nil @@ -23365,6 +25879,7 @@ func TestRepositoryDispatchEvent_GetInstallation(tt *testing.T) { } func TestRepositoryDispatchEvent_GetOrg(tt *testing.T) { + tt.Parallel() r := &RepositoryDispatchEvent{} r.GetOrg() r = nil @@ -23372,6 +25887,7 @@ func TestRepositoryDispatchEvent_GetOrg(tt *testing.T) { } func TestRepositoryDispatchEvent_GetRepo(tt *testing.T) { + tt.Parallel() r := &RepositoryDispatchEvent{} r.GetRepo() r = nil @@ -23379,6 +25895,7 @@ func TestRepositoryDispatchEvent_GetRepo(tt *testing.T) { } func TestRepositoryDispatchEvent_GetSender(tt *testing.T) { + tt.Parallel() r := &RepositoryDispatchEvent{} r.GetSender() r = nil @@ -23386,6 +25903,7 @@ func TestRepositoryDispatchEvent_GetSender(tt *testing.T) { } func TestRepositoryEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryEvent{Action: &zeroValue} r.GetAction() @@ -23396,6 +25914,7 @@ func TestRepositoryEvent_GetAction(tt *testing.T) { } func TestRepositoryEvent_GetChanges(tt *testing.T) { + tt.Parallel() r := &RepositoryEvent{} r.GetChanges() r = nil @@ -23403,6 +25922,7 @@ func TestRepositoryEvent_GetChanges(tt *testing.T) { } func TestRepositoryEvent_GetInstallation(tt *testing.T) { + tt.Parallel() r := &RepositoryEvent{} r.GetInstallation() r = nil @@ -23410,6 +25930,7 @@ func TestRepositoryEvent_GetInstallation(tt *testing.T) { } func TestRepositoryEvent_GetOrg(tt *testing.T) { + tt.Parallel() r := &RepositoryEvent{} r.GetOrg() r = nil @@ -23417,6 +25938,7 @@ func TestRepositoryEvent_GetOrg(tt *testing.T) { } func TestRepositoryEvent_GetRepo(tt *testing.T) { + tt.Parallel() r := &RepositoryEvent{} r.GetRepo() r = nil @@ -23424,6 +25946,7 @@ func TestRepositoryEvent_GetRepo(tt *testing.T) { } func TestRepositoryEvent_GetSender(tt *testing.T) { + tt.Parallel() r := &RepositoryEvent{} r.GetSender() r = nil @@ -23431,6 +25954,7 @@ func TestRepositoryEvent_GetSender(tt *testing.T) { } func TestRepositoryImportEvent_GetOrg(tt *testing.T) { + tt.Parallel() r := &RepositoryImportEvent{} r.GetOrg() r = nil @@ -23438,6 +25962,7 @@ func TestRepositoryImportEvent_GetOrg(tt *testing.T) { } func TestRepositoryImportEvent_GetRepo(tt *testing.T) { + tt.Parallel() r := &RepositoryImportEvent{} r.GetRepo() r = nil @@ -23445,6 +25970,7 @@ func TestRepositoryImportEvent_GetRepo(tt *testing.T) { } func TestRepositoryImportEvent_GetSender(tt *testing.T) { + tt.Parallel() r := &RepositoryImportEvent{} r.GetSender() r = nil @@ -23452,6 +25978,7 @@ func TestRepositoryImportEvent_GetSender(tt *testing.T) { } func TestRepositoryImportEvent_GetStatus(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryImportEvent{Status: &zeroValue} r.GetStatus() @@ -23462,6 +25989,7 @@ func TestRepositoryImportEvent_GetStatus(tt *testing.T) { } func TestRepositoryInvitation_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp r := &RepositoryInvitation{CreatedAt: &zeroValue} r.GetCreatedAt() @@ -23472,6 +26000,7 @@ func TestRepositoryInvitation_GetCreatedAt(tt *testing.T) { } func TestRepositoryInvitation_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryInvitation{HTMLURL: &zeroValue} r.GetHTMLURL() @@ -23482,6 +26011,7 @@ func TestRepositoryInvitation_GetHTMLURL(tt *testing.T) { } func TestRepositoryInvitation_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 r := &RepositoryInvitation{ID: &zeroValue} r.GetID() @@ -23492,6 +26022,7 @@ func TestRepositoryInvitation_GetID(tt *testing.T) { } func TestRepositoryInvitation_GetInvitee(tt *testing.T) { + tt.Parallel() r := &RepositoryInvitation{} r.GetInvitee() r = nil @@ -23499,6 +26030,7 @@ func TestRepositoryInvitation_GetInvitee(tt *testing.T) { } func TestRepositoryInvitation_GetInviter(tt *testing.T) { + tt.Parallel() r := &RepositoryInvitation{} r.GetInviter() r = nil @@ -23506,6 +26038,7 @@ func TestRepositoryInvitation_GetInviter(tt *testing.T) { } func TestRepositoryInvitation_GetPermissions(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryInvitation{Permissions: &zeroValue} r.GetPermissions() @@ -23516,6 +26049,7 @@ func TestRepositoryInvitation_GetPermissions(tt *testing.T) { } func TestRepositoryInvitation_GetRepo(tt *testing.T) { + tt.Parallel() r := &RepositoryInvitation{} r.GetRepo() r = nil @@ -23523,6 +26057,7 @@ func TestRepositoryInvitation_GetRepo(tt *testing.T) { } func TestRepositoryInvitation_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryInvitation{URL: &zeroValue} r.GetURL() @@ -23533,6 +26068,7 @@ func TestRepositoryInvitation_GetURL(tt *testing.T) { } func TestRepositoryLicense_GetContent(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryLicense{Content: &zeroValue} r.GetContent() @@ -23543,6 +26079,7 @@ func TestRepositoryLicense_GetContent(tt *testing.T) { } func TestRepositoryLicense_GetDownloadURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryLicense{DownloadURL: &zeroValue} r.GetDownloadURL() @@ -23553,6 +26090,7 @@ func TestRepositoryLicense_GetDownloadURL(tt *testing.T) { } func TestRepositoryLicense_GetEncoding(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryLicense{Encoding: &zeroValue} r.GetEncoding() @@ -23563,6 +26101,7 @@ func TestRepositoryLicense_GetEncoding(tt *testing.T) { } func TestRepositoryLicense_GetGitURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryLicense{GitURL: &zeroValue} r.GetGitURL() @@ -23573,6 +26112,7 @@ func TestRepositoryLicense_GetGitURL(tt *testing.T) { } func TestRepositoryLicense_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryLicense{HTMLURL: &zeroValue} r.GetHTMLURL() @@ -23583,6 +26123,7 @@ func TestRepositoryLicense_GetHTMLURL(tt *testing.T) { } func TestRepositoryLicense_GetLicense(tt *testing.T) { + tt.Parallel() r := &RepositoryLicense{} r.GetLicense() r = nil @@ -23590,6 +26131,7 @@ func TestRepositoryLicense_GetLicense(tt *testing.T) { } func TestRepositoryLicense_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryLicense{Name: &zeroValue} r.GetName() @@ -23600,6 +26142,7 @@ func TestRepositoryLicense_GetName(tt *testing.T) { } func TestRepositoryLicense_GetPath(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryLicense{Path: &zeroValue} r.GetPath() @@ -23610,6 +26153,7 @@ func TestRepositoryLicense_GetPath(tt *testing.T) { } func TestRepositoryLicense_GetSHA(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryLicense{SHA: &zeroValue} r.GetSHA() @@ -23620,6 +26164,7 @@ func TestRepositoryLicense_GetSHA(tt *testing.T) { } func TestRepositoryLicense_GetSize(tt *testing.T) { + tt.Parallel() var zeroValue int r := &RepositoryLicense{Size: &zeroValue} r.GetSize() @@ -23630,6 +26175,7 @@ func TestRepositoryLicense_GetSize(tt *testing.T) { } func TestRepositoryLicense_GetType(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryLicense{Type: &zeroValue} r.GetType() @@ -23640,6 +26186,7 @@ func TestRepositoryLicense_GetType(tt *testing.T) { } func TestRepositoryLicense_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryLicense{URL: &zeroValue} r.GetURL() @@ -23650,6 +26197,7 @@ func TestRepositoryLicense_GetURL(tt *testing.T) { } func TestRepositoryMergeRequest_GetBase(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryMergeRequest{Base: &zeroValue} r.GetBase() @@ -23660,6 +26208,7 @@ func TestRepositoryMergeRequest_GetBase(tt *testing.T) { } func TestRepositoryMergeRequest_GetCommitMessage(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryMergeRequest{CommitMessage: &zeroValue} r.GetCommitMessage() @@ -23670,6 +26219,7 @@ func TestRepositoryMergeRequest_GetCommitMessage(tt *testing.T) { } func TestRepositoryMergeRequest_GetHead(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryMergeRequest{Head: &zeroValue} r.GetHead() @@ -23680,6 +26230,7 @@ func TestRepositoryMergeRequest_GetHead(tt *testing.T) { } func TestRepositoryPermissionLevel_GetPermission(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryPermissionLevel{Permission: &zeroValue} r.GetPermission() @@ -23690,6 +26241,7 @@ func TestRepositoryPermissionLevel_GetPermission(tt *testing.T) { } func TestRepositoryPermissionLevel_GetRoleName(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryPermissionLevel{RoleName: &zeroValue} r.GetRoleName() @@ -23700,6 +26252,7 @@ func TestRepositoryPermissionLevel_GetRoleName(tt *testing.T) { } func TestRepositoryPermissionLevel_GetUser(tt *testing.T) { + tt.Parallel() r := &RepositoryPermissionLevel{} r.GetUser() r = nil @@ -23707,6 +26260,7 @@ func TestRepositoryPermissionLevel_GetUser(tt *testing.T) { } func TestRepositoryRelease_GetAssetsURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryRelease{AssetsURL: &zeroValue} r.GetAssetsURL() @@ -23717,6 +26271,7 @@ func TestRepositoryRelease_GetAssetsURL(tt *testing.T) { } func TestRepositoryRelease_GetAuthor(tt *testing.T) { + tt.Parallel() r := &RepositoryRelease{} r.GetAuthor() r = nil @@ -23724,6 +26279,7 @@ func TestRepositoryRelease_GetAuthor(tt *testing.T) { } func TestRepositoryRelease_GetBody(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryRelease{Body: &zeroValue} r.GetBody() @@ -23734,6 +26290,7 @@ func TestRepositoryRelease_GetBody(tt *testing.T) { } func TestRepositoryRelease_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp r := &RepositoryRelease{CreatedAt: &zeroValue} r.GetCreatedAt() @@ -23744,6 +26301,7 @@ func TestRepositoryRelease_GetCreatedAt(tt *testing.T) { } func TestRepositoryRelease_GetDiscussionCategoryName(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryRelease{DiscussionCategoryName: &zeroValue} r.GetDiscussionCategoryName() @@ -23754,6 +26312,7 @@ func TestRepositoryRelease_GetDiscussionCategoryName(tt *testing.T) { } func TestRepositoryRelease_GetDraft(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &RepositoryRelease{Draft: &zeroValue} r.GetDraft() @@ -23764,6 +26323,7 @@ func TestRepositoryRelease_GetDraft(tt *testing.T) { } func TestRepositoryRelease_GetGenerateReleaseNotes(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &RepositoryRelease{GenerateReleaseNotes: &zeroValue} r.GetGenerateReleaseNotes() @@ -23774,6 +26334,7 @@ func TestRepositoryRelease_GetGenerateReleaseNotes(tt *testing.T) { } func TestRepositoryRelease_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryRelease{HTMLURL: &zeroValue} r.GetHTMLURL() @@ -23784,6 +26345,7 @@ func TestRepositoryRelease_GetHTMLURL(tt *testing.T) { } func TestRepositoryRelease_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 r := &RepositoryRelease{ID: &zeroValue} r.GetID() @@ -23794,6 +26356,7 @@ func TestRepositoryRelease_GetID(tt *testing.T) { } func TestRepositoryRelease_GetMakeLatest(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryRelease{MakeLatest: &zeroValue} r.GetMakeLatest() @@ -23804,6 +26367,7 @@ func TestRepositoryRelease_GetMakeLatest(tt *testing.T) { } func TestRepositoryRelease_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryRelease{Name: &zeroValue} r.GetName() @@ -23814,6 +26378,7 @@ func TestRepositoryRelease_GetName(tt *testing.T) { } func TestRepositoryRelease_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryRelease{NodeID: &zeroValue} r.GetNodeID() @@ -23824,6 +26389,7 @@ func TestRepositoryRelease_GetNodeID(tt *testing.T) { } func TestRepositoryRelease_GetPrerelease(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &RepositoryRelease{Prerelease: &zeroValue} r.GetPrerelease() @@ -23834,6 +26400,7 @@ func TestRepositoryRelease_GetPrerelease(tt *testing.T) { } func TestRepositoryRelease_GetPublishedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp r := &RepositoryRelease{PublishedAt: &zeroValue} r.GetPublishedAt() @@ -23844,6 +26411,7 @@ func TestRepositoryRelease_GetPublishedAt(tt *testing.T) { } func TestRepositoryRelease_GetTagName(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryRelease{TagName: &zeroValue} r.GetTagName() @@ -23854,6 +26422,7 @@ func TestRepositoryRelease_GetTagName(tt *testing.T) { } func TestRepositoryRelease_GetTarballURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryRelease{TarballURL: &zeroValue} r.GetTarballURL() @@ -23864,6 +26433,7 @@ func TestRepositoryRelease_GetTarballURL(tt *testing.T) { } func TestRepositoryRelease_GetTargetCommitish(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryRelease{TargetCommitish: &zeroValue} r.GetTargetCommitish() @@ -23874,6 +26444,7 @@ func TestRepositoryRelease_GetTargetCommitish(tt *testing.T) { } func TestRepositoryRelease_GetUploadURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryRelease{UploadURL: &zeroValue} r.GetUploadURL() @@ -23884,6 +26455,7 @@ func TestRepositoryRelease_GetUploadURL(tt *testing.T) { } func TestRepositoryRelease_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryRelease{URL: &zeroValue} r.GetURL() @@ -23894,6 +26466,7 @@ func TestRepositoryRelease_GetURL(tt *testing.T) { } func TestRepositoryRelease_GetZipballURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryRelease{ZipballURL: &zeroValue} r.GetZipballURL() @@ -23904,6 +26477,7 @@ func TestRepositoryRelease_GetZipballURL(tt *testing.T) { } func TestRepositoryRule_GetParameters(tt *testing.T) { + tt.Parallel() var zeroValue json.RawMessage r := &RepositoryRule{Parameters: &zeroValue} r.GetParameters() @@ -23914,6 +26488,7 @@ func TestRepositoryRule_GetParameters(tt *testing.T) { } func TestRepositoryTag_GetCommit(tt *testing.T) { + tt.Parallel() r := &RepositoryTag{} r.GetCommit() r = nil @@ -23921,6 +26496,7 @@ func TestRepositoryTag_GetCommit(tt *testing.T) { } func TestRepositoryTag_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryTag{Name: &zeroValue} r.GetName() @@ -23931,6 +26507,7 @@ func TestRepositoryTag_GetName(tt *testing.T) { } func TestRepositoryTag_GetTarballURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryTag{TarballURL: &zeroValue} r.GetTarballURL() @@ -23941,6 +26518,7 @@ func TestRepositoryTag_GetTarballURL(tt *testing.T) { } func TestRepositoryTag_GetZipballURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryTag{ZipballURL: &zeroValue} r.GetZipballURL() @@ -23951,6 +26529,7 @@ func TestRepositoryTag_GetZipballURL(tt *testing.T) { } func TestRepositoryVulnerabilityAlert_GetAffectedPackageName(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryVulnerabilityAlert{AffectedPackageName: &zeroValue} r.GetAffectedPackageName() @@ -23961,6 +26540,7 @@ func TestRepositoryVulnerabilityAlert_GetAffectedPackageName(tt *testing.T) { } func TestRepositoryVulnerabilityAlert_GetAffectedRange(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryVulnerabilityAlert{AffectedRange: &zeroValue} r.GetAffectedRange() @@ -23971,6 +26551,7 @@ func TestRepositoryVulnerabilityAlert_GetAffectedRange(tt *testing.T) { } func TestRepositoryVulnerabilityAlert_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp r := &RepositoryVulnerabilityAlert{CreatedAt: &zeroValue} r.GetCreatedAt() @@ -23981,6 +26562,7 @@ func TestRepositoryVulnerabilityAlert_GetCreatedAt(tt *testing.T) { } func TestRepositoryVulnerabilityAlert_GetDismissedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp r := &RepositoryVulnerabilityAlert{DismissedAt: &zeroValue} r.GetDismissedAt() @@ -23991,6 +26573,7 @@ func TestRepositoryVulnerabilityAlert_GetDismissedAt(tt *testing.T) { } func TestRepositoryVulnerabilityAlert_GetDismisser(tt *testing.T) { + tt.Parallel() r := &RepositoryVulnerabilityAlert{} r.GetDismisser() r = nil @@ -23998,6 +26581,7 @@ func TestRepositoryVulnerabilityAlert_GetDismisser(tt *testing.T) { } func TestRepositoryVulnerabilityAlert_GetDismissReason(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryVulnerabilityAlert{DismissReason: &zeroValue} r.GetDismissReason() @@ -24008,6 +26592,7 @@ func TestRepositoryVulnerabilityAlert_GetDismissReason(tt *testing.T) { } func TestRepositoryVulnerabilityAlert_GetExternalIdentifier(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryVulnerabilityAlert{ExternalIdentifier: &zeroValue} r.GetExternalIdentifier() @@ -24018,6 +26603,7 @@ func TestRepositoryVulnerabilityAlert_GetExternalIdentifier(tt *testing.T) { } func TestRepositoryVulnerabilityAlert_GetExternalReference(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryVulnerabilityAlert{ExternalReference: &zeroValue} r.GetExternalReference() @@ -24028,6 +26614,7 @@ func TestRepositoryVulnerabilityAlert_GetExternalReference(tt *testing.T) { } func TestRepositoryVulnerabilityAlert_GetFixedIn(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryVulnerabilityAlert{FixedIn: &zeroValue} r.GetFixedIn() @@ -24038,6 +26625,7 @@ func TestRepositoryVulnerabilityAlert_GetFixedIn(tt *testing.T) { } func TestRepositoryVulnerabilityAlert_GetGitHubSecurityAdvisoryID(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryVulnerabilityAlert{GitHubSecurityAdvisoryID: &zeroValue} r.GetGitHubSecurityAdvisoryID() @@ -24048,6 +26636,7 @@ func TestRepositoryVulnerabilityAlert_GetGitHubSecurityAdvisoryID(tt *testing.T) } func TestRepositoryVulnerabilityAlert_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 r := &RepositoryVulnerabilityAlert{ID: &zeroValue} r.GetID() @@ -24058,6 +26647,7 @@ func TestRepositoryVulnerabilityAlert_GetID(tt *testing.T) { } func TestRepositoryVulnerabilityAlert_GetSeverity(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryVulnerabilityAlert{Severity: &zeroValue} r.GetSeverity() @@ -24068,6 +26658,7 @@ func TestRepositoryVulnerabilityAlert_GetSeverity(tt *testing.T) { } func TestRepositoryVulnerabilityAlertEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepositoryVulnerabilityAlertEvent{Action: &zeroValue} r.GetAction() @@ -24078,6 +26669,7 @@ func TestRepositoryVulnerabilityAlertEvent_GetAction(tt *testing.T) { } func TestRepositoryVulnerabilityAlertEvent_GetAlert(tt *testing.T) { + tt.Parallel() r := &RepositoryVulnerabilityAlertEvent{} r.GetAlert() r = nil @@ -24085,6 +26677,7 @@ func TestRepositoryVulnerabilityAlertEvent_GetAlert(tt *testing.T) { } func TestRepositoryVulnerabilityAlertEvent_GetInstallation(tt *testing.T) { + tt.Parallel() r := &RepositoryVulnerabilityAlertEvent{} r.GetInstallation() r = nil @@ -24092,6 +26685,7 @@ func TestRepositoryVulnerabilityAlertEvent_GetInstallation(tt *testing.T) { } func TestRepositoryVulnerabilityAlertEvent_GetOrg(tt *testing.T) { + tt.Parallel() r := &RepositoryVulnerabilityAlertEvent{} r.GetOrg() r = nil @@ -24099,6 +26693,7 @@ func TestRepositoryVulnerabilityAlertEvent_GetOrg(tt *testing.T) { } func TestRepositoryVulnerabilityAlertEvent_GetRepository(tt *testing.T) { + tt.Parallel() r := &RepositoryVulnerabilityAlertEvent{} r.GetRepository() r = nil @@ -24106,6 +26701,7 @@ func TestRepositoryVulnerabilityAlertEvent_GetRepository(tt *testing.T) { } func TestRepositoryVulnerabilityAlertEvent_GetSender(tt *testing.T) { + tt.Parallel() r := &RepositoryVulnerabilityAlertEvent{} r.GetSender() r = nil @@ -24113,6 +26709,7 @@ func TestRepositoryVulnerabilityAlertEvent_GetSender(tt *testing.T) { } func TestRepoStats_GetForkRepos(tt *testing.T) { + tt.Parallel() var zeroValue int r := &RepoStats{ForkRepos: &zeroValue} r.GetForkRepos() @@ -24123,6 +26720,7 @@ func TestRepoStats_GetForkRepos(tt *testing.T) { } func TestRepoStats_GetOrgRepos(tt *testing.T) { + tt.Parallel() var zeroValue int r := &RepoStats{OrgRepos: &zeroValue} r.GetOrgRepos() @@ -24133,6 +26731,7 @@ func TestRepoStats_GetOrgRepos(tt *testing.T) { } func TestRepoStats_GetRootRepos(tt *testing.T) { + tt.Parallel() var zeroValue int r := &RepoStats{RootRepos: &zeroValue} r.GetRootRepos() @@ -24143,6 +26742,7 @@ func TestRepoStats_GetRootRepos(tt *testing.T) { } func TestRepoStats_GetTotalPushes(tt *testing.T) { + tt.Parallel() var zeroValue int r := &RepoStats{TotalPushes: &zeroValue} r.GetTotalPushes() @@ -24153,6 +26753,7 @@ func TestRepoStats_GetTotalPushes(tt *testing.T) { } func TestRepoStats_GetTotalRepos(tt *testing.T) { + tt.Parallel() var zeroValue int r := &RepoStats{TotalRepos: &zeroValue} r.GetTotalRepos() @@ -24163,6 +26764,7 @@ func TestRepoStats_GetTotalRepos(tt *testing.T) { } func TestRepoStats_GetTotalWikis(tt *testing.T) { + tt.Parallel() var zeroValue int r := &RepoStats{TotalWikis: &zeroValue} r.GetTotalWikis() @@ -24173,6 +26775,7 @@ func TestRepoStats_GetTotalWikis(tt *testing.T) { } func TestRepoStatus_GetAvatarURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepoStatus{AvatarURL: &zeroValue} r.GetAvatarURL() @@ -24183,6 +26786,7 @@ func TestRepoStatus_GetAvatarURL(tt *testing.T) { } func TestRepoStatus_GetContext(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepoStatus{Context: &zeroValue} r.GetContext() @@ -24193,6 +26797,7 @@ func TestRepoStatus_GetContext(tt *testing.T) { } func TestRepoStatus_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp r := &RepoStatus{CreatedAt: &zeroValue} r.GetCreatedAt() @@ -24203,6 +26808,7 @@ func TestRepoStatus_GetCreatedAt(tt *testing.T) { } func TestRepoStatus_GetCreator(tt *testing.T) { + tt.Parallel() r := &RepoStatus{} r.GetCreator() r = nil @@ -24210,6 +26816,7 @@ func TestRepoStatus_GetCreator(tt *testing.T) { } func TestRepoStatus_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepoStatus{Description: &zeroValue} r.GetDescription() @@ -24220,6 +26827,7 @@ func TestRepoStatus_GetDescription(tt *testing.T) { } func TestRepoStatus_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 r := &RepoStatus{ID: &zeroValue} r.GetID() @@ -24230,6 +26838,7 @@ func TestRepoStatus_GetID(tt *testing.T) { } func TestRepoStatus_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepoStatus{NodeID: &zeroValue} r.GetNodeID() @@ -24240,6 +26849,7 @@ func TestRepoStatus_GetNodeID(tt *testing.T) { } func TestRepoStatus_GetState(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepoStatus{State: &zeroValue} r.GetState() @@ -24250,6 +26860,7 @@ func TestRepoStatus_GetState(tt *testing.T) { } func TestRepoStatus_GetTargetURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepoStatus{TargetURL: &zeroValue} r.GetTargetURL() @@ -24260,6 +26871,7 @@ func TestRepoStatus_GetTargetURL(tt *testing.T) { } func TestRepoStatus_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp r := &RepoStatus{UpdatedAt: &zeroValue} r.GetUpdatedAt() @@ -24270,6 +26882,7 @@ func TestRepoStatus_GetUpdatedAt(tt *testing.T) { } func TestRepoStatus_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RepoStatus{URL: &zeroValue} r.GetURL() @@ -24280,6 +26893,7 @@ func TestRepoStatus_GetURL(tt *testing.T) { } func TestRequireCodeOwnerReviewChanges_GetFrom(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &RequireCodeOwnerReviewChanges{From: &zeroValue} r.GetFrom() @@ -24290,6 +26904,7 @@ func TestRequireCodeOwnerReviewChanges_GetFrom(tt *testing.T) { } func TestRequiredConversationResolutionLevelChanges_GetFrom(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RequiredConversationResolutionLevelChanges{From: &zeroValue} r.GetFrom() @@ -24300,6 +26915,7 @@ func TestRequiredConversationResolutionLevelChanges_GetFrom(tt *testing.T) { } func TestRequiredDeploymentsEnforcementLevelChanges_GetFrom(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RequiredDeploymentsEnforcementLevelChanges{From: &zeroValue} r.GetFrom() @@ -24310,6 +26926,7 @@ func TestRequiredDeploymentsEnforcementLevelChanges_GetFrom(tt *testing.T) { } func TestRequiredReviewer_GetType(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RequiredReviewer{Type: &zeroValue} r.GetType() @@ -24320,6 +26937,7 @@ func TestRequiredReviewer_GetType(tt *testing.T) { } func TestRequiredStatusCheck_GetAppID(tt *testing.T) { + tt.Parallel() var zeroValue int64 r := &RequiredStatusCheck{AppID: &zeroValue} r.GetAppID() @@ -24330,6 +26948,7 @@ func TestRequiredStatusCheck_GetAppID(tt *testing.T) { } func TestRequiredStatusChecks_GetChecks(tt *testing.T) { + tt.Parallel() var zeroValue []*RequiredStatusCheck r := &RequiredStatusChecks{Checks: &zeroValue} r.GetChecks() @@ -24340,6 +26959,7 @@ func TestRequiredStatusChecks_GetChecks(tt *testing.T) { } func TestRequiredStatusChecks_GetContexts(tt *testing.T) { + tt.Parallel() var zeroValue []string r := &RequiredStatusChecks{Contexts: &zeroValue} r.GetContexts() @@ -24350,6 +26970,7 @@ func TestRequiredStatusChecks_GetContexts(tt *testing.T) { } func TestRequiredStatusChecks_GetContextsURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RequiredStatusChecks{ContextsURL: &zeroValue} r.GetContextsURL() @@ -24360,6 +26981,7 @@ func TestRequiredStatusChecks_GetContextsURL(tt *testing.T) { } func TestRequiredStatusChecks_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RequiredStatusChecks{URL: &zeroValue} r.GetURL() @@ -24370,6 +26992,7 @@ func TestRequiredStatusChecks_GetURL(tt *testing.T) { } func TestRequiredStatusChecksEnforcementLevelChanges_GetFrom(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RequiredStatusChecksEnforcementLevelChanges{From: &zeroValue} r.GetFrom() @@ -24380,6 +27003,7 @@ func TestRequiredStatusChecksEnforcementLevelChanges_GetFrom(tt *testing.T) { } func TestRequiredStatusChecksRequest_GetStrict(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &RequiredStatusChecksRequest{Strict: &zeroValue} r.GetStrict() @@ -24390,6 +27014,7 @@ func TestRequiredStatusChecksRequest_GetStrict(tt *testing.T) { } func TestRequiredWorkflowSelectedRepos_GetTotalCount(tt *testing.T) { + tt.Parallel() var zeroValue int r := &RequiredWorkflowSelectedRepos{TotalCount: &zeroValue} r.GetTotalCount() @@ -24400,6 +27025,7 @@ func TestRequiredWorkflowSelectedRepos_GetTotalCount(tt *testing.T) { } func TestReviewersRequest_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string r := &ReviewersRequest{NodeID: &zeroValue} r.GetNodeID() @@ -24410,6 +27036,7 @@ func TestReviewersRequest_GetNodeID(tt *testing.T) { } func TestReviewPersonalAccessTokenRequestOptions_GetReason(tt *testing.T) { + tt.Parallel() var zeroValue string r := &ReviewPersonalAccessTokenRequestOptions{Reason: &zeroValue} r.GetReason() @@ -24420,6 +27047,7 @@ func TestReviewPersonalAccessTokenRequestOptions_GetReason(tt *testing.T) { } func TestRule_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Rule{Description: &zeroValue} r.GetDescription() @@ -24430,6 +27058,7 @@ func TestRule_GetDescription(tt *testing.T) { } func TestRule_GetFullDescription(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Rule{FullDescription: &zeroValue} r.GetFullDescription() @@ -24440,6 +27069,7 @@ func TestRule_GetFullDescription(tt *testing.T) { } func TestRule_GetHelp(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Rule{Help: &zeroValue} r.GetHelp() @@ -24450,6 +27080,7 @@ func TestRule_GetHelp(tt *testing.T) { } func TestRule_GetID(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Rule{ID: &zeroValue} r.GetID() @@ -24460,6 +27091,7 @@ func TestRule_GetID(tt *testing.T) { } func TestRule_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Rule{Name: &zeroValue} r.GetName() @@ -24470,6 +27102,7 @@ func TestRule_GetName(tt *testing.T) { } func TestRule_GetSecuritySeverityLevel(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Rule{SecuritySeverityLevel: &zeroValue} r.GetSecuritySeverityLevel() @@ -24480,6 +27113,7 @@ func TestRule_GetSecuritySeverityLevel(tt *testing.T) { } func TestRule_GetSeverity(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Rule{Severity: &zeroValue} r.GetSeverity() @@ -24490,6 +27124,7 @@ func TestRule_GetSeverity(tt *testing.T) { } func TestRuleFileParameters_GetRestrictedFilePaths(tt *testing.T) { + tt.Parallel() var zeroValue []string r := &RuleFileParameters{RestrictedFilePaths: &zeroValue} r.GetRestrictedFilePaths() @@ -24500,6 +27135,7 @@ func TestRuleFileParameters_GetRestrictedFilePaths(tt *testing.T) { } func TestRulePatternParameters_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RulePatternParameters{Name: &zeroValue} r.GetName() @@ -24510,6 +27146,7 @@ func TestRulePatternParameters_GetName(tt *testing.T) { } func TestRulePatternParameters_GetNegate(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &RulePatternParameters{Negate: &zeroValue} r.GetNegate() @@ -24520,6 +27157,7 @@ func TestRulePatternParameters_GetNegate(tt *testing.T) { } func TestRuleRequiredStatusChecks_GetIntegrationID(tt *testing.T) { + tt.Parallel() var zeroValue int64 r := &RuleRequiredStatusChecks{IntegrationID: &zeroValue} r.GetIntegrationID() @@ -24530,6 +27168,7 @@ func TestRuleRequiredStatusChecks_GetIntegrationID(tt *testing.T) { } func TestRuleRequiredWorkflow_GetRef(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RuleRequiredWorkflow{Ref: &zeroValue} r.GetRef() @@ -24540,6 +27179,7 @@ func TestRuleRequiredWorkflow_GetRef(tt *testing.T) { } func TestRuleRequiredWorkflow_GetRepositoryID(tt *testing.T) { + tt.Parallel() var zeroValue int64 r := &RuleRequiredWorkflow{RepositoryID: &zeroValue} r.GetRepositoryID() @@ -24550,6 +27190,7 @@ func TestRuleRequiredWorkflow_GetRepositoryID(tt *testing.T) { } func TestRuleRequiredWorkflow_GetSha(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RuleRequiredWorkflow{Sha: &zeroValue} r.GetSha() @@ -24560,6 +27201,7 @@ func TestRuleRequiredWorkflow_GetSha(tt *testing.T) { } func TestRuleset_GetConditions(tt *testing.T) { + tt.Parallel() r := &Ruleset{} r.GetConditions() r = nil @@ -24567,6 +27209,7 @@ func TestRuleset_GetConditions(tt *testing.T) { } func TestRuleset_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 r := &Ruleset{ID: &zeroValue} r.GetID() @@ -24577,6 +27220,7 @@ func TestRuleset_GetID(tt *testing.T) { } func TestRuleset_GetLinks(tt *testing.T) { + tt.Parallel() r := &Ruleset{} r.GetLinks() r = nil @@ -24584,6 +27228,7 @@ func TestRuleset_GetLinks(tt *testing.T) { } func TestRuleset_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Ruleset{NodeID: &zeroValue} r.GetNodeID() @@ -24594,6 +27239,7 @@ func TestRuleset_GetNodeID(tt *testing.T) { } func TestRuleset_GetSourceType(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Ruleset{SourceType: &zeroValue} r.GetSourceType() @@ -24604,6 +27250,7 @@ func TestRuleset_GetSourceType(tt *testing.T) { } func TestRuleset_GetTarget(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Ruleset{Target: &zeroValue} r.GetTarget() @@ -24614,6 +27261,7 @@ func TestRuleset_GetTarget(tt *testing.T) { } func TestRulesetConditions_GetRefName(tt *testing.T) { + tt.Parallel() r := &RulesetConditions{} r.GetRefName() r = nil @@ -24621,6 +27269,7 @@ func TestRulesetConditions_GetRefName(tt *testing.T) { } func TestRulesetConditions_GetRepositoryID(tt *testing.T) { + tt.Parallel() r := &RulesetConditions{} r.GetRepositoryID() r = nil @@ -24628,6 +27277,7 @@ func TestRulesetConditions_GetRepositoryID(tt *testing.T) { } func TestRulesetConditions_GetRepositoryName(tt *testing.T) { + tt.Parallel() r := &RulesetConditions{} r.GetRepositoryName() r = nil @@ -24635,6 +27285,7 @@ func TestRulesetConditions_GetRepositoryName(tt *testing.T) { } func TestRulesetConditions_GetRepositoryProperty(tt *testing.T) { + tt.Parallel() r := &RulesetConditions{} r.GetRepositoryProperty() r = nil @@ -24642,6 +27293,7 @@ func TestRulesetConditions_GetRepositoryProperty(tt *testing.T) { } func TestRulesetLink_GetHRef(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RulesetLink{HRef: &zeroValue} r.GetHRef() @@ -24652,6 +27304,7 @@ func TestRulesetLink_GetHRef(tt *testing.T) { } func TestRulesetLinks_GetSelf(tt *testing.T) { + tt.Parallel() r := &RulesetLinks{} r.GetSelf() r = nil @@ -24659,6 +27312,7 @@ func TestRulesetLinks_GetSelf(tt *testing.T) { } func TestRulesetRepositoryNamesConditionParameters_GetProtected(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &RulesetRepositoryNamesConditionParameters{Protected: &zeroValue} r.GetProtected() @@ -24669,6 +27323,7 @@ func TestRulesetRepositoryNamesConditionParameters_GetProtected(tt *testing.T) { } func TestRunner_GetBusy(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &Runner{Busy: &zeroValue} r.GetBusy() @@ -24679,6 +27334,7 @@ func TestRunner_GetBusy(tt *testing.T) { } func TestRunner_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 r := &Runner{ID: &zeroValue} r.GetID() @@ -24689,6 +27345,7 @@ func TestRunner_GetID(tt *testing.T) { } func TestRunner_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Runner{Name: &zeroValue} r.GetName() @@ -24699,6 +27356,7 @@ func TestRunner_GetName(tt *testing.T) { } func TestRunner_GetOS(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Runner{OS: &zeroValue} r.GetOS() @@ -24709,6 +27367,7 @@ func TestRunner_GetOS(tt *testing.T) { } func TestRunner_GetStatus(tt *testing.T) { + tt.Parallel() var zeroValue string r := &Runner{Status: &zeroValue} r.GetStatus() @@ -24719,6 +27378,7 @@ func TestRunner_GetStatus(tt *testing.T) { } func TestRunnerApplicationDownload_GetArchitecture(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RunnerApplicationDownload{Architecture: &zeroValue} r.GetArchitecture() @@ -24729,6 +27389,7 @@ func TestRunnerApplicationDownload_GetArchitecture(tt *testing.T) { } func TestRunnerApplicationDownload_GetDownloadURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RunnerApplicationDownload{DownloadURL: &zeroValue} r.GetDownloadURL() @@ -24739,6 +27400,7 @@ func TestRunnerApplicationDownload_GetDownloadURL(tt *testing.T) { } func TestRunnerApplicationDownload_GetFilename(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RunnerApplicationDownload{Filename: &zeroValue} r.GetFilename() @@ -24749,6 +27411,7 @@ func TestRunnerApplicationDownload_GetFilename(tt *testing.T) { } func TestRunnerApplicationDownload_GetOS(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RunnerApplicationDownload{OS: &zeroValue} r.GetOS() @@ -24759,6 +27422,7 @@ func TestRunnerApplicationDownload_GetOS(tt *testing.T) { } func TestRunnerApplicationDownload_GetSHA256Checksum(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RunnerApplicationDownload{SHA256Checksum: &zeroValue} r.GetSHA256Checksum() @@ -24769,6 +27433,7 @@ func TestRunnerApplicationDownload_GetSHA256Checksum(tt *testing.T) { } func TestRunnerApplicationDownload_GetTempDownloadToken(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RunnerApplicationDownload{TempDownloadToken: &zeroValue} r.GetTempDownloadToken() @@ -24779,6 +27444,7 @@ func TestRunnerApplicationDownload_GetTempDownloadToken(tt *testing.T) { } func TestRunnerGroup_GetAllowsPublicRepositories(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &RunnerGroup{AllowsPublicRepositories: &zeroValue} r.GetAllowsPublicRepositories() @@ -24789,6 +27455,7 @@ func TestRunnerGroup_GetAllowsPublicRepositories(tt *testing.T) { } func TestRunnerGroup_GetDefault(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &RunnerGroup{Default: &zeroValue} r.GetDefault() @@ -24799,6 +27466,7 @@ func TestRunnerGroup_GetDefault(tt *testing.T) { } func TestRunnerGroup_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 r := &RunnerGroup{ID: &zeroValue} r.GetID() @@ -24809,6 +27477,7 @@ func TestRunnerGroup_GetID(tt *testing.T) { } func TestRunnerGroup_GetInherited(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &RunnerGroup{Inherited: &zeroValue} r.GetInherited() @@ -24819,6 +27488,7 @@ func TestRunnerGroup_GetInherited(tt *testing.T) { } func TestRunnerGroup_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RunnerGroup{Name: &zeroValue} r.GetName() @@ -24829,6 +27499,7 @@ func TestRunnerGroup_GetName(tt *testing.T) { } func TestRunnerGroup_GetRestrictedToWorkflows(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &RunnerGroup{RestrictedToWorkflows: &zeroValue} r.GetRestrictedToWorkflows() @@ -24839,6 +27510,7 @@ func TestRunnerGroup_GetRestrictedToWorkflows(tt *testing.T) { } func TestRunnerGroup_GetRunnersURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RunnerGroup{RunnersURL: &zeroValue} r.GetRunnersURL() @@ -24849,6 +27521,7 @@ func TestRunnerGroup_GetRunnersURL(tt *testing.T) { } func TestRunnerGroup_GetSelectedRepositoriesURL(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RunnerGroup{SelectedRepositoriesURL: &zeroValue} r.GetSelectedRepositoriesURL() @@ -24859,6 +27532,7 @@ func TestRunnerGroup_GetSelectedRepositoriesURL(tt *testing.T) { } func TestRunnerGroup_GetVisibility(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RunnerGroup{Visibility: &zeroValue} r.GetVisibility() @@ -24869,6 +27543,7 @@ func TestRunnerGroup_GetVisibility(tt *testing.T) { } func TestRunnerGroup_GetWorkflowRestrictionsReadOnly(tt *testing.T) { + tt.Parallel() var zeroValue bool r := &RunnerGroup{WorkflowRestrictionsReadOnly: &zeroValue} r.GetWorkflowRestrictionsReadOnly() @@ -24879,6 +27554,7 @@ func TestRunnerGroup_GetWorkflowRestrictionsReadOnly(tt *testing.T) { } func TestRunnerLabels_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 r := &RunnerLabels{ID: &zeroValue} r.GetID() @@ -24889,6 +27565,7 @@ func TestRunnerLabels_GetID(tt *testing.T) { } func TestRunnerLabels_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RunnerLabels{Name: &zeroValue} r.GetName() @@ -24899,6 +27576,7 @@ func TestRunnerLabels_GetName(tt *testing.T) { } func TestRunnerLabels_GetType(tt *testing.T) { + tt.Parallel() var zeroValue string r := &RunnerLabels{Type: &zeroValue} r.GetType() @@ -24909,6 +27587,7 @@ func TestRunnerLabels_GetType(tt *testing.T) { } func TestSarifAnalysis_GetCheckoutURI(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SarifAnalysis{CheckoutURI: &zeroValue} s.GetCheckoutURI() @@ -24919,6 +27598,7 @@ func TestSarifAnalysis_GetCheckoutURI(tt *testing.T) { } func TestSarifAnalysis_GetCommitSHA(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SarifAnalysis{CommitSHA: &zeroValue} s.GetCommitSHA() @@ -24929,6 +27609,7 @@ func TestSarifAnalysis_GetCommitSHA(tt *testing.T) { } func TestSarifAnalysis_GetRef(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SarifAnalysis{Ref: &zeroValue} s.GetRef() @@ -24939,6 +27620,7 @@ func TestSarifAnalysis_GetRef(tt *testing.T) { } func TestSarifAnalysis_GetSarif(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SarifAnalysis{Sarif: &zeroValue} s.GetSarif() @@ -24949,6 +27631,7 @@ func TestSarifAnalysis_GetSarif(tt *testing.T) { } func TestSarifAnalysis_GetStartedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp s := &SarifAnalysis{StartedAt: &zeroValue} s.GetStartedAt() @@ -24959,6 +27642,7 @@ func TestSarifAnalysis_GetStartedAt(tt *testing.T) { } func TestSarifAnalysis_GetToolName(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SarifAnalysis{ToolName: &zeroValue} s.GetToolName() @@ -24969,6 +27653,7 @@ func TestSarifAnalysis_GetToolName(tt *testing.T) { } func TestSarifID_GetID(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SarifID{ID: &zeroValue} s.GetID() @@ -24979,6 +27664,7 @@ func TestSarifID_GetID(tt *testing.T) { } func TestSarifID_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SarifID{URL: &zeroValue} s.GetURL() @@ -24989,6 +27675,7 @@ func TestSarifID_GetURL(tt *testing.T) { } func TestSARIFUpload_GetAnalysesURL(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SARIFUpload{AnalysesURL: &zeroValue} s.GetAnalysesURL() @@ -24999,6 +27686,7 @@ func TestSARIFUpload_GetAnalysesURL(tt *testing.T) { } func TestSARIFUpload_GetProcessingStatus(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SARIFUpload{ProcessingStatus: &zeroValue} s.GetProcessingStatus() @@ -25009,6 +27697,7 @@ func TestSARIFUpload_GetProcessingStatus(tt *testing.T) { } func TestSBOM_GetSBOM(tt *testing.T) { + tt.Parallel() s := &SBOM{} s.GetSBOM() s = nil @@ -25016,6 +27705,7 @@ func TestSBOM_GetSBOM(tt *testing.T) { } func TestSBOMInfo_GetCreationInfo(tt *testing.T) { + tt.Parallel() s := &SBOMInfo{} s.GetCreationInfo() s = nil @@ -25023,6 +27713,7 @@ func TestSBOMInfo_GetCreationInfo(tt *testing.T) { } func TestSBOMInfo_GetDataLicense(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SBOMInfo{DataLicense: &zeroValue} s.GetDataLicense() @@ -25033,6 +27724,7 @@ func TestSBOMInfo_GetDataLicense(tt *testing.T) { } func TestSBOMInfo_GetDocumentNamespace(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SBOMInfo{DocumentNamespace: &zeroValue} s.GetDocumentNamespace() @@ -25043,6 +27735,7 @@ func TestSBOMInfo_GetDocumentNamespace(tt *testing.T) { } func TestSBOMInfo_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SBOMInfo{Name: &zeroValue} s.GetName() @@ -25053,6 +27746,7 @@ func TestSBOMInfo_GetName(tt *testing.T) { } func TestSBOMInfo_GetSPDXID(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SBOMInfo{SPDXID: &zeroValue} s.GetSPDXID() @@ -25063,6 +27757,7 @@ func TestSBOMInfo_GetSPDXID(tt *testing.T) { } func TestSBOMInfo_GetSPDXVersion(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SBOMInfo{SPDXVersion: &zeroValue} s.GetSPDXVersion() @@ -25073,6 +27768,7 @@ func TestSBOMInfo_GetSPDXVersion(tt *testing.T) { } func TestScanningAnalysis_GetAnalysisKey(tt *testing.T) { + tt.Parallel() var zeroValue string s := &ScanningAnalysis{AnalysisKey: &zeroValue} s.GetAnalysisKey() @@ -25083,6 +27779,7 @@ func TestScanningAnalysis_GetAnalysisKey(tt *testing.T) { } func TestScanningAnalysis_GetCategory(tt *testing.T) { + tt.Parallel() var zeroValue string s := &ScanningAnalysis{Category: &zeroValue} s.GetCategory() @@ -25093,6 +27790,7 @@ func TestScanningAnalysis_GetCategory(tt *testing.T) { } func TestScanningAnalysis_GetCommitSHA(tt *testing.T) { + tt.Parallel() var zeroValue string s := &ScanningAnalysis{CommitSHA: &zeroValue} s.GetCommitSHA() @@ -25103,6 +27801,7 @@ func TestScanningAnalysis_GetCommitSHA(tt *testing.T) { } func TestScanningAnalysis_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp s := &ScanningAnalysis{CreatedAt: &zeroValue} s.GetCreatedAt() @@ -25113,6 +27812,7 @@ func TestScanningAnalysis_GetCreatedAt(tt *testing.T) { } func TestScanningAnalysis_GetDeletable(tt *testing.T) { + tt.Parallel() var zeroValue bool s := &ScanningAnalysis{Deletable: &zeroValue} s.GetDeletable() @@ -25123,6 +27823,7 @@ func TestScanningAnalysis_GetDeletable(tt *testing.T) { } func TestScanningAnalysis_GetEnvironment(tt *testing.T) { + tt.Parallel() var zeroValue string s := &ScanningAnalysis{Environment: &zeroValue} s.GetEnvironment() @@ -25133,6 +27834,7 @@ func TestScanningAnalysis_GetEnvironment(tt *testing.T) { } func TestScanningAnalysis_GetError(tt *testing.T) { + tt.Parallel() var zeroValue string s := &ScanningAnalysis{Error: &zeroValue} s.GetError() @@ -25143,6 +27845,7 @@ func TestScanningAnalysis_GetError(tt *testing.T) { } func TestScanningAnalysis_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 s := &ScanningAnalysis{ID: &zeroValue} s.GetID() @@ -25153,6 +27856,7 @@ func TestScanningAnalysis_GetID(tt *testing.T) { } func TestScanningAnalysis_GetRef(tt *testing.T) { + tt.Parallel() var zeroValue string s := &ScanningAnalysis{Ref: &zeroValue} s.GetRef() @@ -25163,6 +27867,7 @@ func TestScanningAnalysis_GetRef(tt *testing.T) { } func TestScanningAnalysis_GetResultsCount(tt *testing.T) { + tt.Parallel() var zeroValue int s := &ScanningAnalysis{ResultsCount: &zeroValue} s.GetResultsCount() @@ -25173,6 +27878,7 @@ func TestScanningAnalysis_GetResultsCount(tt *testing.T) { } func TestScanningAnalysis_GetRulesCount(tt *testing.T) { + tt.Parallel() var zeroValue int s := &ScanningAnalysis{RulesCount: &zeroValue} s.GetRulesCount() @@ -25183,6 +27889,7 @@ func TestScanningAnalysis_GetRulesCount(tt *testing.T) { } func TestScanningAnalysis_GetSarifID(tt *testing.T) { + tt.Parallel() var zeroValue string s := &ScanningAnalysis{SarifID: &zeroValue} s.GetSarifID() @@ -25193,6 +27900,7 @@ func TestScanningAnalysis_GetSarifID(tt *testing.T) { } func TestScanningAnalysis_GetTool(tt *testing.T) { + tt.Parallel() s := &ScanningAnalysis{} s.GetTool() s = nil @@ -25200,6 +27908,7 @@ func TestScanningAnalysis_GetTool(tt *testing.T) { } func TestScanningAnalysis_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string s := &ScanningAnalysis{URL: &zeroValue} s.GetURL() @@ -25210,6 +27919,7 @@ func TestScanningAnalysis_GetURL(tt *testing.T) { } func TestScanningAnalysis_GetWarning(tt *testing.T) { + tt.Parallel() var zeroValue string s := &ScanningAnalysis{Warning: &zeroValue} s.GetWarning() @@ -25220,6 +27930,7 @@ func TestScanningAnalysis_GetWarning(tt *testing.T) { } func TestSCIMMeta_GetCreated(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp s := &SCIMMeta{Created: &zeroValue} s.GetCreated() @@ -25230,6 +27941,7 @@ func TestSCIMMeta_GetCreated(tt *testing.T) { } func TestSCIMMeta_GetLastModified(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp s := &SCIMMeta{LastModified: &zeroValue} s.GetLastModified() @@ -25240,6 +27952,7 @@ func TestSCIMMeta_GetLastModified(tt *testing.T) { } func TestSCIMMeta_GetLocation(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SCIMMeta{Location: &zeroValue} s.GetLocation() @@ -25250,6 +27963,7 @@ func TestSCIMMeta_GetLocation(tt *testing.T) { } func TestSCIMMeta_GetResourceType(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SCIMMeta{ResourceType: &zeroValue} s.GetResourceType() @@ -25260,6 +27974,7 @@ func TestSCIMMeta_GetResourceType(tt *testing.T) { } func TestSCIMProvisionedIdentities_GetItemsPerPage(tt *testing.T) { + tt.Parallel() var zeroValue int s := &SCIMProvisionedIdentities{ItemsPerPage: &zeroValue} s.GetItemsPerPage() @@ -25270,6 +27985,7 @@ func TestSCIMProvisionedIdentities_GetItemsPerPage(tt *testing.T) { } func TestSCIMProvisionedIdentities_GetStartIndex(tt *testing.T) { + tt.Parallel() var zeroValue int s := &SCIMProvisionedIdentities{StartIndex: &zeroValue} s.GetStartIndex() @@ -25280,6 +27996,7 @@ func TestSCIMProvisionedIdentities_GetStartIndex(tt *testing.T) { } func TestSCIMProvisionedIdentities_GetTotalResults(tt *testing.T) { + tt.Parallel() var zeroValue int s := &SCIMProvisionedIdentities{TotalResults: &zeroValue} s.GetTotalResults() @@ -25290,6 +28007,7 @@ func TestSCIMProvisionedIdentities_GetTotalResults(tt *testing.T) { } func TestSCIMUserAttributes_GetActive(tt *testing.T) { + tt.Parallel() var zeroValue bool s := &SCIMUserAttributes{Active: &zeroValue} s.GetActive() @@ -25300,6 +28018,7 @@ func TestSCIMUserAttributes_GetActive(tt *testing.T) { } func TestSCIMUserAttributes_GetDisplayName(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SCIMUserAttributes{DisplayName: &zeroValue} s.GetDisplayName() @@ -25310,6 +28029,7 @@ func TestSCIMUserAttributes_GetDisplayName(tt *testing.T) { } func TestSCIMUserAttributes_GetExternalID(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SCIMUserAttributes{ExternalID: &zeroValue} s.GetExternalID() @@ -25320,6 +28040,7 @@ func TestSCIMUserAttributes_GetExternalID(tt *testing.T) { } func TestSCIMUserAttributes_GetID(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SCIMUserAttributes{ID: &zeroValue} s.GetID() @@ -25330,6 +28051,7 @@ func TestSCIMUserAttributes_GetID(tt *testing.T) { } func TestSCIMUserAttributes_GetMeta(tt *testing.T) { + tt.Parallel() s := &SCIMUserAttributes{} s.GetMeta() s = nil @@ -25337,6 +28059,7 @@ func TestSCIMUserAttributes_GetMeta(tt *testing.T) { } func TestSCIMUserEmail_GetPrimary(tt *testing.T) { + tt.Parallel() var zeroValue bool s := &SCIMUserEmail{Primary: &zeroValue} s.GetPrimary() @@ -25347,6 +28070,7 @@ func TestSCIMUserEmail_GetPrimary(tt *testing.T) { } func TestSCIMUserEmail_GetType(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SCIMUserEmail{Type: &zeroValue} s.GetType() @@ -25357,6 +28081,7 @@ func TestSCIMUserEmail_GetType(tt *testing.T) { } func TestSCIMUserName_GetFormatted(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SCIMUserName{Formatted: &zeroValue} s.GetFormatted() @@ -25367,6 +28092,7 @@ func TestSCIMUserName_GetFormatted(tt *testing.T) { } func TestSecretScanning_GetStatus(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SecretScanning{Status: &zeroValue} s.GetStatus() @@ -25377,6 +28103,7 @@ func TestSecretScanning_GetStatus(tt *testing.T) { } func TestSecretScanningAlert_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp s := &SecretScanningAlert{CreatedAt: &zeroValue} s.GetCreatedAt() @@ -25387,6 +28114,7 @@ func TestSecretScanningAlert_GetCreatedAt(tt *testing.T) { } func TestSecretScanningAlert_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SecretScanningAlert{HTMLURL: &zeroValue} s.GetHTMLURL() @@ -25397,6 +28125,7 @@ func TestSecretScanningAlert_GetHTMLURL(tt *testing.T) { } func TestSecretScanningAlert_GetLocationsURL(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SecretScanningAlert{LocationsURL: &zeroValue} s.GetLocationsURL() @@ -25407,6 +28136,7 @@ func TestSecretScanningAlert_GetLocationsURL(tt *testing.T) { } func TestSecretScanningAlert_GetNumber(tt *testing.T) { + tt.Parallel() var zeroValue int s := &SecretScanningAlert{Number: &zeroValue} s.GetNumber() @@ -25417,6 +28147,7 @@ func TestSecretScanningAlert_GetNumber(tt *testing.T) { } func TestSecretScanningAlert_GetPushProtectionBypassed(tt *testing.T) { + tt.Parallel() var zeroValue bool s := &SecretScanningAlert{PushProtectionBypassed: &zeroValue} s.GetPushProtectionBypassed() @@ -25427,6 +28158,7 @@ func TestSecretScanningAlert_GetPushProtectionBypassed(tt *testing.T) { } func TestSecretScanningAlert_GetPushProtectionBypassedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp s := &SecretScanningAlert{PushProtectionBypassedAt: &zeroValue} s.GetPushProtectionBypassedAt() @@ -25437,6 +28169,7 @@ func TestSecretScanningAlert_GetPushProtectionBypassedAt(tt *testing.T) { } func TestSecretScanningAlert_GetPushProtectionBypassedBy(tt *testing.T) { + tt.Parallel() s := &SecretScanningAlert{} s.GetPushProtectionBypassedBy() s = nil @@ -25444,6 +28177,7 @@ func TestSecretScanningAlert_GetPushProtectionBypassedBy(tt *testing.T) { } func TestSecretScanningAlert_GetRepository(tt *testing.T) { + tt.Parallel() s := &SecretScanningAlert{} s.GetRepository() s = nil @@ -25451,6 +28185,7 @@ func TestSecretScanningAlert_GetRepository(tt *testing.T) { } func TestSecretScanningAlert_GetResolution(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SecretScanningAlert{Resolution: &zeroValue} s.GetResolution() @@ -25461,6 +28196,7 @@ func TestSecretScanningAlert_GetResolution(tt *testing.T) { } func TestSecretScanningAlert_GetResolutionComment(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SecretScanningAlert{ResolutionComment: &zeroValue} s.GetResolutionComment() @@ -25471,6 +28207,7 @@ func TestSecretScanningAlert_GetResolutionComment(tt *testing.T) { } func TestSecretScanningAlert_GetResolvedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp s := &SecretScanningAlert{ResolvedAt: &zeroValue} s.GetResolvedAt() @@ -25481,6 +28218,7 @@ func TestSecretScanningAlert_GetResolvedAt(tt *testing.T) { } func TestSecretScanningAlert_GetResolvedBy(tt *testing.T) { + tt.Parallel() s := &SecretScanningAlert{} s.GetResolvedBy() s = nil @@ -25488,6 +28226,7 @@ func TestSecretScanningAlert_GetResolvedBy(tt *testing.T) { } func TestSecretScanningAlert_GetSecret(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SecretScanningAlert{Secret: &zeroValue} s.GetSecret() @@ -25498,6 +28237,7 @@ func TestSecretScanningAlert_GetSecret(tt *testing.T) { } func TestSecretScanningAlert_GetSecretType(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SecretScanningAlert{SecretType: &zeroValue} s.GetSecretType() @@ -25508,6 +28248,7 @@ func TestSecretScanningAlert_GetSecretType(tt *testing.T) { } func TestSecretScanningAlert_GetSecretTypeDisplayName(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SecretScanningAlert{SecretTypeDisplayName: &zeroValue} s.GetSecretTypeDisplayName() @@ -25518,6 +28259,7 @@ func TestSecretScanningAlert_GetSecretTypeDisplayName(tt *testing.T) { } func TestSecretScanningAlert_GetState(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SecretScanningAlert{State: &zeroValue} s.GetState() @@ -25528,6 +28270,7 @@ func TestSecretScanningAlert_GetState(tt *testing.T) { } func TestSecretScanningAlert_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp s := &SecretScanningAlert{UpdatedAt: &zeroValue} s.GetUpdatedAt() @@ -25538,6 +28281,7 @@ func TestSecretScanningAlert_GetUpdatedAt(tt *testing.T) { } func TestSecretScanningAlert_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SecretScanningAlert{URL: &zeroValue} s.GetURL() @@ -25548,6 +28292,7 @@ func TestSecretScanningAlert_GetURL(tt *testing.T) { } func TestSecretScanningAlertEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SecretScanningAlertEvent{Action: &zeroValue} s.GetAction() @@ -25558,6 +28303,7 @@ func TestSecretScanningAlertEvent_GetAction(tt *testing.T) { } func TestSecretScanningAlertEvent_GetAlert(tt *testing.T) { + tt.Parallel() s := &SecretScanningAlertEvent{} s.GetAlert() s = nil @@ -25565,6 +28311,7 @@ func TestSecretScanningAlertEvent_GetAlert(tt *testing.T) { } func TestSecretScanningAlertEvent_GetEnterprise(tt *testing.T) { + tt.Parallel() s := &SecretScanningAlertEvent{} s.GetEnterprise() s = nil @@ -25572,6 +28319,7 @@ func TestSecretScanningAlertEvent_GetEnterprise(tt *testing.T) { } func TestSecretScanningAlertEvent_GetInstallation(tt *testing.T) { + tt.Parallel() s := &SecretScanningAlertEvent{} s.GetInstallation() s = nil @@ -25579,6 +28327,7 @@ func TestSecretScanningAlertEvent_GetInstallation(tt *testing.T) { } func TestSecretScanningAlertEvent_GetOrganization(tt *testing.T) { + tt.Parallel() s := &SecretScanningAlertEvent{} s.GetOrganization() s = nil @@ -25586,6 +28335,7 @@ func TestSecretScanningAlertEvent_GetOrganization(tt *testing.T) { } func TestSecretScanningAlertEvent_GetRepo(tt *testing.T) { + tt.Parallel() s := &SecretScanningAlertEvent{} s.GetRepo() s = nil @@ -25593,6 +28343,7 @@ func TestSecretScanningAlertEvent_GetRepo(tt *testing.T) { } func TestSecretScanningAlertEvent_GetSender(tt *testing.T) { + tt.Parallel() s := &SecretScanningAlertEvent{} s.GetSender() s = nil @@ -25600,6 +28351,7 @@ func TestSecretScanningAlertEvent_GetSender(tt *testing.T) { } func TestSecretScanningAlertLocation_GetDetails(tt *testing.T) { + tt.Parallel() s := &SecretScanningAlertLocation{} s.GetDetails() s = nil @@ -25607,6 +28359,7 @@ func TestSecretScanningAlertLocation_GetDetails(tt *testing.T) { } func TestSecretScanningAlertLocation_GetType(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SecretScanningAlertLocation{Type: &zeroValue} s.GetType() @@ -25617,6 +28370,7 @@ func TestSecretScanningAlertLocation_GetType(tt *testing.T) { } func TestSecretScanningAlertLocationDetails_GetBlobSHA(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SecretScanningAlertLocationDetails{BlobSHA: &zeroValue} s.GetBlobSHA() @@ -25627,6 +28381,7 @@ func TestSecretScanningAlertLocationDetails_GetBlobSHA(tt *testing.T) { } func TestSecretScanningAlertLocationDetails_GetBlobURL(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SecretScanningAlertLocationDetails{BlobURL: &zeroValue} s.GetBlobURL() @@ -25637,6 +28392,7 @@ func TestSecretScanningAlertLocationDetails_GetBlobURL(tt *testing.T) { } func TestSecretScanningAlertLocationDetails_GetCommitSHA(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SecretScanningAlertLocationDetails{CommitSHA: &zeroValue} s.GetCommitSHA() @@ -25647,6 +28403,7 @@ func TestSecretScanningAlertLocationDetails_GetCommitSHA(tt *testing.T) { } func TestSecretScanningAlertLocationDetails_GetCommitURL(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SecretScanningAlertLocationDetails{CommitURL: &zeroValue} s.GetCommitURL() @@ -25657,6 +28414,7 @@ func TestSecretScanningAlertLocationDetails_GetCommitURL(tt *testing.T) { } func TestSecretScanningAlertLocationDetails_GetEndColumn(tt *testing.T) { + tt.Parallel() var zeroValue int s := &SecretScanningAlertLocationDetails{EndColumn: &zeroValue} s.GetEndColumn() @@ -25667,6 +28425,7 @@ func TestSecretScanningAlertLocationDetails_GetEndColumn(tt *testing.T) { } func TestSecretScanningAlertLocationDetails_GetEndLine(tt *testing.T) { + tt.Parallel() var zeroValue int s := &SecretScanningAlertLocationDetails{EndLine: &zeroValue} s.GetEndLine() @@ -25677,6 +28436,7 @@ func TestSecretScanningAlertLocationDetails_GetEndLine(tt *testing.T) { } func TestSecretScanningAlertLocationDetails_GetPath(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SecretScanningAlertLocationDetails{Path: &zeroValue} s.GetPath() @@ -25687,6 +28447,7 @@ func TestSecretScanningAlertLocationDetails_GetPath(tt *testing.T) { } func TestSecretScanningAlertLocationDetails_GetStartColumn(tt *testing.T) { + tt.Parallel() var zeroValue int s := &SecretScanningAlertLocationDetails{StartColumn: &zeroValue} s.GetStartColumn() @@ -25697,6 +28458,7 @@ func TestSecretScanningAlertLocationDetails_GetStartColumn(tt *testing.T) { } func TestSecretScanningAlertLocationDetails_GetStartline(tt *testing.T) { + tt.Parallel() var zeroValue int s := &SecretScanningAlertLocationDetails{Startline: &zeroValue} s.GetStartline() @@ -25707,6 +28469,7 @@ func TestSecretScanningAlertLocationDetails_GetStartline(tt *testing.T) { } func TestSecretScanningAlertUpdateOptions_GetResolution(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SecretScanningAlertUpdateOptions{Resolution: &zeroValue} s.GetResolution() @@ -25717,6 +28480,7 @@ func TestSecretScanningAlertUpdateOptions_GetResolution(tt *testing.T) { } func TestSecretScanningPushProtection_GetStatus(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SecretScanningPushProtection{Status: &zeroValue} s.GetStatus() @@ -25727,6 +28491,7 @@ func TestSecretScanningPushProtection_GetStatus(tt *testing.T) { } func TestSecretScanningValidityChecks_GetStatus(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SecretScanningValidityChecks{Status: &zeroValue} s.GetStatus() @@ -25737,6 +28502,7 @@ func TestSecretScanningValidityChecks_GetStatus(tt *testing.T) { } func TestSecurityAdvisory_GetAuthor(tt *testing.T) { + tt.Parallel() s := &SecurityAdvisory{} s.GetAuthor() s = nil @@ -25744,6 +28510,7 @@ func TestSecurityAdvisory_GetAuthor(tt *testing.T) { } func TestSecurityAdvisory_GetClosedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp s := &SecurityAdvisory{ClosedAt: &zeroValue} s.GetClosedAt() @@ -25754,6 +28521,7 @@ func TestSecurityAdvisory_GetClosedAt(tt *testing.T) { } func TestSecurityAdvisory_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp s := &SecurityAdvisory{CreatedAt: &zeroValue} s.GetCreatedAt() @@ -25764,6 +28532,7 @@ func TestSecurityAdvisory_GetCreatedAt(tt *testing.T) { } func TestSecurityAdvisory_GetCVEID(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SecurityAdvisory{CVEID: &zeroValue} s.GetCVEID() @@ -25774,6 +28543,7 @@ func TestSecurityAdvisory_GetCVEID(tt *testing.T) { } func TestSecurityAdvisory_GetCVSS(tt *testing.T) { + tt.Parallel() s := &SecurityAdvisory{} s.GetCVSS() s = nil @@ -25781,6 +28551,7 @@ func TestSecurityAdvisory_GetCVSS(tt *testing.T) { } func TestSecurityAdvisory_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SecurityAdvisory{Description: &zeroValue} s.GetDescription() @@ -25791,6 +28562,7 @@ func TestSecurityAdvisory_GetDescription(tt *testing.T) { } func TestSecurityAdvisory_GetGHSAID(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SecurityAdvisory{GHSAID: &zeroValue} s.GetGHSAID() @@ -25801,6 +28573,7 @@ func TestSecurityAdvisory_GetGHSAID(tt *testing.T) { } func TestSecurityAdvisory_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SecurityAdvisory{HTMLURL: &zeroValue} s.GetHTMLURL() @@ -25811,6 +28584,7 @@ func TestSecurityAdvisory_GetHTMLURL(tt *testing.T) { } func TestSecurityAdvisory_GetPrivateFork(tt *testing.T) { + tt.Parallel() s := &SecurityAdvisory{} s.GetPrivateFork() s = nil @@ -25818,6 +28592,7 @@ func TestSecurityAdvisory_GetPrivateFork(tt *testing.T) { } func TestSecurityAdvisory_GetPublishedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp s := &SecurityAdvisory{PublishedAt: &zeroValue} s.GetPublishedAt() @@ -25828,6 +28603,7 @@ func TestSecurityAdvisory_GetPublishedAt(tt *testing.T) { } func TestSecurityAdvisory_GetPublisher(tt *testing.T) { + tt.Parallel() s := &SecurityAdvisory{} s.GetPublisher() s = nil @@ -25835,6 +28611,7 @@ func TestSecurityAdvisory_GetPublisher(tt *testing.T) { } func TestSecurityAdvisory_GetSeverity(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SecurityAdvisory{Severity: &zeroValue} s.GetSeverity() @@ -25845,6 +28622,7 @@ func TestSecurityAdvisory_GetSeverity(tt *testing.T) { } func TestSecurityAdvisory_GetState(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SecurityAdvisory{State: &zeroValue} s.GetState() @@ -25855,6 +28633,7 @@ func TestSecurityAdvisory_GetState(tt *testing.T) { } func TestSecurityAdvisory_GetSubmission(tt *testing.T) { + tt.Parallel() s := &SecurityAdvisory{} s.GetSubmission() s = nil @@ -25862,6 +28641,7 @@ func TestSecurityAdvisory_GetSubmission(tt *testing.T) { } func TestSecurityAdvisory_GetSummary(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SecurityAdvisory{Summary: &zeroValue} s.GetSummary() @@ -25872,6 +28652,7 @@ func TestSecurityAdvisory_GetSummary(tt *testing.T) { } func TestSecurityAdvisory_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp s := &SecurityAdvisory{UpdatedAt: &zeroValue} s.GetUpdatedAt() @@ -25882,6 +28663,7 @@ func TestSecurityAdvisory_GetUpdatedAt(tt *testing.T) { } func TestSecurityAdvisory_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SecurityAdvisory{URL: &zeroValue} s.GetURL() @@ -25892,6 +28674,7 @@ func TestSecurityAdvisory_GetURL(tt *testing.T) { } func TestSecurityAdvisory_GetWithdrawnAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp s := &SecurityAdvisory{WithdrawnAt: &zeroValue} s.GetWithdrawnAt() @@ -25902,6 +28685,7 @@ func TestSecurityAdvisory_GetWithdrawnAt(tt *testing.T) { } func TestSecurityAdvisoryEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SecurityAdvisoryEvent{Action: &zeroValue} s.GetAction() @@ -25912,6 +28696,7 @@ func TestSecurityAdvisoryEvent_GetAction(tt *testing.T) { } func TestSecurityAdvisoryEvent_GetEnterprise(tt *testing.T) { + tt.Parallel() s := &SecurityAdvisoryEvent{} s.GetEnterprise() s = nil @@ -25919,6 +28704,7 @@ func TestSecurityAdvisoryEvent_GetEnterprise(tt *testing.T) { } func TestSecurityAdvisoryEvent_GetInstallation(tt *testing.T) { + tt.Parallel() s := &SecurityAdvisoryEvent{} s.GetInstallation() s = nil @@ -25926,6 +28712,7 @@ func TestSecurityAdvisoryEvent_GetInstallation(tt *testing.T) { } func TestSecurityAdvisoryEvent_GetOrganization(tt *testing.T) { + tt.Parallel() s := &SecurityAdvisoryEvent{} s.GetOrganization() s = nil @@ -25933,6 +28720,7 @@ func TestSecurityAdvisoryEvent_GetOrganization(tt *testing.T) { } func TestSecurityAdvisoryEvent_GetRepository(tt *testing.T) { + tt.Parallel() s := &SecurityAdvisoryEvent{} s.GetRepository() s = nil @@ -25940,6 +28728,7 @@ func TestSecurityAdvisoryEvent_GetRepository(tt *testing.T) { } func TestSecurityAdvisoryEvent_GetSecurityAdvisory(tt *testing.T) { + tt.Parallel() s := &SecurityAdvisoryEvent{} s.GetSecurityAdvisory() s = nil @@ -25947,6 +28736,7 @@ func TestSecurityAdvisoryEvent_GetSecurityAdvisory(tt *testing.T) { } func TestSecurityAdvisoryEvent_GetSender(tt *testing.T) { + tt.Parallel() s := &SecurityAdvisoryEvent{} s.GetSender() s = nil @@ -25954,6 +28744,7 @@ func TestSecurityAdvisoryEvent_GetSender(tt *testing.T) { } func TestSecurityAdvisorySubmission_GetAccepted(tt *testing.T) { + tt.Parallel() var zeroValue bool s := &SecurityAdvisorySubmission{Accepted: &zeroValue} s.GetAccepted() @@ -25964,6 +28755,7 @@ func TestSecurityAdvisorySubmission_GetAccepted(tt *testing.T) { } func TestSecurityAndAnalysis_GetAdvancedSecurity(tt *testing.T) { + tt.Parallel() s := &SecurityAndAnalysis{} s.GetAdvancedSecurity() s = nil @@ -25971,6 +28763,7 @@ func TestSecurityAndAnalysis_GetAdvancedSecurity(tt *testing.T) { } func TestSecurityAndAnalysis_GetDependabotSecurityUpdates(tt *testing.T) { + tt.Parallel() s := &SecurityAndAnalysis{} s.GetDependabotSecurityUpdates() s = nil @@ -25978,6 +28771,7 @@ func TestSecurityAndAnalysis_GetDependabotSecurityUpdates(tt *testing.T) { } func TestSecurityAndAnalysis_GetSecretScanning(tt *testing.T) { + tt.Parallel() s := &SecurityAndAnalysis{} s.GetSecretScanning() s = nil @@ -25985,6 +28779,7 @@ func TestSecurityAndAnalysis_GetSecretScanning(tt *testing.T) { } func TestSecurityAndAnalysis_GetSecretScanningPushProtection(tt *testing.T) { + tt.Parallel() s := &SecurityAndAnalysis{} s.GetSecretScanningPushProtection() s = nil @@ -25992,6 +28787,7 @@ func TestSecurityAndAnalysis_GetSecretScanningPushProtection(tt *testing.T) { } func TestSecurityAndAnalysis_GetSecretScanningValidityChecks(tt *testing.T) { + tt.Parallel() s := &SecurityAndAnalysis{} s.GetSecretScanningValidityChecks() s = nil @@ -25999,6 +28795,7 @@ func TestSecurityAndAnalysis_GetSecretScanningValidityChecks(tt *testing.T) { } func TestSecurityAndAnalysisChange_GetFrom(tt *testing.T) { + tt.Parallel() s := &SecurityAndAnalysisChange{} s.GetFrom() s = nil @@ -26006,6 +28803,7 @@ func TestSecurityAndAnalysisChange_GetFrom(tt *testing.T) { } func TestSecurityAndAnalysisChangeFrom_GetSecurityAndAnalysis(tt *testing.T) { + tt.Parallel() s := &SecurityAndAnalysisChangeFrom{} s.GetSecurityAndAnalysis() s = nil @@ -26013,6 +28811,7 @@ func TestSecurityAndAnalysisChangeFrom_GetSecurityAndAnalysis(tt *testing.T) { } func TestSecurityAndAnalysisEvent_GetChanges(tt *testing.T) { + tt.Parallel() s := &SecurityAndAnalysisEvent{} s.GetChanges() s = nil @@ -26020,6 +28819,7 @@ func TestSecurityAndAnalysisEvent_GetChanges(tt *testing.T) { } func TestSecurityAndAnalysisEvent_GetEnterprise(tt *testing.T) { + tt.Parallel() s := &SecurityAndAnalysisEvent{} s.GetEnterprise() s = nil @@ -26027,6 +28827,7 @@ func TestSecurityAndAnalysisEvent_GetEnterprise(tt *testing.T) { } func TestSecurityAndAnalysisEvent_GetInstallation(tt *testing.T) { + tt.Parallel() s := &SecurityAndAnalysisEvent{} s.GetInstallation() s = nil @@ -26034,6 +28835,7 @@ func TestSecurityAndAnalysisEvent_GetInstallation(tt *testing.T) { } func TestSecurityAndAnalysisEvent_GetOrganization(tt *testing.T) { + tt.Parallel() s := &SecurityAndAnalysisEvent{} s.GetOrganization() s = nil @@ -26041,6 +28843,7 @@ func TestSecurityAndAnalysisEvent_GetOrganization(tt *testing.T) { } func TestSecurityAndAnalysisEvent_GetRepository(tt *testing.T) { + tt.Parallel() s := &SecurityAndAnalysisEvent{} s.GetRepository() s = nil @@ -26048,6 +28851,7 @@ func TestSecurityAndAnalysisEvent_GetRepository(tt *testing.T) { } func TestSecurityAndAnalysisEvent_GetSender(tt *testing.T) { + tt.Parallel() s := &SecurityAndAnalysisEvent{} s.GetSender() s = nil @@ -26055,6 +28859,7 @@ func TestSecurityAndAnalysisEvent_GetSender(tt *testing.T) { } func TestSelectedReposList_GetTotalCount(tt *testing.T) { + tt.Parallel() var zeroValue int s := &SelectedReposList{TotalCount: &zeroValue} s.GetTotalCount() @@ -26065,6 +28870,7 @@ func TestSelectedReposList_GetTotalCount(tt *testing.T) { } func TestSignatureRequirementEnforcementLevelChanges_GetFrom(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SignatureRequirementEnforcementLevelChanges{From: &zeroValue} s.GetFrom() @@ -26075,6 +28881,7 @@ func TestSignatureRequirementEnforcementLevelChanges_GetFrom(tt *testing.T) { } func TestSignaturesProtectedBranch_GetEnabled(tt *testing.T) { + tt.Parallel() var zeroValue bool s := &SignaturesProtectedBranch{Enabled: &zeroValue} s.GetEnabled() @@ -26085,6 +28892,7 @@ func TestSignaturesProtectedBranch_GetEnabled(tt *testing.T) { } func TestSignaturesProtectedBranch_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SignaturesProtectedBranch{URL: &zeroValue} s.GetURL() @@ -26095,6 +28903,7 @@ func TestSignaturesProtectedBranch_GetURL(tt *testing.T) { } func TestSignatureVerification_GetPayload(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SignatureVerification{Payload: &zeroValue} s.GetPayload() @@ -26105,6 +28914,7 @@ func TestSignatureVerification_GetPayload(tt *testing.T) { } func TestSignatureVerification_GetReason(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SignatureVerification{Reason: &zeroValue} s.GetReason() @@ -26115,6 +28925,7 @@ func TestSignatureVerification_GetReason(tt *testing.T) { } func TestSignatureVerification_GetSignature(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SignatureVerification{Signature: &zeroValue} s.GetSignature() @@ -26125,6 +28936,7 @@ func TestSignatureVerification_GetSignature(tt *testing.T) { } func TestSignatureVerification_GetVerified(tt *testing.T) { + tt.Parallel() var zeroValue bool s := &SignatureVerification{Verified: &zeroValue} s.GetVerified() @@ -26135,6 +28947,7 @@ func TestSignatureVerification_GetVerified(tt *testing.T) { } func TestSource_GetActor(tt *testing.T) { + tt.Parallel() s := &Source{} s.GetActor() s = nil @@ -26142,6 +28955,7 @@ func TestSource_GetActor(tt *testing.T) { } func TestSource_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 s := &Source{ID: &zeroValue} s.GetID() @@ -26152,6 +28966,7 @@ func TestSource_GetID(tt *testing.T) { } func TestSource_GetIssue(tt *testing.T) { + tt.Parallel() s := &Source{} s.GetIssue() s = nil @@ -26159,6 +28974,7 @@ func TestSource_GetIssue(tt *testing.T) { } func TestSource_GetType(tt *testing.T) { + tt.Parallel() var zeroValue string s := &Source{Type: &zeroValue} s.GetType() @@ -26169,6 +28985,7 @@ func TestSource_GetType(tt *testing.T) { } func TestSource_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string s := &Source{URL: &zeroValue} s.GetURL() @@ -26179,6 +28996,7 @@ func TestSource_GetURL(tt *testing.T) { } func TestSourceImportAuthor_GetEmail(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SourceImportAuthor{Email: &zeroValue} s.GetEmail() @@ -26189,6 +29007,7 @@ func TestSourceImportAuthor_GetEmail(tt *testing.T) { } func TestSourceImportAuthor_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 s := &SourceImportAuthor{ID: &zeroValue} s.GetID() @@ -26199,6 +29018,7 @@ func TestSourceImportAuthor_GetID(tt *testing.T) { } func TestSourceImportAuthor_GetImportURL(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SourceImportAuthor{ImportURL: &zeroValue} s.GetImportURL() @@ -26209,6 +29029,7 @@ func TestSourceImportAuthor_GetImportURL(tt *testing.T) { } func TestSourceImportAuthor_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SourceImportAuthor{Name: &zeroValue} s.GetName() @@ -26219,6 +29040,7 @@ func TestSourceImportAuthor_GetName(tt *testing.T) { } func TestSourceImportAuthor_GetRemoteID(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SourceImportAuthor{RemoteID: &zeroValue} s.GetRemoteID() @@ -26229,6 +29051,7 @@ func TestSourceImportAuthor_GetRemoteID(tt *testing.T) { } func TestSourceImportAuthor_GetRemoteName(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SourceImportAuthor{RemoteName: &zeroValue} s.GetRemoteName() @@ -26239,6 +29062,7 @@ func TestSourceImportAuthor_GetRemoteName(tt *testing.T) { } func TestSourceImportAuthor_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SourceImportAuthor{URL: &zeroValue} s.GetURL() @@ -26249,6 +29073,7 @@ func TestSourceImportAuthor_GetURL(tt *testing.T) { } func TestSponsorshipChanges_GetPrivacyLevel(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SponsorshipChanges{PrivacyLevel: &zeroValue} s.GetPrivacyLevel() @@ -26259,6 +29084,7 @@ func TestSponsorshipChanges_GetPrivacyLevel(tt *testing.T) { } func TestSponsorshipChanges_GetTier(tt *testing.T) { + tt.Parallel() s := &SponsorshipChanges{} s.GetTier() s = nil @@ -26266,6 +29092,7 @@ func TestSponsorshipChanges_GetTier(tt *testing.T) { } func TestSponsorshipEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SponsorshipEvent{Action: &zeroValue} s.GetAction() @@ -26276,6 +29103,7 @@ func TestSponsorshipEvent_GetAction(tt *testing.T) { } func TestSponsorshipEvent_GetChanges(tt *testing.T) { + tt.Parallel() s := &SponsorshipEvent{} s.GetChanges() s = nil @@ -26283,6 +29111,7 @@ func TestSponsorshipEvent_GetChanges(tt *testing.T) { } func TestSponsorshipEvent_GetEffectiveDate(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SponsorshipEvent{EffectiveDate: &zeroValue} s.GetEffectiveDate() @@ -26293,6 +29122,7 @@ func TestSponsorshipEvent_GetEffectiveDate(tt *testing.T) { } func TestSponsorshipEvent_GetInstallation(tt *testing.T) { + tt.Parallel() s := &SponsorshipEvent{} s.GetInstallation() s = nil @@ -26300,6 +29130,7 @@ func TestSponsorshipEvent_GetInstallation(tt *testing.T) { } func TestSponsorshipEvent_GetOrganization(tt *testing.T) { + tt.Parallel() s := &SponsorshipEvent{} s.GetOrganization() s = nil @@ -26307,6 +29138,7 @@ func TestSponsorshipEvent_GetOrganization(tt *testing.T) { } func TestSponsorshipEvent_GetRepository(tt *testing.T) { + tt.Parallel() s := &SponsorshipEvent{} s.GetRepository() s = nil @@ -26314,6 +29146,7 @@ func TestSponsorshipEvent_GetRepository(tt *testing.T) { } func TestSponsorshipEvent_GetSender(tt *testing.T) { + tt.Parallel() s := &SponsorshipEvent{} s.GetSender() s = nil @@ -26321,6 +29154,7 @@ func TestSponsorshipEvent_GetSender(tt *testing.T) { } func TestSponsorshipTier_GetFrom(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SponsorshipTier{From: &zeroValue} s.GetFrom() @@ -26331,6 +29165,7 @@ func TestSponsorshipTier_GetFrom(tt *testing.T) { } func TestSSHSigningKey_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp s := &SSHSigningKey{CreatedAt: &zeroValue} s.GetCreatedAt() @@ -26341,6 +29176,7 @@ func TestSSHSigningKey_GetCreatedAt(tt *testing.T) { } func TestSSHSigningKey_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 s := &SSHSigningKey{ID: &zeroValue} s.GetID() @@ -26351,6 +29187,7 @@ func TestSSHSigningKey_GetID(tt *testing.T) { } func TestSSHSigningKey_GetKey(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SSHSigningKey{Key: &zeroValue} s.GetKey() @@ -26361,6 +29198,7 @@ func TestSSHSigningKey_GetKey(tt *testing.T) { } func TestSSHSigningKey_GetTitle(tt *testing.T) { + tt.Parallel() var zeroValue string s := &SSHSigningKey{Title: &zeroValue} s.GetTitle() @@ -26371,6 +29209,7 @@ func TestSSHSigningKey_GetTitle(tt *testing.T) { } func TestStarEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string s := &StarEvent{Action: &zeroValue} s.GetAction() @@ -26381,6 +29220,7 @@ func TestStarEvent_GetAction(tt *testing.T) { } func TestStarEvent_GetInstallation(tt *testing.T) { + tt.Parallel() s := &StarEvent{} s.GetInstallation() s = nil @@ -26388,6 +29228,7 @@ func TestStarEvent_GetInstallation(tt *testing.T) { } func TestStarEvent_GetOrg(tt *testing.T) { + tt.Parallel() s := &StarEvent{} s.GetOrg() s = nil @@ -26395,6 +29236,7 @@ func TestStarEvent_GetOrg(tt *testing.T) { } func TestStarEvent_GetRepo(tt *testing.T) { + tt.Parallel() s := &StarEvent{} s.GetRepo() s = nil @@ -26402,6 +29244,7 @@ func TestStarEvent_GetRepo(tt *testing.T) { } func TestStarEvent_GetSender(tt *testing.T) { + tt.Parallel() s := &StarEvent{} s.GetSender() s = nil @@ -26409,6 +29252,7 @@ func TestStarEvent_GetSender(tt *testing.T) { } func TestStarEvent_GetStarredAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp s := &StarEvent{StarredAt: &zeroValue} s.GetStarredAt() @@ -26419,6 +29263,7 @@ func TestStarEvent_GetStarredAt(tt *testing.T) { } func TestStargazer_GetStarredAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp s := &Stargazer{StarredAt: &zeroValue} s.GetStarredAt() @@ -26429,6 +29274,7 @@ func TestStargazer_GetStarredAt(tt *testing.T) { } func TestStargazer_GetUser(tt *testing.T) { + tt.Parallel() s := &Stargazer{} s.GetUser() s = nil @@ -26436,6 +29282,7 @@ func TestStargazer_GetUser(tt *testing.T) { } func TestStarredRepository_GetRepository(tt *testing.T) { + tt.Parallel() s := &StarredRepository{} s.GetRepository() s = nil @@ -26443,6 +29290,7 @@ func TestStarredRepository_GetRepository(tt *testing.T) { } func TestStarredRepository_GetStarredAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp s := &StarredRepository{StarredAt: &zeroValue} s.GetStarredAt() @@ -26453,6 +29301,7 @@ func TestStarredRepository_GetStarredAt(tt *testing.T) { } func TestStatusEvent_GetCommit(tt *testing.T) { + tt.Parallel() s := &StatusEvent{} s.GetCommit() s = nil @@ -26460,6 +29309,7 @@ func TestStatusEvent_GetCommit(tt *testing.T) { } func TestStatusEvent_GetContext(tt *testing.T) { + tt.Parallel() var zeroValue string s := &StatusEvent{Context: &zeroValue} s.GetContext() @@ -26470,6 +29320,7 @@ func TestStatusEvent_GetContext(tt *testing.T) { } func TestStatusEvent_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp s := &StatusEvent{CreatedAt: &zeroValue} s.GetCreatedAt() @@ -26480,6 +29331,7 @@ func TestStatusEvent_GetCreatedAt(tt *testing.T) { } func TestStatusEvent_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string s := &StatusEvent{Description: &zeroValue} s.GetDescription() @@ -26490,6 +29342,7 @@ func TestStatusEvent_GetDescription(tt *testing.T) { } func TestStatusEvent_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 s := &StatusEvent{ID: &zeroValue} s.GetID() @@ -26500,6 +29353,7 @@ func TestStatusEvent_GetID(tt *testing.T) { } func TestStatusEvent_GetInstallation(tt *testing.T) { + tt.Parallel() s := &StatusEvent{} s.GetInstallation() s = nil @@ -26507,6 +29361,7 @@ func TestStatusEvent_GetInstallation(tt *testing.T) { } func TestStatusEvent_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string s := &StatusEvent{Name: &zeroValue} s.GetName() @@ -26517,6 +29372,7 @@ func TestStatusEvent_GetName(tt *testing.T) { } func TestStatusEvent_GetOrg(tt *testing.T) { + tt.Parallel() s := &StatusEvent{} s.GetOrg() s = nil @@ -26524,6 +29380,7 @@ func TestStatusEvent_GetOrg(tt *testing.T) { } func TestStatusEvent_GetRepo(tt *testing.T) { + tt.Parallel() s := &StatusEvent{} s.GetRepo() s = nil @@ -26531,6 +29388,7 @@ func TestStatusEvent_GetRepo(tt *testing.T) { } func TestStatusEvent_GetSender(tt *testing.T) { + tt.Parallel() s := &StatusEvent{} s.GetSender() s = nil @@ -26538,6 +29396,7 @@ func TestStatusEvent_GetSender(tt *testing.T) { } func TestStatusEvent_GetSHA(tt *testing.T) { + tt.Parallel() var zeroValue string s := &StatusEvent{SHA: &zeroValue} s.GetSHA() @@ -26548,6 +29407,7 @@ func TestStatusEvent_GetSHA(tt *testing.T) { } func TestStatusEvent_GetState(tt *testing.T) { + tt.Parallel() var zeroValue string s := &StatusEvent{State: &zeroValue} s.GetState() @@ -26558,6 +29418,7 @@ func TestStatusEvent_GetState(tt *testing.T) { } func TestStatusEvent_GetTargetURL(tt *testing.T) { + tt.Parallel() var zeroValue string s := &StatusEvent{TargetURL: &zeroValue} s.GetTargetURL() @@ -26568,6 +29429,7 @@ func TestStatusEvent_GetTargetURL(tt *testing.T) { } func TestStatusEvent_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp s := &StatusEvent{UpdatedAt: &zeroValue} s.GetUpdatedAt() @@ -26578,6 +29440,7 @@ func TestStatusEvent_GetUpdatedAt(tt *testing.T) { } func TestSubscription_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp s := &Subscription{CreatedAt: &zeroValue} s.GetCreatedAt() @@ -26588,6 +29451,7 @@ func TestSubscription_GetCreatedAt(tt *testing.T) { } func TestSubscription_GetIgnored(tt *testing.T) { + tt.Parallel() var zeroValue bool s := &Subscription{Ignored: &zeroValue} s.GetIgnored() @@ -26598,6 +29462,7 @@ func TestSubscription_GetIgnored(tt *testing.T) { } func TestSubscription_GetReason(tt *testing.T) { + tt.Parallel() var zeroValue string s := &Subscription{Reason: &zeroValue} s.GetReason() @@ -26608,6 +29473,7 @@ func TestSubscription_GetReason(tt *testing.T) { } func TestSubscription_GetRepositoryURL(tt *testing.T) { + tt.Parallel() var zeroValue string s := &Subscription{RepositoryURL: &zeroValue} s.GetRepositoryURL() @@ -26618,6 +29484,7 @@ func TestSubscription_GetRepositoryURL(tt *testing.T) { } func TestSubscription_GetSubscribed(tt *testing.T) { + tt.Parallel() var zeroValue bool s := &Subscription{Subscribed: &zeroValue} s.GetSubscribed() @@ -26628,6 +29495,7 @@ func TestSubscription_GetSubscribed(tt *testing.T) { } func TestSubscription_GetThreadURL(tt *testing.T) { + tt.Parallel() var zeroValue string s := &Subscription{ThreadURL: &zeroValue} s.GetThreadURL() @@ -26638,6 +29506,7 @@ func TestSubscription_GetThreadURL(tt *testing.T) { } func TestSubscription_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string s := &Subscription{URL: &zeroValue} s.GetURL() @@ -26648,6 +29517,7 @@ func TestSubscription_GetURL(tt *testing.T) { } func TestTag_GetMessage(tt *testing.T) { + tt.Parallel() var zeroValue string t := &Tag{Message: &zeroValue} t.GetMessage() @@ -26658,6 +29528,7 @@ func TestTag_GetMessage(tt *testing.T) { } func TestTag_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string t := &Tag{NodeID: &zeroValue} t.GetNodeID() @@ -26668,6 +29539,7 @@ func TestTag_GetNodeID(tt *testing.T) { } func TestTag_GetObject(tt *testing.T) { + tt.Parallel() t := &Tag{} t.GetObject() t = nil @@ -26675,6 +29547,7 @@ func TestTag_GetObject(tt *testing.T) { } func TestTag_GetSHA(tt *testing.T) { + tt.Parallel() var zeroValue string t := &Tag{SHA: &zeroValue} t.GetSHA() @@ -26685,6 +29558,7 @@ func TestTag_GetSHA(tt *testing.T) { } func TestTag_GetTag(tt *testing.T) { + tt.Parallel() var zeroValue string t := &Tag{Tag: &zeroValue} t.GetTag() @@ -26695,6 +29569,7 @@ func TestTag_GetTag(tt *testing.T) { } func TestTag_GetTagger(tt *testing.T) { + tt.Parallel() t := &Tag{} t.GetTagger() t = nil @@ -26702,6 +29577,7 @@ func TestTag_GetTagger(tt *testing.T) { } func TestTag_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string t := &Tag{URL: &zeroValue} t.GetURL() @@ -26712,6 +29588,7 @@ func TestTag_GetURL(tt *testing.T) { } func TestTag_GetVerification(tt *testing.T) { + tt.Parallel() t := &Tag{} t.GetVerification() t = nil @@ -26719,6 +29596,7 @@ func TestTag_GetVerification(tt *testing.T) { } func TestTagProtection_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 t := &TagProtection{ID: &zeroValue} t.GetID() @@ -26729,6 +29607,7 @@ func TestTagProtection_GetID(tt *testing.T) { } func TestTagProtection_GetPattern(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TagProtection{Pattern: &zeroValue} t.GetPattern() @@ -26739,6 +29618,7 @@ func TestTagProtection_GetPattern(tt *testing.T) { } func TestTaskStep_GetCompletedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp t := &TaskStep{CompletedAt: &zeroValue} t.GetCompletedAt() @@ -26749,6 +29629,7 @@ func TestTaskStep_GetCompletedAt(tt *testing.T) { } func TestTaskStep_GetConclusion(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TaskStep{Conclusion: &zeroValue} t.GetConclusion() @@ -26759,6 +29640,7 @@ func TestTaskStep_GetConclusion(tt *testing.T) { } func TestTaskStep_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TaskStep{Name: &zeroValue} t.GetName() @@ -26769,6 +29651,7 @@ func TestTaskStep_GetName(tt *testing.T) { } func TestTaskStep_GetNumber(tt *testing.T) { + tt.Parallel() var zeroValue int64 t := &TaskStep{Number: &zeroValue} t.GetNumber() @@ -26779,6 +29662,7 @@ func TestTaskStep_GetNumber(tt *testing.T) { } func TestTaskStep_GetStartedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp t := &TaskStep{StartedAt: &zeroValue} t.GetStartedAt() @@ -26789,6 +29673,7 @@ func TestTaskStep_GetStartedAt(tt *testing.T) { } func TestTaskStep_GetStatus(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TaskStep{Status: &zeroValue} t.GetStatus() @@ -26799,6 +29684,7 @@ func TestTaskStep_GetStatus(tt *testing.T) { } func TestTeam_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string t := &Team{Description: &zeroValue} t.GetDescription() @@ -26809,6 +29695,7 @@ func TestTeam_GetDescription(tt *testing.T) { } func TestTeam_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string t := &Team{HTMLURL: &zeroValue} t.GetHTMLURL() @@ -26819,6 +29706,7 @@ func TestTeam_GetHTMLURL(tt *testing.T) { } func TestTeam_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 t := &Team{ID: &zeroValue} t.GetID() @@ -26829,6 +29717,7 @@ func TestTeam_GetID(tt *testing.T) { } func TestTeam_GetLDAPDN(tt *testing.T) { + tt.Parallel() var zeroValue string t := &Team{LDAPDN: &zeroValue} t.GetLDAPDN() @@ -26839,6 +29728,7 @@ func TestTeam_GetLDAPDN(tt *testing.T) { } func TestTeam_GetMembersCount(tt *testing.T) { + tt.Parallel() var zeroValue int t := &Team{MembersCount: &zeroValue} t.GetMembersCount() @@ -26849,6 +29739,7 @@ func TestTeam_GetMembersCount(tt *testing.T) { } func TestTeam_GetMembersURL(tt *testing.T) { + tt.Parallel() var zeroValue string t := &Team{MembersURL: &zeroValue} t.GetMembersURL() @@ -26859,6 +29750,7 @@ func TestTeam_GetMembersURL(tt *testing.T) { } func TestTeam_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string t := &Team{Name: &zeroValue} t.GetName() @@ -26869,6 +29761,7 @@ func TestTeam_GetName(tt *testing.T) { } func TestTeam_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string t := &Team{NodeID: &zeroValue} t.GetNodeID() @@ -26879,6 +29772,7 @@ func TestTeam_GetNodeID(tt *testing.T) { } func TestTeam_GetOrganization(tt *testing.T) { + tt.Parallel() t := &Team{} t.GetOrganization() t = nil @@ -26886,6 +29780,7 @@ func TestTeam_GetOrganization(tt *testing.T) { } func TestTeam_GetParent(tt *testing.T) { + tt.Parallel() t := &Team{} t.GetParent() t = nil @@ -26893,6 +29788,7 @@ func TestTeam_GetParent(tt *testing.T) { } func TestTeam_GetPermission(tt *testing.T) { + tt.Parallel() var zeroValue string t := &Team{Permission: &zeroValue} t.GetPermission() @@ -26903,6 +29799,7 @@ func TestTeam_GetPermission(tt *testing.T) { } func TestTeam_GetPermissions(tt *testing.T) { + tt.Parallel() zeroValue := map[string]bool{} t := &Team{Permissions: zeroValue} t.GetPermissions() @@ -26913,6 +29810,7 @@ func TestTeam_GetPermissions(tt *testing.T) { } func TestTeam_GetPrivacy(tt *testing.T) { + tt.Parallel() var zeroValue string t := &Team{Privacy: &zeroValue} t.GetPrivacy() @@ -26923,6 +29821,7 @@ func TestTeam_GetPrivacy(tt *testing.T) { } func TestTeam_GetReposCount(tt *testing.T) { + tt.Parallel() var zeroValue int t := &Team{ReposCount: &zeroValue} t.GetReposCount() @@ -26933,6 +29832,7 @@ func TestTeam_GetReposCount(tt *testing.T) { } func TestTeam_GetRepositoriesURL(tt *testing.T) { + tt.Parallel() var zeroValue string t := &Team{RepositoriesURL: &zeroValue} t.GetRepositoriesURL() @@ -26943,6 +29843,7 @@ func TestTeam_GetRepositoriesURL(tt *testing.T) { } func TestTeam_GetSlug(tt *testing.T) { + tt.Parallel() var zeroValue string t := &Team{Slug: &zeroValue} t.GetSlug() @@ -26953,6 +29854,7 @@ func TestTeam_GetSlug(tt *testing.T) { } func TestTeam_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string t := &Team{URL: &zeroValue} t.GetURL() @@ -26963,6 +29865,7 @@ func TestTeam_GetURL(tt *testing.T) { } func TestTeamAddEvent_GetInstallation(tt *testing.T) { + tt.Parallel() t := &TeamAddEvent{} t.GetInstallation() t = nil @@ -26970,6 +29873,7 @@ func TestTeamAddEvent_GetInstallation(tt *testing.T) { } func TestTeamAddEvent_GetOrg(tt *testing.T) { + tt.Parallel() t := &TeamAddEvent{} t.GetOrg() t = nil @@ -26977,6 +29881,7 @@ func TestTeamAddEvent_GetOrg(tt *testing.T) { } func TestTeamAddEvent_GetRepo(tt *testing.T) { + tt.Parallel() t := &TeamAddEvent{} t.GetRepo() t = nil @@ -26984,6 +29889,7 @@ func TestTeamAddEvent_GetRepo(tt *testing.T) { } func TestTeamAddEvent_GetSender(tt *testing.T) { + tt.Parallel() t := &TeamAddEvent{} t.GetSender() t = nil @@ -26991,6 +29897,7 @@ func TestTeamAddEvent_GetSender(tt *testing.T) { } func TestTeamAddEvent_GetTeam(tt *testing.T) { + tt.Parallel() t := &TeamAddEvent{} t.GetTeam() t = nil @@ -26998,6 +29905,7 @@ func TestTeamAddEvent_GetTeam(tt *testing.T) { } func TestTeamChange_GetDescription(tt *testing.T) { + tt.Parallel() t := &TeamChange{} t.GetDescription() t = nil @@ -27005,6 +29913,7 @@ func TestTeamChange_GetDescription(tt *testing.T) { } func TestTeamChange_GetName(tt *testing.T) { + tt.Parallel() t := &TeamChange{} t.GetName() t = nil @@ -27012,6 +29921,7 @@ func TestTeamChange_GetName(tt *testing.T) { } func TestTeamChange_GetPrivacy(tt *testing.T) { + tt.Parallel() t := &TeamChange{} t.GetPrivacy() t = nil @@ -27019,6 +29929,7 @@ func TestTeamChange_GetPrivacy(tt *testing.T) { } func TestTeamChange_GetRepository(tt *testing.T) { + tt.Parallel() t := &TeamChange{} t.GetRepository() t = nil @@ -27026,6 +29937,7 @@ func TestTeamChange_GetRepository(tt *testing.T) { } func TestTeamDescription_GetFrom(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TeamDescription{From: &zeroValue} t.GetFrom() @@ -27036,6 +29948,7 @@ func TestTeamDescription_GetFrom(tt *testing.T) { } func TestTeamDiscussion_GetAuthor(tt *testing.T) { + tt.Parallel() t := &TeamDiscussion{} t.GetAuthor() t = nil @@ -27043,6 +29956,7 @@ func TestTeamDiscussion_GetAuthor(tt *testing.T) { } func TestTeamDiscussion_GetBody(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TeamDiscussion{Body: &zeroValue} t.GetBody() @@ -27053,6 +29967,7 @@ func TestTeamDiscussion_GetBody(tt *testing.T) { } func TestTeamDiscussion_GetBodyHTML(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TeamDiscussion{BodyHTML: &zeroValue} t.GetBodyHTML() @@ -27063,6 +29978,7 @@ func TestTeamDiscussion_GetBodyHTML(tt *testing.T) { } func TestTeamDiscussion_GetBodyVersion(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TeamDiscussion{BodyVersion: &zeroValue} t.GetBodyVersion() @@ -27073,6 +29989,7 @@ func TestTeamDiscussion_GetBodyVersion(tt *testing.T) { } func TestTeamDiscussion_GetCommentsCount(tt *testing.T) { + tt.Parallel() var zeroValue int t := &TeamDiscussion{CommentsCount: &zeroValue} t.GetCommentsCount() @@ -27083,6 +30000,7 @@ func TestTeamDiscussion_GetCommentsCount(tt *testing.T) { } func TestTeamDiscussion_GetCommentsURL(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TeamDiscussion{CommentsURL: &zeroValue} t.GetCommentsURL() @@ -27093,6 +30011,7 @@ func TestTeamDiscussion_GetCommentsURL(tt *testing.T) { } func TestTeamDiscussion_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp t := &TeamDiscussion{CreatedAt: &zeroValue} t.GetCreatedAt() @@ -27103,6 +30022,7 @@ func TestTeamDiscussion_GetCreatedAt(tt *testing.T) { } func TestTeamDiscussion_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TeamDiscussion{HTMLURL: &zeroValue} t.GetHTMLURL() @@ -27113,6 +30033,7 @@ func TestTeamDiscussion_GetHTMLURL(tt *testing.T) { } func TestTeamDiscussion_GetLastEditedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp t := &TeamDiscussion{LastEditedAt: &zeroValue} t.GetLastEditedAt() @@ -27123,6 +30044,7 @@ func TestTeamDiscussion_GetLastEditedAt(tt *testing.T) { } func TestTeamDiscussion_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TeamDiscussion{NodeID: &zeroValue} t.GetNodeID() @@ -27133,6 +30055,7 @@ func TestTeamDiscussion_GetNodeID(tt *testing.T) { } func TestTeamDiscussion_GetNumber(tt *testing.T) { + tt.Parallel() var zeroValue int t := &TeamDiscussion{Number: &zeroValue} t.GetNumber() @@ -27143,6 +30066,7 @@ func TestTeamDiscussion_GetNumber(tt *testing.T) { } func TestTeamDiscussion_GetPinned(tt *testing.T) { + tt.Parallel() var zeroValue bool t := &TeamDiscussion{Pinned: &zeroValue} t.GetPinned() @@ -27153,6 +30077,7 @@ func TestTeamDiscussion_GetPinned(tt *testing.T) { } func TestTeamDiscussion_GetPrivate(tt *testing.T) { + tt.Parallel() var zeroValue bool t := &TeamDiscussion{Private: &zeroValue} t.GetPrivate() @@ -27163,6 +30088,7 @@ func TestTeamDiscussion_GetPrivate(tt *testing.T) { } func TestTeamDiscussion_GetReactions(tt *testing.T) { + tt.Parallel() t := &TeamDiscussion{} t.GetReactions() t = nil @@ -27170,6 +30096,7 @@ func TestTeamDiscussion_GetReactions(tt *testing.T) { } func TestTeamDiscussion_GetTeamURL(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TeamDiscussion{TeamURL: &zeroValue} t.GetTeamURL() @@ -27180,6 +30107,7 @@ func TestTeamDiscussion_GetTeamURL(tt *testing.T) { } func TestTeamDiscussion_GetTitle(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TeamDiscussion{Title: &zeroValue} t.GetTitle() @@ -27190,6 +30118,7 @@ func TestTeamDiscussion_GetTitle(tt *testing.T) { } func TestTeamDiscussion_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp t := &TeamDiscussion{UpdatedAt: &zeroValue} t.GetUpdatedAt() @@ -27200,6 +30129,7 @@ func TestTeamDiscussion_GetUpdatedAt(tt *testing.T) { } func TestTeamDiscussion_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TeamDiscussion{URL: &zeroValue} t.GetURL() @@ -27210,6 +30140,7 @@ func TestTeamDiscussion_GetURL(tt *testing.T) { } func TestTeamEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TeamEvent{Action: &zeroValue} t.GetAction() @@ -27220,6 +30151,7 @@ func TestTeamEvent_GetAction(tt *testing.T) { } func TestTeamEvent_GetChanges(tt *testing.T) { + tt.Parallel() t := &TeamEvent{} t.GetChanges() t = nil @@ -27227,6 +30159,7 @@ func TestTeamEvent_GetChanges(tt *testing.T) { } func TestTeamEvent_GetInstallation(tt *testing.T) { + tt.Parallel() t := &TeamEvent{} t.GetInstallation() t = nil @@ -27234,6 +30167,7 @@ func TestTeamEvent_GetInstallation(tt *testing.T) { } func TestTeamEvent_GetOrg(tt *testing.T) { + tt.Parallel() t := &TeamEvent{} t.GetOrg() t = nil @@ -27241,6 +30175,7 @@ func TestTeamEvent_GetOrg(tt *testing.T) { } func TestTeamEvent_GetRepo(tt *testing.T) { + tt.Parallel() t := &TeamEvent{} t.GetRepo() t = nil @@ -27248,6 +30183,7 @@ func TestTeamEvent_GetRepo(tt *testing.T) { } func TestTeamEvent_GetSender(tt *testing.T) { + tt.Parallel() t := &TeamEvent{} t.GetSender() t = nil @@ -27255,6 +30191,7 @@ func TestTeamEvent_GetSender(tt *testing.T) { } func TestTeamEvent_GetTeam(tt *testing.T) { + tt.Parallel() t := &TeamEvent{} t.GetTeam() t = nil @@ -27262,6 +30199,7 @@ func TestTeamEvent_GetTeam(tt *testing.T) { } func TestTeamLDAPMapping_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TeamLDAPMapping{Description: &zeroValue} t.GetDescription() @@ -27272,6 +30210,7 @@ func TestTeamLDAPMapping_GetDescription(tt *testing.T) { } func TestTeamLDAPMapping_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 t := &TeamLDAPMapping{ID: &zeroValue} t.GetID() @@ -27282,6 +30221,7 @@ func TestTeamLDAPMapping_GetID(tt *testing.T) { } func TestTeamLDAPMapping_GetLDAPDN(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TeamLDAPMapping{LDAPDN: &zeroValue} t.GetLDAPDN() @@ -27292,6 +30232,7 @@ func TestTeamLDAPMapping_GetLDAPDN(tt *testing.T) { } func TestTeamLDAPMapping_GetMembersURL(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TeamLDAPMapping{MembersURL: &zeroValue} t.GetMembersURL() @@ -27302,6 +30243,7 @@ func TestTeamLDAPMapping_GetMembersURL(tt *testing.T) { } func TestTeamLDAPMapping_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TeamLDAPMapping{Name: &zeroValue} t.GetName() @@ -27312,6 +30254,7 @@ func TestTeamLDAPMapping_GetName(tt *testing.T) { } func TestTeamLDAPMapping_GetPermission(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TeamLDAPMapping{Permission: &zeroValue} t.GetPermission() @@ -27322,6 +30265,7 @@ func TestTeamLDAPMapping_GetPermission(tt *testing.T) { } func TestTeamLDAPMapping_GetPrivacy(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TeamLDAPMapping{Privacy: &zeroValue} t.GetPrivacy() @@ -27332,6 +30276,7 @@ func TestTeamLDAPMapping_GetPrivacy(tt *testing.T) { } func TestTeamLDAPMapping_GetRepositoriesURL(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TeamLDAPMapping{RepositoriesURL: &zeroValue} t.GetRepositoriesURL() @@ -27342,6 +30287,7 @@ func TestTeamLDAPMapping_GetRepositoriesURL(tt *testing.T) { } func TestTeamLDAPMapping_GetSlug(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TeamLDAPMapping{Slug: &zeroValue} t.GetSlug() @@ -27352,6 +30298,7 @@ func TestTeamLDAPMapping_GetSlug(tt *testing.T) { } func TestTeamLDAPMapping_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TeamLDAPMapping{URL: &zeroValue} t.GetURL() @@ -27362,6 +30309,7 @@ func TestTeamLDAPMapping_GetURL(tt *testing.T) { } func TestTeamName_GetFrom(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TeamName{From: &zeroValue} t.GetFrom() @@ -27372,6 +30320,7 @@ func TestTeamName_GetFrom(tt *testing.T) { } func TestTeamPermissions_GetFrom(tt *testing.T) { + tt.Parallel() t := &TeamPermissions{} t.GetFrom() t = nil @@ -27379,6 +30328,7 @@ func TestTeamPermissions_GetFrom(tt *testing.T) { } func TestTeamPermissionsFrom_GetAdmin(tt *testing.T) { + tt.Parallel() var zeroValue bool t := &TeamPermissionsFrom{Admin: &zeroValue} t.GetAdmin() @@ -27389,6 +30339,7 @@ func TestTeamPermissionsFrom_GetAdmin(tt *testing.T) { } func TestTeamPermissionsFrom_GetPull(tt *testing.T) { + tt.Parallel() var zeroValue bool t := &TeamPermissionsFrom{Pull: &zeroValue} t.GetPull() @@ -27399,6 +30350,7 @@ func TestTeamPermissionsFrom_GetPull(tt *testing.T) { } func TestTeamPermissionsFrom_GetPush(tt *testing.T) { + tt.Parallel() var zeroValue bool t := &TeamPermissionsFrom{Push: &zeroValue} t.GetPush() @@ -27409,6 +30361,7 @@ func TestTeamPermissionsFrom_GetPush(tt *testing.T) { } func TestTeamPrivacy_GetFrom(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TeamPrivacy{From: &zeroValue} t.GetFrom() @@ -27419,6 +30372,7 @@ func TestTeamPrivacy_GetFrom(tt *testing.T) { } func TestTeamProjectOptions_GetPermission(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TeamProjectOptions{Permission: &zeroValue} t.GetPermission() @@ -27429,6 +30383,7 @@ func TestTeamProjectOptions_GetPermission(tt *testing.T) { } func TestTeamRepository_GetPermissions(tt *testing.T) { + tt.Parallel() t := &TeamRepository{} t.GetPermissions() t = nil @@ -27436,6 +30391,7 @@ func TestTeamRepository_GetPermissions(tt *testing.T) { } func TestTemplateRepoRequest_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TemplateRepoRequest{Description: &zeroValue} t.GetDescription() @@ -27446,6 +30402,7 @@ func TestTemplateRepoRequest_GetDescription(tt *testing.T) { } func TestTemplateRepoRequest_GetIncludeAllBranches(tt *testing.T) { + tt.Parallel() var zeroValue bool t := &TemplateRepoRequest{IncludeAllBranches: &zeroValue} t.GetIncludeAllBranches() @@ -27456,6 +30413,7 @@ func TestTemplateRepoRequest_GetIncludeAllBranches(tt *testing.T) { } func TestTemplateRepoRequest_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TemplateRepoRequest{Name: &zeroValue} t.GetName() @@ -27466,6 +30424,7 @@ func TestTemplateRepoRequest_GetName(tt *testing.T) { } func TestTemplateRepoRequest_GetOwner(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TemplateRepoRequest{Owner: &zeroValue} t.GetOwner() @@ -27476,6 +30435,7 @@ func TestTemplateRepoRequest_GetOwner(tt *testing.T) { } func TestTemplateRepoRequest_GetPrivate(tt *testing.T) { + tt.Parallel() var zeroValue bool t := &TemplateRepoRequest{Private: &zeroValue} t.GetPrivate() @@ -27486,6 +30446,7 @@ func TestTemplateRepoRequest_GetPrivate(tt *testing.T) { } func TestTextMatch_GetFragment(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TextMatch{Fragment: &zeroValue} t.GetFragment() @@ -27496,6 +30457,7 @@ func TestTextMatch_GetFragment(tt *testing.T) { } func TestTextMatch_GetObjectType(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TextMatch{ObjectType: &zeroValue} t.GetObjectType() @@ -27506,6 +30468,7 @@ func TestTextMatch_GetObjectType(tt *testing.T) { } func TestTextMatch_GetObjectURL(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TextMatch{ObjectURL: &zeroValue} t.GetObjectURL() @@ -27516,6 +30479,7 @@ func TestTextMatch_GetObjectURL(tt *testing.T) { } func TestTextMatch_GetProperty(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TextMatch{Property: &zeroValue} t.GetProperty() @@ -27526,6 +30490,7 @@ func TestTextMatch_GetProperty(tt *testing.T) { } func TestTimeline_GetActor(tt *testing.T) { + tt.Parallel() t := &Timeline{} t.GetActor() t = nil @@ -27533,6 +30498,7 @@ func TestTimeline_GetActor(tt *testing.T) { } func TestTimeline_GetAssignee(tt *testing.T) { + tt.Parallel() t := &Timeline{} t.GetAssignee() t = nil @@ -27540,6 +30506,7 @@ func TestTimeline_GetAssignee(tt *testing.T) { } func TestTimeline_GetAssigner(tt *testing.T) { + tt.Parallel() t := &Timeline{} t.GetAssigner() t = nil @@ -27547,6 +30514,7 @@ func TestTimeline_GetAssigner(tt *testing.T) { } func TestTimeline_GetAuthor(tt *testing.T) { + tt.Parallel() t := &Timeline{} t.GetAuthor() t = nil @@ -27554,6 +30522,7 @@ func TestTimeline_GetAuthor(tt *testing.T) { } func TestTimeline_GetBody(tt *testing.T) { + tt.Parallel() var zeroValue string t := &Timeline{Body: &zeroValue} t.GetBody() @@ -27564,6 +30533,7 @@ func TestTimeline_GetBody(tt *testing.T) { } func TestTimeline_GetCommitID(tt *testing.T) { + tt.Parallel() var zeroValue string t := &Timeline{CommitID: &zeroValue} t.GetCommitID() @@ -27574,6 +30544,7 @@ func TestTimeline_GetCommitID(tt *testing.T) { } func TestTimeline_GetCommitter(tt *testing.T) { + tt.Parallel() t := &Timeline{} t.GetCommitter() t = nil @@ -27581,6 +30552,7 @@ func TestTimeline_GetCommitter(tt *testing.T) { } func TestTimeline_GetCommitURL(tt *testing.T) { + tt.Parallel() var zeroValue string t := &Timeline{CommitURL: &zeroValue} t.GetCommitURL() @@ -27591,6 +30563,7 @@ func TestTimeline_GetCommitURL(tt *testing.T) { } func TestTimeline_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp t := &Timeline{CreatedAt: &zeroValue} t.GetCreatedAt() @@ -27601,6 +30574,7 @@ func TestTimeline_GetCreatedAt(tt *testing.T) { } func TestTimeline_GetEvent(tt *testing.T) { + tt.Parallel() var zeroValue string t := &Timeline{Event: &zeroValue} t.GetEvent() @@ -27611,6 +30585,7 @@ func TestTimeline_GetEvent(tt *testing.T) { } func TestTimeline_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 t := &Timeline{ID: &zeroValue} t.GetID() @@ -27621,6 +30596,7 @@ func TestTimeline_GetID(tt *testing.T) { } func TestTimeline_GetLabel(tt *testing.T) { + tt.Parallel() t := &Timeline{} t.GetLabel() t = nil @@ -27628,6 +30604,7 @@ func TestTimeline_GetLabel(tt *testing.T) { } func TestTimeline_GetMessage(tt *testing.T) { + tt.Parallel() var zeroValue string t := &Timeline{Message: &zeroValue} t.GetMessage() @@ -27638,6 +30615,7 @@ func TestTimeline_GetMessage(tt *testing.T) { } func TestTimeline_GetMilestone(tt *testing.T) { + tt.Parallel() t := &Timeline{} t.GetMilestone() t = nil @@ -27645,6 +30623,7 @@ func TestTimeline_GetMilestone(tt *testing.T) { } func TestTimeline_GetPerformedViaGithubApp(tt *testing.T) { + tt.Parallel() t := &Timeline{} t.GetPerformedViaGithubApp() t = nil @@ -27652,6 +30631,7 @@ func TestTimeline_GetPerformedViaGithubApp(tt *testing.T) { } func TestTimeline_GetProjectCard(tt *testing.T) { + tt.Parallel() t := &Timeline{} t.GetProjectCard() t = nil @@ -27659,6 +30639,7 @@ func TestTimeline_GetProjectCard(tt *testing.T) { } func TestTimeline_GetRename(tt *testing.T) { + tt.Parallel() t := &Timeline{} t.GetRename() t = nil @@ -27666,6 +30647,7 @@ func TestTimeline_GetRename(tt *testing.T) { } func TestTimeline_GetRequestedTeam(tt *testing.T) { + tt.Parallel() t := &Timeline{} t.GetRequestedTeam() t = nil @@ -27673,6 +30655,7 @@ func TestTimeline_GetRequestedTeam(tt *testing.T) { } func TestTimeline_GetRequester(tt *testing.T) { + tt.Parallel() t := &Timeline{} t.GetRequester() t = nil @@ -27680,6 +30663,7 @@ func TestTimeline_GetRequester(tt *testing.T) { } func TestTimeline_GetReviewer(tt *testing.T) { + tt.Parallel() t := &Timeline{} t.GetReviewer() t = nil @@ -27687,6 +30671,7 @@ func TestTimeline_GetReviewer(tt *testing.T) { } func TestTimeline_GetSHA(tt *testing.T) { + tt.Parallel() var zeroValue string t := &Timeline{SHA: &zeroValue} t.GetSHA() @@ -27697,6 +30682,7 @@ func TestTimeline_GetSHA(tt *testing.T) { } func TestTimeline_GetSource(tt *testing.T) { + tt.Parallel() t := &Timeline{} t.GetSource() t = nil @@ -27704,6 +30690,7 @@ func TestTimeline_GetSource(tt *testing.T) { } func TestTimeline_GetState(tt *testing.T) { + tt.Parallel() var zeroValue string t := &Timeline{State: &zeroValue} t.GetState() @@ -27714,6 +30701,7 @@ func TestTimeline_GetState(tt *testing.T) { } func TestTimeline_GetSubmittedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp t := &Timeline{SubmittedAt: &zeroValue} t.GetSubmittedAt() @@ -27724,6 +30712,7 @@ func TestTimeline_GetSubmittedAt(tt *testing.T) { } func TestTimeline_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string t := &Timeline{URL: &zeroValue} t.GetURL() @@ -27734,6 +30723,7 @@ func TestTimeline_GetURL(tt *testing.T) { } func TestTimeline_GetUser(tt *testing.T) { + tt.Parallel() t := &Timeline{} t.GetUser() t = nil @@ -27741,6 +30731,7 @@ func TestTimeline_GetUser(tt *testing.T) { } func TestTool_GetGUID(tt *testing.T) { + tt.Parallel() var zeroValue string t := &Tool{GUID: &zeroValue} t.GetGUID() @@ -27751,6 +30742,7 @@ func TestTool_GetGUID(tt *testing.T) { } func TestTool_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string t := &Tool{Name: &zeroValue} t.GetName() @@ -27761,6 +30753,7 @@ func TestTool_GetName(tt *testing.T) { } func TestTool_GetVersion(tt *testing.T) { + tt.Parallel() var zeroValue string t := &Tool{Version: &zeroValue} t.GetVersion() @@ -27771,6 +30764,7 @@ func TestTool_GetVersion(tt *testing.T) { } func TestTopicResult_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp t := &TopicResult{CreatedAt: &zeroValue} t.GetCreatedAt() @@ -27781,6 +30775,7 @@ func TestTopicResult_GetCreatedAt(tt *testing.T) { } func TestTopicResult_GetCreatedBy(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TopicResult{CreatedBy: &zeroValue} t.GetCreatedBy() @@ -27791,6 +30786,7 @@ func TestTopicResult_GetCreatedBy(tt *testing.T) { } func TestTopicResult_GetCurated(tt *testing.T) { + tt.Parallel() var zeroValue bool t := &TopicResult{Curated: &zeroValue} t.GetCurated() @@ -27801,6 +30797,7 @@ func TestTopicResult_GetCurated(tt *testing.T) { } func TestTopicResult_GetDescription(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TopicResult{Description: &zeroValue} t.GetDescription() @@ -27811,6 +30808,7 @@ func TestTopicResult_GetDescription(tt *testing.T) { } func TestTopicResult_GetDisplayName(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TopicResult{DisplayName: &zeroValue} t.GetDisplayName() @@ -27821,6 +30819,7 @@ func TestTopicResult_GetDisplayName(tt *testing.T) { } func TestTopicResult_GetFeatured(tt *testing.T) { + tt.Parallel() var zeroValue bool t := &TopicResult{Featured: &zeroValue} t.GetFeatured() @@ -27831,6 +30830,7 @@ func TestTopicResult_GetFeatured(tt *testing.T) { } func TestTopicResult_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TopicResult{Name: &zeroValue} t.GetName() @@ -27841,6 +30841,7 @@ func TestTopicResult_GetName(tt *testing.T) { } func TestTopicResult_GetScore(tt *testing.T) { + tt.Parallel() t := &TopicResult{} t.GetScore() t = nil @@ -27848,6 +30849,7 @@ func TestTopicResult_GetScore(tt *testing.T) { } func TestTopicResult_GetShortDescription(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TopicResult{ShortDescription: &zeroValue} t.GetShortDescription() @@ -27858,6 +30860,7 @@ func TestTopicResult_GetShortDescription(tt *testing.T) { } func TestTopicResult_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TopicResult{UpdatedAt: &zeroValue} t.GetUpdatedAt() @@ -27868,6 +30871,7 @@ func TestTopicResult_GetUpdatedAt(tt *testing.T) { } func TestTopicsSearchResult_GetIncompleteResults(tt *testing.T) { + tt.Parallel() var zeroValue bool t := &TopicsSearchResult{IncompleteResults: &zeroValue} t.GetIncompleteResults() @@ -27878,6 +30882,7 @@ func TestTopicsSearchResult_GetIncompleteResults(tt *testing.T) { } func TestTopicsSearchResult_GetTotal(tt *testing.T) { + tt.Parallel() var zeroValue int t := &TopicsSearchResult{Total: &zeroValue} t.GetTotal() @@ -27888,6 +30893,7 @@ func TestTopicsSearchResult_GetTotal(tt *testing.T) { } func TestTrafficClones_GetCount(tt *testing.T) { + tt.Parallel() var zeroValue int t := &TrafficClones{Count: &zeroValue} t.GetCount() @@ -27898,6 +30904,7 @@ func TestTrafficClones_GetCount(tt *testing.T) { } func TestTrafficClones_GetUniques(tt *testing.T) { + tt.Parallel() var zeroValue int t := &TrafficClones{Uniques: &zeroValue} t.GetUniques() @@ -27908,6 +30915,7 @@ func TestTrafficClones_GetUniques(tt *testing.T) { } func TestTrafficData_GetCount(tt *testing.T) { + tt.Parallel() var zeroValue int t := &TrafficData{Count: &zeroValue} t.GetCount() @@ -27918,6 +30926,7 @@ func TestTrafficData_GetCount(tt *testing.T) { } func TestTrafficData_GetTimestamp(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp t := &TrafficData{Timestamp: &zeroValue} t.GetTimestamp() @@ -27928,6 +30937,7 @@ func TestTrafficData_GetTimestamp(tt *testing.T) { } func TestTrafficData_GetUniques(tt *testing.T) { + tt.Parallel() var zeroValue int t := &TrafficData{Uniques: &zeroValue} t.GetUniques() @@ -27938,6 +30948,7 @@ func TestTrafficData_GetUniques(tt *testing.T) { } func TestTrafficPath_GetCount(tt *testing.T) { + tt.Parallel() var zeroValue int t := &TrafficPath{Count: &zeroValue} t.GetCount() @@ -27948,6 +30959,7 @@ func TestTrafficPath_GetCount(tt *testing.T) { } func TestTrafficPath_GetPath(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TrafficPath{Path: &zeroValue} t.GetPath() @@ -27958,6 +30970,7 @@ func TestTrafficPath_GetPath(tt *testing.T) { } func TestTrafficPath_GetTitle(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TrafficPath{Title: &zeroValue} t.GetTitle() @@ -27968,6 +30981,7 @@ func TestTrafficPath_GetTitle(tt *testing.T) { } func TestTrafficPath_GetUniques(tt *testing.T) { + tt.Parallel() var zeroValue int t := &TrafficPath{Uniques: &zeroValue} t.GetUniques() @@ -27978,6 +30992,7 @@ func TestTrafficPath_GetUniques(tt *testing.T) { } func TestTrafficReferrer_GetCount(tt *testing.T) { + tt.Parallel() var zeroValue int t := &TrafficReferrer{Count: &zeroValue} t.GetCount() @@ -27988,6 +31003,7 @@ func TestTrafficReferrer_GetCount(tt *testing.T) { } func TestTrafficReferrer_GetReferrer(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TrafficReferrer{Referrer: &zeroValue} t.GetReferrer() @@ -27998,6 +31014,7 @@ func TestTrafficReferrer_GetReferrer(tt *testing.T) { } func TestTrafficReferrer_GetUniques(tt *testing.T) { + tt.Parallel() var zeroValue int t := &TrafficReferrer{Uniques: &zeroValue} t.GetUniques() @@ -28008,6 +31025,7 @@ func TestTrafficReferrer_GetUniques(tt *testing.T) { } func TestTrafficViews_GetCount(tt *testing.T) { + tt.Parallel() var zeroValue int t := &TrafficViews{Count: &zeroValue} t.GetCount() @@ -28018,6 +31036,7 @@ func TestTrafficViews_GetCount(tt *testing.T) { } func TestTrafficViews_GetUniques(tt *testing.T) { + tt.Parallel() var zeroValue int t := &TrafficViews{Uniques: &zeroValue} t.GetUniques() @@ -28028,6 +31047,7 @@ func TestTrafficViews_GetUniques(tt *testing.T) { } func TestTransferRequest_GetNewName(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TransferRequest{NewName: &zeroValue} t.GetNewName() @@ -28038,6 +31058,7 @@ func TestTransferRequest_GetNewName(tt *testing.T) { } func TestTree_GetSHA(tt *testing.T) { + tt.Parallel() var zeroValue string t := &Tree{SHA: &zeroValue} t.GetSHA() @@ -28048,6 +31069,7 @@ func TestTree_GetSHA(tt *testing.T) { } func TestTree_GetTruncated(tt *testing.T) { + tt.Parallel() var zeroValue bool t := &Tree{Truncated: &zeroValue} t.GetTruncated() @@ -28058,6 +31080,7 @@ func TestTree_GetTruncated(tt *testing.T) { } func TestTreeEntry_GetContent(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TreeEntry{Content: &zeroValue} t.GetContent() @@ -28068,6 +31091,7 @@ func TestTreeEntry_GetContent(tt *testing.T) { } func TestTreeEntry_GetMode(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TreeEntry{Mode: &zeroValue} t.GetMode() @@ -28078,6 +31102,7 @@ func TestTreeEntry_GetMode(tt *testing.T) { } func TestTreeEntry_GetPath(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TreeEntry{Path: &zeroValue} t.GetPath() @@ -28088,6 +31113,7 @@ func TestTreeEntry_GetPath(tt *testing.T) { } func TestTreeEntry_GetSHA(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TreeEntry{SHA: &zeroValue} t.GetSHA() @@ -28098,6 +31124,7 @@ func TestTreeEntry_GetSHA(tt *testing.T) { } func TestTreeEntry_GetSize(tt *testing.T) { + tt.Parallel() var zeroValue int t := &TreeEntry{Size: &zeroValue} t.GetSize() @@ -28108,6 +31135,7 @@ func TestTreeEntry_GetSize(tt *testing.T) { } func TestTreeEntry_GetType(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TreeEntry{Type: &zeroValue} t.GetType() @@ -28118,6 +31146,7 @@ func TestTreeEntry_GetType(tt *testing.T) { } func TestTreeEntry_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string t := &TreeEntry{URL: &zeroValue} t.GetURL() @@ -28128,6 +31157,7 @@ func TestTreeEntry_GetURL(tt *testing.T) { } func TestUpdateAttributeForSCIMUserOperations_GetPath(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UpdateAttributeForSCIMUserOperations{Path: &zeroValue} u.GetPath() @@ -28138,6 +31168,7 @@ func TestUpdateAttributeForSCIMUserOperations_GetPath(tt *testing.T) { } func TestUpdateCheckRunOptions_GetCompletedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp u := &UpdateCheckRunOptions{CompletedAt: &zeroValue} u.GetCompletedAt() @@ -28148,6 +31179,7 @@ func TestUpdateCheckRunOptions_GetCompletedAt(tt *testing.T) { } func TestUpdateCheckRunOptions_GetConclusion(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UpdateCheckRunOptions{Conclusion: &zeroValue} u.GetConclusion() @@ -28158,6 +31190,7 @@ func TestUpdateCheckRunOptions_GetConclusion(tt *testing.T) { } func TestUpdateCheckRunOptions_GetDetailsURL(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UpdateCheckRunOptions{DetailsURL: &zeroValue} u.GetDetailsURL() @@ -28168,6 +31201,7 @@ func TestUpdateCheckRunOptions_GetDetailsURL(tt *testing.T) { } func TestUpdateCheckRunOptions_GetExternalID(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UpdateCheckRunOptions{ExternalID: &zeroValue} u.GetExternalID() @@ -28178,6 +31212,7 @@ func TestUpdateCheckRunOptions_GetExternalID(tt *testing.T) { } func TestUpdateCheckRunOptions_GetOutput(tt *testing.T) { + tt.Parallel() u := &UpdateCheckRunOptions{} u.GetOutput() u = nil @@ -28185,6 +31220,7 @@ func TestUpdateCheckRunOptions_GetOutput(tt *testing.T) { } func TestUpdateCheckRunOptions_GetStatus(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UpdateCheckRunOptions{Status: &zeroValue} u.GetStatus() @@ -28195,6 +31231,7 @@ func TestUpdateCheckRunOptions_GetStatus(tt *testing.T) { } func TestUpdateDefaultSetupConfigurationOptions_GetQuerySuite(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UpdateDefaultSetupConfigurationOptions{QuerySuite: &zeroValue} u.GetQuerySuite() @@ -28205,6 +31242,7 @@ func TestUpdateDefaultSetupConfigurationOptions_GetQuerySuite(tt *testing.T) { } func TestUpdateDefaultSetupConfigurationResponse_GetRunID(tt *testing.T) { + tt.Parallel() var zeroValue int64 u := &UpdateDefaultSetupConfigurationResponse{RunID: &zeroValue} u.GetRunID() @@ -28215,6 +31253,7 @@ func TestUpdateDefaultSetupConfigurationResponse_GetRunID(tt *testing.T) { } func TestUpdateDefaultSetupConfigurationResponse_GetRunURL(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UpdateDefaultSetupConfigurationResponse{RunURL: &zeroValue} u.GetRunURL() @@ -28225,6 +31264,7 @@ func TestUpdateDefaultSetupConfigurationResponse_GetRunURL(tt *testing.T) { } func TestUpdateEnterpriseRunnerGroupRequest_GetAllowsPublicRepositories(tt *testing.T) { + tt.Parallel() var zeroValue bool u := &UpdateEnterpriseRunnerGroupRequest{AllowsPublicRepositories: &zeroValue} u.GetAllowsPublicRepositories() @@ -28235,6 +31275,7 @@ func TestUpdateEnterpriseRunnerGroupRequest_GetAllowsPublicRepositories(tt *test } func TestUpdateEnterpriseRunnerGroupRequest_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UpdateEnterpriseRunnerGroupRequest{Name: &zeroValue} u.GetName() @@ -28245,6 +31286,7 @@ func TestUpdateEnterpriseRunnerGroupRequest_GetName(tt *testing.T) { } func TestUpdateEnterpriseRunnerGroupRequest_GetRestrictedToWorkflows(tt *testing.T) { + tt.Parallel() var zeroValue bool u := &UpdateEnterpriseRunnerGroupRequest{RestrictedToWorkflows: &zeroValue} u.GetRestrictedToWorkflows() @@ -28255,6 +31297,7 @@ func TestUpdateEnterpriseRunnerGroupRequest_GetRestrictedToWorkflows(tt *testing } func TestUpdateEnterpriseRunnerGroupRequest_GetVisibility(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UpdateEnterpriseRunnerGroupRequest{Visibility: &zeroValue} u.GetVisibility() @@ -28265,6 +31308,7 @@ func TestUpdateEnterpriseRunnerGroupRequest_GetVisibility(tt *testing.T) { } func TestUpdateRunnerGroupRequest_GetAllowsPublicRepositories(tt *testing.T) { + tt.Parallel() var zeroValue bool u := &UpdateRunnerGroupRequest{AllowsPublicRepositories: &zeroValue} u.GetAllowsPublicRepositories() @@ -28275,6 +31319,7 @@ func TestUpdateRunnerGroupRequest_GetAllowsPublicRepositories(tt *testing.T) { } func TestUpdateRunnerGroupRequest_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UpdateRunnerGroupRequest{Name: &zeroValue} u.GetName() @@ -28285,6 +31330,7 @@ func TestUpdateRunnerGroupRequest_GetName(tt *testing.T) { } func TestUpdateRunnerGroupRequest_GetRestrictedToWorkflows(tt *testing.T) { + tt.Parallel() var zeroValue bool u := &UpdateRunnerGroupRequest{RestrictedToWorkflows: &zeroValue} u.GetRestrictedToWorkflows() @@ -28295,6 +31341,7 @@ func TestUpdateRunnerGroupRequest_GetRestrictedToWorkflows(tt *testing.T) { } func TestUpdateRunnerGroupRequest_GetVisibility(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UpdateRunnerGroupRequest{Visibility: &zeroValue} u.GetVisibility() @@ -28305,6 +31352,7 @@ func TestUpdateRunnerGroupRequest_GetVisibility(tt *testing.T) { } func TestUser_GetAvatarURL(tt *testing.T) { + tt.Parallel() var zeroValue string u := &User{AvatarURL: &zeroValue} u.GetAvatarURL() @@ -28315,6 +31363,7 @@ func TestUser_GetAvatarURL(tt *testing.T) { } func TestUser_GetBio(tt *testing.T) { + tt.Parallel() var zeroValue string u := &User{Bio: &zeroValue} u.GetBio() @@ -28325,6 +31374,7 @@ func TestUser_GetBio(tt *testing.T) { } func TestUser_GetBlog(tt *testing.T) { + tt.Parallel() var zeroValue string u := &User{Blog: &zeroValue} u.GetBlog() @@ -28335,6 +31385,7 @@ func TestUser_GetBlog(tt *testing.T) { } func TestUser_GetCollaborators(tt *testing.T) { + tt.Parallel() var zeroValue int u := &User{Collaborators: &zeroValue} u.GetCollaborators() @@ -28345,6 +31396,7 @@ func TestUser_GetCollaborators(tt *testing.T) { } func TestUser_GetCompany(tt *testing.T) { + tt.Parallel() var zeroValue string u := &User{Company: &zeroValue} u.GetCompany() @@ -28355,6 +31407,7 @@ func TestUser_GetCompany(tt *testing.T) { } func TestUser_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp u := &User{CreatedAt: &zeroValue} u.GetCreatedAt() @@ -28365,6 +31418,7 @@ func TestUser_GetCreatedAt(tt *testing.T) { } func TestUser_GetDiskUsage(tt *testing.T) { + tt.Parallel() var zeroValue int u := &User{DiskUsage: &zeroValue} u.GetDiskUsage() @@ -28375,6 +31429,7 @@ func TestUser_GetDiskUsage(tt *testing.T) { } func TestUser_GetEmail(tt *testing.T) { + tt.Parallel() var zeroValue string u := &User{Email: &zeroValue} u.GetEmail() @@ -28385,6 +31440,7 @@ func TestUser_GetEmail(tt *testing.T) { } func TestUser_GetEventsURL(tt *testing.T) { + tt.Parallel() var zeroValue string u := &User{EventsURL: &zeroValue} u.GetEventsURL() @@ -28395,6 +31451,7 @@ func TestUser_GetEventsURL(tt *testing.T) { } func TestUser_GetFollowers(tt *testing.T) { + tt.Parallel() var zeroValue int u := &User{Followers: &zeroValue} u.GetFollowers() @@ -28405,6 +31462,7 @@ func TestUser_GetFollowers(tt *testing.T) { } func TestUser_GetFollowersURL(tt *testing.T) { + tt.Parallel() var zeroValue string u := &User{FollowersURL: &zeroValue} u.GetFollowersURL() @@ -28415,6 +31473,7 @@ func TestUser_GetFollowersURL(tt *testing.T) { } func TestUser_GetFollowing(tt *testing.T) { + tt.Parallel() var zeroValue int u := &User{Following: &zeroValue} u.GetFollowing() @@ -28425,6 +31484,7 @@ func TestUser_GetFollowing(tt *testing.T) { } func TestUser_GetFollowingURL(tt *testing.T) { + tt.Parallel() var zeroValue string u := &User{FollowingURL: &zeroValue} u.GetFollowingURL() @@ -28435,6 +31495,7 @@ func TestUser_GetFollowingURL(tt *testing.T) { } func TestUser_GetGistsURL(tt *testing.T) { + tt.Parallel() var zeroValue string u := &User{GistsURL: &zeroValue} u.GetGistsURL() @@ -28445,6 +31506,7 @@ func TestUser_GetGistsURL(tt *testing.T) { } func TestUser_GetGravatarID(tt *testing.T) { + tt.Parallel() var zeroValue string u := &User{GravatarID: &zeroValue} u.GetGravatarID() @@ -28455,6 +31517,7 @@ func TestUser_GetGravatarID(tt *testing.T) { } func TestUser_GetHireable(tt *testing.T) { + tt.Parallel() var zeroValue bool u := &User{Hireable: &zeroValue} u.GetHireable() @@ -28465,6 +31528,7 @@ func TestUser_GetHireable(tt *testing.T) { } func TestUser_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string u := &User{HTMLURL: &zeroValue} u.GetHTMLURL() @@ -28475,6 +31539,7 @@ func TestUser_GetHTMLURL(tt *testing.T) { } func TestUser_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 u := &User{ID: &zeroValue} u.GetID() @@ -28485,6 +31550,7 @@ func TestUser_GetID(tt *testing.T) { } func TestUser_GetLdapDn(tt *testing.T) { + tt.Parallel() var zeroValue string u := &User{LdapDn: &zeroValue} u.GetLdapDn() @@ -28495,6 +31561,7 @@ func TestUser_GetLdapDn(tt *testing.T) { } func TestUser_GetLocation(tt *testing.T) { + tt.Parallel() var zeroValue string u := &User{Location: &zeroValue} u.GetLocation() @@ -28505,6 +31572,7 @@ func TestUser_GetLocation(tt *testing.T) { } func TestUser_GetLogin(tt *testing.T) { + tt.Parallel() var zeroValue string u := &User{Login: &zeroValue} u.GetLogin() @@ -28515,6 +31583,7 @@ func TestUser_GetLogin(tt *testing.T) { } func TestUser_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string u := &User{Name: &zeroValue} u.GetName() @@ -28525,6 +31594,7 @@ func TestUser_GetName(tt *testing.T) { } func TestUser_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string u := &User{NodeID: &zeroValue} u.GetNodeID() @@ -28535,6 +31605,7 @@ func TestUser_GetNodeID(tt *testing.T) { } func TestUser_GetOrganizationsURL(tt *testing.T) { + tt.Parallel() var zeroValue string u := &User{OrganizationsURL: &zeroValue} u.GetOrganizationsURL() @@ -28545,6 +31616,7 @@ func TestUser_GetOrganizationsURL(tt *testing.T) { } func TestUser_GetOwnedPrivateRepos(tt *testing.T) { + tt.Parallel() var zeroValue int64 u := &User{OwnedPrivateRepos: &zeroValue} u.GetOwnedPrivateRepos() @@ -28555,6 +31627,7 @@ func TestUser_GetOwnedPrivateRepos(tt *testing.T) { } func TestUser_GetPermissions(tt *testing.T) { + tt.Parallel() zeroValue := map[string]bool{} u := &User{Permissions: zeroValue} u.GetPermissions() @@ -28565,6 +31638,7 @@ func TestUser_GetPermissions(tt *testing.T) { } func TestUser_GetPlan(tt *testing.T) { + tt.Parallel() u := &User{} u.GetPlan() u = nil @@ -28572,6 +31646,7 @@ func TestUser_GetPlan(tt *testing.T) { } func TestUser_GetPrivateGists(tt *testing.T) { + tt.Parallel() var zeroValue int u := &User{PrivateGists: &zeroValue} u.GetPrivateGists() @@ -28582,6 +31657,7 @@ func TestUser_GetPrivateGists(tt *testing.T) { } func TestUser_GetPublicGists(tt *testing.T) { + tt.Parallel() var zeroValue int u := &User{PublicGists: &zeroValue} u.GetPublicGists() @@ -28592,6 +31668,7 @@ func TestUser_GetPublicGists(tt *testing.T) { } func TestUser_GetPublicRepos(tt *testing.T) { + tt.Parallel() var zeroValue int u := &User{PublicRepos: &zeroValue} u.GetPublicRepos() @@ -28602,6 +31679,7 @@ func TestUser_GetPublicRepos(tt *testing.T) { } func TestUser_GetReceivedEventsURL(tt *testing.T) { + tt.Parallel() var zeroValue string u := &User{ReceivedEventsURL: &zeroValue} u.GetReceivedEventsURL() @@ -28612,6 +31690,7 @@ func TestUser_GetReceivedEventsURL(tt *testing.T) { } func TestUser_GetReposURL(tt *testing.T) { + tt.Parallel() var zeroValue string u := &User{ReposURL: &zeroValue} u.GetReposURL() @@ -28622,6 +31701,7 @@ func TestUser_GetReposURL(tt *testing.T) { } func TestUser_GetRoleName(tt *testing.T) { + tt.Parallel() var zeroValue string u := &User{RoleName: &zeroValue} u.GetRoleName() @@ -28632,6 +31712,7 @@ func TestUser_GetRoleName(tt *testing.T) { } func TestUser_GetSiteAdmin(tt *testing.T) { + tt.Parallel() var zeroValue bool u := &User{SiteAdmin: &zeroValue} u.GetSiteAdmin() @@ -28642,6 +31723,7 @@ func TestUser_GetSiteAdmin(tt *testing.T) { } func TestUser_GetStarredURL(tt *testing.T) { + tt.Parallel() var zeroValue string u := &User{StarredURL: &zeroValue} u.GetStarredURL() @@ -28652,6 +31734,7 @@ func TestUser_GetStarredURL(tt *testing.T) { } func TestUser_GetSubscriptionsURL(tt *testing.T) { + tt.Parallel() var zeroValue string u := &User{SubscriptionsURL: &zeroValue} u.GetSubscriptionsURL() @@ -28662,6 +31745,7 @@ func TestUser_GetSubscriptionsURL(tt *testing.T) { } func TestUser_GetSuspendedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp u := &User{SuspendedAt: &zeroValue} u.GetSuspendedAt() @@ -28672,6 +31756,7 @@ func TestUser_GetSuspendedAt(tt *testing.T) { } func TestUser_GetTotalPrivateRepos(tt *testing.T) { + tt.Parallel() var zeroValue int64 u := &User{TotalPrivateRepos: &zeroValue} u.GetTotalPrivateRepos() @@ -28682,6 +31767,7 @@ func TestUser_GetTotalPrivateRepos(tt *testing.T) { } func TestUser_GetTwitterUsername(tt *testing.T) { + tt.Parallel() var zeroValue string u := &User{TwitterUsername: &zeroValue} u.GetTwitterUsername() @@ -28692,6 +31778,7 @@ func TestUser_GetTwitterUsername(tt *testing.T) { } func TestUser_GetTwoFactorAuthentication(tt *testing.T) { + tt.Parallel() var zeroValue bool u := &User{TwoFactorAuthentication: &zeroValue} u.GetTwoFactorAuthentication() @@ -28702,6 +31789,7 @@ func TestUser_GetTwoFactorAuthentication(tt *testing.T) { } func TestUser_GetType(tt *testing.T) { + tt.Parallel() var zeroValue string u := &User{Type: &zeroValue} u.GetType() @@ -28712,6 +31800,7 @@ func TestUser_GetType(tt *testing.T) { } func TestUser_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp u := &User{UpdatedAt: &zeroValue} u.GetUpdatedAt() @@ -28722,6 +31811,7 @@ func TestUser_GetUpdatedAt(tt *testing.T) { } func TestUser_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string u := &User{URL: &zeroValue} u.GetURL() @@ -28732,6 +31822,7 @@ func TestUser_GetURL(tt *testing.T) { } func TestUserAuthorization_GetApp(tt *testing.T) { + tt.Parallel() u := &UserAuthorization{} u.GetApp() u = nil @@ -28739,6 +31830,7 @@ func TestUserAuthorization_GetApp(tt *testing.T) { } func TestUserAuthorization_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp u := &UserAuthorization{CreatedAt: &zeroValue} u.GetCreatedAt() @@ -28749,6 +31841,7 @@ func TestUserAuthorization_GetCreatedAt(tt *testing.T) { } func TestUserAuthorization_GetFingerprint(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UserAuthorization{Fingerprint: &zeroValue} u.GetFingerprint() @@ -28759,6 +31852,7 @@ func TestUserAuthorization_GetFingerprint(tt *testing.T) { } func TestUserAuthorization_GetHashedToken(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UserAuthorization{HashedToken: &zeroValue} u.GetHashedToken() @@ -28769,6 +31863,7 @@ func TestUserAuthorization_GetHashedToken(tt *testing.T) { } func TestUserAuthorization_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 u := &UserAuthorization{ID: &zeroValue} u.GetID() @@ -28779,6 +31874,7 @@ func TestUserAuthorization_GetID(tt *testing.T) { } func TestUserAuthorization_GetNote(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UserAuthorization{Note: &zeroValue} u.GetNote() @@ -28789,6 +31885,7 @@ func TestUserAuthorization_GetNote(tt *testing.T) { } func TestUserAuthorization_GetNoteURL(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UserAuthorization{NoteURL: &zeroValue} u.GetNoteURL() @@ -28799,6 +31896,7 @@ func TestUserAuthorization_GetNoteURL(tt *testing.T) { } func TestUserAuthorization_GetToken(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UserAuthorization{Token: &zeroValue} u.GetToken() @@ -28809,6 +31907,7 @@ func TestUserAuthorization_GetToken(tt *testing.T) { } func TestUserAuthorization_GetTokenLastEight(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UserAuthorization{TokenLastEight: &zeroValue} u.GetTokenLastEight() @@ -28819,6 +31918,7 @@ func TestUserAuthorization_GetTokenLastEight(tt *testing.T) { } func TestUserAuthorization_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp u := &UserAuthorization{UpdatedAt: &zeroValue} u.GetUpdatedAt() @@ -28829,6 +31929,7 @@ func TestUserAuthorization_GetUpdatedAt(tt *testing.T) { } func TestUserAuthorization_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UserAuthorization{URL: &zeroValue} u.GetURL() @@ -28839,6 +31940,7 @@ func TestUserAuthorization_GetURL(tt *testing.T) { } func TestUserContext_GetMessage(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UserContext{Message: &zeroValue} u.GetMessage() @@ -28849,6 +31951,7 @@ func TestUserContext_GetMessage(tt *testing.T) { } func TestUserContext_GetOcticon(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UserContext{Octicon: &zeroValue} u.GetOcticon() @@ -28859,6 +31962,7 @@ func TestUserContext_GetOcticon(tt *testing.T) { } func TestUserEmail_GetEmail(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UserEmail{Email: &zeroValue} u.GetEmail() @@ -28869,6 +31973,7 @@ func TestUserEmail_GetEmail(tt *testing.T) { } func TestUserEmail_GetPrimary(tt *testing.T) { + tt.Parallel() var zeroValue bool u := &UserEmail{Primary: &zeroValue} u.GetPrimary() @@ -28879,6 +31984,7 @@ func TestUserEmail_GetPrimary(tt *testing.T) { } func TestUserEmail_GetVerified(tt *testing.T) { + tt.Parallel() var zeroValue bool u := &UserEmail{Verified: &zeroValue} u.GetVerified() @@ -28889,6 +31995,7 @@ func TestUserEmail_GetVerified(tt *testing.T) { } func TestUserEmail_GetVisibility(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UserEmail{Visibility: &zeroValue} u.GetVisibility() @@ -28899,6 +32006,7 @@ func TestUserEmail_GetVisibility(tt *testing.T) { } func TestUserEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UserEvent{Action: &zeroValue} u.GetAction() @@ -28909,6 +32017,7 @@ func TestUserEvent_GetAction(tt *testing.T) { } func TestUserEvent_GetEnterprise(tt *testing.T) { + tt.Parallel() u := &UserEvent{} u.GetEnterprise() u = nil @@ -28916,6 +32025,7 @@ func TestUserEvent_GetEnterprise(tt *testing.T) { } func TestUserEvent_GetInstallation(tt *testing.T) { + tt.Parallel() u := &UserEvent{} u.GetInstallation() u = nil @@ -28923,6 +32033,7 @@ func TestUserEvent_GetInstallation(tt *testing.T) { } func TestUserEvent_GetSender(tt *testing.T) { + tt.Parallel() u := &UserEvent{} u.GetSender() u = nil @@ -28930,6 +32041,7 @@ func TestUserEvent_GetSender(tt *testing.T) { } func TestUserEvent_GetUser(tt *testing.T) { + tt.Parallel() u := &UserEvent{} u.GetUser() u = nil @@ -28937,6 +32049,7 @@ func TestUserEvent_GetUser(tt *testing.T) { } func TestUserLDAPMapping_GetAvatarURL(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UserLDAPMapping{AvatarURL: &zeroValue} u.GetAvatarURL() @@ -28947,6 +32060,7 @@ func TestUserLDAPMapping_GetAvatarURL(tt *testing.T) { } func TestUserLDAPMapping_GetEventsURL(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UserLDAPMapping{EventsURL: &zeroValue} u.GetEventsURL() @@ -28957,6 +32071,7 @@ func TestUserLDAPMapping_GetEventsURL(tt *testing.T) { } func TestUserLDAPMapping_GetFollowersURL(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UserLDAPMapping{FollowersURL: &zeroValue} u.GetFollowersURL() @@ -28967,6 +32082,7 @@ func TestUserLDAPMapping_GetFollowersURL(tt *testing.T) { } func TestUserLDAPMapping_GetFollowingURL(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UserLDAPMapping{FollowingURL: &zeroValue} u.GetFollowingURL() @@ -28977,6 +32093,7 @@ func TestUserLDAPMapping_GetFollowingURL(tt *testing.T) { } func TestUserLDAPMapping_GetGistsURL(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UserLDAPMapping{GistsURL: &zeroValue} u.GetGistsURL() @@ -28987,6 +32104,7 @@ func TestUserLDAPMapping_GetGistsURL(tt *testing.T) { } func TestUserLDAPMapping_GetGravatarID(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UserLDAPMapping{GravatarID: &zeroValue} u.GetGravatarID() @@ -28997,6 +32115,7 @@ func TestUserLDAPMapping_GetGravatarID(tt *testing.T) { } func TestUserLDAPMapping_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 u := &UserLDAPMapping{ID: &zeroValue} u.GetID() @@ -29007,6 +32126,7 @@ func TestUserLDAPMapping_GetID(tt *testing.T) { } func TestUserLDAPMapping_GetLDAPDN(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UserLDAPMapping{LDAPDN: &zeroValue} u.GetLDAPDN() @@ -29017,6 +32137,7 @@ func TestUserLDAPMapping_GetLDAPDN(tt *testing.T) { } func TestUserLDAPMapping_GetLogin(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UserLDAPMapping{Login: &zeroValue} u.GetLogin() @@ -29027,6 +32148,7 @@ func TestUserLDAPMapping_GetLogin(tt *testing.T) { } func TestUserLDAPMapping_GetOrganizationsURL(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UserLDAPMapping{OrganizationsURL: &zeroValue} u.GetOrganizationsURL() @@ -29037,6 +32159,7 @@ func TestUserLDAPMapping_GetOrganizationsURL(tt *testing.T) { } func TestUserLDAPMapping_GetReceivedEventsURL(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UserLDAPMapping{ReceivedEventsURL: &zeroValue} u.GetReceivedEventsURL() @@ -29047,6 +32170,7 @@ func TestUserLDAPMapping_GetReceivedEventsURL(tt *testing.T) { } func TestUserLDAPMapping_GetReposURL(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UserLDAPMapping{ReposURL: &zeroValue} u.GetReposURL() @@ -29057,6 +32181,7 @@ func TestUserLDAPMapping_GetReposURL(tt *testing.T) { } func TestUserLDAPMapping_GetSiteAdmin(tt *testing.T) { + tt.Parallel() var zeroValue bool u := &UserLDAPMapping{SiteAdmin: &zeroValue} u.GetSiteAdmin() @@ -29067,6 +32192,7 @@ func TestUserLDAPMapping_GetSiteAdmin(tt *testing.T) { } func TestUserLDAPMapping_GetStarredURL(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UserLDAPMapping{StarredURL: &zeroValue} u.GetStarredURL() @@ -29077,6 +32203,7 @@ func TestUserLDAPMapping_GetStarredURL(tt *testing.T) { } func TestUserLDAPMapping_GetSubscriptionsURL(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UserLDAPMapping{SubscriptionsURL: &zeroValue} u.GetSubscriptionsURL() @@ -29087,6 +32214,7 @@ func TestUserLDAPMapping_GetSubscriptionsURL(tt *testing.T) { } func TestUserLDAPMapping_GetType(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UserLDAPMapping{Type: &zeroValue} u.GetType() @@ -29097,6 +32225,7 @@ func TestUserLDAPMapping_GetType(tt *testing.T) { } func TestUserLDAPMapping_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UserLDAPMapping{URL: &zeroValue} u.GetURL() @@ -29107,6 +32236,7 @@ func TestUserLDAPMapping_GetURL(tt *testing.T) { } func TestUserMigration_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UserMigration{CreatedAt: &zeroValue} u.GetCreatedAt() @@ -29117,6 +32247,7 @@ func TestUserMigration_GetCreatedAt(tt *testing.T) { } func TestUserMigration_GetExcludeAttachments(tt *testing.T) { + tt.Parallel() var zeroValue bool u := &UserMigration{ExcludeAttachments: &zeroValue} u.GetExcludeAttachments() @@ -29127,6 +32258,7 @@ func TestUserMigration_GetExcludeAttachments(tt *testing.T) { } func TestUserMigration_GetGUID(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UserMigration{GUID: &zeroValue} u.GetGUID() @@ -29137,6 +32269,7 @@ func TestUserMigration_GetGUID(tt *testing.T) { } func TestUserMigration_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 u := &UserMigration{ID: &zeroValue} u.GetID() @@ -29147,6 +32280,7 @@ func TestUserMigration_GetID(tt *testing.T) { } func TestUserMigration_GetLockRepositories(tt *testing.T) { + tt.Parallel() var zeroValue bool u := &UserMigration{LockRepositories: &zeroValue} u.GetLockRepositories() @@ -29157,6 +32291,7 @@ func TestUserMigration_GetLockRepositories(tt *testing.T) { } func TestUserMigration_GetState(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UserMigration{State: &zeroValue} u.GetState() @@ -29167,6 +32302,7 @@ func TestUserMigration_GetState(tt *testing.T) { } func TestUserMigration_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UserMigration{UpdatedAt: &zeroValue} u.GetUpdatedAt() @@ -29177,6 +32313,7 @@ func TestUserMigration_GetUpdatedAt(tt *testing.T) { } func TestUserMigration_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UserMigration{URL: &zeroValue} u.GetURL() @@ -29187,6 +32324,7 @@ func TestUserMigration_GetURL(tt *testing.T) { } func TestUsersSearchResult_GetIncompleteResults(tt *testing.T) { + tt.Parallel() var zeroValue bool u := &UsersSearchResult{IncompleteResults: &zeroValue} u.GetIncompleteResults() @@ -29197,6 +32335,7 @@ func TestUsersSearchResult_GetIncompleteResults(tt *testing.T) { } func TestUsersSearchResult_GetTotal(tt *testing.T) { + tt.Parallel() var zeroValue int u := &UsersSearchResult{Total: &zeroValue} u.GetTotal() @@ -29207,6 +32346,7 @@ func TestUsersSearchResult_GetTotal(tt *testing.T) { } func TestUserStats_GetAdminUsers(tt *testing.T) { + tt.Parallel() var zeroValue int u := &UserStats{AdminUsers: &zeroValue} u.GetAdminUsers() @@ -29217,6 +32357,7 @@ func TestUserStats_GetAdminUsers(tt *testing.T) { } func TestUserStats_GetSuspendedUsers(tt *testing.T) { + tt.Parallel() var zeroValue int u := &UserStats{SuspendedUsers: &zeroValue} u.GetSuspendedUsers() @@ -29227,6 +32368,7 @@ func TestUserStats_GetSuspendedUsers(tt *testing.T) { } func TestUserStats_GetTotalUsers(tt *testing.T) { + tt.Parallel() var zeroValue int u := &UserStats{TotalUsers: &zeroValue} u.GetTotalUsers() @@ -29237,6 +32379,7 @@ func TestUserStats_GetTotalUsers(tt *testing.T) { } func TestUserSuspendOptions_GetReason(tt *testing.T) { + tt.Parallel() var zeroValue string u := &UserSuspendOptions{Reason: &zeroValue} u.GetReason() @@ -29247,6 +32390,7 @@ func TestUserSuspendOptions_GetReason(tt *testing.T) { } func TestVulnerabilityPackage_GetEcosystem(tt *testing.T) { + tt.Parallel() var zeroValue string v := &VulnerabilityPackage{Ecosystem: &zeroValue} v.GetEcosystem() @@ -29257,6 +32401,7 @@ func TestVulnerabilityPackage_GetEcosystem(tt *testing.T) { } func TestVulnerabilityPackage_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string v := &VulnerabilityPackage{Name: &zeroValue} v.GetName() @@ -29267,6 +32412,7 @@ func TestVulnerabilityPackage_GetName(tt *testing.T) { } func TestWatchEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WatchEvent{Action: &zeroValue} w.GetAction() @@ -29277,6 +32423,7 @@ func TestWatchEvent_GetAction(tt *testing.T) { } func TestWatchEvent_GetInstallation(tt *testing.T) { + tt.Parallel() w := &WatchEvent{} w.GetInstallation() w = nil @@ -29284,6 +32431,7 @@ func TestWatchEvent_GetInstallation(tt *testing.T) { } func TestWatchEvent_GetOrg(tt *testing.T) { + tt.Parallel() w := &WatchEvent{} w.GetOrg() w = nil @@ -29291,6 +32439,7 @@ func TestWatchEvent_GetOrg(tt *testing.T) { } func TestWatchEvent_GetRepo(tt *testing.T) { + tt.Parallel() w := &WatchEvent{} w.GetRepo() w = nil @@ -29298,6 +32447,7 @@ func TestWatchEvent_GetRepo(tt *testing.T) { } func TestWatchEvent_GetSender(tt *testing.T) { + tt.Parallel() w := &WatchEvent{} w.GetSender() w = nil @@ -29305,6 +32455,7 @@ func TestWatchEvent_GetSender(tt *testing.T) { } func TestWeeklyCommitActivity_GetTotal(tt *testing.T) { + tt.Parallel() var zeroValue int w := &WeeklyCommitActivity{Total: &zeroValue} w.GetTotal() @@ -29315,6 +32466,7 @@ func TestWeeklyCommitActivity_GetTotal(tt *testing.T) { } func TestWeeklyCommitActivity_GetWeek(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp w := &WeeklyCommitActivity{Week: &zeroValue} w.GetWeek() @@ -29325,6 +32477,7 @@ func TestWeeklyCommitActivity_GetWeek(tt *testing.T) { } func TestWeeklyStats_GetAdditions(tt *testing.T) { + tt.Parallel() var zeroValue int w := &WeeklyStats{Additions: &zeroValue} w.GetAdditions() @@ -29335,6 +32488,7 @@ func TestWeeklyStats_GetAdditions(tt *testing.T) { } func TestWeeklyStats_GetCommits(tt *testing.T) { + tt.Parallel() var zeroValue int w := &WeeklyStats{Commits: &zeroValue} w.GetCommits() @@ -29345,6 +32499,7 @@ func TestWeeklyStats_GetCommits(tt *testing.T) { } func TestWeeklyStats_GetDeletions(tt *testing.T) { + tt.Parallel() var zeroValue int w := &WeeklyStats{Deletions: &zeroValue} w.GetDeletions() @@ -29355,6 +32510,7 @@ func TestWeeklyStats_GetDeletions(tt *testing.T) { } func TestWeeklyStats_GetWeek(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp w := &WeeklyStats{Week: &zeroValue} w.GetWeek() @@ -29365,6 +32521,7 @@ func TestWeeklyStats_GetWeek(tt *testing.T) { } func TestWorkflow_GetBadgeURL(tt *testing.T) { + tt.Parallel() var zeroValue string w := &Workflow{BadgeURL: &zeroValue} w.GetBadgeURL() @@ -29375,6 +32532,7 @@ func TestWorkflow_GetBadgeURL(tt *testing.T) { } func TestWorkflow_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp w := &Workflow{CreatedAt: &zeroValue} w.GetCreatedAt() @@ -29385,6 +32543,7 @@ func TestWorkflow_GetCreatedAt(tt *testing.T) { } func TestWorkflow_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string w := &Workflow{HTMLURL: &zeroValue} w.GetHTMLURL() @@ -29395,6 +32554,7 @@ func TestWorkflow_GetHTMLURL(tt *testing.T) { } func TestWorkflow_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 w := &Workflow{ID: &zeroValue} w.GetID() @@ -29405,6 +32565,7 @@ func TestWorkflow_GetID(tt *testing.T) { } func TestWorkflow_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string w := &Workflow{Name: &zeroValue} w.GetName() @@ -29415,6 +32576,7 @@ func TestWorkflow_GetName(tt *testing.T) { } func TestWorkflow_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string w := &Workflow{NodeID: &zeroValue} w.GetNodeID() @@ -29425,6 +32587,7 @@ func TestWorkflow_GetNodeID(tt *testing.T) { } func TestWorkflow_GetPath(tt *testing.T) { + tt.Parallel() var zeroValue string w := &Workflow{Path: &zeroValue} w.GetPath() @@ -29435,6 +32598,7 @@ func TestWorkflow_GetPath(tt *testing.T) { } func TestWorkflow_GetState(tt *testing.T) { + tt.Parallel() var zeroValue string w := &Workflow{State: &zeroValue} w.GetState() @@ -29445,6 +32609,7 @@ func TestWorkflow_GetState(tt *testing.T) { } func TestWorkflow_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp w := &Workflow{UpdatedAt: &zeroValue} w.GetUpdatedAt() @@ -29455,6 +32620,7 @@ func TestWorkflow_GetUpdatedAt(tt *testing.T) { } func TestWorkflow_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string w := &Workflow{URL: &zeroValue} w.GetURL() @@ -29465,6 +32631,7 @@ func TestWorkflow_GetURL(tt *testing.T) { } func TestWorkflowBill_GetTotalMS(tt *testing.T) { + tt.Parallel() var zeroValue int64 w := &WorkflowBill{TotalMS: &zeroValue} w.GetTotalMS() @@ -29475,6 +32642,7 @@ func TestWorkflowBill_GetTotalMS(tt *testing.T) { } func TestWorkflowDispatchEvent_GetInstallation(tt *testing.T) { + tt.Parallel() w := &WorkflowDispatchEvent{} w.GetInstallation() w = nil @@ -29482,6 +32650,7 @@ func TestWorkflowDispatchEvent_GetInstallation(tt *testing.T) { } func TestWorkflowDispatchEvent_GetOrg(tt *testing.T) { + tt.Parallel() w := &WorkflowDispatchEvent{} w.GetOrg() w = nil @@ -29489,6 +32658,7 @@ func TestWorkflowDispatchEvent_GetOrg(tt *testing.T) { } func TestWorkflowDispatchEvent_GetRef(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowDispatchEvent{Ref: &zeroValue} w.GetRef() @@ -29499,6 +32669,7 @@ func TestWorkflowDispatchEvent_GetRef(tt *testing.T) { } func TestWorkflowDispatchEvent_GetRepo(tt *testing.T) { + tt.Parallel() w := &WorkflowDispatchEvent{} w.GetRepo() w = nil @@ -29506,6 +32677,7 @@ func TestWorkflowDispatchEvent_GetRepo(tt *testing.T) { } func TestWorkflowDispatchEvent_GetSender(tt *testing.T) { + tt.Parallel() w := &WorkflowDispatchEvent{} w.GetSender() w = nil @@ -29513,6 +32685,7 @@ func TestWorkflowDispatchEvent_GetSender(tt *testing.T) { } func TestWorkflowDispatchEvent_GetWorkflow(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowDispatchEvent{Workflow: &zeroValue} w.GetWorkflow() @@ -29523,6 +32696,7 @@ func TestWorkflowDispatchEvent_GetWorkflow(tt *testing.T) { } func TestWorkflowJob_GetCheckRunURL(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowJob{CheckRunURL: &zeroValue} w.GetCheckRunURL() @@ -29533,6 +32707,7 @@ func TestWorkflowJob_GetCheckRunURL(tt *testing.T) { } func TestWorkflowJob_GetCompletedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp w := &WorkflowJob{CompletedAt: &zeroValue} w.GetCompletedAt() @@ -29543,6 +32718,7 @@ func TestWorkflowJob_GetCompletedAt(tt *testing.T) { } func TestWorkflowJob_GetConclusion(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowJob{Conclusion: &zeroValue} w.GetConclusion() @@ -29553,6 +32729,7 @@ func TestWorkflowJob_GetConclusion(tt *testing.T) { } func TestWorkflowJob_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp w := &WorkflowJob{CreatedAt: &zeroValue} w.GetCreatedAt() @@ -29563,6 +32740,7 @@ func TestWorkflowJob_GetCreatedAt(tt *testing.T) { } func TestWorkflowJob_GetHeadBranch(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowJob{HeadBranch: &zeroValue} w.GetHeadBranch() @@ -29573,6 +32751,7 @@ func TestWorkflowJob_GetHeadBranch(tt *testing.T) { } func TestWorkflowJob_GetHeadSHA(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowJob{HeadSHA: &zeroValue} w.GetHeadSHA() @@ -29583,6 +32762,7 @@ func TestWorkflowJob_GetHeadSHA(tt *testing.T) { } func TestWorkflowJob_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowJob{HTMLURL: &zeroValue} w.GetHTMLURL() @@ -29593,6 +32773,7 @@ func TestWorkflowJob_GetHTMLURL(tt *testing.T) { } func TestWorkflowJob_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 w := &WorkflowJob{ID: &zeroValue} w.GetID() @@ -29603,6 +32784,7 @@ func TestWorkflowJob_GetID(tt *testing.T) { } func TestWorkflowJob_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowJob{Name: &zeroValue} w.GetName() @@ -29613,6 +32795,7 @@ func TestWorkflowJob_GetName(tt *testing.T) { } func TestWorkflowJob_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowJob{NodeID: &zeroValue} w.GetNodeID() @@ -29623,6 +32806,7 @@ func TestWorkflowJob_GetNodeID(tt *testing.T) { } func TestWorkflowJob_GetRunAttempt(tt *testing.T) { + tt.Parallel() var zeroValue int64 w := &WorkflowJob{RunAttempt: &zeroValue} w.GetRunAttempt() @@ -29633,6 +32817,7 @@ func TestWorkflowJob_GetRunAttempt(tt *testing.T) { } func TestWorkflowJob_GetRunID(tt *testing.T) { + tt.Parallel() var zeroValue int64 w := &WorkflowJob{RunID: &zeroValue} w.GetRunID() @@ -29643,6 +32828,7 @@ func TestWorkflowJob_GetRunID(tt *testing.T) { } func TestWorkflowJob_GetRunnerGroupID(tt *testing.T) { + tt.Parallel() var zeroValue int64 w := &WorkflowJob{RunnerGroupID: &zeroValue} w.GetRunnerGroupID() @@ -29653,6 +32839,7 @@ func TestWorkflowJob_GetRunnerGroupID(tt *testing.T) { } func TestWorkflowJob_GetRunnerGroupName(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowJob{RunnerGroupName: &zeroValue} w.GetRunnerGroupName() @@ -29663,6 +32850,7 @@ func TestWorkflowJob_GetRunnerGroupName(tt *testing.T) { } func TestWorkflowJob_GetRunnerID(tt *testing.T) { + tt.Parallel() var zeroValue int64 w := &WorkflowJob{RunnerID: &zeroValue} w.GetRunnerID() @@ -29673,6 +32861,7 @@ func TestWorkflowJob_GetRunnerID(tt *testing.T) { } func TestWorkflowJob_GetRunnerName(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowJob{RunnerName: &zeroValue} w.GetRunnerName() @@ -29683,6 +32872,7 @@ func TestWorkflowJob_GetRunnerName(tt *testing.T) { } func TestWorkflowJob_GetRunURL(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowJob{RunURL: &zeroValue} w.GetRunURL() @@ -29693,6 +32883,7 @@ func TestWorkflowJob_GetRunURL(tt *testing.T) { } func TestWorkflowJob_GetStartedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp w := &WorkflowJob{StartedAt: &zeroValue} w.GetStartedAt() @@ -29703,6 +32894,7 @@ func TestWorkflowJob_GetStartedAt(tt *testing.T) { } func TestWorkflowJob_GetStatus(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowJob{Status: &zeroValue} w.GetStatus() @@ -29713,6 +32905,7 @@ func TestWorkflowJob_GetStatus(tt *testing.T) { } func TestWorkflowJob_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowJob{URL: &zeroValue} w.GetURL() @@ -29723,6 +32916,7 @@ func TestWorkflowJob_GetURL(tt *testing.T) { } func TestWorkflowJob_GetWorkflowName(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowJob{WorkflowName: &zeroValue} w.GetWorkflowName() @@ -29733,6 +32927,7 @@ func TestWorkflowJob_GetWorkflowName(tt *testing.T) { } func TestWorkflowJobEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowJobEvent{Action: &zeroValue} w.GetAction() @@ -29743,6 +32938,7 @@ func TestWorkflowJobEvent_GetAction(tt *testing.T) { } func TestWorkflowJobEvent_GetInstallation(tt *testing.T) { + tt.Parallel() w := &WorkflowJobEvent{} w.GetInstallation() w = nil @@ -29750,6 +32946,7 @@ func TestWorkflowJobEvent_GetInstallation(tt *testing.T) { } func TestWorkflowJobEvent_GetOrg(tt *testing.T) { + tt.Parallel() w := &WorkflowJobEvent{} w.GetOrg() w = nil @@ -29757,6 +32954,7 @@ func TestWorkflowJobEvent_GetOrg(tt *testing.T) { } func TestWorkflowJobEvent_GetRepo(tt *testing.T) { + tt.Parallel() w := &WorkflowJobEvent{} w.GetRepo() w = nil @@ -29764,6 +32962,7 @@ func TestWorkflowJobEvent_GetRepo(tt *testing.T) { } func TestWorkflowJobEvent_GetSender(tt *testing.T) { + tt.Parallel() w := &WorkflowJobEvent{} w.GetSender() w = nil @@ -29771,6 +32970,7 @@ func TestWorkflowJobEvent_GetSender(tt *testing.T) { } func TestWorkflowJobEvent_GetWorkflowJob(tt *testing.T) { + tt.Parallel() w := &WorkflowJobEvent{} w.GetWorkflowJob() w = nil @@ -29778,6 +32978,7 @@ func TestWorkflowJobEvent_GetWorkflowJob(tt *testing.T) { } func TestWorkflowJobRun_GetConclusion(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowJobRun{Conclusion: &zeroValue} w.GetConclusion() @@ -29788,6 +32989,7 @@ func TestWorkflowJobRun_GetConclusion(tt *testing.T) { } func TestWorkflowJobRun_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp w := &WorkflowJobRun{CreatedAt: &zeroValue} w.GetCreatedAt() @@ -29798,6 +33000,7 @@ func TestWorkflowJobRun_GetCreatedAt(tt *testing.T) { } func TestWorkflowJobRun_GetEnvironment(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowJobRun{Environment: &zeroValue} w.GetEnvironment() @@ -29808,6 +33011,7 @@ func TestWorkflowJobRun_GetEnvironment(tt *testing.T) { } func TestWorkflowJobRun_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowJobRun{HTMLURL: &zeroValue} w.GetHTMLURL() @@ -29818,6 +33022,7 @@ func TestWorkflowJobRun_GetHTMLURL(tt *testing.T) { } func TestWorkflowJobRun_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 w := &WorkflowJobRun{ID: &zeroValue} w.GetID() @@ -29828,6 +33033,7 @@ func TestWorkflowJobRun_GetID(tt *testing.T) { } func TestWorkflowJobRun_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowJobRun{Name: &zeroValue} w.GetName() @@ -29838,6 +33044,7 @@ func TestWorkflowJobRun_GetName(tt *testing.T) { } func TestWorkflowJobRun_GetStatus(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowJobRun{Status: &zeroValue} w.GetStatus() @@ -29848,6 +33055,7 @@ func TestWorkflowJobRun_GetStatus(tt *testing.T) { } func TestWorkflowJobRun_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp w := &WorkflowJobRun{UpdatedAt: &zeroValue} w.GetUpdatedAt() @@ -29858,6 +33066,7 @@ func TestWorkflowJobRun_GetUpdatedAt(tt *testing.T) { } func TestWorkflowRun_GetActor(tt *testing.T) { + tt.Parallel() w := &WorkflowRun{} w.GetActor() w = nil @@ -29865,6 +33074,7 @@ func TestWorkflowRun_GetActor(tt *testing.T) { } func TestWorkflowRun_GetArtifactsURL(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowRun{ArtifactsURL: &zeroValue} w.GetArtifactsURL() @@ -29875,6 +33085,7 @@ func TestWorkflowRun_GetArtifactsURL(tt *testing.T) { } func TestWorkflowRun_GetCancelURL(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowRun{CancelURL: &zeroValue} w.GetCancelURL() @@ -29885,6 +33096,7 @@ func TestWorkflowRun_GetCancelURL(tt *testing.T) { } func TestWorkflowRun_GetCheckSuiteID(tt *testing.T) { + tt.Parallel() var zeroValue int64 w := &WorkflowRun{CheckSuiteID: &zeroValue} w.GetCheckSuiteID() @@ -29895,6 +33107,7 @@ func TestWorkflowRun_GetCheckSuiteID(tt *testing.T) { } func TestWorkflowRun_GetCheckSuiteNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowRun{CheckSuiteNodeID: &zeroValue} w.GetCheckSuiteNodeID() @@ -29905,6 +33118,7 @@ func TestWorkflowRun_GetCheckSuiteNodeID(tt *testing.T) { } func TestWorkflowRun_GetCheckSuiteURL(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowRun{CheckSuiteURL: &zeroValue} w.GetCheckSuiteURL() @@ -29915,6 +33129,7 @@ func TestWorkflowRun_GetCheckSuiteURL(tt *testing.T) { } func TestWorkflowRun_GetConclusion(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowRun{Conclusion: &zeroValue} w.GetConclusion() @@ -29925,6 +33140,7 @@ func TestWorkflowRun_GetConclusion(tt *testing.T) { } func TestWorkflowRun_GetCreatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp w := &WorkflowRun{CreatedAt: &zeroValue} w.GetCreatedAt() @@ -29935,6 +33151,7 @@ func TestWorkflowRun_GetCreatedAt(tt *testing.T) { } func TestWorkflowRun_GetDisplayTitle(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowRun{DisplayTitle: &zeroValue} w.GetDisplayTitle() @@ -29945,6 +33162,7 @@ func TestWorkflowRun_GetDisplayTitle(tt *testing.T) { } func TestWorkflowRun_GetEvent(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowRun{Event: &zeroValue} w.GetEvent() @@ -29955,6 +33173,7 @@ func TestWorkflowRun_GetEvent(tt *testing.T) { } func TestWorkflowRun_GetHeadBranch(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowRun{HeadBranch: &zeroValue} w.GetHeadBranch() @@ -29965,6 +33184,7 @@ func TestWorkflowRun_GetHeadBranch(tt *testing.T) { } func TestWorkflowRun_GetHeadCommit(tt *testing.T) { + tt.Parallel() w := &WorkflowRun{} w.GetHeadCommit() w = nil @@ -29972,6 +33192,7 @@ func TestWorkflowRun_GetHeadCommit(tt *testing.T) { } func TestWorkflowRun_GetHeadRepository(tt *testing.T) { + tt.Parallel() w := &WorkflowRun{} w.GetHeadRepository() w = nil @@ -29979,6 +33200,7 @@ func TestWorkflowRun_GetHeadRepository(tt *testing.T) { } func TestWorkflowRun_GetHeadSHA(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowRun{HeadSHA: &zeroValue} w.GetHeadSHA() @@ -29989,6 +33211,7 @@ func TestWorkflowRun_GetHeadSHA(tt *testing.T) { } func TestWorkflowRun_GetHTMLURL(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowRun{HTMLURL: &zeroValue} w.GetHTMLURL() @@ -29999,6 +33222,7 @@ func TestWorkflowRun_GetHTMLURL(tt *testing.T) { } func TestWorkflowRun_GetID(tt *testing.T) { + tt.Parallel() var zeroValue int64 w := &WorkflowRun{ID: &zeroValue} w.GetID() @@ -30009,6 +33233,7 @@ func TestWorkflowRun_GetID(tt *testing.T) { } func TestWorkflowRun_GetJobsURL(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowRun{JobsURL: &zeroValue} w.GetJobsURL() @@ -30019,6 +33244,7 @@ func TestWorkflowRun_GetJobsURL(tt *testing.T) { } func TestWorkflowRun_GetLogsURL(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowRun{LogsURL: &zeroValue} w.GetLogsURL() @@ -30029,6 +33255,7 @@ func TestWorkflowRun_GetLogsURL(tt *testing.T) { } func TestWorkflowRun_GetName(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowRun{Name: &zeroValue} w.GetName() @@ -30039,6 +33266,7 @@ func TestWorkflowRun_GetName(tt *testing.T) { } func TestWorkflowRun_GetNodeID(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowRun{NodeID: &zeroValue} w.GetNodeID() @@ -30049,6 +33277,7 @@ func TestWorkflowRun_GetNodeID(tt *testing.T) { } func TestWorkflowRun_GetPath(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowRun{Path: &zeroValue} w.GetPath() @@ -30059,6 +33288,7 @@ func TestWorkflowRun_GetPath(tt *testing.T) { } func TestWorkflowRun_GetPreviousAttemptURL(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowRun{PreviousAttemptURL: &zeroValue} w.GetPreviousAttemptURL() @@ -30069,6 +33299,7 @@ func TestWorkflowRun_GetPreviousAttemptURL(tt *testing.T) { } func TestWorkflowRun_GetRepository(tt *testing.T) { + tt.Parallel() w := &WorkflowRun{} w.GetRepository() w = nil @@ -30076,6 +33307,7 @@ func TestWorkflowRun_GetRepository(tt *testing.T) { } func TestWorkflowRun_GetRerunURL(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowRun{RerunURL: &zeroValue} w.GetRerunURL() @@ -30086,6 +33318,7 @@ func TestWorkflowRun_GetRerunURL(tt *testing.T) { } func TestWorkflowRun_GetRunAttempt(tt *testing.T) { + tt.Parallel() var zeroValue int w := &WorkflowRun{RunAttempt: &zeroValue} w.GetRunAttempt() @@ -30096,6 +33329,7 @@ func TestWorkflowRun_GetRunAttempt(tt *testing.T) { } func TestWorkflowRun_GetRunNumber(tt *testing.T) { + tt.Parallel() var zeroValue int w := &WorkflowRun{RunNumber: &zeroValue} w.GetRunNumber() @@ -30106,6 +33340,7 @@ func TestWorkflowRun_GetRunNumber(tt *testing.T) { } func TestWorkflowRun_GetRunStartedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp w := &WorkflowRun{RunStartedAt: &zeroValue} w.GetRunStartedAt() @@ -30116,6 +33351,7 @@ func TestWorkflowRun_GetRunStartedAt(tt *testing.T) { } func TestWorkflowRun_GetStatus(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowRun{Status: &zeroValue} w.GetStatus() @@ -30126,6 +33362,7 @@ func TestWorkflowRun_GetStatus(tt *testing.T) { } func TestWorkflowRun_GetTriggeringActor(tt *testing.T) { + tt.Parallel() w := &WorkflowRun{} w.GetTriggeringActor() w = nil @@ -30133,6 +33370,7 @@ func TestWorkflowRun_GetTriggeringActor(tt *testing.T) { } func TestWorkflowRun_GetUpdatedAt(tt *testing.T) { + tt.Parallel() var zeroValue Timestamp w := &WorkflowRun{UpdatedAt: &zeroValue} w.GetUpdatedAt() @@ -30143,6 +33381,7 @@ func TestWorkflowRun_GetUpdatedAt(tt *testing.T) { } func TestWorkflowRun_GetURL(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowRun{URL: &zeroValue} w.GetURL() @@ -30153,6 +33392,7 @@ func TestWorkflowRun_GetURL(tt *testing.T) { } func TestWorkflowRun_GetWorkflowID(tt *testing.T) { + tt.Parallel() var zeroValue int64 w := &WorkflowRun{WorkflowID: &zeroValue} w.GetWorkflowID() @@ -30163,6 +33403,7 @@ func TestWorkflowRun_GetWorkflowID(tt *testing.T) { } func TestWorkflowRun_GetWorkflowURL(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowRun{WorkflowURL: &zeroValue} w.GetWorkflowURL() @@ -30173,6 +33414,7 @@ func TestWorkflowRun_GetWorkflowURL(tt *testing.T) { } func TestWorkflowRunAttemptOptions_GetExcludePullRequests(tt *testing.T) { + tt.Parallel() var zeroValue bool w := &WorkflowRunAttemptOptions{ExcludePullRequests: &zeroValue} w.GetExcludePullRequests() @@ -30183,6 +33425,7 @@ func TestWorkflowRunAttemptOptions_GetExcludePullRequests(tt *testing.T) { } func TestWorkflowRunBill_GetJobs(tt *testing.T) { + tt.Parallel() var zeroValue int w := &WorkflowRunBill{Jobs: &zeroValue} w.GetJobs() @@ -30193,6 +33436,7 @@ func TestWorkflowRunBill_GetJobs(tt *testing.T) { } func TestWorkflowRunBill_GetTotalMS(tt *testing.T) { + tt.Parallel() var zeroValue int64 w := &WorkflowRunBill{TotalMS: &zeroValue} w.GetTotalMS() @@ -30203,6 +33447,7 @@ func TestWorkflowRunBill_GetTotalMS(tt *testing.T) { } func TestWorkflowRunEvent_GetAction(tt *testing.T) { + tt.Parallel() var zeroValue string w := &WorkflowRunEvent{Action: &zeroValue} w.GetAction() @@ -30213,6 +33458,7 @@ func TestWorkflowRunEvent_GetAction(tt *testing.T) { } func TestWorkflowRunEvent_GetInstallation(tt *testing.T) { + tt.Parallel() w := &WorkflowRunEvent{} w.GetInstallation() w = nil @@ -30220,6 +33466,7 @@ func TestWorkflowRunEvent_GetInstallation(tt *testing.T) { } func TestWorkflowRunEvent_GetOrg(tt *testing.T) { + tt.Parallel() w := &WorkflowRunEvent{} w.GetOrg() w = nil @@ -30227,6 +33474,7 @@ func TestWorkflowRunEvent_GetOrg(tt *testing.T) { } func TestWorkflowRunEvent_GetRepo(tt *testing.T) { + tt.Parallel() w := &WorkflowRunEvent{} w.GetRepo() w = nil @@ -30234,6 +33482,7 @@ func TestWorkflowRunEvent_GetRepo(tt *testing.T) { } func TestWorkflowRunEvent_GetSender(tt *testing.T) { + tt.Parallel() w := &WorkflowRunEvent{} w.GetSender() w = nil @@ -30241,6 +33490,7 @@ func TestWorkflowRunEvent_GetSender(tt *testing.T) { } func TestWorkflowRunEvent_GetWorkflow(tt *testing.T) { + tt.Parallel() w := &WorkflowRunEvent{} w.GetWorkflow() w = nil @@ -30248,6 +33498,7 @@ func TestWorkflowRunEvent_GetWorkflow(tt *testing.T) { } func TestWorkflowRunEvent_GetWorkflowRun(tt *testing.T) { + tt.Parallel() w := &WorkflowRunEvent{} w.GetWorkflowRun() w = nil @@ -30255,6 +33506,7 @@ func TestWorkflowRunEvent_GetWorkflowRun(tt *testing.T) { } func TestWorkflowRunJobRun_GetDurationMS(tt *testing.T) { + tt.Parallel() var zeroValue int64 w := &WorkflowRunJobRun{DurationMS: &zeroValue} w.GetDurationMS() @@ -30265,6 +33517,7 @@ func TestWorkflowRunJobRun_GetDurationMS(tt *testing.T) { } func TestWorkflowRunJobRun_GetJobID(tt *testing.T) { + tt.Parallel() var zeroValue int w := &WorkflowRunJobRun{JobID: &zeroValue} w.GetJobID() @@ -30275,6 +33528,7 @@ func TestWorkflowRunJobRun_GetJobID(tt *testing.T) { } func TestWorkflowRuns_GetTotalCount(tt *testing.T) { + tt.Parallel() var zeroValue int w := &WorkflowRuns{TotalCount: &zeroValue} w.GetTotalCount() @@ -30285,6 +33539,7 @@ func TestWorkflowRuns_GetTotalCount(tt *testing.T) { } func TestWorkflowRunUsage_GetBillable(tt *testing.T) { + tt.Parallel() w := &WorkflowRunUsage{} w.GetBillable() w = nil @@ -30292,6 +33547,7 @@ func TestWorkflowRunUsage_GetBillable(tt *testing.T) { } func TestWorkflowRunUsage_GetRunDurationMS(tt *testing.T) { + tt.Parallel() var zeroValue int64 w := &WorkflowRunUsage{RunDurationMS: &zeroValue} w.GetRunDurationMS() @@ -30302,6 +33558,7 @@ func TestWorkflowRunUsage_GetRunDurationMS(tt *testing.T) { } func TestWorkflows_GetTotalCount(tt *testing.T) { + tt.Parallel() var zeroValue int w := &Workflows{TotalCount: &zeroValue} w.GetTotalCount() @@ -30312,6 +33569,7 @@ func TestWorkflows_GetTotalCount(tt *testing.T) { } func TestWorkflowUsage_GetBillable(tt *testing.T) { + tt.Parallel() w := &WorkflowUsage{} w.GetBillable() w = nil diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index 4a210326f9a..d311b87f337 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -16,6 +16,7 @@ import ( func Float64(v float64) *float64 { return &v } func TestActionsAllowed_String(t *testing.T) { + t.Parallel() v := ActionsAllowed{ GithubOwnedAllowed: Bool(false), VerifiedAllowed: Bool(false), @@ -28,6 +29,7 @@ func TestActionsAllowed_String(t *testing.T) { } func TestActionsPermissions_String(t *testing.T) { + t.Parallel() v := ActionsPermissions{ EnabledRepositories: String(""), AllowedActions: String(""), @@ -40,6 +42,7 @@ func TestActionsPermissions_String(t *testing.T) { } func TestActionsPermissionsEnterprise_String(t *testing.T) { + t.Parallel() v := ActionsPermissionsEnterprise{ EnabledOrganizations: String(""), AllowedActions: String(""), @@ -52,6 +55,7 @@ func TestActionsPermissionsEnterprise_String(t *testing.T) { } func TestActionsPermissionsRepository_String(t *testing.T) { + t.Parallel() v := ActionsPermissionsRepository{ Enabled: Bool(false), AllowedActions: String(""), @@ -64,6 +68,7 @@ func TestActionsPermissionsRepository_String(t *testing.T) { } func TestAdminStats_String(t *testing.T) { + t.Parallel() v := AdminStats{ Issues: &IssueStats{}, Hooks: &HookStats{}, @@ -83,6 +88,7 @@ func TestAdminStats_String(t *testing.T) { } func TestAdvancedSecurity_String(t *testing.T) { + t.Parallel() v := AdvancedSecurity{ Status: String(""), } @@ -93,6 +99,7 @@ func TestAdvancedSecurity_String(t *testing.T) { } func TestAuthorization_String(t *testing.T) { + t.Parallel() v := Authorization{ ID: Int64(0), URL: String(""), @@ -115,6 +122,7 @@ func TestAuthorization_String(t *testing.T) { } func TestAuthorizationApp_String(t *testing.T) { + t.Parallel() v := AuthorizationApp{ URL: String(""), Name: String(""), @@ -127,6 +135,7 @@ func TestAuthorizationApp_String(t *testing.T) { } func TestAuthorizationRequest_String(t *testing.T) { + t.Parallel() v := AuthorizationRequest{ Scopes: []Scope{ScopeNone}, Note: String(""), @@ -142,6 +151,7 @@ func TestAuthorizationRequest_String(t *testing.T) { } func TestAuthorizationUpdateRequest_String(t *testing.T) { + t.Parallel() v := AuthorizationUpdateRequest{ Scopes: []string{""}, AddScopes: []string{""}, @@ -157,6 +167,7 @@ func TestAuthorizationUpdateRequest_String(t *testing.T) { } func TestCheckRun_String(t *testing.T) { + t.Parallel() v := CheckRun{ ID: Int64(0), NodeID: String(""), @@ -181,6 +192,7 @@ func TestCheckRun_String(t *testing.T) { } func TestCheckSuite_String(t *testing.T) { + t.Parallel() v := CheckSuite{ ID: Int64(0), NodeID: String(""), @@ -207,6 +219,7 @@ func TestCheckSuite_String(t *testing.T) { } func TestCodeOfConduct_String(t *testing.T) { + t.Parallel() v := CodeOfConduct{ Name: String(""), Key: String(""), @@ -220,6 +233,7 @@ func TestCodeOfConduct_String(t *testing.T) { } func TestCodeResult_String(t *testing.T) { + t.Parallel() v := CodeResult{ Name: String(""), Path: String(""), @@ -234,6 +248,7 @@ func TestCodeResult_String(t *testing.T) { } func TestCombinedStatus_String(t *testing.T) { + t.Parallel() v := CombinedStatus{ State: String(""), Name: String(""), @@ -249,6 +264,7 @@ func TestCombinedStatus_String(t *testing.T) { } func TestCommentStats_String(t *testing.T) { + t.Parallel() v := CommentStats{ TotalCommitComments: Int(0), TotalGistComments: Int(0), @@ -262,6 +278,7 @@ func TestCommentStats_String(t *testing.T) { } func TestCommit_String(t *testing.T) { + t.Parallel() v := Commit{ SHA: String(""), Author: &CommitAuthor{}, @@ -282,6 +299,7 @@ func TestCommit_String(t *testing.T) { } func TestCommitAuthor_String(t *testing.T) { + t.Parallel() v := CommitAuthor{ Date: &Timestamp{}, Name: String(""), @@ -295,6 +313,7 @@ func TestCommitAuthor_String(t *testing.T) { } func TestCommitFile_String(t *testing.T) { + t.Parallel() v := CommitFile{ SHA: String(""), Filename: String(""), @@ -315,6 +334,7 @@ func TestCommitFile_String(t *testing.T) { } func TestCommitStats_String(t *testing.T) { + t.Parallel() v := CommitStats{ Additions: Int(0), Deletions: Int(0), @@ -327,6 +347,7 @@ func TestCommitStats_String(t *testing.T) { } func TestCommitsComparison_String(t *testing.T) { + t.Parallel() v := CommitsComparison{ BaseCommit: &RepositoryCommit{}, MergeBaseCommit: &RepositoryCommit{}, @@ -347,6 +368,7 @@ func TestCommitsComparison_String(t *testing.T) { } func TestContributorStats_String(t *testing.T) { + t.Parallel() v := ContributorStats{ Author: &Contributor{}, Total: Int(0), @@ -358,6 +380,7 @@ func TestContributorStats_String(t *testing.T) { } func TestDependabotSecurityUpdates_String(t *testing.T) { + t.Parallel() v := DependabotSecurityUpdates{ Status: String(""), } @@ -368,6 +391,7 @@ func TestDependabotSecurityUpdates_String(t *testing.T) { } func TestDiscussionComment_String(t *testing.T) { + t.Parallel() v := DiscussionComment{ Author: &User{}, Body: String(""), @@ -390,6 +414,7 @@ func TestDiscussionComment_String(t *testing.T) { } func TestDraftReviewComment_String(t *testing.T) { + t.Parallel() v := DraftReviewComment{ Path: String(""), Position: Int(0), @@ -406,6 +431,7 @@ func TestDraftReviewComment_String(t *testing.T) { } func TestEnterprise_String(t *testing.T) { + t.Parallel() v := Enterprise{ ID: Int(0), Slug: String(""), @@ -425,6 +451,7 @@ func TestEnterprise_String(t *testing.T) { } func TestEvent_String(t *testing.T) { + t.Parallel() v := Event{ Type: String(""), Public: Bool(false), @@ -441,6 +468,7 @@ func TestEvent_String(t *testing.T) { } func TestGPGKey_String(t *testing.T) { + t.Parallel() v := GPGKey{ ID: Int64(0), PrimaryKeyID: Int64(0), @@ -461,6 +489,7 @@ func TestGPGKey_String(t *testing.T) { } func TestGist_String(t *testing.T) { + t.Parallel() v := Gist{ ID: String(""), Description: String(""), @@ -481,6 +510,7 @@ func TestGist_String(t *testing.T) { } func TestGistComment_String(t *testing.T) { + t.Parallel() v := GistComment{ ID: Int64(0), URL: String(""), @@ -495,6 +525,7 @@ func TestGistComment_String(t *testing.T) { } func TestGistCommit_String(t *testing.T) { + t.Parallel() v := GistCommit{ URL: String(""), Version: String(""), @@ -510,6 +541,7 @@ func TestGistCommit_String(t *testing.T) { } func TestGistFile_String(t *testing.T) { + t.Parallel() v := GistFile{ Size: Int(0), Filename: String(""), @@ -525,6 +557,7 @@ func TestGistFile_String(t *testing.T) { } func TestGistFork_String(t *testing.T) { + t.Parallel() v := GistFork{ URL: String(""), User: &User{}, @@ -540,6 +573,7 @@ func TestGistFork_String(t *testing.T) { } func TestGistStats_String(t *testing.T) { + t.Parallel() v := GistStats{ TotalGists: Int(0), PrivateGists: Int(0), @@ -552,6 +586,7 @@ func TestGistStats_String(t *testing.T) { } func TestGitObject_String(t *testing.T) { + t.Parallel() v := GitObject{ Type: String(""), SHA: String(""), @@ -564,6 +599,7 @@ func TestGitObject_String(t *testing.T) { } func TestGitignore_String(t *testing.T) { + t.Parallel() v := Gitignore{ Name: String(""), Source: String(""), @@ -575,6 +611,7 @@ func TestGitignore_String(t *testing.T) { } func TestGrant_String(t *testing.T) { + t.Parallel() v := Grant{ ID: Int64(0), URL: String(""), @@ -590,6 +627,7 @@ func TestGrant_String(t *testing.T) { } func TestHeadCommit_String(t *testing.T) { + t.Parallel() v := HeadCommit{ Message: String(""), Author: &CommitAuthor{}, @@ -611,6 +649,7 @@ func TestHeadCommit_String(t *testing.T) { } func TestHook_String(t *testing.T) { + t.Parallel() v := Hook{ CreatedAt: &Timestamp{}, UpdatedAt: &Timestamp{}, @@ -631,6 +670,7 @@ func TestHook_String(t *testing.T) { } func TestHookDelivery_String(t *testing.T) { + t.Parallel() v := HookDelivery{ ID: Int64(0), GUID: String(""), @@ -653,6 +693,7 @@ func TestHookDelivery_String(t *testing.T) { } func TestHookStats_String(t *testing.T) { + t.Parallel() v := HookStats{ TotalHooks: Int(0), ActiveHooks: Int(0), @@ -665,6 +706,7 @@ func TestHookStats_String(t *testing.T) { } func TestImport_String(t *testing.T) { + t.Parallel() v := Import{ VCSURL: String(""), VCS: String(""), @@ -696,6 +738,7 @@ func TestImport_String(t *testing.T) { } func TestInstallation_String(t *testing.T) { + t.Parallel() v := Installation{ ID: Int64(0), NodeID: String(""), @@ -725,6 +768,7 @@ func TestInstallation_String(t *testing.T) { } func TestInvitation_String(t *testing.T) { + t.Parallel() v := Invitation{ ID: Int64(0), NodeID: String(""), @@ -745,6 +789,7 @@ func TestInvitation_String(t *testing.T) { } func TestIssue_String(t *testing.T) { + t.Parallel() v := Issue{ ID: Int64(0), Number: Int(0), @@ -782,6 +827,7 @@ func TestIssue_String(t *testing.T) { } func TestIssueComment_String(t *testing.T) { + t.Parallel() v := IssueComment{ ID: Int64(0), NodeID: String(""), @@ -802,6 +848,7 @@ func TestIssueComment_String(t *testing.T) { } func TestIssueStats_String(t *testing.T) { + t.Parallel() v := IssueStats{ TotalIssues: Int(0), OpenIssues: Int(0), @@ -814,6 +861,7 @@ func TestIssueStats_String(t *testing.T) { } func TestKey_String(t *testing.T) { + t.Parallel() v := Key{ ID: Int64(0), Key: String(""), @@ -832,6 +880,7 @@ func TestKey_String(t *testing.T) { } func TestLabel_String(t *testing.T) { + t.Parallel() v := Label{ ID: Int64(0), URL: String(""), @@ -848,6 +897,7 @@ func TestLabel_String(t *testing.T) { } func TestLabelResult_String(t *testing.T) { + t.Parallel() v := LabelResult{ ID: Int64(0), URL: String(""), @@ -864,6 +914,7 @@ func TestLabelResult_String(t *testing.T) { } func TestLargeFile_String(t *testing.T) { + t.Parallel() v := LargeFile{ RefName: String(""), Path: String(""), @@ -877,6 +928,7 @@ func TestLargeFile_String(t *testing.T) { } func TestLicense_String(t *testing.T) { + t.Parallel() v := License{ Key: String(""), Name: String(""), @@ -895,6 +947,7 @@ func TestLicense_String(t *testing.T) { } func TestMembership_String(t *testing.T) { + t.Parallel() v := Membership{ URL: String(""), State: String(""), @@ -910,6 +963,7 @@ func TestMembership_String(t *testing.T) { } func TestMigration_String(t *testing.T) { + t.Parallel() v := Migration{ ID: Int64(0), GUID: String(""), @@ -927,6 +981,7 @@ func TestMigration_String(t *testing.T) { } func TestMilestone_String(t *testing.T) { + t.Parallel() v := Milestone{ URL: String(""), HTMLURL: String(""), @@ -952,6 +1007,7 @@ func TestMilestone_String(t *testing.T) { } func TestMilestoneStats_String(t *testing.T) { + t.Parallel() v := MilestoneStats{ TotalMilestones: Int(0), OpenMilestones: Int(0), @@ -964,6 +1020,7 @@ func TestMilestoneStats_String(t *testing.T) { } func TestNewTeam_String(t *testing.T) { + t.Parallel() v := NewTeam{ Name: "", Description: String(""), @@ -982,6 +1039,7 @@ func TestNewTeam_String(t *testing.T) { } func TestOAuthAPP_String(t *testing.T) { + t.Parallel() v := OAuthAPP{ URL: String(""), Name: String(""), @@ -994,6 +1052,7 @@ func TestOAuthAPP_String(t *testing.T) { } func TestOrgStats_String(t *testing.T) { + t.Parallel() v := OrgStats{ TotalOrgs: Int(0), DisabledOrgs: Int(0), @@ -1007,6 +1066,7 @@ func TestOrgStats_String(t *testing.T) { } func TestOrganization_String(t *testing.T) { + t.Parallel() v := Organization{ Login: String(""), ID: Int64(0), @@ -1072,6 +1132,7 @@ func TestOrganization_String(t *testing.T) { } func TestPackage_String(t *testing.T) { + t.Parallel() v := Package{ ID: Int64(0), Name: String(""), @@ -1094,6 +1155,7 @@ func TestPackage_String(t *testing.T) { } func TestPackageContainerMetadata_String(t *testing.T) { + t.Parallel() v := PackageContainerMetadata{ Tags: []string{""}, } @@ -1104,6 +1166,7 @@ func TestPackageContainerMetadata_String(t *testing.T) { } func TestPackageFile_String(t *testing.T) { + t.Parallel() v := PackageFile{ DownloadURL: String(""), ID: Int64(0), @@ -1125,6 +1188,7 @@ func TestPackageFile_String(t *testing.T) { } func TestPackageMetadata_String(t *testing.T) { + t.Parallel() v := PackageMetadata{ PackageType: String(""), Container: &PackageContainerMetadata{}, @@ -1136,6 +1200,7 @@ func TestPackageMetadata_String(t *testing.T) { } func TestPackageRegistry_String(t *testing.T) { + t.Parallel() v := PackageRegistry{ AboutURL: String(""), Name: String(""), @@ -1150,6 +1215,7 @@ func TestPackageRegistry_String(t *testing.T) { } func TestPackageRelease_String(t *testing.T) { + t.Parallel() v := PackageRelease{ URL: String(""), HTMLURL: String(""), @@ -1170,6 +1236,7 @@ func TestPackageRelease_String(t *testing.T) { } func TestPackageVersion_String(t *testing.T) { + t.Parallel() v := PackageVersion{ ID: Int64(0), Version: String(""), @@ -1200,6 +1267,7 @@ func TestPackageVersion_String(t *testing.T) { } func TestPageStats_String(t *testing.T) { + t.Parallel() v := PageStats{ TotalPages: Int(0), } @@ -1210,6 +1278,7 @@ func TestPageStats_String(t *testing.T) { } func TestPlan_String(t *testing.T) { + t.Parallel() v := Plan{ Name: String(""), Space: Int(0), @@ -1225,6 +1294,7 @@ func TestPlan_String(t *testing.T) { } func TestPreReceiveHook_String(t *testing.T) { + t.Parallel() v := PreReceiveHook{ ID: Int64(0), Name: String(""), @@ -1238,6 +1308,7 @@ func TestPreReceiveHook_String(t *testing.T) { } func TestProject_String(t *testing.T) { + t.Parallel() v := Project{ ID: Int64(0), URL: String(""), @@ -1262,6 +1333,7 @@ func TestProject_String(t *testing.T) { } func TestPullRequest_String(t *testing.T) { + t.Parallel() v := PullRequest{ ID: Int64(0), Number: Int(0), @@ -1315,6 +1387,7 @@ func TestPullRequest_String(t *testing.T) { } func TestPullRequestComment_String(t *testing.T) { + t.Parallel() v := PullRequestComment{ ID: Int64(0), NodeID: String(""), @@ -1350,6 +1423,7 @@ func TestPullRequestComment_String(t *testing.T) { } func TestPullRequestReview_String(t *testing.T) { + t.Parallel() v := PullRequestReview{ ID: Int64(0), NodeID: String(""), @@ -1369,6 +1443,7 @@ func TestPullRequestReview_String(t *testing.T) { } func TestPullRequestReviewDismissalRequest_String(t *testing.T) { + t.Parallel() v := PullRequestReviewDismissalRequest{ Message: String(""), } @@ -1379,6 +1454,7 @@ func TestPullRequestReviewDismissalRequest_String(t *testing.T) { } func TestPullRequestReviewRequest_String(t *testing.T) { + t.Parallel() v := PullRequestReviewRequest{ NodeID: String(""), CommitID: String(""), @@ -1392,6 +1468,7 @@ func TestPullRequestReviewRequest_String(t *testing.T) { } func TestPullRequestThread_String(t *testing.T) { + t.Parallel() v := PullRequestThread{ ID: Int64(0), NodeID: String(""), @@ -1403,6 +1480,7 @@ func TestPullRequestThread_String(t *testing.T) { } func TestPullStats_String(t *testing.T) { + t.Parallel() v := PullStats{ TotalPulls: Int(0), MergedPulls: Int(0), @@ -1416,6 +1494,7 @@ func TestPullStats_String(t *testing.T) { } func TestPushEvent_String(t *testing.T) { + t.Parallel() v := PushEvent{ PushID: Int64(0), Head: String(""), @@ -1444,6 +1523,7 @@ func TestPushEvent_String(t *testing.T) { } func TestRate_String(t *testing.T) { + t.Parallel() v := Rate{ Limit: 0, Remaining: 0, @@ -1456,6 +1536,7 @@ func TestRate_String(t *testing.T) { } func TestReaction_String(t *testing.T) { + t.Parallel() v := Reaction{ ID: Int64(0), User: &User{}, @@ -1469,6 +1550,7 @@ func TestReaction_String(t *testing.T) { } func TestReference_String(t *testing.T) { + t.Parallel() v := Reference{ Ref: String(""), URL: String(""), @@ -1482,6 +1564,7 @@ func TestReference_String(t *testing.T) { } func TestReleaseAsset_String(t *testing.T) { + t.Parallel() v := ReleaseAsset{ ID: Int64(0), URL: String(""), @@ -1504,6 +1587,7 @@ func TestReleaseAsset_String(t *testing.T) { } func TestRename_String(t *testing.T) { + t.Parallel() v := Rename{ From: String(""), To: String(""), @@ -1515,6 +1599,7 @@ func TestRename_String(t *testing.T) { } func TestRepoStats_String(t *testing.T) { + t.Parallel() v := RepoStats{ TotalRepos: Int(0), RootRepos: Int(0), @@ -1530,6 +1615,7 @@ func TestRepoStats_String(t *testing.T) { } func TestRepoStatus_String(t *testing.T) { + t.Parallel() v := RepoStatus{ ID: Int64(0), NodeID: String(""), @@ -1550,6 +1636,7 @@ func TestRepoStatus_String(t *testing.T) { } func TestRepository_String(t *testing.T) { + t.Parallel() v := Repository{ ID: Int64(0), NodeID: String(""), @@ -1662,6 +1749,7 @@ func TestRepository_String(t *testing.T) { } func TestRepositoryComment_String(t *testing.T) { + t.Parallel() v := RepositoryComment{ HTMLURL: String(""), URL: String(""), @@ -1683,6 +1771,7 @@ func TestRepositoryComment_String(t *testing.T) { } func TestRepositoryCommit_String(t *testing.T) { + t.Parallel() v := RepositoryCommit{ NodeID: String(""), SHA: String(""), @@ -1701,6 +1790,7 @@ func TestRepositoryCommit_String(t *testing.T) { } func TestRepositoryContent_String(t *testing.T) { + t.Parallel() v := RepositoryContent{ Type: String(""), Target: String(""), @@ -1723,6 +1813,7 @@ func TestRepositoryContent_String(t *testing.T) { } func TestRepositoryLicense_String(t *testing.T) { + t.Parallel() v := RepositoryLicense{ Name: String(""), Path: String(""), @@ -1744,6 +1835,7 @@ func TestRepositoryLicense_String(t *testing.T) { } func TestRepositoryParticipation_String(t *testing.T) { + t.Parallel() v := RepositoryParticipation{ All: []int{0}, Owner: []int{0}, @@ -1755,6 +1847,7 @@ func TestRepositoryParticipation_String(t *testing.T) { } func TestRepositoryRelease_String(t *testing.T) { + t.Parallel() v := RepositoryRelease{ TagName: String(""), TargetCommitish: String(""), @@ -1784,6 +1877,7 @@ func TestRepositoryRelease_String(t *testing.T) { } func TestSBOM_String(t *testing.T) { + t.Parallel() v := SBOM{ SBOM: &SBOMInfo{}, } @@ -1794,6 +1888,7 @@ func TestSBOM_String(t *testing.T) { } func TestSSHSigningKey_String(t *testing.T) { + t.Parallel() v := SSHSigningKey{ ID: Int64(0), Key: String(""), @@ -1807,6 +1902,7 @@ func TestSSHSigningKey_String(t *testing.T) { } func TestSecretScanning_String(t *testing.T) { + t.Parallel() v := SecretScanning{ Status: String(""), } @@ -1817,6 +1913,7 @@ func TestSecretScanning_String(t *testing.T) { } func TestSecretScanningPushProtection_String(t *testing.T) { + t.Parallel() v := SecretScanningPushProtection{ Status: String(""), } @@ -1827,6 +1924,7 @@ func TestSecretScanningPushProtection_String(t *testing.T) { } func TestSecurityAndAnalysis_String(t *testing.T) { + t.Parallel() v := SecurityAndAnalysis{ AdvancedSecurity: &AdvancedSecurity{}, SecretScanning: &SecretScanning{}, @@ -1841,6 +1939,7 @@ func TestSecurityAndAnalysis_String(t *testing.T) { } func TestSourceImportAuthor_String(t *testing.T) { + t.Parallel() v := SourceImportAuthor{ ID: Int64(0), RemoteID: String(""), @@ -1857,6 +1956,7 @@ func TestSourceImportAuthor_String(t *testing.T) { } func TestTeam_String(t *testing.T) { + t.Parallel() v := Team{ ID: Int64(0), NodeID: String(""), @@ -1882,6 +1982,7 @@ func TestTeam_String(t *testing.T) { } func TestTeamDiscussion_String(t *testing.T) { + t.Parallel() v := TeamDiscussion{ Author: &User{}, Body: String(""), @@ -1909,6 +2010,7 @@ func TestTeamDiscussion_String(t *testing.T) { } func TestTeamLDAPMapping_String(t *testing.T) { + t.Parallel() v := TeamLDAPMapping{ ID: Int64(0), LDAPDN: String(""), @@ -1928,6 +2030,7 @@ func TestTeamLDAPMapping_String(t *testing.T) { } func TestTextMatch_String(t *testing.T) { + t.Parallel() v := TextMatch{ ObjectURL: String(""), ObjectType: String(""), @@ -1941,6 +2044,7 @@ func TestTextMatch_String(t *testing.T) { } func TestTree_String(t *testing.T) { + t.Parallel() v := Tree{ SHA: String(""), Truncated: Bool(false), @@ -1952,6 +2056,7 @@ func TestTree_String(t *testing.T) { } func TestTreeEntry_String(t *testing.T) { + t.Parallel() v := TreeEntry{ SHA: String(""), Path: String(""), @@ -1968,6 +2073,7 @@ func TestTreeEntry_String(t *testing.T) { } func TestUser_String(t *testing.T) { + t.Parallel() v := User{ Login: String(""), ID: Int64(0), @@ -2019,6 +2125,7 @@ func TestUser_String(t *testing.T) { } func TestUserLDAPMapping_String(t *testing.T) { + t.Parallel() v := UserLDAPMapping{ ID: Int64(0), LDAPDN: String(""), @@ -2045,6 +2152,7 @@ func TestUserLDAPMapping_String(t *testing.T) { } func TestUserMigration_String(t *testing.T) { + t.Parallel() v := UserMigration{ ID: Int64(0), GUID: String(""), @@ -2062,6 +2170,7 @@ func TestUserMigration_String(t *testing.T) { } func TestUserStats_String(t *testing.T) { + t.Parallel() v := UserStats{ TotalUsers: Int(0), AdminUsers: Int(0), @@ -2074,6 +2183,7 @@ func TestUserStats_String(t *testing.T) { } func TestWeeklyCommitActivity_String(t *testing.T) { + t.Parallel() v := WeeklyCommitActivity{ Days: []int{0}, Total: Int(0), @@ -2086,6 +2196,7 @@ func TestWeeklyCommitActivity_String(t *testing.T) { } func TestWeeklyStats_String(t *testing.T) { + t.Parallel() v := WeeklyStats{ Week: &Timestamp{}, Additions: Int(0), diff --git a/github/github_test.go b/github/github_test.go index 00b8e43f91f..a3eb29720c8 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -292,6 +292,7 @@ func assertWrite(t *testing.T, w io.Writer, data []byte) { } func TestNewClient(t *testing.T) { + t.Parallel() c := NewClient(nil) if got, want := c.BaseURL.String(), defaultBaseURL; got != want { @@ -308,6 +309,7 @@ func TestNewClient(t *testing.T) { } func TestNewClientWithEnvProxy(t *testing.T) { + t.Parallel() client := NewClientWithEnvProxy() if got, want := client.BaseURL.String(), defaultBaseURL; got != want { t.Errorf("NewClient BaseURL is %v, want %v", got, want) @@ -315,6 +317,7 @@ func TestNewClientWithEnvProxy(t *testing.T) { } func TestClient(t *testing.T) { + t.Parallel() c := NewClient(nil) c2 := c.Client() if c.client == c2 { @@ -323,6 +326,7 @@ func TestClient(t *testing.T) { } func TestWithAuthToken(t *testing.T) { + t.Parallel() token := "gh_test_token" validate := func(t *testing.T, c *http.Client, token string) { @@ -348,11 +352,13 @@ func TestWithAuthToken(t *testing.T) { } t.Run("zero-value Client", func(t *testing.T) { + t.Parallel() c := new(Client).WithAuthToken(token) validate(t, c.Client(), token) }) t.Run("NewClient", func(t *testing.T) { + t.Parallel() httpClient := &http.Client{} client := NewClient(httpClient).WithAuthToken(token) validate(t, client.Client(), token) @@ -361,11 +367,13 @@ func TestWithAuthToken(t *testing.T) { }) t.Run("NewTokenClient", func(t *testing.T) { + t.Parallel() validate(t, NewTokenClient(context.Background(), token).Client(), token) }) } func TestWithEnterpriseURLs(t *testing.T) { + t.Parallel() for _, test := range []struct { name string baseURL string @@ -457,7 +465,9 @@ func TestWithEnterpriseURLs(t *testing.T) { wantUploadURL: "https://cloud-api.custom-upload-url/api/uploads/", }, } { + test := test t.Run(test.name, func(t *testing.T) { + t.Parallel() validate := func(c *Client, err error) { t.Helper() if test.wantErr != "" { @@ -485,12 +495,14 @@ func TestWithEnterpriseURLs(t *testing.T) { // Ensure that length of Client.rateLimits is the same as number of fields in RateLimits struct. func TestClient_rateLimits(t *testing.T) { + t.Parallel() if got, want := len(Client{}.rateLimits), reflect.TypeOf(RateLimits{}).NumField(); got != want { t.Errorf("len(Client{}.rateLimits) is %v, want %v", got, want) } } func TestNewRequest(t *testing.T) { + t.Parallel() c := NewClient(nil) inURL, outURL := "/foo", defaultBaseURL+"foo" @@ -532,6 +544,7 @@ func TestNewRequest(t *testing.T) { } func TestNewRequest_invalidJSON(t *testing.T) { + t.Parallel() c := NewClient(nil) type T struct { @@ -548,12 +561,14 @@ func TestNewRequest_invalidJSON(t *testing.T) { } func TestNewRequest_badURL(t *testing.T) { + t.Parallel() c := NewClient(nil) _, err := c.NewRequest("GET", ":", nil) testURLParseError(t, err) } func TestNewRequest_badMethod(t *testing.T) { + t.Parallel() c := NewClient(nil) if _, err := c.NewRequest("BOGUS\nMETHOD", ".", nil); err == nil { t.Fatal("NewRequest returned nil; expected error") @@ -563,6 +578,7 @@ func TestNewRequest_badMethod(t *testing.T) { // ensure that no User-Agent header is set if the client's UserAgent is empty. // This caused a problem with Google's internal http client. func TestNewRequest_emptyUserAgent(t *testing.T) { + t.Parallel() c := NewClient(nil) c.UserAgent = "" req, err := c.NewRequest("GET", ".", nil) @@ -581,6 +597,7 @@ func TestNewRequest_emptyUserAgent(t *testing.T) { // certain cases, intermediate systems may treat these differently resulting in // subtle errors. func TestNewRequest_emptyBody(t *testing.T) { + t.Parallel() c := NewClient(nil) req, err := c.NewRequest("GET", ".", nil) if err != nil { @@ -592,6 +609,7 @@ func TestNewRequest_emptyBody(t *testing.T) { } func TestNewRequest_errorForNoTrailingSlash(t *testing.T) { + t.Parallel() tests := []struct { rawurl string wantError bool @@ -615,6 +633,7 @@ func TestNewRequest_errorForNoTrailingSlash(t *testing.T) { } func TestNewFormRequest(t *testing.T) { + t.Parallel() c := NewClient(nil) inURL, outURL := "/foo", defaultBaseURL+"foo" @@ -652,12 +671,14 @@ func TestNewFormRequest(t *testing.T) { } func TestNewFormRequest_badURL(t *testing.T) { + t.Parallel() c := NewClient(nil) _, err := c.NewFormRequest(":", nil) testURLParseError(t, err) } func TestNewFormRequest_emptyUserAgent(t *testing.T) { + t.Parallel() c := NewClient(nil) c.UserAgent = "" req, err := c.NewFormRequest(".", nil) @@ -670,6 +691,7 @@ func TestNewFormRequest_emptyUserAgent(t *testing.T) { } func TestNewFormRequest_emptyBody(t *testing.T) { + t.Parallel() c := NewClient(nil) req, err := c.NewFormRequest(".", nil) if err != nil { @@ -681,6 +703,7 @@ func TestNewFormRequest_emptyBody(t *testing.T) { } func TestNewFormRequest_errorForNoTrailingSlash(t *testing.T) { + t.Parallel() tests := []struct { rawURL string wantError bool @@ -704,6 +727,7 @@ func TestNewFormRequest_errorForNoTrailingSlash(t *testing.T) { } func TestNewUploadRequest_WithVersion(t *testing.T) { + t.Parallel() c := NewClient(nil) req, _ := c.NewUploadRequest("https://example.com/", nil, 0, "") @@ -720,6 +744,7 @@ func TestNewUploadRequest_WithVersion(t *testing.T) { } func TestNewUploadRequest_badURL(t *testing.T) { + t.Parallel() c := NewClient(nil) _, err := c.NewUploadRequest(":", nil, 0, "") testURLParseError(t, err) @@ -732,6 +757,7 @@ func TestNewUploadRequest_badURL(t *testing.T) { } func TestNewUploadRequest_errorForNoTrailingSlash(t *testing.T) { + t.Parallel() tests := []struct { rawurl string wantError bool @@ -755,6 +781,7 @@ func TestNewUploadRequest_errorForNoTrailingSlash(t *testing.T) { } func TestResponse_populatePageValues(t *testing.T) { + t.Parallel() r := http.Response{ Header: http.Header{ "Link": {`; rel="first",` + @@ -784,6 +811,7 @@ func TestResponse_populatePageValues(t *testing.T) { } func TestResponse_populateSinceValues(t *testing.T) { + t.Parallel() r := http.Response{ Header: http.Header{ "Link": {`; rel="first",` + @@ -813,6 +841,7 @@ func TestResponse_populateSinceValues(t *testing.T) { } func TestResponse_SinceWithPage(t *testing.T) { + t.Parallel() r := http.Response{ Header: http.Header{ "Link": {`; rel="first",` + @@ -842,6 +871,7 @@ func TestResponse_SinceWithPage(t *testing.T) { } func TestResponse_cursorPagination(t *testing.T) { + t.Parallel() r := http.Response{ Header: http.Header{ "Status": {"200 OK"}, @@ -882,6 +912,7 @@ func TestResponse_cursorPagination(t *testing.T) { } func TestResponse_beforeAfterPagination(t *testing.T) { + t.Parallel() r := http.Response{ Header: http.Header{ "Link": {`; rel="next",` + @@ -916,6 +947,7 @@ func TestResponse_beforeAfterPagination(t *testing.T) { } func TestResponse_populatePageValues_invalid(t *testing.T) { + t.Parallel() r := http.Response{ Header: http.Header{ "Link": {`,` + @@ -955,6 +987,7 @@ func TestResponse_populatePageValues_invalid(t *testing.T) { } func TestResponse_populateSinceValues_invalid(t *testing.T) { + t.Parallel() r := http.Response{ Header: http.Header{ "Link": {`,` + @@ -994,6 +1027,7 @@ func TestResponse_populateSinceValues_invalid(t *testing.T) { } func TestDo(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) type foo struct { @@ -1018,6 +1052,7 @@ func TestDo(t *testing.T) { } func TestDo_nilContext(t *testing.T) { + t.Parallel() client, _, _ := setup(t) req, _ := client.NewRequest("GET", ".", nil) @@ -1029,6 +1064,7 @@ func TestDo_nilContext(t *testing.T) { } func TestDo_httpError(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { @@ -1051,6 +1087,7 @@ func TestDo_httpError(t *testing.T) { // function. A redirect loop is pretty unlikely to occur within the GitHub // API, but does allow us to exercise the right code path. func TestDo_redirectLoop(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { @@ -1072,6 +1109,7 @@ func TestDo_redirectLoop(t *testing.T) { // Test that an error caused by the internal http client's Do() function // does not leak the client secret. func TestDo_sanitizeURL(t *testing.T) { + t.Parallel() tp := &UnauthenticatedRateLimitedTransport{ ClientID: "id", ClientSecret: "secret", @@ -1093,6 +1131,7 @@ func TestDo_sanitizeURL(t *testing.T) { } func TestDo_rateLimit(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { @@ -1120,6 +1159,7 @@ func TestDo_rateLimit(t *testing.T) { } func TestDo_rateLimitCategory(t *testing.T) { + t.Parallel() tests := []struct { method string url string @@ -1197,6 +1237,7 @@ func TestDo_rateLimitCategory(t *testing.T) { // ensure rate limit is still parsed, even for error responses func TestDo_rateLimit_errorResponse(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { @@ -1229,6 +1270,7 @@ func TestDo_rateLimit_errorResponse(t *testing.T) { // Ensure *RateLimitError is returned when API rate limit is exceeded. func TestDo_rateLimit_rateLimitError(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { @@ -1268,6 +1310,7 @@ func TestDo_rateLimit_rateLimitError(t *testing.T) { // Ensure a network call is not made when it's known that API rate limit is still exceeded. func TestDo_rateLimit_noNetworkCall(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) reset := time.Now().UTC().Add(time.Minute).Round(time.Second) // Rate reset is a minute from now, with 1 second precision. @@ -1325,6 +1368,7 @@ func TestDo_rateLimit_noNetworkCall(t *testing.T) { // Ignore rate limit headers if the response was served from cache. func TestDo_rateLimit_ignoredFromCache(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) reset := time.Now().UTC().Add(time.Minute).Round(time.Second) // Rate reset is a minute from now, with 1 second precision. @@ -1370,6 +1414,7 @@ func TestDo_rateLimit_ignoredFromCache(t *testing.T) { // Ensure sleeps until the rate limit is reset when the client is rate limited. func TestDo_rateLimit_sleepUntilResponseResetLimit(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) reset := time.Now().UTC().Add(time.Second) @@ -1410,6 +1455,7 @@ func TestDo_rateLimit_sleepUntilResponseResetLimit(t *testing.T) { // Ensure tries to sleep until the rate limit is reset when the client is rate limited, but only once. func TestDo_rateLimit_sleepUntilResponseResetLimitRetryOnce(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) reset := time.Now().UTC().Add(time.Second) @@ -1441,6 +1487,7 @@ func TestDo_rateLimit_sleepUntilResponseResetLimitRetryOnce(t *testing.T) { // Ensure a network call is not made when it's known that API rate limit is still exceeded. func TestDo_rateLimit_sleepUntilClientResetLimit(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) reset := time.Now().UTC().Add(time.Second) @@ -1471,6 +1518,7 @@ func TestDo_rateLimit_sleepUntilClientResetLimit(t *testing.T) { // Ensure sleep is aborted when the context is cancelled. func TestDo_rateLimit_abortSleepContextCancelled(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) // We use a 1 minute reset time to ensure the sleep is not completed. @@ -1503,6 +1551,7 @@ func TestDo_rateLimit_abortSleepContextCancelled(t *testing.T) { // Ensure sleep is aborted when the context is cancelled on initial request. func TestDo_rateLimit_abortSleepContextCancelledClientLimit(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) reset := time.Now().UTC().Add(time.Minute) @@ -1536,6 +1585,7 @@ func TestDo_rateLimit_abortSleepContextCancelledClientLimit(t *testing.T) { // Ensure *AbuseRateLimitError is returned when the response indicates that // the client has triggered an abuse detection mechanism. func TestDo_rateLimit_abuseRateLimitError(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { @@ -1568,6 +1618,7 @@ func TestDo_rateLimit_abuseRateLimitError(t *testing.T) { // Ensure *AbuseRateLimitError is returned when the response indicates that // the client has triggered an abuse detection mechanism on GitHub Enterprise. func TestDo_rateLimit_abuseRateLimitErrorEnterprise(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { @@ -1601,6 +1652,7 @@ func TestDo_rateLimit_abuseRateLimitErrorEnterprise(t *testing.T) { // Ensure *AbuseRateLimitError.RetryAfter is parsed correctly for the Retry-After header. func TestDo_rateLimit_abuseRateLimitError_retryAfter(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { @@ -1653,6 +1705,7 @@ func TestDo_rateLimit_abuseRateLimitError_retryAfter(t *testing.T) { // Ensure *AbuseRateLimitError.RetryAfter is parsed correctly for the x-ratelimit-reset header. func TestDo_rateLimit_abuseRateLimitError_xRateLimitReset(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) // x-ratelimit-reset value of 123 seconds into the future. @@ -1709,6 +1762,7 @@ func TestDo_rateLimit_abuseRateLimitError_xRateLimitReset(t *testing.T) { } func TestDo_noContent(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { @@ -1726,6 +1780,7 @@ func TestDo_noContent(t *testing.T) { } func TestSanitizeURL(t *testing.T) { + t.Parallel() tests := []struct { in, want string }{ @@ -1745,6 +1800,7 @@ func TestSanitizeURL(t *testing.T) { } func TestCheckResponse(t *testing.T) { + t.Parallel() res := &http.Response{ Request: &http.Request{}, StatusCode: http.StatusBadRequest, @@ -1773,6 +1829,7 @@ func TestCheckResponse(t *testing.T) { } func TestCheckResponse_RateLimit(t *testing.T) { + t.Parallel() res := &http.Response{ Request: &http.Request{}, StatusCode: http.StatusForbidden, @@ -1801,6 +1858,7 @@ func TestCheckResponse_RateLimit(t *testing.T) { } func TestCheckResponse_AbuseRateLimit(t *testing.T) { + t.Parallel() res := &http.Response{ Request: &http.Request{}, StatusCode: http.StatusForbidden, @@ -1823,6 +1881,7 @@ func TestCheckResponse_AbuseRateLimit(t *testing.T) { } func TestCompareHttpResponse(t *testing.T) { + t.Parallel() testcases := map[string]struct { h1 *http.Response h2 *http.Response @@ -1848,7 +1907,9 @@ func TestCompareHttpResponse(t *testing.T) { } for name, tc := range testcases { + tc := tc t.Run(name, func(t *testing.T) { + t.Parallel() v := compareHTTPResponse(tc.h1, tc.h2) if tc.expected != v { t.Errorf("Expected %t, got %t for (%#v, %#v)", tc.expected, v, tc.h1, tc.h2) @@ -1858,6 +1919,7 @@ func TestCompareHttpResponse(t *testing.T) { } func TestErrorResponse_Is(t *testing.T) { + t.Parallel() err := &ErrorResponse{ Response: &http.Response{}, Message: "m", @@ -2004,7 +2066,9 @@ func TestErrorResponse_Is(t *testing.T) { } for name, tc := range testcases { + tc := tc t.Run(name, func(t *testing.T) { + t.Parallel() if tc.wantSame != err.Is(tc.otherError) { t.Errorf("Error = %#v, want %#v", err, tc.otherError) } @@ -2013,6 +2077,7 @@ func TestErrorResponse_Is(t *testing.T) { } func TestRateLimitError_Is(t *testing.T) { + t.Parallel() err := &RateLimitError{ Response: &http.Response{}, Message: "Github", @@ -2071,7 +2136,9 @@ func TestRateLimitError_Is(t *testing.T) { } for name, tc := range testcases { + tc := tc t.Run(name, func(t *testing.T) { + t.Parallel() if tc.wantSame != tc.err.Is(tc.otherError) { t.Errorf("Error = %#v, want %#v", tc.err, tc.otherError) } @@ -2080,6 +2147,7 @@ func TestRateLimitError_Is(t *testing.T) { } func TestAbuseRateLimitError_Is(t *testing.T) { + t.Parallel() t1 := 1 * time.Second t2 := 2 * time.Second err := &AbuseRateLimitError{ @@ -2155,7 +2223,9 @@ func TestAbuseRateLimitError_Is(t *testing.T) { } for name, tc := range testcases { + tc := tc t.Run(name, func(t *testing.T) { + t.Parallel() if tc.wantSame != tc.err.Is(tc.otherError) { t.Errorf("Error = %#v, want %#v", tc.err, tc.otherError) } @@ -2164,6 +2234,7 @@ func TestAbuseRateLimitError_Is(t *testing.T) { } func TestAcceptedError_Is(t *testing.T) { + t.Parallel() err := &AcceptedError{Raw: []byte("Github")} testcases := map[string]struct { wantSame bool @@ -2184,7 +2255,9 @@ func TestAcceptedError_Is(t *testing.T) { } for name, tc := range testcases { + tc := tc t.Run(name, func(t *testing.T) { + t.Parallel() if tc.wantSame != err.Is(tc.otherError) { t.Errorf("Error = %#v, want %#v", err, tc.otherError) } @@ -2194,6 +2267,7 @@ func TestAcceptedError_Is(t *testing.T) { // ensure that we properly handle API errors that do not contain a response body func TestCheckResponse_noBody(t *testing.T) { + t.Parallel() res := &http.Response{ Request: &http.Request{}, StatusCode: http.StatusBadRequest, @@ -2214,6 +2288,7 @@ func TestCheckResponse_noBody(t *testing.T) { } func TestCheckResponse_unexpectedErrorStructure(t *testing.T) { + t.Parallel() httpBody := `{"message":"m", "errors": ["error 1"]}` res := &http.Response{ Request: &http.Request{}, @@ -2244,6 +2319,7 @@ func TestCheckResponse_unexpectedErrorStructure(t *testing.T) { } func TestParseBooleanResponse_true(t *testing.T) { + t.Parallel() result, err := parseBoolResponse(nil) if err != nil { t.Errorf("parseBoolResponse returned error: %+v", err) @@ -2255,6 +2331,7 @@ func TestParseBooleanResponse_true(t *testing.T) { } func TestParseBooleanResponse_false(t *testing.T) { + t.Parallel() v := &ErrorResponse{Response: &http.Response{StatusCode: http.StatusNotFound}} result, err := parseBoolResponse(v) if err != nil { @@ -2267,6 +2344,7 @@ func TestParseBooleanResponse_false(t *testing.T) { } func TestParseBooleanResponse_error(t *testing.T) { + t.Parallel() v := &ErrorResponse{Response: &http.Response{StatusCode: http.StatusBadRequest}} result, err := parseBoolResponse(v) @@ -2280,6 +2358,7 @@ func TestParseBooleanResponse_error(t *testing.T) { } func TestErrorResponse_Error(t *testing.T) { + t.Parallel() res := &http.Response{Request: &http.Request{}} err := ErrorResponse{Message: "m", Response: res} if err.Error() == "" { @@ -2301,6 +2380,7 @@ func TestErrorResponse_Error(t *testing.T) { } func TestError_Error(t *testing.T) { + t.Parallel() err := Error{} if err.Error() == "" { t.Errorf("Expected non-empty Error.Error()") @@ -2308,6 +2388,7 @@ func TestError_Error(t *testing.T) { } func TestSetCredentialsAsHeaders(t *testing.T) { + t.Parallel() req := new(http.Request) id, secret := "id", "secret" modifiedRequest := setCredentialsAsHeaders(req, id, secret) @@ -2327,6 +2408,7 @@ func TestSetCredentialsAsHeaders(t *testing.T) { } func TestUnauthenticatedRateLimitedTransport(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) clientID, clientSecret := "id", "secret" @@ -2356,6 +2438,7 @@ func TestUnauthenticatedRateLimitedTransport(t *testing.T) { } func TestUnauthenticatedRateLimitedTransport_missingFields(t *testing.T) { + t.Parallel() // missing ClientID tp := &UnauthenticatedRateLimitedTransport{ ClientSecret: "secret", @@ -2376,6 +2459,7 @@ func TestUnauthenticatedRateLimitedTransport_missingFields(t *testing.T) { } func TestUnauthenticatedRateLimitedTransport_transport(t *testing.T) { + t.Parallel() // default transport tp := &UnauthenticatedRateLimitedTransport{ ClientID: "id", @@ -2397,6 +2481,7 @@ func TestUnauthenticatedRateLimitedTransport_transport(t *testing.T) { } func TestBasicAuthTransport(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) username, password, otp := "u", "p", "123456" @@ -2431,6 +2516,7 @@ func TestBasicAuthTransport(t *testing.T) { } func TestBasicAuthTransport_transport(t *testing.T) { + t.Parallel() // default transport tp := &BasicAuthTransport{} if tp.transport() != http.DefaultTransport { @@ -2447,6 +2533,7 @@ func TestBasicAuthTransport_transport(t *testing.T) { } func TestFormatRateReset(t *testing.T) { + t.Parallel() d := 120*time.Minute + 12*time.Second got := formatRateReset(d) want := "[rate reset in 120m12s]" @@ -2484,6 +2571,7 @@ func TestFormatRateReset(t *testing.T) { } func TestNestedStructAccessorNoPanic(t *testing.T) { + t.Parallel() issue := &Issue{User: nil} got := issue.GetUser().GetPlan().GetName() want := "" @@ -2493,6 +2581,7 @@ func TestNestedStructAccessorNoPanic(t *testing.T) { } func TestTwoFactorAuthError(t *testing.T) { + t.Parallel() u, err := url.Parse("https://example.com") if err != nil { t.Fatal(err) @@ -2511,6 +2600,7 @@ func TestTwoFactorAuthError(t *testing.T) { } func TestRateLimitError(t *testing.T) { + t.Parallel() u, err := url.Parse("https://example.com") if err != nil { t.Fatal(err) @@ -2529,6 +2619,7 @@ func TestRateLimitError(t *testing.T) { } func TestAcceptedError(t *testing.T) { + t.Parallel() a := &AcceptedError{} if got, want := a.Error(), "try again later"; !strings.Contains(got, want) { t.Errorf("AcceptedError = %q, want %q", got, want) @@ -2536,6 +2627,7 @@ func TestAcceptedError(t *testing.T) { } func TestAbuseRateLimitError(t *testing.T) { + t.Parallel() u, err := url.Parse("https://example.com") if err != nil { t.Fatal(err) @@ -2554,12 +2646,14 @@ func TestAbuseRateLimitError(t *testing.T) { } func TestAddOptions_QueryValues(t *testing.T) { + t.Parallel() if _, err := addOptions("yo", ""); err == nil { t.Error("addOptions err = nil, want error") } } func TestBareDo_returnsOpenBody(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) expectedBody := "Hello from the other side !" @@ -2593,6 +2687,7 @@ func TestBareDo_returnsOpenBody(t *testing.T) { } func TestErrorResponse_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ErrorResponse{}, "{}") u := &ErrorResponse{ @@ -2633,6 +2728,7 @@ func TestErrorResponse_Marshal(t *testing.T) { } func TestErrorBlock_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ErrorBlock{}, "{}") u := &ErrorBlock{ @@ -2649,6 +2745,7 @@ func TestErrorBlock_Marshal(t *testing.T) { } func TestRateLimitError_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &RateLimitError{}, "{}") u := &RateLimitError{ @@ -2673,6 +2770,7 @@ func TestRateLimitError_Marshal(t *testing.T) { } func TestAbuseRateLimitError_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &AbuseRateLimitError{}, "{}") u := &AbuseRateLimitError{ @@ -2687,6 +2785,7 @@ func TestAbuseRateLimitError_Marshal(t *testing.T) { } func TestError_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Error{}, "{}") u := &Error{ @@ -2707,6 +2806,7 @@ func TestError_Marshal(t *testing.T) { } func TestParseTokenExpiration(t *testing.T) { + t.Parallel() tests := []struct { header string want Timestamp @@ -2750,6 +2850,7 @@ func TestParseTokenExpiration(t *testing.T) { } func TestClientCopy_leak_transport(t *testing.T) { + t.Parallel() srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json") accessToken := r.Header.Get("Authorization") diff --git a/github/gitignore_test.go b/github/gitignore_test.go index 300c06d3582..25e6f4ea9eb 100644 --- a/github/gitignore_test.go +++ b/github/gitignore_test.go @@ -15,6 +15,7 @@ import ( ) func TestGitignoresService_List(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/gitignore/templates", func(w http.ResponseWriter, r *http.Request) { @@ -44,6 +45,7 @@ func TestGitignoresService_List(t *testing.T) { } func TestGitignoresService_Get(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/gitignore/templates/name", func(w http.ResponseWriter, r *http.Request) { @@ -78,6 +80,7 @@ func TestGitignoresService_Get(t *testing.T) { } func TestGitignoresService_Get_invalidTemplate(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -86,6 +89,7 @@ func TestGitignoresService_Get_invalidTemplate(t *testing.T) { } func TestGitignore_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Gitignore{}, "{}") u := &Gitignore{ diff --git a/github/interactions_orgs_test.go b/github/interactions_orgs_test.go index 264d9635e64..b0521dee6cc 100644 --- a/github/interactions_orgs_test.go +++ b/github/interactions_orgs_test.go @@ -16,6 +16,7 @@ import ( ) func TestInteractionsService_GetRestrictionsForOrgs(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/interaction-limits", func(w http.ResponseWriter, r *http.Request) { @@ -51,6 +52,7 @@ func TestInteractionsService_GetRestrictionsForOrgs(t *testing.T) { } func TestInteractionsService_UpdateRestrictionsForOrg(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &InteractionRestriction{Limit: String("existing_users")} @@ -94,6 +96,7 @@ func TestInteractionsService_UpdateRestrictionsForOrg(t *testing.T) { } func TestInteractionsService_RemoveRestrictionsFromOrg(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/interaction-limits", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/interactions_repos_test.go b/github/interactions_repos_test.go index 432790f4203..51093e57bcb 100644 --- a/github/interactions_repos_test.go +++ b/github/interactions_repos_test.go @@ -16,6 +16,7 @@ import ( ) func TestInteractionsService_GetRestrictionsForRepo(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/interaction-limits", func(w http.ResponseWriter, r *http.Request) { @@ -51,6 +52,7 @@ func TestInteractionsService_GetRestrictionsForRepo(t *testing.T) { } func TestInteractionsService_UpdateRestrictionsForRepo(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &InteractionRestriction{Limit: String("existing_users")} @@ -94,6 +96,7 @@ func TestInteractionsService_UpdateRestrictionsForRepo(t *testing.T) { } func TestInteractionsService_RemoveRestrictionsFromRepo(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/interaction-limits", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/interactions_test.go b/github/interactions_test.go index 47ebae18c48..ac2d0e31649 100644 --- a/github/interactions_test.go +++ b/github/interactions_test.go @@ -8,6 +8,7 @@ package github import "testing" func TestInteractionRestriction_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &InteractionRestriction{}, "{}") u := &InteractionRestriction{ diff --git a/github/issue_import_test.go b/github/issue_import_test.go index 97960994034..cf925ac2b1c 100644 --- a/github/issue_import_test.go +++ b/github/issue_import_test.go @@ -17,6 +17,7 @@ import ( ) func TestIssueImportService_Create(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) createdAt := time.Date(2020, time.August, 11, 15, 30, 0, 0, time.UTC) @@ -74,6 +75,7 @@ func TestIssueImportService_Create(t *testing.T) { } func TestIssueImportService_Create_deferred(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) createdAt := time.Date(2020, time.August, 11, 15, 30, 0, 0, time.UTC) @@ -119,6 +121,7 @@ func TestIssueImportService_Create_deferred(t *testing.T) { } func TestIssueImportService_Create_badResponse(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) createdAt := time.Date(2020, time.August, 11, 15, 30, 0, 0, time.UTC) @@ -159,6 +162,7 @@ func TestIssueImportService_Create_badResponse(t *testing.T) { } func TestIssueImportService_Create_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -167,6 +171,7 @@ func TestIssueImportService_Create_invalidOwner(t *testing.T) { } func TestIssueImportService_CheckStatus(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/import/issues/3", func(w http.ResponseWriter, r *http.Request) { @@ -203,6 +208,7 @@ func TestIssueImportService_CheckStatus(t *testing.T) { } func TestIssueImportService_CheckStatus_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -211,6 +217,7 @@ func TestIssueImportService_CheckStatus_invalidOwner(t *testing.T) { } func TestIssueImportService_CheckStatusSince(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/import/issues", func(w http.ResponseWriter, r *http.Request) { @@ -247,6 +254,7 @@ func TestIssueImportService_CheckStatusSince(t *testing.T) { } func TestIssueImportService_CheckStatusSince_badResponse(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/import/issues", func(w http.ResponseWriter, r *http.Request) { @@ -263,6 +271,7 @@ func TestIssueImportService_CheckStatusSince_badResponse(t *testing.T) { } func TestIssueImportService_CheckStatusSince_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -287,6 +296,7 @@ var wantIssueImportResponse = &IssueImportResponse{ } func TestIssueImportError_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &IssueImportError{}, "{}") u := &IssueImportError{ @@ -309,6 +319,7 @@ func TestIssueImportError_Marshal(t *testing.T) { } func TestIssueImportResponse_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &IssueImportResponse{}, "{}") u := &IssueImportResponse{ @@ -357,6 +368,7 @@ func TestIssueImportResponse_Marshal(t *testing.T) { } func TestComment_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Comment{}, "{}") u := &Comment{ @@ -373,6 +385,7 @@ func TestComment_Marshal(t *testing.T) { } func TestIssueImport_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &IssueImport{}, "{}") u := &IssueImport{ @@ -405,6 +418,7 @@ func TestIssueImport_Marshal(t *testing.T) { } func TestIssueImportRequest_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &IssueImportRequest{}, "{}") u := &IssueImportRequest{ diff --git a/github/issues_assignees_test.go b/github/issues_assignees_test.go index 3da9d5ff1bd..183624eabc6 100644 --- a/github/issues_assignees_test.go +++ b/github/issues_assignees_test.go @@ -16,6 +16,7 @@ import ( ) func TestIssuesService_ListAssignees(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/assignees", func(w http.ResponseWriter, r *http.Request) { @@ -52,6 +53,7 @@ func TestIssuesService_ListAssignees(t *testing.T) { } func TestIssuesService_ListAssignees_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -60,6 +62,7 @@ func TestIssuesService_ListAssignees_invalidOwner(t *testing.T) { } func TestIssuesService_IsAssignee_true(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/assignees/u", func(w http.ResponseWriter, r *http.Request) { @@ -91,6 +94,7 @@ func TestIssuesService_IsAssignee_true(t *testing.T) { } func TestIssuesService_IsAssignee_false(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/assignees/u", func(w http.ResponseWriter, r *http.Request) { @@ -123,6 +127,7 @@ func TestIssuesService_IsAssignee_false(t *testing.T) { } func TestIssuesService_IsAssignee_error(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/assignees/u", func(w http.ResponseWriter, r *http.Request) { @@ -155,6 +160,7 @@ func TestIssuesService_IsAssignee_error(t *testing.T) { } func TestIssuesService_IsAssignee_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -163,6 +169,7 @@ func TestIssuesService_IsAssignee_invalidOwner(t *testing.T) { } func TestIssuesService_AddAssignees(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/1/assignees", func(w http.ResponseWriter, r *http.Request) { @@ -206,6 +213,7 @@ func TestIssuesService_AddAssignees(t *testing.T) { } func TestIssuesService_RemoveAssignees(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/1/assignees", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/issues_comments_test.go b/github/issues_comments_test.go index 81c575c4db9..03fe4c37e71 100644 --- a/github/issues_comments_test.go +++ b/github/issues_comments_test.go @@ -17,6 +17,7 @@ import ( ) func TestIssuesService_ListComments_allIssues(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/comments", func(w http.ResponseWriter, r *http.Request) { @@ -65,6 +66,7 @@ func TestIssuesService_ListComments_allIssues(t *testing.T) { } func TestIssuesService_ListComments_specificIssue(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/1/comments", func(w http.ResponseWriter, r *http.Request) { @@ -100,6 +102,7 @@ func TestIssuesService_ListComments_specificIssue(t *testing.T) { } func TestIssuesService_ListComments_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -108,6 +111,7 @@ func TestIssuesService_ListComments_invalidOwner(t *testing.T) { } func TestIssuesService_GetComment(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/comments/1", func(w http.ResponseWriter, r *http.Request) { @@ -143,6 +147,7 @@ func TestIssuesService_GetComment(t *testing.T) { } func TestIssuesService_GetComment_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -151,6 +156,7 @@ func TestIssuesService_GetComment_invalidOrg(t *testing.T) { } func TestIssuesService_CreateComment(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &IssueComment{Body: String("b")} @@ -194,6 +200,7 @@ func TestIssuesService_CreateComment(t *testing.T) { } func TestIssuesService_CreateComment_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -202,6 +209,7 @@ func TestIssuesService_CreateComment_invalidOrg(t *testing.T) { } func TestIssuesService_EditComment(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &IssueComment{Body: String("b")} @@ -245,6 +253,7 @@ func TestIssuesService_EditComment(t *testing.T) { } func TestIssuesService_EditComment_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -253,6 +262,7 @@ func TestIssuesService_EditComment_invalidOwner(t *testing.T) { } func TestIssuesService_DeleteComment(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/comments/1", func(w http.ResponseWriter, r *http.Request) { @@ -277,6 +287,7 @@ func TestIssuesService_DeleteComment(t *testing.T) { } func TestIssuesService_DeleteComment_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -285,6 +296,7 @@ func TestIssuesService_DeleteComment_invalidOwner(t *testing.T) { } func TestIssueComment_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &IssueComment{}, "{}") u := &IssueComment{ diff --git a/github/issues_events_test.go b/github/issues_events_test.go index e67de51c176..89152d70faa 100644 --- a/github/issues_events_test.go +++ b/github/issues_events_test.go @@ -15,6 +15,7 @@ import ( ) func TestIssuesService_ListIssueEvents(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/1/events", func(w http.ResponseWriter, r *http.Request) { @@ -55,6 +56,7 @@ func TestIssuesService_ListIssueEvents(t *testing.T) { } func TestIssuesService_ListRepositoryEvents(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/events", func(w http.ResponseWriter, r *http.Request) { @@ -94,6 +96,7 @@ func TestIssuesService_ListRepositoryEvents(t *testing.T) { } func TestIssuesService_GetEvent(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/events/1", func(w http.ResponseWriter, r *http.Request) { @@ -128,6 +131,7 @@ func TestIssuesService_GetEvent(t *testing.T) { } func TestRename_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Rename{}, "{}") u := &Rename{ @@ -144,6 +148,7 @@ func TestRename_Marshal(t *testing.T) { } func TestDismissedReview_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &DismissedReview{}, "{}") u := &DismissedReview{ @@ -164,6 +169,7 @@ func TestDismissedReview_Marshal(t *testing.T) { } func TestIssueEvent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &IssueEvent{}, "{}") u := &IssueEvent{ diff --git a/github/issues_labels_test.go b/github/issues_labels_test.go index 48f3e519b50..81b483e2a92 100644 --- a/github/issues_labels_test.go +++ b/github/issues_labels_test.go @@ -16,6 +16,7 @@ import ( ) func TestIssuesService_ListLabels(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/labels", func(w http.ResponseWriter, r *http.Request) { @@ -52,6 +53,7 @@ func TestIssuesService_ListLabels(t *testing.T) { } func TestIssuesService_ListLabels_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -60,6 +62,7 @@ func TestIssuesService_ListLabels_invalidOwner(t *testing.T) { } func TestIssuesService_GetLabel(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/labels/n", func(w http.ResponseWriter, r *http.Request) { @@ -94,6 +97,7 @@ func TestIssuesService_GetLabel(t *testing.T) { } func TestIssuesService_GetLabel_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -102,6 +106,7 @@ func TestIssuesService_GetLabel_invalidOwner(t *testing.T) { } func TestIssuesService_CreateLabel(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &Label{Name: String("n")} @@ -145,6 +150,7 @@ func TestIssuesService_CreateLabel(t *testing.T) { } func TestIssuesService_CreateLabel_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -153,6 +159,7 @@ func TestIssuesService_CreateLabel_invalidOwner(t *testing.T) { } func TestIssuesService_EditLabel(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &Label{Name: String("z")} @@ -196,6 +203,7 @@ func TestIssuesService_EditLabel(t *testing.T) { } func TestIssuesService_EditLabel_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -204,6 +212,7 @@ func TestIssuesService_EditLabel_invalidOwner(t *testing.T) { } func TestIssuesService_DeleteLabel(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/labels/n", func(w http.ResponseWriter, r *http.Request) { @@ -228,6 +237,7 @@ func TestIssuesService_DeleteLabel(t *testing.T) { } func TestIssuesService_DeleteLabel_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -236,6 +246,7 @@ func TestIssuesService_DeleteLabel_invalidOwner(t *testing.T) { } func TestIssuesService_ListLabelsByIssue(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/1/labels", func(w http.ResponseWriter, r *http.Request) { @@ -275,6 +286,7 @@ func TestIssuesService_ListLabelsByIssue(t *testing.T) { } func TestIssuesService_ListLabelsByIssue_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -283,6 +295,7 @@ func TestIssuesService_ListLabelsByIssue_invalidOwner(t *testing.T) { } func TestIssuesService_AddLabelsToIssue(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := []string{"a", "b"} @@ -326,6 +339,7 @@ func TestIssuesService_AddLabelsToIssue(t *testing.T) { } func TestIssuesService_AddLabelsToIssue_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -334,6 +348,7 @@ func TestIssuesService_AddLabelsToIssue_invalidOwner(t *testing.T) { } func TestIssuesService_RemoveLabelForIssue(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/1/labels/l", func(w http.ResponseWriter, r *http.Request) { @@ -358,6 +373,7 @@ func TestIssuesService_RemoveLabelForIssue(t *testing.T) { } func TestIssuesService_RemoveLabelForIssue_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -366,6 +382,7 @@ func TestIssuesService_RemoveLabelForIssue_invalidOwner(t *testing.T) { } func TestIssuesService_ReplaceLabelsForIssue(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := []string{"a", "b"} @@ -409,6 +426,7 @@ func TestIssuesService_ReplaceLabelsForIssue(t *testing.T) { } func TestIssuesService_ReplaceLabelsForIssue_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -417,6 +435,7 @@ func TestIssuesService_ReplaceLabelsForIssue_invalidOwner(t *testing.T) { } func TestIssuesService_RemoveLabelsForIssue(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/1/labels", func(w http.ResponseWriter, r *http.Request) { @@ -441,6 +460,7 @@ func TestIssuesService_RemoveLabelsForIssue(t *testing.T) { } func TestIssuesService_RemoveLabelsForIssue_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -449,6 +469,7 @@ func TestIssuesService_RemoveLabelsForIssue_invalidOwner(t *testing.T) { } func TestIssuesService_ListLabelsForMilestone(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/milestones/1/labels", func(w http.ResponseWriter, r *http.Request) { @@ -485,6 +506,7 @@ func TestIssuesService_ListLabelsForMilestone(t *testing.T) { } func TestIssuesService_ListLabelsForMilestone_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -493,6 +515,7 @@ func TestIssuesService_ListLabelsForMilestone_invalidOwner(t *testing.T) { } func TestLabel_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Label{}, "{}") u := &Label{ diff --git a/github/issues_milestones_test.go b/github/issues_milestones_test.go index ca4ea9f8c76..4444dd63fa2 100644 --- a/github/issues_milestones_test.go +++ b/github/issues_milestones_test.go @@ -16,6 +16,7 @@ import ( ) func TestIssuesService_ListMilestones(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/milestones", func(w http.ResponseWriter, r *http.Request) { @@ -57,6 +58,7 @@ func TestIssuesService_ListMilestones(t *testing.T) { } func TestIssuesService_ListMilestones_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -65,6 +67,7 @@ func TestIssuesService_ListMilestones_invalidOwner(t *testing.T) { } func TestIssuesService_GetMilestone(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/milestones/1", func(w http.ResponseWriter, r *http.Request) { @@ -99,6 +102,7 @@ func TestIssuesService_GetMilestone(t *testing.T) { } func TestIssuesService_GetMilestone_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -107,6 +111,7 @@ func TestIssuesService_GetMilestone_invalidOwner(t *testing.T) { } func TestIssuesService_CreateMilestone(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &Milestone{Title: String("t")} @@ -150,6 +155,7 @@ func TestIssuesService_CreateMilestone(t *testing.T) { } func TestIssuesService_CreateMilestone_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -158,6 +164,7 @@ func TestIssuesService_CreateMilestone_invalidOwner(t *testing.T) { } func TestIssuesService_EditMilestone(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &Milestone{Title: String("t")} @@ -201,6 +208,7 @@ func TestIssuesService_EditMilestone(t *testing.T) { } func TestIssuesService_EditMilestone_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -209,6 +217,7 @@ func TestIssuesService_EditMilestone_invalidOwner(t *testing.T) { } func TestIssuesService_DeleteMilestone(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/milestones/1", func(w http.ResponseWriter, r *http.Request) { @@ -233,6 +242,7 @@ func TestIssuesService_DeleteMilestone(t *testing.T) { } func TestIssuesService_DeleteMilestone_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -241,6 +251,7 @@ func TestIssuesService_DeleteMilestone_invalidOwner(t *testing.T) { } func TestMilestone_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Milestone{}, "{}") u := &Milestone{ diff --git a/github/issues_test.go b/github/issues_test.go index 722d4e31a08..a554b34ed28 100644 --- a/github/issues_test.go +++ b/github/issues_test.go @@ -17,6 +17,7 @@ import ( ) func TestIssuesService_List_all(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/issues", func(w http.ResponseWriter, r *http.Request) { @@ -62,6 +63,7 @@ func TestIssuesService_List_all(t *testing.T) { } func TestIssuesService_List_owned(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/issues", func(w http.ResponseWriter, r *http.Request) { @@ -83,6 +85,7 @@ func TestIssuesService_List_owned(t *testing.T) { } func TestIssuesService_ListByOrg(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/issues", func(w http.ResponseWriter, r *http.Request) { @@ -118,6 +121,7 @@ func TestIssuesService_ListByOrg(t *testing.T) { } func TestIssuesService_ListByOrg_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -126,6 +130,7 @@ func TestIssuesService_ListByOrg_invalidOrg(t *testing.T) { } func TestIssuesService_ListByOrg_badOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -134,6 +139,7 @@ func TestIssuesService_ListByOrg_badOrg(t *testing.T) { } func TestIssuesService_ListByRepo(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues", func(w http.ResponseWriter, r *http.Request) { @@ -185,6 +191,7 @@ func TestIssuesService_ListByRepo(t *testing.T) { } func TestIssuesService_ListByRepo_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -193,6 +200,7 @@ func TestIssuesService_ListByRepo_invalidOwner(t *testing.T) { } func TestIssuesService_Get(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/1", func(w http.ResponseWriter, r *http.Request) { @@ -236,6 +244,7 @@ func TestIssuesService_Get(t *testing.T) { } func TestIssuesService_Get_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -244,6 +253,7 @@ func TestIssuesService_Get_invalidOwner(t *testing.T) { } func TestIssuesService_Create(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &IssueRequest{ @@ -292,6 +302,7 @@ func TestIssuesService_Create(t *testing.T) { } func TestIssuesService_Create_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -300,6 +311,7 @@ func TestIssuesService_Create_invalidOwner(t *testing.T) { } func TestIssuesService_Edit(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &IssueRequest{Title: String("t")} @@ -343,6 +355,7 @@ func TestIssuesService_Edit(t *testing.T) { } func TestIssuesService_RemoveMilestone(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/1", func(w http.ResponseWriter, r *http.Request) { @@ -377,6 +390,7 @@ func TestIssuesService_RemoveMilestone(t *testing.T) { } func TestIssuesService_Edit_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -385,6 +399,7 @@ func TestIssuesService_Edit_invalidOwner(t *testing.T) { } func TestIssuesService_Lock(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/1/lock", func(w http.ResponseWriter, r *http.Request) { @@ -410,6 +425,7 @@ func TestIssuesService_Lock(t *testing.T) { } func TestIssuesService_LockWithReason(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/1/lock", func(w http.ResponseWriter, r *http.Request) { @@ -426,6 +442,7 @@ func TestIssuesService_LockWithReason(t *testing.T) { } func TestIssuesService_Unlock(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/1/lock", func(w http.ResponseWriter, r *http.Request) { @@ -451,6 +468,7 @@ func TestIssuesService_Unlock(t *testing.T) { } func TestIsPullRequest(t *testing.T) { + t.Parallel() i := new(Issue) if i.IsPullRequest() == true { t.Errorf("expected i.IsPullRequest (%v) to return false, got true", i) @@ -462,6 +480,7 @@ func TestIsPullRequest(t *testing.T) { } func TestLockIssueOptions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &LockIssueOptions{}, "{}") u := &LockIssueOptions{ @@ -476,6 +495,7 @@ func TestLockIssueOptions_Marshal(t *testing.T) { } func TestPullRequestLinks_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PullRequestLinks{}, "{}") u := &PullRequestLinks{ @@ -498,6 +518,7 @@ func TestPullRequestLinks_Marshal(t *testing.T) { } func TestIssueRequest_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &IssueRequest{}, "{}") u := &IssueRequest{ @@ -528,6 +549,7 @@ func TestIssueRequest_Marshal(t *testing.T) { } func TestIssue_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Issue{}, "{}") u := &Issue{ diff --git a/github/issues_timeline_test.go b/github/issues_timeline_test.go index 5a2b78622c5..d89043f589a 100644 --- a/github/issues_timeline_test.go +++ b/github/issues_timeline_test.go @@ -16,6 +16,7 @@ import ( ) func TestIssuesService_ListIssueTimeline(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) wantAcceptHeaders := []string{mediaTypeTimelinePreview, mediaTypeProjectCardDetailsPreview} @@ -57,6 +58,7 @@ func TestIssuesService_ListIssueTimeline(t *testing.T) { } func TestSource_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Source{}, "{}") u := &Source{ @@ -97,6 +99,7 @@ func TestSource_Marshal(t *testing.T) { } func TestTimeline_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Timeline{}, "{}") u := &Timeline{ diff --git a/github/licenses_test.go b/github/licenses_test.go index 30b03669789..1a9b1f2e882 100644 --- a/github/licenses_test.go +++ b/github/licenses_test.go @@ -15,6 +15,7 @@ import ( ) func TestRepositoryLicense_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &RepositoryLicense{}, "{}") rl := &RepositoryLicense{ @@ -75,6 +76,7 @@ func TestRepositoryLicense_Marshal(t *testing.T) { } func TestLicense_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &License{}, "{}") l := &License{ @@ -109,6 +111,7 @@ func TestLicense_Marshal(t *testing.T) { } func TestLicensesService_List(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/licenses", func(w http.ResponseWriter, r *http.Request) { @@ -144,6 +147,7 @@ func TestLicensesService_List(t *testing.T) { } func TestLicensesService_Get(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/licenses/mit", func(w http.ResponseWriter, r *http.Request) { @@ -178,6 +182,7 @@ func TestLicensesService_Get(t *testing.T) { } func TestLicensesService_Get_invalidTemplate(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() diff --git a/github/markdown_test.go b/github/markdown_test.go index 709a5b61657..3b8d842365f 100644 --- a/github/markdown_test.go +++ b/github/markdown_test.go @@ -16,6 +16,7 @@ import ( ) func TestMarkdownService_Markdown(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &markdownRenderRequest{ @@ -61,6 +62,7 @@ func TestMarkdownService_Markdown(t *testing.T) { } func TestMarkdownRenderRequest_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &markdownRenderRequest{}, "{}") a := &markdownRenderRequest{ diff --git a/github/messages_test.go b/github/messages_test.go index 322505f65c6..a9de4256905 100644 --- a/github/messages_test.go +++ b/github/messages_test.go @@ -19,6 +19,7 @@ import ( ) func TestMessageMAC_BadHashTypePrefix(t *testing.T) { + t.Parallel() const signature = "bogus1=1234567" if _, _, err := messageMAC(signature); err == nil { t.Fatal("messageMAC returned nil; wanted error") @@ -26,6 +27,7 @@ func TestMessageMAC_BadHashTypePrefix(t *testing.T) { } func TestValidatePayload(t *testing.T) { + t.Parallel() const defaultBody = `{"yo":true}` // All tests below use the default request body and signature. const defaultSignature = "sha1=126f2c800419c60137ce748d7672e77b65cf16d6" secretKey := []byte("0123456789abcdef") @@ -99,6 +101,7 @@ func TestValidatePayload(t *testing.T) { } func TestValidatePayload_FormGet(t *testing.T) { + t.Parallel() payload := `{"yo":true}` signature := "sha1=3374ef144403e8035423b23b02e2c9d7a4c50368" secretKey := []byte("0123456789abcdef") @@ -129,6 +132,7 @@ func TestValidatePayload_FormGet(t *testing.T) { } func TestValidatePayload_FormPost(t *testing.T) { + t.Parallel() payload := `{"yo":true}` signature := "sha1=3374ef144403e8035423b23b02e2c9d7a4c50368" secretKey := []byte("0123456789abcdef") @@ -159,6 +163,7 @@ func TestValidatePayload_FormPost(t *testing.T) { } func TestValidatePayload_InvalidContentType(t *testing.T) { + t.Parallel() req, err := http.NewRequest("POST", "http://localhost/event", nil) if err != nil { t.Fatalf("NewRequest: %v", err) @@ -170,6 +175,7 @@ func TestValidatePayload_InvalidContentType(t *testing.T) { } func TestValidatePayload_NoSecretKey(t *testing.T) { + t.Parallel() payload := `{"yo":true}` form := url.Values{} @@ -200,6 +206,7 @@ func (b *badReader) Read(p []byte) (int, error) { func (b *badReader) Close() error { return errors.New("bad reader") } func TestValidatePayload_BadRequestBody(t *testing.T) { + t.Parallel() tests := []struct { contentType string }{ @@ -208,7 +215,9 @@ func TestValidatePayload_BadRequestBody(t *testing.T) { } for i, tt := range tests { + tt := tt t.Run(fmt.Sprintf("test #%v", i), func(t *testing.T) { + t.Parallel() req := &http.Request{ Header: http.Header{"Content-Type": []string{tt.contentType}}, Body: &badReader{}, @@ -221,6 +230,7 @@ func TestValidatePayload_BadRequestBody(t *testing.T) { } func TestValidatePayload_InvalidContentTypeParams(t *testing.T) { + t.Parallel() req, err := http.NewRequest("POST", "http://localhost/event", nil) if err != nil { t.Fatalf("NewRequest: %v", err) @@ -232,6 +242,7 @@ func TestValidatePayload_InvalidContentTypeParams(t *testing.T) { } func TestValidatePayload_ValidContentTypeParams(t *testing.T) { + t.Parallel() var requestBody = `{"yo":true}` buf := bytes.NewBufferString(requestBody) @@ -248,6 +259,7 @@ func TestValidatePayload_ValidContentTypeParams(t *testing.T) { } func TestParseWebHook(t *testing.T) { + t.Parallel() tests := []struct { payload interface{} messageType string @@ -538,6 +550,7 @@ func TestParseWebHook(t *testing.T) { } func TestAllMessageTypesMapped(t *testing.T) { + t.Parallel() for _, mt := range MessageTypes() { if obj := EventForType(mt); obj == nil { t.Errorf("messageMap missing message type %q", mt) @@ -546,6 +559,7 @@ func TestAllMessageTypesMapped(t *testing.T) { } func TestUnknownMessageType(t *testing.T) { + t.Parallel() if obj := EventForType("unknown"); obj != nil { t.Errorf("EventForType(unknown) = %#v, want nil", obj) } @@ -555,24 +569,28 @@ func TestUnknownMessageType(t *testing.T) { } func TestParseWebHook_BadMessageType(t *testing.T) { + t.Parallel() if _, err := ParseWebHook("bogus message type", []byte("{}")); err == nil { t.Fatal("ParseWebHook returned nil; wanted error") } } func TestValidatePayloadFromBody_UnableToParseBody(t *testing.T) { + t.Parallel() if _, err := ValidatePayloadFromBody("application/x-www-form-urlencoded", bytes.NewReader([]byte(`%`)), "sha1=", []byte{}); err == nil { t.Errorf("ValidatePayloadFromBody returned nil; wanted error") } } func TestValidatePayloadFromBody_UnsupportedContentType(t *testing.T) { + t.Parallel() if _, err := ValidatePayloadFromBody("invalid", bytes.NewReader([]byte(`{}`)), "sha1=", []byte{}); err == nil { t.Errorf("ValidatePayloadFromBody returned nil; wanted error") } } func TestDeliveryID(t *testing.T) { + t.Parallel() id := "8970a780-244e-11e7-91ca-da3aabcb9793" req, err := http.NewRequest("POST", "http://localhost", nil) if err != nil { @@ -587,6 +605,7 @@ func TestDeliveryID(t *testing.T) { } func TestWebHookType(t *testing.T) { + t.Parallel() want := "yo" req := &http.Request{ Header: http.Header{EventTypeHeader: []string{want}}, diff --git a/github/meta_test.go b/github/meta_test.go index c529634f5aa..bce606f2cf1 100644 --- a/github/meta_test.go +++ b/github/meta_test.go @@ -15,6 +15,7 @@ import ( ) func TestAPIMeta_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &APIMeta{}, "{}") a := &APIMeta{ @@ -69,6 +70,7 @@ func TestAPIMeta_Marshal(t *testing.T) { } func TestMetaService_Get(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/meta", func(w http.ResponseWriter, r *http.Request) { @@ -128,6 +130,7 @@ func TestMetaService_Get(t *testing.T) { } func TestMetaService_Octocat(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := "input" @@ -161,6 +164,7 @@ func TestMetaService_Octocat(t *testing.T) { } func TestMetaService_Zen(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) output := "sample text" diff --git a/github/migrations_source_import_test.go b/github/migrations_source_import_test.go index f7225c851be..98e68396da1 100644 --- a/github/migrations_source_import_test.go +++ b/github/migrations_source_import_test.go @@ -16,6 +16,7 @@ import ( ) func TestMigrationService_StartImport(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &Import{ @@ -64,6 +65,7 @@ func TestMigrationService_StartImport(t *testing.T) { } func TestMigrationService_ImportProgress(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/import", func(w http.ResponseWriter, r *http.Request) { @@ -97,6 +99,7 @@ func TestMigrationService_ImportProgress(t *testing.T) { } func TestMigrationService_UpdateImport(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &Import{ @@ -145,6 +148,7 @@ func TestMigrationService_UpdateImport(t *testing.T) { } func TestMigrationService_CommitAuthors(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/import/authors", func(w http.ResponseWriter, r *http.Request) { @@ -181,6 +185,7 @@ func TestMigrationService_CommitAuthors(t *testing.T) { } func TestMigrationService_MapCommitAuthor(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &SourceImportAuthor{Name: String("n"), Email: String("e")} @@ -223,6 +228,7 @@ func TestMigrationService_MapCommitAuthor(t *testing.T) { } func TestMigrationService_SetLFSPreference(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &Import{UseLFS: String("opt_in")} @@ -266,6 +272,7 @@ func TestMigrationService_SetLFSPreference(t *testing.T) { } func TestMigrationService_LargeFiles(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/import/large_files", func(w http.ResponseWriter, r *http.Request) { @@ -302,6 +309,7 @@ func TestMigrationService_LargeFiles(t *testing.T) { } func TestMigrationService_CancelImport(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/import", func(w http.ResponseWriter, r *http.Request) { @@ -327,6 +335,7 @@ func TestMigrationService_CancelImport(t *testing.T) { } func TestLargeFile_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &LargeFile{}, "{}") u := &LargeFile{ @@ -347,6 +356,7 @@ func TestLargeFile_Marshal(t *testing.T) { } func TestSourceImportAuthor_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &SourceImportAuthor{}, "{}") u := &SourceImportAuthor{ @@ -373,6 +383,7 @@ func TestSourceImportAuthor_Marshal(t *testing.T) { } func TestImport_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Import{}, "{}") u := &Import{ diff --git a/github/migrations_test.go b/github/migrations_test.go index 254532eeafa..2e4cbdd77f0 100644 --- a/github/migrations_test.go +++ b/github/migrations_test.go @@ -16,6 +16,7 @@ import ( ) func TestMigrationService_StartMigration(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/migrations", func(w http.ResponseWriter, r *http.Request) { @@ -55,6 +56,7 @@ func TestMigrationService_StartMigration(t *testing.T) { } func TestMigrationService_ListMigrations(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/migrations", func(w http.ResponseWriter, r *http.Request) { @@ -90,6 +92,7 @@ func TestMigrationService_ListMigrations(t *testing.T) { } func TestMigrationService_MigrationStatus(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/migrations/1", func(w http.ResponseWriter, r *http.Request) { @@ -125,6 +128,7 @@ func TestMigrationService_MigrationStatus(t *testing.T) { } func TestMigrationService_MigrationArchiveURL(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/migrations/1/archive", func(w http.ResponseWriter, r *http.Request) { @@ -157,6 +161,7 @@ func TestMigrationService_MigrationArchiveURL(t *testing.T) { } func TestMigrationService_DeleteMigration(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/migrations/1/archive", func(w http.ResponseWriter, r *http.Request) { @@ -183,6 +188,7 @@ func TestMigrationService_DeleteMigration(t *testing.T) { } func TestMigrationService_UnlockRepo(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/migrations/1/repos/r/lock", func(w http.ResponseWriter, r *http.Request) { @@ -247,6 +253,7 @@ var wantMigration = &Migration{ } func TestMigration_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Migration{}, "{}") u := &Migration{ @@ -281,6 +288,7 @@ func TestMigration_Marshal(t *testing.T) { } func TestStartMigration_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &startMigration{}, "{}") u := &startMigration{ diff --git a/github/migrations_user_test.go b/github/migrations_user_test.go index 6de854f491e..6253a7b3934 100644 --- a/github/migrations_user_test.go +++ b/github/migrations_user_test.go @@ -16,6 +16,7 @@ import ( ) func TestMigrationService_StartUserMigration(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/migrations", func(w http.ResponseWriter, r *http.Request) { @@ -53,6 +54,7 @@ func TestMigrationService_StartUserMigration(t *testing.T) { } func TestMigrationService_ListUserMigrations(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/migrations", func(w http.ResponseWriter, r *http.Request) { @@ -85,6 +87,7 @@ func TestMigrationService_ListUserMigrations(t *testing.T) { } func TestMigrationService_UserMigrationStatus(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/migrations/1", func(w http.ResponseWriter, r *http.Request) { @@ -117,6 +120,7 @@ func TestMigrationService_UserMigrationStatus(t *testing.T) { } func TestMigrationService_UserMigrationArchiveURL(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/migrations/1/archive", func(w http.ResponseWriter, r *http.Request) { @@ -145,6 +149,7 @@ func TestMigrationService_UserMigrationArchiveURL(t *testing.T) { } func TestMigrationService_DeleteUserMigration(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/migrations/1/archive", func(w http.ResponseWriter, r *http.Request) { @@ -176,6 +181,7 @@ func TestMigrationService_DeleteUserMigration(t *testing.T) { } func TestMigrationService_UnlockUserRepo(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/migrations/1/repos/r/lock", func(w http.ResponseWriter, r *http.Request) { @@ -245,6 +251,7 @@ var wantUserMigration = &UserMigration{ } func TestUserMigration_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &UserMigration{}, "{}") u := &UserMigration{ @@ -279,6 +286,7 @@ func TestUserMigration_Marshal(t *testing.T) { } func TestStartUserMigration_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &startUserMigration{}, "{}") u := &startUserMigration{ diff --git a/github/orgs_actions_allowed_test.go b/github/orgs_actions_allowed_test.go index 49329eb71a5..70cc0ea1fc6 100644 --- a/github/orgs_actions_allowed_test.go +++ b/github/orgs_actions_allowed_test.go @@ -16,6 +16,7 @@ import ( ) func TestOrganizationsService_GetActionsAllowed(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/permissions/selected-actions", func(w http.ResponseWriter, r *http.Request) { @@ -49,6 +50,7 @@ func TestOrganizationsService_GetActionsAllowed(t *testing.T) { } func TestOrganizationsService_EditActionsAllowed(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &ActionsAllowed{GithubOwnedAllowed: Bool(true), VerifiedAllowed: Bool(false), PatternsAllowed: []string{"a/b"}} diff --git a/github/orgs_actions_permissions_test.go b/github/orgs_actions_permissions_test.go index 07df41a2e4b..0f773435690 100644 --- a/github/orgs_actions_permissions_test.go +++ b/github/orgs_actions_permissions_test.go @@ -16,6 +16,7 @@ import ( ) func TestOrganizationsService_GetActionsPermissions(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/actions/permissions", func(w http.ResponseWriter, r *http.Request) { @@ -49,6 +50,7 @@ func TestOrganizationsService_GetActionsPermissions(t *testing.T) { } func TestOrganizationsService_EditActionsPermissions(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &ActionsPermissions{EnabledRepositories: String("all"), AllowedActions: String("selected")} diff --git a/github/orgs_audit_log_test.go b/github/orgs_audit_log_test.go index 14b42fdfd3e..b13338ba3aa 100644 --- a/github/orgs_audit_log_test.go +++ b/github/orgs_audit_log_test.go @@ -15,6 +15,7 @@ import ( ) func TestOrganizationService_GetAuditLog(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/audit-log", func(w http.ResponseWriter, r *http.Request) { @@ -173,6 +174,7 @@ func TestOrganizationService_GetAuditLog(t *testing.T) { } func TestGetAuditLogOptions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &GetAuditLogOptions{}, "{}") u := &GetAuditLogOptions{ @@ -201,6 +203,7 @@ func TestGetAuditLogOptions_Marshal(t *testing.T) { } func TestHookConfig_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &HookConfig{}, "{}") u := &HookConfig{ @@ -219,6 +222,7 @@ func TestHookConfig_Marshal(t *testing.T) { } func TestAuditEntry_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &AuditEntry{}, "{}") u := &AuditEntry{ diff --git a/github/orgs_credential_authorizations_test.go b/github/orgs_credential_authorizations_test.go index 2750a47aca2..a03f20586b5 100644 --- a/github/orgs_credential_authorizations_test.go +++ b/github/orgs_credential_authorizations_test.go @@ -16,6 +16,7 @@ import ( ) func TestOrganizationsService_ListCredentialAuthorizations(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/credential-authorizations", func(w http.ResponseWriter, r *http.Request) { @@ -72,6 +73,7 @@ func TestOrganizationsService_ListCredentialAuthorizations(t *testing.T) { } func TestOrganizationsService_RemoveCredentialAuthorization(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/credential-authorizations/1", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/orgs_custom_repository_roles_test.go b/github/orgs_custom_repository_roles_test.go index eb2a3ae154f..ddf8ef9759a 100644 --- a/github/orgs_custom_repository_roles_test.go +++ b/github/orgs_custom_repository_roles_test.go @@ -16,6 +16,7 @@ import ( ) func TestOrganizationsService_ListCustomRepoRoles(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/custom-repository-roles", func(w http.ResponseWriter, r *http.Request) { @@ -96,6 +97,7 @@ func TestOrganizationsService_ListCustomRepoRoles(t *testing.T) { } func TestOrganizationsService_CreateCustomRepoRole(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/custom-repository-roles", func(w http.ResponseWriter, r *http.Request) { @@ -138,6 +140,7 @@ func TestOrganizationsService_CreateCustomRepoRole(t *testing.T) { } func TestOrganizationsService_UpdateCustomRepoRole(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/custom-repository-roles/8030", func(w http.ResponseWriter, r *http.Request) { @@ -178,6 +181,7 @@ func TestOrganizationsService_UpdateCustomRepoRole(t *testing.T) { } func TestOrganizationsService_DeleteCustomRepoRole(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/custom-repository-roles/8030", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/orgs_hooks_configuration_test.go b/github/orgs_hooks_configuration_test.go index 47d6ea30ad4..d95b40c18f7 100644 --- a/github/orgs_hooks_configuration_test.go +++ b/github/orgs_hooks_configuration_test.go @@ -16,6 +16,7 @@ import ( ) func TestOrganizationsService_GetHookConfiguration(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/hooks/1/config", func(w http.ResponseWriter, r *http.Request) { @@ -55,6 +56,7 @@ func TestOrganizationsService_GetHookConfiguration(t *testing.T) { } func TestOrganizationsService_GetHookConfiguration_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -63,6 +65,7 @@ func TestOrganizationsService_GetHookConfiguration_invalidOrg(t *testing.T) { } func TestOrganizationsService_EditHookConfiguration(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &HookConfig{} @@ -111,6 +114,7 @@ func TestOrganizationsService_EditHookConfiguration(t *testing.T) { } func TestOrganizationsService_EditHookConfiguration_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() diff --git a/github/orgs_hooks_deliveries_test.go b/github/orgs_hooks_deliveries_test.go index 7a1cc8b3fac..8b4b6463624 100644 --- a/github/orgs_hooks_deliveries_test.go +++ b/github/orgs_hooks_deliveries_test.go @@ -15,6 +15,7 @@ import ( ) func TestOrganizationsService_ListHookDeliveries(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/hooks/1/deliveries", func(w http.ResponseWriter, r *http.Request) { @@ -52,6 +53,7 @@ func TestOrganizationsService_ListHookDeliveries(t *testing.T) { } func TestOrganizationsService_ListHookDeliveries_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -60,6 +62,7 @@ func TestOrganizationsService_ListHookDeliveries_invalidOwner(t *testing.T) { } func TestOrganizationsService_GetHookDelivery(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/hooks/1/deliveries/1", func(w http.ResponseWriter, r *http.Request) { @@ -94,6 +97,7 @@ func TestOrganizationsService_GetHookDelivery(t *testing.T) { } func TestOrganizationsService_GetHookDelivery_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -102,6 +106,7 @@ func TestOrganizationsService_GetHookDelivery_invalidOwner(t *testing.T) { } func TestOrganizationsService_RedeliverHookDelivery(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/hooks/1/deliveries/1/attempts", func(w http.ResponseWriter, r *http.Request) { @@ -136,6 +141,7 @@ func TestOrganizationsService_RedeliverHookDelivery(t *testing.T) { } func TestOrganizationsService_RedeliverHookDelivery_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() diff --git a/github/orgs_hooks_test.go b/github/orgs_hooks_test.go index 3f494bf836a..59e4d0d857f 100644 --- a/github/orgs_hooks_test.go +++ b/github/orgs_hooks_test.go @@ -16,6 +16,7 @@ import ( ) func TestOrganizationsService_ListHooks(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/hooks", func(w http.ResponseWriter, r *http.Request) { @@ -53,6 +54,7 @@ func TestOrganizationsService_ListHooks(t *testing.T) { } func TestOrganizationsService_ListHooks_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -61,6 +63,7 @@ func TestOrganizationsService_ListHooks_invalidOrg(t *testing.T) { } func TestOrganizationsService_CreateHook(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &Hook{CreatedAt: &Timestamp{referenceTime}} @@ -105,6 +108,7 @@ func TestOrganizationsService_CreateHook(t *testing.T) { } func TestOrganizationsService_GetHook(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/hooks/1", func(w http.ResponseWriter, r *http.Request) { @@ -139,6 +143,7 @@ func TestOrganizationsService_GetHook(t *testing.T) { } func TestOrganizationsService_GetHook_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -147,6 +152,7 @@ func TestOrganizationsService_GetHook_invalidOrg(t *testing.T) { } func TestOrganizationsService_EditHook(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &Hook{} @@ -190,6 +196,7 @@ func TestOrganizationsService_EditHook(t *testing.T) { } func TestOrganizationsService_EditHook_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -198,6 +205,7 @@ func TestOrganizationsService_EditHook_invalidOrg(t *testing.T) { } func TestOrganizationsService_PingHook(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/hooks/1/pings", func(w http.ResponseWriter, r *http.Request) { @@ -222,6 +230,7 @@ func TestOrganizationsService_PingHook(t *testing.T) { } func TestOrganizationsService_DeleteHook(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/hooks/1", func(w http.ResponseWriter, r *http.Request) { @@ -246,6 +255,7 @@ func TestOrganizationsService_DeleteHook(t *testing.T) { } func TestOrganizationsService_DeleteHook_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() diff --git a/github/orgs_members_test.go b/github/orgs_members_test.go index eeb494e611f..c2c1b63ee8b 100644 --- a/github/orgs_members_test.go +++ b/github/orgs_members_test.go @@ -17,6 +17,7 @@ import ( ) func TestOrganizationsService_ListMembers(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/members", func(w http.ResponseWriter, r *http.Request) { @@ -62,6 +63,7 @@ func TestOrganizationsService_ListMembers(t *testing.T) { } func TestOrganizationsService_ListMembers_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -70,6 +72,7 @@ func TestOrganizationsService_ListMembers_invalidOrg(t *testing.T) { } func TestOrganizationsService_ListMembers_public(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/public_members", func(w http.ResponseWriter, r *http.Request) { @@ -91,6 +94,7 @@ func TestOrganizationsService_ListMembers_public(t *testing.T) { } func TestOrganizationsService_IsMember(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/members/u", func(w http.ResponseWriter, r *http.Request) { @@ -124,6 +128,7 @@ func TestOrganizationsService_IsMember(t *testing.T) { // ensure that a 404 response is interpreted as "false" and not an error func TestOrganizationsService_IsMember_notMember(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/members/u", func(w http.ResponseWriter, r *http.Request) { @@ -144,6 +149,7 @@ func TestOrganizationsService_IsMember_notMember(t *testing.T) { // ensure that a 400 response is interpreted as an actual error, and not simply // as "false" like the above case of a 404 func TestOrganizationsService_IsMember_error(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/members/u", func(w http.ResponseWriter, r *http.Request) { @@ -162,6 +168,7 @@ func TestOrganizationsService_IsMember_error(t *testing.T) { } func TestOrganizationsService_IsMember_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -170,6 +177,7 @@ func TestOrganizationsService_IsMember_invalidOrg(t *testing.T) { } func TestOrganizationsService_IsPublicMember(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/public_members/u", func(w http.ResponseWriter, r *http.Request) { @@ -203,6 +211,7 @@ func TestOrganizationsService_IsPublicMember(t *testing.T) { // ensure that a 404 response is interpreted as "false" and not an error func TestOrganizationsService_IsPublicMember_notMember(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/public_members/u", func(w http.ResponseWriter, r *http.Request) { @@ -223,6 +232,7 @@ func TestOrganizationsService_IsPublicMember_notMember(t *testing.T) { // ensure that a 400 response is interpreted as an actual error, and not simply // as "false" like the above case of a 404 func TestOrganizationsService_IsPublicMember_error(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/public_members/u", func(w http.ResponseWriter, r *http.Request) { @@ -241,6 +251,7 @@ func TestOrganizationsService_IsPublicMember_error(t *testing.T) { } func TestOrganizationsService_IsPublicMember_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -249,6 +260,7 @@ func TestOrganizationsService_IsPublicMember_invalidOrg(t *testing.T) { } func TestOrganizationsService_RemoveMember(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/members/u", func(w http.ResponseWriter, r *http.Request) { @@ -273,6 +285,7 @@ func TestOrganizationsService_RemoveMember(t *testing.T) { } func TestOrganizationsService_CancelInvite(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/invitations/1", func(w http.ResponseWriter, r *http.Request) { @@ -298,6 +311,7 @@ func TestOrganizationsService_CancelInvite(t *testing.T) { } func TestOrganizationsService_RemoveMember_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -306,6 +320,7 @@ func TestOrganizationsService_RemoveMember_invalidOrg(t *testing.T) { } func TestOrganizationsService_PublicizeMembership(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/public_members/u", func(w http.ResponseWriter, r *http.Request) { @@ -330,6 +345,7 @@ func TestOrganizationsService_PublicizeMembership(t *testing.T) { } func TestOrganizationsService_ConcealMembership(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/public_members/u", func(w http.ResponseWriter, r *http.Request) { @@ -354,6 +370,7 @@ func TestOrganizationsService_ConcealMembership(t *testing.T) { } func TestOrganizationsService_ListOrgMemberships(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/memberships/orgs", func(w http.ResponseWriter, r *http.Request) { @@ -391,6 +408,7 @@ func TestOrganizationsService_ListOrgMemberships(t *testing.T) { } func TestOrganizationsService_GetOrgMembership_AuthenticatedUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/memberships/orgs/o", func(w http.ResponseWriter, r *http.Request) { @@ -425,6 +443,7 @@ func TestOrganizationsService_GetOrgMembership_AuthenticatedUser(t *testing.T) { } func TestOrganizationsService_GetOrgMembership_SpecifiedUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/memberships/u", func(w http.ResponseWriter, r *http.Request) { @@ -445,6 +464,7 @@ func TestOrganizationsService_GetOrgMembership_SpecifiedUser(t *testing.T) { } func TestOrganizationsService_EditOrgMembership_AuthenticatedUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &Membership{State: String("active")} @@ -488,6 +508,7 @@ func TestOrganizationsService_EditOrgMembership_AuthenticatedUser(t *testing.T) } func TestOrganizationsService_EditOrgMembership_SpecifiedUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &Membership{State: String("active")} @@ -517,6 +538,7 @@ func TestOrganizationsService_EditOrgMembership_SpecifiedUser(t *testing.T) { } func TestOrganizationsService_RemoveOrgMembership(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/memberships/u", func(w http.ResponseWriter, r *http.Request) { @@ -542,6 +564,7 @@ func TestOrganizationsService_RemoveOrgMembership(t *testing.T) { } func TestOrganizationsService_ListPendingOrgInvitations(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/invitations", func(w http.ResponseWriter, r *http.Request) { @@ -637,6 +660,7 @@ func TestOrganizationsService_ListPendingOrgInvitations(t *testing.T) { } func TestOrganizationsService_CreateOrgInvitation(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &CreateOrgInvitationOptions{ @@ -687,6 +711,7 @@ func TestOrganizationsService_CreateOrgInvitation(t *testing.T) { } func TestOrganizationsService_ListOrgInvitationTeams(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/invitations/22/teams", func(w http.ResponseWriter, r *http.Request) { @@ -748,6 +773,7 @@ func TestOrganizationsService_ListOrgInvitationTeams(t *testing.T) { } func TestOrganizationsService_ListFailedOrgInvitations(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/failed_invitations", func(w http.ResponseWriter, r *http.Request) { @@ -852,6 +878,7 @@ func TestOrganizationsService_ListFailedOrgInvitations(t *testing.T) { } func TestMembership_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Membership{}, "{}") u := &Membership{ @@ -934,6 +961,7 @@ func TestMembership_Marshal(t *testing.T) { } func TestCreateOrgInvitationOptions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &CreateOrgInvitationOptions{}, "{}") u := &CreateOrgInvitationOptions{ diff --git a/github/orgs_organization_roles_test.go b/github/orgs_organization_roles_test.go index 0afef53e452..4989697e355 100644 --- a/github/orgs_organization_roles_test.go +++ b/github/orgs_organization_roles_test.go @@ -16,6 +16,7 @@ import ( ) func TestOrganizationsService_ListRoles(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/organization-roles", func(w http.ResponseWriter, r *http.Request) { @@ -98,6 +99,7 @@ func TestOrganizationsService_ListRoles(t *testing.T) { } func TestOrganizationsService_GetOrgRole(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) // Test built-in org role @@ -196,6 +198,7 @@ func TestOrganizationsService_GetOrgRole(t *testing.T) { } func TestOrganizationsService_CreateCustomOrgRole(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/organization-roles", func(w http.ResponseWriter, r *http.Request) { @@ -237,6 +240,7 @@ func TestOrganizationsService_CreateCustomOrgRole(t *testing.T) { } func TestOrganizationsService_UpdateCustomOrgRole(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/organization-roles/8030", func(w http.ResponseWriter, r *http.Request) { @@ -277,6 +281,7 @@ func TestOrganizationsService_UpdateCustomOrgRole(t *testing.T) { } func TestOrganizationsService_DeleteCustomOrgRole(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/organization-roles/8030", func(w http.ResponseWriter, r *http.Request) { @@ -307,6 +312,7 @@ func TestOrganizationsService_DeleteCustomOrgRole(t *testing.T) { } func TestOrganizationsService_AssignOrgRoleToTeam(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/organization-roles/teams/t/8030", func(w http.ResponseWriter, r *http.Request) { @@ -335,6 +341,7 @@ func TestOrganizationsService_AssignOrgRoleToTeam(t *testing.T) { } func TestOrganizationsService_RemoveOrgRoleFromTeam(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/organization-roles/teams/t/8030", func(w http.ResponseWriter, r *http.Request) { @@ -363,6 +370,7 @@ func TestOrganizationsService_RemoveOrgRoleFromTeam(t *testing.T) { } func TestOrganizationsService_AssignOrgRoleToUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/organization-roles/users/t/8030", func(w http.ResponseWriter, r *http.Request) { @@ -391,6 +399,7 @@ func TestOrganizationsService_AssignOrgRoleToUser(t *testing.T) { } func TestOrganizationsService_RemoveOrgRoleFromUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/organization-roles/users/t/8030", func(w http.ResponseWriter, r *http.Request) { @@ -419,6 +428,7 @@ func TestOrganizationsService_RemoveOrgRoleFromUser(t *testing.T) { } func TestOrganizationsService_ListTeamsAssignedToOrgRole(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/organization-roles/1729/teams", func(w http.ResponseWriter, r *http.Request) { @@ -453,6 +463,7 @@ func TestOrganizationsService_ListTeamsAssignedToOrgRole(t *testing.T) { } func TestOrganizationsService_ListUsersAssignedToOrgRole(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/organization-roles/1729/users", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/orgs_outside_collaborators_test.go b/github/orgs_outside_collaborators_test.go index 75212aa5787..c366800f4bc 100644 --- a/github/orgs_outside_collaborators_test.go +++ b/github/orgs_outside_collaborators_test.go @@ -15,6 +15,7 @@ import ( ) func TestOrganizationsService_ListOutsideCollaborators(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/outside_collaborators", func(w http.ResponseWriter, r *http.Request) { @@ -57,6 +58,7 @@ func TestOrganizationsService_ListOutsideCollaborators(t *testing.T) { } func TestOrganizationsService_ListOutsideCollaborators_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -65,6 +67,7 @@ func TestOrganizationsService_ListOutsideCollaborators_invalidOrg(t *testing.T) } func TestOrganizationsService_RemoveOutsideCollaborator(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) handler := func(w http.ResponseWriter, r *http.Request) { @@ -90,6 +93,7 @@ func TestOrganizationsService_RemoveOutsideCollaborator(t *testing.T) { } func TestOrganizationsService_RemoveOutsideCollaborator_NonMember(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) handler := func(w http.ResponseWriter, r *http.Request) { @@ -108,6 +112,7 @@ func TestOrganizationsService_RemoveOutsideCollaborator_NonMember(t *testing.T) } func TestOrganizationsService_RemoveOutsideCollaborator_Member(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) handler := func(w http.ResponseWriter, r *http.Request) { @@ -126,6 +131,7 @@ func TestOrganizationsService_RemoveOutsideCollaborator_Member(t *testing.T) { } func TestOrganizationsService_ConvertMemberToOutsideCollaborator(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) handler := func(w http.ResponseWriter, r *http.Request) { @@ -151,6 +157,7 @@ func TestOrganizationsService_ConvertMemberToOutsideCollaborator(t *testing.T) { } func TestOrganizationsService_ConvertMemberToOutsideCollaborator_NonMemberOrLastOwner(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) handler := func(w http.ResponseWriter, r *http.Request) { diff --git a/github/orgs_packages_test.go b/github/orgs_packages_test.go index e02000afedf..a4bbfb915c4 100644 --- a/github/orgs_packages_test.go +++ b/github/orgs_packages_test.go @@ -15,6 +15,7 @@ import ( ) func TestOrganizationsService_ListPackages(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/packages", func(w http.ResponseWriter, r *http.Request) { @@ -113,6 +114,7 @@ func TestOrganizationsService_ListPackages(t *testing.T) { } func TestOrganizationsService_GetPackage(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) // don't url escape the package name here since mux will convert it to a slash automatically @@ -171,6 +173,7 @@ func TestOrganizationsService_GetPackage(t *testing.T) { } func TestOrganizationsService_DeletePackage(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) // don't url escape the package name here since mux will convert it to a slash automatically @@ -200,6 +203,7 @@ func TestOrganizationsService_DeletePackage(t *testing.T) { } func TestOrganizationsService_RestorePackage(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) // don't url escape the package name here since mux will convert it to a slash automatically @@ -225,6 +229,7 @@ func TestOrganizationsService_RestorePackage(t *testing.T) { } func TestOrganizationsService_ListPackagesVersions(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) // don't url escape the package name here since mux will convert it to a slash automatically @@ -298,6 +303,7 @@ func TestOrganizationsService_ListPackagesVersions(t *testing.T) { } func TestOrganizationsService_PackageGetVersion(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) // don't url escape the package name here since mux will convert it to a slash automatically @@ -367,6 +373,7 @@ func TestOrganizationsService_PackageGetVersion(t *testing.T) { } func TestOrganizationsService_PackageDeleteVersion(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) // don't url escape the package name here since mux will convert it to a slash automatically @@ -392,6 +399,7 @@ func TestOrganizationsService_PackageDeleteVersion(t *testing.T) { } func TestOrganizationsService_PackageRestoreVersion(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) // don't url escape the package name here since mux will convert it to a slash automatically diff --git a/github/orgs_personal_access_tokens_test.go b/github/orgs_personal_access_tokens_test.go index 680be354980..f4666004a77 100644 --- a/github/orgs_personal_access_tokens_test.go +++ b/github/orgs_personal_access_tokens_test.go @@ -17,6 +17,7 @@ import ( ) func TestOrganizationsService_ListFineGrainedPersonalAccessTokens(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/personal-access-tokens", func(w http.ResponseWriter, r *http.Request) { @@ -155,6 +156,7 @@ func TestOrganizationsService_ListFineGrainedPersonalAccessTokens(t *testing.T) } func TestOrganizationsService_ReviewPersonalAccessTokenRequest(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := ReviewPersonalAccessTokenRequestOptions{ @@ -196,6 +198,7 @@ func TestOrganizationsService_ReviewPersonalAccessTokenRequest(t *testing.T) { } func TestReviewPersonalAccessTokenRequestOptions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ReviewPersonalAccessTokenRequestOptions{}, "{}") u := &ReviewPersonalAccessTokenRequestOptions{ diff --git a/github/orgs_projects_test.go b/github/orgs_projects_test.go index 7e8cd361902..b6f082f0a45 100644 --- a/github/orgs_projects_test.go +++ b/github/orgs_projects_test.go @@ -16,6 +16,7 @@ import ( ) func TestOrganizationsService_ListProjects(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/projects", func(w http.ResponseWriter, r *http.Request) { @@ -53,6 +54,7 @@ func TestOrganizationsService_ListProjects(t *testing.T) { } func TestOrganizationsService_CreateProject(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &ProjectOptions{Name: String("Project Name"), Body: String("Project body.")} diff --git a/github/orgs_properties_test.go b/github/orgs_properties_test.go index efbcb381133..b71132a8622 100644 --- a/github/orgs_properties_test.go +++ b/github/orgs_properties_test.go @@ -15,6 +15,7 @@ import ( ) func TestOrganizationsService_GetAllCustomProperties(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/properties/schema", func(w http.ResponseWriter, r *http.Request) { @@ -86,6 +87,7 @@ func TestOrganizationsService_GetAllCustomProperties(t *testing.T) { } func TestOrganizationsService_CreateOrUpdateCustomProperties(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/properties/schema", func(w http.ResponseWriter, r *http.Request) { @@ -148,6 +150,7 @@ func TestOrganizationsService_CreateOrUpdateCustomProperties(t *testing.T) { } func TestOrganizationsService_GetCustomProperty(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/properties/schema/name", func(w http.ResponseWriter, r *http.Request) { @@ -197,6 +200,7 @@ func TestOrganizationsService_GetCustomProperty(t *testing.T) { } func TestOrganizationsService_CreateOrUpdateCustomProperty(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/properties/schema/name", func(w http.ResponseWriter, r *http.Request) { @@ -253,6 +257,7 @@ func TestOrganizationsService_CreateOrUpdateCustomProperty(t *testing.T) { } func TestOrganizationsService_RemoveCustomProperty(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/properties/schema/name", func(w http.ResponseWriter, r *http.Request) { @@ -273,6 +278,7 @@ func TestOrganizationsService_RemoveCustomProperty(t *testing.T) { } func TestOrganizationsService_ListCustomPropertyValues(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/properties/values", func(w http.ResponseWriter, r *http.Request) { @@ -359,6 +365,7 @@ func TestOrganizationsService_ListCustomPropertyValues(t *testing.T) { } func TestCustomPropertyValue_UnmarshalJSON(t *testing.T) { + t.Parallel() tests := map[string]struct { data string want *CustomPropertyValue @@ -416,7 +423,9 @@ func TestCustomPropertyValue_UnmarshalJSON(t *testing.T) { } for name, tc := range tests { + tc := tc t.Run(name, func(t *testing.T) { + t.Parallel() cpv := &CustomPropertyValue{} err := cpv.UnmarshalJSON([]byte(tc.data)) if (err != nil) != tc.wantErr { @@ -431,6 +440,7 @@ func TestCustomPropertyValue_UnmarshalJSON(t *testing.T) { } func TestOrganizationsService_CreateOrUpdateRepoCustomPropertyValues(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/properties/values", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/orgs_rules_test.go b/github/orgs_rules_test.go index 67e86ac1c00..66cf6bd5c80 100644 --- a/github/orgs_rules_test.go +++ b/github/orgs_rules_test.go @@ -15,6 +15,7 @@ import ( ) func TestOrganizationsService_GetAllOrganizationRulesets(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/rulesets", func(w http.ResponseWriter, r *http.Request) { @@ -70,6 +71,7 @@ func TestOrganizationsService_GetAllOrganizationRulesets(t *testing.T) { } func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/rulesets", func(w http.ResponseWriter, r *http.Request) { @@ -388,7 +390,9 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) return resp, err }) } + func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/rulesets", func(w http.ResponseWriter, r *http.Request) { @@ -722,7 +726,9 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing. return resp, err }) } + func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/rulesets", func(w http.ResponseWriter, r *http.Request) { @@ -1032,6 +1038,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { } func TestOrganizationsService_GetOrganizationRuleset(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/rulesets/26110", func(w http.ResponseWriter, r *http.Request) { @@ -1127,6 +1134,7 @@ func TestOrganizationsService_GetOrganizationRuleset(t *testing.T) { } func TestOrganizationsService_GetOrganizationRulesetWithRepoPropCondition(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/rulesets/26110", func(w http.ResponseWriter, r *http.Request) { @@ -1214,7 +1222,9 @@ func TestOrganizationsService_GetOrganizationRulesetWithRepoPropCondition(t *tes return resp, err }) } + func TestOrganizationsService_UpdateOrganizationRuleset(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/rulesets/26110", func(w http.ResponseWriter, r *http.Request) { @@ -1329,6 +1339,7 @@ func TestOrganizationsService_UpdateOrganizationRuleset(t *testing.T) { } func TestOrganizationsService_UpdateOrganizationRulesetWithRepoProp(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/rulesets/26110", func(w http.ResponseWriter, r *http.Request) { @@ -1436,7 +1447,9 @@ func TestOrganizationsService_UpdateOrganizationRulesetWithRepoProp(t *testing.T return resp, err }) } + func TestOrganizationsService_DeleteOrganizationRuleset(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/rulesets/26110", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/orgs_security_managers_test.go b/github/orgs_security_managers_test.go index 63403d79bc6..336a16a2abd 100644 --- a/github/orgs_security_managers_test.go +++ b/github/orgs_security_managers_test.go @@ -15,6 +15,7 @@ import ( ) func TestOrganizationsService_ListSecurityManagerTeams(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/security-managers", func(w http.ResponseWriter, r *http.Request) { @@ -49,6 +50,7 @@ func TestOrganizationsService_ListSecurityManagerTeams(t *testing.T) { } func TestOrganizationsService_ListSecurityManagerTeams_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -57,6 +59,7 @@ func TestOrganizationsService_ListSecurityManagerTeams_invalidOrg(t *testing.T) } func TestOrganizationsService_AddSecurityManagerTeam(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/security-managers/teams/t", func(w http.ResponseWriter, r *http.Request) { @@ -81,6 +84,7 @@ func TestOrganizationsService_AddSecurityManagerTeam(t *testing.T) { } func TestOrganizationsService_AddSecurityManagerTeam_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -89,6 +93,7 @@ func TestOrganizationsService_AddSecurityManagerTeam_invalidOrg(t *testing.T) { } func TestOrganizationsService_AddSecurityManagerTeam_invalidTeam(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -97,6 +102,7 @@ func TestOrganizationsService_AddSecurityManagerTeam_invalidTeam(t *testing.T) { } func TestOrganizationsService_RemoveSecurityManagerTeam(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/security-managers/teams/t", func(w http.ResponseWriter, r *http.Request) { @@ -121,6 +127,7 @@ func TestOrganizationsService_RemoveSecurityManagerTeam(t *testing.T) { } func TestOrganizationsService_RemoveSecurityManagerTeam_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -129,6 +136,7 @@ func TestOrganizationsService_RemoveSecurityManagerTeam_invalidOrg(t *testing.T) } func TestOrganizationsService_RemoveSecurityManagerTeam_invalidTeam(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() diff --git a/github/orgs_test.go b/github/orgs_test.go index 59e6257464b..a7412baebac 100644 --- a/github/orgs_test.go +++ b/github/orgs_test.go @@ -16,6 +16,7 @@ import ( ) func TestOrganization_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Organization{}, "{}") o := &Organization{ @@ -68,6 +69,7 @@ func TestOrganization_Marshal(t *testing.T) { } func TestOrganizationsService_ListAll(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) since := int64(1342004) @@ -100,6 +102,7 @@ func TestOrganizationsService_ListAll(t *testing.T) { } func TestOrganizationsService_List_authenticatedUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/orgs", func(w http.ResponseWriter, r *http.Request) { @@ -134,6 +137,7 @@ func TestOrganizationsService_List_authenticatedUser(t *testing.T) { } func TestOrganizationsService_List_specifiedUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/orgs", func(w http.ResponseWriter, r *http.Request) { @@ -170,6 +174,7 @@ func TestOrganizationsService_List_specifiedUser(t *testing.T) { } func TestOrganizationsService_List_invalidUser(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -178,6 +183,7 @@ func TestOrganizationsService_List_invalidUser(t *testing.T) { } func TestOrganizationsService_Get(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o", func(w http.ResponseWriter, r *http.Request) { @@ -213,6 +219,7 @@ func TestOrganizationsService_Get(t *testing.T) { } func TestOrganizationsService_Get_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -221,6 +228,7 @@ func TestOrganizationsService_Get_invalidOrg(t *testing.T) { } func TestOrganizationsService_GetByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/organizations/1", func(w http.ResponseWriter, r *http.Request) { @@ -255,6 +263,7 @@ func TestOrganizationsService_GetByID(t *testing.T) { } func TestOrganizationsService_Edit(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &Organization{Login: String("l")} @@ -299,6 +308,7 @@ func TestOrganizationsService_Edit(t *testing.T) { } func TestOrganizationsService_Edit_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -307,6 +317,7 @@ func TestOrganizationsService_Edit_invalidOrg(t *testing.T) { } func TestOrganizationsService_Delete(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o", func(w http.ResponseWriter, r *http.Request) { @@ -331,6 +342,7 @@ func TestOrganizationsService_Delete(t *testing.T) { } func TestOrganizationsService_ListInstallations(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/installations", func(w http.ResponseWriter, r *http.Request) { @@ -365,6 +377,7 @@ func TestOrganizationsService_ListInstallations(t *testing.T) { } func TestOrganizationsService_ListInstallations_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -373,6 +386,7 @@ func TestOrganizationsService_ListInstallations_invalidOrg(t *testing.T) { } func TestOrganizationsService_ListInstallations_withListOptions(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/installations", func(w http.ResponseWriter, r *http.Request) { @@ -414,6 +428,7 @@ func TestOrganizationsService_ListInstallations_withListOptions(t *testing.T) { } func TestOrganizationInstallations_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &OrganizationInstallations{}, "{}") o := &OrganizationInstallations{ @@ -433,6 +448,7 @@ func TestOrganizationInstallations_Marshal(t *testing.T) { } func TestPlan_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Plan{}, "{}") o := &Plan{ diff --git a/github/orgs_users_blocking_test.go b/github/orgs_users_blocking_test.go index 46c7e6bd410..b544f3a49cc 100644 --- a/github/orgs_users_blocking_test.go +++ b/github/orgs_users_blocking_test.go @@ -15,6 +15,7 @@ import ( ) func TestOrganizationsService_ListBlockedUsers(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/blocks", func(w http.ResponseWriter, r *http.Request) { @@ -54,6 +55,7 @@ func TestOrganizationsService_ListBlockedUsers(t *testing.T) { } func TestOrganizationsService_IsBlocked(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/blocks/u", func(w http.ResponseWriter, r *http.Request) { @@ -87,6 +89,7 @@ func TestOrganizationsService_IsBlocked(t *testing.T) { } func TestOrganizationsService_BlockUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/blocks/u", func(w http.ResponseWriter, r *http.Request) { @@ -113,6 +116,7 @@ func TestOrganizationsService_BlockUser(t *testing.T) { } func TestOrganizationsService_UnblockUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/blocks/u", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/packages_test.go b/github/packages_test.go index c825e6a5429..d4e33989642 100644 --- a/github/packages_test.go +++ b/github/packages_test.go @@ -8,6 +8,7 @@ package github import "testing" func TestPackageRegistry_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PackageRegistry{}, "{}") o := &PackageRegistry{ @@ -29,6 +30,7 @@ func TestPackageRegistry_Marshal(t *testing.T) { } func TestPackageFile_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PackageFile{}, "{}") o := &PackageFile{ @@ -103,6 +105,7 @@ func TestPackageFile_Marshal(t *testing.T) { } func TestPackageRelease_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PackageRelease{}, "{}") o := &PackageRelease{ @@ -175,6 +178,7 @@ func TestPackageRelease_Marshal(t *testing.T) { } func TestPackageVersion_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PackageVersion{}, "{}") o := &PackageVersion{ @@ -391,6 +395,7 @@ func TestPackageVersion_Marshal(t *testing.T) { } func TestPackage_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Package{}, "{}") o := &Package{ diff --git a/github/projects_test.go b/github/projects_test.go index 029e89ca0b6..f7fcb818523 100644 --- a/github/projects_test.go +++ b/github/projects_test.go @@ -17,6 +17,7 @@ import ( ) func TestProject_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Project{}, "{}") u := &Project{ @@ -85,6 +86,7 @@ func TestProject_Marshal(t *testing.T) { } func TestProjectsService_UpdateProject(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &ProjectOptions{ @@ -136,6 +138,7 @@ func TestProjectsService_UpdateProject(t *testing.T) { } func TestProjectsService_GetProject(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/projects/1", func(w http.ResponseWriter, r *http.Request) { @@ -171,6 +174,7 @@ func TestProjectsService_GetProject(t *testing.T) { } func TestProjectsService_DeleteProject(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/projects/1", func(w http.ResponseWriter, r *http.Request) { @@ -196,6 +200,7 @@ func TestProjectsService_DeleteProject(t *testing.T) { } func TestProjectsService_ListProjectColumns(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) wantAcceptHeaders := []string{mediaTypeProjectsPreview} @@ -234,6 +239,7 @@ func TestProjectsService_ListProjectColumns(t *testing.T) { } func TestProjectsService_GetProjectColumn(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/projects/columns/1", func(w http.ResponseWriter, r *http.Request) { @@ -269,6 +275,7 @@ func TestProjectsService_GetProjectColumn(t *testing.T) { } func TestProjectsService_CreateProjectColumn(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &ProjectColumnOptions{Name: "Column Name"} @@ -313,6 +320,7 @@ func TestProjectsService_CreateProjectColumn(t *testing.T) { } func TestProjectsService_UpdateProjectColumn(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &ProjectColumnOptions{Name: "Column Name"} @@ -357,6 +365,7 @@ func TestProjectsService_UpdateProjectColumn(t *testing.T) { } func TestProjectsService_DeleteProjectColumn(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/projects/columns/1", func(w http.ResponseWriter, r *http.Request) { @@ -382,6 +391,7 @@ func TestProjectsService_DeleteProjectColumn(t *testing.T) { } func TestProjectsService_MoveProjectColumn(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &ProjectColumnMoveOptions{Position: "after:12345"} @@ -415,6 +425,7 @@ func TestProjectsService_MoveProjectColumn(t *testing.T) { } func TestProjectsService_ListProjectCards(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/projects/columns/1/cards", func(w http.ResponseWriter, r *http.Request) { @@ -456,6 +467,7 @@ func TestProjectsService_ListProjectCards(t *testing.T) { } func TestProjectsService_GetProjectCard(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/projects/columns/cards/1", func(w http.ResponseWriter, r *http.Request) { @@ -491,6 +503,7 @@ func TestProjectsService_GetProjectCard(t *testing.T) { } func TestProjectsService_CreateProjectCard(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &ProjectCardOptions{ @@ -538,6 +551,7 @@ func TestProjectsService_CreateProjectCard(t *testing.T) { } func TestProjectsService_UpdateProjectCard(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &ProjectCardOptions{ @@ -585,6 +599,7 @@ func TestProjectsService_UpdateProjectCard(t *testing.T) { } func TestProjectsService_DeleteProjectCard(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/projects/columns/cards/1", func(w http.ResponseWriter, r *http.Request) { @@ -610,6 +625,7 @@ func TestProjectsService_DeleteProjectCard(t *testing.T) { } func TestProjectsService_MoveProjectCard(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &ProjectCardMoveOptions{Position: "after:12345"} @@ -643,6 +659,7 @@ func TestProjectsService_MoveProjectCard(t *testing.T) { } func TestProjectsService_AddProjectCollaborator(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) opt := &ProjectCollaboratorOptions{ @@ -680,6 +697,7 @@ func TestProjectsService_AddProjectCollaborator(t *testing.T) { } func TestProjectsService_AddCollaborator_invalidUser(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -688,6 +706,7 @@ func TestProjectsService_AddCollaborator_invalidUser(t *testing.T) { } func TestProjectsService_RemoveCollaborator(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/projects/1/collaborators/u", func(w http.ResponseWriter, r *http.Request) { @@ -714,6 +733,7 @@ func TestProjectsService_RemoveCollaborator(t *testing.T) { } func TestProjectsService_RemoveCollaborator_invalidUser(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -722,6 +742,7 @@ func TestProjectsService_RemoveCollaborator_invalidUser(t *testing.T) { } func TestProjectsService_ListCollaborators(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/projects/1/collaborators", func(w http.ResponseWriter, r *http.Request) { @@ -761,6 +782,7 @@ func TestProjectsService_ListCollaborators(t *testing.T) { } func TestProjectsService_ListCollaborators_withAffiliation(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/projects/1/collaborators", func(w http.ResponseWriter, r *http.Request) { @@ -787,6 +809,7 @@ func TestProjectsService_ListCollaborators_withAffiliation(t *testing.T) { } func TestProjectsService_ReviewProjectCollaboratorPermission(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/projects/1/collaborators/u/permission", func(w http.ResponseWriter, r *http.Request) { @@ -828,6 +851,7 @@ func TestProjectsService_ReviewProjectCollaboratorPermission(t *testing.T) { } func TestProjectOptions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ProjectOptions{}, "{}") u := &ProjectOptions{ @@ -850,6 +874,7 @@ func TestProjectOptions_Marshal(t *testing.T) { } func TestProjectColumn_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ProjectColumn{}, "{}") u := &ProjectColumn{ @@ -878,6 +903,7 @@ func TestProjectColumn_Marshal(t *testing.T) { } func TestProjectColumnOptions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ProjectColumnOptions{}, "{}") u := &ProjectColumnOptions{ @@ -892,6 +918,7 @@ func TestProjectColumnOptions_Marshal(t *testing.T) { } func TestProjectColumnMoveOptions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ProjectColumnMoveOptions{}, "{}") u := &ProjectColumnMoveOptions{ @@ -906,6 +933,7 @@ func TestProjectColumnMoveOptions_Marshal(t *testing.T) { } func TestProjectCard_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ProjectCard{}, "{}") u := &ProjectCard{ @@ -986,6 +1014,7 @@ func TestProjectCard_Marshal(t *testing.T) { } func TestProjectCardOptions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ProjectCardOptions{}, "{}") u := &ProjectCardOptions{ @@ -1006,6 +1035,7 @@ func TestProjectCardOptions_Marshal(t *testing.T) { } func TestProjectCardMoveOptions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ProjectCardMoveOptions{}, "{}") u := &ProjectCardMoveOptions{ @@ -1022,6 +1052,7 @@ func TestProjectCardMoveOptions_Marshal(t *testing.T) { } func TestProjectCollaboratorOptions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ProjectCollaboratorOptions{}, "{}") u := &ProjectCollaboratorOptions{ @@ -1036,6 +1067,7 @@ func TestProjectCollaboratorOptions_Marshal(t *testing.T) { } func TestProjectPermissionLevel_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ProjectPermissionLevel{}, "{}") u := &ProjectPermissionLevel{ diff --git a/github/pulls_comments_test.go b/github/pulls_comments_test.go index 148901badae..0df6f020a2c 100644 --- a/github/pulls_comments_test.go +++ b/github/pulls_comments_test.go @@ -18,6 +18,7 @@ import ( ) func TestPullComments_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PullRequestComment{}, "{}") createdAt := Timestamp{time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC)} @@ -134,6 +135,7 @@ func TestPullComments_Marshal(t *testing.T) { } func TestPullRequestsService_ListComments_allPulls(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) wantAcceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeMultiLineCommentsPreview} @@ -182,6 +184,7 @@ func TestPullRequestsService_ListComments_allPulls(t *testing.T) { } func TestPullRequestsService_ListComments_specificPull(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) wantAcceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeMultiLineCommentsPreview} @@ -204,6 +207,7 @@ func TestPullRequestsService_ListComments_specificPull(t *testing.T) { } func TestPullRequestsService_ListComments_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -212,6 +216,7 @@ func TestPullRequestsService_ListComments_invalidOwner(t *testing.T) { } func TestPullRequestsService_GetComment(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) wantAcceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeMultiLineCommentsPreview} @@ -248,6 +253,7 @@ func TestPullRequestsService_GetComment(t *testing.T) { } func TestPullRequestsService_GetComment_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -256,6 +262,7 @@ func TestPullRequestsService_GetComment_invalidOwner(t *testing.T) { } func TestPullRequestsService_CreateComment(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &PullRequestComment{Body: String("b")} @@ -302,6 +309,7 @@ func TestPullRequestsService_CreateComment(t *testing.T) { } func TestPullRequestsService_CreateComment_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -310,6 +318,7 @@ func TestPullRequestsService_CreateComment_invalidOwner(t *testing.T) { } func TestPullRequestsService_CreateCommentInReplyTo(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &PullRequestComment{Body: String("b")} @@ -353,6 +362,7 @@ func TestPullRequestsService_CreateCommentInReplyTo(t *testing.T) { } func TestPullRequestsService_EditComment(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &PullRequestComment{Body: String("b")} @@ -396,6 +406,7 @@ func TestPullRequestsService_EditComment(t *testing.T) { } func TestPullRequestsService_EditComment_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -404,6 +415,7 @@ func TestPullRequestsService_EditComment_invalidOwner(t *testing.T) { } func TestPullRequestsService_DeleteComment(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/comments/1", func(w http.ResponseWriter, r *http.Request) { @@ -428,6 +440,7 @@ func TestPullRequestsService_DeleteComment(t *testing.T) { } func TestPullRequestsService_DeleteComment_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() diff --git a/github/pulls_reviewers_test.go b/github/pulls_reviewers_test.go index b97fbbec189..ac025d10e26 100644 --- a/github/pulls_reviewers_test.go +++ b/github/pulls_reviewers_test.go @@ -15,6 +15,7 @@ import ( ) func TestReviewersRequest_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ReviewersRequest{}, "{}") u := &ReviewersRequest{ @@ -37,6 +38,7 @@ func TestReviewersRequest_Marshal(t *testing.T) { } func TestReviewers_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Reviewers{}, "{}") u := &Reviewers{ @@ -119,6 +121,7 @@ func TestReviewers_Marshal(t *testing.T) { } func TestRequestReviewers(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1/requested_reviewers", func(w http.ResponseWriter, r *http.Request) { @@ -149,6 +152,7 @@ func TestRequestReviewers(t *testing.T) { } func TestRemoveReviewers(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1/requested_reviewers", func(w http.ResponseWriter, r *http.Request) { @@ -169,6 +173,7 @@ func TestRemoveReviewers(t *testing.T) { } func TestListReviewers(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1/requested_reviewers", func(w http.ResponseWriter, r *http.Request) { @@ -211,6 +216,7 @@ func TestListReviewers(t *testing.T) { } func TestListReviewers_withOptions(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1/requested_reviewers", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/pulls_reviews_test.go b/github/pulls_reviews_test.go index ce7b7857de5..c7c5b62bec5 100644 --- a/github/pulls_reviews_test.go +++ b/github/pulls_reviews_test.go @@ -16,6 +16,7 @@ import ( ) func TestPullRequestsService_ListReviews(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1/reviews", func(w http.ResponseWriter, r *http.Request) { @@ -57,6 +58,7 @@ func TestPullRequestsService_ListReviews(t *testing.T) { } func TestPullRequestsService_ListReviews_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -65,6 +67,7 @@ func TestPullRequestsService_ListReviews_invalidOwner(t *testing.T) { } func TestPullRequestsService_GetReview(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1/reviews/1", func(w http.ResponseWriter, r *http.Request) { @@ -99,6 +102,7 @@ func TestPullRequestsService_GetReview(t *testing.T) { } func TestPullRequestsService_GetReview_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -107,6 +111,7 @@ func TestPullRequestsService_GetReview_invalidOwner(t *testing.T) { } func TestPullRequestsService_DeletePendingReview(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1/reviews/1", func(w http.ResponseWriter, r *http.Request) { @@ -141,6 +146,7 @@ func TestPullRequestsService_DeletePendingReview(t *testing.T) { } func TestPullRequestsService_DeletePendingReview_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -149,6 +155,7 @@ func TestPullRequestsService_DeletePendingReview_invalidOwner(t *testing.T) { } func TestPullRequestsService_ListReviewComments(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1/reviews/1/comments", func(w http.ResponseWriter, r *http.Request) { @@ -186,6 +193,7 @@ func TestPullRequestsService_ListReviewComments(t *testing.T) { } func TestPullRequestsService_ListReviewComments_withOptions(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1/reviews/1/comments", func(w http.ResponseWriter, r *http.Request) { @@ -218,6 +226,7 @@ func TestPullRequestsService_ListReviewComments_withOptions(t *testing.T) { } func TestPullRequestReviewRequest_isComfortFadePreview(t *testing.T) { + t.Parallel() path := "path/to/file.go" body := "this is a comment body" left, right := "LEFT", "RIGHT" @@ -321,7 +330,9 @@ func TestPullRequestReviewRequest_isComfortFadePreview(t *testing.T) { }} for _, tc := range tests { + tc := tc t.Run(tc.name, func(t *testing.T) { + t.Parallel() gotBool, gotErr := tc.review.isComfortFadePreview() if tc.wantErr != nil { if gotErr != tc.wantErr { @@ -337,6 +348,7 @@ func TestPullRequestReviewRequest_isComfortFadePreview(t *testing.T) { } func TestPullRequestsService_ListReviewComments_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -345,6 +357,7 @@ func TestPullRequestsService_ListReviewComments_invalidOwner(t *testing.T) { } func TestPullRequestsService_CreateReview(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &PullRequestReviewRequest{ @@ -392,6 +405,7 @@ func TestPullRequestsService_CreateReview(t *testing.T) { } func TestPullRequestsService_CreateReview_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -400,6 +414,7 @@ func TestPullRequestsService_CreateReview_invalidOwner(t *testing.T) { } func TestPullRequestsService_CreateReview_badReview(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -428,6 +443,7 @@ func TestPullRequestsService_CreateReview_badReview(t *testing.T) { } func TestPullRequestsService_CreateReview_addHeader(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) path := "path/to/file.go" @@ -474,6 +490,7 @@ func TestPullRequestsService_CreateReview_addHeader(t *testing.T) { } func TestPullRequestsService_UpdateReview(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1/reviews/1", func(w http.ResponseWriter, r *http.Request) { @@ -508,6 +525,7 @@ func TestPullRequestsService_UpdateReview(t *testing.T) { } func TestPullRequestsService_SubmitReview(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &PullRequestReviewRequest{ @@ -554,6 +572,7 @@ func TestPullRequestsService_SubmitReview(t *testing.T) { } func TestPullRequestsService_SubmitReview_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -562,6 +581,7 @@ func TestPullRequestsService_SubmitReview_invalidOwner(t *testing.T) { } func TestPullRequestsService_DismissReview(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &PullRequestReviewDismissalRequest{Message: String("m")} @@ -605,6 +625,7 @@ func TestPullRequestsService_DismissReview(t *testing.T) { } func TestPullRequestsService_DismissReview_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -613,6 +634,7 @@ func TestPullRequestsService_DismissReview_invalidOwner(t *testing.T) { } func TestPullRequestReviewDismissalRequest_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PullRequestReviewDismissalRequest{}, "{}") u := &PullRequestReviewDismissalRequest{ @@ -627,6 +649,7 @@ func TestPullRequestReviewDismissalRequest_Marshal(t *testing.T) { } func TestDraftReviewComment_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &DraftReviewComment{}, "{}") u := &DraftReviewComment{ @@ -653,6 +676,7 @@ func TestDraftReviewComment_Marshal(t *testing.T) { } func TestPullRequestReviewRequest_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PullRequestReviewRequest{}, "{}") u := &PullRequestReviewRequest{ @@ -695,6 +719,7 @@ func TestPullRequestReviewRequest_Marshal(t *testing.T) { } func TestPullRequestReview_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PullRequestReview{}, "{}") u := &PullRequestReview{ diff --git a/github/pulls_test.go b/github/pulls_test.go index 0f9058cca84..b4e9e87d2af 100644 --- a/github/pulls_test.go +++ b/github/pulls_test.go @@ -18,6 +18,7 @@ import ( ) func TestPullRequestsService_List(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls", func(w http.ResponseWriter, r *http.Request) { @@ -61,6 +62,7 @@ func TestPullRequestsService_List(t *testing.T) { } func TestPullRequestsService_ListPullRequestsWithCommit(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/commits/sha/pulls", func(w http.ResponseWriter, r *http.Request) { @@ -100,6 +102,7 @@ func TestPullRequestsService_ListPullRequestsWithCommit(t *testing.T) { } func TestPullRequestsService_List_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -108,6 +111,7 @@ func TestPullRequestsService_List_invalidOwner(t *testing.T) { } func TestPullRequestsService_Get(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1", func(w http.ResponseWriter, r *http.Request) { @@ -142,6 +146,7 @@ func TestPullRequestsService_Get(t *testing.T) { } func TestPullRequestsService_GetRaw_diff(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) const rawStr = "@@diff content" @@ -178,6 +183,7 @@ func TestPullRequestsService_GetRaw_diff(t *testing.T) { } func TestPullRequestsService_GetRaw_patch(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) const rawStr = "@@patch content" @@ -200,6 +206,7 @@ func TestPullRequestsService_GetRaw_patch(t *testing.T) { } func TestPullRequestsService_GetRaw_invalid(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -213,6 +220,7 @@ func TestPullRequestsService_GetRaw_invalid(t *testing.T) { } func TestPullRequestsService_Get_links(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1", func(w http.ResponseWriter, r *http.Request) { @@ -266,6 +274,7 @@ func TestPullRequestsService_Get_links(t *testing.T) { } func TestPullRequestsService_Get_headAndBase(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1", func(w http.ResponseWriter, r *http.Request) { @@ -296,6 +305,7 @@ func TestPullRequestsService_Get_headAndBase(t *testing.T) { } func TestPullRequestsService_Get_urlFields(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1", func(w http.ResponseWriter, r *http.Request) { @@ -335,6 +345,7 @@ func TestPullRequestsService_Get_urlFields(t *testing.T) { } func TestPullRequestsService_Get_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -343,6 +354,7 @@ func TestPullRequestsService_Get_invalidOwner(t *testing.T) { } func TestPullRequestsService_Create(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &NewPullRequest{Title: String("t")} @@ -386,6 +398,7 @@ func TestPullRequestsService_Create(t *testing.T) { } func TestPullRequestsService_Create_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -394,6 +407,7 @@ func TestPullRequestsService_Create_invalidOwner(t *testing.T) { } func TestPullRequestsService_UpdateBranch(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1/update-branch", func(w http.ResponseWriter, r *http.Request) { @@ -441,6 +455,7 @@ func TestPullRequestsService_UpdateBranch(t *testing.T) { } func TestPullRequestsService_Edit(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) tests := []struct { @@ -501,6 +516,7 @@ func TestPullRequestsService_Edit(t *testing.T) { } func TestPullRequestsService_Edit_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -509,6 +525,7 @@ func TestPullRequestsService_Edit_invalidOwner(t *testing.T) { } func TestPullRequestsService_ListCommits(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1/commits", func(w http.ResponseWriter, r *http.Request) { @@ -580,6 +597,7 @@ func TestPullRequestsService_ListCommits(t *testing.T) { } func TestPullRequestsService_ListFiles(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1/files", func(w http.ResponseWriter, r *http.Request) { @@ -656,6 +674,7 @@ func TestPullRequestsService_ListFiles(t *testing.T) { } func TestPullRequestsService_IsMerged(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1/merge", func(w http.ResponseWriter, r *http.Request) { @@ -690,6 +709,7 @@ func TestPullRequestsService_IsMerged(t *testing.T) { } func TestPullRequestsService_Merge(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/1/merge", func(w http.ResponseWriter, r *http.Request) { @@ -735,6 +755,7 @@ func TestPullRequestsService_Merge(t *testing.T) { // Test that different merge options produce expected PUT requests. See issue https://github.com/google/go-github/issues/500. func TestPullRequestsService_Merge_options(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) tests := []struct { @@ -789,6 +810,7 @@ func TestPullRequestsService_Merge_options(t *testing.T) { } func TestPullRequestsService_Merge_Blank_Message(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) madeRequest := false @@ -818,6 +840,7 @@ func TestPullRequestsService_Merge_Blank_Message(t *testing.T) { } func TestPullRequestMergeRequest_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &pullRequestMergeRequest{}, "{}") u := &pullRequestMergeRequest{ @@ -838,6 +861,7 @@ func TestPullRequestMergeRequest_Marshal(t *testing.T) { } func TestPullRequestMergeResult_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PullRequestMergeResult{}, "{}") u := &PullRequestMergeResult{ @@ -856,6 +880,7 @@ func TestPullRequestMergeResult_Marshal(t *testing.T) { } func TestPullRequestUpdate_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &pullRequestUpdate{}, "{}") u := &pullRequestUpdate{ @@ -878,6 +903,7 @@ func TestPullRequestUpdate_Marshal(t *testing.T) { } func TestPullRequestBranchUpdateResponse_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PullRequestBranchUpdateResponse{}, "{}") u := &PullRequestBranchUpdateResponse{ @@ -894,6 +920,7 @@ func TestPullRequestBranchUpdateResponse_Marshal(t *testing.T) { } func TestPullRequestBranchUpdateOptions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PullRequestBranchUpdateOptions{}, "{}") u := &PullRequestBranchUpdateOptions{ @@ -908,6 +935,7 @@ func TestPullRequestBranchUpdateOptions_Marshal(t *testing.T) { } func TestNewPullRequest_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &NewPullRequest{}, "{}") u := &NewPullRequest{ @@ -936,6 +964,7 @@ func TestNewPullRequest_Marshal(t *testing.T) { } func TestPullRequestBranch_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PullRequestBranch{}, "{}") u := &PullRequestBranch{ @@ -998,6 +1027,7 @@ func TestPullRequestBranch_Marshal(t *testing.T) { } func TestPRLink_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PRLink{}, "{}") u := &PRLink{ @@ -1012,6 +1042,7 @@ func TestPRLink_Marshal(t *testing.T) { } func TestPRLinks_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PRLinks{}, "{}") u := &PRLinks{ @@ -1072,6 +1103,7 @@ func TestPRLinks_Marshal(t *testing.T) { } func TestPullRequestAutoMerge_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PullRequestAutoMerge{}, "{}") u := &PullRequestAutoMerge{ @@ -1130,6 +1162,7 @@ func TestPullRequestAutoMerge_Marshal(t *testing.T) { } func TestPullRequest_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PullRequest{}, "{}") u := &PullRequest{ diff --git a/github/pulls_threads_test.go b/github/pulls_threads_test.go index 7c3c8619968..25882a31c31 100644 --- a/github/pulls_threads_test.go +++ b/github/pulls_threads_test.go @@ -11,6 +11,7 @@ import ( ) func TestPullRequestThread_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PullRequestThread{}, "{}") createdAt := Timestamp{time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC)} diff --git a/github/rate_limit_test.go b/github/rate_limit_test.go index fb715f9e51e..241b8ce0982 100644 --- a/github/rate_limit_test.go +++ b/github/rate_limit_test.go @@ -16,6 +16,7 @@ import ( ) func TestRateLimits_String(t *testing.T) { + t.Parallel() v := RateLimits{ Core: &Rate{}, Search: &Rate{}, @@ -36,6 +37,7 @@ func TestRateLimits_String(t *testing.T) { } func TestRateLimits(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/rate_limit", func(w http.ResponseWriter, r *http.Request) { @@ -179,6 +181,7 @@ func TestRateLimits(t *testing.T) { } func TestRateLimits_coverage(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -191,6 +194,7 @@ func TestRateLimits_coverage(t *testing.T) { } func TestRateLimits_overQuota(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) client.rateLimits[CoreCategory] = Rate{ @@ -338,6 +342,7 @@ func TestRateLimits_overQuota(t *testing.T) { } func TestRateLimits_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &RateLimits{}, "{}") u := &RateLimits{ @@ -460,6 +465,7 @@ func TestRateLimits_Marshal(t *testing.T) { } func TestRate_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Rate{}, "{}") u := &Rate{ diff --git a/github/reactions_test.go b/github/reactions_test.go index e2c759c9697..246588674de 100644 --- a/github/reactions_test.go +++ b/github/reactions_test.go @@ -15,6 +15,7 @@ import ( ) func TestReaction_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Reaction{}, "{}") r := &Reaction{ @@ -34,6 +35,7 @@ func TestReaction_Marshal(t *testing.T) { } func TestReactions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Reactions{}, "{}") r := &Reactions{ @@ -66,6 +68,7 @@ func TestReactions_Marshal(t *testing.T) { } func TestReactionsService_ListCommentReactions(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/comments/1/reactions", func(w http.ResponseWriter, r *http.Request) { @@ -103,6 +106,7 @@ func TestReactionsService_ListCommentReactions(t *testing.T) { } func TestReactionsService_CreateCommentReaction(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/comments/1/reactions", func(w http.ResponseWriter, r *http.Request) { @@ -139,6 +143,7 @@ func TestReactionsService_CreateCommentReaction(t *testing.T) { } func TestReactionsService_ListIssueReactions(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/1/reactions", func(w http.ResponseWriter, r *http.Request) { @@ -161,6 +166,7 @@ func TestReactionsService_ListIssueReactions(t *testing.T) { } func TestReactionsService_ListIssueReactions_coverage(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -181,6 +187,7 @@ func TestReactionsService_ListIssueReactions_coverage(t *testing.T) { } func TestReactionsService_CreateIssueReaction(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/1/reactions", func(w http.ResponseWriter, r *http.Request) { @@ -217,6 +224,7 @@ func TestReactionsService_CreateIssueReaction(t *testing.T) { } func TestReactionsService_ListIssueCommentReactions(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/comments/1/reactions", func(w http.ResponseWriter, r *http.Request) { @@ -239,6 +247,7 @@ func TestReactionsService_ListIssueCommentReactions(t *testing.T) { } func TestReactionsService_ListIssueCommentReactions_coverage(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -259,6 +268,7 @@ func TestReactionsService_ListIssueCommentReactions_coverage(t *testing.T) { } func TestReactionsService_CreateIssueCommentReaction(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/comments/1/reactions", func(w http.ResponseWriter, r *http.Request) { @@ -295,6 +305,7 @@ func TestReactionsService_CreateIssueCommentReaction(t *testing.T) { } func TestReactionsService_ListPullRequestCommentReactions(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/comments/1/reactions", func(w http.ResponseWriter, r *http.Request) { @@ -317,6 +328,7 @@ func TestReactionsService_ListPullRequestCommentReactions(t *testing.T) { } func TestReactionsService_ListPullRequestCommentReactions_coverage(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -337,6 +349,7 @@ func TestReactionsService_ListPullRequestCommentReactions_coverage(t *testing.T) } func TestReactionsService_CreatePullRequestCommentReaction(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/comments/1/reactions", func(w http.ResponseWriter, r *http.Request) { @@ -373,6 +386,7 @@ func TestReactionsService_CreatePullRequestCommentReaction(t *testing.T) { } func TestReactionsService_ListTeamDiscussionReactions(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/teams/1/discussions/2/reactions", func(w http.ResponseWriter, r *http.Request) { @@ -395,6 +409,7 @@ func TestReactionsService_ListTeamDiscussionReactions(t *testing.T) { } func TestReactionsService_ListTeamDiscussionReactions_coverage(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -415,6 +430,7 @@ func TestReactionsService_ListTeamDiscussionReactions_coverage(t *testing.T) { } func TestReactionsService_CreateTeamDiscussionReaction(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/teams/1/discussions/2/reactions", func(w http.ResponseWriter, r *http.Request) { @@ -451,6 +467,7 @@ func TestReactionsService_CreateTeamDiscussionReaction(t *testing.T) { } func TestReactionService_ListTeamDiscussionCommentReactions(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/teams/1/discussions/2/comments/3/reactions", func(w http.ResponseWriter, r *http.Request) { @@ -473,6 +490,7 @@ func TestReactionService_ListTeamDiscussionCommentReactions(t *testing.T) { } func TestReactionService_ListTeamDiscussionCommentReactions_coverage(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -493,6 +511,7 @@ func TestReactionService_ListTeamDiscussionCommentReactions_coverage(t *testing. } func TestReactionService_CreateTeamDiscussionCommentReaction(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/teams/1/discussions/2/comments/3/reactions", func(w http.ResponseWriter, r *http.Request) { @@ -529,6 +548,7 @@ func TestReactionService_CreateTeamDiscussionCommentReaction(t *testing.T) { } func TestReactionsService_DeleteCommitCommentReaction(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/comments/1/reactions/2", func(w http.ResponseWriter, r *http.Request) { @@ -555,6 +575,7 @@ func TestReactionsService_DeleteCommitCommentReaction(t *testing.T) { } func TestReactionsService_DeleteCommitCommentReactionByRepoID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repositories/1/comments/2/reactions/3", func(w http.ResponseWriter, r *http.Request) { @@ -581,6 +602,7 @@ func TestReactionsService_DeleteCommitCommentReactionByRepoID(t *testing.T) { } func TestReactionsService_DeleteIssueReaction(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/1/reactions/2", func(w http.ResponseWriter, r *http.Request) { @@ -607,6 +629,7 @@ func TestReactionsService_DeleteIssueReaction(t *testing.T) { } func TestReactionsService_DeleteIssueReactionByRepoID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repositories/1/issues/2/reactions/3", func(w http.ResponseWriter, r *http.Request) { @@ -633,6 +656,7 @@ func TestReactionsService_DeleteIssueReactionByRepoID(t *testing.T) { } func TestReactionsService_DeleteIssueCommentReaction(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/issues/comments/1/reactions/2", func(w http.ResponseWriter, r *http.Request) { @@ -659,6 +683,7 @@ func TestReactionsService_DeleteIssueCommentReaction(t *testing.T) { } func TestReactionsService_DeleteIssueCommentReactionByRepoID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repositories/1/issues/comments/2/reactions/3", func(w http.ResponseWriter, r *http.Request) { @@ -685,6 +710,7 @@ func TestReactionsService_DeleteIssueCommentReactionByRepoID(t *testing.T) { } func TestReactionsService_DeletePullRequestCommentReaction(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pulls/comments/1/reactions/2", func(w http.ResponseWriter, r *http.Request) { @@ -711,6 +737,7 @@ func TestReactionsService_DeletePullRequestCommentReaction(t *testing.T) { } func TestReactionsService_DeletePullRequestCommentReactionByRepoID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repositories/1/pulls/comments/2/reactions/3", func(w http.ResponseWriter, r *http.Request) { @@ -737,6 +764,7 @@ func TestReactionsService_DeletePullRequestCommentReactionByRepoID(t *testing.T) } func TestReactionsService_DeleteTeamDiscussionReaction(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s/discussions/1/reactions/2", func(w http.ResponseWriter, r *http.Request) { @@ -763,6 +791,7 @@ func TestReactionsService_DeleteTeamDiscussionReaction(t *testing.T) { } func TestReactionsService_DeleteTeamDiscussionReactionByTeamIDAndOrgID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/2/discussions/3/reactions/4", func(w http.ResponseWriter, r *http.Request) { @@ -789,6 +818,7 @@ func TestReactionsService_DeleteTeamDiscussionReactionByTeamIDAndOrgID(t *testin } func TestReactionsService_DeleteTeamDiscussionCommentReaction(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s/discussions/1/comments/2/reactions/3", func(w http.ResponseWriter, r *http.Request) { @@ -815,6 +845,7 @@ func TestReactionsService_DeleteTeamDiscussionCommentReaction(t *testing.T) { } func TestReactionsService_DeleteTeamDiscussionCommentReactionByTeamIDAndOrgID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/2/discussions/3/comments/4/reactions/5", func(w http.ResponseWriter, r *http.Request) { @@ -841,6 +872,7 @@ func TestReactionsService_DeleteTeamDiscussionCommentReactionByTeamIDAndOrgID(t } func TestReactionService_CreateReleaseReaction(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/releases/1/reactions", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/repos_actions_access_test.go b/github/repos_actions_access_test.go index ae80790e790..9d30f78b84b 100644 --- a/github/repos_actions_access_test.go +++ b/github/repos_actions_access_test.go @@ -16,6 +16,7 @@ import ( ) func TestRepositoriesService_GetActionsAccessLevel(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/permissions/access", func(w http.ResponseWriter, r *http.Request) { @@ -49,6 +50,7 @@ func TestRepositoriesService_GetActionsAccessLevel(t *testing.T) { } func TestRepositoriesService_EditActionsAccessLevel(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &RepositoryActionsAccessLevel{AccessLevel: String("organization")} @@ -82,6 +84,7 @@ func TestRepositoriesService_EditActionsAccessLevel(t *testing.T) { } func TestRepositoryActionsAccessLevel_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ActionsPermissions{}, "{}") u := &RepositoryActionsAccessLevel{ diff --git a/github/repos_actions_allowed_test.go b/github/repos_actions_allowed_test.go index 0ea6e731af8..f9d22797116 100644 --- a/github/repos_actions_allowed_test.go +++ b/github/repos_actions_allowed_test.go @@ -16,6 +16,7 @@ import ( ) func TestRepositoryService_GetActionsAllowed(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/permissions/selected-actions", func(w http.ResponseWriter, r *http.Request) { @@ -49,6 +50,7 @@ func TestRepositoryService_GetActionsAllowed(t *testing.T) { } func TestRepositoriesService_EditActionsAllowed(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &ActionsAllowed{GithubOwnedAllowed: Bool(true), VerifiedAllowed: Bool(false), PatternsAllowed: []string{"a/b"}} diff --git a/github/repos_actions_permissions_test.go b/github/repos_actions_permissions_test.go index bfda30646f8..9e10928292a 100644 --- a/github/repos_actions_permissions_test.go +++ b/github/repos_actions_permissions_test.go @@ -16,6 +16,7 @@ import ( ) func TestRepositoriesService_GetActionsPermissions(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/permissions", func(w http.ResponseWriter, r *http.Request) { @@ -49,6 +50,7 @@ func TestRepositoriesService_GetActionsPermissions(t *testing.T) { } func TestRepositoriesService_EditActionsPermissions(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &ActionsPermissionsRepository{Enabled: Bool(true), AllowedActions: String("selected")} @@ -92,6 +94,7 @@ func TestRepositoriesService_EditActionsPermissions(t *testing.T) { } func TestActionsPermissionsRepository_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ActionsPermissions{}, "{}") u := &ActionsPermissionsRepository{ @@ -110,6 +113,7 @@ func TestActionsPermissionsRepository_Marshal(t *testing.T) { } func TestRepositoriesService_GetDefaultWorkflowPermissions(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/actions/permissions/workflow", func(w http.ResponseWriter, r *http.Request) { @@ -143,6 +147,7 @@ func TestRepositoriesService_GetDefaultWorkflowPermissions(t *testing.T) { } func TestRepositoriesService_EditDefaultWorkflowPermissions(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &DefaultWorkflowPermissionRepository{DefaultWorkflowPermissions: String("read"), CanApprovePullRequestReviews: Bool(true)} diff --git a/github/repos_autolinks_test.go b/github/repos_autolinks_test.go index 10011e315fd..1cf7a968f2a 100644 --- a/github/repos_autolinks_test.go +++ b/github/repos_autolinks_test.go @@ -16,6 +16,7 @@ import ( ) func TestRepositoriesService_ListAutolinks(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/autolinks", func(w http.ResponseWriter, r *http.Request) { @@ -58,6 +59,7 @@ func TestRepositoriesService_ListAutolinks(t *testing.T) { } func TestRepositoriesService_AddAutolink(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) opt := &AutolinkOptions{ @@ -112,6 +114,7 @@ func TestRepositoriesService_AddAutolink(t *testing.T) { } func TestRepositoriesService_GetAutolink(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/autolinks/1", func(w http.ResponseWriter, r *http.Request) { @@ -141,6 +144,7 @@ func TestRepositoriesService_GetAutolink(t *testing.T) { } func TestRepositoriesService_DeleteAutolink(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/autolinks/1", func(w http.ResponseWriter, r *http.Request) { @@ -161,6 +165,7 @@ func TestRepositoriesService_DeleteAutolink(t *testing.T) { } func TestAutolinkOptions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &AutolinkOptions{}, "{}") r := &AutolinkOptions{ @@ -179,6 +184,7 @@ func TestAutolinkOptions_Marshal(t *testing.T) { } func TestAutolink_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Autolink{}, "{}") r := &Autolink{ diff --git a/github/repos_codeowners_test.go b/github/repos_codeowners_test.go index 59709a71bb2..f3ced1ca41a 100644 --- a/github/repos_codeowners_test.go +++ b/github/repos_codeowners_test.go @@ -15,6 +15,7 @@ import ( ) func TestRepositoriesService_GetCodeownersErrors_noRef(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/codeowners/errors", func(w http.ResponseWriter, r *http.Request) { @@ -75,6 +76,7 @@ func TestRepositoriesService_GetCodeownersErrors_noRef(t *testing.T) { } func TestRepositoriesService_GetCodeownersErrors_specificRef(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/codeowners/errors", func(w http.ResponseWriter, r *http.Request) { @@ -137,6 +139,7 @@ func TestRepositoriesService_GetCodeownersErrors_specificRef(t *testing.T) { } func TestCodeownersErrors_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &CodeownersErrors{}, "{}") u := &CodeownersErrors{ diff --git a/github/repos_collaborators_test.go b/github/repos_collaborators_test.go index 2943448a574..1aa9a6fb9bf 100644 --- a/github/repos_collaborators_test.go +++ b/github/repos_collaborators_test.go @@ -16,6 +16,7 @@ import ( ) func TestRepositoriesService_ListCollaborators(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/collaborators", func(w http.ResponseWriter, r *http.Request) { @@ -54,6 +55,7 @@ func TestRepositoriesService_ListCollaborators(t *testing.T) { } func TestRepositoriesService_ListCollaborators_withAffiliation(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/collaborators", func(w http.ResponseWriter, r *http.Request) { @@ -93,6 +95,7 @@ func TestRepositoriesService_ListCollaborators_withAffiliation(t *testing.T) { } func TestRepositoriesService_ListCollaborators_withPermission(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/collaborators", func(w http.ResponseWriter, r *http.Request) { @@ -132,6 +135,7 @@ func TestRepositoriesService_ListCollaborators_withPermission(t *testing.T) { } func TestRepositoriesService_ListCollaborators_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -140,6 +144,7 @@ func TestRepositoriesService_ListCollaborators_invalidOwner(t *testing.T) { } func TestRepositoriesService_IsCollaborator_True(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/collaborators/u", func(w http.ResponseWriter, r *http.Request) { @@ -173,6 +178,7 @@ func TestRepositoriesService_IsCollaborator_True(t *testing.T) { } func TestRepositoriesService_IsCollaborator_False(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/collaborators/u", func(w http.ResponseWriter, r *http.Request) { @@ -206,6 +212,7 @@ func TestRepositoriesService_IsCollaborator_False(t *testing.T) { } func TestRepositoriesService_IsCollaborator_invalidUser(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -214,6 +221,7 @@ func TestRepositoriesService_IsCollaborator_invalidUser(t *testing.T) { } func TestRepositoryService_GetPermissionLevel(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/collaborators/u/permission", func(w http.ResponseWriter, r *http.Request) { @@ -254,6 +262,7 @@ func TestRepositoryService_GetPermissionLevel(t *testing.T) { } func TestRepositoriesService_AddCollaborator(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) opt := &RepositoryAddCollaboratorOptions{Permission: "admin"} @@ -310,6 +319,7 @@ func TestRepositoriesService_AddCollaborator(t *testing.T) { } func TestRepositoriesService_AddCollaborator_invalidUser(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -318,6 +328,7 @@ func TestRepositoriesService_AddCollaborator_invalidUser(t *testing.T) { } func TestRepositoriesService_RemoveCollaborator(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/collaborators/u", func(w http.ResponseWriter, r *http.Request) { @@ -343,6 +354,7 @@ func TestRepositoriesService_RemoveCollaborator(t *testing.T) { } func TestRepositoriesService_RemoveCollaborator_invalidUser(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -351,6 +363,7 @@ func TestRepositoriesService_RemoveCollaborator_invalidUser(t *testing.T) { } func TestRepositoryAddCollaboratorOptions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &RepositoryAddCollaboratorOptions{}, "{}") r := &RepositoryAddCollaboratorOptions{ @@ -365,6 +378,7 @@ func TestRepositoryAddCollaboratorOptions_Marshal(t *testing.T) { } func TestRepositoryPermissionLevel_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &RepositoryPermissionLevel{}, "{}") r := &RepositoryPermissionLevel{ @@ -419,6 +433,7 @@ func TestRepositoryPermissionLevel_Marshal(t *testing.T) { } func TestCollaboratorInvitation_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &CollaboratorInvitation{}, "{}") r := &CollaboratorInvitation{ diff --git a/github/repos_comments_test.go b/github/repos_comments_test.go index 57033487ed9..5daf3c53dd7 100644 --- a/github/repos_comments_test.go +++ b/github/repos_comments_test.go @@ -16,6 +16,7 @@ import ( ) func TestRepositoriesService_ListComments(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/comments", func(w http.ResponseWriter, r *http.Request) { @@ -53,6 +54,7 @@ func TestRepositoriesService_ListComments(t *testing.T) { } func TestRepositoriesService_ListComments_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -61,6 +63,7 @@ func TestRepositoriesService_ListComments_invalidOwner(t *testing.T) { } func TestRepositoriesService_ListCommitComments(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/commits/s/comments", func(w http.ResponseWriter, r *http.Request) { @@ -98,6 +101,7 @@ func TestRepositoriesService_ListCommitComments(t *testing.T) { } func TestRepositoriesService_ListCommitComments_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -106,6 +110,7 @@ func TestRepositoriesService_ListCommitComments_invalidOwner(t *testing.T) { } func TestRepositoriesService_CreateComment(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &RepositoryComment{Body: String("b")} @@ -149,6 +154,7 @@ func TestRepositoriesService_CreateComment(t *testing.T) { } func TestRepositoriesService_CreateComment_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -157,6 +163,7 @@ func TestRepositoriesService_CreateComment_invalidOwner(t *testing.T) { } func TestRepositoriesService_GetComment(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/comments/1", func(w http.ResponseWriter, r *http.Request) { @@ -192,6 +199,7 @@ func TestRepositoriesService_GetComment(t *testing.T) { } func TestRepositoriesService_GetComment_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -200,6 +208,7 @@ func TestRepositoriesService_GetComment_invalidOwner(t *testing.T) { } func TestRepositoriesService_UpdateComment(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &RepositoryComment{Body: String("b")} @@ -243,6 +252,7 @@ func TestRepositoriesService_UpdateComment(t *testing.T) { } func TestRepositoriesService_UpdateComment_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -251,6 +261,7 @@ func TestRepositoriesService_UpdateComment_invalidOwner(t *testing.T) { } func TestRepositoriesService_DeleteComment(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/comments/1", func(w http.ResponseWriter, r *http.Request) { @@ -275,6 +286,7 @@ func TestRepositoriesService_DeleteComment(t *testing.T) { } func TestRepositoriesService_DeleteComment_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -283,6 +295,7 @@ func TestRepositoriesService_DeleteComment_invalidOwner(t *testing.T) { } func TestRepositoryComment_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &RepositoryComment{}, "{}") r := &RepositoryComment{ diff --git a/github/repos_commits_test.go b/github/repos_commits_test.go index 99428aa9b3b..08326d2715c 100644 --- a/github/repos_commits_test.go +++ b/github/repos_commits_test.go @@ -18,6 +18,7 @@ import ( ) func TestRepositoriesService_ListCommits(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) // given @@ -68,6 +69,7 @@ func TestRepositoriesService_ListCommits(t *testing.T) { } func TestRepositoriesService_GetCommit(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/commits/s", func(w http.ResponseWriter, r *http.Request) { @@ -158,6 +160,7 @@ func TestRepositoriesService_GetCommit(t *testing.T) { } func TestRepositoriesService_GetCommitRaw_diff(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) const rawStr = "@@diff content" @@ -194,6 +197,7 @@ func TestRepositoriesService_GetCommitRaw_diff(t *testing.T) { } func TestRepositoriesService_GetCommitRaw_patch(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) const rawStr = "@@patch content" @@ -216,6 +220,7 @@ func TestRepositoriesService_GetCommitRaw_patch(t *testing.T) { } func TestRepositoriesService_GetCommitRaw_invalid(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -229,6 +234,7 @@ func TestRepositoriesService_GetCommitRaw_invalid(t *testing.T) { } func TestRepositoriesService_GetCommitSHA1(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) const sha1 = "01234abcde" @@ -285,6 +291,7 @@ func TestRepositoriesService_GetCommitSHA1(t *testing.T) { } func TestRepositoriesService_NonAlphabetCharacter_GetCommitSHA1(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) const sha1 = "01234abcde" @@ -325,6 +332,7 @@ func TestRepositoriesService_NonAlphabetCharacter_GetCommitSHA1(t *testing.T) { } func TestRepositoriesService_TrailingPercent_GetCommitSHA1(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) const sha1 = "01234abcde" @@ -365,6 +373,7 @@ func TestRepositoriesService_TrailingPercent_GetCommitSHA1(t *testing.T) { } func TestRepositoriesService_CompareCommits(t *testing.T) { + t.Parallel() testCases := []struct { base string head string @@ -375,7 +384,9 @@ func TestRepositoriesService_CompareCommits(t *testing.T) { } for i, sample := range testCases { + sample := sample t.Run(fmt.Sprintf("case #%v", i+1), func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) base := sample.base @@ -500,6 +511,7 @@ func TestRepositoriesService_CompareCommits(t *testing.T) { } func TestRepositoriesService_CompareCommitsRaw_diff(t *testing.T) { + t.Parallel() testCases := []struct { base string head string @@ -510,7 +522,9 @@ func TestRepositoriesService_CompareCommitsRaw_diff(t *testing.T) { } for i, sample := range testCases { + sample := sample t.Run(fmt.Sprintf("case #%v", i+1), func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) base := sample.base @@ -552,6 +566,7 @@ func TestRepositoriesService_CompareCommitsRaw_diff(t *testing.T) { } func TestRepositoriesService_CompareCommitsRaw_patch(t *testing.T) { + t.Parallel() testCases := []struct { base string head string @@ -562,7 +577,9 @@ func TestRepositoriesService_CompareCommitsRaw_patch(t *testing.T) { } for i, sample := range testCases { + sample := sample t.Run(fmt.Sprintf("case #%v", i+1), func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) base := sample.base @@ -590,6 +607,7 @@ func TestRepositoriesService_CompareCommitsRaw_patch(t *testing.T) { } func TestRepositoriesService_CompareCommitsRaw_invalid(t *testing.T) { + t.Parallel() ctx := context.Background() testCases := []struct { @@ -602,7 +620,9 @@ func TestRepositoriesService_CompareCommitsRaw_invalid(t *testing.T) { } for i, sample := range testCases { + sample := sample t.Run(fmt.Sprintf("case #%v", i+1), func(t *testing.T) { + t.Parallel() client, _, _ := setup(t) _, _, err := client.Repositories.CompareCommitsRaw(ctx, "o", "r", sample.base, sample.head, RawOptions{100}) if err == nil { @@ -616,6 +636,7 @@ func TestRepositoriesService_CompareCommitsRaw_invalid(t *testing.T) { } func TestRepositoriesService_ListBranchesHeadCommit(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/commits/s/branches-where-head", func(w http.ResponseWriter, r *http.Request) { @@ -659,6 +680,7 @@ func TestRepositoriesService_ListBranchesHeadCommit(t *testing.T) { } func TestBranchCommit_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &BranchCommit{}, "{}") r := &BranchCommit{ @@ -766,6 +788,7 @@ func TestBranchCommit_Marshal(t *testing.T) { } func TestCommitsComparison_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &CommitsComparison{}, "{}") r := &CommitsComparison{ @@ -824,6 +847,7 @@ func TestCommitsComparison_Marshal(t *testing.T) { } func TestCommitFile_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &CommitFile{}, "{}") r := &CommitFile{ @@ -858,6 +882,7 @@ func TestCommitFile_Marshal(t *testing.T) { } func TestCommitStats_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &CommitStats{}, "{}") r := &CommitStats{ @@ -876,6 +901,7 @@ func TestCommitStats_Marshal(t *testing.T) { } func TestRepositoryCommit_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &RepositoryCommit{}, "{}") r := &RepositoryCommit{ diff --git a/github/repos_community_health_test.go b/github/repos_community_health_test.go index c5af84f8075..4d4a4d86ee0 100644 --- a/github/repos_community_health_test.go +++ b/github/repos_community_health_test.go @@ -16,6 +16,7 @@ import ( ) func TestRepositoriesService_GetCommunityHealthMetrics(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/community/profile", func(w http.ResponseWriter, r *http.Request) { @@ -133,6 +134,7 @@ func TestRepositoriesService_GetCommunityHealthMetrics(t *testing.T) { } func TestMetric_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Metric{}, "{}") r := &Metric{ @@ -157,6 +159,7 @@ func TestMetric_Marshal(t *testing.T) { } func TestCommunityHealthFiles_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &CommunityHealthFiles{}, "{}") r := &CommunityHealthFiles{ @@ -257,6 +260,7 @@ func TestCommunityHealthFiles_Marshal(t *testing.T) { } func TestCommunityHealthMetrics_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &CommunityHealthMetrics{}, "{}") r := &CommunityHealthMetrics{ diff --git a/github/repos_contents_test.go b/github/repos_contents_test.go index 0e30c1bc13d..cf139d77d61 100644 --- a/github/repos_contents_test.go +++ b/github/repos_contents_test.go @@ -18,6 +18,7 @@ import ( ) func TestRepositoryContent_GetContent(t *testing.T) { + t.Parallel() tests := []struct { encoding, content *string // input encoding and content want string // desired output @@ -88,6 +89,7 @@ func stringOrNil(s *string) string { } func TestRepositoriesService_GetReadme(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/readme", func(w http.ResponseWriter, r *http.Request) { @@ -126,6 +128,7 @@ func TestRepositoriesService_GetReadme(t *testing.T) { } func TestRepositoriesService_DownloadContents_Success(t *testing.T) { + t.Parallel() client, mux, serverURL := setup(t) mux.HandleFunc("/repos/o/r/contents/d", func(w http.ResponseWriter, r *http.Request) { @@ -177,6 +180,7 @@ func TestRepositoriesService_DownloadContents_Success(t *testing.T) { } func TestRepositoriesService_DownloadContents_FailedResponse(t *testing.T) { + t.Parallel() client, mux, serverURL := setup(t) mux.HandleFunc("/repos/o/r/contents/d", func(w http.ResponseWriter, r *http.Request) { @@ -215,6 +219,7 @@ func TestRepositoriesService_DownloadContents_FailedResponse(t *testing.T) { } func TestRepositoriesService_DownloadContents_NoDownloadURL(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/contents/d", func(w http.ResponseWriter, r *http.Request) { @@ -237,6 +242,7 @@ func TestRepositoriesService_DownloadContents_NoDownloadURL(t *testing.T) { } func TestRepositoriesService_DownloadContents_NoFile(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/contents/d", func(w http.ResponseWriter, r *http.Request) { @@ -256,6 +262,7 @@ func TestRepositoriesService_DownloadContents_NoFile(t *testing.T) { } func TestRepositoriesService_DownloadContentsWithMeta_Success(t *testing.T) { + t.Parallel() client, mux, serverURL := setup(t) mux.HandleFunc("/repos/o/r/contents/d", func(w http.ResponseWriter, r *http.Request) { @@ -318,6 +325,7 @@ func TestRepositoriesService_DownloadContentsWithMeta_Success(t *testing.T) { } func TestRepositoriesService_DownloadContentsWithMeta_FailedResponse(t *testing.T) { + t.Parallel() client, mux, serverURL := setup(t) mux.HandleFunc("/repos/o/r/contents/d", func(w http.ResponseWriter, r *http.Request) { @@ -364,6 +372,7 @@ func TestRepositoriesService_DownloadContentsWithMeta_FailedResponse(t *testing. } func TestRepositoriesService_DownloadContentsWithMeta_NoDownloadURL(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/contents/d", func(w http.ResponseWriter, r *http.Request) { @@ -386,6 +395,7 @@ func TestRepositoriesService_DownloadContentsWithMeta_NoDownloadURL(t *testing.T } func TestRepositoriesService_DownloadContentsWithMeta_NoFile(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/contents/d", func(w http.ResponseWriter, r *http.Request) { @@ -405,6 +415,7 @@ func TestRepositoriesService_DownloadContentsWithMeta_NoFile(t *testing.T) { } func TestRepositoriesService_GetContents_File(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/contents/p", func(w http.ResponseWriter, r *http.Request) { @@ -443,6 +454,7 @@ func TestRepositoriesService_GetContents_File(t *testing.T) { } func TestRepositoriesService_GetContents_FilenameNeedsEscape(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/contents/p#?%/中.go", func(w http.ResponseWriter, r *http.Request) { @@ -457,6 +469,7 @@ func TestRepositoriesService_GetContents_FilenameNeedsEscape(t *testing.T) { } func TestRepositoriesService_GetContents_DirectoryWithSpaces(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/contents/some directory/file.go", func(w http.ResponseWriter, r *http.Request) { @@ -471,6 +484,7 @@ func TestRepositoriesService_GetContents_DirectoryWithSpaces(t *testing.T) { } func TestRepositoriesService_GetContents_PathWithParent(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/contents/some/../directory/file.go", func(w http.ResponseWriter, r *http.Request) { @@ -485,6 +499,7 @@ func TestRepositoriesService_GetContents_PathWithParent(t *testing.T) { } func TestRepositoriesService_GetContents_DirectoryWithPlusChars(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/contents/some directory+name/file.go", func(w http.ResponseWriter, r *http.Request) { @@ -499,6 +514,7 @@ func TestRepositoriesService_GetContents_DirectoryWithPlusChars(t *testing.T) { } func TestRepositoriesService_GetContents_Directory(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/contents/p", func(w http.ResponseWriter, r *http.Request) { @@ -528,6 +544,7 @@ func TestRepositoriesService_GetContents_Directory(t *testing.T) { } func TestRepositoriesService_CreateFile(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/contents/p", func(w http.ResponseWriter, r *http.Request) { @@ -581,6 +598,7 @@ func TestRepositoriesService_CreateFile(t *testing.T) { } func TestRepositoriesService_UpdateFile(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/contents/p", func(w http.ResponseWriter, r *http.Request) { @@ -636,6 +654,7 @@ func TestRepositoriesService_UpdateFile(t *testing.T) { } func TestRepositoriesService_DeleteFile(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/contents/p", func(w http.ResponseWriter, r *http.Request) { @@ -687,6 +706,7 @@ func TestRepositoriesService_DeleteFile(t *testing.T) { } func TestRepositoriesService_GetArchiveLink(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/tarball/yo", func(w http.ResponseWriter, r *http.Request) { @@ -723,6 +743,7 @@ func TestRepositoriesService_GetArchiveLink(t *testing.T) { } func TestRepositoriesService_GetArchiveLink_StatusMovedPermanently_dontFollowRedirects(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/tarball", func(w http.ResponseWriter, r *http.Request) { @@ -737,6 +758,7 @@ func TestRepositoriesService_GetArchiveLink_StatusMovedPermanently_dontFollowRed } func TestRepositoriesService_GetArchiveLink_StatusMovedPermanently_followRedirects(t *testing.T) { + t.Parallel() client, mux, serverURL := setup(t) // Mock a redirect link, which leads to an archive link @@ -764,6 +786,7 @@ func TestRepositoriesService_GetArchiveLink_StatusMovedPermanently_followRedirec } func TestRepositoriesService_GetContents_NoTrailingSlashInDirectoryApiPath(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/contents/.github", func(w http.ResponseWriter, r *http.Request) { @@ -784,6 +807,7 @@ func TestRepositoriesService_GetContents_NoTrailingSlashInDirectoryApiPath(t *te } func TestRepositoryContent_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &RepositoryContent{}, "{}") r := &RepositoryContent{ @@ -822,6 +846,7 @@ func TestRepositoryContent_Marshal(t *testing.T) { } func TestRepositoryContentResponse_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &RepositoryContentResponse{}, "{}") r := &RepositoryContentResponse{ @@ -955,6 +980,7 @@ func TestRepositoryContentResponse_Marshal(t *testing.T) { } func TestRepositoryContentFileOptions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &RepositoryContentFileOptions{}, "{}") r := &RepositoryContentFileOptions{ diff --git a/github/repos_deployment_branch_policies_test.go b/github/repos_deployment_branch_policies_test.go index 047d77a77fb..355bcb442e4 100644 --- a/github/repos_deployment_branch_policies_test.go +++ b/github/repos_deployment_branch_policies_test.go @@ -14,6 +14,7 @@ import ( ) func TestRepositoriesService_ListDeploymentBranchPolicies(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/environments/e/deployment-branch-policies", func(w http.ResponseWriter, r *http.Request) { @@ -48,6 +49,7 @@ func TestRepositoriesService_ListDeploymentBranchPolicies(t *testing.T) { } func TestRepositoriesService_GetDeploymentBranchPolicy(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/environments/e/deployment-branch-policies/1", func(w http.ResponseWriter, r *http.Request) { @@ -76,6 +78,7 @@ func TestRepositoriesService_GetDeploymentBranchPolicy(t *testing.T) { } func TestRepositoriesService_CreateDeploymentBranchPolicy(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/environments/e/deployment-branch-policies", func(w http.ResponseWriter, r *http.Request) { @@ -105,6 +108,7 @@ func TestRepositoriesService_CreateDeploymentBranchPolicy(t *testing.T) { } func TestRepositoriesService_UpdateDeploymentBranchPolicy(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/environments/e/deployment-branch-policies/1", func(w http.ResponseWriter, r *http.Request) { @@ -134,6 +138,7 @@ func TestRepositoriesService_UpdateDeploymentBranchPolicy(t *testing.T) { } func TestRepositoriesService_DeleteDeploymentBranchPolicy(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/environments/e/deployment-branch-policies/1", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/repos_deployment_protection_rules_test.go b/github/repos_deployment_protection_rules_test.go index b0073c1ac64..5677d5f8afc 100644 --- a/github/repos_deployment_protection_rules_test.go +++ b/github/repos_deployment_protection_rules_test.go @@ -17,6 +17,7 @@ import ( ) func TestRepositoriesService_GetAllDeploymentProtectionRules(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/environments/e/deployment_protection_rules", func(w http.ResponseWriter, r *http.Request) { @@ -52,6 +53,7 @@ func TestRepositoriesService_GetAllDeploymentProtectionRules(t *testing.T) { } func TestRepositoriesService_CreateCustomDeploymentProtectionRule(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &CustomDeploymentProtectionRuleRequest{ @@ -108,6 +110,7 @@ func TestRepositoriesService_CreateCustomDeploymentProtectionRule(t *testing.T) } func TestRepositoriesService_ListCustomDeploymentRuleIntegrations(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/environments/e/deployment_protection_rules/apps", func(w http.ResponseWriter, r *http.Request) { @@ -143,6 +146,7 @@ func TestRepositoriesService_ListCustomDeploymentRuleIntegrations(t *testing.T) } func TestRepositoriesService_GetCustomDeploymentProtectionRule(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/environments/e/deployment_protection_rules/1", func(w http.ResponseWriter, r *http.Request) { @@ -183,6 +187,7 @@ func TestRepositoriesService_GetCustomDeploymentProtectionRule(t *testing.T) { } func TestRepositoriesService_DisableCustomDeploymentProtectionRule(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/environments/e/deployment_protection_rules/1", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/repos_deployments_test.go b/github/repos_deployments_test.go index 3c87bb8524a..722d31d9037 100644 --- a/github/repos_deployments_test.go +++ b/github/repos_deployments_test.go @@ -17,6 +17,7 @@ import ( ) func TestRepositoriesService_ListDeployments(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/deployments", func(w http.ResponseWriter, r *http.Request) { @@ -53,6 +54,7 @@ func TestRepositoriesService_ListDeployments(t *testing.T) { } func TestRepositoriesService_GetDeployment(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/deployments/3", func(w http.ResponseWriter, r *http.Request) { @@ -88,6 +90,7 @@ func TestRepositoriesService_GetDeployment(t *testing.T) { } func TestRepositoriesService_CreateDeployment(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &DeploymentRequest{Ref: String("1111"), Task: String("deploy"), TransientEnvironment: Bool(true)} @@ -133,6 +136,7 @@ func TestRepositoriesService_CreateDeployment(t *testing.T) { } func TestRepositoriesService_DeleteDeployment(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/deployments/1", func(w http.ResponseWriter, r *http.Request) { @@ -169,6 +173,7 @@ func TestRepositoriesService_DeleteDeployment(t *testing.T) { } func TestRepositoriesService_ListDeploymentStatuses(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) wantAcceptHeaders := []string{mediaTypeDeploymentStatusPreview, mediaTypeExpandDeploymentStatusPreview} @@ -207,6 +212,7 @@ func TestRepositoriesService_ListDeploymentStatuses(t *testing.T) { } func TestRepositoriesService_GetDeploymentStatus(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) wantAcceptHeaders := []string{mediaTypeDeploymentStatusPreview, mediaTypeExpandDeploymentStatusPreview} @@ -243,6 +249,7 @@ func TestRepositoriesService_GetDeploymentStatus(t *testing.T) { } func TestRepositoriesService_CreateDeploymentStatus(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &DeploymentStatusRequest{State: String("inactive"), Description: String("deploy"), AutoInactive: Bool(false)} @@ -288,6 +295,7 @@ func TestRepositoriesService_CreateDeploymentStatus(t *testing.T) { } func TestDeploymentStatusRequest_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &DeploymentStatusRequest{}, "{}") r := &DeploymentStatusRequest{ @@ -312,6 +320,7 @@ func TestDeploymentStatusRequest_Marshal(t *testing.T) { } func TestDeploymentStatus_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &DeploymentStatus{}, "{}") r := &DeploymentStatus{ @@ -390,6 +399,7 @@ func TestDeploymentStatus_Marshal(t *testing.T) { } func TestDeploymentRequest_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &DeploymentRequest{}, "{}") r := &DeploymentRequest{ @@ -420,6 +430,7 @@ func TestDeploymentRequest_Marshal(t *testing.T) { } func TestDeployment_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Deployment{}, "{}") str := "s" diff --git a/github/repos_environments_test.go b/github/repos_environments_test.go index 8d093fe272e..34b02ca8637 100644 --- a/github/repos_environments_test.go +++ b/github/repos_environments_test.go @@ -16,6 +16,7 @@ import ( ) func TestRequiredReviewer_UnmarshalJSON(t *testing.T) { + t.Parallel() var testCases = map[string]struct { data []byte wantRule []*RequiredReviewer @@ -69,7 +70,9 @@ func TestRequiredReviewer_UnmarshalJSON(t *testing.T) { } for name, test := range testCases { + test := test t.Run(name, func(t *testing.T) { + t.Parallel() rule := []*RequiredReviewer{} err := json.Unmarshal(test.data, &rule) if err != nil && !test.wantError { @@ -86,6 +89,7 @@ func TestRequiredReviewer_UnmarshalJSON(t *testing.T) { } func TestCreateUpdateEnvironment_MarshalJSON(t *testing.T) { + t.Parallel() cu := &CreateUpdateEnvironment{} got, err := cu.MarshalJSON() @@ -100,6 +104,7 @@ func TestCreateUpdateEnvironment_MarshalJSON(t *testing.T) { } func TestRepositoriesService_ListEnvironments(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/environments", func(w http.ResponseWriter, r *http.Request) { @@ -139,6 +144,7 @@ func TestRepositoriesService_ListEnvironments(t *testing.T) { } func TestRepositoriesService_GetEnvironment(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/environments/e", func(w http.ResponseWriter, r *http.Request) { @@ -173,6 +179,7 @@ func TestRepositoriesService_GetEnvironment(t *testing.T) { } func TestRepositoriesService_CreateEnvironment(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &CreateUpdateEnvironment{ @@ -218,6 +225,7 @@ func TestRepositoriesService_CreateEnvironment(t *testing.T) { } func TestRepositoriesService_CreateEnvironment_noEnterprise(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &CreateUpdateEnvironment{} @@ -253,6 +261,7 @@ func TestRepositoriesService_CreateEnvironment_noEnterprise(t *testing.T) { } func TestRepositoriesService_createNewEnvNoEnterprise(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &CreateUpdateEnvironment{ @@ -320,6 +329,7 @@ func TestRepositoriesService_createNewEnvNoEnterprise(t *testing.T) { } func TestRepositoriesService_DeleteEnvironment(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/environments/e", func(w http.ResponseWriter, r *http.Request) { @@ -344,6 +354,7 @@ func TestRepositoriesService_DeleteEnvironment(t *testing.T) { } func TestRepoEnvironment_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &EnvResponse{}, "{}") repoEnv := &EnvResponse{ @@ -432,6 +443,7 @@ func TestRepoEnvironment_Marshal(t *testing.T) { } func TestEnvReviewers_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &EnvReviewers{}, "{}") repoEnv := &EnvReviewers{ @@ -448,6 +460,7 @@ func TestEnvReviewers_Marshal(t *testing.T) { } func TestEnvironment_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Environment{}, "{}") repoEnv := &Environment{ @@ -526,6 +539,7 @@ func TestEnvironment_Marshal(t *testing.T) { } func TestBranchPolicy_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &BranchPolicy{}, "{}") bp := &BranchPolicy{ diff --git a/github/repos_forks_test.go b/github/repos_forks_test.go index e4fa5460540..ff7271b27c1 100644 --- a/github/repos_forks_test.go +++ b/github/repos_forks_test.go @@ -15,6 +15,7 @@ import ( ) func TestRepositoriesService_ListForks(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/forks", func(w http.ResponseWriter, r *http.Request) { @@ -58,6 +59,7 @@ func TestRepositoriesService_ListForks(t *testing.T) { } func TestRepositoriesService_ListForks_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -66,6 +68,7 @@ func TestRepositoriesService_ListForks_invalidOwner(t *testing.T) { } func TestRepositoriesService_CreateFork(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/forks", func(w http.ResponseWriter, r *http.Request) { @@ -102,6 +105,7 @@ func TestRepositoriesService_CreateFork(t *testing.T) { } func TestRepositoriesService_CreateFork_deferred(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/forks", func(w http.ResponseWriter, r *http.Request) { @@ -126,6 +130,7 @@ func TestRepositoriesService_CreateFork_deferred(t *testing.T) { } func TestRepositoriesService_CreateFork_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() diff --git a/github/repos_hooks_configuration_test.go b/github/repos_hooks_configuration_test.go index c6c54cc3e00..c17e1004255 100644 --- a/github/repos_hooks_configuration_test.go +++ b/github/repos_hooks_configuration_test.go @@ -16,6 +16,7 @@ import ( ) func TestRepositoriesService_GetHookConfiguration(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/hooks/1/config", func(w http.ResponseWriter, r *http.Request) { @@ -55,6 +56,7 @@ func TestRepositoriesService_GetHookConfiguration(t *testing.T) { } func TestRepositoriesService_GetHookConfiguration_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -63,6 +65,7 @@ func TestRepositoriesService_GetHookConfiguration_invalidOrg(t *testing.T) { } func TestRepositoriesService_EditHookConfiguration(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &HookConfig{} @@ -111,6 +114,7 @@ func TestRepositoriesService_EditHookConfiguration(t *testing.T) { } func TestRepositoriesService_EditHookConfiguration_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() diff --git a/github/repos_hooks_deliveries_test.go b/github/repos_hooks_deliveries_test.go index 9f6e1d3bed0..71a04077a13 100644 --- a/github/repos_hooks_deliveries_test.go +++ b/github/repos_hooks_deliveries_test.go @@ -17,6 +17,7 @@ import ( ) func TestRepositoriesService_ListHookDeliveries(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/hooks/1/deliveries", func(w http.ResponseWriter, r *http.Request) { @@ -54,6 +55,7 @@ func TestRepositoriesService_ListHookDeliveries(t *testing.T) { } func TestRepositoriesService_ListHookDeliveries_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -62,6 +64,7 @@ func TestRepositoriesService_ListHookDeliveries_invalidOwner(t *testing.T) { } func TestRepositoriesService_GetHookDelivery(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/hooks/1/deliveries/1", func(w http.ResponseWriter, r *http.Request) { @@ -96,6 +99,7 @@ func TestRepositoriesService_GetHookDelivery(t *testing.T) { } func TestRepositoriesService_GetHookDelivery_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -104,6 +108,7 @@ func TestRepositoriesService_GetHookDelivery_invalidOwner(t *testing.T) { } func TestRepositoriesService_RedeliverHookDelivery(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/hooks/1/deliveries/1/attempts", func(w http.ResponseWriter, r *http.Request) { @@ -201,8 +206,11 @@ var hookDeliveryPayloadTypeToStruct = map[string]interface{}{ } func TestHookDelivery_ParsePayload(t *testing.T) { + t.Parallel() for evt, obj := range hookDeliveryPayloadTypeToStruct { + evt, obj := evt, obj t.Run(evt, func(t *testing.T) { + t.Parallel() bs, err := json.Marshal(obj) if err != nil { t.Fatal(err) @@ -230,6 +238,7 @@ func TestHookDelivery_ParsePayload(t *testing.T) { } func TestHookDelivery_ParsePayload_invalidEvent(t *testing.T) { + t.Parallel() p := json.RawMessage(nil) d := &HookDelivery{ @@ -246,6 +255,7 @@ func TestHookDelivery_ParsePayload_invalidEvent(t *testing.T) { } func TestHookDelivery_ParsePayload_invalidPayload(t *testing.T) { + t.Parallel() p := json.RawMessage([]byte(`{"check_run":{"id":"invalid"}}`)) d := &HookDelivery{ @@ -262,6 +272,7 @@ func TestHookDelivery_ParsePayload_invalidPayload(t *testing.T) { } func TestHookRequest_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &HookRequest{}, "{}") header := make(map[string]string) @@ -287,6 +298,7 @@ func TestHookRequest_Marshal(t *testing.T) { } func TestHookResponse_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &HookResponse{}, "{}") header := make(map[string]string) @@ -312,6 +324,7 @@ func TestHookResponse_Marshal(t *testing.T) { } func TestHookDelivery_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &HookDelivery{}, "{}") header := make(map[string]string) diff --git a/github/repos_hooks_test.go b/github/repos_hooks_test.go index a56e68f39ed..27d81f4eaa7 100644 --- a/github/repos_hooks_test.go +++ b/github/repos_hooks_test.go @@ -16,6 +16,7 @@ import ( ) func TestRepositoriesService_CreateHook(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &Hook{CreatedAt: &Timestamp{referenceTime}} @@ -60,6 +61,7 @@ func TestRepositoriesService_CreateHook(t *testing.T) { } func TestRepositoriesService_ListHooks(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/hooks", func(w http.ResponseWriter, r *http.Request) { @@ -97,6 +99,7 @@ func TestRepositoriesService_ListHooks(t *testing.T) { } func TestRepositoriesService_ListHooks_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -105,14 +108,17 @@ func TestRepositoriesService_ListHooks_invalidOwner(t *testing.T) { } func TestRepositoriesService_ListHooks_403_code_no_rate_limit(t *testing.T) { + t.Parallel() testErrorResponseForStatusCode(t, http.StatusForbidden) } func TestRepositoriesService_ListHooks_404_code(t *testing.T) { + t.Parallel() testErrorResponseForStatusCode(t, http.StatusNotFound) } func TestRepositoriesService_GetHook(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/hooks/1", func(w http.ResponseWriter, r *http.Request) { @@ -147,6 +153,7 @@ func TestRepositoriesService_GetHook(t *testing.T) { } func TestRepositoriesService_GetHook_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -155,6 +162,7 @@ func TestRepositoriesService_GetHook_invalidOwner(t *testing.T) { } func TestRepositoriesService_EditHook(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &Hook{} @@ -198,6 +206,7 @@ func TestRepositoriesService_EditHook(t *testing.T) { } func TestRepositoriesService_EditHook_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -206,6 +215,7 @@ func TestRepositoriesService_EditHook_invalidOwner(t *testing.T) { } func TestRepositoriesService_DeleteHook(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/hooks/1", func(w http.ResponseWriter, r *http.Request) { @@ -230,6 +240,7 @@ func TestRepositoriesService_DeleteHook(t *testing.T) { } func TestRepositoriesService_DeleteHook_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -238,6 +249,7 @@ func TestRepositoriesService_DeleteHook_invalidOwner(t *testing.T) { } func TestRepositoriesService_PingHook(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/hooks/1/pings", func(w http.ResponseWriter, r *http.Request) { @@ -262,6 +274,7 @@ func TestRepositoriesService_PingHook(t *testing.T) { } func TestRepositoriesService_TestHook(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/hooks/1/tests", func(w http.ResponseWriter, r *http.Request) { @@ -286,6 +299,7 @@ func TestRepositoriesService_TestHook(t *testing.T) { } func TestRepositoriesService_TestHook_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -294,6 +308,7 @@ func TestRepositoriesService_TestHook_invalidOwner(t *testing.T) { } func TestBranchWebHookPayload_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &WebHookPayload{}, "{}") v := &WebHookPayload{ @@ -424,6 +439,7 @@ func TestBranchWebHookPayload_Marshal(t *testing.T) { } func TestBranchWebHookAuthor_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &WebHookAuthor{}, "{}") v := &WebHookAuthor{ @@ -442,6 +458,7 @@ func TestBranchWebHookAuthor_Marshal(t *testing.T) { } func TestBranchWebHookCommit_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &WebHookCommit{}, "{}") v := &WebHookCommit{ @@ -484,6 +501,7 @@ func TestBranchWebHookCommit_Marshal(t *testing.T) { } func TestBranchCreateHookRequest_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &createHookRequest{}, "{}") v := &createHookRequest{ @@ -506,6 +524,7 @@ func TestBranchCreateHookRequest_Marshal(t *testing.T) { } func TestBranchHook_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Hook{}, "{}") v := &Hook{ @@ -548,6 +567,7 @@ func TestBranchHook_Marshal(t *testing.T) { } func TestRepositoriesService_Subscribe(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/hub", func(w http.ResponseWriter, r *http.Request) { @@ -580,6 +600,7 @@ func TestRepositoriesService_Subscribe(t *testing.T) { } func TestRepositoriesService_Unsubscribe(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/hub", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/repos_invitations_test.go b/github/repos_invitations_test.go index b32a2690595..b5030cac1dd 100644 --- a/github/repos_invitations_test.go +++ b/github/repos_invitations_test.go @@ -15,6 +15,7 @@ import ( ) func TestRepositoriesService_ListInvitations(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/invitations", func(w http.ResponseWriter, r *http.Request) { @@ -51,6 +52,7 @@ func TestRepositoriesService_ListInvitations(t *testing.T) { } func TestRepositoriesService_DeleteInvitation(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/invitations/2", func(w http.ResponseWriter, r *http.Request) { @@ -76,6 +78,7 @@ func TestRepositoriesService_DeleteInvitation(t *testing.T) { } func TestRepositoriesService_UpdateInvitation(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/invitations/2", func(w http.ResponseWriter, r *http.Request) { @@ -110,6 +113,7 @@ func TestRepositoriesService_UpdateInvitation(t *testing.T) { } func TestRepositoryInvitation_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &RepositoryInvitation{}, "{}") r := &RepositoryInvitation{ diff --git a/github/repos_keys_test.go b/github/repos_keys_test.go index c1429b7d9bc..8b726c1160c 100644 --- a/github/repos_keys_test.go +++ b/github/repos_keys_test.go @@ -16,6 +16,7 @@ import ( ) func TestRepositoriesService_ListKeys(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/keys", func(w http.ResponseWriter, r *http.Request) { @@ -52,6 +53,7 @@ func TestRepositoriesService_ListKeys(t *testing.T) { } func TestRepositoriesService_ListKeys_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -60,6 +62,7 @@ func TestRepositoriesService_ListKeys_invalidOwner(t *testing.T) { } func TestRepositoriesService_GetKey(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/keys/1", func(w http.ResponseWriter, r *http.Request) { @@ -94,6 +97,7 @@ func TestRepositoriesService_GetKey(t *testing.T) { } func TestRepositoriesService_GetKey_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -102,6 +106,7 @@ func TestRepositoriesService_GetKey_invalidOwner(t *testing.T) { } func TestRepositoriesService_CreateKey(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &Key{Key: String("k"), Title: String("t")} @@ -145,6 +150,7 @@ func TestRepositoriesService_CreateKey(t *testing.T) { } func TestRepositoriesService_CreateKey_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -153,6 +159,7 @@ func TestRepositoriesService_CreateKey_invalidOwner(t *testing.T) { } func TestRepositoriesService_DeleteKey(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/keys/1", func(w http.ResponseWriter, r *http.Request) { @@ -177,6 +184,7 @@ func TestRepositoriesService_DeleteKey(t *testing.T) { } func TestRepositoriesService_DeleteKey_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() diff --git a/github/repos_lfs_test.go b/github/repos_lfs_test.go index a503adfd830..e709dfa09f0 100644 --- a/github/repos_lfs_test.go +++ b/github/repos_lfs_test.go @@ -12,6 +12,7 @@ import ( ) func TestRepositoriesService_EnableLFS(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/lfs", func(w http.ResponseWriter, r *http.Request) { @@ -37,6 +38,7 @@ func TestRepositoriesService_EnableLFS(t *testing.T) { } func TestRepositoriesService_DisableLFS(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/lfs", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/repos_merging_test.go b/github/repos_merging_test.go index 1303fa21d6b..6b3adaa657d 100644 --- a/github/repos_merging_test.go +++ b/github/repos_merging_test.go @@ -16,6 +16,7 @@ import ( ) func TestRepositoriesService_Merge(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &RepositoryMergeRequest{ @@ -63,6 +64,7 @@ func TestRepositoriesService_Merge(t *testing.T) { } func TestRepositoryMergeRequest_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &RepositoryMergeRequest{}, "{}") u := &RepositoryMergeRequest{ @@ -81,6 +83,7 @@ func TestRepositoryMergeRequest_Marshal(t *testing.T) { } func TestRepositoriesService_MergeUpstream(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &RepoMergeUpstreamRequest{ @@ -126,6 +129,7 @@ func TestRepositoriesService_MergeUpstream(t *testing.T) { } func TestRepoMergeUpstreamResult_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &RepoMergeUpstreamResult{}, "{}") u := &RepoMergeUpstreamResult{ diff --git a/github/repos_pages_test.go b/github/repos_pages_test.go index 4b134982111..fee52e6656f 100644 --- a/github/repos_pages_test.go +++ b/github/repos_pages_test.go @@ -18,6 +18,7 @@ import ( ) func TestRepositoriesService_EnablePagesLegacy(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &Pages{ @@ -71,6 +72,7 @@ func TestRepositoriesService_EnablePagesLegacy(t *testing.T) { } func TestRepositoriesService_EnablePagesWorkflow(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &Pages{ @@ -120,6 +122,7 @@ func TestRepositoriesService_EnablePagesWorkflow(t *testing.T) { } func TestRepositoriesService_UpdatePagesLegacy(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &PagesUpdate{ @@ -159,6 +162,7 @@ func TestRepositoriesService_UpdatePagesLegacy(t *testing.T) { } func TestRepositoriesService_UpdatePagesWorkflow(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &PagesUpdate{ @@ -197,6 +201,7 @@ func TestRepositoriesService_UpdatePagesWorkflow(t *testing.T) { } func TestRepositoriesService_UpdatePages_NullCNAME(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &PagesUpdate{ @@ -225,6 +230,7 @@ func TestRepositoriesService_UpdatePages_NullCNAME(t *testing.T) { } func TestRepositoriesService_DisablePages(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pages", func(w http.ResponseWriter, r *http.Request) { @@ -250,6 +256,7 @@ func TestRepositoriesService_DisablePages(t *testing.T) { } func TestRepositoriesService_GetPagesInfo(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pages", func(w http.ResponseWriter, r *http.Request) { @@ -284,6 +291,7 @@ func TestRepositoriesService_GetPagesInfo(t *testing.T) { } func TestRepositoriesService_ListPagesBuilds(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pages/builds", func(w http.ResponseWriter, r *http.Request) { @@ -318,6 +326,7 @@ func TestRepositoriesService_ListPagesBuilds(t *testing.T) { } func TestRepositoriesService_ListPagesBuilds_withOptions(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pages/builds", func(w http.ResponseWriter, r *http.Request) { @@ -336,6 +345,7 @@ func TestRepositoriesService_ListPagesBuilds_withOptions(t *testing.T) { } func TestRepositoriesService_GetLatestPagesBuild(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pages/builds/latest", func(w http.ResponseWriter, r *http.Request) { @@ -370,6 +380,7 @@ func TestRepositoriesService_GetLatestPagesBuild(t *testing.T) { } func TestRepositoriesService_GetPageBuild(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pages/builds/1", func(w http.ResponseWriter, r *http.Request) { @@ -404,6 +415,7 @@ func TestRepositoriesService_GetPageBuild(t *testing.T) { } func TestRepositoriesService_RequestPageBuild(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pages/builds", func(w http.ResponseWriter, r *http.Request) { @@ -438,6 +450,7 @@ func TestRepositoriesService_RequestPageBuild(t *testing.T) { } func TestRepositoriesService_GetPageHealthCheck(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pages/health", func(w http.ResponseWriter, r *http.Request) { @@ -485,6 +498,7 @@ func TestRepositoriesService_GetPageHealthCheck(t *testing.T) { } func TestPagesSource_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PagesSource{}, "{}") u := &PagesSource{ @@ -501,6 +515,7 @@ func TestPagesSource_Marshal(t *testing.T) { } func TestPagesError_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PagesError{}, "{}") u := &PagesError{ @@ -515,6 +530,7 @@ func TestPagesError_Marshal(t *testing.T) { } func TestPagesUpdate_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PagesUpdate{}, "{}") u := &PagesUpdate{ @@ -531,6 +547,7 @@ func TestPagesUpdate_Marshal(t *testing.T) { } func TestPages_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Pages{}, "{}") u := &Pages{ @@ -561,6 +578,7 @@ func TestPages_Marshal(t *testing.T) { } func TestPagesBuild_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PagesBuild{}, "{}") u := &PagesBuild{ @@ -595,6 +613,7 @@ func TestPagesBuild_Marshal(t *testing.T) { } func TestPagesHealthCheckResponse_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PagesHealthCheckResponse{}, "{}") u := &PagesHealthCheckResponse{ @@ -679,6 +698,7 @@ func TestPagesHealthCheckResponse_Marshal(t *testing.T) { } func TestCreatePagesRequest_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &createPagesRequest{}, "{}") u := &createPagesRequest{ diff --git a/github/repos_prereceive_hooks_test.go b/github/repos_prereceive_hooks_test.go index 807ec1d0808..566b81b4676 100644 --- a/github/repos_prereceive_hooks_test.go +++ b/github/repos_prereceive_hooks_test.go @@ -16,6 +16,7 @@ import ( ) func TestRepositoriesService_ListPreReceiveHooks(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pre-receive-hooks", func(w http.ResponseWriter, r *http.Request) { @@ -54,6 +55,7 @@ func TestRepositoriesService_ListPreReceiveHooks(t *testing.T) { } func TestRepositoriesService_ListPreReceiveHooks_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -62,6 +64,7 @@ func TestRepositoriesService_ListPreReceiveHooks_invalidOwner(t *testing.T) { } func TestRepositoriesService_GetPreReceiveHook(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pre-receive-hooks/1", func(w http.ResponseWriter, r *http.Request) { @@ -97,6 +100,7 @@ func TestRepositoriesService_GetPreReceiveHook(t *testing.T) { } func TestRepositoriesService_GetPreReceiveHook_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -105,6 +109,7 @@ func TestRepositoriesService_GetPreReceiveHook_invalidOwner(t *testing.T) { } func TestRepositoriesService_UpdatePreReceiveHook(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &PreReceiveHook{} @@ -148,6 +153,7 @@ func TestRepositoriesService_UpdatePreReceiveHook(t *testing.T) { } func TestRepositoriesService_PreReceiveHook_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -156,6 +162,7 @@ func TestRepositoriesService_PreReceiveHook_invalidOwner(t *testing.T) { } func TestRepositoriesService_DeletePreReceiveHook(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/pre-receive-hooks/1", func(w http.ResponseWriter, r *http.Request) { @@ -180,6 +187,7 @@ func TestRepositoriesService_DeletePreReceiveHook(t *testing.T) { } func TestRepositoriesService_DeletePreReceiveHook_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -188,6 +196,7 @@ func TestRepositoriesService_DeletePreReceiveHook_invalidOwner(t *testing.T) { } func TestPreReceiveHook_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PreReceiveHook{}, "{}") u := &PreReceiveHook{ diff --git a/github/repos_projects_test.go b/github/repos_projects_test.go index b0e02738330..e419bb6b665 100644 --- a/github/repos_projects_test.go +++ b/github/repos_projects_test.go @@ -16,6 +16,7 @@ import ( ) func TestRepositoriesService_ListProjects(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/projects", func(w http.ResponseWriter, r *http.Request) { @@ -53,6 +54,7 @@ func TestRepositoriesService_ListProjects(t *testing.T) { } func TestRepositoriesService_CreateProject(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &ProjectOptions{Name: String("Project Name"), Body: String("Project body.")} diff --git a/github/repos_properties_test.go b/github/repos_properties_test.go index 012d7c548d9..6f04bf67f5d 100644 --- a/github/repos_properties_test.go +++ b/github/repos_properties_test.go @@ -15,6 +15,7 @@ import ( ) func TestRepositoriesService_GetAllCustomPropertyValues(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/properties/values", func(w http.ResponseWriter, r *http.Request) { @@ -80,6 +81,7 @@ func TestRepositoriesService_GetAllCustomPropertyValues(t *testing.T) { } func TestRepositoriesService_CreateOrUpdateCustomProperties(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/usr/r/properties/values", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/repos_releases_test.go b/github/repos_releases_test.go index dcd5066c12d..1155a7a94cc 100644 --- a/github/repos_releases_test.go +++ b/github/repos_releases_test.go @@ -19,6 +19,7 @@ import ( ) func TestRepositoriesService_ListReleases(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/releases", func(w http.ResponseWriter, r *http.Request) { @@ -54,6 +55,7 @@ func TestRepositoriesService_ListReleases(t *testing.T) { } func TestRepositoriesService_GenerateReleaseNotes(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/releases/generate-notes", func(w http.ResponseWriter, r *http.Request) { @@ -94,6 +96,7 @@ func TestRepositoriesService_GenerateReleaseNotes(t *testing.T) { } func TestRepositoriesService_GetRelease(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/releases/1", func(w http.ResponseWriter, r *http.Request) { @@ -128,6 +131,7 @@ func TestRepositoriesService_GetRelease(t *testing.T) { } func TestRepositoriesService_GetLatestRelease(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/releases/latest", func(w http.ResponseWriter, r *http.Request) { @@ -162,6 +166,7 @@ func TestRepositoriesService_GetLatestRelease(t *testing.T) { } func TestRepositoriesService_GetReleaseByTag(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/releases/tags/foo", func(w http.ResponseWriter, r *http.Request) { @@ -196,6 +201,7 @@ func TestRepositoriesService_GetReleaseByTag(t *testing.T) { } func TestRepositoriesService_CreateRelease(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &RepositoryRelease{ @@ -260,6 +266,7 @@ func TestRepositoriesService_CreateRelease(t *testing.T) { } func TestRepositoriesService_EditRelease(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &RepositoryRelease{ @@ -322,6 +329,7 @@ func TestRepositoriesService_EditRelease(t *testing.T) { } func TestRepositoriesService_DeleteRelease(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/releases/1", func(w http.ResponseWriter, r *http.Request) { @@ -346,6 +354,7 @@ func TestRepositoriesService_DeleteRelease(t *testing.T) { } func TestRepositoriesService_ListReleaseAssets(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/releases/1/assets", func(w http.ResponseWriter, r *http.Request) { @@ -381,6 +390,7 @@ func TestRepositoriesService_ListReleaseAssets(t *testing.T) { } func TestRepositoriesService_GetReleaseAsset(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/releases/assets/1", func(w http.ResponseWriter, r *http.Request) { @@ -414,6 +424,7 @@ func TestRepositoriesService_GetReleaseAsset(t *testing.T) { } func TestRepositoriesService_DownloadReleaseAsset_Stream(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/releases/assets/1", func(w http.ResponseWriter, r *http.Request) { @@ -446,6 +457,7 @@ func TestRepositoriesService_DownloadReleaseAsset_Stream(t *testing.T) { } func TestRepositoriesService_DownloadReleaseAsset_Redirect(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/releases/assets/1", func(w http.ResponseWriter, r *http.Request) { @@ -466,6 +478,7 @@ func TestRepositoriesService_DownloadReleaseAsset_Redirect(t *testing.T) { } func TestRepositoriesService_DownloadReleaseAsset_FollowRedirect(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/releases/assets/1", func(w http.ResponseWriter, r *http.Request) { @@ -499,6 +512,7 @@ func TestRepositoriesService_DownloadReleaseAsset_FollowRedirect(t *testing.T) { } func TestRepositoriesService_DownloadReleaseAsset_FollowRedirectToError(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/releases/assets/1", func(w http.ResponseWriter, r *http.Request) { @@ -528,6 +542,7 @@ func TestRepositoriesService_DownloadReleaseAsset_FollowRedirectToError(t *testi } func TestRepositoriesService_DownloadReleaseAsset_APIError(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/releases/assets/1", func(w http.ResponseWriter, r *http.Request) { @@ -554,6 +569,7 @@ func TestRepositoriesService_DownloadReleaseAsset_APIError(t *testing.T) { } func TestRepositoriesService_EditReleaseAsset(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &ReleaseAsset{Name: String("n")} @@ -595,6 +611,7 @@ func TestRepositoriesService_EditReleaseAsset(t *testing.T) { } func TestRepositoriesService_DeleteReleaseAsset(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/releases/assets/1", func(w http.ResponseWriter, r *http.Request) { @@ -619,6 +636,7 @@ func TestRepositoriesService_DeleteReleaseAsset(t *testing.T) { } func TestRepositoriesService_UploadReleaseAsset(t *testing.T) { + t.Parallel() var ( defaultUploadOptions = &UploadOptions{Name: "n"} defaultExpectedFormValue = values{"name": "n"} @@ -709,6 +727,7 @@ func TestRepositoriesService_UploadReleaseAsset(t *testing.T) { } func TestRepositoryReleaseRequest_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &repositoryReleaseRequest{}, "{}") u := &repositoryReleaseRequest{ @@ -737,6 +756,7 @@ func TestRepositoryReleaseRequest_Marshal(t *testing.T) { } func TestReleaseAsset_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ReleaseAsset{}, "{}") u := &ReleaseAsset{ @@ -777,6 +797,7 @@ func TestReleaseAsset_Marshal(t *testing.T) { } func TestRepositoryRelease_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &RepositoryRelease{}, "{}") u := &RepositoryRelease{ @@ -835,6 +856,7 @@ func TestRepositoryRelease_Marshal(t *testing.T) { } func TestGenerateNotesOptions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &GenerateNotesOptions{}, "{}") u := &GenerateNotesOptions{ diff --git a/github/repos_rules_test.go b/github/repos_rules_test.go index 0c4c4072069..809bd9a89a1 100644 --- a/github/repos_rules_test.go +++ b/github/repos_rules_test.go @@ -15,6 +15,7 @@ import ( ) func TestRepositoryRule_UnmarshalJSON(t *testing.T) { + t.Parallel() tests := map[string]struct { data string want *RepositoryRule @@ -357,9 +358,11 @@ func TestRepositoryRule_UnmarshalJSON(t *testing.T) { } for name, tc := range tests { + tc := tc rule := &RepositoryRule{} t.Run(name, func(t *testing.T) { + t.Parallel() err := rule.UnmarshalJSON([]byte(tc.data)) if err == nil && tc.wantErr { t.Errorf("RepositoryRule.UnmarshalJSON returned nil instead of an error") @@ -375,6 +378,7 @@ func TestRepositoryRule_UnmarshalJSON(t *testing.T) { } func TestRepositoriesService_GetRulesForBranch(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/repo/rules/branches/branch", func(w http.ResponseWriter, r *http.Request) { @@ -435,6 +439,7 @@ func TestRepositoriesService_GetRulesForBranch(t *testing.T) { } func TestRepositoriesService_GetRulesForBranchEmptyUpdateRule(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/repo/rules/branches/branch", func(w http.ResponseWriter, r *http.Request) { @@ -473,6 +478,7 @@ func TestRepositoriesService_GetRulesForBranchEmptyUpdateRule(t *testing.T) { } func TestRepositoriesService_GetAllRulesets(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/repo/rulesets", func(w http.ResponseWriter, r *http.Request) { @@ -533,6 +539,7 @@ func TestRepositoriesService_GetAllRulesets(t *testing.T) { } func TestRepositoriesService_CreateRuleset(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/repo/rulesets", func(w http.ResponseWriter, r *http.Request) { @@ -578,6 +585,7 @@ func TestRepositoriesService_CreateRuleset(t *testing.T) { } func TestRepositoriesService_CreateRulesetWithPushRules(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/repo/rulesets", func(w http.ResponseWriter, r *http.Request) { @@ -665,6 +673,7 @@ func TestRepositoriesService_CreateRulesetWithPushRules(t *testing.T) { } func TestRepositoriesService_GetRuleset(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/repo/rulesets/42", func(w http.ResponseWriter, r *http.Request) { @@ -707,6 +716,7 @@ func TestRepositoriesService_GetRuleset(t *testing.T) { } func TestRepositoriesService_UpdateRulesetNoBypassActor(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) rs := &Ruleset{ @@ -758,6 +768,7 @@ func TestRepositoriesService_UpdateRulesetNoBypassActor(t *testing.T) { } func TestRepositoriesService_UpdateRuleset(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/repo/rulesets/42", func(w http.ResponseWriter, r *http.Request) { @@ -804,6 +815,7 @@ func TestRepositoriesService_UpdateRuleset(t *testing.T) { } func TestRepositoriesService_DeleteRuleset(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/repo/rulesets/42", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/repos_stats_test.go b/github/repos_stats_test.go index 4d8511cc505..d10cfc5d778 100644 --- a/github/repos_stats_test.go +++ b/github/repos_stats_test.go @@ -16,6 +16,7 @@ import ( ) func TestRepositoriesService_ListContributorsStats(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/stats/contributors", func(w http.ResponseWriter, r *http.Request) { @@ -86,6 +87,7 @@ func TestRepositoriesService_ListContributorsStats(t *testing.T) { } func TestRepositoriesService_ListCommitActivity(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/stats/commit_activity", func(w http.ResponseWriter, r *http.Request) { @@ -136,6 +138,7 @@ func TestRepositoriesService_ListCommitActivity(t *testing.T) { } func TestRepositoriesService_ListCodeFrequency(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/stats/code_frequency", func(w http.ResponseWriter, r *http.Request) { @@ -176,6 +179,7 @@ func TestRepositoriesService_ListCodeFrequency(t *testing.T) { } func TestRepositoriesService_Participation(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/stats/participation", func(w http.ResponseWriter, r *http.Request) { @@ -240,6 +244,7 @@ func TestRepositoriesService_Participation(t *testing.T) { } func TestRepositoriesService_ListPunchCard(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/stats/punch_card", func(w http.ResponseWriter, r *http.Request) { @@ -284,6 +289,7 @@ func TestRepositoriesService_ListPunchCard(t *testing.T) { } func TestRepositoriesService_AcceptedError(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/stats/contributors", func(w http.ResponseWriter, r *http.Request) { @@ -323,6 +329,7 @@ func TestRepositoriesService_AcceptedError(t *testing.T) { } func TestRepositoryParticipation_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &RepositoryParticipation{}, "{}") u := &RepositoryParticipation{ @@ -339,6 +346,7 @@ func TestRepositoryParticipation_Marshal(t *testing.T) { } func TestWeeklyCommitActivity_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &WeeklyCommitActivity{}, "{}") u := &WeeklyCommitActivity{ @@ -359,6 +367,7 @@ func TestWeeklyCommitActivity_Marshal(t *testing.T) { } func TestWeeklyStats_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &WeeklyStats{}, "{}") u := &WeeklyStats{ @@ -379,6 +388,7 @@ func TestWeeklyStats_Marshal(t *testing.T) { } func TestContributorStats_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ContributorStats{}, "{}") u := &ContributorStats{ diff --git a/github/repos_statuses_test.go b/github/repos_statuses_test.go index e586a7a29ef..4f4665d20c0 100644 --- a/github/repos_statuses_test.go +++ b/github/repos_statuses_test.go @@ -16,6 +16,7 @@ import ( ) func TestRepositoriesService_ListStatuses(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/commits/r/statuses", func(w http.ResponseWriter, r *http.Request) { @@ -52,6 +53,7 @@ func TestRepositoriesService_ListStatuses(t *testing.T) { } func TestRepositoriesService_ListStatuses_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -60,6 +62,7 @@ func TestRepositoriesService_ListStatuses_invalidOwner(t *testing.T) { } func TestRepositoriesService_CreateStatus(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &RepoStatus{State: String("s"), TargetURL: String("t"), Description: String("d")} @@ -102,6 +105,7 @@ func TestRepositoriesService_CreateStatus(t *testing.T) { } func TestRepositoriesService_CreateStatus_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -110,6 +114,7 @@ func TestRepositoriesService_CreateStatus_invalidOwner(t *testing.T) { } func TestRepositoriesService_GetCombinedStatus(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/commits/r/status", func(w http.ResponseWriter, r *http.Request) { @@ -146,6 +151,7 @@ func TestRepositoriesService_GetCombinedStatus(t *testing.T) { } func TestRepoStatus_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &RepoStatus{}, "{}") u := &RepoStatus{ @@ -182,6 +188,7 @@ func TestRepoStatus_Marshal(t *testing.T) { } func TestCombinedStatus_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &CombinedStatus{}, "{}") u := &CombinedStatus{ diff --git a/github/repos_tags_test.go b/github/repos_tags_test.go index 577ce56b3dd..c37050d69b2 100644 --- a/github/repos_tags_test.go +++ b/github/repos_tags_test.go @@ -16,6 +16,7 @@ import ( ) func TestRepositoriesService_ListTagProtection(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/tags/protection", func(w http.ResponseWriter, r *http.Request) { @@ -51,6 +52,7 @@ func TestRepositoriesService_ListTagProtection(t *testing.T) { } func TestRepositoriesService_ListTagProtection_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -59,6 +61,7 @@ func TestRepositoriesService_ListTagProtection_invalidOwner(t *testing.T) { } func TestRepositoriesService_CreateTagProtection(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) pattern := "tag*" @@ -103,6 +106,7 @@ func TestRepositoriesService_CreateTagProtection(t *testing.T) { } func TestRepositoriesService_DeleteTagProtection(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/tags/protection/1", func(w http.ResponseWriter, r *http.Request) { @@ -128,6 +132,7 @@ func TestRepositoriesService_DeleteTagProtection(t *testing.T) { } func TestTagProtection_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &TagProtection{}, "{}") u := &TagProtection{ diff --git a/github/repos_test.go b/github/repos_test.go index 0059a20993c..f311488aa3f 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -20,6 +20,7 @@ import ( ) func TestRepositoriesService_ListByAuthenticatedUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/repos", func(w http.ResponseWriter, r *http.Request) { @@ -50,6 +51,7 @@ func TestRepositoriesService_ListByAuthenticatedUser(t *testing.T) { } func TestRepositoriesService_ListByUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/repos", func(w http.ResponseWriter, r *http.Request) { @@ -94,6 +96,7 @@ func TestRepositoriesService_ListByUser(t *testing.T) { } func TestRepositoriesService_ListByUser_type(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/repos", func(w http.ResponseWriter, r *http.Request) { @@ -120,6 +123,7 @@ func TestRepositoriesService_ListByUser_type(t *testing.T) { } func TestRepositoriesService_ListByUser_invalidUser(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -128,6 +132,7 @@ func TestRepositoriesService_ListByUser_invalidUser(t *testing.T) { } func TestRepositoriesService_ListByOrg(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) wantAcceptHeaders := []string{mediaTypeTopicsPreview, mediaTypeRepositoryVisibilityPreview} @@ -172,6 +177,7 @@ func TestRepositoriesService_ListByOrg(t *testing.T) { } func TestRepositoriesService_ListByOrg_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -180,6 +186,7 @@ func TestRepositoriesService_ListByOrg_invalidOrg(t *testing.T) { } func TestRepositoriesService_ListAll(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repositories", func(w http.ResponseWriter, r *http.Request) { @@ -213,6 +220,7 @@ func TestRepositoriesService_ListAll(t *testing.T) { } func TestRepositoriesService_Create_user(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &Repository{ @@ -262,6 +270,7 @@ func TestRepositoriesService_Create_user(t *testing.T) { } func TestRepositoriesService_Create_org(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &Repository{ @@ -297,6 +306,7 @@ func TestRepositoriesService_Create_org(t *testing.T) { } func TestRepositoriesService_CreateFromTemplate(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) templateRepoReq := &TemplateRepoRequest{ @@ -344,6 +354,7 @@ func TestRepositoriesService_CreateFromTemplate(t *testing.T) { } func TestRepositoriesService_Get(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) wantAcceptHeaders := []string{mediaTypeCodesOfConductPreview, mediaTypeTopicsPreview, mediaTypeRepositoryTemplatePreview, mediaTypeRepositoryVisibilityPreview} @@ -380,6 +391,7 @@ func TestRepositoriesService_Get(t *testing.T) { } func TestRepositoriesService_GetCodeOfConduct(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r", func(w http.ResponseWriter, r *http.Request) { @@ -428,6 +440,7 @@ func TestRepositoriesService_GetCodeOfConduct(t *testing.T) { } func TestRepositoriesService_GetByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repositories/1", func(w http.ResponseWriter, r *http.Request) { @@ -457,6 +470,7 @@ func TestRepositoriesService_GetByID(t *testing.T) { } func TestRepositoriesService_Edit(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) i := true @@ -502,6 +516,7 @@ func TestRepositoriesService_Edit(t *testing.T) { } func TestRepositoriesService_Delete(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r", func(w http.ResponseWriter, r *http.Request) { @@ -526,6 +541,7 @@ func TestRepositoriesService_Delete(t *testing.T) { } func TestRepositoriesService_Get_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -534,6 +550,7 @@ func TestRepositoriesService_Get_invalidOwner(t *testing.T) { } func TestRepositoriesService_Edit_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -542,6 +559,7 @@ func TestRepositoriesService_Edit_invalidOwner(t *testing.T) { } func TestRepositoriesService_GetVulnerabilityAlerts(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/vulnerability-alerts", func(w http.ResponseWriter, r *http.Request) { @@ -577,6 +595,7 @@ func TestRepositoriesService_GetVulnerabilityAlerts(t *testing.T) { } func TestRepositoriesService_EnableVulnerabilityAlerts(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/vulnerability-alerts", func(w http.ResponseWriter, r *http.Request) { @@ -603,6 +622,7 @@ func TestRepositoriesService_EnableVulnerabilityAlerts(t *testing.T) { } func TestRepositoriesService_DisableVulnerabilityAlerts(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/vulnerability-alerts", func(w http.ResponseWriter, r *http.Request) { @@ -629,6 +649,7 @@ func TestRepositoriesService_DisableVulnerabilityAlerts(t *testing.T) { } func TestRepositoriesService_EnableAutomatedSecurityFixes(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/automated-security-fixes", func(w http.ResponseWriter, r *http.Request) { @@ -644,6 +665,7 @@ func TestRepositoriesService_EnableAutomatedSecurityFixes(t *testing.T) { } func TestRepositoriesService_GetAutomatedSecurityFixes(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/automated-security-fixes", func(w http.ResponseWriter, r *http.Request) { @@ -680,6 +702,7 @@ func TestRepositoriesService_GetAutomatedSecurityFixes(t *testing.T) { } func TestRepositoriesService_DisableAutomatedSecurityFixes(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/automated-security-fixes", func(w http.ResponseWriter, r *http.Request) { @@ -695,6 +718,7 @@ func TestRepositoriesService_DisableAutomatedSecurityFixes(t *testing.T) { } func TestRepositoriesService_ListContributors(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/contributors", func(w http.ResponseWriter, r *http.Request) { @@ -734,6 +758,7 @@ func TestRepositoriesService_ListContributors(t *testing.T) { } func TestRepositoriesService_ListLanguages(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/languages", func(w http.ResponseWriter, r *http.Request) { @@ -768,6 +793,7 @@ func TestRepositoriesService_ListLanguages(t *testing.T) { } func TestRepositoriesService_ListTeams(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/teams", func(w http.ResponseWriter, r *http.Request) { @@ -804,6 +830,7 @@ func TestRepositoriesService_ListTeams(t *testing.T) { } func TestRepositoriesService_ListTags(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/tags", func(w http.ResponseWriter, r *http.Request) { @@ -850,6 +877,7 @@ func TestRepositoriesService_ListTags(t *testing.T) { } func TestRepositoriesService_ListBranches(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/branches", func(w http.ResponseWriter, r *http.Request) { @@ -889,6 +917,7 @@ func TestRepositoriesService_ListBranches(t *testing.T) { } func TestRepositoriesService_GetBranch(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) tests := []struct { @@ -940,6 +969,7 @@ func TestRepositoriesService_GetBranch(t *testing.T) { } func TestRepositoriesService_GetBranch_BadJSONResponse(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -949,7 +979,9 @@ func TestRepositoriesService_GetBranch_BadJSONResponse(t *testing.T) { } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { @@ -966,6 +998,7 @@ func TestRepositoriesService_GetBranch_BadJSONResponse(t *testing.T) { } func TestRepositoriesService_GetBranch_StatusMovedPermanently_followRedirects(t *testing.T) { + t.Parallel() client, mux, serverURL := setup(t) mux.HandleFunc("/repos/o/r/branches/b", func(w http.ResponseWriter, r *http.Request) { @@ -1007,6 +1040,7 @@ func TestRepositoriesService_GetBranch_StatusMovedPermanently_followRedirects(t } func TestRepositoriesService_GetBranch_notFound(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -1016,7 +1050,9 @@ func TestRepositoriesService_GetBranch_notFound(t *testing.T) { } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { @@ -1047,6 +1083,7 @@ func TestRepositoriesService_GetBranch_notFound(t *testing.T) { } func TestRepositoriesService_RenameBranch(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -1056,7 +1093,9 @@ func TestRepositoriesService_RenameBranch(t *testing.T) { } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) renameBranchReq := "nn" @@ -1103,6 +1142,7 @@ func TestRepositoriesService_RenameBranch(t *testing.T) { } func TestRepositoriesService_GetBranchProtection(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -1113,7 +1153,9 @@ func TestRepositoriesService_GetBranchProtection(t *testing.T) { } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { @@ -1258,6 +1300,7 @@ func TestRepositoriesService_GetBranchProtection(t *testing.T) { } func TestRepositoriesService_GetBranchProtection_noDismissalRestrictions(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) tests := []struct { @@ -1343,6 +1386,7 @@ func TestRepositoriesService_GetBranchProtection_noDismissalRestrictions(t *test } func TestRepositoriesService_GetBranchProtection_branchNotProtected(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -1352,7 +1396,9 @@ func TestRepositoriesService_GetBranchProtection_branchNotProtected(t *testing.T } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { @@ -1380,6 +1426,7 @@ func TestRepositoriesService_GetBranchProtection_branchNotProtected(t *testing.T } func TestRepositoriesService_UpdateBranchProtection_Contexts(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -1389,7 +1436,9 @@ func TestRepositoriesService_UpdateBranchProtection_Contexts(t *testing.T) { } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &ProtectionRequest{ @@ -1567,6 +1616,7 @@ func TestRepositoriesService_UpdateBranchProtection_Contexts(t *testing.T) { } func TestRepositoriesService_UpdateBranchProtection_EmptyContexts(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -1576,7 +1626,9 @@ func TestRepositoriesService_UpdateBranchProtection_EmptyContexts(t *testing.T) } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &ProtectionRequest{ @@ -1744,6 +1796,7 @@ func TestRepositoriesService_UpdateBranchProtection_EmptyContexts(t *testing.T) } func TestRepositoriesService_UpdateBranchProtection_Checks(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -1753,7 +1806,9 @@ func TestRepositoriesService_UpdateBranchProtection_Checks(t *testing.T) { } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &ProtectionRequest{ @@ -1900,6 +1955,7 @@ func TestRepositoriesService_UpdateBranchProtection_Checks(t *testing.T) { } func TestRepositoriesService_UpdateBranchProtection_EmptyChecks(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -1909,7 +1965,9 @@ func TestRepositoriesService_UpdateBranchProtection_EmptyChecks(t *testing.T) { } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &ProtectionRequest{ @@ -2042,6 +2100,7 @@ func TestRepositoriesService_UpdateBranchProtection_EmptyChecks(t *testing.T) { } func TestRepositoriesService_UpdateBranchProtection_StrictNoChecks(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -2051,7 +2110,9 @@ func TestRepositoriesService_UpdateBranchProtection_StrictNoChecks(t *testing.T) } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &ProtectionRequest{ @@ -2183,6 +2244,7 @@ func TestRepositoriesService_UpdateBranchProtection_StrictNoChecks(t *testing.T) } func TestRepositoriesService_UpdateBranchProtection_RequireLastPushApproval(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -2192,7 +2254,9 @@ func TestRepositoriesService_UpdateBranchProtection_RequireLastPushApproval(t *t } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &ProtectionRequest{ @@ -2236,6 +2300,7 @@ func TestRepositoriesService_UpdateBranchProtection_RequireLastPushApproval(t *t } func TestRepositoriesService_RemoveBranchProtection(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -2245,7 +2310,9 @@ func TestRepositoriesService_RemoveBranchProtection(t *testing.T) { } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { @@ -2273,6 +2340,7 @@ func TestRepositoriesService_RemoveBranchProtection(t *testing.T) { } func TestRepositoriesService_ListLanguages_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -2281,6 +2349,7 @@ func TestRepositoriesService_ListLanguages_invalidOwner(t *testing.T) { } func TestRepositoriesService_License(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/license", func(w http.ResponseWriter, r *http.Request) { @@ -2326,6 +2395,7 @@ func TestRepositoriesService_License(t *testing.T) { } func TestRepositoriesService_GetRequiredStatusChecks(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -2335,7 +2405,9 @@ func TestRepositoriesService_GetRequiredStatusChecks(t *testing.T) { } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { @@ -2403,6 +2475,7 @@ func TestRepositoriesService_GetRequiredStatusChecks(t *testing.T) { } func TestRepositoriesService_GetRequiredStatusChecks_branchNotProtected(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -2412,7 +2485,9 @@ func TestRepositoriesService_GetRequiredStatusChecks_branchNotProtected(t *testi } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { @@ -2440,6 +2515,7 @@ func TestRepositoriesService_GetRequiredStatusChecks_branchNotProtected(t *testi } func TestRepositoriesService_UpdateRequiredStatusChecks_Contexts(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -2449,7 +2525,9 @@ func TestRepositoriesService_UpdateRequiredStatusChecks_Contexts(t *testing.T) { } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &RequiredStatusChecksRequest{ @@ -2515,6 +2593,7 @@ func TestRepositoriesService_UpdateRequiredStatusChecks_Contexts(t *testing.T) { } func TestRepositoriesService_UpdateRequiredStatusChecks_Checks(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -2524,7 +2603,9 @@ func TestRepositoriesService_UpdateRequiredStatusChecks_Checks(t *testing.T) { } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) appID := int64(123) @@ -2605,6 +2686,7 @@ func TestRepositoriesService_UpdateRequiredStatusChecks_Checks(t *testing.T) { } func TestRepositoriesService_RemoveRequiredStatusChecks(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -2614,7 +2696,9 @@ func TestRepositoriesService_RemoveRequiredStatusChecks(t *testing.T) { } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { @@ -2643,6 +2727,7 @@ func TestRepositoriesService_RemoveRequiredStatusChecks(t *testing.T) { } func TestRepositoriesService_ListRequiredStatusChecksContexts(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -2652,7 +2737,9 @@ func TestRepositoriesService_ListRequiredStatusChecksContexts(t *testing.T) { } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { @@ -2689,6 +2776,7 @@ func TestRepositoriesService_ListRequiredStatusChecksContexts(t *testing.T) { } func TestRepositoriesService_ListRequiredStatusChecksContexts_branchNotProtected(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -2698,7 +2786,9 @@ func TestRepositoriesService_ListRequiredStatusChecksContexts_branchNotProtected } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { @@ -2726,6 +2816,7 @@ func TestRepositoriesService_ListRequiredStatusChecksContexts_branchNotProtected } func TestRepositoriesService_GetPullRequestReviewEnforcement(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -2735,7 +2826,9 @@ func TestRepositoriesService_GetPullRequestReviewEnforcement(t *testing.T) { } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { @@ -2799,6 +2892,7 @@ func TestRepositoriesService_GetPullRequestReviewEnforcement(t *testing.T) { } func TestRepositoriesService_UpdatePullRequestReviewEnforcement(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -2808,7 +2902,9 @@ func TestRepositoriesService_UpdatePullRequestReviewEnforcement(t *testing.T) { } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &PullRequestReviewsEnforcementUpdate{ @@ -2885,6 +2981,7 @@ func TestRepositoriesService_UpdatePullRequestReviewEnforcement(t *testing.T) { } func TestRepositoriesService_DisableDismissalRestrictions(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -2894,7 +2991,9 @@ func TestRepositoriesService_DisableDismissalRestrictions(t *testing.T) { } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { @@ -2939,6 +3038,7 @@ func TestRepositoriesService_DisableDismissalRestrictions(t *testing.T) { } func TestRepositoriesService_RemovePullRequestReviewEnforcement(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -2948,7 +3048,9 @@ func TestRepositoriesService_RemovePullRequestReviewEnforcement(t *testing.T) { } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { @@ -2976,6 +3078,7 @@ func TestRepositoriesService_RemovePullRequestReviewEnforcement(t *testing.T) { } func TestRepositoriesService_GetAdminEnforcement(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -2985,7 +3088,9 @@ func TestRepositoriesService_GetAdminEnforcement(t *testing.T) { } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { @@ -3026,6 +3131,7 @@ func TestRepositoriesService_GetAdminEnforcement(t *testing.T) { } func TestRepositoriesService_AddAdminEnforcement(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -3035,7 +3141,9 @@ func TestRepositoriesService_AddAdminEnforcement(t *testing.T) { } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { @@ -3075,6 +3183,7 @@ func TestRepositoriesService_AddAdminEnforcement(t *testing.T) { } func TestRepositoriesService_RemoveAdminEnforcement(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -3084,7 +3193,9 @@ func TestRepositoriesService_RemoveAdminEnforcement(t *testing.T) { } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { @@ -3112,6 +3223,7 @@ func TestRepositoriesService_RemoveAdminEnforcement(t *testing.T) { } func TestRepositoriesService_GetSignaturesProtectedBranch(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -3121,7 +3233,9 @@ func TestRepositoriesService_GetSignaturesProtectedBranch(t *testing.T) { } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { @@ -3163,6 +3277,7 @@ func TestRepositoriesService_GetSignaturesProtectedBranch(t *testing.T) { } func TestRepositoriesService_RequireSignaturesOnProtectedBranch(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -3172,7 +3287,9 @@ func TestRepositoriesService_RequireSignaturesOnProtectedBranch(t *testing.T) { } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { @@ -3214,6 +3331,7 @@ func TestRepositoriesService_RequireSignaturesOnProtectedBranch(t *testing.T) { } func TestRepositoriesService_OptionalSignaturesOnProtectedBranch(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -3223,7 +3341,9 @@ func TestRepositoriesService_OptionalSignaturesOnProtectedBranch(t *testing.T) { } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { @@ -3252,6 +3372,7 @@ func TestRepositoriesService_OptionalSignaturesOnProtectedBranch(t *testing.T) { } func TestPullRequestReviewsEnforcementRequest_MarshalJSON_nilDismissalRestirctions(t *testing.T) { + t.Parallel() req := PullRequestReviewsEnforcementRequest{} got, err := json.Marshal(req) @@ -3299,6 +3420,7 @@ func TestPullRequestReviewsEnforcementRequest_MarshalJSON_nilDismissalRestirctio } func TestRepositoriesService_ListAllTopics(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/topics", func(w http.ResponseWriter, r *http.Request) { @@ -3334,6 +3456,7 @@ func TestRepositoriesService_ListAllTopics(t *testing.T) { } func TestRepositoriesService_ListAllTopics_emptyTopics(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/topics", func(w http.ResponseWriter, r *http.Request) { @@ -3355,6 +3478,7 @@ func TestRepositoriesService_ListAllTopics_emptyTopics(t *testing.T) { } func TestRepositoriesService_ReplaceAllTopics(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/topics", func(w http.ResponseWriter, r *http.Request) { @@ -3390,6 +3514,7 @@ func TestRepositoriesService_ReplaceAllTopics(t *testing.T) { } func TestRepositoriesService_ReplaceAllTopics_nilSlice(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/topics", func(w http.ResponseWriter, r *http.Request) { @@ -3412,6 +3537,7 @@ func TestRepositoriesService_ReplaceAllTopics_nilSlice(t *testing.T) { } func TestRepositoriesService_ReplaceAllTopics_emptySlice(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/topics", func(w http.ResponseWriter, r *http.Request) { @@ -3434,6 +3560,7 @@ func TestRepositoriesService_ReplaceAllTopics_emptySlice(t *testing.T) { } func TestRepositoriesService_ListAppRestrictions(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -3443,7 +3570,9 @@ func TestRepositoriesService_ListAppRestrictions(t *testing.T) { } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { @@ -3474,6 +3603,7 @@ func TestRepositoriesService_ListAppRestrictions(t *testing.T) { } func TestRepositoriesService_ReplaceAppRestrictions(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -3483,7 +3613,9 @@ func TestRepositoriesService_ReplaceAppRestrictions(t *testing.T) { } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { @@ -3523,6 +3655,7 @@ func TestRepositoriesService_ReplaceAppRestrictions(t *testing.T) { } func TestRepositoriesService_AddAppRestrictions(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -3532,7 +3665,9 @@ func TestRepositoriesService_AddAppRestrictions(t *testing.T) { } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { @@ -3572,6 +3707,7 @@ func TestRepositoriesService_AddAppRestrictions(t *testing.T) { } func TestRepositoriesService_RemoveAppRestrictions(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -3581,7 +3717,9 @@ func TestRepositoriesService_RemoveAppRestrictions(t *testing.T) { } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { @@ -3617,6 +3755,7 @@ func TestRepositoriesService_RemoveAppRestrictions(t *testing.T) { } func TestRepositoriesService_ListTeamRestrictions(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -3626,7 +3765,9 @@ func TestRepositoriesService_ListTeamRestrictions(t *testing.T) { } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { @@ -3657,6 +3798,7 @@ func TestRepositoriesService_ListTeamRestrictions(t *testing.T) { } func TestRepositoriesService_ReplaceTeamRestrictions(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -3666,7 +3808,9 @@ func TestRepositoriesService_ReplaceTeamRestrictions(t *testing.T) { } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { @@ -3706,6 +3850,7 @@ func TestRepositoriesService_ReplaceTeamRestrictions(t *testing.T) { } func TestRepositoriesService_AddTeamRestrictions(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -3715,7 +3860,9 @@ func TestRepositoriesService_AddTeamRestrictions(t *testing.T) { } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { @@ -3755,6 +3902,7 @@ func TestRepositoriesService_AddTeamRestrictions(t *testing.T) { } func TestRepositoriesService_RemoveTeamRestrictions(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -3764,7 +3912,9 @@ func TestRepositoriesService_RemoveTeamRestrictions(t *testing.T) { } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { @@ -3800,6 +3950,7 @@ func TestRepositoriesService_RemoveTeamRestrictions(t *testing.T) { } func TestRepositoriesService_ListUserRestrictions(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -3809,7 +3960,9 @@ func TestRepositoriesService_ListUserRestrictions(t *testing.T) { } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { @@ -3840,6 +3993,7 @@ func TestRepositoriesService_ListUserRestrictions(t *testing.T) { } func TestRepositoriesService_ReplaceUserRestrictions(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -3849,7 +4003,9 @@ func TestRepositoriesService_ReplaceUserRestrictions(t *testing.T) { } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { @@ -3889,6 +4045,7 @@ func TestRepositoriesService_ReplaceUserRestrictions(t *testing.T) { } func TestRepositoriesService_AddUserRestrictions(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -3898,7 +4055,9 @@ func TestRepositoriesService_AddUserRestrictions(t *testing.T) { } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { @@ -3938,6 +4097,7 @@ func TestRepositoriesService_AddUserRestrictions(t *testing.T) { } func TestRepositoriesService_RemoveUserRestrictions(t *testing.T) { + t.Parallel() tests := []struct { branch string urlPath string @@ -3947,7 +4107,9 @@ func TestRepositoriesService_RemoveUserRestrictions(t *testing.T) { } for _, test := range tests { + test := test t.Run(test.branch, func(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { @@ -3983,6 +4145,7 @@ func TestRepositoriesService_RemoveUserRestrictions(t *testing.T) { } func TestRepositoriesService_Transfer(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := TransferRequest{NewOwner: "a", NewName: String("b"), TeamID: []int64{123}} @@ -4026,6 +4189,7 @@ func TestRepositoriesService_Transfer(t *testing.T) { } func TestRepositoriesService_Dispatch(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) var input DispatchRequestOptions @@ -4103,6 +4267,7 @@ func TestRepositoriesService_Dispatch(t *testing.T) { } func TestAdvancedSecurity_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &AdvancedSecurity{}, "{}") u := &AdvancedSecurity{ @@ -4117,6 +4282,7 @@ func TestAdvancedSecurity_Marshal(t *testing.T) { } func TestAuthorizedActorsOnly_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &AuthorizedActorsOnly{}, "{}") u := &AuthorizedActorsOnly{ @@ -4131,6 +4297,7 @@ func TestAuthorizedActorsOnly_Marshal(t *testing.T) { } func TestDispatchRequestOptions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &DispatchRequestOptions{}, "{}") cp := json.RawMessage(`{"testKey":"testValue"}`) @@ -4150,6 +4317,7 @@ func TestDispatchRequestOptions_Marshal(t *testing.T) { } func TestTransferRequest_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &TransferRequest{}, "{}") u := &TransferRequest{ @@ -4168,6 +4336,7 @@ func TestTransferRequest_Marshal(t *testing.T) { } func TestSignaturesProtectedBranch_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &SignaturesProtectedBranch{}, "{}") u := &SignaturesProtectedBranch{ @@ -4196,6 +4365,7 @@ func TestSignaturesProtectedBranch_Marshal(t *testing.T) { } func TestDismissalRestrictionsRequest_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &DismissalRestrictionsRequest{}, "{}") u := &DismissalRestrictionsRequest{ @@ -4214,6 +4384,7 @@ func TestDismissalRestrictionsRequest_Marshal(t *testing.T) { } func TestAdminEnforcement_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &AdminEnforcement{}, "{}") u := &AdminEnforcement{ @@ -4230,6 +4401,7 @@ func TestAdminEnforcement_Marshal(t *testing.T) { } func TestPullRequestReviewsEnforcementUpdate_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &PullRequestReviewsEnforcementUpdate{}, "{}") u := &PullRequestReviewsEnforcementUpdate{ @@ -4258,6 +4430,7 @@ func TestPullRequestReviewsEnforcementUpdate_Marshal(t *testing.T) { } func TestRequiredStatusCheck_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &RequiredStatusCheck{}, "{}") u := &RequiredStatusCheck{ @@ -4274,6 +4447,7 @@ func TestRequiredStatusCheck_Marshal(t *testing.T) { } func TestRepositoryTag_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &RepositoryTag{}, "{}") u := &RepositoryTag{ @@ -4300,6 +4474,7 @@ func TestRepositoryTag_Marshal(t *testing.T) { } func TestRepositoriesService_EnablePrivateReporting(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/owner/repo/private-vulnerability-reporting", func(w http.ResponseWriter, r *http.Request) { @@ -4325,6 +4500,7 @@ func TestRepositoriesService_EnablePrivateReporting(t *testing.T) { } func TestRepositoriesService_DisablePrivateReporting(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/owner/repo/private-vulnerability-reporting", func(w http.ResponseWriter, r *http.Request) { @@ -4350,6 +4526,7 @@ func TestRepositoriesService_DisablePrivateReporting(t *testing.T) { } func TestRepositoriesService_IsPrivateReportingEnabled(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/owner/repo/private-vulnerability-reporting", func(w http.ResponseWriter, r *http.Request) { @@ -4382,6 +4559,7 @@ func TestRepositoriesService_IsPrivateReportingEnabled(t *testing.T) { } func TestRepository_UnmarshalJSON(t *testing.T) { + t.Parallel() var testCases = map[string]struct { data []byte wantRepository Repository @@ -4412,6 +4590,7 @@ func TestRepository_UnmarshalJSON(t *testing.T) { for name, tt := range testCases { tt := tt t.Run(name, func(t *testing.T) { + t.Parallel() pk := Repository{} err := json.Unmarshal(tt.data, &pk) if err == nil && tt.wantErr { diff --git a/github/repos_traffic_test.go b/github/repos_traffic_test.go index 1ee91fabb35..8f9cdba2364 100644 --- a/github/repos_traffic_test.go +++ b/github/repos_traffic_test.go @@ -16,6 +16,7 @@ import ( ) func TestRepositoriesService_ListTrafficReferrers(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/traffic/popular/referrers", func(w http.ResponseWriter, r *http.Request) { @@ -57,6 +58,7 @@ func TestRepositoriesService_ListTrafficReferrers(t *testing.T) { } func TestRepositoriesService_ListTrafficPaths(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/traffic/popular/paths", func(w http.ResponseWriter, r *http.Request) { @@ -100,6 +102,7 @@ func TestRepositoriesService_ListTrafficPaths(t *testing.T) { } func TestRepositoriesService_ListTrafficViews(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/traffic/views", func(w http.ResponseWriter, r *http.Request) { @@ -149,6 +152,7 @@ func TestRepositoriesService_ListTrafficViews(t *testing.T) { } func TestRepositoriesService_ListTrafficClones(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/traffic/clones", func(w http.ResponseWriter, r *http.Request) { @@ -198,6 +202,7 @@ func TestRepositoriesService_ListTrafficClones(t *testing.T) { } func TestTrafficReferrer_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &TrafficReferrer{}, "{}") u := &TrafficReferrer{ @@ -216,6 +221,7 @@ func TestTrafficReferrer_Marshal(t *testing.T) { } func TestTrafficViews_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &TrafficViews{}, "{}") u := &TrafficViews{ @@ -242,6 +248,7 @@ func TestTrafficViews_Marshal(t *testing.T) { } func TestTrafficClones_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &TrafficClones{}, "{}") u := &TrafficClones{ @@ -268,6 +275,7 @@ func TestTrafficClones_Marshal(t *testing.T) { } func TestTrafficPath_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &TrafficPath{}, "{}") u := &TrafficPath{ @@ -288,6 +296,7 @@ func TestTrafficPath_Marshal(t *testing.T) { } func TestTrafficData_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &TrafficData{}, "{}") u := &TrafficData{ @@ -306,6 +315,7 @@ func TestTrafficData_Marshal(t *testing.T) { } func TestTrafficBreakdownOptions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &TrafficBreakdownOptions{}, "{}") u := &TrafficBreakdownOptions{ diff --git a/github/scim_test.go b/github/scim_test.go index ce3315f2f20..3777135c9a6 100644 --- a/github/scim_test.go +++ b/github/scim_test.go @@ -16,6 +16,7 @@ import ( ) func TestSCIMService_ListSCIMProvisionedIdentities(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/scim/v2/organizations/o/Users", func(w http.ResponseWriter, r *http.Request) { @@ -121,6 +122,7 @@ func TestSCIMService_ListSCIMProvisionedIdentities(t *testing.T) { } func TestSCIMService_ProvisionAndInviteSCIMUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/scim/v2/organizations/o/Users", func(w http.ResponseWriter, r *http.Request) { @@ -171,6 +173,7 @@ func TestSCIMService_ProvisionAndInviteSCIMUser(t *testing.T) { } func TestSCIMService_GetSCIMProvisioningInfoForUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/scim/v2/organizations/o/Users/123", func(w http.ResponseWriter, r *http.Request) { @@ -263,6 +266,7 @@ func TestSCIMService_GetSCIMProvisioningInfoForUser(t *testing.T) { } func TestSCIMService_UpdateProvisionedOrgMembership(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/scim/v2/organizations/o/Users/123", func(w http.ResponseWriter, r *http.Request) { @@ -300,6 +304,7 @@ func TestSCIMService_UpdateProvisionedOrgMembership(t *testing.T) { } func TestSCIMService_UpdateAttributeForSCIMUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/scim/v2/organizations/o/Users/123", func(w http.ResponseWriter, r *http.Request) { @@ -326,6 +331,7 @@ func TestSCIMService_UpdateAttributeForSCIMUser(t *testing.T) { } func TestSCIMService_DeleteSCIMUserFromOrg(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/scim/v2/organizations/o/Users/123", func(w http.ResponseWriter, r *http.Request) { @@ -351,6 +357,7 @@ func TestSCIMService_DeleteSCIMUserFromOrg(t *testing.T) { } func TestSCIMUserAttributes_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &SCIMUserAttributes{}, `{ "userName":"","name":{"givenName":"","familyName":""},"emails":null }`) @@ -399,6 +406,7 @@ func TestSCIMUserAttributes_Marshal(t *testing.T) { } func TestUpdateAttributeForSCIMUserOperations_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &UpdateAttributeForSCIMUserOperations{}, `{}`) u := &UpdateAttributeForSCIMUserOperations{ @@ -415,6 +423,7 @@ func TestUpdateAttributeForSCIMUserOperations_Marshal(t *testing.T) { } func TestUpdateAttributeForSCIMUserOptions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &UpdateAttributeForSCIMUserOptions{}, `{}`) u := &UpdateAttributeForSCIMUserOptions{ @@ -437,6 +446,7 @@ func TestUpdateAttributeForSCIMUserOptions_Marshal(t *testing.T) { } func TestListSCIMProvisionedIdentitiesOptions_addOptions(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ListSCIMProvisionedIdentitiesOptions{}, `{ "StartIndex": null, "Count": null, @@ -470,6 +480,7 @@ func TestListSCIMProvisionedIdentitiesOptions_addOptions(t *testing.T) { } func TestSCIMUserName_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &SCIMUserName{}, `{ "givenName":"","familyName":"" }`) @@ -489,6 +500,7 @@ func TestSCIMUserName_Marshal(t *testing.T) { } func TestSCIMMeta_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &SCIMMeta{}, `{}`) u := &SCIMMeta{ @@ -505,6 +517,7 @@ func TestSCIMMeta_Marshal(t *testing.T) { } func TestSCIMProvisionedIdentities_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &SCIMProvisionedIdentities{}, `{}`) u := &SCIMProvisionedIdentities{ diff --git a/github/search_test.go b/github/search_test.go index 36e1c945937..f55a531e1e3 100644 --- a/github/search_test.go +++ b/github/search_test.go @@ -16,6 +16,7 @@ import ( ) func TestSearchService_Repositories(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/search/repositories", func(w http.ResponseWriter, r *http.Request) { @@ -49,6 +50,7 @@ func TestSearchService_Repositories(t *testing.T) { } func TestSearchService_Repositories_coverage(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -61,6 +63,7 @@ func TestSearchService_Repositories_coverage(t *testing.T) { } func TestSearchService_RepositoriesTextMatch(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/search/repositories", func(w http.ResponseWriter, r *http.Request) { @@ -139,6 +142,7 @@ func TestSearchService_RepositoriesTextMatch(t *testing.T) { } func TestSearchService_Topics(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/search/topics", func(w http.ResponseWriter, r *http.Request) { @@ -170,6 +174,7 @@ func TestSearchService_Topics(t *testing.T) { } func TestSearchService_Topics_coverage(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -182,6 +187,7 @@ func TestSearchService_Topics_coverage(t *testing.T) { } func TestSearchService_Commits(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/search/commits", func(w http.ResponseWriter, r *http.Request) { @@ -213,6 +219,7 @@ func TestSearchService_Commits(t *testing.T) { } func TestSearchService_Commits_coverage(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -225,6 +232,7 @@ func TestSearchService_Commits_coverage(t *testing.T) { } func TestSearchService_Issues(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/search/issues", func(w http.ResponseWriter, r *http.Request) { @@ -258,6 +266,7 @@ func TestSearchService_Issues(t *testing.T) { } func TestSearchService_Issues_coverage(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -270,6 +279,7 @@ func TestSearchService_Issues_coverage(t *testing.T) { } func TestSearchService_Issues_withQualifiersNoOpts(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) const q = "gopher is:issue label:bug language:c++ pushed:>=2018-01-01 stars:>=200" @@ -307,6 +317,7 @@ func TestSearchService_Issues_withQualifiersNoOpts(t *testing.T) { } func TestSearchService_Issues_withQualifiersAndOpts(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) const q = "gopher is:issue label:bug language:c++ pushed:>=2018-01-01 stars:>=200" @@ -345,6 +356,7 @@ func TestSearchService_Issues_withQualifiersAndOpts(t *testing.T) { } func TestSearchService_Users(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/search/users", func(w http.ResponseWriter, r *http.Request) { @@ -378,6 +390,7 @@ func TestSearchService_Users(t *testing.T) { } func TestSearchService_Users_coverage(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -390,6 +403,7 @@ func TestSearchService_Users_coverage(t *testing.T) { } func TestSearchService_Code(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/search/code", func(w http.ResponseWriter, r *http.Request) { @@ -423,6 +437,7 @@ func TestSearchService_Code(t *testing.T) { } func TestSearchService_Code_coverage(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -435,6 +450,7 @@ func TestSearchService_Code_coverage(t *testing.T) { } func TestSearchService_CodeTextMatch(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/search/code", func(w http.ResponseWriter, r *http.Request) { @@ -496,6 +512,7 @@ func TestSearchService_CodeTextMatch(t *testing.T) { } func TestSearchService_Labels(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/search/labels", func(w http.ResponseWriter, r *http.Request) { @@ -533,6 +550,7 @@ func TestSearchService_Labels(t *testing.T) { } func TestSearchService_Labels_coverage(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -545,6 +563,7 @@ func TestSearchService_Labels_coverage(t *testing.T) { } func TestMatch_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Match{}, "{}") u := &Match{ @@ -561,6 +580,7 @@ func TestMatch_Marshal(t *testing.T) { } func TestTextMatch_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &TextMatch{}, "{}") u := &TextMatch{ @@ -591,6 +611,7 @@ func TestTextMatch_Marshal(t *testing.T) { } func TestTopicResult_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &TopicResult{}, "{}") u := &TopicResult{ @@ -621,6 +642,7 @@ func TestTopicResult_Marshal(t *testing.T) { } func TestRepositoriesSearchResult_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &RepositoriesSearchResult{}, "{}") u := &RepositoriesSearchResult{ @@ -639,6 +661,7 @@ func TestRepositoriesSearchResult_Marshal(t *testing.T) { } func TestCommitsSearchResult_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &CommitsSearchResult{}, "{}") c := &CommitsSearchResult{ @@ -659,6 +682,7 @@ func TestCommitsSearchResult_Marshal(t *testing.T) { } func TestTopicsSearchResult_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &TopicsSearchResult{}, "{}") u := &TopicsSearchResult{ @@ -703,6 +727,7 @@ func TestTopicsSearchResult_Marshal(t *testing.T) { } func TestLabelResult_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &LabelResult{}, "{}") u := &LabelResult{ @@ -729,6 +754,7 @@ func TestLabelResult_Marshal(t *testing.T) { } func TestSearchOptions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &SearchOptions{}, "{}") u := &SearchOptions{ @@ -752,6 +778,7 @@ func TestSearchOptions_Marshal(t *testing.T) { } func TestIssuesSearchResult_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &IssuesSearchResult{}, "{}") u := &IssuesSearchResult{ @@ -860,6 +887,7 @@ func TestIssuesSearchResult_Marshal(t *testing.T) { } func TestLabelsSearchResult_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &LabelsSearchResult{}, "{}") u := &LabelsSearchResult{ @@ -898,6 +926,7 @@ func TestLabelsSearchResult_Marshal(t *testing.T) { } func TestCommitResult_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &CommitResult{}, "{}") c := &CommitResult{ @@ -937,6 +966,7 @@ func TestCommitResult_Marshal(t *testing.T) { } func TestUsersSearchResult_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &UsersSearchResult{}, "{}") u := &UsersSearchResult{ @@ -973,6 +1003,7 @@ func TestUsersSearchResult_Marshal(t *testing.T) { } func TestCodeSearchResult_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &CodeSearchResult{}, "{}") u := &CodeSearchResult{ diff --git a/github/secret_scanning_test.go b/github/secret_scanning_test.go index c9336f0fb87..6bb57ffe1dd 100644 --- a/github/secret_scanning_test.go +++ b/github/secret_scanning_test.go @@ -17,6 +17,7 @@ import ( ) func TestSecretScanningService_ListAlertsForEnterprise(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/secret-scanning/alerts", func(w http.ResponseWriter, r *http.Request) { @@ -91,6 +92,7 @@ func TestSecretScanningService_ListAlertsForEnterprise(t *testing.T) { } func TestSecretScanningService_ListAlertsForOrg(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/secret-scanning/alerts", func(w http.ResponseWriter, r *http.Request) { @@ -155,6 +157,7 @@ func TestSecretScanningService_ListAlertsForOrg(t *testing.T) { } func TestSecretScanningService_ListAlertsForOrgListOptions(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/secret-scanning/alerts", func(w http.ResponseWriter, r *http.Request) { @@ -221,6 +224,7 @@ func TestSecretScanningService_ListAlertsForOrgListOptions(t *testing.T) { } func TestSecretScanningService_ListAlertsForRepo(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/secret-scanning/alerts", func(w http.ResponseWriter, r *http.Request) { @@ -285,6 +289,7 @@ func TestSecretScanningService_ListAlertsForRepo(t *testing.T) { } func TestSecretScanningService_GetAlert(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/secret-scanning/alerts/1", func(w http.ResponseWriter, r *http.Request) { @@ -345,6 +350,7 @@ func TestSecretScanningService_GetAlert(t *testing.T) { } func TestSecretScanningService_UpdateAlert(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/secret-scanning/alerts/1", func(w http.ResponseWriter, r *http.Request) { @@ -415,6 +421,7 @@ func TestSecretScanningService_UpdateAlert(t *testing.T) { } func TestSecretScanningService_ListLocationsForAlert(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/secret-scanning/alerts/1/locations", func(w http.ResponseWriter, r *http.Request) { @@ -480,6 +487,7 @@ func TestSecretScanningService_ListLocationsForAlert(t *testing.T) { } func TestSecretScanningAlert_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &SecretScanningAlert{}, `{}`) u := &SecretScanningAlert{ @@ -524,6 +532,7 @@ func TestSecretScanningAlert_Marshal(t *testing.T) { } func TestSecretScanningAlertLocation_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &SecretScanningAlertLocation{}, `{}`) u := &SecretScanningAlertLocation{ @@ -560,6 +569,7 @@ func TestSecretScanningAlertLocation_Marshal(t *testing.T) { } func TestSecretScanningAlertLocationDetails_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &SecretScanningAlertLocationDetails{}, `{}`) u := &SecretScanningAlertLocationDetails{ @@ -590,6 +600,7 @@ func TestSecretScanningAlertLocationDetails_Marshal(t *testing.T) { } func TestSecretScanningAlertUpdateOptions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &SecretScanningAlertUpdateOptions{}, `{}`) u := &SecretScanningAlertUpdateOptions{ diff --git a/github/security_advisories_test.go b/github/security_advisories_test.go index 614174f1ab8..8f5e1263570 100644 --- a/github/security_advisories_test.go +++ b/github/security_advisories_test.go @@ -17,6 +17,7 @@ import ( ) func TestSecurityAdvisoriesService_RequestCVE(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/security-advisories/ghsa_id_ok/cve", func(w http.ResponseWriter, r *http.Request) { @@ -56,6 +57,7 @@ func TestSecurityAdvisoriesService_RequestCVE(t *testing.T) { } func TestSecurityAdvisoriesService_CreateTemporaryPrivateFork(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/security-advisories/ghsa_id/forks", func(w http.ResponseWriter, r *http.Request) { @@ -290,6 +292,7 @@ func TestSecurityAdvisoriesService_CreateTemporaryPrivateFork(t *testing.T) { } func TestSecurityAdvisoriesService_CreateTemporaryPrivateFork_deferred(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/security-advisories/ghsa_id/forks", func(w http.ResponseWriter, r *http.Request) { @@ -511,6 +514,7 @@ func TestSecurityAdvisoriesService_CreateTemporaryPrivateFork_deferred(t *testin } func TestSecurityAdvisoriesService_CreateTemporaryPrivateFork_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -519,6 +523,7 @@ func TestSecurityAdvisoriesService_CreateTemporaryPrivateFork_invalidOwner(t *te } func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisoriesForOrg_BadRequest(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/security-advisories", func(w http.ResponseWriter, r *http.Request) { @@ -541,6 +546,7 @@ func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisoriesForOrg_BadReq } func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisoriesForOrg_NotFound(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/security-advisories", func(w http.ResponseWriter, r *http.Request) { @@ -570,6 +576,7 @@ func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisoriesForOrg_NotFou } func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisoriesForOrg_UnmarshalError(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/security-advisories", func(w http.ResponseWriter, r *http.Request) { @@ -595,6 +602,7 @@ func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisoriesForOrg_Unmars } func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisoriesForOrg(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/security-advisories", func(w http.ResponseWriter, r *http.Request) { @@ -646,6 +654,7 @@ func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisoriesForOrg(t *tes } func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisories_BadRequest(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/security-advisories", func(w http.ResponseWriter, r *http.Request) { @@ -668,6 +677,7 @@ func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisories_BadRequest(t } func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisories_NotFound(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/security-advisories", func(w http.ResponseWriter, r *http.Request) { @@ -697,6 +707,7 @@ func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisories_NotFound(t * } func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisories_UnmarshalError(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/security-advisories", func(w http.ResponseWriter, r *http.Request) { @@ -722,6 +733,7 @@ func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisories_UnmarshalErr } func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisories(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/repos/o/r/security-advisories", func(w http.ResponseWriter, r *http.Request) { @@ -773,6 +785,7 @@ func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisories(t *testing.T } func TestListGlobalSecurityAdvisories(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/advisories", func(w http.ResponseWriter, r *http.Request) { @@ -958,6 +971,7 @@ func TestListGlobalSecurityAdvisories(t *testing.T) { } func TestGetGlobalSecurityAdvisories(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/advisories/GHSA-xoxo-1234-xoxo", func(w http.ResponseWriter, r *http.Request) { @@ -1147,6 +1161,7 @@ func TestGetGlobalSecurityAdvisories(t *testing.T) { } func TestSecurityAdvisorySubmission_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &SecurityAdvisorySubmission{}, `{}`) u := &SecurityAdvisorySubmission{ @@ -1161,6 +1176,7 @@ func TestSecurityAdvisorySubmission_Marshal(t *testing.T) { } func TestRepoAdvisoryCredit_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &RepoAdvisoryCredit{}, `{}`) u := &RepoAdvisoryCredit{ @@ -1177,6 +1193,7 @@ func TestRepoAdvisoryCredit_Marshal(t *testing.T) { } func TestRepoAdvisoryCreditDetailed_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &RepoAdvisoryCreditDetailed{}, `{}`) testDate := &Timestamp{time.Date(2019, time.August, 10, 14, 59, 22, 0, time.UTC)} @@ -1316,6 +1333,7 @@ func TestRepoAdvisoryCreditDetailed_Marshal(t *testing.T) { } func TestCredit_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Credit{}, `{}`) testDate := &Timestamp{time.Date(2019, time.August, 10, 14, 59, 22, 0, time.UTC)} @@ -1453,6 +1471,7 @@ func TestCredit_Marshal(t *testing.T) { } func TestGlobalSecurityAdvisory_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &GlobalSecurityAdvisory{}, `{}`) testDate := &Timestamp{time.Date(2019, time.August, 10, 14, 59, 22, 0, time.UTC)} diff --git a/github/strings_test.go b/github/strings_test.go index fc0f6bafcf3..79ec1fa3c22 100644 --- a/github/strings_test.go +++ b/github/strings_test.go @@ -12,6 +12,7 @@ import ( ) func TestStringify(t *testing.T) { + t.Parallel() var nilPointer *string var tests = []struct { @@ -85,6 +86,7 @@ func TestStringify(t *testing.T) { // used to build the strings, which we do by verifying that pointers are // stringified as their underlying value. func TestString(t *testing.T) { + t.Parallel() var tests = []struct { in interface{} out string diff --git a/github/teams_discussion_comments_test.go b/github/teams_discussion_comments_test.go index adc30aa99a5..8c09568178e 100644 --- a/github/teams_discussion_comments_test.go +++ b/github/teams_discussion_comments_test.go @@ -35,6 +35,7 @@ func tdcEndpointBySlug(org, slug, discussionNumber, commentNumber string) string } func TestTeamsService_ListComments(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) handleFunc := func(w http.ResponseWriter, r *http.Request) { @@ -175,6 +176,7 @@ func TestTeamsService_ListComments(t *testing.T) { } func TestTeamsService_GetComment(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) handlerFunc := func(w http.ResponseWriter, r *http.Request) { @@ -238,6 +240,7 @@ func TestTeamsService_GetComment(t *testing.T) { } func TestTeamsService_CreateComment(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := DiscussionComment{Body: String("c")} @@ -310,6 +313,7 @@ func TestTeamsService_CreateComment(t *testing.T) { } func TestTeamsService_EditComment(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := DiscussionComment{Body: String("e")} @@ -381,6 +385,7 @@ func TestTeamsService_EditComment(t *testing.T) { } func TestTeamsService_DeleteComment(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) handlerFunc := func(w http.ResponseWriter, r *http.Request) { @@ -428,6 +433,7 @@ func TestTeamsService_DeleteComment(t *testing.T) { } func TestDiscussionComment_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &DiscussionComment{}, "{}") u := &DiscussionComment{ diff --git a/github/teams_discussions_test.go b/github/teams_discussions_test.go index 4db4039b7ce..3033a84da25 100644 --- a/github/teams_discussions_test.go +++ b/github/teams_discussions_test.go @@ -17,6 +17,7 @@ import ( ) func TestTeamsService_ListDiscussionsByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/2/discussions", func(w http.ResponseWriter, r *http.Request) { @@ -131,6 +132,7 @@ func TestTeamsService_ListDiscussionsByID(t *testing.T) { } func TestTeamsService_ListDiscussionsBySlug(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s/discussions", func(w http.ResponseWriter, r *http.Request) { @@ -245,6 +247,7 @@ func TestTeamsService_ListDiscussionsBySlug(t *testing.T) { } func TestTeamsService_GetDiscussionByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/2/discussions/3", func(w http.ResponseWriter, r *http.Request) { @@ -279,6 +282,7 @@ func TestTeamsService_GetDiscussionByID(t *testing.T) { } func TestTeamsService_GetDiscussionBySlug(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s/discussions/3", func(w http.ResponseWriter, r *http.Request) { @@ -313,6 +317,7 @@ func TestTeamsService_GetDiscussionBySlug(t *testing.T) { } func TestTeamsService_CreateDiscussionByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := TeamDiscussion{Title: String("c_t"), Body: String("c_b")} @@ -356,6 +361,7 @@ func TestTeamsService_CreateDiscussionByID(t *testing.T) { } func TestTeamsService_CreateDiscussionBySlug(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := TeamDiscussion{Title: String("c_t"), Body: String("c_b")} @@ -399,6 +405,7 @@ func TestTeamsService_CreateDiscussionBySlug(t *testing.T) { } func TestTeamsService_EditDiscussionByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := TeamDiscussion{Title: String("e_t"), Body: String("e_b")} @@ -442,6 +449,7 @@ func TestTeamsService_EditDiscussionByID(t *testing.T) { } func TestTeamsService_EditDiscussionBySlug(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := TeamDiscussion{Title: String("e_t"), Body: String("e_b")} @@ -485,6 +493,7 @@ func TestTeamsService_EditDiscussionBySlug(t *testing.T) { } func TestTeamsService_DeleteDiscussionByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/2/discussions/3", func(w http.ResponseWriter, r *http.Request) { @@ -509,6 +518,7 @@ func TestTeamsService_DeleteDiscussionByID(t *testing.T) { } func TestTeamsService_DeleteDiscussionBySlug(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s/discussions/3", func(w http.ResponseWriter, r *http.Request) { @@ -533,6 +543,7 @@ func TestTeamsService_DeleteDiscussionBySlug(t *testing.T) { } func TestTeamDiscussion_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &TeamDiscussion{}, "{}") u := &TeamDiscussion{ diff --git a/github/teams_members_test.go b/github/teams_members_test.go index 5044cfd4971..1af751285ad 100644 --- a/github/teams_members_test.go +++ b/github/teams_members_test.go @@ -16,6 +16,7 @@ import ( ) func TestTeamsService__ListTeamMembersByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/2/members", func(w http.ResponseWriter, r *http.Request) { @@ -52,6 +53,7 @@ func TestTeamsService__ListTeamMembersByID(t *testing.T) { } func TestTeamsService__ListTeamMembersByID_notFound(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/2/members", func(w http.ResponseWriter, r *http.Request) { @@ -89,6 +91,7 @@ func TestTeamsService__ListTeamMembersByID_notFound(t *testing.T) { } func TestTeamsService__ListTeamMembersBySlug(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s/members", func(w http.ResponseWriter, r *http.Request) { @@ -125,6 +128,7 @@ func TestTeamsService__ListTeamMembersBySlug(t *testing.T) { } func TestTeamsService__ListTeamMembersBySlug_notFound(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s/members", func(w http.ResponseWriter, r *http.Request) { @@ -162,6 +166,7 @@ func TestTeamsService__ListTeamMembersBySlug_notFound(t *testing.T) { } func TestTeamsService__ListTeamMembersBySlug_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -170,6 +175,7 @@ func TestTeamsService__ListTeamMembersBySlug_invalidOrg(t *testing.T) { } func TestTeamsService__GetTeamMembershipByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/2/memberships/u", func(w http.ResponseWriter, r *http.Request) { @@ -204,6 +210,7 @@ func TestTeamsService__GetTeamMembershipByID(t *testing.T) { } func TestTeamsService__GetTeamMembershipByID_notFound(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/2/memberships/u", func(w http.ResponseWriter, r *http.Request) { @@ -239,6 +246,7 @@ func TestTeamsService__GetTeamMembershipByID_notFound(t *testing.T) { } func TestTeamsService__GetTeamMembershipBySlug(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s/memberships/u", func(w http.ResponseWriter, r *http.Request) { @@ -273,6 +281,7 @@ func TestTeamsService__GetTeamMembershipBySlug(t *testing.T) { } func TestTeamsService__GetTeamMembershipBySlug_notFound(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s/memberships/u", func(w http.ResponseWriter, r *http.Request) { @@ -308,6 +317,7 @@ func TestTeamsService__GetTeamMembershipBySlug_notFound(t *testing.T) { } func TestTeamsService__GetTeamMembershipBySlug_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -316,6 +326,7 @@ func TestTeamsService__GetTeamMembershipBySlug_invalidOrg(t *testing.T) { } func TestTeamsService__AddTeamMembershipByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) opt := &TeamAddTeamMembershipOptions{Role: "maintainer"} @@ -359,6 +370,7 @@ func TestTeamsService__AddTeamMembershipByID(t *testing.T) { } func TestTeamsService__AddTeamMembershipByID_notFound(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) opt := &TeamAddTeamMembershipOptions{Role: "maintainer"} @@ -403,6 +415,7 @@ func TestTeamsService__AddTeamMembershipByID_notFound(t *testing.T) { } func TestTeamsService__AddTeamMembershipBySlug(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) opt := &TeamAddTeamMembershipOptions{Role: "maintainer"} @@ -446,6 +459,7 @@ func TestTeamsService__AddTeamMembershipBySlug(t *testing.T) { } func TestTeamsService__AddTeamMembershipBySlug_notFound(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) opt := &TeamAddTeamMembershipOptions{Role: "maintainer"} @@ -490,6 +504,7 @@ func TestTeamsService__AddTeamMembershipBySlug_notFound(t *testing.T) { } func TestTeamsService__AddTeamMembershipBySlug_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -498,6 +513,7 @@ func TestTeamsService__AddTeamMembershipBySlug_invalidOrg(t *testing.T) { } func TestTeamsService__RemoveTeamMembershipByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/2/memberships/u", func(w http.ResponseWriter, r *http.Request) { @@ -523,6 +539,7 @@ func TestTeamsService__RemoveTeamMembershipByID(t *testing.T) { } func TestTeamsService__RemoveTeamMembershipByID_notFound(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/2/memberships/u", func(w http.ResponseWriter, r *http.Request) { @@ -551,6 +568,7 @@ func TestTeamsService__RemoveTeamMembershipByID_notFound(t *testing.T) { } func TestTeamsService__RemoveTeamMembershipBySlug(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s/memberships/u", func(w http.ResponseWriter, r *http.Request) { @@ -576,6 +594,7 @@ func TestTeamsService__RemoveTeamMembershipBySlug(t *testing.T) { } func TestTeamsService__RemoveTeamMembershipBySlug_notFound(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s/memberships/u", func(w http.ResponseWriter, r *http.Request) { @@ -604,6 +623,7 @@ func TestTeamsService__RemoveTeamMembershipBySlug_notFound(t *testing.T) { } func TestTeamsService__RemoveTeamMembershipBySlug_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -612,6 +632,7 @@ func TestTeamsService__RemoveTeamMembershipBySlug_invalidOrg(t *testing.T) { } func TestTeamsService__ListPendingTeamInvitationsByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/2/invitations", func(w http.ResponseWriter, r *http.Request) { @@ -648,6 +669,7 @@ func TestTeamsService__ListPendingTeamInvitationsByID(t *testing.T) { } func TestTeamsService__ListPendingTeamInvitationsByID_notFound(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/2/invitations", func(w http.ResponseWriter, r *http.Request) { @@ -685,6 +707,7 @@ func TestTeamsService__ListPendingTeamInvitationsByID_notFound(t *testing.T) { } func TestTeamsService__ListPendingTeamInvitationsBySlug(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s/invitations", func(w http.ResponseWriter, r *http.Request) { @@ -721,6 +744,7 @@ func TestTeamsService__ListPendingTeamInvitationsBySlug(t *testing.T) { } func TestTeamsService__ListPendingTeamInvitationsBySlug_notFound(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s/invitations", func(w http.ResponseWriter, r *http.Request) { @@ -758,6 +782,7 @@ func TestTeamsService__ListPendingTeamInvitationsBySlug_notFound(t *testing.T) { } func TestTeamsService__ListPendingTeamInvitationsBySlug_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -766,6 +791,7 @@ func TestTeamsService__ListPendingTeamInvitationsBySlug_invalidOrg(t *testing.T) } func TestTeamAddTeamMembershipOptions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &TeamAddTeamMembershipOptions{}, "{}") u := &TeamAddTeamMembershipOptions{ @@ -780,6 +806,7 @@ func TestTeamAddTeamMembershipOptions_Marshal(t *testing.T) { } func TestTeamListTeamMembersOptions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &TeamListTeamMembersOptions{}, "{}") u := &TeamListTeamMembersOptions{ diff --git a/github/teams_test.go b/github/teams_test.go index 74a01cbb9e3..568b1aa5960 100644 --- a/github/teams_test.go +++ b/github/teams_test.go @@ -19,6 +19,7 @@ import ( ) func TestTeamsService_ListTeams(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams", func(w http.ResponseWriter, r *http.Request) { @@ -55,6 +56,7 @@ func TestTeamsService_ListTeams(t *testing.T) { } func TestTeamsService_ListTeams_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -63,6 +65,7 @@ func TestTeamsService_ListTeams_invalidOrg(t *testing.T) { } func TestTeamsService_GetTeamByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/1", func(w http.ResponseWriter, r *http.Request) { @@ -97,6 +100,7 @@ func TestTeamsService_GetTeamByID(t *testing.T) { } func TestTeamsService_GetTeamByID_notFound(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/2", func(w http.ResponseWriter, r *http.Request) { @@ -118,6 +122,7 @@ func TestTeamsService_GetTeamByID_notFound(t *testing.T) { } func TestTeamsService_GetTeamBySlug(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s", func(w http.ResponseWriter, r *http.Request) { @@ -152,6 +157,7 @@ func TestTeamsService_GetTeamBySlug(t *testing.T) { } func TestTeamsService_GetTeamBySlug_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -160,6 +166,7 @@ func TestTeamsService_GetTeamBySlug_invalidOrg(t *testing.T) { } func TestTeamsService_GetTeamBySlug_notFound(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s", func(w http.ResponseWriter, r *http.Request) { @@ -181,6 +188,7 @@ func TestTeamsService_GetTeamBySlug_notFound(t *testing.T) { } func TestTeamsService_CreateTeam(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := NewTeam{Name: "n", Privacy: String("closed"), RepoNames: []string{"r"}} @@ -224,6 +232,7 @@ func TestTeamsService_CreateTeam(t *testing.T) { } func TestTeamsService_CreateTeam_invalidOrg(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -232,6 +241,7 @@ func TestTeamsService_CreateTeam_invalidOrg(t *testing.T) { } func TestTeamsService_EditTeamByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := NewTeam{Name: "n", Privacy: String("closed")} @@ -275,6 +285,7 @@ func TestTeamsService_EditTeamByID(t *testing.T) { } func TestTeamsService_EditTeamByID_RemoveParent(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := NewTeam{Name: "n", NotificationSetting: String("notifications_enabled"), Privacy: String("closed")} @@ -314,6 +325,7 @@ func TestTeamsService_EditTeamByID_RemoveParent(t *testing.T) { } func TestTeamsService_EditTeamBySlug(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := NewTeam{Name: "n", Privacy: String("closed")} @@ -357,6 +369,7 @@ func TestTeamsService_EditTeamBySlug(t *testing.T) { } func TestTeamsService_EditTeamBySlug_RemoveParent(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := NewTeam{Name: "n", NotificationSetting: String("notifications_disabled"), Privacy: String("closed")} @@ -396,6 +409,7 @@ func TestTeamsService_EditTeamBySlug_RemoveParent(t *testing.T) { } func TestTeamsService_DeleteTeamByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/1", func(w http.ResponseWriter, r *http.Request) { @@ -420,6 +434,7 @@ func TestTeamsService_DeleteTeamByID(t *testing.T) { } func TestTeamsService_DeleteTeamBySlug(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s", func(w http.ResponseWriter, r *http.Request) { @@ -444,6 +459,7 @@ func TestTeamsService_DeleteTeamBySlug(t *testing.T) { } func TestTeamsService_ListChildTeamsByParentID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/2/teams", func(w http.ResponseWriter, r *http.Request) { @@ -480,6 +496,7 @@ func TestTeamsService_ListChildTeamsByParentID(t *testing.T) { } func TestTeamsService_ListChildTeamsByParentSlug(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s/teams", func(w http.ResponseWriter, r *http.Request) { @@ -516,6 +533,7 @@ func TestTeamsService_ListChildTeamsByParentSlug(t *testing.T) { } func TestTeamsService_ListTeamReposByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/1/repos", func(w http.ResponseWriter, r *http.Request) { @@ -554,6 +572,7 @@ func TestTeamsService_ListTeamReposByID(t *testing.T) { } func TestTeamsService_ListTeamReposBySlug(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/s/repos", func(w http.ResponseWriter, r *http.Request) { @@ -592,6 +611,7 @@ func TestTeamsService_ListTeamReposBySlug(t *testing.T) { } func TestTeamsService_IsTeamRepoByID_true(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/1/repos/owner/repo", func(w http.ResponseWriter, r *http.Request) { @@ -628,6 +648,7 @@ func TestTeamsService_IsTeamRepoByID_true(t *testing.T) { } func TestTeamsService_IsTeamRepoBySlug_true(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/org/teams/slug/repos/owner/repo", func(w http.ResponseWriter, r *http.Request) { @@ -664,6 +685,7 @@ func TestTeamsService_IsTeamRepoBySlug_true(t *testing.T) { } func TestTeamsService_IsTeamRepoByID_false(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/1/repos/owner/repo", func(w http.ResponseWriter, r *http.Request) { @@ -685,6 +707,7 @@ func TestTeamsService_IsTeamRepoByID_false(t *testing.T) { } func TestTeamsService_IsTeamRepoBySlug_false(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/org/teams/slug/repos/o/r", func(w http.ResponseWriter, r *http.Request) { @@ -706,6 +729,7 @@ func TestTeamsService_IsTeamRepoBySlug_false(t *testing.T) { } func TestTeamsService_IsTeamRepoByID_error(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/1/repos/owner/repo", func(w http.ResponseWriter, r *http.Request) { @@ -727,6 +751,7 @@ func TestTeamsService_IsTeamRepoByID_error(t *testing.T) { } func TestTeamsService_IsTeamRepoBySlug_error(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/org/teams/slug/repos/owner/repo", func(w http.ResponseWriter, r *http.Request) { @@ -748,6 +773,7 @@ func TestTeamsService_IsTeamRepoBySlug_error(t *testing.T) { } func TestTeamsService_IsTeamRepoByID_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -756,6 +782,7 @@ func TestTeamsService_IsTeamRepoByID_invalidOwner(t *testing.T) { } func TestTeamsService_IsTeamRepoBySlug_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -764,6 +791,7 @@ func TestTeamsService_IsTeamRepoBySlug_invalidOwner(t *testing.T) { } func TestTeamsService_AddTeamRepoByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) opt := &TeamAddTeamRepoOptions{Permission: "admin"} @@ -798,6 +826,7 @@ func TestTeamsService_AddTeamRepoByID(t *testing.T) { } func TestTeamsService_AddTeamRepoBySlug(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) opt := &TeamAddTeamRepoOptions{Permission: "admin"} @@ -832,6 +861,7 @@ func TestTeamsService_AddTeamRepoBySlug(t *testing.T) { } func TestTeamsService_AddTeamRepoByID_noAccess(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/1/repos/owner/repo", func(w http.ResponseWriter, r *http.Request) { @@ -847,6 +877,7 @@ func TestTeamsService_AddTeamRepoByID_noAccess(t *testing.T) { } func TestTeamsService_AddTeamRepoBySlug_noAccess(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/org/teams/slug/repos/o/r", func(w http.ResponseWriter, r *http.Request) { @@ -862,6 +893,7 @@ func TestTeamsService_AddTeamRepoBySlug_noAccess(t *testing.T) { } func TestTeamsService_AddTeamRepoByID_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -870,6 +902,7 @@ func TestTeamsService_AddTeamRepoByID_invalidOwner(t *testing.T) { } func TestTeamsService_AddTeamRepoBySlug_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -878,6 +911,7 @@ func TestTeamsService_AddTeamRepoBySlug_invalidOwner(t *testing.T) { } func TestTeamsService_RemoveTeamRepoByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/1/repos/owner/repo", func(w http.ResponseWriter, r *http.Request) { @@ -903,6 +937,7 @@ func TestTeamsService_RemoveTeamRepoByID(t *testing.T) { } func TestTeamsService_RemoveTeamRepoBySlug(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/org/teams/slug/repos/owner/repo", func(w http.ResponseWriter, r *http.Request) { @@ -928,6 +963,7 @@ func TestTeamsService_RemoveTeamRepoBySlug(t *testing.T) { } func TestTeamsService_RemoveTeamRepoByID_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -936,6 +972,7 @@ func TestTeamsService_RemoveTeamRepoByID_invalidOwner(t *testing.T) { } func TestTeamsService_RemoveTeamRepoBySlug_invalidOwner(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -944,6 +981,7 @@ func TestTeamsService_RemoveTeamRepoBySlug_invalidOwner(t *testing.T) { } func TestTeamsService_ListUserTeams(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/teams", func(w http.ResponseWriter, r *http.Request) { @@ -975,6 +1013,7 @@ func TestTeamsService_ListUserTeams(t *testing.T) { } func TestTeamsService_ListProjectsByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) wantAcceptHeaders := []string{mediaTypeProjectsPreview} @@ -1011,6 +1050,7 @@ func TestTeamsService_ListProjectsByID(t *testing.T) { } func TestTeamsService_ListProjectsBySlug(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) wantAcceptHeaders := []string{mediaTypeProjectsPreview} @@ -1047,6 +1087,7 @@ func TestTeamsService_ListProjectsBySlug(t *testing.T) { } func TestTeamsService_ReviewProjectsByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) wantAcceptHeaders := []string{mediaTypeProjectsPreview} @@ -1083,6 +1124,7 @@ func TestTeamsService_ReviewProjectsByID(t *testing.T) { } func TestTeamsService_ReviewProjectsBySlug(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) wantAcceptHeaders := []string{mediaTypeProjectsPreview} @@ -1119,6 +1161,7 @@ func TestTeamsService_ReviewProjectsBySlug(t *testing.T) { } func TestTeamsService_AddTeamProjectByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) opt := &TeamProjectOptions{ @@ -1157,6 +1200,7 @@ func TestTeamsService_AddTeamProjectByID(t *testing.T) { } func TestTeamsService_AddTeamProjectBySlug(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) opt := &TeamProjectOptions{ @@ -1195,6 +1239,7 @@ func TestTeamsService_AddTeamProjectBySlug(t *testing.T) { } func TestTeamsService_RemoveTeamProjectByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) wantAcceptHeaders := []string{mediaTypeProjectsPreview} @@ -1222,6 +1267,7 @@ func TestTeamsService_RemoveTeamProjectByID(t *testing.T) { } func TestTeamsService_RemoveTeamProjectBySlug(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) wantAcceptHeaders := []string{mediaTypeProjectsPreview} @@ -1249,6 +1295,7 @@ func TestTeamsService_RemoveTeamProjectBySlug(t *testing.T) { } func TestTeamsService_ListIDPGroupsInOrganization(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/team-sync/groups", func(w http.ResponseWriter, r *http.Request) { @@ -1299,6 +1346,7 @@ func TestTeamsService_ListIDPGroupsInOrganization(t *testing.T) { } func TestTeamsService_ListIDPGroupsForTeamByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/1/team-sync/group-mappings", func(w http.ResponseWriter, r *http.Request) { @@ -1341,6 +1389,7 @@ func TestTeamsService_ListIDPGroupsForTeamByID(t *testing.T) { } func TestTeamsService_ListIDPGroupsForTeamBySlug(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/slug/team-sync/group-mappings", func(w http.ResponseWriter, r *http.Request) { @@ -1383,6 +1432,7 @@ func TestTeamsService_ListIDPGroupsForTeamBySlug(t *testing.T) { } func TestTeamsService_CreateOrUpdateIDPGroupConnectionsByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/1/team-sync/group-mappings", func(w http.ResponseWriter, r *http.Request) { @@ -1435,6 +1485,7 @@ func TestTeamsService_CreateOrUpdateIDPGroupConnectionsByID(t *testing.T) { } func TestTeamsService_CreateOrUpdateIDPGroupConnectionsBySlug(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/slug/team-sync/group-mappings", func(w http.ResponseWriter, r *http.Request) { @@ -1486,6 +1537,7 @@ func TestTeamsService_CreateOrUpdateIDPGroupConnectionsBySlug(t *testing.T) { }) } func TestTeamsService_CreateOrUpdateIDPGroupConnectionsByID_empty(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/organizations/1/team/1/team-sync/group-mappings", func(w http.ResponseWriter, r *http.Request) { @@ -1512,6 +1564,7 @@ func TestTeamsService_CreateOrUpdateIDPGroupConnectionsByID_empty(t *testing.T) } func TestTeamsService_CreateOrUpdateIDPGroupConnectionsBySlug_empty(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/slug/team-sync/group-mappings", func(w http.ResponseWriter, r *http.Request) { @@ -1538,6 +1591,7 @@ func TestTeamsService_CreateOrUpdateIDPGroupConnectionsBySlug_empty(t *testing.T } func TestNewTeam_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &NewTeam{}, "{}") u := &NewTeam{ @@ -1568,6 +1622,7 @@ func TestNewTeam_Marshal(t *testing.T) { } func TestTeams_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Team{}, "{}") u := &Team{ @@ -1654,6 +1709,7 @@ func TestTeams_Marshal(t *testing.T) { } func TestInvitation_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Invitation{}, "{}") u := &Invitation{ @@ -1682,6 +1738,7 @@ func TestInvitation_Marshal(t *testing.T) { } func TestIDPGroup_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &IDPGroup{}, "{}") u := &IDPGroup{ @@ -1700,6 +1757,7 @@ func TestIDPGroup_Marshal(t *testing.T) { } func TestTeamsService_GetExternalGroup(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/external-group/123", func(w http.ResponseWriter, r *http.Request) { @@ -1790,6 +1848,7 @@ func TestTeamsService_GetExternalGroup(t *testing.T) { } func TestTeamsService_GetExternalGroup_notFound(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/external-group/123", func(w http.ResponseWriter, r *http.Request) { @@ -1811,6 +1870,7 @@ func TestTeamsService_GetExternalGroup_notFound(t *testing.T) { } func TestTeamsService_ListExternalGroups(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/external-groups", func(w http.ResponseWriter, r *http.Request) { @@ -1864,6 +1924,7 @@ func TestTeamsService_ListExternalGroups(t *testing.T) { } func TestTeamsService_ListExternalGroups_notFound(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/external-groups", func(w http.ResponseWriter, r *http.Request) { @@ -1885,6 +1946,7 @@ func TestTeamsService_ListExternalGroups_notFound(t *testing.T) { } func TestTeamsService_ListExternalGroupsForTeamBySlug(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/t/external-groups", func(w http.ResponseWriter, r *http.Request) { @@ -1935,6 +1997,7 @@ func TestTeamsService_ListExternalGroupsForTeamBySlug(t *testing.T) { } func TestTeamsService_ListExternalGroupsForTeamBySlug_notFound(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/t/external-groups", func(w http.ResponseWriter, r *http.Request) { @@ -1956,6 +2019,7 @@ func TestTeamsService_ListExternalGroupsForTeamBySlug_notFound(t *testing.T) { } func TestTeamsService_UpdateConnectedExternalGroup(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/t/external-groups", func(w http.ResponseWriter, r *http.Request) { @@ -2049,6 +2113,7 @@ func TestTeamsService_UpdateConnectedExternalGroup(t *testing.T) { } func TestTeamsService_UpdateConnectedExternalGroup_notFound(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/t/external-groups", func(w http.ResponseWriter, r *http.Request) { @@ -2073,6 +2138,7 @@ func TestTeamsService_UpdateConnectedExternalGroup_notFound(t *testing.T) { } func TestTeamsService_RemoveConnectedExternalGroup(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/t/external-groups", func(w http.ResponseWriter, r *http.Request) { @@ -2098,6 +2164,7 @@ func TestTeamsService_RemoveConnectedExternalGroup(t *testing.T) { } func TestTeamsService_RemoveConnectedExternalGroup_notFound(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/teams/t/external-groups", func(w http.ResponseWriter, r *http.Request) { @@ -2116,6 +2183,7 @@ func TestTeamsService_RemoveConnectedExternalGroup_notFound(t *testing.T) { } func TestIDPGroupList_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &IDPGroupList{}, "{}") u := &IDPGroupList{ @@ -2152,6 +2220,7 @@ func TestIDPGroupList_Marshal(t *testing.T) { } func TestExternalGroupMember_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ExternalGroupMember{}, "{}") u := &ExternalGroupMember{ @@ -2172,6 +2241,7 @@ func TestExternalGroupMember_Marshal(t *testing.T) { } func TestExternalGroup_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ExternalGroup{}, "{}") u := &ExternalGroup{ @@ -2226,6 +2296,7 @@ func TestExternalGroup_Marshal(t *testing.T) { } func TestExternalGroupTeam_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ExternalGroupTeam{}, "{}") u := &ExternalGroupTeam{ @@ -2242,6 +2313,7 @@ func TestExternalGroupTeam_Marshal(t *testing.T) { } func TestListExternalGroupsOptions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &ListExternalGroupsOptions{}, "{}") u := &ListExternalGroupsOptions{ @@ -2262,6 +2334,7 @@ func TestListExternalGroupsOptions_Marshal(t *testing.T) { } func TestTeamAddTeamRepoOptions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &TeamAddTeamRepoOptions{}, "{}") u := &TeamAddTeamRepoOptions{ diff --git a/github/timestamp_test.go b/github/timestamp_test.go index 69245b60d73..4107a4fa6e4 100644 --- a/github/timestamp_test.go +++ b/github/timestamp_test.go @@ -26,6 +26,7 @@ var ( ) func TestTimestamp_Marshal(t *testing.T) { + t.Parallel() testCases := []struct { desc string data Timestamp @@ -51,6 +52,7 @@ func TestTimestamp_Marshal(t *testing.T) { } func TestTimestamp_Unmarshal(t *testing.T) { + t.Parallel() testCases := []struct { desc string data string @@ -84,6 +86,7 @@ func TestTimestamp_Unmarshal(t *testing.T) { } func TestTimestamp_MarshalReflexivity(t *testing.T) { + t.Parallel() testCases := []struct { desc string data Timestamp @@ -113,6 +116,7 @@ type WrappedTimestamp struct { } func TestWrappedTimestamp_Marshal(t *testing.T) { + t.Parallel() testCases := []struct { desc string data WrappedTimestamp @@ -138,6 +142,7 @@ func TestWrappedTimestamp_Marshal(t *testing.T) { } func TestWrappedTimestamp_Unmarshal(t *testing.T) { + t.Parallel() testCases := []struct { desc string data string @@ -170,6 +175,7 @@ func TestWrappedTimestamp_Unmarshal(t *testing.T) { } func TestTimestamp_GetTime(t *testing.T) { + t.Parallel() var t1 *Timestamp if t1.GetTime() != nil { t.Errorf("nil timestamp should return nil, got: %v", t1.GetTime()) @@ -181,6 +187,7 @@ func TestTimestamp_GetTime(t *testing.T) { } func TestWrappedTimestamp_MarshalReflexivity(t *testing.T) { + t.Parallel() testCases := []struct { desc string data WrappedTimestamp diff --git a/github/users_administration_test.go b/github/users_administration_test.go index 57e9807f51e..52270dadc62 100644 --- a/github/users_administration_test.go +++ b/github/users_administration_test.go @@ -15,6 +15,7 @@ import ( ) func TestUsersService_PromoteSiteAdmin(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/site_admin", func(w http.ResponseWriter, r *http.Request) { @@ -40,6 +41,7 @@ func TestUsersService_PromoteSiteAdmin(t *testing.T) { } func TestUsersService_DemoteSiteAdmin(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/site_admin", func(w http.ResponseWriter, r *http.Request) { @@ -65,6 +67,7 @@ func TestUsersService_DemoteSiteAdmin(t *testing.T) { } func TestUsersService_Suspend(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/suspended", func(w http.ResponseWriter, r *http.Request) { @@ -90,6 +93,7 @@ func TestUsersService_Suspend(t *testing.T) { } func TestUsersServiceReason_Suspend(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &UserSuspendOptions{Reason: String("test")} @@ -114,6 +118,7 @@ func TestUsersServiceReason_Suspend(t *testing.T) { } func TestUsersService_Unsuspend(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/suspended", func(w http.ResponseWriter, r *http.Request) { @@ -139,6 +144,7 @@ func TestUsersService_Unsuspend(t *testing.T) { } func TestUserSuspendOptions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &UserSuspendOptions{}, "{}") u := &UserSuspendOptions{ diff --git a/github/users_blocking_test.go b/github/users_blocking_test.go index db94fd434d6..ca7fd97da5b 100644 --- a/github/users_blocking_test.go +++ b/github/users_blocking_test.go @@ -15,6 +15,7 @@ import ( ) func TestUsersService_ListBlockedUsers(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/blocks", func(w http.ResponseWriter, r *http.Request) { @@ -49,6 +50,7 @@ func TestUsersService_ListBlockedUsers(t *testing.T) { } func TestUsersService_IsBlocked(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/blocks/u", func(w http.ResponseWriter, r *http.Request) { @@ -82,6 +84,7 @@ func TestUsersService_IsBlocked(t *testing.T) { } func TestUsersService_BlockUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/blocks/u", func(w http.ResponseWriter, r *http.Request) { @@ -108,6 +111,7 @@ func TestUsersService_BlockUser(t *testing.T) { } func TestUsersService_UnblockUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/blocks/u", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/users_emails_test.go b/github/users_emails_test.go index 312137d39e9..bf3a403526f 100644 --- a/github/users_emails_test.go +++ b/github/users_emails_test.go @@ -16,6 +16,7 @@ import ( ) func TestUsersService_ListEmails(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/emails", func(w http.ResponseWriter, r *http.Request) { @@ -51,6 +52,7 @@ func TestUsersService_ListEmails(t *testing.T) { } func TestUsersService_AddEmails(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := []string{"new@example.com"} @@ -92,6 +94,7 @@ func TestUsersService_AddEmails(t *testing.T) { } func TestUsersService_DeleteEmails(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := []string{"user@example.com"} @@ -119,6 +122,7 @@ func TestUsersService_DeleteEmails(t *testing.T) { } func TestUserEmail_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &UserEmail{}, "{}") u := &UserEmail{ @@ -139,6 +143,7 @@ func TestUserEmail_Marshal(t *testing.T) { } func TestUsersService_SetEmailVisibility(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &UserEmail{Visibility: String("private")} diff --git a/github/users_followers_test.go b/github/users_followers_test.go index e7261488cc9..790739512b4 100644 --- a/github/users_followers_test.go +++ b/github/users_followers_test.go @@ -15,6 +15,7 @@ import ( ) func TestUsersService_ListFollowers_authenticatedUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/followers", func(w http.ResponseWriter, r *http.Request) { @@ -51,6 +52,7 @@ func TestUsersService_ListFollowers_authenticatedUser(t *testing.T) { } func TestUsersService_ListFollowers_specifiedUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/followers", func(w http.ResponseWriter, r *http.Request) { @@ -85,6 +87,7 @@ func TestUsersService_ListFollowers_specifiedUser(t *testing.T) { } func TestUsersService_ListFollowers_invalidUser(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -93,6 +96,7 @@ func TestUsersService_ListFollowers_invalidUser(t *testing.T) { } func TestUsersService_ListFollowing_authenticatedUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/following", func(w http.ResponseWriter, r *http.Request) { @@ -129,6 +133,7 @@ func TestUsersService_ListFollowing_authenticatedUser(t *testing.T) { } func TestUsersService_ListFollowing_specifiedUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/following", func(w http.ResponseWriter, r *http.Request) { @@ -163,6 +168,7 @@ func TestUsersService_ListFollowing_specifiedUser(t *testing.T) { } func TestUsersService_ListFollowing_invalidUser(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -171,6 +177,7 @@ func TestUsersService_ListFollowing_invalidUser(t *testing.T) { } func TestUsersService_IsFollowing_authenticatedUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/following/t", func(w http.ResponseWriter, r *http.Request) { @@ -203,6 +210,7 @@ func TestUsersService_IsFollowing_authenticatedUser(t *testing.T) { } func TestUsersService_IsFollowing_specifiedUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/following/t", func(w http.ResponseWriter, r *http.Request) { @@ -235,6 +243,7 @@ func TestUsersService_IsFollowing_specifiedUser(t *testing.T) { } func TestUsersService_IsFollowing_false(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/following/t", func(w http.ResponseWriter, r *http.Request) { @@ -267,6 +276,7 @@ func TestUsersService_IsFollowing_false(t *testing.T) { } func TestUsersService_IsFollowing_error(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/following/t", func(w http.ResponseWriter, r *http.Request) { @@ -299,6 +309,7 @@ func TestUsersService_IsFollowing_error(t *testing.T) { } func TestUsersService_IsFollowing_invalidUser(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -307,6 +318,7 @@ func TestUsersService_IsFollowing_invalidUser(t *testing.T) { } func TestUsersService_Follow(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/following/u", func(w http.ResponseWriter, r *http.Request) { @@ -331,6 +343,7 @@ func TestUsersService_Follow(t *testing.T) { } func TestUsersService_Follow_invalidUser(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -339,6 +352,7 @@ func TestUsersService_Follow_invalidUser(t *testing.T) { } func TestUsersService_Unfollow(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/following/u", func(w http.ResponseWriter, r *http.Request) { @@ -363,6 +377,7 @@ func TestUsersService_Unfollow(t *testing.T) { } func TestUsersService_Unfollow_invalidUser(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() diff --git a/github/users_gpg_keys_test.go b/github/users_gpg_keys_test.go index f2ee507948e..1d04f758e17 100644 --- a/github/users_gpg_keys_test.go +++ b/github/users_gpg_keys_test.go @@ -16,6 +16,7 @@ import ( ) func TestUsersService_ListGPGKeys_authenticatedUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/gpg_keys", func(w http.ResponseWriter, r *http.Request) { @@ -52,6 +53,7 @@ func TestUsersService_ListGPGKeys_authenticatedUser(t *testing.T) { } func TestUsersService_ListGPGKeys_specifiedUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/gpg_keys", func(w http.ResponseWriter, r *http.Request) { @@ -72,6 +74,7 @@ func TestUsersService_ListGPGKeys_specifiedUser(t *testing.T) { } func TestUsersService_ListGPGKeys_invalidUser(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -80,6 +83,7 @@ func TestUsersService_ListGPGKeys_invalidUser(t *testing.T) { } func TestUsersService_GetGPGKey(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/gpg_keys/1", func(w http.ResponseWriter, r *http.Request) { @@ -114,6 +118,7 @@ func TestUsersService_GetGPGKey(t *testing.T) { } func TestUsersService_CreateGPGKey(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := ` @@ -161,6 +166,7 @@ mQINBFcEd9kBEACo54TDbGhKlXKWMvJgecEUKPPcv7XdnpKdGb3LRw5MvFwT0V0f } func TestUsersService_DeleteGPGKey(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/gpg_keys/1", func(w http.ResponseWriter, r *http.Request) { @@ -185,6 +191,7 @@ func TestUsersService_DeleteGPGKey(t *testing.T) { } func TestGPGEmail_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &GPGEmail{}, "{}") u := &GPGEmail{ @@ -201,6 +208,7 @@ func TestGPGEmail_Marshal(t *testing.T) { } func TestGPGKey_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &GPGKey{}, "{}") ti := &Timestamp{} diff --git a/github/users_keys_test.go b/github/users_keys_test.go index 02c8a0f2be1..15553f52f35 100644 --- a/github/users_keys_test.go +++ b/github/users_keys_test.go @@ -16,6 +16,7 @@ import ( ) func TestUsersService_ListKeys_authenticatedUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/keys", func(w http.ResponseWriter, r *http.Request) { @@ -52,6 +53,7 @@ func TestUsersService_ListKeys_authenticatedUser(t *testing.T) { } func TestUsersService_ListKeys_specifiedUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/keys", func(w http.ResponseWriter, r *http.Request) { @@ -72,6 +74,7 @@ func TestUsersService_ListKeys_specifiedUser(t *testing.T) { } func TestUsersService_ListKeys_invalidUser(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -80,6 +83,7 @@ func TestUsersService_ListKeys_invalidUser(t *testing.T) { } func TestUsersService_GetKey(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/keys/1", func(w http.ResponseWriter, r *http.Request) { @@ -114,6 +118,7 @@ func TestUsersService_GetKey(t *testing.T) { } func TestUsersService_CreateKey(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &Key{Key: String("k"), Title: String("t")} @@ -152,6 +157,7 @@ func TestUsersService_CreateKey(t *testing.T) { } func TestUsersService_DeleteKey(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/keys/1", func(w http.ResponseWriter, r *http.Request) { @@ -176,6 +182,7 @@ func TestUsersService_DeleteKey(t *testing.T) { } func TestKey_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Key{}, "{}") u := &Key{ diff --git a/github/users_packages_test.go b/github/users_packages_test.go index 22f7a2302dc..2b34b51c6eb 100644 --- a/github/users_packages_test.go +++ b/github/users_packages_test.go @@ -15,6 +15,7 @@ import ( ) func TestUsersService_Authenticated_ListPackages(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/packages", func(w http.ResponseWriter, r *http.Request) { @@ -70,6 +71,7 @@ func TestUsersService_Authenticated_ListPackages(t *testing.T) { } func TestUsersService_specifiedUser_ListPackages(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/packages", func(w http.ResponseWriter, r *http.Request) { @@ -125,6 +127,7 @@ func TestUsersService_specifiedUser_ListPackages(t *testing.T) { } func TestUsersService_specifiedUser_GetPackage(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/packages/container/hello_docker", func(w http.ResponseWriter, r *http.Request) { @@ -179,6 +182,7 @@ func TestUsersService_specifiedUser_GetPackage(t *testing.T) { } func TestUsersService_Authenticated_GetPackage(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/packages/container/hello_docker", func(w http.ResponseWriter, r *http.Request) { @@ -233,6 +237,7 @@ func TestUsersService_Authenticated_GetPackage(t *testing.T) { } func TestUsersService_Authenticated_DeletePackage(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/packages/container/hello_docker", func(w http.ResponseWriter, r *http.Request) { @@ -257,6 +262,7 @@ func TestUsersService_Authenticated_DeletePackage(t *testing.T) { } func TestUsersService_specifiedUser_DeletePackage(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/packages/container/hello_docker", func(w http.ResponseWriter, r *http.Request) { @@ -281,6 +287,7 @@ func TestUsersService_specifiedUser_DeletePackage(t *testing.T) { } func TestUsersService_Authenticated_RestorePackage(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/packages/container/hello_docker/restore", func(w http.ResponseWriter, r *http.Request) { @@ -305,6 +312,7 @@ func TestUsersService_Authenticated_RestorePackage(t *testing.T) { } func TestUsersService_specifiedUser_RestorePackage(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/packages/container/hello_docker/restore", func(w http.ResponseWriter, r *http.Request) { @@ -329,6 +337,7 @@ func TestUsersService_specifiedUser_RestorePackage(t *testing.T) { } func TestUsersService_Authenticated_ListPackagesVersions(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/packages/container/hello_docker/versions", func(w http.ResponseWriter, r *http.Request) { @@ -397,6 +406,7 @@ func TestUsersService_Authenticated_ListPackagesVersions(t *testing.T) { } func TestUsersService_specifiedUser_ListPackagesVersions(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/packages/container/hello_docker/versions", func(w http.ResponseWriter, r *http.Request) { @@ -465,6 +475,7 @@ func TestUsersService_specifiedUser_ListPackagesVersions(t *testing.T) { } func TestUsersService_Authenticated_PackageGetVersion(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/packages/container/hello_docker/versions/45763", func(w http.ResponseWriter, r *http.Request) { @@ -530,6 +541,7 @@ func TestUsersService_Authenticated_PackageGetVersion(t *testing.T) { } func TestUsersService_specifiedUser_PackageGetVersion(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/packages/container/hello_docker/versions/45763", func(w http.ResponseWriter, r *http.Request) { @@ -595,6 +607,7 @@ func TestUsersService_specifiedUser_PackageGetVersion(t *testing.T) { } func TestUsersService_Authenticated_PackageDeleteVersion(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/packages/container/hello_docker/versions/45763", func(w http.ResponseWriter, r *http.Request) { @@ -619,6 +632,7 @@ func TestUsersService_Authenticated_PackageDeleteVersion(t *testing.T) { } func TestUsersService_specifiedUser_PackageDeleteVersion(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/packages/container/hello_docker/versions/45763", func(w http.ResponseWriter, r *http.Request) { @@ -643,6 +657,7 @@ func TestUsersService_specifiedUser_PackageDeleteVersion(t *testing.T) { } func TestUsersService_Authenticated_PackageRestoreVersion(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/packages/container/hello_docker/versions/45763/restore", func(w http.ResponseWriter, r *http.Request) { @@ -667,6 +682,7 @@ func TestUsersService_Authenticated_PackageRestoreVersion(t *testing.T) { } func TestUsersService_specifiedUser_PackageRestoreVersion(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/packages/container/hello_docker/versions/45763/restore", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/users_projects_test.go b/github/users_projects_test.go index 6697887610b..8514301d1f5 100644 --- a/github/users_projects_test.go +++ b/github/users_projects_test.go @@ -16,6 +16,7 @@ import ( ) func TestUsersService_ListProjects(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/projects", func(w http.ResponseWriter, r *http.Request) { @@ -53,6 +54,7 @@ func TestUsersService_ListProjects(t *testing.T) { } func TestUsersService_CreateProject(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &CreateUserProjectOptions{Name: "Project Name", Body: String("Project body.")} @@ -92,6 +94,7 @@ func TestUsersService_CreateProject(t *testing.T) { } func TestCreateUserProjectOptions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &CreateUserProjectOptions{}, `{}`) c := CreateUserProjectOptions{ diff --git a/github/users_ssh_signing_keys_test.go b/github/users_ssh_signing_keys_test.go index 4b8dd251217..d5c15ee34ee 100644 --- a/github/users_ssh_signing_keys_test.go +++ b/github/users_ssh_signing_keys_test.go @@ -16,6 +16,7 @@ import ( ) func TestUsersService_ListSSHSigningKeys_authenticatedUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/ssh_signing_keys", func(w http.ResponseWriter, r *http.Request) { @@ -52,6 +53,7 @@ func TestUsersService_ListSSHSigningKeys_authenticatedUser(t *testing.T) { } func TestUsersService_ListSSHSigningKeys_specifiedUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/ssh_signing_keys", func(w http.ResponseWriter, r *http.Request) { @@ -72,6 +74,7 @@ func TestUsersService_ListSSHSigningKeys_specifiedUser(t *testing.T) { } func TestUsersService_ListSSHSigningKeys_invalidUser(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -80,6 +83,7 @@ func TestUsersService_ListSSHSigningKeys_invalidUser(t *testing.T) { } func TestUsersService_GetSSHSigningKey(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/ssh_signing_keys/1", func(w http.ResponseWriter, r *http.Request) { @@ -114,6 +118,7 @@ func TestUsersService_GetSSHSigningKey(t *testing.T) { } func TestUsersService_CreateSSHSigningKey(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &Key{Key: String("k"), Title: String("t")} @@ -152,6 +157,7 @@ func TestUsersService_CreateSSHSigningKey(t *testing.T) { } func TestUsersService_DeleteSSHSigningKey(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/ssh_signing_keys/1", func(w http.ResponseWriter, r *http.Request) { @@ -176,6 +182,7 @@ func TestUsersService_DeleteSSHSigningKey(t *testing.T) { } func TestSSHSigningKey_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &SSHSigningKey{}, "{}") u := &Key{ diff --git a/github/users_test.go b/github/users_test.go index 03c9724378f..0e0137a65aa 100644 --- a/github/users_test.go +++ b/github/users_test.go @@ -16,6 +16,7 @@ import ( ) func TestUser_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &User{}, "{}") u := &User{ @@ -145,6 +146,7 @@ func TestUser_Marshal(t *testing.T) { } func TestUsersService_Get_authenticatedUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user", func(w http.ResponseWriter, r *http.Request) { @@ -179,6 +181,7 @@ func TestUsersService_Get_authenticatedUser(t *testing.T) { } func TestUsersService_Get_specifiedUser(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u", func(w http.ResponseWriter, r *http.Request) { @@ -199,6 +202,7 @@ func TestUsersService_Get_specifiedUser(t *testing.T) { } func TestUsersService_Get_invalidUser(t *testing.T) { + t.Parallel() client, _, _ := setup(t) ctx := context.Background() @@ -207,6 +211,7 @@ func TestUsersService_Get_invalidUser(t *testing.T) { } func TestUsersService_GetByID(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/1", func(w http.ResponseWriter, r *http.Request) { @@ -241,6 +246,7 @@ func TestUsersService_GetByID(t *testing.T) { } func TestUsersService_Edit(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) input := &User{Name: String("n")} @@ -279,6 +285,7 @@ func TestUsersService_Edit(t *testing.T) { } func TestUsersService_GetHovercard(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users/u/hovercard", func(w http.ResponseWriter, r *http.Request) { @@ -315,6 +322,7 @@ func TestUsersService_GetHovercard(t *testing.T) { } func TestUsersService_ListAll(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/users", func(w http.ResponseWriter, r *http.Request) { @@ -346,6 +354,7 @@ func TestUsersService_ListAll(t *testing.T) { } func TestUsersService_ListInvitations(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/repository_invitations", func(w http.ResponseWriter, r *http.Request) { @@ -375,6 +384,7 @@ func TestUsersService_ListInvitations(t *testing.T) { } func TestUsersService_ListInvitations_withOptions(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/repository_invitations", func(w http.ResponseWriter, r *http.Request) { @@ -393,6 +403,7 @@ func TestUsersService_ListInvitations_withOptions(t *testing.T) { } func TestUsersService_AcceptInvitation(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/repository_invitations/1", func(w http.ResponseWriter, r *http.Request) { @@ -417,6 +428,7 @@ func TestUsersService_AcceptInvitation(t *testing.T) { } func TestUsersService_DeclineInvitation(t *testing.T) { + t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/user/repository_invitations/1", func(w http.ResponseWriter, r *http.Request) { @@ -441,6 +453,7 @@ func TestUsersService_DeclineInvitation(t *testing.T) { } func TestUserContext_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &UserContext{}, "{}") u := &UserContext{ @@ -457,6 +470,7 @@ func TestUserContext_Marshal(t *testing.T) { } func TestHovercard_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &Hovercard{}, "{}") h := &Hovercard{ @@ -481,6 +495,7 @@ func TestHovercard_Marshal(t *testing.T) { } func TestUserListOptions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &UserListOptions{}, "{}") u := &UserListOptions{ @@ -501,6 +516,7 @@ func TestUserListOptions_Marshal(t *testing.T) { } func TestHovercardOptions_Marshal(t *testing.T) { + t.Parallel() testJSONMarshal(t, &HovercardOptions{}, "{}") u := &HovercardOptions{ diff --git a/scrape/apps_test.go b/scrape/apps_test.go index 577ff8b2cd1..8594dcd29ad 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -9,6 +9,7 @@ import ( ) func Test_AppRestrictionsEnabled(t *testing.T) { + t.Parallel() tests := []struct { description string testFile string @@ -28,7 +29,9 @@ func Test_AppRestrictionsEnabled(t *testing.T) { } for _, tt := range tests { + tt := tt t.Run(tt.description, func(t *testing.T) { + t.Parallel() client, mux := setup(t) mux.HandleFunc("/organizations/o/settings/oauth_application_policy", func(w http.ResponseWriter, r *http.Request) { @@ -47,6 +50,7 @@ func Test_AppRestrictionsEnabled(t *testing.T) { } func Test_ListOAuthApps(t *testing.T) { + t.Parallel() client, mux := setup(t) mux.HandleFunc("/organizations/e/settings/oauth_application_policy", func(w http.ResponseWriter, r *http.Request) { @@ -83,6 +87,7 @@ func Test_ListOAuthApps(t *testing.T) { } func Test_CreateApp(t *testing.T) { + t.Parallel() client, mux := setup(t) mux.HandleFunc("/apps/settings/new", func(w http.ResponseWriter, r *http.Request) { @@ -100,6 +105,7 @@ func Test_CreateApp(t *testing.T) { } func Test_CreateAppWithOrg(t *testing.T) { + t.Parallel() client, mux := setup(t) mux.HandleFunc("/organizations/example/apps/settings/new", func(w http.ResponseWriter, r *http.Request) { diff --git a/scrape/forms_test.go b/scrape/forms_test.go index 40486c64587..e3e802b0bc8 100644 --- a/scrape/forms_test.go +++ b/scrape/forms_test.go @@ -12,6 +12,7 @@ import ( ) func Test_ParseForms(t *testing.T) { + t.Parallel() tests := []struct { description string html string @@ -70,7 +71,9 @@ func Test_ParseForms(t *testing.T) { } for _, tt := range tests { + tt := tt t.Run(tt.description, func(t *testing.T) { + t.Parallel() node, err := html.Parse(strings.NewReader(tt.html)) if err != nil { t.Errorf("error parsing html: %v", err) @@ -83,6 +86,7 @@ func Test_ParseForms(t *testing.T) { } func Test_FetchAndSumbitForm(t *testing.T) { + t.Parallel() client, mux := setup(t) var submitted bool diff --git a/script/lint.sh b/script/lint.sh index 1434cc69042..25e5e049ca3 100755 --- a/script/lint.sh +++ b/script/lint.sh @@ -5,7 +5,7 @@ set -e -GOLANGCI_LINT_VERSION="1.60.2" +GOLANGCI_LINT_VERSION="1.61.0" CDPATH="" cd -- "$(dirname -- "$0")/.." BIN="$(pwd -P)"/bin diff --git a/tools/metadata/main_test.go b/tools/metadata/main_test.go index b976a22a8e7..008553c37ae 100644 --- a/tools/metadata/main_test.go +++ b/tools/metadata/main_test.go @@ -27,7 +27,9 @@ import ( ) func TestUpdateGo(t *testing.T) { + t.Parallel() t.Run("valid", func(t *testing.T) { + t.Parallel() res := runTest(t, "testdata/update-go/valid", "update-go") res.assertOutput("", "") res.assertNoErr() @@ -35,6 +37,7 @@ func TestUpdateGo(t *testing.T) { }) t.Run("invalid", func(t *testing.T) { + t.Parallel() res := runTest(t, "testdata/update-go/invalid", "update-go") res.assertOutput("", "") res.assertErr(` @@ -49,6 +52,7 @@ duplicate operation: GET /a/{a_id} } func TestUnused(t *testing.T) { + t.Parallel() res := runTest(t, "testdata/unused", "unused") res.assertOutput(` Found 3 unused operations @@ -63,6 +67,7 @@ GET /undocumented/{undocumented_id} `, "") } +//nolint:tparallel,paralleltest // cannot use t.Parallel() when helper calls t.Setenv func TestUpdateOpenAPI(t *testing.T) { testServer := newTestServer(t, "main", map[string]interface{}{ "api.github.com/api.github.com.json": openapi3.T{ @@ -124,6 +129,7 @@ func TestUpdateOpenAPI(t *testing.T) { } func TestFormat(t *testing.T) { + t.Parallel() res := runTest(t, "testdata/format", "format") res.assertOutput("", "") res.assertNoErr() diff --git a/tools/metadata/metadata_test.go b/tools/metadata/metadata_test.go index c3ad0a788f9..b18395d8042 100644 --- a/tools/metadata/metadata_test.go +++ b/tools/metadata/metadata_test.go @@ -10,6 +10,7 @@ import ( ) func Test_normalizedOpName(t *testing.T) { + t.Parallel() for _, td := range []struct { name string want string @@ -18,7 +19,9 @@ func Test_normalizedOpName(t *testing.T) { {name: "get /foo/{id}", want: "GET /foo/*"}, {name: "get foo", want: "GET /foo"}, } { + td := td t.Run(td.name, func(t *testing.T) { + t.Parallel() got := normalizedOpName(td.name) if got != td.want { t.Errorf("normalizedOpName() = %v, want %v", got, td.want) From 29b756d9a257397513eb395f83616c236ade9c1d Mon Sep 17 00:00:00 2001 From: Felix Luthman <34520175+felixlut@users.noreply.github.com> Date: Sun, 6 Oct 2024 13:26:52 +0200 Subject: [PATCH 530/751] fix: Allow removing/unsetting repository custom property (#3309) --- github/orgs_properties.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/orgs_properties.go b/github/orgs_properties.go index f7416d53008..3387d98d76f 100644 --- a/github/orgs_properties.go +++ b/github/orgs_properties.go @@ -42,7 +42,7 @@ type RepoCustomPropertyValue struct { // CustomPropertyValue represents a custom property value. type CustomPropertyValue struct { PropertyName string `json:"property_name"` - Value interface{} `json:"value,omitempty"` + Value interface{} `json:"value"` } // UnmarshalJSON implements the json.Unmarshaler interface. From 057b1d7aab4e6e2e71261f4441180ec33a44dc38 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Sun, 6 Oct 2024 13:02:31 -0400 Subject: [PATCH 531/751] Bump version of go-github to v66.0.0 (#3310) --- README.md | 17 +++++++++-------- example/actionpermissions/main.go | 2 +- example/appengine/app.go | 2 +- example/basicauth/main.go | 2 +- .../codespaces/newreposecretwithxcrypto/main.go | 2 +- .../codespaces/newusersecretwithxcrypto/main.go | 2 +- example/commitpr/main.go | 2 +- example/go.mod | 6 +++--- example/listenvironments/main.go | 2 +- example/migrations/main.go | 2 +- example/newfilewithappauth/main.go | 2 +- example/newrepo/main.go | 2 +- example/newreposecretwithlibsodium/go.mod | 4 ++-- example/newreposecretwithlibsodium/main.go | 2 +- example/newreposecretwithxcrypto/main.go | 2 +- example/ratelimit/main.go | 2 +- example/simple/main.go | 2 +- example/tagprotection/main.go | 2 +- example/tokenauth/main.go | 2 +- example/topics/main.go | 2 +- github/doc.go | 2 +- github/examples_test.go | 2 +- github/github.go | 2 +- go.mod | 2 +- test/fields/fields.go | 2 +- test/integration/activity_test.go | 2 +- test/integration/authorizations_test.go | 2 +- test/integration/github_test.go | 2 +- test/integration/repos_test.go | 2 +- test/integration/users_test.go | 2 +- tools/go.mod | 4 ++-- tools/metadata/main.go | 2 +- tools/metadata/main_test.go | 2 +- tools/metadata/metadata.go | 2 +- tools/metadata/openapi.go | 2 +- 35 files changed, 47 insertions(+), 46 deletions(-) diff --git a/README.md b/README.md index 585790b7588..1126418c54a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-github # [![go-github release (latest SemVer)](https://img.shields.io/github/v/release/google/go-github?sort=semver)](https://github.com/google/go-github/releases) -[![Go Reference](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v65/github) +[![Go Reference](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v66/github) [![Test Status](https://github.com/google/go-github/workflows/tests/badge.svg)](https://github.com/google/go-github/actions?query=workflow%3Atests) [![Test Coverage](https://codecov.io/gh/google/go-github/branch/master/graph/badge.svg)](https://codecov.io/gh/google/go-github) [![Discuss at go-github@googlegroups.com](https://img.shields.io/badge/discuss-go--github%40googlegroups.com-blue.svg)](https://groups.google.com/group/go-github) @@ -24,7 +24,7 @@ If you're interested in using the [GraphQL API v4][], the recommended library is go-github is compatible with modern Go releases in module mode, with Go installed: ```bash -go get github.com/google/go-github/v65 +go get github.com/google/go-github/v66 ``` will resolve and add the package to the current development module, along with its dependencies. @@ -32,7 +32,7 @@ will resolve and add the package to the current development module, along with i Alternatively the same can be achieved if you use import in a package: ```go -import "github.com/google/go-github/v65/github" +import "github.com/google/go-github/v66/github" ``` and run `go get` without parameters. @@ -40,13 +40,13 @@ and run `go get` without parameters. Finally, to use the top-of-trunk version of this repo, use the following command: ```bash -go get github.com/google/go-github/v65@master +go get github.com/google/go-github/v66@master ``` ## Usage ## ```go -import "github.com/google/go-github/v65/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) +import "github.com/google/go-github/v66/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled ``` @@ -119,7 +119,7 @@ import ( "net/http" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" ) func main() { @@ -153,7 +153,7 @@ import ( "os" "strconv" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/jferrl/go-githubauth" "golang.org/x/oauth2" ) @@ -361,7 +361,7 @@ For complete usage of go-github, see the full [package docs][]. [GitHub API v3]: https://docs.github.com/en/rest [personal access token]: https://github.com/blog/1509-personal-api-tokens -[package docs]: https://pkg.go.dev/github.com/google/go-github/v65/github +[package docs]: https://pkg.go.dev/github.com/google/go-github/v66/github [GraphQL API v4]: https://developer.github.com/v4/ [shurcooL/githubv4]: https://github.com/shurcooL/githubv4 [GitHub webhook events]: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads @@ -435,6 +435,7 @@ Versions prior to 48.2.0 are not listed. | go-github Version | GitHub v3 API Version | | ----------------- | --------------------- | +| 66.0.0 | 2022-11-28 | | 65.0.0 | 2022-11-28 | | 64.0.0 | 2022-11-28 | | 63.0.0 | 2022-11-28 | diff --git a/example/actionpermissions/main.go b/example/actionpermissions/main.go index f92aaaaa36e..a41561718a2 100644 --- a/example/actionpermissions/main.go +++ b/example/actionpermissions/main.go @@ -14,7 +14,7 @@ import ( "log" "os" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" ) var ( diff --git a/example/appengine/app.go b/example/appengine/app.go index b45227510a9..a0653217da2 100644 --- a/example/appengine/app.go +++ b/example/appengine/app.go @@ -12,7 +12,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "google.golang.org/appengine" "google.golang.org/appengine/log" ) diff --git a/example/basicauth/main.go b/example/basicauth/main.go index c23f81fc896..0884b258771 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -21,7 +21,7 @@ import ( "os" "strings" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "golang.org/x/term" ) diff --git a/example/codespaces/newreposecretwithxcrypto/main.go b/example/codespaces/newreposecretwithxcrypto/main.go index 3cef6e8e1c2..bd6033ec5af 100644 --- a/example/codespaces/newreposecretwithxcrypto/main.go +++ b/example/codespaces/newreposecretwithxcrypto/main.go @@ -36,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/codespaces/newusersecretwithxcrypto/main.go b/example/codespaces/newusersecretwithxcrypto/main.go index c25aa794430..e1fec87de33 100644 --- a/example/codespaces/newusersecretwithxcrypto/main.go +++ b/example/codespaces/newusersecretwithxcrypto/main.go @@ -37,7 +37,7 @@ import ( "log" "os" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index 02c80a4ec20..56562beb367 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -33,7 +33,7 @@ import ( "time" "github.com/ProtonMail/go-crypto/openpgp" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" ) var ( diff --git a/example/go.mod b/example/go.mod index 455222888c6..5ec2bd5a775 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v65/example +module github.com/google/go-github/v66/example go 1.21 @@ -6,7 +6,7 @@ require ( github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-ratelimit v1.0.3 - github.com/google/go-github/v65 v65.0.0 + github.com/google/go-github/v66 v66.0.0 golang.org/x/crypto v0.21.0 golang.org/x/term v0.18.0 google.golang.org/appengine v1.6.7 @@ -24,4 +24,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v65 => ../ +replace github.com/google/go-github/v66 => ../ diff --git a/example/listenvironments/main.go b/example/listenvironments/main.go index 260e28f0b58..b0a418f5ec2 100644 --- a/example/listenvironments/main.go +++ b/example/listenvironments/main.go @@ -18,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" ) func main() { diff --git a/example/migrations/main.go b/example/migrations/main.go index 47776157b13..17fc9c19f03 100644 --- a/example/migrations/main.go +++ b/example/migrations/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" ) func fetchAllUserMigrations() ([]*github.UserMigration, error) { diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index 52f24b3f308..7ff5d5b37c3 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -16,7 +16,7 @@ import ( "time" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" ) func main() { diff --git a/example/newrepo/main.go b/example/newrepo/main.go index 239bf52d544..a737edbc4cb 100644 --- a/example/newrepo/main.go +++ b/example/newrepo/main.go @@ -16,7 +16,7 @@ import ( "log" "os" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" ) var ( diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index 67612f7e84e..f4c33c6a334 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -6,10 +6,10 @@ toolchain go1.22.0 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb - github.com/google/go-github/v65 v65.0.0 + github.com/google/go-github/v66 v66.0.0 ) require github.com/google/go-querystring v1.1.0 // indirect // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v65 => ../.. +replace github.com/google/go-github/v66 => ../.. diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index bc754bdf041..cfa64196401 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -36,7 +36,7 @@ import ( "os" sodium "github.com/GoKillers/libsodium-go/cryptobox" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" ) var ( diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index 48f16b1c363..6737263aa08 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -36,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/ratelimit/main.go b/example/ratelimit/main.go index 8609543073a..d444d552c35 100644 --- a/example/ratelimit/main.go +++ b/example/ratelimit/main.go @@ -13,7 +13,7 @@ import ( "fmt" "github.com/gofri/go-github-ratelimit/github_ratelimit" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" ) func main() { diff --git a/example/simple/main.go b/example/simple/main.go index 7be316c002b..6c7dad5f996 100644 --- a/example/simple/main.go +++ b/example/simple/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" ) // Fetch all the public organizations' membership of a user. diff --git a/example/tagprotection/main.go b/example/tagprotection/main.go index c66f4f67941..1aae39b9f26 100644 --- a/example/tagprotection/main.go +++ b/example/tagprotection/main.go @@ -18,7 +18,7 @@ import ( "os" "strings" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "golang.org/x/term" ) diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index a10dc3bbca4..71d4c20c31a 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -15,7 +15,7 @@ import ( "log" "os" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "golang.org/x/term" ) diff --git a/example/topics/main.go b/example/topics/main.go index be5a0277b38..ec3c3686f8d 100644 --- a/example/topics/main.go +++ b/example/topics/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" ) // Fetch and lists all the public topics associated with the specified GitHub topic diff --git a/github/doc.go b/github/doc.go index bda83934784..7196394fb9c 100644 --- a/github/doc.go +++ b/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v65/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v66/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to diff --git a/github/examples_test.go b/github/examples_test.go index b54be8bf0da..51eae1e3b5d 100644 --- a/github/examples_test.go +++ b/github/examples_test.go @@ -12,7 +12,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" ) func ExampleMarkdownService_Render() { diff --git a/github/github.go b/github/github.go index f0a862855e1..22fbb9747e1 100644 --- a/github/github.go +++ b/github/github.go @@ -28,7 +28,7 @@ import ( ) const ( - Version = "v65.0.0" + Version = "v66.0.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" diff --git a/go.mod b/go.mod index d1e35fab661..c7f40401733 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v65 +module github.com/google/go-github/v66 require ( github.com/google/go-cmp v0.6.0 diff --git a/test/fields/fields.go b/test/fields/fields.go index 1c64ac5c35f..7bfa021758d 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -25,7 +25,7 @@ import ( "reflect" "strings" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" ) var ( diff --git a/test/integration/activity_test.go b/test/integration/activity_test.go index 32d499c8080..94b054f737b 100644 --- a/test/integration/activity_test.go +++ b/test/integration/activity_test.go @@ -12,7 +12,7 @@ import ( "context" "testing" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" ) const ( diff --git a/test/integration/authorizations_test.go b/test/integration/authorizations_test.go index d1f6224a7df..cf0e92eb29d 100644 --- a/test/integration/authorizations_test.go +++ b/test/integration/authorizations_test.go @@ -15,7 +15,7 @@ import ( "testing" "time" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" ) const msgEnvMissing = "Skipping test because the required environment variable (%v) is not present." diff --git a/test/integration/github_test.go b/test/integration/github_test.go index 5474724decf..07096338f41 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -15,7 +15,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" ) var ( diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index f33ab00f186..ec6a8157f3c 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -15,7 +15,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" ) func TestRepositories_CRUD(t *testing.T) { diff --git a/test/integration/users_test.go b/test/integration/users_test.go index aa2b9ba9be0..fb3bdac12df 100644 --- a/test/integration/users_test.go +++ b/test/integration/users_test.go @@ -14,7 +14,7 @@ import ( "math/rand" "testing" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" ) func TestUsers_Get(t *testing.T) { diff --git a/tools/go.mod b/tools/go.mod index 1b61373c3e8..f1eaa85f51d 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -8,7 +8,7 @@ require ( github.com/alecthomas/kong v1.2.1 github.com/getkin/kin-openapi v0.127.0 github.com/google/go-cmp v0.6.0 - github.com/google/go-github/v65 v65.0.0 + github.com/google/go-github/v66 v66.0.0 golang.org/x/sync v0.8.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -25,4 +25,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v65 => ../ +replace github.com/google/go-github/v66 => ../ diff --git a/tools/metadata/main.go b/tools/metadata/main.go index 4580484e54a..238fc468856 100644 --- a/tools/metadata/main.go +++ b/tools/metadata/main.go @@ -15,7 +15,7 @@ import ( "path/filepath" "github.com/alecthomas/kong" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" ) var helpVars = kong.Vars{ diff --git a/tools/metadata/main_test.go b/tools/metadata/main_test.go index 008553c37ae..51e36b390c9 100644 --- a/tools/metadata/main_test.go +++ b/tools/metadata/main_test.go @@ -23,7 +23,7 @@ import ( "github.com/alecthomas/kong" "github.com/getkin/kin-openapi/openapi3" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" ) func TestUpdateGo(t *testing.T) { diff --git a/tools/metadata/metadata.go b/tools/metadata/metadata.go index 392306903d0..db763462c62 100644 --- a/tools/metadata/metadata.go +++ b/tools/metadata/metadata.go @@ -24,7 +24,7 @@ import ( "strings" "sync" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "gopkg.in/yaml.v3" ) diff --git a/tools/metadata/openapi.go b/tools/metadata/openapi.go index dc9e8da1c7e..bd211da02b8 100644 --- a/tools/metadata/openapi.go +++ b/tools/metadata/openapi.go @@ -14,7 +14,7 @@ import ( "strconv" "github.com/getkin/kin-openapi/openapi3" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "golang.org/x/sync/errgroup" ) From 398aca0313c3a222d98e831f00c9e8024b519b91 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Sun, 6 Oct 2024 13:12:16 -0400 Subject: [PATCH 532/751] Bump go-github from v65 to v66 in /scrape (#3311) --- scrape/apps.go | 2 +- scrape/apps_test.go | 2 +- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scrape/apps.go b/scrape/apps.go index cf294f72f51..1b085296c16 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -18,7 +18,7 @@ import ( "strings" "github.com/PuerkitoBio/goquery" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" ) // AppRestrictionsEnabled returns whether the specified organization has diff --git a/scrape/apps_test.go b/scrape/apps_test.go index 8594dcd29ad..c15b305b065 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" ) func Test_AppRestrictionsEnabled(t *testing.T) { diff --git a/scrape/go.mod b/scrape/go.mod index 91a05ac4d63..c2d77045e76 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -7,7 +7,7 @@ toolchain go1.22.0 require ( github.com/PuerkitoBio/goquery v1.9.2 github.com/google/go-cmp v0.6.0 - github.com/google/go-github/v65 v65.0.0 + github.com/google/go-github/v66 v66.0.0 github.com/xlzd/gotp v0.1.0 golang.org/x/net v0.29.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index fa424ba7a11..e73ac3505f9 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -5,8 +5,8 @@ github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6 github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v65 v65.0.0 h1:pQ7BmO3DZivvFk92geC0jB0q2m3gyn8vnYPgV7GSLhQ= -github.com/google/go-github/v65 v65.0.0/go.mod h1:DvrqWo5hvsdhJvHd4WyVF9ttANN3BniqjP8uTFMNb60= +github.com/google/go-github/v66 v66.0.0 h1:ADJsaXj9UotwdgK8/iFZtv7MLc8E8WBl62WLd/D/9+M= +github.com/google/go-github/v66 v66.0.0/go.mod h1:+4SO9Zkuyf8ytMj0csN1NR/5OTR+MfqPp8P8dVlcvY4= 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.1.0 h1:37blvlKCh38s+fkem+fFh7sMnceltoIEBYTVXyoa5Po= From bc36e731c65d8227ca147351fc9a5bfc31f1ef1c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 15:39:40 -0400 Subject: [PATCH 533/751] build(deps): bump golang.org/x/net from 0.29.0 to 0.30.0 in /scrape (#3313) --- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index c2d77045e76..986380f3c83 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -9,7 +9,7 @@ require ( github.com/google/go-cmp v0.6.0 github.com/google/go-github/v66 v66.0.0 github.com/xlzd/gotp v0.1.0 - golang.org/x/net v0.29.0 + golang.org/x/net v0.30.0 ) require ( diff --git a/scrape/go.sum b/scrape/go.sum index e73ac3505f9..25e51e0db0e 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -21,8 +21,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= -golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= -golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= +golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= +golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= From 11e4984fd917be8e96e47e47f88e348f500cdbb2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 15:40:58 -0400 Subject: [PATCH 534/751] build(deps): bump codecov/codecov-action from 4.5.0 to 4.6.0 (#3312) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 36ec9b31786..f35b944840d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -73,4 +73,4 @@ jobs: - name: Upload coverage to Codecov if: ${{ matrix.update-coverage }} - uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 #v4.5.0 + uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 #v4.6.0 From 06f85a42d08e4afc831ed359773059165567db6e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 15:48:55 -0400 Subject: [PATCH 535/751] build(deps): bump github.com/getkin/kin-openapi from 0.127.0 to 0.128.0 in /tools (#3314) --- tools/go.mod | 2 +- tools/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index f1eaa85f51d..c50bb5f1122 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -6,7 +6,7 @@ toolchain go1.22.0 require ( github.com/alecthomas/kong v1.2.1 - github.com/getkin/kin-openapi v0.127.0 + github.com/getkin/kin-openapi v0.128.0 github.com/google/go-cmp v0.6.0 github.com/google/go-github/v66 v66.0.0 golang.org/x/sync v0.8.0 diff --git a/tools/go.sum b/tools/go.sum index 928a46b0694..8805ab47abe 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -6,8 +6,8 @@ github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/getkin/kin-openapi v0.127.0 h1:Mghqi3Dhryf3F8vR370nN67pAERW+3a95vomb3MAREY= -github.com/getkin/kin-openapi v0.127.0/go.mod h1:OZrfXzUfGrNbsKj+xmFBx6E5c6yH3At/tAKSc2UszXM= +github.com/getkin/kin-openapi v0.128.0 h1:jqq3D9vC9pPq1dGcOCv7yOp1DaEe7c/T1vzcLbITSp4= +github.com/getkin/kin-openapi v0.128.0/go.mod h1:OZrfXzUfGrNbsKj+xmFBx6E5c6yH3At/tAKSc2UszXM= github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= From 139eec83588410f5e4440d745733ea7ca7e26b5b Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Tue, 8 Oct 2024 15:30:47 +0300 Subject: [PATCH 536/751] refactor: Remove unneeded strings.Join calls (#3317) --- github/projects_test.go | 4 +--- github/teams.go | 37 ++++++++++++------------------------- github/teams_test.go | 37 ++++++++++++------------------------- 3 files changed, 25 insertions(+), 53 deletions(-) diff --git a/github/projects_test.go b/github/projects_test.go index f7fcb818523..e69f8b6725d 100644 --- a/github/projects_test.go +++ b/github/projects_test.go @@ -10,7 +10,6 @@ import ( "encoding/json" "fmt" "net/http" - "strings" "testing" "github.com/google/go-cmp/cmp" @@ -203,10 +202,9 @@ func TestProjectsService_ListProjectColumns(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - wantAcceptHeaders := []string{mediaTypeProjectsPreview} mux.HandleFunc("/projects/1/columns", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) + testHeader(t, r, "Accept", mediaTypeProjectsPreview) testFormValues(t, r, values{"page": "2"}) fmt.Fprint(w, `[{"id":1}]`) }) diff --git a/github/teams.go b/github/teams.go index 10dbebcbbe6..df248b65404 100644 --- a/github/teams.go +++ b/github/teams.go @@ -9,7 +9,6 @@ import ( "context" "fmt" "net/http" - "strings" ) // TeamsService provides access to the team-related functions @@ -389,8 +388,7 @@ func (s *TeamsService) ListTeamReposByID(ctx context.Context, orgID, teamID int6 } // TODO: remove custom Accept header when topics API fully launches. - headers := []string{mediaTypeTopicsPreview} - req.Header.Set("Accept", strings.Join(headers, ", ")) + req.Header.Set("Accept", mediaTypeTopicsPreview) var repos []*Repository resp, err := s.client.Do(ctx, req, &repos) @@ -419,8 +417,7 @@ func (s *TeamsService) ListTeamReposBySlug(ctx context.Context, org, slug string } // TODO: remove custom Accept header when topics API fully launches. - headers := []string{mediaTypeTopicsPreview} - req.Header.Set("Accept", strings.Join(headers, ", ")) + req.Header.Set("Accept", mediaTypeTopicsPreview) var repos []*Repository resp, err := s.client.Do(ctx, req, &repos) @@ -445,8 +442,7 @@ func (s *TeamsService) IsTeamRepoByID(ctx context.Context, orgID, teamID int64, return nil, nil, err } - headers := []string{mediaTypeOrgPermissionRepo} - req.Header.Set("Accept", strings.Join(headers, ", ")) + req.Header.Set("Accept", mediaTypeOrgPermissionRepo) repository := new(Repository) resp, err := s.client.Do(ctx, req, repository) @@ -471,8 +467,7 @@ func (s *TeamsService) IsTeamRepoBySlug(ctx context.Context, org, slug, owner, r return nil, nil, err } - headers := []string{mediaTypeOrgPermissionRepo} - req.Header.Set("Accept", strings.Join(headers, ", ")) + req.Header.Set("Accept", mediaTypeOrgPermissionRepo) repository := new(Repository) resp, err := s.client.Do(ctx, req, repository) @@ -606,8 +601,7 @@ func (s *TeamsService) ListTeamProjectsByID(ctx context.Context, orgID, teamID i } // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeProjectsPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeProjectsPreview) var projects []*Project resp, err := s.client.Do(ctx, req, &projects) @@ -632,8 +626,7 @@ func (s *TeamsService) ListTeamProjectsBySlug(ctx context.Context, org, slug str } // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeProjectsPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeProjectsPreview) var projects []*Project resp, err := s.client.Do(ctx, req, &projects) @@ -658,8 +651,7 @@ func (s *TeamsService) ReviewTeamProjectsByID(ctx context.Context, orgID, teamID } // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeProjectsPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeProjectsPreview) projects := &Project{} resp, err := s.client.Do(ctx, req, &projects) @@ -684,8 +676,7 @@ func (s *TeamsService) ReviewTeamProjectsBySlug(ctx context.Context, org, slug s } // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeProjectsPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeProjectsPreview) projects := &Project{} resp, err := s.client.Do(ctx, req, &projects) @@ -723,8 +714,7 @@ func (s *TeamsService) AddTeamProjectByID(ctx context.Context, orgID, teamID, pr } // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeProjectsPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeProjectsPreview) return s.client.Do(ctx, req, nil) } @@ -744,8 +734,7 @@ func (s *TeamsService) AddTeamProjectBySlug(ctx context.Context, org, slug strin } // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeProjectsPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeProjectsPreview) return s.client.Do(ctx, req, nil) } @@ -768,8 +757,7 @@ func (s *TeamsService) RemoveTeamProjectByID(ctx context.Context, orgID, teamID, } // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeProjectsPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeProjectsPreview) return s.client.Do(ctx, req, nil) } @@ -792,8 +780,7 @@ func (s *TeamsService) RemoveTeamProjectBySlug(ctx context.Context, org, slug st } // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeProjectsPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeProjectsPreview) return s.client.Do(ctx, req, nil) } diff --git a/github/teams_test.go b/github/teams_test.go index 568b1aa5960..110925c1226 100644 --- a/github/teams_test.go +++ b/github/teams_test.go @@ -12,7 +12,6 @@ import ( "fmt" "io" "net/http" - "strings" "testing" "github.com/google/go-cmp/cmp" @@ -538,8 +537,7 @@ func TestTeamsService_ListTeamReposByID(t *testing.T) { mux.HandleFunc("/organizations/1/team/1/repos", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - wantAcceptHeaders := []string{mediaTypeTopicsPreview} - testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) + testHeader(t, r, "Accept", mediaTypeTopicsPreview) testFormValues(t, r, values{"page": "2"}) fmt.Fprint(w, `[{"id":1}]`) }) @@ -577,8 +575,7 @@ func TestTeamsService_ListTeamReposBySlug(t *testing.T) { mux.HandleFunc("/orgs/o/teams/s/repos", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - wantAcceptHeaders := []string{mediaTypeTopicsPreview} - testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) + testHeader(t, r, "Accept", mediaTypeTopicsPreview) testFormValues(t, r, values{"page": "2"}) fmt.Fprint(w, `[{"id":1}]`) }) @@ -616,8 +613,7 @@ func TestTeamsService_IsTeamRepoByID_true(t *testing.T) { mux.HandleFunc("/organizations/1/team/1/repos/owner/repo", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - wantAcceptHeaders := []string{mediaTypeOrgPermissionRepo} - testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) + testHeader(t, r, "Accept", mediaTypeOrgPermissionRepo) fmt.Fprint(w, `{"id":1}`) }) @@ -653,8 +649,7 @@ func TestTeamsService_IsTeamRepoBySlug_true(t *testing.T) { mux.HandleFunc("/orgs/org/teams/slug/repos/owner/repo", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - wantAcceptHeaders := []string{mediaTypeOrgPermissionRepo} - testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) + testHeader(t, r, "Accept", mediaTypeOrgPermissionRepo) fmt.Fprint(w, `{"id":1}`) }) @@ -1016,10 +1011,9 @@ func TestTeamsService_ListProjectsByID(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - wantAcceptHeaders := []string{mediaTypeProjectsPreview} mux.HandleFunc("/organizations/1/team/1/projects", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) + testHeader(t, r, "Accept", mediaTypeProjectsPreview) fmt.Fprint(w, `[{"id":1}]`) }) @@ -1053,10 +1047,9 @@ func TestTeamsService_ListProjectsBySlug(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - wantAcceptHeaders := []string{mediaTypeProjectsPreview} mux.HandleFunc("/orgs/o/teams/s/projects", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) + testHeader(t, r, "Accept", mediaTypeProjectsPreview) fmt.Fprint(w, `[{"id":1}]`) }) @@ -1090,10 +1083,9 @@ func TestTeamsService_ReviewProjectsByID(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - wantAcceptHeaders := []string{mediaTypeProjectsPreview} mux.HandleFunc("/organizations/1/team/1/projects/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) + testHeader(t, r, "Accept", mediaTypeProjectsPreview) fmt.Fprint(w, `{"id":1}`) }) @@ -1127,10 +1119,9 @@ func TestTeamsService_ReviewProjectsBySlug(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - wantAcceptHeaders := []string{mediaTypeProjectsPreview} mux.HandleFunc("/orgs/o/teams/s/projects/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) + testHeader(t, r, "Accept", mediaTypeProjectsPreview) fmt.Fprint(w, `{"id":1}`) }) @@ -1168,10 +1159,9 @@ func TestTeamsService_AddTeamProjectByID(t *testing.T) { Permission: String("admin"), } - wantAcceptHeaders := []string{mediaTypeProjectsPreview} mux.HandleFunc("/organizations/1/team/1/projects/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") - testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) + testHeader(t, r, "Accept", mediaTypeProjectsPreview) v := &TeamProjectOptions{} assertNilError(t, json.NewDecoder(r.Body).Decode(v)) @@ -1207,10 +1197,9 @@ func TestTeamsService_AddTeamProjectBySlug(t *testing.T) { Permission: String("admin"), } - wantAcceptHeaders := []string{mediaTypeProjectsPreview} mux.HandleFunc("/orgs/o/teams/s/projects/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") - testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) + testHeader(t, r, "Accept", mediaTypeProjectsPreview) v := &TeamProjectOptions{} assertNilError(t, json.NewDecoder(r.Body).Decode(v)) @@ -1242,10 +1231,9 @@ func TestTeamsService_RemoveTeamProjectByID(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - wantAcceptHeaders := []string{mediaTypeProjectsPreview} mux.HandleFunc("/organizations/1/team/1/projects/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") - testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) + testHeader(t, r, "Accept", mediaTypeProjectsPreview) w.WriteHeader(http.StatusNoContent) }) @@ -1270,10 +1258,9 @@ func TestTeamsService_RemoveTeamProjectBySlug(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - wantAcceptHeaders := []string{mediaTypeProjectsPreview} mux.HandleFunc("/orgs/o/teams/s/projects/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") - testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) + testHeader(t, r, "Accept", mediaTypeProjectsPreview) w.WriteHeader(http.StatusNoContent) }) From 13afa20ab7f3e4d7248ceb9e278195495f4ee9f4 Mon Sep 17 00:00:00 2001 From: Ivan Martos Date: Tue, 8 Oct 2024 15:13:25 +0200 Subject: [PATCH 537/751] feat: Add CreatedAt and UpdatedAt to Ruleset (#3316) Fixes: #3315. --- github/github-accessors.go | 16 ++++++++++++++++ github/github-accessors_test.go | 22 ++++++++++++++++++++++ github/repos_rules.go | 2 ++ github/repos_rules_test.go | 18 +++++++++++++++--- 4 files changed, 55 insertions(+), 3 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index f8e303c4362..1c1f6c33e39 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -21150,6 +21150,14 @@ func (r *Ruleset) GetConditions() *RulesetConditions { return r.Conditions } +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (r *Ruleset) GetCreatedAt() Timestamp { + if r == nil || r.CreatedAt == nil { + return Timestamp{} + } + return *r.CreatedAt +} + // GetID returns the ID field if it's non-nil, zero value otherwise. func (r *Ruleset) GetID() int64 { if r == nil || r.ID == nil { @@ -21190,6 +21198,14 @@ func (r *Ruleset) GetTarget() string { return *r.Target } +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (r *Ruleset) GetUpdatedAt() Timestamp { + if r == nil || r.UpdatedAt == nil { + return Timestamp{} + } + return *r.UpdatedAt +} + // GetRefName returns the RefName field. func (r *RulesetConditions) GetRefName() *RulesetRefConditionParameters { if r == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index b9b4b08b256..4692094303f 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -27208,6 +27208,17 @@ func TestRuleset_GetConditions(tt *testing.T) { r.GetConditions() } +func TestRuleset_GetCreatedAt(tt *testing.T) { + tt.Parallel() + var zeroValue Timestamp + r := &Ruleset{CreatedAt: &zeroValue} + r.GetCreatedAt() + r = &Ruleset{} + r.GetCreatedAt() + r = nil + r.GetCreatedAt() +} + func TestRuleset_GetID(tt *testing.T) { tt.Parallel() var zeroValue int64 @@ -27260,6 +27271,17 @@ func TestRuleset_GetTarget(tt *testing.T) { r.GetTarget() } +func TestRuleset_GetUpdatedAt(tt *testing.T) { + tt.Parallel() + var zeroValue Timestamp + r := &Ruleset{UpdatedAt: &zeroValue} + r.GetUpdatedAt() + r = &Ruleset{} + r.GetUpdatedAt() + r = nil + r.GetUpdatedAt() +} + func TestRulesetConditions_GetRefName(tt *testing.T) { tt.Parallel() r := &RulesetConditions{} diff --git a/github/repos_rules.go b/github/repos_rules.go index d09bb71d103..ca9e9ea85bc 100644 --- a/github/repos_rules.go +++ b/github/repos_rules.go @@ -548,6 +548,8 @@ type Ruleset struct { Links *RulesetLinks `json:"_links,omitempty"` Conditions *RulesetConditions `json:"conditions,omitempty"` Rules []*RepositoryRule `json:"rules,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` } // rulesetNoOmitBypassActors represents a GitHub ruleset object. The struct does not omit bypassActors if the field is nil or an empty array is passed. diff --git a/github/repos_rules_test.go b/github/repos_rules_test.go index 809bd9a89a1..a34b84cd895 100644 --- a/github/repos_rules_test.go +++ b/github/repos_rules_test.go @@ -489,14 +489,18 @@ func TestRepositoriesService_GetAllRulesets(t *testing.T) { "name": "ruleset", "source_type": "Repository", "source": "o/repo", - "enforcement": "enabled" + "enforcement": "enabled", + "created_at": `+referenceTimeStr+`, + "updated_at": `+referenceTimeStr+` }, { "id": 314, "name": "Another ruleset", "source_type": "Repository", "source": "o/repo", - "enforcement": "enabled" + "enforcement": "enabled", + "created_at": `+referenceTimeStr+`, + "updated_at": `+referenceTimeStr+` } ]`) }) @@ -514,6 +518,8 @@ func TestRepositoriesService_GetAllRulesets(t *testing.T) { SourceType: String("Repository"), Source: "o/repo", Enforcement: "enabled", + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, }, { ID: Int64(314), @@ -521,6 +527,8 @@ func TestRepositoriesService_GetAllRulesets(t *testing.T) { SourceType: String("Repository"), Source: "o/repo", Enforcement: "enabled", + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, }, } if !cmp.Equal(ruleSet, want) { @@ -683,7 +691,9 @@ func TestRepositoriesService_GetRuleset(t *testing.T) { "name": "ruleset", "source_type": "Organization", "source": "o", - "enforcement": "enabled" + "enforcement": "enabled", + "created_at": `+referenceTimeStr+`, + "updated_at": `+referenceTimeStr+` }`) }) @@ -699,6 +709,8 @@ func TestRepositoriesService_GetRuleset(t *testing.T) { SourceType: String("Organization"), Source: "o", Enforcement: "enabled", + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, } if !cmp.Equal(ruleSet, want) { t.Errorf("Repositories.GetRuleset returned %+v, want %+v", ruleSet, want) From 62b5d756e3ea1cf3f13a79eb1bf73a2ff11ae2b0 Mon Sep 17 00:00:00 2001 From: Miles Crabill Date: Wed, 9 Oct 2024 18:36:32 -0700 Subject: [PATCH 538/751] feat: Add Expired to RepositoryInvitation (#3320) --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 11 +++++++++++ github/repos_invitations.go | 1 + 3 files changed, 20 insertions(+) diff --git a/github/github-accessors.go b/github/github-accessors.go index 1c1f6c33e39..f3a16c10ae1 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -20238,6 +20238,14 @@ func (r *RepositoryInvitation) GetCreatedAt() Timestamp { return *r.CreatedAt } +// GetExpired returns the Expired field if it's non-nil, zero value otherwise. +func (r *RepositoryInvitation) GetExpired() bool { + if r == nil || r.Expired == nil { + return false + } + return *r.Expired +} + // GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. func (r *RepositoryInvitation) GetHTMLURL() string { if r == nil || r.HTMLURL == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 4692094303f..2086baa0fda 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -25999,6 +25999,17 @@ func TestRepositoryInvitation_GetCreatedAt(tt *testing.T) { r.GetCreatedAt() } +func TestRepositoryInvitation_GetExpired(tt *testing.T) { + tt.Parallel() + var zeroValue bool + r := &RepositoryInvitation{Expired: &zeroValue} + r.GetExpired() + r = &RepositoryInvitation{} + r.GetExpired() + r = nil + r.GetExpired() +} + func TestRepositoryInvitation_GetHTMLURL(tt *testing.T) { tt.Parallel() var zeroValue string diff --git a/github/repos_invitations.go b/github/repos_invitations.go index 4922e0b298c..98fe01d1c9a 100644 --- a/github/repos_invitations.go +++ b/github/repos_invitations.go @@ -23,6 +23,7 @@ type RepositoryInvitation struct { CreatedAt *Timestamp `json:"created_at,omitempty"` URL *string `json:"url,omitempty"` HTMLURL *string `json:"html_url,omitempty"` + Expired *bool `json:"expired,omitempty"` } // ListInvitations lists all currently-open repository invitations. From 02f31995d5157154eedffb8bb9f3174278a76047 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Thu, 10 Oct 2024 09:35:11 -0400 Subject: [PATCH 539/751] Update openapi_operations.yaml (#3322) --- example/tagprotection/main.go | 68 - github/admin.go | 4 +- github/admin_orgs.go | 6 +- github/admin_stats.go | 2 +- github/admin_users.go | 8 +- github/authorizations.go | 4 +- github/orgs_organization_roles.go | 6 +- github/repos_prereceive_hooks.go | 8 +- github/repos_tags.go | 15 +- github/users.go | 4 +- github/users_administration.go | 8 +- openapi_operations.yaml | 2323 ++++++++++++++++------------- 12 files changed, 1285 insertions(+), 1171 deletions(-) delete mode 100644 example/tagprotection/main.go diff --git a/example/tagprotection/main.go b/example/tagprotection/main.go deleted file mode 100644 index 1aae39b9f26..00000000000 --- a/example/tagprotection/main.go +++ /dev/null @@ -1,68 +0,0 @@ -// 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" - - "github.com/google/go-github/v66/github" - "golang.org/x/term" -) - -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: ") - token, _ := term.ReadPassword(int(os.Stdin.Fd())) - println() - - ctx := context.Background() - client := github.NewClient(nil).WithAuthToken(string(token)) - - // 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/admin.go b/github/admin.go index e93c2266bd1..c932cbe6ad6 100644 --- a/github/admin.go +++ b/github/admin.go @@ -82,7 +82,7 @@ func (m Enterprise) String() string { // UpdateUserLDAPMapping updates the mapping between a GitHub user and an LDAP user. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user // //meta:operation PATCH /admin/ldap/users/{username}/mapping func (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, mapping *UserLDAPMapping) (*UserLDAPMapping, *Response, error) { @@ -103,7 +103,7 @@ func (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, m // UpdateTeamLDAPMapping updates the mapping between a GitHub team and an LDAP group. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team // //meta:operation PATCH /admin/ldap/teams/{team_id}/mapping func (s *AdminService) UpdateTeamLDAPMapping(ctx context.Context, team int64, mapping *TeamLDAPMapping) (*TeamLDAPMapping, *Response, error) { diff --git a/github/admin_orgs.go b/github/admin_orgs.go index cb11fe47f42..f1e728707de 100644 --- a/github/admin_orgs.go +++ b/github/admin_orgs.go @@ -22,7 +22,7 @@ type createOrgRequest struct { // Note that only a subset of the org fields are used and org must // not be nil. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/orgs#create-an-organization +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/orgs#create-an-organization // //meta:operation POST /admin/organizations func (s *AdminService) CreateOrg(ctx context.Context, org *Organization, admin string) (*Organization, *Response, error) { @@ -61,7 +61,7 @@ type RenameOrgResponse struct { // RenameOrg renames an organization in GitHub Enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/orgs#update-an-organization-name +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/orgs#update-an-organization-name // //meta:operation PATCH /admin/organizations/{org} func (s *AdminService) RenameOrg(ctx context.Context, org *Organization, newName string) (*RenameOrgResponse, *Response, error) { @@ -70,7 +70,7 @@ func (s *AdminService) RenameOrg(ctx context.Context, org *Organization, newName // RenameOrgByName renames an organization in GitHub Enterprise using its current name. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/orgs#update-an-organization-name +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/orgs#update-an-organization-name // //meta:operation PATCH /admin/organizations/{org} func (s *AdminService) RenameOrgByName(ctx context.Context, org, newName string) (*RenameOrgResponse, *Response, error) { diff --git a/github/admin_stats.go b/github/admin_stats.go index 70412625147..51b7d86fc39 100644 --- a/github/admin_stats.go +++ b/github/admin_stats.go @@ -152,7 +152,7 @@ func (s RepoStats) String() string { // Please note that this is only available to site administrators, // otherwise it will error with a 404 not found (instead of 401 or 403). // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/admin-stats#get-all-statistics +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-all-statistics // //meta:operation GET /enterprise/stats/all func (s *AdminService) GetAdminStats(ctx context.Context) (*AdminStats, *Response, error) { diff --git a/github/admin_users.go b/github/admin_users.go index 82e568a0ac6..e447f002ac6 100644 --- a/github/admin_users.go +++ b/github/admin_users.go @@ -20,7 +20,7 @@ type CreateUserRequest struct { // CreateUser creates a new user in GitHub Enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#create-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#create-a-user // //meta:operation POST /admin/users func (s *AdminService) CreateUser(ctx context.Context, userReq CreateUserRequest) (*User, *Response, error) { @@ -42,7 +42,7 @@ func (s *AdminService) CreateUser(ctx context.Context, userReq CreateUserRequest // DeleteUser deletes a user in GitHub Enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#delete-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#delete-a-user // //meta:operation DELETE /admin/users/{username} func (s *AdminService) DeleteUser(ctx context.Context, username string) (*Response, error) { @@ -95,7 +95,7 @@ type UserAuthorization struct { // CreateUserImpersonation creates an impersonation OAuth token. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#create-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#create-an-impersonation-oauth-token // //meta:operation POST /admin/users/{username}/authorizations func (s *AdminService) CreateUserImpersonation(ctx context.Context, username string, opts *ImpersonateUserOptions) (*UserAuthorization, *Response, error) { @@ -117,7 +117,7 @@ func (s *AdminService) CreateUserImpersonation(ctx context.Context, username str // DeleteUserImpersonation deletes an impersonation OAuth token. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#delete-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#delete-an-impersonation-oauth-token // //meta:operation DELETE /admin/users/{username}/authorizations func (s *AdminService) DeleteUserImpersonation(ctx context.Context, username string) (*Response, error) { diff --git a/github/authorizations.go b/github/authorizations.go index 9bfff7330ab..a9b0e8d2c04 100644 --- a/github/authorizations.go +++ b/github/authorizations.go @@ -257,7 +257,7 @@ func (s *AuthorizationsService) DeleteGrant(ctx context.Context, clientID, acces // you can e.g. create or delete a user's public SSH key. NOTE: creating a // new token automatically revokes an existing one. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#create-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#create-an-impersonation-oauth-token // //meta:operation POST /admin/users/{username}/authorizations func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, username string, authReq *AuthorizationRequest) (*Authorization, *Response, error) { @@ -279,7 +279,7 @@ func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, usernam // // NOTE: there can be only one at a time. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#delete-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#delete-an-impersonation-oauth-token // //meta:operation DELETE /admin/users/{username}/authorizations func (s *AuthorizationsService) DeleteImpersonation(ctx context.Context, username string) (*Response, error) { diff --git a/github/orgs_organization_roles.go b/github/orgs_organization_roles.go index 695c4dade6f..0954b92d41b 100644 --- a/github/orgs_organization_roles.go +++ b/github/orgs_organization_roles.go @@ -86,7 +86,7 @@ func (s *OrganizationsService) GetOrgRole(ctx context.Context, org string, roleI // CreateCustomOrgRole creates a custom role in this organization. // In order to create custom roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#create-a-custom-organization-role +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/organization-roles#create-a-custom-organization-role // //meta:operation POST /orgs/{org}/organization-roles func (s *OrganizationsService) CreateCustomOrgRole(ctx context.Context, org string, opts *CreateOrUpdateOrgRoleOptions) (*CustomOrgRoles, *Response, error) { @@ -109,7 +109,7 @@ func (s *OrganizationsService) CreateCustomOrgRole(ctx context.Context, org stri // UpdateCustomOrgRole updates a custom role in this organization. // In order to update custom roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#update-a-custom-organization-role +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/organization-roles#update-a-custom-organization-role // //meta:operation PATCH /orgs/{org}/organization-roles/{role_id} func (s *OrganizationsService) UpdateCustomOrgRole(ctx context.Context, org string, roleID int64, opts *CreateOrUpdateOrgRoleOptions) (*CustomOrgRoles, *Response, error) { @@ -132,7 +132,7 @@ func (s *OrganizationsService) UpdateCustomOrgRole(ctx context.Context, org stri // DeleteCustomOrgRole deletes an existing custom role in this organization. // In order to delete custom roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#delete-a-custom-organization-role +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/organization-roles#delete-a-custom-organization-role // //meta:operation DELETE /orgs/{org}/organization-roles/{role_id} func (s *OrganizationsService) DeleteCustomOrgRole(ctx context.Context, org string, roleID int64) (*Response, error) { diff --git a/github/repos_prereceive_hooks.go b/github/repos_prereceive_hooks.go index 7d85c873620..8bac8bff7e0 100644 --- a/github/repos_prereceive_hooks.go +++ b/github/repos_prereceive_hooks.go @@ -24,7 +24,7 @@ func (p PreReceiveHook) String() string { // ListPreReceiveHooks lists all pre-receive hooks for the specified repository. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/pre-receive-hooks func (s *RepositoriesService) ListPreReceiveHooks(ctx context.Context, owner, repo string, opts *ListOptions) ([]*PreReceiveHook, *Response, error) { @@ -53,7 +53,7 @@ func (s *RepositoriesService) ListPreReceiveHooks(ctx context.Context, owner, re // GetPreReceiveHook returns a single specified pre-receive hook. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) GetPreReceiveHook(ctx context.Context, owner, repo string, id int64) (*PreReceiveHook, *Response, error) { @@ -77,7 +77,7 @@ func (s *RepositoriesService) GetPreReceiveHook(ctx context.Context, owner, repo // UpdatePreReceiveHook updates a specified pre-receive hook. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository // //meta:operation PATCH /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) UpdatePreReceiveHook(ctx context.Context, owner, repo string, id int64, hook *PreReceiveHook) (*PreReceiveHook, *Response, error) { @@ -101,7 +101,7 @@ func (s *RepositoriesService) UpdatePreReceiveHook(ctx context.Context, owner, r // DeletePreReceiveHook deletes a specified pre-receive hook. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository // //meta:operation DELETE /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) DeletePreReceiveHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { diff --git a/github/repos_tags.go b/github/repos_tags.go index 93164dd1b8e..3fb7f583d1b 100644 --- a/github/repos_tags.go +++ b/github/repos_tags.go @@ -22,9 +22,10 @@ type tagProtectionRequest struct { Pattern string `json:"pattern"` } -// ListTagProtection lists tag protection of the specified repository. +// Deprecated: ListTagProtection lists tag protection of the specified repository. +// Deprecation notice: This operation is deprecated and will be removed after August 30, 2024. Use the "Repository Rulesets" endpoint instead: https://docs.github.com/rest/repos/rules#get-all-repository-rulesets // -// GitHub API docs: https://docs.github.com/rest/repos/tags#list-tag-protection-states-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/tags#deprecated---list-tag-protection-states-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/tags/protection func (s *RepositoriesService) ListTagProtection(ctx context.Context, owner, repo string) ([]*TagProtection, *Response, error) { @@ -44,9 +45,10 @@ func (s *RepositoriesService) ListTagProtection(ctx context.Context, owner, repo return tagProtections, resp, nil } -// CreateTagProtection creates the tag protection of the specified repository. +// Deprecated: CreateTagProtection creates the tag protection of the specified repository. +// Deprecation notice: This operation is deprecated and will be removed after August 30, 2024. Use the "Repository Rulesets" endpoint instead: https://docs.github.com/rest/repos/rules#create-a-repository-ruleset // -// GitHub API docs: https://docs.github.com/rest/repos/tags#create-a-tag-protection-state-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/tags#deprecated---create-a-tag-protection-state-for-a-repository // //meta:operation POST /repos/{owner}/{repo}/tags/protection func (s *RepositoriesService) CreateTagProtection(ctx context.Context, owner, repo, pattern string) (*TagProtection, *Response, error) { @@ -66,9 +68,10 @@ func (s *RepositoriesService) CreateTagProtection(ctx context.Context, owner, re return tagProtection, resp, nil } -// DeleteTagProtection deletes a tag protection from the specified repository. +// Deprecated: DeleteTagProtection deletes a tag protection from the specified repository. +// Deprecation notice: This operation is deprecated and will be removed after August 30, 2024. Use the "Repository Rulesets" endpoint instead: https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset // -// GitHub API docs: https://docs.github.com/rest/repos/tags#delete-a-tag-protection-state-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/tags#deprecated---delete-a-tag-protection-state-for-a-repository // //meta:operation DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id} func (s *RepositoriesService) DeleteTagProtection(ctx context.Context, owner, repo string, tagProtectionID int64) (*Response, error) { diff --git a/github/users.go b/github/users.go index 51b2b2193bc..c1ab5552477 100644 --- a/github/users.go +++ b/github/users.go @@ -107,9 +107,9 @@ func (s *UsersService) Get(ctx context.Context, user string) (*User, *Response, // GetByID fetches a user. // -// Note: GetByID uses the undocumented GitHub API endpoint "GET /user/{user_id}". +// GitHub API docs: https://docs.github.com/rest/users/users#get-a-user-using-their-id // -//meta:operation GET /user/{user_id} +//meta:operation GET /user/{account_id} func (s *UsersService) GetByID(ctx context.Context, id int64) (*User, *Response, error) { u := fmt.Sprintf("user/%d", id) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/users_administration.go b/github/users_administration.go index 2c86af7336d..6b74da5fe8a 100644 --- a/github/users_administration.go +++ b/github/users_administration.go @@ -12,7 +12,7 @@ import ( // PromoteSiteAdmin promotes a user to a site administrator of a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator // //meta:operation PUT /users/{username}/site_admin func (s *UsersService) PromoteSiteAdmin(ctx context.Context, user string) (*Response, error) { @@ -28,7 +28,7 @@ func (s *UsersService) PromoteSiteAdmin(ctx context.Context, user string) (*Resp // DemoteSiteAdmin demotes a user from site administrator of a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#demote-a-site-administrator +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#demote-a-site-administrator // //meta:operation DELETE /users/{username}/site_admin func (s *UsersService) DemoteSiteAdmin(ctx context.Context, user string) (*Response, error) { @@ -49,7 +49,7 @@ type UserSuspendOptions struct { // Suspend a user on a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#suspend-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#suspend-a-user // //meta:operation PUT /users/{username}/suspended func (s *UsersService) Suspend(ctx context.Context, user string, opts *UserSuspendOptions) (*Response, error) { @@ -65,7 +65,7 @@ func (s *UsersService) Suspend(ctx context.Context, user string, opts *UserSuspe // Unsuspend a user on a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#unsuspend-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#unsuspend-a-user // //meta:operation DELETE /users/{username}/suspended func (s *UsersService) Unsuspend(ctx context.Context, user string) (*Response, error) { diff --git a/openapi_operations.yaml b/openapi_operations.yaml index 2cc8bde30a7..f3d820db227 100644 --- a/openapi_operations.yaml +++ b/openapi_operations.yaml @@ -30,7 +30,6 @@ operations: documentation_url: https://gist.github.com/jonmagic/5282384165e0f86ef105#import-status-request - name: GET /repositories/{repository_id} - name: GET /repositories/{repository_id}/installation - - name: GET /user/{user_id} operation_overrides: - name: GET /meta documentation_url: https://docs.github.com/rest/meta/meta#get-github-meta-information @@ -48,260 +47,260 @@ operation_overrides: documentation_url: https://docs.github.com/rest/pages/pages#request-a-github-pages-build - name: GET /repos/{owner}/{repo}/pages/builds/{build_id} documentation_url: https://docs.github.com/rest/pages/pages#get-github-pages-build -openapi_commit: b65cdcaa8a1453dd394cb898b35696a2130f4504 +openapi_commit: b58921456b9d07db8596feacdff0eea8a6022817 openapi_operations: - name: GET / documentation_url: https://docs.github.com/rest/meta/meta#github-api-root openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /admin/hooks - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/global-webhooks#list-global-webhooks + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/global-webhooks#list-global-webhooks openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /admin/hooks - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/global-webhooks#create-a-global-webhook + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/global-webhooks#create-a-global-webhook openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /admin/hooks/{hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/global-webhooks#delete-a-global-webhook + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/global-webhooks#delete-a-global-webhook openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /admin/hooks/{hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/global-webhooks#get-a-global-webhook + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/global-webhooks#get-a-global-webhook openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /admin/hooks/{hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/global-webhooks#update-a-global-webhook + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/global-webhooks#update-a-global-webhook openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /admin/hooks/{hook_id}/pings - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/global-webhooks#ping-a-global-webhook + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/global-webhooks#ping-a-global-webhook openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /admin/keys - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#list-public-keys + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#list-public-keys openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /admin/keys/{key_ids} - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#delete-a-public-key + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#delete-a-public-key openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /admin/ldap/teams/{team_id}/mapping - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /admin/ldap/teams/{team_id}/sync - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/ldap#sync-ldap-mapping-for-a-team + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/ldap#sync-ldap-mapping-for-a-team openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /admin/ldap/users/{username}/mapping - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /admin/ldap/users/{username}/sync - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/ldap#sync-ldap-mapping-for-a-user + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/ldap#sync-ldap-mapping-for-a-user openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /admin/organizations - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/orgs#create-an-organization + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/orgs#create-an-organization openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /admin/organizations/{org} - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/orgs#update-an-organization-name + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/orgs#update-an-organization-name openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /admin/pre-receive-environments - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/pre-receive-environments#list-pre-receive-environments + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-environments#list-pre-receive-environments openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /admin/pre-receive-environments - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/pre-receive-environments#create-a-pre-receive-environment + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-environments#create-a-pre-receive-environment openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /admin/pre-receive-environments/{pre_receive_environment_id} - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/pre-receive-environments#delete-a-pre-receive-environment + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-environments#delete-a-pre-receive-environment openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /admin/pre-receive-environments/{pre_receive_environment_id} - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/pre-receive-environments#get-a-pre-receive-environment + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-environments#get-a-pre-receive-environment openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /admin/pre-receive-environments/{pre_receive_environment_id} - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/pre-receive-environments#update-a-pre-receive-environment + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-environments#update-a-pre-receive-environment openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /admin/pre-receive-environments/{pre_receive_environment_id}/downloads - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/pre-receive-environments#start-a-pre-receive-environment-download + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-environments#start-a-pre-receive-environment-download openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /admin/pre-receive-environments/{pre_receive_environment_id}/downloads/latest - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/pre-receive-environments#get-the-download-status-for-a-pre-receive-environment + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-environments#get-the-download-status-for-a-pre-receive-environment openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /admin/pre-receive-hooks - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/pre-receive-hooks#list-pre-receive-hooks + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-hooks#list-pre-receive-hooks openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /admin/pre-receive-hooks - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/pre-receive-hooks#create-a-pre-receive-hook + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-hooks#create-a-pre-receive-hook openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /admin/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/pre-receive-hooks#delete-a-pre-receive-hook + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-hooks#delete-a-pre-receive-hook openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /admin/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/pre-receive-hooks#get-a-pre-receive-hook + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-hooks#get-a-pre-receive-hook openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /admin/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/pre-receive-hooks#update-a-pre-receive-hook + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-hooks#update-a-pre-receive-hook openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /admin/tokens - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#list-personal-access-tokens + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#list-personal-access-tokens openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /admin/tokens/{token_id} - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#delete-a-personal-access-token + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#delete-a-personal-access-token openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /admin/users - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#create-a-user + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#create-a-user openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /admin/users/{username} - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#delete-a-user + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#delete-a-user openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /admin/users/{username} - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#update-the-username-for-a-user + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#update-the-username-for-a-user openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /admin/users/{username}/authorizations - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#delete-an-impersonation-oauth-token + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#delete-an-impersonation-oauth-token openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /admin/users/{username}/authorizations - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#create-an-impersonation-oauth-token + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#create-an-impersonation-oauth-token openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /advisories documentation_url: https://docs.github.com/rest/security-advisories/global-advisories#list-global-security-advisories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /advisories/{ghsa_id} documentation_url: https://docs.github.com/rest/security-advisories/global-advisories#get-a-global-security-advisory openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /app documentation_url: https://docs.github.com/rest/apps/apps#get-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /app-manifests/{code}/conversions documentation_url: https://docs.github.com/rest/apps/apps#create-a-github-app-from-a-manifest openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /app/hook/config documentation_url: https://docs.github.com/rest/apps/webhooks#get-a-webhook-configuration-for-an-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /app/hook/config documentation_url: https://docs.github.com/rest/apps/webhooks#update-a-webhook-configuration-for-an-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /app/hook/deliveries documentation_url: https://docs.github.com/rest/apps/webhooks#list-deliveries-for-an-app-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /app/hook/deliveries/{delivery_id} documentation_url: https://docs.github.com/rest/apps/webhooks#get-a-delivery-for-an-app-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /app/hook/deliveries/{delivery_id}/attempts documentation_url: https://docs.github.com/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /app/installation-requests documentation_url: https://docs.github.com/rest/apps/apps#list-installation-requests-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /app/installations documentation_url: https://docs.github.com/rest/apps/apps#list-installations-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /app/installations/{installation_id} documentation_url: https://docs.github.com/rest/apps/apps#delete-an-installation-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /app/installations/{installation_id} documentation_url: https://docs.github.com/rest/apps/apps#get-an-installation-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /app/installations/{installation_id}/access_tokens documentation_url: https://docs.github.com/rest/apps/apps#create-an-installation-access-token-for-an-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /app/installations/{installation_id}/suspended documentation_url: https://docs.github.com/rest/apps/apps#unsuspend-an-app-installation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /app/installations/{installation_id}/suspended documentation_url: https://docs.github.com/rest/apps/apps#suspend-an-app-installation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /applications/grants - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/oauth-authorizations/oauth-authorizations#list-your-grants + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations#list-your-grants openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /applications/grants/{grant_id} - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/oauth-authorizations/oauth-authorizations#delete-a-grant + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations#delete-a-grant openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /applications/grants/{grant_id} - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/oauth-authorizations/oauth-authorizations#get-a-single-grant + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations#get-a-single-grant openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /applications/{client_id}/grant documentation_url: https://docs.github.com/rest/apps/oauth-applications#delete-an-app-authorization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /applications/{client_id}/grants/{access_token} documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#revoke-a-grant-for-an-application openapi_files: @@ -311,25 +310,25 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /applications/{client_id}/token documentation_url: https://docs.github.com/rest/apps/oauth-applications#reset-a-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /applications/{client_id}/token documentation_url: https://docs.github.com/rest/apps/oauth-applications#check-a-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /applications/{client_id}/token/scoped documentation_url: https://docs.github.com/rest/apps/apps#create-a-scoped-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /applications/{client_id}/tokens/{access_token} documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#revoke-an-authorization-for-an-application openapi_files: @@ -347,7 +346,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /assignments/{assignment_id} documentation_url: https://docs.github.com/rest/classroom/classroom#get-an-assignment openapi_files: @@ -364,33 +363,33 @@ openapi_operations: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: GET /authorizations - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/oauth-authorizations/oauth-authorizations#list-your-authorizations + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations#list-your-authorizations openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /authorizations - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/oauth-authorizations/oauth-authorizations#create-a-new-authorization + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations#create-a-new-authorization openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /authorizations/clients/{client_id} - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/oauth-authorizations/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /authorizations/clients/{client_id}/{fingerprint} - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/oauth-authorizations/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app-and-fingerprint + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app-and-fingerprint openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /authorizations/{authorization_id} - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/oauth-authorizations/oauth-authorizations#delete-an-authorization + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations#delete-an-authorization openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /authorizations/{authorization_id} - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/oauth-authorizations/oauth-authorizations#get-a-single-authorization + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations#get-a-single-authorization openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /authorizations/{authorization_id} - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/oauth-authorizations/oauth-authorizations#update-an-existing-authorization + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations#update-an-existing-authorization openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /classrooms documentation_url: https://docs.github.com/rest/classroom/classroom#list-classrooms openapi_files: @@ -411,100 +410,100 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /codes_of_conduct/{key} documentation_url: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-a-code-of-conduct openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /emojis documentation_url: https://docs.github.com/rest/emojis/emojis#get-emojis openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /enterprise-installation/{enterprise_or_org}/server-statistics documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/admin-stats#get-github-enterprise-server-statistics openapi_files: - descriptions/ghec/ghec.json - name: DELETE /enterprise/announcement - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/announcement#remove-the-global-announcement-banner + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/announcement#remove-the-global-announcement-banner openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /enterprise/announcement - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/announcement#get-the-global-announcement-banner + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/announcement#get-the-global-announcement-banner openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /enterprise/announcement - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/announcement#set-the-global-announcement-banner + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/announcement#set-the-global-announcement-banner openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /enterprise/settings/license - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/license#get-license-information + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/license#get-license-information openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /enterprise/stats/all - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/admin-stats#get-all-statistics + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-all-statistics openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /enterprise/stats/comments - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/admin-stats#get-comment-statistics + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-comment-statistics openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /enterprise/stats/gists - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/admin-stats#get-gist-statistics + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-gist-statistics openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /enterprise/stats/hooks - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/admin-stats#get-hooks-statistics + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-hooks-statistics openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /enterprise/stats/issues - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/admin-stats#get-issue-statistics + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-issue-statistics openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /enterprise/stats/milestones - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/admin-stats#get-milestone-statistics + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-milestone-statistics openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /enterprise/stats/orgs - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/admin-stats#get-organization-statistics + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-organization-statistics openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /enterprise/stats/pages - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/admin-stats#get-pages-statistics + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-pages-statistics openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /enterprise/stats/pulls - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/admin-stats#get-pull-request-statistics + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-pull-request-statistics openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /enterprise/stats/repos - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/admin-stats#get-repository-statistics + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-repository-statistics openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /enterprise/stats/security-products - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/admin-stats#get-security-products-statistics + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-security-products-statistics openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /enterprise/stats/users - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/admin-stats#get-users-statistics + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-users-statistics openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /enterprises/{enterprise}/actions/cache/usage documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/cache#get-github-actions-cache-usage-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /enterprises/{enterprise}/actions/cache/usage-policy - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/actions/cache#get-github-actions-cache-usage-policy-for-an-enterprise + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/actions/cache#get-github-actions-cache-usage-policy-for-an-enterprise openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /enterprises/{enterprise}/actions/cache/usage-policy - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/actions/cache#set-github-actions-cache-usage-policy-for-an-enterprise + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/actions/cache#set-github-actions-cache-usage-policy-for-an-enterprise openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /enterprises/{enterprise}/actions/oidc/customization/issuer documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/oidc#set-the-github-actions-oidc-custom-issuer-policy-for-an-enterprise openapi_files: @@ -513,177 +512,177 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-github-actions-permissions-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /enterprises/{enterprise}/actions/permissions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-github-actions-permissions-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /enterprises/{enterprise}/actions/permissions/organizations documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#list-selected-organizations-enabled-for-github-actions-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /enterprises/{enterprise}/actions/permissions/organizations documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-selected-organizations-enabled-for-github-actions-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#disable-a-selected-organization-for-github-actions-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#enable-a-selected-organization-for-github-actions-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /enterprises/{enterprise}/actions/permissions/selected-actions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /enterprises/{enterprise}/actions/permissions/selected-actions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /enterprises/{enterprise}/actions/permissions/workflow documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-default-workflow-permissions-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /enterprises/{enterprise}/actions/permissions/workflow documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-default-workflow-permissions-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /enterprises/{enterprise}/actions/runner-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /enterprises/{enterprise}/actions/runner-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-organization-access-to-a-self-hosted-runner-group-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-organization-access-for-a-self-hosted-runner-group-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-organization-access-to-a-self-hosted-runner-group-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-organization-access-to-a-self-hosted-runner-group-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /enterprises/{enterprise}/actions/runners documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /enterprises/{enterprise}/actions/runners/downloads documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#list-runner-applications-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /enterprises/{enterprise}/actions/runners/generate-jitconfig documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /enterprises/{enterprise}/actions/runners/registration-token documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#create-a-registration-token-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /enterprises/{enterprise}/actions/runners/remove-token documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#create-a-remove-token-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /enterprises/{enterprise}/actions/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /enterprises/{enterprise}/actions/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /enterprises/{enterprise}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /enterprises/{enterprise}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /enterprises/{enterprise}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels/{name} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#remove-a-custom-label-from-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /enterprises/{enterprise}/announcement documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/enterprises#remove-announcement-banner-from-enterprise openapi_files: @@ -700,32 +699,42 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#get-the-audit-log-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /enterprises/{enterprise}/code-scanning/alerts documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /enterprises/{enterprise}/code_security_and_analysis documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#get-code-security-and-analysis-features-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /enterprises/{enterprise}/code_security_and_analysis documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#update-code-security-and-analysis-features-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /enterprises/{enterprise}/consumed-licenses documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/license#list-enterprise-consumed-licenses openapi_files: - descriptions/ghec/ghec.json + - name: GET /enterprises/{enterprise}/copilot/billing/seats + documentation_url: https://docs.github.com/rest/copilot/copilot-user-management#list-all-copilot-seat-assignments-for-an-enterprise + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /enterprises/{enterprise}/copilot/usage + documentation_url: https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-enterprise-members + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /enterprises/{enterprise}/dependabot/alerts documentation_url: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-enterprise openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /enterprises/{enterprise}/license-sync-status documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/license#get-a-license-sync-status openapi_files: @@ -735,7 +744,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /enterprises/{enterprise}/settings/billing/actions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#get-github-actions-billing-for-an-enterprise openapi_files: @@ -744,7 +753,19 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#get-github-advanced-security-active-committers-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json + - name: GET /enterprises/{enterprise}/settings/billing/cost-centers + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#get-all-cost-centers-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - name: DELETE /enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}/resource + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#remove-users-from-a-cost-center + openapi_files: + - descriptions/ghec/ghec.json + - name: POST /enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}/resource + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#add-users-to-a-cost-center + openapi_files: + - descriptions/ghec/ghec.json - name: GET /enterprises/{enterprise}/settings/billing/packages documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#get-github-packages-billing-for-an-enterprise openapi_files: @@ -753,251 +774,276 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#get-shared-storage-billing-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json + - name: GET /enterprises/{enterprise}/settings/billing/usage + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#get-billing-usage-report-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - name: GET /enterprises/{enterprise}/team/{team_slug}/copilot/usage + documentation_url: https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-an-enterprise-team + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: POST /enterprises/{enterprise}/{security_product}/{enablement} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#enable-or-disable-a-security-feature openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /events documentation_url: https://docs.github.com/rest/activity/events#list-public-events openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /feeds documentation_url: https://docs.github.com/rest/activity/feeds#get-feeds openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /gists documentation_url: https://docs.github.com/rest/gists/gists#list-gists-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /gists documentation_url: https://docs.github.com/rest/gists/gists#create-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /gists/public documentation_url: https://docs.github.com/rest/gists/gists#list-public-gists openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /gists/starred documentation_url: https://docs.github.com/rest/gists/gists#list-starred-gists openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /gists/{gist_id} documentation_url: https://docs.github.com/rest/gists/gists#delete-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /gists/{gist_id} documentation_url: https://docs.github.com/rest/gists/gists#get-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /gists/{gist_id} documentation_url: https://docs.github.com/rest/gists/gists#update-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /gists/{gist_id}/comments documentation_url: https://docs.github.com/rest/gists/comments#list-gist-comments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /gists/{gist_id}/comments documentation_url: https://docs.github.com/rest/gists/comments#create-a-gist-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /gists/{gist_id}/comments/{comment_id} documentation_url: https://docs.github.com/rest/gists/comments#delete-a-gist-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /gists/{gist_id}/comments/{comment_id} documentation_url: https://docs.github.com/rest/gists/comments#get-a-gist-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /gists/{gist_id}/comments/{comment_id} documentation_url: https://docs.github.com/rest/gists/comments#update-a-gist-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /gists/{gist_id}/commits documentation_url: https://docs.github.com/rest/gists/gists#list-gist-commits openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /gists/{gist_id}/forks documentation_url: https://docs.github.com/rest/gists/gists#list-gist-forks openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /gists/{gist_id}/forks documentation_url: https://docs.github.com/rest/gists/gists#fork-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /gists/{gist_id}/star documentation_url: https://docs.github.com/rest/gists/gists#unstar-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /gists/{gist_id}/star documentation_url: https://docs.github.com/rest/gists/gists#check-if-a-gist-is-starred openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /gists/{gist_id}/star documentation_url: https://docs.github.com/rest/gists/gists#star-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /gists/{gist_id}/{sha} documentation_url: https://docs.github.com/rest/gists/gists#get-a-gist-revision openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /gitignore/templates documentation_url: https://docs.github.com/rest/gitignore/gitignore#get-all-gitignore-templates openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /gitignore/templates/{name} documentation_url: https://docs.github.com/rest/gitignore/gitignore#get-a-gitignore-template openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /installation/repositories documentation_url: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-app-installation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /installation/token documentation_url: https://docs.github.com/rest/apps/installations#revoke-an-installation-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /issues documentation_url: https://docs.github.com/rest/issues/issues#list-issues-assigned-to-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /licenses documentation_url: https://docs.github.com/rest/licenses/licenses#get-all-commonly-used-licenses openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /licenses/{license} documentation_url: https://docs.github.com/rest/licenses/licenses#get-a-license openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /manage/v1/access/ssh - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/manage-ghes#delete-ssh-key + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#delete-a-ssh-key openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /manage/v1/access/ssh - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/manage-ghes#get-ssh-keys + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#get-the-configured-ssh-keys openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /manage/v1/access/ssh - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/manage-ghes#set-ssh-key + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#set-a-new-ssh-key openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /manage/v1/checks/system-requirements - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/manage-ghes#get-system-requirements-check-results-on-configured-nodes + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#get-the-system-requirement-check-results-for-configured-cluster-nodes + openapi_files: + - descriptions/ghes-3.14/ghes-3.14.json + - name: GET /manage/v1/cluster/status + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-cluster-nodes openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json + - name: GET /manage/v1/config/apply + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#get-the-status-of-a-ghe-config-apply-run + openapi_files: + - descriptions/ghes-3.14/ghes-3.14.json + - name: POST /manage/v1/config/apply + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#trigger-a-ghe-config-apply-run + openapi_files: + - descriptions/ghes-3.14/ghes-3.14.json + - name: GET /manage/v1/config/apply/events + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#list-events-from-ghe-config-apply + openapi_files: + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /manage/v1/config/init - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/manage-ghes#initialize-instance-configuration-with-license-upload + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#initialize-instance-configuration-with-license-upload openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /manage/v1/config/license - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/manage-ghes#get-the-enterprise-license-information + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#get-the-enterprise-license-information openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /manage/v1/config/license - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/manage-ghes#upload-an-enterprise-license + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#upload-an-enterprise-license openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /manage/v1/config/license/check - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/manage-ghes#check-a-license + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#check-a-license openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /manage/v1/config/nodes - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/manage-ghes#get-ghes-node-metadata-for-all-nodes + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#get-ghes-node-metadata-for-all-nodes openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /manage/v1/config/settings - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/manage-ghes#get-settings + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#get-the-ghes-settings openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /manage/v1/config/settings - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/manage-ghes#set-settings + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#set-settings openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /manage/v1/maintenance - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/manage-ghes#get-the-status-of-maintenance-mode + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#get-the-status-of-maintenance-mode openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /manage/v1/maintenance - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/manage-ghes#set-the-status-of-maintenance-mode + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#set-the-status-of-maintenance-mode openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /manage/v1/replication/status - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-replica-nodes + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-replica-nodes openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /manage/v1/version - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/manage-ghes#get-all-ghes-release-versions-for-all-nodes + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#get-all-ghes-release-versions-for-all-nodes openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /markdown documentation_url: https://docs.github.com/rest/markdown/markdown#render-a-markdown-document openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /markdown/raw documentation_url: https://docs.github.com/rest/markdown/markdown#render-a-markdown-document-in-raw-mode openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /marketplace_listing/accounts/{account_id} documentation_url: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account openapi_files: @@ -1033,444 +1079,450 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /networks/{owner}/{repo}/events documentation_url: https://docs.github.com/rest/activity/events#list-public-events-for-a-network-of-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /notifications documentation_url: https://docs.github.com/rest/activity/notifications#list-notifications-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /notifications documentation_url: https://docs.github.com/rest/activity/notifications#mark-notifications-as-read openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /notifications/threads/{thread_id} documentation_url: https://docs.github.com/rest/activity/notifications#mark-a-thread-as-done openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /notifications/threads/{thread_id} documentation_url: https://docs.github.com/rest/activity/notifications#get-a-thread openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /notifications/threads/{thread_id} documentation_url: https://docs.github.com/rest/activity/notifications#mark-a-thread-as-read openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /notifications/threads/{thread_id}/subscription documentation_url: https://docs.github.com/rest/activity/notifications#delete-a-thread-subscription openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /notifications/threads/{thread_id}/subscription documentation_url: https://docs.github.com/rest/activity/notifications#get-a-thread-subscription-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /notifications/threads/{thread_id}/subscription documentation_url: https://docs.github.com/rest/activity/notifications#set-a-thread-subscription openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /octocat documentation_url: https://docs.github.com/rest/meta/meta#get-octocat openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /organizations documentation_url: https://docs.github.com/rest/orgs/orgs#list-organizations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /organizations/{organization_id}/custom_roles documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#deprecated---list-custom-repository-roles-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org} documentation_url: https://docs.github.com/rest/orgs/orgs#delete-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org} documentation_url: https://docs.github.com/rest/orgs/orgs#get-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /orgs/{org} documentation_url: https://docs.github.com/rest/orgs/orgs#update-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/actions/cache/usage documentation_url: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/actions/cache/usage-by-repository documentation_url: https://docs.github.com/rest/actions/cache#list-repositories-with-github-actions-cache-usage-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/actions/oidc/customization/sub documentation_url: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /orgs/{org}/actions/oidc/customization/sub documentation_url: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/actions/permissions documentation_url: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /orgs/{org}/actions/permissions documentation_url: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/actions/permissions/repositories documentation_url: https://docs.github.com/rest/actions/permissions#list-selected-repositories-enabled-for-github-actions-in-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /orgs/{org}/actions/permissions/repositories documentation_url: https://docs.github.com/rest/actions/permissions#set-selected-repositories-enabled-for-github-actions-in-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/actions/permissions/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/permissions#disable-a-selected-repository-for-github-actions-in-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /orgs/{org}/actions/permissions/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/permissions#enable-a-selected-repository-for-github-actions-in-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/actions/permissions/selected-actions documentation_url: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /orgs/{org}/actions/permissions/selected-actions documentation_url: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/actions/permissions/workflow documentation_url: https://docs.github.com/rest/actions/permissions#get-default-workflow-permissions-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /orgs/{org}/actions/permissions/workflow documentation_url: https://docs.github.com/rest/actions/permissions#set-default-workflow-permissions-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/actions/runner-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /orgs/{org}/actions/runner-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /orgs/{org}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-repository-access-to-a-self-hosted-runner-group-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-repository-access-for-a-self-hosted-runner-group-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-repository-access-to-a-self-hosted-runner-group-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/actions/runners documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/actions/runners/downloads documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /orgs/{org}/actions/runners/generate-jitconfig documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /orgs/{org}/actions/runners/registration-token documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /orgs/{org}/actions/runners/remove-token documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/actions/runners/{runner_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/actions/runners/{runner_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /orgs/{org}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /orgs/{org}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-a-custom-label-from-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/actions/secrets documentation_url: https://docs.github.com/rest/actions/secrets#list-organization-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/actions/secrets/public-key documentation_url: https://docs.github.com/rest/actions/secrets#get-an-organization-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#delete-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#get-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /orgs/{org}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/actions/secrets/{secret_name}/repositories documentation_url: https://docs.github.com/rest/actions/secrets#list-selected-repositories-for-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /orgs/{org}/actions/secrets/{secret_name}/repositories documentation_url: https://docs.github.com/rest/actions/secrets#set-selected-repositories-for-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/secrets#remove-selected-repository-from-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/secrets#add-selected-repository-to-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/actions/variables documentation_url: https://docs.github.com/rest/actions/variables#list-organization-variables openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /orgs/{org}/actions/variables documentation_url: https://docs.github.com/rest/actions/variables#create-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#delete-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#get-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /orgs/{org}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#update-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/actions/variables/{name}/repositories documentation_url: https://docs.github.com/rest/actions/variables#list-selected-repositories-for-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /orgs/{org}/actions/variables/{name}/repositories documentation_url: https://docs.github.com/rest/actions/variables#set-selected-repositories-for-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/variables#remove-selected-repository-from-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/variables#add-selected-repository-to-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/announcement documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/organizations#remove-announcement-banner-from-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/announcement documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/organizations#get-announcement-banner-for-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /orgs/{org}/announcement documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/organizations#set-announcement-banner-for-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json + - name: GET /orgs/{org}/attestations/{subject_digest} + documentation_url: https://docs.github.com/rest/orgs/orgs#list-attestations + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /orgs/{org}/audit-log documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/orgs#get-the-audit-log-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/blocks documentation_url: https://docs.github.com/rest/orgs/blocking#list-users-blocked-by-an-organization openapi_files: @@ -1496,7 +1548,57 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json + - name: GET /orgs/{org}/code-security/configurations + documentation_url: https://docs.github.com/rest/code-security/configurations#get-code-security-configurations-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: POST /orgs/{org}/code-security/configurations + documentation_url: https://docs.github.com/rest/code-security/configurations#create-a-code-security-configuration + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/code-security/configurations/defaults + documentation_url: https://docs.github.com/rest/code-security/configurations#get-default-code-security-configurations + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /orgs/{org}/code-security/configurations/detach + documentation_url: https://docs.github.com/rest/code-security/configurations#detach-configurations-from-repositories + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /orgs/{org}/code-security/configurations/{configuration_id} + documentation_url: https://docs.github.com/rest/code-security/configurations#delete-a-code-security-configuration + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/code-security/configurations/{configuration_id} + documentation_url: https://docs.github.com/rest/code-security/configurations#get-a-code-security-configuration + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PATCH /orgs/{org}/code-security/configurations/{configuration_id} + documentation_url: https://docs.github.com/rest/code-security/configurations#update-a-code-security-configuration + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: POST /orgs/{org}/code-security/configurations/{configuration_id}/attach + documentation_url: https://docs.github.com/rest/code-security/configurations#attach-a-configuration-to-repositories + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults + documentation_url: https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories + documentation_url: https://docs.github.com/rest/code-security/configurations#get-repositories-associated-with-a-code-security-configuration + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /orgs/{org}/codespaces documentation_url: https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-the-organization openapi_files: @@ -1592,6 +1694,11 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/copilot/usage + documentation_url: https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-organization-members + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /orgs/{org}/credential-authorizations documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/orgs#list-saml-sso-authorizations-for-an-organization openapi_files: @@ -1604,27 +1711,27 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /orgs/{org}/custom-repository-roles documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#create-a-custom-repository-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/custom-repository-roles/{role_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#delete-a-custom-repository-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/custom-repository-roles/{role_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#get-a-custom-repository-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /orgs/{org}/custom-repository-roles/{role_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#update-a-custom-repository-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /orgs/{org}/custom_roles documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#deprecated---create-a-custom-role openapi_files: @@ -1646,83 +1753,83 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/dependabot/secrets documentation_url: https://docs.github.com/rest/dependabot/secrets#list-organization-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/dependabot/secrets/public-key documentation_url: https://docs.github.com/rest/dependabot/secrets#get-an-organization-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#delete-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#get-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /orgs/{org}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories documentation_url: https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories documentation_url: https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/dependabot/secrets#add-selected-repository-to-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/docker/conflicts documentation_url: https://docs.github.com/rest/packages/packages#get-list-of-conflicting-packages-during-docker-migration-for-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/events documentation_url: https://docs.github.com/rest/activity/events#list-public-organization-events openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/external-group/{group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#get-an-external-group openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/external-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#list-external-groups-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/failed_invitations documentation_url: https://docs.github.com/rest/orgs/members#list-failed-organization-invitations openapi_files: @@ -1737,79 +1844,79 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /orgs/{org}/hooks documentation_url: https://docs.github.com/rest/orgs/webhooks#create-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/orgs/webhooks#delete-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/orgs/webhooks#get-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /orgs/{org}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/orgs/webhooks#update-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/hooks/{hook_id}/config documentation_url: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /orgs/{org}/hooks/{hook_id}/config documentation_url: https://docs.github.com/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/hooks/{hook_id}/deliveries documentation_url: https://docs.github.com/rest/orgs/webhooks#list-deliveries-for-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id} documentation_url: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-delivery-for-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts documentation_url: https://docs.github.com/rest/orgs/webhooks#redeliver-a-delivery-for-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /orgs/{org}/hooks/{hook_id}/pings documentation_url: https://docs.github.com/rest/orgs/webhooks#ping-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/installation documentation_url: https://docs.github.com/rest/apps/apps#get-an-organization-installation-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/installations documentation_url: https://docs.github.com/rest/orgs/orgs#list-app-installations-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/interaction-limits documentation_url: https://docs.github.com/rest/interactions/orgs#remove-interaction-restrictions-for-an-organization openapi_files: @@ -1850,25 +1957,25 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/members documentation_url: https://docs.github.com/rest/orgs/members#list-organization-members openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/members/{username} documentation_url: https://docs.github.com/rest/orgs/members#remove-an-organization-member openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/members/{username} documentation_url: https://docs.github.com/rest/orgs/members#check-organization-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/members/{username}/codespaces documentation_url: https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-a-user-in-organization openapi_files: @@ -1894,397 +2001,414 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/memberships/{username} documentation_url: https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /orgs/{org}/memberships/{username} documentation_url: https://docs.github.com/rest/orgs/members#set-organization-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/migrations documentation_url: https://docs.github.com/rest/migrations/orgs#list-organization-migrations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /orgs/{org}/migrations documentation_url: https://docs.github.com/rest/migrations/orgs#start-an-organization-migration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/migrations/{migration_id} documentation_url: https://docs.github.com/rest/migrations/orgs#get-an-organization-migration-status openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/migrations/{migration_id}/archive documentation_url: https://docs.github.com/rest/migrations/orgs#delete-an-organization-migration-archive openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/migrations/{migration_id}/archive documentation_url: https://docs.github.com/rest/migrations/orgs#download-an-organization-migration-archive openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock documentation_url: https://docs.github.com/rest/migrations/orgs#unlock-an-organization-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/migrations/{migration_id}/repositories documentation_url: https://docs.github.com/rest/migrations/orgs#list-repositories-in-an-organization-migration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/organization-fine-grained-permissions - documentation_url: https://docs.github.com/rest/orgs/organization-roles#list-organization-fine-grained-permissions-for-an-organization + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/organization-roles#list-organization-fine-grained-permissions-for-an-organization openapi_files: - - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/organization-roles documentation_url: https://docs.github.com/rest/orgs/organization-roles#get-all-organization-roles-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /orgs/{org}/organization-roles - documentation_url: https://docs.github.com/rest/orgs/organization-roles#create-a-custom-organization-role + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/organization-roles#create-a-custom-organization-role openapi_files: - - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/organization-roles/teams/{team_slug} documentation_url: https://docs.github.com/rest/orgs/organization-roles#remove-all-organization-roles-for-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id} documentation_url: https://docs.github.com/rest/orgs/organization-roles#remove-an-organization-role-from-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id} documentation_url: https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/organization-roles/users/{username} documentation_url: https://docs.github.com/rest/orgs/organization-roles#remove-all-organization-roles-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/organization-roles/users/{username}/{role_id} documentation_url: https://docs.github.com/rest/orgs/organization-roles#remove-an-organization-role-from-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /orgs/{org}/organization-roles/users/{username}/{role_id} documentation_url: https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/organization-roles/{role_id} - documentation_url: https://docs.github.com/rest/orgs/organization-roles#delete-a-custom-organization-role + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/organization-roles#delete-a-custom-organization-role openapi_files: - - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/organization-roles/{role_id} documentation_url: https://docs.github.com/rest/orgs/organization-roles#get-an-organization-role openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /orgs/{org}/organization-roles/{role_id} - documentation_url: https://docs.github.com/rest/orgs/organization-roles#update-a-custom-organization-role + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/organization-roles#update-a-custom-organization-role openapi_files: - - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/organization-roles/{role_id}/teams documentation_url: https://docs.github.com/rest/orgs/organization-roles#list-teams-that-are-assigned-to-an-organization-role openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/organization-roles/{role_id}/users documentation_url: https://docs.github.com/rest/orgs/organization-roles#list-users-that-are-assigned-to-an-organization-role openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/outside_collaborators documentation_url: https://docs.github.com/rest/orgs/outside-collaborators#list-outside-collaborators-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/outside_collaborators/{username} documentation_url: https://docs.github.com/rest/orgs/outside-collaborators#remove-outside-collaborator-from-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /orgs/{org}/outside_collaborators/{username} documentation_url: https://docs.github.com/rest/orgs/outside-collaborators#convert-an-organization-member-to-outside-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/packages documentation_url: https://docs.github.com/rest/packages/packages#list-packages-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /orgs/{org}/packages/{package_type}/{package_name}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/packages/{package_type}/{package_name}/versions documentation_url: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#delete-package-version-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-version-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-package-version-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/personal-access-token-requests documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /orgs/{org}/personal-access-token-requests documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#review-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /orgs/{org}/personal-access-token-requests/{pat_request_id} documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#review-a-request-to-access-organization-resources-with-a-fine-grained-personal-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-repositories-requested-to-be-accessed-by-a-fine-grained-personal-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/personal-access-tokens documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-fine-grained-personal-access-tokens-with-access-to-organization-resources openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /orgs/{org}/personal-access-tokens documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#update-the-access-to-organization-resources-via-fine-grained-personal-access-tokens openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /orgs/{org}/personal-access-tokens/{pat_id} documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#update-the-access-a-fine-grained-personal-access-token-has-to-organization-resources openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-repositories-a-fine-grained-personal-access-token-has-access-to openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/pre-receive-hooks - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/org-pre-receive-hooks#list-pre-receive-hooks-for-an-organization + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/org-pre-receive-hooks#list-pre-receive-hooks-for-an-organization openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/org-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-an-organization + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/org-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-an-organization openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/org-pre-receive-hooks#get-a-pre-receive-hook-for-an-organization + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/org-pre-receive-hooks#get-a-pre-receive-hook-for-an-organization openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /orgs/{org}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/org-pre-receive-hooks#update-pre-receive-hook-enforcement-for-an-organization + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/org-pre-receive-hooks#update-pre-receive-hook-enforcement-for-an-organization openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/projects documentation_url: https://docs.github.com/rest/projects/projects#list-organization-projects openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /orgs/{org}/projects documentation_url: https://docs.github.com/rest/projects/projects#create-an-organization-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/properties/schema documentation_url: https://docs.github.com/rest/orgs/custom-properties#get-all-custom-properties-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /orgs/{org}/properties/schema documentation_url: https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-properties-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/properties/schema/{custom_property_name} documentation_url: https://docs.github.com/rest/orgs/custom-properties#remove-a-custom-property-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/properties/schema/{custom_property_name} documentation_url: https://docs.github.com/rest/orgs/custom-properties#get-a-custom-property-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /orgs/{org}/properties/schema/{custom_property_name} documentation_url: https://docs.github.com/rest/orgs/custom-properties#create-or-update-a-custom-property-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/properties/values documentation_url: https://docs.github.com/rest/orgs/custom-properties#list-custom-property-values-for-organization-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /orgs/{org}/properties/values documentation_url: https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-property-values-for-organization-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/public_members documentation_url: https://docs.github.com/rest/orgs/members#list-public-organization-members openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/public_members/{username} documentation_url: https://docs.github.com/rest/orgs/members#remove-public-organization-membership-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/public_members/{username} documentation_url: https://docs.github.com/rest/orgs/members#check-public-organization-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /orgs/{org}/public_members/{username} documentation_url: https://docs.github.com/rest/orgs/members#set-public-organization-membership-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/repos documentation_url: https://docs.github.com/rest/repos/repos#list-organization-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /orgs/{org}/repos documentation_url: https://docs.github.com/rest/repos/repos#create-an-organization-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/repository-fine-grained-permissions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#list-repository-fine-grained-permissions-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/rulesets documentation_url: https://docs.github.com/rest/orgs/rules#get-all-organization-repository-rulesets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /orgs/{org}/rulesets documentation_url: https://docs.github.com/rest/orgs/rules#create-an-organization-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/rulesets/rule-suites documentation_url: https://docs.github.com/rest/orgs/rule-suites#list-organization-rule-suites openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id} documentation_url: https://docs.github.com/rest/orgs/rule-suites#get-an-organization-rule-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/orgs/rules#delete-an-organization-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/orgs/rules#get-an-organization-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /orgs/{org}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/orgs/rules#update-an-organization-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/secret-scanning/alerts documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/security-advisories documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories-for-an-organization openapi_files: @@ -2295,19 +2419,19 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/security-managers/teams/{team_slug} documentation_url: https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /orgs/{org}/security-managers/teams/{team_slug} documentation_url: https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/settings/billing/actions documentation_url: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-an-organization openapi_files: @@ -2317,7 +2441,7 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/billing/billing#get-github-advanced-security-active-committers-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/settings/billing/packages documentation_url: https://docs.github.com/rest/billing/billing#get-github-packages-billing-for-an-organization openapi_files: @@ -2332,147 +2456,152 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#list-idp-groups-for-an-organization openapi_files: - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/team/{team_slug}/copilot/usage + documentation_url: https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-a-team + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /orgs/{org}/teams documentation_url: https://docs.github.com/rest/teams/teams#list-teams openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /orgs/{org}/teams documentation_url: https://docs.github.com/rest/teams/teams#create-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/teams/{team_slug} documentation_url: https://docs.github.com/rest/teams/teams#delete-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/teams/{team_slug} documentation_url: https://docs.github.com/rest/teams/teams#get-a-team-by-name openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /orgs/{org}/teams/{team_slug} documentation_url: https://docs.github.com/rest/teams/teams#update-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/teams/{team_slug}/discussions documentation_url: https://docs.github.com/rest/teams/discussions#list-discussions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /orgs/{org}/teams/{team_slug}/discussions documentation_url: https://docs.github.com/rest/teams/discussions#create-a-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#delete-a-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#get-a-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#update-a-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments documentation_url: https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments documentation_url: https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-team-discussion-comment-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-team-discussion-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/teams/{team_slug}/external-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#remove-the-connection-between-an-external-group-and-a-team openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/teams/{team_slug}/external-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#list-a-connection-between-an-external-group-and-a-team openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /orgs/{org}/teams/{team_slug}/external-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#update-the-connection-between-an-external-group-and-a-team openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/teams/{team_slug}/invitations documentation_url: https://docs.github.com/rest/teams/members#list-pending-team-invitations openapi_files: @@ -2483,73 +2612,73 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/teams/{team_slug}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/teams/{team_slug}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#get-team-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /orgs/{org}/teams/{team_slug}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/teams/{team_slug}/projects documentation_url: https://docs.github.com/rest/teams/teams#list-team-projects openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/teams/{team_slug}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /orgs/{org}/teams/{team_slug}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/teams/{team_slug}/repos documentation_url: https://docs.github.com/rest/teams/teams#list-team-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#list-idp-groups-for-a-team openapi_files: @@ -2563,133 +2692,133 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /orgs/{org}/{security_product}/{enablement} documentation_url: https://docs.github.com/rest/orgs/orgs#enable-or-disable-a-security-feature-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /projects/columns/cards/{card_id} documentation_url: https://docs.github.com/rest/projects/cards#delete-a-project-card openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /projects/columns/cards/{card_id} documentation_url: https://docs.github.com/rest/projects/cards#get-a-project-card openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /projects/columns/cards/{card_id} documentation_url: https://docs.github.com/rest/projects/cards#update-an-existing-project-card openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /projects/columns/cards/{card_id}/moves documentation_url: https://docs.github.com/rest/projects/cards#move-a-project-card openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /projects/columns/{column_id} documentation_url: https://docs.github.com/rest/projects/columns#delete-a-project-column openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /projects/columns/{column_id} documentation_url: https://docs.github.com/rest/projects/columns#get-a-project-column openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /projects/columns/{column_id} documentation_url: https://docs.github.com/rest/projects/columns#update-an-existing-project-column openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /projects/columns/{column_id}/cards documentation_url: https://docs.github.com/rest/projects/cards#list-project-cards openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /projects/columns/{column_id}/cards documentation_url: https://docs.github.com/rest/projects/cards#create-a-project-card openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /projects/columns/{column_id}/moves documentation_url: https://docs.github.com/rest/projects/columns#move-a-project-column openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /projects/{project_id} documentation_url: https://docs.github.com/rest/projects/projects#delete-a-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /projects/{project_id} documentation_url: https://docs.github.com/rest/projects/projects#get-a-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /projects/{project_id} documentation_url: https://docs.github.com/rest/projects/projects#update-a-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /projects/{project_id}/collaborators documentation_url: https://docs.github.com/rest/projects/collaborators#list-project-collaborators openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /projects/{project_id}/collaborators/{username} documentation_url: https://docs.github.com/rest/projects/collaborators#remove-user-as-a-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /projects/{project_id}/collaborators/{username} documentation_url: https://docs.github.com/rest/projects/collaborators#add-project-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /projects/{project_id}/collaborators/{username}/permission documentation_url: https://docs.github.com/rest/projects/collaborators#get-project-permission-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /projects/{project_id}/columns documentation_url: https://docs.github.com/rest/projects/columns#list-project-columns openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /projects/{project_id}/columns documentation_url: https://docs.github.com/rest/projects/columns#create-a-project-column openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /rate_limit documentation_url: https://docs.github.com/rest/rate-limit/rate-limit#get-rate-limit-status-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /reactions/{reaction_id} documentation_url: https://docs.github.com/enterprise-server@3.4/rest/reference/reactions/#delete-a-reaction-legacy openapi_files: @@ -2699,261 +2828,261 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/repos/repos#get-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/repos/repos#update-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/artifacts documentation_url: https://docs.github.com/rest/actions/artifacts#list-artifacts-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id} documentation_url: https://docs.github.com/rest/actions/artifacts#delete-an-artifact openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id} documentation_url: https://docs.github.com/rest/actions/artifacts#get-an-artifact openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format} documentation_url: https://docs.github.com/rest/actions/artifacts#download-an-artifact openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/cache/usage documentation_url: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/cache/usage-policy - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/actions/cache#get-github-actions-cache-usage-policy-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/actions/cache#get-github-actions-cache-usage-policy-for-a-repository openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /repos/{owner}/{repo}/actions/cache/usage-policy - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/actions/cache#set-github-actions-cache-usage-policy-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/actions/cache#set-github-actions-cache-usage-policy-for-a-repository openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/actions/caches documentation_url: https://docs.github.com/rest/actions/cache#delete-github-actions-caches-for-a-repository-using-a-cache-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/caches documentation_url: https://docs.github.com/rest/actions/cache#list-github-actions-caches-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/actions/caches/{cache_id} documentation_url: https://docs.github.com/rest/actions/cache#delete-a-github-actions-cache-for-a-repository-using-a-cache-id openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/jobs/{job_id} documentation_url: https://docs.github.com/rest/actions/workflow-jobs#get-a-job-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs documentation_url: https://docs.github.com/rest/actions/workflow-jobs#download-job-logs-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun documentation_url: https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/oidc/customization/sub documentation_url: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /repos/{owner}/{repo}/actions/oidc/customization/sub documentation_url: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/organization-secrets documentation_url: https://docs.github.com/rest/actions/secrets#list-repository-organization-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/organization-variables documentation_url: https://docs.github.com/rest/actions/variables#list-repository-organization-variables openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/permissions documentation_url: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /repos/{owner}/{repo}/actions/permissions documentation_url: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/permissions/access documentation_url: https://docs.github.com/rest/actions/permissions#get-the-level-of-access-for-workflows-outside-of-the-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /repos/{owner}/{repo}/actions/permissions/access documentation_url: https://docs.github.com/rest/actions/permissions#set-the-level-of-access-for-workflows-outside-of-the-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/permissions/selected-actions documentation_url: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /repos/{owner}/{repo}/actions/permissions/selected-actions documentation_url: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/permissions/workflow documentation_url: https://docs.github.com/rest/actions/permissions#get-default-workflow-permissions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /repos/{owner}/{repo}/actions/permissions/workflow documentation_url: https://docs.github.com/rest/actions/permissions#set-default-workflow-permissions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/runners documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/runners/downloads documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/actions/runners/registration-token documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/actions/runners/remove-token documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/actions/runners/{runner_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/runners/{runner_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-a-custom-label-from-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/runs documentation_url: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/actions/runs/{run_id} documentation_url: https://docs.github.com/rest/actions/workflow-runs#delete-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id} documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-the-review-history-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve documentation_url: https://docs.github.com/rest/actions/workflow-runs#approve-a-workflow-run-for-a-fork-pull-request openapi_files: @@ -2964,85 +3093,85 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number} documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run-attempt openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs documentation_url: https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run-attempt openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs documentation_url: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-attempt-logs openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel documentation_url: https://docs.github.com/rest/actions/workflow-runs#cancel-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule documentation_url: https://docs.github.com/rest/actions/workflow-runs#review-custom-deployment-protection-rules-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel documentation_url: https://docs.github.com/rest/actions/workflow-runs#force-cancel-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs documentation_url: https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs documentation_url: https://docs.github.com/rest/actions/workflow-runs#delete-workflow-run-logs openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs documentation_url: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-logs openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-pending-deployments-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments documentation_url: https://docs.github.com/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun documentation_url: https://docs.github.com/rest/actions/workflow-runs#re-run-a-workflow openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs documentation_url: https://docs.github.com/rest/actions/workflow-runs#re-run-failed-jobs-from-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-workflow-run-usage openapi_files: @@ -3053,97 +3182,97 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/secrets/public-key documentation_url: https://docs.github.com/rest/actions/secrets#get-a-repository-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#delete-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#get-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /repos/{owner}/{repo}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#create-or-update-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/variables documentation_url: https://docs.github.com/rest/actions/variables#list-repository-variables openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/actions/variables documentation_url: https://docs.github.com/rest/actions/variables#create-a-repository-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#delete-a-repository-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#get-a-repository-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /repos/{owner}/{repo}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#update-a-repository-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/workflows documentation_url: https://docs.github.com/rest/actions/workflows#list-repository-workflows openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/workflows/{workflow_id} documentation_url: https://docs.github.com/rest/actions/workflows#get-a-workflow openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable documentation_url: https://docs.github.com/rest/actions/workflows#disable-a-workflow openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches documentation_url: https://docs.github.com/rest/actions/workflows#create-a-workflow-dispatch-event openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable documentation_url: https://docs.github.com/rest/actions/workflows#enable-a-workflow openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs documentation_url: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-workflow openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing documentation_url: https://docs.github.com/rest/actions/workflows#get-workflow-usage openapi_files: @@ -3154,43 +3283,53 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/assignees documentation_url: https://docs.github.com/rest/issues/assignees#list-assignees openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/assignees/{assignee} documentation_url: https://docs.github.com/rest/issues/assignees#check-if-a-user-can-be-assigned openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json + - name: POST /repos/{owner}/{repo}/attestations + documentation_url: https://docs.github.com/rest/repos/repos#create-an-attestation + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/attestations/{subject_digest} + documentation_url: https://docs.github.com/rest/repos/repos#list-attestations + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /repos/{owner}/{repo}/autolinks documentation_url: https://docs.github.com/rest/repos/autolinks#get-all-autolinks-of-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/autolinks documentation_url: https://docs.github.com/rest/repos/autolinks#create-an-autolink-reference-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/autolinks/{autolink_id} documentation_url: https://docs.github.com/rest/repos/autolinks#delete-an-autolink-reference-from-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/autolinks/{autolink_id} documentation_url: https://docs.github.com/rest/repos/autolinks#get-an-autolink-reference-of-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/automated-security-fixes documentation_url: https://docs.github.com/rest/repos/repos#disable-automated-security-fixes openapi_files: @@ -3201,7 +3340,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /repos/{owner}/{repo}/automated-security-fixes documentation_url: https://docs.github.com/rest/repos/repos#enable-automated-security-fixes openapi_files: @@ -3212,319 +3351,319 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/branches/{branch} documentation_url: https://docs.github.com/rest/branches/branches#get-a-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection documentation_url: https://docs.github.com/rest/branches/branch-protection#get-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection documentation_url: https://docs.github.com/rest/branches/branch-protection#update-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-admin-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins documentation_url: https://docs.github.com/rest/branches/branch-protection#get-admin-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins documentation_url: https://docs.github.com/rest/branches/branch-protection#set-admin-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-pull-request-review-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews documentation_url: https://docs.github.com/rest/branches/branch-protection#get-pull-request-review-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews documentation_url: https://docs.github.com/rest/branches/branch-protection#update-pull-request-review-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-commit-signature-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures documentation_url: https://docs.github.com/rest/branches/branch-protection#get-commit-signature-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures documentation_url: https://docs.github.com/rest/branches/branch-protection#create-commit-signature-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-status-check-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks documentation_url: https://docs.github.com/rest/branches/branch-protection#get-status-checks-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks documentation_url: https://docs.github.com/rest/branches/branch-protection#update-status-check-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-status-check-contexts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts documentation_url: https://docs.github.com/rest/branches/branch-protection#get-all-status-check-contexts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts documentation_url: https://docs.github.com/rest/branches/branch-protection#add-status-check-contexts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts documentation_url: https://docs.github.com/rest/branches/branch-protection#set-status-check-contexts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions documentation_url: https://docs.github.com/rest/branches/branch-protection#get-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-app-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps documentation_url: https://docs.github.com/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps documentation_url: https://docs.github.com/rest/branches/branch-protection#add-app-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps documentation_url: https://docs.github.com/rest/branches/branch-protection#set-app-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-team-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams documentation_url: https://docs.github.com/rest/branches/branch-protection#get-teams-with-access-to-the-protected-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams documentation_url: https://docs.github.com/rest/branches/branch-protection#add-team-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams documentation_url: https://docs.github.com/rest/branches/branch-protection#set-team-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-user-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users documentation_url: https://docs.github.com/rest/branches/branch-protection#get-users-with-access-to-the-protected-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users documentation_url: https://docs.github.com/rest/branches/branch-protection#add-user-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users documentation_url: https://docs.github.com/rest/branches/branch-protection#set-user-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/branches/{branch}/rename documentation_url: https://docs.github.com/rest/branches/branches#rename-a-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/check-runs documentation_url: https://docs.github.com/rest/checks/runs#create-a-check-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/check-runs/{check_run_id} documentation_url: https://docs.github.com/rest/checks/runs#get-a-check-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /repos/{owner}/{repo}/check-runs/{check_run_id} documentation_url: https://docs.github.com/rest/checks/runs#update-a-check-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations documentation_url: https://docs.github.com/rest/checks/runs#list-check-run-annotations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest documentation_url: https://docs.github.com/rest/checks/runs#rerequest-a-check-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/check-suites documentation_url: https://docs.github.com/rest/checks/suites#create-a-check-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /repos/{owner}/{repo}/check-suites/preferences documentation_url: https://docs.github.com/rest/checks/suites#update-repository-preferences-for-check-suites openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/check-suites/{check_suite_id} documentation_url: https://docs.github.com/rest/checks/suites#get-a-check-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs documentation_url: https://docs.github.com/rest/checks/runs#list-check-runs-in-a-check-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest documentation_url: https://docs.github.com/rest/checks/suites#rerequest-a-check-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/code-scanning/alerts documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-instances-of-a-code-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/code-scanning/analyses documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-analyses-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#delete-a-code-scanning-analysis-from-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/code-scanning/codeql/databases documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-codeql-databases-for-a-repository openapi_files: @@ -3535,36 +3674,56 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - name: POST /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses + documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#create-a-codeql-variant-analysis + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id} + documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-the-summary-of-a-codeql-variant-analysis + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}/repos/{repo_owner}/{repo_name} + documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-the-analysis-status-of-a-repository-in-a-codeql-variant-analysis + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /repos/{owner}/{repo}/code-scanning/default-setup documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-default-setup-configuration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /repos/{owner}/{repo}/code-scanning/default-setup documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-default-setup-configuration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/code-scanning/sarifs documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#upload-an-analysis-as-sarif-data openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-information-about-a-sarif-upload openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json + - name: GET /repos/{owner}/{repo}/code-security-configuration + documentation_url: https://docs.github.com/rest/code-security/configurations#get-the-code-security-configuration-associated-with-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /repos/{owner}/{repo}/codeowners/errors documentation_url: https://docs.github.com/rest/repos/repos#list-codeowners-errors openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/codespaces documentation_url: https://docs.github.com/rest/codespaces/codespaces#list-codespaces-in-a-repository-for-the-authenticated-user openapi_files: @@ -3625,133 +3784,133 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/collaborators/{username} documentation_url: https://docs.github.com/rest/collaborators/collaborators#remove-a-repository-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/collaborators/{username} documentation_url: https://docs.github.com/rest/collaborators/collaborators#check-if-a-user-is-a-repository-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /repos/{owner}/{repo}/collaborators/{username} documentation_url: https://docs.github.com/rest/collaborators/collaborators#add-a-repository-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/collaborators/{username}/permission documentation_url: https://docs.github.com/rest/collaborators/collaborators#get-repository-permissions-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/comments documentation_url: https://docs.github.com/rest/commits/comments#list-commit-comments-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/comments/{comment_id} documentation_url: https://docs.github.com/rest/commits/comments#delete-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/comments/{comment_id} documentation_url: https://docs.github.com/rest/commits/comments#get-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /repos/{owner}/{repo}/comments/{comment_id} documentation_url: https://docs.github.com/rest/commits/comments#update-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-a-commit-comment-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/commits documentation_url: https://docs.github.com/rest/commits/commits#list-commits openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head documentation_url: https://docs.github.com/rest/commits/commits#list-branches-for-head-commit openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/commits/{commit_sha}/comments documentation_url: https://docs.github.com/rest/commits/comments#list-commit-comments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/commits/{commit_sha}/comments documentation_url: https://docs.github.com/rest/commits/comments#create-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls documentation_url: https://docs.github.com/rest/commits/commits#list-pull-requests-associated-with-a-commit openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/commits/{ref} documentation_url: https://docs.github.com/rest/commits/commits#get-a-commit openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/commits/{ref}/check-runs documentation_url: https://docs.github.com/rest/checks/runs#list-check-runs-for-a-git-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/commits/{ref}/check-suites documentation_url: https://docs.github.com/rest/checks/suites#list-check-suites-for-a-git-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/commits/{ref}/status documentation_url: https://docs.github.com/rest/commits/statuses#get-the-combined-status-for-a-specific-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/commits/{ref}/statuses documentation_url: https://docs.github.com/rest/commits/statuses#list-commit-statuses-for-a-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/community/profile documentation_url: https://docs.github.com/rest/metrics/community#get-community-profile-metrics openapi_files: @@ -3762,7 +3921,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#create-a-content-attachment openapi_files: @@ -3772,451 +3931,451 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/contents/{path} documentation_url: https://docs.github.com/rest/repos/contents#get-repository-content openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /repos/{owner}/{repo}/contents/{path} documentation_url: https://docs.github.com/rest/repos/contents#create-or-update-file-contents openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/contributors documentation_url: https://docs.github.com/rest/repos/repos#list-repository-contributors openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/dependabot/alerts documentation_url: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number} documentation_url: https://docs.github.com/rest/dependabot/alerts#get-a-dependabot-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number} documentation_url: https://docs.github.com/rest/dependabot/alerts#update-a-dependabot-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/dependabot/secrets documentation_url: https://docs.github.com/rest/dependabot/secrets#list-repository-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/dependabot/secrets/public-key documentation_url: https://docs.github.com/rest/dependabot/secrets#get-a-repository-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#delete-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#get-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#create-or-update-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead} documentation_url: https://docs.github.com/rest/dependency-graph/dependency-review#get-a-diff-of-the-dependencies-between-commits openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/dependency-graph/sbom documentation_url: https://docs.github.com/rest/dependency-graph/sboms#export-a-software-bill-of-materials-sbom-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/dependency-graph/snapshots documentation_url: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/deployments documentation_url: https://docs.github.com/rest/deployments/deployments#list-deployments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/deployments documentation_url: https://docs.github.com/rest/deployments/deployments#create-a-deployment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/deployments/{deployment_id} documentation_url: https://docs.github.com/rest/deployments/deployments#delete-a-deployment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/deployments/{deployment_id} documentation_url: https://docs.github.com/rest/deployments/deployments#get-a-deployment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses documentation_url: https://docs.github.com/rest/deployments/statuses#list-deployment-statuses openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses documentation_url: https://docs.github.com/rest/deployments/statuses#create-a-deployment-status openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id} documentation_url: https://docs.github.com/rest/deployments/statuses#get-a-deployment-status openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/dispatches documentation_url: https://docs.github.com/rest/repos/repos#create-a-repository-dispatch-event openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/environments documentation_url: https://docs.github.com/rest/deployments/environments#list-environments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/environments/{environment_name} documentation_url: https://docs.github.com/rest/deployments/environments#delete-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/environments/{environment_name} documentation_url: https://docs.github.com/rest/deployments/environments#get-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /repos/{owner}/{repo}/environments/{environment_name} documentation_url: https://docs.github.com/rest/deployments/environments#create-or-update-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies documentation_url: https://docs.github.com/rest/deployments/branch-policies#list-deployment-branch-policies openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies documentation_url: https://docs.github.com/rest/deployments/branch-policies#create-a-deployment-branch-policy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} documentation_url: https://docs.github.com/rest/deployments/branch-policies#delete-a-deployment-branch-policy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} documentation_url: https://docs.github.com/rest/deployments/branch-policies#get-a-deployment-branch-policy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} documentation_url: https://docs.github.com/rest/deployments/branch-policies#update-a-deployment-branch-policy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules documentation_url: https://docs.github.com/rest/deployments/protection-rules#get-all-deployment-protection-rules-for-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules documentation_url: https://docs.github.com/rest/deployments/protection-rules#create-a-custom-deployment-protection-rule-on-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps documentation_url: https://docs.github.com/rest/deployments/protection-rules#list-custom-deployment-rule-integrations-available-for-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id} documentation_url: https://docs.github.com/rest/deployments/protection-rules#disable-a-custom-protection-rule-for-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id} documentation_url: https://docs.github.com/rest/deployments/protection-rules#get-a-custom-deployment-protection-rule openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/secrets documentation_url: https://docs.github.com/rest/actions/secrets#list-environment-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key documentation_url: https://docs.github.com/rest/actions/secrets#get-an-environment-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#delete-an-environment-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#get-an-environment-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#create-or-update-an-environment-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/variables documentation_url: https://docs.github.com/rest/actions/variables#list-environment-variables openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/environments/{environment_name}/variables documentation_url: https://docs.github.com/rest/actions/variables#create-an-environment-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#delete-an-environment-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#get-an-environment-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#update-an-environment-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/events documentation_url: https://docs.github.com/rest/activity/events#list-repository-events openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/forks documentation_url: https://docs.github.com/rest/repos/forks#list-forks openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/forks documentation_url: https://docs.github.com/rest/repos/forks#create-a-fork openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/git/blobs documentation_url: https://docs.github.com/rest/git/blobs#create-a-blob openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/git/blobs/{file_sha} documentation_url: https://docs.github.com/rest/git/blobs#get-a-blob openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/git/commits documentation_url: https://docs.github.com/rest/git/commits#create-a-commit openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/git/commits/{commit_sha} documentation_url: https://docs.github.com/rest/git/commits#get-a-commit-object openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/git/matching-refs/{ref} documentation_url: https://docs.github.com/rest/git/refs#list-matching-references openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/git/ref/{ref} documentation_url: https://docs.github.com/rest/git/refs#get-a-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/git/refs documentation_url: https://docs.github.com/rest/git/refs#create-a-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/git/refs/{ref} documentation_url: https://docs.github.com/rest/git/refs#delete-a-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /repos/{owner}/{repo}/git/refs/{ref} documentation_url: https://docs.github.com/rest/git/refs#update-a-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/git/tags documentation_url: https://docs.github.com/rest/git/tags#create-a-tag-object openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/git/tags/{tag_sha} documentation_url: https://docs.github.com/rest/git/tags#get-a-tag openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/git/trees documentation_url: https://docs.github.com/rest/git/trees#create-a-tree openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/git/trees/{tree_sha} documentation_url: https://docs.github.com/rest/git/trees#get-a-tree openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/hooks documentation_url: https://docs.github.com/rest/repos/webhooks#list-repository-webhooks openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/hooks documentation_url: https://docs.github.com/rest/repos/webhooks#create-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/repos/webhooks#delete-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/repos/webhooks#get-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /repos/{owner}/{repo}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/repos/webhooks#update-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/hooks/{hook_id}/config documentation_url: https://docs.github.com/rest/repos/webhooks#get-a-webhook-configuration-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config documentation_url: https://docs.github.com/rest/repos/webhooks#update-a-webhook-configuration-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries documentation_url: https://docs.github.com/rest/repos/webhooks#list-deliveries-for-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id} documentation_url: https://docs.github.com/rest/repos/webhooks#get-a-delivery-for-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts documentation_url: https://docs.github.com/rest/repos/webhooks#redeliver-a-delivery-for-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/hooks/{hook_id}/pings documentation_url: https://docs.github.com/rest/repos/webhooks#ping-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/hooks/{hook_id}/tests documentation_url: https://docs.github.com/rest/repos/webhooks#test-the-push-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/import documentation_url: https://docs.github.com/rest/migrations/source-imports#cancel-an-import openapi_files: @@ -4262,7 +4421,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/interaction-limits documentation_url: https://docs.github.com/rest/interactions/repos#remove-interaction-restrictions-for-a-repository openapi_files: @@ -4283,383 +4442,383 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/invitations/{invitation_id} documentation_url: https://docs.github.com/rest/collaborators/invitations#delete-a-repository-invitation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /repos/{owner}/{repo}/invitations/{invitation_id} documentation_url: https://docs.github.com/rest/collaborators/invitations#update-a-repository-invitation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/issues documentation_url: https://docs.github.com/rest/issues/issues#list-repository-issues openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/issues documentation_url: https://docs.github.com/rest/issues/issues#create-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/issues/comments documentation_url: https://docs.github.com/rest/issues/comments#list-issue-comments-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/issues/comments/{comment_id} documentation_url: https://docs.github.com/rest/issues/comments#delete-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/issues/comments/{comment_id} documentation_url: https://docs.github.com/rest/issues/comments#get-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /repos/{owner}/{repo}/issues/comments/{comment_id} documentation_url: https://docs.github.com/rest/issues/comments#update-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-an-issue-comment-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/issues/events documentation_url: https://docs.github.com/rest/issues/events#list-issue-events-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/issues/events/{event_id} documentation_url: https://docs.github.com/rest/issues/events#get-an-issue-event openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/issues/{issue_number} documentation_url: https://docs.github.com/rest/issues/issues#get-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /repos/{owner}/{repo}/issues/{issue_number} documentation_url: https://docs.github.com/rest/issues/issues#update-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees documentation_url: https://docs.github.com/rest/issues/assignees#remove-assignees-from-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/issues/{issue_number}/assignees documentation_url: https://docs.github.com/rest/issues/assignees#add-assignees-to-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee} documentation_url: https://docs.github.com/rest/issues/assignees#check-if-a-user-can-be-assigned-to-a-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/comments documentation_url: https://docs.github.com/rest/issues/comments#list-issue-comments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/issues/{issue_number}/comments documentation_url: https://docs.github.com/rest/issues/comments#create-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/events documentation_url: https://docs.github.com/rest/issues/events#list-issue-events openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels documentation_url: https://docs.github.com/rest/issues/labels#remove-all-labels-from-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/labels documentation_url: https://docs.github.com/rest/issues/labels#list-labels-for-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/issues/{issue_number}/labels documentation_url: https://docs.github.com/rest/issues/labels#add-labels-to-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /repos/{owner}/{repo}/issues/{issue_number}/labels documentation_url: https://docs.github.com/rest/issues/labels#set-labels-for-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name} documentation_url: https://docs.github.com/rest/issues/labels#remove-a-label-from-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock documentation_url: https://docs.github.com/rest/issues/issues#unlock-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /repos/{owner}/{repo}/issues/{issue_number}/lock documentation_url: https://docs.github.com/rest/issues/issues#lock-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/issues/{issue_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-an-issue-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/timeline documentation_url: https://docs.github.com/rest/issues/timeline#list-timeline-events-for-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/keys documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#list-deploy-keys openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/keys documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#create-a-deploy-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/keys/{key_id} documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#delete-a-deploy-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/keys/{key_id} documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#get-a-deploy-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/labels documentation_url: https://docs.github.com/rest/issues/labels#list-labels-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/labels documentation_url: https://docs.github.com/rest/issues/labels#create-a-label openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/labels/{name} documentation_url: https://docs.github.com/rest/issues/labels#delete-a-label openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/labels/{name} documentation_url: https://docs.github.com/rest/issues/labels#get-a-label openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /repos/{owner}/{repo}/labels/{name} documentation_url: https://docs.github.com/rest/issues/labels#update-a-label openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/languages documentation_url: https://docs.github.com/rest/repos/repos#list-repository-languages openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/lfs documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/repos/lfs#disable-git-lfs-for-a-repository openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /repos/{owner}/{repo}/lfs documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/repos/lfs#enable-git-lfs-for-a-repository openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/license documentation_url: https://docs.github.com/rest/licenses/licenses#get-the-license-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/merge-upstream documentation_url: https://docs.github.com/rest/branches/branches#sync-a-fork-branch-with-the-upstream-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/merges documentation_url: https://docs.github.com/rest/branches/branches#merge-a-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/milestones documentation_url: https://docs.github.com/rest/issues/milestones#list-milestones openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/milestones documentation_url: https://docs.github.com/rest/issues/milestones#create-a-milestone openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/milestones/{milestone_number} documentation_url: https://docs.github.com/rest/issues/milestones#delete-a-milestone openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/milestones/{milestone_number} documentation_url: https://docs.github.com/rest/issues/milestones#get-a-milestone openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /repos/{owner}/{repo}/milestones/{milestone_number} documentation_url: https://docs.github.com/rest/issues/milestones#update-a-milestone openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels documentation_url: https://docs.github.com/rest/issues/labels#list-labels-for-issues-in-a-milestone openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/notifications documentation_url: https://docs.github.com/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /repos/{owner}/{repo}/notifications documentation_url: https://docs.github.com/rest/activity/notifications#mark-repository-notifications-as-read openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/pages documentation_url: https://docs.github.com/rest/pages/pages#delete-a-apiname-pages-site openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/pages documentation_url: https://docs.github.com/rest/pages/pages#get-a-apiname-pages-site openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/pages documentation_url: https://docs.github.com/rest/pages/pages#create-a-apiname-pages-site openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /repos/{owner}/{repo}/pages documentation_url: https://docs.github.com/rest/pages/pages#update-information-about-a-apiname-pages-site openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/pages/builds documentation_url: https://docs.github.com/rest/pages/pages#list-apiname-pages-builds openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/pages/builds documentation_url: https://docs.github.com/rest/pages/pages#request-a-apiname-pages-build openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/pages/builds/latest documentation_url: https://docs.github.com/rest/pages/pages#get-latest-pages-build openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/pages/builds/{build_id} documentation_url: https://docs.github.com/rest/pages/pages#get-apiname-pages-build openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/pages/deployment documentation_url: https://docs.github.com/enterprise-server@3.7/rest/pages/pages#create-a-github-pages-deployment openapi_files: @@ -4669,38 +4828,40 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id} documentation_url: https://docs.github.com/rest/pages/pages#get-the-status-of-a-github-pages-deployment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel documentation_url: https://docs.github.com/rest/pages/pages#cancel-a-github-pages-deployment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/pages/health documentation_url: https://docs.github.com/rest/pages/pages#get-a-dns-health-check-for-github-pages openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: GET /repos/{owner}/{repo}/pre-receive-hooks - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/private-vulnerability-reporting documentation_url: https://docs.github.com/rest/repos/repos#disable-private-vulnerability-reporting-for-a-repository openapi_files: @@ -4721,89 +4882,91 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/projects documentation_url: https://docs.github.com/rest/projects/projects#create-a-repository-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/properties/values documentation_url: https://docs.github.com/rest/repos/custom-properties#get-all-custom-property-values-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /repos/{owner}/{repo}/properties/values documentation_url: https://docs.github.com/rest/repos/custom-properties#create-or-update-custom-property-values-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/pulls documentation_url: https://docs.github.com/rest/pulls/pulls#list-pull-requests openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/pulls documentation_url: https://docs.github.com/rest/pulls/pulls#create-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/pulls/comments documentation_url: https://docs.github.com/rest/pulls/comments#list-review-comments-in-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id} documentation_url: https://docs.github.com/rest/pulls/comments#delete-a-review-comment-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/pulls/comments/{comment_id} documentation_url: https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id} documentation_url: https://docs.github.com/rest/pulls/comments#update-a-review-comment-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-pull-request-review-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-pull-request-review-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-a-pull-request-comment-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number} documentation_url: https://docs.github.com/rest/pulls/pulls#get-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /repos/{owner}/{repo}/pulls/{pull_number} documentation_url: https://docs.github.com/rest/pulls/pulls#update-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces documentation_url: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-from-a-pull-request openapi_files: @@ -4814,299 +4977,304 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/comments documentation_url: https://docs.github.com/rest/pulls/comments#create-a-review-comment-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies documentation_url: https://docs.github.com/rest/pulls/comments#create-a-reply-for-a-review-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/commits documentation_url: https://docs.github.com/rest/pulls/pulls#list-commits-on-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/files documentation_url: https://docs.github.com/rest/pulls/pulls#list-pull-requests-files openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/merge documentation_url: https://docs.github.com/rest/pulls/pulls#check-if-a-pull-request-has-been-merged openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge documentation_url: https://docs.github.com/rest/pulls/pulls#merge-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers documentation_url: https://docs.github.com/rest/pulls/review-requests#remove-requested-reviewers-from-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers documentation_url: https://docs.github.com/rest/pulls/review-requests#get-all-requested-reviewers-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers documentation_url: https://docs.github.com/rest/pulls/review-requests#request-reviewers-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews documentation_url: https://docs.github.com/rest/pulls/reviews#list-reviews-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews documentation_url: https://docs.github.com/rest/pulls/reviews#create-a-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} documentation_url: https://docs.github.com/rest/pulls/reviews#delete-a-pending-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} documentation_url: https://docs.github.com/rest/pulls/reviews#get-a-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} documentation_url: https://docs.github.com/rest/pulls/reviews#update-a-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments documentation_url: https://docs.github.com/rest/pulls/reviews#list-comments-for-a-pull-request-review openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals documentation_url: https://docs.github.com/rest/pulls/reviews#dismiss-a-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events documentation_url: https://docs.github.com/rest/pulls/reviews#submit-a-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch documentation_url: https://docs.github.com/rest/pulls/pulls#update-a-pull-request-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/readme documentation_url: https://docs.github.com/rest/repos/contents#get-a-repository-readme openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/readme/{dir} documentation_url: https://docs.github.com/rest/repos/contents#get-a-repository-readme-for-a-directory openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/releases documentation_url: https://docs.github.com/rest/releases/releases#list-releases openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/releases documentation_url: https://docs.github.com/rest/releases/releases#create-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/releases/assets/{asset_id} documentation_url: https://docs.github.com/rest/releases/assets#delete-a-release-asset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/releases/assets/{asset_id} documentation_url: https://docs.github.com/rest/releases/assets#get-a-release-asset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /repos/{owner}/{repo}/releases/assets/{asset_id} documentation_url: https://docs.github.com/rest/releases/assets#update-a-release-asset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/releases/generate-notes documentation_url: https://docs.github.com/rest/releases/releases#generate-release-notes-content-for-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/releases/latest documentation_url: https://docs.github.com/rest/releases/releases#get-the-latest-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/releases/tags/{tag} documentation_url: https://docs.github.com/rest/releases/releases#get-a-release-by-tag-name openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/releases/{release_id} documentation_url: https://docs.github.com/rest/releases/releases#delete-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/releases/{release_id} documentation_url: https://docs.github.com/rest/releases/releases#get-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /repos/{owner}/{repo}/releases/{release_id} documentation_url: https://docs.github.com/rest/releases/releases#update-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/releases/{release_id}/assets documentation_url: https://docs.github.com/rest/releases/assets#list-release-assets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/releases/{release_id}/assets documentation_url: https://docs.github.com/rest/releases/assets#upload-a-release-asset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/releases/{release_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/releases/{release_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-a-release-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/replicas/caches - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/repos/repos#list-repository-cache-replication-status + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/repos/repos#list-repository-cache-replication-status openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/rules/branches/{branch} documentation_url: https://docs.github.com/rest/repos/rules#get-rules-for-a-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/rulesets documentation_url: https://docs.github.com/rest/repos/rules#get-all-repository-rulesets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/rulesets documentation_url: https://docs.github.com/rest/repos/rules#create-a-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/rulesets/rule-suites documentation_url: https://docs.github.com/rest/repos/rule-suites#list-repository-rule-suites openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id} documentation_url: https://docs.github.com/rest/repos/rule-suites#get-a-repository-rule-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/repos/rules#get-a-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /repos/{owner}/{repo}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/repos/rules#update-a-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/secret-scanning/alerts documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#get-a-secret-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#update-a-secret-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-locations-for-a-secret-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json + - name: POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses + documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#create-a-push-protection-bypass + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /repos/{owner}/{repo}/security-advisories documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories openapi_files: @@ -5147,115 +5315,115 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/stats/code_frequency documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-activity openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/stats/commit_activity documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-last-year-of-commit-activity openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/stats/contributors documentation_url: https://docs.github.com/rest/metrics/statistics#get-all-contributor-commit-activity openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/stats/participation documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-count openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/stats/punch_card documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-hourly-commit-count-for-each-day openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/statuses/{sha} documentation_url: https://docs.github.com/rest/commits/statuses#create-a-commit-status openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/subscribers documentation_url: https://docs.github.com/rest/activity/watching#list-watchers openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/subscription documentation_url: https://docs.github.com/rest/activity/watching#delete-a-repository-subscription openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/subscription documentation_url: https://docs.github.com/rest/activity/watching#get-a-repository-subscription openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /repos/{owner}/{repo}/subscription documentation_url: https://docs.github.com/rest/activity/watching#set-a-repository-subscription openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/tags documentation_url: https://docs.github.com/rest/repos/repos#list-repository-tags openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/tags/protection - documentation_url: https://docs.github.com/rest/repos/tags#list-tag-protection-states-for-a-repository + documentation_url: https://docs.github.com/rest/repos/tags#deprecated---list-tag-protection-states-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{owner}/{repo}/tags/protection - documentation_url: https://docs.github.com/rest/repos/tags#create-a-tag-protection-state-for-a-repository + documentation_url: https://docs.github.com/rest/repos/tags#deprecated---create-a-tag-protection-state-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id} - documentation_url: https://docs.github.com/rest/repos/tags#delete-a-tag-protection-state-for-a-repository + documentation_url: https://docs.github.com/rest/repos/tags#deprecated---delete-a-tag-protection-state-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/tarball/{ref} documentation_url: https://docs.github.com/rest/repos/contents#download-a-repository-archive-tar openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/teams documentation_url: https://docs.github.com/rest/repos/repos#list-repository-teams openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/topics documentation_url: https://docs.github.com/rest/repos/repos#get-all-repository-topics openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /repos/{owner}/{repo}/topics documentation_url: https://docs.github.com/rest/repos/repos#replace-all-repository-topics openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/traffic/clones documentation_url: https://docs.github.com/rest/metrics/traffic#get-repository-clones openapi_files: @@ -5281,43 +5449,43 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /repos/{owner}/{repo}/vulnerability-alerts documentation_url: https://docs.github.com/rest/repos/repos#disable-vulnerability-alerts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/vulnerability-alerts documentation_url: https://docs.github.com/rest/repos/repos#check-if-vulnerability-alerts-are-enabled-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /repos/{owner}/{repo}/vulnerability-alerts documentation_url: https://docs.github.com/rest/repos/repos#enable-vulnerability-alerts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repos/{owner}/{repo}/zipball/{ref} documentation_url: https://docs.github.com/rest/repos/contents#download-a-repository-archive-zip openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /repos/{template_owner}/{template_repo}/generate documentation_url: https://docs.github.com/rest/repos/repos#create-a-repository-using-a-template openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repositories documentation_url: https://docs.github.com/rest/repos/repos#list-public-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /repositories/{repository_id}/environments/{environment_name}/secrets documentation_url: https://docs.github.com/enterprise-server@3.7/rest/actions/secrets#list-environment-secrets openapi_files: @@ -5390,62 +5558,62 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#list-provisioned-scim-groups-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /scim/v2/enterprises/{enterprise}/Groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#provision-a-scim-enterprise-group openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#delete-a-scim-group-from-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-group openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#update-an-attribute-for-a-scim-enterprise-group openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#set-scim-information-for-a-provisioned-enterprise-group openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /scim/v2/enterprises/{enterprise}/Users documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#list-scim-provisioned-identities-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /scim/v2/enterprises/{enterprise}/Users documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#provision-a-scim-enterprise-user openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /scim/v2/enterprises/{enterprise}/Users/{scim_user_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#delete-a-scim-user-from-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /scim/v2/enterprises/{enterprise}/Users/{scim_user_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-user openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /scim/v2/enterprises/{enterprise}/Users/{scim_user_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#update-an-attribute-for-a-scim-enterprise-user openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /scim/v2/enterprises/{enterprise}/Users/{scim_user_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#set-scim-information-for-a-provisioned-enterprise-user openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /scim/v2/organizations/{org}/Users documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#list-scim-provisioned-identities openapi_files: @@ -5475,189 +5643,189 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /search/commits documentation_url: https://docs.github.com/rest/search/search#search-commits openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /search/issues documentation_url: https://docs.github.com/rest/search/search#search-issues-and-pull-requests openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /search/labels documentation_url: https://docs.github.com/rest/search/search#search-labels openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /search/repositories documentation_url: https://docs.github.com/rest/search/search#search-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /search/topics documentation_url: https://docs.github.com/rest/search/search#search-topics openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /search/users documentation_url: https://docs.github.com/rest/search/search#search-users openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /setup/api/configcheck - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/management-console#get-the-configuration-status + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#get-the-configuration-status openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /setup/api/configure - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/management-console#start-a-configuration-process + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#start-a-configuration-process openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /setup/api/maintenance - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/management-console#get-the-maintenance-status + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#get-the-maintenance-status openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /setup/api/maintenance - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/management-console#enable-or-disable-maintenance-mode + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#enable-or-disable-maintenance-mode openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /setup/api/settings - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/management-console#get-settings + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#get-settings openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /setup/api/settings - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/management-console#set-settings + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#set-settings openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /setup/api/settings/authorized-keys - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/management-console#remove-an-authorized-ssh-key + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#remove-an-authorized-ssh-key openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /setup/api/settings/authorized-keys - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/management-console#get-all-authorized-ssh-keys + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#get-all-authorized-ssh-keys openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /setup/api/settings/authorized-keys - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/management-console#add-an-authorized-ssh-key + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#add-an-authorized-ssh-key openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /setup/api/start - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/management-console#create-a-github-license + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#create-a-github-license openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /setup/api/upgrade - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/management-console#upgrade-a-license + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#upgrade-a-license openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /teams/{team_id} documentation_url: https://docs.github.com/rest/teams/teams#delete-a-team-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /teams/{team_id} documentation_url: https://docs.github.com/rest/teams/teams#get-a-team-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /teams/{team_id} documentation_url: https://docs.github.com/rest/teams/teams#update-a-team-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /teams/{team_id}/discussions documentation_url: https://docs.github.com/rest/teams/discussions#list-discussions-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /teams/{team_id}/discussions documentation_url: https://docs.github.com/rest/teams/discussions#create-a-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /teams/{team_id}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#delete-a-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /teams/{team_id}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#get-a-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /teams/{team_id}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#update-a-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /teams/{team_id}/discussions/{discussion_number}/comments documentation_url: https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /teams/{team_id}/discussions/{discussion_number}/comments documentation_url: https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /teams/{team_id}/discussions/{discussion_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /teams/{team_id}/discussions/{discussion_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /teams/{team_id}/invitations documentation_url: https://docs.github.com/rest/teams/members#list-pending-team-invitations-legacy openapi_files: @@ -5668,91 +5836,91 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /teams/{team_id}/members/{username} documentation_url: https://docs.github.com/rest/teams/members#remove-team-member-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /teams/{team_id}/members/{username} documentation_url: https://docs.github.com/rest/teams/members#get-team-member-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /teams/{team_id}/members/{username} documentation_url: https://docs.github.com/rest/teams/members#add-team-member-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /teams/{team_id}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /teams/{team_id}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#get-team-membership-for-a-user-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /teams/{team_id}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /teams/{team_id}/projects documentation_url: https://docs.github.com/rest/teams/teams#list-team-projects-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /teams/{team_id}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /teams/{team_id}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /teams/{team_id}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /teams/{team_id}/repos documentation_url: https://docs.github.com/rest/teams/teams#list-team-repositories-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /teams/{team_id}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /teams/{team_id}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /teams/{team_id}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /teams/{team_id}/team-sync/group-mappings documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#list-idp-groups-for-a-team-legacy openapi_files: @@ -5766,19 +5934,19 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /user documentation_url: https://docs.github.com/rest/users/users#get-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /user documentation_url: https://docs.github.com/rest/users/users#update-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /user/blocks documentation_url: https://docs.github.com/rest/users/blocking#list-users-blocked-by-the-authenticated-user openapi_files: @@ -5904,7 +6072,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /user/email/visibility documentation_url: https://docs.github.com/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user openapi_files: @@ -5915,97 +6083,97 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /user/emails documentation_url: https://docs.github.com/rest/users/emails#list-email-addresses-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /user/emails documentation_url: https://docs.github.com/rest/users/emails#add-an-email-address-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /user/followers documentation_url: https://docs.github.com/rest/users/followers#list-followers-of-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /user/following documentation_url: https://docs.github.com/rest/users/followers#list-the-people-the-authenticated-user-follows openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /user/following/{username} documentation_url: https://docs.github.com/rest/users/followers#unfollow-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /user/following/{username} documentation_url: https://docs.github.com/rest/users/followers#check-if-a-person-is-followed-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /user/following/{username} documentation_url: https://docs.github.com/rest/users/followers#follow-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /user/gpg_keys documentation_url: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /user/gpg_keys documentation_url: https://docs.github.com/rest/users/gpg-keys#create-a-gpg-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /user/gpg_keys/{gpg_key_id} documentation_url: https://docs.github.com/rest/users/gpg-keys#delete-a-gpg-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /user/gpg_keys/{gpg_key_id} documentation_url: https://docs.github.com/rest/users/gpg-keys#get-a-gpg-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /user/installations documentation_url: https://docs.github.com/rest/apps/installations#list-app-installations-accessible-to-the-user-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /user/installations/{installation_id}/repositories documentation_url: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-user-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /user/installations/{installation_id}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/apps/installations#remove-a-repository-from-an-app-installation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /user/installations/{installation_id}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/apps/installations#add-a-repository-to-an-app-installation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /user/interaction-limits documentation_url: https://docs.github.com/rest/interactions/user#remove-interaction-restrictions-from-your-public-repositories openapi_files: @@ -6026,31 +6194,31 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /user/keys documentation_url: https://docs.github.com/rest/users/keys#list-public-ssh-keys-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /user/keys documentation_url: https://docs.github.com/rest/users/keys#create-a-public-ssh-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /user/keys/{key_id} documentation_url: https://docs.github.com/rest/users/keys#delete-a-public-ssh-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /user/keys/{key_id} documentation_url: https://docs.github.com/rest/users/keys#get-a-public-ssh-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /user/marketplace_purchases documentation_url: https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user openapi_files: @@ -6066,31 +6234,31 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /user/memberships/orgs/{org} documentation_url: https://docs.github.com/rest/orgs/members#get-an-organization-membership-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /user/memberships/orgs/{org} documentation_url: https://docs.github.com/rest/orgs/members#update-an-organization-membership-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /user/migrations documentation_url: https://docs.github.com/rest/migrations/users#list-user-migrations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /user/migrations documentation_url: https://docs.github.com/rest/migrations/users#start-a-user-migration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /user/migrations/{migration_id} documentation_url: https://docs.github.com/rest/migrations/users#get-a-user-migration-status openapi_files: @@ -6106,7 +6274,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock documentation_url: https://docs.github.com/rest/migrations/users#unlock-a-user-repository openapi_files: @@ -6117,343 +6285,354 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /user/orgs documentation_url: https://docs.github.com/rest/orgs/orgs#list-organizations-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /user/packages documentation_url: https://docs.github.com/rest/packages/packages#list-packages-for-the-authenticated-users-namespace openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /user/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /user/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /user/packages/{package_type}/{package_name}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /user/packages/{package_type}/{package_name}/versions documentation_url: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-version-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /user/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-version-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-version-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /user/projects documentation_url: https://docs.github.com/rest/projects/projects#create-a-user-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /user/public_emails documentation_url: https://docs.github.com/rest/users/emails#list-public-email-addresses-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /user/repos documentation_url: https://docs.github.com/rest/repos/repos#list-repositories-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /user/repos documentation_url: https://docs.github.com/rest/repos/repos#create-a-repository-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /user/repository_invitations documentation_url: https://docs.github.com/rest/collaborators/invitations#list-repository-invitations-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /user/repository_invitations/{invitation_id} documentation_url: https://docs.github.com/rest/collaborators/invitations#decline-a-repository-invitation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PATCH /user/repository_invitations/{invitation_id} documentation_url: https://docs.github.com/rest/collaborators/invitations#accept-a-repository-invitation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /user/social_accounts documentation_url: https://docs.github.com/rest/users/social-accounts#delete-social-accounts-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /user/social_accounts documentation_url: https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /user/social_accounts documentation_url: https://docs.github.com/rest/users/social-accounts#add-social-accounts-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /user/ssh_signing_keys documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /user/ssh_signing_keys documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#create-a-ssh-signing-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /user/ssh_signing_keys/{ssh_signing_key_id} documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#delete-an-ssh-signing-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /user/ssh_signing_keys/{ssh_signing_key_id} documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#get-an-ssh-signing-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /user/starred documentation_url: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /user/starred/{owner}/{repo} documentation_url: https://docs.github.com/rest/activity/starring#unstar-a-repository-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /user/starred/{owner}/{repo} documentation_url: https://docs.github.com/rest/activity/starring#check-if-a-repository-is-starred-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /user/starred/{owner}/{repo} documentation_url: https://docs.github.com/rest/activity/starring#star-a-repository-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /user/subscriptions documentation_url: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /user/teams documentation_url: https://docs.github.com/rest/teams/teams#list-teams-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json + - name: GET /user/{account_id} + documentation_url: https://docs.github.com/rest/users/users#get-a-user-using-their-id + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /users documentation_url: https://docs.github.com/rest/users/users#list-users openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /users/{username} documentation_url: https://docs.github.com/rest/users/users#get-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json + - name: GET /users/{username}/attestations/{subject_digest} + documentation_url: https://docs.github.com/rest/users/attestations#list-attestations + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /users/{username}/docker/conflicts documentation_url: https://docs.github.com/rest/packages/packages#get-list-of-conflicting-packages-during-docker-migration-for-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /users/{username}/events documentation_url: https://docs.github.com/rest/activity/events#list-events-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /users/{username}/events/orgs/{org} documentation_url: https://docs.github.com/rest/activity/events#list-organization-events-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /users/{username}/events/public documentation_url: https://docs.github.com/rest/activity/events#list-public-events-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /users/{username}/followers documentation_url: https://docs.github.com/rest/users/followers#list-followers-of-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /users/{username}/following documentation_url: https://docs.github.com/rest/users/followers#list-the-people-a-user-follows openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /users/{username}/following/{target_user} documentation_url: https://docs.github.com/rest/users/followers#check-if-a-user-follows-another-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /users/{username}/gists documentation_url: https://docs.github.com/rest/gists/gists#list-gists-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /users/{username}/gpg_keys documentation_url: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /users/{username}/hovercard documentation_url: https://docs.github.com/rest/users/users#get-contextual-information-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /users/{username}/installation documentation_url: https://docs.github.com/rest/apps/apps#get-a-user-installation-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /users/{username}/keys documentation_url: https://docs.github.com/rest/users/keys#list-public-keys-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /users/{username}/orgs documentation_url: https://docs.github.com/rest/orgs/orgs#list-organizations-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /users/{username}/packages documentation_url: https://docs.github.com/rest/packages/packages#list-packages-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /users/{username}/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /users/{username}/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /users/{username}/packages/{package_type}/{package_name}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /users/{username}/packages/{package_type}/{package_name}/versions documentation_url: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#delete-package-version-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-version-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-package-version-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /users/{username}/projects documentation_url: https://docs.github.com/rest/projects/projects#list-user-projects openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /users/{username}/received_events documentation_url: https://docs.github.com/rest/activity/events#list-events-received-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /users/{username}/received_events/public documentation_url: https://docs.github.com/rest/activity/events#list-public-events-received-by-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /users/{username}/repos documentation_url: https://docs.github.com/rest/repos/repos#list-repositories-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /users/{username}/settings/billing/actions documentation_url: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-a-user openapi_files: @@ -6470,45 +6649,45 @@ openapi_operations: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: DELETE /users/{username}/site_admin - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#demote-a-site-administrator + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#demote-a-site-administrator openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /users/{username}/site_admin - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /users/{username}/social_accounts documentation_url: https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /users/{username}/ssh_signing_keys documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /users/{username}/starred documentation_url: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /users/{username}/subscriptions documentation_url: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /users/{username}/suspended - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#unsuspend-a-user + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#unsuspend-a-user openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /users/{username}/suspended - documentation_url: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#suspend-a-user + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#suspend-a-user openapi_files: - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /versions documentation_url: https://docs.github.com/rest/meta/meta#get-all-api-versions openapi_files: @@ -6519,4 +6698,4 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.12/ghes-3.12.json + - descriptions/ghes-3.14/ghes-3.14.json From 4cfd6bdc1036265a4a1a54adc87172bfa97e4960 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Fri, 11 Oct 2024 15:59:20 +0300 Subject: [PATCH 540/751] refactor: Enable perfsprint; fix appeared lint issues (#3324) --- .golangci.yml | 8 ++++++++ example/codespaces/newreposecretwithxcrypto/main.go | 3 ++- example/codespaces/newusersecretwithxcrypto/main.go | 3 ++- example/newreposecretwithxcrypto/main.go | 3 ++- github/copilot.go | 3 ++- github/git_commits.go | 2 +- github/git_commits_test.go | 3 ++- github/orgs_properties.go | 3 ++- github/pulls.go | 3 ++- tools/metadata/main.go | 9 +++++---- 10 files changed, 28 insertions(+), 12 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 2bfeaaa24dc..d97416041cd 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -11,6 +11,7 @@ linters: - gosec - misspell - nakedret + - perfsprint - paralleltest - stylecheck - tparallel @@ -24,6 +25,9 @@ linters-settings: - G104 # int(os.Stdin.Fd()) - G115 + perfsprint: + errorf: true + strconcat: false issues: exclude-use-default: false exclude-rules: @@ -56,3 +60,7 @@ issues: # We don't run parallel integration tests - linters: [ paralleltest, tparallel ] path: '^test/integration' + + # Because fmt.Sprint(reset.Unix())) is more readable than strconv.FormatInt(reset.Unix(), 10). + - linters: [ perfsprint] + text: 'fmt.Sprint.* can be replaced with faster strconv.FormatInt' diff --git a/example/codespaces/newreposecretwithxcrypto/main.go b/example/codespaces/newreposecretwithxcrypto/main.go index bd6033ec5af..df7cd97fb36 100644 --- a/example/codespaces/newreposecretwithxcrypto/main.go +++ b/example/codespaces/newreposecretwithxcrypto/main.go @@ -31,6 +31,7 @@ import ( "context" crypto_rand "crypto/rand" "encoding/base64" + "errors" "flag" "fmt" "log" @@ -84,7 +85,7 @@ func main() { func getSecretName() (string, error) { secretName := flag.Arg(0) if secretName == "" { - return "", fmt.Errorf("missing argument secret name") + return "", errors.New("missing argument secret name") } return secretName, nil } diff --git a/example/codespaces/newusersecretwithxcrypto/main.go b/example/codespaces/newusersecretwithxcrypto/main.go index e1fec87de33..e306ae3de79 100644 --- a/example/codespaces/newusersecretwithxcrypto/main.go +++ b/example/codespaces/newusersecretwithxcrypto/main.go @@ -32,6 +32,7 @@ import ( "context" crypto_rand "crypto/rand" "encoding/base64" + "errors" "flag" "fmt" "log" @@ -77,7 +78,7 @@ func main() { func getSecretName() (string, error) { secretName := flag.Arg(0) if secretName == "" { - return "", fmt.Errorf("missing argument secret name") + return "", errors.New("missing argument secret name") } return secretName, nil } diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index 6737263aa08..9c1a42b04eb 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -31,6 +31,7 @@ import ( "context" crypto_rand "crypto/rand" "encoding/base64" + "errors" "flag" "fmt" "log" @@ -84,7 +85,7 @@ func main() { func getSecretName() (string, error) { secretName := flag.Arg(0) if secretName == "" { - return "", fmt.Errorf("missing argument secret name") + return "", errors.New("missing argument secret name") } return secretName, nil } diff --git a/github/copilot.go b/github/copilot.go index 2697b71850c..349b16ebde6 100644 --- a/github/copilot.go +++ b/github/copilot.go @@ -8,6 +8,7 @@ package github import ( "context" "encoding/json" + "errors" "fmt" ) @@ -87,7 +88,7 @@ func (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error { } if v["type"] == nil { - return fmt.Errorf("assignee type field is not set") + return errors.New("assignee type field is not set") } if t, ok := v["type"].(string); ok && t == "User" { diff --git a/github/git_commits.go b/github/git_commits.go index 573d38be528..fdb3d26ceab 100644 --- a/github/git_commits.go +++ b/github/git_commits.go @@ -129,7 +129,7 @@ type CreateCommitOptions struct { //meta:operation POST /repos/{owner}/{repo}/git/commits func (s *GitService) CreateCommit(ctx context.Context, owner string, repo string, commit *Commit, opts *CreateCommitOptions) (*Commit, *Response, error) { if commit == nil { - return nil, nil, fmt.Errorf("commit must be provided") + return nil, nil, errors.New("commit must be provided") } if opts == nil { opts = &CreateCommitOptions{} diff --git a/github/git_commits_test.go b/github/git_commits_test.go index d99787fab1c..9ea876050e6 100644 --- a/github/git_commits_test.go +++ b/github/git_commits_test.go @@ -8,6 +8,7 @@ package github import ( "context" "encoding/json" + "errors" "fmt" "io" "net/http" @@ -402,7 +403,7 @@ func TestGitService_createSignature_signerError(t *testing.T) { Author: &CommitAuthor{Name: String("go-github")}, } - signer := mockSigner(t, "", fmt.Errorf("signer error"), "") + signer := mockSigner(t, "", errors.New("signer error"), "") _, err := createSignature(signer, a) if err == nil { diff --git a/github/orgs_properties.go b/github/orgs_properties.go index 3387d98d76f..d8db48fc94e 100644 --- a/github/orgs_properties.go +++ b/github/orgs_properties.go @@ -8,6 +8,7 @@ package github import ( "context" "encoding/json" + "errors" "fmt" ) @@ -69,7 +70,7 @@ func (cpv *CustomPropertyValue) UnmarshalJSON(data []byte) error { if str, ok := item.(string); ok { strSlice[i] = str } else { - return fmt.Errorf("non-string value in string array") + return errors.New("non-string value in string array") } } cpv.Value = strSlice diff --git a/github/pulls.go b/github/pulls.go index b668502691e..35ceda44679 100644 --- a/github/pulls.go +++ b/github/pulls.go @@ -8,6 +8,7 @@ package github import ( "bytes" "context" + "errors" "fmt" ) @@ -352,7 +353,7 @@ type pullRequestUpdate struct { //meta:operation PATCH /repos/{owner}/{repo}/pulls/{pull_number} func (s *PullRequestsService) Edit(ctx context.Context, owner string, repo string, number int, pull *PullRequest) (*PullRequest, *Response, error) { if pull == nil { - return nil, nil, fmt.Errorf("pull must be provided") + return nil, nil, errors.New("pull must be provided") } u := fmt.Sprintf("repos/%v/%v/pulls/%d", owner, repo, number) diff --git a/tools/metadata/main.go b/tools/metadata/main.go index 238fc468856..7be3cbed656 100644 --- a/tools/metadata/main.go +++ b/tools/metadata/main.go @@ -10,6 +10,7 @@ package main import ( "context" "encoding/json" + "errors" "fmt" "os" "path/filepath" @@ -70,7 +71,7 @@ func (c *rootCmd) opsFile() (string, *operationsFile, error) { func githubClient(apiURL string) (*github.Client, error) { token := os.Getenv("GITHUB_TOKEN") if token == "" { - return nil, fmt.Errorf("GITHUB_TOKEN environment variable must be set to a GitHub personal access token with the public_repo scope") + return nil, errors.New("GITHUB_TOKEN environment variable must be set to a GitHub personal access token with the public_repo scope") } return github.NewClient(nil).WithAuthToken(token).WithEnterpriseURLs(apiURL, "") } @@ -83,7 +84,7 @@ type updateOpenAPICmd struct { func (c *updateOpenAPICmd) Run(root *rootCmd) error { ctx := context.Background() if c.ValidateGithub && c.Ref != "main" { - return fmt.Errorf("--validate and --ref are mutually exclusive") + return errors.New("--validate and --ref are mutually exclusive") } filename, opsFile, err := root.opsFile() if err != nil { @@ -102,7 +103,7 @@ func (c *updateOpenAPICmd) Run(root *rootCmd) error { if c.ValidateGithub { ref = opsFile.GitCommit if ref == "" { - return fmt.Errorf("openapi_operations.yaml does not have an openapi_commit field") + return errors.New("openapi_operations.yaml does not have an openapi_commit field") } } err = opsFile.updateFromGithub(ctx, client, ref) @@ -113,7 +114,7 @@ func (c *updateOpenAPICmd) Run(root *rootCmd) error { return opsFile.saveFile(filename) } if !operationsEqual(origOps, opsFile.OpenapiOps) { - return fmt.Errorf("openapi_operations.yaml does not match the OpenAPI descriptions in github.com/github/rest-api-description") + return errors.New("openapi_operations.yaml does not match the OpenAPI descriptions in github.com/github/rest-api-description") } return nil } From 0259e6232fe50bec681e310228fc4129d3f48f2e Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Fri, 11 Oct 2024 18:32:45 +0300 Subject: [PATCH 541/751] refactor: Replace 'println' with 'fmt.Println' (#3326) --- example/tokenauth/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index 71d4c20c31a..0c8f39f848c 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -22,7 +22,7 @@ import ( func main() { fmt.Print("GitHub Token: ") token, _ := term.ReadPassword(int(os.Stdin.Fd())) - println() + fmt.Println() ctx := context.Background() client := github.NewClient(nil).WithAuthToken(string(token)) From 1ffcddbd4e7f97684262ca90a84919b548d67e3d Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Fri, 11 Oct 2024 19:08:23 +0300 Subject: [PATCH 542/751] docs: Add dots at the end of sentences (#3325) --- .golangci.yml | 1 + example/topics/main.go | 2 +- github/authorizations.go | 2 +- github/checks.go | 4 ++-- github/codesofconduct.go | 4 ++-- github/copilot_test.go | 2 +- github/emojis.go | 2 +- github/github.go | 2 +- github/github_test.go | 6 +++--- github/issues_labels.go | 2 +- github/messages.go | 4 ++-- github/orgs_members_test.go | 12 ++++++------ github/repos.go | 4 ++-- github/repos_contents.go | 2 +- github/repos_deployments.go | 6 +++--- github/search.go | 2 +- github/timestamp.go | 2 +- github/users_emails.go | 2 +- scrape/apps.go | 6 +++--- test/integration/audit_log_test.go | 6 +++--- tools/metadata/metadata.go | 2 +- 21 files changed, 38 insertions(+), 37 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index d97416041cd..43103588334 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -6,6 +6,7 @@ linters: enable: - dogsled - dupl + - godot - gofmt - goimports - gosec diff --git a/example/topics/main.go b/example/topics/main.go index ec3c3686f8d..b95282ed856 100644 --- a/example/topics/main.go +++ b/example/topics/main.go @@ -15,7 +15,7 @@ import ( "github.com/google/go-github/v66/github" ) -// Fetch and lists all the public topics associated with the specified GitHub topic +// Fetch and lists all the public topics associated with the specified GitHub topic. func fetchTopics(topic string) (*github.TopicsSearchResult, error) { client := github.NewClient(nil) topics, _, err := client.Search.Topics(context.Background(), topic, nil) diff --git a/github/authorizations.go b/github/authorizations.go index a9b0e8d2c04..5e63a3efb95 100644 --- a/github/authorizations.go +++ b/github/authorizations.go @@ -15,7 +15,7 @@ import ( // GitHub API docs: https://docs.github.com/rest/oauth/#scopes type Scope string -// This is the set of scopes for GitHub API V3 +// This is the set of scopes for GitHub API V3. const ( ScopeNone Scope = "(no scope)" // REVISIT: is this actually returned, or just a documentation artifact? ScopeUser Scope = "user" diff --git a/github/checks.go b/github/checks.go index 71e50c15f29..711be207c2b 100644 --- a/github/checks.go +++ b/github/checks.go @@ -401,7 +401,7 @@ type CheckSuitePreferenceResults struct { Repository *Repository `json:"repository,omitempty"` } -// PreferenceList represents a list of auto trigger checks for repository +// PreferenceList represents a list of auto trigger checks for repository. type PreferenceList struct { AutoTriggerChecks []*AutoTriggerCheck `json:"auto_trigger_checks,omitempty"` // A slice of auto trigger checks that can be set for a check suite in a repository. } @@ -429,7 +429,7 @@ func (s *ChecksService) SetCheckSuitePreferences(ctx context.Context, owner, rep return checkSuitePrefResults, resp, nil } -// CreateCheckSuiteOptions sets up parameters to manually create a check suites +// CreateCheckSuiteOptions sets up parameters to manually create a check suites. type CreateCheckSuiteOptions struct { HeadSHA string `json:"head_sha"` // The sha of the head commit. (Required.) HeadBranch *string `json:"head_branch,omitempty"` // The name of the head branch where the code changes are implemented. diff --git a/github/codesofconduct.go b/github/codesofconduct.go index 7d7f9ef8188..aba05741713 100644 --- a/github/codesofconduct.go +++ b/github/codesofconduct.go @@ -50,7 +50,7 @@ func (s *CodesOfConductService) List(ctx context.Context) ([]*CodeOfConduct, *Re // ListCodesOfConduct returns all codes of conduct. // -// Deprecated: Use CodesOfConductService.List instead +// Deprecated: Use CodesOfConductService.List instead. func (c *Client) ListCodesOfConduct(ctx context.Context) ([]*CodeOfConduct, *Response, error) { return c.CodesOfConduct.List(ctx) } @@ -81,7 +81,7 @@ func (s *CodesOfConductService) Get(ctx context.Context, key string) (*CodeOfCon // GetCodeOfConduct returns an individual code of conduct. // -// Deprecated: Use CodesOfConductService.Get instead +// Deprecated: Use CodesOfConductService.Get instead. func (c *Client) GetCodeOfConduct(ctx context.Context, key string) (*CodeOfConduct, *Response, error) { return c.CodesOfConduct.Get(ctx, key) } diff --git a/github/copilot_test.go b/github/copilot_test.go index 7b82390af86..f27350be79d 100644 --- a/github/copilot_test.go +++ b/github/copilot_test.go @@ -16,7 +16,7 @@ import ( "github.com/google/go-cmp/cmp" ) -// Test invalid JSON responses, valid responses are covered in the other tests +// Test invalid JSON responses, valid responses are covered in the other tests. func TestCopilotSeatDetails_UnmarshalJSON(t *testing.T) { t.Parallel() tests := []struct { diff --git a/github/emojis.go b/github/emojis.go index 93ef232f6c7..b7a03dd98c6 100644 --- a/github/emojis.go +++ b/github/emojis.go @@ -34,7 +34,7 @@ func (s *EmojisService) List(ctx context.Context) (map[string]string, *Response, // ListEmojis returns the emojis available to use on GitHub. // -// Deprecated: Use EmojisService.List instead +// Deprecated: Use EmojisService.List instead. func (c *Client) ListEmojis(ctx context.Context) (map[string]string, *Response, error) { return c.Emojis.List(ctx) } diff --git a/github/github.go b/github/github.go index 22fbb9747e1..042a0b52e7a 100644 --- a/github/github.go +++ b/github/github.go @@ -1595,7 +1595,7 @@ func Int64(v int64) *int64 { return &v } // to store v and returns a pointer to it. func String(v string) *string { return &v } -// roundTripperFunc creates a RoundTripper (transport) +// roundTripperFunc creates a RoundTripper (transport). type roundTripperFunc func(*http.Request) (*http.Response, error) func (fn roundTripperFunc) RoundTrip(r *http.Request) (*http.Response, error) { diff --git a/github/github_test.go b/github/github_test.go index a3eb29720c8..d4a06f9f2f5 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -212,7 +212,7 @@ func testNewRequestAndDoFailure(t *testing.T, methodName string, client *Client, testNewRequestAndDoFailureCategory(t, methodName, client, CoreCategory, f) } -// testNewRequestAndDoFailureCategory works Like testNewRequestAndDoFailure, but allows setting the category +// testNewRequestAndDoFailureCategory works Like testNewRequestAndDoFailure, but allows setting the category. func testNewRequestAndDoFailureCategory(t *testing.T, methodName string, client *Client, category RateLimitCategory, f func() (*Response, error)) { t.Helper() if methodName == "" { @@ -1235,7 +1235,7 @@ func TestDo_rateLimitCategory(t *testing.T) { } } -// ensure rate limit is still parsed, even for error responses +// Ensure rate limit is still parsed, even for error responses. func TestDo_rateLimit_errorResponse(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -2265,7 +2265,7 @@ func TestAcceptedError_Is(t *testing.T) { } } -// ensure that we properly handle API errors that do not contain a response body +// Ensure that we properly handle API errors that do not contain a response body. func TestCheckResponse_noBody(t *testing.T) { t.Parallel() res := &http.Response{ diff --git a/github/issues_labels.go b/github/issues_labels.go index 51e7fe6a55b..b97b00f3e82 100644 --- a/github/issues_labels.go +++ b/github/issues_labels.go @@ -10,7 +10,7 @@ import ( "fmt" ) -// Label represents a GitHub label on an Issue +// Label represents a GitHub label on an Issue. type Label struct { ID *int64 `json:"id,omitempty"` URL *string `json:"url,omitempty"` diff --git a/github/messages.go b/github/messages.go index 30c4fca9304..0997479335f 100644 --- a/github/messages.go +++ b/github/messages.go @@ -114,9 +114,9 @@ var ( "workflow_job": &WorkflowJobEvent{}, "workflow_run": &WorkflowRunEvent{}, } - // forward mapping of event types to the string names of the structs + // Forward mapping of event types to the string names of the structs. messageToTypeName = make(map[string]string, len(eventTypeMapping)) - // Inverse map of the above + // Inverse map of the above. typeToMessageMapping = make(map[string]string, len(eventTypeMapping)) ) diff --git a/github/orgs_members_test.go b/github/orgs_members_test.go index c2c1b63ee8b..a351ab9341a 100644 --- a/github/orgs_members_test.go +++ b/github/orgs_members_test.go @@ -126,7 +126,7 @@ func TestOrganizationsService_IsMember(t *testing.T) { }) } -// ensure that a 404 response is interpreted as "false" and not an error +// Ensure that a 404 response is interpreted as "false" and not an error. func TestOrganizationsService_IsMember_notMember(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -146,8 +146,8 @@ func TestOrganizationsService_IsMember_notMember(t *testing.T) { } } -// ensure that a 400 response is interpreted as an actual error, and not simply -// as "false" like the above case of a 404 +// Ensure that a 400 response is interpreted as an actual error, and not simply +// as "false" like the above case of a 404. func TestOrganizationsService_IsMember_error(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -209,7 +209,7 @@ func TestOrganizationsService_IsPublicMember(t *testing.T) { }) } -// ensure that a 404 response is interpreted as "false" and not an error +// Ensure that a 404 response is interpreted as "false" and not an error. func TestOrganizationsService_IsPublicMember_notMember(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -229,8 +229,8 @@ func TestOrganizationsService_IsPublicMember_notMember(t *testing.T) { } } -// ensure that a 400 response is interpreted as an actual error, and not simply -// as "false" like the above case of a 404 +// Ensure that a 400 response is interpreted as an actual error, and not simply +// as "false" like the above case of a 404. func TestOrganizationsService_IsPublicMember_error(t *testing.T) { t.Parallel() client, mux, _ := setup(t) diff --git a/github/repos.go b/github/repos.go index d928771df31..9faed401f87 100644 --- a/github/repos.go +++ b/github/repos.go @@ -738,7 +738,7 @@ func (s *RepositoriesService) Delete(ctx context.Context, owner, repo string) (* return s.client.Do(ctx, req, nil) } -// Contributor represents a repository contributor +// Contributor represents a repository contributor. type Contributor struct { Login *string `json:"login,omitempty"` ID *int64 `json:"id,omitempty"` @@ -998,7 +998,7 @@ func (s *RepositoriesService) ListTags(ctx context.Context, owner string, repo s return tags, resp, nil } -// Branch represents a repository branch +// Branch represents a repository branch. type Branch struct { Name *string `json:"name,omitempty"` Commit *RepositoryCommit `json:"commit,omitempty"` diff --git a/github/repos_contents.go b/github/repos_contents.go index 97539aeeb5e..3a0c266b5ee 100644 --- a/github/repos_contents.go +++ b/github/repos_contents.go @@ -62,7 +62,7 @@ type RepositoryContentFileOptions struct { } // RepositoryContentGetOptions represents an optional ref parameter, which can be a SHA, -// branch, or tag +// branch, or tag. type RepositoryContentGetOptions struct { Ref string `url:"ref,omitempty"` } diff --git a/github/repos_deployments.go b/github/repos_deployments.go index d8c0b63218e..6277ac2151a 100644 --- a/github/repos_deployments.go +++ b/github/repos_deployments.go @@ -12,7 +12,7 @@ import ( "strings" ) -// Deployment represents a deployment in a repo +// Deployment represents a deployment in a repo. type Deployment struct { URL *string `json:"url,omitempty"` ID *int64 `json:"id,omitempty"` @@ -30,7 +30,7 @@ type Deployment struct { NodeID *string `json:"node_id,omitempty"` } -// DeploymentRequest represents a deployment request +// DeploymentRequest represents a deployment request. type DeploymentRequest struct { Ref *string `json:"ref,omitempty"` Task *string `json:"task,omitempty"` @@ -171,7 +171,7 @@ type DeploymentStatus struct { URL *string `json:"url,omitempty"` } -// DeploymentStatusRequest represents a deployment request +// DeploymentStatusRequest represents a deployment request. type DeploymentStatusRequest struct { State *string `json:"state,omitempty"` LogURL *string `json:"log_url,omitempty"` diff --git a/github/search.go b/github/search.go index 71efe87a039..54bc6d5e1f4 100644 --- a/github/search.go +++ b/github/search.go @@ -209,7 +209,7 @@ type Match struct { Indices []int `json:"indices,omitempty"` } -// TextMatch represents a text match for a SearchResult +// TextMatch represents a text match for a SearchResult. type TextMatch struct { ObjectURL *string `json:"object_url,omitempty"` ObjectType *string `json:"object_type,omitempty"` diff --git a/github/timestamp.go b/github/timestamp.go index 00c1235e9d3..dc1045cf742 100644 --- a/github/timestamp.go +++ b/github/timestamp.go @@ -46,7 +46,7 @@ func (t *Timestamp) UnmarshalJSON(data []byte) (err error) { return } -// Equal reports whether t and u are equal based on time.Equal +// Equal reports whether t and u are equal based on time.Equal. func (t Timestamp) Equal(u Timestamp) bool { return t.Time.Equal(u.Time) } diff --git a/github/users_emails.go b/github/users_emails.go index 189187a74a3..3d0e1bfaaf6 100644 --- a/github/users_emails.go +++ b/github/users_emails.go @@ -7,7 +7,7 @@ package github import "context" -// UserEmail represents user's email address +// UserEmail represents user's email address. type UserEmail struct { Email *string `json:"email,omitempty"` Primary *bool `json:"primary,omitempty"` diff --git a/scrape/apps.go b/scrape/apps.go index 1b085296c16..307d8e5a65c 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -92,11 +92,11 @@ func intFromLastPathSegment(s string) int { type OAuthAppReviewState int const ( - // OAuthAppRequested indicates access has been requested, but not reviewed + // OAuthAppRequested indicates access has been requested, but not reviewed. OAuthAppRequested OAuthAppReviewState = iota + 1 - // OAuthAppApproved indicates access has been approved + // OAuthAppApproved indicates access has been approved. OAuthAppApproved - // OAuthAppDenied indicates access has been denied + // OAuthAppDenied indicates access has been denied. OAuthAppDenied ) diff --git a/test/integration/audit_log_test.go b/test/integration/audit_log_test.go index 639ea7a6780..a7f79b746b5 100644 --- a/test/integration/audit_log_test.go +++ b/test/integration/audit_log_test.go @@ -13,9 +13,9 @@ import ( "testing" ) -// TestOrganizationAuditLog test that the client can read an org's audit log -// Note: Org must be part of an enterprise -// Test requires auth - set env var GITHUB_AUTH_TOKEN +// TestOrganizationAuditLog test that the client can read an org's audit log. +// Note: Org must be part of an enterprise. +// Test requires auth - set env var GITHUB_AUTH_TOKEN. func TestOrganizationAuditLog(t *testing.T) { org := "example_org" entries, _, err := client.Organizations.GetAuditLog(context.Background(), org, nil) diff --git a/tools/metadata/metadata.go b/tools/metadata/metadata.go index db763462c62..11eeae58542 100644 --- a/tools/metadata/metadata.go +++ b/tools/metadata/metadata.go @@ -102,7 +102,7 @@ func normalizedOpName(name string) string { return strings.TrimSpace(verb + " " + normalizeOpPath(u)) } -// matches something like "GET /some/path" +// matches something like "GET /some/path". var opNameRe = regexp.MustCompile(`(?i)(\S+)(?:\s+(\S.*))?`) func parseOpName(id string) (verb, url string) { From 7cd68867e10bdc65a6c500bdeb4267336b9e6d30 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Mon, 14 Oct 2024 13:31:19 +0300 Subject: [PATCH 543/751] scrape: refactor tests with t.Fatal (#3299) --- scrape/apps_test.go | 4 ++-- scrape/forms_test.go | 6 +++--- scrape/scrape_test.go | 5 +++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/scrape/apps_test.go b/scrape/apps_test.go index c15b305b065..1a41764867f 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -40,7 +40,7 @@ func Test_AppRestrictionsEnabled(t *testing.T) { got, err := client.AppRestrictionsEnabled("o") if err != nil { - t.Errorf("AppRestrictionsEnabled returned err: %v", err) + t.Fatalf("AppRestrictionsEnabled returned err: %v", err) } if want := tt.want; got != want { t.Errorf("AppRestrictionsEnabled returned %t, want %t", got, want) @@ -59,7 +59,7 @@ func Test_ListOAuthApps(t *testing.T) { got, err := client.ListOAuthApps("e") if err != nil { - t.Errorf("ListOAuthApps(e) returned err: %v", err) + t.Fatalf("ListOAuthApps(e) returned err: %v", err) } want := []OAuthApp{ { diff --git a/scrape/forms_test.go b/scrape/forms_test.go index e3e802b0bc8..28c30c6c670 100644 --- a/scrape/forms_test.go +++ b/scrape/forms_test.go @@ -76,7 +76,7 @@ func Test_ParseForms(t *testing.T) { t.Parallel() node, err := html.Parse(strings.NewReader(tt.html)) if err != nil { - t.Errorf("error parsing html: %v", err) + t.Fatalf("error parsing html: %v", err) } if got, want := parseForms(node), tt.forms; !cmp.Equal(got, want) { t.Errorf("parseForms(%q) returned %+v, want %+v", tt.html, got, want) @@ -99,7 +99,7 @@ func Test_FetchAndSumbitForm(t *testing.T) { mux.HandleFunc("/submit", func(w http.ResponseWriter, r *http.Request) { err := r.ParseForm() if err != nil { - t.Errorf("error parsing form: %v", err) + t.Fatalf("error parsing form: %v", err) } want := url.Values{"hidden": {"h"}, "name": {"n"}} if got := r.Form; !cmp.Equal(got, want) { @@ -111,7 +111,7 @@ func Test_FetchAndSumbitForm(t *testing.T) { setValues := func(values url.Values) { values.Set("name", "n") } _, err := fetchAndSubmitForm(client.Client, client.baseURL.String()+"/", setValues) if err != nil { - t.Errorf("fetchAndSubmitForm returned err: %v", err) + t.Fatalf("fetchAndSubmitForm returned err: %v", err) } if !submitted { t.Error("form was never submitted") diff --git a/scrape/scrape_test.go b/scrape/scrape_test.go index 24bab0a27b5..c31bb8337cd 100644 --- a/scrape/scrape_test.go +++ b/scrape/scrape_test.go @@ -6,6 +6,7 @@ import ( "net/http/httptest" "net/url" "os" + "path/filepath" "testing" ) @@ -27,9 +28,9 @@ func setup(t *testing.T) (client *Client, mux *http.ServeMux) { func copyTestFile(t *testing.T, w io.Writer, filename string) { t.Helper() - f, err := os.Open("testdata/" + filename) + f, err := os.Open(filepath.Join("testdata", filename)) if err != nil { - t.Errorf("unable to open test file: %v", err) + t.Fatalf("unable to open test file: %v", err) } _, err = io.Copy(w, f) if err != nil { From b1615cb2b727a4183f7873794df0d9b7b5ce3a56 Mon Sep 17 00:00:00 2001 From: Aditya Mahendrakar Date: Mon, 14 Oct 2024 03:35:12 -0700 Subject: [PATCH 544/751] feat: Support Code Security Configurations API (#3319) Fixes: #3211. --- github/github-accessors.go | 208 +++++++ github/github-accessors_test.go | 277 ++++++++++ github/orgs_codesecurity_configurations.go | 284 ++++++++++ .../orgs_codesecurity_configurations_test.go | 510 ++++++++++++++++++ 4 files changed, 1279 insertions(+) create mode 100644 github/orgs_codesecurity_configurations.go create mode 100644 github/orgs_codesecurity_configurations_test.go diff --git a/github/github-accessors.go b/github/github-accessors.go index f3a16c10ae1..7995145faa9 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -2662,6 +2662,190 @@ func (c *CodeSearchResult) GetTotal() int { return *c.Total } +// GetAdvancedSecurity returns the AdvancedSecurity field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetAdvancedSecurity() string { + if c == nil || c.AdvancedSecurity == nil { + return "" + } + return *c.AdvancedSecurity +} + +// GetCodeScanningDefaultSetup returns the CodeScanningDefaultSetup field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetCodeScanningDefaultSetup() string { + if c == nil || c.CodeScanningDefaultSetup == nil { + return "" + } + return *c.CodeScanningDefaultSetup +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetCreatedAt() Timestamp { + if c == nil || c.CreatedAt == nil { + return Timestamp{} + } + return *c.CreatedAt +} + +// GetDependabotAlerts returns the DependabotAlerts field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetDependabotAlerts() string { + if c == nil || c.DependabotAlerts == nil { + return "" + } + return *c.DependabotAlerts +} + +// GetDependabotSecurityUpdates returns the DependabotSecurityUpdates field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetDependabotSecurityUpdates() string { + if c == nil || c.DependabotSecurityUpdates == nil { + return "" + } + return *c.DependabotSecurityUpdates +} + +// GetDependencyGraph returns the DependencyGraph field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetDependencyGraph() string { + if c == nil || c.DependencyGraph == nil { + return "" + } + return *c.DependencyGraph +} + +// GetDependencyGraphAutosubmitAction returns the DependencyGraphAutosubmitAction field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetDependencyGraphAutosubmitAction() string { + if c == nil || c.DependencyGraphAutosubmitAction == nil { + return "" + } + return *c.DependencyGraphAutosubmitAction +} + +// GetDependencyGraphAutosubmitActionOptions returns the DependencyGraphAutosubmitActionOptions field. +func (c *CodeSecurityConfiguration) GetDependencyGraphAutosubmitActionOptions() *DependencyGraphAutosubmitActionOptions { + if c == nil { + return nil + } + return c.DependencyGraphAutosubmitActionOptions +} + +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetDescription() string { + if c == nil || c.Description == nil { + return "" + } + return *c.Description +} + +// GetEnforcement returns the Enforcement field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetEnforcement() string { + if c == nil || c.Enforcement == nil { + return "" + } + return *c.Enforcement +} + +// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetHTMLURL() string { + if c == nil || c.HTMLURL == nil { + return "" + } + return *c.HTMLURL +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetID() int64 { + if c == nil || c.ID == nil { + return 0 + } + return *c.ID +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetName() string { + if c == nil || c.Name == nil { + return "" + } + return *c.Name +} + +// GetPrivateVulnerabilityReporting returns the PrivateVulnerabilityReporting field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetPrivateVulnerabilityReporting() string { + if c == nil || c.PrivateVulnerabilityReporting == nil { + return "" + } + return *c.PrivateVulnerabilityReporting +} + +// GetSecretScanning returns the SecretScanning field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetSecretScanning() string { + if c == nil || c.SecretScanning == nil { + return "" + } + return *c.SecretScanning +} + +// GetSecretScanningNonProviderPatterns returns the SecretScanningNonProviderPatterns field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetSecretScanningNonProviderPatterns() string { + if c == nil || c.SecretScanningNonProviderPatterns == nil { + return "" + } + return *c.SecretScanningNonProviderPatterns +} + +// GetSecretScanningPushProtection returns the SecretScanningPushProtection field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetSecretScanningPushProtection() string { + if c == nil || c.SecretScanningPushProtection == nil { + return "" + } + return *c.SecretScanningPushProtection +} + +// GetSecretScanningValidityChecks returns the SecretScanningValidityChecks field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetSecretScanningValidityChecks() string { + if c == nil || c.SecretScanningValidityChecks == nil { + return "" + } + return *c.SecretScanningValidityChecks +} + +// GetTargetType returns the TargetType field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetTargetType() string { + if c == nil || c.TargetType == nil { + return "" + } + return *c.TargetType +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetUpdatedAt() Timestamp { + if c == nil || c.UpdatedAt == nil { + return Timestamp{} + } + return *c.UpdatedAt +} + +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetURL() string { + if c == nil || c.URL == nil { + return "" + } + return *c.URL +} + +// GetConfiguration returns the Configuration field. +func (c *CodeSecurityConfigurationWithDefaultForNewRepos) GetConfiguration() *CodeSecurityConfiguration { + if c == nil { + return nil + } + return c.Configuration +} + +// GetDefaultForNewRepos returns the DefaultForNewRepos field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfigurationWithDefaultForNewRepos) GetDefaultForNewRepos() string { + if c == nil || c.DefaultForNewRepos == nil { + return "" + } + return *c.DefaultForNewRepos +} + // GetBillableOwner returns the BillableOwner field. func (c *Codespace) GetBillableOwner() *User { if c == nil { @@ -5358,6 +5542,14 @@ func (d *Dependency) GetScope() string { return *d.Scope } +// GetLabeledRunners returns the LabeledRunners field if it's non-nil, zero value otherwise. +func (d *DependencyGraphAutosubmitActionOptions) GetLabeledRunners() bool { + if d == nil || d.LabeledRunners == nil { + return false + } + return *d.LabeledRunners +} + // GetDetector returns the Detector field. func (d *DependencyGraphSnapshot) GetDetector() *DependencyGraphSnapshotDetector { if d == nil { @@ -19790,6 +19982,22 @@ func (r *RepositoryActiveCommitters) GetName() string { return *r.Name } +// GetConfiguration returns the Configuration field. +func (r *RepositoryCodeSecurityConfiguration) GetConfiguration() *CodeSecurityConfiguration { + if r == nil { + return nil + } + return r.Configuration +} + +// GetState returns the State field if it's non-nil, zero value otherwise. +func (r *RepositoryCodeSecurityConfiguration) GetState() string { + if r == nil || r.State == nil { + return "" + } + return *r.State +} + // 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-accessors_test.go b/github/github-accessors_test.go index 2086baa0fda..bc6e2be8d01 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -3464,6 +3464,253 @@ func TestCodeSearchResult_GetTotal(tt *testing.T) { c.GetTotal() } +func TestCodeSecurityConfiguration_GetAdvancedSecurity(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CodeSecurityConfiguration{AdvancedSecurity: &zeroValue} + c.GetAdvancedSecurity() + c = &CodeSecurityConfiguration{} + c.GetAdvancedSecurity() + c = nil + c.GetAdvancedSecurity() +} + +func TestCodeSecurityConfiguration_GetCodeScanningDefaultSetup(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CodeSecurityConfiguration{CodeScanningDefaultSetup: &zeroValue} + c.GetCodeScanningDefaultSetup() + c = &CodeSecurityConfiguration{} + c.GetCodeScanningDefaultSetup() + c = nil + c.GetCodeScanningDefaultSetup() +} + +func TestCodeSecurityConfiguration_GetCreatedAt(tt *testing.T) { + tt.Parallel() + var zeroValue Timestamp + c := &CodeSecurityConfiguration{CreatedAt: &zeroValue} + c.GetCreatedAt() + c = &CodeSecurityConfiguration{} + c.GetCreatedAt() + c = nil + c.GetCreatedAt() +} + +func TestCodeSecurityConfiguration_GetDependabotAlerts(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CodeSecurityConfiguration{DependabotAlerts: &zeroValue} + c.GetDependabotAlerts() + c = &CodeSecurityConfiguration{} + c.GetDependabotAlerts() + c = nil + c.GetDependabotAlerts() +} + +func TestCodeSecurityConfiguration_GetDependabotSecurityUpdates(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CodeSecurityConfiguration{DependabotSecurityUpdates: &zeroValue} + c.GetDependabotSecurityUpdates() + c = &CodeSecurityConfiguration{} + c.GetDependabotSecurityUpdates() + c = nil + c.GetDependabotSecurityUpdates() +} + +func TestCodeSecurityConfiguration_GetDependencyGraph(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CodeSecurityConfiguration{DependencyGraph: &zeroValue} + c.GetDependencyGraph() + c = &CodeSecurityConfiguration{} + c.GetDependencyGraph() + c = nil + c.GetDependencyGraph() +} + +func TestCodeSecurityConfiguration_GetDependencyGraphAutosubmitAction(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CodeSecurityConfiguration{DependencyGraphAutosubmitAction: &zeroValue} + c.GetDependencyGraphAutosubmitAction() + c = &CodeSecurityConfiguration{} + c.GetDependencyGraphAutosubmitAction() + c = nil + c.GetDependencyGraphAutosubmitAction() +} + +func TestCodeSecurityConfiguration_GetDependencyGraphAutosubmitActionOptions(tt *testing.T) { + tt.Parallel() + c := &CodeSecurityConfiguration{} + c.GetDependencyGraphAutosubmitActionOptions() + c = nil + c.GetDependencyGraphAutosubmitActionOptions() +} + +func TestCodeSecurityConfiguration_GetDescription(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CodeSecurityConfiguration{Description: &zeroValue} + c.GetDescription() + c = &CodeSecurityConfiguration{} + c.GetDescription() + c = nil + c.GetDescription() +} + +func TestCodeSecurityConfiguration_GetEnforcement(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CodeSecurityConfiguration{Enforcement: &zeroValue} + c.GetEnforcement() + c = &CodeSecurityConfiguration{} + c.GetEnforcement() + c = nil + c.GetEnforcement() +} + +func TestCodeSecurityConfiguration_GetHTMLURL(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CodeSecurityConfiguration{HTMLURL: &zeroValue} + c.GetHTMLURL() + c = &CodeSecurityConfiguration{} + c.GetHTMLURL() + c = nil + c.GetHTMLURL() +} + +func TestCodeSecurityConfiguration_GetID(tt *testing.T) { + tt.Parallel() + var zeroValue int64 + c := &CodeSecurityConfiguration{ID: &zeroValue} + c.GetID() + c = &CodeSecurityConfiguration{} + c.GetID() + c = nil + c.GetID() +} + +func TestCodeSecurityConfiguration_GetName(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CodeSecurityConfiguration{Name: &zeroValue} + c.GetName() + c = &CodeSecurityConfiguration{} + c.GetName() + c = nil + c.GetName() +} + +func TestCodeSecurityConfiguration_GetPrivateVulnerabilityReporting(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CodeSecurityConfiguration{PrivateVulnerabilityReporting: &zeroValue} + c.GetPrivateVulnerabilityReporting() + c = &CodeSecurityConfiguration{} + c.GetPrivateVulnerabilityReporting() + c = nil + c.GetPrivateVulnerabilityReporting() +} + +func TestCodeSecurityConfiguration_GetSecretScanning(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CodeSecurityConfiguration{SecretScanning: &zeroValue} + c.GetSecretScanning() + c = &CodeSecurityConfiguration{} + c.GetSecretScanning() + c = nil + c.GetSecretScanning() +} + +func TestCodeSecurityConfiguration_GetSecretScanningNonProviderPatterns(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CodeSecurityConfiguration{SecretScanningNonProviderPatterns: &zeroValue} + c.GetSecretScanningNonProviderPatterns() + c = &CodeSecurityConfiguration{} + c.GetSecretScanningNonProviderPatterns() + c = nil + c.GetSecretScanningNonProviderPatterns() +} + +func TestCodeSecurityConfiguration_GetSecretScanningPushProtection(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CodeSecurityConfiguration{SecretScanningPushProtection: &zeroValue} + c.GetSecretScanningPushProtection() + c = &CodeSecurityConfiguration{} + c.GetSecretScanningPushProtection() + c = nil + c.GetSecretScanningPushProtection() +} + +func TestCodeSecurityConfiguration_GetSecretScanningValidityChecks(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CodeSecurityConfiguration{SecretScanningValidityChecks: &zeroValue} + c.GetSecretScanningValidityChecks() + c = &CodeSecurityConfiguration{} + c.GetSecretScanningValidityChecks() + c = nil + c.GetSecretScanningValidityChecks() +} + +func TestCodeSecurityConfiguration_GetTargetType(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CodeSecurityConfiguration{TargetType: &zeroValue} + c.GetTargetType() + c = &CodeSecurityConfiguration{} + c.GetTargetType() + c = nil + c.GetTargetType() +} + +func TestCodeSecurityConfiguration_GetUpdatedAt(tt *testing.T) { + tt.Parallel() + var zeroValue Timestamp + c := &CodeSecurityConfiguration{UpdatedAt: &zeroValue} + c.GetUpdatedAt() + c = &CodeSecurityConfiguration{} + c.GetUpdatedAt() + c = nil + c.GetUpdatedAt() +} + +func TestCodeSecurityConfiguration_GetURL(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CodeSecurityConfiguration{URL: &zeroValue} + c.GetURL() + c = &CodeSecurityConfiguration{} + c.GetURL() + c = nil + c.GetURL() +} + +func TestCodeSecurityConfigurationWithDefaultForNewRepos_GetConfiguration(tt *testing.T) { + tt.Parallel() + c := &CodeSecurityConfigurationWithDefaultForNewRepos{} + c.GetConfiguration() + c = nil + c.GetConfiguration() +} + +func TestCodeSecurityConfigurationWithDefaultForNewRepos_GetDefaultForNewRepos(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CodeSecurityConfigurationWithDefaultForNewRepos{DefaultForNewRepos: &zeroValue} + c.GetDefaultForNewRepos() + c = &CodeSecurityConfigurationWithDefaultForNewRepos{} + c.GetDefaultForNewRepos() + c = nil + c.GetDefaultForNewRepos() +} + func TestCodespace_GetBillableOwner(tt *testing.T) { tt.Parallel() c := &Codespace{} @@ -6958,6 +7205,17 @@ func TestDependency_GetScope(tt *testing.T) { d.GetScope() } +func TestDependencyGraphAutosubmitActionOptions_GetLabeledRunners(tt *testing.T) { + tt.Parallel() + var zeroValue bool + d := &DependencyGraphAutosubmitActionOptions{LabeledRunners: &zeroValue} + d.GetLabeledRunners() + d = &DependencyGraphAutosubmitActionOptions{} + d.GetLabeledRunners() + d = nil + d.GetLabeledRunners() +} + func TestDependencyGraphSnapshot_GetDetector(tt *testing.T) { tt.Parallel() d := &DependencyGraphSnapshot{} @@ -25446,6 +25704,25 @@ func TestRepositoryActiveCommitters_GetName(tt *testing.T) { r.GetName() } +func TestRepositoryCodeSecurityConfiguration_GetConfiguration(tt *testing.T) { + tt.Parallel() + r := &RepositoryCodeSecurityConfiguration{} + r.GetConfiguration() + r = nil + r.GetConfiguration() +} + +func TestRepositoryCodeSecurityConfiguration_GetState(tt *testing.T) { + tt.Parallel() + var zeroValue string + r := &RepositoryCodeSecurityConfiguration{State: &zeroValue} + r.GetState() + r = &RepositoryCodeSecurityConfiguration{} + r.GetState() + r = nil + r.GetState() +} + func TestRepositoryComment_GetBody(tt *testing.T) { tt.Parallel() var zeroValue string diff --git a/github/orgs_codesecurity_configurations.go b/github/orgs_codesecurity_configurations.go new file mode 100644 index 00000000000..b25845a4e8a --- /dev/null +++ b/github/orgs_codesecurity_configurations.go @@ -0,0 +1,284 @@ +// Copyright 2024 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" +) + +// DependencyGraphAutosubmitActionOptions represents the options for the DependencyGraphAutosubmitAction. +type DependencyGraphAutosubmitActionOptions struct { + LabeledRunners *bool `json:"labeled_runners,omitempty"` +} + +// CodeSecurityConfiguration represents a code security configuration. +type CodeSecurityConfiguration struct { + ID *int64 `json:"id,omitempty"` + TargetType *string `json:"target_type,omitempty"` + Name *string `json:"name"` + Description *string `json:"description,omitempty"` + AdvancedSecurity *string `json:"advanced_security,omitempty"` + DependencyGraph *string `json:"dependency_graph,omitempty"` + DependencyGraphAutosubmitAction *string `json:"dependency_graph_autosubmit_action,omitempty"` + DependencyGraphAutosubmitActionOptions *DependencyGraphAutosubmitActionOptions `json:"dependency_graph_autosubmit_action_options,omitempty"` + DependabotAlerts *string `json:"dependabot_alerts,omitempty"` + DependabotSecurityUpdates *string `json:"dependabot_security_updates,omitempty"` + CodeScanningDefaultSetup *string `json:"code_scanning_default_setup,omitempty"` + SecretScanning *string `json:"secret_scanning,omitempty"` + SecretScanningPushProtection *string `json:"secret_scanning_push_protection,omitempty"` + SecretScanningValidityChecks *string `json:"secret_scanning_validity_checks,omitempty"` + SecretScanningNonProviderPatterns *string `json:"secret_scanning_non_provider_patterns,omitempty"` + PrivateVulnerabilityReporting *string `json:"private_vulnerability_reporting,omitempty"` + Enforcement *string `json:"enforcement,omitempty"` + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` +} + +// CodeSecurityConfigurationWithDefaultForNewRepos represents a code security configuration with default for new repos param. +type CodeSecurityConfigurationWithDefaultForNewRepos struct { + Configuration *CodeSecurityConfiguration `json:"configuration"` + DefaultForNewRepos *string `json:"default_for_new_repos"` +} + +// RepositoryCodeSecurityConfiguration represents a code security configuration for a repository. +type RepositoryCodeSecurityConfiguration struct { + State *string `json:"state,omitempty"` + Configuration *CodeSecurityConfiguration `json:"configuration,omitempty"` +} + +// GetCodeSecurityConfigurations gets code security configurations for an organization. +// +// GitHub API docs: https://docs.github.com/rest/code-security/configurations#get-code-security-configurations-for-an-organization +// +//meta:operation GET /orgs/{org}/code-security/configurations +func (s *OrganizationsService) GetCodeSecurityConfigurations(ctx context.Context, org string) ([]*CodeSecurityConfiguration, *Response, error) { + u := fmt.Sprintf("orgs/%v/code-security/configurations", org) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var configurations []*CodeSecurityConfiguration + resp, err := s.client.Do(ctx, req, &configurations) + if err != nil { + return nil, resp, err + } + return configurations, resp, nil +} + +// CreateCodeSecurityConfiguration creates a code security configuration for an organization. +// +// GitHub API docs: https://docs.github.com/rest/code-security/configurations#create-a-code-security-configuration +// +//meta:operation POST /orgs/{org}/code-security/configurations +func (s *OrganizationsService) CreateCodeSecurityConfiguration(ctx context.Context, org string, c *CodeSecurityConfiguration) (*CodeSecurityConfiguration, *Response, error) { + u := fmt.Sprintf("orgs/%v/code-security/configurations", org) + + req, err := s.client.NewRequest("POST", u, c) + if err != nil { + return nil, nil, err + } + + var configuration *CodeSecurityConfiguration + resp, err := s.client.Do(ctx, req, &configuration) + if err != nil { + return nil, resp, err + } + return configuration, resp, nil +} + +// GetDefaultCodeSecurityConfigurations gets default code security configurations for an organization. +// +// GitHub API docs: https://docs.github.com/rest/code-security/configurations#get-default-code-security-configurations +// +//meta:operation GET /orgs/{org}/code-security/configurations/defaults +func (s *OrganizationsService) GetDefaultCodeSecurityConfigurations(ctx context.Context, org string) ([]*CodeSecurityConfiguration, *Response, error) { + u := fmt.Sprintf("orgs/%v/code-security/configurations/defaults", org) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var configurations []*CodeSecurityConfiguration + resp, err := s.client.Do(ctx, req, &configurations) + if err != nil { + return nil, resp, err + } + return configurations, resp, nil +} + +// DetachCodeSecurityConfigurationsFromRepositories detaches code security configuration from an organization's repositories. +// +// GitHub API docs: https://docs.github.com/rest/code-security/configurations#detach-configurations-from-repositories +// +//meta:operation DELETE /orgs/{org}/code-security/configurations/detach +func (s *OrganizationsService) DetachCodeSecurityConfigurationsFromRepositories(ctx context.Context, org string, repoIDs []int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/code-security/configurations/detach", org) + type selectedRepoIDs struct { + SelectedIDs []int64 `json:"selected_repository_ids"` + } + req, err := s.client.NewRequest("DELETE", u, selectedRepoIDs{SelectedIDs: repoIDs}) + if err != nil { + return nil, err + } + resp, err := s.client.Do(ctx, req, nil) + if err != nil { + return resp, err + } + return resp, nil +} + +// GetCodeSecurityConfiguration gets a code security configuration available in an organization. +// +// GitHub API docs: https://docs.github.com/rest/code-security/configurations#get-a-code-security-configuration +// +//meta:operation GET /orgs/{org}/code-security/configurations/{configuration_id} +func (s *OrganizationsService) GetCodeSecurityConfiguration(ctx context.Context, org string, id int64) (*CodeSecurityConfiguration, *Response, error) { + u := fmt.Sprintf("orgs/%v/code-security/configurations/%v", org, id) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var configuration *CodeSecurityConfiguration + resp, err := s.client.Do(ctx, req, &configuration) + if err != nil { + return nil, resp, err + } + return configuration, resp, nil +} + +// UpdateCodeSecurityConfiguration updates a code security configuration for an organization. +// +// GitHub API docs: https://docs.github.com/rest/code-security/configurations#update-a-code-security-configuration +// +//meta:operation PATCH /orgs/{org}/code-security/configurations/{configuration_id} +func (s *OrganizationsService) UpdateCodeSecurityConfiguration(ctx context.Context, org string, id int64, c *CodeSecurityConfiguration) (*CodeSecurityConfiguration, *Response, error) { + u := fmt.Sprintf("orgs/%v/code-security/configurations/%v", org, id) + + req, err := s.client.NewRequest("PATCH", u, c) + if err != nil { + return nil, nil, err + } + + var configuration *CodeSecurityConfiguration + resp, err := s.client.Do(ctx, req, &configuration) + if err != nil { + return nil, resp, err + } + return configuration, resp, nil +} + +// DeleteCodeSecurityConfiguration deletes a code security configuration for an organization. +// +// GitHub API docs: https://docs.github.com/rest/code-security/configurations#delete-a-code-security-configuration +// +//meta:operation DELETE /orgs/{org}/code-security/configurations/{configuration_id} +func (s *OrganizationsService) DeleteCodeSecurityConfiguration(ctx context.Context, org string, id int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/code-security/configurations/%v", org, id) + + 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 +} + +// AttachCodeSecurityConfigurationsToRepositories attaches code security configurations to repositories for an organization. +// +// GitHub API docs: https://docs.github.com/rest/code-security/configurations#attach-a-configuration-to-repositories +// +//meta:operation POST /orgs/{org}/code-security/configurations/{configuration_id}/attach +func (s *OrganizationsService) AttachCodeSecurityConfigurationsToRepositories(ctx context.Context, org string, id int64, scope string, repoIDs []int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/code-security/configurations/%v/attach", org, id) + type selectedRepoIDs struct { + Scope string `json:"scope"` + SelectedIDs []int64 `json:"selected_repository_ids,omitempty"` + } + req, err := s.client.NewRequest("POST", u, selectedRepoIDs{Scope: scope, SelectedIDs: repoIDs}) + if err != nil { + return nil, err + } + resp, err := s.client.Do(ctx, req, nil) + if err != nil && resp.StatusCode != http.StatusAccepted { // StatusAccepted(202) is the expected status code as job is queued for processing + return resp, err + } + return resp, nil +} + +// SetDefaultCodeSecurityConfiguration sets a code security configuration as the default for an organization. +// +// GitHub API docs: https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-organization +// +//meta:operation PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults +func (s *OrganizationsService) SetDefaultCodeSecurityConfiguration(ctx context.Context, org string, id int64, newReposParam string) (*CodeSecurityConfigurationWithDefaultForNewRepos, *Response, error) { + u := fmt.Sprintf("orgs/%v/code-security/configurations/%v/defaults", org, id) + type configParam struct { + DefaultForNewRepos string `json:"default_for_new_repos"` + } + req, err := s.client.NewRequest("PUT", u, configParam{DefaultForNewRepos: newReposParam}) + if err != nil { + return nil, nil, err + } + var c *CodeSecurityConfigurationWithDefaultForNewRepos + resp, err := s.client.Do(ctx, req, &c) + if err != nil { + return nil, resp, err + } + return c, resp, nil +} + +// GetRepositoriesForCodeSecurityConfiguration gets repositories associated with a code security configuration. +// +// GitHub API docs: https://docs.github.com/rest/code-security/configurations#get-repositories-associated-with-a-code-security-configuration +// +//meta:operation GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories +func (s *OrganizationsService) GetRepositoriesForCodeSecurityConfiguration(ctx context.Context, org string, id int64) ([]*Repository, *Response, error) { + u := fmt.Sprintf("orgs/%v/code-security/configurations/%v/repositories", org, id) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var repositories []*Repository + resp, err := s.client.Do(ctx, req, &repositories) + if err != nil { + return nil, resp, err + } + return repositories, resp, nil +} + +// GetCodeSecurityConfigurationForRepository gets code security configuration that manages a repository's code security settings. +// +// GitHub API docs: https://docs.github.com/rest/code-security/configurations#get-the-code-security-configuration-associated-with-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/code-security-configuration +func (s *OrganizationsService) GetCodeSecurityConfigurationForRepository(ctx context.Context, org, repo string) (*RepositoryCodeSecurityConfiguration, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/code-security-configuration", org, repo) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + var repoConfig *RepositoryCodeSecurityConfiguration + resp, err := s.client.Do(ctx, req, &repoConfig) + if err != nil { + return nil, resp, err + } + return repoConfig, resp, nil +} diff --git a/github/orgs_codesecurity_configurations_test.go b/github/orgs_codesecurity_configurations_test.go new file mode 100644 index 00000000000..d59b37057ca --- /dev/null +++ b/github/orgs_codesecurity_configurations_test.go @@ -0,0 +1,510 @@ +// Copyright 2024 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" + "reflect" + "testing" + + "encoding/json" +) + +func TestOrganizationsService_GetCodeSecurityConfigurations(t *testing.T) { + t.Parallel() + ctx := context.Background() + client, mux, _ := setup(t) + + mux.HandleFunc("/orgs/o/code-security/configurations", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `[ + { + "id":1, + "name":"config1", + "code_scanning_default_setup": "enabled" + }, + { + "id":2, + "name":"config2", + "private_vulnerability_reporting": "enabled" + }]`) + }) + + configurations, _, err := client.Organizations.GetCodeSecurityConfigurations(ctx, "o") + if err != nil { + t.Errorf("Organizations.GetOrganizationCodeSecurityConfigurations returned error: %v", err) + } + + want := []*CodeSecurityConfiguration{ + {ID: Int64(1), Name: String("config1"), CodeScanningDefaultSetup: String("enabled")}, + {ID: Int64(2), Name: String("config2"), PrivateVulnerabilityReporting: String("enabled")}, + } + if !reflect.DeepEqual(configurations, want) { + t.Errorf("Organizations.GetCodeSecurityConfigurations returned %+v, want %+v", configurations, want) + } + const methodName = "GetCodeSecurityConfigurations" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.GetCodeSecurityConfigurations(ctx, "\n") + return err + }) + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.GetCodeSecurityConfigurations(ctx, "o") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_GetCodeSecurityConfiguration(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + ctx := context.Background() + + mux.HandleFunc("/orgs/o/code-security/configurations/1", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "id":1, + "name":"config1", + "code_scanning_default_setup": "enabled" + }`) + }) + + configuration, _, err := client.Organizations.GetCodeSecurityConfiguration(ctx, "o", 1) + if err != nil { + t.Errorf("Organizations.GetCodeSecurityConfiguration returned error: %v", err) + } + + want := &CodeSecurityConfiguration{ID: Int64(1), Name: String("config1"), CodeScanningDefaultSetup: String("enabled")} + if !reflect.DeepEqual(configuration, want) { + t.Errorf("Organizations.GetCodeSecurityConfiguration returned %+v, want %+v", configuration, want) + } + + const methodName = "GetCodeSecurityConfiguration" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.GetCodeSecurityConfiguration(ctx, "\n", -1) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.GetCodeSecurityConfiguration(ctx, "o", 1) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_CreateCodeSecurityConfiguration(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + ctx := context.Background() + + input := &CodeSecurityConfiguration{ + Name: String("config1"), + CodeScanningDefaultSetup: String("enabled"), + } + + mux.HandleFunc("/orgs/o/code-security/configurations", func(w http.ResponseWriter, r *http.Request) { + v := new(CodeSecurityConfiguration) + err := json.NewDecoder(r.Body).Decode(v) + if err != nil { + t.Errorf("Organizations.CreateCodeSecurityConfiguration request body decode failed: %v", err) + } + + if !reflect.DeepEqual(v, input) { + t.Errorf("Organizations.CreateCodeSecurityConfiguration request body = %+v, want %+v", v, input) + } + + fmt.Fprint(w, `{ + "id":1, + "name":"config1", + "code_scanning_default_setup": "enabled" + }`) + }) + + configuration, _, err := client.Organizations.CreateCodeSecurityConfiguration(ctx, "o", input) + if err != nil { + t.Errorf("Organizations.CreateCodeSecurityConfiguration returned error: %v", err) + } + + want := &CodeSecurityConfiguration{ID: Int64(1), Name: String("config1"), CodeScanningDefaultSetup: String("enabled")} + if !reflect.DeepEqual(configuration, want) { + t.Errorf("Organizations.CreateCodeSecurityConfiguration returned %+v, want %+v", configuration, want) + } + + const methodName = "CreateCodeSecurityConfiguration" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.CreateCodeSecurityConfiguration(ctx, "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.CreateCodeSecurityConfiguration(ctx, "o", input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_GetDefaultCodeSecurityConfigurations(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + ctx := context.Background() + + mux.HandleFunc("/orgs/o/code-security/configurations/defaults", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `[ + { + "id":1, + "name":"config1", + "code_scanning_default_setup": "enabled" + }, + { + "id":2, + "name":"config2", + "private_vulnerability_reporting": "enabled" + }]`) + }) + + configurations, _, err := client.Organizations.GetDefaultCodeSecurityConfigurations(ctx, "o") + if err != nil { + t.Errorf("Organizations.GetDefaultCodeSecurityConfigurations returned error: %v", err) + } + + want := []*CodeSecurityConfiguration{ + {ID: Int64(1), Name: String("config1"), CodeScanningDefaultSetup: String("enabled")}, + {ID: Int64(2), Name: String("config2"), PrivateVulnerabilityReporting: String("enabled")}, + } + if !reflect.DeepEqual(configurations, want) { + t.Errorf("Organizations.GetDefaultCodeSecurityConfigurations returned %+v, want %+v", configurations, want) + } + + const methodName = "GetDefaultCodeSecurityConfigurations" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.GetDefaultCodeSecurityConfigurations(ctx, "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.GetDefaultCodeSecurityConfigurations(ctx, "o") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_DetachCodeSecurityConfigurationsFromRepositories(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + ctx := context.Background() + + mux.HandleFunc("/orgs/o/code-security/configurations/detach", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + w.WriteHeader(http.StatusNoContent) + }) + + resp, err := client.Organizations.DetachCodeSecurityConfigurationsFromRepositories(ctx, "o", []int64{1}) + if err != nil { + t.Errorf("Organizations.DetachCodeSecurityConfigurationsFromRepositories returned error: %v", err) + } + + want := http.StatusNoContent + if resp.StatusCode != want { + t.Errorf("Organizations.DetachCodeSecurityConfigurationsFromRepositories returned status %d, want %d", resp.StatusCode, want) + } + + const methodName = "DetachCodeSecurityConfigurationsFromRepositories" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Organizations.DetachCodeSecurityConfigurationsFromRepositories(ctx, "\n", []int64{1}) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + resp, err := client.Organizations.DetachCodeSecurityConfigurationsFromRepositories(ctx, "o", []int64{1}) + return resp, err + }) +} + +func TestOrganizationsService_UpdateCodeSecurityConfiguration(t *testing.T) { + t.Parallel() + ctx := context.Background() + client, mux, _ := setup(t) + + input := &CodeSecurityConfiguration{ + Name: String("config1"), + CodeScanningDefaultSetup: String("enabled"), + } + + mux.HandleFunc("/orgs/o/code-security/configurations/1", func(w http.ResponseWriter, r *http.Request) { + v := new(CodeSecurityConfiguration) + err := json.NewDecoder(r.Body).Decode(v) + if err != nil { + t.Errorf("Organizations.UpdateCodeSecurityConfiguration request body decode failed: %v", err) + } + + if !reflect.DeepEqual(v, input) { + t.Errorf("Organizations.UpdateCodeSecurityConfiguration request body = %+v, want %+v", v, input) + } + + fmt.Fprint(w, `{ + "id":1, + "name":"config1", + "code_scanning_default_setup": "enabled" + }`) + }) + + configuration, _, err := client.Organizations.UpdateCodeSecurityConfiguration(ctx, "o", 1, input) + if err != nil { + t.Errorf("Organizations.UpdateCodeSecurityConfiguration returned error: %v", err) + } + + want := &CodeSecurityConfiguration{ID: Int64(1), Name: String("config1"), CodeScanningDefaultSetup: String("enabled")} + if !reflect.DeepEqual(configuration, want) { + t.Errorf("Organizations.UpdateCodeSecurityConfiguration returned %+v, want %+v", configuration, want) + } + + const methodName = "UpdateCodeSecurityConfiguration" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.UpdateCodeSecurityConfiguration(ctx, "\n", -1, input) + return + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.UpdateCodeSecurityConfiguration(ctx, "o", 1, input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_DeleteCodeSecurityConfiguration(t *testing.T) { + t.Parallel() + ctx := context.Background() + client, mux, _ := setup(t) + + mux.HandleFunc("/orgs/o/code-security/configurations/1", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + w.WriteHeader(http.StatusNoContent) + }) + + resp, err := client.Organizations.DeleteCodeSecurityConfiguration(ctx, "o", 1) + if err != nil { + t.Errorf("Organizations.DeleteCodeSecurityConfiguration returned error: %v", err) + } + + want := http.StatusNoContent + if resp.StatusCode != want { + t.Errorf("Organizations.DeleteCodeSecurityConfiguration returned status %d, want %d", resp.StatusCode, want) + } + + const methodName = "DeleteCodeSecurityConfiguration" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Organizations.DeleteCodeSecurityConfiguration(ctx, "\n", -1) + return + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + resp, err := client.Organizations.DeleteCodeSecurityConfiguration(ctx, "o", 1) + return resp, err + }) +} + +func TestOrganizationsService_AttachCodeSecurityConfigurationsToRepositories(t *testing.T) { + t.Parallel() + ctx := context.Background() + client, mux, _ := setup(t) + + mux.HandleFunc("/orgs/o/code-security/configurations/1/attach", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + type request struct { + Scope string `json:"scope"` + SelectedRepositoryIDS []int64 `json:"selected_repository_ids,omitempty"` + } + v := new(request) + err := json.NewDecoder(r.Body).Decode(v) + if err != nil { + t.Errorf("Organizations.AttachCodeSecurityConfigurationsToRepositories request body decode failed: %v", err) + } + if v.Scope != "selected" { + t.Errorf("Organizations.AttachCodeSecurityConfigurationsToRepositories request body scope = %s, want selected", v.Scope) + } + if !reflect.DeepEqual(v.SelectedRepositoryIDS, []int64{5, 20}) { + t.Errorf("Organizations.AttachCodeSecurityConfigurationsToRepositories request body selected_repository_ids = %+v, want %+v", v.SelectedRepositoryIDS, []int64{5, 20}) + } + w.WriteHeader(http.StatusAccepted) + }) + + resp, err := client.Organizations.AttachCodeSecurityConfigurationsToRepositories(ctx, "o", int64(1), "selected", []int64{5, 20}) + if err != nil { + t.Errorf("Organizations.AttachCodeSecurityConfigurationsToRepositories returned error: %v", err) + } + + want := http.StatusAccepted + if resp.StatusCode != want { + t.Errorf("Organizations.AttachCodeSecurityConfigurationsToRepositories returned status %d, want %d", resp.StatusCode, want) + } + + const methodName = "AttachCodeSecurityConfigurationsToRepositories" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Organizations.AttachCodeSecurityConfigurationsToRepositories(ctx, "\n", -1, "", nil) + return + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + resp, err := client.Organizations.AttachCodeSecurityConfigurationsToRepositories(ctx, "o", 1, "selected", []int64{5, 20}) + return resp, err + }) +} + +func TestOrganizationsService_SetDefaultCodeSecurityConfiguration(t *testing.T) { + t.Parallel() + ctx := context.Background() + client, mux, _ := setup(t) + + mux.HandleFunc("/orgs/o/code-security/configurations/1/defaults", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + fmt.Fprintf(w, ` + { + "default_for_new_repos": "all", + "configuration": + { + "id": 1, + "name": "config1", + "code_scanning_default_setup": "enabled" + } + }`) + w.WriteHeader(http.StatusOK) + }) + got, resp, err := client.Organizations.SetDefaultCodeSecurityConfiguration(ctx, "o", 1, "all") + if err != nil { + t.Errorf("Organizations.SetDefaultCodeSecurityConfiguration returned error: %v", err) + } + wantStatus := http.StatusOK + if resp.StatusCode != wantStatus { + t.Errorf("Organizations.SetDefaultCodeSecurityConfiguration returned status %d, want %d", resp.StatusCode, wantStatus) + } + want := &CodeSecurityConfigurationWithDefaultForNewRepos{ + DefaultForNewRepos: String("all"), + Configuration: &CodeSecurityConfiguration{ + ID: Int64(1), Name: String("config1"), CodeScanningDefaultSetup: String("enabled"), + }, + } + if !reflect.DeepEqual(got, want) { + t.Errorf("Organizations.SetDefaultCodeSecurityConfiguration returned %+v, want %+v", got, want) + } + + const methodName = "SetDefaultCodeSecurityConfiguration" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.SetDefaultCodeSecurityConfiguration(ctx, "\n", -1, "") + return + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.SetDefaultCodeSecurityConfiguration(ctx, "o", 1, "all") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_GetRepositoriesForCodeSecurityConfiguration(t *testing.T) { + t.Parallel() + ctx := context.Background() + client, mux, _ := setup(t) + + mux.HandleFunc("/orgs/o/code-security/configurations/1/repositories", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `[ + { + "id":8, + "name":"repo8" + }, + { + "id":42, + "name":"repo42" + }]`) + }) + + repositories, _, err := client.Organizations.GetRepositoriesForCodeSecurityConfiguration(ctx, "o", 1) + if err != nil { + t.Errorf("Organizations.GetRepositoriesForCodeSecurityConfiguration returned error: %v", err) + } + + want := []*Repository{ + {ID: Int64(8), Name: String("repo8")}, + {ID: Int64(42), Name: String("repo42")}, + } + if !reflect.DeepEqual(repositories, want) { + t.Errorf("Organizations.GetRepositoriesForCodeSecurityConfiguration returned %+v, want %+v", repositories, want) + } + + const methodName = "GetRepositoriesForCodeSecurityConfiguration" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.GetRepositoriesForCodeSecurityConfiguration(ctx, "\n", -1) + return + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.GetRepositoriesForCodeSecurityConfiguration(ctx, "o", 1) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_GetCodeSecurityConfigurationForRepository(t *testing.T) { + t.Parallel() + ctx := context.Background() + client, mux, _ := setup(t) + + mux.HandleFunc("/repos/o/repo8/code-security-configuration", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "state": "attached", + "configuration": { + "id":42, + "name":"config42", + "code_scanning_default_setup": "enabled" + } + }`) + w.WriteHeader(http.StatusOK) + }) + + rc, _, err := client.Organizations.GetCodeSecurityConfigurationForRepository(ctx, "o", "repo8") + if err != nil { + t.Errorf("Organizations.GetCodeSecurityConfigurationForRepository returned error: %v", err) + } + c := &CodeSecurityConfiguration{ID: Int64(42), Name: String("config42"), CodeScanningDefaultSetup: String("enabled")} + want := &RepositoryCodeSecurityConfiguration{ + State: String("attached"), + Configuration: c, + } + if !reflect.DeepEqual(rc, want) { + t.Errorf("Organizations.GetCodeSecurityConfigurationForRepository returned %+v, want %+v", rc, want) + } + + const methodName = "GetCodeSecurityConfigurationForRepository" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.GetCodeSecurityConfigurationForRepository(ctx, "\n", "\n") + return + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.GetCodeSecurityConfigurationForRepository(ctx, "o", "repo8") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} From 5e806b6a7e3f31f93d5e7b6225cd60f1d71d0c5a Mon Sep 17 00:00:00 2001 From: Clemens W Date: Mon, 14 Oct 2024 12:43:20 +0200 Subject: [PATCH 545/751] Add Copilot Usage Summary for Organization (#3321) --- github/copilot.go | 168 +++++ github/copilot_test.go | 1034 +++++++++++++++++++++++++++++++ github/github-accessors.go | 24 + github/github-accessors_test.go | 33 + 4 files changed, 1259 insertions(+) diff --git a/github/copilot.go b/github/copilot.go index 349b16ebde6..7ea13bd7c85 100644 --- a/github/copilot.go +++ b/github/copilot.go @@ -10,6 +10,7 @@ import ( "encoding/json" "errors" "fmt" + "time" ) // CopilotService provides access to the Copilot-related functions @@ -52,6 +53,7 @@ type CopilotSeatDetails struct { LastActivityEditor *string `json:"last_activity_editor,omitempty"` CreatedAt *Timestamp `json:"created_at"` UpdatedAt *Timestamp `json:"updated_at,omitempty"` + PlanType *string `json:"plan_type,omitempty"` } // SeatAssignments represents the number of seats assigned. @@ -64,6 +66,39 @@ type SeatCancellations struct { SeatsCancelled int `json:"seats_cancelled"` } +// CopilotUsageSummaryListOptions represents the optional parameters to the CopilotService.GetOrganizationUsage method. +type CopilotUsageSummaryListOptions struct { + Since *time.Time `url:"since,omitempty"` + Until *time.Time `url:"until,omitempty"` + + ListOptions +} + +// CopilotUsageBreakdown represents the breakdown of Copilot usage for a specific language and editor. +type CopilotUsageBreakdown struct { + Language string `json:"language"` + Editor string `json:"editor"` + SuggestionsCount int64 `json:"suggestions_count"` + AcceptancesCount int64 `json:"acceptances_count"` + LinesSuggested int64 `json:"lines_suggested"` + LinesAccepted int64 `json:"lines_accepted"` + ActiveUsers int `json:"active_users"` +} + +// CopilotUsageSummary represents the daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE across an organization. +type CopilotUsageSummary struct { + Day string `json:"day"` + TotalSuggestionsCount int64 `json:"total_suggestions_count"` + TotalAcceptancesCount int64 `json:"total_acceptances_count"` + TotalLinesSuggested int64 `json:"total_lines_suggested"` + TotalLinesAccepted int64 `json:"total_lines_accepted"` + TotalActiveUsers int64 `json:"total_active_users"` + TotalChatAcceptances int64 `json:"total_chat_acceptances"` + TotalChatTurns int64 `json:"total_chat_turns"` + TotalActiveChatUsers int `json:"total_active_chat_users"` + Breakdown []*CopilotUsageBreakdown `json:"breakdown"` +} + func (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error { // Using an alias to avoid infinite recursion when calling json.Unmarshal type alias CopilotSeatDetails @@ -79,6 +114,7 @@ func (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error { cp.LastActivityEditor = seatDetail.LastActivityEditor cp.CreatedAt = seatDetail.CreatedAt cp.UpdatedAt = seatDetail.UpdatedAt + cp.PlanType = seatDetail.PlanType switch v := seatDetail.Assignee.(type) { case map[string]interface{}: @@ -181,6 +217,34 @@ func (s *CopilotService) ListCopilotSeats(ctx context.Context, org string, opts return copilotSeats, resp, nil } +// ListCopilotEnterpriseSeats lists Copilot for Business seat assignments for an enterprise. +// +// To paginate through all seats, populate 'Page' with the number of the last page. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#list-all-copilot-seat-assignments-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/copilot/billing/seats +func (s *CopilotService) ListCopilotEnterpriseSeats(ctx context.Context, enterprise string, opts *ListOptions) (*ListCopilotSeatsResponse, *Response, error) { + u := fmt.Sprintf("enterprises/%v/copilot/billing/seats", enterprise) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var copilotSeats *ListCopilotSeatsResponse + resp, err := s.client.Do(ctx, req, &copilotSeats) + if err != nil { + return nil, resp, err + } + + return copilotSeats, resp, nil +} + // AddCopilotTeams adds teams to the Copilot for Business subscription for an organization. // // GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#add-teams-to-the-copilot-subscription-for-an-organization @@ -314,3 +378,107 @@ func (s *CopilotService) GetSeatDetails(ctx context.Context, org, user string) ( return seatDetails, resp, nil } + +// GetOrganizationUsage gets daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE across an organization. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-organization-members +// +//meta:operation GET /orgs/{org}/copilot/usage +func (s *CopilotService) GetOrganizationUsage(ctx context.Context, org string, opts *CopilotUsageSummaryListOptions) ([]*CopilotUsageSummary, *Response, error) { + u := fmt.Sprintf("orgs/%v/copilot/usage", org) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var usage []*CopilotUsageSummary + resp, err := s.client.Do(ctx, req, &usage) + if err != nil { + return nil, resp, err + } + + return usage, resp, nil +} + +// GetEnterpriseUsage gets daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE across an enterprise. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-enterprise-members +// +//meta:operation GET /enterprises/{enterprise}/copilot/usage +func (s *CopilotService) GetEnterpriseUsage(ctx context.Context, enterprise string, opts *CopilotUsageSummaryListOptions) ([]*CopilotUsageSummary, *Response, error) { + u := fmt.Sprintf("enterprises/%v/copilot/usage", enterprise) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var usage []*CopilotUsageSummary + resp, err := s.client.Do(ctx, req, &usage) + if err != nil { + return nil, resp, err + } + + return usage, resp, nil +} + +// GetEnterpriseTeamUsage gets daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE for a team in the enterprise. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-an-enterprise-team +// +//meta:operation GET /enterprises/{enterprise}/team/{team_slug}/copilot/usage +func (s *CopilotService) GetEnterpriseTeamUsage(ctx context.Context, enterprise, team string, opts *CopilotUsageSummaryListOptions) ([]*CopilotUsageSummary, *Response, error) { + u := fmt.Sprintf("enterprises/%v/team/%v/copilot/usage", enterprise, team) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var usage []*CopilotUsageSummary + resp, err := s.client.Do(ctx, req, &usage) + if err != nil { + return nil, resp, err + } + + return usage, resp, nil +} + +// GetOrganizationTeamUsage gets daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE for a team in the organization. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-a-team +// +//meta:operation GET /orgs/{org}/team/{team_slug}/copilot/usage +func (s *CopilotService) GetOrganizationTeamUsage(ctx context.Context, org, team string, opts *CopilotUsageSummaryListOptions) ([]*CopilotUsageSummary, *Response, error) { + u := fmt.Sprintf("orgs/%v/team/%v/copilot/usage", org, team) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var usage []*CopilotUsageSummary + resp, err := s.client.Do(ctx, req, &usage) + if err != nil { + return nil, resp, err + } + + return usage, resp, nil +} diff --git a/github/copilot_test.go b/github/copilot_test.go index f27350be79d..6ac689a9efe 100644 --- a/github/copilot_test.go +++ b/github/copilot_test.go @@ -9,6 +9,7 @@ import ( "context" "encoding/json" "fmt" + "log" "net/http" "testing" "time" @@ -609,6 +610,235 @@ func TestCopilotService_ListCopilotSeats(t *testing.T) { }) } +func TestCopilotService_ListCopilotEnterpriseSeats(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/enterprises/e/copilot/billing/seats", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{ + "per_page": "100", + "page": "1", + }) + fmt.Fprint(w, `{ + "total_seats": 2, + "seats": [ + { + "created_at": "2021-08-03T18:00:00-06:00", + "updated_at": "2021-09-23T15:00:00-06:00", + "pending_cancellation_date": null, + "last_activity_at": "2021-10-14T00:53:32-06:00", + "last_activity_editor": "vscode/1.77.3/copilot/1.86.82", + "plan_type": "business", + "assignee": { + "login": "octocat", + "id": 1, + "node_id": "MDQ6VXNlcjE=", + "avatar_url": "https://github.com/images/error/octocat_happy.gif", + "gravatar_id": "", + "url": "https://api.github.com/users/octocat", + "html_url": "https://github.com/octocat", + "followers_url": "https://api.github.com/users/octocat/followers", + "following_url": "https://api.github.com/users/octocat/following{/other_user}", + "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", + "organizations_url": "https://api.github.com/users/octocat/orgs", + "repos_url": "https://api.github.com/users/octocat/repos", + "events_url": "https://api.github.com/users/octocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/octocat/received_events", + "type": "User", + "site_admin": false + }, + "assigning_team": { + "id": 1, + "node_id": "MDQ6VGVhbTE=", + "url": "https://api.github.com/teams/1", + "html_url": "https://github.com/orgs/github/teams/justice-league", + "name": "Justice League", + "slug": "justice-league", + "description": "A great team.", + "privacy": "closed", + "notification_setting": "notifications_enabled", + "permission": "admin", + "members_url": "https://api.github.com/teams/1/members{/member}", + "repositories_url": "https://api.github.com/teams/1/repos", + "parent": null + } + }, + { + "created_at": "2021-09-23T18:00:00-06:00", + "updated_at": "2021-09-23T15:00:00-06:00", + "pending_cancellation_date": "2021-11-01", + "last_activity_at": "2021-10-13T00:53:32-06:00", + "last_activity_editor": "vscode/1.77.3/copilot/1.86.82", + "assignee": { + "login": "octokitten", + "id": 1, + "node_id": "MDQ76VNlcjE=", + "avatar_url": "https://github.com/images/error/octokitten_happy.gif", + "gravatar_id": "", + "url": "https://api.github.com/users/octokitten", + "html_url": "https://github.com/octokitten", + "followers_url": "https://api.github.com/users/octokitten/followers", + "following_url": "https://api.github.com/users/octokitten/following{/other_user}", + "gists_url": "https://api.github.com/users/octokitten/gists{/gist_id}", + "starred_url": "https://api.github.com/users/octokitten/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/octokitten/subscriptions", + "organizations_url": "https://api.github.com/users/octokitten/orgs", + "repos_url": "https://api.github.com/users/octokitten/repos", + "events_url": "https://api.github.com/users/octokitten/events{/privacy}", + "received_events_url": "https://api.github.com/users/octokitten/received_events", + "type": "User", + "site_admin": false + } + } + ] + }`) + }) + + tmp, err := time.Parse(time.RFC3339, "2021-08-03T18:00:00-06:00") + if err != nil { + panic(err) + } + createdAt1 := Timestamp{tmp} + + tmp, err = time.Parse(time.RFC3339, "2021-09-23T15:00:00-06:00") + if err != nil { + panic(err) + } + updatedAt1 := Timestamp{tmp} + + tmp, err = time.Parse(time.RFC3339, "2021-10-14T00:53:32-06:00") + if err != nil { + panic(err) + } + lastActivityAt1 := Timestamp{tmp} + + tmp, err = time.Parse(time.RFC3339, "2021-09-23T18:00:00-06:00") + if err != nil { + panic(err) + } + createdAt2 := Timestamp{tmp} + + tmp, err = time.Parse(time.RFC3339, "2021-09-23T15:00:00-06:00") + if err != nil { + panic(err) + } + updatedAt2 := Timestamp{tmp} + + tmp, err = time.Parse(time.RFC3339, "2021-10-13T00:53:32-06:00") + if err != nil { + panic(err) + } + lastActivityAt2 := Timestamp{tmp} + + ctx := context.Background() + opts := &ListOptions{Page: 1, PerPage: 100} + got, _, err := client.Copilot.ListCopilotEnterpriseSeats(ctx, "e", opts) + if err != nil { + t.Errorf("Copilot.ListCopilotEnterpriseSeats returned error: %v", err) + } + + want := &ListCopilotSeatsResponse{ + TotalSeats: 2, + Seats: []*CopilotSeatDetails{ + { + Assignee: &User{ + Login: String("octocat"), + ID: Int64(1), + NodeID: String("MDQ6VXNlcjE="), + AvatarURL: String("https://github.com/images/error/octocat_happy.gif"), + GravatarID: String(""), + URL: String("https://api.github.com/users/octocat"), + HTMLURL: String("https://github.com/octocat"), + FollowersURL: String("https://api.github.com/users/octocat/followers"), + FollowingURL: String("https://api.github.com/users/octocat/following{/other_user}"), + GistsURL: String("https://api.github.com/users/octocat/gists{/gist_id}"), + StarredURL: String("https://api.github.com/users/octocat/starred{/owner}{/repo}"), + SubscriptionsURL: String("https://api.github.com/users/octocat/subscriptions"), + OrganizationsURL: String("https://api.github.com/users/octocat/orgs"), + ReposURL: String("https://api.github.com/users/octocat/repos"), + EventsURL: String("https://api.github.com/users/octocat/events{/privacy}"), + ReceivedEventsURL: String("https://api.github.com/users/octocat/received_events"), + Type: String("User"), + SiteAdmin: Bool(false), + }, + AssigningTeam: &Team{ + ID: Int64(1), + NodeID: String("MDQ6VGVhbTE="), + URL: String("https://api.github.com/teams/1"), + HTMLURL: String("https://github.com/orgs/github/teams/justice-league"), + Name: String("Justice League"), + Slug: String("justice-league"), + Description: String("A great team."), + Privacy: String("closed"), + Permission: String("admin"), + MembersURL: String("https://api.github.com/teams/1/members{/member}"), + RepositoriesURL: String("https://api.github.com/teams/1/repos"), + Parent: nil, + }, + CreatedAt: &createdAt1, + UpdatedAt: &updatedAt1, + PendingCancellationDate: nil, + LastActivityAt: &lastActivityAt1, + LastActivityEditor: String("vscode/1.77.3/copilot/1.86.82"), + PlanType: String("business"), + }, + { + Assignee: &User{ + Login: String("octokitten"), + ID: Int64(1), + NodeID: String("MDQ76VNlcjE="), + AvatarURL: String("https://github.com/images/error/octokitten_happy.gif"), + GravatarID: String(""), + URL: String("https://api.github.com/users/octokitten"), + HTMLURL: String("https://github.com/octokitten"), + FollowersURL: String("https://api.github.com/users/octokitten/followers"), + FollowingURL: String("https://api.github.com/users/octokitten/following{/other_user}"), + GistsURL: String("https://api.github.com/users/octokitten/gists{/gist_id}"), + StarredURL: String("https://api.github.com/users/octokitten/starred{/owner}{/repo}"), + SubscriptionsURL: String("https://api.github.com/users/octokitten/subscriptions"), + OrganizationsURL: String("https://api.github.com/users/octokitten/orgs"), + ReposURL: String("https://api.github.com/users/octokitten/repos"), + EventsURL: String("https://api.github.com/users/octokitten/events{/privacy}"), + ReceivedEventsURL: String("https://api.github.com/users/octokitten/received_events"), + Type: String("User"), + SiteAdmin: Bool(false), + }, + AssigningTeam: nil, + CreatedAt: &createdAt2, + UpdatedAt: &updatedAt2, + PendingCancellationDate: String("2021-11-01"), + LastActivityAt: &lastActivityAt2, + LastActivityEditor: String("vscode/1.77.3/copilot/1.86.82"), + PlanType: nil, + }, + }, + } + + if !cmp.Equal(got, want) { + log.Printf("got: %+v", got.Seats[1]) + log.Printf("want: %+v", want.Seats[1]) + t.Errorf("Copilot.ListCopilotEnterpriseSeats returned %+v, want %+v", got, want) + } + + const methodName = "ListCopilotEnterpriseSeats" + + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Copilot.ListCopilotEnterpriseSeats(ctx, "\n", opts) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Copilot.ListCopilotEnterpriseSeats(ctx, "e", opts) + if got != nil { + t.Errorf("Copilot.ListCopilotEnterpriseSeats returned %+v, want nil", got) + } + return resp, err + }) +} + func TestCopilotService_AddCopilotTeams(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -896,3 +1126,807 @@ func TestCopilotService_GetSeatDetails(t *testing.T) { return resp, err }) } + +func TestCopilotService_GetOrganisationUsage(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/orgs/o/copilot/usage", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `[ + { + "day": "2023-10-15", + "total_suggestions_count": 1000, + "total_acceptances_count": 800, + "total_lines_suggested": 1800, + "total_lines_accepted": 1200, + "total_active_users": 10, + "total_chat_acceptances": 32, + "total_chat_turns": 200, + "total_active_chat_users": 4, + "breakdown": [ + { + "language": "python", + "editor": "vscode", + "suggestions_count": 300, + "acceptances_count": 250, + "lines_suggested": 900, + "lines_accepted": 700, + "active_users": 5 + }, + { + "language": "python", + "editor": "jetbrains", + "suggestions_count": 300, + "acceptances_count": 200, + "lines_suggested": 400, + "lines_accepted": 300, + "active_users": 2 + }, + { + "language": "ruby", + "editor": "vscode", + "suggestions_count": 400, + "acceptances_count": 350, + "lines_suggested": 500, + "lines_accepted": 200, + "active_users": 3 + } + ] + }, + { + "day": "2023-10-16", + "total_suggestions_count": 800, + "total_acceptances_count": 600, + "total_lines_suggested": 1100, + "total_lines_accepted": 700, + "total_active_users": 12, + "total_chat_acceptances": 57, + "total_chat_turns": 426, + "total_active_chat_users": 8, + "breakdown": [ + { + "language": "python", + "editor": "vscode", + "suggestions_count": 300, + "acceptances_count": 200, + "lines_suggested": 600, + "lines_accepted": 300, + "active_users": 2 + }, + { + "language": "python", + "editor": "jetbrains", + "suggestions_count": 300, + "acceptances_count": 150, + "lines_suggested": 300, + "lines_accepted": 250, + "active_users": 6 + }, + { + "language": "ruby", + "editor": "vscode", + "suggestions_count": 200, + "acceptances_count": 150, + "lines_suggested": 200, + "lines_accepted": 150, + "active_users": 3 + } + ] + } + ]`) + }) + + summaryOne := time.Date(2023, time.October, 15, 0, 0, 0, 0, time.UTC) + summaryTwoDate := time.Date(2023, time.October, 16, 0, 0, 0, 0, time.UTC) + ctx := context.Background() + got, _, err := client.Copilot.GetOrganizationUsage(ctx, "o", &CopilotUsageSummaryListOptions{}) + if err != nil { + t.Errorf("Copilot.GetOrganizationUsage returned error: %v", err) + } + + want := []*CopilotUsageSummary{ + { + Day: summaryOne.Format("2006-01-02"), + TotalSuggestionsCount: 1000, + TotalAcceptancesCount: 800, + TotalLinesSuggested: 1800, + TotalLinesAccepted: 1200, + TotalActiveUsers: 10, + TotalChatAcceptances: 32, + TotalChatTurns: 200, + TotalActiveChatUsers: 4, + Breakdown: []*CopilotUsageBreakdown{ + { + Language: "python", + Editor: "vscode", + SuggestionsCount: 300, + AcceptancesCount: 250, + LinesSuggested: 900, + LinesAccepted: 700, + ActiveUsers: 5, + }, + { + Language: "python", + Editor: "jetbrains", + SuggestionsCount: 300, + AcceptancesCount: 200, + LinesSuggested: 400, + LinesAccepted: 300, + ActiveUsers: 2, + }, + { + Language: "ruby", + Editor: "vscode", + SuggestionsCount: 400, + AcceptancesCount: 350, + LinesSuggested: 500, + LinesAccepted: 200, + ActiveUsers: 3, + }, + }, + }, + { + Day: summaryTwoDate.Format("2006-01-02"), + TotalSuggestionsCount: 800, + TotalAcceptancesCount: 600, + TotalLinesSuggested: 1100, + TotalLinesAccepted: 700, + TotalActiveUsers: 12, + TotalChatAcceptances: 57, + TotalChatTurns: 426, + TotalActiveChatUsers: 8, + Breakdown: []*CopilotUsageBreakdown{ + { + Language: "python", + Editor: "vscode", + SuggestionsCount: 300, + AcceptancesCount: 200, + LinesSuggested: 600, + LinesAccepted: 300, + ActiveUsers: 2, + }, + { + Language: "python", + Editor: "jetbrains", + SuggestionsCount: 300, + AcceptancesCount: 150, + LinesSuggested: 300, + LinesAccepted: 250, + ActiveUsers: 6, + }, + { + Language: "ruby", + Editor: "vscode", + SuggestionsCount: 200, + AcceptancesCount: 150, + LinesSuggested: 200, + LinesAccepted: 150, + ActiveUsers: 3, + }, + }, + }, + } + + if !cmp.Equal(got, want) { + t.Errorf("Copilot.GetOrganizationUsage returned %+v, want %+v", got, want) + } + + const methodName = "GetOrganizationUsage" + + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Copilot.GetOrganizationUsage(ctx, "\n", &CopilotUsageSummaryListOptions{}) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Copilot.GetOrganizationUsage(ctx, "o", &CopilotUsageSummaryListOptions{}) + if got != nil { + t.Errorf("Copilot.GetOrganizationUsage returned %+v, want nil", got) + } + return resp, err + }) +} + +func TestCopilotService_GetEnterpriseUsage(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/enterprises/e/copilot/usage", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `[ + { + "day": "2023-10-15", + "total_suggestions_count": 5000, + "total_acceptances_count": 3000, + "total_lines_suggested": 7000, + "total_lines_accepted": 3500, + "total_active_users": 15, + "total_chat_acceptances": 45, + "total_chat_turns": 350, + "total_active_chat_users": 8, + "breakdown": [ + { + "language": "python", + "editor": "vscode", + "suggestions_count": 3000, + "acceptances_count": 2000, + "lines_suggested": 3000, + "lines_accepted": 1500, + "active_users": 5 + }, + { + "language": "python", + "editor": "jetbrains", + "suggestions_count": 1000, + "acceptances_count": 500, + "lines_suggested": 2000, + "lines_accepted": 1000, + "active_users": 5 + }, + { + "language": "javascript", + "editor": "vscode", + "suggestions_count": 1000, + "acceptances_count": 500, + "lines_suggested": 2000, + "lines_accepted": 1000, + "active_users": 5 + } + ] + }, + { + "day": "2023-10-16", + "total_suggestions_count": 5200, + "total_acceptances_count": 5100, + "total_lines_suggested": 5300, + "total_lines_accepted": 5000, + "total_active_users": 15, + "total_chat_acceptances": 57, + "total_chat_turns": 455, + "total_active_chat_users": 12, + "breakdown": [ + { + "language": "python", + "editor": "vscode", + "suggestions_count": 3100, + "acceptances_count": 3000, + "lines_suggested": 3200, + "lines_accepted": 3100, + "active_users": 5 + }, + { + "language": "python", + "editor": "jetbrains", + "suggestions_count": 1100, + "acceptances_count": 1000, + "lines_suggested": 1200, + "lines_accepted": 1100, + "active_users": 5 + }, + { + "language": "javascript", + "editor": "vscode", + "suggestions_count": 1000, + "acceptances_count": 900, + "lines_suggested": 1100, + "lines_accepted": 1000, + "active_users": 5 + } + ] + } + ]`) + }) + + summaryOne := time.Date(2023, time.October, 15, 0, 0, 0, 0, time.UTC) + summaryTwoDate := time.Date(2023, time.October, 16, 0, 0, 0, 0, time.UTC) + ctx := context.Background() + got, _, err := client.Copilot.GetEnterpriseUsage(ctx, "e", &CopilotUsageSummaryListOptions{}) + if err != nil { + t.Errorf("Copilot.GetEnterpriseUsage returned error: %v", err) + } + + want := []*CopilotUsageSummary{ + { + Day: summaryOne.Format("2006-01-02"), + TotalSuggestionsCount: 5000, + TotalAcceptancesCount: 3000, + TotalLinesSuggested: 7000, + TotalLinesAccepted: 3500, + TotalActiveUsers: 15, + TotalChatAcceptances: 45, + TotalChatTurns: 350, + TotalActiveChatUsers: 8, + Breakdown: []*CopilotUsageBreakdown{ + { + Language: "python", + Editor: "vscode", + SuggestionsCount: 3000, + AcceptancesCount: 2000, + LinesSuggested: 3000, + LinesAccepted: 1500, + ActiveUsers: 5, + }, + { + Language: "python", + Editor: "jetbrains", + SuggestionsCount: 1000, + AcceptancesCount: 500, + LinesSuggested: 2000, + LinesAccepted: 1000, + ActiveUsers: 5, + }, + { + Language: "javascript", + Editor: "vscode", + SuggestionsCount: 1000, + AcceptancesCount: 500, + LinesSuggested: 2000, + LinesAccepted: 1000, + ActiveUsers: 5, + }, + }, + }, + { + Day: summaryTwoDate.Format("2006-01-02"), + TotalSuggestionsCount: 5200, + TotalAcceptancesCount: 5100, + TotalLinesSuggested: 5300, + TotalLinesAccepted: 5000, + TotalActiveUsers: 15, + TotalChatAcceptances: 57, + TotalChatTurns: 455, + TotalActiveChatUsers: 12, + Breakdown: []*CopilotUsageBreakdown{ + { + Language: "python", + Editor: "vscode", + SuggestionsCount: 3100, + AcceptancesCount: 3000, + LinesSuggested: 3200, + LinesAccepted: 3100, + ActiveUsers: 5, + }, + { + Language: "python", + Editor: "jetbrains", + SuggestionsCount: 1100, + AcceptancesCount: 1000, + LinesSuggested: 1200, + LinesAccepted: 1100, + ActiveUsers: 5, + }, + { + Language: "javascript", + Editor: "vscode", + SuggestionsCount: 1000, + AcceptancesCount: 900, + LinesSuggested: 1100, + LinesAccepted: 1000, + ActiveUsers: 5, + }, + }, + }, + } + + if !cmp.Equal(got, want) { + t.Errorf("Copilot.GetEnterpriseUsage returned %+v, want %+v", got, want) + } + + const methodName = "GetEnterpriseUsage" + + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Copilot.GetEnterpriseUsage(ctx, "\n", &CopilotUsageSummaryListOptions{}) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Copilot.GetEnterpriseUsage(ctx, "e", &CopilotUsageSummaryListOptions{}) + if got != nil { + t.Errorf("Copilot.GetEnterpriseUsage returned %+v, want nil", got) + } + return resp, err + }) +} + +func TestCopilotService_GetEnterpriseTeamUsage(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/enterprises/e/team/t/copilot/usage", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `[ + { + "day": "2023-10-15", + "total_suggestions_count": 1000, + "total_acceptances_count": 800, + "total_lines_suggested": 1800, + "total_lines_accepted": 1200, + "total_active_users": 10, + "total_chat_acceptances": 32, + "total_chat_turns": 200, + "total_active_chat_users": 4, + "breakdown": [ + { + "language": "python", + "editor": "vscode", + "suggestions_count": 300, + "acceptances_count": 250, + "lines_suggested": 900, + "lines_accepted": 700, + "active_users": 5 + }, + { + "language": "python", + "editor": "jetbrains", + "suggestions_count": 300, + "acceptances_count": 200, + "lines_suggested": 400, + "lines_accepted": 300, + "active_users": 2 + }, + { + "language": "ruby", + "editor": "vscode", + "suggestions_count": 400, + "acceptances_count": 350, + "lines_suggested": 500, + "lines_accepted": 200, + "active_users": 3 + } + ] + }, + { + "day": "2023-10-16", + "total_suggestions_count": 800, + "total_acceptances_count": 600, + "total_lines_suggested": 1100, + "total_lines_accepted": 700, + "total_active_users": 12, + "total_chat_acceptances": 57, + "total_chat_turns": 426, + "total_active_chat_users": 8, + "breakdown": [ + { + "language": "python", + "editor": "vscode", + "suggestions_count": 300, + "acceptances_count": 200, + "lines_suggested": 600, + "lines_accepted": 300, + "active_users": 2 + }, + { + "language": "python", + "editor": "jetbrains", + "suggestions_count": 300, + "acceptances_count": 150, + "lines_suggested": 300, + "lines_accepted": 250, + "active_users": 6 + }, + { + "language": "ruby", + "editor": "vscode", + "suggestions_count": 200, + "acceptances_count": 150, + "lines_suggested": 200, + "lines_accepted": 150, + "active_users": 3 + } + ] + } + ]`) + }) + + summaryOne := time.Date(2023, time.October, 15, 0, 0, 0, 0, time.UTC) + summaryTwoDate := time.Date(2023, time.October, 16, 0, 0, 0, 0, time.UTC) + ctx := context.Background() + got, _, err := client.Copilot.GetEnterpriseTeamUsage(ctx, "e", "t", &CopilotUsageSummaryListOptions{}) + if err != nil { + t.Errorf("Copilot.GetEnterpriseTeamUsage returned error: %v", err) + } + + want := []*CopilotUsageSummary{ + { + Day: summaryOne.Format("2006-01-02"), + TotalSuggestionsCount: 1000, + TotalAcceptancesCount: 800, + TotalLinesSuggested: 1800, + TotalLinesAccepted: 1200, + TotalActiveUsers: 10, + TotalChatAcceptances: 32, + TotalChatTurns: 200, + TotalActiveChatUsers: 4, + Breakdown: []*CopilotUsageBreakdown{ + { + Language: "python", + Editor: "vscode", + SuggestionsCount: 300, + AcceptancesCount: 250, + LinesSuggested: 900, + LinesAccepted: 700, + ActiveUsers: 5, + }, + { + Language: "python", + Editor: "jetbrains", + SuggestionsCount: 300, + AcceptancesCount: 200, + LinesSuggested: 400, + LinesAccepted: 300, + ActiveUsers: 2, + }, + { + Language: "ruby", + Editor: "vscode", + SuggestionsCount: 400, + AcceptancesCount: 350, + LinesSuggested: 500, + LinesAccepted: 200, + ActiveUsers: 3, + }, + }, + }, + { + Day: summaryTwoDate.Format("2006-01-02"), + TotalSuggestionsCount: 800, + TotalAcceptancesCount: 600, + TotalLinesSuggested: 1100, + TotalLinesAccepted: 700, + TotalActiveUsers: 12, + TotalChatAcceptances: 57, + TotalChatTurns: 426, + TotalActiveChatUsers: 8, + Breakdown: []*CopilotUsageBreakdown{ + { + Language: "python", + Editor: "vscode", + SuggestionsCount: 300, + AcceptancesCount: 200, + LinesSuggested: 600, + LinesAccepted: 300, + ActiveUsers: 2, + }, + { + Language: "python", + Editor: "jetbrains", + SuggestionsCount: 300, + AcceptancesCount: 150, + LinesSuggested: 300, + LinesAccepted: 250, + ActiveUsers: 6, + }, + { + Language: "ruby", + Editor: "vscode", + SuggestionsCount: 200, + AcceptancesCount: 150, + LinesSuggested: 200, + LinesAccepted: 150, + ActiveUsers: 3, + }, + }, + }, + } + + if !cmp.Equal(got, want) { + t.Errorf("Copilot.GetEnterpriseTeamUsage returned %+v, want %+v", got, want) + } + + const methodName = "GetEnterpriseTeamUsage" + + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Copilot.GetEnterpriseTeamUsage(ctx, "\n", "\n", &CopilotUsageSummaryListOptions{}) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Copilot.GetEnterpriseTeamUsage(ctx, "e", "t", &CopilotUsageSummaryListOptions{}) + if got != nil { + t.Errorf("Copilot.GetEnterpriseTeamUsage returned %+v, want nil", got) + } + return resp, err + }) +} + +func TestCopilotService_GetOrganizationTeamUsage(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/orgs/o/team/t/copilot/usage", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `[ + { + "day": "2023-10-15", + "total_suggestions_count": 1000, + "total_acceptances_count": 800, + "total_lines_suggested": 1800, + "total_lines_accepted": 1200, + "total_active_users": 10, + "total_chat_acceptances": 32, + "total_chat_turns": 200, + "total_active_chat_users": 4, + "breakdown": [ + { + "language": "python", + "editor": "vscode", + "suggestions_count": 300, + "acceptances_count": 250, + "lines_suggested": 900, + "lines_accepted": 700, + "active_users": 5 + }, + { + "language": "python", + "editor": "jetbrains", + "suggestions_count": 300, + "acceptances_count": 200, + "lines_suggested": 400, + "lines_accepted": 300, + "active_users": 2 + }, + { + "language": "ruby", + "editor": "vscode", + "suggestions_count": 400, + "acceptances_count": 350, + "lines_suggested": 500, + "lines_accepted": 200, + "active_users": 3 + } + ] + }, + { + "day": "2023-10-16", + "total_suggestions_count": 800, + "total_acceptances_count": 600, + "total_lines_suggested": 1100, + "total_lines_accepted": 700, + "total_active_users": 12, + "total_chat_acceptances": 57, + "total_chat_turns": 426, + "total_active_chat_users": 8, + "breakdown": [ + { + "language": "python", + "editor": "vscode", + "suggestions_count": 300, + "acceptances_count": 200, + "lines_suggested": 600, + "lines_accepted": 300, + "active_users": 2 + }, + { + "language": "python", + "editor": "jetbrains", + "suggestions_count": 300, + "acceptances_count": 150, + "lines_suggested": 300, + "lines_accepted": 250, + "active_users": 6 + }, + { + "language": "ruby", + "editor": "vscode", + "suggestions_count": 200, + "acceptances_count": 150, + "lines_suggested": 200, + "lines_accepted": 150, + "active_users": 3 + } + ] + } + ]`) + }) + + summaryOne := time.Date(2023, time.October, 15, 0, 0, 0, 0, time.UTC) + summaryTwoDate := time.Date(2023, time.October, 16, 0, 0, 0, 0, time.UTC) + ctx := context.Background() + got, _, err := client.Copilot.GetOrganizationTeamUsage(ctx, "o", "t", &CopilotUsageSummaryListOptions{}) + if err != nil { + t.Errorf("Copilot.GetOrganizationTeamUsage returned error: %v", err) + } + + want := []*CopilotUsageSummary{ + { + Day: summaryOne.Format("2006-01-02"), + TotalSuggestionsCount: 1000, + TotalAcceptancesCount: 800, + TotalLinesSuggested: 1800, + TotalLinesAccepted: 1200, + TotalActiveUsers: 10, + TotalChatAcceptances: 32, + TotalChatTurns: 200, + TotalActiveChatUsers: 4, + Breakdown: []*CopilotUsageBreakdown{ + { + Language: "python", + Editor: "vscode", + SuggestionsCount: 300, + AcceptancesCount: 250, + LinesSuggested: 900, + LinesAccepted: 700, + ActiveUsers: 5, + }, + { + Language: "python", + Editor: "jetbrains", + SuggestionsCount: 300, + AcceptancesCount: 200, + LinesSuggested: 400, + LinesAccepted: 300, + ActiveUsers: 2, + }, + { + Language: "ruby", + Editor: "vscode", + SuggestionsCount: 400, + AcceptancesCount: 350, + LinesSuggested: 500, + LinesAccepted: 200, + ActiveUsers: 3, + }, + }, + }, + { + Day: summaryTwoDate.Format("2006-01-02"), + TotalSuggestionsCount: 800, + TotalAcceptancesCount: 600, + TotalLinesSuggested: 1100, + TotalLinesAccepted: 700, + TotalActiveUsers: 12, + TotalChatAcceptances: 57, + TotalChatTurns: 426, + TotalActiveChatUsers: 8, + Breakdown: []*CopilotUsageBreakdown{ + { + Language: "python", + Editor: "vscode", + SuggestionsCount: 300, + AcceptancesCount: 200, + LinesSuggested: 600, + LinesAccepted: 300, + ActiveUsers: 2, + }, + { + Language: "python", + Editor: "jetbrains", + SuggestionsCount: 300, + AcceptancesCount: 150, + LinesSuggested: 300, + LinesAccepted: 250, + ActiveUsers: 6, + }, + { + Language: "ruby", + Editor: "vscode", + SuggestionsCount: 200, + AcceptancesCount: 150, + LinesSuggested: 200, + LinesAccepted: 150, + ActiveUsers: 3, + }, + }, + }, + } + + if !cmp.Equal(got, want) { + t.Errorf("Copilot.GetOrganizationTeamUsage returned %+v, want %+v", got, want) + } + + const methodName = "GetOrganizationTeamUsage" + + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Copilot.GetOrganizationTeamUsage(ctx, "\n", "\n", &CopilotUsageSummaryListOptions{}) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Copilot.GetOrganizationTeamUsage(ctx, "o", "t", &CopilotUsageSummaryListOptions{}) + if got != nil { + t.Errorf("Copilot.GetOrganizationTeamUsage returned %+v, want nil", got) + } + return resp, err + }) +} diff --git a/github/github-accessors.go b/github/github-accessors.go index 7995145faa9..a43ce8b9bda 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -4294,6 +4294,14 @@ func (c *CopilotSeatDetails) GetPendingCancellationDate() string { return *c.PendingCancellationDate } +// GetPlanType returns the PlanType field if it's non-nil, zero value otherwise. +func (c *CopilotSeatDetails) GetPlanType() string { + if c == nil || c.PlanType == nil { + return "" + } + return *c.PlanType +} + // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. func (c *CopilotSeatDetails) GetUpdatedAt() Timestamp { if c == nil || c.UpdatedAt == nil { @@ -4302,6 +4310,22 @@ func (c *CopilotSeatDetails) GetUpdatedAt() Timestamp { return *c.UpdatedAt } +// GetSince returns the Since field if it's non-nil, zero value otherwise. +func (c *CopilotUsageSummaryListOptions) GetSince() time.Time { + if c == nil || c.Since == nil { + return time.Time{} + } + return *c.Since +} + +// GetUntil returns the Until field if it's non-nil, zero value otherwise. +func (c *CopilotUsageSummaryListOptions) GetUntil() time.Time { + if c == nil || c.Until == nil { + return time.Time{} + } + return *c.Until +} + // GetCompletedAt returns the CompletedAt field if it's non-nil, zero value otherwise. func (c *CreateCheckRunOptions) GetCompletedAt() Timestamp { if c == nil || c.CompletedAt == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index bc6e2be8d01..a4d5315ba41 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -5573,6 +5573,17 @@ func TestCopilotSeatDetails_GetPendingCancellationDate(tt *testing.T) { c.GetPendingCancellationDate() } +func TestCopilotSeatDetails_GetPlanType(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CopilotSeatDetails{PlanType: &zeroValue} + c.GetPlanType() + c = &CopilotSeatDetails{} + c.GetPlanType() + c = nil + c.GetPlanType() +} + func TestCopilotSeatDetails_GetUpdatedAt(tt *testing.T) { tt.Parallel() var zeroValue Timestamp @@ -5584,6 +5595,28 @@ func TestCopilotSeatDetails_GetUpdatedAt(tt *testing.T) { c.GetUpdatedAt() } +func TestCopilotUsageSummaryListOptions_GetSince(tt *testing.T) { + tt.Parallel() + var zeroValue time.Time + c := &CopilotUsageSummaryListOptions{Since: &zeroValue} + c.GetSince() + c = &CopilotUsageSummaryListOptions{} + c.GetSince() + c = nil + c.GetSince() +} + +func TestCopilotUsageSummaryListOptions_GetUntil(tt *testing.T) { + tt.Parallel() + var zeroValue time.Time + c := &CopilotUsageSummaryListOptions{Until: &zeroValue} + c.GetUntil() + c = &CopilotUsageSummaryListOptions{} + c.GetUntil() + c = nil + c.GetUntil() +} + func TestCreateCheckRunOptions_GetCompletedAt(tt *testing.T) { tt.Parallel() var zeroValue Timestamp From 8fbbcf847f43db1d0c4c31e2d3f0531bef59b73c Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Mon, 14 Oct 2024 13:50:27 +0300 Subject: [PATCH 546/751] chore: Remove deprecated build constraints (#3306) --- README.md | 3 ++- github/gen-accessors.go | 1 - github/gen-stringify-test.go | 1 - github/with_appengine.go | 1 - github/without_appengine.go | 1 - test/integration/activity_test.go | 1 - test/integration/audit_log_test.go | 1 - test/integration/authorizations_test.go | 1 - test/integration/github_test.go | 1 - test/integration/issues_test.go | 1 - test/integration/misc_test.go | 1 - test/integration/pulls_test.go | 1 - test/integration/repos_test.go | 1 - test/integration/users_test.go | 1 - 14 files changed, 2 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 1126418c54a..1ed18de71f2 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,8 @@ go-github is a Go client library for accessing the [GitHub API v3][]. -Currently, **go-github tests against Go version 1.22 and greater**. go-github tracks +**go-github requires Go version 1.17 and greater** and +the library is tested against Go version 1.22 and greater. go-github tracks [Go's version support policy][support-policy]. We do our best not to break older versions of Go if we don't have to, but due to tooling constraints, we don't always test older versions. diff --git a/github/gen-accessors.go b/github/gen-accessors.go index b3d78b837a4..d5d8e5cebd1 100644 --- a/github/gen-accessors.go +++ b/github/gen-accessors.go @@ -4,7 +4,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore // gen-accessors generates accessor methods for structs with pointer fields. // diff --git a/github/gen-stringify-test.go b/github/gen-stringify-test.go index 44e70d5db25..cbcea53233b 100644 --- a/github/gen-stringify-test.go +++ b/github/gen-stringify-test.go @@ -4,7 +4,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore // gen-stringify-test generates test methods to test the String methods. // diff --git a/github/with_appengine.go b/github/with_appengine.go index 9053ce1059b..9bb95b8c89c 100644 --- a/github/with_appengine.go +++ b/github/with_appengine.go @@ -4,7 +4,6 @@ // license that can be found in the LICENSE file. //go:build appengine -// +build appengine // This file provides glue for making github work on App Engine. diff --git a/github/without_appengine.go b/github/without_appengine.go index 0024ae4157e..bfdb18ecbb2 100644 --- a/github/without_appengine.go +++ b/github/without_appengine.go @@ -4,7 +4,6 @@ // license that can be found in the LICENSE file. //go:build !appengine -// +build !appengine // This file provides glue for making github work without App Engine. diff --git a/test/integration/activity_test.go b/test/integration/activity_test.go index 94b054f737b..09b2601d571 100644 --- a/test/integration/activity_test.go +++ b/test/integration/activity_test.go @@ -4,7 +4,6 @@ // license that can be found in the LICENSE file. //go:build integration -// +build integration package integration diff --git a/test/integration/audit_log_test.go b/test/integration/audit_log_test.go index a7f79b746b5..34fd5cdffb3 100644 --- a/test/integration/audit_log_test.go +++ b/test/integration/audit_log_test.go @@ -4,7 +4,6 @@ // license that can be found in the LICENSE file. //go:build integration -// +build integration package integration diff --git a/test/integration/authorizations_test.go b/test/integration/authorizations_test.go index cf0e92eb29d..7b409d2c982 100644 --- a/test/integration/authorizations_test.go +++ b/test/integration/authorizations_test.go @@ -4,7 +4,6 @@ // license that can be found in the LICENSE file. //go:build integration -// +build integration package integration diff --git a/test/integration/github_test.go b/test/integration/github_test.go index 07096338f41..64f379a732e 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -4,7 +4,6 @@ // license that can be found in the LICENSE file. //go:build integration -// +build integration package integration diff --git a/test/integration/issues_test.go b/test/integration/issues_test.go index c151ae482bd..9a5d95ca3bf 100644 --- a/test/integration/issues_test.go +++ b/test/integration/issues_test.go @@ -4,7 +4,6 @@ // license that can be found in the LICENSE file. //go:build integration -// +build integration package integration diff --git a/test/integration/misc_test.go b/test/integration/misc_test.go index 0e9ef6e01e7..3390666c57c 100644 --- a/test/integration/misc_test.go +++ b/test/integration/misc_test.go @@ -4,7 +4,6 @@ // license that can be found in the LICENSE file. //go:build integration -// +build integration package integration diff --git a/test/integration/pulls_test.go b/test/integration/pulls_test.go index c054f55d41e..8de93956135 100644 --- a/test/integration/pulls_test.go +++ b/test/integration/pulls_test.go @@ -4,7 +4,6 @@ // license that can be found in the LICENSE file. //go:build integration -// +build integration package integration diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index ec6a8157f3c..be9cc6a0960 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -4,7 +4,6 @@ // license that can be found in the LICENSE file. //go:build integration -// +build integration package integration diff --git a/test/integration/users_test.go b/test/integration/users_test.go index fb3bdac12df..6d1e834ad34 100644 --- a/test/integration/users_test.go +++ b/test/integration/users_test.go @@ -4,7 +4,6 @@ // license that can be found in the LICENSE file. //go:build integration -// +build integration package integration From 8ea16b939809ee06e01354f8923c0ace033217fb Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Mon, 14 Oct 2024 17:41:16 +0300 Subject: [PATCH 547/751] refactor: Replace 'print' with 'fmt.Print' (#3327) --- test/fields/fields.go | 2 +- test/integration/github_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/fields/fields.go b/test/fields/fields.go index 7bfa021758d..7979ccc838f 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -39,7 +39,7 @@ func main() { token := os.Getenv("GITHUB_AUTH_TOKEN") if token == "" { - print("!!! No OAuth token. Some tests won't run. !!!\n\n") + fmt.Print("!!! No OAuth token. Some tests won't run. !!!\n\n") client = github.NewClient(nil) } else { client = github.NewClient(nil).WithAuthToken(token) diff --git a/test/integration/github_test.go b/test/integration/github_test.go index 64f379a732e..48745706002 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -28,7 +28,7 @@ var ( func init() { token := os.Getenv("GITHUB_AUTH_TOKEN") if token == "" { - print("!!! No OAuth token. Some tests won't run. !!!\n\n") + fmt.Print("!!! No OAuth token. Some tests won't run. !!!\n\n") client = github.NewClient(nil) } else { client = github.NewClient(nil).WithAuthToken(token) From b93ab9149bff48bea891e7391e10f20c4e6ab9d5 Mon Sep 17 00:00:00 2001 From: Udit Namdev <35065474+unamdev0@users.noreply.github.com> Date: Wed, 16 Oct 2024 16:48:13 +0530 Subject: [PATCH 548/751] Add Webhook for Repository ruleset (#3305) Fixes: #3295. --- github/event_types.go | 16 + github/event_types_test.go | 1777 +++++++++++++++++++++++++++++++ github/github-accessors.go | 544 ++++++++++ github/github-accessors_test.go | 571 ++++++++++ github/messages.go | 1 + github/messages_test.go | 4 + github/repos_rules.go | 225 +++- github/repos_rules_test.go | 2 +- 8 files changed, 3137 insertions(+), 3 deletions(-) diff --git a/github/event_types.go b/github/event_types.go index fbe56b20d06..64726d77395 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -1505,6 +1505,22 @@ type RepositoryImportEvent struct { Sender *User `json:"sender,omitempty"` } +// RepositoryRulesetEvent triggers whenever there is a change to the repository's ruleset configuration. +// +// This can include updates to protection rules, required status checks, code owners, or other related configurations. +// +// GitHub API docs: https://docs.github.com/en/webhooks/webhook-events-and-payloads#repository_ruleset +type RepositoryRulesetEvent struct { + Action *string `json:"action,omitempty"` + Enterprise *Enterprise `json:"enterprise,omitempty"` + Installation *Installation `json:"installation,omitempty"` + Organization *Organization `json:"organization,omitempty"` + Repository *Repository `json:"repository,omitempty"` + RepositoryRuleset *RepositoryRuleset `json:"repository_ruleset"` + Changes *RepositoryRulesetEditedChanges `json:"changes,omitempty"` + Sender *User `json:"sender"` +} + // RepositoryVulnerabilityAlertEvent is triggered when a security alert is created, dismissed, or resolved. // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#repository_vulnerability_alert diff --git a/github/event_types_test.go b/github/event_types_test.go index 474c9ceb3dc..71c8ac3df2e 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -9506,6 +9506,1783 @@ func TestReleaseEvent_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } +func TestRepositoryRulesetEvent_Marshal(t *testing.T) { + t.Parallel() + testJSONMarshal(t, &RepositoryRulesetEvent{}, "{}") + + l := make(map[string]interface{}) + l["key"] = "value" + + jsonMsg, _ := json.Marshal(&l) + + u := &RepositoryRulesetEvent{ + Action: String("a"), + Enterprise: &Enterprise{ + ID: Int(1), + Slug: String("s"), + Name: String("n"), + NodeID: String("nid"), + AvatarURL: String("au"), + Description: String("d"), + WebsiteURL: String("wu"), + HTMLURL: String("hu"), + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + }, + Installation: &Installation{ + ID: Int64(1), + NodeID: String("nid"), + AppID: Int64(1), + AppSlug: String("as"), + TargetID: Int64(1), + Account: &User{ + Login: String("l"), + ID: Int64(1), + URL: String("u"), + AvatarURL: String("a"), + GravatarID: String("g"), + Name: String("n"), + Company: String("c"), + Blog: String("b"), + Location: String("l"), + Email: String("e"), + Hireable: Bool(true), + Bio: String("b"), + TwitterUsername: String("t"), + PublicRepos: Int(1), + Followers: Int(1), + Following: Int(1), + CreatedAt: &Timestamp{referenceTime}, + SuspendedAt: &Timestamp{referenceTime}, + }, + AccessTokensURL: String("atu"), + RepositoriesURL: String("ru"), + HTMLURL: String("hu"), + TargetType: String("tt"), + SingleFileName: String("sfn"), + RepositorySelection: String("rs"), + Events: []string{"e"}, + SingleFilePaths: []string{"s"}, + Permissions: &InstallationPermissions{ + Actions: String("a"), + Administration: String("ad"), + Checks: String("c"), + Contents: String("co"), + ContentReferences: String("cr"), + Deployments: String("d"), + Environments: String("e"), + Issues: String("i"), + Metadata: String("md"), + Members: String("m"), + OrganizationAdministration: String("oa"), + OrganizationHooks: String("oh"), + OrganizationPlan: String("op"), + OrganizationPreReceiveHooks: String("opr"), + OrganizationProjects: String("op"), + OrganizationSecrets: String("os"), + OrganizationSelfHostedRunners: String("osh"), + OrganizationUserBlocking: String("oub"), + Packages: String("pkg"), + Pages: String("pg"), + PullRequests: String("pr"), + RepositoryHooks: String("rh"), + RepositoryProjects: String("rp"), + RepositoryPreReceiveHooks: String("rprh"), + Secrets: String("s"), + SecretScanningAlerts: String("ssa"), + SecurityEvents: String("se"), + SingleFile: String("sf"), + Statuses: String("s"), + TeamDiscussions: String("td"), + VulnerabilityAlerts: String("va"), + Workflows: String("w"), + }, + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + HasMultipleSingleFiles: Bool(false), + SuspendedBy: &User{ + Login: String("l"), + ID: Int64(1), + URL: String("u"), + AvatarURL: String("a"), + GravatarID: String("g"), + Name: String("n"), + Company: String("c"), + Blog: String("b"), + Location: String("l"), + Email: String("e"), + Hireable: Bool(true), + Bio: String("b"), + TwitterUsername: String("t"), + PublicRepos: Int(1), + Followers: Int(1), + Following: Int(1), + CreatedAt: &Timestamp{referenceTime}, + SuspendedAt: &Timestamp{referenceTime}, + }, + SuspendedAt: &Timestamp{referenceTime}, + }, + Organization: &Organization{ + BillingEmail: String("be"), + Blog: String("b"), + Company: String("c"), + Email: String("e"), + TwitterUsername: String("tu"), + Location: String("loc"), + Name: String("n"), + Description: String("d"), + IsVerified: Bool(true), + HasOrganizationProjects: Bool(true), + HasRepositoryProjects: Bool(true), + DefaultRepoPermission: String("drp"), + MembersCanCreateRepos: Bool(true), + MembersCanCreateInternalRepos: Bool(true), + MembersCanCreatePrivateRepos: Bool(true), + MembersCanCreatePublicRepos: Bool(false), + MembersAllowedRepositoryCreationType: String("marct"), + MembersCanCreatePages: Bool(true), + MembersCanCreatePublicPages: Bool(false), + MembersCanCreatePrivatePages: Bool(true), + }, + Repository: &Repository{ + ID: Int64(1), + URL: String("u"), + Name: String("n"), + }, + RepositoryRuleset: &RepositoryRuleset{ + ID: 1, + Name: "n", + Target: String("branch"), + SourceType: String("Repository"), + Source: "s", + Enforcement: "disabled", + BypassActors: []*BypassActor{ + { + ActorID: Int64(234), + ActorType: String("Team"), + BypassMode: String("Always"), + }, + }, + CurrentUserCanBypass: String("always"), + NodeID: String("n"), + Links: &RepositoryRulesetLink{ + Self: &RulesetLink{ + HRef: String("href"), + }, + HTML: &RulesetLink{ + HRef: String("href"), + }, + }, + Conditions: json.RawMessage(jsonMsg), + Rules: []*RepositoryRulesetRule{ + { + Creation: &RepositoryRulesetRuleType{ + Type: "creation", + }, + Update: &RepositoryRulesetUpdateRule{ + Type: "update", + Parameters: &UpdateAllowsFetchAndMergeRuleParameters{ + UpdateAllowsFetchAndMerge: true, + }, + }, + Deletion: &RepositoryRulesetRuleType{ + Type: "deletion", + }, + RequiredLinearHistory: &RepositoryRulesetRuleType{ + Type: "required_linear_history", + }, + MergeQueue: &RepositoryRulesetMergeQueueRule{ + Type: "merge_queue", + Parameters: &MergeQueueRuleParameters{ + CheckResponseTimeoutMinutes: 35, + GroupingStrategy: "HEADGREEN", + MaxEntriesToBuild: 8, + MaxEntriesToMerge: 4, + MergeMethod: "SQUASH", + MinEntriesToMerge: 2, + MinEntriesToMergeWaitMinutes: 13, + }, + }, + RequiredDeployments: &RepositoryRulesetRequiredDeploymentsRule{ + Type: "required_deployments", + Parameters: &RequiredDeploymentEnvironmentsRuleParameters{ + RequiredDeploymentEnvironments: []string{"test"}, + }, + }, + RequiredSignatures: &RepositoryRulesetRuleType{ + Type: "required_signatures", + }, + PullRequest: &RepositoryRulesetPullRequestRule{ + Type: "pull_request", + Parameters: &PullRequestRuleParameters{ + RequireCodeOwnerReview: true, + RequireLastPushApproval: true, + RequiredApprovingReviewCount: 1, + RequiredReviewThreadResolution: true, + DismissStaleReviewsOnPush: true, + }, + }, + RequiredStatusChecks: &RepositoryRulesetRequiredStatusChecksRule{ + Type: "required_status_checks", + Parameters: &RequiredStatusChecksRuleParameters{ + RequiredStatusChecks: []RuleRequiredStatusChecks{ + { + Context: "test", + IntegrationID: Int64(1), + }, + }, + StrictRequiredStatusChecksPolicy: true, + }, + }, + NonFastForward: &RepositoryRulesetRuleType{ + Type: "non_fast_forward", + }, + CommitMessagePattern: &RepositoryRulesetPatternRule{ + Type: "commit_message_pattern", + Parameters: &RulePatternParameters{ + Name: String("avoid test commits"), + Negate: Bool(true), + Operator: "starts_with", + Pattern: "[test]", + }, + }, + CommitAuthorEmailPattern: &RepositoryRulesetPatternRule{ + Type: "commit_author_email_pattern", + Parameters: &RulePatternParameters{ + Operator: "contains", + Pattern: "github", + }, + }, + CommitterEmailPattern: &RepositoryRulesetPatternRule{ + Type: "committer_email_pattern", + Parameters: &RulePatternParameters{ + Name: String("avoid commit emails"), + Negate: Bool(true), + Operator: "ends_with", + Pattern: "abc", + }, + }, + BranchNamePattern: &RepositoryRulesetPatternRule{ + Type: "branch_name_pattern", + Parameters: &RulePatternParameters{ + Name: String("avoid branch names"), + Negate: Bool(true), + Operator: "regex", + Pattern: "github$", + }, + }, + TagNamePattern: &RepositoryRulesetPatternRule{ + Type: "tag_name_pattern", + Parameters: &RulePatternParameters{ + Name: String("avoid tag names"), + Negate: Bool(true), + Operator: "contains", + Pattern: "github", + }, + }, + FilePathRestriction: &RepositoryRulesetFilePathRestrictionRule{ + Type: "file_path_restriction", + Parameters: &RuleFileParameters{ + RestrictedFilePaths: &[]string{"/a/file"}, + }, + }, + MaxFilePathLength: &RepositoryRulesetMaxFilePathLengthRule{ + Type: "max_file_path_length", + Parameters: &RuleMaxFilePathLengthParameters{ + MaxFilePathLength: 255, + }, + }, + FileExtensionRestriction: &RepositoryRulesetFileExtensionRestrictionRule{ + Type: "file_extension_restriction", + Parameters: &RuleFileExtensionRestrictionParameters{ + RestrictedFileExtensions: []string{".exe"}, + }, + }, + MaxFileSize: &RepositoryRulesetMaxFileSizeRule{ + Type: "max_file_size", + Parameters: &RuleMaxFileSizeParameters{ + MaxFileSize: 1024, + }, + }, + Workflows: &RepositoryRulesetWorkflowsRule{ + Type: "workflows", + Parameters: &RequiredWorkflowsRuleParameters{ + RequiredWorkflows: []*RuleRequiredWorkflow{ + { + Path: ".github/workflows/test.yml", + RepositoryID: Int64(1), + }, + }, + }, + }, + CodeScanning: &RepositoryRulesetCodeScanningRule{ + Type: "code_scanning", + Parameters: &RuleCodeScanningParameters{ + CodeScanningTools: []*CodeScanningTool{{ + AlertsThreshold: "alert", + SecurityAlertsThreshold: "security", + Tool: "tool", + }}, + }, + }, + }, + }, + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + }, + Changes: &RepositoryRulesetEditedChanges{ + Name: &RepositoryRulesetEditedSource{ + From: String("f"), + }, + Enforcement: &RepositoryRulesetEditedSource{ + From: String("e"), + }, + Conditions: &RepositoryRulesetEditedConditions{ + Added: []*RepositoryRulesetRefCondition{ + { + RefName: &RulesetRefConditionParameters{ + Include: []string{"refs/heads/main", "refs/heads/master"}, + Exclude: []string{"refs/heads/dev*"}, + }, + }, + }, + Deleted: []*RepositoryRulesetRefCondition{ + { + RefName: &RulesetRefConditionParameters{ + Include: []string{"refs/heads/main", "refs/heads/master"}, + Exclude: []string{"refs/heads/dev*"}, + }, + }, + }, + Updated: []*RepositoryRulesetEditedUpdatedConditions{ + { + Condition: &RepositoryRulesetRefCondition{ + RefName: &RulesetRefConditionParameters{ + Include: []string{"refs/heads/main", "refs/heads/master"}, + Exclude: []string{"refs/heads/dev*"}, + }, + }, + Changes: &RepositoryRulesetUpdatedConditionsEdited{ + ConditionType: &RepositoryRulesetEditedSource{ + From: String("c"), + }, + Target: &RepositoryRulesetEditedSource{ + From: String("t"), + }, + Include: &RepositoryRulesetEditedSources{ + From: []string{"from"}, + }, + Exclude: &RepositoryRulesetEditedSources{ + From: []string{"to"}, + }, + }, + }, + }, + }, + Rules: &RepositoryRulesetEditedRules{ + Added: []*RepositoryRulesetRule{ + //Creating just one object with all the possible rules for testing + { + Creation: &RepositoryRulesetRuleType{ + Type: "creation", + }, + Update: &RepositoryRulesetUpdateRule{ + Type: "update", + Parameters: &UpdateAllowsFetchAndMergeRuleParameters{ + UpdateAllowsFetchAndMerge: true, + }, + }, + Deletion: &RepositoryRulesetRuleType{ + Type: "deletion", + }, + RequiredLinearHistory: &RepositoryRulesetRuleType{ + Type: "required_linear_history", + }, + MergeQueue: &RepositoryRulesetMergeQueueRule{ + Type: "merge_queue", + Parameters: &MergeQueueRuleParameters{ + CheckResponseTimeoutMinutes: 35, + GroupingStrategy: "HEADGREEN", + MaxEntriesToBuild: 8, + MaxEntriesToMerge: 4, + MergeMethod: "SQUASH", + MinEntriesToMerge: 2, + MinEntriesToMergeWaitMinutes: 13, + }, + }, + RequiredDeployments: &RepositoryRulesetRequiredDeploymentsRule{ + Type: "required_deployments", + Parameters: &RequiredDeploymentEnvironmentsRuleParameters{ + RequiredDeploymentEnvironments: []string{"test"}, + }, + }, + RequiredSignatures: &RepositoryRulesetRuleType{ + Type: "required_signatures", + }, + PullRequest: &RepositoryRulesetPullRequestRule{ + Type: "pull_request", + Parameters: &PullRequestRuleParameters{ + RequireCodeOwnerReview: true, + RequireLastPushApproval: true, + RequiredApprovingReviewCount: 1, + RequiredReviewThreadResolution: true, + DismissStaleReviewsOnPush: true, + }, + }, + RequiredStatusChecks: &RepositoryRulesetRequiredStatusChecksRule{ + Type: "required_status_checks", + Parameters: &RequiredStatusChecksRuleParameters{ + RequiredStatusChecks: []RuleRequiredStatusChecks{ + { + Context: "test", + IntegrationID: Int64(1), + }, + }, + StrictRequiredStatusChecksPolicy: true, + }, + }, + NonFastForward: &RepositoryRulesetRuleType{ + Type: "non_fast_forward", + }, + CommitMessagePattern: &RepositoryRulesetPatternRule{ + Type: "commit_message_pattern", + Parameters: &RulePatternParameters{ + Name: String("avoid test commits"), + Negate: Bool(true), + Operator: "starts_with", + Pattern: "[test]", + }, + }, + CommitAuthorEmailPattern: &RepositoryRulesetPatternRule{ + Type: "commit_author_email_pattern", + Parameters: &RulePatternParameters{ + Operator: "contains", + Pattern: "github", + }, + }, + CommitterEmailPattern: &RepositoryRulesetPatternRule{ + Type: "committer_email_pattern", + Parameters: &RulePatternParameters{ + Name: String("avoid commit emails"), + Negate: Bool(true), + Operator: "ends_with", + Pattern: "abc", + }, + }, + BranchNamePattern: &RepositoryRulesetPatternRule{ + Type: "branch_name_pattern", + Parameters: &RulePatternParameters{ + Name: String("avoid branch names"), + Negate: Bool(true), + Operator: "regex", + Pattern: "github$", + }, + }, + TagNamePattern: &RepositoryRulesetPatternRule{ + Type: "tag_name_pattern", + Parameters: &RulePatternParameters{ + Name: String("avoid tag names"), + Negate: Bool(true), + Operator: "contains", + Pattern: "github", + }, + }, + FilePathRestriction: &RepositoryRulesetFilePathRestrictionRule{ + Type: "file_path_restriction", + Parameters: &RuleFileParameters{ + RestrictedFilePaths: &[]string{"/a/file"}, + }, + }, + MaxFilePathLength: &RepositoryRulesetMaxFilePathLengthRule{ + Type: "max_file_path_length", + Parameters: &RuleMaxFilePathLengthParameters{ + MaxFilePathLength: 255, + }, + }, + FileExtensionRestriction: &RepositoryRulesetFileExtensionRestrictionRule{ + Type: "file_extension_restriction", + Parameters: &RuleFileExtensionRestrictionParameters{ + RestrictedFileExtensions: []string{".exe"}, + }, + }, + MaxFileSize: &RepositoryRulesetMaxFileSizeRule{ + Type: "max_file_size", + Parameters: &RuleMaxFileSizeParameters{ + MaxFileSize: 1024, + }, + }, + Workflows: &RepositoryRulesetWorkflowsRule{ + Type: "workflows", + Parameters: &RequiredWorkflowsRuleParameters{ + RequiredWorkflows: []*RuleRequiredWorkflow{ + { + Path: ".github/workflows/test.yml", + RepositoryID: Int64(1), + }, + }, + }, + }, + CodeScanning: &RepositoryRulesetCodeScanningRule{ + Type: "code_scanning", + Parameters: &RuleCodeScanningParameters{ + CodeScanningTools: []*CodeScanningTool{{ + AlertsThreshold: "alert", + SecurityAlertsThreshold: "security", + Tool: "tool", + }}, + }, + }, + }, + }, + Deleted: []*RepositoryRulesetRule{ + //Creating just one object with all the possible rules for testing + { + Creation: &RepositoryRulesetRuleType{ + Type: "creation", + }, + Update: &RepositoryRulesetUpdateRule{ + Type: "update", + Parameters: &UpdateAllowsFetchAndMergeRuleParameters{ + UpdateAllowsFetchAndMerge: true, + }, + }, + Deletion: &RepositoryRulesetRuleType{ + Type: "deletion", + }, + RequiredLinearHistory: &RepositoryRulesetRuleType{ + Type: "required_linear_history", + }, + MergeQueue: &RepositoryRulesetMergeQueueRule{ + Type: "merge_queue", + Parameters: &MergeQueueRuleParameters{ + CheckResponseTimeoutMinutes: 35, + GroupingStrategy: "HEADGREEN", + MaxEntriesToBuild: 8, + MaxEntriesToMerge: 4, + MergeMethod: "SQUASH", + MinEntriesToMerge: 2, + MinEntriesToMergeWaitMinutes: 13, + }, + }, + RequiredDeployments: &RepositoryRulesetRequiredDeploymentsRule{ + Type: "required_deployments", + Parameters: &RequiredDeploymentEnvironmentsRuleParameters{ + RequiredDeploymentEnvironments: []string{"test"}, + }, + }, + RequiredSignatures: &RepositoryRulesetRuleType{ + Type: "required_signatures", + }, + PullRequest: &RepositoryRulesetPullRequestRule{ + Type: "pull_request", + Parameters: &PullRequestRuleParameters{ + RequireCodeOwnerReview: true, + RequireLastPushApproval: true, + RequiredApprovingReviewCount: 1, + RequiredReviewThreadResolution: true, + DismissStaleReviewsOnPush: true, + }, + }, + RequiredStatusChecks: &RepositoryRulesetRequiredStatusChecksRule{ + Type: "required_status_checks", + Parameters: &RequiredStatusChecksRuleParameters{ + RequiredStatusChecks: []RuleRequiredStatusChecks{ + { + Context: "test", + IntegrationID: Int64(1), + }, + }, + StrictRequiredStatusChecksPolicy: true, + }, + }, + NonFastForward: &RepositoryRulesetRuleType{ + Type: "non_fast_forward", + }, + CommitMessagePattern: &RepositoryRulesetPatternRule{ + Type: "commit_message_pattern", + Parameters: &RulePatternParameters{ + Name: String("avoid test commits"), + Negate: Bool(true), + Operator: "starts_with", + Pattern: "[test]", + }, + }, + CommitAuthorEmailPattern: &RepositoryRulesetPatternRule{ + Type: "commit_author_email_pattern", + Parameters: &RulePatternParameters{ + Operator: "contains", + Pattern: "github", + }, + }, + CommitterEmailPattern: &RepositoryRulesetPatternRule{ + Type: "committer_email_pattern", + Parameters: &RulePatternParameters{ + Name: String("avoid commit emails"), + Negate: Bool(true), + Operator: "ends_with", + Pattern: "abc", + }, + }, + BranchNamePattern: &RepositoryRulesetPatternRule{ + Type: "branch_name_pattern", + Parameters: &RulePatternParameters{ + Name: String("avoid branch names"), + Negate: Bool(true), + Operator: "regex", + Pattern: "github$", + }, + }, + TagNamePattern: &RepositoryRulesetPatternRule{ + Type: "tag_name_pattern", + Parameters: &RulePatternParameters{ + Name: String("avoid tag names"), + Negate: Bool(true), + Operator: "contains", + Pattern: "github", + }, + }, + FilePathRestriction: &RepositoryRulesetFilePathRestrictionRule{ + Type: "file_path_restriction", + Parameters: &RuleFileParameters{ + RestrictedFilePaths: &[]string{"/a/file"}, + }, + }, + MaxFilePathLength: &RepositoryRulesetMaxFilePathLengthRule{ + Type: "max_file_path_length", + Parameters: &RuleMaxFilePathLengthParameters{ + MaxFilePathLength: 255, + }, + }, + FileExtensionRestriction: &RepositoryRulesetFileExtensionRestrictionRule{ + Type: "file_extension_restriction", + Parameters: &RuleFileExtensionRestrictionParameters{ + RestrictedFileExtensions: []string{".exe"}, + }, + }, + MaxFileSize: &RepositoryRulesetMaxFileSizeRule{ + Type: "max_file_size", + Parameters: &RuleMaxFileSizeParameters{ + MaxFileSize: 1024, + }, + }, + Workflows: &RepositoryRulesetWorkflowsRule{ + Type: "workflows", + Parameters: &RequiredWorkflowsRuleParameters{ + RequiredWorkflows: []*RuleRequiredWorkflow{ + { + Path: ".github/workflows/test.yml", + RepositoryID: Int64(1), + }, + }, + }, + }, + CodeScanning: &RepositoryRulesetCodeScanningRule{ + Type: "code_scanning", + Parameters: &RuleCodeScanningParameters{ + CodeScanningTools: []*CodeScanningTool{{ + AlertsThreshold: "alert", + SecurityAlertsThreshold: "security", + Tool: "tool", + }}, + }, + }, + }, + }, + Updated: []*RepositoryRulesetUpdatedRules{ + { + Rule: &RepositoryRulesetRule{ + Creation: &RepositoryRulesetRuleType{ + Type: "creation", + }, + Update: &RepositoryRulesetUpdateRule{ + Type: "update", + Parameters: &UpdateAllowsFetchAndMergeRuleParameters{ + UpdateAllowsFetchAndMerge: true, + }, + }, + Deletion: &RepositoryRulesetRuleType{ + Type: "deletion", + }, + RequiredLinearHistory: &RepositoryRulesetRuleType{ + Type: "required_linear_history", + }, + MergeQueue: &RepositoryRulesetMergeQueueRule{ + Type: "merge_queue", + Parameters: &MergeQueueRuleParameters{ + CheckResponseTimeoutMinutes: 35, + GroupingStrategy: "HEADGREEN", + MaxEntriesToBuild: 8, + MaxEntriesToMerge: 4, + MergeMethod: "SQUASH", + MinEntriesToMerge: 2, + MinEntriesToMergeWaitMinutes: 13, + }, + }, + RequiredDeployments: &RepositoryRulesetRequiredDeploymentsRule{ + Type: "required_deployments", + Parameters: &RequiredDeploymentEnvironmentsRuleParameters{ + RequiredDeploymentEnvironments: []string{"test"}, + }, + }, + RequiredSignatures: &RepositoryRulesetRuleType{ + Type: "required_signatures", + }, + PullRequest: &RepositoryRulesetPullRequestRule{ + Type: "pull_request", + Parameters: &PullRequestRuleParameters{ + RequireCodeOwnerReview: true, + RequireLastPushApproval: true, + RequiredApprovingReviewCount: 1, + RequiredReviewThreadResolution: true, + DismissStaleReviewsOnPush: true, + }, + }, + RequiredStatusChecks: &RepositoryRulesetRequiredStatusChecksRule{ + Type: "required_status_checks", + Parameters: &RequiredStatusChecksRuleParameters{ + RequiredStatusChecks: []RuleRequiredStatusChecks{ + { + Context: "test", + IntegrationID: Int64(1), + }, + }, + StrictRequiredStatusChecksPolicy: true, + }, + }, + NonFastForward: &RepositoryRulesetRuleType{ + Type: "non_fast_forward", + }, + CommitMessagePattern: &RepositoryRulesetPatternRule{ + Type: "commit_message_pattern", + Parameters: &RulePatternParameters{ + Name: String("avoid test commits"), + Negate: Bool(true), + Operator: "starts_with", + Pattern: "[test]", + }, + }, + CommitAuthorEmailPattern: &RepositoryRulesetPatternRule{ + Type: "commit_author_email_pattern", + Parameters: &RulePatternParameters{ + Operator: "contains", + Pattern: "github", + }, + }, + CommitterEmailPattern: &RepositoryRulesetPatternRule{ + Type: "committer_email_pattern", + Parameters: &RulePatternParameters{ + Name: String("avoid commit emails"), + Negate: Bool(true), + Operator: "ends_with", + Pattern: "abc", + }, + }, + BranchNamePattern: &RepositoryRulesetPatternRule{ + Type: "branch_name_pattern", + Parameters: &RulePatternParameters{ + Name: String("avoid branch names"), + Negate: Bool(true), + Operator: "regex", + Pattern: "github$", + }, + }, + TagNamePattern: &RepositoryRulesetPatternRule{ + Type: "tag_name_pattern", + Parameters: &RulePatternParameters{ + Name: String("avoid tag names"), + Negate: Bool(true), + Operator: "contains", + Pattern: "github", + }, + }, + FilePathRestriction: &RepositoryRulesetFilePathRestrictionRule{ + Type: "file_path_restriction", + Parameters: &RuleFileParameters{ + RestrictedFilePaths: &[]string{"/a/file"}, + }, + }, + MaxFilePathLength: &RepositoryRulesetMaxFilePathLengthRule{ + Type: "max_file_path_length", + Parameters: &RuleMaxFilePathLengthParameters{ + MaxFilePathLength: 255, + }, + }, + FileExtensionRestriction: &RepositoryRulesetFileExtensionRestrictionRule{ + Type: "file_extension_restriction", + Parameters: &RuleFileExtensionRestrictionParameters{ + RestrictedFileExtensions: []string{".exe"}, + }, + }, + MaxFileSize: &RepositoryRulesetMaxFileSizeRule{ + Type: "max_file_size", + Parameters: &RuleMaxFileSizeParameters{ + MaxFileSize: 1024, + }, + }, + Workflows: &RepositoryRulesetWorkflowsRule{ + Type: "workflows", + Parameters: &RequiredWorkflowsRuleParameters{ + RequiredWorkflows: []*RuleRequiredWorkflow{ + { + Path: ".github/workflows/test.yml", + RepositoryID: Int64(1), + }, + }, + }, + }, + CodeScanning: &RepositoryRulesetCodeScanningRule{ + Type: "code_scanning", + Parameters: &RuleCodeScanningParameters{ + CodeScanningTools: []*CodeScanningTool{{ + AlertsThreshold: "alert", + SecurityAlertsThreshold: "security", + Tool: "tool", + }}, + }, + }, + }, + Changes: &RepositoryRulesetEditedRuleChanges{ + Configuration: &RepositoryRulesetEditedSources{ + From: []string{"from"}, + }, + RuleType: &RepositoryRulesetEditedSources{ + From: []string{"from"}, + }, + Pattern: &RepositoryRulesetEditedSources{ + From: []string{"from"}, + }, + }, + }, + }, + }, + }, + Sender: &User{ + Login: String("l"), + ID: Int64(1), + NodeID: String("n"), + URL: String("u"), + ReposURL: String("r"), + EventsURL: String("e"), + AvatarURL: String("a"), + }, + } + + want := `{ + "action": "a", + "enterprise": { + "id": 1, + "slug": "s", + "name": "n", + "node_id": "nid", + "avatar_url": "au", + "description": "d", + "website_url": "wu", + "html_url": "hu", + "created_at": ` + referenceTimeStr + `, + "updated_at": ` + referenceTimeStr + ` + }, + "installation": { + "id": 1, + "node_id": "nid", + "app_id": 1, + "app_slug": "as", + "target_id": 1, + "account": { + "login": "l", + "id": 1, + "avatar_url": "a", + "gravatar_id": "g", + "name": "n", + "company": "c", + "blog": "b", + "location": "l", + "email": "e", + "hireable": true, + "bio": "b", + "twitter_username": "t", + "public_repos": 1, + "followers": 1, + "following": 1, + "created_at": ` + referenceTimeStr + `, + "suspended_at": ` + referenceTimeStr + `, + "url": "u" + }, + "access_tokens_url": "atu", + "repositories_url": "ru", + "html_url": "hu", + "target_type": "tt", + "single_file_name": "sfn", + "repository_selection": "rs", + "events": [ + "e" + ], + "single_file_paths": [ + "s" + ], + "permissions": { + "actions": "a", + "administration": "ad", + "checks": "c", + "contents": "co", + "content_references": "cr", + "deployments": "d", + "environments": "e", + "issues": "i", + "metadata": "md", + "members": "m", + "organization_administration": "oa", + "organization_hooks": "oh", + "organization_plan": "op", + "organization_pre_receive_hooks": "opr", + "organization_projects": "op", + "organization_secrets": "os", + "organization_self_hosted_runners": "osh", + "organization_user_blocking": "oub", + "packages": "pkg", + "pages": "pg", + "pull_requests": "pr", + "repository_hooks": "rh", + "repository_projects": "rp", + "repository_pre_receive_hooks": "rprh", + "secrets": "s", + "secret_scanning_alerts": "ssa", + "security_events": "se", + "single_file": "sf", + "statuses": "s", + "team_discussions": "td", + "vulnerability_alerts": "va", + "workflows": "w" + }, + "created_at": ` + referenceTimeStr + `, + "updated_at": ` + referenceTimeStr + `, + "has_multiple_single_files": false, + "suspended_by": { + "login": "l", + "id": 1, + "avatar_url": "a", + "gravatar_id": "g", + "name": "n", + "company": "c", + "blog": "b", + "location": "l", + "email": "e", + "hireable": true, + "bio": "b", + "twitter_username": "t", + "public_repos": 1, + "followers": 1, + "following": 1, + "created_at": ` + referenceTimeStr + `, + "suspended_at": ` + referenceTimeStr + `, + "url": "u" + }, + "suspended_at": ` + referenceTimeStr + ` + }, + "organization": { + "name": "n", + "company": "c", + "blog": "b", + "location": "loc", + "email": "e", + "twitter_username": "tu", + "description": "d", + "billing_email": "be", + "is_verified": true, + "has_organization_projects": true, + "has_repository_projects": true, + "default_repository_permission": "drp", + "members_can_create_repositories": true, + "members_can_create_public_repositories": false, + "members_can_create_private_repositories": true, + "members_can_create_internal_repositories": true, + "members_allowed_repository_creation_type": "marct", + "members_can_create_pages": true, + "members_can_create_public_pages": false, + "members_can_create_private_pages": true + }, + "repository": { + "id": 1, + "name": "n", + "url": "u" + }, + "repository_ruleset": { + "id": 1, + "name": "n", + "target": "branch", + "source_type": "Repository", + "source": "s", + "enforcement": "disabled", + "bypass_actors": [ + { + "actor_id": 234, + "actor_type": "Team", + "bypass_mode": "Always" + } + ], + "current_user_can_bypass": "always", + "node_id": "n", + "_links": { + "self": { + "href": "href" + }, + "html": { + "href": "href" + } + }, + "conditions": { + "key": "value" + }, + "rules": [ + { + "creation": { + "type": "creation" + }, + "update": { + "type": "update", + "parameters": { + "update_allows_fetch_and_merge": true + } + }, + "deletion": { + "type": "deletion" + }, + "required_linear_history": { + "type": "required_linear_history" + }, + "merge_queue": { + "type": "merge_queue", + "parameters": { + "check_response_timeout_minutes": 35, + "grouping_strategy": "HEADGREEN", + "max_entries_to_build": 8, + "max_entries_to_merge": 4, + "merge_method": "SQUASH", + "min_entries_to_merge": 2, + "min_entries_to_merge_wait_minutes": 13 + } + }, + "required_deployments": { + "type": "required_deployments", + "parameters": { + "required_deployment_environments": [ + "test" + ] + } + }, + "required_signatures": { + "type": "required_signatures" + }, + "pull_request": { + "type": "pull_request", + "parameters": { + "dismiss_stale_reviews_on_push": true, + "require_code_owner_review": true, + "require_last_push_approval": true, + "required_approving_review_count": 1, + "required_review_thread_resolution": true + } + }, + "required_status_checks": { + "type": "required_status_checks", + "parameters": { + "required_status_checks": [ + { + "context": "test", + "integration_id": 1 + } + ], + "strict_required_status_checks_policy": true + } + }, + "non_fast_forward": { + "type": "non_fast_forward" + }, + "commit_message_pattern": { + "type": "commit_message_pattern", + "parameters": { + "name": "avoid test commits", + "negate": true, + "operator": "starts_with", + "pattern": "[test]" + } + }, + "commit_author_email_pattern": { + "type": "commit_author_email_pattern", + "parameters": { + "operator": "contains", + "pattern": "github" + } + }, + "committer_email_pattern": { + "type": "committer_email_pattern", + "parameters": { + "name": "avoid commit emails", + "negate": true, + "operator": "ends_with", + "pattern": "abc" + } + }, + "branch_name_pattern": { + "type": "branch_name_pattern", + "parameters": { + "name": "avoid branch names", + "negate": true, + "operator": "regex", + "pattern": "github$" + } + }, + "tag_name_pattern": { + "type": "tag_name_pattern", + "parameters": { + "name": "avoid tag names", + "negate": true, + "operator": "contains", + "pattern": "github" + } + }, + "file_path_restriction": { + "type": "file_path_restriction", + "parameters": { + "restricted_file_paths": [ + "/a/file" + ] + } + }, + "max_file_path_length": { + "type": "max_file_path_length", + "parameters": { + "max_file_path_length": 255 + } + }, + "file_extension_restriction": { + "type": "file_extension_restriction", + "parameters": { + "restricted_file_extensions": [ + ".exe" + ] + } + }, + "max_file_size": { + "type": "max_file_size", + "parameters": { + "max_file_size": 1024 + } + }, + "workflows": { + "type": "workflows", + "parameters": { + "workflows": [ + { + "path": ".github/workflows/test.yml", + "repository_id": 1 + } + ] + } + }, + "code_scanning": { + "type": "code_scanning", + "parameters": { + "code_scanning_tools": [ + { + "alerts_threshold": "alert", + "security_alerts_threshold": "security", + "tool": "tool" + } + ] + } + } + } + ], + "created_at": ` + referenceTimeStr + `, + "updated_at": ` + referenceTimeStr + ` + }, + "changes": { + "name": { + "from": "f" + }, + "enforcement": { + "from": "e" + }, + "conditions": { + "added": [ + { + "ref_name": { + "include": [ + "refs/heads/main", + "refs/heads/master" + ], + "exclude": [ + "refs/heads/dev*" + ] + } + } + ], + "deleted": [ + { + "ref_name": { + "include": [ + "refs/heads/main", + "refs/heads/master" + ], + "exclude": [ + "refs/heads/dev*" + ] + } + } + ], + "updated": [ + { + "condition": { + "ref_name": { + "include": [ + "refs/heads/main", + "refs/heads/master" + ], + "exclude": [ + "refs/heads/dev*" + ] + } + }, + "changes": { + "condition_type": { + "from": "c" + }, + "target": { + "from": "t" + }, + "include": { + "from": [ + "from" + ] + }, + "exclude": { + "from": [ + "to" + ] + } + } + } + ] + }, + "rules": { + "added": [ + { + "creation": { + "type": "creation" + }, + "update": { + "type": "update", + "parameters": { + "update_allows_fetch_and_merge": true + } + }, + "deletion": { + "type": "deletion" + }, + "required_linear_history": { + "type": "required_linear_history" + }, + "merge_queue": { + "type": "merge_queue", + "parameters": { + "check_response_timeout_minutes": 35, + "grouping_strategy": "HEADGREEN", + "max_entries_to_build": 8, + "max_entries_to_merge": 4, + "merge_method": "SQUASH", + "min_entries_to_merge": 2, + "min_entries_to_merge_wait_minutes": 13 + } + }, + "required_deployments": { + "type": "required_deployments", + "parameters": { + "required_deployment_environments": [ + "test" + ] + } + }, + "required_signatures": { + "type": "required_signatures" + }, + "pull_request": { + "type": "pull_request", + "parameters": { + "dismiss_stale_reviews_on_push": true, + "require_code_owner_review": true, + "require_last_push_approval": true, + "required_approving_review_count": 1, + "required_review_thread_resolution": true + } + }, + "required_status_checks": { + "type": "required_status_checks", + "parameters": { + "required_status_checks": [ + { + "context": "test", + "integration_id": 1 + } + ], + "strict_required_status_checks_policy": true + } + }, + "non_fast_forward": { + "type": "non_fast_forward" + }, + "commit_message_pattern": { + "type": "commit_message_pattern", + "parameters": { + "name": "avoid test commits", + "negate": true, + "operator": "starts_with", + "pattern": "[test]" + } + }, + "commit_author_email_pattern": { + "type": "commit_author_email_pattern", + "parameters": { + "operator": "contains", + "pattern": "github" + } + }, + "committer_email_pattern": { + "type": "committer_email_pattern", + "parameters": { + "name": "avoid commit emails", + "negate": true, + "operator": "ends_with", + "pattern": "abc" + } + }, + "branch_name_pattern": { + "type": "branch_name_pattern", + "parameters": { + "name": "avoid branch names", + "negate": true, + "operator": "regex", + "pattern": "github$" + } + }, + "tag_name_pattern": { + "type": "tag_name_pattern", + "parameters": { + "name": "avoid tag names", + "negate": true, + "operator": "contains", + "pattern": "github" + } + }, + "file_path_restriction": { + "type": "file_path_restriction", + "parameters": { + "restricted_file_paths": [ + "/a/file" + ] + } + }, + "max_file_path_length": { + "type": "max_file_path_length", + "parameters": { + "max_file_path_length": 255 + } + }, + "file_extension_restriction": { + "type": "file_extension_restriction", + "parameters": { + "restricted_file_extensions": [ + ".exe" + ] + } + }, + "max_file_size": { + "type": "max_file_size", + "parameters": { + "max_file_size": 1024 + } + }, + "workflows": { + "type": "workflows", + "parameters": { + "workflows": [ + { + "path": ".github/workflows/test.yml", + "repository_id": 1 + } + ] + } + }, + "code_scanning": { + "type": "code_scanning", + "parameters": { + "code_scanning_tools": [ + { + "alerts_threshold": "alert", + "security_alerts_threshold": "security", + "tool": "tool" + } + ] + } + } + } + ], + "deleted": [ + { + "creation": { + "type": "creation" + }, + "update": { + "type": "update", + "parameters": { + "update_allows_fetch_and_merge": true + } + }, + "deletion": { + "type": "deletion" + }, + "required_linear_history": { + "type": "required_linear_history" + }, + "merge_queue": { + "type": "merge_queue", + "parameters": { + "check_response_timeout_minutes": 35, + "grouping_strategy": "HEADGREEN", + "max_entries_to_build": 8, + "max_entries_to_merge": 4, + "merge_method": "SQUASH", + "min_entries_to_merge": 2, + "min_entries_to_merge_wait_minutes": 13 + } + }, + "required_deployments": { + "type": "required_deployments", + "parameters": { + "required_deployment_environments": [ + "test" + ] + } + }, + "required_signatures": { + "type": "required_signatures" + }, + "pull_request": { + "type": "pull_request", + "parameters": { + "dismiss_stale_reviews_on_push": true, + "require_code_owner_review": true, + "require_last_push_approval": true, + "required_approving_review_count": 1, + "required_review_thread_resolution": true + } + }, + "required_status_checks": { + "type": "required_status_checks", + "parameters": { + "required_status_checks": [ + { + "context": "test", + "integration_id": 1 + } + ], + "strict_required_status_checks_policy": true + } + }, + "non_fast_forward": { + "type": "non_fast_forward" + }, + "commit_message_pattern": { + "type": "commit_message_pattern", + "parameters": { + "name": "avoid test commits", + "negate": true, + "operator": "starts_with", + "pattern": "[test]" + } + }, + "commit_author_email_pattern": { + "type": "commit_author_email_pattern", + "parameters": { + "operator": "contains", + "pattern": "github" + } + }, + "committer_email_pattern": { + "type": "committer_email_pattern", + "parameters": { + "name": "avoid commit emails", + "negate": true, + "operator": "ends_with", + "pattern": "abc" + } + }, + "branch_name_pattern": { + "type": "branch_name_pattern", + "parameters": { + "name": "avoid branch names", + "negate": true, + "operator": "regex", + "pattern": "github$" + } + }, + "tag_name_pattern": { + "type": "tag_name_pattern", + "parameters": { + "name": "avoid tag names", + "negate": true, + "operator": "contains", + "pattern": "github" + } + }, + "file_path_restriction": { + "type": "file_path_restriction", + "parameters": { + "restricted_file_paths": [ + "/a/file" + ] + } + }, + "max_file_path_length": { + "type": "max_file_path_length", + "parameters": { + "max_file_path_length": 255 + } + }, + "file_extension_restriction": { + "type": "file_extension_restriction", + "parameters": { + "restricted_file_extensions": [ + ".exe" + ] + } + }, + "max_file_size": { + "type": "max_file_size", + "parameters": { + "max_file_size": 1024 + } + }, + "workflows": { + "type": "workflows", + "parameters": { + "workflows": [ + { + "path": ".github/workflows/test.yml", + "repository_id": 1 + } + ] + } + }, + "code_scanning": { + "type": "code_scanning", + "parameters": { + "code_scanning_tools": [ + { + "alerts_threshold": "alert", + "security_alerts_threshold": "security", + "tool": "tool" + } + ] + } + } + } + ], + "updated": [ + { + "rule": { + "creation": { + "type": "creation" + }, + "update": { + "type": "update", + "parameters": { + "update_allows_fetch_and_merge": true + } + }, + "deletion": { + "type": "deletion" + }, + "required_linear_history": { + "type": "required_linear_history" + }, + "merge_queue": { + "type": "merge_queue", + "parameters": { + "check_response_timeout_minutes": 35, + "grouping_strategy": "HEADGREEN", + "max_entries_to_build": 8, + "max_entries_to_merge": 4, + "merge_method": "SQUASH", + "min_entries_to_merge": 2, + "min_entries_to_merge_wait_minutes": 13 + } + }, + "required_deployments": { + "type": "required_deployments", + "parameters": { + "required_deployment_environments": [ + "test" + ] + } + }, + "required_signatures": { + "type": "required_signatures" + }, + "pull_request": { + "type": "pull_request", + "parameters": { + "dismiss_stale_reviews_on_push": true, + "require_code_owner_review": true, + "require_last_push_approval": true, + "required_approving_review_count": 1, + "required_review_thread_resolution": true + } + }, + "required_status_checks": { + "type": "required_status_checks", + "parameters": { + "required_status_checks": [ + { + "context": "test", + "integration_id": 1 + } + ], + "strict_required_status_checks_policy": true + } + }, + "non_fast_forward": { + "type": "non_fast_forward" + }, + "commit_message_pattern": { + "type": "commit_message_pattern", + "parameters": { + "name": "avoid test commits", + "negate": true, + "operator": "starts_with", + "pattern": "[test]" + } + }, + "commit_author_email_pattern": { + "type": "commit_author_email_pattern", + "parameters": { + "operator": "contains", + "pattern": "github" + } + }, + "committer_email_pattern": { + "type": "committer_email_pattern", + "parameters": { + "name": "avoid commit emails", + "negate": true, + "operator": "ends_with", + "pattern": "abc" + } + }, + "branch_name_pattern": { + "type": "branch_name_pattern", + "parameters": { + "name": "avoid branch names", + "negate": true, + "operator": "regex", + "pattern": "github$" + } + }, + "tag_name_pattern": { + "type": "tag_name_pattern", + "parameters": { + "name": "avoid tag names", + "negate": true, + "operator": "contains", + "pattern": "github" + } + }, + "file_path_restriction": { + "type": "file_path_restriction", + "parameters": { + "restricted_file_paths": [ + "/a/file" + ] + } + }, + "max_file_path_length": { + "type": "max_file_path_length", + "parameters": { + "max_file_path_length": 255 + } + }, + "file_extension_restriction": { + "type": "file_extension_restriction", + "parameters": { + "restricted_file_extensions": [ + ".exe" + ] + } + }, + "max_file_size": { + "type": "max_file_size", + "parameters": { + "max_file_size": 1024 + } + }, + "workflows": { + "type": "workflows", + "parameters": { + "workflows": [ + { + "path": ".github/workflows/test.yml", + "repository_id": 1 + } + ] + } + }, + "code_scanning": { + "type": "code_scanning", + "parameters": { + "code_scanning_tools": [ + { + "alerts_threshold": "alert", + "security_alerts_threshold": "security", + "tool": "tool" + } + ] + } + } + }, + "changes": { + "configuration": { + "from": [ + "from" + ] + }, + "rule_type": { + "from": [ + "from" + ] + }, + "pattern": { + "from": [ + "from" + ] + } + } + } + ] + } + }, + "sender": { + "login": "l", + "id": 1, + "node_id": "n", + "avatar_url": "a", + "url": "u", + "events_url": "e", + "repos_url": "r" + } + }` + + testJSONMarshal(t, u, want) +} + func TestContentReferenceEvent_Marshal(t *testing.T) { t.Parallel() testJSONMarshal(t, &ContentReferenceEvent{}, "{}") diff --git a/github/github-accessors.go b/github/github-accessors.go index a43ce8b9bda..019ba354400 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -20846,6 +20846,542 @@ func (r *RepositoryRule) GetParameters() json.RawMessage { return *r.Parameters } +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (r *RepositoryRuleset) GetCreatedAt() Timestamp { + if r == nil || r.CreatedAt == nil { + return Timestamp{} + } + return *r.CreatedAt +} + +// GetCurrentUserCanBypass returns the CurrentUserCanBypass field if it's non-nil, zero value otherwise. +func (r *RepositoryRuleset) GetCurrentUserCanBypass() string { + if r == nil || r.CurrentUserCanBypass == nil { + return "" + } + return *r.CurrentUserCanBypass +} + +// GetLinks returns the Links field. +func (r *RepositoryRuleset) GetLinks() *RepositoryRulesetLink { + if r == nil { + return nil + } + return r.Links +} + +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (r *RepositoryRuleset) GetNodeID() string { + if r == nil || r.NodeID == nil { + return "" + } + return *r.NodeID +} + +// GetSourceType returns the SourceType field if it's non-nil, zero value otherwise. +func (r *RepositoryRuleset) GetSourceType() string { + if r == nil || r.SourceType == nil { + return "" + } + return *r.SourceType +} + +// GetTarget returns the Target field if it's non-nil, zero value otherwise. +func (r *RepositoryRuleset) GetTarget() string { + if r == nil || r.Target == nil { + return "" + } + return *r.Target +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (r *RepositoryRuleset) GetUpdatedAt() Timestamp { + if r == nil || r.UpdatedAt == nil { + return Timestamp{} + } + return *r.UpdatedAt +} + +// GetParameters returns the Parameters field. +func (r *RepositoryRulesetCodeScanningRule) GetParameters() *RuleCodeScanningParameters { + if r == nil { + return nil + } + return r.Parameters +} + +// GetConditions returns the Conditions field. +func (r *RepositoryRulesetEditedChanges) GetConditions() *RepositoryRulesetEditedConditions { + if r == nil { + return nil + } + return r.Conditions +} + +// GetEnforcement returns the Enforcement field. +func (r *RepositoryRulesetEditedChanges) GetEnforcement() *RepositoryRulesetEditedSource { + if r == nil { + return nil + } + return r.Enforcement +} + +// GetName returns the Name field. +func (r *RepositoryRulesetEditedChanges) GetName() *RepositoryRulesetEditedSource { + if r == nil { + return nil + } + return r.Name +} + +// GetRules returns the Rules field. +func (r *RepositoryRulesetEditedChanges) GetRules() *RepositoryRulesetEditedRules { + if r == nil { + return nil + } + return r.Rules +} + +// GetConfiguration returns the Configuration field. +func (r *RepositoryRulesetEditedRuleChanges) GetConfiguration() *RepositoryRulesetEditedSources { + if r == nil { + return nil + } + return r.Configuration +} + +// GetPattern returns the Pattern field. +func (r *RepositoryRulesetEditedRuleChanges) GetPattern() *RepositoryRulesetEditedSources { + if r == nil { + return nil + } + return r.Pattern +} + +// GetRuleType returns the RuleType field. +func (r *RepositoryRulesetEditedRuleChanges) GetRuleType() *RepositoryRulesetEditedSources { + if r == nil { + return nil + } + return r.RuleType +} + +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (r *RepositoryRulesetEditedSource) GetFrom() string { + if r == nil || r.From == nil { + return "" + } + return *r.From +} + +// GetChanges returns the Changes field. +func (r *RepositoryRulesetEditedUpdatedConditions) GetChanges() *RepositoryRulesetUpdatedConditionsEdited { + if r == nil { + return nil + } + return r.Changes +} + +// GetCondition returns the Condition field. +func (r *RepositoryRulesetEditedUpdatedConditions) GetCondition() *RepositoryRulesetRefCondition { + if r == nil { + return nil + } + return r.Condition +} + +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (r *RepositoryRulesetEvent) GetAction() string { + if r == nil || r.Action == nil { + return "" + } + return *r.Action +} + +// GetChanges returns the Changes field. +func (r *RepositoryRulesetEvent) GetChanges() *RepositoryRulesetEditedChanges { + if r == nil { + return nil + } + return r.Changes +} + +// GetEnterprise returns the Enterprise field. +func (r *RepositoryRulesetEvent) GetEnterprise() *Enterprise { + if r == nil { + return nil + } + return r.Enterprise +} + +// GetInstallation returns the Installation field. +func (r *RepositoryRulesetEvent) GetInstallation() *Installation { + if r == nil { + return nil + } + return r.Installation +} + +// GetOrganization returns the Organization field. +func (r *RepositoryRulesetEvent) GetOrganization() *Organization { + if r == nil { + return nil + } + return r.Organization +} + +// GetRepository returns the Repository field. +func (r *RepositoryRulesetEvent) GetRepository() *Repository { + if r == nil { + return nil + } + return r.Repository +} + +// GetRepositoryRuleset returns the RepositoryRuleset field. +func (r *RepositoryRulesetEvent) GetRepositoryRuleset() *RepositoryRuleset { + if r == nil { + return nil + } + return r.RepositoryRuleset +} + +// GetSender returns the Sender field. +func (r *RepositoryRulesetEvent) GetSender() *User { + if r == nil { + return nil + } + return r.Sender +} + +// GetParameters returns the Parameters field. +func (r *RepositoryRulesetFileExtensionRestrictionRule) GetParameters() *RuleFileExtensionRestrictionParameters { + if r == nil { + return nil + } + return r.Parameters +} + +// GetParameters returns the Parameters field. +func (r *RepositoryRulesetFilePathRestrictionRule) GetParameters() *RuleFileParameters { + if r == nil { + return nil + } + return r.Parameters +} + +// GetHTML returns the HTML field. +func (r *RepositoryRulesetLink) GetHTML() *RulesetLink { + if r == nil { + return nil + } + return r.HTML +} + +// GetSelf returns the Self field. +func (r *RepositoryRulesetLink) GetSelf() *RulesetLink { + if r == nil { + return nil + } + return r.Self +} + +// GetParameters returns the Parameters field. +func (r *RepositoryRulesetMaxFilePathLengthRule) GetParameters() *RuleMaxFilePathLengthParameters { + if r == nil { + return nil + } + return r.Parameters +} + +// GetParameters returns the Parameters field. +func (r *RepositoryRulesetMaxFileSizeRule) GetParameters() *RuleMaxFileSizeParameters { + if r == nil { + return nil + } + return r.Parameters +} + +// GetParameters returns the Parameters field. +func (r *RepositoryRulesetMergeQueueRule) GetParameters() *MergeQueueRuleParameters { + if r == nil { + return nil + } + return r.Parameters +} + +// GetParameters returns the Parameters field. +func (r *RepositoryRulesetPatternRule) GetParameters() *RulePatternParameters { + if r == nil { + return nil + } + return r.Parameters +} + +// GetParameters returns the Parameters field. +func (r *RepositoryRulesetPullRequestRule) GetParameters() *PullRequestRuleParameters { + if r == nil { + return nil + } + return r.Parameters +} + +// GetRefName returns the RefName field. +func (r *RepositoryRulesetRefCondition) GetRefName() *RulesetRefConditionParameters { + if r == nil { + return nil + } + return r.RefName +} + +// GetParameters returns the Parameters field. +func (r *RepositoryRulesetRequiredDeploymentsRule) GetParameters() *RequiredDeploymentEnvironmentsRuleParameters { + if r == nil { + return nil + } + return r.Parameters +} + +// GetParameters returns the Parameters field. +func (r *RepositoryRulesetRequiredStatusChecksRule) GetParameters() *RequiredStatusChecksRuleParameters { + if r == nil { + return nil + } + return r.Parameters +} + +// GetBranchNamePattern returns the BranchNamePattern field. +func (r *RepositoryRulesetRule) GetBranchNamePattern() *RepositoryRulesetPatternRule { + if r == nil { + return nil + } + return r.BranchNamePattern +} + +// GetCodeScanning returns the CodeScanning field. +func (r *RepositoryRulesetRule) GetCodeScanning() *RepositoryRulesetCodeScanningRule { + if r == nil { + return nil + } + return r.CodeScanning +} + +// GetCommitAuthorEmailPattern returns the CommitAuthorEmailPattern field. +func (r *RepositoryRulesetRule) GetCommitAuthorEmailPattern() *RepositoryRulesetPatternRule { + if r == nil { + return nil + } + return r.CommitAuthorEmailPattern +} + +// GetCommitMessagePattern returns the CommitMessagePattern field. +func (r *RepositoryRulesetRule) GetCommitMessagePattern() *RepositoryRulesetPatternRule { + if r == nil { + return nil + } + return r.CommitMessagePattern +} + +// GetCommitterEmailPattern returns the CommitterEmailPattern field. +func (r *RepositoryRulesetRule) GetCommitterEmailPattern() *RepositoryRulesetPatternRule { + if r == nil { + return nil + } + return r.CommitterEmailPattern +} + +// GetCreation returns the Creation field. +func (r *RepositoryRulesetRule) GetCreation() *RepositoryRulesetRuleType { + if r == nil { + return nil + } + return r.Creation +} + +// GetDeletion returns the Deletion field. +func (r *RepositoryRulesetRule) GetDeletion() *RepositoryRulesetRuleType { + if r == nil { + return nil + } + return r.Deletion +} + +// GetFileExtensionRestriction returns the FileExtensionRestriction field. +func (r *RepositoryRulesetRule) GetFileExtensionRestriction() *RepositoryRulesetFileExtensionRestrictionRule { + if r == nil { + return nil + } + return r.FileExtensionRestriction +} + +// GetFilePathRestriction returns the FilePathRestriction field. +func (r *RepositoryRulesetRule) GetFilePathRestriction() *RepositoryRulesetFilePathRestrictionRule { + if r == nil { + return nil + } + return r.FilePathRestriction +} + +// GetMaxFilePathLength returns the MaxFilePathLength field. +func (r *RepositoryRulesetRule) GetMaxFilePathLength() *RepositoryRulesetMaxFilePathLengthRule { + if r == nil { + return nil + } + return r.MaxFilePathLength +} + +// GetMaxFileSize returns the MaxFileSize field. +func (r *RepositoryRulesetRule) GetMaxFileSize() *RepositoryRulesetMaxFileSizeRule { + if r == nil { + return nil + } + return r.MaxFileSize +} + +// GetMergeQueue returns the MergeQueue field. +func (r *RepositoryRulesetRule) GetMergeQueue() *RepositoryRulesetMergeQueueRule { + if r == nil { + return nil + } + return r.MergeQueue +} + +// GetNonFastForward returns the NonFastForward field. +func (r *RepositoryRulesetRule) GetNonFastForward() *RepositoryRulesetRuleType { + if r == nil { + return nil + } + return r.NonFastForward +} + +// GetPullRequest returns the PullRequest field. +func (r *RepositoryRulesetRule) GetPullRequest() *RepositoryRulesetPullRequestRule { + if r == nil { + return nil + } + return r.PullRequest +} + +// GetRequiredDeployments returns the RequiredDeployments field. +func (r *RepositoryRulesetRule) GetRequiredDeployments() *RepositoryRulesetRequiredDeploymentsRule { + if r == nil { + return nil + } + return r.RequiredDeployments +} + +// GetRequiredLinearHistory returns the RequiredLinearHistory field. +func (r *RepositoryRulesetRule) GetRequiredLinearHistory() *RepositoryRulesetRuleType { + if r == nil { + return nil + } + return r.RequiredLinearHistory +} + +// GetRequiredSignatures returns the RequiredSignatures field. +func (r *RepositoryRulesetRule) GetRequiredSignatures() *RepositoryRulesetRuleType { + if r == nil { + return nil + } + return r.RequiredSignatures +} + +// GetRequiredStatusChecks returns the RequiredStatusChecks field. +func (r *RepositoryRulesetRule) GetRequiredStatusChecks() *RepositoryRulesetRequiredStatusChecksRule { + if r == nil { + return nil + } + return r.RequiredStatusChecks +} + +// GetTagNamePattern returns the TagNamePattern field. +func (r *RepositoryRulesetRule) GetTagNamePattern() *RepositoryRulesetPatternRule { + if r == nil { + return nil + } + return r.TagNamePattern +} + +// GetUpdate returns the Update field. +func (r *RepositoryRulesetRule) GetUpdate() *RepositoryRulesetUpdateRule { + if r == nil { + return nil + } + return r.Update +} + +// GetWorkflows returns the Workflows field. +func (r *RepositoryRulesetRule) GetWorkflows() *RepositoryRulesetWorkflowsRule { + if r == nil { + return nil + } + return r.Workflows +} + +// GetConditionType returns the ConditionType field. +func (r *RepositoryRulesetUpdatedConditionsEdited) GetConditionType() *RepositoryRulesetEditedSource { + if r == nil { + return nil + } + return r.ConditionType +} + +// GetExclude returns the Exclude field. +func (r *RepositoryRulesetUpdatedConditionsEdited) GetExclude() *RepositoryRulesetEditedSources { + if r == nil { + return nil + } + return r.Exclude +} + +// GetInclude returns the Include field. +func (r *RepositoryRulesetUpdatedConditionsEdited) GetInclude() *RepositoryRulesetEditedSources { + if r == nil { + return nil + } + return r.Include +} + +// GetTarget returns the Target field. +func (r *RepositoryRulesetUpdatedConditionsEdited) GetTarget() *RepositoryRulesetEditedSource { + if r == nil { + return nil + } + return r.Target +} + +// GetChanges returns the Changes field. +func (r *RepositoryRulesetUpdatedRules) GetChanges() *RepositoryRulesetEditedRuleChanges { + if r == nil { + return nil + } + return r.Changes +} + +// GetRule returns the Rule field. +func (r *RepositoryRulesetUpdatedRules) GetRule() *RepositoryRulesetRule { + if r == nil { + return nil + } + return r.Rule +} + +// GetParameters returns the Parameters field. +func (r *RepositoryRulesetUpdateRule) GetParameters() *UpdateAllowsFetchAndMergeRuleParameters { + if r == nil { + return nil + } + return r.Parameters +} + +// GetParameters returns the Parameters field. +func (r *RepositoryRulesetWorkflowsRule) GetParameters() *RequiredWorkflowsRuleParameters { + if r == nil { + return nil + } + return r.Parameters +} + // GetCommit returns the Commit field. func (r *RepositoryTag) GetCommit() *Commit { if r == nil { @@ -21246,6 +21782,14 @@ func (r *RequiredStatusChecksRequest) GetStrict() bool { return *r.Strict } +// GetDoNotEnforceOnCreate returns the DoNotEnforceOnCreate field if it's non-nil, zero value otherwise. +func (r *RequiredStatusChecksRuleParameters) GetDoNotEnforceOnCreate() bool { + if r == nil || r.DoNotEnforceOnCreate == nil { + return false + } + return *r.DoNotEnforceOnCreate +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (r *RequiredWorkflowSelectedRepos) GetTotalCount() int { if r == nil || r.TotalCount == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index a4d5315ba41..8f1407eeeaf 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -26808,6 +26808,566 @@ func TestRepositoryRule_GetParameters(tt *testing.T) { r.GetParameters() } +func TestRepositoryRuleset_GetCreatedAt(tt *testing.T) { + tt.Parallel() + var zeroValue Timestamp + r := &RepositoryRuleset{CreatedAt: &zeroValue} + r.GetCreatedAt() + r = &RepositoryRuleset{} + r.GetCreatedAt() + r = nil + r.GetCreatedAt() +} + +func TestRepositoryRuleset_GetCurrentUserCanBypass(tt *testing.T) { + tt.Parallel() + var zeroValue string + r := &RepositoryRuleset{CurrentUserCanBypass: &zeroValue} + r.GetCurrentUserCanBypass() + r = &RepositoryRuleset{} + r.GetCurrentUserCanBypass() + r = nil + r.GetCurrentUserCanBypass() +} + +func TestRepositoryRuleset_GetLinks(tt *testing.T) { + tt.Parallel() + r := &RepositoryRuleset{} + r.GetLinks() + r = nil + r.GetLinks() +} + +func TestRepositoryRuleset_GetNodeID(tt *testing.T) { + tt.Parallel() + var zeroValue string + r := &RepositoryRuleset{NodeID: &zeroValue} + r.GetNodeID() + r = &RepositoryRuleset{} + r.GetNodeID() + r = nil + r.GetNodeID() +} + +func TestRepositoryRuleset_GetSourceType(tt *testing.T) { + tt.Parallel() + var zeroValue string + r := &RepositoryRuleset{SourceType: &zeroValue} + r.GetSourceType() + r = &RepositoryRuleset{} + r.GetSourceType() + r = nil + r.GetSourceType() +} + +func TestRepositoryRuleset_GetTarget(tt *testing.T) { + tt.Parallel() + var zeroValue string + r := &RepositoryRuleset{Target: &zeroValue} + r.GetTarget() + r = &RepositoryRuleset{} + r.GetTarget() + r = nil + r.GetTarget() +} + +func TestRepositoryRuleset_GetUpdatedAt(tt *testing.T) { + tt.Parallel() + var zeroValue Timestamp + r := &RepositoryRuleset{UpdatedAt: &zeroValue} + r.GetUpdatedAt() + r = &RepositoryRuleset{} + r.GetUpdatedAt() + r = nil + r.GetUpdatedAt() +} + +func TestRepositoryRulesetCodeScanningRule_GetParameters(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetCodeScanningRule{} + r.GetParameters() + r = nil + r.GetParameters() +} + +func TestRepositoryRulesetEditedChanges_GetConditions(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetEditedChanges{} + r.GetConditions() + r = nil + r.GetConditions() +} + +func TestRepositoryRulesetEditedChanges_GetEnforcement(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetEditedChanges{} + r.GetEnforcement() + r = nil + r.GetEnforcement() +} + +func TestRepositoryRulesetEditedChanges_GetName(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetEditedChanges{} + r.GetName() + r = nil + r.GetName() +} + +func TestRepositoryRulesetEditedChanges_GetRules(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetEditedChanges{} + r.GetRules() + r = nil + r.GetRules() +} + +func TestRepositoryRulesetEditedRuleChanges_GetConfiguration(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetEditedRuleChanges{} + r.GetConfiguration() + r = nil + r.GetConfiguration() +} + +func TestRepositoryRulesetEditedRuleChanges_GetPattern(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetEditedRuleChanges{} + r.GetPattern() + r = nil + r.GetPattern() +} + +func TestRepositoryRulesetEditedRuleChanges_GetRuleType(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetEditedRuleChanges{} + r.GetRuleType() + r = nil + r.GetRuleType() +} + +func TestRepositoryRulesetEditedSource_GetFrom(tt *testing.T) { + tt.Parallel() + var zeroValue string + r := &RepositoryRulesetEditedSource{From: &zeroValue} + r.GetFrom() + r = &RepositoryRulesetEditedSource{} + r.GetFrom() + r = nil + r.GetFrom() +} + +func TestRepositoryRulesetEditedUpdatedConditions_GetChanges(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetEditedUpdatedConditions{} + r.GetChanges() + r = nil + r.GetChanges() +} + +func TestRepositoryRulesetEditedUpdatedConditions_GetCondition(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetEditedUpdatedConditions{} + r.GetCondition() + r = nil + r.GetCondition() +} + +func TestRepositoryRulesetEvent_GetAction(tt *testing.T) { + tt.Parallel() + var zeroValue string + r := &RepositoryRulesetEvent{Action: &zeroValue} + r.GetAction() + r = &RepositoryRulesetEvent{} + r.GetAction() + r = nil + r.GetAction() +} + +func TestRepositoryRulesetEvent_GetChanges(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetEvent{} + r.GetChanges() + r = nil + r.GetChanges() +} + +func TestRepositoryRulesetEvent_GetEnterprise(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetEvent{} + r.GetEnterprise() + r = nil + r.GetEnterprise() +} + +func TestRepositoryRulesetEvent_GetInstallation(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetEvent{} + r.GetInstallation() + r = nil + r.GetInstallation() +} + +func TestRepositoryRulesetEvent_GetOrganization(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetEvent{} + r.GetOrganization() + r = nil + r.GetOrganization() +} + +func TestRepositoryRulesetEvent_GetRepository(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetEvent{} + r.GetRepository() + r = nil + r.GetRepository() +} + +func TestRepositoryRulesetEvent_GetRepositoryRuleset(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetEvent{} + r.GetRepositoryRuleset() + r = nil + r.GetRepositoryRuleset() +} + +func TestRepositoryRulesetEvent_GetSender(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetEvent{} + r.GetSender() + r = nil + r.GetSender() +} + +func TestRepositoryRulesetFileExtensionRestrictionRule_GetParameters(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetFileExtensionRestrictionRule{} + r.GetParameters() + r = nil + r.GetParameters() +} + +func TestRepositoryRulesetFilePathRestrictionRule_GetParameters(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetFilePathRestrictionRule{} + r.GetParameters() + r = nil + r.GetParameters() +} + +func TestRepositoryRulesetLink_GetHTML(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetLink{} + r.GetHTML() + r = nil + r.GetHTML() +} + +func TestRepositoryRulesetLink_GetSelf(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetLink{} + r.GetSelf() + r = nil + r.GetSelf() +} + +func TestRepositoryRulesetMaxFilePathLengthRule_GetParameters(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetMaxFilePathLengthRule{} + r.GetParameters() + r = nil + r.GetParameters() +} + +func TestRepositoryRulesetMaxFileSizeRule_GetParameters(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetMaxFileSizeRule{} + r.GetParameters() + r = nil + r.GetParameters() +} + +func TestRepositoryRulesetMergeQueueRule_GetParameters(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetMergeQueueRule{} + r.GetParameters() + r = nil + r.GetParameters() +} + +func TestRepositoryRulesetPatternRule_GetParameters(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetPatternRule{} + r.GetParameters() + r = nil + r.GetParameters() +} + +func TestRepositoryRulesetPullRequestRule_GetParameters(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetPullRequestRule{} + r.GetParameters() + r = nil + r.GetParameters() +} + +func TestRepositoryRulesetRefCondition_GetRefName(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetRefCondition{} + r.GetRefName() + r = nil + r.GetRefName() +} + +func TestRepositoryRulesetRequiredDeploymentsRule_GetParameters(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetRequiredDeploymentsRule{} + r.GetParameters() + r = nil + r.GetParameters() +} + +func TestRepositoryRulesetRequiredStatusChecksRule_GetParameters(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetRequiredStatusChecksRule{} + r.GetParameters() + r = nil + r.GetParameters() +} + +func TestRepositoryRulesetRule_GetBranchNamePattern(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetRule{} + r.GetBranchNamePattern() + r = nil + r.GetBranchNamePattern() +} + +func TestRepositoryRulesetRule_GetCodeScanning(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetRule{} + r.GetCodeScanning() + r = nil + r.GetCodeScanning() +} + +func TestRepositoryRulesetRule_GetCommitAuthorEmailPattern(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetRule{} + r.GetCommitAuthorEmailPattern() + r = nil + r.GetCommitAuthorEmailPattern() +} + +func TestRepositoryRulesetRule_GetCommitMessagePattern(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetRule{} + r.GetCommitMessagePattern() + r = nil + r.GetCommitMessagePattern() +} + +func TestRepositoryRulesetRule_GetCommitterEmailPattern(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetRule{} + r.GetCommitterEmailPattern() + r = nil + r.GetCommitterEmailPattern() +} + +func TestRepositoryRulesetRule_GetCreation(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetRule{} + r.GetCreation() + r = nil + r.GetCreation() +} + +func TestRepositoryRulesetRule_GetDeletion(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetRule{} + r.GetDeletion() + r = nil + r.GetDeletion() +} + +func TestRepositoryRulesetRule_GetFileExtensionRestriction(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetRule{} + r.GetFileExtensionRestriction() + r = nil + r.GetFileExtensionRestriction() +} + +func TestRepositoryRulesetRule_GetFilePathRestriction(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetRule{} + r.GetFilePathRestriction() + r = nil + r.GetFilePathRestriction() +} + +func TestRepositoryRulesetRule_GetMaxFilePathLength(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetRule{} + r.GetMaxFilePathLength() + r = nil + r.GetMaxFilePathLength() +} + +func TestRepositoryRulesetRule_GetMaxFileSize(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetRule{} + r.GetMaxFileSize() + r = nil + r.GetMaxFileSize() +} + +func TestRepositoryRulesetRule_GetMergeQueue(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetRule{} + r.GetMergeQueue() + r = nil + r.GetMergeQueue() +} + +func TestRepositoryRulesetRule_GetNonFastForward(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetRule{} + r.GetNonFastForward() + r = nil + r.GetNonFastForward() +} + +func TestRepositoryRulesetRule_GetPullRequest(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetRule{} + r.GetPullRequest() + r = nil + r.GetPullRequest() +} + +func TestRepositoryRulesetRule_GetRequiredDeployments(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetRule{} + r.GetRequiredDeployments() + r = nil + r.GetRequiredDeployments() +} + +func TestRepositoryRulesetRule_GetRequiredLinearHistory(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetRule{} + r.GetRequiredLinearHistory() + r = nil + r.GetRequiredLinearHistory() +} + +func TestRepositoryRulesetRule_GetRequiredSignatures(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetRule{} + r.GetRequiredSignatures() + r = nil + r.GetRequiredSignatures() +} + +func TestRepositoryRulesetRule_GetRequiredStatusChecks(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetRule{} + r.GetRequiredStatusChecks() + r = nil + r.GetRequiredStatusChecks() +} + +func TestRepositoryRulesetRule_GetTagNamePattern(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetRule{} + r.GetTagNamePattern() + r = nil + r.GetTagNamePattern() +} + +func TestRepositoryRulesetRule_GetUpdate(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetRule{} + r.GetUpdate() + r = nil + r.GetUpdate() +} + +func TestRepositoryRulesetRule_GetWorkflows(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetRule{} + r.GetWorkflows() + r = nil + r.GetWorkflows() +} + +func TestRepositoryRulesetUpdatedConditionsEdited_GetConditionType(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetUpdatedConditionsEdited{} + r.GetConditionType() + r = nil + r.GetConditionType() +} + +func TestRepositoryRulesetUpdatedConditionsEdited_GetExclude(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetUpdatedConditionsEdited{} + r.GetExclude() + r = nil + r.GetExclude() +} + +func TestRepositoryRulesetUpdatedConditionsEdited_GetInclude(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetUpdatedConditionsEdited{} + r.GetInclude() + r = nil + r.GetInclude() +} + +func TestRepositoryRulesetUpdatedConditionsEdited_GetTarget(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetUpdatedConditionsEdited{} + r.GetTarget() + r = nil + r.GetTarget() +} + +func TestRepositoryRulesetUpdatedRules_GetChanges(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetUpdatedRules{} + r.GetChanges() + r = nil + r.GetChanges() +} + +func TestRepositoryRulesetUpdatedRules_GetRule(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetUpdatedRules{} + r.GetRule() + r = nil + r.GetRule() +} + +func TestRepositoryRulesetUpdateRule_GetParameters(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetUpdateRule{} + r.GetParameters() + r = nil + r.GetParameters() +} + +func TestRepositoryRulesetWorkflowsRule_GetParameters(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetWorkflowsRule{} + r.GetParameters() + r = nil + r.GetParameters() +} + func TestRepositoryTag_GetCommit(tt *testing.T) { tt.Parallel() r := &RepositoryTag{} @@ -27334,6 +27894,17 @@ func TestRequiredStatusChecksRequest_GetStrict(tt *testing.T) { r.GetStrict() } +func TestRequiredStatusChecksRuleParameters_GetDoNotEnforceOnCreate(tt *testing.T) { + tt.Parallel() + var zeroValue bool + r := &RequiredStatusChecksRuleParameters{DoNotEnforceOnCreate: &zeroValue} + r.GetDoNotEnforceOnCreate() + r = &RequiredStatusChecksRuleParameters{} + r.GetDoNotEnforceOnCreate() + r = nil + r.GetDoNotEnforceOnCreate() +} + func TestRequiredWorkflowSelectedRepos_GetTotalCount(tt *testing.T) { tt.Parallel() var zeroValue int diff --git a/github/messages.go b/github/messages.go index 0997479335f..f365190ae39 100644 --- a/github/messages.go +++ b/github/messages.go @@ -98,6 +98,7 @@ var ( "repository": &RepositoryEvent{}, "repository_dispatch": &RepositoryDispatchEvent{}, "repository_import": &RepositoryImportEvent{}, + "repository_ruleset": &RepositoryRulesetEvent{}, "repository_vulnerability_alert": &RepositoryVulnerabilityAlertEvent{}, "release": &ReleaseEvent{}, "secret_scanning_alert": &SecretScanningAlertEvent{}, diff --git a/github/messages_test.go b/github/messages_test.go index a9de4256905..e04c0b18a7b 100644 --- a/github/messages_test.go +++ b/github/messages_test.go @@ -468,6 +468,10 @@ func TestParseWebHook(t *testing.T) { payload: &RepositoryEvent{}, messageType: "repository", }, + { + payload: &RepositoryRulesetEvent{}, + messageType: "repository_ruleset", + }, { payload: &RepositoryVulnerabilityAlertEvent{}, messageType: "repository_vulnerability_alert", diff --git a/github/repos_rules.go b/github/repos_rules.go index ca9e9ea85bc..b812bd0b984 100644 --- a/github/repos_rules.go +++ b/github/repos_rules.go @@ -140,7 +140,7 @@ type MergeQueueRuleParameters struct { // RequiredStatusChecksRuleParameters represents the required_status_checks rule parameters. type RequiredStatusChecksRuleParameters struct { - DoNotEnforceOnCreate bool `json:"do_not_enforce_on_create"` + DoNotEnforceOnCreate *bool `json:"do_not_enforce_on_create,omitempty"` RequiredStatusChecks []RuleRequiredStatusChecks `json:"required_status_checks"` StrictRequiredStatusChecksPolicy bool `json:"strict_required_status_checks_policy"` } @@ -155,7 +155,8 @@ type RuleRequiredWorkflow struct { // RequiredWorkflowsRuleParameters represents the workflows rule parameters. type RequiredWorkflowsRuleParameters struct { - RequiredWorkflows []*RuleRequiredWorkflow `json:"workflows"` + DoNotEnforceOnCreate bool `json:"do_not_enforce_on_create,omitempty"` + RequiredWorkflows []*RuleRequiredWorkflow `json:"workflows"` } // RepositoryRule represents a GitHub Rule. @@ -167,6 +168,226 @@ type RepositoryRule struct { RulesetID int64 `json:"ruleset_id"` } +// RepositoryRulesetEditedChanges represents the changes made to a repository ruleset. +type RepositoryRulesetEditedChanges struct { + Name *RepositoryRulesetEditedSource `json:"name,omitempty"` + Enforcement *RepositoryRulesetEditedSource `json:"enforcement,omitempty"` + Conditions *RepositoryRulesetEditedConditions `json:"conditions,omitempty"` + Rules *RepositoryRulesetEditedRules `json:"rules,omitempty"` +} + +// RepositoryRulesetEditedSource represents a source change for the ruleset. +type RepositoryRulesetEditedSource struct { + From *string `json:"from,omitempty"` +} + +// RepositoryRulesetEditedSources represents multiple source changes for the ruleset. +type RepositoryRulesetEditedSources struct { + From []string `json:"from,omitempty"` +} + +// RepositoryRulesetEditedConditions holds changes to conditions in a ruleset. +type RepositoryRulesetEditedConditions struct { + Added []*RepositoryRulesetRefCondition `json:"added,omitempty"` + Deleted []*RepositoryRulesetRefCondition `json:"deleted,omitempty"` + Updated []*RepositoryRulesetEditedUpdatedConditions `json:"updated,omitempty"` +} + +// RepositoryRulesetEditedRules holds changes to rules in a ruleset. +type RepositoryRulesetEditedRules struct { + Added []*RepositoryRulesetRule `json:"added,omitempty"` + Deleted []*RepositoryRulesetRule `json:"deleted,omitempty"` + Updated []*RepositoryRulesetUpdatedRules `json:"updated,omitempty"` +} + +// RepositoryRulesetRefCondition represents a reference condition for the ruleset. +type RepositoryRulesetRefCondition struct { + RefName *RulesetRefConditionParameters `json:"ref_name,omitempty"` +} + +// RepositoryRulesetEditedUpdatedConditions holds updates to conditions in a ruleset. +type RepositoryRulesetEditedUpdatedConditions struct { + Condition *RepositoryRulesetRefCondition `json:"condition,omitempty"` + Changes *RepositoryRulesetUpdatedConditionsEdited `json:"changes,omitempty"` +} + +// RepositoryRulesetUpdatedConditionsEdited holds the edited updates to conditions in a ruleset. +type RepositoryRulesetUpdatedConditionsEdited struct { + ConditionType *RepositoryRulesetEditedSource `json:"condition_type,omitempty"` + Target *RepositoryRulesetEditedSource `json:"target,omitempty"` + Include *RepositoryRulesetEditedSources `json:"include,omitempty"` + Exclude *RepositoryRulesetEditedSources `json:"exclude,omitempty"` +} + +// RepositoryRulesetUpdatedRules holds updates to rules in a ruleset. +type RepositoryRulesetUpdatedRules struct { + Rule *RepositoryRulesetRule `json:"rule,omitempty"` + Changes *RepositoryRulesetEditedRuleChanges `json:"changes,omitempty"` +} + +// RepositoryRulesetEditedRuleChanges holds changes made to a rule in a ruleset. +type RepositoryRulesetEditedRuleChanges struct { + Configuration *RepositoryRulesetEditedSources `json:"configuration,omitempty"` + RuleType *RepositoryRulesetEditedSources `json:"rule_type,omitempty"` + Pattern *RepositoryRulesetEditedSources `json:"pattern,omitempty"` +} + +// RepositoryRuleset represents the structure of a ruleset associated with a GitHub repository. +type RepositoryRuleset struct { + ID int64 `json:"id"` + Name string `json:"name"` + // Possible values for target: "branch", "tag", "push" + Target *string `json:"target,omitempty"` + // Possible values for source type: "Repository", "Organization" + SourceType *string `json:"source_type,omitempty"` + Source string `json:"source"` + // Possible values for enforcement: "disabled", "active", "evaluate" + Enforcement string `json:"enforcement"` + BypassActors []*BypassActor `json:"bypass_actors,omitempty"` + // Possible values for current user can bypass: "always", "pull_requests_only", "never" + CurrentUserCanBypass *string `json:"current_user_can_bypass,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Links *RepositoryRulesetLink `json:"_links,omitempty"` + Conditions json.RawMessage `json:"conditions,omitempty"` + Rules []*RepositoryRulesetRule `json:"rules,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` +} + +// RepositoryRulesetRule represents individual rules which are present in a repository's ruleset. +type RepositoryRulesetRule struct { + Creation *RepositoryRulesetRuleType `json:"creation,omitempty"` + Update *RepositoryRulesetUpdateRule `json:"update,omitempty"` + Deletion *RepositoryRulesetRuleType `json:"deletion,omitempty"` + RequiredLinearHistory *RepositoryRulesetRuleType `json:"required_linear_history,omitempty"` + MergeQueue *RepositoryRulesetMergeQueueRule `json:"merge_queue,omitempty"` + RequiredDeployments *RepositoryRulesetRequiredDeploymentsRule `json:"required_deployments,omitempty"` + RequiredSignatures *RepositoryRulesetRuleType `json:"required_signatures,omitempty"` + PullRequest *RepositoryRulesetPullRequestRule `json:"pull_request,omitempty"` + RequiredStatusChecks *RepositoryRulesetRequiredStatusChecksRule `json:"required_status_checks,omitempty"` + NonFastForward *RepositoryRulesetRuleType `json:"non_fast_forward,omitempty"` + CommitMessagePattern *RepositoryRulesetPatternRule `json:"commit_message_pattern,omitempty"` + CommitAuthorEmailPattern *RepositoryRulesetPatternRule `json:"commit_author_email_pattern,omitempty"` + CommitterEmailPattern *RepositoryRulesetPatternRule `json:"committer_email_pattern,omitempty"` + BranchNamePattern *RepositoryRulesetPatternRule `json:"branch_name_pattern,omitempty"` + TagNamePattern *RepositoryRulesetPatternRule `json:"tag_name_pattern,omitempty"` + FilePathRestriction *RepositoryRulesetFilePathRestrictionRule `json:"file_path_restriction,omitempty"` + MaxFilePathLength *RepositoryRulesetMaxFilePathLengthRule `json:"max_file_path_length,omitempty"` + FileExtensionRestriction *RepositoryRulesetFileExtensionRestrictionRule `json:"file_extension_restriction,omitempty"` + MaxFileSize *RepositoryRulesetMaxFileSizeRule `json:"max_file_size,omitempty"` + Workflows *RepositoryRulesetWorkflowsRule `json:"workflows,omitempty"` + CodeScanning *RepositoryRulesetCodeScanningRule `json:"code_scanning,omitempty"` +} + +// RepositoryRulesetLink represents Links associated with a repository's rulesets. These links are used to provide more information about the ruleset. +type RepositoryRulesetLink struct { + Self *RulesetLink `json:"self,omitempty"` + HTML *RulesetLink `json:"html,omitempty"` +} + +// RepositoryRulesetRuleType represents the type of a ruleset rule. +type RepositoryRulesetRuleType struct { + Type string `json:"type"` +} + +// RepositoryRulesetUpdateRule defines an update rule for the repository. +type RepositoryRulesetUpdateRule struct { + // Type can be one of: "update". + Type string `json:"type"` + Parameters *UpdateAllowsFetchAndMergeRuleParameters `json:"parameters,omitempty"` +} + +// RepositoryRulesetMergeQueueRule defines a merge queue rule for the repository. +type RepositoryRulesetMergeQueueRule struct { + // Type can be one of: "merge_queue". + Type string `json:"type"` + Parameters *MergeQueueRuleParameters `json:"parameters,omitempty"` +} + +// RepositoryRulesetRequiredDeploymentsRule defines a rule for required deployments. +type RepositoryRulesetRequiredDeploymentsRule struct { + // Type can be one of: "required_deployments". + Type string `json:"type"` + Parameters *RequiredDeploymentEnvironmentsRuleParameters `json:"parameters,omitempty"` +} + +// RepositoryRulesetPullRequestRule defines a rule for pull requests. +type RepositoryRulesetPullRequestRule struct { + // Type can be one of: "pull_request". + + Type string `json:"type"` + Parameters *PullRequestRuleParameters `json:"parameters,omitempty"` +} + +// RepositoryRulesetRequiredStatusChecksRule defines a rule for required status checks. +type RepositoryRulesetRequiredStatusChecksRule struct { + // Type can be one of: "required_status_checks". + + Type string `json:"type"` + Parameters *RequiredStatusChecksRuleParameters `json:"parameters,omitempty"` +} + +// RepositoryRulesetPatternRule defines a pattern rule for the repository. +type RepositoryRulesetPatternRule struct { + Type string `json:"type"` + Parameters *RulePatternParameters `json:"parameters,omitempty"` +} + +// RepositoryRulesetFilePathRestrictionRule defines a file path restriction rule for the repository. +type RepositoryRulesetFilePathRestrictionRule struct { + // Type can be one of: "file_path_restriction". + Type string `json:"type"` + Parameters *RuleFileParameters `json:"parameters,omitempty"` +} + +// RepositoryRulesetMaxFilePathLengthRule defines a maximum file path length rule for the repository. +type RepositoryRulesetMaxFilePathLengthRule struct { + // Type can be one of: "max_file_path_length". + + Type string `json:"type"` + Parameters *RuleMaxFilePathLengthParameters `json:"parameters,omitempty"` +} + +// RepositoryRulesetFileExtensionRestrictionRule defines a file extension restriction rule for the repository. +type RepositoryRulesetFileExtensionRestrictionRule struct { + // Type can be one of: "file_extension_restriction". + Type string `json:"type"` + Parameters *RuleFileExtensionRestrictionParameters `json:"parameters,omitempty"` +} + +// RepositoryRulesetMaxFileSizeRule defines a maximum file size rule for the repository. +type RepositoryRulesetMaxFileSizeRule struct { + // Type can be one of: "max_file_size". + Type string `json:"type"` + Parameters *RuleMaxFileSizeParameters `json:"parameters,omitempty"` +} + +// RepositoryRulesetWorkflowsRule defines a workflow rule for the repository. +type RepositoryRulesetWorkflowsRule struct { + // Type can be one of: "workflows". + Type string `json:"type"` + Parameters *RequiredWorkflowsRuleParameters `json:"parameters,omitempty"` +} + +// RepositoryRulesetCodeScanningRule defines a code scanning rule for the repository. +type RepositoryRulesetCodeScanningRule struct { + // Type can be one of: "code_scanning". + Type string `json:"type"` + Parameters *RuleCodeScanningParameters `json:"parameters,omitempty"` +} + +// RuleCodeScanningParameters defines parameters for code scanning rules. +type RuleCodeScanningParameters struct { + CodeScanningTools []*CodeScanningTool `json:"code_scanning_tools,omitempty"` +} + +// CodeScanningTool defines a specific tool used for code scanning. +type CodeScanningTool struct { + AlertsThreshold string `json:"alerts_threshold"` + SecurityAlertsThreshold string `json:"security_alerts_threshold"` + Tool string `json:"tool"` +} + // UnmarshalJSON implements the json.Unmarshaler interface. // This helps us handle the fact that RepositoryRule parameter field can be of numerous types. func (r *RepositoryRule) UnmarshalJSON(data []byte) error { diff --git a/github/repos_rules_test.go b/github/repos_rules_test.go index a34b84cd895..e7faf7e7b2c 100644 --- a/github/repos_rules_test.go +++ b/github/repos_rules_test.go @@ -269,7 +269,7 @@ func TestRepositoryRule_UnmarshalJSON(t *testing.T) { "Valid required_status_checks params": { data: `{"type":"required_status_checks","parameters":{"required_status_checks":[{"context":"test","integration_id":1}],"strict_required_status_checks_policy":true,"do_not_enforce_on_create":true}}`, want: NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ - DoNotEnforceOnCreate: true, + DoNotEnforceOnCreate: Bool(true), RequiredStatusChecks: []RuleRequiredStatusChecks{ { Context: "test", From 8c273e1245f4e685158aff6b1d6076d3538fda76 Mon Sep 17 00:00:00 2001 From: ihor-hrytskiv <39990360+ihor-hrytskiv@users.noreply.github.com> Date: Thu, 17 Oct 2024 14:43:08 +0300 Subject: [PATCH 549/751] feat: Add support for code_scanning (#3256) --- github/orgs_rules_test.go | 90 ++++++++++++++++++++++++++++++++++++++ github/repos_rules.go | 33 ++++++++++++++ github/repos_rules_test.go | 30 ++++++++++++- 3 files changed, 152 insertions(+), 1 deletion(-) diff --git a/github/orgs_rules_test.go b/github/orgs_rules_test.go index 66cf6bd5c80..353705febad 100644 --- a/github/orgs_rules_test.go +++ b/github/orgs_rules_test.go @@ -202,6 +202,18 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) "operator": "contains", "pattern": "github" } + }, + { + "type": "code_scanning", + "parameters": { + "code_scanning_tools": [ + { + "tool": "CodeQL", + "security_alerts_threshold": "high_or_higher", + "alerts_threshold": "errors" + } + ] + } } ] }`) @@ -288,6 +300,15 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) Operator: "contains", Pattern: "github", }), + NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ + RequiredCodeScanningTools: []*RuleRequiredCodeScanningTools{ + { + Tool: "CodeQL", + SecurityAlertsThreshold: "high_or_higher", + AlertsThreshold: "errors", + }, + }, + }), }, }) if err != nil { @@ -374,6 +395,15 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) Operator: "contains", Pattern: "github", }), + NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ + RequiredCodeScanningTools: []*RuleRequiredCodeScanningTools{ + { + Tool: "CodeQL", + SecurityAlertsThreshold: "high_or_higher", + AlertsThreshold: "errors", + }, + }, + }), }, } if !cmp.Equal(ruleset, want) { @@ -524,6 +554,18 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing. "operator": "contains", "pattern": "github" } + }, + { + "type": "code_scanning", + "parameters": { + "code_scanning_tools": [ + { + "tool": "CodeQL", + "security_alerts_threshold": "high_or_higher", + "alerts_threshold": "errors" + } + ] + } } ] }`) @@ -617,6 +659,15 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing. Operator: "contains", Pattern: "github", }), + NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ + RequiredCodeScanningTools: []*RuleRequiredCodeScanningTools{ + { + Tool: "CodeQL", + SecurityAlertsThreshold: "high_or_higher", + AlertsThreshold: "errors", + }, + }, + }), }, }) if err != nil { @@ -710,6 +761,15 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing. Operator: "contains", Pattern: "github", }), + NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ + RequiredCodeScanningTools: []*RuleRequiredCodeScanningTools{ + { + Tool: "CodeQL", + SecurityAlertsThreshold: "high_or_higher", + AlertsThreshold: "errors", + }, + }, + }), }, } if !cmp.Equal(ruleset, want) { @@ -852,6 +912,18 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { "operator": "contains", "pattern": "github" } + }, + { + "type": "code_scanning", + "parameters": { + "code_scanning_tools": [ + { + "tool": "CodeQL", + "security_alerts_threshold": "high_or_higher", + "alerts_threshold": "errors" + } + ] + } } ] }`) @@ -936,6 +1008,15 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { Operator: "contains", Pattern: "github", }), + NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ + RequiredCodeScanningTools: []*RuleRequiredCodeScanningTools{ + { + Tool: "CodeQL", + SecurityAlertsThreshold: "high_or_higher", + AlertsThreshold: "errors", + }, + }, + }), }, }) if err != nil { @@ -1020,6 +1101,15 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { Operator: "contains", Pattern: "github", }), + NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ + RequiredCodeScanningTools: []*RuleRequiredCodeScanningTools{ + { + Tool: "CodeQL", + SecurityAlertsThreshold: "high_or_higher", + AlertsThreshold: "errors", + }, + }, + }), }, } if !cmp.Equal(ruleset, want) { diff --git a/github/repos_rules.go b/github/repos_rules.go index b812bd0b984..bb8aa121f81 100644 --- a/github/repos_rules.go +++ b/github/repos_rules.go @@ -159,6 +159,18 @@ type RequiredWorkflowsRuleParameters struct { RequiredWorkflows []*RuleRequiredWorkflow `json:"workflows"` } +// RuleRequiredCodeScanningTools represents the RequiredCodeScanningTools for the RequiredCodeScanningParameters object. +type RuleRequiredCodeScanningTools struct { + AlertsThreshold string `json:"alerts_threshold"` + SecurityAlertsThreshold string `json:"security_alerts_threshold"` + Tool string `json:"tool"` +} + +// RequiredCodeScanningRuleParameters represents the code_scanning rule parameters. +type RequiredCodeScanningRuleParameters struct { + RequiredCodeScanningTools []*RuleRequiredCodeScanningTools `json:"code_scanning_tools"` +} + // RepositoryRule represents a GitHub Rule. type RepositoryRule struct { Type string `json:"type"` @@ -491,6 +503,15 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { bytes, _ := json.Marshal(params) rawParams := json.RawMessage(bytes) + r.Parameters = &rawParams + case "code_scanning": + params := RequiredCodeScanningRuleParameters{} + if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { + return err + } + bytes, _ := json.Marshal(params) + rawParams := json.RawMessage(bytes) + r.Parameters = &rawParams case "max_file_path_length": params := RuleMaxFilePathLengthParameters{} @@ -705,6 +726,18 @@ func NewRequiredWorkflowsRule(params *RequiredWorkflowsRuleParameters) (rule *Re } } +// NewRequiredCodeScanningRule creates a rule to require which tools must provide code scanning results before the reference is updated. +func NewRequiredCodeScanningRule(params *RequiredCodeScanningRuleParameters) (rule *RepositoryRule) { + bytes, _ := json.Marshal(params) + + rawParams := json.RawMessage(bytes) + + return &RepositoryRule{ + Type: "code_scanning", + Parameters: &rawParams, + } +} + // NewFilePathRestrictionRule creates a rule to restrict file paths from being pushed to. func NewFilePathRestrictionRule(params *RuleFileParameters) (rule *RepositoryRule) { bytes, _ := json.Marshal(params) diff --git a/github/repos_rules_test.go b/github/repos_rules_test.go index e7faf7e7b2c..4af486aaa86 100644 --- a/github/repos_rules_test.go +++ b/github/repos_rules_test.go @@ -294,7 +294,7 @@ func TestRepositoryRule_UnmarshalJSON(t *testing.T) { }, wantErr: true, }, - "Required workflows params": { + "Valid Required workflows params": { data: `{"type":"workflows","parameters":{"workflows":[{"path": ".github/workflows/test.yml", "repository_id": 1}]}}`, want: NewRequiredWorkflowsRule(&RequiredWorkflowsRuleParameters{ RequiredWorkflows: []*RuleRequiredWorkflow{ @@ -305,6 +305,34 @@ func TestRepositoryRule_UnmarshalJSON(t *testing.T) { }, }), }, + "Invalid Required workflows params": { + data: `{"type":"workflows","parameters":{"workflows":[{"path": ".github/workflows/test.yml", "repository_id": "test"}]}}`, + want: &RepositoryRule{ + Type: "workflows", + Parameters: nil, + }, + wantErr: true, + }, + "Valid Required code_scanning params": { + data: `{"type":"code_scanning","parameters":{"code_scanning_tools":[{"tool": "CodeQL", "security_alerts_threshold": "high_or_higher", "alerts_threshold": "errors"}]}}`, + want: NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ + RequiredCodeScanningTools: []*RuleRequiredCodeScanningTools{ + { + Tool: "CodeQL", + SecurityAlertsThreshold: "high_or_higher", + AlertsThreshold: "errors", + }, + }, + }), + }, + "Invalid Required code_scanning params": { + data: `{"type":"code_scanning","parameters":{"code_scanning_tools":[{"tool": 1}]}}`, + want: &RepositoryRule{ + Type: "code_scanning", + Parameters: nil, + }, + wantErr: true, + }, "Invalid type": { data: `{"type":"unknown"}`, want: &RepositoryRule{ From 9412ac2afd7d2730d0c1e25beac900eb5a616541 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Fri, 18 Oct 2024 15:59:31 +0300 Subject: [PATCH 550/751] docs: put a space between `//` and comment text (#3329) --- .golangci.yml | 5 +++++ example/newfilewithappauth/main.go | 6 +++--- github/event_types.go | 3 +-- github/event_types_test.go | 4 ++-- github/github_test.go | 4 ++-- scrape/apps.go | 2 +- test/fields/fields.go | 1 - 7 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 43103588334..252c7c40201 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -6,6 +6,7 @@ linters: enable: - dogsled - dupl + - gocritic - godot - gofmt - goimports @@ -20,6 +21,10 @@ linters: - unparam - whitespace linters-settings: + gocritic: + disable-all: true + enabled-checks: + - commentFormatting gosec: excludes: # duplicates errcheck diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index 7ff5d5b37c3..fd4f4d76ff0 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -33,7 +33,7 @@ func main() { } itr.BaseURL = gitHost - //create git client with app transport + // create git client with app transport client, err := github.NewClient( &http.Client{ Transport: itr, @@ -50,8 +50,8 @@ func main() { log.Fatalf("failed to list installations: %v\n", err) } - //capture our installationId for our app - //we need this for the access token + // capture our installationId for our app + // we need this for the access token var installID int64 for _, val := range installations { installID = val.GetID() diff --git a/github/event_types.go b/github/event_types.go index 64726d77395..f9778215092 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -753,8 +753,7 @@ type MemberChanges struct { // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#member type MemberEvent struct { - // Action is the action that was performed. Possible values are: - //"added", "edited", "removed". + // Action is the action that was performed. Possible values are: "added", "edited", "removed". Action *string `json:"action,omitempty"` Member *User `json:"member,omitempty"` Changes *MemberChanges `json:"changes,omitempty"` diff --git a/github/event_types_test.go b/github/event_types_test.go index 71c8ac3df2e..0c4deab4177 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -9881,7 +9881,7 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { }, Rules: &RepositoryRulesetEditedRules{ Added: []*RepositoryRulesetRule{ - //Creating just one object with all the possible rules for testing + // Creating just one object with all the possible rules for testing { Creation: &RepositoryRulesetRuleType{ Type: "creation", @@ -10035,7 +10035,7 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { }, }, Deleted: []*RepositoryRulesetRule{ - //Creating just one object with all the possible rules for testing + // Creating just one object with all the possible rules for testing { Creation: &RepositoryRulesetRuleType{ Type: "creation", diff --git a/github/github_test.go b/github/github_test.go index d4a06f9f2f5..e16a2e47aca 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -2365,14 +2365,14 @@ func TestErrorResponse_Error(t *testing.T) { t.Errorf("Expected non-empty ErrorResponse.Error()") } - //dont panic if request is nil + // dont panic if request is nil res = &http.Response{} err = ErrorResponse{Message: "m", Response: res} if err.Error() == "" { t.Errorf("Expected non-empty ErrorResponse.Error()") } - //dont panic if response is nil + // dont panic if response is nil err = ErrorResponse{Message: "m"} if err.Error() == "" { t.Errorf("Expected non-empty ErrorResponse.Error()") diff --git a/scrape/apps.go b/scrape/apps.go index 307d8e5a65c..db68b583e1a 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -115,7 +115,7 @@ type OAuthApp struct { type AppManifest struct { // The name of the GitHub App. Name *string `json:"name,omitempty"` - //Required. The homepage of your GitHub App. + // Required. The homepage of your GitHub App. URL *string `json:"url,omitempty"` // The full URL(s) of the endpoint(s) to authenticate users via the GitHub App (Max: 10). CallbackURLs []string `json:"callback_urls,omitempty"` diff --git a/test/fields/fields.go b/test/fields/fields.go index 7979ccc838f..0ea783d8c0c 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -49,7 +49,6 @@ func main() { url string typ interface{} }{ - //{"rate_limit", &github.RateLimits{}}, {"users/octocat", &github.User{}}, {"user", &github.User{}}, {"users/willnorris/keys", &[]github.Key{}}, From cc9a0ed64e518722a1154cc15789b52e304ddde7 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Mon, 21 Oct 2024 08:00:02 -0400 Subject: [PATCH 551/751] feat!: Add name query parameter to ActionsService.ListArtifacts (#3330) Fixes: #3328. BREAKING CHANGE: `opts` argument to `ActionsService.ListArtifacts` changed from `ListOptions` to `ListArtifactsOptions`. --- github/actions_artifacts.go | 12 +++++++++++- github/actions_artifacts_test.go | 7 +++++-- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 11 +++++++++++ 4 files changed, 35 insertions(+), 3 deletions(-) diff --git a/github/actions_artifacts.go b/github/actions_artifacts.go index f804b809b4a..e05a9a84024 100644 --- a/github/actions_artifacts.go +++ b/github/actions_artifacts.go @@ -50,12 +50,22 @@ type ArtifactList struct { Artifacts []*Artifact `json:"artifacts,omitempty"` } +// ListArtifactsOptions specifies the optional parameters to the +// ActionsService.ListArtifacts method. +type ListArtifactsOptions struct { + // Name represents the name field of an artifact. + // When specified, only artifacts with this name will be returned. + Name *string `url:"name,omitempty"` + + ListOptions +} + // ListArtifacts lists all artifacts that belong to a repository. // // GitHub API docs: https://docs.github.com/rest/actions/artifacts#list-artifacts-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/actions/artifacts -func (s *ActionsService) ListArtifacts(ctx context.Context, owner, repo string, opts *ListOptions) (*ArtifactList, *Response, error) { +func (s *ActionsService) ListArtifacts(ctx context.Context, owner, repo string, opts *ListArtifactsOptions) (*ArtifactList, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/artifacts", owner, repo) u, err := addOptions(u, opts) if err != nil { diff --git a/github/actions_artifacts_test.go b/github/actions_artifacts_test.go index c592283d0cd..751b6e26ca2 100644 --- a/github/actions_artifacts_test.go +++ b/github/actions_artifacts_test.go @@ -22,7 +22,7 @@ func TestActionsService_ListArtifacts(t *testing.T) { mux.HandleFunc("/repos/o/r/actions/artifacts", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testFormValues(t, r, values{"page": "2"}) + testFormValues(t, r, values{"page": "2", "name": "TheArtifact"}) fmt.Fprint(w, `{ "total_count":1, @@ -31,7 +31,10 @@ func TestActionsService_ListArtifacts(t *testing.T) { ) }) - opts := &ListOptions{Page: 2} + opts := &ListArtifactsOptions{ + Name: String("TheArtifact"), + ListOptions: ListOptions{Page: 2}, + } ctx := context.Background() artifacts, _, err := client.Actions.ListArtifacts(ctx, "o", "r", opts) if err != nil { diff --git a/github/github-accessors.go b/github/github-accessors.go index 019ba354400..ea4cfb75da1 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -11238,6 +11238,14 @@ func (l *ListAlertsOptions) GetState() string { return *l.State } +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (l *ListArtifactsOptions) GetName() string { + if l == nil || l.Name == nil { + return "" + } + return *l.Name +} + // GetAppID returns the AppID field if it's non-nil, zero value otherwise. func (l *ListCheckRunsOptions) GetAppID() int64 { if l == nil || l.AppID == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 8f1407eeeaf..acd3febe8f6 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -14527,6 +14527,17 @@ func TestListAlertsOptions_GetState(tt *testing.T) { l.GetState() } +func TestListArtifactsOptions_GetName(tt *testing.T) { + tt.Parallel() + var zeroValue string + l := &ListArtifactsOptions{Name: &zeroValue} + l.GetName() + l = &ListArtifactsOptions{} + l.GetName() + l = nil + l.GetName() +} + func TestListCheckRunsOptions_GetAppID(tt *testing.T) { tt.Parallel() var zeroValue int64 From 792bd15b871a8a6aea57cca226ef7a9e85e2955a Mon Sep 17 00:00:00 2001 From: ihor-hrytskiv <39990360+ihor-hrytskiv@users.noreply.github.com> Date: Tue, 22 Oct 2024 15:25:57 +0300 Subject: [PATCH 552/751] feat!: Rename code scanning params from plural to singular (#3331) BREAKING CHANGE: Rename `RuleRequiredCodeScanningTools` to `RuleRequiredCodeScanningTool`. --- github/orgs_rules_test.go | 12 ++++++------ github/repos_rules.go | 6 +++--- github/repos_rules_test.go | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/github/orgs_rules_test.go b/github/orgs_rules_test.go index 353705febad..ac391dae531 100644 --- a/github/orgs_rules_test.go +++ b/github/orgs_rules_test.go @@ -301,7 +301,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) Pattern: "github", }), NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ - RequiredCodeScanningTools: []*RuleRequiredCodeScanningTools{ + RequiredCodeScanningTools: []*RuleRequiredCodeScanningTool{ { Tool: "CodeQL", SecurityAlertsThreshold: "high_or_higher", @@ -396,7 +396,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) Pattern: "github", }), NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ - RequiredCodeScanningTools: []*RuleRequiredCodeScanningTools{ + RequiredCodeScanningTools: []*RuleRequiredCodeScanningTool{ { Tool: "CodeQL", SecurityAlertsThreshold: "high_or_higher", @@ -660,7 +660,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing. Pattern: "github", }), NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ - RequiredCodeScanningTools: []*RuleRequiredCodeScanningTools{ + RequiredCodeScanningTools: []*RuleRequiredCodeScanningTool{ { Tool: "CodeQL", SecurityAlertsThreshold: "high_or_higher", @@ -762,7 +762,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing. Pattern: "github", }), NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ - RequiredCodeScanningTools: []*RuleRequiredCodeScanningTools{ + RequiredCodeScanningTools: []*RuleRequiredCodeScanningTool{ { Tool: "CodeQL", SecurityAlertsThreshold: "high_or_higher", @@ -1009,7 +1009,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { Pattern: "github", }), NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ - RequiredCodeScanningTools: []*RuleRequiredCodeScanningTools{ + RequiredCodeScanningTools: []*RuleRequiredCodeScanningTool{ { Tool: "CodeQL", SecurityAlertsThreshold: "high_or_higher", @@ -1102,7 +1102,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { Pattern: "github", }), NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ - RequiredCodeScanningTools: []*RuleRequiredCodeScanningTools{ + RequiredCodeScanningTools: []*RuleRequiredCodeScanningTool{ { Tool: "CodeQL", SecurityAlertsThreshold: "high_or_higher", diff --git a/github/repos_rules.go b/github/repos_rules.go index bb8aa121f81..07e8afad0ed 100644 --- a/github/repos_rules.go +++ b/github/repos_rules.go @@ -159,8 +159,8 @@ type RequiredWorkflowsRuleParameters struct { RequiredWorkflows []*RuleRequiredWorkflow `json:"workflows"` } -// RuleRequiredCodeScanningTools represents the RequiredCodeScanningTools for the RequiredCodeScanningParameters object. -type RuleRequiredCodeScanningTools struct { +// RuleRequiredCodeScanningTool represents a single required code-scanning tool for the RequiredCodeScanningParameters object. +type RuleRequiredCodeScanningTool struct { AlertsThreshold string `json:"alerts_threshold"` SecurityAlertsThreshold string `json:"security_alerts_threshold"` Tool string `json:"tool"` @@ -168,7 +168,7 @@ type RuleRequiredCodeScanningTools struct { // RequiredCodeScanningRuleParameters represents the code_scanning rule parameters. type RequiredCodeScanningRuleParameters struct { - RequiredCodeScanningTools []*RuleRequiredCodeScanningTools `json:"code_scanning_tools"` + RequiredCodeScanningTools []*RuleRequiredCodeScanningTool `json:"code_scanning_tools"` } // RepositoryRule represents a GitHub Rule. diff --git a/github/repos_rules_test.go b/github/repos_rules_test.go index 4af486aaa86..3f7f6721dbf 100644 --- a/github/repos_rules_test.go +++ b/github/repos_rules_test.go @@ -316,7 +316,7 @@ func TestRepositoryRule_UnmarshalJSON(t *testing.T) { "Valid Required code_scanning params": { data: `{"type":"code_scanning","parameters":{"code_scanning_tools":[{"tool": "CodeQL", "security_alerts_threshold": "high_or_higher", "alerts_threshold": "errors"}]}}`, want: NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ - RequiredCodeScanningTools: []*RuleRequiredCodeScanningTools{ + RequiredCodeScanningTools: []*RuleRequiredCodeScanningTool{ { Tool: "CodeQL", SecurityAlertsThreshold: "high_or_higher", From 08cca48241ca466a1d3b6c8ddfb694df0ec287b0 Mon Sep 17 00:00:00 2001 From: Andrew Gillis Date: Sun, 27 Oct 2024 08:04:39 -0400 Subject: [PATCH 553/751] Add support for fetching artifact attestations at the org, repo and user levels (#3334) --- example/go.mod | 95 ++++- example/go.sum | 396 +++++++++++++++++- example/verifyartifact/main.go | 198 +++++++++ .../trusted-root-public-good.json | 114 +++++ github/attestations.go | 27 ++ github/orgs_attestations.go | 40 ++ github/orgs_attestations_test.go | 72 ++++ github/repos_attestations.go | 39 ++ github/repos_attestations_test.go | 72 ++++ github/users_attestations.go | 40 ++ github/users_attestations_test.go | 72 ++++ 11 files changed, 1143 insertions(+), 22 deletions(-) create mode 100644 example/verifyartifact/main.go create mode 100644 example/verifyartifact/trusted-root-public-good.json create mode 100644 github/attestations.go create mode 100644 github/orgs_attestations.go create mode 100644 github/orgs_attestations_test.go create mode 100644 github/repos_attestations.go create mode 100644 github/repos_attestations_test.go create mode 100644 github/users_attestations.go create mode 100644 github/users_attestations_test.go diff --git a/example/go.mod b/example/go.mod index 5ec2bd5a775..5de15d5902b 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,26 +1,103 @@ module github.com/google/go-github/v66/example -go 1.21 +go 1.22.5 + +toolchain go1.23.2 require ( github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-ratelimit v1.0.3 github.com/google/go-github/v66 v66.0.0 - golang.org/x/crypto v0.21.0 - golang.org/x/term v0.18.0 - google.golang.org/appengine v1.6.7 + github.com/sigstore/sigstore-go v0.6.2 + golang.org/x/crypto v0.27.0 + golang.org/x/term v0.24.0 + google.golang.org/appengine v1.6.8 ) require ( + github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect + github.com/blang/semver v3.5.1+incompatible // indirect github.com/cloudflare/circl v1.3.7 // indirect - github.com/golang-jwt/jwt/v4 v4.0.0 // indirect - github.com/golang/protobuf v1.5.2 // indirect + github.com/cyberphone/json-canonicalization v0.0.0-20220623050100-57a0ce2678a7 // indirect + github.com/digitorus/pkcs7 v0.0.0-20230818184609-3a137a874352 // indirect + github.com/digitorus/timestamp v0.0.0-20231217203849-220c5c2851b7 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/go-chi/chi v4.1.2+incompatible // indirect + github.com/go-jose/go-jose/v4 v4.0.2 // indirect + github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-openapi/analysis v0.23.0 // indirect + github.com/go-openapi/errors v0.22.0 // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect + github.com/go-openapi/jsonreference v0.21.0 // indirect + github.com/go-openapi/loads v0.22.0 // indirect + github.com/go-openapi/runtime v0.28.0 // indirect + github.com/go-openapi/spec v0.21.0 // indirect + github.com/go-openapi/strfmt v0.23.0 // indirect + github.com/go-openapi/swag v0.23.0 // indirect + github.com/go-openapi/validate v0.24.0 // indirect + github.com/golang-jwt/jwt/v4 v4.5.0 // indirect + github.com/golang/protobuf v1.5.4 // indirect + github.com/google/certificate-transparency-go v1.2.1 // indirect + github.com/google/go-containerregistry v0.20.2 // indirect github.com/google/go-github/v41 v41.0.0 // indirect github.com/google/go-querystring v1.1.0 // indirect - golang.org/x/net v0.23.0 // indirect - golang.org/x/sys v0.18.0 // indirect - google.golang.org/protobuf v1.33.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/hashicorp/go-cleanhttp v0.5.2 // indirect + github.com/hashicorp/go-retryablehttp v0.7.7 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/in-toto/attestation v1.1.0 // indirect + github.com/in-toto/in-toto-golang v0.9.0 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/jedisct1/go-minisign v0.0.0-20211028175153-1c139d1cc84b // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/letsencrypt/boulder v0.0.0-20240620165639-de9c06129bec // indirect + github.com/magiconair/properties v1.8.7 // indirect + github.com/mailru/easyjson v0.7.7 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/oklog/ulid v1.3.1 // indirect + github.com/opencontainers/go-digest v1.0.0 // indirect + github.com/opentracing/opentracing-go v1.2.0 // indirect + github.com/pelletier/go-toml/v2 v2.1.0 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/sagikazarmark/locafero v0.4.0 // indirect + github.com/sagikazarmark/slog-shim v0.1.0 // indirect + github.com/sassoftware/relic v7.2.1+incompatible // indirect + github.com/secure-systems-lab/go-securesystemslib v0.8.0 // indirect + github.com/shibumi/go-pathspec v1.3.0 // indirect + github.com/sigstore/protobuf-specs v0.3.2 // indirect + github.com/sigstore/rekor v1.3.6 // indirect + github.com/sigstore/sigstore v1.8.9 // indirect + github.com/sigstore/timestamp-authority v1.2.2 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.11.0 // indirect + github.com/spf13/cast v1.6.0 // indirect + github.com/spf13/cobra v1.8.1 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/spf13/viper v1.18.2 // indirect + github.com/subosito/gotenv v1.6.0 // indirect + github.com/theupdateframework/go-tuf v0.7.0 // indirect + github.com/theupdateframework/go-tuf/v2 v2.0.0 // indirect + github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 // indirect + github.com/transparency-dev/merkle v0.0.2 // indirect + go.mongodb.org/mongo-driver v1.14.0 // indirect + go.opentelemetry.io/otel v1.27.0 // indirect + go.opentelemetry.io/otel/metric v1.27.0 // indirect + go.opentelemetry.io/otel/trace v1.27.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + go.uber.org/zap v1.27.0 // indirect + golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 // indirect + golang.org/x/mod v0.20.0 // indirect + golang.org/x/net v0.27.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/text v0.18.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 // indirect + google.golang.org/protobuf v1.34.2 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + k8s.io/klog/v2 v2.120.1 // indirect ) // Use version at HEAD, not the latest published. diff --git a/example/go.sum b/example/go.sum index 7e3d1749689..facdd200c25 100644 --- a/example/go.sum +++ b/example/go.sum @@ -1,39 +1,375 @@ +cloud.google.com/go v0.112.1 h1:uJSeirPke5UNZHIb4SxfZklVSiWWVqW4oXlETwZziwM= +cloud.google.com/go/compute v1.25.1 h1:ZRpHJedLtTpKgr3RV1Fx23NuaAEN1Zfx9hw1u4aJdjU= +cloud.google.com/go/compute v1.25.1/go.mod h1:oopOIR53ly6viBYxaDhBfJwzUAxf1zE//uf3IB011ls= +cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= +cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +cloud.google.com/go/iam v1.1.6 h1:bEa06k05IO4f4uJonbB5iAgKTPpABy1ayxaIZV/GHVc= +cloud.google.com/go/iam v1.1.6/go.mod h1:O0zxdPeGBoFdWW3HWmBxJsk0pfvNM/p/qa82rWOGTwI= +cloud.google.com/go/kms v1.15.8 h1:szIeDCowID8th2i8XE4uRev5PMxQFqW+JjwYxL9h6xs= +cloud.google.com/go/kms v1.15.8/go.mod h1:WoUHcDjD9pluCg7pNds131awnH429QGvRM3N/4MyoVs= +filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= +filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= +github.com/AdamKorcz/go-fuzz-headers-1 v0.0.0-20230919221257-8b5d3ce2d11d h1:zjqpY4C7H15HjRPEenkS4SAn3Jy2eRRjkjZbGR30TOg= +github.com/AdamKorcz/go-fuzz-headers-1 v0.0.0-20230919221257-8b5d3ce2d11d/go.mod h1:XNqJ7hv2kY++g8XEHREpi+JqZo3+0l+CH2egBVN4yqM= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.10.0 h1:n1DH8TPV4qqPTje2RcUBYwtrTWlabVp4n46+74X2pn4= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.10.0/go.mod h1:HDcZnuGbiyppErN6lB+idp4CKhjbc8gwjto6OPpyggM= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1 h1:sO0/P7g68FrryJzljemN+6GTssUXdANk6aJ7T1ZxnsQ= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1/go.mod h1:h8hyGFDsU5HMivxiS2iYFZsgDbU9OnnJ163x5UGVKYo= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2 h1:LqbJ/WzJUwBf8UiaSzgX7aMclParm9/5Vgp+TY51uBQ= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2/go.mod h1:yInRyqWXAuaPrgI7p70+lDDgh3mlBohis29jGMISnmc= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.1.0 h1:DRiANoJTiW6obBQe3SqZizkuV1PEgfiiGivmVocDy64= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.1.0/go.mod h1:qLIye2hwb/ZouqhpSD9Zn3SJipvpEnz1Ywl3VUk9Y0s= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.0 h1:D3occbWoio4EBLkbkevetNMAVX197GkzbUMtqjGWn80= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.0/go.mod h1:bTSOgj05NGRuHHhQwAdPnYr9TOdNmKlZTgGLL6nyAdI= +github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= +github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg= github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= +github.com/alessio/shellescape v1.4.1 h1:V7yhSDDn8LP4lc4jS8pFkt0zCnzVJlG5JXy9BVKJUX0= +github.com/alessio/shellescape v1.4.1/go.mod h1:PZAiSCk0LJaZkiCSkPv8qIobYglO3FPpyFjDCtHLS30= +github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= +github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= +github.com/aws/aws-sdk-go v1.51.6 h1:Ld36dn9r7P9IjU8WZSaswQ8Y/XUCRpewim5980DwYiU= +github.com/aws/aws-sdk-go v1.51.6/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go-v2 v1.27.2 h1:pLsTXqX93rimAOZG2FIYraDQstZaaGVVN4tNw65v0h8= +github.com/aws/aws-sdk-go-v2 v1.27.2/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM= +github.com/aws/aws-sdk-go-v2/config v1.27.18 h1:wFvAnwOKKe7QAyIxziwSKjmer9JBMH1vzIL6W+fYuKk= +github.com/aws/aws-sdk-go-v2/config v1.27.18/go.mod h1:0xz6cgdX55+kmppvPm2IaKzIXOheGJhAufacPJaXZ7c= +github.com/aws/aws-sdk-go-v2/credentials v1.17.18 h1:D/ALDWqK4JdY3OFgA2thcPO1c9aYTT5STS/CvnkqY1c= +github.com/aws/aws-sdk-go-v2/credentials v1.17.18/go.mod h1:JuitCWq+F5QGUrmMPsk945rop6bB57jdscu+Glozdnc= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.5 h1:dDgptDO9dxeFkXy+tEgVkzSClHZje/6JkPW5aZyEvrQ= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.5/go.mod h1:gjvE2KBUgUQhcv89jqxrIxH9GaKs1JbZzWejj/DaHGA= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.9 h1:cy8ahBJuhtM8GTTSyOkfy6WVPV1IE+SS5/wfXUYuulw= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.9/go.mod h1:CZBXGLaJnEZI6EVNcPd7a6B5IC5cA/GkRWtu9fp3S6Y= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.9 h1:A4SYk07ef04+vxZToz9LWvAXl9LW0NClpPpMsi31cz0= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.9/go.mod h1:5jJcHuwDagxN+ErjQ3PU3ocf6Ylc/p9x+BLO/+X4iXw= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpVgEL2IrrDOf6/m9RQum4NkY= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 h1:Ji0DY1xUsUr3I8cHps0G+XM3WWU16lP6yG8qu1GAZAs= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2/go.mod h1:5CsjAbs3NlGQyZNFACh+zztPDI7fU6eW9QsxjfnuBKg= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.11 h1:o4T+fKxA3gTMcluBNZZXE9DNaMkJuUL1O3mffCUjoJo= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.11/go.mod h1:84oZdJ+VjuJKs9v1UTC9NaodRZRseOXCTgku+vQJWR8= +github.com/aws/aws-sdk-go-v2/service/kms v1.30.0 h1:yS0JkEdV6h9JOo8sy2JSpjX+i7vsKifU8SIeHrqiDhU= +github.com/aws/aws-sdk-go-v2/service/kms v1.30.0/go.mod h1:+I8VUUSVD4p5ISQtzpgSva4I8cJ4SQ4b1dcBcof7O+g= +github.com/aws/aws-sdk-go-v2/service/sso v1.20.11 h1:gEYM2GSpr4YNWc6hCd5nod4+d4kd9vWIAWrmGuLdlMw= +github.com/aws/aws-sdk-go-v2/service/sso v1.20.11/go.mod h1:gVvwPdPNYehHSP9Rs7q27U1EU+3Or2ZpXvzAYJNh63w= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.5 h1:iXjh3uaH3vsVcnyZX7MqCoCfcyxIrVE9iOQruRaWPrQ= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.5/go.mod h1:5ZXesEuy/QcO0WUnt+4sDkxhdXRHTu2yG0uCSH8B6os= +github.com/aws/aws-sdk-go-v2/service/sts v1.28.12 h1:M/1u4HBpwLuMtjlxuI2y6HoVLzF5e2mfxHCg7ZVMYmk= +github.com/aws/aws-sdk-go-v2/service/sts v1.28.12/go.mod h1:kcfd+eTdEi/40FIbLq4Hif3XMXnl5b/+t/KTfLt9xIk= +github.com/aws/smithy-go v1.20.2 h1:tbp628ireGtzcHDDmLT/6ADHidqnwgF57XOXZe6tp4Q= +github.com/aws/smithy-go v1.20.2/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= +github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 h1:tXKVfhE7FcSkhkv0UwkLvPDeZ4kz6OXd0PKPlFqf81M= github.com/bradleyfalzon/ghinstallation/v2 v2.0.4/go.mod h1:B40qPqJxWE0jDZgOR1JmaMy+4AY1eBP+IByOvqyAKp0= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= +github.com/cenkalti/backoff/v3 v3.2.2 h1:cfUAAO3yvKMYKPrvhDuHSwQnhZNk/RMHKdZqKTxfm6M= +github.com/cenkalti/backoff/v3 v3.2.2/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= +github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb h1:EDmT6Q9Zs+SbUoc7Ik9EfrFqcylYqgPZ9ANSbTAntnE= +github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb/go.mod h1:ZjrT6AXHbDs86ZSdt/osfBi5qfexBrKUdONk989Wnk4= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cyberphone/json-canonicalization v0.0.0-20220623050100-57a0ce2678a7 h1:vU+EP9ZuFUCYE0NYLwTSob+3LNEJATzNfP/DC7SWGWI= +github.com/cyberphone/json-canonicalization v0.0.0-20220623050100-57a0ce2678a7/go.mod h1:uzvlm1mxhHkdfqitSA92i7Se+S9ksOn3a3qmv/kyOCw= +github.com/danieljoos/wincred v1.2.0 h1:ozqKHaLK0W/ii4KVbbvluM91W2H3Sh0BncbUNPS7jLE= +github.com/danieljoos/wincred v1.2.0/go.mod h1:FzQLLMKBFdvu+osBrnFODiv32YGwCfx0SkRa/eYHgec= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/digitorus/pkcs7 v0.0.0-20230713084857-e76b763bdc49/go.mod h1:SKVExuS+vpu2l9IoOc0RwqE7NYnb0JlcFHFnEJkVDzc= +github.com/digitorus/pkcs7 v0.0.0-20230818184609-3a137a874352 h1:ge14PCmCvPjpMQMIAH7uKg0lrtNSOdpYsRXlwk3QbaE= +github.com/digitorus/pkcs7 v0.0.0-20230818184609-3a137a874352/go.mod h1:SKVExuS+vpu2l9IoOc0RwqE7NYnb0JlcFHFnEJkVDzc= +github.com/digitorus/timestamp v0.0.0-20231217203849-220c5c2851b7 h1:lxmTCgmHE1GUYL7P0MlNa00M67axePTq+9nBSGddR8I= +github.com/digitorus/timestamp v0.0.0-20231217203849-220c5c2851b7/go.mod h1:GvWntX9qiTlOud0WkQ6ewFm0LPy5JUR1Xo0Ngbd1w6Y= +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/go-chi/chi v4.1.2+incompatible h1:fGFk2Gmi/YKXk0OmGfBh0WgmN3XB8lVnEyNz34tQRec= +github.com/go-chi/chi v4.1.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= +github.com/go-jose/go-jose/v3 v3.0.3 h1:fFKWeig/irsp7XD2zBxvnmA/XaRWp5V3CBsZXJF7G7k= +github.com/go-jose/go-jose/v3 v3.0.3/go.mod h1:5b+7YgP7ZICgJDBdfjZaIt+H/9L9T/YQrVfLAMboGkQ= +github.com/go-jose/go-jose/v4 v4.0.2 h1:R3l3kkBds16bO7ZFAEEcofK0MkrAJt3jlJznWZG0nvk= +github.com/go-jose/go-jose/v4 v4.0.2/go.mod h1:WVf9LFMHh/QVrmqrOfqun0C45tMe3RoiKJMPvgWwLfY= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-openapi/analysis v0.23.0 h1:aGday7OWupfMs+LbmLZG4k0MYXIANxcuBTYUC03zFCU= +github.com/go-openapi/analysis v0.23.0/go.mod h1:9mz9ZWaSlV8TvjQHLl2mUW2PbZtemkE8yA5v22ohupo= +github.com/go-openapi/errors v0.22.0 h1:c4xY/OLxUBSTiepAg3j/MHuAv5mJhnf53LLMWFB+u/w= +github.com/go-openapi/errors v0.22.0/go.mod h1:J3DmZScxCDufmIMsdOuDHxJbdOGC0xtUynjIx092vXE= +github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= +github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= +github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= +github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4= +github.com/go-openapi/loads v0.22.0 h1:ECPGd4jX1U6NApCGG1We+uEozOAvXvJSF4nnwHZ8Aco= +github.com/go-openapi/loads v0.22.0/go.mod h1:yLsaTCS92mnSAZX5WWoxszLj0u+Ojl+Zs5Stn1oF+rs= +github.com/go-openapi/runtime v0.28.0 h1:gpPPmWSNGo214l6n8hzdXYhPuJcGtziTOgUpvsFWGIQ= +github.com/go-openapi/runtime v0.28.0/go.mod h1:QN7OzcS+XuYmkQLw05akXk0jRH/eZ3kb18+1KwW9gyc= +github.com/go-openapi/spec v0.21.0 h1:LTVzPc3p/RzRnkQqLRndbAzjY0d0BCL72A6j3CdL9ZY= +github.com/go-openapi/spec v0.21.0/go.mod h1:78u6VdPw81XU44qEWGhtr982gJ5BWg2c0I5XwVMotYk= +github.com/go-openapi/strfmt v0.23.0 h1:nlUS6BCqcnAk0pyhi9Y+kdDVZdZMHfEKQiS4HaMgO/c= +github.com/go-openapi/strfmt v0.23.0/go.mod h1:NrtIpfKtWIygRkKVsxh7XQMDQW5HKQl6S5ik2elW+K4= +github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= +github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= +github.com/go-openapi/validate v0.24.0 h1:LdfDKwNbpB6Vn40xhTdNZAnfLECL81w+VX3BumrGD58= +github.com/go-openapi/validate v0.24.0/go.mod h1:iyeX1sEufmv3nPbBdX3ieNviWnOZaJ1+zquzJEf2BAQ= +github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y= +github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= +github.com/go-test/deep v1.1.1 h1:0r/53hagsehfO4bzD2Pgr/+RgHqhmf+k1Bpse2cTu1U= +github.com/go-test/deep v1.1.1/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= +github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= +github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofri/go-github-ratelimit v1.0.3 h1:Ocs2jaYokZDzgvqaajX+g04dqFyVqL0JQzoO7d2wmlk= github.com/gofri/go-github-ratelimit v1.0.3/go.mod h1:OnCi5gV+hAG/LMR7llGhU7yHt44se9sYgKPnafoL7RY= -github.com/golang-jwt/jwt/v4 v4.0.0 h1:RAqyYixv1p7uEnocuy8P1nru5wprCh/MH2BIlW5z5/o= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= +github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= +github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= +github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/certificate-transparency-go v1.2.1 h1:4iW/NwzqOqYEEoCBEFP+jPbBXbLqMpq3CifMyOnDUME= +github.com/google/certificate-transparency-go v1.2.1/go.mod h1:bvn/ytAccv+I6+DGkqpvSsEdiVGramgaSC6RD3tEmeE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-containerregistry v0.20.2 h1:B1wPJ1SN/S7pB+ZAimcciVD+r+yV/l/DSArMxlbwseo= +github.com/google/go-containerregistry v0.20.2/go.mod h1:z38EKdKh4h7IP2gSfUUqEvalZBqs6AoLeWfUy34nQC8= github.com/google/go-github/v41 v41.0.0 h1:HseJrM2JFf2vfiZJ8anY2hqBjdfY1Vlj/K27ueww4gg= github.com/google/go-github/v41 v41.0.0/go.mod h1:XgmCA5H323A9rtgExdTcnDkcqp6S30AVACCBDOonIxg= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= +github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= +github.com/google/tink/go v1.7.0 h1:6Eox8zONGebBFcCBqkVmt60LaWZa6xg1cl/DwAh/J1w= +github.com/google/tink/go v1.7.0/go.mod h1:GAUOd+QE3pgj9q8VKIGTCP33c/B7eb4NhxLcgTJZStM= +github.com/google/trillian v1.6.0 h1:jMBeDBIkINFvS2n6oV5maDqfRlxREAc6CW9QYWQ0qT4= +github.com/google/trillian v1.6.0/go.mod h1:Yu3nIMITzNhhMJEHjAtp6xKiu+H/iHu2Oq5FjV2mCWI= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= +github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= +github.com/googleapis/gax-go/v2 v2.12.3 h1:5/zPPDvw8Q1SuXjrqrZslrqT7dL/uJT2CQii/cLCKqA= +github.com/googleapis/gax-go/v2 v2.12.3/go.mod h1:AKloxT6GtNbaLm8QTNSidHUVsHYcBHwWRvkNFJUQcS4= +github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= +github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= +github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU= +github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk= +github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= +github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/go-secure-stdlib/parseutil v0.1.7 h1:UpiO20jno/eV1eVZcxqWnUohyKRe1g8FPV/xH1s/2qs= +github.com/hashicorp/go-secure-stdlib/parseutil v0.1.7/go.mod h1:QmrqtbKuxxSWTN3ETMPuB+VtEiBJ/A9XhoYGv8E1uD8= +github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 h1:kes8mmyCpxJsI7FTwtzRqEy9CdjCtrXrXGuOpxEA7Ts= +github.com/hashicorp/go-secure-stdlib/strutil v0.1.2/go.mod h1:Gou2R9+il93BqX25LAKCLuM+y9U2T4hlwvT1yprcna4= +github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc= +github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= +github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/vault/api v1.12.2 h1:7YkCTE5Ni90TcmYHDBExdt4WGJxhpzaHqR6uGbQb/rE= +github.com/hashicorp/vault/api v1.12.2/go.mod h1:LSGf1NGT1BnvFFnKVtnvcaLBM2Lz+gJdpL6HUYed8KE= +github.com/howeyc/gopass v0.0.0-20210920133722-c8aef6fb66ef h1:A9HsByNhogrvm9cWb28sjiS3i7tcKCkflWFEkHfuAgM= +github.com/howeyc/gopass v0.0.0-20210920133722-c8aef6fb66ef/go.mod h1:lADxMC39cJJqL93Duh1xhAs4I2Zs8mKS89XWXFGp9cs= +github.com/in-toto/attestation v1.1.0 h1:oRWzfmZPDSctChD0VaQV7MJrywKOzyNrtpENQFq//2Q= +github.com/in-toto/attestation v1.1.0/go.mod h1:DB59ytd3z7cIHgXxwpSX2SABrU6WJUKg/grpdgHVgVs= +github.com/in-toto/in-toto-golang v0.9.0 h1:tHny7ac4KgtsfrG6ybU8gVOZux2H8jN05AXJ9EBM1XU= +github.com/in-toto/in-toto-golang v0.9.0/go.mod h1:xsBVrVsHNsB61++S6Dy2vWosKhuA3lUTQd+eF9HdeMo= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/jedisct1/go-minisign v0.0.0-20211028175153-1c139d1cc84b h1:ZGiXF8sz7PDk6RgkP+A/SFfUD0ZR/AgG6SpRNEDKZy8= +github.com/jedisct1/go-minisign v0.0.0-20211028175153-1c139d1cc84b/go.mod h1:hQmNrgofl+IY/8L+n20H6E6PWBBTokdsv+q49j0QhsU= +github.com/jellydator/ttlcache/v3 v3.2.0 h1:6lqVJ8X3ZaUwvzENqPAobDsXNExfUJd61u++uW8a3LE= +github.com/jellydator/ttlcache/v3 v3.2.0/go.mod h1:hi7MGFdMAwZna5n2tuvh63DvFLzVKySzCVW6+0gA2n4= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmhodges/clock v1.2.0 h1:eq4kys+NI0PLngzaHEe7AmPT90XMGIEySD1JfV1PDIs= +github.com/jmhodges/clock v1.2.0/go.mod h1:qKjhA7x7u/lQpPB1XAqX1b1lCI/w3/fNuYpI/ZjLynI= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/letsencrypt/boulder v0.0.0-20240620165639-de9c06129bec h1:2tTW6cDth2TSgRbAhD7yjZzTQmcN25sDRPEeinR51yQ= +github.com/letsencrypt/boulder v0.0.0-20240620165639-de9c06129bec/go.mod h1:TmwEoGCwIti7BCeJ9hescZgRtatxRE+A72pCoPfmcfk= +github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= +github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= +github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= +github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= +github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= +github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= +github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= +github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= +github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= +github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= +github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= +github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE= +github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= +github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk= +github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= +github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= +github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= +github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= +github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= +github.com/sassoftware/relic v7.2.1+incompatible h1:Pwyh1F3I0r4clFJXkSI8bOyJINGqpgjJU3DYAZeI05A= +github.com/sassoftware/relic v7.2.1+incompatible/go.mod h1:CWfAxv73/iLZ17rbyhIEq3K9hs5w6FpNMdUT//qR+zk= +github.com/sassoftware/relic/v7 v7.6.2 h1:rS44Lbv9G9eXsukknS4mSjIAuuX+lMq/FnStgmZlUv4= +github.com/sassoftware/relic/v7 v7.6.2/go.mod h1:kjmP0IBVkJZ6gXeAu35/KCEfca//+PKM6vTAsyDPY+k= +github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbmfHkLguCE9laoZCUzEEpIZXA= +github.com/secure-systems-lab/go-securesystemslib v0.8.0/go.mod h1:UH2VZVuJfCYR8WgMlCU1uFsOUU+KeyrTWcSS73NBOzU= +github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= +github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= +github.com/shibumi/go-pathspec v1.3.0 h1:QUyMZhFo0Md5B8zV8x2tesohbb5kfbpTi9rBnKh5dkI= +github.com/shibumi/go-pathspec v1.3.0/go.mod h1:Xutfslp817l2I1cZvgcfeMQJG5QnU2lh5tVaaMCl3jE= +github.com/sigstore/protobuf-specs v0.3.2 h1:nCVARCN+fHjlNCk3ThNXwrZRqIommIeNKWwQvORuRQo= +github.com/sigstore/protobuf-specs v0.3.2/go.mod h1:RZ0uOdJR4OB3tLQeAyWoJFbNCBFrPQdcokntde4zRBA= +github.com/sigstore/rekor v1.3.6 h1:QvpMMJVWAp69a3CHzdrLelqEqpTM3ByQRt5B5Kspbi8= +github.com/sigstore/rekor v1.3.6/go.mod h1:JDTSNNMdQ/PxdsS49DJkJ+pRJCO/83nbR5p3aZQteXc= +github.com/sigstore/sigstore v1.8.9 h1:NiUZIVWywgYuVTxXmRoTT4O4QAGiTEKup4N1wdxFadk= +github.com/sigstore/sigstore v1.8.9/go.mod h1:d9ZAbNDs8JJfxJrYmulaTazU3Pwr8uLL9+mii4BNR3w= +github.com/sigstore/sigstore-go v0.6.2 h1:8uiywjt73vzfrGfWYVwVsiB1E1Qmwmpgr1kVpl4fs6A= +github.com/sigstore/sigstore-go v0.6.2/go.mod h1:pOIUH7Jx+ctwMICo+2zNrViOJJN5sGaQgwX4yAVJkA0= +github.com/sigstore/sigstore/pkg/signature/kms/aws v1.8.3 h1:LTfPadUAo+PDRUbbdqbeSl2OuoFQwUFTnJ4stu+nwWw= +github.com/sigstore/sigstore/pkg/signature/kms/aws v1.8.3/go.mod h1:QV/Lxlxm0POyhfyBtIbTWxNeF18clMlkkyL9mu45y18= +github.com/sigstore/sigstore/pkg/signature/kms/azure v1.8.3 h1:xgbPRCr2npmmsuVVteJqi/ERw9+I13Wou7kq0Yk4D8g= +github.com/sigstore/sigstore/pkg/signature/kms/azure v1.8.3/go.mod h1:G4+I83FILPX6MtnoaUdmv/bRGEVtR3JdLeJa/kXdk/0= +github.com/sigstore/sigstore/pkg/signature/kms/gcp v1.8.3 h1:vDl2fqPT0h3D/k6NZPlqnKFd1tz3335wm39qjvpZNJc= +github.com/sigstore/sigstore/pkg/signature/kms/gcp v1.8.3/go.mod h1:9uOJXbXEXj+M6QjMKH5PaL5WDMu43rHfbIMgXzA8eKI= +github.com/sigstore/sigstore/pkg/signature/kms/hashivault v1.8.3 h1:h9G8j+Ds21zqqulDbA/R/ft64oQQIyp8S7wJYABYSlg= +github.com/sigstore/sigstore/pkg/signature/kms/hashivault v1.8.3/go.mod h1:zgCeHOuqF6k7A7TTEvftcA9V3FRzB7mrPtHOhXAQBnc= +github.com/sigstore/timestamp-authority v1.2.2 h1:X4qyutnCQqJ0apMewFyx+3t7Tws00JQ/JonBiu3QvLE= +github.com/sigstore/timestamp-authority v1.2.2/go.mod h1:nEah4Eq4wpliDjlY342rXclGSO7Kb9hoRrl9tqLW13A= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= +github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= +github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= +github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= +github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ= +github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= +github.com/theupdateframework/go-tuf v0.7.0 h1:CqbQFrWo1ae3/I0UCblSbczevCCbS31Qvs5LdxRWqRI= +github.com/theupdateframework/go-tuf v0.7.0/go.mod h1:uEB7WSY+7ZIugK6R1hiBMBjQftaFzn7ZCDJcp1tCUug= +github.com/theupdateframework/go-tuf/v2 v2.0.0 h1:rD8d9RotYBprZVgC+9oyTZ5MmawepnTSTqoDuxjWgbs= +github.com/theupdateframework/go-tuf/v2 v2.0.0/go.mod h1:baB22nBHeHBCeuGZcIlctNq4P61PcOdyARlplg5xmLA= +github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 h1:e/5i7d4oYZ+C1wj2THlRK+oAhjeS/TRQwMfkIuet3w0= +github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399/go.mod h1:LdwHTNJT99C5fTAzDz0ud328OgXz+gierycbcIx2fRs= +github.com/transparency-dev/merkle v0.0.2 h1:Q9nBoQcZcgPamMkGn7ghV8XiTZ/kRxn1yCG81+twTK4= +github.com/transparency-dev/merkle v0.0.2/go.mod h1:pqSy+OXefQ1EDUVmAJ8MUhHB9TXGuzVAT58PqBoHz1A= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/zalando/go-keyring v0.2.3 h1:v9CUu9phlABObO4LPWycf+zwMG7nlbb3t/B5wa97yms= +github.com/zalando/go-keyring v0.2.3/go.mod h1:HL4k+OXQfJUWaMnqyuSOc0drfGPX2b51Du6K+MRgZMk= +go.mongodb.org/mongo-driver v1.14.0 h1:P98w8egYRjYe3XDjxhYJagTokP/H6HzlsnojRgZRd80= +go.mongodb.org/mongo-driver v1.14.0/go.mod h1:Vzb0Mk/pa7e6cWw85R4F/endUC3u0U9jGcNU603k65c= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 h1:vS1Ao/R55RNV4O7TA2Qopok8yN+X0LIP6RVWLFkprck= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0/go.mod h1:BMsdeOxN04K0L5FNUBfjFdvwWGNe/rkmSwH4Aelu/X0= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 h1:9l89oX4ba9kHbBol3Xin3leYJ+252h0zszDtBwyKe2A= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0/go.mod h1:XLZfZboOJWHNKUv7eH0inh0E9VV6eWDFB/9yJyTLPp0= +go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= +go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= +go.opentelemetry.io/otel/metric v1.27.0 h1:hvj3vdEKyeCi4YaYfNjv2NUje8FqKqUY8IlF0FxV/ik= +go.opentelemetry.io/otel/metric v1.27.0/go.mod h1:mVFgmRlhljgBiuk/MP/oKylr4hs85GZAylncepAX/ak= +go.opentelemetry.io/otel/sdk v1.27.0 h1:mlk+/Y1gLPLn84U4tI8d3GNJmGT/eXe3ZuOXN9kTWmI= +go.opentelemetry.io/otel/sdk v1.27.0/go.mod h1:Ha9vbLwJE6W86YstIywK2xFfPjbWlCuwPtMkKdz/Y4A= +go.opentelemetry.io/otel/trace v1.27.0 h1:IqYb813p7cmbHk0a5y6pD5JPakbVfftRXABGt5/Rscw= +go.opentelemetry.io/otel/trace v1.27.0/go.mod h1:6RiD1hkAprV4/q+yd2ln1HG9GoPx39SuvvstaLBl+l4= +go.step.sm/crypto v0.44.2 h1:t3p3uQ7raP2jp2ha9P6xkQF85TJZh+87xmjSLaib+jk= +go.step.sm/crypto v0.44.2/go.mod h1:x1439EnFhadzhkuaGX7sz03LEMQ+jV4gRamf5LCZJQQ= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= +golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= +golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 h1:hNQpMuAJe5CtcUqCXaWga3FHu+kQvCqcsoVaQgSV60o= +golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= +golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= @@ -41,12 +377,16 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= +golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= +golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -56,31 +396,61 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= +golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/api v0.172.0 h1:/1OcMZGPmW1rX2LCu2CmGUD1KXK1+pfzxotxyRUCCdk= +google.golang.org/api v0.172.0/go.mod h1:+fJZq6QXWfa9pXhnIzsjx4yI22d4aI9ZpLb58gvXjis= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= +google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= +google.golang.org/genproto v0.0.0-20240311173647-c811ad7063a7 h1:ImUcDPHjTrAqNhlOkSocDLfG9rrNHH7w7uoKWPaWZ8s= +google.golang.org/genproto v0.0.0-20240311173647-c811ad7063a7/go.mod h1:/3XmxOjePkvmKrHuBy4zNFw7IzxJXtAgdpXi8Ll990U= +google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 h1:P8OJ/WCl/Xo4E4zoe4/bifHpSmmKwARqyqE4nW6J2GQ= +google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5/go.mod h1:RGnPtTG7r4i8sPlNyDeikXF99hMM+hN6QMm4ooG9g2g= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 h1:Q2RxlXqh1cgzzUgV261vBO2jI5R/3DD1J2pM0nI4NhU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/grpc v1.64.1 h1:LKtvyfbX3UGVPFcGqJ9ItpVWW6oN/2XqTxfAnwRRXiA= +google.golang.org/grpc v1.64.1/go.mod h1:hiQF4LFZelK2WKaP6W0L92zGHtiQdZxk8CrSdvyjeP0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= +k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= +software.sslmate.com/src/go-pkcs12 v0.4.0 h1:H2g08FrTvSFKUj+D309j1DPfk5APnIdAQAB8aEykJ5k= +software.sslmate.com/src/go-pkcs12 v0.4.0/go.mod h1:Qiz0EyvDRJjjxGyUQa2cCNZn/wMyzrRJ/qcDXOQazLI= diff --git a/example/verifyartifact/main.go b/example/verifyartifact/main.go new file mode 100644 index 00000000000..01ea9110770 --- /dev/null +++ b/example/verifyartifact/main.go @@ -0,0 +1,198 @@ +// Copyright 2024 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. + +// This is a simple example of how to verify an artifact +// attestations hosted on GitHub using the sigstore-go library. +// This is a very barebones example drawn from the sigstore-go +// library's examples and should not be used in production. +package main + +import ( + "context" + "encoding/hex" + "encoding/json" + "flag" + "fmt" + "log" + "os" + + "github.com/google/go-github/v66/github" + "github.com/sigstore/sigstore-go/pkg/bundle" + "github.com/sigstore/sigstore-go/pkg/root" + "github.com/sigstore/sigstore-go/pkg/verify" +) + +var ( + owner = flag.String("owner", "cli", "GitHub organization or user to scope attestation lookup by") + // You can use a utility like openssl or sha256sum to + // compute the digest. + artifactDigest = flag.String("artifact-digest", "", "The digest of the artifact") + // The algorithm used to compute the digest of the artifact. + // Note that the GitHub API only currently support querying + // by sha256 digest. + artifactDigestAlgorithm = flag.String("artifact-digest-algorithm", "sha256", "The algorithm used to compute the digest of the artifact") + // Attestations produced by GitHub Actions use ID token + // issued by GitHub. + expectedIssuer = flag.String("expected-issuer", "https://token.actions.githubusercontent.com", "Issuer of the OIDC token") + // Subject Alternative Name is set to the calling workflow file. + // This value will vary from repository to repository. + expectedSAN = flag.String("expected-san", "https://github.com/cli/cli/.github/workflows/deployment.yml@refs/heads/trunk", "The expected Subject Alternative Name (SAN) of the certificate used to sign the attestation") + // Attestations produced by GitHub Actions use the public + // good trust root maintained by Sigstore. + // A copy is included in this repo for convenience. + // + // https://github.com/sigstore/root-signing/raw/refs/heads/main/targets/trusted_root.json + trustedRootJSONPath = flag.String("trusted-root-json-path", "verifyartifact/trusted-root-public-good.json", "Path to the trusted root JSON file") +) + +func usage() { + fmt.Fprintln(os.Stderr, "This is an example of how to verify the provenance of an artifact using GitHub Attestations and the sigstore-go library.") + fmt.Fprintf(os.Stderr, "\nUsage: %s [flags]\n", os.Args[0]) + fmt.Fprint(os.Stderr, "\nThe flags are:\n") + flag.PrintDefaults() + fmt.Fprintf(os.Stderr, ` +Example: +Verifying a GitHub CLI artifact + %s -owner cli \ + -artifact-digest 2ce2e480e3c3f7ca0af83418d3ebaeedacee135dbac94bd946d7d84edabcdb64 \ + -expected-san https://github.com/cli/cli/.github/workflows/deployment.yml@refs/heads/trunk + + See https://github.com/cli/cli/attestations/2543768 for a summary of the attestation. +`, os.Args[0]) +} + +func main() { + flag.Parse() + if *artifactDigest == "" { + fmt.Fprintln(os.Stderr, "artifact-digest is required.") + usage() + os.Exit(1) + } + + token := os.Getenv("GITHUB_AUTH_TOKEN") + + if token == "" { + log.Fatal("Unauthorized: No token present. Please set the GITHUB_AUTH_TOKEN environment variable to a valid token with `attestations:read` permission.") + } + + ctx := context.Background() + client := github.NewClient(nil).WithAuthToken(token) + + // Fetch attestations from the GitHub API. + // The attestations API doesn't differentiate between users and orgs, + // so we can use the OrganizationsService to fetch attestations for both. + attestations, _, err := client.Organizations.ListAttestations(ctx, *owner, fmt.Sprintf("%v:%v", *artifactDigestAlgorithm, *artifactDigest), nil) + if err != nil { + log.Fatal(err) + } + + if len(attestations.Attestations) == 0 { + log.Fatal("No attestations found.") + } + + sev, err := getSignedEntityVerifier() + if err != nil { + log.Fatal(err) + } + + pb, err := getPolicyBuilder() + if err != nil { + log.Fatal(err) + } + + var b *bundle.Bundle + for _, attestation := range attestations.Attestations { + if err := json.Unmarshal(attestation.Bundle, &b); err != nil { + log.Fatal(err) + } + + err := runVerification(sev, pb, b) + + if err != nil { + log.Fatal(err) + } + } +} + +func getTrustedMaterial() (root.TrustedMaterialCollection, error) { + trustedRootJSON, err := os.ReadFile(*trustedRootJSONPath) + if err != nil { + return nil, fmt.Errorf("failed to read %s: %w", *trustedRootJSONPath, err) + } + + trustedRoot, err := root.NewTrustedRootFromJSON(trustedRootJSON) + if err != nil { + return nil, err + } + + trustedMaterial := root.TrustedMaterialCollection{ + trustedRoot, + } + + return trustedMaterial, nil +} + +func getIdentityPolicies() ([]verify.PolicyOption, error) { + certID, err := verify.NewShortCertificateIdentity(*expectedIssuer, "", *expectedSAN, "") + if err != nil { + return nil, err + } + + return []verify.PolicyOption{ + verify.WithCertificateIdentity(certID), + }, nil +} + +func getSignedEntityVerifier() (*verify.SignedEntityVerifier, error) { + // Set up the verifier + verifierConfig := []verify.VerifierOption{ + verify.WithSignedCertificateTimestamps(1), + verify.WithObserverTimestamps(1), + verify.WithTransparencyLog(1), + } + + // Set up the trusted material + trustedMaterial, err := getTrustedMaterial() + if err != nil { + return nil, err + } + + return verify.NewSignedEntityVerifier(trustedMaterial, verifierConfig...) +} + +func getPolicyBuilder() (*verify.PolicyBuilder, error) { + // Set up the identity policy + identityPolicies, err := getIdentityPolicies() + if err != nil { + return nil, err + } + + // Set up the articaft policy + artifactDigestBytes, err := hex.DecodeString(*artifactDigest) + if err != nil { + return nil, err + } + artifactPolicy := verify.WithArtifactDigest(*artifactDigestAlgorithm, artifactDigestBytes) + + pb := verify.NewPolicy(artifactPolicy, identityPolicies...) + return &pb, nil +} + +func runVerification(sev *verify.SignedEntityVerifier, pb *verify.PolicyBuilder, b *bundle.Bundle) error { + res, err := sev.Verify(b, *pb) + if err != nil { + return err + } + + fmt.Fprintf(os.Stderr, "Verification successful!\n") + + marshaled, err := json.MarshalIndent(res, "", " ") + if err != nil { + return err + } + + fmt.Println(string(marshaled)) + return nil +} diff --git a/example/verifyartifact/trusted-root-public-good.json b/example/verifyartifact/trusted-root-public-good.json new file mode 100644 index 00000000000..5ed62811e17 --- /dev/null +++ b/example/verifyartifact/trusted-root-public-good.json @@ -0,0 +1,114 @@ +{ + "mediaType": "application/vnd.dev.sigstore.trustedroot+json;version=0.1", + "tlogs": [ + { + "baseUrl": "https://rekor.sigstore.dev", + "hashAlgorithm": "SHA2_256", + "publicKey": { + "rawBytes": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE2G2Y+2tabdTV5BcGiBIx0a9fAFwrkBbmLSGtks4L3qX6yYY0zufBnhC8Ur/iy55GhWP/9A/bY2LhC30M9+RYtw==", + "keyDetails": "PKIX_ECDSA_P256_SHA_256", + "validFor": { + "start": "2021-01-12T11:53:27.000Z" + } + }, + "logId": { + "keyId": "wNI9atQGlz+VWfO6LRygH4QUfY/8W4RFwiT5i5WRgB0=" + } + } + ], + "certificateAuthorities": [ + { + "subject": { + "organization": "sigstore.dev", + "commonName": "sigstore" + }, + "uri": "https://fulcio.sigstore.dev", + "certChain": { + "certificates": [ + { + "rawBytes": "MIIB+DCCAX6gAwIBAgITNVkDZoCiofPDsy7dfm6geLbuhzAKBggqhkjOPQQDAzAqMRUwEwYDVQQKEwxzaWdzdG9yZS5kZXYxETAPBgNVBAMTCHNpZ3N0b3JlMB4XDTIxMDMwNzAzMjAyOVoXDTMxMDIyMzAzMjAyOVowKjEVMBMGA1UEChMMc2lnc3RvcmUuZGV2MREwDwYDVQQDEwhzaWdzdG9yZTB2MBAGByqGSM49AgEGBSuBBAAiA2IABLSyA7Ii5k+pNO8ZEWY0ylemWDowOkNa3kL+GZE5Z5GWehL9/A9bRNA3RbrsZ5i0JcastaRL7Sp5fp/jD5dxqc/UdTVnlvS16an+2Yfswe/QuLolRUCrcOE2+2iA5+tzd6NmMGQwDgYDVR0PAQH/BAQDAgEGMBIGA1UdEwEB/wQIMAYBAf8CAQEwHQYDVR0OBBYEFMjFHQBBmiQpMlEk6w2uSu1KBtPsMB8GA1UdIwQYMBaAFMjFHQBBmiQpMlEk6w2uSu1KBtPsMAoGCCqGSM49BAMDA2gAMGUCMH8liWJfMui6vXXBhjDgY4MwslmN/TJxVe/83WrFomwmNf056y1X48F9c4m3a3ozXAIxAKjRay5/aj/jsKKGIkmQatjI8uupHr/+CxFvaJWmpYqNkLDGRU+9orzh5hI2RrcuaQ==" + } + ] + }, + "validFor": { + "start": "2021-03-07T03:20:29.000Z", + "end": "2022-12-31T23:59:59.999Z" + } + }, + { + "subject": { + "organization": "sigstore.dev", + "commonName": "sigstore" + }, + "uri": "https://fulcio.sigstore.dev", + "certChain": { + "certificates": [ + { + "rawBytes": "MIICGjCCAaGgAwIBAgIUALnViVfnU0brJasmRkHrn/UnfaQwCgYIKoZIzj0EAwMwKjEVMBMGA1UEChMMc2lnc3RvcmUuZGV2MREwDwYDVQQDEwhzaWdzdG9yZTAeFw0yMjA0MTMyMDA2MTVaFw0zMTEwMDUxMzU2NThaMDcxFTATBgNVBAoTDHNpZ3N0b3JlLmRldjEeMBwGA1UEAxMVc2lnc3RvcmUtaW50ZXJtZWRpYXRlMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE8RVS/ysH+NOvuDZyPIZtilgUF9NlarYpAd9HP1vBBH1U5CV77LSS7s0ZiH4nE7Hv7ptS6LvvR/STk798LVgMzLlJ4HeIfF3tHSaexLcYpSASr1kS0N/RgBJz/9jWCiXno3sweTAOBgNVHQ8BAf8EBAMCAQYwEwYDVR0lBAwwCgYIKwYBBQUHAwMwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHQ4EFgQU39Ppz1YkEZb5qNjpKFWixi4YZD8wHwYDVR0jBBgwFoAUWMAeX5FFpWapesyQoZMi0CrFxfowCgYIKoZIzj0EAwMDZwAwZAIwPCsQK4DYiZYDPIaDi5HFKnfxXx6ASSVmERfsynYBiX2X6SJRnZU84/9DZdnFvvxmAjBOt6QpBlc4J/0DxvkTCqpclvziL6BCCPnjdlIB3Pu3BxsPmygUY7Ii2zbdCdliiow=" + }, + { + "rawBytes": "MIIB9zCCAXygAwIBAgIUALZNAPFdxHPwjeDloDwyYChAO/4wCgYIKoZIzj0EAwMwKjEVMBMGA1UEChMMc2lnc3RvcmUuZGV2MREwDwYDVQQDEwhzaWdzdG9yZTAeFw0yMTEwMDcxMzU2NTlaFw0zMTEwMDUxMzU2NThaMCoxFTATBgNVBAoTDHNpZ3N0b3JlLmRldjERMA8GA1UEAxMIc2lnc3RvcmUwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAT7XeFT4rb3PQGwS4IajtLk3/OlnpgangaBclYpsYBr5i+4ynB07ceb3LP0OIOZdxexX69c5iVuyJRQ+Hz05yi+UF3uBWAlHpiS5sh0+H2GHE7SXrk1EC5m1Tr19L9gg92jYzBhMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRYwB5fkUWlZql6zJChkyLQKsXF+jAfBgNVHSMEGDAWgBRYwB5fkUWlZql6zJChkyLQKsXF+jAKBggqhkjOPQQDAwNpADBmAjEAj1nHeXZp+13NWBNa+EDsDP8G1WWg1tCMWP/WHPqpaVo0jhsweNFZgSs0eE7wYI4qAjEA2WB9ot98sIkoF3vZYdd3/VtWB5b9TNMea7Ix/stJ5TfcLLeABLE4BNJOsQ4vnBHJ" + } + ] + }, + "validFor": { + "start": "2022-04-13T20:06:15.000Z" + } + } + ], + "ctlogs": [ + { + "baseUrl": "https://ctfe.sigstore.dev/test", + "hashAlgorithm": "SHA2_256", + "publicKey": { + "rawBytes": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEbfwR+RJudXscgRBRpKX1XFDy3PyudDxz/SfnRi1fT8ekpfBd2O1uoz7jr3Z8nKzxA69EUQ+eFCFI3zeubPWU7w==", + "keyDetails": "PKIX_ECDSA_P256_SHA_256", + "validFor": { + "start": "2021-03-14T00:00:00.000Z", + "end": "2022-10-31T23:59:59.999Z" + } + }, + "logId": { + "keyId": "CGCS8ChS/2hF0dFrJ4ScRWcYrBY9wzjSbea8IgY2b3I=" + } + }, + { + "baseUrl": "https://ctfe.sigstore.dev/2022", + "hashAlgorithm": "SHA2_256", + "publicKey": { + "rawBytes": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEiPSlFi0CmFTfEjCUqF9HuCEcYXNKAaYalIJmBZ8yyezPjTqhxrKBpMnaocVtLJBI1eM3uXnQzQGAJdJ4gs9Fyw==", + "keyDetails": "PKIX_ECDSA_P256_SHA_256", + "validFor": { + "start": "2022-10-20T00:00:00.000Z" + } + }, + "logId": { + "keyId": "3T0wasbHETJjGR4cmWc3AqJKXrjePK3/h4pygC8p7o4=" + } + } + ], + "timestampAuthorities": [ + { + "subject": { + "organization": "GitHub, Inc.", + "commonName": "Internal Services Root" + }, + "certChain": { + "certificates": [ + { + "rawBytes": "MIIB3DCCAWKgAwIBAgIUchkNsH36Xa04b1LqIc+qr9DVecMwCgYIKoZIzj0EAwMwMjEVMBMGA1UEChMMR2l0SHViLCBJbmMuMRkwFwYDVQQDExBUU0EgaW50ZXJtZWRpYXRlMB4XDTIzMDQxNDAwMDAwMFoXDTI0MDQxMzAwMDAwMFowMjEVMBMGA1UEChMMR2l0SHViLCBJbmMuMRkwFwYDVQQDExBUU0EgVGltZXN0YW1waW5nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEUD5ZNbSqYMd6r8qpOOEX9ibGnZT9GsuXOhr/f8U9FJugBGExKYp40OULS0erjZW7xV9xV52NnJf5OeDq4e5ZKqNWMFQwDgYDVR0PAQH/BAQDAgeAMBMGA1UdJQQMMAoGCCsGAQUFBwMIMAwGA1UdEwEB/wQCMAAwHwYDVR0jBBgwFoAUaW1RudOgVt0leqY0WKYbuPr47wAwCgYIKoZIzj0EAwMDaAAwZQIwbUH9HvD4ejCZJOWQnqAlkqURllvu9M8+VqLbiRK+zSfZCZwsiljRn8MQQRSkXEE5AjEAg+VxqtojfVfu8DhzzhCx9GKETbJHb19iV72mMKUbDAFmzZ6bQ8b54Zb8tidy5aWe" + }, + { + "rawBytes": "MIICEDCCAZWgAwIBAgIUX8ZO5QXP7vN4dMQ5e9sU3nub8OgwCgYIKoZIzj0EAwMwODEVMBMGA1UEChMMR2l0SHViLCBJbmMuMR8wHQYDVQQDExZJbnRlcm5hbCBTZXJ2aWNlcyBSb290MB4XDTIzMDQxNDAwMDAwMFoXDTI4MDQxMjAwMDAwMFowMjEVMBMGA1UEChMMR2l0SHViLCBJbmMuMRkwFwYDVQQDExBUU0EgaW50ZXJtZWRpYXRlMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEvMLY/dTVbvIJYANAuszEwJnQE1llftynyMKIMhh48HmqbVr5ygybzsLRLVKbBWOdZ21aeJz+gZiytZetqcyF9WlER5NEMf6JV7ZNojQpxHq4RHGoGSceQv/qvTiZxEDKo2YwZDAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHQ4EFgQUaW1RudOgVt0leqY0WKYbuPr47wAwHwYDVR0jBBgwFoAU9NYYlobnAG4c0/qjxyH/lq/wz+QwCgYIKoZIzj0EAwMDaQAwZgIxAK1B185ygCrIYFlIs3GjswjnwSMG6LY8woLVdakKDZxVa8f8cqMs1DhcxJ0+09w95QIxAO+tBzZk7vjUJ9iJgD4R6ZWTxQWKqNm74jO99o+o9sv4FI/SZTZTFyMn0IJEHdNmyA==" + }, + { + "rawBytes": "MIIB9DCCAXqgAwIBAgIUa/JAkdUjK4JUwsqtaiRJGWhqLSowCgYIKoZIzj0EAwMwODEVMBMGA1UEChMMR2l0SHViLCBJbmMuMR8wHQYDVQQDExZJbnRlcm5hbCBTZXJ2aWNlcyBSb290MB4XDTIzMDQxNDAwMDAwMFoXDTMzMDQxMTAwMDAwMFowODEVMBMGA1UEChMMR2l0SHViLCBJbmMuMR8wHQYDVQQDExZJbnRlcm5hbCBTZXJ2aWNlcyBSb290MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEf9jFAXxz4kx68AHRMOkFBhflDcMTvzaXz4x/FCcXjJ/1qEKon/qPIGnaURskDtyNbNDOpeJTDDFqt48iMPrnzpx6IZwqemfUJN4xBEZfza+pYt/iyod+9tZr20RRWSv/o0UwQzAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBAjAdBgNVHQ4EFgQU9NYYlobnAG4c0/qjxyH/lq/wz+QwCgYIKoZIzj0EAwMDaAAwZQIxALZLZ8BgRXzKxLMMN9VIlO+e4hrBnNBgF7tz7Hnrowv2NetZErIACKFymBlvWDvtMAIwZO+ki6ssQ1bsZo98O8mEAf2NZ7iiCgDDU0Vwjeco6zyeh0zBTs9/7gV6AHNQ53xD" + } + ] + }, + "validFor": { + "start": "2023-04-14T00:00:00.000Z" + } + } + ] +} diff --git a/github/attestations.go b/github/attestations.go new file mode 100644 index 00000000000..618d5d73f6c --- /dev/null +++ b/github/attestations.go @@ -0,0 +1,27 @@ +// Copyright 2024 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 ( + "encoding/json" +) + +// Attestation represents an artifact attestation associated with a repository. +// The provided bundle can be used to verify the provenance of artifacts. +// +// https://docs.github.com/en/actions/security-for-github-actions/using-artifact-attestations/using-artifact-attestations-to-establish-provenance-for-builds +type Attestation struct { + // The attestation's Sigstore Bundle. + // Refer to the sigstore bundle specification for more info: + // https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto + Bundle json.RawMessage `json:"bundle"` + RepositoryID int64 `json:"repository_id"` +} + +// AttestationsResponse represents a collection of artifact attestations. +type AttestationsResponse struct { + Attestations []*Attestation `json:"attestations"` +} diff --git a/github/orgs_attestations.go b/github/orgs_attestations.go new file mode 100644 index 00000000000..3d5793c18f0 --- /dev/null +++ b/github/orgs_attestations.go @@ -0,0 +1,40 @@ +// Copyright 2024 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" +) + +// ListAttestations returns a collection of artifact attestations +// with a given subject digest that are associated with repositories +// owned by an organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-attestations +// +//meta:operation GET /orgs/{org}/attestations/{subject_digest} +func (s *OrganizationsService) ListAttestations(ctx context.Context, org, subjectDigest string, opts *ListOptions) (*AttestationsResponse, *Response, error) { + var u = fmt.Sprintf("orgs/%v/attestations/%v", org, subjectDigest) + + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var attestations *AttestationsResponse + resp, err := s.client.Do(ctx, req, &attestations) + if err != nil { + return nil, resp, err + } + + return attestations, resp, nil +} diff --git a/github/orgs_attestations_test.go b/github/orgs_attestations_test.go new file mode 100644 index 00000000000..7eea0aa0a7e --- /dev/null +++ b/github/orgs_attestations_test.go @@ -0,0 +1,72 @@ +// Copyright 2024 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 TestOrganizationsService_ListAttestations(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/orgs/o/attestations/digest", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "attestations": [ + { + "repository_id": 1, + "bundle": {} + }, + { + "repository_id": 2, + "bundle": {} + } + ] + }`) + }) + ctx := context.Background() + attestations, _, err := client.Organizations.ListAttestations(ctx, "o", "digest", &ListOptions{}) + if err != nil { + t.Errorf("Organizations.ListAttestations returned error: %v", err) + } + + want := &AttestationsResponse{ + Attestations: []*Attestation{ + { + RepositoryID: 1, + Bundle: []byte(`{}`), + }, + { + RepositoryID: 2, + Bundle: []byte(`{}`), + }, + }, + } + + if !cmp.Equal(attestations, want) { + t.Errorf("Organizations.ListAttestations = %+v, want %+v", attestations, want) + } + const methodName = "ListAttestations" + + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.ListAttestations(ctx, "\n", "\n", &ListOptions{}) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.ListAttestations(ctx, "o", "digest", nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} diff --git a/github/repos_attestations.go b/github/repos_attestations.go new file mode 100644 index 00000000000..2e5425502c9 --- /dev/null +++ b/github/repos_attestations.go @@ -0,0 +1,39 @@ +// Copyright 2024 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" +) + +// ListAttestations returns a collection of artifact attestations +// with a given subject digest that are associated with a repository. +// +// GitHub API docs: https://docs.github.com/rest/repos/repos#list-attestations +// +//meta:operation GET /repos/{owner}/{repo}/attestations/{subject_digest} +func (s *RepositoriesService) ListAttestations(ctx context.Context, owner, repo, subjectDigest string, opts *ListOptions) (*AttestationsResponse, *Response, error) { + var u = fmt.Sprintf("repos/%v/%v/attestations/%v", owner, repo, subjectDigest) + + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var attestations *AttestationsResponse + resp, err := s.client.Do(ctx, req, &attestations) + if err != nil { + return nil, resp, err + } + + return attestations, resp, nil +} diff --git a/github/repos_attestations_test.go b/github/repos_attestations_test.go new file mode 100644 index 00000000000..ab35fc3d5a6 --- /dev/null +++ b/github/repos_attestations_test.go @@ -0,0 +1,72 @@ +// Copyright 2024 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_ListAttestations(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/repos/o/r/attestations/digest", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "attestations": [ + { + "repository_id": 1, + "bundle": {} + }, + { + "repository_id": 2, + "bundle": {} + } + ] + }`) + }) + ctx := context.Background() + attestations, _, err := client.Repositories.ListAttestations(ctx, "o", "r", "digest", &ListOptions{}) + if err != nil { + t.Errorf("Repositories.ListAttestations returned error: %v", err) + } + + want := &AttestationsResponse{ + Attestations: []*Attestation{ + { + RepositoryID: 1, + Bundle: []byte(`{}`), + }, + { + RepositoryID: 2, + Bundle: []byte(`{}`), + }, + }, + } + + if !cmp.Equal(attestations, want) { + t.Errorf("Repositories.ListAttestations = %+v, want %+v", attestations, want) + } + const methodName = "ListAttestations" + + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.ListAttestations(ctx, "\n", "\n", "\n", &ListOptions{}) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.ListAttestations(ctx, "o", "r", "digest", nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} diff --git a/github/users_attestations.go b/github/users_attestations.go new file mode 100644 index 00000000000..18f60298d87 --- /dev/null +++ b/github/users_attestations.go @@ -0,0 +1,40 @@ +// Copyright 2024 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" +) + +// ListAttestations returns a collection of artifact attestations +// with a given subject digest that are associated with repositories +// owned by a user. +// +// GitHub API docs: https://docs.github.com/rest/users/attestations#list-attestations +// +//meta:operation GET /users/{username}/attestations/{subject_digest} +func (s *UsersService) ListAttestations(ctx context.Context, user, subjectDigest string, opts *ListOptions) (*AttestationsResponse, *Response, error) { + var u = fmt.Sprintf("users/%v/attestations/%v", user, subjectDigest) + + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var attestations *AttestationsResponse + res, err := s.client.Do(ctx, req, &attestations) + if err != nil { + return nil, res, err + } + + return attestations, res, nil +} diff --git a/github/users_attestations_test.go b/github/users_attestations_test.go new file mode 100644 index 00000000000..b9decf520a4 --- /dev/null +++ b/github/users_attestations_test.go @@ -0,0 +1,72 @@ +// Copyright 2024 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 TestUsersService_ListAttestations(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/users/u/attestations/digest", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "attestations": [ + { + "repository_id": 1, + "bundle": {} + }, + { + "repository_id": 2, + "bundle": {} + } + ] + }`) + }) + ctx := context.Background() + attestations, _, err := client.Users.ListAttestations(ctx, "u", "digest", &ListOptions{}) + if err != nil { + t.Errorf("Users.ListAttestations returned error: %v", err) + } + + want := &AttestationsResponse{ + Attestations: []*Attestation{ + { + RepositoryID: 1, + Bundle: []byte(`{}`), + }, + { + RepositoryID: 2, + Bundle: []byte(`{}`), + }, + }, + } + + if !cmp.Equal(attestations, want) { + t.Errorf("Users.ListAttestations = %+v, want %+v", attestations, want) + } + const methodName = "ListAttestations" + + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Users.ListAttestations(ctx, "\n", "\n", &ListOptions{}) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Users.ListAttestations(ctx, "u", "digest", nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} From a81279821da7f9503c0aa840609e8c15a8fba2b7 Mon Sep 17 00:00:00 2001 From: Aditya Mahendrakar Date: Sun, 27 Oct 2024 05:18:32 -0700 Subject: [PATCH 554/751] Add BranchProtectionConfigurationEvent and SecretScanningAlertLocationEvent (#3332) --- github/event_types.go | 27 ++++ github/event_types_test.go | 147 ++++++++++++++++++ github/github-accessors.go | 104 +++++++++++++ github/github-accessors_test.go | 110 +++++++++++++ github/messages.go | 138 ++++++++-------- github/messages_test.go | 8 + .../orgs_codesecurity_configurations_test.go | 2 - 7 files changed, 466 insertions(+), 70 deletions(-) diff --git a/github/event_types.go b/github/event_types.go index f9778215092..40ad919be5e 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -29,6 +29,19 @@ type BranchProtectionRuleEvent struct { Installation *Installation `json:"installation,omitempty"` } +// BranchProtectionConfigurationEvent is triggered when there is a change to branch protection configurations for a repository. +// The Webhook event name is "branch_protection_configuration". +// +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#branch_protection_configuration +type BranchProtectionConfigurationEvent struct { + Action *string `json:"action,omitempty"` + Repo *Repository `json:"repository,omitempty"` + Org *Organization `json:"organization,omitempty"` + Enterprise *Enterprise `json:"enterprise,omitempty"` + Sender *User `json:"sender,omitempty"` + Installation *Installation `json:"installation,omitempty"` +} + // CheckRunEvent is triggered when a check run is "created", "completed", or "rerequested". // The Webhook event name is "check_run". // @@ -1580,6 +1593,20 @@ type SecretScanningAlertEvent struct { Installation *Installation `json:"installation,omitempty"` } +// SecretScanningAlertLocationEvent is triggered when there is activity relating to the locations of a secret in a secret scanning alert. +// The Webhook event name is "secret_scanning_alert_location". +// +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#secret_scanning_alert_location +type SecretScanningAlertLocationEvent struct { + Action *string `json:"action,omitempty"` + Alert *SecretScanningAlert `json:"alert,omitempty"` + Installation *Installation `json:"installation,omitempty"` + Location *SecretScanningAlertLocation `json:"location,omitempty"` + Organization *Organization `json:"organization,omitempty"` + Repo *Repository `json:"repository,omitempty"` + Sender *User `json:"sender,omitempty"` +} + // SecurityAndAnalysisEvent is triggered when code security and analysis features // are enabled or disabled for a repository. // diff --git a/github/event_types_test.go b/github/event_types_test.go index 0c4deab4177..3883c9f0acb 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -265,6 +265,61 @@ func TestProjectColumnChange_Marshal_NameChange(t *testing.T) { testJSONMarshal(t, u, want) } +func TestBranchProtectionConfigurationEvent_Marshal(t *testing.T) { + t.Parallel() + testJSONMarshal(t, &BranchProtectionConfigurationEvent{}, "{}") + u := &BranchProtectionConfigurationEvent{ + Action: String("enabled"), + Repo: &Repository{ + ID: Int64(12345), + NodeID: String("MDEwOlJlcG9zaXRvcnkxMjM0NQ=="), + Name: String("example-repo"), + }, + Org: &Organization{ + Login: String("example-org"), + ID: Int64(67890), + }, + Sender: &User{ + Login: String("example-user"), + ID: Int64(1111), + }, + Installation: &Installation{ + ID: Int64(2222), + }, + Enterprise: &Enterprise{ + ID: Int(3333), + Slug: String("example-enterprise"), + Name: String("Example Enterprise"), + }, + } + + want := `{ + "action": "enabled", + "repository": { + "id": 12345, + "node_id": "MDEwOlJlcG9zaXRvcnkxMjM0NQ==", + "name": "example-repo" + }, + "organization": { + "login": "example-org", + "id": 67890 + }, + "sender": { + "login": "example-user", + "id": 1111 + }, + "installation": { + "id": 2222 + }, + "enterprise": { + "id": 3333, + "slug": "example-enterprise", + "name": "Example Enterprise" + } + }` + testJSONMarshal(t, u, want) +} + func TestTeamAddEvent_Marshal(t *testing.T) { t.Parallel() testJSONMarshal(t, &TeamAddEvent{}, "{}") @@ -19295,6 +19350,98 @@ func TestSecretScanningAlertEvent_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } +func TestSecretScanningAlertLocationEvent_Marshal(t *testing.T) { + t.Parallel() + testJSONMarshal(t, &SecretScanningAlertLocationEvent{}, "{}") + u := &SecretScanningAlertLocationEvent{ + Action: String("created"), + Alert: &SecretScanningAlert{ + Number: Int(10), + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + URL: String("a"), + HTMLURL: String("a"), + SecretType: String("mailchimp_api_key"), + }, + Location: &SecretScanningAlertLocation{ + Type: String("blob"), + Details: &SecretScanningAlertLocationDetails{ + Path: String("path/to/file"), + Startline: Int(10), + EndLine: Int(20), + StartColumn: Int(1), + EndColumn: Int(2), + BlobSHA: String("d6e4c75c141dbacecc279b721b8bsomeSHA"), + BlobURL: String("a"), + CommitSHA: String("d6e4c75c141dbacecc279b721b8bsomeSHA"), + CommitURL: String("a"), + }, + }, + Repo: &Repository{ + ID: Int64(12345), + NodeID: String("MDEwOlJlcG9zaXRvcnkxMjM0NQ=="), + Name: String("example-repo"), + }, + Organization: &Organization{ + Login: String("example-org"), + ID: Int64(67890), + }, + Sender: &User{ + Login: String("example-user"), + ID: Int64(1111), + }, + Installation: &Installation{ + ID: Int64(2222), + }, + } + + want := `{ + "action": "created", + "alert": { + "number": 10, + "created_at": ` + referenceTimeStr + `, + "updated_at": ` + referenceTimeStr + `, + "url": "a", + "html_url": "a", + "secret_type": "mailchimp_api_key" + }, + "location": { + + "type": "blob", + "details": { + "path": "path/to/file", + "start_line": 10, + "end_line": 20, + "start_column": 1, + "end_column": 2, + "blob_sha": "d6e4c75c141dbacecc279b721b8bsomeSHA", + "blob_url": "a", + "commit_sha": "d6e4c75c141dbacecc279b721b8bsomeSHA", + "commit_url": "a" + } + }, + "repository": { + + "id": 12345, + "node_id": "MDEwOlJlcG9zaXRvcnkxMjM0NQ==", + "name": "example-repo" + }, + "organization": { + "login": "example-org", + "id": 67890 + }, + "sender": { + "login": "example-user", + "id": 1111 + }, + "installation": { + "id": 2222 + } + }` + + testJSONMarshal(t, u, want) +} + func TestSecurityAdvisoryEvent_Marshal(t *testing.T) { t.Parallel() testJSONMarshal(t, &SecurityAdvisoryEvent{}, "{}") diff --git a/github/github-accessors.go b/github/github-accessors.go index ea4cfb75da1..9341e001d49 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -1646,6 +1646,54 @@ func (b *BranchPolicy) GetProtectedBranches() bool { return *b.ProtectedBranches } +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (b *BranchProtectionConfigurationEvent) GetAction() string { + if b == nil || b.Action == nil { + return "" + } + return *b.Action +} + +// GetEnterprise returns the Enterprise field. +func (b *BranchProtectionConfigurationEvent) GetEnterprise() *Enterprise { + if b == nil { + return nil + } + return b.Enterprise +} + +// GetInstallation returns the Installation field. +func (b *BranchProtectionConfigurationEvent) GetInstallation() *Installation { + if b == nil { + return nil + } + return b.Installation +} + +// GetOrg returns the Org field. +func (b *BranchProtectionConfigurationEvent) GetOrg() *Organization { + if b == nil { + return nil + } + return b.Org +} + +// GetRepo returns the Repo field. +func (b *BranchProtectionConfigurationEvent) GetRepo() *Repository { + if b == nil { + return nil + } + return b.Repo +} + +// GetSender returns the Sender field. +func (b *BranchProtectionConfigurationEvent) GetSender() *User { + if b == nil { + return nil + } + return b.Sender +} + // GetAdminEnforced returns the AdminEnforced field if it's non-nil, zero value otherwise. func (b *BranchProtectionRule) GetAdminEnforced() bool { if b == nil || b.AdminEnforced == nil { @@ -22918,6 +22966,62 @@ func (s *SecretScanningAlertLocationDetails) GetStartline() int { return *s.Startline } +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlertLocationEvent) GetAction() string { + if s == nil || s.Action == nil { + return "" + } + return *s.Action +} + +// GetAlert returns the Alert field. +func (s *SecretScanningAlertLocationEvent) GetAlert() *SecretScanningAlert { + if s == nil { + return nil + } + return s.Alert +} + +// GetInstallation returns the Installation field. +func (s *SecretScanningAlertLocationEvent) GetInstallation() *Installation { + if s == nil { + return nil + } + return s.Installation +} + +// GetLocation returns the Location field. +func (s *SecretScanningAlertLocationEvent) GetLocation() *SecretScanningAlertLocation { + if s == nil { + return nil + } + return s.Location +} + +// GetOrganization returns the Organization field. +func (s *SecretScanningAlertLocationEvent) GetOrganization() *Organization { + if s == nil { + return nil + } + return s.Organization +} + +// GetRepo returns the Repo field. +func (s *SecretScanningAlertLocationEvent) GetRepo() *Repository { + if s == nil { + return nil + } + return s.Repo +} + +// GetSender returns the Sender field. +func (s *SecretScanningAlertLocationEvent) GetSender() *User { + if s == nil { + return nil + } + return s.Sender +} + // GetResolution returns the Resolution field if it's non-nil, zero value otherwise. func (s *SecretScanningAlertUpdateOptions) GetResolution() string { if s == nil || s.Resolution == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index acd3febe8f6..90966654517 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -2163,6 +2163,57 @@ func TestBranchPolicy_GetProtectedBranches(tt *testing.T) { b.GetProtectedBranches() } +func TestBranchProtectionConfigurationEvent_GetAction(tt *testing.T) { + tt.Parallel() + var zeroValue string + b := &BranchProtectionConfigurationEvent{Action: &zeroValue} + b.GetAction() + b = &BranchProtectionConfigurationEvent{} + b.GetAction() + b = nil + b.GetAction() +} + +func TestBranchProtectionConfigurationEvent_GetEnterprise(tt *testing.T) { + tt.Parallel() + b := &BranchProtectionConfigurationEvent{} + b.GetEnterprise() + b = nil + b.GetEnterprise() +} + +func TestBranchProtectionConfigurationEvent_GetInstallation(tt *testing.T) { + tt.Parallel() + b := &BranchProtectionConfigurationEvent{} + b.GetInstallation() + b = nil + b.GetInstallation() +} + +func TestBranchProtectionConfigurationEvent_GetOrg(tt *testing.T) { + tt.Parallel() + b := &BranchProtectionConfigurationEvent{} + b.GetOrg() + b = nil + b.GetOrg() +} + +func TestBranchProtectionConfigurationEvent_GetRepo(tt *testing.T) { + tt.Parallel() + b := &BranchProtectionConfigurationEvent{} + b.GetRepo() + b = nil + b.GetRepo() +} + +func TestBranchProtectionConfigurationEvent_GetSender(tt *testing.T) { + tt.Parallel() + b := &BranchProtectionConfigurationEvent{} + b.GetSender() + b = nil + b.GetSender() +} + func TestBranchProtectionRule_GetAdminEnforced(tt *testing.T) { tt.Parallel() var zeroValue bool @@ -29393,6 +29444,65 @@ func TestSecretScanningAlertLocationDetails_GetStartline(tt *testing.T) { s.GetStartline() } +func TestSecretScanningAlertLocationEvent_GetAction(tt *testing.T) { + tt.Parallel() + var zeroValue string + s := &SecretScanningAlertLocationEvent{Action: &zeroValue} + s.GetAction() + s = &SecretScanningAlertLocationEvent{} + s.GetAction() + s = nil + s.GetAction() +} + +func TestSecretScanningAlertLocationEvent_GetAlert(tt *testing.T) { + tt.Parallel() + s := &SecretScanningAlertLocationEvent{} + s.GetAlert() + s = nil + s.GetAlert() +} + +func TestSecretScanningAlertLocationEvent_GetInstallation(tt *testing.T) { + tt.Parallel() + s := &SecretScanningAlertLocationEvent{} + s.GetInstallation() + s = nil + s.GetInstallation() +} + +func TestSecretScanningAlertLocationEvent_GetLocation(tt *testing.T) { + tt.Parallel() + s := &SecretScanningAlertLocationEvent{} + s.GetLocation() + s = nil + s.GetLocation() +} + +func TestSecretScanningAlertLocationEvent_GetOrganization(tt *testing.T) { + tt.Parallel() + s := &SecretScanningAlertLocationEvent{} + s.GetOrganization() + s = nil + s.GetOrganization() +} + +func TestSecretScanningAlertLocationEvent_GetRepo(tt *testing.T) { + tt.Parallel() + s := &SecretScanningAlertLocationEvent{} + s.GetRepo() + s = nil + s.GetRepo() +} + +func TestSecretScanningAlertLocationEvent_GetSender(tt *testing.T) { + tt.Parallel() + s := &SecretScanningAlertLocationEvent{} + s.GetSender() + s = nil + s.GetSender() +} + func TestSecretScanningAlertUpdateOptions_GetResolution(tt *testing.T) { tt.Parallel() var zeroValue string diff --git a/github/messages.go b/github/messages.go index f365190ae39..608c557cb09 100644 --- a/github/messages.go +++ b/github/messages.go @@ -46,74 +46,76 @@ const ( var ( // eventTypeMapping maps webhooks types to their corresponding go-github struct types. eventTypeMapping = map[string]interface{}{ - "branch_protection_rule": &BranchProtectionRuleEvent{}, - "check_run": &CheckRunEvent{}, - "check_suite": &CheckSuiteEvent{}, - "code_scanning_alert": &CodeScanningAlertEvent{}, - "commit_comment": &CommitCommentEvent{}, - "content_reference": &ContentReferenceEvent{}, - "create": &CreateEvent{}, - "delete": &DeleteEvent{}, - "dependabot_alert": &DependabotAlertEvent{}, - "deploy_key": &DeployKeyEvent{}, - "deployment": &DeploymentEvent{}, - "deployment_review": &DeploymentReviewEvent{}, - "deployment_status": &DeploymentStatusEvent{}, - "deployment_protection_rule": &DeploymentProtectionRuleEvent{}, - "discussion": &DiscussionEvent{}, - "discussion_comment": &DiscussionCommentEvent{}, - "fork": &ForkEvent{}, - "github_app_authorization": &GitHubAppAuthorizationEvent{}, - "gollum": &GollumEvent{}, - "installation": &InstallationEvent{}, - "installation_repositories": &InstallationRepositoriesEvent{}, - "installation_target": &InstallationTargetEvent{}, - "issue_comment": &IssueCommentEvent{}, - "issues": &IssuesEvent{}, - "label": &LabelEvent{}, - "marketplace_purchase": &MarketplacePurchaseEvent{}, - "member": &MemberEvent{}, - "membership": &MembershipEvent{}, - "merge_group": &MergeGroupEvent{}, - "meta": &MetaEvent{}, - "milestone": &MilestoneEvent{}, - "organization": &OrganizationEvent{}, - "org_block": &OrgBlockEvent{}, - "package": &PackageEvent{}, - "page_build": &PageBuildEvent{}, - "personal_access_token_request": &PersonalAccessTokenRequestEvent{}, - "ping": &PingEvent{}, - "project": &ProjectEvent{}, - "project_card": &ProjectCardEvent{}, - "project_column": &ProjectColumnEvent{}, - "projects_v2": &ProjectV2Event{}, - "projects_v2_item": &ProjectV2ItemEvent{}, - "public": &PublicEvent{}, - "pull_request": &PullRequestEvent{}, - "pull_request_review": &PullRequestReviewEvent{}, - "pull_request_review_comment": &PullRequestReviewCommentEvent{}, - "pull_request_review_thread": &PullRequestReviewThreadEvent{}, - "pull_request_target": &PullRequestTargetEvent{}, - "push": &PushEvent{}, - "repository": &RepositoryEvent{}, - "repository_dispatch": &RepositoryDispatchEvent{}, - "repository_import": &RepositoryImportEvent{}, - "repository_ruleset": &RepositoryRulesetEvent{}, - "repository_vulnerability_alert": &RepositoryVulnerabilityAlertEvent{}, - "release": &ReleaseEvent{}, - "secret_scanning_alert": &SecretScanningAlertEvent{}, - "security_advisory": &SecurityAdvisoryEvent{}, - "security_and_analysis": &SecurityAndAnalysisEvent{}, - "sponsorship": &SponsorshipEvent{}, - "star": &StarEvent{}, - "status": &StatusEvent{}, - "team": &TeamEvent{}, - "team_add": &TeamAddEvent{}, - "user": &UserEvent{}, - "watch": &WatchEvent{}, - "workflow_dispatch": &WorkflowDispatchEvent{}, - "workflow_job": &WorkflowJobEvent{}, - "workflow_run": &WorkflowRunEvent{}, + "branch_protection_configuration": &BranchProtectionConfigurationEvent{}, + "branch_protection_rule": &BranchProtectionRuleEvent{}, + "check_run": &CheckRunEvent{}, + "check_suite": &CheckSuiteEvent{}, + "code_scanning_alert": &CodeScanningAlertEvent{}, + "commit_comment": &CommitCommentEvent{}, + "content_reference": &ContentReferenceEvent{}, + "create": &CreateEvent{}, + "delete": &DeleteEvent{}, + "dependabot_alert": &DependabotAlertEvent{}, + "deploy_key": &DeployKeyEvent{}, + "deployment": &DeploymentEvent{}, + "deployment_review": &DeploymentReviewEvent{}, + "deployment_status": &DeploymentStatusEvent{}, + "deployment_protection_rule": &DeploymentProtectionRuleEvent{}, + "discussion": &DiscussionEvent{}, + "discussion_comment": &DiscussionCommentEvent{}, + "fork": &ForkEvent{}, + "github_app_authorization": &GitHubAppAuthorizationEvent{}, + "gollum": &GollumEvent{}, + "installation": &InstallationEvent{}, + "installation_repositories": &InstallationRepositoriesEvent{}, + "installation_target": &InstallationTargetEvent{}, + "issue_comment": &IssueCommentEvent{}, + "issues": &IssuesEvent{}, + "label": &LabelEvent{}, + "marketplace_purchase": &MarketplacePurchaseEvent{}, + "member": &MemberEvent{}, + "membership": &MembershipEvent{}, + "merge_group": &MergeGroupEvent{}, + "meta": &MetaEvent{}, + "milestone": &MilestoneEvent{}, + "organization": &OrganizationEvent{}, + "org_block": &OrgBlockEvent{}, + "package": &PackageEvent{}, + "page_build": &PageBuildEvent{}, + "personal_access_token_request": &PersonalAccessTokenRequestEvent{}, + "ping": &PingEvent{}, + "project": &ProjectEvent{}, + "project_card": &ProjectCardEvent{}, + "project_column": &ProjectColumnEvent{}, + "projects_v2": &ProjectV2Event{}, + "projects_v2_item": &ProjectV2ItemEvent{}, + "public": &PublicEvent{}, + "pull_request": &PullRequestEvent{}, + "pull_request_review": &PullRequestReviewEvent{}, + "pull_request_review_comment": &PullRequestReviewCommentEvent{}, + "pull_request_review_thread": &PullRequestReviewThreadEvent{}, + "pull_request_target": &PullRequestTargetEvent{}, + "push": &PushEvent{}, + "repository": &RepositoryEvent{}, + "repository_dispatch": &RepositoryDispatchEvent{}, + "repository_import": &RepositoryImportEvent{}, + "repository_ruleset": &RepositoryRulesetEvent{}, + "repository_vulnerability_alert": &RepositoryVulnerabilityAlertEvent{}, + "release": &ReleaseEvent{}, + "secret_scanning_alert": &SecretScanningAlertEvent{}, + "secret_scanning_alert_location": &SecretScanningAlertLocationEvent{}, + "security_advisory": &SecurityAdvisoryEvent{}, + "security_and_analysis": &SecurityAndAnalysisEvent{}, + "sponsorship": &SponsorshipEvent{}, + "star": &StarEvent{}, + "status": &StatusEvent{}, + "team": &TeamEvent{}, + "team_add": &TeamAddEvent{}, + "user": &UserEvent{}, + "watch": &WatchEvent{}, + "workflow_dispatch": &WorkflowDispatchEvent{}, + "workflow_job": &WorkflowJobEvent{}, + "workflow_run": &WorkflowRunEvent{}, } // Forward mapping of event types to the string names of the structs. messageToTypeName = make(map[string]string, len(eventTypeMapping)) diff --git a/github/messages_test.go b/github/messages_test.go index e04c0b18a7b..be325d504b4 100644 --- a/github/messages_test.go +++ b/github/messages_test.go @@ -264,6 +264,10 @@ func TestParseWebHook(t *testing.T) { payload interface{} messageType string }{ + { + payload: &BranchProtectionConfigurationEvent{}, + messageType: "branch_protection_configuration", + }, { payload: &BranchProtectionRuleEvent{}, messageType: "branch_protection_rule", @@ -480,6 +484,10 @@ func TestParseWebHook(t *testing.T) { payload: &SecretScanningAlertEvent{}, messageType: "secret_scanning_alert", }, + { + payload: &SecretScanningAlertLocationEvent{}, + messageType: "secret_scanning_alert_location", + }, { payload: &SecurityAdvisoryEvent{}, messageType: "security_advisory", diff --git a/github/orgs_codesecurity_configurations_test.go b/github/orgs_codesecurity_configurations_test.go index d59b37057ca..e72f9fb976c 100644 --- a/github/orgs_codesecurity_configurations_test.go +++ b/github/orgs_codesecurity_configurations_test.go @@ -382,7 +382,6 @@ func TestOrganizationsService_SetDefaultCodeSecurityConfiguration(t *testing.T) "code_scanning_default_setup": "enabled" } }`) - w.WriteHeader(http.StatusOK) }) got, resp, err := client.Organizations.SetDefaultCodeSecurityConfiguration(ctx, "o", 1, "all") if err != nil { @@ -478,7 +477,6 @@ func TestOrganizationsService_GetCodeSecurityConfigurationForRepository(t *testi "code_scanning_default_setup": "enabled" } }`) - w.WriteHeader(http.StatusOK) }) rc, _, err := client.Organizations.GetCodeSecurityConfigurationForRepository(ctx, "o", "repo8") From 9f20524769829bedee2dca7fe2fc893192945a80 Mon Sep 17 00:00:00 2001 From: Clemens W Date: Sun, 27 Oct 2024 13:25:41 +0100 Subject: [PATCH 555/751] feat!: Fix `source` property on Repo Custom Properties (#3333) BREAKING CHANGE: Change `RulesetRepositoryPropertyTargetParameters.Source` from `string` to `*string`. --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 11 +++++++++++ github/orgs_rules_test.go | 13 +++++-------- github/repos_rules.go | 2 +- 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 9341e001d49..acc54e7d960 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -22102,6 +22102,14 @@ func (r *RulesetRepositoryNamesConditionParameters) GetProtected() bool { return *r.Protected } +// GetSource returns the Source field if it's non-nil, zero value otherwise. +func (r *RulesetRepositoryPropertyTargetParameters) GetSource() string { + if r == nil || r.Source == nil { + return "" + } + return *r.Source +} + // GetBusy returns the Busy field if it's non-nil, zero value otherwise. func (r *Runner) GetBusy() bool { if r == nil || r.Busy == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 90966654517..eea6da94d7e 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -28298,6 +28298,17 @@ func TestRulesetRepositoryNamesConditionParameters_GetProtected(tt *testing.T) { r.GetProtected() } +func TestRulesetRepositoryPropertyTargetParameters_GetSource(tt *testing.T) { + tt.Parallel() + var zeroValue string + r := &RulesetRepositoryPropertyTargetParameters{Source: &zeroValue} + r.GetSource() + r = &RulesetRepositoryPropertyTargetParameters{} + r.GetSource() + r = nil + r.GetSource() +} + func TestRunner_GetBusy(tt *testing.T) { tt.Parallel() var zeroValue bool diff --git a/github/orgs_rules_test.go b/github/orgs_rules_test.go index ac391dae531..ca6e3f84ce4 100644 --- a/github/orgs_rules_test.go +++ b/github/orgs_rules_test.go @@ -454,7 +454,6 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing. "exclude": [ { "name": "testExcludeProp", - "source": "custom", "property_values": [ "false" ] @@ -590,14 +589,13 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing. Include: []RulesetRepositoryPropertyTargetParameters{ { Name: "testIncludeProp", - Source: "custom", + Source: String("custom"), Values: []string{"true"}, }, }, Exclude: []RulesetRepositoryPropertyTargetParameters{ { Name: "testExcludeProp", - Source: "custom", Values: []string{"false"}, }, }, @@ -692,14 +690,13 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing. Include: []RulesetRepositoryPropertyTargetParameters{ { Name: "testIncludeProp", - Source: "custom", + Source: String("custom"), Values: []string{"true"}, }, }, Exclude: []RulesetRepositoryPropertyTargetParameters{ { Name: "testExcludeProp", - Source: "custom", Values: []string{"false"}, }, }, @@ -1287,7 +1284,7 @@ func TestOrganizationsService_GetOrganizationRulesetWithRepoPropCondition(t *tes Include: []RulesetRepositoryPropertyTargetParameters{ { Name: "testIncludeProp", - Source: "custom", + Source: String("custom"), Values: []string{"true"}, }, }, @@ -1480,7 +1477,7 @@ func TestOrganizationsService_UpdateOrganizationRulesetWithRepoProp(t *testing.T Include: []RulesetRepositoryPropertyTargetParameters{ { Name: "testIncludeProp", - Source: "custom", + Source: String("custom"), Values: []string{"true"}, }, }, @@ -1512,7 +1509,7 @@ func TestOrganizationsService_UpdateOrganizationRulesetWithRepoProp(t *testing.T Include: []RulesetRepositoryPropertyTargetParameters{ { Name: "testIncludeProp", - Source: "custom", + Source: String("custom"), Values: []string{"true"}, }, }, diff --git a/github/repos_rules.go b/github/repos_rules.go index 07e8afad0ed..0d5052a4b1e 100644 --- a/github/repos_rules.go +++ b/github/repos_rules.go @@ -52,7 +52,7 @@ type RulesetRepositoryIDsConditionParameters struct { type RulesetRepositoryPropertyTargetParameters struct { Name string `json:"name"` Values []string `json:"property_values"` - Source string `json:"source"` + Source *string `json:"source,omitempty"` } // RulesetRepositoryPropertyConditionParameters represents the conditions object for repository_property. From 5439fdf6525e1fa9c34adbdfd28b71933689b1b0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 27 Oct 2024 08:49:47 -0400 Subject: [PATCH 556/751] build(deps): bump github.com/theupdateframework/go-tuf/v2 from 2.0.0 to 2.0.1 in /example in the go_modules group (#3338) --- example/go.mod | 2 +- example/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/example/go.mod b/example/go.mod index 5de15d5902b..e234c569d44 100644 --- a/example/go.mod +++ b/example/go.mod @@ -78,7 +78,7 @@ require ( github.com/spf13/viper v1.18.2 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/theupdateframework/go-tuf v0.7.0 // indirect - github.com/theupdateframework/go-tuf/v2 v2.0.0 // indirect + github.com/theupdateframework/go-tuf/v2 v2.0.1 // indirect github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 // indirect github.com/transparency-dev/merkle v0.0.2 // indirect go.mongodb.org/mongo-driver v1.14.0 // indirect diff --git a/example/go.sum b/example/go.sum index facdd200c25..a7ec2d5a899 100644 --- a/example/go.sum +++ b/example/go.sum @@ -324,8 +324,8 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8 github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/theupdateframework/go-tuf v0.7.0 h1:CqbQFrWo1ae3/I0UCblSbczevCCbS31Qvs5LdxRWqRI= github.com/theupdateframework/go-tuf v0.7.0/go.mod h1:uEB7WSY+7ZIugK6R1hiBMBjQftaFzn7ZCDJcp1tCUug= -github.com/theupdateframework/go-tuf/v2 v2.0.0 h1:rD8d9RotYBprZVgC+9oyTZ5MmawepnTSTqoDuxjWgbs= -github.com/theupdateframework/go-tuf/v2 v2.0.0/go.mod h1:baB22nBHeHBCeuGZcIlctNq4P61PcOdyARlplg5xmLA= +github.com/theupdateframework/go-tuf/v2 v2.0.1 h1:11p9tXpq10KQEujxjcIjDSivMKCMLguls7erXHZnxJQ= +github.com/theupdateframework/go-tuf/v2 v2.0.1/go.mod h1:baB22nBHeHBCeuGZcIlctNq4P61PcOdyARlplg5xmLA= github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 h1:e/5i7d4oYZ+C1wj2THlRK+oAhjeS/TRQwMfkIuet3w0= github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399/go.mod h1:LdwHTNJT99C5fTAzDz0ud328OgXz+gierycbcIx2fRs= github.com/transparency-dev/merkle v0.0.2 h1:Q9nBoQcZcgPamMkGn7ghV8XiTZ/kRxn1yCG81+twTK4= From 9e5757d5a766646f5e4153c6e30407471a0d2556 Mon Sep 17 00:00:00 2001 From: nagl-resourcely <137814572+nagl-resourcely@users.noreply.github.com> Date: Sun, 27 Oct 2024 06:06:11 -0700 Subject: [PATCH 557/751] Allow RemoveReviewers to remove only teams (#3337) --- github/pulls_reviewers.go | 22 +++++++++++++++++++++- github/pulls_reviewers_test.go | 21 +++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/github/pulls_reviewers.go b/github/pulls_reviewers.go index 3f0c50b746a..9dd60ae6888 100644 --- a/github/pulls_reviewers.go +++ b/github/pulls_reviewers.go @@ -23,6 +23,13 @@ type Reviewers struct { Teams []*Team `json:"teams,omitempty"` } +type removeReviewersRequest struct { + NodeID *string `json:"node_id,omitempty"` + // Note the lack of omitempty! See comment in RemoveReviewers. + Reviewers []string `json:"reviewers"` + TeamReviewers []string `json:"team_reviewers,omitempty"` +} + // RequestReviewers creates a review request for the provided reviewers for the specified pull request. // // GitHub API docs: https://docs.github.com/rest/pulls/review-requests#request-reviewers-for-a-pull-request @@ -76,8 +83,21 @@ func (s *PullRequestsService) ListReviewers(ctx context.Context, owner, repo str // //meta:operation DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers func (s *PullRequestsService) RemoveReviewers(ctx context.Context, owner, repo string, number int, reviewers ReviewersRequest) (*Response, error) { + // reviewers.Reviewers may be empty if the caller wants to remove teams, but not users. Unlike AddReviewers, + // "reviewers" is a required param here. Reference: https://github.com/google/go-github/issues/3336 + removeRequest := removeReviewersRequest{ + NodeID: reviewers.NodeID, + Reviewers: reviewers.Reviewers, + TeamReviewers: reviewers.TeamReviewers, + } + + if removeRequest.Reviewers == nil { + // GitHub accepts the empty list, but rejects null. Removing `omitempty` is not enough - we also have to promote nil to []. + removeRequest.Reviewers = []string{} + } + u := fmt.Sprintf("repos/%s/%s/pulls/%d/requested_reviewers", owner, repo, number) - req, err := s.client.NewRequest("DELETE", u, &reviewers) + req, err := s.client.NewRequest("DELETE", u, &removeRequest) if err != nil { return nil, err } diff --git a/github/pulls_reviewers_test.go b/github/pulls_reviewers_test.go index ac025d10e26..dfe7e6b7216 100644 --- a/github/pulls_reviewers_test.go +++ b/github/pulls_reviewers_test.go @@ -172,6 +172,27 @@ func TestRemoveReviewers(t *testing.T) { }) } +func TestRemoveReviewers_teamsOnly(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/repos/o/r/pulls/1/requested_reviewers", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + testBody(t, r, `{"reviewers":[],"team_reviewers":["justice-league"]}`+"\n") + }) + + ctx := context.Background() + _, err := client.PullRequests.RemoveReviewers(ctx, "o", "r", 1, ReviewersRequest{TeamReviewers: []string{"justice-league"}}) + if err != nil { + t.Errorf("PullRequests.RemoveReviewers returned error: %v", err) + } + + const methodName = "RemoveReviewers" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.PullRequests.RemoveReviewers(ctx, "o", "r", 1, ReviewersRequest{TeamReviewers: []string{"justice-league"}}) + }) +} + func TestListReviewers(t *testing.T) { t.Parallel() client, mux, _ := setup(t) From 68432f29bb704aa287904d28b0360ae63e58c913 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Nov 2024 14:35:12 -0500 Subject: [PATCH 558/751] build(deps): bump github.com/alecthomas/kong from 1.2.1 to 1.3.0 in /tools (#3342) --- tools/go.mod | 2 +- tools/go.sum | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index c50bb5f1122..86c55603fa8 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -5,7 +5,7 @@ go 1.21 toolchain go1.22.0 require ( - github.com/alecthomas/kong v1.2.1 + github.com/alecthomas/kong v1.3.0 github.com/getkin/kin-openapi v0.128.0 github.com/google/go-cmp v0.6.0 github.com/google/go-github/v66 v66.0.0 diff --git a/tools/go.sum b/tools/go.sum index 8805ab47abe..96f89ad96fa 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -1,7 +1,7 @@ -github.com/alecthomas/assert/v2 v2.10.0 h1:jjRCHsj6hBJhkmhznrCzoNpbA3zqy0fYiUcYZP/GkPY= -github.com/alecthomas/assert/v2 v2.10.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= -github.com/alecthomas/kong v1.2.1 h1:E8jH4Tsgv6wCRX2nGrdPyHDUCSG83WH2qE4XLACD33Q= -github.com/alecthomas/kong v1.2.1/go.mod h1:rKTSFhbdp3Ryefn8x5MOEprnRFQ7nlmMC01GKhehhBM= +github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0= +github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= +github.com/alecthomas/kong v1.3.0 h1:YJKuU6/TV2XOBtymafSeuzDvLAFR8cYMZiXVNLhAO6g= +github.com/alecthomas/kong v1.3.0/go.mod h1:IDc8HyiouDdpdiEiY81iaEJM8rSIW6LzX8On4FCO0bE= github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc= github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= From 78ac52d48290d8960e46177e43cfe820aca262b7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Nov 2024 19:00:58 -0500 Subject: [PATCH 559/751] build(deps): bump github.com/golang-jwt/jwt/v4 from 4.5.0 to 4.5.1 in /example in the go_modules group (#3343) --- example/go.mod | 2 +- example/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/example/go.mod b/example/go.mod index e234c569d44..52e9242d413 100644 --- a/example/go.mod +++ b/example/go.mod @@ -37,7 +37,7 @@ require ( github.com/go-openapi/strfmt v0.23.0 // indirect github.com/go-openapi/swag v0.23.0 // indirect github.com/go-openapi/validate v0.24.0 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect + github.com/golang-jwt/jwt/v4 v4.5.1 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/certificate-transparency-go v1.2.1 // indirect github.com/google/go-containerregistry v0.20.2 // indirect diff --git a/example/go.sum b/example/go.sum index a7ec2d5a899..46aba6838b5 100644 --- a/example/go.sum +++ b/example/go.sum @@ -137,8 +137,8 @@ github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x github.com/gofri/go-github-ratelimit v1.0.3 h1:Ocs2jaYokZDzgvqaajX+g04dqFyVqL0JQzoO7d2wmlk= github.com/gofri/go-github-ratelimit v1.0.3/go.mod h1:OnCi5gV+hAG/LMR7llGhU7yHt44se9sYgKPnafoL7RY= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-jwt/jwt/v4 v4.5.1 h1:JdqV9zKUdtaa9gdPlywC3aeoEsR681PlKC+4F5gQgeo= +github.com/golang-jwt/jwt/v4 v4.5.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= From 1f5fe3c3f38af5983d9a67ed788cba739e4eaa62 Mon Sep 17 00:00:00 2001 From: Chris Allen Lane Date: Wed, 6 Nov 2024 18:51:33 -0500 Subject: [PATCH 560/751] feat(secret scanning): Support `pull_request_comment_url` (#3344) --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 11 +++++++++++ github/secret_scanning.go | 19 ++++++++++--------- 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index acc54e7d960..1eb787dd709 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -22958,6 +22958,14 @@ func (s *SecretScanningAlertLocationDetails) GetPath() string { return *s.Path } +// GetPullRequestCommentURL returns the PullRequestCommentURL field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlertLocationDetails) GetPullRequestCommentURL() string { + if s == nil || s.PullRequestCommentURL == nil { + return "" + } + return *s.PullRequestCommentURL +} + // GetStartColumn returns the StartColumn field if it's non-nil, zero value otherwise. func (s *SecretScanningAlertLocationDetails) GetStartColumn() int { if s == nil || s.StartColumn == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index eea6da94d7e..b5c0d178a6a 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -29433,6 +29433,17 @@ func TestSecretScanningAlertLocationDetails_GetPath(tt *testing.T) { s.GetPath() } +func TestSecretScanningAlertLocationDetails_GetPullRequestCommentURL(tt *testing.T) { + tt.Parallel() + var zeroValue string + s := &SecretScanningAlertLocationDetails{PullRequestCommentURL: &zeroValue} + s.GetPullRequestCommentURL() + s = &SecretScanningAlertLocationDetails{} + s.GetPullRequestCommentURL() + s = nil + s.GetPullRequestCommentURL() +} + func TestSecretScanningAlertLocationDetails_GetStartColumn(tt *testing.T) { tt.Parallel() var zeroValue int diff --git a/github/secret_scanning.go b/github/secret_scanning.go index 9b2ad8cd0d2..2744926286a 100644 --- a/github/secret_scanning.go +++ b/github/secret_scanning.go @@ -44,15 +44,16 @@ type SecretScanningAlertLocation struct { // SecretScanningAlertLocationDetails represents the location details for a secret scanning alert. type SecretScanningAlertLocationDetails struct { - Path *string `json:"path,omitempty"` - Startline *int `json:"start_line,omitempty"` - EndLine *int `json:"end_line,omitempty"` - StartColumn *int `json:"start_column,omitempty"` - EndColumn *int `json:"end_column,omitempty"` - BlobSHA *string `json:"blob_sha,omitempty"` - BlobURL *string `json:"blob_url,omitempty"` - CommitSHA *string `json:"commit_sha,omitempty"` - CommitURL *string `json:"commit_url,omitempty"` + Path *string `json:"path,omitempty"` + Startline *int `json:"start_line,omitempty"` + EndLine *int `json:"end_line,omitempty"` + StartColumn *int `json:"start_column,omitempty"` + EndColumn *int `json:"end_column,omitempty"` + BlobSHA *string `json:"blob_sha,omitempty"` + BlobURL *string `json:"blob_url,omitempty"` + CommitSHA *string `json:"commit_sha,omitempty"` + CommitURL *string `json:"commit_url,omitempty"` + PullRequestCommentURL *string `json:"pull_request_comment_url,omitempty"` } // SecretScanningAlertListOptions specifies optional parameters to the SecretScanningService.ListAlertsForEnterprise method. From a1bc7608029b0c60969fa0bf2ae5e2ec22344a32 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Nov 2024 18:57:01 -0500 Subject: [PATCH 561/751] build(deps): bump golang.org/x/net from 0.30.0 to 0.31.0 in /scrape (#3348) --- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 986380f3c83..7a5ffdffbe8 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -9,7 +9,7 @@ require ( github.com/google/go-cmp v0.6.0 github.com/google/go-github/v66 v66.0.0 github.com/xlzd/gotp v0.1.0 - golang.org/x/net v0.30.0 + golang.org/x/net v0.31.0 ) require ( diff --git a/scrape/go.sum b/scrape/go.sum index 25e51e0db0e..a23c65cc4f5 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -21,8 +21,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= -golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= -golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= +golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= +golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= From 7d02f4270b644ec22c1caedd8e7ccf82616f23d8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Nov 2024 19:09:10 -0500 Subject: [PATCH 562/751] build(deps): bump golang.org/x/sync from 0.8.0 to 0.9.0 in /tools (#3347) --- tools/go.mod | 2 +- tools/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index 86c55603fa8..874a236c6e4 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -9,7 +9,7 @@ require ( github.com/getkin/kin-openapi v0.128.0 github.com/google/go-cmp v0.6.0 github.com/google/go-github/v66 v66.0.0 - golang.org/x/sync v0.8.0 + golang.org/x/sync v0.9.0 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/tools/go.sum b/tools/go.sum index 96f89ad96fa..91ee890697e 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -43,8 +43,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= -golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= -golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= +golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= From 163b46a095145d72aeaa26a6739722c246a2f01c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Nov 2024 19:18:34 -0500 Subject: [PATCH 563/751] build(deps): bump github.com/alecthomas/kong from 1.3.0 to 1.4.0 in /tools (#3346) --- tools/go.mod | 2 +- tools/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index 874a236c6e4..e76e1efa0fb 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -5,7 +5,7 @@ go 1.21 toolchain go1.22.0 require ( - github.com/alecthomas/kong v1.3.0 + github.com/alecthomas/kong v1.4.0 github.com/getkin/kin-openapi v0.128.0 github.com/google/go-cmp v0.6.0 github.com/google/go-github/v66 v66.0.0 diff --git a/tools/go.sum b/tools/go.sum index 91ee890697e..1ab04c7e250 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -1,7 +1,7 @@ github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0= github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= -github.com/alecthomas/kong v1.3.0 h1:YJKuU6/TV2XOBtymafSeuzDvLAFR8cYMZiXVNLhAO6g= -github.com/alecthomas/kong v1.3.0/go.mod h1:IDc8HyiouDdpdiEiY81iaEJM8rSIW6LzX8On4FCO0bE= +github.com/alecthomas/kong v1.4.0 h1:UL7tzGMnnY0YRMMvJyITIRX1EpO6RbBRZDNcCevy3HA= +github.com/alecthomas/kong v1.4.0/go.mod h1:p2vqieVMeTAnaC83txKtXe8FLke2X07aruPWXyMPQrU= github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc= github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= From 77dcbf366eb38ef6e07f72d9c268d0d1f024a398 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Tue, 12 Nov 2024 02:37:16 +0200 Subject: [PATCH 564/751] refactor: Enable revive linter and fix up lint issues (#3345) --- .golangci.yml | 31 +++++++++++++ github/{code-scanning.go => code_scanning.go} | 0 ...scanning_test.go => code_scanning_test.go} | 0 github/event_types_test.go | 4 +- github/github_test.go | 10 ++--- github/issues_test.go | 4 +- .../orgs_codesecurity_configurations_test.go | 6 +-- github/orgs_properties.go | 6 +-- github/repos_properties_test.go | 6 +-- github/repos_rules.go | 44 +++++++++---------- script/lint.sh | 2 +- 11 files changed, 72 insertions(+), 41 deletions(-) rename github/{code-scanning.go => code_scanning.go} (100%) rename github/{code-scanning_test.go => code_scanning_test.go} (100%) diff --git a/.golangci.yml b/.golangci.yml index 252c7c40201..89474e9be2b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -15,6 +15,7 @@ linters: - nakedret - perfsprint - paralleltest + - revive - stylecheck - tparallel - unconvert @@ -34,6 +35,36 @@ linters-settings: perfsprint: errorf: true strconcat: false + revive: + rules: + - name: blank-imports + - name: bool-literal-in-expr + - name: context-as-argument + - name: context-keys-type + - name: dot-imports + - name: early-return + - name: empty-block + - name: error-naming + - name: error-return + - name: error-strings + - name: errorf + - name: filename-format + arguments: + - "^[_a-z][_a-z0-9]*.go$" + - name: increment-decrement + - name: indent-error-flow + - name: package-comments + - name: range + - name: receiver-naming + - name: redefines-builtin-id + - name: superfluous-else + - name: time-equal + - name: time-naming + - name: unexported-naming + - name: unexported-return + - name: unreachable-code + - name: var-declaration + - name: var-naming issues: exclude-use-default: false exclude-rules: diff --git a/github/code-scanning.go b/github/code_scanning.go similarity index 100% rename from github/code-scanning.go rename to github/code_scanning.go diff --git a/github/code-scanning_test.go b/github/code_scanning_test.go similarity index 100% rename from github/code-scanning_test.go rename to github/code_scanning_test.go diff --git a/github/event_types_test.go b/github/event_types_test.go index 3883c9f0acb..b09b92799f1 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -56,7 +56,7 @@ func TestEditChange_Marshal_BaseChange(t *testing.T) { t.Parallel() testJSONMarshal(t, &EditChange{}, "{}") - Base := EditBase{ + base := EditBase{ Ref: &EditRef{ From: String("BaseRefFrom"), }, @@ -68,7 +68,7 @@ func TestEditChange_Marshal_BaseChange(t *testing.T) { u := &EditChange{ Title: nil, Body: nil, - Base: &Base, + Base: &base, } want := `{ diff --git a/github/github_test.go b/github/github_test.go index e16a2e47aca..73afa2d1968 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -1153,8 +1153,8 @@ func TestDo_rateLimit(t *testing.T) { t.Errorf("Client rate remaining = %v, want %v", got, want) } reset := time.Date(2013, time.July, 1, 17, 47, 53, 0, time.UTC) - if resp.Rate.Reset.UTC() != reset { - t.Errorf("Client rate reset = %v, want %v", resp.Rate.Reset, reset) + if !resp.Rate.Reset.UTC().Equal(reset) { + t.Errorf("Client rate reset = %v, want %v", resp.Rate.Reset.UTC(), reset) } } @@ -1263,7 +1263,7 @@ func TestDo_rateLimit_errorResponse(t *testing.T) { t.Errorf("Client rate remaining = %v, want %v", got, want) } reset := time.Date(2013, time.July, 1, 17, 47, 53, 0, time.UTC) - if resp.Rate.Reset.UTC() != reset { + if !resp.Rate.Reset.UTC().Equal(reset) { t.Errorf("Client rate reset = %v, want %v", resp.Rate.Reset, reset) } } @@ -1303,7 +1303,7 @@ func TestDo_rateLimit_rateLimitError(t *testing.T) { t.Errorf("rateLimitErr rate remaining = %v, want %v", got, want) } reset := time.Date(2013, time.July, 1, 17, 47, 53, 0, time.UTC) - if rateLimitErr.Rate.Reset.UTC() != reset { + if !rateLimitErr.Rate.Reset.UTC().Equal(reset) { t.Errorf("rateLimitErr rate reset = %v, want %v", rateLimitErr.Rate.Reset.UTC(), reset) } } @@ -1361,7 +1361,7 @@ func TestDo_rateLimit_noNetworkCall(t *testing.T) { if got, want := rateLimitErr.Rate.Remaining, 0; got != want { t.Errorf("rateLimitErr rate remaining = %v, want %v", got, want) } - if rateLimitErr.Rate.Reset.UTC() != reset { + if !rateLimitErr.Rate.Reset.UTC().Equal(reset) { t.Errorf("rateLimitErr rate reset = %v, want %v", rateLimitErr.Rate.Reset.UTC(), reset) } } diff --git a/github/issues_test.go b/github/issues_test.go index a554b34ed28..e4f0cace74a 100644 --- a/github/issues_test.go +++ b/github/issues_test.go @@ -470,11 +470,11 @@ func TestIssuesService_Unlock(t *testing.T) { func TestIsPullRequest(t *testing.T) { t.Parallel() i := new(Issue) - if i.IsPullRequest() == true { + if i.IsPullRequest() { t.Errorf("expected i.IsPullRequest (%v) to return false, got true", i) } i.PullRequestLinks = &PullRequestLinks{URL: String("http://example.com")} - if i.IsPullRequest() == false { + if !i.IsPullRequest() { t.Errorf("expected i.IsPullRequest (%v) to return true, got false", i) } } diff --git a/github/orgs_codesecurity_configurations_test.go b/github/orgs_codesecurity_configurations_test.go index e72f9fb976c..cb630bccb64 100644 --- a/github/orgs_codesecurity_configurations_test.go +++ b/github/orgs_codesecurity_configurations_test.go @@ -327,7 +327,7 @@ func TestOrganizationsService_AttachCodeSecurityConfigurationsToRepositories(t * testMethod(t, r, "POST") type request struct { Scope string `json:"scope"` - SelectedRepositoryIDS []int64 `json:"selected_repository_ids,omitempty"` + SelectedRepositoryIDs []int64 `json:"selected_repository_ids,omitempty"` } v := new(request) err := json.NewDecoder(r.Body).Decode(v) @@ -337,8 +337,8 @@ func TestOrganizationsService_AttachCodeSecurityConfigurationsToRepositories(t * if v.Scope != "selected" { t.Errorf("Organizations.AttachCodeSecurityConfigurationsToRepositories request body scope = %s, want selected", v.Scope) } - if !reflect.DeepEqual(v.SelectedRepositoryIDS, []int64{5, 20}) { - t.Errorf("Organizations.AttachCodeSecurityConfigurationsToRepositories request body selected_repository_ids = %+v, want %+v", v.SelectedRepositoryIDS, []int64{5, 20}) + if !reflect.DeepEqual(v.SelectedRepositoryIDs, []int64{5, 20}) { + t.Errorf("Organizations.AttachCodeSecurityConfigurationsToRepositories request body selected_repository_ids = %+v, want %+v", v.SelectedRepositoryIDs, []int64{5, 20}) } w.WriteHeader(http.StatusAccepted) }) diff --git a/github/orgs_properties.go b/github/orgs_properties.go index d8db48fc94e..d4fe5dfa07d 100644 --- a/github/orgs_properties.go +++ b/github/orgs_properties.go @@ -67,11 +67,11 @@ func (cpv *CustomPropertyValue) UnmarshalJSON(data []byte) error { case []interface{}: strSlice := make([]string, len(v)) for i, item := range v { - if str, ok := item.(string); ok { - strSlice[i] = str - } else { + str, ok := item.(string) + if !ok { return errors.New("non-string value in string array") } + strSlice[i] = str } cpv.Value = strSlice default: diff --git a/github/repos_properties_test.go b/github/repos_properties_test.go index 6f04bf67f5d..28e9573f8e4 100644 --- a/github/repos_properties_test.go +++ b/github/repos_properties_test.go @@ -90,13 +90,13 @@ func TestRepositoriesService_CreateOrUpdateCustomProperties(t *testing.T) { }) ctx := context.Background() - RepoCustomProperty := []*CustomPropertyValue{ + repoCustomProperty := []*CustomPropertyValue{ { PropertyName: "environment", Value: "production", }, } - _, err := client.Repositories.CreateOrUpdateCustomProperties(ctx, "usr", "r", RepoCustomProperty) + _, err := client.Repositories.CreateOrUpdateCustomProperties(ctx, "usr", "r", repoCustomProperty) if err != nil { t.Errorf("Repositories.CreateOrUpdateCustomProperties returned error: %v", err) } @@ -104,6 +104,6 @@ func TestRepositoriesService_CreateOrUpdateCustomProperties(t *testing.T) { const methodName = "CreateOrUpdateCustomProperties" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Repositories.CreateOrUpdateCustomProperties(ctx, "usr", "r", RepoCustomProperty) + return client.Repositories.CreateOrUpdateCustomProperties(ctx, "usr", "r", repoCustomProperty) }) } diff --git a/github/repos_rules.go b/github/repos_rules.go index 0d5052a4b1e..b113553a247 100644 --- a/github/repos_rules.go +++ b/github/repos_rules.go @@ -404,26 +404,26 @@ type CodeScanningTool struct { // This helps us handle the fact that RepositoryRule parameter field can be of numerous types. func (r *RepositoryRule) UnmarshalJSON(data []byte) error { type rule RepositoryRule - var RepositoryRule rule - if err := json.Unmarshal(data, &RepositoryRule); err != nil { + var repositoryRule rule + if err := json.Unmarshal(data, &repositoryRule); err != nil { return err } - r.RulesetID = RepositoryRule.RulesetID - r.RulesetSourceType = RepositoryRule.RulesetSourceType - r.RulesetSource = RepositoryRule.RulesetSource - r.Type = RepositoryRule.Type + r.RulesetID = repositoryRule.RulesetID + r.RulesetSourceType = repositoryRule.RulesetSourceType + r.RulesetSource = repositoryRule.RulesetSource + r.Type = repositoryRule.Type - switch RepositoryRule.Type { + switch repositoryRule.Type { case "creation", "deletion", "non_fast_forward", "required_linear_history", "required_signatures": r.Parameters = nil case "update": - if RepositoryRule.Parameters == nil { + if repositoryRule.Parameters == nil { r.Parameters = nil return nil } params := UpdateAllowsFetchAndMergeRuleParameters{} - if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { + if err := json.Unmarshal(*repositoryRule.Parameters, ¶ms); err != nil { return err } @@ -432,12 +432,12 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { r.Parameters = &rawParams case "merge_queue": - if RepositoryRule.Parameters == nil { + if repositoryRule.Parameters == nil { r.Parameters = nil return nil } params := MergeQueueRuleParameters{} - if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { + if err := json.Unmarshal(*repositoryRule.Parameters, ¶ms); err != nil { return err } @@ -447,7 +447,7 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { r.Parameters = &rawParams case "required_deployments": params := RequiredDeploymentEnvironmentsRuleParameters{} - if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { + if err := json.Unmarshal(*repositoryRule.Parameters, ¶ms); err != nil { return err } @@ -457,7 +457,7 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { r.Parameters = &rawParams case "commit_message_pattern", "commit_author_email_pattern", "committer_email_pattern", "branch_name_pattern", "tag_name_pattern": params := RulePatternParameters{} - if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { + if err := json.Unmarshal(*repositoryRule.Parameters, ¶ms); err != nil { return err } @@ -467,7 +467,7 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { r.Parameters = &rawParams case "pull_request": params := PullRequestRuleParameters{} - if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { + if err := json.Unmarshal(*repositoryRule.Parameters, ¶ms); err != nil { return err } @@ -477,7 +477,7 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { r.Parameters = &rawParams case "required_status_checks": params := RequiredStatusChecksRuleParameters{} - if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { + if err := json.Unmarshal(*repositoryRule.Parameters, ¶ms); err != nil { return err } @@ -487,7 +487,7 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { r.Parameters = &rawParams case "workflows": params := RequiredWorkflowsRuleParameters{} - if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { + if err := json.Unmarshal(*repositoryRule.Parameters, ¶ms); err != nil { return err } @@ -497,7 +497,7 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { r.Parameters = &rawParams case "file_path_restriction": params := RuleFileParameters{} - if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { + if err := json.Unmarshal(*repositoryRule.Parameters, ¶ms); err != nil { return err } bytes, _ := json.Marshal(params) @@ -506,7 +506,7 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { r.Parameters = &rawParams case "code_scanning": params := RequiredCodeScanningRuleParameters{} - if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { + if err := json.Unmarshal(*repositoryRule.Parameters, ¶ms); err != nil { return err } bytes, _ := json.Marshal(params) @@ -515,7 +515,7 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { r.Parameters = &rawParams case "max_file_path_length": params := RuleMaxFilePathLengthParameters{} - if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { + if err := json.Unmarshal(*repositoryRule.Parameters, ¶ms); err != nil { return err } bytes, _ := json.Marshal(params) @@ -524,7 +524,7 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { r.Parameters = &rawParams case "file_extension_restriction": params := RuleFileExtensionRestrictionParameters{} - if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { + if err := json.Unmarshal(*repositoryRule.Parameters, ¶ms); err != nil { return err } bytes, _ := json.Marshal(params) @@ -533,7 +533,7 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { r.Parameters = &rawParams case "max_file_size": params := RuleMaxFileSizeParameters{} - if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { + if err := json.Unmarshal(*repositoryRule.Parameters, ¶ms); err != nil { return err } bytes, _ := json.Marshal(params) @@ -543,7 +543,7 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { default: r.Type = "" r.Parameters = nil - return fmt.Errorf("RepositoryRule.Type %q is not yet implemented, unable to unmarshal (%#v)", RepositoryRule.Type, RepositoryRule) + return fmt.Errorf("RepositoryRule.Type %q is not yet implemented, unable to unmarshal (%#v)", repositoryRule.Type, repositoryRule) } return nil diff --git a/script/lint.sh b/script/lint.sh index 25e5e049ca3..a52e9bfa2b6 100755 --- a/script/lint.sh +++ b/script/lint.sh @@ -5,7 +5,7 @@ set -e -GOLANGCI_LINT_VERSION="1.61.0" +GOLANGCI_LINT_VERSION="1.62.0" CDPATH="" cd -- "$(dirname -- "$0")/.." BIN="$(pwd -P)"/bin From fbd682c97513e58df90d1506ac51219ecc0ff5b7 Mon Sep 17 00:00:00 2001 From: tomfeigin Date: Mon, 18 Nov 2024 00:16:30 +0200 Subject: [PATCH 565/751] Add missing permissions to `InstallationPermissions` struct (#3349) --- github/apps.go | 9 +++ github/github-accessors.go | 72 ++++++++++++++++++++++++ github/github-accessors_test.go | 99 +++++++++++++++++++++++++++++++++ 3 files changed, 180 insertions(+) diff --git a/github/apps.go b/github/apps.go index 2f74c2c2639..4757dedfaa9 100644 --- a/github/apps.go +++ b/github/apps.go @@ -82,15 +82,22 @@ type InstallationPermissions struct { Administration *string `json:"administration,omitempty"` Blocking *string `json:"blocking,omitempty"` Checks *string `json:"checks,omitempty"` + Codespaces *string `json:"codespaces,omitempty"` + CodespacesLifecycleAdmin *string `json:"codespaces_lifecycle_admin,omitempty"` + CodespacesMetadata *string `json:"codespaces_metadata,omitempty"` + CodespacesSecrets *string `json:"codespaces_secrets,omitempty"` Contents *string `json:"contents,omitempty"` ContentReferences *string `json:"content_references,omitempty"` + DependabotSecrets *string `json:"dependabot_secrets,omitempty"` Deployments *string `json:"deployments,omitempty"` + Discussions *string `json:"discussions,omitempty"` Emails *string `json:"emails,omitempty"` Environments *string `json:"environments,omitempty"` Followers *string `json:"followers,omitempty"` Issues *string `json:"issues,omitempty"` Metadata *string `json:"metadata,omitempty"` Members *string `json:"members,omitempty"` + MergeQueues *string `json:"merge_queues,omitempty"` OrganizationAdministration *string `json:"organization_administration,omitempty"` OrganizationCustomProperties *string `json:"organization_custom_properties,omitempty"` OrganizationCustomRoles *string `json:"organization_custom_roles,omitempty"` @@ -108,6 +115,8 @@ type InstallationPermissions struct { Packages *string `json:"packages,omitempty"` Pages *string `json:"pages,omitempty"` PullRequests *string `json:"pull_requests,omitempty"` + RepositoryAdvisories *string `json:"repository_advisories,omitempty"` + RepositoryCustomProperties *string `json:"repository_custom_properties,omitempty"` RepositoryHooks *string `json:"repository_hooks,omitempty"` RepositoryProjects *string `json:"repository_projects,omitempty"` RepositoryPreReceiveHooks *string `json:"repository_pre_receive_hooks,omitempty"` diff --git a/github/github-accessors.go b/github/github-accessors.go index 1eb787dd709..7d8292a9652 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -9302,6 +9302,38 @@ func (i *InstallationPermissions) GetChecks() string { return *i.Checks } +// GetCodespaces returns the Codespaces field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetCodespaces() string { + if i == nil || i.Codespaces == nil { + return "" + } + return *i.Codespaces +} + +// GetCodespacesLifecycleAdmin returns the CodespacesLifecycleAdmin field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetCodespacesLifecycleAdmin() string { + if i == nil || i.CodespacesLifecycleAdmin == nil { + return "" + } + return *i.CodespacesLifecycleAdmin +} + +// GetCodespacesMetadata returns the CodespacesMetadata field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetCodespacesMetadata() string { + if i == nil || i.CodespacesMetadata == nil { + return "" + } + return *i.CodespacesMetadata +} + +// GetCodespacesSecrets returns the CodespacesSecrets field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetCodespacesSecrets() string { + if i == nil || i.CodespacesSecrets == nil { + return "" + } + return *i.CodespacesSecrets +} + // GetContentReferences returns the ContentReferences field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetContentReferences() string { if i == nil || i.ContentReferences == nil { @@ -9318,6 +9350,14 @@ func (i *InstallationPermissions) GetContents() string { return *i.Contents } +// GetDependabotSecrets returns the DependabotSecrets field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetDependabotSecrets() string { + if i == nil || i.DependabotSecrets == nil { + return "" + } + return *i.DependabotSecrets +} + // GetDeployments returns the Deployments field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetDeployments() string { if i == nil || i.Deployments == nil { @@ -9326,6 +9366,14 @@ func (i *InstallationPermissions) GetDeployments() string { return *i.Deployments } +// GetDiscussions returns the Discussions field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetDiscussions() string { + if i == nil || i.Discussions == nil { + return "" + } + return *i.Discussions +} + // GetEmails returns the Emails field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetEmails() string { if i == nil || i.Emails == nil { @@ -9366,6 +9414,14 @@ func (i *InstallationPermissions) GetMembers() string { return *i.Members } +// GetMergeQueues returns the MergeQueues field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetMergeQueues() string { + if i == nil || i.MergeQueues == nil { + return "" + } + return *i.MergeQueues +} + // GetMetadata returns the Metadata field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetMetadata() string { if i == nil || i.Metadata == nil { @@ -9510,6 +9566,22 @@ func (i *InstallationPermissions) GetPullRequests() string { return *i.PullRequests } +// GetRepositoryAdvisories returns the RepositoryAdvisories field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetRepositoryAdvisories() string { + if i == nil || i.RepositoryAdvisories == nil { + return "" + } + return *i.RepositoryAdvisories +} + +// GetRepositoryCustomProperties returns the RepositoryCustomProperties field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetRepositoryCustomProperties() string { + if i == nil || i.RepositoryCustomProperties == nil { + return "" + } + return *i.RepositoryCustomProperties +} + // GetRepositoryHooks returns the RepositoryHooks field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetRepositoryHooks() string { if i == nil || i.RepositoryHooks == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index b5c0d178a6a..4d7b022e12c 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -12039,6 +12039,50 @@ func TestInstallationPermissions_GetChecks(tt *testing.T) { i.GetChecks() } +func TestInstallationPermissions_GetCodespaces(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &InstallationPermissions{Codespaces: &zeroValue} + i.GetCodespaces() + i = &InstallationPermissions{} + i.GetCodespaces() + i = nil + i.GetCodespaces() +} + +func TestInstallationPermissions_GetCodespacesLifecycleAdmin(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &InstallationPermissions{CodespacesLifecycleAdmin: &zeroValue} + i.GetCodespacesLifecycleAdmin() + i = &InstallationPermissions{} + i.GetCodespacesLifecycleAdmin() + i = nil + i.GetCodespacesLifecycleAdmin() +} + +func TestInstallationPermissions_GetCodespacesMetadata(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &InstallationPermissions{CodespacesMetadata: &zeroValue} + i.GetCodespacesMetadata() + i = &InstallationPermissions{} + i.GetCodespacesMetadata() + i = nil + i.GetCodespacesMetadata() +} + +func TestInstallationPermissions_GetCodespacesSecrets(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &InstallationPermissions{CodespacesSecrets: &zeroValue} + i.GetCodespacesSecrets() + i = &InstallationPermissions{} + i.GetCodespacesSecrets() + i = nil + i.GetCodespacesSecrets() +} + func TestInstallationPermissions_GetContentReferences(tt *testing.T) { tt.Parallel() var zeroValue string @@ -12061,6 +12105,17 @@ func TestInstallationPermissions_GetContents(tt *testing.T) { i.GetContents() } +func TestInstallationPermissions_GetDependabotSecrets(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &InstallationPermissions{DependabotSecrets: &zeroValue} + i.GetDependabotSecrets() + i = &InstallationPermissions{} + i.GetDependabotSecrets() + i = nil + i.GetDependabotSecrets() +} + func TestInstallationPermissions_GetDeployments(tt *testing.T) { tt.Parallel() var zeroValue string @@ -12072,6 +12127,17 @@ func TestInstallationPermissions_GetDeployments(tt *testing.T) { i.GetDeployments() } +func TestInstallationPermissions_GetDiscussions(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &InstallationPermissions{Discussions: &zeroValue} + i.GetDiscussions() + i = &InstallationPermissions{} + i.GetDiscussions() + i = nil + i.GetDiscussions() +} + func TestInstallationPermissions_GetEmails(tt *testing.T) { tt.Parallel() var zeroValue string @@ -12127,6 +12193,17 @@ func TestInstallationPermissions_GetMembers(tt *testing.T) { i.GetMembers() } +func TestInstallationPermissions_GetMergeQueues(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &InstallationPermissions{MergeQueues: &zeroValue} + i.GetMergeQueues() + i = &InstallationPermissions{} + i.GetMergeQueues() + i = nil + i.GetMergeQueues() +} + func TestInstallationPermissions_GetMetadata(tt *testing.T) { tt.Parallel() var zeroValue string @@ -12325,6 +12402,28 @@ func TestInstallationPermissions_GetPullRequests(tt *testing.T) { i.GetPullRequests() } +func TestInstallationPermissions_GetRepositoryAdvisories(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &InstallationPermissions{RepositoryAdvisories: &zeroValue} + i.GetRepositoryAdvisories() + i = &InstallationPermissions{} + i.GetRepositoryAdvisories() + i = nil + i.GetRepositoryAdvisories() +} + +func TestInstallationPermissions_GetRepositoryCustomProperties(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &InstallationPermissions{RepositoryCustomProperties: &zeroValue} + i.GetRepositoryCustomProperties() + i = &InstallationPermissions{} + i.GetRepositoryCustomProperties() + i = nil + i.GetRepositoryCustomProperties() +} + func TestInstallationPermissions_GetRepositoryHooks(tt *testing.T) { tt.Parallel() var zeroValue string From 4d424547bb8c1465dedea5b3401cd082e1582ff8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 14:44:29 -0500 Subject: [PATCH 566/751] build(deps): bump codecov/codecov-action from 4.6.0 to 5.0.2 (#3351) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f35b944840d..3c7efdd6a8e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -73,4 +73,4 @@ jobs: - name: Upload coverage to Codecov if: ${{ matrix.update-coverage }} - uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 #v4.6.0 + uses: codecov/codecov-action@5c47607acb93fed5485fdbf7232e8a31425f672a #v5.0.2 From f9210c4672f0c8f68c86712e0c7c49d6010f0545 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Tue, 19 Nov 2024 07:59:59 -0500 Subject: [PATCH 567/751] Update OpenAPI (#3352) --- github/actions_runner_groups.go | 26 +- github/admin.go | 4 +- github/admin_orgs.go | 6 +- github/admin_stats.go | 2 +- github/admin_users.go | 8 +- github/authorizations.go | 4 +- github/repos_prereceive_hooks.go | 8 +- github/repos_tags.go | 6 +- github/users_administration.go | 8 +- openapi_operations.yaml | 2329 ++++++++++++++++-------------- 10 files changed, 1248 insertions(+), 1153 deletions(-) diff --git a/github/actions_runner_groups.go b/github/actions_runner_groups.go index a1f453f3c67..b2ee32f6145 100644 --- a/github/actions_runner_groups.go +++ b/github/actions_runner_groups.go @@ -80,7 +80,7 @@ type ListOrgRunnerGroupOptions struct { // ListOrganizationRunnerGroups lists all self-hosted runner groups configured in an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-organization // //meta:operation GET /orgs/{org}/actions/runner-groups func (s *ActionsService) ListOrganizationRunnerGroups(ctx context.Context, org string, opts *ListOrgRunnerGroupOptions) (*RunnerGroups, *Response, error) { @@ -106,7 +106,7 @@ func (s *ActionsService) ListOrganizationRunnerGroups(ctx context.Context, org s // GetOrganizationRunnerGroup gets a specific self-hosted runner group for an organization using its RunnerGroup ID. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-organization // //meta:operation GET /orgs/{org}/actions/runner-groups/{runner_group_id} func (s *ActionsService) GetOrganizationRunnerGroup(ctx context.Context, org string, groupID int64) (*RunnerGroup, *Response, error) { @@ -127,7 +127,7 @@ func (s *ActionsService) GetOrganizationRunnerGroup(ctx context.Context, org str // DeleteOrganizationRunnerGroup deletes a self-hosted runner group from an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-organization // //meta:operation DELETE /orgs/{org}/actions/runner-groups/{runner_group_id} func (s *ActionsService) DeleteOrganizationRunnerGroup(ctx context.Context, org string, groupID int64) (*Response, error) { @@ -143,7 +143,7 @@ func (s *ActionsService) DeleteOrganizationRunnerGroup(ctx context.Context, org // CreateOrganizationRunnerGroup creates a new self-hosted runner group for an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-organization // //meta:operation POST /orgs/{org}/actions/runner-groups func (s *ActionsService) CreateOrganizationRunnerGroup(ctx context.Context, org string, createReq CreateRunnerGroupRequest) (*RunnerGroup, *Response, error) { @@ -164,7 +164,7 @@ func (s *ActionsService) CreateOrganizationRunnerGroup(ctx context.Context, org // UpdateOrganizationRunnerGroup updates a self-hosted runner group for an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-organization // //meta:operation PATCH /orgs/{org}/actions/runner-groups/{runner_group_id} func (s *ActionsService) UpdateOrganizationRunnerGroup(ctx context.Context, org string, groupID int64, updateReq UpdateRunnerGroupRequest) (*RunnerGroup, *Response, error) { @@ -185,7 +185,7 @@ func (s *ActionsService) UpdateOrganizationRunnerGroup(ctx context.Context, org // ListRepositoryAccessRunnerGroup lists the repositories with access to a self-hosted runner group configured in an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#list-repository-access-to-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#list-repository-access-to-a-self-hosted-runner-group-in-an-organization // //meta:operation GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories func (s *ActionsService) ListRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID int64, opts *ListOptions) (*ListRepositories, *Response, error) { @@ -212,7 +212,7 @@ func (s *ActionsService) ListRepositoryAccessRunnerGroup(ctx context.Context, or // SetRepositoryAccessRunnerGroup replaces the list of repositories that have access to a self-hosted runner group configured in an organization // with a new List of repositories. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#set-repository-access-for-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#set-repository-access-for-a-self-hosted-runner-group-in-an-organization // //meta:operation PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories func (s *ActionsService) SetRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID int64, ids SetRepoAccessRunnerGroupRequest) (*Response, error) { @@ -229,7 +229,7 @@ func (s *ActionsService) SetRepositoryAccessRunnerGroup(ctx context.Context, org // AddRepositoryAccessRunnerGroup adds a repository to the list of selected repositories that can access a self-hosted runner group. // The runner group must have visibility set to 'selected'. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#add-repository-access-to-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#add-repository-access-to-a-self-hosted-runner-group-in-an-organization // //meta:operation PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} func (s *ActionsService) AddRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID, repoID int64) (*Response, error) { @@ -246,7 +246,7 @@ func (s *ActionsService) AddRepositoryAccessRunnerGroup(ctx context.Context, org // RemoveRepositoryAccessRunnerGroup removes a repository from the list of selected repositories that can access a self-hosted runner group. // The runner group must have visibility set to 'selected'. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization // //meta:operation DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} func (s *ActionsService) RemoveRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID, repoID int64) (*Response, error) { @@ -262,7 +262,7 @@ func (s *ActionsService) RemoveRepositoryAccessRunnerGroup(ctx context.Context, // ListRunnerGroupRunners lists self-hosted runners that are in a specific organization group. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-organization // //meta:operation GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners func (s *ActionsService) ListRunnerGroupRunners(ctx context.Context, org string, groupID int64, opts *ListOptions) (*Runners, *Response, error) { @@ -289,7 +289,7 @@ func (s *ActionsService) ListRunnerGroupRunners(ctx context.Context, org string, // SetRunnerGroupRunners replaces the list of self-hosted runners that are part of an organization runner group // with a new list of runners. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-organization // //meta:operation PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners func (s *ActionsService) SetRunnerGroupRunners(ctx context.Context, org string, groupID int64, ids SetRunnerGroupRunnersRequest) (*Response, error) { @@ -305,7 +305,7 @@ func (s *ActionsService) SetRunnerGroupRunners(ctx context.Context, org string, // AddRunnerGroupRunners adds a self-hosted runner to a runner group configured in an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-organization // //meta:operation PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} func (s *ActionsService) AddRunnerGroupRunners(ctx context.Context, org string, groupID, runnerID int64) (*Response, error) { @@ -322,7 +322,7 @@ func (s *ActionsService) AddRunnerGroupRunners(ctx context.Context, org string, // RemoveRunnerGroupRunners removes a self-hosted runner from a group configured in an organization. // The runner is then returned to the default group. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-organization // //meta:operation DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} func (s *ActionsService) RemoveRunnerGroupRunners(ctx context.Context, org string, groupID, runnerID int64) (*Response, error) { diff --git a/github/admin.go b/github/admin.go index c932cbe6ad6..adf55d64146 100644 --- a/github/admin.go +++ b/github/admin.go @@ -82,7 +82,7 @@ func (m Enterprise) String() string { // UpdateUserLDAPMapping updates the mapping between a GitHub user and an LDAP user. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user // //meta:operation PATCH /admin/ldap/users/{username}/mapping func (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, mapping *UserLDAPMapping) (*UserLDAPMapping, *Response, error) { @@ -103,7 +103,7 @@ func (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, m // UpdateTeamLDAPMapping updates the mapping between a GitHub team and an LDAP group. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team // //meta:operation PATCH /admin/ldap/teams/{team_id}/mapping func (s *AdminService) UpdateTeamLDAPMapping(ctx context.Context, team int64, mapping *TeamLDAPMapping) (*TeamLDAPMapping, *Response, error) { diff --git a/github/admin_orgs.go b/github/admin_orgs.go index f1e728707de..8b50756b0d0 100644 --- a/github/admin_orgs.go +++ b/github/admin_orgs.go @@ -22,7 +22,7 @@ type createOrgRequest struct { // Note that only a subset of the org fields are used and org must // not be nil. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/orgs#create-an-organization +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/orgs#create-an-organization // //meta:operation POST /admin/organizations func (s *AdminService) CreateOrg(ctx context.Context, org *Organization, admin string) (*Organization, *Response, error) { @@ -61,7 +61,7 @@ type RenameOrgResponse struct { // RenameOrg renames an organization in GitHub Enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/orgs#update-an-organization-name +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/orgs#update-an-organization-name // //meta:operation PATCH /admin/organizations/{org} func (s *AdminService) RenameOrg(ctx context.Context, org *Organization, newName string) (*RenameOrgResponse, *Response, error) { @@ -70,7 +70,7 @@ func (s *AdminService) RenameOrg(ctx context.Context, org *Organization, newName // RenameOrgByName renames an organization in GitHub Enterprise using its current name. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/orgs#update-an-organization-name +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/orgs#update-an-organization-name // //meta:operation PATCH /admin/organizations/{org} func (s *AdminService) RenameOrgByName(ctx context.Context, org, newName string) (*RenameOrgResponse, *Response, error) { diff --git a/github/admin_stats.go b/github/admin_stats.go index 51b7d86fc39..f012d7984c0 100644 --- a/github/admin_stats.go +++ b/github/admin_stats.go @@ -152,7 +152,7 @@ func (s RepoStats) String() string { // Please note that this is only available to site administrators, // otherwise it will error with a 404 not found (instead of 401 or 403). // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-all-statistics +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/admin-stats#get-all-statistics // //meta:operation GET /enterprise/stats/all func (s *AdminService) GetAdminStats(ctx context.Context) (*AdminStats, *Response, error) { diff --git a/github/admin_users.go b/github/admin_users.go index e447f002ac6..6877cef460c 100644 --- a/github/admin_users.go +++ b/github/admin_users.go @@ -20,7 +20,7 @@ type CreateUserRequest struct { // CreateUser creates a new user in GitHub Enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#create-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#create-a-user // //meta:operation POST /admin/users func (s *AdminService) CreateUser(ctx context.Context, userReq CreateUserRequest) (*User, *Response, error) { @@ -42,7 +42,7 @@ func (s *AdminService) CreateUser(ctx context.Context, userReq CreateUserRequest // DeleteUser deletes a user in GitHub Enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#delete-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#delete-a-user // //meta:operation DELETE /admin/users/{username} func (s *AdminService) DeleteUser(ctx context.Context, username string) (*Response, error) { @@ -95,7 +95,7 @@ type UserAuthorization struct { // CreateUserImpersonation creates an impersonation OAuth token. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#create-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#create-an-impersonation-oauth-token // //meta:operation POST /admin/users/{username}/authorizations func (s *AdminService) CreateUserImpersonation(ctx context.Context, username string, opts *ImpersonateUserOptions) (*UserAuthorization, *Response, error) { @@ -117,7 +117,7 @@ func (s *AdminService) CreateUserImpersonation(ctx context.Context, username str // DeleteUserImpersonation deletes an impersonation OAuth token. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#delete-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#delete-an-impersonation-oauth-token // //meta:operation DELETE /admin/users/{username}/authorizations func (s *AdminService) DeleteUserImpersonation(ctx context.Context, username string) (*Response, error) { diff --git a/github/authorizations.go b/github/authorizations.go index 5e63a3efb95..8b8a67d5524 100644 --- a/github/authorizations.go +++ b/github/authorizations.go @@ -257,7 +257,7 @@ func (s *AuthorizationsService) DeleteGrant(ctx context.Context, clientID, acces // you can e.g. create or delete a user's public SSH key. NOTE: creating a // new token automatically revokes an existing one. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#create-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#create-an-impersonation-oauth-token // //meta:operation POST /admin/users/{username}/authorizations func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, username string, authReq *AuthorizationRequest) (*Authorization, *Response, error) { @@ -279,7 +279,7 @@ func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, usernam // // NOTE: there can be only one at a time. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#delete-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#delete-an-impersonation-oauth-token // //meta:operation DELETE /admin/users/{username}/authorizations func (s *AuthorizationsService) DeleteImpersonation(ctx context.Context, username string) (*Response, error) { diff --git a/github/repos_prereceive_hooks.go b/github/repos_prereceive_hooks.go index 8bac8bff7e0..e97075d020c 100644 --- a/github/repos_prereceive_hooks.go +++ b/github/repos_prereceive_hooks.go @@ -24,7 +24,7 @@ func (p PreReceiveHook) String() string { // ListPreReceiveHooks lists all pre-receive hooks for the specified repository. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/pre-receive-hooks func (s *RepositoriesService) ListPreReceiveHooks(ctx context.Context, owner, repo string, opts *ListOptions) ([]*PreReceiveHook, *Response, error) { @@ -53,7 +53,7 @@ func (s *RepositoriesService) ListPreReceiveHooks(ctx context.Context, owner, re // GetPreReceiveHook returns a single specified pre-receive hook. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) GetPreReceiveHook(ctx context.Context, owner, repo string, id int64) (*PreReceiveHook, *Response, error) { @@ -77,7 +77,7 @@ func (s *RepositoriesService) GetPreReceiveHook(ctx context.Context, owner, repo // UpdatePreReceiveHook updates a specified pre-receive hook. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository // //meta:operation PATCH /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) UpdatePreReceiveHook(ctx context.Context, owner, repo string, id int64, hook *PreReceiveHook) (*PreReceiveHook, *Response, error) { @@ -101,7 +101,7 @@ func (s *RepositoriesService) UpdatePreReceiveHook(ctx context.Context, owner, r // DeletePreReceiveHook deletes a specified pre-receive hook. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository // //meta:operation DELETE /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) DeletePreReceiveHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { diff --git a/github/repos_tags.go b/github/repos_tags.go index 3fb7f583d1b..b6dc36e2a34 100644 --- a/github/repos_tags.go +++ b/github/repos_tags.go @@ -25,7 +25,7 @@ type tagProtectionRequest struct { // Deprecated: ListTagProtection lists tag protection of the specified repository. // Deprecation notice: This operation is deprecated and will be removed after August 30, 2024. Use the "Repository Rulesets" endpoint instead: https://docs.github.com/rest/repos/rules#get-all-repository-rulesets // -// GitHub API docs: https://docs.github.com/rest/repos/tags#deprecated---list-tag-protection-states-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/tags#closing-down---list-tag-protection-states-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/tags/protection func (s *RepositoriesService) ListTagProtection(ctx context.Context, owner, repo string) ([]*TagProtection, *Response, error) { @@ -48,7 +48,7 @@ func (s *RepositoriesService) ListTagProtection(ctx context.Context, owner, repo // Deprecated: CreateTagProtection creates the tag protection of the specified repository. // Deprecation notice: This operation is deprecated and will be removed after August 30, 2024. Use the "Repository Rulesets" endpoint instead: https://docs.github.com/rest/repos/rules#create-a-repository-ruleset // -// GitHub API docs: https://docs.github.com/rest/repos/tags#deprecated---create-a-tag-protection-state-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/tags#closing-down---create-a-tag-protection-state-for-a-repository // //meta:operation POST /repos/{owner}/{repo}/tags/protection func (s *RepositoriesService) CreateTagProtection(ctx context.Context, owner, repo, pattern string) (*TagProtection, *Response, error) { @@ -71,7 +71,7 @@ func (s *RepositoriesService) CreateTagProtection(ctx context.Context, owner, re // Deprecated: DeleteTagProtection deletes a tag protection from the specified repository. // Deprecation notice: This operation is deprecated and will be removed after August 30, 2024. Use the "Repository Rulesets" endpoint instead: https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset // -// GitHub API docs: https://docs.github.com/rest/repos/tags#deprecated---delete-a-tag-protection-state-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/tags#closing-down---delete-a-tag-protection-state-for-a-repository // //meta:operation DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id} func (s *RepositoriesService) DeleteTagProtection(ctx context.Context, owner, repo string, tagProtectionID int64) (*Response, error) { diff --git a/github/users_administration.go b/github/users_administration.go index 6b74da5fe8a..c0aa3b6493d 100644 --- a/github/users_administration.go +++ b/github/users_administration.go @@ -12,7 +12,7 @@ import ( // PromoteSiteAdmin promotes a user to a site administrator of a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator // //meta:operation PUT /users/{username}/site_admin func (s *UsersService) PromoteSiteAdmin(ctx context.Context, user string) (*Response, error) { @@ -28,7 +28,7 @@ func (s *UsersService) PromoteSiteAdmin(ctx context.Context, user string) (*Resp // DemoteSiteAdmin demotes a user from site administrator of a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#demote-a-site-administrator +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#demote-a-site-administrator // //meta:operation DELETE /users/{username}/site_admin func (s *UsersService) DemoteSiteAdmin(ctx context.Context, user string) (*Response, error) { @@ -49,7 +49,7 @@ type UserSuspendOptions struct { // Suspend a user on a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#suspend-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#suspend-a-user // //meta:operation PUT /users/{username}/suspended func (s *UsersService) Suspend(ctx context.Context, user string, opts *UserSuspendOptions) (*Response, error) { @@ -65,7 +65,7 @@ func (s *UsersService) Suspend(ctx context.Context, user string, opts *UserSuspe // Unsuspend a user on a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#unsuspend-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#unsuspend-a-user // //meta:operation DELETE /users/{username}/suspended func (s *UsersService) Unsuspend(ctx context.Context, user string) (*Response, error) { diff --git a/openapi_operations.yaml b/openapi_operations.yaml index f3d820db227..65a8ef0aafb 100644 --- a/openapi_operations.yaml +++ b/openapi_operations.yaml @@ -47,260 +47,260 @@ operation_overrides: documentation_url: https://docs.github.com/rest/pages/pages#request-a-github-pages-build - name: GET /repos/{owner}/{repo}/pages/builds/{build_id} documentation_url: https://docs.github.com/rest/pages/pages#get-github-pages-build -openapi_commit: b58921456b9d07db8596feacdff0eea8a6022817 +openapi_commit: a0508cecd18ab26b525527e4ba35bd9c6d725c4f openapi_operations: - name: GET / documentation_url: https://docs.github.com/rest/meta/meta#github-api-root openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /admin/hooks - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/global-webhooks#list-global-webhooks + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/global-webhooks#list-global-webhooks openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /admin/hooks - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/global-webhooks#create-a-global-webhook + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/global-webhooks#create-a-global-webhook openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /admin/hooks/{hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/global-webhooks#delete-a-global-webhook + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/global-webhooks#delete-a-global-webhook openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /admin/hooks/{hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/global-webhooks#get-a-global-webhook + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/global-webhooks#get-a-global-webhook openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /admin/hooks/{hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/global-webhooks#update-a-global-webhook + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/global-webhooks#update-a-global-webhook openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /admin/hooks/{hook_id}/pings - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/global-webhooks#ping-a-global-webhook + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/global-webhooks#ping-a-global-webhook openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /admin/keys - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#list-public-keys + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#list-public-keys openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /admin/keys/{key_ids} - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#delete-a-public-key + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#delete-a-public-key openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /admin/ldap/teams/{team_id}/mapping - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /admin/ldap/teams/{team_id}/sync - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/ldap#sync-ldap-mapping-for-a-team + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/ldap#sync-ldap-mapping-for-a-team openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /admin/ldap/users/{username}/mapping - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /admin/ldap/users/{username}/sync - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/ldap#sync-ldap-mapping-for-a-user + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/ldap#sync-ldap-mapping-for-a-user openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /admin/organizations - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/orgs#create-an-organization + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/orgs#create-an-organization openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /admin/organizations/{org} - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/orgs#update-an-organization-name + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/orgs#update-an-organization-name openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /admin/pre-receive-environments - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-environments#list-pre-receive-environments + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/pre-receive-environments#list-pre-receive-environments openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /admin/pre-receive-environments - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-environments#create-a-pre-receive-environment + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/pre-receive-environments#create-a-pre-receive-environment openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /admin/pre-receive-environments/{pre_receive_environment_id} - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-environments#delete-a-pre-receive-environment + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/pre-receive-environments#delete-a-pre-receive-environment openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /admin/pre-receive-environments/{pre_receive_environment_id} - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-environments#get-a-pre-receive-environment + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/pre-receive-environments#get-a-pre-receive-environment openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /admin/pre-receive-environments/{pre_receive_environment_id} - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-environments#update-a-pre-receive-environment + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/pre-receive-environments#update-a-pre-receive-environment openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /admin/pre-receive-environments/{pre_receive_environment_id}/downloads - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-environments#start-a-pre-receive-environment-download + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/pre-receive-environments#start-a-pre-receive-environment-download openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /admin/pre-receive-environments/{pre_receive_environment_id}/downloads/latest - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-environments#get-the-download-status-for-a-pre-receive-environment + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/pre-receive-environments#get-the-download-status-for-a-pre-receive-environment openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /admin/pre-receive-hooks - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-hooks#list-pre-receive-hooks + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/pre-receive-hooks#list-pre-receive-hooks openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /admin/pre-receive-hooks - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-hooks#create-a-pre-receive-hook + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/pre-receive-hooks#create-a-pre-receive-hook openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /admin/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-hooks#delete-a-pre-receive-hook + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/pre-receive-hooks#delete-a-pre-receive-hook openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /admin/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-hooks#get-a-pre-receive-hook + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/pre-receive-hooks#get-a-pre-receive-hook openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /admin/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-hooks#update-a-pre-receive-hook + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/pre-receive-hooks#update-a-pre-receive-hook openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /admin/tokens - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#list-personal-access-tokens + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#list-personal-access-tokens openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /admin/tokens/{token_id} - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#delete-a-personal-access-token + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#delete-a-personal-access-token openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /admin/users - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#create-a-user + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#create-a-user openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /admin/users/{username} - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#delete-a-user + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#delete-a-user openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /admin/users/{username} - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#update-the-username-for-a-user + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#update-the-username-for-a-user openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /admin/users/{username}/authorizations - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#delete-an-impersonation-oauth-token + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#delete-an-impersonation-oauth-token openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /admin/users/{username}/authorizations - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#create-an-impersonation-oauth-token + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#create-an-impersonation-oauth-token openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /advisories documentation_url: https://docs.github.com/rest/security-advisories/global-advisories#list-global-security-advisories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /advisories/{ghsa_id} documentation_url: https://docs.github.com/rest/security-advisories/global-advisories#get-a-global-security-advisory openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /app documentation_url: https://docs.github.com/rest/apps/apps#get-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /app-manifests/{code}/conversions documentation_url: https://docs.github.com/rest/apps/apps#create-a-github-app-from-a-manifest openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /app/hook/config documentation_url: https://docs.github.com/rest/apps/webhooks#get-a-webhook-configuration-for-an-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /app/hook/config documentation_url: https://docs.github.com/rest/apps/webhooks#update-a-webhook-configuration-for-an-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /app/hook/deliveries documentation_url: https://docs.github.com/rest/apps/webhooks#list-deliveries-for-an-app-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /app/hook/deliveries/{delivery_id} documentation_url: https://docs.github.com/rest/apps/webhooks#get-a-delivery-for-an-app-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /app/hook/deliveries/{delivery_id}/attempts documentation_url: https://docs.github.com/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /app/installation-requests documentation_url: https://docs.github.com/rest/apps/apps#list-installation-requests-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /app/installations documentation_url: https://docs.github.com/rest/apps/apps#list-installations-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /app/installations/{installation_id} documentation_url: https://docs.github.com/rest/apps/apps#delete-an-installation-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /app/installations/{installation_id} documentation_url: https://docs.github.com/rest/apps/apps#get-an-installation-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /app/installations/{installation_id}/access_tokens documentation_url: https://docs.github.com/rest/apps/apps#create-an-installation-access-token-for-an-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /app/installations/{installation_id}/suspended documentation_url: https://docs.github.com/rest/apps/apps#unsuspend-an-app-installation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /app/installations/{installation_id}/suspended documentation_url: https://docs.github.com/rest/apps/apps#suspend-an-app-installation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /applications/grants - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations#list-your-grants + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/oauth-authorizations/oauth-authorizations#list-your-grants openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /applications/grants/{grant_id} - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations#delete-a-grant + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/oauth-authorizations/oauth-authorizations#delete-a-grant openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /applications/grants/{grant_id} - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations#get-a-single-grant + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/oauth-authorizations/oauth-authorizations#get-a-single-grant openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /applications/{client_id}/grant documentation_url: https://docs.github.com/rest/apps/oauth-applications#delete-an-app-authorization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /applications/{client_id}/grants/{access_token} documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#revoke-a-grant-for-an-application openapi_files: @@ -310,25 +310,25 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /applications/{client_id}/token documentation_url: https://docs.github.com/rest/apps/oauth-applications#reset-a-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /applications/{client_id}/token documentation_url: https://docs.github.com/rest/apps/oauth-applications#check-a-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /applications/{client_id}/token/scoped documentation_url: https://docs.github.com/rest/apps/apps#create-a-scoped-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /applications/{client_id}/tokens/{access_token} documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#revoke-an-authorization-for-an-application openapi_files: @@ -346,7 +346,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /assignments/{assignment_id} documentation_url: https://docs.github.com/rest/classroom/classroom#get-an-assignment openapi_files: @@ -363,33 +363,33 @@ openapi_operations: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: GET /authorizations - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations#list-your-authorizations + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/oauth-authorizations/oauth-authorizations#list-your-authorizations openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /authorizations - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations#create-a-new-authorization + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/oauth-authorizations/oauth-authorizations#create-a-new-authorization openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /authorizations/clients/{client_id} - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/oauth-authorizations/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /authorizations/clients/{client_id}/{fingerprint} - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app-and-fingerprint + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/oauth-authorizations/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app-and-fingerprint openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /authorizations/{authorization_id} - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations#delete-an-authorization + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/oauth-authorizations/oauth-authorizations#delete-an-authorization openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /authorizations/{authorization_id} - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations#get-a-single-authorization + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/oauth-authorizations/oauth-authorizations#get-a-single-authorization openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /authorizations/{authorization_id} - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations#update-an-existing-authorization + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/oauth-authorizations/oauth-authorizations#update-an-existing-authorization openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /classrooms documentation_url: https://docs.github.com/rest/classroom/classroom#list-classrooms openapi_files: @@ -410,100 +410,100 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /codes_of_conduct/{key} documentation_url: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-a-code-of-conduct openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /emojis documentation_url: https://docs.github.com/rest/emojis/emojis#get-emojis openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /enterprise-installation/{enterprise_or_org}/server-statistics documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/admin-stats#get-github-enterprise-server-statistics openapi_files: - descriptions/ghec/ghec.json - name: DELETE /enterprise/announcement - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/announcement#remove-the-global-announcement-banner + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/announcement#remove-the-global-announcement-banner openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /enterprise/announcement - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/announcement#get-the-global-announcement-banner + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/announcement#get-the-global-announcement-banner openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /enterprise/announcement - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/announcement#set-the-global-announcement-banner + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/announcement#set-the-global-announcement-banner openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /enterprise/settings/license - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/license#get-license-information + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/license#get-license-information openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /enterprise/stats/all - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-all-statistics + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/admin-stats#get-all-statistics openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /enterprise/stats/comments - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-comment-statistics + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/admin-stats#get-comment-statistics openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /enterprise/stats/gists - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-gist-statistics + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/admin-stats#get-gist-statistics openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /enterprise/stats/hooks - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-hooks-statistics + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/admin-stats#get-hooks-statistics openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /enterprise/stats/issues - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-issue-statistics + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/admin-stats#get-issue-statistics openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /enterprise/stats/milestones - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-milestone-statistics + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/admin-stats#get-milestone-statistics openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /enterprise/stats/orgs - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-organization-statistics + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/admin-stats#get-organization-statistics openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /enterprise/stats/pages - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-pages-statistics + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/admin-stats#get-pages-statistics openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /enterprise/stats/pulls - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-pull-request-statistics + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/admin-stats#get-pull-request-statistics openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /enterprise/stats/repos - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-repository-statistics + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/admin-stats#get-repository-statistics openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /enterprise/stats/security-products - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-security-products-statistics + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/admin-stats#get-security-products-statistics openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /enterprise/stats/users - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-users-statistics + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/admin-stats#get-users-statistics openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /enterprises/{enterprise}/actions/cache/usage documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/cache#get-github-actions-cache-usage-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /enterprises/{enterprise}/actions/cache/usage-policy - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/actions/cache#get-github-actions-cache-usage-policy-for-an-enterprise + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/actions/cache#get-github-actions-cache-usage-policy-for-an-enterprise openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /enterprises/{enterprise}/actions/cache/usage-policy - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/actions/cache#set-github-actions-cache-usage-policy-for-an-enterprise + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/actions/cache#set-github-actions-cache-usage-policy-for-an-enterprise openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /enterprises/{enterprise}/actions/oidc/customization/issuer documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/oidc#set-the-github-actions-oidc-custom-issuer-policy-for-an-enterprise openapi_files: @@ -512,177 +512,177 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-github-actions-permissions-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /enterprises/{enterprise}/actions/permissions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-github-actions-permissions-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /enterprises/{enterprise}/actions/permissions/organizations documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#list-selected-organizations-enabled-for-github-actions-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /enterprises/{enterprise}/actions/permissions/organizations documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-selected-organizations-enabled-for-github-actions-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#disable-a-selected-organization-for-github-actions-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#enable-a-selected-organization-for-github-actions-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /enterprises/{enterprise}/actions/permissions/selected-actions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /enterprises/{enterprise}/actions/permissions/selected-actions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /enterprises/{enterprise}/actions/permissions/workflow documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-default-workflow-permissions-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /enterprises/{enterprise}/actions/permissions/workflow documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-default-workflow-permissions-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /enterprises/{enterprise}/actions/runner-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /enterprises/{enterprise}/actions/runner-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-organization-access-to-a-self-hosted-runner-group-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-organization-access-for-a-self-hosted-runner-group-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-organization-access-to-a-self-hosted-runner-group-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-organization-access-to-a-self-hosted-runner-group-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /enterprises/{enterprise}/actions/runners documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /enterprises/{enterprise}/actions/runners/downloads documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#list-runner-applications-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /enterprises/{enterprise}/actions/runners/generate-jitconfig documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /enterprises/{enterprise}/actions/runners/registration-token documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#create-a-registration-token-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /enterprises/{enterprise}/actions/runners/remove-token documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#create-a-remove-token-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /enterprises/{enterprise}/actions/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /enterprises/{enterprise}/actions/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /enterprises/{enterprise}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /enterprises/{enterprise}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /enterprises/{enterprise}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels/{name} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#remove-a-custom-label-from-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /enterprises/{enterprise}/announcement documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/enterprises#remove-announcement-banner-from-enterprise openapi_files: @@ -699,22 +699,22 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#get-the-audit-log-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /enterprises/{enterprise}/code-scanning/alerts documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /enterprises/{enterprise}/code_security_and_analysis documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#get-code-security-and-analysis-features-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /enterprises/{enterprise}/code_security_and_analysis documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#update-code-security-and-analysis-features-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /enterprises/{enterprise}/consumed-licenses documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/license#list-enterprise-consumed-licenses openapi_files: @@ -724,6 +724,11 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - name: GET /enterprises/{enterprise}/copilot/metrics + documentation_url: https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /enterprises/{enterprise}/copilot/usage documentation_url: https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-enterprise-members openapi_files: @@ -734,7 +739,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /enterprises/{enterprise}/license-sync-status documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/license#get-a-license-sync-status openapi_files: @@ -744,7 +749,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /enterprises/{enterprise}/settings/billing/actions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#get-github-actions-billing-for-an-enterprise openapi_files: @@ -753,7 +758,7 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#get-github-advanced-security-active-committers-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /enterprises/{enterprise}/settings/billing/cost-centers documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#get-all-cost-centers-for-an-enterprise openapi_files: @@ -778,6 +783,11 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#get-billing-usage-report-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json + - name: GET /enterprises/{enterprise}/team/{team_slug}/copilot/metrics + documentation_url: https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise-team + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /enterprises/{enterprise}/team/{team_slug}/copilot/usage documentation_url: https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-an-enterprise-team openapi_files: @@ -787,263 +797,263 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#enable-or-disable-a-security-feature openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /events documentation_url: https://docs.github.com/rest/activity/events#list-public-events openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /feeds documentation_url: https://docs.github.com/rest/activity/feeds#get-feeds openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /gists documentation_url: https://docs.github.com/rest/gists/gists#list-gists-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /gists documentation_url: https://docs.github.com/rest/gists/gists#create-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /gists/public documentation_url: https://docs.github.com/rest/gists/gists#list-public-gists openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /gists/starred documentation_url: https://docs.github.com/rest/gists/gists#list-starred-gists openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /gists/{gist_id} documentation_url: https://docs.github.com/rest/gists/gists#delete-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /gists/{gist_id} documentation_url: https://docs.github.com/rest/gists/gists#get-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /gists/{gist_id} documentation_url: https://docs.github.com/rest/gists/gists#update-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /gists/{gist_id}/comments documentation_url: https://docs.github.com/rest/gists/comments#list-gist-comments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /gists/{gist_id}/comments documentation_url: https://docs.github.com/rest/gists/comments#create-a-gist-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /gists/{gist_id}/comments/{comment_id} documentation_url: https://docs.github.com/rest/gists/comments#delete-a-gist-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /gists/{gist_id}/comments/{comment_id} documentation_url: https://docs.github.com/rest/gists/comments#get-a-gist-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /gists/{gist_id}/comments/{comment_id} documentation_url: https://docs.github.com/rest/gists/comments#update-a-gist-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /gists/{gist_id}/commits documentation_url: https://docs.github.com/rest/gists/gists#list-gist-commits openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /gists/{gist_id}/forks documentation_url: https://docs.github.com/rest/gists/gists#list-gist-forks openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /gists/{gist_id}/forks documentation_url: https://docs.github.com/rest/gists/gists#fork-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /gists/{gist_id}/star documentation_url: https://docs.github.com/rest/gists/gists#unstar-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /gists/{gist_id}/star documentation_url: https://docs.github.com/rest/gists/gists#check-if-a-gist-is-starred openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /gists/{gist_id}/star documentation_url: https://docs.github.com/rest/gists/gists#star-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /gists/{gist_id}/{sha} documentation_url: https://docs.github.com/rest/gists/gists#get-a-gist-revision openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /gitignore/templates documentation_url: https://docs.github.com/rest/gitignore/gitignore#get-all-gitignore-templates openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /gitignore/templates/{name} documentation_url: https://docs.github.com/rest/gitignore/gitignore#get-a-gitignore-template openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /installation/repositories documentation_url: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-app-installation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /installation/token documentation_url: https://docs.github.com/rest/apps/installations#revoke-an-installation-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /issues documentation_url: https://docs.github.com/rest/issues/issues#list-issues-assigned-to-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /licenses documentation_url: https://docs.github.com/rest/licenses/licenses#get-all-commonly-used-licenses openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /licenses/{license} documentation_url: https://docs.github.com/rest/licenses/licenses#get-a-license openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /manage/v1/access/ssh - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#delete-a-ssh-key + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#delete-a-ssh-key openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /manage/v1/access/ssh - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#get-the-configured-ssh-keys + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-configured-ssh-keys openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /manage/v1/access/ssh - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#set-a-new-ssh-key + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#set-a-new-ssh-key openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /manage/v1/checks/system-requirements - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#get-the-system-requirement-check-results-for-configured-cluster-nodes + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-system-requirement-check-results-for-configured-cluster-nodes openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /manage/v1/cluster/status - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-cluster-nodes + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-cluster-nodes openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /manage/v1/config/apply - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#get-the-status-of-a-ghe-config-apply-run + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-status-of-a-ghe-config-apply-run openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /manage/v1/config/apply - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#trigger-a-ghe-config-apply-run + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#trigger-a-ghe-config-apply-run openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /manage/v1/config/apply/events - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#list-events-from-ghe-config-apply + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#list-events-from-ghe-config-apply openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /manage/v1/config/init - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#initialize-instance-configuration-with-license-upload + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#initialize-instance-configuration-with-license-upload openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /manage/v1/config/license - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#get-the-enterprise-license-information + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-enterprise-license-information openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /manage/v1/config/license - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#upload-an-enterprise-license + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#upload-an-enterprise-license openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /manage/v1/config/license/check - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#check-a-license + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#check-a-license openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /manage/v1/config/nodes - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#get-ghes-node-metadata-for-all-nodes + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-ghes-node-metadata-for-all-nodes openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /manage/v1/config/settings - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#get-the-ghes-settings + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-ghes-settings openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /manage/v1/config/settings - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#set-settings + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#set-settings openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /manage/v1/maintenance - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#get-the-status-of-maintenance-mode + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-status-of-maintenance-mode openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /manage/v1/maintenance - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#set-the-status-of-maintenance-mode + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#set-the-status-of-maintenance-mode openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /manage/v1/replication/status - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-replica-nodes + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-replica-nodes openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /manage/v1/version - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#get-all-ghes-release-versions-for-all-nodes + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-all-ghes-release-versions-for-all-nodes openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /markdown documentation_url: https://docs.github.com/rest/markdown/markdown#render-a-markdown-document openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /markdown/raw documentation_url: https://docs.github.com/rest/markdown/markdown#render-a-markdown-document-in-raw-mode openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /marketplace_listing/accounts/{account_id} documentation_url: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account openapi_files: @@ -1079,440 +1089,453 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /networks/{owner}/{repo}/events documentation_url: https://docs.github.com/rest/activity/events#list-public-events-for-a-network-of-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /notifications documentation_url: https://docs.github.com/rest/activity/notifications#list-notifications-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /notifications documentation_url: https://docs.github.com/rest/activity/notifications#mark-notifications-as-read openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /notifications/threads/{thread_id} documentation_url: https://docs.github.com/rest/activity/notifications#mark-a-thread-as-done openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /notifications/threads/{thread_id} documentation_url: https://docs.github.com/rest/activity/notifications#get-a-thread openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /notifications/threads/{thread_id} documentation_url: https://docs.github.com/rest/activity/notifications#mark-a-thread-as-read openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /notifications/threads/{thread_id}/subscription documentation_url: https://docs.github.com/rest/activity/notifications#delete-a-thread-subscription openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /notifications/threads/{thread_id}/subscription documentation_url: https://docs.github.com/rest/activity/notifications#get-a-thread-subscription-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /notifications/threads/{thread_id}/subscription documentation_url: https://docs.github.com/rest/activity/notifications#set-a-thread-subscription openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /octocat documentation_url: https://docs.github.com/rest/meta/meta#get-octocat openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /organizations documentation_url: https://docs.github.com/rest/orgs/orgs#list-organizations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /organizations/{organization_id}/custom_roles - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#deprecated---list-custom-repository-roles-in-an-organization + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#closing-down---list-custom-repository-roles-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org} documentation_url: https://docs.github.com/rest/orgs/orgs#delete-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org} documentation_url: https://docs.github.com/rest/orgs/orgs#get-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /orgs/{org} documentation_url: https://docs.github.com/rest/orgs/orgs#update-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/actions/cache/usage documentation_url: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/actions/cache/usage-by-repository documentation_url: https://docs.github.com/rest/actions/cache#list-repositories-with-github-actions-cache-usage-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/actions/oidc/customization/sub documentation_url: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /orgs/{org}/actions/oidc/customization/sub documentation_url: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/actions/permissions documentation_url: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /orgs/{org}/actions/permissions documentation_url: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/actions/permissions/repositories documentation_url: https://docs.github.com/rest/actions/permissions#list-selected-repositories-enabled-for-github-actions-in-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /orgs/{org}/actions/permissions/repositories documentation_url: https://docs.github.com/rest/actions/permissions#set-selected-repositories-enabled-for-github-actions-in-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/actions/permissions/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/permissions#disable-a-selected-repository-for-github-actions-in-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /orgs/{org}/actions/permissions/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/permissions#enable-a-selected-repository-for-github-actions-in-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/actions/permissions/selected-actions documentation_url: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /orgs/{org}/actions/permissions/selected-actions documentation_url: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/actions/permissions/workflow documentation_url: https://docs.github.com/rest/actions/permissions#get-default-workflow-permissions-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /orgs/{org}/actions/permissions/workflow documentation_url: https://docs.github.com/rest/actions/permissions#set-default-workflow-permissions-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/actions/runner-groups - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-organization + documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-organization openapi_files: + - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /orgs/{org}/actions/runner-groups - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-organization + documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-organization openapi_files: + - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/actions/runner-groups/{runner_group_id} - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-organization + documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-organization openapi_files: + - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/actions/runner-groups/{runner_group_id} - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-organization + documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-organization openapi_files: + - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /orgs/{org}/actions/runner-groups/{runner_group_id} - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-organization + documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-organization openapi_files: + - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-repository-access-to-a-self-hosted-runner-group-in-an-organization + documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#list-repository-access-to-a-self-hosted-runner-group-in-an-organization openapi_files: + - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-repository-access-for-a-self-hosted-runner-group-in-an-organization + documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#set-repository-access-for-a-self-hosted-runner-group-in-an-organization openapi_files: + - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization + documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization openapi_files: + - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-repository-access-to-a-self-hosted-runner-group-in-an-organization + documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#add-repository-access-to-a-self-hosted-runner-group-in-an-organization openapi_files: + - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-organization + documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-organization openapi_files: + - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-organization + documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-organization openapi_files: + - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-organization + documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-organization openapi_files: + - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-organization + documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-organization openapi_files: + - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/actions/runners documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/actions/runners/downloads documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /orgs/{org}/actions/runners/generate-jitconfig documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /orgs/{org}/actions/runners/registration-token documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /orgs/{org}/actions/runners/remove-token documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/actions/runners/{runner_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/actions/runners/{runner_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /orgs/{org}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /orgs/{org}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-a-custom-label-from-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/actions/secrets documentation_url: https://docs.github.com/rest/actions/secrets#list-organization-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/actions/secrets/public-key documentation_url: https://docs.github.com/rest/actions/secrets#get-an-organization-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#delete-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#get-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /orgs/{org}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/actions/secrets/{secret_name}/repositories documentation_url: https://docs.github.com/rest/actions/secrets#list-selected-repositories-for-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /orgs/{org}/actions/secrets/{secret_name}/repositories documentation_url: https://docs.github.com/rest/actions/secrets#set-selected-repositories-for-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/secrets#remove-selected-repository-from-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/secrets#add-selected-repository-to-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/actions/variables documentation_url: https://docs.github.com/rest/actions/variables#list-organization-variables openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /orgs/{org}/actions/variables documentation_url: https://docs.github.com/rest/actions/variables#create-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#delete-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#get-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /orgs/{org}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#update-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/actions/variables/{name}/repositories documentation_url: https://docs.github.com/rest/actions/variables#list-selected-repositories-for-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /orgs/{org}/actions/variables/{name}/repositories documentation_url: https://docs.github.com/rest/actions/variables#set-selected-repositories-for-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/variables#remove-selected-repository-from-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/variables#add-selected-repository-to-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/announcement documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/organizations#remove-announcement-banner-from-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/announcement documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/organizations#get-announcement-banner-for-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /orgs/{org}/announcement documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/organizations#set-announcement-banner-for-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/attestations/{subject_digest} documentation_url: https://docs.github.com/rest/orgs/orgs#list-attestations openapi_files: @@ -1522,7 +1545,7 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/orgs#get-the-audit-log-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/blocks documentation_url: https://docs.github.com/rest/orgs/blocking#list-users-blocked-by-an-organization openapi_files: @@ -1548,57 +1571,67 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/code-security/configurations documentation_url: https://docs.github.com/rest/code-security/configurations#get-code-security-configurations-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /orgs/{org}/code-security/configurations documentation_url: https://docs.github.com/rest/code-security/configurations#create-a-code-security-configuration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/code-security/configurations/defaults documentation_url: https://docs.github.com/rest/code-security/configurations#get-default-code-security-configurations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/code-security/configurations/detach documentation_url: https://docs.github.com/rest/code-security/configurations#detach-configurations-from-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/code-security/configurations/{configuration_id} documentation_url: https://docs.github.com/rest/code-security/configurations#delete-a-code-security-configuration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/code-security/configurations/{configuration_id} documentation_url: https://docs.github.com/rest/code-security/configurations#get-a-code-security-configuration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /orgs/{org}/code-security/configurations/{configuration_id} documentation_url: https://docs.github.com/rest/code-security/configurations#update-a-code-security-configuration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /orgs/{org}/code-security/configurations/{configuration_id}/attach documentation_url: https://docs.github.com/rest/code-security/configurations#attach-a-configuration-to-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults documentation_url: https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories documentation_url: https://docs.github.com/rest/code-security/configurations#get-repositories-associated-with-a-code-security-configuration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/codespaces documentation_url: https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-the-organization openapi_files: @@ -1694,6 +1727,11 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/copilot/metrics + documentation_url: https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /orgs/{org}/copilot/usage documentation_url: https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-organization-members openapi_files: @@ -1711,41 +1749,41 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /orgs/{org}/custom-repository-roles documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#create-a-custom-repository-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/custom-repository-roles/{role_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#delete-a-custom-repository-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/custom-repository-roles/{role_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#get-a-custom-repository-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /orgs/{org}/custom-repository-roles/{role_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#update-a-custom-repository-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /orgs/{org}/custom_roles - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#deprecated---create-a-custom-role + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#closing-down---create-a-custom-role openapi_files: - descriptions/ghec/ghec.json - name: DELETE /orgs/{org}/custom_roles/{role_id} - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#deprecated---delete-a-custom-role + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#closing-down---delete-a-custom-role openapi_files: - descriptions/ghec/ghec.json - name: GET /orgs/{org}/custom_roles/{role_id} - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#deprecated---get-a-custom-role + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#closing-down---get-a-custom-role openapi_files: - descriptions/ghec/ghec.json - name: PATCH /orgs/{org}/custom_roles/{role_id} - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#deprecated---update-a-custom-role + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#closing-down---update-a-custom-role openapi_files: - descriptions/ghec/ghec.json - name: GET /orgs/{org}/dependabot/alerts @@ -1753,90 +1791,90 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/dependabot/secrets documentation_url: https://docs.github.com/rest/dependabot/secrets#list-organization-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/dependabot/secrets/public-key documentation_url: https://docs.github.com/rest/dependabot/secrets#get-an-organization-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#delete-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#get-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /orgs/{org}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories documentation_url: https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories documentation_url: https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/dependabot/secrets#add-selected-repository-to-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/docker/conflicts documentation_url: https://docs.github.com/rest/packages/packages#get-list-of-conflicting-packages-during-docker-migration-for-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/events documentation_url: https://docs.github.com/rest/activity/events#list-public-organization-events openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/external-group/{group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#get-an-external-group openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/external-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#list-external-groups-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/failed_invitations documentation_url: https://docs.github.com/rest/orgs/members#list-failed-organization-invitations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: GET /orgs/{org}/fine_grained_permissions - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#deprecated---list-fine-grained-permissions-for-an-organization + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#closing-down---list-fine-grained-permissions-for-an-organization openapi_files: - descriptions/ghec/ghec.json - name: GET /orgs/{org}/hooks @@ -1844,79 +1882,124 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /orgs/{org}/hooks documentation_url: https://docs.github.com/rest/orgs/webhooks#create-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/orgs/webhooks#delete-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/orgs/webhooks#get-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /orgs/{org}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/orgs/webhooks#update-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/hooks/{hook_id}/config documentation_url: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /orgs/{org}/hooks/{hook_id}/config documentation_url: https://docs.github.com/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/hooks/{hook_id}/deliveries documentation_url: https://docs.github.com/rest/orgs/webhooks#list-deliveries-for-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id} documentation_url: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-delivery-for-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts documentation_url: https://docs.github.com/rest/orgs/webhooks#redeliver-a-delivery-for-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /orgs/{org}/hooks/{hook_id}/pings documentation_url: https://docs.github.com/rest/orgs/webhooks#ping-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json + - name: GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id} + documentation_url: https://docs.github.com/rest/orgs/api-insights#get-route-stats-by-actor + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/insights/api/subject-stats + documentation_url: https://docs.github.com/rest/orgs/api-insights#get-subject-stats + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/insights/api/summary-stats + documentation_url: https://docs.github.com/rest/orgs/api-insights#get-summary-stats + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/insights/api/summary-stats/users/{user_id} + documentation_url: https://docs.github.com/rest/orgs/api-insights#get-summary-stats-by-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id} + documentation_url: https://docs.github.com/rest/orgs/api-insights#get-summary-stats-by-actor + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/insights/api/time-stats + documentation_url: https://docs.github.com/rest/orgs/api-insights#get-time-stats + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/insights/api/time-stats/users/{user_id} + documentation_url: https://docs.github.com/rest/orgs/api-insights#get-time-stats-by-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id} + documentation_url: https://docs.github.com/rest/orgs/api-insights#get-time-stats-by-actor + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/insights/api/user-stats/{user_id} + documentation_url: https://docs.github.com/rest/orgs/api-insights#get-user-stats + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /orgs/{org}/installation documentation_url: https://docs.github.com/rest/apps/apps#get-an-organization-installation-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/installations documentation_url: https://docs.github.com/rest/orgs/orgs#list-app-installations-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/interaction-limits documentation_url: https://docs.github.com/rest/interactions/orgs#remove-interaction-restrictions-for-an-organization openapi_files: @@ -1957,25 +2040,25 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/members documentation_url: https://docs.github.com/rest/orgs/members#list-organization-members openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/members/{username} documentation_url: https://docs.github.com/rest/orgs/members#remove-an-organization-member openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/members/{username} documentation_url: https://docs.github.com/rest/orgs/members#check-organization-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/members/{username}/codespaces documentation_url: https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-a-user-in-organization openapi_files: @@ -2001,414 +2084,414 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/memberships/{username} documentation_url: https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /orgs/{org}/memberships/{username} documentation_url: https://docs.github.com/rest/orgs/members#set-organization-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/migrations documentation_url: https://docs.github.com/rest/migrations/orgs#list-organization-migrations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /orgs/{org}/migrations documentation_url: https://docs.github.com/rest/migrations/orgs#start-an-organization-migration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/migrations/{migration_id} documentation_url: https://docs.github.com/rest/migrations/orgs#get-an-organization-migration-status openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/migrations/{migration_id}/archive documentation_url: https://docs.github.com/rest/migrations/orgs#delete-an-organization-migration-archive openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/migrations/{migration_id}/archive documentation_url: https://docs.github.com/rest/migrations/orgs#download-an-organization-migration-archive openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock documentation_url: https://docs.github.com/rest/migrations/orgs#unlock-an-organization-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/migrations/{migration_id}/repositories documentation_url: https://docs.github.com/rest/migrations/orgs#list-repositories-in-an-organization-migration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/organization-fine-grained-permissions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/organization-roles#list-organization-fine-grained-permissions-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/organization-roles documentation_url: https://docs.github.com/rest/orgs/organization-roles#get-all-organization-roles-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /orgs/{org}/organization-roles documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/organization-roles#create-a-custom-organization-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/organization-roles/teams/{team_slug} documentation_url: https://docs.github.com/rest/orgs/organization-roles#remove-all-organization-roles-for-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id} documentation_url: https://docs.github.com/rest/orgs/organization-roles#remove-an-organization-role-from-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id} documentation_url: https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/organization-roles/users/{username} documentation_url: https://docs.github.com/rest/orgs/organization-roles#remove-all-organization-roles-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/organization-roles/users/{username}/{role_id} documentation_url: https://docs.github.com/rest/orgs/organization-roles#remove-an-organization-role-from-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /orgs/{org}/organization-roles/users/{username}/{role_id} documentation_url: https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/organization-roles/{role_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/organization-roles#delete-a-custom-organization-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/organization-roles/{role_id} documentation_url: https://docs.github.com/rest/orgs/organization-roles#get-an-organization-role openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /orgs/{org}/organization-roles/{role_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/organization-roles#update-a-custom-organization-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/organization-roles/{role_id}/teams documentation_url: https://docs.github.com/rest/orgs/organization-roles#list-teams-that-are-assigned-to-an-organization-role openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/organization-roles/{role_id}/users documentation_url: https://docs.github.com/rest/orgs/organization-roles#list-users-that-are-assigned-to-an-organization-role openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/outside_collaborators documentation_url: https://docs.github.com/rest/orgs/outside-collaborators#list-outside-collaborators-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/outside_collaborators/{username} documentation_url: https://docs.github.com/rest/orgs/outside-collaborators#remove-outside-collaborator-from-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /orgs/{org}/outside_collaborators/{username} documentation_url: https://docs.github.com/rest/orgs/outside-collaborators#convert-an-organization-member-to-outside-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/packages documentation_url: https://docs.github.com/rest/packages/packages#list-packages-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /orgs/{org}/packages/{package_type}/{package_name}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/packages/{package_type}/{package_name}/versions documentation_url: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#delete-package-version-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-version-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-package-version-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/personal-access-token-requests documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /orgs/{org}/personal-access-token-requests documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#review-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /orgs/{org}/personal-access-token-requests/{pat_request_id} documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#review-a-request-to-access-organization-resources-with-a-fine-grained-personal-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-repositories-requested-to-be-accessed-by-a-fine-grained-personal-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/personal-access-tokens documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-fine-grained-personal-access-tokens-with-access-to-organization-resources openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /orgs/{org}/personal-access-tokens documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#update-the-access-to-organization-resources-via-fine-grained-personal-access-tokens openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /orgs/{org}/personal-access-tokens/{pat_id} documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#update-the-access-a-fine-grained-personal-access-token-has-to-organization-resources openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-repositories-a-fine-grained-personal-access-token-has-access-to openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/pre-receive-hooks - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/org-pre-receive-hooks#list-pre-receive-hooks-for-an-organization + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/org-pre-receive-hooks#list-pre-receive-hooks-for-an-organization openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/org-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-an-organization + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/org-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-an-organization openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/org-pre-receive-hooks#get-a-pre-receive-hook-for-an-organization + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/org-pre-receive-hooks#get-a-pre-receive-hook-for-an-organization openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /orgs/{org}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/org-pre-receive-hooks#update-pre-receive-hook-enforcement-for-an-organization + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/org-pre-receive-hooks#update-pre-receive-hook-enforcement-for-an-organization openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/projects documentation_url: https://docs.github.com/rest/projects/projects#list-organization-projects openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /orgs/{org}/projects documentation_url: https://docs.github.com/rest/projects/projects#create-an-organization-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/properties/schema documentation_url: https://docs.github.com/rest/orgs/custom-properties#get-all-custom-properties-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /orgs/{org}/properties/schema documentation_url: https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-properties-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/properties/schema/{custom_property_name} documentation_url: https://docs.github.com/rest/orgs/custom-properties#remove-a-custom-property-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/properties/schema/{custom_property_name} documentation_url: https://docs.github.com/rest/orgs/custom-properties#get-a-custom-property-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /orgs/{org}/properties/schema/{custom_property_name} documentation_url: https://docs.github.com/rest/orgs/custom-properties#create-or-update-a-custom-property-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/properties/values documentation_url: https://docs.github.com/rest/orgs/custom-properties#list-custom-property-values-for-organization-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /orgs/{org}/properties/values documentation_url: https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-property-values-for-organization-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/public_members documentation_url: https://docs.github.com/rest/orgs/members#list-public-organization-members openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/public_members/{username} documentation_url: https://docs.github.com/rest/orgs/members#remove-public-organization-membership-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/public_members/{username} documentation_url: https://docs.github.com/rest/orgs/members#check-public-organization-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /orgs/{org}/public_members/{username} documentation_url: https://docs.github.com/rest/orgs/members#set-public-organization-membership-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/repos documentation_url: https://docs.github.com/rest/repos/repos#list-organization-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /orgs/{org}/repos documentation_url: https://docs.github.com/rest/repos/repos#create-an-organization-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/repository-fine-grained-permissions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#list-repository-fine-grained-permissions-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/rulesets documentation_url: https://docs.github.com/rest/orgs/rules#get-all-organization-repository-rulesets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /orgs/{org}/rulesets documentation_url: https://docs.github.com/rest/orgs/rules#create-an-organization-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/rulesets/rule-suites documentation_url: https://docs.github.com/rest/orgs/rule-suites#list-organization-rule-suites openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id} documentation_url: https://docs.github.com/rest/orgs/rule-suites#get-an-organization-rule-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/orgs/rules#delete-an-organization-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/orgs/rules#get-an-organization-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /orgs/{org}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/orgs/rules#update-an-organization-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/secret-scanning/alerts documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/security-advisories documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories-for-an-organization openapi_files: @@ -2419,19 +2502,19 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/security-managers/teams/{team_slug} documentation_url: https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /orgs/{org}/security-managers/teams/{team_slug} documentation_url: https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/settings/billing/actions documentation_url: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-an-organization openapi_files: @@ -2441,7 +2524,7 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/billing/billing#get-github-advanced-security-active-committers-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/settings/billing/packages documentation_url: https://docs.github.com/rest/billing/billing#get-github-packages-billing-for-an-organization openapi_files: @@ -2456,6 +2539,11 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#list-idp-groups-for-an-organization openapi_files: - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/team/{team_slug}/copilot/metrics + documentation_url: https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-a-team + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /orgs/{org}/team/{team_slug}/copilot/usage documentation_url: https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-a-team openapi_files: @@ -2466,142 +2554,142 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /orgs/{org}/teams documentation_url: https://docs.github.com/rest/teams/teams#create-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/teams/{team_slug} documentation_url: https://docs.github.com/rest/teams/teams#delete-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/teams/{team_slug} documentation_url: https://docs.github.com/rest/teams/teams#get-a-team-by-name openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /orgs/{org}/teams/{team_slug} documentation_url: https://docs.github.com/rest/teams/teams#update-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/teams/{team_slug}/discussions documentation_url: https://docs.github.com/rest/teams/discussions#list-discussions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /orgs/{org}/teams/{team_slug}/discussions documentation_url: https://docs.github.com/rest/teams/discussions#create-a-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#delete-a-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#get-a-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#update-a-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments documentation_url: https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments documentation_url: https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-team-discussion-comment-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-team-discussion-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/teams/{team_slug}/external-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#remove-the-connection-between-an-external-group-and-a-team openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/teams/{team_slug}/external-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#list-a-connection-between-an-external-group-and-a-team openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /orgs/{org}/teams/{team_slug}/external-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#update-the-connection-between-an-external-group-and-a-team openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/teams/{team_slug}/invitations documentation_url: https://docs.github.com/rest/teams/members#list-pending-team-invitations openapi_files: @@ -2612,73 +2700,73 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/teams/{team_slug}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/teams/{team_slug}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#get-team-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /orgs/{org}/teams/{team_slug}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/teams/{team_slug}/projects documentation_url: https://docs.github.com/rest/teams/teams#list-team-projects openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/teams/{team_slug}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /orgs/{org}/teams/{team_slug}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/teams/{team_slug}/repos documentation_url: https://docs.github.com/rest/teams/teams#list-team-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#list-idp-groups-for-a-team openapi_files: @@ -2692,133 +2780,133 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /orgs/{org}/{security_product}/{enablement} documentation_url: https://docs.github.com/rest/orgs/orgs#enable-or-disable-a-security-feature-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /projects/columns/cards/{card_id} documentation_url: https://docs.github.com/rest/projects/cards#delete-a-project-card openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /projects/columns/cards/{card_id} documentation_url: https://docs.github.com/rest/projects/cards#get-a-project-card openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /projects/columns/cards/{card_id} documentation_url: https://docs.github.com/rest/projects/cards#update-an-existing-project-card openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /projects/columns/cards/{card_id}/moves documentation_url: https://docs.github.com/rest/projects/cards#move-a-project-card openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /projects/columns/{column_id} documentation_url: https://docs.github.com/rest/projects/columns#delete-a-project-column openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /projects/columns/{column_id} documentation_url: https://docs.github.com/rest/projects/columns#get-a-project-column openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /projects/columns/{column_id} documentation_url: https://docs.github.com/rest/projects/columns#update-an-existing-project-column openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /projects/columns/{column_id}/cards documentation_url: https://docs.github.com/rest/projects/cards#list-project-cards openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /projects/columns/{column_id}/cards documentation_url: https://docs.github.com/rest/projects/cards#create-a-project-card openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /projects/columns/{column_id}/moves documentation_url: https://docs.github.com/rest/projects/columns#move-a-project-column openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /projects/{project_id} documentation_url: https://docs.github.com/rest/projects/projects#delete-a-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /projects/{project_id} documentation_url: https://docs.github.com/rest/projects/projects#get-a-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /projects/{project_id} documentation_url: https://docs.github.com/rest/projects/projects#update-a-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /projects/{project_id}/collaborators documentation_url: https://docs.github.com/rest/projects/collaborators#list-project-collaborators openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /projects/{project_id}/collaborators/{username} documentation_url: https://docs.github.com/rest/projects/collaborators#remove-user-as-a-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /projects/{project_id}/collaborators/{username} documentation_url: https://docs.github.com/rest/projects/collaborators#add-project-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /projects/{project_id}/collaborators/{username}/permission documentation_url: https://docs.github.com/rest/projects/collaborators#get-project-permission-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /projects/{project_id}/columns documentation_url: https://docs.github.com/rest/projects/columns#list-project-columns openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /projects/{project_id}/columns documentation_url: https://docs.github.com/rest/projects/columns#create-a-project-column openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /rate_limit documentation_url: https://docs.github.com/rest/rate-limit/rate-limit#get-rate-limit-status-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /reactions/{reaction_id} documentation_url: https://docs.github.com/enterprise-server@3.4/rest/reference/reactions/#delete-a-reaction-legacy openapi_files: @@ -2828,261 +2916,261 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/repos/repos#get-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/repos/repos#update-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/artifacts documentation_url: https://docs.github.com/rest/actions/artifacts#list-artifacts-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id} documentation_url: https://docs.github.com/rest/actions/artifacts#delete-an-artifact openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id} documentation_url: https://docs.github.com/rest/actions/artifacts#get-an-artifact openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format} documentation_url: https://docs.github.com/rest/actions/artifacts#download-an-artifact openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/cache/usage documentation_url: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/cache/usage-policy - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/actions/cache#get-github-actions-cache-usage-policy-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/actions/cache#get-github-actions-cache-usage-policy-for-a-repository openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /repos/{owner}/{repo}/actions/cache/usage-policy - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/actions/cache#set-github-actions-cache-usage-policy-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/actions/cache#set-github-actions-cache-usage-policy-for-a-repository openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/actions/caches documentation_url: https://docs.github.com/rest/actions/cache#delete-github-actions-caches-for-a-repository-using-a-cache-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/caches documentation_url: https://docs.github.com/rest/actions/cache#list-github-actions-caches-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/actions/caches/{cache_id} documentation_url: https://docs.github.com/rest/actions/cache#delete-a-github-actions-cache-for-a-repository-using-a-cache-id openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/jobs/{job_id} documentation_url: https://docs.github.com/rest/actions/workflow-jobs#get-a-job-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs documentation_url: https://docs.github.com/rest/actions/workflow-jobs#download-job-logs-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun documentation_url: https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/oidc/customization/sub documentation_url: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /repos/{owner}/{repo}/actions/oidc/customization/sub documentation_url: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/organization-secrets documentation_url: https://docs.github.com/rest/actions/secrets#list-repository-organization-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/organization-variables documentation_url: https://docs.github.com/rest/actions/variables#list-repository-organization-variables openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/permissions documentation_url: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /repos/{owner}/{repo}/actions/permissions documentation_url: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/permissions/access documentation_url: https://docs.github.com/rest/actions/permissions#get-the-level-of-access-for-workflows-outside-of-the-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /repos/{owner}/{repo}/actions/permissions/access documentation_url: https://docs.github.com/rest/actions/permissions#set-the-level-of-access-for-workflows-outside-of-the-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/permissions/selected-actions documentation_url: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /repos/{owner}/{repo}/actions/permissions/selected-actions documentation_url: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/permissions/workflow documentation_url: https://docs.github.com/rest/actions/permissions#get-default-workflow-permissions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /repos/{owner}/{repo}/actions/permissions/workflow documentation_url: https://docs.github.com/rest/actions/permissions#set-default-workflow-permissions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/runners documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/runners/downloads documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/actions/runners/registration-token documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/actions/runners/remove-token documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/actions/runners/{runner_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/runners/{runner_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-a-custom-label-from-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/runs documentation_url: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/actions/runs/{run_id} documentation_url: https://docs.github.com/rest/actions/workflow-runs#delete-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id} documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-the-review-history-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve documentation_url: https://docs.github.com/rest/actions/workflow-runs#approve-a-workflow-run-for-a-fork-pull-request openapi_files: @@ -3093,85 +3181,85 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number} documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run-attempt openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs documentation_url: https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run-attempt openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs documentation_url: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-attempt-logs openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel documentation_url: https://docs.github.com/rest/actions/workflow-runs#cancel-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule documentation_url: https://docs.github.com/rest/actions/workflow-runs#review-custom-deployment-protection-rules-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel documentation_url: https://docs.github.com/rest/actions/workflow-runs#force-cancel-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs documentation_url: https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs documentation_url: https://docs.github.com/rest/actions/workflow-runs#delete-workflow-run-logs openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs documentation_url: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-logs openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-pending-deployments-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments documentation_url: https://docs.github.com/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun documentation_url: https://docs.github.com/rest/actions/workflow-runs#re-run-a-workflow openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs documentation_url: https://docs.github.com/rest/actions/workflow-runs#re-run-failed-jobs-from-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-workflow-run-usage openapi_files: @@ -3182,97 +3270,97 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/secrets/public-key documentation_url: https://docs.github.com/rest/actions/secrets#get-a-repository-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#delete-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#get-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /repos/{owner}/{repo}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#create-or-update-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/variables documentation_url: https://docs.github.com/rest/actions/variables#list-repository-variables openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/actions/variables documentation_url: https://docs.github.com/rest/actions/variables#create-a-repository-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#delete-a-repository-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#get-a-repository-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /repos/{owner}/{repo}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#update-a-repository-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/workflows documentation_url: https://docs.github.com/rest/actions/workflows#list-repository-workflows openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/workflows/{workflow_id} documentation_url: https://docs.github.com/rest/actions/workflows#get-a-workflow openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable documentation_url: https://docs.github.com/rest/actions/workflows#disable-a-workflow openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches documentation_url: https://docs.github.com/rest/actions/workflows#create-a-workflow-dispatch-event openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable documentation_url: https://docs.github.com/rest/actions/workflows#enable-a-workflow openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs documentation_url: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-workflow openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing documentation_url: https://docs.github.com/rest/actions/workflows#get-workflow-usage openapi_files: @@ -3283,19 +3371,19 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/assignees documentation_url: https://docs.github.com/rest/issues/assignees#list-assignees openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/assignees/{assignee} documentation_url: https://docs.github.com/rest/issues/assignees#check-if-a-user-can-be-assigned openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/attestations documentation_url: https://docs.github.com/rest/repos/repos#create-an-attestation openapi_files: @@ -3311,25 +3399,25 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/autolinks documentation_url: https://docs.github.com/rest/repos/autolinks#create-an-autolink-reference-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/autolinks/{autolink_id} documentation_url: https://docs.github.com/rest/repos/autolinks#delete-an-autolink-reference-from-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/autolinks/{autolink_id} documentation_url: https://docs.github.com/rest/repos/autolinks#get-an-autolink-reference-of-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/automated-security-fixes documentation_url: https://docs.github.com/rest/repos/repos#disable-automated-security-fixes openapi_files: @@ -3340,7 +3428,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /repos/{owner}/{repo}/automated-security-fixes documentation_url: https://docs.github.com/rest/repos/repos#enable-automated-security-fixes openapi_files: @@ -3351,324 +3439,329 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/branches/{branch} documentation_url: https://docs.github.com/rest/branches/branches#get-a-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection documentation_url: https://docs.github.com/rest/branches/branch-protection#get-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection documentation_url: https://docs.github.com/rest/branches/branch-protection#update-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-admin-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins documentation_url: https://docs.github.com/rest/branches/branch-protection#get-admin-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins documentation_url: https://docs.github.com/rest/branches/branch-protection#set-admin-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-pull-request-review-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews documentation_url: https://docs.github.com/rest/branches/branch-protection#get-pull-request-review-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews documentation_url: https://docs.github.com/rest/branches/branch-protection#update-pull-request-review-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-commit-signature-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures documentation_url: https://docs.github.com/rest/branches/branch-protection#get-commit-signature-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures documentation_url: https://docs.github.com/rest/branches/branch-protection#create-commit-signature-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-status-check-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks documentation_url: https://docs.github.com/rest/branches/branch-protection#get-status-checks-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks documentation_url: https://docs.github.com/rest/branches/branch-protection#update-status-check-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-status-check-contexts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts documentation_url: https://docs.github.com/rest/branches/branch-protection#get-all-status-check-contexts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts documentation_url: https://docs.github.com/rest/branches/branch-protection#add-status-check-contexts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts documentation_url: https://docs.github.com/rest/branches/branch-protection#set-status-check-contexts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions documentation_url: https://docs.github.com/rest/branches/branch-protection#get-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-app-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps documentation_url: https://docs.github.com/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps documentation_url: https://docs.github.com/rest/branches/branch-protection#add-app-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps documentation_url: https://docs.github.com/rest/branches/branch-protection#set-app-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-team-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams documentation_url: https://docs.github.com/rest/branches/branch-protection#get-teams-with-access-to-the-protected-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams documentation_url: https://docs.github.com/rest/branches/branch-protection#add-team-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams documentation_url: https://docs.github.com/rest/branches/branch-protection#set-team-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-user-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users documentation_url: https://docs.github.com/rest/branches/branch-protection#get-users-with-access-to-the-protected-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users documentation_url: https://docs.github.com/rest/branches/branch-protection#add-user-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users documentation_url: https://docs.github.com/rest/branches/branch-protection#set-user-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/branches/{branch}/rename documentation_url: https://docs.github.com/rest/branches/branches#rename-a-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/check-runs documentation_url: https://docs.github.com/rest/checks/runs#create-a-check-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/check-runs/{check_run_id} documentation_url: https://docs.github.com/rest/checks/runs#get-a-check-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /repos/{owner}/{repo}/check-runs/{check_run_id} documentation_url: https://docs.github.com/rest/checks/runs#update-a-check-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations documentation_url: https://docs.github.com/rest/checks/runs#list-check-run-annotations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest documentation_url: https://docs.github.com/rest/checks/runs#rerequest-a-check-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/check-suites documentation_url: https://docs.github.com/rest/checks/suites#create-a-check-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /repos/{owner}/{repo}/check-suites/preferences documentation_url: https://docs.github.com/rest/checks/suites#update-repository-preferences-for-check-suites openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/check-suites/{check_suite_id} documentation_url: https://docs.github.com/rest/checks/suites#get-a-check-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs documentation_url: https://docs.github.com/rest/checks/runs#list-check-runs-in-a-check-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest documentation_url: https://docs.github.com/rest/checks/suites#rerequest-a-check-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/code-scanning/alerts documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-instances-of-a-code-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/code-scanning/analyses documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-analyses-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#delete-a-code-scanning-analysis-from-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/code-scanning/codeql/databases documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-codeql-databases-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - name: DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language} + documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#delete-a-codeql-database + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-a-codeql-database-for-a-repository openapi_files: @@ -3694,36 +3787,37 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /repos/{owner}/{repo}/code-scanning/default-setup documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-default-setup-configuration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/code-scanning/sarifs documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#upload-an-analysis-as-sarif-data openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-information-about-a-sarif-upload openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/code-security-configuration documentation_url: https://docs.github.com/rest/code-security/configurations#get-the-code-security-configuration-associated-with-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/codeowners/errors documentation_url: https://docs.github.com/rest/repos/repos#list-codeowners-errors openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/codespaces documentation_url: https://docs.github.com/rest/codespaces/codespaces#list-codespaces-in-a-repository-for-the-authenticated-user openapi_files: @@ -3784,133 +3878,133 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/collaborators/{username} documentation_url: https://docs.github.com/rest/collaborators/collaborators#remove-a-repository-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/collaborators/{username} documentation_url: https://docs.github.com/rest/collaborators/collaborators#check-if-a-user-is-a-repository-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /repos/{owner}/{repo}/collaborators/{username} documentation_url: https://docs.github.com/rest/collaborators/collaborators#add-a-repository-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/collaborators/{username}/permission documentation_url: https://docs.github.com/rest/collaborators/collaborators#get-repository-permissions-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/comments documentation_url: https://docs.github.com/rest/commits/comments#list-commit-comments-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/comments/{comment_id} documentation_url: https://docs.github.com/rest/commits/comments#delete-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/comments/{comment_id} documentation_url: https://docs.github.com/rest/commits/comments#get-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /repos/{owner}/{repo}/comments/{comment_id} documentation_url: https://docs.github.com/rest/commits/comments#update-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-a-commit-comment-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/commits documentation_url: https://docs.github.com/rest/commits/commits#list-commits openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head documentation_url: https://docs.github.com/rest/commits/commits#list-branches-for-head-commit openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/commits/{commit_sha}/comments documentation_url: https://docs.github.com/rest/commits/comments#list-commit-comments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/commits/{commit_sha}/comments documentation_url: https://docs.github.com/rest/commits/comments#create-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls documentation_url: https://docs.github.com/rest/commits/commits#list-pull-requests-associated-with-a-commit openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/commits/{ref} documentation_url: https://docs.github.com/rest/commits/commits#get-a-commit openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/commits/{ref}/check-runs documentation_url: https://docs.github.com/rest/checks/runs#list-check-runs-for-a-git-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/commits/{ref}/check-suites documentation_url: https://docs.github.com/rest/checks/suites#list-check-suites-for-a-git-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/commits/{ref}/status documentation_url: https://docs.github.com/rest/commits/statuses#get-the-combined-status-for-a-specific-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/commits/{ref}/statuses documentation_url: https://docs.github.com/rest/commits/statuses#list-commit-statuses-for-a-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/community/profile documentation_url: https://docs.github.com/rest/metrics/community#get-community-profile-metrics openapi_files: @@ -3921,7 +4015,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#create-a-content-attachment openapi_files: @@ -3931,451 +4025,451 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/contents/{path} documentation_url: https://docs.github.com/rest/repos/contents#get-repository-content openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /repos/{owner}/{repo}/contents/{path} documentation_url: https://docs.github.com/rest/repos/contents#create-or-update-file-contents openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/contributors documentation_url: https://docs.github.com/rest/repos/repos#list-repository-contributors openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/dependabot/alerts documentation_url: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number} documentation_url: https://docs.github.com/rest/dependabot/alerts#get-a-dependabot-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number} documentation_url: https://docs.github.com/rest/dependabot/alerts#update-a-dependabot-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/dependabot/secrets documentation_url: https://docs.github.com/rest/dependabot/secrets#list-repository-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/dependabot/secrets/public-key documentation_url: https://docs.github.com/rest/dependabot/secrets#get-a-repository-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#delete-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#get-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#create-or-update-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead} documentation_url: https://docs.github.com/rest/dependency-graph/dependency-review#get-a-diff-of-the-dependencies-between-commits openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/dependency-graph/sbom documentation_url: https://docs.github.com/rest/dependency-graph/sboms#export-a-software-bill-of-materials-sbom-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/dependency-graph/snapshots documentation_url: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/deployments documentation_url: https://docs.github.com/rest/deployments/deployments#list-deployments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/deployments documentation_url: https://docs.github.com/rest/deployments/deployments#create-a-deployment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/deployments/{deployment_id} documentation_url: https://docs.github.com/rest/deployments/deployments#delete-a-deployment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/deployments/{deployment_id} documentation_url: https://docs.github.com/rest/deployments/deployments#get-a-deployment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses documentation_url: https://docs.github.com/rest/deployments/statuses#list-deployment-statuses openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses documentation_url: https://docs.github.com/rest/deployments/statuses#create-a-deployment-status openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id} documentation_url: https://docs.github.com/rest/deployments/statuses#get-a-deployment-status openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/dispatches documentation_url: https://docs.github.com/rest/repos/repos#create-a-repository-dispatch-event openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/environments documentation_url: https://docs.github.com/rest/deployments/environments#list-environments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/environments/{environment_name} documentation_url: https://docs.github.com/rest/deployments/environments#delete-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/environments/{environment_name} documentation_url: https://docs.github.com/rest/deployments/environments#get-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /repos/{owner}/{repo}/environments/{environment_name} documentation_url: https://docs.github.com/rest/deployments/environments#create-or-update-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies documentation_url: https://docs.github.com/rest/deployments/branch-policies#list-deployment-branch-policies openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies documentation_url: https://docs.github.com/rest/deployments/branch-policies#create-a-deployment-branch-policy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} documentation_url: https://docs.github.com/rest/deployments/branch-policies#delete-a-deployment-branch-policy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} documentation_url: https://docs.github.com/rest/deployments/branch-policies#get-a-deployment-branch-policy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} documentation_url: https://docs.github.com/rest/deployments/branch-policies#update-a-deployment-branch-policy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules documentation_url: https://docs.github.com/rest/deployments/protection-rules#get-all-deployment-protection-rules-for-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules documentation_url: https://docs.github.com/rest/deployments/protection-rules#create-a-custom-deployment-protection-rule-on-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps documentation_url: https://docs.github.com/rest/deployments/protection-rules#list-custom-deployment-rule-integrations-available-for-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id} documentation_url: https://docs.github.com/rest/deployments/protection-rules#disable-a-custom-protection-rule-for-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id} documentation_url: https://docs.github.com/rest/deployments/protection-rules#get-a-custom-deployment-protection-rule openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/secrets documentation_url: https://docs.github.com/rest/actions/secrets#list-environment-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key documentation_url: https://docs.github.com/rest/actions/secrets#get-an-environment-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#delete-an-environment-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#get-an-environment-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#create-or-update-an-environment-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/variables documentation_url: https://docs.github.com/rest/actions/variables#list-environment-variables openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/environments/{environment_name}/variables documentation_url: https://docs.github.com/rest/actions/variables#create-an-environment-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#delete-an-environment-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#get-an-environment-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#update-an-environment-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/events documentation_url: https://docs.github.com/rest/activity/events#list-repository-events openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/forks documentation_url: https://docs.github.com/rest/repos/forks#list-forks openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/forks documentation_url: https://docs.github.com/rest/repos/forks#create-a-fork openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/git/blobs documentation_url: https://docs.github.com/rest/git/blobs#create-a-blob openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/git/blobs/{file_sha} documentation_url: https://docs.github.com/rest/git/blobs#get-a-blob openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/git/commits documentation_url: https://docs.github.com/rest/git/commits#create-a-commit openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/git/commits/{commit_sha} documentation_url: https://docs.github.com/rest/git/commits#get-a-commit-object openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/git/matching-refs/{ref} documentation_url: https://docs.github.com/rest/git/refs#list-matching-references openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/git/ref/{ref} documentation_url: https://docs.github.com/rest/git/refs#get-a-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/git/refs documentation_url: https://docs.github.com/rest/git/refs#create-a-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/git/refs/{ref} documentation_url: https://docs.github.com/rest/git/refs#delete-a-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /repos/{owner}/{repo}/git/refs/{ref} documentation_url: https://docs.github.com/rest/git/refs#update-a-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/git/tags documentation_url: https://docs.github.com/rest/git/tags#create-a-tag-object openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/git/tags/{tag_sha} documentation_url: https://docs.github.com/rest/git/tags#get-a-tag openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/git/trees documentation_url: https://docs.github.com/rest/git/trees#create-a-tree openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/git/trees/{tree_sha} documentation_url: https://docs.github.com/rest/git/trees#get-a-tree openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/hooks documentation_url: https://docs.github.com/rest/repos/webhooks#list-repository-webhooks openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/hooks documentation_url: https://docs.github.com/rest/repos/webhooks#create-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/repos/webhooks#delete-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/repos/webhooks#get-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /repos/{owner}/{repo}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/repos/webhooks#update-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/hooks/{hook_id}/config documentation_url: https://docs.github.com/rest/repos/webhooks#get-a-webhook-configuration-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config documentation_url: https://docs.github.com/rest/repos/webhooks#update-a-webhook-configuration-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries documentation_url: https://docs.github.com/rest/repos/webhooks#list-deliveries-for-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id} documentation_url: https://docs.github.com/rest/repos/webhooks#get-a-delivery-for-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts documentation_url: https://docs.github.com/rest/repos/webhooks#redeliver-a-delivery-for-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/hooks/{hook_id}/pings documentation_url: https://docs.github.com/rest/repos/webhooks#ping-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/hooks/{hook_id}/tests documentation_url: https://docs.github.com/rest/repos/webhooks#test-the-push-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/import documentation_url: https://docs.github.com/rest/migrations/source-imports#cancel-an-import openapi_files: @@ -4421,7 +4515,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/interaction-limits documentation_url: https://docs.github.com/rest/interactions/repos#remove-interaction-restrictions-for-a-repository openapi_files: @@ -4442,383 +4536,383 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/invitations/{invitation_id} documentation_url: https://docs.github.com/rest/collaborators/invitations#delete-a-repository-invitation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /repos/{owner}/{repo}/invitations/{invitation_id} documentation_url: https://docs.github.com/rest/collaborators/invitations#update-a-repository-invitation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/issues documentation_url: https://docs.github.com/rest/issues/issues#list-repository-issues openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/issues documentation_url: https://docs.github.com/rest/issues/issues#create-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/issues/comments documentation_url: https://docs.github.com/rest/issues/comments#list-issue-comments-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/issues/comments/{comment_id} documentation_url: https://docs.github.com/rest/issues/comments#delete-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/issues/comments/{comment_id} documentation_url: https://docs.github.com/rest/issues/comments#get-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /repos/{owner}/{repo}/issues/comments/{comment_id} documentation_url: https://docs.github.com/rest/issues/comments#update-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-an-issue-comment-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/issues/events documentation_url: https://docs.github.com/rest/issues/events#list-issue-events-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/issues/events/{event_id} documentation_url: https://docs.github.com/rest/issues/events#get-an-issue-event openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/issues/{issue_number} documentation_url: https://docs.github.com/rest/issues/issues#get-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /repos/{owner}/{repo}/issues/{issue_number} documentation_url: https://docs.github.com/rest/issues/issues#update-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees documentation_url: https://docs.github.com/rest/issues/assignees#remove-assignees-from-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/issues/{issue_number}/assignees documentation_url: https://docs.github.com/rest/issues/assignees#add-assignees-to-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee} documentation_url: https://docs.github.com/rest/issues/assignees#check-if-a-user-can-be-assigned-to-a-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/comments documentation_url: https://docs.github.com/rest/issues/comments#list-issue-comments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/issues/{issue_number}/comments documentation_url: https://docs.github.com/rest/issues/comments#create-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/events documentation_url: https://docs.github.com/rest/issues/events#list-issue-events openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels documentation_url: https://docs.github.com/rest/issues/labels#remove-all-labels-from-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/labels documentation_url: https://docs.github.com/rest/issues/labels#list-labels-for-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/issues/{issue_number}/labels documentation_url: https://docs.github.com/rest/issues/labels#add-labels-to-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /repos/{owner}/{repo}/issues/{issue_number}/labels documentation_url: https://docs.github.com/rest/issues/labels#set-labels-for-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name} documentation_url: https://docs.github.com/rest/issues/labels#remove-a-label-from-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock documentation_url: https://docs.github.com/rest/issues/issues#unlock-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /repos/{owner}/{repo}/issues/{issue_number}/lock documentation_url: https://docs.github.com/rest/issues/issues#lock-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/issues/{issue_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-an-issue-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/timeline documentation_url: https://docs.github.com/rest/issues/timeline#list-timeline-events-for-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/keys documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#list-deploy-keys openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/keys documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#create-a-deploy-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/keys/{key_id} documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#delete-a-deploy-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/keys/{key_id} documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#get-a-deploy-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/labels documentation_url: https://docs.github.com/rest/issues/labels#list-labels-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/labels documentation_url: https://docs.github.com/rest/issues/labels#create-a-label openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/labels/{name} documentation_url: https://docs.github.com/rest/issues/labels#delete-a-label openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/labels/{name} documentation_url: https://docs.github.com/rest/issues/labels#get-a-label openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /repos/{owner}/{repo}/labels/{name} documentation_url: https://docs.github.com/rest/issues/labels#update-a-label openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/languages documentation_url: https://docs.github.com/rest/repos/repos#list-repository-languages openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/lfs documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/repos/lfs#disable-git-lfs-for-a-repository openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /repos/{owner}/{repo}/lfs documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/repos/lfs#enable-git-lfs-for-a-repository openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/license documentation_url: https://docs.github.com/rest/licenses/licenses#get-the-license-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/merge-upstream documentation_url: https://docs.github.com/rest/branches/branches#sync-a-fork-branch-with-the-upstream-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/merges documentation_url: https://docs.github.com/rest/branches/branches#merge-a-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/milestones documentation_url: https://docs.github.com/rest/issues/milestones#list-milestones openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/milestones documentation_url: https://docs.github.com/rest/issues/milestones#create-a-milestone openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/milestones/{milestone_number} documentation_url: https://docs.github.com/rest/issues/milestones#delete-a-milestone openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/milestones/{milestone_number} documentation_url: https://docs.github.com/rest/issues/milestones#get-a-milestone openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /repos/{owner}/{repo}/milestones/{milestone_number} documentation_url: https://docs.github.com/rest/issues/milestones#update-a-milestone openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels documentation_url: https://docs.github.com/rest/issues/labels#list-labels-for-issues-in-a-milestone openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/notifications documentation_url: https://docs.github.com/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /repos/{owner}/{repo}/notifications documentation_url: https://docs.github.com/rest/activity/notifications#mark-repository-notifications-as-read openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/pages documentation_url: https://docs.github.com/rest/pages/pages#delete-a-apiname-pages-site openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/pages documentation_url: https://docs.github.com/rest/pages/pages#get-a-apiname-pages-site openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/pages documentation_url: https://docs.github.com/rest/pages/pages#create-a-apiname-pages-site openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /repos/{owner}/{repo}/pages documentation_url: https://docs.github.com/rest/pages/pages#update-information-about-a-apiname-pages-site openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/pages/builds documentation_url: https://docs.github.com/rest/pages/pages#list-apiname-pages-builds openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/pages/builds documentation_url: https://docs.github.com/rest/pages/pages#request-a-apiname-pages-build openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/pages/builds/latest documentation_url: https://docs.github.com/rest/pages/pages#get-latest-pages-build openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/pages/builds/{build_id} documentation_url: https://docs.github.com/rest/pages/pages#get-apiname-pages-build openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/pages/deployment documentation_url: https://docs.github.com/enterprise-server@3.7/rest/pages/pages#create-a-github-pages-deployment openapi_files: @@ -4828,40 +4922,40 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id} documentation_url: https://docs.github.com/rest/pages/pages#get-the-status-of-a-github-pages-deployment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel documentation_url: https://docs.github.com/rest/pages/pages#cancel-a-github-pages-deployment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/pages/health documentation_url: https://docs.github.com/rest/pages/pages#get-a-dns-health-check-for-github-pages openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: GET /repos/{owner}/{repo}/pre-receive-hooks - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/private-vulnerability-reporting documentation_url: https://docs.github.com/rest/repos/repos#disable-private-vulnerability-reporting-for-a-repository openapi_files: @@ -4882,91 +4976,91 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/projects documentation_url: https://docs.github.com/rest/projects/projects#create-a-repository-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/properties/values documentation_url: https://docs.github.com/rest/repos/custom-properties#get-all-custom-property-values-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /repos/{owner}/{repo}/properties/values documentation_url: https://docs.github.com/rest/repos/custom-properties#create-or-update-custom-property-values-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/pulls documentation_url: https://docs.github.com/rest/pulls/pulls#list-pull-requests openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/pulls documentation_url: https://docs.github.com/rest/pulls/pulls#create-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/pulls/comments documentation_url: https://docs.github.com/rest/pulls/comments#list-review-comments-in-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id} documentation_url: https://docs.github.com/rest/pulls/comments#delete-a-review-comment-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/pulls/comments/{comment_id} documentation_url: https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id} documentation_url: https://docs.github.com/rest/pulls/comments#update-a-review-comment-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-pull-request-review-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-pull-request-review-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-a-pull-request-comment-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number} documentation_url: https://docs.github.com/rest/pulls/pulls#get-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /repos/{owner}/{repo}/pulls/{pull_number} documentation_url: https://docs.github.com/rest/pulls/pulls#update-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces documentation_url: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-from-a-pull-request openapi_files: @@ -4977,304 +5071,305 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/comments documentation_url: https://docs.github.com/rest/pulls/comments#create-a-review-comment-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies documentation_url: https://docs.github.com/rest/pulls/comments#create-a-reply-for-a-review-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/commits documentation_url: https://docs.github.com/rest/pulls/pulls#list-commits-on-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/files documentation_url: https://docs.github.com/rest/pulls/pulls#list-pull-requests-files openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/merge documentation_url: https://docs.github.com/rest/pulls/pulls#check-if-a-pull-request-has-been-merged openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge documentation_url: https://docs.github.com/rest/pulls/pulls#merge-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers documentation_url: https://docs.github.com/rest/pulls/review-requests#remove-requested-reviewers-from-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers documentation_url: https://docs.github.com/rest/pulls/review-requests#get-all-requested-reviewers-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers documentation_url: https://docs.github.com/rest/pulls/review-requests#request-reviewers-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews documentation_url: https://docs.github.com/rest/pulls/reviews#list-reviews-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews documentation_url: https://docs.github.com/rest/pulls/reviews#create-a-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} documentation_url: https://docs.github.com/rest/pulls/reviews#delete-a-pending-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} documentation_url: https://docs.github.com/rest/pulls/reviews#get-a-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} documentation_url: https://docs.github.com/rest/pulls/reviews#update-a-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments documentation_url: https://docs.github.com/rest/pulls/reviews#list-comments-for-a-pull-request-review openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals documentation_url: https://docs.github.com/rest/pulls/reviews#dismiss-a-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events documentation_url: https://docs.github.com/rest/pulls/reviews#submit-a-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch documentation_url: https://docs.github.com/rest/pulls/pulls#update-a-pull-request-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/readme documentation_url: https://docs.github.com/rest/repos/contents#get-a-repository-readme openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/readme/{dir} documentation_url: https://docs.github.com/rest/repos/contents#get-a-repository-readme-for-a-directory openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/releases documentation_url: https://docs.github.com/rest/releases/releases#list-releases openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/releases documentation_url: https://docs.github.com/rest/releases/releases#create-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/releases/assets/{asset_id} documentation_url: https://docs.github.com/rest/releases/assets#delete-a-release-asset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/releases/assets/{asset_id} documentation_url: https://docs.github.com/rest/releases/assets#get-a-release-asset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /repos/{owner}/{repo}/releases/assets/{asset_id} documentation_url: https://docs.github.com/rest/releases/assets#update-a-release-asset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/releases/generate-notes documentation_url: https://docs.github.com/rest/releases/releases#generate-release-notes-content-for-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/releases/latest documentation_url: https://docs.github.com/rest/releases/releases#get-the-latest-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/releases/tags/{tag} documentation_url: https://docs.github.com/rest/releases/releases#get-a-release-by-tag-name openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/releases/{release_id} documentation_url: https://docs.github.com/rest/releases/releases#delete-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/releases/{release_id} documentation_url: https://docs.github.com/rest/releases/releases#get-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /repos/{owner}/{repo}/releases/{release_id} documentation_url: https://docs.github.com/rest/releases/releases#update-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/releases/{release_id}/assets documentation_url: https://docs.github.com/rest/releases/assets#list-release-assets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/releases/{release_id}/assets documentation_url: https://docs.github.com/rest/releases/assets#upload-a-release-asset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/releases/{release_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/releases/{release_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-a-release-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/replicas/caches - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/repos/repos#list-repository-cache-replication-status + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/repos/repos#list-repository-cache-replication-status openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/rules/branches/{branch} documentation_url: https://docs.github.com/rest/repos/rules#get-rules-for-a-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/rulesets documentation_url: https://docs.github.com/rest/repos/rules#get-all-repository-rulesets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/rulesets documentation_url: https://docs.github.com/rest/repos/rules#create-a-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/rulesets/rule-suites documentation_url: https://docs.github.com/rest/repos/rule-suites#list-repository-rule-suites openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id} documentation_url: https://docs.github.com/rest/repos/rule-suites#get-a-repository-rule-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/repos/rules#get-a-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /repos/{owner}/{repo}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/repos/rules#update-a-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/secret-scanning/alerts documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#get-a-secret-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#update-a-secret-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-locations-for-a-secret-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#create-a-push-protection-bypass openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/security-advisories documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories openapi_files: @@ -5315,115 +5410,115 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/stats/code_frequency documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-activity openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/stats/commit_activity documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-last-year-of-commit-activity openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/stats/contributors documentation_url: https://docs.github.com/rest/metrics/statistics#get-all-contributor-commit-activity openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/stats/participation documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-count openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/stats/punch_card documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-hourly-commit-count-for-each-day openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/statuses/{sha} documentation_url: https://docs.github.com/rest/commits/statuses#create-a-commit-status openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/subscribers documentation_url: https://docs.github.com/rest/activity/watching#list-watchers openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/subscription documentation_url: https://docs.github.com/rest/activity/watching#delete-a-repository-subscription openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/subscription documentation_url: https://docs.github.com/rest/activity/watching#get-a-repository-subscription openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /repos/{owner}/{repo}/subscription documentation_url: https://docs.github.com/rest/activity/watching#set-a-repository-subscription openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/tags documentation_url: https://docs.github.com/rest/repos/repos#list-repository-tags openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/tags/protection - documentation_url: https://docs.github.com/rest/repos/tags#deprecated---list-tag-protection-states-for-a-repository + documentation_url: https://docs.github.com/rest/repos/tags#closing-down---list-tag-protection-states-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{owner}/{repo}/tags/protection - documentation_url: https://docs.github.com/rest/repos/tags#deprecated---create-a-tag-protection-state-for-a-repository + documentation_url: https://docs.github.com/rest/repos/tags#closing-down---create-a-tag-protection-state-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id} - documentation_url: https://docs.github.com/rest/repos/tags#deprecated---delete-a-tag-protection-state-for-a-repository + documentation_url: https://docs.github.com/rest/repos/tags#closing-down---delete-a-tag-protection-state-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/tarball/{ref} documentation_url: https://docs.github.com/rest/repos/contents#download-a-repository-archive-tar openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/teams documentation_url: https://docs.github.com/rest/repos/repos#list-repository-teams openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/topics documentation_url: https://docs.github.com/rest/repos/repos#get-all-repository-topics openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /repos/{owner}/{repo}/topics documentation_url: https://docs.github.com/rest/repos/repos#replace-all-repository-topics openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/traffic/clones documentation_url: https://docs.github.com/rest/metrics/traffic#get-repository-clones openapi_files: @@ -5449,43 +5544,43 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/vulnerability-alerts documentation_url: https://docs.github.com/rest/repos/repos#disable-vulnerability-alerts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/vulnerability-alerts documentation_url: https://docs.github.com/rest/repos/repos#check-if-vulnerability-alerts-are-enabled-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /repos/{owner}/{repo}/vulnerability-alerts documentation_url: https://docs.github.com/rest/repos/repos#enable-vulnerability-alerts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repos/{owner}/{repo}/zipball/{ref} documentation_url: https://docs.github.com/rest/repos/contents#download-a-repository-archive-zip openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /repos/{template_owner}/{template_repo}/generate documentation_url: https://docs.github.com/rest/repos/repos#create-a-repository-using-a-template openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repositories documentation_url: https://docs.github.com/rest/repos/repos#list-public-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /repositories/{repository_id}/environments/{environment_name}/secrets documentation_url: https://docs.github.com/enterprise-server@3.7/rest/actions/secrets#list-environment-secrets openapi_files: @@ -5558,62 +5653,62 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#list-provisioned-scim-groups-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /scim/v2/enterprises/{enterprise}/Groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#provision-a-scim-enterprise-group openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#delete-a-scim-group-from-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-group openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#update-an-attribute-for-a-scim-enterprise-group openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#set-scim-information-for-a-provisioned-enterprise-group openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /scim/v2/enterprises/{enterprise}/Users documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#list-scim-provisioned-identities-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /scim/v2/enterprises/{enterprise}/Users documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#provision-a-scim-enterprise-user openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /scim/v2/enterprises/{enterprise}/Users/{scim_user_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#delete-a-scim-user-from-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /scim/v2/enterprises/{enterprise}/Users/{scim_user_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-user openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /scim/v2/enterprises/{enterprise}/Users/{scim_user_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#update-an-attribute-for-a-scim-enterprise-user openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /scim/v2/enterprises/{enterprise}/Users/{scim_user_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#set-scim-information-for-a-provisioned-enterprise-user openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /scim/v2/organizations/{org}/Users documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#list-scim-provisioned-identities openapi_files: @@ -5643,189 +5738,189 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /search/commits documentation_url: https://docs.github.com/rest/search/search#search-commits openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /search/issues documentation_url: https://docs.github.com/rest/search/search#search-issues-and-pull-requests openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /search/labels documentation_url: https://docs.github.com/rest/search/search#search-labels openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /search/repositories documentation_url: https://docs.github.com/rest/search/search#search-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /search/topics documentation_url: https://docs.github.com/rest/search/search#search-topics openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /search/users documentation_url: https://docs.github.com/rest/search/search#search-users openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /setup/api/configcheck - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#get-the-configuration-status + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/management-console#get-the-configuration-status openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /setup/api/configure - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#start-a-configuration-process + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/management-console#start-a-configuration-process openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /setup/api/maintenance - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#get-the-maintenance-status + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/management-console#get-the-maintenance-status openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /setup/api/maintenance - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#enable-or-disable-maintenance-mode + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/management-console#enable-or-disable-maintenance-mode openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /setup/api/settings - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#get-settings + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/management-console#get-settings openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /setup/api/settings - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#set-settings + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/management-console#set-settings openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /setup/api/settings/authorized-keys - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#remove-an-authorized-ssh-key + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/management-console#remove-an-authorized-ssh-key openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /setup/api/settings/authorized-keys - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#get-all-authorized-ssh-keys + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/management-console#get-all-authorized-ssh-keys openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /setup/api/settings/authorized-keys - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#add-an-authorized-ssh-key + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/management-console#add-an-authorized-ssh-key openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /setup/api/start - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#create-a-github-license + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/management-console#create-a-github-license openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /setup/api/upgrade - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#upgrade-a-license + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/management-console#upgrade-a-license openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /teams/{team_id} documentation_url: https://docs.github.com/rest/teams/teams#delete-a-team-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /teams/{team_id} documentation_url: https://docs.github.com/rest/teams/teams#get-a-team-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /teams/{team_id} documentation_url: https://docs.github.com/rest/teams/teams#update-a-team-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /teams/{team_id}/discussions documentation_url: https://docs.github.com/rest/teams/discussions#list-discussions-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /teams/{team_id}/discussions documentation_url: https://docs.github.com/rest/teams/discussions#create-a-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /teams/{team_id}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#delete-a-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /teams/{team_id}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#get-a-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /teams/{team_id}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#update-a-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /teams/{team_id}/discussions/{discussion_number}/comments documentation_url: https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /teams/{team_id}/discussions/{discussion_number}/comments documentation_url: https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /teams/{team_id}/discussions/{discussion_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /teams/{team_id}/discussions/{discussion_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /teams/{team_id}/invitations documentation_url: https://docs.github.com/rest/teams/members#list-pending-team-invitations-legacy openapi_files: @@ -5836,91 +5931,91 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /teams/{team_id}/members/{username} documentation_url: https://docs.github.com/rest/teams/members#remove-team-member-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /teams/{team_id}/members/{username} documentation_url: https://docs.github.com/rest/teams/members#get-team-member-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /teams/{team_id}/members/{username} documentation_url: https://docs.github.com/rest/teams/members#add-team-member-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /teams/{team_id}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /teams/{team_id}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#get-team-membership-for-a-user-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /teams/{team_id}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /teams/{team_id}/projects documentation_url: https://docs.github.com/rest/teams/teams#list-team-projects-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /teams/{team_id}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /teams/{team_id}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /teams/{team_id}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /teams/{team_id}/repos documentation_url: https://docs.github.com/rest/teams/teams#list-team-repositories-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /teams/{team_id}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /teams/{team_id}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /teams/{team_id}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /teams/{team_id}/team-sync/group-mappings documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#list-idp-groups-for-a-team-legacy openapi_files: @@ -5934,19 +6029,19 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /user documentation_url: https://docs.github.com/rest/users/users#get-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /user documentation_url: https://docs.github.com/rest/users/users#update-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /user/blocks documentation_url: https://docs.github.com/rest/users/blocking#list-users-blocked-by-the-authenticated-user openapi_files: @@ -6072,7 +6167,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /user/email/visibility documentation_url: https://docs.github.com/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user openapi_files: @@ -6083,97 +6178,97 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /user/emails documentation_url: https://docs.github.com/rest/users/emails#list-email-addresses-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /user/emails documentation_url: https://docs.github.com/rest/users/emails#add-an-email-address-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /user/followers documentation_url: https://docs.github.com/rest/users/followers#list-followers-of-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /user/following documentation_url: https://docs.github.com/rest/users/followers#list-the-people-the-authenticated-user-follows openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /user/following/{username} documentation_url: https://docs.github.com/rest/users/followers#unfollow-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /user/following/{username} documentation_url: https://docs.github.com/rest/users/followers#check-if-a-person-is-followed-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /user/following/{username} documentation_url: https://docs.github.com/rest/users/followers#follow-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /user/gpg_keys documentation_url: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /user/gpg_keys documentation_url: https://docs.github.com/rest/users/gpg-keys#create-a-gpg-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /user/gpg_keys/{gpg_key_id} documentation_url: https://docs.github.com/rest/users/gpg-keys#delete-a-gpg-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /user/gpg_keys/{gpg_key_id} documentation_url: https://docs.github.com/rest/users/gpg-keys#get-a-gpg-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /user/installations documentation_url: https://docs.github.com/rest/apps/installations#list-app-installations-accessible-to-the-user-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /user/installations/{installation_id}/repositories documentation_url: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-user-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /user/installations/{installation_id}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/apps/installations#remove-a-repository-from-an-app-installation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /user/installations/{installation_id}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/apps/installations#add-a-repository-to-an-app-installation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /user/interaction-limits documentation_url: https://docs.github.com/rest/interactions/user#remove-interaction-restrictions-from-your-public-repositories openapi_files: @@ -6194,31 +6289,31 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /user/keys documentation_url: https://docs.github.com/rest/users/keys#list-public-ssh-keys-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /user/keys documentation_url: https://docs.github.com/rest/users/keys#create-a-public-ssh-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /user/keys/{key_id} documentation_url: https://docs.github.com/rest/users/keys#delete-a-public-ssh-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /user/keys/{key_id} documentation_url: https://docs.github.com/rest/users/keys#get-a-public-ssh-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /user/marketplace_purchases documentation_url: https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user openapi_files: @@ -6234,31 +6329,31 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /user/memberships/orgs/{org} documentation_url: https://docs.github.com/rest/orgs/members#get-an-organization-membership-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /user/memberships/orgs/{org} documentation_url: https://docs.github.com/rest/orgs/members#update-an-organization-membership-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /user/migrations documentation_url: https://docs.github.com/rest/migrations/users#list-user-migrations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /user/migrations documentation_url: https://docs.github.com/rest/migrations/users#start-a-user-migration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /user/migrations/{migration_id} documentation_url: https://docs.github.com/rest/migrations/users#get-a-user-migration-status openapi_files: @@ -6274,7 +6369,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock documentation_url: https://docs.github.com/rest/migrations/users#unlock-a-user-repository openapi_files: @@ -6285,199 +6380,199 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /user/orgs documentation_url: https://docs.github.com/rest/orgs/orgs#list-organizations-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /user/packages documentation_url: https://docs.github.com/rest/packages/packages#list-packages-for-the-authenticated-users-namespace openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /user/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /user/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /user/packages/{package_type}/{package_name}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /user/packages/{package_type}/{package_name}/versions documentation_url: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-version-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /user/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-version-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-version-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /user/projects documentation_url: https://docs.github.com/rest/projects/projects#create-a-user-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /user/public_emails documentation_url: https://docs.github.com/rest/users/emails#list-public-email-addresses-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /user/repos documentation_url: https://docs.github.com/rest/repos/repos#list-repositories-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /user/repos documentation_url: https://docs.github.com/rest/repos/repos#create-a-repository-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /user/repository_invitations documentation_url: https://docs.github.com/rest/collaborators/invitations#list-repository-invitations-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /user/repository_invitations/{invitation_id} documentation_url: https://docs.github.com/rest/collaborators/invitations#decline-a-repository-invitation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PATCH /user/repository_invitations/{invitation_id} documentation_url: https://docs.github.com/rest/collaborators/invitations#accept-a-repository-invitation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /user/social_accounts documentation_url: https://docs.github.com/rest/users/social-accounts#delete-social-accounts-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /user/social_accounts documentation_url: https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /user/social_accounts documentation_url: https://docs.github.com/rest/users/social-accounts#add-social-accounts-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /user/ssh_signing_keys documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /user/ssh_signing_keys documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#create-a-ssh-signing-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /user/ssh_signing_keys/{ssh_signing_key_id} documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#delete-an-ssh-signing-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /user/ssh_signing_keys/{ssh_signing_key_id} documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#get-an-ssh-signing-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /user/starred documentation_url: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /user/starred/{owner}/{repo} documentation_url: https://docs.github.com/rest/activity/starring#unstar-a-repository-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /user/starred/{owner}/{repo} documentation_url: https://docs.github.com/rest/activity/starring#check-if-a-repository-is-starred-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /user/starred/{owner}/{repo} documentation_url: https://docs.github.com/rest/activity/starring#star-a-repository-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /user/subscriptions documentation_url: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /user/teams documentation_url: https://docs.github.com/rest/teams/teams#list-teams-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /user/{account_id} documentation_url: https://docs.github.com/rest/users/users#get-a-user-using-their-id openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /users documentation_url: https://docs.github.com/rest/users/users#list-users openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /users/{username} documentation_url: https://docs.github.com/rest/users/users#get-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /users/{username}/attestations/{subject_digest} documentation_url: https://docs.github.com/rest/users/attestations#list-attestations openapi_files: @@ -6488,151 +6583,151 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /users/{username}/events documentation_url: https://docs.github.com/rest/activity/events#list-events-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /users/{username}/events/orgs/{org} documentation_url: https://docs.github.com/rest/activity/events#list-organization-events-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /users/{username}/events/public documentation_url: https://docs.github.com/rest/activity/events#list-public-events-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /users/{username}/followers documentation_url: https://docs.github.com/rest/users/followers#list-followers-of-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /users/{username}/following documentation_url: https://docs.github.com/rest/users/followers#list-the-people-a-user-follows openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /users/{username}/following/{target_user} documentation_url: https://docs.github.com/rest/users/followers#check-if-a-user-follows-another-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /users/{username}/gists documentation_url: https://docs.github.com/rest/gists/gists#list-gists-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /users/{username}/gpg_keys documentation_url: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /users/{username}/hovercard documentation_url: https://docs.github.com/rest/users/users#get-contextual-information-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /users/{username}/installation documentation_url: https://docs.github.com/rest/apps/apps#get-a-user-installation-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /users/{username}/keys documentation_url: https://docs.github.com/rest/users/keys#list-public-keys-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /users/{username}/orgs documentation_url: https://docs.github.com/rest/orgs/orgs#list-organizations-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /users/{username}/packages documentation_url: https://docs.github.com/rest/packages/packages#list-packages-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /users/{username}/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /users/{username}/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /users/{username}/packages/{package_type}/{package_name}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /users/{username}/packages/{package_type}/{package_name}/versions documentation_url: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#delete-package-version-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-version-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-package-version-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /users/{username}/projects documentation_url: https://docs.github.com/rest/projects/projects#list-user-projects openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /users/{username}/received_events documentation_url: https://docs.github.com/rest/activity/events#list-events-received-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /users/{username}/received_events/public documentation_url: https://docs.github.com/rest/activity/events#list-public-events-received-by-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /users/{username}/repos documentation_url: https://docs.github.com/rest/repos/repos#list-repositories-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /users/{username}/settings/billing/actions documentation_url: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-a-user openapi_files: @@ -6649,45 +6744,45 @@ openapi_operations: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: DELETE /users/{username}/site_admin - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#demote-a-site-administrator + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#demote-a-site-administrator openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /users/{username}/site_admin - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /users/{username}/social_accounts documentation_url: https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /users/{username}/ssh_signing_keys documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /users/{username}/starred documentation_url: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /users/{username}/subscriptions documentation_url: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /users/{username}/suspended - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#unsuspend-a-user + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#unsuspend-a-user openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /users/{username}/suspended - documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#suspend-a-user + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#suspend-a-user openapi_files: - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json - name: GET /versions documentation_url: https://docs.github.com/rest/meta/meta#get-all-api-versions openapi_files: @@ -6698,4 +6793,4 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.14/ghes-3.14.json + - descriptions/ghes-3.15/ghes-3.15.json From 6d30edd4f2cce5a9d8df252d6afbf1e486cc7991 Mon Sep 17 00:00:00 2001 From: Erwan Finot Date: Wed, 20 Nov 2024 04:23:52 +0100 Subject: [PATCH 568/751] Add missing Deployment field to workflow_job event type (#3353) --- github/event_types.go | 1 + github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 8 ++++++++ 3 files changed, 17 insertions(+) diff --git a/github/event_types.go b/github/event_types.go index 40ad919be5e..373d59bad2c 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -1787,6 +1787,7 @@ type WorkflowJobEvent struct { Repo *Repository `json:"repository,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + Deployment *Deployment `json:"deployment,omitempty"` } // WorkflowRunEvent is triggered when a GitHub Actions workflow run is requested or completed. diff --git a/github/github-accessors.go b/github/github-accessors.go index 7d8292a9652..ed9353d1b91 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -26574,6 +26574,14 @@ func (w *WorkflowJobEvent) GetAction() string { return *w.Action } +// GetDeployment returns the Deployment field. +func (w *WorkflowJobEvent) GetDeployment() *Deployment { + if w == nil { + return nil + } + return w.Deployment +} + // GetInstallation returns the Installation field. func (w *WorkflowJobEvent) GetInstallation() *Installation { if w == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 4d7b022e12c..4269618a2c2 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -34093,6 +34093,14 @@ func TestWorkflowJobEvent_GetAction(tt *testing.T) { w.GetAction() } +func TestWorkflowJobEvent_GetDeployment(tt *testing.T) { + tt.Parallel() + w := &WorkflowJobEvent{} + w.GetDeployment() + w = nil + w.GetDeployment() +} + func TestWorkflowJobEvent_GetInstallation(tt *testing.T) { tt.Parallel() w := &WorkflowJobEvent{} From 717e93fa2808da46013f98feb95275e3f6bedf2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Lundstr=C3=B6m?= Date: Wed, 20 Nov 2024 13:36:33 +0100 Subject: [PATCH 569/751] feat: Support Copilot metrics endpoints (#3350) --- github/copilot.go | 223 +++++ github/copilot_test.go | 1372 +++++++++++++++++++++++++++++++ github/github-accessors.go | 96 +++ github/github-accessors_test.go | 120 +++ 4 files changed, 1811 insertions(+) diff --git a/github/copilot.go b/github/copilot.go index 7ea13bd7c85..19cfd977ceb 100644 --- a/github/copilot.go +++ b/github/copilot.go @@ -99,6 +99,125 @@ type CopilotUsageSummary struct { Breakdown []*CopilotUsageBreakdown `json:"breakdown"` } +// CopilotMetricsListOptions represents the optional parameters to the CopilotService get metrics methods. +type CopilotMetricsListOptions struct { + Since *time.Time `url:"since,omitempty"` + Until *time.Time `url:"until,omitempty"` + + ListOptions +} + +// CopilotIDECodeCompletionsLanguage represents Copilot usage metrics for completions in the IDE for a language. +type CopilotIDECodeCompletionsLanguage struct { + Name string `json:"name"` + TotalEngagedUsers int `json:"total_engaged_users"` +} + +// CopilotIDECodeCompletionsModelLanguage represents Copilot usage metrics for completions in the IDE for a model and language. +type CopilotIDECodeCompletionsModelLanguage struct { + Name string `json:"name"` + TotalEngagedUsers int `json:"total_engaged_users"` + TotalCodeSuggestions int `json:"total_code_suggestions"` + TotalCodeAcceptances int `json:"total_code_acceptances"` + TotalCodeLinesSuggested int `json:"total_code_lines_suggested"` + TotalCodeLinesAccepted int `json:"total_code_lines_accepted"` +} + +// CopilotIDECodeCompletionsModel represents Copilot usage metrics for completions in the IDE for a model. +type CopilotIDECodeCompletionsModel struct { + Name string `json:"name"` + IsCustomModel bool `json:"is_custom_model"` + CustomModelTrainingDate *string `json:"custom_model_training_date,omitempty"` + TotalEngagedUsers int `json:"total_engaged_users"` + Languages []*CopilotIDECodeCompletionsModelLanguage `json:"languages"` +} + +// CopilotIDECodeCompletionsEditor represents Copilot usage metrics for completions in the IDE for an editor. +type CopilotIDECodeCompletionsEditor struct { + Name string `json:"name"` + TotalEngagedUsers int `json:"total_engaged_users"` + Models []*CopilotIDECodeCompletionsModel `json:"models"` +} + +// CopilotIDECodeCompletions represents Copilot usage metrics for Copilot code completions in the IDE, categorized by editor, model and language. +type CopilotIDECodeCompletions struct { + TotalEngagedUsers int `json:"total_engaged_users"` + Languages []*CopilotIDECodeCompletionsLanguage `json:"languages"` + Editors []*CopilotIDECodeCompletionsEditor `json:"editors"` +} + +// CopilotIDEChatModel represents Copilot usage metrics for chatting with a model in the IDE. +type CopilotIDEChatModel struct { + Name string `json:"name"` + IsCustomModel bool `json:"is_custom_model"` + CustomModelTrainingDate *string `json:"custom_model_training_date,omitempty"` + TotalEngagedUsers int `json:"total_engaged_users"` + TotalChats int `json:"total_chats"` + TotalChatInsertionEvents int `json:"total_chat_insertion_events"` + TotalChatCopyEvents int `json:"total_chat_copy_events"` +} + +// CopilotIDEChatEditor represents Copilot usage metrics for chatting with a model in the IDE, categorized by editor and model. +type CopilotIDEChatEditor struct { + Name string `json:"name"` + TotalEngagedUsers int `json:"total_engaged_users"` + Models []*CopilotIDEChatModel `json:"models"` +} + +// CopilotIDEChat represents Copilot usage metrics for Copilot Chat in the IDE, categorized by editor and model. +type CopilotIDEChat struct { + TotalEngagedUsers int `json:"total_engaged_users"` + Editors []*CopilotIDEChatEditor `json:"editors"` +} + +// CopilotDotcomChatModel represents Copilot usage metrics for chatting with a model in the webbrowser. +type CopilotDotcomChatModel struct { + Name string `json:"name"` + IsCustomModel bool `json:"is_custom_model"` + CustomModelTrainingDate *string `json:"custom_model_training_date,omitempty"` + TotalEngagedUsers int `json:"total_engaged_users"` + TotalChats int `json:"total_chats"` +} + +// CopilotDotcomChat represents Copilot usage metrics for Copilot Chat in the webbrowser, categorized by model. +type CopilotDotcomChat struct { + TotalEngagedUsers int `json:"total_engaged_users"` + Models []*CopilotDotcomChatModel `json:"models"` +} + +// CopilotDotcomPullRequestsModel represents Copilot usage metrics for pull requests in the webbrowser, categorized by model. +type CopilotDotcomPullRequestsModel struct { + Name string `json:"name"` + IsCustomModel bool `json:"is_custom_model"` + CustomModelTrainingDate *string `json:"custom_model_training_date,omitempty"` + TotalPRSummariesCreated int `json:"total_pr_summaries_created"` + TotalEngagedUsers int `json:"total_engaged_users"` +} + +// CopilotDotcomPullRequestsRepository represents Copilot usage metrics for pull requests in the webbrowser, categorized by repository. +type CopilotDotcomPullRequestsRepository struct { + Name string `json:"name"` + TotalEngagedUsers int `json:"total_engaged_users"` + Models []*CopilotDotcomPullRequestsModel `json:"models"` +} + +// CopilotDotcomPullRequests represents Copilot usage metrics for pull requests in the webbrowser, categorized by repository and model. +type CopilotDotcomPullRequests struct { + TotalEngagedUsers int `json:"total_engaged_users"` + Repositories []*CopilotDotcomPullRequestsRepository `json:"repositories"` +} + +// CopilotMetrics represents Copilot usage metrics for a given day. +type CopilotMetrics struct { + Date string `json:"date"` + TotalActiveUsers *int `json:"total_active_users,omitempty"` + TotalEngagedUsers *int `json:"total_engaged_users,omitempty"` + CopilotIDECodeCompletions *CopilotIDECodeCompletions `json:"copilot_ide_code_completions,omitempty"` + CopilotIDEChat *CopilotIDEChat `json:"copilot_ide_chat,omitempty"` + CopilotDotcomChat *CopilotDotcomChat `json:"copilot_dotcom_chat,omitempty"` + CopilotDotcomPullRequests *CopilotDotcomPullRequests `json:"copilot_dotcom_pull_requests,omitempty"` +} + func (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error { // Using an alias to avoid infinite recursion when calling json.Unmarshal type alias CopilotSeatDetails @@ -482,3 +601,107 @@ func (s *CopilotService) GetOrganizationTeamUsage(ctx context.Context, org, team return usage, resp, nil } + +// GetEnterpriseMetrics gets Copilot usage metrics for an enterprise. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/copilot/metrics +func (s *CopilotService) GetEnterpriseMetrics(ctx context.Context, enterprise string, opts *CopilotMetricsListOptions) ([]*CopilotMetrics, *Response, error) { + u := fmt.Sprintf("enterprises/%v/copilot/metrics", enterprise) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var metrics []*CopilotMetrics + resp, err := s.client.Do(ctx, req, &metrics) + if err != nil { + return nil, resp, err + } + + return metrics, resp, nil +} + +// GetEnterpriseTeamMetrics gets Copilot usage metrics for an enterprise team. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise-team +// +//meta:operation GET /enterprises/{enterprise}/team/{team_slug}/copilot/metrics +func (s *CopilotService) GetEnterpriseTeamMetrics(ctx context.Context, enterprise, team string, opts *CopilotMetricsListOptions) ([]*CopilotMetrics, *Response, error) { + u := fmt.Sprintf("enterprises/%v/team/%v/copilot/metrics", enterprise, team) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var metrics []*CopilotMetrics + resp, err := s.client.Do(ctx, req, &metrics) + if err != nil { + return nil, resp, err + } + + return metrics, resp, nil +} + +// GetOrganizationMetrics gets Copilot usage metrics for an organization. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-organization +// +//meta:operation GET /orgs/{org}/copilot/metrics +func (s *CopilotService) GetOrganizationMetrics(ctx context.Context, org string, opts *CopilotMetricsListOptions) ([]*CopilotMetrics, *Response, error) { + u := fmt.Sprintf("orgs/%v/copilot/metrics", org) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var metrics []*CopilotMetrics + resp, err := s.client.Do(ctx, req, &metrics) + if err != nil { + return nil, resp, err + } + + return metrics, resp, nil +} + +// GetOrganizationTeamMetrics gets Copilot usage metrics for an organization team. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-a-team +// +//meta:operation GET /orgs/{org}/team/{team_slug}/copilot/metrics +func (s *CopilotService) GetOrganizationTeamMetrics(ctx context.Context, org, team string, opts *CopilotMetricsListOptions) ([]*CopilotMetrics, *Response, error) { + u := fmt.Sprintf("orgs/%v/team/%v/copilot/metrics", org, team) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var metrics []*CopilotMetrics + resp, err := s.client.Do(ctx, req, &metrics) + if err != nil { + return nil, resp, err + } + + return metrics, resp, nil +} diff --git a/github/copilot_test.go b/github/copilot_test.go index 6ac689a9efe..a299bf0735a 100644 --- a/github/copilot_test.go +++ b/github/copilot_test.go @@ -1930,3 +1930,1375 @@ func TestCopilotService_GetOrganizationTeamUsage(t *testing.T) { return resp, err }) } + +func TestCopilotService_GetEnterpriseMetrics(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/enterprises/e/copilot/metrics", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `[ + { + "date": "2024-06-24", + "total_active_users": 24, + "total_engaged_users": 20, + "copilot_ide_code_completions": { + "total_engaged_users": 20, + "languages": [ + { + "name": "python", + "total_engaged_users": 10 + }, + { + "name": "ruby", + "total_engaged_users": 10 + } + ], + "editors": [ + { + "name": "vscode", + "total_engaged_users": 13, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 13, + "languages": [ + { + "name": "python", + "total_engaged_users": 6, + "total_code_suggestions": 249, + "total_code_acceptances": 123, + "total_code_lines_suggested": 225, + "total_code_lines_accepted": 135 + }, + { + "name": "ruby", + "total_engaged_users": 7, + "total_code_suggestions": 496, + "total_code_acceptances": 253, + "total_code_lines_suggested": 520, + "total_code_lines_accepted": 270 + } + ] + } + ] + }, + { + "name": "neovim", + "total_engaged_users": 7, + "models": [ + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "languages": [ + { + "name": "typescript", + "total_engaged_users": 3, + "total_code_suggestions": 112, + "total_code_acceptances": 56, + "total_code_lines_suggested": 143, + "total_code_lines_accepted": 61 + }, + { + "name": "go", + "total_engaged_users": 4, + "total_code_suggestions": 132, + "total_code_acceptances": 67, + "total_code_lines_suggested": 154, + "total_code_lines_accepted": 72 + } + ] + } + ] + } + ] + }, + "copilot_ide_chat": { + "total_engaged_users": 13, + "editors": [ + { + "name": "vscode", + "total_engaged_users": 13, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 12, + "total_chats": 45, + "total_chat_insertion_events": 12, + "total_chat_copy_events": 16 + }, + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "total_engaged_users": 1, + "total_chats": 10, + "total_chat_insertion_events": 11, + "total_chat_copy_events": 3 + } + ] + } + ] + }, + "copilot_dotcom_chat": { + "total_engaged_users": 14, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 14, + "total_chats": 38 + } + ] + }, + "copilot_dotcom_pull_requests": { + "total_engaged_users": 12, + "repositories": [ + { + "name": "demo/repo1", + "total_engaged_users": 8, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_pr_summaries_created": 6, + "total_engaged_users": 8 + } + ] + }, + { + "name": "demo/repo2", + "total_engaged_users": 4, + "models": [ + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "total_pr_summaries_created": 10, + "total_engaged_users": 4 + } + ] + } + ] + } + } + ]`) + }) + + ctx := context.Background() + got, _, err := client.Copilot.GetEnterpriseMetrics(ctx, "e", &CopilotMetricsListOptions{}) + if err != nil { + t.Errorf("Copilot.GetEnterpriseMetrics returned error: %v", err) + } + + totalActiveUsers := 24 + totalEngagedUsers := 20 + want := []*CopilotMetrics{ + { + Date: "2024-06-24", + TotalActiveUsers: &totalActiveUsers, + TotalEngagedUsers: &totalEngagedUsers, + CopilotIDECodeCompletions: &CopilotIDECodeCompletions{ + TotalEngagedUsers: 20, + Languages: []*CopilotIDECodeCompletionsLanguage{ + { + Name: "python", + TotalEngagedUsers: 10, + }, + { + Name: "ruby", + TotalEngagedUsers: 10, + }, + }, + Editors: []*CopilotIDECodeCompletionsEditor{ + { + Name: "vscode", + TotalEngagedUsers: 13, + Models: []*CopilotIDECodeCompletionsModel{ + { + Name: "default", + IsCustomModel: false, + CustomModelTrainingDate: nil, + TotalEngagedUsers: 13, + Languages: []*CopilotIDECodeCompletionsModelLanguage{ + { + Name: "python", + TotalEngagedUsers: 6, + TotalCodeSuggestions: 249, + TotalCodeAcceptances: 123, + TotalCodeLinesSuggested: 225, + TotalCodeLinesAccepted: 135, + }, + { + Name: "ruby", + TotalEngagedUsers: 7, + TotalCodeSuggestions: 496, + TotalCodeAcceptances: 253, + TotalCodeLinesSuggested: 520, + TotalCodeLinesAccepted: 270, + }, + }, + }, + }, + }, + { + Name: "neovim", + TotalEngagedUsers: 7, + Models: []*CopilotIDECodeCompletionsModel{ + { + Name: "a-custom-model", + IsCustomModel: true, + CustomModelTrainingDate: String("2024-02-01"), + Languages: []*CopilotIDECodeCompletionsModelLanguage{ + { + Name: "typescript", + TotalEngagedUsers: 3, + TotalCodeSuggestions: 112, + TotalCodeAcceptances: 56, + TotalCodeLinesSuggested: 143, + TotalCodeLinesAccepted: 61, + }, + { + Name: "go", + TotalEngagedUsers: 4, + TotalCodeSuggestions: 132, + TotalCodeAcceptances: 67, + TotalCodeLinesSuggested: 154, + TotalCodeLinesAccepted: 72, + }, + }, + }, + }, + }, + }, + }, + CopilotIDEChat: &CopilotIDEChat{ + TotalEngagedUsers: 13, + Editors: []*CopilotIDEChatEditor{ + { + Name: "vscode", + TotalEngagedUsers: 13, + Models: []*CopilotIDEChatModel{ + { + Name: "default", + IsCustomModel: false, + CustomModelTrainingDate: nil, + TotalEngagedUsers: 12, + TotalChats: 45, + TotalChatInsertionEvents: 12, + TotalChatCopyEvents: 16, + }, + { + Name: "a-custom-model", + IsCustomModel: true, + CustomModelTrainingDate: String("2024-02-01"), + TotalEngagedUsers: 1, + TotalChats: 10, + TotalChatInsertionEvents: 11, + TotalChatCopyEvents: 3, + }, + }, + }, + }, + }, + CopilotDotcomChat: &CopilotDotcomChat{ + TotalEngagedUsers: 14, + Models: []*CopilotDotcomChatModel{ + { + Name: "default", + IsCustomModel: false, + CustomModelTrainingDate: nil, + TotalEngagedUsers: 14, + TotalChats: 38, + }, + }, + }, + CopilotDotcomPullRequests: &CopilotDotcomPullRequests{ + TotalEngagedUsers: 12, + Repositories: []*CopilotDotcomPullRequestsRepository{ + { + Name: "demo/repo1", + TotalEngagedUsers: 8, + Models: []*CopilotDotcomPullRequestsModel{ + { + Name: "default", + IsCustomModel: false, + CustomModelTrainingDate: nil, + TotalPRSummariesCreated: 6, + TotalEngagedUsers: 8, + }, + }, + }, + { + Name: "demo/repo2", + TotalEngagedUsers: 4, + Models: []*CopilotDotcomPullRequestsModel{ + { + Name: "a-custom-model", + IsCustomModel: true, + CustomModelTrainingDate: String("2024-02-01"), + TotalPRSummariesCreated: 10, + TotalEngagedUsers: 4, + }, + }, + }, + }, + }, + }, + } + + if !cmp.Equal(got, want) { + t.Errorf("Copilot.GetEnterpriseMetrics returned %+v, want %+v", got, want) + } + + const methodName = "GetEnterpriseMetrics" + + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Copilot.GetEnterpriseMetrics(ctx, "\n", &CopilotMetricsListOptions{}) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Copilot.GetEnterpriseMetrics(ctx, "e", &CopilotMetricsListOptions{}) + if got != nil { + t.Errorf("Copilot.GetEnterpriseMetrics returned %+v, want nil", got) + } + return resp, err + }) +} + +func TestCopilotService_GetEnterpriseTeamMetrics(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/enterprises/e/team/t/copilot/metrics", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `[ + { + "date": "2024-06-24", + "total_active_users": 24, + "total_engaged_users": 20, + "copilot_ide_code_completions": { + "total_engaged_users": 20, + "languages": [ + { + "name": "python", + "total_engaged_users": 10 + }, + { + "name": "ruby", + "total_engaged_users": 10 + } + ], + "editors": [ + { + "name": "vscode", + "total_engaged_users": 13, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 13, + "languages": [ + { + "name": "python", + "total_engaged_users": 6, + "total_code_suggestions": 249, + "total_code_acceptances": 123, + "total_code_lines_suggested": 225, + "total_code_lines_accepted": 135 + }, + { + "name": "ruby", + "total_engaged_users": 7, + "total_code_suggestions": 496, + "total_code_acceptances": 253, + "total_code_lines_suggested": 520, + "total_code_lines_accepted": 270 + } + ] + } + ] + }, + { + "name": "neovim", + "total_engaged_users": 7, + "models": [ + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "languages": [ + { + "name": "typescript", + "total_engaged_users": 3, + "total_code_suggestions": 112, + "total_code_acceptances": 56, + "total_code_lines_suggested": 143, + "total_code_lines_accepted": 61 + }, + { + "name": "go", + "total_engaged_users": 4, + "total_code_suggestions": 132, + "total_code_acceptances": 67, + "total_code_lines_suggested": 154, + "total_code_lines_accepted": 72 + } + ] + } + ] + } + ] + }, + "copilot_ide_chat": { + "total_engaged_users": 13, + "editors": [ + { + "name": "vscode", + "total_engaged_users": 13, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 12, + "total_chats": 45, + "total_chat_insertion_events": 12, + "total_chat_copy_events": 16 + }, + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "total_engaged_users": 1, + "total_chats": 10, + "total_chat_insertion_events": 11, + "total_chat_copy_events": 3 + } + ] + } + ] + }, + "copilot_dotcom_chat": { + "total_engaged_users": 14, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 14, + "total_chats": 38 + } + ] + }, + "copilot_dotcom_pull_requests": { + "total_engaged_users": 12, + "repositories": [ + { + "name": "demo/repo1", + "total_engaged_users": 8, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_pr_summaries_created": 6, + "total_engaged_users": 8 + } + ] + }, + { + "name": "demo/repo2", + "total_engaged_users": 4, + "models": [ + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "total_pr_summaries_created": 10, + "total_engaged_users": 4 + } + ] + } + ] + } + } + ]`) + }) + + ctx := context.Background() + got, _, err := client.Copilot.GetEnterpriseTeamMetrics(ctx, "e", "t", &CopilotMetricsListOptions{}) + if err != nil { + t.Errorf("Copilot.GetEnterpriseTeamMetrics returned error: %v", err) + } + + totalActiveUsers := 24 + totalEngagedUsers := 20 + want := []*CopilotMetrics{ + { + Date: "2024-06-24", + TotalActiveUsers: &totalActiveUsers, + TotalEngagedUsers: &totalEngagedUsers, + CopilotIDECodeCompletions: &CopilotIDECodeCompletions{ + TotalEngagedUsers: 20, + Languages: []*CopilotIDECodeCompletionsLanguage{ + { + Name: "python", + TotalEngagedUsers: 10, + }, + { + Name: "ruby", + TotalEngagedUsers: 10, + }, + }, + Editors: []*CopilotIDECodeCompletionsEditor{ + { + Name: "vscode", + TotalEngagedUsers: 13, + Models: []*CopilotIDECodeCompletionsModel{ + { + Name: "default", + IsCustomModel: false, + CustomModelTrainingDate: nil, + TotalEngagedUsers: 13, + Languages: []*CopilotIDECodeCompletionsModelLanguage{ + { + Name: "python", + TotalEngagedUsers: 6, + TotalCodeSuggestions: 249, + TotalCodeAcceptances: 123, + TotalCodeLinesSuggested: 225, + TotalCodeLinesAccepted: 135, + }, + { + Name: "ruby", + TotalEngagedUsers: 7, + TotalCodeSuggestions: 496, + TotalCodeAcceptances: 253, + TotalCodeLinesSuggested: 520, + TotalCodeLinesAccepted: 270, + }, + }, + }, + }, + }, + { + Name: "neovim", + TotalEngagedUsers: 7, + Models: []*CopilotIDECodeCompletionsModel{ + { + Name: "a-custom-model", + IsCustomModel: true, + CustomModelTrainingDate: String("2024-02-01"), + Languages: []*CopilotIDECodeCompletionsModelLanguage{ + { + Name: "typescript", + TotalEngagedUsers: 3, + TotalCodeSuggestions: 112, + TotalCodeAcceptances: 56, + TotalCodeLinesSuggested: 143, + TotalCodeLinesAccepted: 61, + }, + { + Name: "go", + TotalEngagedUsers: 4, + TotalCodeSuggestions: 132, + TotalCodeAcceptances: 67, + TotalCodeLinesSuggested: 154, + TotalCodeLinesAccepted: 72, + }, + }, + }, + }, + }, + }, + }, + CopilotIDEChat: &CopilotIDEChat{ + TotalEngagedUsers: 13, + Editors: []*CopilotIDEChatEditor{ + { + Name: "vscode", + TotalEngagedUsers: 13, + Models: []*CopilotIDEChatModel{ + { + Name: "default", + IsCustomModel: false, + CustomModelTrainingDate: nil, + TotalEngagedUsers: 12, + TotalChats: 45, + TotalChatInsertionEvents: 12, + TotalChatCopyEvents: 16, + }, + { + Name: "a-custom-model", + IsCustomModel: true, + CustomModelTrainingDate: String("2024-02-01"), + TotalEngagedUsers: 1, + TotalChats: 10, + TotalChatInsertionEvents: 11, + TotalChatCopyEvents: 3, + }, + }, + }, + }, + }, + CopilotDotcomChat: &CopilotDotcomChat{ + TotalEngagedUsers: 14, + Models: []*CopilotDotcomChatModel{ + { + Name: "default", + IsCustomModel: false, + CustomModelTrainingDate: nil, + TotalEngagedUsers: 14, + TotalChats: 38, + }, + }, + }, + CopilotDotcomPullRequests: &CopilotDotcomPullRequests{ + TotalEngagedUsers: 12, + Repositories: []*CopilotDotcomPullRequestsRepository{ + { + Name: "demo/repo1", + TotalEngagedUsers: 8, + Models: []*CopilotDotcomPullRequestsModel{ + { + Name: "default", + IsCustomModel: false, + CustomModelTrainingDate: nil, + TotalPRSummariesCreated: 6, + TotalEngagedUsers: 8, + }, + }, + }, + { + Name: "demo/repo2", + TotalEngagedUsers: 4, + Models: []*CopilotDotcomPullRequestsModel{ + { + Name: "a-custom-model", + IsCustomModel: true, + CustomModelTrainingDate: String("2024-02-01"), + TotalPRSummariesCreated: 10, + TotalEngagedUsers: 4, + }, + }, + }, + }, + }, + }, + } + + if !cmp.Equal(got, want) { + t.Errorf("Copilot.GetEnterpriseTeamMetrics returned %+v, want %+v", got, want) + } + + const methodName = "GetEnterpriseTeamMetrics" + + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Copilot.GetEnterpriseTeamMetrics(ctx, "\n", "t", &CopilotMetricsListOptions{}) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Copilot.GetEnterpriseTeamMetrics(ctx, "e", "t", &CopilotMetricsListOptions{}) + if got != nil { + t.Errorf("Copilot.GetEnterpriseTeamMetrics returned %+v, want nil", got) + } + return resp, err + }) +} + +func TestCopilotService_GetOrganizationMetrics(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/orgs/o/copilot/metrics", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `[ + { + "date": "2024-06-24", + "total_active_users": 24, + "total_engaged_users": 20, + "copilot_ide_code_completions": { + "total_engaged_users": 20, + "languages": [ + { + "name": "python", + "total_engaged_users": 10 + }, + { + "name": "ruby", + "total_engaged_users": 10 + } + ], + "editors": [ + { + "name": "vscode", + "total_engaged_users": 13, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 13, + "languages": [ + { + "name": "python", + "total_engaged_users": 6, + "total_code_suggestions": 249, + "total_code_acceptances": 123, + "total_code_lines_suggested": 225, + "total_code_lines_accepted": 135 + }, + { + "name": "ruby", + "total_engaged_users": 7, + "total_code_suggestions": 496, + "total_code_acceptances": 253, + "total_code_lines_suggested": 520, + "total_code_lines_accepted": 270 + } + ] + } + ] + }, + { + "name": "neovim", + "total_engaged_users": 7, + "models": [ + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "languages": [ + { + "name": "typescript", + "total_engaged_users": 3, + "total_code_suggestions": 112, + "total_code_acceptances": 56, + "total_code_lines_suggested": 143, + "total_code_lines_accepted": 61 + }, + { + "name": "go", + "total_engaged_users": 4, + "total_code_suggestions": 132, + "total_code_acceptances": 67, + "total_code_lines_suggested": 154, + "total_code_lines_accepted": 72 + } + ] + } + ] + } + ] + }, + "copilot_ide_chat": { + "total_engaged_users": 13, + "editors": [ + { + "name": "vscode", + "total_engaged_users": 13, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 12, + "total_chats": 45, + "total_chat_insertion_events": 12, + "total_chat_copy_events": 16 + }, + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "total_engaged_users": 1, + "total_chats": 10, + "total_chat_insertion_events": 11, + "total_chat_copy_events": 3 + } + ] + } + ] + }, + "copilot_dotcom_chat": { + "total_engaged_users": 14, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 14, + "total_chats": 38 + } + ] + }, + "copilot_dotcom_pull_requests": { + "total_engaged_users": 12, + "repositories": [ + { + "name": "demo/repo1", + "total_engaged_users": 8, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_pr_summaries_created": 6, + "total_engaged_users": 8 + } + ] + }, + { + "name": "demo/repo2", + "total_engaged_users": 4, + "models": [ + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "total_pr_summaries_created": 10, + "total_engaged_users": 4 + } + ] + } + ] + } + } + ]`) + }) + + ctx := context.Background() + got, _, err := client.Copilot.GetOrganizationMetrics(ctx, "o", &CopilotMetricsListOptions{}) + if err != nil { + t.Errorf("Copilot.GetOrganizationMetrics returned error: %v", err) + } + + totalActiveUsers := 24 + totalEngagedUsers := 20 + want := []*CopilotMetrics{ + { + Date: "2024-06-24", + TotalActiveUsers: &totalActiveUsers, + TotalEngagedUsers: &totalEngagedUsers, + CopilotIDECodeCompletions: &CopilotIDECodeCompletions{ + TotalEngagedUsers: 20, + Languages: []*CopilotIDECodeCompletionsLanguage{ + { + Name: "python", + TotalEngagedUsers: 10, + }, + { + Name: "ruby", + TotalEngagedUsers: 10, + }, + }, + Editors: []*CopilotIDECodeCompletionsEditor{ + { + Name: "vscode", + TotalEngagedUsers: 13, + Models: []*CopilotIDECodeCompletionsModel{ + { + Name: "default", + IsCustomModel: false, + CustomModelTrainingDate: nil, + TotalEngagedUsers: 13, + Languages: []*CopilotIDECodeCompletionsModelLanguage{ + { + Name: "python", + TotalEngagedUsers: 6, + TotalCodeSuggestions: 249, + TotalCodeAcceptances: 123, + TotalCodeLinesSuggested: 225, + TotalCodeLinesAccepted: 135, + }, + { + Name: "ruby", + TotalEngagedUsers: 7, + TotalCodeSuggestions: 496, + TotalCodeAcceptances: 253, + TotalCodeLinesSuggested: 520, + TotalCodeLinesAccepted: 270, + }, + }, + }, + }, + }, + { + Name: "neovim", + TotalEngagedUsers: 7, + Models: []*CopilotIDECodeCompletionsModel{ + { + Name: "a-custom-model", + IsCustomModel: true, + CustomModelTrainingDate: String("2024-02-01"), + Languages: []*CopilotIDECodeCompletionsModelLanguage{ + { + Name: "typescript", + TotalEngagedUsers: 3, + TotalCodeSuggestions: 112, + TotalCodeAcceptances: 56, + TotalCodeLinesSuggested: 143, + TotalCodeLinesAccepted: 61, + }, + { + Name: "go", + TotalEngagedUsers: 4, + TotalCodeSuggestions: 132, + TotalCodeAcceptances: 67, + TotalCodeLinesSuggested: 154, + TotalCodeLinesAccepted: 72, + }, + }, + }, + }, + }, + }, + }, + CopilotIDEChat: &CopilotIDEChat{ + TotalEngagedUsers: 13, + Editors: []*CopilotIDEChatEditor{ + { + Name: "vscode", + TotalEngagedUsers: 13, + Models: []*CopilotIDEChatModel{ + { + Name: "default", + IsCustomModel: false, + CustomModelTrainingDate: nil, + TotalEngagedUsers: 12, + TotalChats: 45, + TotalChatInsertionEvents: 12, + TotalChatCopyEvents: 16, + }, + { + Name: "a-custom-model", + IsCustomModel: true, + CustomModelTrainingDate: String("2024-02-01"), + TotalEngagedUsers: 1, + TotalChats: 10, + TotalChatInsertionEvents: 11, + TotalChatCopyEvents: 3, + }, + }, + }, + }, + }, + CopilotDotcomChat: &CopilotDotcomChat{ + TotalEngagedUsers: 14, + Models: []*CopilotDotcomChatModel{ + { + Name: "default", + IsCustomModel: false, + CustomModelTrainingDate: nil, + TotalEngagedUsers: 14, + TotalChats: 38, + }, + }, + }, + CopilotDotcomPullRequests: &CopilotDotcomPullRequests{ + TotalEngagedUsers: 12, + Repositories: []*CopilotDotcomPullRequestsRepository{ + { + Name: "demo/repo1", + TotalEngagedUsers: 8, + Models: []*CopilotDotcomPullRequestsModel{ + { + Name: "default", + IsCustomModel: false, + CustomModelTrainingDate: nil, + TotalPRSummariesCreated: 6, + TotalEngagedUsers: 8, + }, + }, + }, + { + Name: "demo/repo2", + TotalEngagedUsers: 4, + Models: []*CopilotDotcomPullRequestsModel{ + { + Name: "a-custom-model", + IsCustomModel: true, + CustomModelTrainingDate: String("2024-02-01"), + TotalPRSummariesCreated: 10, + TotalEngagedUsers: 4, + }, + }, + }, + }, + }, + }, + } + + if !cmp.Equal(got, want) { + t.Errorf("Copilot.GetOrganizationMetrics returned %+v, want %+v", got, want) + } + + const methodName = "GetOrganizationMetrics" + + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Copilot.GetOrganizationMetrics(ctx, "\n", &CopilotMetricsListOptions{}) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Copilot.GetOrganizationMetrics(ctx, "o", &CopilotMetricsListOptions{}) + if got != nil { + t.Errorf("Copilot.GetOrganizationMetrics returned %+v, want nil", got) + } + return resp, err + }) +} + +func TestCopilotService_GetOrganizationTeamMetrics(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/orgs/o/team/t/copilot/metrics", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `[ + { + "date": "2024-06-24", + "total_active_users": 24, + "total_engaged_users": 20, + "copilot_ide_code_completions": { + "total_engaged_users": 20, + "languages": [ + { + "name": "python", + "total_engaged_users": 10 + }, + { + "name": "ruby", + "total_engaged_users": 10 + } + ], + "editors": [ + { + "name": "vscode", + "total_engaged_users": 13, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 13, + "languages": [ + { + "name": "python", + "total_engaged_users": 6, + "total_code_suggestions": 249, + "total_code_acceptances": 123, + "total_code_lines_suggested": 225, + "total_code_lines_accepted": 135 + }, + { + "name": "ruby", + "total_engaged_users": 7, + "total_code_suggestions": 496, + "total_code_acceptances": 253, + "total_code_lines_suggested": 520, + "total_code_lines_accepted": 270 + } + ] + } + ] + }, + { + "name": "neovim", + "total_engaged_users": 7, + "models": [ + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "languages": [ + { + "name": "typescript", + "total_engaged_users": 3, + "total_code_suggestions": 112, + "total_code_acceptances": 56, + "total_code_lines_suggested": 143, + "total_code_lines_accepted": 61 + }, + { + "name": "go", + "total_engaged_users": 4, + "total_code_suggestions": 132, + "total_code_acceptances": 67, + "total_code_lines_suggested": 154, + "total_code_lines_accepted": 72 + } + ] + } + ] + } + ] + }, + "copilot_ide_chat": { + "total_engaged_users": 13, + "editors": [ + { + "name": "vscode", + "total_engaged_users": 13, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 12, + "total_chats": 45, + "total_chat_insertion_events": 12, + "total_chat_copy_events": 16 + }, + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "total_engaged_users": 1, + "total_chats": 10, + "total_chat_insertion_events": 11, + "total_chat_copy_events": 3 + } + ] + } + ] + }, + "copilot_dotcom_chat": { + "total_engaged_users": 14, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 14, + "total_chats": 38 + } + ] + }, + "copilot_dotcom_pull_requests": { + "total_engaged_users": 12, + "repositories": [ + { + "name": "demo/repo1", + "total_engaged_users": 8, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_pr_summaries_created": 6, + "total_engaged_users": 8 + } + ] + }, + { + "name": "demo/repo2", + "total_engaged_users": 4, + "models": [ + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "total_pr_summaries_created": 10, + "total_engaged_users": 4 + } + ] + } + ] + } + } + ]`) + }) + + ctx := context.Background() + got, _, err := client.Copilot.GetOrganizationTeamMetrics(ctx, "o", "t", &CopilotMetricsListOptions{}) + if err != nil { + t.Errorf("Copilot.GetOrganizationTeamMetrics returned error: %v", err) + } + + totalActiveUsers := 24 + totalEngagedUsers := 20 + want := []*CopilotMetrics{ + { + Date: "2024-06-24", + TotalActiveUsers: &totalActiveUsers, + TotalEngagedUsers: &totalEngagedUsers, + CopilotIDECodeCompletions: &CopilotIDECodeCompletions{ + TotalEngagedUsers: 20, + Languages: []*CopilotIDECodeCompletionsLanguage{ + { + Name: "python", + TotalEngagedUsers: 10, + }, + { + Name: "ruby", + TotalEngagedUsers: 10, + }, + }, + Editors: []*CopilotIDECodeCompletionsEditor{ + { + Name: "vscode", + TotalEngagedUsers: 13, + Models: []*CopilotIDECodeCompletionsModel{ + { + Name: "default", + IsCustomModel: false, + CustomModelTrainingDate: nil, + TotalEngagedUsers: 13, + Languages: []*CopilotIDECodeCompletionsModelLanguage{ + { + Name: "python", + TotalEngagedUsers: 6, + TotalCodeSuggestions: 249, + TotalCodeAcceptances: 123, + TotalCodeLinesSuggested: 225, + TotalCodeLinesAccepted: 135, + }, + { + Name: "ruby", + TotalEngagedUsers: 7, + TotalCodeSuggestions: 496, + TotalCodeAcceptances: 253, + TotalCodeLinesSuggested: 520, + TotalCodeLinesAccepted: 270, + }, + }, + }, + }, + }, + { + Name: "neovim", + TotalEngagedUsers: 7, + Models: []*CopilotIDECodeCompletionsModel{ + { + Name: "a-custom-model", + IsCustomModel: true, + CustomModelTrainingDate: String("2024-02-01"), + Languages: []*CopilotIDECodeCompletionsModelLanguage{ + { + Name: "typescript", + TotalEngagedUsers: 3, + TotalCodeSuggestions: 112, + TotalCodeAcceptances: 56, + TotalCodeLinesSuggested: 143, + TotalCodeLinesAccepted: 61, + }, + { + Name: "go", + TotalEngagedUsers: 4, + TotalCodeSuggestions: 132, + TotalCodeAcceptances: 67, + TotalCodeLinesSuggested: 154, + TotalCodeLinesAccepted: 72, + }, + }, + }, + }, + }, + }, + }, + CopilotIDEChat: &CopilotIDEChat{ + TotalEngagedUsers: 13, + Editors: []*CopilotIDEChatEditor{ + { + Name: "vscode", + TotalEngagedUsers: 13, + Models: []*CopilotIDEChatModel{ + { + Name: "default", + IsCustomModel: false, + CustomModelTrainingDate: nil, + TotalEngagedUsers: 12, + TotalChats: 45, + TotalChatInsertionEvents: 12, + TotalChatCopyEvents: 16, + }, + { + Name: "a-custom-model", + IsCustomModel: true, + CustomModelTrainingDate: String("2024-02-01"), + TotalEngagedUsers: 1, + TotalChats: 10, + TotalChatInsertionEvents: 11, + TotalChatCopyEvents: 3, + }, + }, + }, + }, + }, + CopilotDotcomChat: &CopilotDotcomChat{ + TotalEngagedUsers: 14, + Models: []*CopilotDotcomChatModel{ + { + Name: "default", + IsCustomModel: false, + CustomModelTrainingDate: nil, + TotalEngagedUsers: 14, + TotalChats: 38, + }, + }, + }, + CopilotDotcomPullRequests: &CopilotDotcomPullRequests{ + TotalEngagedUsers: 12, + Repositories: []*CopilotDotcomPullRequestsRepository{ + { + Name: "demo/repo1", + TotalEngagedUsers: 8, + Models: []*CopilotDotcomPullRequestsModel{ + { + Name: "default", + IsCustomModel: false, + CustomModelTrainingDate: nil, + TotalPRSummariesCreated: 6, + TotalEngagedUsers: 8, + }, + }, + }, + { + Name: "demo/repo2", + TotalEngagedUsers: 4, + Models: []*CopilotDotcomPullRequestsModel{ + { + Name: "a-custom-model", + IsCustomModel: true, + CustomModelTrainingDate: String("2024-02-01"), + TotalPRSummariesCreated: 10, + TotalEngagedUsers: 4, + }, + }, + }, + }, + }, + }, + } + + if !cmp.Equal(got, want) { + t.Errorf("Copilot.GetOrganizationTeamMetrics returned %+v, want %+v", got, want) + } + + const methodName = "GetOrganizationTeamMetrics" + + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Copilot.GetOrganizationTeamMetrics(ctx, "\n", "\n", &CopilotMetricsListOptions{}) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Copilot.GetOrganizationTeamMetrics(ctx, "o", "t", &CopilotMetricsListOptions{}) + if got != nil { + t.Errorf("Copilot.GetOrganizationTeamMetrics returned %+v, want nil", got) + } + return resp, err + }) +} diff --git a/github/github-accessors.go b/github/github-accessors.go index ed9353d1b91..0c7f150ed7e 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -4294,6 +4294,102 @@ func (c *ContributorStats) GetTotal() int { return *c.Total } +// GetCustomModelTrainingDate returns the CustomModelTrainingDate field if it's non-nil, zero value otherwise. +func (c *CopilotDotcomChatModel) GetCustomModelTrainingDate() string { + if c == nil || c.CustomModelTrainingDate == nil { + return "" + } + return *c.CustomModelTrainingDate +} + +// GetCustomModelTrainingDate returns the CustomModelTrainingDate field if it's non-nil, zero value otherwise. +func (c *CopilotDotcomPullRequestsModel) GetCustomModelTrainingDate() string { + if c == nil || c.CustomModelTrainingDate == nil { + return "" + } + return *c.CustomModelTrainingDate +} + +// GetCustomModelTrainingDate returns the CustomModelTrainingDate field if it's non-nil, zero value otherwise. +func (c *CopilotIDEChatModel) GetCustomModelTrainingDate() string { + if c == nil || c.CustomModelTrainingDate == nil { + return "" + } + return *c.CustomModelTrainingDate +} + +// GetCustomModelTrainingDate returns the CustomModelTrainingDate field if it's non-nil, zero value otherwise. +func (c *CopilotIDECodeCompletionsModel) GetCustomModelTrainingDate() string { + if c == nil || c.CustomModelTrainingDate == nil { + return "" + } + return *c.CustomModelTrainingDate +} + +// GetCopilotDotcomChat returns the CopilotDotcomChat field. +func (c *CopilotMetrics) GetCopilotDotcomChat() *CopilotDotcomChat { + if c == nil { + return nil + } + return c.CopilotDotcomChat +} + +// GetCopilotDotcomPullRequests returns the CopilotDotcomPullRequests field. +func (c *CopilotMetrics) GetCopilotDotcomPullRequests() *CopilotDotcomPullRequests { + if c == nil { + return nil + } + return c.CopilotDotcomPullRequests +} + +// GetCopilotIDEChat returns the CopilotIDEChat field. +func (c *CopilotMetrics) GetCopilotIDEChat() *CopilotIDEChat { + if c == nil { + return nil + } + return c.CopilotIDEChat +} + +// GetCopilotIDECodeCompletions returns the CopilotIDECodeCompletions field. +func (c *CopilotMetrics) GetCopilotIDECodeCompletions() *CopilotIDECodeCompletions { + if c == nil { + return nil + } + return c.CopilotIDECodeCompletions +} + +// GetTotalActiveUsers returns the TotalActiveUsers field if it's non-nil, zero value otherwise. +func (c *CopilotMetrics) GetTotalActiveUsers() int { + if c == nil || c.TotalActiveUsers == nil { + return 0 + } + return *c.TotalActiveUsers +} + +// GetTotalEngagedUsers returns the TotalEngagedUsers field if it's non-nil, zero value otherwise. +func (c *CopilotMetrics) GetTotalEngagedUsers() int { + if c == nil || c.TotalEngagedUsers == nil { + return 0 + } + return *c.TotalEngagedUsers +} + +// GetSince returns the Since field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsListOptions) GetSince() time.Time { + if c == nil || c.Since == nil { + return time.Time{} + } + return *c.Since +} + +// GetUntil returns the Until field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsListOptions) GetUntil() time.Time { + if c == nil || c.Until == nil { + return time.Time{} + } + return *c.Until +} + // GetSeatBreakdown returns the SeatBreakdown field. func (c *CopilotOrganizationDetails) GetSeatBreakdown() *CopilotSeatBreakdown { if c == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 4269618a2c2..28d75f3e3f3 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -5564,6 +5564,126 @@ func TestContributorStats_GetTotal(tt *testing.T) { c.GetTotal() } +func TestCopilotDotcomChatModel_GetCustomModelTrainingDate(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CopilotDotcomChatModel{CustomModelTrainingDate: &zeroValue} + c.GetCustomModelTrainingDate() + c = &CopilotDotcomChatModel{} + c.GetCustomModelTrainingDate() + c = nil + c.GetCustomModelTrainingDate() +} + +func TestCopilotDotcomPullRequestsModel_GetCustomModelTrainingDate(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CopilotDotcomPullRequestsModel{CustomModelTrainingDate: &zeroValue} + c.GetCustomModelTrainingDate() + c = &CopilotDotcomPullRequestsModel{} + c.GetCustomModelTrainingDate() + c = nil + c.GetCustomModelTrainingDate() +} + +func TestCopilotIDEChatModel_GetCustomModelTrainingDate(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CopilotIDEChatModel{CustomModelTrainingDate: &zeroValue} + c.GetCustomModelTrainingDate() + c = &CopilotIDEChatModel{} + c.GetCustomModelTrainingDate() + c = nil + c.GetCustomModelTrainingDate() +} + +func TestCopilotIDECodeCompletionsModel_GetCustomModelTrainingDate(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CopilotIDECodeCompletionsModel{CustomModelTrainingDate: &zeroValue} + c.GetCustomModelTrainingDate() + c = &CopilotIDECodeCompletionsModel{} + c.GetCustomModelTrainingDate() + c = nil + c.GetCustomModelTrainingDate() +} + +func TestCopilotMetrics_GetCopilotDotcomChat(tt *testing.T) { + tt.Parallel() + c := &CopilotMetrics{} + c.GetCopilotDotcomChat() + c = nil + c.GetCopilotDotcomChat() +} + +func TestCopilotMetrics_GetCopilotDotcomPullRequests(tt *testing.T) { + tt.Parallel() + c := &CopilotMetrics{} + c.GetCopilotDotcomPullRequests() + c = nil + c.GetCopilotDotcomPullRequests() +} + +func TestCopilotMetrics_GetCopilotIDEChat(tt *testing.T) { + tt.Parallel() + c := &CopilotMetrics{} + c.GetCopilotIDEChat() + c = nil + c.GetCopilotIDEChat() +} + +func TestCopilotMetrics_GetCopilotIDECodeCompletions(tt *testing.T) { + tt.Parallel() + c := &CopilotMetrics{} + c.GetCopilotIDECodeCompletions() + c = nil + c.GetCopilotIDECodeCompletions() +} + +func TestCopilotMetrics_GetTotalActiveUsers(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotMetrics{TotalActiveUsers: &zeroValue} + c.GetTotalActiveUsers() + c = &CopilotMetrics{} + c.GetTotalActiveUsers() + c = nil + c.GetTotalActiveUsers() +} + +func TestCopilotMetrics_GetTotalEngagedUsers(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotMetrics{TotalEngagedUsers: &zeroValue} + c.GetTotalEngagedUsers() + c = &CopilotMetrics{} + c.GetTotalEngagedUsers() + c = nil + c.GetTotalEngagedUsers() +} + +func TestCopilotMetricsListOptions_GetSince(tt *testing.T) { + tt.Parallel() + var zeroValue time.Time + c := &CopilotMetricsListOptions{Since: &zeroValue} + c.GetSince() + c = &CopilotMetricsListOptions{} + c.GetSince() + c = nil + c.GetSince() +} + +func TestCopilotMetricsListOptions_GetUntil(tt *testing.T) { + tt.Parallel() + var zeroValue time.Time + c := &CopilotMetricsListOptions{Until: &zeroValue} + c.GetUntil() + c = &CopilotMetricsListOptions{} + c.GetUntil() + c = nil + c.GetUntil() +} + func TestCopilotOrganizationDetails_GetSeatBreakdown(tt *testing.T) { tt.Parallel() c := &CopilotOrganizationDetails{} From 45574f42f3e2e68886cc8e7df8accf3e21200529 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Lundstr=C3=B6m?= Date: Fri, 22 Nov 2024 16:34:11 +0100 Subject: [PATCH 570/751] feat: Remove the beta endpoint for Copilot usage (#3354) --- github/copilot.go | 137 ------ github/copilot_test.go | 804 -------------------------------- github/github-accessors.go | 16 - github/github-accessors_test.go | 22 - 4 files changed, 979 deletions(-) diff --git a/github/copilot.go b/github/copilot.go index 19cfd977ceb..a2b2aa09953 100644 --- a/github/copilot.go +++ b/github/copilot.go @@ -66,39 +66,6 @@ type SeatCancellations struct { SeatsCancelled int `json:"seats_cancelled"` } -// CopilotUsageSummaryListOptions represents the optional parameters to the CopilotService.GetOrganizationUsage method. -type CopilotUsageSummaryListOptions struct { - Since *time.Time `url:"since,omitempty"` - Until *time.Time `url:"until,omitempty"` - - ListOptions -} - -// CopilotUsageBreakdown represents the breakdown of Copilot usage for a specific language and editor. -type CopilotUsageBreakdown struct { - Language string `json:"language"` - Editor string `json:"editor"` - SuggestionsCount int64 `json:"suggestions_count"` - AcceptancesCount int64 `json:"acceptances_count"` - LinesSuggested int64 `json:"lines_suggested"` - LinesAccepted int64 `json:"lines_accepted"` - ActiveUsers int `json:"active_users"` -} - -// CopilotUsageSummary represents the daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE across an organization. -type CopilotUsageSummary struct { - Day string `json:"day"` - TotalSuggestionsCount int64 `json:"total_suggestions_count"` - TotalAcceptancesCount int64 `json:"total_acceptances_count"` - TotalLinesSuggested int64 `json:"total_lines_suggested"` - TotalLinesAccepted int64 `json:"total_lines_accepted"` - TotalActiveUsers int64 `json:"total_active_users"` - TotalChatAcceptances int64 `json:"total_chat_acceptances"` - TotalChatTurns int64 `json:"total_chat_turns"` - TotalActiveChatUsers int `json:"total_active_chat_users"` - Breakdown []*CopilotUsageBreakdown `json:"breakdown"` -} - // CopilotMetricsListOptions represents the optional parameters to the CopilotService get metrics methods. type CopilotMetricsListOptions struct { Since *time.Time `url:"since,omitempty"` @@ -498,110 +465,6 @@ func (s *CopilotService) GetSeatDetails(ctx context.Context, org, user string) ( return seatDetails, resp, nil } -// GetOrganizationUsage gets daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE across an organization. -// -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-organization-members -// -//meta:operation GET /orgs/{org}/copilot/usage -func (s *CopilotService) GetOrganizationUsage(ctx context.Context, org string, opts *CopilotUsageSummaryListOptions) ([]*CopilotUsageSummary, *Response, error) { - u := fmt.Sprintf("orgs/%v/copilot/usage", org) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var usage []*CopilotUsageSummary - resp, err := s.client.Do(ctx, req, &usage) - if err != nil { - return nil, resp, err - } - - return usage, resp, nil -} - -// GetEnterpriseUsage gets daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE across an enterprise. -// -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-enterprise-members -// -//meta:operation GET /enterprises/{enterprise}/copilot/usage -func (s *CopilotService) GetEnterpriseUsage(ctx context.Context, enterprise string, opts *CopilotUsageSummaryListOptions) ([]*CopilotUsageSummary, *Response, error) { - u := fmt.Sprintf("enterprises/%v/copilot/usage", enterprise) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var usage []*CopilotUsageSummary - resp, err := s.client.Do(ctx, req, &usage) - if err != nil { - return nil, resp, err - } - - return usage, resp, nil -} - -// GetEnterpriseTeamUsage gets daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE for a team in the enterprise. -// -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-an-enterprise-team -// -//meta:operation GET /enterprises/{enterprise}/team/{team_slug}/copilot/usage -func (s *CopilotService) GetEnterpriseTeamUsage(ctx context.Context, enterprise, team string, opts *CopilotUsageSummaryListOptions) ([]*CopilotUsageSummary, *Response, error) { - u := fmt.Sprintf("enterprises/%v/team/%v/copilot/usage", enterprise, team) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var usage []*CopilotUsageSummary - resp, err := s.client.Do(ctx, req, &usage) - if err != nil { - return nil, resp, err - } - - return usage, resp, nil -} - -// GetOrganizationTeamUsage gets daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE for a team in the organization. -// -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-a-team -// -//meta:operation GET /orgs/{org}/team/{team_slug}/copilot/usage -func (s *CopilotService) GetOrganizationTeamUsage(ctx context.Context, org, team string, opts *CopilotUsageSummaryListOptions) ([]*CopilotUsageSummary, *Response, error) { - u := fmt.Sprintf("orgs/%v/team/%v/copilot/usage", org, team) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var usage []*CopilotUsageSummary - resp, err := s.client.Do(ctx, req, &usage) - if err != nil { - return nil, resp, err - } - - return usage, resp, nil -} - // GetEnterpriseMetrics gets Copilot usage metrics for an enterprise. // // GitHub API docs: https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise diff --git a/github/copilot_test.go b/github/copilot_test.go index a299bf0735a..fd5efa9f0bf 100644 --- a/github/copilot_test.go +++ b/github/copilot_test.go @@ -1127,810 +1127,6 @@ func TestCopilotService_GetSeatDetails(t *testing.T) { }) } -func TestCopilotService_GetOrganisationUsage(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/orgs/o/copilot/usage", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - fmt.Fprint(w, `[ - { - "day": "2023-10-15", - "total_suggestions_count": 1000, - "total_acceptances_count": 800, - "total_lines_suggested": 1800, - "total_lines_accepted": 1200, - "total_active_users": 10, - "total_chat_acceptances": 32, - "total_chat_turns": 200, - "total_active_chat_users": 4, - "breakdown": [ - { - "language": "python", - "editor": "vscode", - "suggestions_count": 300, - "acceptances_count": 250, - "lines_suggested": 900, - "lines_accepted": 700, - "active_users": 5 - }, - { - "language": "python", - "editor": "jetbrains", - "suggestions_count": 300, - "acceptances_count": 200, - "lines_suggested": 400, - "lines_accepted": 300, - "active_users": 2 - }, - { - "language": "ruby", - "editor": "vscode", - "suggestions_count": 400, - "acceptances_count": 350, - "lines_suggested": 500, - "lines_accepted": 200, - "active_users": 3 - } - ] - }, - { - "day": "2023-10-16", - "total_suggestions_count": 800, - "total_acceptances_count": 600, - "total_lines_suggested": 1100, - "total_lines_accepted": 700, - "total_active_users": 12, - "total_chat_acceptances": 57, - "total_chat_turns": 426, - "total_active_chat_users": 8, - "breakdown": [ - { - "language": "python", - "editor": "vscode", - "suggestions_count": 300, - "acceptances_count": 200, - "lines_suggested": 600, - "lines_accepted": 300, - "active_users": 2 - }, - { - "language": "python", - "editor": "jetbrains", - "suggestions_count": 300, - "acceptances_count": 150, - "lines_suggested": 300, - "lines_accepted": 250, - "active_users": 6 - }, - { - "language": "ruby", - "editor": "vscode", - "suggestions_count": 200, - "acceptances_count": 150, - "lines_suggested": 200, - "lines_accepted": 150, - "active_users": 3 - } - ] - } - ]`) - }) - - summaryOne := time.Date(2023, time.October, 15, 0, 0, 0, 0, time.UTC) - summaryTwoDate := time.Date(2023, time.October, 16, 0, 0, 0, 0, time.UTC) - ctx := context.Background() - got, _, err := client.Copilot.GetOrganizationUsage(ctx, "o", &CopilotUsageSummaryListOptions{}) - if err != nil { - t.Errorf("Copilot.GetOrganizationUsage returned error: %v", err) - } - - want := []*CopilotUsageSummary{ - { - Day: summaryOne.Format("2006-01-02"), - TotalSuggestionsCount: 1000, - TotalAcceptancesCount: 800, - TotalLinesSuggested: 1800, - TotalLinesAccepted: 1200, - TotalActiveUsers: 10, - TotalChatAcceptances: 32, - TotalChatTurns: 200, - TotalActiveChatUsers: 4, - Breakdown: []*CopilotUsageBreakdown{ - { - Language: "python", - Editor: "vscode", - SuggestionsCount: 300, - AcceptancesCount: 250, - LinesSuggested: 900, - LinesAccepted: 700, - ActiveUsers: 5, - }, - { - Language: "python", - Editor: "jetbrains", - SuggestionsCount: 300, - AcceptancesCount: 200, - LinesSuggested: 400, - LinesAccepted: 300, - ActiveUsers: 2, - }, - { - Language: "ruby", - Editor: "vscode", - SuggestionsCount: 400, - AcceptancesCount: 350, - LinesSuggested: 500, - LinesAccepted: 200, - ActiveUsers: 3, - }, - }, - }, - { - Day: summaryTwoDate.Format("2006-01-02"), - TotalSuggestionsCount: 800, - TotalAcceptancesCount: 600, - TotalLinesSuggested: 1100, - TotalLinesAccepted: 700, - TotalActiveUsers: 12, - TotalChatAcceptances: 57, - TotalChatTurns: 426, - TotalActiveChatUsers: 8, - Breakdown: []*CopilotUsageBreakdown{ - { - Language: "python", - Editor: "vscode", - SuggestionsCount: 300, - AcceptancesCount: 200, - LinesSuggested: 600, - LinesAccepted: 300, - ActiveUsers: 2, - }, - { - Language: "python", - Editor: "jetbrains", - SuggestionsCount: 300, - AcceptancesCount: 150, - LinesSuggested: 300, - LinesAccepted: 250, - ActiveUsers: 6, - }, - { - Language: "ruby", - Editor: "vscode", - SuggestionsCount: 200, - AcceptancesCount: 150, - LinesSuggested: 200, - LinesAccepted: 150, - ActiveUsers: 3, - }, - }, - }, - } - - if !cmp.Equal(got, want) { - t.Errorf("Copilot.GetOrganizationUsage returned %+v, want %+v", got, want) - } - - const methodName = "GetOrganizationUsage" - - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Copilot.GetOrganizationUsage(ctx, "\n", &CopilotUsageSummaryListOptions{}) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Copilot.GetOrganizationUsage(ctx, "o", &CopilotUsageSummaryListOptions{}) - if got != nil { - t.Errorf("Copilot.GetOrganizationUsage returned %+v, want nil", got) - } - return resp, err - }) -} - -func TestCopilotService_GetEnterpriseUsage(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/enterprises/e/copilot/usage", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - fmt.Fprint(w, `[ - { - "day": "2023-10-15", - "total_suggestions_count": 5000, - "total_acceptances_count": 3000, - "total_lines_suggested": 7000, - "total_lines_accepted": 3500, - "total_active_users": 15, - "total_chat_acceptances": 45, - "total_chat_turns": 350, - "total_active_chat_users": 8, - "breakdown": [ - { - "language": "python", - "editor": "vscode", - "suggestions_count": 3000, - "acceptances_count": 2000, - "lines_suggested": 3000, - "lines_accepted": 1500, - "active_users": 5 - }, - { - "language": "python", - "editor": "jetbrains", - "suggestions_count": 1000, - "acceptances_count": 500, - "lines_suggested": 2000, - "lines_accepted": 1000, - "active_users": 5 - }, - { - "language": "javascript", - "editor": "vscode", - "suggestions_count": 1000, - "acceptances_count": 500, - "lines_suggested": 2000, - "lines_accepted": 1000, - "active_users": 5 - } - ] - }, - { - "day": "2023-10-16", - "total_suggestions_count": 5200, - "total_acceptances_count": 5100, - "total_lines_suggested": 5300, - "total_lines_accepted": 5000, - "total_active_users": 15, - "total_chat_acceptances": 57, - "total_chat_turns": 455, - "total_active_chat_users": 12, - "breakdown": [ - { - "language": "python", - "editor": "vscode", - "suggestions_count": 3100, - "acceptances_count": 3000, - "lines_suggested": 3200, - "lines_accepted": 3100, - "active_users": 5 - }, - { - "language": "python", - "editor": "jetbrains", - "suggestions_count": 1100, - "acceptances_count": 1000, - "lines_suggested": 1200, - "lines_accepted": 1100, - "active_users": 5 - }, - { - "language": "javascript", - "editor": "vscode", - "suggestions_count": 1000, - "acceptances_count": 900, - "lines_suggested": 1100, - "lines_accepted": 1000, - "active_users": 5 - } - ] - } - ]`) - }) - - summaryOne := time.Date(2023, time.October, 15, 0, 0, 0, 0, time.UTC) - summaryTwoDate := time.Date(2023, time.October, 16, 0, 0, 0, 0, time.UTC) - ctx := context.Background() - got, _, err := client.Copilot.GetEnterpriseUsage(ctx, "e", &CopilotUsageSummaryListOptions{}) - if err != nil { - t.Errorf("Copilot.GetEnterpriseUsage returned error: %v", err) - } - - want := []*CopilotUsageSummary{ - { - Day: summaryOne.Format("2006-01-02"), - TotalSuggestionsCount: 5000, - TotalAcceptancesCount: 3000, - TotalLinesSuggested: 7000, - TotalLinesAccepted: 3500, - TotalActiveUsers: 15, - TotalChatAcceptances: 45, - TotalChatTurns: 350, - TotalActiveChatUsers: 8, - Breakdown: []*CopilotUsageBreakdown{ - { - Language: "python", - Editor: "vscode", - SuggestionsCount: 3000, - AcceptancesCount: 2000, - LinesSuggested: 3000, - LinesAccepted: 1500, - ActiveUsers: 5, - }, - { - Language: "python", - Editor: "jetbrains", - SuggestionsCount: 1000, - AcceptancesCount: 500, - LinesSuggested: 2000, - LinesAccepted: 1000, - ActiveUsers: 5, - }, - { - Language: "javascript", - Editor: "vscode", - SuggestionsCount: 1000, - AcceptancesCount: 500, - LinesSuggested: 2000, - LinesAccepted: 1000, - ActiveUsers: 5, - }, - }, - }, - { - Day: summaryTwoDate.Format("2006-01-02"), - TotalSuggestionsCount: 5200, - TotalAcceptancesCount: 5100, - TotalLinesSuggested: 5300, - TotalLinesAccepted: 5000, - TotalActiveUsers: 15, - TotalChatAcceptances: 57, - TotalChatTurns: 455, - TotalActiveChatUsers: 12, - Breakdown: []*CopilotUsageBreakdown{ - { - Language: "python", - Editor: "vscode", - SuggestionsCount: 3100, - AcceptancesCount: 3000, - LinesSuggested: 3200, - LinesAccepted: 3100, - ActiveUsers: 5, - }, - { - Language: "python", - Editor: "jetbrains", - SuggestionsCount: 1100, - AcceptancesCount: 1000, - LinesSuggested: 1200, - LinesAccepted: 1100, - ActiveUsers: 5, - }, - { - Language: "javascript", - Editor: "vscode", - SuggestionsCount: 1000, - AcceptancesCount: 900, - LinesSuggested: 1100, - LinesAccepted: 1000, - ActiveUsers: 5, - }, - }, - }, - } - - if !cmp.Equal(got, want) { - t.Errorf("Copilot.GetEnterpriseUsage returned %+v, want %+v", got, want) - } - - const methodName = "GetEnterpriseUsage" - - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Copilot.GetEnterpriseUsage(ctx, "\n", &CopilotUsageSummaryListOptions{}) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Copilot.GetEnterpriseUsage(ctx, "e", &CopilotUsageSummaryListOptions{}) - if got != nil { - t.Errorf("Copilot.GetEnterpriseUsage returned %+v, want nil", got) - } - return resp, err - }) -} - -func TestCopilotService_GetEnterpriseTeamUsage(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/enterprises/e/team/t/copilot/usage", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - fmt.Fprint(w, `[ - { - "day": "2023-10-15", - "total_suggestions_count": 1000, - "total_acceptances_count": 800, - "total_lines_suggested": 1800, - "total_lines_accepted": 1200, - "total_active_users": 10, - "total_chat_acceptances": 32, - "total_chat_turns": 200, - "total_active_chat_users": 4, - "breakdown": [ - { - "language": "python", - "editor": "vscode", - "suggestions_count": 300, - "acceptances_count": 250, - "lines_suggested": 900, - "lines_accepted": 700, - "active_users": 5 - }, - { - "language": "python", - "editor": "jetbrains", - "suggestions_count": 300, - "acceptances_count": 200, - "lines_suggested": 400, - "lines_accepted": 300, - "active_users": 2 - }, - { - "language": "ruby", - "editor": "vscode", - "suggestions_count": 400, - "acceptances_count": 350, - "lines_suggested": 500, - "lines_accepted": 200, - "active_users": 3 - } - ] - }, - { - "day": "2023-10-16", - "total_suggestions_count": 800, - "total_acceptances_count": 600, - "total_lines_suggested": 1100, - "total_lines_accepted": 700, - "total_active_users": 12, - "total_chat_acceptances": 57, - "total_chat_turns": 426, - "total_active_chat_users": 8, - "breakdown": [ - { - "language": "python", - "editor": "vscode", - "suggestions_count": 300, - "acceptances_count": 200, - "lines_suggested": 600, - "lines_accepted": 300, - "active_users": 2 - }, - { - "language": "python", - "editor": "jetbrains", - "suggestions_count": 300, - "acceptances_count": 150, - "lines_suggested": 300, - "lines_accepted": 250, - "active_users": 6 - }, - { - "language": "ruby", - "editor": "vscode", - "suggestions_count": 200, - "acceptances_count": 150, - "lines_suggested": 200, - "lines_accepted": 150, - "active_users": 3 - } - ] - } - ]`) - }) - - summaryOne := time.Date(2023, time.October, 15, 0, 0, 0, 0, time.UTC) - summaryTwoDate := time.Date(2023, time.October, 16, 0, 0, 0, 0, time.UTC) - ctx := context.Background() - got, _, err := client.Copilot.GetEnterpriseTeamUsage(ctx, "e", "t", &CopilotUsageSummaryListOptions{}) - if err != nil { - t.Errorf("Copilot.GetEnterpriseTeamUsage returned error: %v", err) - } - - want := []*CopilotUsageSummary{ - { - Day: summaryOne.Format("2006-01-02"), - TotalSuggestionsCount: 1000, - TotalAcceptancesCount: 800, - TotalLinesSuggested: 1800, - TotalLinesAccepted: 1200, - TotalActiveUsers: 10, - TotalChatAcceptances: 32, - TotalChatTurns: 200, - TotalActiveChatUsers: 4, - Breakdown: []*CopilotUsageBreakdown{ - { - Language: "python", - Editor: "vscode", - SuggestionsCount: 300, - AcceptancesCount: 250, - LinesSuggested: 900, - LinesAccepted: 700, - ActiveUsers: 5, - }, - { - Language: "python", - Editor: "jetbrains", - SuggestionsCount: 300, - AcceptancesCount: 200, - LinesSuggested: 400, - LinesAccepted: 300, - ActiveUsers: 2, - }, - { - Language: "ruby", - Editor: "vscode", - SuggestionsCount: 400, - AcceptancesCount: 350, - LinesSuggested: 500, - LinesAccepted: 200, - ActiveUsers: 3, - }, - }, - }, - { - Day: summaryTwoDate.Format("2006-01-02"), - TotalSuggestionsCount: 800, - TotalAcceptancesCount: 600, - TotalLinesSuggested: 1100, - TotalLinesAccepted: 700, - TotalActiveUsers: 12, - TotalChatAcceptances: 57, - TotalChatTurns: 426, - TotalActiveChatUsers: 8, - Breakdown: []*CopilotUsageBreakdown{ - { - Language: "python", - Editor: "vscode", - SuggestionsCount: 300, - AcceptancesCount: 200, - LinesSuggested: 600, - LinesAccepted: 300, - ActiveUsers: 2, - }, - { - Language: "python", - Editor: "jetbrains", - SuggestionsCount: 300, - AcceptancesCount: 150, - LinesSuggested: 300, - LinesAccepted: 250, - ActiveUsers: 6, - }, - { - Language: "ruby", - Editor: "vscode", - SuggestionsCount: 200, - AcceptancesCount: 150, - LinesSuggested: 200, - LinesAccepted: 150, - ActiveUsers: 3, - }, - }, - }, - } - - if !cmp.Equal(got, want) { - t.Errorf("Copilot.GetEnterpriseTeamUsage returned %+v, want %+v", got, want) - } - - const methodName = "GetEnterpriseTeamUsage" - - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Copilot.GetEnterpriseTeamUsage(ctx, "\n", "\n", &CopilotUsageSummaryListOptions{}) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Copilot.GetEnterpriseTeamUsage(ctx, "e", "t", &CopilotUsageSummaryListOptions{}) - if got != nil { - t.Errorf("Copilot.GetEnterpriseTeamUsage returned %+v, want nil", got) - } - return resp, err - }) -} - -func TestCopilotService_GetOrganizationTeamUsage(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/orgs/o/team/t/copilot/usage", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - fmt.Fprint(w, `[ - { - "day": "2023-10-15", - "total_suggestions_count": 1000, - "total_acceptances_count": 800, - "total_lines_suggested": 1800, - "total_lines_accepted": 1200, - "total_active_users": 10, - "total_chat_acceptances": 32, - "total_chat_turns": 200, - "total_active_chat_users": 4, - "breakdown": [ - { - "language": "python", - "editor": "vscode", - "suggestions_count": 300, - "acceptances_count": 250, - "lines_suggested": 900, - "lines_accepted": 700, - "active_users": 5 - }, - { - "language": "python", - "editor": "jetbrains", - "suggestions_count": 300, - "acceptances_count": 200, - "lines_suggested": 400, - "lines_accepted": 300, - "active_users": 2 - }, - { - "language": "ruby", - "editor": "vscode", - "suggestions_count": 400, - "acceptances_count": 350, - "lines_suggested": 500, - "lines_accepted": 200, - "active_users": 3 - } - ] - }, - { - "day": "2023-10-16", - "total_suggestions_count": 800, - "total_acceptances_count": 600, - "total_lines_suggested": 1100, - "total_lines_accepted": 700, - "total_active_users": 12, - "total_chat_acceptances": 57, - "total_chat_turns": 426, - "total_active_chat_users": 8, - "breakdown": [ - { - "language": "python", - "editor": "vscode", - "suggestions_count": 300, - "acceptances_count": 200, - "lines_suggested": 600, - "lines_accepted": 300, - "active_users": 2 - }, - { - "language": "python", - "editor": "jetbrains", - "suggestions_count": 300, - "acceptances_count": 150, - "lines_suggested": 300, - "lines_accepted": 250, - "active_users": 6 - }, - { - "language": "ruby", - "editor": "vscode", - "suggestions_count": 200, - "acceptances_count": 150, - "lines_suggested": 200, - "lines_accepted": 150, - "active_users": 3 - } - ] - } - ]`) - }) - - summaryOne := time.Date(2023, time.October, 15, 0, 0, 0, 0, time.UTC) - summaryTwoDate := time.Date(2023, time.October, 16, 0, 0, 0, 0, time.UTC) - ctx := context.Background() - got, _, err := client.Copilot.GetOrganizationTeamUsage(ctx, "o", "t", &CopilotUsageSummaryListOptions{}) - if err != nil { - t.Errorf("Copilot.GetOrganizationTeamUsage returned error: %v", err) - } - - want := []*CopilotUsageSummary{ - { - Day: summaryOne.Format("2006-01-02"), - TotalSuggestionsCount: 1000, - TotalAcceptancesCount: 800, - TotalLinesSuggested: 1800, - TotalLinesAccepted: 1200, - TotalActiveUsers: 10, - TotalChatAcceptances: 32, - TotalChatTurns: 200, - TotalActiveChatUsers: 4, - Breakdown: []*CopilotUsageBreakdown{ - { - Language: "python", - Editor: "vscode", - SuggestionsCount: 300, - AcceptancesCount: 250, - LinesSuggested: 900, - LinesAccepted: 700, - ActiveUsers: 5, - }, - { - Language: "python", - Editor: "jetbrains", - SuggestionsCount: 300, - AcceptancesCount: 200, - LinesSuggested: 400, - LinesAccepted: 300, - ActiveUsers: 2, - }, - { - Language: "ruby", - Editor: "vscode", - SuggestionsCount: 400, - AcceptancesCount: 350, - LinesSuggested: 500, - LinesAccepted: 200, - ActiveUsers: 3, - }, - }, - }, - { - Day: summaryTwoDate.Format("2006-01-02"), - TotalSuggestionsCount: 800, - TotalAcceptancesCount: 600, - TotalLinesSuggested: 1100, - TotalLinesAccepted: 700, - TotalActiveUsers: 12, - TotalChatAcceptances: 57, - TotalChatTurns: 426, - TotalActiveChatUsers: 8, - Breakdown: []*CopilotUsageBreakdown{ - { - Language: "python", - Editor: "vscode", - SuggestionsCount: 300, - AcceptancesCount: 200, - LinesSuggested: 600, - LinesAccepted: 300, - ActiveUsers: 2, - }, - { - Language: "python", - Editor: "jetbrains", - SuggestionsCount: 300, - AcceptancesCount: 150, - LinesSuggested: 300, - LinesAccepted: 250, - ActiveUsers: 6, - }, - { - Language: "ruby", - Editor: "vscode", - SuggestionsCount: 200, - AcceptancesCount: 150, - LinesSuggested: 200, - LinesAccepted: 150, - ActiveUsers: 3, - }, - }, - }, - } - - if !cmp.Equal(got, want) { - t.Errorf("Copilot.GetOrganizationTeamUsage returned %+v, want %+v", got, want) - } - - const methodName = "GetOrganizationTeamUsage" - - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Copilot.GetOrganizationTeamUsage(ctx, "\n", "\n", &CopilotUsageSummaryListOptions{}) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Copilot.GetOrganizationTeamUsage(ctx, "o", "t", &CopilotUsageSummaryListOptions{}) - if got != nil { - t.Errorf("Copilot.GetOrganizationTeamUsage returned %+v, want nil", got) - } - return resp, err - }) -} - func TestCopilotService_GetEnterpriseMetrics(t *testing.T) { t.Parallel() client, mux, _ := setup(t) diff --git a/github/github-accessors.go b/github/github-accessors.go index 0c7f150ed7e..0782ba2f326 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -4454,22 +4454,6 @@ func (c *CopilotSeatDetails) GetUpdatedAt() Timestamp { return *c.UpdatedAt } -// GetSince returns the Since field if it's non-nil, zero value otherwise. -func (c *CopilotUsageSummaryListOptions) GetSince() time.Time { - if c == nil || c.Since == nil { - return time.Time{} - } - return *c.Since -} - -// GetUntil returns the Until field if it's non-nil, zero value otherwise. -func (c *CopilotUsageSummaryListOptions) GetUntil() time.Time { - if c == nil || c.Until == nil { - return time.Time{} - } - return *c.Until -} - // GetCompletedAt returns the CompletedAt field if it's non-nil, zero value otherwise. func (c *CreateCheckRunOptions) GetCompletedAt() Timestamp { if c == nil || c.CompletedAt == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 28d75f3e3f3..b0a96dea810 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -5766,28 +5766,6 @@ func TestCopilotSeatDetails_GetUpdatedAt(tt *testing.T) { c.GetUpdatedAt() } -func TestCopilotUsageSummaryListOptions_GetSince(tt *testing.T) { - tt.Parallel() - var zeroValue time.Time - c := &CopilotUsageSummaryListOptions{Since: &zeroValue} - c.GetSince() - c = &CopilotUsageSummaryListOptions{} - c.GetSince() - c = nil - c.GetSince() -} - -func TestCopilotUsageSummaryListOptions_GetUntil(tt *testing.T) { - tt.Parallel() - var zeroValue time.Time - c := &CopilotUsageSummaryListOptions{Until: &zeroValue} - c.GetUntil() - c = &CopilotUsageSummaryListOptions{} - c.GetUntil() - c = nil - c.GetUntil() -} - func TestCreateCheckRunOptions_GetCompletedAt(tt *testing.T) { tt.Parallel() var zeroValue Timestamp From b5e9d440479292ba3b3a9e1795e37427ed9786c8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 14:58:38 -0500 Subject: [PATCH 571/751] build(deps): bump codecov/codecov-action from 5.0.2 to 5.0.7 (#3358) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3c7efdd6a8e..fb3cfb88819 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -73,4 +73,4 @@ jobs: - name: Upload coverage to Codecov if: ${{ matrix.update-coverage }} - uses: codecov/codecov-action@5c47607acb93fed5485fdbf7232e8a31425f672a #v5.0.2 + uses: codecov/codecov-action@015f24e6818733317a2da2edd6290ab26238649a #v5.0.7 From 4267bc92446ca99b39c102ceda73c2a07770d774 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Wed, 27 Nov 2024 08:46:55 -0500 Subject: [PATCH 572/751] Update AUTHORS (#3359) --- AUTHORS | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/AUTHORS b/AUTHORS index d2116450984..bbbdc74b2d5 100644 --- a/AUTHORS +++ b/AUTHORS @@ -20,6 +20,7 @@ Abhishek Sharma Abhishek Veeramalla aboy Adam Kohring +Aditya Mahendrakar adrienzieba afdesk Ahmad Nurus S @@ -48,6 +49,7 @@ Amey Sakhadeo Anders Janmyr Andreas Deininger Andreas Garnæs +Andrew Gillis Andrew Ryabchun Andrew Svoboda Andriyun @@ -110,6 +112,7 @@ chandresh-pancholi Charles Fenwick Elliott Charlie Yan Chmouel Boudjnah +Chris Allen Lane Chris King Chris Mc Chris Raborg @@ -170,6 +173,7 @@ eperm Erick Fejta Erik Elkins Erik Nobel +Erwan Finot erwinvaneyk Evan Anderson Evan Elias @@ -207,6 +211,7 @@ Hari haran Harikesh00 haya14busa haya14busa +Henrik Lundström Hiroki Ito Hubot Jr Huy Tr @@ -219,6 +224,7 @@ Ioannis Georgoulas Isao Jonas ishan upadhyay isqua +Ivan Martos Jacob Valdemar Jake Krammer Jake Scaltreto @@ -343,6 +349,7 @@ MichaÅ‚ Glapa Michelangelo Morrillo Miguel Elias dos Santos Mike Chen +Miles Crabill Mishin Nikolai mohammad ali <2018cs92@student.uet.edu.pk> Mohammed AlDujaili @@ -373,6 +380,7 @@ ns-cweber nxya Ole Orhagen Oleg Kovalov +Oleksandr Redko OndÅ™ej Kupka Ori Talmor Osama Faqhruldin From 92383951a7395b26519cb20263b70ebe67a3672a Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Wed, 27 Nov 2024 09:02:17 -0500 Subject: [PATCH 573/751] Bump version of go-github to v67.0.0 (#3360) --- README.md | 41 +++++-------------- example/actionpermissions/main.go | 2 +- example/appengine/app.go | 2 +- example/basicauth/main.go | 2 +- .../newreposecretwithxcrypto/main.go | 2 +- .../newusersecretwithxcrypto/main.go | 2 +- example/commitpr/main.go | 2 +- example/go.mod | 6 +-- example/listenvironments/main.go | 2 +- example/migrations/main.go | 2 +- example/newfilewithappauth/main.go | 2 +- example/newrepo/main.go | 2 +- example/newreposecretwithlibsodium/go.mod | 4 +- example/newreposecretwithlibsodium/main.go | 2 +- example/newreposecretwithxcrypto/main.go | 2 +- example/ratelimit/main.go | 2 +- example/simple/main.go | 2 +- example/tokenauth/main.go | 2 +- example/topics/main.go | 2 +- example/verifyartifact/main.go | 2 +- github/doc.go | 2 +- github/examples_test.go | 2 +- github/github.go | 2 +- go.mod | 2 +- test/fields/fields.go | 2 +- test/integration/activity_test.go | 2 +- test/integration/authorizations_test.go | 2 +- test/integration/github_test.go | 2 +- test/integration/repos_test.go | 2 +- test/integration/users_test.go | 2 +- tools/go.mod | 4 +- tools/metadata/main.go | 2 +- tools/metadata/main_test.go | 2 +- tools/metadata/metadata.go | 2 +- tools/metadata/openapi.go | 2 +- 35 files changed, 48 insertions(+), 69 deletions(-) diff --git a/README.md b/README.md index 1ed18de71f2..4c9f67cdd20 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-github # [![go-github release (latest SemVer)](https://img.shields.io/github/v/release/google/go-github?sort=semver)](https://github.com/google/go-github/releases) -[![Go Reference](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v66/github) +[![Go Reference](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v67/github) [![Test Status](https://github.com/google/go-github/workflows/tests/badge.svg)](https://github.com/google/go-github/actions?query=workflow%3Atests) [![Test Coverage](https://codecov.io/gh/google/go-github/branch/master/graph/badge.svg)](https://codecov.io/gh/google/go-github) [![Discuss at go-github@googlegroups.com](https://img.shields.io/badge/discuss-go--github%40googlegroups.com-blue.svg)](https://groups.google.com/group/go-github) @@ -25,7 +25,7 @@ If you're interested in using the [GraphQL API v4][], the recommended library is go-github is compatible with modern Go releases in module mode, with Go installed: ```bash -go get github.com/google/go-github/v66 +go get github.com/google/go-github/v67 ``` will resolve and add the package to the current development module, along with its dependencies. @@ -33,7 +33,7 @@ will resolve and add the package to the current development module, along with i Alternatively the same can be achieved if you use import in a package: ```go -import "github.com/google/go-github/v66/github" +import "github.com/google/go-github/v67/github" ``` and run `go get` without parameters. @@ -41,13 +41,13 @@ and run `go get` without parameters. Finally, to use the top-of-trunk version of this repo, use the following command: ```bash -go get github.com/google/go-github/v66@master +go get github.com/google/go-github/v67@master ``` ## Usage ## ```go -import "github.com/google/go-github/v66/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) +import "github.com/google/go-github/v67/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled ``` @@ -120,7 +120,7 @@ import ( "net/http" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" ) func main() { @@ -154,7 +154,7 @@ import ( "os" "strconv" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" "github.com/jferrl/go-githubauth" "golang.org/x/oauth2" ) @@ -362,7 +362,7 @@ For complete usage of go-github, see the full [package docs][]. [GitHub API v3]: https://docs.github.com/en/rest [personal access token]: https://github.com/blog/1509-personal-api-tokens -[package docs]: https://pkg.go.dev/github.com/google/go-github/v66/github +[package docs]: https://pkg.go.dev/github.com/google/go-github/v67/github [GraphQL API v4]: https://developer.github.com/v4/ [shurcooL/githubv4]: https://github.com/shurcooL/githubv4 [GitHub webhook events]: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads @@ -436,29 +436,8 @@ Versions prior to 48.2.0 are not listed. | go-github Version | GitHub v3 API Version | | ----------------- | --------------------- | -| 66.0.0 | 2022-11-28 | -| 65.0.0 | 2022-11-28 | -| 64.0.0 | 2022-11-28 | -| 63.0.0 | 2022-11-28 | -| 62.0.0 | 2022-11-28 | -| 61.0.0 | 2022-11-28 | -| 60.0.0 | 2022-11-28 | -| 59.0.0 | 2022-11-28 | -| 58.0.0 | 2022-11-28 | -| 57.0.0 | 2022-11-28 | -| 56.0.0 | 2022-11-28 | -| 55.0.0 | 2022-11-28 | -| 54.0.0 | 2022-11-28 | -| 53.2.0 | 2022-11-28 | -| 53.1.0 | 2022-11-28 | -| 53.0.0 | 2022-11-28 | -| 52.0.0 | 2022-11-28 | -| 51.0.0 | 2022-11-28 | -| 50.2.0 | 2022-11-28 | -| 50.1.0 | 2022-11-28 | -| 50.0.0 | 2022-11-28 | -| 49.1.0 | 2022-11-28 | -| 49.0.0 | 2022-11-28 | +| 67.0.0 | 2022-11-28 | +| ... | 2022-11-28 | | 48.2.0 | 2022-11-28 | ## License ## diff --git a/example/actionpermissions/main.go b/example/actionpermissions/main.go index a41561718a2..6047824b6bb 100644 --- a/example/actionpermissions/main.go +++ b/example/actionpermissions/main.go @@ -14,7 +14,7 @@ import ( "log" "os" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" ) var ( diff --git a/example/appengine/app.go b/example/appengine/app.go index a0653217da2..94299d593fa 100644 --- a/example/appengine/app.go +++ b/example/appengine/app.go @@ -12,7 +12,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" "google.golang.org/appengine" "google.golang.org/appengine/log" ) diff --git a/example/basicauth/main.go b/example/basicauth/main.go index 0884b258771..8bae18e7a1b 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -21,7 +21,7 @@ import ( "os" "strings" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" "golang.org/x/term" ) diff --git a/example/codespaces/newreposecretwithxcrypto/main.go b/example/codespaces/newreposecretwithxcrypto/main.go index df7cd97fb36..4f5821ef4b9 100644 --- a/example/codespaces/newreposecretwithxcrypto/main.go +++ b/example/codespaces/newreposecretwithxcrypto/main.go @@ -37,7 +37,7 @@ import ( "log" "os" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/codespaces/newusersecretwithxcrypto/main.go b/example/codespaces/newusersecretwithxcrypto/main.go index e306ae3de79..4d3567f40b1 100644 --- a/example/codespaces/newusersecretwithxcrypto/main.go +++ b/example/codespaces/newusersecretwithxcrypto/main.go @@ -38,7 +38,7 @@ import ( "log" "os" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index 56562beb367..cc7d148a378 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -33,7 +33,7 @@ import ( "time" "github.com/ProtonMail/go-crypto/openpgp" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" ) var ( diff --git a/example/go.mod b/example/go.mod index 52e9242d413..2222cd7fd4e 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v66/example +module github.com/google/go-github/v67/example go 1.22.5 @@ -8,7 +8,7 @@ require ( github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-ratelimit v1.0.3 - github.com/google/go-github/v66 v66.0.0 + github.com/google/go-github/v67 v67.0.0 github.com/sigstore/sigstore-go v0.6.2 golang.org/x/crypto v0.27.0 golang.org/x/term v0.24.0 @@ -101,4 +101,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v66 => ../ +replace github.com/google/go-github/v67 => ../ diff --git a/example/listenvironments/main.go b/example/listenvironments/main.go index b0a418f5ec2..7de29753e05 100644 --- a/example/listenvironments/main.go +++ b/example/listenvironments/main.go @@ -18,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" ) func main() { diff --git a/example/migrations/main.go b/example/migrations/main.go index 17fc9c19f03..5c3fc40ad11 100644 --- a/example/migrations/main.go +++ b/example/migrations/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" ) func fetchAllUserMigrations() ([]*github.UserMigration, error) { diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index fd4f4d76ff0..9db0e08e183 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -16,7 +16,7 @@ import ( "time" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" ) func main() { diff --git a/example/newrepo/main.go b/example/newrepo/main.go index a737edbc4cb..479e75e7259 100644 --- a/example/newrepo/main.go +++ b/example/newrepo/main.go @@ -16,7 +16,7 @@ import ( "log" "os" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" ) var ( diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index f4c33c6a334..df264fcc27d 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -6,10 +6,10 @@ toolchain go1.22.0 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb - github.com/google/go-github/v66 v66.0.0 + github.com/google/go-github/v67 v67.0.0 ) require github.com/google/go-querystring v1.1.0 // indirect // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v66 => ../.. +replace github.com/google/go-github/v67 => ../.. diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index cfa64196401..a2888583462 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -36,7 +36,7 @@ import ( "os" sodium "github.com/GoKillers/libsodium-go/cryptobox" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" ) var ( diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index 9c1a42b04eb..107908cd85c 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -37,7 +37,7 @@ import ( "log" "os" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/ratelimit/main.go b/example/ratelimit/main.go index d444d552c35..0a90944b1c3 100644 --- a/example/ratelimit/main.go +++ b/example/ratelimit/main.go @@ -13,7 +13,7 @@ import ( "fmt" "github.com/gofri/go-github-ratelimit/github_ratelimit" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" ) func main() { diff --git a/example/simple/main.go b/example/simple/main.go index 6c7dad5f996..46d90310884 100644 --- a/example/simple/main.go +++ b/example/simple/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" ) // Fetch all the public organizations' membership of a user. diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index 0c8f39f848c..9e95ff16a44 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -15,7 +15,7 @@ import ( "log" "os" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" "golang.org/x/term" ) diff --git a/example/topics/main.go b/example/topics/main.go index b95282ed856..64638479f4b 100644 --- a/example/topics/main.go +++ b/example/topics/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" ) // Fetch and lists all the public topics associated with the specified GitHub topic. diff --git a/example/verifyartifact/main.go b/example/verifyartifact/main.go index 01ea9110770..b01cb1f7c4b 100644 --- a/example/verifyartifact/main.go +++ b/example/verifyartifact/main.go @@ -18,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" "github.com/sigstore/sigstore-go/pkg/bundle" "github.com/sigstore/sigstore-go/pkg/root" "github.com/sigstore/sigstore-go/pkg/verify" diff --git a/github/doc.go b/github/doc.go index 7196394fb9c..bee1a616fde 100644 --- a/github/doc.go +++ b/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v66/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v67/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to diff --git a/github/examples_test.go b/github/examples_test.go index 51eae1e3b5d..ccb0fd6bafe 100644 --- a/github/examples_test.go +++ b/github/examples_test.go @@ -12,7 +12,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" ) func ExampleMarkdownService_Render() { diff --git a/github/github.go b/github/github.go index 042a0b52e7a..6f476353473 100644 --- a/github/github.go +++ b/github/github.go @@ -28,7 +28,7 @@ import ( ) const ( - Version = "v66.0.0" + Version = "v67.0.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" diff --git a/go.mod b/go.mod index c7f40401733..effc7386d53 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v66 +module github.com/google/go-github/v67 require ( github.com/google/go-cmp v0.6.0 diff --git a/test/fields/fields.go b/test/fields/fields.go index 0ea783d8c0c..5fc0bd6fe57 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -25,7 +25,7 @@ import ( "reflect" "strings" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" ) var ( diff --git a/test/integration/activity_test.go b/test/integration/activity_test.go index 09b2601d571..369c5e6c7d4 100644 --- a/test/integration/activity_test.go +++ b/test/integration/activity_test.go @@ -11,7 +11,7 @@ import ( "context" "testing" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" ) const ( diff --git a/test/integration/authorizations_test.go b/test/integration/authorizations_test.go index 7b409d2c982..eeb1a12a182 100644 --- a/test/integration/authorizations_test.go +++ b/test/integration/authorizations_test.go @@ -14,7 +14,7 @@ import ( "testing" "time" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" ) const msgEnvMissing = "Skipping test because the required environment variable (%v) is not present." diff --git a/test/integration/github_test.go b/test/integration/github_test.go index 48745706002..577ccba89ab 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -14,7 +14,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" ) var ( diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index be9cc6a0960..81c0d6da093 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -14,7 +14,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" ) func TestRepositories_CRUD(t *testing.T) { diff --git a/test/integration/users_test.go b/test/integration/users_test.go index 6d1e834ad34..3415fc26161 100644 --- a/test/integration/users_test.go +++ b/test/integration/users_test.go @@ -13,7 +13,7 @@ import ( "math/rand" "testing" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" ) func TestUsers_Get(t *testing.T) { diff --git a/tools/go.mod b/tools/go.mod index e76e1efa0fb..4453e721a9d 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -8,7 +8,7 @@ require ( github.com/alecthomas/kong v1.4.0 github.com/getkin/kin-openapi v0.128.0 github.com/google/go-cmp v0.6.0 - github.com/google/go-github/v66 v66.0.0 + github.com/google/go-github/v67 v67.0.0 golang.org/x/sync v0.9.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -25,4 +25,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v66 => ../ +replace github.com/google/go-github/v67 => ../ diff --git a/tools/metadata/main.go b/tools/metadata/main.go index 7be3cbed656..1471c616c01 100644 --- a/tools/metadata/main.go +++ b/tools/metadata/main.go @@ -16,7 +16,7 @@ import ( "path/filepath" "github.com/alecthomas/kong" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" ) var helpVars = kong.Vars{ diff --git a/tools/metadata/main_test.go b/tools/metadata/main_test.go index 51e36b390c9..a9f69abacae 100644 --- a/tools/metadata/main_test.go +++ b/tools/metadata/main_test.go @@ -23,7 +23,7 @@ import ( "github.com/alecthomas/kong" "github.com/getkin/kin-openapi/openapi3" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" ) func TestUpdateGo(t *testing.T) { diff --git a/tools/metadata/metadata.go b/tools/metadata/metadata.go index 11eeae58542..d67608c7716 100644 --- a/tools/metadata/metadata.go +++ b/tools/metadata/metadata.go @@ -24,7 +24,7 @@ import ( "strings" "sync" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" "gopkg.in/yaml.v3" ) diff --git a/tools/metadata/openapi.go b/tools/metadata/openapi.go index bd211da02b8..6dccd252464 100644 --- a/tools/metadata/openapi.go +++ b/tools/metadata/openapi.go @@ -14,7 +14,7 @@ import ( "strconv" "github.com/getkin/kin-openapi/openapi3" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" "golang.org/x/sync/errgroup" ) From e7356de4e9b3551b15df58d95bd6e60e75469cab Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Wed, 27 Nov 2024 09:19:26 -0500 Subject: [PATCH 574/751] Bump go-github from v66 to v67 in /scrape (#3361) --- scrape/apps.go | 2 +- scrape/apps_test.go | 2 +- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scrape/apps.go b/scrape/apps.go index db68b583e1a..6b0ce0e8b50 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -18,7 +18,7 @@ import ( "strings" "github.com/PuerkitoBio/goquery" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" ) // AppRestrictionsEnabled returns whether the specified organization has diff --git a/scrape/apps_test.go b/scrape/apps_test.go index 1a41764867f..991dd8f368d 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" ) func Test_AppRestrictionsEnabled(t *testing.T) { diff --git a/scrape/go.mod b/scrape/go.mod index 7a5ffdffbe8..3ea2c52cc24 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -7,7 +7,7 @@ toolchain go1.22.0 require ( github.com/PuerkitoBio/goquery v1.9.2 github.com/google/go-cmp v0.6.0 - github.com/google/go-github/v66 v66.0.0 + github.com/google/go-github/v67 v67.0.0 github.com/xlzd/gotp v0.1.0 golang.org/x/net v0.31.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index a23c65cc4f5..cd2b0bf8d4a 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -5,8 +5,8 @@ github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6 github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v66 v66.0.0 h1:ADJsaXj9UotwdgK8/iFZtv7MLc8E8WBl62WLd/D/9+M= -github.com/google/go-github/v66 v66.0.0/go.mod h1:+4SO9Zkuyf8ytMj0csN1NR/5OTR+MfqPp8P8dVlcvY4= +github.com/google/go-github/v67 v67.0.0 h1:g11NDAmfaBaCO8qYdI9fsmbaRipHNWRIU/2YGvlh4rg= +github.com/google/go-github/v67 v67.0.0/go.mod h1:zH3K7BxjFndr9QSeFibx4lTKkYS3K9nDanoI1NjaOtY= 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.1.0 h1:37blvlKCh38s+fkem+fFh7sMnceltoIEBYTVXyoa5Po= From c6856bc9e29aeba0999a959f7a892098b18ff965 Mon Sep 17 00:00:00 2001 From: tomfeigin Date: Sun, 1 Dec 2024 15:16:12 +0200 Subject: [PATCH 575/751] Map more missing installation permissions (#3363) --- github/apps.go | 23 +++ github/github-accessors.go | 184 +++++++++++++++++++++++ github/github-accessors_test.go | 253 ++++++++++++++++++++++++++++++++ 3 files changed, 460 insertions(+) diff --git a/github/apps.go b/github/apps.go index 4757dedfaa9..8b7ed454161 100644 --- a/github/apps.go +++ b/github/apps.go @@ -80,29 +80,47 @@ type InstallationPermissions struct { Actions *string `json:"actions,omitempty"` ActionsVariables *string `json:"actions_variables,omitempty"` Administration *string `json:"administration,omitempty"` + Attestations *string `json:"attestations,omitempty"` Blocking *string `json:"blocking,omitempty"` Checks *string `json:"checks,omitempty"` Codespaces *string `json:"codespaces,omitempty"` CodespacesLifecycleAdmin *string `json:"codespaces_lifecycle_admin,omitempty"` CodespacesMetadata *string `json:"codespaces_metadata,omitempty"` CodespacesSecrets *string `json:"codespaces_secrets,omitempty"` + CodespacesUserSecrets *string `json:"codespaces_user_secrets,omitempty"` Contents *string `json:"contents,omitempty"` ContentReferences *string `json:"content_references,omitempty"` + CopilotMessages *string `json:"copilot_messages,omitempty"` DependabotSecrets *string `json:"dependabot_secrets,omitempty"` Deployments *string `json:"deployments,omitempty"` Discussions *string `json:"discussions,omitempty"` Emails *string `json:"emails,omitempty"` Environments *string `json:"environments,omitempty"` Followers *string `json:"followers,omitempty"` + Gists *string `json:"gists,omitempty"` + GitSigningSSHPublicKeys *string `json:"git_signing_ssh_public_keys,omitempty"` + GPGKeys *string `json:"gpg_keys,omitempty"` + InteractionLimits *string `json:"interaction_limits,omitempty"` Issues *string `json:"issues,omitempty"` + Keys *string `json:"keys,omitempty"` Metadata *string `json:"metadata,omitempty"` Members *string `json:"members,omitempty"` MergeQueues *string `json:"merge_queues,omitempty"` + OrganizationActionsVariables *string `json:"organization_actions_variables,omitempty"` OrganizationAdministration *string `json:"organization_administration,omitempty"` + OrganizationAnnouncementBanners *string `json:"organization_announcement_banners,omitempty"` + OrganizationAPIInsights *string `json:"organization_api_insights,omitempty"` + OrganizationCodespaces *string `json:"organization_codespaces,omitempty"` + OrganizationCodespacesSecrets *string `json:"organization_codespaces_secrets,omitempty"` + OrganizationCodespacesSettings *string `json:"organization_codespaces_settings,omitempty"` + OrganizationCopilotSeatManagement *string `json:"organization_copilot_seat_management,omitempty"` OrganizationCustomProperties *string `json:"organization_custom_properties,omitempty"` OrganizationCustomRoles *string `json:"organization_custom_roles,omitempty"` OrganizationCustomOrgRoles *string `json:"organization_custom_org_roles,omitempty"` + OrganizationDependabotSecrets *string `json:"organization_dependabot_secrets,omitempty"` + OrganizationEvents *string `json:"organization_events,omitempty"` OrganizationHooks *string `json:"organization_hooks,omitempty"` + OrganizationKnowledgeBases *string `json:"organization_knowledge_bases,omitempty"` OrganizationPackages *string `json:"organization_packages,omitempty"` OrganizationPersonalAccessTokens *string `json:"organization_personal_access_tokens,omitempty"` OrganizationPersonalAccessTokenRequests *string `json:"organization_personal_access_token_requests,omitempty"` @@ -114,6 +132,8 @@ type InstallationPermissions struct { OrganizationUserBlocking *string `json:"organization_user_blocking,omitempty"` Packages *string `json:"packages,omitempty"` Pages *string `json:"pages,omitempty"` + Plan *string `json:"plan,omitempty"` + Profile *string `json:"profile,omitempty"` PullRequests *string `json:"pull_requests,omitempty"` RepositoryAdvisories *string `json:"repository_advisories,omitempty"` RepositoryCustomProperties *string `json:"repository_custom_properties,omitempty"` @@ -124,9 +144,12 @@ type InstallationPermissions struct { SecretScanningAlerts *string `json:"secret_scanning_alerts,omitempty"` SecurityEvents *string `json:"security_events,omitempty"` SingleFile *string `json:"single_file,omitempty"` + Starring *string `json:"starring,omitempty"` Statuses *string `json:"statuses,omitempty"` TeamDiscussions *string `json:"team_discussions,omitempty"` + UserEvents *string `json:"user_events,omitempty"` VulnerabilityAlerts *string `json:"vulnerability_alerts,omitempty"` + Watching *string `json:"watching,omitempty"` Workflows *string `json:"workflows,omitempty"` } diff --git a/github/github-accessors.go b/github/github-accessors.go index 0782ba2f326..7fa93d8ae97 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -9366,6 +9366,14 @@ func (i *InstallationPermissions) GetAdministration() string { return *i.Administration } +// GetAttestations returns the Attestations field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetAttestations() string { + if i == nil || i.Attestations == nil { + return "" + } + return *i.Attestations +} + // GetBlocking returns the Blocking field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetBlocking() string { if i == nil || i.Blocking == nil { @@ -9414,6 +9422,14 @@ func (i *InstallationPermissions) GetCodespacesSecrets() string { return *i.CodespacesSecrets } +// GetCodespacesUserSecrets returns the CodespacesUserSecrets field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetCodespacesUserSecrets() string { + if i == nil || i.CodespacesUserSecrets == nil { + return "" + } + return *i.CodespacesUserSecrets +} + // GetContentReferences returns the ContentReferences field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetContentReferences() string { if i == nil || i.ContentReferences == nil { @@ -9430,6 +9446,14 @@ func (i *InstallationPermissions) GetContents() string { return *i.Contents } +// GetCopilotMessages returns the CopilotMessages field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetCopilotMessages() string { + if i == nil || i.CopilotMessages == nil { + return "" + } + return *i.CopilotMessages +} + // GetDependabotSecrets returns the DependabotSecrets field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetDependabotSecrets() string { if i == nil || i.DependabotSecrets == nil { @@ -9478,6 +9502,38 @@ func (i *InstallationPermissions) GetFollowers() string { return *i.Followers } +// GetGists returns the Gists field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetGists() string { + if i == nil || i.Gists == nil { + return "" + } + return *i.Gists +} + +// GetGitSigningSSHPublicKeys returns the GitSigningSSHPublicKeys field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetGitSigningSSHPublicKeys() string { + if i == nil || i.GitSigningSSHPublicKeys == nil { + return "" + } + return *i.GitSigningSSHPublicKeys +} + +// GetGPGKeys returns the GPGKeys field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetGPGKeys() string { + if i == nil || i.GPGKeys == nil { + return "" + } + return *i.GPGKeys +} + +// GetInteractionLimits returns the InteractionLimits field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetInteractionLimits() string { + if i == nil || i.InteractionLimits == nil { + return "" + } + return *i.InteractionLimits +} + // GetIssues returns the Issues field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetIssues() string { if i == nil || i.Issues == nil { @@ -9486,6 +9542,14 @@ func (i *InstallationPermissions) GetIssues() string { return *i.Issues } +// GetKeys returns the Keys field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetKeys() string { + if i == nil || i.Keys == nil { + return "" + } + return *i.Keys +} + // GetMembers returns the Members field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetMembers() string { if i == nil || i.Members == nil { @@ -9510,6 +9574,14 @@ func (i *InstallationPermissions) GetMetadata() string { return *i.Metadata } +// GetOrganizationActionsVariables returns the OrganizationActionsVariables field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetOrganizationActionsVariables() string { + if i == nil || i.OrganizationActionsVariables == nil { + return "" + } + return *i.OrganizationActionsVariables +} + // GetOrganizationAdministration returns the OrganizationAdministration field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetOrganizationAdministration() string { if i == nil || i.OrganizationAdministration == nil { @@ -9518,6 +9590,54 @@ func (i *InstallationPermissions) GetOrganizationAdministration() string { return *i.OrganizationAdministration } +// GetOrganizationAnnouncementBanners returns the OrganizationAnnouncementBanners field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetOrganizationAnnouncementBanners() string { + if i == nil || i.OrganizationAnnouncementBanners == nil { + return "" + } + return *i.OrganizationAnnouncementBanners +} + +// GetOrganizationAPIInsights returns the OrganizationAPIInsights field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetOrganizationAPIInsights() string { + if i == nil || i.OrganizationAPIInsights == nil { + return "" + } + return *i.OrganizationAPIInsights +} + +// GetOrganizationCodespaces returns the OrganizationCodespaces field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetOrganizationCodespaces() string { + if i == nil || i.OrganizationCodespaces == nil { + return "" + } + return *i.OrganizationCodespaces +} + +// GetOrganizationCodespacesSecrets returns the OrganizationCodespacesSecrets field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetOrganizationCodespacesSecrets() string { + if i == nil || i.OrganizationCodespacesSecrets == nil { + return "" + } + return *i.OrganizationCodespacesSecrets +} + +// GetOrganizationCodespacesSettings returns the OrganizationCodespacesSettings field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetOrganizationCodespacesSettings() string { + if i == nil || i.OrganizationCodespacesSettings == nil { + return "" + } + return *i.OrganizationCodespacesSettings +} + +// GetOrganizationCopilotSeatManagement returns the OrganizationCopilotSeatManagement field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetOrganizationCopilotSeatManagement() string { + if i == nil || i.OrganizationCopilotSeatManagement == nil { + return "" + } + return *i.OrganizationCopilotSeatManagement +} + // GetOrganizationCustomOrgRoles returns the OrganizationCustomOrgRoles field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetOrganizationCustomOrgRoles() string { if i == nil || i.OrganizationCustomOrgRoles == nil { @@ -9542,6 +9662,22 @@ func (i *InstallationPermissions) GetOrganizationCustomRoles() string { return *i.OrganizationCustomRoles } +// GetOrganizationDependabotSecrets returns the OrganizationDependabotSecrets field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetOrganizationDependabotSecrets() string { + if i == nil || i.OrganizationDependabotSecrets == nil { + return "" + } + return *i.OrganizationDependabotSecrets +} + +// GetOrganizationEvents returns the OrganizationEvents field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetOrganizationEvents() string { + if i == nil || i.OrganizationEvents == nil { + return "" + } + return *i.OrganizationEvents +} + // GetOrganizationHooks returns the OrganizationHooks field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetOrganizationHooks() string { if i == nil || i.OrganizationHooks == nil { @@ -9550,6 +9686,14 @@ func (i *InstallationPermissions) GetOrganizationHooks() string { return *i.OrganizationHooks } +// GetOrganizationKnowledgeBases returns the OrganizationKnowledgeBases field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetOrganizationKnowledgeBases() string { + if i == nil || i.OrganizationKnowledgeBases == nil { + return "" + } + return *i.OrganizationKnowledgeBases +} + // GetOrganizationPackages returns the OrganizationPackages field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetOrganizationPackages() string { if i == nil || i.OrganizationPackages == nil { @@ -9638,6 +9782,22 @@ func (i *InstallationPermissions) GetPages() string { return *i.Pages } +// GetPlan returns the Plan field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetPlan() string { + if i == nil || i.Plan == nil { + return "" + } + return *i.Plan +} + +// GetProfile returns the Profile field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetProfile() string { + if i == nil || i.Profile == nil { + return "" + } + return *i.Profile +} + // GetPullRequests returns the PullRequests field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetPullRequests() string { if i == nil || i.PullRequests == nil { @@ -9718,6 +9878,14 @@ func (i *InstallationPermissions) GetSingleFile() string { return *i.SingleFile } +// GetStarring returns the Starring field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetStarring() string { + if i == nil || i.Starring == nil { + return "" + } + return *i.Starring +} + // GetStatuses returns the Statuses field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetStatuses() string { if i == nil || i.Statuses == nil { @@ -9734,6 +9902,14 @@ func (i *InstallationPermissions) GetTeamDiscussions() string { return *i.TeamDiscussions } +// GetUserEvents returns the UserEvents field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetUserEvents() string { + if i == nil || i.UserEvents == nil { + return "" + } + return *i.UserEvents +} + // GetVulnerabilityAlerts returns the VulnerabilityAlerts field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetVulnerabilityAlerts() string { if i == nil || i.VulnerabilityAlerts == nil { @@ -9742,6 +9918,14 @@ func (i *InstallationPermissions) GetVulnerabilityAlerts() string { return *i.VulnerabilityAlerts } +// GetWatching returns the Watching field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetWatching() string { + if i == nil || i.Watching == nil { + return "" + } + return *i.Watching +} + // GetWorkflows returns the Workflows field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetWorkflows() string { if i == nil || i.Workflows == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index b0a96dea810..51c4f86142d 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -12115,6 +12115,17 @@ func TestInstallationPermissions_GetAdministration(tt *testing.T) { i.GetAdministration() } +func TestInstallationPermissions_GetAttestations(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &InstallationPermissions{Attestations: &zeroValue} + i.GetAttestations() + i = &InstallationPermissions{} + i.GetAttestations() + i = nil + i.GetAttestations() +} + func TestInstallationPermissions_GetBlocking(tt *testing.T) { tt.Parallel() var zeroValue string @@ -12181,6 +12192,17 @@ func TestInstallationPermissions_GetCodespacesSecrets(tt *testing.T) { i.GetCodespacesSecrets() } +func TestInstallationPermissions_GetCodespacesUserSecrets(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &InstallationPermissions{CodespacesUserSecrets: &zeroValue} + i.GetCodespacesUserSecrets() + i = &InstallationPermissions{} + i.GetCodespacesUserSecrets() + i = nil + i.GetCodespacesUserSecrets() +} + func TestInstallationPermissions_GetContentReferences(tt *testing.T) { tt.Parallel() var zeroValue string @@ -12203,6 +12225,17 @@ func TestInstallationPermissions_GetContents(tt *testing.T) { i.GetContents() } +func TestInstallationPermissions_GetCopilotMessages(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &InstallationPermissions{CopilotMessages: &zeroValue} + i.GetCopilotMessages() + i = &InstallationPermissions{} + i.GetCopilotMessages() + i = nil + i.GetCopilotMessages() +} + func TestInstallationPermissions_GetDependabotSecrets(tt *testing.T) { tt.Parallel() var zeroValue string @@ -12269,6 +12302,50 @@ func TestInstallationPermissions_GetFollowers(tt *testing.T) { i.GetFollowers() } +func TestInstallationPermissions_GetGists(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &InstallationPermissions{Gists: &zeroValue} + i.GetGists() + i = &InstallationPermissions{} + i.GetGists() + i = nil + i.GetGists() +} + +func TestInstallationPermissions_GetGitSigningSSHPublicKeys(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &InstallationPermissions{GitSigningSSHPublicKeys: &zeroValue} + i.GetGitSigningSSHPublicKeys() + i = &InstallationPermissions{} + i.GetGitSigningSSHPublicKeys() + i = nil + i.GetGitSigningSSHPublicKeys() +} + +func TestInstallationPermissions_GetGPGKeys(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &InstallationPermissions{GPGKeys: &zeroValue} + i.GetGPGKeys() + i = &InstallationPermissions{} + i.GetGPGKeys() + i = nil + i.GetGPGKeys() +} + +func TestInstallationPermissions_GetInteractionLimits(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &InstallationPermissions{InteractionLimits: &zeroValue} + i.GetInteractionLimits() + i = &InstallationPermissions{} + i.GetInteractionLimits() + i = nil + i.GetInteractionLimits() +} + func TestInstallationPermissions_GetIssues(tt *testing.T) { tt.Parallel() var zeroValue string @@ -12280,6 +12357,17 @@ func TestInstallationPermissions_GetIssues(tt *testing.T) { i.GetIssues() } +func TestInstallationPermissions_GetKeys(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &InstallationPermissions{Keys: &zeroValue} + i.GetKeys() + i = &InstallationPermissions{} + i.GetKeys() + i = nil + i.GetKeys() +} + func TestInstallationPermissions_GetMembers(tt *testing.T) { tt.Parallel() var zeroValue string @@ -12313,6 +12401,17 @@ func TestInstallationPermissions_GetMetadata(tt *testing.T) { i.GetMetadata() } +func TestInstallationPermissions_GetOrganizationActionsVariables(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &InstallationPermissions{OrganizationActionsVariables: &zeroValue} + i.GetOrganizationActionsVariables() + i = &InstallationPermissions{} + i.GetOrganizationActionsVariables() + i = nil + i.GetOrganizationActionsVariables() +} + func TestInstallationPermissions_GetOrganizationAdministration(tt *testing.T) { tt.Parallel() var zeroValue string @@ -12324,6 +12423,72 @@ func TestInstallationPermissions_GetOrganizationAdministration(tt *testing.T) { i.GetOrganizationAdministration() } +func TestInstallationPermissions_GetOrganizationAnnouncementBanners(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &InstallationPermissions{OrganizationAnnouncementBanners: &zeroValue} + i.GetOrganizationAnnouncementBanners() + i = &InstallationPermissions{} + i.GetOrganizationAnnouncementBanners() + i = nil + i.GetOrganizationAnnouncementBanners() +} + +func TestInstallationPermissions_GetOrganizationAPIInsights(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &InstallationPermissions{OrganizationAPIInsights: &zeroValue} + i.GetOrganizationAPIInsights() + i = &InstallationPermissions{} + i.GetOrganizationAPIInsights() + i = nil + i.GetOrganizationAPIInsights() +} + +func TestInstallationPermissions_GetOrganizationCodespaces(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &InstallationPermissions{OrganizationCodespaces: &zeroValue} + i.GetOrganizationCodespaces() + i = &InstallationPermissions{} + i.GetOrganizationCodespaces() + i = nil + i.GetOrganizationCodespaces() +} + +func TestInstallationPermissions_GetOrganizationCodespacesSecrets(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &InstallationPermissions{OrganizationCodespacesSecrets: &zeroValue} + i.GetOrganizationCodespacesSecrets() + i = &InstallationPermissions{} + i.GetOrganizationCodespacesSecrets() + i = nil + i.GetOrganizationCodespacesSecrets() +} + +func TestInstallationPermissions_GetOrganizationCodespacesSettings(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &InstallationPermissions{OrganizationCodespacesSettings: &zeroValue} + i.GetOrganizationCodespacesSettings() + i = &InstallationPermissions{} + i.GetOrganizationCodespacesSettings() + i = nil + i.GetOrganizationCodespacesSettings() +} + +func TestInstallationPermissions_GetOrganizationCopilotSeatManagement(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &InstallationPermissions{OrganizationCopilotSeatManagement: &zeroValue} + i.GetOrganizationCopilotSeatManagement() + i = &InstallationPermissions{} + i.GetOrganizationCopilotSeatManagement() + i = nil + i.GetOrganizationCopilotSeatManagement() +} + func TestInstallationPermissions_GetOrganizationCustomOrgRoles(tt *testing.T) { tt.Parallel() var zeroValue string @@ -12357,6 +12522,28 @@ func TestInstallationPermissions_GetOrganizationCustomRoles(tt *testing.T) { i.GetOrganizationCustomRoles() } +func TestInstallationPermissions_GetOrganizationDependabotSecrets(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &InstallationPermissions{OrganizationDependabotSecrets: &zeroValue} + i.GetOrganizationDependabotSecrets() + i = &InstallationPermissions{} + i.GetOrganizationDependabotSecrets() + i = nil + i.GetOrganizationDependabotSecrets() +} + +func TestInstallationPermissions_GetOrganizationEvents(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &InstallationPermissions{OrganizationEvents: &zeroValue} + i.GetOrganizationEvents() + i = &InstallationPermissions{} + i.GetOrganizationEvents() + i = nil + i.GetOrganizationEvents() +} + func TestInstallationPermissions_GetOrganizationHooks(tt *testing.T) { tt.Parallel() var zeroValue string @@ -12368,6 +12555,17 @@ func TestInstallationPermissions_GetOrganizationHooks(tt *testing.T) { i.GetOrganizationHooks() } +func TestInstallationPermissions_GetOrganizationKnowledgeBases(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &InstallationPermissions{OrganizationKnowledgeBases: &zeroValue} + i.GetOrganizationKnowledgeBases() + i = &InstallationPermissions{} + i.GetOrganizationKnowledgeBases() + i = nil + i.GetOrganizationKnowledgeBases() +} + func TestInstallationPermissions_GetOrganizationPackages(tt *testing.T) { tt.Parallel() var zeroValue string @@ -12489,6 +12687,28 @@ func TestInstallationPermissions_GetPages(tt *testing.T) { i.GetPages() } +func TestInstallationPermissions_GetPlan(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &InstallationPermissions{Plan: &zeroValue} + i.GetPlan() + i = &InstallationPermissions{} + i.GetPlan() + i = nil + i.GetPlan() +} + +func TestInstallationPermissions_GetProfile(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &InstallationPermissions{Profile: &zeroValue} + i.GetProfile() + i = &InstallationPermissions{} + i.GetProfile() + i = nil + i.GetProfile() +} + func TestInstallationPermissions_GetPullRequests(tt *testing.T) { tt.Parallel() var zeroValue string @@ -12599,6 +12819,17 @@ func TestInstallationPermissions_GetSingleFile(tt *testing.T) { i.GetSingleFile() } +func TestInstallationPermissions_GetStarring(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &InstallationPermissions{Starring: &zeroValue} + i.GetStarring() + i = &InstallationPermissions{} + i.GetStarring() + i = nil + i.GetStarring() +} + func TestInstallationPermissions_GetStatuses(tt *testing.T) { tt.Parallel() var zeroValue string @@ -12621,6 +12852,17 @@ func TestInstallationPermissions_GetTeamDiscussions(tt *testing.T) { i.GetTeamDiscussions() } +func TestInstallationPermissions_GetUserEvents(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &InstallationPermissions{UserEvents: &zeroValue} + i.GetUserEvents() + i = &InstallationPermissions{} + i.GetUserEvents() + i = nil + i.GetUserEvents() +} + func TestInstallationPermissions_GetVulnerabilityAlerts(tt *testing.T) { tt.Parallel() var zeroValue string @@ -12632,6 +12874,17 @@ func TestInstallationPermissions_GetVulnerabilityAlerts(tt *testing.T) { i.GetVulnerabilityAlerts() } +func TestInstallationPermissions_GetWatching(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &InstallationPermissions{Watching: &zeroValue} + i.GetWatching() + i = &InstallationPermissions{} + i.GetWatching() + i = nil + i.GetWatching() +} + func TestInstallationPermissions_GetWorkflows(tt *testing.T) { tt.Parallel() var zeroValue string From cea0bba46cd1df7668793ca6a28e0ca65727e533 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 16:30:40 -0500 Subject: [PATCH 576/751] build(deps): bump github.com/alecthomas/kong from 1.4.0 to 1.5.0 in /tools (#3365) --- tools/go.mod | 2 +- tools/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index 4453e721a9d..22b2d690486 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -5,7 +5,7 @@ go 1.21 toolchain go1.22.0 require ( - github.com/alecthomas/kong v1.4.0 + github.com/alecthomas/kong v1.5.0 github.com/getkin/kin-openapi v0.128.0 github.com/google/go-cmp v0.6.0 github.com/google/go-github/v67 v67.0.0 diff --git a/tools/go.sum b/tools/go.sum index 1ab04c7e250..2553038b92a 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -1,7 +1,7 @@ github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0= github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= -github.com/alecthomas/kong v1.4.0 h1:UL7tzGMnnY0YRMMvJyITIRX1EpO6RbBRZDNcCevy3HA= -github.com/alecthomas/kong v1.4.0/go.mod h1:p2vqieVMeTAnaC83txKtXe8FLke2X07aruPWXyMPQrU= +github.com/alecthomas/kong v1.5.0 h1:pvJ7ucmgyBrGcdHVYD3xc9rqbcnVNRQ63mYv6KNrwYs= +github.com/alecthomas/kong v1.5.0/go.mod h1:p2vqieVMeTAnaC83txKtXe8FLke2X07aruPWXyMPQrU= github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc= github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= From f0bfdaf2a8a33adad790b4e103f3c61081a4b760 Mon Sep 17 00:00:00 2001 From: Silas Alberti Date: Sun, 8 Dec 2024 04:44:24 -0800 Subject: [PATCH 577/751] fix: Preserve HTTP Response in URL Errors (#3369) Fixes: #3362. --- github/github.go | 13 ++++++++----- github/github_test.go | 45 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 5 deletions(-) diff --git a/github/github.go b/github/github.go index 6f476353473..4f94f2481a4 100644 --- a/github/github.go +++ b/github/github.go @@ -841,12 +841,17 @@ func (c *Client) BareDo(ctx context.Context, req *http.Request) (*Response, erro } resp, err := c.client.Do(req) + var response *Response + if resp != nil { + response = newResponse(resp) + } + if err != nil { // If we got an error, and the context has been canceled, // the context's error is probably more useful. select { case <-ctx.Done(): - return nil, ctx.Err() + return response, ctx.Err() default: } @@ -854,15 +859,13 @@ func (c *Client) BareDo(ctx context.Context, req *http.Request) (*Response, erro if e, ok := err.(*url.Error); ok { if url, err := url.Parse(e.URL); err == nil { e.URL = sanitizeURL(url).String() - return nil, e + return response, e } } - return nil, err + return response, err } - response := newResponse(resp) - // Don't update the rate limits if this was a cached response. // X-From-Cache is set by https://github.com/gregjones/httpcache if response.Header.Get("X-From-Cache") == "" { diff --git a/github/github_test.go b/github/github_test.go index 73afa2d1968..48ac2ab26e5 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -1106,6 +1106,51 @@ func TestDo_redirectLoop(t *testing.T) { } } +func TestDo_preservesResponseInHTTPError(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusNotFound) + fmt.Fprintf(w, `{ + "message": "Resource not found", + "documentation_url": "https://docs.github.com/rest/reference/repos#get-a-repository" + }`) + }) + + req, _ := client.NewRequest("GET", ".", nil) + var resp *Response + var data interface{} + resp, err := client.Do(context.Background(), req, &data) + + if err == nil { + t.Fatal("Expected error response") + } + + // Verify error type and access to status code + errResp, ok := err.(*ErrorResponse) + if !ok { + t.Fatalf("Expected *ErrorResponse error, got %T", err) + } + + // Verify status code is accessible from both Response and ErrorResponse + if resp == nil { + t.Fatal("Expected response to be returned even with error") + } + if got, want := resp.StatusCode, http.StatusNotFound; got != want { + t.Errorf("Response status = %d, want %d", got, want) + } + if got, want := errResp.Response.StatusCode, http.StatusNotFound; got != want { + t.Errorf("Error response status = %d, want %d", got, want) + } + + // Verify error contains proper message + if !strings.Contains(errResp.Message, "Resource not found") { + t.Errorf("Error message = %q, want to contain 'Resource not found'", errResp.Message) + } +} + // Test that an error caused by the internal http client's Do() function // does not leak the client secret. func TestDo_sanitizeURL(t *testing.T) { From d08d35e0d5a189753a59e64e090fc84f0c2965f6 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Mon, 9 Dec 2024 11:05:03 -0500 Subject: [PATCH 578/751] Update OpenAPI (#3374) --- openapi_operations.yaml | 122 ++++++++++++++++++++++++++++++++-------- 1 file changed, 98 insertions(+), 24 deletions(-) diff --git a/openapi_operations.yaml b/openapi_operations.yaml index 65a8ef0aafb..3539219e2ab 100644 --- a/openapi_operations.yaml +++ b/openapi_operations.yaml @@ -47,7 +47,7 @@ operation_overrides: documentation_url: https://docs.github.com/rest/pages/pages#request-a-github-pages-build - name: GET /repos/{owner}/{repo}/pages/builds/{build_id} documentation_url: https://docs.github.com/rest/pages/pages#get-github-pages-build -openapi_commit: a0508cecd18ab26b525527e4ba35bd9c6d725c4f +openapi_commit: 4ab8513682637010cd3bb5d8ee3227cc5ce739d1 openapi_operations: - name: GET / documentation_url: https://docs.github.com/rest/meta/meta#github-api-root @@ -700,6 +700,30 @@ openapi_operations: openapi_files: - descriptions/ghec/ghec.json - descriptions/ghes-3.15/ghes-3.15.json + - name: GET /enterprises/{enterprise}/audit-log/stream-key + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#get-the-audit-log-stream-key-for-encrypting-secrets + openapi_files: + - descriptions/ghec/ghec.json + - name: GET /enterprises/{enterprise}/audit-log/streams + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#list-audit-log-stream-configurations-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - name: POST /enterprises/{enterprise}/audit-log/streams + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#create-an-audit-log-streaming-configuration-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - name: DELETE /enterprises/{enterprise}/audit-log/streams/{stream_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#delete-an-audit-log-streaming-configuration-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - name: GET /enterprises/{enterprise}/audit-log/streams/{stream_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#list-one-audit-log-streaming-configuration-via-a-stream-id + openapi_files: + - descriptions/ghec/ghec.json + - name: PUT /enterprises/{enterprise}/audit-log/streams/{stream_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#update-an-existing-audit-log-stream-configuration + openapi_files: + - descriptions/ghec/ghec.json - name: GET /enterprises/{enterprise}/code-scanning/alerts documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-enterprise openapi_files: @@ -744,6 +768,26 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/license#get-a-license-sync-status openapi_files: - descriptions/ghec/ghec.json + - name: GET /enterprises/{enterprise}/properties/schema + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/custom-properties#get-custom-properties-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - name: PATCH /enterprises/{enterprise}/properties/schema + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/custom-properties#create-or-update-custom-properties-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - name: DELETE /enterprises/{enterprise}/properties/schema/{custom_property_name} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/custom-properties#remove-a-custom-property-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - name: GET /enterprises/{enterprise}/properties/schema/{custom_property_name} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/custom-properties#get-a-custom-property-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - name: PUT /enterprises/{enterprise}/properties/schema/{custom_property_name} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/custom-properties#create-or-update-a-custom-property-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json - name: GET /enterprises/{enterprise}/secret-scanning/alerts documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-enterprise openapi_files: @@ -999,7 +1043,7 @@ openapi_operations: openapi_files: - descriptions/ghes-3.15/ghes-3.15.json - name: POST /manage/v1/config/init - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#initialize-instance-configuration-with-license-upload + documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#initialize-instance-configuration-with-license-and-password openapi_files: - descriptions/ghes-3.15/ghes-3.15.json - name: GET /manage/v1/config/license @@ -1161,6 +1205,11 @@ openapi_operations: openapi_files: - descriptions/ghec/ghec.json - descriptions/ghes-3.15/ghes-3.15.json + - name: GET /organizations/{org}/settings/billing/usage + documentation_url: https://docs.github.com/rest/billing/enhanced-billing#get-billing-usage-report-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: DELETE /orgs/{org} documentation_url: https://docs.github.com/rest/orgs/orgs#delete-an-organization openapi_files: @@ -4723,6 +4772,26 @@ openapi_operations: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.15/ghes-3.15.json + - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue + documentation_url: https://docs.github.com/rest/issues/sub-issues#remove-sub-issue + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues + documentation_url: https://docs.github.com/rest/issues/sub-issues#list-sub-issues + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues + documentation_url: https://docs.github.com/rest/issues/sub-issues#add-sub-issue + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority + documentation_url: https://docs.github.com/rest/issues/sub-issues#reprioritize-sub-issue + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/timeline documentation_url: https://docs.github.com/rest/issues/timeline#list-timeline-events-for-an-issue openapi_files: @@ -5370,6 +5439,11 @@ openapi_operations: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.15/ghes-3.15.json + - name: GET /repos/{owner}/{repo}/secret-scanning/scan-history + documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#get-secret-scanning-scan-history-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /repos/{owner}/{repo}/security-advisories documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories openapi_files: @@ -5776,49 +5850,49 @@ openapi_operations: - descriptions/ghec/ghec.json - descriptions/ghes-3.15/ghes-3.15.json - name: GET /setup/api/configcheck - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/management-console#get-the-configuration-status + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#get-the-configuration-status openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /setup/api/configure - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/management-console#start-a-configuration-process + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#start-a-configuration-process openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /setup/api/maintenance - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/management-console#get-the-maintenance-status + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#get-the-maintenance-status openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /setup/api/maintenance - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/management-console#enable-or-disable-maintenance-mode + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#enable-or-disable-maintenance-mode openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /setup/api/settings - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/management-console#get-settings + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#get-settings openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.14/ghes-3.14.json - name: PUT /setup/api/settings - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/management-console#set-settings + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#set-settings openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /setup/api/settings/authorized-keys - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/management-console#remove-an-authorized-ssh-key + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#remove-an-authorized-ssh-key openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.14/ghes-3.14.json - name: GET /setup/api/settings/authorized-keys - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/management-console#get-all-authorized-ssh-keys + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#get-all-authorized-ssh-keys openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /setup/api/settings/authorized-keys - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/management-console#add-an-authorized-ssh-key + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#add-an-authorized-ssh-key openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /setup/api/start - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/management-console#create-a-github-license + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#create-a-github-license openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.14/ghes-3.14.json - name: POST /setup/api/upgrade - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/management-console#upgrade-a-license + documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#upgrade-a-license openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.14/ghes-3.14.json - name: DELETE /teams/{team_id} documentation_url: https://docs.github.com/rest/teams/teams#delete-a-team-legacy openapi_files: From 1616008c748c482ac58150b58788f90996b451de Mon Sep 17 00:00:00 2001 From: Steve Hipwell Date: Mon, 9 Dec 2024 22:31:28 +0000 Subject: [PATCH 579/751] feat: Add assignment for org role associations (#3371) Fixes: #3364. --- github/github-accessors.go | 24 ++++++++++++++++++++++++ github/github-accessors_test.go | 30 ++++++++++++++++++++++++++++++ github/github-stringify_test.go | 7 +++++-- github/teams.go | 13 +++++++++---- github/users.go | 8 ++++++++ 5 files changed, 76 insertions(+), 6 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 7fa93d8ae97..db906dab624 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -24358,6 +24358,14 @@ func (t *TaskStep) GetStatus() string { return *t.Status } +// GetAssignment returns the Assignment field if it's non-nil, zero value otherwise. +func (t *Team) GetAssignment() string { + if t == nil || t.Assignment == nil { + return "" + } + return *t.Assignment +} + // GetDescription returns the Description field if it's non-nil, zero value otherwise. func (t *Team) GetDescription() string { if t == nil || t.Description == nil { @@ -25654,6 +25662,14 @@ func (u *UpdateRunnerGroupRequest) GetVisibility() string { return *u.Visibility } +// GetAssignment returns the Assignment field if it's non-nil, zero value otherwise. +func (u *User) GetAssignment() string { + if u == nil || u.Assignment == nil { + return "" + } + return *u.Assignment +} + // GetAvatarURL returns the AvatarURL field if it's non-nil, zero value otherwise. func (u *User) GetAvatarURL() string { if u == nil || u.AvatarURL == nil { @@ -25798,6 +25814,14 @@ func (u *User) GetID() int64 { return *u.ID } +// GetInheritedFrom returns the InheritedFrom field. +func (u *User) GetInheritedFrom() *Team { + if u == nil { + return nil + } + return u.InheritedFrom +} + // GetLdapDn returns the LdapDn field if it's non-nil, zero value otherwise. func (u *User) GetLdapDn() string { if u == nil || u.LdapDn == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 51c4f86142d..67b833a67b5 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -31190,6 +31190,17 @@ func TestTaskStep_GetStatus(tt *testing.T) { t.GetStatus() } +func TestTeam_GetAssignment(tt *testing.T) { + tt.Parallel() + var zeroValue string + t := &Team{Assignment: &zeroValue} + t.GetAssignment() + t = &Team{} + t.GetAssignment() + t = nil + t.GetAssignment() +} + func TestTeam_GetDescription(tt *testing.T) { tt.Parallel() var zeroValue string @@ -32858,6 +32869,17 @@ func TestUpdateRunnerGroupRequest_GetVisibility(tt *testing.T) { u.GetVisibility() } +func TestUser_GetAssignment(tt *testing.T) { + tt.Parallel() + var zeroValue string + u := &User{Assignment: &zeroValue} + u.GetAssignment() + u = &User{} + u.GetAssignment() + u = nil + u.GetAssignment() +} + func TestUser_GetAvatarURL(tt *testing.T) { tt.Parallel() var zeroValue string @@ -33056,6 +33078,14 @@ func TestUser_GetID(tt *testing.T) { u.GetID() } +func TestUser_GetInheritedFrom(tt *testing.T) { + tt.Parallel() + u := &User{} + u.GetInheritedFrom() + u = nil + u.GetInheritedFrom() +} + func TestUser_GetLdapDn(tt *testing.T) { tt.Parallel() var zeroValue string diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index d311b87f337..7ffee278d13 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -1974,8 +1974,9 @@ func TestTeam_String(t *testing.T) { RepositoriesURL: String(""), Parent: &Team{}, LDAPDN: String(""), + Assignment: String(""), } - want := `github.Team{ID:0, NodeID:"", Name:"", Description:"", URL:"", Slug:"", Permission:"", Privacy:"", MembersCount:0, ReposCount:0, Organization:github.Organization{}, HTMLURL:"", MembersURL:"", RepositoriesURL:"", Parent:github.Team{}, LDAPDN:""}` + want := `github.Team{ID:0, NodeID:"", Name:"", Description:"", URL:"", Slug:"", Permission:"", Privacy:"", MembersCount:0, ReposCount:0, Organization:github.Organization{}, HTMLURL:"", MembersURL:"", RepositoriesURL:"", Parent:github.Team{}, LDAPDN:"", Assignment:""}` if got := v.String(); got != want { t.Errorf("Team.String = %v, want %v", got, want) } @@ -2117,8 +2118,10 @@ func TestUser_String(t *testing.T) { StarredURL: String(""), SubscriptionsURL: String(""), RoleName: String(""), + Assignment: String(""), + InheritedFrom: &Team{}, } - want := `github.User{Login:"", ID:0, NodeID:"", AvatarURL:"", HTMLURL:"", GravatarID:"", Name:"", Company:"", Blog:"", Location:"", Email:"", Hireable:false, Bio:"", TwitterUsername:"", PublicRepos:0, PublicGists:0, Followers:0, Following:0, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, SuspendedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Type:"", SiteAdmin:false, TotalPrivateRepos:0, OwnedPrivateRepos:0, PrivateGists:0, DiskUsage:0, Collaborators:0, TwoFactorAuthentication:false, Plan:github.Plan{}, LdapDn:"", URL:"", EventsURL:"", FollowingURL:"", FollowersURL:"", GistsURL:"", OrganizationsURL:"", ReceivedEventsURL:"", ReposURL:"", StarredURL:"", SubscriptionsURL:"", RoleName:""}` + want := `github.User{Login:"", ID:0, NodeID:"", AvatarURL:"", HTMLURL:"", GravatarID:"", Name:"", Company:"", Blog:"", Location:"", Email:"", Hireable:false, Bio:"", TwitterUsername:"", PublicRepos:0, PublicGists:0, Followers:0, Following:0, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, SuspendedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Type:"", SiteAdmin:false, TotalPrivateRepos:0, OwnedPrivateRepos:0, PrivateGists:0, DiskUsage:0, Collaborators:0, TwoFactorAuthentication:false, Plan:github.Plan{}, LdapDn:"", URL:"", EventsURL:"", FollowingURL:"", FollowersURL:"", GistsURL:"", OrganizationsURL:"", ReceivedEventsURL:"", ReposURL:"", StarredURL:"", SubscriptionsURL:"", RoleName:"", Assignment:"", InheritedFrom:github.Team{}}` if got := v.String(); got != want { t.Errorf("User.String = %v, want %v", got, want) } diff --git a/github/teams.go b/github/teams.go index df248b65404..651c2514654 100644 --- a/github/teams.go +++ b/github/teams.go @@ -30,10 +30,6 @@ type Team struct { // Permission specifies the default permission for repositories owned by the team. Permission *string `json:"permission,omitempty"` - // Permissions identifies the permissions that a team has on a given - // repository. This is only populated when calling Repositories.ListTeams. - Permissions map[string]bool `json:"permissions,omitempty"` - // Privacy identifies the level of privacy this team should have. // Possible values are: // secret - only visible to organization owners and members of this team @@ -52,6 +48,15 @@ type Team struct { // LDAPDN is only available in GitHub Enterprise and when the team // membership is synchronized with LDAP. LDAPDN *string `json:"ldap_dn,omitempty"` + + // Permissions identifies the permissions that a team has on a given + // repository. This is only populated when calling Repositories.ListTeams. + Permissions map[string]bool `json:"permissions,omitempty"` + + // Assignment identifies how a team was assigned to an organization role. Its + // possible values are: "direct", "indirect", "mixed". This is only populated when + // calling the ListTeamsAssignedToOrgRole method. + Assignment *string `json:"assignment,omitempty"` } func (t Team) String() string { diff --git a/github/users.go b/github/users.go index c1ab5552477..60f1e06a694 100644 --- a/github/users.go +++ b/github/users.go @@ -70,6 +70,14 @@ type User struct { // repository. These are only populated when calling Repositories.ListCollaborators. Permissions map[string]bool `json:"permissions,omitempty"` RoleName *string `json:"role_name,omitempty"` + + // Assignment identifies how a user was assigned to an organization role. Its + // possible values are: "direct", "indirect", "mixed". This is only populated when + // calling the ListUsersAssignedToOrgRole method. + Assignment *string `json:"assignment,omitempty"` + // InheritedFrom identifies the team that a user inherited their organization role + // from. This is only populated when calling the ListUsersAssignedToOrgRole method. + InheritedFrom *Team `json:"inherited_from,omitempty"` } func (u User) String() string { From d1ffbe3c0a3f11156241c2114846f9078d8e75b2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 17:36:09 -0500 Subject: [PATCH 580/751] build(deps): bump codecov/codecov-action from 5.0.7 to 5.1.1 (#3375) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fb3cfb88819..7329a51bab8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -73,4 +73,4 @@ jobs: - name: Upload coverage to Codecov if: ${{ matrix.update-coverage }} - uses: codecov/codecov-action@015f24e6818733317a2da2edd6290ab26238649a #v5.0.7 + uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e #v5.1.1 From 54fde31c78a7a22cd7ac54d9a9048f787bcee364 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 17:36:47 -0500 Subject: [PATCH 581/751] build(deps): bump github.com/alecthomas/kong from 1.5.0 to 1.6.0 in /tools (#3376) --- tools/go.mod | 2 +- tools/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index 22b2d690486..d0709d9936a 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -5,7 +5,7 @@ go 1.21 toolchain go1.22.0 require ( - github.com/alecthomas/kong v1.5.0 + github.com/alecthomas/kong v1.6.0 github.com/getkin/kin-openapi v0.128.0 github.com/google/go-cmp v0.6.0 github.com/google/go-github/v67 v67.0.0 diff --git a/tools/go.sum b/tools/go.sum index 2553038b92a..dc0e5f286f7 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -1,7 +1,7 @@ github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0= github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= -github.com/alecthomas/kong v1.5.0 h1:pvJ7ucmgyBrGcdHVYD3xc9rqbcnVNRQ63mYv6KNrwYs= -github.com/alecthomas/kong v1.5.0/go.mod h1:p2vqieVMeTAnaC83txKtXe8FLke2X07aruPWXyMPQrU= +github.com/alecthomas/kong v1.6.0 h1:mwOzbdMR7uv2vul9J0FU3GYxE7ls/iX1ieMg5WIM6gE= +github.com/alecthomas/kong v1.6.0/go.mod h1:p2vqieVMeTAnaC83txKtXe8FLke2X07aruPWXyMPQrU= github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc= github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= From 0eaaa9700097a0426439644f683e1c6d09ca2ef1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 17:37:18 -0500 Subject: [PATCH 582/751] build(deps): bump golang.org/x/sync from 0.9.0 to 0.10.0 in /tools (#3377) --- tools/go.mod | 2 +- tools/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index d0709d9936a..092dd8e85ef 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -9,7 +9,7 @@ require ( github.com/getkin/kin-openapi v0.128.0 github.com/google/go-cmp v0.6.0 github.com/google/go-github/v67 v67.0.0 - golang.org/x/sync v0.9.0 + golang.org/x/sync v0.10.0 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/tools/go.sum b/tools/go.sum index dc0e5f286f7..74e159fa447 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -43,8 +43,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= -golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= -golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= From e659f23f723cbe4de4b7ceefb4f9bb6c45574a99 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 17:37:40 -0500 Subject: [PATCH 583/751] build(deps): bump golang.org/x/net from 0.31.0 to 0.32.0 in /scrape (#3378) --- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 3ea2c52cc24..4264ba3c98b 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -9,7 +9,7 @@ require ( github.com/google/go-cmp v0.6.0 github.com/google/go-github/v67 v67.0.0 github.com/xlzd/gotp v0.1.0 - golang.org/x/net v0.31.0 + golang.org/x/net v0.32.0 ) require ( diff --git a/scrape/go.sum b/scrape/go.sum index cd2b0bf8d4a..abfc7858b9b 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -21,8 +21,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI= +golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= From 0162c9d2cc94f727c923194366eb4142e7a097ae Mon Sep 17 00:00:00 2001 From: Steve Hipwell Date: Mon, 9 Dec 2024 22:41:19 +0000 Subject: [PATCH 584/751] chore: Deprecate legacy ID-based team methods (#3373) Fixes: #3368. --- github/teams.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/github/teams.go b/github/teams.go index 651c2514654..686ab9a3f8e 100644 --- a/github/teams.go +++ b/github/teams.go @@ -111,6 +111,8 @@ func (s *TeamsService) ListTeams(ctx context.Context, org string, opts *ListOpti // GetTeamByID fetches a team, given a specified organization ID, by ID. // +// Deprecated: Use GetTeamBySlug instead. +// // GitHub API docs: https://docs.github.com/rest/teams/teams#get-a-team-by-name // //meta:operation GET /orgs/{org}/teams/{team_slug} @@ -237,6 +239,8 @@ func copyNewTeamWithoutParent(team *NewTeam) *newTeamNoParent { // EditTeamByID edits a team, given an organization ID, selected by ID. // +// Deprecated: Use EditTeamBySlug instead. +// // GitHub API docs: https://docs.github.com/rest/teams/teams#update-a-team // //meta:operation PATCH /orgs/{org}/teams/{team_slug} @@ -295,6 +299,8 @@ func (s *TeamsService) EditTeamBySlug(ctx context.Context, org, slug string, tea // DeleteTeamByID deletes a team referenced by ID. // +// Deprecated: Use DeleteTeamBySlug instead. +// // GitHub API docs: https://docs.github.com/rest/teams/teams#delete-a-team // //meta:operation DELETE /orgs/{org}/teams/{team_slug} @@ -325,6 +331,8 @@ func (s *TeamsService) DeleteTeamBySlug(ctx context.Context, org, slug string) ( // ListChildTeamsByParentID lists child teams for a parent team given parent ID. // +// Deprecated: Use ListChildTeamsByParentSlug instead. +// // GitHub API docs: https://docs.github.com/rest/teams/teams#list-child-teams // //meta:operation GET /orgs/{org}/teams/{team_slug}/teams @@ -377,6 +385,8 @@ func (s *TeamsService) ListChildTeamsByParentSlug(ctx context.Context, org, slug // ListTeamReposByID lists the repositories given a team ID that the specified team has access to. // +// Deprecated: Use ListTeamReposBySlug instead. +// // GitHub API docs: https://docs.github.com/rest/teams/teams#list-team-repositories // //meta:operation GET /orgs/{org}/teams/{team_slug}/repos @@ -437,6 +447,8 @@ func (s *TeamsService) ListTeamReposBySlug(ctx context.Context, org, slug string // repository is managed by team, a Repository is returned which includes the // permissions team has for that repo. // +// Deprecated: Use IsTeamRepoBySlug instead. +// // GitHub API docs: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository // //meta:operation GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} @@ -502,6 +514,8 @@ type TeamAddTeamRepoOptions struct { // The specified repository must be owned by the organization to which the team // belongs, or a direct fork of a repository owned by the organization. // +// Deprecated: Use AddTeamRepoBySlug instead. +// // GitHub API docs: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions // //meta:operation PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} @@ -536,6 +550,8 @@ func (s *TeamsService) AddTeamRepoBySlug(ctx context.Context, org, slug, owner, // team given the team ID. Note that this does not delete the repository, it // just removes it from the team. // +// Deprecated: Use RemoveTeamRepoBySlug instead. +// // GitHub API docs: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team // //meta:operation DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} @@ -594,6 +610,8 @@ func (s *TeamsService) ListUserTeams(ctx context.Context, opts *ListOptions) ([] // ListTeamProjectsByID lists the organization projects for a team given the team ID. // +// Deprecated: Use ListTeamProjectsBySlug instead. +// // GitHub API docs: https://docs.github.com/rest/teams/teams#list-team-projects // //meta:operation GET /orgs/{org}/teams/{team_slug}/projects @@ -645,6 +663,8 @@ func (s *TeamsService) ListTeamProjectsBySlug(ctx context.Context, org, slug str // ReviewTeamProjectsByID checks whether a team, given its ID, has read, write, or admin // permissions for an organization project. // +// Deprecated: Use ReviewTeamProjectsBySlug instead. +// // GitHub API docs: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project // //meta:operation GET /orgs/{org}/teams/{team_slug}/projects/{project_id} @@ -708,6 +728,8 @@ type TeamProjectOptions struct { // To add a project to a team or update the team's permission on a project, the // authenticated user must have admin permissions for the project. // +// Deprecated: Use AddTeamProjectBySlug instead. +// // GitHub API docs: https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions // //meta:operation PUT /orgs/{org}/teams/{team_slug}/projects/{project_id} @@ -751,6 +773,8 @@ func (s *TeamsService) AddTeamProjectBySlug(ctx context.Context, org, slug strin // or project. // Note: This endpoint removes the project from the team, but does not delete it. // +// Deprecated: Use RemoveTeamProjectBySlug instead. +// // GitHub API docs: https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team // //meta:operation DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id} @@ -839,6 +863,8 @@ func (s *TeamsService) ListIDPGroupsInOrganization(ctx context.Context, org stri // ListIDPGroupsForTeamByID lists IDP groups connected to a team on GitHub // given organization and team IDs. // +// Deprecated: Use ListIDPGroupsForTeamBySlug instead. +// // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#list-idp-groups-for-a-team // //meta:operation GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings @@ -885,6 +911,8 @@ func (s *TeamsService) ListIDPGroupsForTeamBySlug(ctx context.Context, org, slug // CreateOrUpdateIDPGroupConnectionsByID creates, updates, or removes a connection // between a team and an IDP group given organization and team IDs. // +// Deprecated: Use CreateOrUpdateIDPGroupConnectionsBySlug instead. +// // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#create-or-update-idp-group-connections // //meta:operation PATCH /orgs/{org}/teams/{team_slug}/team-sync/group-mappings From 077cefe1f489b0b5c6ce8c3d007120719a504604 Mon Sep 17 00:00:00 2001 From: Na-ga <537006+na-ga@users.noreply.github.com> Date: Tue, 10 Dec 2024 22:55:28 +0900 Subject: [PATCH 585/751] feat: Support resolution_comment to update alert API (#3357) --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 11 +++++++++++ github/secret_scanning.go | 3 +++ github/secret_scanning_test.go | 28 +++++++++++++++------------- 4 files changed, 37 insertions(+), 13 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index db906dab624..485fe514a69 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -23382,6 +23382,14 @@ func (s *SecretScanningAlertUpdateOptions) GetResolution() string { return *s.Resolution } +// GetResolutionComment returns the ResolutionComment field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlertUpdateOptions) GetResolutionComment() string { + if s == nil || s.ResolutionComment == nil { + return "" + } + return *s.ResolutionComment +} + // GetStatus returns the Status field if it's non-nil, zero value otherwise. func (s *SecretScanningPushProtection) GetStatus() string { if s == nil || s.Status == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 67b833a67b5..3393c0ec662 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -29986,6 +29986,17 @@ func TestSecretScanningAlertUpdateOptions_GetResolution(tt *testing.T) { s.GetResolution() } +func TestSecretScanningAlertUpdateOptions_GetResolutionComment(tt *testing.T) { + tt.Parallel() + var zeroValue string + s := &SecretScanningAlertUpdateOptions{ResolutionComment: &zeroValue} + s.GetResolutionComment() + s = &SecretScanningAlertUpdateOptions{} + s.GetResolutionComment() + s = nil + s.GetResolutionComment() +} + func TestSecretScanningPushProtection_GetStatus(tt *testing.T) { tt.Parallel() var zeroValue string diff --git a/github/secret_scanning.go b/github/secret_scanning.go index 2744926286a..fc0fe0cd8c2 100644 --- a/github/secret_scanning.go +++ b/github/secret_scanning.go @@ -89,6 +89,9 @@ type SecretScanningAlertUpdateOptions struct { // Required when the state is "resolved" and represents the reason for resolving the alert. // Can be one of: "false_positive", "wont_fix", "revoked", or "used_in_tests". Resolution *string `json:"resolution,omitempty"` + + // An optional comment when closing an alert. + ResolutionComment *string `json:"resolution_comment,omitempty"` } // ListAlertsForEnterprise lists secret scanning alerts for eligible repositories in an enterprise, from newest to oldest. diff --git a/github/secret_scanning_test.go b/github/secret_scanning_test.go index 6bb57ffe1dd..de3afb7cd52 100644 --- a/github/secret_scanning_test.go +++ b/github/secret_scanning_test.go @@ -359,7 +359,7 @@ func TestSecretScanningService_UpdateAlert(t *testing.T) { v := new(SecretScanningAlertUpdateOptions) assertNilError(t, json.NewDecoder(r.Body).Decode(v)) - want := &SecretScanningAlertUpdateOptions{State: "resolved", Resolution: String("used_in_tests")} + want := &SecretScanningAlertUpdateOptions{State: "resolved", Resolution: String("used_in_tests"), ResolutionComment: String("resolution comment")} if !cmp.Equal(v, want) { t.Errorf("Request body = %+v, want %+v", v, want) @@ -373,6 +373,7 @@ func TestSecretScanningService_UpdateAlert(t *testing.T) { "locations_url": "https://api.github.com/repos/o/r/secret-scanning/alerts/1/locations", "state": "resolved", "resolution": "used_in_tests", + "resolution_comment": "resolution comment", "resolved_at": "1996-06-20T00:00:00Z", "resolved_by": null, "secret_type": "mailchimp_api_key", @@ -381,7 +382,7 @@ func TestSecretScanningService_UpdateAlert(t *testing.T) { }) ctx := context.Background() - opts := &SecretScanningAlertUpdateOptions{State: "resolved", Resolution: String("used_in_tests")} + opts := &SecretScanningAlertUpdateOptions{State: "resolved", Resolution: String("used_in_tests"), ResolutionComment: String("resolution comment")} alert, _, err := client.SecretScanning.UpdateAlert(ctx, "o", "r", 1, opts) if err != nil { @@ -390,17 +391,18 @@ func TestSecretScanningService_UpdateAlert(t *testing.T) { date := Timestamp{time.Date(1996, time.June, 20, 00, 00, 00, 0, time.UTC)} want := &SecretScanningAlert{ - Number: Int(1), - CreatedAt: &date, - URL: String("https://api.github.com/repos/o/r/secret-scanning/alerts/1"), - HTMLURL: String("https://github.com/o/r/security/secret-scanning/1"), - LocationsURL: String("https://api.github.com/repos/o/r/secret-scanning/alerts/1/locations"), - State: String("resolved"), - Resolution: String("used_in_tests"), - ResolvedAt: &date, - ResolvedBy: nil, - SecretType: String("mailchimp_api_key"), - Secret: String("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2"), + Number: Int(1), + CreatedAt: &date, + URL: String("https://api.github.com/repos/o/r/secret-scanning/alerts/1"), + HTMLURL: String("https://github.com/o/r/security/secret-scanning/1"), + LocationsURL: String("https://api.github.com/repos/o/r/secret-scanning/alerts/1/locations"), + State: String("resolved"), + Resolution: String("used_in_tests"), + ResolutionComment: String("resolution comment"), + ResolvedAt: &date, + ResolvedBy: nil, + SecretType: String("mailchimp_api_key"), + Secret: String("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2"), } if !cmp.Equal(alert, want) { From f349af0dab56a5326cd1c59e9549900aa487afeb Mon Sep 17 00:00:00 2001 From: Alexis Couvreur Date: Tue, 10 Dec 2024 11:16:58 -0500 Subject: [PATCH 586/751] feat: Add custom_property events (#3379) Fixes: #3207. --- AUTHORS | 1 + github/event_types.go | 37 +++ github/event_types_test.go | 494 ++++++++++++++++++++++++++++++++ github/github-accessors.go | 104 +++++++ github/github-accessors_test.go | 113 ++++++++ github/messages.go | 2 + github/messages_test.go | 8 + github/orgs_properties.go | 4 +- 8 files changed, 762 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index bbbdc74b2d5..6e3c5035f63 100644 --- a/AUTHORS +++ b/AUTHORS @@ -40,6 +40,7 @@ Alex Su Alex Unger Alexander Harkness Alexey Alekhin +Alexis Couvreur Alexis Gauthiez Ali Farooq Alin Balutoiu diff --git a/github/event_types.go b/github/event_types.go index 373d59bad2c..5321a91f80b 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -132,6 +132,43 @@ type CreateEvent struct { Installation *Installation `json:"installation,omitempty"` } +// CustomPropertyEvent represents a created, deleted or updated custom property. +// The Webhook event name is "custom_property". +// +// Note: this is related to custom property configuration at the enterprise or organization level. +// See CustomPropertyValuesEvent for activity related to custom property values for a repository. +// +// GitHub API docs: https://docs.github.com/en/webhooks/webhook-events-and-payloads#custom_property +type CustomPropertyEvent struct { + // Action possible values are: "created", "deleted", "updated". + Action *string `json:"action,omitempty"` + Definition *CustomProperty `json:"definition,omitempty"` + + // The following fields are only populated by Webhook events. + Enterprise *Enterprise `json:"enterprise,omitempty"` + Installation *Installation `json:"installation,omitempty"` + Org *Organization `json:"organization,omitempty"` + Sender *User `json:"sender,omitempty"` +} + +// CustomPropertyValuesEvent represents an update to a custom property. +// The Webhook event name is "custom_property_values". +// +// GitHub API docs: https://docs.github.com/en/webhooks/webhook-events-and-payloads#custom_property_values +type CustomPropertyValuesEvent struct { + // Action possible values are: "updated". + Action *string `json:"action,omitempty"` + NewPropertyValues []*CustomPropertyValue `json:"new_property_values,omitempty"` + OldPropertyValues []*CustomPropertyValue `json:"old_property_values,omitempty"` + + // The following fields are only populated by Webhook events. + Enterprise *Enterprise `json:"enterprise,omitempty"` + Installation *Installation `json:"installation,omitempty"` + Repo *Repository `json:"repository,omitempty"` + Org *Organization `json:"organization,omitempty"` + Sender *User `json:"sender,omitempty"` +} + // DeleteEvent represents a deleted branch or tag. // The Webhook event name is "delete". // diff --git a/github/event_types_test.go b/github/event_types_test.go index b09b92799f1..2288c04c86a 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -14995,6 +14995,500 @@ func TestCreateEvent_Marshal(t *testing.T) { testJSONMarshal(t, r, want) } +func TestCustomPropertyEvent_Marshal(t *testing.T) { + t.Parallel() + testJSONMarshal(t, &CustomPropertyEvent{}, "{}") + + r := &CustomPropertyEvent{ + Action: String("created"), + Definition: &CustomProperty{ + PropertyName: String("name"), + ValueType: "single_select", + SourceType: String("enterprise"), + Required: Bool(true), + DefaultValue: String("production"), + Description: String("Prod or dev environment"), + AllowedValues: []string{"production", "development"}, + ValuesEditableBy: String("org_actors"), + }, + Sender: &User{ + Login: String("l"), + ID: Int64(1), + NodeID: String("n"), + URL: String("u"), + ReposURL: String("r"), + EventsURL: String("e"), + AvatarURL: String("a"), + }, + Installation: &Installation{ + ID: Int64(1), + NodeID: String("nid"), + AppID: Int64(1), + AppSlug: String("as"), + TargetID: Int64(1), + Account: &User{ + Login: String("l"), + ID: Int64(1), + URL: String("u"), + AvatarURL: String("a"), + GravatarID: String("g"), + Name: String("n"), + Company: String("c"), + Blog: String("b"), + Location: String("l"), + Email: String("e"), + Hireable: Bool(true), + Bio: String("b"), + TwitterUsername: String("t"), + PublicRepos: Int(1), + Followers: Int(1), + Following: Int(1), + CreatedAt: &Timestamp{referenceTime}, + SuspendedAt: &Timestamp{referenceTime}, + }, + AccessTokensURL: String("atu"), + RepositoriesURL: String("ru"), + HTMLURL: String("hu"), + TargetType: String("tt"), + SingleFileName: String("sfn"), + RepositorySelection: String("rs"), + Events: []string{"e"}, + SingleFilePaths: []string{"s"}, + Permissions: &InstallationPermissions{ + Actions: String("a"), + Administration: String("ad"), + Checks: String("c"), + Contents: String("co"), + ContentReferences: String("cr"), + Deployments: String("d"), + Environments: String("e"), + Issues: String("i"), + Metadata: String("md"), + Members: String("m"), + OrganizationAdministration: String("oa"), + OrganizationHooks: String("oh"), + OrganizationPlan: String("op"), + OrganizationPreReceiveHooks: String("opr"), + OrganizationProjects: String("op"), + OrganizationSecrets: String("os"), + OrganizationSelfHostedRunners: String("osh"), + OrganizationUserBlocking: String("oub"), + Packages: String("pkg"), + Pages: String("pg"), + PullRequests: String("pr"), + RepositoryHooks: String("rh"), + RepositoryProjects: String("rp"), + RepositoryPreReceiveHooks: String("rprh"), + Secrets: String("s"), + SecretScanningAlerts: String("ssa"), + SecurityEvents: String("se"), + SingleFile: String("sf"), + Statuses: String("s"), + TeamDiscussions: String("td"), + VulnerabilityAlerts: String("va"), + Workflows: String("w"), + }, + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + HasMultipleSingleFiles: Bool(false), + SuspendedBy: &User{ + Login: String("l"), + ID: Int64(1), + URL: String("u"), + AvatarURL: String("a"), + GravatarID: String("g"), + Name: String("n"), + Company: String("c"), + Blog: String("b"), + Location: String("l"), + Email: String("e"), + Hireable: Bool(true), + Bio: String("b"), + TwitterUsername: String("t"), + PublicRepos: Int(1), + Followers: Int(1), + Following: Int(1), + CreatedAt: &Timestamp{referenceTime}, + SuspendedAt: &Timestamp{referenceTime}, + }, + SuspendedAt: &Timestamp{referenceTime}, + }, + } + + want := `{ + "action": "created", + "definition": { + "property_name": "name", + "source_type": "enterprise", + "value_type": "single_select", + "required": true, + "default_value": "production", + "description": "Prod or dev environment", + "allowed_values": [ + "production", + "development" + ], + "values_editable_by": "org_actors" + }, + "repository": { + "id": 1, + "name": "n", + "url": "s" + }, + "sender": { + "login": "l", + "id": 1, + "node_id": "n", + "avatar_url": "a", + "url": "u", + "events_url": "e", + "repos_url": "r" + }, + "installation": { + "id": 1, + "node_id": "nid", + "app_id": 1, + "app_slug": "as", + "target_id": 1, + "account": { + "login": "l", + "id": 1, + "avatar_url": "a", + "gravatar_id": "g", + "name": "n", + "company": "c", + "blog": "b", + "location": "l", + "email": "e", + "hireable": true, + "bio": "b", + "twitter_username": "t", + "public_repos": 1, + "followers": 1, + "following": 1, + "created_at": ` + referenceTimeStr + `, + "suspended_at": ` + referenceTimeStr + `, + "url": "u" + }, + "access_tokens_url": "atu", + "repositories_url": "ru", + "html_url": "hu", + "target_type": "tt", + "single_file_name": "sfn", + "repository_selection": "rs", + "events": [ + "e" + ], + "single_file_paths": [ + "s" + ], + "permissions": { + "actions": "a", + "administration": "ad", + "checks": "c", + "contents": "co", + "content_references": "cr", + "deployments": "d", + "environments": "e", + "issues": "i", + "metadata": "md", + "members": "m", + "organization_administration": "oa", + "organization_hooks": "oh", + "organization_plan": "op", + "organization_pre_receive_hooks": "opr", + "organization_projects": "op", + "organization_secrets": "os", + "organization_self_hosted_runners": "osh", + "organization_user_blocking": "oub", + "packages": "pkg", + "pages": "pg", + "pull_requests": "pr", + "repository_hooks": "rh", + "repository_projects": "rp", + "repository_pre_receive_hooks": "rprh", + "secrets": "s", + "secret_scanning_alerts": "ssa", + "security_events": "se", + "single_file": "sf", + "statuses": "s", + "team_discussions": "td", + "vulnerability_alerts": "va", + "workflows": "w" + }, + "created_at": ` + referenceTimeStr + `, + "updated_at": ` + referenceTimeStr + `, + "has_multiple_single_files": false, + "suspended_by": { + "login": "l", + "id": 1, + "avatar_url": "a", + "gravatar_id": "g", + "name": "n", + "company": "c", + "blog": "b", + "location": "l", + "email": "e", + "hireable": true, + "bio": "b", + "twitter_username": "t", + "public_repos": 1, + "followers": 1, + "following": 1, + "created_at": ` + referenceTimeStr + `, + "suspended_at": ` + referenceTimeStr + `, + "url": "u" + }, + "suspended_at": ` + referenceTimeStr + ` + } + }` + + testJSONMarshal(t, r, want) +} + +func TestCustomPropertyValuesEvent_Marshal(t *testing.T) { + t.Parallel() + testJSONMarshal(t, &CustomPropertyValuesEvent{}, "{}") + + r := &CustomPropertyValuesEvent{ + Action: String("updated"), + NewPropertyValues: []*CustomPropertyValue{ + { + PropertyName: "environment", + Value: "production", + }, + }, + OldPropertyValues: []*CustomPropertyValue{ + { + PropertyName: "environment", + Value: "staging", + }, + }, + Sender: &User{ + Login: String("l"), + ID: Int64(1), + NodeID: String("n"), + URL: String("u"), + ReposURL: String("r"), + EventsURL: String("e"), + AvatarURL: String("a"), + }, + Installation: &Installation{ + ID: Int64(1), + NodeID: String("nid"), + AppID: Int64(1), + AppSlug: String("as"), + TargetID: Int64(1), + Account: &User{ + Login: String("l"), + ID: Int64(1), + URL: String("u"), + AvatarURL: String("a"), + GravatarID: String("g"), + Name: String("n"), + Company: String("c"), + Blog: String("b"), + Location: String("l"), + Email: String("e"), + Hireable: Bool(true), + Bio: String("b"), + TwitterUsername: String("t"), + PublicRepos: Int(1), + Followers: Int(1), + Following: Int(1), + CreatedAt: &Timestamp{referenceTime}, + SuspendedAt: &Timestamp{referenceTime}, + }, + AccessTokensURL: String("atu"), + RepositoriesURL: String("ru"), + HTMLURL: String("hu"), + TargetType: String("tt"), + SingleFileName: String("sfn"), + RepositorySelection: String("rs"), + Events: []string{"e"}, + SingleFilePaths: []string{"s"}, + Permissions: &InstallationPermissions{ + Actions: String("a"), + Administration: String("ad"), + Checks: String("c"), + Contents: String("co"), + ContentReferences: String("cr"), + Deployments: String("d"), + Environments: String("e"), + Issues: String("i"), + Metadata: String("md"), + Members: String("m"), + OrganizationAdministration: String("oa"), + OrganizationHooks: String("oh"), + OrganizationPlan: String("op"), + OrganizationPreReceiveHooks: String("opr"), + OrganizationProjects: String("op"), + OrganizationSecrets: String("os"), + OrganizationSelfHostedRunners: String("osh"), + OrganizationUserBlocking: String("oub"), + Packages: String("pkg"), + Pages: String("pg"), + PullRequests: String("pr"), + RepositoryHooks: String("rh"), + RepositoryProjects: String("rp"), + RepositoryPreReceiveHooks: String("rprh"), + Secrets: String("s"), + SecretScanningAlerts: String("ssa"), + SecurityEvents: String("se"), + SingleFile: String("sf"), + Statuses: String("s"), + TeamDiscussions: String("td"), + VulnerabilityAlerts: String("va"), + Workflows: String("w"), + }, + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + HasMultipleSingleFiles: Bool(false), + SuspendedBy: &User{ + Login: String("l"), + ID: Int64(1), + URL: String("u"), + AvatarURL: String("a"), + GravatarID: String("g"), + Name: String("n"), + Company: String("c"), + Blog: String("b"), + Location: String("l"), + Email: String("e"), + Hireable: Bool(true), + Bio: String("b"), + TwitterUsername: String("t"), + PublicRepos: Int(1), + Followers: Int(1), + Following: Int(1), + CreatedAt: &Timestamp{referenceTime}, + SuspendedAt: &Timestamp{referenceTime}, + }, + SuspendedAt: &Timestamp{referenceTime}, + }, + } + + want := `{ + "action": "updated", + "new_property_values": [{ + "property_name": "environment", + "value": "production" + }], + "old_property_values": [{ + "property_name": "environment", + "value": "staging" + }], + "sender": { + "login": "l", + "id": 1, + "node_id": "n", + "avatar_url": "a", + "url": "u", + "events_url": "e", + "repos_url": "r" + }, + "installation": { + "id": 1, + "node_id": "nid", + "app_id": 1, + "app_slug": "as", + "target_id": 1, + "account": { + "login": "l", + "id": 1, + "avatar_url": "a", + "gravatar_id": "g", + "name": "n", + "company": "c", + "blog": "b", + "location": "l", + "email": "e", + "hireable": true, + "bio": "b", + "twitter_username": "t", + "public_repos": 1, + "followers": 1, + "following": 1, + "created_at": ` + referenceTimeStr + `, + "suspended_at": ` + referenceTimeStr + `, + "url": "u" + }, + "access_tokens_url": "atu", + "repositories_url": "ru", + "html_url": "hu", + "target_type": "tt", + "single_file_name": "sfn", + "repository_selection": "rs", + "events": [ + "e" + ], + "single_file_paths": [ + "s" + ], + "permissions": { + "actions": "a", + "administration": "ad", + "checks": "c", + "contents": "co", + "content_references": "cr", + "deployments": "d", + "environments": "e", + "issues": "i", + "metadata": "md", + "members": "m", + "organization_administration": "oa", + "organization_hooks": "oh", + "organization_plan": "op", + "organization_pre_receive_hooks": "opr", + "organization_projects": "op", + "organization_secrets": "os", + "organization_self_hosted_runners": "osh", + "organization_user_blocking": "oub", + "packages": "pkg", + "pages": "pg", + "pull_requests": "pr", + "repository_hooks": "rh", + "repository_projects": "rp", + "repository_pre_receive_hooks": "rprh", + "secrets": "s", + "secret_scanning_alerts": "ssa", + "security_events": "se", + "single_file": "sf", + "statuses": "s", + "team_discussions": "td", + "vulnerability_alerts": "va", + "workflows": "w" + }, + "created_at": ` + referenceTimeStr + `, + "updated_at": ` + referenceTimeStr + `, + "has_multiple_single_files": false, + "suspended_by": { + "login": "l", + "id": 1, + "avatar_url": "a", + "gravatar_id": "g", + "name": "n", + "company": "c", + "blog": "b", + "location": "l", + "email": "e", + "hireable": true, + "bio": "b", + "twitter_username": "t", + "public_repos": 1, + "followers": 1, + "following": 1, + "created_at": ` + referenceTimeStr + `, + "suspended_at": ` + referenceTimeStr + `, + "url": "u" + }, + "suspended_at": ` + referenceTimeStr + ` + } + }` + + testJSONMarshal(t, r, want) +} + func TestDeleteEvent_Marshal(t *testing.T) { t.Parallel() testJSONMarshal(t, &DeleteEvent{}, "{}") diff --git a/github/github-accessors.go b/github/github-accessors.go index 485fe514a69..cc058414209 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -5182,6 +5182,14 @@ func (c *CustomProperty) GetRequired() bool { return *c.Required } +// GetSourceType returns the SourceType field if it's non-nil, zero value otherwise. +func (c *CustomProperty) GetSourceType() string { + if c == nil || c.SourceType == nil { + return "" + } + return *c.SourceType +} + // GetValuesEditableBy returns the ValuesEditableBy field if it's non-nil, zero value otherwise. func (c *CustomProperty) GetValuesEditableBy() string { if c == nil || c.ValuesEditableBy == nil { @@ -5190,6 +5198,102 @@ func (c *CustomProperty) GetValuesEditableBy() string { return *c.ValuesEditableBy } +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (c *CustomPropertyEvent) GetAction() string { + if c == nil || c.Action == nil { + return "" + } + return *c.Action +} + +// GetDefinition returns the Definition field. +func (c *CustomPropertyEvent) GetDefinition() *CustomProperty { + if c == nil { + return nil + } + return c.Definition +} + +// GetEnterprise returns the Enterprise field. +func (c *CustomPropertyEvent) GetEnterprise() *Enterprise { + if c == nil { + return nil + } + return c.Enterprise +} + +// GetInstallation returns the Installation field. +func (c *CustomPropertyEvent) GetInstallation() *Installation { + if c == nil { + return nil + } + return c.Installation +} + +// GetOrg returns the Org field. +func (c *CustomPropertyEvent) GetOrg() *Organization { + if c == nil { + return nil + } + return c.Org +} + +// GetSender returns the Sender field. +func (c *CustomPropertyEvent) GetSender() *User { + if c == nil { + return nil + } + return c.Sender +} + +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (c *CustomPropertyValuesEvent) GetAction() string { + if c == nil || c.Action == nil { + return "" + } + return *c.Action +} + +// GetEnterprise returns the Enterprise field. +func (c *CustomPropertyValuesEvent) GetEnterprise() *Enterprise { + if c == nil { + return nil + } + return c.Enterprise +} + +// GetInstallation returns the Installation field. +func (c *CustomPropertyValuesEvent) GetInstallation() *Installation { + if c == nil { + return nil + } + return c.Installation +} + +// GetOrg returns the Org field. +func (c *CustomPropertyValuesEvent) GetOrg() *Organization { + if c == nil { + return nil + } + return c.Org +} + +// GetRepo returns the Repo field. +func (c *CustomPropertyValuesEvent) GetRepo() *Repository { + if c == nil { + return nil + } + return c.Repo +} + +// GetSender returns the Sender field. +func (c *CustomPropertyValuesEvent) GetSender() *User { + if c == nil { + return nil + } + return c.Sender +} + // GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise. func (c *CustomRepoRoles) GetBaseRole() string { if c == nil || c.BaseRole == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 3393c0ec662..71cef92fd5f 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -6737,6 +6737,17 @@ func TestCustomProperty_GetRequired(tt *testing.T) { c.GetRequired() } +func TestCustomProperty_GetSourceType(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CustomProperty{SourceType: &zeroValue} + c.GetSourceType() + c = &CustomProperty{} + c.GetSourceType() + c = nil + c.GetSourceType() +} + func TestCustomProperty_GetValuesEditableBy(tt *testing.T) { tt.Parallel() var zeroValue string @@ -6748,6 +6759,108 @@ func TestCustomProperty_GetValuesEditableBy(tt *testing.T) { c.GetValuesEditableBy() } +func TestCustomPropertyEvent_GetAction(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CustomPropertyEvent{Action: &zeroValue} + c.GetAction() + c = &CustomPropertyEvent{} + c.GetAction() + c = nil + c.GetAction() +} + +func TestCustomPropertyEvent_GetDefinition(tt *testing.T) { + tt.Parallel() + c := &CustomPropertyEvent{} + c.GetDefinition() + c = nil + c.GetDefinition() +} + +func TestCustomPropertyEvent_GetEnterprise(tt *testing.T) { + tt.Parallel() + c := &CustomPropertyEvent{} + c.GetEnterprise() + c = nil + c.GetEnterprise() +} + +func TestCustomPropertyEvent_GetInstallation(tt *testing.T) { + tt.Parallel() + c := &CustomPropertyEvent{} + c.GetInstallation() + c = nil + c.GetInstallation() +} + +func TestCustomPropertyEvent_GetOrg(tt *testing.T) { + tt.Parallel() + c := &CustomPropertyEvent{} + c.GetOrg() + c = nil + c.GetOrg() +} + +func TestCustomPropertyEvent_GetSender(tt *testing.T) { + tt.Parallel() + c := &CustomPropertyEvent{} + c.GetSender() + c = nil + c.GetSender() +} + +func TestCustomPropertyValuesEvent_GetAction(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CustomPropertyValuesEvent{Action: &zeroValue} + c.GetAction() + c = &CustomPropertyValuesEvent{} + c.GetAction() + c = nil + c.GetAction() +} + +func TestCustomPropertyValuesEvent_GetEnterprise(tt *testing.T) { + tt.Parallel() + c := &CustomPropertyValuesEvent{} + c.GetEnterprise() + c = nil + c.GetEnterprise() +} + +func TestCustomPropertyValuesEvent_GetInstallation(tt *testing.T) { + tt.Parallel() + c := &CustomPropertyValuesEvent{} + c.GetInstallation() + c = nil + c.GetInstallation() +} + +func TestCustomPropertyValuesEvent_GetOrg(tt *testing.T) { + tt.Parallel() + c := &CustomPropertyValuesEvent{} + c.GetOrg() + c = nil + c.GetOrg() +} + +func TestCustomPropertyValuesEvent_GetRepo(tt *testing.T) { + tt.Parallel() + c := &CustomPropertyValuesEvent{} + c.GetRepo() + c = nil + c.GetRepo() +} + +func TestCustomPropertyValuesEvent_GetSender(tt *testing.T) { + tt.Parallel() + c := &CustomPropertyValuesEvent{} + c.GetSender() + c = nil + c.GetSender() +} + func TestCustomRepoRoles_GetBaseRole(tt *testing.T) { tt.Parallel() var zeroValue string diff --git a/github/messages.go b/github/messages.go index 608c557cb09..3df4f3a3544 100644 --- a/github/messages.go +++ b/github/messages.go @@ -54,6 +54,8 @@ var ( "commit_comment": &CommitCommentEvent{}, "content_reference": &ContentReferenceEvent{}, "create": &CreateEvent{}, + "custom_property": &CustomPropertyEvent{}, + "custom_property_values": &CustomPropertyValuesEvent{}, "delete": &DeleteEvent{}, "dependabot_alert": &DependabotAlertEvent{}, "deploy_key": &DeployKeyEvent{}, diff --git a/github/messages_test.go b/github/messages_test.go index be325d504b4..e5a5327cfac 100644 --- a/github/messages_test.go +++ b/github/messages_test.go @@ -296,6 +296,14 @@ func TestParseWebHook(t *testing.T) { payload: &CreateEvent{}, messageType: "create", }, + { + payload: &CustomPropertyEvent{}, + messageType: "custom_property", + }, + { + payload: &CustomPropertyValuesEvent{}, + messageType: "custom_property_values", + }, { payload: &DeleteEvent{}, messageType: "delete", diff --git a/github/orgs_properties.go b/github/orgs_properties.go index d4fe5dfa07d..f59d9f467ed 100644 --- a/github/orgs_properties.go +++ b/github/orgs_properties.go @@ -17,7 +17,9 @@ type CustomProperty struct { // PropertyName is required for most endpoints except when calling CreateOrUpdateCustomProperty; // where this is sent in the path and thus can be omitted. PropertyName *string `json:"property_name,omitempty"` - // The type of the value for the property. Can be one of: string, single_select. + // SourceType is the source type of the property where it has been created. Can be one of: organization, enterprise. + SourceType *string `json:"source_type,omitempty"` + // The type of the value for the property. Can be one of: string, single_select, multi_select, true_false. ValueType string `json:"value_type"` // Whether the property is required. Required *bool `json:"required,omitempty"` From f66ed859551f07af01a9ff33ca4f1a90ea9d482c Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Wed, 11 Dec 2024 04:36:09 +0200 Subject: [PATCH 587/751] feat: Deprecate and replace Bool,Int,Int64,String with Ptr using generics (#3355) --- README.md | 4 +- example/actionpermissions/main.go | 6 +- example/commitpr/main.go | 6 +- example/newfilewithappauth/main.go | 2 +- github/actions_artifacts_test.go | 66 +- github/actions_cache_test.go | 38 +- github/actions_oidc_test.go | 8 +- github/actions_permissions_enterprise_test.go | 22 +- github/actions_permissions_orgs_test.go | 32 +- github/actions_required_workflows_test.go | 60 +- github/actions_runner_groups_test.go | 142 +- github/actions_runners_test.go | 116 +- github/actions_secrets.go | 2 +- github/actions_secrets_test.go | 40 +- github/actions_variables_test.go | 26 +- github/actions_workflow_jobs_test.go | 108 +- github/actions_workflow_runs_test.go | 494 +- github/actions_workflows_test.go | 70 +- github/activity_events_test.go | 24 +- github/activity_notifications_test.go | 42 +- github/activity_star_test.go | 44 +- github/activity_test.go | 112 +- github/activity_watching_test.go | 24 +- github/admin_orgs_test.go | 26 +- github/admin_stats_test.go | 204 +- github/admin_test.go | 136 +- github/admin_users_test.go | 58 +- github/apps.go | 2 +- github/apps_hooks_deliveries_test.go | 6 +- github/apps_hooks_test.go | 24 +- github/apps_installation_test.go | 14 +- github/apps_manifest_test.go | 64 +- github/apps_marketplace_test.go | 166 +- github/apps_test.go | 616 +- github/authorizations_test.go | 92 +- github/billing_test.go | 8 +- github/checks_test.go | 692 +- github/code_scanning_test.go | 630 +- github/codesofconduct_test.go | 22 +- github/codespaces_secrets_test.go | 10 +- github/codespaces_test.go | 84 +- github/copilot_test.go | 324 +- github/dependabot_alerts_test.go | 30 +- github/dependabot_secrets_test.go | 14 +- github/dependency_graph_snapshots_test.go | 42 +- github/dependency_graph_test.go | 6 +- github/doc.go | 4 +- .../enterprise_actions_runner_groups_test.go | 148 +- github/enterprise_actions_runners_test.go | 26 +- github/enterprise_audit_log_test.go | 14 +- ...erprise_code_security_and_analysis_test.go | 20 +- github/event_test.go | 66 +- github/event_types_test.go | 13958 ++++++++-------- github/examples_test.go | 16 +- github/gen-stringify-test.go | 19 +- github/gists_comments_test.go | 46 +- github/gists_test.go | 202 +- github/git_blobs_test.go | 24 +- github/git_commits_test.go | 164 +- github/git_refs.go | 2 +- github/git_refs_test.go | 156 +- github/git_tags_test.go | 50 +- github/git_trees_test.go | 118 +- github/github-stringify_test.go | 1724 +- github/github.go | 14 + github/github_test.go | 17 +- github/gitignore_test.go | 6 +- github/interactions_orgs.go | 2 +- github/interactions_orgs_test.go | 6 +- github/interactions_repos.go | 2 +- github/interactions_repos_test.go | 6 +- github/interactions_test.go | 4 +- github/issue_import_test.go | 68 +- github/issues_assignees_test.go | 6 +- github/issues_comments_test.go | 66 +- github/issues_events_test.go | 300 +- github/issues_labels_test.go | 36 +- github/issues_milestones_test.go | 66 +- github/issues_test.go | 104 +- github/issues_timeline_test.go | 132 +- github/licenses_test.go | 70 +- github/markdown.go | 6 +- github/markdown_test.go | 12 +- github/meta_test.go | 4 +- github/migrations.go | 4 +- github/migrations_source_import_test.go | 106 +- github/migrations_test.go | 46 +- github/migrations_user.go | 4 +- github/migrations_user_test.go | 46 +- github/orgs_actions_allowed_test.go | 6 +- github/orgs_actions_permissions_test.go | 6 +- github/orgs_audit_log_test.go | 62 +- .../orgs_codesecurity_configurations_test.go | 34 +- github/orgs_credential_authorizations_test.go | 8 +- github/orgs_custom_repository_roles_test.go | 42 +- github/orgs_hooks_configuration_test.go | 16 +- github/orgs_hooks_deliveries_test.go | 6 +- github/orgs_hooks_test.go | 8 +- github/orgs_members_test.go | 208 +- github/orgs_organization_roles_test.go | 64 +- github/orgs_outside_collaborators_test.go | 2 +- github/orgs_packages_test.go | 90 +- github/orgs_personal_access_tokens_test.go | 48 +- github/orgs_projects_test.go | 6 +- github/orgs_properties_test.go | 58 +- github/orgs_rules_test.go | 242 +- github/orgs_security_managers_test.go | 2 +- github/orgs_test.go | 74 +- github/orgs_users_blocking_test.go | 2 +- github/packages_test.go | 472 +- github/projects_test.go | 208 +- github/pulls_comments_test.go | 104 +- github/pulls_reviewers_test.go | 66 +- github/pulls_reviews_test.go | 118 +- github/pulls_test.go | 542 +- github/pulls_threads_test.go | 90 +- github/reactions.go | 14 +- github/reactions_test.go | 52 +- github/repos_actions_access_test.go | 6 +- github/repos_actions_allowed_test.go | 6 +- github/repos_actions_permissions_test.go | 18 +- github/repos_autolinks_test.go | 32 +- github/repos_codeowners_test.go | 6 +- github/repos_collaborators_test.go | 140 +- github/repos_comments_test.go | 82 +- github/repos_commits_test.go | 246 +- github/repos_community_health_test.go | 184 +- github/repos_contents_test.go | 172 +- .../repos_deployment_branch_policies_test.go | 20 +- .../repos_deployment_protection_rules_test.go | 42 +- github/repos_deployments_test.go | 148 +- github/repos_environments.go | 4 +- github/repos_environments_test.go | 130 +- github/repos_forks_test.go | 6 +- github/repos_hooks_configuration_test.go | 16 +- github/repos_hooks_deliveries_test.go | 32 +- github/repos_hooks_test.go | 108 +- github/repos_invitations_test.go | 30 +- github/repos_keys_test.go | 8 +- github/repos_merging_test.go | 24 +- github/repos_pages_test.go | 166 +- github/repos_prereceive_hooks_test.go | 14 +- github/repos_projects_test.go | 6 +- github/repos_releases_test.go | 162 +- github/repos_rules_test.go | 36 +- github/repos_stats.go | 10 +- github/repos_stats_test.go | 42 +- github/repos_statuses_test.go | 56 +- github/repos_tags_test.go | 8 +- github/repos_test.go | 322 +- github/repos_traffic_test.go | 64 +- github/scim_test.go | 90 +- github/search_test.go | 270 +- github/secret_scanning_test.go | 182 +- github/security_advisories_test.go | 844 +- github/strings_test.go | 94 +- github/teams_discussion_comments_test.go | 96 +- github/teams_discussions_test.go | 196 +- github/teams_members_test.go | 16 +- github/teams_test.go | 308 +- github/users_administration_test.go | 4 +- github/users_blocking_test.go | 2 +- github/users_emails_test.go | 18 +- github/users_followers_test.go | 8 +- github/users_gpg_keys_test.go | 34 +- github/users_keys_test.go | 22 +- github/users_packages_test.go | 112 +- github/users_projects_test.go | 8 +- github/users_ssh_signing_keys_test.go | 16 +- github/users_test.go | 122 +- test/integration/activity_test.go | 2 +- test/integration/github_test.go | 4 +- test/integration/repos_test.go | 22 +- test/integration/users_test.go | 4 +- tools/metadata/main_test.go | 8 +- 175 files changed, 15076 insertions(+), 15050 deletions(-) diff --git a/README.md b/README.md index 4c9f67cdd20..ec360fba2dc 100644 --- a/README.md +++ b/README.md @@ -279,8 +279,8 @@ bool, and int values. For example: ```go // create a new private repository named "foo" repo := &github.Repository{ - Name: github.String("foo"), - Private: github.Bool(true), + Name: github.Ptr("foo"), + Private: github.Ptr(true), } client.Repositories.Create(ctx, "", repo) ``` diff --git a/example/actionpermissions/main.go b/example/actionpermissions/main.go index 6047824b6bb..082465e0edc 100644 --- a/example/actionpermissions/main.go +++ b/example/actionpermissions/main.go @@ -44,7 +44,7 @@ func main() { fmt.Printf("Current ActionsPermissions %s\n", actionsPermissionsRepository.String()) - actionsPermissionsRepository = &github.ActionsPermissionsRepository{Enabled: github.Bool(true), AllowedActions: github.String("selected")} + actionsPermissionsRepository = &github.ActionsPermissionsRepository{Enabled: github.Ptr(true), AllowedActions: github.Ptr("selected")} _, _, err = client.Repositories.EditActionsPermissions(ctx, *owner, *name, *actionsPermissionsRepository) if err != nil { log.Fatal(err) @@ -59,7 +59,7 @@ func main() { fmt.Printf("Current ActionsAllowed %s\n", actionsAllowed.String()) - actionsAllowed = &github.ActionsAllowed{GithubOwnedAllowed: github.Bool(true), VerifiedAllowed: github.Bool(false), PatternsAllowed: []string{"a/b"}} + actionsAllowed = &github.ActionsAllowed{GithubOwnedAllowed: github.Ptr(true), VerifiedAllowed: github.Ptr(false), PatternsAllowed: []string{"a/b"}} _, _, err = client.Repositories.EditActionsAllowed(ctx, *owner, *name, *actionsAllowed) if err != nil { log.Fatal(err) @@ -67,7 +67,7 @@ func main() { fmt.Printf("Current ActionsAllowed %s\n", actionsAllowed.String()) - actionsPermissionsRepository = &github.ActionsPermissionsRepository{Enabled: github.Bool(true), AllowedActions: github.String("all")} + actionsPermissionsRepository = &github.ActionsPermissionsRepository{Enabled: github.Ptr(true), AllowedActions: github.Ptr("all")} _, _, err = client.Repositories.EditActionsPermissions(ctx, *owner, *name, *actionsPermissionsRepository) if err != nil { log.Fatal(err) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index cc7d148a378..9928b59b42c 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -81,7 +81,7 @@ func getRef() (ref *github.Reference, err error) { if baseRef, _, err = client.Git.GetRef(ctx, *sourceOwner, *sourceRepo, "refs/heads/"+*baseBranch); err != nil { return nil, err } - newRef := &github.Reference{Ref: github.String("refs/heads/" + *commitBranch), Object: &github.GitObject{SHA: baseRef.Object.SHA}} + newRef := &github.Reference{Ref: github.Ptr("refs/heads/" + *commitBranch), Object: &github.GitObject{SHA: baseRef.Object.SHA}} ref, _, err = client.Git.CreateRef(ctx, *sourceOwner, *sourceRepo, newRef) return ref, err } @@ -98,7 +98,7 @@ func getTree(ref *github.Reference) (tree *github.Tree, err error) { if err != nil { return nil, err } - entries = append(entries, &github.TreeEntry{Path: github.String(file), Type: github.String("blob"), Content: github.String(string(content)), Mode: github.String("100644")}) + entries = append(entries, &github.TreeEntry{Path: github.Ptr(file), Type: github.Ptr("blob"), Content: github.Ptr(string(content)), Mode: github.Ptr("100644")}) } tree, _, err = client.Git.CreateTree(ctx, *sourceOwner, *sourceRepo, *ref.Object.SHA, entries) @@ -190,7 +190,7 @@ func createPR() (err error) { HeadRepo: repoBranch, Base: prBranch, Body: prDescription, - MaintainerCanModify: github.Bool(true), + MaintainerCanModify: github.Ptr(true), } pr, _, err := client.PullRequests.Create(ctx, *prRepoOwner, *prRepo, newPR) diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index 9db0e08e183..e5fad2680c5 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -79,7 +79,7 @@ func main() { "example/foo.txt", &github.RepositoryContentFileOptions{ Content: []byte("foo"), - Message: github.String("sample commit"), + Message: github.Ptr("sample commit"), SHA: nil, }) if err != nil { diff --git a/github/actions_artifacts_test.go b/github/actions_artifacts_test.go index 751b6e26ca2..5ac5a8f2bd1 100644 --- a/github/actions_artifacts_test.go +++ b/github/actions_artifacts_test.go @@ -32,7 +32,7 @@ func TestActionsService_ListArtifacts(t *testing.T) { }) opts := &ListArtifactsOptions{ - Name: String("TheArtifact"), + Name: Ptr("TheArtifact"), ListOptions: ListOptions{Page: 2}, } ctx := context.Background() @@ -41,7 +41,7 @@ func TestActionsService_ListArtifacts(t *testing.T) { t.Errorf("Actions.ListArtifacts returned error: %v", err) } - want := &ArtifactList{TotalCount: Int64(1), Artifacts: []*Artifact{{ID: Int64(1)}}} + want := &ArtifactList{TotalCount: Ptr(int64(1)), Artifacts: []*Artifact{{ID: Ptr(int64(1))}}} if !cmp.Equal(artifacts, want) { t.Errorf("Actions.ListArtifacts returned %+v, want %+v", artifacts, want) } @@ -123,7 +123,7 @@ func TestActionsService_ListWorkflowRunArtifacts(t *testing.T) { t.Errorf("Actions.ListWorkflowRunArtifacts returned error: %v", err) } - want := &ArtifactList{TotalCount: Int64(1), Artifacts: []*Artifact{{ID: Int64(1)}}} + want := &ArtifactList{TotalCount: Ptr(int64(1)), Artifacts: []*Artifact{{ID: Ptr(int64(1))}}} if !cmp.Equal(artifacts, want) { t.Errorf("Actions.ListWorkflowRunArtifacts returned %+v, want %+v", artifacts, want) } @@ -205,11 +205,11 @@ func TestActionsService_GetArtifact(t *testing.T) { } want := &Artifact{ - ID: Int64(1), - NodeID: String("xyz"), - Name: String("a"), - SizeInBytes: Int64(5), - ArchiveDownloadURL: String("u"), + ID: Ptr(int64(1)), + NodeID: Ptr("xyz"), + Name: Ptr("a"), + SizeInBytes: Ptr(int64(5)), + ArchiveDownloadURL: Ptr("u"), } if !cmp.Equal(artifact, want) { t.Errorf("Actions.GetArtifact returned %+v, want %+v", artifact, want) @@ -438,22 +438,22 @@ func TestArtifact_Marshal(t *testing.T) { testJSONMarshal(t, &Artifact{}, "{}") u := &Artifact{ - ID: Int64(1), - NodeID: String("nid"), - Name: String("n"), - SizeInBytes: Int64(1), - URL: String("u"), - ArchiveDownloadURL: String("a"), - Expired: Bool(false), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + Name: Ptr("n"), + SizeInBytes: Ptr(int64(1)), + URL: Ptr("u"), + ArchiveDownloadURL: Ptr("a"), + Expired: Ptr(false), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, ExpiresAt: &Timestamp{referenceTime}, WorkflowRun: &ArtifactWorkflowRun{ - ID: Int64(1), - RepositoryID: Int64(1), - HeadRepositoryID: Int64(1), - HeadBranch: String("b"), - HeadSHA: String("s"), + ID: Ptr(int64(1)), + RepositoryID: Ptr(int64(1)), + HeadRepositoryID: Ptr(int64(1)), + HeadBranch: Ptr("b"), + HeadSHA: Ptr("s"), }, } @@ -485,25 +485,25 @@ func TestArtifactList_Marshal(t *testing.T) { testJSONMarshal(t, &ArtifactList{}, "{}") u := &ArtifactList{ - TotalCount: Int64(1), + TotalCount: Ptr(int64(1)), Artifacts: []*Artifact{ { - ID: Int64(1), - NodeID: String("nid"), - Name: String("n"), - SizeInBytes: Int64(1), - URL: String("u"), - ArchiveDownloadURL: String("a"), - Expired: Bool(false), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + Name: Ptr("n"), + SizeInBytes: Ptr(int64(1)), + URL: Ptr("u"), + ArchiveDownloadURL: Ptr("a"), + Expired: Ptr(false), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, ExpiresAt: &Timestamp{referenceTime}, WorkflowRun: &ArtifactWorkflowRun{ - ID: Int64(1), - RepositoryID: Int64(1), - HeadRepositoryID: Int64(1), - HeadBranch: String("b"), - HeadSHA: String("s"), + ID: Ptr(int64(1)), + RepositoryID: Ptr(int64(1)), + HeadRepositoryID: Ptr(int64(1)), + HeadBranch: Ptr("b"), + HeadSHA: Ptr("s"), }, }, }, diff --git a/github/actions_cache_test.go b/github/actions_cache_test.go index cac64065c0f..4831b612c4a 100644 --- a/github/actions_cache_test.go +++ b/github/actions_cache_test.go @@ -36,7 +36,7 @@ func TestActionsService_ListCaches(t *testing.T) { t.Errorf("Actions.ListCaches returned error: %v", err) } - want := &ActionsCacheList{TotalCount: 1, ActionsCaches: []*ActionsCache{{ID: Int64(1)}}} + want := &ActionsCacheList{TotalCount: 1, ActionsCaches: []*ActionsCache{{ID: Ptr(int64(1))}}} if !cmp.Equal(cacheList, want) { t.Errorf("Actions.ListCaches returned %+v, want %+v", cacheList, want) } @@ -106,19 +106,19 @@ func TestActionsService_DeleteCachesByKey(t *testing.T) { }) ctx := context.Background() - _, err := client.Actions.DeleteCachesByKey(ctx, "o", "r", "1", String("main")) + _, err := client.Actions.DeleteCachesByKey(ctx, "o", "r", "1", Ptr("main")) if err != nil { t.Errorf("Actions.DeleteCachesByKey return error: %v", err) } const methodName = "DeleteCachesByKey" testBadOptions(t, methodName, func() (err error) { - _, err = client.Actions.DeleteCachesByKey(ctx, "\n", "\n", "\n", String("\n")) + _, err = client.Actions.DeleteCachesByKey(ctx, "\n", "\n", "\n", Ptr("\n")) return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Actions.DeleteCachesByKey(ctx, "o", "r", "1", String("main")) + return client.Actions.DeleteCachesByKey(ctx, "o", "r", "1", Ptr("main")) }) } @@ -127,7 +127,7 @@ func TestActionsService_DeleteCachesByKey_invalidOwner(t *testing.T) { client, _, _ := setup(t) ctx := context.Background() - _, err := client.Actions.DeleteCachesByKey(ctx, "%", "r", "1", String("main")) + _, err := client.Actions.DeleteCachesByKey(ctx, "%", "r", "1", Ptr("main")) testURLParseError(t, err) } @@ -136,7 +136,7 @@ func TestActionsService_DeleteCachesByKey_invalidRepo(t *testing.T) { client, _, _ := setup(t) ctx := context.Background() - _, err := client.Actions.DeleteCachesByKey(ctx, "o", "%", "1", String("main")) + _, err := client.Actions.DeleteCachesByKey(ctx, "o", "%", "1", Ptr("main")) testURLParseError(t, err) } func TestActionsService_DeleteCachesByKey_notFound(t *testing.T) { @@ -149,7 +149,7 @@ func TestActionsService_DeleteCachesByKey_notFound(t *testing.T) { }) ctx := context.Background() - resp, err := client.Actions.DeleteCachesByKey(ctx, "o", "r", "1", String("main")) + resp, err := client.Actions.DeleteCachesByKey(ctx, "o", "r", "1", Ptr("main")) if err == nil { t.Errorf("Expected HTTP 404 response") } @@ -521,13 +521,13 @@ func TestActionsCache_Marshal(t *testing.T) { testJSONMarshal(t, &ActionsCache{}, "{}") u := &ActionsCache{ - ID: Int64(1), - Ref: String("refAction"), - Key: String("key1"), - Version: String("alpha"), + ID: Ptr(int64(1)), + Ref: Ptr("refAction"), + Key: Ptr("key1"), + Version: Ptr("alpha"), LastAccessedAt: &Timestamp{referenceTime}, CreatedAt: &Timestamp{referenceTime}, - SizeInBytes: Int64(1), + SizeInBytes: Ptr(int64(1)), } want := `{ @@ -551,19 +551,19 @@ func TestActionsCacheList_Marshal(t *testing.T) { TotalCount: 2, ActionsCaches: []*ActionsCache{ { - ID: Int64(1), - Key: String("key1"), - Version: String("alpha"), + ID: Ptr(int64(1)), + Key: Ptr("key1"), + Version: Ptr("alpha"), LastAccessedAt: &Timestamp{referenceTime}, CreatedAt: &Timestamp{referenceTime}, - SizeInBytes: Int64(1), + SizeInBytes: Ptr(int64(1)), }, { - ID: Int64(2), - Ref: String("refAction"), + ID: Ptr(int64(2)), + Ref: Ptr("refAction"), LastAccessedAt: &Timestamp{referenceTime}, CreatedAt: &Timestamp{referenceTime}, - SizeInBytes: Int64(1), + SizeInBytes: Ptr(int64(1)), }, }, } diff --git a/github/actions_oidc_test.go b/github/actions_oidc_test.go index 4ad00a75371..dd8764946f0 100644 --- a/github/actions_oidc_test.go +++ b/github/actions_oidc_test.go @@ -64,7 +64,7 @@ func TestActionsService_GetRepoOIDCSubjectClaimCustomTemplate(t *testing.T) { t.Errorf("Actions.GetRepoOIDCSubjectClaimCustomTemplate returned error: %v", err) } - want := &OIDCSubjectClaimCustomTemplate{UseDefault: Bool(false), IncludeClaimKeys: []string{"repo", "context"}} + want := &OIDCSubjectClaimCustomTemplate{UseDefault: Ptr(false), IncludeClaimKeys: []string{"repo", "context"}} if !cmp.Equal(template, want) { t.Errorf("Actions.GetOrgOIDCSubjectClaimCustomTemplate returned %+v, want %+v", template, want) } @@ -128,7 +128,7 @@ func TestActionsService_SetRepoOIDCSubjectClaimCustomTemplate(t *testing.T) { }) input := &OIDCSubjectClaimCustomTemplate{ - UseDefault: Bool(false), + UseDefault: Ptr(false), IncludeClaimKeys: []string{"repo", "context"}, } ctx := context.Background() @@ -161,7 +161,7 @@ func TestActionService_SetRepoOIDCSubjectClaimCustomTemplateToDefault(t *testing }) input := &OIDCSubjectClaimCustomTemplate{ - UseDefault: Bool(true), + UseDefault: Ptr(true), } ctx := context.Background() _, err := client.Actions.SetRepoOIDCSubjectClaimCustomTemplate(ctx, "o", "r", input) @@ -185,7 +185,7 @@ func TestOIDCSubjectClaimCustomTemplate_Marshal(t *testing.T) { testJSONMarshal(t, &OIDCSubjectClaimCustomTemplate{}, "{}") u := &OIDCSubjectClaimCustomTemplate{ - UseDefault: Bool(false), + UseDefault: Ptr(false), IncludeClaimKeys: []string{"s"}, } diff --git a/github/actions_permissions_enterprise_test.go b/github/actions_permissions_enterprise_test.go index 3ec9ab1163a..30c29a38eb3 100644 --- a/github/actions_permissions_enterprise_test.go +++ b/github/actions_permissions_enterprise_test.go @@ -29,7 +29,7 @@ func TestActionsService_GetActionsPermissionsInEnterprise(t *testing.T) { if err != nil { t.Errorf("Actions.GetActionsPermissionsInEnterprise returned error: %v", err) } - want := &ActionsPermissionsEnterprise{EnabledOrganizations: String("all"), AllowedActions: String("all")} + want := &ActionsPermissionsEnterprise{EnabledOrganizations: Ptr("all"), AllowedActions: Ptr("all")} if !cmp.Equal(ent, want) { t.Errorf("Actions.GetActionsPermissionsInEnterprise returned %+v, want %+v", ent, want) } @@ -53,7 +53,7 @@ func TestActionsService_EditActionsPermissionsInEnterprise(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &ActionsPermissionsEnterprise{EnabledOrganizations: String("all"), AllowedActions: String("selected")} + input := &ActionsPermissionsEnterprise{EnabledOrganizations: Ptr("all"), AllowedActions: Ptr("selected")} mux.HandleFunc("/enterprises/e/actions/permissions", func(w http.ResponseWriter, r *http.Request) { v := new(ActionsPermissionsEnterprise) @@ -73,7 +73,7 @@ func TestActionsService_EditActionsPermissionsInEnterprise(t *testing.T) { t.Errorf("Actions.EditActionsPermissionsInEnterprise returned error: %v", err) } - want := &ActionsPermissionsEnterprise{EnabledOrganizations: String("all"), AllowedActions: String("selected")} + want := &ActionsPermissionsEnterprise{EnabledOrganizations: Ptr("all"), AllowedActions: Ptr("selected")} if !cmp.Equal(ent, want) { t.Errorf("Actions.EditActionsPermissionsInEnterprise returned %+v, want %+v", ent, want) } @@ -115,8 +115,8 @@ func TestActionsService_ListEnabledOrgsInEnterprise(t *testing.T) { } want := &ActionsEnabledOnEnterpriseRepos{TotalCount: int(2), Organizations: []*Organization{ - {ID: Int64(2)}, - {ID: Int64(3)}, + {ID: Ptr(int64(2))}, + {ID: Ptr(int64(3))}, }} if !cmp.Equal(got, want) { t.Errorf("Actions.ListEnabledOrgsInEnterprise returned %+v, want %+v", got, want) @@ -234,7 +234,7 @@ func TestActionsService_GetActionsAllowedInEnterprise(t *testing.T) { if err != nil { t.Errorf("Actions.GetActionsAllowedInEnterprise returned error: %v", err) } - want := &ActionsAllowed{GithubOwnedAllowed: Bool(true), VerifiedAllowed: Bool(false), PatternsAllowed: []string{"a/b"}} + want := &ActionsAllowed{GithubOwnedAllowed: Ptr(true), VerifiedAllowed: Ptr(false), PatternsAllowed: []string{"a/b"}} if !cmp.Equal(ent, want) { t.Errorf("Actions.GetActionsAllowedInEnterprise returned %+v, want %+v", ent, want) } @@ -258,7 +258,7 @@ func TestActionsService_EditActionsAllowedInEnterprise(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &ActionsAllowed{GithubOwnedAllowed: Bool(true), VerifiedAllowed: Bool(false), PatternsAllowed: []string{"a/b"}} + input := &ActionsAllowed{GithubOwnedAllowed: Ptr(true), VerifiedAllowed: Ptr(false), PatternsAllowed: []string{"a/b"}} mux.HandleFunc("/enterprises/e/actions/permissions/selected-actions", func(w http.ResponseWriter, r *http.Request) { v := new(ActionsAllowed) @@ -278,7 +278,7 @@ func TestActionsService_EditActionsAllowedInEnterprise(t *testing.T) { t.Errorf("Actions.EditActionsAllowedInEnterprise returned error: %v", err) } - want := &ActionsAllowed{GithubOwnedAllowed: Bool(true), VerifiedAllowed: Bool(false), PatternsAllowed: []string{"a/b"}} + want := &ActionsAllowed{GithubOwnedAllowed: Ptr(true), VerifiedAllowed: Ptr(false), PatternsAllowed: []string{"a/b"}} if !cmp.Equal(ent, want) { t.Errorf("Actions.EditActionsAllowedInEnterprise returned %+v, want %+v", ent, want) } @@ -312,7 +312,7 @@ func TestActionsService_GetDefaultWorkflowPermissionsInEnterprise(t *testing.T) if err != nil { t.Errorf("Actions.GetDefaultWorkflowPermissionsInEnterprise returned error: %v", err) } - want := &DefaultWorkflowPermissionEnterprise{DefaultWorkflowPermissions: String("read"), CanApprovePullRequestReviews: Bool(true)} + want := &DefaultWorkflowPermissionEnterprise{DefaultWorkflowPermissions: Ptr("read"), CanApprovePullRequestReviews: Ptr(true)} if !cmp.Equal(ent, want) { t.Errorf("Actions.GetDefaultWorkflowPermissionsInEnterprise returned %+v, want %+v", ent, want) } @@ -336,7 +336,7 @@ func TestActionsService_EditDefaultWorkflowPermissionsInEnterprise(t *testing.T) t.Parallel() client, mux, _ := setup(t) - input := &DefaultWorkflowPermissionEnterprise{DefaultWorkflowPermissions: String("read"), CanApprovePullRequestReviews: Bool(true)} + input := &DefaultWorkflowPermissionEnterprise{DefaultWorkflowPermissions: Ptr("read"), CanApprovePullRequestReviews: Ptr(true)} mux.HandleFunc("/enterprises/e/actions/permissions/workflow", func(w http.ResponseWriter, r *http.Request) { v := new(DefaultWorkflowPermissionEnterprise) @@ -356,7 +356,7 @@ func TestActionsService_EditDefaultWorkflowPermissionsInEnterprise(t *testing.T) t.Errorf("Actions.EditDefaultWorkflowPermissionsInEnterprise returned error: %v", err) } - want := &DefaultWorkflowPermissionEnterprise{DefaultWorkflowPermissions: String("read"), CanApprovePullRequestReviews: Bool(true)} + want := &DefaultWorkflowPermissionEnterprise{DefaultWorkflowPermissions: Ptr("read"), CanApprovePullRequestReviews: Ptr(true)} if !cmp.Equal(ent, want) { t.Errorf("Actions.EditDefaultWorkflowPermissionsInEnterprise returned %+v, want %+v", ent, want) } diff --git a/github/actions_permissions_orgs_test.go b/github/actions_permissions_orgs_test.go index 4b778400fcb..c485b749b4b 100644 --- a/github/actions_permissions_orgs_test.go +++ b/github/actions_permissions_orgs_test.go @@ -29,7 +29,7 @@ func TestActionsService_GetActionsPermissions(t *testing.T) { if err != nil { t.Errorf("Actions.GetActionsPermissions returned error: %v", err) } - want := &ActionsPermissions{EnabledRepositories: String("all"), AllowedActions: String("all")} + want := &ActionsPermissions{EnabledRepositories: Ptr("all"), AllowedActions: Ptr("all")} if !cmp.Equal(org, want) { t.Errorf("Actions.GetActionsPermissions returned %+v, want %+v", org, want) } @@ -53,7 +53,7 @@ func TestActionsService_EditActionsPermissions(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &ActionsPermissions{EnabledRepositories: String("all"), AllowedActions: String("selected")} + input := &ActionsPermissions{EnabledRepositories: Ptr("all"), AllowedActions: Ptr("selected")} mux.HandleFunc("/orgs/o/actions/permissions", func(w http.ResponseWriter, r *http.Request) { v := new(ActionsPermissions) @@ -73,7 +73,7 @@ func TestActionsService_EditActionsPermissions(t *testing.T) { t.Errorf("Actions.EditActionsPermissions returned error: %v", err) } - want := &ActionsPermissions{EnabledRepositories: String("all"), AllowedActions: String("selected")} + want := &ActionsPermissions{EnabledRepositories: Ptr("all"), AllowedActions: Ptr("selected")} if !cmp.Equal(org, want) { t.Errorf("Actions.EditActionsPermissions returned %+v, want %+v", org, want) } @@ -115,8 +115,8 @@ func TestActionsService_ListEnabledReposInOrg(t *testing.T) { } want := &ActionsEnabledOnOrgRepos{TotalCount: int(2), Repositories: []*Repository{ - {ID: Int64(2)}, - {ID: Int64(3)}, + {ID: Ptr(int64(2))}, + {ID: Ptr(int64(3))}, }} if !cmp.Equal(got, want) { t.Errorf("Actions.ListEnabledRepos returned %+v, want %+v", got, want) @@ -234,7 +234,7 @@ func TestActionsService_GetActionsAllowed(t *testing.T) { if err != nil { t.Errorf("Actions.GetActionsAllowed returned error: %v", err) } - want := &ActionsAllowed{GithubOwnedAllowed: Bool(true), VerifiedAllowed: Bool(false), PatternsAllowed: []string{"a/b"}} + want := &ActionsAllowed{GithubOwnedAllowed: Ptr(true), VerifiedAllowed: Ptr(false), PatternsAllowed: []string{"a/b"}} if !cmp.Equal(org, want) { t.Errorf("Actions.GetActionsAllowed returned %+v, want %+v", org, want) } @@ -258,7 +258,7 @@ func TestActionsService_EditActionsAllowed(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &ActionsAllowed{GithubOwnedAllowed: Bool(true), VerifiedAllowed: Bool(false), PatternsAllowed: []string{"a/b"}} + input := &ActionsAllowed{GithubOwnedAllowed: Ptr(true), VerifiedAllowed: Ptr(false), PatternsAllowed: []string{"a/b"}} mux.HandleFunc("/orgs/o/actions/permissions/selected-actions", func(w http.ResponseWriter, r *http.Request) { v := new(ActionsAllowed) @@ -278,7 +278,7 @@ func TestActionsService_EditActionsAllowed(t *testing.T) { t.Errorf("Actions.EditActionsAllowed returned error: %v", err) } - want := &ActionsAllowed{GithubOwnedAllowed: Bool(true), VerifiedAllowed: Bool(false), PatternsAllowed: []string{"a/b"}} + want := &ActionsAllowed{GithubOwnedAllowed: Ptr(true), VerifiedAllowed: Ptr(false), PatternsAllowed: []string{"a/b"}} if !cmp.Equal(org, want) { t.Errorf("Actions.EditActionsAllowed returned %+v, want %+v", org, want) } @@ -303,8 +303,8 @@ func TestActionsAllowed_Marshal(t *testing.T) { testJSONMarshal(t, &ActionsAllowed{}, "{}") u := &ActionsAllowed{ - GithubOwnedAllowed: Bool(false), - VerifiedAllowed: Bool(false), + GithubOwnedAllowed: Ptr(false), + VerifiedAllowed: Ptr(false), PatternsAllowed: []string{"s"}, } @@ -324,9 +324,9 @@ func TestActionsPermissions_Marshal(t *testing.T) { testJSONMarshal(t, &ActionsPermissions{}, "{}") u := &ActionsPermissions{ - EnabledRepositories: String("e"), - AllowedActions: String("a"), - SelectedActionsURL: String("sau"), + EnabledRepositories: Ptr("e"), + AllowedActions: Ptr("a"), + SelectedActionsURL: Ptr("sau"), } want := `{ @@ -352,7 +352,7 @@ func TestActionsService_GetDefaultWorkflowPermissionsInOrganization(t *testing.T if err != nil { t.Errorf("Actions.GetDefaultWorkflowPermissionsInOrganization returned error: %v", err) } - want := &DefaultWorkflowPermissionOrganization{DefaultWorkflowPermissions: String("read"), CanApprovePullRequestReviews: Bool(true)} + want := &DefaultWorkflowPermissionOrganization{DefaultWorkflowPermissions: Ptr("read"), CanApprovePullRequestReviews: Ptr(true)} if !cmp.Equal(org, want) { t.Errorf("Actions.GetDefaultWorkflowPermissionsInOrganization returned %+v, want %+v", org, want) } @@ -376,7 +376,7 @@ func TestActionsService_EditDefaultWorkflowPermissionsInOrganization(t *testing. t.Parallel() client, mux, _ := setup(t) - input := &DefaultWorkflowPermissionOrganization{DefaultWorkflowPermissions: String("read"), CanApprovePullRequestReviews: Bool(true)} + input := &DefaultWorkflowPermissionOrganization{DefaultWorkflowPermissions: Ptr("read"), CanApprovePullRequestReviews: Ptr(true)} mux.HandleFunc("/orgs/o/actions/permissions/workflow", func(w http.ResponseWriter, r *http.Request) { v := new(DefaultWorkflowPermissionOrganization) @@ -396,7 +396,7 @@ func TestActionsService_EditDefaultWorkflowPermissionsInOrganization(t *testing. t.Errorf("Actions.EditDefaultWorkflowPermissionsInOrganization returned error: %v", err) } - want := &DefaultWorkflowPermissionOrganization{DefaultWorkflowPermissions: String("read"), CanApprovePullRequestReviews: Bool(true)} + want := &DefaultWorkflowPermissionOrganization{DefaultWorkflowPermissions: Ptr("read"), CanApprovePullRequestReviews: Ptr(true)} if !cmp.Equal(org, want) { t.Errorf("Actions.EditDefaultWorkflowPermissionsInOrganization returned %+v, want %+v", org, want) } diff --git a/github/actions_required_workflows_test.go b/github/actions_required_workflows_test.go index 98c9b90751e..5d7e72c6883 100644 --- a/github/actions_required_workflows_test.go +++ b/github/actions_required_workflows_test.go @@ -56,10 +56,10 @@ func TestActionsService_ListOrgRequiredWorkflows(t *testing.T) { } want := &OrgRequiredWorkflows{ - TotalCount: Int(4), + TotalCount: Ptr(4), RequiredWorkflows: []*OrgRequiredWorkflow{ - {ID: Int64(30433642), Name: String("Required CI"), Path: String(".github/workflows/ci.yml"), Scope: String("selected"), Ref: String("refs/head/main"), State: String("active"), SelectedRepositoriesURL: String("https://api.github.com/organizations/org/actions/required_workflows/1/repositories"), CreatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}}, - {ID: Int64(30433643), Name: String("Required Linter"), Path: String(".github/workflows/lint.yml"), Scope: String("all"), Ref: String("refs/head/main"), State: String("active"), CreatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}}, + {ID: Ptr(int64(30433642)), Name: Ptr("Required CI"), Path: Ptr(".github/workflows/ci.yml"), Scope: Ptr("selected"), Ref: Ptr("refs/head/main"), State: Ptr("active"), SelectedRepositoriesURL: Ptr("https://api.github.com/organizations/org/actions/required_workflows/1/repositories"), CreatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}}, + {ID: Ptr(int64(30433643)), Name: Ptr("Required Linter"), Path: Ptr(".github/workflows/lint.yml"), Scope: Ptr("all"), Ref: Ptr("refs/head/main"), State: Ptr("active"), CreatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}}, }, } if !cmp.Equal(jobs, want) { @@ -104,9 +104,9 @@ func TestActionsService_CreateRequiredWorkflow(t *testing.T) { "url": "https://api.github.com/repos/o/Hello-World"}}`) }) input := &CreateUpdateRequiredWorkflowOptions{ - WorkflowFilePath: String(".github/workflows/ci.yaml"), - RepositoryID: Int64(53), - Scope: String("selected"), + WorkflowFilePath: Ptr(".github/workflows/ci.yaml"), + RepositoryID: Ptr(int64(53)), + Scope: Ptr("selected"), SelectedRepositoryIDs: &SelectedRepoIDs{32, 91}, } ctx := context.Background() @@ -115,16 +115,16 @@ func TestActionsService_CreateRequiredWorkflow(t *testing.T) { t.Errorf("Actions.CreateRequiredWorkflow returned error: %v", err) } want := &OrgRequiredWorkflow{ - ID: Int64(2), - Name: String("Required CI"), - Path: String(".github/workflows/ci.yml"), - Scope: String("selected"), - Ref: String("refs/head/main"), - State: String("active"), - SelectedRepositoriesURL: String("https://api.github.com/orgs/octo-org/actions/required_workflows/2/repositories"), + ID: Ptr(int64(2)), + Name: Ptr("Required CI"), + Path: Ptr(".github/workflows/ci.yml"), + Scope: Ptr("selected"), + Ref: Ptr("refs/head/main"), + State: Ptr("active"), + SelectedRepositoriesURL: Ptr("https://api.github.com/orgs/octo-org/actions/required_workflows/2/repositories"), CreatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, - Repository: &Repository{ID: Int64(53), URL: String("https://api.github.com/repos/o/Hello-World"), Name: String("Hello-World")}, + Repository: &Repository{ID: Ptr(int64(53)), URL: Ptr("https://api.github.com/repos/o/Hello-World"), Name: Ptr("Hello-World")}, } if !cmp.Equal(requiredWokflow, want) { @@ -177,7 +177,7 @@ func TestActionsService_GetRequiredWorkflowByID(t *testing.T) { } want := &OrgRequiredWorkflow{ - ID: Int64(12345), Name: String("Required CI"), Path: String(".github/workflows/ci.yml"), Scope: String("selected"), Ref: String("refs/head/main"), State: String("active"), SelectedRepositoriesURL: String("https://api.github.com/orgs/o/actions/required_workflows/12345/repositories"), CreatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, Repository: &Repository{ID: Int64(1296269), URL: String("https://api.github.com/repos/o/Hello-World"), Name: String("Hello-World")}, + ID: Ptr(int64(12345)), Name: Ptr("Required CI"), Path: Ptr(".github/workflows/ci.yml"), Scope: Ptr("selected"), Ref: Ptr("refs/head/main"), State: Ptr("active"), SelectedRepositoriesURL: Ptr("https://api.github.com/orgs/o/actions/required_workflows/12345/repositories"), CreatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, Repository: &Repository{ID: Ptr(int64(1296269)), URL: Ptr("https://api.github.com/repos/o/Hello-World"), Name: Ptr("Hello-World")}, } if !cmp.Equal(jobs, want) { t.Errorf("Actions.GetRequiredWorkflowByID returned %+v, want %+v", jobs, want) @@ -221,9 +221,9 @@ func TestActionsService_UpdateRequiredWorkflow(t *testing.T) { "url": "https://api.github.com/repos/o/Hello-World"}}`) }) input := &CreateUpdateRequiredWorkflowOptions{ - WorkflowFilePath: String(".github/workflows/ci.yaml"), - RepositoryID: Int64(53), - Scope: String("selected"), + WorkflowFilePath: Ptr(".github/workflows/ci.yaml"), + RepositoryID: Ptr(int64(53)), + Scope: Ptr("selected"), SelectedRepositoryIDs: &SelectedRepoIDs{32, 91}, } ctx := context.Background() @@ -234,16 +234,16 @@ func TestActionsService_UpdateRequiredWorkflow(t *testing.T) { t.Errorf("Actions.UpdateRequiredWorkflow returned error: %v", err) } want := &OrgRequiredWorkflow{ - ID: Int64(12345), - Name: String("Required CI"), - Path: String(".github/workflows/ci.yml"), - Scope: String("selected"), - Ref: String("refs/head/main"), - State: String("active"), - SelectedRepositoriesURL: String("https://api.github.com/orgs/octo-org/actions/required_workflows/12345/repositories"), + ID: Ptr(int64(12345)), + Name: Ptr("Required CI"), + Path: Ptr(".github/workflows/ci.yml"), + Scope: Ptr("selected"), + Ref: Ptr("refs/head/main"), + State: Ptr("active"), + SelectedRepositoriesURL: Ptr("https://api.github.com/orgs/octo-org/actions/required_workflows/12345/repositories"), CreatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, - Repository: &Repository{ID: Int64(53), URL: String("https://api.github.com/repos/o/Hello-World"), Name: String("Hello-World")}, + Repository: &Repository{ID: Ptr(int64(53)), URL: Ptr("https://api.github.com/repos/o/Hello-World"), Name: Ptr("Hello-World")}, } if !cmp.Equal(requiredWokflow, want) { @@ -315,9 +315,9 @@ func TestActionsService_ListRequiredWorkflowSelectedRepos(t *testing.T) { } want := &RequiredWorkflowSelectedRepos{ - TotalCount: Int(1), + TotalCount: Ptr(1), Repositories: []*Repository{ - {ID: Int64(1296269), URL: String("https://api.github.com/repos/o/Hello-World"), Name: String("Hello-World")}, + {ID: Ptr(int64(1296269)), URL: Ptr("https://api.github.com/repos/o/Hello-World"), Name: Ptr("Hello-World")}, }, } if !cmp.Equal(jobs, want) { @@ -455,9 +455,9 @@ func TestActionsService_ListRepoRequiredWorkflows(t *testing.T) { } want := &RepoRequiredWorkflows{ - TotalCount: Int(1), + TotalCount: Ptr(1), RequiredWorkflows: []*RepoRequiredWorkflow{ - {ID: Int64(30433642), NodeID: String("MDg6V29ya2Zsb3cxNjEzMzU="), Name: String("Required CI"), Path: String(".github/workflows/ci.yml"), State: String("active"), CreatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, URL: String("https://api.github.com/repos/o/r/actions/required_workflows/161335"), BadgeURL: String("https://github.com/o/r/workflows/required/o/hello-world/.github/workflows/required_ci.yaml/badge.svg"), HTMLURL: String("https://github.com/o/r/blob/master/o/hello-world/.github/workflows/required_ci.yaml"), SourceRepository: &Repository{ID: Int64(1296269), URL: String("https://api.github.com/repos/o/Hello-World"), Name: String("Hello-World")}}, + {ID: Ptr(int64(30433642)), NodeID: Ptr("MDg6V29ya2Zsb3cxNjEzMzU="), Name: Ptr("Required CI"), Path: Ptr(".github/workflows/ci.yml"), State: Ptr("active"), CreatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, URL: Ptr("https://api.github.com/repos/o/r/actions/required_workflows/161335"), BadgeURL: Ptr("https://github.com/o/r/workflows/required/o/hello-world/.github/workflows/required_ci.yaml/badge.svg"), HTMLURL: Ptr("https://github.com/o/r/blob/master/o/hello-world/.github/workflows/required_ci.yaml"), SourceRepository: &Repository{ID: Ptr(int64(1296269)), URL: Ptr("https://api.github.com/repos/o/Hello-World"), Name: Ptr("Hello-World")}}, }, } if !cmp.Equal(jobs, want) { diff --git a/github/actions_runner_groups_test.go b/github/actions_runner_groups_test.go index c051bbc1213..c7154b74e0a 100644 --- a/github/actions_runner_groups_test.go +++ b/github/actions_runner_groups_test.go @@ -34,9 +34,9 @@ func TestActionsService_ListOrganizationRunnerGroups(t *testing.T) { want := &RunnerGroups{ TotalCount: 3, RunnerGroups: []*RunnerGroup{ - {ID: Int64(1), Name: String("Default"), Visibility: String("all"), Default: Bool(true), RunnersURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/1/runners"), Inherited: Bool(false), AllowsPublicRepositories: Bool(true), RestrictedToWorkflows: Bool(true), SelectedWorkflows: []string{"a", "b"}}, - {ID: Int64(2), Name: String("octo-runner-group"), Visibility: String("selected"), Default: Bool(false), SelectedRepositoriesURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories"), RunnersURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners"), Inherited: Bool(true), AllowsPublicRepositories: Bool(true), RestrictedToWorkflows: Bool(false), SelectedWorkflows: []string{}}, - {ID: Int64(3), Name: String("expensive-hardware"), Visibility: String("private"), Default: Bool(false), RunnersURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/3/runners"), Inherited: Bool(false), AllowsPublicRepositories: Bool(true), RestrictedToWorkflows: Bool(false), SelectedWorkflows: []string{}}, + {ID: Ptr(int64(1)), Name: Ptr("Default"), Visibility: Ptr("all"), Default: Ptr(true), RunnersURL: Ptr("https://api.github.com/orgs/octo-org/actions/runner_groups/1/runners"), Inherited: Ptr(false), AllowsPublicRepositories: Ptr(true), RestrictedToWorkflows: Ptr(true), SelectedWorkflows: []string{"a", "b"}}, + {ID: Ptr(int64(2)), Name: Ptr("octo-runner-group"), Visibility: Ptr("selected"), Default: Ptr(false), SelectedRepositoriesURL: Ptr("https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories"), RunnersURL: Ptr("https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners"), Inherited: Ptr(true), AllowsPublicRepositories: Ptr(true), RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}}, + {ID: Ptr(int64(3)), Name: Ptr("expensive-hardware"), Visibility: Ptr("private"), Default: Ptr(false), RunnersURL: Ptr("https://api.github.com/orgs/octo-org/actions/runner_groups/3/runners"), Inherited: Ptr(false), AllowsPublicRepositories: Ptr(true), RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}}, }, } if !cmp.Equal(groups, want) { @@ -78,9 +78,9 @@ func TestActionsService_ListOrganizationRunnerGroupsVisibleToRepo(t *testing.T) want := &RunnerGroups{ TotalCount: 3, RunnerGroups: []*RunnerGroup{ - {ID: Int64(1), Name: String("Default"), Visibility: String("all"), Default: Bool(true), RunnersURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/1/runners"), Inherited: Bool(false), AllowsPublicRepositories: Bool(true), RestrictedToWorkflows: Bool(false), SelectedWorkflows: []string{}}, - {ID: Int64(2), Name: String("octo-runner-group"), Visibility: String("selected"), Default: Bool(false), SelectedRepositoriesURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories"), RunnersURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners"), Inherited: Bool(true), AllowsPublicRepositories: Bool(true), RestrictedToWorkflows: Bool(false), SelectedWorkflows: []string{}}, - {ID: Int64(3), Name: String("expensive-hardware"), Visibility: String("private"), Default: Bool(false), RunnersURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/3/runners"), Inherited: Bool(false), AllowsPublicRepositories: Bool(true), RestrictedToWorkflows: Bool(false), SelectedWorkflows: []string{}}, + {ID: Ptr(int64(1)), Name: Ptr("Default"), Visibility: Ptr("all"), Default: Ptr(true), RunnersURL: Ptr("https://api.github.com/orgs/octo-org/actions/runner_groups/1/runners"), Inherited: Ptr(false), AllowsPublicRepositories: Ptr(true), RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}}, + {ID: Ptr(int64(2)), Name: Ptr("octo-runner-group"), Visibility: Ptr("selected"), Default: Ptr(false), SelectedRepositoriesURL: Ptr("https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories"), RunnersURL: Ptr("https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners"), Inherited: Ptr(true), AllowsPublicRepositories: Ptr(true), RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}}, + {ID: Ptr(int64(3)), Name: Ptr("expensive-hardware"), Visibility: Ptr("private"), Default: Ptr(false), RunnersURL: Ptr("https://api.github.com/orgs/octo-org/actions/runner_groups/3/runners"), Inherited: Ptr(false), AllowsPublicRepositories: Ptr(true), RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}}, }, } if !cmp.Equal(groups, want) { @@ -118,15 +118,15 @@ func TestActionsService_GetOrganizationRunnerGroup(t *testing.T) { } want := &RunnerGroup{ - ID: Int64(2), - Name: String("octo-runner-group"), - Visibility: String("selected"), - Default: Bool(false), - SelectedRepositoriesURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories"), - RunnersURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners"), - Inherited: Bool(false), - AllowsPublicRepositories: Bool(true), - RestrictedToWorkflows: Bool(false), + ID: Ptr(int64(2)), + Name: Ptr("octo-runner-group"), + Visibility: Ptr("selected"), + Default: Ptr(false), + SelectedRepositoriesURL: Ptr("https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories"), + RunnersURL: Ptr("https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners"), + Inherited: Ptr(false), + AllowsPublicRepositories: Ptr(true), + RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}, } @@ -185,10 +185,10 @@ func TestActionsService_CreateOrganizationRunnerGroup(t *testing.T) { ctx := context.Background() req := CreateRunnerGroupRequest{ - Name: String("octo-runner-group"), - Visibility: String("selected"), - AllowsPublicRepositories: Bool(true), - RestrictedToWorkflows: Bool(false), + Name: Ptr("octo-runner-group"), + Visibility: Ptr("selected"), + AllowsPublicRepositories: Ptr(true), + RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}, } group, _, err := client.Actions.CreateOrganizationRunnerGroup(ctx, "o", req) @@ -197,15 +197,15 @@ func TestActionsService_CreateOrganizationRunnerGroup(t *testing.T) { } want := &RunnerGroup{ - ID: Int64(2), - Name: String("octo-runner-group"), - Visibility: String("selected"), - Default: Bool(false), - SelectedRepositoriesURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories"), - RunnersURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners"), - Inherited: Bool(false), - AllowsPublicRepositories: Bool(true), - RestrictedToWorkflows: Bool(false), + ID: Ptr(int64(2)), + Name: Ptr("octo-runner-group"), + Visibility: Ptr("selected"), + Default: Ptr(false), + SelectedRepositoriesURL: Ptr("https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories"), + RunnersURL: Ptr("https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners"), + Inherited: Ptr(false), + AllowsPublicRepositories: Ptr(true), + RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}, } @@ -239,10 +239,10 @@ func TestActionsService_UpdateOrganizationRunnerGroup(t *testing.T) { ctx := context.Background() req := UpdateRunnerGroupRequest{ - Name: String("octo-runner-group"), - Visibility: String("selected"), - AllowsPublicRepositories: Bool(true), - RestrictedToWorkflows: Bool(false), + Name: Ptr("octo-runner-group"), + Visibility: Ptr("selected"), + AllowsPublicRepositories: Ptr(true), + RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}, } group, _, err := client.Actions.UpdateOrganizationRunnerGroup(ctx, "o", 2, req) @@ -251,15 +251,15 @@ func TestActionsService_UpdateOrganizationRunnerGroup(t *testing.T) { } want := &RunnerGroup{ - ID: Int64(2), - Name: String("octo-runner-group"), - Visibility: String("selected"), - Default: Bool(false), - SelectedRepositoriesURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories"), - RunnersURL: String("https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners"), - Inherited: Bool(false), - AllowsPublicRepositories: Bool(true), - RestrictedToWorkflows: Bool(false), + ID: Ptr(int64(2)), + Name: Ptr("octo-runner-group"), + Visibility: Ptr("selected"), + Default: Ptr(false), + SelectedRepositoriesURL: Ptr("https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories"), + RunnersURL: Ptr("https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners"), + Inherited: Ptr(false), + AllowsPublicRepositories: Ptr(true), + RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}, } @@ -300,9 +300,9 @@ func TestActionsService_ListRepositoryAccessRunnerGroup(t *testing.T) { } want := &ListRepositories{ - TotalCount: Int(1), + TotalCount: Ptr(1), Repositories: []*Repository{ - {ID: Int64(43), NodeID: String("MDEwOlJlcG9zaXRvcnkxMjk2MjY5"), Name: String("Hello-World"), FullName: String("octocat/Hello-World")}, + {ID: Ptr(int64(43)), NodeID: Ptr("MDEwOlJlcG9zaXRvcnkxMjk2MjY5"), Name: Ptr("Hello-World"), FullName: Ptr("octocat/Hello-World")}, }, } if !cmp.Equal(groups, want) { @@ -426,8 +426,8 @@ func TestActionsService_ListRunnerGroupRunners(t *testing.T) { want := &Runners{ TotalCount: 2, Runners: []*Runner{ - {ID: Int64(23), Name: String("MBP"), OS: String("macos"), Status: String("online")}, - {ID: Int64(24), Name: String("iMac"), OS: String("macos"), Status: String("offline")}, + {ID: Ptr(int64(23)), Name: Ptr("MBP"), OS: Ptr("macos"), Status: Ptr("online")}, + {ID: Ptr(int64(24)), Name: Ptr("iMac"), OS: Ptr("macos"), Status: Ptr("offline")}, }, } if !cmp.Equal(runners, want) { @@ -536,15 +536,15 @@ func TestRunnerGroup_Marshal(t *testing.T) { testJSONMarshal(t, &RunnerGroup{}, "{}") u := &RunnerGroup{ - ID: Int64(1), - Name: String("n"), - Visibility: String("v"), - Default: Bool(true), - SelectedRepositoriesURL: String("s"), - RunnersURL: String("r"), - Inherited: Bool(true), - AllowsPublicRepositories: Bool(true), - RestrictedToWorkflows: Bool(false), + ID: Ptr(int64(1)), + Name: Ptr("n"), + Visibility: Ptr("v"), + Default: Ptr(true), + SelectedRepositoriesURL: Ptr("s"), + RunnersURL: Ptr("r"), + Inherited: Ptr(true), + AllowsPublicRepositories: Ptr(true), + RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}, } @@ -572,15 +572,15 @@ func TestRunnerGroups_Marshal(t *testing.T) { TotalCount: int(1), RunnerGroups: []*RunnerGroup{ { - ID: Int64(1), - Name: String("n"), - Visibility: String("v"), - Default: Bool(true), - SelectedRepositoriesURL: String("s"), - RunnersURL: String("r"), - Inherited: Bool(true), - AllowsPublicRepositories: Bool(true), - RestrictedToWorkflows: Bool(false), + ID: Ptr(int64(1)), + Name: Ptr("n"), + Visibility: Ptr("v"), + Default: Ptr(true), + SelectedRepositoriesURL: Ptr("s"), + RunnersURL: Ptr("r"), + Inherited: Ptr(true), + AllowsPublicRepositories: Ptr(true), + RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}, }, }, @@ -610,12 +610,12 @@ func TestCreateRunnerGroupRequest_Marshal(t *testing.T) { testJSONMarshal(t, &CreateRunnerGroupRequest{}, "{}") u := &CreateRunnerGroupRequest{ - Name: String("n"), - Visibility: String("v"), + Name: Ptr("n"), + Visibility: Ptr("v"), SelectedRepositoryIDs: []int64{1}, Runners: []int64{1}, - AllowsPublicRepositories: Bool(true), - RestrictedToWorkflows: Bool(true), + AllowsPublicRepositories: Ptr(true), + RestrictedToWorkflows: Ptr(true), SelectedWorkflows: []string{"a", "b"}, } @@ -637,10 +637,10 @@ func TestUpdateRunnerGroupRequest_Marshal(t *testing.T) { testJSONMarshal(t, &UpdateRunnerGroupRequest{}, "{}") u := &UpdateRunnerGroupRequest{ - Name: String("n"), - Visibility: String("v"), - AllowsPublicRepositories: Bool(true), - RestrictedToWorkflows: Bool(false), + Name: Ptr("n"), + Visibility: Ptr("v"), + AllowsPublicRepositories: Ptr(true), + RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}, } diff --git a/github/actions_runners_test.go b/github/actions_runners_test.go index 06b824da45b..4c174d3c878 100644 --- a/github/actions_runners_test.go +++ b/github/actions_runners_test.go @@ -32,11 +32,11 @@ func TestActionsService_ListRunnerApplicationDownloads(t *testing.T) { } want := []*RunnerApplicationDownload{ - {OS: String("osx"), Architecture: String("x64"), DownloadURL: String("https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-osx-x64-2.164.0.tar.gz"), Filename: String("actions-runner-osx-x64-2.164.0.tar.gz")}, - {OS: String("linux"), Architecture: String("x64"), DownloadURL: String("https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-x64-2.164.0.tar.gz"), Filename: String("actions-runner-linux-x64-2.164.0.tar.gz")}, - {OS: String("linux"), Architecture: String("arm"), DownloadURL: String("https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm-2.164.0.tar.gz"), Filename: String("actions-runner-linux-arm-2.164.0.tar.gz")}, - {OS: String("win"), Architecture: String("x64"), DownloadURL: String("https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-win-x64-2.164.0.zip"), Filename: String("actions-runner-win-x64-2.164.0.zip")}, - {OS: String("linux"), Architecture: String("arm64"), DownloadURL: String("https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm64-2.164.0.tar.gz"), Filename: String("actions-runner-linux-arm64-2.164.0.tar.gz")}, + {OS: Ptr("osx"), Architecture: Ptr("x64"), DownloadURL: Ptr("https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-osx-x64-2.164.0.tar.gz"), Filename: Ptr("actions-runner-osx-x64-2.164.0.tar.gz")}, + {OS: Ptr("linux"), Architecture: Ptr("x64"), DownloadURL: Ptr("https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-x64-2.164.0.tar.gz"), Filename: Ptr("actions-runner-linux-x64-2.164.0.tar.gz")}, + {OS: Ptr("linux"), Architecture: Ptr("arm"), DownloadURL: Ptr("https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm-2.164.0.tar.gz"), Filename: Ptr("actions-runner-linux-arm-2.164.0.tar.gz")}, + {OS: Ptr("win"), Architecture: Ptr("x64"), DownloadURL: Ptr("https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-win-x64-2.164.0.zip"), Filename: Ptr("actions-runner-win-x64-2.164.0.zip")}, + {OS: Ptr("linux"), Architecture: Ptr("arm64"), DownloadURL: Ptr("https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm64-2.164.0.tar.gz"), Filename: Ptr("actions-runner-linux-arm64-2.164.0.tar.gz")}, } if !cmp.Equal(downloads, want) { t.Errorf("Actions.ListRunnerApplicationDownloads returned %+v, want %+v", downloads, want) @@ -81,7 +81,7 @@ func TestActionsService_GenerateOrgJITConfig(t *testing.T) { t.Errorf("Actions.GenerateOrgJITConfig returned error: %v", err) } - want := &JITRunnerConfig{EncodedJITConfig: String("foo")} + want := &JITRunnerConfig{EncodedJITConfig: Ptr("foo")} if !cmp.Equal(jitConfig, want) { t.Errorf("Actions.GenerateOrgJITConfig returned %+v, want %+v", jitConfig, want) } @@ -125,7 +125,7 @@ func TestActionsService_GenerateRepoJITConfig(t *testing.T) { t.Errorf("Actions.GenerateRepoJITConfig returned error: %v", err) } - want := &JITRunnerConfig{EncodedJITConfig: String("foo")} + want := &JITRunnerConfig{EncodedJITConfig: Ptr("foo")} if !cmp.Equal(jitConfig, want) { t.Errorf("Actions.GenerateRepoJITConfig returned %+v, want %+v", jitConfig, want) } @@ -160,7 +160,7 @@ func TestActionsService_CreateRegistrationToken(t *testing.T) { t.Errorf("Actions.CreateRegistrationToken returned error: %v", err) } - want := &RegistrationToken{Token: String("LLBF3JGZDX3P5PMEXLND6TS6FCWO6"), + want := &RegistrationToken{Token: Ptr("LLBF3JGZDX3P5PMEXLND6TS6FCWO6"), ExpiresAt: &Timestamp{time.Date(2020, time.January, 22, 12, 13, 35, 123000000, time.UTC)}} if !cmp.Equal(token, want) { @@ -193,7 +193,7 @@ func TestActionsService_ListRunners(t *testing.T) { }) opts := &ListRunnersOptions{ - Name: String("MBP"), + Name: Ptr("MBP"), ListOptions: ListOptions{Page: 2, PerPage: 2}, } ctx := context.Background() @@ -205,7 +205,7 @@ func TestActionsService_ListRunners(t *testing.T) { want := &Runners{ TotalCount: 1, Runners: []*Runner{ - {ID: Int64(23), Name: String("MBP"), OS: String("macos"), Status: String("online")}, + {ID: Ptr(int64(23)), Name: Ptr("MBP"), OS: Ptr("macos"), Status: Ptr("online")}, }, } if !cmp.Equal(runners, want) { @@ -243,10 +243,10 @@ func TestActionsService_GetRunner(t *testing.T) { } want := &Runner{ - ID: Int64(23), - Name: String("MBP"), - OS: String("macos"), - Status: String("online"), + ID: Ptr(int64(23)), + Name: Ptr("MBP"), + OS: Ptr("macos"), + Status: Ptr("online"), } if !cmp.Equal(runner, want) { t.Errorf("Actions.GetRunner returned %+v, want %+v", runner, want) @@ -282,7 +282,7 @@ func TestActionsService_CreateRemoveToken(t *testing.T) { t.Errorf("Actions.CreateRemoveToken returned error: %v", err) } - want := &RemoveToken{Token: String("AABF3JGZDX3P5PMEXLND6TS6FCWO6"), ExpiresAt: &Timestamp{time.Date(2020, time.January, 29, 12, 13, 35, 123000000, time.UTC)}} + want := &RemoveToken{Token: Ptr("AABF3JGZDX3P5PMEXLND6TS6FCWO6"), ExpiresAt: &Timestamp{time.Date(2020, time.January, 29, 12, 13, 35, 123000000, time.UTC)}} if !cmp.Equal(token, want) { t.Errorf("Actions.CreateRemoveToken returned %+v, want %+v", token, want) } @@ -343,11 +343,11 @@ func TestActionsService_ListOrganizationRunnerApplicationDownloads(t *testing.T) } want := []*RunnerApplicationDownload{ - {OS: String("osx"), Architecture: String("x64"), DownloadURL: String("https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-osx-x64-2.164.0.tar.gz"), Filename: String("actions-runner-osx-x64-2.164.0.tar.gz")}, - {OS: String("linux"), Architecture: String("x64"), DownloadURL: String("https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-x64-2.164.0.tar.gz"), Filename: String("actions-runner-linux-x64-2.164.0.tar.gz")}, - {OS: String("linux"), Architecture: String("arm"), DownloadURL: String("https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm-2.164.0.tar.gz"), Filename: String("actions-runner-linux-arm-2.164.0.tar.gz")}, - {OS: String("win"), Architecture: String("x64"), DownloadURL: String("https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-win-x64-2.164.0.zip"), Filename: String("actions-runner-win-x64-2.164.0.zip")}, - {OS: String("linux"), Architecture: String("arm64"), DownloadURL: String("https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm64-2.164.0.tar.gz"), Filename: String("actions-runner-linux-arm64-2.164.0.tar.gz")}, + {OS: Ptr("osx"), Architecture: Ptr("x64"), DownloadURL: Ptr("https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-osx-x64-2.164.0.tar.gz"), Filename: Ptr("actions-runner-osx-x64-2.164.0.tar.gz")}, + {OS: Ptr("linux"), Architecture: Ptr("x64"), DownloadURL: Ptr("https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-x64-2.164.0.tar.gz"), Filename: Ptr("actions-runner-linux-x64-2.164.0.tar.gz")}, + {OS: Ptr("linux"), Architecture: Ptr("arm"), DownloadURL: Ptr("https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm-2.164.0.tar.gz"), Filename: Ptr("actions-runner-linux-arm-2.164.0.tar.gz")}, + {OS: Ptr("win"), Architecture: Ptr("x64"), DownloadURL: Ptr("https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-win-x64-2.164.0.zip"), Filename: Ptr("actions-runner-win-x64-2.164.0.zip")}, + {OS: Ptr("linux"), Architecture: Ptr("arm64"), DownloadURL: Ptr("https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm64-2.164.0.tar.gz"), Filename: Ptr("actions-runner-linux-arm64-2.164.0.tar.gz")}, } if !cmp.Equal(downloads, want) { t.Errorf("Actions.ListOrganizationRunnerApplicationDownloads returned %+v, want %+v", downloads, want) @@ -383,7 +383,7 @@ func TestActionsService_CreateOrganizationRegistrationToken(t *testing.T) { t.Errorf("Actions.CreateRegistrationToken returned error: %v", err) } - want := &RegistrationToken{Token: String("LLBF3JGZDX3P5PMEXLND6TS6FCWO6"), + want := &RegistrationToken{Token: Ptr("LLBF3JGZDX3P5PMEXLND6TS6FCWO6"), ExpiresAt: &Timestamp{time.Date(2020, time.January, 22, 12, 13, 35, 123000000, time.UTC)}} if !cmp.Equal(token, want) { @@ -427,8 +427,8 @@ func TestActionsService_ListOrganizationRunners(t *testing.T) { want := &Runners{ TotalCount: 2, Runners: []*Runner{ - {ID: Int64(23), Name: String("MBP"), OS: String("macos"), Status: String("online")}, - {ID: Int64(24), Name: String("iMac"), OS: String("macos"), Status: String("offline")}, + {ID: Ptr(int64(23)), Name: Ptr("MBP"), OS: Ptr("macos"), Status: Ptr("online")}, + {ID: Ptr(int64(24)), Name: Ptr("iMac"), OS: Ptr("macos"), Status: Ptr("offline")}, }, } if !cmp.Equal(runners, want) { @@ -466,10 +466,10 @@ func TestActionsService_GetOrganizationRunner(t *testing.T) { } want := &Runner{ - ID: Int64(23), - Name: String("MBP"), - OS: String("macos"), - Status: String("online"), + ID: Ptr(int64(23)), + Name: Ptr("MBP"), + OS: Ptr("macos"), + Status: Ptr("online"), } if !cmp.Equal(runner, want) { t.Errorf("Actions.GetRunner returned %+v, want %+v", runner, want) @@ -505,7 +505,7 @@ func TestActionsService_CreateOrganizationRemoveToken(t *testing.T) { t.Errorf("Actions.CreateRemoveToken returned error: %v", err) } - want := &RemoveToken{Token: String("AABF3JGZDX3P5PMEXLND6TS6FCWO6"), ExpiresAt: &Timestamp{time.Date(2020, time.January, 29, 12, 13, 35, 123000000, time.UTC)}} + want := &RemoveToken{Token: Ptr("AABF3JGZDX3P5PMEXLND6TS6FCWO6"), ExpiresAt: &Timestamp{time.Date(2020, time.January, 29, 12, 13, 35, 123000000, time.UTC)}} if !cmp.Equal(token, want) { t.Errorf("Actions.CreateRemoveToken returned %+v, want %+v", token, want) } @@ -555,12 +555,12 @@ func TestRunnerApplicationDownload_Marshal(t *testing.T) { testJSONMarshal(t, &RunnerApplicationDownload{}, "{}") u := &RunnerApplicationDownload{ - OS: String("o"), - Architecture: String("a"), - DownloadURL: String("d"), - Filename: String("f"), - TempDownloadToken: String("t"), - SHA256Checksum: String("s"), + OS: Ptr("o"), + Architecture: Ptr("a"), + DownloadURL: Ptr("d"), + Filename: Ptr("f"), + TempDownloadToken: Ptr("t"), + SHA256Checksum: Ptr("s"), } want := `{ @@ -583,9 +583,9 @@ func TestActionsEnabledOnOrgRepos_Marshal(t *testing.T) { TotalCount: 1, Repositories: []*Repository{ { - ID: Int64(1), - URL: String("u"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + Name: Ptr("n"), }, }, } @@ -609,7 +609,7 @@ func TestRegistrationToken_Marshal(t *testing.T) { testJSONMarshal(t, &RegistrationToken{}, "{}") u := &RegistrationToken{ - Token: String("t"), + Token: Ptr("t"), ExpiresAt: &Timestamp{referenceTime}, } @@ -626,9 +626,9 @@ func TestRunnerLabels_Marshal(t *testing.T) { testJSONMarshal(t, &RunnerLabels{}, "{}") u := &RunnerLabels{ - ID: Int64(1), - Name: String("n"), - Type: String("t"), + ID: Ptr(int64(1)), + Name: Ptr("n"), + Type: Ptr("t"), } want := `{ @@ -645,16 +645,16 @@ func TestRunner_Marshal(t *testing.T) { testJSONMarshal(t, &Runner{}, "{}") u := &Runner{ - ID: Int64(1), - Name: String("n"), - OS: String("o"), - Status: String("s"), - Busy: Bool(false), + ID: Ptr(int64(1)), + Name: Ptr("n"), + OS: Ptr("o"), + Status: Ptr("s"), + Busy: Ptr(false), Labels: []*RunnerLabels{ { - ID: Int64(1), - Name: String("n"), - Type: String("t"), + ID: Ptr(int64(1)), + Name: Ptr("n"), + Type: Ptr("t"), }, }, } @@ -685,16 +685,16 @@ func TestRunners_Marshal(t *testing.T) { TotalCount: 1, Runners: []*Runner{ { - ID: Int64(1), - Name: String("n"), - OS: String("o"), - Status: String("s"), - Busy: Bool(false), + ID: Ptr(int64(1)), + Name: Ptr("n"), + OS: Ptr("o"), + Status: Ptr("s"), + Busy: Ptr(false), Labels: []*RunnerLabels{ { - ID: Int64(1), - Name: String("n"), - Type: String("t"), + ID: Ptr(int64(1)), + Name: Ptr("n"), + Type: Ptr("t"), }, }, }, @@ -729,7 +729,7 @@ func TestRemoveToken_Marshal(t *testing.T) { testJSONMarshal(t, &RemoveToken{}, "{}") u := &RemoveToken{ - Token: String("t"), + Token: Ptr("t"), ExpiresAt: &Timestamp{referenceTime}, } diff --git a/github/actions_secrets.go b/github/actions_secrets.go index ec519838eab..cba85c10042 100644 --- a/github/actions_secrets.go +++ b/github/actions_secrets.go @@ -39,7 +39,7 @@ func (p *PublicKey) UnmarshalJSON(data []byte) error { case string: p.KeyID = &v case float64: - p.KeyID = String(strconv.FormatFloat(v, 'f', -1, 64)) + p.KeyID = Ptr(strconv.FormatFloat(v, 'f', -1, 64)) default: return fmt.Errorf("unable to unmarshal %T as a string", v) } diff --git a/github/actions_secrets_test.go b/github/actions_secrets_test.go index e4cfc68e3db..ebf312f8170 100644 --- a/github/actions_secrets_test.go +++ b/github/actions_secrets_test.go @@ -35,17 +35,17 @@ func TestPublicKey_UnmarshalJSON(t *testing.T) { }, "Numeric KeyID": { data: []byte(`{"key_id":1234,"key":"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234"}`), - wantPublicKey: PublicKey{KeyID: String("1234"), Key: String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234")}, + wantPublicKey: PublicKey{KeyID: Ptr("1234"), Key: Ptr("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234")}, wantErr: false, }, "String KeyID": { data: []byte(`{"key_id":"1234","key":"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234"}`), - wantPublicKey: PublicKey{KeyID: String("1234"), Key: String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234")}, + wantPublicKey: PublicKey{KeyID: Ptr("1234"), Key: Ptr("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234")}, wantErr: false, }, "Invalid KeyID": { data: []byte(`{"key_id":["1234"],"key":"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234"}`), - wantPublicKey: PublicKey{KeyID: nil, Key: String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234")}, + wantPublicKey: PublicKey{KeyID: nil, Key: Ptr("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234")}, wantErr: true, }, "Invalid Key": { @@ -65,12 +65,12 @@ func TestPublicKey_UnmarshalJSON(t *testing.T) { }, "Missing Key": { data: []byte(`{"key_id":"1234"}`), - wantPublicKey: PublicKey{KeyID: String("1234")}, + wantPublicKey: PublicKey{KeyID: Ptr("1234")}, wantErr: false, }, "Missing KeyID": { data: []byte(`{"key":"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234"}`), - wantPublicKey: PublicKey{Key: String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234")}, + wantPublicKey: PublicKey{Key: Ptr("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234")}, wantErr: false, }, } @@ -109,7 +109,7 @@ func TestActionsService_GetRepoPublicKey(t *testing.T) { t.Errorf("Actions.GetRepoPublicKey returned error: %v", err) } - want := &PublicKey{KeyID: String("1234"), Key: String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234")} + want := &PublicKey{KeyID: Ptr("1234"), Key: Ptr("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234")} if !cmp.Equal(key, want) { t.Errorf("Actions.GetRepoPublicKey returned %+v, want %+v", key, want) } @@ -144,7 +144,7 @@ func TestActionsService_GetRepoPublicKeyNumeric(t *testing.T) { t.Errorf("Actions.GetRepoPublicKey returned error: %v", err) } - want := &PublicKey{KeyID: String("1234"), Key: String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234")} + want := &PublicKey{KeyID: Ptr("1234"), Key: Ptr("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234")} if !cmp.Equal(key, want) { t.Errorf("Actions.GetRepoPublicKey returned %+v, want %+v", key, want) } @@ -362,7 +362,7 @@ func TestActionsService_GetOrgPublicKey(t *testing.T) { t.Errorf("Actions.GetOrgPublicKey returned error: %v", err) } - want := &PublicKey{KeyID: String("012345678"), Key: String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234")} + want := &PublicKey{KeyID: Ptr("012345678"), Key: Ptr("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234")} if !cmp.Equal(key, want) { t.Errorf("Actions.GetOrgPublicKey returned %+v, want %+v", key, want) } @@ -519,9 +519,9 @@ func TestActionsService_ListSelectedReposForOrgSecret(t *testing.T) { } want := &SelectedReposList{ - TotalCount: Int(1), + TotalCount: Ptr(1), Repositories: []*Repository{ - {ID: Int64(1)}, + {ID: Ptr(int64(1))}, }, } if !cmp.Equal(repos, want) { @@ -578,7 +578,7 @@ func TestActionsService_AddSelectedRepoToOrgSecret(t *testing.T) { testMethod(t, r, "PUT") }) - repo := &Repository{ID: Int64(1234)} + repo := &Repository{ID: Ptr(int64(1234))} ctx := context.Background() _, err := client.Actions.AddSelectedRepoToOrgSecret(ctx, "o", "NAME", repo) if err != nil { @@ -604,7 +604,7 @@ func TestActionsService_RemoveSelectedRepoFromOrgSecret(t *testing.T) { testMethod(t, r, "DELETE") }) - repo := &Repository{ID: Int64(1234)} + repo := &Repository{ID: Ptr(int64(1234))} ctx := context.Background() _, err := client.Actions.RemoveSelectedRepoFromOrgSecret(ctx, "o", "NAME", repo) if err != nil { @@ -662,7 +662,7 @@ func TestActionsService_GetEnvPublicKey(t *testing.T) { t.Errorf("Actions.GetEnvPublicKey returned error: %v", err) } - want := &PublicKey{KeyID: String("1234"), Key: String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234")} + want := &PublicKey{KeyID: Ptr("1234"), Key: Ptr("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234")} if !cmp.Equal(key, want) { t.Errorf("Actions.GetEnvPublicKey returned %+v, want %+v", key, want) } @@ -697,7 +697,7 @@ func TestActionsService_GetEnvPublicKeyNumeric(t *testing.T) { t.Errorf("Actions.GetEnvPublicKey returned error: %v", err) } - want := &PublicKey{KeyID: String("1234"), Key: String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234")} + want := &PublicKey{KeyID: Ptr("1234"), Key: Ptr("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234")} if !cmp.Equal(key, want) { t.Errorf("Actions.GetEnvPublicKey returned %+v, want %+v", key, want) } @@ -862,8 +862,8 @@ func TestPublicKey_Marshal(t *testing.T) { testJSONMarshal(t, &PublicKey{}, "{}") u := &PublicKey{ - KeyID: String("kid"), - Key: String("k"), + KeyID: Ptr("kid"), + Key: Ptr("k"), } want := `{ @@ -956,12 +956,12 @@ func TestSelectedReposList_Marshal(t *testing.T) { testJSONMarshal(t, &SelectedReposList{}, "{}") u := &SelectedReposList{ - TotalCount: Int(1), + TotalCount: Ptr(1), Repositories: []*Repository{ { - ID: Int64(1), - URL: String("u"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + Name: Ptr("n"), }, }, } diff --git a/github/actions_variables_test.go b/github/actions_variables_test.go index 14ce9ee2827..5a1813ab73d 100644 --- a/github/actions_variables_test.go +++ b/github/actions_variables_test.go @@ -250,9 +250,9 @@ func TestActionsService_ListOrgVariables(t *testing.T) { want := &ActionsVariables{ TotalCount: 3, Variables: []*ActionsVariable{ - {Name: "A", Value: "AA", CreatedAt: &Timestamp{time.Date(2019, time.August, 10, 14, 59, 22, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 10, 14, 59, 22, 0, time.UTC)}, Visibility: String("private")}, - {Name: "B", Value: "BB", CreatedAt: &Timestamp{time.Date(2019, time.August, 10, 14, 59, 22, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 10, 14, 59, 22, 0, time.UTC)}, Visibility: String("all")}, - {Name: "C", Value: "CC", CreatedAt: &Timestamp{time.Date(2019, time.August, 10, 14, 59, 22, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 10, 14, 59, 22, 0, time.UTC)}, Visibility: String("selected"), SelectedRepositoriesURL: String("https://api.github.com/orgs/octo-org/actions/variables/VAR/repositories")}, + {Name: "A", Value: "AA", CreatedAt: &Timestamp{time.Date(2019, time.August, 10, 14, 59, 22, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 10, 14, 59, 22, 0, time.UTC)}, Visibility: Ptr("private")}, + {Name: "B", Value: "BB", CreatedAt: &Timestamp{time.Date(2019, time.August, 10, 14, 59, 22, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 10, 14, 59, 22, 0, time.UTC)}, Visibility: Ptr("all")}, + {Name: "C", Value: "CC", CreatedAt: &Timestamp{time.Date(2019, time.August, 10, 14, 59, 22, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 10, 14, 59, 22, 0, time.UTC)}, Visibility: Ptr("selected"), SelectedRepositoriesURL: Ptr("https://api.github.com/orgs/octo-org/actions/variables/VAR/repositories")}, }, } if !cmp.Equal(variables, want) { @@ -294,8 +294,8 @@ func TestActionsService_GetOrgVariable(t *testing.T) { Value: "VALUE", CreatedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}, - Visibility: String("selected"), - SelectedRepositoriesURL: String("https://api.github.com/orgs/octo-org/actions/variables/VAR/repositories"), + Visibility: Ptr("selected"), + SelectedRepositoriesURL: Ptr("https://api.github.com/orgs/octo-org/actions/variables/VAR/repositories"), } if !cmp.Equal(variable, want) { t.Errorf("Actions.GetOrgVariable returned %+v, want %+v", variable, want) @@ -330,7 +330,7 @@ func TestActionsService_CreateOrgVariable(t *testing.T) { input := &ActionsVariable{ Name: "NAME", Value: "VALUE", - Visibility: String("selected"), + Visibility: Ptr("selected"), SelectedRepositoryIDs: &SelectedRepoIDs{1296269, 1269280}, } ctx := context.Background() @@ -364,7 +364,7 @@ func TestActionsService_UpdateOrgVariable(t *testing.T) { input := &ActionsVariable{ Name: "NAME", Value: "VALUE", - Visibility: String("selected"), + Visibility: Ptr("selected"), SelectedRepositoryIDs: &SelectedRepoIDs{1296269, 1269280}, } ctx := context.Background() @@ -401,9 +401,9 @@ func TestActionsService_ListSelectedReposForOrgVariable(t *testing.T) { } want := &SelectedReposList{ - TotalCount: Int(1), + TotalCount: Ptr(1), Repositories: []*Repository{ - {ID: Int64(1)}, + {ID: Ptr(int64(1))}, }, } if !cmp.Equal(repos, want) { @@ -460,7 +460,7 @@ func TestActionsService_AddSelectedRepoToOrgVariable(t *testing.T) { testMethod(t, r, "PUT") }) - repo := &Repository{ID: Int64(1234)} + repo := &Repository{ID: Ptr(int64(1234))} ctx := context.Background() _, err := client.Actions.AddSelectedRepoToOrgVariable(ctx, "o", "NAME", repo) if err != nil { @@ -486,7 +486,7 @@ func TestActionsService_RemoveSelectedRepoFromOrgVariable(t *testing.T) { testMethod(t, r, "DELETE") }) - repo := &Repository{ID: Int64(1234)} + repo := &Repository{ID: Ptr(int64(1234))} ctx := context.Background() _, err := client.Actions.RemoveSelectedRepoFromOrgVariable(ctx, "o", "NAME", repo) if err != nil { @@ -710,8 +710,8 @@ func TestActionVariable_Marshal(t *testing.T) { Value: "v", CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - Visibility: String("v"), - SelectedRepositoriesURL: String("s"), + Visibility: Ptr("v"), + SelectedRepositoriesURL: Ptr("s"), SelectedRepositoryIDs: &SelectedRepoIDs{1, 2, 3}, } diff --git a/github/actions_workflow_jobs_test.go b/github/actions_workflow_jobs_test.go index f8bb9481b31..3ef5295afde 100644 --- a/github/actions_workflow_jobs_test.go +++ b/github/actions_workflow_jobs_test.go @@ -35,10 +35,10 @@ func TestActionsService_ListWorkflowJobs(t *testing.T) { } want := &Jobs{ - TotalCount: Int(4), + TotalCount: Ptr(4), Jobs: []*WorkflowJob{ - {ID: Int64(399444496), RunID: Int64(29679449), StartedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, CompletedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}}, - {ID: Int64(399444497), RunID: Int64(29679449), StartedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, CompletedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}}, + {ID: Ptr(int64(399444496)), RunID: Ptr(int64(29679449)), StartedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, CompletedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}}, + {ID: Ptr(int64(399444497)), RunID: Ptr(int64(29679449)), StartedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, CompletedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}}, }, } if !cmp.Equal(jobs, want) { @@ -78,10 +78,10 @@ func TestActionsService_ListWorkflowJobs_Filter(t *testing.T) { } want := &Jobs{ - TotalCount: Int(4), + TotalCount: Ptr(4), Jobs: []*WorkflowJob{ - {ID: Int64(399444496), RunID: Int64(29679449), StartedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, CompletedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}}, - {ID: Int64(399444497), RunID: Int64(29679449), StartedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, CompletedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}}, + {ID: Ptr(int64(399444496)), RunID: Ptr(int64(29679449)), StartedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, CompletedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}}, + {ID: Ptr(int64(399444497)), RunID: Ptr(int64(29679449)), StartedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, CompletedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}}, }, } if !cmp.Equal(jobs, want) { @@ -106,21 +106,21 @@ func TestActionsService_ListWorkflowJobsAttempt(t *testing.T) { } want := &Jobs{ - TotalCount: Int(4), + TotalCount: Ptr(4), Jobs: []*WorkflowJob{ { - ID: Int64(399444496), - RunID: Int64(29679449), + ID: Ptr(int64(399444496)), + RunID: Ptr(int64(29679449)), StartedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, CompletedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}, - RunAttempt: Int64(2), + RunAttempt: Ptr(int64(2)), }, { - ID: Int64(399444497), - RunID: Int64(29679449), + ID: Ptr(int64(399444497)), + RunID: Ptr(int64(29679449)), StartedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, CompletedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}, - RunAttempt: Int64(2), + RunAttempt: Ptr(int64(2)), }, }, } @@ -159,7 +159,7 @@ func TestActionsService_GetWorkflowJobByID(t *testing.T) { } want := &WorkflowJob{ - ID: Int64(399444496), + ID: Ptr(int64(399444496)), StartedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, CompletedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}, } @@ -273,10 +273,10 @@ func TestTaskStep_Marshal(t *testing.T) { testJSONMarshal(t, &TaskStep{}, "{}") u := &TaskStep{ - Name: String("n"), - Status: String("s"), - Conclusion: String("c"), - Number: Int64(1), + Name: Ptr("n"), + Status: Ptr("s"), + Conclusion: Ptr("c"), + Number: Ptr(int64(1)), StartedAt: &Timestamp{referenceTime}, CompletedAt: &Timestamp{referenceTime}, } @@ -298,32 +298,32 @@ func TestWorkflowJob_Marshal(t *testing.T) { testJSONMarshal(t, &WorkflowJob{}, "{}") u := &WorkflowJob{ - ID: Int64(1), - RunID: Int64(1), - RunURL: String("r"), - NodeID: String("n"), - HeadBranch: String("b"), - HeadSHA: String("h"), - URL: String("u"), - HTMLURL: String("h"), - Status: String("s"), - Conclusion: String("c"), + ID: Ptr(int64(1)), + RunID: Ptr(int64(1)), + RunURL: Ptr("r"), + NodeID: Ptr("n"), + HeadBranch: Ptr("b"), + HeadSHA: Ptr("h"), + URL: Ptr("u"), + HTMLURL: Ptr("h"), + Status: Ptr("s"), + Conclusion: Ptr("c"), CreatedAt: &Timestamp{referenceTime}, StartedAt: &Timestamp{referenceTime}, CompletedAt: &Timestamp{referenceTime}, - Name: String("n"), + Name: Ptr("n"), Steps: []*TaskStep{ { - Name: String("n"), - Status: String("s"), - Conclusion: String("c"), - Number: Int64(1), + Name: Ptr("n"), + Status: Ptr("s"), + Conclusion: Ptr("c"), + Number: Ptr(int64(1)), StartedAt: &Timestamp{referenceTime}, CompletedAt: &Timestamp{referenceTime}, }, }, - CheckRunURL: String("c"), - WorkflowName: String("w"), + CheckRunURL: Ptr("c"), + WorkflowName: Ptr("w"), } want := `{ @@ -361,36 +361,36 @@ func TestJobs_Marshal(t *testing.T) { testJSONMarshal(t, &Jobs{}, "{}") u := &Jobs{ - TotalCount: Int(1), + TotalCount: Ptr(1), Jobs: []*WorkflowJob{ { - ID: Int64(1), - RunID: Int64(1), - RunURL: String("r"), - NodeID: String("n"), - HeadBranch: String("b"), - HeadSHA: String("h"), - URL: String("u"), - HTMLURL: String("h"), - Status: String("s"), - Conclusion: String("c"), + ID: Ptr(int64(1)), + RunID: Ptr(int64(1)), + RunURL: Ptr("r"), + NodeID: Ptr("n"), + HeadBranch: Ptr("b"), + HeadSHA: Ptr("h"), + URL: Ptr("u"), + HTMLURL: Ptr("h"), + Status: Ptr("s"), + Conclusion: Ptr("c"), CreatedAt: &Timestamp{referenceTime}, StartedAt: &Timestamp{referenceTime}, CompletedAt: &Timestamp{referenceTime}, - Name: String("n"), + Name: Ptr("n"), Steps: []*TaskStep{ { - Name: String("n"), - Status: String("s"), - Conclusion: String("c"), - Number: Int64(1), + Name: Ptr("n"), + Status: Ptr("s"), + Conclusion: Ptr("c"), + Number: Ptr(int64(1)), StartedAt: &Timestamp{referenceTime}, CompletedAt: &Timestamp{referenceTime}, }, }, - CheckRunURL: String("c"), - RunAttempt: Int64(2), - WorkflowName: String("w"), + CheckRunURL: Ptr("c"), + RunAttempt: Ptr(int64(2)), + WorkflowName: Ptr("w"), }, }, } diff --git a/github/actions_workflow_runs_test.go b/github/actions_workflow_runs_test.go index ea6583ef583..4c91c5349ce 100644 --- a/github/actions_workflow_runs_test.go +++ b/github/actions_workflow_runs_test.go @@ -35,10 +35,10 @@ func TestActionsService_ListWorkflowRunsByID(t *testing.T) { } want := &WorkflowRuns{ - TotalCount: Int(4), + TotalCount: Ptr(4), WorkflowRuns: []*WorkflowRun{ - {ID: Int64(399444496), RunNumber: Int(296), CreatedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}}, - {ID: Int64(399444497), RunNumber: Int(296), CreatedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}}, + {ID: Ptr(int64(399444496)), RunNumber: Ptr(296), CreatedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}}, + {ID: Ptr(int64(399444497)), RunNumber: Ptr(296), CreatedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}}, }, } if !cmp.Equal(runs, want) { @@ -78,10 +78,10 @@ func TestActionsService_ListWorkflowRunsFileName(t *testing.T) { } want := &WorkflowRuns{ - TotalCount: Int(4), + TotalCount: Ptr(4), WorkflowRuns: []*WorkflowRun{ - {ID: Int64(399444496), RunNumber: Int(296), CreatedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}}, - {ID: Int64(399444497), RunNumber: Int(296), CreatedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}}, + {ID: Ptr(int64(399444496)), RunNumber: Ptr(296), CreatedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}}, + {ID: Ptr(int64(399444497)), RunNumber: Ptr(296), CreatedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}}, }, } if !cmp.Equal(runs, want) { @@ -119,8 +119,8 @@ func TestActionsService_GetWorkflowRunByID(t *testing.T) { } want := &WorkflowRun{ - ID: Int64(399444496), - RunNumber: Int(296), + ID: Ptr(int64(399444496)), + RunNumber: Ptr(296), CreatedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}, } @@ -154,7 +154,7 @@ func TestActionsService_GetWorkflowRunAttempt(t *testing.T) { fmt.Fprint(w, `{"id":399444496,"run_number":296,"run_attempt":3,"created_at":"2019-01-02T15:04:05Z","updated_at":"2020-01-02T15:04:05Z"}}`) }) - opts := &WorkflowRunAttemptOptions{ExcludePullRequests: Bool(true)} + opts := &WorkflowRunAttemptOptions{ExcludePullRequests: Ptr(true)} ctx := context.Background() runs, _, err := client.Actions.GetWorkflowRunAttempt(ctx, "o", "r", 29679449, 3, opts) if err != nil { @@ -162,9 +162,9 @@ func TestActionsService_GetWorkflowRunAttempt(t *testing.T) { } want := &WorkflowRun{ - ID: Int64(399444496), - RunNumber: Int(296), - RunAttempt: Int(3), + ID: Ptr(int64(399444496)), + RunNumber: Ptr(296), + RunAttempt: Ptr(3), CreatedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}, } @@ -491,10 +491,10 @@ func TestActionService_ListRepositoryWorkflowRuns(t *testing.T) { } expected := &WorkflowRuns{ - TotalCount: Int(2), + TotalCount: Ptr(2), WorkflowRuns: []*WorkflowRun{ - {ID: Int64(298499444), RunNumber: Int(301), CreatedAt: &Timestamp{time.Date(2020, time.April, 11, 11, 14, 54, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.April, 11, 11, 14, 54, 0, time.UTC)}}, - {ID: Int64(298499445), RunNumber: Int(302), CreatedAt: &Timestamp{time.Date(2020, time.April, 11, 11, 14, 54, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.April, 11, 11, 14, 54, 0, time.UTC)}}, + {ID: Ptr(int64(298499444)), RunNumber: Ptr(301), CreatedAt: &Timestamp{time.Date(2020, time.April, 11, 11, 14, 54, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.April, 11, 11, 14, 54, 0, time.UTC)}}, + {ID: Ptr(int64(298499445)), RunNumber: Ptr(302), CreatedAt: &Timestamp{time.Date(2020, time.April, 11, 11, 14, 54, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.April, 11, 11, 14, 54, 0, time.UTC)}}, }, } @@ -577,26 +577,26 @@ func TestPendingDeployment_Marshal(t *testing.T) { u := &PendingDeployment{ Environment: &PendingDeploymentEnvironment{ - ID: Int64(1), - NodeID: String("nid"), - Name: String("n"), - URL: String("u"), - HTMLURL: String("hu"), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + Name: Ptr("n"), + URL: Ptr("u"), + HTMLURL: Ptr("hu"), }, - WaitTimer: Int64(100), + WaitTimer: Ptr(int64(100)), WaitTimerStartedAt: &Timestamp{referenceTime}, - CurrentUserCanApprove: Bool(false), + CurrentUserCanApprove: Ptr(false), Reviewers: []*RequiredReviewer{ { - Type: String("User"), + Type: Ptr("User"), Reviewer: &User{ - Login: String("l"), + Login: Ptr("l"), }, }, { - Type: String("Team"), + Type: Ptr("Team"), Reviewer: &Team{ - Name: String("n"), + Name: Ptr("n"), }, }, }, @@ -697,35 +697,35 @@ func TestActionsService_GetWorkflowRunUsageByID(t *testing.T) { want := &WorkflowRunUsage{ Billable: &WorkflowRunBillMap{ "UBUNTU": &WorkflowRunBill{ - TotalMS: Int64(180000), - Jobs: Int(1), + TotalMS: Ptr(int64(180000)), + Jobs: Ptr(1), JobRuns: []*WorkflowRunJobRun{ { - JobID: Int(1), - DurationMS: Int64(60000), + JobID: Ptr(1), + DurationMS: Ptr(int64(60000)), }, }, }, "MACOS": &WorkflowRunBill{ - TotalMS: Int64(240000), - Jobs: Int(2), + TotalMS: Ptr(int64(240000)), + Jobs: Ptr(2), JobRuns: []*WorkflowRunJobRun{ { - JobID: Int(2), - DurationMS: Int64(30000), + JobID: Ptr(2), + DurationMS: Ptr(int64(30000)), }, { - JobID: Int(3), - DurationMS: Int64(10000), + JobID: Ptr(3), + DurationMS: Ptr(int64(10000)), }, }, }, "WINDOWS": &WorkflowRunBill{ - TotalMS: Int64(300000), - Jobs: Int(2), + TotalMS: Ptr(int64(300000)), + Jobs: Ptr(2), }, }, - RunDurationMS: Int64(500000), + RunDurationMS: Ptr(int64(500000)), } if !cmp.Equal(workflowRunUsage, want) { @@ -752,41 +752,41 @@ func TestWorkflowRun_Marshal(t *testing.T) { testJSONMarshal(t, &WorkflowRun{}, "{}") u := &WorkflowRun{ - ID: Int64(1), - Name: String("n"), - NodeID: String("nid"), - HeadBranch: String("hb"), - HeadSHA: String("hs"), - Path: String("p"), - RunNumber: Int(1), - RunAttempt: Int(1), - Event: String("e"), - Status: String("s"), - Conclusion: String("c"), - WorkflowID: Int64(1), - URL: String("u"), - HTMLURL: String("h"), + ID: Ptr(int64(1)), + Name: Ptr("n"), + NodeID: Ptr("nid"), + HeadBranch: Ptr("hb"), + HeadSHA: Ptr("hs"), + Path: Ptr("p"), + RunNumber: Ptr(1), + RunAttempt: Ptr(1), + Event: Ptr("e"), + Status: Ptr("s"), + Conclusion: Ptr("c"), + WorkflowID: Ptr(int64(1)), + URL: Ptr("u"), + HTMLURL: Ptr("h"), PullRequests: []*PullRequest{ { - URL: String("u"), - ID: Int64(1), - Number: Int(1), + URL: Ptr("u"), + ID: Ptr(int64(1)), + Number: Ptr(1), Head: &PullRequestBranch{ - Ref: String("r"), - SHA: String("s"), + Ref: Ptr("r"), + SHA: Ptr("s"), Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, }, Base: &PullRequestBranch{ - Ref: String("r"), - SHA: String("s"), + Ref: Ptr("r"), + SHA: Ptr("s"), Repo: &Repository{ - ID: Int64(1), - URL: String("u"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + Name: Ptr("n"), }, }, }, @@ -794,88 +794,88 @@ func TestWorkflowRun_Marshal(t *testing.T) { CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, RunStartedAt: &Timestamp{referenceTime}, - JobsURL: String("j"), - LogsURL: String("l"), - CheckSuiteURL: String("c"), - ArtifactsURL: String("a"), - CancelURL: String("c"), - RerunURL: String("r"), - PreviousAttemptURL: String("p"), + JobsURL: Ptr("j"), + LogsURL: Ptr("l"), + CheckSuiteURL: Ptr("c"), + ArtifactsURL: Ptr("a"), + CancelURL: Ptr("c"), + RerunURL: Ptr("r"), + PreviousAttemptURL: Ptr("p"), HeadCommit: &HeadCommit{ - Message: String("m"), + Message: Ptr("m"), Author: &CommitAuthor{ - Name: String("n"), - Email: String("e"), - Login: String("l"), + Name: Ptr("n"), + Email: Ptr("e"), + Login: Ptr("l"), }, - URL: String("u"), - Distinct: Bool(false), - SHA: String("s"), - ID: String("i"), - TreeID: String("tid"), + URL: Ptr("u"), + Distinct: Ptr(false), + SHA: Ptr("s"), + ID: Ptr("i"), + TreeID: Ptr("tid"), Timestamp: &Timestamp{referenceTime}, Committer: &CommitAuthor{ - Name: String("n"), - Email: String("e"), - Login: String("l"), + Name: Ptr("n"), + Email: Ptr("e"), + Login: Ptr("l"), }, }, - WorkflowURL: String("w"), + WorkflowURL: Ptr("w"), Repository: &Repository{ - ID: Int64(1), - URL: String("u"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + Name: Ptr("n"), }, HeadRepository: &Repository{ - ID: Int64(1), - URL: String("u"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + Name: Ptr("n"), }, Actor: &User{ - Login: String("l"), - ID: Int64(1), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, - URL: String("u"), + URL: Ptr("u"), }, TriggeringActor: &User{ - Login: String("l2"), - ID: Int64(2), - AvatarURL: String("a2"), - GravatarID: String("g2"), - Name: String("n2"), - Company: String("c2"), - Blog: String("b2"), - Location: String("l2"), - Email: String("e2"), - Hireable: Bool(false), - Bio: String("b2"), - TwitterUsername: String("t2"), - PublicRepos: Int(2), - Followers: Int(2), - Following: Int(2), + Login: Ptr("l2"), + ID: Ptr(int64(2)), + AvatarURL: Ptr("a2"), + GravatarID: Ptr("g2"), + Name: Ptr("n2"), + Company: Ptr("c2"), + Blog: Ptr("b2"), + Location: Ptr("l2"), + Email: Ptr("e2"), + Hireable: Ptr(false), + Bio: Ptr("b2"), + TwitterUsername: Ptr("t2"), + PublicRepos: Ptr(2), + Followers: Ptr(2), + Following: Ptr(2), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, - URL: String("u2"), + URL: Ptr("u2"), }, ReferencedWorkflows: []*ReferencedWorkflow{ { - Path: String("rwfp"), - SHA: String("rwfsha"), - Ref: String("rwfref"), + Path: Ptr("rwfp"), + SHA: Ptr("rwfsha"), + Ref: Ptr("rwfref"), }, }, } @@ -1017,43 +1017,43 @@ func TestWorkflowRuns_Marshal(t *testing.T) { testJSONMarshal(t, &WorkflowRuns{}, "{}") u := &WorkflowRuns{ - TotalCount: Int(1), + TotalCount: Ptr(1), WorkflowRuns: []*WorkflowRun{ { - ID: Int64(1), - Name: String("n"), - NodeID: String("nid"), - HeadBranch: String("hb"), - HeadSHA: String("hs"), - RunNumber: Int(1), - RunAttempt: Int(1), - Event: String("e"), - Status: String("s"), - Conclusion: String("c"), - WorkflowID: Int64(1), - URL: String("u"), - HTMLURL: String("h"), + ID: Ptr(int64(1)), + Name: Ptr("n"), + NodeID: Ptr("nid"), + HeadBranch: Ptr("hb"), + HeadSHA: Ptr("hs"), + RunNumber: Ptr(1), + RunAttempt: Ptr(1), + Event: Ptr("e"), + Status: Ptr("s"), + Conclusion: Ptr("c"), + WorkflowID: Ptr(int64(1)), + URL: Ptr("u"), + HTMLURL: Ptr("h"), PullRequests: []*PullRequest{ { - URL: String("u"), - ID: Int64(1), - Number: Int(1), + URL: Ptr("u"), + ID: Ptr(int64(1)), + Number: Ptr(1), Head: &PullRequestBranch{ - Ref: String("r"), - SHA: String("s"), + Ref: Ptr("r"), + SHA: Ptr("s"), Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, }, Base: &PullRequestBranch{ - Ref: String("r"), - SHA: String("s"), + Ref: Ptr("r"), + SHA: Ptr("s"), Repo: &Repository{ - ID: Int64(1), - URL: String("u"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + Name: Ptr("n"), }, }, }, @@ -1061,82 +1061,82 @@ func TestWorkflowRuns_Marshal(t *testing.T) { CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, RunStartedAt: &Timestamp{referenceTime}, - JobsURL: String("j"), - LogsURL: String("l"), - CheckSuiteURL: String("c"), - ArtifactsURL: String("a"), - CancelURL: String("c"), - RerunURL: String("r"), - PreviousAttemptURL: String("p"), + JobsURL: Ptr("j"), + LogsURL: Ptr("l"), + CheckSuiteURL: Ptr("c"), + ArtifactsURL: Ptr("a"), + CancelURL: Ptr("c"), + RerunURL: Ptr("r"), + PreviousAttemptURL: Ptr("p"), HeadCommit: &HeadCommit{ - Message: String("m"), + Message: Ptr("m"), Author: &CommitAuthor{ - Name: String("n"), - Email: String("e"), - Login: String("l"), + Name: Ptr("n"), + Email: Ptr("e"), + Login: Ptr("l"), }, - URL: String("u"), - Distinct: Bool(false), - SHA: String("s"), - ID: String("i"), - TreeID: String("tid"), + URL: Ptr("u"), + Distinct: Ptr(false), + SHA: Ptr("s"), + ID: Ptr("i"), + TreeID: Ptr("tid"), Timestamp: &Timestamp{referenceTime}, Committer: &CommitAuthor{ - Name: String("n"), - Email: String("e"), - Login: String("l"), + Name: Ptr("n"), + Email: Ptr("e"), + Login: Ptr("l"), }, }, - WorkflowURL: String("w"), + WorkflowURL: Ptr("w"), Repository: &Repository{ - ID: Int64(1), - URL: String("u"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + Name: Ptr("n"), }, HeadRepository: &Repository{ - ID: Int64(1), - URL: String("u"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + Name: Ptr("n"), }, Actor: &User{ - Login: String("l"), - ID: Int64(1), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, - URL: String("u"), + URL: Ptr("u"), }, TriggeringActor: &User{ - Login: String("l2"), - ID: Int64(2), - AvatarURL: String("a2"), - GravatarID: String("g2"), - Name: String("n2"), - Company: String("c2"), - Blog: String("b2"), - Location: String("l2"), - Email: String("e2"), - Hireable: Bool(false), - Bio: String("b2"), - TwitterUsername: String("t2"), - PublicRepos: Int(2), - Followers: Int(2), - Following: Int(2), + Login: Ptr("l2"), + ID: Ptr(int64(2)), + AvatarURL: Ptr("a2"), + GravatarID: Ptr("g2"), + Name: Ptr("n2"), + Company: Ptr("c2"), + Blog: Ptr("b2"), + Location: Ptr("l2"), + Email: Ptr("e2"), + Hireable: Ptr(false), + Bio: Ptr("b2"), + TwitterUsername: Ptr("t2"), + PublicRepos: Ptr(2), + Followers: Ptr(2), + Following: Ptr(2), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, - URL: String("u2"), + URL: Ptr("u2"), }, }, }, @@ -1276,8 +1276,8 @@ func TestWorkflowRunBill_Marshal(t *testing.T) { testJSONMarshal(t, &WorkflowRunBill{}, "{}") u := &WorkflowRunBill{ - TotalMS: Int64(1), - Jobs: Int(1), + TotalMS: Ptr(int64(1)), + Jobs: Ptr(1), } want := `{ @@ -1294,16 +1294,16 @@ func TestWorkflowRunBillMap_Marshal(t *testing.T) { u := &WorkflowRunBillMap{ "UBUNTU": &WorkflowRunBill{ - TotalMS: Int64(1), - Jobs: Int(1), + TotalMS: Ptr(int64(1)), + Jobs: Ptr(1), }, "MACOS": &WorkflowRunBill{ - TotalMS: Int64(1), - Jobs: Int(1), + TotalMS: Ptr(int64(1)), + Jobs: Ptr(1), }, "WINDOWS": &WorkflowRunBill{ - TotalMS: Int64(1), - Jobs: Int(1), + TotalMS: Ptr(int64(1)), + Jobs: Ptr(1), }, } @@ -1332,19 +1332,19 @@ func TestWorkflowRunUsage_Marshal(t *testing.T) { u := &WorkflowRunUsage{ Billable: &WorkflowRunBillMap{ "UBUNTU": &WorkflowRunBill{ - TotalMS: Int64(1), - Jobs: Int(1), + TotalMS: Ptr(int64(1)), + Jobs: Ptr(1), }, "MACOS": &WorkflowRunBill{ - TotalMS: Int64(1), - Jobs: Int(1), + TotalMS: Ptr(int64(1)), + Jobs: Ptr(1), }, "WINDOWS": &WorkflowRunBill{ - TotalMS: Int64(1), - Jobs: Int(1), + TotalMS: Ptr(int64(1)), + Jobs: Ptr(1), }, }, - RunDurationMS: Int64(1), + RunDurationMS: Ptr(int64(1)), } want := `{ @@ -1392,7 +1392,7 @@ func TestActionService_PendingDeployments(t *testing.T) { t.Errorf("Actions.PendingDeployments returned error: %v", err) } - want := []*Deployment{{ID: Int64(1)}, {ID: Int64(2)}} + want := []*Deployment{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}} if !cmp.Equal(deployments, want) { t.Errorf("Actions.PendingDeployments returned %+v, want %+v", deployments, want) } @@ -1471,40 +1471,40 @@ func TestActionService_GetPendingDeployments(t *testing.T) { want := []*PendingDeployment{ { Environment: &PendingDeploymentEnvironment{ - ID: Int64(1), - NodeID: String("nid"), - Name: String("n"), - URL: String("u"), - HTMLURL: String("hu"), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + Name: Ptr("n"), + URL: Ptr("u"), + HTMLURL: Ptr("hu"), }, - WaitTimer: Int64(0), + WaitTimer: Ptr(int64(0)), WaitTimerStartedAt: &Timestamp{referenceTime}, - CurrentUserCanApprove: Bool(false), + CurrentUserCanApprove: Ptr(false), Reviewers: []*RequiredReviewer{}, }, { Environment: &PendingDeploymentEnvironment{ - ID: Int64(2), - NodeID: String("nid"), - Name: String("n"), - URL: String("u"), - HTMLURL: String("hu"), + ID: Ptr(int64(2)), + NodeID: Ptr("nid"), + Name: Ptr("n"), + URL: Ptr("u"), + HTMLURL: Ptr("hu"), }, - WaitTimer: Int64(13), + WaitTimer: Ptr(int64(13)), WaitTimerStartedAt: &Timestamp{referenceTime}, - CurrentUserCanApprove: Bool(true), + CurrentUserCanApprove: Ptr(true), Reviewers: []*RequiredReviewer{ { - Type: String("User"), + Type: Ptr("User"), Reviewer: &User{ - Login: String("l"), + Login: Ptr("l"), }, }, { - Type: String("Team"), + Type: Ptr("Team"), Reviewer: &Team{ - Name: String("t"), - Slug: String("s"), + Name: Ptr("t"), + Slug: Ptr("s"), }, }, }, diff --git a/github/actions_workflows_test.go b/github/actions_workflows_test.go index 7a42cabde23..baaae7bfb9d 100644 --- a/github/actions_workflows_test.go +++ b/github/actions_workflows_test.go @@ -34,10 +34,10 @@ func TestActionsService_ListWorkflows(t *testing.T) { } want := &Workflows{ - TotalCount: Int(4), + TotalCount: Ptr(4), Workflows: []*Workflow{ - {ID: Int64(72844), CreatedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}}, - {ID: Int64(72845), CreatedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}}, + {ID: Ptr(int64(72844)), CreatedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}}, + {ID: Ptr(int64(72845)), CreatedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}}, }, } if !cmp.Equal(workflows, want) { @@ -75,7 +75,7 @@ func TestActionsService_GetWorkflowByID(t *testing.T) { } want := &Workflow{ - ID: Int64(72844), + ID: Ptr(int64(72844)), CreatedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}, } @@ -114,7 +114,7 @@ func TestActionsService_GetWorkflowByFileName(t *testing.T) { } want := &Workflow{ - ID: Int64(72844), + ID: Ptr(int64(72844)), CreatedAt: &Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 02, 15, 04, 05, 0, time.UTC)}, } @@ -155,13 +155,13 @@ func TestActionsService_GetWorkflowUsageByID(t *testing.T) { want := &WorkflowUsage{ Billable: &WorkflowBillMap{ "UBUNTU": &WorkflowBill{ - TotalMS: Int64(180000), + TotalMS: Ptr(int64(180000)), }, "MACOS": &WorkflowBill{ - TotalMS: Int64(240000), + TotalMS: Ptr(int64(240000)), }, "WINDOWS": &WorkflowBill{ - TotalMS: Int64(300000), + TotalMS: Ptr(int64(300000)), }, }, } @@ -202,13 +202,13 @@ func TestActionsService_GetWorkflowUsageByFileName(t *testing.T) { want := &WorkflowUsage{ Billable: &WorkflowBillMap{ "UBUNTU": &WorkflowBill{ - TotalMS: Int64(180000), + TotalMS: Ptr(int64(180000)), }, "MACOS": &WorkflowBill{ - TotalMS: Int64(240000), + TotalMS: Ptr(int64(240000)), }, "WINDOWS": &WorkflowBill{ - TotalMS: Int64(300000), + TotalMS: Ptr(int64(300000)), }, }, } @@ -464,16 +464,16 @@ func TestWorkflow_Marshal(t *testing.T) { testJSONMarshal(t, &Workflow{}, "{}") u := &Workflow{ - ID: Int64(1), - NodeID: String("nid"), - Name: String("n"), - Path: String("p"), - State: String("s"), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + Name: Ptr("n"), + Path: Ptr("p"), + State: Ptr("s"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - URL: String("u"), - HTMLURL: String("h"), - BadgeURL: String("b"), + URL: Ptr("u"), + HTMLURL: Ptr("h"), + BadgeURL: Ptr("b"), } want := `{ @@ -497,19 +497,19 @@ func TestWorkflows_Marshal(t *testing.T) { testJSONMarshal(t, &Workflows{}, "{}") u := &Workflows{ - TotalCount: Int(1), + TotalCount: Ptr(1), Workflows: []*Workflow{ { - ID: Int64(1), - NodeID: String("nid"), - Name: String("n"), - Path: String("p"), - State: String("s"), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + Name: Ptr("n"), + Path: Ptr("p"), + State: Ptr("s"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - URL: String("u"), - HTMLURL: String("h"), - BadgeURL: String("b"), + URL: Ptr("u"), + HTMLURL: Ptr("h"), + BadgeURL: Ptr("b"), }, }, } @@ -538,7 +538,7 @@ func TestWorkflowBill_Marshal(t *testing.T) { testJSONMarshal(t, &WorkflowBill{}, "{}") u := &WorkflowBill{ - TotalMS: Int64(1), + TotalMS: Ptr(int64(1)), } want := `{ @@ -554,13 +554,13 @@ func TestWorkflowBillMap_Marshal(t *testing.T) { u := &WorkflowBillMap{ "UBUNTU": &WorkflowBill{ - TotalMS: Int64(1), + TotalMS: Ptr(int64(1)), }, "MACOS": &WorkflowBill{ - TotalMS: Int64(1), + TotalMS: Ptr(int64(1)), }, "WINDOWS": &WorkflowBill{ - TotalMS: Int64(1), + TotalMS: Ptr(int64(1)), }, } @@ -586,13 +586,13 @@ func TestWorkflowUsage_Marshal(t *testing.T) { u := &WorkflowUsage{ Billable: &WorkflowBillMap{ "UBUNTU": &WorkflowBill{ - TotalMS: Int64(1), + TotalMS: Ptr(int64(1)), }, "MACOS": &WorkflowBill{ - TotalMS: Int64(1), + TotalMS: Ptr(int64(1)), }, "WINDOWS": &WorkflowBill{ - TotalMS: Int64(1), + TotalMS: Ptr(int64(1)), }, }, } diff --git a/github/activity_events_test.go b/github/activity_events_test.go index d9025725b6a..cf38b4b6799 100644 --- a/github/activity_events_test.go +++ b/github/activity_events_test.go @@ -34,7 +34,7 @@ func TestActivityService_ListEvents(t *testing.T) { t.Errorf("Activities.ListEvents returned error: %v", err) } - want := []*Event{{ID: String("1")}, {ID: String("2")}} + want := []*Event{{ID: Ptr("1")}, {ID: Ptr("2")}} if !cmp.Equal(events, want) { t.Errorf("Activities.ListEvents returned %+v, want %+v", events, want) } @@ -68,7 +68,7 @@ func TestActivityService_ListRepositoryEvents(t *testing.T) { t.Errorf("Activities.ListRepositoryEvents returned error: %v", err) } - want := []*Event{{ID: String("1")}, {ID: String("2")}} + want := []*Event{{ID: Ptr("1")}, {ID: Ptr("2")}} if !cmp.Equal(events, want) { t.Errorf("Activities.ListRepositoryEvents returned %+v, want %+v", events, want) } @@ -116,7 +116,7 @@ func TestActivityService_ListIssueEventsForRepository(t *testing.T) { t.Errorf("Activities.ListIssueEventsForRepository returned error: %v", err) } - want := []*IssueEvent{{ID: Int64(1)}, {ID: Int64(2)}} + want := []*IssueEvent{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}} if !cmp.Equal(events, want) { t.Errorf("Activities.ListIssueEventsForRepository returned %+v, want %+v", events, want) } @@ -164,7 +164,7 @@ func TestActivityService_ListEventsForRepoNetwork(t *testing.T) { t.Errorf("Activities.ListEventsForRepoNetwork returned error: %v", err) } - want := []*Event{{ID: String("1")}, {ID: String("2")}} + want := []*Event{{ID: Ptr("1")}, {ID: Ptr("2")}} if !cmp.Equal(events, want) { t.Errorf("Activities.ListEventsForRepoNetwork returned %+v, want %+v", events, want) } @@ -212,7 +212,7 @@ func TestActivityService_ListEventsForOrganization(t *testing.T) { t.Errorf("Activities.ListEventsForOrganization returned error: %v", err) } - want := []*Event{{ID: String("1")}, {ID: String("2")}} + want := []*Event{{ID: Ptr("1")}, {ID: Ptr("2")}} if !cmp.Equal(events, want) { t.Errorf("Activities.ListEventsForOrganization returned %+v, want %+v", events, want) } @@ -260,7 +260,7 @@ func TestActivityService_ListEventsPerformedByUser_all(t *testing.T) { t.Errorf("Events.ListPerformedByUser returned error: %v", err) } - want := []*Event{{ID: String("1")}, {ID: String("2")}} + want := []*Event{{ID: Ptr("1")}, {ID: Ptr("2")}} if !cmp.Equal(events, want) { t.Errorf("Events.ListPerformedByUser returned %+v, want %+v", events, want) } @@ -295,7 +295,7 @@ func TestActivityService_ListEventsPerformedByUser_publicOnly(t *testing.T) { t.Errorf("Events.ListPerformedByUser returned error: %v", err) } - want := []*Event{{ID: String("1")}, {ID: String("2")}} + want := []*Event{{ID: Ptr("1")}, {ID: Ptr("2")}} if !cmp.Equal(events, want) { t.Errorf("Events.ListPerformedByUser returned %+v, want %+v", events, want) } @@ -329,7 +329,7 @@ func TestActivityService_ListEventsReceivedByUser_all(t *testing.T) { t.Errorf("Events.ListReceivedByUser returned error: %v", err) } - want := []*Event{{ID: String("1")}, {ID: String("2")}} + want := []*Event{{ID: Ptr("1")}, {ID: Ptr("2")}} if !cmp.Equal(events, want) { t.Errorf("Events.ListReceivedUser returned %+v, want %+v", events, want) } @@ -364,7 +364,7 @@ func TestActivityService_ListEventsReceivedByUser_publicOnly(t *testing.T) { t.Errorf("Events.ListReceivedByUser returned error: %v", err) } - want := []*Event{{ID: String("1")}, {ID: String("2")}} + want := []*Event{{ID: Ptr("1")}, {ID: Ptr("2")}} if !cmp.Equal(events, want) { t.Errorf("Events.ListReceivedByUser returned %+v, want %+v", events, want) } @@ -398,7 +398,7 @@ func TestActivityService_ListUserEventsForOrganization(t *testing.T) { t.Errorf("Activities.ListUserEventsForOrganization returned error: %v", err) } - want := []*Event{{ID: String("1")}, {ID: String("2")}} + want := []*Event{{ID: Ptr("1")}, {ID: Ptr("2")}} if !cmp.Equal(events, want) { t.Errorf("Activities.ListUserEventsForOrganization returned %+v, want %+v", events, want) } @@ -426,7 +426,7 @@ func TestActivityService_EventParsePayload_typed(t *testing.T) { t.Fatalf("Unmarshal Event returned error: %v", err) } - want := &PushEvent{PushID: Int64(1)} + want := &PushEvent{PushID: Ptr(int64(1))} got, err := event.ParsePayload() if err != nil { t.Fatalf("ParsePayload returned unexpected error: %v", err) @@ -465,7 +465,7 @@ func TestActivityService_EventParsePayload_installation(t *testing.T) { t.Fatalf("Unmarshal Event returned error: %v", err) } - want := &PullRequestEvent{Installation: &Installation{ID: Int64(1)}} + want := &PullRequestEvent{Installation: &Installation{ID: Ptr(int64(1))}} got, err := event.ParsePayload() if err != nil { t.Fatalf("ParsePayload returned unexpected error: %v", err) diff --git a/github/activity_notifications_test.go b/github/activity_notifications_test.go index 03ecc8f66c7..6f3ae5b970e 100644 --- a/github/activity_notifications_test.go +++ b/github/activity_notifications_test.go @@ -44,7 +44,7 @@ func TestActivityService_ListNotification(t *testing.T) { t.Errorf("Activity.ListNotifications returned error: %v", err) } - want := []*Notification{{ID: String("1"), Subject: &NotificationSubject{Title: String("t")}}} + want := []*Notification{{ID: Ptr("1"), Subject: &NotificationSubject{Title: Ptr("t")}}} if !cmp.Equal(notifications, want) { t.Errorf("Activity.ListNotifications returned %+v, want %+v", notifications, want) } @@ -74,7 +74,7 @@ func TestActivityService_ListRepositoryNotifications(t *testing.T) { t.Errorf("Activity.ListRepositoryNotifications returned error: %v", err) } - want := []*Notification{{ID: String("1")}} + want := []*Notification{{ID: Ptr("1")}} if !cmp.Equal(notifications, want) { t.Errorf("Activity.ListRepositoryNotifications returned %+v, want %+v", notifications, want) } @@ -162,7 +162,7 @@ func TestActivityService_GetThread(t *testing.T) { t.Errorf("Activity.GetThread returned error: %v", err) } - want := &Notification{ID: String("1")} + want := &Notification{ID: Ptr("1")} if !cmp.Equal(notification, want) { t.Errorf("Activity.GetThread returned %+v, want %+v", notification, want) } @@ -249,7 +249,7 @@ func TestActivityService_GetThreadSubscription(t *testing.T) { t.Errorf("Activity.GetThreadSubscription returned error: %v", err) } - want := &Subscription{Subscribed: Bool(true)} + want := &Subscription{Subscribed: Ptr(true)} if !cmp.Equal(sub, want) { t.Errorf("Activity.GetThreadSubscription returned %+v, want %+v", sub, want) } @@ -273,7 +273,7 @@ func TestActivityService_SetThreadSubscription(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &Subscription{Subscribed: Bool(true)} + input := &Subscription{Subscribed: Ptr(true)} mux.HandleFunc("/notifications/threads/1/subscription", func(w http.ResponseWriter, r *http.Request) { v := new(Subscription) @@ -293,7 +293,7 @@ func TestActivityService_SetThreadSubscription(t *testing.T) { t.Errorf("Activity.SetThreadSubscription returned error: %v", err) } - want := &Subscription{Ignored: Bool(true)} + want := &Subscription{Ignored: Ptr(true)} if !cmp.Equal(sub, want) { t.Errorf("Activity.SetThreadSubscription returned %+v, want %+v", sub, want) } @@ -344,23 +344,23 @@ func TestNotification_Marshal(t *testing.T) { testJSONMarshal(t, &Notification{}, "{}") u := &Notification{ - ID: String("id"), + ID: Ptr("id"), Repository: &Repository{ - ID: Int64(1), - URL: String("u"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + Name: Ptr("n"), }, Subject: &NotificationSubject{ - Title: String("t"), - URL: String("u"), - LatestCommentURL: String("l"), - Type: String("t"), + Title: Ptr("t"), + URL: Ptr("u"), + LatestCommentURL: Ptr("l"), + Type: Ptr("t"), }, - Reason: String("r"), - Unread: Bool(true), + Reason: Ptr("r"), + Unread: Ptr(true), UpdatedAt: &Timestamp{referenceTime}, LastReadAt: &Timestamp{referenceTime}, - URL: String("u"), + URL: Ptr("u"), } want := `{ @@ -391,10 +391,10 @@ func TestNotificationSubject_Marshal(t *testing.T) { testJSONMarshal(t, &NotificationSubject{}, "{}") u := &NotificationSubject{ - Title: String("t"), - URL: String("u"), - LatestCommentURL: String("l"), - Type: String("t"), + Title: Ptr("t"), + URL: Ptr("u"), + LatestCommentURL: Ptr("l"), + Type: Ptr("t"), } want := `{ diff --git a/github/activity_star_test.go b/github/activity_star_test.go index ceb9e94ef65..1f1fbbc7488 100644 --- a/github/activity_star_test.go +++ b/github/activity_star_test.go @@ -36,7 +36,7 @@ func TestActivityService_ListStargazers(t *testing.T) { t.Errorf("Activity.ListStargazers returned error: %v", err) } - want := []*Stargazer{{StarredAt: &Timestamp{time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC)}, User: &User{ID: Int64(1)}}} + want := []*Stargazer{{StarredAt: &Timestamp{time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC)}, User: &User{ID: Ptr(int64(1))}}} if !cmp.Equal(stargazers, want) { t.Errorf("Activity.ListStargazers returned %+v, want %+v", stargazers, want) } @@ -72,7 +72,7 @@ func TestActivityService_ListStarred_authenticatedUser(t *testing.T) { t.Errorf("Activity.ListStarred returned error: %v", err) } - want := []*StarredRepository{{StarredAt: &Timestamp{time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC)}, Repository: &Repository{ID: Int64(1)}}} + want := []*StarredRepository{{StarredAt: &Timestamp{time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC)}, Repository: &Repository{ID: Ptr(int64(1))}}} if !cmp.Equal(repos, want) { t.Errorf("Activity.ListStarred returned %+v, want %+v", repos, want) } @@ -114,7 +114,7 @@ func TestActivityService_ListStarred_specifiedUser(t *testing.T) { t.Errorf("Activity.ListStarred returned error: %v", err) } - want := []*StarredRepository{{StarredAt: &Timestamp{time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC)}, Repository: &Repository{ID: Int64(2)}}} + want := []*StarredRepository{{StarredAt: &Timestamp{time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC)}, Repository: &Repository{ID: Ptr(int64(2))}}} if !cmp.Equal(repos, want) { t.Errorf("Activity.ListStarred returned %+v, want %+v", repos, want) } @@ -293,9 +293,9 @@ func TestStarredRepository_Marshal(t *testing.T) { u := &StarredRepository{ StarredAt: &Timestamp{referenceTime}, Repository: &Repository{ - ID: Int64(1), - URL: String("u"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + Name: Ptr("n"), }, } @@ -318,22 +318,22 @@ func TestStargazer_Marshal(t *testing.T) { u := &Stargazer{ StarredAt: &Timestamp{referenceTime}, User: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, diff --git a/github/activity_test.go b/github/activity_test.go index dc8d41c9a97..4ae35b3f938 100644 --- a/github/activity_test.go +++ b/github/activity_test.go @@ -88,44 +88,44 @@ var feedsJSON = []byte(`{ }`) var wantFeeds = &Feeds{ - TimelineURL: String("https://github.com/timeline"), - UserURL: String("https://github.com/{user}"), - CurrentUserPublicURL: String("https://github.com/defunkt"), - CurrentUserURL: String("https://github.com/defunkt.private?token=abc123"), - CurrentUserActorURL: String("https://github.com/defunkt.private.actor?token=abc123"), - CurrentUserOrganizationURL: String(""), + TimelineURL: Ptr("https://github.com/timeline"), + UserURL: Ptr("https://github.com/{user}"), + CurrentUserPublicURL: Ptr("https://github.com/defunkt"), + CurrentUserURL: Ptr("https://github.com/defunkt.private?token=abc123"), + CurrentUserActorURL: Ptr("https://github.com/defunkt.private.actor?token=abc123"), + CurrentUserOrganizationURL: Ptr(""), CurrentUserOrganizationURLs: []string{ "https://github.com/organizations/github/defunkt.private.atom?token=abc123", }, Links: &FeedLinks{ Timeline: &FeedLink{ - HRef: String("https://github.com/timeline"), - Type: String("application/atom+xml"), + HRef: Ptr("https://github.com/timeline"), + Type: Ptr("application/atom+xml"), }, User: &FeedLink{ - HRef: String("https://github.com/{user}"), - Type: String("application/atom+xml"), + HRef: Ptr("https://github.com/{user}"), + Type: Ptr("application/atom+xml"), }, CurrentUserPublic: &FeedLink{ - HRef: String("https://github.com/defunkt"), - Type: String("application/atom+xml"), + HRef: Ptr("https://github.com/defunkt"), + Type: Ptr("application/atom+xml"), }, CurrentUser: &FeedLink{ - HRef: String("https://github.com/defunkt.private?token=abc123"), - Type: String("application/atom+xml"), + HRef: Ptr("https://github.com/defunkt.private?token=abc123"), + Type: Ptr("application/atom+xml"), }, CurrentUserActor: &FeedLink{ - HRef: String("https://github.com/defunkt.private.actor?token=abc123"), - Type: String("application/atom+xml"), + HRef: Ptr("https://github.com/defunkt.private.actor?token=abc123"), + Type: Ptr("application/atom+xml"), }, CurrentUserOrganization: &FeedLink{ - HRef: String(""), - Type: String(""), + HRef: Ptr(""), + Type: Ptr(""), }, CurrentUserOrganizations: []*FeedLink{ { - HRef: String("https://github.com/organizations/github/defunkt.private.atom?token=abc123"), - Type: String("application/atom+xml"), + HRef: Ptr("https://github.com/organizations/github/defunkt.private.atom?token=abc123"), + Type: Ptr("application/atom+xml"), }, }, }, @@ -136,8 +136,8 @@ func TestFeedLink_Marshal(t *testing.T) { testJSONMarshal(t, &FeedLink{}, "{}") u := &FeedLink{ - HRef: String("h"), - Type: String("t"), + HRef: Ptr("h"), + Type: Ptr("t"), } want := `{ @@ -153,42 +153,42 @@ func TestFeeds_Marshal(t *testing.T) { testJSONMarshal(t, &Feeds{}, "{}") u := &Feeds{ - TimelineURL: String("t"), - UserURL: String("u"), - CurrentUserPublicURL: String("cupu"), - CurrentUserURL: String("cuu"), - CurrentUserActorURL: String("cuau"), - CurrentUserOrganizationURL: String("cuou"), + TimelineURL: Ptr("t"), + UserURL: Ptr("u"), + CurrentUserPublicURL: Ptr("cupu"), + CurrentUserURL: Ptr("cuu"), + CurrentUserActorURL: Ptr("cuau"), + CurrentUserOrganizationURL: Ptr("cuou"), CurrentUserOrganizationURLs: []string{"a"}, Links: &FeedLinks{ Timeline: &FeedLink{ - HRef: String("h"), - Type: String("t"), + HRef: Ptr("h"), + Type: Ptr("t"), }, User: &FeedLink{ - HRef: String("h"), - Type: String("t"), + HRef: Ptr("h"), + Type: Ptr("t"), }, CurrentUserPublic: &FeedLink{ - HRef: String("h"), - Type: String("t"), + HRef: Ptr("h"), + Type: Ptr("t"), }, CurrentUser: &FeedLink{ - HRef: String("h"), - Type: String("t"), + HRef: Ptr("h"), + Type: Ptr("t"), }, CurrentUserActor: &FeedLink{ - HRef: String("h"), - Type: String("t"), + HRef: Ptr("h"), + Type: Ptr("t"), }, CurrentUserOrganization: &FeedLink{ - HRef: String("h"), - Type: String("t"), + HRef: Ptr("h"), + Type: Ptr("t"), }, CurrentUserOrganizations: []*FeedLink{ { - HRef: String("h"), - Type: String("t"), + HRef: Ptr("h"), + Type: Ptr("t"), }, }, }, @@ -245,33 +245,33 @@ func TestFeedLinks_Marshal(t *testing.T) { u := &FeedLinks{ Timeline: &FeedLink{ - HRef: String("h"), - Type: String("t"), + HRef: Ptr("h"), + Type: Ptr("t"), }, User: &FeedLink{ - HRef: String("h"), - Type: String("t"), + HRef: Ptr("h"), + Type: Ptr("t"), }, CurrentUserPublic: &FeedLink{ - HRef: String("h"), - Type: String("t"), + HRef: Ptr("h"), + Type: Ptr("t"), }, CurrentUser: &FeedLink{ - HRef: String("h"), - Type: String("t"), + HRef: Ptr("h"), + Type: Ptr("t"), }, CurrentUserActor: &FeedLink{ - HRef: String("h"), - Type: String("t"), + HRef: Ptr("h"), + Type: Ptr("t"), }, CurrentUserOrganization: &FeedLink{ - HRef: String("h"), - Type: String("t"), + HRef: Ptr("h"), + Type: Ptr("t"), }, CurrentUserOrganizations: []*FeedLink{ { - HRef: String("h"), - Type: String("t"), + HRef: Ptr("h"), + Type: Ptr("t"), }, }, } diff --git a/github/activity_watching_test.go b/github/activity_watching_test.go index 98a9f5000c5..8a7ab8ab71c 100644 --- a/github/activity_watching_test.go +++ b/github/activity_watching_test.go @@ -34,7 +34,7 @@ func TestActivityService_ListWatchers(t *testing.T) { t.Errorf("Activity.ListWatchers returned error: %v", err) } - want := []*User{{ID: Int64(1)}} + want := []*User{{ID: Ptr(int64(1))}} if !cmp.Equal(watchers, want) { t.Errorf("Activity.ListWatchers returned %+v, want %+v", watchers, want) } @@ -72,7 +72,7 @@ func TestActivityService_ListWatched_authenticatedUser(t *testing.T) { t.Errorf("Activity.ListWatched returned error: %v", err) } - want := []*Repository{{ID: Int64(1)}} + want := []*Repository{{ID: Ptr(int64(1))}} if !cmp.Equal(watched, want) { t.Errorf("Activity.ListWatched returned %+v, want %+v", watched, want) } @@ -110,7 +110,7 @@ func TestActivityService_ListWatched_specifiedUser(t *testing.T) { t.Errorf("Activity.ListWatched returned error: %v", err) } - want := []*Repository{{ID: Int64(1)}} + want := []*Repository{{ID: Ptr(int64(1))}} if !cmp.Equal(watched, want) { t.Errorf("Activity.ListWatched returned %+v, want %+v", watched, want) } @@ -131,7 +131,7 @@ func TestActivityService_GetRepositorySubscription_true(t *testing.T) { t.Errorf("Activity.GetRepositorySubscription returned error: %v", err) } - want := &Subscription{Subscribed: Bool(true)} + want := &Subscription{Subscribed: Ptr(true)} if !cmp.Equal(sub, want) { t.Errorf("Activity.GetRepositorySubscription returned %+v, want %+v", sub, want) } @@ -192,7 +192,7 @@ func TestActivityService_SetRepositorySubscription(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &Subscription{Subscribed: Bool(true)} + input := &Subscription{Subscribed: Ptr(true)} mux.HandleFunc("/repos/o/r/subscription", func(w http.ResponseWriter, r *http.Request) { v := new(Subscription) @@ -212,7 +212,7 @@ func TestActivityService_SetRepositorySubscription(t *testing.T) { t.Errorf("Activity.SetRepositorySubscription returned error: %v", err) } - want := &Subscription{Ignored: Bool(true)} + want := &Subscription{Ignored: Ptr(true)} if !cmp.Equal(sub, want) { t.Errorf("Activity.SetRepositorySubscription returned %+v, want %+v", sub, want) } @@ -263,13 +263,13 @@ func TestSubscription_Marshal(t *testing.T) { testJSONMarshal(t, &Subscription{}, "{}") u := &Subscription{ - Subscribed: Bool(true), - Ignored: Bool(false), - Reason: String("r"), + Subscribed: Ptr(true), + Ignored: Ptr(false), + Reason: Ptr("r"), CreatedAt: &Timestamp{referenceTime}, - URL: String("u"), - RepositoryURL: String("ru"), - ThreadURL: String("tu"), + URL: Ptr("u"), + RepositoryURL: Ptr("ru"), + ThreadURL: Ptr("tu"), } want := `{ diff --git a/github/admin_orgs_test.go b/github/admin_orgs_test.go index 48f10089c9b..b05ce57b31c 100644 --- a/github/admin_orgs_test.go +++ b/github/admin_orgs_test.go @@ -20,7 +20,7 @@ func TestAdminOrgs_Create(t *testing.T) { client, mux, _ := setup(t) input := &Organization{ - Login: String("github"), + Login: Ptr("github"), } mux.HandleFunc("/admin/organizations", func(w http.ResponseWriter, r *http.Request) { @@ -28,7 +28,7 @@ func TestAdminOrgs_Create(t *testing.T) { assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") - want := &createOrgRequest{Login: String("github"), Admin: String("ghAdmin")} + want := &createOrgRequest{Login: Ptr("github"), Admin: Ptr("ghAdmin")} if !cmp.Equal(v, want) { t.Errorf("Request body = %+v, want %+v", v, want) } @@ -42,7 +42,7 @@ func TestAdminOrgs_Create(t *testing.T) { t.Errorf("Admin.CreateOrg returned error: %v", err) } - want := &Organization{ID: Int64(1), Login: String("github")} + want := &Organization{ID: Ptr(int64(1)), Login: Ptr("github")} if !cmp.Equal(org, want) { t.Errorf("Admin.CreateOrg returned %+v, want %+v", org, want) } @@ -62,7 +62,7 @@ func TestAdminOrgs_Rename(t *testing.T) { client, mux, _ := setup(t) input := &Organization{ - Login: String("o"), + Login: Ptr("o"), } mux.HandleFunc("/admin/organizations/o", func(w http.ResponseWriter, r *http.Request) { @@ -70,7 +70,7 @@ func TestAdminOrgs_Rename(t *testing.T) { assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") - want := &renameOrgRequest{Login: String("the-new-octocats")} + want := &renameOrgRequest{Login: Ptr("the-new-octocats")} if !cmp.Equal(v, want) { t.Errorf("Request body = %+v, want %+v", v, want) } @@ -84,7 +84,7 @@ func TestAdminOrgs_Rename(t *testing.T) { t.Errorf("Admin.RenameOrg returned error: %v", err) } - want := &RenameOrgResponse{Message: String("Job queued to rename organization. It may take a few minutes to complete."), URL: String("https:///api/v3/organizations/1")} + want := &RenameOrgResponse{Message: Ptr("Job queued to rename organization. It may take a few minutes to complete."), URL: Ptr("https:///api/v3/organizations/1")} if !cmp.Equal(resp, want) { t.Errorf("Admin.RenameOrg returned %+v, want %+v", resp, want) } @@ -108,7 +108,7 @@ func TestAdminOrgs_RenameByName(t *testing.T) { assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PATCH") - want := &renameOrgRequest{Login: String("the-new-octocats")} + want := &renameOrgRequest{Login: Ptr("the-new-octocats")} if !cmp.Equal(v, want) { t.Errorf("Request body = %+v, want %+v", v, want) } @@ -122,7 +122,7 @@ func TestAdminOrgs_RenameByName(t *testing.T) { t.Errorf("Admin.RenameOrg returned error: %v", err) } - want := &RenameOrgResponse{Message: String("Job queued to rename organization. It may take a few minutes to complete."), URL: String("https:///api/v3/organizations/1")} + want := &RenameOrgResponse{Message: Ptr("Job queued to rename organization. It may take a few minutes to complete."), URL: Ptr("https:///api/v3/organizations/1")} if !cmp.Equal(resp, want) { t.Errorf("Admin.RenameOrg returned %+v, want %+v", resp, want) } @@ -147,8 +147,8 @@ func TestCreateOrgRequest_Marshal(t *testing.T) { testJSONMarshal(t, &createOrgRequest{}, "{}") u := &createOrgRequest{ - Login: String("l"), - Admin: String("a"), + Login: Ptr("l"), + Admin: Ptr("a"), } want := `{ @@ -164,7 +164,7 @@ func TestRenameOrgRequest_Marshal(t *testing.T) { testJSONMarshal(t, &renameOrgRequest{}, "{}") u := &renameOrgRequest{ - Login: String("l"), + Login: Ptr("l"), } want := `{ @@ -179,8 +179,8 @@ func TestRenameOrgResponse_Marshal(t *testing.T) { testJSONMarshal(t, &renameOrgRequest{}, "{}") u := &RenameOrgResponse{ - Message: String("m"), - URL: String("u"), + Message: Ptr("m"), + URL: Ptr("u"), } want := `{ diff --git a/github/admin_stats_test.go b/github/admin_stats_test.go index e12f6df5fcf..02b5d83bfcb 100644 --- a/github/admin_stats_test.go +++ b/github/admin_stats_test.go @@ -156,58 +156,58 @@ func TestAdminService_Stringify(t *testing.T) { var testAdminStats = &AdminStats{ Repos: &RepoStats{ - TotalRepos: Int(212), - RootRepos: Int(194), - ForkRepos: Int(18), - OrgRepos: Int(51), - TotalPushes: Int(3082), - TotalWikis: Int(15), + TotalRepos: Ptr(212), + RootRepos: Ptr(194), + ForkRepos: Ptr(18), + OrgRepos: Ptr(51), + TotalPushes: Ptr(3082), + TotalWikis: Ptr(15), }, Hooks: &HookStats{ - TotalHooks: Int(27), - ActiveHooks: Int(23), - InactiveHooks: Int(4), + TotalHooks: Ptr(27), + ActiveHooks: Ptr(23), + InactiveHooks: Ptr(4), }, Pages: &PageStats{ - TotalPages: Int(36), + TotalPages: Ptr(36), }, Orgs: &OrgStats{ - TotalOrgs: Int(33), - DisabledOrgs: Int(0), - TotalTeams: Int(60), - TotalTeamMembers: Int(314), + TotalOrgs: Ptr(33), + DisabledOrgs: Ptr(0), + TotalTeams: Ptr(60), + TotalTeamMembers: Ptr(314), }, Users: &UserStats{ - TotalUsers: Int(254), - AdminUsers: Int(45), - SuspendedUsers: Int(21), + TotalUsers: Ptr(254), + AdminUsers: Ptr(45), + SuspendedUsers: Ptr(21), }, Pulls: &PullStats{ - TotalPulls: Int(86), - MergedPulls: Int(60), - MergablePulls: Int(21), - UnmergablePulls: Int(3), + TotalPulls: Ptr(86), + MergedPulls: Ptr(60), + MergablePulls: Ptr(21), + UnmergablePulls: Ptr(3), }, Issues: &IssueStats{ - TotalIssues: Int(179), - OpenIssues: Int(83), - ClosedIssues: Int(96), + TotalIssues: Ptr(179), + OpenIssues: Ptr(83), + ClosedIssues: Ptr(96), }, Milestones: &MilestoneStats{ - TotalMilestones: Int(7), - OpenMilestones: Int(6), - ClosedMilestones: Int(1), + TotalMilestones: Ptr(7), + OpenMilestones: Ptr(6), + ClosedMilestones: Ptr(1), }, Gists: &GistStats{ - TotalGists: Int(178), - PrivateGists: Int(151), - PublicGists: Int(25), + TotalGists: Ptr(178), + PrivateGists: Ptr(151), + PublicGists: Ptr(25), }, Comments: &CommentStats{ - TotalCommitComments: Int(6), - TotalGistComments: Int(28), - TotalIssueComments: Int(366), - TotalPullRequestComments: Int(30), + TotalCommitComments: Ptr(6), + TotalGistComments: Ptr(28), + TotalIssueComments: Ptr(366), + TotalPullRequestComments: Ptr(30), }, } @@ -216,9 +216,9 @@ func TestIssueStats_Marshal(t *testing.T) { testJSONMarshal(t, &IssueStats{}, "{}") u := &IssueStats{ - TotalIssues: Int(1), - OpenIssues: Int(1), - ClosedIssues: Int(1), + TotalIssues: Ptr(1), + OpenIssues: Ptr(1), + ClosedIssues: Ptr(1), } want := `{ @@ -235,9 +235,9 @@ func TestHookStats_Marshal(t *testing.T) { testJSONMarshal(t, &HookStats{}, "{}") u := &HookStats{ - TotalHooks: Int(1), - ActiveHooks: Int(1), - InactiveHooks: Int(1), + TotalHooks: Ptr(1), + ActiveHooks: Ptr(1), + InactiveHooks: Ptr(1), } want := `{ @@ -254,9 +254,9 @@ func TestMilestoneStats_Marshal(t *testing.T) { testJSONMarshal(t, &MilestoneStats{}, "{}") u := &MilestoneStats{ - TotalMilestones: Int(1), - OpenMilestones: Int(1), - ClosedMilestones: Int(1), + TotalMilestones: Ptr(1), + OpenMilestones: Ptr(1), + ClosedMilestones: Ptr(1), } want := `{ @@ -273,10 +273,10 @@ func TestOrgStats_Marshal(t *testing.T) { testJSONMarshal(t, &OrgStats{}, "{}") u := &OrgStats{ - TotalOrgs: Int(1), - DisabledOrgs: Int(1), - TotalTeams: Int(1), - TotalTeamMembers: Int(1), + TotalOrgs: Ptr(1), + DisabledOrgs: Ptr(1), + TotalTeams: Ptr(1), + TotalTeamMembers: Ptr(1), } want := `{ @@ -294,10 +294,10 @@ func TestCommentStats_Marshal(t *testing.T) { testJSONMarshal(t, &CommentStats{}, "{}") u := &CommentStats{ - TotalCommitComments: Int(1), - TotalGistComments: Int(1), - TotalIssueComments: Int(1), - TotalPullRequestComments: Int(1), + TotalCommitComments: Ptr(1), + TotalGistComments: Ptr(1), + TotalIssueComments: Ptr(1), + TotalPullRequestComments: Ptr(1), } want := `{ @@ -315,7 +315,7 @@ func TestPageStats_Marshal(t *testing.T) { testJSONMarshal(t, &PageStats{}, "{}") u := &PageStats{ - TotalPages: Int(1), + TotalPages: Ptr(1), } want := `{ @@ -330,9 +330,9 @@ func TestUserStats_Marshal(t *testing.T) { testJSONMarshal(t, &UserStats{}, "{}") u := &UserStats{ - TotalUsers: Int(1), - AdminUsers: Int(1), - SuspendedUsers: Int(1), + TotalUsers: Ptr(1), + AdminUsers: Ptr(1), + SuspendedUsers: Ptr(1), } want := `{ @@ -349,9 +349,9 @@ func TestGistStats_Marshal(t *testing.T) { testJSONMarshal(t, &GistStats{}, "{}") u := &GistStats{ - TotalGists: Int(1), - PrivateGists: Int(1), - PublicGists: Int(1), + TotalGists: Ptr(1), + PrivateGists: Ptr(1), + PublicGists: Ptr(1), } want := `{ @@ -368,10 +368,10 @@ func TestPullStats_Marshal(t *testing.T) { testJSONMarshal(t, &PullStats{}, "{}") u := &PullStats{ - TotalPulls: Int(1), - MergedPulls: Int(1), - MergablePulls: Int(1), - UnmergablePulls: Int(1), + TotalPulls: Ptr(1), + MergedPulls: Ptr(1), + MergablePulls: Ptr(1), + UnmergablePulls: Ptr(1), } want := `{ @@ -389,12 +389,12 @@ func TestRepoStats_Marshal(t *testing.T) { testJSONMarshal(t, &RepoStats{}, "{}") u := &RepoStats{ - TotalRepos: Int(1), - RootRepos: Int(1), - ForkRepos: Int(1), - OrgRepos: Int(1), - TotalPushes: Int(1), - TotalWikis: Int(1), + TotalRepos: Ptr(1), + RootRepos: Ptr(1), + ForkRepos: Ptr(1), + OrgRepos: Ptr(1), + TotalPushes: Ptr(1), + TotalWikis: Ptr(1), } want := `{ @@ -415,58 +415,58 @@ func TestAdminStats_Marshal(t *testing.T) { u := &AdminStats{ Repos: &RepoStats{ - TotalRepos: Int(212), - RootRepos: Int(194), - ForkRepos: Int(18), - OrgRepos: Int(51), - TotalPushes: Int(3082), - TotalWikis: Int(15), + TotalRepos: Ptr(212), + RootRepos: Ptr(194), + ForkRepos: Ptr(18), + OrgRepos: Ptr(51), + TotalPushes: Ptr(3082), + TotalWikis: Ptr(15), }, Hooks: &HookStats{ - TotalHooks: Int(27), - ActiveHooks: Int(23), - InactiveHooks: Int(4), + TotalHooks: Ptr(27), + ActiveHooks: Ptr(23), + InactiveHooks: Ptr(4), }, Pages: &PageStats{ - TotalPages: Int(36), + TotalPages: Ptr(36), }, Orgs: &OrgStats{ - TotalOrgs: Int(33), - DisabledOrgs: Int(0), - TotalTeams: Int(60), - TotalTeamMembers: Int(314), + TotalOrgs: Ptr(33), + DisabledOrgs: Ptr(0), + TotalTeams: Ptr(60), + TotalTeamMembers: Ptr(314), }, Users: &UserStats{ - TotalUsers: Int(254), - AdminUsers: Int(45), - SuspendedUsers: Int(21), + TotalUsers: Ptr(254), + AdminUsers: Ptr(45), + SuspendedUsers: Ptr(21), }, Pulls: &PullStats{ - TotalPulls: Int(86), - MergedPulls: Int(60), - MergablePulls: Int(21), - UnmergablePulls: Int(3), + TotalPulls: Ptr(86), + MergedPulls: Ptr(60), + MergablePulls: Ptr(21), + UnmergablePulls: Ptr(3), }, Issues: &IssueStats{ - TotalIssues: Int(179), - OpenIssues: Int(83), - ClosedIssues: Int(96), + TotalIssues: Ptr(179), + OpenIssues: Ptr(83), + ClosedIssues: Ptr(96), }, Milestones: &MilestoneStats{ - TotalMilestones: Int(7), - OpenMilestones: Int(6), - ClosedMilestones: Int(1), + TotalMilestones: Ptr(7), + OpenMilestones: Ptr(6), + ClosedMilestones: Ptr(1), }, Gists: &GistStats{ - TotalGists: Int(178), - PrivateGists: Int(151), - PublicGists: Int(25), + TotalGists: Ptr(178), + PrivateGists: Ptr(151), + PublicGists: Ptr(25), }, Comments: &CommentStats{ - TotalCommitComments: Int(6), - TotalGistComments: Int(28), - TotalIssueComments: Int(366), - TotalPullRequestComments: Int(30), + TotalCommitComments: Ptr(6), + TotalGistComments: Ptr(28), + TotalIssueComments: Ptr(366), + TotalPullRequestComments: Ptr(30), }, } diff --git a/github/admin_test.go b/github/admin_test.go index ae5b86b8998..957a9135bc1 100644 --- a/github/admin_test.go +++ b/github/admin_test.go @@ -20,7 +20,7 @@ func TestAdminService_UpdateUserLDAPMapping(t *testing.T) { client, mux, _ := setup(t) input := &UserLDAPMapping{ - LDAPDN: String("uid=asdf,ou=users,dc=github,dc=com"), + LDAPDN: Ptr("uid=asdf,ou=users,dc=github,dc=com"), } mux.HandleFunc("/admin/ldap/users/u/mapping", func(w http.ResponseWriter, r *http.Request) { @@ -41,8 +41,8 @@ func TestAdminService_UpdateUserLDAPMapping(t *testing.T) { } want := &UserLDAPMapping{ - ID: Int64(1), - LDAPDN: String("uid=asdf,ou=users,dc=github,dc=com"), + ID: Ptr(int64(1)), + LDAPDN: Ptr("uid=asdf,ou=users,dc=github,dc=com"), } if !cmp.Equal(mapping, want) { t.Errorf("Admin.UpdateUserLDAPMapping returned %+v, want %+v", mapping, want) @@ -68,7 +68,7 @@ func TestAdminService_UpdateTeamLDAPMapping(t *testing.T) { client, mux, _ := setup(t) input := &TeamLDAPMapping{ - LDAPDN: String("cn=Enterprise Ops,ou=teams,dc=github,dc=com"), + LDAPDN: Ptr("cn=Enterprise Ops,ou=teams,dc=github,dc=com"), } mux.HandleFunc("/admin/ldap/teams/1/mapping", func(w http.ResponseWriter, r *http.Request) { @@ -89,8 +89,8 @@ func TestAdminService_UpdateTeamLDAPMapping(t *testing.T) { } want := &TeamLDAPMapping{ - ID: Int64(1), - LDAPDN: String("cn=Enterprise Ops,ou=teams,dc=github,dc=com"), + ID: Ptr(int64(1)), + LDAPDN: Ptr("cn=Enterprise Ops,ou=teams,dc=github,dc=com"), } if !cmp.Equal(mapping, want) { t.Errorf("Admin.UpdateTeamLDAPMapping returned %+v, want %+v", mapping, want) @@ -114,16 +114,16 @@ func TestAdminService_UpdateTeamLDAPMapping(t *testing.T) { func TestAdminService_TeamLDAPMapping_String(t *testing.T) { t.Parallel() v := &TeamLDAPMapping{ - ID: Int64(1), - LDAPDN: String("a"), - URL: String("b"), - Name: String("c"), - Slug: String("d"), - Description: String("e"), - Privacy: String("f"), - Permission: String("g"), - MembersURL: String("h"), - RepositoriesURL: String("i"), + ID: Ptr(int64(1)), + LDAPDN: Ptr("a"), + URL: Ptr("b"), + Name: Ptr("c"), + Slug: Ptr("d"), + Description: Ptr("e"), + Privacy: Ptr("f"), + Permission: Ptr("g"), + MembersURL: Ptr("h"), + RepositoriesURL: Ptr("i"), } want := `github.TeamLDAPMapping{ID:1, LDAPDN:"a", URL:"b", Name:"c", Slug:"d", Description:"e", Privacy:"f", Permission:"g", MembersURL:"h", RepositoriesURL:"i"}` @@ -135,23 +135,23 @@ func TestAdminService_TeamLDAPMapping_String(t *testing.T) { func TestAdminService_UserLDAPMapping_String(t *testing.T) { t.Parallel() v := &UserLDAPMapping{ - ID: Int64(1), - LDAPDN: String("a"), - Login: String("b"), - AvatarURL: String("c"), - GravatarID: String("d"), - Type: String("e"), - SiteAdmin: Bool(true), - URL: String("f"), - EventsURL: String("g"), - FollowingURL: String("h"), - FollowersURL: String("i"), - GistsURL: String("j"), - OrganizationsURL: String("k"), - ReceivedEventsURL: String("l"), - ReposURL: String("m"), - StarredURL: String("n"), - SubscriptionsURL: String("o"), + ID: Ptr(int64(1)), + LDAPDN: Ptr("a"), + Login: Ptr("b"), + AvatarURL: Ptr("c"), + GravatarID: Ptr("d"), + Type: Ptr("e"), + SiteAdmin: Ptr(true), + URL: Ptr("f"), + EventsURL: Ptr("g"), + FollowingURL: Ptr("h"), + FollowersURL: Ptr("i"), + GistsURL: Ptr("j"), + OrganizationsURL: Ptr("k"), + ReceivedEventsURL: Ptr("l"), + ReposURL: Ptr("m"), + StarredURL: Ptr("n"), + SubscriptionsURL: Ptr("o"), } want := `github.UserLDAPMapping{ID:1, LDAPDN:"a", Login:"b", AvatarURL:"c", GravatarID:"d", Type:"e", SiteAdmin:true, URL:"f", EventsURL:"g", FollowingURL:"h", FollowersURL:"i", GistsURL:"j", OrganizationsURL:"k", ReceivedEventsURL:"l", ReposURL:"m", StarredURL:"n", SubscriptionsURL:"o"}` @@ -165,16 +165,16 @@ func TestTeamLDAPMapping_Marshal(t *testing.T) { testJSONMarshal(t, &TeamLDAPMapping{}, "{}") u := &TeamLDAPMapping{ - ID: Int64(1), - LDAPDN: String("ldapdn"), - URL: String("u"), - Name: String("n"), - Slug: String("s"), - Description: String("d"), - Privacy: String("p"), - Permission: String("per"), - MembersURL: String("mu"), - RepositoriesURL: String("ru"), + ID: Ptr(int64(1)), + LDAPDN: Ptr("ldapdn"), + URL: Ptr("u"), + Name: Ptr("n"), + Slug: Ptr("s"), + Description: Ptr("d"), + Privacy: Ptr("p"), + Permission: Ptr("per"), + MembersURL: Ptr("mu"), + RepositoriesURL: Ptr("ru"), } want := `{ @@ -198,23 +198,23 @@ func TestUserLDAPMapping_Marshal(t *testing.T) { testJSONMarshal(t, &UserLDAPMapping{}, "{}") u := &UserLDAPMapping{ - ID: Int64(1), - LDAPDN: String("ldapdn"), - Login: String("l"), - AvatarURL: String("au"), - GravatarID: String("gi"), - Type: String("t"), - SiteAdmin: Bool(true), - URL: String("u"), - EventsURL: String("eu"), - FollowingURL: String("fu"), - FollowersURL: String("fu"), - GistsURL: String("gu"), - OrganizationsURL: String("ou"), - ReceivedEventsURL: String("reu"), - ReposURL: String("ru"), - StarredURL: String("su"), - SubscriptionsURL: String("subu"), + ID: Ptr(int64(1)), + LDAPDN: Ptr("ldapdn"), + Login: Ptr("l"), + AvatarURL: Ptr("au"), + GravatarID: Ptr("gi"), + Type: Ptr("t"), + SiteAdmin: Ptr(true), + URL: Ptr("u"), + EventsURL: Ptr("eu"), + FollowingURL: Ptr("fu"), + FollowersURL: Ptr("fu"), + GistsURL: Ptr("gu"), + OrganizationsURL: Ptr("ou"), + ReceivedEventsURL: Ptr("reu"), + ReposURL: Ptr("ru"), + StarredURL: Ptr("su"), + SubscriptionsURL: Ptr("subu"), } want := `{ @@ -245,14 +245,14 @@ func TestEnterprise_Marshal(t *testing.T) { testJSONMarshal(t, &Enterprise{}, "{}") u := &Enterprise{ - ID: Int(1), - Slug: String("s"), - Name: String("n"), - NodeID: String("nid"), - AvatarURL: String("au"), - Description: String("d"), - WebsiteURL: String("wu"), - HTMLURL: String("hu"), + ID: Ptr(1), + Slug: Ptr("s"), + Name: Ptr("n"), + NodeID: Ptr("nid"), + AvatarURL: Ptr("au"), + Description: Ptr("d"), + WebsiteURL: Ptr("wu"), + HTMLURL: Ptr("hu"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, } diff --git a/github/admin_users_test.go b/github/admin_users_test.go index e0094255858..4806c53461e 100644 --- a/github/admin_users_test.go +++ b/github/admin_users_test.go @@ -25,7 +25,7 @@ func TestAdminUsers_Create(t *testing.T) { assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") - want := &CreateUserRequest{Login: "github", Email: String("email@domain.com"), Suspended: Bool(false)} + want := &CreateUserRequest{Login: "github", Email: Ptr("email@domain.com"), Suspended: Ptr(false)} if !cmp.Equal(v, want) { t.Errorf("Request body = %+v, want %+v", v, want) } @@ -36,14 +36,14 @@ func TestAdminUsers_Create(t *testing.T) { ctx := context.Background() org, _, err := client.Admin.CreateUser(ctx, CreateUserRequest{ Login: "github", - Email: String("email@domain.com"), - Suspended: Bool(false), + Email: Ptr("email@domain.com"), + Suspended: Ptr(false), }) if err != nil { t.Errorf("Admin.CreateUser returned error: %v", err) } - want := &User{ID: Int64(1), Login: String("github")} + want := &User{ID: Ptr(int64(1)), Login: Ptr("github")} if !cmp.Equal(org, want) { t.Errorf("Admin.CreateUser returned %+v, want %+v", org, want) } @@ -52,8 +52,8 @@ func TestAdminUsers_Create(t *testing.T) { testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { got, resp, err := client.Admin.CreateUser(ctx, CreateUserRequest{ Login: "github", - Email: String("email@domain.com"), - Suspended: Bool(false), + Email: Ptr("email@domain.com"), + Suspended: Ptr(false), }) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) @@ -123,16 +123,16 @@ func TestUserImpersonation_Create(t *testing.T) { date := Timestamp{Time: time.Date(2018, time.January, 1, 0, 0, 0, 0, time.UTC)} want := &UserAuthorization{ - ID: Int64(1234), - URL: String("https://git.company.com/api/v3/authorizations/1234"), + ID: Ptr(int64(1234)), + URL: Ptr("https://git.company.com/api/v3/authorizations/1234"), App: &OAuthAPP{ - Name: String("GitHub Site Administrator"), - URL: String("https://docs.github.com/en/rest/enterprise/users/"), - ClientID: String("1234"), + Name: Ptr("GitHub Site Administrator"), + URL: Ptr("https://docs.github.com/en/rest/enterprise/users/"), + ClientID: Ptr("1234"), }, - Token: String("1234"), - HashedToken: String("1234"), - TokenLastEight: String("1234"), + Token: Ptr("1234"), + HashedToken: Ptr("1234"), + TokenLastEight: Ptr("1234"), Note: nil, NoteURL: nil, CreatedAt: &date, @@ -190,7 +190,7 @@ func TestCreateUserRequest_Marshal(t *testing.T) { u := &CreateUserRequest{ Login: "l", - Email: String("e"), + Email: Ptr("e"), } want := `{ @@ -223,9 +223,9 @@ func TestOAuthAPP_Marshal(t *testing.T) { testJSONMarshal(t, &OAuthAPP{}, "{}") u := &OAuthAPP{ - URL: String("u"), - Name: String("n"), - ClientID: String("cid"), + URL: Ptr("u"), + Name: Ptr("n"), + ClientID: Ptr("cid"), } want := `{ @@ -242,24 +242,24 @@ func TestUserAuthorization_Marshal(t *testing.T) { testJSONMarshal(t, &UserAuthorization{}, "{}") u := &UserAuthorization{ - ID: Int64(1), - URL: String("u"), + ID: Ptr(int64(1)), + URL: Ptr("u"), Scopes: []string{ "s", }, - Token: String("t"), - TokenLastEight: String("tle"), - HashedToken: String("ht"), + Token: Ptr("t"), + TokenLastEight: Ptr("tle"), + HashedToken: Ptr("ht"), App: &OAuthAPP{ - URL: String("u"), - Name: String("n"), - ClientID: String("cid"), + URL: Ptr("u"), + Name: Ptr("n"), + ClientID: Ptr("cid"), }, - Note: String("n"), - NoteURL: String("nu"), + Note: Ptr("n"), + NoteURL: Ptr("nu"), UpdatedAt: &Timestamp{referenceTime}, CreatedAt: &Timestamp{referenceTime}, - Fingerprint: String("f"), + Fingerprint: Ptr("f"), } want := `{ diff --git a/github/apps.go b/github/apps.go index 8b7ed454161..3dd392d0833 100644 --- a/github/apps.go +++ b/github/apps.go @@ -425,7 +425,7 @@ func (s *AppsService) CreateInstallationTokenListRepos(ctx context.Context, id i //meta:operation POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments func (s *AppsService) CreateAttachment(ctx context.Context, contentReferenceID int64, title, body string) (*Attachment, *Response, error) { u := fmt.Sprintf("content_references/%v/attachments", contentReferenceID) - payload := &Attachment{Title: String(title), Body: String(body)} + payload := &Attachment{Title: Ptr(title), Body: Ptr(body)} req, err := s.client.NewRequest("POST", u, payload) if err != nil { return nil, nil, err diff --git a/github/apps_hooks_deliveries_test.go b/github/apps_hooks_deliveries_test.go index 2fdc2c6c83c..a5036d2ed76 100644 --- a/github/apps_hooks_deliveries_test.go +++ b/github/apps_hooks_deliveries_test.go @@ -33,7 +33,7 @@ func TestAppsService_ListHookDeliveries(t *testing.T) { t.Errorf("Apps.ListHookDeliveries returned error: %v", err) } - want := []*HookDelivery{{ID: Int64(1)}, {ID: Int64(2)}} + want := []*HookDelivery{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}} if d := cmp.Diff(deliveries, want); d != "" { t.Errorf("Apps.ListHooks want (-), got (+):\n%s", d) } @@ -63,7 +63,7 @@ func TestAppsService_GetHookDelivery(t *testing.T) { t.Errorf("Apps.GetHookDelivery returned error: %v", err) } - want := &HookDelivery{ID: Int64(1)} + want := &HookDelivery{ID: Ptr(int64(1))} if !cmp.Equal(hook, want) { t.Errorf("Apps.GetHookDelivery returned %+v, want %+v", hook, want) } @@ -98,7 +98,7 @@ func TestAppsService_RedeliverHookDelivery(t *testing.T) { t.Errorf("Apps.RedeliverHookDelivery returned error: %v", err) } - want := &HookDelivery{ID: Int64(1)} + want := &HookDelivery{ID: Ptr(int64(1))} if !cmp.Equal(hook, want) { t.Errorf("Apps.RedeliverHookDelivery returned %+v, want %+v", hook, want) } diff --git a/github/apps_hooks_test.go b/github/apps_hooks_test.go index e55b995193c..42545bd8a7c 100644 --- a/github/apps_hooks_test.go +++ b/github/apps_hooks_test.go @@ -35,10 +35,10 @@ func TestAppsService_GetHookConfig(t *testing.T) { } want := &HookConfig{ - ContentType: String("json"), - InsecureSSL: String("0"), - Secret: String("********"), - URL: String("https://example.com/webhook"), + ContentType: Ptr("json"), + InsecureSSL: Ptr("0"), + Secret: Ptr("********"), + URL: Ptr("https://example.com/webhook"), } if !cmp.Equal(config, want) { t.Errorf("Apps.GetHookConfig returned %+v, want %+v", config, want) @@ -59,10 +59,10 @@ func TestAppsService_UpdateHookConfig(t *testing.T) { client, mux, _ := setup(t) input := &HookConfig{ - ContentType: String("json"), - InsecureSSL: String("1"), - Secret: String("s"), - URL: String("u"), + ContentType: Ptr("json"), + InsecureSSL: Ptr("1"), + Secret: Ptr("s"), + URL: Ptr("u"), } mux.HandleFunc("/app/hook/config", func(w http.ResponseWriter, r *http.Request) { @@ -83,10 +83,10 @@ func TestAppsService_UpdateHookConfig(t *testing.T) { } want := &HookConfig{ - ContentType: String("json"), - InsecureSSL: String("1"), - Secret: String("********"), - URL: String("u"), + ContentType: Ptr("json"), + InsecureSSL: Ptr("1"), + Secret: Ptr("********"), + URL: Ptr("u"), } if !cmp.Equal(config, want) { t.Errorf("Apps.UpdateHookConfig returned %+v, want %+v", config, want) diff --git a/github/apps_installation_test.go b/github/apps_installation_test.go index 0a121bfd6cb..48521504f7a 100644 --- a/github/apps_installation_test.go +++ b/github/apps_installation_test.go @@ -41,7 +41,7 @@ func TestAppsService_ListRepos(t *testing.T) { t.Errorf("Apps.ListRepos returned error: %v", err) } - want := &ListRepositories{TotalCount: Int(1), Repositories: []*Repository{{ID: Int64(1)}}} + want := &ListRepositories{TotalCount: Ptr(1), Repositories: []*Repository{{ID: Ptr(int64(1))}}} if !cmp.Equal(repositories, want) { t.Errorf("Apps.ListRepos returned %+v, want %+v", repositories, want) } @@ -82,7 +82,7 @@ func TestAppsService_ListUserRepos(t *testing.T) { t.Errorf("Apps.ListUserRepos returned error: %v", err) } - want := &ListRepositories{TotalCount: Int(1), Repositories: []*Repository{{ID: Int64(1)}}} + want := &ListRepositories{TotalCount: Ptr(1), Repositories: []*Repository{{ID: Ptr(int64(1))}}} if !cmp.Equal(repositories, want) { t.Errorf("Apps.ListUserRepos returned %+v, want %+v", repositories, want) } @@ -117,7 +117,7 @@ func TestAppsService_AddRepository(t *testing.T) { t.Errorf("Apps.AddRepository returned error: %v", err) } - want := &Repository{ID: Int64(1), Name: String("n"), Description: String("d"), Owner: &User{Login: String("l")}, License: &License{Key: String("mit")}} + want := &Repository{ID: Ptr(int64(1)), Name: Ptr("n"), Description: Ptr("d"), Owner: &User{Login: Ptr("l")}, License: &License{Key: Ptr("mit")}} if !cmp.Equal(repo, want) { t.Errorf("AddRepository returned %+v, want %+v", repo, want) } @@ -179,12 +179,12 @@ func TestListRepositories_Marshal(t *testing.T) { testJSONMarshal(t, &ListRepositories{}, "{}") u := &ListRepositories{ - TotalCount: Int(1), + TotalCount: Ptr(1), Repositories: []*Repository{ { - ID: Int64(1), - URL: String("u"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + Name: Ptr("n"), }, }, } diff --git a/github/apps_manifest_test.go b/github/apps_manifest_test.go index 35e5db2fd96..ed5e38ff976 100644 --- a/github/apps_manifest_test.go +++ b/github/apps_manifest_test.go @@ -41,11 +41,11 @@ func TestGetConfig(t *testing.T) { } want := &AppConfig{ - ID: Int64(1), - ClientID: String("a"), - ClientSecret: String("b"), - WebhookSecret: String("c"), - PEM: String("key"), + ID: Ptr(int64(1)), + ClientID: Ptr("a"), + ClientSecret: Ptr("b"), + WebhookSecret: Ptr("c"), + PEM: Ptr("key"), } if !cmp.Equal(cfg, want) { @@ -72,39 +72,39 @@ func TestAppConfig_Marshal(t *testing.T) { testJSONMarshal(t, &AppConfig{}, "{}") u := &AppConfig{ - ID: Int64(1), - Slug: String("s"), - NodeID: String("nid"), + ID: Ptr(int64(1)), + Slug: Ptr("s"), + NodeID: Ptr("nid"), Owner: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - Name: String("n"), - Description: String("d"), - ExternalURL: String("eu"), - HTMLURL: String("hu"), + Name: Ptr("n"), + Description: Ptr("d"), + ExternalURL: Ptr("eu"), + HTMLURL: Ptr("hu"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - ClientID: String("ci"), - ClientSecret: String("cs"), - WebhookSecret: String("ws"), - PEM: String("pem"), + ClientID: Ptr("ci"), + ClientSecret: Ptr("cs"), + WebhookSecret: Ptr("ws"), + PEM: Ptr("pem"), } want := `{ diff --git a/github/apps_marketplace_test.go b/github/apps_marketplace_test.go index 3780bad0965..a3664114e90 100644 --- a/github/apps_marketplace_test.go +++ b/github/apps_marketplace_test.go @@ -35,7 +35,7 @@ func TestMarketplaceService_ListPlans(t *testing.T) { t.Errorf("Marketplace.ListPlans returned error: %v", err) } - want := []*MarketplacePlan{{ID: Int64(1)}} + want := []*MarketplacePlan{{ID: Ptr(int64(1))}} if !cmp.Equal(plans, want) { t.Errorf("Marketplace.ListPlans returned %+v, want %+v", plans, want) } @@ -67,7 +67,7 @@ func TestMarketplaceService_Stubbed_ListPlans(t *testing.T) { t.Errorf("Marketplace.ListPlans (Stubbed) returned error: %v", err) } - want := []*MarketplacePlan{{ID: Int64(1)}} + want := []*MarketplacePlan{{ID: Ptr(int64(1))}} if !cmp.Equal(plans, want) { t.Errorf("Marketplace.ListPlans (Stubbed) returned %+v, want %+v", plans, want) } @@ -90,7 +90,7 @@ func TestMarketplaceService_ListPlanAccountsForPlan(t *testing.T) { t.Errorf("Marketplace.ListPlanAccountsForPlan returned error: %v", err) } - want := []*MarketplacePlanAccount{{ID: Int64(1)}} + want := []*MarketplacePlanAccount{{ID: Ptr(int64(1))}} if !cmp.Equal(accounts, want) { t.Errorf("Marketplace.ListPlanAccountsForPlan returned %+v, want %+v", accounts, want) } @@ -122,7 +122,7 @@ func TestMarketplaceService_Stubbed_ListPlanAccountsForPlan(t *testing.T) { t.Errorf("Marketplace.ListPlanAccountsForPlan (Stubbed) returned error: %v", err) } - want := []*MarketplacePlanAccount{{ID: Int64(1)}} + want := []*MarketplacePlanAccount{{ID: Ptr(int64(1))}} if !cmp.Equal(accounts, want) { t.Errorf("Marketplace.ListPlanAccountsForPlan (Stubbed) returned %+v, want %+v", accounts, want) } @@ -144,7 +144,7 @@ func TestMarketplaceService_GetPlanAccountForAccount(t *testing.T) { t.Errorf("Marketplace.GetPlanAccountForAccount returned error: %v", err) } - want := &MarketplacePlanAccount{ID: Int64(1), MarketplacePendingChange: &MarketplacePendingChange{ID: Int64(77)}} + want := &MarketplacePlanAccount{ID: Ptr(int64(1)), MarketplacePendingChange: &MarketplacePendingChange{ID: Ptr(int64(77))}} if !cmp.Equal(account, want) { t.Errorf("Marketplace.GetPlanAccountForAccount returned %+v, want %+v", account, want) } @@ -175,7 +175,7 @@ func TestMarketplaceService_Stubbed_GetPlanAccountForAccount(t *testing.T) { t.Errorf("Marketplace.GetPlanAccountForAccount (Stubbed) returned error: %v", err) } - want := &MarketplacePlanAccount{ID: Int64(1)} + want := &MarketplacePlanAccount{ID: Ptr(int64(1))} if !cmp.Equal(account, want) { t.Errorf("Marketplace.GetPlanAccountForAccount (Stubbed) returned %+v, want %+v", account, want) } @@ -198,7 +198,7 @@ func TestMarketplaceService_ListMarketplacePurchasesForUser(t *testing.T) { t.Errorf("Marketplace.ListMarketplacePurchasesForUser returned error: %v", err) } - want := []*MarketplacePurchase{{BillingCycle: String("monthly")}} + want := []*MarketplacePurchase{{BillingCycle: Ptr("monthly")}} if !cmp.Equal(purchases, want) { t.Errorf("Marketplace.ListMarketplacePurchasesForUser returned %+v, want %+v", purchases, want) } @@ -230,7 +230,7 @@ func TestMarketplaceService_Stubbed_ListMarketplacePurchasesForUser(t *testing.T t.Errorf("Marketplace.ListMarketplacePurchasesForUser returned error: %v", err) } - want := []*MarketplacePurchase{{BillingCycle: String("monthly")}} + want := []*MarketplacePurchase{{BillingCycle: Ptr("monthly")}} if !cmp.Equal(purchases, want) { t.Errorf("Marketplace.ListMarketplacePurchasesForUser returned %+v, want %+v", purchases, want) } @@ -241,19 +241,19 @@ func TestMarketplacePlan_Marshal(t *testing.T) { testJSONMarshal(t, &MarketplacePlan{}, "{}") u := &MarketplacePlan{ - URL: String("u"), - AccountsURL: String("au"), - ID: Int64(1), - Number: Int(1), - Name: String("n"), - Description: String("d"), - MonthlyPriceInCents: Int(1), - YearlyPriceInCents: Int(1), - PriceModel: String("pm"), - UnitName: String("un"), + URL: Ptr("u"), + AccountsURL: Ptr("au"), + ID: Ptr(int64(1)), + Number: Ptr(1), + Name: Ptr("n"), + Description: Ptr("d"), + MonthlyPriceInCents: Ptr(1), + YearlyPriceInCents: Ptr(1), + PriceModel: Ptr("pm"), + UnitName: Ptr("un"), Bullets: &[]string{"b"}, - State: String("s"), - HasFreeTrial: Bool(false), + State: Ptr("s"), + HasFreeTrial: Ptr(false), } want := `{ @@ -280,25 +280,25 @@ func TestMarketplacePurchase_Marshal(t *testing.T) { testJSONMarshal(t, &MarketplacePurchase{}, "{}") u := &MarketplacePurchase{ - BillingCycle: String("bc"), + BillingCycle: Ptr("bc"), NextBillingDate: &Timestamp{referenceTime}, - UnitCount: Int(1), + UnitCount: Ptr(1), Plan: &MarketplacePlan{ - URL: String("u"), - AccountsURL: String("au"), - ID: Int64(1), - Number: Int(1), - Name: String("n"), - Description: String("d"), - MonthlyPriceInCents: Int(1), - YearlyPriceInCents: Int(1), - PriceModel: String("pm"), - UnitName: String("un"), + URL: Ptr("u"), + AccountsURL: Ptr("au"), + ID: Ptr(int64(1)), + Number: Ptr(1), + Name: Ptr("n"), + Description: Ptr("d"), + MonthlyPriceInCents: Ptr(1), + YearlyPriceInCents: Ptr(1), + PriceModel: Ptr("pm"), + UnitName: Ptr("un"), Bullets: &[]string{"b"}, - State: String("s"), - HasFreeTrial: Bool(false), + State: Ptr("s"), + HasFreeTrial: Ptr(false), }, - OnFreeTrial: Bool(false), + OnFreeTrial: Ptr(false), FreeTrialEndsOn: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, } @@ -336,22 +336,22 @@ func TestMarketplacePendingChange_Marshal(t *testing.T) { u := &MarketplacePendingChange{ EffectiveDate: &Timestamp{referenceTime}, - UnitCount: Int(1), - ID: Int64(1), + UnitCount: Ptr(1), + ID: Ptr(int64(1)), Plan: &MarketplacePlan{ - URL: String("u"), - AccountsURL: String("au"), - ID: Int64(1), - Number: Int(1), - Name: String("n"), - Description: String("d"), - MonthlyPriceInCents: Int(1), - YearlyPriceInCents: Int(1), - PriceModel: String("pm"), - UnitName: String("un"), + URL: Ptr("u"), + AccountsURL: Ptr("au"), + ID: Ptr(int64(1)), + Number: Ptr(1), + Name: Ptr("n"), + Description: Ptr("d"), + MonthlyPriceInCents: Ptr(1), + YearlyPriceInCents: Ptr(1), + PriceModel: Ptr("pm"), + UnitName: Ptr("un"), Bullets: &[]string{"b"}, - State: String("s"), - HasFreeTrial: Bool(false), + State: Ptr("s"), + HasFreeTrial: Ptr(false), }, } @@ -384,52 +384,52 @@ func TestMarketplacePlanAccount_Marshal(t *testing.T) { testJSONMarshal(t, &MarketplacePlanAccount{}, "{}") u := &MarketplacePlanAccount{ - URL: String("u"), - Type: String("t"), - ID: Int64(1), - Login: String("l"), - OrganizationBillingEmail: String("obe"), + URL: Ptr("u"), + Type: Ptr("t"), + ID: Ptr(int64(1)), + Login: Ptr("l"), + OrganizationBillingEmail: Ptr("obe"), MarketplacePurchase: &MarketplacePurchase{ - BillingCycle: String("bc"), + BillingCycle: Ptr("bc"), NextBillingDate: &Timestamp{referenceTime}, - UnitCount: Int(1), + UnitCount: Ptr(1), Plan: &MarketplacePlan{ - URL: String("u"), - AccountsURL: String("au"), - ID: Int64(1), - Number: Int(1), - Name: String("n"), - Description: String("d"), - MonthlyPriceInCents: Int(1), - YearlyPriceInCents: Int(1), - PriceModel: String("pm"), - UnitName: String("un"), + URL: Ptr("u"), + AccountsURL: Ptr("au"), + ID: Ptr(int64(1)), + Number: Ptr(1), + Name: Ptr("n"), + Description: Ptr("d"), + MonthlyPriceInCents: Ptr(1), + YearlyPriceInCents: Ptr(1), + PriceModel: Ptr("pm"), + UnitName: Ptr("un"), Bullets: &[]string{"b"}, - State: String("s"), - HasFreeTrial: Bool(false), + State: Ptr("s"), + HasFreeTrial: Ptr(false), }, - OnFreeTrial: Bool(false), + OnFreeTrial: Ptr(false), FreeTrialEndsOn: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, }, MarketplacePendingChange: &MarketplacePendingChange{ EffectiveDate: &Timestamp{referenceTime}, - UnitCount: Int(1), - ID: Int64(1), + UnitCount: Ptr(1), + ID: Ptr(int64(1)), Plan: &MarketplacePlan{ - URL: String("u"), - AccountsURL: String("au"), - ID: Int64(1), - Number: Int(1), - Name: String("n"), - Description: String("d"), - MonthlyPriceInCents: Int(1), - YearlyPriceInCents: Int(1), - PriceModel: String("pm"), - UnitName: String("un"), + URL: Ptr("u"), + AccountsURL: Ptr("au"), + ID: Ptr(int64(1)), + Number: Ptr(1), + Name: Ptr("n"), + Description: Ptr("d"), + MonthlyPriceInCents: Ptr(1), + YearlyPriceInCents: Ptr(1), + PriceModel: Ptr("pm"), + UnitName: Ptr("un"), Bullets: &[]string{"b"}, - State: String("s"), - HasFreeTrial: Bool(false), + State: Ptr("s"), + HasFreeTrial: Ptr(false), }, }, } diff --git a/github/apps_test.go b/github/apps_test.go index 8356e63634f..060281a50b5 100644 --- a/github/apps_test.go +++ b/github/apps_test.go @@ -31,7 +31,7 @@ func TestAppsService_Get_authenticatedApp(t *testing.T) { t.Errorf("Apps.Get returned error: %v", err) } - want := &App{ID: Int64(1)} + want := &App{ID: Ptr(int64(1))} if !cmp.Equal(app, want) { t.Errorf("Apps.Get returned %+v, want %+v", app, want) } @@ -66,7 +66,7 @@ func TestAppsService_Get_specifiedApp(t *testing.T) { t.Errorf("Apps.Get returned error: %v", err) } - want := &App{HTMLURL: String("https://github.com/apps/a")} + want := &App{HTMLURL: Ptr("https://github.com/apps/a")} if !cmp.Equal(app, want) { t.Errorf("Apps.Get returned %+v, want %+v", *app.HTMLURL, *want.HTMLURL) } @@ -100,9 +100,9 @@ func TestAppsService_ListInstallationRequests(t *testing.T) { date := Timestamp{Time: time.Date(2018, time.January, 1, 0, 0, 0, 0, time.UTC)} want := []*InstallationRequest{{ - ID: Int64(1), - Account: &User{ID: Int64(2)}, - Requester: &User{ID: Int64(3)}, + ID: Ptr(int64(1)), + Account: &User{ID: Ptr(int64(2))}, + Requester: &User{ID: Ptr(int64(3))}, CreatedAt: &date, }} if !cmp.Equal(installationRequests, want) { @@ -192,49 +192,49 @@ func TestAppsService_ListInstallations(t *testing.T) { date := Timestamp{Time: time.Date(2018, time.January, 1, 0, 0, 0, 0, time.UTC)} want := []*Installation{{ - ID: Int64(1), - AppID: Int64(1), - TargetID: Int64(1), - TargetType: String("Organization"), - SingleFileName: String("config.yml"), - RepositorySelection: String("selected"), + ID: Ptr(int64(1)), + AppID: Ptr(int64(1)), + TargetID: Ptr(int64(1)), + TargetType: Ptr("Organization"), + SingleFileName: Ptr("config.yml"), + RepositorySelection: Ptr("selected"), Permissions: &InstallationPermissions{ - Actions: String("read"), - Administration: String("read"), - Checks: String("read"), - Contents: String("read"), - ContentReferences: String("read"), - Deployments: String("read"), - Environments: String("read"), - Issues: String("write"), - Metadata: String("read"), - Members: String("read"), - OrganizationAdministration: String("write"), - OrganizationCustomRoles: String("write"), - OrganizationHooks: String("write"), - OrganizationPackages: String("write"), - OrganizationPersonalAccessTokens: String("read"), - OrganizationPersonalAccessTokenRequests: String("read"), - OrganizationPlan: String("read"), - OrganizationPreReceiveHooks: String("write"), - OrganizationProjects: String("read"), - OrganizationSecrets: String("read"), - OrganizationSelfHostedRunners: String("read"), - OrganizationUserBlocking: String("write"), - Packages: String("read"), - Pages: String("read"), - PullRequests: String("write"), - RepositoryHooks: String("write"), - RepositoryProjects: String("read"), - RepositoryPreReceiveHooks: String("read"), - Secrets: String("read"), - SecretScanningAlerts: String("read"), - SecurityEvents: String("read"), - SingleFile: String("write"), - Statuses: String("write"), - TeamDiscussions: String("read"), - VulnerabilityAlerts: String("read"), - Workflows: String("write")}, + Actions: Ptr("read"), + Administration: Ptr("read"), + Checks: Ptr("read"), + Contents: Ptr("read"), + ContentReferences: Ptr("read"), + Deployments: Ptr("read"), + Environments: Ptr("read"), + Issues: Ptr("write"), + Metadata: Ptr("read"), + Members: Ptr("read"), + OrganizationAdministration: Ptr("write"), + OrganizationCustomRoles: Ptr("write"), + OrganizationHooks: Ptr("write"), + OrganizationPackages: Ptr("write"), + OrganizationPersonalAccessTokens: Ptr("read"), + OrganizationPersonalAccessTokenRequests: Ptr("read"), + OrganizationPlan: Ptr("read"), + OrganizationPreReceiveHooks: Ptr("write"), + OrganizationProjects: Ptr("read"), + OrganizationSecrets: Ptr("read"), + OrganizationSelfHostedRunners: Ptr("read"), + OrganizationUserBlocking: Ptr("write"), + Packages: Ptr("read"), + Pages: Ptr("read"), + PullRequests: Ptr("write"), + RepositoryHooks: Ptr("write"), + RepositoryProjects: Ptr("read"), + RepositoryPreReceiveHooks: Ptr("read"), + Secrets: Ptr("read"), + SecretScanningAlerts: Ptr("read"), + SecurityEvents: Ptr("read"), + SingleFile: Ptr("write"), + Statuses: Ptr("write"), + TeamDiscussions: Ptr("read"), + VulnerabilityAlerts: Ptr("read"), + Workflows: Ptr("write")}, Events: []string{"push", "pull_request"}, CreatedAt: &date, UpdatedAt: &date, @@ -268,7 +268,7 @@ func TestAppsService_GetInstallation(t *testing.T) { t.Errorf("Apps.GetInstallation returned error: %v", err) } - want := &Installation{ID: Int64(1), AppID: Int64(1), TargetID: Int64(1), TargetType: String("Organization")} + want := &Installation{ID: Ptr(int64(1)), AppID: Ptr(int64(1)), TargetID: Ptr(int64(1)), TargetType: Ptr("Organization")} if !cmp.Equal(installation, want) { t.Errorf("Apps.GetInstallation returned %+v, want %+v", installation, want) } @@ -308,7 +308,7 @@ func TestAppsService_ListUserInstallations(t *testing.T) { t.Errorf("Apps.ListUserInstallations returned error: %v", err) } - want := []*Installation{{ID: Int64(1), AppID: Int64(1), TargetID: Int64(1), TargetType: String("Organization")}} + want := []*Installation{{ID: Ptr(int64(1)), AppID: Ptr(int64(1)), TargetID: Ptr(int64(1)), TargetType: Ptr("Organization")}} if !cmp.Equal(installations, want) { t.Errorf("Apps.ListUserInstallations returned %+v, want %+v", installations, want) } @@ -416,7 +416,7 @@ func TestAppsService_CreateInstallationToken(t *testing.T) { t.Errorf("Apps.CreateInstallationToken returned error: %v", err) } - want := &InstallationToken{Token: String("t")} + want := &InstallationToken{Token: Ptr("t")} if !cmp.Equal(token, want) { t.Errorf("Apps.CreateInstallationToken returned %+v, want %+v", token, want) } @@ -444,8 +444,8 @@ func TestAppsService_CreateInstallationTokenWithOptions(t *testing.T) { RepositoryIDs: []int64{1234}, Repositories: []string{"foo"}, Permissions: &InstallationPermissions{ - Contents: String("write"), - Issues: String("read"), + Contents: Ptr("write"), + Issues: Ptr("read"), }, } @@ -467,7 +467,7 @@ func TestAppsService_CreateInstallationTokenWithOptions(t *testing.T) { t.Errorf("Apps.CreateInstallationToken returned error: %v", err) } - want := &InstallationToken{Token: String("t")} + want := &InstallationToken{Token: Ptr("t")} if !cmp.Equal(token, want) { t.Errorf("Apps.CreateInstallationToken returned %+v, want %+v", token, want) } @@ -480,8 +480,8 @@ func TestAppsService_CreateInstallationTokenListReposWithOptions(t *testing.T) { installationTokenListRepoOptions := &InstallationTokenListRepoOptions{ Repositories: []string{"foo"}, Permissions: &InstallationPermissions{ - Contents: String("write"), - Issues: String("read"), + Contents: Ptr("write"), + Issues: Ptr("read"), }, } @@ -503,7 +503,7 @@ func TestAppsService_CreateInstallationTokenListReposWithOptions(t *testing.T) { t.Errorf("Apps.CreateInstallationTokenListRepos returned error: %v", err) } - want := &InstallationToken{Token: String("t")} + want := &InstallationToken{Token: Ptr("t")} if !cmp.Equal(token, want) { t.Errorf("Apps.CreateInstallationTokenListRepos returned %+v, want %+v", token, want) } @@ -524,7 +524,7 @@ func TestAppsService_CreateInstallationTokenListReposWithNoOptions(t *testing.T) t.Errorf("Apps.CreateInstallationTokenListRepos returned error: %v", err) } - want := &InstallationToken{Token: String("t")} + want := &InstallationToken{Token: Ptr("t")} if !cmp.Equal(token, want) { t.Errorf("Apps.CreateInstallationTokenListRepos returned %+v, want %+v", token, want) } @@ -562,7 +562,7 @@ func TestAppsService_CreateAttachment(t *testing.T) { t.Errorf("CreateAttachment returned error: %v", err) } - want := &Attachment{ID: Int64(1), Title: String("title1"), Body: String("body1")} + want := &Attachment{ID: Ptr(int64(1)), Title: Ptr("title1"), Body: Ptr("body1")} if !cmp.Equal(got, want) { t.Errorf("CreateAttachment = %+v, want %+v", got, want) } @@ -597,7 +597,7 @@ func TestAppsService_FindOrganizationInstallation(t *testing.T) { t.Errorf("Apps.FindOrganizationInstallation returned error: %v", err) } - want := &Installation{ID: Int64(1), AppID: Int64(1), TargetID: Int64(1), TargetType: String("Organization")} + want := &Installation{ID: Ptr(int64(1)), AppID: Ptr(int64(1)), TargetID: Ptr(int64(1)), TargetType: Ptr("Organization")} if !cmp.Equal(installation, want) { t.Errorf("Apps.FindOrganizationInstallation returned %+v, want %+v", installation, want) } @@ -632,7 +632,7 @@ func TestAppsService_FindRepositoryInstallation(t *testing.T) { t.Errorf("Apps.FindRepositoryInstallation returned error: %v", err) } - want := &Installation{ID: Int64(1), AppID: Int64(1), TargetID: Int64(1), TargetType: String("Organization")} + want := &Installation{ID: Ptr(int64(1)), AppID: Ptr(int64(1)), TargetID: Ptr(int64(1)), TargetType: Ptr("Organization")} if !cmp.Equal(installation, want) { t.Errorf("Apps.FindRepositoryInstallation returned %+v, want %+v", installation, want) } @@ -667,7 +667,7 @@ func TestAppsService_FindRepositoryInstallationByID(t *testing.T) { t.Errorf("Apps.FindRepositoryInstallationByID returned error: %v", err) } - want := &Installation{ID: Int64(1), AppID: Int64(1), TargetID: Int64(1), TargetType: String("Organization")} + want := &Installation{ID: Ptr(int64(1)), AppID: Ptr(int64(1)), TargetID: Ptr(int64(1)), TargetType: Ptr("Organization")} if !cmp.Equal(installation, want) { t.Errorf("Apps.FindRepositoryInstallationByID returned %+v, want %+v", installation, want) } @@ -702,7 +702,7 @@ func TestAppsService_FindUserInstallation(t *testing.T) { t.Errorf("Apps.FindUserInstallation returned error: %v", err) } - want := &Installation{ID: Int64(1), AppID: Int64(1), TargetID: Int64(1), TargetType: String("User")} + want := &Installation{ID: Ptr(int64(1)), AppID: Ptr(int64(1)), TargetID: Ptr(int64(1)), TargetType: Ptr("User")} if !cmp.Equal(installation, want) { t.Errorf("Apps.FindUserInstallation returned %+v, want %+v", installation, want) } @@ -727,9 +727,9 @@ func TestContentReference_Marshal(t *testing.T) { testJSONMarshal(t, &ContentReference{}, "{}") u := &ContentReference{ - ID: Int64(1), - NodeID: String("nid"), - Reference: String("r"), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + Reference: Ptr("r"), } want := `{ @@ -746,9 +746,9 @@ func TestAttachment_Marshal(t *testing.T) { testJSONMarshal(t, &Attachment{}, "{}") u := &Attachment{ - ID: Int64(1), - Title: String("t"), - Body: String("b"), + ID: Ptr(int64(1)), + Title: Ptr("t"), + Body: Ptr("b"), } want := `{ @@ -765,39 +765,39 @@ func TestInstallationPermissions_Marshal(t *testing.T) { testJSONMarshal(t, &InstallationPermissions{}, "{}") u := &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationCustomOrgRoles: String("ocr"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationCustomOrgRoles: Ptr("ocr"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), } want := `{ @@ -844,95 +844,95 @@ func TestInstallation_Marshal(t *testing.T) { testJSONMarshal(t, &Installation{}, "{}") u := &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - ActionsVariables: String("ac"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationCustomOrgRoles: String("ocr"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + ActionsVariables: Ptr("ac"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationCustomOrgRoles: Ptr("ocr"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -1049,40 +1049,40 @@ func TestInstallationTokenOptions_Marshal(t *testing.T) { u := &InstallationTokenOptions{ RepositoryIDs: []int64{1}, Permissions: &InstallationPermissions{ - Actions: String("a"), - ActionsVariables: String("ac"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationCustomOrgRoles: String("ocr"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + ActionsVariables: Ptr("ac"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationCustomOrgRoles: Ptr("ocr"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, } @@ -1134,49 +1134,49 @@ func TestInstallationToken_Marshal(t *testing.T) { testJSONMarshal(t, &InstallationToken{}, "{}") u := &InstallationToken{ - Token: String("t"), + Token: Ptr("t"), ExpiresAt: &Timestamp{referenceTime}, Permissions: &InstallationPermissions{ - Actions: String("a"), - ActionsVariables: String("ac"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationCustomOrgRoles: String("ocr"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + ActionsVariables: Ptr("ac"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationCustomOrgRoles: Ptr("ocr"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, Repositories: []*Repository{ { - ID: Int64(1), - URL: String("u"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + Name: Ptr("n"), }, }, } @@ -1237,70 +1237,70 @@ func TestApp_Marshal(t *testing.T) { testJSONMarshal(t, &App{}, "{}") u := &App{ - ID: Int64(1), - Slug: String("s"), - NodeID: String("nid"), + ID: Ptr(int64(1)), + Slug: Ptr("s"), + NodeID: Ptr("nid"), Owner: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - Name: String("n"), - Description: String("d"), - ExternalURL: String("eu"), - HTMLURL: String("hu"), + Name: Ptr("n"), + Description: Ptr("d"), + ExternalURL: Ptr("eu"), + HTMLURL: Ptr("hu"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, Permissions: &InstallationPermissions{ - Actions: String("a"), - ActionsVariables: String("ac"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationCustomOrgRoles: String("ocr"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + ActionsVariables: Ptr("ac"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationCustomOrgRoles: Ptr("ocr"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, Events: []string{"s"}, } diff --git a/github/authorizations_test.go b/github/authorizations_test.go index 6c644996515..1a0612a5080 100644 --- a/github/authorizations_test.go +++ b/github/authorizations_test.go @@ -31,7 +31,7 @@ func TestAuthorizationsService_Check(t *testing.T) { t.Errorf("Authorizations.Check returned error: %v", err) } - want := &Authorization{ID: Int64(1)} + want := &Authorization{ID: Ptr(int64(1))} if !cmp.Equal(got, want) { t.Errorf("Authorizations.Check returned auth %+v, want %+v", got, want) } @@ -68,7 +68,7 @@ func TestAuthorizationsService_Reset(t *testing.T) { t.Errorf("Authorizations.Reset returned error: %v", err) } - want := &Authorization{ID: Int64(1)} + want := &Authorization{ID: Ptr(int64(1))} if !cmp.Equal(got, want) { t.Errorf("Authorizations.Reset returned auth %+v, want %+v", got, want) } @@ -159,7 +159,7 @@ func TestAuthorizationsService_CreateImpersonation(t *testing.T) { t.Errorf("Authorizations.CreateImpersonation returned error: %+v", err) } - want := &Authorization{ID: Int64(1)} + want := &Authorization{ID: Ptr(int64(1))} if !cmp.Equal(got, want) { t.Errorf("Authorizations.CreateImpersonation returned %+v, want %+v", *got.ID, *want.ID) } @@ -212,9 +212,9 @@ func TestAuthorizationUpdateRequest_Marshal(t *testing.T) { Scopes: []string{"s"}, AddScopes: []string{"a"}, RemoveScopes: []string{"r"}, - Note: String("n"), - NoteURL: String("nu"), - Fingerprint: String("f"), + Note: Ptr("n"), + NoteURL: Ptr("nu"), + Fingerprint: Ptr("f"), } want := `{ @@ -235,11 +235,11 @@ func TestAuthorizationRequest_Marshal(t *testing.T) { u := &AuthorizationRequest{ Scopes: []Scope{"s"}, - ClientID: String("cid"), - ClientSecret: String("cs"), - Note: String("n"), - NoteURL: String("nu"), - Fingerprint: String("f"), + ClientID: Ptr("cid"), + ClientSecret: Ptr("cs"), + Note: Ptr("n"), + NoteURL: Ptr("nu"), + Fingerprint: Ptr("f"), } want := `{ @@ -259,9 +259,9 @@ func TestAuthorizationApp_Marshal(t *testing.T) { testJSONMarshal(t, &AuthorizationApp{}, "{}") u := &AuthorizationApp{ - URL: String("u"), - Name: String("n"), - ClientID: String("cid"), + URL: Ptr("u"), + Name: Ptr("n"), + ClientID: Ptr("cid"), } want := `{ @@ -278,12 +278,12 @@ func TestGrant_Marshal(t *testing.T) { testJSONMarshal(t, &Grant{}, "{}") u := &Grant{ - ID: Int64(1), - URL: String("u"), + ID: Ptr(int64(1)), + URL: Ptr("u"), App: &AuthorizationApp{ - URL: String("u"), - Name: String("n"), - ClientID: String("cid"), + URL: Ptr("u"), + Name: Ptr("n"), + ClientID: Ptr("cid"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, @@ -311,39 +311,39 @@ func TestAuthorization_Marshal(t *testing.T) { testJSONMarshal(t, &Authorization{}, "{}") u := &Authorization{ - ID: Int64(1), - URL: String("u"), + ID: Ptr(int64(1)), + URL: Ptr("u"), Scopes: []Scope{"s"}, - Token: String("t"), - TokenLastEight: String("tle"), - HashedToken: String("ht"), + Token: Ptr("t"), + TokenLastEight: Ptr("tle"), + HashedToken: Ptr("ht"), App: &AuthorizationApp{ - URL: String("u"), - Name: String("n"), - ClientID: String("cid"), + URL: Ptr("u"), + Name: Ptr("n"), + ClientID: Ptr("cid"), }, - Note: String("n"), - NoteURL: String("nu"), + Note: Ptr("n"), + NoteURL: Ptr("nu"), UpdatedAt: &Timestamp{referenceTime}, CreatedAt: &Timestamp{referenceTime}, - Fingerprint: String("f"), + Fingerprint: Ptr("f"), User: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, diff --git a/github/billing_test.go b/github/billing_test.go index 716f50d3c6b..8fb6499c186 100644 --- a/github/billing_test.go +++ b/github/billing_test.go @@ -472,12 +472,12 @@ func TestBillingService_GetAdvancedSecurityActiveCommittersOrg(t *testing.T) { PurchasedAdvancedSecurityCommitters: 4, Repositories: []*RepositoryActiveCommitters{ { - Name: String("octocat-org/Hello-World"), - AdvancedSecurityCommitters: Int(2), + Name: Ptr("octocat-org/Hello-World"), + AdvancedSecurityCommitters: Ptr(2), AdvancedSecurityCommittersBreakdown: []*AdvancedSecurityCommittersBreakdown{ { - UserLogin: String("octokitten"), - LastPushedDate: String("2021-10-25"), + UserLogin: Ptr("octokitten"), + LastPushedDate: Ptr("2021-10-25"), }, }, }, diff --git a/github/checks_test.go b/github/checks_test.go index 08e934c8d8a..ba3b082017f 100644 --- a/github/checks_test.go +++ b/github/checks_test.go @@ -39,12 +39,12 @@ func TestChecksService_GetCheckRun(t *testing.T) { completeAt, _ := time.Parse(time.RFC3339, "2018-05-04T01:14:52Z") want := &CheckRun{ - ID: Int64(1), - Status: String("completed"), - Conclusion: String("neutral"), + ID: Ptr(int64(1)), + Status: Ptr("completed"), + Conclusion: Ptr("neutral"), StartedAt: &Timestamp{startedAt}, CompletedAt: &Timestamp{completeAt}, - Name: String("testCheckRun"), + Name: Ptr("testCheckRun"), } if !cmp.Equal(checkRun, want) { t.Errorf("Checks.GetCheckRun return %+v, want %+v", checkRun, want) @@ -87,13 +87,13 @@ func TestChecksService_GetCheckSuite(t *testing.T) { t.Errorf("Checks.GetCheckSuite return error: %v", err) } want := &CheckSuite{ - ID: Int64(1), - HeadBranch: String("master"), - HeadSHA: String("deadbeef"), - AfterSHA: String("deadbeefa"), - BeforeSHA: String("deadbeefb"), - Status: String("completed"), - Conclusion: String("neutral"), + ID: Ptr(int64(1)), + HeadBranch: Ptr("master"), + HeadSHA: Ptr("deadbeef"), + AfterSHA: Ptr("deadbeefa"), + BeforeSHA: Ptr("deadbeefb"), + Status: Ptr("completed"), + Conclusion: Ptr("neutral"), } if !cmp.Equal(checkSuite, want) { t.Errorf("Checks.GetCheckSuite return %+v, want %+v", checkSuite, want) @@ -135,12 +135,12 @@ func TestChecksService_CreateCheckRun(t *testing.T) { checkRunOpt := CreateCheckRunOptions{ Name: "testCreateCheckRun", HeadSHA: "deadbeef", - Status: String("in_progress"), + Status: Ptr("in_progress"), StartedAt: &Timestamp{startedAt}, Output: &CheckRunOutput{ - Title: String("Mighty test report"), - Summary: String(""), - Text: String(""), + Title: Ptr("Mighty test report"), + Summary: Ptr(""), + Text: Ptr(""), }, } @@ -151,15 +151,15 @@ func TestChecksService_CreateCheckRun(t *testing.T) { } want := &CheckRun{ - ID: Int64(1), - Status: String("in_progress"), + ID: Ptr(int64(1)), + Status: Ptr("in_progress"), StartedAt: &Timestamp{startedAt}, - HeadSHA: String("deadbeef"), - Name: String("testCreateCheckRun"), + HeadSHA: Ptr("deadbeef"), + Name: Ptr("testCreateCheckRun"), Output: &CheckRunOutput{ - Title: String("Mighty test report"), - Summary: String(""), - Text: String(""), + Title: Ptr("Mighty test report"), + Summary: Ptr(""), + Text: Ptr(""), }, } if !cmp.Equal(checkRun, want) { @@ -211,15 +211,15 @@ func TestChecksService_ListCheckRunAnnotations(t *testing.T) { } want := []*CheckRunAnnotation{{ - Path: String("README.md"), - StartLine: Int(2), - EndLine: Int(2), - StartColumn: Int(1), - EndColumn: Int(5), - AnnotationLevel: String("warning"), - Message: String("Check your spelling for 'banaas'."), - Title: String("Spell check"), - RawDetails: String("Do you mean 'bananas' or 'banana'?"), + Path: Ptr("README.md"), + StartLine: Ptr(2), + EndLine: Ptr(2), + StartColumn: Ptr(1), + EndColumn: Ptr(5), + AnnotationLevel: Ptr("warning"), + Message: Ptr("Check your spelling for 'banaas'."), + Title: Ptr("Spell check"), + RawDetails: Ptr("Do you mean 'bananas' or 'banana'?"), }} if !cmp.Equal(checkRunAnnotations, want) { @@ -260,12 +260,12 @@ func TestChecksService_UpdateCheckRun(t *testing.T) { startedAt, _ := time.Parse(time.RFC3339, "2018-05-04T01:14:52Z") updateCheckRunOpt := UpdateCheckRunOptions{ Name: "testUpdateCheckRun", - Status: String("completed"), + Status: Ptr("completed"), CompletedAt: &Timestamp{startedAt}, Output: &CheckRunOutput{ - Title: String("Mighty test report"), - Summary: String("There are 0 failures, 2 warnings and 1 notice"), - Text: String("You may have misspelled some words."), + Title: Ptr("Mighty test report"), + Summary: Ptr("There are 0 failures, 2 warnings and 1 notice"), + Text: Ptr("You may have misspelled some words."), }, } @@ -276,16 +276,16 @@ func TestChecksService_UpdateCheckRun(t *testing.T) { } want := &CheckRun{ - ID: Int64(1), - Status: String("completed"), + ID: Ptr(int64(1)), + Status: Ptr("completed"), StartedAt: &Timestamp{startedAt}, CompletedAt: &Timestamp{startedAt}, - Conclusion: String("neutral"), - Name: String("testUpdateCheckRun"), + Conclusion: Ptr("neutral"), + Name: Ptr("testUpdateCheckRun"), Output: &CheckRunOutput{ - Title: String("Mighty test report"), - Summary: String("There are 0 failures, 2 warnings and 1 notice"), - Text: String("You may have misspelled some words."), + Title: Ptr("Mighty test report"), + Summary: Ptr("There are 0 failures, 2 warnings and 1 notice"), + Text: Ptr("You may have misspelled some words."), }, } if !cmp.Equal(checkRun, want) { @@ -335,10 +335,10 @@ func TestChecksService_ListCheckRunsForRef(t *testing.T) { }) opt := &ListCheckRunsOptions{ - CheckName: String("testing"), - Status: String("completed"), - Filter: String("all"), - AppID: Int64(1), + CheckName: Ptr("testing"), + Status: Ptr("completed"), + Filter: Ptr("all"), + AppID: Ptr(int64(1)), ListOptions: ListOptions{Page: 1}, } ctx := context.Background() @@ -348,15 +348,15 @@ func TestChecksService_ListCheckRunsForRef(t *testing.T) { } startedAt, _ := time.Parse(time.RFC3339, "2018-05-04T01:14:52Z") want := &ListCheckRunsResults{ - Total: Int(1), + Total: Ptr(1), CheckRuns: []*CheckRun{{ - ID: Int64(1), - Status: String("completed"), + ID: Ptr(int64(1)), + Status: Ptr("completed"), StartedAt: &Timestamp{startedAt}, CompletedAt: &Timestamp{startedAt}, - Conclusion: String("neutral"), - HeadSHA: String("deadbeef"), - App: &App{ID: Int64(1)}, + Conclusion: Ptr("neutral"), + HeadSHA: Ptr("deadbeef"), + App: &App{ID: Ptr(int64(1))}, }}, } @@ -404,9 +404,9 @@ func TestChecksService_ListCheckRunsCheckSuite(t *testing.T) { }) opt := &ListCheckRunsOptions{ - CheckName: String("testing"), - Status: String("completed"), - Filter: String("all"), + CheckName: Ptr("testing"), + Status: Ptr("completed"), + Filter: Ptr("all"), ListOptions: ListOptions{Page: 1}, } ctx := context.Background() @@ -416,14 +416,14 @@ func TestChecksService_ListCheckRunsCheckSuite(t *testing.T) { } startedAt, _ := time.Parse(time.RFC3339, "2018-05-04T01:14:52Z") want := &ListCheckRunsResults{ - Total: Int(1), + Total: Ptr(1), CheckRuns: []*CheckRun{{ - ID: Int64(1), - Status: String("completed"), + ID: Ptr(int64(1)), + Status: Ptr("completed"), StartedAt: &Timestamp{startedAt}, CompletedAt: &Timestamp{startedAt}, - Conclusion: String("neutral"), - HeadSHA: String("deadbeef"), + Conclusion: Ptr("neutral"), + HeadSHA: Ptr("deadbeef"), }}, } @@ -471,8 +471,8 @@ func TestChecksService_ListCheckSuiteForRef(t *testing.T) { }) opt := &ListCheckSuiteOptions{ - CheckName: String("testing"), - AppID: Int(2), + CheckName: Ptr("testing"), + AppID: Ptr(2), ListOptions: ListOptions{Page: 1}, } ctx := context.Background() @@ -481,15 +481,15 @@ func TestChecksService_ListCheckSuiteForRef(t *testing.T) { t.Errorf("Checks.ListCheckSuitesForRef return error: %v", err) } want := &ListCheckSuiteResults{ - Total: Int(1), + Total: Ptr(1), CheckSuites: []*CheckSuite{{ - ID: Int64(1), - Status: String("completed"), - Conclusion: String("neutral"), - HeadSHA: String("deadbeef"), - HeadBranch: String("master"), - BeforeSHA: String("deadbeefb"), - AfterSHA: String("deadbeefa"), + ID: Ptr(int64(1)), + Status: Ptr("completed"), + Conclusion: Ptr("neutral"), + HeadSHA: Ptr("deadbeef"), + HeadBranch: Ptr("master"), + BeforeSHA: Ptr("deadbeefb"), + AfterSHA: Ptr("deadbeefa"), }}, } @@ -523,8 +523,8 @@ func TestChecksService_SetCheckSuitePreferences(t *testing.T) { fmt.Fprint(w, `{"preferences":{"auto_trigger_checks":[{"app_id": 2,"setting": false}]}}`) }) a := []*AutoTriggerCheck{{ - AppID: Int64(2), - Setting: Bool(false), + AppID: Ptr(int64(2)), + Setting: Ptr(false), }} opt := CheckSuitePreferenceOptions{AutoTriggerChecks: a} ctx := context.Background() @@ -578,7 +578,7 @@ func TestChecksService_CreateCheckSuite(t *testing.T) { checkSuiteOpt := CreateCheckSuiteOptions{ HeadSHA: "deadbeef", - HeadBranch: String("master"), + HeadBranch: Ptr("master"), } ctx := context.Background() @@ -588,13 +588,13 @@ func TestChecksService_CreateCheckSuite(t *testing.T) { } want := &CheckSuite{ - ID: Int64(2), - Status: String("completed"), - HeadSHA: String("deadbeef"), - HeadBranch: String("master"), - Conclusion: String("neutral"), - BeforeSHA: String("deadbeefb"), - AfterSHA: String("deadbeefa"), + ID: Ptr(int64(2)), + Status: Ptr("completed"), + HeadSHA: Ptr("deadbeef"), + HeadBranch: Ptr("master"), + Conclusion: Ptr("neutral"), + BeforeSHA: Ptr("deadbeefb"), + AfterSHA: Ptr("deadbeefa"), } if !cmp.Equal(checkSuite, want) { t.Errorf("Checks.CreateCheckSuite return %+v, want %+v", checkSuite, want) @@ -648,86 +648,86 @@ func Test_CheckRunMarshal(t *testing.T) { ts := now.Format(time.RFC3339Nano) c := CheckRun{ - ID: Int64(1), - NodeID: String("n"), - HeadSHA: String("h"), - ExternalID: String("1"), - URL: String("u"), - HTMLURL: String("u"), - DetailsURL: String("u"), - Status: String("s"), - Conclusion: String("c"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + HeadSHA: Ptr("h"), + ExternalID: Ptr("1"), + URL: Ptr("u"), + HTMLURL: Ptr("u"), + DetailsURL: Ptr("u"), + Status: Ptr("s"), + Conclusion: Ptr("c"), StartedAt: &Timestamp{Time: now}, CompletedAt: &Timestamp{Time: now}, Output: &CheckRunOutput{ Annotations: []*CheckRunAnnotation{ { - AnnotationLevel: String("a"), - EndLine: Int(1), - Message: String("m"), - Path: String("p"), - RawDetails: String("r"), - StartLine: Int(1), - Title: String("t"), + AnnotationLevel: Ptr("a"), + EndLine: Ptr(1), + Message: Ptr("m"), + Path: Ptr("p"), + RawDetails: Ptr("r"), + StartLine: Ptr(1), + Title: Ptr("t"), }, }, - AnnotationsCount: Int(1), - AnnotationsURL: String("a"), + AnnotationsCount: Ptr(1), + AnnotationsURL: Ptr("a"), Images: []*CheckRunImage{ { - Alt: String("a"), - ImageURL: String("i"), - Caption: String("c"), + Alt: Ptr("a"), + ImageURL: Ptr("i"), + Caption: Ptr("c"), }, }, - Title: String("t"), - Summary: String("s"), - Text: String("t"), + Title: Ptr("t"), + Summary: Ptr("s"), + Text: Ptr("t"), }, - Name: String("n"), + Name: Ptr("n"), CheckSuite: &CheckSuite{ - ID: Int64(1), + ID: Ptr(int64(1)), }, App: &App{ - ID: Int64(1), - NodeID: String("n"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), Owner: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, - Name: String("n"), - Description: String("d"), - HTMLURL: String("h"), - ExternalURL: String("u"), + Name: Ptr("n"), + Description: Ptr("d"), + HTMLURL: Ptr("h"), + ExternalURL: Ptr("u"), CreatedAt: &Timestamp{now}, UpdatedAt: &Timestamp{now}, }, PullRequests: []*PullRequest{ { - URL: String("u"), - ID: Int64(1), - Number: Int(1), + URL: Ptr("u"), + ID: Ptr(int64(1)), + Number: Ptr(1), Head: &PullRequestBranch{ - Ref: String("r"), - SHA: String("s"), + Ref: Ptr("r"), + SHA: Ptr("s"), Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, }, Base: &PullRequestBranch{ - Ref: String("r"), - SHA: String("s"), + Ref: Ptr("r"), + SHA: Ptr("s"), Repo: &Repository{ - ID: Int64(1), - URL: String("u"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + Name: Ptr("n"), }, }, }, @@ -831,68 +831,68 @@ func Test_CheckSuiteMarshal(t *testing.T) { ts := now.Format(time.RFC3339Nano) c := CheckSuite{ - ID: Int64(1), - NodeID: String("n"), - HeadBranch: String("h"), - HeadSHA: String("h"), - URL: String("u"), - BeforeSHA: String("b"), - AfterSHA: String("a"), - Status: String("s"), - Conclusion: String("c"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + HeadBranch: Ptr("h"), + HeadSHA: Ptr("h"), + URL: Ptr("u"), + BeforeSHA: Ptr("b"), + AfterSHA: Ptr("a"), + Status: Ptr("s"), + Conclusion: Ptr("c"), App: &App{ - ID: Int64(1), - NodeID: String("n"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), Owner: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, - Name: String("n"), - Description: String("d"), - HTMLURL: String("h"), - ExternalURL: String("u"), + Name: Ptr("n"), + Description: Ptr("d"), + HTMLURL: Ptr("h"), + ExternalURL: Ptr("u"), CreatedAt: &Timestamp{now}, UpdatedAt: &Timestamp{now}, }, Repository: &Repository{ - ID: Int64(1), + ID: Ptr(int64(1)), }, PullRequests: []*PullRequest{ { - URL: String("u"), - ID: Int64(1), - Number: Int(1), + URL: Ptr("u"), + ID: Ptr(int64(1)), + Number: Ptr(1), Head: &PullRequestBranch{ - Ref: String("r"), - SHA: String("s"), + Ref: Ptr("r"), + SHA: Ptr("s"), Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, }, Base: &PullRequestBranch{ - Ref: String("r"), - SHA: String("s"), + Ref: Ptr("r"), + SHA: Ptr("s"), Repo: &Repository{ - ID: Int64(1), - URL: String("u"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + Name: Ptr("n"), }, }, }, }, HeadCommit: &Commit{ - SHA: String("s"), + SHA: Ptr("s"), }, - LatestCheckRunsCount: Int64(1), - Rerequstable: Bool(true), - RunsRerequstable: Bool(true), + LatestCheckRunsCount: Ptr(int64(1)), + Rerequstable: Ptr(true), + RunsRerequstable: Ptr(true), } w := fmt.Sprintf(`{ @@ -968,15 +968,15 @@ func TestCheckRunAnnotation_Marshal(t *testing.T) { testJSONMarshal(t, &CheckRunAnnotation{}, "{}") u := &CheckRunAnnotation{ - Path: String("p"), - StartLine: Int(1), - EndLine: Int(1), - StartColumn: Int(1), - EndColumn: Int(1), - AnnotationLevel: String("al"), - Message: String("m"), - Title: String("t"), - RawDetails: String("rd"), + Path: Ptr("p"), + StartLine: Ptr(1), + EndLine: Ptr(1), + StartColumn: Ptr(1), + EndColumn: Ptr(1), + AnnotationLevel: Ptr("al"), + Message: Ptr("m"), + Title: Ptr("t"), + RawDetails: Ptr("rd"), } want := `{ @@ -999,9 +999,9 @@ func TestCheckRunImage_Marshal(t *testing.T) { testJSONMarshal(t, &CheckRunImage{}, "{}") u := &CheckRunImage{ - Alt: String("a"), - ImageURL: String("i"), - Caption: String("c"), + Alt: Ptr("a"), + ImageURL: Ptr("i"), + Caption: Ptr("c"), } want := `{ @@ -1037,8 +1037,8 @@ func TestAutoTriggerCheck_Marshal(t *testing.T) { testJSONMarshal(t, &AutoTriggerCheck{}, "{}") u := &AutoTriggerCheck{ - AppID: Int64(1), - Setting: Bool(false), + AppID: Ptr(int64(1)), + Setting: Ptr(false), } want := `{ @@ -1055,7 +1055,7 @@ func TestCreateCheckSuiteOptions_Marshal(t *testing.T) { u := &CreateCheckSuiteOptions{ HeadSHA: "hsha", - HeadBranch: String("hb"), + HeadBranch: Ptr("hb"), } want := `{ @@ -1071,29 +1071,29 @@ func TestCheckRunOutput_Marshal(t *testing.T) { testJSONMarshal(t, &CheckRunOutput{}, "{}") u := &CheckRunOutput{ - Title: String("ti"), - Summary: String("s"), - Text: String("t"), - AnnotationsCount: Int(1), - AnnotationsURL: String("au"), + Title: Ptr("ti"), + Summary: Ptr("s"), + Text: Ptr("t"), + AnnotationsCount: Ptr(1), + AnnotationsURL: Ptr("au"), Annotations: []*CheckRunAnnotation{ { - Path: String("p"), - StartLine: Int(1), - EndLine: Int(1), - StartColumn: Int(1), - EndColumn: Int(1), - AnnotationLevel: String("al"), - Message: String("m"), - Title: String("t"), - RawDetails: String("rd"), + Path: Ptr("p"), + StartLine: Ptr(1), + EndLine: Ptr(1), + StartColumn: Ptr(1), + EndColumn: Ptr(1), + AnnotationLevel: Ptr("al"), + Message: Ptr("m"), + Title: Ptr("t"), + RawDetails: Ptr("rd"), }, }, Images: []*CheckRunImage{ { - Alt: String("a"), - ImageURL: String("i"), - Caption: String("c"), + Alt: Ptr("a"), + ImageURL: Ptr("i"), + Caption: Ptr("c"), }, }, } @@ -1136,36 +1136,36 @@ func TestCreateCheckRunOptions_Marshal(t *testing.T) { u := &CreateCheckRunOptions{ Name: "n", HeadSHA: "hsha", - DetailsURL: String("durl"), - ExternalID: String("eid"), - Status: String("s"), - Conclusion: String("c"), + DetailsURL: Ptr("durl"), + ExternalID: Ptr("eid"), + Status: Ptr("s"), + Conclusion: Ptr("c"), StartedAt: &Timestamp{referenceTime}, CompletedAt: &Timestamp{referenceTime}, Output: &CheckRunOutput{ - Title: String("ti"), - Summary: String("s"), - Text: String("t"), - AnnotationsCount: Int(1), - AnnotationsURL: String("au"), + Title: Ptr("ti"), + Summary: Ptr("s"), + Text: Ptr("t"), + AnnotationsCount: Ptr(1), + AnnotationsURL: Ptr("au"), Annotations: []*CheckRunAnnotation{ { - Path: String("p"), - StartLine: Int(1), - EndLine: Int(1), - StartColumn: Int(1), - EndColumn: Int(1), - AnnotationLevel: String("al"), - Message: String("m"), - Title: String("t"), - RawDetails: String("rd"), + Path: Ptr("p"), + StartLine: Ptr(1), + EndLine: Ptr(1), + StartColumn: Ptr(1), + EndColumn: Ptr(1), + AnnotationLevel: Ptr("al"), + Message: Ptr("m"), + Title: Ptr("t"), + RawDetails: Ptr("rd"), }, }, Images: []*CheckRunImage{ { - Alt: String("a"), - ImageURL: String("i"), - Caption: String("c"), + Alt: Ptr("a"), + ImageURL: Ptr("i"), + Caption: Ptr("c"), }, }, }, @@ -1232,35 +1232,35 @@ func TestUpdateCheckRunOptions_Marshal(t *testing.T) { u := &UpdateCheckRunOptions{ Name: "n", - DetailsURL: String("durl"), - ExternalID: String("eid"), - Status: String("s"), - Conclusion: String("c"), + DetailsURL: Ptr("durl"), + ExternalID: Ptr("eid"), + Status: Ptr("s"), + Conclusion: Ptr("c"), CompletedAt: &Timestamp{referenceTime}, Output: &CheckRunOutput{ - Title: String("ti"), - Summary: String("s"), - Text: String("t"), - AnnotationsCount: Int(1), - AnnotationsURL: String("au"), + Title: Ptr("ti"), + Summary: Ptr("s"), + Text: Ptr("t"), + AnnotationsCount: Ptr(1), + AnnotationsURL: Ptr("au"), Annotations: []*CheckRunAnnotation{ { - Path: String("p"), - StartLine: Int(1), - EndLine: Int(1), - StartColumn: Int(1), - EndColumn: Int(1), - AnnotationLevel: String("al"), - Message: String("m"), - Title: String("t"), - RawDetails: String("rd"), + Path: Ptr("p"), + StartLine: Ptr(1), + EndLine: Ptr(1), + StartColumn: Ptr(1), + EndColumn: Ptr(1), + AnnotationLevel: Ptr("al"), + Message: Ptr("m"), + Title: Ptr("t"), + RawDetails: Ptr("rd"), }, }, Images: []*CheckRunImage{ { - Alt: String("a"), - ImageURL: String("i"), - Caption: String("c"), + Alt: Ptr("a"), + ImageURL: Ptr("i"), + Caption: Ptr("c"), }, }, }, @@ -1324,89 +1324,89 @@ func TestListCheckRunsResults_Marshal(t *testing.T) { testJSONMarshal(t, &ListCheckRunsResults{}, "{}") l := &ListCheckRunsResults{ - Total: Int(1), + Total: Ptr(1), CheckRuns: []*CheckRun{ { - ID: Int64(1), - NodeID: String("n"), - HeadSHA: String("h"), - ExternalID: String("1"), - URL: String("u"), - HTMLURL: String("u"), - DetailsURL: String("u"), - Status: String("s"), - Conclusion: String("c"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + HeadSHA: Ptr("h"), + ExternalID: Ptr("1"), + URL: Ptr("u"), + HTMLURL: Ptr("u"), + DetailsURL: Ptr("u"), + Status: Ptr("s"), + Conclusion: Ptr("c"), StartedAt: &Timestamp{referenceTime}, CompletedAt: &Timestamp{referenceTime}, Output: &CheckRunOutput{ Annotations: []*CheckRunAnnotation{ { - AnnotationLevel: String("a"), - EndLine: Int(1), - Message: String("m"), - Path: String("p"), - RawDetails: String("r"), - StartLine: Int(1), - Title: String("t"), + AnnotationLevel: Ptr("a"), + EndLine: Ptr(1), + Message: Ptr("m"), + Path: Ptr("p"), + RawDetails: Ptr("r"), + StartLine: Ptr(1), + Title: Ptr("t"), }, }, - AnnotationsCount: Int(1), - AnnotationsURL: String("a"), + AnnotationsCount: Ptr(1), + AnnotationsURL: Ptr("a"), Images: []*CheckRunImage{ { - Alt: String("a"), - ImageURL: String("i"), - Caption: String("c"), + Alt: Ptr("a"), + ImageURL: Ptr("i"), + Caption: Ptr("c"), }, }, - Title: String("t"), - Summary: String("s"), - Text: String("t"), + Title: Ptr("t"), + Summary: Ptr("s"), + Text: Ptr("t"), }, - Name: String("n"), + Name: Ptr("n"), CheckSuite: &CheckSuite{ - ID: Int64(1), + ID: Ptr(int64(1)), }, App: &App{ - ID: Int64(1), - NodeID: String("n"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), Owner: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, - Name: String("n"), - Description: String("d"), - HTMLURL: String("h"), - ExternalURL: String("u"), + Name: Ptr("n"), + Description: Ptr("d"), + HTMLURL: Ptr("h"), + ExternalURL: Ptr("u"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, }, PullRequests: []*PullRequest{ { - URL: String("u"), - ID: Int64(1), - Number: Int(1), + URL: Ptr("u"), + ID: Ptr(int64(1)), + Number: Ptr(1), Head: &PullRequestBranch{ - Ref: String("r"), - SHA: String("s"), + Ref: Ptr("r"), + SHA: Ptr("s"), Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, }, Base: &PullRequestBranch{ - Ref: String("r"), - SHA: String("s"), + Ref: Ptr("r"), + SHA: Ptr("s"), Repo: &Repository{ - ID: Int64(1), - URL: String("u"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + Name: Ptr("n"), }, }, }, @@ -1515,67 +1515,67 @@ func TestListCheckSuiteResults_Marshal(t *testing.T) { testJSONMarshal(t, &ListCheckSuiteResults{}, "{}") l := &ListCheckSuiteResults{ - Total: Int(1), + Total: Ptr(1), CheckSuites: []*CheckSuite{ { - ID: Int64(1), - NodeID: String("n"), - HeadBranch: String("h"), - HeadSHA: String("h"), - URL: String("u"), - BeforeSHA: String("b"), - AfterSHA: String("a"), - Status: String("s"), - Conclusion: String("c"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + HeadBranch: Ptr("h"), + HeadSHA: Ptr("h"), + URL: Ptr("u"), + BeforeSHA: Ptr("b"), + AfterSHA: Ptr("a"), + Status: Ptr("s"), + Conclusion: Ptr("c"), App: &App{ - ID: Int64(1), - NodeID: String("n"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), Owner: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, - Name: String("n"), - Description: String("d"), - HTMLURL: String("h"), - ExternalURL: String("u"), + Name: Ptr("n"), + Description: Ptr("d"), + HTMLURL: Ptr("h"), + ExternalURL: Ptr("u"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, }, Repository: &Repository{ - ID: Int64(1), + ID: Ptr(int64(1)), }, PullRequests: []*PullRequest{ { - URL: String("u"), - ID: Int64(1), - Number: Int(1), + URL: Ptr("u"), + ID: Ptr(int64(1)), + Number: Ptr(1), Head: &PullRequestBranch{ - Ref: String("r"), - SHA: String("s"), + Ref: Ptr("r"), + SHA: Ptr("s"), Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, }, Base: &PullRequestBranch{ - Ref: String("r"), - SHA: String("s"), + Ref: Ptr("r"), + SHA: Ptr("s"), Repo: &Repository{ - ID: Int64(1), - URL: String("u"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + Name: Ptr("n"), }, }, }, }, HeadCommit: &Commit{ - SHA: String("s"), + SHA: Ptr("s"), }, }, }, @@ -1658,8 +1658,8 @@ func TestCheckSuitePreferenceOptions_Marshal(t *testing.T) { u := &CheckSuitePreferenceOptions{ AutoTriggerChecks: []*AutoTriggerCheck{ { - AppID: Int64(1), - Setting: Bool(false), + AppID: Ptr(int64(1)), + Setting: Ptr(false), }, }, } @@ -1683,8 +1683,8 @@ func TestPreferenceList_Marshal(t *testing.T) { u := &PreferenceList{ AutoTriggerChecks: []*AutoTriggerCheck{ { - AppID: Int64(1), - Setting: Bool(false), + AppID: Ptr(int64(1)), + Setting: Ptr(false), }, }, } @@ -1709,15 +1709,15 @@ func TestCheckSuitePreferenceResults_Marshal(t *testing.T) { Preferences: &PreferenceList{ AutoTriggerChecks: []*AutoTriggerCheck{ { - AppID: Int64(1), - Setting: Bool(false), + AppID: Ptr(int64(1)), + Setting: Ptr(false), }, }, }, Repository: &Repository{ - ID: Int64(1), - URL: String("u"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + Name: Ptr("n"), }, } diff --git a/github/code_scanning_test.go b/github/code_scanning_test.go index 64cb49a1aed..4e9bbc57a79 100644 --- a/github/code_scanning_test.go +++ b/github/code_scanning_test.go @@ -28,7 +28,7 @@ func TestCodeScanningService_Alert_ID(t *testing.T) { // Test: Valid HTMLURL a = &Alert{ - HTMLURL: String("https://github.com/o/r/security/code-scanning/88"), + HTMLURL: Ptr("https://github.com/o/r/security/code-scanning/88"), } id = a.ID() want = 88 @@ -46,7 +46,7 @@ func TestCodeScanningService_Alert_ID(t *testing.T) { // Test: ID can't be parsed as an int a = &Alert{ - HTMLURL: String("https://github.com/o/r/security/code-scanning/bad88"), + HTMLURL: Ptr("https://github.com/o/r/security/code-scanning/bad88"), } id = a.ID() want = 0 @@ -60,15 +60,15 @@ func TestCodeScanningService_UploadSarif(t *testing.T) { client, mux, _ := setup(t) expectedSarifID := &SarifID{ - ID: String("testid"), - URL: String("https://example.com/testurl"), + ID: Ptr("testid"), + URL: Ptr("https://example.com/testurl"), } mux.HandleFunc("/repos/o/r/code-scanning/sarifs", func(w http.ResponseWriter, r *http.Request) { v := new(SarifAnalysis) assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") - want := &SarifAnalysis{CommitSHA: String("abc"), Ref: String("ref/head/main"), Sarif: String("abc"), CheckoutURI: String("uri"), StartedAt: &Timestamp{time.Date(2006, time.January, 02, 15, 04, 05, 0, time.UTC)}, ToolName: String("codeql-cli")} + want := &SarifAnalysis{CommitSHA: Ptr("abc"), Ref: Ptr("ref/head/main"), Sarif: Ptr("abc"), CheckoutURI: Ptr("uri"), StartedAt: &Timestamp{time.Date(2006, time.January, 02, 15, 04, 05, 0, time.UTC)}, ToolName: Ptr("codeql-cli")} if !cmp.Equal(v, want) { t.Errorf("Request body = %+v, want %+v", v, want) } @@ -79,7 +79,7 @@ func TestCodeScanningService_UploadSarif(t *testing.T) { }) ctx := context.Background() - sarifAnalysis := &SarifAnalysis{CommitSHA: String("abc"), Ref: String("ref/head/main"), Sarif: String("abc"), CheckoutURI: String("uri"), StartedAt: &Timestamp{time.Date(2006, time.January, 02, 15, 04, 05, 0, time.UTC)}, ToolName: String("codeql-cli")} + sarifAnalysis := &SarifAnalysis{CommitSHA: Ptr("abc"), Ref: Ptr("ref/head/main"), Sarif: Ptr("abc"), CheckoutURI: Ptr("uri"), StartedAt: &Timestamp{time.Date(2006, time.January, 02, 15, 04, 05, 0, time.UTC)}, ToolName: Ptr("codeql-cli")} respSarifID, _, err := client.CodeScanning.UploadSarif(ctx, "o", "r", sarifAnalysis) if err != nil { t.Errorf("CodeScanning.UploadSarif returned error: %v", err) @@ -119,8 +119,8 @@ func TestCodeScanningService_GetSARIF(t *testing.T) { } want := &SARIFUpload{ - ProcessingStatus: String("s"), - AnalysesURL: String("u"), + ProcessingStatus: Ptr("s"), + AnalysesURL: Ptr("u"), } if !cmp.Equal(sarifUpload, want) { t.Errorf("CodeScanning.GetSARIF returned %+v, want %+v", sarifUpload, want) @@ -250,77 +250,77 @@ func TestCodeScanningService_ListAlertsForOrg(t *testing.T) { want := []*Alert{ { Repository: &Repository{ - ID: Int64(1), - URL: String("url"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("url"), + Name: Ptr("n"), }, - RuleID: String("js/trivial-conditional"), - RuleSeverity: String("warning"), - RuleDescription: String("Useless conditional"), - Tool: &Tool{Name: String("CodeQL"), GUID: nil, Version: String("1.4.0")}, + RuleID: Ptr("js/trivial-conditional"), + RuleSeverity: Ptr("warning"), + RuleDescription: Ptr("Useless conditional"), + Tool: &Tool{Name: Ptr("CodeQL"), GUID: nil, Version: Ptr("1.4.0")}, Rule: &Rule{ - ID: String("js/trivial-conditional"), - Severity: String("warning"), - Description: String("Useless conditional"), - Name: String("js/trivial-conditional"), - FullDescription: String("Expression has no effect"), - Help: String("Expression has no effect"), + ID: Ptr("js/trivial-conditional"), + Severity: Ptr("warning"), + Description: Ptr("Useless conditional"), + Name: Ptr("js/trivial-conditional"), + FullDescription: Ptr("Expression has no effect"), + Help: Ptr("Expression has no effect"), }, CreatedAt: &date, - State: String("open"), + State: Ptr("open"), ClosedBy: nil, ClosedAt: nil, - URL: String("https://api.github.com/repos/o/r/code-scanning/alerts/25"), - HTMLURL: String("https://github.com/o/r/security/code-scanning/25"), + URL: Ptr("https://api.github.com/repos/o/r/code-scanning/alerts/25"), + HTMLURL: Ptr("https://github.com/o/r/security/code-scanning/25"), MostRecentInstance: &MostRecentInstance{ - Ref: String("refs/heads/main"), - State: String("open"), - CommitSHA: String("abcdefg12345"), + Ref: Ptr("refs/heads/main"), + State: Ptr("open"), + CommitSHA: Ptr("abcdefg12345"), Message: &Message{ - Text: String("This path depends on a user-provided value."), + Text: Ptr("This path depends on a user-provided value."), }, Location: &Location{ - Path: String("spec-main/api-session-spec.ts"), - StartLine: Int(917), - EndLine: Int(917), - StartColumn: Int(7), - EndColumn: Int(18), + Path: Ptr("spec-main/api-session-spec.ts"), + StartLine: Ptr(917), + EndLine: Ptr(917), + StartColumn: Ptr(7), + EndColumn: Ptr(18), }, Classifications: []string{"test"}, }, }, { - RuleID: String("js/useless-expression"), - RuleSeverity: String("warning"), - RuleDescription: String("Expression has no effect"), - Tool: &Tool{Name: String("CodeQL"), GUID: nil, Version: String("1.4.0")}, + RuleID: Ptr("js/useless-expression"), + RuleSeverity: Ptr("warning"), + RuleDescription: Ptr("Expression has no effect"), + Tool: &Tool{Name: Ptr("CodeQL"), GUID: nil, Version: Ptr("1.4.0")}, Rule: &Rule{ - ID: String("js/useless-expression"), - Severity: String("warning"), - Description: String("Expression has no effect"), - Name: String("js/useless-expression"), - FullDescription: String("Expression has no effect"), - Help: String("Expression has no effect"), + ID: Ptr("js/useless-expression"), + Severity: Ptr("warning"), + Description: Ptr("Expression has no effect"), + Name: Ptr("js/useless-expression"), + FullDescription: Ptr("Expression has no effect"), + Help: Ptr("Expression has no effect"), }, CreatedAt: &date, - State: String("open"), + State: Ptr("open"), ClosedBy: nil, ClosedAt: nil, - URL: String("https://api.github.com/repos/o/r/code-scanning/alerts/88"), - HTMLURL: String("https://github.com/o/r/security/code-scanning/88"), + URL: Ptr("https://api.github.com/repos/o/r/code-scanning/alerts/88"), + HTMLURL: Ptr("https://github.com/o/r/security/code-scanning/88"), MostRecentInstance: &MostRecentInstance{ - Ref: String("refs/heads/main"), - State: String("open"), - CommitSHA: String("abcdefg12345"), + Ref: Ptr("refs/heads/main"), + State: Ptr("open"), + CommitSHA: Ptr("abcdefg12345"), Message: &Message{ - Text: String("This path depends on a user-provided value."), + Text: Ptr("This path depends on a user-provided value."), }, Location: &Location{ - Path: String("spec-main/api-session-spec.ts"), - StartLine: Int(917), - EndLine: Int(917), - StartColumn: Int(7), - EndColumn: Int(18), + Path: Ptr("spec-main/api-session-spec.ts"), + StartLine: Ptr(917), + EndLine: Ptr(917), + StartColumn: Ptr(7), + EndColumn: Ptr(18), }, Classifications: []string{"test"}, }, @@ -412,41 +412,41 @@ func TestCodeScanningService_ListAlertsForOrgLisCursorOptions(t *testing.T) { want := []*Alert{ { Repository: &Repository{ - ID: Int64(1), - URL: String("url"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("url"), + Name: Ptr("n"), }, - RuleID: String("js/trivial-conditional"), - RuleSeverity: String("warning"), - RuleDescription: String("Useless conditional"), - Tool: &Tool{Name: String("CodeQL"), GUID: nil, Version: String("1.4.0")}, + RuleID: Ptr("js/trivial-conditional"), + RuleSeverity: Ptr("warning"), + RuleDescription: Ptr("Useless conditional"), + Tool: &Tool{Name: Ptr("CodeQL"), GUID: nil, Version: Ptr("1.4.0")}, Rule: &Rule{ - ID: String("js/trivial-conditional"), - Severity: String("warning"), - Description: String("Useless conditional"), - Name: String("js/trivial-conditional"), - FullDescription: String("Expression has no effect"), - Help: String("Expression has no effect"), + ID: Ptr("js/trivial-conditional"), + Severity: Ptr("warning"), + Description: Ptr("Useless conditional"), + Name: Ptr("js/trivial-conditional"), + FullDescription: Ptr("Expression has no effect"), + Help: Ptr("Expression has no effect"), }, CreatedAt: &date, - State: String("open"), + State: Ptr("open"), ClosedBy: nil, ClosedAt: nil, - URL: String("https://api.github.com/repos/o/r/code-scanning/alerts/25"), - HTMLURL: String("https://github.com/o/r/security/code-scanning/25"), + URL: Ptr("https://api.github.com/repos/o/r/code-scanning/alerts/25"), + HTMLURL: Ptr("https://github.com/o/r/security/code-scanning/25"), MostRecentInstance: &MostRecentInstance{ - Ref: String("refs/heads/main"), - State: String("open"), - CommitSHA: String("abcdefg12345"), + Ref: Ptr("refs/heads/main"), + State: Ptr("open"), + CommitSHA: Ptr("abcdefg12345"), Message: &Message{ - Text: String("This path depends on a user-provided value."), + Text: Ptr("This path depends on a user-provided value."), }, Location: &Location{ - Path: String("spec-main/api-session-spec.ts"), - StartLine: Int(917), - EndLine: Int(917), - StartColumn: Int(7), - EndColumn: Int(18), + Path: Ptr("spec-main/api-session-spec.ts"), + StartLine: Ptr(917), + EndLine: Ptr(917), + StartColumn: Ptr(7), + EndColumn: Ptr(18), }, Classifications: []string{"test"}, }, @@ -574,73 +574,73 @@ func TestCodeScanningService_ListAlertsForRepo(t *testing.T) { date := Timestamp{time.Date(2020, time.May, 06, 12, 00, 00, 0, time.UTC)} want := []*Alert{ { - RuleID: String("js/trivial-conditional"), - RuleSeverity: String("warning"), - RuleDescription: String("Useless conditional"), - Tool: &Tool{Name: String("CodeQL"), GUID: nil, Version: String("1.4.0")}, + RuleID: Ptr("js/trivial-conditional"), + RuleSeverity: Ptr("warning"), + RuleDescription: Ptr("Useless conditional"), + Tool: &Tool{Name: Ptr("CodeQL"), GUID: nil, Version: Ptr("1.4.0")}, Rule: &Rule{ - ID: String("js/trivial-conditional"), - Severity: String("warning"), - Description: String("Useless conditional"), - Name: String("js/trivial-conditional"), - FullDescription: String("Expression has no effect"), - Help: String("Expression has no effect"), + ID: Ptr("js/trivial-conditional"), + Severity: Ptr("warning"), + Description: Ptr("Useless conditional"), + Name: Ptr("js/trivial-conditional"), + FullDescription: Ptr("Expression has no effect"), + Help: Ptr("Expression has no effect"), }, CreatedAt: &date, - State: String("open"), + State: Ptr("open"), ClosedBy: nil, ClosedAt: nil, - URL: String("https://api.github.com/repos/o/r/code-scanning/alerts/25"), - HTMLURL: String("https://github.com/o/r/security/code-scanning/25"), + URL: Ptr("https://api.github.com/repos/o/r/code-scanning/alerts/25"), + HTMLURL: Ptr("https://github.com/o/r/security/code-scanning/25"), MostRecentInstance: &MostRecentInstance{ - Ref: String("refs/heads/main"), - State: String("open"), - CommitSHA: String("abcdefg12345"), + Ref: Ptr("refs/heads/main"), + State: Ptr("open"), + CommitSHA: Ptr("abcdefg12345"), Message: &Message{ - Text: String("This path depends on a user-provided value."), + Text: Ptr("This path depends on a user-provided value."), }, Location: &Location{ - Path: String("spec-main/api-session-spec.ts"), - StartLine: Int(917), - EndLine: Int(917), - StartColumn: Int(7), - EndColumn: Int(18), + Path: Ptr("spec-main/api-session-spec.ts"), + StartLine: Ptr(917), + EndLine: Ptr(917), + StartColumn: Ptr(7), + EndColumn: Ptr(18), }, Classifications: []string{"test"}, }, }, { - RuleID: String("js/useless-expression"), - RuleSeverity: String("warning"), - RuleDescription: String("Expression has no effect"), - Tool: &Tool{Name: String("CodeQL"), GUID: nil, Version: String("1.4.0")}, + RuleID: Ptr("js/useless-expression"), + RuleSeverity: Ptr("warning"), + RuleDescription: Ptr("Expression has no effect"), + Tool: &Tool{Name: Ptr("CodeQL"), GUID: nil, Version: Ptr("1.4.0")}, Rule: &Rule{ - ID: String("js/useless-expression"), - Severity: String("warning"), - Description: String("Expression has no effect"), - Name: String("js/useless-expression"), - FullDescription: String("Expression has no effect"), - Help: String("Expression has no effect"), + ID: Ptr("js/useless-expression"), + Severity: Ptr("warning"), + Description: Ptr("Expression has no effect"), + Name: Ptr("js/useless-expression"), + FullDescription: Ptr("Expression has no effect"), + Help: Ptr("Expression has no effect"), }, CreatedAt: &date, - State: String("open"), + State: Ptr("open"), ClosedBy: nil, ClosedAt: nil, - URL: String("https://api.github.com/repos/o/r/code-scanning/alerts/88"), - HTMLURL: String("https://github.com/o/r/security/code-scanning/88"), + URL: Ptr("https://api.github.com/repos/o/r/code-scanning/alerts/88"), + HTMLURL: Ptr("https://github.com/o/r/security/code-scanning/88"), MostRecentInstance: &MostRecentInstance{ - Ref: String("refs/heads/main"), - State: String("open"), - CommitSHA: String("abcdefg12345"), + Ref: Ptr("refs/heads/main"), + State: Ptr("open"), + CommitSHA: Ptr("abcdefg12345"), Message: &Message{ - Text: String("This path depends on a user-provided value."), + Text: Ptr("This path depends on a user-provided value."), }, Location: &Location{ - Path: String("spec-main/api-session-spec.ts"), - StartLine: Int(917), - EndLine: Int(917), - StartColumn: Int(7), - EndColumn: Int(18), + Path: Ptr("spec-main/api-session-spec.ts"), + StartLine: Ptr(917), + EndLine: Ptr(917), + StartColumn: Ptr(7), + EndColumn: Ptr(18), }, Classifications: []string{"test"}, }, @@ -716,9 +716,9 @@ func TestCodeScanningService_UpdateAlert(t *testing.T) { }) ctx := context.Background() - dismissedComment := String("This alert is not actually correct as sanitizer is used") - dismissedReason := String("false positive") - state := String("dismissed") + dismissedComment := Ptr("This alert is not actually correct as sanitizer is used") + dismissedReason := Ptr("false positive") + state := Ptr("dismissed") stateInfo := &CodeScanningAlertState{State: *state, DismissedReason: dismissedReason, DismissedComment: dismissedComment} alert, _, err := client.CodeScanning.UpdateAlert(ctx, "o", "r", 88, stateInfo) if err != nil { @@ -727,17 +727,17 @@ func TestCodeScanningService_UpdateAlert(t *testing.T) { date := Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)} want := &Alert{ - RuleID: String("js/useless-expression"), - RuleSeverity: String("warning"), - RuleDescription: String("Expression has no effect"), - Tool: &Tool{Name: String("CodeQL"), GUID: nil, Version: String("1.4.0")}, + RuleID: Ptr("js/useless-expression"), + RuleSeverity: Ptr("warning"), + RuleDescription: Ptr("Expression has no effect"), + Tool: &Tool{Name: Ptr("CodeQL"), GUID: nil, Version: Ptr("1.4.0")}, Rule: &Rule{ - ID: String("useless expression"), - Severity: String("warning"), - Description: String("Expression has no effect"), - Name: String("useless expression"), - FullDescription: String("Expression has no effect"), - Help: String("Expression has no effect"), + ID: Ptr("useless expression"), + Severity: Ptr("warning"), + Description: Ptr("Expression has no effect"), + Name: Ptr("useless expression"), + FullDescription: Ptr("Expression has no effect"), + Help: Ptr("Expression has no effect"), }, CreatedAt: &date, State: state, @@ -745,21 +745,21 @@ func TestCodeScanningService_UpdateAlert(t *testing.T) { DismissedComment: dismissedComment, ClosedBy: nil, ClosedAt: nil, - URL: String("https://api.github.com/repos/o/r/code-scanning/alerts/88"), - HTMLURL: String("https://github.com/o/r/security/code-scanning/88"), + URL: Ptr("https://api.github.com/repos/o/r/code-scanning/alerts/88"), + HTMLURL: Ptr("https://github.com/o/r/security/code-scanning/88"), MostRecentInstance: &MostRecentInstance{ - Ref: String("refs/heads/main"), - State: String("dismissed"), - CommitSHA: String("abcdefg12345"), + Ref: Ptr("refs/heads/main"), + State: Ptr("dismissed"), + CommitSHA: Ptr("abcdefg12345"), Message: &Message{ - Text: String("This path depends on a user-provided value."), + Text: Ptr("This path depends on a user-provided value."), }, Location: &Location{ - Path: String("spec-main/api-session-spec.ts"), - StartLine: Int(917), - EndLine: Int(917), - StartColumn: Int(7), - EndColumn: Int(18), + Path: Ptr("spec-main/api-session-spec.ts"), + StartLine: Ptr(917), + EndLine: Ptr(917), + StartColumn: Ptr(7), + EndColumn: Ptr(18), }, Classifications: []string{"test"}, }, @@ -824,21 +824,21 @@ func TestCodeScanningService_ListAlertInstances(t *testing.T) { want := []*MostRecentInstance{ { - Ref: String("refs/heads/main"), - AnalysisKey: String(".github/workflows/codeql-analysis.yml:analyze"), - Category: String(".github/workflows/codeql-analysis.yml:analyze"), - Environment: String(""), - State: String("open"), - CommitSHA: String("abcdefg12345"), + Ref: Ptr("refs/heads/main"), + AnalysisKey: Ptr(".github/workflows/codeql-analysis.yml:analyze"), + Category: Ptr(".github/workflows/codeql-analysis.yml:analyze"), + Environment: Ptr(""), + State: Ptr("open"), + CommitSHA: Ptr("abcdefg12345"), Message: &Message{ - Text: String("This path depends on a user-provided value."), + Text: Ptr("This path depends on a user-provided value."), }, Location: &Location{ - Path: String("spec-main/api-session-spec.ts"), - StartLine: Int(917), - EndLine: Int(917), - StartColumn: Int(7), - EndColumn: Int(18), + Path: Ptr("spec-main/api-session-spec.ts"), + StartLine: Ptr(917), + EndLine: Ptr(917), + StartColumn: Ptr(7), + EndColumn: Ptr(18), }, Classifications: []string{"test"}, }, @@ -920,37 +920,37 @@ func TestCodeScanningService_GetAlert(t *testing.T) { date := Timestamp{time.Date(2019, time.January, 02, 15, 04, 05, 0, time.UTC)} want := &Alert{ - RuleID: String("js/useless-expression"), - RuleSeverity: String("warning"), - RuleDescription: String("Expression has no effect"), - Tool: &Tool{Name: String("CodeQL"), GUID: nil, Version: String("1.4.0")}, + RuleID: Ptr("js/useless-expression"), + RuleSeverity: Ptr("warning"), + RuleDescription: Ptr("Expression has no effect"), + Tool: &Tool{Name: Ptr("CodeQL"), GUID: nil, Version: Ptr("1.4.0")}, Rule: &Rule{ - ID: String("useless expression"), - Severity: String("warning"), - Description: String("Expression has no effect"), - Name: String("useless expression"), - FullDescription: String("Expression has no effect"), - Help: String("Expression has no effect"), + ID: Ptr("useless expression"), + Severity: Ptr("warning"), + Description: Ptr("Expression has no effect"), + Name: Ptr("useless expression"), + FullDescription: Ptr("Expression has no effect"), + Help: Ptr("Expression has no effect"), }, CreatedAt: &date, - State: String("open"), + State: Ptr("open"), ClosedBy: nil, ClosedAt: nil, - URL: String("https://api.github.com/repos/o/r/code-scanning/alerts/88"), - HTMLURL: String("https://github.com/o/r/security/code-scanning/88"), + URL: Ptr("https://api.github.com/repos/o/r/code-scanning/alerts/88"), + HTMLURL: Ptr("https://github.com/o/r/security/code-scanning/88"), MostRecentInstance: &MostRecentInstance{ - Ref: String("refs/heads/main"), - State: String("open"), - CommitSHA: String("abcdefg12345"), + Ref: Ptr("refs/heads/main"), + State: Ptr("open"), + CommitSHA: Ptr("abcdefg12345"), Message: &Message{ - Text: String("This path depends on a user-provided value."), + Text: Ptr("This path depends on a user-provided value."), }, Location: &Location{ - Path: String("spec-main/api-session-spec.ts"), - StartLine: Int(917), - EndLine: Int(917), - StartColumn: Int(7), - EndColumn: Int(18), + Path: Ptr("spec-main/api-session-spec.ts"), + StartLine: Ptr(917), + EndLine: Ptr(917), + StartColumn: Ptr(7), + EndColumn: Ptr(18), }, Classifications: []string{"test"}, }, @@ -979,28 +979,28 @@ func TestAlert_Marshal(t *testing.T) { testJSONMarshal(t, &Alert{}, "{}") u := &Alert{ - RuleID: String("rid"), - RuleSeverity: String("rs"), - RuleDescription: String("rd"), + RuleID: Ptr("rid"), + RuleSeverity: Ptr("rs"), + RuleDescription: Ptr("rd"), Tool: &Tool{ - Name: String("n"), - GUID: String("g"), - Version: String("v"), + Name: Ptr("n"), + GUID: Ptr("g"), + Version: Ptr("v"), }, CreatedAt: &Timestamp{referenceTime}, - State: String("fixed"), + State: Ptr("fixed"), ClosedBy: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, ClosedAt: &Timestamp{referenceTime}, - URL: String("url"), - HTMLURL: String("hurl"), + URL: Ptr("url"), + HTMLURL: Ptr("hurl"), } want := `{ @@ -1036,11 +1036,11 @@ func TestLocation_Marshal(t *testing.T) { testJSONMarshal(t, &Location{}, "{}") u := &Location{ - Path: String("path"), - StartLine: Int(1), - EndLine: Int(2), - StartColumn: Int(3), - EndColumn: Int(4), + Path: Ptr("path"), + StartLine: Ptr(1), + EndLine: Ptr(2), + StartColumn: Ptr(3), + EndColumn: Ptr(4), } want := `{ @@ -1059,14 +1059,14 @@ func TestRule_Marshal(t *testing.T) { testJSONMarshal(t, &Rule{}, "{}") u := &Rule{ - ID: String("1"), - Severity: String("3"), - Description: String("description"), - Name: String("first"), - SecuritySeverityLevel: String("2"), - FullDescription: String("summary"), + ID: Ptr("1"), + Severity: Ptr("3"), + Description: Ptr("description"), + Name: Ptr("first"), + SecuritySeverityLevel: Ptr("2"), + FullDescription: Ptr("summary"), Tags: []string{"tag1", "tag2"}, - Help: String("Help Text"), + Help: Ptr("Help Text"), } want := `{ @@ -1088,9 +1088,9 @@ func TestTool_Marshal(t *testing.T) { testJSONMarshal(t, &Tool{}, "{}") u := &Tool{ - Name: String("name"), - GUID: String("guid"), - Version: String("ver"), + Name: Ptr("name"), + GUID: Ptr("guid"), + Version: Ptr("ver"), } want := `{ @@ -1107,7 +1107,7 @@ func TestMessage_Marshal(t *testing.T) { testJSONMarshal(t, &Message{}, "{}") u := &Message{ - Text: String("text"), + Text: Ptr("text"), } want := `{ @@ -1170,7 +1170,7 @@ func TestCodeScanningService_ListAnalysesForRepo(t *testing.T) { ]`) }) - opts := &AnalysesListOptions{SarifID: String("8981cd8e-b078-4ac3-a3be-1dad7dbd0b582"), Ref: String("heads/master")} + opts := &AnalysesListOptions{SarifID: Ptr("8981cd8e-b078-4ac3-a3be-1dad7dbd0b582"), Ref: Ptr("heads/master")} ctx := context.Background() analyses, _, err := client.CodeScanning.ListAnalysesForRepo(ctx, "o", "r", opts) if err != nil { @@ -1180,46 +1180,46 @@ func TestCodeScanningService_ListAnalysesForRepo(t *testing.T) { date := &Timestamp{time.Date(2020, time.August, 27, 15, 05, 21, 0, time.UTC)} want := []*ScanningAnalysis{ { - ID: Int64(201), - Ref: String("refs/heads/main"), - CommitSHA: String("d99612c3e1f2970085cfbaeadf8f010ef69bad83"), - AnalysisKey: String(".github/workflows/codeql-analysis.yml:analyze"), - Environment: String("{\"language\":\"python\"}"), - Error: String(""), - Category: String(".github/workflows/codeql-analysis.yml:analyze/language:python"), + ID: Ptr(int64(201)), + Ref: Ptr("refs/heads/main"), + CommitSHA: Ptr("d99612c3e1f2970085cfbaeadf8f010ef69bad83"), + AnalysisKey: Ptr(".github/workflows/codeql-analysis.yml:analyze"), + Environment: Ptr("{\"language\":\"python\"}"), + Error: Ptr(""), + Category: Ptr(".github/workflows/codeql-analysis.yml:analyze/language:python"), CreatedAt: date, - ResultsCount: Int(17), - RulesCount: Int(49), - URL: String("https://api.github.com/repos/o/r/code-scanning/analyses/201"), - SarifID: String("8981cd8e-b078-4ac3-a3be-1dad7dbd0b582"), + ResultsCount: Ptr(17), + RulesCount: Ptr(49), + URL: Ptr("https://api.github.com/repos/o/r/code-scanning/analyses/201"), + SarifID: Ptr("8981cd8e-b078-4ac3-a3be-1dad7dbd0b582"), Tool: &Tool{ - Name: String("CodeQL"), + Name: Ptr("CodeQL"), GUID: nil, - Version: String("2.4.0"), + Version: Ptr("2.4.0"), }, - Deletable: Bool(true), - Warning: String(""), + Deletable: Ptr(true), + Warning: Ptr(""), }, { - ID: Int64(200), - Ref: String("refs/heads/my-branch"), - CommitSHA: String("c8cff6510d4d084fb1b4aa13b64b97ca12b07321"), - AnalysisKey: String(".github/workflows/shiftleft.yml:build"), - Environment: String("{}"), - Error: String(""), - Category: String(".github/workflows/shiftleft.yml:build/"), + ID: Ptr(int64(200)), + Ref: Ptr("refs/heads/my-branch"), + CommitSHA: Ptr("c8cff6510d4d084fb1b4aa13b64b97ca12b07321"), + AnalysisKey: Ptr(".github/workflows/shiftleft.yml:build"), + Environment: Ptr("{}"), + Error: Ptr(""), + Category: Ptr(".github/workflows/shiftleft.yml:build/"), CreatedAt: date, - ResultsCount: Int(17), - RulesCount: Int(32), - URL: String("https://api.github.com/repos/o/r/code-scanning/analyses/200"), - SarifID: String("8981cd8e-b078-4ac3-a3be-1dad7dbd0b582"), + ResultsCount: Ptr(17), + RulesCount: Ptr(32), + URL: Ptr("https://api.github.com/repos/o/r/code-scanning/analyses/200"), + SarifID: Ptr("8981cd8e-b078-4ac3-a3be-1dad7dbd0b582"), Tool: &Tool{ - Name: String("Python Security ScanningAnalysis"), + Name: Ptr("Python Security ScanningAnalysis"), GUID: nil, - Version: String("1.2.0"), + Version: Ptr("1.2.0"), }, - Deletable: Bool(true), - Warning: String(""), + Deletable: Ptr(true), + Warning: Ptr(""), }, } if !cmp.Equal(analyses, want) { @@ -1278,25 +1278,25 @@ func TestCodeScanningService_GetAnalysis(t *testing.T) { date := &Timestamp{time.Date(2021, time.January, 13, 11, 55, 49, 0, time.UTC)} want := &ScanningAnalysis{ - ID: Int64(3602840), - Ref: String("refs/heads/main"), - CommitSHA: String("c18c69115654ff0166991962832dc2bd7756e655"), - AnalysisKey: String(".github/workflows/codeql-analysis.yml:analyze"), - Environment: String("{\"language\":\"javascript\"}"), - Error: String(""), - Category: String(".github/workflows/codeql-analysis.yml:analyze/language:javascript"), + ID: Ptr(int64(3602840)), + Ref: Ptr("refs/heads/main"), + CommitSHA: Ptr("c18c69115654ff0166991962832dc2bd7756e655"), + AnalysisKey: Ptr(".github/workflows/codeql-analysis.yml:analyze"), + Environment: Ptr("{\"language\":\"javascript\"}"), + Error: Ptr(""), + Category: Ptr(".github/workflows/codeql-analysis.yml:analyze/language:javascript"), CreatedAt: date, - ResultsCount: Int(3), - RulesCount: Int(67), - URL: String("https://api.github.com/repos/o/r/code-scanning/analyses/201"), - SarifID: String("47177e22-5596-11eb-80a1-c1e54ef945c6"), + ResultsCount: Ptr(3), + RulesCount: Ptr(67), + URL: Ptr("https://api.github.com/repos/o/r/code-scanning/analyses/201"), + SarifID: Ptr("47177e22-5596-11eb-80a1-c1e54ef945c6"), Tool: &Tool{ - Name: String("CodeQL"), + Name: Ptr("CodeQL"), GUID: nil, - Version: String("2.4.0"), + Version: Ptr("2.4.0"), }, - Deletable: Bool(true), - Warning: String(""), + Deletable: Ptr(true), + Warning: Ptr(""), } if !cmp.Equal(analysis, want) { t.Errorf("CodeScanning.GetAnalysis returned %+v, want %+v", analysis, want) @@ -1336,8 +1336,8 @@ func TestCodeScanningService_DeleteAnalysis(t *testing.T) { } want := &DeleteAnalysis{ - NextAnalysisURL: String("a"), - ConfirmDeleteURL: String("b"), + NextAnalysisURL: Ptr("a"), + ConfirmDeleteURL: Ptr("b"), } if !cmp.Equal(analysis, want) { t.Errorf("CodeScanning.DeleteAnalysis returned %+v, want %+v", analysis, want) @@ -1407,34 +1407,34 @@ func TestCodeScanningService_ListCodeQLDatabases(t *testing.T) { date := &Timestamp{time.Date(2021, time.January, 13, 11, 55, 49, 0, time.UTC)} want := []*CodeQLDatabase{ { - ID: Int64(1), - Name: String("name"), - Language: String("language"), + ID: Ptr(int64(1)), + Name: Ptr("name"), + Language: Ptr("language"), Uploader: &User{ - Login: String("a"), - ID: Int64(1), - NodeID: String("b"), - AvatarURL: String("c"), - GravatarID: String("d"), - URL: String("e"), - HTMLURL: String("f"), - FollowersURL: String("g"), - FollowingURL: String("h"), - GistsURL: String("i"), - StarredURL: String("j"), - SubscriptionsURL: String("k"), - OrganizationsURL: String("l"), - ReposURL: String("m"), - EventsURL: String("n"), - ReceivedEventsURL: String("o"), - Type: String("p"), - SiteAdmin: Bool(false), + Login: Ptr("a"), + ID: Ptr(int64(1)), + NodeID: Ptr("b"), + AvatarURL: Ptr("c"), + GravatarID: Ptr("d"), + URL: Ptr("e"), + HTMLURL: Ptr("f"), + FollowersURL: Ptr("g"), + FollowingURL: Ptr("h"), + GistsURL: Ptr("i"), + StarredURL: Ptr("j"), + SubscriptionsURL: Ptr("k"), + OrganizationsURL: Ptr("l"), + ReposURL: Ptr("m"), + EventsURL: Ptr("n"), + ReceivedEventsURL: Ptr("o"), + Type: Ptr("p"), + SiteAdmin: Ptr(false), }, - ContentType: String("r"), - Size: Int64(1024), + ContentType: Ptr("r"), + Size: Ptr(int64(1024)), CreatedAt: date, UpdatedAt: date, - URL: String("s"), + URL: Ptr("s"), }, } @@ -1503,34 +1503,34 @@ func TestCodeScanningService_GetCodeQLDatabase(t *testing.T) { date := &Timestamp{time.Date(2021, time.January, 13, 11, 55, 49, 0, time.UTC)} want := &CodeQLDatabase{ - ID: Int64(1), - Name: String("name"), - Language: String("language"), + ID: Ptr(int64(1)), + Name: Ptr("name"), + Language: Ptr("language"), Uploader: &User{ - Login: String("a"), - ID: Int64(1), - NodeID: String("b"), - AvatarURL: String("c"), - GravatarID: String("d"), - URL: String("e"), - HTMLURL: String("f"), - FollowersURL: String("g"), - FollowingURL: String("h"), - GistsURL: String("i"), - StarredURL: String("j"), - SubscriptionsURL: String("k"), - OrganizationsURL: String("l"), - ReposURL: String("m"), - EventsURL: String("n"), - ReceivedEventsURL: String("o"), - Type: String("p"), - SiteAdmin: Bool(false), + Login: Ptr("a"), + ID: Ptr(int64(1)), + NodeID: Ptr("b"), + AvatarURL: Ptr("c"), + GravatarID: Ptr("d"), + URL: Ptr("e"), + HTMLURL: Ptr("f"), + FollowersURL: Ptr("g"), + FollowingURL: Ptr("h"), + GistsURL: Ptr("i"), + StarredURL: Ptr("j"), + SubscriptionsURL: Ptr("k"), + OrganizationsURL: Ptr("l"), + ReposURL: Ptr("m"), + EventsURL: Ptr("n"), + ReceivedEventsURL: Ptr("o"), + Type: Ptr("p"), + SiteAdmin: Ptr(false), }, - ContentType: String("r"), - Size: Int64(1024), + ContentType: Ptr("r"), + Size: Ptr(int64(1024)), CreatedAt: date, UpdatedAt: date, - URL: String("s"), + URL: Ptr("s"), } if !cmp.Equal(database, want) { @@ -1581,9 +1581,9 @@ func TestCodeScanningService_GetDefaultSetupConfiguration(t *testing.T) { date := &Timestamp{time.Date(2006, time.January, 02, 15, 04, 05, 0, time.UTC)} want := &DefaultSetupConfiguration{ - State: String("configured"), + State: Ptr("configured"), Languages: []string{"javascript", "javascript-typescript", "typescript"}, - QuerySuite: String("default"), + QuerySuite: Ptr("default"), UpdatedAt: date, } if !cmp.Equal(cfg, want) { @@ -1624,7 +1624,7 @@ func TestCodeScanningService_UpdateDefaultSetupConfiguration(t *testing.T) { options := &UpdateDefaultSetupConfigurationOptions{ State: "configured", Languages: []string{"go"}, - QuerySuite: String("default"), + QuerySuite: Ptr("default"), } got, _, err := client.CodeScanning.UpdateDefaultSetupConfiguration(ctx, "o", "r", options) if err != nil { @@ -1632,8 +1632,8 @@ func TestCodeScanningService_UpdateDefaultSetupConfiguration(t *testing.T) { } want := &UpdateDefaultSetupConfigurationResponse{ - RunID: Int64(5301214200), - RunURL: String("https://api.github.com/repos/o/r/actions/runs/5301214200"), + RunID: Ptr(int64(5301214200)), + RunURL: Ptr("https://api.github.com/repos/o/r/actions/runs/5301214200"), } if !cmp.Equal(got, want) { t.Errorf("CodeScanning.UpdateDefaultSetupConfiguration returned %+v, want %+v", got, want) diff --git a/github/codesofconduct_test.go b/github/codesofconduct_test.go index 7d237791b13..a1f0aefe8ca 100644 --- a/github/codesofconduct_test.go +++ b/github/codesofconduct_test.go @@ -34,9 +34,9 @@ func TestCodesOfConductService_List(t *testing.T) { want := []*CodeOfConduct{ { - Key: String("key"), - Name: String("name"), - URL: String("url"), + Key: Ptr("key"), + Name: Ptr("name"), + URL: Ptr("url"), }} if !cmp.Equal(want, cs) { t.Errorf("returned %+v, want %+v", cs, want) @@ -72,10 +72,10 @@ func TestCodesOfConductService_Get(t *testing.T) { assertNilError(t, err) want := &CodeOfConduct{ - Key: String("key"), - Name: String("name"), - URL: String("url"), - Body: String("body"), + Key: Ptr("key"), + Name: Ptr("name"), + URL: Ptr("url"), + Body: Ptr("body"), } if !cmp.Equal(want, coc) { t.Errorf("returned %+v, want %+v", coc, want) @@ -101,10 +101,10 @@ func TestCodeOfConduct_Marshal(t *testing.T) { testJSONMarshal(t, &CodeOfConduct{}, "{}") a := &CodeOfConduct{ - Name: String("name"), - Key: String("key"), - URL: String("url"), - Body: String("body"), + Name: Ptr("name"), + Key: Ptr("key"), + URL: Ptr("url"), + Body: Ptr("body"), } want := `{ diff --git a/github/codespaces_secrets_test.go b/github/codespaces_secrets_test.go index 9199a93b935..9529143cee5 100644 --- a/github/codespaces_secrets_test.go +++ b/github/codespaces_secrets_test.go @@ -463,7 +463,7 @@ func TestCodespacesService_GetPublicKey(t *testing.T) { t.Errorf("Codespaces.%v returned error: %v", tt.methodName, err) } - want := &PublicKey{KeyID: String("1234"), Key: String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234")} + want := &PublicKey{KeyID: Ptr("1234"), Key: Ptr("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234")} if !cmp.Equal(key, want) { t.Errorf("Codespaces.%v returned %+v, want %+v", tt.methodName, key, want) } @@ -543,9 +543,9 @@ func TestCodespacesService_ListSelectedReposForSecret(t *testing.T) { } want := &SelectedReposList{ - TotalCount: Int(1), + TotalCount: Ptr(1), Repositories: []*Repository{ - {ID: Int64(1)}, + {ID: Ptr(int64(1))}, }, } @@ -652,7 +652,7 @@ func TestCodespacesService_AddSelectedReposForSecret(t *testing.T) { badCall func(context.Context, *Client) (*Response, error) methodName string } - repo := &Repository{ID: Int64(1234)} + repo := &Repository{ID: Ptr(int64(1234))} tests := []test{ { name: "User", @@ -720,7 +720,7 @@ func TestCodespacesService_RemoveSelectedReposFromSecret(t *testing.T) { badCall func(context.Context, *Client) (*Response, error) methodName string } - repo := &Repository{ID: Int64(1234)} + repo := &Repository{ID: Ptr(int64(1234))} tests := []test{ { name: "User", diff --git a/github/codespaces_test.go b/github/codespaces_test.go index 13ceb92a057..64146ec848c 100644 --- a/github/codespaces_test.go +++ b/github/codespaces_test.go @@ -35,55 +35,55 @@ func TestCodespacesService_ListInRepo(t *testing.T) { t.Errorf("Codespaces.ListInRepo returned error: %v", err) } - want := &ListCodespaces{TotalCount: Int(2), Codespaces: []*Codespace{ + want := &ListCodespaces{TotalCount: Ptr(2), Codespaces: []*Codespace{ { - ID: Int64(1), - Name: String("monalisa-octocat-hello-world-g4wpq6h95q"), - EnvironmentID: String("26a7c758-7299-4a73-b978-5a92a7ae98a0"), + ID: Ptr(int64(1)), + Name: Ptr("monalisa-octocat-hello-world-g4wpq6h95q"), + EnvironmentID: Ptr("26a7c758-7299-4a73-b978-5a92a7ae98a0"), Owner: &User{ - Login: String("octocat"), + Login: Ptr("octocat"), }, BillableOwner: &User{ - Login: String("octocat"), + Login: Ptr("octocat"), }, Repository: &Repository{ - ID: Int64(1296269), + ID: Ptr(int64(1296269)), }, Machine: &CodespacesMachine{ - Name: String("standardLinux"), - DisplayName: String("4 cores, 8 GB RAM, 64 GB storage"), - OperatingSystem: String("linux"), - StorageInBytes: Int64(68719476736), - MemoryInBytes: Int64(8589934592), - CPUs: Int(4), + Name: Ptr("standardLinux"), + DisplayName: Ptr("4 cores, 8 GB RAM, 64 GB storage"), + OperatingSystem: Ptr("linux"), + StorageInBytes: Ptr(int64(68719476736)), + MemoryInBytes: Ptr(int64(8589934592)), + CPUs: Ptr(4), }, - Prebuild: Bool(false), - DevcontainerPath: String(".devcontainer/devcontainer.json"), + Prebuild: Ptr(false), + DevcontainerPath: Ptr(".devcontainer/devcontainer.json"), CreatedAt: &Timestamp{time.Date(2021, 10, 14, 0, 53, 30, 0, time.FixedZone("", -6*60*60))}, UpdatedAt: &Timestamp{time.Date(2021, 10, 14, 0, 53, 32, 0, time.FixedZone("", -6*60*60))}, LastUsedAt: &Timestamp{time.Date(2021, 10, 14, 0, 53, 30, 0, time.FixedZone("", -6*60*60))}, - State: String("Available"), - URL: String("https://api.github.com/user/codespaces/monalisa-octocat-hello-world-g4wpq6h95q"), + State: Ptr("Available"), + URL: Ptr("https://api.github.com/user/codespaces/monalisa-octocat-hello-world-g4wpq6h95q"), GitStatus: &CodespacesGitStatus{ - Ahead: Int(0), - Behind: Int(0), - HasUnpushedChanges: Bool(false), - HasUncommittedChanges: Bool(false), - Ref: String("main"), + Ahead: Ptr(0), + Behind: Ptr(0), + HasUnpushedChanges: Ptr(false), + HasUncommittedChanges: Ptr(false), + Ref: Ptr("main"), }, - Location: String("WestUs2"), - IdleTimeoutMinutes: Int(60), - WebURL: String("https://monalisa-octocat-hello-world-g4wpq6h95q.github.dev"), - MachinesURL: String("https://api.github.com/user/codespaces/monalisa-octocat-hello-world-g4wpq6h95q/machines"), - StartURL: String("https://api.github.com/user/codespaces/monalisa-octocat-hello-world-g4wpq6h95q/start"), - StopURL: String("https://api.github.com/user/codespaces/monalisa-octocat-hello-world-g4wpq6h95q/stop"), + Location: Ptr("WestUs2"), + IdleTimeoutMinutes: Ptr(60), + WebURL: Ptr("https://monalisa-octocat-hello-world-g4wpq6h95q.github.dev"), + MachinesURL: Ptr("https://api.github.com/user/codespaces/monalisa-octocat-hello-world-g4wpq6h95q/machines"), + StartURL: Ptr("https://api.github.com/user/codespaces/monalisa-octocat-hello-world-g4wpq6h95q/start"), + StopURL: Ptr("https://api.github.com/user/codespaces/monalisa-octocat-hello-world-g4wpq6h95q/stop"), RecentFolders: []string{ "testfolder1", "testfolder2", }, }, { - ID: Int64(2), + ID: Ptr(int64(2)), }, }} if !cmp.Equal(codespaces, want) { @@ -121,11 +121,11 @@ func TestCodespacesService_List(t *testing.T) { t.Errorf("Codespaces.List returned error: %v", err) } - want := &ListCodespaces{TotalCount: Int(1), Codespaces: []*Codespace{ + want := &ListCodespaces{TotalCount: Ptr(1), Codespaces: []*Codespace{ { - ID: Int64(1), + ID: Ptr(int64(1)), Repository: &Repository{ - ID: Int64(1296269), + ID: Ptr(int64(1296269)), }, }, }} @@ -154,10 +154,10 @@ func TestCodespacesService_CreateInRepo(t *testing.T) { fmt.Fprint(w, `{"id":1, "repository": {"id": 1296269}}`) }) input := &CreateCodespaceOptions{ - Ref: String("main"), - Geo: String("WestUs2"), - Machine: String("standardLinux"), - IdleTimeoutMinutes: Int(60), + Ref: Ptr("main"), + Geo: Ptr("WestUs2"), + Machine: Ptr("standardLinux"), + IdleTimeoutMinutes: Ptr(60), } ctx := context.Background() codespace, _, err := client.Codespaces.CreateInRepo(ctx, "owner", "repo", input) @@ -165,9 +165,9 @@ func TestCodespacesService_CreateInRepo(t *testing.T) { t.Errorf("Codespaces.CreateInRepo returned error: %v", err) } want := &Codespace{ - ID: Int64(1), + ID: Ptr(int64(1)), Repository: &Repository{ - ID: Int64(1296269), + ID: Ptr(int64(1296269)), }, } @@ -204,9 +204,9 @@ func TestCodespacesService_Start(t *testing.T) { t.Errorf("Codespaces.Start returned error: %v", err) } want := &Codespace{ - ID: Int64(1), + ID: Ptr(int64(1)), Repository: &Repository{ - ID: Int64(1296269), + ID: Ptr(int64(1296269)), }, } @@ -243,9 +243,9 @@ func TestCodespacesService_Stop(t *testing.T) { t.Errorf("Codespaces.Stop returned error: %v", err) } want := &Codespace{ - ID: Int64(1), + ID: Ptr(int64(1)), Repository: &Repository{ - ID: Int64(1296269), + ID: Ptr(int64(1296269)), }, } diff --git a/github/copilot_test.go b/github/copilot_test.go index fd5efa9f0bf..82e8a770455 100644 --- a/github/copilot_test.go +++ b/github/copilot_test.go @@ -150,8 +150,8 @@ func TestCopilotService_GetSeatDetailsUser(t *testing.T) { } want := &User{ - ID: Int64(1), - Type: String("User"), + ID: Ptr(int64(1)), + Type: Ptr("User"), } if got, ok := seatDetails.GetUser(); ok && !cmp.Equal(got, want) { @@ -168,8 +168,8 @@ func TestCopilotService_GetSeatDetailsUser(t *testing.T) { }` bad := &Organization{ - ID: Int64(1), - Type: String("Organization"), + ID: Ptr(int64(1)), + Type: Ptr("Organization"), } err = json.Unmarshal([]byte(data), seatDetails) @@ -199,7 +199,7 @@ func TestCopilotService_GetSeatDetailsTeam(t *testing.T) { } want := &Team{ - ID: Int64(1), + ID: Ptr(int64(1)), } if got, ok := seatDetails.GetTeam(); ok && !cmp.Equal(got, want) { @@ -216,8 +216,8 @@ func TestCopilotService_GetSeatDetailsTeam(t *testing.T) { }` bad := &User{ - ID: Int64(1), - Type: String("User"), + ID: Ptr(int64(1)), + Type: Ptr("User"), } err = json.Unmarshal([]byte(data), seatDetails) @@ -247,8 +247,8 @@ func TestCopilotService_GetSeatDetailsOrganization(t *testing.T) { } want := &Organization{ - ID: Int64(1), - Type: String("Organization"), + ID: Ptr(int64(1)), + Type: Ptr("Organization"), } if got, ok := seatDetails.GetOrganization(); ok && !cmp.Equal(got, want) { @@ -265,7 +265,7 @@ func TestCopilotService_GetSeatDetailsOrganization(t *testing.T) { }` bad := &Team{ - ID: Int64(1), + ID: Ptr(int64(1)), } err = json.Unmarshal([]byte(data), seatDetails) @@ -495,97 +495,97 @@ func TestCopilotService_ListCopilotSeats(t *testing.T) { Seats: []*CopilotSeatDetails{ { Assignee: &User{ - Login: String("octocat"), - ID: Int64(1), - NodeID: String("MDQ6VXNlcjE="), - AvatarURL: String("https://github.com/images/error/octocat_happy.gif"), - GravatarID: String(""), - URL: String("https://api.github.com/users/octocat"), - HTMLURL: String("https://github.com/octocat"), - FollowersURL: String("https://api.github.com/users/octocat/followers"), - FollowingURL: String("https://api.github.com/users/octocat/following{/other_user}"), - GistsURL: String("https://api.github.com/users/octocat/gists{/gist_id}"), - StarredURL: String("https://api.github.com/users/octocat/starred{/owner}{/repo}"), - SubscriptionsURL: String("https://api.github.com/users/octocat/subscriptions"), - OrganizationsURL: String("https://api.github.com/users/octocat/orgs"), - ReposURL: String("https://api.github.com/users/octocat/repos"), - EventsURL: String("https://api.github.com/users/octocat/events{/privacy}"), - ReceivedEventsURL: String("https://api.github.com/users/octocat/received_events"), - Type: String("User"), - SiteAdmin: Bool(false), + Login: Ptr("octocat"), + ID: Ptr(int64(1)), + NodeID: Ptr("MDQ6VXNlcjE="), + AvatarURL: Ptr("https://github.com/images/error/octocat_happy.gif"), + GravatarID: Ptr(""), + URL: Ptr("https://api.github.com/users/octocat"), + HTMLURL: Ptr("https://github.com/octocat"), + FollowersURL: Ptr("https://api.github.com/users/octocat/followers"), + FollowingURL: Ptr("https://api.github.com/users/octocat/following{/other_user}"), + GistsURL: Ptr("https://api.github.com/users/octocat/gists{/gist_id}"), + StarredURL: Ptr("https://api.github.com/users/octocat/starred{/owner}{/repo}"), + SubscriptionsURL: Ptr("https://api.github.com/users/octocat/subscriptions"), + OrganizationsURL: Ptr("https://api.github.com/users/octocat/orgs"), + ReposURL: Ptr("https://api.github.com/users/octocat/repos"), + EventsURL: Ptr("https://api.github.com/users/octocat/events{/privacy}"), + ReceivedEventsURL: Ptr("https://api.github.com/users/octocat/received_events"), + Type: Ptr("User"), + SiteAdmin: Ptr(false), }, AssigningTeam: &Team{ - ID: Int64(1), - NodeID: String("MDQ6VGVhbTE="), - URL: String("https://api.github.com/teams/1"), - HTMLURL: String("https://github.com/orgs/github/teams/justice-league"), - Name: String("Justice League"), - Slug: String("justice-league"), - Description: String("A great team."), - Privacy: String("closed"), - Permission: String("admin"), - MembersURL: String("https://api.github.com/teams/1/members{/member}"), - RepositoriesURL: String("https://api.github.com/teams/1/repos"), + ID: Ptr(int64(1)), + NodeID: Ptr("MDQ6VGVhbTE="), + URL: Ptr("https://api.github.com/teams/1"), + HTMLURL: Ptr("https://github.com/orgs/github/teams/justice-league"), + Name: Ptr("Justice League"), + Slug: Ptr("justice-league"), + Description: Ptr("A great team."), + Privacy: Ptr("closed"), + Permission: Ptr("admin"), + MembersURL: Ptr("https://api.github.com/teams/1/members{/member}"), + RepositoriesURL: Ptr("https://api.github.com/teams/1/repos"), Parent: nil, }, CreatedAt: &createdAt1, UpdatedAt: &updatedAt1, PendingCancellationDate: nil, LastActivityAt: &lastActivityAt1, - LastActivityEditor: String("vscode/1.77.3/copilot/1.86.82"), + LastActivityEditor: Ptr("vscode/1.77.3/copilot/1.86.82"), }, { Assignee: &User{ - Login: String("octokitten"), - ID: Int64(1), - NodeID: String("MDQ76VNlcjE="), - AvatarURL: String("https://github.com/images/error/octokitten_happy.gif"), - GravatarID: String(""), - URL: String("https://api.github.com/users/octokitten"), - HTMLURL: String("https://github.com/octokitten"), - FollowersURL: String("https://api.github.com/users/octokitten/followers"), - FollowingURL: String("https://api.github.com/users/octokitten/following{/other_user}"), - GistsURL: String("https://api.github.com/users/octokitten/gists{/gist_id}"), - StarredURL: String("https://api.github.com/users/octokitten/starred{/owner}{/repo}"), - SubscriptionsURL: String("https://api.github.com/users/octokitten/subscriptions"), - OrganizationsURL: String("https://api.github.com/users/octokitten/orgs"), - ReposURL: String("https://api.github.com/users/octokitten/repos"), - EventsURL: String("https://api.github.com/users/octokitten/events{/privacy}"), - ReceivedEventsURL: String("https://api.github.com/users/octokitten/received_events"), - Type: String("User"), - SiteAdmin: Bool(false), + Login: Ptr("octokitten"), + ID: Ptr(int64(1)), + NodeID: Ptr("MDQ76VNlcjE="), + AvatarURL: Ptr("https://github.com/images/error/octokitten_happy.gif"), + GravatarID: Ptr(""), + URL: Ptr("https://api.github.com/users/octokitten"), + HTMLURL: Ptr("https://github.com/octokitten"), + FollowersURL: Ptr("https://api.github.com/users/octokitten/followers"), + FollowingURL: Ptr("https://api.github.com/users/octokitten/following{/other_user}"), + GistsURL: Ptr("https://api.github.com/users/octokitten/gists{/gist_id}"), + StarredURL: Ptr("https://api.github.com/users/octokitten/starred{/owner}{/repo}"), + SubscriptionsURL: Ptr("https://api.github.com/users/octokitten/subscriptions"), + OrganizationsURL: Ptr("https://api.github.com/users/octokitten/orgs"), + ReposURL: Ptr("https://api.github.com/users/octokitten/repos"), + EventsURL: Ptr("https://api.github.com/users/octokitten/events{/privacy}"), + ReceivedEventsURL: Ptr("https://api.github.com/users/octokitten/received_events"), + Type: Ptr("User"), + SiteAdmin: Ptr(false), }, AssigningTeam: nil, CreatedAt: &createdAt2, UpdatedAt: &updatedAt2, - PendingCancellationDate: String("2021-11-01"), + PendingCancellationDate: Ptr("2021-11-01"), LastActivityAt: &lastActivityAt2, - LastActivityEditor: String("vscode/1.77.3/copilot/1.86.82"), + LastActivityEditor: Ptr("vscode/1.77.3/copilot/1.86.82"), }, { Assignee: &Team{ - ID: Int64(1), - Name: String("octokittens"), + ID: Ptr(int64(1)), + Name: Ptr("octokittens"), }, AssigningTeam: nil, CreatedAt: &createdAt2, UpdatedAt: &updatedAt2, - PendingCancellationDate: String("2021-11-01"), + PendingCancellationDate: Ptr("2021-11-01"), LastActivityAt: &lastActivityAt2, - LastActivityEditor: String("vscode/1.77.3/copilot/1.86.82"), + LastActivityEditor: Ptr("vscode/1.77.3/copilot/1.86.82"), }, { Assignee: &Organization{ - ID: Int64(1), - Name: String("octocats"), - Type: String("Organization"), + ID: Ptr(int64(1)), + Name: Ptr("octocats"), + Type: Ptr("Organization"), }, AssigningTeam: nil, CreatedAt: &createdAt2, UpdatedAt: &updatedAt2, - PendingCancellationDate: String("2021-11-01"), + PendingCancellationDate: Ptr("2021-11-01"), LastActivityAt: &lastActivityAt2, - LastActivityEditor: String("vscode/1.77.3/copilot/1.86.82"), + LastActivityEditor: Ptr("vscode/1.77.3/copilot/1.86.82"), }, }, } @@ -745,73 +745,73 @@ func TestCopilotService_ListCopilotEnterpriseSeats(t *testing.T) { Seats: []*CopilotSeatDetails{ { Assignee: &User{ - Login: String("octocat"), - ID: Int64(1), - NodeID: String("MDQ6VXNlcjE="), - AvatarURL: String("https://github.com/images/error/octocat_happy.gif"), - GravatarID: String(""), - URL: String("https://api.github.com/users/octocat"), - HTMLURL: String("https://github.com/octocat"), - FollowersURL: String("https://api.github.com/users/octocat/followers"), - FollowingURL: String("https://api.github.com/users/octocat/following{/other_user}"), - GistsURL: String("https://api.github.com/users/octocat/gists{/gist_id}"), - StarredURL: String("https://api.github.com/users/octocat/starred{/owner}{/repo}"), - SubscriptionsURL: String("https://api.github.com/users/octocat/subscriptions"), - OrganizationsURL: String("https://api.github.com/users/octocat/orgs"), - ReposURL: String("https://api.github.com/users/octocat/repos"), - EventsURL: String("https://api.github.com/users/octocat/events{/privacy}"), - ReceivedEventsURL: String("https://api.github.com/users/octocat/received_events"), - Type: String("User"), - SiteAdmin: Bool(false), + Login: Ptr("octocat"), + ID: Ptr(int64(1)), + NodeID: Ptr("MDQ6VXNlcjE="), + AvatarURL: Ptr("https://github.com/images/error/octocat_happy.gif"), + GravatarID: Ptr(""), + URL: Ptr("https://api.github.com/users/octocat"), + HTMLURL: Ptr("https://github.com/octocat"), + FollowersURL: Ptr("https://api.github.com/users/octocat/followers"), + FollowingURL: Ptr("https://api.github.com/users/octocat/following{/other_user}"), + GistsURL: Ptr("https://api.github.com/users/octocat/gists{/gist_id}"), + StarredURL: Ptr("https://api.github.com/users/octocat/starred{/owner}{/repo}"), + SubscriptionsURL: Ptr("https://api.github.com/users/octocat/subscriptions"), + OrganizationsURL: Ptr("https://api.github.com/users/octocat/orgs"), + ReposURL: Ptr("https://api.github.com/users/octocat/repos"), + EventsURL: Ptr("https://api.github.com/users/octocat/events{/privacy}"), + ReceivedEventsURL: Ptr("https://api.github.com/users/octocat/received_events"), + Type: Ptr("User"), + SiteAdmin: Ptr(false), }, AssigningTeam: &Team{ - ID: Int64(1), - NodeID: String("MDQ6VGVhbTE="), - URL: String("https://api.github.com/teams/1"), - HTMLURL: String("https://github.com/orgs/github/teams/justice-league"), - Name: String("Justice League"), - Slug: String("justice-league"), - Description: String("A great team."), - Privacy: String("closed"), - Permission: String("admin"), - MembersURL: String("https://api.github.com/teams/1/members{/member}"), - RepositoriesURL: String("https://api.github.com/teams/1/repos"), + ID: Ptr(int64(1)), + NodeID: Ptr("MDQ6VGVhbTE="), + URL: Ptr("https://api.github.com/teams/1"), + HTMLURL: Ptr("https://github.com/orgs/github/teams/justice-league"), + Name: Ptr("Justice League"), + Slug: Ptr("justice-league"), + Description: Ptr("A great team."), + Privacy: Ptr("closed"), + Permission: Ptr("admin"), + MembersURL: Ptr("https://api.github.com/teams/1/members{/member}"), + RepositoriesURL: Ptr("https://api.github.com/teams/1/repos"), Parent: nil, }, CreatedAt: &createdAt1, UpdatedAt: &updatedAt1, PendingCancellationDate: nil, LastActivityAt: &lastActivityAt1, - LastActivityEditor: String("vscode/1.77.3/copilot/1.86.82"), - PlanType: String("business"), + LastActivityEditor: Ptr("vscode/1.77.3/copilot/1.86.82"), + PlanType: Ptr("business"), }, { Assignee: &User{ - Login: String("octokitten"), - ID: Int64(1), - NodeID: String("MDQ76VNlcjE="), - AvatarURL: String("https://github.com/images/error/octokitten_happy.gif"), - GravatarID: String(""), - URL: String("https://api.github.com/users/octokitten"), - HTMLURL: String("https://github.com/octokitten"), - FollowersURL: String("https://api.github.com/users/octokitten/followers"), - FollowingURL: String("https://api.github.com/users/octokitten/following{/other_user}"), - GistsURL: String("https://api.github.com/users/octokitten/gists{/gist_id}"), - StarredURL: String("https://api.github.com/users/octokitten/starred{/owner}{/repo}"), - SubscriptionsURL: String("https://api.github.com/users/octokitten/subscriptions"), - OrganizationsURL: String("https://api.github.com/users/octokitten/orgs"), - ReposURL: String("https://api.github.com/users/octokitten/repos"), - EventsURL: String("https://api.github.com/users/octokitten/events{/privacy}"), - ReceivedEventsURL: String("https://api.github.com/users/octokitten/received_events"), - Type: String("User"), - SiteAdmin: Bool(false), + Login: Ptr("octokitten"), + ID: Ptr(int64(1)), + NodeID: Ptr("MDQ76VNlcjE="), + AvatarURL: Ptr("https://github.com/images/error/octokitten_happy.gif"), + GravatarID: Ptr(""), + URL: Ptr("https://api.github.com/users/octokitten"), + HTMLURL: Ptr("https://github.com/octokitten"), + FollowersURL: Ptr("https://api.github.com/users/octokitten/followers"), + FollowingURL: Ptr("https://api.github.com/users/octokitten/following{/other_user}"), + GistsURL: Ptr("https://api.github.com/users/octokitten/gists{/gist_id}"), + StarredURL: Ptr("https://api.github.com/users/octokitten/starred{/owner}{/repo}"), + SubscriptionsURL: Ptr("https://api.github.com/users/octokitten/subscriptions"), + OrganizationsURL: Ptr("https://api.github.com/users/octokitten/orgs"), + ReposURL: Ptr("https://api.github.com/users/octokitten/repos"), + EventsURL: Ptr("https://api.github.com/users/octokitten/events{/privacy}"), + ReceivedEventsURL: Ptr("https://api.github.com/users/octokitten/received_events"), + Type: Ptr("User"), + SiteAdmin: Ptr(false), }, AssigningTeam: nil, CreatedAt: &createdAt2, UpdatedAt: &updatedAt2, - PendingCancellationDate: String("2021-11-01"), + PendingCancellationDate: Ptr("2021-11-01"), LastActivityAt: &lastActivityAt2, - LastActivityEditor: String("vscode/1.77.3/copilot/1.86.82"), + LastActivityEditor: Ptr("vscode/1.77.3/copilot/1.86.82"), PlanType: nil, }, }, @@ -1067,44 +1067,44 @@ func TestCopilotService_GetSeatDetails(t *testing.T) { want := &CopilotSeatDetails{ Assignee: &User{ - Login: String("octocat"), - ID: Int64(1), - NodeID: String("MDQ6VXNlcjE="), - AvatarURL: String("https://github.com/images/error/octocat_happy.gif"), - GravatarID: String(""), - URL: String("https://api.github.com/users/octocat"), - HTMLURL: String("https://github.com/octocat"), - FollowersURL: String("https://api.github.com/users/octocat/followers"), - FollowingURL: String("https://api.github.com/users/octocat/following{/other_user}"), - GistsURL: String("https://api.github.com/users/octocat/gists{/gist_id}"), - StarredURL: String("https://api.github.com/users/octocat/starred{/owner}{/repo}"), - SubscriptionsURL: String("https://api.github.com/users/octocat/subscriptions"), - OrganizationsURL: String("https://api.github.com/users/octocat/orgs"), - ReposURL: String("https://api.github.com/users/octocat/repos"), - EventsURL: String("https://api.github.com/users/octocat/events{/privacy}"), - ReceivedEventsURL: String("https://api.github.com/users/octocat/received_events"), - Type: String("User"), - SiteAdmin: Bool(false), + Login: Ptr("octocat"), + ID: Ptr(int64(1)), + NodeID: Ptr("MDQ6VXNlcjE="), + AvatarURL: Ptr("https://github.com/images/error/octocat_happy.gif"), + GravatarID: Ptr(""), + URL: Ptr("https://api.github.com/users/octocat"), + HTMLURL: Ptr("https://github.com/octocat"), + FollowersURL: Ptr("https://api.github.com/users/octocat/followers"), + FollowingURL: Ptr("https://api.github.com/users/octocat/following{/other_user}"), + GistsURL: Ptr("https://api.github.com/users/octocat/gists{/gist_id}"), + StarredURL: Ptr("https://api.github.com/users/octocat/starred{/owner}{/repo}"), + SubscriptionsURL: Ptr("https://api.github.com/users/octocat/subscriptions"), + OrganizationsURL: Ptr("https://api.github.com/users/octocat/orgs"), + ReposURL: Ptr("https://api.github.com/users/octocat/repos"), + EventsURL: Ptr("https://api.github.com/users/octocat/events{/privacy}"), + ReceivedEventsURL: Ptr("https://api.github.com/users/octocat/received_events"), + Type: Ptr("User"), + SiteAdmin: Ptr(false), }, AssigningTeam: &Team{ - ID: Int64(1), - NodeID: String("MDQ6VGVhbTE="), - URL: String("https://api.github.com/teams/1"), - HTMLURL: String("https://github.com/orgs/github/teams/justice-league"), - Name: String("Justice League"), - Slug: String("justice-league"), - Description: String("A great team."), - Privacy: String("closed"), - Permission: String("admin"), - MembersURL: String("https://api.github.com/teams/1/members{/member}"), - RepositoriesURL: String("https://api.github.com/teams/1/repos"), + ID: Ptr(int64(1)), + NodeID: Ptr("MDQ6VGVhbTE="), + URL: Ptr("https://api.github.com/teams/1"), + HTMLURL: Ptr("https://github.com/orgs/github/teams/justice-league"), + Name: Ptr("Justice League"), + Slug: Ptr("justice-league"), + Description: Ptr("A great team."), + Privacy: Ptr("closed"), + Permission: Ptr("admin"), + MembersURL: Ptr("https://api.github.com/teams/1/members{/member}"), + RepositoriesURL: Ptr("https://api.github.com/teams/1/repos"), Parent: nil, }, CreatedAt: &createdAt, UpdatedAt: &updatedAt, PendingCancellationDate: nil, LastActivityAt: &lastActivityAt, - LastActivityEditor: String("vscode/1.77.3/copilot/1.86.82"), + LastActivityEditor: Ptr("vscode/1.77.3/copilot/1.86.82"), } if !cmp.Equal(got, want) { @@ -1351,7 +1351,7 @@ func TestCopilotService_GetEnterpriseMetrics(t *testing.T) { { Name: "a-custom-model", IsCustomModel: true, - CustomModelTrainingDate: String("2024-02-01"), + CustomModelTrainingDate: Ptr("2024-02-01"), Languages: []*CopilotIDECodeCompletionsModelLanguage{ { Name: "typescript", @@ -1394,7 +1394,7 @@ func TestCopilotService_GetEnterpriseMetrics(t *testing.T) { { Name: "a-custom-model", IsCustomModel: true, - CustomModelTrainingDate: String("2024-02-01"), + CustomModelTrainingDate: Ptr("2024-02-01"), TotalEngagedUsers: 1, TotalChats: 10, TotalChatInsertionEvents: 11, @@ -1439,7 +1439,7 @@ func TestCopilotService_GetEnterpriseMetrics(t *testing.T) { { Name: "a-custom-model", IsCustomModel: true, - CustomModelTrainingDate: String("2024-02-01"), + CustomModelTrainingDate: Ptr("2024-02-01"), TotalPRSummariesCreated: 10, TotalEngagedUsers: 4, }, @@ -1694,7 +1694,7 @@ func TestCopilotService_GetEnterpriseTeamMetrics(t *testing.T) { { Name: "a-custom-model", IsCustomModel: true, - CustomModelTrainingDate: String("2024-02-01"), + CustomModelTrainingDate: Ptr("2024-02-01"), Languages: []*CopilotIDECodeCompletionsModelLanguage{ { Name: "typescript", @@ -1737,7 +1737,7 @@ func TestCopilotService_GetEnterpriseTeamMetrics(t *testing.T) { { Name: "a-custom-model", IsCustomModel: true, - CustomModelTrainingDate: String("2024-02-01"), + CustomModelTrainingDate: Ptr("2024-02-01"), TotalEngagedUsers: 1, TotalChats: 10, TotalChatInsertionEvents: 11, @@ -1782,7 +1782,7 @@ func TestCopilotService_GetEnterpriseTeamMetrics(t *testing.T) { { Name: "a-custom-model", IsCustomModel: true, - CustomModelTrainingDate: String("2024-02-01"), + CustomModelTrainingDate: Ptr("2024-02-01"), TotalPRSummariesCreated: 10, TotalEngagedUsers: 4, }, @@ -2037,7 +2037,7 @@ func TestCopilotService_GetOrganizationMetrics(t *testing.T) { { Name: "a-custom-model", IsCustomModel: true, - CustomModelTrainingDate: String("2024-02-01"), + CustomModelTrainingDate: Ptr("2024-02-01"), Languages: []*CopilotIDECodeCompletionsModelLanguage{ { Name: "typescript", @@ -2080,7 +2080,7 @@ func TestCopilotService_GetOrganizationMetrics(t *testing.T) { { Name: "a-custom-model", IsCustomModel: true, - CustomModelTrainingDate: String("2024-02-01"), + CustomModelTrainingDate: Ptr("2024-02-01"), TotalEngagedUsers: 1, TotalChats: 10, TotalChatInsertionEvents: 11, @@ -2125,7 +2125,7 @@ func TestCopilotService_GetOrganizationMetrics(t *testing.T) { { Name: "a-custom-model", IsCustomModel: true, - CustomModelTrainingDate: String("2024-02-01"), + CustomModelTrainingDate: Ptr("2024-02-01"), TotalPRSummariesCreated: 10, TotalEngagedUsers: 4, }, @@ -2380,7 +2380,7 @@ func TestCopilotService_GetOrganizationTeamMetrics(t *testing.T) { { Name: "a-custom-model", IsCustomModel: true, - CustomModelTrainingDate: String("2024-02-01"), + CustomModelTrainingDate: Ptr("2024-02-01"), Languages: []*CopilotIDECodeCompletionsModelLanguage{ { Name: "typescript", @@ -2423,7 +2423,7 @@ func TestCopilotService_GetOrganizationTeamMetrics(t *testing.T) { { Name: "a-custom-model", IsCustomModel: true, - CustomModelTrainingDate: String("2024-02-01"), + CustomModelTrainingDate: Ptr("2024-02-01"), TotalEngagedUsers: 1, TotalChats: 10, TotalChatInsertionEvents: 11, @@ -2468,7 +2468,7 @@ func TestCopilotService_GetOrganizationTeamMetrics(t *testing.T) { { Name: "a-custom-model", IsCustomModel: true, - CustomModelTrainingDate: String("2024-02-01"), + CustomModelTrainingDate: Ptr("2024-02-01"), TotalPRSummariesCreated: 10, TotalEngagedUsers: 4, }, diff --git a/github/dependabot_alerts_test.go b/github/dependabot_alerts_test.go index e5c31875a77..3908ab29459 100644 --- a/github/dependabot_alerts_test.go +++ b/github/dependabot_alerts_test.go @@ -24,7 +24,7 @@ func TestDependabotService_ListRepoAlerts(t *testing.T) { fmt.Fprint(w, `[{"number":1,"state":"open"},{"number":42,"state":"fixed"}]`) }) - opts := &ListAlertsOptions{State: String("open")} + opts := &ListAlertsOptions{State: Ptr("open")} ctx := context.Background() alerts, _, err := client.Dependabot.ListRepoAlerts(ctx, "o", "r", opts) if err != nil { @@ -32,8 +32,8 @@ func TestDependabotService_ListRepoAlerts(t *testing.T) { } want := []*DependabotAlert{ - {Number: Int(1), State: String("open")}, - {Number: Int(42), State: String("fixed")}, + {Number: Ptr(1), State: Ptr("open")}, + {Number: Ptr(42), State: Ptr("fixed")}, } if !cmp.Equal(alerts, want) { t.Errorf("Dependabot.ListRepoAlerts returned %+v, want %+v", alerts, want) @@ -70,8 +70,8 @@ func TestDependabotService_GetRepoAlert(t *testing.T) { } want := &DependabotAlert{ - Number: Int(42), - State: String("fixed"), + Number: Ptr(42), + State: Ptr("fixed"), } if !cmp.Equal(alert, want) { t.Errorf("Dependabot.GetRepoAlert returned %+v, want %+v", alert, want) @@ -102,7 +102,7 @@ func TestDependabotService_ListOrgAlerts(t *testing.T) { fmt.Fprint(w, `[{"number":1,"state":"open"},{"number":42,"state":"fixed"}]`) }) - opts := &ListAlertsOptions{State: String("open")} + opts := &ListAlertsOptions{State: Ptr("open")} ctx := context.Background() alerts, _, err := client.Dependabot.ListOrgAlerts(ctx, "o", opts) if err != nil { @@ -110,8 +110,8 @@ func TestDependabotService_ListOrgAlerts(t *testing.T) { } want := []*DependabotAlert{ - {Number: Int(1), State: String("open")}, - {Number: Int(42), State: String("fixed")}, + {Number: Ptr(1), State: Ptr("open")}, + {Number: Ptr(42), State: Ptr("fixed")}, } if !cmp.Equal(alerts, want) { t.Errorf("Dependabot.ListOrgAlerts returned %+v, want %+v", alerts, want) @@ -136,9 +136,9 @@ func TestDependabotService_UpdateAlert(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - state := String("dismissed") - dismissedReason := String("no_bandwidth") - dismissedComment := String("no time to fix this") + state := Ptr("dismissed") + dismissedReason := Ptr("no_bandwidth") + dismissedComment := Ptr("no time to fix this") alertState := &DependabotAlertState{State: *state, DismissedReason: dismissedReason, DismissedComment: dismissedComment} @@ -154,10 +154,10 @@ func TestDependabotService_UpdateAlert(t *testing.T) { } want := &DependabotAlert{ - Number: Int(42), - State: String("dismissed"), - DismissedReason: String("no_bandwidth"), - DismissedComment: String("no time to fix this"), + Number: Ptr(42), + State: Ptr("dismissed"), + DismissedReason: Ptr("no_bandwidth"), + DismissedComment: Ptr("no time to fix this"), } if !cmp.Equal(alert, want) { t.Errorf("Dependabot.UpdateAlert returned %+v, want %+v", alert, want) diff --git a/github/dependabot_secrets_test.go b/github/dependabot_secrets_test.go index 7b7ea5f85a1..21f72ca22a7 100644 --- a/github/dependabot_secrets_test.go +++ b/github/dependabot_secrets_test.go @@ -30,7 +30,7 @@ func TestDependabotService_GetRepoPublicKey(t *testing.T) { t.Errorf("Dependabot.GetRepoPublicKey returned error: %v", err) } - want := &PublicKey{KeyID: String("1234"), Key: String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234")} + want := &PublicKey{KeyID: Ptr("1234"), Key: Ptr("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234")} if !cmp.Equal(key, want) { t.Errorf("Dependabot.GetRepoPublicKey returned %+v, want %+v", key, want) } @@ -65,7 +65,7 @@ func TestDependabotService_GetRepoPublicKeyNumeric(t *testing.T) { t.Errorf("Dependabot.GetRepoPublicKey returned error: %v", err) } - want := &PublicKey{KeyID: String("1234"), Key: String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234")} + want := &PublicKey{KeyID: Ptr("1234"), Key: Ptr("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234")} if !cmp.Equal(key, want) { t.Errorf("Dependabot.GetRepoPublicKey returned %+v, want %+v", key, want) } @@ -240,7 +240,7 @@ func TestDependabotService_GetOrgPublicKey(t *testing.T) { t.Errorf("Dependabot.GetOrgPublicKey returned error: %v", err) } - want := &PublicKey{KeyID: String("012345678"), Key: String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234")} + want := &PublicKey{KeyID: Ptr("012345678"), Key: Ptr("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234")} if !cmp.Equal(key, want) { t.Errorf("Dependabot.GetOrgPublicKey returned %+v, want %+v", key, want) } @@ -397,9 +397,9 @@ func TestDependabotService_ListSelectedReposForOrgSecret(t *testing.T) { } want := &SelectedReposList{ - TotalCount: Int(1), + TotalCount: Ptr(1), Repositories: []*Repository{ - {ID: Int64(1)}, + {ID: Ptr(int64(1))}, }, } if !cmp.Equal(repos, want) { @@ -456,7 +456,7 @@ func TestDependabotService_AddSelectedRepoToOrgSecret(t *testing.T) { testMethod(t, r, "PUT") }) - repo := &Repository{ID: Int64(1234)} + repo := &Repository{ID: Ptr(int64(1234))} ctx := context.Background() _, err := client.Dependabot.AddSelectedRepoToOrgSecret(ctx, "o", "NAME", repo) if err != nil { @@ -482,7 +482,7 @@ func TestDependabotService_RemoveSelectedRepoFromOrgSecret(t *testing.T) { testMethod(t, r, "DELETE") }) - repo := &Repository{ID: Int64(1234)} + repo := &Repository{ID: Ptr(int64(1234))} ctx := context.Background() _, err := client.Dependabot.RemoveSelectedRepoFromOrgSecret(ctx, "o", "NAME", repo) if err != nil { diff --git a/github/dependency_graph_snapshots_test.go b/github/dependency_graph_snapshots_test.go index 604edeca91a..40d73a6733f 100644 --- a/github/dependency_graph_snapshots_test.go +++ b/github/dependency_graph_snapshots_test.go @@ -28,40 +28,40 @@ func TestDependencyGraphService_CreateSnapshot(t *testing.T) { ctx := context.Background() snapshot := &DependencyGraphSnapshot{ Version: 0, - Sha: String("ce587453ced02b1526dfb4cb910479d431683101"), - Ref: String("refs/heads/main"), + Sha: Ptr("ce587453ced02b1526dfb4cb910479d431683101"), + Ref: Ptr("refs/heads/main"), Job: &DependencyGraphSnapshotJob{ - Correlator: String("yourworkflowname_youractionname"), - ID: String("yourrunid"), - HTMLURL: String("https://example.com"), + Correlator: Ptr("yourworkflowname_youractionname"), + ID: Ptr("yourrunid"), + HTMLURL: Ptr("https://example.com"), }, Detector: &DependencyGraphSnapshotDetector{ - Name: String("octo-detector"), - Version: String("0.0.1"), - URL: String("https://github.com/octo-org/octo-repo"), + Name: Ptr("octo-detector"), + Version: Ptr("0.0.1"), + URL: Ptr("https://github.com/octo-org/octo-repo"), }, Scanned: &Timestamp{time.Date(2022, time.June, 14, 20, 25, 00, 0, time.UTC)}, Manifests: map[string]*DependencyGraphSnapshotManifest{ "package-lock.json": { - Name: String("package-lock.json"), - File: &DependencyGraphSnapshotManifestFile{SourceLocation: String("src/package-lock.json")}, + Name: Ptr("package-lock.json"), + File: &DependencyGraphSnapshotManifestFile{SourceLocation: Ptr("src/package-lock.json")}, Resolved: map[string]*DependencyGraphSnapshotResolvedDependency{ "@actions/core": { - PackageURL: String("pkg:/npm/%40actions/core@1.1.9"), - Relationship: String("direct"), - Scope: String("runtime"), + PackageURL: Ptr("pkg:/npm/%40actions/core@1.1.9"), + Relationship: Ptr("direct"), + Scope: Ptr("runtime"), Dependencies: []string{"@actions/http-client"}, }, "@actions/http-client": { - PackageURL: String("pkg:/npm/%40actions/http-client@1.0.7"), - Relationship: String("indirect"), - Scope: String("runtime"), + PackageURL: Ptr("pkg:/npm/%40actions/http-client@1.0.7"), + Relationship: Ptr("indirect"), + Scope: Ptr("runtime"), Dependencies: []string{"tunnel"}, }, "tunnel": { - PackageURL: String("pkg:/npm/tunnel@0.0.6"), - Relationship: String("indirect"), - Scope: String("runtime"), + PackageURL: Ptr("pkg:/npm/tunnel@0.0.6"), + Relationship: Ptr("indirect"), + Scope: Ptr("runtime"), }, }, }, @@ -76,8 +76,8 @@ func TestDependencyGraphService_CreateSnapshot(t *testing.T) { want := &DependencyGraphSnapshotCreationData{ ID: 12345, CreatedAt: &Timestamp{time.Date(2022, time.June, 14, 20, 25, 01, 0, time.UTC)}, - Message: String("Dependency results for the repo have been successfully updated."), - Result: String("SUCCESS"), + Message: Ptr("Dependency results for the repo have been successfully updated."), + Result: Ptr("SUCCESS"), } if !cmp.Equal(snapshotCreationData, want) { t.Errorf("DependencyGraph.CreateSnapshot returned %+v, want %+v", snapshotCreationData, want) diff --git a/github/dependency_graph_test.go b/github/dependency_graph_test.go index 0bef36df28d..8b4f29e37d6 100644 --- a/github/dependency_graph_test.go +++ b/github/dependency_graph_test.go @@ -49,11 +49,11 @@ func TestDependencyGraphService_GetSBOM(t *testing.T) { CreationInfo: &CreationInfo{ Created: &Timestamp{testTime}, }, - Name: String("owner/repo"), + Name: Ptr("owner/repo"), Packages: []*RepoDependencies{ { - Name: String("rubygems:rails"), - VersionInfo: String("1.0.0"), + Name: Ptr("rubygems:rails"), + VersionInfo: Ptr("1.0.0"), }, }, }, diff --git a/github/doc.go b/github/doc.go index bee1a616fde..a97a85703ac 100644 --- a/github/doc.go +++ b/github/doc.go @@ -156,8 +156,8 @@ bool, and int values. For example: // create a new private repository named "foo" repo := &github.Repository{ - Name: github.String("foo"), - Private: github.Bool(true), + Name: github.Ptr("foo"), + Private: github.Ptr(true), } client.Repositories.Create(ctx, "", repo) diff --git a/github/enterprise_actions_runner_groups_test.go b/github/enterprise_actions_runner_groups_test.go index 7612ba55909..e4d2bfffc2f 100644 --- a/github/enterprise_actions_runner_groups_test.go +++ b/github/enterprise_actions_runner_groups_test.go @@ -32,11 +32,11 @@ func TestEnterpriseService_ListRunnerGroups(t *testing.T) { } want := &EnterpriseRunnerGroups{ - TotalCount: Int(3), + TotalCount: Ptr(3), RunnerGroups: []*EnterpriseRunnerGroup{ - {ID: Int64(1), Name: String("Default"), Visibility: String("all"), Default: Bool(true), RunnersURL: String("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/1/runners"), Inherited: Bool(false), AllowsPublicRepositories: Bool(true), RestrictedToWorkflows: Bool(true), SelectedWorkflows: []string{"a", "b"}}, - {ID: Int64(2), Name: String("octo-runner-group"), Visibility: String("selected"), Default: Bool(false), SelectedOrganizationsURL: String("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/organizations"), RunnersURL: String("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/runners"), Inherited: Bool(true), AllowsPublicRepositories: Bool(true), RestrictedToWorkflows: Bool(false), SelectedWorkflows: []string{}}, - {ID: Int64(3), Name: String("expensive-hardware"), Visibility: String("private"), Default: Bool(false), RunnersURL: String("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/3/runners"), Inherited: Bool(false), AllowsPublicRepositories: Bool(true), RestrictedToWorkflows: Bool(false), SelectedWorkflows: []string{}}, + {ID: Ptr(int64(1)), Name: Ptr("Default"), Visibility: Ptr("all"), Default: Ptr(true), RunnersURL: Ptr("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/1/runners"), Inherited: Ptr(false), AllowsPublicRepositories: Ptr(true), RestrictedToWorkflows: Ptr(true), SelectedWorkflows: []string{"a", "b"}}, + {ID: Ptr(int64(2)), Name: Ptr("octo-runner-group"), Visibility: Ptr("selected"), Default: Ptr(false), SelectedOrganizationsURL: Ptr("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/organizations"), RunnersURL: Ptr("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/runners"), Inherited: Ptr(true), AllowsPublicRepositories: Ptr(true), RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}}, + {ID: Ptr(int64(3)), Name: Ptr("expensive-hardware"), Visibility: Ptr("private"), Default: Ptr(false), RunnersURL: Ptr("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/3/runners"), Inherited: Ptr(false), AllowsPublicRepositories: Ptr(true), RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}}, }, } if !cmp.Equal(groups, want) { @@ -76,11 +76,11 @@ func TestEnterpriseService_ListRunnerGroupsVisibleToOrganization(t *testing.T) { } want := &EnterpriseRunnerGroups{ - TotalCount: Int(3), + TotalCount: Ptr(3), RunnerGroups: []*EnterpriseRunnerGroup{ - {ID: Int64(1), Name: String("Default"), Visibility: String("all"), Default: Bool(true), RunnersURL: String("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/1/runners"), Inherited: Bool(false), AllowsPublicRepositories: Bool(true), RestrictedToWorkflows: Bool(false), SelectedWorkflows: []string{}}, - {ID: Int64(2), Name: String("octo-runner-group"), Visibility: String("selected"), Default: Bool(false), SelectedOrganizationsURL: String("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/organizations"), RunnersURL: String("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/runners"), Inherited: Bool(true), AllowsPublicRepositories: Bool(true), RestrictedToWorkflows: Bool(false), SelectedWorkflows: []string{}}, - {ID: Int64(3), Name: String("expensive-hardware"), Visibility: String("private"), Default: Bool(false), RunnersURL: String("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/3/runners"), Inherited: Bool(false), AllowsPublicRepositories: Bool(true), RestrictedToWorkflows: Bool(false), SelectedWorkflows: []string{}}, + {ID: Ptr(int64(1)), Name: Ptr("Default"), Visibility: Ptr("all"), Default: Ptr(true), RunnersURL: Ptr("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/1/runners"), Inherited: Ptr(false), AllowsPublicRepositories: Ptr(true), RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}}, + {ID: Ptr(int64(2)), Name: Ptr("octo-runner-group"), Visibility: Ptr("selected"), Default: Ptr(false), SelectedOrganizationsURL: Ptr("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/organizations"), RunnersURL: Ptr("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/runners"), Inherited: Ptr(true), AllowsPublicRepositories: Ptr(true), RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}}, + {ID: Ptr(int64(3)), Name: Ptr("expensive-hardware"), Visibility: Ptr("private"), Default: Ptr(false), RunnersURL: Ptr("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/3/runners"), Inherited: Ptr(false), AllowsPublicRepositories: Ptr(true), RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}}, }, } if !cmp.Equal(groups, want) { @@ -118,15 +118,15 @@ func TestEnterpriseService_GetRunnerGroup(t *testing.T) { } want := &EnterpriseRunnerGroup{ - ID: Int64(2), - Name: String("octo-runner-group"), - Visibility: String("selected"), - Default: Bool(false), - SelectedOrganizationsURL: String("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/organizations"), - RunnersURL: String("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/runners"), - Inherited: Bool(false), - AllowsPublicRepositories: Bool(true), - RestrictedToWorkflows: Bool(false), + ID: Ptr(int64(2)), + Name: Ptr("octo-runner-group"), + Visibility: Ptr("selected"), + Default: Ptr(false), + SelectedOrganizationsURL: Ptr("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/organizations"), + RunnersURL: Ptr("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/runners"), + Inherited: Ptr(false), + AllowsPublicRepositories: Ptr(true), + RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}, } @@ -185,10 +185,10 @@ func TestEnterpriseService_CreateRunnerGroup(t *testing.T) { ctx := context.Background() req := CreateEnterpriseRunnerGroupRequest{ - Name: String("octo-runner-group"), - Visibility: String("selected"), - AllowsPublicRepositories: Bool(true), - RestrictedToWorkflows: Bool(false), + Name: Ptr("octo-runner-group"), + Visibility: Ptr("selected"), + AllowsPublicRepositories: Ptr(true), + RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}, } group, _, err := client.Enterprise.CreateEnterpriseRunnerGroup(ctx, "o", req) @@ -197,15 +197,15 @@ func TestEnterpriseService_CreateRunnerGroup(t *testing.T) { } want := &EnterpriseRunnerGroup{ - ID: Int64(2), - Name: String("octo-runner-group"), - Visibility: String("selected"), - Default: Bool(false), - SelectedOrganizationsURL: String("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/organizations"), - RunnersURL: String("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/runners"), - Inherited: Bool(false), - AllowsPublicRepositories: Bool(true), - RestrictedToWorkflows: Bool(false), + ID: Ptr(int64(2)), + Name: Ptr("octo-runner-group"), + Visibility: Ptr("selected"), + Default: Ptr(false), + SelectedOrganizationsURL: Ptr("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/organizations"), + RunnersURL: Ptr("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/runners"), + Inherited: Ptr(false), + AllowsPublicRepositories: Ptr(true), + RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}, } @@ -239,10 +239,10 @@ func TestEnterpriseService_UpdateRunnerGroup(t *testing.T) { ctx := context.Background() req := UpdateEnterpriseRunnerGroupRequest{ - Name: String("octo-runner-group"), - Visibility: String("selected"), - AllowsPublicRepositories: Bool(true), - RestrictedToWorkflows: Bool(false), + Name: Ptr("octo-runner-group"), + Visibility: Ptr("selected"), + AllowsPublicRepositories: Ptr(true), + RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}, } group, _, err := client.Enterprise.UpdateEnterpriseRunnerGroup(ctx, "o", 2, req) @@ -251,15 +251,15 @@ func TestEnterpriseService_UpdateRunnerGroup(t *testing.T) { } want := &EnterpriseRunnerGroup{ - ID: Int64(2), - Name: String("octo-runner-group"), - Visibility: String("selected"), - Default: Bool(false), - SelectedOrganizationsURL: String("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/organizations"), - RunnersURL: String("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/runners"), - Inherited: Bool(false), - AllowsPublicRepositories: Bool(true), - RestrictedToWorkflows: Bool(false), + ID: Ptr(int64(2)), + Name: Ptr("octo-runner-group"), + Visibility: Ptr("selected"), + Default: Ptr(false), + SelectedOrganizationsURL: Ptr("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/organizations"), + RunnersURL: Ptr("https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/runners"), + Inherited: Ptr(false), + AllowsPublicRepositories: Ptr(true), + RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}, } @@ -300,9 +300,9 @@ func TestEnterpriseService_ListOrganizationAccessRunnerGroup(t *testing.T) { } want := &ListOrganizations{ - TotalCount: Int(1), + TotalCount: Ptr(1), Organizations: []*Organization{ - {ID: Int64(43), NodeID: String("MDEwOlJlcG9zaXRvcnkxMjk2MjY5"), Name: String("Hello-World"), Login: String("octocat")}, + {ID: Ptr(int64(43)), NodeID: Ptr("MDEwOlJlcG9zaXRvcnkxMjk2MjY5"), Name: Ptr("Hello-World"), Login: Ptr("octocat")}, }, } if !cmp.Equal(groups, want) { @@ -426,8 +426,8 @@ func TestEnterpriseService_ListEnterpriseRunnerGroupRunners(t *testing.T) { want := &Runners{ TotalCount: 2, Runners: []*Runner{ - {ID: Int64(23), Name: String("MBP"), OS: String("macos"), Status: String("online")}, - {ID: Int64(24), Name: String("iMac"), OS: String("macos"), Status: String("offline")}, + {ID: Ptr(int64(23)), Name: Ptr("MBP"), OS: Ptr("macos"), Status: Ptr("online")}, + {ID: Ptr(int64(24)), Name: Ptr("iMac"), OS: Ptr("macos"), Status: Ptr("offline")}, }, } if !cmp.Equal(runners, want) { @@ -536,15 +536,15 @@ func TestEnterpriseRunnerGroup_Marshal(t *testing.T) { testJSONMarshal(t, &EnterpriseRunnerGroup{}, "{}") u := &EnterpriseRunnerGroup{ - ID: Int64(1), - Name: String("n"), - Visibility: String("v"), - Default: Bool(true), - SelectedOrganizationsURL: String("s"), - RunnersURL: String("r"), - Inherited: Bool(true), - AllowsPublicRepositories: Bool(true), - RestrictedToWorkflows: Bool(false), + ID: Ptr(int64(1)), + Name: Ptr("n"), + Visibility: Ptr("v"), + Default: Ptr(true), + SelectedOrganizationsURL: Ptr("s"), + RunnersURL: Ptr("r"), + Inherited: Ptr(true), + AllowsPublicRepositories: Ptr(true), + RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}, } @@ -569,18 +569,18 @@ func TestEnterpriseRunnerGroups_Marshal(t *testing.T) { testJSONMarshal(t, &EnterpriseRunnerGroups{}, "{}") u := &EnterpriseRunnerGroups{ - TotalCount: Int(1), + TotalCount: Ptr(1), RunnerGroups: []*EnterpriseRunnerGroup{ { - ID: Int64(1), - Name: String("n"), - Visibility: String("v"), - Default: Bool(true), - SelectedOrganizationsURL: String("s"), - RunnersURL: String("r"), - Inherited: Bool(true), - AllowsPublicRepositories: Bool(true), - RestrictedToWorkflows: Bool(false), + ID: Ptr(int64(1)), + Name: Ptr("n"), + Visibility: Ptr("v"), + Default: Ptr(true), + SelectedOrganizationsURL: Ptr("s"), + RunnersURL: Ptr("r"), + Inherited: Ptr(true), + AllowsPublicRepositories: Ptr(true), + RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}, }, }, @@ -610,12 +610,12 @@ func TestCreateEnterpriseRunnerGroupRequest_Marshal(t *testing.T) { testJSONMarshal(t, &CreateEnterpriseRunnerGroupRequest{}, "{}") u := &CreateEnterpriseRunnerGroupRequest{ - Name: String("n"), - Visibility: String("v"), + Name: Ptr("n"), + Visibility: Ptr("v"), SelectedOrganizationIDs: []int64{1}, Runners: []int64{1}, - AllowsPublicRepositories: Bool(true), - RestrictedToWorkflows: Bool(true), + AllowsPublicRepositories: Ptr(true), + RestrictedToWorkflows: Ptr(true), SelectedWorkflows: []string{"a", "b"}, } @@ -637,10 +637,10 @@ func TestUpdateEnterpriseRunnerGroupRequest_Marshal(t *testing.T) { testJSONMarshal(t, &UpdateEnterpriseRunnerGroupRequest{}, "{}") u := &UpdateEnterpriseRunnerGroupRequest{ - Name: String("n"), - Visibility: String("v"), - AllowsPublicRepositories: Bool(true), - RestrictedToWorkflows: Bool(false), + Name: Ptr("n"), + Visibility: Ptr("v"), + AllowsPublicRepositories: Ptr(true), + RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}, } diff --git a/github/enterprise_actions_runners_test.go b/github/enterprise_actions_runners_test.go index 114ece8745d..b3a5770b6ad 100644 --- a/github/enterprise_actions_runners_test.go +++ b/github/enterprise_actions_runners_test.go @@ -43,7 +43,7 @@ func TestEnterpriseService_GenerateEnterpriseJITConfig(t *testing.T) { t.Errorf("Enterprise.GenerateEnterpriseJITConfig returned error: %v", err) } - want := &JITRunnerConfig{EncodedJITConfig: String("foo")} + want := &JITRunnerConfig{EncodedJITConfig: Ptr("foo")} if !cmp.Equal(jitConfig, want) { t.Errorf("Enterprise.GenerateEnterpriseJITConfig returned %+v, want %+v", jitConfig, want) } @@ -78,7 +78,7 @@ func TestEnterpriseService_CreateRegistrationToken(t *testing.T) { t.Errorf("Enterprise.CreateRegistrationToken returned error: %v", err) } - want := &RegistrationToken{Token: String("LLBF3JGZDX3P5PMEXLND6TS6FCWO6"), + want := &RegistrationToken{Token: Ptr("LLBF3JGZDX3P5PMEXLND6TS6FCWO6"), ExpiresAt: &Timestamp{time.Date(2020, time.January, 22, 12, 13, 35, 123000000, time.UTC)}} if !cmp.Equal(token, want) { @@ -111,7 +111,7 @@ func TestEnterpriseService_ListRunners(t *testing.T) { }) opts := &ListRunnersOptions{ - Name: String("MBP"), + Name: Ptr("MBP"), ListOptions: ListOptions{Page: 2, PerPage: 2}, } ctx := context.Background() @@ -123,7 +123,7 @@ func TestEnterpriseService_ListRunners(t *testing.T) { want := &Runners{ TotalCount: 1, Runners: []*Runner{ - {ID: Int64(23), Name: String("MBP"), OS: String("macos"), Status: String("online")}, + {ID: Ptr(int64(23)), Name: Ptr("MBP"), OS: Ptr("macos"), Status: Ptr("online")}, }, } if !cmp.Equal(runners, want) { @@ -161,10 +161,10 @@ func TestEnterpriseService_GetRunner(t *testing.T) { } want := &Runner{ - ID: Int64(23), - Name: String("MBP"), - OS: String("macos"), - Status: String("online"), + ID: Ptr(int64(23)), + Name: Ptr("MBP"), + OS: Ptr("macos"), + Status: Ptr("online"), } if !cmp.Equal(runner, want) { t.Errorf("Enterprise.GetRunner returned %+v, want %+v", runner, want) @@ -226,11 +226,11 @@ func TestEnterpriseService_ListRunnerApplicationDownloads(t *testing.T) { } want := []*RunnerApplicationDownload{ - {OS: String("osx"), Architecture: String("x64"), DownloadURL: String("https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-osx-x64-2.164.0.tar.gz"), Filename: String("actions-runner-osx-x64-2.164.0.tar.gz")}, - {OS: String("linux"), Architecture: String("x64"), DownloadURL: String("https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-x64-2.164.0.tar.gz"), Filename: String("actions-runner-linux-x64-2.164.0.tar.gz")}, - {OS: String("linux"), Architecture: String("arm"), DownloadURL: String("https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm-2.164.0.tar.gz"), Filename: String("actions-runner-linux-arm-2.164.0.tar.gz")}, - {OS: String("win"), Architecture: String("x64"), DownloadURL: String("https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-win-x64-2.164.0.zip"), Filename: String("actions-runner-win-x64-2.164.0.zip")}, - {OS: String("linux"), Architecture: String("arm64"), DownloadURL: String("https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm64-2.164.0.tar.gz"), Filename: String("actions-runner-linux-arm64-2.164.0.tar.gz")}, + {OS: Ptr("osx"), Architecture: Ptr("x64"), DownloadURL: Ptr("https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-osx-x64-2.164.0.tar.gz"), Filename: Ptr("actions-runner-osx-x64-2.164.0.tar.gz")}, + {OS: Ptr("linux"), Architecture: Ptr("x64"), DownloadURL: Ptr("https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-x64-2.164.0.tar.gz"), Filename: Ptr("actions-runner-linux-x64-2.164.0.tar.gz")}, + {OS: Ptr("linux"), Architecture: Ptr("arm"), DownloadURL: Ptr("https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm-2.164.0.tar.gz"), Filename: Ptr("actions-runner-linux-arm-2.164.0.tar.gz")}, + {OS: Ptr("win"), Architecture: Ptr("x64"), DownloadURL: Ptr("https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-win-x64-2.164.0.zip"), Filename: Ptr("actions-runner-win-x64-2.164.0.zip")}, + {OS: Ptr("linux"), Architecture: Ptr("arm64"), DownloadURL: Ptr("https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm64-2.164.0.tar.gz"), Filename: Ptr("actions-runner-linux-arm64-2.164.0.tar.gz")}, } if !cmp.Equal(downloads, want) { t.Errorf("Enterprise.ListRunnerApplicationDownloads returned %+v, want %+v", downloads, want) diff --git a/github/enterprise_audit_log_test.go b/github/enterprise_audit_log_test.go index 77a4dc162cc..08ecd23c996 100644 --- a/github/enterprise_audit_log_test.go +++ b/github/enterprise_audit_log_test.go @@ -43,9 +43,9 @@ func TestEnterpriseService_GetAuditLog(t *testing.T) { ]`) }) getOpts := GetAuditLogOptions{ - Include: String("all"), - Phrase: String("action:workflows"), - Order: String("asc"), + Include: Ptr("all"), + Phrase: Ptr("action:workflows"), + Order: Ptr("asc"), } ctx := context.Background() auditEntries, _, err := client.Enterprise.GetAuditLog(ctx, "e", &getOpts) @@ -56,11 +56,11 @@ func TestEnterpriseService_GetAuditLog(t *testing.T) { want := []*AuditEntry{ { Timestamp: &Timestamp{timestamp}, - DocumentID: String("beeZYapIUe-wKg5-beadb33"), - Action: String("workflows.completed_workflow_run"), - Actor: String("testactor"), + DocumentID: Ptr("beeZYapIUe-wKg5-beadb33"), + Action: Ptr("workflows.completed_workflow_run"), + Actor: Ptr("testactor"), CreatedAt: &Timestamp{timestamp}, - Org: String("o"), + Org: Ptr("o"), AdditionalFields: map[string]interface{}{ "completed_at": "2021-03-07T00:35:08.000Z", "conclusion": "success", diff --git a/github/enterprise_code_security_and_analysis_test.go b/github/enterprise_code_security_and_analysis_test.go index 2cf5c310323..6080299b723 100644 --- a/github/enterprise_code_security_and_analysis_test.go +++ b/github/enterprise_code_security_and_analysis_test.go @@ -41,11 +41,11 @@ func TestEnterpriseService_GetCodeSecurityAndAnalysis(t *testing.T) { t.Errorf("Enterprise.%v returned error: %v", methodName, err) } want := &EnterpriseSecurityAnalysisSettings{ - AdvancedSecurityEnabledForNewRepositories: Bool(true), - SecretScanningEnabledForNewRepositories: Bool(true), - SecretScanningPushProtectionEnabledForNewRepositories: Bool(true), - SecretScanningPushProtectionCustomLink: String("https://github.com/test-org/test-repo/blob/main/README.md"), - SecretScanningValidityChecksEnabled: Bool(true), + AdvancedSecurityEnabledForNewRepositories: Ptr(true), + SecretScanningEnabledForNewRepositories: Ptr(true), + SecretScanningPushProtectionEnabledForNewRepositories: Ptr(true), + SecretScanningPushProtectionCustomLink: Ptr("https://github.com/test-org/test-repo/blob/main/README.md"), + SecretScanningValidityChecksEnabled: Ptr(true), } if !cmp.Equal(settings, want) { @@ -71,11 +71,11 @@ func TestEnterpriseService_UpdateCodeSecurityAndAnalysis(t *testing.T) { client, mux, _ := setup(t) input := &EnterpriseSecurityAnalysisSettings{ - AdvancedSecurityEnabledForNewRepositories: Bool(true), - SecretScanningEnabledForNewRepositories: Bool(true), - SecretScanningPushProtectionEnabledForNewRepositories: Bool(true), - SecretScanningPushProtectionCustomLink: String("https://github.com/test-org/test-repo/blob/main/README.md"), - SecretScanningValidityChecksEnabled: Bool(true), + AdvancedSecurityEnabledForNewRepositories: Ptr(true), + SecretScanningEnabledForNewRepositories: Ptr(true), + SecretScanningPushProtectionEnabledForNewRepositories: Ptr(true), + SecretScanningPushProtectionCustomLink: Ptr("https://github.com/test-org/test-repo/blob/main/README.md"), + SecretScanningValidityChecksEnabled: Ptr(true), } mux.HandleFunc("/enterprises/e/code_security_and_analysis", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/event_test.go b/github/event_test.go index 7d5ad54e514..bc37e12f563 100644 --- a/github/event_test.go +++ b/github/event_test.go @@ -55,47 +55,47 @@ func TestEvent_Marshal(t *testing.T) { jsonMsg, _ := json.Marshal(&l) u := &Event{ - Type: String("t"), - Public: Bool(false), + Type: Ptr("t"), + Public: Ptr(false), RawPayload: (*json.RawMessage)(&jsonMsg), Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Actor: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Org: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, CreatedAt: &Timestamp{referenceTime}, - ID: String("id"), + ID: Ptr("id"), } want := `{ diff --git a/github/event_types_test.go b/github/event_types_test.go index 2288c04c86a..fcf852336c6 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -16,7 +16,7 @@ func TestEditChange_Marshal_TitleChange(t *testing.T) { u := &EditChange{ Title: &EditTitle{ - From: String("TitleFrom"), + From: Ptr("TitleFrom"), }, Body: nil, Base: nil, @@ -38,7 +38,7 @@ func TestEditChange_Marshal_BodyChange(t *testing.T) { u := &EditChange{ Title: nil, Body: &EditBody{ - From: String("BodyFrom"), + From: Ptr("BodyFrom"), }, Base: nil, } @@ -58,10 +58,10 @@ func TestEditChange_Marshal_BaseChange(t *testing.T) { base := EditBase{ Ref: &EditRef{ - From: String("BaseRefFrom"), + From: Ptr("BaseRefFrom"), }, SHA: &EditSHA{ - From: String("BaseSHAFrom"), + From: Ptr("BaseSHAFrom"), }, } @@ -92,7 +92,7 @@ func TestEditChange_Marshal_Repo(t *testing.T) { u := &EditChange{ Repo: &EditRepo{ Name: &RepoName{ - From: String("old-repo-name"), + From: Ptr("old-repo-name"), }, }, Topics: &EditTopics{ @@ -125,13 +125,13 @@ func TestEditChange_Marshal_TransferFromUser(t *testing.T) { Owner: &EditOwner{ OwnerInfo: &OwnerInfo{ User: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, }, }, @@ -164,13 +164,13 @@ func TestEditChange_Marshal_TransferFromOrg(t *testing.T) { Owner: &EditOwner{ OwnerInfo: &OwnerInfo{ Org: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, }, }, @@ -200,7 +200,7 @@ func TestProjectChange_Marshal_NameChange(t *testing.T) { testJSONMarshal(t, &ProjectChange{}, "{}") u := &ProjectChange{ - Name: &ProjectName{From: String("NameFrom")}, + Name: &ProjectName{From: Ptr("NameFrom")}, Body: nil, } @@ -219,7 +219,7 @@ func TestProjectChange_Marshal_BodyChange(t *testing.T) { u := &ProjectChange{ Name: nil, - Body: &ProjectBody{From: String("BodyFrom")}, + Body: &ProjectBody{From: Ptr("BodyFrom")}, } want := `{ @@ -236,7 +236,7 @@ func TestProjectCardChange_Marshal_NoteChange(t *testing.T) { testJSONMarshal(t, &ProjectCardChange{}, "{}") u := &ProjectCardChange{ - Note: &ProjectCardNote{From: String("NoteFrom")}, + Note: &ProjectCardNote{From: Ptr("NoteFrom")}, } want := `{ @@ -253,7 +253,7 @@ func TestProjectColumnChange_Marshal_NameChange(t *testing.T) { testJSONMarshal(t, &ProjectColumnChange{}, "{}") u := &ProjectColumnChange{ - Name: &ProjectColumnName{From: String("NameFrom")}, + Name: &ProjectColumnName{From: Ptr("NameFrom")}, } want := `{ @@ -269,27 +269,27 @@ func TestBranchProtectionConfigurationEvent_Marshal(t *testing.T) { t.Parallel() testJSONMarshal(t, &BranchProtectionConfigurationEvent{}, "{}") u := &BranchProtectionConfigurationEvent{ - Action: String("enabled"), + Action: Ptr("enabled"), Repo: &Repository{ - ID: Int64(12345), - NodeID: String("MDEwOlJlcG9zaXRvcnkxMjM0NQ=="), - Name: String("example-repo"), + ID: Ptr(int64(12345)), + NodeID: Ptr("MDEwOlJlcG9zaXRvcnkxMjM0NQ=="), + Name: Ptr("example-repo"), }, Org: &Organization{ - Login: String("example-org"), - ID: Int64(67890), + Login: Ptr("example-org"), + ID: Ptr(int64(67890)), }, Sender: &User{ - Login: String("example-user"), - ID: Int64(1111), + Login: Ptr("example-user"), + ID: Ptr(int64(1111)), }, Installation: &Installation{ - ID: Int64(2222), + ID: Ptr(int64(2222)), }, Enterprise: &Enterprise{ - ID: Int(3333), - Slug: String("example-enterprise"), - Name: String("Example Enterprise"), + ID: Ptr(3333), + Slug: Ptr("example-enterprise"), + Name: Ptr("Example Enterprise"), }, } @@ -326,168 +326,168 @@ func TestTeamAddEvent_Marshal(t *testing.T) { u := &TeamAddEvent{ Team: &Team{ - ID: Int64(1), - NodeID: String("n"), - Name: String("n"), - Description: String("d"), - URL: String("u"), - Slug: String("s"), - Permission: String("p"), - Privacy: String("p"), - MembersCount: Int(1), - ReposCount: Int(1), - MembersURL: String("m"), - RepositoriesURL: String("r"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + Name: Ptr("n"), + Description: Ptr("d"), + URL: Ptr("u"), + Slug: Ptr("s"), + Permission: Ptr("p"), + Privacy: Ptr("p"), + MembersCount: Ptr(1), + ReposCount: Ptr(1), + MembersURL: Ptr("m"), + RepositoriesURL: Ptr("r"), Organization: &Organization{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - AvatarURL: String("a"), - HTMLURL: String("h"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + AvatarURL: Ptr("a"), + HTMLURL: Ptr("h"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), }, Parent: &Team{ - ID: Int64(1), - NodeID: String("n"), - Name: String("n"), - Description: String("d"), - URL: String("u"), - Slug: String("s"), - Permission: String("p"), - Privacy: String("p"), - MembersCount: Int(1), - ReposCount: Int(1), - }, - LDAPDN: String("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + Name: Ptr("n"), + Description: Ptr("d"), + URL: Ptr("u"), + Slug: Ptr("s"), + Permission: Ptr("p"), + Privacy: Ptr("p"), + MembersCount: Ptr(1), + ReposCount: Ptr(1), + }, + LDAPDN: Ptr("l"), }, Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Org: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -678,43 +678,43 @@ func TestStarEvent_Marshal(t *testing.T) { testJSONMarshal(t, &StarEvent{}, "{}") u := &StarEvent{ - Action: String("a"), + Action: Ptr("a"), StarredAt: &Timestamp{referenceTime}, Org: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, } @@ -767,190 +767,190 @@ func TestTeamEvent_Marshal(t *testing.T) { testJSONMarshal(t, &TeamEvent{}, "{}") u := &TeamEvent{ - Action: String("a"), + Action: Ptr("a"), Team: &Team{ - ID: Int64(1), - NodeID: String("n"), - Name: String("n"), - Description: String("d"), - URL: String("u"), - Slug: String("s"), - Permission: String("p"), - Privacy: String("p"), - MembersCount: Int(1), - ReposCount: Int(1), - MembersURL: String("m"), - RepositoriesURL: String("r"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + Name: Ptr("n"), + Description: Ptr("d"), + URL: Ptr("u"), + Slug: Ptr("s"), + Permission: Ptr("p"), + Privacy: Ptr("p"), + MembersCount: Ptr(1), + ReposCount: Ptr(1), + MembersURL: Ptr("m"), + RepositoriesURL: Ptr("r"), Organization: &Organization{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - AvatarURL: String("a"), - HTMLURL: String("h"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + AvatarURL: Ptr("a"), + HTMLURL: Ptr("h"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), }, Parent: &Team{ - ID: Int64(1), - NodeID: String("n"), - Name: String("n"), - Description: String("d"), - URL: String("u"), - Slug: String("s"), - Permission: String("p"), - Privacy: String("p"), - MembersCount: Int(1), - ReposCount: Int(1), - }, - LDAPDN: String("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + Name: Ptr("n"), + Description: Ptr("d"), + URL: Ptr("u"), + Slug: Ptr("s"), + Permission: Ptr("p"), + Privacy: Ptr("p"), + MembersCount: Ptr(1), + ReposCount: Ptr(1), + }, + LDAPDN: Ptr("l"), }, Changes: &TeamChange{ Description: &TeamDescription{ - From: String("from"), + From: Ptr("from"), }, Name: &TeamName{ - From: String("from"), + From: Ptr("from"), }, Privacy: &TeamPrivacy{ - From: String("from"), + From: Ptr("from"), }, Repository: &TeamRepository{ Permissions: &TeamPermissions{ From: &TeamPermissionsFrom{ - Admin: Bool(true), - Pull: Bool(true), - Push: Bool(true), + Admin: Ptr(true), + Pull: Ptr(true), + Push: Ptr(true), }, }, }, }, Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Org: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -1162,119 +1162,119 @@ func TestInstallationRepositoriesEvent_Marshal(t *testing.T) { testJSONMarshal(t, &InstallationRepositoriesEvent{}, "{}") u := &InstallationRepositoriesEvent{ - Action: String("a"), + Action: Ptr("a"), RepositoriesAdded: []*Repository{ { - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, }, RepositoriesRemoved: []*Repository{ { - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, }, - RepositorySelection: String("rs"), + RepositorySelection: Ptr("rs"), Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -1416,165 +1416,165 @@ func TestInstallationTargetEvent_Marshal(t *testing.T) { u := &InstallationTargetEvent{ Account: &User{ - Login: String("u"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("l"), - }, - Action: String("a"), + Login: Ptr("u"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("l"), + }, + Action: Ptr("a"), Changes: &InstallationChanges{ Login: &InstallationLoginChange{ - From: String("p"), + From: Ptr("p"), }, Slug: &InstallationSlugChange{ - From: String("j"), + From: Ptr("j"), }, }, Enterprise: &Enterprise{ - ID: Int(1), - Slug: String("s"), - Name: String("n"), - NodeID: String("nid"), - AvatarURL: String("au"), - Description: String("d"), - WebsiteURL: String("wu"), - HTMLURL: String("hu"), + ID: Ptr(1), + Slug: Ptr("s"), + Name: Ptr("n"), + NodeID: Ptr("nid"), + AvatarURL: Ptr("au"), + Description: Ptr("d"), + WebsiteURL: Ptr("wu"), + HTMLURL: Ptr("hu"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, SuspendedAt: &Timestamp{referenceTime}, }, Organization: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, Repository: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), - }, - TargetType: String("running"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), + }, + TargetType: Ptr("running"), } want := `{ @@ -1752,7 +1752,7 @@ func TestEditTitle_Marshal(t *testing.T) { testJSONMarshal(t, &EditTitle{}, "{}") u := &EditTitle{ - From: String("EditTitleFrom"), + From: Ptr("EditTitleFrom"), } want := `{ @@ -1767,7 +1767,7 @@ func TestEditBody_Marshal(t *testing.T) { testJSONMarshal(t, &EditBody{}, "{}") u := &EditBody{ - From: String("EditBodyFrom"), + From: Ptr("EditBodyFrom"), } want := `{ @@ -1783,10 +1783,10 @@ func TestEditBase_Marshal(t *testing.T) { u := &EditBase{ Ref: &EditRef{ - From: String("EditRefFrom"), + From: Ptr("EditRefFrom"), }, SHA: &EditSHA{ - From: String("EditSHAFrom"), + From: Ptr("EditSHAFrom"), }, } @@ -1807,7 +1807,7 @@ func TestEditRef_Marshal(t *testing.T) { testJSONMarshal(t, &EditRef{}, "{}") u := &EditRef{ - From: String("EditRefFrom"), + From: Ptr("EditRefFrom"), } want := `{ @@ -1822,7 +1822,7 @@ func TestEditSHA_Marshal(t *testing.T) { testJSONMarshal(t, &EditSHA{}, "{}") u := &EditSHA{ - From: String("EditSHAFrom"), + From: Ptr("EditSHAFrom"), } want := `{ @@ -1837,7 +1837,7 @@ func TestProjectName_Marshal(t *testing.T) { testJSONMarshal(t, &ProjectName{}, "{}") u := &ProjectName{ - From: String("ProjectNameFrom"), + From: Ptr("ProjectNameFrom"), } want := `{ @@ -1852,7 +1852,7 @@ func TestProjectBody_Marshal(t *testing.T) { testJSONMarshal(t, &ProjectBody{}, "{}") u := &ProjectBody{ - From: String("ProjectBodyFrom"), + From: Ptr("ProjectBodyFrom"), } want := `{ @@ -1867,7 +1867,7 @@ func TestProjectCardNote_Marshal(t *testing.T) { testJSONMarshal(t, &ProjectCardNote{}, "{}") u := &ProjectCardNote{ - From: String("ProjectCardNoteFrom"), + From: Ptr("ProjectCardNoteFrom"), } want := `{ @@ -1882,7 +1882,7 @@ func TestProjectColumnName_Marshal(t *testing.T) { testJSONMarshal(t, &ProjectColumnName{}, "{}") u := &ProjectColumnName{ - From: String("ProjectColumnNameFrom"), + From: Ptr("ProjectColumnNameFrom"), } want := `{ @@ -1897,7 +1897,7 @@ func TestTeamDescription_Marshal(t *testing.T) { testJSONMarshal(t, &TeamDescription{}, "{}") u := &TeamDescription{ - From: String("TeamDescriptionFrom"), + From: Ptr("TeamDescriptionFrom"), } want := `{ @@ -1912,7 +1912,7 @@ func TestTeamName_Marshal(t *testing.T) { testJSONMarshal(t, &TeamName{}, "{}") u := &TeamName{ - From: String("TeamNameFrom"), + From: Ptr("TeamNameFrom"), } want := `{ @@ -1927,7 +1927,7 @@ func TestTeamPrivacy_Marshal(t *testing.T) { testJSONMarshal(t, &TeamPrivacy{}, "{}") u := &TeamPrivacy{ - From: String("TeamPrivacyFrom"), + From: Ptr("TeamPrivacyFrom"), } want := `{ @@ -1944,9 +1944,9 @@ func TestTeamRepository_Marshal(t *testing.T) { u := &TeamRepository{ Permissions: &TeamPermissions{ From: &TeamPermissionsFrom{ - Admin: Bool(true), - Pull: Bool(true), - Push: Bool(true), + Admin: Ptr(true), + Pull: Ptr(true), + Push: Ptr(true), }, }, } @@ -1970,9 +1970,9 @@ func TestTeamPermissions_Marshal(t *testing.T) { u := &TeamPermissions{ From: &TeamPermissionsFrom{ - Admin: Bool(true), - Pull: Bool(true), - Push: Bool(true), + Admin: Ptr(true), + Pull: Ptr(true), + Push: Ptr(true), }, } @@ -1992,9 +1992,9 @@ func TestTeamPermissionsFrom_Marshal(t *testing.T) { testJSONMarshal(t, &TeamPermissionsFrom{}, "{}") u := &TeamPermissionsFrom{ - Admin: Bool(true), - Pull: Bool(true), - Push: Bool(true), + Admin: Ptr(true), + Pull: Ptr(true), + Push: Ptr(true), } want := `{ @@ -2011,22 +2011,22 @@ func TestRepositoryVulnerabilityAlert_Marshal(t *testing.T) { testJSONMarshal(t, &RepositoryVulnerabilityAlert{}, "{}") u := &RepositoryVulnerabilityAlert{ - ID: Int64(1), - AffectedRange: String("ar"), - AffectedPackageName: String("apn"), - ExternalReference: String("er"), - ExternalIdentifier: String("ei"), - FixedIn: String("fi"), + ID: Ptr(int64(1)), + AffectedRange: Ptr("ar"), + AffectedPackageName: Ptr("apn"), + ExternalReference: Ptr("er"), + ExternalIdentifier: Ptr("ei"), + FixedIn: Ptr("fi"), Dismisser: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), - }, - DismissReason: String("dr"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), + }, + DismissReason: Ptr("dr"), DismissedAt: &Timestamp{referenceTime}, } @@ -2058,12 +2058,12 @@ func TestPage_Marshal(t *testing.T) { testJSONMarshal(t, &Page{}, "{}") u := &Page{ - PageName: String("p"), - Title: String("t"), - Summary: String("s"), - Action: String("a"), - SHA: String("s"), - HTMLURL: String("h"), + PageName: Ptr("p"), + Title: Ptr("t"), + Summary: Ptr("s"), + Action: Ptr("a"), + SHA: Ptr("s"), + HTMLURL: Ptr("h"), } want := `{ @@ -2084,20 +2084,20 @@ func TestTeamChange_Marshal(t *testing.T) { u := &TeamChange{ Description: &TeamDescription{ - From: String("DescriptionFrom"), + From: Ptr("DescriptionFrom"), }, Name: &TeamName{ - From: String("NameFrom"), + From: Ptr("NameFrom"), }, Privacy: &TeamPrivacy{ - From: String("PrivacyFrom"), + From: Ptr("PrivacyFrom"), }, Repository: &TeamRepository{ Permissions: &TeamPermissions{ From: &TeamPermissionsFrom{ - Admin: Bool(false), - Pull: Bool(false), - Push: Bool(false), + Admin: Ptr(false), + Pull: Ptr(false), + Push: Ptr(false), }, }, }, @@ -2132,153 +2132,153 @@ func TestIssueCommentEvent_Marshal(t *testing.T) { testJSONMarshal(t, &IssueCommentEvent{}, "{}") u := &IssueCommentEvent{ - Action: String("a"), - Issue: &Issue{ID: Int64(1)}, - Comment: &IssueComment{ID: Int64(1)}, + Action: Ptr("a"), + Issue: &Issue{ID: Ptr(int64(1))}, + Comment: &IssueComment{ID: Ptr(int64(1))}, Changes: &EditChange{ Title: &EditTitle{ - From: String("TitleFrom"), + From: Ptr("TitleFrom"), }, Body: &EditBody{ - From: String("BodyFrom"), + From: Ptr("BodyFrom"), }, Base: &EditBase{ Ref: &EditRef{ - From: String("BaseRefFrom"), + From: Ptr("BaseRefFrom"), }, SHA: &EditSHA{ - From: String("BaseSHAFrom"), + From: Ptr("BaseSHAFrom"), }, }, }, Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, SuspendedAt: &Timestamp{referenceTime}, }, Organization: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, } @@ -2449,136 +2449,136 @@ func TestIssuesEvent_Marshal(t *testing.T) { testJSONMarshal(t, &IssuesEvent{}, "{}") u := &IssuesEvent{ - Action: String("a"), - Issue: &Issue{ID: Int64(1)}, + Action: Ptr("a"), + Issue: &Issue{ID: Ptr(int64(1))}, Assignee: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), - }, - Label: &Label{ID: Int64(1)}, + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), + }, + Label: &Label{ID: Ptr(int64(1))}, Changes: &EditChange{ Title: &EditTitle{ - From: String("TitleFrom"), + From: Ptr("TitleFrom"), }, Body: &EditBody{ - From: String("BodyFrom"), + From: Ptr("BodyFrom"), }, Base: &EditBase{ Ref: &EditRef{ - From: String("BaseRefFrom"), + From: Ptr("BaseRefFrom"), }, SHA: &EditSHA{ - From: String("BaseSHAFrom"), + From: Ptr("BaseSHAFrom"), }, }, }, Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -2740,139 +2740,139 @@ func TestLabelEvent_Marshal(t *testing.T) { testJSONMarshal(t, &LabelEvent{}, "{}") u := &LabelEvent{ - Action: String("a"), - Label: &Label{ID: Int64(1)}, + Action: Ptr("a"), + Label: &Label{ID: Ptr(int64(1))}, Changes: &EditChange{ Title: &EditTitle{ - From: String("TitleFrom"), + From: Ptr("TitleFrom"), }, Body: &EditBody{ - From: String("BodyFrom"), + From: Ptr("BodyFrom"), }, Base: &EditBase{ Ref: &EditRef{ - From: String("BaseRefFrom"), + From: Ptr("BaseRefFrom"), }, SHA: &EditSHA{ - From: String("BaseSHAFrom"), + From: Ptr("BaseSHAFrom"), }, }, }, Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Org: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -3035,148 +3035,148 @@ func TestMilestoneEvent_Marshal(t *testing.T) { testJSONMarshal(t, &MilestoneEvent{}, "{}") u := &MilestoneEvent{ - Action: String("a"), - Milestone: &Milestone{ID: Int64(1)}, + Action: Ptr("a"), + Milestone: &Milestone{ID: Ptr(int64(1))}, Changes: &EditChange{ Title: &EditTitle{ - From: String("TitleFrom"), + From: Ptr("TitleFrom"), }, Body: &EditBody{ - From: String("BodyFrom"), + From: Ptr("BodyFrom"), }, Base: &EditBase{ Ref: &EditRef{ - From: String("BaseRefFrom"), + From: Ptr("BaseRefFrom"), }, SHA: &EditSHA{ - From: String("BaseSHAFrom"), + From: Ptr("BaseSHAFrom"), }, }, }, Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Org: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -3349,107 +3349,107 @@ func TestPublicEvent_Marshal(t *testing.T) { u := &PublicEvent{ Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -3579,137 +3579,137 @@ func TestPullRequestReviewEvent_Marshal(t *testing.T) { testJSONMarshal(t, &PullRequestReviewEvent{}, "{}") u := &PullRequestReviewEvent{ - Action: String("a"), - Review: &PullRequestReview{ID: Int64(1)}, - PullRequest: &PullRequest{ID: Int64(1)}, + Action: Ptr("a"), + Review: &PullRequestReview{ID: Ptr(int64(1))}, + PullRequest: &PullRequest{ID: Ptr(int64(1))}, Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, SuspendedAt: &Timestamp{referenceTime}, }, Organization: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, } @@ -3864,152 +3864,152 @@ func TestPushEvent_Marshal(t *testing.T) { testJSONMarshal(t, &PushEvent{}, "{}") u := &PushEvent{ - PushID: Int64(1), - Head: String("h"), - Ref: String("ref"), - Size: Int(1), + PushID: Ptr(int64(1)), + Head: Ptr("h"), + Ref: Ptr("ref"), + Size: Ptr(1), Commits: []*HeadCommit{ - {ID: String("id")}, - }, - Before: String("b"), - DistinctSize: Int(1), - After: String("a"), - Created: Bool(true), - Deleted: Bool(true), - Forced: Bool(true), - BaseRef: String("a"), - Compare: String("a"), - Repo: &PushEventRepository{ID: Int64(1)}, - HeadCommit: &HeadCommit{ID: String("id")}, + {ID: Ptr("id")}, + }, + Before: Ptr("b"), + DistinctSize: Ptr(1), + After: Ptr("a"), + Created: Ptr(true), + Deleted: Ptr(true), + Forced: Ptr(true), + BaseRef: Ptr("a"), + Compare: Ptr("a"), + Repo: &PushEventRepository{ID: Ptr(int64(1))}, + HeadCommit: &HeadCommit{ID: Ptr("id")}, Pusher: &CommitAuthor{ - Login: String("l"), + Login: Ptr("l"), Date: &Timestamp{referenceTime}, - Name: String("n"), - Email: String("e"), + Name: Ptr("n"), + Email: Ptr("e"), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, SuspendedAt: &Timestamp{referenceTime}, }, Organization: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, } @@ -4181,120 +4181,120 @@ func TestStatusEvent_Marshal(t *testing.T) { testJSONMarshal(t, &StatusEvent{}, "{}") u := &StatusEvent{ - SHA: String("sha"), - State: String("s"), - Description: String("d"), - TargetURL: String("turl"), + SHA: Ptr("sha"), + State: Ptr("s"), + Description: Ptr("d"), + TargetURL: Ptr("turl"), Branches: []*Branch{ { - Name: String("n"), - Commit: &RepositoryCommit{NodeID: String("nid")}, - Protected: Bool(false), + Name: Ptr("n"), + Commit: &RepositoryCommit{NodeID: Ptr("nid")}, + Protected: Ptr(false), }, }, - ID: Int64(1), - Name: String("n"), - Context: String("c"), - Commit: &RepositoryCommit{NodeID: String("nid")}, + ID: Ptr(int64(1)), + Name: Ptr("n"), + Context: Ptr("c"), + Commit: &RepositoryCommit{NodeID: Ptr("nid")}, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -4440,151 +4440,151 @@ func TestMarketplacePurchaseEvent_Marshal(t *testing.T) { testJSONMarshal(t, &MarketplacePurchaseEvent{}, "{}") u := &MarketplacePurchaseEvent{ - Action: String("a"), + Action: Ptr("a"), EffectiveDate: &Timestamp{referenceTime}, MarketplacePurchase: &MarketplacePurchase{ - BillingCycle: String("bc"), + BillingCycle: Ptr("bc"), NextBillingDate: &Timestamp{referenceTime}, - UnitCount: Int(1), + UnitCount: Ptr(1), Plan: &MarketplacePlan{ - URL: String("u"), - AccountsURL: String("au"), - ID: Int64(1), - Number: Int(1), - Name: String("n"), - Description: String("d"), - MonthlyPriceInCents: Int(1), - YearlyPriceInCents: Int(1), - PriceModel: String("pm"), - UnitName: String("un"), + URL: Ptr("u"), + AccountsURL: Ptr("au"), + ID: Ptr(int64(1)), + Number: Ptr(1), + Name: Ptr("n"), + Description: Ptr("d"), + MonthlyPriceInCents: Ptr(1), + YearlyPriceInCents: Ptr(1), + PriceModel: Ptr("pm"), + UnitName: Ptr("un"), Bullets: &[]string{"b"}, - State: String("s"), - HasFreeTrial: Bool(false), + State: Ptr("s"), + HasFreeTrial: Ptr(false), }, - OnFreeTrial: Bool(false), + OnFreeTrial: Ptr(false), FreeTrialEndsOn: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, }, PreviousMarketplacePurchase: &MarketplacePurchase{ - BillingCycle: String("bc"), + BillingCycle: Ptr("bc"), NextBillingDate: &Timestamp{referenceTime}, - UnitCount: Int(1), + UnitCount: Ptr(1), Plan: &MarketplacePlan{ - URL: String("u"), - AccountsURL: String("au"), - ID: Int64(1), - Number: Int(1), - Name: String("n"), - Description: String("d"), - MonthlyPriceInCents: Int(1), - YearlyPriceInCents: Int(1), - PriceModel: String("pm"), - UnitName: String("un"), + URL: Ptr("u"), + AccountsURL: Ptr("au"), + ID: Ptr(int64(1)), + Number: Ptr(1), + Name: Ptr("n"), + Description: Ptr("d"), + MonthlyPriceInCents: Ptr(1), + YearlyPriceInCents: Ptr(1), + PriceModel: Ptr("pm"), + UnitName: Ptr("un"), Bullets: &[]string{"b"}, - State: String("s"), - HasFreeTrial: Bool(false), + State: Ptr("s"), + HasFreeTrial: Ptr(false), }, - OnFreeTrial: Bool(false), + OnFreeTrial: Ptr(false), FreeTrialEndsOn: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -4761,164 +4761,164 @@ func TestOrganizationEvent_Marshal(t *testing.T) { testJSONMarshal(t, &OrganizationEvent{}, "{}") u := &OrganizationEvent{ - Action: String("a"), - Invitation: &Invitation{ID: Int64(1)}, + Action: Ptr("a"), + Invitation: &Invitation{ID: Ptr(int64(1))}, Membership: &Membership{ - URL: String("url"), - State: String("s"), - Role: String("r"), - OrganizationURL: String("ou"), + URL: Ptr("url"), + State: Ptr("s"), + Role: Ptr("r"), + OrganizationURL: Ptr("ou"), Organization: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, User: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, }, Organization: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -5106,110 +5106,110 @@ func TestPageBuildEvent_Marshal(t *testing.T) { testJSONMarshal(t, &PageBuildEvent{}, "{}") u := &PageBuildEvent{ - Build: &PagesBuild{URL: String("url")}, - ID: Int64(1), + Build: &PagesBuild{URL: Ptr("url")}, + ID: Ptr(int64(1)), Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -5344,141 +5344,141 @@ func TestCommitCommentEvent_Marshal(t *testing.T) { u := &CommitCommentEvent{ Comment: &RepositoryComment{ - HTMLURL: String("hurl"), - URL: String("url"), - ID: Int64(1), - NodeID: String("nid"), - CommitID: String("cid"), + HTMLURL: Ptr("hurl"), + URL: Ptr("url"), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + CommitID: Ptr("cid"), User: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Reactions: &Reactions{ - TotalCount: Int(1), - PlusOne: Int(1), - MinusOne: Int(1), - Laugh: Int(1), - Confused: Int(1), - Heart: Int(1), - Hooray: Int(1), - Rocket: Int(1), - Eyes: Int(1), - URL: String("url"), + TotalCount: Ptr(1), + PlusOne: Ptr(1), + MinusOne: Ptr(1), + Laugh: Ptr(1), + Confused: Ptr(1), + Heart: Ptr(1), + Hooray: Ptr(1), + Rocket: Ptr(1), + Eyes: Ptr(1), + URL: Ptr("url"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - Body: String("b"), - Path: String("path"), - Position: Int(1), + Body: Ptr("b"), + Path: Ptr("path"), + Position: Ptr(1), }, - Action: String("a"), + Action: Ptr("a"), Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -5648,183 +5648,183 @@ func TestDeploymentEvent_Marshal(t *testing.T) { u := &DeploymentEvent{ Deployment: &Deployment{ - URL: String("url"), - ID: Int64(1), - SHA: String("sha"), - Ref: String("ref"), - Task: String("t"), + URL: Ptr("url"), + ID: Ptr(int64(1)), + SHA: Ptr("sha"), + Ref: Ptr("ref"), + Task: Ptr("t"), Payload: jsonMsg, - Environment: String("e"), - Description: String("d"), + Environment: Ptr("e"), + Description: Ptr("d"), Creator: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - StatusesURL: String("surl"), - RepositoryURL: String("rurl"), - NodeID: String("nid"), + StatusesURL: Ptr("surl"), + RepositoryURL: Ptr("rurl"), + NodeID: Ptr("nid"), }, Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, SuspendedAt: &Timestamp{referenceTime}, }, Workflow: &Workflow{ - ID: Int64(1), - NodeID: String("nid"), - Name: String("n"), - Path: String("p"), - State: String("s"), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + Name: Ptr("n"), + Path: Ptr("p"), + State: Ptr("s"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - URL: String("u"), - HTMLURL: String("h"), - BadgeURL: String("b"), + URL: Ptr("u"), + HTMLURL: Ptr("h"), + BadgeURL: Ptr("b"), }, WorkflowRun: &WorkflowRun{ - ID: Int64(1), - Name: String("n"), - NodeID: String("nid"), - HeadBranch: String("hb"), - HeadSHA: String("hs"), - RunNumber: Int(1), - RunAttempt: Int(1), - Event: String("e"), - Status: String("s"), - Conclusion: String("c"), - WorkflowID: Int64(1), - URL: String("u"), - HTMLURL: String("h"), + ID: Ptr(int64(1)), + Name: Ptr("n"), + NodeID: Ptr("nid"), + HeadBranch: Ptr("hb"), + HeadSHA: Ptr("hs"), + RunNumber: Ptr(1), + RunAttempt: Ptr(1), + Event: Ptr("e"), + Status: Ptr("s"), + Conclusion: Ptr("c"), + WorkflowID: Ptr(int64(1)), + URL: Ptr("u"), + HTMLURL: Ptr("h"), PullRequests: []*PullRequest{ { - URL: String("u"), - ID: Int64(1), - Number: Int(1), + URL: Ptr("u"), + ID: Ptr(int64(1)), + Number: Ptr(1), Head: &PullRequestBranch{ - Ref: String("r"), - SHA: String("s"), + Ref: Ptr("r"), + SHA: Ptr("s"), Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, }, Base: &PullRequestBranch{ - Ref: String("r"), - SHA: String("s"), + Ref: Ptr("r"), + SHA: Ptr("s"), Repo: &Repository{ - ID: Int64(1), - URL: String("u"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + Name: Ptr("n"), }, }, }, @@ -5832,42 +5832,42 @@ func TestDeploymentEvent_Marshal(t *testing.T) { CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, RunStartedAt: &Timestamp{referenceTime}, - JobsURL: String("j"), - LogsURL: String("l"), - CheckSuiteURL: String("c"), - ArtifactsURL: String("a"), - CancelURL: String("c"), - RerunURL: String("r"), - PreviousAttemptURL: String("p"), + JobsURL: Ptr("j"), + LogsURL: Ptr("l"), + CheckSuiteURL: Ptr("c"), + ArtifactsURL: Ptr("a"), + CancelURL: Ptr("c"), + RerunURL: Ptr("r"), + PreviousAttemptURL: Ptr("p"), HeadCommit: &HeadCommit{ - Message: String("m"), + Message: Ptr("m"), Author: &CommitAuthor{ - Name: String("n"), - Email: String("e"), - Login: String("l"), + Name: Ptr("n"), + Email: Ptr("e"), + Login: Ptr("l"), }, - URL: String("u"), - Distinct: Bool(false), - SHA: String("s"), - ID: String("i"), - TreeID: String("tid"), + URL: Ptr("u"), + Distinct: Ptr(false), + SHA: Ptr("s"), + ID: Ptr("i"), + TreeID: Ptr("tid"), Timestamp: &Timestamp{referenceTime}, Committer: &CommitAuthor{ - Name: String("n"), - Email: String("e"), - Login: String("l"), + Name: Ptr("n"), + Email: Ptr("e"), + Login: Ptr("l"), }, }, - WorkflowURL: String("w"), + WorkflowURL: Ptr("w"), Repository: &Repository{ - ID: Int64(1), - URL: String("u"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + Name: Ptr("n"), }, HeadRepository: &Repository{ - ID: Int64(1), - URL: String("u"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + Name: Ptr("n"), }, }, } @@ -6117,182 +6117,182 @@ func TestDeploymentProtectionRuleEvent_Marshal(t *testing.T) { jsonMsg, _ := json.Marshal(&l) u := &DeploymentProtectionRuleEvent{ - Action: String("a"), - Environment: String("e"), - DeploymentCallbackURL: String("b"), + Action: Ptr("a"), + Environment: Ptr("e"), + DeploymentCallbackURL: Ptr("b"), Deployment: &Deployment{ - URL: String("url"), - ID: Int64(1), - SHA: String("sha"), - Ref: String("ref"), - Task: String("t"), + URL: Ptr("url"), + ID: Ptr(int64(1)), + SHA: Ptr("sha"), + Ref: Ptr("ref"), + Task: Ptr("t"), Payload: jsonMsg, - Environment: String("e"), - Description: String("d"), + Environment: Ptr("e"), + Description: Ptr("d"), Creator: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - StatusesURL: String("surl"), - RepositoryURL: String("rurl"), - NodeID: String("nid"), + StatusesURL: Ptr("surl"), + RepositoryURL: Ptr("rurl"), + NodeID: Ptr("nid"), }, Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Organization: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, PullRequests: []*PullRequest{ { - URL: String("u"), - ID: Int64(1), - Number: Int(1), + URL: Ptr("u"), + ID: Ptr(int64(1)), + Number: Ptr(1), Head: &PullRequestBranch{ - Ref: String("r"), - SHA: String("s"), + Ref: Ptr("r"), + SHA: Ptr("s"), Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, }, Base: &PullRequestBranch{ - Ref: String("r"), - SHA: String("s"), + Ref: Ptr("r"), + SHA: Ptr("s"), Repo: &Repository{ - ID: Int64(1), - URL: String("u"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + Name: Ptr("n"), }, }, }, }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -6498,252 +6498,252 @@ func TestDeploymentReviewEvent_Marshal(t *testing.T) { testJSONMarshal(t, &DeploymentReviewEvent{}, "{}") u := &DeploymentReviewEvent{ - Action: String("a"), - Environment: String("e"), + Action: Ptr("a"), + Environment: Ptr("e"), Requester: &User{ - AvatarURL: String("a"), - Email: String("e"), - EventsURL: String("e"), - FollowersURL: String("f"), - FollowingURL: String("f"), - GistsURL: String("g"), - GravatarID: String("g"), - HTMLURL: String("h"), - ID: Int64(1), - Login: String("l"), - Name: String("n"), - NodeID: String("n"), - OrganizationsURL: String("o"), - ReceivedEventsURL: String("r"), - ReposURL: String("r"), - SiteAdmin: Bool(false), - StarredURL: String("s"), - SubscriptionsURL: String("s"), - Type: String("User"), - URL: String("u"), + AvatarURL: Ptr("a"), + Email: Ptr("e"), + EventsURL: Ptr("e"), + FollowersURL: Ptr("f"), + FollowingURL: Ptr("f"), + GistsURL: Ptr("g"), + GravatarID: Ptr("g"), + HTMLURL: Ptr("h"), + ID: Ptr(int64(1)), + Login: Ptr("l"), + Name: Ptr("n"), + NodeID: Ptr("n"), + OrganizationsURL: Ptr("o"), + ReceivedEventsURL: Ptr("r"), + ReposURL: Ptr("r"), + SiteAdmin: Ptr(false), + StarredURL: Ptr("s"), + SubscriptionsURL: Ptr("s"), + Type: Ptr("User"), + URL: Ptr("u"), }, Reviewers: []*RequiredReviewer{ { - Type: String("User"), + Type: Ptr("User"), Reviewer: &User{ - AvatarURL: String("a"), - Email: String("e"), - EventsURL: String("e"), - FollowersURL: String("f"), - FollowingURL: String("f"), - GistsURL: String("g"), - GravatarID: String("g"), - HTMLURL: String("h"), - ID: Int64(1), - Login: String("l"), - Name: String("n"), - NodeID: String("n"), - OrganizationsURL: String("o"), - ReceivedEventsURL: String("r"), - ReposURL: String("r"), - SiteAdmin: Bool(false), - StarredURL: String("s"), - SubscriptionsURL: String("s"), - Type: String("User"), - URL: String("u"), + AvatarURL: Ptr("a"), + Email: Ptr("e"), + EventsURL: Ptr("e"), + FollowersURL: Ptr("f"), + FollowingURL: Ptr("f"), + GistsURL: Ptr("g"), + GravatarID: Ptr("g"), + HTMLURL: Ptr("h"), + ID: Ptr(int64(1)), + Login: Ptr("l"), + Name: Ptr("n"), + NodeID: Ptr("n"), + OrganizationsURL: Ptr("o"), + ReceivedEventsURL: Ptr("r"), + ReposURL: Ptr("r"), + SiteAdmin: Ptr(false), + StarredURL: Ptr("s"), + SubscriptionsURL: Ptr("s"), + Type: Ptr("User"), + URL: Ptr("u"), }, }, { - Type: String("Team"), + Type: Ptr("Team"), Reviewer: &Team{ - ID: Int64(1), - Name: String("n"), - Slug: String("s"), + ID: Ptr(int64(1)), + Name: Ptr("n"), + Slug: Ptr("s"), }, }, }, Enterprise: &Enterprise{ - ID: Int(1), - Slug: String("s"), - Name: String("n"), - NodeID: String("nid"), - AvatarURL: String("au"), - Description: String("d"), - WebsiteURL: String("wu"), - HTMLURL: String("hu"), + ID: Ptr(1), + Slug: Ptr("s"), + Name: Ptr("n"), + NodeID: Ptr("nid"), + AvatarURL: Ptr("au"), + Description: Ptr("d"), + WebsiteURL: Ptr("wu"), + HTMLURL: Ptr("hu"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, SuspendedAt: &Timestamp{referenceTime}, }, Organization: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), - }, - Since: String("s"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), + }, + Since: Ptr("s"), WorkflowJobRun: &WorkflowJobRun{ - ID: Int64(1), - Conclusion: String("c"), - Environment: String("e"), - HTMLURL: String("h"), - Name: String("n"), - Status: String("s"), + ID: Ptr(int64(1)), + Conclusion: Ptr("c"), + Environment: Ptr("e"), + HTMLURL: Ptr("h"), + Name: Ptr("n"), + Status: Ptr("s"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, }, WorkflowRun: &WorkflowRun{ - ID: Int64(1), - Name: String("n"), - NodeID: String("nid"), - HeadBranch: String("hb"), - HeadSHA: String("hs"), - RunNumber: Int(1), - RunAttempt: Int(1), - Event: String("e"), - Status: String("s"), - Conclusion: String("c"), - WorkflowID: Int64(1), - URL: String("u"), - HTMLURL: String("h"), + ID: Ptr(int64(1)), + Name: Ptr("n"), + NodeID: Ptr("nid"), + HeadBranch: Ptr("hb"), + HeadSHA: Ptr("hs"), + RunNumber: Ptr(1), + RunAttempt: Ptr(1), + Event: Ptr("e"), + Status: Ptr("s"), + Conclusion: Ptr("c"), + WorkflowID: Ptr(int64(1)), + URL: Ptr("u"), + HTMLURL: Ptr("h"), PullRequests: []*PullRequest{ { - URL: String("u"), - ID: Int64(1), - Number: Int(1), + URL: Ptr("u"), + ID: Ptr(int64(1)), + Number: Ptr(1), Head: &PullRequestBranch{ - Ref: String("r"), - SHA: String("s"), + Ref: Ptr("r"), + SHA: Ptr("s"), Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, }, Base: &PullRequestBranch{ - Ref: String("r"), - SHA: String("s"), + Ref: Ptr("r"), + SHA: Ptr("s"), Repo: &Repository{ - ID: Int64(1), - URL: String("u"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + Name: Ptr("n"), }, }, }, @@ -6751,42 +6751,42 @@ func TestDeploymentReviewEvent_Marshal(t *testing.T) { CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, RunStartedAt: &Timestamp{referenceTime}, - JobsURL: String("j"), - LogsURL: String("l"), - CheckSuiteURL: String("c"), - ArtifactsURL: String("a"), - CancelURL: String("c"), - RerunURL: String("r"), - PreviousAttemptURL: String("p"), + JobsURL: Ptr("j"), + LogsURL: Ptr("l"), + CheckSuiteURL: Ptr("c"), + ArtifactsURL: Ptr("a"), + CancelURL: Ptr("c"), + RerunURL: Ptr("r"), + PreviousAttemptURL: Ptr("p"), HeadCommit: &HeadCommit{ - Message: String("m"), + Message: Ptr("m"), Author: &CommitAuthor{ - Name: String("n"), - Email: String("e"), - Login: String("l"), + Name: Ptr("n"), + Email: Ptr("e"), + Login: Ptr("l"), }, - URL: String("u"), - Distinct: Bool(false), - SHA: String("s"), - ID: String("i"), - TreeID: String("tid"), + URL: Ptr("u"), + Distinct: Ptr(false), + SHA: Ptr("s"), + ID: Ptr("i"), + TreeID: Ptr("tid"), Timestamp: &Timestamp{referenceTime}, Committer: &CommitAuthor{ - Name: String("n"), - Email: String("e"), - Login: String("l"), + Name: Ptr("n"), + Email: Ptr("e"), + Login: Ptr("l"), }, }, - WorkflowURL: String("w"), + WorkflowURL: Ptr("w"), Repository: &Repository{ - ID: Int64(1), - URL: String("u"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + Name: Ptr("n"), }, HeadRepository: &Repository{ - ID: Int64(1), - URL: String("u"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + Name: Ptr("n"), }, }, } @@ -7103,155 +7103,155 @@ func TestDeploymentStatusEvent_Marshal(t *testing.T) { u := &DeploymentStatusEvent{ Deployment: &Deployment{ - URL: String("url"), - ID: Int64(1), - SHA: String("sha"), - Ref: String("ref"), - Task: String("t"), + URL: Ptr("url"), + ID: Ptr(int64(1)), + SHA: Ptr("sha"), + Ref: Ptr("ref"), + Task: Ptr("t"), Payload: jsonMsg, - Environment: String("e"), - Description: String("d"), + Environment: Ptr("e"), + Description: Ptr("d"), Creator: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - StatusesURL: String("surl"), - RepositoryURL: String("rurl"), - NodeID: String("nid"), + StatusesURL: Ptr("surl"), + RepositoryURL: Ptr("rurl"), + NodeID: Ptr("nid"), }, DeploymentStatus: &DeploymentStatus{ - ID: Int64(1), - State: String("s"), + ID: Ptr(int64(1)), + State: Ptr("s"), Creator: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), - }, - Description: String("s"), - Environment: String("s"), - NodeID: String("s"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), + }, + Description: Ptr("s"), + Environment: Ptr("s"), + NodeID: Ptr("s"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - TargetURL: String("s"), - DeploymentURL: String("s"), - RepositoryURL: String("s"), - EnvironmentURL: String("s"), - LogURL: String("s"), - URL: String("s"), + TargetURL: Ptr("s"), + DeploymentURL: Ptr("s"), + RepositoryURL: Ptr("s"), + EnvironmentURL: Ptr("s"), + LogURL: Ptr("s"), + URL: Ptr("s"), }, Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -7432,199 +7432,199 @@ func TestDiscussionCommentEvent_Marshal(t *testing.T) { u := &DiscussionCommentEvent{ Comment: &CommentDiscussion{ - AuthorAssociation: String("aa"), - Body: String("bo"), - ChildCommentCount: Int(1), + AuthorAssociation: Ptr("aa"), + Body: Ptr("bo"), + ChildCommentCount: Ptr(1), CreatedAt: &Timestamp{referenceTime}, - DiscussionID: Int64(1), - HTMLURL: String("hurl"), - ID: Int64(1), - NodeID: String("nid"), - ParentID: Int64(1), + DiscussionID: Ptr(int64(1)), + HTMLURL: Ptr("hurl"), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + ParentID: Ptr(int64(1)), Reactions: &Reactions{ - TotalCount: Int(1), - PlusOne: Int(1), - MinusOne: Int(1), - Laugh: Int(1), - Confused: Int(1), - Heart: Int(1), - Hooray: Int(1), - Rocket: Int(1), - Eyes: Int(1), - URL: String("url"), - }, - RepositoryURL: String("rurl"), + TotalCount: Ptr(1), + PlusOne: Ptr(1), + MinusOne: Ptr(1), + Laugh: Ptr(1), + Confused: Ptr(1), + Heart: Ptr(1), + Hooray: Ptr(1), + Rocket: Ptr(1), + Eyes: Ptr(1), + URL: Ptr("url"), + }, + RepositoryURL: Ptr("rurl"), UpdatedAt: &Timestamp{referenceTime}, User: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, }, Discussion: &Discussion{ - RepositoryURL: String("rurl"), + RepositoryURL: Ptr("rurl"), DiscussionCategory: &DiscussionCategory{ - ID: Int64(1), - NodeID: String("nid"), - RepositoryID: Int64(1), - Emoji: String("emoji"), - Name: String("name"), - Description: String("description"), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + RepositoryID: Ptr(int64(1)), + Emoji: Ptr("emoji"), + Name: Ptr("name"), + Description: Ptr("description"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - Slug: String("slug"), - IsAnswerable: Bool(false), - }, - HTMLURL: String("hurl"), - ID: Int64(1), - NodeID: String("nurl"), - Number: Int(1), - Title: String("title"), + Slug: Ptr("slug"), + IsAnswerable: Ptr(false), + }, + HTMLURL: Ptr("hurl"), + ID: Ptr(int64(1)), + NodeID: Ptr("nurl"), + Number: Ptr(1), + Title: Ptr("title"), User: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), - }, - State: String("st"), - Locked: Bool(false), - Comments: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), + }, + State: Ptr("st"), + Locked: Ptr(false), + Comments: Ptr(1), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - AuthorAssociation: String("aa"), - Body: String("bo"), + AuthorAssociation: Ptr("aa"), + Body: Ptr("bo"), }, Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Org: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -7847,165 +7847,165 @@ func TestDiscussionEvent_Marshal(t *testing.T) { u := &DiscussionEvent{ Discussion: &Discussion{ - RepositoryURL: String("rurl"), + RepositoryURL: Ptr("rurl"), DiscussionCategory: &DiscussionCategory{ - ID: Int64(1), - NodeID: String("nid"), - RepositoryID: Int64(1), - Emoji: String("emoji"), - Name: String("name"), - Description: String("description"), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + RepositoryID: Ptr(int64(1)), + Emoji: Ptr("emoji"), + Name: Ptr("name"), + Description: Ptr("description"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - Slug: String("slug"), - IsAnswerable: Bool(false), - }, - HTMLURL: String("hurl"), - ID: Int64(1), - NodeID: String("nurl"), - Number: Int(1), - Title: String("title"), + Slug: Ptr("slug"), + IsAnswerable: Ptr(false), + }, + HTMLURL: Ptr("hurl"), + ID: Ptr(int64(1)), + NodeID: Ptr("nurl"), + Number: Ptr(1), + Title: Ptr("title"), User: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), - }, - State: String("st"), - Locked: Bool(false), - Comments: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), + }, + State: Ptr("st"), + Locked: Ptr(false), + Comments: Ptr(1), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - AuthorAssociation: String("aa"), - Body: String("bo"), + AuthorAssociation: Ptr("aa"), + Body: Ptr("bo"), }, Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Org: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -8193,61 +8193,61 @@ func TestPackageEvent_Marshal(t *testing.T) { testJSONMarshal(t, &PackageEvent{}, "{}") u := &PackageEvent{ - Action: String("a"), + Action: Ptr("a"), Package: &Package{ - ID: Int64(1), - Name: String("n"), - PackageType: String("pt"), - HTMLURL: String("hurl"), + ID: Ptr(int64(1)), + Name: Ptr("n"), + PackageType: Ptr("pt"), + HTMLURL: Ptr("hurl"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, Owner: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, - PackageVersion: &PackageVersion{ID: Int64(1)}, - Registry: &PackageRegistry{Name: String("n")}, + PackageVersion: &PackageVersion{ID: Ptr(int64(1))}, + Registry: &PackageRegistry{Name: Ptr("n")}, }, Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Org: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, } @@ -8322,32 +8322,32 @@ func TestPersonalAccessTokenRequestEvent_Marshal(t *testing.T) { testJSONMarshal(t, &PersonalAccessTokenRequestEvent{}, "{}") event := &PersonalAccessTokenRequestEvent{ - Action: String("a"), + Action: Ptr("a"), PersonalAccessTokenRequest: &PersonalAccessTokenRequest{ - ID: Int64(1), - Owner: &User{Login: String("l")}, + ID: Ptr(int64(1)), + Owner: &User{Login: Ptr("l")}, PermissionsAdded: &PersonalAccessTokenPermissions{ Org: map[string]string{"organization_events": "read"}, Repo: map[string]string{"security_events": "write"}, }, CreatedAt: &Timestamp{referenceTime}, - TokenExpired: Bool(false), + TokenExpired: Ptr(false), TokenExpiresAt: &Timestamp{referenceTime}, TokenLastUsedAt: &Timestamp{referenceTime}, - RepositoryCount: Int64(1), - RepositorySelection: String("rs"), + RepositoryCount: Ptr(int64(1)), + RepositorySelection: Ptr("rs"), Repositories: []*Repository{ { - Name: String("n"), + Name: Ptr("n"), }, }, }, - Org: &Organization{Name: String("n")}, + Org: &Organization{Name: Ptr("n")}, Sender: &User{ - Login: String("l"), + Login: Ptr("l"), }, Installation: &Installation{ - ID: Int64(1), + ID: Ptr(int64(1)), }, } @@ -8401,110 +8401,110 @@ func TestPingEvent_Marshal(t *testing.T) { hookConfig := new(HookConfig) u := &PingEvent{ - Zen: String("z"), - HookID: Int64(1), + Zen: Ptr("z"), + HookID: Ptr(int64(1)), Hook: &Hook{ CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - URL: String("url"), - ID: Int64(1), - Type: String("t"), - Name: String("n"), - TestURL: String("tu"), - PingURL: String("pu"), + URL: Ptr("url"), + ID: Ptr(int64(1)), + Type: Ptr("t"), + Name: Ptr("n"), + TestURL: Ptr("tu"), + PingURL: Ptr("pu"), LastResponse: l, Config: hookConfig, Events: []string{"a"}, - Active: Bool(true), + Active: Ptr(true), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -8647,134 +8647,134 @@ func TestRepositoryDispatchEvent_Marshal(t *testing.T) { jsonMsg, _ := json.Marshal(&l) u := &RepositoryDispatchEvent{ - Action: String("a"), - Branch: String("b"), + Action: Ptr("a"), + Branch: Ptr("b"), ClientPayload: jsonMsg, Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Org: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -8931,42 +8931,42 @@ func TestRepositoryImportEvent_Marshal(t *testing.T) { testJSONMarshal(t, &RepositoryImportEvent{}, "{}") u := &RepositoryImportEvent{ - Status: String("success"), + Status: Ptr("success"), Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Org: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, } @@ -9018,131 +9018,131 @@ func TestRepositoryEvent_Marshal(t *testing.T) { testJSONMarshal(t, &RepositoryEvent{}, "{}") u := &RepositoryEvent{ - Action: String("a"), + Action: Ptr("a"), Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Org: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -9295,125 +9295,125 @@ func TestReleaseEvent_Marshal(t *testing.T) { testJSONMarshal(t, &ReleaseEvent{}, "{}") u := &ReleaseEvent{ - Action: String("a"), + Action: Ptr("a"), Release: &RepositoryRelease{ - Name: String("n"), - DiscussionCategoryName: String("dcn"), - ID: Int64(2), + Name: Ptr("n"), + DiscussionCategoryName: Ptr("dcn"), + ID: Ptr(int64(2)), CreatedAt: &Timestamp{referenceTime}, PublishedAt: &Timestamp{referenceTime}, - URL: String("url"), - HTMLURL: String("htmlurl"), - AssetsURL: String("assetsurl"), - Assets: []*ReleaseAsset{{ID: Int64(1)}}, - UploadURL: String("uploadurl"), - ZipballURL: String("zipballurl"), - TarballURL: String("tarballurl"), - Author: &User{Name: String("octocat")}, - NodeID: String("nid"), + URL: Ptr("url"), + HTMLURL: Ptr("htmlurl"), + AssetsURL: Ptr("assetsurl"), + Assets: []*ReleaseAsset{{ID: Ptr(int64(1))}}, + UploadURL: Ptr("uploadurl"), + ZipballURL: Ptr("zipballurl"), + TarballURL: Ptr("tarballurl"), + Author: &User{Name: Ptr("octocat")}, + NodeID: Ptr("nid"), }, Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -9571,161 +9571,161 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { jsonMsg, _ := json.Marshal(&l) u := &RepositoryRulesetEvent{ - Action: String("a"), + Action: Ptr("a"), Enterprise: &Enterprise{ - ID: Int(1), - Slug: String("s"), - Name: String("n"), - NodeID: String("nid"), - AvatarURL: String("au"), - Description: String("d"), - WebsiteURL: String("wu"), - HTMLURL: String("hu"), + ID: Ptr(1), + Slug: Ptr("s"), + Name: Ptr("n"), + NodeID: Ptr("nid"), + AvatarURL: Ptr("au"), + Description: Ptr("d"), + WebsiteURL: Ptr("wu"), + HTMLURL: Ptr("hu"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, SuspendedAt: &Timestamp{referenceTime}, }, Organization: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, Repository: &Repository{ - ID: Int64(1), - URL: String("u"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + Name: Ptr("n"), }, RepositoryRuleset: &RepositoryRuleset{ ID: 1, Name: "n", - Target: String("branch"), - SourceType: String("Repository"), + Target: Ptr("branch"), + SourceType: Ptr("Repository"), Source: "s", Enforcement: "disabled", BypassActors: []*BypassActor{ { - ActorID: Int64(234), - ActorType: String("Team"), - BypassMode: String("Always"), + ActorID: Ptr(int64(234)), + ActorType: Ptr("Team"), + BypassMode: Ptr("Always"), }, }, - CurrentUserCanBypass: String("always"), - NodeID: String("n"), + CurrentUserCanBypass: Ptr("always"), + NodeID: Ptr("n"), Links: &RepositoryRulesetLink{ Self: &RulesetLink{ - HRef: String("href"), + HRef: Ptr("href"), }, HTML: &RulesetLink{ - HRef: String("href"), + HRef: Ptr("href"), }, }, Conditions: json.RawMessage(jsonMsg), @@ -9783,7 +9783,7 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { RequiredStatusChecks: []RuleRequiredStatusChecks{ { Context: "test", - IntegrationID: Int64(1), + IntegrationID: Ptr(int64(1)), }, }, StrictRequiredStatusChecksPolicy: true, @@ -9795,8 +9795,8 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { CommitMessagePattern: &RepositoryRulesetPatternRule{ Type: "commit_message_pattern", Parameters: &RulePatternParameters{ - Name: String("avoid test commits"), - Negate: Bool(true), + Name: Ptr("avoid test commits"), + Negate: Ptr(true), Operator: "starts_with", Pattern: "[test]", }, @@ -9811,8 +9811,8 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { CommitterEmailPattern: &RepositoryRulesetPatternRule{ Type: "committer_email_pattern", Parameters: &RulePatternParameters{ - Name: String("avoid commit emails"), - Negate: Bool(true), + Name: Ptr("avoid commit emails"), + Negate: Ptr(true), Operator: "ends_with", Pattern: "abc", }, @@ -9820,8 +9820,8 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { BranchNamePattern: &RepositoryRulesetPatternRule{ Type: "branch_name_pattern", Parameters: &RulePatternParameters{ - Name: String("avoid branch names"), - Negate: Bool(true), + Name: Ptr("avoid branch names"), + Negate: Ptr(true), Operator: "regex", Pattern: "github$", }, @@ -9829,8 +9829,8 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { TagNamePattern: &RepositoryRulesetPatternRule{ Type: "tag_name_pattern", Parameters: &RulePatternParameters{ - Name: String("avoid tag names"), - Negate: Bool(true), + Name: Ptr("avoid tag names"), + Negate: Ptr(true), Operator: "contains", Pattern: "github", }, @@ -9865,7 +9865,7 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { RequiredWorkflows: []*RuleRequiredWorkflow{ { Path: ".github/workflows/test.yml", - RepositoryID: Int64(1), + RepositoryID: Ptr(int64(1)), }, }, }, @@ -9887,10 +9887,10 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { }, Changes: &RepositoryRulesetEditedChanges{ Name: &RepositoryRulesetEditedSource{ - From: String("f"), + From: Ptr("f"), }, Enforcement: &RepositoryRulesetEditedSource{ - From: String("e"), + From: Ptr("e"), }, Conditions: &RepositoryRulesetEditedConditions{ Added: []*RepositoryRulesetRefCondition{ @@ -9919,10 +9919,10 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { }, Changes: &RepositoryRulesetUpdatedConditionsEdited{ ConditionType: &RepositoryRulesetEditedSource{ - From: String("c"), + From: Ptr("c"), }, Target: &RepositoryRulesetEditedSource{ - From: String("t"), + From: Ptr("t"), }, Include: &RepositoryRulesetEditedSources{ From: []string{"from"}, @@ -9990,7 +9990,7 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { RequiredStatusChecks: []RuleRequiredStatusChecks{ { Context: "test", - IntegrationID: Int64(1), + IntegrationID: Ptr(int64(1)), }, }, StrictRequiredStatusChecksPolicy: true, @@ -10002,8 +10002,8 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { CommitMessagePattern: &RepositoryRulesetPatternRule{ Type: "commit_message_pattern", Parameters: &RulePatternParameters{ - Name: String("avoid test commits"), - Negate: Bool(true), + Name: Ptr("avoid test commits"), + Negate: Ptr(true), Operator: "starts_with", Pattern: "[test]", }, @@ -10018,8 +10018,8 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { CommitterEmailPattern: &RepositoryRulesetPatternRule{ Type: "committer_email_pattern", Parameters: &RulePatternParameters{ - Name: String("avoid commit emails"), - Negate: Bool(true), + Name: Ptr("avoid commit emails"), + Negate: Ptr(true), Operator: "ends_with", Pattern: "abc", }, @@ -10027,8 +10027,8 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { BranchNamePattern: &RepositoryRulesetPatternRule{ Type: "branch_name_pattern", Parameters: &RulePatternParameters{ - Name: String("avoid branch names"), - Negate: Bool(true), + Name: Ptr("avoid branch names"), + Negate: Ptr(true), Operator: "regex", Pattern: "github$", }, @@ -10036,8 +10036,8 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { TagNamePattern: &RepositoryRulesetPatternRule{ Type: "tag_name_pattern", Parameters: &RulePatternParameters{ - Name: String("avoid tag names"), - Negate: Bool(true), + Name: Ptr("avoid tag names"), + Negate: Ptr(true), Operator: "contains", Pattern: "github", }, @@ -10072,7 +10072,7 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { RequiredWorkflows: []*RuleRequiredWorkflow{ { Path: ".github/workflows/test.yml", - RepositoryID: Int64(1), + RepositoryID: Ptr(int64(1)), }, }, }, @@ -10144,7 +10144,7 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { RequiredStatusChecks: []RuleRequiredStatusChecks{ { Context: "test", - IntegrationID: Int64(1), + IntegrationID: Ptr(int64(1)), }, }, StrictRequiredStatusChecksPolicy: true, @@ -10156,8 +10156,8 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { CommitMessagePattern: &RepositoryRulesetPatternRule{ Type: "commit_message_pattern", Parameters: &RulePatternParameters{ - Name: String("avoid test commits"), - Negate: Bool(true), + Name: Ptr("avoid test commits"), + Negate: Ptr(true), Operator: "starts_with", Pattern: "[test]", }, @@ -10172,8 +10172,8 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { CommitterEmailPattern: &RepositoryRulesetPatternRule{ Type: "committer_email_pattern", Parameters: &RulePatternParameters{ - Name: String("avoid commit emails"), - Negate: Bool(true), + Name: Ptr("avoid commit emails"), + Negate: Ptr(true), Operator: "ends_with", Pattern: "abc", }, @@ -10181,8 +10181,8 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { BranchNamePattern: &RepositoryRulesetPatternRule{ Type: "branch_name_pattern", Parameters: &RulePatternParameters{ - Name: String("avoid branch names"), - Negate: Bool(true), + Name: Ptr("avoid branch names"), + Negate: Ptr(true), Operator: "regex", Pattern: "github$", }, @@ -10190,8 +10190,8 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { TagNamePattern: &RepositoryRulesetPatternRule{ Type: "tag_name_pattern", Parameters: &RulePatternParameters{ - Name: String("avoid tag names"), - Negate: Bool(true), + Name: Ptr("avoid tag names"), + Negate: Ptr(true), Operator: "contains", Pattern: "github", }, @@ -10226,7 +10226,7 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { RequiredWorkflows: []*RuleRequiredWorkflow{ { Path: ".github/workflows/test.yml", - RepositoryID: Int64(1), + RepositoryID: Ptr(int64(1)), }, }, }, @@ -10298,7 +10298,7 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { RequiredStatusChecks: []RuleRequiredStatusChecks{ { Context: "test", - IntegrationID: Int64(1), + IntegrationID: Ptr(int64(1)), }, }, StrictRequiredStatusChecksPolicy: true, @@ -10310,8 +10310,8 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { CommitMessagePattern: &RepositoryRulesetPatternRule{ Type: "commit_message_pattern", Parameters: &RulePatternParameters{ - Name: String("avoid test commits"), - Negate: Bool(true), + Name: Ptr("avoid test commits"), + Negate: Ptr(true), Operator: "starts_with", Pattern: "[test]", }, @@ -10326,8 +10326,8 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { CommitterEmailPattern: &RepositoryRulesetPatternRule{ Type: "committer_email_pattern", Parameters: &RulePatternParameters{ - Name: String("avoid commit emails"), - Negate: Bool(true), + Name: Ptr("avoid commit emails"), + Negate: Ptr(true), Operator: "ends_with", Pattern: "abc", }, @@ -10335,8 +10335,8 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { BranchNamePattern: &RepositoryRulesetPatternRule{ Type: "branch_name_pattern", Parameters: &RulePatternParameters{ - Name: String("avoid branch names"), - Negate: Bool(true), + Name: Ptr("avoid branch names"), + Negate: Ptr(true), Operator: "regex", Pattern: "github$", }, @@ -10344,8 +10344,8 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { TagNamePattern: &RepositoryRulesetPatternRule{ Type: "tag_name_pattern", Parameters: &RulePatternParameters{ - Name: String("avoid tag names"), - Negate: Bool(true), + Name: Ptr("avoid tag names"), + Negate: Ptr(true), Operator: "contains", Pattern: "github", }, @@ -10380,7 +10380,7 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { RequiredWorkflows: []*RuleRequiredWorkflow{ { Path: ".github/workflows/test.yml", - RepositoryID: Int64(1), + RepositoryID: Ptr(int64(1)), }, }, }, @@ -10412,13 +10412,13 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { }, }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, } @@ -11343,114 +11343,114 @@ func TestContentReferenceEvent_Marshal(t *testing.T) { testJSONMarshal(t, &ContentReferenceEvent{}, "{}") u := &ContentReferenceEvent{ - Action: String("a"), + Action: Ptr("a"), ContentReference: &ContentReference{ - ID: Int64(1), - NodeID: String("nid"), - Reference: String("ref"), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + Reference: Ptr("ref"), }, Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -11586,128 +11586,128 @@ func TestMemberEvent_Marshal(t *testing.T) { testJSONMarshal(t, &MemberEvent{}, "{}") u := &MemberEvent{ - Action: String("a"), + Action: Ptr("a"), Member: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Changes: &MemberChanges{ Permission: &MemberChangesPermission{ - From: String("f"), - To: String("t"), + From: Ptr("f"), + To: Ptr("t"), }, RoleName: &MemberChangesRoleName{ - From: String("f"), - To: String("t"), + From: Ptr("f"), + To: Ptr("t"), }, }, Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -11857,175 +11857,175 @@ func TestMembershipEvent_Marshal(t *testing.T) { testJSONMarshal(t, &MembershipEvent{}, "{}") u := &MembershipEvent{ - Action: String("a"), - Scope: String("s"), + Action: Ptr("a"), + Scope: Ptr("s"), Member: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Team: &Team{ - ID: Int64(1), - NodeID: String("n"), - Name: String("n"), - Description: String("d"), - URL: String("u"), - Slug: String("s"), - Permission: String("p"), - Privacy: String("p"), - MembersCount: Int(1), - ReposCount: Int(1), - MembersURL: String("m"), - RepositoriesURL: String("r"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + Name: Ptr("n"), + Description: Ptr("d"), + URL: Ptr("u"), + Slug: Ptr("s"), + Permission: Ptr("p"), + Privacy: Ptr("p"), + MembersCount: Ptr(1), + ReposCount: Ptr(1), + MembersURL: Ptr("m"), + RepositoriesURL: Ptr("r"), Organization: &Organization{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - AvatarURL: String("a"), - HTMLURL: String("h"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + AvatarURL: Ptr("a"), + HTMLURL: Ptr("h"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), }, Parent: &Team{ - ID: Int64(1), - NodeID: String("n"), - Name: String("n"), - Description: String("d"), - URL: String("u"), - Slug: String("s"), - Permission: String("p"), - Privacy: String("p"), - MembersCount: Int(1), - ReposCount: Int(1), - }, - LDAPDN: String("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + Name: Ptr("n"), + Description: Ptr("d"), + URL: Ptr("u"), + Slug: Ptr("s"), + Permission: Ptr("p"), + Privacy: Ptr("p"), + MembersCount: Ptr(1), + ReposCount: Ptr(1), + }, + LDAPDN: Ptr("l"), }, Org: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -12222,138 +12222,138 @@ func TestMergeGroupEvent_Marshal(t *testing.T) { testJSONMarshal(t, &MergeGroupEvent{}, "{}") u := &MergeGroupEvent{ - Action: String("a"), + Action: Ptr("a"), MergeGroup: &MergeGroup{ - HeadSHA: String("hs"), - HeadRef: String("hr"), - BaseSHA: String("bs"), - BaseRef: String("br"), - HeadCommit: &Commit{NodeID: String("nid")}, + HeadSHA: Ptr("hs"), + HeadRef: Ptr("hr"), + BaseSHA: Ptr("bs"), + BaseRef: Ptr("br"), + HeadCommit: &Commit{NodeID: Ptr("nid")}, }, Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Org: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -12515,135 +12515,135 @@ func TestOrgBlockEvent_Marshal(t *testing.T) { testJSONMarshal(t, &OrgBlockEvent{}, "{}") u := &OrgBlockEvent{ - Action: String("a"), + Action: Ptr("a"), BlockedUser: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Organization: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -12802,116 +12802,116 @@ func TestGollumEvent_Marshal(t *testing.T) { u := &GollumEvent{ Pages: []*Page{ { - PageName: String("pn"), - Title: String("t"), - Summary: String("s"), - Action: String("a"), - SHA: String("sha"), - HTMLURL: String("hu"), + PageName: Ptr("pn"), + Title: Ptr("t"), + Summary: Ptr("s"), + Action: Ptr("a"), + SHA: Ptr("sha"), + HTMLURL: Ptr("hu"), }, }, Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -13051,54 +13051,54 @@ func TestWorkflowRunEvent_Marshal(t *testing.T) { testJSONMarshal(t, &WorkflowRunEvent{}, "{}") u := &WorkflowRunEvent{ - Action: String("a"), + Action: Ptr("a"), Workflow: &Workflow{ - ID: Int64(1), - NodeID: String("nid"), - Name: String("n"), - Path: String("p"), - State: String("s"), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + Name: Ptr("n"), + Path: Ptr("p"), + State: Ptr("s"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - URL: String("u"), - HTMLURL: String("h"), - BadgeURL: String("b"), + URL: Ptr("u"), + HTMLURL: Ptr("h"), + BadgeURL: Ptr("b"), }, WorkflowRun: &WorkflowRun{ - ID: Int64(1), - Name: String("n"), - NodeID: String("nid"), - HeadBranch: String("hb"), - HeadSHA: String("hs"), - RunNumber: Int(1), - RunAttempt: Int(1), - Event: String("e"), - Status: String("s"), - Conclusion: String("c"), - WorkflowID: Int64(1), - URL: String("u"), - HTMLURL: String("h"), + ID: Ptr(int64(1)), + Name: Ptr("n"), + NodeID: Ptr("nid"), + HeadBranch: Ptr("hb"), + HeadSHA: Ptr("hs"), + RunNumber: Ptr(1), + RunAttempt: Ptr(1), + Event: Ptr("e"), + Status: Ptr("s"), + Conclusion: Ptr("c"), + WorkflowID: Ptr(int64(1)), + URL: Ptr("u"), + HTMLURL: Ptr("h"), PullRequests: []*PullRequest{ { - URL: String("u"), - ID: Int64(1), - Number: Int(1), + URL: Ptr("u"), + ID: Ptr(int64(1)), + Number: Ptr(1), Head: &PullRequestBranch{ - Ref: String("r"), - SHA: String("s"), + Ref: Ptr("r"), + SHA: Ptr("s"), Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, }, Base: &PullRequestBranch{ - Ref: String("r"), - SHA: String("s"), + Ref: Ptr("r"), + SHA: Ptr("s"), Repo: &Repository{ - ID: Int64(1), - URL: String("u"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + Name: Ptr("n"), }, }, }, @@ -13106,79 +13106,79 @@ func TestWorkflowRunEvent_Marshal(t *testing.T) { CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, RunStartedAt: &Timestamp{referenceTime}, - JobsURL: String("j"), - LogsURL: String("l"), - CheckSuiteURL: String("c"), - ArtifactsURL: String("a"), - CancelURL: String("c"), - RerunURL: String("r"), - PreviousAttemptURL: String("p"), + JobsURL: Ptr("j"), + LogsURL: Ptr("l"), + CheckSuiteURL: Ptr("c"), + ArtifactsURL: Ptr("a"), + CancelURL: Ptr("c"), + RerunURL: Ptr("r"), + PreviousAttemptURL: Ptr("p"), HeadCommit: &HeadCommit{ - Message: String("m"), + Message: Ptr("m"), Author: &CommitAuthor{ - Name: String("n"), - Email: String("e"), - Login: String("l"), + Name: Ptr("n"), + Email: Ptr("e"), + Login: Ptr("l"), }, - URL: String("u"), - Distinct: Bool(false), - SHA: String("s"), - ID: String("i"), - TreeID: String("tid"), + URL: Ptr("u"), + Distinct: Ptr(false), + SHA: Ptr("s"), + ID: Ptr("i"), + TreeID: Ptr("tid"), Timestamp: &Timestamp{referenceTime}, Committer: &CommitAuthor{ - Name: String("n"), - Email: String("e"), - Login: String("l"), + Name: Ptr("n"), + Email: Ptr("e"), + Login: Ptr("l"), }, }, - WorkflowURL: String("w"), + WorkflowURL: Ptr("w"), Repository: &Repository{ - ID: Int64(1), - URL: String("u"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + Name: Ptr("n"), }, HeadRepository: &Repository{ - ID: Int64(1), - URL: String("u"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + Name: Ptr("n"), }, }, Org: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, } @@ -13327,43 +13327,43 @@ func TestWorkflowDispatchEvent_Marshal(t *testing.T) { jsonMsg, _ := json.Marshal(i) u := &WorkflowDispatchEvent{ Inputs: jsonMsg, - Ref: String("r"), - Workflow: String("w"), + Ref: Ptr("r"), + Workflow: Ptr("w"), Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Org: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, } @@ -13419,109 +13419,109 @@ func TestWatchEvent_Marshal(t *testing.T) { testJSONMarshal(t, &WatchEvent{}, "{}") u := &WatchEvent{ - Action: String("a"), + Action: Ptr("a"), Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -13653,36 +13653,36 @@ func TestUserEvent_Marshal(t *testing.T) { u := &UserEvent{ User: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, // The action performed. Possible values are: "created" or "deleted". - Action: String("a"), + Action: Ptr("a"), Enterprise: &Enterprise{ - ID: Int(1), - Slug: String("s"), - Name: String("n"), - NodeID: String("nid"), - AvatarURL: String("au"), - Description: String("d"), - WebsiteURL: String("wu"), - HTMLURL: String("hu"), + ID: Ptr(1), + Slug: Ptr("s"), + Name: Ptr("n"), + NodeID: Ptr("nid"), + AvatarURL: Ptr("au"), + Description: Ptr("d"), + WebsiteURL: Ptr("wu"), + HTMLURL: Ptr("hu"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, } @@ -13729,216 +13729,216 @@ func TestCheckRunEvent_Marshal(t *testing.T) { r := &CheckRunEvent{ CheckRun: &CheckRun{ - ID: Int64(1), - NodeID: String("n"), - HeadSHA: String("h"), - ExternalID: String("1"), - URL: String("u"), - HTMLURL: String("u"), - DetailsURL: String("u"), - Status: String("s"), - Conclusion: String("c"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + HeadSHA: Ptr("h"), + ExternalID: Ptr("1"), + URL: Ptr("u"), + HTMLURL: Ptr("u"), + DetailsURL: Ptr("u"), + Status: Ptr("s"), + Conclusion: Ptr("c"), StartedAt: &Timestamp{referenceTime}, CompletedAt: &Timestamp{referenceTime}, Output: &CheckRunOutput{ Annotations: []*CheckRunAnnotation{ { - AnnotationLevel: String("a"), - EndLine: Int(1), - Message: String("m"), - Path: String("p"), - RawDetails: String("r"), - StartLine: Int(1), - Title: String("t"), + AnnotationLevel: Ptr("a"), + EndLine: Ptr(1), + Message: Ptr("m"), + Path: Ptr("p"), + RawDetails: Ptr("r"), + StartLine: Ptr(1), + Title: Ptr("t"), }, }, - AnnotationsCount: Int(1), - AnnotationsURL: String("a"), + AnnotationsCount: Ptr(1), + AnnotationsURL: Ptr("a"), Images: []*CheckRunImage{ { - Alt: String("a"), - ImageURL: String("i"), - Caption: String("c"), + Alt: Ptr("a"), + ImageURL: Ptr("i"), + Caption: Ptr("c"), }, }, - Title: String("t"), - Summary: String("s"), - Text: String("t"), + Title: Ptr("t"), + Summary: Ptr("s"), + Text: Ptr("t"), }, - Name: String("n"), + Name: Ptr("n"), CheckSuite: &CheckSuite{ - ID: Int64(1), + ID: Ptr(int64(1)), }, App: &App{ - ID: Int64(1), - NodeID: String("n"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), Owner: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, - Name: String("n"), - Description: String("d"), - HTMLURL: String("h"), - ExternalURL: String("u"), + Name: Ptr("n"), + Description: Ptr("d"), + HTMLURL: Ptr("h"), + ExternalURL: Ptr("u"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, }, PullRequests: []*PullRequest{ { - URL: String("u"), - ID: Int64(1), - Number: Int(1), + URL: Ptr("u"), + ID: Ptr(int64(1)), + Number: Ptr(1), Head: &PullRequestBranch{ - Ref: String("r"), - SHA: String("s"), + Ref: Ptr("r"), + SHA: Ptr("s"), Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, }, Base: &PullRequestBranch{ - Ref: String("r"), - SHA: String("s"), + Ref: Ptr("r"), + SHA: Ptr("s"), Repo: &Repository{ - ID: Int64(1), - URL: String("u"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + Name: Ptr("n"), }, }, }, }, }, - Action: String("a"), + Action: Ptr("a"), Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Org: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -14184,191 +14184,191 @@ func TestCheckSuiteEvent_Marshal(t *testing.T) { r := &CheckSuiteEvent{ CheckSuite: &CheckSuite{ - ID: Int64(1), - NodeID: String("n"), - HeadBranch: String("h"), - HeadSHA: String("h"), - URL: String("u"), - BeforeSHA: String("b"), - AfterSHA: String("a"), - Status: String("s"), - Conclusion: String("c"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + HeadBranch: Ptr("h"), + HeadSHA: Ptr("h"), + URL: Ptr("u"), + BeforeSHA: Ptr("b"), + AfterSHA: Ptr("a"), + Status: Ptr("s"), + Conclusion: Ptr("c"), App: &App{ - ID: Int64(1), - NodeID: String("n"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), Owner: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, - Name: String("n"), - Description: String("d"), - HTMLURL: String("h"), - ExternalURL: String("u"), + Name: Ptr("n"), + Description: Ptr("d"), + HTMLURL: Ptr("h"), + ExternalURL: Ptr("u"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, }, Repository: &Repository{ - ID: Int64(1), + ID: Ptr(int64(1)), }, PullRequests: []*PullRequest{ { - URL: String("u"), - ID: Int64(1), - Number: Int(1), + URL: Ptr("u"), + ID: Ptr(int64(1)), + Number: Ptr(1), Head: &PullRequestBranch{ - Ref: String("r"), - SHA: String("s"), + Ref: Ptr("r"), + SHA: Ptr("s"), Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, }, Base: &PullRequestBranch{ - Ref: String("r"), - SHA: String("s"), + Ref: Ptr("r"), + SHA: Ptr("s"), Repo: &Repository{ - ID: Int64(1), - URL: String("u"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + Name: Ptr("n"), }, }, }, }, HeadCommit: &Commit{ - SHA: String("s"), + SHA: Ptr("s"), }, }, - Action: String("a"), + Action: Ptr("a"), Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Org: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -14582,51 +14582,51 @@ func TestDeployKeyEvent_Marshal(t *testing.T) { testJSONMarshal(t, &DeployKeyEvent{}, "{}") u := &DeployKeyEvent{ - Action: String("a"), + Action: Ptr("a"), Key: &Key{ - ID: Int64(1), - Key: String("k"), - URL: String("k"), - Title: String("k"), - ReadOnly: Bool(false), - Verified: Bool(false), + ID: Ptr(int64(1)), + Key: Ptr("k"), + URL: Ptr("k"), + Title: Ptr("k"), + ReadOnly: Ptr(false), + Verified: Ptr(false), CreatedAt: &Timestamp{referenceTime}, }, Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Organization: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - AvatarURL: String("a"), - URL: String("u"), - EventsURL: String("e"), - ReposURL: String("r"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + AvatarURL: Ptr("a"), + URL: Ptr("u"), + EventsURL: Ptr("e"), + ReposURL: Ptr("r"), }, } @@ -14689,25 +14689,25 @@ func TestMetaEvent_Marshal(t *testing.T) { v := make(map[string]interface{}) v["a"] = "b" hookConfig := &HookConfig{ - ContentType: String("json"), + ContentType: Ptr("json"), } u := &MetaEvent{ - Action: String("a"), - HookID: Int64(1), + Action: Ptr("a"), + HookID: Ptr(int64(1)), Hook: &Hook{ CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - URL: String("u"), - ID: Int64(1), - Type: String("t"), - Name: String("n"), - TestURL: String("tu"), - PingURL: String("pu"), + URL: Ptr("u"), + ID: Ptr(int64(1)), + Type: Ptr("t"), + Name: Ptr("n"), + TestURL: Ptr("tu"), + PingURL: Ptr("pu"), LastResponse: v, Config: hookConfig, Events: []string{"a"}, - Active: Bool(true), + Active: Ptr(true), }, } @@ -14759,113 +14759,113 @@ func TestCreateEvent_Marshal(t *testing.T) { testJSONMarshal(t, &CreateEvent{}, "{}") r := &CreateEvent{ - Ref: String("r"), - RefType: String("rt"), - MasterBranch: String("mb"), - Description: String("d"), - PusherType: String("pt"), + Ref: Ptr("r"), + RefType: Ptr("rt"), + MasterBranch: Ptr("mb"), + Description: Ptr("d"), + PusherType: Ptr("pt"), Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -15000,114 +15000,114 @@ func TestCustomPropertyEvent_Marshal(t *testing.T) { testJSONMarshal(t, &CustomPropertyEvent{}, "{}") r := &CustomPropertyEvent{ - Action: String("created"), + Action: Ptr("created"), Definition: &CustomProperty{ - PropertyName: String("name"), + PropertyName: Ptr("name"), ValueType: "single_select", - SourceType: String("enterprise"), - Required: Bool(true), - DefaultValue: String("production"), - Description: String("Prod or dev environment"), + SourceType: Ptr("enterprise"), + Required: Ptr(true), + DefaultValue: Ptr("production"), + Description: Ptr("Prod or dev environment"), AllowedValues: []string{"production", "development"}, - ValuesEditableBy: String("org_actors"), + ValuesEditableBy: Ptr("org_actors"), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -15251,7 +15251,7 @@ func TestCustomPropertyValuesEvent_Marshal(t *testing.T) { testJSONMarshal(t, &CustomPropertyValuesEvent{}, "{}") r := &CustomPropertyValuesEvent{ - Action: String("updated"), + Action: Ptr("updated"), NewPropertyValues: []*CustomPropertyValue{ { PropertyName: "environment", @@ -15265,102 +15265,102 @@ func TestCustomPropertyValuesEvent_Marshal(t *testing.T) { }, }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -15494,111 +15494,111 @@ func TestDeleteEvent_Marshal(t *testing.T) { testJSONMarshal(t, &DeleteEvent{}, "{}") r := &DeleteEvent{ - Ref: String("r"), - RefType: String("rt"), - PusherType: String("pt"), + Ref: Ptr("r"), + RefType: Ptr("rt"), + PusherType: Ptr("pt"), Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -15731,52 +15731,52 @@ func TestDependabotAlertEvent_Marshal(t *testing.T) { testJSONMarshal(t, &DependabotAlertEvent{}, "{}") e := &DependabotAlertEvent{ - Action: String("a"), + Action: Ptr("a"), Alert: &DependabotAlert{ - Number: Int(1), - State: String("s"), + Number: Ptr(1), + State: Ptr("s"), Dependency: &Dependency{ Package: &VulnerabilityPackage{ - Ecosystem: String("e"), - Name: String("n"), + Ecosystem: Ptr("e"), + Name: Ptr("n"), }, - ManifestPath: String("mp"), - Scope: String("s"), + ManifestPath: Ptr("mp"), + Scope: Ptr("s"), }, SecurityAdvisory: &DependabotSecurityAdvisory{ - GHSAID: String("ghsaid"), - CVEID: String("cveid"), - Summary: String("s"), - Description: String("d"), + GHSAID: Ptr("ghsaid"), + CVEID: Ptr("cveid"), + Summary: Ptr("s"), + Description: Ptr("d"), Vulnerabilities: []*AdvisoryVulnerability{ { Package: &VulnerabilityPackage{ - Ecosystem: String("e"), - Name: String("n"), + Ecosystem: Ptr("e"), + Name: Ptr("n"), }, - Severity: String("s"), + Severity: Ptr("s"), }, }, - Severity: String("s"), + Severity: Ptr("s"), CVSS: &AdvisoryCVSS{ - Score: Float64(1.0), - VectorString: String("vs"), + Score: Ptr(1.0), + VectorString: Ptr("vs"), }, CWEs: []*AdvisoryCWEs{ { - CWEID: String("cweid"), - Name: String("n"), + CWEID: Ptr("cweid"), + Name: Ptr("n"), }, }, Identifiers: []*AdvisoryIdentifier{ { - Value: String("v"), - Type: String("t"), + Value: Ptr("v"), + Type: Ptr("t"), }, }, References: []*AdvisoryReference{ { - URL: String("u"), + URL: Ptr("u"), }, }, PublishedAt: &Timestamp{referenceTime}, @@ -15785,170 +15785,170 @@ func TestDependabotAlertEvent_Marshal(t *testing.T) { }, SecurityVulnerability: &AdvisoryVulnerability{ Package: &VulnerabilityPackage{ - Ecosystem: String("e"), - Name: String("n"), + Ecosystem: Ptr("e"), + Name: Ptr("n"), }, - Severity: String("s"), - VulnerableVersionRange: String("vvr"), + Severity: Ptr("s"), + VulnerableVersionRange: Ptr("vvr"), FirstPatchedVersion: &FirstPatchedVersion{ - Identifier: String("i"), + Identifier: Ptr("i"), }, }, - URL: String("u"), - HTMLURL: String("hu"), + URL: Ptr("u"), + HTMLURL: Ptr("hu"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, DismissedAt: &Timestamp{referenceTime}, DismissedBy: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), - }, - DismissedReason: String("dr"), - DismissedComment: String("dc"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), + }, + DismissedReason: Ptr("dr"), + DismissedComment: Ptr("dc"), FixedAt: &Timestamp{referenceTime}, AutoDismissedAt: &Timestamp{referenceTime}, }, Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Organization: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, Enterprise: &Enterprise{ - ID: Int(1), - Slug: String("s"), - Name: String("n"), - NodeID: String("nid"), - AvatarURL: String("au"), - Description: String("d"), - WebsiteURL: String("wu"), - HTMLURL: String("hu"), + ID: Ptr(1), + Slug: Ptr("s"), + Name: Ptr("n"), + NodeID: Ptr("nid"), + AvatarURL: Ptr("au"), + Description: Ptr("d"), + WebsiteURL: Ptr("wu"), + HTMLURL: Ptr("hu"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -16194,112 +16194,112 @@ func TestForkEvent_Marshal(t *testing.T) { u := &ForkEvent{ Forkee: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -16434,15 +16434,15 @@ func TestGitHubAppAuthorizationEvent_Marshal(t *testing.T) { testJSONMarshal(t, &GitHubAppAuthorizationEvent{}, "{}") u := &GitHubAppAuthorizationEvent{ - Action: String("a"), + Action: Ptr("a"), Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, } @@ -16467,111 +16467,111 @@ func TestInstallationEvent_Marshal(t *testing.T) { testJSONMarshal(t, &InstallationEvent{}, "{}") u := &InstallationEvent{ - Action: String("a"), + Action: Ptr("a"), Repositories: []*Repository{ { - ID: Int64(1), - URL: String("u"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + Name: Ptr("n"), }, }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -16704,24 +16704,24 @@ func TestHeadCommit_Marshal(t *testing.T) { testJSONMarshal(t, &HeadCommit{}, "{}") u := &HeadCommit{ - Message: String("m"), + Message: Ptr("m"), Author: &CommitAuthor{ Date: &Timestamp{referenceTime}, - Name: String("n"), - Email: String("e"), - Login: String("u"), - }, - URL: String("u"), - Distinct: Bool(true), - SHA: String("s"), - ID: String("id"), - TreeID: String("tid"), + Name: Ptr("n"), + Email: Ptr("e"), + Login: Ptr("u"), + }, + URL: Ptr("u"), + Distinct: Ptr(true), + SHA: Ptr("s"), + ID: Ptr("id"), + TreeID: Ptr("tid"), Timestamp: &Timestamp{referenceTime}, Committer: &CommitAuthor{ Date: &Timestamp{referenceTime}, - Name: String("n"), - Email: String("e"), - Login: String("u"), + Name: Ptr("n"), + Email: Ptr("e"), + Login: Ptr("u"), }, Added: []string{"a"}, Removed: []string{"r"}, @@ -16767,58 +16767,58 @@ func TestPushEventRepository_Marshal(t *testing.T) { testJSONMarshal(t, &PushEventRepository{}, "{}") u := &PushEventRepository{ - ID: Int64(1), - NodeID: String("nid"), - Name: String("n"), - FullName: String("fn"), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + Name: Ptr("n"), + FullName: Ptr("fn"), Owner: &User{ - Login: String("l"), - ID: Int64(1), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, - URL: String("u"), + URL: Ptr("u"), }, - Private: Bool(true), - Description: String("d"), - Fork: Bool(true), + Private: Ptr(true), + Description: Ptr("d"), + Fork: Ptr(true), CreatedAt: &Timestamp{referenceTime}, PushedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - Homepage: String("h"), - PullsURL: String("p"), - Size: Int(1), - StargazersCount: Int(1), - WatchersCount: Int(1), - Language: String("l"), - HasIssues: Bool(true), - HasDownloads: Bool(true), - HasWiki: Bool(true), - HasPages: Bool(true), - ForksCount: Int(1), - Archived: Bool(true), - Disabled: Bool(true), - OpenIssuesCount: Int(1), - DefaultBranch: String("d"), - MasterBranch: String("m"), - Organization: String("o"), - URL: String("u"), - ArchiveURL: String("a"), - HTMLURL: String("h"), - StatusesURL: String("s"), - GitURL: String("g"), - SSHURL: String("s"), - CloneURL: String("c"), - SVNURL: String("s"), + Homepage: Ptr("h"), + PullsURL: Ptr("p"), + Size: Ptr(1), + StargazersCount: Ptr(1), + WatchersCount: Ptr(1), + Language: Ptr("l"), + HasIssues: Ptr(true), + HasDownloads: Ptr(true), + HasWiki: Ptr(true), + HasPages: Ptr(true), + ForksCount: Ptr(1), + Archived: Ptr(true), + Disabled: Ptr(true), + OpenIssuesCount: Ptr(1), + DefaultBranch: Ptr("d"), + MasterBranch: Ptr("m"), + Organization: Ptr("o"), + URL: Ptr("u"), + ArchiveURL: Ptr("a"), + HTMLURL: Ptr("h"), + StatusesURL: Ptr("s"), + GitURL: Ptr("g"), + SSHURL: Ptr("s"), + CloneURL: Ptr("c"), + SVNURL: Ptr("s"), Topics: []string{"octocat", "api"}, } @@ -16886,8 +16886,8 @@ func TestPushEventRepoOwner_Marshal(t *testing.T) { testJSONMarshal(t, &PushEventRepoOwner{}, "{}") u := &PushEventRepoOwner{ - Name: String("n"), - Email: String("e"), + Name: Ptr("n"), + Email: Ptr("e"), } want := `{ @@ -16903,136 +16903,136 @@ func TestProjectEvent_Marshal(t *testing.T) { testJSONMarshal(t, &ProjectEvent{}, "{}") u := &ProjectEvent{ - Project: &Project{ID: Int64(1)}, - Action: String("a"), + Project: &Project{ID: Ptr(int64(1))}, + Action: Ptr("a"), Changes: &ProjectChange{ - Name: &ProjectName{From: String("NameFrom")}, - Body: &ProjectBody{From: String("BodyFrom")}, + Name: &ProjectName{From: Ptr("NameFrom")}, + Body: &ProjectBody{From: Ptr("BodyFrom")}, }, Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Org: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -17196,136 +17196,136 @@ func TestProjectCardEvent_Marshal(t *testing.T) { testJSONMarshal(t, &ProjectCardEvent{}, "{}") u := &ProjectCardEvent{ - Action: String("a"), + Action: Ptr("a"), Changes: &ProjectCardChange{ - Note: &ProjectCardNote{From: String("NoteFrom")}, + Note: &ProjectCardNote{From: Ptr("NoteFrom")}, }, - AfterID: Int64(1), - ProjectCard: &ProjectCard{ID: Int64(1)}, + AfterID: Ptr(int64(1)), + ProjectCard: &ProjectCard{ID: Ptr(int64(1))}, Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Org: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -17487,136 +17487,136 @@ func TestProjectColumnEvent_Marshal(t *testing.T) { testJSONMarshal(t, &ProjectColumnEvent{}, "{}") u := &ProjectColumnEvent{ - Action: String("a"), + Action: Ptr("a"), Changes: &ProjectColumnChange{ - Name: &ProjectColumnName{From: String("NameFrom")}, + Name: &ProjectColumnName{From: Ptr("NameFrom")}, }, - AfterID: Int64(1), - ProjectColumn: &ProjectColumn{ID: Int64(1)}, + AfterID: Ptr(int64(1)), + ProjectColumn: &ProjectColumn{ID: Ptr(int64(1))}, Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Org: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -17778,101 +17778,101 @@ func TestProjectV2Event_Marshal(t *testing.T) { testJSONMarshal(t, &ProjectV2Event{}, "{}") u := &ProjectV2Event{ - Action: String("a"), + Action: Ptr("a"), ProjectsV2: &ProjectsV2{ - ID: Int64(1), - NodeID: String("nid"), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), Owner: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Creator: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), - }, - Title: String("t"), - Description: String("d"), - Public: Bool(true), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), + }, + Title: Ptr("t"), + Description: Ptr("d"), + Public: Ptr(true), ClosedAt: &Timestamp{referenceTime}, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, DeletedAt: &Timestamp{referenceTime}, - Number: Int(1), - ShortDescription: String("sd"), + Number: Ptr(1), + ShortDescription: Ptr("sd"), DeletedBy: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, }, Org: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -17989,7 +17989,7 @@ func TestProjectV2ItemEvent_Marshal(t *testing.T) { testJSONMarshal(t, &ProjectV2ItemEvent{}, "{}") u := &ProjectV2ItemEvent{ - Action: String("a"), + Action: Ptr("a"), Changes: &ProjectV2ItemChange{ ArchivedAt: &ArchivedAt{ From: &Timestamp{referenceTime}, @@ -17997,78 +17997,78 @@ func TestProjectV2ItemEvent_Marshal(t *testing.T) { }, }, ProjectV2Item: &ProjectV2Item{ - ID: Int64(1), - NodeID: String("nid"), - ProjectNodeID: String("pnid"), - ContentNodeID: String("cnid"), - ContentType: String("ct"), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + ProjectNodeID: Ptr("pnid"), + ContentNodeID: Ptr("cnid"), + ContentType: Ptr("ct"), Creator: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, ArchivedAt: &Timestamp{referenceTime}, }, Org: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -18170,180 +18170,180 @@ func TestPullRequestEvent_Marshal(t *testing.T) { testJSONMarshal(t, &PullRequestEvent{}, "{}") u := &PullRequestEvent{ - Action: String("a"), + Action: Ptr("a"), Assignee: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), - }, - Number: Int(1), - PullRequest: &PullRequest{ID: Int64(1)}, + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), + }, + Number: Ptr(1), + PullRequest: &PullRequest{ID: Ptr(int64(1))}, Changes: &EditChange{ Title: &EditTitle{ - From: String("TitleFrom"), + From: Ptr("TitleFrom"), }, Body: &EditBody{ - From: String("BodyFrom"), + From: Ptr("BodyFrom"), }, Base: &EditBase{ Ref: &EditRef{ - From: String("BaseRefFrom"), + From: Ptr("BaseRefFrom"), }, SHA: &EditSHA{ - From: String("BaseSHAFrom"), + From: Ptr("BaseSHAFrom"), }, }, }, RequestedReviewer: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), - }, - RequestedTeam: &Team{ID: Int64(1)}, - Label: &Label{ID: Int64(1)}, - Before: String("before"), - After: String("after"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), + }, + RequestedTeam: &Team{ID: Ptr(int64(1))}, + Label: &Label{ID: Ptr(int64(1))}, + Before: Ptr("before"), + After: Ptr("after"), Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, PerformedViaGithubApp: &App{ - ID: Int64(1), - NodeID: String("n"), - Slug: String("s"), - Name: String("n"), - Description: String("d"), - ExternalURL: String("e"), - HTMLURL: String("h"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + Slug: Ptr("s"), + Name: Ptr("n"), + Description: Ptr("d"), + ExternalURL: Ptr("e"), + HTMLURL: Ptr("h"), }, Organization: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -18551,127 +18551,127 @@ func TestPullRequestReviewCommentEvent_Marshal(t *testing.T) { testJSONMarshal(t, &PullRequestReviewCommentEvent{}, "{}") u := &PullRequestReviewCommentEvent{ - Action: String("a"), - PullRequest: &PullRequest{ID: Int64(1)}, - Comment: &PullRequestComment{ID: Int64(1)}, + Action: Ptr("a"), + PullRequest: &PullRequest{ID: Ptr(int64(1))}, + Comment: &PullRequestComment{ID: Ptr(int64(1))}, Changes: &EditChange{ Title: &EditTitle{ - From: String("TitleFrom"), + From: Ptr("TitleFrom"), }, Body: &EditBody{ - From: String("BodyFrom"), + From: Ptr("BodyFrom"), }, Base: &EditBase{ Ref: &EditRef{ - From: String("BaseRefFrom"), + From: Ptr("BaseRefFrom"), }, SHA: &EditSHA{ - From: String("BaseSHAFrom"), + From: Ptr("BaseSHAFrom"), }, }, }, Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -18824,113 +18824,113 @@ func TestPullRequestReviewThreadEvent_Marshal(t *testing.T) { testJSONMarshal(t, &PullRequestReviewThreadEvent{}, "{}") u := &PullRequestReviewThreadEvent{ - Action: String("a"), - PullRequest: &PullRequest{ID: Int64(1)}, + Action: Ptr("a"), + PullRequest: &PullRequest{ID: Ptr(int64(1))}, Thread: &PullRequestThread{ - Comments: []*PullRequestComment{{ID: Int64(1)}, {ID: Int64(2)}}, + Comments: []*PullRequestComment{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}}, }, Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -19074,180 +19074,180 @@ func TestPullRequestTargetEvent_Marshal(t *testing.T) { testJSONMarshal(t, &PullRequestTargetEvent{}, "{}") u := &PullRequestTargetEvent{ - Action: String("a"), + Action: Ptr("a"), Assignee: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), - }, - Number: Int(1), - PullRequest: &PullRequest{ID: Int64(1)}, + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), + }, + Number: Ptr(1), + PullRequest: &PullRequest{ID: Ptr(int64(1))}, Changes: &EditChange{ Title: &EditTitle{ - From: String("TitleFrom"), + From: Ptr("TitleFrom"), }, Body: &EditBody{ - From: String("BodyFrom"), + From: Ptr("BodyFrom"), }, Base: &EditBase{ Ref: &EditRef{ - From: String("BaseRefFrom"), + From: Ptr("BaseRefFrom"), }, SHA: &EditSHA{ - From: String("BaseSHAFrom"), + From: Ptr("BaseSHAFrom"), }, }, }, RequestedReviewer: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), - }, - RequestedTeam: &Team{ID: Int64(1)}, - Label: &Label{ID: Int64(1)}, - Before: String("before"), - After: String("after"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), + }, + RequestedTeam: &Team{ID: Ptr(int64(1))}, + Label: &Label{ID: Ptr(int64(1))}, + Before: Ptr("before"), + After: Ptr("after"), Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, PerformedViaGithubApp: &App{ - ID: Int64(1), - NodeID: String("n"), - Slug: String("s"), - Name: String("n"), - Description: String("d"), - ExternalURL: String("e"), - HTMLURL: String("h"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + Slug: Ptr("s"), + Name: Ptr("n"), + Description: Ptr("d"), + ExternalURL: Ptr("e"), + HTMLURL: Ptr("h"), }, Organization: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -19455,30 +19455,30 @@ func TestRepositoryVulnerabilityAlertEvent_Marshal(t *testing.T) { testJSONMarshal(t, &RepositoryVulnerabilityAlertEvent{}, "{}") u := &RepositoryVulnerabilityAlertEvent{ - Action: String("a"), + Action: Ptr("a"), Alert: &RepositoryVulnerabilityAlert{ - ID: Int64(1), - AffectedRange: String("ar"), - AffectedPackageName: String("apn"), - ExternalReference: String("er"), - ExternalIdentifier: String("ei"), - FixedIn: String("fi"), + ID: Ptr(int64(1)), + AffectedRange: Ptr("ar"), + AffectedPackageName: Ptr("apn"), + ExternalReference: Ptr("er"), + ExternalIdentifier: Ptr("ei"), + FixedIn: Ptr("fi"), Dismisser: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), - }, - DismissReason: String("dr"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), + }, + DismissReason: Ptr("dr"), DismissedAt: &Timestamp{referenceTime}, }, Repository: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, } @@ -19518,158 +19518,158 @@ func TestSecretScanningAlertEvent_Marshal(t *testing.T) { testJSONMarshal(t, &SecretScanningAlertEvent{}, "{}") u := &SecretScanningAlertEvent{ - Action: String("a"), + Action: Ptr("a"), Alert: &SecretScanningAlert{ - Number: Int(1), - SecretType: String("t"), - Resolution: String("r"), + Number: Ptr(1), + SecretType: Ptr("t"), + Resolution: Ptr("r"), ResolvedBy: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, ResolvedAt: &Timestamp{referenceTime}, }, Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Organization: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, Enterprise: &Enterprise{ - ID: Int(1), - Slug: String("s"), - Name: String("n"), - NodeID: String("nid"), - AvatarURL: String("au"), - Description: String("d"), - WebsiteURL: String("wu"), - HTMLURL: String("hu"), + ID: Ptr(1), + Slug: Ptr("s"), + Name: Ptr("n"), + NodeID: Ptr("nid"), + AvatarURL: Ptr("au"), + Description: Ptr("d"), + WebsiteURL: Ptr("wu"), + HTMLURL: Ptr("hu"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -19848,44 +19848,44 @@ func TestSecretScanningAlertLocationEvent_Marshal(t *testing.T) { t.Parallel() testJSONMarshal(t, &SecretScanningAlertLocationEvent{}, "{}") u := &SecretScanningAlertLocationEvent{ - Action: String("created"), + Action: Ptr("created"), Alert: &SecretScanningAlert{ - Number: Int(10), + Number: Ptr(10), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - URL: String("a"), - HTMLURL: String("a"), - SecretType: String("mailchimp_api_key"), + URL: Ptr("a"), + HTMLURL: Ptr("a"), + SecretType: Ptr("mailchimp_api_key"), }, Location: &SecretScanningAlertLocation{ - Type: String("blob"), + Type: Ptr("blob"), Details: &SecretScanningAlertLocationDetails{ - Path: String("path/to/file"), - Startline: Int(10), - EndLine: Int(20), - StartColumn: Int(1), - EndColumn: Int(2), - BlobSHA: String("d6e4c75c141dbacecc279b721b8bsomeSHA"), - BlobURL: String("a"), - CommitSHA: String("d6e4c75c141dbacecc279b721b8bsomeSHA"), - CommitURL: String("a"), + Path: Ptr("path/to/file"), + Startline: Ptr(10), + EndLine: Ptr(20), + StartColumn: Ptr(1), + EndColumn: Ptr(2), + BlobSHA: Ptr("d6e4c75c141dbacecc279b721b8bsomeSHA"), + BlobURL: Ptr("a"), + CommitSHA: Ptr("d6e4c75c141dbacecc279b721b8bsomeSHA"), + CommitURL: Ptr("a"), }, }, Repo: &Repository{ - ID: Int64(12345), - NodeID: String("MDEwOlJlcG9zaXRvcnkxMjM0NQ=="), - Name: String("example-repo"), + ID: Ptr(int64(12345)), + NodeID: Ptr("MDEwOlJlcG9zaXRvcnkxMjM0NQ=="), + Name: Ptr("example-repo"), }, Organization: &Organization{ - Login: String("example-org"), - ID: Int64(67890), + Login: Ptr("example-org"), + ID: Ptr(int64(67890)), }, Sender: &User{ - Login: String("example-user"), - ID: Int64(1111), + Login: Ptr("example-user"), + ID: Ptr(int64(1111)), }, Installation: &Installation{ - ID: Int64(2222), + ID: Ptr(int64(2222)), }, } @@ -19940,31 +19940,31 @@ func TestSecurityAdvisoryEvent_Marshal(t *testing.T) { t.Parallel() testJSONMarshal(t, &SecurityAdvisoryEvent{}, "{}") u := &SecurityAdvisoryEvent{ - Action: String("published"), + Action: Ptr("published"), SecurityAdvisory: &SecurityAdvisory{ CVSS: &AdvisoryCVSS{ - Score: Float64(1.0), - VectorString: String("vs"), + Score: Ptr(1.0), + VectorString: Ptr("vs"), }, CWEs: []*AdvisoryCWEs{ { - CWEID: String("cweid"), - Name: String("n"), + CWEID: Ptr("cweid"), + Name: Ptr("n"), }, }, - GHSAID: String("GHSA-rf4j-j272-some"), - Summary: String("Siuuuuuuuuu"), - Description: String("desc"), - Severity: String("moderate"), + GHSAID: Ptr("GHSA-rf4j-j272-some"), + Summary: Ptr("Siuuuuuuuuu"), + Description: Ptr("desc"), + Severity: Ptr("moderate"), Identifiers: []*AdvisoryIdentifier{ { - Value: String("GHSA-rf4j-j272-some"), - Type: String("GHSA"), + Value: Ptr("GHSA-rf4j-j272-some"), + Type: Ptr("GHSA"), }, }, References: []*AdvisoryReference{ { - URL: String("https://some-url"), + URL: Ptr("https://some-url"), }, }, PublishedAt: &Timestamp{referenceTime}, @@ -19973,157 +19973,157 @@ func TestSecurityAdvisoryEvent_Marshal(t *testing.T) { Vulnerabilities: []*AdvisoryVulnerability{ { Package: &VulnerabilityPackage{ - Ecosystem: String("ucl"), - Name: String("penaldo"), + Ecosystem: Ptr("ucl"), + Name: Ptr("penaldo"), }, - Severity: String("moderate"), - VulnerableVersionRange: String(">= 2.0.0, < 2.0.2"), + Severity: Ptr("moderate"), + VulnerableVersionRange: Ptr(">= 2.0.0, < 2.0.2"), FirstPatchedVersion: &FirstPatchedVersion{ - Identifier: String("2.0.2"), + Identifier: Ptr("2.0.2"), }, }, }, }, Enterprise: &Enterprise{ - ID: Int(1), - Slug: String("s"), - Name: String("n"), - NodeID: String("nid"), - AvatarURL: String("au"), - Description: String("d"), - WebsiteURL: String("wu"), - HTMLURL: String("hu"), + ID: Ptr(1), + Slug: Ptr("s"), + Name: Ptr("n"), + NodeID: Ptr("nid"), + AvatarURL: Ptr("au"), + Description: Ptr("d"), + WebsiteURL: Ptr("wu"), + HTMLURL: Ptr("hu"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, SuspendedAt: &Timestamp{referenceTime}, }, Organization: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, Repository: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, } @@ -20331,160 +20331,160 @@ func TestSecurityAndAnalysisEvent_Marshal(t *testing.T) { From: &SecurityAndAnalysisChangeFrom{ SecurityAndAnalysis: &SecurityAndAnalysis{ AdvancedSecurity: &AdvancedSecurity{ - Status: String("enabled"), + Status: Ptr("enabled"), }, SecretScanning: &SecretScanning{ - Status: String("enabled"), + Status: Ptr("enabled"), }, SecretScanningPushProtection: &SecretScanningPushProtection{ - Status: String("enabled"), + Status: Ptr("enabled"), }, DependabotSecurityUpdates: &DependabotSecurityUpdates{ - Status: String("enabled"), + Status: Ptr("enabled"), }, }, }, }, Enterprise: &Enterprise{ - ID: Int(1), - Slug: String("s"), - Name: String("n"), - NodeID: String("nid"), - AvatarURL: String("au"), - Description: String("d"), - WebsiteURL: String("wu"), - HTMLURL: String("hu"), + ID: Ptr(1), + Slug: Ptr("s"), + Name: Ptr("n"), + NodeID: Ptr("nid"), + AvatarURL: Ptr("au"), + Description: Ptr("d"), + WebsiteURL: Ptr("wu"), + HTMLURL: Ptr("hu"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, }, Installation: &Installation{ - ID: Int64(1), - NodeID: String("nid"), - AppID: Int64(1), - AppSlug: String("as"), - TargetID: Int64(1), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("as"), + TargetID: Ptr(int64(1)), Account: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - AccessTokensURL: String("atu"), - RepositoriesURL: String("ru"), - HTMLURL: String("hu"), - TargetType: String("tt"), - SingleFileName: String("sfn"), - RepositorySelection: String("rs"), + AccessTokensURL: Ptr("atu"), + RepositoriesURL: Ptr("ru"), + HTMLURL: Ptr("hu"), + TargetType: Ptr("tt"), + SingleFileName: Ptr("sfn"), + RepositorySelection: Ptr("rs"), Events: []string{"e"}, SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ - Actions: String("a"), - Administration: String("ad"), - Checks: String("c"), - Contents: String("co"), - ContentReferences: String("cr"), - Deployments: String("d"), - Environments: String("e"), - Issues: String("i"), - Metadata: String("md"), - Members: String("m"), - OrganizationAdministration: String("oa"), - OrganizationHooks: String("oh"), - OrganizationPlan: String("op"), - OrganizationPreReceiveHooks: String("opr"), - OrganizationProjects: String("op"), - OrganizationSecrets: String("os"), - OrganizationSelfHostedRunners: String("osh"), - OrganizationUserBlocking: String("oub"), - Packages: String("pkg"), - Pages: String("pg"), - PullRequests: String("pr"), - RepositoryHooks: String("rh"), - RepositoryProjects: String("rp"), - RepositoryPreReceiveHooks: String("rprh"), - Secrets: String("s"), - SecretScanningAlerts: String("ssa"), - SecurityEvents: String("se"), - SingleFile: String("sf"), - Statuses: String("s"), - TeamDiscussions: String("td"), - VulnerabilityAlerts: String("va"), - Workflows: String("w"), + Actions: Ptr("a"), + Administration: Ptr("ad"), + Checks: Ptr("c"), + Contents: Ptr("co"), + ContentReferences: Ptr("cr"), + Deployments: Ptr("d"), + Environments: Ptr("e"), + Issues: Ptr("i"), + Metadata: Ptr("md"), + Members: Ptr("m"), + OrganizationAdministration: Ptr("oa"), + OrganizationHooks: Ptr("oh"), + OrganizationPlan: Ptr("op"), + OrganizationPreReceiveHooks: Ptr("opr"), + OrganizationProjects: Ptr("op"), + OrganizationSecrets: Ptr("os"), + OrganizationSelfHostedRunners: Ptr("osh"), + OrganizationUserBlocking: Ptr("oub"), + Packages: Ptr("pkg"), + Pages: Ptr("pg"), + PullRequests: Ptr("pr"), + RepositoryHooks: Ptr("rh"), + RepositoryProjects: Ptr("rp"), + RepositoryPreReceiveHooks: Ptr("rprh"), + Secrets: Ptr("s"), + SecretScanningAlerts: Ptr("ssa"), + SecurityEvents: Ptr("se"), + SingleFile: Ptr("sf"), + Statuses: Ptr("s"), + TeamDiscussions: Ptr("td"), + VulnerabilityAlerts: Ptr("va"), + Workflows: Ptr("w"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, SuspendedAt: &Timestamp{referenceTime}, }, Organization: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, Repository: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), }, Sender: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, } @@ -20663,167 +20663,167 @@ func TestCodeScanningAlertEvent_Marshal(t *testing.T) { testJSONMarshal(t, &CodeScanningAlertEvent{}, "{}") u := &CodeScanningAlertEvent{ - Action: String("reopened"), + Action: Ptr("reopened"), Alert: &Alert{ - Number: Int(10), + Number: Ptr(10), Rule: &Rule{ - ID: String("Style/FrozenStringLiteralComment"), - Severity: String("note"), - Description: String("desc"), - FullDescription: String("full desc"), + ID: Ptr("Style/FrozenStringLiteralComment"), + Severity: Ptr("note"), + Description: Ptr("desc"), + FullDescription: Ptr("full desc"), Tags: []string{"style"}, - Help: String("help"), + Help: Ptr("help"), }, Tool: &Tool{ - Name: String("Rubocop"), + Name: Ptr("Rubocop"), Version: nil, }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, FixedAt: nil, - State: String("open"), - URL: String("a"), - HTMLURL: String("a"), + State: Ptr("open"), + URL: Ptr("a"), + HTMLURL: Ptr("a"), Instances: []*MostRecentInstance{ { - Ref: String("refs/heads/main"), - AnalysisKey: String(".github/workflows/workflow.yml:upload"), - Environment: String("{}"), - State: String("open"), + Ref: Ptr("refs/heads/main"), + AnalysisKey: Ptr(".github/workflows/workflow.yml:upload"), + Environment: Ptr("{}"), + State: Ptr("open"), }, }, DismissedBy: nil, DismissedAt: nil, DismissedReason: nil, }, - Ref: String("refs/heads/main"), - CommitOID: String("d6e4c75c141dbacecc279b721b8bsomeSHA"), + Ref: Ptr("refs/heads/main"), + CommitOID: Ptr("d6e4c75c141dbacecc279b721b8bsomeSHA"), Repo: &Repository{ - ID: Int64(1234234535), - NodeID: String("MDEwOlJlcG9zaXRvcnkxODY4NT=="), + ID: Ptr(int64(1234234535)), + NodeID: Ptr("MDEwOlJlcG9zaXRvcnkxODY4NT=="), Owner: &User{ - Login: String("Codertocat"), - ID: Int64(21031067), - NodeID: String("MDQ6VXNlcjIxMDMxMDY3"), - AvatarURL: String("a"), - GravatarID: String(""), - URL: String("a"), - HTMLURL: String("a"), - Type: String("User"), - SiteAdmin: Bool(false), - FollowersURL: String("a"), - FollowingURL: String("a"), - EventsURL: String("a"), - GistsURL: String("a"), - OrganizationsURL: String("a"), - ReceivedEventsURL: String("a"), - ReposURL: String("a"), - StarredURL: String("a"), - SubscriptionsURL: String("a"), - }, - HTMLURL: String("a"), - Name: String("Hello-World"), - FullName: String("Codertocat/Hello-World"), + Login: Ptr("Codertocat"), + ID: Ptr(int64(21031067)), + NodeID: Ptr("MDQ6VXNlcjIxMDMxMDY3"), + AvatarURL: Ptr("a"), + GravatarID: Ptr(""), + URL: Ptr("a"), + HTMLURL: Ptr("a"), + Type: Ptr("User"), + SiteAdmin: Ptr(false), + FollowersURL: Ptr("a"), + FollowingURL: Ptr("a"), + EventsURL: Ptr("a"), + GistsURL: Ptr("a"), + OrganizationsURL: Ptr("a"), + ReceivedEventsURL: Ptr("a"), + ReposURL: Ptr("a"), + StarredURL: Ptr("a"), + SubscriptionsURL: Ptr("a"), + }, + HTMLURL: Ptr("a"), + Name: Ptr("Hello-World"), + FullName: Ptr("Codertocat/Hello-World"), Description: nil, - Fork: Bool(false), + Fork: Ptr(false), Homepage: nil, - DefaultBranch: String("main"), + DefaultBranch: Ptr("main"), CreatedAt: &Timestamp{referenceTime}, PushedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - CloneURL: String("a"), - GitURL: String("a"), + CloneURL: Ptr("a"), + GitURL: Ptr("a"), MirrorURL: nil, - SSHURL: String("a"), - SVNURL: String("a"), + SSHURL: Ptr("a"), + SVNURL: Ptr("a"), Language: nil, - ForksCount: Int(0), - OpenIssuesCount: Int(2), - OpenIssues: Int(2), - StargazersCount: Int(0), - WatchersCount: Int(0), - Watchers: Int(0), - Size: Int(0), - Archived: Bool(false), - Disabled: Bool(false), + ForksCount: Ptr(0), + OpenIssuesCount: Ptr(2), + OpenIssues: Ptr(2), + StargazersCount: Ptr(0), + WatchersCount: Ptr(0), + Watchers: Ptr(0), + Size: Ptr(0), + Archived: Ptr(false), + Disabled: Ptr(false), License: nil, - Private: Bool(false), - HasIssues: Bool(true), - HasWiki: Bool(true), - HasPages: Bool(true), - HasProjects: Bool(true), - HasDownloads: Bool(true), - URL: String("a"), - ArchiveURL: String("a"), - AssigneesURL: String("a"), - BlobsURL: String("a"), - BranchesURL: String("a"), - CollaboratorsURL: String("a"), - CommentsURL: String("a"), - CommitsURL: String("a"), - CompareURL: String("a"), - ContentsURL: String("a"), - ContributorsURL: String("a"), - DeploymentsURL: String("a"), - DownloadsURL: String("a"), - EventsURL: String("a"), - ForksURL: String("a"), - GitCommitsURL: String("a"), - GitRefsURL: String("a"), - GitTagsURL: String("a"), - HooksURL: String("a"), - IssueCommentURL: String("a"), - IssueEventsURL: String("a"), - IssuesURL: String("a"), - KeysURL: String("a"), - LabelsURL: String("a"), - LanguagesURL: String("a"), - MergesURL: String("a"), - MilestonesURL: String("a"), - NotificationsURL: String("a"), - PullsURL: String("a"), - ReleasesURL: String("a"), - StargazersURL: String("a"), - StatusesURL: String("a"), - SubscribersURL: String("a"), - SubscriptionURL: String("a"), - TagsURL: String("a"), - TreesURL: String("a"), - TeamsURL: String("a"), + Private: Ptr(false), + HasIssues: Ptr(true), + HasWiki: Ptr(true), + HasPages: Ptr(true), + HasProjects: Ptr(true), + HasDownloads: Ptr(true), + URL: Ptr("a"), + ArchiveURL: Ptr("a"), + AssigneesURL: Ptr("a"), + BlobsURL: Ptr("a"), + BranchesURL: Ptr("a"), + CollaboratorsURL: Ptr("a"), + CommentsURL: Ptr("a"), + CommitsURL: Ptr("a"), + CompareURL: Ptr("a"), + ContentsURL: Ptr("a"), + ContributorsURL: Ptr("a"), + DeploymentsURL: Ptr("a"), + DownloadsURL: Ptr("a"), + EventsURL: Ptr("a"), + ForksURL: Ptr("a"), + GitCommitsURL: Ptr("a"), + GitRefsURL: Ptr("a"), + GitTagsURL: Ptr("a"), + HooksURL: Ptr("a"), + IssueCommentURL: Ptr("a"), + IssueEventsURL: Ptr("a"), + IssuesURL: Ptr("a"), + KeysURL: Ptr("a"), + LabelsURL: Ptr("a"), + LanguagesURL: Ptr("a"), + MergesURL: Ptr("a"), + MilestonesURL: Ptr("a"), + NotificationsURL: Ptr("a"), + PullsURL: Ptr("a"), + ReleasesURL: Ptr("a"), + StargazersURL: Ptr("a"), + StatusesURL: Ptr("a"), + SubscribersURL: Ptr("a"), + SubscriptionURL: Ptr("a"), + TagsURL: Ptr("a"), + TreesURL: Ptr("a"), + TeamsURL: Ptr("a"), }, Org: &Organization{ - Login: String("Octocoders"), - ID: Int64(6), - NodeID: String("MDEyOk9yZ2FuaXphdGlvbjY="), - AvatarURL: String("a"), - Description: String(""), - URL: String("a"), - EventsURL: String("a"), - HooksURL: String("a"), - IssuesURL: String("a"), - MembersURL: String("a"), - PublicMembersURL: String("a"), - ReposURL: String("a"), + Login: Ptr("Octocoders"), + ID: Ptr(int64(6)), + NodeID: Ptr("MDEyOk9yZ2FuaXphdGlvbjY="), + AvatarURL: Ptr("a"), + Description: Ptr(""), + URL: Ptr("a"), + EventsURL: Ptr("a"), + HooksURL: Ptr("a"), + IssuesURL: Ptr("a"), + MembersURL: Ptr("a"), + PublicMembersURL: Ptr("a"), + ReposURL: Ptr("a"), }, Sender: &User{ - Login: String("github"), - ID: Int64(9919), - NodeID: String("MDEyOk9yZ2FuaXphdGlvbjk5MTk="), - AvatarURL: String("a"), - HTMLURL: String("a"), - GravatarID: String(""), - Type: String("Organization"), - SiteAdmin: Bool(false), - URL: String("a"), - EventsURL: String("a"), - FollowingURL: String("a"), - FollowersURL: String("a"), - GistsURL: String("a"), - OrganizationsURL: String("a"), - ReceivedEventsURL: String("a"), - ReposURL: String("a"), - StarredURL: String("a"), - SubscriptionsURL: String("a"), + Login: Ptr("github"), + ID: Ptr(int64(9919)), + NodeID: Ptr("MDEyOk9yZ2FuaXphdGlvbjk5MTk="), + AvatarURL: Ptr("a"), + HTMLURL: Ptr("a"), + GravatarID: Ptr(""), + Type: Ptr("Organization"), + SiteAdmin: Ptr(false), + URL: Ptr("a"), + EventsURL: Ptr("a"), + FollowingURL: Ptr("a"), + FollowersURL: Ptr("a"), + GistsURL: Ptr("a"), + OrganizationsURL: Ptr("a"), + ReceivedEventsURL: Ptr("a"), + ReposURL: Ptr("a"), + StarredURL: Ptr("a"), + SubscriptionsURL: Ptr("a"), }, } @@ -21003,29 +21003,29 @@ func TestSponsorshipEvent_Marshal(t *testing.T) { testJSONMarshal(t, &SponsorshipEvent{}, "{}") u := &SponsorshipEvent{ - Action: String("created"), - EffectiveDate: String("2023-01-01T00:00:00Z"), + Action: Ptr("created"), + EffectiveDate: Ptr("2023-01-01T00:00:00Z"), Changes: &SponsorshipChanges{ Tier: &SponsorshipTier{ - From: String("basic"), + From: Ptr("basic"), }, - PrivacyLevel: String("public"), + PrivacyLevel: Ptr("public"), }, Repository: &Repository{ - ID: Int64(12345), - NodeID: String("MDEwOlJlcG9zaXRvcnkxMjM0NQ=="), - Name: String("example-repo"), + ID: Ptr(int64(12345)), + NodeID: Ptr("MDEwOlJlcG9zaXRvcnkxMjM0NQ=="), + Name: Ptr("example-repo"), }, Organization: &Organization{ - Login: String("example-org"), - ID: Int64(67890), + Login: Ptr("example-org"), + ID: Ptr(int64(67890)), }, Sender: &User{ - Login: String("example-user"), - ID: Int64(1111), + Login: Ptr("example-user"), + ID: Ptr(int64(1111)), }, Installation: &Installation{ - ID: Int64(2222), + ID: Ptr(int64(2222)), }, } @@ -21065,9 +21065,9 @@ func TestSponsorshipChanges_Marshal(t *testing.T) { u := &SponsorshipChanges{ Tier: &SponsorshipTier{ - From: String("premium"), + From: Ptr("premium"), }, - PrivacyLevel: String("private"), + PrivacyLevel: Ptr("private"), } want := `{ @@ -21085,7 +21085,7 @@ func TestSponsorshipTier_Marshal(t *testing.T) { testJSONMarshal(t, &SponsorshipTier{}, "{}") u := &SponsorshipTier{ - From: String("gold"), + From: Ptr("gold"), } want := `{ diff --git a/github/examples_test.go b/github/examples_test.go index ccb0fd6bafe..29caa27c738 100644 --- a/github/examples_test.go +++ b/github/examples_test.go @@ -81,10 +81,10 @@ func ExampleRepositoriesService_CreateFile() { // Note: the file needs to be absent from the repository as you are not // specifying a SHA reference here. opts := &github.RepositoryContentFileOptions{ - Message: github.String("This is my commit message"), + Message: github.Ptr("This is my commit message"), Content: fileContent, - Branch: github.String("master"), - Committer: &github.CommitAuthor{Name: github.String("FirstName LastName"), Email: github.String("user@example.com")}, + Branch: github.Ptr("master"), + Committer: &github.CommitAuthor{Name: github.Ptr("FirstName LastName"), Email: github.Ptr("user@example.com")}, } _, _, err := client.Repositories.CreateFile(ctx, "myOrganization", "myRepository", "myNewFile.md", opts) if err != nil { @@ -121,11 +121,11 @@ func ExamplePullRequestsService_Create() { client := github.NewClient(nil) newPR := &github.NewPullRequest{ - Title: github.String("My awesome pull request"), - Head: github.String("branch_to_merge"), - Base: github.String("master"), - Body: github.String("This is the description of the PR created with the package `github.com/google/go-github/github`"), - MaintainerCanModify: github.Bool(true), + Title: github.Ptr("My awesome pull request"), + Head: github.Ptr("branch_to_merge"), + Base: github.Ptr("master"), + Body: github.Ptr("This is the description of the PR created with the package `github.com/google/go-github/github`"), + MaintainerCanModify: github.Ptr(true), } ctx := context.Background() diff --git a/github/gen-stringify-test.go b/github/gen-stringify-test.go index cbcea53233b..6c887a0ca2c 100644 --- a/github/gen-stringify-test.go +++ b/github/gen-stringify-test.go @@ -54,13 +54,13 @@ var ( }, "processZeroValue": func(v string) string { switch v { - case "Bool(false)": + case "Ptr(false)": return "false" - case "Float64(0.0)": + case "Ptr(0.0)": return "0" - case "0", "Int(0)", "Int64(0)": + case "0", "Ptr(0)", "Ptr(int64(0))": return "0" - case `""`, `String("")`: + case `""`, `Ptr("")`: return `""` case "Timestamp{}", "&Timestamp{}": return "github.Timestamp{0001-01-01 00:00:00 +0000 UTC}" @@ -276,15 +276,15 @@ func (t *templateData) addIdentPtr(x *ast.Ident, receiverType, fieldName string) var namedStruct = false switch x.String() { case "int": - zeroValue = "Int(0)" + zeroValue = "Ptr(0)" case "int64": - zeroValue = "Int64(0)" + zeroValue = "Ptr(int64(0))" case "float64": - zeroValue = "Float64(0.0)" + zeroValue = "Ptr(0.0)" case "string": - zeroValue = `String("")` + zeroValue = `Ptr("")` case "bool": - zeroValue = "Bool(false)" + zeroValue = "Ptr(false)" case "Timestamp": zeroValue = "&Timestamp{}" default: @@ -400,7 +400,6 @@ import ( {{end -}} ) {{end}} -func Float64(v float64) *float64 { return &v } {{range $key, $value := .StructFields}} func Test{{ $key }}_String(t *testing.T) { t.Parallel() diff --git a/github/gists_comments_test.go b/github/gists_comments_test.go index a6a0a5cd1fc..94c07a8c5fe 100644 --- a/github/gists_comments_test.go +++ b/github/gists_comments_test.go @@ -23,25 +23,25 @@ func TestGistComments_Marshal(t *testing.T) { createdAt := time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC) u := &GistComment{ - ID: Int64(1), - URL: String("u"), - Body: String("test gist comment"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + Body: Ptr("test gist comment"), User: &User{ - Login: String("ll"), - ID: Int64(123), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("ll"), + ID: Ptr(int64(123)), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, - URL: String("u"), + URL: Ptr("u"), }, CreatedAt: &Timestamp{createdAt}, } @@ -89,7 +89,7 @@ func TestGistsService_ListComments(t *testing.T) { t.Errorf("Gists.Comments returned error: %v", err) } - want := []*GistComment{{ID: Int64(1)}} + want := []*GistComment{{ID: Ptr(int64(1))}} if !cmp.Equal(comments, want) { t.Errorf("Gists.ListComments returned %+v, want %+v", comments, want) } @@ -133,7 +133,7 @@ func TestGistsService_GetComment(t *testing.T) { t.Errorf("Gists.GetComment returned error: %v", err) } - want := &GistComment{ID: Int64(1)} + want := &GistComment{ID: Ptr(int64(1))} if !cmp.Equal(comment, want) { t.Errorf("Gists.GetComment returned %+v, want %+v", comment, want) } @@ -166,7 +166,7 @@ func TestGistsService_CreateComment(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &GistComment{ID: Int64(1), Body: String("b")} + input := &GistComment{ID: Ptr(int64(1)), Body: Ptr("b")} mux.HandleFunc("/gists/1/comments", func(w http.ResponseWriter, r *http.Request) { v := new(GistComment) @@ -186,7 +186,7 @@ func TestGistsService_CreateComment(t *testing.T) { t.Errorf("Gists.CreateComment returned error: %v", err) } - want := &GistComment{ID: Int64(1)} + want := &GistComment{ID: Ptr(int64(1))} if !cmp.Equal(comment, want) { t.Errorf("Gists.CreateComment returned %+v, want %+v", comment, want) } @@ -219,7 +219,7 @@ func TestGistsService_EditComment(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &GistComment{ID: Int64(1), Body: String("b")} + input := &GistComment{ID: Ptr(int64(1)), Body: Ptr("b")} mux.HandleFunc("/gists/1/comments/2", func(w http.ResponseWriter, r *http.Request) { v := new(GistComment) @@ -239,7 +239,7 @@ func TestGistsService_EditComment(t *testing.T) { t.Errorf("Gists.EditComment returned error: %v", err) } - want := &GistComment{ID: Int64(1)} + want := &GistComment{ID: Ptr(int64(1))} if !cmp.Equal(comment, want) { t.Errorf("Gists.EditComment returned %+v, want %+v", comment, want) } diff --git a/github/gists_test.go b/github/gists_test.go index 26c0a2bd8d1..c6ee6d0f661 100644 --- a/github/gists_test.go +++ b/github/gists_test.go @@ -24,43 +24,43 @@ func TestGist_Marshal(t *testing.T) { updatedAt := time.Date(2010, time.February, 10, 10, 10, 0, 0, time.UTC) u := &Gist{ - ID: String("i"), - Description: String("description"), - Public: Bool(true), + ID: Ptr("i"), + Description: Ptr("description"), + Public: Ptr(true), Owner: &User{ - Login: String("ll"), - ID: Int64(123), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("ll"), + ID: Ptr(int64(123)), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, - URL: String("u"), + URL: Ptr("u"), }, Files: map[GistFilename]GistFile{ "gistfile.py": { - Size: Int(167), - Filename: String("gistfile.py"), - Language: String("Python"), - Type: String("application/x-python"), - RawURL: String("raw-url"), - Content: String("c"), + Size: Ptr(167), + Filename: Ptr("gistfile.py"), + Language: Ptr("Python"), + Type: Ptr("application/x-python"), + RawURL: Ptr("raw-url"), + Content: Ptr("c"), }, }, - Comments: Int(1), - HTMLURL: String("html-url"), - GitPullURL: String("gitpull-url"), - GitPushURL: String("gitpush-url"), + Comments: Ptr(1), + HTMLURL: Ptr("html-url"), + GitPullURL: Ptr("gitpull-url"), + GitPushURL: Ptr("gitpush-url"), CreatedAt: &Timestamp{createdAt}, UpdatedAt: &Timestamp{updatedAt}, - NodeID: String("node"), + NodeID: Ptr("node"), } want := `{ @@ -111,32 +111,32 @@ func TestGistCommit_Marshal(t *testing.T) { testJSONMarshal(t, &GistCommit{}, "{}") u := &GistCommit{ - URL: String("u"), - Version: String("v"), + URL: Ptr("u"), + Version: Ptr("v"), User: &User{ - Login: String("ll"), - ID: Int64(123), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("ll"), + ID: Ptr(int64(123)), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, - URL: String("u"), + URL: Ptr("u"), }, ChangeStatus: &CommitStats{ - Additions: Int(1), - Deletions: Int(1), - Total: Int(2), + Additions: Ptr(1), + Deletions: Ptr(1), + Total: Ptr(2), }, CommittedAt: &Timestamp{referenceTime}, - NodeID: String("node"), + NodeID: Ptr("node"), } want := `{ @@ -176,28 +176,28 @@ func TestGistFork_Marshal(t *testing.T) { testJSONMarshal(t, &GistFork{}, "{}") u := &GistFork{ - URL: String("u"), + URL: Ptr("u"), User: &User{ - Login: String("ll"), - ID: Int64(123), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("ll"), + ID: Ptr(int64(123)), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, - URL: String("u"), + URL: Ptr("u"), }, - ID: String("id"), + ID: Ptr("id"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - NodeID: String("node"), + NodeID: Ptr("node"), } want := `{ @@ -249,7 +249,7 @@ func TestGistsService_List_specifiedUser(t *testing.T) { t.Errorf("Gists.List returned error: %v", err) } - want := []*Gist{{ID: String("1")}} + want := []*Gist{{ID: Ptr("1")}} if !cmp.Equal(gists, want) { t.Errorf("Gists.List returned %+v, want %+v", gists, want) } @@ -284,7 +284,7 @@ func TestGistsService_List_authenticatedUser(t *testing.T) { t.Errorf("Gists.List returned error: %v", err) } - want := []*Gist{{ID: String("1")}} + want := []*Gist{{ID: Ptr("1")}} if !cmp.Equal(gists, want) { t.Errorf("Gists.List returned %+v, want %+v", gists, want) } @@ -334,7 +334,7 @@ func TestGistsService_ListAll(t *testing.T) { t.Errorf("Gists.ListAll returned error: %v", err) } - want := []*Gist{{ID: String("1")}} + want := []*Gist{{ID: Ptr("1")}} if !cmp.Equal(gists, want) { t.Errorf("Gists.ListAll returned %+v, want %+v", gists, want) } @@ -370,7 +370,7 @@ func TestGistsService_ListStarred(t *testing.T) { t.Errorf("Gists.ListStarred returned error: %v", err) } - want := []*Gist{{ID: String("1")}} + want := []*Gist{{ID: Ptr("1")}} if !cmp.Equal(gists, want) { t.Errorf("Gists.ListStarred returned %+v, want %+v", gists, want) } @@ -400,7 +400,7 @@ func TestGistsService_Get(t *testing.T) { t.Errorf("Gists.Get returned error: %v", err) } - want := &Gist{ID: String("1")} + want := &Gist{ID: Ptr("1")} if !cmp.Equal(gist, want) { t.Errorf("Gists.Get returned %+v, want %+v", gist, want) } @@ -444,7 +444,7 @@ func TestGistsService_GetRevision(t *testing.T) { t.Errorf("Gists.Get returned error: %v", err) } - want := &Gist{ID: String("1")} + want := &Gist{ID: Ptr("1")} if !cmp.Equal(gist, want) { t.Errorf("Gists.Get returned %+v, want %+v", gist, want) } @@ -478,10 +478,10 @@ func TestGistsService_Create(t *testing.T) { client, mux, _ := setup(t) input := &Gist{ - Description: String("Gist description"), - Public: Bool(false), + Description: Ptr("Gist description"), + Public: Ptr(false), Files: map[GistFilename]GistFile{ - "test.txt": {Content: String("Gist file content")}, + "test.txt": {Content: Ptr("Gist file content")}, }, } @@ -515,11 +515,11 @@ func TestGistsService_Create(t *testing.T) { } want := &Gist{ - ID: String("1"), - Description: String("Gist description"), - Public: Bool(false), + ID: Ptr("1"), + Description: Ptr("Gist description"), + Public: Ptr(false), Files: map[GistFilename]GistFile{ - "test.txt": {Filename: String("test.txt")}, + "test.txt": {Filename: Ptr("test.txt")}, }, } if !cmp.Equal(gist, want) { @@ -541,9 +541,9 @@ func TestGistsService_Edit(t *testing.T) { client, mux, _ := setup(t) input := &Gist{ - Description: String("New description"), + Description: Ptr("New description"), Files: map[GistFilename]GistFile{ - "new.txt": {Content: String("new file content")}, + "new.txt": {Content: Ptr("new file content")}, }, } @@ -580,12 +580,12 @@ func TestGistsService_Edit(t *testing.T) { } want := &Gist{ - ID: String("1"), - Description: String("new description"), - Public: Bool(false), + ID: Ptr("1"), + Description: Ptr("new description"), + Public: Ptr(false), Files: map[GistFilename]GistFile{ - "test.txt": {Filename: String("test.txt")}, - "new.txt": {Filename: String("new.txt")}, + "test.txt": {Filename: Ptr("test.txt")}, + "new.txt": {Filename: Ptr("new.txt")}, }, } if !cmp.Equal(gist, want) { @@ -649,14 +649,14 @@ func TestGistsService_ListCommits(t *testing.T) { } want := []*GistCommit{{ - URL: String("https://api.github.com/gists/1/1"), - Version: String("1"), - User: &User{ID: Int64(1)}, + URL: Ptr("https://api.github.com/gists/1/1"), + Version: Ptr("1"), + User: &User{ID: Ptr(int64(1))}, CommittedAt: &Timestamp{time.Date(2010, time.January, 1, 00, 00, 00, 0, time.UTC)}, ChangeStatus: &CommitStats{ - Additions: Int(180), - Deletions: Int(0), - Total: Int(180), + Additions: Ptr(180), + Deletions: Ptr(0), + Total: Ptr(180), }}} if !cmp.Equal(gistCommits, want) { @@ -912,7 +912,7 @@ func TestGistsService_Fork(t *testing.T) { t.Errorf("Gists.Fork returned error: %v", err) } - want := &Gist{ID: String("2")} + want := &Gist{ID: Ptr("2")} if !cmp.Equal(gist, want) { t.Errorf("Gists.Fork returned %+v, want %+v", gist, want) } @@ -958,9 +958,9 @@ func TestGistsService_ListForks(t *testing.T) { } want := []*GistFork{{ - URL: String("https://api.github.com/gists/1"), - ID: String("1"), - User: &User{ID: Int64(1)}, + URL: Ptr("https://api.github.com/gists/1"), + ID: Ptr("1"), + User: &User{ID: Ptr(int64(1))}, CreatedAt: &Timestamp{time.Date(2010, time.January, 1, 00, 00, 00, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2013, time.January, 1, 00, 00, 00, 0, time.UTC)}}} @@ -1026,12 +1026,12 @@ func TestGistFile_Marshal(t *testing.T) { testJSONMarshal(t, &GistFile{}, "{}") u := &GistFile{ - Size: Int(1), - Filename: String("fn"), - Language: String("lan"), - Type: String("type"), - RawURL: String("rurl"), - Content: String("con"), + Size: Ptr(1), + Filename: Ptr("fn"), + Language: Ptr("lan"), + Type: Ptr("type"), + RawURL: Ptr("rurl"), + Content: Ptr("con"), } want := `{ diff --git a/github/git_blobs_test.go b/github/git_blobs_test.go index 710171bc2ce..f8f35b2ceba 100644 --- a/github/git_blobs_test.go +++ b/github/git_blobs_test.go @@ -36,8 +36,8 @@ func TestGitService_GetBlob(t *testing.T) { } want := Blob{ - SHA: String("s"), - Content: String("blob content"), + SHA: Ptr("s"), + Content: Ptr("blob content"), } if !cmp.Equal(*blob, want) { @@ -110,10 +110,10 @@ func TestGitService_CreateBlob(t *testing.T) { client, mux, _ := setup(t) input := &Blob{ - SHA: String("s"), - Content: String("blob content"), - Encoding: String("utf-8"), - Size: Int(12), + SHA: Ptr("s"), + Content: Ptr("blob content"), + Encoding: Ptr("utf-8"), + Size: Ptr(12), } mux.HandleFunc("/repos/o/r/git/blobs", func(w http.ResponseWriter, r *http.Request) { @@ -176,12 +176,12 @@ func TestBlob_Marshal(t *testing.T) { testJSONMarshal(t, &Blob{}, "{}") u := &Blob{ - Content: String("content"), - Encoding: String("encoding"), - SHA: String("sha"), - Size: Int(1), - URL: String("url"), - NodeID: String("nid"), + Content: Ptr("content"), + Encoding: Ptr("encoding"), + SHA: Ptr("sha"), + Size: Ptr(1), + URL: Ptr("url"), + NodeID: Ptr("nid"), } want := `{ diff --git a/github/git_commits_test.go b/github/git_commits_test.go index 9ea876050e6..a58a4d98a1f 100644 --- a/github/git_commits_test.go +++ b/github/git_commits_test.go @@ -43,49 +43,49 @@ func TestCommit_Marshal(t *testing.T) { testJSONMarshal(t, &Commit{}, "{}") u := &Commit{ - SHA: String("s"), + SHA: Ptr("s"), Author: &CommitAuthor{ Date: &Timestamp{referenceTime}, - Name: String("n"), - Email: String("e"), - Login: String("u"), + Name: Ptr("n"), + Email: Ptr("e"), + Login: Ptr("u"), }, Committer: &CommitAuthor{ Date: &Timestamp{referenceTime}, - Name: String("n"), - Email: String("e"), - Login: String("u"), + Name: Ptr("n"), + Email: Ptr("e"), + Login: Ptr("u"), }, - Message: String("m"), + Message: Ptr("m"), Tree: &Tree{ - SHA: String("s"), + SHA: Ptr("s"), Entries: []*TreeEntry{{ - SHA: String("s"), - Path: String("p"), - Mode: String("m"), - Type: String("t"), - Size: Int(1), - Content: String("c"), - URL: String("u"), + SHA: Ptr("s"), + Path: Ptr("p"), + Mode: Ptr("m"), + Type: Ptr("t"), + Size: Ptr(1), + Content: Ptr("c"), + URL: Ptr("u"), }}, - Truncated: Bool(false), + Truncated: Ptr(false), }, Parents: nil, Stats: &CommitStats{ - Additions: Int(1), - Deletions: Int(1), - Total: Int(1), + Additions: Ptr(1), + Deletions: Ptr(1), + Total: Ptr(1), }, - HTMLURL: String("h"), - URL: String("u"), + HTMLURL: Ptr("h"), + URL: Ptr("u"), Verification: &SignatureVerification{ - Verified: Bool(false), - Reason: String("r"), - Signature: String("s"), - Payload: String("p"), + Verified: Ptr(false), + Reason: Ptr("r"), + Signature: Ptr("s"), + Payload: Ptr("p"), }, - NodeID: String("n"), - CommentCount: Int(1), + NodeID: Ptr("n"), + CommentCount: Ptr(1), } want := `{ @@ -153,7 +153,7 @@ func TestGitService_GetCommit(t *testing.T) { t.Errorf("Git.GetCommit returned error: %v", err) } - want := &Commit{SHA: String("s"), Message: String("Commit Message."), Author: &CommitAuthor{Name: String("n")}} + want := &Commit{SHA: Ptr("s"), Message: Ptr("Commit Message."), Author: &CommitAuthor{Name: Ptr("n")}} if !cmp.Equal(commit, want) { t.Errorf("Git.GetCommit returned %+v, want %+v", commit, want) } @@ -187,9 +187,9 @@ func TestGitService_CreateCommit(t *testing.T) { client, mux, _ := setup(t) input := &Commit{ - Message: String("Commit Message."), - Tree: &Tree{SHA: String("t")}, - Parents: []*Commit{{SHA: String("p")}}, + Message: Ptr("Commit Message."), + Tree: &Tree{SHA: Ptr("t")}, + Parents: []*Commit{{SHA: Ptr("p")}}, } mux.HandleFunc("/repos/o/r/git/commits", func(w http.ResponseWriter, r *http.Request) { @@ -200,7 +200,7 @@ func TestGitService_CreateCommit(t *testing.T) { want := &createCommit{ Message: input.Message, - Tree: String("t"), + Tree: Ptr("t"), Parents: []string{"p"}, } if !cmp.Equal(v, want) { @@ -215,7 +215,7 @@ func TestGitService_CreateCommit(t *testing.T) { t.Errorf("Git.CreateCommit returned error: %v", err) } - want := &Commit{SHA: String("s")} + want := &Commit{SHA: Ptr("s")} if !cmp.Equal(commit, want) { t.Errorf("Git.CreateCommit returned %+v, want %+v", commit, want) } @@ -242,11 +242,11 @@ func TestGitService_CreateSignedCommit(t *testing.T) { signature := "----- BEGIN PGP SIGNATURE -----\n\naaaa\naaaa\n----- END PGP SIGNATURE -----" input := &Commit{ - Message: String("Commit Message."), - Tree: &Tree{SHA: String("t")}, - Parents: []*Commit{{SHA: String("p")}}, + Message: Ptr("Commit Message."), + Tree: &Tree{SHA: Ptr("t")}, + Parents: []*Commit{{SHA: Ptr("p")}}, Verification: &SignatureVerification{ - Signature: String(signature), + Signature: Ptr(signature), }, } @@ -258,9 +258,9 @@ func TestGitService_CreateSignedCommit(t *testing.T) { want := &createCommit{ Message: input.Message, - Tree: String("t"), + Tree: Ptr("t"), Parents: []string{"p"}, - Signature: String(signature), + Signature: Ptr(signature), } if !cmp.Equal(v, want) { t.Errorf("Request body = %+v, want %+v", v, want) @@ -274,7 +274,7 @@ func TestGitService_CreateSignedCommit(t *testing.T) { t.Errorf("Git.CreateCommit returned error: %v", err) } - want := &Commit{SHA: String("commitSha")} + want := &Commit{SHA: Ptr("commitSha")} if !cmp.Equal(commit, want) { t.Errorf("Git.CreateCommit returned %+v, want %+v", commit, want) } @@ -326,8 +326,8 @@ func TestGitService_CreateCommit_WithSigner(t *testing.T) { signature := "my voice is my password" date := time.Date(2017, time.May, 4, 0, 3, 43, 0, time.FixedZone("CEST", 2*3600)) author := CommitAuthor{ - Name: String("go-github"), - Email: String("go-github@github.com"), + Name: Ptr("go-github"), + Email: Ptr("go-github@github.com"), Date: &Timestamp{date}, } wantMessage := `tree t @@ -339,14 +339,14 @@ Commit Message.` sha := "commitSha" input := &Commit{ SHA: &sha, - Message: String("Commit Message."), - Tree: &Tree{SHA: String("t")}, - Parents: []*Commit{{SHA: String("p")}}, + Message: Ptr("Commit Message."), + Tree: &Tree{SHA: Ptr("t")}, + Parents: []*Commit{{SHA: Ptr("p")}}, Author: &author, } wantBody := createCommit{ Message: input.Message, - Tree: String("t"), + Tree: Ptr("t"), Parents: []string{"p"}, Author: &author, Signature: &signature, @@ -358,7 +358,7 @@ Commit Message.` fmt.Fprintf(w, `{"sha":"%s"}`, sha) }) ctx := context.Background() - wantCommit := &Commit{SHA: String(sha)} + wantCommit := &Commit{SHA: Ptr(sha)} opts := CreateCommitOptions{Signer: mockSigner(t, signature, nil, wantMessage)} commit, _, err := client.Git.CreateCommit(ctx, "o", "r", input, &opts) assertNilError(t, err) @@ -373,8 +373,8 @@ Commit Message.` func TestGitService_createSignature_nilSigner(t *testing.T) { t.Parallel() a := &createCommit{ - Message: String("Commit Message."), - Tree: String("t"), + Message: Ptr("Commit Message."), + Tree: Ptr("t"), Parents: []string{"p"}, } @@ -397,10 +397,10 @@ func TestGitService_createSignature_nilCommit(t *testing.T) { func TestGitService_createSignature_signerError(t *testing.T) { t.Parallel() a := &createCommit{ - Message: String("Commit Message."), - Tree: String("t"), + Message: Ptr("Commit Message."), + Tree: Ptr("t"), Parents: []string{"p"}, - Author: &CommitAuthor{Name: String("go-github")}, + Author: &CommitAuthor{Name: Ptr("go-github")}, } signer := mockSigner(t, "", errors.New("signer error"), "") @@ -427,8 +427,8 @@ func TestGitService_createSignatureMessage_nilMessage(t *testing.T) { Message: nil, Parents: []string{"p"}, Author: &CommitAuthor{ - Name: String("go-github"), - Email: String("go-github@github.com"), + Name: Ptr("go-github"), + Email: Ptr("go-github@github.com"), Date: &Timestamp{date}, }, }) @@ -445,8 +445,8 @@ func TestGitService_createSignatureMessage_emptyMessage(t *testing.T) { Message: &emptyString, Parents: []string{"p"}, Author: &CommitAuthor{ - Name: String("go-github"), - Email: String("go-github@github.com"), + Name: Ptr("go-github"), + Email: Ptr("go-github@github.com"), Date: &Timestamp{date}, }, }) @@ -458,7 +458,7 @@ func TestGitService_createSignatureMessage_emptyMessage(t *testing.T) { func TestGitService_createSignatureMessage_nilAuthor(t *testing.T) { t.Parallel() _, err := createSignatureMessage(&createCommit{ - Message: String("Commit Message."), + Message: Ptr("Commit Message."), Parents: []string{"p"}, Author: nil, }) @@ -472,11 +472,11 @@ func TestGitService_createSignatureMessage_withoutTree(t *testing.T) { date, _ := time.Parse("Mon Jan 02 15:04:05 2006 -0700", "Thu May 04 00:03:43 2017 +0200") msg, _ := createSignatureMessage(&createCommit{ - Message: String("Commit Message."), + Message: Ptr("Commit Message."), Parents: []string{"p"}, Author: &CommitAuthor{ - Name: String("go-github"), - Email: String("go-github@github.com"), + Name: Ptr("go-github"), + Email: Ptr("go-github@github.com"), Date: &Timestamp{date}, }, }) @@ -495,16 +495,16 @@ func TestGitService_createSignatureMessage_withoutCommitter(t *testing.T) { date, _ := time.Parse("Mon Jan 02 15:04:05 2006 -0700", "Thu May 04 00:03:43 2017 +0200") msg, _ := createSignatureMessage(&createCommit{ - Message: String("Commit Message."), + Message: Ptr("Commit Message."), Parents: []string{"p"}, Author: &CommitAuthor{ - Name: String("go-github"), - Email: String("go-github@github.com"), + Name: Ptr("go-github"), + Email: Ptr("go-github@github.com"), Date: &Timestamp{date}, }, Committer: &CommitAuthor{ - Name: String("foo"), - Email: String("foo@bar.com"), + Name: Ptr("foo"), + Email: Ptr("foo@bar.com"), Date: &Timestamp{date}, }, }) @@ -532,10 +532,10 @@ func TestSignatureVerification_Marshal(t *testing.T) { testJSONMarshal(t, &SignatureVerification{}, "{}") u := &SignatureVerification{ - Verified: Bool(true), - Reason: String("reason"), - Signature: String("sign"), - Payload: String("payload"), + Verified: Ptr(true), + Reason: Ptr("reason"), + Signature: Ptr("sign"), + Payload: Ptr("payload"), } want := `{ @@ -554,9 +554,9 @@ func TestCommitAuthor_Marshal(t *testing.T) { u := &CommitAuthor{ Date: &Timestamp{referenceTime}, - Name: String("name"), - Email: String("email"), - Login: String("login"), + Name: Ptr("name"), + Email: Ptr("email"), + Login: Ptr("login"), } want := `{ @@ -576,20 +576,20 @@ func TestCreateCommit_Marshal(t *testing.T) { u := &createCommit{ Author: &CommitAuthor{ Date: &Timestamp{referenceTime}, - Name: String("name"), - Email: String("email"), - Login: String("login"), + Name: Ptr("name"), + Email: Ptr("email"), + Login: Ptr("login"), }, Committer: &CommitAuthor{ Date: &Timestamp{referenceTime}, - Name: String("name"), - Email: String("email"), - Login: String("login"), + Name: Ptr("name"), + Email: Ptr("email"), + Login: Ptr("login"), }, - Message: String("message"), - Tree: String("tree"), + Message: Ptr("message"), + Tree: Ptr("tree"), Parents: []string{"p"}, - Signature: String("sign"), + Signature: Ptr("sign"), } want := `{ diff --git a/github/git_refs.go b/github/git_refs.go index ad7b10d7d3f..91eb6dd43fa 100644 --- a/github/git_refs.go +++ b/github/git_refs.go @@ -127,7 +127,7 @@ func (s *GitService) CreateRef(ctx context.Context, owner string, repo string, r u := fmt.Sprintf("repos/%v/%v/git/refs", owner, repo) req, err := s.client.NewRequest("POST", u, &createRefRequest{ // back-compat with previous behavior that didn't require 'refs/' prefix - Ref: String("refs/" + strings.TrimPrefix(*ref.Ref, "refs/")), + Ref: Ptr("refs/" + strings.TrimPrefix(*ref.Ref, "refs/")), SHA: ref.Object.SHA, }) if err != nil { diff --git a/github/git_refs_test.go b/github/git_refs_test.go index 0c552f434f3..389b23c0c29 100644 --- a/github/git_refs_test.go +++ b/github/git_refs_test.go @@ -41,12 +41,12 @@ func TestGitService_GetRef_singleRef(t *testing.T) { } want := &Reference{ - Ref: String("refs/heads/b"), - URL: String("https://api.github.com/repos/o/r/git/refs/heads/b"), + Ref: Ptr("refs/heads/b"), + URL: Ptr("https://api.github.com/repos/o/r/git/refs/heads/b"), Object: &GitObject{ - Type: String("commit"), - SHA: String("aa218f56b14c9653891f9e74264a383fa43fefbd"), - URL: String("https://api.github.com/repos/o/r/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd"), + Type: Ptr("commit"), + SHA: Ptr("aa218f56b14c9653891f9e74264a383fa43fefbd"), + URL: Ptr("https://api.github.com/repos/o/r/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd"), }, } if !cmp.Equal(ref, want) { @@ -138,12 +138,12 @@ func TestGitService_ListMatchingRefs_singleRef(t *testing.T) { ref := refs[0] want := &Reference{ - Ref: String("refs/heads/b"), - URL: String("https://api.github.com/repos/o/r/git/refs/heads/b"), + Ref: Ptr("refs/heads/b"), + URL: Ptr("https://api.github.com/repos/o/r/git/refs/heads/b"), Object: &GitObject{ - Type: String("commit"), - SHA: String("aa218f56b14c9653891f9e74264a383fa43fefbd"), - URL: String("https://api.github.com/repos/o/r/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd"), + Type: Ptr("commit"), + SHA: Ptr("aa218f56b14c9653891f9e74264a383fa43fefbd"), + URL: Ptr("https://api.github.com/repos/o/r/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd"), }, } if !cmp.Equal(ref, want) { @@ -209,12 +209,12 @@ func TestGitService_ListMatchingRefs_multipleRefs(t *testing.T) { } want := &Reference{ - Ref: String("refs/heads/booger"), - URL: String("https://api.github.com/repos/o/r/git/refs/heads/booger"), + Ref: Ptr("refs/heads/booger"), + URL: Ptr("https://api.github.com/repos/o/r/git/refs/heads/booger"), Object: &GitObject{ - Type: String("commit"), - SHA: String("aa218f56b14c9653891f9e74264a383fa43fefbd"), - URL: String("https://api.github.com/repos/o/r/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd"), + Type: Ptr("commit"), + SHA: Ptr("aa218f56b14c9653891f9e74264a383fa43fefbd"), + URL: Ptr("https://api.github.com/repos/o/r/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd"), }, } if !cmp.Equal(refs[0], want) { @@ -308,21 +308,21 @@ func TestGitService_ListMatchingRefs_allRefs(t *testing.T) { want := []*Reference{ { - Ref: String("refs/heads/branchA"), - URL: String("https://api.github.com/repos/o/r/git/refs/heads/branchA"), + Ref: Ptr("refs/heads/branchA"), + URL: Ptr("https://api.github.com/repos/o/r/git/refs/heads/branchA"), Object: &GitObject{ - Type: String("commit"), - SHA: String("aa218f56b14c9653891f9e74264a383fa43fefbd"), - URL: String("https://api.github.com/repos/o/r/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd"), + Type: Ptr("commit"), + SHA: Ptr("aa218f56b14c9653891f9e74264a383fa43fefbd"), + URL: Ptr("https://api.github.com/repos/o/r/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd"), }, }, { - Ref: String("refs/heads/branchB"), - URL: String("https://api.github.com/repos/o/r/git/refs/heads/branchB"), + Ref: Ptr("refs/heads/branchB"), + URL: Ptr("https://api.github.com/repos/o/r/git/refs/heads/branchB"), Object: &GitObject{ - Type: String("commit"), - SHA: String("aa218f56b14c9653891f9e74264a383fa43fefbd"), - URL: String("https://api.github.com/repos/o/r/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd"), + Type: Ptr("commit"), + SHA: Ptr("aa218f56b14c9653891f9e74264a383fa43fefbd"), + URL: Ptr("https://api.github.com/repos/o/r/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd"), }, }, } @@ -362,7 +362,7 @@ func TestGitService_ListMatchingRefs_options(t *testing.T) { t.Errorf("Git.ListMatchingRefs returned error: %v", err) } - want := []*Reference{{Ref: String("r")}} + want := []*Reference{{Ref: Ptr("r")}} if !cmp.Equal(refs, want) { t.Errorf("Git.ListMatchingRefs returned %+v, want %+v", refs, want) } @@ -387,8 +387,8 @@ func TestGitService_CreateRef(t *testing.T) { client, mux, _ := setup(t) args := &createRefRequest{ - Ref: String("refs/heads/b"), - SHA: String("aa218f56b14c9653891f9e74264a383fa43fefbd"), + Ref: Ptr("refs/heads/b"), + SHA: Ptr("aa218f56b14c9653891f9e74264a383fa43fefbd"), } mux.HandleFunc("/repos/o/r/git/refs", func(w http.ResponseWriter, r *http.Request) { @@ -413,9 +413,9 @@ func TestGitService_CreateRef(t *testing.T) { ctx := context.Background() ref, _, err := client.Git.CreateRef(ctx, "o", "r", &Reference{ - Ref: String("refs/heads/b"), + Ref: Ptr("refs/heads/b"), Object: &GitObject{ - SHA: String("aa218f56b14c9653891f9e74264a383fa43fefbd"), + SHA: Ptr("aa218f56b14c9653891f9e74264a383fa43fefbd"), }, }) if err != nil { @@ -423,12 +423,12 @@ func TestGitService_CreateRef(t *testing.T) { } want := &Reference{ - Ref: String("refs/heads/b"), - URL: String("https://api.github.com/repos/o/r/git/refs/heads/b"), + Ref: Ptr("refs/heads/b"), + URL: Ptr("https://api.github.com/repos/o/r/git/refs/heads/b"), Object: &GitObject{ - Type: String("commit"), - SHA: String("aa218f56b14c9653891f9e74264a383fa43fefbd"), - URL: String("https://api.github.com/repos/o/r/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd"), + Type: Ptr("commit"), + SHA: Ptr("aa218f56b14c9653891f9e74264a383fa43fefbd"), + URL: Ptr("https://api.github.com/repos/o/r/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd"), }, } if !cmp.Equal(ref, want) { @@ -437,9 +437,9 @@ func TestGitService_CreateRef(t *testing.T) { // without 'refs/' prefix _, _, err = client.Git.CreateRef(ctx, "o", "r", &Reference{ - Ref: String("heads/b"), + Ref: Ptr("heads/b"), Object: &GitObject{ - SHA: String("aa218f56b14c9653891f9e74264a383fa43fefbd"), + SHA: Ptr("aa218f56b14c9653891f9e74264a383fa43fefbd"), }, }) if err != nil { @@ -449,9 +449,9 @@ func TestGitService_CreateRef(t *testing.T) { const methodName = "CreateRef" testBadOptions(t, methodName, func() (err error) { _, _, err = client.Git.CreateRef(ctx, "\n", "\n", &Reference{ - Ref: String("refs/heads/b"), + Ref: Ptr("refs/heads/b"), Object: &GitObject{ - SHA: String("aa218f56b14c9653891f9e74264a383fa43fefbd"), + SHA: Ptr("aa218f56b14c9653891f9e74264a383fa43fefbd"), }, }) return err @@ -459,9 +459,9 @@ func TestGitService_CreateRef(t *testing.T) { testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { got, resp, err := client.Git.CreateRef(ctx, "o", "r", &Reference{ - Ref: String("refs/heads/b"), + Ref: Ptr("refs/heads/b"), Object: &GitObject{ - SHA: String("aa218f56b14c9653891f9e74264a383fa43fefbd"), + SHA: Ptr("aa218f56b14c9653891f9e74264a383fa43fefbd"), }, }) if got != nil { @@ -476,8 +476,8 @@ func TestGitService_UpdateRef(t *testing.T) { client, mux, _ := setup(t) args := &updateRefRequest{ - SHA: String("aa218f56b14c9653891f9e74264a383fa43fefbd"), - Force: Bool(true), + SHA: Ptr("aa218f56b14c9653891f9e74264a383fa43fefbd"), + Force: Ptr(true), } mux.HandleFunc("/repos/o/r/git/refs/heads/b", func(w http.ResponseWriter, r *http.Request) { @@ -502,20 +502,20 @@ func TestGitService_UpdateRef(t *testing.T) { ctx := context.Background() ref, _, err := client.Git.UpdateRef(ctx, "o", "r", &Reference{ - Ref: String("refs/heads/b"), - Object: &GitObject{SHA: String("aa218f56b14c9653891f9e74264a383fa43fefbd")}, + Ref: Ptr("refs/heads/b"), + Object: &GitObject{SHA: Ptr("aa218f56b14c9653891f9e74264a383fa43fefbd")}, }, true) if err != nil { t.Errorf("Git.UpdateRef returned error: %v", err) } want := &Reference{ - Ref: String("refs/heads/b"), - URL: String("https://api.github.com/repos/o/r/git/refs/heads/b"), + Ref: Ptr("refs/heads/b"), + URL: Ptr("https://api.github.com/repos/o/r/git/refs/heads/b"), Object: &GitObject{ - Type: String("commit"), - SHA: String("aa218f56b14c9653891f9e74264a383fa43fefbd"), - URL: String("https://api.github.com/repos/o/r/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd"), + Type: Ptr("commit"), + SHA: Ptr("aa218f56b14c9653891f9e74264a383fa43fefbd"), + URL: Ptr("https://api.github.com/repos/o/r/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd"), }, } if !cmp.Equal(ref, want) { @@ -524,8 +524,8 @@ func TestGitService_UpdateRef(t *testing.T) { // without 'refs/' prefix _, _, err = client.Git.UpdateRef(ctx, "o", "r", &Reference{ - Ref: String("heads/b"), - Object: &GitObject{SHA: String("aa218f56b14c9653891f9e74264a383fa43fefbd")}, + Ref: Ptr("heads/b"), + Object: &GitObject{SHA: Ptr("aa218f56b14c9653891f9e74264a383fa43fefbd")}, }, true) if err != nil { t.Errorf("Git.UpdateRef returned error: %v", err) @@ -534,16 +534,16 @@ func TestGitService_UpdateRef(t *testing.T) { const methodName = "UpdateRef" testBadOptions(t, methodName, func() (err error) { _, _, err = client.Git.UpdateRef(ctx, "\n", "\n", &Reference{ - Ref: String("refs/heads/b"), - Object: &GitObject{SHA: String("aa218f56b14c9653891f9e74264a383fa43fefbd")}, + Ref: Ptr("refs/heads/b"), + Object: &GitObject{SHA: Ptr("aa218f56b14c9653891f9e74264a383fa43fefbd")}, }, true) return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { got, resp, err := client.Git.UpdateRef(ctx, "o", "r", &Reference{ - Ref: String("refs/heads/b"), - Object: &GitObject{SHA: String("aa218f56b14c9653891f9e74264a383fa43fefbd")}, + Ref: Ptr("refs/heads/b"), + Object: &GitObject{SHA: Ptr("aa218f56b14c9653891f9e74264a383fa43fefbd")}, }, true) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) @@ -629,8 +629,8 @@ func TestGitService_UpdateRef_pathEscape(t *testing.T) { client, mux, _ := setup(t) args := &updateRefRequest{ - SHA: String("aa218f56b14c9653891f9e74264a383fa43fefbd"), - Force: Bool(true), + SHA: Ptr("aa218f56b14c9653891f9e74264a383fa43fefbd"), + Force: Ptr(true), } mux.HandleFunc("/repos/o/r/git/refs/heads/b#1", func(w http.ResponseWriter, r *http.Request) { @@ -655,20 +655,20 @@ func TestGitService_UpdateRef_pathEscape(t *testing.T) { ctx := context.Background() ref, _, err := client.Git.UpdateRef(ctx, "o", "r", &Reference{ - Ref: String("refs/heads/b#1"), - Object: &GitObject{SHA: String("aa218f56b14c9653891f9e74264a383fa43fefbd")}, + Ref: Ptr("refs/heads/b#1"), + Object: &GitObject{SHA: Ptr("aa218f56b14c9653891f9e74264a383fa43fefbd")}, }, true) if err != nil { t.Errorf("Git.UpdateRef returned error: %v", err) } want := &Reference{ - Ref: String("refs/heads/b#1"), - URL: String("https://api.github.com/repos/o/r/git/refs/heads/b%231"), + Ref: Ptr("refs/heads/b#1"), + URL: Ptr("https://api.github.com/repos/o/r/git/refs/heads/b%231"), Object: &GitObject{ - Type: String("commit"), - SHA: String("aa218f56b14c9653891f9e74264a383fa43fefbd"), - URL: String("https://api.github.com/repos/o/r/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd"), + Type: Ptr("commit"), + SHA: Ptr("aa218f56b14c9653891f9e74264a383fa43fefbd"), + URL: Ptr("https://api.github.com/repos/o/r/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd"), }, } if !cmp.Equal(ref, want) { @@ -681,14 +681,14 @@ func TestReference_Marshal(t *testing.T) { testJSONMarshal(t, &Reference{}, "{}") u := &Reference{ - Ref: String("ref"), - URL: String("url"), + Ref: Ptr("ref"), + URL: Ptr("url"), Object: &GitObject{ - Type: String("type"), - SHA: String("sha"), - URL: String("url"), + Type: Ptr("type"), + SHA: Ptr("sha"), + URL: Ptr("url"), }, - NodeID: String("nid"), + NodeID: Ptr("nid"), } want := `{ @@ -710,9 +710,9 @@ func TestGitObject_Marshal(t *testing.T) { testJSONMarshal(t, &GitObject{}, "{}") u := &GitObject{ - Type: String("type"), - SHA: String("sha"), - URL: String("url"), + Type: Ptr("type"), + SHA: Ptr("sha"), + URL: Ptr("url"), } want := `{ @@ -729,8 +729,8 @@ func TestCreateRefRequest_Marshal(t *testing.T) { testJSONMarshal(t, &createRefRequest{}, "{}") u := &createRefRequest{ - Ref: String("ref"), - SHA: String("sha"), + Ref: Ptr("ref"), + SHA: Ptr("sha"), } want := `{ @@ -746,8 +746,8 @@ func TestUpdateRefRequest_Marshal(t *testing.T) { testJSONMarshal(t, &updateRefRequest{}, "{}") u := &updateRefRequest{ - SHA: String("sha"), - Force: Bool(true), + SHA: Ptr("sha"), + Force: Ptr(true), } want := `{ diff --git a/github/git_tags_test.go b/github/git_tags_test.go index d1495c8b549..0d878dc3ee5 100644 --- a/github/git_tags_test.go +++ b/github/git_tags_test.go @@ -30,7 +30,7 @@ func TestGitService_GetTag(t *testing.T) { t.Errorf("Git.GetTag returned error: %v", err) } - want := &Tag{Tag: String("t")} + want := &Tag{Tag: Ptr("t")} if !cmp.Equal(tag, want) { t.Errorf("Git.GetTag returned %+v, want %+v", tag, want) } @@ -54,7 +54,7 @@ func TestGitService_CreateTag(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &createTagRequest{Tag: String("t"), Object: String("s")} + input := &createTagRequest{Tag: Ptr("t"), Object: Ptr("s")} mux.HandleFunc("/repos/o/r/git/tags", func(w http.ResponseWriter, r *http.Request) { v := new(createTagRequest) @@ -78,7 +78,7 @@ func TestGitService_CreateTag(t *testing.T) { t.Errorf("Git.CreateTag returned error: %v", err) } - want := &Tag{Tag: String("t")} + want := &Tag{Tag: Ptr("t")} if !cmp.Equal(tag, want) { t.Errorf("Git.GetTag returned %+v, want %+v", tag, want) } @@ -103,28 +103,28 @@ func TestTag_Marshal(t *testing.T) { testJSONMarshal(t, &Tag{}, "{}") u := &Tag{ - Tag: String("tag"), - SHA: String("sha"), - URL: String("url"), - Message: String("msg"), + Tag: Ptr("tag"), + SHA: Ptr("sha"), + URL: Ptr("url"), + Message: Ptr("msg"), Tagger: &CommitAuthor{ Date: &Timestamp{referenceTime}, - Name: String("name"), - Email: String("email"), - Login: String("login"), + Name: Ptr("name"), + Email: Ptr("email"), + Login: Ptr("login"), }, Object: &GitObject{ - Type: String("type"), - SHA: String("sha"), - URL: String("url"), + Type: Ptr("type"), + SHA: Ptr("sha"), + URL: Ptr("url"), }, Verification: &SignatureVerification{ - Verified: Bool(true), - Reason: String("reason"), - Signature: String("sign"), - Payload: String("payload"), + Verified: Ptr(true), + Reason: Ptr("reason"), + Signature: Ptr("sign"), + Payload: Ptr("payload"), }, - NodeID: String("nid"), + NodeID: Ptr("nid"), } want := `{ @@ -160,15 +160,15 @@ func TestCreateTagRequest_Marshal(t *testing.T) { testJSONMarshal(t, &createTagRequest{}, "{}") u := &createTagRequest{ - Tag: String("tag"), - Message: String("msg"), - Object: String("obj"), - Type: String("type"), + Tag: Ptr("tag"), + Message: Ptr("msg"), + Object: Ptr("obj"), + Type: Ptr("type"), Tagger: &CommitAuthor{ Date: &Timestamp{referenceTime}, - Name: String("name"), - Email: String("email"), - Login: String("login"), + Name: Ptr("name"), + Email: Ptr("email"), + Login: Ptr("login"), }, } diff --git a/github/git_trees_test.go b/github/git_trees_test.go index 591ff0c1c0f..0c264470ce2 100644 --- a/github/git_trees_test.go +++ b/github/git_trees_test.go @@ -19,11 +19,11 @@ import ( func TestMarshalJSON_withNilContentAndSHA(t *testing.T) { t.Parallel() te := &TreeEntry{ - Path: String("path"), - Mode: String("mode"), - Type: String("type"), - Size: Int(1), - URL: String("url"), + Path: Ptr("path"), + Mode: Ptr("mode"), + Type: Ptr("type"), + Size: Ptr(1), + URL: Ptr("url"), } got, err := te.MarshalJSON() @@ -57,13 +57,13 @@ func TestGitService_GetTree(t *testing.T) { } want := Tree{ - SHA: String("s"), + SHA: Ptr("s"), Entries: []*TreeEntry{ { - Type: String("blob"), + Type: Ptr("blob"), }, }, - Truncated: Bool(true), + Truncated: Ptr(true), } if !cmp.Equal(*tree, want) { t.Errorf("Tree.Get returned %+v, want %+v", *tree, want) @@ -99,10 +99,10 @@ func TestGitService_CreateTree(t *testing.T) { input := []*TreeEntry{ { - Path: String("file.rb"), - Mode: String("100644"), - Type: String("blob"), - SHA: String("7c258a9869f33c1e1e1f74fbb32f07c86cb5a75b"), + Path: Ptr("file.rb"), + Mode: Ptr("100644"), + Type: Ptr("blob"), + SHA: Ptr("7c258a9869f33c1e1e1f74fbb32f07c86cb5a75b"), }, } @@ -140,14 +140,14 @@ func TestGitService_CreateTree(t *testing.T) { } want := Tree{ - String("cd8274d15fa3ae2ab983129fb037999f264ba9a7"), + Ptr("cd8274d15fa3ae2ab983129fb037999f264ba9a7"), []*TreeEntry{ { - Path: String("file.rb"), - Mode: String("100644"), - Type: String("blob"), - Size: Int(132), - SHA: String("7c258a9869f33c1e1e1f74fbb32f07c86cb5a75b"), + Path: Ptr("file.rb"), + Mode: Ptr("100644"), + Type: Ptr("blob"), + Size: Ptr(132), + SHA: Ptr("7c258a9869f33c1e1e1f74fbb32f07c86cb5a75b"), }, }, nil, @@ -178,9 +178,9 @@ func TestGitService_CreateTree_Content(t *testing.T) { input := []*TreeEntry{ { - Path: String("content.md"), - Mode: String("100644"), - Content: String("file content"), + Path: Ptr("content.md"), + Mode: Ptr("100644"), + Content: Ptr("file content"), }, } @@ -220,15 +220,15 @@ func TestGitService_CreateTree_Content(t *testing.T) { } want := Tree{ - String("5c6780ad2c68743383b740fd1dab6f6a33202b11"), + Ptr("5c6780ad2c68743383b740fd1dab6f6a33202b11"), []*TreeEntry{ { - Path: String("content.md"), - Mode: String("100644"), - Type: String("blob"), - Size: Int(12), - SHA: String("aad8feacf6f8063150476a7b2bd9770f2794c08b"), - URL: String("https://api.github.com/repos/o/r/git/blobs/aad8feacf6f8063150476a7b2bd9770f2794c08b"), + Path: Ptr("content.md"), + Mode: Ptr("100644"), + Type: Ptr("blob"), + Size: Ptr(12), + SHA: Ptr("aad8feacf6f8063150476a7b2bd9770f2794c08b"), + URL: Ptr("https://api.github.com/repos/o/r/git/blobs/aad8feacf6f8063150476a7b2bd9770f2794c08b"), }, }, nil, @@ -259,8 +259,8 @@ func TestGitService_CreateTree_Delete(t *testing.T) { input := []*TreeEntry{ { - Path: String("content.md"), - Mode: String("100644"), + Path: Ptr("content.md"), + Mode: Ptr("100644"), }, } @@ -300,15 +300,15 @@ func TestGitService_CreateTree_Delete(t *testing.T) { } want := Tree{ - String("5c6780ad2c68743383b740fd1dab6f6a33202b11"), + Ptr("5c6780ad2c68743383b740fd1dab6f6a33202b11"), []*TreeEntry{ { - Path: String("content.md"), - Mode: String("100644"), - Type: String("blob"), - Size: Int(12), + Path: Ptr("content.md"), + Mode: Ptr("100644"), + Type: Ptr("blob"), + Size: Ptr(12), SHA: nil, - URL: String("https://api.github.com/repos/o/r/git/blobs/aad8feacf6f8063150476a7b2bd9770f2794c08b"), + URL: Ptr("https://api.github.com/repos/o/r/git/blobs/aad8feacf6f8063150476a7b2bd9770f2794c08b"), }, }, nil, @@ -347,19 +347,19 @@ func TestTree_Marshal(t *testing.T) { testJSONMarshal(t, &Tree{}, "{}") u := &Tree{ - SHA: String("sha"), + SHA: Ptr("sha"), Entries: []*TreeEntry{ { - SHA: String("sha"), - Path: String("path"), - Mode: String("mode"), - Type: String("type"), - Size: Int(1), - Content: String("content"), - URL: String("url"), + SHA: Ptr("sha"), + Path: Ptr("path"), + Mode: Ptr("mode"), + Type: Ptr("type"), + Size: Ptr(1), + Content: Ptr("content"), + URL: Ptr("url"), }, }, - Truncated: Bool(false), + Truncated: Ptr(false), } want := `{ @@ -386,13 +386,13 @@ func TestTreeEntry_Marshal(t *testing.T) { testJSONMarshal(t, &TreeEntry{}, "{}") u := &TreeEntry{ - SHA: String("sha"), - Path: String("path"), - Mode: String("mode"), - Type: String("type"), - Size: Int(1), - Content: String("content"), - URL: String("url"), + SHA: Ptr("sha"), + Path: Ptr("path"), + Mode: Ptr("mode"), + Type: Ptr("type"), + Size: Ptr(1), + Content: Ptr("content"), + URL: Ptr("url"), } want := `{ @@ -413,13 +413,13 @@ func TestTreeEntryWithFileDelete_Marshal(t *testing.T) { testJSONMarshal(t, &treeEntryWithFileDelete{}, "{}") u := &treeEntryWithFileDelete{ - SHA: String("sha"), - Path: String("path"), - Mode: String("mode"), - Type: String("type"), - Size: Int(1), - Content: String("content"), - URL: String("url"), + SHA: Ptr("sha"), + Path: Ptr("path"), + Mode: Ptr("mode"), + Type: Ptr("type"), + Size: Ptr(1), + Content: Ptr("content"), + URL: Ptr("url"), } want := `{ diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index 7ffee278d13..ed1c8f11e70 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -13,13 +13,11 @@ import ( "testing" ) -func Float64(v float64) *float64 { return &v } - func TestActionsAllowed_String(t *testing.T) { t.Parallel() v := ActionsAllowed{ - GithubOwnedAllowed: Bool(false), - VerifiedAllowed: Bool(false), + GithubOwnedAllowed: Ptr(false), + VerifiedAllowed: Ptr(false), PatternsAllowed: []string{""}, } want := `github.ActionsAllowed{GithubOwnedAllowed:false, VerifiedAllowed:false, PatternsAllowed:[""]}` @@ -31,9 +29,9 @@ func TestActionsAllowed_String(t *testing.T) { func TestActionsPermissions_String(t *testing.T) { t.Parallel() v := ActionsPermissions{ - EnabledRepositories: String(""), - AllowedActions: String(""), - SelectedActionsURL: String(""), + EnabledRepositories: Ptr(""), + AllowedActions: Ptr(""), + SelectedActionsURL: Ptr(""), } want := `github.ActionsPermissions{EnabledRepositories:"", AllowedActions:"", SelectedActionsURL:""}` if got := v.String(); got != want { @@ -44,9 +42,9 @@ func TestActionsPermissions_String(t *testing.T) { func TestActionsPermissionsEnterprise_String(t *testing.T) { t.Parallel() v := ActionsPermissionsEnterprise{ - EnabledOrganizations: String(""), - AllowedActions: String(""), - SelectedActionsURL: String(""), + EnabledOrganizations: Ptr(""), + AllowedActions: Ptr(""), + SelectedActionsURL: Ptr(""), } want := `github.ActionsPermissionsEnterprise{EnabledOrganizations:"", AllowedActions:"", SelectedActionsURL:""}` if got := v.String(); got != want { @@ -57,9 +55,9 @@ func TestActionsPermissionsEnterprise_String(t *testing.T) { func TestActionsPermissionsRepository_String(t *testing.T) { t.Parallel() v := ActionsPermissionsRepository{ - Enabled: Bool(false), - AllowedActions: String(""), - SelectedActionsURL: String(""), + Enabled: Ptr(false), + AllowedActions: Ptr(""), + SelectedActionsURL: Ptr(""), } want := `github.ActionsPermissionsRepository{Enabled:false, AllowedActions:"", SelectedActionsURL:""}` if got := v.String(); got != want { @@ -90,7 +88,7 @@ func TestAdminStats_String(t *testing.T) { func TestAdvancedSecurity_String(t *testing.T) { t.Parallel() v := AdvancedSecurity{ - Status: String(""), + Status: Ptr(""), } want := `github.AdvancedSecurity{Status:""}` if got := v.String(); got != want { @@ -101,18 +99,18 @@ func TestAdvancedSecurity_String(t *testing.T) { func TestAuthorization_String(t *testing.T) { t.Parallel() v := Authorization{ - ID: Int64(0), - URL: String(""), + ID: Ptr(int64(0)), + URL: Ptr(""), Scopes: []Scope{ScopeNone}, - Token: String(""), - TokenLastEight: String(""), - HashedToken: String(""), + Token: Ptr(""), + TokenLastEight: Ptr(""), + HashedToken: Ptr(""), App: &AuthorizationApp{}, - Note: String(""), - NoteURL: String(""), + Note: Ptr(""), + NoteURL: Ptr(""), UpdatedAt: &Timestamp{}, CreatedAt: &Timestamp{}, - Fingerprint: String(""), + Fingerprint: Ptr(""), User: &User{}, } want := `github.Authorization{ID:0, URL:"", Scopes:["(no scope)"], Token:"", TokenLastEight:"", HashedToken:"", App:github.AuthorizationApp{}, Note:"", NoteURL:"", UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Fingerprint:"", User:github.User{}}` @@ -124,9 +122,9 @@ func TestAuthorization_String(t *testing.T) { func TestAuthorizationApp_String(t *testing.T) { t.Parallel() v := AuthorizationApp{ - URL: String(""), - Name: String(""), - ClientID: String(""), + URL: Ptr(""), + Name: Ptr(""), + ClientID: Ptr(""), } want := `github.AuthorizationApp{URL:"", Name:"", ClientID:""}` if got := v.String(); got != want { @@ -138,11 +136,11 @@ func TestAuthorizationRequest_String(t *testing.T) { t.Parallel() v := AuthorizationRequest{ Scopes: []Scope{ScopeNone}, - Note: String(""), - NoteURL: String(""), - ClientID: String(""), - ClientSecret: String(""), - Fingerprint: String(""), + Note: Ptr(""), + NoteURL: Ptr(""), + ClientID: Ptr(""), + ClientSecret: Ptr(""), + Fingerprint: Ptr(""), } want := `github.AuthorizationRequest{Scopes:["(no scope)"], Note:"", NoteURL:"", ClientID:"", ClientSecret:"", Fingerprint:""}` if got := v.String(); got != want { @@ -156,9 +154,9 @@ func TestAuthorizationUpdateRequest_String(t *testing.T) { Scopes: []string{""}, AddScopes: []string{""}, RemoveScopes: []string{""}, - Note: String(""), - NoteURL: String(""), - Fingerprint: String(""), + Note: Ptr(""), + NoteURL: Ptr(""), + Fingerprint: Ptr(""), } want := `github.AuthorizationUpdateRequest{Scopes:[""], AddScopes:[""], RemoveScopes:[""], Note:"", NoteURL:"", Fingerprint:""}` if got := v.String(); got != want { @@ -169,19 +167,19 @@ func TestAuthorizationUpdateRequest_String(t *testing.T) { func TestCheckRun_String(t *testing.T) { t.Parallel() v := CheckRun{ - ID: Int64(0), - NodeID: String(""), - HeadSHA: String(""), - ExternalID: String(""), - URL: String(""), - HTMLURL: String(""), - DetailsURL: String(""), - Status: String(""), - Conclusion: String(""), + ID: Ptr(int64(0)), + NodeID: Ptr(""), + HeadSHA: Ptr(""), + ExternalID: Ptr(""), + URL: Ptr(""), + HTMLURL: Ptr(""), + DetailsURL: Ptr(""), + Status: Ptr(""), + Conclusion: Ptr(""), StartedAt: &Timestamp{}, CompletedAt: &Timestamp{}, Output: &CheckRunOutput{}, - Name: String(""), + Name: Ptr(""), CheckSuite: &CheckSuite{}, App: &App{}, } @@ -194,23 +192,23 @@ func TestCheckRun_String(t *testing.T) { func TestCheckSuite_String(t *testing.T) { t.Parallel() v := CheckSuite{ - ID: Int64(0), - NodeID: String(""), - HeadBranch: String(""), - HeadSHA: String(""), - URL: String(""), - BeforeSHA: String(""), - AfterSHA: String(""), - Status: String(""), - Conclusion: String(""), + ID: Ptr(int64(0)), + NodeID: Ptr(""), + HeadBranch: Ptr(""), + HeadSHA: Ptr(""), + URL: Ptr(""), + BeforeSHA: Ptr(""), + AfterSHA: Ptr(""), + Status: Ptr(""), + Conclusion: Ptr(""), CreatedAt: &Timestamp{}, UpdatedAt: &Timestamp{}, App: &App{}, Repository: &Repository{}, HeadCommit: &Commit{}, - LatestCheckRunsCount: Int64(0), - Rerequstable: Bool(false), - RunsRerequstable: Bool(false), + LatestCheckRunsCount: Ptr(int64(0)), + Rerequstable: Ptr(false), + RunsRerequstable: Ptr(false), } want := `github.CheckSuite{ID:0, NodeID:"", HeadBranch:"", HeadSHA:"", URL:"", BeforeSHA:"", AfterSHA:"", Status:"", Conclusion:"", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, App:github.App{}, Repository:github.Repository{}, HeadCommit:github.Commit{}, LatestCheckRunsCount:0, Rerequstable:false, RunsRerequstable:false}` if got := v.String(); got != want { @@ -221,10 +219,10 @@ func TestCheckSuite_String(t *testing.T) { func TestCodeOfConduct_String(t *testing.T) { t.Parallel() v := CodeOfConduct{ - Name: String(""), - Key: String(""), - URL: String(""), - Body: String(""), + Name: Ptr(""), + Key: Ptr(""), + URL: Ptr(""), + Body: Ptr(""), } want := `github.CodeOfConduct{Name:"", Key:"", URL:"", Body:""}` if got := v.String(); got != want { @@ -235,10 +233,10 @@ func TestCodeOfConduct_String(t *testing.T) { func TestCodeResult_String(t *testing.T) { t.Parallel() v := CodeResult{ - Name: String(""), - Path: String(""), - SHA: String(""), - HTMLURL: String(""), + Name: Ptr(""), + Path: Ptr(""), + SHA: Ptr(""), + HTMLURL: Ptr(""), Repository: &Repository{}, } want := `github.CodeResult{Name:"", Path:"", SHA:"", HTMLURL:"", Repository:github.Repository{}}` @@ -250,12 +248,12 @@ func TestCodeResult_String(t *testing.T) { func TestCombinedStatus_String(t *testing.T) { t.Parallel() v := CombinedStatus{ - State: String(""), - Name: String(""), - SHA: String(""), - TotalCount: Int(0), - CommitURL: String(""), - RepositoryURL: String(""), + State: Ptr(""), + Name: Ptr(""), + SHA: Ptr(""), + TotalCount: Ptr(0), + CommitURL: Ptr(""), + RepositoryURL: Ptr(""), } want := `github.CombinedStatus{State:"", Name:"", SHA:"", TotalCount:0, CommitURL:"", RepositoryURL:""}` if got := v.String(); got != want { @@ -266,10 +264,10 @@ func TestCombinedStatus_String(t *testing.T) { func TestCommentStats_String(t *testing.T) { t.Parallel() v := CommentStats{ - TotalCommitComments: Int(0), - TotalGistComments: Int(0), - TotalIssueComments: Int(0), - TotalPullRequestComments: Int(0), + TotalCommitComments: Ptr(0), + TotalGistComments: Ptr(0), + TotalIssueComments: Ptr(0), + TotalPullRequestComments: Ptr(0), } want := `github.CommentStats{TotalCommitComments:0, TotalGistComments:0, TotalIssueComments:0, TotalPullRequestComments:0}` if got := v.String(); got != want { @@ -280,17 +278,17 @@ func TestCommentStats_String(t *testing.T) { func TestCommit_String(t *testing.T) { t.Parallel() v := Commit{ - SHA: String(""), + SHA: Ptr(""), Author: &CommitAuthor{}, Committer: &CommitAuthor{}, - Message: String(""), + Message: Ptr(""), Tree: &Tree{}, Stats: &CommitStats{}, - HTMLURL: String(""), - URL: String(""), + HTMLURL: Ptr(""), + URL: Ptr(""), Verification: &SignatureVerification{}, - NodeID: String(""), - CommentCount: Int(0), + NodeID: Ptr(""), + CommentCount: Ptr(0), } want := `github.Commit{SHA:"", Author:github.CommitAuthor{}, Committer:github.CommitAuthor{}, Message:"", Tree:github.Tree{}, Stats:github.CommitStats{}, HTMLURL:"", URL:"", Verification:github.SignatureVerification{}, NodeID:"", CommentCount:0}` if got := v.String(); got != want { @@ -302,9 +300,9 @@ func TestCommitAuthor_String(t *testing.T) { t.Parallel() v := CommitAuthor{ Date: &Timestamp{}, - Name: String(""), - Email: String(""), - Login: String(""), + Name: Ptr(""), + Email: Ptr(""), + Login: Ptr(""), } want := `github.CommitAuthor{Date:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Name:"", Email:"", Login:""}` if got := v.String(); got != want { @@ -315,17 +313,17 @@ func TestCommitAuthor_String(t *testing.T) { func TestCommitFile_String(t *testing.T) { t.Parallel() v := CommitFile{ - SHA: String(""), - Filename: String(""), - Additions: Int(0), - Deletions: Int(0), - Changes: Int(0), - Status: String(""), - Patch: String(""), - BlobURL: String(""), - RawURL: String(""), - ContentsURL: String(""), - PreviousFilename: String(""), + SHA: Ptr(""), + Filename: Ptr(""), + Additions: Ptr(0), + Deletions: Ptr(0), + Changes: Ptr(0), + Status: Ptr(""), + Patch: Ptr(""), + BlobURL: Ptr(""), + RawURL: Ptr(""), + ContentsURL: Ptr(""), + PreviousFilename: Ptr(""), } want := `github.CommitFile{SHA:"", Filename:"", Additions:0, Deletions:0, Changes:0, Status:"", Patch:"", BlobURL:"", RawURL:"", ContentsURL:"", PreviousFilename:""}` if got := v.String(); got != want { @@ -336,9 +334,9 @@ func TestCommitFile_String(t *testing.T) { func TestCommitStats_String(t *testing.T) { t.Parallel() v := CommitStats{ - Additions: Int(0), - Deletions: Int(0), - Total: Int(0), + Additions: Ptr(0), + Deletions: Ptr(0), + Total: Ptr(0), } want := `github.CommitStats{Additions:0, Deletions:0, Total:0}` if got := v.String(); got != want { @@ -351,15 +349,15 @@ func TestCommitsComparison_String(t *testing.T) { v := CommitsComparison{ BaseCommit: &RepositoryCommit{}, MergeBaseCommit: &RepositoryCommit{}, - Status: String(""), - AheadBy: Int(0), - BehindBy: Int(0), - TotalCommits: Int(0), - HTMLURL: String(""), - PermalinkURL: String(""), - DiffURL: String(""), - PatchURL: String(""), - URL: String(""), + Status: Ptr(""), + AheadBy: Ptr(0), + BehindBy: Ptr(0), + TotalCommits: Ptr(0), + HTMLURL: Ptr(""), + PermalinkURL: Ptr(""), + DiffURL: Ptr(""), + PatchURL: Ptr(""), + URL: Ptr(""), } want := `github.CommitsComparison{BaseCommit:github.RepositoryCommit{}, MergeBaseCommit:github.RepositoryCommit{}, Status:"", AheadBy:0, BehindBy:0, TotalCommits:0, HTMLURL:"", PermalinkURL:"", DiffURL:"", PatchURL:"", URL:""}` if got := v.String(); got != want { @@ -371,7 +369,7 @@ func TestContributorStats_String(t *testing.T) { t.Parallel() v := ContributorStats{ Author: &Contributor{}, - Total: Int(0), + Total: Ptr(0), } want := `github.ContributorStats{Author:github.Contributor{}, Total:0}` if got := v.String(); got != want { @@ -382,7 +380,7 @@ func TestContributorStats_String(t *testing.T) { func TestDependabotSecurityUpdates_String(t *testing.T) { t.Parallel() v := DependabotSecurityUpdates{ - Status: String(""), + Status: Ptr(""), } want := `github.DependabotSecurityUpdates{Status:""}` if got := v.String(); got != want { @@ -394,17 +392,17 @@ func TestDiscussionComment_String(t *testing.T) { t.Parallel() v := DiscussionComment{ Author: &User{}, - Body: String(""), - BodyHTML: String(""), - BodyVersion: String(""), + Body: Ptr(""), + BodyHTML: Ptr(""), + BodyVersion: Ptr(""), CreatedAt: &Timestamp{}, LastEditedAt: &Timestamp{}, - DiscussionURL: String(""), - HTMLURL: String(""), - NodeID: String(""), - Number: Int(0), + DiscussionURL: Ptr(""), + HTMLURL: Ptr(""), + NodeID: Ptr(""), + Number: Ptr(0), UpdatedAt: &Timestamp{}, - URL: String(""), + URL: Ptr(""), Reactions: &Reactions{}, } want := `github.DiscussionComment{Author:github.User{}, Body:"", BodyHTML:"", BodyVersion:"", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, LastEditedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, DiscussionURL:"", HTMLURL:"", NodeID:"", Number:0, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, URL:"", Reactions:github.Reactions{}}` @@ -416,13 +414,13 @@ func TestDiscussionComment_String(t *testing.T) { func TestDraftReviewComment_String(t *testing.T) { t.Parallel() v := DraftReviewComment{ - Path: String(""), - Position: Int(0), - Body: String(""), - StartSide: String(""), - Side: String(""), - StartLine: Int(0), - Line: Int(0), + Path: Ptr(""), + Position: Ptr(0), + Body: Ptr(""), + StartSide: Ptr(""), + Side: Ptr(""), + StartLine: Ptr(0), + Line: Ptr(0), } want := `github.DraftReviewComment{Path:"", Position:0, Body:"", StartSide:"", Side:"", StartLine:0, Line:0}` if got := v.String(); got != want { @@ -433,14 +431,14 @@ func TestDraftReviewComment_String(t *testing.T) { func TestEnterprise_String(t *testing.T) { t.Parallel() v := Enterprise{ - ID: Int(0), - Slug: String(""), - Name: String(""), - NodeID: String(""), - AvatarURL: String(""), - Description: String(""), - WebsiteURL: String(""), - HTMLURL: String(""), + ID: Ptr(0), + Slug: Ptr(""), + Name: Ptr(""), + NodeID: Ptr(""), + AvatarURL: Ptr(""), + Description: Ptr(""), + WebsiteURL: Ptr(""), + HTMLURL: Ptr(""), CreatedAt: &Timestamp{}, UpdatedAt: &Timestamp{}, } @@ -453,13 +451,13 @@ func TestEnterprise_String(t *testing.T) { func TestEvent_String(t *testing.T) { t.Parallel() v := Event{ - Type: String(""), - Public: Bool(false), + Type: Ptr(""), + Public: Ptr(false), Repo: &Repository{}, Actor: &User{}, Org: &Organization{}, CreatedAt: &Timestamp{}, - ID: String(""), + ID: Ptr(""), } want := `github.Event{Type:"", Public:false, Repo:github.Repository{}, Actor:github.User{}, Org:github.Organization{}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, ID:""}` if got := v.String(); got != want { @@ -470,15 +468,15 @@ func TestEvent_String(t *testing.T) { func TestGPGKey_String(t *testing.T) { t.Parallel() v := GPGKey{ - ID: Int64(0), - PrimaryKeyID: Int64(0), - KeyID: String(""), - RawKey: String(""), - PublicKey: String(""), - CanSign: Bool(false), - CanEncryptComms: Bool(false), - CanEncryptStorage: Bool(false), - CanCertify: Bool(false), + ID: Ptr(int64(0)), + PrimaryKeyID: Ptr(int64(0)), + KeyID: Ptr(""), + RawKey: Ptr(""), + PublicKey: Ptr(""), + CanSign: Ptr(false), + CanEncryptComms: Ptr(false), + CanEncryptStorage: Ptr(false), + CanCertify: Ptr(false), CreatedAt: &Timestamp{}, ExpiresAt: &Timestamp{}, } @@ -491,17 +489,17 @@ func TestGPGKey_String(t *testing.T) { func TestGist_String(t *testing.T) { t.Parallel() v := Gist{ - ID: String(""), - Description: String(""), - Public: Bool(false), + ID: Ptr(""), + Description: Ptr(""), + Public: Ptr(false), Owner: &User{}, - Comments: Int(0), - HTMLURL: String(""), - GitPullURL: String(""), - GitPushURL: String(""), + Comments: Ptr(0), + HTMLURL: Ptr(""), + GitPullURL: Ptr(""), + GitPushURL: Ptr(""), CreatedAt: &Timestamp{}, UpdatedAt: &Timestamp{}, - NodeID: String(""), + NodeID: Ptr(""), } want := `github.Gist{ID:"", Description:"", Public:false, Owner:github.User{}, Comments:0, HTMLURL:"", GitPullURL:"", GitPushURL:"", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, NodeID:""}` if got := v.String(); got != want { @@ -512,9 +510,9 @@ func TestGist_String(t *testing.T) { func TestGistComment_String(t *testing.T) { t.Parallel() v := GistComment{ - ID: Int64(0), - URL: String(""), - Body: String(""), + ID: Ptr(int64(0)), + URL: Ptr(""), + Body: Ptr(""), User: &User{}, CreatedAt: &Timestamp{}, } @@ -527,12 +525,12 @@ func TestGistComment_String(t *testing.T) { func TestGistCommit_String(t *testing.T) { t.Parallel() v := GistCommit{ - URL: String(""), - Version: String(""), + URL: Ptr(""), + Version: Ptr(""), User: &User{}, ChangeStatus: &CommitStats{}, CommittedAt: &Timestamp{}, - NodeID: String(""), + NodeID: Ptr(""), } want := `github.GistCommit{URL:"", Version:"", User:github.User{}, ChangeStatus:github.CommitStats{}, CommittedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, NodeID:""}` if got := v.String(); got != want { @@ -543,12 +541,12 @@ func TestGistCommit_String(t *testing.T) { func TestGistFile_String(t *testing.T) { t.Parallel() v := GistFile{ - Size: Int(0), - Filename: String(""), - Language: String(""), - Type: String(""), - RawURL: String(""), - Content: String(""), + Size: Ptr(0), + Filename: Ptr(""), + Language: Ptr(""), + Type: Ptr(""), + RawURL: Ptr(""), + Content: Ptr(""), } want := `github.GistFile{Size:0, Filename:"", Language:"", Type:"", RawURL:"", Content:""}` if got := v.String(); got != want { @@ -559,12 +557,12 @@ func TestGistFile_String(t *testing.T) { func TestGistFork_String(t *testing.T) { t.Parallel() v := GistFork{ - URL: String(""), + URL: Ptr(""), User: &User{}, - ID: String(""), + ID: Ptr(""), CreatedAt: &Timestamp{}, UpdatedAt: &Timestamp{}, - NodeID: String(""), + NodeID: Ptr(""), } want := `github.GistFork{URL:"", User:github.User{}, ID:"", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, NodeID:""}` if got := v.String(); got != want { @@ -575,9 +573,9 @@ func TestGistFork_String(t *testing.T) { func TestGistStats_String(t *testing.T) { t.Parallel() v := GistStats{ - TotalGists: Int(0), - PrivateGists: Int(0), - PublicGists: Int(0), + TotalGists: Ptr(0), + PrivateGists: Ptr(0), + PublicGists: Ptr(0), } want := `github.GistStats{TotalGists:0, PrivateGists:0, PublicGists:0}` if got := v.String(); got != want { @@ -588,9 +586,9 @@ func TestGistStats_String(t *testing.T) { func TestGitObject_String(t *testing.T) { t.Parallel() v := GitObject{ - Type: String(""), - SHA: String(""), - URL: String(""), + Type: Ptr(""), + SHA: Ptr(""), + URL: Ptr(""), } want := `github.GitObject{Type:"", SHA:"", URL:""}` if got := v.String(); got != want { @@ -601,8 +599,8 @@ func TestGitObject_String(t *testing.T) { func TestGitignore_String(t *testing.T) { t.Parallel() v := Gitignore{ - Name: String(""), - Source: String(""), + Name: Ptr(""), + Source: Ptr(""), } want := `github.Gitignore{Name:"", Source:""}` if got := v.String(); got != want { @@ -613,8 +611,8 @@ func TestGitignore_String(t *testing.T) { func TestGrant_String(t *testing.T) { t.Parallel() v := Grant{ - ID: Int64(0), - URL: String(""), + ID: Ptr(int64(0)), + URL: Ptr(""), App: &AuthorizationApp{}, CreatedAt: &Timestamp{}, UpdatedAt: &Timestamp{}, @@ -629,13 +627,13 @@ func TestGrant_String(t *testing.T) { func TestHeadCommit_String(t *testing.T) { t.Parallel() v := HeadCommit{ - Message: String(""), + Message: Ptr(""), Author: &CommitAuthor{}, - URL: String(""), - Distinct: Bool(false), - SHA: String(""), - ID: String(""), - TreeID: String(""), + URL: Ptr(""), + Distinct: Ptr(false), + SHA: Ptr(""), + ID: Ptr(""), + TreeID: Ptr(""), Timestamp: &Timestamp{}, Committer: &CommitAuthor{}, Added: []string{""}, @@ -653,15 +651,15 @@ func TestHook_String(t *testing.T) { v := Hook{ CreatedAt: &Timestamp{}, UpdatedAt: &Timestamp{}, - URL: String(""), - ID: Int64(0), - Type: String(""), - Name: String(""), - TestURL: String(""), - PingURL: String(""), + URL: Ptr(""), + ID: Ptr(int64(0)), + Type: Ptr(""), + Name: Ptr(""), + TestURL: Ptr(""), + PingURL: Ptr(""), Config: &HookConfig{}, Events: []string{""}, - Active: Bool(false), + Active: Ptr(false), } want := `github.Hook{CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, URL:"", ID:0, Type:"", Name:"", TestURL:"", PingURL:"", Config:github.HookConfig{}, Events:[""], Active:false}` if got := v.String(); got != want { @@ -672,17 +670,17 @@ func TestHook_String(t *testing.T) { func TestHookDelivery_String(t *testing.T) { t.Parallel() v := HookDelivery{ - ID: Int64(0), - GUID: String(""), + ID: Ptr(int64(0)), + GUID: Ptr(""), DeliveredAt: &Timestamp{}, - Redelivery: Bool(false), - Duration: Float64(0.0), - Status: String(""), - StatusCode: Int(0), - Event: String(""), - Action: String(""), - InstallationID: Int64(0), - RepositoryID: Int64(0), + Redelivery: Ptr(false), + Duration: Ptr(0.0), + Status: Ptr(""), + StatusCode: Ptr(0), + Event: Ptr(""), + Action: Ptr(""), + InstallationID: Ptr(int64(0)), + RepositoryID: Ptr(int64(0)), Request: &HookRequest{}, Response: &HookResponse{}, } @@ -695,9 +693,9 @@ func TestHookDelivery_String(t *testing.T) { func TestHookStats_String(t *testing.T) { t.Parallel() v := HookStats{ - TotalHooks: Int(0), - ActiveHooks: Int(0), - InactiveHooks: Int(0), + TotalHooks: Ptr(0), + ActiveHooks: Ptr(0), + InactiveHooks: Ptr(0), } want := `github.HookStats{TotalHooks:0, ActiveHooks:0, InactiveHooks:0}` if got := v.String(); got != want { @@ -708,28 +706,28 @@ func TestHookStats_String(t *testing.T) { func TestImport_String(t *testing.T) { t.Parallel() v := Import{ - VCSURL: String(""), - VCS: String(""), - VCSUsername: String(""), - VCSPassword: String(""), - TFVCProject: String(""), - UseLFS: String(""), - HasLargeFiles: Bool(false), - LargeFilesSize: Int(0), - LargeFilesCount: Int(0), - Status: String(""), - CommitCount: Int(0), - StatusText: String(""), - AuthorsCount: Int(0), - Percent: Int(0), - PushPercent: Int(0), - URL: String(""), - HTMLURL: String(""), - AuthorsURL: String(""), - RepositoryURL: String(""), - Message: String(""), - FailedStep: String(""), - HumanName: String(""), + VCSURL: Ptr(""), + VCS: Ptr(""), + VCSUsername: Ptr(""), + VCSPassword: Ptr(""), + TFVCProject: Ptr(""), + UseLFS: Ptr(""), + HasLargeFiles: Ptr(false), + LargeFilesSize: Ptr(0), + LargeFilesCount: Ptr(0), + Status: Ptr(""), + CommitCount: Ptr(0), + StatusText: Ptr(""), + AuthorsCount: Ptr(0), + Percent: Ptr(0), + PushPercent: Ptr(0), + URL: Ptr(""), + HTMLURL: Ptr(""), + AuthorsURL: Ptr(""), + RepositoryURL: Ptr(""), + Message: Ptr(""), + FailedStep: Ptr(""), + HumanName: Ptr(""), } want := `github.Import{VCSURL:"", VCS:"", VCSUsername:"", VCSPassword:"", TFVCProject:"", UseLFS:"", HasLargeFiles:false, LargeFilesSize:0, LargeFilesCount:0, Status:"", CommitCount:0, StatusText:"", AuthorsCount:0, Percent:0, PushPercent:0, URL:"", HTMLURL:"", AuthorsURL:"", RepositoryURL:"", Message:"", FailedStep:"", HumanName:""}` if got := v.String(); got != want { @@ -740,24 +738,24 @@ func TestImport_String(t *testing.T) { func TestInstallation_String(t *testing.T) { t.Parallel() v := Installation{ - ID: Int64(0), - NodeID: String(""), - AppID: Int64(0), - AppSlug: String(""), - TargetID: Int64(0), + ID: Ptr(int64(0)), + NodeID: Ptr(""), + AppID: Ptr(int64(0)), + AppSlug: Ptr(""), + TargetID: Ptr(int64(0)), Account: &User{}, - AccessTokensURL: String(""), - RepositoriesURL: String(""), - HTMLURL: String(""), - TargetType: String(""), - SingleFileName: String(""), - RepositorySelection: String(""), + AccessTokensURL: Ptr(""), + RepositoriesURL: Ptr(""), + HTMLURL: Ptr(""), + TargetType: Ptr(""), + SingleFileName: Ptr(""), + RepositorySelection: Ptr(""), Events: []string{""}, SingleFilePaths: []string{""}, Permissions: &InstallationPermissions{}, CreatedAt: &Timestamp{}, UpdatedAt: &Timestamp{}, - HasMultipleSingleFiles: Bool(false), + HasMultipleSingleFiles: Ptr(false), SuspendedBy: &User{}, SuspendedAt: &Timestamp{}, } @@ -770,17 +768,17 @@ func TestInstallation_String(t *testing.T) { func TestInvitation_String(t *testing.T) { t.Parallel() v := Invitation{ - ID: Int64(0), - NodeID: String(""), - Login: String(""), - Email: String(""), - Role: String(""), + ID: Ptr(int64(0)), + NodeID: Ptr(""), + Login: Ptr(""), + Email: Ptr(""), + Role: Ptr(""), CreatedAt: &Timestamp{}, Inviter: &User{}, - TeamCount: Int(0), - InvitationTeamURL: String(""), + TeamCount: Ptr(0), + InvitationTeamURL: Ptr(""), FailedAt: &Timestamp{}, - FailedReason: String(""), + FailedReason: Ptr(""), } want := `github.Invitation{ID:0, NodeID:"", Login:"", Email:"", Role:"", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Inviter:github.User{}, TeamCount:0, InvitationTeamURL:"", FailedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, FailedReason:""}` if got := v.String(); got != want { @@ -791,34 +789,34 @@ func TestInvitation_String(t *testing.T) { func TestIssue_String(t *testing.T) { t.Parallel() v := Issue{ - ID: Int64(0), - Number: Int(0), - State: String(""), - StateReason: String(""), - Locked: Bool(false), - Title: String(""), - Body: String(""), - AuthorAssociation: String(""), + ID: Ptr(int64(0)), + Number: Ptr(0), + State: Ptr(""), + StateReason: Ptr(""), + Locked: Ptr(false), + Title: Ptr(""), + Body: Ptr(""), + AuthorAssociation: Ptr(""), User: &User{}, Assignee: &User{}, - Comments: Int(0), + Comments: Ptr(0), ClosedAt: &Timestamp{}, CreatedAt: &Timestamp{}, UpdatedAt: &Timestamp{}, ClosedBy: &User{}, - URL: String(""), - HTMLURL: String(""), - CommentsURL: String(""), - EventsURL: String(""), - LabelsURL: String(""), - RepositoryURL: String(""), + URL: Ptr(""), + HTMLURL: Ptr(""), + CommentsURL: Ptr(""), + EventsURL: Ptr(""), + LabelsURL: Ptr(""), + RepositoryURL: Ptr(""), Milestone: &Milestone{}, PullRequestLinks: &PullRequestLinks{}, Repository: &Repository{}, Reactions: &Reactions{}, - NodeID: String(""), - Draft: Bool(false), - ActiveLockReason: String(""), + NodeID: Ptr(""), + Draft: Ptr(false), + ActiveLockReason: Ptr(""), } want := `github.Issue{ID:0, Number:0, State:"", StateReason:"", Locked:false, Title:"", Body:"", AuthorAssociation:"", User:github.User{}, Assignee:github.User{}, Comments:0, ClosedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, ClosedBy:github.User{}, URL:"", HTMLURL:"", CommentsURL:"", EventsURL:"", LabelsURL:"", RepositoryURL:"", Milestone:github.Milestone{}, PullRequestLinks:github.PullRequestLinks{}, Repository:github.Repository{}, Reactions:github.Reactions{}, NodeID:"", Draft:false, ActiveLockReason:""}` if got := v.String(); got != want { @@ -829,17 +827,17 @@ func TestIssue_String(t *testing.T) { func TestIssueComment_String(t *testing.T) { t.Parallel() v := IssueComment{ - ID: Int64(0), - NodeID: String(""), - Body: String(""), + ID: Ptr(int64(0)), + NodeID: Ptr(""), + Body: Ptr(""), User: &User{}, Reactions: &Reactions{}, CreatedAt: &Timestamp{}, UpdatedAt: &Timestamp{}, - AuthorAssociation: String(""), - URL: String(""), - HTMLURL: String(""), - IssueURL: String(""), + AuthorAssociation: Ptr(""), + URL: Ptr(""), + HTMLURL: Ptr(""), + IssueURL: Ptr(""), } want := `github.IssueComment{ID:0, NodeID:"", Body:"", User:github.User{}, Reactions:github.Reactions{}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, AuthorAssociation:"", URL:"", HTMLURL:"", IssueURL:""}` if got := v.String(); got != want { @@ -850,9 +848,9 @@ func TestIssueComment_String(t *testing.T) { func TestIssueStats_String(t *testing.T) { t.Parallel() v := IssueStats{ - TotalIssues: Int(0), - OpenIssues: Int(0), - ClosedIssues: Int(0), + TotalIssues: Ptr(0), + OpenIssues: Ptr(0), + ClosedIssues: Ptr(0), } want := `github.IssueStats{TotalIssues:0, OpenIssues:0, ClosedIssues:0}` if got := v.String(); got != want { @@ -863,14 +861,14 @@ func TestIssueStats_String(t *testing.T) { func TestKey_String(t *testing.T) { t.Parallel() v := Key{ - ID: Int64(0), - Key: String(""), - URL: String(""), - Title: String(""), - ReadOnly: Bool(false), - Verified: Bool(false), + ID: Ptr(int64(0)), + Key: Ptr(""), + URL: Ptr(""), + Title: Ptr(""), + ReadOnly: Ptr(false), + Verified: Ptr(false), CreatedAt: &Timestamp{}, - AddedBy: String(""), + AddedBy: Ptr(""), LastUsed: &Timestamp{}, } want := `github.Key{ID:0, Key:"", URL:"", Title:"", ReadOnly:false, Verified:false, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, AddedBy:"", LastUsed:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}` @@ -882,13 +880,13 @@ func TestKey_String(t *testing.T) { func TestLabel_String(t *testing.T) { t.Parallel() v := Label{ - ID: Int64(0), - URL: String(""), - Name: String(""), - Color: String(""), - Description: String(""), - Default: Bool(false), - NodeID: String(""), + ID: Ptr(int64(0)), + URL: Ptr(""), + Name: Ptr(""), + Color: Ptr(""), + Description: Ptr(""), + Default: Ptr(false), + NodeID: Ptr(""), } want := `github.Label{ID:0, URL:"", Name:"", Color:"", Description:"", Default:false, NodeID:""}` if got := v.String(); got != want { @@ -899,13 +897,13 @@ func TestLabel_String(t *testing.T) { func TestLabelResult_String(t *testing.T) { t.Parallel() v := LabelResult{ - ID: Int64(0), - URL: String(""), - Name: String(""), - Color: String(""), - Default: Bool(false), - Description: String(""), - Score: Float64(0.0), + ID: Ptr(int64(0)), + URL: Ptr(""), + Name: Ptr(""), + Color: Ptr(""), + Default: Ptr(false), + Description: Ptr(""), + Score: Ptr(0.0), } want := `github.LabelResult{ID:0, URL:"", Name:"", Color:"", Default:false, Description:"", Score:0}` if got := v.String(); got != want { @@ -916,10 +914,10 @@ func TestLabelResult_String(t *testing.T) { func TestLargeFile_String(t *testing.T) { t.Parallel() v := LargeFile{ - RefName: String(""), - Path: String(""), - OID: String(""), - Size: Int(0), + RefName: Ptr(""), + Path: Ptr(""), + OID: Ptr(""), + Size: Ptr(0), } want := `github.LargeFile{RefName:"", Path:"", OID:"", Size:0}` if got := v.String(); got != want { @@ -930,15 +928,15 @@ func TestLargeFile_String(t *testing.T) { func TestLicense_String(t *testing.T) { t.Parallel() v := License{ - Key: String(""), - Name: String(""), - URL: String(""), - SPDXID: String(""), - HTMLURL: String(""), - Featured: Bool(false), - Description: String(""), - Implementation: String(""), - Body: String(""), + Key: Ptr(""), + Name: Ptr(""), + URL: Ptr(""), + SPDXID: Ptr(""), + HTMLURL: Ptr(""), + Featured: Ptr(false), + Description: Ptr(""), + Implementation: Ptr(""), + Body: Ptr(""), } want := `github.License{Key:"", Name:"", URL:"", SPDXID:"", HTMLURL:"", Featured:false, Description:"", Implementation:"", Body:""}` if got := v.String(); got != want { @@ -949,10 +947,10 @@ func TestLicense_String(t *testing.T) { func TestMembership_String(t *testing.T) { t.Parallel() v := Membership{ - URL: String(""), - State: String(""), - Role: String(""), - OrganizationURL: String(""), + URL: Ptr(""), + State: Ptr(""), + Role: Ptr(""), + OrganizationURL: Ptr(""), Organization: &Organization{}, User: &User{}, } @@ -965,14 +963,14 @@ func TestMembership_String(t *testing.T) { func TestMigration_String(t *testing.T) { t.Parallel() v := Migration{ - ID: Int64(0), - GUID: String(""), - State: String(""), - LockRepositories: Bool(false), - ExcludeAttachments: Bool(false), - URL: String(""), - CreatedAt: String(""), - UpdatedAt: String(""), + ID: Ptr(int64(0)), + GUID: Ptr(""), + State: Ptr(""), + LockRepositories: Ptr(false), + ExcludeAttachments: Ptr(false), + URL: Ptr(""), + CreatedAt: Ptr(""), + UpdatedAt: Ptr(""), } want := `github.Migration{ID:0, GUID:"", State:"", LockRepositories:false, ExcludeAttachments:false, URL:"", CreatedAt:"", UpdatedAt:""}` if got := v.String(); got != want { @@ -983,22 +981,22 @@ func TestMigration_String(t *testing.T) { func TestMilestone_String(t *testing.T) { t.Parallel() v := Milestone{ - URL: String(""), - HTMLURL: String(""), - LabelsURL: String(""), - ID: Int64(0), - Number: Int(0), - State: String(""), - Title: String(""), - Description: String(""), + URL: Ptr(""), + HTMLURL: Ptr(""), + LabelsURL: Ptr(""), + ID: Ptr(int64(0)), + Number: Ptr(0), + State: Ptr(""), + Title: Ptr(""), + Description: Ptr(""), Creator: &User{}, - OpenIssues: Int(0), - ClosedIssues: Int(0), + OpenIssues: Ptr(0), + ClosedIssues: Ptr(0), CreatedAt: &Timestamp{}, UpdatedAt: &Timestamp{}, ClosedAt: &Timestamp{}, DueOn: &Timestamp{}, - NodeID: String(""), + NodeID: Ptr(""), } want := `github.Milestone{URL:"", HTMLURL:"", LabelsURL:"", ID:0, Number:0, State:"", Title:"", Description:"", Creator:github.User{}, OpenIssues:0, ClosedIssues:0, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, ClosedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, DueOn:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, NodeID:""}` if got := v.String(); got != want { @@ -1009,9 +1007,9 @@ func TestMilestone_String(t *testing.T) { func TestMilestoneStats_String(t *testing.T) { t.Parallel() v := MilestoneStats{ - TotalMilestones: Int(0), - OpenMilestones: Int(0), - ClosedMilestones: Int(0), + TotalMilestones: Ptr(0), + OpenMilestones: Ptr(0), + ClosedMilestones: Ptr(0), } want := `github.MilestoneStats{TotalMilestones:0, OpenMilestones:0, ClosedMilestones:0}` if got := v.String(); got != want { @@ -1023,14 +1021,14 @@ func TestNewTeam_String(t *testing.T) { t.Parallel() v := NewTeam{ Name: "", - Description: String(""), + Description: Ptr(""), Maintainers: []string{""}, RepoNames: []string{""}, - ParentTeamID: Int64(0), - NotificationSetting: String(""), - Permission: String(""), - Privacy: String(""), - LDAPDN: String(""), + ParentTeamID: Ptr(int64(0)), + NotificationSetting: Ptr(""), + Permission: Ptr(""), + Privacy: Ptr(""), + LDAPDN: Ptr(""), } want := `github.NewTeam{Name:"", Description:"", Maintainers:[""], RepoNames:[""], ParentTeamID:0, NotificationSetting:"", Permission:"", Privacy:"", LDAPDN:""}` if got := v.String(); got != want { @@ -1041,9 +1039,9 @@ func TestNewTeam_String(t *testing.T) { func TestOAuthAPP_String(t *testing.T) { t.Parallel() v := OAuthAPP{ - URL: String(""), - Name: String(""), - ClientID: String(""), + URL: Ptr(""), + Name: Ptr(""), + ClientID: Ptr(""), } want := `github.OAuthAPP{URL:"", Name:"", ClientID:""}` if got := v.String(); got != want { @@ -1054,10 +1052,10 @@ func TestOAuthAPP_String(t *testing.T) { func TestOrgStats_String(t *testing.T) { t.Parallel() v := OrgStats{ - TotalOrgs: Int(0), - DisabledOrgs: Int(0), - TotalTeams: Int(0), - TotalTeamMembers: Int(0), + TotalOrgs: Ptr(0), + DisabledOrgs: Ptr(0), + TotalTeams: Ptr(0), + TotalTeamMembers: Ptr(0), } want := `github.OrgStats{TotalOrgs:0, DisabledOrgs:0, TotalTeams:0, TotalTeamMembers:0}` if got := v.String(); got != want { @@ -1068,62 +1066,62 @@ func TestOrgStats_String(t *testing.T) { func TestOrganization_String(t *testing.T) { t.Parallel() v := Organization{ - Login: String(""), - ID: Int64(0), - NodeID: String(""), - AvatarURL: String(""), - HTMLURL: String(""), - Name: String(""), - Company: String(""), - Blog: String(""), - Location: String(""), - Email: String(""), - TwitterUsername: String(""), - Description: String(""), - PublicRepos: Int(0), - PublicGists: Int(0), - Followers: Int(0), - Following: Int(0), + Login: Ptr(""), + ID: Ptr(int64(0)), + NodeID: Ptr(""), + AvatarURL: Ptr(""), + HTMLURL: Ptr(""), + Name: Ptr(""), + Company: Ptr(""), + Blog: Ptr(""), + Location: Ptr(""), + Email: Ptr(""), + TwitterUsername: Ptr(""), + Description: Ptr(""), + PublicRepos: Ptr(0), + PublicGists: Ptr(0), + Followers: Ptr(0), + Following: Ptr(0), CreatedAt: &Timestamp{}, UpdatedAt: &Timestamp{}, - TotalPrivateRepos: Int64(0), - OwnedPrivateRepos: Int64(0), - PrivateGists: Int(0), - DiskUsage: Int(0), - Collaborators: Int(0), - BillingEmail: String(""), - Type: String(""), + TotalPrivateRepos: Ptr(int64(0)), + OwnedPrivateRepos: Ptr(int64(0)), + PrivateGists: Ptr(0), + DiskUsage: Ptr(0), + Collaborators: Ptr(0), + BillingEmail: Ptr(""), + Type: Ptr(""), Plan: &Plan{}, - TwoFactorRequirementEnabled: Bool(false), - IsVerified: Bool(false), - HasOrganizationProjects: Bool(false), - HasRepositoryProjects: Bool(false), - DefaultRepoPermission: String(""), - DefaultRepoSettings: String(""), - MembersCanCreateRepos: Bool(false), - MembersCanCreatePublicRepos: Bool(false), - MembersCanCreatePrivateRepos: Bool(false), - MembersCanCreateInternalRepos: Bool(false), - MembersCanForkPrivateRepos: Bool(false), - MembersAllowedRepositoryCreationType: String(""), - MembersCanCreatePages: Bool(false), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(false), - WebCommitSignoffRequired: Bool(false), - AdvancedSecurityEnabledForNewRepos: Bool(false), - DependabotAlertsEnabledForNewRepos: Bool(false), - DependabotSecurityUpdatesEnabledForNewRepos: Bool(false), - DependencyGraphEnabledForNewRepos: Bool(false), - SecretScanningEnabledForNewRepos: Bool(false), - SecretScanningPushProtectionEnabledForNewRepos: Bool(false), - SecretScanningValidityChecksEnabled: Bool(false), - URL: String(""), - EventsURL: String(""), - HooksURL: String(""), - IssuesURL: String(""), - MembersURL: String(""), - PublicMembersURL: String(""), - ReposURL: String(""), + TwoFactorRequirementEnabled: Ptr(false), + IsVerified: Ptr(false), + HasOrganizationProjects: Ptr(false), + HasRepositoryProjects: Ptr(false), + DefaultRepoPermission: Ptr(""), + DefaultRepoSettings: Ptr(""), + MembersCanCreateRepos: Ptr(false), + MembersCanCreatePublicRepos: Ptr(false), + MembersCanCreatePrivateRepos: Ptr(false), + MembersCanCreateInternalRepos: Ptr(false), + MembersCanForkPrivateRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr(""), + MembersCanCreatePages: Ptr(false), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(false), + WebCommitSignoffRequired: Ptr(false), + AdvancedSecurityEnabledForNewRepos: Ptr(false), + DependabotAlertsEnabledForNewRepos: Ptr(false), + DependabotSecurityUpdatesEnabledForNewRepos: Ptr(false), + DependencyGraphEnabledForNewRepos: Ptr(false), + SecretScanningEnabledForNewRepos: Ptr(false), + SecretScanningPushProtectionEnabledForNewRepos: Ptr(false), + SecretScanningValidityChecksEnabled: Ptr(false), + URL: Ptr(""), + EventsURL: Ptr(""), + HooksURL: Ptr(""), + IssuesURL: Ptr(""), + MembersURL: Ptr(""), + PublicMembersURL: Ptr(""), + ReposURL: Ptr(""), } want := `github.Organization{Login:"", ID:0, NodeID:"", AvatarURL:"", HTMLURL:"", Name:"", Company:"", Blog:"", Location:"", Email:"", TwitterUsername:"", Description:"", PublicRepos:0, PublicGists:0, Followers:0, Following:0, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, 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, WebCommitSignoffRequired:false, AdvancedSecurityEnabledForNewRepos:false, DependabotAlertsEnabledForNewRepos:false, DependabotSecurityUpdatesEnabledForNewRepos:false, DependencyGraphEnabledForNewRepos:false, SecretScanningEnabledForNewRepos:false, SecretScanningPushProtectionEnabledForNewRepos:false, SecretScanningValidityChecksEnabled:false, URL:"", EventsURL:"", HooksURL:"", IssuesURL:"", MembersURL:"", PublicMembersURL:"", ReposURL:""}` if got := v.String(); got != want { @@ -1134,18 +1132,18 @@ func TestOrganization_String(t *testing.T) { func TestPackage_String(t *testing.T) { t.Parallel() v := Package{ - ID: Int64(0), - Name: String(""), - PackageType: String(""), - HTMLURL: String(""), + ID: Ptr(int64(0)), + Name: Ptr(""), + PackageType: Ptr(""), + HTMLURL: Ptr(""), CreatedAt: &Timestamp{}, UpdatedAt: &Timestamp{}, Owner: &User{}, PackageVersion: &PackageVersion{}, Registry: &PackageRegistry{}, - URL: String(""), - VersionCount: Int64(0), - Visibility: String(""), + URL: Ptr(""), + VersionCount: Ptr(int64(0)), + Visibility: Ptr(""), Repository: &Repository{}, } want := `github.Package{ID:0, Name:"", PackageType:"", HTMLURL:"", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Owner:github.User{}, PackageVersion:github.PackageVersion{}, Registry:github.PackageRegistry{}, URL:"", VersionCount:0, Visibility:"", Repository:github.Repository{}}` @@ -1168,16 +1166,16 @@ func TestPackageContainerMetadata_String(t *testing.T) { func TestPackageFile_String(t *testing.T) { t.Parallel() v := PackageFile{ - DownloadURL: String(""), - ID: Int64(0), - Name: String(""), - SHA256: String(""), - SHA1: String(""), - MD5: String(""), - ContentType: String(""), - State: String(""), + DownloadURL: Ptr(""), + ID: Ptr(int64(0)), + Name: Ptr(""), + SHA256: Ptr(""), + SHA1: Ptr(""), + MD5: Ptr(""), + ContentType: Ptr(""), + State: Ptr(""), Author: &User{}, - Size: Int64(0), + Size: Ptr(int64(0)), CreatedAt: &Timestamp{}, UpdatedAt: &Timestamp{}, } @@ -1190,7 +1188,7 @@ func TestPackageFile_String(t *testing.T) { func TestPackageMetadata_String(t *testing.T) { t.Parallel() v := PackageMetadata{ - PackageType: String(""), + PackageType: Ptr(""), Container: &PackageContainerMetadata{}, } want := `github.PackageMetadata{PackageType:"", Container:github.PackageContainerMetadata{}}` @@ -1202,11 +1200,11 @@ func TestPackageMetadata_String(t *testing.T) { func TestPackageRegistry_String(t *testing.T) { t.Parallel() v := PackageRegistry{ - AboutURL: String(""), - Name: String(""), - Type: String(""), - URL: String(""), - Vendor: String(""), + AboutURL: Ptr(""), + Name: Ptr(""), + Type: Ptr(""), + URL: Ptr(""), + Vendor: Ptr(""), } want := `github.PackageRegistry{AboutURL:"", Name:"", Type:"", URL:"", Vendor:""}` if got := v.String(); got != want { @@ -1217,15 +1215,15 @@ func TestPackageRegistry_String(t *testing.T) { func TestPackageRelease_String(t *testing.T) { t.Parallel() v := PackageRelease{ - URL: String(""), - HTMLURL: String(""), - ID: Int64(0), - TagName: String(""), - TargetCommitish: String(""), - Name: String(""), - Draft: Bool(false), + URL: Ptr(""), + HTMLURL: Ptr(""), + ID: Ptr(int64(0)), + TagName: Ptr(""), + TargetCommitish: Ptr(""), + Name: Ptr(""), + Draft: Ptr(false), Author: &User{}, - Prerelease: Bool(false), + Prerelease: Ptr(false), CreatedAt: &Timestamp{}, PublishedAt: &Timestamp{}, } @@ -1238,27 +1236,27 @@ func TestPackageRelease_String(t *testing.T) { func TestPackageVersion_String(t *testing.T) { t.Parallel() v := PackageVersion{ - ID: Int64(0), - Version: String(""), - Summary: String(""), - Body: String(""), - BodyHTML: String(""), + ID: Ptr(int64(0)), + Version: Ptr(""), + Summary: Ptr(""), + Body: Ptr(""), + BodyHTML: Ptr(""), Release: &PackageRelease{}, - Manifest: String(""), - HTMLURL: String(""), - TagName: String(""), - TargetCommitish: String(""), - TargetOID: String(""), - Draft: Bool(false), - Prerelease: Bool(false), + Manifest: Ptr(""), + HTMLURL: Ptr(""), + TagName: Ptr(""), + TargetCommitish: Ptr(""), + TargetOID: Ptr(""), + Draft: Ptr(false), + Prerelease: Ptr(false), CreatedAt: &Timestamp{}, UpdatedAt: &Timestamp{}, Author: &User{}, - InstallationCommand: String(""), + InstallationCommand: Ptr(""), Metadata: &PackageMetadata{}, - PackageHTMLURL: String(""), - Name: String(""), - URL: String(""), + PackageHTMLURL: Ptr(""), + Name: Ptr(""), + URL: Ptr(""), } want := `github.PackageVersion{ID:0, Version:"", Summary:"", Body:"", BodyHTML:"", Release:github.PackageRelease{}, Manifest:"", HTMLURL:"", TagName:"", TargetCommitish:"", TargetOID:"", Draft:false, Prerelease:false, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Author:github.User{}, InstallationCommand:"", Metadata:github.PackageMetadata{}, PackageHTMLURL:"", Name:"", URL:""}` if got := v.String(); got != want { @@ -1269,7 +1267,7 @@ func TestPackageVersion_String(t *testing.T) { func TestPageStats_String(t *testing.T) { t.Parallel() v := PageStats{ - TotalPages: Int(0), + TotalPages: Ptr(0), } want := `github.PageStats{TotalPages:0}` if got := v.String(); got != want { @@ -1280,12 +1278,12 @@ func TestPageStats_String(t *testing.T) { func TestPlan_String(t *testing.T) { t.Parallel() v := Plan{ - Name: String(""), - Space: Int(0), - Collaborators: Int(0), - PrivateRepos: Int64(0), - FilledSeats: Int(0), - Seats: Int(0), + Name: Ptr(""), + Space: Ptr(0), + Collaborators: Ptr(0), + PrivateRepos: Ptr(int64(0)), + FilledSeats: Ptr(0), + Seats: Ptr(0), } want := `github.Plan{Name:"", Space:0, Collaborators:0, PrivateRepos:0, FilledSeats:0, Seats:0}` if got := v.String(); got != want { @@ -1296,10 +1294,10 @@ func TestPlan_String(t *testing.T) { func TestPreReceiveHook_String(t *testing.T) { t.Parallel() v := PreReceiveHook{ - ID: Int64(0), - Name: String(""), - Enforcement: String(""), - ConfigURL: String(""), + ID: Ptr(int64(0)), + Name: Ptr(""), + Enforcement: Ptr(""), + ConfigURL: Ptr(""), } want := `github.PreReceiveHook{ID:0, Name:"", Enforcement:"", ConfigURL:""}` if got := v.String(); got != want { @@ -1310,20 +1308,20 @@ func TestPreReceiveHook_String(t *testing.T) { func TestProject_String(t *testing.T) { t.Parallel() v := Project{ - ID: Int64(0), - URL: String(""), - HTMLURL: String(""), - ColumnsURL: String(""), - OwnerURL: String(""), - Name: String(""), - Body: String(""), - Number: Int(0), - State: String(""), + ID: Ptr(int64(0)), + URL: Ptr(""), + HTMLURL: Ptr(""), + ColumnsURL: Ptr(""), + OwnerURL: Ptr(""), + Name: Ptr(""), + Body: Ptr(""), + Number: Ptr(0), + State: Ptr(""), CreatedAt: &Timestamp{}, UpdatedAt: &Timestamp{}, - NodeID: String(""), - OrganizationPermission: String(""), - Private: Bool(false), + NodeID: Ptr(""), + OrganizationPermission: Ptr(""), + Private: Ptr(false), Creator: &User{}, } want := `github.Project{ID:0, URL:"", HTMLURL:"", ColumnsURL:"", OwnerURL:"", Name:"", Body:"", Number:0, State:"", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, NodeID:"", OrganizationPermission:"", Private:false, Creator:github.User{}}` @@ -1335,50 +1333,50 @@ func TestProject_String(t *testing.T) { func TestPullRequest_String(t *testing.T) { t.Parallel() v := PullRequest{ - ID: Int64(0), - Number: Int(0), - State: String(""), - Locked: Bool(false), - Title: String(""), - Body: String(""), + ID: Ptr(int64(0)), + Number: Ptr(0), + State: Ptr(""), + Locked: Ptr(false), + Title: Ptr(""), + Body: Ptr(""), CreatedAt: &Timestamp{}, UpdatedAt: &Timestamp{}, ClosedAt: &Timestamp{}, MergedAt: &Timestamp{}, User: &User{}, - Draft: Bool(false), - Merged: Bool(false), - Mergeable: Bool(false), - MergeableState: String(""), + Draft: Ptr(false), + Merged: Ptr(false), + Mergeable: Ptr(false), + MergeableState: Ptr(""), MergedBy: &User{}, - MergeCommitSHA: String(""), - Rebaseable: Bool(false), - Comments: Int(0), - Commits: Int(0), - Additions: Int(0), - Deletions: Int(0), - ChangedFiles: Int(0), - URL: String(""), - HTMLURL: String(""), - IssueURL: String(""), - StatusesURL: String(""), - DiffURL: String(""), - PatchURL: String(""), - CommitsURL: String(""), - CommentsURL: String(""), - ReviewCommentsURL: String(""), - ReviewCommentURL: String(""), - ReviewComments: Int(0), + MergeCommitSHA: Ptr(""), + Rebaseable: Ptr(false), + Comments: Ptr(0), + Commits: Ptr(0), + Additions: Ptr(0), + Deletions: Ptr(0), + ChangedFiles: Ptr(0), + URL: Ptr(""), + HTMLURL: Ptr(""), + IssueURL: Ptr(""), + StatusesURL: Ptr(""), + DiffURL: Ptr(""), + PatchURL: Ptr(""), + CommitsURL: Ptr(""), + CommentsURL: Ptr(""), + ReviewCommentsURL: Ptr(""), + ReviewCommentURL: Ptr(""), + ReviewComments: Ptr(0), Assignee: &User{}, Milestone: &Milestone{}, - MaintainerCanModify: Bool(false), - AuthorAssociation: String(""), - NodeID: String(""), + MaintainerCanModify: Ptr(false), + AuthorAssociation: Ptr(""), + NodeID: Ptr(""), AutoMerge: &PullRequestAutoMerge{}, Links: &PRLinks{}, Head: &PullRequestBranch{}, Base: &PullRequestBranch{}, - ActiveLockReason: String(""), + ActiveLockReason: Ptr(""), } want := `github.PullRequest{ID:0, Number:0, State:"", Locked:false, Title:"", Body:"", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, ClosedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, MergedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, User:github.User{}, Draft:false, Merged:false, Mergeable:false, MergeableState:"", MergedBy:github.User{}, MergeCommitSHA:"", Rebaseable:false, Comments:0, Commits:0, Additions:0, Deletions:0, ChangedFiles:0, URL:"", HTMLURL:"", IssueURL:"", StatusesURL:"", DiffURL:"", PatchURL:"", CommitsURL:"", CommentsURL:"", ReviewCommentsURL:"", ReviewCommentURL:"", ReviewComments:0, Assignee:github.User{}, Milestone:github.Milestone{}, MaintainerCanModify:false, AuthorAssociation:"", NodeID:"", AutoMerge:github.PullRequestAutoMerge{}, Links:github.PRLinks{}, Head:github.PullRequestBranch{}, Base:github.PullRequestBranch{}, ActiveLockReason:""}` if got := v.String(); got != want { @@ -1389,32 +1387,32 @@ func TestPullRequest_String(t *testing.T) { func TestPullRequestComment_String(t *testing.T) { t.Parallel() v := PullRequestComment{ - ID: Int64(0), - NodeID: String(""), - InReplyTo: Int64(0), - Body: String(""), - Path: String(""), - DiffHunk: String(""), - PullRequestReviewID: Int64(0), - Position: Int(0), - OriginalPosition: Int(0), - StartLine: Int(0), - Line: Int(0), - OriginalLine: Int(0), - OriginalStartLine: Int(0), - Side: String(""), - StartSide: String(""), - CommitID: String(""), - OriginalCommitID: String(""), + ID: Ptr(int64(0)), + NodeID: Ptr(""), + InReplyTo: Ptr(int64(0)), + Body: Ptr(""), + Path: Ptr(""), + DiffHunk: Ptr(""), + PullRequestReviewID: Ptr(int64(0)), + Position: Ptr(0), + OriginalPosition: Ptr(0), + StartLine: Ptr(0), + Line: Ptr(0), + OriginalLine: Ptr(0), + OriginalStartLine: Ptr(0), + Side: Ptr(""), + StartSide: Ptr(""), + CommitID: Ptr(""), + OriginalCommitID: Ptr(""), User: &User{}, Reactions: &Reactions{}, CreatedAt: &Timestamp{}, UpdatedAt: &Timestamp{}, - AuthorAssociation: String(""), - URL: String(""), - HTMLURL: String(""), - PullRequestURL: String(""), - SubjectType: String(""), + AuthorAssociation: Ptr(""), + URL: Ptr(""), + HTMLURL: Ptr(""), + PullRequestURL: Ptr(""), + SubjectType: Ptr(""), } want := `github.PullRequestComment{ID:0, NodeID:"", InReplyTo:0, Body:"", Path:"", DiffHunk:"", PullRequestReviewID:0, Position:0, OriginalPosition:0, StartLine:0, Line:0, OriginalLine:0, OriginalStartLine:0, Side:"", StartSide:"", CommitID:"", OriginalCommitID:"", User:github.User{}, Reactions:github.Reactions{}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, AuthorAssociation:"", URL:"", HTMLURL:"", PullRequestURL:"", SubjectType:""}` if got := v.String(); got != want { @@ -1425,16 +1423,16 @@ func TestPullRequestComment_String(t *testing.T) { func TestPullRequestReview_String(t *testing.T) { t.Parallel() v := PullRequestReview{ - ID: Int64(0), - NodeID: String(""), + ID: Ptr(int64(0)), + NodeID: Ptr(""), User: &User{}, - Body: String(""), + Body: Ptr(""), SubmittedAt: &Timestamp{}, - CommitID: String(""), - HTMLURL: String(""), - PullRequestURL: String(""), - State: String(""), - AuthorAssociation: String(""), + CommitID: Ptr(""), + HTMLURL: Ptr(""), + PullRequestURL: Ptr(""), + State: Ptr(""), + AuthorAssociation: Ptr(""), } want := `github.PullRequestReview{ID:0, NodeID:"", User:github.User{}, Body:"", SubmittedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, CommitID:"", HTMLURL:"", PullRequestURL:"", State:"", AuthorAssociation:""}` if got := v.String(); got != want { @@ -1445,7 +1443,7 @@ func TestPullRequestReview_String(t *testing.T) { func TestPullRequestReviewDismissalRequest_String(t *testing.T) { t.Parallel() v := PullRequestReviewDismissalRequest{ - Message: String(""), + Message: Ptr(""), } want := `github.PullRequestReviewDismissalRequest{Message:""}` if got := v.String(); got != want { @@ -1456,10 +1454,10 @@ func TestPullRequestReviewDismissalRequest_String(t *testing.T) { func TestPullRequestReviewRequest_String(t *testing.T) { t.Parallel() v := PullRequestReviewRequest{ - NodeID: String(""), - CommitID: String(""), - Body: String(""), - Event: String(""), + NodeID: Ptr(""), + CommitID: Ptr(""), + Body: Ptr(""), + Event: Ptr(""), } want := `github.PullRequestReviewRequest{NodeID:"", CommitID:"", Body:"", Event:""}` if got := v.String(); got != want { @@ -1470,8 +1468,8 @@ func TestPullRequestReviewRequest_String(t *testing.T) { func TestPullRequestThread_String(t *testing.T) { t.Parallel() v := PullRequestThread{ - ID: Int64(0), - NodeID: String(""), + ID: Ptr(int64(0)), + NodeID: Ptr(""), } want := `github.PullRequestThread{ID:0, NodeID:""}` if got := v.String(); got != want { @@ -1482,10 +1480,10 @@ func TestPullRequestThread_String(t *testing.T) { func TestPullStats_String(t *testing.T) { t.Parallel() v := PullStats{ - TotalPulls: Int(0), - MergedPulls: Int(0), - MergablePulls: Int(0), - UnmergablePulls: Int(0), + TotalPulls: Ptr(0), + MergedPulls: Ptr(0), + MergablePulls: Ptr(0), + UnmergablePulls: Ptr(0), } want := `github.PullStats{TotalPulls:0, MergedPulls:0, MergablePulls:0, UnmergablePulls:0}` if got := v.String(); got != want { @@ -1496,19 +1494,19 @@ func TestPullStats_String(t *testing.T) { func TestPushEvent_String(t *testing.T) { t.Parallel() v := PushEvent{ - PushID: Int64(0), - Head: String(""), - Ref: String(""), - Size: Int(0), - Before: String(""), - DistinctSize: Int(0), - Action: String(""), - After: String(""), - Created: Bool(false), - Deleted: Bool(false), - Forced: Bool(false), - BaseRef: String(""), - Compare: String(""), + PushID: Ptr(int64(0)), + Head: Ptr(""), + Ref: Ptr(""), + Size: Ptr(0), + Before: Ptr(""), + DistinctSize: Ptr(0), + Action: Ptr(""), + After: Ptr(""), + Created: Ptr(false), + Deleted: Ptr(false), + Forced: Ptr(false), + BaseRef: Ptr(""), + Compare: Ptr(""), Repo: &PushEventRepository{}, HeadCommit: &HeadCommit{}, Pusher: &CommitAuthor{}, @@ -1538,10 +1536,10 @@ func TestRate_String(t *testing.T) { func TestReaction_String(t *testing.T) { t.Parallel() v := Reaction{ - ID: Int64(0), + ID: Ptr(int64(0)), User: &User{}, - NodeID: String(""), - Content: String(""), + NodeID: Ptr(""), + Content: Ptr(""), } want := `github.Reaction{ID:0, User:github.User{}, NodeID:"", Content:""}` if got := v.String(); got != want { @@ -1552,10 +1550,10 @@ func TestReaction_String(t *testing.T) { func TestReference_String(t *testing.T) { t.Parallel() v := Reference{ - Ref: String(""), - URL: String(""), + Ref: Ptr(""), + URL: Ptr(""), Object: &GitObject{}, - NodeID: String(""), + NodeID: Ptr(""), } want := `github.Reference{Ref:"", URL:"", Object:github.GitObject{}, NodeID:""}` if got := v.String(); got != want { @@ -1566,19 +1564,19 @@ func TestReference_String(t *testing.T) { func TestReleaseAsset_String(t *testing.T) { t.Parallel() v := ReleaseAsset{ - ID: Int64(0), - URL: String(""), - Name: String(""), - Label: String(""), - State: String(""), - ContentType: String(""), - Size: Int(0), - DownloadCount: Int(0), + ID: Ptr(int64(0)), + URL: Ptr(""), + Name: Ptr(""), + Label: Ptr(""), + State: Ptr(""), + ContentType: Ptr(""), + Size: Ptr(0), + DownloadCount: Ptr(0), CreatedAt: &Timestamp{}, UpdatedAt: &Timestamp{}, - BrowserDownloadURL: String(""), + BrowserDownloadURL: Ptr(""), Uploader: &User{}, - NodeID: String(""), + NodeID: Ptr(""), } want := `github.ReleaseAsset{ID:0, URL:"", Name:"", Label:"", State:"", ContentType:"", Size:0, DownloadCount:0, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, BrowserDownloadURL:"", Uploader:github.User{}, NodeID:""}` if got := v.String(); got != want { @@ -1589,8 +1587,8 @@ func TestReleaseAsset_String(t *testing.T) { func TestRename_String(t *testing.T) { t.Parallel() v := Rename{ - From: String(""), - To: String(""), + From: Ptr(""), + To: Ptr(""), } want := `github.Rename{From:"", To:""}` if got := v.String(); got != want { @@ -1601,12 +1599,12 @@ func TestRename_String(t *testing.T) { func TestRepoStats_String(t *testing.T) { t.Parallel() v := RepoStats{ - TotalRepos: Int(0), - RootRepos: Int(0), - ForkRepos: Int(0), - OrgRepos: Int(0), - TotalPushes: Int(0), - TotalWikis: Int(0), + TotalRepos: Ptr(0), + RootRepos: Ptr(0), + ForkRepos: Ptr(0), + OrgRepos: Ptr(0), + TotalPushes: Ptr(0), + TotalWikis: Ptr(0), } want := `github.RepoStats{TotalRepos:0, RootRepos:0, ForkRepos:0, OrgRepos:0, TotalPushes:0, TotalWikis:0}` if got := v.String(); got != want { @@ -1617,14 +1615,14 @@ func TestRepoStats_String(t *testing.T) { func TestRepoStatus_String(t *testing.T) { t.Parallel() v := RepoStatus{ - ID: Int64(0), - NodeID: String(""), - URL: String(""), - State: String(""), - TargetURL: String(""), - Description: String(""), - Context: String(""), - AvatarURL: String(""), + ID: Ptr(int64(0)), + NodeID: Ptr(""), + URL: Ptr(""), + State: Ptr(""), + TargetURL: Ptr(""), + Description: Ptr(""), + Context: Ptr(""), + AvatarURL: Ptr(""), Creator: &User{}, CreatedAt: &Timestamp{}, UpdatedAt: &Timestamp{}, @@ -1638,109 +1636,109 @@ func TestRepoStatus_String(t *testing.T) { func TestRepository_String(t *testing.T) { t.Parallel() v := Repository{ - ID: Int64(0), - NodeID: String(""), + ID: Ptr(int64(0)), + NodeID: Ptr(""), Owner: &User{}, - Name: String(""), - FullName: String(""), - Description: String(""), - Homepage: String(""), + Name: Ptr(""), + FullName: Ptr(""), + Description: Ptr(""), + Homepage: Ptr(""), CodeOfConduct: &CodeOfConduct{}, - DefaultBranch: String(""), - MasterBranch: String(""), + DefaultBranch: Ptr(""), + MasterBranch: Ptr(""), 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), + HTMLURL: Ptr(""), + CloneURL: Ptr(""), + GitURL: Ptr(""), + MirrorURL: Ptr(""), + SSHURL: Ptr(""), + SVNURL: Ptr(""), + Language: Ptr(""), + Fork: Ptr(false), + ForksCount: Ptr(0), + NetworkCount: Ptr(0), + OpenIssuesCount: Ptr(0), + OpenIssues: Ptr(0), + StargazersCount: Ptr(0), + SubscribersCount: Ptr(0), + WatchersCount: Ptr(0), + Watchers: Ptr(0), + Size: Ptr(0), + AutoInit: Ptr(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), - WebCommitSignoffRequired: Bool(false), - DeleteBranchOnMerge: Bool(false), - UseSquashPRTitleAsDefault: Bool(false), - SquashMergeCommitTitle: String(""), - SquashMergeCommitMessage: String(""), - MergeCommitTitle: String(""), - MergeCommitMessage: String(""), + AllowRebaseMerge: Ptr(false), + AllowUpdateBranch: Ptr(false), + AllowSquashMerge: Ptr(false), + AllowMergeCommit: Ptr(false), + AllowAutoMerge: Ptr(false), + AllowForking: Ptr(false), + WebCommitSignoffRequired: Ptr(false), + DeleteBranchOnMerge: Ptr(false), + UseSquashPRTitleAsDefault: Ptr(false), + SquashMergeCommitTitle: Ptr(""), + SquashMergeCommitMessage: Ptr(""), + MergeCommitTitle: Ptr(""), + MergeCommitMessage: Ptr(""), Topics: []string{""}, - Archived: Bool(false), - Disabled: Bool(false), + Archived: Ptr(false), + Disabled: Ptr(false), License: &License{}, - Private: Bool(false), - HasIssues: Bool(false), - HasWiki: Bool(false), - HasPages: Bool(false), - HasProjects: Bool(false), - HasDownloads: Bool(false), - HasDiscussions: Bool(false), - IsTemplate: Bool(false), - LicenseTemplate: String(""), - GitignoreTemplate: String(""), + Private: Ptr(false), + HasIssues: Ptr(false), + HasWiki: Ptr(false), + HasPages: Ptr(false), + HasProjects: Ptr(false), + HasDownloads: Ptr(false), + HasDiscussions: Ptr(false), + IsTemplate: Ptr(false), + LicenseTemplate: Ptr(""), + GitignoreTemplate: Ptr(""), 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(""), + TeamID: Ptr(int64(0)), + URL: Ptr(""), + ArchiveURL: Ptr(""), + AssigneesURL: Ptr(""), + BlobsURL: Ptr(""), + BranchesURL: Ptr(""), + CollaboratorsURL: Ptr(""), + CommentsURL: Ptr(""), + CommitsURL: Ptr(""), + CompareURL: Ptr(""), + ContentsURL: Ptr(""), + ContributorsURL: Ptr(""), + DeploymentsURL: Ptr(""), + DownloadsURL: Ptr(""), + EventsURL: Ptr(""), + ForksURL: Ptr(""), + GitCommitsURL: Ptr(""), + GitRefsURL: Ptr(""), + GitTagsURL: Ptr(""), + HooksURL: Ptr(""), + IssueCommentURL: Ptr(""), + IssueEventsURL: Ptr(""), + IssuesURL: Ptr(""), + KeysURL: Ptr(""), + LabelsURL: Ptr(""), + LanguagesURL: Ptr(""), + MergesURL: Ptr(""), + MilestonesURL: Ptr(""), + NotificationsURL: Ptr(""), + PullsURL: Ptr(""), + ReleasesURL: Ptr(""), + StargazersURL: Ptr(""), + StatusesURL: Ptr(""), + SubscribersURL: Ptr(""), + SubscriptionURL: Ptr(""), + TagsURL: Ptr(""), + TreesURL: Ptr(""), + TeamsURL: Ptr(""), + Visibility: Ptr(""), + RoleName: Ptr(""), } 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, WebCommitSignoffRequired:false, DeleteBranchOnMerge:false, UseSquashPRTitleAsDefault:false, SquashMergeCommitTitle:"", SquashMergeCommitMessage:"", MergeCommitTitle:"", MergeCommitMessage:"", Topics:[""], Archived:false, Disabled:false, License:github.License{}, Private:false, HasIssues:false, HasWiki:false, HasPages:false, HasProjects:false, HasDownloads:false, HasDiscussions: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 { @@ -1751,18 +1749,18 @@ func TestRepository_String(t *testing.T) { func TestRepositoryComment_String(t *testing.T) { t.Parallel() v := RepositoryComment{ - HTMLURL: String(""), - URL: String(""), - ID: Int64(0), - NodeID: String(""), - CommitID: String(""), + HTMLURL: Ptr(""), + URL: Ptr(""), + ID: Ptr(int64(0)), + NodeID: Ptr(""), + CommitID: Ptr(""), User: &User{}, Reactions: &Reactions{}, CreatedAt: &Timestamp{}, UpdatedAt: &Timestamp{}, - Body: String(""), - Path: String(""), - Position: Int(0), + Body: Ptr(""), + Path: Ptr(""), + Position: Ptr(0), } want := `github.RepositoryComment{HTMLURL:"", URL:"", ID:0, NodeID:"", CommitID:"", User:github.User{}, Reactions:github.Reactions{}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Body:"", Path:"", Position:0}` if got := v.String(); got != want { @@ -1773,14 +1771,14 @@ func TestRepositoryComment_String(t *testing.T) { func TestRepositoryCommit_String(t *testing.T) { t.Parallel() v := RepositoryCommit{ - NodeID: String(""), - SHA: String(""), + NodeID: Ptr(""), + SHA: Ptr(""), Commit: &Commit{}, Author: &User{}, Committer: &User{}, - HTMLURL: String(""), - URL: String(""), - CommentsURL: String(""), + HTMLURL: Ptr(""), + URL: Ptr(""), + CommentsURL: Ptr(""), Stats: &CommitStats{}, } want := `github.RepositoryCommit{NodeID:"", SHA:"", Commit:github.Commit{}, Author:github.User{}, Committer:github.User{}, HTMLURL:"", URL:"", CommentsURL:"", Stats:github.CommitStats{}}` @@ -1792,19 +1790,19 @@ func TestRepositoryCommit_String(t *testing.T) { func TestRepositoryContent_String(t *testing.T) { t.Parallel() v := RepositoryContent{ - Type: String(""), - Target: String(""), - Encoding: String(""), - Size: Int(0), - Name: String(""), - Path: String(""), - Content: String(""), - SHA: String(""), - URL: String(""), - GitURL: String(""), - HTMLURL: String(""), - DownloadURL: String(""), - SubmoduleGitURL: String(""), + Type: Ptr(""), + Target: Ptr(""), + Encoding: Ptr(""), + Size: Ptr(0), + Name: Ptr(""), + Path: Ptr(""), + Content: Ptr(""), + SHA: Ptr(""), + URL: Ptr(""), + GitURL: Ptr(""), + HTMLURL: Ptr(""), + DownloadURL: Ptr(""), + SubmoduleGitURL: Ptr(""), } want := `github.RepositoryContent{Type:"", Target:"", Encoding:"", Size:0, Name:"", Path:"", Content:"", SHA:"", URL:"", GitURL:"", HTMLURL:"", DownloadURL:"", SubmoduleGitURL:""}` if got := v.String(); got != want { @@ -1815,17 +1813,17 @@ func TestRepositoryContent_String(t *testing.T) { func TestRepositoryLicense_String(t *testing.T) { t.Parallel() v := RepositoryLicense{ - Name: String(""), - Path: String(""), - SHA: String(""), - Size: Int(0), - URL: String(""), - HTMLURL: String(""), - GitURL: String(""), - DownloadURL: String(""), - Type: String(""), - Content: String(""), - Encoding: String(""), + Name: Ptr(""), + Path: Ptr(""), + SHA: Ptr(""), + Size: Ptr(0), + URL: Ptr(""), + HTMLURL: Ptr(""), + GitURL: Ptr(""), + DownloadURL: Ptr(""), + Type: Ptr(""), + Content: Ptr(""), + Encoding: Ptr(""), License: &License{}, } want := `github.RepositoryLicense{Name:"", Path:"", SHA:"", Size:0, URL:"", HTMLURL:"", GitURL:"", DownloadURL:"", Type:"", Content:"", Encoding:"", License:github.License{}}` @@ -1849,26 +1847,26 @@ func TestRepositoryParticipation_String(t *testing.T) { func TestRepositoryRelease_String(t *testing.T) { t.Parallel() v := RepositoryRelease{ - TagName: String(""), - TargetCommitish: String(""), - Name: String(""), - Body: String(""), - Draft: Bool(false), - Prerelease: Bool(false), - MakeLatest: String(""), - DiscussionCategoryName: String(""), - GenerateReleaseNotes: Bool(false), - ID: Int64(0), + TagName: Ptr(""), + TargetCommitish: Ptr(""), + Name: Ptr(""), + Body: Ptr(""), + Draft: Ptr(false), + Prerelease: Ptr(false), + MakeLatest: Ptr(""), + DiscussionCategoryName: Ptr(""), + GenerateReleaseNotes: Ptr(false), + ID: Ptr(int64(0)), CreatedAt: &Timestamp{}, PublishedAt: &Timestamp{}, - URL: String(""), - HTMLURL: String(""), - AssetsURL: String(""), - UploadURL: String(""), - ZipballURL: String(""), - TarballURL: String(""), + URL: Ptr(""), + HTMLURL: Ptr(""), + AssetsURL: Ptr(""), + UploadURL: Ptr(""), + ZipballURL: Ptr(""), + TarballURL: Ptr(""), Author: &User{}, - NodeID: String(""), + NodeID: Ptr(""), } want := `github.RepositoryRelease{TagName:"", TargetCommitish:"", Name:"", Body:"", Draft:false, Prerelease:false, MakeLatest:"", DiscussionCategoryName:"", GenerateReleaseNotes:false, ID:0, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, PublishedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, URL:"", HTMLURL:"", AssetsURL:"", UploadURL:"", ZipballURL:"", TarballURL:"", Author:github.User{}, NodeID:""}` if got := v.String(); got != want { @@ -1890,9 +1888,9 @@ func TestSBOM_String(t *testing.T) { func TestSSHSigningKey_String(t *testing.T) { t.Parallel() v := SSHSigningKey{ - ID: Int64(0), - Key: String(""), - Title: String(""), + ID: Ptr(int64(0)), + Key: Ptr(""), + Title: Ptr(""), CreatedAt: &Timestamp{}, } want := `github.SSHSigningKey{ID:0, Key:"", Title:"", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}` @@ -1904,7 +1902,7 @@ func TestSSHSigningKey_String(t *testing.T) { func TestSecretScanning_String(t *testing.T) { t.Parallel() v := SecretScanning{ - Status: String(""), + Status: Ptr(""), } want := `github.SecretScanning{Status:""}` if got := v.String(); got != want { @@ -1915,7 +1913,7 @@ func TestSecretScanning_String(t *testing.T) { func TestSecretScanningPushProtection_String(t *testing.T) { t.Parallel() v := SecretScanningPushProtection{ - Status: String(""), + Status: Ptr(""), } want := `github.SecretScanningPushProtection{Status:""}` if got := v.String(); got != want { @@ -1941,13 +1939,13 @@ func TestSecurityAndAnalysis_String(t *testing.T) { func TestSourceImportAuthor_String(t *testing.T) { t.Parallel() v := SourceImportAuthor{ - ID: Int64(0), - RemoteID: String(""), - RemoteName: String(""), - Email: String(""), - Name: String(""), - URL: String(""), - ImportURL: String(""), + ID: Ptr(int64(0)), + RemoteID: Ptr(""), + RemoteName: Ptr(""), + Email: Ptr(""), + Name: Ptr(""), + URL: Ptr(""), + ImportURL: Ptr(""), } want := `github.SourceImportAuthor{ID:0, RemoteID:"", RemoteName:"", Email:"", Name:"", URL:"", ImportURL:""}` if got := v.String(); got != want { @@ -1958,23 +1956,23 @@ func TestSourceImportAuthor_String(t *testing.T) { func TestTeam_String(t *testing.T) { t.Parallel() v := Team{ - ID: Int64(0), - NodeID: String(""), - Name: String(""), - Description: String(""), - URL: String(""), - Slug: String(""), - Permission: String(""), - Privacy: String(""), - MembersCount: Int(0), - ReposCount: Int(0), + ID: Ptr(int64(0)), + NodeID: Ptr(""), + Name: Ptr(""), + Description: Ptr(""), + URL: Ptr(""), + Slug: Ptr(""), + Permission: Ptr(""), + Privacy: Ptr(""), + MembersCount: Ptr(0), + ReposCount: Ptr(0), Organization: &Organization{}, - HTMLURL: String(""), - MembersURL: String(""), - RepositoriesURL: String(""), + HTMLURL: Ptr(""), + MembersURL: Ptr(""), + RepositoriesURL: Ptr(""), Parent: &Team{}, - LDAPDN: String(""), - Assignment: String(""), + LDAPDN: Ptr(""), + Assignment: Ptr(""), } want := `github.Team{ID:0, NodeID:"", Name:"", Description:"", URL:"", Slug:"", Permission:"", Privacy:"", MembersCount:0, ReposCount:0, Organization:github.Organization{}, HTMLURL:"", MembersURL:"", RepositoriesURL:"", Parent:github.Team{}, LDAPDN:"", Assignment:""}` if got := v.String(); got != want { @@ -1986,22 +1984,22 @@ func TestTeamDiscussion_String(t *testing.T) { t.Parallel() v := TeamDiscussion{ Author: &User{}, - Body: String(""), - BodyHTML: String(""), - BodyVersion: String(""), - CommentsCount: Int(0), - CommentsURL: String(""), + Body: Ptr(""), + BodyHTML: Ptr(""), + BodyVersion: Ptr(""), + CommentsCount: Ptr(0), + CommentsURL: Ptr(""), CreatedAt: &Timestamp{}, LastEditedAt: &Timestamp{}, - HTMLURL: String(""), - NodeID: String(""), - Number: Int(0), - Pinned: Bool(false), - Private: Bool(false), - TeamURL: String(""), - Title: String(""), + HTMLURL: Ptr(""), + NodeID: Ptr(""), + Number: Ptr(0), + Pinned: Ptr(false), + Private: Ptr(false), + TeamURL: Ptr(""), + Title: Ptr(""), UpdatedAt: &Timestamp{}, - URL: String(""), + URL: Ptr(""), Reactions: &Reactions{}, } want := `github.TeamDiscussion{Author:github.User{}, Body:"", BodyHTML:"", BodyVersion:"", CommentsCount:0, CommentsURL:"", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, LastEditedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, HTMLURL:"", NodeID:"", Number:0, Pinned:false, Private:false, TeamURL:"", Title:"", UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, URL:"", Reactions:github.Reactions{}}` @@ -2013,16 +2011,16 @@ func TestTeamDiscussion_String(t *testing.T) { func TestTeamLDAPMapping_String(t *testing.T) { t.Parallel() v := TeamLDAPMapping{ - ID: Int64(0), - LDAPDN: String(""), - URL: String(""), - Name: String(""), - Slug: String(""), - Description: String(""), - Privacy: String(""), - Permission: String(""), - MembersURL: String(""), - RepositoriesURL: String(""), + ID: Ptr(int64(0)), + LDAPDN: Ptr(""), + URL: Ptr(""), + Name: Ptr(""), + Slug: Ptr(""), + Description: Ptr(""), + Privacy: Ptr(""), + Permission: Ptr(""), + MembersURL: Ptr(""), + RepositoriesURL: Ptr(""), } want := `github.TeamLDAPMapping{ID:0, LDAPDN:"", URL:"", Name:"", Slug:"", Description:"", Privacy:"", Permission:"", MembersURL:"", RepositoriesURL:""}` if got := v.String(); got != want { @@ -2033,10 +2031,10 @@ func TestTeamLDAPMapping_String(t *testing.T) { func TestTextMatch_String(t *testing.T) { t.Parallel() v := TextMatch{ - ObjectURL: String(""), - ObjectType: String(""), - Property: String(""), - Fragment: String(""), + ObjectURL: Ptr(""), + ObjectType: Ptr(""), + Property: Ptr(""), + Fragment: Ptr(""), } want := `github.TextMatch{ObjectURL:"", ObjectType:"", Property:"", Fragment:""}` if got := v.String(); got != want { @@ -2047,8 +2045,8 @@ func TestTextMatch_String(t *testing.T) { func TestTree_String(t *testing.T) { t.Parallel() v := Tree{ - SHA: String(""), - Truncated: Bool(false), + SHA: Ptr(""), + Truncated: Ptr(false), } want := `github.Tree{SHA:"", Truncated:false}` if got := v.String(); got != want { @@ -2059,13 +2057,13 @@ func TestTree_String(t *testing.T) { func TestTreeEntry_String(t *testing.T) { t.Parallel() v := TreeEntry{ - SHA: String(""), - Path: String(""), - Mode: String(""), - Type: String(""), - Size: Int(0), - Content: String(""), - URL: String(""), + SHA: Ptr(""), + Path: Ptr(""), + Mode: Ptr(""), + Type: Ptr(""), + Size: Ptr(0), + Content: Ptr(""), + URL: Ptr(""), } want := `github.TreeEntry{SHA:"", Path:"", Mode:"", Type:"", Size:0, Content:"", URL:""}` if got := v.String(); got != want { @@ -2076,49 +2074,49 @@ func TestTreeEntry_String(t *testing.T) { func TestUser_String(t *testing.T) { t.Parallel() v := User{ - Login: String(""), - ID: Int64(0), - NodeID: String(""), - AvatarURL: String(""), - HTMLURL: String(""), - GravatarID: String(""), - Name: String(""), - Company: String(""), - Blog: String(""), - Location: String(""), - Email: String(""), - Hireable: Bool(false), - Bio: String(""), - TwitterUsername: String(""), - PublicRepos: Int(0), - PublicGists: Int(0), - Followers: Int(0), - Following: Int(0), + Login: Ptr(""), + ID: Ptr(int64(0)), + NodeID: Ptr(""), + AvatarURL: Ptr(""), + HTMLURL: Ptr(""), + GravatarID: Ptr(""), + Name: Ptr(""), + Company: Ptr(""), + Blog: Ptr(""), + Location: Ptr(""), + Email: Ptr(""), + Hireable: Ptr(false), + Bio: Ptr(""), + TwitterUsername: Ptr(""), + PublicRepos: Ptr(0), + PublicGists: Ptr(0), + Followers: Ptr(0), + Following: Ptr(0), CreatedAt: &Timestamp{}, UpdatedAt: &Timestamp{}, SuspendedAt: &Timestamp{}, - Type: String(""), - SiteAdmin: Bool(false), - TotalPrivateRepos: Int64(0), - OwnedPrivateRepos: Int64(0), - PrivateGists: Int(0), - DiskUsage: Int(0), - Collaborators: Int(0), - TwoFactorAuthentication: Bool(false), + Type: Ptr(""), + SiteAdmin: Ptr(false), + TotalPrivateRepos: Ptr(int64(0)), + OwnedPrivateRepos: Ptr(int64(0)), + PrivateGists: Ptr(0), + DiskUsage: Ptr(0), + Collaborators: Ptr(0), + TwoFactorAuthentication: Ptr(false), Plan: &Plan{}, - LdapDn: String(""), - URL: String(""), - EventsURL: String(""), - FollowingURL: String(""), - FollowersURL: String(""), - GistsURL: String(""), - OrganizationsURL: String(""), - ReceivedEventsURL: String(""), - ReposURL: String(""), - StarredURL: String(""), - SubscriptionsURL: String(""), - RoleName: String(""), - Assignment: String(""), + LdapDn: Ptr(""), + URL: Ptr(""), + EventsURL: Ptr(""), + FollowingURL: Ptr(""), + FollowersURL: Ptr(""), + GistsURL: Ptr(""), + OrganizationsURL: Ptr(""), + ReceivedEventsURL: Ptr(""), + ReposURL: Ptr(""), + StarredURL: Ptr(""), + SubscriptionsURL: Ptr(""), + RoleName: Ptr(""), + Assignment: Ptr(""), InheritedFrom: &Team{}, } want := `github.User{Login:"", ID:0, NodeID:"", AvatarURL:"", HTMLURL:"", GravatarID:"", Name:"", Company:"", Blog:"", Location:"", Email:"", Hireable:false, Bio:"", TwitterUsername:"", PublicRepos:0, PublicGists:0, Followers:0, Following:0, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, SuspendedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Type:"", SiteAdmin:false, TotalPrivateRepos:0, OwnedPrivateRepos:0, PrivateGists:0, DiskUsage:0, Collaborators:0, TwoFactorAuthentication:false, Plan:github.Plan{}, LdapDn:"", URL:"", EventsURL:"", FollowingURL:"", FollowersURL:"", GistsURL:"", OrganizationsURL:"", ReceivedEventsURL:"", ReposURL:"", StarredURL:"", SubscriptionsURL:"", RoleName:"", Assignment:"", InheritedFrom:github.Team{}}` @@ -2130,23 +2128,23 @@ func TestUser_String(t *testing.T) { func TestUserLDAPMapping_String(t *testing.T) { t.Parallel() v := UserLDAPMapping{ - ID: Int64(0), - LDAPDN: String(""), - Login: String(""), - AvatarURL: String(""), - GravatarID: String(""), - Type: String(""), - SiteAdmin: Bool(false), - URL: String(""), - EventsURL: String(""), - FollowingURL: String(""), - FollowersURL: String(""), - GistsURL: String(""), - OrganizationsURL: String(""), - ReceivedEventsURL: String(""), - ReposURL: String(""), - StarredURL: String(""), - SubscriptionsURL: String(""), + ID: Ptr(int64(0)), + LDAPDN: Ptr(""), + Login: Ptr(""), + AvatarURL: Ptr(""), + GravatarID: Ptr(""), + Type: Ptr(""), + SiteAdmin: Ptr(false), + URL: Ptr(""), + EventsURL: Ptr(""), + FollowingURL: Ptr(""), + FollowersURL: Ptr(""), + GistsURL: Ptr(""), + OrganizationsURL: Ptr(""), + ReceivedEventsURL: Ptr(""), + ReposURL: Ptr(""), + StarredURL: Ptr(""), + SubscriptionsURL: Ptr(""), } want := `github.UserLDAPMapping{ID:0, LDAPDN:"", Login:"", AvatarURL:"", GravatarID:"", Type:"", SiteAdmin:false, URL:"", EventsURL:"", FollowingURL:"", FollowersURL:"", GistsURL:"", OrganizationsURL:"", ReceivedEventsURL:"", ReposURL:"", StarredURL:"", SubscriptionsURL:""}` if got := v.String(); got != want { @@ -2157,14 +2155,14 @@ func TestUserLDAPMapping_String(t *testing.T) { func TestUserMigration_String(t *testing.T) { t.Parallel() v := UserMigration{ - ID: Int64(0), - GUID: String(""), - State: String(""), - LockRepositories: Bool(false), - ExcludeAttachments: Bool(false), - URL: String(""), - CreatedAt: String(""), - UpdatedAt: String(""), + ID: Ptr(int64(0)), + GUID: Ptr(""), + State: Ptr(""), + LockRepositories: Ptr(false), + ExcludeAttachments: Ptr(false), + URL: Ptr(""), + CreatedAt: Ptr(""), + UpdatedAt: Ptr(""), } want := `github.UserMigration{ID:0, GUID:"", State:"", LockRepositories:false, ExcludeAttachments:false, URL:"", CreatedAt:"", UpdatedAt:""}` if got := v.String(); got != want { @@ -2175,9 +2173,9 @@ func TestUserMigration_String(t *testing.T) { func TestUserStats_String(t *testing.T) { t.Parallel() v := UserStats{ - TotalUsers: Int(0), - AdminUsers: Int(0), - SuspendedUsers: Int(0), + TotalUsers: Ptr(0), + AdminUsers: Ptr(0), + SuspendedUsers: Ptr(0), } want := `github.UserStats{TotalUsers:0, AdminUsers:0, SuspendedUsers:0}` if got := v.String(); got != want { @@ -2189,7 +2187,7 @@ func TestWeeklyCommitActivity_String(t *testing.T) { t.Parallel() v := WeeklyCommitActivity{ Days: []int{0}, - Total: Int(0), + Total: Ptr(0), Week: &Timestamp{}, } want := `github.WeeklyCommitActivity{Days:[0], Total:0, Week:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}` @@ -2202,9 +2200,9 @@ func TestWeeklyStats_String(t *testing.T) { t.Parallel() v := WeeklyStats{ Week: &Timestamp{}, - Additions: Int(0), - Deletions: Int(0), - Commits: Int(0), + Additions: Ptr(0), + Deletions: Ptr(0), + Commits: Ptr(0), } want := `github.WeeklyStats{Week:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Additions:0, Deletions:0, Commits:0}` if got := v.String(); got != want { diff --git a/github/github.go b/github/github.go index 4f94f2481a4..2590d061ee1 100644 --- a/github/github.go +++ b/github/github.go @@ -1582,20 +1582,34 @@ func (c *Client) roundTripWithOptionalFollowRedirect(ctx context.Context, u stri return resp, err } +// Ptr is a helper routine that allocates a new T value +// to store v and returns a pointer to it. +func Ptr[T any](v T) *T { + return &v +} + // Bool is a helper routine that allocates a new bool value // to store v and returns a pointer to it. +// +// Deprecated: use Ptr instead. func Bool(v bool) *bool { return &v } // Int is a helper routine that allocates a new int value // to store v and returns a pointer to it. +// +// Deprecated: use Ptr instead. func Int(v int) *int { return &v } // Int64 is a helper routine that allocates a new int64 value // to store v and returns a pointer to it. +// +// Deprecated: use Ptr instead. func Int64(v int64) *int64 { return &v } // String is a helper routine that allocates a new string value // to store v and returns a pointer to it. +// +// Deprecated: use Ptr instead. func String(v string) *string { return &v } // roundTripperFunc creates a RoundTripper (transport). diff --git a/github/github_test.go b/github/github_test.go index 48ac2ab26e5..43c9bde4f82 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -506,7 +506,7 @@ func TestNewRequest(t *testing.T) { c := NewClient(nil) inURL, outURL := "/foo", defaultBaseURL+"foo" - inBody, outBody := &User{Login: String("l")}, `{"login":"l"}`+"\n" + inBody, outBody := &User{Login: Ptr("l")}, `{"login":"l"}`+"\n" req, _ := c.NewRequest("GET", inURL, inBody) // test that relative URL was expanded @@ -2923,3 +2923,18 @@ func TestClientCopy_leak_transport(t *testing.T) { assertNoDiff(t, "Bearer bob", bob.GetLogin()) } + +func TestPtr(t *testing.T) { + t.Parallel() + equal := func(t *testing.T, want, got any) { + t.Helper() + if !reflect.DeepEqual(want, got) { + t.Errorf("want %#v, got %#v", want, got) + } + } + + equal(t, true, *Ptr(true)) + equal(t, int(10), *Ptr(int(10))) + equal(t, int64(-10), *Ptr(int64(-10))) + equal(t, "str", *Ptr("str")) +} diff --git a/github/gitignore_test.go b/github/gitignore_test.go index 25e6f4ea9eb..43b9ea86531 100644 --- a/github/gitignore_test.go +++ b/github/gitignore_test.go @@ -59,7 +59,7 @@ func TestGitignoresService_Get(t *testing.T) { t.Errorf("Gitignores.List returned error: %v", err) } - want := &Gitignore{Name: String("Name"), Source: String("template source")} + want := &Gitignore{Name: Ptr("Name"), Source: Ptr("template source")} if !cmp.Equal(gitignore, want) { t.Errorf("Gitignores.Get returned %+v, want %+v", gitignore, want) } @@ -93,8 +93,8 @@ func TestGitignore_Marshal(t *testing.T) { testJSONMarshal(t, &Gitignore{}, "{}") u := &Gitignore{ - Name: String("name"), - Source: String("source"), + Name: Ptr("name"), + Source: Ptr("source"), } want := `{ diff --git a/github/interactions_orgs.go b/github/interactions_orgs.go index f0ba0b15f04..47998c4eefb 100644 --- a/github/interactions_orgs.go +++ b/github/interactions_orgs.go @@ -47,7 +47,7 @@ func (s *InteractionsService) GetRestrictionsForOrg(ctx context.Context, organiz func (s *InteractionsService) UpdateRestrictionsForOrg(ctx context.Context, organization, limit string) (*InteractionRestriction, *Response, error) { u := fmt.Sprintf("orgs/%v/interaction-limits", organization) - interaction := &InteractionRestriction{Limit: String(limit)} + interaction := &InteractionRestriction{Limit: Ptr(limit)} req, err := s.client.NewRequest("PUT", u, interaction) if err != nil { diff --git a/github/interactions_orgs_test.go b/github/interactions_orgs_test.go index b0521dee6cc..d482cb6cea9 100644 --- a/github/interactions_orgs_test.go +++ b/github/interactions_orgs_test.go @@ -31,7 +31,7 @@ func TestInteractionsService_GetRestrictionsForOrgs(t *testing.T) { t.Errorf("Interactions.GetRestrictionsForOrg returned error: %v", err) } - want := &InteractionRestriction{Origin: String("organization")} + want := &InteractionRestriction{Origin: Ptr("organization")} if !cmp.Equal(organizationInteractions, want) { t.Errorf("Interactions.GetRestrictionsForOrg returned %+v, want %+v", organizationInteractions, want) } @@ -55,7 +55,7 @@ func TestInteractionsService_UpdateRestrictionsForOrg(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &InteractionRestriction{Limit: String("existing_users")} + input := &InteractionRestriction{Limit: Ptr("existing_users")} mux.HandleFunc("/orgs/o/interaction-limits", func(w http.ResponseWriter, r *http.Request) { v := new(InteractionRestriction) @@ -75,7 +75,7 @@ func TestInteractionsService_UpdateRestrictionsForOrg(t *testing.T) { t.Errorf("Interactions.UpdateRestrictionsForOrg returned error: %v", err) } - want := &InteractionRestriction{Origin: String("organization")} + want := &InteractionRestriction{Origin: Ptr("organization")} if !cmp.Equal(organizationInteractions, want) { t.Errorf("Interactions.UpdateRestrictionsForOrg returned %+v, want %+v", organizationInteractions, want) } diff --git a/github/interactions_repos.go b/github/interactions_repos.go index 9c044badd19..58fd4f04f30 100644 --- a/github/interactions_repos.go +++ b/github/interactions_repos.go @@ -47,7 +47,7 @@ func (s *InteractionsService) GetRestrictionsForRepo(ctx context.Context, owner, func (s *InteractionsService) UpdateRestrictionsForRepo(ctx context.Context, owner, repo, limit string) (*InteractionRestriction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/interaction-limits", owner, repo) - interaction := &InteractionRestriction{Limit: String(limit)} + interaction := &InteractionRestriction{Limit: Ptr(limit)} req, err := s.client.NewRequest("PUT", u, interaction) if err != nil { diff --git a/github/interactions_repos_test.go b/github/interactions_repos_test.go index 51093e57bcb..6107986b93a 100644 --- a/github/interactions_repos_test.go +++ b/github/interactions_repos_test.go @@ -31,7 +31,7 @@ func TestInteractionsService_GetRestrictionsForRepo(t *testing.T) { t.Errorf("Interactions.GetRestrictionsForRepo returned error: %v", err) } - want := &InteractionRestriction{Origin: String("repository")} + want := &InteractionRestriction{Origin: Ptr("repository")} if !cmp.Equal(repoInteractions, want) { t.Errorf("Interactions.GetRestrictionsForRepo returned %+v, want %+v", repoInteractions, want) } @@ -55,7 +55,7 @@ func TestInteractionsService_UpdateRestrictionsForRepo(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &InteractionRestriction{Limit: String("existing_users")} + input := &InteractionRestriction{Limit: Ptr("existing_users")} mux.HandleFunc("/repos/o/r/interaction-limits", func(w http.ResponseWriter, r *http.Request) { v := new(InteractionRestriction) @@ -75,7 +75,7 @@ func TestInteractionsService_UpdateRestrictionsForRepo(t *testing.T) { t.Errorf("Interactions.UpdateRestrictionsForRepo returned error: %v", err) } - want := &InteractionRestriction{Origin: String("repository")} + want := &InteractionRestriction{Origin: Ptr("repository")} if !cmp.Equal(repoInteractions, want) { t.Errorf("Interactions.UpdateRestrictionsForRepo returned %+v, want %+v", repoInteractions, want) } diff --git a/github/interactions_test.go b/github/interactions_test.go index ac2d0e31649..c52f32c9e32 100644 --- a/github/interactions_test.go +++ b/github/interactions_test.go @@ -12,8 +12,8 @@ func TestInteractionRestriction_Marshal(t *testing.T) { testJSONMarshal(t, &InteractionRestriction{}, "{}") u := &InteractionRestriction{ - Limit: String("limit"), - Origin: String("origin"), + Limit: Ptr("limit"), + Origin: Ptr("origin"), ExpiresAt: &Timestamp{referenceTime}, } diff --git a/github/issue_import_test.go b/github/issue_import_test.go index cf925ac2b1c..fd081d0d233 100644 --- a/github/issue_import_test.go +++ b/github/issue_import_test.go @@ -23,11 +23,11 @@ func TestIssueImportService_Create(t *testing.T) { createdAt := time.Date(2020, time.August, 11, 15, 30, 0, 0, time.UTC) input := &IssueImportRequest{ IssueImport: IssueImport{ - Assignee: String("developer"), + Assignee: Ptr("developer"), Body: "Dummy description", CreatedAt: &Timestamp{createdAt}, Labels: []string{"l1", "l2"}, - Milestone: Int(1), + Milestone: Ptr(1), Title: "Dummy Issue", }, Comments: []*Comment{{ @@ -81,11 +81,11 @@ func TestIssueImportService_Create_deferred(t *testing.T) { createdAt := time.Date(2020, time.August, 11, 15, 30, 0, 0, time.UTC) input := &IssueImportRequest{ IssueImport: IssueImport{ - Assignee: String("developer"), + Assignee: Ptr("developer"), Body: "Dummy description", CreatedAt: &Timestamp{createdAt}, Labels: []string{"l1", "l2"}, - Milestone: Int(1), + Milestone: Ptr(1), Title: "Dummy Issue", }, Comments: []*Comment{{ @@ -127,11 +127,11 @@ func TestIssueImportService_Create_badResponse(t *testing.T) { createdAt := time.Date(2020, time.August, 11, 15, 30, 0, 0, time.UTC) input := &IssueImportRequest{ IssueImport: IssueImport{ - Assignee: String("developer"), + Assignee: Ptr("developer"), Body: "Dummy description", CreatedAt: &Timestamp{createdAt}, Labels: []string{"l1", "l2"}, - Milestone: Int(1), + Milestone: Ptr(1), Title: "Dummy Issue", }, Comments: []*Comment{{ @@ -288,11 +288,11 @@ var issueImportResponseJSON = []byte(`{ }`) var wantIssueImportResponse = &IssueImportResponse{ - ID: Int(3), - Status: String("pending"), - URL: String("https://api.github.com/repos/o/r/import/issues/3"), - ImportIssuesURL: String("https://api.github.com/repos/o/r/import/issues"), - RepositoryURL: String("https://api.github.com/repos/o/r"), + ID: Ptr(3), + Status: Ptr("pending"), + URL: Ptr("https://api.github.com/repos/o/r/import/issues/3"), + ImportIssuesURL: Ptr("https://api.github.com/repos/o/r/import/issues"), + RepositoryURL: Ptr("https://api.github.com/repos/o/r"), } func TestIssueImportError_Marshal(t *testing.T) { @@ -300,11 +300,11 @@ func TestIssueImportError_Marshal(t *testing.T) { testJSONMarshal(t, &IssueImportError{}, "{}") u := &IssueImportError{ - Location: String("loc"), - Resource: String("res"), - Field: String("field"), - Value: String("value"), - Code: String("code"), + Location: Ptr("loc"), + Resource: Ptr("res"), + Field: Ptr("field"), + Value: Ptr("value"), + Code: Ptr("code"), } want := `{ @@ -323,22 +323,22 @@ func TestIssueImportResponse_Marshal(t *testing.T) { testJSONMarshal(t, &IssueImportResponse{}, "{}") u := &IssueImportResponse{ - ID: Int(1), - Status: String("status"), - URL: String("url"), - ImportIssuesURL: String("iiu"), - RepositoryURL: String("ru"), + ID: Ptr(1), + Status: Ptr("status"), + URL: Ptr("url"), + ImportIssuesURL: Ptr("iiu"), + RepositoryURL: Ptr("ru"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - Message: String("msg"), - DocumentationURL: String("durl"), + Message: Ptr("msg"), + DocumentationURL: Ptr("durl"), Errors: []*IssueImportError{ { - Location: String("loc"), - Resource: String("res"), - Field: String("field"), - Value: String("value"), - Code: String("code"), + Location: Ptr("loc"), + Resource: Ptr("res"), + Field: Ptr("field"), + Value: Ptr("value"), + Code: Ptr("code"), }, }, } @@ -394,9 +394,9 @@ func TestIssueImport_Marshal(t *testing.T) { CreatedAt: &Timestamp{referenceTime}, ClosedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - Assignee: String("a"), - Milestone: Int(1), - Closed: Bool(false), + Assignee: Ptr("a"), + Milestone: Ptr(1), + Closed: Ptr(false), Labels: []string{"l"}, } @@ -428,9 +428,9 @@ func TestIssueImportRequest_Marshal(t *testing.T) { CreatedAt: &Timestamp{referenceTime}, ClosedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - Assignee: String("a"), - Milestone: Int(1), - Closed: Bool(false), + Assignee: Ptr("a"), + Milestone: Ptr(1), + Closed: Ptr(false), Labels: []string{"l"}, }, Comments: []*Comment{ diff --git a/github/issues_assignees_test.go b/github/issues_assignees_test.go index 183624eabc6..88f0e0e42b3 100644 --- a/github/issues_assignees_test.go +++ b/github/issues_assignees_test.go @@ -32,7 +32,7 @@ func TestIssuesService_ListAssignees(t *testing.T) { t.Errorf("Issues.ListAssignees returned error: %v", err) } - want := []*User{{ID: Int64(1)}} + want := []*User{{ID: Ptr(int64(1))}} if !cmp.Equal(assignees, want) { t.Errorf("Issues.ListAssignees returned %+v, want %+v", assignees, want) } @@ -192,7 +192,7 @@ func TestIssuesService_AddAssignees(t *testing.T) { t.Errorf("Issues.AddAssignees returned error: %v", err) } - want := &Issue{Number: Int(1), Assignees: []*User{{Login: String("user1")}, {Login: String("user2")}}} + want := &Issue{Number: Ptr(1), Assignees: []*User{{Login: Ptr("user1")}, {Login: Ptr("user2")}}} if !cmp.Equal(got, want) { t.Errorf("Issues.AddAssignees = %+v, want %+v", got, want) } @@ -236,7 +236,7 @@ func TestIssuesService_RemoveAssignees(t *testing.T) { t.Errorf("Issues.RemoveAssignees returned error: %v", err) } - want := &Issue{Number: Int(1), Assignees: []*User{}} + want := &Issue{Number: Ptr(1), Assignees: []*User{}} if !cmp.Equal(got, want) { t.Errorf("Issues.RemoveAssignees = %+v, want %+v", got, want) } diff --git a/github/issues_comments_test.go b/github/issues_comments_test.go index 03fe4c37e71..aa9ed2b1146 100644 --- a/github/issues_comments_test.go +++ b/github/issues_comments_test.go @@ -34,8 +34,8 @@ func TestIssuesService_ListComments_allIssues(t *testing.T) { since := time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC) opt := &IssueListCommentsOptions{ - Sort: String("updated"), - Direction: String("desc"), + Sort: Ptr("updated"), + Direction: Ptr("desc"), Since: &since, ListOptions: ListOptions{Page: 2}, } @@ -45,7 +45,7 @@ func TestIssuesService_ListComments_allIssues(t *testing.T) { t.Errorf("Issues.ListComments returned error: %v", err) } - want := []*IssueComment{{ID: Int64(1)}} + want := []*IssueComment{{ID: Ptr(int64(1))}} if !cmp.Equal(comments, want) { t.Errorf("Issues.ListComments returned %+v, want %+v", comments, want) } @@ -81,7 +81,7 @@ func TestIssuesService_ListComments_specificIssue(t *testing.T) { t.Errorf("Issues.ListComments returned error: %v", err) } - want := []*IssueComment{{ID: Int64(1)}} + want := []*IssueComment{{ID: Ptr(int64(1))}} if !cmp.Equal(comments, want) { t.Errorf("Issues.ListComments returned %+v, want %+v", comments, want) } @@ -126,7 +126,7 @@ func TestIssuesService_GetComment(t *testing.T) { t.Errorf("Issues.GetComment returned error: %v", err) } - want := &IssueComment{ID: Int64(1)} + want := &IssueComment{ID: Ptr(int64(1))} if !cmp.Equal(comment, want) { t.Errorf("Issues.GetComment returned %+v, want %+v", comment, want) } @@ -159,7 +159,7 @@ func TestIssuesService_CreateComment(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &IssueComment{Body: String("b")} + input := &IssueComment{Body: Ptr("b")} mux.HandleFunc("/repos/o/r/issues/1/comments", func(w http.ResponseWriter, r *http.Request) { v := new(IssueComment) @@ -179,7 +179,7 @@ func TestIssuesService_CreateComment(t *testing.T) { t.Errorf("Issues.CreateComment returned error: %v", err) } - want := &IssueComment{ID: Int64(1)} + want := &IssueComment{ID: Ptr(int64(1))} if !cmp.Equal(comment, want) { t.Errorf("Issues.CreateComment returned %+v, want %+v", comment, want) } @@ -212,7 +212,7 @@ func TestIssuesService_EditComment(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &IssueComment{Body: String("b")} + input := &IssueComment{Body: Ptr("b")} mux.HandleFunc("/repos/o/r/issues/comments/1", func(w http.ResponseWriter, r *http.Request) { v := new(IssueComment) @@ -232,7 +232,7 @@ func TestIssuesService_EditComment(t *testing.T) { t.Errorf("Issues.EditComment returned error: %v", err) } - want := &IssueComment{ID: Int64(1)} + want := &IssueComment{ID: Ptr(int64(1))} if !cmp.Equal(comment, want) { t.Errorf("Issues.EditComment returned %+v, want %+v", comment, want) } @@ -300,36 +300,36 @@ func TestIssueComment_Marshal(t *testing.T) { testJSONMarshal(t, &IssueComment{}, "{}") u := &IssueComment{ - ID: Int64(1), - NodeID: String("nid"), - Body: String("body"), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + Body: Ptr("body"), User: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - Reactions: &Reactions{TotalCount: Int(1)}, + Reactions: &Reactions{TotalCount: Ptr(1)}, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - AuthorAssociation: String("aa"), - URL: String("url"), - HTMLURL: String("hurl"), - IssueURL: String("iurl"), + AuthorAssociation: Ptr("aa"), + URL: Ptr("url"), + HTMLURL: Ptr("hurl"), + IssueURL: Ptr("iurl"), } want := `{ diff --git a/github/issues_events_test.go b/github/issues_events_test.go index 89152d70faa..6e4a9685af2 100644 --- a/github/issues_events_test.go +++ b/github/issues_events_test.go @@ -35,7 +35,7 @@ func TestIssuesService_ListIssueEvents(t *testing.T) { t.Errorf("Issues.ListIssueEvents returned error: %v", err) } - want := []*IssueEvent{{ID: Int64(1)}} + want := []*IssueEvent{{ID: Ptr(int64(1))}} if !cmp.Equal(events, want) { t.Errorf("Issues.ListIssueEvents returned %+v, want %+v", events, want) } @@ -75,7 +75,7 @@ func TestIssuesService_ListRepositoryEvents(t *testing.T) { t.Errorf("Issues.ListRepositoryEvents returned error: %v", err) } - want := []*IssueEvent{{ID: Int64(1)}} + want := []*IssueEvent{{ID: Ptr(int64(1))}} if !cmp.Equal(events, want) { t.Errorf("Issues.ListRepositoryEvents returned %+v, want %+v", events, want) } @@ -110,7 +110,7 @@ func TestIssuesService_GetEvent(t *testing.T) { t.Errorf("Issues.GetEvent returned error: %v", err) } - want := &IssueEvent{ID: Int64(1)} + want := &IssueEvent{ID: Ptr(int64(1))} if !cmp.Equal(event, want) { t.Errorf("Issues.GetEvent returned %+v, want %+v", event, want) } @@ -135,8 +135,8 @@ func TestRename_Marshal(t *testing.T) { testJSONMarshal(t, &Rename{}, "{}") u := &Rename{ - From: String("from"), - To: String("to"), + From: Ptr("from"), + To: Ptr("to"), } want := `{ @@ -152,10 +152,10 @@ func TestDismissedReview_Marshal(t *testing.T) { testJSONMarshal(t, &DismissedReview{}, "{}") u := &DismissedReview{ - State: String("state"), - ReviewID: Int64(1), - DismissalMessage: String("dm"), - DismissalCommitID: String("dcid"), + State: Ptr("state"), + ReviewID: Ptr(int64(1)), + DismissalMessage: Ptr("dm"), + DismissalCommitID: Ptr("dcid"), } want := `{ @@ -173,179 +173,179 @@ func TestIssueEvent_Marshal(t *testing.T) { testJSONMarshal(t, &IssueEvent{}, "{}") u := &IssueEvent{ - ID: Int64(1), - URL: String("url"), + ID: Ptr(int64(1)), + URL: Ptr("url"), Actor: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - Event: String("event"), + Event: Ptr("event"), CreatedAt: &Timestamp{referenceTime}, - Issue: &Issue{ID: Int64(1)}, + Issue: &Issue{ID: Ptr(int64(1))}, Assignee: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, Assigner: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - CommitID: String("cid"), - Milestone: &Milestone{ID: Int64(1)}, - Label: &Label{ID: Int64(1)}, + CommitID: Ptr("cid"), + Milestone: &Milestone{ID: Ptr(int64(1))}, + Label: &Label{ID: Ptr(int64(1))}, Rename: &Rename{ - From: String("from"), - To: String("to"), + From: Ptr("from"), + To: Ptr("to"), }, - LockReason: String("lr"), - ProjectCard: &ProjectCard{ID: Int64(1)}, + LockReason: Ptr("lr"), + ProjectCard: &ProjectCard{ID: Ptr(int64(1))}, DismissedReview: &DismissedReview{ - State: String("state"), - ReviewID: Int64(1), - DismissalMessage: String("dm"), - DismissalCommitID: String("dcid"), + State: Ptr("state"), + ReviewID: Ptr(int64(1)), + DismissalMessage: Ptr("dm"), + DismissalCommitID: Ptr("dcid"), }, RequestedReviewer: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, RequestedTeam: &Team{ - ID: Int64(1), - NodeID: String("n"), - Name: String("n"), - Description: String("d"), - URL: String("u"), - Slug: String("s"), - Permission: String("p"), - Privacy: String("p"), - MembersCount: Int(1), - ReposCount: Int(1), - MembersURL: String("m"), - RepositoriesURL: String("r"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + Name: Ptr("n"), + Description: Ptr("d"), + URL: Ptr("u"), + Slug: Ptr("s"), + Permission: Ptr("p"), + Privacy: Ptr("p"), + MembersCount: Ptr(1), + ReposCount: Ptr(1), + MembersURL: Ptr("m"), + RepositoriesURL: Ptr("r"), Organization: &Organization{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - AvatarURL: String("a"), - HTMLURL: String("h"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + AvatarURL: Ptr("a"), + HTMLURL: Ptr("h"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), }, Parent: &Team{ - ID: Int64(1), - NodeID: String("n"), - Name: String("n"), - Description: String("d"), - URL: String("u"), - Slug: String("s"), - Permission: String("p"), - Privacy: String("p"), - MembersCount: Int(1), - ReposCount: Int(1), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + Name: Ptr("n"), + Description: Ptr("d"), + URL: Ptr("u"), + Slug: Ptr("s"), + Permission: Ptr("p"), + Privacy: Ptr("p"), + MembersCount: Ptr(1), + ReposCount: Ptr(1), }, - LDAPDN: String("l"), + LDAPDN: Ptr("l"), }, PerformedViaGithubApp: &App{ - ID: Int64(1), - NodeID: String("n"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), Owner: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, - Name: String("n"), - Description: String("d"), - HTMLURL: String("h"), - ExternalURL: String("u"), + Name: Ptr("n"), + Description: Ptr("d"), + HTMLURL: Ptr("h"), + ExternalURL: Ptr("u"), }, ReviewRequester: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, diff --git a/github/issues_labels_test.go b/github/issues_labels_test.go index 81b483e2a92..fd14153b6ab 100644 --- a/github/issues_labels_test.go +++ b/github/issues_labels_test.go @@ -32,7 +32,7 @@ func TestIssuesService_ListLabels(t *testing.T) { t.Errorf("Issues.ListLabels returned error: %v", err) } - want := []*Label{{Name: String("a")}, {Name: String("b")}} + want := []*Label{{Name: Ptr("a")}, {Name: Ptr("b")}} if !cmp.Equal(labels, want) { t.Errorf("Issues.ListLabels returned %+v, want %+v", labels, want) } @@ -76,7 +76,7 @@ func TestIssuesService_GetLabel(t *testing.T) { t.Errorf("Issues.GetLabel returned error: %v", err) } - want := &Label{URL: String("u"), Name: String("n"), Color: String("c"), Description: String("d")} + want := &Label{URL: Ptr("u"), Name: Ptr("n"), Color: Ptr("c"), Description: Ptr("d")} if !cmp.Equal(label, want) { t.Errorf("Issues.GetLabel returned %+v, want %+v", label, want) } @@ -109,7 +109,7 @@ func TestIssuesService_CreateLabel(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &Label{Name: String("n")} + input := &Label{Name: Ptr("n")} mux.HandleFunc("/repos/o/r/labels", func(w http.ResponseWriter, r *http.Request) { v := new(Label) @@ -129,7 +129,7 @@ func TestIssuesService_CreateLabel(t *testing.T) { t.Errorf("Issues.CreateLabel returned error: %v", err) } - want := &Label{URL: String("u")} + want := &Label{URL: Ptr("u")} if !cmp.Equal(label, want) { t.Errorf("Issues.CreateLabel returned %+v, want %+v", label, want) } @@ -162,7 +162,7 @@ func TestIssuesService_EditLabel(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &Label{Name: String("z")} + input := &Label{Name: Ptr("z")} mux.HandleFunc("/repos/o/r/labels/n", func(w http.ResponseWriter, r *http.Request) { v := new(Label) @@ -182,7 +182,7 @@ func TestIssuesService_EditLabel(t *testing.T) { t.Errorf("Issues.EditLabel returned error: %v", err) } - want := &Label{URL: String("u")} + want := &Label{URL: Ptr("u")} if !cmp.Equal(label, want) { t.Errorf("Issues.EditLabel returned %+v, want %+v", label, want) } @@ -263,8 +263,8 @@ func TestIssuesService_ListLabelsByIssue(t *testing.T) { } want := []*Label{ - {Name: String("a"), ID: Int64(1)}, - {Name: String("b"), ID: Int64(2)}, + {Name: Ptr("a"), ID: Ptr(int64(1))}, + {Name: Ptr("b"), ID: Ptr(int64(2))}, } if !cmp.Equal(labels, want) { t.Errorf("Issues.ListLabelsByIssue returned %+v, want %+v", labels, want) @@ -318,7 +318,7 @@ func TestIssuesService_AddLabelsToIssue(t *testing.T) { t.Errorf("Issues.AddLabelsToIssue returned error: %v", err) } - want := []*Label{{URL: String("u")}} + want := []*Label{{URL: Ptr("u")}} if !cmp.Equal(labels, want) { t.Errorf("Issues.AddLabelsToIssue returned %+v, want %+v", labels, want) } @@ -405,7 +405,7 @@ func TestIssuesService_ReplaceLabelsForIssue(t *testing.T) { t.Errorf("Issues.ReplaceLabelsForIssue returned error: %v", err) } - want := []*Label{{URL: String("u")}} + want := []*Label{{URL: Ptr("u")}} if !cmp.Equal(labels, want) { t.Errorf("Issues.ReplaceLabelsForIssue returned %+v, want %+v", labels, want) } @@ -485,7 +485,7 @@ func TestIssuesService_ListLabelsForMilestone(t *testing.T) { t.Errorf("Issues.ListLabelsForMilestone returned error: %v", err) } - want := []*Label{{Name: String("a")}, {Name: String("b")}} + want := []*Label{{Name: Ptr("a")}, {Name: Ptr("b")}} if !cmp.Equal(labels, want) { t.Errorf("Issues.ListLabelsForMilestone returned %+v, want %+v", labels, want) } @@ -519,13 +519,13 @@ func TestLabel_Marshal(t *testing.T) { testJSONMarshal(t, &Label{}, "{}") u := &Label{ - ID: Int64(1), - URL: String("url"), - Name: String("name"), - Color: String("color"), - Description: String("desc"), - Default: Bool(false), - NodeID: String("nid"), + ID: Ptr(int64(1)), + URL: Ptr("url"), + Name: Ptr("name"), + Color: Ptr("color"), + Description: Ptr("desc"), + Default: Ptr(false), + NodeID: Ptr("nid"), } want := `{ diff --git a/github/issues_milestones_test.go b/github/issues_milestones_test.go index 4444dd63fa2..8b6e17e4ea7 100644 --- a/github/issues_milestones_test.go +++ b/github/issues_milestones_test.go @@ -37,7 +37,7 @@ func TestIssuesService_ListMilestones(t *testing.T) { t.Errorf("IssuesService.ListMilestones returned error: %v", err) } - want := []*Milestone{{Number: Int(1)}} + want := []*Milestone{{Number: Ptr(1)}} if !cmp.Equal(milestones, want) { t.Errorf("IssuesService.ListMilestones returned %+v, want %+v", milestones, want) } @@ -81,7 +81,7 @@ func TestIssuesService_GetMilestone(t *testing.T) { t.Errorf("IssuesService.GetMilestone returned error: %v", err) } - want := &Milestone{Number: Int(1)} + want := &Milestone{Number: Ptr(1)} if !cmp.Equal(milestone, want) { t.Errorf("IssuesService.GetMilestone returned %+v, want %+v", milestone, want) } @@ -114,7 +114,7 @@ func TestIssuesService_CreateMilestone(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &Milestone{Title: String("t")} + input := &Milestone{Title: Ptr("t")} mux.HandleFunc("/repos/o/r/milestones", func(w http.ResponseWriter, r *http.Request) { v := new(Milestone) @@ -134,7 +134,7 @@ func TestIssuesService_CreateMilestone(t *testing.T) { t.Errorf("IssuesService.CreateMilestone returned error: %v", err) } - want := &Milestone{Number: Int(1)} + want := &Milestone{Number: Ptr(1)} if !cmp.Equal(milestone, want) { t.Errorf("IssuesService.CreateMilestone returned %+v, want %+v", milestone, want) } @@ -167,7 +167,7 @@ func TestIssuesService_EditMilestone(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &Milestone{Title: String("t")} + input := &Milestone{Title: Ptr("t")} mux.HandleFunc("/repos/o/r/milestones/1", func(w http.ResponseWriter, r *http.Request) { v := new(Milestone) @@ -187,7 +187,7 @@ func TestIssuesService_EditMilestone(t *testing.T) { t.Errorf("IssuesService.EditMilestone returned error: %v", err) } - want := &Milestone{Number: Int(1)} + want := &Milestone{Number: Ptr(1)} if !cmp.Equal(milestone, want) { t.Errorf("IssuesService.EditMilestone returned %+v, want %+v", milestone, want) } @@ -255,41 +255,41 @@ func TestMilestone_Marshal(t *testing.T) { testJSONMarshal(t, &Milestone{}, "{}") u := &Milestone{ - URL: String("url"), - HTMLURL: String("hurl"), - LabelsURL: String("lurl"), - ID: Int64(1), - Number: Int(1), - State: String("state"), - Title: String("title"), - Description: String("desc"), + URL: Ptr("url"), + HTMLURL: Ptr("hurl"), + LabelsURL: Ptr("lurl"), + ID: Ptr(int64(1)), + Number: Ptr(1), + State: Ptr("state"), + Title: Ptr("title"), + Description: Ptr("desc"), Creator: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("tu"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("tu"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - OpenIssues: Int(1), - ClosedIssues: Int(1), + OpenIssues: Ptr(1), + ClosedIssues: Ptr(1), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, ClosedAt: &Timestamp{referenceTime}, DueOn: &Timestamp{referenceTime}, - NodeID: String("nid"), + NodeID: Ptr("nid"), } want := `{ diff --git a/github/issues_test.go b/github/issues_test.go index e4f0cace74a..4ac67981d40 100644 --- a/github/issues_test.go +++ b/github/issues_test.go @@ -47,7 +47,7 @@ func TestIssuesService_List_all(t *testing.T) { t.Errorf("Issues.List returned error: %v", err) } - want := []*Issue{{Number: Int(1)}} + want := []*Issue{{Number: Ptr(1)}} if !cmp.Equal(issues, want) { t.Errorf("Issues.List returned %+v, want %+v", issues, want) } @@ -78,7 +78,7 @@ func TestIssuesService_List_owned(t *testing.T) { t.Errorf("Issues.List returned error: %v", err) } - want := []*Issue{{Number: Int(1)}} + want := []*Issue{{Number: Ptr(1)}} if !cmp.Equal(issues, want) { t.Errorf("Issues.List returned %+v, want %+v", issues, want) } @@ -100,7 +100,7 @@ func TestIssuesService_ListByOrg(t *testing.T) { t.Errorf("Issues.ListByOrg returned error: %v", err) } - want := []*Issue{{Number: Int(1)}} + want := []*Issue{{Number: Ptr(1)}} if !cmp.Equal(issues, want) { t.Errorf("Issues.List returned %+v, want %+v", issues, want) } @@ -170,7 +170,7 @@ func TestIssuesService_ListByRepo(t *testing.T) { t.Errorf("Issues.ListByOrg returned error: %v", err) } - want := []*Issue{{Number: Int(1)}} + want := []*Issue{{Number: Ptr(1)}} if !cmp.Equal(issues, want) { t.Errorf("Issues.List returned %+v, want %+v", issues, want) } @@ -216,12 +216,12 @@ func TestIssuesService_Get(t *testing.T) { } want := &Issue{ - Number: Int(1), - AuthorAssociation: String("MEMBER"), + Number: Ptr(1), + AuthorAssociation: Ptr("MEMBER"), Labels: []*Label{{ - URL: String("u"), - Name: String("n"), - Color: String("c"), + URL: Ptr("u"), + Name: Ptr("n"), + Color: Ptr("c"), }}, } if !cmp.Equal(issue, want) { @@ -257,9 +257,9 @@ func TestIssuesService_Create(t *testing.T) { client, mux, _ := setup(t) input := &IssueRequest{ - Title: String("t"), - Body: String("b"), - Assignee: String("a"), + Title: Ptr("t"), + Body: Ptr("b"), + Assignee: Ptr("a"), Labels: &[]string{"l1", "l2"}, } @@ -281,7 +281,7 @@ func TestIssuesService_Create(t *testing.T) { t.Errorf("Issues.Create returned error: %v", err) } - want := &Issue{Number: Int(1)} + want := &Issue{Number: Ptr(1)} if !cmp.Equal(issue, want) { t.Errorf("Issues.Create returned %+v, want %+v", issue, want) } @@ -314,7 +314,7 @@ func TestIssuesService_Edit(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &IssueRequest{Title: String("t")} + input := &IssueRequest{Title: Ptr("t")} mux.HandleFunc("/repos/o/r/issues/1", func(w http.ResponseWriter, r *http.Request) { v := new(IssueRequest) @@ -334,7 +334,7 @@ func TestIssuesService_Edit(t *testing.T) { t.Errorf("Issues.Edit returned error: %v", err) } - want := &Issue{Number: Int(1)} + want := &Issue{Number: Ptr(1)} if !cmp.Equal(issue, want) { t.Errorf("Issues.Edit returned %+v, want %+v", issue, want) } @@ -369,7 +369,7 @@ func TestIssuesService_RemoveMilestone(t *testing.T) { t.Errorf("Issues.RemoveMilestone returned error: %v", err) } - want := &Issue{Number: Int(1)} + want := &Issue{Number: Ptr(1)} if !cmp.Equal(issue, want) { t.Errorf("Issues.RemoveMilestone returned %+v, want %+v", issue, want) } @@ -473,7 +473,7 @@ func TestIsPullRequest(t *testing.T) { if i.IsPullRequest() { t.Errorf("expected i.IsPullRequest (%v) to return false, got true", i) } - i.PullRequestLinks = &PullRequestLinks{URL: String("http://example.com")} + i.PullRequestLinks = &PullRequestLinks{URL: Ptr("http://example.com")} if !i.IsPullRequest() { t.Errorf("expected i.IsPullRequest (%v) to return true, got false", i) } @@ -499,10 +499,10 @@ func TestPullRequestLinks_Marshal(t *testing.T) { testJSONMarshal(t, &PullRequestLinks{}, "{}") u := &PullRequestLinks{ - URL: String("url"), - HTMLURL: String("hurl"), - DiffURL: String("durl"), - PatchURL: String("purl"), + URL: Ptr("url"), + HTMLURL: Ptr("hurl"), + DiffURL: Ptr("durl"), + PatchURL: Ptr("purl"), MergedAt: &Timestamp{referenceTime}, } @@ -522,12 +522,12 @@ func TestIssueRequest_Marshal(t *testing.T) { testJSONMarshal(t, &IssueRequest{}, "{}") u := &IssueRequest{ - Title: String("url"), - Body: String("url"), + Title: Ptr("url"), + Body: Ptr("url"), Labels: &[]string{"l"}, - Assignee: String("url"), - State: String("url"), - Milestone: Int(1), + Assignee: Ptr("url"), + State: Ptr("url"), + Milestone: Ptr(1), Assignees: &[]string{"a"}, } @@ -553,35 +553,35 @@ func TestIssue_Marshal(t *testing.T) { testJSONMarshal(t, &Issue{}, "{}") u := &Issue{ - ID: Int64(1), - Number: Int(1), - State: String("s"), - Locked: Bool(false), - Title: String("title"), - Body: String("body"), - AuthorAssociation: String("aa"), - User: &User{ID: Int64(1)}, - Labels: []*Label{{ID: Int64(1)}}, - Assignee: &User{ID: Int64(1)}, - Comments: Int(1), + ID: Ptr(int64(1)), + Number: Ptr(1), + State: Ptr("s"), + Locked: Ptr(false), + Title: Ptr("title"), + Body: Ptr("body"), + AuthorAssociation: Ptr("aa"), + User: &User{ID: Ptr(int64(1))}, + Labels: []*Label{{ID: Ptr(int64(1))}}, + Assignee: &User{ID: Ptr(int64(1))}, + Comments: Ptr(1), ClosedAt: &Timestamp{referenceTime}, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - ClosedBy: &User{ID: Int64(1)}, - URL: String("url"), - HTMLURL: String("hurl"), - CommentsURL: String("curl"), - EventsURL: String("eurl"), - LabelsURL: String("lurl"), - RepositoryURL: String("rurl"), - Milestone: &Milestone{ID: Int64(1)}, - PullRequestLinks: &PullRequestLinks{URL: String("url")}, - Repository: &Repository{ID: Int64(1)}, - Reactions: &Reactions{TotalCount: Int(1)}, - Assignees: []*User{{ID: Int64(1)}}, - NodeID: String("nid"), - TextMatches: []*TextMatch{{ObjectURL: String("ourl")}}, - ActiveLockReason: String("alr"), + ClosedBy: &User{ID: Ptr(int64(1))}, + URL: Ptr("url"), + HTMLURL: Ptr("hurl"), + CommentsURL: Ptr("curl"), + EventsURL: Ptr("eurl"), + LabelsURL: Ptr("lurl"), + RepositoryURL: Ptr("rurl"), + Milestone: &Milestone{ID: Ptr(int64(1))}, + PullRequestLinks: &PullRequestLinks{URL: Ptr("url")}, + Repository: &Repository{ID: Ptr(int64(1))}, + Reactions: &Reactions{TotalCount: Ptr(1)}, + Assignees: []*User{{ID: Ptr(int64(1))}}, + NodeID: Ptr("nid"), + TextMatches: []*TextMatch{{ObjectURL: Ptr("ourl")}}, + ActiveLockReason: Ptr("alr"), } want := `{ diff --git a/github/issues_timeline_test.go b/github/issues_timeline_test.go index d89043f589a..b5b33c4c5e8 100644 --- a/github/issues_timeline_test.go +++ b/github/issues_timeline_test.go @@ -37,7 +37,7 @@ func TestIssuesService_ListIssueTimeline(t *testing.T) { t.Errorf("Issues.ListIssueTimeline returned error: %v", err) } - want := []*Timeline{{ID: Int64(1)}} + want := []*Timeline{{ID: Ptr(int64(1))}} if !cmp.Equal(events, want) { t.Errorf("Issues.ListIssueTimeline = %+v, want %+v", events, want) } @@ -62,19 +62,19 @@ func TestSource_Marshal(t *testing.T) { testJSONMarshal(t, &Source{}, "{}") u := &Source{ - ID: Int64(1), - URL: String("url"), + ID: Ptr(int64(1)), + URL: Ptr("url"), Actor: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, - Type: String("type"), - Issue: &Issue{ID: Int64(1)}, + Type: Ptr("type"), + Issue: &Issue{ID: Ptr(int64(1))}, } want := `{ @@ -103,75 +103,75 @@ func TestTimeline_Marshal(t *testing.T) { testJSONMarshal(t, &Timeline{}, "{}") u := &Timeline{ - ID: Int64(1), - URL: String("url"), - CommitURL: String("curl"), + ID: Ptr(int64(1)), + URL: Ptr("url"), + CommitURL: Ptr("curl"), Actor: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - Event: String("event"), - CommitID: String("cid"), + Event: Ptr("event"), + CommitID: Ptr("cid"), CreatedAt: &Timestamp{referenceTime}, - Label: &Label{ID: Int64(1)}, + Label: &Label{ID: Ptr(int64(1))}, Assignee: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - Milestone: &Milestone{ID: Int64(1)}, + Milestone: &Milestone{ID: Ptr(int64(1))}, Source: &Source{ - ID: Int64(1), - URL: String("url"), + ID: Ptr(int64(1)), + URL: Ptr("url"), Actor: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, - Type: String("type"), - Issue: &Issue{ID: Int64(1)}, + Type: Ptr("type"), + Issue: &Issue{ID: Ptr(int64(1))}, }, Rename: &Rename{ - From: String("from"), - To: String("to"), + From: Ptr("from"), + To: Ptr("to"), }, - ProjectCard: &ProjectCard{ID: Int64(1)}, - State: String("state"), + ProjectCard: &ProjectCard{ID: Ptr(int64(1))}, + State: Ptr("state"), } want := `{ diff --git a/github/licenses_test.go b/github/licenses_test.go index 1a9b1f2e882..51b37c48e69 100644 --- a/github/licenses_test.go +++ b/github/licenses_test.go @@ -19,30 +19,30 @@ func TestRepositoryLicense_Marshal(t *testing.T) { testJSONMarshal(t, &RepositoryLicense{}, "{}") rl := &RepositoryLicense{ - Name: String("n"), - Path: String("p"), - SHA: String("s"), - Size: Int(1), - URL: String("u"), - HTMLURL: String("h"), - GitURL: String("g"), - DownloadURL: String("d"), - Type: String("t"), - Content: String("c"), - Encoding: String("e"), + Name: Ptr("n"), + Path: Ptr("p"), + SHA: Ptr("s"), + Size: Ptr(1), + URL: Ptr("u"), + HTMLURL: Ptr("h"), + GitURL: Ptr("g"), + DownloadURL: Ptr("d"), + Type: Ptr("t"), + Content: Ptr("c"), + Encoding: Ptr("e"), License: &License{ - Key: String("k"), - Name: String("n"), - URL: String("u"), - SPDXID: String("s"), - HTMLURL: String("h"), - Featured: Bool(true), - Description: String("d"), - Implementation: String("i"), + Key: Ptr("k"), + Name: Ptr("n"), + URL: Ptr("u"), + SPDXID: Ptr("s"), + HTMLURL: Ptr("h"), + Featured: Ptr(true), + Description: Ptr("d"), + Implementation: Ptr("i"), Permissions: &[]string{"p"}, Conditions: &[]string{"c"}, Limitations: &[]string{"l"}, - Body: String("b"), + Body: Ptr("b"), }, } want := `{ @@ -80,18 +80,18 @@ func TestLicense_Marshal(t *testing.T) { testJSONMarshal(t, &License{}, "{}") l := &License{ - Key: String("k"), - Name: String("n"), - URL: String("u"), - SPDXID: String("s"), - HTMLURL: String("h"), - Featured: Bool(true), - Description: String("d"), - Implementation: String("i"), + Key: Ptr("k"), + Name: Ptr("n"), + URL: Ptr("u"), + SPDXID: Ptr("s"), + HTMLURL: Ptr("h"), + Featured: Ptr(true), + Description: Ptr("d"), + Implementation: Ptr("i"), Permissions: &[]string{"p"}, Conditions: &[]string{"c"}, Limitations: &[]string{"l"}, - Body: String("b"), + Body: Ptr("b"), } want := `{ "key": "k", @@ -126,11 +126,11 @@ func TestLicensesService_List(t *testing.T) { } want := []*License{{ - Key: String("mit"), - Name: String("MIT"), - SPDXID: String("MIT"), - URL: String("https://api.github.com/licenses/mit"), - Featured: Bool(true), + Key: Ptr("mit"), + Name: Ptr("MIT"), + SPDXID: Ptr("MIT"), + URL: Ptr("https://api.github.com/licenses/mit"), + Featured: Ptr(true), }} if !cmp.Equal(licenses, want) { t.Errorf("Licenses.List returned %+v, want %+v", licenses, want) @@ -161,7 +161,7 @@ func TestLicensesService_Get(t *testing.T) { t.Errorf("Licenses.Get returned error: %v", err) } - want := &License{Key: String("mit"), Name: String("MIT")} + want := &License{Key: Ptr("mit"), Name: Ptr("MIT")} if !cmp.Equal(license, want) { t.Errorf("Licenses.Get returned %+v, want %+v", license, want) } diff --git a/github/markdown.go b/github/markdown.go index fe3b31128d5..0fd896c6c85 100644 --- a/github/markdown.go +++ b/github/markdown.go @@ -44,13 +44,13 @@ type markdownRenderRequest struct { // //meta:operation POST /markdown func (s *MarkdownService) Render(ctx context.Context, text string, opts *MarkdownOptions) (string, *Response, error) { - request := &markdownRenderRequest{Text: String(text)} + request := &markdownRenderRequest{Text: Ptr(text)} if opts != nil { if opts.Mode != "" { - request.Mode = String(opts.Mode) + request.Mode = Ptr(opts.Mode) } if opts.Context != "" { - request.Context = String(opts.Context) + request.Context = Ptr(opts.Context) } } diff --git a/github/markdown_test.go b/github/markdown_test.go index 3b8d842365f..d09fdd4aff9 100644 --- a/github/markdown_test.go +++ b/github/markdown_test.go @@ -20,9 +20,9 @@ func TestMarkdownService_Markdown(t *testing.T) { client, mux, _ := setup(t) input := &markdownRenderRequest{ - Text: String("# text #"), - Mode: String("gfm"), - Context: String("google/go-github"), + Text: Ptr("# text #"), + Mode: Ptr("gfm"), + Context: Ptr("google/go-github"), } mux.HandleFunc("/markdown", func(w http.ResponseWriter, r *http.Request) { v := new(markdownRenderRequest) @@ -66,9 +66,9 @@ func TestMarkdownRenderRequest_Marshal(t *testing.T) { testJSONMarshal(t, &markdownRenderRequest{}, "{}") a := &markdownRenderRequest{ - Text: String("txt"), - Mode: String("mode"), - Context: String("ctx"), + Text: Ptr("txt"), + Mode: Ptr("mode"), + Context: Ptr("ctx"), } want := `{ diff --git a/github/meta_test.go b/github/meta_test.go index bce606f2cf1..71eb2149328 100644 --- a/github/meta_test.go +++ b/github/meta_test.go @@ -21,7 +21,7 @@ func TestAPIMeta_Marshal(t *testing.T) { a := &APIMeta{ Hooks: []string{"h"}, Git: []string{"g"}, - VerifiablePasswordAuthentication: Bool(true), + VerifiablePasswordAuthentication: Ptr(true), Pages: []string{"p"}, Importer: []string{"i"}, GithubEnterpriseImporter: []string{"gei"}, @@ -113,7 +113,7 @@ func TestMetaService_Get(t *testing.T) { }, }, - VerifiablePasswordAuthentication: Bool(true), + VerifiablePasswordAuthentication: Ptr(true), } if !cmp.Equal(want, meta) { t.Errorf("Get returned %+v, want %+v", meta, want) diff --git a/github/migrations.go b/github/migrations.go index 5af8817050f..766c4c38e1c 100644 --- a/github/migrations.go +++ b/github/migrations.go @@ -82,8 +82,8 @@ func (s *MigrationService) StartMigration(ctx context.Context, org string, repos body := &startMigration{Repositories: repos} if opts != nil { - body.LockRepositories = Bool(opts.LockRepositories) - body.ExcludeAttachments = Bool(opts.ExcludeAttachments) + body.LockRepositories = Ptr(opts.LockRepositories) + body.ExcludeAttachments = Ptr(opts.ExcludeAttachments) } req, err := s.client.NewRequest("POST", u, body) diff --git a/github/migrations_source_import_test.go b/github/migrations_source_import_test.go index 98e68396da1..a79d1781053 100644 --- a/github/migrations_source_import_test.go +++ b/github/migrations_source_import_test.go @@ -20,10 +20,10 @@ func TestMigrationService_StartImport(t *testing.T) { client, mux, _ := setup(t) input := &Import{ - VCS: String("git"), - VCSURL: String("url"), - VCSUsername: String("u"), - VCSPassword: String("p"), + VCS: Ptr("git"), + VCSURL: Ptr("url"), + VCSUsername: Ptr("u"), + VCSPassword: Ptr("p"), } mux.HandleFunc("/repos/o/r/import", func(w http.ResponseWriter, r *http.Request) { @@ -44,7 +44,7 @@ func TestMigrationService_StartImport(t *testing.T) { if err != nil { t.Errorf("StartImport returned error: %v", err) } - want := &Import{Status: String("importing")} + want := &Import{Status: Ptr("importing")} if !cmp.Equal(got, want) { t.Errorf("StartImport = %+v, want %+v", got, want) } @@ -78,7 +78,7 @@ func TestMigrationService_ImportProgress(t *testing.T) { if err != nil { t.Errorf("ImportProgress returned error: %v", err) } - want := &Import{Status: String("complete")} + want := &Import{Status: Ptr("complete")} if !cmp.Equal(got, want) { t.Errorf("ImportProgress = %+v, want %+v", got, want) } @@ -103,10 +103,10 @@ func TestMigrationService_UpdateImport(t *testing.T) { client, mux, _ := setup(t) input := &Import{ - VCS: String("git"), - VCSURL: String("url"), - VCSUsername: String("u"), - VCSPassword: String("p"), + VCS: Ptr("git"), + VCSURL: Ptr("url"), + VCSUsername: Ptr("u"), + VCSPassword: Ptr("p"), } mux.HandleFunc("/repos/o/r/import", func(w http.ResponseWriter, r *http.Request) { @@ -127,7 +127,7 @@ func TestMigrationService_UpdateImport(t *testing.T) { if err != nil { t.Errorf("UpdateImport returned error: %v", err) } - want := &Import{Status: String("importing")} + want := &Import{Status: Ptr("importing")} if !cmp.Equal(got, want) { t.Errorf("UpdateImport = %+v, want %+v", got, want) } @@ -162,8 +162,8 @@ func TestMigrationService_CommitAuthors(t *testing.T) { t.Errorf("CommitAuthors returned error: %v", err) } want := []*SourceImportAuthor{ - {ID: Int64(1), Name: String("a")}, - {ID: Int64(2), Name: String("b")}, + {ID: Ptr(int64(1)), Name: Ptr("a")}, + {ID: Ptr(int64(2)), Name: Ptr("b")}, } if !cmp.Equal(got, want) { t.Errorf("CommitAuthors = %+v, want %+v", got, want) @@ -188,7 +188,7 @@ func TestMigrationService_MapCommitAuthor(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &SourceImportAuthor{Name: String("n"), Email: String("e")} + input := &SourceImportAuthor{Name: Ptr("n"), Email: Ptr("e")} mux.HandleFunc("/repos/o/r/import/authors/1", func(w http.ResponseWriter, r *http.Request) { v := new(SourceImportAuthor) @@ -207,7 +207,7 @@ func TestMigrationService_MapCommitAuthor(t *testing.T) { if err != nil { t.Errorf("MapCommitAuthor returned error: %v", err) } - want := &SourceImportAuthor{ID: Int64(1)} + want := &SourceImportAuthor{ID: Ptr(int64(1))} if !cmp.Equal(got, want) { t.Errorf("MapCommitAuthor = %+v, want %+v", got, want) } @@ -231,7 +231,7 @@ func TestMigrationService_SetLFSPreference(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &Import{UseLFS: String("opt_in")} + input := &Import{UseLFS: Ptr("opt_in")} mux.HandleFunc("/repos/o/r/import/lfs", func(w http.ResponseWriter, r *http.Request) { v := new(Import) @@ -251,7 +251,7 @@ func TestMigrationService_SetLFSPreference(t *testing.T) { if err != nil { t.Errorf("SetLFSPreference returned error: %v", err) } - want := &Import{Status: String("importing")} + want := &Import{Status: Ptr("importing")} if !cmp.Equal(got, want) { t.Errorf("SetLFSPreference = %+v, want %+v", got, want) } @@ -286,8 +286,8 @@ func TestMigrationService_LargeFiles(t *testing.T) { t.Errorf("LargeFiles returned error: %v", err) } want := []*LargeFile{ - {OID: String("a")}, - {OID: String("b")}, + {OID: Ptr("a")}, + {OID: Ptr("b")}, } if !cmp.Equal(got, want) { t.Errorf("LargeFiles = %+v, want %+v", got, want) @@ -339,10 +339,10 @@ func TestLargeFile_Marshal(t *testing.T) { testJSONMarshal(t, &LargeFile{}, "{}") u := &LargeFile{ - RefName: String("rn"), - Path: String("p"), - OID: String("oid"), - Size: Int(1), + RefName: Ptr("rn"), + Path: Ptr("p"), + OID: Ptr("oid"), + Size: Ptr(1), } want := `{ @@ -360,13 +360,13 @@ func TestSourceImportAuthor_Marshal(t *testing.T) { testJSONMarshal(t, &SourceImportAuthor{}, "{}") u := &SourceImportAuthor{ - ID: Int64(1), - RemoteID: String("rid"), - RemoteName: String("rn"), - Email: String("e"), - Name: String("n"), - URL: String("url"), - ImportURL: String("iurl"), + ID: Ptr(int64(1)), + RemoteID: Ptr("rid"), + RemoteName: Ptr("rn"), + Email: Ptr("e"), + Name: Ptr("n"), + URL: Ptr("url"), + ImportURL: Ptr("iurl"), } want := `{ @@ -387,29 +387,29 @@ func TestImport_Marshal(t *testing.T) { testJSONMarshal(t, &Import{}, "{}") u := &Import{ - VCSURL: String("vcsurl"), - VCS: String("vcs"), - VCSUsername: String("vcsusr"), - VCSPassword: String("vcspass"), - TFVCProject: String("tfvcp"), - UseLFS: String("uselfs"), - HasLargeFiles: Bool(false), - LargeFilesSize: Int(1), - LargeFilesCount: Int(1), - Status: String("status"), - CommitCount: Int(1), - StatusText: String("statustxt"), - AuthorsCount: Int(1), - Percent: Int(1), - PushPercent: Int(1), - URL: String("url"), - HTMLURL: String("hurl"), - AuthorsURL: String("aurl"), - RepositoryURL: String("rurl"), - Message: String("msg"), - FailedStep: String("fs"), - HumanName: String("hn"), - ProjectChoices: []*Import{{VCSURL: String("vcsurl")}}, + VCSURL: Ptr("vcsurl"), + VCS: Ptr("vcs"), + VCSUsername: Ptr("vcsusr"), + VCSPassword: Ptr("vcspass"), + TFVCProject: Ptr("tfvcp"), + UseLFS: Ptr("uselfs"), + HasLargeFiles: Ptr(false), + LargeFilesSize: Ptr(1), + LargeFilesCount: Ptr(1), + Status: Ptr("status"), + CommitCount: Ptr(1), + StatusText: Ptr("statustxt"), + AuthorsCount: Ptr(1), + Percent: Ptr(1), + PushPercent: Ptr(1), + URL: Ptr("url"), + HTMLURL: Ptr("hurl"), + AuthorsURL: Ptr("aurl"), + RepositoryURL: Ptr("rurl"), + Message: Ptr("msg"), + FailedStep: Ptr("fs"), + HumanName: Ptr("hn"), + ProjectChoices: []*Import{{VCSURL: Ptr("vcsurl")}}, } want := `{ diff --git a/github/migrations_test.go b/github/migrations_test.go index 2e4cbdd77f0..99604f62d7c 100644 --- a/github/migrations_test.go +++ b/github/migrations_test.go @@ -234,20 +234,20 @@ var migrationJSON = []byte(`{ }`) var wantMigration = &Migration{ - ID: Int64(79), - GUID: String("0b989ba4-242f-11e5-81e1-c7b6966d2516"), - State: String("pending"), - LockRepositories: Bool(true), - ExcludeAttachments: Bool(false), - URL: String("https://api.github.com/orgs/octo-org/migrations/79"), - CreatedAt: String("2015-07-06T15:33:38-07:00"), - UpdatedAt: String("2015-07-06T15:33:38-07:00"), + ID: Ptr(int64(79)), + GUID: Ptr("0b989ba4-242f-11e5-81e1-c7b6966d2516"), + State: Ptr("pending"), + LockRepositories: Ptr(true), + ExcludeAttachments: Ptr(false), + URL: Ptr("https://api.github.com/orgs/octo-org/migrations/79"), + CreatedAt: Ptr("2015-07-06T15:33:38-07:00"), + UpdatedAt: Ptr("2015-07-06T15:33:38-07:00"), Repositories: []*Repository{ { - ID: Int64(1296269), - Name: String("Hello-World"), - FullName: String("octocat/Hello-World"), - Description: String("This your first repo!"), + ID: Ptr(int64(1296269)), + Name: Ptr("Hello-World"), + FullName: Ptr("octocat/Hello-World"), + Description: Ptr("This your first repo!"), }, }, } @@ -257,15 +257,15 @@ func TestMigration_Marshal(t *testing.T) { testJSONMarshal(t, &Migration{}, "{}") u := &Migration{ - ID: Int64(1), - GUID: String("guid"), - State: String("state"), - LockRepositories: Bool(false), - ExcludeAttachments: Bool(false), - URL: String("url"), - CreatedAt: String("ca"), - UpdatedAt: String("ua"), - Repositories: []*Repository{{ID: Int64(1)}}, + ID: Ptr(int64(1)), + GUID: Ptr("guid"), + State: Ptr("state"), + LockRepositories: Ptr(false), + ExcludeAttachments: Ptr(false), + URL: Ptr("url"), + CreatedAt: Ptr("ca"), + UpdatedAt: Ptr("ua"), + Repositories: []*Repository{{ID: Ptr(int64(1))}}, } want := `{ @@ -293,8 +293,8 @@ func TestStartMigration_Marshal(t *testing.T) { u := &startMigration{ Repositories: []string{"r"}, - LockRepositories: Bool(false), - ExcludeAttachments: Bool(false), + LockRepositories: Ptr(false), + ExcludeAttachments: Ptr(false), } want := `{ diff --git a/github/migrations_user.go b/github/migrations_user.go index 1f907cd4ec2..a7bd79499a2 100644 --- a/github/migrations_user.go +++ b/github/migrations_user.go @@ -75,8 +75,8 @@ func (s *MigrationService) StartUserMigration(ctx context.Context, repos []strin body := &startUserMigration{Repositories: repos} if opts != nil { - body.LockRepositories = Bool(opts.LockRepositories) - body.ExcludeAttachments = Bool(opts.ExcludeAttachments) + body.LockRepositories = Ptr(opts.LockRepositories) + body.ExcludeAttachments = Ptr(opts.ExcludeAttachments) } req, err := s.client.NewRequest("POST", u, body) diff --git a/github/migrations_user_test.go b/github/migrations_user_test.go index 6253a7b3934..aea2b1be712 100644 --- a/github/migrations_user_test.go +++ b/github/migrations_user_test.go @@ -232,20 +232,20 @@ var userMigrationJSON = []byte(`{ }`) var wantUserMigration = &UserMigration{ - ID: Int64(79), - GUID: String("0b989ba4-242f-11e5-81e1-c7b6966d2516"), - State: String("pending"), - LockRepositories: Bool(true), - ExcludeAttachments: Bool(false), - URL: String("https://api.github.com/orgs/octo-org/migrations/79"), - CreatedAt: String("2015-07-06T15:33:38-07:00"), - UpdatedAt: String("2015-07-06T15:33:38-07:00"), + ID: Ptr(int64(79)), + GUID: Ptr("0b989ba4-242f-11e5-81e1-c7b6966d2516"), + State: Ptr("pending"), + LockRepositories: Ptr(true), + ExcludeAttachments: Ptr(false), + URL: Ptr("https://api.github.com/orgs/octo-org/migrations/79"), + CreatedAt: Ptr("2015-07-06T15:33:38-07:00"), + UpdatedAt: Ptr("2015-07-06T15:33:38-07:00"), Repositories: []*Repository{ { - ID: Int64(1296269), - Name: String("Hello-World"), - FullName: String("octocat/Hello-World"), - Description: String("This your first repo!"), + ID: Ptr(int64(1296269)), + Name: Ptr("Hello-World"), + FullName: Ptr("octocat/Hello-World"), + Description: Ptr("This your first repo!"), }, }, } @@ -255,15 +255,15 @@ func TestUserMigration_Marshal(t *testing.T) { testJSONMarshal(t, &UserMigration{}, "{}") u := &UserMigration{ - ID: Int64(1), - GUID: String("guid"), - State: String("state"), - LockRepositories: Bool(false), - ExcludeAttachments: Bool(false), - URL: String("url"), - CreatedAt: String("ca"), - UpdatedAt: String("ua"), - Repositories: []*Repository{{ID: Int64(1)}}, + ID: Ptr(int64(1)), + GUID: Ptr("guid"), + State: Ptr("state"), + LockRepositories: Ptr(false), + ExcludeAttachments: Ptr(false), + URL: Ptr("url"), + CreatedAt: Ptr("ca"), + UpdatedAt: Ptr("ua"), + Repositories: []*Repository{{ID: Ptr(int64(1))}}, } want := `{ @@ -291,8 +291,8 @@ func TestStartUserMigration_Marshal(t *testing.T) { u := &startUserMigration{ Repositories: []string{"r"}, - LockRepositories: Bool(false), - ExcludeAttachments: Bool(false), + LockRepositories: Ptr(false), + ExcludeAttachments: Ptr(false), } want := `{ diff --git a/github/orgs_actions_allowed_test.go b/github/orgs_actions_allowed_test.go index 70cc0ea1fc6..d95558ed93f 100644 --- a/github/orgs_actions_allowed_test.go +++ b/github/orgs_actions_allowed_test.go @@ -29,7 +29,7 @@ func TestOrganizationsService_GetActionsAllowed(t *testing.T) { if err != nil { t.Errorf("Organizations.GetActionsAllowed returned error: %v", err) } - want := &ActionsAllowed{GithubOwnedAllowed: Bool(true), VerifiedAllowed: Bool(false), PatternsAllowed: []string{"a/b"}} + want := &ActionsAllowed{GithubOwnedAllowed: Ptr(true), VerifiedAllowed: Ptr(false), PatternsAllowed: []string{"a/b"}} if !cmp.Equal(org, want) { t.Errorf("Organizations.GetActionsAllowed returned %+v, want %+v", org, want) } @@ -53,7 +53,7 @@ func TestOrganizationsService_EditActionsAllowed(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &ActionsAllowed{GithubOwnedAllowed: Bool(true), VerifiedAllowed: Bool(false), PatternsAllowed: []string{"a/b"}} + input := &ActionsAllowed{GithubOwnedAllowed: Ptr(true), VerifiedAllowed: Ptr(false), PatternsAllowed: []string{"a/b"}} mux.HandleFunc("/orgs/o/actions/permissions/selected-actions", func(w http.ResponseWriter, r *http.Request) { v := new(ActionsAllowed) @@ -73,7 +73,7 @@ func TestOrganizationsService_EditActionsAllowed(t *testing.T) { t.Errorf("Organizations.EditActionsAllowed returned error: %v", err) } - want := &ActionsAllowed{GithubOwnedAllowed: Bool(true), VerifiedAllowed: Bool(false), PatternsAllowed: []string{"a/b"}} + want := &ActionsAllowed{GithubOwnedAllowed: Ptr(true), VerifiedAllowed: Ptr(false), PatternsAllowed: []string{"a/b"}} if !cmp.Equal(org, want) { t.Errorf("Organizations.EditActionsAllowed returned %+v, want %+v", org, want) } diff --git a/github/orgs_actions_permissions_test.go b/github/orgs_actions_permissions_test.go index 0f773435690..3bdbe34c743 100644 --- a/github/orgs_actions_permissions_test.go +++ b/github/orgs_actions_permissions_test.go @@ -29,7 +29,7 @@ func TestOrganizationsService_GetActionsPermissions(t *testing.T) { if err != nil { t.Errorf("Organizations.GetActionsPermissions returned error: %v", err) } - want := &ActionsPermissions{EnabledRepositories: String("all"), AllowedActions: String("all")} + want := &ActionsPermissions{EnabledRepositories: Ptr("all"), AllowedActions: Ptr("all")} if !cmp.Equal(org, want) { t.Errorf("Organizations.GetActionsPermissions returned %+v, want %+v", org, want) } @@ -53,7 +53,7 @@ func TestOrganizationsService_EditActionsPermissions(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &ActionsPermissions{EnabledRepositories: String("all"), AllowedActions: String("selected")} + input := &ActionsPermissions{EnabledRepositories: Ptr("all"), AllowedActions: Ptr("selected")} mux.HandleFunc("/orgs/o/actions/permissions", func(w http.ResponseWriter, r *http.Request) { v := new(ActionsPermissions) @@ -73,7 +73,7 @@ func TestOrganizationsService_EditActionsPermissions(t *testing.T) { t.Errorf("Organizations.EditActionsPermissions returned error: %v", err) } - want := &ActionsPermissions{EnabledRepositories: String("all"), AllowedActions: String("selected")} + want := &ActionsPermissions{EnabledRepositories: Ptr("all"), AllowedActions: Ptr("selected")} if !cmp.Equal(org, want) { t.Errorf("Organizations.EditActionsPermissions returned %+v, want %+v", org, want) } diff --git a/github/orgs_audit_log_test.go b/github/orgs_audit_log_test.go index b13338ba3aa..3a6cacef45b 100644 --- a/github/orgs_audit_log_test.go +++ b/github/orgs_audit_log_test.go @@ -82,9 +82,9 @@ func TestOrganizationService_GetAuditLog(t *testing.T) { }) ctx := context.Background() getOpts := GetAuditLogOptions{ - Include: String("all"), - Phrase: String("action:workflows"), - Order: String("asc"), + Include: Ptr("all"), + Phrase: Ptr("action:workflows"), + Order: Ptr("asc"), } auditEntries, resp, err := client.Organizations.GetAuditLog(ctx, "o", &getOpts) @@ -96,18 +96,18 @@ func TestOrganizationService_GetAuditLog(t *testing.T) { want := []*AuditEntry{ { Timestamp: &Timestamp{timestamp}, - DocumentID: String("beeZYapIUe-wKg5-beadb33"), - Action: String("workflows.completed_workflow_run"), - Actor: String("testactor"), + DocumentID: Ptr("beeZYapIUe-wKg5-beadb33"), + Action: Ptr("workflows.completed_workflow_run"), + Actor: Ptr("testactor"), ActorLocation: &ActorLocation{ - CountryCode: String("US"), + CountryCode: Ptr("US"), }, CreatedAt: &Timestamp{timestamp}, - HashedToken: String("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="), - Org: String("o"), - OrgID: Int64(1), - TokenID: Int64(1), - TokenScopes: String("gist,repo:read"), + HashedToken: Ptr("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="), + Org: Ptr("o"), + OrgID: Ptr(int64(1)), + TokenID: Ptr(int64(1)), + TokenScopes: Ptr("gist,repo:read"), AdditionalFields: map[string]interface{}{ "actor_ip": "10.0.0.1", "active": true, @@ -178,9 +178,9 @@ func TestGetAuditLogOptions_Marshal(t *testing.T) { testJSONMarshal(t, &GetAuditLogOptions{}, "{}") u := &GetAuditLogOptions{ - Phrase: String("p"), - Include: String("i"), - Order: String("o"), + Phrase: Ptr("p"), + Include: Ptr("i"), + Order: Ptr("o"), ListCursorOptions: ListCursorOptions{ Page: "p", PerPage: 1, @@ -207,9 +207,9 @@ func TestHookConfig_Marshal(t *testing.T) { testJSONMarshal(t, &HookConfig{}, "{}") u := &HookConfig{ - ContentType: String("ct"), - InsecureSSL: String("ct"), - URL: String("url"), + ContentType: Ptr("ct"), + InsecureSSL: Ptr("ct"), + URL: Ptr("url"), } want := `{ @@ -226,21 +226,21 @@ func TestAuditEntry_Marshal(t *testing.T) { testJSONMarshal(t, &AuditEntry{}, "{}") u := &AuditEntry{ - Action: String("a"), - Actor: String("ac"), - ActorLocation: &ActorLocation{CountryCode: String("alcc")}, - Business: String("b"), + Action: Ptr("a"), + Actor: Ptr("ac"), + ActorLocation: &ActorLocation{CountryCode: Ptr("alcc")}, + Business: Ptr("b"), CreatedAt: &Timestamp{referenceTime}, - DocumentID: String("did"), - ExternalIdentityNameID: String("ein"), - ExternalIdentityUsername: String("eiu"), - HashedToken: String("ht"), - Org: String("o"), - OrgID: Int64(1), + DocumentID: Ptr("did"), + ExternalIdentityNameID: Ptr("ein"), + ExternalIdentityUsername: Ptr("eiu"), + HashedToken: Ptr("ht"), + Org: Ptr("o"), + OrgID: Ptr(int64(1)), Timestamp: &Timestamp{referenceTime}, - TokenID: Int64(1), - TokenScopes: String("ts"), - User: String("u"), + TokenID: Ptr(int64(1)), + TokenScopes: Ptr("ts"), + User: Ptr("u"), Data: map[string]interface{}{ "old_name": "on", "old_login": "ol", diff --git a/github/orgs_codesecurity_configurations_test.go b/github/orgs_codesecurity_configurations_test.go index cb630bccb64..97dc058d841 100644 --- a/github/orgs_codesecurity_configurations_test.go +++ b/github/orgs_codesecurity_configurations_test.go @@ -41,8 +41,8 @@ func TestOrganizationsService_GetCodeSecurityConfigurations(t *testing.T) { } want := []*CodeSecurityConfiguration{ - {ID: Int64(1), Name: String("config1"), CodeScanningDefaultSetup: String("enabled")}, - {ID: Int64(2), Name: String("config2"), PrivateVulnerabilityReporting: String("enabled")}, + {ID: Ptr(int64(1)), Name: Ptr("config1"), CodeScanningDefaultSetup: Ptr("enabled")}, + {ID: Ptr(int64(2)), Name: Ptr("config2"), PrivateVulnerabilityReporting: Ptr("enabled")}, } if !reflect.DeepEqual(configurations, want) { t.Errorf("Organizations.GetCodeSecurityConfigurations returned %+v, want %+v", configurations, want) @@ -80,7 +80,7 @@ func TestOrganizationsService_GetCodeSecurityConfiguration(t *testing.T) { t.Errorf("Organizations.GetCodeSecurityConfiguration returned error: %v", err) } - want := &CodeSecurityConfiguration{ID: Int64(1), Name: String("config1"), CodeScanningDefaultSetup: String("enabled")} + want := &CodeSecurityConfiguration{ID: Ptr(int64(1)), Name: Ptr("config1"), CodeScanningDefaultSetup: Ptr("enabled")} if !reflect.DeepEqual(configuration, want) { t.Errorf("Organizations.GetCodeSecurityConfiguration returned %+v, want %+v", configuration, want) } @@ -106,8 +106,8 @@ func TestOrganizationsService_CreateCodeSecurityConfiguration(t *testing.T) { ctx := context.Background() input := &CodeSecurityConfiguration{ - Name: String("config1"), - CodeScanningDefaultSetup: String("enabled"), + Name: Ptr("config1"), + CodeScanningDefaultSetup: Ptr("enabled"), } mux.HandleFunc("/orgs/o/code-security/configurations", func(w http.ResponseWriter, r *http.Request) { @@ -133,7 +133,7 @@ func TestOrganizationsService_CreateCodeSecurityConfiguration(t *testing.T) { t.Errorf("Organizations.CreateCodeSecurityConfiguration returned error: %v", err) } - want := &CodeSecurityConfiguration{ID: Int64(1), Name: String("config1"), CodeScanningDefaultSetup: String("enabled")} + want := &CodeSecurityConfiguration{ID: Ptr(int64(1)), Name: Ptr("config1"), CodeScanningDefaultSetup: Ptr("enabled")} if !reflect.DeepEqual(configuration, want) { t.Errorf("Organizations.CreateCodeSecurityConfiguration returned %+v, want %+v", configuration, want) } @@ -179,8 +179,8 @@ func TestOrganizationsService_GetDefaultCodeSecurityConfigurations(t *testing.T) } want := []*CodeSecurityConfiguration{ - {ID: Int64(1), Name: String("config1"), CodeScanningDefaultSetup: String("enabled")}, - {ID: Int64(2), Name: String("config2"), PrivateVulnerabilityReporting: String("enabled")}, + {ID: Ptr(int64(1)), Name: Ptr("config1"), CodeScanningDefaultSetup: Ptr("enabled")}, + {ID: Ptr(int64(2)), Name: Ptr("config2"), PrivateVulnerabilityReporting: Ptr("enabled")}, } if !reflect.DeepEqual(configurations, want) { t.Errorf("Organizations.GetDefaultCodeSecurityConfigurations returned %+v, want %+v", configurations, want) @@ -239,8 +239,8 @@ func TestOrganizationsService_UpdateCodeSecurityConfiguration(t *testing.T) { client, mux, _ := setup(t) input := &CodeSecurityConfiguration{ - Name: String("config1"), - CodeScanningDefaultSetup: String("enabled"), + Name: Ptr("config1"), + CodeScanningDefaultSetup: Ptr("enabled"), } mux.HandleFunc("/orgs/o/code-security/configurations/1", func(w http.ResponseWriter, r *http.Request) { @@ -266,7 +266,7 @@ func TestOrganizationsService_UpdateCodeSecurityConfiguration(t *testing.T) { t.Errorf("Organizations.UpdateCodeSecurityConfiguration returned error: %v", err) } - want := &CodeSecurityConfiguration{ID: Int64(1), Name: String("config1"), CodeScanningDefaultSetup: String("enabled")} + want := &CodeSecurityConfiguration{ID: Ptr(int64(1)), Name: Ptr("config1"), CodeScanningDefaultSetup: Ptr("enabled")} if !reflect.DeepEqual(configuration, want) { t.Errorf("Organizations.UpdateCodeSecurityConfiguration returned %+v, want %+v", configuration, want) } @@ -392,9 +392,9 @@ func TestOrganizationsService_SetDefaultCodeSecurityConfiguration(t *testing.T) t.Errorf("Organizations.SetDefaultCodeSecurityConfiguration returned status %d, want %d", resp.StatusCode, wantStatus) } want := &CodeSecurityConfigurationWithDefaultForNewRepos{ - DefaultForNewRepos: String("all"), + DefaultForNewRepos: Ptr("all"), Configuration: &CodeSecurityConfiguration{ - ID: Int64(1), Name: String("config1"), CodeScanningDefaultSetup: String("enabled"), + ID: Ptr(int64(1)), Name: Ptr("config1"), CodeScanningDefaultSetup: Ptr("enabled"), }, } if !reflect.DeepEqual(got, want) { @@ -440,8 +440,8 @@ func TestOrganizationsService_GetRepositoriesForCodeSecurityConfiguration(t *tes } want := []*Repository{ - {ID: Int64(8), Name: String("repo8")}, - {ID: Int64(42), Name: String("repo42")}, + {ID: Ptr(int64(8)), Name: Ptr("repo8")}, + {ID: Ptr(int64(42)), Name: Ptr("repo42")}, } if !reflect.DeepEqual(repositories, want) { t.Errorf("Organizations.GetRepositoriesForCodeSecurityConfiguration returned %+v, want %+v", repositories, want) @@ -483,9 +483,9 @@ func TestOrganizationsService_GetCodeSecurityConfigurationForRepository(t *testi if err != nil { t.Errorf("Organizations.GetCodeSecurityConfigurationForRepository returned error: %v", err) } - c := &CodeSecurityConfiguration{ID: Int64(42), Name: String("config42"), CodeScanningDefaultSetup: String("enabled")} + c := &CodeSecurityConfiguration{ID: Ptr(int64(42)), Name: Ptr("config42"), CodeScanningDefaultSetup: Ptr("enabled")} want := &RepositoryCodeSecurityConfiguration{ - State: String("attached"), + State: Ptr("attached"), Configuration: c, } if !reflect.DeepEqual(rc, want) { diff --git a/github/orgs_credential_authorizations_test.go b/github/orgs_credential_authorizations_test.go index a03f20586b5..dfd7e559507 100644 --- a/github/orgs_credential_authorizations_test.go +++ b/github/orgs_credential_authorizations_test.go @@ -48,12 +48,12 @@ func TestOrganizationsService_ListCredentialAuthorizations(t *testing.T) { ts := time.Date(2017, time.January, 21, 0, 0, 0, 0, time.UTC) want := []*CredentialAuthorization{ { - Login: String("l"), - CredentialID: Int64(1), - CredentialType: String("t"), + Login: Ptr("l"), + CredentialID: Ptr(int64(1)), + CredentialType: Ptr("t"), CredentialAuthorizedAt: &Timestamp{ts}, CredentialAccessedAt: &Timestamp{ts}, - AuthorizedCredentialID: Int64(1), + AuthorizedCredentialID: Ptr(int64(1)), }, } if !cmp.Equal(creds, want) { diff --git a/github/orgs_custom_repository_roles_test.go b/github/orgs_custom_repository_roles_test.go index ddf8ef9759a..8e78e0a041c 100644 --- a/github/orgs_custom_repository_roles_test.go +++ b/github/orgs_custom_repository_roles_test.go @@ -53,24 +53,24 @@ func TestOrganizationsService_ListCustomRepoRoles(t *testing.T) { } want := &OrganizationCustomRepoRoles{ - TotalCount: Int(1), + TotalCount: Ptr(1), CustomRepoRoles: []*CustomRepoRoles{ { - ID: Int64(1), - Name: String("Developer"), - BaseRole: String("write"), + ID: Ptr(int64(1)), + Name: Ptr("Developer"), + BaseRole: Ptr("write"), Permissions: []string{"delete_alerts_code_scanning"}, Org: &Organization{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - AvatarURL: String("a"), - HTMLURL: String("h"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + AvatarURL: Ptr("a"), + HTMLURL: Ptr("h"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), }, CreatedAt: &Timestamp{time.Date(2024, time.July, 21, 19, 33, 8, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2024, time.July, 21, 19, 33, 8, 0, time.UTC)}, @@ -108,9 +108,9 @@ func TestOrganizationsService_CreateCustomRepoRole(t *testing.T) { ctx := context.Background() opts := &CreateOrUpdateCustomRepoRoleOptions{ - Name: String("Labeler"), - Description: String("A role for issue and PR labelers"), - BaseRole: String("read"), + Name: Ptr("Labeler"), + Description: Ptr("A role for issue and PR labelers"), + BaseRole: Ptr("read"), Permissions: []string{"add_label"}, } apps, _, err := client.Organizations.CreateCustomRepoRole(ctx, "o", opts) @@ -118,7 +118,7 @@ func TestOrganizationsService_CreateCustomRepoRole(t *testing.T) { t.Errorf("Organizations.CreateCustomRepoRole returned error: %v", err) } - want := &CustomRepoRoles{ID: Int64(8030), Name: String("Labeler"), BaseRole: String("read"), Permissions: []string{"add_label"}, Description: String("A role for issue and PR labelers")} + want := &CustomRepoRoles{ID: Ptr(int64(8030)), Name: Ptr("Labeler"), BaseRole: Ptr("read"), Permissions: []string{"add_label"}, Description: Ptr("A role for issue and PR labelers")} if !cmp.Equal(apps, want) { t.Errorf("Organizations.CreateCustomRepoRole returned %+v, want %+v", apps, want) @@ -151,15 +151,15 @@ func TestOrganizationsService_UpdateCustomRepoRole(t *testing.T) { ctx := context.Background() opts := &CreateOrUpdateCustomRepoRoleOptions{ - Name: String("Updated Name"), - Description: String("Updated Description"), + Name: Ptr("Updated Name"), + Description: Ptr("Updated Description"), } apps, _, err := client.Organizations.UpdateCustomRepoRole(ctx, "o", 8030, opts) if err != nil { t.Errorf("Organizations.UpdateCustomRepoRole returned error: %v", err) } - want := &CustomRepoRoles{ID: Int64(8030), Name: String("Updated Name"), BaseRole: String("read"), Permissions: []string{"add_label"}, Description: String("Updated Description")} + want := &CustomRepoRoles{ID: Ptr(int64(8030)), Name: Ptr("Updated Name"), BaseRole: Ptr("read"), Permissions: []string{"add_label"}, Description: Ptr("Updated Description")} if !cmp.Equal(apps, want) { t.Errorf("Organizations.UpdateCustomRepoRole returned %+v, want %+v", apps, want) diff --git a/github/orgs_hooks_configuration_test.go b/github/orgs_hooks_configuration_test.go index d95b40c18f7..42f55c99aff 100644 --- a/github/orgs_hooks_configuration_test.go +++ b/github/orgs_hooks_configuration_test.go @@ -31,10 +31,10 @@ func TestOrganizationsService_GetHookConfiguration(t *testing.T) { } want := &HookConfig{ - ContentType: String("json"), - InsecureSSL: String("0"), - Secret: String("********"), - URL: String("https://example.com/webhook"), + ContentType: Ptr("json"), + InsecureSSL: Ptr("0"), + Secret: Ptr("********"), + URL: Ptr("https://example.com/webhook"), } if !cmp.Equal(config, want) { t.Errorf("Organizations.GetHookConfiguration returned %+v, want %+v", config, want) @@ -89,10 +89,10 @@ func TestOrganizationsService_EditHookConfiguration(t *testing.T) { } want := &HookConfig{ - ContentType: String("json"), - InsecureSSL: String("0"), - Secret: String("********"), - URL: String("https://example.com/webhook"), + ContentType: Ptr("json"), + InsecureSSL: Ptr("0"), + Secret: Ptr("********"), + URL: Ptr("https://example.com/webhook"), } if !cmp.Equal(config, want) { t.Errorf("Organizations.EditHookConfiguration returned %+v, want %+v", config, want) diff --git a/github/orgs_hooks_deliveries_test.go b/github/orgs_hooks_deliveries_test.go index 8b4b6463624..d4d68236143 100644 --- a/github/orgs_hooks_deliveries_test.go +++ b/github/orgs_hooks_deliveries_test.go @@ -32,7 +32,7 @@ func TestOrganizationsService_ListHookDeliveries(t *testing.T) { t.Errorf("Organizations.ListHookDeliveries returned error: %v", err) } - want := []*HookDelivery{{ID: Int64(1)}, {ID: Int64(2)}} + want := []*HookDelivery{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}} if d := cmp.Diff(hooks, want); d != "" { t.Errorf("Organizations.ListHooks want (-), got (+):\n%s", d) } @@ -76,7 +76,7 @@ func TestOrganizationsService_GetHookDelivery(t *testing.T) { t.Errorf("Organizations.GetHookDelivery returned error: %v", err) } - want := &HookDelivery{ID: Int64(1)} + want := &HookDelivery{ID: Ptr(int64(1))} if !cmp.Equal(hook, want) { t.Errorf("Organizations.GetHookDelivery returned %+v, want %+v", hook, want) } @@ -120,7 +120,7 @@ func TestOrganizationsService_RedeliverHookDelivery(t *testing.T) { t.Errorf("Organizations.RedeliverHookDelivery returned error: %v", err) } - want := &HookDelivery{ID: Int64(1)} + want := &HookDelivery{ID: Ptr(int64(1))} if !cmp.Equal(hook, want) { t.Errorf("Organizations.RedeliverHookDelivery returned %+v, want %+v", hook, want) } diff --git a/github/orgs_hooks_test.go b/github/orgs_hooks_test.go index 59e4d0d857f..3b3b8bff91c 100644 --- a/github/orgs_hooks_test.go +++ b/github/orgs_hooks_test.go @@ -33,7 +33,7 @@ func TestOrganizationsService_ListHooks(t *testing.T) { t.Errorf("Organizations.ListHooks returned error: %v", err) } - want := []*Hook{{ID: Int64(1)}, {ID: Int64(2)}} + want := []*Hook{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}} if !cmp.Equal(hooks, want) { t.Errorf("Organizations.ListHooks returned %+v, want %+v", hooks, want) } @@ -87,7 +87,7 @@ func TestOrganizationsService_CreateHook(t *testing.T) { t.Errorf("Organizations.CreateHook returned error: %v", err) } - want := &Hook{ID: Int64(1)} + want := &Hook{ID: Ptr(int64(1))} if !cmp.Equal(hook, want) { t.Errorf("Organizations.CreateHook returned %+v, want %+v", hook, want) } @@ -122,7 +122,7 @@ func TestOrganizationsService_GetHook(t *testing.T) { t.Errorf("Organizations.GetHook returned error: %v", err) } - want := &Hook{ID: Int64(1)} + want := &Hook{ID: Ptr(int64(1))} if !cmp.Equal(hook, want) { t.Errorf("Organizations.GetHook returned %+v, want %+v", hook, want) } @@ -175,7 +175,7 @@ func TestOrganizationsService_EditHook(t *testing.T) { t.Errorf("Organizations.EditHook returned error: %v", err) } - want := &Hook{ID: Int64(1)} + want := &Hook{ID: Ptr(int64(1))} if !cmp.Equal(hook, want) { t.Errorf("Organizations.EditHook returned %+v, want %+v", hook, want) } diff --git a/github/orgs_members_test.go b/github/orgs_members_test.go index a351ab9341a..71c7fbef3a7 100644 --- a/github/orgs_members_test.go +++ b/github/orgs_members_test.go @@ -42,7 +42,7 @@ func TestOrganizationsService_ListMembers(t *testing.T) { t.Errorf("Organizations.ListMembers returned error: %v", err) } - want := []*User{{ID: Int64(1)}} + want := []*User{{ID: Ptr(int64(1))}} if !cmp.Equal(members, want) { t.Errorf("Organizations.ListMembers returned %+v, want %+v", members, want) } @@ -87,7 +87,7 @@ func TestOrganizationsService_ListMembers_public(t *testing.T) { t.Errorf("Organizations.ListMembers returned error: %v", err) } - want := []*User{{ID: Int64(1)}} + want := []*User{{ID: Ptr(int64(1))}} if !cmp.Equal(members, want) { t.Errorf("Organizations.ListMembers returned %+v, want %+v", members, want) } @@ -392,7 +392,7 @@ func TestOrganizationsService_ListOrgMemberships(t *testing.T) { t.Errorf("Organizations.ListOrgMemberships returned error: %v", err) } - want := []*Membership{{URL: String("u")}} + want := []*Membership{{URL: Ptr("u")}} if !cmp.Equal(memberships, want) { t.Errorf("Organizations.ListOrgMemberships returned %+v, want %+v", memberships, want) } @@ -422,7 +422,7 @@ func TestOrganizationsService_GetOrgMembership_AuthenticatedUser(t *testing.T) { t.Errorf("Organizations.GetOrgMembership returned error: %v", err) } - want := &Membership{URL: String("u")} + want := &Membership{URL: Ptr("u")} if !cmp.Equal(membership, want) { t.Errorf("Organizations.GetOrgMembership returned %+v, want %+v", membership, want) } @@ -457,7 +457,7 @@ func TestOrganizationsService_GetOrgMembership_SpecifiedUser(t *testing.T) { t.Errorf("Organizations.GetOrgMembership returned error: %v", err) } - want := &Membership{URL: String("u")} + want := &Membership{URL: Ptr("u")} if !cmp.Equal(membership, want) { t.Errorf("Organizations.GetOrgMembership returned %+v, want %+v", membership, want) } @@ -467,7 +467,7 @@ func TestOrganizationsService_EditOrgMembership_AuthenticatedUser(t *testing.T) t.Parallel() client, mux, _ := setup(t) - input := &Membership{State: String("active")} + input := &Membership{State: Ptr("active")} mux.HandleFunc("/user/memberships/orgs/o", func(w http.ResponseWriter, r *http.Request) { v := new(Membership) @@ -487,7 +487,7 @@ func TestOrganizationsService_EditOrgMembership_AuthenticatedUser(t *testing.T) t.Errorf("Organizations.EditOrgMembership returned error: %v", err) } - want := &Membership{URL: String("u")} + want := &Membership{URL: Ptr("u")} if !cmp.Equal(membership, want) { t.Errorf("Organizations.EditOrgMembership returned %+v, want %+v", membership, want) } @@ -511,7 +511,7 @@ func TestOrganizationsService_EditOrgMembership_SpecifiedUser(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &Membership{State: String("active")} + input := &Membership{State: Ptr("active")} mux.HandleFunc("/orgs/o/memberships/u", func(w http.ResponseWriter, r *http.Request) { v := new(Membership) @@ -531,7 +531,7 @@ func TestOrganizationsService_EditOrgMembership_SpecifiedUser(t *testing.T) { t.Errorf("Organizations.EditOrgMembership returned error: %v", err) } - want := &Membership{URL: String("u")} + want := &Membership{URL: Ptr("u")} if !cmp.Equal(membership, want) { t.Errorf("Organizations.EditOrgMembership returned %+v, want %+v", membership, want) } @@ -612,32 +612,32 @@ func TestOrganizationsService_ListPendingOrgInvitations(t *testing.T) { createdAt := time.Date(2017, time.January, 21, 0, 0, 0, 0, time.UTC) want := []*Invitation{ { - ID: Int64(1), - Login: String("monalisa"), - Email: String("octocat@github.com"), - Role: String("direct_member"), + ID: Ptr(int64(1)), + Login: Ptr("monalisa"), + Email: Ptr("octocat@github.com"), + Role: Ptr("direct_member"), CreatedAt: &Timestamp{createdAt}, Inviter: &User{ - Login: String("other_user"), - ID: Int64(1), - AvatarURL: String("https://github.com/images/error/other_user_happy.gif"), - GravatarID: String(""), - URL: String("https://api.github.com/users/other_user"), - HTMLURL: String("https://github.com/other_user"), - FollowersURL: String("https://api.github.com/users/other_user/followers"), - FollowingURL: String("https://api.github.com/users/other_user/following/other_user"), - GistsURL: String("https://api.github.com/users/other_user/gists/gist_id"), - StarredURL: String("https://api.github.com/users/other_user/starred/owner/repo"), - SubscriptionsURL: String("https://api.github.com/users/other_user/subscriptions"), - OrganizationsURL: String("https://api.github.com/users/other_user/orgs"), - ReposURL: String("https://api.github.com/users/other_user/repos"), - EventsURL: String("https://api.github.com/users/other_user/events/privacy"), - ReceivedEventsURL: String("https://api.github.com/users/other_user/received_events/privacy"), - Type: String("User"), - SiteAdmin: Bool(false), + Login: Ptr("other_user"), + ID: Ptr(int64(1)), + AvatarURL: Ptr("https://github.com/images/error/other_user_happy.gif"), + GravatarID: Ptr(""), + URL: Ptr("https://api.github.com/users/other_user"), + HTMLURL: Ptr("https://github.com/other_user"), + FollowersURL: Ptr("https://api.github.com/users/other_user/followers"), + FollowingURL: Ptr("https://api.github.com/users/other_user/following/other_user"), + GistsURL: Ptr("https://api.github.com/users/other_user/gists/gist_id"), + StarredURL: Ptr("https://api.github.com/users/other_user/starred/owner/repo"), + SubscriptionsURL: Ptr("https://api.github.com/users/other_user/subscriptions"), + OrganizationsURL: Ptr("https://api.github.com/users/other_user/orgs"), + ReposURL: Ptr("https://api.github.com/users/other_user/repos"), + EventsURL: Ptr("https://api.github.com/users/other_user/events/privacy"), + ReceivedEventsURL: Ptr("https://api.github.com/users/other_user/received_events/privacy"), + Type: Ptr("User"), + SiteAdmin: Ptr(false), }, - TeamCount: Int(2), - InvitationTeamURL: String("https://api.github.com/organizations/2/invitations/1/teams"), + TeamCount: Ptr(2), + InvitationTeamURL: Ptr("https://api.github.com/organizations/2/invitations/1/teams"), }} if !cmp.Equal(invitations, want) { @@ -664,8 +664,8 @@ func TestOrganizationsService_CreateOrgInvitation(t *testing.T) { client, mux, _ := setup(t) input := &CreateOrgInvitationOptions{ - Email: String("octocat@github.com"), - Role: String("direct_member"), + Email: Ptr("octocat@github.com"), + Role: Ptr("direct_member"), TeamID: []int64{ 12, 26, @@ -690,7 +690,7 @@ func TestOrganizationsService_CreateOrgInvitation(t *testing.T) { t.Errorf("Organizations.CreateOrgInvitation returned error: %v", err) } - want := &Invitation{Email: String("octocat@github.com")} + want := &Invitation{Email: Ptr("octocat@github.com")} if !cmp.Equal(invitations, want) { t.Errorf("Organizations.ListPendingOrgInvitations returned %+v, want %+v", invitations, want) } @@ -741,15 +741,15 @@ func TestOrganizationsService_ListOrgInvitationTeams(t *testing.T) { want := []*Team{ { - ID: Int64(1), - URL: String("https://api.github.com/teams/1"), - Name: String("Justice League"), - Slug: String("justice-league"), - Description: String("A great team."), - Privacy: String("closed"), - Permission: String("admin"), - MembersURL: String("https://api.github.com/teams/1/members{/member}"), - RepositoriesURL: String("https://api.github.com/teams/1/repos"), + ID: Ptr(int64(1)), + URL: Ptr("https://api.github.com/teams/1"), + Name: Ptr("Justice League"), + Slug: Ptr("justice-league"), + Description: Ptr("A great team."), + Privacy: Ptr("closed"), + Permission: Ptr("admin"), + MembersURL: Ptr("https://api.github.com/teams/1/members{/member}"), + RepositoriesURL: Ptr("https://api.github.com/teams/1/repos"), }, } @@ -825,36 +825,36 @@ func TestOrganizationsService_ListFailedOrgInvitations(t *testing.T) { createdAt := time.Date(2016, time.November, 30, 6, 46, 10, 0, time.UTC) want := []*Invitation{ { - ID: Int64(1), - Login: String("monalisa"), - NodeID: String("MDQ6VXNlcjE="), - Email: String("octocat@github.com"), - Role: String("direct_member"), + ID: Ptr(int64(1)), + Login: Ptr("monalisa"), + NodeID: Ptr("MDQ6VXNlcjE="), + Email: Ptr("octocat@github.com"), + Role: Ptr("direct_member"), FailedAt: &Timestamp{time.Date(2017, time.January, 2, 1, 10, 0, 0, time.UTC)}, - FailedReason: String("the reason"), + FailedReason: Ptr("the reason"), CreatedAt: &Timestamp{createdAt}, Inviter: &User{ - Login: String("other_user"), - ID: Int64(1), - NodeID: String("MDQ6VXNlcjE="), - AvatarURL: String("https://github.com/images/error/other_user_happy.gif"), - GravatarID: String(""), - URL: String("https://api.github.com/users/other_user"), - HTMLURL: String("https://github.com/other_user"), - FollowersURL: String("https://api.github.com/users/other_user/followers"), - FollowingURL: String("https://api.github.com/users/other_user/following{/other_user}"), - GistsURL: String("https://api.github.com/users/other_user/gists{/gist_id}"), - StarredURL: String("https://api.github.com/users/other_user/starred{/owner}{/repo}"), - SubscriptionsURL: String("https://api.github.com/users/other_user/subscriptions"), - OrganizationsURL: String("https://api.github.com/users/other_user/orgs"), - ReposURL: String("https://api.github.com/users/other_user/repos"), - EventsURL: String("https://api.github.com/users/other_user/events{/privacy}"), - ReceivedEventsURL: String("https://api.github.com/users/other_user/received_events"), - Type: String("User"), - SiteAdmin: Bool(false), + Login: Ptr("other_user"), + ID: Ptr(int64(1)), + NodeID: Ptr("MDQ6VXNlcjE="), + AvatarURL: Ptr("https://github.com/images/error/other_user_happy.gif"), + GravatarID: Ptr(""), + URL: Ptr("https://api.github.com/users/other_user"), + HTMLURL: Ptr("https://github.com/other_user"), + FollowersURL: Ptr("https://api.github.com/users/other_user/followers"), + FollowingURL: Ptr("https://api.github.com/users/other_user/following{/other_user}"), + GistsURL: Ptr("https://api.github.com/users/other_user/gists{/gist_id}"), + StarredURL: Ptr("https://api.github.com/users/other_user/starred{/owner}{/repo}"), + SubscriptionsURL: Ptr("https://api.github.com/users/other_user/subscriptions"), + OrganizationsURL: Ptr("https://api.github.com/users/other_user/orgs"), + ReposURL: Ptr("https://api.github.com/users/other_user/repos"), + EventsURL: Ptr("https://api.github.com/users/other_user/events{/privacy}"), + ReceivedEventsURL: Ptr("https://api.github.com/users/other_user/received_events"), + Type: Ptr("User"), + SiteAdmin: Ptr(false), }, - TeamCount: Int(2), - InvitationTeamURL: String("https://api.github.com/organizations/2/invitations/1/teams"), + TeamCount: Ptr(2), + InvitationTeamURL: Ptr("https://api.github.com/organizations/2/invitations/1/teams"), }, } @@ -882,40 +882,40 @@ func TestMembership_Marshal(t *testing.T) { testJSONMarshal(t, &Membership{}, "{}") u := &Membership{ - URL: String("url"), - State: String("state"), - Role: String("email"), - OrganizationURL: String("orgurl"), + URL: Ptr("url"), + State: Ptr("state"), + Role: Ptr("email"), + OrganizationURL: Ptr("orgurl"), Organization: &Organization{ - BillingEmail: String("be"), - Blog: String("b"), - Company: String("c"), - Email: String("e"), - TwitterUsername: String("tu"), - Location: String("loc"), - Name: String("n"), - Description: String("d"), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("drp"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("marct"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), }, User: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), }, } @@ -965,9 +965,9 @@ func TestCreateOrgInvitationOptions_Marshal(t *testing.T) { testJSONMarshal(t, &CreateOrgInvitationOptions{}, "{}") u := &CreateOrgInvitationOptions{ - InviteeID: Int64(1), - Email: String("email"), - Role: String("role"), + InviteeID: Ptr(int64(1)), + Email: Ptr("email"), + Role: Ptr("role"), TeamID: []int64{1}, } diff --git a/github/orgs_organization_roles_test.go b/github/orgs_organization_roles_test.go index 4989697e355..d64e13b1ef2 100644 --- a/github/orgs_organization_roles_test.go +++ b/github/orgs_organization_roles_test.go @@ -54,28 +54,28 @@ func TestOrganizationsService_ListRoles(t *testing.T) { } want := &OrganizationCustomRoles{ - TotalCount: Int(1), + TotalCount: Ptr(1), CustomRepoRoles: []*CustomOrgRoles{ { - ID: Int64(1), - Name: String("Auditor"), + ID: Ptr(int64(1)), + Name: Ptr("Auditor"), Permissions: []string{"read_audit_logs"}, Org: &Organization{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - AvatarURL: String("a"), - HTMLURL: String("h"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + AvatarURL: Ptr("a"), + HTMLURL: Ptr("h"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), }, CreatedAt: &Timestamp{time.Date(2024, time.July, 21, 19, 33, 8, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2024, time.July, 21, 19, 33, 8, 0, time.UTC)}, - Source: String("Organization"), - BaseRole: String("admin"), + Source: Ptr("Organization"), + BaseRole: Ptr("admin"), }, }, } @@ -125,14 +125,14 @@ func TestOrganizationsService_GetOrgRole(t *testing.T) { } wantBuiltInRole := &CustomOrgRoles{ - ID: Int64(8132), - Name: String("all_repo_read"), - Description: String("Grants read access to all repositories in the organization."), + ID: Ptr(int64(8132)), + Name: Ptr("all_repo_read"), + Description: Ptr("Grants read access to all repositories in the organization."), Permissions: []string{}, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - Source: String("Predefined"), - BaseRole: String("read"), + Source: Ptr("Predefined"), + BaseRole: Ptr("read"), } if !cmp.Equal(gotBuiltInRole, wantBuiltInRole) { @@ -164,9 +164,9 @@ func TestOrganizationsService_GetOrgRole(t *testing.T) { } wantCustomRole := &CustomOrgRoles{ - ID: Int64(123456), - Name: String("test-role"), - Description: String("test-role"), + ID: Ptr(int64(123456)), + Name: Ptr("test-role"), + Description: Ptr("test-role"), Permissions: []string{ "read_organization_custom_org_role", "read_organization_custom_repo_role", @@ -174,7 +174,7 @@ func TestOrganizationsService_GetOrgRole(t *testing.T) { }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - Source: String("Organization"), + Source: Ptr("Organization"), BaseRole: nil, } @@ -209,8 +209,8 @@ func TestOrganizationsService_CreateCustomOrgRole(t *testing.T) { ctx := context.Background() opts := &CreateOrUpdateOrgRoleOptions{ - Name: String("Reader"), - Description: String("A role for reading custom org roles"), + Name: Ptr("Reader"), + Description: Ptr("A role for reading custom org roles"), Permissions: []string{"read_organization_custom_org_role"}, } gotRoles, _, err := client.Organizations.CreateCustomOrgRole(ctx, "o", opts) @@ -218,7 +218,7 @@ func TestOrganizationsService_CreateCustomOrgRole(t *testing.T) { t.Errorf("Organizations.CreateCustomOrgRole returned error: %v", err) } - want := &CustomOrgRoles{ID: Int64(8030), Name: String("Reader"), Permissions: []string{"read_organization_custom_org_role"}, Description: String("A role for reading custom org roles")} + want := &CustomOrgRoles{ID: Ptr(int64(8030)), Name: Ptr("Reader"), Permissions: []string{"read_organization_custom_org_role"}, Description: Ptr("A role for reading custom org roles")} if !cmp.Equal(gotRoles, want) { t.Errorf("Organizations.CreateCustomOrgRole returned %+v, want %+v", gotRoles, want) @@ -251,15 +251,15 @@ func TestOrganizationsService_UpdateCustomOrgRole(t *testing.T) { ctx := context.Background() opts := &CreateOrUpdateOrgRoleOptions{ - Name: String("Updated Name"), - Description: String("Updated Description"), + Name: Ptr("Updated Name"), + Description: Ptr("Updated Description"), } gotRoles, _, err := client.Organizations.UpdateCustomOrgRole(ctx, "o", 8030, opts) if err != nil { t.Errorf("Organizations.UpdateCustomOrgRole returned error: %v", err) } - want := &CustomOrgRoles{ID: Int64(8030), Name: String("Updated Name"), Permissions: []string{"read_organization_custom_org_role"}, Description: String("Updated Description")} + want := &CustomOrgRoles{ID: Ptr(int64(8030)), Name: Ptr("Updated Name"), Permissions: []string{"read_organization_custom_org_role"}, Description: Ptr("Updated Description")} if !cmp.Equal(gotRoles, want) { t.Errorf("Organizations.UpdateCustomOrgRole returned %+v, want %+v", gotRoles, want) @@ -442,7 +442,7 @@ func TestOrganizationsService_ListTeamsAssignedToOrgRole(t *testing.T) { t.Errorf("Organizations.ListTeamsAssignedToOrgRole returned error: %v", err) } - want := []*Team{{ID: Int64(1)}} + want := []*Team{{ID: Ptr(int64(1))}} if !cmp.Equal(apps, want) { t.Errorf("Organizations.ListTeamsAssignedToOrgRole returned %+v, want %+v", apps, want) } @@ -477,7 +477,7 @@ func TestOrganizationsService_ListUsersAssignedToOrgRole(t *testing.T) { t.Errorf("Organizations.ListUsersAssignedToOrgRole returned error: %v", err) } - want := []*User{{ID: Int64(1)}} + want := []*User{{ID: Ptr(int64(1))}} if !cmp.Equal(apps, want) { t.Errorf("Organizations.ListUsersAssignedToOrgRole returned %+v, want %+v", apps, want) } diff --git a/github/orgs_outside_collaborators_test.go b/github/orgs_outside_collaborators_test.go index c366800f4bc..42b4b770192 100644 --- a/github/orgs_outside_collaborators_test.go +++ b/github/orgs_outside_collaborators_test.go @@ -37,7 +37,7 @@ func TestOrganizationsService_ListOutsideCollaborators(t *testing.T) { t.Errorf("Organizations.ListOutsideCollaborators returned error: %v", err) } - want := []*User{{ID: Int64(1)}} + want := []*User{{ID: Ptr(int64(1))}} if !cmp.Equal(members, want) { t.Errorf("Organizations.ListOutsideCollaborators returned %+v, want %+v", members, want) } diff --git a/github/orgs_packages_test.go b/github/orgs_packages_test.go index a4bbfb915c4..5aa783d26e0 100644 --- a/github/orgs_packages_test.go +++ b/github/orgs_packages_test.go @@ -64,34 +64,34 @@ func TestOrganizationsService_ListPackages(t *testing.T) { } want := []*Package{{ - ID: Int64(197), - Name: String("hello_docker"), - PackageType: String("container"), - VersionCount: Int64(1), - Visibility: String("private"), - URL: String("https://api.github.com/orgs/github/packages/container/hello_docker"), - HTMLURL: String("https://github.com/orgs/github/packages/container/package/hello_docker"), + ID: Ptr(int64(197)), + Name: Ptr("hello_docker"), + PackageType: Ptr("container"), + VersionCount: Ptr(int64(1)), + Visibility: Ptr("private"), + URL: Ptr("https://api.github.com/orgs/github/packages/container/hello_docker"), + HTMLURL: Ptr("https://github.com/orgs/github/packages/container/package/hello_docker"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, Owner: &User{ - Login: String("github"), - ID: Int64(9919), - NodeID: String("MDEyOk9yZ2FuaXphdGlvbjk5MTk="), - AvatarURL: String("https://avatars.githubusercontent.com/u/9919?v=4"), - GravatarID: String(""), - URL: String("https://api.github.com/users/github"), - HTMLURL: String("https://github.com/github"), - FollowersURL: String("https://api.github.com/users/github/followers"), - FollowingURL: String("https://api.github.com/users/github/following{/other_user}"), - GistsURL: String("https://api.github.com/users/github/gists{/gist_id}"), - StarredURL: String("https://api.github.com/users/github/starred{/owner}{/repo}"), - SubscriptionsURL: String("https://api.github.com/users/github/subscriptions"), - OrganizationsURL: String("https://api.github.com/users/github/orgs"), - ReposURL: String("https://api.github.com/users/github/repos"), - EventsURL: String("https://api.github.com/users/github/events{/privacy}"), - ReceivedEventsURL: String("https://api.github.com/users/github/received_events"), - Type: String("Organization"), - SiteAdmin: Bool(false), + Login: Ptr("github"), + ID: Ptr(int64(9919)), + NodeID: Ptr("MDEyOk9yZ2FuaXphdGlvbjk5MTk="), + AvatarURL: Ptr("https://avatars.githubusercontent.com/u/9919?v=4"), + GravatarID: Ptr(""), + URL: Ptr("https://api.github.com/users/github"), + HTMLURL: Ptr("https://github.com/github"), + FollowersURL: Ptr("https://api.github.com/users/github/followers"), + FollowingURL: Ptr("https://api.github.com/users/github/following{/other_user}"), + GistsURL: Ptr("https://api.github.com/users/github/gists{/gist_id}"), + StarredURL: Ptr("https://api.github.com/users/github/starred{/owner}{/repo}"), + SubscriptionsURL: Ptr("https://api.github.com/users/github/subscriptions"), + OrganizationsURL: Ptr("https://api.github.com/users/github/orgs"), + ReposURL: Ptr("https://api.github.com/users/github/repos"), + EventsURL: Ptr("https://api.github.com/users/github/events{/privacy}"), + ReceivedEventsURL: Ptr("https://api.github.com/users/github/received_events"), + Type: Ptr("Organization"), + SiteAdmin: Ptr(false), }, }} if !cmp.Equal(packages, want) { @@ -143,13 +143,13 @@ func TestOrganizationsService_GetPackage(t *testing.T) { } want := &Package{ - ID: Int64(197), - Name: String("hello/hello_docker"), - PackageType: String("container"), - VersionCount: Int64(1), - Visibility: String("private"), - URL: String("https://api.github.com/orgs/github/packages/container/hello%2Fhello_docker"), - HTMLURL: String("https://github.com/orgs/github/packages/container/package/hello%2Fhello_docker"), + ID: Ptr(int64(197)), + Name: Ptr("hello/hello_docker"), + PackageType: Ptr("container"), + VersionCount: Ptr(int64(1)), + Visibility: Ptr("private"), + URL: Ptr("https://api.github.com/orgs/github/packages/container/hello%2Fhello_docker"), + HTMLURL: Ptr("https://github.com/orgs/github/packages/container/package/hello%2Fhello_docker"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, } @@ -261,7 +261,7 @@ func TestOrganizationsService_ListPackagesVersions(t *testing.T) { ctx := context.Background() opts := &PackageListOptions{ - String("internal"), String("container"), String("deleted"), ListOptions{Page: 1, PerPage: 2}, + Ptr("internal"), Ptr("container"), Ptr("deleted"), ListOptions{Page: 1, PerPage: 2}, } packages, _, err := client.Organizations.PackageGetAllVersions(ctx, "o", "container", "hello/hello_docker", opts) if err != nil { @@ -269,15 +269,15 @@ func TestOrganizationsService_ListPackagesVersions(t *testing.T) { } want := []*PackageVersion{{ - ID: Int64(45763), - Name: String("sha256:08a44bab0bddaddd8837a8b381aebc2e4b933768b981685a9e088360af0d3dd9"), - URL: String("https://api.github.com/users/octocat/packages/container/hello%2Fhello_docker/versions/45763"), - PackageHTMLURL: String("https://github.com/users/octocat/packages/container/package/hello%2Fhello_docker"), + ID: Ptr(int64(45763)), + Name: Ptr("sha256:08a44bab0bddaddd8837a8b381aebc2e4b933768b981685a9e088360af0d3dd9"), + URL: Ptr("https://api.github.com/users/octocat/packages/container/hello%2Fhello_docker/versions/45763"), + PackageHTMLURL: Ptr("https://github.com/users/octocat/packages/container/package/hello%2Fhello_docker"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HTMLURL: String("https://github.com/users/octocat/packages/container/hello%2Fhello_docker/45763"), + HTMLURL: Ptr("https://github.com/users/octocat/packages/container/hello%2Fhello_docker/45763"), Metadata: &PackageMetadata{ - PackageType: String("container"), + PackageType: Ptr("container"), Container: &PackageContainerMetadata{ Tags: []string{"latest"}, }, @@ -339,15 +339,15 @@ func TestOrganizationsService_PackageGetVersion(t *testing.T) { } want := &PackageVersion{ - ID: Int64(45763), - Name: String("sha256:08a44bab0bddaddd8837a8b381aebc2e4b933768b981685a9e088360af0d3dd9"), - URL: String("https://api.github.com/users/octocat/packages/container/hello%2Fhello_docker/versions/45763"), - PackageHTMLURL: String("https://github.com/users/octocat/packages/container/package/hello%2Fhello_docker"), + ID: Ptr(int64(45763)), + Name: Ptr("sha256:08a44bab0bddaddd8837a8b381aebc2e4b933768b981685a9e088360af0d3dd9"), + URL: Ptr("https://api.github.com/users/octocat/packages/container/hello%2Fhello_docker/versions/45763"), + PackageHTMLURL: Ptr("https://github.com/users/octocat/packages/container/package/hello%2Fhello_docker"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HTMLURL: String("https://github.com/users/octocat/packages/container/hello%2Fhello_docker/45763"), + HTMLURL: Ptr("https://github.com/users/octocat/packages/container/hello%2Fhello_docker/45763"), Metadata: &PackageMetadata{ - PackageType: String("container"), + PackageType: Ptr("container"), Container: &PackageContainerMetadata{ Tags: []string{"latest"}, }, diff --git a/github/orgs_personal_access_tokens_test.go b/github/orgs_personal_access_tokens_test.go index f4666004a77..8322c403916 100644 --- a/github/orgs_personal_access_tokens_test.go +++ b/github/orgs_personal_access_tokens_test.go @@ -99,35 +99,35 @@ func TestOrganizationsService_ListFineGrainedPersonalAccessTokens(t *testing.T) want := []*PersonalAccessToken{ { - ID: Int64(25381), + ID: Ptr(int64(25381)), Owner: &User{ - Login: String("octocat"), - ID: Int64(1), - NodeID: String("MDQ6VXNlcjE="), - AvatarURL: String("https://github.com/images/error/octocat_happy.gif"), - GravatarID: String(""), - URL: String("https://api.github.com/users/octocat"), - HTMLURL: String("https://github.com/octocat"), - FollowersURL: String("https://api.github.com/users/octocat/followers"), - FollowingURL: String("https://api.github.com/users/octocat/following{/other_user}"), - GistsURL: String("https://api.github.com/users/octocat/gists{/gist_id}"), - StarredURL: String("https://api.github.com/users/octocat/starred{/owner}{/repo}"), - SubscriptionsURL: String("https://api.github.com/users/octocat/subscriptions"), - OrganizationsURL: String("https://api.github.com/users/octocat/orgs"), - ReposURL: String("https://api.github.com/users/octocat/repos"), - EventsURL: String("https://api.github.com/users/octocat/events{/privacy}"), - ReceivedEventsURL: String("https://api.github.com/users/octocat/received_events"), - Type: String("User"), - SiteAdmin: Bool(false), + Login: Ptr("octocat"), + ID: Ptr(int64(1)), + NodeID: Ptr("MDQ6VXNlcjE="), + AvatarURL: Ptr("https://github.com/images/error/octocat_happy.gif"), + GravatarID: Ptr(""), + URL: Ptr("https://api.github.com/users/octocat"), + HTMLURL: Ptr("https://github.com/octocat"), + FollowersURL: Ptr("https://api.github.com/users/octocat/followers"), + FollowingURL: Ptr("https://api.github.com/users/octocat/following{/other_user}"), + GistsURL: Ptr("https://api.github.com/users/octocat/gists{/gist_id}"), + StarredURL: Ptr("https://api.github.com/users/octocat/starred{/owner}{/repo}"), + SubscriptionsURL: Ptr("https://api.github.com/users/octocat/subscriptions"), + OrganizationsURL: Ptr("https://api.github.com/users/octocat/orgs"), + ReposURL: Ptr("https://api.github.com/users/octocat/repos"), + EventsURL: Ptr("https://api.github.com/users/octocat/events{/privacy}"), + ReceivedEventsURL: Ptr("https://api.github.com/users/octocat/received_events"), + Type: Ptr("User"), + SiteAdmin: Ptr(false), }, - RepositorySelection: String("all"), - RepositoriesURL: String("https://api.github.com/organizations/652551/personal-access-tokens/25381/repositories"), + RepositorySelection: Ptr("all"), + RepositoriesURL: Ptr("https://api.github.com/organizations/652551/personal-access-tokens/25381/repositories"), Permissions: &PersonalAccessTokenPermissions{ Org: map[string]string{"members": "read"}, Repo: map[string]string{"metadata": "read"}, }, AccessGrantedAt: &Timestamp{time.Date(2023, time.May, 16, 8, 47, 9, 0, time.FixedZone("PDT", -7*60*60))}, - TokenExpired: Bool(false), + TokenExpired: Ptr(false), TokenExpiresAt: &Timestamp{time.Date(2023, time.November, 16, 8, 47, 9, 0, time.FixedZone("PDT", -7*60*60))}, TokenLastUsedAt: nil, }, @@ -161,7 +161,7 @@ func TestOrganizationsService_ReviewPersonalAccessTokenRequest(t *testing.T) { input := ReviewPersonalAccessTokenRequestOptions{ Action: "a", - Reason: String("r"), + Reason: Ptr("r"), } mux.HandleFunc("/orgs/o/personal-access-token-requests/1", func(w http.ResponseWriter, r *http.Request) { @@ -203,7 +203,7 @@ func TestReviewPersonalAccessTokenRequestOptions_Marshal(t *testing.T) { u := &ReviewPersonalAccessTokenRequestOptions{ Action: "a", - Reason: String("r"), + Reason: Ptr("r"), } want := `{ diff --git a/github/orgs_projects_test.go b/github/orgs_projects_test.go index b6f082f0a45..f26cb90ac35 100644 --- a/github/orgs_projects_test.go +++ b/github/orgs_projects_test.go @@ -33,7 +33,7 @@ func TestOrganizationsService_ListProjects(t *testing.T) { t.Errorf("Organizations.ListProjects returned error: %v", err) } - want := []*Project{{ID: Int64(1)}} + want := []*Project{{ID: Ptr(int64(1))}} if !cmp.Equal(projects, want) { t.Errorf("Organizations.ListProjects returned %+v, want %+v", projects, want) } @@ -57,7 +57,7 @@ func TestOrganizationsService_CreateProject(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &ProjectOptions{Name: String("Project Name"), Body: String("Project body.")} + input := &ProjectOptions{Name: Ptr("Project Name"), Body: Ptr("Project body.")} mux.HandleFunc("/orgs/o/projects", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -78,7 +78,7 @@ func TestOrganizationsService_CreateProject(t *testing.T) { t.Errorf("Organizations.CreateProject returned error: %v", err) } - want := &Project{ID: Int64(1)} + want := &Project{ID: Ptr(int64(1))} if !cmp.Equal(project, want) { t.Errorf("Organizations.CreateProject returned %+v, want %+v", project, want) } diff --git a/github/orgs_properties_test.go b/github/orgs_properties_test.go index b71132a8622..102f9e669c7 100644 --- a/github/orgs_properties_test.go +++ b/github/orgs_properties_test.go @@ -53,22 +53,22 @@ func TestOrganizationsService_GetAllCustomProperties(t *testing.T) { want := []*CustomProperty{ { - PropertyName: String("name"), + PropertyName: Ptr("name"), ValueType: "single_select", - Required: Bool(true), - DefaultValue: String("production"), - Description: String("Prod or dev environment"), + Required: Ptr(true), + DefaultValue: Ptr("production"), + Description: Ptr("Prod or dev environment"), AllowedValues: []string{"production", "development"}, - ValuesEditableBy: String("org_actors"), + ValuesEditableBy: Ptr("org_actors"), }, { - PropertyName: String("service"), + PropertyName: Ptr("service"), ValueType: "string", }, { - PropertyName: String("team"), + PropertyName: Ptr("team"), ValueType: "string", - Description: String("Team owning the repository"), + Description: Ptr("Team owning the repository"), }, } if !cmp.Equal(properties, want) { @@ -109,12 +109,12 @@ func TestOrganizationsService_CreateOrUpdateCustomProperties(t *testing.T) { ctx := context.Background() properties, _, err := client.Organizations.CreateOrUpdateCustomProperties(ctx, "o", []*CustomProperty{ { - PropertyName: String("name"), + PropertyName: Ptr("name"), ValueType: "single_select", - Required: Bool(true), + Required: Ptr(true), }, { - PropertyName: String("service"), + PropertyName: Ptr("service"), ValueType: "string", }, }) @@ -124,12 +124,12 @@ func TestOrganizationsService_CreateOrUpdateCustomProperties(t *testing.T) { want := []*CustomProperty{ { - PropertyName: String("name"), + PropertyName: Ptr("name"), ValueType: "single_select", - Required: Bool(true), + Required: Ptr(true), }, { - PropertyName: String("service"), + PropertyName: Ptr("service"), ValueType: "string", }, } @@ -176,13 +176,13 @@ func TestOrganizationsService_GetCustomProperty(t *testing.T) { } want := &CustomProperty{ - PropertyName: String("name"), + PropertyName: Ptr("name"), ValueType: "single_select", - Required: Bool(true), - DefaultValue: String("production"), - Description: String("Prod or dev environment"), + Required: Ptr(true), + DefaultValue: Ptr("production"), + Description: Ptr("Prod or dev environment"), AllowedValues: []string{"production", "development"}, - ValuesEditableBy: String("org_actors"), + ValuesEditableBy: Ptr("org_actors"), } if !cmp.Equal(property, want) { t.Errorf("Organizations.GetCustomProperty returned %+v, want %+v", property, want) @@ -222,24 +222,24 @@ func TestOrganizationsService_CreateOrUpdateCustomProperty(t *testing.T) { ctx := context.Background() property, _, err := client.Organizations.CreateOrUpdateCustomProperty(ctx, "o", "name", &CustomProperty{ ValueType: "single_select", - Required: Bool(true), - DefaultValue: String("production"), - Description: String("Prod or dev environment"), + Required: Ptr(true), + DefaultValue: Ptr("production"), + Description: Ptr("Prod or dev environment"), AllowedValues: []string{"production", "development"}, - ValuesEditableBy: String("org_actors"), + ValuesEditableBy: Ptr("org_actors"), }) if err != nil { t.Errorf("Organizations.CreateOrUpdateCustomProperty returned error: %v", err) } want := &CustomProperty{ - PropertyName: String("name"), + PropertyName: Ptr("name"), ValueType: "single_select", - Required: Bool(true), - DefaultValue: String("production"), - Description: String("Prod or dev environment"), + Required: Ptr(true), + DefaultValue: Ptr("production"), + Description: Ptr("Prod or dev environment"), AllowedValues: []string{"production", "development"}, - ValuesEditableBy: String("org_actors"), + ValuesEditableBy: Ptr("org_actors"), } if !cmp.Equal(property, want) { t.Errorf("Organizations.CreateOrUpdateCustomProperty returned %+v, want %+v", property, want) @@ -452,7 +452,7 @@ func TestOrganizationsService_CreateOrUpdateRepoCustomPropertyValues(t *testing. _, err := client.Organizations.CreateOrUpdateRepoCustomPropertyValues(ctx, "o", []string{"repo"}, []*CustomPropertyValue{ { PropertyName: "service", - Value: String("string"), + Value: Ptr("string"), }, }) if err != nil { diff --git a/github/orgs_rules_test.go b/github/orgs_rules_test.go index ca6e3f84ce4..ebc559c640c 100644 --- a/github/orgs_rules_test.go +++ b/github/orgs_rules_test.go @@ -44,15 +44,15 @@ func TestOrganizationsService_GetAllOrganizationRulesets(t *testing.T) { } want := []*Ruleset{{ - ID: Int64(26110), + ID: Ptr(int64(26110)), Name: "test ruleset", - Target: String("branch"), - SourceType: String("Organization"), + Target: Ptr("branch"), + SourceType: Ptr("Organization"), Source: "o", Enforcement: "active", - NodeID: String("nid"), + NodeID: Ptr("nid"), Links: &RulesetLinks{ - Self: &RulesetLink{HRef: String("https://api.github.com/orgs/o/rulesets/26110")}, + Self: &RulesetLink{HRef: Ptr("https://api.github.com/orgs/o/rulesets/26110")}, }, }} if !cmp.Equal(rulesets, want) { @@ -221,16 +221,16 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) ctx := context.Background() ruleset, _, err := client.Organizations.CreateOrganizationRuleset(ctx, "o", &Ruleset{ - ID: Int64(21), + ID: Ptr(int64(21)), Name: "ruleset", - Target: String("branch"), - SourceType: String("Organization"), + Target: Ptr("branch"), + SourceType: Ptr("Organization"), Source: "o", Enforcement: "active", BypassActors: []*BypassActor{ { - ActorID: Int64(234), - ActorType: String("Team"), + ActorID: Ptr(int64(234)), + ActorType: Ptr("Team"), }, }, Conditions: &RulesetConditions{ @@ -241,7 +241,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) RepositoryName: &RulesetRepositoryNamesConditionParameters{ Include: []string{"important_repository", "another_important_repository"}, Exclude: []string{"unimportant_repository"}, - Protected: Bool(true), + Protected: Ptr(true), }, }, Rules: []*RepositoryRule{ @@ -266,15 +266,15 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) RequiredStatusChecks: []RuleRequiredStatusChecks{ { Context: "test", - IntegrationID: Int64(1), + IntegrationID: Ptr(int64(1)), }, }, StrictRequiredStatusChecksPolicy: true, }), NewNonFastForwardRule(), NewCommitMessagePatternRule(&RulePatternParameters{ - Name: String("avoid test commits"), - Negate: Bool(true), + Name: Ptr("avoid test commits"), + Negate: Ptr(true), Operator: "starts_with", Pattern: "[test]", }), @@ -283,20 +283,20 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) Pattern: "github", }), NewCommitterEmailPatternRule(&RulePatternParameters{ - Name: String("avoid commit emails"), - Negate: Bool(true), + Name: Ptr("avoid commit emails"), + Negate: Ptr(true), Operator: "ends_with", Pattern: "abc", }), NewBranchNamePatternRule(&RulePatternParameters{ - Name: String("avoid branch names"), - Negate: Bool(true), + Name: Ptr("avoid branch names"), + Negate: Ptr(true), Operator: "regex", Pattern: "github$", }), NewTagNamePatternRule(&RulePatternParameters{ - Name: String("avoid tag names"), - Negate: Bool(true), + Name: Ptr("avoid tag names"), + Negate: Ptr(true), Operator: "contains", Pattern: "github", }), @@ -316,16 +316,16 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) } want := &Ruleset{ - ID: Int64(21), + ID: Ptr(int64(21)), Name: "ruleset", - Target: String("branch"), - SourceType: String("Organization"), + Target: Ptr("branch"), + SourceType: Ptr("Organization"), Source: "o", Enforcement: "active", BypassActors: []*BypassActor{ { - ActorID: Int64(234), - ActorType: String("Team"), + ActorID: Ptr(int64(234)), + ActorType: Ptr("Team"), }, }, Conditions: &RulesetConditions{ @@ -336,7 +336,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) RepositoryName: &RulesetRepositoryNamesConditionParameters{ Include: []string{"important_repository", "another_important_repository"}, Exclude: []string{"unimportant_repository"}, - Protected: Bool(true), + Protected: Ptr(true), }, }, Rules: []*RepositoryRule{ @@ -361,15 +361,15 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) RequiredStatusChecks: []RuleRequiredStatusChecks{ { Context: "test", - IntegrationID: Int64(1), + IntegrationID: Ptr(int64(1)), }, }, StrictRequiredStatusChecksPolicy: true, }), NewNonFastForwardRule(), NewCommitMessagePatternRule(&RulePatternParameters{ - Name: String("avoid test commits"), - Negate: Bool(true), + Name: Ptr("avoid test commits"), + Negate: Ptr(true), Operator: "starts_with", Pattern: "[test]", }), @@ -378,20 +378,20 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) Pattern: "github", }), NewCommitterEmailPatternRule(&RulePatternParameters{ - Name: String("avoid commit emails"), - Negate: Bool(true), + Name: Ptr("avoid commit emails"), + Negate: Ptr(true), Operator: "ends_with", Pattern: "abc", }), NewBranchNamePatternRule(&RulePatternParameters{ - Name: String("avoid branch names"), - Negate: Bool(true), + Name: Ptr("avoid branch names"), + Negate: Ptr(true), Operator: "regex", Pattern: "github$", }), NewTagNamePatternRule(&RulePatternParameters{ - Name: String("avoid tag names"), - Negate: Bool(true), + Name: Ptr("avoid tag names"), + Negate: Ptr(true), Operator: "contains", Pattern: "github", }), @@ -572,16 +572,16 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing. ctx := context.Background() ruleset, _, err := client.Organizations.CreateOrganizationRuleset(ctx, "o", &Ruleset{ - ID: Int64(21), + ID: Ptr(int64(21)), Name: "ruleset", - Target: String("branch"), - SourceType: String("Organization"), + Target: Ptr("branch"), + SourceType: Ptr("Organization"), Source: "o", Enforcement: "active", BypassActors: []*BypassActor{ { - ActorID: Int64(234), - ActorType: String("Team"), + ActorID: Ptr(int64(234)), + ActorType: Ptr("Team"), }, }, Conditions: &RulesetConditions{ @@ -589,7 +589,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing. Include: []RulesetRepositoryPropertyTargetParameters{ { Name: "testIncludeProp", - Source: String("custom"), + Source: Ptr("custom"), Values: []string{"true"}, }, }, @@ -623,15 +623,15 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing. RequiredStatusChecks: []RuleRequiredStatusChecks{ { Context: "test", - IntegrationID: Int64(1), + IntegrationID: Ptr(int64(1)), }, }, StrictRequiredStatusChecksPolicy: true, }), NewNonFastForwardRule(), NewCommitMessagePatternRule(&RulePatternParameters{ - Name: String("avoid test commits"), - Negate: Bool(true), + Name: Ptr("avoid test commits"), + Negate: Ptr(true), Operator: "starts_with", Pattern: "[test]", }), @@ -640,20 +640,20 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing. Pattern: "github", }), NewCommitterEmailPatternRule(&RulePatternParameters{ - Name: String("avoid commit emails"), - Negate: Bool(true), + Name: Ptr("avoid commit emails"), + Negate: Ptr(true), Operator: "ends_with", Pattern: "abc", }), NewBranchNamePatternRule(&RulePatternParameters{ - Name: String("avoid branch names"), - Negate: Bool(true), + Name: Ptr("avoid branch names"), + Negate: Ptr(true), Operator: "regex", Pattern: "github$", }), NewTagNamePatternRule(&RulePatternParameters{ - Name: String("avoid tag names"), - Negate: Bool(true), + Name: Ptr("avoid tag names"), + Negate: Ptr(true), Operator: "contains", Pattern: "github", }), @@ -673,16 +673,16 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing. } want := &Ruleset{ - ID: Int64(21), + ID: Ptr(int64(21)), Name: "ruleset", - Target: String("branch"), - SourceType: String("Organization"), + Target: Ptr("branch"), + SourceType: Ptr("Organization"), Source: "o", Enforcement: "active", BypassActors: []*BypassActor{ { - ActorID: Int64(234), - ActorType: String("Team"), + ActorID: Ptr(int64(234)), + ActorType: Ptr("Team"), }, }, Conditions: &RulesetConditions{ @@ -690,7 +690,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing. Include: []RulesetRepositoryPropertyTargetParameters{ { Name: "testIncludeProp", - Source: String("custom"), + Source: Ptr("custom"), Values: []string{"true"}, }, }, @@ -724,15 +724,15 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing. RequiredStatusChecks: []RuleRequiredStatusChecks{ { Context: "test", - IntegrationID: Int64(1), + IntegrationID: Ptr(int64(1)), }, }, StrictRequiredStatusChecksPolicy: true, }), NewNonFastForwardRule(), NewCommitMessagePatternRule(&RulePatternParameters{ - Name: String("avoid test commits"), - Negate: Bool(true), + Name: Ptr("avoid test commits"), + Negate: Ptr(true), Operator: "starts_with", Pattern: "[test]", }), @@ -741,20 +741,20 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing. Pattern: "github", }), NewCommitterEmailPatternRule(&RulePatternParameters{ - Name: String("avoid commit emails"), - Negate: Bool(true), + Name: Ptr("avoid commit emails"), + Negate: Ptr(true), Operator: "ends_with", Pattern: "abc", }), NewBranchNamePatternRule(&RulePatternParameters{ - Name: String("avoid branch names"), - Negate: Bool(true), + Name: Ptr("avoid branch names"), + Negate: Ptr(true), Operator: "regex", Pattern: "github$", }), NewTagNamePatternRule(&RulePatternParameters{ - Name: String("avoid tag names"), - Negate: Bool(true), + Name: Ptr("avoid tag names"), + Negate: Ptr(true), Operator: "contains", Pattern: "github", }), @@ -928,16 +928,16 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { ctx := context.Background() ruleset, _, err := client.Organizations.CreateOrganizationRuleset(ctx, "o", &Ruleset{ - ID: Int64(21), + ID: Ptr(int64(21)), Name: "ruleset", - Target: String("branch"), - SourceType: String("Organization"), + Target: Ptr("branch"), + SourceType: Ptr("Organization"), Source: "o", Enforcement: "active", BypassActors: []*BypassActor{ { - ActorID: Int64(234), - ActorType: String("Team"), + ActorID: Ptr(int64(234)), + ActorType: Ptr("Team"), }, }, Conditions: &RulesetConditions{ @@ -971,15 +971,15 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { RequiredStatusChecks: []RuleRequiredStatusChecks{ { Context: "test", - IntegrationID: Int64(1), + IntegrationID: Ptr(int64(1)), }, }, StrictRequiredStatusChecksPolicy: true, }), NewNonFastForwardRule(), NewCommitMessagePatternRule(&RulePatternParameters{ - Name: String("avoid test commits"), - Negate: Bool(true), + Name: Ptr("avoid test commits"), + Negate: Ptr(true), Operator: "starts_with", Pattern: "[test]", }), @@ -988,20 +988,20 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { Pattern: "github", }), NewCommitterEmailPatternRule(&RulePatternParameters{ - Name: String("avoid commit emails"), - Negate: Bool(true), + Name: Ptr("avoid commit emails"), + Negate: Ptr(true), Operator: "ends_with", Pattern: "abc", }), NewBranchNamePatternRule(&RulePatternParameters{ - Name: String("avoid branch names"), - Negate: Bool(true), + Name: Ptr("avoid branch names"), + Negate: Ptr(true), Operator: "regex", Pattern: "github$", }), NewTagNamePatternRule(&RulePatternParameters{ - Name: String("avoid tag names"), - Negate: Bool(true), + Name: Ptr("avoid tag names"), + Negate: Ptr(true), Operator: "contains", Pattern: "github", }), @@ -1021,16 +1021,16 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { } want := &Ruleset{ - ID: Int64(21), + ID: Ptr(int64(21)), Name: "ruleset", - Target: String("branch"), - SourceType: String("Organization"), + Target: Ptr("branch"), + SourceType: Ptr("Organization"), Source: "o", Enforcement: "active", BypassActors: []*BypassActor{ { - ActorID: Int64(234), - ActorType: String("Team"), + ActorID: Ptr(int64(234)), + ActorType: Ptr("Team"), }, }, Conditions: &RulesetConditions{ @@ -1064,15 +1064,15 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { RequiredStatusChecks: []RuleRequiredStatusChecks{ { Context: "test", - IntegrationID: Int64(1), + IntegrationID: Ptr(int64(1)), }, }, StrictRequiredStatusChecksPolicy: true, }), NewNonFastForwardRule(), NewCommitMessagePatternRule(&RulePatternParameters{ - Name: String("avoid test commits"), - Negate: Bool(true), + Name: Ptr("avoid test commits"), + Negate: Ptr(true), Operator: "starts_with", Pattern: "[test]", }), @@ -1081,20 +1081,20 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { Pattern: "github", }), NewCommitterEmailPatternRule(&RulePatternParameters{ - Name: String("avoid commit emails"), - Negate: Bool(true), + Name: Ptr("avoid commit emails"), + Negate: Ptr(true), Operator: "ends_with", Pattern: "abc", }), NewBranchNamePatternRule(&RulePatternParameters{ - Name: String("avoid branch names"), - Negate: Bool(true), + Name: Ptr("avoid branch names"), + Negate: Ptr(true), Operator: "regex", Pattern: "github$", }), NewTagNamePatternRule(&RulePatternParameters{ - Name: String("avoid tag names"), - Negate: Bool(true), + Name: Ptr("avoid tag names"), + Negate: Ptr(true), Operator: "contains", Pattern: "github", }), @@ -1180,15 +1180,15 @@ func TestOrganizationsService_GetOrganizationRuleset(t *testing.T) { } want := &Ruleset{ - ID: Int64(26110), + ID: Ptr(int64(26110)), Name: "test ruleset", - Target: String("branch"), - SourceType: String("Organization"), + Target: Ptr("branch"), + SourceType: Ptr("Organization"), Source: "o", Enforcement: "active", - NodeID: String("nid"), + NodeID: Ptr("nid"), Links: &RulesetLinks{ - Self: &RulesetLink{HRef: String("https://api.github.com/orgs/o/rulesets/26110")}, + Self: &RulesetLink{HRef: Ptr("https://api.github.com/orgs/o/rulesets/26110")}, }, Conditions: &RulesetConditions{ RefName: &RulesetRefConditionParameters{ @@ -1198,7 +1198,7 @@ func TestOrganizationsService_GetOrganizationRuleset(t *testing.T) { RepositoryName: &RulesetRepositoryNamesConditionParameters{ Include: []string{"important_repository", "another_important_repository"}, Exclude: []string{"unimportant_repository"}, - Protected: Bool(true), + Protected: Ptr(true), }, }, Rules: []*RepositoryRule{ @@ -1269,22 +1269,22 @@ func TestOrganizationsService_GetOrganizationRulesetWithRepoPropCondition(t *tes } want := &Ruleset{ - ID: Int64(26110), + ID: Ptr(int64(26110)), Name: "test ruleset", - Target: String("branch"), - SourceType: String("Organization"), + Target: Ptr("branch"), + SourceType: Ptr("Organization"), Source: "o", Enforcement: "active", - NodeID: String("nid"), + NodeID: Ptr("nid"), Links: &RulesetLinks{ - Self: &RulesetLink{HRef: String("https://api.github.com/orgs/o/rulesets/26110")}, + Self: &RulesetLink{HRef: Ptr("https://api.github.com/orgs/o/rulesets/26110")}, }, Conditions: &RulesetConditions{ RepositoryProperty: &RulesetRepositoryPropertyConditionParameters{ Include: []RulesetRepositoryPropertyTargetParameters{ { Name: "testIncludeProp", - Source: String("custom"), + Source: Ptr("custom"), Values: []string{"true"}, }, }, @@ -1362,7 +1362,7 @@ func TestOrganizationsService_UpdateOrganizationRuleset(t *testing.T) { ctx := context.Background() rulesets, _, err := client.Organizations.UpdateOrganizationRuleset(ctx, "o", 26110, &Ruleset{ Name: "test ruleset", - Target: String("branch"), + Target: Ptr("branch"), Enforcement: "active", Conditions: &RulesetConditions{ RefName: &RulesetRefConditionParameters{ @@ -1372,7 +1372,7 @@ func TestOrganizationsService_UpdateOrganizationRuleset(t *testing.T) { RepositoryName: &RulesetRepositoryNamesConditionParameters{ Include: []string{"important_repository", "another_important_repository"}, Exclude: []string{"unimportant_repository"}, - Protected: Bool(true), + Protected: Ptr(true), }, }, Rules: []*RepositoryRule{ @@ -1385,15 +1385,15 @@ func TestOrganizationsService_UpdateOrganizationRuleset(t *testing.T) { } want := &Ruleset{ - ID: Int64(26110), + ID: Ptr(int64(26110)), Name: "test ruleset", - Target: String("branch"), - SourceType: String("Organization"), + Target: Ptr("branch"), + SourceType: Ptr("Organization"), Source: "o", Enforcement: "active", - NodeID: String("nid"), + NodeID: Ptr("nid"), Links: &RulesetLinks{ - Self: &RulesetLink{HRef: String("https://api.github.com/orgs/o/rulesets/26110")}, + Self: &RulesetLink{HRef: Ptr("https://api.github.com/orgs/o/rulesets/26110")}, }, Conditions: &RulesetConditions{ RefName: &RulesetRefConditionParameters{ @@ -1403,7 +1403,7 @@ func TestOrganizationsService_UpdateOrganizationRuleset(t *testing.T) { RepositoryName: &RulesetRepositoryNamesConditionParameters{ Include: []string{"important_repository", "another_important_repository"}, Exclude: []string{"unimportant_repository"}, - Protected: Bool(true), + Protected: Ptr(true), }, }, Rules: []*RepositoryRule{ @@ -1470,14 +1470,14 @@ func TestOrganizationsService_UpdateOrganizationRulesetWithRepoProp(t *testing.T ctx := context.Background() rulesets, _, err := client.Organizations.UpdateOrganizationRuleset(ctx, "o", 26110, &Ruleset{ Name: "test ruleset", - Target: String("branch"), + Target: Ptr("branch"), Enforcement: "active", Conditions: &RulesetConditions{ RepositoryProperty: &RulesetRepositoryPropertyConditionParameters{ Include: []RulesetRepositoryPropertyTargetParameters{ { Name: "testIncludeProp", - Source: String("custom"), + Source: Ptr("custom"), Values: []string{"true"}, }, }, @@ -1494,22 +1494,22 @@ func TestOrganizationsService_UpdateOrganizationRulesetWithRepoProp(t *testing.T } want := &Ruleset{ - ID: Int64(26110), + ID: Ptr(int64(26110)), Name: "test ruleset", - Target: String("branch"), - SourceType: String("Organization"), + Target: Ptr("branch"), + SourceType: Ptr("Organization"), Source: "o", Enforcement: "active", - NodeID: String("nid"), + NodeID: Ptr("nid"), Links: &RulesetLinks{ - Self: &RulesetLink{HRef: String("https://api.github.com/orgs/o/rulesets/26110")}, + Self: &RulesetLink{HRef: Ptr("https://api.github.com/orgs/o/rulesets/26110")}, }, Conditions: &RulesetConditions{ RepositoryProperty: &RulesetRepositoryPropertyConditionParameters{ Include: []RulesetRepositoryPropertyTargetParameters{ { Name: "testIncludeProp", - Source: String("custom"), + Source: Ptr("custom"), Values: []string{"true"}, }, }, diff --git a/github/orgs_security_managers_test.go b/github/orgs_security_managers_test.go index 336a16a2abd..3ce67d24c03 100644 --- a/github/orgs_security_managers_test.go +++ b/github/orgs_security_managers_test.go @@ -29,7 +29,7 @@ func TestOrganizationsService_ListSecurityManagerTeams(t *testing.T) { t.Errorf("Organizations.ListSecurityManagerTeams returned error: %v", err) } - want := []*Team{{ID: Int64(1)}} + want := []*Team{{ID: Ptr(int64(1))}} if !cmp.Equal(teams, want) { t.Errorf("Organizations.ListSecurityManagerTeams returned %+v, want %+v", teams, want) } diff --git a/github/orgs_test.go b/github/orgs_test.go index a7412baebac..3866ca78773 100644 --- a/github/orgs_test.go +++ b/github/orgs_test.go @@ -20,26 +20,26 @@ func TestOrganization_Marshal(t *testing.T) { testJSONMarshal(t, &Organization{}, "{}") o := &Organization{ - BillingEmail: String("support@github.com"), - Blog: String("https://github.com/blog"), - Company: String("GitHub"), - Email: String("support@github.com"), - TwitterUsername: String("github"), - Location: String("San Francisco"), - Name: String("github"), - Description: String("GitHub, the company."), - IsVerified: Bool(true), - HasOrganizationProjects: Bool(true), - HasRepositoryProjects: Bool(true), - DefaultRepoPermission: String("read"), - MembersCanCreateRepos: Bool(true), - MembersCanCreateInternalRepos: Bool(true), - MembersCanCreatePrivateRepos: Bool(true), - MembersCanCreatePublicRepos: Bool(false), - MembersAllowedRepositoryCreationType: String("all"), - MembersCanCreatePages: Bool(true), - MembersCanCreatePublicPages: Bool(false), - MembersCanCreatePrivatePages: Bool(true), + BillingEmail: Ptr("support@github.com"), + Blog: Ptr("https://github.com/blog"), + Company: Ptr("GitHub"), + Email: Ptr("support@github.com"), + TwitterUsername: Ptr("github"), + Location: Ptr("San Francisco"), + Name: Ptr("github"), + Description: Ptr("GitHub, the company."), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("read"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("all"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), } want := ` { @@ -86,7 +86,7 @@ func TestOrganizationsService_ListAll(t *testing.T) { t.Errorf("Organizations.ListAll returned error: %v", err) } - want := []*Organization{{ID: Int64(4314092)}} + want := []*Organization{{ID: Ptr(int64(4314092))}} if !cmp.Equal(orgs, want) { t.Errorf("Organizations.ListAll returned %+v, want %+v", orgs, want) } @@ -116,7 +116,7 @@ func TestOrganizationsService_List_authenticatedUser(t *testing.T) { t.Errorf("Organizations.List returned error: %v", err) } - want := []*Organization{{ID: Int64(1)}, {ID: Int64(2)}} + want := []*Organization{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}} if !cmp.Equal(orgs, want) { t.Errorf("Organizations.List returned %+v, want %+v", orgs, want) } @@ -153,7 +153,7 @@ func TestOrganizationsService_List_specifiedUser(t *testing.T) { t.Errorf("Organizations.List returned error: %v", err) } - want := []*Organization{{ID: Int64(1)}, {ID: Int64(2)}} + want := []*Organization{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}} if !cmp.Equal(orgs, want) { t.Errorf("Organizations.List returned %+v, want %+v", orgs, want) } @@ -198,7 +198,7 @@ func TestOrganizationsService_Get(t *testing.T) { t.Errorf("Organizations.Get returned error: %v", err) } - want := &Organization{ID: Int64(1), Login: String("l"), URL: String("u"), AvatarURL: String("a"), Location: String("l")} + want := &Organization{ID: Ptr(int64(1)), Login: Ptr("l"), URL: Ptr("u"), AvatarURL: Ptr("a"), Location: Ptr("l")} if !cmp.Equal(org, want) { t.Errorf("Organizations.Get returned %+v, want %+v", org, want) } @@ -242,7 +242,7 @@ func TestOrganizationsService_GetByID(t *testing.T) { t.Fatalf("Organizations.GetByID returned error: %v", err) } - want := &Organization{ID: Int64(1), Login: String("l"), URL: String("u"), AvatarURL: String("a"), Location: String("l")} + want := &Organization{ID: Ptr(int64(1)), Login: Ptr("l"), URL: Ptr("u"), AvatarURL: Ptr("a"), Location: Ptr("l")} if !cmp.Equal(org, want) { t.Errorf("Organizations.GetByID returned %+v, want %+v", org, want) } @@ -266,7 +266,7 @@ func TestOrganizationsService_Edit(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &Organization{Login: String("l")} + input := &Organization{Login: Ptr("l")} mux.HandleFunc("/orgs/o", func(w http.ResponseWriter, r *http.Request) { v := new(Organization) @@ -287,7 +287,7 @@ func TestOrganizationsService_Edit(t *testing.T) { t.Errorf("Organizations.Edit returned error: %v", err) } - want := &Organization{ID: Int64(1)} + want := &Organization{ID: Ptr(int64(1))} if !cmp.Equal(org, want) { t.Errorf("Organizations.Edit returned %+v, want %+v", org, want) } @@ -356,7 +356,7 @@ func TestOrganizationsService_ListInstallations(t *testing.T) { t.Errorf("Organizations.ListInstallations returned error: %v", err) } - want := &OrganizationInstallations{TotalCount: Int(1), Installations: []*Installation{{ID: Int64(1), AppID: Int64(5)}}} + want := &OrganizationInstallations{TotalCount: Ptr(1), Installations: []*Installation{{ID: Ptr(int64(1)), AppID: Ptr(int64(5))}}} if !cmp.Equal(apps, want) { t.Errorf("Organizations.ListInstallations returned %+v, want %+v", apps, want) } @@ -401,7 +401,7 @@ func TestOrganizationsService_ListInstallations_withListOptions(t *testing.T) { t.Errorf("Organizations.ListInstallations returned error: %v", err) } - want := &OrganizationInstallations{TotalCount: Int(2), Installations: []*Installation{{ID: Int64(2), AppID: Int64(10)}}} + want := &OrganizationInstallations{TotalCount: Ptr(2), Installations: []*Installation{{ID: Ptr(int64(2)), AppID: Ptr(int64(10))}}} if !cmp.Equal(apps, want) { t.Errorf("Organizations.ListInstallations returned %+v, want %+v", apps, want) } @@ -432,8 +432,8 @@ func TestOrganizationInstallations_Marshal(t *testing.T) { testJSONMarshal(t, &OrganizationInstallations{}, "{}") o := &OrganizationInstallations{ - TotalCount: Int(1), - Installations: []*Installation{{ID: Int64(1)}}, + TotalCount: Ptr(1), + Installations: []*Installation{{ID: Ptr(int64(1))}}, } want := `{ "total_count": 1, @@ -452,12 +452,12 @@ func TestPlan_Marshal(t *testing.T) { testJSONMarshal(t, &Plan{}, "{}") o := &Plan{ - Name: String("name"), - Space: Int(1), - Collaborators: Int(1), - PrivateRepos: Int64(1), - FilledSeats: Int(1), - Seats: Int(1), + Name: Ptr("name"), + Space: Ptr(1), + Collaborators: Ptr(1), + PrivateRepos: Ptr(int64(1)), + FilledSeats: Ptr(1), + Seats: Ptr(1), } want := `{ "name": "name", diff --git a/github/orgs_users_blocking_test.go b/github/orgs_users_blocking_test.go index b544f3a49cc..82172fb033e 100644 --- a/github/orgs_users_blocking_test.go +++ b/github/orgs_users_blocking_test.go @@ -34,7 +34,7 @@ func TestOrganizationsService_ListBlockedUsers(t *testing.T) { t.Errorf("Organizations.ListBlockedUsers returned error: %v", err) } - want := []*User{{Login: String("octocat")}} + want := []*User{{Login: Ptr("octocat")}} if !cmp.Equal(blockedUsers, want) { t.Errorf("Organizations.ListBlockedUsers returned %+v, want %+v", blockedUsers, want) } diff --git a/github/packages_test.go b/github/packages_test.go index d4e33989642..718998f7efd 100644 --- a/github/packages_test.go +++ b/github/packages_test.go @@ -12,11 +12,11 @@ func TestPackageRegistry_Marshal(t *testing.T) { testJSONMarshal(t, &PackageRegistry{}, "{}") o := &PackageRegistry{ - AboutURL: String("aurl"), - Name: String("name"), - Type: String("type"), - URL: String("url"), - Vendor: String("vendor"), + AboutURL: Ptr("aurl"), + Name: Ptr("name"), + Type: Ptr("type"), + URL: Ptr("url"), + Vendor: Ptr("vendor"), } want := `{ "about_url": "aurl", @@ -34,35 +34,35 @@ func TestPackageFile_Marshal(t *testing.T) { testJSONMarshal(t, &PackageFile{}, "{}") o := &PackageFile{ - DownloadURL: String("durl"), - ID: Int64(1), - Name: String("name"), - SHA256: String("sha256"), - SHA1: String("sha1"), - MD5: String("md5"), - ContentType: String("ct"), - State: String("state"), + DownloadURL: Ptr("durl"), + ID: Ptr(int64(1)), + Name: Ptr("name"), + SHA256: Ptr("sha256"), + SHA1: Ptr("sha1"), + MD5: Ptr("md5"), + ContentType: Ptr("ct"), + State: Ptr("state"), Author: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - Size: Int64(1), + Size: Ptr(int64(1)), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, } @@ -109,34 +109,34 @@ func TestPackageRelease_Marshal(t *testing.T) { testJSONMarshal(t, &PackageRelease{}, "{}") o := &PackageRelease{ - URL: String("url"), - HTMLURL: String("hurl"), - ID: Int64(1), - TagName: String("tn"), - TargetCommitish: String("tcs"), - Name: String("name"), - Draft: Bool(true), + URL: Ptr("url"), + HTMLURL: Ptr("hurl"), + ID: Ptr(int64(1)), + TagName: Ptr("tn"), + TargetCommitish: Ptr("tcs"), + Name: Ptr("name"), + Draft: Ptr(true), Author: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - Prerelease: Bool(true), + Prerelease: Ptr(true), CreatedAt: &Timestamp{referenceTime}, PublishedAt: &Timestamp{referenceTime}, } @@ -182,108 +182,108 @@ func TestPackageVersion_Marshal(t *testing.T) { testJSONMarshal(t, &PackageVersion{}, "{}") o := &PackageVersion{ - ID: Int64(1), - Version: String("ver"), - Summary: String("sum"), - Body: String("body"), - BodyHTML: String("btnhtml"), + ID: Ptr(int64(1)), + Version: Ptr("ver"), + Summary: Ptr("sum"), + Body: Ptr("body"), + BodyHTML: Ptr("btnhtml"), Release: &PackageRelease{ - URL: String("url"), - HTMLURL: String("hurl"), - ID: Int64(1), - TagName: String("tn"), - TargetCommitish: String("tcs"), - Name: String("name"), - Draft: Bool(true), + URL: Ptr("url"), + HTMLURL: Ptr("hurl"), + ID: Ptr(int64(1)), + TagName: Ptr("tn"), + TargetCommitish: Ptr("tcs"), + Name: Ptr("name"), + Draft: Ptr(true), Author: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - Prerelease: Bool(true), + Prerelease: Ptr(true), CreatedAt: &Timestamp{referenceTime}, PublishedAt: &Timestamp{referenceTime}, }, - Manifest: String("mani"), - HTMLURL: String("hurl"), - TagName: String("tn"), - TargetCommitish: String("tcs"), - TargetOID: String("tid"), - Draft: Bool(true), - Prerelease: Bool(true), + Manifest: Ptr("mani"), + HTMLURL: Ptr("hurl"), + TagName: Ptr("tn"), + TargetCommitish: Ptr("tcs"), + TargetOID: Ptr("tid"), + Draft: Ptr(true), + Prerelease: Ptr(true), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, PackageFiles: []*PackageFile{ { - DownloadURL: String("durl"), - ID: Int64(1), - Name: String("name"), - SHA256: String("sha256"), - SHA1: String("sha1"), - MD5: String("md5"), - ContentType: String("ct"), - State: String("state"), + DownloadURL: Ptr("durl"), + ID: Ptr(int64(1)), + Name: Ptr("name"), + SHA256: Ptr("sha256"), + SHA1: Ptr("sha1"), + MD5: Ptr("md5"), + ContentType: Ptr("ct"), + State: Ptr("state"), Author: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - Size: Int64(1), + Size: Ptr(int64(1)), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, }, }, Author: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - InstallationCommand: String("ic"), + InstallationCommand: Ptr("ic"), } want := `{ @@ -399,143 +399,143 @@ func TestPackage_Marshal(t *testing.T) { testJSONMarshal(t, &Package{}, "{}") o := &Package{ - ID: Int64(1), - Name: String("name"), - PackageType: String("pt"), - HTMLURL: String("hurl"), + ID: Ptr(int64(1)), + Name: Ptr("name"), + PackageType: Ptr("pt"), + HTMLURL: Ptr("hurl"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - Visibility: String("private"), + Visibility: Ptr("private"), Owner: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, PackageVersion: &PackageVersion{ - ID: Int64(1), - Version: String("ver"), - Summary: String("sum"), - Body: String("body"), - BodyHTML: String("btnhtml"), + ID: Ptr(int64(1)), + Version: Ptr("ver"), + Summary: Ptr("sum"), + Body: Ptr("body"), + BodyHTML: Ptr("btnhtml"), Release: &PackageRelease{ - URL: String("url"), - HTMLURL: String("hurl"), - ID: Int64(1), - TagName: String("tn"), - TargetCommitish: String("tcs"), - Name: String("name"), - Draft: Bool(true), + URL: Ptr("url"), + HTMLURL: Ptr("hurl"), + ID: Ptr(int64(1)), + TagName: Ptr("tn"), + TargetCommitish: Ptr("tcs"), + Name: Ptr("name"), + Draft: Ptr(true), Author: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - Prerelease: Bool(true), + Prerelease: Ptr(true), CreatedAt: &Timestamp{referenceTime}, PublishedAt: &Timestamp{referenceTime}, }, - Manifest: String("mani"), - HTMLURL: String("hurl"), - TagName: String("tn"), - TargetCommitish: String("tcs"), - TargetOID: String("tid"), - Draft: Bool(true), - Prerelease: Bool(true), + Manifest: Ptr("mani"), + HTMLURL: Ptr("hurl"), + TagName: Ptr("tn"), + TargetCommitish: Ptr("tcs"), + TargetOID: Ptr("tid"), + Draft: Ptr(true), + Prerelease: Ptr(true), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, PackageFiles: []*PackageFile{ { - DownloadURL: String("durl"), - ID: Int64(1), - Name: String("name"), - SHA256: String("sha256"), - SHA1: String("sha1"), - MD5: String("md5"), - ContentType: String("ct"), - State: String("state"), + DownloadURL: Ptr("durl"), + ID: Ptr(int64(1)), + Name: Ptr("name"), + SHA256: Ptr("sha256"), + SHA1: Ptr("sha1"), + MD5: Ptr("md5"), + ContentType: Ptr("ct"), + State: Ptr("state"), Author: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - Size: Int64(1), + Size: Ptr(int64(1)), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, }, }, Author: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - InstallationCommand: String("ic"), + InstallationCommand: Ptr("ic"), }, Registry: &PackageRegistry{ - AboutURL: String("aurl"), - Name: String("name"), - Type: String("type"), - URL: String("url"), - Vendor: String("vendor"), + AboutURL: Ptr("aurl"), + Name: Ptr("name"), + Type: Ptr("type"), + URL: Ptr("url"), + Vendor: Ptr("vendor"), }, } diff --git a/github/projects_test.go b/github/projects_test.go index e69f8b6725d..f02e2a725a4 100644 --- a/github/projects_test.go +++ b/github/projects_test.go @@ -20,34 +20,34 @@ func TestProject_Marshal(t *testing.T) { testJSONMarshal(t, &Project{}, "{}") u := &Project{ - ID: Int64(1), - URL: String("u"), - HTMLURL: String("h"), - ColumnsURL: String("c"), - OwnerURL: String("o"), - Name: String("n"), - Body: String("b"), - Number: Int(1), - State: String("s"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + HTMLURL: Ptr("h"), + ColumnsURL: Ptr("c"), + OwnerURL: Ptr("o"), + Name: Ptr("n"), + Body: Ptr("b"), + Number: Ptr(1), + State: Ptr("s"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - NodeID: String("n"), + NodeID: Ptr("n"), Creator: &User{ - Login: String("l"), - ID: Int64(1), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, - URL: String("u"), + URL: Ptr("u"), }, } want := `{ @@ -89,12 +89,12 @@ func TestProjectsService_UpdateProject(t *testing.T) { client, mux, _ := setup(t) input := &ProjectOptions{ - Name: String("Project Name"), - Body: String("Project body."), - State: String("open"), - Private: Bool(false), + Name: Ptr("Project Name"), + Body: Ptr("Project body."), + State: Ptr("open"), + Private: Ptr(false), - OrganizationPermission: String("read"), + OrganizationPermission: Ptr("read"), } mux.HandleFunc("/projects/1", func(w http.ResponseWriter, r *http.Request) { @@ -116,7 +116,7 @@ func TestProjectsService_UpdateProject(t *testing.T) { t.Errorf("Projects.UpdateProject returned error: %v", err) } - want := &Project{ID: Int64(1)} + want := &Project{ID: Ptr(int64(1))} if !cmp.Equal(project, want) { t.Errorf("Projects.UpdateProject returned %+v, want %+v", project, want) } @@ -152,7 +152,7 @@ func TestProjectsService_GetProject(t *testing.T) { t.Errorf("Projects.GetProject returned error: %v", err) } - want := &Project{ID: Int64(1)} + want := &Project{ID: Ptr(int64(1))} if !cmp.Equal(project, want) { t.Errorf("Projects.GetProject returned %+v, want %+v", project, want) } @@ -216,7 +216,7 @@ func TestProjectsService_ListProjectColumns(t *testing.T) { t.Errorf("Projects.ListProjectColumns returned error: %v", err) } - want := []*ProjectColumn{{ID: Int64(1)}} + want := []*ProjectColumn{{ID: Ptr(int64(1))}} if !cmp.Equal(columns, want) { t.Errorf("Projects.ListProjectColumns returned %+v, want %+v", columns, want) } @@ -252,7 +252,7 @@ func TestProjectsService_GetProjectColumn(t *testing.T) { t.Errorf("Projects.GetProjectColumn returned error: %v", err) } - want := &ProjectColumn{ID: Int64(1)} + want := &ProjectColumn{ID: Ptr(int64(1))} if !cmp.Equal(column, want) { t.Errorf("Projects.GetProjectColumn returned %+v, want %+v", column, want) } @@ -297,7 +297,7 @@ func TestProjectsService_CreateProjectColumn(t *testing.T) { t.Errorf("Projects.CreateProjectColumn returned error: %v", err) } - want := &ProjectColumn{ID: Int64(1)} + want := &ProjectColumn{ID: Ptr(int64(1))} if !cmp.Equal(column, want) { t.Errorf("Projects.CreateProjectColumn returned %+v, want %+v", column, want) } @@ -342,7 +342,7 @@ func TestProjectsService_UpdateProjectColumn(t *testing.T) { t.Errorf("Projects.UpdateProjectColumn returned error: %v", err) } - want := &ProjectColumn{ID: Int64(1)} + want := &ProjectColumn{ID: Ptr(int64(1))} if !cmp.Equal(column, want) { t.Errorf("Projects.UpdateProjectColumn returned %+v, want %+v", column, want) } @@ -436,7 +436,7 @@ func TestProjectsService_ListProjectCards(t *testing.T) { }) opt := &ProjectCardListOptions{ - ArchivedState: String("all"), + ArchivedState: Ptr("all"), ListOptions: ListOptions{Page: 2}} ctx := context.Background() cards, _, err := client.Projects.ListProjectCards(ctx, 1, opt) @@ -444,7 +444,7 @@ func TestProjectsService_ListProjectCards(t *testing.T) { t.Errorf("Projects.ListProjectCards returned error: %v", err) } - want := []*ProjectCard{{ID: Int64(1)}} + want := []*ProjectCard{{ID: Ptr(int64(1))}} if !cmp.Equal(cards, want) { t.Errorf("Projects.ListProjectCards returned %+v, want %+v", cards, want) } @@ -480,7 +480,7 @@ func TestProjectsService_GetProjectCard(t *testing.T) { t.Errorf("Projects.GetProjectCard returned error: %v", err) } - want := &ProjectCard{ID: Int64(1)} + want := &ProjectCard{ID: Ptr(int64(1))} if !cmp.Equal(card, want) { t.Errorf("Projects.GetProjectCard returned %+v, want %+v", card, want) } @@ -528,7 +528,7 @@ func TestProjectsService_CreateProjectCard(t *testing.T) { t.Errorf("Projects.CreateProjectCard returned error: %v", err) } - want := &ProjectCard{ID: Int64(1)} + want := &ProjectCard{ID: Ptr(int64(1))} if !cmp.Equal(card, want) { t.Errorf("Projects.CreateProjectCard returned %+v, want %+v", card, want) } @@ -576,7 +576,7 @@ func TestProjectsService_UpdateProjectCard(t *testing.T) { t.Errorf("Projects.UpdateProjectCard returned error: %v", err) } - want := &ProjectCard{ID: Int64(1), Archived: Bool(false)} + want := &ProjectCard{ID: Ptr(int64(1)), Archived: Ptr(false)} if !cmp.Equal(card, want) { t.Errorf("Projects.UpdateProjectCard returned %+v, want %+v", card, want) } @@ -661,7 +661,7 @@ func TestProjectsService_AddProjectCollaborator(t *testing.T) { client, mux, _ := setup(t) opt := &ProjectCollaboratorOptions{ - Permission: String("admin"), + Permission: Ptr("admin"), } mux.HandleFunc("/projects/1/collaborators/u", func(w http.ResponseWriter, r *http.Request) { @@ -759,7 +759,7 @@ func TestProjectsService_ListCollaborators(t *testing.T) { t.Errorf("Projects.ListProjectCollaborators returned error: %v", err) } - want := []*User{{ID: Int64(1)}, {ID: Int64(2)}} + want := []*User{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}} if !cmp.Equal(users, want) { t.Errorf("Projects.ListProjectCollaborators returned %+v, want %+v", users, want) } @@ -792,7 +792,7 @@ func TestProjectsService_ListCollaborators_withAffiliation(t *testing.T) { opt := &ListCollaboratorOptions{ ListOptions: ListOptions{Page: 2}, - Affiliation: String("all"), + Affiliation: Ptr("all"), } ctx := context.Background() users, _, err := client.Projects.ListProjectCollaborators(ctx, 1, opt) @@ -800,7 +800,7 @@ func TestProjectsService_ListCollaborators_withAffiliation(t *testing.T) { t.Errorf("Projects.ListProjectCollaborators returned error: %v", err) } - want := []*User{{ID: Int64(1)}, {ID: Int64(2)}} + want := []*User{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}} if !cmp.Equal(users, want) { t.Errorf("Projects.ListProjectCollaborators returned %+v, want %+v", users, want) } @@ -823,9 +823,9 @@ func TestProjectsService_ReviewProjectCollaboratorPermission(t *testing.T) { } want := &ProjectPermissionLevel{ - Permission: String("admin"), + Permission: Ptr("admin"), User: &User{ - Login: String("u"), + Login: Ptr("u"), }, } @@ -853,11 +853,11 @@ func TestProjectOptions_Marshal(t *testing.T) { testJSONMarshal(t, &ProjectOptions{}, "{}") u := &ProjectOptions{ - Name: String("name"), - Body: String("body"), - State: String("state"), - OrganizationPermission: String("op"), - Private: Bool(false), + Name: Ptr("name"), + Body: Ptr("body"), + State: Ptr("state"), + OrganizationPermission: Ptr("op"), + Private: Ptr(false), } want := `{ @@ -876,14 +876,14 @@ func TestProjectColumn_Marshal(t *testing.T) { testJSONMarshal(t, &ProjectColumn{}, "{}") u := &ProjectColumn{ - ID: Int64(1), - Name: String("name"), - URL: String("url"), - ProjectURL: String("purl"), - CardsURL: String("curl"), + ID: Ptr(int64(1)), + Name: Ptr("name"), + URL: Ptr("url"), + ProjectURL: Ptr("purl"), + CardsURL: Ptr("curl"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - NodeID: String("onidp"), + NodeID: Ptr("onidp"), } want := `{ @@ -935,40 +935,40 @@ func TestProjectCard_Marshal(t *testing.T) { testJSONMarshal(t, &ProjectCard{}, "{}") u := &ProjectCard{ - URL: String("url"), - ColumnURL: String("curl"), - ContentURL: String("conurl"), - ID: Int64(1), - Note: String("note"), + URL: Ptr("url"), + ColumnURL: Ptr("curl"), + ContentURL: Ptr("conurl"), + ID: Ptr(int64(1)), + Note: Ptr("note"), Creator: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - NodeID: String("nid"), - Archived: Bool(true), - ColumnID: Int64(1), - ProjectID: Int64(1), - ProjectURL: String("purl"), - ColumnName: String("cn"), - PreviousColumnName: String("pcn"), + NodeID: Ptr("nid"), + Archived: Ptr(true), + ColumnID: Ptr(int64(1)), + ProjectID: Ptr(int64(1)), + ProjectURL: Ptr("purl"), + ColumnName: Ptr("cn"), + PreviousColumnName: Ptr("pcn"), } want := `{ @@ -1019,7 +1019,7 @@ func TestProjectCardOptions_Marshal(t *testing.T) { Note: "note", ContentID: 1, ContentType: "ct", - Archived: Bool(false), + Archived: Ptr(false), } want := `{ @@ -1054,7 +1054,7 @@ func TestProjectCollaboratorOptions_Marshal(t *testing.T) { testJSONMarshal(t, &ProjectCollaboratorOptions{}, "{}") u := &ProjectCollaboratorOptions{ - Permission: String("per"), + Permission: Ptr("per"), } want := `{ @@ -1069,24 +1069,24 @@ func TestProjectPermissionLevel_Marshal(t *testing.T) { testJSONMarshal(t, &ProjectPermissionLevel{}, "{}") u := &ProjectPermissionLevel{ - Permission: String("per"), + Permission: Ptr("per"), User: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, diff --git a/github/pulls_comments_test.go b/github/pulls_comments_test.go index 0df6f020a2c..3df530662d0 100644 --- a/github/pulls_comments_test.go +++ b/github/pulls_comments_test.go @@ -24,58 +24,58 @@ func TestPullComments_Marshal(t *testing.T) { createdAt := Timestamp{time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC)} updatedAt := Timestamp{time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC)} reactions := &Reactions{ - TotalCount: Int(1), - PlusOne: Int(1), - MinusOne: Int(0), - Laugh: Int(0), - Confused: Int(0), - Heart: Int(0), - Hooray: Int(0), - Rocket: Int(0), - Eyes: Int(0), - URL: String("u"), + TotalCount: Ptr(1), + PlusOne: Ptr(1), + MinusOne: Ptr(0), + Laugh: Ptr(0), + Confused: Ptr(0), + Heart: Ptr(0), + Hooray: Ptr(0), + Rocket: Ptr(0), + Eyes: Ptr(0), + URL: Ptr("u"), } u := &PullRequestComment{ - ID: Int64(10), - InReplyTo: Int64(8), - Body: String("Test comment"), - Path: String("file1.txt"), - DiffHunk: String("@@ -16,33 +16,40 @@ fmt.Println()"), - PullRequestReviewID: Int64(42), - Position: Int(1), - OriginalPosition: Int(4), - StartLine: Int(2), - Line: Int(3), - OriginalLine: Int(2), - OriginalStartLine: Int(2), - Side: String("RIGHT"), - StartSide: String("LEFT"), - CommitID: String("ab"), - OriginalCommitID: String("9c"), + ID: Ptr(int64(10)), + InReplyTo: Ptr(int64(8)), + Body: Ptr("Test comment"), + Path: Ptr("file1.txt"), + DiffHunk: Ptr("@@ -16,33 +16,40 @@ fmt.Println()"), + PullRequestReviewID: Ptr(int64(42)), + Position: Ptr(1), + OriginalPosition: Ptr(4), + StartLine: Ptr(2), + Line: Ptr(3), + OriginalLine: Ptr(2), + OriginalStartLine: Ptr(2), + Side: Ptr("RIGHT"), + StartSide: Ptr("LEFT"), + CommitID: Ptr("ab"), + OriginalCommitID: Ptr("9c"), User: &User{ - Login: String("ll"), - ID: Int64(123), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("ll"), + ID: Ptr(int64(123)), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, - URL: String("u"), + URL: Ptr("u"), }, Reactions: reactions, CreatedAt: &createdAt, UpdatedAt: &updatedAt, - URL: String("pullrequestcommentUrl"), - HTMLURL: String("pullrequestcommentHTMLUrl"), - PullRequestURL: String("pullrequestcommentPullRequestURL"), + URL: Ptr("pullrequestcommentUrl"), + HTMLURL: Ptr("pullrequestcommentHTMLUrl"), + PullRequestURL: Ptr("pullrequestcommentPullRequestURL"), } want := `{ @@ -163,7 +163,7 @@ func TestPullRequestsService_ListComments_allPulls(t *testing.T) { t.Errorf("PullRequests.ListComments returned error: %v", err) } - want := []*PullRequestComment{{ID: Int64(1)}} + want := []*PullRequestComment{{ID: Ptr(int64(1))}} if !cmp.Equal(pulls, want) { t.Errorf("PullRequests.ListComments returned %+v, want %+v", pulls, want) } @@ -200,7 +200,7 @@ func TestPullRequestsService_ListComments_specificPull(t *testing.T) { t.Errorf("PullRequests.ListComments returned error: %v", err) } - want := []*PullRequestComment{{ID: Int64(1), PullRequestReviewID: Int64(42)}} + want := []*PullRequestComment{{ID: Ptr(int64(1)), PullRequestReviewID: Ptr(int64(42))}} if !cmp.Equal(pulls, want) { t.Errorf("PullRequests.ListComments returned %+v, want %+v", pulls, want) } @@ -232,7 +232,7 @@ func TestPullRequestsService_GetComment(t *testing.T) { t.Errorf("PullRequests.GetComment returned error: %v", err) } - want := &PullRequestComment{ID: Int64(1)} + want := &PullRequestComment{ID: Ptr(int64(1))} if !cmp.Equal(comment, want) { t.Errorf("PullRequests.GetComment returned %+v, want %+v", comment, want) } @@ -265,7 +265,7 @@ func TestPullRequestsService_CreateComment(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &PullRequestComment{Body: String("b")} + input := &PullRequestComment{Body: Ptr("b")} wantAcceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeMultiLineCommentsPreview} mux.HandleFunc("/repos/o/r/pulls/1/comments", func(w http.ResponseWriter, r *http.Request) { @@ -288,7 +288,7 @@ func TestPullRequestsService_CreateComment(t *testing.T) { t.Errorf("PullRequests.CreateComment returned error: %v", err) } - want := &PullRequestComment{ID: Int64(1)} + want := &PullRequestComment{ID: Ptr(int64(1))} if !cmp.Equal(comment, want) { t.Errorf("PullRequests.CreateComment returned %+v, want %+v", comment, want) } @@ -321,7 +321,7 @@ func TestPullRequestsService_CreateCommentInReplyTo(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &PullRequestComment{Body: String("b")} + input := &PullRequestComment{Body: Ptr("b")} mux.HandleFunc("/repos/o/r/pulls/1/comments", func(w http.ResponseWriter, r *http.Request) { v := new(PullRequestComment) @@ -341,7 +341,7 @@ func TestPullRequestsService_CreateCommentInReplyTo(t *testing.T) { t.Errorf("PullRequests.CreateCommentInReplyTo returned error: %v", err) } - want := &PullRequestComment{ID: Int64(1)} + want := &PullRequestComment{ID: Ptr(int64(1))} if !cmp.Equal(comment, want) { t.Errorf("PullRequests.CreateCommentInReplyTo returned %+v, want %+v", comment, want) } @@ -365,7 +365,7 @@ func TestPullRequestsService_EditComment(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &PullRequestComment{Body: String("b")} + input := &PullRequestComment{Body: Ptr("b")} mux.HandleFunc("/repos/o/r/pulls/comments/1", func(w http.ResponseWriter, r *http.Request) { v := new(PullRequestComment) @@ -385,7 +385,7 @@ func TestPullRequestsService_EditComment(t *testing.T) { t.Errorf("PullRequests.EditComment returned error: %v", err) } - want := &PullRequestComment{ID: Int64(1)} + want := &PullRequestComment{ID: Ptr(int64(1))} if !cmp.Equal(comment, want) { t.Errorf("PullRequests.EditComment returned %+v, want %+v", comment, want) } diff --git a/github/pulls_reviewers_test.go b/github/pulls_reviewers_test.go index dfe7e6b7216..53b8d521beb 100644 --- a/github/pulls_reviewers_test.go +++ b/github/pulls_reviewers_test.go @@ -19,7 +19,7 @@ func TestReviewersRequest_Marshal(t *testing.T) { testJSONMarshal(t, &ReviewersRequest{}, "{}") u := &ReviewersRequest{ - NodeID: String("n"), + NodeID: Ptr("n"), Reviewers: []string{"r"}, TeamReviewers: []string{"t"}, } @@ -43,38 +43,38 @@ func TestReviewers_Marshal(t *testing.T) { u := &Reviewers{ Users: []*User{{ - Login: String("l"), - ID: Int64(1), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, - URL: String("u"), + URL: Ptr("u"), }}, Teams: []*Team{{ - ID: Int64(1), - NodeID: String("node"), - Name: String("n"), - Description: String("d"), - URL: String("u"), - Slug: String("s"), - Permission: String("p"), - Privacy: String("priv"), - MembersCount: Int(1), - ReposCount: Int(1), + ID: Ptr(int64(1)), + NodeID: Ptr("node"), + Name: Ptr("n"), + Description: Ptr("d"), + URL: Ptr("u"), + Slug: Ptr("s"), + Permission: Ptr("p"), + Privacy: Ptr("priv"), + MembersCount: Ptr(1), + ReposCount: Ptr(1), Organization: nil, - MembersURL: String("m"), - RepositoriesURL: String("r"), + MembersURL: Ptr("m"), + RepositoriesURL: Ptr("r"), Parent: nil, - LDAPDN: String("l"), + LDAPDN: Ptr("l"), }}, } @@ -136,7 +136,7 @@ func TestRequestReviewers(t *testing.T) { if err != nil { t.Errorf("PullRequests.RequestReviewers returned error: %v", err) } - want := &PullRequest{Number: Int(1)} + want := &PullRequest{Number: Ptr(1)} if !cmp.Equal(got, want) { t.Errorf("PullRequests.RequestReviewers returned %+v, want %+v", got, want) } @@ -211,14 +211,14 @@ func TestListReviewers(t *testing.T) { want := &Reviewers{ Users: []*User{ { - Login: String("octocat"), - ID: Int64(1), + Login: Ptr("octocat"), + ID: Ptr(int64(1)), }, }, Teams: []*Team{ { - ID: Int64(1), - Name: String("Justice League"), + ID: Ptr(int64(1)), + Name: Ptr("Justice League"), }, }, } diff --git a/github/pulls_reviews_test.go b/github/pulls_reviews_test.go index c7c5b62bec5..2417f765376 100644 --- a/github/pulls_reviews_test.go +++ b/github/pulls_reviews_test.go @@ -35,8 +35,8 @@ func TestPullRequestsService_ListReviews(t *testing.T) { } want := []*PullRequestReview{ - {ID: Int64(1)}, - {ID: Int64(2)}, + {ID: Ptr(int64(1))}, + {ID: Ptr(int64(2))}, } if !cmp.Equal(reviews, want) { t.Errorf("PullRequests.ListReviews returned %+v, want %+v", reviews, want) @@ -81,7 +81,7 @@ func TestPullRequestsService_GetReview(t *testing.T) { t.Errorf("PullRequests.GetReview returned error: %v", err) } - want := &PullRequestReview{ID: Int64(1)} + want := &PullRequestReview{ID: Ptr(int64(1))} if !cmp.Equal(review, want) { t.Errorf("PullRequests.GetReview returned %+v, want %+v", review, want) } @@ -125,7 +125,7 @@ func TestPullRequestsService_DeletePendingReview(t *testing.T) { t.Errorf("PullRequests.DeletePendingReview returned error: %v", err) } - want := &PullRequestReview{ID: Int64(1)} + want := &PullRequestReview{ID: Ptr(int64(1))} if !cmp.Equal(review, want) { t.Errorf("PullRequests.DeletePendingReview returned %+v, want %+v", review, want) } @@ -170,8 +170,8 @@ func TestPullRequestsService_ListReviewComments(t *testing.T) { } want := []*PullRequestComment{ - {ID: Int64(1)}, - {ID: Int64(2)}, + {ID: Ptr(int64(1))}, + {ID: Ptr(int64(2))}, } if !cmp.Equal(comments, want) { t.Errorf("PullRequests.ListReviewComments returned %+v, want %+v", comments, want) @@ -361,9 +361,9 @@ func TestPullRequestsService_CreateReview(t *testing.T) { client, mux, _ := setup(t) input := &PullRequestReviewRequest{ - CommitID: String("commit_id"), - Body: String("b"), - Event: String("APPROVE"), + CommitID: Ptr("commit_id"), + Body: Ptr("b"), + Event: Ptr("APPROVE"), } mux.HandleFunc("/repos/o/r/pulls/1/reviews", func(w http.ResponseWriter, r *http.Request) { @@ -384,7 +384,7 @@ func TestPullRequestsService_CreateReview(t *testing.T) { t.Errorf("PullRequests.CreateReview returned error: %v", err) } - want := &PullRequestReview{ID: Int64(1)} + want := &PullRequestReview{ID: Ptr(int64(1))} if !cmp.Equal(review, want) { t.Errorf("PullRequests.CreateReview returned %+v, want %+v", review, want) } @@ -504,7 +504,7 @@ func TestPullRequestsService_UpdateReview(t *testing.T) { t.Errorf("PullRequests.UpdateReview returned error: %v", err) } - want := &PullRequestReview{ID: Int64(1)} + want := &PullRequestReview{ID: Ptr(int64(1))} if !cmp.Equal(got, want) { t.Errorf("PullRequests.UpdateReview = %+v, want %+v", got, want) } @@ -529,8 +529,8 @@ func TestPullRequestsService_SubmitReview(t *testing.T) { client, mux, _ := setup(t) input := &PullRequestReviewRequest{ - Body: String("b"), - Event: String("APPROVE"), + Body: Ptr("b"), + Event: Ptr("APPROVE"), } mux.HandleFunc("/repos/o/r/pulls/1/reviews/1/events", func(w http.ResponseWriter, r *http.Request) { @@ -551,7 +551,7 @@ func TestPullRequestsService_SubmitReview(t *testing.T) { t.Errorf("PullRequests.SubmitReview returned error: %v", err) } - want := &PullRequestReview{ID: Int64(1)} + want := &PullRequestReview{ID: Ptr(int64(1))} if !cmp.Equal(review, want) { t.Errorf("PullRequests.SubmitReview returned %+v, want %+v", review, want) } @@ -584,7 +584,7 @@ func TestPullRequestsService_DismissReview(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &PullRequestReviewDismissalRequest{Message: String("m")} + input := &PullRequestReviewDismissalRequest{Message: Ptr("m")} mux.HandleFunc("/repos/o/r/pulls/1/reviews/1/dismissals", func(w http.ResponseWriter, r *http.Request) { v := new(PullRequestReviewDismissalRequest) @@ -604,7 +604,7 @@ func TestPullRequestsService_DismissReview(t *testing.T) { t.Errorf("PullRequests.DismissReview returned error: %v", err) } - want := &PullRequestReview{ID: Int64(1)} + want := &PullRequestReview{ID: Ptr(int64(1))} if !cmp.Equal(review, want) { t.Errorf("PullRequests.DismissReview returned %+v, want %+v", review, want) } @@ -638,7 +638,7 @@ func TestPullRequestReviewDismissalRequest_Marshal(t *testing.T) { testJSONMarshal(t, &PullRequestReviewDismissalRequest{}, "{}") u := &PullRequestReviewDismissalRequest{ - Message: String("msg"), + Message: Ptr("msg"), } want := `{ @@ -653,13 +653,13 @@ func TestDraftReviewComment_Marshal(t *testing.T) { testJSONMarshal(t, &DraftReviewComment{}, "{}") u := &DraftReviewComment{ - Path: String("path"), - Position: Int(1), - Body: String("body"), - StartSide: String("ss"), - Side: String("side"), - StartLine: Int(1), - Line: Int(1), + Path: Ptr("path"), + Position: Ptr(1), + Body: Ptr("body"), + StartSide: Ptr("ss"), + Side: Ptr("side"), + StartLine: Ptr(1), + Line: Ptr(1), } want := `{ @@ -680,19 +680,19 @@ func TestPullRequestReviewRequest_Marshal(t *testing.T) { testJSONMarshal(t, &PullRequestReviewRequest{}, "{}") u := &PullRequestReviewRequest{ - NodeID: String("nodeid"), - CommitID: String("cid"), - Body: String("body"), - Event: String("event"), + NodeID: Ptr("nodeid"), + CommitID: Ptr("cid"), + Body: Ptr("body"), + Event: Ptr("event"), Comments: []*DraftReviewComment{ { - Path: String("path"), - Position: Int(1), - Body: String("body"), - StartSide: String("ss"), - Side: String("side"), - StartLine: Int(1), - Line: Int(1), + Path: Ptr("path"), + Position: Ptr(1), + Body: Ptr("body"), + StartSide: Ptr("ss"), + Side: Ptr("side"), + StartLine: Ptr(1), + Line: Ptr(1), }, }, } @@ -723,35 +723,35 @@ func TestPullRequestReview_Marshal(t *testing.T) { testJSONMarshal(t, &PullRequestReview{}, "{}") u := &PullRequestReview{ - ID: Int64(1), - NodeID: String("nid"), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), User: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - Body: String("body"), + Body: Ptr("body"), SubmittedAt: &Timestamp{referenceTime}, - CommitID: String("cid"), - HTMLURL: String("hurl"), - PullRequestURL: String("prurl"), - State: String("state"), - AuthorAssociation: String("aa"), + CommitID: Ptr("cid"), + HTMLURL: Ptr("hurl"), + PullRequestURL: Ptr("prurl"), + State: Ptr("state"), + AuthorAssociation: Ptr("aa"), } want := `{ diff --git a/github/pulls_test.go b/github/pulls_test.go index b4e9e87d2af..4a48bdb08ae 100644 --- a/github/pulls_test.go +++ b/github/pulls_test.go @@ -41,7 +41,7 @@ func TestPullRequestsService_List(t *testing.T) { t.Errorf("PullRequests.List returned error: %v", err) } - want := []*PullRequest{{Number: Int(1)}} + want := []*PullRequest{{Number: Ptr(1)}} if !cmp.Equal(pulls, want) { t.Errorf("PullRequests.List returned %+v, want %+v", pulls, want) } @@ -81,7 +81,7 @@ func TestPullRequestsService_ListPullRequestsWithCommit(t *testing.T) { t.Errorf("PullRequests.ListPullRequestsWithCommit returned error: %v", err) } - want := []*PullRequest{{Number: Int(1)}} + want := []*PullRequest{{Number: Ptr(1)}} if !cmp.Equal(pulls, want) { t.Errorf("PullRequests.ListPullRequestsWithCommit returned %+v, want %+v", pulls, want) } @@ -125,7 +125,7 @@ func TestPullRequestsService_Get(t *testing.T) { t.Errorf("PullRequests.Get returned error: %v", err) } - want := &PullRequest{Number: Int(1)} + want := &PullRequest{Number: Ptr(1)} if !cmp.Equal(pull, want) { t.Errorf("PullRequests.Get returned %+v, want %+v", pull, want) } @@ -247,24 +247,24 @@ func TestPullRequestsService_Get_links(t *testing.T) { } want := &PullRequest{ - Number: Int(1), + Number: Ptr(1), Links: &PRLinks{ Self: &PRLink{ - HRef: String("https://api.github.com/repos/octocat/Hello-World/pulls/1347"), + HRef: Ptr("https://api.github.com/repos/octocat/Hello-World/pulls/1347"), }, HTML: &PRLink{ - HRef: String("https://github.com/octocat/Hello-World/pull/1347"), + HRef: Ptr("https://github.com/octocat/Hello-World/pull/1347"), }, Issue: &PRLink{ - HRef: String("https://api.github.com/repos/octocat/Hello-World/issues/1347"), + HRef: Ptr("https://api.github.com/repos/octocat/Hello-World/issues/1347"), }, Comments: &PRLink{ - HRef: String("https://api.github.com/repos/octocat/Hello-World/issues/1347/comments"), + HRef: Ptr("https://api.github.com/repos/octocat/Hello-World/issues/1347/comments"), }, ReviewComments: &PRLink{ - HRef: String("https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments"), + HRef: Ptr("https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments"), }, ReviewComment: &PRLink{ - HRef: String("https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}"), + HRef: Ptr("https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}"), }, Commits: &PRLink{ - HRef: String("https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits"), + HRef: Ptr("https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits"), }, Statuses: &PRLink{ - HRef: String("https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e"), + HRef: Ptr("https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e"), }, }, } @@ -289,14 +289,14 @@ func TestPullRequestsService_Get_headAndBase(t *testing.T) { } want := &PullRequest{ - Number: Int(1), + Number: Ptr(1), Head: &PullRequestBranch{ - Ref: String("r2"), - Repo: &Repository{ID: Int64(2)}, + Ref: Ptr("r2"), + Repo: &Repository{ID: Ptr(int64(2))}, }, Base: &PullRequestBranch{ - Ref: String("r1"), - Repo: &Repository{ID: Int64(1)}, + Ref: Ptr("r1"), + Repo: &Repository{ID: Ptr(int64(1))}, }, } if !cmp.Equal(pull, want) { @@ -328,15 +328,15 @@ func TestPullRequestsService_Get_urlFields(t *testing.T) { } want := &PullRequest{ - Number: Int(1), - URL: String("https://api.github.com/repos/octocat/Hello-World/pulls/1347"), - HTMLURL: String("https://github.com/octocat/Hello-World/pull/1347"), - IssueURL: String("https://api.github.com/repos/octocat/Hello-World/issues/1347"), - StatusesURL: String("https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e"), - DiffURL: String("https://github.com/octocat/Hello-World/pull/1347.diff"), - PatchURL: String("https://github.com/octocat/Hello-World/pull/1347.patch"), - ReviewCommentsURL: String("https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments"), - ReviewCommentURL: String("https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}"), + Number: Ptr(1), + URL: Ptr("https://api.github.com/repos/octocat/Hello-World/pulls/1347"), + HTMLURL: Ptr("https://github.com/octocat/Hello-World/pull/1347"), + IssueURL: Ptr("https://api.github.com/repos/octocat/Hello-World/issues/1347"), + StatusesURL: Ptr("https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e"), + DiffURL: Ptr("https://github.com/octocat/Hello-World/pull/1347.diff"), + PatchURL: Ptr("https://github.com/octocat/Hello-World/pull/1347.patch"), + ReviewCommentsURL: Ptr("https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments"), + ReviewCommentURL: Ptr("https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}"), } if !cmp.Equal(pull, want) { @@ -357,7 +357,7 @@ func TestPullRequestsService_Create(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &NewPullRequest{Title: String("t")} + input := &NewPullRequest{Title: Ptr("t")} mux.HandleFunc("/repos/o/r/pulls", func(w http.ResponseWriter, r *http.Request) { v := new(NewPullRequest) @@ -377,7 +377,7 @@ func TestPullRequestsService_Create(t *testing.T) { t.Errorf("PullRequests.Create returned error: %v", err) } - want := &PullRequest{Number: Int(1)} + want := &PullRequest{Number: Ptr(1)} if !cmp.Equal(pull, want) { t.Errorf("PullRequests.Create returned %+v, want %+v", pull, want) } @@ -421,7 +421,7 @@ func TestPullRequestsService_UpdateBranch(t *testing.T) { }) opts := &PullRequestBranchUpdateOptions{ - ExpectedHeadSHA: String("s"), + ExpectedHeadSHA: Ptr("s"), } ctx := context.Background() @@ -431,8 +431,8 @@ func TestPullRequestsService_UpdateBranch(t *testing.T) { } want := &PullRequestBranchUpdateResponse{ - Message: String("Updating pull request branch."), - URL: String("https://github.com/repos/o/r/pulls/1"), + Message: Ptr("Updating pull request branch."), + URL: Ptr("https://github.com/repos/o/r/pulls/1"), } if !cmp.Equal(pull, want) { @@ -466,19 +466,19 @@ func TestPullRequestsService_Edit(t *testing.T) { want *PullRequest }{ { - input: &PullRequest{Title: String("t")}, + input: &PullRequest{Title: Ptr("t")}, sendResponse: `{"number":1}`, wantUpdate: `{"title":"t"}`, - want: &PullRequest{Number: Int(1)}, + want: &PullRequest{Number: Ptr(1)}, }, { // base update - input: &PullRequest{Base: &PullRequestBranch{Ref: String("master")}}, + input: &PullRequest{Base: &PullRequestBranch{Ref: Ptr("master")}}, sendResponse: `{"number":1,"base":{"ref":"master"}}`, wantUpdate: `{"base":"master"}`, want: &PullRequest{ - Number: Int(1), - Base: &PullRequestBranch{Ref: String("master")}, + Number: Ptr(1), + Base: &PullRequestBranch{Ref: Ptr("master")}, }, }, } @@ -561,18 +561,18 @@ func TestPullRequestsService_ListCommits(t *testing.T) { want := []*RepositoryCommit{ { - SHA: String("3"), + SHA: Ptr("3"), Parents: []*Commit{ { - SHA: String("2"), + SHA: Ptr("2"), }, }, }, { - SHA: String("2"), + SHA: Ptr("2"), Parents: []*Commit{ { - SHA: String("1"), + SHA: Ptr("1"), }, }, }, @@ -635,22 +635,22 @@ func TestPullRequestsService_ListFiles(t *testing.T) { want := []*CommitFile{ { - SHA: String("6dcb09b5b57875f334f61aebed695e2e4193db5e"), - Filename: String("file1.txt"), - Additions: Int(103), - Deletions: Int(21), - Changes: Int(124), - Status: String("added"), - Patch: String("@@ -132,7 +132,7 @@ module Test @@ -1000,7 +1000,7 @@ module Test"), + SHA: Ptr("6dcb09b5b57875f334f61aebed695e2e4193db5e"), + Filename: Ptr("file1.txt"), + Additions: Ptr(103), + Deletions: Ptr(21), + Changes: Ptr(124), + Status: Ptr("added"), + Patch: Ptr("@@ -132,7 +132,7 @@ module Test @@ -1000,7 +1000,7 @@ module Test"), }, { - SHA: String("f61aebed695e2e4193db5e6dcb09b5b57875f334"), - Filename: String("file2.txt"), - Additions: Int(5), - Deletions: Int(3), - Changes: Int(103), - Status: String("modified"), - Patch: String("@@ -132,7 +132,7 @@ module Test @@ -1000,7 +1000,7 @@ module Test"), + SHA: Ptr("f61aebed695e2e4193db5e6dcb09b5b57875f334"), + Filename: Ptr("file2.txt"), + Additions: Ptr(5), + Deletions: Ptr(3), + Changes: Ptr(103), + Status: Ptr("modified"), + Patch: Ptr("@@ -132,7 +132,7 @@ module Test @@ -1000,7 +1000,7 @@ module Test"), }, } @@ -730,9 +730,9 @@ func TestPullRequestsService_Merge(t *testing.T) { } want := &PullRequestMergeResult{ - SHA: String("6dcb09b5b57875f334f61aebed695e2e4193db5e"), - Merged: Bool(true), - Message: String("Pull Request successfully merged"), + SHA: Ptr("6dcb09b5b57875f334f61aebed695e2e4193db5e"), + Merged: Ptr(true), + Message: Ptr("Pull Request successfully merged"), } if !cmp.Equal(merge, want) { t.Errorf("PullRequests.Merge returned %+v, want %+v", merge, want) @@ -844,7 +844,7 @@ func TestPullRequestMergeRequest_Marshal(t *testing.T) { testJSONMarshal(t, &pullRequestMergeRequest{}, "{}") u := &pullRequestMergeRequest{ - CommitMessage: String("cm"), + CommitMessage: Ptr("cm"), CommitTitle: "ct", MergeMethod: "mm", SHA: "sha", @@ -865,9 +865,9 @@ func TestPullRequestMergeResult_Marshal(t *testing.T) { testJSONMarshal(t, &PullRequestMergeResult{}, "{}") u := &PullRequestMergeResult{ - SHA: String("sha"), - Merged: Bool(false), - Message: String("msg"), + SHA: Ptr("sha"), + Merged: Ptr(false), + Message: Ptr("msg"), } want := `{ @@ -884,11 +884,11 @@ func TestPullRequestUpdate_Marshal(t *testing.T) { testJSONMarshal(t, &pullRequestUpdate{}, "{}") u := &pullRequestUpdate{ - Title: String("title"), - Body: String("body"), - State: String("state"), - Base: String("base"), - MaintainerCanModify: Bool(false), + Title: Ptr("title"), + Body: Ptr("body"), + State: Ptr("state"), + Base: Ptr("base"), + MaintainerCanModify: Ptr(false), } want := `{ @@ -907,8 +907,8 @@ func TestPullRequestBranchUpdateResponse_Marshal(t *testing.T) { testJSONMarshal(t, &PullRequestBranchUpdateResponse{}, "{}") u := &PullRequestBranchUpdateResponse{ - Message: String("message"), - URL: String("url"), + Message: Ptr("message"), + URL: Ptr("url"), } want := `{ @@ -924,7 +924,7 @@ func TestPullRequestBranchUpdateOptions_Marshal(t *testing.T) { testJSONMarshal(t, &PullRequestBranchUpdateOptions{}, "{}") u := &PullRequestBranchUpdateOptions{ - ExpectedHeadSHA: String("eh"), + ExpectedHeadSHA: Ptr("eh"), } want := `{ @@ -939,14 +939,14 @@ func TestNewPullRequest_Marshal(t *testing.T) { testJSONMarshal(t, &NewPullRequest{}, "{}") u := &NewPullRequest{ - Title: String("eh"), - Head: String("eh"), - HeadRepo: String("eh"), - Base: String("eh"), - Body: String("eh"), - Issue: Int(1), - MaintainerCanModify: Bool(false), - Draft: Bool(false), + Title: Ptr("eh"), + Head: Ptr("eh"), + HeadRepo: Ptr("eh"), + Base: Ptr("eh"), + Body: Ptr("eh"), + Issue: Ptr(1), + MaintainerCanModify: Ptr(false), + Draft: Ptr(false), } want := `{ @@ -968,27 +968,27 @@ func TestPullRequestBranch_Marshal(t *testing.T) { testJSONMarshal(t, &PullRequestBranch{}, "{}") u := &PullRequestBranch{ - Label: String("label"), - Ref: String("ref"), - SHA: String("sha"), - Repo: &Repository{ID: Int64(1)}, + Label: Ptr("label"), + Ref: Ptr("ref"), + SHA: Ptr("sha"), + Repo: &Repository{ID: Ptr(int64(1))}, User: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -1031,7 +1031,7 @@ func TestPRLink_Marshal(t *testing.T) { testJSONMarshal(t, &PRLink{}, "{}") u := &PRLink{ - HRef: String("href"), + HRef: Ptr("href"), } want := `{ @@ -1047,28 +1047,28 @@ func TestPRLinks_Marshal(t *testing.T) { u := &PRLinks{ Self: &PRLink{ - HRef: String("href"), + HRef: Ptr("href"), }, HTML: &PRLink{ - HRef: String("href"), + HRef: Ptr("href"), }, Issue: &PRLink{ - HRef: String("href"), + HRef: Ptr("href"), }, Comments: &PRLink{ - HRef: String("href"), + HRef: Ptr("href"), }, ReviewComments: &PRLink{ - HRef: String("href"), + HRef: Ptr("href"), }, ReviewComment: &PRLink{ - HRef: String("href"), + HRef: Ptr("href"), }, Commits: &PRLink{ - HRef: String("href"), + HRef: Ptr("href"), }, Statuses: &PRLink{ - HRef: String("href"), + HRef: Ptr("href"), }, } @@ -1108,28 +1108,28 @@ func TestPullRequestAutoMerge_Marshal(t *testing.T) { u := &PullRequestAutoMerge{ EnabledBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - MergeMethod: String("mm"), - CommitTitle: String("ct"), - CommitMessage: String("cm"), + MergeMethod: Ptr("mm"), + CommitTitle: Ptr("ct"), + CommitMessage: Ptr("cm"), } want := `{ @@ -1166,208 +1166,208 @@ func TestPullRequest_Marshal(t *testing.T) { testJSONMarshal(t, &PullRequest{}, "{}") u := &PullRequest{ - ID: Int64(1), - Number: Int(1), - State: String("state"), - Locked: Bool(false), - Title: String("title"), - Body: String("body"), + ID: Ptr(int64(1)), + Number: Ptr(1), + State: Ptr("state"), + Locked: Ptr(false), + Title: Ptr("title"), + Body: Ptr("body"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, ClosedAt: &Timestamp{referenceTime}, MergedAt: &Timestamp{referenceTime}, - Labels: []*Label{{ID: Int64(1)}}, + Labels: []*Label{{ID: Ptr(int64(1))}}, User: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - Draft: Bool(false), - Merged: Bool(false), - Mergeable: Bool(false), - MergeableState: String("ms"), + Draft: Ptr(false), + Merged: Ptr(false), + Mergeable: Ptr(false), + MergeableState: Ptr("ms"), MergedBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - MergeCommitSHA: String("mcs"), - Rebaseable: Bool(false), - Comments: Int(1), - Commits: Int(1), - Additions: Int(1), - Deletions: Int(1), - ChangedFiles: Int(1), - URL: String("url"), - HTMLURL: String("hurl"), - IssueURL: String("iurl"), - StatusesURL: String("surl"), - DiffURL: String("durl"), - PatchURL: String("purl"), - CommitsURL: String("curl"), - CommentsURL: String("comurl"), - ReviewCommentsURL: String("rcurls"), - ReviewCommentURL: String("rcurl"), - ReviewComments: Int(1), + MergeCommitSHA: Ptr("mcs"), + Rebaseable: Ptr(false), + Comments: Ptr(1), + Commits: Ptr(1), + Additions: Ptr(1), + Deletions: Ptr(1), + ChangedFiles: Ptr(1), + URL: Ptr("url"), + HTMLURL: Ptr("hurl"), + IssueURL: Ptr("iurl"), + StatusesURL: Ptr("surl"), + DiffURL: Ptr("durl"), + PatchURL: Ptr("purl"), + CommitsURL: Ptr("curl"), + CommentsURL: Ptr("comurl"), + ReviewCommentsURL: Ptr("rcurls"), + ReviewCommentURL: Ptr("rcurl"), + ReviewComments: Ptr(1), Assignee: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, Assignees: []*User{ { - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, }, - Milestone: &Milestone{ID: Int64(1)}, - MaintainerCanModify: Bool(true), - AuthorAssociation: String("aa"), - NodeID: String("nid"), + Milestone: &Milestone{ID: Ptr(int64(1))}, + MaintainerCanModify: Ptr(true), + AuthorAssociation: Ptr("aa"), + NodeID: Ptr("nid"), RequestedReviewers: []*User{ { - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, }, AutoMerge: &PullRequestAutoMerge{ EnabledBy: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - MergeMethod: String("mm"), - CommitTitle: String("ct"), - CommitMessage: String("cm"), + MergeMethod: Ptr("mm"), + CommitTitle: Ptr("ct"), + CommitMessage: Ptr("cm"), }, - RequestedTeams: []*Team{{ID: Int64(1)}}, + RequestedTeams: []*Team{{ID: Ptr(int64(1))}}, Links: &PRLinks{ Self: &PRLink{ - HRef: String("href"), + HRef: Ptr("href"), }, HTML: &PRLink{ - HRef: String("href"), + HRef: Ptr("href"), }, Issue: &PRLink{ - HRef: String("href"), + HRef: Ptr("href"), }, Comments: &PRLink{ - HRef: String("href"), + HRef: Ptr("href"), }, ReviewComments: &PRLink{ - HRef: String("href"), + HRef: Ptr("href"), }, ReviewComment: &PRLink{ - HRef: String("href"), + HRef: Ptr("href"), }, Commits: &PRLink{ - HRef: String("href"), + HRef: Ptr("href"), }, Statuses: &PRLink{ - HRef: String("href"), + HRef: Ptr("href"), }, }, Head: &PullRequestBranch{ - Ref: String("r2"), - Repo: &Repository{ID: Int64(2)}, + Ref: Ptr("r2"), + Repo: &Repository{ID: Ptr(int64(2))}, }, Base: &PullRequestBranch{ - Ref: String("r2"), - Repo: &Repository{ID: Int64(2)}, + Ref: Ptr("r2"), + Repo: &Repository{ID: Ptr(int64(2))}, }, - ActiveLockReason: String("alr"), + ActiveLockReason: Ptr("alr"), } want := `{ diff --git a/github/pulls_threads_test.go b/github/pulls_threads_test.go index 25882a31c31..ea81e358d2a 100644 --- a/github/pulls_threads_test.go +++ b/github/pulls_threads_test.go @@ -17,63 +17,63 @@ func TestPullRequestThread_Marshal(t *testing.T) { createdAt := Timestamp{time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC)} updatedAt := Timestamp{time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC)} reactions := &Reactions{ - TotalCount: Int(1), - PlusOne: Int(1), - MinusOne: Int(0), - Laugh: Int(0), - Confused: Int(0), - Heart: Int(0), - Hooray: Int(0), - Rocket: Int(0), - Eyes: Int(0), - URL: String("u"), + TotalCount: Ptr(1), + PlusOne: Ptr(1), + MinusOne: Ptr(0), + Laugh: Ptr(0), + Confused: Ptr(0), + Heart: Ptr(0), + Hooray: Ptr(0), + Rocket: Ptr(0), + Eyes: Ptr(0), + URL: Ptr("u"), } user := &User{ - Login: String("ll"), - ID: Int64(123), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("ll"), + ID: Ptr(int64(123)), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, - URL: String("u"), + URL: Ptr("u"), } comment := &PullRequestComment{ - ID: Int64(10), - InReplyTo: Int64(8), - Body: String("Test comment"), - Path: String("file1.txt"), - DiffHunk: String("@@ -16,33 +16,40 @@ fmt.Println()"), - PullRequestReviewID: Int64(42), - Position: Int(1), - OriginalPosition: Int(4), - StartLine: Int(2), - Line: Int(3), - OriginalLine: Int(2), - OriginalStartLine: Int(2), - Side: String("RIGHT"), - StartSide: String("LEFT"), - CommitID: String("ab"), - OriginalCommitID: String("9c"), + ID: Ptr(int64(10)), + InReplyTo: Ptr(int64(8)), + Body: Ptr("Test comment"), + Path: Ptr("file1.txt"), + DiffHunk: Ptr("@@ -16,33 +16,40 @@ fmt.Println()"), + PullRequestReviewID: Ptr(int64(42)), + Position: Ptr(1), + OriginalPosition: Ptr(4), + StartLine: Ptr(2), + Line: Ptr(3), + OriginalLine: Ptr(2), + OriginalStartLine: Ptr(2), + Side: Ptr("RIGHT"), + StartSide: Ptr("LEFT"), + CommitID: Ptr("ab"), + OriginalCommitID: Ptr("9c"), User: user, Reactions: reactions, CreatedAt: &createdAt, UpdatedAt: &updatedAt, - URL: String("pullrequestcommentUrl"), - HTMLURL: String("pullrequestcommentHTMLUrl"), - PullRequestURL: String("pullrequestcommentPullRequestURL"), + URL: Ptr("pullrequestcommentUrl"), + HTMLURL: Ptr("pullrequestcommentHTMLUrl"), + PullRequestURL: Ptr("pullrequestcommentPullRequestURL"), } u := &PullRequestThread{ - ID: Int64(1), - NodeID: String("nid"), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), Comments: []*PullRequestComment{comment, comment}, } diff --git a/github/reactions.go b/github/reactions.go index 1aa7ac38f2a..9f9f72faeed 100644 --- a/github/reactions.go +++ b/github/reactions.go @@ -98,7 +98,7 @@ func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo func (s *ReactionsService) CreateCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) - body := &Reaction{Content: String(content)} + body := &Reaction{Content: Ptr(content)} req, err := s.client.NewRequest("POST", u, body) if err != nil { return nil, nil, err @@ -178,7 +178,7 @@ func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo s func (s *ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo string, number int, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) - body := &Reaction{Content: String(content)} + body := &Reaction{Content: Ptr(content)} req, err := s.client.NewRequest("POST", u, body) if err != nil { return nil, nil, err @@ -258,7 +258,7 @@ func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, func (s *ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) - body := &Reaction{Content: String(content)} + body := &Reaction{Content: Ptr(content)} req, err := s.client.NewRequest("POST", u, body) if err != nil { return nil, nil, err @@ -338,7 +338,7 @@ func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, func (s *ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) - body := &Reaction{Content: String(content)} + body := &Reaction{Content: Ptr(content)} req, err := s.client.NewRequest("POST", u, body) if err != nil { return nil, nil, err @@ -415,7 +415,7 @@ func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, team func (s *ReactionsService) CreateTeamDiscussionReaction(ctx context.Context, teamID int64, discussionNumber int, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) - body := &Reaction{Content: String(content)} + body := &Reaction{Content: Ptr(content)} req, err := s.client.NewRequest("POST", u, body) if err != nil { return nil, nil, err @@ -490,7 +490,7 @@ func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Contex func (s *ReactionsService) CreateTeamDiscussionCommentReaction(ctx context.Context, teamID int64, discussionNumber, commentNumber int, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) - body := &Reaction{Content: String(content)} + body := &Reaction{Content: Ptr(content)} req, err := s.client.NewRequest("POST", u, body) if err != nil { return nil, nil, err @@ -552,7 +552,7 @@ func (s *ReactionsService) deleteReaction(ctx context.Context, url string) (*Res func (s *ReactionsService) CreateReleaseReaction(ctx context.Context, owner, repo string, releaseID int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/releases/%v/reactions", owner, repo, releaseID) - body := &Reaction{Content: String(content)} + body := &Reaction{Content: Ptr(content)} req, err := s.client.NewRequest("POST", u, body) if err != nil { return nil, nil, err diff --git a/github/reactions_test.go b/github/reactions_test.go index 246588674de..5758a705f05 100644 --- a/github/reactions_test.go +++ b/github/reactions_test.go @@ -19,10 +19,10 @@ func TestReaction_Marshal(t *testing.T) { testJSONMarshal(t, &Reaction{}, "{}") r := &Reaction{ - ID: Int64(1), + ID: Ptr(int64(1)), User: nil, - NodeID: String("n"), - Content: String("+1"), + NodeID: Ptr("n"), + Content: Ptr("+1"), } want := `{ @@ -39,16 +39,16 @@ func TestReactions_Marshal(t *testing.T) { testJSONMarshal(t, &Reactions{}, "{}") r := &Reactions{ - TotalCount: Int(1), - PlusOne: Int(1), - MinusOne: Int(1), - Laugh: Int(1), - Confused: Int(1), - Heart: Int(1), - Hooray: Int(1), - Rocket: Int(1), - Eyes: Int(1), - URL: String("u"), + TotalCount: Ptr(1), + PlusOne: Ptr(1), + MinusOne: Ptr(1), + Laugh: Ptr(1), + Confused: Ptr(1), + Heart: Ptr(1), + Hooray: Ptr(1), + Rocket: Ptr(1), + Eyes: Ptr(1), + URL: Ptr("u"), } want := `{ @@ -85,7 +85,7 @@ func TestReactionsService_ListCommentReactions(t *testing.T) { if err != nil { t.Errorf("ListCommentReactions returned error: %v", err) } - want := []*Reaction{{ID: Int64(1), User: &User{Login: String("l"), ID: Int64(2)}, Content: String("+1")}} + want := []*Reaction{{ID: Ptr(int64(1)), User: &User{Login: Ptr("l"), ID: Ptr(int64(2))}, Content: Ptr("+1")}} if !cmp.Equal(reactions, want) { t.Errorf("ListCommentReactions = %+v, want %+v", reactions, want) } @@ -122,7 +122,7 @@ func TestReactionsService_CreateCommentReaction(t *testing.T) { if err != nil { t.Errorf("CreateCommentReaction returned error: %v", err) } - want := &Reaction{ID: Int64(1), User: &User{Login: String("l"), ID: Int64(2)}, Content: String("+1")} + want := &Reaction{ID: Ptr(int64(1)), User: &User{Login: Ptr("l"), ID: Ptr(int64(2))}, Content: Ptr("+1")} if !cmp.Equal(got, want) { t.Errorf("CreateCommentReaction = %+v, want %+v", got, want) } @@ -159,7 +159,7 @@ func TestReactionsService_ListIssueReactions(t *testing.T) { if err != nil { t.Errorf("ListIssueReactions returned error: %v", err) } - want := []*Reaction{{ID: Int64(1), User: &User{Login: String("l"), ID: Int64(2)}, Content: String("+1")}} + want := []*Reaction{{ID: Ptr(int64(1)), User: &User{Login: Ptr("l"), ID: Ptr(int64(2))}, Content: Ptr("+1")}} if !cmp.Equal(got, want) { t.Errorf("ListIssueReactions = %+v, want %+v", got, want) } @@ -203,7 +203,7 @@ func TestReactionsService_CreateIssueReaction(t *testing.T) { if err != nil { t.Errorf("CreateIssueReaction returned error: %v", err) } - want := &Reaction{ID: Int64(1), User: &User{Login: String("l"), ID: Int64(2)}, Content: String("+1")} + want := &Reaction{ID: Ptr(int64(1)), User: &User{Login: Ptr("l"), ID: Ptr(int64(2))}, Content: Ptr("+1")} if !cmp.Equal(got, want) { t.Errorf("CreateIssueReaction = %+v, want %+v", got, want) } @@ -240,7 +240,7 @@ func TestReactionsService_ListIssueCommentReactions(t *testing.T) { if err != nil { t.Errorf("ListIssueCommentReactions returned error: %v", err) } - want := []*Reaction{{ID: Int64(1), User: &User{Login: String("l"), ID: Int64(2)}, Content: String("+1")}} + want := []*Reaction{{ID: Ptr(int64(1)), User: &User{Login: Ptr("l"), ID: Ptr(int64(2))}, Content: Ptr("+1")}} if !cmp.Equal(got, want) { t.Errorf("ListIssueCommentReactions = %+v, want %+v", got, want) } @@ -284,7 +284,7 @@ func TestReactionsService_CreateIssueCommentReaction(t *testing.T) { if err != nil { t.Errorf("CreateIssueCommentReaction returned error: %v", err) } - want := &Reaction{ID: Int64(1), User: &User{Login: String("l"), ID: Int64(2)}, Content: String("+1")} + want := &Reaction{ID: Ptr(int64(1)), User: &User{Login: Ptr("l"), ID: Ptr(int64(2))}, Content: Ptr("+1")} if !cmp.Equal(got, want) { t.Errorf("CreateIssueCommentReaction = %+v, want %+v", got, want) } @@ -321,7 +321,7 @@ func TestReactionsService_ListPullRequestCommentReactions(t *testing.T) { if err != nil { t.Errorf("ListPullRequestCommentReactions returned error: %v", err) } - want := []*Reaction{{ID: Int64(1), User: &User{Login: String("l"), ID: Int64(2)}, Content: String("+1")}} + want := []*Reaction{{ID: Ptr(int64(1)), User: &User{Login: Ptr("l"), ID: Ptr(int64(2))}, Content: Ptr("+1")}} if !cmp.Equal(got, want) { t.Errorf("ListPullRequestCommentReactions = %+v, want %+v", got, want) } @@ -365,7 +365,7 @@ func TestReactionsService_CreatePullRequestCommentReaction(t *testing.T) { if err != nil { t.Errorf("CreatePullRequestCommentReaction returned error: %v", err) } - want := &Reaction{ID: Int64(1), User: &User{Login: String("l"), ID: Int64(2)}, Content: String("+1")} + want := &Reaction{ID: Ptr(int64(1)), User: &User{Login: Ptr("l"), ID: Ptr(int64(2))}, Content: Ptr("+1")} if !cmp.Equal(got, want) { t.Errorf("CreatePullRequestCommentReaction = %+v, want %+v", got, want) } @@ -402,7 +402,7 @@ func TestReactionsService_ListTeamDiscussionReactions(t *testing.T) { if err != nil { t.Errorf("ListTeamDiscussionReactions returned error: %v", err) } - want := []*Reaction{{ID: Int64(1), User: &User{Login: String("l"), ID: Int64(2)}, Content: String("+1")}} + want := []*Reaction{{ID: Ptr(int64(1)), User: &User{Login: Ptr("l"), ID: Ptr(int64(2))}, Content: Ptr("+1")}} if !cmp.Equal(got, want) { t.Errorf("ListTeamDiscussionReactions = %+v, want %+v", got, want) } @@ -446,7 +446,7 @@ func TestReactionsService_CreateTeamDiscussionReaction(t *testing.T) { if err != nil { t.Errorf("CreateTeamDiscussionReaction returned error: %v", err) } - want := &Reaction{ID: Int64(1), User: &User{Login: String("l"), ID: Int64(2)}, Content: String("+1")} + want := &Reaction{ID: Ptr(int64(1)), User: &User{Login: Ptr("l"), ID: Ptr(int64(2))}, Content: Ptr("+1")} if !cmp.Equal(got, want) { t.Errorf("CreateTeamDiscussionReaction = %+v, want %+v", got, want) } @@ -483,7 +483,7 @@ func TestReactionService_ListTeamDiscussionCommentReactions(t *testing.T) { if err != nil { t.Errorf("ListTeamDiscussionCommentReactions returned error: %v", err) } - want := []*Reaction{{ID: Int64(1), User: &User{Login: String("l"), ID: Int64(2)}, Content: String("+1")}} + want := []*Reaction{{ID: Ptr(int64(1)), User: &User{Login: Ptr("l"), ID: Ptr(int64(2))}, Content: Ptr("+1")}} if !cmp.Equal(got, want) { t.Errorf("ListTeamDiscussionCommentReactions = %+v, want %+v", got, want) } @@ -527,7 +527,7 @@ func TestReactionService_CreateTeamDiscussionCommentReaction(t *testing.T) { if err != nil { t.Errorf("CreateTeamDiscussionCommentReaction returned error: %v", err) } - want := &Reaction{ID: Int64(1), User: &User{Login: String("l"), ID: Int64(2)}, Content: String("+1")} + want := &Reaction{ID: Ptr(int64(1)), User: &User{Login: Ptr("l"), ID: Ptr(int64(2))}, Content: Ptr("+1")} if !cmp.Equal(got, want) { t.Errorf("CreateTeamDiscussionCommentReaction = %+v, want %+v", got, want) } @@ -890,7 +890,7 @@ func TestReactionService_CreateReleaseReaction(t *testing.T) { t.Errorf("%v returned error: %v", methodName, err) } - want := &Reaction{ID: Int64(1), User: &User{Login: String("l"), ID: Int64(2)}, Content: String("rocket")} + want := &Reaction{ID: Ptr(int64(1)), User: &User{Login: Ptr("l"), ID: Ptr(int64(2))}, Content: Ptr("rocket")} if !cmp.Equal(got, want) { t.Errorf("%v = %+v, want %+v", methodName, got, want) } diff --git a/github/repos_actions_access_test.go b/github/repos_actions_access_test.go index 9d30f78b84b..c7550dd28ba 100644 --- a/github/repos_actions_access_test.go +++ b/github/repos_actions_access_test.go @@ -29,7 +29,7 @@ func TestRepositoriesService_GetActionsAccessLevel(t *testing.T) { if err != nil { t.Errorf("Repositories.GetActionsAccessLevel returned error: %v", err) } - want := &RepositoryActionsAccessLevel{AccessLevel: String("none")} + want := &RepositoryActionsAccessLevel{AccessLevel: Ptr("none")} if !cmp.Equal(org, want) { t.Errorf("Repositories.GetActionsAccessLevel returned %+v, want %+v", org, want) } @@ -53,7 +53,7 @@ func TestRepositoriesService_EditActionsAccessLevel(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &RepositoryActionsAccessLevel{AccessLevel: String("organization")} + input := &RepositoryActionsAccessLevel{AccessLevel: Ptr("organization")} mux.HandleFunc("/repos/o/r/actions/permissions/access", func(w http.ResponseWriter, r *http.Request) { v := new(RepositoryActionsAccessLevel) @@ -88,7 +88,7 @@ func TestRepositoryActionsAccessLevel_Marshal(t *testing.T) { testJSONMarshal(t, &ActionsPermissions{}, "{}") u := &RepositoryActionsAccessLevel{ - AccessLevel: String("enterprise"), + AccessLevel: Ptr("enterprise"), } want := `{ diff --git a/github/repos_actions_allowed_test.go b/github/repos_actions_allowed_test.go index f9d22797116..9a86b2282d2 100644 --- a/github/repos_actions_allowed_test.go +++ b/github/repos_actions_allowed_test.go @@ -29,7 +29,7 @@ func TestRepositoryService_GetActionsAllowed(t *testing.T) { if err != nil { t.Errorf("Repositories.GetActionsAllowed returned error: %v", err) } - want := &ActionsAllowed{GithubOwnedAllowed: Bool(true), VerifiedAllowed: Bool(false), PatternsAllowed: []string{"a/b"}} + want := &ActionsAllowed{GithubOwnedAllowed: Ptr(true), VerifiedAllowed: Ptr(false), PatternsAllowed: []string{"a/b"}} if !cmp.Equal(org, want) { t.Errorf("Repositories.GetActionsAllowed returned %+v, want %+v", org, want) } @@ -53,7 +53,7 @@ func TestRepositoriesService_EditActionsAllowed(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &ActionsAllowed{GithubOwnedAllowed: Bool(true), VerifiedAllowed: Bool(false), PatternsAllowed: []string{"a/b"}} + input := &ActionsAllowed{GithubOwnedAllowed: Ptr(true), VerifiedAllowed: Ptr(false), PatternsAllowed: []string{"a/b"}} mux.HandleFunc("/repos/o/r/actions/permissions/selected-actions", func(w http.ResponseWriter, r *http.Request) { v := new(ActionsAllowed) @@ -73,7 +73,7 @@ func TestRepositoriesService_EditActionsAllowed(t *testing.T) { t.Errorf("Repositories.EditActionsAllowed returned error: %v", err) } - want := &ActionsAllowed{GithubOwnedAllowed: Bool(true), VerifiedAllowed: Bool(false), PatternsAllowed: []string{"a/b"}} + want := &ActionsAllowed{GithubOwnedAllowed: Ptr(true), VerifiedAllowed: Ptr(false), PatternsAllowed: []string{"a/b"}} if !cmp.Equal(org, want) { t.Errorf("Repositories.EditActionsAllowed returned %+v, want %+v", org, want) } diff --git a/github/repos_actions_permissions_test.go b/github/repos_actions_permissions_test.go index 9e10928292a..be0c7883f44 100644 --- a/github/repos_actions_permissions_test.go +++ b/github/repos_actions_permissions_test.go @@ -29,7 +29,7 @@ func TestRepositoriesService_GetActionsPermissions(t *testing.T) { if err != nil { t.Errorf("Repositories.GetActionsPermissions returned error: %v", err) } - want := &ActionsPermissionsRepository{Enabled: Bool(true), AllowedActions: String("all")} + want := &ActionsPermissionsRepository{Enabled: Ptr(true), AllowedActions: Ptr("all")} if !cmp.Equal(org, want) { t.Errorf("Repositories.GetActionsPermissions returned %+v, want %+v", org, want) } @@ -53,7 +53,7 @@ func TestRepositoriesService_EditActionsPermissions(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &ActionsPermissionsRepository{Enabled: Bool(true), AllowedActions: String("selected")} + input := &ActionsPermissionsRepository{Enabled: Ptr(true), AllowedActions: Ptr("selected")} mux.HandleFunc("/repos/o/r/actions/permissions", func(w http.ResponseWriter, r *http.Request) { v := new(ActionsPermissionsRepository) @@ -73,7 +73,7 @@ func TestRepositoriesService_EditActionsPermissions(t *testing.T) { t.Errorf("Repositories.EditActionsPermissions returned error: %v", err) } - want := &ActionsPermissionsRepository{Enabled: Bool(true), AllowedActions: String("selected")} + want := &ActionsPermissionsRepository{Enabled: Ptr(true), AllowedActions: Ptr("selected")} if !cmp.Equal(org, want) { t.Errorf("Repositories.EditActionsPermissions returned %+v, want %+v", org, want) } @@ -98,9 +98,9 @@ func TestActionsPermissionsRepository_Marshal(t *testing.T) { testJSONMarshal(t, &ActionsPermissions{}, "{}") u := &ActionsPermissionsRepository{ - Enabled: Bool(true), - AllowedActions: String("all"), - SelectedActionsURL: String("someURL"), + Enabled: Ptr(true), + AllowedActions: Ptr("all"), + SelectedActionsURL: Ptr("someURL"), } want := `{ @@ -126,7 +126,7 @@ func TestRepositoriesService_GetDefaultWorkflowPermissions(t *testing.T) { if err != nil { t.Errorf("Repositories.GetDefaultWorkflowPermissions returned error: %v", err) } - want := &DefaultWorkflowPermissionRepository{DefaultWorkflowPermissions: String("read"), CanApprovePullRequestReviews: Bool(true)} + want := &DefaultWorkflowPermissionRepository{DefaultWorkflowPermissions: Ptr("read"), CanApprovePullRequestReviews: Ptr(true)} if !cmp.Equal(org, want) { t.Errorf("Repositories.GetDefaultWorkflowPermissions returned %+v, want %+v", org, want) } @@ -150,7 +150,7 @@ func TestRepositoriesService_EditDefaultWorkflowPermissions(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &DefaultWorkflowPermissionRepository{DefaultWorkflowPermissions: String("read"), CanApprovePullRequestReviews: Bool(true)} + input := &DefaultWorkflowPermissionRepository{DefaultWorkflowPermissions: Ptr("read"), CanApprovePullRequestReviews: Ptr(true)} mux.HandleFunc("/repos/o/r/actions/permissions/workflow", func(w http.ResponseWriter, r *http.Request) { v := new(DefaultWorkflowPermissionRepository) @@ -170,7 +170,7 @@ func TestRepositoriesService_EditDefaultWorkflowPermissions(t *testing.T) { t.Errorf("Repositories.EditDefaultWorkflowPermissions returned error: %v", err) } - want := &DefaultWorkflowPermissionRepository{DefaultWorkflowPermissions: String("read"), CanApprovePullRequestReviews: Bool(true)} + want := &DefaultWorkflowPermissionRepository{DefaultWorkflowPermissions: Ptr("read"), CanApprovePullRequestReviews: Ptr(true)} if !cmp.Equal(org, want) { t.Errorf("Repositories.EditDefaultWorkflowPermissions returned %+v, want %+v", org, want) } diff --git a/github/repos_autolinks_test.go b/github/repos_autolinks_test.go index 1cf7a968f2a..5fdd8d44f0b 100644 --- a/github/repos_autolinks_test.go +++ b/github/repos_autolinks_test.go @@ -35,8 +35,8 @@ func TestRepositoriesService_ListAutolinks(t *testing.T) { } want := []*Autolink{ - {ID: Int64(1), KeyPrefix: String("TICKET-"), URLTemplate: String("https://example.com/TICKET?query=")}, - {ID: Int64(2), KeyPrefix: String("STORY-"), URLTemplate: String("https://example.com/STORY?query=")}, + {ID: Ptr(int64(1)), KeyPrefix: Ptr("TICKET-"), URLTemplate: Ptr("https://example.com/TICKET?query=")}, + {ID: Ptr(int64(2)), KeyPrefix: Ptr("STORY-"), URLTemplate: Ptr("https://example.com/STORY?query=")}, } if !cmp.Equal(autolinks, want) { @@ -63,9 +63,9 @@ func TestRepositoriesService_AddAutolink(t *testing.T) { client, mux, _ := setup(t) opt := &AutolinkOptions{ - KeyPrefix: String("TICKET-"), - URLTemplate: String("https://example.com/TICKET?query="), - IsAlphanumeric: Bool(true), + KeyPrefix: Ptr("TICKET-"), + URLTemplate: Ptr("https://example.com/TICKET?query="), + IsAlphanumeric: Ptr(true), } mux.HandleFunc("/repos/o/r/autolinks", func(w http.ResponseWriter, r *http.Request) { v := new(AutolinkOptions) @@ -89,9 +89,9 @@ func TestRepositoriesService_AddAutolink(t *testing.T) { t.Errorf("Repositories.AddAutolink returned error: %v", err) } want := &Autolink{ - KeyPrefix: String("TICKET-"), - URLTemplate: String("https://example.com/TICKET?query="), - IsAlphanumeric: Bool(true), + KeyPrefix: Ptr("TICKET-"), + URLTemplate: Ptr("https://example.com/TICKET?query="), + IsAlphanumeric: Ptr(true), } if !cmp.Equal(autolink, want) { @@ -128,7 +128,7 @@ func TestRepositoriesService_GetAutolink(t *testing.T) { t.Errorf("Repositories.GetAutolink returned error: %v", err) } - want := &Autolink{ID: Int64(1), KeyPrefix: String("TICKET-"), URLTemplate: String("https://example.com/TICKET?query=")} + want := &Autolink{ID: Ptr(int64(1)), KeyPrefix: Ptr("TICKET-"), URLTemplate: Ptr("https://example.com/TICKET?query=")} if !cmp.Equal(autolink, want) { t.Errorf("Repositories.GetAutolink returned %+v, want %+v", autolink, want) } @@ -169,9 +169,9 @@ func TestAutolinkOptions_Marshal(t *testing.T) { testJSONMarshal(t, &AutolinkOptions{}, "{}") r := &AutolinkOptions{ - KeyPrefix: String("kp"), - URLTemplate: String("URLT"), - IsAlphanumeric: Bool(true), + KeyPrefix: Ptr("kp"), + URLTemplate: Ptr("URLT"), + IsAlphanumeric: Ptr(true), } want := `{ @@ -188,10 +188,10 @@ func TestAutolink_Marshal(t *testing.T) { testJSONMarshal(t, &Autolink{}, "{}") r := &Autolink{ - ID: Int64(1), - KeyPrefix: String("kp"), - URLTemplate: String("URLT"), - IsAlphanumeric: Bool(true), + ID: Ptr(int64(1)), + KeyPrefix: Ptr("kp"), + URLTemplate: Ptr("URLT"), + IsAlphanumeric: Ptr(true), } want := `{ diff --git a/github/repos_codeowners_test.go b/github/repos_codeowners_test.go index f3ced1ca41a..0b3c784274b 100644 --- a/github/repos_codeowners_test.go +++ b/github/repos_codeowners_test.go @@ -50,7 +50,7 @@ func TestRepositoriesService_GetCodeownersErrors_noRef(t *testing.T) { Column: 1, Kind: "Invalid pattern", Source: "***/*.rb @monalisa", - Suggestion: String("Did you mean **/*.rb?"), + Suggestion: Ptr("Did you mean **/*.rb?"), Message: "Invalid pattern on line 3: Did you mean **/*.rb?\n\n ***/*.rb @monalisa\n ^", Path: ".github/CODEOWNERS", }, @@ -113,7 +113,7 @@ func TestRepositoriesService_GetCodeownersErrors_specificRef(t *testing.T) { Column: 1, Kind: "Invalid pattern", Source: "***/*.rb @monalisa", - Suggestion: String("Did you mean **/*.rb?"), + Suggestion: Ptr("Did you mean **/*.rb?"), Message: "Invalid pattern on line 3: Did you mean **/*.rb?\n\n ***/*.rb @monalisa\n ^", Path: ".github/CODEOWNERS", }, @@ -149,7 +149,7 @@ func TestCodeownersErrors_Marshal(t *testing.T) { Column: 1, Kind: "Invalid pattern", Source: "***/*.rb @monalisa", - Suggestion: String("Did you mean **/*.rb?"), + Suggestion: Ptr("Did you mean **/*.rb?"), Message: "Invalid pattern on line 3: Did you mean **/*.rb?\n\n ***/*.rb @monalisa\n ^", Path: ".github/CODEOWNERS", }, diff --git a/github/repos_collaborators_test.go b/github/repos_collaborators_test.go index 1aa9a6fb9bf..0525ca5f568 100644 --- a/github/repos_collaborators_test.go +++ b/github/repos_collaborators_test.go @@ -34,7 +34,7 @@ func TestRepositoriesService_ListCollaborators(t *testing.T) { t.Errorf("Repositories.ListCollaborators returned error: %v", err) } - want := []*User{{ID: Int64(1)}, {ID: Int64(2)}} + want := []*User{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}} if !cmp.Equal(users, want) { t.Errorf("Repositories.ListCollaborators returned %+v, want %+v", users, want) } @@ -74,7 +74,7 @@ func TestRepositoriesService_ListCollaborators_withAffiliation(t *testing.T) { t.Errorf("Repositories.ListCollaborators returned error: %v", err) } - want := []*User{{ID: Int64(1)}, {ID: Int64(2)}} + want := []*User{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}} if !cmp.Equal(users, want) { t.Errorf("Repositories.ListCollaborators returned %+v, want %+v", users, want) } @@ -114,7 +114,7 @@ func TestRepositoriesService_ListCollaborators_withPermission(t *testing.T) { t.Errorf("Repositories.ListCollaborators returned error: %v", err) } - want := []*User{{ID: Int64(1)}, {ID: Int64(2)}} + want := []*User{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}} if !cmp.Equal(users, want) { t.Errorf("Repositories.ListCollaborators returned %+v, want %+v", users, want) } @@ -236,9 +236,9 @@ func TestRepositoryService_GetPermissionLevel(t *testing.T) { } want := &RepositoryPermissionLevel{ - Permission: String("admin"), + Permission: Ptr("admin"), User: &User{ - Login: String("u"), + Login: Ptr("u"), }, } @@ -282,21 +282,21 @@ func TestRepositoriesService_AddCollaborator(t *testing.T) { t.Errorf("Repositories.AddCollaborator returned error: %v", err) } want := &CollaboratorInvitation{ - ID: Int64(1), + ID: Ptr(int64(1)), Repo: &Repository{ - ID: Int64(1), - URL: String("s"), - Name: String("r"), + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("r"), }, Invitee: &User{ - Login: String("u"), + Login: Ptr("u"), }, Inviter: &User{ - Login: String("o"), + Login: Ptr("o"), }, - Permissions: String("write"), - URL: String("https://api.github.com/user/repository_invitations/1296269"), - HTMLURL: String("https://github.com/octocat/Hello-World/invitations"), + Permissions: Ptr("write"), + URL: Ptr("https://api.github.com/user/repository_invitations/1296269"), + HTMLURL: Ptr("https://github.com/octocat/Hello-World/invitations"), } if !cmp.Equal(collaboratorInvitation, want) { @@ -382,24 +382,24 @@ func TestRepositoryPermissionLevel_Marshal(t *testing.T) { testJSONMarshal(t, &RepositoryPermissionLevel{}, "{}") r := &RepositoryPermissionLevel{ - Permission: String("permission"), + Permission: Ptr("permission"), User: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, @@ -437,57 +437,57 @@ func TestCollaboratorInvitation_Marshal(t *testing.T) { testJSONMarshal(t, &CollaboratorInvitation{}, "{}") r := &CollaboratorInvitation{ - ID: Int64(1), + ID: Ptr(int64(1)), Repo: &Repository{ - ID: Int64(1), - URL: String("url"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("url"), + Name: Ptr("n"), }, Invitee: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, Inviter: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - Permissions: String("per"), + Permissions: Ptr("per"), CreatedAt: &Timestamp{referenceTime}, - URL: String("url"), - HTMLURL: String("hurl"), + URL: Ptr("url"), + HTMLURL: Ptr("hurl"), } want := `{ diff --git a/github/repos_comments_test.go b/github/repos_comments_test.go index 5daf3c53dd7..c415b1c3202 100644 --- a/github/repos_comments_test.go +++ b/github/repos_comments_test.go @@ -33,7 +33,7 @@ func TestRepositoriesService_ListComments(t *testing.T) { t.Errorf("Repositories.ListComments returned error: %v", err) } - want := []*RepositoryComment{{ID: Int64(1)}, {ID: Int64(2)}} + want := []*RepositoryComment{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}} if !cmp.Equal(comments, want) { t.Errorf("Repositories.ListComments returned %+v, want %+v", comments, want) } @@ -80,7 +80,7 @@ func TestRepositoriesService_ListCommitComments(t *testing.T) { t.Errorf("Repositories.ListCommitComments returned error: %v", err) } - want := []*RepositoryComment{{ID: Int64(1)}, {ID: Int64(2)}} + want := []*RepositoryComment{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}} if !cmp.Equal(comments, want) { t.Errorf("Repositories.ListCommitComments returned %+v, want %+v", comments, want) } @@ -113,7 +113,7 @@ func TestRepositoriesService_CreateComment(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &RepositoryComment{Body: String("b")} + input := &RepositoryComment{Body: Ptr("b")} mux.HandleFunc("/repos/o/r/commits/s/comments", func(w http.ResponseWriter, r *http.Request) { v := new(RepositoryComment) @@ -133,7 +133,7 @@ func TestRepositoriesService_CreateComment(t *testing.T) { t.Errorf("Repositories.CreateComment returned error: %v", err) } - want := &RepositoryComment{ID: Int64(1)} + want := &RepositoryComment{ID: Ptr(int64(1))} if !cmp.Equal(comment, want) { t.Errorf("Repositories.CreateComment returned %+v, want %+v", comment, want) } @@ -178,7 +178,7 @@ func TestRepositoriesService_GetComment(t *testing.T) { t.Errorf("Repositories.GetComment returned error: %v", err) } - want := &RepositoryComment{ID: Int64(1)} + want := &RepositoryComment{ID: Ptr(int64(1))} if !cmp.Equal(comment, want) { t.Errorf("Repositories.GetComment returned %+v, want %+v", comment, want) } @@ -211,7 +211,7 @@ func TestRepositoriesService_UpdateComment(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &RepositoryComment{Body: String("b")} + input := &RepositoryComment{Body: Ptr("b")} mux.HandleFunc("/repos/o/r/comments/1", func(w http.ResponseWriter, r *http.Request) { v := new(RepositoryComment) @@ -231,7 +231,7 @@ func TestRepositoriesService_UpdateComment(t *testing.T) { t.Errorf("Repositories.UpdateComment returned error: %v", err) } - want := &RepositoryComment{ID: Int64(1)} + want := &RepositoryComment{ID: Ptr(int64(1))} if !cmp.Equal(comment, want) { t.Errorf("Repositories.UpdateComment returned %+v, want %+v", comment, want) } @@ -299,48 +299,48 @@ func TestRepositoryComment_Marshal(t *testing.T) { testJSONMarshal(t, &RepositoryComment{}, "{}") r := &RepositoryComment{ - HTMLURL: String("hurl"), - URL: String("url"), - ID: Int64(1), - NodeID: String("nid"), - CommitID: String("cid"), + HTMLURL: Ptr("hurl"), + URL: Ptr("url"), + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + CommitID: Ptr("cid"), User: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, Reactions: &Reactions{ - TotalCount: Int(1), - PlusOne: Int(1), - MinusOne: Int(1), - Laugh: Int(1), - Confused: Int(1), - Heart: Int(1), - Hooray: Int(1), - Rocket: Int(1), - Eyes: Int(1), - URL: String("u"), + TotalCount: Ptr(1), + PlusOne: Ptr(1), + MinusOne: Ptr(1), + Laugh: Ptr(1), + Confused: Ptr(1), + Heart: Ptr(1), + Hooray: Ptr(1), + Rocket: Ptr(1), + Eyes: Ptr(1), + URL: Ptr("u"), }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - Body: String("body"), - Path: String("path"), - Position: Int(1), + Body: Ptr("body"), + Path: Ptr("path"), + Position: Ptr(1), } want := `{ diff --git a/github/repos_commits_test.go b/github/repos_commits_test.go index 08326d2715c..fb99a75a614 100644 --- a/github/repos_commits_test.go +++ b/github/repos_commits_test.go @@ -48,7 +48,7 @@ func TestRepositoriesService_ListCommits(t *testing.T) { t.Errorf("Repositories.ListCommits returned error: %v", err) } - want := []*RepositoryCommit{{SHA: String("s")}} + want := []*RepositoryCommit{{SHA: Ptr("s")}} if !cmp.Equal(commits, want) { t.Errorf("Repositories.ListCommits returned %+v, want %+v", commits, want) } @@ -106,37 +106,37 @@ func TestRepositoriesService_GetCommit(t *testing.T) { } want := &RepositoryCommit{ - SHA: String("s"), + SHA: Ptr("s"), Commit: &Commit{ - Message: String("m"), + Message: Ptr("m"), }, Author: &User{ - Login: String("l"), + Login: Ptr("l"), }, Committer: &User{ - Login: String("l"), + Login: Ptr("l"), }, Parents: []*Commit{ { - SHA: String("s"), + SHA: Ptr("s"), }, }, Stats: &CommitStats{ - Additions: Int(104), - Deletions: Int(4), - Total: Int(108), + Additions: Ptr(104), + Deletions: Ptr(4), + Total: Ptr(108), }, Files: []*CommitFile{ { - Filename: String("f"), - Additions: Int(10), - Deletions: Int(2), - Changes: Int(12), - Status: String("s"), - Patch: String("p"), - BlobURL: String("b"), - RawURL: String("r"), - ContentsURL: String("c"), + Filename: Ptr("f"), + Additions: Ptr(10), + Deletions: Ptr(2), + Changes: Ptr(12), + Status: Ptr("s"), + Patch: Ptr("p"), + BlobURL: Ptr("b"), + RawURL: Ptr("r"), + ContentsURL: Ptr("c"), }, }, } @@ -443,50 +443,50 @@ func TestRepositoriesService_CompareCommits(t *testing.T) { want := &CommitsComparison{ BaseCommit: &RepositoryCommit{ - SHA: String("s"), + SHA: Ptr("s"), Commit: &Commit{ - Author: &CommitAuthor{Name: String("n")}, - Committer: &CommitAuthor{Name: String("n")}, - Message: String("m"), - Tree: &Tree{SHA: String("t")}, + Author: &CommitAuthor{Name: Ptr("n")}, + Committer: &CommitAuthor{Name: Ptr("n")}, + Message: Ptr("m"), + Tree: &Tree{SHA: Ptr("t")}, }, - Author: &User{Login: String("l")}, - Committer: &User{Login: String("l")}, + Author: &User{Login: Ptr("l")}, + Committer: &User{Login: Ptr("l")}, Parents: []*Commit{ { - SHA: String("s"), + SHA: Ptr("s"), }, }, }, - Status: String("s"), - AheadBy: Int(1), - BehindBy: Int(2), - TotalCommits: Int(1), + Status: Ptr("s"), + AheadBy: Ptr(1), + BehindBy: Ptr(2), + TotalCommits: Ptr(1), Commits: []*RepositoryCommit{ { - SHA: String("s"), + SHA: Ptr("s"), Commit: &Commit{ - Author: &CommitAuthor{Name: String("n")}, + Author: &CommitAuthor{Name: Ptr("n")}, }, - Author: &User{Login: String("l")}, - Committer: &User{Login: String("l")}, + Author: &User{Login: Ptr("l")}, + Committer: &User{Login: Ptr("l")}, Parents: []*Commit{ { - SHA: String("s"), + SHA: Ptr("s"), }, }, }, }, Files: []*CommitFile{ { - Filename: String("f"), + Filename: Ptr("f"), }, }, - HTMLURL: String(fmt.Sprintf("https://github.com/o/r/compare/%v...%v", escapedBase, escapedHead)), - PermalinkURL: String("https://github.com/o/r/compare/o:bbcd538c8e72b8c175046e27cc8f907076331401...o:0328041d1152db8ae77652d1618a02e57f745f17"), - DiffURL: String(fmt.Sprintf("https://github.com/o/r/compare/%v...%v.diff", escapedBase, escapedHead)), - PatchURL: String(fmt.Sprintf("https://github.com/o/r/compare/%v...%v.patch", escapedBase, escapedHead)), - URL: String(fmt.Sprintf("https://api.github.com/repos/o/r/compare/%v...%v", escapedBase, escapedHead)), + HTMLURL: Ptr(fmt.Sprintf("https://github.com/o/r/compare/%v...%v", escapedBase, escapedHead)), + PermalinkURL: Ptr("https://github.com/o/r/compare/o:bbcd538c8e72b8c175046e27cc8f907076331401...o:0328041d1152db8ae77652d1618a02e57f745f17"), + DiffURL: Ptr(fmt.Sprintf("https://github.com/o/r/compare/%v...%v.diff", escapedBase, escapedHead)), + PatchURL: Ptr(fmt.Sprintf("https://github.com/o/r/compare/%v...%v.patch", escapedBase, escapedHead)), + URL: Ptr(fmt.Sprintf("https://api.github.com/repos/o/r/compare/%v...%v", escapedBase, escapedHead)), } if !cmp.Equal(got, want) { @@ -652,12 +652,12 @@ func TestRepositoriesService_ListBranchesHeadCommit(t *testing.T) { want := []*BranchCommit{ { - Name: String("b"), + Name: Ptr("b"), Commit: &Commit{ - SHA: String("2e90302801c870f17b6152327d9b9a03c8eca0e2"), - URL: String("https://api.github.com/repos/google/go-github/commits/2e90302801c870f17b6152327d9b9a03c8eca0e2"), + SHA: Ptr("2e90302801c870f17b6152327d9b9a03c8eca0e2"), + URL: Ptr("https://api.github.com/repos/google/go-github/commits/2e90302801c870f17b6152327d9b9a03c8eca0e2"), }, - Protected: Bool(true), + Protected: Ptr(true), }, } if !cmp.Equal(branches, want) { @@ -684,53 +684,53 @@ func TestBranchCommit_Marshal(t *testing.T) { testJSONMarshal(t, &BranchCommit{}, "{}") r := &BranchCommit{ - Name: String("n"), + Name: Ptr("n"), Commit: &Commit{ - SHA: String("s"), + SHA: Ptr("s"), Author: &CommitAuthor{ Date: &Timestamp{referenceTime}, - Name: String("n"), - Email: String("e"), - Login: String("u"), + Name: Ptr("n"), + Email: Ptr("e"), + Login: Ptr("u"), }, Committer: &CommitAuthor{ Date: &Timestamp{referenceTime}, - Name: String("n"), - Email: String("e"), - Login: String("u"), + Name: Ptr("n"), + Email: Ptr("e"), + Login: Ptr("u"), }, - Message: String("m"), + Message: Ptr("m"), Tree: &Tree{ - SHA: String("s"), + SHA: Ptr("s"), Entries: []*TreeEntry{{ - SHA: String("s"), - Path: String("p"), - Mode: String("m"), - Type: String("t"), - Size: Int(1), - Content: String("c"), - URL: String("u"), + SHA: Ptr("s"), + Path: Ptr("p"), + Mode: Ptr("m"), + Type: Ptr("t"), + Size: Ptr(1), + Content: Ptr("c"), + URL: Ptr("u"), }}, - Truncated: Bool(false), + Truncated: Ptr(false), }, Parents: nil, Stats: &CommitStats{ - Additions: Int(1), - Deletions: Int(1), - Total: Int(1), + Additions: Ptr(1), + Deletions: Ptr(1), + Total: Ptr(1), }, - HTMLURL: String("h"), - URL: String("u"), + HTMLURL: Ptr("h"), + URL: Ptr("u"), Verification: &SignatureVerification{ - Verified: Bool(false), - Reason: String("r"), - Signature: String("s"), - Payload: String("p"), + Verified: Ptr(false), + Reason: Ptr("r"), + Signature: Ptr("s"), + Payload: Ptr("p"), }, - NodeID: String("n"), - CommentCount: Int(1), + NodeID: Ptr("n"), + CommentCount: Ptr(1), }, - Protected: Bool(false), + Protected: Ptr(false), } want := `{ @@ -792,27 +792,27 @@ func TestCommitsComparison_Marshal(t *testing.T) { testJSONMarshal(t, &CommitsComparison{}, "{}") r := &CommitsComparison{ - BaseCommit: &RepositoryCommit{NodeID: String("nid")}, - MergeBaseCommit: &RepositoryCommit{NodeID: String("nid")}, - Status: String("status"), - AheadBy: Int(1), - BehindBy: Int(1), - TotalCommits: Int(1), + BaseCommit: &RepositoryCommit{NodeID: Ptr("nid")}, + MergeBaseCommit: &RepositoryCommit{NodeID: Ptr("nid")}, + Status: Ptr("status"), + AheadBy: Ptr(1), + BehindBy: Ptr(1), + TotalCommits: Ptr(1), Commits: []*RepositoryCommit{ { - NodeID: String("nid"), + NodeID: Ptr("nid"), }, }, Files: []*CommitFile{ { - SHA: String("sha"), + SHA: Ptr("sha"), }, }, - HTMLURL: String("hurl"), - PermalinkURL: String("purl"), - DiffURL: String("durl"), - PatchURL: String("purl"), - URL: String("url"), + HTMLURL: Ptr("hurl"), + PermalinkURL: Ptr("purl"), + DiffURL: Ptr("durl"), + PatchURL: Ptr("purl"), + URL: Ptr("url"), } want := `{ @@ -851,17 +851,17 @@ func TestCommitFile_Marshal(t *testing.T) { testJSONMarshal(t, &CommitFile{}, "{}") r := &CommitFile{ - SHA: String("sha"), - Filename: String("fn"), - Additions: Int(1), - Deletions: Int(1), - Changes: Int(1), - Status: String("status"), - Patch: String("patch"), - BlobURL: String("burl"), - RawURL: String("rurl"), - ContentsURL: String("curl"), - PreviousFilename: String("pf"), + SHA: Ptr("sha"), + Filename: Ptr("fn"), + Additions: Ptr(1), + Deletions: Ptr(1), + Changes: Ptr(1), + Status: Ptr("status"), + Patch: Ptr("patch"), + BlobURL: Ptr("burl"), + RawURL: Ptr("rurl"), + ContentsURL: Ptr("curl"), + PreviousFilename: Ptr("pf"), } want := `{ @@ -886,9 +886,9 @@ func TestCommitStats_Marshal(t *testing.T) { testJSONMarshal(t, &CommitStats{}, "{}") r := &CommitStats{ - Additions: Int(1), - Deletions: Int(1), - Total: Int(1), + Additions: Ptr(1), + Deletions: Ptr(1), + Total: Ptr(1), } want := `{ @@ -905,41 +905,41 @@ func TestRepositoryCommit_Marshal(t *testing.T) { testJSONMarshal(t, &RepositoryCommit{}, "{}") r := &RepositoryCommit{ - NodeID: String("nid"), - SHA: String("sha"), + NodeID: Ptr("nid"), + SHA: Ptr("sha"), Commit: &Commit{ - Message: String("m"), + Message: Ptr("m"), }, Author: &User{ - Login: String("l"), + Login: Ptr("l"), }, Committer: &User{ - Login: String("l"), + Login: Ptr("l"), }, Parents: []*Commit{ { - SHA: String("s"), + SHA: Ptr("s"), }, }, - HTMLURL: String("hurl"), - URL: String("url"), - CommentsURL: String("curl"), + HTMLURL: Ptr("hurl"), + URL: Ptr("url"), + CommentsURL: Ptr("curl"), Stats: &CommitStats{ - Additions: Int(104), - Deletions: Int(4), - Total: Int(108), + Additions: Ptr(104), + Deletions: Ptr(4), + Total: Ptr(108), }, Files: []*CommitFile{ { - Filename: String("f"), - Additions: Int(10), - Deletions: Int(2), - Changes: Int(12), - Status: String("s"), - Patch: String("p"), - BlobURL: String("b"), - RawURL: String("r"), - ContentsURL: String("c"), + Filename: Ptr("f"), + Additions: Ptr(10), + Deletions: Ptr(2), + Changes: Ptr(12), + Status: Ptr("s"), + Patch: Ptr("p"), + BlobURL: Ptr("b"), + RawURL: Ptr("r"), + ContentsURL: Ptr("c"), }, }, } diff --git a/github/repos_community_health_test.go b/github/repos_community_health_test.go index 4d4a4d86ee0..eb7f2ce507c 100644 --- a/github/repos_community_health_test.go +++ b/github/repos_community_health_test.go @@ -74,43 +74,43 @@ func TestRepositoriesService_GetCommunityHealthMetrics(t *testing.T) { updatedAt := time.Date(2017, time.February, 28, 0, 0, 0, 0, time.UTC) want := &CommunityHealthMetrics{ - HealthPercentage: Int(100), - Description: String("My first repository on GitHub!"), + HealthPercentage: Ptr(100), + Description: Ptr("My first repository on GitHub!"), UpdatedAt: &Timestamp{updatedAt}, - ContentReportsEnabled: Bool(true), + ContentReportsEnabled: Ptr(true), Files: &CommunityHealthFiles{ CodeOfConduct: &Metric{ - Name: String("Contributor Covenant"), - Key: String("contributor_covenant"), - HTMLURL: String("https://github.com/octocat/Hello-World/blob/master/CODE_OF_CONDUCT.md"), + Name: Ptr("Contributor Covenant"), + Key: Ptr("contributor_covenant"), + HTMLURL: Ptr("https://github.com/octocat/Hello-World/blob/master/CODE_OF_CONDUCT.md"), }, CodeOfConductFile: &Metric{ - URL: String("https://api.github.com/repos/octocat/Hello-World/contents/CODE_OF_CONDUCT.md"), - HTMLURL: String("https://github.com/octocat/Hello-World/blob/master/CODE_OF_CONDUCT.md"), + URL: Ptr("https://api.github.com/repos/octocat/Hello-World/contents/CODE_OF_CONDUCT.md"), + HTMLURL: Ptr("https://github.com/octocat/Hello-World/blob/master/CODE_OF_CONDUCT.md"), }, Contributing: &Metric{ - URL: String("https://api.github.com/repos/octocat/Hello-World/contents/CONTRIBUTING"), - HTMLURL: String("https://github.com/octocat/Hello-World/blob/master/CONTRIBUTING"), + URL: Ptr("https://api.github.com/repos/octocat/Hello-World/contents/CONTRIBUTING"), + HTMLURL: Ptr("https://github.com/octocat/Hello-World/blob/master/CONTRIBUTING"), }, IssueTemplate: &Metric{ - URL: String("https://api.github.com/repos/octocat/Hello-World/contents/ISSUE_TEMPLATE"), - HTMLURL: String("https://github.com/octocat/Hello-World/blob/master/ISSUE_TEMPLATE"), + URL: Ptr("https://api.github.com/repos/octocat/Hello-World/contents/ISSUE_TEMPLATE"), + HTMLURL: Ptr("https://github.com/octocat/Hello-World/blob/master/ISSUE_TEMPLATE"), }, PullRequestTemplate: &Metric{ - URL: String("https://api.github.com/repos/octocat/Hello-World/contents/PULL_REQUEST_TEMPLATE"), - HTMLURL: String("https://github.com/octocat/Hello-World/blob/master/PULL_REQUEST_TEMPLATE"), + URL: Ptr("https://api.github.com/repos/octocat/Hello-World/contents/PULL_REQUEST_TEMPLATE"), + HTMLURL: Ptr("https://github.com/octocat/Hello-World/blob/master/PULL_REQUEST_TEMPLATE"), }, License: &Metric{ - Name: String("MIT License"), - Key: String("mit"), - SPDXID: String("MIT"), - URL: String("https://api.github.com/licenses/mit"), - HTMLURL: String("https://github.com/octocat/Hello-World/blob/master/LICENSE"), - NodeID: String("MDc6TGljZW5zZW1pdA=="), + Name: Ptr("MIT License"), + Key: Ptr("mit"), + SPDXID: Ptr("MIT"), + URL: Ptr("https://api.github.com/licenses/mit"), + HTMLURL: Ptr("https://github.com/octocat/Hello-World/blob/master/LICENSE"), + NodeID: Ptr("MDc6TGljZW5zZW1pdA=="), }, Readme: &Metric{ - URL: String("https://api.github.com/repos/octocat/Hello-World/contents/README.md"), - HTMLURL: String("https://github.com/octocat/Hello-World/blob/master/README.md"), + URL: Ptr("https://api.github.com/repos/octocat/Hello-World/contents/README.md"), + HTMLURL: Ptr("https://github.com/octocat/Hello-World/blob/master/README.md"), }, }, } @@ -138,12 +138,12 @@ func TestMetric_Marshal(t *testing.T) { testJSONMarshal(t, &Metric{}, "{}") r := &Metric{ - Name: String("name"), - Key: String("key"), - SPDXID: String("spdx_id"), - URL: String("url"), - HTMLURL: String("hurl"), - NodeID: String("node_id"), + Name: Ptr("name"), + Key: Ptr("key"), + SPDXID: Ptr("spdx_id"), + URL: Ptr("url"), + HTMLURL: Ptr("hurl"), + NodeID: Ptr("node_id"), } want := `{ @@ -164,48 +164,48 @@ func TestCommunityHealthFiles_Marshal(t *testing.T) { r := &CommunityHealthFiles{ CodeOfConduct: &Metric{ - Name: String("name"), - Key: String("key"), - URL: String("url"), - HTMLURL: String("hurl"), + Name: Ptr("name"), + Key: Ptr("key"), + URL: Ptr("url"), + HTMLURL: Ptr("hurl"), }, CodeOfConductFile: &Metric{ - Name: String("name"), - Key: String("key"), - URL: String("url"), - HTMLURL: String("hurl"), + Name: Ptr("name"), + Key: Ptr("key"), + URL: Ptr("url"), + HTMLURL: Ptr("hurl"), }, Contributing: &Metric{ - Name: String("name"), - Key: String("key"), - URL: String("url"), - HTMLURL: String("hurl"), + Name: Ptr("name"), + Key: Ptr("key"), + URL: Ptr("url"), + HTMLURL: Ptr("hurl"), }, IssueTemplate: &Metric{ - Name: String("name"), - Key: String("key"), - URL: String("url"), - HTMLURL: String("hurl"), + Name: Ptr("name"), + Key: Ptr("key"), + URL: Ptr("url"), + HTMLURL: Ptr("hurl"), }, PullRequestTemplate: &Metric{ - Name: String("name"), - Key: String("key"), - URL: String("url"), - HTMLURL: String("hurl"), + Name: Ptr("name"), + Key: Ptr("key"), + URL: Ptr("url"), + HTMLURL: Ptr("hurl"), }, License: &Metric{ - Name: String("name"), - Key: String("key"), - SPDXID: String("spdx_id"), - URL: String("url"), - HTMLURL: String("hurl"), - NodeID: String("node_id"), + Name: Ptr("name"), + Key: Ptr("key"), + SPDXID: Ptr("spdx_id"), + URL: Ptr("url"), + HTMLURL: Ptr("hurl"), + NodeID: Ptr("node_id"), }, Readme: &Metric{ - Name: String("name"), - Key: String("key"), - URL: String("url"), - HTMLURL: String("hurl"), + Name: Ptr("name"), + Key: Ptr("key"), + URL: Ptr("url"), + HTMLURL: Ptr("hurl"), }, } @@ -264,57 +264,57 @@ func TestCommunityHealthMetrics_Marshal(t *testing.T) { testJSONMarshal(t, &CommunityHealthMetrics{}, "{}") r := &CommunityHealthMetrics{ - HealthPercentage: Int(1), - Description: String("desc"), - Documentation: String("docs"), + HealthPercentage: Ptr(1), + Description: Ptr("desc"), + Documentation: Ptr("docs"), Files: &CommunityHealthFiles{ CodeOfConduct: &Metric{ - Name: String("name"), - Key: String("key"), - URL: String("url"), - HTMLURL: String("hurl"), + Name: Ptr("name"), + Key: Ptr("key"), + URL: Ptr("url"), + HTMLURL: Ptr("hurl"), }, CodeOfConductFile: &Metric{ - Name: String("name"), - Key: String("key"), - URL: String("url"), - HTMLURL: String("hurl"), + Name: Ptr("name"), + Key: Ptr("key"), + URL: Ptr("url"), + HTMLURL: Ptr("hurl"), }, Contributing: &Metric{ - Name: String("name"), - Key: String("key"), - URL: String("url"), - HTMLURL: String("hurl"), + Name: Ptr("name"), + Key: Ptr("key"), + URL: Ptr("url"), + HTMLURL: Ptr("hurl"), }, IssueTemplate: &Metric{ - Name: String("name"), - Key: String("key"), - URL: String("url"), - HTMLURL: String("hurl"), + Name: Ptr("name"), + Key: Ptr("key"), + URL: Ptr("url"), + HTMLURL: Ptr("hurl"), }, PullRequestTemplate: &Metric{ - Name: String("name"), - Key: String("key"), - URL: String("url"), - HTMLURL: String("hurl"), + Name: Ptr("name"), + Key: Ptr("key"), + URL: Ptr("url"), + HTMLURL: Ptr("hurl"), }, License: &Metric{ - Name: String("name"), - Key: String("key"), - SPDXID: String("spdx_id"), - URL: String("url"), - HTMLURL: String("hurl"), - NodeID: String("node_id"), + Name: Ptr("name"), + Key: Ptr("key"), + SPDXID: Ptr("spdx_id"), + URL: Ptr("url"), + HTMLURL: Ptr("hurl"), + NodeID: Ptr("node_id"), }, Readme: &Metric{ - Name: String("name"), - Key: String("key"), - URL: String("url"), - HTMLURL: String("hurl"), + Name: Ptr("name"), + Key: Ptr("key"), + URL: Ptr("url"), + HTMLURL: Ptr("hurl"), }, }, UpdatedAt: &Timestamp{referenceTime}, - ContentReportsEnabled: Bool(true), + ContentReportsEnabled: Ptr(true), } want := `{ diff --git a/github/repos_contents_test.go b/github/repos_contents_test.go index cf139d77d61..b50e32fc30c 100644 --- a/github/repos_contents_test.go +++ b/github/repos_contents_test.go @@ -25,14 +25,14 @@ func TestRepositoryContent_GetContent(t *testing.T) { wantErr bool // whether an error is expected }{ { - encoding: String(""), - content: String("hello"), + encoding: Ptr(""), + content: Ptr("hello"), want: "hello", wantErr: false, }, { encoding: nil, - content: String("hello"), + content: Ptr("hello"), want: "hello", wantErr: false, }, @@ -43,19 +43,19 @@ func TestRepositoryContent_GetContent(t *testing.T) { wantErr: false, }, { - encoding: String("base64"), - content: String("aGVsbG8="), + encoding: Ptr("base64"), + content: Ptr("aGVsbG8="), want: "hello", wantErr: false, }, { - encoding: String("bad"), - content: String("aGVsbG8="), + encoding: Ptr("bad"), + content: Ptr("aGVsbG8="), want: "", wantErr: true, }, { - encoding: String("none"), + encoding: Ptr("none"), content: nil, want: "", wantErr: true, @@ -107,7 +107,7 @@ func TestRepositoriesService_GetReadme(t *testing.T) { if err != nil { t.Errorf("Repositories.GetReadme returned error: %v", err) } - want := &RepositoryContent{Type: String("file"), Name: String("README.md"), Size: Int(5362), Encoding: String("base64"), Path: String("README.md")} + want := &RepositoryContent{Type: Ptr("file"), Name: Ptr("README.md"), Size: Ptr(5362), Encoding: Ptr("base64"), Path: Ptr("README.md")} if !cmp.Equal(readme, want) { t.Errorf("Repositories.GetReadme returned %+v, want %+v", readme, want) } @@ -433,7 +433,7 @@ func TestRepositoriesService_GetContents_File(t *testing.T) { if err != nil { t.Errorf("Repositories.GetContents returned error: %v", err) } - want := &RepositoryContent{Type: String("file"), Name: String("LICENSE"), Size: Int(20678), Encoding: String("base64"), Path: String("LICENSE")} + want := &RepositoryContent{Type: Ptr("file"), Name: Ptr("LICENSE"), Size: Ptr(20678), Encoding: Ptr("base64"), Path: Ptr("LICENSE")} if !cmp.Equal(fileContents, want) { t.Errorf("Repositories.GetContents returned %+v, want %+v", fileContents, want) } @@ -536,8 +536,8 @@ func TestRepositoriesService_GetContents_Directory(t *testing.T) { if err != nil { t.Errorf("Repositories.GetContents returned error: %v", err) } - want := []*RepositoryContent{{Type: String("dir"), Name: String("lib"), Path: String("lib")}, - {Type: String("file"), Name: String("LICENSE"), Size: Int(20678), Path: String("LICENSE")}} + want := []*RepositoryContent{{Type: Ptr("dir"), Name: Ptr("lib"), Path: Ptr("lib")}, + {Type: Ptr("file"), Name: Ptr("LICENSE"), Size: Ptr(20678), Path: Ptr("LICENSE")}} if !cmp.Equal(directoryContents, want) { t.Errorf("Repositories.GetContents_Directory returned %+v, want %+v", directoryContents, want) } @@ -564,7 +564,7 @@ func TestRepositoriesService_CreateFile(t *testing.T) { repositoryContentsOptions := &RepositoryContentFileOptions{ Message: &message, Content: content, - Committer: &CommitAuthor{Name: String("n"), Email: String("e")}, + Committer: &CommitAuthor{Name: Ptr("n"), Email: Ptr("e")}, } ctx := context.Background() createResponse, _, err := client.Repositories.CreateFile(ctx, "o", "r", "p", repositoryContentsOptions) @@ -572,10 +572,10 @@ func TestRepositoriesService_CreateFile(t *testing.T) { t.Errorf("Repositories.CreateFile returned error: %v", err) } want := &RepositoryContentResponse{ - Content: &RepositoryContent{Name: String("p")}, + Content: &RepositoryContent{Name: Ptr("p")}, Commit: Commit{ - Message: String("m"), - SHA: String("f5f369044773ff9c6383c087466d12adb6fa0828"), + Message: Ptr("m"), + SHA: Ptr("f5f369044773ff9c6383c087466d12adb6fa0828"), }, } if !cmp.Equal(createResponse, want) { @@ -620,7 +620,7 @@ func TestRepositoriesService_UpdateFile(t *testing.T) { Message: &message, Content: content, SHA: &sha, - Committer: &CommitAuthor{Name: String("n"), Email: String("e")}, + Committer: &CommitAuthor{Name: Ptr("n"), Email: Ptr("e")}, } ctx := context.Background() updateResponse, _, err := client.Repositories.UpdateFile(ctx, "o", "r", "p", repositoryContentsOptions) @@ -628,10 +628,10 @@ func TestRepositoriesService_UpdateFile(t *testing.T) { t.Errorf("Repositories.UpdateFile returned error: %v", err) } want := &RepositoryContentResponse{ - Content: &RepositoryContent{Name: String("p")}, + Content: &RepositoryContent{Name: Ptr("p")}, Commit: Commit{ - Message: String("m"), - SHA: String("f5f369044773ff9c6383c087466d12adb6fa0828"), + Message: Ptr("m"), + SHA: Ptr("f5f369044773ff9c6383c087466d12adb6fa0828"), }, } if !cmp.Equal(updateResponse, want) { @@ -672,7 +672,7 @@ func TestRepositoriesService_DeleteFile(t *testing.T) { repositoryContentsOptions := &RepositoryContentFileOptions{ Message: &message, SHA: &sha, - Committer: &CommitAuthor{Name: String("n"), Email: String("e")}, + Committer: &CommitAuthor{Name: Ptr("n"), Email: Ptr("e")}, } ctx := context.Background() deleteResponse, _, err := client.Repositories.DeleteFile(ctx, "o", "r", "p", repositoryContentsOptions) @@ -682,8 +682,8 @@ func TestRepositoriesService_DeleteFile(t *testing.T) { want := &RepositoryContentResponse{ Content: nil, Commit: Commit{ - Message: String("m"), - SHA: String("f5f369044773ff9c6383c087466d12adb6fa0828"), + Message: Ptr("m"), + SHA: Ptr("f5f369044773ff9c6383c087466d12adb6fa0828"), }, } if !cmp.Equal(deleteResponse, want) { @@ -811,19 +811,19 @@ func TestRepositoryContent_Marshal(t *testing.T) { testJSONMarshal(t, &RepositoryContent{}, "{}") r := &RepositoryContent{ - Type: String("type"), - Target: String("target"), - Encoding: String("encoding"), - Size: Int(1), - Name: String("name"), - Path: String("path"), - Content: String("content"), - SHA: String("sha"), - URL: String("url"), - GitURL: String("gurl"), - HTMLURL: String("hurl"), - DownloadURL: String("durl"), - SubmoduleGitURL: String("smgurl"), + Type: Ptr("type"), + Target: Ptr("target"), + Encoding: Ptr("encoding"), + Size: Ptr(1), + Name: Ptr("name"), + Path: Ptr("path"), + Content: Ptr("content"), + SHA: Ptr("sha"), + URL: Ptr("url"), + GitURL: Ptr("gurl"), + HTMLURL: Ptr("hurl"), + DownloadURL: Ptr("durl"), + SubmoduleGitURL: Ptr("smgurl"), } want := `{ @@ -851,64 +851,64 @@ func TestRepositoryContentResponse_Marshal(t *testing.T) { r := &RepositoryContentResponse{ Content: &RepositoryContent{ - Type: String("type"), - Target: String("target"), - Encoding: String("encoding"), - Size: Int(1), - Name: String("name"), - Path: String("path"), - Content: String("content"), - SHA: String("sha"), - URL: String("url"), - GitURL: String("gurl"), - HTMLURL: String("hurl"), - DownloadURL: String("durl"), - SubmoduleGitURL: String("smgurl"), + Type: Ptr("type"), + Target: Ptr("target"), + Encoding: Ptr("encoding"), + Size: Ptr(1), + Name: Ptr("name"), + Path: Ptr("path"), + Content: Ptr("content"), + SHA: Ptr("sha"), + URL: Ptr("url"), + GitURL: Ptr("gurl"), + HTMLURL: Ptr("hurl"), + DownloadURL: Ptr("durl"), + SubmoduleGitURL: Ptr("smgurl"), }, Commit: Commit{ - SHA: String("s"), + SHA: Ptr("s"), Author: &CommitAuthor{ Date: &Timestamp{referenceTime}, - Name: String("n"), - Email: String("e"), - Login: String("u"), + Name: Ptr("n"), + Email: Ptr("e"), + Login: Ptr("u"), }, Committer: &CommitAuthor{ Date: &Timestamp{referenceTime}, - Name: String("n"), - Email: String("e"), - Login: String("u"), + Name: Ptr("n"), + Email: Ptr("e"), + Login: Ptr("u"), }, - Message: String("m"), + Message: Ptr("m"), Tree: &Tree{ - SHA: String("s"), + SHA: Ptr("s"), Entries: []*TreeEntry{{ - SHA: String("s"), - Path: String("p"), - Mode: String("m"), - Type: String("t"), - Size: Int(1), - Content: String("c"), - URL: String("u"), + SHA: Ptr("s"), + Path: Ptr("p"), + Mode: Ptr("m"), + Type: Ptr("t"), + Size: Ptr(1), + Content: Ptr("c"), + URL: Ptr("u"), }}, - Truncated: Bool(false), + Truncated: Ptr(false), }, Parents: nil, Stats: &CommitStats{ - Additions: Int(1), - Deletions: Int(1), - Total: Int(1), + Additions: Ptr(1), + Deletions: Ptr(1), + Total: Ptr(1), }, - HTMLURL: String("h"), - URL: String("u"), + HTMLURL: Ptr("h"), + URL: Ptr("u"), Verification: &SignatureVerification{ - Verified: Bool(false), - Reason: String("r"), - Signature: String("s"), - Payload: String("p"), + Verified: Ptr(false), + Reason: Ptr("r"), + Signature: Ptr("s"), + Payload: Ptr("p"), }, - NodeID: String("n"), - CommentCount: Int(1), + NodeID: Ptr("n"), + CommentCount: Ptr(1), }, } @@ -984,21 +984,21 @@ func TestRepositoryContentFileOptions_Marshal(t *testing.T) { testJSONMarshal(t, &RepositoryContentFileOptions{}, "{}") r := &RepositoryContentFileOptions{ - Message: String("type"), + Message: Ptr("type"), Content: []byte{1}, - SHA: String("type"), - Branch: String("type"), + SHA: Ptr("type"), + Branch: Ptr("type"), Author: &CommitAuthor{ Date: &Timestamp{referenceTime}, - Name: String("name"), - Email: String("email"), - Login: String("login"), + Name: Ptr("name"), + Email: Ptr("email"), + Login: Ptr("login"), }, Committer: &CommitAuthor{ Date: &Timestamp{referenceTime}, - Name: String("name"), - Email: String("email"), - Login: String("login"), + Name: Ptr("name"), + Email: Ptr("email"), + Login: Ptr("login"), }, } diff --git a/github/repos_deployment_branch_policies_test.go b/github/repos_deployment_branch_policies_test.go index 355bcb442e4..bbf4499cf9c 100644 --- a/github/repos_deployment_branch_policies_test.go +++ b/github/repos_deployment_branch_policies_test.go @@ -29,10 +29,10 @@ func TestRepositoriesService_ListDeploymentBranchPolicies(t *testing.T) { want := &DeploymentBranchPolicyResponse{ BranchPolicies: []*DeploymentBranchPolicy{ - {ID: Int64(1)}, - {ID: Int64(2)}, + {ID: Ptr(int64(1))}, + {ID: Ptr(int64(2))}, }, - TotalCount: Int(2), + TotalCount: Ptr(2), } if !reflect.DeepEqual(got, want) { t.Errorf("Repositories.ListDeploymentBranchPolicies = %+v, want %+v", got, want) @@ -62,7 +62,7 @@ func TestRepositoriesService_GetDeploymentBranchPolicy(t *testing.T) { t.Errorf("Repositories.GetDeploymentBranchPolicy returned error: %v", err) } - want := &DeploymentBranchPolicy{ID: Int64(1)} + want := &DeploymentBranchPolicy{ID: Ptr(int64(1))} if !reflect.DeepEqual(got, want) { t.Errorf("Repositories.GetDeploymentBranchPolicy = %+v, want %+v", got, want) } @@ -87,19 +87,19 @@ func TestRepositoriesService_CreateDeploymentBranchPolicy(t *testing.T) { }) ctx := context.Background() - got, _, err := client.Repositories.CreateDeploymentBranchPolicy(ctx, "o", "r", "e", &DeploymentBranchPolicyRequest{Name: String("n"), Type: String("branch")}) + got, _, err := client.Repositories.CreateDeploymentBranchPolicy(ctx, "o", "r", "e", &DeploymentBranchPolicyRequest{Name: Ptr("n"), Type: Ptr("branch")}) if err != nil { t.Errorf("Repositories.CreateDeploymentBranchPolicy returned error: %v", err) } - want := &DeploymentBranchPolicy{ID: Int64(1), Type: String("branch")} + want := &DeploymentBranchPolicy{ID: Ptr(int64(1)), Type: Ptr("branch")} if !reflect.DeepEqual(got, want) { t.Errorf("Repositories.CreateDeploymentBranchPolicy = %+v, want %+v", got, want) } const methodName = "CreateDeploymentBranchPolicy" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.CreateDeploymentBranchPolicy(ctx, "o", "r", "e", &DeploymentBranchPolicyRequest{Name: String("n")}) + got, resp, err := client.Repositories.CreateDeploymentBranchPolicy(ctx, "o", "r", "e", &DeploymentBranchPolicyRequest{Name: Ptr("n")}) if got != nil { t.Errorf("got non-nil Repositories.CreateDeploymentBranchPolicy response: %+v", got) } @@ -117,19 +117,19 @@ func TestRepositoriesService_UpdateDeploymentBranchPolicy(t *testing.T) { }) ctx := context.Background() - got, _, err := client.Repositories.UpdateDeploymentBranchPolicy(ctx, "o", "r", "e", 1, &DeploymentBranchPolicyRequest{Name: String("n")}) + got, _, err := client.Repositories.UpdateDeploymentBranchPolicy(ctx, "o", "r", "e", 1, &DeploymentBranchPolicyRequest{Name: Ptr("n")}) if err != nil { t.Errorf("Repositories.UpdateDeploymentBranchPolicy returned error: %v", err) } - want := &DeploymentBranchPolicy{ID: Int64(1)} + want := &DeploymentBranchPolicy{ID: Ptr(int64(1))} if !reflect.DeepEqual(got, want) { t.Errorf("Repositories.UpdateDeploymentBranchPolicy = %+v, want %+v", got, want) } const methodName = "UpdateDeploymentBranchPolicy" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.UpdateDeploymentBranchPolicy(ctx, "o", "r", "e", 1, &DeploymentBranchPolicyRequest{Name: String("n")}) + got, resp, err := client.Repositories.UpdateDeploymentBranchPolicy(ctx, "o", "r", "e", 1, &DeploymentBranchPolicyRequest{Name: Ptr("n")}) if got != nil { t.Errorf("got non-nil Repositories.UpdateDeploymentBranchPolicy response: %+v", got) } diff --git a/github/repos_deployment_protection_rules_test.go b/github/repos_deployment_protection_rules_test.go index 5677d5f8afc..d17f0695a0c 100644 --- a/github/repos_deployment_protection_rules_test.go +++ b/github/repos_deployment_protection_rules_test.go @@ -33,10 +33,10 @@ func TestRepositoriesService_GetAllDeploymentProtectionRules(t *testing.T) { want := &ListDeploymentProtectionRuleResponse{ ProtectionRules: []*CustomDeploymentProtectionRule{ - {ID: Int64(3), NodeID: String("IEH37kRlcGxveW1lbnRTdGF0ddiv"), Enabled: Bool(true), App: &CustomDeploymentProtectionRuleApp{ID: Int64(1), NodeID: String("GHT58kRlcGxveW1lbnRTdTY!bbcy"), Slug: String("a-custom-app"), IntegrationURL: String("https://api.github.com/apps/a-custom-app")}}, - {ID: Int64(4), NodeID: String("MDE2OkRlcGxveW1lbnRTdHJ41128"), Enabled: Bool(true), App: &CustomDeploymentProtectionRuleApp{ID: Int64(1), NodeID: String("UHVE67RlcGxveW1lbnRTdTY!jfeuy"), Slug: String("another-custom-app"), IntegrationURL: String("https://api.github.com/apps/another-custom-app")}}, + {ID: Ptr(int64(3)), NodeID: Ptr("IEH37kRlcGxveW1lbnRTdGF0ddiv"), Enabled: Ptr(true), App: &CustomDeploymentProtectionRuleApp{ID: Ptr(int64(1)), NodeID: Ptr("GHT58kRlcGxveW1lbnRTdTY!bbcy"), Slug: Ptr("a-custom-app"), IntegrationURL: Ptr("https://api.github.com/apps/a-custom-app")}}, + {ID: Ptr(int64(4)), NodeID: Ptr("MDE2OkRlcGxveW1lbnRTdHJ41128"), Enabled: Ptr(true), App: &CustomDeploymentProtectionRuleApp{ID: Ptr(int64(1)), NodeID: Ptr("UHVE67RlcGxveW1lbnRTdTY!jfeuy"), Slug: Ptr("another-custom-app"), IntegrationURL: Ptr("https://api.github.com/apps/another-custom-app")}}, }, - TotalCount: Int(2), + TotalCount: Ptr(2), } if !reflect.DeepEqual(got, want) { t.Errorf("Repositories.GetAllDeploymentProtectionRules = %+v, want %+v", got, want) @@ -57,7 +57,7 @@ func TestRepositoriesService_CreateCustomDeploymentProtectionRule(t *testing.T) client, mux, _ := setup(t) input := &CustomDeploymentProtectionRuleRequest{ - IntegrationID: Int64(5), + IntegrationID: Ptr(int64(5)), } mux.HandleFunc("/repos/o/r/environments/e/deployment_protection_rules", func(w http.ResponseWriter, r *http.Request) { @@ -80,14 +80,14 @@ func TestRepositoriesService_CreateCustomDeploymentProtectionRule(t *testing.T) } want := &CustomDeploymentProtectionRule{ - ID: Int64(3), - NodeID: String("IEH37kRlcGxveW1lbnRTdGF0ddiv"), - Enabled: Bool(true), + ID: Ptr(int64(3)), + NodeID: Ptr("IEH37kRlcGxveW1lbnRTdGF0ddiv"), + Enabled: Ptr(true), App: &CustomDeploymentProtectionRuleApp{ - ID: Int64(1), - NodeID: String("GHT58kRlcGxveW1lbnRTdTY!bbcy"), - Slug: String("a-custom-app"), - IntegrationURL: String("https://api.github.com/apps/a-custom-app"), + ID: Ptr(int64(1)), + NodeID: Ptr("GHT58kRlcGxveW1lbnRTdTY!bbcy"), + Slug: Ptr("a-custom-app"), + IntegrationURL: Ptr("https://api.github.com/apps/a-custom-app"), }, } if !reflect.DeepEqual(got, want) { @@ -125,10 +125,10 @@ func TestRepositoriesService_ListCustomDeploymentRuleIntegrations(t *testing.T) } want := &ListCustomDeploymentRuleIntegrationsResponse{ - TotalCount: Int(2), + TotalCount: Ptr(2), AvailableIntegrations: []*CustomDeploymentProtectionRuleApp{ - {ID: Int64(1), NodeID: String("GHT58kRlcGxveW1lbnRTdTY!bbcy"), Slug: String("a-custom-app"), IntegrationURL: String("https://api.github.com/apps/a-custom-app")}, - {ID: Int64(2), NodeID: String("UHVE67RlcGxveW1lbnRTdTY!jfeuy"), Slug: String("another-custom-app"), IntegrationURL: String("https://api.github.com/apps/another-custom-app")}, + {ID: Ptr(int64(1)), NodeID: Ptr("GHT58kRlcGxveW1lbnRTdTY!bbcy"), Slug: Ptr("a-custom-app"), IntegrationURL: Ptr("https://api.github.com/apps/a-custom-app")}, + {ID: Ptr(int64(2)), NodeID: Ptr("UHVE67RlcGxveW1lbnRTdTY!jfeuy"), Slug: Ptr("another-custom-app"), IntegrationURL: Ptr("https://api.github.com/apps/another-custom-app")}, }, } if !reflect.DeepEqual(got, want) { @@ -161,14 +161,14 @@ func TestRepositoriesService_GetCustomDeploymentProtectionRule(t *testing.T) { } want := &CustomDeploymentProtectionRule{ - ID: Int64(1), - NodeID: String("IEH37kRlcGxveW1lbnRTdGF0ddiv"), - Enabled: Bool(true), + ID: Ptr(int64(1)), + NodeID: Ptr("IEH37kRlcGxveW1lbnRTdGF0ddiv"), + Enabled: Ptr(true), App: &CustomDeploymentProtectionRuleApp{ - ID: Int64(1), - NodeID: String("GHT58kRlcGxveW1lbnRTdTY!bbcy"), - Slug: String("a-custom-app"), - IntegrationURL: String("https://api.github.com/apps/a-custom-app"), + ID: Ptr(int64(1)), + NodeID: Ptr("GHT58kRlcGxveW1lbnRTdTY!bbcy"), + Slug: Ptr("a-custom-app"), + IntegrationURL: Ptr("https://api.github.com/apps/a-custom-app"), }, } diff --git a/github/repos_deployments_test.go b/github/repos_deployments_test.go index 722d31d9037..cc451e34236 100644 --- a/github/repos_deployments_test.go +++ b/github/repos_deployments_test.go @@ -33,7 +33,7 @@ func TestRepositoriesService_ListDeployments(t *testing.T) { t.Errorf("Repositories.ListDeployments returned error: %v", err) } - want := []*Deployment{{ID: Int64(1)}, {ID: Int64(2)}} + want := []*Deployment{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}} if !cmp.Equal(deployments, want) { t.Errorf("Repositories.ListDeployments returned %+v, want %+v", deployments, want) } @@ -68,7 +68,7 @@ func TestRepositoriesService_GetDeployment(t *testing.T) { t.Errorf("Repositories.GetDeployment returned error: %v", err) } - want := &Deployment{ID: Int64(3)} + want := &Deployment{ID: Ptr(int64(3))} if !cmp.Equal(deployment, want) { t.Errorf("Repositories.GetDeployment returned %+v, want %+v", deployment, want) @@ -93,7 +93,7 @@ func TestRepositoriesService_CreateDeployment(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &DeploymentRequest{Ref: String("1111"), Task: String("deploy"), TransientEnvironment: Bool(true)} + input := &DeploymentRequest{Ref: Ptr("1111"), Task: Ptr("deploy"), TransientEnvironment: Ptr(true)} mux.HandleFunc("/repos/o/r/deployments", func(w http.ResponseWriter, r *http.Request) { v := new(DeploymentRequest) @@ -115,7 +115,7 @@ func TestRepositoriesService_CreateDeployment(t *testing.T) { t.Errorf("Repositories.CreateDeployment returned error: %v", err) } - want := &Deployment{Ref: String("1111"), Task: String("deploy")} + want := &Deployment{Ref: Ptr("1111"), Task: Ptr("deploy")} if !cmp.Equal(deployment, want) { t.Errorf("Repositories.CreateDeployment returned %+v, want %+v", deployment, want) } @@ -191,7 +191,7 @@ func TestRepositoriesService_ListDeploymentStatuses(t *testing.T) { t.Errorf("Repositories.ListDeploymentStatuses returned error: %v", err) } - want := []*DeploymentStatus{{ID: Int64(1)}, {ID: Int64(2)}} + want := []*DeploymentStatus{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}} if !cmp.Equal(statutses, want) { t.Errorf("Repositories.ListDeploymentStatuses returned %+v, want %+v", statutses, want) } @@ -228,7 +228,7 @@ func TestRepositoriesService_GetDeploymentStatus(t *testing.T) { t.Errorf("Repositories.GetDeploymentStatus returned error: %v", err) } - want := &DeploymentStatus{ID: Int64(4)} + want := &DeploymentStatus{ID: Ptr(int64(4))} if !cmp.Equal(deploymentStatus, want) { t.Errorf("Repositories.GetDeploymentStatus returned %+v, want %+v", deploymentStatus, want) } @@ -252,7 +252,7 @@ func TestRepositoriesService_CreateDeploymentStatus(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &DeploymentStatusRequest{State: String("inactive"), Description: String("deploy"), AutoInactive: Bool(false)} + input := &DeploymentStatusRequest{State: Ptr("inactive"), Description: Ptr("deploy"), AutoInactive: Ptr(false)} mux.HandleFunc("/repos/o/r/deployments/1/statuses", func(w http.ResponseWriter, r *http.Request) { v := new(DeploymentStatusRequest) @@ -274,7 +274,7 @@ func TestRepositoriesService_CreateDeploymentStatus(t *testing.T) { t.Errorf("Repositories.CreateDeploymentStatus returned error: %v", err) } - want := &DeploymentStatus{State: String("inactive"), Description: String("deploy")} + want := &DeploymentStatus{State: Ptr("inactive"), Description: Ptr("deploy")} if !cmp.Equal(deploymentStatus, want) { t.Errorf("Repositories.CreateDeploymentStatus returned %+v, want %+v", deploymentStatus, want) } @@ -299,12 +299,12 @@ func TestDeploymentStatusRequest_Marshal(t *testing.T) { testJSONMarshal(t, &DeploymentStatusRequest{}, "{}") r := &DeploymentStatusRequest{ - State: String("state"), - LogURL: String("logurl"), - Description: String("desc"), - Environment: String("env"), - EnvironmentURL: String("eurl"), - AutoInactive: Bool(false), + State: Ptr("state"), + LogURL: Ptr("logurl"), + Description: Ptr("desc"), + Environment: Ptr("env"), + EnvironmentURL: Ptr("eurl"), + AutoInactive: Ptr(false), } want := `{ @@ -324,39 +324,39 @@ func TestDeploymentStatus_Marshal(t *testing.T) { testJSONMarshal(t, &DeploymentStatus{}, "{}") r := &DeploymentStatus{ - ID: Int64(1), - State: String("state"), + ID: Ptr(int64(1)), + State: Ptr("state"), Creator: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - Description: String("desc"), - Environment: String("env"), - NodeID: String("nid"), + Description: Ptr("desc"), + Environment: Ptr("env"), + NodeID: Ptr("nid"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - TargetURL: String("turl"), - DeploymentURL: String("durl"), - RepositoryURL: String("rurl"), - EnvironmentURL: String("eurl"), - LogURL: String("lurl"), - URL: String("url"), + TargetURL: Ptr("turl"), + DeploymentURL: Ptr("durl"), + RepositoryURL: Ptr("rurl"), + EnvironmentURL: Ptr("eurl"), + LogURL: Ptr("lurl"), + URL: Ptr("url"), } want := `{ @@ -403,15 +403,15 @@ func TestDeploymentRequest_Marshal(t *testing.T) { testJSONMarshal(t, &DeploymentRequest{}, "{}") r := &DeploymentRequest{ - Ref: String("ref"), - Task: String("task"), - AutoMerge: Bool(false), + Ref: Ptr("ref"), + Task: Ptr("task"), + AutoMerge: Ptr(false), RequiredContexts: &[]string{"s"}, Payload: "payload", - Environment: String("environment"), - Description: String("description"), - TransientEnvironment: Bool(false), - ProductionEnvironment: Bool(false), + Environment: Ptr("environment"), + Description: Ptr("description"), + TransientEnvironment: Ptr(false), + ProductionEnvironment: Ptr(false), } want := `{ @@ -437,39 +437,39 @@ func TestDeployment_Marshal(t *testing.T) { jsonMsg, _ := json.Marshal(str) r := &Deployment{ - URL: String("url"), - ID: Int64(1), - SHA: String("sha"), - Ref: String("ref"), - Task: String("task"), + URL: Ptr("url"), + ID: Ptr(int64(1)), + SHA: Ptr("sha"), + Ref: Ptr("ref"), + Task: Ptr("task"), Payload: jsonMsg, - Environment: String("env"), - Description: String("desc"), + Environment: Ptr("env"), + Description: Ptr("desc"), Creator: &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - StatusesURL: String("surl"), - RepositoryURL: String("rurl"), - NodeID: String("nid"), + StatusesURL: Ptr("surl"), + RepositoryURL: Ptr("rurl"), + NodeID: Ptr("nid"), } want := `{ diff --git a/github/repos_environments.go b/github/repos_environments.go index ed81e3a1f95..d3e34fa8f80 100644 --- a/github/repos_environments.go +++ b/github/repos_environments.go @@ -157,10 +157,10 @@ func (s *RepositoriesService) GetEnvironment(ctx context.Context, owner, repo, n func (c *CreateUpdateEnvironment) MarshalJSON() ([]byte, error) { type Alias CreateUpdateEnvironment if c.WaitTimer == nil { - c.WaitTimer = Int(0) + c.WaitTimer = Ptr(0) } if c.CanAdminsBypass == nil { - c.CanAdminsBypass = Bool(true) + c.CanAdminsBypass = Ptr(true) } return json.Marshal(&struct { *Alias diff --git a/github/repos_environments_test.go b/github/repos_environments_test.go index 34b02ca8637..438ab71c288 100644 --- a/github/repos_environments_test.go +++ b/github/repos_environments_test.go @@ -24,17 +24,17 @@ func TestRequiredReviewer_UnmarshalJSON(t *testing.T) { }{ "User Reviewer": { data: []byte(`[{"type": "User", "reviewer": {"id": 1,"login": "octocat"}}]`), - wantRule: []*RequiredReviewer{{Type: String("User"), Reviewer: &User{ID: Int64(1), Login: String("octocat")}}}, + wantRule: []*RequiredReviewer{{Type: Ptr("User"), Reviewer: &User{ID: Ptr(int64(1)), Login: Ptr("octocat")}}}, wantError: false, }, "Team Reviewer": { data: []byte(`[{"type": "Team", "reviewer": {"id": 1, "name": "Justice League"}}]`), - wantRule: []*RequiredReviewer{{Type: String("Team"), Reviewer: &Team{ID: Int64(1), Name: String("Justice League")}}}, + wantRule: []*RequiredReviewer{{Type: Ptr("Team"), Reviewer: &Team{ID: Ptr(int64(1)), Name: Ptr("Justice League")}}}, wantError: false, }, "Both Types Reviewer": { data: []byte(`[{"type": "User", "reviewer": {"id": 1,"login": "octocat"}},{"type": "Team", "reviewer": {"id": 1, "name": "Justice League"}}]`), - wantRule: []*RequiredReviewer{{Type: String("User"), Reviewer: &User{ID: Int64(1), Login: String("octocat")}}, {Type: String("Team"), Reviewer: &Team{ID: Int64(1), Name: String("Justice League")}}}, + wantRule: []*RequiredReviewer{{Type: Ptr("User"), Reviewer: &User{ID: Ptr(int64(1)), Login: Ptr("octocat")}}, {Type: Ptr("Team"), Reviewer: &Team{ID: Ptr(int64(1)), Name: Ptr("Justice League")}}}, wantError: false, }, "Empty JSON Object": { @@ -54,12 +54,12 @@ func TestRequiredReviewer_UnmarshalJSON(t *testing.T) { }, "Wrong ID Type in User Object": { data: []byte(`[{"type": "User", "reviewer": {"id": "string"}}]`), - wantRule: []*RequiredReviewer{{Type: String("User"), Reviewer: nil}}, + wantRule: []*RequiredReviewer{{Type: Ptr("User"), Reviewer: nil}}, wantError: true, }, "Wrong ID Type in Team Object": { data: []byte(`[{"type": "Team", "reviewer": {"id": "string"}}]`), - wantRule: []*RequiredReviewer{{Type: String("Team"), Reviewer: nil}}, + wantRule: []*RequiredReviewer{{Type: Ptr("Team"), Reviewer: nil}}, wantError: true, }, "Wrong Type of Reviewer": { @@ -123,7 +123,7 @@ func TestRepositoriesService_ListEnvironments(t *testing.T) { if err != nil { t.Errorf("Repositories.ListEnvironments returned error: %v", err) } - want := &EnvResponse{TotalCount: Int(1), Environments: []*Environment{{ID: Int64(1)}, {ID: Int64(2)}}} + want := &EnvResponse{TotalCount: Ptr(1), Environments: []*Environment{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}}} if !cmp.Equal(environments, want) { t.Errorf("Repositories.ListEnvironments returned %+v, want %+v", environments, want) } @@ -158,7 +158,7 @@ func TestRepositoriesService_GetEnvironment(t *testing.T) { t.Errorf("Repositories.GetEnvironment returned error: %v\n%v", err, resp.Body) } - want := &Environment{ID: Int64(1), Name: String("staging"), DeploymentBranchPolicy: &BranchPolicy{ProtectedBranches: Bool(true), CustomBranchPolicies: Bool(false)}, CanAdminsBypass: Bool(false)} + want := &Environment{ID: Ptr(int64(1)), Name: Ptr("staging"), DeploymentBranchPolicy: &BranchPolicy{ProtectedBranches: Ptr(true), CustomBranchPolicies: Ptr(false)}, CanAdminsBypass: Ptr(false)} if !cmp.Equal(release, want) { t.Errorf("Repositories.GetEnvironment returned %+v, want %+v", release, want) } @@ -183,7 +183,7 @@ func TestRepositoriesService_CreateEnvironment(t *testing.T) { client, mux, _ := setup(t) input := &CreateUpdateEnvironment{ - WaitTimer: Int(30), + WaitTimer: Ptr(30), } mux.HandleFunc("/repos/o/r/environments/e", func(w http.ResponseWriter, r *http.Request) { @@ -191,7 +191,7 @@ func TestRepositoriesService_CreateEnvironment(t *testing.T) { assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PUT") - want := &CreateUpdateEnvironment{WaitTimer: Int(30), CanAdminsBypass: Bool(true)} + want := &CreateUpdateEnvironment{WaitTimer: Ptr(30), CanAdminsBypass: Ptr(true)} if !cmp.Equal(v, want) { t.Errorf("Request body = %+v, want %+v", v, want) } @@ -204,7 +204,7 @@ func TestRepositoriesService_CreateEnvironment(t *testing.T) { t.Errorf("Repositories.CreateUpdateEnvironment returned error: %v", err) } - want := &Environment{ID: Int64(1), Name: String("staging"), ProtectionRules: []*ProtectionRule{{ID: Int64(1), Type: String("wait_timer"), WaitTimer: Int(30)}}} + want := &Environment{ID: Ptr(int64(1)), Name: Ptr("staging"), ProtectionRules: []*ProtectionRule{{ID: Ptr(int64(1)), Type: Ptr("wait_timer"), WaitTimer: Ptr(30)}}} if !cmp.Equal(release, want) { t.Errorf("Repositories.CreateUpdateEnvironment returned %+v, want %+v", release, want) } @@ -254,7 +254,7 @@ func TestRepositoriesService_CreateEnvironment_noEnterprise(t *testing.T) { t.Errorf("Repositories.CreateUpdateEnvironment returned error: %v", err) } - want := &Environment{ID: Int64(1), Name: String("staging"), ProtectionRules: []*ProtectionRule{}} + want := &Environment{ID: Ptr(int64(1)), Name: Ptr("staging"), ProtectionRules: []*ProtectionRule{}} if !cmp.Equal(release, want) { t.Errorf("Repositories.CreateUpdateEnvironment returned %+v, want %+v", release, want) } @@ -266,8 +266,8 @@ func TestRepositoriesService_createNewEnvNoEnterprise(t *testing.T) { input := &CreateUpdateEnvironment{ DeploymentBranchPolicy: &BranchPolicy{ - ProtectedBranches: Bool(true), - CustomBranchPolicies: Bool(false), + ProtectedBranches: Ptr(true), + CustomBranchPolicies: Ptr(false), }, } @@ -278,8 +278,8 @@ func TestRepositoriesService_createNewEnvNoEnterprise(t *testing.T) { testMethod(t, r, "PUT") want := &createUpdateEnvironmentNoEnterprise{ DeploymentBranchPolicy: &BranchPolicy{ - ProtectedBranches: Bool(true), - CustomBranchPolicies: Bool(false), + ProtectedBranches: Ptr(true), + CustomBranchPolicies: Ptr(false), }, } if !cmp.Equal(v, want) { @@ -295,18 +295,18 @@ func TestRepositoriesService_createNewEnvNoEnterprise(t *testing.T) { } want := &Environment{ - ID: Int64(1), - Name: String("staging"), + ID: Ptr(int64(1)), + Name: Ptr("staging"), ProtectionRules: []*ProtectionRule{ { - ID: Int64(1), - NodeID: String("id"), - Type: String("branch_policy"), + ID: Ptr(int64(1)), + NodeID: Ptr("id"), + Type: Ptr("branch_policy"), }, }, DeploymentBranchPolicy: &BranchPolicy{ - ProtectedBranches: Bool(true), - CustomBranchPolicies: Bool(false), + ProtectedBranches: Ptr(true), + CustomBranchPolicies: Ptr(false), }, } if !cmp.Equal(release, want) { @@ -358,40 +358,40 @@ func TestRepoEnvironment_Marshal(t *testing.T) { testJSONMarshal(t, &EnvResponse{}, "{}") repoEnv := &EnvResponse{ - TotalCount: Int(1), + TotalCount: Ptr(1), Environments: []*Environment{ { - Owner: String("me"), - Repo: String("se"), - EnvironmentName: String("dev"), - WaitTimer: Int(123), + Owner: Ptr("me"), + Repo: Ptr("se"), + EnvironmentName: Ptr("dev"), + WaitTimer: Ptr(123), Reviewers: []*EnvReviewers{ { - Type: String("main"), - ID: Int64(1), + Type: Ptr("main"), + ID: Ptr(int64(1)), }, { - Type: String("rev"), - ID: Int64(2), + Type: Ptr("rev"), + ID: Ptr(int64(2)), }, }, DeploymentBranchPolicy: &BranchPolicy{ - ProtectedBranches: Bool(false), - CustomBranchPolicies: Bool(false), + ProtectedBranches: Ptr(false), + CustomBranchPolicies: Ptr(false), }, - ID: Int64(2), - NodeID: String("star"), - Name: String("eg"), - URL: String("https://hey.in"), - HTMLURL: String("htmlurl"), + ID: Ptr(int64(2)), + NodeID: Ptr("star"), + Name: Ptr("eg"), + URL: Ptr("https://hey.in"), + HTMLURL: Ptr("htmlurl"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, ProtectionRules: []*ProtectionRule{ { - ID: Int64(21), - NodeID: String("mnb"), - Type: String("ewq"), - WaitTimer: Int(9090), + ID: Ptr(int64(21)), + NodeID: Ptr("mnb"), + Type: Ptr("ewq"), + WaitTimer: Ptr(9090), }, }, }, @@ -447,8 +447,8 @@ func TestEnvReviewers_Marshal(t *testing.T) { testJSONMarshal(t, &EnvReviewers{}, "{}") repoEnv := &EnvReviewers{ - Type: String("main"), - ID: Int64(1), + Type: Ptr("main"), + ID: Ptr(int64(1)), } want := `{ @@ -464,37 +464,37 @@ func TestEnvironment_Marshal(t *testing.T) { testJSONMarshal(t, &Environment{}, "{}") repoEnv := &Environment{ - Owner: String("o"), - Repo: String("r"), - EnvironmentName: String("e"), - WaitTimer: Int(123), + Owner: Ptr("o"), + Repo: Ptr("r"), + EnvironmentName: Ptr("e"), + WaitTimer: Ptr(123), Reviewers: []*EnvReviewers{ { - Type: String("main"), - ID: Int64(1), + Type: Ptr("main"), + ID: Ptr(int64(1)), }, { - Type: String("rev"), - ID: Int64(2), + Type: Ptr("rev"), + ID: Ptr(int64(2)), }, }, DeploymentBranchPolicy: &BranchPolicy{ - ProtectedBranches: Bool(false), - CustomBranchPolicies: Bool(false), + ProtectedBranches: Ptr(false), + CustomBranchPolicies: Ptr(false), }, - ID: Int64(2), - NodeID: String("star"), - Name: String("eg"), - URL: String("https://hey.in"), - HTMLURL: String("htmlurl"), + ID: Ptr(int64(2)), + NodeID: Ptr("star"), + Name: Ptr("eg"), + URL: Ptr("https://hey.in"), + HTMLURL: Ptr("htmlurl"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, ProtectionRules: []*ProtectionRule{ { - ID: Int64(21), - NodeID: String("mnb"), - Type: String("ewq"), - WaitTimer: Int(9090), + ID: Ptr(int64(21)), + NodeID: Ptr("mnb"), + Type: Ptr("ewq"), + WaitTimer: Ptr(9090), }, }, } @@ -543,8 +543,8 @@ func TestBranchPolicy_Marshal(t *testing.T) { testJSONMarshal(t, &BranchPolicy{}, "{}") bp := &BranchPolicy{ - ProtectedBranches: Bool(false), - CustomBranchPolicies: Bool(false), + ProtectedBranches: Ptr(false), + CustomBranchPolicies: Ptr(false), } want := `{ diff --git a/github/repos_forks_test.go b/github/repos_forks_test.go index ff7271b27c1..d90fbfd9a0d 100644 --- a/github/repos_forks_test.go +++ b/github/repos_forks_test.go @@ -38,7 +38,7 @@ func TestRepositoriesService_ListForks(t *testing.T) { t.Errorf("Repositories.ListForks returned error: %v", err) } - want := []*Repository{{ID: Int64(1)}, {ID: Int64(2)}} + want := []*Repository{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}} if !cmp.Equal(repos, want) { t.Errorf("Repositories.ListForks returned %+v, want %+v", repos, want) } @@ -84,7 +84,7 @@ func TestRepositoriesService_CreateFork(t *testing.T) { t.Errorf("Repositories.CreateFork returned error: %v", err) } - want := &Repository{ID: Int64(1)} + want := &Repository{ID: Ptr(int64(1))} if !cmp.Equal(repo, want) { t.Errorf("Repositories.CreateFork returned %+v, want %+v", repo, want) } @@ -123,7 +123,7 @@ func TestRepositoriesService_CreateFork_deferred(t *testing.T) { t.Errorf("Repositories.CreateFork returned error: %v (want AcceptedError)", err) } - want := &Repository{ID: Int64(1)} + want := &Repository{ID: Ptr(int64(1))} if !cmp.Equal(repo, want) { t.Errorf("Repositories.CreateFork returned %+v, want %+v", repo, want) } diff --git a/github/repos_hooks_configuration_test.go b/github/repos_hooks_configuration_test.go index c17e1004255..d3403193277 100644 --- a/github/repos_hooks_configuration_test.go +++ b/github/repos_hooks_configuration_test.go @@ -31,10 +31,10 @@ func TestRepositoriesService_GetHookConfiguration(t *testing.T) { } want := &HookConfig{ - ContentType: String("json"), - InsecureSSL: String("0"), - Secret: String("********"), - URL: String("https://example.com/webhook"), + ContentType: Ptr("json"), + InsecureSSL: Ptr("0"), + Secret: Ptr("********"), + URL: Ptr("https://example.com/webhook"), } if !cmp.Equal(config, want) { t.Errorf("Repositories.GetHookConfiguration returned %+v, want %+v", config, want) @@ -89,10 +89,10 @@ func TestRepositoriesService_EditHookConfiguration(t *testing.T) { } want := &HookConfig{ - ContentType: String("json"), - InsecureSSL: String("0"), - Secret: String("********"), - URL: String("https://example.com/webhook"), + ContentType: Ptr("json"), + InsecureSSL: Ptr("0"), + Secret: Ptr("********"), + URL: Ptr("https://example.com/webhook"), } if !cmp.Equal(config, want) { t.Errorf("Repositories.EditHookConfiguration returned %+v, want %+v", config, want) diff --git a/github/repos_hooks_deliveries_test.go b/github/repos_hooks_deliveries_test.go index 71a04077a13..b168964674b 100644 --- a/github/repos_hooks_deliveries_test.go +++ b/github/repos_hooks_deliveries_test.go @@ -34,7 +34,7 @@ func TestRepositoriesService_ListHookDeliveries(t *testing.T) { t.Errorf("Repositories.ListHookDeliveries returned error: %v", err) } - want := []*HookDelivery{{ID: Int64(1)}, {ID: Int64(2)}} + want := []*HookDelivery{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}} if d := cmp.Diff(hooks, want); d != "" { t.Errorf("Repositories.ListHooks want (-), got (+):\n%s", d) } @@ -78,7 +78,7 @@ func TestRepositoriesService_GetHookDelivery(t *testing.T) { t.Errorf("Repositories.GetHookDelivery returned error: %v", err) } - want := &HookDelivery{ID: Int64(1)} + want := &HookDelivery{ID: Ptr(int64(1))} if !cmp.Equal(hook, want) { t.Errorf("Repositories.GetHookDelivery returned %+v, want %+v", hook, want) } @@ -122,7 +122,7 @@ func TestRepositoriesService_RedeliverHookDelivery(t *testing.T) { t.Errorf("Repositories.RedeliverHookDelivery returned error: %v", err) } - want := &HookDelivery{ID: Int64(1)} + want := &HookDelivery{ID: Ptr(int64(1))} if !cmp.Equal(hook, want) { t.Errorf("Repositories.RedeliverHookDelivery returned %+v, want %+v", hook, want) } @@ -219,7 +219,7 @@ func TestHookDelivery_ParsePayload(t *testing.T) { p := json.RawMessage(bs) d := &HookDelivery{ - Event: String(evt), + Event: Ptr(evt), Request: &HookRequest{ RawPayload: &p, }, @@ -242,7 +242,7 @@ func TestHookDelivery_ParsePayload_invalidEvent(t *testing.T) { p := json.RawMessage(nil) d := &HookDelivery{ - Event: String("some_invalid_event"), + Event: Ptr("some_invalid_event"), Request: &HookRequest{ RawPayload: &p, }, @@ -259,7 +259,7 @@ func TestHookDelivery_ParsePayload_invalidPayload(t *testing.T) { p := json.RawMessage([]byte(`{"check_run":{"id":"invalid"}}`)) d := &HookDelivery{ - Event: String("check_run"), + Event: Ptr("check_run"), Request: &HookRequest{ RawPayload: &p, }, @@ -333,17 +333,17 @@ func TestHookDelivery_Marshal(t *testing.T) { jsonMsg, _ := json.Marshal(&header) r := &HookDelivery{ - ID: Int64(1), - GUID: String("guid"), + ID: Ptr(int64(1)), + GUID: Ptr("guid"), DeliveredAt: &Timestamp{referenceTime}, - Redelivery: Bool(true), - Duration: Float64(1), - Status: String("guid"), - StatusCode: Int(1), - Event: String("guid"), - Action: String("guid"), - InstallationID: Int64(1), - RepositoryID: Int64(1), + Redelivery: Ptr(true), + Duration: Ptr(1.0), + Status: Ptr("guid"), + StatusCode: Ptr(1), + Event: Ptr("guid"), + Action: Ptr("guid"), + InstallationID: Ptr(int64(1)), + RepositoryID: Ptr(int64(1)), Request: &HookRequest{ Headers: header, RawPayload: (*json.RawMessage)(&jsonMsg), diff --git a/github/repos_hooks_test.go b/github/repos_hooks_test.go index 27d81f4eaa7..17b13daadd4 100644 --- a/github/repos_hooks_test.go +++ b/github/repos_hooks_test.go @@ -40,7 +40,7 @@ func TestRepositoriesService_CreateHook(t *testing.T) { t.Errorf("Repositories.CreateHook returned error: %v", err) } - want := &Hook{ID: Int64(1)} + want := &Hook{ID: Ptr(int64(1))} if !cmp.Equal(hook, want) { t.Errorf("Repositories.CreateHook returned %+v, want %+v", hook, want) } @@ -78,7 +78,7 @@ func TestRepositoriesService_ListHooks(t *testing.T) { t.Errorf("Repositories.ListHooks returned error: %v", err) } - want := []*Hook{{ID: Int64(1)}, {ID: Int64(2)}} + want := []*Hook{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}} if !cmp.Equal(hooks, want) { t.Errorf("Repositories.ListHooks returned %+v, want %+v", hooks, want) } @@ -132,7 +132,7 @@ func TestRepositoriesService_GetHook(t *testing.T) { t.Errorf("Repositories.GetHook returned error: %v", err) } - want := &Hook{ID: Int64(1)} + want := &Hook{ID: Ptr(int64(1))} if !cmp.Equal(hook, want) { t.Errorf("Repositories.GetHook returned %+v, want %+v", hook, want) } @@ -185,7 +185,7 @@ func TestRepositoriesService_EditHook(t *testing.T) { t.Errorf("Repositories.EditHook returned error: %v", err) } - want := &Hook{ID: Int64(1)} + want := &Hook{ID: Ptr(int64(1))} if !cmp.Equal(hook, want) { t.Errorf("Repositories.EditHook returned %+v, want %+v", hook, want) } @@ -312,64 +312,64 @@ func TestBranchWebHookPayload_Marshal(t *testing.T) { testJSONMarshal(t, &WebHookPayload{}, "{}") v := &WebHookPayload{ - Action: String("action"), - After: String("after"), - Before: String("before"), + Action: Ptr("action"), + After: Ptr("after"), + Before: Ptr("before"), Commits: []*WebHookCommit{ { Added: []string{"1", "2", "3"}, Author: &WebHookAuthor{ - Email: String("abc@gmail.com"), - Name: String("abc"), - Login: String("abc_12"), + Email: Ptr("abc@gmail.com"), + Name: Ptr("abc"), + Login: Ptr("abc_12"), }, Committer: &WebHookAuthor{ - Email: String("abc@gmail.com"), - Name: String("abc"), - Login: String("abc_12"), + Email: Ptr("abc@gmail.com"), + Name: Ptr("abc"), + Login: Ptr("abc_12"), }, - ID: String("1"), - Message: String("WebHookCommit"), + ID: Ptr("1"), + Message: Ptr("WebHookCommit"), Modified: []string{"abc", "efg", "erd"}, Removed: []string{"cmd", "rti", "duv"}, }, }, - Compare: String("compare"), - Created: Bool(true), - Forced: Bool(false), + Compare: Ptr("compare"), + Created: Ptr(true), + Forced: Ptr(false), HeadCommit: &WebHookCommit{ Added: []string{"1", "2", "3"}, Author: &WebHookAuthor{ - Email: String("abc@gmail.com"), - Name: String("abc"), - Login: String("abc_12"), + Email: Ptr("abc@gmail.com"), + Name: Ptr("abc"), + Login: Ptr("abc_12"), }, Committer: &WebHookAuthor{ - Email: String("abc@gmail.com"), - Name: String("abc"), - Login: String("abc_12"), + Email: Ptr("abc@gmail.com"), + Name: Ptr("abc"), + Login: Ptr("abc_12"), }, - ID: String("1"), - Message: String("WebHookCommit"), + ID: Ptr("1"), + Message: Ptr("WebHookCommit"), Modified: []string{"abc", "efg", "erd"}, Removed: []string{"cmd", "rti", "duv"}, }, Installation: &Installation{ - ID: Int64(12), + ID: Ptr(int64(12)), }, Organization: &Organization{ - ID: Int64(22), + ID: Ptr(int64(22)), }, Pusher: &CommitAuthor{ - Login: String("rd@yahoo.com"), + Login: Ptr("rd@yahoo.com"), }, Repo: &PushEventRepository{ - ID: Int64(321), - NodeID: String("node_321"), + ID: Ptr(int64(321)), + NodeID: Ptr("node_321"), }, Sender: &User{ - Login: String("st@gmail.com"), - ID: Int64(202), + Login: Ptr("st@gmail.com"), + ID: Ptr(int64(202)), }, } @@ -443,9 +443,9 @@ func TestBranchWebHookAuthor_Marshal(t *testing.T) { testJSONMarshal(t, &WebHookAuthor{}, "{}") v := &WebHookAuthor{ - Email: String("abc@gmail.com"), - Name: String("abc"), - Login: String("abc_12"), + Email: Ptr("abc@gmail.com"), + Name: Ptr("abc"), + Login: Ptr("abc_12"), } want := `{ @@ -464,17 +464,17 @@ func TestBranchWebHookCommit_Marshal(t *testing.T) { v := &WebHookCommit{ Added: []string{"1", "2", "3"}, Author: &WebHookAuthor{ - Email: String("abc@gmail.com"), - Name: String("abc"), - Login: String("abc_12"), + Email: Ptr("abc@gmail.com"), + Name: Ptr("abc"), + Login: Ptr("abc_12"), }, Committer: &WebHookAuthor{ - Email: String("abc@gmail.com"), - Name: String("abc"), - Login: String("abc_12"), + Email: Ptr("abc@gmail.com"), + Name: Ptr("abc"), + Login: Ptr("abc_12"), }, - ID: String("1"), - Message: String("WebHookCommit"), + ID: Ptr("1"), + Message: Ptr("WebHookCommit"), Modified: []string{"abc", "efg", "erd"}, Removed: []string{"cmd", "rti", "duv"}, } @@ -507,8 +507,8 @@ func TestBranchCreateHookRequest_Marshal(t *testing.T) { v := &createHookRequest{ Name: "abc", Events: []string{"1", "2", "3"}, - Active: Bool(true), - Config: &HookConfig{ContentType: String("json")}, + Active: Ptr(true), + Config: &HookConfig{ContentType: Ptr("json")}, } want := `{ @@ -530,18 +530,18 @@ func TestBranchHook_Marshal(t *testing.T) { v := &Hook{ CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - URL: String("url"), - ID: Int64(1), - Type: String("type"), - Name: String("name"), - TestURL: String("testurl"), - PingURL: String("pingurl"), + URL: Ptr("url"), + ID: Ptr(int64(1)), + Type: Ptr("type"), + Name: Ptr("name"), + TestURL: Ptr("testurl"), + PingURL: Ptr("pingurl"), LastResponse: map[string]interface{}{ "item": "item", }, - Config: &HookConfig{ContentType: String("json")}, + Config: &HookConfig{ContentType: Ptr("json")}, Events: []string{"1", "2", "3"}, - Active: Bool(true), + Active: Ptr(true), } want := `{ diff --git a/github/repos_invitations_test.go b/github/repos_invitations_test.go index b5030cac1dd..06ca3e8bed7 100644 --- a/github/repos_invitations_test.go +++ b/github/repos_invitations_test.go @@ -31,7 +31,7 @@ func TestRepositoriesService_ListInvitations(t *testing.T) { t.Errorf("Repositories.ListInvitations returned error: %v", err) } - want := []*RepositoryInvitation{{ID: Int64(1)}, {ID: Int64(2)}} + want := []*RepositoryInvitation{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}} if !cmp.Equal(got, want) { t.Errorf("Repositories.ListInvitations = %+v, want %+v", got, want) } @@ -92,7 +92,7 @@ func TestRepositoriesService_UpdateInvitation(t *testing.T) { t.Errorf("Repositories.UpdateInvitation returned error: %v", err) } - want := &RepositoryInvitation{ID: Int64(1)} + want := &RepositoryInvitation{ID: Ptr(int64(1))} if !cmp.Equal(got, want) { t.Errorf("Repositories.UpdateInvitation = %+v, want %+v", got, want) } @@ -117,26 +117,26 @@ func TestRepositoryInvitation_Marshal(t *testing.T) { testJSONMarshal(t, &RepositoryInvitation{}, "{}") r := &RepositoryInvitation{ - ID: Int64(1), + ID: Ptr(int64(1)), Repo: &Repository{ - ID: Int64(1), - Name: String("n"), - URL: String("u"), + ID: Ptr(int64(1)), + Name: Ptr("n"), + URL: Ptr("u"), }, Invitee: &User{ - ID: Int64(1), - Name: String("n"), - URL: String("u"), + ID: Ptr(int64(1)), + Name: Ptr("n"), + URL: Ptr("u"), }, Inviter: &User{ - ID: Int64(1), - Name: String("n"), - URL: String("u"), + ID: Ptr(int64(1)), + Name: Ptr("n"), + URL: Ptr("u"), }, - Permissions: String("p"), + Permissions: Ptr("p"), CreatedAt: &Timestamp{referenceTime}, - URL: String("u"), - HTMLURL: String("h"), + URL: Ptr("u"), + HTMLURL: Ptr("h"), } want := `{ diff --git a/github/repos_keys_test.go b/github/repos_keys_test.go index 8b726c1160c..af63857116c 100644 --- a/github/repos_keys_test.go +++ b/github/repos_keys_test.go @@ -32,7 +32,7 @@ func TestRepositoriesService_ListKeys(t *testing.T) { t.Errorf("Repositories.ListKeys returned error: %v", err) } - want := []*Key{{ID: Int64(1)}} + want := []*Key{{ID: Ptr(int64(1))}} if !cmp.Equal(keys, want) { t.Errorf("Repositories.ListKeys returned %+v, want %+v", keys, want) } @@ -76,7 +76,7 @@ func TestRepositoriesService_GetKey(t *testing.T) { t.Errorf("Repositories.GetKey returned error: %v", err) } - want := &Key{ID: Int64(1)} + want := &Key{ID: Ptr(int64(1))} if !cmp.Equal(key, want) { t.Errorf("Repositories.GetKey returned %+v, want %+v", key, want) } @@ -109,7 +109,7 @@ func TestRepositoriesService_CreateKey(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &Key{Key: String("k"), Title: String("t")} + input := &Key{Key: Ptr("k"), Title: Ptr("t")} mux.HandleFunc("/repos/o/r/keys", func(w http.ResponseWriter, r *http.Request) { v := new(Key) @@ -129,7 +129,7 @@ func TestRepositoriesService_CreateKey(t *testing.T) { t.Errorf("Repositories.GetKey returned error: %v", err) } - want := &Key{ID: Int64(1)} + want := &Key{ID: Ptr(int64(1))} if !cmp.Equal(key, want) { t.Errorf("Repositories.GetKey returned %+v, want %+v", key, want) } diff --git a/github/repos_merging_test.go b/github/repos_merging_test.go index 6b3adaa657d..21467d06442 100644 --- a/github/repos_merging_test.go +++ b/github/repos_merging_test.go @@ -20,9 +20,9 @@ func TestRepositoriesService_Merge(t *testing.T) { client, mux, _ := setup(t) input := &RepositoryMergeRequest{ - Base: String("b"), - Head: String("h"), - CommitMessage: String("c"), + Base: Ptr("b"), + Head: Ptr("h"), + CommitMessage: Ptr("c"), } mux.HandleFunc("/repos/o/r/merges", func(w http.ResponseWriter, r *http.Request) { @@ -43,7 +43,7 @@ func TestRepositoriesService_Merge(t *testing.T) { t.Errorf("Repositories.Merge returned error: %v", err) } - want := &RepositoryCommit{SHA: String("s")} + want := &RepositoryCommit{SHA: Ptr("s")} if !cmp.Equal(commit, want) { t.Errorf("Repositories.Merge returned %+v, want %+v", commit, want) } @@ -68,9 +68,9 @@ func TestRepositoryMergeRequest_Marshal(t *testing.T) { testJSONMarshal(t, &RepositoryMergeRequest{}, "{}") u := &RepositoryMergeRequest{ - Base: String("base"), - Head: String("head"), - CommitMessage: String("cm"), + Base: Ptr("base"), + Head: Ptr("head"), + CommitMessage: Ptr("cm"), } want := `{ @@ -87,7 +87,7 @@ func TestRepositoriesService_MergeUpstream(t *testing.T) { client, mux, _ := setup(t) input := &RepoMergeUpstreamRequest{ - Branch: String("b"), + Branch: Ptr("b"), } mux.HandleFunc("/repos/o/r/merge-upstream", func(w http.ResponseWriter, r *http.Request) { @@ -108,7 +108,7 @@ func TestRepositoriesService_MergeUpstream(t *testing.T) { t.Errorf("Repositories.MergeUpstream returned error: %v", err) } - want := &RepoMergeUpstreamResult{MergeType: String("m")} + want := &RepoMergeUpstreamResult{MergeType: Ptr("m")} if !cmp.Equal(result, want) { t.Errorf("Repositories.MergeUpstream returned %+v, want %+v", result, want) } @@ -133,9 +133,9 @@ func TestRepoMergeUpstreamResult_Marshal(t *testing.T) { testJSONMarshal(t, &RepoMergeUpstreamResult{}, "{}") u := &RepoMergeUpstreamResult{ - Message: String("message"), - MergeType: String("merge_type"), - BaseBranch: String("base_branch"), + Message: Ptr("message"), + MergeType: Ptr("merge_type"), + BaseBranch: Ptr("base_branch"), } want := `{ diff --git a/github/repos_pages_test.go b/github/repos_pages_test.go index fee52e6656f..3c139d99b2f 100644 --- a/github/repos_pages_test.go +++ b/github/repos_pages_test.go @@ -22,12 +22,12 @@ func TestRepositoriesService_EnablePagesLegacy(t *testing.T) { client, mux, _ := setup(t) input := &Pages{ - BuildType: String("legacy"), + BuildType: Ptr("legacy"), Source: &PagesSource{ - Branch: String("master"), - Path: String("/"), + Branch: Ptr("master"), + Path: Ptr("/"), }, - CNAME: String("www.my-domain.com"), // not passed along. + CNAME: Ptr("www.my-domain.com"), // not passed along. } mux.HandleFunc("/repos/o/r/pages", func(w http.ResponseWriter, r *http.Request) { @@ -36,7 +36,7 @@ func TestRepositoriesService_EnablePagesLegacy(t *testing.T) { testMethod(t, r, "POST") testHeader(t, r, "Accept", mediaTypeEnablePagesAPIPreview) - want := &createPagesRequest{BuildType: String("legacy"), Source: &PagesSource{Branch: String("master"), Path: String("/")}} + want := &createPagesRequest{BuildType: Ptr("legacy"), Source: &PagesSource{Branch: Ptr("master"), Path: Ptr("/")}} if !cmp.Equal(v, want) { t.Errorf("Request body = %+v, want %+v", v, want) } @@ -50,7 +50,7 @@ func TestRepositoriesService_EnablePagesLegacy(t *testing.T) { t.Errorf("Repositories.EnablePages returned error: %v", err) } - want := &Pages{URL: String("u"), Status: String("s"), CNAME: String("c"), Custom404: Bool(false), HTMLURL: String("h"), BuildType: String("legacy"), Source: &PagesSource{Branch: String("master"), Path: String("/")}} + want := &Pages{URL: Ptr("u"), Status: Ptr("s"), CNAME: Ptr("c"), Custom404: Ptr(false), HTMLURL: Ptr("h"), BuildType: Ptr("legacy"), Source: &PagesSource{Branch: Ptr("master"), Path: Ptr("/")}} if !cmp.Equal(page, want) { t.Errorf("Repositories.EnablePages returned %v, want %v", page, want) @@ -76,8 +76,8 @@ func TestRepositoriesService_EnablePagesWorkflow(t *testing.T) { client, mux, _ := setup(t) input := &Pages{ - BuildType: String("workflow"), - CNAME: String("www.my-domain.com"), // not passed along. + BuildType: Ptr("workflow"), + CNAME: Ptr("www.my-domain.com"), // not passed along. } mux.HandleFunc("/repos/o/r/pages", func(w http.ResponseWriter, r *http.Request) { @@ -86,7 +86,7 @@ func TestRepositoriesService_EnablePagesWorkflow(t *testing.T) { testMethod(t, r, "POST") testHeader(t, r, "Accept", mediaTypeEnablePagesAPIPreview) - want := &createPagesRequest{BuildType: String("workflow")} + want := &createPagesRequest{BuildType: Ptr("workflow")} if !cmp.Equal(v, want) { t.Errorf("Request body = %+v, want %+v", v, want) } @@ -100,7 +100,7 @@ func TestRepositoriesService_EnablePagesWorkflow(t *testing.T) { t.Errorf("Repositories.EnablePages returned error: %v", err) } - want := &Pages{URL: String("u"), Status: String("s"), CNAME: String("c"), Custom404: Bool(false), HTMLURL: String("h"), BuildType: String("workflow")} + want := &Pages{URL: Ptr("u"), Status: Ptr("s"), CNAME: Ptr("c"), Custom404: Ptr(false), HTMLURL: Ptr("h"), BuildType: Ptr("workflow")} if !cmp.Equal(page, want) { t.Errorf("Repositories.EnablePages returned %v, want %v", page, want) @@ -126,9 +126,9 @@ func TestRepositoriesService_UpdatePagesLegacy(t *testing.T) { client, mux, _ := setup(t) input := &PagesUpdate{ - CNAME: String("www.my-domain.com"), - BuildType: String("legacy"), - Source: &PagesSource{Branch: String("gh-pages")}, + CNAME: Ptr("www.my-domain.com"), + BuildType: Ptr("legacy"), + Source: &PagesSource{Branch: Ptr("gh-pages")}, } mux.HandleFunc("/repos/o/r/pages", func(w http.ResponseWriter, r *http.Request) { @@ -136,7 +136,7 @@ func TestRepositoriesService_UpdatePagesLegacy(t *testing.T) { assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PUT") - want := &PagesUpdate{CNAME: String("www.my-domain.com"), BuildType: String("legacy"), Source: &PagesSource{Branch: String("gh-pages")}} + want := &PagesUpdate{CNAME: Ptr("www.my-domain.com"), BuildType: Ptr("legacy"), Source: &PagesSource{Branch: Ptr("gh-pages")}} if !cmp.Equal(v, want) { t.Errorf("Request body = %+v, want %+v", v, want) } @@ -166,8 +166,8 @@ func TestRepositoriesService_UpdatePagesWorkflow(t *testing.T) { client, mux, _ := setup(t) input := &PagesUpdate{ - CNAME: String("www.my-domain.com"), - BuildType: String("workflow"), + CNAME: Ptr("www.my-domain.com"), + BuildType: Ptr("workflow"), } mux.HandleFunc("/repos/o/r/pages", func(w http.ResponseWriter, r *http.Request) { @@ -175,7 +175,7 @@ func TestRepositoriesService_UpdatePagesWorkflow(t *testing.T) { assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "PUT") - want := &PagesUpdate{CNAME: String("www.my-domain.com"), BuildType: String("workflow")} + want := &PagesUpdate{CNAME: Ptr("www.my-domain.com"), BuildType: Ptr("workflow")} if !cmp.Equal(v, want) { t.Errorf("Request body = %+v, want %+v", v, want) } @@ -205,7 +205,7 @@ func TestRepositoriesService_UpdatePages_NullCNAME(t *testing.T) { client, mux, _ := setup(t) input := &PagesUpdate{ - Source: &PagesSource{Branch: String("gh-pages")}, + Source: &PagesSource{Branch: Ptr("gh-pages")}, } mux.HandleFunc("/repos/o/r/pages", func(w http.ResponseWriter, r *http.Request) { @@ -270,7 +270,7 @@ func TestRepositoriesService_GetPagesInfo(t *testing.T) { t.Errorf("Repositories.GetPagesInfo returned error: %v", err) } - want := &Pages{URL: String("u"), Status: String("s"), CNAME: String("c"), Custom404: Bool(false), HTMLURL: String("h"), Public: Bool(true), HTTPSCertificate: &PagesHTTPSCertificate{State: String("approved"), Description: String("Certificate is approved"), Domains: []string{"developer.github.com"}, ExpiresAt: String("2021-05-22")}, HTTPSEnforced: Bool(true)} + want := &Pages{URL: Ptr("u"), Status: Ptr("s"), CNAME: Ptr("c"), Custom404: Ptr(false), HTMLURL: Ptr("h"), Public: Ptr(true), HTTPSCertificate: &PagesHTTPSCertificate{State: Ptr("approved"), Description: Ptr("Certificate is approved"), Domains: []string{"developer.github.com"}, ExpiresAt: Ptr("2021-05-22")}, HTTPSEnforced: Ptr(true)} if !cmp.Equal(page, want) { t.Errorf("Repositories.GetPagesInfo returned %+v, want %+v", page, want) } @@ -305,7 +305,7 @@ func TestRepositoriesService_ListPagesBuilds(t *testing.T) { t.Errorf("Repositories.ListPagesBuilds returned error: %v", err) } - want := []*PagesBuild{{URL: String("u"), Status: String("s"), Commit: String("c")}} + want := []*PagesBuild{{URL: Ptr("u"), Status: Ptr("s"), Commit: Ptr("c")}} if !cmp.Equal(pages, want) { t.Errorf("Repositories.ListPagesBuilds returned %+v, want %+v", pages, want) } @@ -359,7 +359,7 @@ func TestRepositoriesService_GetLatestPagesBuild(t *testing.T) { t.Errorf("Repositories.GetLatestPagesBuild returned error: %v", err) } - want := &PagesBuild{URL: String("u"), Status: String("s"), Commit: String("c")} + want := &PagesBuild{URL: Ptr("u"), Status: Ptr("s"), Commit: Ptr("c")} if !cmp.Equal(build, want) { t.Errorf("Repositories.GetLatestPagesBuild returned %+v, want %+v", build, want) } @@ -394,7 +394,7 @@ func TestRepositoriesService_GetPageBuild(t *testing.T) { t.Errorf("Repositories.GetPageBuild returned error: %v", err) } - want := &PagesBuild{URL: String("u"), Status: String("s"), Commit: String("c")} + want := &PagesBuild{URL: Ptr("u"), Status: Ptr("s"), Commit: Ptr("c")} if !cmp.Equal(build, want) { t.Errorf("Repositories.GetPageBuild returned %+v, want %+v", build, want) } @@ -429,7 +429,7 @@ func TestRepositoriesService_RequestPageBuild(t *testing.T) { t.Errorf("Repositories.RequestPageBuild returned error: %v", err) } - want := &PagesBuild{URL: String("u"), Status: String("s")} + want := &PagesBuild{URL: Ptr("u"), Status: Ptr("s")} if !cmp.Equal(build, want) { t.Errorf("Repositories.RequestPageBuild returned %+v, want %+v", build, want) } @@ -466,16 +466,16 @@ func TestRepositoriesService_GetPageHealthCheck(t *testing.T) { want := &PagesHealthCheckResponse{ Domain: &PagesDomain{ - Host: String("example.com"), - URI: String("http://example.com/"), - Nameservers: String("default"), - DNSResolves: Bool(true), + Host: Ptr("example.com"), + URI: Ptr("http://example.com/"), + Nameservers: Ptr("default"), + DNSResolves: Ptr(true), }, AltDomain: &PagesDomain{ - Host: String("www.example.com"), - URI: String("http://www.example.com/"), - Nameservers: String("default"), - DNSResolves: Bool(true), + Host: Ptr("www.example.com"), + URI: Ptr("http://www.example.com/"), + Nameservers: Ptr("default"), + DNSResolves: Ptr(true), }, } if !cmp.Equal(healthCheckResponse, want) { @@ -502,8 +502,8 @@ func TestPagesSource_Marshal(t *testing.T) { testJSONMarshal(t, &PagesSource{}, "{}") u := &PagesSource{ - Branch: String("branch"), - Path: String("path"), + Branch: Ptr("branch"), + Path: Ptr("path"), } want := `{ @@ -519,7 +519,7 @@ func TestPagesError_Marshal(t *testing.T) { testJSONMarshal(t, &PagesError{}, "{}") u := &PagesError{ - Message: String("message"), + Message: Ptr("message"), } want := `{ @@ -534,8 +534,8 @@ func TestPagesUpdate_Marshal(t *testing.T) { testJSONMarshal(t, &PagesUpdate{}, "{}") u := &PagesUpdate{ - CNAME: String("cname"), - Source: &PagesSource{Path: String("src")}, + CNAME: Ptr("cname"), + Source: &PagesSource{Path: Ptr("src")}, } want := `{ @@ -551,14 +551,14 @@ func TestPages_Marshal(t *testing.T) { testJSONMarshal(t, &Pages{}, "{}") u := &Pages{ - URL: String("url"), - Status: String("status"), - CNAME: String("cname"), - Custom404: Bool(false), - HTMLURL: String("hurl"), + URL: Ptr("url"), + Status: Ptr("status"), + CNAME: Ptr("cname"), + Custom404: Ptr(false), + HTMLURL: Ptr("hurl"), Source: &PagesSource{ - Branch: String("branch"), - Path: String("path"), + Branch: Ptr("branch"), + Path: Ptr("path"), }, } @@ -582,14 +582,14 @@ func TestPagesBuild_Marshal(t *testing.T) { testJSONMarshal(t, &PagesBuild{}, "{}") u := &PagesBuild{ - URL: String("url"), - Status: String("status"), + URL: Ptr("url"), + Status: Ptr("status"), Error: &PagesError{ - Message: String("message"), + Message: Ptr("message"), }, - Pusher: &User{ID: Int64(1)}, - Commit: String("commit"), - Duration: Int(1), + Pusher: &User{ID: Ptr(int64(1))}, + Commit: Ptr("commit"), + Duration: Ptr(1), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, } @@ -618,40 +618,40 @@ func TestPagesHealthCheckResponse_Marshal(t *testing.T) { u := &PagesHealthCheckResponse{ Domain: &PagesDomain{ - Host: String("example.com"), - URI: String("http://example.com/"), - Nameservers: String("default"), - DNSResolves: Bool(true), - IsProxied: Bool(false), - IsCloudflareIP: Bool(false), - IsFastlyIP: Bool(false), - IsOldIPAddress: Bool(false), - IsARecord: Bool(true), - HasCNAMERecord: Bool(false), - HasMXRecordsPresent: Bool(false), - IsValidDomain: Bool(true), - IsApexDomain: Bool(true), - ShouldBeARecord: Bool(true), - IsCNAMEToGithubUserDomain: Bool(false), - IsCNAMEToPagesDotGithubDotCom: Bool(false), - IsCNAMEToFastly: Bool(false), - IsPointedToGithubPagesIP: Bool(true), - IsNonGithubPagesIPPresent: Bool(false), - IsPagesDomain: Bool(false), - IsServedByPages: Bool(true), - IsValid: Bool(true), - Reason: String("some reason"), - RespondsToHTTPS: Bool(true), - EnforcesHTTPS: Bool(true), - HTTPSError: String("some error"), - IsHTTPSEligible: Bool(true), - CAAError: String("some error"), + Host: Ptr("example.com"), + URI: Ptr("http://example.com/"), + Nameservers: Ptr("default"), + DNSResolves: Ptr(true), + IsProxied: Ptr(false), + IsCloudflareIP: Ptr(false), + IsFastlyIP: Ptr(false), + IsOldIPAddress: Ptr(false), + IsARecord: Ptr(true), + HasCNAMERecord: Ptr(false), + HasMXRecordsPresent: Ptr(false), + IsValidDomain: Ptr(true), + IsApexDomain: Ptr(true), + ShouldBeARecord: Ptr(true), + IsCNAMEToGithubUserDomain: Ptr(false), + IsCNAMEToPagesDotGithubDotCom: Ptr(false), + IsCNAMEToFastly: Ptr(false), + IsPointedToGithubPagesIP: Ptr(true), + IsNonGithubPagesIPPresent: Ptr(false), + IsPagesDomain: Ptr(false), + IsServedByPages: Ptr(true), + IsValid: Ptr(true), + Reason: Ptr("some reason"), + RespondsToHTTPS: Ptr(true), + EnforcesHTTPS: Ptr(true), + HTTPSError: Ptr("some error"), + IsHTTPSEligible: Ptr(true), + CAAError: Ptr("some error"), }, AltDomain: &PagesDomain{ - Host: String("www.example.com"), - URI: String("http://www.example.com/"), - Nameservers: String("default"), - DNSResolves: Bool(true), + Host: Ptr("www.example.com"), + URI: Ptr("http://www.example.com/"), + Nameservers: Ptr("default"), + DNSResolves: Ptr(true), }, } @@ -703,8 +703,8 @@ func TestCreatePagesRequest_Marshal(t *testing.T) { u := &createPagesRequest{ Source: &PagesSource{ - Branch: String("branch"), - Path: String("path"), + Branch: Ptr("branch"), + Path: Ptr("path"), }, } diff --git a/github/repos_prereceive_hooks_test.go b/github/repos_prereceive_hooks_test.go index 566b81b4676..c424c47a9fa 100644 --- a/github/repos_prereceive_hooks_test.go +++ b/github/repos_prereceive_hooks_test.go @@ -34,7 +34,7 @@ func TestRepositoriesService_ListPreReceiveHooks(t *testing.T) { t.Errorf("Repositories.ListHooks returned error: %v", err) } - want := []*PreReceiveHook{{ID: Int64(1)}, {ID: Int64(2)}} + want := []*PreReceiveHook{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}} if !cmp.Equal(hooks, want) { t.Errorf("Repositories.ListPreReceiveHooks returned %+v, want %+v", hooks, want) } @@ -79,7 +79,7 @@ func TestRepositoriesService_GetPreReceiveHook(t *testing.T) { t.Errorf("Repositories.GetPreReceiveHook returned error: %v", err) } - want := &PreReceiveHook{ID: Int64(1)} + want := &PreReceiveHook{ID: Ptr(int64(1))} if !cmp.Equal(hook, want) { t.Errorf("Repositories.GetPreReceiveHook returned %+v, want %+v", hook, want) } @@ -132,7 +132,7 @@ func TestRepositoriesService_UpdatePreReceiveHook(t *testing.T) { t.Errorf("Repositories.UpdatePreReceiveHook returned error: %v", err) } - want := &PreReceiveHook{ID: Int64(1)} + want := &PreReceiveHook{ID: Ptr(int64(1))} if !cmp.Equal(hook, want) { t.Errorf("Repositories.UpdatePreReceiveHook returned %+v, want %+v", hook, want) } @@ -200,10 +200,10 @@ func TestPreReceiveHook_Marshal(t *testing.T) { testJSONMarshal(t, &PreReceiveHook{}, "{}") u := &PreReceiveHook{ - ID: Int64(1), - Name: String("name"), - Enforcement: String("e"), - ConfigURL: String("curl"), + ID: Ptr(int64(1)), + Name: Ptr("name"), + Enforcement: Ptr("e"), + ConfigURL: Ptr("curl"), } want := `{ diff --git a/github/repos_projects_test.go b/github/repos_projects_test.go index e419bb6b665..e81b93390fd 100644 --- a/github/repos_projects_test.go +++ b/github/repos_projects_test.go @@ -33,7 +33,7 @@ func TestRepositoriesService_ListProjects(t *testing.T) { t.Errorf("Repositories.ListProjects returned error: %v", err) } - want := []*Project{{ID: Int64(1)}} + want := []*Project{{ID: Ptr(int64(1))}} if !cmp.Equal(projects, want) { t.Errorf("Repositories.ListProjects returned %+v, want %+v", projects, want) } @@ -57,7 +57,7 @@ func TestRepositoriesService_CreateProject(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &ProjectOptions{Name: String("Project Name"), Body: String("Project body.")} + input := &ProjectOptions{Name: Ptr("Project Name"), Body: Ptr("Project body.")} mux.HandleFunc("/repos/o/r/projects", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -78,7 +78,7 @@ func TestRepositoriesService_CreateProject(t *testing.T) { t.Errorf("Repositories.CreateProject returned error: %v", err) } - want := &Project{ID: Int64(1)} + want := &Project{ID: Ptr(int64(1))} if !cmp.Equal(project, want) { t.Errorf("Repositories.CreateProject returned %+v, want %+v", project, want) } diff --git a/github/repos_releases_test.go b/github/repos_releases_test.go index 1155a7a94cc..7c9b9e96bab 100644 --- a/github/repos_releases_test.go +++ b/github/repos_releases_test.go @@ -34,7 +34,7 @@ func TestRepositoriesService_ListReleases(t *testing.T) { if err != nil { t.Errorf("Repositories.ListReleases returned error: %v", err) } - want := []*RepositoryRelease{{ID: Int64(1)}} + want := []*RepositoryRelease{{ID: Ptr(int64(1))}} if !cmp.Equal(releases, want) { t.Errorf("Repositories.ListReleases returned %+v, want %+v", releases, want) } @@ -110,7 +110,7 @@ func TestRepositoriesService_GetRelease(t *testing.T) { t.Errorf("Repositories.GetRelease returned error: %v\n%v", err, resp.Body) } - want := &RepositoryRelease{ID: Int64(1), Author: &User{Login: String("l")}} + want := &RepositoryRelease{ID: Ptr(int64(1)), Author: &User{Login: Ptr("l")}} if !cmp.Equal(release, want) { t.Errorf("Repositories.GetRelease returned %+v, want %+v", release, want) } @@ -145,7 +145,7 @@ func TestRepositoriesService_GetLatestRelease(t *testing.T) { t.Errorf("Repositories.GetLatestRelease returned error: %v\n%v", err, resp.Body) } - want := &RepositoryRelease{ID: Int64(3)} + want := &RepositoryRelease{ID: Ptr(int64(3))} if !cmp.Equal(release, want) { t.Errorf("Repositories.GetLatestRelease returned %+v, want %+v", release, want) } @@ -180,7 +180,7 @@ func TestRepositoriesService_GetReleaseByTag(t *testing.T) { t.Errorf("Repositories.GetReleaseByTag returned error: %v\n%v", err, resp.Body) } - want := &RepositoryRelease{ID: Int64(13)} + want := &RepositoryRelease{ID: Ptr(int64(13))} if !cmp.Equal(release, want) { t.Errorf("Repositories.GetReleaseByTag returned %+v, want %+v", release, want) } @@ -205,22 +205,22 @@ func TestRepositoriesService_CreateRelease(t *testing.T) { client, mux, _ := setup(t) input := &RepositoryRelease{ - Name: String("v1.0"), - DiscussionCategoryName: String("General"), - GenerateReleaseNotes: Bool(true), + Name: Ptr("v1.0"), + DiscussionCategoryName: Ptr("General"), + GenerateReleaseNotes: Ptr(true), // Fields to be removed: - ID: Int64(2), + ID: Ptr(int64(2)), CreatedAt: &Timestamp{referenceTime}, PublishedAt: &Timestamp{referenceTime}, - URL: String("http://url/"), - HTMLURL: String("http://htmlurl/"), - AssetsURL: String("http://assetsurl/"), - Assets: []*ReleaseAsset{{ID: Int64(5)}}, - UploadURL: String("http://uploadurl/"), - ZipballURL: String("http://zipballurl/"), - TarballURL: String("http://tarballurl/"), - Author: &User{Name: String("octocat")}, - NodeID: String("nodeid"), + URL: Ptr("http://url/"), + HTMLURL: Ptr("http://htmlurl/"), + AssetsURL: Ptr("http://assetsurl/"), + Assets: []*ReleaseAsset{{ID: Ptr(int64(5))}}, + UploadURL: Ptr("http://uploadurl/"), + ZipballURL: Ptr("http://zipballurl/"), + TarballURL: Ptr("http://tarballurl/"), + Author: &User{Name: Ptr("octocat")}, + NodeID: Ptr("nodeid"), } mux.HandleFunc("/repos/o/r/releases", func(w http.ResponseWriter, r *http.Request) { @@ -229,9 +229,9 @@ func TestRepositoriesService_CreateRelease(t *testing.T) { testMethod(t, r, "POST") want := &repositoryReleaseRequest{ - Name: String("v1.0"), - DiscussionCategoryName: String("General"), - GenerateReleaseNotes: Bool(true), + Name: Ptr("v1.0"), + DiscussionCategoryName: Ptr("General"), + GenerateReleaseNotes: Ptr(true), } if !cmp.Equal(v, want) { t.Errorf("Request body = %+v, want %+v", v, want) @@ -245,7 +245,7 @@ func TestRepositoriesService_CreateRelease(t *testing.T) { t.Errorf("Repositories.CreateRelease returned error: %v", err) } - want := &RepositoryRelease{ID: Int64(1)} + want := &RepositoryRelease{ID: Ptr(int64(1))} if !cmp.Equal(release, want) { t.Errorf("Repositories.CreateRelease returned %+v, want %+v", release, want) } @@ -270,22 +270,22 @@ func TestRepositoriesService_EditRelease(t *testing.T) { client, mux, _ := setup(t) input := &RepositoryRelease{ - Name: String("n"), - DiscussionCategoryName: String("General"), + Name: Ptr("n"), + DiscussionCategoryName: Ptr("General"), // Fields to be removed: - GenerateReleaseNotes: Bool(true), - ID: Int64(2), + GenerateReleaseNotes: Ptr(true), + ID: Ptr(int64(2)), CreatedAt: &Timestamp{referenceTime}, PublishedAt: &Timestamp{referenceTime}, - URL: String("http://url/"), - HTMLURL: String("http://htmlurl/"), - AssetsURL: String("http://assetsurl/"), - Assets: []*ReleaseAsset{{ID: Int64(5)}}, - UploadURL: String("http://uploadurl/"), - ZipballURL: String("http://zipballurl/"), - TarballURL: String("http://tarballurl/"), - Author: &User{Name: String("octocat")}, - NodeID: String("nodeid"), + URL: Ptr("http://url/"), + HTMLURL: Ptr("http://htmlurl/"), + AssetsURL: Ptr("http://assetsurl/"), + Assets: []*ReleaseAsset{{ID: Ptr(int64(5))}}, + UploadURL: Ptr("http://uploadurl/"), + ZipballURL: Ptr("http://zipballurl/"), + TarballURL: Ptr("http://tarballurl/"), + Author: &User{Name: Ptr("octocat")}, + NodeID: Ptr("nodeid"), } mux.HandleFunc("/repos/o/r/releases/1", func(w http.ResponseWriter, r *http.Request) { @@ -294,8 +294,8 @@ func TestRepositoriesService_EditRelease(t *testing.T) { testMethod(t, r, "PATCH") want := &repositoryReleaseRequest{ - Name: String("n"), - DiscussionCategoryName: String("General"), + Name: Ptr("n"), + DiscussionCategoryName: Ptr("General"), } if !cmp.Equal(v, want) { t.Errorf("Request body = %+v, want %+v", v, want) @@ -308,7 +308,7 @@ func TestRepositoriesService_EditRelease(t *testing.T) { if err != nil { t.Errorf("Repositories.EditRelease returned error: %v", err) } - want := &RepositoryRelease{ID: Int64(1)} + want := &RepositoryRelease{ID: Ptr(int64(1))} if !cmp.Equal(release, want) { t.Errorf("Repositories.EditRelease returned = %+v, want %+v", release, want) } @@ -369,7 +369,7 @@ func TestRepositoriesService_ListReleaseAssets(t *testing.T) { if err != nil { t.Errorf("Repositories.ListReleaseAssets returned error: %v", err) } - want := []*ReleaseAsset{{ID: Int64(1)}} + want := []*ReleaseAsset{{ID: Ptr(int64(1))}} if !cmp.Equal(assets, want) { t.Errorf("Repositories.ListReleaseAssets returned %+v, want %+v", assets, want) } @@ -403,7 +403,7 @@ func TestRepositoriesService_GetReleaseAsset(t *testing.T) { if err != nil { t.Errorf("Repositories.GetReleaseAsset returned error: %v", err) } - want := &ReleaseAsset{ID: Int64(1)} + want := &ReleaseAsset{ID: Ptr(int64(1))} if !cmp.Equal(asset, want) { t.Errorf("Repositories.GetReleaseAsset returned %+v, want %+v", asset, want) } @@ -572,7 +572,7 @@ func TestRepositoriesService_EditReleaseAsset(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &ReleaseAsset{Name: String("n")} + input := &ReleaseAsset{Name: Ptr("n")} mux.HandleFunc("/repos/o/r/releases/assets/1", func(w http.ResponseWriter, r *http.Request) { v := new(ReleaseAsset) @@ -590,7 +590,7 @@ func TestRepositoriesService_EditReleaseAsset(t *testing.T) { if err != nil { t.Errorf("Repositories.EditReleaseAsset returned error: %v", err) } - want := &ReleaseAsset{ID: Int64(1)} + want := &ReleaseAsset{ID: Ptr(int64(1))} if !cmp.Equal(asset, want) { t.Errorf("Repositories.EditReleaseAsset returned = %+v, want %+v", asset, want) } @@ -713,7 +713,7 @@ func TestRepositoriesService_UploadReleaseAsset(t *testing.T) { if err != nil { t.Errorf("Repositories.UploadReleaseAssert returned error: %v", err) } - want := &ReleaseAsset{ID: Int64(1)} + want := &ReleaseAsset{ID: Ptr(int64(1))} if !cmp.Equal(asset, want) { t.Errorf("Repositories.UploadReleaseAssert returned %+v, want %+v", asset, want) } @@ -731,14 +731,14 @@ func TestRepositoryReleaseRequest_Marshal(t *testing.T) { testJSONMarshal(t, &repositoryReleaseRequest{}, "{}") u := &repositoryReleaseRequest{ - TagName: String("tn"), - TargetCommitish: String("tc"), - Name: String("name"), - Body: String("body"), - Draft: Bool(false), - Prerelease: Bool(false), - MakeLatest: String("legacy"), - DiscussionCategoryName: String("dcn"), + TagName: Ptr("tn"), + TargetCommitish: Ptr("tc"), + Name: Ptr("name"), + Body: Ptr("body"), + Draft: Ptr(false), + Prerelease: Ptr(false), + MakeLatest: Ptr("legacy"), + DiscussionCategoryName: Ptr("dcn"), } want := `{ @@ -760,19 +760,19 @@ func TestReleaseAsset_Marshal(t *testing.T) { testJSONMarshal(t, &ReleaseAsset{}, "{}") u := &ReleaseAsset{ - ID: Int64(1), - URL: String("url"), - Name: String("name"), - Label: String("label"), - State: String("state"), - ContentType: String("ct"), - Size: Int(1), - DownloadCount: Int(1), + ID: Ptr(int64(1)), + URL: Ptr("url"), + Name: Ptr("name"), + Label: Ptr("label"), + State: Ptr("state"), + ContentType: Ptr("ct"), + Size: Ptr(1), + DownloadCount: Ptr(1), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - BrowserDownloadURL: String("bdu"), - Uploader: &User{ID: Int64(1)}, - NodeID: String("nid"), + BrowserDownloadURL: Ptr("bdu"), + Uploader: &User{ID: Ptr(int64(1))}, + NodeID: Ptr("nid"), } want := `{ @@ -801,26 +801,26 @@ func TestRepositoryRelease_Marshal(t *testing.T) { testJSONMarshal(t, &RepositoryRelease{}, "{}") u := &RepositoryRelease{ - TagName: String("tn"), - TargetCommitish: String("tc"), - Name: String("name"), - Body: String("body"), - Draft: Bool(false), - Prerelease: Bool(false), - MakeLatest: String("legacy"), - DiscussionCategoryName: String("dcn"), - ID: Int64(1), + TagName: Ptr("tn"), + TargetCommitish: Ptr("tc"), + Name: Ptr("name"), + Body: Ptr("body"), + Draft: Ptr(false), + Prerelease: Ptr(false), + MakeLatest: Ptr("legacy"), + DiscussionCategoryName: Ptr("dcn"), + ID: Ptr(int64(1)), CreatedAt: &Timestamp{referenceTime}, PublishedAt: &Timestamp{referenceTime}, - URL: String("url"), - HTMLURL: String("hurl"), - AssetsURL: String("aurl"), - Assets: []*ReleaseAsset{{ID: Int64(1)}}, - UploadURL: String("uurl"), - ZipballURL: String("zurl"), - TarballURL: String("turl"), - Author: &User{ID: Int64(1)}, - NodeID: String("nid"), + URL: Ptr("url"), + HTMLURL: Ptr("hurl"), + AssetsURL: Ptr("aurl"), + Assets: []*ReleaseAsset{{ID: Ptr(int64(1))}}, + UploadURL: Ptr("uurl"), + ZipballURL: Ptr("zurl"), + TarballURL: Ptr("turl"), + Author: &User{ID: Ptr(int64(1))}, + NodeID: Ptr("nid"), } want := `{ @@ -861,8 +861,8 @@ func TestGenerateNotesOptions_Marshal(t *testing.T) { u := &GenerateNotesOptions{ TagName: "tag_name", - PreviousTagName: String("previous_tag_name"), - TargetCommitish: String("target_commitish"), + PreviousTagName: Ptr("previous_tag_name"), + TargetCommitish: Ptr("target_commitish"), } want := `{ diff --git a/github/repos_rules_test.go b/github/repos_rules_test.go index 3f7f6721dbf..1597b36e110 100644 --- a/github/repos_rules_test.go +++ b/github/repos_rules_test.go @@ -269,11 +269,11 @@ func TestRepositoryRule_UnmarshalJSON(t *testing.T) { "Valid required_status_checks params": { data: `{"type":"required_status_checks","parameters":{"required_status_checks":[{"context":"test","integration_id":1}],"strict_required_status_checks_policy":true,"do_not_enforce_on_create":true}}`, want: NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ - DoNotEnforceOnCreate: Bool(true), + DoNotEnforceOnCreate: Ptr(true), RequiredStatusChecks: []RuleRequiredStatusChecks{ { Context: "test", - IntegrationID: Int64(1), + IntegrationID: Ptr(int64(1)), }, }, StrictRequiredStatusChecksPolicy: true, @@ -300,7 +300,7 @@ func TestRepositoryRule_UnmarshalJSON(t *testing.T) { RequiredWorkflows: []*RuleRequiredWorkflow{ { Path: ".github/workflows/test.yml", - RepositoryID: Int64(1), + RepositoryID: Ptr(int64(1)), }, }, }), @@ -541,18 +541,18 @@ func TestRepositoriesService_GetAllRulesets(t *testing.T) { want := []*Ruleset{ { - ID: Int64(42), + ID: Ptr(int64(42)), Name: "ruleset", - SourceType: String("Repository"), + SourceType: Ptr("Repository"), Source: "o/repo", Enforcement: "enabled", CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, }, { - ID: Int64(314), + ID: Ptr(int64(314)), Name: "Another ruleset", - SourceType: String("Repository"), + SourceType: Ptr("Repository"), Source: "o/repo", Enforcement: "enabled", CreatedAt: &Timestamp{referenceTime}, @@ -599,9 +599,9 @@ func TestRepositoriesService_CreateRuleset(t *testing.T) { } want := &Ruleset{ - ID: Int64(42), + ID: Ptr(int64(42)), Name: "ruleset", - SourceType: String("Repository"), + SourceType: Ptr("Repository"), Source: "o/repo", Enforcement: "enabled", } @@ -672,11 +672,11 @@ func TestRepositoriesService_CreateRulesetWithPushRules(t *testing.T) { } want := &Ruleset{ - ID: Int64(42), + ID: Ptr(int64(42)), Name: "ruleset", - SourceType: String("Repository"), + SourceType: Ptr("Repository"), Source: "o/repo", - Target: String("push"), + Target: Ptr("push"), Enforcement: "enabled", Rules: []*RepositoryRule{ NewFilePathRestrictionRule(&RuleFileParameters{ @@ -732,9 +732,9 @@ func TestRepositoriesService_GetRuleset(t *testing.T) { } want := &Ruleset{ - ID: Int64(42), + ID: Ptr(int64(42)), Name: "ruleset", - SourceType: String("Organization"), + SourceType: Ptr("Organization"), Source: "o", Enforcement: "enabled", CreatedAt: &Timestamp{referenceTime}, @@ -785,9 +785,9 @@ func TestRepositoriesService_UpdateRulesetNoBypassActor(t *testing.T) { } want := &Ruleset{ - ID: Int64(42), + ID: Ptr(int64(42)), Name: "ruleset", - SourceType: String("Repository"), + SourceType: Ptr("Repository"), Source: "o/repo", Enforcement: "enabled", } @@ -832,9 +832,9 @@ func TestRepositoriesService_UpdateRuleset(t *testing.T) { } want := &Ruleset{ - ID: Int64(42), + ID: Ptr(int64(42)), Name: "ruleset", - SourceType: String("Repository"), + SourceType: Ptr("Repository"), Source: "o/repo", Enforcement: "enabled", } diff --git a/github/repos_stats.go b/github/repos_stats.go index 898693f7864..a6ef9c0da43 100644 --- a/github/repos_stats.go +++ b/github/repos_stats.go @@ -139,8 +139,8 @@ func (s *RepositoriesService) ListCodeFrequency(ctx context.Context, owner, repo } stat := &WeeklyStats{ Week: &Timestamp{time.Unix(int64(week[0]), 0)}, - Additions: Int(week[1]), - Deletions: Int(week[2]), + Additions: Ptr(week[1]), + Deletions: Ptr(week[2]), } stats = append(stats, stat) } @@ -231,9 +231,9 @@ func (s *RepositoriesService) ListPunchCard(ctx context.Context, owner, repo str continue } card := &PunchCard{ - Day: Int(result[0]), - Hour: Int(result[1]), - Commits: Int(result[2]), + Day: Ptr(result[0]), + Hour: Ptr(result[1]), + Commits: Ptr(result[2]), } cards = append(cards, card) } diff --git a/github/repos_stats_test.go b/github/repos_stats_test.go index d10cfc5d778..358e2705bab 100644 --- a/github/repos_stats_test.go +++ b/github/repos_stats_test.go @@ -52,16 +52,16 @@ func TestRepositoriesService_ListContributorsStats(t *testing.T) { want := []*ContributorStats{ { Author: &Contributor{ - ID: Int64(1), - NodeID: String("nodeid-1"), + ID: Ptr(int64(1)), + NodeID: Ptr("nodeid-1"), }, - Total: Int(135), + Total: Ptr(135), Weeks: []*WeeklyStats{ { Week: &Timestamp{time.Date(2013, time.May, 05, 00, 00, 00, 0, time.UTC).Local()}, - Additions: Int(6898), - Deletions: Int(77), - Commits: Int(10), + Additions: Ptr(6898), + Deletions: Ptr(77), + Commits: Ptr(10), }, }, }, @@ -113,7 +113,7 @@ func TestRepositoriesService_ListCommitActivity(t *testing.T) { want := []*WeeklyCommitActivity{ { Days: []int{0, 3, 26, 20, 39, 1, 0}, - Total: Int(89), + Total: Ptr(89), Week: &Timestamp{time.Date(2012, time.May, 06, 05, 00, 00, 0, time.UTC).Local()}, }, } @@ -155,8 +155,8 @@ func TestRepositoriesService_ListCodeFrequency(t *testing.T) { want := []*WeeklyStats{{ Week: &Timestamp{time.Date(2011, time.April, 17, 00, 00, 00, 0, time.UTC).Local()}, - Additions: Int(1124), - Deletions: Int(-435), + Additions: Ptr(1124), + Deletions: Ptr(-435), }} if !cmp.Equal(code, want) { @@ -264,9 +264,9 @@ func TestRepositoriesService_ListPunchCard(t *testing.T) { } want := []*PunchCard{ - {Day: Int(0), Hour: Int(0), Commits: Int(5)}, - {Day: Int(0), Hour: Int(1), Commits: Int(43)}, - {Day: Int(0), Hour: Int(2), Commits: Int(21)}, + {Day: Ptr(0), Hour: Ptr(0), Commits: Ptr(5)}, + {Day: Ptr(0), Hour: Ptr(1), Commits: Ptr(43)}, + {Day: Ptr(0), Hour: Ptr(2), Commits: Ptr(21)}, } if !cmp.Equal(card, want) { @@ -351,7 +351,7 @@ func TestWeeklyCommitActivity_Marshal(t *testing.T) { u := &WeeklyCommitActivity{ Days: []int{1}, - Total: Int(1), + Total: Ptr(1), Week: &Timestamp{referenceTime}, } @@ -372,9 +372,9 @@ func TestWeeklyStats_Marshal(t *testing.T) { u := &WeeklyStats{ Week: &Timestamp{referenceTime}, - Additions: Int(1), - Deletions: Int(1), - Commits: Int(1), + Additions: Ptr(1), + Deletions: Ptr(1), + Commits: Ptr(1), } want := `{ @@ -392,14 +392,14 @@ func TestContributorStats_Marshal(t *testing.T) { testJSONMarshal(t, &ContributorStats{}, "{}") u := &ContributorStats{ - Author: &Contributor{ID: Int64(1)}, - Total: Int(1), + Author: &Contributor{ID: Ptr(int64(1))}, + Total: Ptr(1), Weeks: []*WeeklyStats{ { Week: &Timestamp{referenceTime}, - Additions: Int(1), - Deletions: Int(1), - Commits: Int(1), + Additions: Ptr(1), + Deletions: Ptr(1), + Commits: Ptr(1), }, }, } diff --git a/github/repos_statuses_test.go b/github/repos_statuses_test.go index 4f4665d20c0..7cdc1186cc1 100644 --- a/github/repos_statuses_test.go +++ b/github/repos_statuses_test.go @@ -32,7 +32,7 @@ func TestRepositoriesService_ListStatuses(t *testing.T) { t.Errorf("Repositories.ListStatuses returned error: %v", err) } - want := []*RepoStatus{{ID: Int64(1)}} + want := []*RepoStatus{{ID: Ptr(int64(1))}} if !cmp.Equal(statuses, want) { t.Errorf("Repositories.ListStatuses returned %+v, want %+v", statuses, want) } @@ -65,7 +65,7 @@ func TestRepositoriesService_CreateStatus(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &RepoStatus{State: String("s"), TargetURL: String("t"), Description: String("d")} + input := &RepoStatus{State: Ptr("s"), TargetURL: Ptr("t"), Description: Ptr("d")} mux.HandleFunc("/repos/o/r/statuses/r", func(w http.ResponseWriter, r *http.Request) { v := new(RepoStatus) @@ -84,7 +84,7 @@ func TestRepositoriesService_CreateStatus(t *testing.T) { t.Errorf("Repositories.CreateStatus returned error: %v", err) } - want := &RepoStatus{ID: Int64(1)} + want := &RepoStatus{ID: Ptr(int64(1))} if !cmp.Equal(status, want) { t.Errorf("Repositories.CreateStatus returned %+v, want %+v", status, want) } @@ -130,7 +130,7 @@ func TestRepositoriesService_GetCombinedStatus(t *testing.T) { t.Errorf("Repositories.GetCombinedStatus returned error: %v", err) } - want := &CombinedStatus{State: String("success"), Statuses: []*RepoStatus{{ID: Int64(1)}}} + want := &CombinedStatus{State: Ptr("success"), Statuses: []*RepoStatus{{ID: Ptr(int64(1))}}} if !cmp.Equal(status, want) { t.Errorf("Repositories.GetCombinedStatus returned %+v, want %+v", status, want) } @@ -155,15 +155,15 @@ func TestRepoStatus_Marshal(t *testing.T) { testJSONMarshal(t, &RepoStatus{}, "{}") u := &RepoStatus{ - ID: Int64(1), - NodeID: String("nid"), - URL: String("url"), - State: String("state"), - TargetURL: String("turl"), - Description: String("desc"), - Context: String("ctx"), - AvatarURL: String("aurl"), - Creator: &User{ID: Int64(1)}, + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + URL: Ptr("url"), + State: Ptr("state"), + TargetURL: Ptr("turl"), + Description: Ptr("desc"), + Context: Ptr("ctx"), + AvatarURL: Ptr("aurl"), + Creator: &User{ID: Ptr(int64(1))}, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, } @@ -192,27 +192,27 @@ func TestCombinedStatus_Marshal(t *testing.T) { testJSONMarshal(t, &CombinedStatus{}, "{}") u := &CombinedStatus{ - State: String("state"), - Name: String("name"), - SHA: String("sha"), - TotalCount: Int(1), + State: Ptr("state"), + Name: Ptr("name"), + SHA: Ptr("sha"), + TotalCount: Ptr(1), Statuses: []*RepoStatus{ { - ID: Int64(1), - NodeID: String("nid"), - URL: String("url"), - State: String("state"), - TargetURL: String("turl"), - Description: String("desc"), - Context: String("ctx"), - AvatarURL: String("aurl"), - Creator: &User{ID: Int64(1)}, + ID: Ptr(int64(1)), + NodeID: Ptr("nid"), + URL: Ptr("url"), + State: Ptr("state"), + TargetURL: Ptr("turl"), + Description: Ptr("desc"), + Context: Ptr("ctx"), + AvatarURL: Ptr("aurl"), + Creator: &User{ID: Ptr(int64(1))}, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, }, }, - CommitURL: String("curl"), - RepositoryURL: String("rurl"), + CommitURL: Ptr("curl"), + RepositoryURL: Ptr("rurl"), } want := `{ diff --git a/github/repos_tags_test.go b/github/repos_tags_test.go index c37050d69b2..5b05694f76a 100644 --- a/github/repos_tags_test.go +++ b/github/repos_tags_test.go @@ -31,7 +31,7 @@ func TestRepositoriesService_ListTagProtection(t *testing.T) { t.Errorf("Repositories.ListTagProtection returned error: %v", err) } - want := []*TagProtection{{ID: Int64(1), Pattern: String("tag1")}, {ID: Int64(2), Pattern: String("tag2")}} + want := []*TagProtection{{ID: Ptr(int64(1)), Pattern: Ptr("tag1")}, {ID: Ptr(int64(2)), Pattern: Ptr("tag2")}} if !cmp.Equal(tagProtections, want) { t.Errorf("Repositories.ListTagProtection returned %+v, want %+v", tagProtections, want) } @@ -85,7 +85,7 @@ func TestRepositoriesService_CreateTagProtection(t *testing.T) { t.Errorf("Repositories.CreateTagProtection returned error: %v", err) } - want := &TagProtection{ID: Int64(1), Pattern: String("tag*")} + want := &TagProtection{ID: Ptr(int64(1)), Pattern: Ptr("tag*")} if !cmp.Equal(got, want) { t.Errorf("Repositories.CreateTagProtection returned %+v, want %+v", got, want) } @@ -136,8 +136,8 @@ func TestTagProtection_Marshal(t *testing.T) { testJSONMarshal(t, &TagProtection{}, "{}") u := &TagProtection{ - ID: Int64(1), - Pattern: String("pattern"), + ID: Ptr(int64(1)), + Pattern: Ptr("pattern"), } want := `{ diff --git a/github/repos_test.go b/github/repos_test.go index f311488aa3f..90b00573702 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -34,7 +34,7 @@ func TestRepositoriesService_ListByAuthenticatedUser(t *testing.T) { t.Errorf("Repositories.List returned error: %v", err) } - want := []*Repository{{ID: Int64(1)}, {ID: Int64(2)}} + want := []*Repository{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}} if !cmp.Equal(got, want) { t.Errorf("Repositories.ListByAuthenticatedUser returned %+v, want %+v", got, want) } @@ -75,7 +75,7 @@ func TestRepositoriesService_ListByUser(t *testing.T) { t.Errorf("Repositories.List returned error: %v", err) } - want := []*Repository{{ID: Int64(1)}} + want := []*Repository{{ID: Ptr(int64(1))}} if !cmp.Equal(repos, want) { t.Errorf("Repositories.ListByUser returned %+v, want %+v", repos, want) } @@ -116,7 +116,7 @@ func TestRepositoriesService_ListByUser_type(t *testing.T) { t.Errorf("Repositories.ListByUser returned error: %v", err) } - want := []*Repository{{ID: Int64(1)}} + want := []*Repository{{ID: Ptr(int64(1))}} if !cmp.Equal(repos, want) { t.Errorf("Repositories.ListByUser returned %+v, want %+v", repos, want) } @@ -156,7 +156,7 @@ func TestRepositoriesService_ListByOrg(t *testing.T) { t.Errorf("Repositories.ListByOrg returned error: %v", err) } - want := []*Repository{{ID: Int64(1)}} + want := []*Repository{{ID: Ptr(int64(1))}} if !cmp.Equal(got, want) { t.Errorf("Repositories.ListByOrg returned %+v, want %+v", got, want) } @@ -204,7 +204,7 @@ func TestRepositoriesService_ListAll(t *testing.T) { t.Errorf("Repositories.ListAll returned error: %v", err) } - want := []*Repository{{ID: Int64(1)}} + want := []*Repository{{ID: Ptr(int64(1))}} if !cmp.Equal(got, want) { t.Errorf("Repositories.ListAll returned %+v, want %+v", got, want) } @@ -224,8 +224,8 @@ func TestRepositoriesService_Create_user(t *testing.T) { client, mux, _ := setup(t) input := &Repository{ - Name: String("n"), - Archived: Bool(true), // not passed along. + Name: Ptr("n"), + Archived: Ptr(true), // not passed along. } wantAcceptHeaders := []string{mediaTypeRepositoryTemplatePreview, mediaTypeRepositoryVisibilityPreview} @@ -235,7 +235,7 @@ func TestRepositoriesService_Create_user(t *testing.T) { testMethod(t, r, "POST") testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) - want := &createRepoRequest{Name: String("n")} + want := &createRepoRequest{Name: Ptr("n")} if !cmp.Equal(v, want) { t.Errorf("Request body = %+v, want %+v", v, want) } @@ -249,7 +249,7 @@ func TestRepositoriesService_Create_user(t *testing.T) { t.Errorf("Repositories.Create returned error: %v", err) } - want := &Repository{ID: Int64(1)} + want := &Repository{ID: Ptr(int64(1))} if !cmp.Equal(got, want) { t.Errorf("Repositories.Create returned %+v, want %+v", got, want) } @@ -274,8 +274,8 @@ func TestRepositoriesService_Create_org(t *testing.T) { client, mux, _ := setup(t) input := &Repository{ - Name: String("n"), - Archived: Bool(true), // not passed along. + Name: Ptr("n"), + Archived: Ptr(true), // not passed along. } wantAcceptHeaders := []string{mediaTypeRepositoryTemplatePreview, mediaTypeRepositoryVisibilityPreview} @@ -285,7 +285,7 @@ func TestRepositoriesService_Create_org(t *testing.T) { testMethod(t, r, "POST") testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) - want := &createRepoRequest{Name: String("n")} + want := &createRepoRequest{Name: Ptr("n")} if !cmp.Equal(v, want) { t.Errorf("Request body = %+v, want %+v", v, want) } @@ -299,7 +299,7 @@ func TestRepositoriesService_Create_org(t *testing.T) { t.Errorf("Repositories.Create returned error: %v", err) } - want := &Repository{ID: Int64(1)} + want := &Repository{ID: Ptr(int64(1))} if !cmp.Equal(repo, want) { t.Errorf("Repositories.Create returned %+v, want %+v", repo, want) } @@ -310,7 +310,7 @@ func TestRepositoriesService_CreateFromTemplate(t *testing.T) { client, mux, _ := setup(t) templateRepoReq := &TemplateRepoRequest{ - Name: String("n"), + Name: Ptr("n"), } mux.HandleFunc("/repos/to/tr/generate", func(w http.ResponseWriter, r *http.Request) { @@ -319,7 +319,7 @@ func TestRepositoriesService_CreateFromTemplate(t *testing.T) { testMethod(t, r, "POST") testHeader(t, r, "Accept", mediaTypeRepositoryTemplatePreview) - want := &TemplateRepoRequest{Name: String("n")} + want := &TemplateRepoRequest{Name: Ptr("n")} if !cmp.Equal(v, want) { t.Errorf("Request body = %+v, want %+v", v, want) } @@ -333,7 +333,7 @@ func TestRepositoriesService_CreateFromTemplate(t *testing.T) { t.Errorf("Repositories.CreateFromTemplate returned error: %v", err) } - want := &Repository{ID: Int64(1), Name: String("n")} + want := &Repository{ID: Ptr(int64(1)), Name: Ptr("n")} if !cmp.Equal(got, want) { t.Errorf("Repositories.CreateFromTemplate returned %+v, want %+v", got, want) } @@ -370,7 +370,7 @@ func TestRepositoriesService_Get(t *testing.T) { t.Errorf("Repositories.Get returned error: %v", err) } - want := &Repository{ID: Int64(1), Name: String("n"), Description: String("d"), Owner: &User{Login: String("l")}, License: &License{Key: String("mit")}, SecurityAndAnalysis: &SecurityAndAnalysis{AdvancedSecurity: &AdvancedSecurity{Status: String("enabled")}, SecretScanning: &SecretScanning{String("enabled")}, SecretScanningPushProtection: &SecretScanningPushProtection{String("enabled")}, DependabotSecurityUpdates: &DependabotSecurityUpdates{String("enabled")}, SecretScanningValidityChecks: &SecretScanningValidityChecks{String("enabled")}}} + want := &Repository{ID: Ptr(int64(1)), Name: Ptr("n"), Description: Ptr("d"), Owner: &User{Login: Ptr("l")}, License: &License{Key: Ptr("mit")}, SecurityAndAnalysis: &SecurityAndAnalysis{AdvancedSecurity: &AdvancedSecurity{Status: Ptr("enabled")}, SecretScanning: &SecretScanning{Ptr("enabled")}, SecretScanningPushProtection: &SecretScanningPushProtection{Ptr("enabled")}, DependabotSecurityUpdates: &DependabotSecurityUpdates{Ptr("enabled")}, SecretScanningValidityChecks: &SecretScanningValidityChecks{Ptr("enabled")}}} if !cmp.Equal(got, want) { t.Errorf("Repositories.Get returned %+v, want %+v", got, want) } @@ -414,10 +414,10 @@ func TestRepositoriesService_GetCodeOfConduct(t *testing.T) { } want := &CodeOfConduct{ - Key: String("key"), - Name: String("name"), - URL: String("url"), - Body: String("body"), + Key: Ptr("key"), + Name: Ptr("name"), + URL: Ptr("url"), + Body: Ptr("body"), } if !cmp.Equal(got, want) { @@ -454,7 +454,7 @@ func TestRepositoriesService_GetByID(t *testing.T) { t.Fatalf("Repositories.GetByID returned error: %v", err) } - want := &Repository{ID: Int64(1), Name: String("n"), Description: String("d"), Owner: &User{Login: String("l")}, License: &License{Key: String("mit")}} + want := &Repository{ID: Ptr(int64(1)), Name: Ptr("n"), Description: Ptr("d"), Owner: &User{Login: Ptr("l")}, License: &License{Key: Ptr("mit")}} if !cmp.Equal(got, want) { t.Errorf("Repositories.GetByID returned %+v, want %+v", got, want) } @@ -495,7 +495,7 @@ func TestRepositoriesService_Edit(t *testing.T) { t.Errorf("Repositories.Edit returned error: %v", err) } - want := &Repository{ID: Int64(1)} + want := &Repository{ID: Ptr(int64(1))} if !cmp.Equal(got, want) { t.Errorf("Repositories.Edit returned %+v, want %+v", got, want) } @@ -680,8 +680,8 @@ func TestRepositoriesService_GetAutomatedSecurityFixes(t *testing.T) { } want := &AutomatedSecurityFixes{ - Enabled: Bool(true), - Paused: Bool(false), + Enabled: Ptr(true), + Paused: Ptr(false), } if !cmp.Equal(fixes, want) { t.Errorf("Repositories.GetAutomatedSecurityFixes returned #{fixes}, want #{want}") @@ -737,7 +737,7 @@ func TestRepositoriesService_ListContributors(t *testing.T) { t.Errorf("Repositories.ListContributors returned error: %v", err) } - want := []*Contributor{{Contributions: Int(42)}} + want := []*Contributor{{Contributions: Ptr(42)}} if !cmp.Equal(contributors, want) { t.Errorf("Repositories.ListContributors returned %+v, want %+v", contributors, want) } @@ -809,7 +809,7 @@ func TestRepositoriesService_ListTeams(t *testing.T) { t.Errorf("Repositories.ListTeams returned error: %v", err) } - want := []*Team{{ID: Int64(1)}} + want := []*Team{{ID: Ptr(int64(1))}} if !cmp.Equal(teams, want) { t.Errorf("Repositories.ListTeams returned %+v, want %+v", teams, want) } @@ -848,13 +848,13 @@ func TestRepositoriesService_ListTags(t *testing.T) { want := []*RepositoryTag{ { - Name: String("n"), + Name: Ptr("n"), Commit: &Commit{ - SHA: String("s"), - URL: String("u"), + SHA: Ptr("s"), + URL: Ptr("u"), }, - ZipballURL: String("z"), - TarballURL: String("t"), + ZipballURL: Ptr("z"), + TarballURL: Ptr("t"), }, } if !cmp.Equal(tags, want) { @@ -896,7 +896,7 @@ func TestRepositoriesService_ListBranches(t *testing.T) { t.Errorf("Repositories.ListBranches returned error: %v", err) } - want := []*Branch{{Name: String("master"), Commit: &RepositoryCommit{SHA: String("a57781"), URL: String("https://api.github.com/repos/o/r/commits/a57781")}}} + want := []*Branch{{Name: Ptr("master"), Commit: &RepositoryCommit{SHA: Ptr("a57781"), URL: Ptr("https://api.github.com/repos/o/r/commits/a57781")}}} if !cmp.Equal(branches, want) { t.Errorf("Repositories.ListBranches returned %+v, want %+v", branches, want) } @@ -941,14 +941,14 @@ func TestRepositoriesService_GetBranch(t *testing.T) { } want := &Branch{ - Name: String("n"), + Name: Ptr("n"), Commit: &RepositoryCommit{ - SHA: String("s"), + SHA: Ptr("s"), Commit: &Commit{ - Message: String("m"), + Message: Ptr("m"), }, }, - Protected: Bool(true), + Protected: Ptr(true), Protection: &Protection{ RequiredStatusChecks: &RequiredStatusChecks{ Contexts: &[]string{"c"}, @@ -1020,14 +1020,14 @@ func TestRepositoriesService_GetBranch_StatusMovedPermanently_followRedirects(t } want := &Branch{ - Name: String("n"), + Name: Ptr("n"), Commit: &RepositoryCommit{ - SHA: String("s"), + SHA: Ptr("s"), Commit: &Commit{ - Message: String("m"), + Message: Ptr("m"), }, }, - Protected: Bool(true), + Protected: Ptr(true), Protection: &Protection{ RequiredStatusChecks: &RequiredStatusChecks{ Contexts: &[]string{"c"}, @@ -1119,7 +1119,7 @@ func TestRepositoriesService_RenameBranch(t *testing.T) { t.Errorf("Repositories.RenameBranch returned error: %v", err) } - want := &Branch{Name: String("nn"), Protected: Bool(true)} + want := &Branch{Name: Ptr("nn"), Protected: Ptr(true)} if !cmp.Equal(got, want) { t.Errorf("Repositories.RenameBranch returned %+v, want %+v", got, want) } @@ -1237,13 +1237,13 @@ func TestRepositoriesService_GetBranchProtection(t *testing.T) { DismissStaleReviews: true, DismissalRestrictions: &DismissalRestrictions{ Users: []*User{ - {Login: String("u"), ID: Int64(3)}, + {Login: Ptr("u"), ID: Ptr(int64(3))}, }, Teams: []*Team{ - {Slug: String("t"), ID: Int64(4)}, + {Slug: Ptr("t"), ID: Ptr(int64(4))}, }, Apps: []*App{ - {Slug: String("a"), ID: Int64(5)}, + {Slug: Ptr("a"), ID: Ptr(int64(5))}, }, }, RequireCodeOwnerReviews: true, @@ -1251,31 +1251,31 @@ func TestRepositoriesService_GetBranchProtection(t *testing.T) { RequireLastPushApproval: false, }, EnforceAdmins: &AdminEnforcement{ - URL: String(test.enforceAdminsURLPath), + URL: Ptr(test.enforceAdminsURLPath), Enabled: true, }, Restrictions: &BranchRestrictions{ Users: []*User{ - {Login: String("u"), ID: Int64(1)}, + {Login: Ptr("u"), ID: Ptr(int64(1))}, }, Teams: []*Team{ - {Slug: String("t"), ID: Int64(2)}, + {Slug: Ptr("t"), ID: Ptr(int64(2))}, }, Apps: []*App{ - {Slug: String("a"), ID: Int64(3)}, + {Slug: Ptr("a"), ID: Ptr(int64(3))}, }, }, RequiredConversationResolution: &RequiredConversationResolution{ Enabled: true, }, BlockCreations: &BlockCreations{ - Enabled: Bool(false), + Enabled: Ptr(false), }, LockBranch: &LockBranch{ - Enabled: Bool(false), + Enabled: Ptr(false), }, AllowForkSyncing: &AllowForkSyncing{ - Enabled: Bool(false), + Enabled: Ptr(false), }, } if !cmp.Equal(protection, want) { @@ -1367,15 +1367,15 @@ func TestRepositoriesService_GetBranchProtection_noDismissalRestrictions(t *test RequiredApprovingReviewCount: 1, }, EnforceAdmins: &AdminEnforcement{ - URL: String(test.enforceAdminsURLPath), + URL: Ptr(test.enforceAdminsURLPath), Enabled: true, }, Restrictions: &BranchRestrictions{ Users: []*User{ - {Login: String("u"), ID: Int64(1)}, + {Login: Ptr("u"), ID: Ptr(int64(1))}, }, Teams: []*Team{ - {Slug: String("t"), ID: Int64(2)}, + {Slug: Ptr("t"), ID: Ptr(int64(2))}, }, }, } @@ -1464,9 +1464,9 @@ func TestRepositoriesService_UpdateBranchProtection_Contexts(t *testing.T) { Teams: []string{"t"}, Apps: []string{"a"}, }, - BlockCreations: Bool(true), - LockBranch: Bool(true), - AllowForkSyncing: Bool(true), + BlockCreations: Ptr(true), + LockBranch: Ptr(true), + AllowForkSyncing: Ptr(true), } mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { @@ -1551,47 +1551,47 @@ func TestRepositoriesService_UpdateBranchProtection_Contexts(t *testing.T) { DismissStaleReviews: true, DismissalRestrictions: &DismissalRestrictions{ Users: []*User{ - {Login: String("uu"), ID: Int64(3)}, + {Login: Ptr("uu"), ID: Ptr(int64(3))}, }, Teams: []*Team{ - {Slug: String("tt"), ID: Int64(4)}, + {Slug: Ptr("tt"), ID: Ptr(int64(4))}, }, Apps: []*App{ - {Slug: String("aa"), ID: Int64(5)}, + {Slug: Ptr("aa"), ID: Ptr(int64(5))}, }, }, RequireCodeOwnerReviews: true, BypassPullRequestAllowances: &BypassPullRequestAllowances{ Users: []*User{ - {Login: String("uuu"), ID: Int64(10)}, + {Login: Ptr("uuu"), ID: Ptr(int64(10))}, }, Teams: []*Team{ - {Slug: String("ttt"), ID: Int64(20)}, + {Slug: Ptr("ttt"), ID: Ptr(int64(20))}, }, Apps: []*App{ - {Slug: String("aaa"), ID: Int64(30)}, + {Slug: Ptr("aaa"), ID: Ptr(int64(30))}, }, }, }, Restrictions: &BranchRestrictions{ Users: []*User{ - {Login: String("u"), ID: Int64(1)}, + {Login: Ptr("u"), ID: Ptr(int64(1))}, }, Teams: []*Team{ - {Slug: String("t"), ID: Int64(2)}, + {Slug: Ptr("t"), ID: Ptr(int64(2))}, }, Apps: []*App{ - {Slug: String("a"), ID: Int64(3)}, + {Slug: Ptr("a"), ID: Ptr(int64(3))}, }, }, BlockCreations: &BlockCreations{ - Enabled: Bool(true), + Enabled: Ptr(true), }, LockBranch: &LockBranch{ - Enabled: Bool(true), + Enabled: Ptr(true), }, AllowForkSyncing: &AllowForkSyncing{ - Enabled: Bool(true), + Enabled: Ptr(true), }, } if !cmp.Equal(protection, want) { @@ -1654,9 +1654,9 @@ func TestRepositoriesService_UpdateBranchProtection_EmptyContexts(t *testing.T) Teams: []string{"t"}, Apps: []string{"a"}, }, - BlockCreations: Bool(true), - LockBranch: Bool(true), - AllowForkSyncing: Bool(true), + BlockCreations: Ptr(true), + LockBranch: Ptr(true), + AllowForkSyncing: Ptr(true), } mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { @@ -1731,47 +1731,47 @@ func TestRepositoriesService_UpdateBranchProtection_EmptyContexts(t *testing.T) DismissStaleReviews: true, DismissalRestrictions: &DismissalRestrictions{ Users: []*User{ - {Login: String("uu"), ID: Int64(3)}, + {Login: Ptr("uu"), ID: Ptr(int64(3))}, }, Teams: []*Team{ - {Slug: String("tt"), ID: Int64(4)}, + {Slug: Ptr("tt"), ID: Ptr(int64(4))}, }, Apps: []*App{ - {Slug: String("aa"), ID: Int64(5)}, + {Slug: Ptr("aa"), ID: Ptr(int64(5))}, }, }, RequireCodeOwnerReviews: true, BypassPullRequestAllowances: &BypassPullRequestAllowances{ Users: []*User{ - {Login: String("uuu"), ID: Int64(10)}, + {Login: Ptr("uuu"), ID: Ptr(int64(10))}, }, Teams: []*Team{ - {Slug: String("ttt"), ID: Int64(20)}, + {Slug: Ptr("ttt"), ID: Ptr(int64(20))}, }, Apps: []*App{ - {Slug: String("aaa"), ID: Int64(30)}, + {Slug: Ptr("aaa"), ID: Ptr(int64(30))}, }, }, }, Restrictions: &BranchRestrictions{ Users: []*User{ - {Login: String("u"), ID: Int64(1)}, + {Login: Ptr("u"), ID: Ptr(int64(1))}, }, Teams: []*Team{ - {Slug: String("t"), ID: Int64(2)}, + {Slug: Ptr("t"), ID: Ptr(int64(2))}, }, Apps: []*App{ - {Slug: String("a"), ID: Int64(3)}, + {Slug: Ptr("a"), ID: Ptr(int64(3))}, }, }, BlockCreations: &BlockCreations{ - Enabled: Bool(true), + Enabled: Ptr(true), }, LockBranch: &LockBranch{ - Enabled: Bool(true), + Enabled: Ptr(true), }, AllowForkSyncing: &AllowForkSyncing{ - Enabled: Bool(true), + Enabled: Ptr(true), }, } if !cmp.Equal(protection, want) { @@ -1913,37 +1913,37 @@ func TestRepositoriesService_UpdateBranchProtection_Checks(t *testing.T) { DismissStaleReviews: true, DismissalRestrictions: &DismissalRestrictions{ Users: []*User{ - {Login: String("uu"), ID: Int64(3)}, + {Login: Ptr("uu"), ID: Ptr(int64(3))}, }, Teams: []*Team{ - {Slug: String("tt"), ID: Int64(4)}, + {Slug: Ptr("tt"), ID: Ptr(int64(4))}, }, Apps: []*App{ - {Slug: String("aa"), ID: Int64(5)}, + {Slug: Ptr("aa"), ID: Ptr(int64(5))}, }, }, RequireCodeOwnerReviews: true, BypassPullRequestAllowances: &BypassPullRequestAllowances{ Users: []*User{ - {Login: String("uuu"), ID: Int64(10)}, + {Login: Ptr("uuu"), ID: Ptr(int64(10))}, }, Teams: []*Team{ - {Slug: String("ttt"), ID: Int64(20)}, + {Slug: Ptr("ttt"), ID: Ptr(int64(20))}, }, Apps: []*App{ - {Slug: String("aaa"), ID: Int64(30)}, + {Slug: Ptr("aaa"), ID: Ptr(int64(30))}, }, }, }, Restrictions: &BranchRestrictions{ Users: []*User{ - {Login: String("u"), ID: Int64(1)}, + {Login: Ptr("u"), ID: Ptr(int64(1))}, }, Teams: []*Team{ - {Slug: String("t"), ID: Int64(2)}, + {Slug: Ptr("t"), ID: Ptr(int64(2))}, }, Apps: []*App{ - {Slug: String("a"), ID: Int64(3)}, + {Slug: Ptr("a"), ID: Ptr(int64(3))}, }, }, } @@ -2058,37 +2058,37 @@ func TestRepositoriesService_UpdateBranchProtection_EmptyChecks(t *testing.T) { DismissStaleReviews: true, DismissalRestrictions: &DismissalRestrictions{ Users: []*User{ - {Login: String("uu"), ID: Int64(3)}, + {Login: Ptr("uu"), ID: Ptr(int64(3))}, }, Teams: []*Team{ - {Slug: String("tt"), ID: Int64(4)}, + {Slug: Ptr("tt"), ID: Ptr(int64(4))}, }, Apps: []*App{ - {Slug: String("aa"), ID: Int64(5)}, + {Slug: Ptr("aa"), ID: Ptr(int64(5))}, }, }, RequireCodeOwnerReviews: true, BypassPullRequestAllowances: &BypassPullRequestAllowances{ Users: []*User{ - {Login: String("uuu"), ID: Int64(10)}, + {Login: Ptr("uuu"), ID: Ptr(int64(10))}, }, Teams: []*Team{ - {Slug: String("ttt"), ID: Int64(20)}, + {Slug: Ptr("ttt"), ID: Ptr(int64(20))}, }, Apps: []*App{ - {Slug: String("aaa"), ID: Int64(30)}, + {Slug: Ptr("aaa"), ID: Ptr(int64(30))}, }, }, }, Restrictions: &BranchRestrictions{ Users: []*User{ - {Login: String("u"), ID: Int64(1)}, + {Login: Ptr("u"), ID: Ptr(int64(1))}, }, Teams: []*Team{ - {Slug: String("t"), ID: Int64(2)}, + {Slug: Ptr("t"), ID: Ptr(int64(2))}, }, Apps: []*App{ - {Slug: String("a"), ID: Int64(3)}, + {Slug: Ptr("a"), ID: Ptr(int64(3))}, }, }, } @@ -2202,37 +2202,37 @@ func TestRepositoriesService_UpdateBranchProtection_StrictNoChecks(t *testing.T) DismissStaleReviews: true, DismissalRestrictions: &DismissalRestrictions{ Users: []*User{ - {Login: String("uu"), ID: Int64(3)}, + {Login: Ptr("uu"), ID: Ptr(int64(3))}, }, Teams: []*Team{ - {Slug: String("tt"), ID: Int64(4)}, + {Slug: Ptr("tt"), ID: Ptr(int64(4))}, }, Apps: []*App{ - {Slug: String("aa"), ID: Int64(5)}, + {Slug: Ptr("aa"), ID: Ptr(int64(5))}, }, }, RequireCodeOwnerReviews: true, BypassPullRequestAllowances: &BypassPullRequestAllowances{ Users: []*User{ - {Login: String("uuu"), ID: Int64(10)}, + {Login: Ptr("uuu"), ID: Ptr(int64(10))}, }, Teams: []*Team{ - {Slug: String("ttt"), ID: Int64(20)}, + {Slug: Ptr("ttt"), ID: Ptr(int64(20))}, }, Apps: []*App{ - {Slug: String("aaa"), ID: Int64(30)}, + {Slug: Ptr("aaa"), ID: Ptr(int64(30))}, }, }, }, Restrictions: &BranchRestrictions{ Users: []*User{ - {Login: String("u"), ID: Int64(1)}, + {Login: Ptr("u"), ID: Ptr(int64(1))}, }, Teams: []*Team{ - {Slug: String("t"), ID: Int64(2)}, + {Slug: Ptr("t"), ID: Ptr(int64(2))}, }, Apps: []*App{ - {Slug: String("a"), ID: Int64(3)}, + {Slug: Ptr("a"), ID: Ptr(int64(3))}, }, }, } @@ -2261,7 +2261,7 @@ func TestRepositoriesService_UpdateBranchProtection_RequireLastPushApproval(t *t input := &ProtectionRequest{ RequiredPullRequestReviews: &PullRequestReviewsEnforcementRequest{ - RequireLastPushApproval: Bool(true), + RequireLastPushApproval: Ptr(true), }, } @@ -2364,14 +2364,14 @@ func TestRepositoriesService_License(t *testing.T) { } want := &RepositoryLicense{ - Name: String("LICENSE"), - Path: String("LICENSE"), + Name: Ptr("LICENSE"), + Path: Ptr("LICENSE"), License: &License{ - Name: String("MIT License"), - Key: String("mit"), - SPDXID: String("MIT"), - URL: String("https://api.github.com/licenses/mit"), - Featured: Bool(true), + Name: Ptr("MIT License"), + Key: Ptr("mit"), + SPDXID: Ptr("MIT"), + URL: Ptr("https://api.github.com/licenses/mit"), + Featured: Ptr(true), }, } @@ -2531,7 +2531,7 @@ func TestRepositoriesService_UpdateRequiredStatusChecks_Contexts(t *testing.T) { client, mux, _ := setup(t) input := &RequiredStatusChecksRequest{ - Strict: Bool(true), + Strict: Ptr(true), Contexts: []string{"continuous-integration"}, } @@ -2611,7 +2611,7 @@ func TestRepositoriesService_UpdateRequiredStatusChecks_Checks(t *testing.T) { appID := int64(123) noAppID := int64(-1) input := &RequiredStatusChecksRequest{ - Strict: Bool(true), + Strict: Ptr(true), Checks: []*RequiredStatusCheck{ { Context: "continuous-integration", @@ -2857,13 +2857,13 @@ func TestRepositoriesService_GetPullRequestReviewEnforcement(t *testing.T) { DismissStaleReviews: true, DismissalRestrictions: &DismissalRestrictions{ Users: []*User{ - {Login: String("u"), ID: Int64(1)}, + {Login: Ptr("u"), ID: Ptr(int64(1))}, }, Teams: []*Team{ - {Slug: String("t"), ID: Int64(2)}, + {Slug: Ptr("t"), ID: Ptr(int64(2))}, }, Apps: []*App{ - {Slug: String("a"), ID: Int64(3)}, + {Slug: Ptr("a"), ID: Ptr(int64(3))}, }, }, RequireCodeOwnerReviews: true, @@ -2947,13 +2947,13 @@ func TestRepositoriesService_UpdatePullRequestReviewEnforcement(t *testing.T) { DismissStaleReviews: true, DismissalRestrictions: &DismissalRestrictions{ Users: []*User{ - {Login: String("u"), ID: Int64(1)}, + {Login: Ptr("u"), ID: Ptr(int64(1))}, }, Teams: []*Team{ - {Slug: String("t"), ID: Int64(2)}, + {Slug: Ptr("t"), ID: Ptr(int64(2))}, }, Apps: []*App{ - {Slug: String("a"), ID: Int64(3)}, + {Slug: Ptr("a"), ID: Ptr(int64(3))}, }, }, RequireCodeOwnerReviews: true, @@ -3105,7 +3105,7 @@ func TestRepositoriesService_GetAdminEnforcement(t *testing.T) { } want := &AdminEnforcement{ - URL: String("/repos/o/r/branches/b/protection/enforce_admins"), + URL: Ptr("/repos/o/r/branches/b/protection/enforce_admins"), Enabled: true, } @@ -3158,7 +3158,7 @@ func TestRepositoriesService_AddAdminEnforcement(t *testing.T) { } want := &AdminEnforcement{ - URL: String("/repos/o/r/branches/b/protection/enforce_admins"), + URL: Ptr("/repos/o/r/branches/b/protection/enforce_admins"), Enabled: true, } if !cmp.Equal(enforcement, want) { @@ -3251,8 +3251,8 @@ func TestRepositoriesService_GetSignaturesProtectedBranch(t *testing.T) { } want := &SignaturesProtectedBranch{ - URL: String("/repos/o/r/branches/b/protection/required_signatures"), - Enabled: Bool(false), + URL: Ptr("/repos/o/r/branches/b/protection/required_signatures"), + Enabled: Ptr(false), } if !cmp.Equal(signature, want) { @@ -3305,8 +3305,8 @@ func TestRepositoriesService_RequireSignaturesOnProtectedBranch(t *testing.T) { } want := &SignaturesProtectedBranch{ - URL: String("/repos/o/r/branches/b/protection/required_signatures"), - Enabled: Bool(true), + URL: Ptr("/repos/o/r/branches/b/protection/required_signatures"), + Enabled: Ptr(true), } if !cmp.Equal(signature, want) { @@ -3405,7 +3405,7 @@ func TestPullRequestReviewsEnforcementRequest_MarshalJSON_nilDismissalRestirctio Teams: &[]string{}, Apps: &[]string{}, }, - RequireLastPushApproval: Bool(true), + RequireLastPushApproval: Ptr(true), } got, err = json.Marshal(req) @@ -3631,7 +3631,7 @@ func TestRepositoriesService_ReplaceAppRestrictions(t *testing.T) { t.Errorf("Repositories.ReplaceAppRestrictions returned error: %v", err) } want := []*App{ - {Name: String("octocat")}, + {Name: Ptr("octocat")}, } if !cmp.Equal(got, want) { t.Errorf("Repositories.ReplaceAppRestrictions returned %+v, want %+v", got, want) @@ -3683,7 +3683,7 @@ func TestRepositoriesService_AddAppRestrictions(t *testing.T) { t.Errorf("Repositories.AddAppRestrictions returned error: %v", err) } want := []*App{ - {Name: String("octocat")}, + {Name: Ptr("octocat")}, } if !cmp.Equal(got, want) { t.Errorf("Repositories.AddAppRestrictions returned %+v, want %+v", got, want) @@ -3826,7 +3826,7 @@ func TestRepositoriesService_ReplaceTeamRestrictions(t *testing.T) { t.Errorf("Repositories.ReplaceTeamRestrictions returned error: %v", err) } want := []*Team{ - {Name: String("octocat")}, + {Name: Ptr("octocat")}, } if !cmp.Equal(got, want) { t.Errorf("Repositories.ReplaceTeamRestrictions returned %+v, want %+v", got, want) @@ -3878,7 +3878,7 @@ func TestRepositoriesService_AddTeamRestrictions(t *testing.T) { t.Errorf("Repositories.AddTeamRestrictions returned error: %v", err) } want := []*Team{ - {Name: String("octocat")}, + {Name: Ptr("octocat")}, } if !cmp.Equal(got, want) { t.Errorf("Repositories.AddTeamRestrictions returned %+v, want %+v", got, want) @@ -4021,7 +4021,7 @@ func TestRepositoriesService_ReplaceUserRestrictions(t *testing.T) { t.Errorf("Repositories.ReplaceUserRestrictions returned error: %v", err) } want := []*User{ - {Name: String("octocat")}, + {Name: Ptr("octocat")}, } if !cmp.Equal(got, want) { t.Errorf("Repositories.ReplaceUserRestrictions returned %+v, want %+v", got, want) @@ -4073,7 +4073,7 @@ func TestRepositoriesService_AddUserRestrictions(t *testing.T) { t.Errorf("Repositories.AddUserRestrictions returned error: %v", err) } want := []*User{ - {Name: String("octocat")}, + {Name: Ptr("octocat")}, } if !cmp.Equal(got, want) { t.Errorf("Repositories.AddUserRestrictions returned %+v, want %+v", got, want) @@ -4148,7 +4148,7 @@ func TestRepositoriesService_Transfer(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := TransferRequest{NewOwner: "a", NewName: String("b"), TeamID: []int64{123}} + input := TransferRequest{NewOwner: "a", NewName: Ptr("b"), TeamID: []int64{123}} mux.HandleFunc("/repos/o/r/transfer", func(w http.ResponseWriter, r *http.Request) { var v TransferRequest @@ -4168,7 +4168,7 @@ func TestRepositoriesService_Transfer(t *testing.T) { t.Errorf("Repositories.Transfer returned error: %v", err) } - want := &Repository{Owner: &User{Login: String("a")}} + want := &Repository{Owner: &User{Login: Ptr("a")}} if !cmp.Equal(got, want) { t.Errorf("Repositories.Transfer returned %+v, want %+v", got, want) } @@ -4245,7 +4245,7 @@ func TestRepositoriesService_Dispatch(t *testing.T) { t.Errorf("Repositories.Dispatch returned error: %v", err) } - want := &Repository{Owner: &User{Login: String("a")}} + want := &Repository{Owner: &User{Login: Ptr("a")}} if !cmp.Equal(got, want) { t.Errorf("Repositories.Dispatch returned %+v, want %+v", got, want) } @@ -4271,7 +4271,7 @@ func TestAdvancedSecurity_Marshal(t *testing.T) { testJSONMarshal(t, &AdvancedSecurity{}, "{}") u := &AdvancedSecurity{ - Status: String("status"), + Status: Ptr("status"), } want := `{ @@ -4286,7 +4286,7 @@ func TestAuthorizedActorsOnly_Marshal(t *testing.T) { testJSONMarshal(t, &AuthorizedActorsOnly{}, "{}") u := &AuthorizedActorsOnly{ - From: Bool(true), + From: Ptr(true), } want := `{ @@ -4322,7 +4322,7 @@ func TestTransferRequest_Marshal(t *testing.T) { u := &TransferRequest{ NewOwner: "testOwner", - NewName: String("testName"), + NewName: Ptr("testName"), TeamID: []int64{1, 2}, } @@ -4340,8 +4340,8 @@ func TestSignaturesProtectedBranch_Marshal(t *testing.T) { testJSONMarshal(t, &SignaturesProtectedBranch{}, "{}") u := &SignaturesProtectedBranch{ - URL: String("https://www.testURL.in"), - Enabled: Bool(false), + URL: Ptr("https://www.testURL.in"), + Enabled: Ptr(false), } want := `{ @@ -4352,8 +4352,8 @@ func TestSignaturesProtectedBranch_Marshal(t *testing.T) { testJSONMarshal(t, u, want) u2 := &SignaturesProtectedBranch{ - URL: String("testURL"), - Enabled: Bool(true), + URL: Ptr("testURL"), + Enabled: Ptr(true), } want2 := `{ @@ -4388,7 +4388,7 @@ func TestAdminEnforcement_Marshal(t *testing.T) { testJSONMarshal(t, &AdminEnforcement{}, "{}") u := &AdminEnforcement{ - URL: String("https://www.test-url.in"), + URL: Ptr("https://www.test-url.in"), Enabled: false, } @@ -4410,8 +4410,8 @@ func TestPullRequestReviewsEnforcementUpdate_Marshal(t *testing.T) { Teams: []string{"team1", "team2"}, Apps: []string{"app1", "app2"}, }, - DismissStaleReviews: Bool(false), - RequireCodeOwnerReviews: Bool(true), + DismissStaleReviews: Ptr(false), + RequireCodeOwnerReviews: Ptr(true), RequiredApprovingReviewCount: 2, } @@ -4435,7 +4435,7 @@ func TestRequiredStatusCheck_Marshal(t *testing.T) { u := &RequiredStatusCheck{ Context: "ctx", - AppID: Int64(1), + AppID: Ptr(int64(1)), } want := `{ @@ -4451,13 +4451,13 @@ func TestRepositoryTag_Marshal(t *testing.T) { testJSONMarshal(t, &RepositoryTag{}, "{}") u := &RepositoryTag{ - Name: String("v0.1"), + Name: Ptr("v0.1"), Commit: &Commit{ - SHA: String("sha"), - URL: String("url"), + SHA: Ptr("sha"), + URL: Ptr("url"), }, - ZipballURL: String("zball"), - TarballURL: String("tball"), + ZipballURL: Ptr("zball"), + TarballURL: Ptr("tball"), } want := `{ @@ -4577,7 +4577,7 @@ func TestRepository_UnmarshalJSON(t *testing.T) { }, "Partial project": { data: []byte(`{"id":10270722,"name":"go-github","private":false,"owner":{"login":"google"},"created_at":"2013-05-24T16:42:58Z","license":{},"topics":["github"],"permissions":{"pull":true},"custom_properties":{},"organization":{"login":"google"}}`), - wantRepository: Repository{ID: Int64(10270722), Name: String("go-github"), Private: Bool(false), Owner: &User{Login: String("google")}, CreatedAt: &Timestamp{time.Date(2013, 5, 24, 16, 42, 58, 0, time.UTC)}, License: &License{}, Topics: []string{"github"}, Permissions: map[string]bool{"pull": true}, CustomProperties: map[string]interface{}{}, Organization: &Organization{Login: String("google")}}, + wantRepository: Repository{ID: Ptr(int64(10270722)), Name: Ptr("go-github"), Private: Ptr(false), Owner: &User{Login: Ptr("google")}, CreatedAt: &Timestamp{time.Date(2013, 5, 24, 16, 42, 58, 0, time.UTC)}, License: &License{}, Topics: []string{"github"}, Permissions: map[string]bool{"pull": true}, CustomProperties: map[string]interface{}{}, Organization: &Organization{Login: Ptr("google")}}, wantErr: false, }, "With custom properties": { diff --git a/github/repos_traffic_test.go b/github/repos_traffic_test.go index 8f9cdba2364..e1374d8c461 100644 --- a/github/repos_traffic_test.go +++ b/github/repos_traffic_test.go @@ -34,9 +34,9 @@ func TestRepositoriesService_ListTrafficReferrers(t *testing.T) { } want := []*TrafficReferrer{{ - Referrer: String("Google"), - Count: Int(4), - Uniques: Int(3), + Referrer: Ptr("Google"), + Count: Ptr(4), + Uniques: Ptr(3), }} if !cmp.Equal(got, want) { t.Errorf("Repositories.ListTrafficReferrers returned %+v, want %+v", got, want) @@ -77,10 +77,10 @@ func TestRepositoriesService_ListTrafficPaths(t *testing.T) { } want := []*TrafficPath{{ - Path: String("/github/hubot"), - Title: String("github/hubot: A customizable life embetterment robot."), - Count: Int(3542), - Uniques: Int(2225), + Path: Ptr("/github/hubot"), + Title: Ptr("github/hubot: A customizable life embetterment robot."), + Count: Ptr(3542), + Uniques: Ptr(2225), }} if !cmp.Equal(got, want) { t.Errorf("Repositories.ListTrafficPaths returned %+v, want %+v", got, want) @@ -125,11 +125,11 @@ func TestRepositoriesService_ListTrafficViews(t *testing.T) { want := &TrafficViews{ Views: []*TrafficData{{ Timestamp: &Timestamp{time.Date(2016, time.May, 31, 16, 0, 0, 0, time.UTC)}, - Count: Int(7), - Uniques: Int(6), + Count: Ptr(7), + Uniques: Ptr(6), }}, - Count: Int(7), - Uniques: Int(6), + Count: Ptr(7), + Uniques: Ptr(6), } if !cmp.Equal(got, want) { @@ -175,11 +175,11 @@ func TestRepositoriesService_ListTrafficClones(t *testing.T) { want := &TrafficClones{ Clones: []*TrafficData{{ Timestamp: &Timestamp{time.Date(2016, time.May, 31, 16, 0, 0, 0, time.UTC)}, - Count: Int(7), - Uniques: Int(6), + Count: Ptr(7), + Uniques: Ptr(6), }}, - Count: Int(7), - Uniques: Int(6), + Count: Ptr(7), + Uniques: Ptr(6), } if !cmp.Equal(got, want) { @@ -206,9 +206,9 @@ func TestTrafficReferrer_Marshal(t *testing.T) { testJSONMarshal(t, &TrafficReferrer{}, "{}") u := &TrafficReferrer{ - Referrer: String("referrer"), - Count: Int(0), - Uniques: Int(0), + Referrer: Ptr("referrer"), + Count: Ptr(0), + Uniques: Ptr(0), } want := `{ @@ -227,11 +227,11 @@ func TestTrafficViews_Marshal(t *testing.T) { u := &TrafficViews{ Views: []*TrafficData{{ Timestamp: &Timestamp{time.Date(2016, time.May, 31, 16, 0, 0, 0, time.UTC)}, - Count: Int(7), - Uniques: Int(6), + Count: Ptr(7), + Uniques: Ptr(6), }}, - Count: Int(0), - Uniques: Int(0), + Count: Ptr(0), + Uniques: Ptr(0), } want := `{ @@ -254,11 +254,11 @@ func TestTrafficClones_Marshal(t *testing.T) { u := &TrafficClones{ Clones: []*TrafficData{{ Timestamp: &Timestamp{time.Date(2021, time.October, 29, 16, 0, 0, 0, time.UTC)}, - Count: Int(1), - Uniques: Int(1), + Count: Ptr(1), + Uniques: Ptr(1), }}, - Count: Int(0), - Uniques: Int(0), + Count: Ptr(0), + Uniques: Ptr(0), } want := `{ @@ -279,10 +279,10 @@ func TestTrafficPath_Marshal(t *testing.T) { testJSONMarshal(t, &TrafficPath{}, "{}") u := &TrafficPath{ - Path: String("test/path"), - Title: String("test"), - Count: Int(2), - Uniques: Int(3), + Path: Ptr("test/path"), + Title: Ptr("test"), + Count: Ptr(2), + Uniques: Ptr(3), } want := `{ @@ -301,8 +301,8 @@ func TestTrafficData_Marshal(t *testing.T) { u := &TrafficData{ Timestamp: &Timestamp{time.Date(2016, time.May, 31, 16, 0, 0, 0, time.UTC)}, - Count: Int(7), - Uniques: Int(6), + Count: Ptr(7), + Uniques: Ptr(6), } want := `{ diff --git a/github/scim_test.go b/github/scim_test.go index 3777135c9a6..a6c806cb574 100644 --- a/github/scim_test.go +++ b/github/scim_test.go @@ -71,35 +71,35 @@ func TestSCIMService_ListSCIMProvisionedIdentities(t *testing.T) { date := Timestamp{time.Date(2018, time.February, 13, 15, 5, 24, 0, time.UTC)} want := SCIMProvisionedIdentities{ Schemas: []string{"urn:ietf:params:scim:api:messages:2.0:ListResponse"}, - TotalResults: Int(1), - ItemsPerPage: Int(1), - StartIndex: Int(1), + TotalResults: Ptr(1), + ItemsPerPage: Ptr(1), + StartIndex: Ptr(1), Resources: []*SCIMUserAttributes{ { - ID: String("5fc0c238-1112-11e8-8e45-920c87bdbd75"), + ID: Ptr("5fc0c238-1112-11e8-8e45-920c87bdbd75"), Meta: &SCIMMeta{ - ResourceType: String("User"), + ResourceType: Ptr("User"), Created: &date, LastModified: &date, - Location: String("https://api.github.com/scim/v2/organizations/octo-org/Users/5fc0c238-1112-11e8-8e45-920c87bdbd75"), + Location: Ptr("https://api.github.com/scim/v2/organizations/octo-org/Users/5fc0c238-1112-11e8-8e45-920c87bdbd75"), }, UserName: "octocat@github.com", Name: SCIMUserName{ GivenName: "Mona", FamilyName: "Octocat", - Formatted: String("Mona Octocat"), + Formatted: Ptr("Mona Octocat"), }, - DisplayName: String("Mona Octocat"), + DisplayName: Ptr("Mona Octocat"), Emails: []*SCIMUserEmail{ { Value: "octocat@github.com", - Primary: Bool(true), + Primary: Ptr(true), }, }, Schemas: []string{"urn:ietf:params:scim:schemas:core:2.0:User"}, - ExternalID: String("00u1dhhb1fkIGP7RL1d8"), + ExternalID: Ptr("00u1dhhb1fkIGP7RL1d8"), Groups: nil, - Active: Bool(true), + Active: Ptr(true), }, }, } @@ -150,7 +150,7 @@ func TestSCIMService_ProvisionAndInviteSCIMUser(t *testing.T) { } want := &SCIMUserAttributes{ - ID: String("1234567890"), + ID: Ptr("1234567890"), UserName: "userName", } if !cmp.Equal(user, want) { @@ -219,33 +219,33 @@ func TestSCIMService_GetSCIMProvisioningInfoForUser(t *testing.T) { date := Timestamp{time.Date(2017, time.March, 9, 16, 11, 13, 0, time.UTC)} want := SCIMUserAttributes{ - ID: String("edefdfedf-050c-11e7-8d32"), + ID: Ptr("edefdfedf-050c-11e7-8d32"), Meta: &SCIMMeta{ - ResourceType: String("User"), + ResourceType: Ptr("User"), Created: &date, LastModified: &date, - Location: String("https://api.github.com/scim/v2/organizations/octo-org/Users/edefdfedf-050c-11e7-8d32"), + Location: Ptr("https://api.github.com/scim/v2/organizations/octo-org/Users/edefdfedf-050c-11e7-8d32"), }, UserName: "mona.octocat@okta.example.com", Name: SCIMUserName{ GivenName: "Mona", FamilyName: "Octocat", - Formatted: String("Mona Octocat"), + Formatted: Ptr("Mona Octocat"), }, - DisplayName: String("Mona Octocat"), + DisplayName: Ptr("Mona Octocat"), Emails: []*SCIMUserEmail{ { Value: "mona.octocat@okta.example.com", - Primary: Bool(true), + Primary: Ptr(true), }, { Value: "mona@octocat.github.com", }, }, Schemas: []string{"urn:ietf:params:scim:schemas:core:2.0:User"}, - ExternalID: String("a7d0f98382"), + ExternalID: Ptr("a7d0f98382"), Groups: nil, - Active: Bool(true), + Active: Ptr(true), } if !cmp.Equal(user, &want) { @@ -367,20 +367,20 @@ func TestSCIMUserAttributes_Marshal(t *testing.T) { Name: SCIMUserName{ GivenName: "Name1", FamilyName: "Fname", - Formatted: String("formatted name"), + Formatted: Ptr("formatted name"), }, - DisplayName: String("Name"), + DisplayName: Ptr("Name"), Emails: []*SCIMUserEmail{ { Value: "value", - Primary: Bool(false), - Type: String("type"), + Primary: Ptr(false), + Type: Ptr("type"), }, }, Schemas: []string{"schema1"}, - ExternalID: String("id"), + ExternalID: Ptr("id"), Groups: []string{"group1"}, - Active: Bool(true), + Active: Ptr(true), } want := `{ @@ -411,7 +411,7 @@ func TestUpdateAttributeForSCIMUserOperations_Marshal(t *testing.T) { u := &UpdateAttributeForSCIMUserOperations{ Op: "TestOp", - Path: String("path"), + Path: Ptr("path"), } want := `{ @@ -430,7 +430,7 @@ func TestUpdateAttributeForSCIMUserOptions_Marshal(t *testing.T) { Schemas: []string{"test", "schema"}, Operations: UpdateAttributeForSCIMUserOperations{ Op: "TestOp", - Path: String("path"), + Path: Ptr("path"), }, } @@ -461,8 +461,8 @@ func TestListSCIMProvisionedIdentitiesOptions_addOptions(t *testing.T) { t, url, &ListSCIMProvisionedIdentitiesOptions{ - StartIndex: Int(1), - Count: Int(10), + StartIndex: Ptr(1), + Count: Ptr(10), }, fmt.Sprintf("%s?count=10&startIndex=1", url), ) @@ -471,9 +471,9 @@ func TestListSCIMProvisionedIdentitiesOptions_addOptions(t *testing.T) { t, url, &ListSCIMProvisionedIdentitiesOptions{ - StartIndex: Int(1), - Count: Int(10), - Filter: String("test"), + StartIndex: Ptr(1), + Count: Ptr(10), + Filter: Ptr("test"), }, fmt.Sprintf("%s?count=10&filter=test&startIndex=1", url), ) @@ -488,7 +488,7 @@ func TestSCIMUserName_Marshal(t *testing.T) { u := &SCIMUserName{ GivenName: "Name1", FamilyName: "Fname", - Formatted: String("formatted name"), + Formatted: Ptr("formatted name"), } want := `{ @@ -504,8 +504,8 @@ func TestSCIMMeta_Marshal(t *testing.T) { testJSONMarshal(t, &SCIMMeta{}, `{}`) u := &SCIMMeta{ - ResourceType: String("test"), - Location: String("test"), + ResourceType: Ptr("test"), + Location: Ptr("test"), } want := `{ @@ -522,29 +522,29 @@ func TestSCIMProvisionedIdentities_Marshal(t *testing.T) { u := &SCIMProvisionedIdentities{ Schemas: []string{"test", "schema"}, - TotalResults: Int(1), - ItemsPerPage: Int(2), - StartIndex: Int(1), + TotalResults: Ptr(1), + ItemsPerPage: Ptr(2), + StartIndex: Ptr(1), Resources: []*SCIMUserAttributes{ { UserName: "SCIM", Name: SCIMUserName{ GivenName: "scim", FamilyName: "test", - Formatted: String("SCIM"), + Formatted: Ptr("SCIM"), }, - DisplayName: String("Test SCIM"), + DisplayName: Ptr("Test SCIM"), Emails: []*SCIMUserEmail{ { Value: "test", - Primary: Bool(true), - Type: String("test"), + Primary: Ptr(true), + Type: Ptr("test"), }, }, Schemas: []string{"schema1"}, - ExternalID: String("id"), + ExternalID: Ptr("id"), Groups: []string{"group1"}, - Active: Bool(true), + Active: Ptr(true), }, }, } diff --git a/github/search_test.go b/github/search_test.go index f55a531e1e3..d9fcb66c5bf 100644 --- a/github/search_test.go +++ b/github/search_test.go @@ -40,9 +40,9 @@ func TestSearchService_Repositories(t *testing.T) { } want := &RepositoriesSearchResult{ - Total: Int(4), - IncompleteResults: Bool(false), - Repositories: []*Repository{{ID: Int64(1)}, {ID: Int64(2)}}, + Total: Ptr(4), + IncompleteResults: Ptr(false), + Repositories: []*Repository{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}}, } if !cmp.Equal(result, want) { t.Errorf("Search.Repositories returned %+v, want %+v", result, want) @@ -123,17 +123,17 @@ func TestSearchService_RepositoriesTextMatch(t *testing.T) { } wantedRepoResult := &Repository{ - Name: String("gopher1"), + Name: Ptr("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}}}, + Fragment: Ptr("I'm afraid my friend what you have found\nIs a gopher who lives to feed"), + Matches: []*Match{{Text: Ptr("gopher"), Indices: []int{14, 21}}}, }, }, } want := &RepositoriesSearchResult{ - Total: Int(1), - IncompleteResults: Bool(false), + Total: Ptr(1), + IncompleteResults: Ptr(false), Repositories: []*Repository{wantedRepoResult}, } if !cmp.Equal(result, want) { @@ -164,9 +164,9 @@ func TestSearchService_Topics(t *testing.T) { } want := &TopicsSearchResult{ - Total: Int(4), - IncompleteResults: Bool(false), - Topics: []*TopicResult{{Name: String("blah")}, {Name: String("blahblah")}}, + Total: Ptr(4), + IncompleteResults: Ptr(false), + Topics: []*TopicResult{{Name: Ptr("blah")}, {Name: Ptr("blahblah")}}, } if !cmp.Equal(result, want) { t.Errorf("Search.Topics returned %+v, want %+v", result, want) @@ -209,9 +209,9 @@ func TestSearchService_Commits(t *testing.T) { } want := &CommitsSearchResult{ - Total: Int(4), - IncompleteResults: Bool(false), - Commits: []*CommitResult{{SHA: String("random_hash1")}, {SHA: String("random_hash2")}}, + Total: Ptr(4), + IncompleteResults: Ptr(false), + Commits: []*CommitResult{{SHA: Ptr("random_hash1")}, {SHA: Ptr("random_hash2")}}, } if !cmp.Equal(result, want) { t.Errorf("Search.Commits returned %+v, want %+v", result, want) @@ -256,9 +256,9 @@ func TestSearchService_Issues(t *testing.T) { } want := &IssuesSearchResult{ - Total: Int(4), - IncompleteResults: Bool(true), - Issues: []*Issue{{Number: Int(1)}, {Number: Int(2)}}, + Total: Ptr(4), + IncompleteResults: Ptr(true), + Issues: []*Issue{{Number: Ptr(1)}, {Number: Ptr(2)}}, } if !cmp.Equal(result, want) { t.Errorf("Search.Issues returned %+v, want %+v", result, want) @@ -307,9 +307,9 @@ func TestSearchService_Issues_withQualifiersNoOpts(t *testing.T) { } want := &IssuesSearchResult{ - Total: Int(4), - IncompleteResults: Bool(true), - Issues: []*Issue{{Number: Int(1)}, {Number: Int(2)}}, + Total: Ptr(4), + IncompleteResults: Ptr(true), + Issues: []*Issue{{Number: Ptr(1)}, {Number: Ptr(2)}}, } if !cmp.Equal(result, want) { t.Errorf("Search.Issues returned %+v, want %+v", result, want) @@ -346,9 +346,9 @@ func TestSearchService_Issues_withQualifiersAndOpts(t *testing.T) { } want := &IssuesSearchResult{ - Total: Int(4), - IncompleteResults: Bool(true), - Issues: []*Issue{{Number: Int(1)}, {Number: Int(2)}}, + Total: Ptr(4), + IncompleteResults: Ptr(true), + Issues: []*Issue{{Number: Ptr(1)}, {Number: Ptr(2)}}, } if !cmp.Equal(result, want) { t.Errorf("Search.Issues returned %+v, want %+v", result, want) @@ -380,9 +380,9 @@ func TestSearchService_Users(t *testing.T) { } want := &UsersSearchResult{ - Total: Int(4), - IncompleteResults: Bool(false), - Users: []*User{{ID: Int64(1)}, {ID: Int64(2)}}, + Total: Ptr(4), + IncompleteResults: Ptr(false), + Users: []*User{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}}, } if !cmp.Equal(result, want) { t.Errorf("Search.Users returned %+v, want %+v", result, want) @@ -427,9 +427,9 @@ func TestSearchService_Code(t *testing.T) { } want := &CodeSearchResult{ - Total: Int(4), - IncompleteResults: Bool(false), - CodeResults: []*CodeResult{{Name: String("1")}, {Name: String("2")}}, + Total: Ptr(4), + IncompleteResults: Ptr(false), + CodeResults: []*CodeResult{{Name: Ptr("1")}, {Name: Ptr("2")}}, } if !cmp.Equal(result, want) { t.Errorf("Search.Code returned %+v, want %+v", result, want) @@ -493,17 +493,17 @@ func TestSearchService_CodeTextMatch(t *testing.T) { } wantedCodeResult := &CodeResult{ - Name: String("gopher1"), + Name: Ptr("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}}}, + Fragment: Ptr("I'm afraid my friend what you have found\nIs a gopher who lives to feed"), + Matches: []*Match{{Text: Ptr("gopher"), Indices: []int{14, 21}}}, }, }, } want := &CodeSearchResult{ - Total: Int(1), - IncompleteResults: Bool(false), + Total: Ptr(1), + IncompleteResults: Ptr(false), CodeResults: []*CodeResult{wantedCodeResult}, } if !cmp.Equal(result, want) { @@ -537,11 +537,11 @@ func TestSearchService_Labels(t *testing.T) { } want := &LabelsSearchResult{ - Total: Int(4), - IncompleteResults: Bool(false), + Total: Ptr(4), + IncompleteResults: Ptr(false), Labels: []*LabelResult{ - {ID: Int64(1234), Name: String("bug"), Description: String("some text")}, - {ID: Int64(4567), Name: String("feature")}, + {ID: Ptr(int64(1234)), Name: Ptr("bug"), Description: Ptr("some text")}, + {ID: Ptr(int64(4567)), Name: Ptr("feature")}, }, } if !cmp.Equal(result, want) { @@ -567,7 +567,7 @@ func TestMatch_Marshal(t *testing.T) { testJSONMarshal(t, &Match{}, "{}") u := &Match{ - Text: String("txt"), + Text: Ptr("txt"), Indices: []int{1}, } @@ -584,13 +584,13 @@ func TestTextMatch_Marshal(t *testing.T) { testJSONMarshal(t, &TextMatch{}, "{}") u := &TextMatch{ - ObjectURL: String("ourl"), - ObjectType: String("otype"), - Property: String("prop"), - Fragment: String("fragment"), + ObjectURL: Ptr("ourl"), + ObjectType: Ptr("otype"), + Property: Ptr("prop"), + Fragment: Ptr("fragment"), Matches: []*Match{ { - Text: String("txt"), + Text: Ptr("txt"), Indices: []int{1}, }, }, @@ -615,15 +615,15 @@ func TestTopicResult_Marshal(t *testing.T) { testJSONMarshal(t, &TopicResult{}, "{}") u := &TopicResult{ - Name: String("name"), - DisplayName: String("displayName"), - ShortDescription: String("shortDescription"), - Description: String("description"), - CreatedBy: String("createdBy"), - UpdatedAt: String("2021-10-26"), - Featured: Bool(false), - Curated: Bool(true), - Score: Float64(99.9), + Name: Ptr("name"), + DisplayName: Ptr("displayName"), + ShortDescription: Ptr("shortDescription"), + Description: Ptr("description"), + CreatedBy: Ptr("createdBy"), + UpdatedAt: Ptr("2021-10-26"), + Featured: Ptr(false), + Curated: Ptr(true), + Score: Ptr(99.9), } want := `{ @@ -646,9 +646,9 @@ func TestRepositoriesSearchResult_Marshal(t *testing.T) { testJSONMarshal(t, &RepositoriesSearchResult{}, "{}") u := &RepositoriesSearchResult{ - Total: Int(0), - IncompleteResults: Bool(true), - Repositories: []*Repository{{ID: Int64(1)}}, + Total: Ptr(0), + IncompleteResults: Ptr(true), + Repositories: []*Repository{{ID: Ptr(int64(1))}}, } want := `{ @@ -665,10 +665,10 @@ func TestCommitsSearchResult_Marshal(t *testing.T) { testJSONMarshal(t, &CommitsSearchResult{}, "{}") c := &CommitsSearchResult{ - Total: Int(0), - IncompleteResults: Bool(true), + Total: Ptr(0), + IncompleteResults: Ptr(true), Commits: []*CommitResult{{ - SHA: String("s"), + SHA: Ptr("s"), }}, } @@ -686,20 +686,20 @@ func TestTopicsSearchResult_Marshal(t *testing.T) { testJSONMarshal(t, &TopicsSearchResult{}, "{}") u := &TopicsSearchResult{ - Total: Int(2), - IncompleteResults: Bool(false), + Total: Ptr(2), + IncompleteResults: Ptr(false), Topics: []*TopicResult{ { - Name: String("t1"), - DisplayName: String("tt"), - ShortDescription: String("t desc"), - Description: String("desc"), - CreatedBy: String("mi"), + Name: Ptr("t1"), + DisplayName: Ptr("tt"), + ShortDescription: Ptr("t desc"), + Description: Ptr("desc"), + CreatedBy: Ptr("mi"), CreatedAt: &Timestamp{referenceTime}, - UpdatedAt: String("2006-01-02T15:04:05Z"), - Featured: Bool(true), - Curated: Bool(true), - Score: Float64(123), + UpdatedAt: Ptr("2006-01-02T15:04:05Z"), + Featured: Ptr(true), + Curated: Ptr(true), + Score: Ptr(123.0), }, }, } @@ -731,13 +731,13 @@ func TestLabelResult_Marshal(t *testing.T) { testJSONMarshal(t, &LabelResult{}, "{}") u := &LabelResult{ - ID: Int64(11), - URL: String("url"), - Name: String("label"), - Color: String("green"), - Default: Bool(true), - Description: String("desc"), - Score: Float64(123), + ID: Ptr(int64(11)), + URL: Ptr("url"), + Name: Ptr("label"), + Color: Ptr("green"), + Default: Ptr(true), + Description: Ptr("desc"), + Score: Ptr(123.0), } want := `{ @@ -782,39 +782,39 @@ func TestIssuesSearchResult_Marshal(t *testing.T) { testJSONMarshal(t, &IssuesSearchResult{}, "{}") u := &IssuesSearchResult{ - Total: Int(48), - IncompleteResults: Bool(false), + Total: Ptr(48), + IncompleteResults: Ptr(false), Issues: []*Issue{ { - ID: Int64(1), - Number: Int(1), - State: String("s"), - Locked: Bool(false), - Title: String("title"), - Body: String("body"), - AuthorAssociation: String("aa"), - User: &User{ID: Int64(1)}, - Labels: []*Label{{ID: Int64(1)}}, - Assignee: &User{ID: Int64(1)}, - Comments: Int(1), + ID: Ptr(int64(1)), + Number: Ptr(1), + State: Ptr("s"), + Locked: Ptr(false), + Title: Ptr("title"), + Body: Ptr("body"), + AuthorAssociation: Ptr("aa"), + User: &User{ID: Ptr(int64(1))}, + Labels: []*Label{{ID: Ptr(int64(1))}}, + Assignee: &User{ID: Ptr(int64(1))}, + Comments: Ptr(1), ClosedAt: &Timestamp{referenceTime}, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - ClosedBy: &User{ID: Int64(1)}, - URL: String("url"), - HTMLURL: String("hurl"), - CommentsURL: String("curl"), - EventsURL: String("eurl"), - LabelsURL: String("lurl"), - RepositoryURL: String("rurl"), - Milestone: &Milestone{ID: Int64(1)}, - PullRequestLinks: &PullRequestLinks{URL: String("url")}, - Repository: &Repository{ID: Int64(1)}, - Reactions: &Reactions{TotalCount: Int(1)}, - Assignees: []*User{{ID: Int64(1)}}, - NodeID: String("nid"), - TextMatches: []*TextMatch{{ObjectURL: String("ourl")}}, - ActiveLockReason: String("alr"), + ClosedBy: &User{ID: Ptr(int64(1))}, + URL: Ptr("url"), + HTMLURL: Ptr("hurl"), + CommentsURL: Ptr("curl"), + EventsURL: Ptr("eurl"), + LabelsURL: Ptr("lurl"), + RepositoryURL: Ptr("rurl"), + Milestone: &Milestone{ID: Ptr(int64(1))}, + PullRequestLinks: &PullRequestLinks{URL: Ptr("url")}, + Repository: &Repository{ID: Ptr(int64(1))}, + Reactions: &Reactions{TotalCount: Ptr(1)}, + Assignees: []*User{{ID: Ptr(int64(1))}}, + NodeID: Ptr("nid"), + TextMatches: []*TextMatch{{ObjectURL: Ptr("ourl")}}, + ActiveLockReason: Ptr("alr"), }, }, } @@ -891,17 +891,17 @@ func TestLabelsSearchResult_Marshal(t *testing.T) { testJSONMarshal(t, &LabelsSearchResult{}, "{}") u := &LabelsSearchResult{ - Total: Int(5), - IncompleteResults: Bool(false), + Total: Ptr(5), + IncompleteResults: Ptr(false), Labels: []*LabelResult{ { - ID: Int64(1), - URL: String("https://www.test-url.com"), - Name: String("test name"), - Color: String("green"), - Default: Bool(true), - Description: String("testDescription"), - Score: Float64(1), + ID: Ptr(int64(1)), + URL: Ptr("https://www.test-url.com"), + Name: Ptr("test name"), + Color: Ptr("green"), + Default: Ptr(true), + Description: Ptr("testDescription"), + Score: Ptr(1.0), }, }, } @@ -930,15 +930,15 @@ func TestCommitResult_Marshal(t *testing.T) { testJSONMarshal(t, &CommitResult{}, "{}") c := &CommitResult{ - SHA: String("test"), - HTMLURL: String("hurl"), - CommentsURL: String("curl"), - URL: String("url"), - Repository: &Repository{ID: Int64(1)}, - Score: Float64(123), - Commit: &Commit{SHA: String("test")}, - Author: &User{ID: Int64(1)}, - Committer: &User{ID: Int64(1)}, + SHA: Ptr("test"), + HTMLURL: Ptr("hurl"), + CommentsURL: Ptr("curl"), + URL: Ptr("url"), + Repository: &Repository{ID: Ptr(int64(1))}, + Score: Ptr(123.0), + Commit: &Commit{SHA: Ptr("test")}, + Author: &User{ID: Ptr(int64(1))}, + Committer: &User{ID: Ptr(int64(1))}, Parents: []*Commit{}, } @@ -970,16 +970,16 @@ func TestUsersSearchResult_Marshal(t *testing.T) { testJSONMarshal(t, &UsersSearchResult{}, "{}") u := &UsersSearchResult{ - Total: Int(2), - IncompleteResults: Bool(false), + Total: Ptr(2), + IncompleteResults: Ptr(false), Users: []*User{{ - Login: String("loginTest"), - ID: Int64(1), - NodeID: String("NodeTest"), - AvatarURL: String("AvatarURLTest"), - HTMLURL: String("Hurl"), - GravatarID: String("gravatarIDTest"), - Name: String("nameTest"), + Login: Ptr("loginTest"), + ID: Ptr(int64(1)), + NodeID: Ptr("NodeTest"), + AvatarURL: Ptr("AvatarURLTest"), + HTMLURL: Ptr("Hurl"), + GravatarID: Ptr("gravatarIDTest"), + Name: Ptr("nameTest"), }}, } @@ -1007,9 +1007,9 @@ func TestCodeSearchResult_Marshal(t *testing.T) { testJSONMarshal(t, &CodeSearchResult{}, "{}") u := &CodeSearchResult{ - Total: Int(4), - IncompleteResults: Bool(false), - CodeResults: []*CodeResult{{Name: String("n")}}, + Total: Ptr(4), + IncompleteResults: Ptr(false), + CodeResults: []*CodeResult{{Name: Ptr("n")}}, } want := `{ diff --git a/github/secret_scanning_test.go b/github/secret_scanning_test.go index de3afb7cd52..6eea92de933 100644 --- a/github/secret_scanning_test.go +++ b/github/secret_scanning_test.go @@ -55,21 +55,21 @@ func TestSecretScanningService_ListAlertsForEnterprise(t *testing.T) { date := Timestamp{time.Date(1996, time.June, 20, 00, 00, 00, 0, time.UTC)} want := []*SecretScanningAlert{ { - Number: Int(1), + Number: Ptr(1), CreatedAt: &date, - URL: String("https://api.github.com/repos/o/r/secret-scanning/alerts/1"), - HTMLURL: String("https://github.com/o/r/security/secret-scanning/1"), - LocationsURL: String("https://api.github.com/repos/o/r/secret-scanning/alerts/1/locations"), - State: String("open"), + URL: Ptr("https://api.github.com/repos/o/r/secret-scanning/alerts/1"), + HTMLURL: Ptr("https://github.com/o/r/security/secret-scanning/1"), + LocationsURL: Ptr("https://api.github.com/repos/o/r/secret-scanning/alerts/1/locations"), + State: Ptr("open"), Resolution: nil, ResolvedAt: nil, ResolvedBy: nil, - SecretType: String("mailchimp_api_key"), - Secret: String("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2"), + SecretType: Ptr("mailchimp_api_key"), + Secret: Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2"), Repository: &Repository{ - ID: Int64(1), - URL: String("url"), - Name: String("n"), + ID: Ptr(int64(1)), + URL: Ptr("url"), + Name: Ptr("n"), }, }, } @@ -125,17 +125,17 @@ func TestSecretScanningService_ListAlertsForOrg(t *testing.T) { date := Timestamp{time.Date(1996, time.June, 20, 00, 00, 00, 0, time.UTC)} want := []*SecretScanningAlert{ { - Number: Int(1), + Number: Ptr(1), CreatedAt: &date, - URL: String("https://api.github.com/repos/o/r/secret-scanning/alerts/1"), - HTMLURL: String("https://github.com/o/r/security/secret-scanning/1"), - LocationsURL: String("https://api.github.com/repos/o/r/secret-scanning/alerts/1/locations"), - State: String("open"), + URL: Ptr("https://api.github.com/repos/o/r/secret-scanning/alerts/1"), + HTMLURL: Ptr("https://github.com/o/r/security/secret-scanning/1"), + LocationsURL: Ptr("https://api.github.com/repos/o/r/secret-scanning/alerts/1/locations"), + State: Ptr("open"), Resolution: nil, ResolvedAt: nil, ResolvedBy: nil, - SecretType: String("mailchimp_api_key"), - Secret: String("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2"), + SecretType: Ptr("mailchimp_api_key"), + Secret: Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2"), }, } @@ -192,17 +192,17 @@ func TestSecretScanningService_ListAlertsForOrgListOptions(t *testing.T) { date := Timestamp{time.Date(1996, time.June, 20, 00, 00, 00, 0, time.UTC)} want := []*SecretScanningAlert{ { - Number: Int(1), + Number: Ptr(1), CreatedAt: &date, - URL: String("https://api.github.com/repos/o/r/secret-scanning/alerts/1"), - HTMLURL: String("https://github.com/o/r/security/secret-scanning/1"), - LocationsURL: String("https://api.github.com/repos/o/r/secret-scanning/alerts/1/locations"), - State: String("open"), + URL: Ptr("https://api.github.com/repos/o/r/secret-scanning/alerts/1"), + HTMLURL: Ptr("https://github.com/o/r/security/secret-scanning/1"), + LocationsURL: Ptr("https://api.github.com/repos/o/r/secret-scanning/alerts/1/locations"), + State: Ptr("open"), Resolution: nil, ResolvedAt: nil, ResolvedBy: nil, - SecretType: String("mailchimp_api_key"), - Secret: String("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2"), + SecretType: Ptr("mailchimp_api_key"), + Secret: Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2"), }, } @@ -257,17 +257,17 @@ func TestSecretScanningService_ListAlertsForRepo(t *testing.T) { date := Timestamp{time.Date(1996, time.June, 20, 00, 00, 00, 0, time.UTC)} want := []*SecretScanningAlert{ { - Number: Int(1), + Number: Ptr(1), CreatedAt: &date, - URL: String("https://api.github.com/repos/o/r/secret-scanning/alerts/1"), - HTMLURL: String("https://github.com/o/r/security/secret-scanning/1"), - LocationsURL: String("https://api.github.com/repos/o/r/secret-scanning/alerts/1/locations"), - State: String("open"), + URL: Ptr("https://api.github.com/repos/o/r/secret-scanning/alerts/1"), + HTMLURL: Ptr("https://github.com/o/r/security/secret-scanning/1"), + LocationsURL: Ptr("https://api.github.com/repos/o/r/secret-scanning/alerts/1/locations"), + State: Ptr("open"), Resolution: nil, ResolvedAt: nil, ResolvedBy: nil, - SecretType: String("mailchimp_api_key"), - Secret: String("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2"), + SecretType: Ptr("mailchimp_api_key"), + Secret: Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2"), }, } @@ -319,17 +319,17 @@ func TestSecretScanningService_GetAlert(t *testing.T) { date := Timestamp{time.Date(1996, time.June, 20, 00, 00, 00, 0, time.UTC)} want := &SecretScanningAlert{ - Number: Int(1), + Number: Ptr(1), CreatedAt: &date, - URL: String("https://api.github.com/repos/o/r/secret-scanning/alerts/1"), - HTMLURL: String("https://github.com/o/r/security/secret-scanning/1"), - LocationsURL: String("https://api.github.com/repos/o/r/secret-scanning/alerts/1/locations"), - State: String("open"), + URL: Ptr("https://api.github.com/repos/o/r/secret-scanning/alerts/1"), + HTMLURL: Ptr("https://github.com/o/r/security/secret-scanning/1"), + LocationsURL: Ptr("https://api.github.com/repos/o/r/secret-scanning/alerts/1/locations"), + State: Ptr("open"), Resolution: nil, ResolvedAt: nil, ResolvedBy: nil, - SecretType: String("mailchimp_api_key"), - Secret: String("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2"), + SecretType: Ptr("mailchimp_api_key"), + Secret: Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2"), } if !cmp.Equal(alert, want) { @@ -359,7 +359,7 @@ func TestSecretScanningService_UpdateAlert(t *testing.T) { v := new(SecretScanningAlertUpdateOptions) assertNilError(t, json.NewDecoder(r.Body).Decode(v)) - want := &SecretScanningAlertUpdateOptions{State: "resolved", Resolution: String("used_in_tests"), ResolutionComment: String("resolution comment")} + want := &SecretScanningAlertUpdateOptions{State: "resolved", Resolution: Ptr("used_in_tests")} if !cmp.Equal(v, want) { t.Errorf("Request body = %+v, want %+v", v, want) @@ -382,7 +382,7 @@ func TestSecretScanningService_UpdateAlert(t *testing.T) { }) ctx := context.Background() - opts := &SecretScanningAlertUpdateOptions{State: "resolved", Resolution: String("used_in_tests"), ResolutionComment: String("resolution comment")} + opts := &SecretScanningAlertUpdateOptions{State: "resolved", Resolution: Ptr("used_in_tests")} alert, _, err := client.SecretScanning.UpdateAlert(ctx, "o", "r", 1, opts) if err != nil { @@ -391,18 +391,18 @@ func TestSecretScanningService_UpdateAlert(t *testing.T) { date := Timestamp{time.Date(1996, time.June, 20, 00, 00, 00, 0, time.UTC)} want := &SecretScanningAlert{ - Number: Int(1), + Number: Ptr(1), CreatedAt: &date, - URL: String("https://api.github.com/repos/o/r/secret-scanning/alerts/1"), - HTMLURL: String("https://github.com/o/r/security/secret-scanning/1"), - LocationsURL: String("https://api.github.com/repos/o/r/secret-scanning/alerts/1/locations"), - State: String("resolved"), - Resolution: String("used_in_tests"), - ResolutionComment: String("resolution comment"), + URL: Ptr("https://api.github.com/repos/o/r/secret-scanning/alerts/1"), + HTMLURL: Ptr("https://github.com/o/r/security/secret-scanning/1"), + LocationsURL: Ptr("https://api.github.com/repos/o/r/secret-scanning/alerts/1/locations"), + State: Ptr("resolved"), + Resolution: Ptr("used_in_tests"), + ResolutionComment: Ptr("resolution comment"), ResolvedAt: &date, ResolvedBy: nil, - SecretType: String("mailchimp_api_key"), - Secret: String("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2"), + SecretType: Ptr("mailchimp_api_key"), + Secret: Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2"), } if !cmp.Equal(alert, want) { @@ -456,17 +456,17 @@ func TestSecretScanningService_ListLocationsForAlert(t *testing.T) { want := []*SecretScanningAlertLocation{ { - Type: String("commit"), + Type: Ptr("commit"), Details: &SecretScanningAlertLocationDetails{ - Path: String("/example/secrets.txt"), - Startline: Int(1), - EndLine: Int(1), - StartColumn: Int(1), - EndColumn: Int(64), - BlobSHA: String("af5626b4a114abcb82d63db7c8082c3c4756e51b"), - BlobURL: String("https://api.github.com/repos/o/r/git/blobs/af5626b4a114abcb82d63db7c8082c3c4756e51b"), - CommitSHA: String("f14d7debf9775f957cf4f1e8176da0786431f72b"), - CommitURL: String("https://api.github.com/repos/o/r/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b"), + Path: Ptr("/example/secrets.txt"), + Startline: Ptr(1), + EndLine: Ptr(1), + StartColumn: Ptr(1), + EndColumn: Ptr(64), + BlobSHA: Ptr("af5626b4a114abcb82d63db7c8082c3c4756e51b"), + BlobURL: Ptr("https://api.github.com/repos/o/r/git/blobs/af5626b4a114abcb82d63db7c8082c3c4756e51b"), + CommitSHA: Ptr("f14d7debf9775f957cf4f1e8176da0786431f72b"), + CommitURL: Ptr("https://api.github.com/repos/o/r/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b"), }, }, } @@ -493,22 +493,22 @@ func TestSecretScanningAlert_Marshal(t *testing.T) { testJSONMarshal(t, &SecretScanningAlert{}, `{}`) u := &SecretScanningAlert{ - Number: Int(1), + Number: Ptr(1), CreatedAt: &Timestamp{referenceTime}, - URL: String("https://api.github.com/teams/2/discussions/3/comments"), - HTMLURL: String("https://api.github.com/teams/2/discussions/3/comments"), - LocationsURL: String("https://api.github.com/teams/2/discussions/3/comments"), - State: String("test_state"), - Resolution: String("test_resolution"), + URL: Ptr("https://api.github.com/teams/2/discussions/3/comments"), + HTMLURL: Ptr("https://api.github.com/teams/2/discussions/3/comments"), + LocationsURL: Ptr("https://api.github.com/teams/2/discussions/3/comments"), + State: Ptr("test_state"), + Resolution: Ptr("test_resolution"), ResolvedAt: &Timestamp{referenceTime}, ResolvedBy: &User{ - Login: String("test"), - ID: Int64(10), - NodeID: String("A123"), - AvatarURL: String("https://api.github.com/teams/2/discussions/3/comments"), + Login: Ptr("test"), + ID: Ptr(int64(10)), + NodeID: Ptr("A123"), + AvatarURL: Ptr("https://api.github.com/teams/2/discussions/3/comments"), }, - SecretType: String("test"), - Secret: String("test"), + SecretType: Ptr("test"), + Secret: Ptr("test"), } want := `{ @@ -538,17 +538,17 @@ func TestSecretScanningAlertLocation_Marshal(t *testing.T) { testJSONMarshal(t, &SecretScanningAlertLocation{}, `{}`) u := &SecretScanningAlertLocation{ - Type: String("test"), + Type: Ptr("test"), Details: &SecretScanningAlertLocationDetails{ - Path: String("test_path"), - Startline: Int(10), - EndLine: Int(20), - StartColumn: Int(30), - EndColumn: Int(40), - BlobSHA: String("test_sha"), - BlobURL: String("https://api.github.com/repos/o/r/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b"), - CommitSHA: String("test_sha"), - CommitURL: String("https://api.github.com/repos/o/r/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b"), + Path: Ptr("test_path"), + Startline: Ptr(10), + EndLine: Ptr(20), + StartColumn: Ptr(30), + EndColumn: Ptr(40), + BlobSHA: Ptr("test_sha"), + BlobURL: Ptr("https://api.github.com/repos/o/r/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b"), + CommitSHA: Ptr("test_sha"), + CommitURL: Ptr("https://api.github.com/repos/o/r/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b"), }, } @@ -575,15 +575,15 @@ func TestSecretScanningAlertLocationDetails_Marshal(t *testing.T) { testJSONMarshal(t, &SecretScanningAlertLocationDetails{}, `{}`) u := &SecretScanningAlertLocationDetails{ - Path: String("test_path"), - Startline: Int(10), - EndLine: Int(20), - StartColumn: Int(30), - EndColumn: Int(40), - BlobSHA: String("test_sha"), - BlobURL: String("https://api.github.com/repos/o/r/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b"), - CommitSHA: String("test_sha"), - CommitURL: String("https://api.github.com/repos/o/r/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b"), + Path: Ptr("test_path"), + Startline: Ptr(10), + EndLine: Ptr(20), + StartColumn: Ptr(30), + EndColumn: Ptr(40), + BlobSHA: Ptr("test_sha"), + BlobURL: Ptr("https://api.github.com/repos/o/r/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b"), + CommitSHA: Ptr("test_sha"), + CommitURL: Ptr("https://api.github.com/repos/o/r/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b"), } want := `{ @@ -607,7 +607,7 @@ func TestSecretScanningAlertUpdateOptions_Marshal(t *testing.T) { u := &SecretScanningAlertUpdateOptions{ State: "open", - Resolution: String("false_positive"), + Resolution: Ptr("false_positive"), } want := `{ diff --git a/github/security_advisories_test.go b/github/security_advisories_test.go index 8f5e1263570..ff421db49d9 100644 --- a/github/security_advisories_test.go +++ b/github/security_advisories_test.go @@ -172,49 +172,49 @@ func TestSecurityAdvisoriesService_CreateTemporaryPrivateFork(t *testing.T) { } want := &Repository{ - ID: Int64(1), - NodeID: String("R_kgDPP3c6pQ"), + ID: Ptr(int64(1)), + NodeID: Ptr("R_kgDPP3c6pQ"), Owner: &User{ - Login: String("owner"), - ID: Int64(2), - NodeID: String("MDQ6VXFGcjYyMjcyMTQw"), - AvatarURL: String("https://avatars.githubusercontent.com/u/111111?v=4"), - HTMLURL: String("https://github.com/xxxxx"), - GravatarID: String(""), - Type: String("User"), - SiteAdmin: Bool(false), - URL: String("https://api.github.com/users/owner"), - EventsURL: String("https://api.github.com/users/owner/events{/privacy}"), - FollowingURL: String("https://api.github.com/users/owner/following{/other_user}"), - FollowersURL: String("https://api.github.com/users/owner/followers"), - GistsURL: String("https://api.github.com/users/owner/gists{/gist_id}"), - OrganizationsURL: String("https://api.github.com/users/owner/orgs"), - ReceivedEventsURL: String("https://api.github.com/users/owner/received_events"), - ReposURL: String("https://api.github.com/users/owner/repos"), - StarredURL: String("https://api.github.com/users/owner/starred{/owner}{/repo}"), - SubscriptionsURL: String("https://api.github.com/users/owner/subscriptions"), + Login: Ptr("owner"), + ID: Ptr(int64(2)), + NodeID: Ptr("MDQ6VXFGcjYyMjcyMTQw"), + AvatarURL: Ptr("https://avatars.githubusercontent.com/u/111111?v=4"), + HTMLURL: Ptr("https://github.com/xxxxx"), + GravatarID: Ptr(""), + Type: Ptr("User"), + SiteAdmin: Ptr(false), + URL: Ptr("https://api.github.com/users/owner"), + EventsURL: Ptr("https://api.github.com/users/owner/events{/privacy}"), + FollowingURL: Ptr("https://api.github.com/users/owner/following{/other_user}"), + FollowersURL: Ptr("https://api.github.com/users/owner/followers"), + GistsURL: Ptr("https://api.github.com/users/owner/gists{/gist_id}"), + OrganizationsURL: Ptr("https://api.github.com/users/owner/orgs"), + ReceivedEventsURL: Ptr("https://api.github.com/users/owner/received_events"), + ReposURL: Ptr("https://api.github.com/users/owner/repos"), + StarredURL: Ptr("https://api.github.com/users/owner/starred{/owner}{/repo}"), + SubscriptionsURL: Ptr("https://api.github.com/users/owner/subscriptions"), }, - Name: String("repo-ghsa-xxxx-xxxx-xxxx"), - FullName: String("owner/repo-ghsa-xxxx-xxxx-xxxx"), - DefaultBranch: String("master"), + Name: Ptr("repo-ghsa-xxxx-xxxx-xxxx"), + FullName: Ptr("owner/repo-ghsa-xxxx-xxxx-xxxx"), + DefaultBranch: Ptr("master"), CreatedAt: &Timestamp{time.Date(2023, time.December, 8, 17, 22, 41, 0, time.UTC)}, PushedAt: &Timestamp{time.Date(2023, time.December, 3, 11, 27, 8, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2023, time.December, 8, 17, 22, 42, 0, time.UTC)}, - HTMLURL: String("https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx"), - CloneURL: String("https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git"), - GitURL: String("git://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git"), - SSHURL: String("git@github.com:owner/repo-ghsa-xxxx-xxxx-xxxx.git"), - SVNURL: String("https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx"), - 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), + HTMLURL: Ptr("https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx"), + CloneURL: Ptr("https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git"), + GitURL: Ptr("git://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git"), + SSHURL: Ptr("git@github.com:owner/repo-ghsa-xxxx-xxxx-xxxx.git"), + SVNURL: Ptr("https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx"), + Fork: Ptr(false), + ForksCount: Ptr(0), + NetworkCount: Ptr(0), + OpenIssuesCount: Ptr(0), + OpenIssues: Ptr(0), + StargazersCount: Ptr(0), + SubscribersCount: Ptr(0), + WatchersCount: Ptr(0), + Watchers: Ptr(0), + Size: Ptr(0), Permissions: map[string]bool{ "admin": true, "maintain": true, @@ -222,55 +222,55 @@ func TestSecurityAdvisoriesService_CreateTemporaryPrivateFork(t *testing.T) { "push": true, "triage": true, }, - AllowForking: Bool(true), - WebCommitSignoffRequired: Bool(false), - Archived: Bool(false), - Disabled: Bool(false), - Private: Bool(true), - HasIssues: Bool(false), - HasWiki: Bool(false), - HasPages: Bool(false), - HasProjects: Bool(false), - HasDownloads: Bool(false), - HasDiscussions: Bool(false), - IsTemplate: Bool(false), - URL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx"), - ArchiveURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/{archive_format}{/ref}"), - AssigneesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/assignees{/user}"), - BlobsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/blobs{/sha}"), - BranchesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/branches{/branch}"), - CollaboratorsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/collaborators{/collaborator}"), - CommentsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/comments{/number}"), - CommitsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/commits{/sha}"), - CompareURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/compare/{base}...{head}"), - ContentsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contents/{+path}"), - ContributorsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contributors"), - DeploymentsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/deployments"), - DownloadsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/downloads"), - EventsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/events"), - ForksURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/forks"), - GitCommitsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/commits{/sha}"), - GitRefsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/refs{/sha}"), - GitTagsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/tags{/sha}"), - HooksURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/hooks"), - IssueCommentURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/comments{/number}"), - IssueEventsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/events{/number}"), - IssuesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues{/number}"), - KeysURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/keys{/key_id}"), - LabelsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/labels{/name}"), - LanguagesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/languages"), - MergesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/merges"), - MilestonesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/milestones{/number}"), - NotificationsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/notifications{?since,all,participating}"), - PullsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/pulls{/number}"), - ReleasesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/releases{/id}"), - StargazersURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/stargazers"), - StatusesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/statuses/{sha}"), - SubscribersURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscribers"), - SubscriptionURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscription"), - TagsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/tags"), - TeamsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/teams"), - Visibility: String("private"), + AllowForking: Ptr(true), + WebCommitSignoffRequired: Ptr(false), + Archived: Ptr(false), + Disabled: Ptr(false), + Private: Ptr(true), + HasIssues: Ptr(false), + HasWiki: Ptr(false), + HasPages: Ptr(false), + HasProjects: Ptr(false), + HasDownloads: Ptr(false), + HasDiscussions: Ptr(false), + IsTemplate: Ptr(false), + URL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx"), + ArchiveURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/{archive_format}{/ref}"), + AssigneesURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/assignees{/user}"), + BlobsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/blobs{/sha}"), + BranchesURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/branches{/branch}"), + CollaboratorsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/collaborators{/collaborator}"), + CommentsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/comments{/number}"), + CommitsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/commits{/sha}"), + CompareURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/compare/{base}...{head}"), + ContentsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contents/{+path}"), + ContributorsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contributors"), + DeploymentsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/deployments"), + DownloadsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/downloads"), + EventsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/events"), + ForksURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/forks"), + GitCommitsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/commits{/sha}"), + GitRefsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/refs{/sha}"), + GitTagsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/tags{/sha}"), + HooksURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/hooks"), + IssueCommentURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/comments{/number}"), + IssueEventsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/events{/number}"), + IssuesURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues{/number}"), + KeysURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/keys{/key_id}"), + LabelsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/labels{/name}"), + LanguagesURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/languages"), + MergesURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/merges"), + MilestonesURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/milestones{/number}"), + NotificationsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/notifications{?since,all,participating}"), + PullsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/pulls{/number}"), + ReleasesURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/releases{/id}"), + StargazersURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/stargazers"), + StatusesURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/statuses/{sha}"), + SubscribersURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscribers"), + SubscriptionURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscription"), + TagsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/tags"), + TeamsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/teams"), + Visibility: Ptr("private"), } if !cmp.Equal(fork, want) { t.Errorf("SecurityAdvisoriesService.CreateTemporaryPrivateFork returned %+v, want %+v", fork, want) @@ -408,49 +408,49 @@ func TestSecurityAdvisoriesService_CreateTemporaryPrivateFork_deferred(t *testin } want := &Repository{ - ID: Int64(1), - NodeID: String("R_kgDPP3c6pQ"), + ID: Ptr(int64(1)), + NodeID: Ptr("R_kgDPP3c6pQ"), Owner: &User{ - Login: String("owner"), - ID: Int64(2), - NodeID: String("MDQ6VXFGcjYyMjcyMTQw"), - AvatarURL: String("https://avatars.githubusercontent.com/u/111111?v=4"), - HTMLURL: String("https://github.com/xxxxx"), - GravatarID: String(""), - Type: String("User"), - SiteAdmin: Bool(false), - URL: String("https://api.github.com/users/owner"), - EventsURL: String("https://api.github.com/users/owner/events{/privacy}"), - FollowingURL: String("https://api.github.com/users/owner/following{/other_user}"), - FollowersURL: String("https://api.github.com/users/owner/followers"), - GistsURL: String("https://api.github.com/users/owner/gists{/gist_id}"), - OrganizationsURL: String("https://api.github.com/users/owner/orgs"), - ReceivedEventsURL: String("https://api.github.com/users/owner/received_events"), - ReposURL: String("https://api.github.com/users/owner/repos"), - StarredURL: String("https://api.github.com/users/owner/starred{/owner}{/repo}"), - SubscriptionsURL: String("https://api.github.com/users/owner/subscriptions"), + Login: Ptr("owner"), + ID: Ptr(int64(2)), + NodeID: Ptr("MDQ6VXFGcjYyMjcyMTQw"), + AvatarURL: Ptr("https://avatars.githubusercontent.com/u/111111?v=4"), + HTMLURL: Ptr("https://github.com/xxxxx"), + GravatarID: Ptr(""), + Type: Ptr("User"), + SiteAdmin: Ptr(false), + URL: Ptr("https://api.github.com/users/owner"), + EventsURL: Ptr("https://api.github.com/users/owner/events{/privacy}"), + FollowingURL: Ptr("https://api.github.com/users/owner/following{/other_user}"), + FollowersURL: Ptr("https://api.github.com/users/owner/followers"), + GistsURL: Ptr("https://api.github.com/users/owner/gists{/gist_id}"), + OrganizationsURL: Ptr("https://api.github.com/users/owner/orgs"), + ReceivedEventsURL: Ptr("https://api.github.com/users/owner/received_events"), + ReposURL: Ptr("https://api.github.com/users/owner/repos"), + StarredURL: Ptr("https://api.github.com/users/owner/starred{/owner}{/repo}"), + SubscriptionsURL: Ptr("https://api.github.com/users/owner/subscriptions"), }, - Name: String("repo-ghsa-xxxx-xxxx-xxxx"), - FullName: String("owner/repo-ghsa-xxxx-xxxx-xxxx"), - DefaultBranch: String("master"), + Name: Ptr("repo-ghsa-xxxx-xxxx-xxxx"), + FullName: Ptr("owner/repo-ghsa-xxxx-xxxx-xxxx"), + DefaultBranch: Ptr("master"), CreatedAt: &Timestamp{time.Date(2023, time.December, 8, 17, 22, 41, 0, time.UTC)}, PushedAt: &Timestamp{time.Date(2023, time.December, 3, 11, 27, 8, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2023, time.December, 8, 17, 22, 42, 0, time.UTC)}, - HTMLURL: String("https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx"), - CloneURL: String("https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git"), - GitURL: String("git://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git"), - SSHURL: String("git@github.com:owner/repo-ghsa-xxxx-xxxx-xxxx.git"), - SVNURL: String("https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx"), - 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), + HTMLURL: Ptr("https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx"), + CloneURL: Ptr("https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git"), + GitURL: Ptr("git://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git"), + SSHURL: Ptr("git@github.com:owner/repo-ghsa-xxxx-xxxx-xxxx.git"), + SVNURL: Ptr("https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx"), + Fork: Ptr(false), + ForksCount: Ptr(0), + NetworkCount: Ptr(0), + OpenIssuesCount: Ptr(0), + OpenIssues: Ptr(0), + StargazersCount: Ptr(0), + SubscribersCount: Ptr(0), + WatchersCount: Ptr(0), + Watchers: Ptr(0), + Size: Ptr(0), Permissions: map[string]bool{ "admin": true, "maintain": true, @@ -458,55 +458,55 @@ func TestSecurityAdvisoriesService_CreateTemporaryPrivateFork_deferred(t *testin "push": true, "triage": true, }, - AllowForking: Bool(true), - WebCommitSignoffRequired: Bool(false), - Archived: Bool(false), - Disabled: Bool(false), - Private: Bool(true), - HasIssues: Bool(false), - HasWiki: Bool(false), - HasPages: Bool(false), - HasProjects: Bool(false), - HasDownloads: Bool(false), - HasDiscussions: Bool(false), - IsTemplate: Bool(false), - URL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx"), - ArchiveURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/{archive_format}{/ref}"), - AssigneesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/assignees{/user}"), - BlobsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/blobs{/sha}"), - BranchesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/branches{/branch}"), - CollaboratorsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/collaborators{/collaborator}"), - CommentsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/comments{/number}"), - CommitsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/commits{/sha}"), - CompareURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/compare/{base}...{head}"), - ContentsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contents/{+path}"), - ContributorsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contributors"), - DeploymentsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/deployments"), - DownloadsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/downloads"), - EventsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/events"), - ForksURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/forks"), - GitCommitsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/commits{/sha}"), - GitRefsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/refs{/sha}"), - GitTagsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/tags{/sha}"), - HooksURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/hooks"), - IssueCommentURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/comments{/number}"), - IssueEventsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/events{/number}"), - IssuesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues{/number}"), - KeysURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/keys{/key_id}"), - LabelsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/labels{/name}"), - LanguagesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/languages"), - MergesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/merges"), - MilestonesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/milestones{/number}"), - NotificationsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/notifications{?since,all,participating}"), - PullsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/pulls{/number}"), - ReleasesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/releases{/id}"), - StargazersURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/stargazers"), - StatusesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/statuses/{sha}"), - SubscribersURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscribers"), - SubscriptionURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscription"), - TagsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/tags"), - TeamsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/teams"), - Visibility: String("private"), + AllowForking: Ptr(true), + WebCommitSignoffRequired: Ptr(false), + Archived: Ptr(false), + Disabled: Ptr(false), + Private: Ptr(true), + HasIssues: Ptr(false), + HasWiki: Ptr(false), + HasPages: Ptr(false), + HasProjects: Ptr(false), + HasDownloads: Ptr(false), + HasDiscussions: Ptr(false), + IsTemplate: Ptr(false), + URL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx"), + ArchiveURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/{archive_format}{/ref}"), + AssigneesURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/assignees{/user}"), + BlobsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/blobs{/sha}"), + BranchesURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/branches{/branch}"), + CollaboratorsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/collaborators{/collaborator}"), + CommentsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/comments{/number}"), + CommitsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/commits{/sha}"), + CompareURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/compare/{base}...{head}"), + ContentsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contents/{+path}"), + ContributorsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contributors"), + DeploymentsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/deployments"), + DownloadsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/downloads"), + EventsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/events"), + ForksURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/forks"), + GitCommitsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/commits{/sha}"), + GitRefsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/refs{/sha}"), + GitTagsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/tags{/sha}"), + HooksURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/hooks"), + IssueCommentURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/comments{/number}"), + IssueEventsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/events{/number}"), + IssuesURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues{/number}"), + KeysURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/keys{/key_id}"), + LabelsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/labels{/name}"), + LanguagesURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/languages"), + MergesURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/merges"), + MilestonesURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/milestones{/number}"), + NotificationsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/notifications{?since,all,participating}"), + PullsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/pulls{/number}"), + ReleasesURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/releases{/id}"), + StargazersURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/stargazers"), + StatusesURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/statuses/{sha}"), + SubscribersURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscribers"), + SubscriptionURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscription"), + TagsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/tags"), + TeamsURL: Ptr("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/teams"), + Visibility: Ptr("private"), } if !cmp.Equal(fork, want) { t.Errorf("SecurityAdvisoriesService.CreateTemporaryPrivateFork returned %+v, want %+v", fork, want) @@ -628,8 +628,8 @@ func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisoriesForOrg(t *tes want := []*SecurityAdvisory{ { - GHSAID: String("GHSA-abcd-1234-efgh"), - CVEID: String("CVE-2050-00000"), + GHSAID: Ptr("GHSA-abcd-1234-efgh"), + CVEID: Ptr("CVE-2050-00000"), }, } if !cmp.Equal(advisories, want) { @@ -759,8 +759,8 @@ func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisories(t *testing.T want := []*SecurityAdvisory{ { - GHSAID: String("GHSA-abcd-1234-efgh"), - CVEID: String("CVE-2050-00000"), + GHSAID: Ptr("GHSA-abcd-1234-efgh"), + CVEID: Ptr("CVE-2050-00000"), }, } if !cmp.Equal(advisories, want) { @@ -871,7 +871,7 @@ func TestListGlobalSecurityAdvisories(t *testing.T) { }) ctx := context.Background() - opts := &ListGlobalSecurityAdvisoriesOptions{CVEID: String("CVE-xoxo-1234")} + opts := &ListGlobalSecurityAdvisoriesOptions{CVEID: Ptr("CVE-xoxo-1234")} advisories, _, err := client.SecurityAdvisories.ListGlobalSecurityAdvisories(ctx, opts) if err != nil { @@ -881,36 +881,36 @@ func TestListGlobalSecurityAdvisories(t *testing.T) { date := Timestamp{time.Date(1996, time.June, 20, 00, 00, 00, 0, time.UTC)} want := []*GlobalSecurityAdvisory{ { - ID: Int64(1), + ID: Ptr(int64(1)), SecurityAdvisory: SecurityAdvisory{ - GHSAID: String("GHSA-xoxo-1234-xoxo"), - CVEID: String("CVE-xoxo-1234"), - URL: String("https://api.github.com/advisories/GHSA-xoxo-1234-xoxo"), - HTMLURL: String("https://github.com/advisories/GHSA-xoxo-1234-xoxo"), - Severity: String("high"), - Summary: String("Heartbleed security advisory"), - Description: String("This bug allows an attacker to read portions of the affected server’s memory, potentially disclosing sensitive information."), + GHSAID: Ptr("GHSA-xoxo-1234-xoxo"), + CVEID: Ptr("CVE-xoxo-1234"), + URL: Ptr("https://api.github.com/advisories/GHSA-xoxo-1234-xoxo"), + HTMLURL: Ptr("https://github.com/advisories/GHSA-xoxo-1234-xoxo"), + Severity: Ptr("high"), + Summary: Ptr("Heartbleed security advisory"), + Description: Ptr("This bug allows an attacker to read portions of the affected server’s memory, potentially disclosing sensitive information."), Identifiers: []*AdvisoryIdentifier{ { - Type: String("GHSA"), - Value: String("GHSA-xoxo-1234-xoxo"), + Type: Ptr("GHSA"), + Value: Ptr("GHSA-xoxo-1234-xoxo"), }, { - Type: String("CVE"), - Value: String("CVE-xoxo-1234"), + Type: Ptr("CVE"), + Value: Ptr("CVE-xoxo-1234"), }, }, PublishedAt: &date, UpdatedAt: &date, WithdrawnAt: nil, CVSS: &AdvisoryCVSS{ - VectorString: String("CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:H"), - Score: Float64(7.6), + VectorString: Ptr("CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:H"), + Score: Ptr(7.6), }, CWEs: []*AdvisoryCWEs{ { - CWEID: String("CWE-400"), - Name: String("Uncontrolled Resource Consumption"), + CWEID: Ptr("CWE-400"), + Name: Ptr("Uncontrolled Resource Consumption"), }, }, }, @@ -918,42 +918,42 @@ func TestListGlobalSecurityAdvisories(t *testing.T) { Vulnerabilities: []*GlobalSecurityVulnerability{ { Package: &VulnerabilityPackage{ - Ecosystem: String("npm"), - Name: String("a-package"), + Ecosystem: Ptr("npm"), + Name: Ptr("a-package"), }, - FirstPatchedVersion: String("1.0.3"), - VulnerableVersionRange: String("<=1.0.2"), + FirstPatchedVersion: Ptr("1.0.3"), + VulnerableVersionRange: Ptr("<=1.0.2"), VulnerableFunctions: []string{"a_function"}, }, }, - RepositoryAdvisoryURL: String("https://api.github.com/repos/project/a-package/security-advisories/GHSA-xoxo-1234-xoxo"), - Type: String("reviewed"), - SourceCodeLocation: String("https://github.com/project/a-package"), + RepositoryAdvisoryURL: Ptr("https://api.github.com/repos/project/a-package/security-advisories/GHSA-xoxo-1234-xoxo"), + Type: Ptr("reviewed"), + SourceCodeLocation: Ptr("https://github.com/project/a-package"), GithubReviewedAt: &date, NVDPublishedAt: &date, Credits: []*Credit{ { User: &User{ - Login: String("user"), - ID: Int64(1), - NodeID: String("12="), - AvatarURL: String("a"), - GravatarID: String(""), - URL: String("a"), - HTMLURL: String("b"), - FollowersURL: String("b"), - FollowingURL: String("c"), - GistsURL: String("d"), - StarredURL: String("e"), - SubscriptionsURL: String("f"), - OrganizationsURL: String("g"), - ReposURL: String("h"), - EventsURL: String("i"), - ReceivedEventsURL: String("j"), - Type: String("User"), - SiteAdmin: Bool(false), + Login: Ptr("user"), + ID: Ptr(int64(1)), + NodeID: Ptr("12="), + AvatarURL: Ptr("a"), + GravatarID: Ptr(""), + URL: Ptr("a"), + HTMLURL: Ptr("b"), + FollowersURL: Ptr("b"), + FollowingURL: Ptr("c"), + GistsURL: Ptr("d"), + StarredURL: Ptr("e"), + SubscriptionsURL: Ptr("f"), + OrganizationsURL: Ptr("g"), + ReposURL: Ptr("h"), + EventsURL: Ptr("i"), + ReceivedEventsURL: Ptr("j"), + Type: Ptr("User"), + SiteAdmin: Ptr(false), }, - Type: String("analyst"), + Type: Ptr("analyst"), }, }, }, @@ -1062,42 +1062,42 @@ func TestGetGlobalSecurityAdvisories(t *testing.T) { date := Timestamp{time.Date(1996, time.June, 20, 00, 00, 00, 0, time.UTC)} want := &GlobalSecurityAdvisory{ - ID: Int64(1), + ID: Ptr(int64(1)), SecurityAdvisory: SecurityAdvisory{ - GHSAID: String("GHSA-xoxo-1234-xoxo"), - CVEID: String("CVE-xoxo-1234"), - URL: String("https://api.github.com/advisories/GHSA-xoxo-1234-xoxo"), - HTMLURL: String("https://github.com/advisories/GHSA-xoxo-1234-xoxo"), - Severity: String("high"), - Summary: String("Heartbleed security advisory"), - Description: String("This bug allows an attacker to read portions of the affected server’s memory, potentially disclosing sensitive information."), + GHSAID: Ptr("GHSA-xoxo-1234-xoxo"), + CVEID: Ptr("CVE-xoxo-1234"), + URL: Ptr("https://api.github.com/advisories/GHSA-xoxo-1234-xoxo"), + HTMLURL: Ptr("https://github.com/advisories/GHSA-xoxo-1234-xoxo"), + Severity: Ptr("high"), + Summary: Ptr("Heartbleed security advisory"), + Description: Ptr("This bug allows an attacker to read portions of the affected server’s memory, potentially disclosing sensitive information."), Identifiers: []*AdvisoryIdentifier{ { - Type: String("GHSA"), - Value: String("GHSA-xoxo-1234-xoxo"), + Type: Ptr("GHSA"), + Value: Ptr("GHSA-xoxo-1234-xoxo"), }, { - Type: String("CVE"), - Value: String("CVE-xoxo-1234"), + Type: Ptr("CVE"), + Value: Ptr("CVE-xoxo-1234"), }, }, PublishedAt: &date, UpdatedAt: &date, WithdrawnAt: nil, CVSS: &AdvisoryCVSS{ - VectorString: String("CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:H"), - Score: Float64(7.6), + VectorString: Ptr("CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:H"), + Score: Ptr(7.6), }, CWEs: []*AdvisoryCWEs{ { - CWEID: String("CWE-400"), - Name: String("Uncontrolled Resource Consumption"), + CWEID: Ptr("CWE-400"), + Name: Ptr("Uncontrolled Resource Consumption"), }, }, }, - RepositoryAdvisoryURL: String("https://api.github.com/repos/project/a-package/security-advisories/GHSA-xoxo-1234-xoxo"), - Type: String("reviewed"), - SourceCodeLocation: String("https://github.com/project/a-package"), + RepositoryAdvisoryURL: Ptr("https://api.github.com/repos/project/a-package/security-advisories/GHSA-xoxo-1234-xoxo"), + Type: Ptr("reviewed"), + SourceCodeLocation: Ptr("https://github.com/project/a-package"), References: []string{"https://nvd.nist.gov/vuln/detail/CVE-xoxo-1234"}, GithubReviewedAt: &date, NVDPublishedAt: &date, @@ -1105,37 +1105,37 @@ func TestGetGlobalSecurityAdvisories(t *testing.T) { Vulnerabilities: []*GlobalSecurityVulnerability{ { Package: &VulnerabilityPackage{ - Ecosystem: String("npm"), - Name: String("a-package"), + Ecosystem: Ptr("npm"), + Name: Ptr("a-package"), }, - FirstPatchedVersion: String("1.0.3"), - VulnerableVersionRange: String("<=1.0.2"), + FirstPatchedVersion: Ptr("1.0.3"), + VulnerableVersionRange: Ptr("<=1.0.2"), VulnerableFunctions: []string{"a_function"}, }, }, Credits: []*Credit{ { User: &User{ - Login: String("user"), - ID: Int64(1), - NodeID: String("12="), - AvatarURL: String("a"), - GravatarID: String(""), - URL: String("a"), - HTMLURL: String("b"), - FollowersURL: String("b"), - FollowingURL: String("c"), - GistsURL: String("d"), - StarredURL: String("e"), - SubscriptionsURL: String("f"), - OrganizationsURL: String("g"), - ReposURL: String("h"), - EventsURL: String("i"), - ReceivedEventsURL: String("j"), - Type: String("User"), - SiteAdmin: Bool(false), + Login: Ptr("user"), + ID: Ptr(int64(1)), + NodeID: Ptr("12="), + AvatarURL: Ptr("a"), + GravatarID: Ptr(""), + URL: Ptr("a"), + HTMLURL: Ptr("b"), + FollowersURL: Ptr("b"), + FollowingURL: Ptr("c"), + GistsURL: Ptr("d"), + StarredURL: Ptr("e"), + SubscriptionsURL: Ptr("f"), + OrganizationsURL: Ptr("g"), + ReposURL: Ptr("h"), + EventsURL: Ptr("i"), + ReceivedEventsURL: Ptr("j"), + Type: Ptr("User"), + SiteAdmin: Ptr(false), }, - Type: String("analyst"), + Type: Ptr("analyst"), }, }, } @@ -1165,7 +1165,7 @@ func TestSecurityAdvisorySubmission_Marshal(t *testing.T) { testJSONMarshal(t, &SecurityAdvisorySubmission{}, `{}`) u := &SecurityAdvisorySubmission{ - Accepted: Bool(true), + Accepted: Ptr(true), } w := `{ @@ -1180,8 +1180,8 @@ func TestRepoAdvisoryCredit_Marshal(t *testing.T) { testJSONMarshal(t, &RepoAdvisoryCredit{}, `{}`) u := &RepoAdvisoryCredit{ - Login: String("l"), - Type: String("t"), + Login: Ptr("l"), + Type: Ptr("t"), } w := `{ @@ -1198,67 +1198,67 @@ func TestRepoAdvisoryCreditDetailed_Marshal(t *testing.T) { testDate := &Timestamp{time.Date(2019, time.August, 10, 14, 59, 22, 0, time.UTC)} u := &RepoAdvisoryCreditDetailed{ - Type: String("t"), - State: String("s"), + Type: Ptr("t"), + State: Ptr("s"), User: &User{ - Name: String("u"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(false), - Bio: String("bio"), - TwitterUsername: String("tu"), - PublicRepos: Int(1), - PublicGists: Int(1), - Followers: Int(2), - Following: Int(2), + Name: Ptr("u"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(false), + Bio: Ptr("bio"), + TwitterUsername: Ptr("tu"), + PublicRepos: Ptr(1), + PublicGists: Ptr(1), + Followers: Ptr(2), + Following: Ptr(2), CreatedAt: testDate, UpdatedAt: testDate, SuspendedAt: testDate, - Type: String("type"), - SiteAdmin: Bool(false), - TotalPrivateRepos: Int64(10), - OwnedPrivateRepos: Int64(10), - PrivateGists: Int(10), - DiskUsage: Int(10), - Collaborators: Int(10), - TwoFactorAuthentication: Bool(true), + Type: Ptr("type"), + SiteAdmin: Ptr(false), + TotalPrivateRepos: Ptr(int64(10)), + OwnedPrivateRepos: Ptr(int64(10)), + PrivateGists: Ptr(10), + DiskUsage: Ptr(10), + Collaborators: Ptr(10), + TwoFactorAuthentication: Ptr(true), Plan: &Plan{ - Name: String("p"), - Space: Int(2), - Collaborators: Int(2), - PrivateRepos: Int64(2), - Seats: Int(2), - FilledSeats: Int(1), + Name: Ptr("p"), + Space: Ptr(2), + Collaborators: Ptr(2), + PrivateRepos: Ptr(int64(2)), + Seats: Ptr(2), + FilledSeats: Ptr(1), }, - LdapDn: String("l"), - URL: String("url"), - EventsURL: String("e"), - FollowingURL: String("f"), - FollowersURL: String("f"), - GistsURL: String("g"), - OrganizationsURL: String("o"), - ReceivedEventsURL: String("r"), - ReposURL: String("rep"), - StarredURL: String("star"), - SubscriptionsURL: String("sub"), + LdapDn: Ptr("l"), + URL: Ptr("url"), + EventsURL: Ptr("e"), + FollowingURL: Ptr("f"), + FollowersURL: Ptr("f"), + GistsURL: Ptr("g"), + OrganizationsURL: Ptr("o"), + ReceivedEventsURL: Ptr("r"), + ReposURL: Ptr("rep"), + StarredURL: Ptr("star"), + SubscriptionsURL: Ptr("sub"), TextMatches: []*TextMatch{ { - ObjectURL: String("u"), - ObjectType: String("t"), - Property: String("p"), - Fragment: String("f"), + ObjectURL: Ptr("u"), + ObjectType: Ptr("t"), + Property: Ptr("p"), + Fragment: Ptr("f"), Matches: []*Match{ { - Text: String("t"), + Text: Ptr("t"), Indices: []int{1, 2}, }, }, }, }, Permissions: map[string]bool{"p1": true}, - RoleName: String("r"), + RoleName: Ptr("r"), }, } @@ -1338,66 +1338,66 @@ func TestCredit_Marshal(t *testing.T) { testDate := &Timestamp{time.Date(2019, time.August, 10, 14, 59, 22, 0, time.UTC)} u := &Credit{ - Type: String("t"), + Type: Ptr("t"), User: &User{ - Name: String("u"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(false), - Bio: String("bio"), - TwitterUsername: String("tu"), - PublicRepos: Int(1), - PublicGists: Int(1), - Followers: Int(2), - Following: Int(2), + Name: Ptr("u"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(false), + Bio: Ptr("bio"), + TwitterUsername: Ptr("tu"), + PublicRepos: Ptr(1), + PublicGists: Ptr(1), + Followers: Ptr(2), + Following: Ptr(2), CreatedAt: testDate, UpdatedAt: testDate, SuspendedAt: testDate, - Type: String("type"), - SiteAdmin: Bool(false), - TotalPrivateRepos: Int64(10), - OwnedPrivateRepos: Int64(10), - PrivateGists: Int(10), - DiskUsage: Int(10), - Collaborators: Int(10), - TwoFactorAuthentication: Bool(true), + Type: Ptr("type"), + SiteAdmin: Ptr(false), + TotalPrivateRepos: Ptr(int64(10)), + OwnedPrivateRepos: Ptr(int64(10)), + PrivateGists: Ptr(10), + DiskUsage: Ptr(10), + Collaborators: Ptr(10), + TwoFactorAuthentication: Ptr(true), Plan: &Plan{ - Name: String("p"), - Space: Int(2), - Collaborators: Int(2), - PrivateRepos: Int64(2), - Seats: Int(2), - FilledSeats: Int(1), + Name: Ptr("p"), + Space: Ptr(2), + Collaborators: Ptr(2), + PrivateRepos: Ptr(int64(2)), + Seats: Ptr(2), + FilledSeats: Ptr(1), }, - LdapDn: String("l"), - URL: String("url"), - EventsURL: String("e"), - FollowingURL: String("f"), - FollowersURL: String("f"), - GistsURL: String("g"), - OrganizationsURL: String("o"), - ReceivedEventsURL: String("r"), - ReposURL: String("rep"), - StarredURL: String("star"), - SubscriptionsURL: String("sub"), + LdapDn: Ptr("l"), + URL: Ptr("url"), + EventsURL: Ptr("e"), + FollowingURL: Ptr("f"), + FollowersURL: Ptr("f"), + GistsURL: Ptr("g"), + OrganizationsURL: Ptr("o"), + ReceivedEventsURL: Ptr("r"), + ReposURL: Ptr("rep"), + StarredURL: Ptr("star"), + SubscriptionsURL: Ptr("sub"), TextMatches: []*TextMatch{ { - ObjectURL: String("u"), - ObjectType: String("t"), - Property: String("p"), - Fragment: String("f"), + ObjectURL: Ptr("u"), + ObjectType: Ptr("t"), + Property: Ptr("p"), + Fragment: Ptr("f"), Matches: []*Match{ { - Text: String("t"), + Text: Ptr("t"), Indices: []int{1, 2}, }, }, }, }, Permissions: map[string]bool{"p1": true}, - RoleName: String("r"), + RoleName: Ptr("r"), }, } @@ -1476,19 +1476,19 @@ func TestGlobalSecurityAdvisory_Marshal(t *testing.T) { testDate := &Timestamp{time.Date(2019, time.August, 10, 14, 59, 22, 0, time.UTC)} u := &GlobalSecurityAdvisory{ - ID: Int64(1), - RepositoryAdvisoryURL: String("r"), - Type: String("t"), - SourceCodeLocation: String("s"), + ID: Ptr(int64(1)), + RepositoryAdvisoryURL: Ptr("r"), + Type: Ptr("t"), + SourceCodeLocation: Ptr("s"), References: []string{"r"}, Vulnerabilities: []*GlobalSecurityVulnerability{ { Package: &VulnerabilityPackage{ - Ecosystem: String("npm"), - Name: String("a-package"), + Ecosystem: Ptr("npm"), + Name: Ptr("a-package"), }, - FirstPatchedVersion: String("1.0.3"), - VulnerableVersionRange: String("<=1.0.2"), + FirstPatchedVersion: Ptr("1.0.3"), + VulnerableVersionRange: Ptr("<=1.0.2"), VulnerableFunctions: []string{"a_function"}, }, }, @@ -1496,98 +1496,98 @@ func TestGlobalSecurityAdvisory_Marshal(t *testing.T) { NVDPublishedAt: testDate, Credits: []*Credit{ { - Type: String("t"), + Type: Ptr("t"), User: &User{ - Name: String("u"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(false), - Bio: String("bio"), - TwitterUsername: String("tu"), - PublicRepos: Int(1), - PublicGists: Int(1), - Followers: Int(2), - Following: Int(2), + Name: Ptr("u"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(false), + Bio: Ptr("bio"), + TwitterUsername: Ptr("tu"), + PublicRepos: Ptr(1), + PublicGists: Ptr(1), + Followers: Ptr(2), + Following: Ptr(2), CreatedAt: testDate, UpdatedAt: testDate, SuspendedAt: testDate, - Type: String("type"), - SiteAdmin: Bool(false), - TotalPrivateRepos: Int64(10), - OwnedPrivateRepos: Int64(10), - PrivateGists: Int(10), - DiskUsage: Int(10), - Collaborators: Int(10), - TwoFactorAuthentication: Bool(true), + Type: Ptr("type"), + SiteAdmin: Ptr(false), + TotalPrivateRepos: Ptr(int64(10)), + OwnedPrivateRepos: Ptr(int64(10)), + PrivateGists: Ptr(10), + DiskUsage: Ptr(10), + Collaborators: Ptr(10), + TwoFactorAuthentication: Ptr(true), Plan: &Plan{ - Name: String("p"), - Space: Int(2), - Collaborators: Int(2), - PrivateRepos: Int64(2), - Seats: Int(2), - FilledSeats: Int(1), + Name: Ptr("p"), + Space: Ptr(2), + Collaborators: Ptr(2), + PrivateRepos: Ptr(int64(2)), + Seats: Ptr(2), + FilledSeats: Ptr(1), }, - LdapDn: String("l"), - URL: String("url"), - EventsURL: String("e"), - FollowingURL: String("f"), - FollowersURL: String("f"), - GistsURL: String("g"), - OrganizationsURL: String("o"), - ReceivedEventsURL: String("r"), - ReposURL: String("rep"), - StarredURL: String("star"), - SubscriptionsURL: String("sub"), + LdapDn: Ptr("l"), + URL: Ptr("url"), + EventsURL: Ptr("e"), + FollowingURL: Ptr("f"), + FollowersURL: Ptr("f"), + GistsURL: Ptr("g"), + OrganizationsURL: Ptr("o"), + ReceivedEventsURL: Ptr("r"), + ReposURL: Ptr("rep"), + StarredURL: Ptr("star"), + SubscriptionsURL: Ptr("sub"), TextMatches: []*TextMatch{ { - ObjectURL: String("u"), - ObjectType: String("t"), - Property: String("p"), - Fragment: String("f"), + ObjectURL: Ptr("u"), + ObjectType: Ptr("t"), + Property: Ptr("p"), + Fragment: Ptr("f"), Matches: []*Match{ { - Text: String("t"), + Text: Ptr("t"), Indices: []int{1, 2}, }, }, }, }, Permissions: map[string]bool{"p1": true}, - RoleName: String("r"), + RoleName: Ptr("r"), }, }, }, SecurityAdvisory: SecurityAdvisory{ - GHSAID: String("GHSA-xoxo-1234-xoxo"), - CVEID: String("CVE-xoxo-1234"), - URL: String("https://api.github.com/advisories/GHSA-xoxo-1234-xoxo"), - HTMLURL: String("https://github.com/advisories/GHSA-xoxo-1234-xoxo"), - Severity: String("high"), - Summary: String("Heartbleed security advisory"), - Description: String("This bug allows an attacker to read portions of the affected server’s memory, potentially disclosing sensitive information."), + GHSAID: Ptr("GHSA-xoxo-1234-xoxo"), + CVEID: Ptr("CVE-xoxo-1234"), + URL: Ptr("https://api.github.com/advisories/GHSA-xoxo-1234-xoxo"), + HTMLURL: Ptr("https://github.com/advisories/GHSA-xoxo-1234-xoxo"), + Severity: Ptr("high"), + Summary: Ptr("Heartbleed security advisory"), + Description: Ptr("This bug allows an attacker to read portions of the affected server’s memory, potentially disclosing sensitive information."), Identifiers: []*AdvisoryIdentifier{ { - Type: String("GHSA"), - Value: String("GHSA-xoxo-1234-xoxo"), + Type: Ptr("GHSA"), + Value: Ptr("GHSA-xoxo-1234-xoxo"), }, { - Type: String("CVE"), - Value: String("CVE-xoxo-1234"), + Type: Ptr("CVE"), + Value: Ptr("CVE-xoxo-1234"), }, }, PublishedAt: testDate, UpdatedAt: testDate, WithdrawnAt: nil, CVSS: &AdvisoryCVSS{ - VectorString: String("CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:H"), - Score: Float64(7.6), + VectorString: Ptr("CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:H"), + Score: Ptr(7.6), }, CWEs: []*AdvisoryCWEs{ { - CWEID: String("CWE-400"), - Name: String("Uncontrolled Resource Consumption"), + CWEID: Ptr("CWE-400"), + Name: Ptr("Uncontrolled Resource Consumption"), }, }, }, diff --git a/github/strings_test.go b/github/strings_test.go index 79ec1fa3c22..4d53f21aac6 100644 --- a/github/strings_test.go +++ b/github/strings_test.go @@ -45,11 +45,11 @@ func TestStringify(t *testing.T) { // pointers {nilPointer, ``}, - {String("foo"), `"foo"`}, - {Int(123), `123`}, - {Bool(false), `false`}, + {Ptr("foo"), `"foo"`}, + {Ptr(123), `123`}, + {Ptr(false), `false`}, { - []*string{String("a"), String("b")}, + []*string{Ptr("a"), Ptr("b")}, `["a" "b"]`, }, @@ -63,11 +63,11 @@ func TestStringify(t *testing.T) { `github.Timestamp{2006-01-02 15:04:05 +0000 UTC}`, }, { - User{ID: Int64(123), Name: String("n")}, + User{ID: Ptr(int64(123)), Name: Ptr("n")}, `github.User{ID:123, Name:"n"}`, }, { - Repository{Owner: &User{ID: Int64(123)}}, + Repository{Owner: &User{ID: Ptr(int64(123))}}, `github.Repository{Owner:github.User{ID:123}}`, }, } @@ -91,47 +91,47 @@ func TestString(t *testing.T) { in interface{} out string }{ - {CodeResult{Name: String("n")}, `github.CodeResult{Name:"n"}`}, - {CommitAuthor{Name: String("n")}, `github.CommitAuthor{Name:"n"}`}, - {CommitFile{SHA: String("s")}, `github.CommitFile{SHA:"s"}`}, - {CommitStats{Total: Int(1)}, `github.CommitStats{Total:1}`}, - {CommitsComparison{TotalCommits: Int(1)}, `github.CommitsComparison{TotalCommits:1}`}, - {Commit{SHA: String("s")}, `github.Commit{SHA:"s"}`}, - {Event{ID: String("1")}, `github.Event{ID:"1"}`}, - {GistComment{ID: Int64(1)}, `github.GistComment{ID:1}`}, - {GistFile{Size: Int(1)}, `github.GistFile{Size:1}`}, - {Gist{ID: String("1")}, `github.Gist{ID:"1"}`}, - {GitObject{SHA: String("s")}, `github.GitObject{SHA:"s"}`}, - {Gitignore{Name: String("n")}, `github.Gitignore{Name:"n"}`}, - {Hook{ID: Int64(1)}, `github.Hook{ID:1}`}, - {IssueComment{ID: Int64(1)}, `github.IssueComment{ID:1}`}, - {Issue{Number: Int(1)}, `github.Issue{Number:1}`}, - {Key{ID: Int64(1)}, `github.Key{ID:1}`}, - {Label{ID: Int64(1), Name: String("l")}, `github.Label{ID:1, Name:"l"}`}, - {Organization{ID: Int64(1)}, `github.Organization{ID:1}`}, - {PullRequestComment{ID: Int64(1)}, `github.PullRequestComment{ID:1}`}, - {PullRequest{Number: Int(1)}, `github.PullRequest{Number:1}`}, - {PullRequestReview{ID: Int64(1)}, `github.PullRequestReview{ID:1}`}, - {DraftReviewComment{Position: Int(1)}, `github.DraftReviewComment{Position:1}`}, - {PullRequestReviewRequest{Body: String("r")}, `github.PullRequestReviewRequest{Body:"r"}`}, - {PullRequestReviewDismissalRequest{Message: String("r")}, `github.PullRequestReviewDismissalRequest{Message:"r"}`}, - {HeadCommit{SHA: String("s")}, `github.HeadCommit{SHA:"s"}`}, - {PushEvent{PushID: Int64(1)}, `github.PushEvent{PushID:1}`}, - {Reference{Ref: String("r")}, `github.Reference{Ref:"r"}`}, - {ReleaseAsset{ID: Int64(1)}, `github.ReleaseAsset{ID:1}`}, - {RepoStatus{ID: Int64(1)}, `github.RepoStatus{ID:1}`}, - {RepositoryComment{ID: Int64(1)}, `github.RepositoryComment{ID:1}`}, - {RepositoryCommit{SHA: String("s")}, `github.RepositoryCommit{SHA:"s"}`}, - {RepositoryContent{Name: String("n")}, `github.RepositoryContent{Name:"n"}`}, - {RepositoryRelease{ID: Int64(1)}, `github.RepositoryRelease{ID:1}`}, - {Repository{ID: Int64(1)}, `github.Repository{ID:1}`}, - {Team{ID: Int64(1)}, `github.Team{ID:1}`}, - {TreeEntry{SHA: String("s")}, `github.TreeEntry{SHA:"s"}`}, - {Tree{SHA: String("s")}, `github.Tree{SHA:"s"}`}, - {User{ID: Int64(1)}, `github.User{ID:1}`}, - {WebHookAuthor{Name: String("n")}, `github.CommitAuthor{Name:"n"}`}, - {WebHookCommit{ID: String("1")}, `github.HeadCommit{ID:"1"}`}, - {WebHookPayload{Ref: String("r")}, `github.PushEvent{Ref:"r"}`}, + {CodeResult{Name: Ptr("n")}, `github.CodeResult{Name:"n"}`}, + {CommitAuthor{Name: Ptr("n")}, `github.CommitAuthor{Name:"n"}`}, + {CommitFile{SHA: Ptr("s")}, `github.CommitFile{SHA:"s"}`}, + {CommitStats{Total: Ptr(1)}, `github.CommitStats{Total:1}`}, + {CommitsComparison{TotalCommits: Ptr(1)}, `github.CommitsComparison{TotalCommits:1}`}, + {Commit{SHA: Ptr("s")}, `github.Commit{SHA:"s"}`}, + {Event{ID: Ptr("1")}, `github.Event{ID:"1"}`}, + {GistComment{ID: Ptr(int64(1))}, `github.GistComment{ID:1}`}, + {GistFile{Size: Ptr(1)}, `github.GistFile{Size:1}`}, + {Gist{ID: Ptr("1")}, `github.Gist{ID:"1"}`}, + {GitObject{SHA: Ptr("s")}, `github.GitObject{SHA:"s"}`}, + {Gitignore{Name: Ptr("n")}, `github.Gitignore{Name:"n"}`}, + {Hook{ID: Ptr(int64(1))}, `github.Hook{ID:1}`}, + {IssueComment{ID: Ptr(int64(1))}, `github.IssueComment{ID:1}`}, + {Issue{Number: Ptr(1)}, `github.Issue{Number:1}`}, + {Key{ID: Ptr(int64(1))}, `github.Key{ID:1}`}, + {Label{ID: Ptr(int64(1)), Name: Ptr("l")}, `github.Label{ID:1, Name:"l"}`}, + {Organization{ID: Ptr(int64(1))}, `github.Organization{ID:1}`}, + {PullRequestComment{ID: Ptr(int64(1))}, `github.PullRequestComment{ID:1}`}, + {PullRequest{Number: Ptr(1)}, `github.PullRequest{Number:1}`}, + {PullRequestReview{ID: Ptr(int64(1))}, `github.PullRequestReview{ID:1}`}, + {DraftReviewComment{Position: Ptr(1)}, `github.DraftReviewComment{Position:1}`}, + {PullRequestReviewRequest{Body: Ptr("r")}, `github.PullRequestReviewRequest{Body:"r"}`}, + {PullRequestReviewDismissalRequest{Message: Ptr("r")}, `github.PullRequestReviewDismissalRequest{Message:"r"}`}, + {HeadCommit{SHA: Ptr("s")}, `github.HeadCommit{SHA:"s"}`}, + {PushEvent{PushID: Ptr(int64(1))}, `github.PushEvent{PushID:1}`}, + {Reference{Ref: Ptr("r")}, `github.Reference{Ref:"r"}`}, + {ReleaseAsset{ID: Ptr(int64(1))}, `github.ReleaseAsset{ID:1}`}, + {RepoStatus{ID: Ptr(int64(1))}, `github.RepoStatus{ID:1}`}, + {RepositoryComment{ID: Ptr(int64(1))}, `github.RepositoryComment{ID:1}`}, + {RepositoryCommit{SHA: Ptr("s")}, `github.RepositoryCommit{SHA:"s"}`}, + {RepositoryContent{Name: Ptr("n")}, `github.RepositoryContent{Name:"n"}`}, + {RepositoryRelease{ID: Ptr(int64(1))}, `github.RepositoryRelease{ID:1}`}, + {Repository{ID: Ptr(int64(1))}, `github.Repository{ID:1}`}, + {Team{ID: Ptr(int64(1))}, `github.Team{ID:1}`}, + {TreeEntry{SHA: Ptr("s")}, `github.TreeEntry{SHA:"s"}`}, + {Tree{SHA: Ptr("s")}, `github.Tree{SHA:"s"}`}, + {User{ID: Ptr(int64(1))}, `github.User{ID:1}`}, + {WebHookAuthor{Name: Ptr("n")}, `github.CommitAuthor{Name:"n"}`}, + {WebHookCommit{ID: Ptr("1")}, `github.HeadCommit{ID:"1"}`}, + {WebHookPayload{Ref: Ptr("r")}, `github.PushEvent{Ref:"r"}`}, } for i, tt := range tests { diff --git a/github/teams_discussion_comments_test.go b/github/teams_discussion_comments_test.go index 8c09568178e..e8173abcd5a 100644 --- a/github/teams_discussion_comments_test.go +++ b/github/teams_discussion_comments_test.go @@ -83,35 +83,35 @@ func TestTeamsService_ListComments(t *testing.T) { want := []*DiscussionComment{ { Author: &User{ - Login: String("author"), - ID: Int64(0), - AvatarURL: String("https://avatars1.githubusercontent.com/u/0?v=4"), - GravatarID: String(""), - URL: String("https://api.github.com/users/author"), - HTMLURL: String("https://github.com/author"), - FollowersURL: String("https://api.github.com/users/author/followers"), - FollowingURL: String("https://api.github.com/users/author/following{/other_user}"), - GistsURL: String("https://api.github.com/users/author/gists{/gist_id}"), - StarredURL: String("https://api.github.com/users/author/starred{/owner}{/repo}"), - SubscriptionsURL: String("https://api.github.com/users/author/subscriptions"), - OrganizationsURL: String("https://api.github.com/users/author/orgs"), - ReposURL: String("https://api.github.com/users/author/repos"), - EventsURL: String("https://api.github.com/users/author/events{/privacy}"), - ReceivedEventsURL: String("https://api.github.com/users/author/received_events"), - Type: String("User"), - SiteAdmin: Bool(false), + Login: Ptr("author"), + ID: Ptr(int64(0)), + AvatarURL: Ptr("https://avatars1.githubusercontent.com/u/0?v=4"), + GravatarID: Ptr(""), + URL: Ptr("https://api.github.com/users/author"), + HTMLURL: Ptr("https://github.com/author"), + FollowersURL: Ptr("https://api.github.com/users/author/followers"), + FollowingURL: Ptr("https://api.github.com/users/author/following{/other_user}"), + GistsURL: Ptr("https://api.github.com/users/author/gists{/gist_id}"), + StarredURL: Ptr("https://api.github.com/users/author/starred{/owner}{/repo}"), + SubscriptionsURL: Ptr("https://api.github.com/users/author/subscriptions"), + OrganizationsURL: Ptr("https://api.github.com/users/author/orgs"), + ReposURL: Ptr("https://api.github.com/users/author/repos"), + EventsURL: Ptr("https://api.github.com/users/author/events{/privacy}"), + ReceivedEventsURL: Ptr("https://api.github.com/users/author/received_events"), + Type: Ptr("User"), + SiteAdmin: Ptr(false), }, - Body: String("comment"), - BodyHTML: String("

    comment

    "), - BodyVersion: String("version"), + Body: Ptr("comment"), + BodyHTML: Ptr("

    comment

    "), + BodyVersion: Ptr("version"), CreatedAt: &Timestamp{time.Date(2018, time.January, 1, 0, 0, 0, 0, time.UTC)}, LastEditedAt: nil, - DiscussionURL: String("https://api.github.com/teams/2/discussions/3"), - HTMLURL: String("https://github.com/orgs/1/teams/2/discussions/3/comments/4"), - NodeID: String("node"), - Number: Int(4), + DiscussionURL: Ptr("https://api.github.com/teams/2/discussions/3"), + HTMLURL: Ptr("https://github.com/orgs/1/teams/2/discussions/3/comments/4"), + NodeID: Ptr("node"), + Number: Ptr(4), UpdatedAt: &Timestamp{time.Date(2018, time.January, 1, 0, 0, 0, 0, time.UTC)}, - URL: String("https://api.github.com/teams/2/discussions/3/comments/4"), + URL: Ptr("https://api.github.com/teams/2/discussions/3/comments/4"), }, } @@ -183,7 +183,7 @@ func TestTeamsService_GetComment(t *testing.T) { testMethod(t, r, "GET") fmt.Fprint(w, `{"number":4}`) } - want := &DiscussionComment{Number: Int(4)} + want := &DiscussionComment{Number: Ptr(4)} e := tdcEndpointByID("1", "2", "3", "4") mux.HandleFunc(e, handlerFunc) @@ -243,7 +243,7 @@ func TestTeamsService_CreateComment(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := DiscussionComment{Body: String("c")} + input := DiscussionComment{Body: Ptr("c")} handlerFunc := func(w http.ResponseWriter, r *http.Request) { v := new(DiscussionComment) @@ -256,7 +256,7 @@ func TestTeamsService_CreateComment(t *testing.T) { fmt.Fprint(w, `{"number":4}`) } - want := &DiscussionComment{Number: Int(4)} + want := &DiscussionComment{Number: Ptr(4)} e := tdcEndpointByID("1", "2", "3", "") mux.HandleFunc(e, handlerFunc) @@ -316,7 +316,7 @@ func TestTeamsService_EditComment(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := DiscussionComment{Body: String("e")} + input := DiscussionComment{Body: Ptr("e")} handlerFunc := func(w http.ResponseWriter, r *http.Request) { v := new(DiscussionComment) assertNilError(t, json.NewDecoder(r.Body).Decode(v)) @@ -328,7 +328,7 @@ func TestTeamsService_EditComment(t *testing.T) { fmt.Fprint(w, `{"number":4}`) } - want := &DiscussionComment{Number: Int(4)} + want := &DiscussionComment{Number: Ptr(4)} e := tdcEndpointByID("1", "2", "3", "4") mux.HandleFunc(e, handlerFunc) @@ -438,28 +438,28 @@ func TestDiscussionComment_Marshal(t *testing.T) { u := &DiscussionComment{ Author: &User{}, - Body: String("body"), - BodyHTML: String("body html"), - BodyVersion: String("body version"), + Body: Ptr("body"), + BodyHTML: Ptr("body html"), + BodyVersion: Ptr("body version"), CreatedAt: &Timestamp{referenceTime}, LastEditedAt: &Timestamp{referenceTime}, - DiscussionURL: String("url"), - HTMLURL: String("html url"), - NodeID: String("node"), - Number: Int(1), + DiscussionURL: Ptr("url"), + HTMLURL: Ptr("html url"), + NodeID: Ptr("node"), + Number: Ptr(1), UpdatedAt: &Timestamp{referenceTime}, - URL: String("url"), + URL: Ptr("url"), Reactions: &Reactions{ - TotalCount: Int(10), - PlusOne: Int(1), - MinusOne: Int(1), - Laugh: Int(1), - Confused: Int(1), - Heart: Int(2), - Hooray: Int(5), - Rocket: Int(3), - Eyes: Int(9), - URL: String("url"), + TotalCount: Ptr(10), + PlusOne: Ptr(1), + MinusOne: Ptr(1), + Laugh: Ptr(1), + Confused: Ptr(1), + Heart: Ptr(2), + Hooray: Ptr(5), + Rocket: Ptr(3), + Eyes: Ptr(9), + URL: Ptr("url"), }, } diff --git a/github/teams_discussions_test.go b/github/teams_discussions_test.go index 3033a84da25..236382e0227 100644 --- a/github/teams_discussions_test.go +++ b/github/teams_discussions_test.go @@ -76,40 +76,40 @@ func TestTeamsService_ListDiscussionsByID(t *testing.T) { want := []*TeamDiscussion{ { Author: &User{ - Login: String("author"), - ID: Int64(0), - AvatarURL: String("https://avatars1.githubusercontent.com/u/0?v=4"), - GravatarID: String(""), - URL: String("https://api.github.com/users/author"), - HTMLURL: String("https://github.com/author"), - FollowersURL: String("https://api.github.com/users/author/followers"), - FollowingURL: String("https://api.github.com/users/author/following{/other_user}"), - GistsURL: String("https://api.github.com/users/author/gists{/gist_id}"), - StarredURL: String("https://api.github.com/users/author/starred{/owner}{/repo}"), - SubscriptionsURL: String("https://api.github.com/users/author/subscriptions"), - OrganizationsURL: String("https://api.github.com/users/author/orgs"), - ReposURL: String("https://api.github.com/users/author/repos"), - EventsURL: String("https://api.github.com/users/author/events{/privacy}"), - ReceivedEventsURL: String("https://api.github.com/users/author/received_events"), - Type: String("User"), - SiteAdmin: Bool(false), + Login: Ptr("author"), + ID: Ptr(int64(0)), + AvatarURL: Ptr("https://avatars1.githubusercontent.com/u/0?v=4"), + GravatarID: Ptr(""), + URL: Ptr("https://api.github.com/users/author"), + HTMLURL: Ptr("https://github.com/author"), + FollowersURL: Ptr("https://api.github.com/users/author/followers"), + FollowingURL: Ptr("https://api.github.com/users/author/following{/other_user}"), + GistsURL: Ptr("https://api.github.com/users/author/gists{/gist_id}"), + StarredURL: Ptr("https://api.github.com/users/author/starred{/owner}{/repo}"), + SubscriptionsURL: Ptr("https://api.github.com/users/author/subscriptions"), + OrganizationsURL: Ptr("https://api.github.com/users/author/orgs"), + ReposURL: Ptr("https://api.github.com/users/author/repos"), + EventsURL: Ptr("https://api.github.com/users/author/events{/privacy}"), + ReceivedEventsURL: Ptr("https://api.github.com/users/author/received_events"), + Type: Ptr("User"), + SiteAdmin: Ptr(false), }, - Body: String("test"), - BodyHTML: String("

    test

    "), - BodyVersion: String("version"), - CommentsCount: Int(1), - CommentsURL: String("https://api.github.com/teams/2/discussions/3/comments"), + Body: Ptr("test"), + BodyHTML: Ptr("

    test

    "), + BodyVersion: Ptr("version"), + CommentsCount: Ptr(1), + CommentsURL: Ptr("https://api.github.com/teams/2/discussions/3/comments"), CreatedAt: &Timestamp{time.Date(2018, time.January, 1, 0, 0, 0, 0, time.UTC)}, LastEditedAt: nil, - HTMLURL: String("https://github.com/orgs/1/teams/2/discussions/3"), - NodeID: String("node"), - Number: Int(3), - Pinned: Bool(false), - Private: Bool(false), - TeamURL: String("https://api.github.com/teams/2"), - Title: String("test"), + HTMLURL: Ptr("https://github.com/orgs/1/teams/2/discussions/3"), + NodeID: Ptr("node"), + Number: Ptr(3), + Pinned: Ptr(false), + Private: Ptr(false), + TeamURL: Ptr("https://api.github.com/teams/2"), + Title: Ptr("test"), UpdatedAt: &Timestamp{time.Date(2018, time.January, 1, 0, 0, 0, 0, time.UTC)}, - URL: String("https://api.github.com/teams/2/discussions/3"), + URL: Ptr("https://api.github.com/teams/2/discussions/3"), }, } if !cmp.Equal(discussions, want) { @@ -191,40 +191,40 @@ func TestTeamsService_ListDiscussionsBySlug(t *testing.T) { want := []*TeamDiscussion{ { Author: &User{ - Login: String("author"), - ID: Int64(0), - AvatarURL: String("https://avatars1.githubusercontent.com/u/0?v=4"), - GravatarID: String(""), - URL: String("https://api.github.com/users/author"), - HTMLURL: String("https://github.com/author"), - FollowersURL: String("https://api.github.com/users/author/followers"), - FollowingURL: String("https://api.github.com/users/author/following{/other_user}"), - GistsURL: String("https://api.github.com/users/author/gists{/gist_id}"), - StarredURL: String("https://api.github.com/users/author/starred{/owner}{/repo}"), - SubscriptionsURL: String("https://api.github.com/users/author/subscriptions"), - OrganizationsURL: String("https://api.github.com/users/author/orgs"), - ReposURL: String("https://api.github.com/users/author/repos"), - EventsURL: String("https://api.github.com/users/author/events{/privacy}"), - ReceivedEventsURL: String("https://api.github.com/users/author/received_events"), - Type: String("User"), - SiteAdmin: Bool(false), + Login: Ptr("author"), + ID: Ptr(int64(0)), + AvatarURL: Ptr("https://avatars1.githubusercontent.com/u/0?v=4"), + GravatarID: Ptr(""), + URL: Ptr("https://api.github.com/users/author"), + HTMLURL: Ptr("https://github.com/author"), + FollowersURL: Ptr("https://api.github.com/users/author/followers"), + FollowingURL: Ptr("https://api.github.com/users/author/following{/other_user}"), + GistsURL: Ptr("https://api.github.com/users/author/gists{/gist_id}"), + StarredURL: Ptr("https://api.github.com/users/author/starred{/owner}{/repo}"), + SubscriptionsURL: Ptr("https://api.github.com/users/author/subscriptions"), + OrganizationsURL: Ptr("https://api.github.com/users/author/orgs"), + ReposURL: Ptr("https://api.github.com/users/author/repos"), + EventsURL: Ptr("https://api.github.com/users/author/events{/privacy}"), + ReceivedEventsURL: Ptr("https://api.github.com/users/author/received_events"), + Type: Ptr("User"), + SiteAdmin: Ptr(false), }, - Body: String("test"), - BodyHTML: String("

    test

    "), - BodyVersion: String("version"), - CommentsCount: Int(1), - CommentsURL: String("https://api.github.com/teams/2/discussions/3/comments"), + Body: Ptr("test"), + BodyHTML: Ptr("

    test

    "), + BodyVersion: Ptr("version"), + CommentsCount: Ptr(1), + CommentsURL: Ptr("https://api.github.com/teams/2/discussions/3/comments"), CreatedAt: &Timestamp{time.Date(2018, time.January, 1, 0, 0, 0, 0, time.UTC)}, LastEditedAt: nil, - HTMLURL: String("https://github.com/orgs/1/teams/2/discussions/3"), - NodeID: String("node"), - Number: Int(3), - Pinned: Bool(false), - Private: Bool(false), - TeamURL: String("https://api.github.com/teams/2"), - Title: String("test"), + HTMLURL: Ptr("https://github.com/orgs/1/teams/2/discussions/3"), + NodeID: Ptr("node"), + Number: Ptr(3), + Pinned: Ptr(false), + Private: Ptr(false), + TeamURL: Ptr("https://api.github.com/teams/2"), + Title: Ptr("test"), UpdatedAt: &Timestamp{time.Date(2018, time.January, 1, 0, 0, 0, 0, time.UTC)}, - URL: String("https://api.github.com/teams/2/discussions/3"), + URL: Ptr("https://api.github.com/teams/2/discussions/3"), }, } if !cmp.Equal(discussions, want) { @@ -261,7 +261,7 @@ func TestTeamsService_GetDiscussionByID(t *testing.T) { t.Errorf("Teams.GetDiscussionByID returned error: %v", err) } - want := &TeamDiscussion{Number: Int(3)} + want := &TeamDiscussion{Number: Ptr(3)} if !cmp.Equal(discussion, want) { t.Errorf("Teams.GetDiscussionByID returned %+v, want %+v", discussion, want) } @@ -296,7 +296,7 @@ func TestTeamsService_GetDiscussionBySlug(t *testing.T) { t.Errorf("Teams.GetDiscussionBySlug returned error: %v", err) } - want := &TeamDiscussion{Number: Int(3)} + want := &TeamDiscussion{Number: Ptr(3)} if !cmp.Equal(discussion, want) { t.Errorf("Teams.GetDiscussionBySlug returned %+v, want %+v", discussion, want) } @@ -320,7 +320,7 @@ func TestTeamsService_CreateDiscussionByID(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := TeamDiscussion{Title: String("c_t"), Body: String("c_b")} + input := TeamDiscussion{Title: Ptr("c_t"), Body: Ptr("c_b")} mux.HandleFunc("/organizations/1/team/2/discussions", func(w http.ResponseWriter, r *http.Request) { v := new(TeamDiscussion) @@ -340,7 +340,7 @@ func TestTeamsService_CreateDiscussionByID(t *testing.T) { t.Errorf("Teams.CreateDiscussionByID returned error: %v", err) } - want := &TeamDiscussion{Number: Int(3)} + want := &TeamDiscussion{Number: Ptr(3)} if !cmp.Equal(comment, want) { t.Errorf("Teams.CreateDiscussionByID returned %+v, want %+v", comment, want) } @@ -364,7 +364,7 @@ func TestTeamsService_CreateDiscussionBySlug(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := TeamDiscussion{Title: String("c_t"), Body: String("c_b")} + input := TeamDiscussion{Title: Ptr("c_t"), Body: Ptr("c_b")} mux.HandleFunc("/orgs/o/teams/s/discussions", func(w http.ResponseWriter, r *http.Request) { v := new(TeamDiscussion) @@ -384,7 +384,7 @@ func TestTeamsService_CreateDiscussionBySlug(t *testing.T) { t.Errorf("Teams.CreateDiscussionBySlug returned error: %v", err) } - want := &TeamDiscussion{Number: Int(3)} + want := &TeamDiscussion{Number: Ptr(3)} if !cmp.Equal(comment, want) { t.Errorf("Teams.CreateDiscussionBySlug returned %+v, want %+v", comment, want) } @@ -408,7 +408,7 @@ func TestTeamsService_EditDiscussionByID(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := TeamDiscussion{Title: String("e_t"), Body: String("e_b")} + input := TeamDiscussion{Title: Ptr("e_t"), Body: Ptr("e_b")} mux.HandleFunc("/organizations/1/team/2/discussions/3", func(w http.ResponseWriter, r *http.Request) { v := new(TeamDiscussion) @@ -428,7 +428,7 @@ func TestTeamsService_EditDiscussionByID(t *testing.T) { t.Errorf("Teams.EditDiscussionByID returned error: %v", err) } - want := &TeamDiscussion{Number: Int(3)} + want := &TeamDiscussion{Number: Ptr(3)} if !cmp.Equal(comment, want) { t.Errorf("Teams.EditDiscussionByID returned %+v, want %+v", comment, want) } @@ -452,7 +452,7 @@ func TestTeamsService_EditDiscussionBySlug(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := TeamDiscussion{Title: String("e_t"), Body: String("e_b")} + input := TeamDiscussion{Title: Ptr("e_t"), Body: Ptr("e_b")} mux.HandleFunc("/orgs/o/teams/s/discussions/3", func(w http.ResponseWriter, r *http.Request) { v := new(TeamDiscussion) @@ -472,7 +472,7 @@ func TestTeamsService_EditDiscussionBySlug(t *testing.T) { t.Errorf("Teams.EditDiscussionBySlug returned error: %v", err) } - want := &TeamDiscussion{Number: Int(3)} + want := &TeamDiscussion{Number: Ptr(3)} if !cmp.Equal(comment, want) { t.Errorf("Teams.EditDiscussionBySlug returned %+v, want %+v", comment, want) } @@ -548,41 +548,41 @@ func TestTeamDiscussion_Marshal(t *testing.T) { u := &TeamDiscussion{ Author: &User{ - Login: String("author"), - ID: Int64(0), - URL: String("https://api.github.com/users/author"), - AvatarURL: String("https://avatars1.githubusercontent.com/u/0?v=4"), - GravatarID: String(""), + Login: Ptr("author"), + ID: Ptr(int64(0)), + URL: Ptr("https://api.github.com/users/author"), + AvatarURL: Ptr("https://avatars1.githubusercontent.com/u/0?v=4"), + GravatarID: Ptr(""), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, - Body: String("test"), - BodyHTML: String("

    test

    "), - BodyVersion: String("version"), - CommentsCount: Int(1), - CommentsURL: String("https://api.github.com/teams/2/discussions/3/comments"), + Body: Ptr("test"), + BodyHTML: Ptr("

    test

    "), + BodyVersion: Ptr("version"), + CommentsCount: Ptr(1), + CommentsURL: Ptr("https://api.github.com/teams/2/discussions/3/comments"), CreatedAt: &Timestamp{referenceTime}, LastEditedAt: &Timestamp{referenceTime}, - HTMLURL: String("https://api.github.com/teams/2/discussions/3/comments"), - NodeID: String("A123"), - Number: Int(10), - Pinned: Bool(true), - Private: Bool(false), - TeamURL: String("https://api.github.com/teams/2/discussions/3/comments"), - Title: String("Test"), + HTMLURL: Ptr("https://api.github.com/teams/2/discussions/3/comments"), + NodeID: Ptr("A123"), + Number: Ptr(10), + Pinned: Ptr(true), + Private: Ptr(false), + TeamURL: Ptr("https://api.github.com/teams/2/discussions/3/comments"), + Title: Ptr("Test"), UpdatedAt: &Timestamp{referenceTime}, - URL: String("https://api.github.com/teams/2/discussions/3/comments"), + URL: Ptr("https://api.github.com/teams/2/discussions/3/comments"), Reactions: &Reactions{ - TotalCount: Int(1), - PlusOne: Int(2), - MinusOne: Int(-3), - Laugh: Int(4), - Confused: Int(5), - Heart: Int(6), - Hooray: Int(7), - Rocket: Int(8), - Eyes: Int(9), - URL: String("https://api.github.com/teams/2/discussions/3/comments"), + TotalCount: Ptr(1), + PlusOne: Ptr(2), + MinusOne: Ptr(-3), + Laugh: Ptr(4), + Confused: Ptr(5), + Heart: Ptr(6), + Hooray: Ptr(7), + Rocket: Ptr(8), + Eyes: Ptr(9), + URL: Ptr("https://api.github.com/teams/2/discussions/3/comments"), }, } diff --git a/github/teams_members_test.go b/github/teams_members_test.go index 1af751285ad..4cd41d4fc2a 100644 --- a/github/teams_members_test.go +++ b/github/teams_members_test.go @@ -32,7 +32,7 @@ func TestTeamsService__ListTeamMembersByID(t *testing.T) { t.Errorf("Teams.ListTeamMembersByID returned error: %v", err) } - want := []*User{{ID: Int64(1)}} + want := []*User{{ID: Ptr(int64(1))}} if !cmp.Equal(members, want) { t.Errorf("Teams.ListTeamMembersByID returned %+v, want %+v", members, want) } @@ -107,7 +107,7 @@ func TestTeamsService__ListTeamMembersBySlug(t *testing.T) { t.Errorf("Teams.ListTeamMembersBySlug returned error: %v", err) } - want := []*User{{ID: Int64(1)}} + want := []*User{{ID: Ptr(int64(1))}} if !cmp.Equal(members, want) { t.Errorf("Teams.ListTeamMembersBySlug returned %+v, want %+v", members, want) } @@ -189,7 +189,7 @@ func TestTeamsService__GetTeamMembershipByID(t *testing.T) { t.Errorf("Teams.GetTeamMembershipByID returned error: %v", err) } - want := &Membership{URL: String("u"), State: String("active")} + want := &Membership{URL: Ptr("u"), State: Ptr("active")} if !cmp.Equal(membership, want) { t.Errorf("Teams.GetTeamMembershipByID returned %+v, want %+v", membership, want) } @@ -260,7 +260,7 @@ func TestTeamsService__GetTeamMembershipBySlug(t *testing.T) { t.Errorf("Teams.GetTeamMembershipBySlug returned error: %v", err) } - want := &Membership{URL: String("u"), State: String("active")} + want := &Membership{URL: Ptr("u"), State: Ptr("active")} if !cmp.Equal(membership, want) { t.Errorf("Teams.GetTeamMembershipBySlug returned %+v, want %+v", membership, want) } @@ -349,7 +349,7 @@ func TestTeamsService__AddTeamMembershipByID(t *testing.T) { t.Errorf("Teams.AddTeamMembershipByID returned error: %v", err) } - want := &Membership{URL: String("u"), State: String("pending")} + want := &Membership{URL: Ptr("u"), State: Ptr("pending")} if !cmp.Equal(membership, want) { t.Errorf("Teams.AddTeamMembershipByID returned %+v, want %+v", membership, want) } @@ -438,7 +438,7 @@ func TestTeamsService__AddTeamMembershipBySlug(t *testing.T) { t.Errorf("Teams.AddTeamMembershipBySlug returned error: %v", err) } - want := &Membership{URL: String("u"), State: String("pending")} + want := &Membership{URL: Ptr("u"), State: Ptr("pending")} if !cmp.Equal(membership, want) { t.Errorf("Teams.AddTeamMembershipBySlug returned %+v, want %+v", membership, want) } @@ -648,7 +648,7 @@ func TestTeamsService__ListPendingTeamInvitationsByID(t *testing.T) { t.Errorf("Teams.ListPendingTeamInvitationsByID returned error: %v", err) } - want := []*Invitation{{ID: Int64(1)}} + want := []*Invitation{{ID: Ptr(int64(1))}} if !cmp.Equal(invitations, want) { t.Errorf("Teams.ListPendingTeamInvitationsByID returned %+v, want %+v", invitations, want) } @@ -723,7 +723,7 @@ func TestTeamsService__ListPendingTeamInvitationsBySlug(t *testing.T) { t.Errorf("Teams.ListPendingTeamInvitationsByID returned error: %v", err) } - want := []*Invitation{{ID: Int64(1)}} + want := []*Invitation{{ID: Ptr(int64(1))}} if !cmp.Equal(invitations, want) { t.Errorf("Teams.ListPendingTeamInvitationsByID returned %+v, want %+v", invitations, want) } diff --git a/github/teams_test.go b/github/teams_test.go index 110925c1226..34c5b2026b4 100644 --- a/github/teams_test.go +++ b/github/teams_test.go @@ -34,7 +34,7 @@ func TestTeamsService_ListTeams(t *testing.T) { t.Errorf("Teams.ListTeams returned error: %v", err) } - want := []*Team{{ID: Int64(1)}} + want := []*Team{{ID: Ptr(int64(1))}} if !cmp.Equal(teams, want) { t.Errorf("Teams.ListTeams returned %+v, want %+v", teams, want) } @@ -78,7 +78,7 @@ func TestTeamsService_GetTeamByID(t *testing.T) { t.Errorf("Teams.GetTeamByID returned error: %v", err) } - want := &Team{ID: Int64(1), Name: String("n"), Description: String("d"), URL: String("u"), Slug: String("s"), Permission: String("p"), LDAPDN: String("cn=n,ou=groups,dc=example,dc=com")} + want := &Team{ID: Ptr(int64(1)), Name: Ptr("n"), Description: Ptr("d"), URL: Ptr("u"), Slug: Ptr("s"), Permission: Ptr("p"), LDAPDN: Ptr("cn=n,ou=groups,dc=example,dc=com")} if !cmp.Equal(team, want) { t.Errorf("Teams.GetTeamByID returned %+v, want %+v", team, want) } @@ -135,7 +135,7 @@ func TestTeamsService_GetTeamBySlug(t *testing.T) { t.Errorf("Teams.GetTeamBySlug returned error: %v", err) } - want := &Team{ID: Int64(1), Name: String("n"), Description: String("d"), URL: String("u"), Slug: String("s"), Permission: String("p"), LDAPDN: String("cn=n,ou=groups,dc=example,dc=com")} + want := &Team{ID: Ptr(int64(1)), Name: Ptr("n"), Description: Ptr("d"), URL: Ptr("u"), Slug: Ptr("s"), Permission: Ptr("p"), LDAPDN: Ptr("cn=n,ou=groups,dc=example,dc=com")} if !cmp.Equal(team, want) { t.Errorf("Teams.GetTeamBySlug returned %+v, want %+v", team, want) } @@ -190,7 +190,7 @@ func TestTeamsService_CreateTeam(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := NewTeam{Name: "n", Privacy: String("closed"), RepoNames: []string{"r"}} + input := NewTeam{Name: "n", Privacy: Ptr("closed"), RepoNames: []string{"r"}} mux.HandleFunc("/orgs/o/teams", func(w http.ResponseWriter, r *http.Request) { v := new(NewTeam) @@ -210,7 +210,7 @@ func TestTeamsService_CreateTeam(t *testing.T) { t.Errorf("Teams.CreateTeam returned error: %v", err) } - want := &Team{ID: Int64(1)} + want := &Team{ID: Ptr(int64(1))} if !cmp.Equal(team, want) { t.Errorf("Teams.CreateTeam returned %+v, want %+v", team, want) } @@ -243,7 +243,7 @@ func TestTeamsService_EditTeamByID(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := NewTeam{Name: "n", Privacy: String("closed")} + input := NewTeam{Name: "n", Privacy: Ptr("closed")} mux.HandleFunc("/organizations/1/team/1", func(w http.ResponseWriter, r *http.Request) { v := new(NewTeam) @@ -263,7 +263,7 @@ func TestTeamsService_EditTeamByID(t *testing.T) { t.Errorf("Teams.EditTeamByID returned error: %v", err) } - want := &Team{ID: Int64(1)} + want := &Team{ID: Ptr(int64(1))} if !cmp.Equal(team, want) { t.Errorf("Teams.EditTeamByID returned %+v, want %+v", team, want) } @@ -287,7 +287,7 @@ func TestTeamsService_EditTeamByID_RemoveParent(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := NewTeam{Name: "n", NotificationSetting: String("notifications_enabled"), Privacy: String("closed")} + input := NewTeam{Name: "n", NotificationSetting: Ptr("notifications_enabled"), Privacy: Ptr("closed")} var body string mux.HandleFunc("/organizations/1/team/1", func(w http.ResponseWriter, r *http.Request) { @@ -313,7 +313,7 @@ func TestTeamsService_EditTeamByID_RemoveParent(t *testing.T) { t.Errorf("Teams.EditTeamByID returned error: %v", err) } - want := &Team{ID: Int64(1)} + want := &Team{ID: Ptr(int64(1))} if !cmp.Equal(team, want) { t.Errorf("Teams.EditTeamByID returned %+v, want %+v", team, want) } @@ -327,7 +327,7 @@ func TestTeamsService_EditTeamBySlug(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := NewTeam{Name: "n", Privacy: String("closed")} + input := NewTeam{Name: "n", Privacy: Ptr("closed")} mux.HandleFunc("/orgs/o/teams/s", func(w http.ResponseWriter, r *http.Request) { v := new(NewTeam) @@ -347,7 +347,7 @@ func TestTeamsService_EditTeamBySlug(t *testing.T) { t.Errorf("Teams.EditTeamBySlug returned error: %v", err) } - want := &Team{ID: Int64(1)} + want := &Team{ID: Ptr(int64(1))} if !cmp.Equal(team, want) { t.Errorf("Teams.EditTeamBySlug returned %+v, want %+v", team, want) } @@ -371,7 +371,7 @@ func TestTeamsService_EditTeamBySlug_RemoveParent(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := NewTeam{Name: "n", NotificationSetting: String("notifications_disabled"), Privacy: String("closed")} + input := NewTeam{Name: "n", NotificationSetting: Ptr("notifications_disabled"), Privacy: Ptr("closed")} var body string mux.HandleFunc("/orgs/o/teams/s", func(w http.ResponseWriter, r *http.Request) { @@ -397,7 +397,7 @@ func TestTeamsService_EditTeamBySlug_RemoveParent(t *testing.T) { t.Errorf("Teams.EditTeam returned error: %v", err) } - want := &Team{ID: Int64(1)} + want := &Team{ID: Ptr(int64(1))} if !cmp.Equal(team, want) { t.Errorf("Teams.EditTeam returned %+v, want %+v", team, want) } @@ -474,7 +474,7 @@ func TestTeamsService_ListChildTeamsByParentID(t *testing.T) { t.Errorf("Teams.ListChildTeamsByParentID returned error: %v", err) } - want := []*Team{{ID: Int64(2)}} + want := []*Team{{ID: Ptr(int64(2))}} if !cmp.Equal(teams, want) { t.Errorf("Teams.ListChildTeamsByParentID returned %+v, want %+v", teams, want) } @@ -511,7 +511,7 @@ func TestTeamsService_ListChildTeamsByParentSlug(t *testing.T) { t.Errorf("Teams.ListChildTeamsByParentSlug returned error: %v", err) } - want := []*Team{{ID: Int64(2)}} + want := []*Team{{ID: Ptr(int64(2))}} if !cmp.Equal(teams, want) { t.Errorf("Teams.ListChildTeamsByParentSlug returned %+v, want %+v", teams, want) } @@ -549,7 +549,7 @@ func TestTeamsService_ListTeamReposByID(t *testing.T) { t.Errorf("Teams.ListTeamReposByID returned error: %v", err) } - want := []*Repository{{ID: Int64(1)}} + want := []*Repository{{ID: Ptr(int64(1))}} if !cmp.Equal(members, want) { t.Errorf("Teams.ListTeamReposByID returned %+v, want %+v", members, want) } @@ -587,7 +587,7 @@ func TestTeamsService_ListTeamReposBySlug(t *testing.T) { t.Errorf("Teams.ListTeamReposBySlug returned error: %v", err) } - want := []*Repository{{ID: Int64(1)}} + want := []*Repository{{ID: Ptr(int64(1))}} if !cmp.Equal(members, want) { t.Errorf("Teams.ListTeamReposBySlug returned %+v, want %+v", members, want) } @@ -623,7 +623,7 @@ func TestTeamsService_IsTeamRepoByID_true(t *testing.T) { t.Errorf("Teams.IsTeamRepoByID returned error: %v", err) } - want := &Repository{ID: Int64(1)} + want := &Repository{ID: Ptr(int64(1))} if !cmp.Equal(repo, want) { t.Errorf("Teams.IsTeamRepoByID returned %+v, want %+v", repo, want) } @@ -659,7 +659,7 @@ func TestTeamsService_IsTeamRepoBySlug_true(t *testing.T) { t.Errorf("Teams.IsTeamRepoBySlug returned error: %v", err) } - want := &Repository{ID: Int64(1)} + want := &Repository{ID: Ptr(int64(1))} if !cmp.Equal(repo, want) { t.Errorf("Teams.IsTeamRepoBySlug returned %+v, want %+v", repo, want) } @@ -992,7 +992,7 @@ func TestTeamsService_ListUserTeams(t *testing.T) { t.Errorf("Teams.ListUserTeams returned error: %v", err) } - want := []*Team{{ID: Int64(1)}} + want := []*Team{{ID: Ptr(int64(1))}} if !cmp.Equal(teams, want) { t.Errorf("Teams.ListUserTeams returned %+v, want %+v", teams, want) } @@ -1023,7 +1023,7 @@ func TestTeamsService_ListProjectsByID(t *testing.T) { t.Errorf("Teams.ListTeamProjectsByID returned error: %v", err) } - want := []*Project{{ID: Int64(1)}} + want := []*Project{{ID: Ptr(int64(1))}} if !cmp.Equal(projects, want) { t.Errorf("Teams.ListTeamProjectsByID returned %+v, want %+v", projects, want) } @@ -1059,7 +1059,7 @@ func TestTeamsService_ListProjectsBySlug(t *testing.T) { t.Errorf("Teams.ListTeamProjectsBySlug returned error: %v", err) } - want := []*Project{{ID: Int64(1)}} + want := []*Project{{ID: Ptr(int64(1))}} if !cmp.Equal(projects, want) { t.Errorf("Teams.ListTeamProjectsBySlug returned %+v, want %+v", projects, want) } @@ -1095,7 +1095,7 @@ func TestTeamsService_ReviewProjectsByID(t *testing.T) { t.Errorf("Teams.ReviewTeamProjectsByID returned error: %v", err) } - want := &Project{ID: Int64(1)} + want := &Project{ID: Ptr(int64(1))} if !cmp.Equal(project, want) { t.Errorf("Teams.ReviewTeamProjectsByID returned %+v, want %+v", project, want) } @@ -1131,7 +1131,7 @@ func TestTeamsService_ReviewProjectsBySlug(t *testing.T) { t.Errorf("Teams.ReviewTeamProjectsBySlug returned error: %v", err) } - want := &Project{ID: Int64(1)} + want := &Project{ID: Ptr(int64(1))} if !cmp.Equal(project, want) { t.Errorf("Teams.ReviewTeamProjectsBySlug returned %+v, want %+v", project, want) } @@ -1156,7 +1156,7 @@ func TestTeamsService_AddTeamProjectByID(t *testing.T) { client, mux, _ := setup(t) opt := &TeamProjectOptions{ - Permission: String("admin"), + Permission: Ptr("admin"), } mux.HandleFunc("/organizations/1/team/1/projects/1", func(w http.ResponseWriter, r *http.Request) { @@ -1194,7 +1194,7 @@ func TestTeamsService_AddTeamProjectBySlug(t *testing.T) { client, mux, _ := setup(t) opt := &TeamProjectOptions{ - Permission: String("admin"), + Permission: Ptr("admin"), } mux.HandleFunc("/orgs/o/teams/s/projects/1", func(w http.ResponseWriter, r *http.Request) { @@ -1307,9 +1307,9 @@ func TestTeamsService_ListIDPGroupsInOrganization(t *testing.T) { want := &IDPGroupList{ Groups: []*IDPGroup{ { - GroupID: String("1"), - GroupName: String("n"), - GroupDescription: String("d"), + GroupID: Ptr("1"), + GroupName: Ptr("n"), + GroupDescription: Ptr("d"), }, }, } @@ -1350,9 +1350,9 @@ func TestTeamsService_ListIDPGroupsForTeamByID(t *testing.T) { want := &IDPGroupList{ Groups: []*IDPGroup{ { - GroupID: String("1"), - GroupName: String("n"), - GroupDescription: String("d"), + GroupID: Ptr("1"), + GroupName: Ptr("n"), + GroupDescription: Ptr("d"), }, }, } @@ -1393,9 +1393,9 @@ func TestTeamsService_ListIDPGroupsForTeamBySlug(t *testing.T) { want := &IDPGroupList{ Groups: []*IDPGroup{ { - GroupID: String("1"), - GroupName: String("n"), - GroupDescription: String("d"), + GroupID: Ptr("1"), + GroupName: Ptr("n"), + GroupDescription: Ptr("d"), }, }, } @@ -1430,9 +1430,9 @@ func TestTeamsService_CreateOrUpdateIDPGroupConnectionsByID(t *testing.T) { input := IDPGroupList{ Groups: []*IDPGroup{ { - GroupID: String("1"), - GroupName: String("n"), - GroupDescription: String("d"), + GroupID: Ptr("1"), + GroupName: Ptr("n"), + GroupDescription: Ptr("d"), }, }, } @@ -1446,9 +1446,9 @@ func TestTeamsService_CreateOrUpdateIDPGroupConnectionsByID(t *testing.T) { want := &IDPGroupList{ Groups: []*IDPGroup{ { - GroupID: String("1"), - GroupName: String("n"), - GroupDescription: String("d"), + GroupID: Ptr("1"), + GroupName: Ptr("n"), + GroupDescription: Ptr("d"), }, }, } @@ -1483,9 +1483,9 @@ func TestTeamsService_CreateOrUpdateIDPGroupConnectionsBySlug(t *testing.T) { input := IDPGroupList{ Groups: []*IDPGroup{ { - GroupID: String("1"), - GroupName: String("n"), - GroupDescription: String("d"), + GroupID: Ptr("1"), + GroupName: Ptr("n"), + GroupDescription: Ptr("d"), }, }, } @@ -1499,9 +1499,9 @@ func TestTeamsService_CreateOrUpdateIDPGroupConnectionsBySlug(t *testing.T) { want := &IDPGroupList{ Groups: []*IDPGroup{ { - GroupID: String("1"), - GroupName: String("n"), - GroupDescription: String("d"), + GroupID: Ptr("1"), + GroupName: Ptr("n"), + GroupDescription: Ptr("d"), }, }, } @@ -1583,14 +1583,14 @@ func TestNewTeam_Marshal(t *testing.T) { u := &NewTeam{ Name: "n", - Description: String("d"), + Description: Ptr("d"), Maintainers: []string{"m1", "m2"}, RepoNames: []string{"repo1", "repo2"}, - NotificationSetting: String("notifications_enabled"), - ParentTeamID: Int64(1), - Permission: String("perm"), - Privacy: String("p"), - LDAPDN: String("l"), + NotificationSetting: Ptr("notifications_enabled"), + ParentTeamID: Ptr(int64(1)), + Permission: Ptr("perm"), + Privacy: Ptr("p"), + LDAPDN: Ptr("l"), } want := `{ @@ -1613,43 +1613,43 @@ func TestTeams_Marshal(t *testing.T) { testJSONMarshal(t, &Team{}, "{}") u := &Team{ - ID: Int64(1), - NodeID: String("n"), - Name: String("n"), - Description: String("d"), - URL: String("u"), - Slug: String("s"), - Permission: String("p"), - Privacy: String("p"), - MembersCount: Int(1), - ReposCount: Int(1), - MembersURL: String("m"), - RepositoriesURL: String("r"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + Name: Ptr("n"), + Description: Ptr("d"), + URL: Ptr("u"), + Slug: Ptr("s"), + Permission: Ptr("p"), + Privacy: Ptr("p"), + MembersCount: Ptr(1), + ReposCount: Ptr(1), + MembersURL: Ptr("m"), + RepositoriesURL: Ptr("r"), Organization: &Organization{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - AvatarURL: String("a"), - HTMLURL: String("h"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + AvatarURL: Ptr("a"), + HTMLURL: Ptr("h"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), }, Parent: &Team{ - ID: Int64(1), - NodeID: String("n"), - Name: String("n"), - Description: String("d"), - URL: String("u"), - Slug: String("s"), - Permission: String("p"), - Privacy: String("p"), - MembersCount: Int(1), - ReposCount: Int(1), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + Name: Ptr("n"), + Description: Ptr("d"), + URL: Ptr("u"), + Slug: Ptr("s"), + Permission: Ptr("p"), + Privacy: Ptr("p"), + MembersCount: Ptr(1), + ReposCount: Ptr(1), }, - LDAPDN: String("l"), + LDAPDN: Ptr("l"), } want := `{ @@ -1700,14 +1700,14 @@ func TestInvitation_Marshal(t *testing.T) { testJSONMarshal(t, &Invitation{}, "{}") u := &Invitation{ - ID: Int64(1), - NodeID: String("test node"), - Login: String("login123"), - Email: String("go@github.com"), - Role: String("developer"), + ID: Ptr(int64(1)), + NodeID: Ptr("test node"), + Login: Ptr("login123"), + Email: Ptr("go@github.com"), + Role: Ptr("developer"), CreatedAt: &Timestamp{referenceTime}, - TeamCount: Int(99), - InvitationTeamURL: String("url"), + TeamCount: Ptr(99), + InvitationTeamURL: Ptr("url"), } want := `{ @@ -1729,9 +1729,9 @@ func TestIDPGroup_Marshal(t *testing.T) { testJSONMarshal(t, &IDPGroup{}, "{}") u := &IDPGroup{ - GroupID: String("abc1"), - GroupName: String("test group"), - GroupDescription: String("test group description"), + GroupID: Ptr("abc1"), + GroupName: Ptr("test group"), + GroupDescription: Ptr("test group description"), } want := `{ @@ -1787,31 +1787,31 @@ func TestTeamsService_GetExternalGroup(t *testing.T) { } want := &ExternalGroup{ - GroupID: Int64(123), - GroupName: String("Octocat admins"), + GroupID: Ptr(int64(123)), + GroupName: Ptr("Octocat admins"), UpdatedAt: &Timestamp{Time: referenceTime}, Teams: []*ExternalGroupTeam{ { - TeamID: Int64(1), - TeamName: String("team-test"), + TeamID: Ptr(int64(1)), + TeamName: Ptr("team-test"), }, { - TeamID: Int64(2), - TeamName: String("team-test2"), + TeamID: Ptr(int64(2)), + TeamName: Ptr("team-test2"), }, }, Members: []*ExternalGroupMember{ { - MemberID: Int64(1), - MemberLogin: String("mona-lisa_eocsaxrs"), - MemberName: String("Mona Lisa"), - MemberEmail: String("mona_lisa@github.com"), + MemberID: Ptr(int64(1)), + MemberLogin: Ptr("mona-lisa_eocsaxrs"), + MemberName: Ptr("Mona Lisa"), + MemberEmail: Ptr("mona_lisa@github.com"), }, { - MemberID: Int64(2), - MemberLogin: String("octo-lisa_eocsaxrs"), - MemberName: String("Octo Lisa"), - MemberEmail: String("octo_lisa@github.com"), + MemberID: Ptr(int64(2)), + MemberLogin: Ptr("octo-lisa_eocsaxrs"), + MemberName: Ptr("Octo Lisa"), + MemberEmail: Ptr("octo_lisa@github.com"), }, }, } @@ -1875,7 +1875,7 @@ func TestTeamsService_ListExternalGroups(t *testing.T) { ctx := context.Background() opts := &ListExternalGroupsOptions{ - DisplayName: String("Octocat"), + DisplayName: Ptr("Octocat"), } list, _, err := client.Teams.ListExternalGroups(ctx, "o", opts) if err != nil { @@ -1885,8 +1885,8 @@ func TestTeamsService_ListExternalGroups(t *testing.T) { want := &ExternalGroupList{ Groups: []*ExternalGroup{ { - GroupID: Int64(123), - GroupName: String("Octocat admins"), + GroupID: Ptr(int64(123)), + GroupName: Ptr("Octocat admins"), UpdatedAt: &Timestamp{Time: referenceTime}, }, }, @@ -1958,8 +1958,8 @@ func TestTeamsService_ListExternalGroupsForTeamBySlug(t *testing.T) { want := &ExternalGroupList{ Groups: []*ExternalGroup{ { - GroupID: Int64(123), - GroupName: String("Octocat admins"), + GroupID: Ptr(int64(123)), + GroupName: Ptr("Octocat admins"), UpdatedAt: &Timestamp{Time: referenceTime}, }, }, @@ -2044,7 +2044,7 @@ func TestTeamsService_UpdateConnectedExternalGroup(t *testing.T) { ctx := context.Background() body := &ExternalGroup{ - GroupID: Int64(123), + GroupID: Ptr(int64(123)), } externalGroup, _, err := client.Teams.UpdateConnectedExternalGroup(ctx, "o", "t", body) if err != nil { @@ -2052,31 +2052,31 @@ func TestTeamsService_UpdateConnectedExternalGroup(t *testing.T) { } want := &ExternalGroup{ - GroupID: Int64(123), - GroupName: String("Octocat admins"), + GroupID: Ptr(int64(123)), + GroupName: Ptr("Octocat admins"), UpdatedAt: &Timestamp{Time: referenceTime}, Teams: []*ExternalGroupTeam{ { - TeamID: Int64(1), - TeamName: String("team-test"), + TeamID: Ptr(int64(1)), + TeamName: Ptr("team-test"), }, { - TeamID: Int64(2), - TeamName: String("team-test2"), + TeamID: Ptr(int64(2)), + TeamName: Ptr("team-test2"), }, }, Members: []*ExternalGroupMember{ { - MemberID: Int64(1), - MemberLogin: String("mona-lisa_eocsaxrs"), - MemberName: String("Mona Lisa"), - MemberEmail: String("mona_lisa@github.com"), + MemberID: Ptr(int64(1)), + MemberLogin: Ptr("mona-lisa_eocsaxrs"), + MemberName: Ptr("Mona Lisa"), + MemberEmail: Ptr("mona_lisa@github.com"), }, { - MemberID: Int64(2), - MemberLogin: String("octo-lisa_eocsaxrs"), - MemberName: String("Octo Lisa"), - MemberEmail: String("octo_lisa@github.com"), + MemberID: Ptr(int64(2)), + MemberLogin: Ptr("octo-lisa_eocsaxrs"), + MemberName: Ptr("Octo Lisa"), + MemberEmail: Ptr("octo_lisa@github.com"), }, }, } @@ -2110,7 +2110,7 @@ func TestTeamsService_UpdateConnectedExternalGroup_notFound(t *testing.T) { ctx := context.Background() body := &ExternalGroup{ - GroupID: Int64(123), + GroupID: Ptr(int64(123)), } eg, resp, err := client.Teams.UpdateConnectedExternalGroup(ctx, "o", "t", body) if err == nil { @@ -2176,14 +2176,14 @@ func TestIDPGroupList_Marshal(t *testing.T) { u := &IDPGroupList{ Groups: []*IDPGroup{ { - GroupID: String("abc1"), - GroupName: String("test group"), - GroupDescription: String("test group description"), + GroupID: Ptr("abc1"), + GroupName: Ptr("test group"), + GroupDescription: Ptr("test group description"), }, { - GroupID: String("abc2"), - GroupName: String("test group2"), - GroupDescription: String("test group description2"), + GroupID: Ptr("abc2"), + GroupName: Ptr("test group2"), + GroupDescription: Ptr("test group description2"), }, }, } @@ -2211,10 +2211,10 @@ func TestExternalGroupMember_Marshal(t *testing.T) { testJSONMarshal(t, &ExternalGroupMember{}, "{}") u := &ExternalGroupMember{ - MemberID: Int64(1), - MemberLogin: String("test member"), - MemberName: String("test member name"), - MemberEmail: String("test member email"), + MemberID: Ptr(int64(1)), + MemberLogin: Ptr("test member"), + MemberName: Ptr("test member name"), + MemberEmail: Ptr("test member email"), } want := `{ @@ -2232,25 +2232,25 @@ func TestExternalGroup_Marshal(t *testing.T) { testJSONMarshal(t, &ExternalGroup{}, "{}") u := &ExternalGroup{ - GroupID: Int64(123), - GroupName: String("group1"), + GroupID: Ptr(int64(123)), + GroupName: Ptr("group1"), UpdatedAt: &Timestamp{referenceTime}, Teams: []*ExternalGroupTeam{ { - TeamID: Int64(1), - TeamName: String("team-test"), + TeamID: Ptr(int64(1)), + TeamName: Ptr("team-test"), }, { - TeamID: Int64(2), - TeamName: String("team-test2"), + TeamID: Ptr(int64(2)), + TeamName: Ptr("team-test2"), }, }, Members: []*ExternalGroupMember{ { - MemberID: Int64(1), - MemberLogin: String("test"), - MemberName: String("test"), - MemberEmail: String("test@github.com"), + MemberID: Ptr(int64(1)), + MemberLogin: Ptr("test"), + MemberName: Ptr("test"), + MemberEmail: Ptr("test@github.com"), }, }, } @@ -2287,8 +2287,8 @@ func TestExternalGroupTeam_Marshal(t *testing.T) { testJSONMarshal(t, &ExternalGroupTeam{}, "{}") u := &ExternalGroupTeam{ - TeamID: Int64(123), - TeamName: String("test"), + TeamID: Ptr(int64(123)), + TeamName: Ptr("test"), } want := `{ @@ -2304,7 +2304,7 @@ func TestListExternalGroupsOptions_Marshal(t *testing.T) { testJSONMarshal(t, &ListExternalGroupsOptions{}, "{}") u := &ListExternalGroupsOptions{ - DisplayName: String("test"), + DisplayName: Ptr("test"), ListOptions: ListOptions{ Page: 1, PerPage: 2, diff --git a/github/users_administration_test.go b/github/users_administration_test.go index 52270dadc62..8ddf0865335 100644 --- a/github/users_administration_test.go +++ b/github/users_administration_test.go @@ -96,7 +96,7 @@ func TestUsersServiceReason_Suspend(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &UserSuspendOptions{Reason: String("test")} + input := &UserSuspendOptions{Reason: Ptr("test")} mux.HandleFunc("/users/u/suspended", func(w http.ResponseWriter, r *http.Request) { v := new(UserSuspendOptions) @@ -148,7 +148,7 @@ func TestUserSuspendOptions_Marshal(t *testing.T) { testJSONMarshal(t, &UserSuspendOptions{}, "{}") u := &UserSuspendOptions{ - Reason: String("reason"), + Reason: Ptr("reason"), } want := `{ diff --git a/github/users_blocking_test.go b/github/users_blocking_test.go index ca7fd97da5b..e9625cc27ff 100644 --- a/github/users_blocking_test.go +++ b/github/users_blocking_test.go @@ -34,7 +34,7 @@ func TestUsersService_ListBlockedUsers(t *testing.T) { t.Errorf("Users.ListBlockedUsers returned error: %v", err) } - want := []*User{{Login: String("octocat")}} + want := []*User{{Login: Ptr("octocat")}} if !cmp.Equal(blockedUsers, want) { t.Errorf("Users.ListBlockedUsers returned %+v, want %+v", blockedUsers, want) } diff --git a/github/users_emails_test.go b/github/users_emails_test.go index bf3a403526f..6c1c73f3ef9 100644 --- a/github/users_emails_test.go +++ b/github/users_emails_test.go @@ -36,7 +36,7 @@ func TestUsersService_ListEmails(t *testing.T) { t.Errorf("Users.ListEmails returned error: %v", err) } - want := []*UserEmail{{Email: String("user@example.com"), Verified: Bool(false), Primary: Bool(true)}} + want := []*UserEmail{{Email: Ptr("user@example.com"), Verified: Ptr(false), Primary: Ptr(true)}} if !cmp.Equal(emails, want) { t.Errorf("Users.ListEmails returned %+v, want %+v", emails, want) } @@ -76,8 +76,8 @@ func TestUsersService_AddEmails(t *testing.T) { } want := []*UserEmail{ - {Email: String("old@example.com")}, - {Email: String("new@example.com")}, + {Email: Ptr("old@example.com")}, + {Email: Ptr("new@example.com")}, } if !cmp.Equal(emails, want) { t.Errorf("Users.AddEmails returned %+v, want %+v", emails, want) @@ -126,10 +126,10 @@ func TestUserEmail_Marshal(t *testing.T) { testJSONMarshal(t, &UserEmail{}, "{}") u := &UserEmail{ - Email: String("qwe@qwe.qwe"), - Primary: Bool(false), - Verified: Bool(true), - Visibility: String("yes"), + Email: Ptr("qwe@qwe.qwe"), + Primary: Ptr(false), + Verified: Ptr(true), + Visibility: Ptr("yes"), } want := `{ @@ -146,7 +146,7 @@ func TestUsersService_SetEmailVisibility(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &UserEmail{Visibility: String("private")} + input := &UserEmail{Visibility: Ptr("private")} mux.HandleFunc("/user/email/visibility", func(w http.ResponseWriter, r *http.Request) { v := new(UserEmail) @@ -171,7 +171,7 @@ func TestUsersService_SetEmailVisibility(t *testing.T) { t.Errorf("Users.SetEmailVisibility returned error: %v", err) } - want := []*UserEmail{{Email: String("user@example.com"), Verified: Bool(false), Primary: Bool(true), Visibility: String("private")}} + want := []*UserEmail{{Email: Ptr("user@example.com"), Verified: Ptr(false), Primary: Ptr(true), Visibility: Ptr("private")}} if !cmp.Equal(emails, want) { t.Errorf("Users.SetEmailVisibility returned %+v, want %+v", emails, want) } diff --git a/github/users_followers_test.go b/github/users_followers_test.go index 790739512b4..1ffe5d7c70e 100644 --- a/github/users_followers_test.go +++ b/github/users_followers_test.go @@ -31,7 +31,7 @@ func TestUsersService_ListFollowers_authenticatedUser(t *testing.T) { t.Errorf("Users.ListFollowers returned error: %v", err) } - want := []*User{{ID: Int64(1)}} + want := []*User{{ID: Ptr(int64(1))}} if !cmp.Equal(users, want) { t.Errorf("Users.ListFollowers returned %+v, want %+v", users, want) } @@ -66,7 +66,7 @@ func TestUsersService_ListFollowers_specifiedUser(t *testing.T) { t.Errorf("Users.ListFollowers returned error: %v", err) } - want := []*User{{ID: Int64(1)}} + want := []*User{{ID: Ptr(int64(1))}} if !cmp.Equal(users, want) { t.Errorf("Users.ListFollowers returned %+v, want %+v", users, want) } @@ -112,7 +112,7 @@ func TestUsersService_ListFollowing_authenticatedUser(t *testing.T) { t.Errorf("Users.ListFollowing returned error: %v", err) } - want := []*User{{ID: Int64(1)}} + want := []*User{{ID: Ptr(int64(1))}} if !cmp.Equal(users, want) { t.Errorf("Users.ListFollowing returned %+v, want %+v", users, want) } @@ -147,7 +147,7 @@ func TestUsersService_ListFollowing_specifiedUser(t *testing.T) { t.Errorf("Users.ListFollowing returned error: %v", err) } - want := []*User{{ID: Int64(1)}} + want := []*User{{ID: Ptr(int64(1))}} if !cmp.Equal(users, want) { t.Errorf("Users.ListFollowing returned %+v, want %+v", users, want) } diff --git a/github/users_gpg_keys_test.go b/github/users_gpg_keys_test.go index 1d04f758e17..585ea4c6dbd 100644 --- a/github/users_gpg_keys_test.go +++ b/github/users_gpg_keys_test.go @@ -32,7 +32,7 @@ func TestUsersService_ListGPGKeys_authenticatedUser(t *testing.T) { t.Errorf("Users.ListGPGKeys returned error: %v", err) } - want := []*GPGKey{{ID: Int64(1), PrimaryKeyID: Int64(2)}} + want := []*GPGKey{{ID: Ptr(int64(1)), PrimaryKeyID: Ptr(int64(2))}} if !cmp.Equal(keys, want) { t.Errorf("Users.ListGPGKeys = %+v, want %+v", keys, want) } @@ -67,7 +67,7 @@ func TestUsersService_ListGPGKeys_specifiedUser(t *testing.T) { t.Errorf("Users.ListGPGKeys returned error: %v", err) } - want := []*GPGKey{{ID: Int64(1), PrimaryKeyID: Int64(2)}} + want := []*GPGKey{{ID: Ptr(int64(1)), PrimaryKeyID: Ptr(int64(2))}} if !cmp.Equal(keys, want) { t.Errorf("Users.ListGPGKeys = %+v, want %+v", keys, want) } @@ -97,7 +97,7 @@ func TestUsersService_GetGPGKey(t *testing.T) { t.Errorf("Users.GetGPGKey returned error: %v", err) } - want := &GPGKey{ID: Int64(1)} + want := &GPGKey{ID: Ptr(int64(1))} if !cmp.Equal(key, want) { t.Errorf("Users.GetGPGKey = %+v, want %+v", key, want) } @@ -150,7 +150,7 @@ mQINBFcEd9kBEACo54TDbGhKlXKWMvJgecEUKPPcv7XdnpKdGb3LRw5MvFwT0V0f t.Errorf("Users.GetGPGKey returned error: %v", err) } - want := &GPGKey{ID: Int64(1)} + want := &GPGKey{ID: Ptr(int64(1))} if !cmp.Equal(gpgKey, want) { t.Errorf("Users.GetGPGKey = %+v, want %+v", gpgKey, want) } @@ -195,8 +195,8 @@ func TestGPGEmail_Marshal(t *testing.T) { testJSONMarshal(t, &GPGEmail{}, "{}") u := &GPGEmail{ - Email: String("email@abc.com"), - Verified: Bool(false), + Email: Ptr("email@abc.com"), + Verified: Ptr(false), } want := `{ @@ -214,24 +214,24 @@ func TestGPGKey_Marshal(t *testing.T) { ti := &Timestamp{} g := &GPGKey{ - ID: Int64(1), - PrimaryKeyID: Int64(1), - KeyID: String("someKeyID"), - RawKey: String("someRawKeyID"), - PublicKey: String("somePublicKey"), + ID: Ptr(int64(1)), + PrimaryKeyID: Ptr(int64(1)), + KeyID: Ptr("someKeyID"), + RawKey: Ptr("someRawKeyID"), + PublicKey: Ptr("somePublicKey"), Emails: []*GPGEmail{ { - Email: String("someEmail"), - Verified: Bool(true), + Email: Ptr("someEmail"), + Verified: Ptr(true), }, }, Subkeys: []*GPGKey{ {}, }, - CanSign: Bool(true), - CanEncryptComms: Bool(true), - CanEncryptStorage: Bool(true), - CanCertify: Bool(true), + CanSign: Ptr(true), + CanEncryptComms: Ptr(true), + CanEncryptStorage: Ptr(true), + CanCertify: Ptr(true), CreatedAt: ti, ExpiresAt: ti, } diff --git a/github/users_keys_test.go b/github/users_keys_test.go index 15553f52f35..59167a34778 100644 --- a/github/users_keys_test.go +++ b/github/users_keys_test.go @@ -32,7 +32,7 @@ func TestUsersService_ListKeys_authenticatedUser(t *testing.T) { t.Errorf("Users.ListKeys returned error: %v", err) } - want := []*Key{{ID: Int64(1)}} + want := []*Key{{ID: Ptr(int64(1))}} if !cmp.Equal(keys, want) { t.Errorf("Users.ListKeys returned %+v, want %+v", keys, want) } @@ -67,7 +67,7 @@ func TestUsersService_ListKeys_specifiedUser(t *testing.T) { t.Errorf("Users.ListKeys returned error: %v", err) } - want := []*Key{{ID: Int64(1)}} + want := []*Key{{ID: Ptr(int64(1))}} if !cmp.Equal(keys, want) { t.Errorf("Users.ListKeys returned %+v, want %+v", keys, want) } @@ -97,7 +97,7 @@ func TestUsersService_GetKey(t *testing.T) { t.Errorf("Users.GetKey returned error: %v", err) } - want := &Key{ID: Int64(1)} + want := &Key{ID: Ptr(int64(1))} if !cmp.Equal(key, want) { t.Errorf("Users.GetKey returned %+v, want %+v", key, want) } @@ -121,7 +121,7 @@ func TestUsersService_CreateKey(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &Key{Key: String("k"), Title: String("t")} + input := &Key{Key: Ptr("k"), Title: Ptr("t")} mux.HandleFunc("/user/keys", func(w http.ResponseWriter, r *http.Request) { v := new(Key) @@ -141,7 +141,7 @@ func TestUsersService_CreateKey(t *testing.T) { t.Errorf("Users.CreateKey returned error: %v", err) } - want := &Key{ID: Int64(1)} + want := &Key{ID: Ptr(int64(1))} if !cmp.Equal(key, want) { t.Errorf("Users.CreateKey returned %+v, want %+v", key, want) } @@ -186,12 +186,12 @@ func TestKey_Marshal(t *testing.T) { testJSONMarshal(t, &Key{}, "{}") u := &Key{ - ID: Int64(1), - Key: String("abc"), - URL: String("url"), - Title: String("title"), - ReadOnly: Bool(true), - Verified: Bool(true), + ID: Ptr(int64(1)), + Key: Ptr("abc"), + URL: Ptr("url"), + Title: Ptr("title"), + ReadOnly: Ptr(true), + Verified: Ptr(true), CreatedAt: &Timestamp{referenceTime}, } diff --git a/github/users_packages_test.go b/github/users_packages_test.go index 2b34b51c6eb..3d1cffff569 100644 --- a/github/users_packages_test.go +++ b/github/users_packages_test.go @@ -35,19 +35,19 @@ func TestUsersService_Authenticated_ListPackages(t *testing.T) { }) ctx := context.Background() - packages, _, err := client.Users.ListPackages(ctx, "", &PackageListOptions{PackageType: String("container"), Visibility: String("private")}) + packages, _, err := client.Users.ListPackages(ctx, "", &PackageListOptions{PackageType: Ptr("container"), Visibility: Ptr("private")}) if err != nil { t.Errorf("Users.Authenticated_ListPackages returned error: %v", err) } want := []*Package{{ - ID: Int64(197), - Name: String("hello_docker"), - PackageType: String("container"), - VersionCount: Int64(1), - Visibility: String("private"), - URL: String("https://api.github.com/orgs/github/packages/container/hello_docker"), - HTMLURL: String("https://github.com/orgs/github/packages/container/package/hello_docker"), + ID: Ptr(int64(197)), + Name: Ptr("hello_docker"), + PackageType: Ptr("container"), + VersionCount: Ptr(int64(1)), + Visibility: Ptr("private"), + URL: Ptr("https://api.github.com/orgs/github/packages/container/hello_docker"), + HTMLURL: Ptr("https://github.com/orgs/github/packages/container/package/hello_docker"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, }} @@ -91,19 +91,19 @@ func TestUsersService_specifiedUser_ListPackages(t *testing.T) { }) ctx := context.Background() - packages, _, err := client.Users.ListPackages(ctx, "u", &PackageListOptions{PackageType: String("container"), Visibility: String("public")}) + packages, _, err := client.Users.ListPackages(ctx, "u", &PackageListOptions{PackageType: Ptr("container"), Visibility: Ptr("public")}) if err != nil { t.Errorf("Users.specifiedUser_ListPackages returned error: %v", err) } want := []*Package{{ - ID: Int64(197), - Name: String("hello_docker"), - PackageType: String("container"), - VersionCount: Int64(1), - Visibility: String("public"), - URL: String("https://api.github.com/orgs/github/packages/container/hello_docker"), - HTMLURL: String("https://github.com/orgs/github/packages/container/package/hello_docker"), + ID: Ptr(int64(197)), + Name: Ptr("hello_docker"), + PackageType: Ptr("container"), + VersionCount: Ptr(int64(1)), + Visibility: Ptr("public"), + URL: Ptr("https://api.github.com/orgs/github/packages/container/hello_docker"), + HTMLURL: Ptr("https://github.com/orgs/github/packages/container/package/hello_docker"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, }} @@ -152,13 +152,13 @@ func TestUsersService_specifiedUser_GetPackage(t *testing.T) { } want := &Package{ - ID: Int64(197), - Name: String("hello_docker"), - PackageType: String("container"), - VersionCount: Int64(1), - Visibility: String("private"), - URL: String("https://api.github.com/orgs/github/packages/container/hello_docker"), - HTMLURL: String("https://github.com/orgs/github/packages/container/package/hello_docker"), + ID: Ptr(int64(197)), + Name: Ptr("hello_docker"), + PackageType: Ptr("container"), + VersionCount: Ptr(int64(1)), + Visibility: Ptr("private"), + URL: Ptr("https://api.github.com/orgs/github/packages/container/hello_docker"), + HTMLURL: Ptr("https://github.com/orgs/github/packages/container/package/hello_docker"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, } @@ -207,13 +207,13 @@ func TestUsersService_Authenticated_GetPackage(t *testing.T) { } want := &Package{ - ID: Int64(197), - Name: String("hello_docker"), - PackageType: String("container"), - VersionCount: Int64(1), - Visibility: String("private"), - URL: String("https://api.github.com/orgs/github/packages/container/hello_docker"), - HTMLURL: String("https://github.com/orgs/github/packages/container/package/hello_docker"), + ID: Ptr(int64(197)), + Name: Ptr("hello_docker"), + PackageType: Ptr("container"), + VersionCount: Ptr(int64(1)), + Visibility: Ptr("private"), + URL: Ptr("https://api.github.com/orgs/github/packages/container/hello_docker"), + HTMLURL: Ptr("https://github.com/orgs/github/packages/container/package/hello_docker"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, } @@ -364,7 +364,7 @@ func TestUsersService_Authenticated_ListPackagesVersions(t *testing.T) { ctx := context.Background() opts := &PackageListOptions{ - String("internal"), String("container"), String("deleted"), ListOptions{Page: 1, PerPage: 2}, + Ptr("internal"), Ptr("container"), Ptr("deleted"), ListOptions{Page: 1, PerPage: 2}, } packages, _, err := client.Users.PackageGetAllVersions(ctx, "", "container", "hello_docker", opts) if err != nil { @@ -372,15 +372,15 @@ func TestUsersService_Authenticated_ListPackagesVersions(t *testing.T) { } want := []*PackageVersion{{ - ID: Int64(45763), - Name: String("sha256:08a44bab0bddaddd8837a8b381aebc2e4b933768b981685a9e088360af0d3dd9"), - URL: String("https://api.github.com/users/octocat/packages/container/hello_docker/versions/45763"), - PackageHTMLURL: String("https://github.com/users/octocat/packages/container/package/hello_docker"), + ID: Ptr(int64(45763)), + Name: Ptr("sha256:08a44bab0bddaddd8837a8b381aebc2e4b933768b981685a9e088360af0d3dd9"), + URL: Ptr("https://api.github.com/users/octocat/packages/container/hello_docker/versions/45763"), + PackageHTMLURL: Ptr("https://github.com/users/octocat/packages/container/package/hello_docker"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HTMLURL: String("https://github.com/users/octocat/packages/container/hello_docker/45763"), + HTMLURL: Ptr("https://github.com/users/octocat/packages/container/hello_docker/45763"), Metadata: &PackageMetadata{ - PackageType: String("container"), + PackageType: Ptr("container"), Container: &PackageContainerMetadata{ Tags: []string{"latest"}, }, @@ -433,7 +433,7 @@ func TestUsersService_specifiedUser_ListPackagesVersions(t *testing.T) { ctx := context.Background() opts := &PackageListOptions{ - String("internal"), String("container"), String("deleted"), ListOptions{Page: 1, PerPage: 2}, + Ptr("internal"), Ptr("container"), Ptr("deleted"), ListOptions{Page: 1, PerPage: 2}, } packages, _, err := client.Users.PackageGetAllVersions(ctx, "u", "container", "hello_docker", opts) if err != nil { @@ -441,15 +441,15 @@ func TestUsersService_specifiedUser_ListPackagesVersions(t *testing.T) { } want := []*PackageVersion{{ - ID: Int64(45763), - Name: String("sha256:08a44bab0bddaddd8837a8b381aebc2e4b933768b981685a9e088360af0d3dd9"), - URL: String("https://api.github.com/users/octocat/packages/container/hello_docker/versions/45763"), - PackageHTMLURL: String("https://github.com/users/octocat/packages/container/package/hello_docker"), + ID: Ptr(int64(45763)), + Name: Ptr("sha256:08a44bab0bddaddd8837a8b381aebc2e4b933768b981685a9e088360af0d3dd9"), + URL: Ptr("https://api.github.com/users/octocat/packages/container/hello_docker/versions/45763"), + PackageHTMLURL: Ptr("https://github.com/users/octocat/packages/container/package/hello_docker"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HTMLURL: String("https://github.com/users/octocat/packages/container/hello_docker/45763"), + HTMLURL: Ptr("https://github.com/users/octocat/packages/container/hello_docker/45763"), Metadata: &PackageMetadata{ - PackageType: String("container"), + PackageType: Ptr("container"), Container: &PackageContainerMetadata{ Tags: []string{"latest"}, }, @@ -507,15 +507,15 @@ func TestUsersService_Authenticated_PackageGetVersion(t *testing.T) { } want := &PackageVersion{ - ID: Int64(45763), - Name: String("sha256:08a44bab0bddaddd8837a8b381aebc2e4b933768b981685a9e088360af0d3dd9"), - URL: String("https://api.github.com/users/octocat/packages/container/hello_docker/versions/45763"), - PackageHTMLURL: String("https://github.com/users/octocat/packages/container/package/hello_docker"), + ID: Ptr(int64(45763)), + Name: Ptr("sha256:08a44bab0bddaddd8837a8b381aebc2e4b933768b981685a9e088360af0d3dd9"), + URL: Ptr("https://api.github.com/users/octocat/packages/container/hello_docker/versions/45763"), + PackageHTMLURL: Ptr("https://github.com/users/octocat/packages/container/package/hello_docker"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HTMLURL: String("https://github.com/users/octocat/packages/container/hello_docker/45763"), + HTMLURL: Ptr("https://github.com/users/octocat/packages/container/hello_docker/45763"), Metadata: &PackageMetadata{ - PackageType: String("container"), + PackageType: Ptr("container"), Container: &PackageContainerMetadata{ Tags: []string{"latest"}, }, @@ -573,15 +573,15 @@ func TestUsersService_specifiedUser_PackageGetVersion(t *testing.T) { } want := &PackageVersion{ - ID: Int64(45763), - Name: String("sha256:08a44bab0bddaddd8837a8b381aebc2e4b933768b981685a9e088360af0d3dd9"), - URL: String("https://api.github.com/users/octocat/packages/container/hello_docker/versions/45763"), - PackageHTMLURL: String("https://github.com/users/octocat/packages/container/package/hello_docker"), + ID: Ptr(int64(45763)), + Name: Ptr("sha256:08a44bab0bddaddd8837a8b381aebc2e4b933768b981685a9e088360af0d3dd9"), + URL: Ptr("https://api.github.com/users/octocat/packages/container/hello_docker/versions/45763"), + PackageHTMLURL: Ptr("https://github.com/users/octocat/packages/container/package/hello_docker"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HTMLURL: String("https://github.com/users/octocat/packages/container/hello_docker/45763"), + HTMLURL: Ptr("https://github.com/users/octocat/packages/container/hello_docker/45763"), Metadata: &PackageMetadata{ - PackageType: String("container"), + PackageType: Ptr("container"), Container: &PackageContainerMetadata{ Tags: []string{"latest"}, }, diff --git a/github/users_projects_test.go b/github/users_projects_test.go index 8514301d1f5..215dc3ec98f 100644 --- a/github/users_projects_test.go +++ b/github/users_projects_test.go @@ -33,7 +33,7 @@ func TestUsersService_ListProjects(t *testing.T) { t.Errorf("Users.ListProjects returned error: %v", err) } - want := []*Project{{ID: Int64(1)}} + want := []*Project{{ID: Ptr(int64(1))}} if !cmp.Equal(projects, want) { t.Errorf("Users.ListProjects returned %+v, want %+v", projects, want) } @@ -57,7 +57,7 @@ func TestUsersService_CreateProject(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &CreateUserProjectOptions{Name: "Project Name", Body: String("Project body.")} + input := &CreateUserProjectOptions{Name: "Project Name", Body: Ptr("Project body.")} mux.HandleFunc("/user/projects", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") @@ -78,7 +78,7 @@ func TestUsersService_CreateProject(t *testing.T) { t.Errorf("Users.CreateProject returned error: %v", err) } - want := &Project{ID: Int64(1)} + want := &Project{ID: Ptr(int64(1))} if !cmp.Equal(project, want) { t.Errorf("Users.CreateProject returned %+v, want %+v", project, want) } @@ -99,7 +99,7 @@ func TestCreateUserProjectOptions_Marshal(t *testing.T) { c := CreateUserProjectOptions{ Name: "SomeProject", - Body: String("SomeProjectBody"), + Body: Ptr("SomeProjectBody"), } want := `{ diff --git a/github/users_ssh_signing_keys_test.go b/github/users_ssh_signing_keys_test.go index d5c15ee34ee..56c082fdb8a 100644 --- a/github/users_ssh_signing_keys_test.go +++ b/github/users_ssh_signing_keys_test.go @@ -32,7 +32,7 @@ func TestUsersService_ListSSHSigningKeys_authenticatedUser(t *testing.T) { t.Errorf("Users.ListSSHSigningKeys returned error: %v", err) } - want := []*SSHSigningKey{{ID: Int64(1)}} + want := []*SSHSigningKey{{ID: Ptr(int64(1))}} if !cmp.Equal(keys, want) { t.Errorf("Users.ListSSHSigningKeys returned %+v, want %+v", keys, want) } @@ -67,7 +67,7 @@ func TestUsersService_ListSSHSigningKeys_specifiedUser(t *testing.T) { t.Errorf("Users.ListSSHSigningKeys returned error: %v", err) } - want := []*SSHSigningKey{{ID: Int64(1)}} + want := []*SSHSigningKey{{ID: Ptr(int64(1))}} if !cmp.Equal(keys, want) { t.Errorf("Users.ListSSHSigningKeys returned %+v, want %+v", keys, want) } @@ -97,7 +97,7 @@ func TestUsersService_GetSSHSigningKey(t *testing.T) { t.Errorf("Users.GetSSHSigningKey returned error: %v", err) } - want := &SSHSigningKey{ID: Int64(1)} + want := &SSHSigningKey{ID: Ptr(int64(1))} if !cmp.Equal(key, want) { t.Errorf("Users.GetSSHSigningKey returned %+v, want %+v", key, want) } @@ -121,7 +121,7 @@ func TestUsersService_CreateSSHSigningKey(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &Key{Key: String("k"), Title: String("t")} + input := &Key{Key: Ptr("k"), Title: Ptr("t")} mux.HandleFunc("/user/ssh_signing_keys", func(w http.ResponseWriter, r *http.Request) { v := new(Key) @@ -141,7 +141,7 @@ func TestUsersService_CreateSSHSigningKey(t *testing.T) { t.Errorf("Users.CreateSSHSigningKey returned error: %v", err) } - want := &SSHSigningKey{ID: Int64(1)} + want := &SSHSigningKey{ID: Ptr(int64(1))} if !cmp.Equal(key, want) { t.Errorf("Users.CreateSSHSigningKey returned %+v, want %+v", key, want) } @@ -186,9 +186,9 @@ func TestSSHSigningKey_Marshal(t *testing.T) { testJSONMarshal(t, &SSHSigningKey{}, "{}") u := &Key{ - ID: Int64(1), - Key: String("abc"), - Title: String("title"), + ID: Ptr(int64(1)), + Key: Ptr("abc"), + Title: Ptr("title"), CreatedAt: &Timestamp{referenceTime}, } diff --git a/github/users_test.go b/github/users_test.go index 0e0137a65aa..96332b15567 100644 --- a/github/users_test.go +++ b/github/users_test.go @@ -20,22 +20,22 @@ func TestUser_Marshal(t *testing.T) { testJSONMarshal(t, &User{}, "{}") u := &User{ - Login: String("l"), - ID: Int64(1), - URL: String("u"), - AvatarURL: String("a"), - GravatarID: String("g"), - Name: String("n"), - Company: String("c"), - Blog: String("b"), - Location: String("l"), - Email: String("e"), - Hireable: Bool(true), - Bio: String("b"), - TwitterUsername: String("t"), - PublicRepos: Int(1), - Followers: Int(1), - Following: Int(1), + Login: Ptr("l"), + ID: Ptr(int64(1)), + URL: Ptr("u"), + AvatarURL: Ptr("a"), + GravatarID: Ptr("g"), + Name: Ptr("n"), + Company: Ptr("c"), + Blog: Ptr("b"), + Location: Ptr("l"), + Email: Ptr("e"), + Hireable: Ptr(true), + Bio: Ptr("b"), + TwitterUsername: Ptr("t"), + PublicRepos: Ptr(1), + Followers: Ptr(1), + Following: Ptr(1), CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, } @@ -62,44 +62,44 @@ func TestUser_Marshal(t *testing.T) { testJSONMarshal(t, u, want) u2 := &User{ - Login: String("testLogin"), - ID: Int64(1), - NodeID: String("testNode123"), - AvatarURL: String("https://www.my-avatar.com"), - HTMLURL: String("https://www.test-url.com"), - GravatarID: String("testGravatar123"), - Name: String("myName"), - Company: String("testCompany"), - Blog: String("test Blog"), - Location: String("test location"), - Email: String("test@test.com"), - Hireable: Bool(true), - Bio: String("my good bio"), - TwitterUsername: String("https://www.twitter.com/test"), - PublicRepos: Int(1), - PublicGists: Int(2), - Followers: Int(100), - Following: Int(29), + Login: Ptr("testLogin"), + ID: Ptr(int64(1)), + NodeID: Ptr("testNode123"), + AvatarURL: Ptr("https://www.my-avatar.com"), + HTMLURL: Ptr("https://www.test-url.com"), + GravatarID: Ptr("testGravatar123"), + Name: Ptr("myName"), + Company: Ptr("testCompany"), + Blog: Ptr("test Blog"), + Location: Ptr("test location"), + Email: Ptr("test@test.com"), + Hireable: Ptr(true), + Bio: Ptr("my good bio"), + TwitterUsername: Ptr("https://www.twitter.com/test"), + PublicRepos: Ptr(1), + PublicGists: Ptr(2), + Followers: Ptr(100), + Following: Ptr(29), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, - Type: String("test type"), - SiteAdmin: Bool(false), - TotalPrivateRepos: Int64(2), - OwnedPrivateRepos: Int64(1), - PrivateGists: Int(1), - DiskUsage: Int(1), - Collaborators: Int(1), - TwoFactorAuthentication: Bool(false), + Type: Ptr("test type"), + SiteAdmin: Ptr(false), + TotalPrivateRepos: Ptr(int64(2)), + OwnedPrivateRepos: Ptr(int64(1)), + PrivateGists: Ptr(1), + DiskUsage: Ptr(1), + Collaborators: Ptr(1), + TwoFactorAuthentication: Ptr(false), Plan: &Plan{ - Name: String("silver"), - Space: Int(1024), - Collaborators: Int(10), - PrivateRepos: Int64(4), - FilledSeats: Int(24), - Seats: Int(1), + Name: Ptr("silver"), + Space: Ptr(1024), + Collaborators: Ptr(10), + PrivateRepos: Ptr(int64(4)), + FilledSeats: Ptr(24), + Seats: Ptr(1), }, - LdapDn: String("test ldap"), + LdapDn: Ptr("test ldap"), } want2 := `{ @@ -160,7 +160,7 @@ func TestUsersService_Get_authenticatedUser(t *testing.T) { t.Errorf("Users.Get returned error: %v", err) } - want := &User{ID: Int64(1)} + want := &User{ID: Ptr(int64(1))} if !cmp.Equal(user, want) { t.Errorf("Users.Get returned %+v, want %+v", user, want) } @@ -195,7 +195,7 @@ func TestUsersService_Get_specifiedUser(t *testing.T) { t.Errorf("Users.Get returned error: %v", err) } - want := &User{ID: Int64(1)} + want := &User{ID: Ptr(int64(1))} if !cmp.Equal(user, want) { t.Errorf("Users.Get returned %+v, want %+v", user, want) } @@ -225,7 +225,7 @@ func TestUsersService_GetByID(t *testing.T) { t.Fatalf("Users.GetByID returned error: %v", err) } - want := &User{ID: Int64(1)} + want := &User{ID: Ptr(int64(1))} if !cmp.Equal(user, want) { t.Errorf("Users.GetByID returned %+v, want %+v", user, want) } @@ -249,7 +249,7 @@ func TestUsersService_Edit(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &User{Name: String("n")} + input := &User{Name: Ptr("n")} mux.HandleFunc("/user", func(w http.ResponseWriter, r *http.Request) { v := new(User) @@ -269,7 +269,7 @@ func TestUsersService_Edit(t *testing.T) { t.Errorf("Users.Edit returned error: %v", err) } - want := &User{ID: Int64(1)} + want := &User{ID: Ptr(int64(1))} if !cmp.Equal(user, want) { t.Errorf("Users.Edit returned %+v, want %+v", user, want) } @@ -301,7 +301,7 @@ func TestUsersService_GetHovercard(t *testing.T) { t.Errorf("Users.GetHovercard returned error: %v", err) } - want := &Hovercard{Contexts: []*UserContext{{Message: String("Owns this repository"), Octicon: String("repo")}}} + want := &Hovercard{Contexts: []*UserContext{{Message: Ptr("Owns this repository"), Octicon: Ptr("repo")}}} if !cmp.Equal(hovercard, want) { t.Errorf("Users.GetHovercard returned %+v, want %+v", hovercard, want) } @@ -338,7 +338,7 @@ func TestUsersService_ListAll(t *testing.T) { t.Errorf("Users.Get returned error: %v", err) } - want := []*User{{ID: Int64(2)}} + want := []*User{{ID: Ptr(int64(2))}} if !cmp.Equal(users, want) { t.Errorf("Users.ListAll returned %+v, want %+v", users, want) } @@ -368,7 +368,7 @@ func TestUsersService_ListInvitations(t *testing.T) { t.Errorf("Users.ListInvitations returned error: %v", err) } - want := []*RepositoryInvitation{{ID: Int64(1)}, {ID: Int64(2)}} + want := []*RepositoryInvitation{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}} if !cmp.Equal(got, want) { t.Errorf("Users.ListInvitations = %+v, want %+v", got, want) } @@ -457,8 +457,8 @@ func TestUserContext_Marshal(t *testing.T) { testJSONMarshal(t, &UserContext{}, "{}") u := &UserContext{ - Message: String("message"), - Octicon: String("message"), + Message: Ptr("message"), + Octicon: Ptr("message"), } want := `{ @@ -476,8 +476,8 @@ func TestHovercard_Marshal(t *testing.T) { h := &Hovercard{ Contexts: []*UserContext{ { - Message: String("someMessage"), - Octicon: String("someOcticon"), + Message: Ptr("someMessage"), + Octicon: Ptr("someOcticon"), }, }, } diff --git a/test/integration/activity_test.go b/test/integration/activity_test.go index 369c5e6c7d4..2532baa6709 100644 --- a/test/integration/activity_test.go +++ b/test/integration/activity_test.go @@ -93,7 +93,7 @@ func deleteSubscription(t *testing.T) { func createSubscription(t *testing.T) { // watch the target repository - sub := &github.Subscription{Subscribed: github.Bool(true)} + sub := &github.Subscription{Subscribed: github.Ptr(true)} _, _, err := client.Activity.SetRepositorySubscription(context.Background(), owner, repo, sub) if err != nil { t.Fatalf("Activity.SetRepositorySubscription returned error: %v", err) diff --git a/test/integration/github_test.go b/test/integration/github_test.go index 577ccba89ab..1b5d66e25c6 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -76,8 +76,8 @@ func createRandomTestRepository(owner string, autoinit bool) (*github.Repository context.Background(), owner, &github.Repository{ - Name: github.String(repoName), - AutoInit: github.Bool(autoinit), + Name: github.Ptr(repoName), + AutoInit: github.Ptr(autoinit), }, ) if err != nil { diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index 81c0d6da093..6c0b43cf776 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -29,7 +29,7 @@ func TestRepositories_CRUD(t *testing.T) { } // update the repository description - repo.Description = github.String("description") + repo.Description = github.Ptr("description") repo.DefaultBranch = nil // FIXME: this shouldn't be necessary _, _, err = client.Repositories.Edit(context.Background(), *repo.Owner.Login, *repo.Name, repo) if err != nil { @@ -112,9 +112,9 @@ func TestRepositories_EditBranches(t *testing.T) { // In order to be able to test these Restrictions, need to add support // for creating temporary organization repositories. Restrictions: nil, - BlockCreations: github.Bool(false), - LockBranch: github.Bool(false), - AllowForkSyncing: github.Bool(false), + BlockCreations: github.Ptr(false), + LockBranch: github.Ptr(false), + AllowForkSyncing: github.Ptr(false), } protection, _, err := client.Repositories.UpdateBranchProtection(context.Background(), *repo.Owner.Login, *repo.Name, "master", protectionRequest) @@ -132,18 +132,18 @@ func TestRepositories_EditBranches(t *testing.T) { RequiredApprovingReviewCount: 0, }, EnforceAdmins: &github.AdminEnforcement{ - URL: github.String("https://api.github.com/repos/" + *repo.Owner.Login + "/" + *repo.Name + "/branches/master/protection/enforce_admins"), + URL: github.Ptr("https://api.github.com/repos/" + *repo.Owner.Login + "/" + *repo.Name + "/branches/master/protection/enforce_admins"), Enabled: true, }, Restrictions: nil, BlockCreations: &github.BlockCreations{ - Enabled: github.Bool(false), + Enabled: github.Ptr(false), }, LockBranch: &github.LockBranch{ - Enabled: github.Bool(false), + Enabled: github.Ptr(false), }, AllowForkSyncing: &github.AllowForkSyncing{ - Enabled: github.Bool(false), + Enabled: github.Ptr(false), }, } if !cmp.Equal(protection, want) { @@ -213,9 +213,9 @@ func TestRepositories_Autolinks(t *testing.T) { } opts := &github.AutolinkOptions{ - KeyPrefix: github.String("TICKET-"), - URLTemplate: github.String("https://example.com/TICKET?query="), - IsAlphanumeric: github.Bool(false), + KeyPrefix: github.Ptr("TICKET-"), + URLTemplate: github.Ptr("https://example.com/TICKET?query="), + IsAlphanumeric: github.Ptr(false), } actionlink, _, err := client.Repositories.AddAutolink(context.Background(), *repo.Owner.Login, *repo.Name, opts) diff --git a/test/integration/users_test.go b/test/integration/users_test.go index 3415fc26161..78e597aef0b 100644 --- a/test/integration/users_test.go +++ b/test/integration/users_test.go @@ -190,8 +190,8 @@ func TestUsers_Keys(t *testing.T) { // Add new key _, _, err = client.Users.CreateKey(context.Background(), &github.Key{ - Title: github.String("go-github test key"), - Key: github.String(key), + Title: github.Ptr("go-github test key"), + Key: github.Ptr(key), }) if err != nil { t.Fatalf("Users.CreateKey() returned error: %v", err) diff --git a/tools/metadata/main_test.go b/tools/metadata/main_test.go index a9f69abacae..65525714c05 100644 --- a/tools/metadata/main_test.go +++ b/tools/metadata/main_test.go @@ -355,19 +355,19 @@ func newTestServer(t *testing.T, ref string, files map[string]interface{}) *http server := httptest.NewServer(mux) mux.HandleFunc( path.Join(repoPath, "commits", ref), - jsonHandler(emptyQuery, &github.RepositoryCommit{SHA: github.String("s")}), + jsonHandler(emptyQuery, &github.RepositoryCommit{SHA: github.Ptr("s")}), ) var descriptionsContent []*github.RepositoryContent for name, content := range files { descriptionsContent = append(descriptionsContent, &github.RepositoryContent{ - Name: github.String(path.Base(path.Dir(name))), + Name: github.Ptr(path.Base(path.Dir(name))), }) mux.HandleFunc( path.Join(repoPath, "contents/descriptions", path.Dir(name)), jsonHandler(refQuery, []*github.RepositoryContent{ { - Name: github.String(path.Base(name)), - DownloadURL: github.String(server.URL + "/dl/" + name), + Name: github.Ptr(path.Base(name)), + DownloadURL: github.Ptr(server.URL + "/dl/" + name), }, }), ) From 9505a7fc910c637ce04ade611f59751068c7b644 Mon Sep 17 00:00:00 2001 From: Steve Hipwell Date: Wed, 11 Dec 2024 13:23:42 +0000 Subject: [PATCH 588/751] feat: Add GET for custom org repo role (#3372) Fixes: #3370. --- github/orgs_custom_repository_roles.go | 23 ++++++ github/orgs_custom_repository_roles_test.go | 78 +++++++++++++++++++++ 2 files changed, 101 insertions(+) diff --git a/github/orgs_custom_repository_roles.go b/github/orgs_custom_repository_roles.go index 2295e1b8a70..44408db1418 100644 --- a/github/orgs_custom_repository_roles.go +++ b/github/orgs_custom_repository_roles.go @@ -61,6 +61,29 @@ func (s *OrganizationsService) ListCustomRepoRoles(ctx context.Context, org stri return customRepoRoles, resp, nil } +// GetCustomRepoRole gets a custom repository roles available in this organization. +// In order to see custom repository roles in an organization, the authenticated user must be an organization owner. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#get-a-custom-repository-role +// +//meta:operation GET /orgs/{org}/custom-repository-roles/{role_id} +func (s *OrganizationsService) GetCustomRepoRole(ctx context.Context, org string, roleID int64) (*CustomRepoRoles, *Response, error) { + u := fmt.Sprintf("orgs/%v/custom-repository-roles/%v", org, roleID) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + resultingRole := new(CustomRepoRoles) + resp, err := s.client.Do(ctx, req, resultingRole) + if err != nil { + return nil, resp, err + } + + return resultingRole, resp, nil +} + // CreateCustomRepoRole creates a custom repository role in this organization. // In order to create custom repository roles in an organization, the authenticated user must be an organization owner. // diff --git a/github/orgs_custom_repository_roles_test.go b/github/orgs_custom_repository_roles_test.go index 8e78e0a041c..fd7895397e6 100644 --- a/github/orgs_custom_repository_roles_test.go +++ b/github/orgs_custom_repository_roles_test.go @@ -96,6 +96,84 @@ func TestOrganizationsService_ListCustomRepoRoles(t *testing.T) { }) } +func TestOrganizationsService_GetCustomRepoRole(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/orgs/o/custom-repository-roles/1", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "id": 1, + "name": "Developer", + "base_role": "write", + "permissions": ["delete_alerts_code_scanning"], + "organization": { + "login": "l", + "id": 1, + "node_id": "n", + "avatar_url": "a", + "html_url": "h", + "name": "n", + "company": "c", + "blog": "b", + "location": "l", + "email": "e" + }, + "created_at": "2024-07-21T19:33:08Z", + "updated_at": "2024-07-21T19:33:08Z" + }`) + }) + + ctx := context.Background() + role, _, err := client.Organizations.GetCustomRepoRole(ctx, "o", 1) + if err != nil { + t.Errorf("Organizations.GetCustomRepoRole returned error: %v", err) + } + + want := &CustomRepoRoles{ + ID: Int64(1), + Name: String("Developer"), + BaseRole: String("write"), + Permissions: []string{"delete_alerts_code_scanning"}, + Org: &Organization{ + Login: String("l"), + ID: Int64(1), + NodeID: String("n"), + AvatarURL: String("a"), + HTMLURL: String("h"), + Name: String("n"), + Company: String("c"), + Blog: String("b"), + Location: String("l"), + Email: String("e"), + }, + CreatedAt: &Timestamp{time.Date(2024, time.July, 21, 19, 33, 8, 0, time.UTC)}, + UpdatedAt: &Timestamp{time.Date(2024, time.July, 21, 19, 33, 8, 0, time.UTC)}, + } + if !cmp.Equal(role, want) { + t.Errorf("Organizations.GetCustomRepoRole returned %+v, want %+v", role, want) + } + + const methodName = "GetCustomRepoRole" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.GetCustomRepoRole(ctx, "\no", 1) + return err + }) + + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.GetCustomRepoRole(ctx, "o", -1) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.GetCustomRepoRole(ctx, "o", 1) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + func TestOrganizationsService_CreateCustomRepoRole(t *testing.T) { t.Parallel() client, mux, _ := setup(t) From 550ecbe014c982f03e7d4d21bfbf1d26a509dee7 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Wed, 11 Dec 2024 08:44:55 -0500 Subject: [PATCH 589/751] feat!: Remove Project (classic) support (#3380) BREAKING CHANGE: All support for "Project (classic)" is removed and `Project` responses are replaced by `ProjectV2` (renamed from `ProjectsV2`). Fixes: #3367. --- github/event_types.go | 69 +- github/event_types_test.go | 877 +----------------- github/github-accessors.go | 960 +++++-------------- github/github-accessors_test.go | 1229 ++++++------------------- github/github-stringify_test.go | 25 - github/github.go | 2 - github/issues_events.go | 1 - github/issues_events_test.go | 3 +- github/issues_timeline.go | 3 +- github/issues_timeline_test.go | 3 +- github/messages.go | 3 - github/messages_test.go | 12 - github/orgs_projects.go | 64 -- github/orgs_projects_test.go | 99 -- github/projects.go | 634 ------------- github/projects_test.go | 1120 ---------------------- github/repos_hooks_deliveries_test.go | 3 - github/repos_projects.go | 73 -- github/repos_projects_test.go | 99 -- github/teams.go | 16 +- github/teams_test.go | 8 +- github/users_projects.go | 72 -- github/users_projects_test.go | 111 --- 23 files changed, 533 insertions(+), 4953 deletions(-) delete mode 100644 github/orgs_projects.go delete mode 100644 github/orgs_projects_test.go delete mode 100644 github/projects.go delete mode 100644 github/projects_test.go delete mode 100644 github/repos_projects.go delete mode 100644 github/repos_projects_test.go delete mode 100644 github/users_projects.go delete mode 100644 github/users_projects_test.go diff --git a/github/event_types.go b/github/event_types.go index 5321a91f80b..37e62c2fab9 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -1083,63 +1083,13 @@ type PingEvent struct { Installation *Installation `json:"installation,omitempty"` } -// ProjectEvent is triggered when project is created, modified or deleted. -// The webhook event name is "project". -// -// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#project -type ProjectEvent struct { - Action *string `json:"action,omitempty"` - Changes *ProjectChange `json:"changes,omitempty"` - Project *Project `json:"project,omitempty"` - - // The following fields are only populated by Webhook events. - Repo *Repository `json:"repository,omitempty"` - Org *Organization `json:"organization,omitempty"` - Sender *User `json:"sender,omitempty"` - Installation *Installation `json:"installation,omitempty"` -} - -// ProjectCardEvent is triggered when a project card is created, updated, moved, converted to an issue, or deleted. -// The webhook event name is "project_card". -// -// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#project_card -type ProjectCardEvent struct { - Action *string `json:"action,omitempty"` - Changes *ProjectCardChange `json:"changes,omitempty"` - AfterID *int64 `json:"after_id,omitempty"` - ProjectCard *ProjectCard `json:"project_card,omitempty"` - - // The following fields are only populated by Webhook events. - Repo *Repository `json:"repository,omitempty"` - Org *Organization `json:"organization,omitempty"` - Sender *User `json:"sender,omitempty"` - Installation *Installation `json:"installation,omitempty"` -} - -// ProjectColumnEvent is triggered when a project column is created, updated, moved, or deleted. -// The webhook event name is "project_column". -// -// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#project_column -type ProjectColumnEvent struct { - Action *string `json:"action,omitempty"` - Changes *ProjectColumnChange `json:"changes,omitempty"` - AfterID *int64 `json:"after_id,omitempty"` - ProjectColumn *ProjectColumn `json:"project_column,omitempty"` - - // The following fields are only populated by Webhook events. - Repo *Repository `json:"repository,omitempty"` - Org *Organization `json:"organization,omitempty"` - Sender *User `json:"sender,omitempty"` - Installation *Installation `json:"installation,omitempty"` -} - // ProjectV2Event is triggered when there is activity relating to an organization-level project. // The Webhook event name is "projects_v2". // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#projects_v2 type ProjectV2Event struct { - Action *string `json:"action,omitempty"` - ProjectsV2 *ProjectsV2 `json:"projects_v2,omitempty"` + Action *string `json:"action,omitempty"` + ProjectsV2 *ProjectV2 `json:"projects_v2,omitempty"` // The following fields are only populated by Webhook events. Installation *Installation `json:"installation,omitempty"` @@ -1147,8 +1097,8 @@ type ProjectV2Event struct { Sender *User `json:"sender,omitempty"` } -// ProjectsV2 represents a projects v2 project. -type ProjectsV2 struct { +// ProjectV2 represents a v2 project. +type ProjectV2 struct { ID *int64 `json:"id,omitempty"` NodeID *string `json:"node_id,omitempty"` Owner *User `json:"owner,omitempty"` @@ -1163,6 +1113,17 @@ type ProjectsV2 struct { Number *int `json:"number,omitempty"` ShortDescription *string `json:"short_description,omitempty"` DeletedBy *User `json:"deleted_by,omitempty"` + + // Fields migrated from the Project (classic) struct: + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + ColumnsURL *string `json:"columns_url,omitempty"` + OwnerURL *string `json:"owner_url,omitempty"` + Name *string `json:"name,omitempty"` + Body *string `json:"body,omitempty"` + State *string `json:"state,omitempty"` + OrganizationPermission *string `json:"organization_permission,omitempty"` + Private *bool `json:"private,omitempty"` } // ProjectV2ItemEvent is triggered when there is activity relating to an item on an organization-level project. diff --git a/github/event_types_test.go b/github/event_types_test.go index fcf852336c6..66d4e4989a7 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -16898,888 +16898,13 @@ func TestPushEventRepoOwner_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } -func TestProjectEvent_Marshal(t *testing.T) { - t.Parallel() - testJSONMarshal(t, &ProjectEvent{}, "{}") - - u := &ProjectEvent{ - Project: &Project{ID: Ptr(int64(1))}, - Action: Ptr("a"), - Changes: &ProjectChange{ - Name: &ProjectName{From: Ptr("NameFrom")}, - Body: &ProjectBody{From: Ptr("BodyFrom")}, - }, - Repo: &Repository{ - ID: Ptr(int64(1)), - URL: Ptr("s"), - Name: Ptr("n"), - }, - Org: &Organization{ - BillingEmail: Ptr("be"), - Blog: Ptr("b"), - Company: Ptr("c"), - Email: Ptr("e"), - TwitterUsername: Ptr("tu"), - Location: Ptr("loc"), - Name: Ptr("n"), - Description: Ptr("d"), - IsVerified: Ptr(true), - HasOrganizationProjects: Ptr(true), - HasRepositoryProjects: Ptr(true), - DefaultRepoPermission: Ptr("drp"), - MembersCanCreateRepos: Ptr(true), - MembersCanCreateInternalRepos: Ptr(true), - MembersCanCreatePrivateRepos: Ptr(true), - MembersCanCreatePublicRepos: Ptr(false), - MembersAllowedRepositoryCreationType: Ptr("marct"), - MembersCanCreatePages: Ptr(true), - MembersCanCreatePublicPages: Ptr(false), - MembersCanCreatePrivatePages: Ptr(true), - }, - Sender: &User{ - Login: Ptr("l"), - ID: Ptr(int64(1)), - NodeID: Ptr("n"), - URL: Ptr("u"), - ReposURL: Ptr("r"), - EventsURL: Ptr("e"), - AvatarURL: Ptr("a"), - }, - Installation: &Installation{ - ID: Ptr(int64(1)), - NodeID: Ptr("nid"), - AppID: Ptr(int64(1)), - AppSlug: Ptr("as"), - TargetID: Ptr(int64(1)), - Account: &User{ - Login: Ptr("l"), - ID: Ptr(int64(1)), - URL: Ptr("u"), - AvatarURL: Ptr("a"), - GravatarID: Ptr("g"), - Name: Ptr("n"), - Company: Ptr("c"), - Blog: Ptr("b"), - Location: Ptr("l"), - Email: Ptr("e"), - Hireable: Ptr(true), - Bio: Ptr("b"), - TwitterUsername: Ptr("t"), - PublicRepos: Ptr(1), - Followers: Ptr(1), - Following: Ptr(1), - CreatedAt: &Timestamp{referenceTime}, - SuspendedAt: &Timestamp{referenceTime}, - }, - AccessTokensURL: Ptr("atu"), - RepositoriesURL: Ptr("ru"), - HTMLURL: Ptr("hu"), - TargetType: Ptr("tt"), - SingleFileName: Ptr("sfn"), - RepositorySelection: Ptr("rs"), - Events: []string{"e"}, - SingleFilePaths: []string{"s"}, - Permissions: &InstallationPermissions{ - Actions: Ptr("a"), - Administration: Ptr("ad"), - Checks: Ptr("c"), - Contents: Ptr("co"), - ContentReferences: Ptr("cr"), - Deployments: Ptr("d"), - Environments: Ptr("e"), - Issues: Ptr("i"), - Metadata: Ptr("md"), - Members: Ptr("m"), - OrganizationAdministration: Ptr("oa"), - OrganizationHooks: Ptr("oh"), - OrganizationPlan: Ptr("op"), - OrganizationPreReceiveHooks: Ptr("opr"), - OrganizationProjects: Ptr("op"), - OrganizationSecrets: Ptr("os"), - OrganizationSelfHostedRunners: Ptr("osh"), - OrganizationUserBlocking: Ptr("oub"), - Packages: Ptr("pkg"), - Pages: Ptr("pg"), - PullRequests: Ptr("pr"), - RepositoryHooks: Ptr("rh"), - RepositoryProjects: Ptr("rp"), - RepositoryPreReceiveHooks: Ptr("rprh"), - Secrets: Ptr("s"), - SecretScanningAlerts: Ptr("ssa"), - SecurityEvents: Ptr("se"), - SingleFile: Ptr("sf"), - Statuses: Ptr("s"), - TeamDiscussions: Ptr("td"), - VulnerabilityAlerts: Ptr("va"), - Workflows: Ptr("w"), - }, - CreatedAt: &Timestamp{referenceTime}, - UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Ptr(false), - SuspendedBy: &User{ - Login: Ptr("l"), - ID: Ptr(int64(1)), - URL: Ptr("u"), - AvatarURL: Ptr("a"), - GravatarID: Ptr("g"), - Name: Ptr("n"), - Company: Ptr("c"), - Blog: Ptr("b"), - Location: Ptr("l"), - Email: Ptr("e"), - Hireable: Ptr(true), - Bio: Ptr("b"), - TwitterUsername: Ptr("t"), - PublicRepos: Ptr(1), - Followers: Ptr(1), - Following: Ptr(1), - CreatedAt: &Timestamp{referenceTime}, - SuspendedAt: &Timestamp{referenceTime}, - }, - SuspendedAt: &Timestamp{referenceTime}, - }, - } - - want := `{ - "action": "a", - "changes": { - "name": { - "from": "NameFrom" - }, - "body": { - "from": "BodyFrom" - } - }, - "project": { - "id": 1 - }, - "repository": { - "id": 1, - "name": "n", - "url": "s" - }, - "organization": { - "name": "n", - "company": "c", - "blog": "b", - "location": "loc", - "email": "e", - "twitter_username": "tu", - "description": "d", - "billing_email": "be", - "is_verified": true, - "has_organization_projects": true, - "has_repository_projects": true, - "default_repository_permission": "drp", - "members_can_create_repositories": true, - "members_can_create_public_repositories": false, - "members_can_create_private_repositories": true, - "members_can_create_internal_repositories": true, - "members_allowed_repository_creation_type": "marct", - "members_can_create_pages": true, - "members_can_create_public_pages": false, - "members_can_create_private_pages": true - }, - "sender": { - "login": "l", - "id": 1, - "node_id": "n", - "avatar_url": "a", - "url": "u", - "events_url": "e", - "repos_url": "r" - }, - "installation": { - "id": 1, - "node_id": "nid", - "app_id": 1, - "app_slug": "as", - "target_id": 1, - "account": { - "login": "l", - "id": 1, - "avatar_url": "a", - "gravatar_id": "g", - "name": "n", - "company": "c", - "blog": "b", - "location": "l", - "email": "e", - "hireable": true, - "bio": "b", - "twitter_username": "t", - "public_repos": 1, - "followers": 1, - "following": 1, - "created_at": ` + referenceTimeStr + `, - "suspended_at": ` + referenceTimeStr + `, - "url": "u" - }, - "access_tokens_url": "atu", - "repositories_url": "ru", - "html_url": "hu", - "target_type": "tt", - "single_file_name": "sfn", - "repository_selection": "rs", - "events": [ - "e" - ], - "single_file_paths": [ - "s" - ], - "permissions": { - "actions": "a", - "administration": "ad", - "checks": "c", - "contents": "co", - "content_references": "cr", - "deployments": "d", - "environments": "e", - "issues": "i", - "metadata": "md", - "members": "m", - "organization_administration": "oa", - "organization_hooks": "oh", - "organization_plan": "op", - "organization_pre_receive_hooks": "opr", - "organization_projects": "op", - "organization_secrets": "os", - "organization_self_hosted_runners": "osh", - "organization_user_blocking": "oub", - "packages": "pkg", - "pages": "pg", - "pull_requests": "pr", - "repository_hooks": "rh", - "repository_projects": "rp", - "repository_pre_receive_hooks": "rprh", - "secrets": "s", - "secret_scanning_alerts": "ssa", - "security_events": "se", - "single_file": "sf", - "statuses": "s", - "team_discussions": "td", - "vulnerability_alerts": "va", - "workflows": "w" - }, - "created_at": ` + referenceTimeStr + `, - "updated_at": ` + referenceTimeStr + `, - "has_multiple_single_files": false, - "suspended_by": { - "login": "l", - "id": 1, - "avatar_url": "a", - "gravatar_id": "g", - "name": "n", - "company": "c", - "blog": "b", - "location": "l", - "email": "e", - "hireable": true, - "bio": "b", - "twitter_username": "t", - "public_repos": 1, - "followers": 1, - "following": 1, - "created_at": ` + referenceTimeStr + `, - "suspended_at": ` + referenceTimeStr + `, - "url": "u" - }, - "suspended_at": ` + referenceTimeStr + ` - } - }` - - testJSONMarshal(t, u, want) -} - -func TestProjectCardEvent_Marshal(t *testing.T) { - t.Parallel() - testJSONMarshal(t, &ProjectCardEvent{}, "{}") - - u := &ProjectCardEvent{ - Action: Ptr("a"), - Changes: &ProjectCardChange{ - Note: &ProjectCardNote{From: Ptr("NoteFrom")}, - }, - AfterID: Ptr(int64(1)), - ProjectCard: &ProjectCard{ID: Ptr(int64(1))}, - Repo: &Repository{ - ID: Ptr(int64(1)), - URL: Ptr("s"), - Name: Ptr("n"), - }, - Org: &Organization{ - BillingEmail: Ptr("be"), - Blog: Ptr("b"), - Company: Ptr("c"), - Email: Ptr("e"), - TwitterUsername: Ptr("tu"), - Location: Ptr("loc"), - Name: Ptr("n"), - Description: Ptr("d"), - IsVerified: Ptr(true), - HasOrganizationProjects: Ptr(true), - HasRepositoryProjects: Ptr(true), - DefaultRepoPermission: Ptr("drp"), - MembersCanCreateRepos: Ptr(true), - MembersCanCreateInternalRepos: Ptr(true), - MembersCanCreatePrivateRepos: Ptr(true), - MembersCanCreatePublicRepos: Ptr(false), - MembersAllowedRepositoryCreationType: Ptr("marct"), - MembersCanCreatePages: Ptr(true), - MembersCanCreatePublicPages: Ptr(false), - MembersCanCreatePrivatePages: Ptr(true), - }, - Sender: &User{ - Login: Ptr("l"), - ID: Ptr(int64(1)), - NodeID: Ptr("n"), - URL: Ptr("u"), - ReposURL: Ptr("r"), - EventsURL: Ptr("e"), - AvatarURL: Ptr("a"), - }, - Installation: &Installation{ - ID: Ptr(int64(1)), - NodeID: Ptr("nid"), - AppID: Ptr(int64(1)), - AppSlug: Ptr("as"), - TargetID: Ptr(int64(1)), - Account: &User{ - Login: Ptr("l"), - ID: Ptr(int64(1)), - URL: Ptr("u"), - AvatarURL: Ptr("a"), - GravatarID: Ptr("g"), - Name: Ptr("n"), - Company: Ptr("c"), - Blog: Ptr("b"), - Location: Ptr("l"), - Email: Ptr("e"), - Hireable: Ptr(true), - Bio: Ptr("b"), - TwitterUsername: Ptr("t"), - PublicRepos: Ptr(1), - Followers: Ptr(1), - Following: Ptr(1), - CreatedAt: &Timestamp{referenceTime}, - SuspendedAt: &Timestamp{referenceTime}, - }, - AccessTokensURL: Ptr("atu"), - RepositoriesURL: Ptr("ru"), - HTMLURL: Ptr("hu"), - TargetType: Ptr("tt"), - SingleFileName: Ptr("sfn"), - RepositorySelection: Ptr("rs"), - Events: []string{"e"}, - SingleFilePaths: []string{"s"}, - Permissions: &InstallationPermissions{ - Actions: Ptr("a"), - Administration: Ptr("ad"), - Checks: Ptr("c"), - Contents: Ptr("co"), - ContentReferences: Ptr("cr"), - Deployments: Ptr("d"), - Environments: Ptr("e"), - Issues: Ptr("i"), - Metadata: Ptr("md"), - Members: Ptr("m"), - OrganizationAdministration: Ptr("oa"), - OrganizationHooks: Ptr("oh"), - OrganizationPlan: Ptr("op"), - OrganizationPreReceiveHooks: Ptr("opr"), - OrganizationProjects: Ptr("op"), - OrganizationSecrets: Ptr("os"), - OrganizationSelfHostedRunners: Ptr("osh"), - OrganizationUserBlocking: Ptr("oub"), - Packages: Ptr("pkg"), - Pages: Ptr("pg"), - PullRequests: Ptr("pr"), - RepositoryHooks: Ptr("rh"), - RepositoryProjects: Ptr("rp"), - RepositoryPreReceiveHooks: Ptr("rprh"), - Secrets: Ptr("s"), - SecretScanningAlerts: Ptr("ssa"), - SecurityEvents: Ptr("se"), - SingleFile: Ptr("sf"), - Statuses: Ptr("s"), - TeamDiscussions: Ptr("td"), - VulnerabilityAlerts: Ptr("va"), - Workflows: Ptr("w"), - }, - CreatedAt: &Timestamp{referenceTime}, - UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Ptr(false), - SuspendedBy: &User{ - Login: Ptr("l"), - ID: Ptr(int64(1)), - URL: Ptr("u"), - AvatarURL: Ptr("a"), - GravatarID: Ptr("g"), - Name: Ptr("n"), - Company: Ptr("c"), - Blog: Ptr("b"), - Location: Ptr("l"), - Email: Ptr("e"), - Hireable: Ptr(true), - Bio: Ptr("b"), - TwitterUsername: Ptr("t"), - PublicRepos: Ptr(1), - Followers: Ptr(1), - Following: Ptr(1), - CreatedAt: &Timestamp{referenceTime}, - SuspendedAt: &Timestamp{referenceTime}, - }, - SuspendedAt: &Timestamp{referenceTime}, - }, - } - - want := `{ - "action": "a", - "changes": { - "note": { - "from": "NoteFrom" - } - }, - "after_id": 1, - "project_card": { - "id": 1 - }, - "repository": { - "id": 1, - "name": "n", - "url": "s" - }, - "organization": { - "name": "n", - "company": "c", - "blog": "b", - "location": "loc", - "email": "e", - "twitter_username": "tu", - "description": "d", - "billing_email": "be", - "is_verified": true, - "has_organization_projects": true, - "has_repository_projects": true, - "default_repository_permission": "drp", - "members_can_create_repositories": true, - "members_can_create_public_repositories": false, - "members_can_create_private_repositories": true, - "members_can_create_internal_repositories": true, - "members_allowed_repository_creation_type": "marct", - "members_can_create_pages": true, - "members_can_create_public_pages": false, - "members_can_create_private_pages": true - }, - "sender": { - "login": "l", - "id": 1, - "node_id": "n", - "avatar_url": "a", - "url": "u", - "events_url": "e", - "repos_url": "r" - }, - "installation": { - "id": 1, - "node_id": "nid", - "app_id": 1, - "app_slug": "as", - "target_id": 1, - "account": { - "login": "l", - "id": 1, - "avatar_url": "a", - "gravatar_id": "g", - "name": "n", - "company": "c", - "blog": "b", - "location": "l", - "email": "e", - "hireable": true, - "bio": "b", - "twitter_username": "t", - "public_repos": 1, - "followers": 1, - "following": 1, - "created_at": ` + referenceTimeStr + `, - "suspended_at": ` + referenceTimeStr + `, - "url": "u" - }, - "access_tokens_url": "atu", - "repositories_url": "ru", - "html_url": "hu", - "target_type": "tt", - "single_file_name": "sfn", - "repository_selection": "rs", - "events": [ - "e" - ], - "single_file_paths": [ - "s" - ], - "permissions": { - "actions": "a", - "administration": "ad", - "checks": "c", - "contents": "co", - "content_references": "cr", - "deployments": "d", - "environments": "e", - "issues": "i", - "metadata": "md", - "members": "m", - "organization_administration": "oa", - "organization_hooks": "oh", - "organization_plan": "op", - "organization_pre_receive_hooks": "opr", - "organization_projects": "op", - "organization_secrets": "os", - "organization_self_hosted_runners": "osh", - "organization_user_blocking": "oub", - "packages": "pkg", - "pages": "pg", - "pull_requests": "pr", - "repository_hooks": "rh", - "repository_projects": "rp", - "repository_pre_receive_hooks": "rprh", - "secrets": "s", - "secret_scanning_alerts": "ssa", - "security_events": "se", - "single_file": "sf", - "statuses": "s", - "team_discussions": "td", - "vulnerability_alerts": "va", - "workflows": "w" - }, - "created_at": ` + referenceTimeStr + `, - "updated_at": ` + referenceTimeStr + `, - "has_multiple_single_files": false, - "suspended_by": { - "login": "l", - "id": 1, - "avatar_url": "a", - "gravatar_id": "g", - "name": "n", - "company": "c", - "blog": "b", - "location": "l", - "email": "e", - "hireable": true, - "bio": "b", - "twitter_username": "t", - "public_repos": 1, - "followers": 1, - "following": 1, - "created_at": ` + referenceTimeStr + `, - "suspended_at": ` + referenceTimeStr + `, - "url": "u" - }, - "suspended_at": ` + referenceTimeStr + ` - } - }` - - testJSONMarshal(t, u, want) -} - -func TestProjectColumnEvent_Marshal(t *testing.T) { - t.Parallel() - testJSONMarshal(t, &ProjectColumnEvent{}, "{}") - - u := &ProjectColumnEvent{ - Action: Ptr("a"), - Changes: &ProjectColumnChange{ - Name: &ProjectColumnName{From: Ptr("NameFrom")}, - }, - AfterID: Ptr(int64(1)), - ProjectColumn: &ProjectColumn{ID: Ptr(int64(1))}, - Repo: &Repository{ - ID: Ptr(int64(1)), - URL: Ptr("s"), - Name: Ptr("n"), - }, - Org: &Organization{ - BillingEmail: Ptr("be"), - Blog: Ptr("b"), - Company: Ptr("c"), - Email: Ptr("e"), - TwitterUsername: Ptr("tu"), - Location: Ptr("loc"), - Name: Ptr("n"), - Description: Ptr("d"), - IsVerified: Ptr(true), - HasOrganizationProjects: Ptr(true), - HasRepositoryProjects: Ptr(true), - DefaultRepoPermission: Ptr("drp"), - MembersCanCreateRepos: Ptr(true), - MembersCanCreateInternalRepos: Ptr(true), - MembersCanCreatePrivateRepos: Ptr(true), - MembersCanCreatePublicRepos: Ptr(false), - MembersAllowedRepositoryCreationType: Ptr("marct"), - MembersCanCreatePages: Ptr(true), - MembersCanCreatePublicPages: Ptr(false), - MembersCanCreatePrivatePages: Ptr(true), - }, - Sender: &User{ - Login: Ptr("l"), - ID: Ptr(int64(1)), - NodeID: Ptr("n"), - URL: Ptr("u"), - ReposURL: Ptr("r"), - EventsURL: Ptr("e"), - AvatarURL: Ptr("a"), - }, - Installation: &Installation{ - ID: Ptr(int64(1)), - NodeID: Ptr("nid"), - AppID: Ptr(int64(1)), - AppSlug: Ptr("as"), - TargetID: Ptr(int64(1)), - Account: &User{ - Login: Ptr("l"), - ID: Ptr(int64(1)), - URL: Ptr("u"), - AvatarURL: Ptr("a"), - GravatarID: Ptr("g"), - Name: Ptr("n"), - Company: Ptr("c"), - Blog: Ptr("b"), - Location: Ptr("l"), - Email: Ptr("e"), - Hireable: Ptr(true), - Bio: Ptr("b"), - TwitterUsername: Ptr("t"), - PublicRepos: Ptr(1), - Followers: Ptr(1), - Following: Ptr(1), - CreatedAt: &Timestamp{referenceTime}, - SuspendedAt: &Timestamp{referenceTime}, - }, - AccessTokensURL: Ptr("atu"), - RepositoriesURL: Ptr("ru"), - HTMLURL: Ptr("hu"), - TargetType: Ptr("tt"), - SingleFileName: Ptr("sfn"), - RepositorySelection: Ptr("rs"), - Events: []string{"e"}, - SingleFilePaths: []string{"s"}, - Permissions: &InstallationPermissions{ - Actions: Ptr("a"), - Administration: Ptr("ad"), - Checks: Ptr("c"), - Contents: Ptr("co"), - ContentReferences: Ptr("cr"), - Deployments: Ptr("d"), - Environments: Ptr("e"), - Issues: Ptr("i"), - Metadata: Ptr("md"), - Members: Ptr("m"), - OrganizationAdministration: Ptr("oa"), - OrganizationHooks: Ptr("oh"), - OrganizationPlan: Ptr("op"), - OrganizationPreReceiveHooks: Ptr("opr"), - OrganizationProjects: Ptr("op"), - OrganizationSecrets: Ptr("os"), - OrganizationSelfHostedRunners: Ptr("osh"), - OrganizationUserBlocking: Ptr("oub"), - Packages: Ptr("pkg"), - Pages: Ptr("pg"), - PullRequests: Ptr("pr"), - RepositoryHooks: Ptr("rh"), - RepositoryProjects: Ptr("rp"), - RepositoryPreReceiveHooks: Ptr("rprh"), - Secrets: Ptr("s"), - SecretScanningAlerts: Ptr("ssa"), - SecurityEvents: Ptr("se"), - SingleFile: Ptr("sf"), - Statuses: Ptr("s"), - TeamDiscussions: Ptr("td"), - VulnerabilityAlerts: Ptr("va"), - Workflows: Ptr("w"), - }, - CreatedAt: &Timestamp{referenceTime}, - UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Ptr(false), - SuspendedBy: &User{ - Login: Ptr("l"), - ID: Ptr(int64(1)), - URL: Ptr("u"), - AvatarURL: Ptr("a"), - GravatarID: Ptr("g"), - Name: Ptr("n"), - Company: Ptr("c"), - Blog: Ptr("b"), - Location: Ptr("l"), - Email: Ptr("e"), - Hireable: Ptr(true), - Bio: Ptr("b"), - TwitterUsername: Ptr("t"), - PublicRepos: Ptr(1), - Followers: Ptr(1), - Following: Ptr(1), - CreatedAt: &Timestamp{referenceTime}, - SuspendedAt: &Timestamp{referenceTime}, - }, - SuspendedAt: &Timestamp{referenceTime}, - }, - } - - want := `{ - "action": "a", - "changes": { - "name": { - "from": "NameFrom" - } - }, - "after_id": 1, - "project_column": { - "id": 1 - }, - "repository": { - "id": 1, - "name": "n", - "url": "s" - }, - "organization": { - "name": "n", - "company": "c", - "blog": "b", - "location": "loc", - "email": "e", - "twitter_username": "tu", - "description": "d", - "billing_email": "be", - "is_verified": true, - "has_organization_projects": true, - "has_repository_projects": true, - "default_repository_permission": "drp", - "members_can_create_repositories": true, - "members_can_create_public_repositories": false, - "members_can_create_private_repositories": true, - "members_can_create_internal_repositories": true, - "members_allowed_repository_creation_type": "marct", - "members_can_create_pages": true, - "members_can_create_public_pages": false, - "members_can_create_private_pages": true - }, - "sender": { - "login": "l", - "id": 1, - "node_id": "n", - "avatar_url": "a", - "url": "u", - "events_url": "e", - "repos_url": "r" - }, - "installation": { - "id": 1, - "node_id": "nid", - "app_id": 1, - "app_slug": "as", - "target_id": 1, - "account": { - "login": "l", - "id": 1, - "avatar_url": "a", - "gravatar_id": "g", - "name": "n", - "company": "c", - "blog": "b", - "location": "l", - "email": "e", - "hireable": true, - "bio": "b", - "twitter_username": "t", - "public_repos": 1, - "followers": 1, - "following": 1, - "created_at": ` + referenceTimeStr + `, - "suspended_at": ` + referenceTimeStr + `, - "url": "u" - }, - "access_tokens_url": "atu", - "repositories_url": "ru", - "html_url": "hu", - "target_type": "tt", - "single_file_name": "sfn", - "repository_selection": "rs", - "events": [ - "e" - ], - "single_file_paths": [ - "s" - ], - "permissions": { - "actions": "a", - "administration": "ad", - "checks": "c", - "contents": "co", - "content_references": "cr", - "deployments": "d", - "environments": "e", - "issues": "i", - "metadata": "md", - "members": "m", - "organization_administration": "oa", - "organization_hooks": "oh", - "organization_plan": "op", - "organization_pre_receive_hooks": "opr", - "organization_projects": "op", - "organization_secrets": "os", - "organization_self_hosted_runners": "osh", - "organization_user_blocking": "oub", - "packages": "pkg", - "pages": "pg", - "pull_requests": "pr", - "repository_hooks": "rh", - "repository_projects": "rp", - "repository_pre_receive_hooks": "rprh", - "secrets": "s", - "secret_scanning_alerts": "ssa", - "security_events": "se", - "single_file": "sf", - "statuses": "s", - "team_discussions": "td", - "vulnerability_alerts": "va", - "workflows": "w" - }, - "created_at": ` + referenceTimeStr + `, - "updated_at": ` + referenceTimeStr + `, - "has_multiple_single_files": false, - "suspended_by": { - "login": "l", - "id": 1, - "avatar_url": "a", - "gravatar_id": "g", - "name": "n", - "company": "c", - "blog": "b", - "location": "l", - "email": "e", - "hireable": true, - "bio": "b", - "twitter_username": "t", - "public_repos": 1, - "followers": 1, - "following": 1, - "created_at": ` + referenceTimeStr + `, - "suspended_at": ` + referenceTimeStr + `, - "url": "u" - }, - "suspended_at": ` + referenceTimeStr + ` - } - }` - - testJSONMarshal(t, u, want) -} - func TestProjectV2Event_Marshal(t *testing.T) { t.Parallel() testJSONMarshal(t, &ProjectV2Event{}, "{}") u := &ProjectV2Event{ Action: Ptr("a"), - ProjectsV2: &ProjectsV2{ + ProjectsV2: &ProjectV2{ ID: Ptr(int64(1)), NodeID: Ptr("nid"), Owner: &User{ diff --git a/github/github-accessors.go b/github/github-accessors.go index cc058414209..2d17414064f 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -4878,14 +4878,6 @@ func (c *CreateUpdateRequiredWorkflowOptions) GetWorkflowFilePath() string { return *c.WorkflowFilePath } -// GetBody returns the Body field if it's non-nil, zero value otherwise. -func (c *CreateUserProjectOptions) GetBody() string { - if c == nil || c.Body == nil { - return "" - } - return *c.Body -} - // GetEmail returns the Email field if it's non-nil, zero value otherwise. func (c *CreateUserRequest) GetEmail() string { if c == nil || c.Email == nil { @@ -10830,14 +10822,6 @@ func (i *IssueEvent) GetPerformedViaGithubApp() *App { return i.PerformedViaGithubApp } -// GetProjectCard returns the ProjectCard field. -func (i *IssueEvent) GetProjectCard() *ProjectCard { - if i == nil { - return nil - } - return i.ProjectCard -} - // GetRename returns the Rename field. func (i *IssueEvent) GetRename() *Rename { if i == nil { @@ -11806,14 +11790,6 @@ func (l *ListCodespaces) GetTotalCount() int { return *l.TotalCount } -// GetAffiliation returns the Affiliation field if it's non-nil, zero value otherwise. -func (l *ListCollaboratorOptions) GetAffiliation() string { - if l == nil || l.Affiliation == nil { - return "" - } - return *l.Affiliation -} - // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (l *ListCustomDeploymentRuleIntegrationsResponse) GetTotalCount() int { if l == nil || l.TotalCount == nil { @@ -15750,16 +15726,88 @@ func (p *PRLinks) GetStatuses() *PRLink { return p.Statuses } +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (p *ProjectBody) GetFrom() string { + if p == nil || p.From == nil { + return "" + } + return *p.From +} + +// GetNote returns the Note field. +func (p *ProjectCardChange) GetNote() *ProjectCardNote { + if p == nil { + return nil + } + return p.Note +} + +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (p *ProjectCardNote) GetFrom() string { + if p == nil || p.From == nil { + return "" + } + return *p.From +} + +// GetBody returns the Body field. +func (p *ProjectChange) GetBody() *ProjectBody { + if p == nil { + return nil + } + return p.Body +} + +// GetName returns the Name field. +func (p *ProjectChange) GetName() *ProjectName { + if p == nil { + return nil + } + return p.Name +} + +// GetName returns the Name field. +func (p *ProjectColumnChange) GetName() *ProjectColumnName { + if p == nil { + return nil + } + return p.Name +} + +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (p *ProjectColumnName) GetFrom() string { + if p == nil || p.From == nil { + return "" + } + return *p.From +} + +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (p *ProjectName) GetFrom() string { + if p == nil || p.From == nil { + return "" + } + return *p.From +} + // GetBody returns the Body field if it's non-nil, zero value otherwise. -func (p *Project) GetBody() string { +func (p *ProjectV2) GetBody() string { if p == nil || p.Body == nil { return "" } return *p.Body } +// GetClosedAt returns the ClosedAt field if it's non-nil, zero value otherwise. +func (p *ProjectV2) GetClosedAt() Timestamp { + if p == nil || p.ClosedAt == nil { + return Timestamp{} + } + return *p.ClosedAt +} + // GetColumnsURL returns the ColumnsURL field if it's non-nil, zero value otherwise. -func (p *Project) GetColumnsURL() string { +func (p *ProjectV2) GetColumnsURL() string { if p == nil || p.ColumnsURL == nil { return "" } @@ -15767,7 +15815,7 @@ func (p *Project) GetColumnsURL() string { } // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (p *Project) GetCreatedAt() Timestamp { +func (p *ProjectV2) GetCreatedAt() Timestamp { if p == nil || p.CreatedAt == nil { return Timestamp{} } @@ -15775,15 +15823,39 @@ func (p *Project) GetCreatedAt() Timestamp { } // GetCreator returns the Creator field. -func (p *Project) GetCreator() *User { +func (p *ProjectV2) GetCreator() *User { if p == nil { return nil } return p.Creator } +// GetDeletedAt returns the DeletedAt field if it's non-nil, zero value otherwise. +func (p *ProjectV2) GetDeletedAt() Timestamp { + if p == nil || p.DeletedAt == nil { + return Timestamp{} + } + return *p.DeletedAt +} + +// GetDeletedBy returns the DeletedBy field. +func (p *ProjectV2) GetDeletedBy() *User { + if p == nil { + return nil + } + return p.DeletedBy +} + +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (p *ProjectV2) GetDescription() string { + if p == nil || p.Description == nil { + return "" + } + return *p.Description +} + // GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. -func (p *Project) GetHTMLURL() string { +func (p *ProjectV2) GetHTMLURL() string { if p == nil || p.HTMLURL == nil { return "" } @@ -15791,7 +15863,7 @@ func (p *Project) GetHTMLURL() string { } // GetID returns the ID field if it's non-nil, zero value otherwise. -func (p *Project) GetID() int64 { +func (p *ProjectV2) GetID() int64 { if p == nil || p.ID == nil { return 0 } @@ -15799,7 +15871,7 @@ func (p *Project) GetID() int64 { } // GetName returns the Name field if it's non-nil, zero value otherwise. -func (p *Project) GetName() string { +func (p *ProjectV2) GetName() string { if p == nil || p.Name == nil { return "" } @@ -15807,7 +15879,7 @@ func (p *Project) GetName() string { } // GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. -func (p *Project) GetNodeID() string { +func (p *ProjectV2) GetNodeID() string { if p == nil || p.NodeID == nil { return "" } @@ -15815,7 +15887,7 @@ func (p *Project) GetNodeID() string { } // GetNumber returns the Number field if it's non-nil, zero value otherwise. -func (p *Project) GetNumber() int { +func (p *ProjectV2) GetNumber() int { if p == nil || p.Number == nil { return 0 } @@ -15823,15 +15895,23 @@ func (p *Project) GetNumber() int { } // GetOrganizationPermission returns the OrganizationPermission field if it's non-nil, zero value otherwise. -func (p *Project) GetOrganizationPermission() string { +func (p *ProjectV2) GetOrganizationPermission() string { if p == nil || p.OrganizationPermission == nil { return "" } return *p.OrganizationPermission } +// GetOwner returns the Owner field. +func (p *ProjectV2) GetOwner() *User { + if p == nil { + return nil + } + return p.Owner +} + // GetOwnerURL returns the OwnerURL field if it's non-nil, zero value otherwise. -func (p *Project) GetOwnerURL() string { +func (p *ProjectV2) GetOwnerURL() string { if p == nil || p.OwnerURL == nil { return "" } @@ -15839,23 +15919,47 @@ func (p *Project) GetOwnerURL() string { } // GetPrivate returns the Private field if it's non-nil, zero value otherwise. -func (p *Project) GetPrivate() bool { +func (p *ProjectV2) GetPrivate() bool { if p == nil || p.Private == nil { return false } return *p.Private } +// GetPublic returns the Public field if it's non-nil, zero value otherwise. +func (p *ProjectV2) GetPublic() bool { + if p == nil || p.Public == nil { + return false + } + return *p.Public +} + +// GetShortDescription returns the ShortDescription field if it's non-nil, zero value otherwise. +func (p *ProjectV2) GetShortDescription() string { + if p == nil || p.ShortDescription == nil { + return "" + } + return *p.ShortDescription +} + // GetState returns the State field if it's non-nil, zero value otherwise. -func (p *Project) GetState() string { +func (p *ProjectV2) GetState() string { if p == nil || p.State == nil { return "" } return *p.State } +// GetTitle returns the Title field if it's non-nil, zero value otherwise. +func (p *ProjectV2) GetTitle() string { + if p == nil || p.Title == nil { + return "" + } + return *p.Title +} + // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (p *Project) GetUpdatedAt() Timestamp { +func (p *ProjectV2) GetUpdatedAt() Timestamp { if p == nil || p.UpdatedAt == nil { return Timestamp{} } @@ -15863,63 +15967,79 @@ func (p *Project) GetUpdatedAt() Timestamp { } // GetURL returns the URL field if it's non-nil, zero value otherwise. -func (p *Project) GetURL() string { +func (p *ProjectV2) GetURL() string { if p == nil || p.URL == nil { return "" } return *p.URL } -// GetFrom returns the From field if it's non-nil, zero value otherwise. -func (p *ProjectBody) GetFrom() string { - if p == nil || p.From == nil { +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (p *ProjectV2Event) GetAction() string { + if p == nil || p.Action == nil { return "" } - return *p.From + return *p.Action } -// GetArchived returns the Archived field if it's non-nil, zero value otherwise. -func (p *ProjectCard) GetArchived() bool { - if p == nil || p.Archived == nil { - return false +// GetInstallation returns the Installation field. +func (p *ProjectV2Event) GetInstallation() *Installation { + if p == nil { + return nil } - return *p.Archived + return p.Installation } -// GetColumnID returns the ColumnID field if it's non-nil, zero value otherwise. -func (p *ProjectCard) GetColumnID() int64 { - if p == nil || p.ColumnID == nil { - return 0 +// GetOrg returns the Org field. +func (p *ProjectV2Event) GetOrg() *Organization { + if p == nil { + return nil } - return *p.ColumnID + return p.Org } -// GetColumnName returns the ColumnName field if it's non-nil, zero value otherwise. -func (p *ProjectCard) GetColumnName() string { - if p == nil || p.ColumnName == nil { - return "" +// GetProjectsV2 returns the ProjectsV2 field. +func (p *ProjectV2Event) GetProjectsV2() *ProjectV2 { + if p == nil { + return nil + } + return p.ProjectsV2 +} + +// GetSender returns the Sender field. +func (p *ProjectV2Event) GetSender() *User { + if p == nil { + return nil + } + return p.Sender +} + +// GetArchivedAt returns the ArchivedAt field if it's non-nil, zero value otherwise. +func (p *ProjectV2Item) GetArchivedAt() Timestamp { + if p == nil || p.ArchivedAt == nil { + return Timestamp{} } - return *p.ColumnName + return *p.ArchivedAt } -// GetColumnURL returns the ColumnURL field if it's non-nil, zero value otherwise. -func (p *ProjectCard) GetColumnURL() string { - if p == nil || p.ColumnURL == nil { +// GetContentNodeID returns the ContentNodeID field if it's non-nil, zero value otherwise. +func (p *ProjectV2Item) GetContentNodeID() string { + if p == nil || p.ContentNodeID == nil { return "" } - return *p.ColumnURL + return *p.ContentNodeID } -// GetContentURL returns the ContentURL field if it's non-nil, zero value otherwise. -func (p *ProjectCard) GetContentURL() string { - if p == nil || p.ContentURL == nil { +// GetContentType returns the ContentType field if it's non-nil, zero value otherwise. +func (p *ProjectV2Item) GetContentType() string { + if p == nil || p.ContentType == nil { return "" } - return *p.ContentURL + return *p.ContentType } // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (p *ProjectCard) GetCreatedAt() Timestamp { +func (p *ProjectV2Item) GetCreatedAt() Timestamp { if p == nil || p.CreatedAt == nil { return Timestamp{} } @@ -15927,7 +16047,7 @@ func (p *ProjectCard) GetCreatedAt() Timestamp { } // GetCreator returns the Creator field. -func (p *ProjectCard) GetCreator() *User { +func (p *ProjectV2Item) GetCreator() *User { if p == nil { return nil } @@ -15935,7 +16055,7 @@ func (p *ProjectCard) GetCreator() *User { } // GetID returns the ID field if it's non-nil, zero value otherwise. -func (p *ProjectCard) GetID() int64 { +func (p *ProjectV2Item) GetID() int64 { if p == nil || p.ID == nil { return 0 } @@ -15943,87 +16063,47 @@ func (p *ProjectCard) GetID() int64 { } // GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. -func (p *ProjectCard) GetNodeID() string { +func (p *ProjectV2Item) GetNodeID() string { if p == nil || p.NodeID == nil { return "" } return *p.NodeID } -// GetNote returns the Note field if it's non-nil, zero value otherwise. -func (p *ProjectCard) GetNote() string { - if p == nil || p.Note == nil { - return "" - } - return *p.Note -} - -// GetPreviousColumnName returns the PreviousColumnName field if it's non-nil, zero value otherwise. -func (p *ProjectCard) GetPreviousColumnName() string { - if p == nil || p.PreviousColumnName == nil { - return "" - } - return *p.PreviousColumnName -} - -// GetProjectID returns the ProjectID field if it's non-nil, zero value otherwise. -func (p *ProjectCard) GetProjectID() int64 { - if p == nil || p.ProjectID == nil { - return 0 - } - return *p.ProjectID -} - -// GetProjectURL returns the ProjectURL field if it's non-nil, zero value otherwise. -func (p *ProjectCard) GetProjectURL() string { - if p == nil || p.ProjectURL == nil { +// GetProjectNodeID returns the ProjectNodeID field if it's non-nil, zero value otherwise. +func (p *ProjectV2Item) GetProjectNodeID() string { + if p == nil || p.ProjectNodeID == nil { return "" } - return *p.ProjectURL + return *p.ProjectNodeID } // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (p *ProjectCard) GetUpdatedAt() Timestamp { +func (p *ProjectV2Item) GetUpdatedAt() Timestamp { if p == nil || p.UpdatedAt == nil { return Timestamp{} } return *p.UpdatedAt } -// GetURL returns the URL field if it's non-nil, zero value otherwise. -func (p *ProjectCard) GetURL() string { - if p == nil || p.URL == nil { - return "" - } - return *p.URL -} - -// GetNote returns the Note field. -func (p *ProjectCardChange) GetNote() *ProjectCardNote { +// GetArchivedAt returns the ArchivedAt field. +func (p *ProjectV2ItemChange) GetArchivedAt() *ArchivedAt { if p == nil { return nil } - return p.Note + return p.ArchivedAt } // GetAction returns the Action field if it's non-nil, zero value otherwise. -func (p *ProjectCardEvent) GetAction() string { +func (p *ProjectV2ItemEvent) GetAction() string { if p == nil || p.Action == nil { return "" } return *p.Action } -// GetAfterID returns the AfterID field if it's non-nil, zero value otherwise. -func (p *ProjectCardEvent) GetAfterID() int64 { - if p == nil || p.AfterID == nil { - return 0 - } - return *p.AfterID -} - // GetChanges returns the Changes field. -func (p *ProjectCardEvent) GetChanges() *ProjectCardChange { +func (p *ProjectV2ItemEvent) GetChanges() *ProjectV2ItemChange { if p == nil { return nil } @@ -16031,7 +16111,7 @@ func (p *ProjectCardEvent) GetChanges() *ProjectCardChange { } // GetInstallation returns the Installation field. -func (p *ProjectCardEvent) GetInstallation() *Installation { +func (p *ProjectV2ItemEvent) GetInstallation() *Installation { if p == nil { return nil } @@ -16039,643 +16119,43 @@ func (p *ProjectCardEvent) GetInstallation() *Installation { } // GetOrg returns the Org field. -func (p *ProjectCardEvent) GetOrg() *Organization { +func (p *ProjectV2ItemEvent) GetOrg() *Organization { if p == nil { return nil } return p.Org } -// GetProjectCard returns the ProjectCard field. -func (p *ProjectCardEvent) GetProjectCard() *ProjectCard { +// GetProjectV2Item returns the ProjectV2Item field. +func (p *ProjectV2ItemEvent) GetProjectV2Item() *ProjectV2Item { if p == nil { return nil } - return p.ProjectCard + return p.ProjectV2Item } -// GetRepo returns the Repo field. -func (p *ProjectCardEvent) GetRepo() *Repository { +// GetSender returns the Sender field. +func (p *ProjectV2ItemEvent) GetSender() *User { if p == nil { return nil } - return p.Repo + return p.Sender } -// GetSender returns the Sender field. -func (p *ProjectCardEvent) GetSender() *User { +// GetAllowDeletions returns the AllowDeletions field. +func (p *Protection) GetAllowDeletions() *AllowDeletions { if p == nil { return nil } - return p.Sender + return p.AllowDeletions } -// GetArchivedState returns the ArchivedState field if it's non-nil, zero value otherwise. -func (p *ProjectCardListOptions) GetArchivedState() string { - if p == nil || p.ArchivedState == nil { - return "" +// GetAllowForcePushes returns the AllowForcePushes field. +func (p *Protection) GetAllowForcePushes() *AllowForcePushes { + if p == nil { + return nil } - return *p.ArchivedState -} - -// GetFrom returns the From field if it's non-nil, zero value otherwise. -func (p *ProjectCardNote) GetFrom() string { - if p == nil || p.From == nil { - return "" - } - return *p.From -} - -// GetArchived returns the Archived field if it's non-nil, zero value otherwise. -func (p *ProjectCardOptions) GetArchived() bool { - if p == nil || p.Archived == nil { - return false - } - return *p.Archived -} - -// GetBody returns the Body field. -func (p *ProjectChange) GetBody() *ProjectBody { - if p == nil { - return nil - } - return p.Body -} - -// GetName returns the Name field. -func (p *ProjectChange) GetName() *ProjectName { - if p == nil { - return nil - } - return p.Name -} - -// GetPermission returns the Permission field if it's non-nil, zero value otherwise. -func (p *ProjectCollaboratorOptions) GetPermission() string { - if p == nil || p.Permission == nil { - return "" - } - return *p.Permission -} - -// GetCardsURL returns the CardsURL field if it's non-nil, zero value otherwise. -func (p *ProjectColumn) GetCardsURL() string { - if p == nil || p.CardsURL == nil { - return "" - } - return *p.CardsURL -} - -// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (p *ProjectColumn) GetCreatedAt() Timestamp { - if p == nil || p.CreatedAt == nil { - return Timestamp{} - } - return *p.CreatedAt -} - -// GetID returns the ID field if it's non-nil, zero value otherwise. -func (p *ProjectColumn) GetID() int64 { - if p == nil || p.ID == nil { - return 0 - } - return *p.ID -} - -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (p *ProjectColumn) GetName() string { - if p == nil || p.Name == nil { - return "" - } - return *p.Name -} - -// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. -func (p *ProjectColumn) GetNodeID() string { - if p == nil || p.NodeID == nil { - return "" - } - return *p.NodeID -} - -// GetProjectURL returns the ProjectURL field if it's non-nil, zero value otherwise. -func (p *ProjectColumn) GetProjectURL() string { - if p == nil || p.ProjectURL == nil { - return "" - } - return *p.ProjectURL -} - -// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (p *ProjectColumn) GetUpdatedAt() Timestamp { - if p == nil || p.UpdatedAt == nil { - return Timestamp{} - } - return *p.UpdatedAt -} - -// GetURL returns the URL field if it's non-nil, zero value otherwise. -func (p *ProjectColumn) GetURL() string { - if p == nil || p.URL == nil { - return "" - } - return *p.URL -} - -// GetName returns the Name field. -func (p *ProjectColumnChange) GetName() *ProjectColumnName { - if p == nil { - return nil - } - return p.Name -} - -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (p *ProjectColumnEvent) GetAction() string { - if p == nil || p.Action == nil { - return "" - } - return *p.Action -} - -// GetAfterID returns the AfterID field if it's non-nil, zero value otherwise. -func (p *ProjectColumnEvent) GetAfterID() int64 { - if p == nil || p.AfterID == nil { - return 0 - } - return *p.AfterID -} - -// GetChanges returns the Changes field. -func (p *ProjectColumnEvent) GetChanges() *ProjectColumnChange { - if p == nil { - return nil - } - return p.Changes -} - -// GetInstallation returns the Installation field. -func (p *ProjectColumnEvent) GetInstallation() *Installation { - if p == nil { - return nil - } - return p.Installation -} - -// GetOrg returns the Org field. -func (p *ProjectColumnEvent) GetOrg() *Organization { - if p == nil { - return nil - } - return p.Org -} - -// GetProjectColumn returns the ProjectColumn field. -func (p *ProjectColumnEvent) GetProjectColumn() *ProjectColumn { - if p == nil { - return nil - } - return p.ProjectColumn -} - -// GetRepo returns the Repo field. -func (p *ProjectColumnEvent) GetRepo() *Repository { - if p == nil { - return nil - } - return p.Repo -} - -// GetSender returns the Sender field. -func (p *ProjectColumnEvent) GetSender() *User { - if p == nil { - return nil - } - return p.Sender -} - -// GetFrom returns the From field if it's non-nil, zero value otherwise. -func (p *ProjectColumnName) GetFrom() string { - if p == nil || p.From == nil { - return "" - } - return *p.From -} - -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (p *ProjectEvent) GetAction() string { - if p == nil || p.Action == nil { - return "" - } - return *p.Action -} - -// GetChanges returns the Changes field. -func (p *ProjectEvent) GetChanges() *ProjectChange { - if p == nil { - return nil - } - return p.Changes -} - -// GetInstallation returns the Installation field. -func (p *ProjectEvent) GetInstallation() *Installation { - if p == nil { - return nil - } - return p.Installation -} - -// GetOrg returns the Org field. -func (p *ProjectEvent) GetOrg() *Organization { - if p == nil { - return nil - } - return p.Org -} - -// GetProject returns the Project field. -func (p *ProjectEvent) GetProject() *Project { - if p == nil { - return nil - } - return p.Project -} - -// GetRepo returns the Repo field. -func (p *ProjectEvent) GetRepo() *Repository { - if p == nil { - return nil - } - return p.Repo -} - -// GetSender returns the Sender field. -func (p *ProjectEvent) GetSender() *User { - if p == nil { - return nil - } - return p.Sender -} - -// GetFrom returns the From field if it's non-nil, zero value otherwise. -func (p *ProjectName) GetFrom() string { - if p == nil || p.From == nil { - return "" - } - return *p.From -} - -// GetBody returns the Body field if it's non-nil, zero value otherwise. -func (p *ProjectOptions) GetBody() string { - if p == nil || p.Body == nil { - return "" - } - return *p.Body -} - -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (p *ProjectOptions) GetName() string { - if p == nil || p.Name == nil { - return "" - } - return *p.Name -} - -// GetOrganizationPermission returns the OrganizationPermission field if it's non-nil, zero value otherwise. -func (p *ProjectOptions) GetOrganizationPermission() string { - if p == nil || p.OrganizationPermission == nil { - return "" - } - return *p.OrganizationPermission -} - -// GetPrivate returns the Private field if it's non-nil, zero value otherwise. -func (p *ProjectOptions) GetPrivate() bool { - if p == nil || p.Private == nil { - return false - } - return *p.Private -} - -// GetState returns the State field if it's non-nil, zero value otherwise. -func (p *ProjectOptions) GetState() string { - if p == nil || p.State == nil { - return "" - } - return *p.State -} - -// GetPermission returns the Permission field if it's non-nil, zero value otherwise. -func (p *ProjectPermissionLevel) GetPermission() string { - if p == nil || p.Permission == nil { - return "" - } - return *p.Permission -} - -// GetUser returns the User field. -func (p *ProjectPermissionLevel) GetUser() *User { - if p == nil { - return nil - } - return p.User -} - -// GetClosedAt returns the ClosedAt field if it's non-nil, zero value otherwise. -func (p *ProjectsV2) GetClosedAt() Timestamp { - if p == nil || p.ClosedAt == nil { - return Timestamp{} - } - return *p.ClosedAt -} - -// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (p *ProjectsV2) GetCreatedAt() Timestamp { - if p == nil || p.CreatedAt == nil { - return Timestamp{} - } - return *p.CreatedAt -} - -// GetCreator returns the Creator field. -func (p *ProjectsV2) GetCreator() *User { - if p == nil { - return nil - } - return p.Creator -} - -// GetDeletedAt returns the DeletedAt field if it's non-nil, zero value otherwise. -func (p *ProjectsV2) GetDeletedAt() Timestamp { - if p == nil || p.DeletedAt == nil { - return Timestamp{} - } - return *p.DeletedAt -} - -// GetDeletedBy returns the DeletedBy field. -func (p *ProjectsV2) GetDeletedBy() *User { - if p == nil { - return nil - } - return p.DeletedBy -} - -// GetDescription returns the Description field if it's non-nil, zero value otherwise. -func (p *ProjectsV2) GetDescription() string { - if p == nil || p.Description == nil { - return "" - } - return *p.Description -} - -// GetID returns the ID field if it's non-nil, zero value otherwise. -func (p *ProjectsV2) GetID() int64 { - if p == nil || p.ID == nil { - return 0 - } - return *p.ID -} - -// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. -func (p *ProjectsV2) GetNodeID() string { - if p == nil || p.NodeID == nil { - return "" - } - return *p.NodeID -} - -// GetNumber returns the Number field if it's non-nil, zero value otherwise. -func (p *ProjectsV2) GetNumber() int { - if p == nil || p.Number == nil { - return 0 - } - return *p.Number -} - -// GetOwner returns the Owner field. -func (p *ProjectsV2) GetOwner() *User { - if p == nil { - return nil - } - return p.Owner -} - -// GetPublic returns the Public field if it's non-nil, zero value otherwise. -func (p *ProjectsV2) GetPublic() bool { - if p == nil || p.Public == nil { - return false - } - return *p.Public -} - -// GetShortDescription returns the ShortDescription field if it's non-nil, zero value otherwise. -func (p *ProjectsV2) GetShortDescription() string { - if p == nil || p.ShortDescription == nil { - return "" - } - return *p.ShortDescription -} - -// GetTitle returns the Title field if it's non-nil, zero value otherwise. -func (p *ProjectsV2) GetTitle() string { - if p == nil || p.Title == nil { - return "" - } - return *p.Title -} - -// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (p *ProjectsV2) GetUpdatedAt() Timestamp { - if p == nil || p.UpdatedAt == nil { - return Timestamp{} - } - return *p.UpdatedAt -} - -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (p *ProjectV2Event) GetAction() string { - if p == nil || p.Action == nil { - return "" - } - return *p.Action -} - -// GetInstallation returns the Installation field. -func (p *ProjectV2Event) GetInstallation() *Installation { - if p == nil { - return nil - } - return p.Installation -} - -// GetOrg returns the Org field. -func (p *ProjectV2Event) GetOrg() *Organization { - if p == nil { - return nil - } - return p.Org -} - -// GetProjectsV2 returns the ProjectsV2 field. -func (p *ProjectV2Event) GetProjectsV2() *ProjectsV2 { - if p == nil { - return nil - } - return p.ProjectsV2 -} - -// GetSender returns the Sender field. -func (p *ProjectV2Event) GetSender() *User { - if p == nil { - return nil - } - return p.Sender -} - -// GetArchivedAt returns the ArchivedAt field if it's non-nil, zero value otherwise. -func (p *ProjectV2Item) GetArchivedAt() Timestamp { - if p == nil || p.ArchivedAt == nil { - return Timestamp{} - } - return *p.ArchivedAt -} - -// GetContentNodeID returns the ContentNodeID field if it's non-nil, zero value otherwise. -func (p *ProjectV2Item) GetContentNodeID() string { - if p == nil || p.ContentNodeID == nil { - return "" - } - return *p.ContentNodeID -} - -// GetContentType returns the ContentType field if it's non-nil, zero value otherwise. -func (p *ProjectV2Item) GetContentType() string { - if p == nil || p.ContentType == nil { - return "" - } - return *p.ContentType -} - -// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (p *ProjectV2Item) GetCreatedAt() Timestamp { - if p == nil || p.CreatedAt == nil { - return Timestamp{} - } - return *p.CreatedAt -} - -// GetCreator returns the Creator field. -func (p *ProjectV2Item) GetCreator() *User { - if p == nil { - return nil - } - return p.Creator -} - -// GetID returns the ID field if it's non-nil, zero value otherwise. -func (p *ProjectV2Item) GetID() int64 { - if p == nil || p.ID == nil { - return 0 - } - return *p.ID -} - -// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. -func (p *ProjectV2Item) GetNodeID() string { - if p == nil || p.NodeID == nil { - return "" - } - return *p.NodeID -} - -// GetProjectNodeID returns the ProjectNodeID field if it's non-nil, zero value otherwise. -func (p *ProjectV2Item) GetProjectNodeID() string { - if p == nil || p.ProjectNodeID == nil { - return "" - } - return *p.ProjectNodeID -} - -// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (p *ProjectV2Item) GetUpdatedAt() Timestamp { - if p == nil || p.UpdatedAt == nil { - return Timestamp{} - } - return *p.UpdatedAt -} - -// GetArchivedAt returns the ArchivedAt field. -func (p *ProjectV2ItemChange) GetArchivedAt() *ArchivedAt { - if p == nil { - return nil - } - return p.ArchivedAt -} - -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (p *ProjectV2ItemEvent) GetAction() string { - if p == nil || p.Action == nil { - return "" - } - return *p.Action -} - -// GetChanges returns the Changes field. -func (p *ProjectV2ItemEvent) GetChanges() *ProjectV2ItemChange { - if p == nil { - return nil - } - return p.Changes -} - -// GetInstallation returns the Installation field. -func (p *ProjectV2ItemEvent) GetInstallation() *Installation { - if p == nil { - return nil - } - return p.Installation -} - -// GetOrg returns the Org field. -func (p *ProjectV2ItemEvent) GetOrg() *Organization { - if p == nil { - return nil - } - return p.Org -} - -// GetProjectV2Item returns the ProjectV2Item field. -func (p *ProjectV2ItemEvent) GetProjectV2Item() *ProjectV2Item { - if p == nil { - return nil - } - return p.ProjectV2Item -} - -// GetSender returns the Sender field. -func (p *ProjectV2ItemEvent) GetSender() *User { - if p == nil { - return nil - } - return p.Sender -} - -// GetAllowDeletions returns the AllowDeletions field. -func (p *Protection) GetAllowDeletions() *AllowDeletions { - if p == nil { - return nil - } - return p.AllowDeletions -} - -// GetAllowForcePushes returns the AllowForcePushes field. -func (p *Protection) GetAllowForcePushes() *AllowForcePushes { - if p == nil { - return nil - } - return p.AllowForcePushes + return p.AllowForcePushes } // GetAllowForkSyncing returns the AllowForkSyncing field. @@ -25230,14 +24710,6 @@ func (t *Timeline) GetPerformedViaGithubApp() *App { return t.PerformedViaGithubApp } -// GetProjectCard returns the ProjectCard field. -func (t *Timeline) GetProjectCard() *ProjectCard { - if t == nil { - return nil - } - return t.ProjectCard -} - // GetRename returns the Rename field. func (t *Timeline) GetRename() *Rename { if t == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 71cef92fd5f..3cf970d33f2 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -6328,17 +6328,6 @@ func TestCreateUpdateRequiredWorkflowOptions_GetWorkflowFilePath(tt *testing.T) c.GetWorkflowFilePath() } -func TestCreateUserProjectOptions_GetBody(tt *testing.T) { - tt.Parallel() - var zeroValue string - c := &CreateUserProjectOptions{Body: &zeroValue} - c.GetBody() - c = &CreateUserProjectOptions{} - c.GetBody() - c = nil - c.GetBody() -} - func TestCreateUserRequest_GetEmail(tt *testing.T) { tt.Parallel() var zeroValue string @@ -13978,14 +13967,6 @@ func TestIssueEvent_GetPerformedViaGithubApp(tt *testing.T) { i.GetPerformedViaGithubApp() } -func TestIssueEvent_GetProjectCard(tt *testing.T) { - tt.Parallel() - i := &IssueEvent{} - i.GetProjectCard() - i = nil - i.GetProjectCard() -} - func TestIssueEvent_GetRename(tt *testing.T) { tt.Parallel() i := &IssueEvent{} @@ -15251,17 +15232,6 @@ func TestListCodespaces_GetTotalCount(tt *testing.T) { l.GetTotalCount() } -func TestListCollaboratorOptions_GetAffiliation(tt *testing.T) { - tt.Parallel() - var zeroValue string - l := &ListCollaboratorOptions{Affiliation: &zeroValue} - l.GetAffiliation() - l = &ListCollaboratorOptions{} - l.GetAffiliation() - l = nil - l.GetAffiliation() -} - func TestListCustomDeploymentRuleIntegrationsResponse_GetTotalCount(tt *testing.T) { tt.Parallel() var zeroValue int @@ -20338,1104 +20308,485 @@ func TestPRLinks_GetStatuses(tt *testing.T) { p.GetStatuses() } -func TestProject_GetBody(tt *testing.T) { +func TestProjectBody_GetFrom(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &ProjectBody{From: &zeroValue} + p.GetFrom() + p = &ProjectBody{} + p.GetFrom() + p = nil + p.GetFrom() +} + +func TestProjectCardChange_GetNote(tt *testing.T) { + tt.Parallel() + p := &ProjectCardChange{} + p.GetNote() + p = nil + p.GetNote() +} + +func TestProjectCardNote_GetFrom(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &ProjectCardNote{From: &zeroValue} + p.GetFrom() + p = &ProjectCardNote{} + p.GetFrom() + p = nil + p.GetFrom() +} + +func TestProjectChange_GetBody(tt *testing.T) { + tt.Parallel() + p := &ProjectChange{} + p.GetBody() + p = nil + p.GetBody() +} + +func TestProjectChange_GetName(tt *testing.T) { + tt.Parallel() + p := &ProjectChange{} + p.GetName() + p = nil + p.GetName() +} + +func TestProjectColumnChange_GetName(tt *testing.T) { + tt.Parallel() + p := &ProjectColumnChange{} + p.GetName() + p = nil + p.GetName() +} + +func TestProjectColumnName_GetFrom(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &ProjectColumnName{From: &zeroValue} + p.GetFrom() + p = &ProjectColumnName{} + p.GetFrom() + p = nil + p.GetFrom() +} + +func TestProjectName_GetFrom(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &ProjectName{From: &zeroValue} + p.GetFrom() + p = &ProjectName{} + p.GetFrom() + p = nil + p.GetFrom() +} + +func TestProjectV2_GetBody(tt *testing.T) { tt.Parallel() var zeroValue string - p := &Project{Body: &zeroValue} + p := &ProjectV2{Body: &zeroValue} p.GetBody() - p = &Project{} + p = &ProjectV2{} p.GetBody() p = nil p.GetBody() } -func TestProject_GetColumnsURL(tt *testing.T) { +func TestProjectV2_GetClosedAt(tt *testing.T) { + tt.Parallel() + var zeroValue Timestamp + p := &ProjectV2{ClosedAt: &zeroValue} + p.GetClosedAt() + p = &ProjectV2{} + p.GetClosedAt() + p = nil + p.GetClosedAt() +} + +func TestProjectV2_GetColumnsURL(tt *testing.T) { tt.Parallel() var zeroValue string - p := &Project{ColumnsURL: &zeroValue} + p := &ProjectV2{ColumnsURL: &zeroValue} p.GetColumnsURL() - p = &Project{} + p = &ProjectV2{} p.GetColumnsURL() p = nil p.GetColumnsURL() } -func TestProject_GetCreatedAt(tt *testing.T) { +func TestProjectV2_GetCreatedAt(tt *testing.T) { tt.Parallel() var zeroValue Timestamp - p := &Project{CreatedAt: &zeroValue} + p := &ProjectV2{CreatedAt: &zeroValue} p.GetCreatedAt() - p = &Project{} + p = &ProjectV2{} p.GetCreatedAt() p = nil p.GetCreatedAt() } -func TestProject_GetCreator(tt *testing.T) { +func TestProjectV2_GetCreator(tt *testing.T) { tt.Parallel() - p := &Project{} + p := &ProjectV2{} p.GetCreator() p = nil p.GetCreator() } -func TestProject_GetHTMLURL(tt *testing.T) { +func TestProjectV2_GetDeletedAt(tt *testing.T) { + tt.Parallel() + var zeroValue Timestamp + p := &ProjectV2{DeletedAt: &zeroValue} + p.GetDeletedAt() + p = &ProjectV2{} + p.GetDeletedAt() + p = nil + p.GetDeletedAt() +} + +func TestProjectV2_GetDeletedBy(tt *testing.T) { + tt.Parallel() + p := &ProjectV2{} + p.GetDeletedBy() + p = nil + p.GetDeletedBy() +} + +func TestProjectV2_GetDescription(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &ProjectV2{Description: &zeroValue} + p.GetDescription() + p = &ProjectV2{} + p.GetDescription() + p = nil + p.GetDescription() +} + +func TestProjectV2_GetHTMLURL(tt *testing.T) { tt.Parallel() var zeroValue string - p := &Project{HTMLURL: &zeroValue} + p := &ProjectV2{HTMLURL: &zeroValue} p.GetHTMLURL() - p = &Project{} + p = &ProjectV2{} p.GetHTMLURL() p = nil p.GetHTMLURL() } -func TestProject_GetID(tt *testing.T) { +func TestProjectV2_GetID(tt *testing.T) { tt.Parallel() var zeroValue int64 - p := &Project{ID: &zeroValue} + p := &ProjectV2{ID: &zeroValue} p.GetID() - p = &Project{} + p = &ProjectV2{} p.GetID() p = nil p.GetID() } -func TestProject_GetName(tt *testing.T) { +func TestProjectV2_GetName(tt *testing.T) { tt.Parallel() var zeroValue string - p := &Project{Name: &zeroValue} + p := &ProjectV2{Name: &zeroValue} p.GetName() - p = &Project{} + p = &ProjectV2{} p.GetName() p = nil p.GetName() } -func TestProject_GetNodeID(tt *testing.T) { +func TestProjectV2_GetNodeID(tt *testing.T) { tt.Parallel() var zeroValue string - p := &Project{NodeID: &zeroValue} + p := &ProjectV2{NodeID: &zeroValue} p.GetNodeID() - p = &Project{} + p = &ProjectV2{} p.GetNodeID() p = nil p.GetNodeID() } -func TestProject_GetNumber(tt *testing.T) { +func TestProjectV2_GetNumber(tt *testing.T) { tt.Parallel() var zeroValue int - p := &Project{Number: &zeroValue} + p := &ProjectV2{Number: &zeroValue} p.GetNumber() - p = &Project{} + p = &ProjectV2{} p.GetNumber() p = nil p.GetNumber() } -func TestProject_GetOrganizationPermission(tt *testing.T) { +func TestProjectV2_GetOrganizationPermission(tt *testing.T) { tt.Parallel() var zeroValue string - p := &Project{OrganizationPermission: &zeroValue} + p := &ProjectV2{OrganizationPermission: &zeroValue} p.GetOrganizationPermission() - p = &Project{} + p = &ProjectV2{} p.GetOrganizationPermission() p = nil p.GetOrganizationPermission() } -func TestProject_GetOwnerURL(tt *testing.T) { +func TestProjectV2_GetOwner(tt *testing.T) { + tt.Parallel() + p := &ProjectV2{} + p.GetOwner() + p = nil + p.GetOwner() +} + +func TestProjectV2_GetOwnerURL(tt *testing.T) { tt.Parallel() var zeroValue string - p := &Project{OwnerURL: &zeroValue} + p := &ProjectV2{OwnerURL: &zeroValue} p.GetOwnerURL() - p = &Project{} + p = &ProjectV2{} p.GetOwnerURL() p = nil p.GetOwnerURL() } -func TestProject_GetPrivate(tt *testing.T) { +func TestProjectV2_GetPrivate(tt *testing.T) { tt.Parallel() var zeroValue bool - p := &Project{Private: &zeroValue} + p := &ProjectV2{Private: &zeroValue} p.GetPrivate() - p = &Project{} + p = &ProjectV2{} p.GetPrivate() p = nil p.GetPrivate() } -func TestProject_GetState(tt *testing.T) { +func TestProjectV2_GetPublic(tt *testing.T) { + tt.Parallel() + var zeroValue bool + p := &ProjectV2{Public: &zeroValue} + p.GetPublic() + p = &ProjectV2{} + p.GetPublic() + p = nil + p.GetPublic() +} + +func TestProjectV2_GetShortDescription(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &ProjectV2{ShortDescription: &zeroValue} + p.GetShortDescription() + p = &ProjectV2{} + p.GetShortDescription() + p = nil + p.GetShortDescription() +} + +func TestProjectV2_GetState(tt *testing.T) { tt.Parallel() var zeroValue string - p := &Project{State: &zeroValue} + p := &ProjectV2{State: &zeroValue} p.GetState() - p = &Project{} + p = &ProjectV2{} p.GetState() p = nil p.GetState() } -func TestProject_GetUpdatedAt(tt *testing.T) { +func TestProjectV2_GetTitle(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &ProjectV2{Title: &zeroValue} + p.GetTitle() + p = &ProjectV2{} + p.GetTitle() + p = nil + p.GetTitle() +} + +func TestProjectV2_GetUpdatedAt(tt *testing.T) { tt.Parallel() var zeroValue Timestamp - p := &Project{UpdatedAt: &zeroValue} + p := &ProjectV2{UpdatedAt: &zeroValue} p.GetUpdatedAt() - p = &Project{} + p = &ProjectV2{} p.GetUpdatedAt() p = nil p.GetUpdatedAt() } -func TestProject_GetURL(tt *testing.T) { +func TestProjectV2_GetURL(tt *testing.T) { tt.Parallel() var zeroValue string - p := &Project{URL: &zeroValue} + p := &ProjectV2{URL: &zeroValue} p.GetURL() - p = &Project{} + p = &ProjectV2{} p.GetURL() p = nil p.GetURL() } -func TestProjectBody_GetFrom(tt *testing.T) { +func TestProjectV2Event_GetAction(tt *testing.T) { tt.Parallel() var zeroValue string - p := &ProjectBody{From: &zeroValue} - p.GetFrom() - p = &ProjectBody{} - p.GetFrom() + p := &ProjectV2Event{Action: &zeroValue} + p.GetAction() + p = &ProjectV2Event{} + p.GetAction() p = nil - p.GetFrom() + p.GetAction() } -func TestProjectCard_GetArchived(tt *testing.T) { +func TestProjectV2Event_GetInstallation(tt *testing.T) { tt.Parallel() - var zeroValue bool - p := &ProjectCard{Archived: &zeroValue} - p.GetArchived() - p = &ProjectCard{} - p.GetArchived() + p := &ProjectV2Event{} + p.GetInstallation() p = nil - p.GetArchived() + p.GetInstallation() } -func TestProjectCard_GetColumnID(tt *testing.T) { +func TestProjectV2Event_GetOrg(tt *testing.T) { tt.Parallel() - var zeroValue int64 - p := &ProjectCard{ColumnID: &zeroValue} - p.GetColumnID() - p = &ProjectCard{} - p.GetColumnID() + p := &ProjectV2Event{} + p.GetOrg() p = nil - p.GetColumnID() + p.GetOrg() } -func TestProjectCard_GetColumnName(tt *testing.T) { +func TestProjectV2Event_GetProjectsV2(tt *testing.T) { tt.Parallel() - var zeroValue string - p := &ProjectCard{ColumnName: &zeroValue} - p.GetColumnName() - p = &ProjectCard{} - p.GetColumnName() + p := &ProjectV2Event{} + p.GetProjectsV2() + p = nil + p.GetProjectsV2() +} + +func TestProjectV2Event_GetSender(tt *testing.T) { + tt.Parallel() + p := &ProjectV2Event{} + p.GetSender() + p = nil + p.GetSender() +} + +func TestProjectV2Item_GetArchivedAt(tt *testing.T) { + tt.Parallel() + var zeroValue Timestamp + p := &ProjectV2Item{ArchivedAt: &zeroValue} + p.GetArchivedAt() + p = &ProjectV2Item{} + p.GetArchivedAt() p = nil - p.GetColumnName() + p.GetArchivedAt() } -func TestProjectCard_GetColumnURL(tt *testing.T) { +func TestProjectV2Item_GetContentNodeID(tt *testing.T) { tt.Parallel() var zeroValue string - p := &ProjectCard{ColumnURL: &zeroValue} - p.GetColumnURL() - p = &ProjectCard{} - p.GetColumnURL() + p := &ProjectV2Item{ContentNodeID: &zeroValue} + p.GetContentNodeID() + p = &ProjectV2Item{} + p.GetContentNodeID() p = nil - p.GetColumnURL() + p.GetContentNodeID() } -func TestProjectCard_GetContentURL(tt *testing.T) { +func TestProjectV2Item_GetContentType(tt *testing.T) { tt.Parallel() var zeroValue string - p := &ProjectCard{ContentURL: &zeroValue} - p.GetContentURL() - p = &ProjectCard{} - p.GetContentURL() + p := &ProjectV2Item{ContentType: &zeroValue} + p.GetContentType() + p = &ProjectV2Item{} + p.GetContentType() p = nil - p.GetContentURL() + p.GetContentType() } -func TestProjectCard_GetCreatedAt(tt *testing.T) { +func TestProjectV2Item_GetCreatedAt(tt *testing.T) { tt.Parallel() var zeroValue Timestamp - p := &ProjectCard{CreatedAt: &zeroValue} + p := &ProjectV2Item{CreatedAt: &zeroValue} p.GetCreatedAt() - p = &ProjectCard{} + p = &ProjectV2Item{} p.GetCreatedAt() p = nil p.GetCreatedAt() } -func TestProjectCard_GetCreator(tt *testing.T) { +func TestProjectV2Item_GetCreator(tt *testing.T) { tt.Parallel() - p := &ProjectCard{} + p := &ProjectV2Item{} p.GetCreator() p = nil p.GetCreator() } -func TestProjectCard_GetID(tt *testing.T) { +func TestProjectV2Item_GetID(tt *testing.T) { tt.Parallel() var zeroValue int64 - p := &ProjectCard{ID: &zeroValue} + p := &ProjectV2Item{ID: &zeroValue} p.GetID() - p = &ProjectCard{} + p = &ProjectV2Item{} p.GetID() p = nil p.GetID() } -func TestProjectCard_GetNodeID(tt *testing.T) { +func TestProjectV2Item_GetNodeID(tt *testing.T) { tt.Parallel() var zeroValue string - p := &ProjectCard{NodeID: &zeroValue} + p := &ProjectV2Item{NodeID: &zeroValue} p.GetNodeID() - p = &ProjectCard{} + p = &ProjectV2Item{} p.GetNodeID() p = nil p.GetNodeID() } -func TestProjectCard_GetNote(tt *testing.T) { +func TestProjectV2Item_GetProjectNodeID(tt *testing.T) { tt.Parallel() var zeroValue string - p := &ProjectCard{Note: &zeroValue} - p.GetNote() - p = &ProjectCard{} - p.GetNote() + p := &ProjectV2Item{ProjectNodeID: &zeroValue} + p.GetProjectNodeID() + p = &ProjectV2Item{} + p.GetProjectNodeID() p = nil - p.GetNote() + p.GetProjectNodeID() } -func TestProjectCard_GetPreviousColumnName(tt *testing.T) { +func TestProjectV2Item_GetUpdatedAt(tt *testing.T) { tt.Parallel() - var zeroValue string - p := &ProjectCard{PreviousColumnName: &zeroValue} - p.GetPreviousColumnName() - p = &ProjectCard{} - p.GetPreviousColumnName() + var zeroValue Timestamp + p := &ProjectV2Item{UpdatedAt: &zeroValue} + p.GetUpdatedAt() + p = &ProjectV2Item{} + p.GetUpdatedAt() p = nil - p.GetPreviousColumnName() + p.GetUpdatedAt() } -func TestProjectCard_GetProjectID(tt *testing.T) { +func TestProjectV2ItemChange_GetArchivedAt(tt *testing.T) { tt.Parallel() - var zeroValue int64 - p := &ProjectCard{ProjectID: &zeroValue} - p.GetProjectID() - p = &ProjectCard{} - p.GetProjectID() + p := &ProjectV2ItemChange{} + p.GetArchivedAt() p = nil - p.GetProjectID() + p.GetArchivedAt() } -func TestProjectCard_GetProjectURL(tt *testing.T) { +func TestProjectV2ItemEvent_GetAction(tt *testing.T) { tt.Parallel() var zeroValue string - p := &ProjectCard{ProjectURL: &zeroValue} - p.GetProjectURL() - p = &ProjectCard{} - p.GetProjectURL() + p := &ProjectV2ItemEvent{Action: &zeroValue} + p.GetAction() + p = &ProjectV2ItemEvent{} + p.GetAction() p = nil - p.GetProjectURL() + p.GetAction() } -func TestProjectCard_GetUpdatedAt(tt *testing.T) { - tt.Parallel() - var zeroValue Timestamp - p := &ProjectCard{UpdatedAt: &zeroValue} - p.GetUpdatedAt() - p = &ProjectCard{} - p.GetUpdatedAt() - p = nil - p.GetUpdatedAt() -} - -func TestProjectCard_GetURL(tt *testing.T) { - tt.Parallel() - var zeroValue string - p := &ProjectCard{URL: &zeroValue} - p.GetURL() - p = &ProjectCard{} - p.GetURL() - p = nil - p.GetURL() -} - -func TestProjectCardChange_GetNote(tt *testing.T) { - tt.Parallel() - p := &ProjectCardChange{} - p.GetNote() - p = nil - p.GetNote() -} - -func TestProjectCardEvent_GetAction(tt *testing.T) { - tt.Parallel() - var zeroValue string - p := &ProjectCardEvent{Action: &zeroValue} - p.GetAction() - p = &ProjectCardEvent{} - p.GetAction() - p = nil - p.GetAction() -} - -func TestProjectCardEvent_GetAfterID(tt *testing.T) { - tt.Parallel() - var zeroValue int64 - p := &ProjectCardEvent{AfterID: &zeroValue} - p.GetAfterID() - p = &ProjectCardEvent{} - p.GetAfterID() - p = nil - p.GetAfterID() -} - -func TestProjectCardEvent_GetChanges(tt *testing.T) { - tt.Parallel() - p := &ProjectCardEvent{} - p.GetChanges() - p = nil - p.GetChanges() -} - -func TestProjectCardEvent_GetInstallation(tt *testing.T) { - tt.Parallel() - p := &ProjectCardEvent{} - p.GetInstallation() - p = nil - p.GetInstallation() -} - -func TestProjectCardEvent_GetOrg(tt *testing.T) { - tt.Parallel() - p := &ProjectCardEvent{} - p.GetOrg() - p = nil - p.GetOrg() -} - -func TestProjectCardEvent_GetProjectCard(tt *testing.T) { - tt.Parallel() - p := &ProjectCardEvent{} - p.GetProjectCard() - p = nil - p.GetProjectCard() -} - -func TestProjectCardEvent_GetRepo(tt *testing.T) { - tt.Parallel() - p := &ProjectCardEvent{} - p.GetRepo() - p = nil - p.GetRepo() -} - -func TestProjectCardEvent_GetSender(tt *testing.T) { - tt.Parallel() - p := &ProjectCardEvent{} - p.GetSender() - p = nil - p.GetSender() -} - -func TestProjectCardListOptions_GetArchivedState(tt *testing.T) { - tt.Parallel() - var zeroValue string - p := &ProjectCardListOptions{ArchivedState: &zeroValue} - p.GetArchivedState() - p = &ProjectCardListOptions{} - p.GetArchivedState() - p = nil - p.GetArchivedState() -} - -func TestProjectCardNote_GetFrom(tt *testing.T) { - tt.Parallel() - var zeroValue string - p := &ProjectCardNote{From: &zeroValue} - p.GetFrom() - p = &ProjectCardNote{} - p.GetFrom() - p = nil - p.GetFrom() -} - -func TestProjectCardOptions_GetArchived(tt *testing.T) { - tt.Parallel() - var zeroValue bool - p := &ProjectCardOptions{Archived: &zeroValue} - p.GetArchived() - p = &ProjectCardOptions{} - p.GetArchived() - p = nil - p.GetArchived() -} - -func TestProjectChange_GetBody(tt *testing.T) { - tt.Parallel() - p := &ProjectChange{} - p.GetBody() - p = nil - p.GetBody() -} - -func TestProjectChange_GetName(tt *testing.T) { - tt.Parallel() - p := &ProjectChange{} - p.GetName() - p = nil - p.GetName() -} - -func TestProjectCollaboratorOptions_GetPermission(tt *testing.T) { - tt.Parallel() - var zeroValue string - p := &ProjectCollaboratorOptions{Permission: &zeroValue} - p.GetPermission() - p = &ProjectCollaboratorOptions{} - p.GetPermission() - p = nil - p.GetPermission() -} - -func TestProjectColumn_GetCardsURL(tt *testing.T) { - tt.Parallel() - var zeroValue string - p := &ProjectColumn{CardsURL: &zeroValue} - p.GetCardsURL() - p = &ProjectColumn{} - p.GetCardsURL() - p = nil - p.GetCardsURL() -} - -func TestProjectColumn_GetCreatedAt(tt *testing.T) { - tt.Parallel() - var zeroValue Timestamp - p := &ProjectColumn{CreatedAt: &zeroValue} - p.GetCreatedAt() - p = &ProjectColumn{} - p.GetCreatedAt() - p = nil - p.GetCreatedAt() -} - -func TestProjectColumn_GetID(tt *testing.T) { - tt.Parallel() - var zeroValue int64 - p := &ProjectColumn{ID: &zeroValue} - p.GetID() - p = &ProjectColumn{} - p.GetID() - p = nil - p.GetID() -} - -func TestProjectColumn_GetName(tt *testing.T) { - tt.Parallel() - var zeroValue string - p := &ProjectColumn{Name: &zeroValue} - p.GetName() - p = &ProjectColumn{} - p.GetName() - p = nil - p.GetName() -} - -func TestProjectColumn_GetNodeID(tt *testing.T) { - tt.Parallel() - var zeroValue string - p := &ProjectColumn{NodeID: &zeroValue} - p.GetNodeID() - p = &ProjectColumn{} - p.GetNodeID() - p = nil - p.GetNodeID() -} - -func TestProjectColumn_GetProjectURL(tt *testing.T) { - tt.Parallel() - var zeroValue string - p := &ProjectColumn{ProjectURL: &zeroValue} - p.GetProjectURL() - p = &ProjectColumn{} - p.GetProjectURL() - p = nil - p.GetProjectURL() -} - -func TestProjectColumn_GetUpdatedAt(tt *testing.T) { - tt.Parallel() - var zeroValue Timestamp - p := &ProjectColumn{UpdatedAt: &zeroValue} - p.GetUpdatedAt() - p = &ProjectColumn{} - p.GetUpdatedAt() - p = nil - p.GetUpdatedAt() -} - -func TestProjectColumn_GetURL(tt *testing.T) { - tt.Parallel() - var zeroValue string - p := &ProjectColumn{URL: &zeroValue} - p.GetURL() - p = &ProjectColumn{} - p.GetURL() - p = nil - p.GetURL() -} - -func TestProjectColumnChange_GetName(tt *testing.T) { - tt.Parallel() - p := &ProjectColumnChange{} - p.GetName() - p = nil - p.GetName() -} - -func TestProjectColumnEvent_GetAction(tt *testing.T) { - tt.Parallel() - var zeroValue string - p := &ProjectColumnEvent{Action: &zeroValue} - p.GetAction() - p = &ProjectColumnEvent{} - p.GetAction() - p = nil - p.GetAction() -} - -func TestProjectColumnEvent_GetAfterID(tt *testing.T) { - tt.Parallel() - var zeroValue int64 - p := &ProjectColumnEvent{AfterID: &zeroValue} - p.GetAfterID() - p = &ProjectColumnEvent{} - p.GetAfterID() - p = nil - p.GetAfterID() -} - -func TestProjectColumnEvent_GetChanges(tt *testing.T) { - tt.Parallel() - p := &ProjectColumnEvent{} - p.GetChanges() - p = nil - p.GetChanges() -} - -func TestProjectColumnEvent_GetInstallation(tt *testing.T) { - tt.Parallel() - p := &ProjectColumnEvent{} - p.GetInstallation() - p = nil - p.GetInstallation() -} - -func TestProjectColumnEvent_GetOrg(tt *testing.T) { - tt.Parallel() - p := &ProjectColumnEvent{} - p.GetOrg() - p = nil - p.GetOrg() -} - -func TestProjectColumnEvent_GetProjectColumn(tt *testing.T) { - tt.Parallel() - p := &ProjectColumnEvent{} - p.GetProjectColumn() - p = nil - p.GetProjectColumn() -} - -func TestProjectColumnEvent_GetRepo(tt *testing.T) { - tt.Parallel() - p := &ProjectColumnEvent{} - p.GetRepo() - p = nil - p.GetRepo() -} - -func TestProjectColumnEvent_GetSender(tt *testing.T) { - tt.Parallel() - p := &ProjectColumnEvent{} - p.GetSender() - p = nil - p.GetSender() -} - -func TestProjectColumnName_GetFrom(tt *testing.T) { - tt.Parallel() - var zeroValue string - p := &ProjectColumnName{From: &zeroValue} - p.GetFrom() - p = &ProjectColumnName{} - p.GetFrom() - p = nil - p.GetFrom() -} - -func TestProjectEvent_GetAction(tt *testing.T) { - tt.Parallel() - var zeroValue string - p := &ProjectEvent{Action: &zeroValue} - p.GetAction() - p = &ProjectEvent{} - p.GetAction() - p = nil - p.GetAction() -} - -func TestProjectEvent_GetChanges(tt *testing.T) { - tt.Parallel() - p := &ProjectEvent{} - p.GetChanges() - p = nil - p.GetChanges() -} - -func TestProjectEvent_GetInstallation(tt *testing.T) { - tt.Parallel() - p := &ProjectEvent{} - p.GetInstallation() - p = nil - p.GetInstallation() -} - -func TestProjectEvent_GetOrg(tt *testing.T) { - tt.Parallel() - p := &ProjectEvent{} - p.GetOrg() - p = nil - p.GetOrg() -} - -func TestProjectEvent_GetProject(tt *testing.T) { - tt.Parallel() - p := &ProjectEvent{} - p.GetProject() - p = nil - p.GetProject() -} - -func TestProjectEvent_GetRepo(tt *testing.T) { - tt.Parallel() - p := &ProjectEvent{} - p.GetRepo() - p = nil - p.GetRepo() -} - -func TestProjectEvent_GetSender(tt *testing.T) { - tt.Parallel() - p := &ProjectEvent{} - p.GetSender() - p = nil - p.GetSender() -} - -func TestProjectName_GetFrom(tt *testing.T) { - tt.Parallel() - var zeroValue string - p := &ProjectName{From: &zeroValue} - p.GetFrom() - p = &ProjectName{} - p.GetFrom() - p = nil - p.GetFrom() -} - -func TestProjectOptions_GetBody(tt *testing.T) { - tt.Parallel() - var zeroValue string - p := &ProjectOptions{Body: &zeroValue} - p.GetBody() - p = &ProjectOptions{} - p.GetBody() - p = nil - p.GetBody() -} - -func TestProjectOptions_GetName(tt *testing.T) { - tt.Parallel() - var zeroValue string - p := &ProjectOptions{Name: &zeroValue} - p.GetName() - p = &ProjectOptions{} - p.GetName() - p = nil - p.GetName() -} - -func TestProjectOptions_GetOrganizationPermission(tt *testing.T) { - tt.Parallel() - var zeroValue string - p := &ProjectOptions{OrganizationPermission: &zeroValue} - p.GetOrganizationPermission() - p = &ProjectOptions{} - p.GetOrganizationPermission() - p = nil - p.GetOrganizationPermission() -} - -func TestProjectOptions_GetPrivate(tt *testing.T) { - tt.Parallel() - var zeroValue bool - p := &ProjectOptions{Private: &zeroValue} - p.GetPrivate() - p = &ProjectOptions{} - p.GetPrivate() - p = nil - p.GetPrivate() -} - -func TestProjectOptions_GetState(tt *testing.T) { - tt.Parallel() - var zeroValue string - p := &ProjectOptions{State: &zeroValue} - p.GetState() - p = &ProjectOptions{} - p.GetState() - p = nil - p.GetState() -} - -func TestProjectPermissionLevel_GetPermission(tt *testing.T) { - tt.Parallel() - var zeroValue string - p := &ProjectPermissionLevel{Permission: &zeroValue} - p.GetPermission() - p = &ProjectPermissionLevel{} - p.GetPermission() - p = nil - p.GetPermission() -} - -func TestProjectPermissionLevel_GetUser(tt *testing.T) { - tt.Parallel() - p := &ProjectPermissionLevel{} - p.GetUser() - p = nil - p.GetUser() -} - -func TestProjectsV2_GetClosedAt(tt *testing.T) { - tt.Parallel() - var zeroValue Timestamp - p := &ProjectsV2{ClosedAt: &zeroValue} - p.GetClosedAt() - p = &ProjectsV2{} - p.GetClosedAt() - p = nil - p.GetClosedAt() -} - -func TestProjectsV2_GetCreatedAt(tt *testing.T) { - tt.Parallel() - var zeroValue Timestamp - p := &ProjectsV2{CreatedAt: &zeroValue} - p.GetCreatedAt() - p = &ProjectsV2{} - p.GetCreatedAt() - p = nil - p.GetCreatedAt() -} - -func TestProjectsV2_GetCreator(tt *testing.T) { - tt.Parallel() - p := &ProjectsV2{} - p.GetCreator() - p = nil - p.GetCreator() -} - -func TestProjectsV2_GetDeletedAt(tt *testing.T) { - tt.Parallel() - var zeroValue Timestamp - p := &ProjectsV2{DeletedAt: &zeroValue} - p.GetDeletedAt() - p = &ProjectsV2{} - p.GetDeletedAt() - p = nil - p.GetDeletedAt() -} - -func TestProjectsV2_GetDeletedBy(tt *testing.T) { - tt.Parallel() - p := &ProjectsV2{} - p.GetDeletedBy() - p = nil - p.GetDeletedBy() -} - -func TestProjectsV2_GetDescription(tt *testing.T) { - tt.Parallel() - var zeroValue string - p := &ProjectsV2{Description: &zeroValue} - p.GetDescription() - p = &ProjectsV2{} - p.GetDescription() - p = nil - p.GetDescription() -} - -func TestProjectsV2_GetID(tt *testing.T) { - tt.Parallel() - var zeroValue int64 - p := &ProjectsV2{ID: &zeroValue} - p.GetID() - p = &ProjectsV2{} - p.GetID() - p = nil - p.GetID() -} - -func TestProjectsV2_GetNodeID(tt *testing.T) { - tt.Parallel() - var zeroValue string - p := &ProjectsV2{NodeID: &zeroValue} - p.GetNodeID() - p = &ProjectsV2{} - p.GetNodeID() - p = nil - p.GetNodeID() -} - -func TestProjectsV2_GetNumber(tt *testing.T) { - tt.Parallel() - var zeroValue int - p := &ProjectsV2{Number: &zeroValue} - p.GetNumber() - p = &ProjectsV2{} - p.GetNumber() - p = nil - p.GetNumber() -} - -func TestProjectsV2_GetOwner(tt *testing.T) { - tt.Parallel() - p := &ProjectsV2{} - p.GetOwner() - p = nil - p.GetOwner() -} - -func TestProjectsV2_GetPublic(tt *testing.T) { - tt.Parallel() - var zeroValue bool - p := &ProjectsV2{Public: &zeroValue} - p.GetPublic() - p = &ProjectsV2{} - p.GetPublic() - p = nil - p.GetPublic() -} - -func TestProjectsV2_GetShortDescription(tt *testing.T) { - tt.Parallel() - var zeroValue string - p := &ProjectsV2{ShortDescription: &zeroValue} - p.GetShortDescription() - p = &ProjectsV2{} - p.GetShortDescription() - p = nil - p.GetShortDescription() -} - -func TestProjectsV2_GetTitle(tt *testing.T) { - tt.Parallel() - var zeroValue string - p := &ProjectsV2{Title: &zeroValue} - p.GetTitle() - p = &ProjectsV2{} - p.GetTitle() - p = nil - p.GetTitle() -} - -func TestProjectsV2_GetUpdatedAt(tt *testing.T) { - tt.Parallel() - var zeroValue Timestamp - p := &ProjectsV2{UpdatedAt: &zeroValue} - p.GetUpdatedAt() - p = &ProjectsV2{} - p.GetUpdatedAt() - p = nil - p.GetUpdatedAt() -} - -func TestProjectV2Event_GetAction(tt *testing.T) { - tt.Parallel() - var zeroValue string - p := &ProjectV2Event{Action: &zeroValue} - p.GetAction() - p = &ProjectV2Event{} - p.GetAction() - p = nil - p.GetAction() -} - -func TestProjectV2Event_GetInstallation(tt *testing.T) { - tt.Parallel() - p := &ProjectV2Event{} - p.GetInstallation() - p = nil - p.GetInstallation() -} - -func TestProjectV2Event_GetOrg(tt *testing.T) { - tt.Parallel() - p := &ProjectV2Event{} - p.GetOrg() - p = nil - p.GetOrg() -} - -func TestProjectV2Event_GetProjectsV2(tt *testing.T) { - tt.Parallel() - p := &ProjectV2Event{} - p.GetProjectsV2() - p = nil - p.GetProjectsV2() -} - -func TestProjectV2Event_GetSender(tt *testing.T) { - tt.Parallel() - p := &ProjectV2Event{} - p.GetSender() - p = nil - p.GetSender() -} - -func TestProjectV2Item_GetArchivedAt(tt *testing.T) { - tt.Parallel() - var zeroValue Timestamp - p := &ProjectV2Item{ArchivedAt: &zeroValue} - p.GetArchivedAt() - p = &ProjectV2Item{} - p.GetArchivedAt() - p = nil - p.GetArchivedAt() -} - -func TestProjectV2Item_GetContentNodeID(tt *testing.T) { - tt.Parallel() - var zeroValue string - p := &ProjectV2Item{ContentNodeID: &zeroValue} - p.GetContentNodeID() - p = &ProjectV2Item{} - p.GetContentNodeID() - p = nil - p.GetContentNodeID() -} - -func TestProjectV2Item_GetContentType(tt *testing.T) { - tt.Parallel() - var zeroValue string - p := &ProjectV2Item{ContentType: &zeroValue} - p.GetContentType() - p = &ProjectV2Item{} - p.GetContentType() - p = nil - p.GetContentType() -} - -func TestProjectV2Item_GetCreatedAt(tt *testing.T) { - tt.Parallel() - var zeroValue Timestamp - p := &ProjectV2Item{CreatedAt: &zeroValue} - p.GetCreatedAt() - p = &ProjectV2Item{} - p.GetCreatedAt() - p = nil - p.GetCreatedAt() -} - -func TestProjectV2Item_GetCreator(tt *testing.T) { - tt.Parallel() - p := &ProjectV2Item{} - p.GetCreator() - p = nil - p.GetCreator() -} - -func TestProjectV2Item_GetID(tt *testing.T) { - tt.Parallel() - var zeroValue int64 - p := &ProjectV2Item{ID: &zeroValue} - p.GetID() - p = &ProjectV2Item{} - p.GetID() - p = nil - p.GetID() -} - -func TestProjectV2Item_GetNodeID(tt *testing.T) { - tt.Parallel() - var zeroValue string - p := &ProjectV2Item{NodeID: &zeroValue} - p.GetNodeID() - p = &ProjectV2Item{} - p.GetNodeID() - p = nil - p.GetNodeID() -} - -func TestProjectV2Item_GetProjectNodeID(tt *testing.T) { - tt.Parallel() - var zeroValue string - p := &ProjectV2Item{ProjectNodeID: &zeroValue} - p.GetProjectNodeID() - p = &ProjectV2Item{} - p.GetProjectNodeID() - p = nil - p.GetProjectNodeID() -} - -func TestProjectV2Item_GetUpdatedAt(tt *testing.T) { - tt.Parallel() - var zeroValue Timestamp - p := &ProjectV2Item{UpdatedAt: &zeroValue} - p.GetUpdatedAt() - p = &ProjectV2Item{} - p.GetUpdatedAt() - p = nil - p.GetUpdatedAt() -} - -func TestProjectV2ItemChange_GetArchivedAt(tt *testing.T) { - tt.Parallel() - p := &ProjectV2ItemChange{} - p.GetArchivedAt() - p = nil - p.GetArchivedAt() -} - -func TestProjectV2ItemEvent_GetAction(tt *testing.T) { - tt.Parallel() - var zeroValue string - p := &ProjectV2ItemEvent{Action: &zeroValue} - p.GetAction() - p = &ProjectV2ItemEvent{} - p.GetAction() - p = nil - p.GetAction() -} - -func TestProjectV2ItemEvent_GetChanges(tt *testing.T) { +func TestProjectV2ItemEvent_GetChanges(tt *testing.T) { tt.Parallel() p := &ProjectV2ItemEvent{} p.GetChanges() @@ -32272,14 +31623,6 @@ func TestTimeline_GetPerformedViaGithubApp(tt *testing.T) { t.GetPerformedViaGithubApp() } -func TestTimeline_GetProjectCard(tt *testing.T) { - tt.Parallel() - t := &Timeline{} - t.GetProjectCard() - t = nil - t.GetProjectCard() -} - func TestTimeline_GetRename(tt *testing.T) { tt.Parallel() t := &Timeline{} diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index ed1c8f11e70..e9d8f29d061 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -1305,31 +1305,6 @@ func TestPreReceiveHook_String(t *testing.T) { } } -func TestProject_String(t *testing.T) { - t.Parallel() - v := Project{ - ID: Ptr(int64(0)), - URL: Ptr(""), - HTMLURL: Ptr(""), - ColumnsURL: Ptr(""), - OwnerURL: Ptr(""), - Name: Ptr(""), - Body: Ptr(""), - Number: Ptr(0), - State: Ptr(""), - CreatedAt: &Timestamp{}, - UpdatedAt: &Timestamp{}, - NodeID: Ptr(""), - OrganizationPermission: Ptr(""), - Private: Ptr(false), - Creator: &User{}, - } - want := `github.Project{ID:0, URL:"", HTMLURL:"", ColumnsURL:"", OwnerURL:"", Name:"", Body:"", Number:0, State:"", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, NodeID:"", OrganizationPermission:"", Private:false, Creator:github.User{}}` - if got := v.String(); got != want { - t.Errorf("Project.String = %v, want %v", got, want) - } -} - func TestPullRequest_String(t *testing.T) { t.Parallel() v := PullRequest{ diff --git a/github/github.go b/github/github.go index 2590d061ee1..7cdd73eb25e 100644 --- a/github/github.go +++ b/github/github.go @@ -203,7 +203,6 @@ type Client struct { Meta *MetaService Migrations *MigrationService Organizations *OrganizationsService - Projects *ProjectsService PullRequests *PullRequestsService RateLimit *RateLimitService Reactions *ReactionsService @@ -432,7 +431,6 @@ func (c *Client) initialize() { c.Meta = (*MetaService)(&c.common) c.Migrations = (*MigrationService)(&c.common) c.Organizations = (*OrganizationsService)(&c.common) - c.Projects = (*ProjectsService)(&c.common) c.PullRequests = (*PullRequestsService)(&c.common) c.RateLimit = (*RateLimitService)(&c.common) c.Reactions = (*ReactionsService)(&c.common) diff --git a/github/issues_events.go b/github/issues_events.go index bba3b180311..8e234d7e020 100644 --- a/github/issues_events.go +++ b/github/issues_events.go @@ -85,7 +85,6 @@ type IssueEvent struct { Label *Label `json:"label,omitempty"` Rename *Rename `json:"rename,omitempty"` LockReason *string `json:"lock_reason,omitempty"` - ProjectCard *ProjectCard `json:"project_card,omitempty"` DismissedReview *DismissedReview `json:"dismissed_review,omitempty"` RequestedReviewer *User `json:"requested_reviewer,omitempty"` RequestedTeam *Team `json:"requested_team,omitempty"` diff --git a/github/issues_events_test.go b/github/issues_events_test.go index 6e4a9685af2..043caedadc7 100644 --- a/github/issues_events_test.go +++ b/github/issues_events_test.go @@ -245,8 +245,7 @@ func TestIssueEvent_Marshal(t *testing.T) { From: Ptr("from"), To: Ptr("to"), }, - LockReason: Ptr("lr"), - ProjectCard: &ProjectCard{ID: Ptr(int64(1))}, + LockReason: Ptr("lr"), DismissedReview: &DismissedReview{ State: Ptr("state"), ReviewID: Ptr(int64(1)), diff --git a/github/issues_timeline.go b/github/issues_timeline.go index 0aa589afe40..ffd9b6fecfc 100644 --- a/github/issues_timeline.go +++ b/github/issues_timeline.go @@ -134,8 +134,7 @@ type Timeline struct { Source *Source `json:"source,omitempty"` // An object containing rename details including 'from' and 'to' attributes. // Only provided for 'renamed' events. - Rename *Rename `json:"rename,omitempty"` - ProjectCard *ProjectCard `json:"project_card,omitempty"` + Rename *Rename `json:"rename,omitempty"` // The state of a submitted review. Can be one of: 'commented', // 'changes_requested' or 'approved'. // Only provided for 'reviewed' events. diff --git a/github/issues_timeline_test.go b/github/issues_timeline_test.go index b5b33c4c5e8..1e88f500d99 100644 --- a/github/issues_timeline_test.go +++ b/github/issues_timeline_test.go @@ -170,8 +170,7 @@ func TestTimeline_Marshal(t *testing.T) { From: Ptr("from"), To: Ptr("to"), }, - ProjectCard: &ProjectCard{ID: Ptr(int64(1))}, - State: Ptr("state"), + State: Ptr("state"), } want := `{ diff --git a/github/messages.go b/github/messages.go index 3df4f3a3544..59b214b355a 100644 --- a/github/messages.go +++ b/github/messages.go @@ -86,9 +86,6 @@ var ( "page_build": &PageBuildEvent{}, "personal_access_token_request": &PersonalAccessTokenRequestEvent{}, "ping": &PingEvent{}, - "project": &ProjectEvent{}, - "project_card": &ProjectCardEvent{}, - "project_column": &ProjectColumnEvent{}, "projects_v2": &ProjectV2Event{}, "projects_v2_item": &ProjectV2ItemEvent{}, "public": &PublicEvent{}, diff --git a/github/messages_test.go b/github/messages_test.go index e5a5327cfac..36149ba2e36 100644 --- a/github/messages_test.go +++ b/github/messages_test.go @@ -424,18 +424,6 @@ func TestParseWebHook(t *testing.T) { payload: &PingEvent{}, messageType: "ping", }, - { - payload: &ProjectEvent{}, - messageType: "project", - }, - { - payload: &ProjectCardEvent{}, - messageType: "project_card", - }, - { - payload: &ProjectColumnEvent{}, - messageType: "project_column", - }, { payload: &ProjectV2Event{}, messageType: "projects_v2", diff --git a/github/orgs_projects.go b/github/orgs_projects.go deleted file mode 100644 index 454d8cf1c34..00000000000 --- a/github/orgs_projects.go +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2017 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" -) - -// ListProjects lists the projects for an organization. -// -// GitHub API docs: https://docs.github.com/rest/projects/projects#list-organization-projects -// -//meta:operation GET /orgs/{org}/projects -func (s *OrganizationsService) ListProjects(ctx context.Context, org string, opts *ProjectListOptions) ([]*Project, *Response, error) { - u := fmt.Sprintf("orgs/%v/projects", org) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - var projects []*Project - resp, err := s.client.Do(ctx, req, &projects) - if err != nil { - return nil, resp, err - } - - return projects, resp, nil -} - -// CreateProject creates a GitHub Project for the specified organization. -// -// GitHub API docs: https://docs.github.com/rest/projects/projects#create-an-organization-project -// -//meta:operation POST /orgs/{org}/projects -func (s *OrganizationsService) CreateProject(ctx context.Context, org string, opts *ProjectOptions) (*Project, *Response, error) { - u := fmt.Sprintf("orgs/%v/projects", org) - req, err := s.client.NewRequest("POST", u, opts) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - project := &Project{} - resp, err := s.client.Do(ctx, req, project) - if err != nil { - return nil, resp, err - } - - return project, resp, nil -} diff --git a/github/orgs_projects_test.go b/github/orgs_projects_test.go deleted file mode 100644 index f26cb90ac35..00000000000 --- a/github/orgs_projects_test.go +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright 2017 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 TestOrganizationsService_ListProjects(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/orgs/o/projects", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - testHeader(t, r, "Accept", mediaTypeProjectsPreview) - testFormValues(t, r, values{"state": "open", "page": "2"}) - fmt.Fprint(w, `[{"id":1}]`) - }) - - opt := &ProjectListOptions{State: "open", ListOptions: ListOptions{Page: 2}} - ctx := context.Background() - projects, _, err := client.Organizations.ListProjects(ctx, "o", opt) - if err != nil { - t.Errorf("Organizations.ListProjects returned error: %v", err) - } - - want := []*Project{{ID: Ptr(int64(1))}} - if !cmp.Equal(projects, want) { - t.Errorf("Organizations.ListProjects returned %+v, want %+v", projects, want) - } - - const methodName = "ListProjects" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Organizations.ListProjects(ctx, "\n", opt) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Organizations.ListProjects(ctx, "o", opt) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestOrganizationsService_CreateProject(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - input := &ProjectOptions{Name: Ptr("Project Name"), Body: Ptr("Project body.")} - - mux.HandleFunc("/orgs/o/projects", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "POST") - testHeader(t, r, "Accept", mediaTypeProjectsPreview) - - v := &ProjectOptions{} - assertNilError(t, json.NewDecoder(r.Body).Decode(v)) - if !cmp.Equal(v, input) { - t.Errorf("Request body = %+v, want %+v", v, input) - } - - fmt.Fprint(w, `{"id":1}`) - }) - - ctx := context.Background() - project, _, err := client.Organizations.CreateProject(ctx, "o", input) - if err != nil { - t.Errorf("Organizations.CreateProject returned error: %v", err) - } - - want := &Project{ID: Ptr(int64(1))} - if !cmp.Equal(project, want) { - t.Errorf("Organizations.CreateProject returned %+v, want %+v", project, want) - } - - const methodName = "CreateProject" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Organizations.CreateProject(ctx, "\n", input) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Organizations.CreateProject(ctx, "o", input) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} diff --git a/github/projects.go b/github/projects.go deleted file mode 100644 index c5c42f8939b..00000000000 --- a/github/projects.go +++ /dev/null @@ -1,634 +0,0 @@ -// Copyright 2016 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" -) - -// ProjectsService provides access to the projects functions in the -// GitHub API. -// -// GitHub API docs: https://docs.github.com/rest/projects -type ProjectsService service - -// Project represents a GitHub Project. -type Project struct { - ID *int64 `json:"id,omitempty"` - URL *string `json:"url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - ColumnsURL *string `json:"columns_url,omitempty"` - OwnerURL *string `json:"owner_url,omitempty"` - Name *string `json:"name,omitempty"` - Body *string `json:"body,omitempty"` - Number *int `json:"number,omitempty"` - State *string `json:"state,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - NodeID *string `json:"node_id,omitempty"` - OrganizationPermission *string `json:"organization_permission,omitempty"` - Private *bool `json:"private,omitempty"` - - // The User object that generated the project. - Creator *User `json:"creator,omitempty"` -} - -func (p Project) String() string { - return Stringify(p) -} - -// GetProject gets a GitHub Project for a repo. -// -// GitHub API docs: https://docs.github.com/rest/projects/projects#get-a-project -// -//meta:operation GET /projects/{project_id} -func (s *ProjectsService) GetProject(ctx context.Context, id int64) (*Project, *Response, error) { - u := fmt.Sprintf("projects/%v", id) - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - project := &Project{} - resp, err := s.client.Do(ctx, req, project) - if err != nil { - return nil, resp, err - } - - return project, resp, nil -} - -// ProjectOptions specifies the parameters to the -// RepositoriesService.CreateProject and -// ProjectsService.UpdateProject methods. -type ProjectOptions struct { - // The name of the project. (Required for creation; optional for update.) - Name *string `json:"name,omitempty"` - // The body of the project. (Optional.) - Body *string `json:"body,omitempty"` - - // The following field(s) are only applicable for update. - // They should be left with zero values for creation. - - // State of the project. Either "open" or "closed". (Optional.) - State *string `json:"state,omitempty"` - // The permission level that all members of the project's organization - // will have on this project. - // Setting the organization permission is only available - // for organization projects. (Optional.) - OrganizationPermission *string `json:"organization_permission,omitempty"` - // Sets visibility of the project within the organization. - // Setting visibility is only available - // for organization projects.(Optional.) - Private *bool `json:"private,omitempty"` -} - -// UpdateProject updates a repository project. -// -// GitHub API docs: https://docs.github.com/rest/projects/projects#update-a-project -// -//meta:operation PATCH /projects/{project_id} -func (s *ProjectsService) UpdateProject(ctx context.Context, id int64, opts *ProjectOptions) (*Project, *Response, error) { - u := fmt.Sprintf("projects/%v", id) - req, err := s.client.NewRequest("PATCH", u, opts) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - project := &Project{} - resp, err := s.client.Do(ctx, req, project) - if err != nil { - return nil, resp, err - } - - return project, resp, nil -} - -// DeleteProject deletes a GitHub Project from a repository. -// -// GitHub API docs: https://docs.github.com/rest/projects/projects#delete-a-project -// -//meta:operation DELETE /projects/{project_id} -func (s *ProjectsService) DeleteProject(ctx context.Context, id int64) (*Response, error) { - u := fmt.Sprintf("projects/%v", id) - req, err := s.client.NewRequest("DELETE", u, nil) - if err != nil { - return nil, err - } - - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - return s.client.Do(ctx, req, nil) -} - -// ProjectColumn represents a column of a GitHub Project. -// -// GitHub API docs: https://docs.github.com/rest/repos/projects/ -type ProjectColumn struct { - ID *int64 `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - URL *string `json:"url,omitempty"` - ProjectURL *string `json:"project_url,omitempty"` - CardsURL *string `json:"cards_url,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - NodeID *string `json:"node_id,omitempty"` -} - -// ListProjectColumns lists the columns of a GitHub Project for a repo. -// -// GitHub API docs: https://docs.github.com/rest/projects/columns#list-project-columns -// -//meta:operation GET /projects/{project_id}/columns -func (s *ProjectsService) ListProjectColumns(ctx context.Context, projectID int64, opts *ListOptions) ([]*ProjectColumn, *Response, error) { - u := fmt.Sprintf("projects/%v/columns", projectID) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - columns := []*ProjectColumn{} - resp, err := s.client.Do(ctx, req, &columns) - if err != nil { - return nil, resp, err - } - - return columns, resp, nil -} - -// GetProjectColumn gets a column of a GitHub Project for a repo. -// -// GitHub API docs: https://docs.github.com/rest/projects/columns#get-a-project-column -// -//meta:operation GET /projects/columns/{column_id} -func (s *ProjectsService) GetProjectColumn(ctx context.Context, id int64) (*ProjectColumn, *Response, error) { - u := fmt.Sprintf("projects/columns/%v", id) - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - column := &ProjectColumn{} - resp, err := s.client.Do(ctx, req, column) - if err != nil { - return nil, resp, err - } - - return column, resp, nil -} - -// ProjectColumnOptions specifies the parameters to the -// ProjectsService.CreateProjectColumn and -// ProjectsService.UpdateProjectColumn methods. -type ProjectColumnOptions struct { - // The name of the project column. (Required for creation and update.) - Name string `json:"name"` -} - -// CreateProjectColumn creates a column for the specified (by number) project. -// -// GitHub API docs: https://docs.github.com/rest/projects/columns#create-a-project-column -// -//meta:operation POST /projects/{project_id}/columns -func (s *ProjectsService) CreateProjectColumn(ctx context.Context, projectID int64, opts *ProjectColumnOptions) (*ProjectColumn, *Response, error) { - u := fmt.Sprintf("projects/%v/columns", projectID) - req, err := s.client.NewRequest("POST", u, opts) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - column := &ProjectColumn{} - resp, err := s.client.Do(ctx, req, column) - if err != nil { - return nil, resp, err - } - - return column, resp, nil -} - -// UpdateProjectColumn updates a column of a GitHub Project. -// -// GitHub API docs: https://docs.github.com/rest/projects/columns#update-an-existing-project-column -// -//meta:operation PATCH /projects/columns/{column_id} -func (s *ProjectsService) UpdateProjectColumn(ctx context.Context, columnID int64, opts *ProjectColumnOptions) (*ProjectColumn, *Response, error) { - u := fmt.Sprintf("projects/columns/%v", columnID) - req, err := s.client.NewRequest("PATCH", u, opts) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - column := &ProjectColumn{} - resp, err := s.client.Do(ctx, req, column) - if err != nil { - return nil, resp, err - } - - return column, resp, nil -} - -// DeleteProjectColumn deletes a column from a GitHub Project. -// -// GitHub API docs: https://docs.github.com/rest/projects/columns#delete-a-project-column -// -//meta:operation DELETE /projects/columns/{column_id} -func (s *ProjectsService) DeleteProjectColumn(ctx context.Context, columnID int64) (*Response, error) { - u := fmt.Sprintf("projects/columns/%v", columnID) - req, err := s.client.NewRequest("DELETE", u, nil) - if err != nil { - return nil, err - } - - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - return s.client.Do(ctx, req, nil) -} - -// ProjectColumnMoveOptions specifies the parameters to the -// ProjectsService.MoveProjectColumn method. -type ProjectColumnMoveOptions struct { - // Position can be one of "first", "last", or "after:", where - // is the ID of a column in the same project. (Required.) - Position string `json:"position"` -} - -// MoveProjectColumn moves a column within a GitHub Project. -// -// GitHub API docs: https://docs.github.com/rest/projects/columns#move-a-project-column -// -//meta:operation POST /projects/columns/{column_id}/moves -func (s *ProjectsService) MoveProjectColumn(ctx context.Context, columnID int64, opts *ProjectColumnMoveOptions) (*Response, error) { - u := fmt.Sprintf("projects/columns/%v/moves", columnID) - req, err := s.client.NewRequest("POST", u, opts) - if err != nil { - return nil, err - } - - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - return s.client.Do(ctx, req, nil) -} - -// ProjectCard represents a card in a column of a GitHub Project. -// -// GitHub API docs: https://docs.github.com/rest/projects/cards/#get-a-project-card -type ProjectCard struct { - URL *string `json:"url,omitempty"` - ColumnURL *string `json:"column_url,omitempty"` - ContentURL *string `json:"content_url,omitempty"` - ID *int64 `json:"id,omitempty"` - Note *string `json:"note,omitempty"` - Creator *User `json:"creator,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - NodeID *string `json:"node_id,omitempty"` - Archived *bool `json:"archived,omitempty"` - - // The following fields are only populated by Webhook events. - ColumnID *int64 `json:"column_id,omitempty"` - - // The following fields are only populated by Events API. - ProjectID *int64 `json:"project_id,omitempty"` - ProjectURL *string `json:"project_url,omitempty"` - ColumnName *string `json:"column_name,omitempty"` - PreviousColumnName *string `json:"previous_column_name,omitempty"` // Populated in "moved_columns_in_project" event deliveries. -} - -// ProjectCardListOptions specifies the optional parameters to the -// ProjectsService.ListProjectCards method. -type ProjectCardListOptions struct { - // ArchivedState is used to list all, archived, or not_archived project cards. - // Defaults to not_archived when you omit this parameter. - ArchivedState *string `url:"archived_state,omitempty"` - - ListOptions -} - -// ListProjectCards lists the cards in a column of a GitHub Project. -// -// GitHub API docs: https://docs.github.com/rest/projects/cards#list-project-cards -// -//meta:operation GET /projects/columns/{column_id}/cards -func (s *ProjectsService) ListProjectCards(ctx context.Context, columnID int64, opts *ProjectCardListOptions) ([]*ProjectCard, *Response, error) { - u := fmt.Sprintf("projects/columns/%v/cards", columnID) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - cards := []*ProjectCard{} - resp, err := s.client.Do(ctx, req, &cards) - if err != nil { - return nil, resp, err - } - - return cards, resp, nil -} - -// GetProjectCard gets a card in a column of a GitHub Project. -// -// GitHub API docs: https://docs.github.com/rest/projects/cards#get-a-project-card -// -//meta:operation GET /projects/columns/cards/{card_id} -func (s *ProjectsService) GetProjectCard(ctx context.Context, cardID int64) (*ProjectCard, *Response, error) { - u := fmt.Sprintf("projects/columns/cards/%v", cardID) - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - card := &ProjectCard{} - resp, err := s.client.Do(ctx, req, card) - if err != nil { - return nil, resp, err - } - - return card, resp, nil -} - -// ProjectCardOptions specifies the parameters to the -// ProjectsService.CreateProjectCard and -// ProjectsService.UpdateProjectCard methods. -type ProjectCardOptions struct { - // The note of the card. Note and ContentID are mutually exclusive. - Note string `json:"note,omitempty"` - // The ID (not Number) of the Issue to associate with this card. - // Note and ContentID are mutually exclusive. - ContentID int64 `json:"content_id,omitempty"` - // The type of content to associate with this card. Possible values are: "Issue" and "PullRequest". - ContentType string `json:"content_type,omitempty"` - // Use true to archive a project card. - // Specify false if you need to restore a previously archived project card. - Archived *bool `json:"archived,omitempty"` -} - -// CreateProjectCard creates a card in the specified column of a GitHub Project. -// -// GitHub API docs: https://docs.github.com/rest/projects/cards#create-a-project-card -// -//meta:operation POST /projects/columns/{column_id}/cards -func (s *ProjectsService) CreateProjectCard(ctx context.Context, columnID int64, opts *ProjectCardOptions) (*ProjectCard, *Response, error) { - u := fmt.Sprintf("projects/columns/%v/cards", columnID) - req, err := s.client.NewRequest("POST", u, opts) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - card := &ProjectCard{} - resp, err := s.client.Do(ctx, req, card) - if err != nil { - return nil, resp, err - } - - return card, resp, nil -} - -// UpdateProjectCard updates a card of a GitHub Project. -// -// GitHub API docs: https://docs.github.com/rest/projects/cards#update-an-existing-project-card -// -//meta:operation PATCH /projects/columns/cards/{card_id} -func (s *ProjectsService) UpdateProjectCard(ctx context.Context, cardID int64, opts *ProjectCardOptions) (*ProjectCard, *Response, error) { - u := fmt.Sprintf("projects/columns/cards/%v", cardID) - req, err := s.client.NewRequest("PATCH", u, opts) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - card := &ProjectCard{} - resp, err := s.client.Do(ctx, req, card) - if err != nil { - return nil, resp, err - } - - return card, resp, nil -} - -// DeleteProjectCard deletes a card from a GitHub Project. -// -// GitHub API docs: https://docs.github.com/rest/projects/cards#delete-a-project-card -// -//meta:operation DELETE /projects/columns/cards/{card_id} -func (s *ProjectsService) DeleteProjectCard(ctx context.Context, cardID int64) (*Response, error) { - u := fmt.Sprintf("projects/columns/cards/%v", cardID) - req, err := s.client.NewRequest("DELETE", u, nil) - if err != nil { - return nil, err - } - - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - return s.client.Do(ctx, req, nil) -} - -// ProjectCardMoveOptions specifies the parameters to the -// ProjectsService.MoveProjectCard method. -type ProjectCardMoveOptions struct { - // Position can be one of "top", "bottom", or "after:", where - // is the ID of a card in the same project. - Position string `json:"position"` - // ColumnID is the ID of a column in the same project. Note that ColumnID - // is required when using Position "after:" when that card is in - // another column; otherwise it is optional. - ColumnID int64 `json:"column_id,omitempty"` -} - -// MoveProjectCard moves a card within a GitHub Project. -// -// GitHub API docs: https://docs.github.com/rest/projects/cards#move-a-project-card -// -//meta:operation POST /projects/columns/cards/{card_id}/moves -func (s *ProjectsService) MoveProjectCard(ctx context.Context, cardID int64, opts *ProjectCardMoveOptions) (*Response, error) { - u := fmt.Sprintf("projects/columns/cards/%v/moves", cardID) - req, err := s.client.NewRequest("POST", u, opts) - if err != nil { - return nil, err - } - - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - return s.client.Do(ctx, req, nil) -} - -// ProjectCollaboratorOptions specifies the optional parameters to the -// ProjectsService.AddProjectCollaborator method. -type ProjectCollaboratorOptions struct { - // Permission specifies the permission to grant to the collaborator. - // Possible values are: - // "read" - can read, but not write to or administer this project. - // "write" - can read and write, but not administer this project. - // "admin" - can read, write and administer this project. - // - // Default value is "write" - Permission *string `json:"permission,omitempty"` -} - -// AddProjectCollaborator adds a collaborator to an organization project and sets -// their permission level. You must be an organization owner or a project admin to add a collaborator. -// -// GitHub API docs: https://docs.github.com/rest/projects/collaborators#add-project-collaborator -// -//meta:operation PUT /projects/{project_id}/collaborators/{username} -func (s *ProjectsService) AddProjectCollaborator(ctx context.Context, id int64, username string, opts *ProjectCollaboratorOptions) (*Response, error) { - u := fmt.Sprintf("projects/%v/collaborators/%v", id, username) - req, err := s.client.NewRequest("PUT", u, opts) - if err != nil { - return nil, err - } - - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - return s.client.Do(ctx, req, nil) -} - -// RemoveProjectCollaborator removes a collaborator from an organization project. -// You must be an organization owner or a project admin to remove a collaborator. -// -// GitHub API docs: https://docs.github.com/rest/projects/collaborators#remove-user-as-a-collaborator -// -//meta:operation DELETE /projects/{project_id}/collaborators/{username} -func (s *ProjectsService) RemoveProjectCollaborator(ctx context.Context, id int64, username string) (*Response, error) { - u := fmt.Sprintf("projects/%v/collaborators/%v", id, username) - req, err := s.client.NewRequest("DELETE", u, nil) - if err != nil { - return nil, err - } - - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - return s.client.Do(ctx, req, nil) -} - -// ListCollaboratorOptions specifies the optional parameters to the -// ProjectsService.ListProjectCollaborators method. -type ListCollaboratorOptions struct { - // Affiliation specifies how collaborators should be filtered by their affiliation. - // Possible values are: - // "outside" - All outside collaborators of an organization-owned repository - // "direct" - All collaborators with permissions to an organization-owned repository, - // regardless of organization membership status - // "all" - All collaborators the authenticated user can see - // - // Default value is "all". - Affiliation *string `url:"affiliation,omitempty"` - - ListOptions -} - -// ListProjectCollaborators lists the collaborators for an organization project. For a project, -// the list of collaborators includes outside collaborators, organization members that are direct -// collaborators, organization members with access through team memberships, organization members -// with access through default organization permissions, and organization owners. You must be an -// organization owner or a project admin to list collaborators. -// -// GitHub API docs: https://docs.github.com/rest/projects/collaborators#list-project-collaborators -// -//meta:operation GET /projects/{project_id}/collaborators -func (s *ProjectsService) ListProjectCollaborators(ctx context.Context, id int64, opts *ListCollaboratorOptions) ([]*User, *Response, error) { - u := fmt.Sprintf("projects/%v/collaborators", id) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - var users []*User - resp, err := s.client.Do(ctx, req, &users) - if err != nil { - return nil, resp, err - } - - return users, resp, nil -} - -// ProjectPermissionLevel represents the permission level an organization -// member has for a given project. -type ProjectPermissionLevel struct { - // Possible values: "admin", "write", "read", "none" - Permission *string `json:"permission,omitempty"` - - User *User `json:"user,omitempty"` -} - -// ReviewProjectCollaboratorPermission returns the collaborator's permission level for an organization -// project. Possible values for the permission key: "admin", "write", "read", "none". -// You must be an organization owner or a project admin to review a user's permission level. -// -// GitHub API docs: https://docs.github.com/rest/projects/collaborators#get-project-permission-for-a-user -// -//meta:operation GET /projects/{project_id}/collaborators/{username}/permission -func (s *ProjectsService) ReviewProjectCollaboratorPermission(ctx context.Context, id int64, username string) (*ProjectPermissionLevel, *Response, error) { - u := fmt.Sprintf("projects/%v/collaborators/%v/permission", id, username) - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - ppl := new(ProjectPermissionLevel) - resp, err := s.client.Do(ctx, req, ppl) - if err != nil { - return nil, resp, err - } - return ppl, resp, nil -} diff --git a/github/projects_test.go b/github/projects_test.go deleted file mode 100644 index f02e2a725a4..00000000000 --- a/github/projects_test.go +++ /dev/null @@ -1,1120 +0,0 @@ -// Copyright 2016 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 TestProject_Marshal(t *testing.T) { - t.Parallel() - testJSONMarshal(t, &Project{}, "{}") - - u := &Project{ - ID: Ptr(int64(1)), - URL: Ptr("u"), - HTMLURL: Ptr("h"), - ColumnsURL: Ptr("c"), - OwnerURL: Ptr("o"), - Name: Ptr("n"), - Body: Ptr("b"), - Number: Ptr(1), - State: Ptr("s"), - CreatedAt: &Timestamp{referenceTime}, - UpdatedAt: &Timestamp{referenceTime}, - NodeID: Ptr("n"), - Creator: &User{ - Login: Ptr("l"), - ID: Ptr(int64(1)), - AvatarURL: Ptr("a"), - GravatarID: Ptr("g"), - Name: Ptr("n"), - Company: Ptr("c"), - Blog: Ptr("b"), - Location: Ptr("l"), - Email: Ptr("e"), - Hireable: Ptr(true), - PublicRepos: Ptr(1), - Followers: Ptr(1), - Following: Ptr(1), - CreatedAt: &Timestamp{referenceTime}, - URL: Ptr("u"), - }, - } - want := `{ - "id": 1, - "url": "u", - "html_url": "h", - "columns_url": "c", - "owner_url": "o", - "name": "n", - "body": "b", - "number": 1, - "state": "s", - "created_at": ` + referenceTimeStr + `, - "updated_at": ` + referenceTimeStr + `, - "node_id": "n", - "creator": { - "login": "l", - "id": 1, - "avatar_url": "a", - "gravatar_id": "g", - "name": "n", - "company": "c", - "blog": "b", - "location": "l", - "email": "e", - "hireable": true, - "public_repos": 1, - "followers": 1, - "following": 1, - "created_at": ` + referenceTimeStr + `, - "url": "u" - } - }` - testJSONMarshal(t, u, want) -} - -func TestProjectsService_UpdateProject(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - input := &ProjectOptions{ - Name: Ptr("Project Name"), - Body: Ptr("Project body."), - State: Ptr("open"), - Private: Ptr(false), - - OrganizationPermission: Ptr("read"), - } - - mux.HandleFunc("/projects/1", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "PATCH") - testHeader(t, r, "Accept", mediaTypeProjectsPreview) - - v := &ProjectOptions{} - assertNilError(t, json.NewDecoder(r.Body).Decode(v)) - if !cmp.Equal(v, input) { - t.Errorf("Request body = %+v, want %+v", v, input) - } - - fmt.Fprint(w, `{"id":1}`) - }) - - ctx := context.Background() - project, _, err := client.Projects.UpdateProject(ctx, 1, input) - if err != nil { - t.Errorf("Projects.UpdateProject returned error: %v", err) - } - - want := &Project{ID: Ptr(int64(1))} - if !cmp.Equal(project, want) { - t.Errorf("Projects.UpdateProject returned %+v, want %+v", project, want) - } - - const methodName = "UpdateProject" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Projects.UpdateProject(ctx, -1, input) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Projects.UpdateProject(ctx, 1, input) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestProjectsService_GetProject(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/projects/1", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - testHeader(t, r, "Accept", mediaTypeProjectsPreview) - fmt.Fprint(w, `{"id":1}`) - }) - - ctx := context.Background() - project, _, err := client.Projects.GetProject(ctx, 1) - if err != nil { - t.Errorf("Projects.GetProject returned error: %v", err) - } - - want := &Project{ID: Ptr(int64(1))} - if !cmp.Equal(project, want) { - t.Errorf("Projects.GetProject returned %+v, want %+v", project, want) - } - - const methodName = "GetProject" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Projects.GetProject(ctx, -1) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Projects.GetProject(ctx, 1) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestProjectsService_DeleteProject(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/projects/1", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "DELETE") - testHeader(t, r, "Accept", mediaTypeProjectsPreview) - }) - - ctx := context.Background() - _, err := client.Projects.DeleteProject(ctx, 1) - if err != nil { - t.Errorf("Projects.DeleteProject returned error: %v", err) - } - - const methodName = "DeleteProject" - testBadOptions(t, methodName, func() (err error) { - _, err = client.Projects.DeleteProject(ctx, -1) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Projects.DeleteProject(ctx, 1) - }) -} - -func TestProjectsService_ListProjectColumns(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/projects/1/columns", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - testHeader(t, r, "Accept", mediaTypeProjectsPreview) - testFormValues(t, r, values{"page": "2"}) - fmt.Fprint(w, `[{"id":1}]`) - }) - - opt := &ListOptions{Page: 2} - ctx := context.Background() - columns, _, err := client.Projects.ListProjectColumns(ctx, 1, opt) - if err != nil { - t.Errorf("Projects.ListProjectColumns returned error: %v", err) - } - - want := []*ProjectColumn{{ID: Ptr(int64(1))}} - if !cmp.Equal(columns, want) { - t.Errorf("Projects.ListProjectColumns returned %+v, want %+v", columns, want) - } - - const methodName = "ListProjectColumns" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Projects.ListProjectColumns(ctx, -1, opt) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Projects.ListProjectColumns(ctx, 1, opt) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestProjectsService_GetProjectColumn(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/projects/columns/1", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - testHeader(t, r, "Accept", mediaTypeProjectsPreview) - fmt.Fprint(w, `{"id":1}`) - }) - - ctx := context.Background() - column, _, err := client.Projects.GetProjectColumn(ctx, 1) - if err != nil { - t.Errorf("Projects.GetProjectColumn returned error: %v", err) - } - - want := &ProjectColumn{ID: Ptr(int64(1))} - if !cmp.Equal(column, want) { - t.Errorf("Projects.GetProjectColumn returned %+v, want %+v", column, want) - } - - const methodName = "GetProjectColumn" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Projects.GetProjectColumn(ctx, -1) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Projects.GetProjectColumn(ctx, 1) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestProjectsService_CreateProjectColumn(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - input := &ProjectColumnOptions{Name: "Column Name"} - - mux.HandleFunc("/projects/1/columns", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "POST") - testHeader(t, r, "Accept", mediaTypeProjectsPreview) - - v := &ProjectColumnOptions{} - assertNilError(t, json.NewDecoder(r.Body).Decode(v)) - if !cmp.Equal(v, input) { - t.Errorf("Request body = %+v, want %+v", v, input) - } - - fmt.Fprint(w, `{"id":1}`) - }) - - ctx := context.Background() - column, _, err := client.Projects.CreateProjectColumn(ctx, 1, input) - if err != nil { - t.Errorf("Projects.CreateProjectColumn returned error: %v", err) - } - - want := &ProjectColumn{ID: Ptr(int64(1))} - if !cmp.Equal(column, want) { - t.Errorf("Projects.CreateProjectColumn returned %+v, want %+v", column, want) - } - - const methodName = "CreateProjectColumn" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Projects.CreateProjectColumn(ctx, -1, input) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Projects.CreateProjectColumn(ctx, 1, input) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestProjectsService_UpdateProjectColumn(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - input := &ProjectColumnOptions{Name: "Column Name"} - - mux.HandleFunc("/projects/columns/1", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "PATCH") - testHeader(t, r, "Accept", mediaTypeProjectsPreview) - - v := &ProjectColumnOptions{} - assertNilError(t, json.NewDecoder(r.Body).Decode(v)) - if !cmp.Equal(v, input) { - t.Errorf("Request body = %+v, want %+v", v, input) - } - - fmt.Fprint(w, `{"id":1}`) - }) - - ctx := context.Background() - column, _, err := client.Projects.UpdateProjectColumn(ctx, 1, input) - if err != nil { - t.Errorf("Projects.UpdateProjectColumn returned error: %v", err) - } - - want := &ProjectColumn{ID: Ptr(int64(1))} - if !cmp.Equal(column, want) { - t.Errorf("Projects.UpdateProjectColumn returned %+v, want %+v", column, want) - } - - const methodName = "UpdateProjectColumn" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Projects.UpdateProjectColumn(ctx, -1, input) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Projects.UpdateProjectColumn(ctx, 1, input) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestProjectsService_DeleteProjectColumn(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/projects/columns/1", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "DELETE") - testHeader(t, r, "Accept", mediaTypeProjectsPreview) - }) - - ctx := context.Background() - _, err := client.Projects.DeleteProjectColumn(ctx, 1) - if err != nil { - t.Errorf("Projects.DeleteProjectColumn returned error: %v", err) - } - - const methodName = "DeleteProjectColumn" - testBadOptions(t, methodName, func() (err error) { - _, err = client.Projects.DeleteProjectColumn(ctx, -1) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Projects.DeleteProjectColumn(ctx, 1) - }) -} - -func TestProjectsService_MoveProjectColumn(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - input := &ProjectColumnMoveOptions{Position: "after:12345"} - - mux.HandleFunc("/projects/columns/1/moves", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "POST") - testHeader(t, r, "Accept", mediaTypeProjectsPreview) - - v := &ProjectColumnMoveOptions{} - assertNilError(t, json.NewDecoder(r.Body).Decode(v)) - if !cmp.Equal(v, input) { - t.Errorf("Request body = %+v, want %+v", v, input) - } - }) - - ctx := context.Background() - _, err := client.Projects.MoveProjectColumn(ctx, 1, input) - if err != nil { - t.Errorf("Projects.MoveProjectColumn returned error: %v", err) - } - - const methodName = "MoveProjectColumn" - testBadOptions(t, methodName, func() (err error) { - _, err = client.Projects.MoveProjectColumn(ctx, -1, input) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Projects.MoveProjectColumn(ctx, 1, input) - }) -} - -func TestProjectsService_ListProjectCards(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/projects/columns/1/cards", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - testHeader(t, r, "Accept", mediaTypeProjectsPreview) - testFormValues(t, r, values{ - "archived_state": "all", - "page": "2"}) - fmt.Fprint(w, `[{"id":1}]`) - }) - - opt := &ProjectCardListOptions{ - ArchivedState: Ptr("all"), - ListOptions: ListOptions{Page: 2}} - ctx := context.Background() - cards, _, err := client.Projects.ListProjectCards(ctx, 1, opt) - if err != nil { - t.Errorf("Projects.ListProjectCards returned error: %v", err) - } - - want := []*ProjectCard{{ID: Ptr(int64(1))}} - if !cmp.Equal(cards, want) { - t.Errorf("Projects.ListProjectCards returned %+v, want %+v", cards, want) - } - - const methodName = "ListProjectCards" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Projects.ListProjectCards(ctx, -1, opt) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Projects.ListProjectCards(ctx, 1, opt) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestProjectsService_GetProjectCard(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/projects/columns/cards/1", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - testHeader(t, r, "Accept", mediaTypeProjectsPreview) - fmt.Fprint(w, `{"id":1}`) - }) - - ctx := context.Background() - card, _, err := client.Projects.GetProjectCard(ctx, 1) - if err != nil { - t.Errorf("Projects.GetProjectCard returned error: %v", err) - } - - want := &ProjectCard{ID: Ptr(int64(1))} - if !cmp.Equal(card, want) { - t.Errorf("Projects.GetProjectCard returned %+v, want %+v", card, want) - } - - const methodName = "GetProjectCard" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Projects.GetProjectCard(ctx, -1) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Projects.GetProjectCard(ctx, 1) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestProjectsService_CreateProjectCard(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - input := &ProjectCardOptions{ - ContentID: 12345, - ContentType: "Issue", - } - - mux.HandleFunc("/projects/columns/1/cards", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "POST") - testHeader(t, r, "Accept", mediaTypeProjectsPreview) - - v := &ProjectCardOptions{} - assertNilError(t, json.NewDecoder(r.Body).Decode(v)) - if !cmp.Equal(v, input) { - t.Errorf("Request body = %+v, want %+v", v, input) - } - - fmt.Fprint(w, `{"id":1}`) - }) - - ctx := context.Background() - card, _, err := client.Projects.CreateProjectCard(ctx, 1, input) - if err != nil { - t.Errorf("Projects.CreateProjectCard returned error: %v", err) - } - - want := &ProjectCard{ID: Ptr(int64(1))} - if !cmp.Equal(card, want) { - t.Errorf("Projects.CreateProjectCard returned %+v, want %+v", card, want) - } - - const methodName = "CreateProjectCard" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Projects.CreateProjectCard(ctx, -1, input) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Projects.CreateProjectCard(ctx, 1, input) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestProjectsService_UpdateProjectCard(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - input := &ProjectCardOptions{ - ContentID: 12345, - ContentType: "Issue", - } - - mux.HandleFunc("/projects/columns/cards/1", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "PATCH") - testHeader(t, r, "Accept", mediaTypeProjectsPreview) - - v := &ProjectCardOptions{} - assertNilError(t, json.NewDecoder(r.Body).Decode(v)) - if !cmp.Equal(v, input) { - t.Errorf("Request body = %+v, want %+v", v, input) - } - - fmt.Fprint(w, `{"id":1, "archived":false}`) - }) - - ctx := context.Background() - card, _, err := client.Projects.UpdateProjectCard(ctx, 1, input) - if err != nil { - t.Errorf("Projects.UpdateProjectCard returned error: %v", err) - } - - want := &ProjectCard{ID: Ptr(int64(1)), Archived: Ptr(false)} - if !cmp.Equal(card, want) { - t.Errorf("Projects.UpdateProjectCard returned %+v, want %+v", card, want) - } - - const methodName = "UpdateProjectCard" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Projects.UpdateProjectCard(ctx, -1, input) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Projects.UpdateProjectCard(ctx, 1, input) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestProjectsService_DeleteProjectCard(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/projects/columns/cards/1", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "DELETE") - testHeader(t, r, "Accept", mediaTypeProjectsPreview) - }) - - ctx := context.Background() - _, err := client.Projects.DeleteProjectCard(ctx, 1) - if err != nil { - t.Errorf("Projects.DeleteProjectCard returned error: %v", err) - } - - const methodName = "DeleteProjectCard" - testBadOptions(t, methodName, func() (err error) { - _, err = client.Projects.DeleteProjectCard(ctx, -1) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Projects.DeleteProjectCard(ctx, 1) - }) -} - -func TestProjectsService_MoveProjectCard(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - input := &ProjectCardMoveOptions{Position: "after:12345"} - - mux.HandleFunc("/projects/columns/cards/1/moves", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "POST") - testHeader(t, r, "Accept", mediaTypeProjectsPreview) - - v := &ProjectCardMoveOptions{} - assertNilError(t, json.NewDecoder(r.Body).Decode(v)) - if !cmp.Equal(v, input) { - t.Errorf("Request body = %+v, want %+v", v, input) - } - }) - - ctx := context.Background() - _, err := client.Projects.MoveProjectCard(ctx, 1, input) - if err != nil { - t.Errorf("Projects.MoveProjectCard returned error: %v", err) - } - - const methodName = "MoveProjectCard" - testBadOptions(t, methodName, func() (err error) { - _, err = client.Projects.MoveProjectCard(ctx, -1, input) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Projects.MoveProjectCard(ctx, 1, input) - }) -} - -func TestProjectsService_AddProjectCollaborator(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - opt := &ProjectCollaboratorOptions{ - Permission: Ptr("admin"), - } - - mux.HandleFunc("/projects/1/collaborators/u", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "PUT") - testHeader(t, r, "Accept", mediaTypeProjectsPreview) - - v := &ProjectCollaboratorOptions{} - assertNilError(t, json.NewDecoder(r.Body).Decode(v)) - if !cmp.Equal(v, opt) { - t.Errorf("Request body = %+v, want %+v", v, opt) - } - - w.WriteHeader(http.StatusNoContent) - }) - - ctx := context.Background() - _, err := client.Projects.AddProjectCollaborator(ctx, 1, "u", opt) - if err != nil { - t.Errorf("Projects.AddProjectCollaborator returned error: %v", err) - } - - const methodName = "AddProjectCollaborator" - testBadOptions(t, methodName, func() (err error) { - _, err = client.Projects.AddProjectCollaborator(ctx, -1, "\n", opt) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Projects.AddProjectCollaborator(ctx, 1, "u", opt) - }) -} - -func TestProjectsService_AddCollaborator_invalidUser(t *testing.T) { - t.Parallel() - client, _, _ := setup(t) - - ctx := context.Background() - _, err := client.Projects.AddProjectCollaborator(ctx, 1, "%", nil) - testURLParseError(t, err) -} - -func TestProjectsService_RemoveCollaborator(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/projects/1/collaborators/u", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "DELETE") - testHeader(t, r, "Accept", mediaTypeProjectsPreview) - w.WriteHeader(http.StatusNoContent) - }) - - ctx := context.Background() - _, err := client.Projects.RemoveProjectCollaborator(ctx, 1, "u") - if err != nil { - t.Errorf("Projects.RemoveProjectCollaborator returned error: %v", err) - } - - const methodName = "RemoveProjectCollaborator" - testBadOptions(t, methodName, func() (err error) { - _, err = client.Projects.RemoveProjectCollaborator(ctx, -1, "\n") - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Projects.RemoveProjectCollaborator(ctx, 1, "u") - }) -} - -func TestProjectsService_RemoveCollaborator_invalidUser(t *testing.T) { - t.Parallel() - client, _, _ := setup(t) - - ctx := context.Background() - _, err := client.Projects.RemoveProjectCollaborator(ctx, 1, "%") - testURLParseError(t, err) -} - -func TestProjectsService_ListCollaborators(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/projects/1/collaborators", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - testHeader(t, r, "Accept", mediaTypeProjectsPreview) - testFormValues(t, r, values{"page": "2"}) - fmt.Fprintf(w, `[{"id":1}, {"id":2}]`) - }) - - opt := &ListCollaboratorOptions{ - ListOptions: ListOptions{Page: 2}, - } - ctx := context.Background() - users, _, err := client.Projects.ListProjectCollaborators(ctx, 1, opt) - if err != nil { - t.Errorf("Projects.ListProjectCollaborators returned error: %v", err) - } - - want := []*User{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}} - if !cmp.Equal(users, want) { - t.Errorf("Projects.ListProjectCollaborators returned %+v, want %+v", users, want) - } - - const methodName = "ListProjectCollaborators" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Projects.ListProjectCollaborators(ctx, -1, opt) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Projects.ListProjectCollaborators(ctx, 1, opt) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestProjectsService_ListCollaborators_withAffiliation(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/projects/1/collaborators", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - testHeader(t, r, "Accept", mediaTypeProjectsPreview) - testFormValues(t, r, values{"affiliation": "all", "page": "2"}) - fmt.Fprintf(w, `[{"id":1}, {"id":2}]`) - }) - - opt := &ListCollaboratorOptions{ - ListOptions: ListOptions{Page: 2}, - Affiliation: Ptr("all"), - } - ctx := context.Background() - users, _, err := client.Projects.ListProjectCollaborators(ctx, 1, opt) - if err != nil { - t.Errorf("Projects.ListProjectCollaborators returned error: %v", err) - } - - want := []*User{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}} - if !cmp.Equal(users, want) { - t.Errorf("Projects.ListProjectCollaborators returned %+v, want %+v", users, want) - } -} - -func TestProjectsService_ReviewProjectCollaboratorPermission(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/projects/1/collaborators/u/permission", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - testHeader(t, r, "Accept", mediaTypeProjectsPreview) - fmt.Fprintf(w, `{"permission":"admin","user":{"login":"u"}}`) - }) - - ctx := context.Background() - ppl, _, err := client.Projects.ReviewProjectCollaboratorPermission(ctx, 1, "u") - if err != nil { - t.Errorf("Projects.ReviewProjectCollaboratorPermission returned error: %v", err) - } - - want := &ProjectPermissionLevel{ - Permission: Ptr("admin"), - User: &User{ - Login: Ptr("u"), - }, - } - - if !cmp.Equal(ppl, want) { - t.Errorf("Projects.ReviewProjectCollaboratorPermission returned %+v, want %+v", ppl, want) - } - - const methodName = "ReviewProjectCollaboratorPermission" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Projects.ReviewProjectCollaboratorPermission(ctx, -1, "\n") - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Projects.ReviewProjectCollaboratorPermission(ctx, 1, "u") - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestProjectOptions_Marshal(t *testing.T) { - t.Parallel() - testJSONMarshal(t, &ProjectOptions{}, "{}") - - u := &ProjectOptions{ - Name: Ptr("name"), - Body: Ptr("body"), - State: Ptr("state"), - OrganizationPermission: Ptr("op"), - Private: Ptr(false), - } - - want := `{ - "name": "name", - "body": "body", - "state": "state", - "organization_permission": "op", - "private": false - }` - - testJSONMarshal(t, u, want) -} - -func TestProjectColumn_Marshal(t *testing.T) { - t.Parallel() - testJSONMarshal(t, &ProjectColumn{}, "{}") - - u := &ProjectColumn{ - ID: Ptr(int64(1)), - Name: Ptr("name"), - URL: Ptr("url"), - ProjectURL: Ptr("purl"), - CardsURL: Ptr("curl"), - CreatedAt: &Timestamp{referenceTime}, - UpdatedAt: &Timestamp{referenceTime}, - NodeID: Ptr("onidp"), - } - - want := `{ - "id": 1, - "name": "name", - "url": "url", - "project_url": "purl", - "cards_url": "curl", - "created_at": ` + referenceTimeStr + `, - "updated_at": ` + referenceTimeStr + `, - "node_id": "onidp" - }` - - testJSONMarshal(t, u, want) -} - -func TestProjectColumnOptions_Marshal(t *testing.T) { - t.Parallel() - testJSONMarshal(t, &ProjectColumnOptions{}, "{}") - - u := &ProjectColumnOptions{ - Name: "name", - } - - want := `{ - "name": "name" - }` - - testJSONMarshal(t, u, want) -} - -func TestProjectColumnMoveOptions_Marshal(t *testing.T) { - t.Parallel() - testJSONMarshal(t, &ProjectColumnMoveOptions{}, "{}") - - u := &ProjectColumnMoveOptions{ - Position: "pos", - } - - want := `{ - "position": "pos" - }` - - testJSONMarshal(t, u, want) -} - -func TestProjectCard_Marshal(t *testing.T) { - t.Parallel() - testJSONMarshal(t, &ProjectCard{}, "{}") - - u := &ProjectCard{ - URL: Ptr("url"), - ColumnURL: Ptr("curl"), - ContentURL: Ptr("conurl"), - ID: Ptr(int64(1)), - Note: Ptr("note"), - Creator: &User{ - Login: Ptr("l"), - ID: Ptr(int64(1)), - URL: Ptr("u"), - AvatarURL: Ptr("a"), - GravatarID: Ptr("g"), - Name: Ptr("n"), - Company: Ptr("c"), - Blog: Ptr("b"), - Location: Ptr("l"), - Email: Ptr("e"), - Hireable: Ptr(true), - Bio: Ptr("b"), - TwitterUsername: Ptr("t"), - PublicRepos: Ptr(1), - Followers: Ptr(1), - Following: Ptr(1), - CreatedAt: &Timestamp{referenceTime}, - SuspendedAt: &Timestamp{referenceTime}, - }, - CreatedAt: &Timestamp{referenceTime}, - UpdatedAt: &Timestamp{referenceTime}, - NodeID: Ptr("nid"), - Archived: Ptr(true), - ColumnID: Ptr(int64(1)), - ProjectID: Ptr(int64(1)), - ProjectURL: Ptr("purl"), - ColumnName: Ptr("cn"), - PreviousColumnName: Ptr("pcn"), - } - - want := `{ - "url": "url", - "column_url": "curl", - "content_url": "conurl", - "id": 1, - "note": "note", - "creator": { - "login": "l", - "id": 1, - "avatar_url": "a", - "gravatar_id": "g", - "name": "n", - "company": "c", - "blog": "b", - "location": "l", - "email": "e", - "hireable": true, - "bio": "b", - "twitter_username": "t", - "public_repos": 1, - "followers": 1, - "following": 1, - "created_at": ` + referenceTimeStr + `, - "suspended_at": ` + referenceTimeStr + `, - "url": "u" - }, - "created_at": ` + referenceTimeStr + `, - "updated_at": ` + referenceTimeStr + `, - "node_id": "nid", - "archived": true, - "column_id": 1, - "project_id": 1, - "project_url": "purl", - "column_name": "cn", - "previous_column_name": "pcn" - }` - - testJSONMarshal(t, u, want) -} - -func TestProjectCardOptions_Marshal(t *testing.T) { - t.Parallel() - testJSONMarshal(t, &ProjectCardOptions{}, "{}") - - u := &ProjectCardOptions{ - Note: "note", - ContentID: 1, - ContentType: "ct", - Archived: Ptr(false), - } - - want := `{ - "note": "note", - "content_id": 1, - "content_type": "ct", - "archived": false - }` - - testJSONMarshal(t, u, want) -} - -func TestProjectCardMoveOptions_Marshal(t *testing.T) { - t.Parallel() - testJSONMarshal(t, &ProjectCardMoveOptions{}, "{}") - - u := &ProjectCardMoveOptions{ - Position: "pos", - ColumnID: 1, - } - - want := `{ - "position": "pos", - "column_id": 1 - }` - - testJSONMarshal(t, u, want) -} - -func TestProjectCollaboratorOptions_Marshal(t *testing.T) { - t.Parallel() - testJSONMarshal(t, &ProjectCollaboratorOptions{}, "{}") - - u := &ProjectCollaboratorOptions{ - Permission: Ptr("per"), - } - - want := `{ - "permission": "per" - }` - - testJSONMarshal(t, u, want) -} - -func TestProjectPermissionLevel_Marshal(t *testing.T) { - t.Parallel() - testJSONMarshal(t, &ProjectPermissionLevel{}, "{}") - - u := &ProjectPermissionLevel{ - Permission: Ptr("per"), - User: &User{ - Login: Ptr("l"), - ID: Ptr(int64(1)), - URL: Ptr("u"), - AvatarURL: Ptr("a"), - GravatarID: Ptr("g"), - Name: Ptr("n"), - Company: Ptr("c"), - Blog: Ptr("b"), - Location: Ptr("l"), - Email: Ptr("e"), - Hireable: Ptr(true), - Bio: Ptr("b"), - TwitterUsername: Ptr("t"), - PublicRepos: Ptr(1), - Followers: Ptr(1), - Following: Ptr(1), - CreatedAt: &Timestamp{referenceTime}, - SuspendedAt: &Timestamp{referenceTime}, - }, - } - - want := `{ - "permission": "per", - "user": { - "login": "l", - "id": 1, - "avatar_url": "a", - "gravatar_id": "g", - "name": "n", - "company": "c", - "blog": "b", - "location": "l", - "email": "e", - "hireable": true, - "bio": "b", - "twitter_username": "t", - "public_repos": 1, - "followers": 1, - "following": 1, - "created_at": ` + referenceTimeStr + `, - "suspended_at": ` + referenceTimeStr + `, - "url": "u" - } - }` - - testJSONMarshal(t, u, want) -} diff --git a/github/repos_hooks_deliveries_test.go b/github/repos_hooks_deliveries_test.go index b168964674b..5cdc66dfae2 100644 --- a/github/repos_hooks_deliveries_test.go +++ b/github/repos_hooks_deliveries_test.go @@ -174,9 +174,6 @@ var hookDeliveryPayloadTypeToStruct = map[string]interface{}{ "package": &PackageEvent{}, "page_build": &PageBuildEvent{}, "ping": &PingEvent{}, - "project": &ProjectEvent{}, - "project_card": &ProjectCardEvent{}, - "project_column": &ProjectColumnEvent{}, "projects_v2": &ProjectV2Event{}, "projects_v2_item": &ProjectV2ItemEvent{}, "public": &PublicEvent{}, diff --git a/github/repos_projects.go b/github/repos_projects.go deleted file mode 100644 index 9269d4e95c0..00000000000 --- a/github/repos_projects.go +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2017 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" -) - -// ProjectListOptions specifies the optional parameters to the -// OrganizationsService.ListProjects and RepositoriesService.ListProjects methods. -type ProjectListOptions struct { - // Indicates the state of the projects to return. Can be either open, closed, or all. Default: open - State string `url:"state,omitempty"` - - ListOptions -} - -// ListProjects lists the projects for a repo. -// -// GitHub API docs: https://docs.github.com/rest/projects/projects#list-repository-projects -// -//meta:operation GET /repos/{owner}/{repo}/projects -func (s *RepositoriesService) ListProjects(ctx context.Context, owner, repo string, opts *ProjectListOptions) ([]*Project, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/projects", owner, repo) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - var projects []*Project - resp, err := s.client.Do(ctx, req, &projects) - if err != nil { - return nil, resp, err - } - - return projects, resp, nil -} - -// CreateProject creates a GitHub Project for the specified repository. -// -// GitHub API docs: https://docs.github.com/rest/projects/projects#create-a-repository-project -// -//meta:operation POST /repos/{owner}/{repo}/projects -func (s *RepositoriesService) CreateProject(ctx context.Context, owner, repo string, opts *ProjectOptions) (*Project, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/projects", owner, repo) - req, err := s.client.NewRequest("POST", u, opts) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - project := &Project{} - resp, err := s.client.Do(ctx, req, project) - if err != nil { - return nil, resp, err - } - - return project, resp, nil -} diff --git a/github/repos_projects_test.go b/github/repos_projects_test.go deleted file mode 100644 index e81b93390fd..00000000000 --- a/github/repos_projects_test.go +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright 2017 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_ListProjects(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/repos/o/r/projects", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - testHeader(t, r, "Accept", mediaTypeProjectsPreview) - testFormValues(t, r, values{"page": "2"}) - fmt.Fprint(w, `[{"id":1}]`) - }) - - opt := &ProjectListOptions{ListOptions: ListOptions{Page: 2}} - ctx := context.Background() - projects, _, err := client.Repositories.ListProjects(ctx, "o", "r", opt) - if err != nil { - t.Errorf("Repositories.ListProjects returned error: %v", err) - } - - want := []*Project{{ID: Ptr(int64(1))}} - if !cmp.Equal(projects, want) { - t.Errorf("Repositories.ListProjects returned %+v, want %+v", projects, want) - } - - const methodName = "ListProjects" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.ListProjects(ctx, "\n", "\n", opt) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.ListProjects(ctx, "o", "r", opt) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestRepositoriesService_CreateProject(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - input := &ProjectOptions{Name: Ptr("Project Name"), Body: Ptr("Project body.")} - - mux.HandleFunc("/repos/o/r/projects", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "POST") - testHeader(t, r, "Accept", mediaTypeProjectsPreview) - - v := &ProjectOptions{} - assertNilError(t, json.NewDecoder(r.Body).Decode(v)) - if !cmp.Equal(v, input) { - t.Errorf("Request body = %+v, want %+v", v, input) - } - - fmt.Fprint(w, `{"id":1}`) - }) - - ctx := context.Background() - project, _, err := client.Repositories.CreateProject(ctx, "o", "r", input) - if err != nil { - t.Errorf("Repositories.CreateProject returned error: %v", err) - } - - want := &Project{ID: Ptr(int64(1))} - if !cmp.Equal(project, want) { - t.Errorf("Repositories.CreateProject returned %+v, want %+v", project, want) - } - - const methodName = "CreateProject" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.CreateProject(ctx, "\n", "\n", input) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.CreateProject(ctx, "o", "r", input) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} diff --git a/github/teams.go b/github/teams.go index 686ab9a3f8e..579e5b828b5 100644 --- a/github/teams.go +++ b/github/teams.go @@ -615,7 +615,7 @@ func (s *TeamsService) ListUserTeams(ctx context.Context, opts *ListOptions) ([] // GitHub API docs: https://docs.github.com/rest/teams/teams#list-team-projects // //meta:operation GET /orgs/{org}/teams/{team_slug}/projects -func (s *TeamsService) ListTeamProjectsByID(ctx context.Context, orgID, teamID int64) ([]*Project, *Response, error) { +func (s *TeamsService) ListTeamProjectsByID(ctx context.Context, orgID, teamID int64) ([]*ProjectV2, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/projects", orgID, teamID) req, err := s.client.NewRequest("GET", u, nil) @@ -626,7 +626,7 @@ func (s *TeamsService) ListTeamProjectsByID(ctx context.Context, orgID, teamID i // TODO: remove custom Accept header when this API fully launches. req.Header.Set("Accept", mediaTypeProjectsPreview) - var projects []*Project + var projects []*ProjectV2 resp, err := s.client.Do(ctx, req, &projects) if err != nil { return nil, resp, err @@ -640,7 +640,7 @@ func (s *TeamsService) ListTeamProjectsByID(ctx context.Context, orgID, teamID i // GitHub API docs: https://docs.github.com/rest/teams/teams#list-team-projects // //meta:operation GET /orgs/{org}/teams/{team_slug}/projects -func (s *TeamsService) ListTeamProjectsBySlug(ctx context.Context, org, slug string) ([]*Project, *Response, error) { +func (s *TeamsService) ListTeamProjectsBySlug(ctx context.Context, org, slug string) ([]*ProjectV2, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/projects", org, slug) req, err := s.client.NewRequest("GET", u, nil) @@ -651,7 +651,7 @@ func (s *TeamsService) ListTeamProjectsBySlug(ctx context.Context, org, slug str // TODO: remove custom Accept header when this API fully launches. req.Header.Set("Accept", mediaTypeProjectsPreview) - var projects []*Project + var projects []*ProjectV2 resp, err := s.client.Do(ctx, req, &projects) if err != nil { return nil, resp, err @@ -668,7 +668,7 @@ func (s *TeamsService) ListTeamProjectsBySlug(ctx context.Context, org, slug str // GitHub API docs: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project // //meta:operation GET /orgs/{org}/teams/{team_slug}/projects/{project_id} -func (s *TeamsService) ReviewTeamProjectsByID(ctx context.Context, orgID, teamID, projectID int64) (*Project, *Response, error) { +func (s *TeamsService) ReviewTeamProjectsByID(ctx context.Context, orgID, teamID, projectID int64) (*ProjectV2, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/projects/%v", orgID, teamID, projectID) req, err := s.client.NewRequest("GET", u, nil) if err != nil { @@ -678,7 +678,7 @@ func (s *TeamsService) ReviewTeamProjectsByID(ctx context.Context, orgID, teamID // TODO: remove custom Accept header when this API fully launches. req.Header.Set("Accept", mediaTypeProjectsPreview) - projects := &Project{} + projects := &ProjectV2{} resp, err := s.client.Do(ctx, req, &projects) if err != nil { return nil, resp, err @@ -693,7 +693,7 @@ func (s *TeamsService) ReviewTeamProjectsByID(ctx context.Context, orgID, teamID // GitHub API docs: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project // //meta:operation GET /orgs/{org}/teams/{team_slug}/projects/{project_id} -func (s *TeamsService) ReviewTeamProjectsBySlug(ctx context.Context, org, slug string, projectID int64) (*Project, *Response, error) { +func (s *TeamsService) ReviewTeamProjectsBySlug(ctx context.Context, org, slug string, projectID int64) (*ProjectV2, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/projects/%v", org, slug, projectID) req, err := s.client.NewRequest("GET", u, nil) if err != nil { @@ -703,7 +703,7 @@ func (s *TeamsService) ReviewTeamProjectsBySlug(ctx context.Context, org, slug s // TODO: remove custom Accept header when this API fully launches. req.Header.Set("Accept", mediaTypeProjectsPreview) - projects := &Project{} + projects := &ProjectV2{} resp, err := s.client.Do(ctx, req, &projects) if err != nil { return nil, resp, err diff --git a/github/teams_test.go b/github/teams_test.go index 34c5b2026b4..1e3d3da2980 100644 --- a/github/teams_test.go +++ b/github/teams_test.go @@ -1023,7 +1023,7 @@ func TestTeamsService_ListProjectsByID(t *testing.T) { t.Errorf("Teams.ListTeamProjectsByID returned error: %v", err) } - want := []*Project{{ID: Ptr(int64(1))}} + want := []*ProjectV2{{ID: Ptr(int64(1))}} if !cmp.Equal(projects, want) { t.Errorf("Teams.ListTeamProjectsByID returned %+v, want %+v", projects, want) } @@ -1059,7 +1059,7 @@ func TestTeamsService_ListProjectsBySlug(t *testing.T) { t.Errorf("Teams.ListTeamProjectsBySlug returned error: %v", err) } - want := []*Project{{ID: Ptr(int64(1))}} + want := []*ProjectV2{{ID: Ptr(int64(1))}} if !cmp.Equal(projects, want) { t.Errorf("Teams.ListTeamProjectsBySlug returned %+v, want %+v", projects, want) } @@ -1095,7 +1095,7 @@ func TestTeamsService_ReviewProjectsByID(t *testing.T) { t.Errorf("Teams.ReviewTeamProjectsByID returned error: %v", err) } - want := &Project{ID: Ptr(int64(1))} + want := &ProjectV2{ID: Ptr(int64(1))} if !cmp.Equal(project, want) { t.Errorf("Teams.ReviewTeamProjectsByID returned %+v, want %+v", project, want) } @@ -1131,7 +1131,7 @@ func TestTeamsService_ReviewProjectsBySlug(t *testing.T) { t.Errorf("Teams.ReviewTeamProjectsBySlug returned error: %v", err) } - want := &Project{ID: Ptr(int64(1))} + want := &ProjectV2{ID: Ptr(int64(1))} if !cmp.Equal(project, want) { t.Errorf("Teams.ReviewTeamProjectsBySlug returned %+v, want %+v", project, want) } diff --git a/github/users_projects.go b/github/users_projects.go deleted file mode 100644 index 0ab57e5c23c..00000000000 --- a/github/users_projects.go +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2019 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" -) - -// ListProjects lists the projects for the specified user. -// -// GitHub API docs: https://docs.github.com/rest/projects/projects#list-user-projects -// -//meta:operation GET /users/{username}/projects -func (s *UsersService) ListProjects(ctx context.Context, user string, opts *ProjectListOptions) ([]*Project, *Response, error) { - u := fmt.Sprintf("users/%v/projects", user) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - var projects []*Project - resp, err := s.client.Do(ctx, req, &projects) - if err != nil { - return nil, resp, err - } - - return projects, resp, nil -} - -// CreateUserProjectOptions specifies the parameters to the UsersService.CreateProject method. -type CreateUserProjectOptions struct { - // The name of the project. (Required.) - Name string `json:"name"` - // The description of the project. (Optional.) - Body *string `json:"body,omitempty"` -} - -// CreateProject creates a GitHub Project for the current user. -// -// GitHub API docs: https://docs.github.com/rest/projects/projects#create-a-user-project -// -//meta:operation POST /user/projects -func (s *UsersService) CreateProject(ctx context.Context, opts *CreateUserProjectOptions) (*Project, *Response, error) { - u := "user/projects" - req, err := s.client.NewRequest("POST", u, opts) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - project := &Project{} - resp, err := s.client.Do(ctx, req, project) - if err != nil { - return nil, resp, err - } - - return project, resp, nil -} diff --git a/github/users_projects_test.go b/github/users_projects_test.go deleted file mode 100644 index 215dc3ec98f..00000000000 --- a/github/users_projects_test.go +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright 2019 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 TestUsersService_ListProjects(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/users/u/projects", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - testHeader(t, r, "Accept", mediaTypeProjectsPreview) - testFormValues(t, r, values{"state": "open", "page": "2"}) - fmt.Fprint(w, `[{"id":1}]`) - }) - - opt := &ProjectListOptions{State: "open", ListOptions: ListOptions{Page: 2}} - ctx := context.Background() - projects, _, err := client.Users.ListProjects(ctx, "u", opt) - if err != nil { - t.Errorf("Users.ListProjects returned error: %v", err) - } - - want := []*Project{{ID: Ptr(int64(1))}} - if !cmp.Equal(projects, want) { - t.Errorf("Users.ListProjects returned %+v, want %+v", projects, want) - } - - const methodName = "ListProjects" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Users.ListProjects(ctx, "\n", opt) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Users.ListProjects(ctx, "u", opt) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestUsersService_CreateProject(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - input := &CreateUserProjectOptions{Name: "Project Name", Body: Ptr("Project body.")} - - mux.HandleFunc("/user/projects", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "POST") - testHeader(t, r, "Accept", mediaTypeProjectsPreview) - - v := &CreateUserProjectOptions{} - assertNilError(t, json.NewDecoder(r.Body).Decode(v)) - if !cmp.Equal(v, input) { - t.Errorf("Request body = %+v, want %+v", v, input) - } - - fmt.Fprint(w, `{"id":1}`) - }) - - ctx := context.Background() - project, _, err := client.Users.CreateProject(ctx, input) - if err != nil { - t.Errorf("Users.CreateProject returned error: %v", err) - } - - want := &Project{ID: Ptr(int64(1))} - if !cmp.Equal(project, want) { - t.Errorf("Users.CreateProject returned %+v, want %+v", project, want) - } - - const methodName = "CreateProject" - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Users.CreateProject(ctx, input) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestCreateUserProjectOptions_Marshal(t *testing.T) { - t.Parallel() - testJSONMarshal(t, &CreateUserProjectOptions{}, `{}`) - - c := CreateUserProjectOptions{ - Name: "SomeProject", - Body: Ptr("SomeProjectBody"), - } - - want := `{ - "name": "SomeProject", - "body": "SomeProjectBody" - }` - - testJSONMarshal(t, c, want) -} From c7f49d2dff936c94756f4ee15934dc969ddbf229 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Wed, 11 Dec 2024 16:04:01 +0200 Subject: [PATCH 590/751] chore: Remove commented out test code (#3381) --- .golangci.yml | 1 + github/codespaces_secrets_test.go | 40 ------------------------------- 2 files changed, 1 insertion(+), 40 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 89474e9be2b..17e42f8f1cb 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -25,6 +25,7 @@ linters-settings: gocritic: disable-all: true enabled-checks: + - commentedOutCode - commentFormatting gosec: excludes: diff --git a/github/codespaces_secrets_test.go b/github/codespaces_secrets_test.go index 9529143cee5..543e0651def 100644 --- a/github/codespaces_secrets_test.go +++ b/github/codespaces_secrets_test.go @@ -778,43 +778,3 @@ func TestCodespacesService_RemoveSelectedReposFromSecret(t *testing.T) { }) } } - -// func TestActionsService_ListSelectedReposForOrgSecret(t *testing.T) { -// client, mux, _ := setup(t) - -// mux.HandleFunc("/orgs/o/actions/secrets/NAME/repositories", func(w http.ResponseWriter, r *http.Request) { -// testMethod(t, r, "GET") -// fmt.Fprintf(w, `{"total_count":1,"repositories":[{"id":1}]}`) -// }) - -// opts := &ListOptions{Page: 2, PerPage: 2} -// ctx := context.Background() -// repos, _, err := client.Actions.ListSelectedReposForOrgSecret(ctx, "o", "NAME", opts) -// if err != nil { -// t.Errorf("Actions.ListSelectedReposForOrgSecret returned error: %v", err) -// } - -// want := &SelectedReposList{ -// TotalCount: Int(1), -// Repositories: []*Repository{ -// {ID: Int64(1)}, -// }, -// } -// if !cmp.Equal(repos, want) { -// t.Errorf("Actions.ListSelectedReposForOrgSecret returned %+v, want %+v", repos, want) -// } - -// const methodName = "ListSelectedReposForOrgSecret" -// testBadOptions(t, methodName, func() (err error) { -// _, _, err = client.Actions.ListSelectedReposForOrgSecret(ctx, "\n", "\n", opts) -// return err -// }) - -// testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { -// got, resp, err := client.Actions.ListSelectedReposForOrgSecret(ctx, "o", "NAME", opts) -// if got != nil { -// t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) -// } -// return resp, err -// }) -// } From 58ab8d3c875bbebaff2e76eb6b44c52c613d48e2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2024 20:42:41 -0500 Subject: [PATCH 591/751] build(deps): bump golang.org/x/crypto from 0.27.0 to 0.31.0 in /example in the go_modules group (#3383) --- example/go.mod | 10 +++++----- example/go.sum | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/example/go.mod b/example/go.mod index 2222cd7fd4e..4db4f3498db 100644 --- a/example/go.mod +++ b/example/go.mod @@ -10,8 +10,8 @@ require ( github.com/gofri/go-github-ratelimit v1.0.3 github.com/google/go-github/v67 v67.0.0 github.com/sigstore/sigstore-go v0.6.2 - golang.org/x/crypto v0.27.0 - golang.org/x/term v0.24.0 + golang.org/x/crypto v0.31.0 + golang.org/x/term v0.27.0 google.golang.org/appengine v1.6.8 ) @@ -90,9 +90,9 @@ require ( golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 // indirect golang.org/x/mod v0.20.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.25.0 // indirect - golang.org/x/text v0.18.0 // indirect + golang.org/x/sync v0.10.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/example/go.sum b/example/go.sum index 46aba6838b5..cb0a2fa390d 100644 --- a/example/go.sum +++ b/example/go.sum @@ -362,8 +362,8 @@ golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= -golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= +golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 h1:hNQpMuAJe5CtcUqCXaWga3FHu+kQvCqcsoVaQgSV60o= golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= @@ -385,8 +385,8 @@ golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbht golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= -golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -396,15 +396,15 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= -golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= +golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= +golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -413,8 +413,8 @@ golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= -golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= From 7bc4871e2ebbdf9e3494108a36f406271bc5a3ca Mon Sep 17 00:00:00 2001 From: Steve Hipwell Date: Thu, 12 Dec 2024 13:18:50 +0000 Subject: [PATCH 592/751] feat: Add enterprise custom properties (#3382) --- AUTHORS | 1 + github/enterprise_properties.go | 121 ++++++++++++ github/enterprise_properties_test.go | 278 +++++++++++++++++++++++++++ 3 files changed, 400 insertions(+) create mode 100644 github/enterprise_properties.go create mode 100644 github/enterprise_properties_test.go diff --git a/AUTHORS b/AUTHORS index 6e3c5035f63..a6104ffa9aa 100644 --- a/AUTHORS +++ b/AUTHORS @@ -481,6 +481,7 @@ SoundCloud, Ltd. Sridhar Mocherla SriVignessh Pss Stefan Sedich +Steve Hipwell Steve Teuber Stian Eikeland Suhaib Mujahid diff --git a/github/enterprise_properties.go b/github/enterprise_properties.go new file mode 100644 index 00000000000..bc5ab55a3a6 --- /dev/null +++ b/github/enterprise_properties.go @@ -0,0 +1,121 @@ +// Copyright 2024 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" +) + +// GetAllCustomProperties gets all custom properties that are defined for the specified enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties#get-custom-properties-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/properties/schema +func (s *EnterpriseService) GetAllCustomProperties(ctx context.Context, enterprise string) ([]*CustomProperty, *Response, error) { + u := fmt.Sprintf("enterprises/%v/properties/schema", enterprise) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var customProperties []*CustomProperty + resp, err := s.client.Do(ctx, req, &customProperties) + if err != nil { + return nil, resp, err + } + + return customProperties, resp, nil +} + +// CreateOrUpdateCustomProperties creates new or updates existing custom properties that are defined for the specified enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties#create-or-update-custom-properties-for-an-enterprise +// +//meta:operation PATCH /enterprises/{enterprise}/properties/schema +func (s *EnterpriseService) CreateOrUpdateCustomProperties(ctx context.Context, enterprise string, properties []*CustomProperty) ([]*CustomProperty, *Response, error) { + u := fmt.Sprintf("enterprises/%v/properties/schema", enterprise) + + params := struct { + Properties []*CustomProperty `json:"properties"` + }{ + Properties: properties, + } + + req, err := s.client.NewRequest("PATCH", u, params) + if err != nil { + return nil, nil, err + } + + var customProperties []*CustomProperty + resp, err := s.client.Do(ctx, req, &customProperties) + if err != nil { + return nil, resp, err + } + + return customProperties, resp, nil +} + +// GetCustomProperty gets a custom property that is defined for the specified enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties#get-a-custom-property-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/properties/schema/{custom_property_name} +func (s *EnterpriseService) GetCustomProperty(ctx context.Context, enterprise, customPropertyName string) (*CustomProperty, *Response, error) { + u := fmt.Sprintf("enterprises/%v/properties/schema/%v", enterprise, customPropertyName) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var customProperty *CustomProperty + resp, err := s.client.Do(ctx, req, &customProperty) + if err != nil { + return nil, resp, err + } + + return customProperty, resp, nil +} + +// CreateOrUpdateCustomProperty creates a new or updates an existing custom property that is defined for the specified enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties#create-or-update-a-custom-property-for-an-enterprise +// +//meta:operation PUT /enterprises/{enterprise}/properties/schema/{custom_property_name} +func (s *EnterpriseService) CreateOrUpdateCustomProperty(ctx context.Context, enterprise, customPropertyName string, property *CustomProperty) (*CustomProperty, *Response, error) { + u := fmt.Sprintf("enterprises/%v/properties/schema/%v", enterprise, customPropertyName) + + req, err := s.client.NewRequest("PUT", u, property) + if err != nil { + return nil, nil, err + } + + var customProperty *CustomProperty + resp, err := s.client.Do(ctx, req, &customProperty) + if err != nil { + return nil, resp, err + } + + return customProperty, resp, nil +} + +// RemoveCustomProperty removes a custom property that is defined for the specified enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties#remove-a-custom-property-for-an-enterprise +// +//meta:operation DELETE /enterprises/{enterprise}/properties/schema/{custom_property_name} +func (s *EnterpriseService) RemoveCustomProperty(ctx context.Context, enterprise, customPropertyName string) (*Response, error) { + u := fmt.Sprintf("enterprises/%v/properties/schema/%v", enterprise, customPropertyName) + + 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/enterprise_properties_test.go b/github/enterprise_properties_test.go new file mode 100644 index 00000000000..4f44d60f217 --- /dev/null +++ b/github/enterprise_properties_test.go @@ -0,0 +1,278 @@ +// Copyright 2024 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 TestEnterpriseService_GetAllCustomProperties(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/enterprises/e/properties/schema", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `[ + { + "property_name": "name", + "value_type": "single_select", + "required": true, + "default_value": "production", + "description": "Prod or dev environment", + "allowed_values":[ + "production", + "development" + ], + "values_editable_by": "org_actors" + }, + { + "property_name": "service", + "value_type": "string" + }, + { + "property_name": "team", + "value_type": "string", + "description": "Team owning the repository" + } + ]`) + }) + + ctx := context.Background() + properties, _, err := client.Enterprise.GetAllCustomProperties(ctx, "e") + if err != nil { + t.Errorf("Enterprise.GetAllCustomProperties returned error: %v", err) + } + + want := []*CustomProperty{ + { + PropertyName: Ptr("name"), + ValueType: "single_select", + Required: Ptr(true), + DefaultValue: Ptr("production"), + Description: Ptr("Prod or dev environment"), + AllowedValues: []string{"production", "development"}, + ValuesEditableBy: Ptr("org_actors"), + }, + { + PropertyName: Ptr("service"), + ValueType: "string", + }, + { + PropertyName: Ptr("team"), + ValueType: "string", + Description: Ptr("Team owning the repository"), + }, + } + if !cmp.Equal(properties, want) { + t.Errorf("Enterprise.GetAllCustomProperties returned %+v, want %+v", properties, want) + } + + const methodName = "GetAllCustomProperties" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.GetAllCustomProperties(ctx, "e") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_CreateOrUpdateCustomProperties(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/enterprises/e/properties/schema", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PATCH") + testBody(t, r, `{"properties":[{"property_name":"name","value_type":"single_select","required":true},{"property_name":"service","value_type":"string"}]}`+"\n") + fmt.Fprint(w, `[ + { + "property_name": "name", + "value_type": "single_select", + "required": true + }, + { + "property_name": "service", + "value_type": "string" + } + ]`) + }) + + ctx := context.Background() + properties, _, err := client.Enterprise.CreateOrUpdateCustomProperties(ctx, "e", []*CustomProperty{ + { + PropertyName: Ptr("name"), + ValueType: "single_select", + Required: Ptr(true), + }, + { + PropertyName: Ptr("service"), + ValueType: "string", + }, + }) + if err != nil { + t.Errorf("Enterprise.CreateOrUpdateCustomProperties returned error: %v", err) + } + + want := []*CustomProperty{ + { + PropertyName: Ptr("name"), + ValueType: "single_select", + Required: Ptr(true), + }, + { + PropertyName: Ptr("service"), + ValueType: "string", + }, + } + + if !cmp.Equal(properties, want) { + t.Errorf("Enterprise.CreateOrUpdateCustomProperties returned %+v, want %+v", properties, want) + } + + const methodName = "CreateOrUpdateCustomProperties" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.CreateOrUpdateCustomProperties(ctx, "e", nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_GetCustomProperty(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/enterprises/e/properties/schema/name", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "property_name": "name", + "value_type": "single_select", + "required": true, + "default_value": "production", + "description": "Prod or dev environment", + "allowed_values":[ + "production", + "development" + ], + "values_editable_by": "org_actors" + }`) + }) + + ctx := context.Background() + property, _, err := client.Enterprise.GetCustomProperty(ctx, "e", "name") + if err != nil { + t.Errorf("Enterprise.GetCustomProperty returned error: %v", err) + } + + want := &CustomProperty{ + PropertyName: Ptr("name"), + ValueType: "single_select", + Required: Ptr(true), + DefaultValue: Ptr("production"), + Description: Ptr("Prod or dev environment"), + AllowedValues: []string{"production", "development"}, + ValuesEditableBy: Ptr("org_actors"), + } + if !cmp.Equal(property, want) { + t.Errorf("Enterprise.GetCustomProperty returned %+v, want %+v", property, want) + } + + const methodName = "GetCustomProperty" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.GetCustomProperty(ctx, "e", "name") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_CreateOrUpdateCustomProperty(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/enterprises/e/properties/schema/name", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + fmt.Fprint(w, `{ + "property_name": "name", + "value_type": "single_select", + "required": true, + "default_value": "production", + "description": "Prod or dev environment", + "allowed_values":[ + "production", + "development" + ], + "values_editable_by": "org_actors" + }`) + }) + + ctx := context.Background() + property, _, err := client.Enterprise.CreateOrUpdateCustomProperty(ctx, "e", "name", &CustomProperty{ + ValueType: "single_select", + Required: Ptr(true), + DefaultValue: Ptr("production"), + Description: Ptr("Prod or dev environment"), + AllowedValues: []string{"production", "development"}, + ValuesEditableBy: Ptr("org_actors"), + }) + if err != nil { + t.Errorf("Enterprise.CreateOrUpdateCustomProperty returned error: %v", err) + } + + want := &CustomProperty{ + PropertyName: Ptr("name"), + ValueType: "single_select", + Required: Ptr(true), + DefaultValue: Ptr("production"), + Description: Ptr("Prod or dev environment"), + AllowedValues: []string{"production", "development"}, + ValuesEditableBy: Ptr("org_actors"), + } + if !cmp.Equal(property, want) { + t.Errorf("Enterprise.CreateOrUpdateCustomProperty returned %+v, want %+v", property, want) + } + + const methodName = "CreateOrUpdateCustomProperty" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.CreateOrUpdateCustomProperty(ctx, "e", "name", nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_RemoveCustomProperty(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/enterprises/e/properties/schema/name", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + }) + + ctx := context.Background() + _, err := client.Enterprise.RemoveCustomProperty(ctx, "e", "name") + if err != nil { + t.Errorf("Enterprise.RemoveCustomProperty returned error: %v", err) + } + + const methodName = "RemoveCustomProperty" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Enterprise.RemoveCustomProperty(ctx, "e", "name") + }) +} From 7beb0aa9e5742e5bf549bb98a055d012d5c0a115 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Mon, 16 Dec 2024 19:02:50 +0200 Subject: [PATCH 593/751] Change header keys to be canonical (#3389) --- .golangci.yml | 1 + github/github.go | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 17e42f8f1cb..52d2e04ddf8 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -4,6 +4,7 @@ run: timeout: 10m linters: enable: + - canonicalheader - dogsled - dupl - gocritic diff --git a/github/github.go b/github/github.go index 7cdd73eb25e..7069a18e053 100644 --- a/github/github.go +++ b/github/github.go @@ -35,14 +35,14 @@ const ( defaultUserAgent = "go-github" + "/" + Version uploadBaseURL = "https://uploads.github.com/" - headerAPIVersion = "X-GitHub-Api-Version" - headerRateLimit = "X-RateLimit-Limit" - headerRateRemaining = "X-RateLimit-Remaining" - headerRateReset = "X-RateLimit-Reset" - headerOTP = "X-GitHub-OTP" + headerAPIVersion = "X-Github-Api-Version" + headerRateLimit = "X-Ratelimit-Limit" + headerRateRemaining = "X-Ratelimit-Remaining" + headerRateReset = "X-Ratelimit-Reset" + headerOTP = "X-Github-Otp" headerRetryAfter = "Retry-After" - headerTokenExpiration = "GitHub-Authentication-Token-Expiration" + headerTokenExpiration = "Github-Authentication-Token-Expiration" mediaTypeV3 = "application/vnd.github.v3+json" defaultMediaType = "application/octet-stream" From 232522b3119110817240727035b989cb0fa92d88 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Mon, 16 Dec 2024 20:13:55 +0200 Subject: [PATCH 594/751] chore: Sort std imports (#3390) --- .golangci.yml | 1 + github/orgs_codesecurity_configurations_test.go | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 52d2e04ddf8..3f81e7f73e1 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -7,6 +7,7 @@ linters: - canonicalheader - dogsled - dupl + - gci - gocritic - godot - gofmt diff --git a/github/orgs_codesecurity_configurations_test.go b/github/orgs_codesecurity_configurations_test.go index 97dc058d841..ef916efbffd 100644 --- a/github/orgs_codesecurity_configurations_test.go +++ b/github/orgs_codesecurity_configurations_test.go @@ -7,12 +7,11 @@ package github import ( "context" + "encoding/json" "fmt" "net/http" "reflect" "testing" - - "encoding/json" ) func TestOrganizationsService_GetCodeSecurityConfigurations(t *testing.T) { From c4a49db9ca5d5f737f459fa97e3b86c52339b978 Mon Sep 17 00:00:00 2001 From: Jason Brill Date: Tue, 17 Dec 2024 13:39:27 -0500 Subject: [PATCH 595/751] feat: Document review request events in `Timeline` struct (#3391) --- github/issues_timeline.go | 8 ++++ github/issues_timeline_test.go | 88 ++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) diff --git a/github/issues_timeline.go b/github/issues_timeline.go index ffd9b6fecfc..903f5b89c34 100644 --- a/github/issues_timeline.go +++ b/github/issues_timeline.go @@ -97,6 +97,14 @@ type Timeline struct { // reviewed // The pull request was reviewed. // + // review_requested + // The actor requested a review from a user or team. + // Reviewer and Requester/RequestedTeam will be populated. + // + // review_request_removed + // The actor removed a review request from a user or team. + // Reviewer and Requester/RequestedTeam will be populated. + // // subscribed // The actor subscribed to receive notifications for an issue. // diff --git a/github/issues_timeline_test.go b/github/issues_timeline_test.go index 1e88f500d99..ed7649489e2 100644 --- a/github/issues_timeline_test.go +++ b/github/issues_timeline_test.go @@ -255,3 +255,91 @@ func TestTimeline_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestTimeline_ReviewRequests(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/repos/example-org/example-repo/issues/3/timeline", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `[{ + "id": 1234567890, + "url": "http://example.com/timeline/1", + "actor": { + "login": "actor-user", + "id": 1 + }, + "event": "review_requested", + "created_at": "2006-01-02T15:04:05Z", + "requested_reviewer": { + "login": "reviewer-user", + "id": 2 + }, + "review_requester": { + "login": "requester-user", + "id": 1 + } + }, + { + "id": 1234567891, + "url": "http://example.com/timeline/2", + "actor": { + "login": "actor-user", + "id": 1 + }, + "event": "review_request_removed", + "created_at": "2006-01-02T15:04:05Z", + "requested_reviewer": { + "login": "reviewer-user", + "id": 2 + } + }]`) + }) + + ctx := context.Background() + events, _, err := client.Issues.ListIssueTimeline(ctx, "example-org", "example-repo", 3, nil) + if err != nil { + t.Errorf("Issues.ListIssueTimeline returned error: %v", err) + } + + want := []*Timeline{ + { + ID: Ptr(int64(1234567890)), + URL: Ptr("http://example.com/timeline/1"), + Actor: &User{ + Login: Ptr("actor-user"), + ID: Ptr(int64(1)), + }, + Event: Ptr("review_requested"), + CreatedAt: &Timestamp{referenceTime}, + Reviewer: &User{ + Login: Ptr("reviewer-user"), + ID: Ptr(int64(2)), + }, + Requester: &User{ + Login: Ptr("requester-user"), + ID: Ptr(int64(1)), + }, + }, + { + ID: Ptr(int64(1234567891)), + URL: Ptr("http://example.com/timeline/2"), + Actor: &User{ + Login: Ptr("actor-user"), + ID: Ptr(int64(1)), + }, + Event: Ptr("review_request_removed"), + CreatedAt: &Timestamp{referenceTime}, + Reviewer: &User{ + Login: Ptr("reviewer-user"), + ID: Ptr(int64(2)), + }, + }, + } + + if !cmp.Equal(events, want) { + t.Errorf("Issues.ListIssueTimeline review request events = %+v, want %+v", events, want) + diff := cmp.Diff(events, want) + t.Errorf("Difference: %s", diff) + } +} From 3c06fc105fea5cd7216af67c1455620c8689ff1e Mon Sep 17 00:00:00 2001 From: Alexis Couvreur Date: Wed, 18 Dec 2024 12:27:11 -0500 Subject: [PATCH 596/751] fix!: Remove unused `Stats` field from `Commit` struct (#3395) BREAKING CHANGE: The unused `Stats` field is removed from the `Commit` struct. Fixes: #3394. --- github/git_commits.go | 1 - github/git_commits_test.go | 10 ---------- github/github-accessors.go | 8 -------- github/github-accessors_test.go | 8 -------- github/github-stringify_test.go | 3 +-- github/repos_commits_test.go | 10 ---------- github/repos_contents_test.go | 10 ---------- 7 files changed, 1 insertion(+), 49 deletions(-) diff --git a/github/git_commits.go b/github/git_commits.go index fdb3d26ceab..d7ed3ecbec5 100644 --- a/github/git_commits.go +++ b/github/git_commits.go @@ -49,7 +49,6 @@ type Commit struct { Message *string `json:"message,omitempty"` Tree *Tree `json:"tree,omitempty"` Parents []*Commit `json:"parents,omitempty"` - Stats *CommitStats `json:"stats,omitempty"` HTMLURL *string `json:"html_url,omitempty"` URL *string `json:"url,omitempty"` Verification *SignatureVerification `json:"verification,omitempty"` diff --git a/github/git_commits_test.go b/github/git_commits_test.go index a58a4d98a1f..f0ad44b6a64 100644 --- a/github/git_commits_test.go +++ b/github/git_commits_test.go @@ -71,11 +71,6 @@ func TestCommit_Marshal(t *testing.T) { Truncated: Ptr(false), }, Parents: nil, - Stats: &CommitStats{ - Additions: Ptr(1), - Deletions: Ptr(1), - Total: Ptr(1), - }, HTMLURL: Ptr("h"), URL: Ptr("u"), Verification: &SignatureVerification{ @@ -118,11 +113,6 @@ func TestCommit_Marshal(t *testing.T) { ], "truncated": false }, - "stats": { - "additions": 1, - "deletions": 1, - "total": 1 - }, "html_url": "h", "url": "u", "verification": { diff --git a/github/github-accessors.go b/github/github-accessors.go index 2d17414064f..0800c02c6c4 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -3542,14 +3542,6 @@ func (c *Commit) GetSHA() string { return *c.SHA } -// GetStats returns the Stats field. -func (c *Commit) GetStats() *CommitStats { - if c == nil { - return nil - } - return c.Stats -} - // GetTree returns the Tree field. func (c *Commit) GetTree() *Tree { if c == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 3cf970d33f2..4b5c9dcb263 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -4614,14 +4614,6 @@ func TestCommit_GetSHA(tt *testing.T) { c.GetSHA() } -func TestCommit_GetStats(tt *testing.T) { - tt.Parallel() - c := &Commit{} - c.GetStats() - c = nil - c.GetStats() -} - func TestCommit_GetTree(tt *testing.T) { tt.Parallel() c := &Commit{} diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index e9d8f29d061..6fda6a907c7 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -283,14 +283,13 @@ func TestCommit_String(t *testing.T) { Committer: &CommitAuthor{}, Message: Ptr(""), Tree: &Tree{}, - Stats: &CommitStats{}, HTMLURL: Ptr(""), URL: Ptr(""), Verification: &SignatureVerification{}, NodeID: Ptr(""), CommentCount: Ptr(0), } - want := `github.Commit{SHA:"", Author:github.CommitAuthor{}, Committer:github.CommitAuthor{}, Message:"", Tree:github.Tree{}, Stats:github.CommitStats{}, HTMLURL:"", URL:"", Verification:github.SignatureVerification{}, NodeID:"", CommentCount:0}` + want := `github.Commit{SHA:"", Author:github.CommitAuthor{}, Committer:github.CommitAuthor{}, Message:"", Tree:github.Tree{}, HTMLURL:"", URL:"", Verification:github.SignatureVerification{}, NodeID:"", CommentCount:0}` if got := v.String(); got != want { t.Errorf("Commit.String = %v, want %v", got, want) } diff --git a/github/repos_commits_test.go b/github/repos_commits_test.go index fb99a75a614..eba7e7520ad 100644 --- a/github/repos_commits_test.go +++ b/github/repos_commits_test.go @@ -714,11 +714,6 @@ func TestBranchCommit_Marshal(t *testing.T) { Truncated: Ptr(false), }, Parents: nil, - Stats: &CommitStats{ - Additions: Ptr(1), - Deletions: Ptr(1), - Total: Ptr(1), - }, HTMLURL: Ptr("h"), URL: Ptr("u"), Verification: &SignatureVerification{ @@ -765,11 +760,6 @@ func TestBranchCommit_Marshal(t *testing.T) { ], "truncated": false }, - "stats": { - "additions": 1, - "deletions": 1, - "total": 1 - }, "html_url": "h", "url": "u", "verification": { diff --git a/github/repos_contents_test.go b/github/repos_contents_test.go index b50e32fc30c..e75a00e6d5c 100644 --- a/github/repos_contents_test.go +++ b/github/repos_contents_test.go @@ -894,11 +894,6 @@ func TestRepositoryContentResponse_Marshal(t *testing.T) { Truncated: Ptr(false), }, Parents: nil, - Stats: &CommitStats{ - Additions: Ptr(1), - Deletions: Ptr(1), - Total: Ptr(1), - }, HTMLURL: Ptr("h"), URL: Ptr("u"), Verification: &SignatureVerification{ @@ -958,11 +953,6 @@ func TestRepositoryContentResponse_Marshal(t *testing.T) { ], "truncated": false }, - "stats": { - "additions": 1, - "deletions": 1, - "total": 1 - }, "html_url": "h", "url": "u", "verification": { From b0a5e6017ff6a6c04ed3f2733eef71a700b54574 Mon Sep 17 00:00:00 2001 From: Mike Ball Date: Sun, 22 Dec 2024 10:15:30 -0500 Subject: [PATCH 597/751] fix: DownloadReleaseAsset handles renamed repository (#3392) Fixes: #3081. --- github/repos_releases.go | 9 ++++--- github/repos_releases_test.go | 46 +++++++++++++++++++++++++++++++++-- 2 files changed, 49 insertions(+), 6 deletions(-) diff --git a/github/repos_releases.go b/github/repos_releases.go index 7231db6d9ea..6023f632716 100644 --- a/github/repos_releases.go +++ b/github/repos_releases.go @@ -333,9 +333,10 @@ func (s *RepositoriesService) GetReleaseAsset(ctx context.Context, owner, repo s // of the io.ReadCloser. Exactly one of rc and redirectURL will be zero. // // followRedirectsClient can be passed to download the asset from a redirected -// location. Passing http.DefaultClient is recommended unless special circumstances -// exist, but it's possible to pass any http.Client. If nil is passed the -// redirectURL will be returned instead. +// location. Specifying any http.Client is possible, but passing http.DefaultClient +// is recommended, except when the specified repository is private, in which case +// it's necessary to pass an http.Client that performs authenticated requests. +// If nil is passed the redirectURL will be returned instead. // // GitHub API docs: https://docs.github.com/rest/releases/assets#get-a-release-asset // @@ -387,7 +388,7 @@ func (s *RepositoriesService) downloadReleaseAssetFromURL(ctx context.Context, f return nil, err } req = withContext(ctx, req) - req.Header.Set("Accept", "*/*") + req.Header.Set("Accept", defaultMediaType) resp, err := followRedirectsClient.Do(req) if err != nil { return nil, err diff --git a/github/repos_releases_test.go b/github/repos_releases_test.go index 7c9b9e96bab..011e8cf67bf 100644 --- a/github/repos_releases_test.go +++ b/github/repos_releases_test.go @@ -489,7 +489,7 @@ func TestRepositoriesService_DownloadReleaseAsset_FollowRedirect(t *testing.T) { }) mux.HandleFunc("/yo", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", "*/*") + testHeader(t, r, "Accept", defaultMediaType) w.Header().Set("Content-Type", "application/octet-stream") w.Header().Set("Content-Disposition", "attachment; filename=hello-world.txt") fmt.Fprint(w, "Hello World") @@ -511,6 +511,48 @@ func TestRepositoriesService_DownloadReleaseAsset_FollowRedirect(t *testing.T) { } } +func TestRepositoriesService_DownloadReleaseAsset_FollowMultipleRedirects(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/repos/o/r/releases/assets/1", func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=utf-8") + testMethod(t, r, "GET") + testHeader(t, r, "Accept", defaultMediaType) + // /yo, below will be served as baseURLPath/yo + http.Redirect(w, r, baseURLPath+"/yo", http.StatusMovedPermanently) + }) + mux.HandleFunc("/yo", func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "text/html;charset=utf-8") + testMethod(t, r, "GET") + testHeader(t, r, "Accept", defaultMediaType) + // /yo2, below will be served as baseURLPath/yo2 + http.Redirect(w, r, baseURLPath+"/yo2", http.StatusFound) + }) + mux.HandleFunc("/yo2", func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/octet-stream") + w.Header().Set("Content-Disposition", "attachment; filename=hello-world.txt") + testMethod(t, r, "GET") + testHeader(t, r, "Accept", defaultMediaType) + fmt.Fprint(w, "Hello World") + }) + + ctx := context.Background() + reader, _, err := client.Repositories.DownloadReleaseAsset(ctx, "o", "r", 1, http.DefaultClient) + if err != nil { + t.Errorf("Repositories.DownloadReleaseAsset returned error: %v", err) + } + content, err := io.ReadAll(reader) + if err != nil { + t.Errorf("Reading Repositories.DownloadReleaseAsset returned error: %v", err) + } + reader.Close() + want := []byte("Hello World") + if !bytes.Equal(want, content) { + t.Errorf("Repositories.DownloadReleaseAsset returned %+v, want %+v", content, want) + } +} + func TestRepositoriesService_DownloadReleaseAsset_FollowRedirectToError(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -523,7 +565,7 @@ func TestRepositoriesService_DownloadReleaseAsset_FollowRedirectToError(t *testi }) mux.HandleFunc("/yo", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", "*/*") + testHeader(t, r, "Accept", defaultMediaType) w.WriteHeader(http.StatusNotFound) }) From 98d4f502e28c1de670e319f18a219cfe98dfe4cd Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Mon, 23 Dec 2024 06:41:13 -0500 Subject: [PATCH 598/751] Bump version of go-github to v68.0.0 (#3397) --- README.md | 18 +++++++++--------- example/actionpermissions/main.go | 2 +- example/appengine/app.go | 2 +- example/basicauth/main.go | 2 +- .../newreposecretwithxcrypto/main.go | 2 +- .../newusersecretwithxcrypto/main.go | 2 +- example/commitpr/main.go | 2 +- example/go.mod | 6 +++--- example/listenvironments/main.go | 2 +- example/migrations/main.go | 2 +- example/newfilewithappauth/main.go | 2 +- example/newrepo/main.go | 2 +- example/newreposecretwithlibsodium/go.mod | 4 ++-- example/newreposecretwithlibsodium/main.go | 2 +- example/newreposecretwithxcrypto/main.go | 2 +- example/ratelimit/main.go | 2 +- example/simple/main.go | 2 +- example/tokenauth/main.go | 2 +- example/topics/main.go | 2 +- example/verifyartifact/main.go | 2 +- github/doc.go | 2 +- github/examples_test.go | 2 +- github/github.go | 2 +- go.mod | 2 +- test/fields/fields.go | 2 +- test/integration/activity_test.go | 2 +- test/integration/authorizations_test.go | 2 +- test/integration/github_test.go | 2 +- test/integration/repos_test.go | 2 +- test/integration/users_test.go | 2 +- tools/go.mod | 4 ++-- tools/metadata/main.go | 2 +- tools/metadata/main_test.go | 2 +- tools/metadata/metadata.go | 2 +- tools/metadata/openapi.go | 2 +- 35 files changed, 47 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index ec360fba2dc..1ed60695bfb 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-github # [![go-github release (latest SemVer)](https://img.shields.io/github/v/release/google/go-github?sort=semver)](https://github.com/google/go-github/releases) -[![Go Reference](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v67/github) +[![Go Reference](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v68/github) [![Test Status](https://github.com/google/go-github/workflows/tests/badge.svg)](https://github.com/google/go-github/actions?query=workflow%3Atests) [![Test Coverage](https://codecov.io/gh/google/go-github/branch/master/graph/badge.svg)](https://codecov.io/gh/google/go-github) [![Discuss at go-github@googlegroups.com](https://img.shields.io/badge/discuss-go--github%40googlegroups.com-blue.svg)](https://groups.google.com/group/go-github) @@ -25,7 +25,7 @@ If you're interested in using the [GraphQL API v4][], the recommended library is go-github is compatible with modern Go releases in module mode, with Go installed: ```bash -go get github.com/google/go-github/v67 +go get github.com/google/go-github/v68 ``` will resolve and add the package to the current development module, along with its dependencies. @@ -33,7 +33,7 @@ will resolve and add the package to the current development module, along with i Alternatively the same can be achieved if you use import in a package: ```go -import "github.com/google/go-github/v67/github" +import "github.com/google/go-github/v68/github" ``` and run `go get` without parameters. @@ -41,13 +41,13 @@ and run `go get` without parameters. Finally, to use the top-of-trunk version of this repo, use the following command: ```bash -go get github.com/google/go-github/v67@master +go get github.com/google/go-github/v68@master ``` ## Usage ## ```go -import "github.com/google/go-github/v67/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) +import "github.com/google/go-github/v68/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled ``` @@ -120,7 +120,7 @@ import ( "net/http" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" ) func main() { @@ -154,7 +154,7 @@ import ( "os" "strconv" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" "github.com/jferrl/go-githubauth" "golang.org/x/oauth2" ) @@ -362,7 +362,7 @@ For complete usage of go-github, see the full [package docs][]. [GitHub API v3]: https://docs.github.com/en/rest [personal access token]: https://github.com/blog/1509-personal-api-tokens -[package docs]: https://pkg.go.dev/github.com/google/go-github/v67/github +[package docs]: https://pkg.go.dev/github.com/google/go-github/v68/github [GraphQL API v4]: https://developer.github.com/v4/ [shurcooL/githubv4]: https://github.com/shurcooL/githubv4 [GitHub webhook events]: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads @@ -436,7 +436,7 @@ Versions prior to 48.2.0 are not listed. | go-github Version | GitHub v3 API Version | | ----------------- | --------------------- | -| 67.0.0 | 2022-11-28 | +| 68.0.0 | 2022-11-28 | | ... | 2022-11-28 | | 48.2.0 | 2022-11-28 | diff --git a/example/actionpermissions/main.go b/example/actionpermissions/main.go index 082465e0edc..6a263a6228c 100644 --- a/example/actionpermissions/main.go +++ b/example/actionpermissions/main.go @@ -14,7 +14,7 @@ import ( "log" "os" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" ) var ( diff --git a/example/appengine/app.go b/example/appengine/app.go index 94299d593fa..fe2867ce6f1 100644 --- a/example/appengine/app.go +++ b/example/appengine/app.go @@ -12,7 +12,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" "google.golang.org/appengine" "google.golang.org/appengine/log" ) diff --git a/example/basicauth/main.go b/example/basicauth/main.go index 8bae18e7a1b..1a00941b6e9 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -21,7 +21,7 @@ import ( "os" "strings" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" "golang.org/x/term" ) diff --git a/example/codespaces/newreposecretwithxcrypto/main.go b/example/codespaces/newreposecretwithxcrypto/main.go index 4f5821ef4b9..485e5b4db26 100644 --- a/example/codespaces/newreposecretwithxcrypto/main.go +++ b/example/codespaces/newreposecretwithxcrypto/main.go @@ -37,7 +37,7 @@ import ( "log" "os" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/codespaces/newusersecretwithxcrypto/main.go b/example/codespaces/newusersecretwithxcrypto/main.go index 4d3567f40b1..b20fc3af888 100644 --- a/example/codespaces/newusersecretwithxcrypto/main.go +++ b/example/codespaces/newusersecretwithxcrypto/main.go @@ -38,7 +38,7 @@ import ( "log" "os" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index 9928b59b42c..b707f846458 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -33,7 +33,7 @@ import ( "time" "github.com/ProtonMail/go-crypto/openpgp" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" ) var ( diff --git a/example/go.mod b/example/go.mod index 4db4f3498db..25cfccfaee5 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v67/example +module github.com/google/go-github/v68/example go 1.22.5 @@ -8,7 +8,7 @@ require ( github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-ratelimit v1.0.3 - github.com/google/go-github/v67 v67.0.0 + github.com/google/go-github/v68 v68.0.0 github.com/sigstore/sigstore-go v0.6.2 golang.org/x/crypto v0.31.0 golang.org/x/term v0.27.0 @@ -101,4 +101,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v67 => ../ +replace github.com/google/go-github/v68 => ../ diff --git a/example/listenvironments/main.go b/example/listenvironments/main.go index 7de29753e05..ebe60ffe225 100644 --- a/example/listenvironments/main.go +++ b/example/listenvironments/main.go @@ -18,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" ) func main() { diff --git a/example/migrations/main.go b/example/migrations/main.go index 5c3fc40ad11..07e3cbb67ec 100644 --- a/example/migrations/main.go +++ b/example/migrations/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" ) func fetchAllUserMigrations() ([]*github.UserMigration, error) { diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index e5fad2680c5..adb6fd2f238 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -16,7 +16,7 @@ import ( "time" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" ) func main() { diff --git a/example/newrepo/main.go b/example/newrepo/main.go index 479e75e7259..d140ad58b15 100644 --- a/example/newrepo/main.go +++ b/example/newrepo/main.go @@ -16,7 +16,7 @@ import ( "log" "os" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" ) var ( diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index df264fcc27d..0314bc03080 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -6,10 +6,10 @@ toolchain go1.22.0 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb - github.com/google/go-github/v67 v67.0.0 + github.com/google/go-github/v68 v68.0.0 ) require github.com/google/go-querystring v1.1.0 // indirect // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v67 => ../.. +replace github.com/google/go-github/v68 => ../.. diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index a2888583462..9aa14cb5ae6 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -36,7 +36,7 @@ import ( "os" sodium "github.com/GoKillers/libsodium-go/cryptobox" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" ) var ( diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index 107908cd85c..250b8eddd5b 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -37,7 +37,7 @@ import ( "log" "os" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/ratelimit/main.go b/example/ratelimit/main.go index 0a90944b1c3..38a2135c74d 100644 --- a/example/ratelimit/main.go +++ b/example/ratelimit/main.go @@ -13,7 +13,7 @@ import ( "fmt" "github.com/gofri/go-github-ratelimit/github_ratelimit" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" ) func main() { diff --git a/example/simple/main.go b/example/simple/main.go index 46d90310884..e7454197ea1 100644 --- a/example/simple/main.go +++ b/example/simple/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" ) // Fetch all the public organizations' membership of a user. diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index 9e95ff16a44..cedbe3cc49b 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -15,7 +15,7 @@ import ( "log" "os" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" "golang.org/x/term" ) diff --git a/example/topics/main.go b/example/topics/main.go index 64638479f4b..6f51cf4e238 100644 --- a/example/topics/main.go +++ b/example/topics/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" ) // Fetch and lists all the public topics associated with the specified GitHub topic. diff --git a/example/verifyartifact/main.go b/example/verifyartifact/main.go index b01cb1f7c4b..f68d36aaa41 100644 --- a/example/verifyartifact/main.go +++ b/example/verifyartifact/main.go @@ -18,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" "github.com/sigstore/sigstore-go/pkg/bundle" "github.com/sigstore/sigstore-go/pkg/root" "github.com/sigstore/sigstore-go/pkg/verify" diff --git a/github/doc.go b/github/doc.go index a97a85703ac..4a0f163a0bb 100644 --- a/github/doc.go +++ b/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v67/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v68/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to diff --git a/github/examples_test.go b/github/examples_test.go index 29caa27c738..b75d15363ff 100644 --- a/github/examples_test.go +++ b/github/examples_test.go @@ -12,7 +12,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" ) func ExampleMarkdownService_Render() { diff --git a/github/github.go b/github/github.go index 7069a18e053..4e5a33c67e4 100644 --- a/github/github.go +++ b/github/github.go @@ -28,7 +28,7 @@ import ( ) const ( - Version = "v67.0.0" + Version = "v68.0.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" diff --git a/go.mod b/go.mod index effc7386d53..e695685f022 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v67 +module github.com/google/go-github/v68 require ( github.com/google/go-cmp v0.6.0 diff --git a/test/fields/fields.go b/test/fields/fields.go index 5fc0bd6fe57..c85139b0891 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -25,7 +25,7 @@ import ( "reflect" "strings" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" ) var ( diff --git a/test/integration/activity_test.go b/test/integration/activity_test.go index 2532baa6709..ee069cfdc0c 100644 --- a/test/integration/activity_test.go +++ b/test/integration/activity_test.go @@ -11,7 +11,7 @@ import ( "context" "testing" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" ) const ( diff --git a/test/integration/authorizations_test.go b/test/integration/authorizations_test.go index eeb1a12a182..729e08d262f 100644 --- a/test/integration/authorizations_test.go +++ b/test/integration/authorizations_test.go @@ -14,7 +14,7 @@ import ( "testing" "time" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" ) const msgEnvMissing = "Skipping test because the required environment variable (%v) is not present." diff --git a/test/integration/github_test.go b/test/integration/github_test.go index 1b5d66e25c6..236c2c98ae5 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -14,7 +14,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" ) var ( diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index 6c0b43cf776..4295e50a898 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -14,7 +14,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" ) func TestRepositories_CRUD(t *testing.T) { diff --git a/test/integration/users_test.go b/test/integration/users_test.go index 78e597aef0b..a6e15b0084e 100644 --- a/test/integration/users_test.go +++ b/test/integration/users_test.go @@ -13,7 +13,7 @@ import ( "math/rand" "testing" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" ) func TestUsers_Get(t *testing.T) { diff --git a/tools/go.mod b/tools/go.mod index 092dd8e85ef..a22dadf4020 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -8,7 +8,7 @@ require ( github.com/alecthomas/kong v1.6.0 github.com/getkin/kin-openapi v0.128.0 github.com/google/go-cmp v0.6.0 - github.com/google/go-github/v67 v67.0.0 + github.com/google/go-github/v68 v68.0.0 golang.org/x/sync v0.10.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -25,4 +25,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v67 => ../ +replace github.com/google/go-github/v68 => ../ diff --git a/tools/metadata/main.go b/tools/metadata/main.go index 1471c616c01..5191a178beb 100644 --- a/tools/metadata/main.go +++ b/tools/metadata/main.go @@ -16,7 +16,7 @@ import ( "path/filepath" "github.com/alecthomas/kong" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" ) var helpVars = kong.Vars{ diff --git a/tools/metadata/main_test.go b/tools/metadata/main_test.go index 65525714c05..2b16215f218 100644 --- a/tools/metadata/main_test.go +++ b/tools/metadata/main_test.go @@ -23,7 +23,7 @@ import ( "github.com/alecthomas/kong" "github.com/getkin/kin-openapi/openapi3" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" ) func TestUpdateGo(t *testing.T) { diff --git a/tools/metadata/metadata.go b/tools/metadata/metadata.go index d67608c7716..c021c868e67 100644 --- a/tools/metadata/metadata.go +++ b/tools/metadata/metadata.go @@ -24,7 +24,7 @@ import ( "strings" "sync" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" "gopkg.in/yaml.v3" ) diff --git a/tools/metadata/openapi.go b/tools/metadata/openapi.go index 6dccd252464..40c6cc689f5 100644 --- a/tools/metadata/openapi.go +++ b/tools/metadata/openapi.go @@ -14,7 +14,7 @@ import ( "strconv" "github.com/getkin/kin-openapi/openapi3" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" "golang.org/x/sync/errgroup" ) From 211449041d83d3e6b90668613c4e4af366b5366c Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Mon, 23 Dec 2024 06:54:36 -0500 Subject: [PATCH 599/751] Bump go-github from v67 to v68 in /scrape (#3398) --- scrape/apps.go | 2 +- scrape/apps_test.go | 6 +++--- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scrape/apps.go b/scrape/apps.go index 6b0ce0e8b50..fe99ea84a03 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -18,7 +18,7 @@ import ( "strings" "github.com/PuerkitoBio/goquery" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" ) // AppRestrictionsEnabled returns whether the specified organization has diff --git a/scrape/apps_test.go b/scrape/apps_test.go index 991dd8f368d..ae5b191eed8 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" ) func Test_AppRestrictionsEnabled(t *testing.T) { @@ -95,7 +95,7 @@ func Test_CreateApp(t *testing.T) { }) if _, err := client.CreateApp(&AppManifest{ - URL: github.String("https://example.com"), + URL: github.Ptr("https://example.com"), HookAttributes: map[string]string{ "url": "https://example.com/hook", }, @@ -113,7 +113,7 @@ func Test_CreateAppWithOrg(t *testing.T) { }) if _, err := client.CreateApp(&AppManifest{ - URL: github.String("https://example.com"), + URL: github.Ptr("https://example.com"), HookAttributes: map[string]string{ "url": "https://example.com/hook", }, diff --git a/scrape/go.mod b/scrape/go.mod index 4264ba3c98b..b56b0f2c5be 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -7,7 +7,7 @@ toolchain go1.22.0 require ( github.com/PuerkitoBio/goquery v1.9.2 github.com/google/go-cmp v0.6.0 - github.com/google/go-github/v67 v67.0.0 + github.com/google/go-github/v68 v68.0.0 github.com/xlzd/gotp v0.1.0 golang.org/x/net v0.32.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index abfc7858b9b..7b08a0ca5e5 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -5,8 +5,8 @@ github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6 github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v67 v67.0.0 h1:g11NDAmfaBaCO8qYdI9fsmbaRipHNWRIU/2YGvlh4rg= -github.com/google/go-github/v67 v67.0.0/go.mod h1:zH3K7BxjFndr9QSeFibx4lTKkYS3K9nDanoI1NjaOtY= +github.com/google/go-github/v68 v68.0.0 h1:ZW57zeNZiXTdQ16qrDiZ0k6XucrxZ2CGmoTvcCyQG6s= +github.com/google/go-github/v68 v68.0.0/go.mod h1:K9HAUBovM2sLwM408A18h+wd9vqdLOEqTUCbnRIcx68= 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.1.0 h1:37blvlKCh38s+fkem+fFh7sMnceltoIEBYTVXyoa5Po= From 611fb6aad67688e47dc63ef32bcfca7812df9f38 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Dec 2024 14:25:13 -0500 Subject: [PATCH 600/751] build(deps): bump golang.org/x/net from 0.32.0 to 0.33.0 in /scrape (#3400) --- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index b56b0f2c5be..662d42de98e 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -9,7 +9,7 @@ require ( github.com/google/go-cmp v0.6.0 github.com/google/go-github/v68 v68.0.0 github.com/xlzd/gotp v0.1.0 - golang.org/x/net v0.32.0 + golang.org/x/net v0.33.0 ) require ( diff --git a/scrape/go.sum b/scrape/go.sum index 7b08a0ca5e5..5b4ac55ade8 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -21,8 +21,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= -golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI= -golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= From e1d7336d614a086b199e4ca3dda2e26edf3d1301 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Dec 2024 15:02:11 -0500 Subject: [PATCH 601/751] build(deps): bump codecov/codecov-action from 5.1.1 to 5.1.2 (#3401) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7329a51bab8..3ab68bb7b6b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -73,4 +73,4 @@ jobs: - name: Upload coverage to Codecov if: ${{ matrix.update-coverage }} - uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e #v5.1.1 + uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 #v5.1.2 From 06727b5b2be16883a65f55a7e5639ac54032f692 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Tue, 24 Dec 2024 20:17:39 -0500 Subject: [PATCH 602/751] Bump golang.org/x/net to v0.33.0 (#3402) --- example/go.mod | 2 +- example/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/example/go.mod b/example/go.mod index 25cfccfaee5..7b23a7b88a1 100644 --- a/example/go.mod +++ b/example/go.mod @@ -89,7 +89,7 @@ require ( go.uber.org/zap v1.27.0 // indirect golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 // indirect golang.org/x/mod v0.20.0 // indirect - golang.org/x/net v0.27.0 // indirect + golang.org/x/net v0.33.0 // indirect golang.org/x/sync v0.10.0 // indirect golang.org/x/sys v0.28.0 // indirect golang.org/x/text v0.21.0 // indirect diff --git a/example/go.sum b/example/go.sum index cb0a2fa390d..5fe8fd12e51 100644 --- a/example/go.sum +++ b/example/go.sum @@ -377,8 +377,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= -golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= From 3424b985f31e18ad13f0f9cd3e4a64dd3ebfa216 Mon Sep 17 00:00:00 2001 From: R4vio <55717756+R4vio@users.noreply.github.com> Date: Wed, 25 Dec 2024 23:33:01 +0100 Subject: [PATCH 603/751] Add TokenID and TokenName to PersonalAccessToken struct (#3404) Fixes: #3403. --- github/github-accessors.go | 16 ++++++++++++++++ github/github-accessors_test.go | 22 ++++++++++++++++++++++ github/orgs_personal_access_tokens.go | 6 ++++++ 3 files changed, 44 insertions(+) diff --git a/github/github-accessors.go b/github/github-accessors.go index 0800c02c6c4..cf70ac59493 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -15342,6 +15342,14 @@ func (p *PersonalAccessToken) GetTokenExpiresAt() Timestamp { return *p.TokenExpiresAt } +// GetTokenID returns the TokenID field if it's non-nil, zero value otherwise. +func (p *PersonalAccessToken) GetTokenID() int64 { + if p == nil || p.TokenID == nil { + return 0 + } + return *p.TokenID +} + // GetTokenLastUsedAt returns the TokenLastUsedAt field if it's non-nil, zero value otherwise. func (p *PersonalAccessToken) GetTokenLastUsedAt() Timestamp { if p == nil || p.TokenLastUsedAt == nil { @@ -15350,6 +15358,14 @@ func (p *PersonalAccessToken) GetTokenLastUsedAt() Timestamp { return *p.TokenLastUsedAt } +// GetTokenName returns the TokenName field if it's non-nil, zero value otherwise. +func (p *PersonalAccessToken) GetTokenName() string { + if p == nil || p.TokenName == nil { + return "" + } + return *p.TokenName +} + // GetOrg returns the Org map if it's non-nil, an empty map otherwise. func (p *PersonalAccessTokenPermissions) GetOrg() map[string]string { if p == nil || p.Org == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 4b5c9dcb263..ff7530bcc0a 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -19849,6 +19849,17 @@ func TestPersonalAccessToken_GetTokenExpiresAt(tt *testing.T) { p.GetTokenExpiresAt() } +func TestPersonalAccessToken_GetTokenID(tt *testing.T) { + tt.Parallel() + var zeroValue int64 + p := &PersonalAccessToken{TokenID: &zeroValue} + p.GetTokenID() + p = &PersonalAccessToken{} + p.GetTokenID() + p = nil + p.GetTokenID() +} + func TestPersonalAccessToken_GetTokenLastUsedAt(tt *testing.T) { tt.Parallel() var zeroValue Timestamp @@ -19860,6 +19871,17 @@ func TestPersonalAccessToken_GetTokenLastUsedAt(tt *testing.T) { p.GetTokenLastUsedAt() } +func TestPersonalAccessToken_GetTokenName(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &PersonalAccessToken{TokenName: &zeroValue} + p.GetTokenName() + p = &PersonalAccessToken{} + p.GetTokenName() + p = nil + p.GetTokenName() +} + func TestPersonalAccessTokenPermissions_GetOrg(tt *testing.T) { tt.Parallel() zeroValue := map[string]string{} diff --git a/github/orgs_personal_access_tokens.go b/github/orgs_personal_access_tokens.go index af083744e85..276fbbb4942 100644 --- a/github/orgs_personal_access_tokens.go +++ b/github/orgs_personal_access_tokens.go @@ -44,6 +44,12 @@ type PersonalAccessToken struct { // Date and time when the associated fine-grained personal access token expires. TokenExpiresAt *Timestamp `json:"token_expires_at"` + // TokenID + TokenID *int64 `json:"token_id"` + + // TokenName + TokenName *string `json:"token_name"` + // Date and time when the associated fine-grained personal access token was last used for authentication. TokenLastUsedAt *Timestamp `json:"token_last_used_at"` } From 5bfda1ec47a53080110b69d8f45867ba21234aeb Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Mon, 30 Dec 2024 15:38:04 -0500 Subject: [PATCH 604/751] Bump github.com/PuerkitoBio/goquery from 1.9.2 to 1.10.1 in /scrape (#3408) --- scrape/go.mod | 8 ++++---- scrape/go.sum | 43 ++++++++++++++++++++++++++++++++++++------- 2 files changed, 40 insertions(+), 11 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 662d42de98e..ec913e510d3 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -1,11 +1,11 @@ module github.com/google/go-github/scrape -go 1.21 +go 1.23 -toolchain go1.22.0 +toolchain go1.23.4 require ( - github.com/PuerkitoBio/goquery v1.9.2 + github.com/PuerkitoBio/goquery v1.10.1 github.com/google/go-cmp v0.6.0 github.com/google/go-github/v68 v68.0.0 github.com/xlzd/gotp v0.1.0 @@ -13,6 +13,6 @@ require ( ) require ( - github.com/andybalholm/cascadia v1.3.2 // indirect + github.com/andybalholm/cascadia v1.3.3 // indirect github.com/google/go-querystring v1.1.0 // indirect ) diff --git a/scrape/go.sum b/scrape/go.sum index 5b4ac55ade8..13b9cf2ae28 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -1,7 +1,7 @@ -github.com/PuerkitoBio/goquery v1.9.2 h1:4/wZksC3KgkQw7SQgkKotmKljk0M6V8TUvA8Wb4yPeE= -github.com/PuerkitoBio/goquery v1.9.2/go.mod h1:GHPCaP0ODyyxqcNoFGYlAprUFH81NuRPd0GX3Zu2Mvk= -github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsViSLyss= -github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU= +github.com/PuerkitoBio/goquery v1.10.1 h1:Y8JGYUkXWTGRB6Ars3+j3kN0xg1YqqlwvdTV8WTFQcU= +github.com/PuerkitoBio/goquery v1.10.1/go.mod h1:IYiHrOMps66ag56LEH7QYDDupKXyo5A8qrjIx3ZtujY= +github.com/andybalholm/cascadia v1.3.3 h1:AG2YHrzJIm4BZ19iwJ/DAua6Btl3IwJX+VI4kktS1LM= +github.com/andybalholm/cascadia v1.3.3/go.mod h1:xNd9bqTn98Ln4DwST8/nG+H0yuB8Hmgu1YHNnWw0GeA= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -14,37 +14,66 @@ github.com/xlzd/gotp v0.1.0/go.mod h1:ndLJ3JKzi3xLmUProq4LLxCuECL93dG9WASNLpHz8q github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= +golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= +golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From 9ec2ee9fcc55cced2a903d6fd28a7710907c01ab Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Mon, 30 Dec 2024 17:09:31 -0500 Subject: [PATCH 605/751] Bump Go to 1.22.10 or 1.23.4 in go.mod files (#3410) --- README.md | 13 +++++++++++++ example/go.mod | 4 +--- example/newreposecretwithlibsodium/go.mod | 4 +--- go.mod | 2 +- scrape/go.mod | 4 +--- script/test.sh | 2 ++ tools/go.mod | 4 +--- 7 files changed, 20 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 1ed60695bfb..5f6d5ab3ff0 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,19 @@ the library is tested against Go version 1.22 and greater. go-github tracks older versions of Go if we don't have to, but due to tooling constraints, we don't always test older versions. +Go version 1.22 introduced significant changes to the pattern syntax and matching +behavior of `http.ServerMux` which causes a large number of legacy unit tests to break. +(See https://pkg.go.dev/net/http#hdr-Compatibility-ServeMux for more information.) +As a result, testing of this repo is currently performed by setting this env variable: + +```bash +export GODEBUG=httpmuxgo121=1 +``` + +An issue has been created (#3409) requesting assistance in updating all breaking legacy unit +tests when this `GODEBUG` environment variable is not set and Go 1.23.4 or later is +used to perform unit tests. + [support-policy]: https://golang.org/doc/devel/release.html#policy If you're interested in using the [GraphQL API v4][], the recommended library is diff --git a/example/go.mod b/example/go.mod index 7b23a7b88a1..314b6c93ee5 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,8 +1,6 @@ module github.com/google/go-github/v68/example -go 1.22.5 - -toolchain go1.23.2 +go 1.22.10 require ( github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index 0314bc03080..281feb1a542 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -1,8 +1,6 @@ module newreposecretwithlibsodium -go 1.21 - -toolchain go1.22.0 +go 1.22.10 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb diff --git a/go.mod b/go.mod index e695685f022..6e7d38a639a 100644 --- a/go.mod +++ b/go.mod @@ -5,4 +5,4 @@ require ( github.com/google/go-querystring v1.1.0 ) -go 1.21 +go 1.22.10 diff --git a/scrape/go.mod b/scrape/go.mod index ec913e510d3..69c6248ac60 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -1,8 +1,6 @@ module github.com/google/go-github/scrape -go 1.23 - -toolchain go1.23.4 +go 1.23.4 require ( github.com/PuerkitoBio/goquery v1.10.1 diff --git a/script/test.sh b/script/test.sh index dedd832ecad..6cff1ac6952 100755 --- a/script/test.sh +++ b/script/test.sh @@ -7,6 +7,8 @@ set -e CDPATH="" cd -- "$(dirname -- "$0")/.." +# TODO(gmlewis): Remove this when #3409 is resolved. +export GODEBUG=httpmuxgo121=1 if [ "$#" = "0" ]; then set -- -race -covermode atomic ./... diff --git a/tools/go.mod b/tools/go.mod index a22dadf4020..f5ca69b70d1 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -1,8 +1,6 @@ module tools -go 1.21 - -toolchain go1.22.0 +go 1.23.4 require ( github.com/alecthomas/kong v1.6.0 From 3428a813851d8b860cda96761747a657b3b4a222 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?William=20Mouch=C3=A8re?= <4822814+wmouchere@users.noreply.github.com> Date: Thu, 2 Jan 2025 18:00:31 +0100 Subject: [PATCH 606/751] Add opt-in rate limit support on endpoints returning 302s (#3411) Fixes: #3406. --- github/actions_artifacts.go | 30 +- github/actions_artifacts_test.go | 296 +++++++++++++---- github/actions_workflow_jobs.go | 30 +- github/actions_workflow_jobs_test.go | 247 ++++++++++---- github/actions_workflow_runs.go | 58 +++- github/actions_workflow_runs_test.go | 465 ++++++++++++++++++++------- github/github.go | 166 +++++++++- github/github_test.go | 74 +++++ github/repos_contents.go | 31 +- github/repos_contents_test.go | 185 +++++++---- 10 files changed, 1253 insertions(+), 329 deletions(-) diff --git a/github/actions_artifacts.go b/github/actions_artifacts.go index e05a9a84024..2b560fa05de 100644 --- a/github/actions_artifacts.go +++ b/github/actions_artifacts.go @@ -142,6 +142,14 @@ func (s *ActionsService) GetArtifact(ctx context.Context, owner, repo string, ar func (s *ActionsService) DownloadArtifact(ctx context.Context, owner, repo string, artifactID int64, maxRedirects int) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/artifacts/%v/zip", owner, repo, artifactID) + if s.client.RateLimitRedirectionalEndpoints { + return s.downloadArtifactWithRateLimit(ctx, u, maxRedirects) + } + + return s.downloadArtifactWithoutRateLimit(ctx, u, maxRedirects) +} + +func (s *ActionsService) downloadArtifactWithoutRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) { resp, err := s.client.roundTripWithOptionalFollowRedirect(ctx, u, maxRedirects) if err != nil { return nil, nil, err @@ -149,7 +157,7 @@ func (s *ActionsService) DownloadArtifact(ctx context.Context, owner, repo strin defer resp.Body.Close() if resp.StatusCode != http.StatusFound { - return nil, newResponse(resp), fmt.Errorf("unexpected status code: %s", resp.Status) + return nil, newResponse(resp), fmt.Errorf("unexpected status code: %v", resp.Status) } parsedURL, err := url.Parse(resp.Header.Get("Location")) @@ -160,6 +168,26 @@ func (s *ActionsService) DownloadArtifact(ctx context.Context, owner, repo strin return parsedURL, newResponse(resp), nil } +func (s *ActionsService) downloadArtifactWithRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) { + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + url, resp, err := s.client.bareDoUntilFound(ctx, req, maxRedirects) + if err != nil { + return nil, resp, err + } + defer resp.Body.Close() + + // If we didn't receive a valid Location in a 302 response + if url == nil { + return nil, resp, fmt.Errorf("unexpected status code: %v", resp.Status) + } + + return url, resp, nil +} + // DeleteArtifact deletes a workflow run artifact. // // GitHub API docs: https://docs.github.com/rest/actions/artifacts#delete-an-artifact diff --git a/github/actions_artifacts_test.go b/github/actions_artifacts_test.go index 5ac5a8f2bd1..76a82355e1d 100644 --- a/github/actions_artifacts_test.go +++ b/github/actions_artifacts_test.go @@ -11,6 +11,7 @@ import ( "fmt" "net/http" "net/url" + "strings" "testing" "github.com/google/go-cmp/cmp" @@ -272,102 +273,261 @@ func TestActionsService_GetArtifact_notFound(t *testing.T) { func TestActionsService_DownloadArtifact(t *testing.T) { t.Parallel() - client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/actions/artifacts/1/zip", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - http.Redirect(w, r, "https://github.com/artifact", http.StatusFound) - }) - - ctx := context.Background() - url, resp, err := client.Actions.DownloadArtifact(ctx, "o", "r", 1, 1) - if err != nil { - t.Errorf("Actions.DownloadArtifact returned error: %v", err) - } - if resp.StatusCode != http.StatusFound { - t.Errorf("Actions.DownloadArtifact returned status: %d, want %d", resp.StatusCode, http.StatusFound) + tcs := []struct { + name string + respectRateLimits bool + }{ + { + name: "withoutRateLimits", + respectRateLimits: false, + }, + { + name: "withRateLimits", + respectRateLimits: true, + }, } - want := "https://github.com/artifact" - if url.String() != want { - t.Errorf("Actions.DownloadArtifact returned %+v, want %+v", url.String(), want) - } + for _, tc := range tcs { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + client.RateLimitRedirectionalEndpoints = tc.respectRateLimits + + mux.HandleFunc("/repos/o/r/actions/artifacts/1/zip", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + http.Redirect(w, r, "https://github.com/artifact", http.StatusFound) + }) + + ctx := context.Background() + url, resp, err := client.Actions.DownloadArtifact(ctx, "o", "r", 1, 1) + if err != nil { + t.Errorf("Actions.DownloadArtifact returned error: %v", err) + } + if resp.StatusCode != http.StatusFound { + t.Errorf("Actions.DownloadArtifact returned status: %d, want %d", resp.StatusCode, http.StatusFound) + } - const methodName = "DownloadArtifact" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Actions.DownloadArtifact(ctx, "\n", "\n", -1, 1) - return err - }) + want := "https://github.com/artifact" + if url.String() != want { + t.Errorf("Actions.DownloadArtifact returned %+v, want %+v", url.String(), want) + } - // Add custom round tripper - client.client.Transport = roundTripperFunc(func(r *http.Request) (*http.Response, error) { - return nil, errors.New("failed to download artifact") - }) - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Actions.DownloadArtifact(ctx, "o", "r", 1, 1) - return err - }) + const methodName = "DownloadArtifact" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.DownloadArtifact(ctx, "\n", "\n", -1, 1) + return err + }) + + // Add custom round tripper + client.client.Transport = roundTripperFunc(func(r *http.Request) (*http.Response, error) { + return nil, errors.New("failed to download artifact") + }) + // propagate custom round tripper to client without CheckRedirect + client.initialize() + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.DownloadArtifact(ctx, "o", "r", 1, 1) + return err + }) + }) + } } func TestActionsService_DownloadArtifact_invalidOwner(t *testing.T) { t.Parallel() - client, _, _ := setup(t) + tcs := []struct { + name string + respectRateLimits bool + }{ + { + name: "withoutRateLimits", + respectRateLimits: false, + }, + { + name: "withRateLimits", + respectRateLimits: true, + }, + } - ctx := context.Background() - _, _, err := client.Actions.DownloadArtifact(ctx, "%", "r", 1, 1) - testURLParseError(t, err) + for _, tc := range tcs { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + client, _, _ := setup(t) + client.RateLimitRedirectionalEndpoints = tc.respectRateLimits + + ctx := context.Background() + _, _, err := client.Actions.DownloadArtifact(ctx, "%", "r", 1, 1) + testURLParseError(t, err) + }) + } } func TestActionsService_DownloadArtifact_invalidRepo(t *testing.T) { t.Parallel() - client, _, _ := setup(t) + tcs := []struct { + name string + respectRateLimits bool + }{ + { + name: "withoutRateLimits", + respectRateLimits: false, + }, + { + name: "withRateLimits", + respectRateLimits: true, + }, + } - ctx := context.Background() - _, _, err := client.Actions.DownloadArtifact(ctx, "o", "%", 1, 1) - testURLParseError(t, err) + for _, tc := range tcs { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + client, _, _ := setup(t) + client.RateLimitRedirectionalEndpoints = tc.respectRateLimits + + ctx := context.Background() + _, _, err := client.Actions.DownloadArtifact(ctx, "o", "%", 1, 1) + testURLParseError(t, err) + }) + } } func TestActionsService_DownloadArtifact_StatusMovedPermanently_dontFollowRedirects(t *testing.T) { t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/repos/o/r/actions/artifacts/1/zip", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - http.Redirect(w, r, "https://github.com/artifact", http.StatusMovedPermanently) - }) + tcs := []struct { + name string + respectRateLimits bool + }{ + { + name: "withoutRateLimits", + respectRateLimits: false, + }, + { + name: "withRateLimits", + respectRateLimits: true, + }, + } - ctx := context.Background() - _, resp, _ := client.Actions.DownloadArtifact(ctx, "o", "r", 1, 0) - if resp.StatusCode != http.StatusMovedPermanently { - t.Errorf("Actions.DownloadArtifact return status %d, want %d", resp.StatusCode, http.StatusMovedPermanently) + for _, tc := range tcs { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + client.RateLimitRedirectionalEndpoints = tc.respectRateLimits + + mux.HandleFunc("/repos/o/r/actions/artifacts/1/zip", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + http.Redirect(w, r, "https://github.com/artifact", http.StatusMovedPermanently) + }) + + ctx := context.Background() + _, resp, _ := client.Actions.DownloadArtifact(ctx, "o", "r", 1, 0) + if resp.StatusCode != http.StatusMovedPermanently { + t.Errorf("Actions.DownloadArtifact return status %d, want %d", resp.StatusCode, http.StatusMovedPermanently) + } + }) } } func TestActionsService_DownloadArtifact_StatusMovedPermanently_followRedirects(t *testing.T) { t.Parallel() - client, mux, serverURL := setup(t) - - mux.HandleFunc("/repos/o/r/actions/artifacts/1/zip", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - redirectURL, _ := url.Parse(serverURL + baseURLPath + "/redirect") - http.Redirect(w, r, redirectURL.String(), http.StatusMovedPermanently) - }) - mux.HandleFunc("/redirect", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - http.Redirect(w, r, "http://github.com/artifact", http.StatusFound) - }) + tcs := []struct { + name string + respectRateLimits bool + }{ + { + name: "withoutRateLimits", + respectRateLimits: false, + }, + { + name: "withRateLimits", + respectRateLimits: true, + }, + } - ctx := context.Background() - url, resp, err := client.Actions.DownloadArtifact(ctx, "o", "r", 1, 1) - if err != nil { - t.Errorf("Actions.DownloadArtifact return error: %v", err) + for _, tc := range tcs { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + client, mux, serverURL := setup(t) + client.RateLimitRedirectionalEndpoints = tc.respectRateLimits + + mux.HandleFunc("/repos/o/r/actions/artifacts/1/zip", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + redirectURL, _ := url.Parse(serverURL + baseURLPath + "/redirect") + http.Redirect(w, r, redirectURL.String(), http.StatusMovedPermanently) + }) + mux.HandleFunc("/redirect", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + http.Redirect(w, r, "http://github.com/artifact", http.StatusFound) + }) + + ctx := context.Background() + url, resp, err := client.Actions.DownloadArtifact(ctx, "o", "r", 1, 1) + if err != nil { + t.Errorf("Actions.DownloadArtifact return error: %v", err) + } + if resp.StatusCode != http.StatusFound { + t.Errorf("Actions.DownloadArtifact return status %d, want %d", resp.StatusCode, http.StatusFound) + } + want := "http://github.com/artifact" + if url.String() != want { + t.Errorf("Actions.DownloadArtifact returned %+v, want %+v", url.String(), want) + } + }) } - if resp.StatusCode != http.StatusFound { - t.Errorf("Actions.DownloadArtifact return status %d, want %d", resp.StatusCode, http.StatusFound) +} + +func TestActionsService_DownloadArtifact_unexpectedCode(t *testing.T) { + t.Parallel() + tcs := []struct { + name string + respectRateLimits bool + }{ + { + name: "withoutRateLimits", + respectRateLimits: false, + }, + { + name: "withRateLimits", + respectRateLimits: true, + }, } - want := "http://github.com/artifact" - if url.String() != want { - t.Errorf("Actions.DownloadArtifact returned %+v, want %+v", url.String(), want) + + for _, tc := range tcs { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + client, mux, serverURL := setup(t) + client.RateLimitRedirectionalEndpoints = tc.respectRateLimits + + mux.HandleFunc("/repos/o/r/actions/artifacts/1/zip", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + redirectURL, _ := url.Parse(serverURL + baseURLPath + "/redirect") + http.Redirect(w, r, redirectURL.String(), http.StatusMovedPermanently) + }) + mux.HandleFunc("/redirect", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + w.WriteHeader(http.StatusNoContent) + }) + + ctx := context.Background() + url, resp, err := client.Actions.DownloadArtifact(ctx, "o", "r", 1, 1) + if err == nil { + t.Fatalf("Actions.DownloadArtifact should return error on unexpected code") + } + if !strings.Contains(err.Error(), "unexpected status code") { + t.Error("Actions.DownloadArtifact should return unexpected status code") + } + if got, want := resp.Response.StatusCode, http.StatusNoContent; got != want { + t.Errorf("Actions.DownloadArtifact return status %d, want %d", got, want) + } + if url != nil { + t.Errorf("Actions.DownloadArtifact return %+v, want nil", url) + } + }) } } diff --git a/github/actions_workflow_jobs.go b/github/actions_workflow_jobs.go index 84bbe5aa46d..10067c8b260 100644 --- a/github/actions_workflow_jobs.go +++ b/github/actions_workflow_jobs.go @@ -150,6 +150,14 @@ func (s *ActionsService) GetWorkflowJobByID(ctx context.Context, owner, repo str func (s *ActionsService) GetWorkflowJobLogs(ctx context.Context, owner, repo string, jobID int64, maxRedirects int) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/jobs/%v/logs", owner, repo, jobID) + if s.client.RateLimitRedirectionalEndpoints { + return s.getWorkflowJobLogsWithRateLimit(ctx, u, maxRedirects) + } + + return s.getWorkflowJobLogsWithoutRateLimit(ctx, u, maxRedirects) +} + +func (s *ActionsService) getWorkflowJobLogsWithoutRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) { resp, err := s.client.roundTripWithOptionalFollowRedirect(ctx, u, maxRedirects) if err != nil { return nil, nil, err @@ -157,9 +165,29 @@ func (s *ActionsService) GetWorkflowJobLogs(ctx context.Context, owner, repo str defer resp.Body.Close() if resp.StatusCode != http.StatusFound { - return nil, newResponse(resp), fmt.Errorf("unexpected status code: %s", resp.Status) + return nil, newResponse(resp), fmt.Errorf("unexpected status code: %v", resp.Status) } parsedURL, err := url.Parse(resp.Header.Get("Location")) return parsedURL, newResponse(resp), err } + +func (s *ActionsService) getWorkflowJobLogsWithRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) { + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + url, resp, err := s.client.bareDoUntilFound(ctx, req, maxRedirects) + if err != nil { + return nil, resp, err + } + defer resp.Body.Close() + + // If we didn't receive a valid Location in a 302 response + if url == nil { + return nil, resp, fmt.Errorf("unexpected status code: %v", resp.Status) + } + + return url, resp, nil +} diff --git a/github/actions_workflow_jobs_test.go b/github/actions_workflow_jobs_test.go index 3ef5295afde..f414df0fbfb 100644 --- a/github/actions_workflow_jobs_test.go +++ b/github/actions_workflow_jobs_test.go @@ -11,6 +11,7 @@ import ( "fmt" "net/http" "net/url" + "strings" "testing" "time" @@ -184,87 +185,205 @@ func TestActionsService_GetWorkflowJobByID(t *testing.T) { func TestActionsService_GetWorkflowJobLogs(t *testing.T) { t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/repos/o/r/actions/jobs/399444496/logs", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - http.Redirect(w, r, "http://github.com/a", http.StatusFound) - }) - - ctx := context.Background() - url, resp, err := client.Actions.GetWorkflowJobLogs(ctx, "o", "r", 399444496, 1) - if err != nil { - t.Errorf("Actions.GetWorkflowJobLogs returned error: %v", err) - } - if resp.StatusCode != http.StatusFound { - t.Errorf("Actions.GetWorkflowJobLogs returned status: %d, want %d", resp.StatusCode, http.StatusFound) - } - want := "http://github.com/a" - if url.String() != want { - t.Errorf("Actions.GetWorkflowJobLogs returned %+v, want %+v", url.String(), want) + tcs := []struct { + name string + respectRateLimits bool + }{ + { + name: "withoutRateLimits", + respectRateLimits: false, + }, + { + name: "withRateLimits", + respectRateLimits: true, + }, } - const methodName = "GetWorkflowJobLogs" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Actions.GetWorkflowJobLogs(ctx, "\n", "\n", 399444496, 1) - return err - }) - - // Add custom round tripper - client.client.Transport = roundTripperFunc(func(r *http.Request) (*http.Response, error) { - return nil, errors.New("failed to get workflow logs") - }) - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Actions.GetWorkflowJobLogs(ctx, "o", "r", 399444496, 1) - return err - }) + for _, tc := range tcs { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + client.RateLimitRedirectionalEndpoints = tc.respectRateLimits + + mux.HandleFunc("/repos/o/r/actions/jobs/399444496/logs", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + http.Redirect(w, r, "http://github.com/a", http.StatusFound) + }) + + ctx := context.Background() + url, resp, err := client.Actions.GetWorkflowJobLogs(ctx, "o", "r", 399444496, 1) + if err != nil { + t.Errorf("Actions.GetWorkflowJobLogs returned error: %v", err) + } + if resp.StatusCode != http.StatusFound { + t.Errorf("Actions.GetWorkflowJobLogs returned status: %d, want %d", resp.StatusCode, http.StatusFound) + } + want := "http://github.com/a" + if url.String() != want { + t.Errorf("Actions.GetWorkflowJobLogs returned %+v, want %+v", url.String(), want) + } + + const methodName = "GetWorkflowJobLogs" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.GetWorkflowJobLogs(ctx, "\n", "\n", 399444496, 1) + return err + }) + + // Add custom round tripper + client.client.Transport = roundTripperFunc(func(r *http.Request) (*http.Response, error) { + return nil, errors.New("failed to get workflow logs") + }) + // propagate custom round tripper to client without CheckRedirect + client.initialize() + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.GetWorkflowJobLogs(ctx, "o", "r", 399444496, 1) + return err + }) + }) + } } func TestActionsService_GetWorkflowJobLogs_StatusMovedPermanently_dontFollowRedirects(t *testing.T) { t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/repos/o/r/actions/jobs/399444496/logs", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - http.Redirect(w, r, "http://github.com/a", http.StatusMovedPermanently) - }) + tcs := []struct { + name string + respectRateLimits bool + }{ + { + name: "withoutRateLimits", + respectRateLimits: false, + }, + { + name: "withRateLimits", + respectRateLimits: true, + }, + } - ctx := context.Background() - _, resp, _ := client.Actions.GetWorkflowJobLogs(ctx, "o", "r", 399444496, 0) - if resp.StatusCode != http.StatusMovedPermanently { - t.Errorf("Actions.GetWorkflowJobLogs returned status: %d, want %d", resp.StatusCode, http.StatusMovedPermanently) + for _, tc := range tcs { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + client.RateLimitRedirectionalEndpoints = tc.respectRateLimits + + mux.HandleFunc("/repos/o/r/actions/jobs/399444496/logs", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + http.Redirect(w, r, "http://github.com/a", http.StatusMovedPermanently) + }) + + ctx := context.Background() + _, resp, _ := client.Actions.GetWorkflowJobLogs(ctx, "o", "r", 399444496, 0) + if resp.StatusCode != http.StatusMovedPermanently { + t.Errorf("Actions.GetWorkflowJobLogs returned status: %d, want %d", resp.StatusCode, http.StatusMovedPermanently) + } + }) } } func TestActionsService_GetWorkflowJobLogs_StatusMovedPermanently_followRedirects(t *testing.T) { t.Parallel() - client, mux, serverURL := setup(t) - - // Mock a redirect link, which leads to an archive link - mux.HandleFunc("/repos/o/r/actions/jobs/399444496/logs", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - redirectURL, _ := url.Parse(serverURL + baseURLPath + "/redirect") - http.Redirect(w, r, redirectURL.String(), http.StatusMovedPermanently) - }) - - mux.HandleFunc("/redirect", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - http.Redirect(w, r, "http://github.com/a", http.StatusFound) - }) + tcs := []struct { + name string + respectRateLimits bool + }{ + { + name: "withoutRateLimits", + respectRateLimits: false, + }, + { + name: "withRateLimits", + respectRateLimits: true, + }, + } - ctx := context.Background() - url, resp, err := client.Actions.GetWorkflowJobLogs(ctx, "o", "r", 399444496, 1) - if err != nil { - t.Errorf("Actions.GetWorkflowJobLogs returned error: %v", err) + for _, tc := range tcs { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + client, mux, serverURL := setup(t) + client.RateLimitRedirectionalEndpoints = tc.respectRateLimits + + // Mock a redirect link, which leads to an archive link + mux.HandleFunc("/repos/o/r/actions/jobs/399444496/logs", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + redirectURL, _ := url.Parse(serverURL + baseURLPath + "/redirect") + http.Redirect(w, r, redirectURL.String(), http.StatusMovedPermanently) + }) + + mux.HandleFunc("/redirect", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + http.Redirect(w, r, "http://github.com/a", http.StatusFound) + }) + + ctx := context.Background() + url, resp, err := client.Actions.GetWorkflowJobLogs(ctx, "o", "r", 399444496, 1) + if err != nil { + t.Errorf("Actions.GetWorkflowJobLogs returned error: %v", err) + } + + if resp.StatusCode != http.StatusFound { + t.Errorf("Actions.GetWorkflowJobLogs returned status: %d, want %d", resp.StatusCode, http.StatusFound) + } + + want := "http://github.com/a" + if url.String() != want { + t.Errorf("Actions.GetWorkflowJobLogs returned %+v, want %+v", url.String(), want) + } + }) } +} - if resp.StatusCode != http.StatusFound { - t.Errorf("Actions.GetWorkflowJobLogs returned status: %d, want %d", resp.StatusCode, http.StatusFound) +func TestActionsService_GetWorkflowJobLogs_unexpectedCode(t *testing.T) { + t.Parallel() + tcs := []struct { + name string + respectRateLimits bool + }{ + { + name: "withoutRateLimits", + respectRateLimits: false, + }, + { + name: "withRateLimits", + respectRateLimits: true, + }, } - want := "http://github.com/a" - if url.String() != want { - t.Errorf("Actions.GetWorkflowJobLogs returned %+v, want %+v", url.String(), want) + for _, tc := range tcs { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + client, mux, serverURL := setup(t) + client.RateLimitRedirectionalEndpoints = tc.respectRateLimits + + // Mock a redirect link, which leads to an archive link + mux.HandleFunc("/repos/o/r/actions/jobs/399444496/logs", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + redirectURL, _ := url.Parse(serverURL + baseURLPath + "/redirect") + http.Redirect(w, r, redirectURL.String(), http.StatusMovedPermanently) + }) + + mux.HandleFunc("/redirect", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + w.WriteHeader(http.StatusNoContent) + }) + + ctx := context.Background() + url, resp, err := client.Actions.GetWorkflowJobLogs(ctx, "o", "r", 399444496, 1) + if err == nil { + t.Fatalf("Actions.GetWorkflowJobLogs should return error on unexpected code") + } + if !strings.Contains(err.Error(), "unexpected status code") { + t.Error("Actions.GetWorkflowJobLogs should return unexpected status code") + } + if got, want := resp.Response.StatusCode, http.StatusNoContent; got != want { + t.Errorf("Actions.GetWorkflowJobLogs return status %d, want %d", got, want) + } + if url != nil { + t.Errorf("Actions.GetWorkflowJobLogs return %+v, want nil", url) + } + }) } } diff --git a/github/actions_workflow_runs.go b/github/actions_workflow_runs.go index 122ea1d0e2b..dddc56d2327 100644 --- a/github/actions_workflow_runs.go +++ b/github/actions_workflow_runs.go @@ -259,6 +259,14 @@ func (s *ActionsService) GetWorkflowRunAttempt(ctx context.Context, owner, repo func (s *ActionsService) GetWorkflowRunAttemptLogs(ctx context.Context, owner, repo string, runID int64, attemptNumber int, maxRedirects int) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/attempts/%v/logs", owner, repo, runID, attemptNumber) + if s.client.RateLimitRedirectionalEndpoints { + return s.getWorkflowRunAttemptLogsWithRateLimit(ctx, u, maxRedirects) + } + + return s.getWorkflowRunAttemptLogsWithoutRateLimit(ctx, u, maxRedirects) +} + +func (s *ActionsService) getWorkflowRunAttemptLogsWithoutRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) { resp, err := s.client.roundTripWithOptionalFollowRedirect(ctx, u, maxRedirects) if err != nil { return nil, nil, err @@ -266,13 +274,33 @@ func (s *ActionsService) GetWorkflowRunAttemptLogs(ctx context.Context, owner, r defer resp.Body.Close() if resp.StatusCode != http.StatusFound { - return nil, newResponse(resp), fmt.Errorf("unexpected status code: %s", resp.Status) + return nil, newResponse(resp), fmt.Errorf("unexpected status code: %v", resp.Status) } parsedURL, err := url.Parse(resp.Header.Get("Location")) return parsedURL, newResponse(resp), err } +func (s *ActionsService) getWorkflowRunAttemptLogsWithRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) { + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + url, resp, err := s.client.bareDoUntilFound(ctx, req, maxRedirects) + if err != nil { + return nil, resp, err + } + defer resp.Body.Close() + + // If we didn't receive a valid Location in a 302 response + if url == nil { + return nil, resp, fmt.Errorf("unexpected status code: %v", resp.Status) + } + + return url, resp, nil +} + // RerunWorkflowByID re-runs a workflow by ID. // // GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#re-run-a-workflow @@ -345,6 +373,14 @@ func (s *ActionsService) CancelWorkflowRunByID(ctx context.Context, owner, repo func (s *ActionsService) GetWorkflowRunLogs(ctx context.Context, owner, repo string, runID int64, maxRedirects int) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/logs", owner, repo, runID) + if s.client.RateLimitRedirectionalEndpoints { + return s.getWorkflowRunLogsWithRateLimit(ctx, u, maxRedirects) + } + + return s.getWorkflowRunLogsWithoutRateLimit(ctx, u, maxRedirects) +} + +func (s *ActionsService) getWorkflowRunLogsWithoutRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) { resp, err := s.client.roundTripWithOptionalFollowRedirect(ctx, u, maxRedirects) if err != nil { return nil, nil, err @@ -359,6 +395,26 @@ func (s *ActionsService) GetWorkflowRunLogs(ctx context.Context, owner, repo str return parsedURL, newResponse(resp), err } +func (s *ActionsService) getWorkflowRunLogsWithRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) { + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + url, resp, err := s.client.bareDoUntilFound(ctx, req, maxRedirects) + if err != nil { + return nil, resp, err + } + defer resp.Body.Close() + + // If we didn't receive a valid Location in a 302 response + if url == nil { + return nil, resp, fmt.Errorf("unexpected status code: %v", resp.Status) + } + + return url, resp, nil +} + // DeleteWorkflowRun deletes a workflow run by ID. // // GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#delete-a-workflow-run diff --git a/github/actions_workflow_runs_test.go b/github/actions_workflow_runs_test.go index 4c91c5349ce..be400c27e8d 100644 --- a/github/actions_workflow_runs_test.go +++ b/github/actions_workflow_runs_test.go @@ -11,6 +11,7 @@ import ( "fmt" "net/http" "net/url" + "strings" "testing" "time" @@ -190,85 +191,201 @@ func TestActionsService_GetWorkflowRunAttempt(t *testing.T) { func TestActionsService_GetWorkflowRunAttemptLogs(t *testing.T) { t.Parallel() - client, mux, _ := setup(t) + tcs := []struct { + name string + respectRateLimits bool + }{ + { + name: "withoutRateLimits", + respectRateLimits: false, + }, + { + name: "withRateLimits", + respectRateLimits: true, + }, + } - mux.HandleFunc("/repos/o/r/actions/runs/399444496/attempts/2/logs", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - http.Redirect(w, r, "http://github.com/a", http.StatusFound) - }) + for _, tc := range tcs { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + client.RateLimitRedirectionalEndpoints = tc.respectRateLimits + + mux.HandleFunc("/repos/o/r/actions/runs/399444496/attempts/2/logs", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + http.Redirect(w, r, "http://github.com/a", http.StatusFound) + }) + + ctx := context.Background() + url, resp, err := client.Actions.GetWorkflowRunAttemptLogs(ctx, "o", "r", 399444496, 2, 1) + if err != nil { + t.Errorf("Actions.GetWorkflowRunAttemptLogs returned error: %v", err) + } + if resp.StatusCode != http.StatusFound { + t.Errorf("Actions.GetWorkflowRunAttemptLogs returned status: %d, want %d", resp.StatusCode, http.StatusFound) + } + want := "http://github.com/a" + if url.String() != want { + t.Errorf("Actions.GetWorkflowRunAttemptLogs returned %+v, want %+v", url.String(), want) + } - ctx := context.Background() - url, resp, err := client.Actions.GetWorkflowRunAttemptLogs(ctx, "o", "r", 399444496, 2, 1) - if err != nil { - t.Errorf("Actions.GetWorkflowRunAttemptLogs returned error: %v", err) - } - if resp.StatusCode != http.StatusFound { - t.Errorf("Actions.GetWorkflowRunAttemptLogs returned status: %d, want %d", resp.StatusCode, http.StatusFound) + const methodName = "GetWorkflowRunAttemptLogs" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.GetWorkflowRunAttemptLogs(ctx, "\n", "\n", 399444496, 2, 1) + return err + }) + }) } - want := "http://github.com/a" - if url.String() != want { - t.Errorf("Actions.GetWorkflowRunAttemptLogs returned %+v, want %+v", url.String(), want) - } - - const methodName = "GetWorkflowRunAttemptLogs" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Actions.GetWorkflowRunAttemptLogs(ctx, "\n", "\n", 399444496, 2, 1) - return err - }) } func TestActionsService_GetWorkflowRunAttemptLogs_StatusMovedPermanently_dontFollowRedirects(t *testing.T) { t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/repos/o/r/actions/runs/399444496/attempts/2/logs", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - http.Redirect(w, r, "http://github.com/a", http.StatusMovedPermanently) - }) + tcs := []struct { + name string + respectRateLimits bool + }{ + { + name: "withoutRateLimits", + respectRateLimits: false, + }, + { + name: "withRateLimits", + respectRateLimits: true, + }, + } - ctx := context.Background() - _, resp, _ := client.Actions.GetWorkflowRunAttemptLogs(ctx, "o", "r", 399444496, 2, 0) - if resp.StatusCode != http.StatusMovedPermanently { - t.Errorf("Actions.GetWorkflowRunAttemptLogs returned status: %d, want %d", resp.StatusCode, http.StatusMovedPermanently) + for _, tc := range tcs { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + client.RateLimitRedirectionalEndpoints = tc.respectRateLimits + + mux.HandleFunc("/repos/o/r/actions/runs/399444496/attempts/2/logs", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + http.Redirect(w, r, "http://github.com/a", http.StatusMovedPermanently) + }) + + ctx := context.Background() + _, resp, _ := client.Actions.GetWorkflowRunAttemptLogs(ctx, "o", "r", 399444496, 2, 0) + if resp.StatusCode != http.StatusMovedPermanently { + t.Errorf("Actions.GetWorkflowRunAttemptLogs returned status: %d, want %d", resp.StatusCode, http.StatusMovedPermanently) + } + }) } } func TestActionsService_GetWorkflowRunAttemptLogs_StatusMovedPermanently_followRedirects(t *testing.T) { t.Parallel() - client, mux, serverURL := setup(t) + tcs := []struct { + name string + respectRateLimits bool + }{ + { + name: "withoutRateLimits", + respectRateLimits: false, + }, + { + name: "withRateLimits", + respectRateLimits: true, + }, + } - // Mock a redirect link, which leads to an archive link - mux.HandleFunc("/repos/o/r/actions/runs/399444496/attempts/2/logs", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - redirectURL, _ := url.Parse(serverURL + baseURLPath + "/redirect") - http.Redirect(w, r, redirectURL.String(), http.StatusMovedPermanently) - }) + for _, tc := range tcs { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + client, mux, serverURL := setup(t) + client.RateLimitRedirectionalEndpoints = tc.respectRateLimits + + // Mock a redirect link, which leads to an archive link + mux.HandleFunc("/repos/o/r/actions/runs/399444496/attempts/2/logs", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + redirectURL, _ := url.Parse(serverURL + baseURLPath + "/redirect") + http.Redirect(w, r, redirectURL.String(), http.StatusMovedPermanently) + }) + + mux.HandleFunc("/redirect", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + http.Redirect(w, r, "http://github.com/a", http.StatusFound) + }) + + ctx := context.Background() + url, resp, err := client.Actions.GetWorkflowRunAttemptLogs(ctx, "o", "r", 399444496, 2, 1) + if err != nil { + t.Errorf("Actions.GetWorkflowRunAttemptLogs returned error: %v", err) + } - mux.HandleFunc("/redirect", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - http.Redirect(w, r, "http://github.com/a", http.StatusFound) - }) + if resp.StatusCode != http.StatusFound { + t.Errorf("Actions.GetWorkflowRunAttemptLogs returned status: %d, want %d", resp.StatusCode, http.StatusFound) + } - ctx := context.Background() - url, resp, err := client.Actions.GetWorkflowRunAttemptLogs(ctx, "o", "r", 399444496, 2, 1) - if err != nil { - t.Errorf("Actions.GetWorkflowRunAttemptLogs returned error: %v", err) - } + want := "http://github.com/a" + if url.String() != want { + t.Errorf("Actions.GetWorkflowRunAttemptLogs returned %+v, want %+v", url.String(), want) + } - if resp.StatusCode != http.StatusFound { - t.Errorf("Actions.GetWorkflowRunAttemptLogs returned status: %d, want %d", resp.StatusCode, http.StatusFound) + const methodName = "GetWorkflowRunAttemptLogs" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.GetWorkflowRunAttemptLogs(ctx, "\n", "\n", 399444496, 2, 1) + return err + }) + }) } +} - want := "http://github.com/a" - if url.String() != want { - t.Errorf("Actions.GetWorkflowRunAttemptLogs returned %+v, want %+v", url.String(), want) +func TestActionsService_GetWorkflowRunAttemptLogs_unexpectedCode(t *testing.T) { + t.Parallel() + tcs := []struct { + name string + respectRateLimits bool + }{ + { + name: "withoutRateLimits", + respectRateLimits: false, + }, + { + name: "withRateLimits", + respectRateLimits: true, + }, } - const methodName = "GetWorkflowRunAttemptLogs" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Actions.GetWorkflowRunAttemptLogs(ctx, "\n", "\n", 399444496, 2, 1) - return err - }) + for _, tc := range tcs { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + client, mux, serverURL := setup(t) + client.RateLimitRedirectionalEndpoints = tc.respectRateLimits + + // Mock a redirect link, which leads to an archive link + mux.HandleFunc("/repos/o/r/actions/runs/399444496/attempts/2/logs", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + redirectURL, _ := url.Parse(serverURL + baseURLPath + "/redirect") + http.Redirect(w, r, redirectURL.String(), http.StatusMovedPermanently) + }) + + mux.HandleFunc("/redirect", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + w.WriteHeader(http.StatusNoContent) + }) + + ctx := context.Background() + url, resp, err := client.Actions.GetWorkflowRunAttemptLogs(ctx, "o", "r", 399444496, 2, 1) + if err == nil { + t.Fatalf("Actions.GetWorkflowRunAttemptLogs should return error on unexpected code") + } + if !strings.Contains(err.Error(), "unexpected status code") { + t.Error("Actions.GetWorkflowRunAttemptLogs should return unexpected status code") + } + if got, want := resp.Response.StatusCode, http.StatusNoContent; got != want { + t.Errorf("Actions.GetWorkflowRunAttemptLogs return status %d, want %d", got, want) + } + if url != nil { + t.Errorf("Actions.GetWorkflowRunAttemptLogs return %+v, want nil", url) + } + }) + } } func TestActionsService_RerunWorkflowRunByID(t *testing.T) { @@ -389,85 +506,201 @@ func TestActionsService_CancelWorkflowRunByID(t *testing.T) { func TestActionsService_GetWorkflowRunLogs(t *testing.T) { t.Parallel() - client, mux, _ := setup(t) + tcs := []struct { + name string + respectRateLimits bool + }{ + { + name: "withoutRateLimits", + respectRateLimits: false, + }, + { + name: "withRateLimits", + respectRateLimits: true, + }, + } - mux.HandleFunc("/repos/o/r/actions/runs/399444496/logs", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - http.Redirect(w, r, "http://github.com/a", http.StatusFound) - }) + for _, tc := range tcs { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + client.RateLimitRedirectionalEndpoints = tc.respectRateLimits + + mux.HandleFunc("/repos/o/r/actions/runs/399444496/logs", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + http.Redirect(w, r, "http://github.com/a", http.StatusFound) + }) + + ctx := context.Background() + url, resp, err := client.Actions.GetWorkflowRunLogs(ctx, "o", "r", 399444496, 1) + if err != nil { + t.Errorf("Actions.GetWorkflowRunLogs returned error: %v", err) + } + if resp.StatusCode != http.StatusFound { + t.Errorf("Actions.GetWorkflowRunLogs returned status: %d, want %d", resp.StatusCode, http.StatusFound) + } + want := "http://github.com/a" + if url.String() != want { + t.Errorf("Actions.GetWorkflowRunLogs returned %+v, want %+v", url.String(), want) + } - ctx := context.Background() - url, resp, err := client.Actions.GetWorkflowRunLogs(ctx, "o", "r", 399444496, 1) - if err != nil { - t.Errorf("Actions.GetWorkflowRunLogs returned error: %v", err) + const methodName = "GetWorkflowRunLogs" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.GetWorkflowRunLogs(ctx, "\n", "\n", 399444496, 1) + return err + }) + }) } - if resp.StatusCode != http.StatusFound { - t.Errorf("Actions.GetWorkflowRunLogs returned status: %d, want %d", resp.StatusCode, http.StatusFound) - } - want := "http://github.com/a" - if url.String() != want { - t.Errorf("Actions.GetWorkflowRunLogs returned %+v, want %+v", url.String(), want) - } - - const methodName = "GetWorkflowRunLogs" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Actions.GetWorkflowRunLogs(ctx, "\n", "\n", 399444496, 1) - return err - }) } func TestActionsService_GetWorkflowRunLogs_StatusMovedPermanently_dontFollowRedirects(t *testing.T) { t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/repos/o/r/actions/runs/399444496/logs", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - http.Redirect(w, r, "http://github.com/a", http.StatusMovedPermanently) - }) + tcs := []struct { + name string + respectRateLimits bool + }{ + { + name: "withoutRateLimits", + respectRateLimits: false, + }, + { + name: "withRateLimits", + respectRateLimits: true, + }, + } - ctx := context.Background() - _, resp, _ := client.Actions.GetWorkflowRunLogs(ctx, "o", "r", 399444496, 0) - if resp.StatusCode != http.StatusMovedPermanently { - t.Errorf("Actions.GetWorkflowJobLogs returned status: %d, want %d", resp.StatusCode, http.StatusMovedPermanently) + for _, tc := range tcs { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + client.RateLimitRedirectionalEndpoints = tc.respectRateLimits + + mux.HandleFunc("/repos/o/r/actions/runs/399444496/logs", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + http.Redirect(w, r, "http://github.com/a", http.StatusMovedPermanently) + }) + + ctx := context.Background() + _, resp, _ := client.Actions.GetWorkflowRunLogs(ctx, "o", "r", 399444496, 0) + if resp.StatusCode != http.StatusMovedPermanently { + t.Errorf("Actions.GetWorkflowJobLogs returned status: %d, want %d", resp.StatusCode, http.StatusMovedPermanently) + } + }) } } func TestActionsService_GetWorkflowRunLogs_StatusMovedPermanently_followRedirects(t *testing.T) { t.Parallel() - client, mux, serverURL := setup(t) + tcs := []struct { + name string + respectRateLimits bool + }{ + { + name: "withoutRateLimits", + respectRateLimits: false, + }, + { + name: "withRateLimits", + respectRateLimits: true, + }, + } - // Mock a redirect link, which leads to an archive link - mux.HandleFunc("/repos/o/r/actions/runs/399444496/logs", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - redirectURL, _ := url.Parse(serverURL + baseURLPath + "/redirect") - http.Redirect(w, r, redirectURL.String(), http.StatusMovedPermanently) - }) + for _, tc := range tcs { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + client, mux, serverURL := setup(t) + client.RateLimitRedirectionalEndpoints = tc.respectRateLimits + + // Mock a redirect link, which leads to an archive link + mux.HandleFunc("/repos/o/r/actions/runs/399444496/logs", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + redirectURL, _ := url.Parse(serverURL + baseURLPath + "/redirect") + http.Redirect(w, r, redirectURL.String(), http.StatusMovedPermanently) + }) + + mux.HandleFunc("/redirect", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + http.Redirect(w, r, "http://github.com/a", http.StatusFound) + }) + + ctx := context.Background() + url, resp, err := client.Actions.GetWorkflowRunLogs(ctx, "o", "r", 399444496, 1) + if err != nil { + t.Errorf("Actions.GetWorkflowJobLogs returned error: %v", err) + } - mux.HandleFunc("/redirect", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - http.Redirect(w, r, "http://github.com/a", http.StatusFound) - }) + if resp.StatusCode != http.StatusFound { + t.Errorf("Actions.GetWorkflowJobLogs returned status: %d, want %d", resp.StatusCode, http.StatusFound) + } - ctx := context.Background() - url, resp, err := client.Actions.GetWorkflowRunLogs(ctx, "o", "r", 399444496, 1) - if err != nil { - t.Errorf("Actions.GetWorkflowJobLogs returned error: %v", err) - } + want := "http://github.com/a" + if url.String() != want { + t.Errorf("Actions.GetWorkflowJobLogs returned %+v, want %+v", url.String(), want) + } - if resp.StatusCode != http.StatusFound { - t.Errorf("Actions.GetWorkflowJobLogs returned status: %d, want %d", resp.StatusCode, http.StatusFound) + const methodName = "GetWorkflowRunLogs" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.GetWorkflowRunLogs(ctx, "\n", "\n", 399444496, 1) + return err + }) + }) } +} - want := "http://github.com/a" - if url.String() != want { - t.Errorf("Actions.GetWorkflowJobLogs returned %+v, want %+v", url.String(), want) +func TestActionsService_GetWorkflowRunLogs_unexpectedCode(t *testing.T) { + t.Parallel() + tcs := []struct { + name string + respectRateLimits bool + }{ + { + name: "withoutRateLimits", + respectRateLimits: false, + }, + { + name: "withRateLimits", + respectRateLimits: true, + }, } - const methodName = "GetWorkflowRunLogs" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Actions.GetWorkflowRunLogs(ctx, "\n", "\n", 399444496, 1) - return err - }) + for _, tc := range tcs { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + client, mux, serverURL := setup(t) + client.RateLimitRedirectionalEndpoints = tc.respectRateLimits + + // Mock a redirect link, which leads to an archive link + mux.HandleFunc("/repos/o/r/actions/runs/399444496/logs", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + redirectURL, _ := url.Parse(serverURL + baseURLPath + "/redirect") + http.Redirect(w, r, redirectURL.String(), http.StatusMovedPermanently) + }) + + mux.HandleFunc("/redirect", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + w.WriteHeader(http.StatusNoContent) + }) + + ctx := context.Background() + url, resp, err := client.Actions.GetWorkflowRunLogs(ctx, "o", "r", 399444496, 1) + if err == nil { + t.Fatalf("Actions.GetWorkflowRunLogs should return error on unexpected code") + } + if !strings.Contains(err.Error(), "unexpected status code") { + t.Error("Actions.GetWorkflowRunLogs should return unexpected status code") + } + if got, want := resp.Response.StatusCode, http.StatusNoContent; got != want { + t.Errorf("Actions.GetWorkflowRunLogs return status %d, want %d", got, want) + } + if url != nil { + t.Errorf("Actions.GetWorkflowRunLogs return %+v, want nil", url) + } + }) + } } func TestActionService_ListRepositoryWorkflowRuns(t *testing.T) { diff --git a/github/github.go b/github/github.go index 4e5a33c67e4..fe74c75f7a7 100644 --- a/github/github.go +++ b/github/github.go @@ -155,8 +155,9 @@ var errNonNilContext = errors.New("context must be non-nil") // A Client manages communication with the GitHub API. type Client struct { - clientMu sync.Mutex // clientMu protects the client during calls that modify the CheckRedirect func. - client *http.Client // HTTP client used to communicate with the API. + clientMu sync.Mutex // clientMu protects the client during calls that modify the CheckRedirect func. + client *http.Client // HTTP client used to communicate with the API. + clientIgnoreRedirects *http.Client // HTTP client used to communicate with the API on endpoints where we don't want to follow redirects. // Base URL for API requests. Defaults to the public GitHub API, but can be // set to a domain endpoint to use with GitHub Enterprise. BaseURL should @@ -173,6 +174,9 @@ type Client struct { rateLimits [Categories]Rate // Rate limits for the client as determined by the most recent API calls. secondaryRateLimitReset time.Time // Secondary rate limit reset for the client as determined by the most recent API calls. + // Whether to respect rate limit headers on endpoints that return 302 redirections to artifacts + RateLimitRedirectionalEndpoints bool + common service // Reuse a single struct instead of allocating one for each service on the heap. // Services used for talking to different parts of the GitHub API. @@ -394,6 +398,14 @@ func (c *Client) initialize() { if c.client == nil { c.client = &http.Client{} } + // Copy the main http client into the IgnoreRedirects one, overriding the `CheckRedirect` func + c.clientIgnoreRedirects = &http.Client{} + c.clientIgnoreRedirects.Transport = c.client.Transport + c.clientIgnoreRedirects.Timeout = c.client.Timeout + c.clientIgnoreRedirects.Jar = c.client.Jar + c.clientIgnoreRedirects.CheckRedirect = func(req *http.Request, via []*http.Request) error { + return http.ErrUseLastResponse + } if c.BaseURL == nil { c.BaseURL, _ = url.Parse(defaultBaseURL) } @@ -448,11 +460,12 @@ func (c *Client) copy() *Client { c.clientMu.Lock() // can't use *c here because that would copy mutexes by value. clone := Client{ - client: &http.Client{}, - UserAgent: c.UserAgent, - BaseURL: c.BaseURL, - UploadURL: c.UploadURL, - secondaryRateLimitReset: c.secondaryRateLimitReset, + client: &http.Client{}, + UserAgent: c.UserAgent, + BaseURL: c.BaseURL, + UploadURL: c.UploadURL, + RateLimitRedirectionalEndpoints: c.RateLimitRedirectionalEndpoints, + secondaryRateLimitReset: c.secondaryRateLimitReset, } c.clientMu.Unlock() if c.client != nil { @@ -805,15 +818,15 @@ const ( SleepUntilPrimaryRateLimitResetWhenRateLimited ) -// BareDo sends an API request and lets you handle the api response. If an error -// or API Error occurs, the error will contain more information. Otherwise you -// are supposed to read and close the response's Body. If rate limit is exceeded -// and reset time is in the future, BareDo returns *RateLimitError immediately -// without making a network API call. +// bareDo sends an API request using `caller` http.Client passed in the parameters +// and lets you handle the api response. If an error or API Error occurs, the error +// will contain more information. Otherwise you are supposed to read and close the +// response's Body. If rate limit is exceeded and reset time is in the future, +// bareDo returns *RateLimitError immediately without making a network API call. // // The provided ctx must be non-nil, if it is nil an error is returned. If it is // canceled or times out, ctx.Err() will be returned. -func (c *Client) BareDo(ctx context.Context, req *http.Request) (*Response, error) { +func (c *Client) bareDo(ctx context.Context, caller *http.Client, req *http.Request) (*Response, error) { if ctx == nil { return nil, errNonNilContext } @@ -838,7 +851,7 @@ func (c *Client) BareDo(ctx context.Context, req *http.Request) (*Response, erro } } - resp, err := c.client.Do(req) + resp, err := caller.Do(req) var response *Response if resp != nil { response = newResponse(resp) @@ -897,7 +910,7 @@ func (c *Client) BareDo(ctx context.Context, req *http.Request) (*Response, erro return response, err } // retry the request once when the rate limit has reset - return c.BareDo(context.WithValue(req.Context(), SleepUntilPrimaryRateLimitResetWhenRateLimited, nil), req) + return c.bareDo(context.WithValue(req.Context(), SleepUntilPrimaryRateLimitResetWhenRateLimited, nil), caller, req) } // Update the secondary rate limit if we hit it. @@ -911,6 +924,73 @@ func (c *Client) BareDo(ctx context.Context, req *http.Request) (*Response, erro return response, err } +// BareDo sends an API request and lets you handle the api response. If an error +// or API Error occurs, the error will contain more information. Otherwise you +// are supposed to read and close the response's Body. If rate limit is exceeded +// and reset time is in the future, BareDo returns *RateLimitError immediately +// without making a network API call. +// +// The provided ctx must be non-nil, if it is nil an error is returned. If it is +// canceled or times out, ctx.Err() will be returned. +func (c *Client) BareDo(ctx context.Context, req *http.Request) (*Response, error) { + return c.bareDo(ctx, c.client, req) +} + +// bareDoIgnoreRedirects has the exact same behavior as BareDo but stops at the first +// redirection code returned by the API. If a redirection is returned by the api, bareDoIgnoreRedirects +// returns a *RedirectionError. +// +// The provided ctx must be non-nil, if it is nil an error is returned. If it is +// canceled or times out, ctx.Err() will be returned. +func (c *Client) bareDoIgnoreRedirects(ctx context.Context, req *http.Request) (*Response, error) { + return c.bareDo(ctx, c.clientIgnoreRedirects, req) +} + +var errInvalidLocation = errors.New("invalid or empty Location header in redirection response") + +// bareDoUntilFound has the exact same behavior as BareDo but only follows 301s, up to maxRedirects times. If it receives +// a 302, it will parse the Location header into a *url.URL and return that. +// This is useful for endpoints that return a 302 in successful cases but still might return 301s for +// permanent redirections. +// +// The provided ctx must be non-nil, if it is nil an error is returned. If it is +// canceled or times out, ctx.Err() will be returned. +func (c *Client) bareDoUntilFound(ctx context.Context, req *http.Request, maxRedirects int) (*url.URL, *Response, error) { + response, err := c.bareDoIgnoreRedirects(ctx, req) + + if err != nil { + rerr, ok := err.(*RedirectionError) + if ok { + // If we receive a 302, transform potential relative locations into absolute and return it. + if rerr.StatusCode == http.StatusFound { + if rerr.Location == nil { + return nil, nil, errInvalidLocation + } + newURL := c.BaseURL.ResolveReference(rerr.Location) + return newURL, response, nil + } + // If permanent redirect response is returned, follow it + if maxRedirects > 0 && rerr.StatusCode == http.StatusMovedPermanently { + if rerr.Location == nil { + return nil, nil, errInvalidLocation + } + newURL := c.BaseURL.ResolveReference(rerr.Location) + newRequest := req.Clone(ctx) + newRequest.URL = newURL + return c.bareDoUntilFound(ctx, newRequest, maxRedirects-1) + } + // If we reached the maximum amount of redirections, return an error + if maxRedirects <= 0 && rerr.StatusCode == http.StatusMovedPermanently { + return nil, response, fmt.Errorf("reached the maximum amount of redirections: %w", err) + } + return nil, response, fmt.Errorf("unexepected redirection response: %w", err) + } + } + + // If we don't receive a redirection, forward the response and potential error + return nil, response, err +} + // Do sends an API request and returns the API response. The API response is // JSON decoded and stored in the value pointed to by v, or returned as an // error if an API error has occurred. If v implements the io.Writer interface, @@ -1196,6 +1276,40 @@ func (r *AbuseRateLimitError) Is(target error) bool { compareHTTPResponse(r.Response, v.Response) } +// RedirectionError represents a response that returned a redirect status code: +// +// 301 (Moved Permanently) +// 302 (Found) +// 303 (See Other) +// 307 (Temporary Redirect) +// 308 (Permanent Redirect) +// +// If there was a valid Location header included, it will be parsed to a URL. You should use +// `BaseURL.ResolveReference()` to enrich it with the correct hostname where needed. +type RedirectionError struct { + Response *http.Response // HTTP response that caused this error + StatusCode int + Location *url.URL // location header of the redirection if present +} + +func (r *RedirectionError) Error() string { + return fmt.Sprintf("%v %v: %d location %v", + r.Response.Request.Method, sanitizeURL(r.Response.Request.URL), + r.StatusCode, sanitizeURL(r.Location)) +} + +// Is returns whether the provided error equals this error. +func (r *RedirectionError) Is(target error) bool { + v, ok := target.(*RedirectionError) + if !ok { + return false + } + + return r.StatusCode == v.StatusCode && + (r.Location == v.Location || // either both locations are nil or exactly the same pointer + r.Location != nil && v.Location != nil && r.Location.String() == v.Location.String()) // or they are both not nil and marshalled identically +} + // sanitizeURL redacts the client_secret parameter from the URL which may be // exposed to the user. func sanitizeURL(uri *url.URL) *url.URL { @@ -1260,7 +1374,8 @@ func (e *Error) UnmarshalJSON(data []byte) error { // // The error type will be *RateLimitError for rate limit exceeded errors, // *AcceptedError for 202 Accepted status codes, -// and *TwoFactorAuthError for two-factor authentication errors. +// *TwoFactorAuthError for two-factor authentication errors, +// and *RedirectionError for redirect status codes (only happens when ignoring redirections). func CheckResponse(r *http.Response) error { if r.StatusCode == http.StatusAccepted { return &AcceptedError{} @@ -1302,6 +1417,25 @@ func CheckResponse(r *http.Response) error { abuseRateLimitError.RetryAfter = retryAfter } return abuseRateLimitError + // Check that the status code is a redirection and return a sentinel error that can be used to handle special cases + // where 302 is considered a successful result. + // This should never happen with the default `CheckRedirect`, because it would return a `url.Error` that should be handled upstream. + case r.StatusCode == http.StatusMovedPermanently || + r.StatusCode == http.StatusFound || + r.StatusCode == http.StatusSeeOther || + r.StatusCode == http.StatusTemporaryRedirect || + r.StatusCode == http.StatusPermanentRedirect: + + locationStr := r.Header.Get("Location") + var location *url.URL + if locationStr != "" { + location, _ = url.Parse(locationStr) + } + return &RedirectionError{ + Response: errorResponse.Response, + StatusCode: r.StatusCode, + Location: location, + } default: return errorResponse } diff --git a/github/github_test.go b/github/github_test.go index 43c9bde4f82..16257b384c2 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -1824,6 +1824,48 @@ func TestDo_noContent(t *testing.T) { } } +func TestBareDoUntilFound_redirectLoop(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + http.Redirect(w, r, baseURLPath, http.StatusMovedPermanently) + }) + + req, _ := client.NewRequest("GET", ".", nil) + ctx := context.Background() + _, _, err := client.bareDoUntilFound(ctx, req, 1) + + if err == nil { + t.Error("Expected error to be returned.") + } + var rerr *RedirectionError + if !errors.As(err, &rerr) { + t.Errorf("Expected a Redirection error; got %#v.", err) + } +} + +func TestBareDoUntilFound_UnexpectedRedirection(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + http.Redirect(w, r, baseURLPath, http.StatusSeeOther) + }) + + req, _ := client.NewRequest("GET", ".", nil) + ctx := context.Background() + _, _, err := client.bareDoUntilFound(ctx, req, 1) + + if err == nil { + t.Error("Expected error to be returned.") + } + var rerr *RedirectionError + if !errors.As(err, &rerr) { + t.Errorf("Expected a Redirection error; got %#v.", err) + } +} + func TestSanitizeURL(t *testing.T) { t.Parallel() tests := []struct { @@ -1925,6 +1967,38 @@ func TestCheckResponse_AbuseRateLimit(t *testing.T) { } } +func TestCheckResponse_RedirectionError(t *testing.T) { + t.Parallel() + urlStr := "/foo/bar" + + res := &http.Response{ + Request: &http.Request{}, + StatusCode: http.StatusFound, + Header: http.Header{}, + Body: io.NopCloser(strings.NewReader(``)), + } + res.Header.Set("Location", urlStr) + err := CheckResponse(res).(*RedirectionError) + + if err == nil { + t.Errorf("Expected error response.") + } + + wantedURL, parseErr := url.Parse(urlStr) + if parseErr != nil { + t.Errorf("Error parsing fixture url: %v", parseErr) + } + + want := &RedirectionError{ + Response: res, + StatusCode: http.StatusFound, + Location: wantedURL, + } + if !errors.Is(err, want) { + t.Errorf("Error = %#v, want %#v", err, want) + } +} + func TestCompareHttpResponse(t *testing.T) { t.Parallel() testcases := map[string]struct { diff --git a/github/repos_contents.go b/github/repos_contents.go index 3a0c266b5ee..383988bf296 100644 --- a/github/repos_contents.go +++ b/github/repos_contents.go @@ -348,6 +348,15 @@ func (s *RepositoriesService) GetArchiveLink(ctx context.Context, owner, repo st if opts != nil && opts.Ref != "" { u += fmt.Sprintf("/%s", opts.Ref) } + + if s.client.RateLimitRedirectionalEndpoints { + return s.getArchiveLinkWithRateLimit(ctx, u, maxRedirects) + } + + return s.getArchiveLinkWithoutRateLimit(ctx, u, maxRedirects) +} + +func (s *RepositoriesService) getArchiveLinkWithoutRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) { resp, err := s.client.roundTripWithOptionalFollowRedirect(ctx, u, maxRedirects) if err != nil { return nil, nil, err @@ -355,7 +364,7 @@ func (s *RepositoriesService) GetArchiveLink(ctx context.Context, owner, repo st defer resp.Body.Close() if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusFound { - return nil, newResponse(resp), fmt.Errorf("unexpected status code: %s", resp.Status) + return nil, newResponse(resp), fmt.Errorf("unexpected status code: %v", resp.Status) } parsedURL, err := url.Parse(resp.Header.Get("Location")) @@ -365,3 +374,23 @@ func (s *RepositoriesService) GetArchiveLink(ctx context.Context, owner, repo st return parsedURL, newResponse(resp), nil } + +func (s *RepositoriesService) getArchiveLinkWithRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) { + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + url, resp, err := s.client.bareDoUntilFound(ctx, req, maxRedirects) + if err != nil { + return nil, resp, err + } + defer resp.Body.Close() + + // If we didn't receive a valid Location in a 302 response + if url == nil { + return nil, resp, fmt.Errorf("unexpected status code: %v", resp.Status) + } + + return url, resp, nil +} diff --git a/github/repos_contents_test.go b/github/repos_contents_test.go index e75a00e6d5c..84f660eca15 100644 --- a/github/repos_contents_test.go +++ b/github/repos_contents_test.go @@ -707,81 +707,144 @@ func TestRepositoriesService_DeleteFile(t *testing.T) { func TestRepositoriesService_GetArchiveLink(t *testing.T) { t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/repos/o/r/tarball/yo", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - http.Redirect(w, r, "http://github.com/a", http.StatusFound) - }) - ctx := context.Background() - url, resp, err := client.Repositories.GetArchiveLink(ctx, "o", "r", Tarball, &RepositoryContentGetOptions{Ref: "yo"}, 1) - if err != nil { - t.Errorf("Repositories.GetArchiveLink returned error: %v", err) - } - if resp.StatusCode != http.StatusFound { - t.Errorf("Repositories.GetArchiveLink returned status: %d, want %d", resp.StatusCode, http.StatusFound) - } - want := "http://github.com/a" - if url.String() != want { - t.Errorf("Repositories.GetArchiveLink returned %+v, want %+v", url.String(), want) + tcs := []struct { + name string + respectRateLimits bool + }{ + { + name: "withoutRateLimits", + respectRateLimits: false, + }, + { + name: "withRateLimits", + respectRateLimits: true, + }, } - const methodName = "GetArchiveLink" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.GetArchiveLink(ctx, "\n", "\n", Tarball, &RepositoryContentGetOptions{}, 1) - return err - }) + for _, tc := range tcs { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + client.RateLimitRedirectionalEndpoints = tc.respectRateLimits + + mux.HandleFunc("/repos/o/r/tarball/yo", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + http.Redirect(w, r, "http://github.com/a", http.StatusFound) + }) + ctx := context.Background() + url, resp, err := client.Repositories.GetArchiveLink(ctx, "o", "r", Tarball, &RepositoryContentGetOptions{Ref: "yo"}, 1) + if err != nil { + t.Errorf("Repositories.GetArchiveLink returned error: %v", err) + } + if resp.StatusCode != http.StatusFound { + t.Errorf("Repositories.GetArchiveLink returned status: %d, want %d", resp.StatusCode, http.StatusFound) + } + want := "http://github.com/a" + if url.String() != want { + t.Errorf("Repositories.GetArchiveLink returned %+v, want %+v", url.String(), want) + } - // Add custom round tripper - client.client.Transport = roundTripperFunc(func(r *http.Request) (*http.Response, error) { - return nil, errors.New("failed to get archive link") - }) - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Repositories.GetArchiveLink(ctx, "o", "r", Tarball, &RepositoryContentGetOptions{}, 1) - return err - }) + const methodName = "GetArchiveLink" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.GetArchiveLink(ctx, "\n", "\n", Tarball, &RepositoryContentGetOptions{}, 1) + return err + }) + + // Add custom round tripper + client.client.Transport = roundTripperFunc(func(r *http.Request) (*http.Response, error) { + return nil, errors.New("failed to get archive link") + }) + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.GetArchiveLink(ctx, "o", "r", Tarball, &RepositoryContentGetOptions{}, 1) + return err + }) + }) + } } func TestRepositoriesService_GetArchiveLink_StatusMovedPermanently_dontFollowRedirects(t *testing.T) { t.Parallel() - client, mux, _ := setup(t) + tcs := []struct { + name string + respectRateLimits bool + }{ + { + name: "withoutRateLimits", + respectRateLimits: false, + }, + { + name: "withRateLimits", + respectRateLimits: true, + }, + } - mux.HandleFunc("/repos/o/r/tarball", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - http.Redirect(w, r, "http://github.com/a", http.StatusMovedPermanently) - }) - ctx := context.Background() - _, resp, _ := client.Repositories.GetArchiveLink(ctx, "o", "r", Tarball, &RepositoryContentGetOptions{}, 0) - if resp.StatusCode != http.StatusMovedPermanently { - t.Errorf("Repositories.GetArchiveLink returned status: %d, want %d", resp.StatusCode, http.StatusMovedPermanently) + for _, tc := range tcs { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + client.RateLimitRedirectionalEndpoints = tc.respectRateLimits + + mux.HandleFunc("/repos/o/r/tarball", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + http.Redirect(w, r, "http://github.com/a", http.StatusMovedPermanently) + }) + ctx := context.Background() + _, resp, _ := client.Repositories.GetArchiveLink(ctx, "o", "r", Tarball, &RepositoryContentGetOptions{}, 0) + if resp.StatusCode != http.StatusMovedPermanently { + t.Errorf("Repositories.GetArchiveLink returned status: %d, want %d", resp.StatusCode, http.StatusMovedPermanently) + } + }) } } func TestRepositoriesService_GetArchiveLink_StatusMovedPermanently_followRedirects(t *testing.T) { t.Parallel() - client, mux, serverURL := setup(t) - - // Mock a redirect link, which leads to an archive link - mux.HandleFunc("/repos/o/r/tarball", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - redirectURL, _ := url.Parse(serverURL + baseURLPath + "/redirect") - http.Redirect(w, r, redirectURL.String(), http.StatusMovedPermanently) - }) - mux.HandleFunc("/redirect", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - http.Redirect(w, r, "http://github.com/a", http.StatusFound) - }) - ctx := context.Background() - url, resp, err := client.Repositories.GetArchiveLink(ctx, "o", "r", Tarball, &RepositoryContentGetOptions{}, 1) - if err != nil { - t.Errorf("Repositories.GetArchiveLink returned error: %v", err) - } - if resp.StatusCode != http.StatusFound { - t.Errorf("Repositories.GetArchiveLink returned status: %d, want %d", resp.StatusCode, http.StatusFound) + tcs := []struct { + name string + respectRateLimits bool + }{ + { + name: "withoutRateLimits", + respectRateLimits: false, + }, + { + name: "withRateLimits", + respectRateLimits: true, + }, } - want := "http://github.com/a" - if url.String() != want { - t.Errorf("Repositories.GetArchiveLink returned %+v, want %+v", url.String(), want) + + for _, tc := range tcs { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + client, mux, serverURL := setup(t) + client.RateLimitRedirectionalEndpoints = tc.respectRateLimits + + // Mock a redirect link, which leads to an archive link + mux.HandleFunc("/repos/o/r/tarball", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + redirectURL, _ := url.Parse(serverURL + baseURLPath + "/redirect") + http.Redirect(w, r, redirectURL.String(), http.StatusMovedPermanently) + }) + mux.HandleFunc("/redirect", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + http.Redirect(w, r, "http://github.com/a", http.StatusFound) + }) + ctx := context.Background() + url, resp, err := client.Repositories.GetArchiveLink(ctx, "o", "r", Tarball, &RepositoryContentGetOptions{}, 1) + if err != nil { + t.Errorf("Repositories.GetArchiveLink returned error: %v", err) + } + if resp.StatusCode != http.StatusFound { + t.Errorf("Repositories.GetArchiveLink returned status: %d, want %d", resp.StatusCode, http.StatusFound) + } + want := "http://github.com/a" + if url.String() != want { + t.Errorf("Repositories.GetArchiveLink returned %+v, want %+v", url.String(), want) + } + }) } } From 16495de4bae4535a0f20f0dd066a031addedc320 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Mon, 6 Jan 2025 14:19:19 -0500 Subject: [PATCH 607/751] Update OpenAPI (#3419) --- github/copilot.go | 6 +- openapi_operations.yaml | 135 ++++++++++++++++++++++++++++++++++++---- 2 files changed, 127 insertions(+), 14 deletions(-) diff --git a/github/copilot.go b/github/copilot.go index a2b2aa09953..b9adfcb4eec 100644 --- a/github/copilot.go +++ b/github/copilot.go @@ -307,7 +307,7 @@ func (s *CopilotService) ListCopilotSeats(ctx context.Context, org string, opts // // To paginate through all seats, populate 'Page' with the number of the last page. // -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#list-all-copilot-seat-assignments-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-user-management#list-all-copilot-seat-assignments-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/copilot/billing/seats func (s *CopilotService) ListCopilotEnterpriseSeats(ctx context.Context, enterprise string, opts *ListOptions) (*ListCopilotSeatsResponse, *Response, error) { @@ -467,7 +467,7 @@ func (s *CopilotService) GetSeatDetails(ctx context.Context, org, user string) ( // GetEnterpriseMetrics gets Copilot usage metrics for an enterprise. // -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/copilot/metrics func (s *CopilotService) GetEnterpriseMetrics(ctx context.Context, enterprise string, opts *CopilotMetricsListOptions) ([]*CopilotMetrics, *Response, error) { @@ -493,7 +493,7 @@ func (s *CopilotService) GetEnterpriseMetrics(ctx context.Context, enterprise st // GetEnterpriseTeamMetrics gets Copilot usage metrics for an enterprise team. // -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise-team +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise-team // //meta:operation GET /enterprises/{enterprise}/team/{team_slug}/copilot/metrics func (s *CopilotService) GetEnterpriseTeamMetrics(ctx context.Context, enterprise, team string, opts *CopilotMetricsListOptions) ([]*CopilotMetrics, *Response, error) { diff --git a/openapi_operations.yaml b/openapi_operations.yaml index 3539219e2ab..d144ca7e38c 100644 --- a/openapi_operations.yaml +++ b/openapi_operations.yaml @@ -47,7 +47,7 @@ operation_overrides: documentation_url: https://docs.github.com/rest/pages/pages#request-a-github-pages-build - name: GET /repos/{owner}/{repo}/pages/builds/{build_id} documentation_url: https://docs.github.com/rest/pages/pages#get-github-pages-build -openapi_commit: 4ab8513682637010cd3bb5d8ee3227cc5ce739d1 +openapi_commit: 8031023b31a852778532c5fa688b8bb6bcbab9d6 openapi_operations: - name: GET / documentation_url: https://docs.github.com/rest/meta/meta#github-api-root @@ -729,6 +729,51 @@ openapi_operations: openapi_files: - descriptions/ghec/ghec.json - descriptions/ghes-3.15/ghes-3.15.json + - name: GET /enterprises/{enterprise}/code-security/configurations + documentation_url: https://docs.github.com/rest/code-security/configurations#get-code-security-configurations-for-an-enterprise + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: POST /enterprises/{enterprise}/code-security/configurations + documentation_url: https://docs.github.com/rest/code-security/configurations#create-a-code-security-configuration-for-an-enterprise + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /enterprises/{enterprise}/code-security/configurations/defaults + documentation_url: https://docs.github.com/rest/code-security/configurations#get-default-code-security-configurations-for-an-enterprise + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id} + documentation_url: https://docs.github.com/rest/code-security/configurations#delete-a-code-security-configuration-for-an-enterprise + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /enterprises/{enterprise}/code-security/configurations/{configuration_id} + documentation_url: https://docs.github.com/rest/code-security/configurations#retrieve-a-code-security-configuration-of-an-enterprise + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id} + documentation_url: https://docs.github.com/rest/code-security/configurations#update-a-custom-code-security-configuration-for-an-enterprise + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach + documentation_url: https://docs.github.com/rest/code-security/configurations#attach-an-enterprise-configuration-to-repositories + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults + documentation_url: https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-enterprise + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories + documentation_url: https://docs.github.com/rest/code-security/configurations#get-repositories-associated-with-an-enterprise-code-security-configuration + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /enterprises/{enterprise}/code_security_and_analysis documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#get-code-security-and-analysis-features-for-an-enterprise openapi_files: @@ -744,19 +789,16 @@ openapi_operations: openapi_files: - descriptions/ghec/ghec.json - name: GET /enterprises/{enterprise}/copilot/billing/seats - documentation_url: https://docs.github.com/rest/copilot/copilot-user-management#list-all-copilot-seat-assignments-for-an-enterprise + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-user-management#list-all-copilot-seat-assignments-for-an-enterprise openapi_files: - - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: GET /enterprises/{enterprise}/copilot/metrics - documentation_url: https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise openapi_files: - - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: GET /enterprises/{enterprise}/copilot/usage - documentation_url: https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-enterprise-members + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-enterprise-members openapi_files: - - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: GET /enterprises/{enterprise}/dependabot/alerts documentation_url: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-enterprise @@ -788,6 +830,22 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/custom-properties#create-or-update-a-custom-property-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json + - name: POST /enterprises/{enterprise}/rulesets + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/rules#create-an-enterprise-repository-ruleset + openapi_files: + - descriptions/ghec/ghec.json + - name: DELETE /enterprises/{enterprise}/rulesets/{ruleset_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/rules#delete-an-enterprise-repository-ruleset + openapi_files: + - descriptions/ghec/ghec.json + - name: GET /enterprises/{enterprise}/rulesets/{ruleset_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/rules#get-an-enterprise-repository-ruleset + openapi_files: + - descriptions/ghec/ghec.json + - name: PUT /enterprises/{enterprise}/rulesets/{ruleset_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/rules#update-an-enterprise-repository-ruleset + openapi_files: + - descriptions/ghec/ghec.json - name: GET /enterprises/{enterprise}/secret-scanning/alerts documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-enterprise openapi_files: @@ -828,14 +886,12 @@ openapi_operations: openapi_files: - descriptions/ghec/ghec.json - name: GET /enterprises/{enterprise}/team/{team_slug}/copilot/metrics - documentation_url: https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise-team + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise-team openapi_files: - - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: GET /enterprises/{enterprise}/team/{team_slug}/copilot/usage - documentation_url: https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-an-enterprise-team + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-an-enterprise-team openapi_files: - - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: POST /enterprises/{enterprise}/{security_product}/{enablement} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#enable-or-disable-a-security-feature @@ -1615,6 +1671,10 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/bypass-requests/push-rules + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/bypass-requests#list-push-rule-bypass-requests-within-an-organization + openapi_files: + - descriptions/ghec/ghec.json - name: GET /orgs/{org}/code-scanning/alerts documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-organization openapi_files: @@ -2398,6 +2458,36 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/org-pre-receive-hooks#update-pre-receive-hook-enforcement-for-an-organization openapi_files: - descriptions/ghes-3.15/ghes-3.15.json + - name: GET /orgs/{org}/private-registries + documentation_url: https://docs.github.com/rest/private-registries/organization-configurations#list-private-registries-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: POST /orgs/{org}/private-registries + documentation_url: https://docs.github.com/rest/private-registries/organization-configurations#create-a-private-registry-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/private-registries/public-key + documentation_url: https://docs.github.com/rest/private-registries/organization-configurations#get-private-registries-public-key-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /orgs/{org}/private-registries/{secret_name} + documentation_url: https://docs.github.com/rest/private-registries/organization-configurations#delete-a-private-registry-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/private-registries/{secret_name} + documentation_url: https://docs.github.com/rest/private-registries/organization-configurations#get-a-private-registry-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PATCH /orgs/{org}/private-registries/{secret_name} + documentation_url: https://docs.github.com/rest/private-registries/organization-configurations#update-a-private-registry-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /orgs/{org}/projects documentation_url: https://docs.github.com/rest/projects/projects#list-organization-projects openapi_files: @@ -3699,6 +3789,14 @@ openapi_operations: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.15/ghes-3.15.json + - name: GET /repos/{owner}/{repo}/bypass-requests/push-rules + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/repos/bypass-requests#list-repository-push-rule-bypass-requests + openapi_files: + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/bypass-requests/push-rules/{bypass_request_number} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/repos/bypass-requests#get-a-repository-push-bypass-request + openapi_files: + - descriptions/ghec/ghec.json - name: POST /repos/{owner}/{repo}/check-runs documentation_url: https://docs.github.com/rest/checks/runs#create-a-check-run openapi_files: @@ -3777,6 +3875,21 @@ openapi_operations: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.15/ghes-3.15.json + - name: GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix + documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-the-status-of-an-autofix-for-a-code-scanning-alert + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix + documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#create-an-autofix-for-a-code-scanning-alert + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits + documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#commit-an-autofix-for-a-code-scanning-alert + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-instances-of-a-code-scanning-alert openapi_files: From cd880c603cb76925a9bcf3325f2877902ab0a0eb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 14:30:54 -0500 Subject: [PATCH 608/751] build(deps): bump golang.org/x/net from 0.33.0 to 0.34.0 in /scrape (#3420) --- scrape/go.mod | 2 +- scrape/go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 69c6248ac60..aa681f89a34 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -7,7 +7,7 @@ require ( github.com/google/go-cmp v0.6.0 github.com/google/go-github/v68 v68.0.0 github.com/xlzd/gotp v0.1.0 - golang.org/x/net v0.33.0 + golang.org/x/net v0.34.0 ) require ( diff --git a/scrape/go.sum b/scrape/go.sum index 13b9cf2ae28..c596dce4b40 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -31,8 +31,9 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= From 80c57ff7188e53e12015f2851ae272fc6c981456 Mon Sep 17 00:00:00 2001 From: Tom Bamford Date: Tue, 7 Jan 2025 13:26:26 +0000 Subject: [PATCH 609/751] Permit toggling rate limit check by consumers (#3386) --- github/github.go | 8 ++++++-- github/github_test.go | 2 +- github/rate_limit.go | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/github/github.go b/github/github.go index fe74c75f7a7..5fce6381c69 100644 --- a/github/github.go +++ b/github/github.go @@ -814,7 +814,11 @@ func parseTokenExpiration(r *http.Response) Timestamp { type requestContext uint8 const ( - bypassRateLimitCheck requestContext = iota + // BypassRateLimitCheck prevents a pre-emptive check for exceeded primary rate limits + // Specify this by providing a context with this key, e.g. + // context.WithValue(context.Background(), github.BypassRateLimitCheck, true) + BypassRateLimitCheck requestContext = iota + SleepUntilPrimaryRateLimitResetWhenRateLimited ) @@ -835,7 +839,7 @@ func (c *Client) bareDo(ctx context.Context, caller *http.Client, req *http.Requ rateLimitCategory := GetRateLimitCategory(req.Method, req.URL.Path) - if bypass := ctx.Value(bypassRateLimitCheck); bypass == nil { + if bypass := ctx.Value(BypassRateLimitCheck); bypass == nil { // If we've hit rate limit, don't make further requests before Reset time. if err := c.checkRateLimitBeforeDo(req, rateLimitCategory); err != nil { return &Response{ diff --git a/github/github_test.go b/github/github_test.go index 16257b384c2..b3dd0cf10be 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -231,7 +231,7 @@ func testNewRequestAndDoFailureCategory(t *testing.T, methodName string, client client.BaseURL.Path = "/api-v3/" client.rateLimits[category].Reset.Time = time.Now().Add(10 * time.Minute) resp, err = f() - if bypass := resp.Request.Context().Value(bypassRateLimitCheck); bypass != nil { + if bypass := resp.Request.Context().Value(BypassRateLimitCheck); bypass != nil { return } if want := http.StatusForbidden; resp == nil || resp.Response.StatusCode != want { diff --git a/github/rate_limit.go b/github/rate_limit.go index 5b01b573d8a..d55c545e7a5 100644 --- a/github/rate_limit.go +++ b/github/rate_limit.go @@ -77,7 +77,7 @@ func (s *RateLimitService) Get(ctx context.Context) (*RateLimits, *Response, err }) // This resource is not subject to rate limits. - ctx = context.WithValue(ctx, bypassRateLimitCheck, true) + ctx = context.WithValue(ctx, BypassRateLimitCheck, true) resp, err := s.client.Do(ctx, req, response) if err != nil { return nil, resp, err From f4d4e89071744add79e0f1fddf00585cd22a98c1 Mon Sep 17 00:00:00 2001 From: Dominic Evans <8060970+dnwe@users.noreply.github.com> Date: Tue, 7 Jan 2025 17:14:17 +0000 Subject: [PATCH 610/751] build(deps): Pin and group actions/* (#3424) --- .github/dependabot.yml | 4 ++++ .github/workflows/linter.yml | 4 ++-- .github/workflows/tests.yml | 8 ++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 0c068c6c1ac..f4bfd395efd 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -16,3 +16,7 @@ updates: directory: / schedule: interval: weekly + groups: + actions: + patterns: + - "actions/*" diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 24f3d909db4..4606434fe47 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -8,8 +8,8 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 with: go-version: 1.x cache-dependency-path: "**/go.sum" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3ab68bb7b6b..00298a5aa95 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,10 +39,10 @@ jobs: runs-on: ${{ matrix.platform }} steps: - - uses: actions/setup-go@v5 + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 with: go-version: ${{ matrix.go-version }} - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 # Get values for cache paths to be used in later steps - id: cache-paths @@ -51,7 +51,7 @@ jobs: echo "go-mod-cache=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT - name: Cache go modules - uses: actions/cache@v4 + uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 with: path: | ${{ steps.cache-paths.outputs.go-cache }} @@ -73,4 +73,4 @@ jobs: - name: Upload coverage to Codecov if: ${{ matrix.update-coverage }} - uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 #v5.1.2 + uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 # v5.1.2 From 27e3249368f336a5f54e28ca164da80bf0f16ecd Mon Sep 17 00:00:00 2001 From: Joshua French Date: Tue, 7 Jan 2025 10:47:41 -0700 Subject: [PATCH 611/751] Add deprecation messages to security managers APIs (#3426) --- github/orgs_security_managers.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/github/orgs_security_managers.go b/github/orgs_security_managers.go index 08037727320..b8562a2fd75 100644 --- a/github/orgs_security_managers.go +++ b/github/orgs_security_managers.go @@ -12,6 +12,8 @@ import ( // ListSecurityManagerTeams lists all security manager teams for an organization. // +// Deprecated: Please use `client.Organizations.ListTeamsAssignedToOrgRole` instead. +// // GitHub API docs: https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams // //meta:operation GET /orgs/{org}/security-managers @@ -34,6 +36,8 @@ func (s *OrganizationsService) ListSecurityManagerTeams(ctx context.Context, org // AddSecurityManagerTeam adds a team to the list of security managers for an organization. // +// Deprecated: Please use `client.Organizations.AssignOrgRoleToTeam` instead. +// // GitHub API docs: https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team // //meta:operation PUT /orgs/{org}/security-managers/teams/{team_slug} @@ -49,6 +53,8 @@ func (s *OrganizationsService) AddSecurityManagerTeam(ctx context.Context, org, // RemoveSecurityManagerTeam removes a team from the list of security managers for an organization. // +// Deprecated: Please use `client.Organizations.RemoveOrgRoleFromTeam` instead. +// // GitHub API docs: https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team // //meta:operation DELETE /orgs/{org}/security-managers/teams/{team_slug} From a44a24b633d438cfb8eb756265a676586edee7b1 Mon Sep 17 00:00:00 2001 From: Dominic Evans <8060970+dnwe@users.noreply.github.com> Date: Thu, 9 Jan 2025 13:48:58 +0000 Subject: [PATCH 612/751] fix: Relax go directive in go.mod to 1.22.0 (#3423) Fixes: #3422. --- .github/workflows/tests.yml | 2 +- README.md | 19 ++++++++++++------- example/go.mod | 7 +++---- example/go.sum | 14 ++++++-------- example/newreposecretwithlibsodium/go.mod | 2 +- example/verifyartifact/main.go | 4 ++-- go.mod | 4 ++-- scrape/go.mod | 4 ++-- scrape/go.sum | 4 ++-- tools/go.mod | 3 ++- tools/go.sum | 4 ++-- 11 files changed, 35 insertions(+), 32 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 00298a5aa95..945c07d2956 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,7 +24,7 @@ jobs: shell: bash strategy: matrix: - go-version: [1.x, 1.22.x] + go-version: [1.x, 1.22.0] # test with N and the .0 release of N-1 platform: [ubuntu-latest] include: # include windows, but only with the latest Go version, since there diff --git a/README.md b/README.md index 5f6d5ab3ff0..5914581b6f0 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,18 @@ go-github is a Go client library for accessing the [GitHub API v3][]. -**go-github requires Go version 1.17 and greater** and -the library is tested against Go version 1.22 and greater. go-github tracks -[Go's version support policy][support-policy]. We do our best not to break -older versions of Go if we don't have to, but due to tooling constraints, we -don't always test older versions. +go-github tracks [Go's version support policy][support-policy] supporting any +minor version of the latest two major releases of Go and the go directive in +go.mod reflects that. +We do our best not to break older versions of Go if we don't have to, but we +don't explicitly test older versions and as of Go 1.21 the go directive in +go.mod declares a hard required _minimum_ version of Go to use with this module +and this _must_ be greater than or equal to the go line of all dependencies so +go-github will require the N-1 major release of Go by default. + +[support-policy]: https://golang.org/doc/devel/release.html#policy + +## Development Go version 1.22 introduced significant changes to the pattern syntax and matching behavior of `http.ServerMux` which causes a large number of legacy unit tests to break. @@ -28,8 +35,6 @@ An issue has been created (#3409) requesting assistance in updating all breaking tests when this `GODEBUG` environment variable is not set and Go 1.23.4 or later is used to perform unit tests. -[support-policy]: https://golang.org/doc/devel/release.html#policy - If you're interested in using the [GraphQL API v4][], the recommended library is [shurcooL/githubv4][]. diff --git a/example/go.mod b/example/go.mod index 314b6c93ee5..bd784bf5921 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,13 +1,13 @@ module github.com/google/go-github/v68/example -go 1.22.10 +go 1.22.0 require ( github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-ratelimit v1.0.3 github.com/google/go-github/v68 v68.0.0 - github.com/sigstore/sigstore-go v0.6.2 + github.com/sigstore/sigstore-go v0.5.1 golang.org/x/crypto v0.31.0 golang.org/x/term v0.27.0 google.golang.org/appengine v1.6.8 @@ -45,7 +45,6 @@ require ( github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-retryablehttp v0.7.7 // indirect github.com/hashicorp/hcl v1.0.0 // indirect - github.com/in-toto/attestation v1.1.0 // indirect github.com/in-toto/in-toto-golang v0.9.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jedisct1/go-minisign v0.0.0-20211028175153-1c139d1cc84b // indirect @@ -66,7 +65,7 @@ require ( github.com/shibumi/go-pathspec v1.3.0 // indirect github.com/sigstore/protobuf-specs v0.3.2 // indirect github.com/sigstore/rekor v1.3.6 // indirect - github.com/sigstore/sigstore v1.8.9 // indirect + github.com/sigstore/sigstore v1.8.11 // indirect github.com/sigstore/timestamp-authority v1.2.2 // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/spf13/afero v1.11.0 // indirect diff --git a/example/go.sum b/example/go.sum index 5fe8fd12e51..9fc9663b67c 100644 --- a/example/go.sum +++ b/example/go.sum @@ -203,8 +203,6 @@ github.com/hashicorp/vault/api v1.12.2 h1:7YkCTE5Ni90TcmYHDBExdt4WGJxhpzaHqR6uGb github.com/hashicorp/vault/api v1.12.2/go.mod h1:LSGf1NGT1BnvFFnKVtnvcaLBM2Lz+gJdpL6HUYed8KE= github.com/howeyc/gopass v0.0.0-20210920133722-c8aef6fb66ef h1:A9HsByNhogrvm9cWb28sjiS3i7tcKCkflWFEkHfuAgM= github.com/howeyc/gopass v0.0.0-20210920133722-c8aef6fb66ef/go.mod h1:lADxMC39cJJqL93Duh1xhAs4I2Zs8mKS89XWXFGp9cs= -github.com/in-toto/attestation v1.1.0 h1:oRWzfmZPDSctChD0VaQV7MJrywKOzyNrtpENQFq//2Q= -github.com/in-toto/attestation v1.1.0/go.mod h1:DB59ytd3z7cIHgXxwpSX2SABrU6WJUKg/grpdgHVgVs= github.com/in-toto/in-toto-golang v0.9.0 h1:tHny7ac4KgtsfrG6ybU8gVOZux2H8jN05AXJ9EBM1XU= github.com/in-toto/in-toto-golang v0.9.0/go.mod h1:xsBVrVsHNsB61++S6Dy2vWosKhuA3lUTQd+eF9HdeMo= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= @@ -285,10 +283,10 @@ github.com/sigstore/protobuf-specs v0.3.2 h1:nCVARCN+fHjlNCk3ThNXwrZRqIommIeNKWw github.com/sigstore/protobuf-specs v0.3.2/go.mod h1:RZ0uOdJR4OB3tLQeAyWoJFbNCBFrPQdcokntde4zRBA= github.com/sigstore/rekor v1.3.6 h1:QvpMMJVWAp69a3CHzdrLelqEqpTM3ByQRt5B5Kspbi8= github.com/sigstore/rekor v1.3.6/go.mod h1:JDTSNNMdQ/PxdsS49DJkJ+pRJCO/83nbR5p3aZQteXc= -github.com/sigstore/sigstore v1.8.9 h1:NiUZIVWywgYuVTxXmRoTT4O4QAGiTEKup4N1wdxFadk= -github.com/sigstore/sigstore v1.8.9/go.mod h1:d9ZAbNDs8JJfxJrYmulaTazU3Pwr8uLL9+mii4BNR3w= -github.com/sigstore/sigstore-go v0.6.2 h1:8uiywjt73vzfrGfWYVwVsiB1E1Qmwmpgr1kVpl4fs6A= -github.com/sigstore/sigstore-go v0.6.2/go.mod h1:pOIUH7Jx+ctwMICo+2zNrViOJJN5sGaQgwX4yAVJkA0= +github.com/sigstore/sigstore v1.8.11 h1:tEqeQqbT+awtM87ec9KEeSUxT/AFvJNawneYJyAkFrQ= +github.com/sigstore/sigstore v1.8.11/go.mod h1:fdrFQosxCQ4wTL5H1NrZcQkqQ72AQbPjtpcL2QOGKV0= +github.com/sigstore/sigstore-go v0.5.1 h1:5IhKvtjlQBeLnjKkzMELNG4tIBf+xXQkDzhLV77+/8Y= +github.com/sigstore/sigstore-go v0.5.1/go.mod h1:TuOfV7THHqiDaUHuJ5+QN23RP/YoKmsbwJpY+aaYPN0= github.com/sigstore/sigstore/pkg/signature/kms/aws v1.8.3 h1:LTfPadUAo+PDRUbbdqbeSl2OuoFQwUFTnJ4stu+nwWw= github.com/sigstore/sigstore/pkg/signature/kms/aws v1.8.3/go.mod h1:QV/Lxlxm0POyhfyBtIbTWxNeF18clMlkkyL9mu45y18= github.com/sigstore/sigstore/pkg/signature/kms/azure v1.8.3 h1:xgbPRCr2npmmsuVVteJqi/ERw9+I13Wou7kq0Yk4D8g= @@ -380,8 +378,8 @@ golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= -golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE= +golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index 281feb1a542..b7b85f22b40 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -1,6 +1,6 @@ module newreposecretwithlibsodium -go 1.22.10 +go 1.22.0 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb diff --git a/example/verifyartifact/main.go b/example/verifyartifact/main.go index f68d36aaa41..7409bade079 100644 --- a/example/verifyartifact/main.go +++ b/example/verifyartifact/main.go @@ -102,7 +102,7 @@ func main() { log.Fatal(err) } - var b *bundle.Bundle + var b *bundle.ProtobufBundle for _, attestation := range attestations.Attestations { if err := json.Unmarshal(attestation.Bundle, &b); err != nil { log.Fatal(err) @@ -180,7 +180,7 @@ func getPolicyBuilder() (*verify.PolicyBuilder, error) { return &pb, nil } -func runVerification(sev *verify.SignedEntityVerifier, pb *verify.PolicyBuilder, b *bundle.Bundle) error { +func runVerification(sev *verify.SignedEntityVerifier, pb *verify.PolicyBuilder, b *bundle.ProtobufBundle) error { res, err := sev.Verify(b, *pb) if err != nil { return err diff --git a/go.mod b/go.mod index 6e7d38a639a..e367366bdc7 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ module github.com/google/go-github/v68 +go 1.22.0 + require ( github.com/google/go-cmp v0.6.0 github.com/google/go-querystring v1.1.0 ) - -go 1.22.10 diff --git a/scrape/go.mod b/scrape/go.mod index aa681f89a34..e0d91574d21 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -1,9 +1,9 @@ module github.com/google/go-github/scrape -go 1.23.4 +go 1.22.0 require ( - github.com/PuerkitoBio/goquery v1.10.1 + github.com/PuerkitoBio/goquery v1.9.3 github.com/google/go-cmp v0.6.0 github.com/google/go-github/v68 v68.0.0 github.com/xlzd/gotp v0.1.0 diff --git a/scrape/go.sum b/scrape/go.sum index c596dce4b40..9e164640eaa 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -1,5 +1,5 @@ -github.com/PuerkitoBio/goquery v1.10.1 h1:Y8JGYUkXWTGRB6Ars3+j3kN0xg1YqqlwvdTV8WTFQcU= -github.com/PuerkitoBio/goquery v1.10.1/go.mod h1:IYiHrOMps66ag56LEH7QYDDupKXyo5A8qrjIx3ZtujY= +github.com/PuerkitoBio/goquery v1.9.3 h1:mpJr/ikUA9/GNJB/DBZcGeFDXUtosHRyRrwh7KGdTG0= +github.com/PuerkitoBio/goquery v1.9.3/go.mod h1:1ndLHPdTz+DyQPICCWYlYQMPl0oXZj0G6D4LCYA6u4U= github.com/andybalholm/cascadia v1.3.3 h1:AG2YHrzJIm4BZ19iwJ/DAua6Btl3IwJX+VI4kktS1LM= github.com/andybalholm/cascadia v1.3.3/go.mod h1:xNd9bqTn98Ln4DwST8/nG+H0yuB8Hmgu1YHNnWw0GeA= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/tools/go.mod b/tools/go.mod index f5ca69b70d1..188a79ce51f 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -1,6 +1,6 @@ module tools -go 1.23.4 +go 1.22.0 require ( github.com/alecthomas/kong v1.6.0 @@ -14,6 +14,7 @@ require ( require ( github.com/go-openapi/jsonpointer v0.21.0 // indirect github.com/go-openapi/swag v0.23.0 // indirect + github.com/go-test/deep v1.1.1 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/invopop/yaml v0.3.1 // indirect github.com/josharian/intern v1.0.0 // indirect diff --git a/tools/go.sum b/tools/go.sum index 74e159fa447..3073cf11c8f 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -12,8 +12,8 @@ github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1 github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= -github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= -github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= +github.com/go-test/deep v1.1.1 h1:0r/53hagsehfO4bzD2Pgr/+RgHqhmf+k1Bpse2cTu1U= +github.com/go-test/deep v1.1.1/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= From a61e9cfebc0030c1051347e9c62cc9a8f71bc6f2 Mon Sep 17 00:00:00 2001 From: Steve Hipwell Date: Thu, 9 Jan 2025 14:58:32 +0000 Subject: [PATCH 613/751] feat!: Add support for enterprise rulesets (#3417) BREAKING CHANGE: `Create*Ruleset` and `Update*Ruleset` now pass `ruleset` parameter by-value instead of by-reference. Fixes: #3416. --- github/enterprise_rules.go | 118 ++ github/enterprise_rules_test.go | 1852 +++++++++++++++++++++++++++++++ github/event_types_test.go | 17 +- github/github-accessors.go | 16 + github/github-accessors_test.go | 16 + github/orgs_rules.go | 45 +- github/orgs_rules_test.go | 100 +- github/repos_rules.go | 128 ++- github/repos_rules_test.go | 94 +- 9 files changed, 2291 insertions(+), 95 deletions(-) create mode 100644 github/enterprise_rules.go create mode 100644 github/enterprise_rules_test.go diff --git a/github/enterprise_rules.go b/github/enterprise_rules.go new file mode 100644 index 00000000000..29e3e4a568f --- /dev/null +++ b/github/enterprise_rules.go @@ -0,0 +1,118 @@ +// Copyright 2025 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" +) + +// CreateEnterpriseRuleset creates a ruleset for the specified enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/rules#create-an-enterprise-repository-ruleset +// +//meta:operation POST /enterprises/{enterprise}/rulesets +func (s *EnterpriseService) CreateEnterpriseRuleset(ctx context.Context, enterprise string, ruleset Ruleset) (*Ruleset, *Response, error) { + u := fmt.Sprintf("enterprises/%v/rulesets", enterprise) + + req, err := s.client.NewRequest("POST", u, ruleset) + if err != nil { + return nil, nil, err + } + + var rs *Ruleset + resp, err := s.client.Do(ctx, req, &rs) + if err != nil { + return nil, resp, err + } + + return rs, resp, nil +} + +// GetEnterpriseRuleset gets a ruleset from the specified enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/rules#get-an-enterprise-repository-ruleset +// +//meta:operation GET /enterprises/{enterprise}/rulesets/{ruleset_id} +func (s *EnterpriseService) GetEnterpriseRuleset(ctx context.Context, enterprise string, rulesetID int64) (*Ruleset, *Response, error) { + u := fmt.Sprintf("enterprises/%v/rulesets/%v", enterprise, rulesetID) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var ruleset *Ruleset + resp, err := s.client.Do(ctx, req, &ruleset) + if err != nil { + return nil, resp, err + } + + return ruleset, resp, nil +} + +// UpdateEnterpriseRuleset updates a ruleset from the specified enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/rules#update-an-enterprise-repository-ruleset +// +//meta:operation PUT /enterprises/{enterprise}/rulesets/{ruleset_id} +func (s *EnterpriseService) UpdateEnterpriseRuleset(ctx context.Context, enterprise string, rulesetID int64, ruleset Ruleset) (*Ruleset, *Response, error) { + u := fmt.Sprintf("enterprises/%v/rulesets/%v", enterprise, rulesetID) + + req, err := s.client.NewRequest("PUT", u, ruleset) + if err != nil { + return nil, nil, err + } + + var rs *Ruleset + resp, err := s.client.Do(ctx, req, &rs) + if err != nil { + return nil, resp, err + } + + return rs, resp, nil +} + +// UpdateEnterpriseRulesetClearBypassActor clears the ruleset bypass actors for a ruleset for the specified repository. +// +// This function is necessary as the UpdateEnterpriseRuleset function does not marshal ByPassActor if passed as an empty array. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/rules#update-an-enterprise-repository-ruleset +// +//meta:operation PUT /enterprises/{enterprise}/rulesets/{ruleset_id} +func (s *EnterpriseService) UpdateEnterpriseRulesetClearBypassActor(ctx context.Context, enterprise string, rulesetID int64) (*Response, error) { + u := fmt.Sprintf("enterprises/%v/rulesets/%v", enterprise, rulesetID) + + rsClearBypassActor := rulesetClearBypassActors{} + + req, err := s.client.NewRequest("PUT", u, rsClearBypassActor) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req, nil) + if err != nil { + return resp, err + } + + return resp, nil +} + +// DeleteEnterpriseRuleset deletes a ruleset from the specified enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/rules#delete-an-enterprise-repository-ruleset +// +//meta:operation DELETE /enterprises/{enterprise}/rulesets/{ruleset_id} +func (s *EnterpriseService) DeleteEnterpriseRuleset(ctx context.Context, enterprise string, rulesetID int64) (*Response, error) { + u := fmt.Sprintf("enterprises/%v/rulesets/%v", enterprise, rulesetID) + + 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/enterprise_rules_test.go b/github/enterprise_rules_test.go new file mode 100644 index 00000000000..574b8396591 --- /dev/null +++ b/github/enterprise_rules_test.go @@ -0,0 +1,1852 @@ +// Copyright 2025 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 TestEnterpriseService_CreateEnterpriseRuleset_OrgNameRepoName(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/enterprises/e/rulesets", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + fmt.Fprint(w, `{ + "id": 21, + "name": "ruleset", + "target": "branch", + "source_type": "Enterprise", + "source": "e", + "enforcement": "active", + "bypass_actors": [ + { + "actor_id": 234, + "actor_type": "Team" + } + ], + "conditions": { + "organization_name": { + "include": [ + "important_organization", + "another_important_organization" + ], + "exclude": [ + "unimportant_organization" + ] + }, + "repository_name": { + "include": [ + "important_repository", + "another_important_repository" + ], + "exclude": [ + "unimportant_repository" + ], + "protected": true + }, + "ref_name": { + "include": [ + "refs/heads/main", + "refs/heads/master" + ], + "exclude": [ + "refs/heads/dev*" + ] + } + }, + "rules": [ + { + "type": "creation" + }, + { + "type": "update", + "parameters": { + "update_allows_fetch_and_merge": true + } + }, + { + "type": "deletion" + }, + { + "type": "required_linear_history" + }, + { + "type": "required_deployments", + "parameters": { + "required_deployment_environments": ["test"] + } + }, + { + "type": "required_signatures" + }, + { + "type": "pull_request", + "parameters": { + "allowed_merge_methods": ["rebase","squash"], + "dismiss_stale_reviews_on_push": true, + "require_code_owner_review": true, + "require_last_push_approval": true, + "required_approving_review_count": 1, + "required_review_thread_resolution": true + } + }, + { + "type": "required_status_checks", + "parameters": { + "required_status_checks": [ + { + "context": "test", + "integration_id": 1 + } + ], + "strict_required_status_checks_policy": true + } + }, + { + "type": "non_fast_forward" + }, + { + "type": "commit_message_pattern", + "parameters": { + "name": "avoid test commits", + "negate": true, + "operator": "starts_with", + "pattern": "[test]" + } + }, + { + "type": "commit_author_email_pattern", + "parameters": { + "operator": "contains", + "pattern": "github" + } + }, + { + "type": "committer_email_pattern", + "parameters": { + "name": "avoid commit emails", + "negate": true, + "operator": "ends_with", + "pattern": "abc" + } + }, + { + "type": "branch_name_pattern", + "parameters": { + "name": "avoid branch names", + "negate": true, + "operator": "regex", + "pattern": "github$" + } + }, + { + "type": "tag_name_pattern", + "parameters": { + "name": "avoid tag names", + "negate": true, + "operator": "contains", + "pattern": "github" + } + }, + { + "type": "code_scanning", + "parameters": { + "code_scanning_tools": [ + { + "tool": "CodeQL", + "security_alerts_threshold": "high_or_higher", + "alerts_threshold": "errors" + } + ] + } + } + ] + }`) + }) + + ctx := context.Background() + ruleset, _, err := client.Enterprise.CreateEnterpriseRuleset(ctx, "e", Ruleset{ + Name: "ruleset", + Target: Ptr("branch"), + Enforcement: "active", + BypassActors: []*BypassActor{ + { + ActorID: Ptr(int64(234)), + ActorType: Ptr("Team"), + }, + }, + Conditions: &RulesetConditions{ + OrganizationName: &RulesetOrganizationNamesConditionParameters{ + Include: []string{"important_organization", "another_important_organization"}, + Exclude: []string{"unimportant_organization"}, + }, + RepositoryName: &RulesetRepositoryNamesConditionParameters{ + Include: []string{"important_repository", "another_important_repository"}, + Exclude: []string{"unimportant_repository"}, + Protected: Ptr(true), + }, + RefName: &RulesetRefConditionParameters{ + Include: []string{"refs/heads/main", "refs/heads/master"}, + Exclude: []string{"refs/heads/dev*"}, + }, + }, + Rules: []*RepositoryRule{ + NewCreationRule(), + NewUpdateRule(&UpdateAllowsFetchAndMergeRuleParameters{ + UpdateAllowsFetchAndMerge: true, + }), + NewDeletionRule(), + NewRequiredLinearHistoryRule(), + NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ + RequiredDeploymentEnvironments: []string{"test"}, + }), + NewRequiredSignaturesRule(), + NewPullRequestRule(&PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, + DismissStaleReviewsOnPush: true, + RequireCodeOwnerReview: true, + RequireLastPushApproval: true, + RequiredApprovingReviewCount: 1, + RequiredReviewThreadResolution: true, + }), + NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ + RequiredStatusChecks: []RuleRequiredStatusChecks{ + { + Context: "test", + IntegrationID: Ptr(int64(1)), + }, + }, + StrictRequiredStatusChecksPolicy: true, + }), + NewNonFastForwardRule(), + NewCommitMessagePatternRule(&RulePatternParameters{ + Name: Ptr("avoid test commits"), + Negate: Ptr(true), + Operator: "starts_with", + Pattern: "[test]", + }), + NewCommitAuthorEmailPatternRule(&RulePatternParameters{ + Operator: "contains", + Pattern: "github", + }), + NewCommitterEmailPatternRule(&RulePatternParameters{ + Name: Ptr("avoid commit emails"), + Negate: Ptr(true), + Operator: "ends_with", + Pattern: "abc", + }), + NewBranchNamePatternRule(&RulePatternParameters{ + Name: Ptr("avoid branch names"), + Negate: Ptr(true), + Operator: "regex", + Pattern: "github$", + }), + NewTagNamePatternRule(&RulePatternParameters{ + Name: Ptr("avoid tag names"), + Negate: Ptr(true), + Operator: "contains", + Pattern: "github", + }), + NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ + RequiredCodeScanningTools: []*RuleRequiredCodeScanningTool{ + { + Tool: "CodeQL", + SecurityAlertsThreshold: "high_or_higher", + AlertsThreshold: "errors", + }, + }, + }), + }, + }) + if err != nil { + t.Errorf("Enterprise.CreateEnterpriseRuleset returned error: %v", err) + } + + want := &Ruleset{ + ID: Ptr(int64(21)), + Name: "ruleset", + Target: Ptr("branch"), + SourceType: Ptr("Enterprise"), + Source: "e", + Enforcement: "active", + BypassActors: []*BypassActor{ + { + ActorID: Ptr(int64(234)), + ActorType: Ptr("Team"), + }, + }, + Conditions: &RulesetConditions{ + OrganizationName: &RulesetOrganizationNamesConditionParameters{ + Include: []string{"important_organization", "another_important_organization"}, + Exclude: []string{"unimportant_organization"}, + }, + RepositoryName: &RulesetRepositoryNamesConditionParameters{ + Include: []string{"important_repository", "another_important_repository"}, + Exclude: []string{"unimportant_repository"}, + Protected: Ptr(true), + }, + RefName: &RulesetRefConditionParameters{ + Include: []string{"refs/heads/main", "refs/heads/master"}, + Exclude: []string{"refs/heads/dev*"}, + }, + }, + Rules: []*RepositoryRule{ + NewCreationRule(), + NewUpdateRule(&UpdateAllowsFetchAndMergeRuleParameters{ + UpdateAllowsFetchAndMerge: true, + }), + NewDeletionRule(), + NewRequiredLinearHistoryRule(), + NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ + RequiredDeploymentEnvironments: []string{"test"}, + }), + NewRequiredSignaturesRule(), + NewPullRequestRule(&PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, + DismissStaleReviewsOnPush: true, + RequireCodeOwnerReview: true, + RequireLastPushApproval: true, + RequiredApprovingReviewCount: 1, + RequiredReviewThreadResolution: true, + }), + NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ + RequiredStatusChecks: []RuleRequiredStatusChecks{ + { + Context: "test", + IntegrationID: Ptr(int64(1)), + }, + }, + StrictRequiredStatusChecksPolicy: true, + }), + NewNonFastForwardRule(), + NewCommitMessagePatternRule(&RulePatternParameters{ + Name: Ptr("avoid test commits"), + Negate: Ptr(true), + Operator: "starts_with", + Pattern: "[test]", + }), + NewCommitAuthorEmailPatternRule(&RulePatternParameters{ + Operator: "contains", + Pattern: "github", + }), + NewCommitterEmailPatternRule(&RulePatternParameters{ + Name: Ptr("avoid commit emails"), + Negate: Ptr(true), + Operator: "ends_with", + Pattern: "abc", + }), + NewBranchNamePatternRule(&RulePatternParameters{ + Name: Ptr("avoid branch names"), + Negate: Ptr(true), + Operator: "regex", + Pattern: "github$", + }), + NewTagNamePatternRule(&RulePatternParameters{ + Name: Ptr("avoid tag names"), + Negate: Ptr(true), + Operator: "contains", + Pattern: "github", + }), + NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ + RequiredCodeScanningTools: []*RuleRequiredCodeScanningTool{ + { + Tool: "CodeQL", + SecurityAlertsThreshold: "high_or_higher", + AlertsThreshold: "errors", + }, + }, + }), + }, + } + if !cmp.Equal(ruleset, want) { + t.Errorf("Enterprise.CreateEnterpriseRuleset returned %+v, want %+v", ruleset, want) + } + + const methodName = "CreateEnterpriseRuleset" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.CreateEnterpriseRuleset(ctx, "e", Ruleset{}) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_CreateEnterpriseRuleset_OrgNameRepoProperty(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/enterprises/e/rulesets", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + fmt.Fprint(w, `{ + "id": 21, + "name": "ruleset", + "target": "branch", + "source_type": "Enterprise", + "source": "e", + "enforcement": "active", + "bypass_actors": [ + { + "actor_id": 234, + "actor_type": "Team" + } + ], + "conditions": { + "organization_name": { + "include": [ + "important_organization", + "another_important_organization" + ], + "exclude": [ + "unimportant_organization" + ] + }, + "repository_property": { + "include": [ + { + "name": "testIncludeProp", + "source": "custom", + "property_values": [ + "true" + ] + } + ], + "exclude": [ + { + "name": "testExcludeProp", + "property_values": [ + "false" + ] + } + ] + }, + "ref_name": { + "include": [ + "refs/heads/main", + "refs/heads/master" + ], + "exclude": [ + "refs/heads/dev*" + ] + } + }, + "rules": [ + { + "type": "creation" + }, + { + "type": "update", + "parameters": { + "update_allows_fetch_and_merge": true + } + }, + { + "type": "deletion" + }, + { + "type": "required_linear_history" + }, + { + "type": "required_deployments", + "parameters": { + "required_deployment_environments": ["test"] + } + }, + { + "type": "required_signatures" + }, + { + "type": "pull_request", + "parameters": { + "allowed_merge_methods": ["rebase","squash"], + "dismiss_stale_reviews_on_push": true, + "require_code_owner_review": true, + "require_last_push_approval": true, + "required_approving_review_count": 1, + "required_review_thread_resolution": true + } + }, + { + "type": "required_status_checks", + "parameters": { + "required_status_checks": [ + { + "context": "test", + "integration_id": 1 + } + ], + "strict_required_status_checks_policy": true + } + }, + { + "type": "non_fast_forward" + }, + { + "type": "commit_message_pattern", + "parameters": { + "name": "avoid test commits", + "negate": true, + "operator": "starts_with", + "pattern": "[test]" + } + }, + { + "type": "commit_author_email_pattern", + "parameters": { + "operator": "contains", + "pattern": "github" + } + }, + { + "type": "committer_email_pattern", + "parameters": { + "name": "avoid commit emails", + "negate": true, + "operator": "ends_with", + "pattern": "abc" + } + }, + { + "type": "branch_name_pattern", + "parameters": { + "name": "avoid branch names", + "negate": true, + "operator": "regex", + "pattern": "github$" + } + }, + { + "type": "tag_name_pattern", + "parameters": { + "name": "avoid tag names", + "negate": true, + "operator": "contains", + "pattern": "github" + } + }, + { + "type": "code_scanning", + "parameters": { + "code_scanning_tools": [ + { + "tool": "CodeQL", + "security_alerts_threshold": "high_or_higher", + "alerts_threshold": "errors" + } + ] + } + } + ] + }`) + }) + + ctx := context.Background() + ruleset, _, err := client.Enterprise.CreateEnterpriseRuleset(ctx, "e", Ruleset{ + Name: "ruleset", + Target: Ptr("branch"), + Enforcement: "active", + BypassActors: []*BypassActor{ + { + ActorID: Ptr(int64(234)), + ActorType: Ptr("Team"), + }, + }, + Conditions: &RulesetConditions{ + OrganizationName: &RulesetOrganizationNamesConditionParameters{ + Include: []string{"important_organization", "another_important_organization"}, + Exclude: []string{"unimportant_organization"}, + }, + RepositoryProperty: &RulesetRepositoryPropertyConditionParameters{ + Include: []RulesetRepositoryPropertyTargetParameters{ + { + Name: "testIncludeProp", + Source: Ptr("custom"), + Values: []string{"true"}, + }, + }, + Exclude: []RulesetRepositoryPropertyTargetParameters{ + { + Name: "testExcludeProp", + Values: []string{"false"}, + }, + }, + }, + RefName: &RulesetRefConditionParameters{ + Include: []string{"refs/heads/main", "refs/heads/master"}, + Exclude: []string{"refs/heads/dev*"}, + }, + }, + Rules: []*RepositoryRule{ + NewCreationRule(), + NewUpdateRule(&UpdateAllowsFetchAndMergeRuleParameters{ + UpdateAllowsFetchAndMerge: true, + }), + NewDeletionRule(), + NewRequiredLinearHistoryRule(), + NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ + RequiredDeploymentEnvironments: []string{"test"}, + }), + NewRequiredSignaturesRule(), + NewPullRequestRule(&PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, + DismissStaleReviewsOnPush: true, + RequireCodeOwnerReview: true, + RequireLastPushApproval: true, + RequiredApprovingReviewCount: 1, + RequiredReviewThreadResolution: true, + }), + NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ + RequiredStatusChecks: []RuleRequiredStatusChecks{ + { + Context: "test", + IntegrationID: Ptr(int64(1)), + }, + }, + StrictRequiredStatusChecksPolicy: true, + }), + NewNonFastForwardRule(), + NewCommitMessagePatternRule(&RulePatternParameters{ + Name: Ptr("avoid test commits"), + Negate: Ptr(true), + Operator: "starts_with", + Pattern: "[test]", + }), + NewCommitAuthorEmailPatternRule(&RulePatternParameters{ + Operator: "contains", + Pattern: "github", + }), + NewCommitterEmailPatternRule(&RulePatternParameters{ + Name: Ptr("avoid commit emails"), + Negate: Ptr(true), + Operator: "ends_with", + Pattern: "abc", + }), + NewBranchNamePatternRule(&RulePatternParameters{ + Name: Ptr("avoid branch names"), + Negate: Ptr(true), + Operator: "regex", + Pattern: "github$", + }), + NewTagNamePatternRule(&RulePatternParameters{ + Name: Ptr("avoid tag names"), + Negate: Ptr(true), + Operator: "contains", + Pattern: "github", + }), + NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ + RequiredCodeScanningTools: []*RuleRequiredCodeScanningTool{ + { + Tool: "CodeQL", + SecurityAlertsThreshold: "high_or_higher", + AlertsThreshold: "errors", + }, + }, + }), + }, + }) + if err != nil { + t.Errorf("Enterprise.CreateEnterpriseRuleset returned error: %v", err) + } + + want := &Ruleset{ + ID: Ptr(int64(21)), + Name: "ruleset", + Target: Ptr("branch"), + SourceType: Ptr("Enterprise"), + Source: "e", + Enforcement: "active", + BypassActors: []*BypassActor{ + { + ActorID: Ptr(int64(234)), + ActorType: Ptr("Team"), + }, + }, + Conditions: &RulesetConditions{ + OrganizationName: &RulesetOrganizationNamesConditionParameters{ + Include: []string{"important_organization", "another_important_organization"}, + Exclude: []string{"unimportant_organization"}, + }, + RepositoryProperty: &RulesetRepositoryPropertyConditionParameters{ + Include: []RulesetRepositoryPropertyTargetParameters{ + { + Name: "testIncludeProp", + Source: Ptr("custom"), + Values: []string{"true"}, + }, + }, + Exclude: []RulesetRepositoryPropertyTargetParameters{ + { + Name: "testExcludeProp", + Values: []string{"false"}, + }, + }, + }, + RefName: &RulesetRefConditionParameters{ + Include: []string{"refs/heads/main", "refs/heads/master"}, + Exclude: []string{"refs/heads/dev*"}, + }, + }, + Rules: []*RepositoryRule{ + NewCreationRule(), + NewUpdateRule(&UpdateAllowsFetchAndMergeRuleParameters{ + UpdateAllowsFetchAndMerge: true, + }), + NewDeletionRule(), + NewRequiredLinearHistoryRule(), + NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ + RequiredDeploymentEnvironments: []string{"test"}, + }), + NewRequiredSignaturesRule(), + NewPullRequestRule(&PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, + DismissStaleReviewsOnPush: true, + RequireCodeOwnerReview: true, + RequireLastPushApproval: true, + RequiredApprovingReviewCount: 1, + RequiredReviewThreadResolution: true, + }), + NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ + RequiredStatusChecks: []RuleRequiredStatusChecks{ + { + Context: "test", + IntegrationID: Ptr(int64(1)), + }, + }, + StrictRequiredStatusChecksPolicy: true, + }), + NewNonFastForwardRule(), + NewCommitMessagePatternRule(&RulePatternParameters{ + Name: Ptr("avoid test commits"), + Negate: Ptr(true), + Operator: "starts_with", + Pattern: "[test]", + }), + NewCommitAuthorEmailPatternRule(&RulePatternParameters{ + Operator: "contains", + Pattern: "github", + }), + NewCommitterEmailPatternRule(&RulePatternParameters{ + Name: Ptr("avoid commit emails"), + Negate: Ptr(true), + Operator: "ends_with", + Pattern: "abc", + }), + NewBranchNamePatternRule(&RulePatternParameters{ + Name: Ptr("avoid branch names"), + Negate: Ptr(true), + Operator: "regex", + Pattern: "github$", + }), + NewTagNamePatternRule(&RulePatternParameters{ + Name: Ptr("avoid tag names"), + Negate: Ptr(true), + Operator: "contains", + Pattern: "github", + }), + NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ + RequiredCodeScanningTools: []*RuleRequiredCodeScanningTool{ + { + Tool: "CodeQL", + SecurityAlertsThreshold: "high_or_higher", + AlertsThreshold: "errors", + }, + }, + }), + }, + } + if !cmp.Equal(ruleset, want) { + t.Errorf("Enterprise.CreateEnterpriseRuleset returned %+v, want %+v", ruleset, want) + } + + const methodName = "CreateEnterpriseRuleset" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.CreateEnterpriseRuleset(ctx, "e", Ruleset{}) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_CreateEnterpriseRuleset_OrgIdRepoName(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/enterprises/e/rulesets", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + fmt.Fprint(w, `{ + "id": 21, + "name": "ruleset", + "target": "branch", + "source_type": "Enterprise", + "source": "e", + "enforcement": "active", + "bypass_actors": [ + { + "actor_id": 234, + "actor_type": "Team" + } + ], + "conditions": { + "organization_id": { + "organization_ids": [1001, 1002] + }, + "repository_name": { + "include": [ + "important_repository", + "another_important_repository" + ], + "exclude": [ + "unimportant_repository" + ], + "protected": true + }, + "ref_name": { + "include": [ + "refs/heads/main", + "refs/heads/master" + ], + "exclude": [ + "refs/heads/dev*" + ] + } + }, + "rules": [ + { + "type": "creation" + }, + { + "type": "update", + "parameters": { + "update_allows_fetch_and_merge": true + } + }, + { + "type": "deletion" + }, + { + "type": "required_linear_history" + }, + { + "type": "required_deployments", + "parameters": { + "required_deployment_environments": ["test"] + } + }, + { + "type": "required_signatures" + }, + { + "type": "pull_request", + "parameters": { + "allowed_merge_methods": ["rebase","squash"], + "dismiss_stale_reviews_on_push": true, + "require_code_owner_review": true, + "require_last_push_approval": true, + "required_approving_review_count": 1, + "required_review_thread_resolution": true + } + }, + { + "type": "required_status_checks", + "parameters": { + "required_status_checks": [ + { + "context": "test", + "integration_id": 1 + } + ], + "strict_required_status_checks_policy": true + } + }, + { + "type": "non_fast_forward" + }, + { + "type": "commit_message_pattern", + "parameters": { + "name": "avoid test commits", + "negate": true, + "operator": "starts_with", + "pattern": "[test]" + } + }, + { + "type": "commit_author_email_pattern", + "parameters": { + "operator": "contains", + "pattern": "github" + } + }, + { + "type": "committer_email_pattern", + "parameters": { + "name": "avoid commit emails", + "negate": true, + "operator": "ends_with", + "pattern": "abc" + } + }, + { + "type": "branch_name_pattern", + "parameters": { + "name": "avoid branch names", + "negate": true, + "operator": "regex", + "pattern": "github$" + } + }, + { + "type": "tag_name_pattern", + "parameters": { + "name": "avoid tag names", + "negate": true, + "operator": "contains", + "pattern": "github" + } + }, + { + "type": "code_scanning", + "parameters": { + "code_scanning_tools": [ + { + "tool": "CodeQL", + "security_alerts_threshold": "high_or_higher", + "alerts_threshold": "errors" + } + ] + } + } + ] + }`) + }) + + ctx := context.Background() + ruleset, _, err := client.Enterprise.CreateEnterpriseRuleset(ctx, "e", Ruleset{ + Name: "ruleset", + Target: Ptr("branch"), + Enforcement: "active", + BypassActors: []*BypassActor{ + { + ActorID: Ptr(int64(234)), + ActorType: Ptr("Team"), + }, + }, + Conditions: &RulesetConditions{ + OrganizationID: &RulesetOrganizationIDsConditionParameters{ + OrganizationIDs: []int64{1001, 1002}, + }, + RepositoryName: &RulesetRepositoryNamesConditionParameters{ + Include: []string{"important_repository", "another_important_repository"}, + Exclude: []string{"unimportant_repository"}, + Protected: Ptr(true), + }, + RefName: &RulesetRefConditionParameters{ + Include: []string{"refs/heads/main", "refs/heads/master"}, + Exclude: []string{"refs/heads/dev*"}, + }, + }, + Rules: []*RepositoryRule{ + NewCreationRule(), + NewUpdateRule(&UpdateAllowsFetchAndMergeRuleParameters{ + UpdateAllowsFetchAndMerge: true, + }), + NewDeletionRule(), + NewRequiredLinearHistoryRule(), + NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ + RequiredDeploymentEnvironments: []string{"test"}, + }), + NewRequiredSignaturesRule(), + NewPullRequestRule(&PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, + DismissStaleReviewsOnPush: true, + RequireCodeOwnerReview: true, + RequireLastPushApproval: true, + RequiredApprovingReviewCount: 1, + RequiredReviewThreadResolution: true, + }), + NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ + RequiredStatusChecks: []RuleRequiredStatusChecks{ + { + Context: "test", + IntegrationID: Ptr(int64(1)), + }, + }, + StrictRequiredStatusChecksPolicy: true, + }), + NewNonFastForwardRule(), + NewCommitMessagePatternRule(&RulePatternParameters{ + Name: Ptr("avoid test commits"), + Negate: Ptr(true), + Operator: "starts_with", + Pattern: "[test]", + }), + NewCommitAuthorEmailPatternRule(&RulePatternParameters{ + Operator: "contains", + Pattern: "github", + }), + NewCommitterEmailPatternRule(&RulePatternParameters{ + Name: Ptr("avoid commit emails"), + Negate: Ptr(true), + Operator: "ends_with", + Pattern: "abc", + }), + NewBranchNamePatternRule(&RulePatternParameters{ + Name: Ptr("avoid branch names"), + Negate: Ptr(true), + Operator: "regex", + Pattern: "github$", + }), + NewTagNamePatternRule(&RulePatternParameters{ + Name: Ptr("avoid tag names"), + Negate: Ptr(true), + Operator: "contains", + Pattern: "github", + }), + NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ + RequiredCodeScanningTools: []*RuleRequiredCodeScanningTool{ + { + Tool: "CodeQL", + SecurityAlertsThreshold: "high_or_higher", + AlertsThreshold: "errors", + }, + }, + }), + }, + }) + if err != nil { + t.Errorf("Enterprise.CreateEnterpriseRuleset returned error: %v", err) + } + + want := &Ruleset{ + ID: Ptr(int64(21)), + Name: "ruleset", + Target: Ptr("branch"), + SourceType: Ptr("Enterprise"), + Source: "e", + Enforcement: "active", + BypassActors: []*BypassActor{ + { + ActorID: Ptr(int64(234)), + ActorType: Ptr("Team"), + }, + }, + Conditions: &RulesetConditions{ + OrganizationID: &RulesetOrganizationIDsConditionParameters{ + OrganizationIDs: []int64{1001, 1002}, + }, + RepositoryName: &RulesetRepositoryNamesConditionParameters{ + Include: []string{"important_repository", "another_important_repository"}, + Exclude: []string{"unimportant_repository"}, + Protected: Ptr(true), + }, + RefName: &RulesetRefConditionParameters{ + Include: []string{"refs/heads/main", "refs/heads/master"}, + Exclude: []string{"refs/heads/dev*"}, + }, + }, + Rules: []*RepositoryRule{ + NewCreationRule(), + NewUpdateRule(&UpdateAllowsFetchAndMergeRuleParameters{ + UpdateAllowsFetchAndMerge: true, + }), + NewDeletionRule(), + NewRequiredLinearHistoryRule(), + NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ + RequiredDeploymentEnvironments: []string{"test"}, + }), + NewRequiredSignaturesRule(), + NewPullRequestRule(&PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, + DismissStaleReviewsOnPush: true, + RequireCodeOwnerReview: true, + RequireLastPushApproval: true, + RequiredApprovingReviewCount: 1, + RequiredReviewThreadResolution: true, + }), + NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ + RequiredStatusChecks: []RuleRequiredStatusChecks{ + { + Context: "test", + IntegrationID: Ptr(int64(1)), + }, + }, + StrictRequiredStatusChecksPolicy: true, + }), + NewNonFastForwardRule(), + NewCommitMessagePatternRule(&RulePatternParameters{ + Name: Ptr("avoid test commits"), + Negate: Ptr(true), + Operator: "starts_with", + Pattern: "[test]", + }), + NewCommitAuthorEmailPatternRule(&RulePatternParameters{ + Operator: "contains", + Pattern: "github", + }), + NewCommitterEmailPatternRule(&RulePatternParameters{ + Name: Ptr("avoid commit emails"), + Negate: Ptr(true), + Operator: "ends_with", + Pattern: "abc", + }), + NewBranchNamePatternRule(&RulePatternParameters{ + Name: Ptr("avoid branch names"), + Negate: Ptr(true), + Operator: "regex", + Pattern: "github$", + }), + NewTagNamePatternRule(&RulePatternParameters{ + Name: Ptr("avoid tag names"), + Negate: Ptr(true), + Operator: "contains", + Pattern: "github", + }), + NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ + RequiredCodeScanningTools: []*RuleRequiredCodeScanningTool{ + { + Tool: "CodeQL", + SecurityAlertsThreshold: "high_or_higher", + AlertsThreshold: "errors", + }, + }, + }), + }, + } + if !cmp.Equal(ruleset, want) { + t.Errorf("Enterprise.CreateEnterpriseRuleset returned %+v, want %+v", ruleset, want) + } + + const methodName = "CreateEnterpriseRuleset" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.CreateEnterpriseRuleset(ctx, "e", Ruleset{}) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_CreateEnterpriseRuleset_OrgIdRepoProperty(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/enterprises/e/rulesets", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + fmt.Fprint(w, `{ + "id": 21, + "name": "ruleset", + "target": "branch", + "source_type": "Enterprise", + "source": "e", + "enforcement": "active", + "bypass_actors": [ + { + "actor_id": 234, + "actor_type": "Team" + } + ], + "conditions": { + "organization_id": { + "organization_ids": [1001, 1002] + }, + "repository_property": { + "include": [ + { + "name": "testIncludeProp", + "source": "custom", + "property_values": [ + "true" + ] + } + ], + "exclude": [ + { + "name": "testExcludeProp", + "property_values": [ + "false" + ] + } + ] + }, + "ref_name": { + "include": [ + "refs/heads/main", + "refs/heads/master" + ], + "exclude": [ + "refs/heads/dev*" + ] + } + }, + "rules": [ + { + "type": "creation" + }, + { + "type": "update", + "parameters": { + "update_allows_fetch_and_merge": true + } + }, + { + "type": "deletion" + }, + { + "type": "required_linear_history" + }, + { + "type": "required_deployments", + "parameters": { + "required_deployment_environments": ["test"] + } + }, + { + "type": "required_signatures" + }, + { + "type": "pull_request", + "parameters": { + "allowed_merge_methods": ["rebase","squash"], + "dismiss_stale_reviews_on_push": true, + "require_code_owner_review": true, + "require_last_push_approval": true, + "required_approving_review_count": 1, + "required_review_thread_resolution": true + } + }, + { + "type": "required_status_checks", + "parameters": { + "required_status_checks": [ + { + "context": "test", + "integration_id": 1 + } + ], + "strict_required_status_checks_policy": true + } + }, + { + "type": "non_fast_forward" + }, + { + "type": "commit_message_pattern", + "parameters": { + "name": "avoid test commits", + "negate": true, + "operator": "starts_with", + "pattern": "[test]" + } + }, + { + "type": "commit_author_email_pattern", + "parameters": { + "operator": "contains", + "pattern": "github" + } + }, + { + "type": "committer_email_pattern", + "parameters": { + "name": "avoid commit emails", + "negate": true, + "operator": "ends_with", + "pattern": "abc" + } + }, + { + "type": "branch_name_pattern", + "parameters": { + "name": "avoid branch names", + "negate": true, + "operator": "regex", + "pattern": "github$" + } + }, + { + "type": "tag_name_pattern", + "parameters": { + "name": "avoid tag names", + "negate": true, + "operator": "contains", + "pattern": "github" + } + }, + { + "type": "code_scanning", + "parameters": { + "code_scanning_tools": [ + { + "tool": "CodeQL", + "security_alerts_threshold": "high_or_higher", + "alerts_threshold": "errors" + } + ] + } + } + ] + }`) + }) + + ctx := context.Background() + ruleset, _, err := client.Enterprise.CreateEnterpriseRuleset(ctx, "e", Ruleset{ + Name: "ruleset", + Target: Ptr("branch"), + Enforcement: "active", + BypassActors: []*BypassActor{ + { + ActorID: Ptr(int64(234)), + ActorType: Ptr("Team"), + }, + }, + Conditions: &RulesetConditions{ + OrganizationID: &RulesetOrganizationIDsConditionParameters{ + OrganizationIDs: []int64{1001, 1002}, + }, + RepositoryProperty: &RulesetRepositoryPropertyConditionParameters{ + Include: []RulesetRepositoryPropertyTargetParameters{ + { + Name: "testIncludeProp", + Source: Ptr("custom"), + Values: []string{"true"}, + }, + }, + Exclude: []RulesetRepositoryPropertyTargetParameters{ + { + Name: "testExcludeProp", + Values: []string{"false"}, + }, + }, + }, + RefName: &RulesetRefConditionParameters{ + Include: []string{"refs/heads/main", "refs/heads/master"}, + Exclude: []string{"refs/heads/dev*"}, + }, + }, + Rules: []*RepositoryRule{ + NewCreationRule(), + NewUpdateRule(&UpdateAllowsFetchAndMergeRuleParameters{ + UpdateAllowsFetchAndMerge: true, + }), + NewDeletionRule(), + NewRequiredLinearHistoryRule(), + NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ + RequiredDeploymentEnvironments: []string{"test"}, + }), + NewRequiredSignaturesRule(), + NewPullRequestRule(&PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, + DismissStaleReviewsOnPush: true, + RequireCodeOwnerReview: true, + RequireLastPushApproval: true, + RequiredApprovingReviewCount: 1, + RequiredReviewThreadResolution: true, + }), + NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ + RequiredStatusChecks: []RuleRequiredStatusChecks{ + { + Context: "test", + IntegrationID: Ptr(int64(1)), + }, + }, + StrictRequiredStatusChecksPolicy: true, + }), + NewNonFastForwardRule(), + NewCommitMessagePatternRule(&RulePatternParameters{ + Name: Ptr("avoid test commits"), + Negate: Ptr(true), + Operator: "starts_with", + Pattern: "[test]", + }), + NewCommitAuthorEmailPatternRule(&RulePatternParameters{ + Operator: "contains", + Pattern: "github", + }), + NewCommitterEmailPatternRule(&RulePatternParameters{ + Name: Ptr("avoid commit emails"), + Negate: Ptr(true), + Operator: "ends_with", + Pattern: "abc", + }), + NewBranchNamePatternRule(&RulePatternParameters{ + Name: Ptr("avoid branch names"), + Negate: Ptr(true), + Operator: "regex", + Pattern: "github$", + }), + NewTagNamePatternRule(&RulePatternParameters{ + Name: Ptr("avoid tag names"), + Negate: Ptr(true), + Operator: "contains", + Pattern: "github", + }), + NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ + RequiredCodeScanningTools: []*RuleRequiredCodeScanningTool{ + { + Tool: "CodeQL", + SecurityAlertsThreshold: "high_or_higher", + AlertsThreshold: "errors", + }, + }, + }), + }, + }) + if err != nil { + t.Errorf("Enterprise.CreateEnterpriseRuleset returned error: %v", err) + } + + want := &Ruleset{ + ID: Ptr(int64(21)), + Name: "ruleset", + Target: Ptr("branch"), + SourceType: Ptr("Enterprise"), + Source: "e", + Enforcement: "active", + BypassActors: []*BypassActor{ + { + ActorID: Ptr(int64(234)), + ActorType: Ptr("Team"), + }, + }, + Conditions: &RulesetConditions{ + OrganizationID: &RulesetOrganizationIDsConditionParameters{ + OrganizationIDs: []int64{1001, 1002}, + }, + RepositoryProperty: &RulesetRepositoryPropertyConditionParameters{ + Include: []RulesetRepositoryPropertyTargetParameters{ + { + Name: "testIncludeProp", + Source: Ptr("custom"), + Values: []string{"true"}, + }, + }, + Exclude: []RulesetRepositoryPropertyTargetParameters{ + { + Name: "testExcludeProp", + Values: []string{"false"}, + }, + }, + }, + RefName: &RulesetRefConditionParameters{ + Include: []string{"refs/heads/main", "refs/heads/master"}, + Exclude: []string{"refs/heads/dev*"}, + }, + }, + Rules: []*RepositoryRule{ + NewCreationRule(), + NewUpdateRule(&UpdateAllowsFetchAndMergeRuleParameters{ + UpdateAllowsFetchAndMerge: true, + }), + NewDeletionRule(), + NewRequiredLinearHistoryRule(), + NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ + RequiredDeploymentEnvironments: []string{"test"}, + }), + NewRequiredSignaturesRule(), + NewPullRequestRule(&PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, + DismissStaleReviewsOnPush: true, + RequireCodeOwnerReview: true, + RequireLastPushApproval: true, + RequiredApprovingReviewCount: 1, + RequiredReviewThreadResolution: true, + }), + NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ + RequiredStatusChecks: []RuleRequiredStatusChecks{ + { + Context: "test", + IntegrationID: Ptr(int64(1)), + }, + }, + StrictRequiredStatusChecksPolicy: true, + }), + NewNonFastForwardRule(), + NewCommitMessagePatternRule(&RulePatternParameters{ + Name: Ptr("avoid test commits"), + Negate: Ptr(true), + Operator: "starts_with", + Pattern: "[test]", + }), + NewCommitAuthorEmailPatternRule(&RulePatternParameters{ + Operator: "contains", + Pattern: "github", + }), + NewCommitterEmailPatternRule(&RulePatternParameters{ + Name: Ptr("avoid commit emails"), + Negate: Ptr(true), + Operator: "ends_with", + Pattern: "abc", + }), + NewBranchNamePatternRule(&RulePatternParameters{ + Name: Ptr("avoid branch names"), + Negate: Ptr(true), + Operator: "regex", + Pattern: "github$", + }), + NewTagNamePatternRule(&RulePatternParameters{ + Name: Ptr("avoid tag names"), + Negate: Ptr(true), + Operator: "contains", + Pattern: "github", + }), + NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ + RequiredCodeScanningTools: []*RuleRequiredCodeScanningTool{ + { + Tool: "CodeQL", + SecurityAlertsThreshold: "high_or_higher", + AlertsThreshold: "errors", + }, + }, + }), + }, + } + if !cmp.Equal(ruleset, want) { + t.Errorf("Enterprise.CreateEnterpriseRuleset returned %+v, want %+v", ruleset, want) + } + + const methodName = "CreateEnterpriseRuleset" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.CreateEnterpriseRuleset(ctx, "e", Ruleset{}) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_GetEnterpriseRuleset(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/enterprises/e/rulesets/26110", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "id": 26110, + "name": "test ruleset", + "target": "branch", + "source_type": "Enterprise", + "source": "e", + "enforcement": "active", + "bypass_mode": "none", + "node_id": "nid", + "_links": { + "self": { + "href": "https://api.github.com/enterprises/e/rulesets/26110" + } + }, + "conditions": { + "organization_name": { + "include": [ + "important_organization", + "another_important_organization" + ], + "exclude": [ + "unimportant_organization" + ] + }, + "repository_name": { + "include": [ + "important_repository", + "another_important_repository" + ], + "exclude": [ + "unimportant_repository" + ], + "protected": true + }, + "ref_name": { + "include": [ + "refs/heads/main", + "refs/heads/master" + ], + "exclude": [ + "refs/heads/dev*" + ] + } + }, + "rules": [ + { + "type": "creation" + } + ] + }`) + }) + + ctx := context.Background() + rulesets, _, err := client.Enterprise.GetEnterpriseRuleset(ctx, "e", 26110) + if err != nil { + t.Errorf("Enterprise.GetEnterpriseRuleset returned error: %v", err) + } + + want := &Ruleset{ + ID: Ptr(int64(26110)), + Name: "test ruleset", + Target: Ptr("branch"), + SourceType: Ptr("Enterprise"), + Source: "e", + Enforcement: "active", + NodeID: Ptr("nid"), + Links: &RulesetLinks{ + Self: &RulesetLink{HRef: Ptr("https://api.github.com/enterprises/e/rulesets/26110")}, + }, + Conditions: &RulesetConditions{ + OrganizationName: &RulesetOrganizationNamesConditionParameters{ + Include: []string{"important_organization", "another_important_organization"}, + Exclude: []string{"unimportant_organization"}, + }, + RepositoryName: &RulesetRepositoryNamesConditionParameters{ + Include: []string{"important_repository", "another_important_repository"}, + Exclude: []string{"unimportant_repository"}, + Protected: Ptr(true), + }, + RefName: &RulesetRefConditionParameters{ + Include: []string{"refs/heads/main", "refs/heads/master"}, + Exclude: []string{"refs/heads/dev*"}, + }, + }, + Rules: []*RepositoryRule{ + NewCreationRule(), + }, + } + if !cmp.Equal(rulesets, want) { + t.Errorf("Enterprise.GetEnterpriseRuleset returned %+v, want %+v", rulesets, want) + } + + const methodName = "GetEnterpriseRuleset" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.GetEnterpriseRuleset(ctx, "e", 26110) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_UpdateEnterpriseRuleset(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/enterprises/e/rulesets/26110", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + fmt.Fprint(w, `{ + "id": 26110, + "name": "test ruleset", + "target": "branch", + "source_type": "Enterprise", + "source": "e", + "enforcement": "active", + "bypass_mode": "none", + "node_id": "nid", + "_links": { + "self": { + "href": "https://api.github.com/enterprises/e/rulesets/26110" + } + }, + "conditions": { + "organization_name": { + "include": [ + "important_organization", + "another_important_organization" + ], + "exclude": [ + "unimportant_organization" + ] + }, + "repository_name": { + "include": [ + "important_repository", + "another_important_repository" + ], + "exclude": [ + "unimportant_repository" + ], + "protected": true + }, + "ref_name": { + "include": [ + "refs/heads/main", + "refs/heads/master" + ], + "exclude": [ + "refs/heads/dev*" + ] + } + }, + "rules": [ + { + "type": "creation" + } + ] + }`) + }) + + ctx := context.Background() + rulesets, _, err := client.Enterprise.UpdateEnterpriseRuleset(ctx, "e", 26110, Ruleset{ + Name: "test ruleset", + Target: Ptr("branch"), + Enforcement: "active", + Conditions: &RulesetConditions{ + RefName: &RulesetRefConditionParameters{ + Include: []string{"refs/heads/main", "refs/heads/master"}, + Exclude: []string{"refs/heads/dev*"}, + }, + RepositoryName: &RulesetRepositoryNamesConditionParameters{ + Include: []string{"important_repository", "another_important_repository"}, + Exclude: []string{"unimportant_repository"}, + Protected: Ptr(true), + }, + }, + Rules: []*RepositoryRule{ + NewCreationRule(), + }, + }) + if err != nil { + t.Errorf("Enterprise.UpdateEnterpriseRuleset returned error: %v", err) + } + + want := &Ruleset{ + ID: Ptr(int64(26110)), + Name: "test ruleset", + Target: Ptr("branch"), + SourceType: Ptr("Enterprise"), + Source: "e", + Enforcement: "active", + NodeID: Ptr("nid"), + Links: &RulesetLinks{ + Self: &RulesetLink{HRef: Ptr("https://api.github.com/enterprises/e/rulesets/26110")}, + }, + Conditions: &RulesetConditions{ + OrganizationName: &RulesetOrganizationNamesConditionParameters{ + Include: []string{"important_organization", "another_important_organization"}, + Exclude: []string{"unimportant_organization"}, + }, + RepositoryName: &RulesetRepositoryNamesConditionParameters{ + Include: []string{"important_repository", "another_important_repository"}, + Exclude: []string{"unimportant_repository"}, + Protected: Ptr(true), + }, + RefName: &RulesetRefConditionParameters{ + Include: []string{"refs/heads/main", "refs/heads/master"}, + Exclude: []string{"refs/heads/dev*"}, + }, + }, + Rules: []*RepositoryRule{ + NewCreationRule(), + }, + } + if !cmp.Equal(rulesets, want) { + t.Errorf("Enterprise.UpdateEnterpriseRuleset returned %+v, want %+v", rulesets, want) + } + + const methodName = "UpdateEnterpriseRuleset" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.UpdateEnterpriseRuleset(ctx, "e", 26110, Ruleset{}) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_UpdateEnterpriseRulesetClearBypassActor(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/enterprises/e/rulesets/26110", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + fmt.Fprint(w, `{ + "id": 26110, + "name": "test ruleset", + "target": "branch", + "source_type": "Enterprise", + "source": "e", + "enforcement": "active", + "bypass_mode": "none", + "conditions": { + "organization_name": { + "include": [ + "important_organization", + "another_important_organization" + ], + "exclude": [ + "unimportant_organization" + ] + }, + "repository_name": { + "include": [ + "important_repository", + "another_important_repository" + ], + "exclude": [ + "unimportant_repository" + ], + "protected": true + }, + "ref_name": { + "include": [ + "refs/heads/main", + "refs/heads/master" + ], + "exclude": [ + "refs/heads/dev*" + ] + } + }, + "rules": [ + { + "type": "creation" + } + ] + }`) + }) + + ctx := context.Background() + + _, err := client.Enterprise.UpdateEnterpriseRulesetClearBypassActor(ctx, "e", 26110) + if err != nil { + t.Errorf("Enterprise.UpdateEnterpriseRulesetClearBypassActor returned error: %v \n", err) + } + + const methodName = "UpdateEnterpriseRulesetClearBypassActor" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Enterprise.UpdateEnterpriseRulesetClearBypassActor(ctx, "e", 26110) + }) +} + +func TestEnterpriseService_DeleteEnterpriseRuleset(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/enterprises/e/rulesets/26110", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + }) + + ctx := context.Background() + _, err := client.Enterprise.DeleteEnterpriseRuleset(ctx, "e", 26110) + if err != nil { + t.Errorf("Enterprise.DeleteEnterpriseRuleset returned error: %v", err) + } + + const methodName = "DeleteEnterpriseRuleset" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Enterprise.DeleteEnterpriseRuleset(ctx, "e", 26110) + }) +} diff --git a/github/event_types_test.go b/github/event_types_test.go index 66d4e4989a7..b65d792e9bf 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -8651,7 +8651,6 @@ func TestRepositoryDispatchEvent_Marshal(t *testing.T) { Branch: Ptr("b"), ClientPayload: jsonMsg, Repo: &Repository{ - ID: Ptr(int64(1)), URL: Ptr("s"), Name: Ptr("n"), @@ -9770,11 +9769,12 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { PullRequest: &RepositoryRulesetPullRequestRule{ Type: "pull_request", Parameters: &PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, + DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, RequiredApprovingReviewCount: 1, RequiredReviewThreadResolution: true, - DismissStaleReviewsOnPush: true, }, }, RequiredStatusChecks: &RepositoryRulesetRequiredStatusChecksRule{ @@ -9977,11 +9977,12 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { PullRequest: &RepositoryRulesetPullRequestRule{ Type: "pull_request", Parameters: &PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, + DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, RequiredApprovingReviewCount: 1, RequiredReviewThreadResolution: true, - DismissStaleReviewsOnPush: true, }, }, RequiredStatusChecks: &RepositoryRulesetRequiredStatusChecksRule{ @@ -10131,11 +10132,12 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { PullRequest: &RepositoryRulesetPullRequestRule{ Type: "pull_request", Parameters: &PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, + DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, RequiredApprovingReviewCount: 1, RequiredReviewThreadResolution: true, - DismissStaleReviewsOnPush: true, }, }, RequiredStatusChecks: &RepositoryRulesetRequiredStatusChecksRule{ @@ -10285,11 +10287,12 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { PullRequest: &RepositoryRulesetPullRequestRule{ Type: "pull_request", Parameters: &PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, + DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, RequiredApprovingReviewCount: 1, RequiredReviewThreadResolution: true, - DismissStaleReviewsOnPush: true, }, }, RequiredStatusChecks: &RepositoryRulesetRequiredStatusChecksRule{ @@ -10630,6 +10633,7 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { "pull_request": { "type": "pull_request", "parameters": { + "allowed_merge_methods": ["rebase","squash"], "dismiss_stale_reviews_on_push": true, "require_code_owner_review": true, "require_last_push_approval": true, @@ -10863,6 +10867,7 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { "pull_request": { "type": "pull_request", "parameters": { + "allowed_merge_methods": ["rebase","squash"], "dismiss_stale_reviews_on_push": true, "require_code_owner_review": true, "require_last_push_approval": true, @@ -11024,6 +11029,7 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { "pull_request": { "type": "pull_request", "parameters": { + "allowed_merge_methods": ["rebase","squash"], "dismiss_stale_reviews_on_push": true, "require_code_owner_review": true, "require_last_push_approval": true, @@ -11186,6 +11192,7 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { "pull_request": { "type": "pull_request", "parameters": { + "allowed_merge_methods": ["rebase","squash"], "dismiss_stale_reviews_on_push": true, "require_code_owner_review": true, "require_last_push_approval": true, diff --git a/github/github-accessors.go b/github/github-accessors.go index cf70ac59493..448154a47f4 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -21974,6 +21974,22 @@ func (r *Ruleset) GetUpdatedAt() Timestamp { return *r.UpdatedAt } +// GetOrganizationID returns the OrganizationID field. +func (r *RulesetConditions) GetOrganizationID() *RulesetOrganizationIDsConditionParameters { + if r == nil { + return nil + } + return r.OrganizationID +} + +// GetOrganizationName returns the OrganizationName field. +func (r *RulesetConditions) GetOrganizationName() *RulesetOrganizationNamesConditionParameters { + if r == nil { + return nil + } + return r.OrganizationName +} + // GetRefName returns the RefName field. func (r *RulesetConditions) GetRefName() *RulesetRefConditionParameters { if r == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index ff7530bcc0a..1e2a53f1601 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -28164,6 +28164,22 @@ func TestRuleset_GetUpdatedAt(tt *testing.T) { r.GetUpdatedAt() } +func TestRulesetConditions_GetOrganizationID(tt *testing.T) { + tt.Parallel() + r := &RulesetConditions{} + r.GetOrganizationID() + r = nil + r.GetOrganizationID() +} + +func TestRulesetConditions_GetOrganizationName(tt *testing.T) { + tt.Parallel() + r := &RulesetConditions{} + r.GetOrganizationName() + r = nil + r.GetOrganizationName() +} + func TestRulesetConditions_GetRefName(tt *testing.T) { tt.Parallel() r := &RulesetConditions{} diff --git a/github/orgs_rules.go b/github/orgs_rules.go index 37c06a7333c..b0773fab917 100644 --- a/github/orgs_rules.go +++ b/github/orgs_rules.go @@ -37,21 +37,21 @@ func (s *OrganizationsService) GetAllOrganizationRulesets(ctx context.Context, o // GitHub API docs: https://docs.github.com/rest/orgs/rules#create-an-organization-repository-ruleset // //meta:operation POST /orgs/{org}/rulesets -func (s *OrganizationsService) CreateOrganizationRuleset(ctx context.Context, org string, rs *Ruleset) (*Ruleset, *Response, error) { +func (s *OrganizationsService) CreateOrganizationRuleset(ctx context.Context, org string, ruleset Ruleset) (*Ruleset, *Response, error) { u := fmt.Sprintf("orgs/%v/rulesets", org) - req, err := s.client.NewRequest("POST", u, rs) + req, err := s.client.NewRequest("POST", u, ruleset) if err != nil { return nil, nil, err } - var ruleset *Ruleset - resp, err := s.client.Do(ctx, req, &ruleset) + var rs *Ruleset + resp, err := s.client.Do(ctx, req, &rs) if err != nil { return nil, resp, err } - return ruleset, resp, nil + return rs, resp, nil } // GetOrganizationRuleset gets a ruleset from the specified organization. @@ -81,21 +81,46 @@ func (s *OrganizationsService) GetOrganizationRuleset(ctx context.Context, org s // GitHub API docs: https://docs.github.com/rest/orgs/rules#update-an-organization-repository-ruleset // //meta:operation PUT /orgs/{org}/rulesets/{ruleset_id} -func (s *OrganizationsService) UpdateOrganizationRuleset(ctx context.Context, org string, rulesetID int64, rs *Ruleset) (*Ruleset, *Response, error) { +func (s *OrganizationsService) UpdateOrganizationRuleset(ctx context.Context, org string, rulesetID int64, ruleset Ruleset) (*Ruleset, *Response, error) { u := fmt.Sprintf("orgs/%v/rulesets/%v", org, rulesetID) - req, err := s.client.NewRequest("PUT", u, rs) + req, err := s.client.NewRequest("PUT", u, ruleset) if err != nil { return nil, nil, err } - var ruleset *Ruleset - resp, err := s.client.Do(ctx, req, &ruleset) + var rs *Ruleset + resp, err := s.client.Do(ctx, req, &rs) if err != nil { return nil, resp, err } - return ruleset, resp, nil + return rs, resp, nil +} + +// UpdateOrganizationRulesetClearBypassActor clears the ruleset bypass actors for a ruleset for the specified repository. +// +// This function is necessary as the UpdateOrganizationRuleset function does not marshal ByPassActor if passed as an empty array. +// +// GitHub API docs: https://docs.github.com/rest/orgs/rules#update-an-organization-repository-ruleset +// +//meta:operation PUT /orgs/{org}/rulesets/{ruleset_id} +func (s *OrganizationsService) UpdateOrganizationRulesetClearBypassActor(ctx context.Context, org string, rulesetID int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/rulesets/%v", org, rulesetID) + + rsClearBypassActor := rulesetClearBypassActors{} + + req, err := s.client.NewRequest("PUT", u, rsClearBypassActor) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req, nil) + if err != nil { + return resp, err + } + + return resp, nil } // DeleteOrganizationRuleset deletes a ruleset from the specified organization. diff --git a/github/orgs_rules_test.go b/github/orgs_rules_test.go index ebc559c640c..13afd4f058e 100644 --- a/github/orgs_rules_test.go +++ b/github/orgs_rules_test.go @@ -138,6 +138,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) { "type": "pull_request", "parameters": { + "allowed_merge_methods": ["rebase","squash"], "dismiss_stale_reviews_on_push": true, "require_code_owner_review": true, "require_last_push_approval": true, @@ -220,7 +221,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) }) ctx := context.Background() - ruleset, _, err := client.Organizations.CreateOrganizationRuleset(ctx, "o", &Ruleset{ + ruleset, _, err := client.Organizations.CreateOrganizationRuleset(ctx, "o", Ruleset{ ID: Ptr(int64(21)), Name: "ruleset", Target: Ptr("branch"), @@ -256,11 +257,12 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) }), NewRequiredSignaturesRule(), NewPullRequestRule(&PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, + DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, RequiredApprovingReviewCount: 1, RequiredReviewThreadResolution: true, - DismissStaleReviewsOnPush: true, }), NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ RequiredStatusChecks: []RuleRequiredStatusChecks{ @@ -351,11 +353,12 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) }), NewRequiredSignaturesRule(), NewPullRequestRule(&PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, + DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, RequiredApprovingReviewCount: 1, RequiredReviewThreadResolution: true, - DismissStaleReviewsOnPush: true, }), NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ RequiredStatusChecks: []RuleRequiredStatusChecks{ @@ -413,7 +416,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) const methodName = "CreateOrganizationRuleset" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Organizations.CreateOrganizationRuleset(ctx, "o", nil) + got, resp, err := client.Organizations.CreateOrganizationRuleset(ctx, "o", Ruleset{}) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -489,6 +492,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing. { "type": "pull_request", "parameters": { + "allowed_merge_methods": ["rebase","squash"], "dismiss_stale_reviews_on_push": true, "require_code_owner_review": true, "require_last_push_approval": true, @@ -571,7 +575,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing. }) ctx := context.Background() - ruleset, _, err := client.Organizations.CreateOrganizationRuleset(ctx, "o", &Ruleset{ + ruleset, _, err := client.Organizations.CreateOrganizationRuleset(ctx, "o", Ruleset{ ID: Ptr(int64(21)), Name: "ruleset", Target: Ptr("branch"), @@ -613,11 +617,12 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing. }), NewRequiredSignaturesRule(), NewPullRequestRule(&PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, + DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, RequiredApprovingReviewCount: 1, RequiredReviewThreadResolution: true, - DismissStaleReviewsOnPush: true, }), NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ RequiredStatusChecks: []RuleRequiredStatusChecks{ @@ -714,11 +719,12 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing. }), NewRequiredSignaturesRule(), NewPullRequestRule(&PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, + DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, RequiredApprovingReviewCount: 1, RequiredReviewThreadResolution: true, - DismissStaleReviewsOnPush: true, }), NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ RequiredStatusChecks: []RuleRequiredStatusChecks{ @@ -776,7 +782,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing. const methodName = "CreateOrganizationRuleset" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Organizations.CreateOrganizationRuleset(ctx, "o", nil) + got, resp, err := client.Organizations.CreateOrganizationRuleset(ctx, "o", Ruleset{}) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -845,6 +851,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { { "type": "pull_request", "parameters": { + "allowed_merge_methods": ["rebase","squash"], "dismiss_stale_reviews_on_push": true, "require_code_owner_review": true, "require_last_push_approval": true, @@ -927,7 +934,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { }) ctx := context.Background() - ruleset, _, err := client.Organizations.CreateOrganizationRuleset(ctx, "o", &Ruleset{ + ruleset, _, err := client.Organizations.CreateOrganizationRuleset(ctx, "o", Ruleset{ ID: Ptr(int64(21)), Name: "ruleset", Target: Ptr("branch"), @@ -961,11 +968,12 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { }), NewRequiredSignaturesRule(), NewPullRequestRule(&PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, + DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, RequiredApprovingReviewCount: 1, RequiredReviewThreadResolution: true, - DismissStaleReviewsOnPush: true, }), NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ RequiredStatusChecks: []RuleRequiredStatusChecks{ @@ -1054,11 +1062,12 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { }), NewRequiredSignaturesRule(), NewPullRequestRule(&PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, + DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, RequiredApprovingReviewCount: 1, RequiredReviewThreadResolution: true, - DismissStaleReviewsOnPush: true, }), NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ RequiredStatusChecks: []RuleRequiredStatusChecks{ @@ -1116,7 +1125,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { const methodName = "CreateOrganizationRuleset" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Organizations.CreateOrganizationRuleset(ctx, "o", nil) + got, resp, err := client.Organizations.CreateOrganizationRuleset(ctx, "o", Ruleset{}) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -1360,7 +1369,7 @@ func TestOrganizationsService_UpdateOrganizationRuleset(t *testing.T) { }) ctx := context.Background() - rulesets, _, err := client.Organizations.UpdateOrganizationRuleset(ctx, "o", 26110, &Ruleset{ + rulesets, _, err := client.Organizations.UpdateOrganizationRuleset(ctx, "o", 26110, Ruleset{ Name: "test ruleset", Target: Ptr("branch"), Enforcement: "active", @@ -1379,7 +1388,6 @@ func TestOrganizationsService_UpdateOrganizationRuleset(t *testing.T) { NewCreationRule(), }, }) - if err != nil { t.Errorf("Organizations.UpdateOrganizationRuleset returned error: %v", err) } @@ -1417,7 +1425,7 @@ func TestOrganizationsService_UpdateOrganizationRuleset(t *testing.T) { const methodName = "UpdateOrganizationRuleset" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Organizations.UpdateOrganizationRuleset(ctx, "o", 26110, nil) + got, resp, err := client.Organizations.UpdateOrganizationRuleset(ctx, "o", 26110, Ruleset{}) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -1468,7 +1476,7 @@ func TestOrganizationsService_UpdateOrganizationRulesetWithRepoProp(t *testing.T }) ctx := context.Background() - rulesets, _, err := client.Organizations.UpdateOrganizationRuleset(ctx, "o", 26110, &Ruleset{ + rulesets, _, err := client.Organizations.UpdateOrganizationRuleset(ctx, "o", 26110, Ruleset{ Name: "test ruleset", Target: Ptr("branch"), Enforcement: "active", @@ -1488,7 +1496,6 @@ func TestOrganizationsService_UpdateOrganizationRulesetWithRepoProp(t *testing.T NewCreationRule(), }, }) - if err != nil { t.Errorf("Organizations.UpdateOrganizationRuleset returned error: %v", err) } @@ -1527,7 +1534,7 @@ func TestOrganizationsService_UpdateOrganizationRulesetWithRepoProp(t *testing.T const methodName = "UpdateOrganizationRuleset" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Organizations.UpdateOrganizationRuleset(ctx, "o", 26110, nil) + got, resp, err := client.Organizations.UpdateOrganizationRuleset(ctx, "o", 26110, Ruleset{}) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -1535,6 +1542,63 @@ func TestOrganizationsService_UpdateOrganizationRulesetWithRepoProp(t *testing.T }) } +func TestOrganizationsService_UpdateOrganizationRulesetClearBypassActor(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/orgs/o/rulesets/26110", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + fmt.Fprint(w, `{ + "id": 26110, + "name": "test ruleset", + "target": "branch", + "source_type": "Organization", + "source": "o", + "enforcement": "active", + "bypass_mode": "none", + "conditions": { + "repository_name": { + "include": [ + "important_repository", + "another_important_repository" + ], + "exclude": [ + "unimportant_repository" + ], + "protected": true + }, + "ref_name": { + "include": [ + "refs/heads/main", + "refs/heads/master" + ], + "exclude": [ + "refs/heads/dev*" + ] + } + }, + "rules": [ + { + "type": "creation" + } + ] + }`) + }) + + ctx := context.Background() + + _, err := client.Organizations.UpdateOrganizationRulesetClearBypassActor(ctx, "o", 26110) + if err != nil { + t.Errorf("Organizations.UpdateOrganizationRulesetClearBypassActor returned error: %v \n", err) + } + + const methodName = "UpdateOrganizationRulesetClearBypassActor" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Organizations.UpdateOrganizationRulesetClearBypassActor(ctx, "o", 26110) + }) +} + func TestOrganizationsService_DeleteOrganizationRuleset(t *testing.T) { t.Parallel() client, mux, _ := setup(t) diff --git a/github/repos_rules.go b/github/repos_rules.go index b113553a247..60e9739cdf7 100644 --- a/github/repos_rules.go +++ b/github/repos_rules.go @@ -11,6 +11,16 @@ import ( "fmt" ) +// MergeMethod models a GitHub merge method. +type MergeMethod string + +// This is the set of GitHub merge methods. +const ( + MergeMethodMerge MergeMethod = "merge" + MergeMethodRebase MergeMethod = "rebase" + MergeMethodSquash MergeMethod = "squash" +) + // BypassActor represents the bypass actors from a ruleset. type BypassActor struct { ActorID *int64 `json:"actor_id,omitempty"` @@ -36,14 +46,14 @@ type RulesetRefConditionParameters struct { Exclude []string `json:"exclude"` } -// RulesetRepositoryNamesConditionParameters represents the conditions object for repository_names. +// RulesetRepositoryNamesConditionParameters represents the conditions object for repository_name. type RulesetRepositoryNamesConditionParameters struct { Include []string `json:"include"` Exclude []string `json:"exclude"` Protected *bool `json:"protected,omitempty"` } -// RulesetRepositoryIDsConditionParameters represents the conditions object for repository_ids. +// RulesetRepositoryIDsConditionParameters represents the conditions object for repository_id. type RulesetRepositoryIDsConditionParameters struct { RepositoryIDs []int64 `json:"repository_ids,omitempty"` } @@ -61,6 +71,17 @@ type RulesetRepositoryPropertyConditionParameters struct { Exclude []RulesetRepositoryPropertyTargetParameters `json:"exclude"` } +// RulesetOrganizationNamesConditionParameters represents the conditions object for organization_name. +type RulesetOrganizationNamesConditionParameters struct { + Include []string `json:"include"` + Exclude []string `json:"exclude"` +} + +// RulesetOrganizationIDsConditionParameters represents the conditions object for organization_id. +type RulesetOrganizationIDsConditionParameters struct { + OrganizationIDs []int64 `json:"organization_ids,omitempty"` +} + // RulesetConditions represents the conditions object in a ruleset. // Set either RepositoryName or RepositoryID or RepositoryProperty, not more than one. type RulesetConditions struct { @@ -68,6 +89,8 @@ type RulesetConditions struct { RepositoryName *RulesetRepositoryNamesConditionParameters `json:"repository_name,omitempty"` RepositoryID *RulesetRepositoryIDsConditionParameters `json:"repository_id,omitempty"` RepositoryProperty *RulesetRepositoryPropertyConditionParameters `json:"repository_property,omitempty"` + OrganizationName *RulesetOrganizationNamesConditionParameters `json:"organization_name,omitempty"` + OrganizationID *RulesetOrganizationIDsConditionParameters `json:"organization_id,omitempty"` } // RulePatternParameters represents the rule pattern parameters. @@ -112,11 +135,12 @@ type RequiredDeploymentEnvironmentsRuleParameters struct { // PullRequestRuleParameters represents the pull_request rule parameters. type PullRequestRuleParameters struct { - DismissStaleReviewsOnPush bool `json:"dismiss_stale_reviews_on_push"` - RequireCodeOwnerReview bool `json:"require_code_owner_review"` - RequireLastPushApproval bool `json:"require_last_push_approval"` - RequiredApprovingReviewCount int `json:"required_approving_review_count"` - RequiredReviewThreadResolution bool `json:"required_review_thread_resolution"` + AllowedMergeMethods []MergeMethod `json:"allowed_merge_methods"` + DismissStaleReviewsOnPush bool `json:"dismiss_stale_reviews_on_push"` + RequireCodeOwnerReview bool `json:"require_code_owner_review"` + RequireLastPushApproval bool `json:"require_last_push_approval"` + RequiredApprovingReviewCount int `json:"required_approving_review_count"` + RequiredReviewThreadResolution bool `json:"required_review_thread_resolution"` } // RuleRequiredStatusChecks represents the RequiredStatusChecks for the RequiredStatusChecksRuleParameters object. @@ -824,6 +848,11 @@ type rulesetNoOmitBypassActors struct { Rules []*RepositoryRule `json:"rules,omitempty"` } +// rulesetClearBypassActors is used to clear the bypass actors when modifying a GitHub ruleset object. +type rulesetClearBypassActors struct { + BypassActors []*BypassActor `json:"bypass_actors"` +} + // GetRulesForBranch gets all the rules that apply to the specified branch. // // GitHub API docs: https://docs.github.com/rest/repos/rules#get-rules-for-a-branch @@ -874,21 +903,21 @@ func (s *RepositoriesService) GetAllRulesets(ctx context.Context, owner, repo st // GitHub API docs: https://docs.github.com/rest/repos/rules#create-a-repository-ruleset // //meta:operation POST /repos/{owner}/{repo}/rulesets -func (s *RepositoriesService) CreateRuleset(ctx context.Context, owner, repo string, rs *Ruleset) (*Ruleset, *Response, error) { +func (s *RepositoriesService) CreateRuleset(ctx context.Context, owner, repo string, ruleset Ruleset) (*Ruleset, *Response, error) { u := fmt.Sprintf("repos/%v/%v/rulesets", owner, repo) - req, err := s.client.NewRequest("POST", u, rs) + req, err := s.client.NewRequest("POST", u, ruleset) if err != nil { return nil, nil, err } - var ruleset *Ruleset - resp, err := s.client.Do(ctx, req, &ruleset) + var rs *Ruleset + resp, err := s.client.Do(ctx, req, &rs) if err != nil { return nil, resp, err } - return ruleset, resp, nil + return rs, resp, nil } // GetRuleset gets a ruleset for the specified repository. @@ -919,49 +948,72 @@ func (s *RepositoriesService) GetRuleset(ctx context.Context, owner, repo string // GitHub API docs: https://docs.github.com/rest/repos/rules#update-a-repository-ruleset // //meta:operation PUT /repos/{owner}/{repo}/rulesets/{ruleset_id} -func (s *RepositoriesService) UpdateRuleset(ctx context.Context, owner, repo string, rulesetID int64, rs *Ruleset) (*Ruleset, *Response, error) { +func (s *RepositoriesService) UpdateRuleset(ctx context.Context, owner, repo string, rulesetID int64, ruleset Ruleset) (*Ruleset, *Response, error) { u := fmt.Sprintf("repos/%v/%v/rulesets/%v", owner, repo, rulesetID) - req, err := s.client.NewRequest("PUT", u, rs) + req, err := s.client.NewRequest("PUT", u, ruleset) if err != nil { return nil, nil, err } - var ruleset *Ruleset - resp, err := s.client.Do(ctx, req, &ruleset) + var rs *Ruleset + resp, err := s.client.Do(ctx, req, &rs) if err != nil { return nil, resp, err } - return ruleset, resp, nil + return rs, resp, nil +} + +// UpdateRulesetClearBypassActor clears the ruleset bypass actors for a ruleset for the specified repository. +// +// This function is necessary as the UpdateRuleset function does not marshal ByPassActor if passed as an empty array. +// +// GitHub API docs: https://docs.github.com/rest/repos/rules#update-a-repository-ruleset +// +//meta:operation PUT /repos/{owner}/{repo}/rulesets/{ruleset_id} +func (s *RepositoriesService) UpdateRulesetClearBypassActor(ctx context.Context, owner, repo string, rulesetID int64) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/rulesets/%v", owner, repo, rulesetID) + + rsClearBypassActor := rulesetClearBypassActors{} + + req, err := s.client.NewRequest("PUT", u, rsClearBypassActor) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req, nil) + if err != nil { + return resp, err + } + + return resp, nil } // UpdateRulesetNoBypassActor updates a ruleset for the specified repository. // -// This function is necessary as the UpdateRuleset function does not marshal ByPassActor if passed as nil or an empty array. +// This function is necessary as the UpdateRuleset function does not marshal ByPassActor if passed as an empty array. +// +// Deprecated: Use UpdateRulesetClearBypassActor instead. // // GitHub API docs: https://docs.github.com/rest/repos/rules#update-a-repository-ruleset // //meta:operation PUT /repos/{owner}/{repo}/rulesets/{ruleset_id} -func (s *RepositoriesService) UpdateRulesetNoBypassActor(ctx context.Context, owner, repo string, rulesetID int64, rs *Ruleset) (*Ruleset, *Response, error) { +func (s *RepositoriesService) UpdateRulesetNoBypassActor(ctx context.Context, owner, repo string, rulesetID int64, ruleset Ruleset) (*Ruleset, *Response, error) { u := fmt.Sprintf("repos/%v/%v/rulesets/%v", owner, repo, rulesetID) - rsNoBypassActor := &rulesetNoOmitBypassActors{} - - if rs != nil { - rsNoBypassActor = &rulesetNoOmitBypassActors{ - ID: rs.ID, - Name: rs.Name, - Target: rs.Target, - SourceType: rs.SourceType, - Source: rs.Source, - Enforcement: rs.Enforcement, - BypassActors: rs.BypassActors, - NodeID: rs.NodeID, - Links: rs.Links, - Conditions: rs.Conditions, - Rules: rs.Rules, - } + rsNoBypassActor := rulesetNoOmitBypassActors{ + ID: ruleset.ID, + Name: ruleset.Name, + Target: ruleset.Target, + SourceType: ruleset.SourceType, + Source: ruleset.Source, + Enforcement: ruleset.Enforcement, + BypassActors: ruleset.BypassActors, + NodeID: ruleset.NodeID, + Links: ruleset.Links, + Conditions: ruleset.Conditions, + Rules: ruleset.Rules, } req, err := s.client.NewRequest("PUT", u, rsNoBypassActor) @@ -969,13 +1021,13 @@ func (s *RepositoriesService) UpdateRulesetNoBypassActor(ctx context.Context, ow return nil, nil, err } - var ruleSet *Ruleset - resp, err := s.client.Do(ctx, req, &ruleSet) + var rs *Ruleset + resp, err := s.client.Do(ctx, req, &rs) if err != nil { return nil, resp, err } - return ruleSet, resp, nil + return rs, resp, nil } // DeleteRuleset deletes a ruleset for the specified repository. diff --git a/github/repos_rules_test.go b/github/repos_rules_test.go index 1597b36e110..8ee8b9749ec 100644 --- a/github/repos_rules_test.go +++ b/github/repos_rules_test.go @@ -243,6 +243,7 @@ func TestRepositoryRule_UnmarshalJSON(t *testing.T) { data: `{ "type":"pull_request", "parameters":{ + "allowed_merge_methods": ["rebase","squash"], "dismiss_stale_reviews_on_push": true, "require_code_owner_review": true, "require_last_push_approval": true, @@ -251,6 +252,7 @@ func TestRepositoryRule_UnmarshalJSON(t *testing.T) { } }`, want: NewPullRequestRule(&PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, @@ -590,7 +592,7 @@ func TestRepositoriesService_CreateRuleset(t *testing.T) { }) ctx := context.Background() - ruleSet, _, err := client.Repositories.CreateRuleset(ctx, "o", "repo", &Ruleset{ + ruleSet, _, err := client.Repositories.CreateRuleset(ctx, "o", "repo", Ruleset{ Name: "ruleset", Enforcement: "enabled", }) @@ -612,7 +614,7 @@ func TestRepositoriesService_CreateRuleset(t *testing.T) { const methodName = "CreateRuleset" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.CreateRuleset(ctx, "o", "repo", &Ruleset{}) + got, resp, err := client.Repositories.CreateRuleset(ctx, "o", "repo", Ruleset{}) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -663,7 +665,7 @@ func TestRepositoriesService_CreateRulesetWithPushRules(t *testing.T) { }) ctx := context.Background() - ruleSet, _, err := client.Repositories.CreateRuleset(ctx, "o", "repo", &Ruleset{ + ruleSet, _, err := client.Repositories.CreateRuleset(ctx, "o", "repo", Ruleset{ Name: "ruleset", Enforcement: "enabled", }) @@ -700,7 +702,7 @@ func TestRepositoriesService_CreateRulesetWithPushRules(t *testing.T) { const methodName = "CreateRuleset" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.CreateRuleset(ctx, "o", "repo", &Ruleset{}) + got, resp, err := client.Repositories.CreateRuleset(ctx, "o", "repo", Ruleset{}) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -755,16 +757,10 @@ func TestRepositoriesService_GetRuleset(t *testing.T) { }) } -func TestRepositoriesService_UpdateRulesetNoBypassActor(t *testing.T) { +func TestRepositoriesService_UpdateRuleset(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - rs := &Ruleset{ - Name: "ruleset", - Source: "o/repo", - Enforcement: "enabled", - } - mux.HandleFunc("/repos/o/repo/rulesets/42", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") fmt.Fprint(w, `{ @@ -777,11 +773,12 @@ func TestRepositoriesService_UpdateRulesetNoBypassActor(t *testing.T) { }) ctx := context.Background() - - ruleSet, _, err := client.Repositories.UpdateRulesetNoBypassActor(ctx, "o", "repo", 42, rs) - + ruleSet, _, err := client.Repositories.UpdateRuleset(ctx, "o", "repo", 42, Ruleset{ + Name: "ruleset", + Enforcement: "enabled", + }) if err != nil { - t.Errorf("Repositories.UpdateRulesetNoBypassActor returned error: %v \n", err) + t.Errorf("Repositories.UpdateRuleset returned error: %v", err) } want := &Ruleset{ @@ -793,13 +790,13 @@ func TestRepositoriesService_UpdateRulesetNoBypassActor(t *testing.T) { } if !cmp.Equal(ruleSet, want) { - t.Errorf("Repositories.UpdateRulesetNoBypassActor returned %+v, want %+v", ruleSet, want) + t.Errorf("Repositories.UpdateRuleset returned %+v, want %+v", ruleSet, want) } - const methodName = "UpdateRulesetNoBypassActor" + const methodName = "UpdateRuleset" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.UpdateRulesetNoBypassActor(ctx, "o", "repo", 42, nil) + got, resp, err := client.Repositories.UpdateRuleset(ctx, "o", "repo", 42, Ruleset{}) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -807,7 +804,7 @@ func TestRepositoriesService_UpdateRulesetNoBypassActor(t *testing.T) { }) } -func TestRepositoriesService_UpdateRuleset(t *testing.T) { +func TestRepositoriesService_UpdateRulesetClearBypassActor(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -819,16 +816,65 @@ func TestRepositoriesService_UpdateRuleset(t *testing.T) { "source_type": "Repository", "source": "o/repo", "enforcement": "enabled" + "conditions": { + "ref_name": { + "include": [ + "refs/heads/main", + "refs/heads/master" + ], + "exclude": [ + "refs/heads/dev*" + ] + } + }, + "rules": [ + { + "type": "creation" + } + ] }`) }) ctx := context.Background() - ruleSet, _, err := client.Repositories.UpdateRuleset(ctx, "o", "repo", 42, &Ruleset{ + + _, err := client.Repositories.UpdateRulesetClearBypassActor(ctx, "o", "repo", 42) + if err != nil { + t.Errorf("Repositories.UpdateRulesetClearBypassActor returned error: %v \n", err) + } + + const methodName = "UpdateRulesetClearBypassActor" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Repositories.UpdateRulesetClearBypassActor(ctx, "o", "repo", 42) + }) +} + +func TestRepositoriesService_UpdateRulesetNoBypassActor(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + rs := Ruleset{ Name: "ruleset", + Source: "o/repo", Enforcement: "enabled", + } + + mux.HandleFunc("/repos/o/repo/rulesets/42", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + fmt.Fprint(w, `{ + "id": 42, + "name": "ruleset", + "source_type": "Repository", + "source": "o/repo", + "enforcement": "enabled" + }`) }) + + ctx := context.Background() + + ruleSet, _, err := client.Repositories.UpdateRulesetNoBypassActor(ctx, "o", "repo", 42, rs) if err != nil { - t.Errorf("Repositories.UpdateRuleset returned error: %v", err) + t.Errorf("Repositories.UpdateRulesetNoBypassActor returned error: %v \n", err) } want := &Ruleset{ @@ -840,13 +886,13 @@ func TestRepositoriesService_UpdateRuleset(t *testing.T) { } if !cmp.Equal(ruleSet, want) { - t.Errorf("Repositories.UpdateRuleset returned %+v, want %+v", ruleSet, want) + t.Errorf("Repositories.UpdateRulesetNoBypassActor returned %+v, want %+v", ruleSet, want) } - const methodName = "UpdateRuleset" + const methodName = "UpdateRulesetNoBypassActor" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.UpdateRuleset(ctx, "o", "repo", 42, nil) + got, resp, err := client.Repositories.UpdateRulesetNoBypassActor(ctx, "o", "repo", 42, Ruleset{}) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } From 1343645a00933bc5c9545fc676decb69d9418b6a Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Thu, 9 Jan 2025 12:19:20 -0500 Subject: [PATCH 614/751] Enforce toolchain requirement in generate.sh (#3428) --- script/generate.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/generate.sh b/script/generate.sh index 6dab2ad6795..8d5f240dfaa 100755 --- a/script/generate.sh +++ b/script/generate.sh @@ -43,6 +43,6 @@ for dir in $MOD_DIRS; do ( cd "$dir" go generate ./... - go mod tidy -compat '1.21' + GOTOOLCHAIN="go1.22+auto" go mod tidy ) done From 6b18a2be3816c36d6fd28092e5ce1cdd64b37346 Mon Sep 17 00:00:00 2001 From: Steve Hipwell Date: Tue, 14 Jan 2025 15:25:31 +0000 Subject: [PATCH 615/751] feat: Add missing notification_setting to `Team` (#3431) --- github/copilot_test.go | 75 +++++++++++++++++---------------- github/github-accessors.go | 8 ++++ github/github-accessors_test.go | 11 +++++ github/github-stringify_test.go | 37 ++++++++-------- github/teams.go | 3 ++ 5 files changed, 80 insertions(+), 54 deletions(-) diff --git a/github/copilot_test.go b/github/copilot_test.go index 82e8a770455..6a2f1703d37 100644 --- a/github/copilot_test.go +++ b/github/copilot_test.go @@ -515,18 +515,19 @@ func TestCopilotService_ListCopilotSeats(t *testing.T) { SiteAdmin: Ptr(false), }, AssigningTeam: &Team{ - ID: Ptr(int64(1)), - NodeID: Ptr("MDQ6VGVhbTE="), - URL: Ptr("https://api.github.com/teams/1"), - HTMLURL: Ptr("https://github.com/orgs/github/teams/justice-league"), - Name: Ptr("Justice League"), - Slug: Ptr("justice-league"), - Description: Ptr("A great team."), - Privacy: Ptr("closed"), - Permission: Ptr("admin"), - MembersURL: Ptr("https://api.github.com/teams/1/members{/member}"), - RepositoriesURL: Ptr("https://api.github.com/teams/1/repos"), - Parent: nil, + ID: Ptr(int64(1)), + NodeID: Ptr("MDQ6VGVhbTE="), + URL: Ptr("https://api.github.com/teams/1"), + HTMLURL: Ptr("https://github.com/orgs/github/teams/justice-league"), + Name: Ptr("Justice League"), + Slug: Ptr("justice-league"), + Description: Ptr("A great team."), + Privacy: Ptr("closed"), + Permission: Ptr("admin"), + NotificationSetting: Ptr("notifications_enabled"), + MembersURL: Ptr("https://api.github.com/teams/1/members{/member}"), + RepositoriesURL: Ptr("https://api.github.com/teams/1/repos"), + Parent: nil, }, CreatedAt: &createdAt1, UpdatedAt: &updatedAt1, @@ -765,18 +766,19 @@ func TestCopilotService_ListCopilotEnterpriseSeats(t *testing.T) { SiteAdmin: Ptr(false), }, AssigningTeam: &Team{ - ID: Ptr(int64(1)), - NodeID: Ptr("MDQ6VGVhbTE="), - URL: Ptr("https://api.github.com/teams/1"), - HTMLURL: Ptr("https://github.com/orgs/github/teams/justice-league"), - Name: Ptr("Justice League"), - Slug: Ptr("justice-league"), - Description: Ptr("A great team."), - Privacy: Ptr("closed"), - Permission: Ptr("admin"), - MembersURL: Ptr("https://api.github.com/teams/1/members{/member}"), - RepositoriesURL: Ptr("https://api.github.com/teams/1/repos"), - Parent: nil, + ID: Ptr(int64(1)), + NodeID: Ptr("MDQ6VGVhbTE="), + URL: Ptr("https://api.github.com/teams/1"), + HTMLURL: Ptr("https://github.com/orgs/github/teams/justice-league"), + Name: Ptr("Justice League"), + Slug: Ptr("justice-league"), + Description: Ptr("A great team."), + Privacy: Ptr("closed"), + NotificationSetting: Ptr("notifications_enabled"), + Permission: Ptr("admin"), + MembersURL: Ptr("https://api.github.com/teams/1/members{/member}"), + RepositoriesURL: Ptr("https://api.github.com/teams/1/repos"), + Parent: nil, }, CreatedAt: &createdAt1, UpdatedAt: &updatedAt1, @@ -1087,18 +1089,19 @@ func TestCopilotService_GetSeatDetails(t *testing.T) { SiteAdmin: Ptr(false), }, AssigningTeam: &Team{ - ID: Ptr(int64(1)), - NodeID: Ptr("MDQ6VGVhbTE="), - URL: Ptr("https://api.github.com/teams/1"), - HTMLURL: Ptr("https://github.com/orgs/github/teams/justice-league"), - Name: Ptr("Justice League"), - Slug: Ptr("justice-league"), - Description: Ptr("A great team."), - Privacy: Ptr("closed"), - Permission: Ptr("admin"), - MembersURL: Ptr("https://api.github.com/teams/1/members{/member}"), - RepositoriesURL: Ptr("https://api.github.com/teams/1/repos"), - Parent: nil, + ID: Ptr(int64(1)), + NodeID: Ptr("MDQ6VGVhbTE="), + URL: Ptr("https://api.github.com/teams/1"), + HTMLURL: Ptr("https://github.com/orgs/github/teams/justice-league"), + Name: Ptr("Justice League"), + Slug: Ptr("justice-league"), + Description: Ptr("A great team."), + Privacy: Ptr("closed"), + NotificationSetting: Ptr("notifications_enabled"), + Permission: Ptr("admin"), + MembersURL: Ptr("https://api.github.com/teams/1/members{/member}"), + RepositoriesURL: Ptr("https://api.github.com/teams/1/repos"), + Parent: nil, }, CreatedAt: &createdAt, UpdatedAt: &updatedAt, diff --git a/github/github-accessors.go b/github/github-accessors.go index 448154a47f4..ec7ac4f7b20 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -24046,6 +24046,14 @@ func (t *Team) GetNodeID() string { return *t.NodeID } +// GetNotificationSetting returns the NotificationSetting field if it's non-nil, zero value otherwise. +func (t *Team) GetNotificationSetting() string { + if t == nil || t.NotificationSetting == nil { + return "" + } + return *t.NotificationSetting +} + // GetOrganization returns the Organization field. func (t *Team) GetOrganization() *Organization { if t == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 1e2a53f1601..dca95aba16e 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -30794,6 +30794,17 @@ func TestTeam_GetNodeID(tt *testing.T) { t.GetNodeID() } +func TestTeam_GetNotificationSetting(tt *testing.T) { + tt.Parallel() + var zeroValue string + t := &Team{NotificationSetting: &zeroValue} + t.GetNotificationSetting() + t = &Team{} + t.GetNotificationSetting() + t = nil + t.GetNotificationSetting() +} + func TestTeam_GetOrganization(tt *testing.T) { tt.Parallel() t := &Team{} diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index 6fda6a907c7..881e279f942 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -1930,25 +1930,26 @@ func TestSourceImportAuthor_String(t *testing.T) { func TestTeam_String(t *testing.T) { t.Parallel() v := Team{ - ID: Ptr(int64(0)), - NodeID: Ptr(""), - Name: Ptr(""), - Description: Ptr(""), - URL: Ptr(""), - Slug: Ptr(""), - Permission: Ptr(""), - Privacy: Ptr(""), - MembersCount: Ptr(0), - ReposCount: Ptr(0), - Organization: &Organization{}, - HTMLURL: Ptr(""), - MembersURL: Ptr(""), - RepositoriesURL: Ptr(""), - Parent: &Team{}, - LDAPDN: Ptr(""), - Assignment: Ptr(""), + ID: Ptr(int64(0)), + NodeID: Ptr(""), + Name: Ptr(""), + Description: Ptr(""), + URL: Ptr(""), + Slug: Ptr(""), + Permission: Ptr(""), + Privacy: Ptr(""), + NotificationSetting: Ptr(""), + MembersCount: Ptr(0), + ReposCount: Ptr(0), + Organization: &Organization{}, + HTMLURL: Ptr(""), + MembersURL: Ptr(""), + RepositoriesURL: Ptr(""), + Parent: &Team{}, + LDAPDN: Ptr(""), + Assignment: Ptr(""), } - want := `github.Team{ID:0, NodeID:"", Name:"", Description:"", URL:"", Slug:"", Permission:"", Privacy:"", MembersCount:0, ReposCount:0, Organization:github.Organization{}, HTMLURL:"", MembersURL:"", RepositoriesURL:"", Parent:github.Team{}, LDAPDN:"", Assignment:""}` + want := `github.Team{ID:0, NodeID:"", Name:"", Description:"", URL:"", Slug:"", Permission:"", Privacy:"", NotificationSetting:"", MembersCount:0, ReposCount:0, Organization:github.Organization{}, HTMLURL:"", MembersURL:"", RepositoriesURL:"", Parent:github.Team{}, LDAPDN:"", Assignment:""}` if got := v.String(); got != want { t.Errorf("Team.String = %v, want %v", got, want) } diff --git a/github/teams.go b/github/teams.go index 579e5b828b5..d334110f4a7 100644 --- a/github/teams.go +++ b/github/teams.go @@ -37,6 +37,9 @@ type Team struct { // Default is "secret". Privacy *string `json:"privacy,omitempty"` + // NotificationSetting can be one of: "notifications_enabled", "notifications_disabled". + NotificationSetting *string `json:"notification_setting,omitempty"` + MembersCount *int `json:"members_count,omitempty"` ReposCount *int `json:"repos_count,omitempty"` Organization *Organization `json:"organization,omitempty"` From 2db75de8d301f50ae39b8e3c0bfbce5ac6ff7c4d Mon Sep 17 00:00:00 2001 From: Steve Hipwell Date: Thu, 16 Jan 2025 14:58:53 +0000 Subject: [PATCH 616/751] chore: Add reviewers file (#3435) --- CONTRIBUTING.md | 23 ++++++++++++++++++++--- REVIEWERS | 1 + 2 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 REVIEWERS diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e1fdbef5abe..f8317aa567f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -15,7 +15,6 @@ You generally only need to submit a CLA once, so if you've already submitted one (even if it was for a different project), you probably don't need to do it again. - ## Reporting issues Bugs, feature requests, and development-related questions should be directed to @@ -28,6 +27,21 @@ how the requested feature would help you do that. Security related bugs can either be reported in the issue tracker, or if they are more sensitive, emailed to . +## Reviewing PRs + +In addition to writing code, community projects also require community +contributions in other ways; one of these is reviewing code contributions. If +you are willing to review PRs please open a PR to add your GitHub username to +the [REVIEWERS](./REVIEWERS) file. By adding your GitHub username to the list +of reviewers you are giving contributors permission to request a review for a +PR that has already been approved by a maintainer. If you are asked to review a +PR and either do not have the time or do not think you are able to you should +feel comfortable politely saying no. + +If at any time you would like to remove your permission to be contacted for a +review you can open a PR to remove your name from the [REVIEWERS](./REVIEWERS) +file. + ## Submitting a patch 1. It's generally best to start by opening a new issue describing the bug or @@ -67,10 +81,14 @@ are more sensitive, emailed to . This is done to make a much cleaner `git log` history and helps to find regressions in the code using existing tools such as `git bisect`. + - If your PR needs additional reviews you can request one of the + [REVIEWERS][] takes a look by mentioning them in a PR comment. + [forking]: https://help.github.com/articles/fork-a-repo [well-formed commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html [pull request]: https://help.github.com/articles/creating-a-pull-request [monitored by codecov.io]: https://codecov.io/gh/google/go-github +[REVIEWERS]: ./REVIEWERS ## Code Comments @@ -195,7 +213,7 @@ section for more information. **script/test.sh** runs tests on all modules. -## Other notes on code organization ## +## Other notes on code organization Currently, everything is defined in the main `github` package, with API methods broken into separate service objects. These services map directly to how @@ -210,7 +228,6 @@ defined at live in [GitHub API documentation]: https://docs.github.com/en/rest [repos_hooks.go]: https://github.com/google/go-github/blob/master/github/repos_hooks.go - ## Maintainer's Guide (These notes are mostly only for people merging in pull requests.) diff --git a/REVIEWERS b/REVIEWERS new file mode 100644 index 00000000000..2dd1f6fe582 --- /dev/null +++ b/REVIEWERS @@ -0,0 +1 @@ +stevehipwell From d13c7393434693a0e0b0f48a6686f7af6aa558b5 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Fri, 17 Jan 2025 00:21:54 +0200 Subject: [PATCH 617/751] gen-accessors: Update dumping of getters (#3437) --- github/gen-accessors.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/github/gen-accessors.go b/github/gen-accessors.go index d5d8e5cebd1..261b945e426 100644 --- a/github/gen-accessors.go +++ b/github/gen-accessors.go @@ -22,7 +22,7 @@ import ( "go/token" "log" "os" - "sort" + "slices" "strings" "text/template" ) @@ -182,7 +182,9 @@ func (t *templateData) dump() error { } // Sort getters by ReceiverType.FieldName. - sort.Sort(byName(t.Getters)) + slices.SortStableFunc(t.Getters, func(a, b *getter) int { + return strings.Compare(a.sortVal, b.sortVal) + }) processTemplate := func(tmpl *template.Template, filename string) error { var buf bytes.Buffer @@ -344,12 +346,6 @@ type getter struct { ArrayType bool } -type byName []*getter - -func (b byName) Len() int { return len(b) } -func (b byName) Less(i, j int) bool { return b[i].sortVal < b[j].sortVal } -func (b byName) Swap(i, j int) { b[i], b[j] = b[j], b[i] } - const source = `// Copyright {{.Year}} The go-github AUTHORS. All rights reserved. // // Use of this source code is governed by a BSD-style From ce3a8398fa2b9caf2558f28da98083bb445185a3 Mon Sep 17 00:00:00 2001 From: Steve Hipwell Date: Mon, 20 Jan 2025 14:48:04 +0000 Subject: [PATCH 618/751] chore: Fix codecov upload (#3440) --- .github/workflows/tests.yml | 69 ++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 945c07d2956..b19e20f0954 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,10 +5,10 @@ concurrency: on: push: branches: - - master + - master pull_request: branches: - - master + - master name: tests env: @@ -19,6 +19,9 @@ permissions: jobs: test: + permissions: + contents: read + id-token: write defaults: run: shell: bash @@ -39,38 +42,40 @@ jobs: runs-on: ${{ matrix.platform }} steps: - - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 - with: - go-version: ${{ matrix.go-version }} - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 + with: + go-version: ${{ matrix.go-version }} + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - # Get values for cache paths to be used in later steps - - id: cache-paths - run: | - echo "go-cache=$(go env GOCACHE)" >> $GITHUB_OUTPUT - echo "go-mod-cache=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT + # Get values for cache paths to be used in later steps + - id: cache-paths + run: | + echo "go-cache=$(go env GOCACHE)" >> $GITHUB_OUTPUT + echo "go-mod-cache=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT - - name: Cache go modules - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 - with: - path: | - ${{ steps.cache-paths.outputs.go-cache }} - ${{ steps.cache-paths.outputs.go-mod-cache }} - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ runner.os }}-go- + - name: Cache go modules + uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 + with: + path: | + ${{ steps.cache-paths.outputs.go-cache }} + ${{ steps.cache-paths.outputs.go-mod-cache }} + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ runner.os }}-go- - - name: Run go test - run: | - if [ -n "${{ matrix.update-coverage }}" ]; then - script/test.sh -race -covermode atomic -coverprofile coverage.txt ./... - exit - fi - script/test.sh -race -covermode atomic ./... + - name: Run go test + run: | + if [ -n "${{ matrix.update-coverage }}" ]; then + script/test.sh -race -covermode atomic -coverprofile coverage.txt ./... + exit + fi + script/test.sh -race -covermode atomic ./... - - name: Ensure integration tests build - # don't actually run tests since they hit live GitHub API - run: go test -v -tags=integration -run=^$ ./test/integration + - name: Ensure integration tests build + # don't actually run tests since they hit live GitHub API + run: go test -v -tags=integration -run=^$ ./test/integration - - name: Upload coverage to Codecov - if: ${{ matrix.update-coverage }} - uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 # v5.1.2 + - name: Upload coverage to Codecov + if: ${{ matrix.update-coverage }} + uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 # v5.1.2 + with: + use_oidc: true From 4510383b816a8f91dd13393d6358cf4443ebf500 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Mon, 20 Jan 2025 17:00:35 +0200 Subject: [PATCH 619/751] chore: Spell "unmarshal" consistently with one el (#3441) --- .golangci.yml | 21 +++++++++++++++++++++ github/code_scanning.go | 2 +- github/github.go | 2 +- github/pulls_reviewers_test.go | 2 +- github/repos_contents.go | 2 +- github/timestamp.go | 2 +- 6 files changed, 26 insertions(+), 5 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 3f81e7f73e1..288ba4b61d2 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -35,6 +35,27 @@ linters-settings: - G104 # int(os.Stdin.Fd()) - G115 + misspell: + locale: US + ignore-words: + - "analyses" # returned by the GitHub API + - "cancelled" # returned by the GitHub API + # extra words from https://go.dev//wiki/Spelling + extra-words: + - typo: "marshall" + correction: "marshal" + - typo: "marshalled" + correction: "marshaled" + - typo: "marshalling" + correction: "marshaling" + - typo: "unmarshall" + correction: "unmarshal" + - typo: "unmarshalling" + correction: "unmarshaling" + - typo: "unmarshalled" + correction: "unmarshaled" + - typo: "unmarshalling" + correction: "unmarshaling" perfsprint: errorf: true strconcat: false diff --git a/github/code_scanning.go b/github/code_scanning.go index a8fca98a92d..bd11f00ddba 100644 --- a/github/code_scanning.go +++ b/github/code_scanning.go @@ -391,7 +391,7 @@ func (s *CodeScanningService) UploadSarif(ctx context.Context, owner, repo strin return nil, nil, err } - // This will always return an error without unmarshalling the data + // This will always return an error without unmarshaling the data resp, err := s.client.Do(ctx, req, nil) // Even though there was an error, we still return the response // in case the caller wants to inspect it further. diff --git a/github/github.go b/github/github.go index 5fce6381c69..34ca4394fe2 100644 --- a/github/github.go +++ b/github/github.go @@ -1311,7 +1311,7 @@ func (r *RedirectionError) Is(target error) bool { return r.StatusCode == v.StatusCode && (r.Location == v.Location || // either both locations are nil or exactly the same pointer - r.Location != nil && v.Location != nil && r.Location.String() == v.Location.String()) // or they are both not nil and marshalled identically + r.Location != nil && v.Location != nil && r.Location.String() == v.Location.String()) // or they are both not nil and marshaled identically } // sanitizeURL redacts the client_secret parameter from the URL which may be diff --git a/github/pulls_reviewers_test.go b/github/pulls_reviewers_test.go index 53b8d521beb..cfc415ef82f 100644 --- a/github/pulls_reviewers_test.go +++ b/github/pulls_reviewers_test.go @@ -130,7 +130,7 @@ func TestRequestReviewers(t *testing.T) { fmt.Fprint(w, `{"number":1}`) }) - // This returns a PR, unmarshalling of which is tested elsewhere + // This returns a PR, unmarshaling of which is tested elsewhere ctx := context.Background() got, _, err := client.PullRequests.RequestReviewers(ctx, "o", "r", 1, ReviewersRequest{Reviewers: []string{"octocat", "googlebot"}, TeamReviewers: []string{"justice-league", "injustice-league"}}) if err != nil { diff --git a/github/repos_contents.go b/github/repos_contents.go index 383988bf296..013993e5be1 100644 --- a/github/repos_contents.go +++ b/github/repos_contents.go @@ -254,7 +254,7 @@ func (s *RepositoriesService) GetContents(ctx context.Context, owner, repo, path return nil, directoryContent, resp, nil } - return nil, nil, resp, fmt.Errorf("unmarshalling failed for both file and directory content: %s and %s", fileUnmarshalError, directoryUnmarshalError) + return nil, nil, resp, fmt.Errorf("unmarshaling failed for both file and directory content: %s and %s", fileUnmarshalError, directoryUnmarshalError) } // CreateFile creates a new file in a repository at the given path and returns diff --git a/github/timestamp.go b/github/timestamp.go index dc1045cf742..71660193bb3 100644 --- a/github/timestamp.go +++ b/github/timestamp.go @@ -10,7 +10,7 @@ import ( "time" ) -// Timestamp represents a time that can be unmarshalled from a JSON string +// Timestamp represents a time that can be unmarshaled from a JSON string // formatted as either an RFC3339 or Unix timestamp. This is necessary for some // fields since the GitHub API is inconsistent in how it represents times. All // exported methods of time.Time can be called on Timestamp. From eb92cca97b2bc052b9fa3a64a1ee2401b04ff7cc Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Mon, 20 Jan 2025 18:31:52 +0200 Subject: [PATCH 620/751] fix: Typos in func parameter, vars, error, and comments (#3442) --- example/verifyartifact/main.go | 2 +- github/github.go | 2 +- github/repos_deployments_test.go | 6 +++--- github/teams_discussion_comments.go | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/example/verifyartifact/main.go b/example/verifyartifact/main.go index 7409bade079..9d85142c03b 100644 --- a/example/verifyartifact/main.go +++ b/example/verifyartifact/main.go @@ -169,7 +169,7 @@ func getPolicyBuilder() (*verify.PolicyBuilder, error) { return nil, err } - // Set up the articaft policy + // Set up the artifact policy artifactDigestBytes, err := hex.DecodeString(*artifactDigest) if err != nil { return nil, err diff --git a/github/github.go b/github/github.go index 34ca4394fe2..3d379774e61 100644 --- a/github/github.go +++ b/github/github.go @@ -987,7 +987,7 @@ func (c *Client) bareDoUntilFound(ctx context.Context, req *http.Request, maxRed if maxRedirects <= 0 && rerr.StatusCode == http.StatusMovedPermanently { return nil, response, fmt.Errorf("reached the maximum amount of redirections: %w", err) } - return nil, response, fmt.Errorf("unexepected redirection response: %w", err) + return nil, response, fmt.Errorf("unexpected redirection response: %w", err) } } diff --git a/github/repos_deployments_test.go b/github/repos_deployments_test.go index cc451e34236..83e027a2e03 100644 --- a/github/repos_deployments_test.go +++ b/github/repos_deployments_test.go @@ -186,14 +186,14 @@ func TestRepositoriesService_ListDeploymentStatuses(t *testing.T) { opt := &ListOptions{Page: 2} ctx := context.Background() - statutses, _, err := client.Repositories.ListDeploymentStatuses(ctx, "o", "r", 1, opt) + statuses, _, err := client.Repositories.ListDeploymentStatuses(ctx, "o", "r", 1, opt) if err != nil { t.Errorf("Repositories.ListDeploymentStatuses returned error: %v", err) } want := []*DeploymentStatus{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}} - if !cmp.Equal(statutses, want) { - t.Errorf("Repositories.ListDeploymentStatuses returned %+v, want %+v", statutses, want) + if !cmp.Equal(statuses, want) { + t.Errorf("Repositories.ListDeploymentStatuses returned %+v, want %+v", statuses, want) } const methodName = "ListDeploymentStatuses" diff --git a/github/teams_discussion_comments.go b/github/teams_discussion_comments.go index eba6fdf46a4..70bcbbc95bf 100644 --- a/github/teams_discussion_comments.go +++ b/github/teams_discussion_comments.go @@ -167,8 +167,8 @@ func (s *TeamsService) CreateCommentByID(ctx context.Context, orgID, teamID int6 // GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment // //meta:operation POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments -func (s *TeamsService) CreateCommentBySlug(ctx context.Context, org, slug string, discsusionNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { - u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments", org, slug, discsusionNumber) +func (s *TeamsService) CreateCommentBySlug(ctx context.Context, org, slug string, discussionNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { + u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments", org, slug, discussionNumber) req, err := s.client.NewRequest("POST", u, comment) if err != nil { return nil, nil, err From c44e9dd4b0f827fd37e67db8957b38118e93b49e Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Mon, 20 Jan 2025 20:38:01 +0200 Subject: [PATCH 621/751] fix!: Typo in field names in the CheckSuite struct (#3444) BREAKING CHANGE: `Rerequstable`=>`Rerequestable`, `RunsRerequstable`=>`RunsRerequestable` --- github/checks.go | 4 ++-- github/checks_test.go | 4 ++-- github/github-accessors.go | 16 ++++++++-------- github/github-accessors_test.go | 20 ++++++++++---------- github/github-stringify_test.go | 6 +++--- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/github/checks.go b/github/checks.go index 711be207c2b..2f0f65bf92a 100644 --- a/github/checks.go +++ b/github/checks.go @@ -87,8 +87,8 @@ type CheckSuite struct { // The following fields are only populated by Webhook events. HeadCommit *Commit `json:"head_commit,omitempty"` LatestCheckRunsCount *int64 `json:"latest_check_runs_count,omitempty"` - Rerequstable *bool `json:"rerequestable,omitempty"` - RunsRerequstable *bool `json:"runs_rerequestable,omitempty"` + Rerequestable *bool `json:"rerequestable,omitempty"` + RunsRerequestable *bool `json:"runs_rerequestable,omitempty"` } func (c CheckRun) String() string { diff --git a/github/checks_test.go b/github/checks_test.go index ba3b082017f..fac30ec2871 100644 --- a/github/checks_test.go +++ b/github/checks_test.go @@ -891,8 +891,8 @@ func Test_CheckSuiteMarshal(t *testing.T) { SHA: Ptr("s"), }, LatestCheckRunsCount: Ptr(int64(1)), - Rerequstable: Ptr(true), - RunsRerequstable: Ptr(true), + Rerequestable: Ptr(true), + RunsRerequestable: Ptr(true), } w := fmt.Sprintf(`{ diff --git a/github/github-accessors.go b/github/github-accessors.go index ec7ac4f7b20..1e4921c57cb 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -2358,20 +2358,20 @@ func (c *CheckSuite) GetRepository() *Repository { return c.Repository } -// GetRerequstable returns the Rerequstable field if it's non-nil, zero value otherwise. -func (c *CheckSuite) GetRerequstable() bool { - if c == nil || c.Rerequstable == nil { +// GetRerequestable returns the Rerequestable field if it's non-nil, zero value otherwise. +func (c *CheckSuite) GetRerequestable() bool { + if c == nil || c.Rerequestable == nil { return false } - return *c.Rerequstable + return *c.Rerequestable } -// GetRunsRerequstable returns the RunsRerequstable field if it's non-nil, zero value otherwise. -func (c *CheckSuite) GetRunsRerequstable() bool { - if c == nil || c.RunsRerequstable == nil { +// GetRunsRerequestable returns the RunsRerequestable field if it's non-nil, zero value otherwise. +func (c *CheckSuite) GetRunsRerequestable() bool { + if c == nil || c.RunsRerequestable == nil { return false } - return *c.RunsRerequstable + return *c.RunsRerequestable } // GetStatus returns the Status field if it's non-nil, zero value otherwise. diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index dca95aba16e..aa5be66e5e1 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -3073,26 +3073,26 @@ func TestCheckSuite_GetRepository(tt *testing.T) { c.GetRepository() } -func TestCheckSuite_GetRerequstable(tt *testing.T) { +func TestCheckSuite_GetRerequestable(tt *testing.T) { tt.Parallel() var zeroValue bool - c := &CheckSuite{Rerequstable: &zeroValue} - c.GetRerequstable() + c := &CheckSuite{Rerequestable: &zeroValue} + c.GetRerequestable() c = &CheckSuite{} - c.GetRerequstable() + c.GetRerequestable() c = nil - c.GetRerequstable() + c.GetRerequestable() } -func TestCheckSuite_GetRunsRerequstable(tt *testing.T) { +func TestCheckSuite_GetRunsRerequestable(tt *testing.T) { tt.Parallel() var zeroValue bool - c := &CheckSuite{RunsRerequstable: &zeroValue} - c.GetRunsRerequstable() + c := &CheckSuite{RunsRerequestable: &zeroValue} + c.GetRunsRerequestable() c = &CheckSuite{} - c.GetRunsRerequstable() + c.GetRunsRerequestable() c = nil - c.GetRunsRerequstable() + c.GetRunsRerequestable() } func TestCheckSuite_GetStatus(tt *testing.T) { diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index 881e279f942..53283289f7d 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -207,10 +207,10 @@ func TestCheckSuite_String(t *testing.T) { Repository: &Repository{}, HeadCommit: &Commit{}, LatestCheckRunsCount: Ptr(int64(0)), - Rerequstable: Ptr(false), - RunsRerequstable: Ptr(false), + Rerequestable: Ptr(false), + RunsRerequestable: Ptr(false), } - want := `github.CheckSuite{ID:0, NodeID:"", HeadBranch:"", HeadSHA:"", URL:"", BeforeSHA:"", AfterSHA:"", Status:"", Conclusion:"", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, App:github.App{}, Repository:github.Repository{}, HeadCommit:github.Commit{}, LatestCheckRunsCount:0, Rerequstable:false, RunsRerequstable:false}` + want := `github.CheckSuite{ID:0, NodeID:"", HeadBranch:"", HeadSHA:"", URL:"", BeforeSHA:"", AfterSHA:"", Status:"", Conclusion:"", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, App:github.App{}, Repository:github.Repository{}, HeadCommit:github.Commit{}, LatestCheckRunsCount:0, Rerequestable:false, RunsRerequestable:false}` if got := v.String(); got != want { t.Errorf("CheckSuite.String = %v, want %v", got, want) } From b8c22534c3d00f4ad42d77ce36f65be3ebcb73e9 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Mon, 20 Jan 2025 21:25:31 +0200 Subject: [PATCH 622/751] fix!: Typo in field names in the PullStats struct (#3445) BREAKING CHANGE: `MergablePulls`=>`MergeablePulls`, `UnmergablePulls`=>`UnmergeablePulls` --- github/admin_stats.go | 10 +++++----- github/admin_stats_test.go | 28 ++++++++++++++-------------- github/github-accessors.go | 16 ++++++++-------- github/github-accessors_test.go | 20 ++++++++++---------- github/github-stringify_test.go | 10 +++++----- 5 files changed, 42 insertions(+), 42 deletions(-) diff --git a/github/admin_stats.go b/github/admin_stats.go index f012d7984c0..a6e406beca6 100644 --- a/github/admin_stats.go +++ b/github/admin_stats.go @@ -118,13 +118,13 @@ func (s GistStats) String() string { return Stringify(s) } -// PullStats represents the number of total, merged, mergable and unmergeable +// PullStats represents the number of total, merged, mergeable and unmergeable // pull-requests. type PullStats struct { - TotalPulls *int `json:"total_pulls,omitempty"` - MergedPulls *int `json:"merged_pulls,omitempty"` - MergablePulls *int `json:"mergeable_pulls,omitempty"` - UnmergablePulls *int `json:"unmergeable_pulls,omitempty"` + TotalPulls *int `json:"total_pulls,omitempty"` + MergedPulls *int `json:"merged_pulls,omitempty"` + MergeablePulls *int `json:"mergeable_pulls,omitempty"` + UnmergeablePulls *int `json:"unmergeable_pulls,omitempty"` } func (s PullStats) String() string { diff --git a/github/admin_stats_test.go b/github/admin_stats_test.go index 02b5d83bfcb..63e428bb5fd 100644 --- a/github/admin_stats_test.go +++ b/github/admin_stats_test.go @@ -98,7 +98,7 @@ func TestAdminService_GetAdminStats(t *testing.T) { func TestAdminService_Stringify(t *testing.T) { t.Parallel() - want := "github.AdminStats{Issues:github.IssueStats{TotalIssues:179, OpenIssues:83, ClosedIssues:96}, Hooks:github.HookStats{TotalHooks:27, ActiveHooks:23, InactiveHooks:4}, Milestones:github.MilestoneStats{TotalMilestones:7, OpenMilestones:6, ClosedMilestones:1}, Orgs:github.OrgStats{TotalOrgs:33, DisabledOrgs:0, TotalTeams:60, TotalTeamMembers:314}, Comments:github.CommentStats{TotalCommitComments:6, TotalGistComments:28, TotalIssueComments:366, TotalPullRequestComments:30}, Pages:github.PageStats{TotalPages:36}, Users:github.UserStats{TotalUsers:254, AdminUsers:45, SuspendedUsers:21}, Gists:github.GistStats{TotalGists:178, PrivateGists:151, PublicGists:25}, Pulls:github.PullStats{TotalPulls:86, MergedPulls:60, MergablePulls:21, UnmergablePulls:3}, Repos:github.RepoStats{TotalRepos:212, RootRepos:194, ForkRepos:18, OrgRepos:51, TotalPushes:3082, TotalWikis:15}}" + want := "github.AdminStats{Issues:github.IssueStats{TotalIssues:179, OpenIssues:83, ClosedIssues:96}, Hooks:github.HookStats{TotalHooks:27, ActiveHooks:23, InactiveHooks:4}, Milestones:github.MilestoneStats{TotalMilestones:7, OpenMilestones:6, ClosedMilestones:1}, Orgs:github.OrgStats{TotalOrgs:33, DisabledOrgs:0, TotalTeams:60, TotalTeamMembers:314}, Comments:github.CommentStats{TotalCommitComments:6, TotalGistComments:28, TotalIssueComments:366, TotalPullRequestComments:30}, Pages:github.PageStats{TotalPages:36}, Users:github.UserStats{TotalUsers:254, AdminUsers:45, SuspendedUsers:21}, Gists:github.GistStats{TotalGists:178, PrivateGists:151, PublicGists:25}, Pulls:github.PullStats{TotalPulls:86, MergedPulls:60, MergeablePulls:21, UnmergeablePulls:3}, Repos:github.RepoStats{TotalRepos:212, RootRepos:194, ForkRepos:18, OrgRepos:51, TotalPushes:3082, TotalWikis:15}}" if got := testAdminStats.String(); got != want { t.Errorf("testAdminStats.String = %q, want %q", got, want) } @@ -143,7 +143,7 @@ func TestAdminService_Stringify(t *testing.T) { t.Errorf("testAdminStats.Gists.String = %q, want %q", got, want) } - want = "github.PullStats{TotalPulls:86, MergedPulls:60, MergablePulls:21, UnmergablePulls:3}" + want = "github.PullStats{TotalPulls:86, MergedPulls:60, MergeablePulls:21, UnmergeablePulls:3}" if got := testAdminStats.Pulls.String(); got != want { t.Errorf("testAdminStats.Pulls.String = %q, want %q", got, want) } @@ -183,10 +183,10 @@ var testAdminStats = &AdminStats{ SuspendedUsers: Ptr(21), }, Pulls: &PullStats{ - TotalPulls: Ptr(86), - MergedPulls: Ptr(60), - MergablePulls: Ptr(21), - UnmergablePulls: Ptr(3), + TotalPulls: Ptr(86), + MergedPulls: Ptr(60), + MergeablePulls: Ptr(21), + UnmergeablePulls: Ptr(3), }, Issues: &IssueStats{ TotalIssues: Ptr(179), @@ -368,10 +368,10 @@ func TestPullStats_Marshal(t *testing.T) { testJSONMarshal(t, &PullStats{}, "{}") u := &PullStats{ - TotalPulls: Ptr(1), - MergedPulls: Ptr(1), - MergablePulls: Ptr(1), - UnmergablePulls: Ptr(1), + TotalPulls: Ptr(1), + MergedPulls: Ptr(1), + MergeablePulls: Ptr(1), + UnmergeablePulls: Ptr(1), } want := `{ @@ -442,10 +442,10 @@ func TestAdminStats_Marshal(t *testing.T) { SuspendedUsers: Ptr(21), }, Pulls: &PullStats{ - TotalPulls: Ptr(86), - MergedPulls: Ptr(60), - MergablePulls: Ptr(21), - UnmergablePulls: Ptr(3), + TotalPulls: Ptr(86), + MergedPulls: Ptr(60), + MergeablePulls: Ptr(21), + UnmergeablePulls: Ptr(3), }, Issues: &IssueStats{ TotalIssues: Ptr(179), diff --git a/github/github-accessors.go b/github/github-accessors.go index 1e4921c57cb..28d44ce35e5 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -17902,12 +17902,12 @@ func (p *PullRequestThread) GetNodeID() string { return *p.NodeID } -// GetMergablePulls returns the MergablePulls field if it's non-nil, zero value otherwise. -func (p *PullStats) GetMergablePulls() int { - if p == nil || p.MergablePulls == nil { +// GetMergeablePulls returns the MergeablePulls field if it's non-nil, zero value otherwise. +func (p *PullStats) GetMergeablePulls() int { + if p == nil || p.MergeablePulls == nil { return 0 } - return *p.MergablePulls + return *p.MergeablePulls } // GetMergedPulls returns the MergedPulls field if it's non-nil, zero value otherwise. @@ -17926,12 +17926,12 @@ func (p *PullStats) GetTotalPulls() int { return *p.TotalPulls } -// GetUnmergablePulls returns the UnmergablePulls field if it's non-nil, zero value otherwise. -func (p *PullStats) GetUnmergablePulls() int { - if p == nil || p.UnmergablePulls == nil { +// GetUnmergeablePulls returns the UnmergeablePulls field if it's non-nil, zero value otherwise. +func (p *PullStats) GetUnmergeablePulls() int { + if p == nil || p.UnmergeablePulls == nil { return 0 } - return *p.UnmergablePulls + return *p.UnmergeablePulls } // GetCommits returns the Commits field if it's non-nil, zero value otherwise. diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index aa5be66e5e1..db3da5ba72d 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -22964,15 +22964,15 @@ func TestPullRequestThread_GetNodeID(tt *testing.T) { p.GetNodeID() } -func TestPullStats_GetMergablePulls(tt *testing.T) { +func TestPullStats_GetMergeablePulls(tt *testing.T) { tt.Parallel() var zeroValue int - p := &PullStats{MergablePulls: &zeroValue} - p.GetMergablePulls() + p := &PullStats{MergeablePulls: &zeroValue} + p.GetMergeablePulls() p = &PullStats{} - p.GetMergablePulls() + p.GetMergeablePulls() p = nil - p.GetMergablePulls() + p.GetMergeablePulls() } func TestPullStats_GetMergedPulls(tt *testing.T) { @@ -22997,15 +22997,15 @@ func TestPullStats_GetTotalPulls(tt *testing.T) { p.GetTotalPulls() } -func TestPullStats_GetUnmergablePulls(tt *testing.T) { +func TestPullStats_GetUnmergeablePulls(tt *testing.T) { tt.Parallel() var zeroValue int - p := &PullStats{UnmergablePulls: &zeroValue} - p.GetUnmergablePulls() + p := &PullStats{UnmergeablePulls: &zeroValue} + p.GetUnmergeablePulls() p = &PullStats{} - p.GetUnmergablePulls() + p.GetUnmergeablePulls() p = nil - p.GetUnmergablePulls() + p.GetUnmergeablePulls() } func TestPunchCard_GetCommits(tt *testing.T) { diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index 53283289f7d..e20497355e2 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -1454,12 +1454,12 @@ func TestPullRequestThread_String(t *testing.T) { func TestPullStats_String(t *testing.T) { t.Parallel() v := PullStats{ - TotalPulls: Ptr(0), - MergedPulls: Ptr(0), - MergablePulls: Ptr(0), - UnmergablePulls: Ptr(0), + TotalPulls: Ptr(0), + MergedPulls: Ptr(0), + MergeablePulls: Ptr(0), + UnmergeablePulls: Ptr(0), } - want := `github.PullStats{TotalPulls:0, MergedPulls:0, MergablePulls:0, UnmergablePulls:0}` + want := `github.PullStats{TotalPulls:0, MergedPulls:0, MergeablePulls:0, UnmergeablePulls:0}` if got := v.String(); got != want { t.Errorf("PullStats.String = %v, want %v", got, want) } From 1875fe0f3a7f5d3d1e4afd4e30ed05ba7a49059d Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Tue, 21 Jan 2025 16:04:29 +0200 Subject: [PATCH 623/751] refactor!: Do not capitalize error strings (#3446) BREAKING CHANGE: Some error strings are slightly modified - please do not rely on error text in general. --- .golangci.yml | 2 ++ example/codespaces/newreposecretwithxcrypto/main.go | 4 ++-- example/codespaces/newusersecretwithxcrypto/main.go | 6 +++--- example/newreposecretwithlibsodium/main.go | 2 +- example/newreposecretwithxcrypto/main.go | 2 +- github/github.go | 6 +++--- github/github_test.go | 8 ++++---- github/repos_rules.go | 2 +- 8 files changed, 17 insertions(+), 15 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 288ba4b61d2..eae5a3bdd6a 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -60,6 +60,8 @@ linters-settings: errorf: true strconcat: false revive: + # Set below 0.8 to enable error-strings rule. + confidence: 0.6 rules: - name: blank-imports - name: bool-literal-in-expr diff --git a/example/codespaces/newreposecretwithxcrypto/main.go b/example/codespaces/newreposecretwithxcrypto/main.go index 485e5b4db26..98f02604377 100644 --- a/example/codespaces/newreposecretwithxcrypto/main.go +++ b/example/codespaces/newreposecretwithxcrypto/main.go @@ -134,7 +134,7 @@ func addRepoSecret(ctx context.Context, client *github.Client, owner string, rep } if _, err := client.Codespaces.CreateOrUpdateRepoSecret(ctx, owner, repo, encryptedSecret); err != nil { - return fmt.Errorf("Codespaces.CreateOrUpdateRepoSecret returned error: %v", err) + return fmt.Errorf("client.Codespaces.CreateOrUpdateRepoSecret returned error: %v", err) } return nil @@ -143,7 +143,7 @@ func addRepoSecret(ctx context.Context, client *github.Client, owner string, rep func encryptSecretWithPublicKey(publicKey *github.PublicKey, secretName string, secretValue string) (*github.EncryptedSecret, error) { decodedPublicKey, err := base64.StdEncoding.DecodeString(publicKey.GetKey()) if err != nil { - return nil, fmt.Errorf("base64.StdEncoding.DecodeString was unable to decode public key: %v", err) + return nil, fmt.Errorf("unable to decode public key: %v", err) } var boxKey [32]byte diff --git a/example/codespaces/newusersecretwithxcrypto/main.go b/example/codespaces/newusersecretwithxcrypto/main.go index b20fc3af888..63cd5a572b9 100644 --- a/example/codespaces/newusersecretwithxcrypto/main.go +++ b/example/codespaces/newusersecretwithxcrypto/main.go @@ -129,17 +129,17 @@ func addUserSecret(ctx context.Context, client *github.Client, secretName, secre } if _, err := client.Codespaces.CreateOrUpdateUserSecret(ctx, encryptedSecret); err != nil { - return fmt.Errorf("Codespaces.CreateOrUpdateUserSecret returned error: %v", err) + return fmt.Errorf("client.Codespaces.CreateOrUpdateUserSecret returned error: %v", err) } if owner != "" && repo != "" { r, _, err := client.Repositories.Get(ctx, owner, repo) if err != nil { - return fmt.Errorf("Repositories.Get returned error: %v", err) + return fmt.Errorf("client.Repositories.Get returned error: %v", err) } _, err = client.Codespaces.AddSelectedRepoToUserSecret(ctx, encryptedSecret.Name, r) if err != nil { - return fmt.Errorf("Codespaces.AddSelectedRepoToUserSecret returned error: %v", err) + return fmt.Errorf("client.Codespaces.AddSelectedRepoToUserSecret returned error: %v", err) } fmt.Printf("Added secret %q to %v/%v\n", secretName, owner, repo) } diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index 9aa14cb5ae6..cae03bb72bc 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -130,7 +130,7 @@ func addRepoSecret(ctx context.Context, client *github.Client, owner string, rep } if _, err := client.Actions.CreateOrUpdateRepoSecret(ctx, owner, repo, encryptedSecret); err != nil { - return fmt.Errorf("Actions.CreateOrUpdateRepoSecret returned error: %v", err) + return fmt.Errorf("client.Actions.CreateOrUpdateRepoSecret returned error: %v", err) } return nil diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index 250b8eddd5b..cf42b1c4b0f 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -134,7 +134,7 @@ func addRepoSecret(ctx context.Context, client *github.Client, owner string, rep } if _, err := client.Actions.CreateOrUpdateRepoSecret(ctx, owner, repo, encryptedSecret); err != nil { - return fmt.Errorf("Actions.CreateOrUpdateRepoSecret returned error: %v", err) + return fmt.Errorf("client.Actions.CreateOrUpdateRepoSecret returned error: %v", err) } return nil diff --git a/github/github.go b/github/github.go index 3d379774e61..60e8b86c40f 100644 --- a/github/github.go +++ b/github/github.go @@ -519,7 +519,7 @@ func WithVersion(version string) RequestOption { // request body. func (c *Client) NewRequest(method, urlStr string, body interface{}, opts ...RequestOption) (*http.Request, error) { if !strings.HasSuffix(c.BaseURL.Path, "/") { - return nil, fmt.Errorf("BaseURL must have a trailing slash, but %q does not", c.BaseURL) + return nil, fmt.Errorf("baseURL must have a trailing slash, but %q does not", c.BaseURL) } u, err := c.BaseURL.Parse(urlStr) @@ -565,7 +565,7 @@ func (c *Client) NewRequest(method, urlStr string, body interface{}, opts ...Req // Body is sent with Content-Type: application/x-www-form-urlencoded. func (c *Client) NewFormRequest(urlStr string, body io.Reader, opts ...RequestOption) (*http.Request, error) { if !strings.HasSuffix(c.BaseURL.Path, "/") { - return nil, fmt.Errorf("BaseURL must have a trailing slash, but %q does not", c.BaseURL) + return nil, fmt.Errorf("baseURL must have a trailing slash, but %q does not", c.BaseURL) } u, err := c.BaseURL.Parse(urlStr) @@ -597,7 +597,7 @@ func (c *Client) NewFormRequest(urlStr string, body io.Reader, opts ...RequestOp // Relative URLs should always be specified without a preceding slash. func (c *Client) NewUploadRequest(urlStr string, reader io.Reader, size int64, mediaType string, opts ...RequestOption) (*http.Request, error) { if !strings.HasSuffix(c.UploadURL.Path, "/") { - return nil, fmt.Errorf("UploadURL must have a trailing slash, but %q does not", c.UploadURL) + return nil, fmt.Errorf("uploadURL must have a trailing slash, but %q does not", c.UploadURL) } u, err := c.UploadURL.Parse(urlStr) if err != nil { diff --git a/github/github_test.go b/github/github_test.go index b3dd0cf10be..7116636b691 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -2180,7 +2180,7 @@ func TestErrorResponse_Is(t *testing.T) { }, "errors have different types": { wantSame: false, - otherError: errors.New("Github"), + otherError: errors.New("github"), }, } @@ -2250,7 +2250,7 @@ func TestRateLimitError_Is(t *testing.T) { "errors have different types": { wantSame: false, err: err, - otherError: errors.New("Github"), + otherError: errors.New("github"), }, } @@ -2337,7 +2337,7 @@ func TestAbuseRateLimitError_Is(t *testing.T) { "errors have different types": { wantSame: false, err: err, - otherError: errors.New("Github"), + otherError: errors.New("github"), }, } @@ -2369,7 +2369,7 @@ func TestAcceptedError_Is(t *testing.T) { }, "errors have different types": { wantSame: false, - otherError: errors.New("Github"), + otherError: errors.New("github"), }, } diff --git a/github/repos_rules.go b/github/repos_rules.go index 60e9739cdf7..571a789fef4 100644 --- a/github/repos_rules.go +++ b/github/repos_rules.go @@ -567,7 +567,7 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { default: r.Type = "" r.Parameters = nil - return fmt.Errorf("RepositoryRule.Type %q is not yet implemented, unable to unmarshal (%#v)", repositoryRule.Type, repositoryRule) + return fmt.Errorf("repositoryRule.Type %q is not yet implemented, unable to unmarshal (%#v)", repositoryRule.Type, repositoryRule) } return nil From daaa51aa3732d7cec2de604bea5b75086fbb81f9 Mon Sep 17 00:00:00 2001 From: Krisztian Banhidy Date: Tue, 21 Jan 2025 20:19:39 +0300 Subject: [PATCH 624/751] feat: Add manage_ghes endpoints introduced in 3.15 (#3433) --- github/enterprise_manage_ghes.go | 163 ++ github/enterprise_manage_ghes_config.go | 516 ++++ github/enterprise_manage_ghes_config_test.go | 729 +++++ github/enterprise_manage_ghes_maintenance.go | 94 + ...enterprise_manage_ghes_maintenance_test.go | 129 + github/enterprise_manage_ghes_ssh.go | 99 + github/enterprise_manage_ghes_ssh_test.go | 134 + github/enterprise_manage_ghes_test.go | 213 ++ github/github-accessors.go | 1618 ++++++++++- github/github-accessors_test.go | 2398 ++++++++++++++++- 10 files changed, 5920 insertions(+), 173 deletions(-) create mode 100644 github/enterprise_manage_ghes.go create mode 100644 github/enterprise_manage_ghes_config.go create mode 100644 github/enterprise_manage_ghes_config_test.go create mode 100644 github/enterprise_manage_ghes_maintenance.go create mode 100644 github/enterprise_manage_ghes_maintenance_test.go create mode 100644 github/enterprise_manage_ghes_ssh.go create mode 100644 github/enterprise_manage_ghes_ssh_test.go create mode 100644 github/enterprise_manage_ghes_test.go diff --git a/github/enterprise_manage_ghes.go b/github/enterprise_manage_ghes.go new file mode 100644 index 00000000000..e14836eb02e --- /dev/null +++ b/github/enterprise_manage_ghes.go @@ -0,0 +1,163 @@ +// Copyright 2025 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" +) + +// NodeQueryOptions specifies the optional parameters to the EnterpriseService +// Node management APIs. +type NodeQueryOptions struct { + // UUID filters issues based on the node UUID. + UUID *string `url:"uuid,omitempty"` + + // ClusterRoles filters the cluster roles from the cluster configuration file. + ClusterRoles *string `url:"cluster_roles,omitempty"` +} + +// ClusterStatus represents a response from the ClusterStatus and ReplicationStatus methods. +type ClusterStatus struct { + Status *string `json:"status,omitempty"` + Nodes []*ClusterStatusNode `json:"nodes"` +} + +// ClusterStatusNode represents the status of a cluster node. +type ClusterStatusNode struct { + Hostname *string `json:"hostname,omitempty"` + Status *string `json:"status,omitempty"` + Services []*ClusterStatusNodeServiceItem `json:"services"` +} + +// ClusterStatusNodeServiceItem represents the status of a service running on a cluster node. +type ClusterStatusNodeServiceItem struct { + Status *string `json:"status,omitempty"` + Name *string `json:"name,omitempty"` + Details *string `json:"details,omitempty"` +} + +// SystemRequirements represents a response from the CheckSystemRequirements method. +type SystemRequirements struct { + Status *string `json:"status,omitempty"` + Nodes []*SystemRequirementsNode `json:"nodes"` +} + +// SystemRequirementsNode represents the status of a system node. +type SystemRequirementsNode struct { + Hostname *string `json:"hostname,omitempty"` + Status *string `json:"status,omitempty"` + RolesStatus []*SystemRequirementsNodeRoleStatus `json:"roles_status"` +} + +// SystemRequirementsNodeRoleStatus represents the status of a role on a system node. +type SystemRequirementsNodeRoleStatus struct { + Status *string `json:"status,omitempty"` + Role *string `json:"role,omitempty"` +} + +// NodeReleaseVersion represents a response from the GetNodeReleaseVersions method. +type NodeReleaseVersion struct { + Hostname *string `json:"hostname,omitempty"` + Version *ReleaseVersion `json:"version"` +} + +// ReleaseVersion holds the release version information of the node. +type ReleaseVersion struct { + Version *string `json:"version,omitempty"` + Platform *string `json:"platform,omitempty"` + BuildID *string `json:"build_id,omitempty"` + BuildDate *string `json:"build_date,omitempty"` +} + +// CheckSystemRequirements checks if GHES system nodes meet the system requirements. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-system-requirement-check-results-for-configured-cluster-nodes +// +//meta:operation GET /manage/v1/checks/system-requirements +func (s *EnterpriseService) CheckSystemRequirements(ctx context.Context) (*SystemRequirements, *Response, error) { + u := "manage/v1/checks/system-requirements" + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + systemRequirements := new(SystemRequirements) + resp, err := s.client.Do(ctx, req, systemRequirements) + if err != nil { + return nil, resp, err + } + + return systemRequirements, resp, nil +} + +// ClusterStatus gets the status of all services running on each cluster node. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-cluster-nodes +// +//meta:operation GET /manage/v1/cluster/status +func (s *EnterpriseService) ClusterStatus(ctx context.Context) (*ClusterStatus, *Response, error) { + u := "manage/v1/cluster/status" + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + clusterStatus := new(ClusterStatus) + resp, err := s.client.Do(ctx, req, clusterStatus) + if err != nil { + return nil, resp, err + } + + return clusterStatus, resp, nil +} + +// ReplicationStatus gets the status of all services running on each replica node. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-replica-nodes +// +//meta:operation GET /manage/v1/replication/status +func (s *EnterpriseService) ReplicationStatus(ctx context.Context, opts *NodeQueryOptions) (*ClusterStatus, *Response, error) { + u, err := addOptions("manage/v1/replication/status", opts) + if err != nil { + return nil, nil, err + } + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + status := new(ClusterStatus) + resp, err := s.client.Do(ctx, req, status) + if err != nil { + return nil, resp, err + } + + return status, resp, nil +} + +// GetNodeReleaseVersions gets the version information deployed to each node. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-all-ghes-release-versions-for-all-nodes +// +//meta:operation GET /manage/v1/version +func (s *EnterpriseService) GetNodeReleaseVersions(ctx context.Context, opts *NodeQueryOptions) ([]*NodeReleaseVersion, *Response, error) { + u, err := addOptions("manage/v1/version", opts) + if err != nil { + return nil, nil, err + } + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var releaseVersions []*NodeReleaseVersion + resp, err := s.client.Do(ctx, req, &releaseVersions) + if err != nil { + return nil, resp, err + } + + return releaseVersions, resp, nil +} diff --git a/github/enterprise_manage_ghes_config.go b/github/enterprise_manage_ghes_config.go new file mode 100644 index 00000000000..10fb8590e4f --- /dev/null +++ b/github/enterprise_manage_ghes_config.go @@ -0,0 +1,516 @@ +// Copyright 2025 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" + "errors" +) + +// ConfigApplyOptions is a struct to hold the options for the ConfigApply API and the response. +type ConfigApplyOptions struct { + // RunID is the ID of the run to get the status of. If empty a random one will be generated. + RunID *string `json:"run_id,omitempty"` +} + +// ConfigApplyStatus is a struct to hold the response from the ConfigApply API. +type ConfigApplyStatus struct { + Running *bool `json:"running,omitempty"` + Successful *bool `json:"successful,omitempty"` + Nodes []*ConfigApplyStatusNode `json:"nodes"` +} + +// ConfigApplyStatusNode is a struct to hold the response from the ConfigApply API. +type ConfigApplyStatusNode struct { + Hostname *string `json:"hostname,omitempty"` + Running *bool `json:"running,omitempty"` + Successful *bool `json:"successful,omitempty"` + RunID *string `json:"run_id,omitempty"` +} + +// ConfigApplyEventsOptions is used to enable pagination. +type ConfigApplyEventsOptions struct { + LastRequestID *string `url:"last_request_id,omitempty"` +} + +// ConfigApplyEvents is a struct to hold the response from the ConfigApplyEvents API. +type ConfigApplyEvents struct { + Nodes []*ConfigApplyEventsNode `json:"nodes"` +} + +// ConfigApplyEventsNode is a struct to hold the response from the ConfigApplyEvents API. +type ConfigApplyEventsNode struct { + Node *string `json:"node,omitempty"` + LastRequestID *string `json:"last_request_id,omitempty"` + Events []*ConfigApplyEventsNodeEvent `json:"events"` +} + +// ConfigApplyEventsNodeEvent is a struct to hold the response from the ConfigApplyEvents API. +type ConfigApplyEventsNodeEvent struct { + Timestamp *Timestamp `json:"timestamp,omitempty"` + SeverityText *string `json:"severity_text,omitempty"` + Body *string `json:"body,omitempty"` + EventName *string `json:"event_name,omitempty"` + Topology *string `json:"topology,omitempty"` + Hostname *string `json:"hostname,omitempty"` + ConfigRunID *string `json:"config_run_id,omitempty"` + TraceID *string `json:"trace_id,omitempty"` + SpanID *string `json:"span_id,omitempty"` + SpanParentID *int64 `json:"span_parent_id,omitempty"` + SpanDepth *int `json:"span_depth,omitempty"` +} + +// InitialConfigOptions is a struct to hold the options for the InitialConfig API. +type InitialConfigOptions struct { + License string `url:"license"` + Password string `url:"password"` +} + +// LicenseStatus is a struct to hold the response from the License API. +type LicenseStatus struct { + AdvancedSecurityEnabled *bool `json:"advancedSecurityEnabled,omitempty"` + AdvancedSecuritySeats *int `json:"advancedSecuritySeats,omitempty"` + ClusterSupport *bool `json:"clusterSupport,omitempty"` + Company *string `json:"company,omitempty"` + CroquetSupport *bool `json:"croquetSupport,omitempty"` + CustomTerms *bool `json:"customTerms,omitempty"` + Evaluation *bool `json:"evaluation,omitempty"` + ExpireAt *Timestamp `json:"expireAt,omitempty"` + InsightsEnabled *bool `json:"insightsEnabled,omitempty"` + InsightsExpireAt *Timestamp `json:"insightsExpireAt,omitempty"` + LearningLabEvaluationExpires *Timestamp `json:"learningLabEvaluationExpires,omitempty"` + LearningLabSeats *int `json:"learningLabSeats,omitempty"` + Perpetual *bool `json:"perpetual,omitempty"` + ReferenceNumber *string `json:"referenceNumber,omitempty"` + Seats *int `json:"seats,omitempty"` + SSHAllowed *bool `json:"sshAllowed,omitempty"` + SupportKey *string `json:"supportKey,omitempty"` + UnlimitedSeating *bool `json:"unlimitedSeating,omitempty"` +} + +// UploadLicenseOptions is a struct to hold the options for the UploadLicense API. +type UploadLicenseOptions struct { + License string `url:"license"` +} + +// LicenseCheck is a struct to hold the response from the LicenseStatus API. +type LicenseCheck struct { + Status *string `json:"status,omitempty"` +} + +// ConfigSettings is a struct to hold the response from the Settings API. +// There are many fields that link to other structs. +type ConfigSettings struct { + PrivateMode *bool `json:"private_mode,omitempty"` + PublicPages *bool `json:"public_pages,omitempty"` + SubdomainIsolation *bool `json:"subdomain_isolation,omitempty"` + SignupEnabled *bool `json:"signup_enabled,omitempty"` + GithubHostname *string `json:"github_hostname,omitempty"` + IdenticonsHost *string `json:"identicons_host,omitempty"` + HTTPProxy *string `json:"http_proxy,omitempty"` + AuthMode *string `json:"auth_mode,omitempty"` + ExpireSessions *bool `json:"expire_sessions,omitempty"` + AdminPassword *string `json:"admin_password,omitempty"` + ConfigurationID *int64 `json:"configuration_id,omitempty"` + ConfigurationRunCount *int `json:"configuration_run_count,omitempty"` + Avatar *ConfigSettingsAvatar `json:"avatar,omitempty"` + Customer *ConfigSettingsCustomer `json:"customer,omitempty"` + License *ConfigSettingsLicenseSettings `json:"license,omitempty"` + GithubSSL *ConfigSettingsGithubSSL `json:"github_ssl,omitempty"` + LDAP *ConfigSettingsLDAP `json:"ldap,omitempty"` + CAS *ConfigSettingsCAS `json:"cas,omitempty"` + SAML *ConfigSettingsSAML `json:"saml,omitempty"` + GithubOAuth *ConfigSettingsGithubOAuth `json:"github_oauth,omitempty"` + SMTP *ConfigSettingsSMTP `json:"smtp,omitempty"` + NTP *ConfigSettingsNTP `json:"ntp,omitempty"` + Timezone *string `json:"timezone,omitempty"` + SNMP *ConfigSettingsSNMP `json:"snmp,omitempty"` + Syslog *ConfigSettingsSyslog `json:"syslog,omitempty"` + Assets *string `json:"assets,omitempty"` + Pages *ConfigSettingsPagesSettings `json:"pages,omitempty"` + Collectd *ConfigSettingsCollectd `json:"collectd,omitempty"` + Mapping *ConfigSettingsMapping `json:"mapping,omitempty"` + LoadBalancer *string `json:"load_balancer,omitempty"` +} + +// ConfigSettingsAvatar is a struct to hold the response from the Settings API. +type ConfigSettingsAvatar struct { + Enabled *bool `json:"enabled,omitempty"` + URI *string `json:"uri,omitempty"` +} + +// ConfigSettingsCustomer is a struct to hold the response from the Settings API. +type ConfigSettingsCustomer struct { + Name *string `json:"name,omitempty"` + Email *string `json:"email,omitempty"` + UUID *string `json:"uuid,omitempty"` + Secret *string `json:"secret,omitempty"` + PublicKeyData *string `json:"public_key_data,omitempty"` +} + +// ConfigSettingsLicenseSettings is a struct to hold the response from the Settings API. +type ConfigSettingsLicenseSettings struct { + Seats *int `json:"seats,omitempty"` + Evaluation *bool `json:"evaluation,omitempty"` + Perpetual *bool `json:"perpetual,omitempty"` + UnlimitedSeating *bool `json:"unlimited_seating,omitempty"` + SupportKey *string `json:"support_key,omitempty"` + SSHAllowed *bool `json:"ssh_allowed,omitempty"` + ClusterSupport *bool `json:"cluster_support,omitempty"` + ExpireAt *Timestamp `json:"expire_at,omitempty"` +} + +// ConfigSettingsGithubSSL is a struct to hold the response from the Settings API. +type ConfigSettingsGithubSSL struct { + Enabled *bool `json:"enabled,omitempty"` + Cert *string `json:"cert,omitempty"` + Key *string `json:"key,omitempty"` +} + +// ConfigSettingsLDAP is a struct to hold the response from the Settings API. +type ConfigSettingsLDAP struct { + Host *string `json:"host,omitempty"` + Port *int `json:"port,omitempty"` + Base []string `json:"base,omitempty"` + UID *string `json:"uid,omitempty"` + BindDN *string `json:"bind_dn,omitempty"` + Password *string `json:"password,omitempty"` + Method *string `json:"method,omitempty"` + SearchStrategy *string `json:"search_strategy,omitempty"` + UserGroups []string `json:"user_groups,omitempty"` + AdminGroup *string `json:"admin_group,omitempty"` + VirtualAttributeEnabled *bool `json:"virtual_attribute_enabled,omitempty"` + RecursiveGroupSearch *bool `json:"recursive_group_search,omitempty"` + PosixSupport *bool `json:"posix_support,omitempty"` + UserSyncEmails *bool `json:"user_sync_emails,omitempty"` + UserSyncKeys *bool `json:"user_sync_keys,omitempty"` + UserSyncInterval *int `json:"user_sync_interval,omitempty"` + TeamSyncInterval *int `json:"team_sync_interval,omitempty"` + SyncEnabled *bool `json:"sync_enabled,omitempty"` + Reconciliation *ConfigSettingsLDAPReconciliation `json:"reconciliation,omitempty"` + Profile *ConfigSettingsLDAPProfile `json:"profile,omitempty"` +} + +// ConfigSettingsLDAPReconciliation is part of the ConfigSettingsLDAP struct. +type ConfigSettingsLDAPReconciliation struct { + User *string `json:"user,omitempty"` + Org *string `json:"org,omitempty"` +} + +// ConfigSettingsLDAPProfile is part of the ConfigSettingsLDAP struct. +type ConfigSettingsLDAPProfile struct { + UID *string `json:"uid,omitempty"` + Name *string `json:"name,omitempty"` + Mail *string `json:"mail,omitempty"` + Key *string `json:"key,omitempty"` +} + +// ConfigSettingsCAS is a struct to hold the response from the Settings API. +type ConfigSettingsCAS struct { + URL *string `json:"url,omitempty"` +} + +// ConfigSettingsSAML is a struct to hold the response from the Settings API. +type ConfigSettingsSAML struct { + SSOURL *string `json:"sso_url,omitempty"` + Certificate *string `json:"certificate,omitempty"` + CertificatePath *string `json:"certificate_path,omitempty"` + Issuer *string `json:"issuer,omitempty"` + IDPInitiatedSSO *bool `json:"idp_initiated_sso,omitempty"` + DisableAdminDemote *bool `json:"disable_admin_demote,omitempty"` +} + +// ConfigSettingsGithubOAuth is a struct to hold the response from the Settings API. +type ConfigSettingsGithubOAuth struct { + ClientID *string `json:"client_id,omitempty"` + ClientSecret *string `json:"client_secret,omitempty"` + OrganizationName *string `json:"organization_name,omitempty"` + OrganizationTeam *string `json:"organization_team,omitempty"` +} + +// ConfigSettingsSMTP is a struct to hold the response from the Settings API. +type ConfigSettingsSMTP struct { + Enabled *bool `json:"enabled,omitempty"` + Address *string `json:"address,omitempty"` + Authentication *string `json:"authentication,omitempty"` + Port *string `json:"port,omitempty"` + Domain *string `json:"domain,omitempty"` + Username *string `json:"username,omitempty"` + UserName *string `json:"user_name,omitempty"` + EnableStarttlsAuto *bool `json:"enable_starttls_auto,omitempty"` + Password *string `json:"password,omitempty"` + DiscardToNoreplyAddress *bool `json:"discard-to-noreply-address,omitempty"` + SupportAddress *string `json:"support_address,omitempty"` + SupportAddressType *string `json:"support_address_type,omitempty"` + NoreplyAddress *string `json:"noreply_address,omitempty"` +} + +// ConfigSettingsNTP is a struct to hold the response from the Settings API. +type ConfigSettingsNTP struct { + PrimaryServer *string `json:"primary_server,omitempty"` + SecondaryServer *string `json:"secondary_server,omitempty"` +} + +// ConfigSettingsSNMP is a struct to hold the response from the Settings API. +type ConfigSettingsSNMP struct { + Enabled *bool `json:"enabled,omitempty"` + Community *string `json:"community,omitempty"` +} + +// ConfigSettingsSyslog is a struct to hold the response from the Settings API. +type ConfigSettingsSyslog struct { + Enabled *bool `json:"enabled,omitempty"` + Server *string `json:"server,omitempty"` + ProtocolName *string `json:"protocol_name,omitempty"` +} + +// ConfigSettingsPagesSettings is a struct to hold the response from the Settings API. +type ConfigSettingsPagesSettings struct { + Enabled *bool `json:"enabled,omitempty"` +} + +// ConfigSettingsCollectd is a struct to hold the response from the Settings API. +type ConfigSettingsCollectd struct { + Enabled *bool `json:"enabled,omitempty"` + Server *string `json:"server,omitempty"` + Port *int `json:"port,omitempty"` + Encryption *string `json:"encryption,omitempty"` + Username *string `json:"username,omitempty"` + Password *string `json:"password,omitempty"` +} + +// ConfigSettingsMapping is a struct to hold the response from the Settings API. +type ConfigSettingsMapping struct { + Enabled *bool `json:"enabled,omitempty"` + Tileserver *string `json:"tileserver,omitempty"` + Basemap *string `json:"basemap,omitempty"` + Token *string `json:"token,omitempty"` +} + +// NodeMetadataStatus is a struct to hold the response from the NodeMetadata API. +type NodeMetadataStatus struct { + Topology *string `json:"topology,omitempty"` + Nodes []*NodeDetails `json:"nodes"` +} + +// NodeDetails is a struct to hold the response from the NodeMetadata API. +type NodeDetails struct { + Hostname *string `json:"hostname,omitempty"` + UUID *string `json:"uuid,omitempty"` + ClusterRoles []string `json:"cluster_roles,omitempty"` +} + +// ConfigApplyEvents gets events from the command ghe-config-apply. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#list-events-from-ghe-config-apply +// +//meta:operation GET /manage/v1/config/apply/events +func (s *EnterpriseService) ConfigApplyEvents(ctx context.Context, opts *ConfigApplyEventsOptions) (*ConfigApplyEvents, *Response, error) { + u, err := addOptions("manage/v1/config/apply/events", opts) + if err != nil { + return nil, nil, err + } + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + configApplyEvents := new(ConfigApplyEvents) + resp, err := s.client.Do(ctx, req, configApplyEvents) + if err != nil { + return nil, resp, err + } + + return configApplyEvents, resp, nil +} + +// InitialConfig initializes the GitHub Enterprise instance with a license and password. +// After initializing the instance, you need to run an apply to apply the configuration. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#initialize-instance-configuration-with-license-and-password +// +//meta:operation POST /manage/v1/config/init +func (s *EnterpriseService) InitialConfig(ctx context.Context, license, password string) (*Response, error) { + u := "manage/v1/config/init" + + opts := &InitialConfigOptions{ + License: license, + Password: password, + } + + req, err := s.client.NewRequest("POST", u, opts) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// License gets the current license information for the GitHub Enterprise instance. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-enterprise-license-information +// +//meta:operation GET /manage/v1/config/license +func (s *EnterpriseService) License(ctx context.Context) ([]*LicenseStatus, *Response, error) { + u := "manage/v1/config/license" + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var licenseStatus []*LicenseStatus + resp, err := s.client.Do(ctx, req, &licenseStatus) + if err != nil { + return nil, resp, err + } + + return licenseStatus, resp, nil +} + +// UploadLicense uploads a new license to the GitHub Enterprise instance. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#upload-an-enterprise-license +// +//meta:operation PUT /manage/v1/config/license +func (s *EnterpriseService) UploadLicense(ctx context.Context, license string) (*Response, error) { + u := "manage/v1/config/license" + opts := &UploadLicenseOptions{ + License: license, + } + req, err := s.client.NewRequest("PUT", u, opts) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// LicenseStatus gets the current license status for the GitHub Enterprise instance. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#check-a-license +// +//meta:operation GET /manage/v1/config/license/check +func (s *EnterpriseService) LicenseStatus(ctx context.Context) ([]*LicenseCheck, *Response, error) { + u := "manage/v1/config/license/check" + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var checks []*LicenseCheck + resp, err := s.client.Do(ctx, req, &checks) + if err != nil { + return nil, resp, err + } + + return checks, resp, nil +} + +// NodeMetadata gets the metadata for all nodes in the GitHub Enterprise instance. +// This is required for clustered setups. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-ghes-node-metadata-for-all-nodes +// +//meta:operation GET /manage/v1/config/nodes +func (s *EnterpriseService) NodeMetadata(ctx context.Context, opts *NodeQueryOptions) (*NodeMetadataStatus, *Response, error) { + u, err := addOptions("manage/v1/config/nodes", opts) + if err != nil { + return nil, nil, err + } + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + status := new(NodeMetadataStatus) + resp, err := s.client.Do(ctx, req, status) + if err != nil { + return nil, resp, err + } + + return status, resp, nil +} + +// Settings gets the current configuration settings for the GitHub Enterprise instance. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-ghes-settings +// +//meta:operation GET /manage/v1/config/settings +func (s *EnterpriseService) Settings(ctx context.Context) (*ConfigSettings, *Response, error) { + u := "manage/v1/config/settings" + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + configSettings := new(ConfigSettings) + resp, err := s.client.Do(ctx, req, configSettings) + if err != nil { + return nil, resp, err + } + + return configSettings, resp, nil +} + +// UpdateSettings updates the configuration settings for the GitHub Enterprise instance. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#set-settings +// +//meta:operation PUT /manage/v1/config/settings +func (s *EnterpriseService) UpdateSettings(ctx context.Context, opts *ConfigSettings) (*Response, error) { + u := "manage/v1/config/settings" + + if opts == nil { + return nil, errors.New("opts should not be nil") + } + req, err := s.client.NewRequest("PUT", u, opts) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// ConfigApply triggers a configuration apply run on the GitHub Enterprise instance. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#trigger-a-ghe-config-apply-run +// +//meta:operation POST /manage/v1/config/apply +func (s *EnterpriseService) ConfigApply(ctx context.Context, opts *ConfigApplyOptions) (*ConfigApplyOptions, *Response, error) { + u := "manage/v1/config/apply" + req, err := s.client.NewRequest("POST", u, opts) + if err != nil { + return nil, nil, err + } + + configApplyOptions := new(ConfigApplyOptions) + resp, err := s.client.Do(ctx, req, configApplyOptions) + if err != nil { + return nil, resp, err + } + return configApplyOptions, resp, nil +} + +// ConfigApplyStatus gets the status of a ghe-config-apply run on the GitHub Enterprise instance. +// You can request lat one or specific id one. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-status-of-a-ghe-config-apply-run +// +//meta:operation GET /manage/v1/config/apply +func (s *EnterpriseService) ConfigApplyStatus(ctx context.Context, opts *ConfigApplyOptions) (*ConfigApplyStatus, *Response, error) { + u := "manage/v1/config/apply" + req, err := s.client.NewRequest("GET", u, opts) + if err != nil { + return nil, nil, err + } + + status := new(ConfigApplyStatus) + resp, err := s.client.Do(ctx, req, status) + if err != nil { + return nil, resp, err + } + return status, resp, nil +} diff --git a/github/enterprise_manage_ghes_config_test.go b/github/enterprise_manage_ghes_config_test.go new file mode 100644 index 00000000000..6fb0f526a25 --- /dev/null +++ b/github/enterprise_manage_ghes_config_test.go @@ -0,0 +1,729 @@ +// Copyright 2025 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" + "time" + + "github.com/google/go-cmp/cmp" +) + +func TestEnterpriseService_Settings(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/manage/v1/config/settings", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "private_mode": false, + "public_pages": false, + "subdomain_isolation": true, + "signup_enabled": false, + "github_hostname": "ghe.local", + "identicons_host": "dotcom", + "http_proxy": null, + "auth_mode": "default", + "expire_sessions": false, + "admin_password": null, + "configuration_id": 1401777404, + "configuration_run_count": 4, + "avatar": { + "enabled": false, + "uri": "" + }, + "customer": { + "name": "GitHub", + "email": "stannis", + "uuid": "af6cac80-e4e1-012e-d822-1231380e52e9", + "secret_key_data": "-", + "public_key_data": "-" + }, + "license": { + "seats": 0, + "evaluation": false, + "perpetual": false, + "unlimited_seating": true, + "support_key": "ssh-rsa AAAAB3N....", + "ssh_allowed": true, + "cluster_support": false, + "expire_at": "2018-01-01T00:00:00-00:00" + }, + "github_ssl": { + "enabled": false, + "cert": null, + "key": null + }, + "ldap": { + "host": null, + "port": 0, + "base": [], + "uid": null, + "bind_dn": null, + "password": null, + "method": "Plain", + "search_strategy": "detect", + "user_groups": [], + "admin_group": null, + "virtual_attribute_enabled": false, + "recursive_group_search": false, + "posix_support": true, + "user_sync_emails": false, + "user_sync_keys": false, + "user_sync_interval": 4, + "team_sync_interval": 4, + "sync_enabled": false, + "reconciliation": { + "user": null, + "org": null + }, + "profile": { + "uid": "uid", + "name": null, + "mail": null, + "key": null + } + }, + "cas": { + "url": null + }, + "saml": { + "sso_url": null, + "certificate": null, + "certificate_path": null, + "issuer": null, + "idp_initiated_sso": false, + "disable_admin_demote": false + }, + "github_oauth": { + "client_id": "12313412", + "client_secret": "kj123131132", + "organization_name": "Homestar Runners", + "organization_team": "homestarrunners/characters" + }, + "smtp": { + "enabled": true, + "address": "smtp.example.com", + "authentication": "plain", + "port": "1234", + "domain": "blah", + "username": "foo", + "user_name": "mr_foo", + "enable_starttls_auto": true, + "password": "bar", + "discard-to-noreply-address": true, + "support_address": "enterprise@github.com", + "support_address_type": "email", + "noreply_address": "noreply@github.com" + }, + "ntp": { + "primary_server": "0.pool.ntp.org", + "secondary_server": "1.pool.ntp.org" + }, + "timezone": null, + "snmp": { + "enabled": false, + "community": "" + }, + "syslog": { + "enabled": false, + "server": null, + "protocol_name": "udp" + }, + "assets": null, + "pages": { + "enabled": true + }, + "collectd": { + "enabled": false, + "server": null, + "port": 0, + "encryption": null, + "username": null, + "password": null + }, + "mapping": { + "enabled": true, + "tileserver": null, + "basemap": "company.map-qsz2zrvs", + "token": null + }, + "load_balancer": null + }`) + }) + + ctx := context.Background() + configSettings, _, err := client.Enterprise.Settings(ctx) + if err != nil { + t.Errorf("Enterprise.Settings returned error: %v", err) + } + + want := &ConfigSettings{ + PrivateMode: Ptr(false), + PublicPages: Ptr(false), + SubdomainIsolation: Ptr(true), + SignupEnabled: Ptr(false), + GithubHostname: Ptr("ghe.local"), + IdenticonsHost: Ptr("dotcom"), + HTTPProxy: nil, + AuthMode: Ptr("default"), + ExpireSessions: Ptr(false), + AdminPassword: nil, + ConfigurationID: Ptr(int64(1401777404)), + ConfigurationRunCount: Ptr(4), + Avatar: &ConfigSettingsAvatar{ + Enabled: Ptr(false), + URI: Ptr(""), + }, + Customer: &ConfigSettingsCustomer{ + Name: Ptr("GitHub"), + Email: Ptr("stannis"), + UUID: Ptr("af6cac80-e4e1-012e-d822-1231380e52e9"), + Secret: nil, + PublicKeyData: Ptr("-"), + }, + License: &ConfigSettingsLicenseSettings{ + Seats: Ptr(0), + Evaluation: Ptr(false), + Perpetual: Ptr(false), + UnlimitedSeating: Ptr(true), + SupportKey: Ptr("ssh-rsa AAAAB3N...."), + SSHAllowed: Ptr(true), + ClusterSupport: Ptr(false), + ExpireAt: &Timestamp{time.Date(2018, time.January, 1, 0, 0, 0, 0, time.UTC)}, + }, + GithubSSL: &ConfigSettingsGithubSSL{ + Enabled: Ptr(false), + Cert: nil, + Key: nil, + }, + LDAP: &ConfigSettingsLDAP{ + Host: nil, + Port: Ptr(0), + Base: []string{}, + UID: nil, + BindDN: nil, + Password: nil, + Method: Ptr("Plain"), + SearchStrategy: Ptr("detect"), + UserGroups: []string{}, + AdminGroup: nil, + VirtualAttributeEnabled: Ptr(false), + RecursiveGroupSearch: Ptr(false), + PosixSupport: Ptr(true), + UserSyncEmails: Ptr(false), + UserSyncKeys: Ptr(false), + UserSyncInterval: Ptr(4), + TeamSyncInterval: Ptr(4), + SyncEnabled: Ptr(false), + Reconciliation: &ConfigSettingsLDAPReconciliation{ + User: nil, + Org: nil, + }, + Profile: &ConfigSettingsLDAPProfile{ + UID: Ptr("uid"), + Name: nil, + Mail: nil, + Key: nil, + }, + }, + CAS: &ConfigSettingsCAS{ + URL: nil, + }, + SAML: &ConfigSettingsSAML{ + SSOURL: nil, + Certificate: nil, + CertificatePath: nil, + Issuer: nil, + IDPInitiatedSSO: Ptr(false), + DisableAdminDemote: Ptr(false), + }, + GithubOAuth: &ConfigSettingsGithubOAuth{ + ClientID: Ptr("12313412"), + ClientSecret: Ptr("kj123131132"), + OrganizationName: Ptr("Homestar Runners"), + OrganizationTeam: Ptr("homestarrunners/characters"), + }, + SMTP: &ConfigSettingsSMTP{ + Enabled: Ptr(true), + Address: Ptr("smtp.example.com"), + Authentication: Ptr("plain"), + Port: Ptr("1234"), + Domain: Ptr("blah"), + Username: Ptr("foo"), + UserName: Ptr("mr_foo"), + Password: Ptr("bar"), + DiscardToNoreplyAddress: Ptr(true), + SupportAddress: Ptr("enterprise@github.com"), + SupportAddressType: Ptr("email"), + NoreplyAddress: Ptr("noreply@github.com"), + EnableStarttlsAuto: Ptr(true), + }, + NTP: &ConfigSettingsNTP{ + PrimaryServer: Ptr("0.pool.ntp.org"), + SecondaryServer: Ptr("1.pool.ntp.org"), + }, + Timezone: nil, + SNMP: &ConfigSettingsSNMP{ + Enabled: Ptr(false), + Community: Ptr(""), + }, + Syslog: &ConfigSettingsSyslog{ + Enabled: Ptr(false), + Server: nil, + ProtocolName: Ptr("udp"), + }, + Assets: nil, + Pages: &ConfigSettingsPagesSettings{ + Enabled: Ptr(true), + }, + Collectd: &ConfigSettingsCollectd{ + Enabled: Ptr(false), + Server: nil, + Port: Ptr(0), + Encryption: nil, + Username: nil, + Password: nil, + }, + Mapping: &ConfigSettingsMapping{ + Enabled: Ptr(true), + Tileserver: nil, + Basemap: Ptr("company.map-qsz2zrvs"), + Token: nil, + }, + LoadBalancer: nil, + } + if diff := cmp.Diff(want, configSettings); diff != "" { + t.Errorf("diff mismatch (-want +got):\n%v", diff) + } + + const methodName = "Settings" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.Settings(ctx) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_NodeMetadata(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/manage/v1/config/nodes", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{ + "uuid": "1234-1234", + "cluster_roles": "primary", + }) + fmt.Fprint(w, `{ + "topology": "Cluster", + "nodes": [{ + "hostname": "data1", + "uuid": "1b6cf518-f97c-11ed-8544-061d81f7eedb", + "cluster_roles": [ + "ConsulServer" + ] + }] + }`) + }) + + opt := &NodeQueryOptions{ + UUID: Ptr("1234-1234"), ClusterRoles: Ptr("primary"), + } + ctx := context.Background() + configNodes, _, err := client.Enterprise.NodeMetadata(ctx, opt) + if err != nil { + t.Errorf("Enterprise.NodeMetadata returned error: %v", err) + } + + want := &NodeMetadataStatus{ + Topology: Ptr("Cluster"), + Nodes: []*NodeDetails{{ + Hostname: Ptr("data1"), + UUID: Ptr("1b6cf518-f97c-11ed-8544-061d81f7eedb"), + ClusterRoles: []string{ + "ConsulServer", + }, + }}, + } + if !cmp.Equal(configNodes, want) { + t.Errorf("Enterprise.NodeMetadata returned %+v, want %+v", configNodes, want) + } + + const methodName = "NodeMetadata" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.NodeMetadata(ctx, opt) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_LicenseStatus(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/manage/v1/config/license/check", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `[{ + "status": "valid" + }]`) + }) + + ctx := context.Background() + licenseCheck, _, err := client.Enterprise.LicenseStatus(ctx) + if err != nil { + t.Errorf("Enterprise.LicenseStatus returned error: %v", err) + } + + want := []*LicenseCheck{{ + Status: Ptr("valid"), + }} + if !cmp.Equal(licenseCheck, want) { + t.Errorf("Enterprise.LicenseStatus returned %+v, want %+v", licenseCheck, want) + } + + const methodName = "LicenseStatus" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.LicenseStatus(ctx) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_License(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/manage/v1/config/license", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `[{ + "advancedSecurityEnabled": true, + "advancedSecuritySeats": 0, + "clusterSupport": false, + "company": "GitHub", + "croquetSupport": true, + "customTerms": true, + "evaluation": false, + "expireAt": "2018-01-01T00:00:00Z", + "insightsEnabled": true, + "insightsExpireAt": "2018-01-01T00:00:00Z", + "learningLabEvaluationExpires": "2018-01-01T00:00:00Z", + "learningLabSeats": 100, + "perpetual": false, + "referenceNumber": "32a145", + "seats": 0, + "sshAllowed": true, + "supportKey": "", + "unlimitedSeating": true + }]`) + }) + + ctx := context.Background() + license, _, err := client.Enterprise.License(ctx) + if err != nil { + t.Errorf("Enterprise.License returned error: %v", err) + } + + want := []*LicenseStatus{{ + AdvancedSecurityEnabled: Ptr(true), + AdvancedSecuritySeats: Ptr(0), + ClusterSupport: Ptr(false), + Company: Ptr("GitHub"), + CroquetSupport: Ptr(true), + CustomTerms: Ptr(true), + Evaluation: Ptr(false), + ExpireAt: &Timestamp{time.Date(2018, time.January, 1, 0, 0, 0, 0, time.UTC)}, + InsightsEnabled: Ptr(true), + InsightsExpireAt: &Timestamp{time.Date(2018, time.January, 1, 0, 0, 0, 0, time.UTC)}, + LearningLabEvaluationExpires: &Timestamp{time.Date(2018, time.January, 1, 0, 0, 0, 0, time.UTC)}, + LearningLabSeats: Ptr(100), + Perpetual: Ptr(false), + ReferenceNumber: Ptr("32a145"), + Seats: Ptr(0), + SSHAllowed: Ptr(true), + SupportKey: Ptr(""), + UnlimitedSeating: Ptr(true), + }} + if diff := cmp.Diff(want, license); diff != "" { + t.Errorf("diff mismatch (-want +got):\n%v", diff) + } + const methodName = "License" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.License(ctx) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_ConfigApplyEvents(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/manage/v1/config/apply/events", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "nodes": [{ + "node": "ghes-01.lan", + "last_request_id": "387cd628c06d606700e79be368e5e574:0cde553750689c76:0000000000000000", + "events": [{ + "timestamp": "2018-01-01T00:00:00+00:00", + "severity_text": "INFO", + "body": "Validating services", + "event_name": "Enterprise::ConfigApply::PhaseValidation#config_phase_validation", + "topology": "multinode", + "hostname": "ghes-01.lan", + "config_run_id": "d34db33f", + "trace_id": "387cd628c06d606700e79be368e5e574", + "span_id": "0cde553750689c76", + "span_parent_id": 0, + "span_depth": 0 + }] + }] + }`) + }) + + input := &ConfigApplyEventsOptions{ + LastRequestID: Ptr("387cd628c06d606700e79be368e5e574:0cde553750689"), + } + + ctx := context.Background() + configEvents, _, err := client.Enterprise.ConfigApplyEvents(ctx, input) + if err != nil { + t.Errorf("Enterprise.ConfigApplyEvents returned error: %v", err) + } + + want := &ConfigApplyEvents{ + Nodes: []*ConfigApplyEventsNode{{ + Node: Ptr("ghes-01.lan"), + LastRequestID: Ptr("387cd628c06d606700e79be368e5e574:0cde553750689c76:0000000000000000"), + Events: []*ConfigApplyEventsNodeEvent{{ + Timestamp: &Timestamp{time.Date(2018, time.January, 1, 0, 0, 0, 0, time.UTC)}, + SeverityText: Ptr("INFO"), + Body: Ptr("Validating services"), + EventName: Ptr("Enterprise::ConfigApply::PhaseValidation#config_phase_validation"), + Topology: Ptr("multinode"), + Hostname: Ptr("ghes-01.lan"), + ConfigRunID: Ptr("d34db33f"), + TraceID: Ptr("387cd628c06d606700e79be368e5e574"), + SpanID: Ptr("0cde553750689c76"), + SpanParentID: Ptr(int64(0)), + SpanDepth: Ptr(0), + }}, + }}, + } + if diff := cmp.Diff(want, configEvents); diff != "" { + t.Errorf("diff mismatch (-want +got):\n%v", diff) + } + if !cmp.Equal(configEvents, want) { + t.Errorf("Enterprise.ConfigApplyEvents returned %+v, want %+v", configEvents, want) + } + + const methodName = "ConfigApplyEvents" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.ConfigApplyEvents(ctx, input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_UpdateSettings(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/manage/v1/config/settings", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + + w.WriteHeader(http.StatusNoContent) + }) + + input := &ConfigSettings{ + PrivateMode: Ptr(false), + } + + ctx := context.Background() + if _, err := client.Enterprise.UpdateSettings(ctx, input); err != nil { + t.Errorf("Enterprise.UpdateSettings returned error: %v", err) + } + + const methodName = "UpdateSettings" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Enterprise.UpdateSettings(ctx, nil) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Enterprise.UpdateSettings(ctx, input) + }) +} + +func TestEnterpriseService_UploadLicense(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/manage/v1/config/license", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + + w.WriteHeader(http.StatusNoContent) + }) + + ctx := context.Background() + if _, err := client.Enterprise.UploadLicense(ctx, "abc"); err != nil { + t.Errorf("Enterprise.UploadLicense returned error: %v", err) + } + + const methodName = "UploadLicense" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Enterprise.UploadLicense(ctx, "") + }) +} + +func TestEnterpriseService_InitialConfig(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + input := &InitialConfigOptions{ + License: "1234-1234", + Password: "password", + } + + mux.HandleFunc("/manage/v1/config/init", func(w http.ResponseWriter, r *http.Request) { + v := new(InitialConfigOptions) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) + + testMethod(t, r, "POST") + if diff := cmp.Diff(v, input); diff != "" { + t.Errorf("diff mismatch (-want +got):\n%v", diff) + } + }) + + ctx := context.Background() + if _, err := client.Enterprise.InitialConfig(ctx, "1234-1234", "password"); err != nil { + t.Errorf("Enterprise.InitialConfig returned error: %v", err) + } + + const methodName = "InitialConfig" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Enterprise.InitialConfig(ctx, "", "") + }) +} + +func TestEnterpriseService_ConfigApply(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/manage/v1/config/apply", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + got := new(ConfigApplyOptions) + assertNilError(t, json.NewDecoder(r.Body).Decode(got)) + + want := &ConfigApplyOptions{ + RunID: Ptr("1234"), + } + if diff := cmp.Diff(want, got); diff != "" { + t.Errorf("diff mismatch (-want +got):\n%v", diff) + } + fmt.Fprint(w, `{ "run_id": "1234" }`) + }) + + input := &ConfigApplyOptions{ + RunID: Ptr("1234"), + } + + ctx := context.Background() + configApply, _, err := client.Enterprise.ConfigApply(ctx, input) + if err != nil { + t.Errorf("Enterprise.ConfigApply returned error: %v", err) + } + want := &ConfigApplyOptions{ + RunID: Ptr("1234"), + } + if !cmp.Equal(configApply, want) { + t.Errorf("Enterprise.ConfigApply returned %+v, want %+v", configApply, want) + } + const methodName = "ConfigApply" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.ConfigApply(ctx, input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_ConfigApplyStatus(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/manage/v1/config/apply", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + got := new(ConfigApplyOptions) + assertNilError(t, json.NewDecoder(r.Body).Decode(got)) + + want := &ConfigApplyOptions{ + RunID: Ptr("1234"), + } + if diff := cmp.Diff(want, got); diff != "" { + t.Errorf("diff mismatch (-want +got):\n%v", diff) + } + fmt.Fprint(w, `{ + "running": true, + "successful": false, + "nodes": [ + { + "run_id": "d34db33f", + "hostname": "ghes-01.lan", + "running": true, + "successful": false + } + ] + }`) + }) + input := &ConfigApplyOptions{ + RunID: Ptr("1234"), + } + ctx := context.Background() + configApplyStatus, _, err := client.Enterprise.ConfigApplyStatus(ctx, input) + if err != nil { + t.Errorf("Enterprise.ConfigApplyStatus returned error: %v", err) + } + want := &ConfigApplyStatus{ + Running: Ptr(true), + Successful: Ptr(false), + Nodes: []*ConfigApplyStatusNode{{ + RunID: Ptr("d34db33f"), + Hostname: Ptr("ghes-01.lan"), + Running: Ptr(true), + Successful: Ptr(false), + }}, + } + if !cmp.Equal(configApplyStatus, want) { + t.Errorf("Enterprise.ConfigApplyStatus returned %+v, want %+v", configApplyStatus, want) + } + const methodName = "ConfigApplyStatus" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.ConfigApplyStatus(ctx, input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} diff --git a/github/enterprise_manage_ghes_maintenance.go b/github/enterprise_manage_ghes_maintenance.go new file mode 100644 index 00000000000..3b1de92df13 --- /dev/null +++ b/github/enterprise_manage_ghes_maintenance.go @@ -0,0 +1,94 @@ +// Copyright 2025 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" +) + +// MaintenanceOperationStatus represents the message to be displayed when the instance gets a maintenance operation request. +type MaintenanceOperationStatus struct { + Hostname *string `json:"hostname,omitempty"` + UUID *string `json:"uuid,omitempty"` + Message *string `json:"message,omitempty"` +} + +// MaintenanceStatus represents the status of maintenance mode for all nodes. +type MaintenanceStatus struct { + Hostname *string `json:"hostname,omitempty"` + UUID *string `json:"uuid,omitempty"` + Status *string `json:"status,omitempty"` + ScheduledTime *Timestamp `json:"scheduled_time,omitempty"` + ConnectionServices []*ConnectionServiceItem `json:"connection_services,omitempty"` + CanUnsetMaintenance *bool `json:"can_unset_maintenance,omitempty"` + IPExceptionList []string `json:"ip_exception_list,omitempty"` + MaintenanceModeMessage *string `json:"maintenance_mode_message,omitempty"` +} + +// ConnectionServiceItem represents the connection services for the maintenance status. +type ConnectionServiceItem struct { + Name *string `json:"name,omitempty"` + Number *int `json:"number,omitempty"` +} + +// MaintenanceOptions represents the options for setting the maintenance mode for the instance. +// When can be a string, so we can't use a Timestamp type. +type MaintenanceOptions struct { + Enabled bool `json:"enabled"` + UUID *string `json:"uuid,omitempty"` + When *string `json:"when,omitempty"` + IPExceptionList []string `json:"ip_exception_list,omitempty"` + MaintenanceModeMessage *string `json:"maintenance_mode_message,omitempty"` +} + +// GetMaintenanceStatus gets the status of maintenance mode for all nodes. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-status-of-maintenance-mode +// +//meta:operation GET /manage/v1/maintenance +func (s *EnterpriseService) GetMaintenanceStatus(ctx context.Context, opts *NodeQueryOptions) ([]*MaintenanceStatus, *Response, error) { + u, err := addOptions("manage/v1/maintenance", opts) + if err != nil { + return nil, nil, err + } + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var status []*MaintenanceStatus + resp, err := s.client.Do(ctx, req, &status) + if err != nil { + return nil, resp, err + } + + return status, resp, nil +} + +// CreateMaintenance sets the maintenance mode for the instance. +// With the enable parameter we can control to put instance into maintenance mode or not. With false we can disable the maintenance mode. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#set-the-status-of-maintenance-mode +// +//meta:operation POST /manage/v1/maintenance +func (s *EnterpriseService) CreateMaintenance(ctx context.Context, enable bool, opts *MaintenanceOptions) ([]*MaintenanceOperationStatus, *Response, error) { + u := "manage/v1/maintenance" + + opts.Enabled = enable + + req, err := s.client.NewRequest("POST", u, opts) + if err != nil { + return nil, nil, err + } + + var i []*MaintenanceOperationStatus + resp, err := s.client.Do(ctx, req, &i) + if err != nil { + return nil, resp, err + } + + return i, resp, nil +} diff --git a/github/enterprise_manage_ghes_maintenance_test.go b/github/enterprise_manage_ghes_maintenance_test.go new file mode 100644 index 00000000000..dabbfd45099 --- /dev/null +++ b/github/enterprise_manage_ghes_maintenance_test.go @@ -0,0 +1,129 @@ +// Copyright 2025 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" + "time" + + "github.com/google/go-cmp/cmp" +) + +func TestEnterpriseService_GetMaintenanceStatus(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/manage/v1/maintenance", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{ + "uuid": "1234-1234", + "cluster_roles": "primary", + }) + fmt.Fprint(w, `[{ + "hostname": "primary", + "uuid": "1b6cf518-f97c-11ed-8544-061d81f7eedb", + "status": "scheduled", + "scheduled_time": "2018-01-01T00:00:00+00:00", + "connection_services": [ + { + "name": "git operations", + "number": 15 + } + ], + "can_unset_maintenance": true, + "ip_exception_list": [ + "1.1.1.1" + ], + "maintenance_mode_message": "Scheduled maintenance for upgrading." + }]`) + }) + + opt := &NodeQueryOptions{ + UUID: Ptr("1234-1234"), ClusterRoles: Ptr("primary"), + } + ctx := context.Background() + maintenanceStatus, _, err := client.Enterprise.GetMaintenanceStatus(ctx, opt) + if err != nil { + t.Errorf("Enterprise.GetMaintenanceStatus returned error: %v", err) + } + + want := []*MaintenanceStatus{{ + Hostname: Ptr("primary"), + UUID: Ptr("1b6cf518-f97c-11ed-8544-061d81f7eedb"), + Status: Ptr("scheduled"), + ScheduledTime: &Timestamp{time.Date(2018, time.January, 1, 0, 0, 0, 0, time.UTC)}, + ConnectionServices: []*ConnectionServiceItem{{ + Name: Ptr("git operations"), + Number: Ptr(15), + }}, + CanUnsetMaintenance: Ptr(true), + IPExceptionList: []string{"1.1.1.1"}, + MaintenanceModeMessage: Ptr("Scheduled maintenance for upgrading."), + }} + if !cmp.Equal(maintenanceStatus, want) { + t.Errorf("Enterprise.GetMaintenanceStatus returned %+v, want %+v", maintenanceStatus, want) + } + + const methodName = "GetMaintenanceStatus" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.GetMaintenanceStatus(ctx, opt) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_CreateMaintenance(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + input := &MaintenanceOptions{ + Enabled: true, + UUID: Ptr("1234-1234"), + When: Ptr("now"), + IPExceptionList: []string{ + "1.1.1.1", + }, + MaintenanceModeMessage: Ptr("Scheduled maintenance for upgrading."), + } + + mux.HandleFunc("/manage/v1/maintenance", func(w http.ResponseWriter, r *http.Request) { + v := new(MaintenanceOptions) + assertNilError(t, 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, `[ { "hostname": "primary", "uuid": "1b6cf518-f97c-11ed-8544-061d81f7eedb", "message": "Scheduled maintenance for upgrading." } ]`) + }) + + ctx := context.Background() + maintenanceStatus, _, err := client.Enterprise.CreateMaintenance(ctx, true, input) + if err != nil { + t.Errorf("Enterprise.CreateMaintenance returned error: %v", err) + } + + want := []*MaintenanceOperationStatus{{Hostname: Ptr("primary"), UUID: Ptr("1b6cf518-f97c-11ed-8544-061d81f7eedb"), Message: Ptr("Scheduled maintenance for upgrading.")}} + if diff := cmp.Diff(want, maintenanceStatus); diff != "" { + t.Errorf("diff mismatch (-want +got):\n%v", diff) + } + + const methodName = "CreateMaintenance" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.CreateMaintenance(ctx, true, input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} diff --git a/github/enterprise_manage_ghes_ssh.go b/github/enterprise_manage_ghes_ssh.go new file mode 100644 index 00000000000..77d25216593 --- /dev/null +++ b/github/enterprise_manage_ghes_ssh.go @@ -0,0 +1,99 @@ +// Copyright 2025 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" +) + +// SSHKeyStatus represents the status of a SSH key operation. +type SSHKeyStatus struct { + Hostname *string `json:"hostname,omitempty"` + UUID *string `json:"uuid,omitempty"` + Message *string `json:"message,omitempty"` + Modified *bool `json:"modified,omitempty"` +} + +// SSHKeyOptions specifies the parameters to the SSH create and delete functions. +type SSHKeyOptions struct { + // Key is the SSH key to add to the instance. + Key string `json:"key"` +} + +// ClusterSSHKey represents the SSH keys configured for the instance. +type ClusterSSHKey struct { + Key *string `json:"key,omitempty"` + Fingerprint *string `json:"fingerprint,omitempty"` +} + +// DeleteSSHKey deletes the SSH key from the instance. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#delete-a-ssh-key +// +//meta:operation DELETE /manage/v1/access/ssh +func (s *EnterpriseService) DeleteSSHKey(ctx context.Context, key string) ([]*SSHKeyStatus, *Response, error) { + u := "manage/v1/access/ssh" + opts := &SSHKeyOptions{ + Key: key, + } + req, err := s.client.NewRequest("DELETE", u, opts) + if err != nil { + return nil, nil, err + } + + var sshStatus []*SSHKeyStatus + resp, err := s.client.Do(ctx, req, &sshStatus) + if err != nil { + return nil, resp, err + } + + return sshStatus, resp, nil +} + +// GetSSHKey gets the SSH keys configured for the instance. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-configured-ssh-keys +// +//meta:operation GET /manage/v1/access/ssh +func (s *EnterpriseService) GetSSHKey(ctx context.Context) ([]*ClusterSSHKey, *Response, error) { + u := "manage/v1/access/ssh" + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var sshKeys []*ClusterSSHKey + resp, err := s.client.Do(ctx, req, &sshKeys) + if err != nil { + return nil, resp, err + } + + return sshKeys, resp, nil +} + +// CreateSSHKey adds a new SSH key to the instance. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#set-a-new-ssh-key +// +//meta:operation POST /manage/v1/access/ssh +func (s *EnterpriseService) CreateSSHKey(ctx context.Context, key string) ([]*SSHKeyStatus, *Response, error) { + u := "manage/v1/access/ssh" + opts := &SSHKeyOptions{ + Key: key, + } + req, err := s.client.NewRequest("POST", u, opts) + if err != nil { + return nil, nil, err + } + + var sshKeyResponse []*SSHKeyStatus + resp, err := s.client.Do(ctx, req, &sshKeyResponse) + if err != nil { + return nil, resp, err + } + + return sshKeyResponse, resp, nil +} diff --git a/github/enterprise_manage_ghes_ssh_test.go b/github/enterprise_manage_ghes_ssh_test.go new file mode 100644 index 00000000000..b8ed236644f --- /dev/null +++ b/github/enterprise_manage_ghes_ssh_test.go @@ -0,0 +1,134 @@ +// Copyright 2025 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 TestEnterpriseService_GetSSHKey(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/manage/v1/access/ssh", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `[{ + "key": "ssh-rsa 1234", + "fingerprint": "bd" + }]`) + }) + + ctx := context.Background() + accessSSH, _, err := client.Enterprise.GetSSHKey(ctx) + if err != nil { + t.Errorf("Enterprise.GetSSHKey returned error: %v", err) + } + + want := []*ClusterSSHKey{{ + Key: Ptr("ssh-rsa 1234"), + Fingerprint: Ptr("bd"), + }} + if !cmp.Equal(accessSSH, want) { + t.Errorf("Enterprise.GetSSHKey returned %+v, want %+v", accessSSH, want) + } + + const methodName = "GetSSHKey" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.GetSSHKey(ctx) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_DeleteSSHKey(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + input := &SSHKeyOptions{ + Key: "ssh-rsa 1234", + } + + mux.HandleFunc("/manage/v1/access/ssh", func(w http.ResponseWriter, r *http.Request) { + v := new(SSHKeyOptions) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) + + testMethod(t, r, "DELETE") + if !cmp.Equal(v, input) { + t.Errorf("Request body = %+v, want %+v", v, input) + } + + fmt.Fprint(w, `[ { "hostname": "primary", "uuid": "1b6cf518-f97c-11ed-8544-061d81f7eedb", "message": "SSH key removed successfully" } ]`) + }) + + ctx := context.Background() + sshStatus, _, err := client.Enterprise.DeleteSSHKey(ctx, "ssh-rsa 1234") + if err != nil { + t.Errorf("Enterprise.DeleteSSHKey returned error: %v", err) + } + + want := []*SSHKeyStatus{{Hostname: Ptr("primary"), UUID: Ptr("1b6cf518-f97c-11ed-8544-061d81f7eedb"), Message: Ptr("SSH key removed successfully")}} + if diff := cmp.Diff(want, sshStatus); diff != "" { + t.Errorf("diff mismatch (-want +got):\n%v", diff) + } + + const methodName = "DeleteSSHKey" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.DeleteSSHKey(ctx, "ssh-rsa 1234") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_CreateSSHKey(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + input := &SSHKeyOptions{ + Key: "ssh-rsa 1234", + } + + mux.HandleFunc("/manage/v1/access/ssh", func(w http.ResponseWriter, r *http.Request) { + v := new(SSHKeyOptions) + assertNilError(t, 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, `[ { "hostname": "primary", "uuid": "1b6cf518-f97c-11ed-8544-061d81f7eedb", "message": "SSH key added successfully", "modified": true } ]`) + }) + + ctx := context.Background() + sshStatus, _, err := client.Enterprise.CreateSSHKey(ctx, "ssh-rsa 1234") + if err != nil { + t.Errorf("Enterprise.CreateSSHKey returned error: %v", err) + } + + want := []*SSHKeyStatus{{Hostname: Ptr("primary"), UUID: Ptr("1b6cf518-f97c-11ed-8544-061d81f7eedb"), Message: Ptr("SSH key added successfully"), Modified: Ptr(true)}} + if diff := cmp.Diff(want, sshStatus); diff != "" { + t.Errorf("diff mismatch (-want +got):\n%v", diff) + } + + const methodName = "CreateSSHKey" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.CreateSSHKey(ctx, "ssh-rsa 1234") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} diff --git a/github/enterprise_manage_ghes_test.go b/github/enterprise_manage_ghes_test.go new file mode 100644 index 00000000000..7f947eb320e --- /dev/null +++ b/github/enterprise_manage_ghes_test.go @@ -0,0 +1,213 @@ +// Copyright 2025 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 TestEnterpriseService_CheckSystemRequirements(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/manage/v1/checks/system-requirements", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "status": "OK", + "nodes": [{ + "hostname": "primary", + "status": "OK", + "roles_status": [{ + "status": "OK", + "role": "ConsulServer" + } + ]} + ]}`) + }) + + ctx := context.Background() + systemRequirements, _, err := client.Enterprise.CheckSystemRequirements(ctx) + if err != nil { + t.Errorf("Enterprise.CheckSystemRequirements returned error: %v", err) + } + + want := &SystemRequirements{ + Status: Ptr("OK"), + Nodes: []*SystemRequirementsNode{{ + Hostname: Ptr("primary"), + Status: Ptr("OK"), + RolesStatus: []*SystemRequirementsNodeRoleStatus{{ + Status: Ptr("OK"), + Role: Ptr("ConsulServer"), + }}, + }}, + } + if !cmp.Equal(systemRequirements, want) { + t.Errorf("Enterprise.CheckSystemRequirements returned %+v, want %+v", systemRequirements, want) + } + + const methodName = "CheckSystemRequirements" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.CheckSystemRequirements(ctx) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_ClusterStatus(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/manage/v1/cluster/status", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "status": "OK", + "nodes": [{ + "hostname": "primary", + "status": "OK", + "services": [] + }] + }`) + }) + + ctx := context.Background() + clusterStatus, _, err := client.Enterprise.ClusterStatus(ctx) + if err != nil { + t.Errorf("Enterprise.ClusterStatus returned error: %v", err) + } + + want := &ClusterStatus{ + Status: Ptr("OK"), + Nodes: []*ClusterStatusNode{{ + Hostname: Ptr("primary"), + Status: Ptr("OK"), + Services: []*ClusterStatusNodeServiceItem{}, + }}, + } + if !cmp.Equal(clusterStatus, want) { + t.Errorf("Enterprise.ClusterStatus returned %+v, want %+v", clusterStatus, want) + } + + const methodName = "ClusterStatus" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.ClusterStatus(ctx) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_ReplicationStatus(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/manage/v1/replication/status", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{ + "uuid": "1234-1234", + "cluster_roles": "primary", + }) + fmt.Fprint(w, `{ + "status": "OK", + "nodes": [{ + "hostname": "primary", + "status": "OK", + "services": [] + }] + }`) + }) + + opt := &NodeQueryOptions{ + UUID: Ptr("1234-1234"), ClusterRoles: Ptr("primary"), + } + ctx := context.Background() + replicationStatus, _, err := client.Enterprise.ReplicationStatus(ctx, opt) + if err != nil { + t.Errorf("Enterprise.ReplicationStatus returned error: %v", err) + } + + want := &ClusterStatus{ + Status: Ptr("OK"), + Nodes: []*ClusterStatusNode{{ + Hostname: Ptr("primary"), + Status: Ptr("OK"), + Services: []*ClusterStatusNodeServiceItem{}, + }}, + } + if !cmp.Equal(replicationStatus, want) { + t.Errorf("Enterprise.ReplicationStatus returned %+v, want %+v", replicationStatus, want) + } + + const methodName = "ReplicationStatus" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.ReplicationStatus(ctx, opt) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_Versions(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/manage/v1/version", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{ + "uuid": "1234-1234", + "cluster_roles": "primary", + }) + fmt.Fprint(w, `[{ + "hostname": "primary", + "version": { + "version": "3.9.0", + "platform": "azure", + "build_id": "fc542058b5", + "build_date": "2023-05-02" + } + }]`) + }) + + opt := &NodeQueryOptions{ + UUID: Ptr("1234-1234"), ClusterRoles: Ptr("primary"), + } + ctx := context.Background() + releaseVersions, _, err := client.Enterprise.GetNodeReleaseVersions(ctx, opt) + if err != nil { + t.Errorf("Enterprise.GetNodeReleaseVersions returned error: %v", err) + } + + want := []*NodeReleaseVersion{{ + Hostname: Ptr("primary"), + Version: &ReleaseVersion{ + Version: Ptr("3.9.0"), + Platform: Ptr("azure"), + BuildID: Ptr("fc542058b5"), + BuildDate: Ptr("2023-05-02"), + }, + }} + if !cmp.Equal(releaseVersions, want) { + t.Errorf("Enterprise.GetNodeReleaseVersions returned %+v, want %+v", releaseVersions, want) + } + + const methodName = "GetNodeReleaseVersions" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.GetNodeReleaseVersions(ctx, opt) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} diff --git a/github/github-accessors.go b/github/github-accessors.go index 28d44ce35e5..2900ace10c5 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -2462,6 +2462,70 @@ func (c *CheckSuitePreferenceResults) GetRepository() *Repository { return c.Repository } +// GetFingerprint returns the Fingerprint field if it's non-nil, zero value otherwise. +func (c *ClusterSSHKey) GetFingerprint() string { + if c == nil || c.Fingerprint == nil { + return "" + } + return *c.Fingerprint +} + +// GetKey returns the Key field if it's non-nil, zero value otherwise. +func (c *ClusterSSHKey) GetKey() string { + if c == nil || c.Key == nil { + return "" + } + return *c.Key +} + +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (c *ClusterStatus) GetStatus() string { + if c == nil || c.Status == nil { + return "" + } + return *c.Status +} + +// GetHostname returns the Hostname field if it's non-nil, zero value otherwise. +func (c *ClusterStatusNode) GetHostname() string { + if c == nil || c.Hostname == nil { + return "" + } + return *c.Hostname +} + +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (c *ClusterStatusNode) GetStatus() string { + if c == nil || c.Status == nil { + return "" + } + return *c.Status +} + +// GetDetails returns the Details field if it's non-nil, zero value otherwise. +func (c *ClusterStatusNodeServiceItem) GetDetails() string { + if c == nil || c.Details == nil { + return "" + } + return *c.Details +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (c *ClusterStatusNodeServiceItem) GetName() string { + if c == nil || c.Name == nil { + return "" + } + return *c.Name +} + +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (c *ClusterStatusNodeServiceItem) GetStatus() string { + if c == nil || c.Status == nil { + return "" + } + return *c.Status +} + // GetBody returns the Body field if it's non-nil, zero value otherwise. func (c *CodeOfConduct) GetBody() string { if c == nil || c.Body == nil { @@ -3998,44 +4062,1140 @@ func (c *CommunityHealthMetrics) GetContentReportsEnabled() bool { return *c.ContentReportsEnabled } -// GetDescription returns the Description field if it's non-nil, zero value otherwise. -func (c *CommunityHealthMetrics) GetDescription() string { - if c == nil || c.Description == nil { +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (c *CommunityHealthMetrics) GetDescription() string { + if c == nil || c.Description == nil { + return "" + } + return *c.Description +} + +// GetDocumentation returns the Documentation field if it's non-nil, zero value otherwise. +func (c *CommunityHealthMetrics) GetDocumentation() string { + if c == nil || c.Documentation == nil { + return "" + } + return *c.Documentation +} + +// GetFiles returns the Files field. +func (c *CommunityHealthMetrics) GetFiles() *CommunityHealthFiles { + if c == nil { + return nil + } + return c.Files +} + +// GetHealthPercentage returns the HealthPercentage field if it's non-nil, zero value otherwise. +func (c *CommunityHealthMetrics) GetHealthPercentage() int { + if c == nil || c.HealthPercentage == nil { + return 0 + } + return *c.HealthPercentage +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (c *CommunityHealthMetrics) GetUpdatedAt() Timestamp { + if c == nil || c.UpdatedAt == nil { + return Timestamp{} + } + return *c.UpdatedAt +} + +// GetLastRequestID returns the LastRequestID field if it's non-nil, zero value otherwise. +func (c *ConfigApplyEventsNode) GetLastRequestID() string { + if c == nil || c.LastRequestID == nil { + return "" + } + return *c.LastRequestID +} + +// GetNode returns the Node field if it's non-nil, zero value otherwise. +func (c *ConfigApplyEventsNode) GetNode() string { + if c == nil || c.Node == nil { + return "" + } + return *c.Node +} + +// GetBody returns the Body field if it's non-nil, zero value otherwise. +func (c *ConfigApplyEventsNodeEvent) GetBody() string { + if c == nil || c.Body == nil { + return "" + } + return *c.Body +} + +// GetConfigRunID returns the ConfigRunID field if it's non-nil, zero value otherwise. +func (c *ConfigApplyEventsNodeEvent) GetConfigRunID() string { + if c == nil || c.ConfigRunID == nil { + return "" + } + return *c.ConfigRunID +} + +// GetEventName returns the EventName field if it's non-nil, zero value otherwise. +func (c *ConfigApplyEventsNodeEvent) GetEventName() string { + if c == nil || c.EventName == nil { + return "" + } + return *c.EventName +} + +// GetHostname returns the Hostname field if it's non-nil, zero value otherwise. +func (c *ConfigApplyEventsNodeEvent) GetHostname() string { + if c == nil || c.Hostname == nil { + return "" + } + return *c.Hostname +} + +// GetSeverityText returns the SeverityText field if it's non-nil, zero value otherwise. +func (c *ConfigApplyEventsNodeEvent) GetSeverityText() string { + if c == nil || c.SeverityText == nil { + return "" + } + return *c.SeverityText +} + +// GetSpanDepth returns the SpanDepth field if it's non-nil, zero value otherwise. +func (c *ConfigApplyEventsNodeEvent) GetSpanDepth() int { + if c == nil || c.SpanDepth == nil { + return 0 + } + return *c.SpanDepth +} + +// GetSpanID returns the SpanID field if it's non-nil, zero value otherwise. +func (c *ConfigApplyEventsNodeEvent) GetSpanID() string { + if c == nil || c.SpanID == nil { + return "" + } + return *c.SpanID +} + +// GetSpanParentID returns the SpanParentID field if it's non-nil, zero value otherwise. +func (c *ConfigApplyEventsNodeEvent) GetSpanParentID() int64 { + if c == nil || c.SpanParentID == nil { + return 0 + } + return *c.SpanParentID +} + +// GetTimestamp returns the Timestamp field if it's non-nil, zero value otherwise. +func (c *ConfigApplyEventsNodeEvent) GetTimestamp() Timestamp { + if c == nil || c.Timestamp == nil { + return Timestamp{} + } + return *c.Timestamp +} + +// GetTopology returns the Topology field if it's non-nil, zero value otherwise. +func (c *ConfigApplyEventsNodeEvent) GetTopology() string { + if c == nil || c.Topology == nil { + return "" + } + return *c.Topology +} + +// GetTraceID returns the TraceID field if it's non-nil, zero value otherwise. +func (c *ConfigApplyEventsNodeEvent) GetTraceID() string { + if c == nil || c.TraceID == nil { + return "" + } + return *c.TraceID +} + +// GetLastRequestID returns the LastRequestID field if it's non-nil, zero value otherwise. +func (c *ConfigApplyEventsOptions) GetLastRequestID() string { + if c == nil || c.LastRequestID == nil { + return "" + } + return *c.LastRequestID +} + +// GetRunID returns the RunID field if it's non-nil, zero value otherwise. +func (c *ConfigApplyOptions) GetRunID() string { + if c == nil || c.RunID == nil { + return "" + } + return *c.RunID +} + +// GetRunning returns the Running field if it's non-nil, zero value otherwise. +func (c *ConfigApplyStatus) GetRunning() bool { + if c == nil || c.Running == nil { + return false + } + return *c.Running +} + +// GetSuccessful returns the Successful field if it's non-nil, zero value otherwise. +func (c *ConfigApplyStatus) GetSuccessful() bool { + if c == nil || c.Successful == nil { + return false + } + return *c.Successful +} + +// GetHostname returns the Hostname field if it's non-nil, zero value otherwise. +func (c *ConfigApplyStatusNode) GetHostname() string { + if c == nil || c.Hostname == nil { + return "" + } + return *c.Hostname +} + +// GetRunID returns the RunID field if it's non-nil, zero value otherwise. +func (c *ConfigApplyStatusNode) GetRunID() string { + if c == nil || c.RunID == nil { + return "" + } + return *c.RunID +} + +// GetRunning returns the Running field if it's non-nil, zero value otherwise. +func (c *ConfigApplyStatusNode) GetRunning() bool { + if c == nil || c.Running == nil { + return false + } + return *c.Running +} + +// GetSuccessful returns the Successful field if it's non-nil, zero value otherwise. +func (c *ConfigApplyStatusNode) GetSuccessful() bool { + if c == nil || c.Successful == nil { + return false + } + return *c.Successful +} + +// GetAdminPassword returns the AdminPassword field if it's non-nil, zero value otherwise. +func (c *ConfigSettings) GetAdminPassword() string { + if c == nil || c.AdminPassword == nil { + return "" + } + return *c.AdminPassword +} + +// GetAssets returns the Assets field if it's non-nil, zero value otherwise. +func (c *ConfigSettings) GetAssets() string { + if c == nil || c.Assets == nil { + return "" + } + return *c.Assets +} + +// GetAuthMode returns the AuthMode field if it's non-nil, zero value otherwise. +func (c *ConfigSettings) GetAuthMode() string { + if c == nil || c.AuthMode == nil { + return "" + } + return *c.AuthMode +} + +// GetAvatar returns the Avatar field. +func (c *ConfigSettings) GetAvatar() *ConfigSettingsAvatar { + if c == nil { + return nil + } + return c.Avatar +} + +// GetCAS returns the CAS field. +func (c *ConfigSettings) GetCAS() *ConfigSettingsCAS { + if c == nil { + return nil + } + return c.CAS +} + +// GetCollectd returns the Collectd field. +func (c *ConfigSettings) GetCollectd() *ConfigSettingsCollectd { + if c == nil { + return nil + } + return c.Collectd +} + +// GetConfigurationID returns the ConfigurationID field if it's non-nil, zero value otherwise. +func (c *ConfigSettings) GetConfigurationID() int64 { + if c == nil || c.ConfigurationID == nil { + return 0 + } + return *c.ConfigurationID +} + +// GetConfigurationRunCount returns the ConfigurationRunCount field if it's non-nil, zero value otherwise. +func (c *ConfigSettings) GetConfigurationRunCount() int { + if c == nil || c.ConfigurationRunCount == nil { + return 0 + } + return *c.ConfigurationRunCount +} + +// GetCustomer returns the Customer field. +func (c *ConfigSettings) GetCustomer() *ConfigSettingsCustomer { + if c == nil { + return nil + } + return c.Customer +} + +// GetExpireSessions returns the ExpireSessions field if it's non-nil, zero value otherwise. +func (c *ConfigSettings) GetExpireSessions() bool { + if c == nil || c.ExpireSessions == nil { + return false + } + return *c.ExpireSessions +} + +// GetGithubHostname returns the GithubHostname field if it's non-nil, zero value otherwise. +func (c *ConfigSettings) GetGithubHostname() string { + if c == nil || c.GithubHostname == nil { + return "" + } + return *c.GithubHostname +} + +// GetGithubOAuth returns the GithubOAuth field. +func (c *ConfigSettings) GetGithubOAuth() *ConfigSettingsGithubOAuth { + if c == nil { + return nil + } + return c.GithubOAuth +} + +// GetGithubSSL returns the GithubSSL field. +func (c *ConfigSettings) GetGithubSSL() *ConfigSettingsGithubSSL { + if c == nil { + return nil + } + return c.GithubSSL +} + +// GetHTTPProxy returns the HTTPProxy field if it's non-nil, zero value otherwise. +func (c *ConfigSettings) GetHTTPProxy() string { + if c == nil || c.HTTPProxy == nil { + return "" + } + return *c.HTTPProxy +} + +// GetIdenticonsHost returns the IdenticonsHost field if it's non-nil, zero value otherwise. +func (c *ConfigSettings) GetIdenticonsHost() string { + if c == nil || c.IdenticonsHost == nil { + return "" + } + return *c.IdenticonsHost +} + +// GetLDAP returns the LDAP field. +func (c *ConfigSettings) GetLDAP() *ConfigSettingsLDAP { + if c == nil { + return nil + } + return c.LDAP +} + +// GetLicense returns the License field. +func (c *ConfigSettings) GetLicense() *ConfigSettingsLicenseSettings { + if c == nil { + return nil + } + return c.License +} + +// GetLoadBalancer returns the LoadBalancer field if it's non-nil, zero value otherwise. +func (c *ConfigSettings) GetLoadBalancer() string { + if c == nil || c.LoadBalancer == nil { + return "" + } + return *c.LoadBalancer +} + +// GetMapping returns the Mapping field. +func (c *ConfigSettings) GetMapping() *ConfigSettingsMapping { + if c == nil { + return nil + } + return c.Mapping +} + +// GetNTP returns the NTP field. +func (c *ConfigSettings) GetNTP() *ConfigSettingsNTP { + if c == nil { + return nil + } + return c.NTP +} + +// GetPages returns the Pages field. +func (c *ConfigSettings) GetPages() *ConfigSettingsPagesSettings { + if c == nil { + return nil + } + return c.Pages +} + +// GetPrivateMode returns the PrivateMode field if it's non-nil, zero value otherwise. +func (c *ConfigSettings) GetPrivateMode() bool { + if c == nil || c.PrivateMode == nil { + return false + } + return *c.PrivateMode +} + +// GetPublicPages returns the PublicPages field if it's non-nil, zero value otherwise. +func (c *ConfigSettings) GetPublicPages() bool { + if c == nil || c.PublicPages == nil { + return false + } + return *c.PublicPages +} + +// GetSAML returns the SAML field. +func (c *ConfigSettings) GetSAML() *ConfigSettingsSAML { + if c == nil { + return nil + } + return c.SAML +} + +// GetSignupEnabled returns the SignupEnabled field if it's non-nil, zero value otherwise. +func (c *ConfigSettings) GetSignupEnabled() bool { + if c == nil || c.SignupEnabled == nil { + return false + } + return *c.SignupEnabled +} + +// GetSMTP returns the SMTP field. +func (c *ConfigSettings) GetSMTP() *ConfigSettingsSMTP { + if c == nil { + return nil + } + return c.SMTP +} + +// GetSNMP returns the SNMP field. +func (c *ConfigSettings) GetSNMP() *ConfigSettingsSNMP { + if c == nil { + return nil + } + return c.SNMP +} + +// GetSubdomainIsolation returns the SubdomainIsolation field if it's non-nil, zero value otherwise. +func (c *ConfigSettings) GetSubdomainIsolation() bool { + if c == nil || c.SubdomainIsolation == nil { + return false + } + return *c.SubdomainIsolation +} + +// GetSyslog returns the Syslog field. +func (c *ConfigSettings) GetSyslog() *ConfigSettingsSyslog { + if c == nil { + return nil + } + return c.Syslog +} + +// GetTimezone returns the Timezone field if it's non-nil, zero value otherwise. +func (c *ConfigSettings) GetTimezone() string { + if c == nil || c.Timezone == nil { + return "" + } + return *c.Timezone +} + +// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsAvatar) GetEnabled() bool { + if c == nil || c.Enabled == nil { + return false + } + return *c.Enabled +} + +// GetURI returns the URI field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsAvatar) GetURI() string { + if c == nil || c.URI == nil { + return "" + } + return *c.URI +} + +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsCAS) GetURL() string { + if c == nil || c.URL == nil { + return "" + } + return *c.URL +} + +// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsCollectd) GetEnabled() bool { + if c == nil || c.Enabled == nil { + return false + } + return *c.Enabled +} + +// GetEncryption returns the Encryption field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsCollectd) GetEncryption() string { + if c == nil || c.Encryption == nil { + return "" + } + return *c.Encryption +} + +// GetPassword returns the Password field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsCollectd) GetPassword() string { + if c == nil || c.Password == nil { + return "" + } + return *c.Password +} + +// GetPort returns the Port field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsCollectd) GetPort() int { + if c == nil || c.Port == nil { + return 0 + } + return *c.Port +} + +// GetServer returns the Server field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsCollectd) GetServer() string { + if c == nil || c.Server == nil { + return "" + } + return *c.Server +} + +// GetUsername returns the Username field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsCollectd) GetUsername() string { + if c == nil || c.Username == nil { + return "" + } + return *c.Username +} + +// GetEmail returns the Email field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsCustomer) GetEmail() string { + if c == nil || c.Email == nil { + return "" + } + return *c.Email +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsCustomer) GetName() string { + if c == nil || c.Name == nil { + return "" + } + return *c.Name +} + +// GetPublicKeyData returns the PublicKeyData field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsCustomer) GetPublicKeyData() string { + if c == nil || c.PublicKeyData == nil { + return "" + } + return *c.PublicKeyData +} + +// GetSecret returns the Secret field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsCustomer) GetSecret() string { + if c == nil || c.Secret == nil { + return "" + } + return *c.Secret +} + +// GetUUID returns the UUID field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsCustomer) GetUUID() string { + if c == nil || c.UUID == nil { + return "" + } + return *c.UUID +} + +// GetClientID returns the ClientID field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsGithubOAuth) GetClientID() string { + if c == nil || c.ClientID == nil { + return "" + } + return *c.ClientID +} + +// GetClientSecret returns the ClientSecret field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsGithubOAuth) GetClientSecret() string { + if c == nil || c.ClientSecret == nil { + return "" + } + return *c.ClientSecret +} + +// GetOrganizationName returns the OrganizationName field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsGithubOAuth) GetOrganizationName() string { + if c == nil || c.OrganizationName == nil { + return "" + } + return *c.OrganizationName +} + +// GetOrganizationTeam returns the OrganizationTeam field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsGithubOAuth) GetOrganizationTeam() string { + if c == nil || c.OrganizationTeam == nil { + return "" + } + return *c.OrganizationTeam +} + +// GetCert returns the Cert field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsGithubSSL) GetCert() string { + if c == nil || c.Cert == nil { + return "" + } + return *c.Cert +} + +// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsGithubSSL) GetEnabled() bool { + if c == nil || c.Enabled == nil { + return false + } + return *c.Enabled +} + +// GetKey returns the Key field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsGithubSSL) GetKey() string { + if c == nil || c.Key == nil { + return "" + } + return *c.Key +} + +// GetAdminGroup returns the AdminGroup field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAP) GetAdminGroup() string { + if c == nil || c.AdminGroup == nil { + return "" + } + return *c.AdminGroup +} + +// GetBindDN returns the BindDN field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAP) GetBindDN() string { + if c == nil || c.BindDN == nil { + return "" + } + return *c.BindDN +} + +// GetHost returns the Host field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAP) GetHost() string { + if c == nil || c.Host == nil { + return "" + } + return *c.Host +} + +// GetMethod returns the Method field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAP) GetMethod() string { + if c == nil || c.Method == nil { + return "" + } + return *c.Method +} + +// GetPassword returns the Password field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAP) GetPassword() string { + if c == nil || c.Password == nil { + return "" + } + return *c.Password +} + +// GetPort returns the Port field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAP) GetPort() int { + if c == nil || c.Port == nil { + return 0 + } + return *c.Port +} + +// GetPosixSupport returns the PosixSupport field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAP) GetPosixSupport() bool { + if c == nil || c.PosixSupport == nil { + return false + } + return *c.PosixSupport +} + +// GetProfile returns the Profile field. +func (c *ConfigSettingsLDAP) GetProfile() *ConfigSettingsLDAPProfile { + if c == nil { + return nil + } + return c.Profile +} + +// GetReconciliation returns the Reconciliation field. +func (c *ConfigSettingsLDAP) GetReconciliation() *ConfigSettingsLDAPReconciliation { + if c == nil { + return nil + } + return c.Reconciliation +} + +// GetRecursiveGroupSearch returns the RecursiveGroupSearch field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAP) GetRecursiveGroupSearch() bool { + if c == nil || c.RecursiveGroupSearch == nil { + return false + } + return *c.RecursiveGroupSearch +} + +// GetSearchStrategy returns the SearchStrategy field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAP) GetSearchStrategy() string { + if c == nil || c.SearchStrategy == nil { + return "" + } + return *c.SearchStrategy +} + +// GetSyncEnabled returns the SyncEnabled field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAP) GetSyncEnabled() bool { + if c == nil || c.SyncEnabled == nil { + return false + } + return *c.SyncEnabled +} + +// GetTeamSyncInterval returns the TeamSyncInterval field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAP) GetTeamSyncInterval() int { + if c == nil || c.TeamSyncInterval == nil { + return 0 + } + return *c.TeamSyncInterval +} + +// GetUID returns the UID field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAP) GetUID() string { + if c == nil || c.UID == nil { + return "" + } + return *c.UID +} + +// GetUserSyncEmails returns the UserSyncEmails field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAP) GetUserSyncEmails() bool { + if c == nil || c.UserSyncEmails == nil { + return false + } + return *c.UserSyncEmails +} + +// GetUserSyncInterval returns the UserSyncInterval field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAP) GetUserSyncInterval() int { + if c == nil || c.UserSyncInterval == nil { + return 0 + } + return *c.UserSyncInterval +} + +// GetUserSyncKeys returns the UserSyncKeys field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAP) GetUserSyncKeys() bool { + if c == nil || c.UserSyncKeys == nil { + return false + } + return *c.UserSyncKeys +} + +// GetVirtualAttributeEnabled returns the VirtualAttributeEnabled field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAP) GetVirtualAttributeEnabled() bool { + if c == nil || c.VirtualAttributeEnabled == nil { + return false + } + return *c.VirtualAttributeEnabled +} + +// GetKey returns the Key field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAPProfile) GetKey() string { + if c == nil || c.Key == nil { + return "" + } + return *c.Key +} + +// GetMail returns the Mail field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAPProfile) GetMail() string { + if c == nil || c.Mail == nil { + return "" + } + return *c.Mail +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAPProfile) GetName() string { + if c == nil || c.Name == nil { + return "" + } + return *c.Name +} + +// GetUID returns the UID field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAPProfile) GetUID() string { + if c == nil || c.UID == nil { + return "" + } + return *c.UID +} + +// GetOrg returns the Org field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAPReconciliation) GetOrg() string { + if c == nil || c.Org == nil { + return "" + } + return *c.Org +} + +// GetUser returns the User field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAPReconciliation) GetUser() string { + if c == nil || c.User == nil { + return "" + } + return *c.User +} + +// GetClusterSupport returns the ClusterSupport field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLicenseSettings) GetClusterSupport() bool { + if c == nil || c.ClusterSupport == nil { + return false + } + return *c.ClusterSupport +} + +// GetEvaluation returns the Evaluation field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLicenseSettings) GetEvaluation() bool { + if c == nil || c.Evaluation == nil { + return false + } + return *c.Evaluation +} + +// GetExpireAt returns the ExpireAt field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLicenseSettings) GetExpireAt() Timestamp { + if c == nil || c.ExpireAt == nil { + return Timestamp{} + } + return *c.ExpireAt +} + +// GetPerpetual returns the Perpetual field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLicenseSettings) GetPerpetual() bool { + if c == nil || c.Perpetual == nil { + return false + } + return *c.Perpetual +} + +// GetSeats returns the Seats field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLicenseSettings) GetSeats() int { + if c == nil || c.Seats == nil { + return 0 + } + return *c.Seats +} + +// GetSSHAllowed returns the SSHAllowed field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLicenseSettings) GetSSHAllowed() bool { + if c == nil || c.SSHAllowed == nil { + return false + } + return *c.SSHAllowed +} + +// GetSupportKey returns the SupportKey field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLicenseSettings) GetSupportKey() string { + if c == nil || c.SupportKey == nil { + return "" + } + return *c.SupportKey +} + +// GetUnlimitedSeating returns the UnlimitedSeating field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLicenseSettings) GetUnlimitedSeating() bool { + if c == nil || c.UnlimitedSeating == nil { + return false + } + return *c.UnlimitedSeating +} + +// GetBasemap returns the Basemap field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsMapping) GetBasemap() string { + if c == nil || c.Basemap == nil { + return "" + } + return *c.Basemap +} + +// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsMapping) GetEnabled() bool { + if c == nil || c.Enabled == nil { + return false + } + return *c.Enabled +} + +// GetTileserver returns the Tileserver field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsMapping) GetTileserver() string { + if c == nil || c.Tileserver == nil { + return "" + } + return *c.Tileserver +} + +// GetToken returns the Token field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsMapping) GetToken() string { + if c == nil || c.Token == nil { + return "" + } + return *c.Token +} + +// GetPrimaryServer returns the PrimaryServer field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsNTP) GetPrimaryServer() string { + if c == nil || c.PrimaryServer == nil { + return "" + } + return *c.PrimaryServer +} + +// GetSecondaryServer returns the SecondaryServer field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsNTP) GetSecondaryServer() string { + if c == nil || c.SecondaryServer == nil { + return "" + } + return *c.SecondaryServer +} + +// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsPagesSettings) GetEnabled() bool { + if c == nil || c.Enabled == nil { + return false + } + return *c.Enabled +} + +// GetCertificate returns the Certificate field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSAML) GetCertificate() string { + if c == nil || c.Certificate == nil { + return "" + } + return *c.Certificate +} + +// GetCertificatePath returns the CertificatePath field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSAML) GetCertificatePath() string { + if c == nil || c.CertificatePath == nil { + return "" + } + return *c.CertificatePath +} + +// GetDisableAdminDemote returns the DisableAdminDemote field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSAML) GetDisableAdminDemote() bool { + if c == nil || c.DisableAdminDemote == nil { + return false + } + return *c.DisableAdminDemote +} + +// GetIDPInitiatedSSO returns the IDPInitiatedSSO field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSAML) GetIDPInitiatedSSO() bool { + if c == nil || c.IDPInitiatedSSO == nil { + return false + } + return *c.IDPInitiatedSSO +} + +// GetIssuer returns the Issuer field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSAML) GetIssuer() string { + if c == nil || c.Issuer == nil { + return "" + } + return *c.Issuer +} + +// GetSSOURL returns the SSOURL field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSAML) GetSSOURL() string { + if c == nil || c.SSOURL == nil { + return "" + } + return *c.SSOURL +} + +// GetAddress returns the Address field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSMTP) GetAddress() string { + if c == nil || c.Address == nil { + return "" + } + return *c.Address +} + +// GetAuthentication returns the Authentication field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSMTP) GetAuthentication() string { + if c == nil || c.Authentication == nil { + return "" + } + return *c.Authentication +} + +// GetDiscardToNoreplyAddress returns the DiscardToNoreplyAddress field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSMTP) GetDiscardToNoreplyAddress() bool { + if c == nil || c.DiscardToNoreplyAddress == nil { + return false + } + return *c.DiscardToNoreplyAddress +} + +// GetDomain returns the Domain field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSMTP) GetDomain() string { + if c == nil || c.Domain == nil { + return "" + } + return *c.Domain +} + +// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSMTP) GetEnabled() bool { + if c == nil || c.Enabled == nil { + return false + } + return *c.Enabled +} + +// GetEnableStarttlsAuto returns the EnableStarttlsAuto field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSMTP) GetEnableStarttlsAuto() bool { + if c == nil || c.EnableStarttlsAuto == nil { + return false + } + return *c.EnableStarttlsAuto +} + +// GetNoreplyAddress returns the NoreplyAddress field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSMTP) GetNoreplyAddress() string { + if c == nil || c.NoreplyAddress == nil { + return "" + } + return *c.NoreplyAddress +} + +// GetPassword returns the Password field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSMTP) GetPassword() string { + if c == nil || c.Password == nil { + return "" + } + return *c.Password +} + +// GetPort returns the Port field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSMTP) GetPort() string { + if c == nil || c.Port == nil { + return "" + } + return *c.Port +} + +// GetSupportAddress returns the SupportAddress field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSMTP) GetSupportAddress() string { + if c == nil || c.SupportAddress == nil { + return "" + } + return *c.SupportAddress +} + +// GetSupportAddressType returns the SupportAddressType field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSMTP) GetSupportAddressType() string { + if c == nil || c.SupportAddressType == nil { + return "" + } + return *c.SupportAddressType +} + +// GetUsername returns the Username field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSMTP) GetUsername() string { + if c == nil || c.Username == nil { + return "" + } + return *c.Username +} + +// GetUserName returns the UserName field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSMTP) GetUserName() string { + if c == nil || c.UserName == nil { + return "" + } + return *c.UserName +} + +// GetCommunity returns the Community field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSNMP) GetCommunity() string { + if c == nil || c.Community == nil { + return "" + } + return *c.Community +} + +// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSNMP) GetEnabled() bool { + if c == nil || c.Enabled == nil { + return false + } + return *c.Enabled +} + +// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSyslog) GetEnabled() bool { + if c == nil || c.Enabled == nil { + return false + } + return *c.Enabled +} + +// GetProtocolName returns the ProtocolName field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSyslog) GetProtocolName() string { + if c == nil || c.ProtocolName == nil { return "" } - return *c.Description + return *c.ProtocolName } -// GetDocumentation returns the Documentation field if it's non-nil, zero value otherwise. -func (c *CommunityHealthMetrics) GetDocumentation() string { - if c == nil || c.Documentation == nil { +// GetServer returns the Server field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSyslog) GetServer() string { + if c == nil || c.Server == nil { return "" } - return *c.Documentation + return *c.Server } -// GetFiles returns the Files field. -func (c *CommunityHealthMetrics) GetFiles() *CommunityHealthFiles { - if c == nil { - return nil +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (c *ConnectionServiceItem) GetName() string { + if c == nil || c.Name == nil { + return "" } - return c.Files + return *c.Name } -// GetHealthPercentage returns the HealthPercentage field if it's non-nil, zero value otherwise. -func (c *CommunityHealthMetrics) GetHealthPercentage() int { - if c == nil || c.HealthPercentage == nil { +// GetNumber returns the Number field if it's non-nil, zero value otherwise. +func (c *ConnectionServiceItem) GetNumber() int { + if c == nil || c.Number == nil { return 0 } - return *c.HealthPercentage -} - -// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (c *CommunityHealthMetrics) GetUpdatedAt() Timestamp { - if c == nil || c.UpdatedAt == nil { - return Timestamp{} - } - return *c.UpdatedAt + return *c.Number } // GetID returns the ID field if it's non-nil, zero value otherwise. @@ -11638,6 +12798,158 @@ func (l *License) GetURL() string { return *l.URL } +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (l *LicenseCheck) GetStatus() string { + if l == nil || l.Status == nil { + return "" + } + return *l.Status +} + +// GetAdvancedSecurityEnabled returns the AdvancedSecurityEnabled field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetAdvancedSecurityEnabled() bool { + if l == nil || l.AdvancedSecurityEnabled == nil { + return false + } + return *l.AdvancedSecurityEnabled +} + +// GetAdvancedSecuritySeats returns the AdvancedSecuritySeats field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetAdvancedSecuritySeats() int { + if l == nil || l.AdvancedSecuritySeats == nil { + return 0 + } + return *l.AdvancedSecuritySeats +} + +// GetClusterSupport returns the ClusterSupport field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetClusterSupport() bool { + if l == nil || l.ClusterSupport == nil { + return false + } + return *l.ClusterSupport +} + +// GetCompany returns the Company field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetCompany() string { + if l == nil || l.Company == nil { + return "" + } + return *l.Company +} + +// GetCroquetSupport returns the CroquetSupport field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetCroquetSupport() bool { + if l == nil || l.CroquetSupport == nil { + return false + } + return *l.CroquetSupport +} + +// GetCustomTerms returns the CustomTerms field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetCustomTerms() bool { + if l == nil || l.CustomTerms == nil { + return false + } + return *l.CustomTerms +} + +// GetEvaluation returns the Evaluation field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetEvaluation() bool { + if l == nil || l.Evaluation == nil { + return false + } + return *l.Evaluation +} + +// GetExpireAt returns the ExpireAt field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetExpireAt() Timestamp { + if l == nil || l.ExpireAt == nil { + return Timestamp{} + } + return *l.ExpireAt +} + +// GetInsightsEnabled returns the InsightsEnabled field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetInsightsEnabled() bool { + if l == nil || l.InsightsEnabled == nil { + return false + } + return *l.InsightsEnabled +} + +// GetInsightsExpireAt returns the InsightsExpireAt field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetInsightsExpireAt() Timestamp { + if l == nil || l.InsightsExpireAt == nil { + return Timestamp{} + } + return *l.InsightsExpireAt +} + +// GetLearningLabEvaluationExpires returns the LearningLabEvaluationExpires field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetLearningLabEvaluationExpires() Timestamp { + if l == nil || l.LearningLabEvaluationExpires == nil { + return Timestamp{} + } + return *l.LearningLabEvaluationExpires +} + +// GetLearningLabSeats returns the LearningLabSeats field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetLearningLabSeats() int { + if l == nil || l.LearningLabSeats == nil { + return 0 + } + return *l.LearningLabSeats +} + +// GetPerpetual returns the Perpetual field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetPerpetual() bool { + if l == nil || l.Perpetual == nil { + return false + } + return *l.Perpetual +} + +// GetReferenceNumber returns the ReferenceNumber field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetReferenceNumber() string { + if l == nil || l.ReferenceNumber == nil { + return "" + } + return *l.ReferenceNumber +} + +// GetSeats returns the Seats field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetSeats() int { + if l == nil || l.Seats == nil { + return 0 + } + return *l.Seats +} + +// GetSSHAllowed returns the SSHAllowed field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetSSHAllowed() bool { + if l == nil || l.SSHAllowed == nil { + return false + } + return *l.SSHAllowed +} + +// GetSupportKey returns the SupportKey field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetSupportKey() string { + if l == nil || l.SupportKey == nil { + return "" + } + return *l.SupportKey +} + +// GetUnlimitedSeating returns the UnlimitedSeating field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetUnlimitedSeating() bool { + if l == nil || l.UnlimitedSeating == nil { + return false + } + return *l.UnlimitedSeating +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (l *LinearHistoryRequirementEnforcementLevelChanges) GetFrom() string { if l == nil || l.From == nil { @@ -11982,6 +13294,102 @@ func (l *LockBranch) GetEnabled() bool { return *l.Enabled } +// GetHostname returns the Hostname field if it's non-nil, zero value otherwise. +func (m *MaintenanceOperationStatus) GetHostname() string { + if m == nil || m.Hostname == nil { + return "" + } + return *m.Hostname +} + +// GetMessage returns the Message field if it's non-nil, zero value otherwise. +func (m *MaintenanceOperationStatus) GetMessage() string { + if m == nil || m.Message == nil { + return "" + } + return *m.Message +} + +// GetUUID returns the UUID field if it's non-nil, zero value otherwise. +func (m *MaintenanceOperationStatus) GetUUID() string { + if m == nil || m.UUID == nil { + return "" + } + return *m.UUID +} + +// GetMaintenanceModeMessage returns the MaintenanceModeMessage field if it's non-nil, zero value otherwise. +func (m *MaintenanceOptions) GetMaintenanceModeMessage() string { + if m == nil || m.MaintenanceModeMessage == nil { + return "" + } + return *m.MaintenanceModeMessage +} + +// GetUUID returns the UUID field if it's non-nil, zero value otherwise. +func (m *MaintenanceOptions) GetUUID() string { + if m == nil || m.UUID == nil { + return "" + } + return *m.UUID +} + +// GetWhen returns the When field if it's non-nil, zero value otherwise. +func (m *MaintenanceOptions) GetWhen() string { + if m == nil || m.When == nil { + return "" + } + return *m.When +} + +// GetCanUnsetMaintenance returns the CanUnsetMaintenance field if it's non-nil, zero value otherwise. +func (m *MaintenanceStatus) GetCanUnsetMaintenance() bool { + if m == nil || m.CanUnsetMaintenance == nil { + return false + } + return *m.CanUnsetMaintenance +} + +// GetHostname returns the Hostname field if it's non-nil, zero value otherwise. +func (m *MaintenanceStatus) GetHostname() string { + if m == nil || m.Hostname == nil { + return "" + } + return *m.Hostname +} + +// GetMaintenanceModeMessage returns the MaintenanceModeMessage field if it's non-nil, zero value otherwise. +func (m *MaintenanceStatus) GetMaintenanceModeMessage() string { + if m == nil || m.MaintenanceModeMessage == nil { + return "" + } + return *m.MaintenanceModeMessage +} + +// GetScheduledTime returns the ScheduledTime field if it's non-nil, zero value otherwise. +func (m *MaintenanceStatus) GetScheduledTime() Timestamp { + if m == nil || m.ScheduledTime == nil { + return Timestamp{} + } + return *m.ScheduledTime +} + +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (m *MaintenanceStatus) GetStatus() string { + if m == nil || m.Status == nil { + return "" + } + return *m.Status +} + +// GetUUID returns the UUID field if it's non-nil, zero value otherwise. +func (m *MaintenanceStatus) GetUUID() string { + if m == nil || m.UUID == nil { + return "" + } + return *m.UUID +} + // GetEffectiveDate returns the EffectiveDate field if it's non-nil, zero value otherwise. func (m *MarketplacePendingChange) GetEffectiveDate() Timestamp { if m == nil || m.EffectiveDate == nil { @@ -13222,6 +14630,62 @@ func (n *NewTeam) GetPrivacy() string { return *n.Privacy } +// GetHostname returns the Hostname field if it's non-nil, zero value otherwise. +func (n *NodeDetails) GetHostname() string { + if n == nil || n.Hostname == nil { + return "" + } + return *n.Hostname +} + +// GetUUID returns the UUID field if it's non-nil, zero value otherwise. +func (n *NodeDetails) GetUUID() string { + if n == nil || n.UUID == nil { + return "" + } + return *n.UUID +} + +// GetTopology returns the Topology field if it's non-nil, zero value otherwise. +func (n *NodeMetadataStatus) GetTopology() string { + if n == nil || n.Topology == nil { + return "" + } + return *n.Topology +} + +// GetClusterRoles returns the ClusterRoles field if it's non-nil, zero value otherwise. +func (n *NodeQueryOptions) GetClusterRoles() string { + if n == nil || n.ClusterRoles == nil { + return "" + } + return *n.ClusterRoles +} + +// GetUUID returns the UUID field if it's non-nil, zero value otherwise. +func (n *NodeQueryOptions) GetUUID() string { + if n == nil || n.UUID == nil { + return "" + } + return *n.UUID +} + +// GetHostname returns the Hostname field if it's non-nil, zero value otherwise. +func (n *NodeReleaseVersion) GetHostname() string { + if n == nil || n.Hostname == nil { + return "" + } + return *n.Hostname +} + +// GetVersion returns the Version field. +func (n *NodeReleaseVersion) GetVersion() *ReleaseVersion { + if n == nil { + return nil + } + return n.Version +} + // GetID returns the ID field if it's non-nil, zero value otherwise. func (n *Notification) GetID() string { if n == nil || n.ID == nil { @@ -18846,6 +20310,38 @@ func (r *ReleaseEvent) GetSender() *User { return r.Sender } +// GetBuildDate returns the BuildDate field if it's non-nil, zero value otherwise. +func (r *ReleaseVersion) GetBuildDate() string { + if r == nil || r.BuildDate == nil { + return "" + } + return *r.BuildDate +} + +// GetBuildID returns the BuildID field if it's non-nil, zero value otherwise. +func (r *ReleaseVersion) GetBuildID() string { + if r == nil || r.BuildID == nil { + return "" + } + return *r.BuildID +} + +// GetPlatform returns the Platform field if it's non-nil, zero value otherwise. +func (r *ReleaseVersion) GetPlatform() string { + if r == nil || r.Platform == nil { + return "" + } + return *r.Platform +} + +// GetVersion returns the Version field if it's non-nil, zero value otherwise. +func (r *ReleaseVersion) GetVersion() string { + if r == nil || r.Version == nil { + return "" + } + return *r.Version +} + // GetExpiresAt returns the ExpiresAt field if it's non-nil, zero value otherwise. func (r *RemoveToken) GetExpiresAt() Timestamp { if r == nil || r.ExpiresAt == nil { @@ -23566,6 +25062,38 @@ func (s *SponsorshipTier) GetFrom() string { return *s.From } +// GetHostname returns the Hostname field if it's non-nil, zero value otherwise. +func (s *SSHKeyStatus) GetHostname() string { + if s == nil || s.Hostname == nil { + return "" + } + return *s.Hostname +} + +// GetMessage returns the Message field if it's non-nil, zero value otherwise. +func (s *SSHKeyStatus) GetMessage() string { + if s == nil || s.Message == nil { + return "" + } + return *s.Message +} + +// GetModified returns the Modified field if it's non-nil, zero value otherwise. +func (s *SSHKeyStatus) GetModified() bool { + if s == nil || s.Modified == nil { + return false + } + return *s.Modified +} + +// GetUUID returns the UUID field if it's non-nil, zero value otherwise. +func (s *SSHKeyStatus) GetUUID() string { + if s == nil || s.UUID == nil { + return "" + } + return *s.UUID +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (s *SSHSigningKey) GetCreatedAt() Timestamp { if s == nil || s.CreatedAt == nil { @@ -23846,6 +25374,46 @@ func (s *Subscription) GetURL() string { return *s.URL } +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (s *SystemRequirements) GetStatus() string { + if s == nil || s.Status == nil { + return "" + } + return *s.Status +} + +// GetHostname returns the Hostname field if it's non-nil, zero value otherwise. +func (s *SystemRequirementsNode) GetHostname() string { + if s == nil || s.Hostname == nil { + return "" + } + return *s.Hostname +} + +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (s *SystemRequirementsNode) GetStatus() string { + if s == nil || s.Status == nil { + return "" + } + return *s.Status +} + +// GetRole returns the Role field if it's non-nil, zero value otherwise. +func (s *SystemRequirementsNodeRoleStatus) GetRole() string { + if s == nil || s.Role == nil { + return "" + } + return *s.Role +} + +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (s *SystemRequirementsNodeRoleStatus) GetStatus() string { + if s == nil || s.Status == nil { + return "" + } + return *s.Status +} + // GetMessage returns the Message field if it's non-nil, zero value otherwise. func (t *Tag) GetMessage() string { if t == nil || t.Message == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index db3da5ba72d..5c689f83b24 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -3195,6 +3195,94 @@ func TestCheckSuitePreferenceResults_GetRepository(tt *testing.T) { c.GetRepository() } +func TestClusterSSHKey_GetFingerprint(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ClusterSSHKey{Fingerprint: &zeroValue} + c.GetFingerprint() + c = &ClusterSSHKey{} + c.GetFingerprint() + c = nil + c.GetFingerprint() +} + +func TestClusterSSHKey_GetKey(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ClusterSSHKey{Key: &zeroValue} + c.GetKey() + c = &ClusterSSHKey{} + c.GetKey() + c = nil + c.GetKey() +} + +func TestClusterStatus_GetStatus(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ClusterStatus{Status: &zeroValue} + c.GetStatus() + c = &ClusterStatus{} + c.GetStatus() + c = nil + c.GetStatus() +} + +func TestClusterStatusNode_GetHostname(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ClusterStatusNode{Hostname: &zeroValue} + c.GetHostname() + c = &ClusterStatusNode{} + c.GetHostname() + c = nil + c.GetHostname() +} + +func TestClusterStatusNode_GetStatus(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ClusterStatusNode{Status: &zeroValue} + c.GetStatus() + c = &ClusterStatusNode{} + c.GetStatus() + c = nil + c.GetStatus() +} + +func TestClusterStatusNodeServiceItem_GetDetails(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ClusterStatusNodeServiceItem{Details: &zeroValue} + c.GetDetails() + c = &ClusterStatusNodeServiceItem{} + c.GetDetails() + c = nil + c.GetDetails() +} + +func TestClusterStatusNodeServiceItem_GetName(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ClusterStatusNodeServiceItem{Name: &zeroValue} + c.GetName() + c = &ClusterStatusNodeServiceItem{} + c.GetName() + c = nil + c.GetName() +} + +func TestClusterStatusNodeServiceItem_GetStatus(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ClusterStatusNodeServiceItem{Status: &zeroValue} + c.GetStatus() + c = &ClusterStatusNodeServiceItem{} + c.GetStatus() + c = nil + c.GetStatus() +} + func TestCodeOfConduct_GetBody(tt *testing.T) { tt.Parallel() var zeroValue string @@ -5086,148 +5174,1604 @@ func TestCommitStats_GetAdditions(tt *testing.T) { c = &CommitStats{} c.GetAdditions() c = nil - c.GetAdditions() + c.GetAdditions() +} + +func TestCommitStats_GetDeletions(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CommitStats{Deletions: &zeroValue} + c.GetDeletions() + c = &CommitStats{} + c.GetDeletions() + c = nil + c.GetDeletions() +} + +func TestCommitStats_GetTotal(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CommitStats{Total: &zeroValue} + c.GetTotal() + c = &CommitStats{} + c.GetTotal() + c = nil + c.GetTotal() +} + +func TestCommunityHealthFiles_GetCodeOfConduct(tt *testing.T) { + tt.Parallel() + c := &CommunityHealthFiles{} + c.GetCodeOfConduct() + c = nil + c.GetCodeOfConduct() +} + +func TestCommunityHealthFiles_GetCodeOfConductFile(tt *testing.T) { + tt.Parallel() + c := &CommunityHealthFiles{} + c.GetCodeOfConductFile() + c = nil + c.GetCodeOfConductFile() +} + +func TestCommunityHealthFiles_GetContributing(tt *testing.T) { + tt.Parallel() + c := &CommunityHealthFiles{} + c.GetContributing() + c = nil + c.GetContributing() +} + +func TestCommunityHealthFiles_GetIssueTemplate(tt *testing.T) { + tt.Parallel() + c := &CommunityHealthFiles{} + c.GetIssueTemplate() + c = nil + c.GetIssueTemplate() +} + +func TestCommunityHealthFiles_GetLicense(tt *testing.T) { + tt.Parallel() + c := &CommunityHealthFiles{} + c.GetLicense() + c = nil + c.GetLicense() +} + +func TestCommunityHealthFiles_GetPullRequestTemplate(tt *testing.T) { + tt.Parallel() + c := &CommunityHealthFiles{} + c.GetPullRequestTemplate() + c = nil + c.GetPullRequestTemplate() +} + +func TestCommunityHealthFiles_GetReadme(tt *testing.T) { + tt.Parallel() + c := &CommunityHealthFiles{} + c.GetReadme() + c = nil + c.GetReadme() +} + +func TestCommunityHealthMetrics_GetContentReportsEnabled(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &CommunityHealthMetrics{ContentReportsEnabled: &zeroValue} + c.GetContentReportsEnabled() + c = &CommunityHealthMetrics{} + c.GetContentReportsEnabled() + c = nil + c.GetContentReportsEnabled() +} + +func TestCommunityHealthMetrics_GetDescription(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CommunityHealthMetrics{Description: &zeroValue} + c.GetDescription() + c = &CommunityHealthMetrics{} + c.GetDescription() + c = nil + c.GetDescription() +} + +func TestCommunityHealthMetrics_GetDocumentation(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CommunityHealthMetrics{Documentation: &zeroValue} + c.GetDocumentation() + c = &CommunityHealthMetrics{} + c.GetDocumentation() + c = nil + c.GetDocumentation() +} + +func TestCommunityHealthMetrics_GetFiles(tt *testing.T) { + tt.Parallel() + c := &CommunityHealthMetrics{} + c.GetFiles() + c = nil + c.GetFiles() +} + +func TestCommunityHealthMetrics_GetHealthPercentage(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CommunityHealthMetrics{HealthPercentage: &zeroValue} + c.GetHealthPercentage() + c = &CommunityHealthMetrics{} + c.GetHealthPercentage() + c = nil + c.GetHealthPercentage() +} + +func TestCommunityHealthMetrics_GetUpdatedAt(tt *testing.T) { + tt.Parallel() + var zeroValue Timestamp + c := &CommunityHealthMetrics{UpdatedAt: &zeroValue} + c.GetUpdatedAt() + c = &CommunityHealthMetrics{} + c.GetUpdatedAt() + c = nil + c.GetUpdatedAt() +} + +func TestConfigApplyEventsNode_GetLastRequestID(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigApplyEventsNode{LastRequestID: &zeroValue} + c.GetLastRequestID() + c = &ConfigApplyEventsNode{} + c.GetLastRequestID() + c = nil + c.GetLastRequestID() +} + +func TestConfigApplyEventsNode_GetNode(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigApplyEventsNode{Node: &zeroValue} + c.GetNode() + c = &ConfigApplyEventsNode{} + c.GetNode() + c = nil + c.GetNode() +} + +func TestConfigApplyEventsNodeEvent_GetBody(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigApplyEventsNodeEvent{Body: &zeroValue} + c.GetBody() + c = &ConfigApplyEventsNodeEvent{} + c.GetBody() + c = nil + c.GetBody() +} + +func TestConfigApplyEventsNodeEvent_GetConfigRunID(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigApplyEventsNodeEvent{ConfigRunID: &zeroValue} + c.GetConfigRunID() + c = &ConfigApplyEventsNodeEvent{} + c.GetConfigRunID() + c = nil + c.GetConfigRunID() +} + +func TestConfigApplyEventsNodeEvent_GetEventName(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigApplyEventsNodeEvent{EventName: &zeroValue} + c.GetEventName() + c = &ConfigApplyEventsNodeEvent{} + c.GetEventName() + c = nil + c.GetEventName() +} + +func TestConfigApplyEventsNodeEvent_GetHostname(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigApplyEventsNodeEvent{Hostname: &zeroValue} + c.GetHostname() + c = &ConfigApplyEventsNodeEvent{} + c.GetHostname() + c = nil + c.GetHostname() +} + +func TestConfigApplyEventsNodeEvent_GetSeverityText(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigApplyEventsNodeEvent{SeverityText: &zeroValue} + c.GetSeverityText() + c = &ConfigApplyEventsNodeEvent{} + c.GetSeverityText() + c = nil + c.GetSeverityText() +} + +func TestConfigApplyEventsNodeEvent_GetSpanDepth(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &ConfigApplyEventsNodeEvent{SpanDepth: &zeroValue} + c.GetSpanDepth() + c = &ConfigApplyEventsNodeEvent{} + c.GetSpanDepth() + c = nil + c.GetSpanDepth() +} + +func TestConfigApplyEventsNodeEvent_GetSpanID(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigApplyEventsNodeEvent{SpanID: &zeroValue} + c.GetSpanID() + c = &ConfigApplyEventsNodeEvent{} + c.GetSpanID() + c = nil + c.GetSpanID() +} + +func TestConfigApplyEventsNodeEvent_GetSpanParentID(tt *testing.T) { + tt.Parallel() + var zeroValue int64 + c := &ConfigApplyEventsNodeEvent{SpanParentID: &zeroValue} + c.GetSpanParentID() + c = &ConfigApplyEventsNodeEvent{} + c.GetSpanParentID() + c = nil + c.GetSpanParentID() +} + +func TestConfigApplyEventsNodeEvent_GetTimestamp(tt *testing.T) { + tt.Parallel() + var zeroValue Timestamp + c := &ConfigApplyEventsNodeEvent{Timestamp: &zeroValue} + c.GetTimestamp() + c = &ConfigApplyEventsNodeEvent{} + c.GetTimestamp() + c = nil + c.GetTimestamp() +} + +func TestConfigApplyEventsNodeEvent_GetTopology(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigApplyEventsNodeEvent{Topology: &zeroValue} + c.GetTopology() + c = &ConfigApplyEventsNodeEvent{} + c.GetTopology() + c = nil + c.GetTopology() +} + +func TestConfigApplyEventsNodeEvent_GetTraceID(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigApplyEventsNodeEvent{TraceID: &zeroValue} + c.GetTraceID() + c = &ConfigApplyEventsNodeEvent{} + c.GetTraceID() + c = nil + c.GetTraceID() +} + +func TestConfigApplyEventsOptions_GetLastRequestID(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigApplyEventsOptions{LastRequestID: &zeroValue} + c.GetLastRequestID() + c = &ConfigApplyEventsOptions{} + c.GetLastRequestID() + c = nil + c.GetLastRequestID() +} + +func TestConfigApplyOptions_GetRunID(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigApplyOptions{RunID: &zeroValue} + c.GetRunID() + c = &ConfigApplyOptions{} + c.GetRunID() + c = nil + c.GetRunID() +} + +func TestConfigApplyStatus_GetRunning(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &ConfigApplyStatus{Running: &zeroValue} + c.GetRunning() + c = &ConfigApplyStatus{} + c.GetRunning() + c = nil + c.GetRunning() +} + +func TestConfigApplyStatus_GetSuccessful(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &ConfigApplyStatus{Successful: &zeroValue} + c.GetSuccessful() + c = &ConfigApplyStatus{} + c.GetSuccessful() + c = nil + c.GetSuccessful() +} + +func TestConfigApplyStatusNode_GetHostname(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigApplyStatusNode{Hostname: &zeroValue} + c.GetHostname() + c = &ConfigApplyStatusNode{} + c.GetHostname() + c = nil + c.GetHostname() +} + +func TestConfigApplyStatusNode_GetRunID(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigApplyStatusNode{RunID: &zeroValue} + c.GetRunID() + c = &ConfigApplyStatusNode{} + c.GetRunID() + c = nil + c.GetRunID() +} + +func TestConfigApplyStatusNode_GetRunning(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &ConfigApplyStatusNode{Running: &zeroValue} + c.GetRunning() + c = &ConfigApplyStatusNode{} + c.GetRunning() + c = nil + c.GetRunning() +} + +func TestConfigApplyStatusNode_GetSuccessful(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &ConfigApplyStatusNode{Successful: &zeroValue} + c.GetSuccessful() + c = &ConfigApplyStatusNode{} + c.GetSuccessful() + c = nil + c.GetSuccessful() +} + +func TestConfigSettings_GetAdminPassword(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettings{AdminPassword: &zeroValue} + c.GetAdminPassword() + c = &ConfigSettings{} + c.GetAdminPassword() + c = nil + c.GetAdminPassword() +} + +func TestConfigSettings_GetAssets(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettings{Assets: &zeroValue} + c.GetAssets() + c = &ConfigSettings{} + c.GetAssets() + c = nil + c.GetAssets() +} + +func TestConfigSettings_GetAuthMode(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettings{AuthMode: &zeroValue} + c.GetAuthMode() + c = &ConfigSettings{} + c.GetAuthMode() + c = nil + c.GetAuthMode() +} + +func TestConfigSettings_GetAvatar(tt *testing.T) { + tt.Parallel() + c := &ConfigSettings{} + c.GetAvatar() + c = nil + c.GetAvatar() +} + +func TestConfigSettings_GetCAS(tt *testing.T) { + tt.Parallel() + c := &ConfigSettings{} + c.GetCAS() + c = nil + c.GetCAS() +} + +func TestConfigSettings_GetCollectd(tt *testing.T) { + tt.Parallel() + c := &ConfigSettings{} + c.GetCollectd() + c = nil + c.GetCollectd() +} + +func TestConfigSettings_GetConfigurationID(tt *testing.T) { + tt.Parallel() + var zeroValue int64 + c := &ConfigSettings{ConfigurationID: &zeroValue} + c.GetConfigurationID() + c = &ConfigSettings{} + c.GetConfigurationID() + c = nil + c.GetConfigurationID() +} + +func TestConfigSettings_GetConfigurationRunCount(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &ConfigSettings{ConfigurationRunCount: &zeroValue} + c.GetConfigurationRunCount() + c = &ConfigSettings{} + c.GetConfigurationRunCount() + c = nil + c.GetConfigurationRunCount() +} + +func TestConfigSettings_GetCustomer(tt *testing.T) { + tt.Parallel() + c := &ConfigSettings{} + c.GetCustomer() + c = nil + c.GetCustomer() +} + +func TestConfigSettings_GetExpireSessions(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &ConfigSettings{ExpireSessions: &zeroValue} + c.GetExpireSessions() + c = &ConfigSettings{} + c.GetExpireSessions() + c = nil + c.GetExpireSessions() +} + +func TestConfigSettings_GetGithubHostname(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettings{GithubHostname: &zeroValue} + c.GetGithubHostname() + c = &ConfigSettings{} + c.GetGithubHostname() + c = nil + c.GetGithubHostname() +} + +func TestConfigSettings_GetGithubOAuth(tt *testing.T) { + tt.Parallel() + c := &ConfigSettings{} + c.GetGithubOAuth() + c = nil + c.GetGithubOAuth() +} + +func TestConfigSettings_GetGithubSSL(tt *testing.T) { + tt.Parallel() + c := &ConfigSettings{} + c.GetGithubSSL() + c = nil + c.GetGithubSSL() +} + +func TestConfigSettings_GetHTTPProxy(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettings{HTTPProxy: &zeroValue} + c.GetHTTPProxy() + c = &ConfigSettings{} + c.GetHTTPProxy() + c = nil + c.GetHTTPProxy() +} + +func TestConfigSettings_GetIdenticonsHost(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettings{IdenticonsHost: &zeroValue} + c.GetIdenticonsHost() + c = &ConfigSettings{} + c.GetIdenticonsHost() + c = nil + c.GetIdenticonsHost() +} + +func TestConfigSettings_GetLDAP(tt *testing.T) { + tt.Parallel() + c := &ConfigSettings{} + c.GetLDAP() + c = nil + c.GetLDAP() +} + +func TestConfigSettings_GetLicense(tt *testing.T) { + tt.Parallel() + c := &ConfigSettings{} + c.GetLicense() + c = nil + c.GetLicense() +} + +func TestConfigSettings_GetLoadBalancer(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettings{LoadBalancer: &zeroValue} + c.GetLoadBalancer() + c = &ConfigSettings{} + c.GetLoadBalancer() + c = nil + c.GetLoadBalancer() +} + +func TestConfigSettings_GetMapping(tt *testing.T) { + tt.Parallel() + c := &ConfigSettings{} + c.GetMapping() + c = nil + c.GetMapping() +} + +func TestConfigSettings_GetNTP(tt *testing.T) { + tt.Parallel() + c := &ConfigSettings{} + c.GetNTP() + c = nil + c.GetNTP() +} + +func TestConfigSettings_GetPages(tt *testing.T) { + tt.Parallel() + c := &ConfigSettings{} + c.GetPages() + c = nil + c.GetPages() +} + +func TestConfigSettings_GetPrivateMode(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &ConfigSettings{PrivateMode: &zeroValue} + c.GetPrivateMode() + c = &ConfigSettings{} + c.GetPrivateMode() + c = nil + c.GetPrivateMode() +} + +func TestConfigSettings_GetPublicPages(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &ConfigSettings{PublicPages: &zeroValue} + c.GetPublicPages() + c = &ConfigSettings{} + c.GetPublicPages() + c = nil + c.GetPublicPages() +} + +func TestConfigSettings_GetSAML(tt *testing.T) { + tt.Parallel() + c := &ConfigSettings{} + c.GetSAML() + c = nil + c.GetSAML() +} + +func TestConfigSettings_GetSignupEnabled(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &ConfigSettings{SignupEnabled: &zeroValue} + c.GetSignupEnabled() + c = &ConfigSettings{} + c.GetSignupEnabled() + c = nil + c.GetSignupEnabled() +} + +func TestConfigSettings_GetSMTP(tt *testing.T) { + tt.Parallel() + c := &ConfigSettings{} + c.GetSMTP() + c = nil + c.GetSMTP() +} + +func TestConfigSettings_GetSNMP(tt *testing.T) { + tt.Parallel() + c := &ConfigSettings{} + c.GetSNMP() + c = nil + c.GetSNMP() +} + +func TestConfigSettings_GetSubdomainIsolation(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &ConfigSettings{SubdomainIsolation: &zeroValue} + c.GetSubdomainIsolation() + c = &ConfigSettings{} + c.GetSubdomainIsolation() + c = nil + c.GetSubdomainIsolation() +} + +func TestConfigSettings_GetSyslog(tt *testing.T) { + tt.Parallel() + c := &ConfigSettings{} + c.GetSyslog() + c = nil + c.GetSyslog() +} + +func TestConfigSettings_GetTimezone(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettings{Timezone: &zeroValue} + c.GetTimezone() + c = &ConfigSettings{} + c.GetTimezone() + c = nil + c.GetTimezone() +} + +func TestConfigSettingsAvatar_GetEnabled(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &ConfigSettingsAvatar{Enabled: &zeroValue} + c.GetEnabled() + c = &ConfigSettingsAvatar{} + c.GetEnabled() + c = nil + c.GetEnabled() +} + +func TestConfigSettingsAvatar_GetURI(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsAvatar{URI: &zeroValue} + c.GetURI() + c = &ConfigSettingsAvatar{} + c.GetURI() + c = nil + c.GetURI() +} + +func TestConfigSettingsCAS_GetURL(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsCAS{URL: &zeroValue} + c.GetURL() + c = &ConfigSettingsCAS{} + c.GetURL() + c = nil + c.GetURL() +} + +func TestConfigSettingsCollectd_GetEnabled(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &ConfigSettingsCollectd{Enabled: &zeroValue} + c.GetEnabled() + c = &ConfigSettingsCollectd{} + c.GetEnabled() + c = nil + c.GetEnabled() +} + +func TestConfigSettingsCollectd_GetEncryption(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsCollectd{Encryption: &zeroValue} + c.GetEncryption() + c = &ConfigSettingsCollectd{} + c.GetEncryption() + c = nil + c.GetEncryption() +} + +func TestConfigSettingsCollectd_GetPassword(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsCollectd{Password: &zeroValue} + c.GetPassword() + c = &ConfigSettingsCollectd{} + c.GetPassword() + c = nil + c.GetPassword() +} + +func TestConfigSettingsCollectd_GetPort(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &ConfigSettingsCollectd{Port: &zeroValue} + c.GetPort() + c = &ConfigSettingsCollectd{} + c.GetPort() + c = nil + c.GetPort() +} + +func TestConfigSettingsCollectd_GetServer(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsCollectd{Server: &zeroValue} + c.GetServer() + c = &ConfigSettingsCollectd{} + c.GetServer() + c = nil + c.GetServer() +} + +func TestConfigSettingsCollectd_GetUsername(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsCollectd{Username: &zeroValue} + c.GetUsername() + c = &ConfigSettingsCollectd{} + c.GetUsername() + c = nil + c.GetUsername() +} + +func TestConfigSettingsCustomer_GetEmail(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsCustomer{Email: &zeroValue} + c.GetEmail() + c = &ConfigSettingsCustomer{} + c.GetEmail() + c = nil + c.GetEmail() +} + +func TestConfigSettingsCustomer_GetName(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsCustomer{Name: &zeroValue} + c.GetName() + c = &ConfigSettingsCustomer{} + c.GetName() + c = nil + c.GetName() +} + +func TestConfigSettingsCustomer_GetPublicKeyData(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsCustomer{PublicKeyData: &zeroValue} + c.GetPublicKeyData() + c = &ConfigSettingsCustomer{} + c.GetPublicKeyData() + c = nil + c.GetPublicKeyData() +} + +func TestConfigSettingsCustomer_GetSecret(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsCustomer{Secret: &zeroValue} + c.GetSecret() + c = &ConfigSettingsCustomer{} + c.GetSecret() + c = nil + c.GetSecret() +} + +func TestConfigSettingsCustomer_GetUUID(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsCustomer{UUID: &zeroValue} + c.GetUUID() + c = &ConfigSettingsCustomer{} + c.GetUUID() + c = nil + c.GetUUID() +} + +func TestConfigSettingsGithubOAuth_GetClientID(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsGithubOAuth{ClientID: &zeroValue} + c.GetClientID() + c = &ConfigSettingsGithubOAuth{} + c.GetClientID() + c = nil + c.GetClientID() +} + +func TestConfigSettingsGithubOAuth_GetClientSecret(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsGithubOAuth{ClientSecret: &zeroValue} + c.GetClientSecret() + c = &ConfigSettingsGithubOAuth{} + c.GetClientSecret() + c = nil + c.GetClientSecret() +} + +func TestConfigSettingsGithubOAuth_GetOrganizationName(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsGithubOAuth{OrganizationName: &zeroValue} + c.GetOrganizationName() + c = &ConfigSettingsGithubOAuth{} + c.GetOrganizationName() + c = nil + c.GetOrganizationName() +} + +func TestConfigSettingsGithubOAuth_GetOrganizationTeam(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsGithubOAuth{OrganizationTeam: &zeroValue} + c.GetOrganizationTeam() + c = &ConfigSettingsGithubOAuth{} + c.GetOrganizationTeam() + c = nil + c.GetOrganizationTeam() +} + +func TestConfigSettingsGithubSSL_GetCert(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsGithubSSL{Cert: &zeroValue} + c.GetCert() + c = &ConfigSettingsGithubSSL{} + c.GetCert() + c = nil + c.GetCert() +} + +func TestConfigSettingsGithubSSL_GetEnabled(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &ConfigSettingsGithubSSL{Enabled: &zeroValue} + c.GetEnabled() + c = &ConfigSettingsGithubSSL{} + c.GetEnabled() + c = nil + c.GetEnabled() +} + +func TestConfigSettingsGithubSSL_GetKey(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsGithubSSL{Key: &zeroValue} + c.GetKey() + c = &ConfigSettingsGithubSSL{} + c.GetKey() + c = nil + c.GetKey() +} + +func TestConfigSettingsLDAP_GetAdminGroup(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsLDAP{AdminGroup: &zeroValue} + c.GetAdminGroup() + c = &ConfigSettingsLDAP{} + c.GetAdminGroup() + c = nil + c.GetAdminGroup() +} + +func TestConfigSettingsLDAP_GetBindDN(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsLDAP{BindDN: &zeroValue} + c.GetBindDN() + c = &ConfigSettingsLDAP{} + c.GetBindDN() + c = nil + c.GetBindDN() +} + +func TestConfigSettingsLDAP_GetHost(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsLDAP{Host: &zeroValue} + c.GetHost() + c = &ConfigSettingsLDAP{} + c.GetHost() + c = nil + c.GetHost() +} + +func TestConfigSettingsLDAP_GetMethod(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsLDAP{Method: &zeroValue} + c.GetMethod() + c = &ConfigSettingsLDAP{} + c.GetMethod() + c = nil + c.GetMethod() +} + +func TestConfigSettingsLDAP_GetPassword(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsLDAP{Password: &zeroValue} + c.GetPassword() + c = &ConfigSettingsLDAP{} + c.GetPassword() + c = nil + c.GetPassword() +} + +func TestConfigSettingsLDAP_GetPort(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &ConfigSettingsLDAP{Port: &zeroValue} + c.GetPort() + c = &ConfigSettingsLDAP{} + c.GetPort() + c = nil + c.GetPort() +} + +func TestConfigSettingsLDAP_GetPosixSupport(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &ConfigSettingsLDAP{PosixSupport: &zeroValue} + c.GetPosixSupport() + c = &ConfigSettingsLDAP{} + c.GetPosixSupport() + c = nil + c.GetPosixSupport() +} + +func TestConfigSettingsLDAP_GetProfile(tt *testing.T) { + tt.Parallel() + c := &ConfigSettingsLDAP{} + c.GetProfile() + c = nil + c.GetProfile() +} + +func TestConfigSettingsLDAP_GetReconciliation(tt *testing.T) { + tt.Parallel() + c := &ConfigSettingsLDAP{} + c.GetReconciliation() + c = nil + c.GetReconciliation() +} + +func TestConfigSettingsLDAP_GetRecursiveGroupSearch(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &ConfigSettingsLDAP{RecursiveGroupSearch: &zeroValue} + c.GetRecursiveGroupSearch() + c = &ConfigSettingsLDAP{} + c.GetRecursiveGroupSearch() + c = nil + c.GetRecursiveGroupSearch() +} + +func TestConfigSettingsLDAP_GetSearchStrategy(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsLDAP{SearchStrategy: &zeroValue} + c.GetSearchStrategy() + c = &ConfigSettingsLDAP{} + c.GetSearchStrategy() + c = nil + c.GetSearchStrategy() +} + +func TestConfigSettingsLDAP_GetSyncEnabled(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &ConfigSettingsLDAP{SyncEnabled: &zeroValue} + c.GetSyncEnabled() + c = &ConfigSettingsLDAP{} + c.GetSyncEnabled() + c = nil + c.GetSyncEnabled() +} + +func TestConfigSettingsLDAP_GetTeamSyncInterval(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &ConfigSettingsLDAP{TeamSyncInterval: &zeroValue} + c.GetTeamSyncInterval() + c = &ConfigSettingsLDAP{} + c.GetTeamSyncInterval() + c = nil + c.GetTeamSyncInterval() +} + +func TestConfigSettingsLDAP_GetUID(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsLDAP{UID: &zeroValue} + c.GetUID() + c = &ConfigSettingsLDAP{} + c.GetUID() + c = nil + c.GetUID() +} + +func TestConfigSettingsLDAP_GetUserSyncEmails(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &ConfigSettingsLDAP{UserSyncEmails: &zeroValue} + c.GetUserSyncEmails() + c = &ConfigSettingsLDAP{} + c.GetUserSyncEmails() + c = nil + c.GetUserSyncEmails() +} + +func TestConfigSettingsLDAP_GetUserSyncInterval(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &ConfigSettingsLDAP{UserSyncInterval: &zeroValue} + c.GetUserSyncInterval() + c = &ConfigSettingsLDAP{} + c.GetUserSyncInterval() + c = nil + c.GetUserSyncInterval() +} + +func TestConfigSettingsLDAP_GetUserSyncKeys(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &ConfigSettingsLDAP{UserSyncKeys: &zeroValue} + c.GetUserSyncKeys() + c = &ConfigSettingsLDAP{} + c.GetUserSyncKeys() + c = nil + c.GetUserSyncKeys() +} + +func TestConfigSettingsLDAP_GetVirtualAttributeEnabled(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &ConfigSettingsLDAP{VirtualAttributeEnabled: &zeroValue} + c.GetVirtualAttributeEnabled() + c = &ConfigSettingsLDAP{} + c.GetVirtualAttributeEnabled() + c = nil + c.GetVirtualAttributeEnabled() +} + +func TestConfigSettingsLDAPProfile_GetKey(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsLDAPProfile{Key: &zeroValue} + c.GetKey() + c = &ConfigSettingsLDAPProfile{} + c.GetKey() + c = nil + c.GetKey() +} + +func TestConfigSettingsLDAPProfile_GetMail(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsLDAPProfile{Mail: &zeroValue} + c.GetMail() + c = &ConfigSettingsLDAPProfile{} + c.GetMail() + c = nil + c.GetMail() +} + +func TestConfigSettingsLDAPProfile_GetName(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsLDAPProfile{Name: &zeroValue} + c.GetName() + c = &ConfigSettingsLDAPProfile{} + c.GetName() + c = nil + c.GetName() +} + +func TestConfigSettingsLDAPProfile_GetUID(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsLDAPProfile{UID: &zeroValue} + c.GetUID() + c = &ConfigSettingsLDAPProfile{} + c.GetUID() + c = nil + c.GetUID() +} + +func TestConfigSettingsLDAPReconciliation_GetOrg(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsLDAPReconciliation{Org: &zeroValue} + c.GetOrg() + c = &ConfigSettingsLDAPReconciliation{} + c.GetOrg() + c = nil + c.GetOrg() +} + +func TestConfigSettingsLDAPReconciliation_GetUser(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsLDAPReconciliation{User: &zeroValue} + c.GetUser() + c = &ConfigSettingsLDAPReconciliation{} + c.GetUser() + c = nil + c.GetUser() +} + +func TestConfigSettingsLicenseSettings_GetClusterSupport(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &ConfigSettingsLicenseSettings{ClusterSupport: &zeroValue} + c.GetClusterSupport() + c = &ConfigSettingsLicenseSettings{} + c.GetClusterSupport() + c = nil + c.GetClusterSupport() +} + +func TestConfigSettingsLicenseSettings_GetEvaluation(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &ConfigSettingsLicenseSettings{Evaluation: &zeroValue} + c.GetEvaluation() + c = &ConfigSettingsLicenseSettings{} + c.GetEvaluation() + c = nil + c.GetEvaluation() +} + +func TestConfigSettingsLicenseSettings_GetExpireAt(tt *testing.T) { + tt.Parallel() + var zeroValue Timestamp + c := &ConfigSettingsLicenseSettings{ExpireAt: &zeroValue} + c.GetExpireAt() + c = &ConfigSettingsLicenseSettings{} + c.GetExpireAt() + c = nil + c.GetExpireAt() +} + +func TestConfigSettingsLicenseSettings_GetPerpetual(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &ConfigSettingsLicenseSettings{Perpetual: &zeroValue} + c.GetPerpetual() + c = &ConfigSettingsLicenseSettings{} + c.GetPerpetual() + c = nil + c.GetPerpetual() +} + +func TestConfigSettingsLicenseSettings_GetSeats(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &ConfigSettingsLicenseSettings{Seats: &zeroValue} + c.GetSeats() + c = &ConfigSettingsLicenseSettings{} + c.GetSeats() + c = nil + c.GetSeats() +} + +func TestConfigSettingsLicenseSettings_GetSSHAllowed(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &ConfigSettingsLicenseSettings{SSHAllowed: &zeroValue} + c.GetSSHAllowed() + c = &ConfigSettingsLicenseSettings{} + c.GetSSHAllowed() + c = nil + c.GetSSHAllowed() +} + +func TestConfigSettingsLicenseSettings_GetSupportKey(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsLicenseSettings{SupportKey: &zeroValue} + c.GetSupportKey() + c = &ConfigSettingsLicenseSettings{} + c.GetSupportKey() + c = nil + c.GetSupportKey() +} + +func TestConfigSettingsLicenseSettings_GetUnlimitedSeating(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &ConfigSettingsLicenseSettings{UnlimitedSeating: &zeroValue} + c.GetUnlimitedSeating() + c = &ConfigSettingsLicenseSettings{} + c.GetUnlimitedSeating() + c = nil + c.GetUnlimitedSeating() +} + +func TestConfigSettingsMapping_GetBasemap(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsMapping{Basemap: &zeroValue} + c.GetBasemap() + c = &ConfigSettingsMapping{} + c.GetBasemap() + c = nil + c.GetBasemap() +} + +func TestConfigSettingsMapping_GetEnabled(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &ConfigSettingsMapping{Enabled: &zeroValue} + c.GetEnabled() + c = &ConfigSettingsMapping{} + c.GetEnabled() + c = nil + c.GetEnabled() +} + +func TestConfigSettingsMapping_GetTileserver(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsMapping{Tileserver: &zeroValue} + c.GetTileserver() + c = &ConfigSettingsMapping{} + c.GetTileserver() + c = nil + c.GetTileserver() +} + +func TestConfigSettingsMapping_GetToken(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsMapping{Token: &zeroValue} + c.GetToken() + c = &ConfigSettingsMapping{} + c.GetToken() + c = nil + c.GetToken() +} + +func TestConfigSettingsNTP_GetPrimaryServer(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsNTP{PrimaryServer: &zeroValue} + c.GetPrimaryServer() + c = &ConfigSettingsNTP{} + c.GetPrimaryServer() + c = nil + c.GetPrimaryServer() +} + +func TestConfigSettingsNTP_GetSecondaryServer(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsNTP{SecondaryServer: &zeroValue} + c.GetSecondaryServer() + c = &ConfigSettingsNTP{} + c.GetSecondaryServer() + c = nil + c.GetSecondaryServer() +} + +func TestConfigSettingsPagesSettings_GetEnabled(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &ConfigSettingsPagesSettings{Enabled: &zeroValue} + c.GetEnabled() + c = &ConfigSettingsPagesSettings{} + c.GetEnabled() + c = nil + c.GetEnabled() +} + +func TestConfigSettingsSAML_GetCertificate(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsSAML{Certificate: &zeroValue} + c.GetCertificate() + c = &ConfigSettingsSAML{} + c.GetCertificate() + c = nil + c.GetCertificate() +} + +func TestConfigSettingsSAML_GetCertificatePath(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsSAML{CertificatePath: &zeroValue} + c.GetCertificatePath() + c = &ConfigSettingsSAML{} + c.GetCertificatePath() + c = nil + c.GetCertificatePath() +} + +func TestConfigSettingsSAML_GetDisableAdminDemote(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &ConfigSettingsSAML{DisableAdminDemote: &zeroValue} + c.GetDisableAdminDemote() + c = &ConfigSettingsSAML{} + c.GetDisableAdminDemote() + c = nil + c.GetDisableAdminDemote() +} + +func TestConfigSettingsSAML_GetIDPInitiatedSSO(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &ConfigSettingsSAML{IDPInitiatedSSO: &zeroValue} + c.GetIDPInitiatedSSO() + c = &ConfigSettingsSAML{} + c.GetIDPInitiatedSSO() + c = nil + c.GetIDPInitiatedSSO() +} + +func TestConfigSettingsSAML_GetIssuer(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsSAML{Issuer: &zeroValue} + c.GetIssuer() + c = &ConfigSettingsSAML{} + c.GetIssuer() + c = nil + c.GetIssuer() +} + +func TestConfigSettingsSAML_GetSSOURL(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsSAML{SSOURL: &zeroValue} + c.GetSSOURL() + c = &ConfigSettingsSAML{} + c.GetSSOURL() + c = nil + c.GetSSOURL() +} + +func TestConfigSettingsSMTP_GetAddress(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsSMTP{Address: &zeroValue} + c.GetAddress() + c = &ConfigSettingsSMTP{} + c.GetAddress() + c = nil + c.GetAddress() +} + +func TestConfigSettingsSMTP_GetAuthentication(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsSMTP{Authentication: &zeroValue} + c.GetAuthentication() + c = &ConfigSettingsSMTP{} + c.GetAuthentication() + c = nil + c.GetAuthentication() +} + +func TestConfigSettingsSMTP_GetDiscardToNoreplyAddress(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &ConfigSettingsSMTP{DiscardToNoreplyAddress: &zeroValue} + c.GetDiscardToNoreplyAddress() + c = &ConfigSettingsSMTP{} + c.GetDiscardToNoreplyAddress() + c = nil + c.GetDiscardToNoreplyAddress() +} + +func TestConfigSettingsSMTP_GetDomain(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &ConfigSettingsSMTP{Domain: &zeroValue} + c.GetDomain() + c = &ConfigSettingsSMTP{} + c.GetDomain() + c = nil + c.GetDomain() +} + +func TestConfigSettingsSMTP_GetEnabled(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &ConfigSettingsSMTP{Enabled: &zeroValue} + c.GetEnabled() + c = &ConfigSettingsSMTP{} + c.GetEnabled() + c = nil + c.GetEnabled() } -func TestCommitStats_GetDeletions(tt *testing.T) { +func TestConfigSettingsSMTP_GetEnableStarttlsAuto(tt *testing.T) { tt.Parallel() - var zeroValue int - c := &CommitStats{Deletions: &zeroValue} - c.GetDeletions() - c = &CommitStats{} - c.GetDeletions() + var zeroValue bool + c := &ConfigSettingsSMTP{EnableStarttlsAuto: &zeroValue} + c.GetEnableStarttlsAuto() + c = &ConfigSettingsSMTP{} + c.GetEnableStarttlsAuto() c = nil - c.GetDeletions() + c.GetEnableStarttlsAuto() } -func TestCommitStats_GetTotal(tt *testing.T) { +func TestConfigSettingsSMTP_GetNoreplyAddress(tt *testing.T) { tt.Parallel() - var zeroValue int - c := &CommitStats{Total: &zeroValue} - c.GetTotal() - c = &CommitStats{} - c.GetTotal() + var zeroValue string + c := &ConfigSettingsSMTP{NoreplyAddress: &zeroValue} + c.GetNoreplyAddress() + c = &ConfigSettingsSMTP{} + c.GetNoreplyAddress() c = nil - c.GetTotal() + c.GetNoreplyAddress() } -func TestCommunityHealthFiles_GetCodeOfConduct(tt *testing.T) { +func TestConfigSettingsSMTP_GetPassword(tt *testing.T) { tt.Parallel() - c := &CommunityHealthFiles{} - c.GetCodeOfConduct() + var zeroValue string + c := &ConfigSettingsSMTP{Password: &zeroValue} + c.GetPassword() + c = &ConfigSettingsSMTP{} + c.GetPassword() c = nil - c.GetCodeOfConduct() + c.GetPassword() } -func TestCommunityHealthFiles_GetCodeOfConductFile(tt *testing.T) { +func TestConfigSettingsSMTP_GetPort(tt *testing.T) { tt.Parallel() - c := &CommunityHealthFiles{} - c.GetCodeOfConductFile() + var zeroValue string + c := &ConfigSettingsSMTP{Port: &zeroValue} + c.GetPort() + c = &ConfigSettingsSMTP{} + c.GetPort() c = nil - c.GetCodeOfConductFile() + c.GetPort() } -func TestCommunityHealthFiles_GetContributing(tt *testing.T) { +func TestConfigSettingsSMTP_GetSupportAddress(tt *testing.T) { tt.Parallel() - c := &CommunityHealthFiles{} - c.GetContributing() + var zeroValue string + c := &ConfigSettingsSMTP{SupportAddress: &zeroValue} + c.GetSupportAddress() + c = &ConfigSettingsSMTP{} + c.GetSupportAddress() c = nil - c.GetContributing() + c.GetSupportAddress() } -func TestCommunityHealthFiles_GetIssueTemplate(tt *testing.T) { +func TestConfigSettingsSMTP_GetSupportAddressType(tt *testing.T) { tt.Parallel() - c := &CommunityHealthFiles{} - c.GetIssueTemplate() + var zeroValue string + c := &ConfigSettingsSMTP{SupportAddressType: &zeroValue} + c.GetSupportAddressType() + c = &ConfigSettingsSMTP{} + c.GetSupportAddressType() c = nil - c.GetIssueTemplate() + c.GetSupportAddressType() } -func TestCommunityHealthFiles_GetLicense(tt *testing.T) { +func TestConfigSettingsSMTP_GetUsername(tt *testing.T) { tt.Parallel() - c := &CommunityHealthFiles{} - c.GetLicense() + var zeroValue string + c := &ConfigSettingsSMTP{Username: &zeroValue} + c.GetUsername() + c = &ConfigSettingsSMTP{} + c.GetUsername() c = nil - c.GetLicense() + c.GetUsername() } -func TestCommunityHealthFiles_GetPullRequestTemplate(tt *testing.T) { +func TestConfigSettingsSMTP_GetUserName(tt *testing.T) { tt.Parallel() - c := &CommunityHealthFiles{} - c.GetPullRequestTemplate() + var zeroValue string + c := &ConfigSettingsSMTP{UserName: &zeroValue} + c.GetUserName() + c = &ConfigSettingsSMTP{} + c.GetUserName() c = nil - c.GetPullRequestTemplate() + c.GetUserName() } -func TestCommunityHealthFiles_GetReadme(tt *testing.T) { +func TestConfigSettingsSNMP_GetCommunity(tt *testing.T) { tt.Parallel() - c := &CommunityHealthFiles{} - c.GetReadme() + var zeroValue string + c := &ConfigSettingsSNMP{Community: &zeroValue} + c.GetCommunity() + c = &ConfigSettingsSNMP{} + c.GetCommunity() c = nil - c.GetReadme() + c.GetCommunity() } -func TestCommunityHealthMetrics_GetContentReportsEnabled(tt *testing.T) { +func TestConfigSettingsSNMP_GetEnabled(tt *testing.T) { tt.Parallel() var zeroValue bool - c := &CommunityHealthMetrics{ContentReportsEnabled: &zeroValue} - c.GetContentReportsEnabled() - c = &CommunityHealthMetrics{} - c.GetContentReportsEnabled() + c := &ConfigSettingsSNMP{Enabled: &zeroValue} + c.GetEnabled() + c = &ConfigSettingsSNMP{} + c.GetEnabled() c = nil - c.GetContentReportsEnabled() + c.GetEnabled() } -func TestCommunityHealthMetrics_GetDescription(tt *testing.T) { +func TestConfigSettingsSyslog_GetEnabled(tt *testing.T) { tt.Parallel() - var zeroValue string - c := &CommunityHealthMetrics{Description: &zeroValue} - c.GetDescription() - c = &CommunityHealthMetrics{} - c.GetDescription() + var zeroValue bool + c := &ConfigSettingsSyslog{Enabled: &zeroValue} + c.GetEnabled() + c = &ConfigSettingsSyslog{} + c.GetEnabled() c = nil - c.GetDescription() + c.GetEnabled() } -func TestCommunityHealthMetrics_GetDocumentation(tt *testing.T) { +func TestConfigSettingsSyslog_GetProtocolName(tt *testing.T) { tt.Parallel() var zeroValue string - c := &CommunityHealthMetrics{Documentation: &zeroValue} - c.GetDocumentation() - c = &CommunityHealthMetrics{} - c.GetDocumentation() + c := &ConfigSettingsSyslog{ProtocolName: &zeroValue} + c.GetProtocolName() + c = &ConfigSettingsSyslog{} + c.GetProtocolName() c = nil - c.GetDocumentation() + c.GetProtocolName() } -func TestCommunityHealthMetrics_GetFiles(tt *testing.T) { +func TestConfigSettingsSyslog_GetServer(tt *testing.T) { tt.Parallel() - c := &CommunityHealthMetrics{} - c.GetFiles() + var zeroValue string + c := &ConfigSettingsSyslog{Server: &zeroValue} + c.GetServer() + c = &ConfigSettingsSyslog{} + c.GetServer() c = nil - c.GetFiles() + c.GetServer() } -func TestCommunityHealthMetrics_GetHealthPercentage(tt *testing.T) { +func TestConnectionServiceItem_GetName(tt *testing.T) { tt.Parallel() - var zeroValue int - c := &CommunityHealthMetrics{HealthPercentage: &zeroValue} - c.GetHealthPercentage() - c = &CommunityHealthMetrics{} - c.GetHealthPercentage() + var zeroValue string + c := &ConnectionServiceItem{Name: &zeroValue} + c.GetName() + c = &ConnectionServiceItem{} + c.GetName() c = nil - c.GetHealthPercentage() + c.GetName() } -func TestCommunityHealthMetrics_GetUpdatedAt(tt *testing.T) { +func TestConnectionServiceItem_GetNumber(tt *testing.T) { tt.Parallel() - var zeroValue Timestamp - c := &CommunityHealthMetrics{UpdatedAt: &zeroValue} - c.GetUpdatedAt() - c = &CommunityHealthMetrics{} - c.GetUpdatedAt() + var zeroValue int + c := &ConnectionServiceItem{Number: &zeroValue} + c.GetNumber() + c = &ConnectionServiceItem{} + c.GetNumber() c = nil - c.GetUpdatedAt() + c.GetNumber() } func TestContentReference_GetID(tt *testing.T) { @@ -14913,117 +16457,326 @@ func TestLicense_GetConditions(tt *testing.T) { l = &License{} l.GetConditions() l = nil - l.GetConditions() + l.GetConditions() +} + +func TestLicense_GetDescription(tt *testing.T) { + tt.Parallel() + var zeroValue string + l := &License{Description: &zeroValue} + l.GetDescription() + l = &License{} + l.GetDescription() + l = nil + l.GetDescription() +} + +func TestLicense_GetFeatured(tt *testing.T) { + tt.Parallel() + var zeroValue bool + l := &License{Featured: &zeroValue} + l.GetFeatured() + l = &License{} + l.GetFeatured() + l = nil + l.GetFeatured() +} + +func TestLicense_GetHTMLURL(tt *testing.T) { + tt.Parallel() + var zeroValue string + l := &License{HTMLURL: &zeroValue} + l.GetHTMLURL() + l = &License{} + l.GetHTMLURL() + l = nil + l.GetHTMLURL() +} + +func TestLicense_GetImplementation(tt *testing.T) { + tt.Parallel() + var zeroValue string + l := &License{Implementation: &zeroValue} + l.GetImplementation() + l = &License{} + l.GetImplementation() + l = nil + l.GetImplementation() +} + +func TestLicense_GetKey(tt *testing.T) { + tt.Parallel() + var zeroValue string + l := &License{Key: &zeroValue} + l.GetKey() + l = &License{} + l.GetKey() + l = nil + l.GetKey() +} + +func TestLicense_GetLimitations(tt *testing.T) { + tt.Parallel() + var zeroValue []string + l := &License{Limitations: &zeroValue} + l.GetLimitations() + l = &License{} + l.GetLimitations() + l = nil + l.GetLimitations() +} + +func TestLicense_GetName(tt *testing.T) { + tt.Parallel() + var zeroValue string + l := &License{Name: &zeroValue} + l.GetName() + l = &License{} + l.GetName() + l = nil + l.GetName() +} + +func TestLicense_GetPermissions(tt *testing.T) { + tt.Parallel() + var zeroValue []string + l := &License{Permissions: &zeroValue} + l.GetPermissions() + l = &License{} + l.GetPermissions() + l = nil + l.GetPermissions() +} + +func TestLicense_GetSPDXID(tt *testing.T) { + tt.Parallel() + var zeroValue string + l := &License{SPDXID: &zeroValue} + l.GetSPDXID() + l = &License{} + l.GetSPDXID() + l = nil + l.GetSPDXID() +} + +func TestLicense_GetURL(tt *testing.T) { + tt.Parallel() + var zeroValue string + l := &License{URL: &zeroValue} + l.GetURL() + l = &License{} + l.GetURL() + l = nil + l.GetURL() +} + +func TestLicenseCheck_GetStatus(tt *testing.T) { + tt.Parallel() + var zeroValue string + l := &LicenseCheck{Status: &zeroValue} + l.GetStatus() + l = &LicenseCheck{} + l.GetStatus() + l = nil + l.GetStatus() +} + +func TestLicenseStatus_GetAdvancedSecurityEnabled(tt *testing.T) { + tt.Parallel() + var zeroValue bool + l := &LicenseStatus{AdvancedSecurityEnabled: &zeroValue} + l.GetAdvancedSecurityEnabled() + l = &LicenseStatus{} + l.GetAdvancedSecurityEnabled() + l = nil + l.GetAdvancedSecurityEnabled() +} + +func TestLicenseStatus_GetAdvancedSecuritySeats(tt *testing.T) { + tt.Parallel() + var zeroValue int + l := &LicenseStatus{AdvancedSecuritySeats: &zeroValue} + l.GetAdvancedSecuritySeats() + l = &LicenseStatus{} + l.GetAdvancedSecuritySeats() + l = nil + l.GetAdvancedSecuritySeats() +} + +func TestLicenseStatus_GetClusterSupport(tt *testing.T) { + tt.Parallel() + var zeroValue bool + l := &LicenseStatus{ClusterSupport: &zeroValue} + l.GetClusterSupport() + l = &LicenseStatus{} + l.GetClusterSupport() + l = nil + l.GetClusterSupport() +} + +func TestLicenseStatus_GetCompany(tt *testing.T) { + tt.Parallel() + var zeroValue string + l := &LicenseStatus{Company: &zeroValue} + l.GetCompany() + l = &LicenseStatus{} + l.GetCompany() + l = nil + l.GetCompany() +} + +func TestLicenseStatus_GetCroquetSupport(tt *testing.T) { + tt.Parallel() + var zeroValue bool + l := &LicenseStatus{CroquetSupport: &zeroValue} + l.GetCroquetSupport() + l = &LicenseStatus{} + l.GetCroquetSupport() + l = nil + l.GetCroquetSupport() +} + +func TestLicenseStatus_GetCustomTerms(tt *testing.T) { + tt.Parallel() + var zeroValue bool + l := &LicenseStatus{CustomTerms: &zeroValue} + l.GetCustomTerms() + l = &LicenseStatus{} + l.GetCustomTerms() + l = nil + l.GetCustomTerms() } -func TestLicense_GetDescription(tt *testing.T) { +func TestLicenseStatus_GetEvaluation(tt *testing.T) { tt.Parallel() - var zeroValue string - l := &License{Description: &zeroValue} - l.GetDescription() - l = &License{} - l.GetDescription() + var zeroValue bool + l := &LicenseStatus{Evaluation: &zeroValue} + l.GetEvaluation() + l = &LicenseStatus{} + l.GetEvaluation() l = nil - l.GetDescription() + l.GetEvaluation() } -func TestLicense_GetFeatured(tt *testing.T) { +func TestLicenseStatus_GetExpireAt(tt *testing.T) { + tt.Parallel() + var zeroValue Timestamp + l := &LicenseStatus{ExpireAt: &zeroValue} + l.GetExpireAt() + l = &LicenseStatus{} + l.GetExpireAt() + l = nil + l.GetExpireAt() +} + +func TestLicenseStatus_GetInsightsEnabled(tt *testing.T) { tt.Parallel() var zeroValue bool - l := &License{Featured: &zeroValue} - l.GetFeatured() - l = &License{} - l.GetFeatured() + l := &LicenseStatus{InsightsEnabled: &zeroValue} + l.GetInsightsEnabled() + l = &LicenseStatus{} + l.GetInsightsEnabled() l = nil - l.GetFeatured() + l.GetInsightsEnabled() } -func TestLicense_GetHTMLURL(tt *testing.T) { +func TestLicenseStatus_GetInsightsExpireAt(tt *testing.T) { tt.Parallel() - var zeroValue string - l := &License{HTMLURL: &zeroValue} - l.GetHTMLURL() - l = &License{} - l.GetHTMLURL() + var zeroValue Timestamp + l := &LicenseStatus{InsightsExpireAt: &zeroValue} + l.GetInsightsExpireAt() + l = &LicenseStatus{} + l.GetInsightsExpireAt() l = nil - l.GetHTMLURL() + l.GetInsightsExpireAt() } -func TestLicense_GetImplementation(tt *testing.T) { +func TestLicenseStatus_GetLearningLabEvaluationExpires(tt *testing.T) { tt.Parallel() - var zeroValue string - l := &License{Implementation: &zeroValue} - l.GetImplementation() - l = &License{} - l.GetImplementation() + var zeroValue Timestamp + l := &LicenseStatus{LearningLabEvaluationExpires: &zeroValue} + l.GetLearningLabEvaluationExpires() + l = &LicenseStatus{} + l.GetLearningLabEvaluationExpires() l = nil - l.GetImplementation() + l.GetLearningLabEvaluationExpires() } -func TestLicense_GetKey(tt *testing.T) { +func TestLicenseStatus_GetLearningLabSeats(tt *testing.T) { tt.Parallel() - var zeroValue string - l := &License{Key: &zeroValue} - l.GetKey() - l = &License{} - l.GetKey() + var zeroValue int + l := &LicenseStatus{LearningLabSeats: &zeroValue} + l.GetLearningLabSeats() + l = &LicenseStatus{} + l.GetLearningLabSeats() l = nil - l.GetKey() + l.GetLearningLabSeats() } -func TestLicense_GetLimitations(tt *testing.T) { +func TestLicenseStatus_GetPerpetual(tt *testing.T) { tt.Parallel() - var zeroValue []string - l := &License{Limitations: &zeroValue} - l.GetLimitations() - l = &License{} - l.GetLimitations() + var zeroValue bool + l := &LicenseStatus{Perpetual: &zeroValue} + l.GetPerpetual() + l = &LicenseStatus{} + l.GetPerpetual() l = nil - l.GetLimitations() + l.GetPerpetual() } -func TestLicense_GetName(tt *testing.T) { +func TestLicenseStatus_GetReferenceNumber(tt *testing.T) { tt.Parallel() var zeroValue string - l := &License{Name: &zeroValue} - l.GetName() - l = &License{} - l.GetName() + l := &LicenseStatus{ReferenceNumber: &zeroValue} + l.GetReferenceNumber() + l = &LicenseStatus{} + l.GetReferenceNumber() l = nil - l.GetName() + l.GetReferenceNumber() } -func TestLicense_GetPermissions(tt *testing.T) { +func TestLicenseStatus_GetSeats(tt *testing.T) { tt.Parallel() - var zeroValue []string - l := &License{Permissions: &zeroValue} - l.GetPermissions() - l = &License{} - l.GetPermissions() + var zeroValue int + l := &LicenseStatus{Seats: &zeroValue} + l.GetSeats() + l = &LicenseStatus{} + l.GetSeats() l = nil - l.GetPermissions() + l.GetSeats() } -func TestLicense_GetSPDXID(tt *testing.T) { +func TestLicenseStatus_GetSSHAllowed(tt *testing.T) { tt.Parallel() - var zeroValue string - l := &License{SPDXID: &zeroValue} - l.GetSPDXID() - l = &License{} - l.GetSPDXID() + var zeroValue bool + l := &LicenseStatus{SSHAllowed: &zeroValue} + l.GetSSHAllowed() + l = &LicenseStatus{} + l.GetSSHAllowed() l = nil - l.GetSPDXID() + l.GetSSHAllowed() } -func TestLicense_GetURL(tt *testing.T) { +func TestLicenseStatus_GetSupportKey(tt *testing.T) { tt.Parallel() var zeroValue string - l := &License{URL: &zeroValue} - l.GetURL() - l = &License{} - l.GetURL() + l := &LicenseStatus{SupportKey: &zeroValue} + l.GetSupportKey() + l = &LicenseStatus{} + l.GetSupportKey() l = nil - l.GetURL() + l.GetSupportKey() +} + +func TestLicenseStatus_GetUnlimitedSeating(tt *testing.T) { + tt.Parallel() + var zeroValue bool + l := &LicenseStatus{UnlimitedSeating: &zeroValue} + l.GetUnlimitedSeating() + l = &LicenseStatus{} + l.GetUnlimitedSeating() + l = nil + l.GetUnlimitedSeating() } func TestLinearHistoryRequirementEnforcementLevelChanges_GetFrom(tt *testing.T) { @@ -15499,6 +17252,138 @@ func TestLockBranch_GetEnabled(tt *testing.T) { l.GetEnabled() } +func TestMaintenanceOperationStatus_GetHostname(tt *testing.T) { + tt.Parallel() + var zeroValue string + m := &MaintenanceOperationStatus{Hostname: &zeroValue} + m.GetHostname() + m = &MaintenanceOperationStatus{} + m.GetHostname() + m = nil + m.GetHostname() +} + +func TestMaintenanceOperationStatus_GetMessage(tt *testing.T) { + tt.Parallel() + var zeroValue string + m := &MaintenanceOperationStatus{Message: &zeroValue} + m.GetMessage() + m = &MaintenanceOperationStatus{} + m.GetMessage() + m = nil + m.GetMessage() +} + +func TestMaintenanceOperationStatus_GetUUID(tt *testing.T) { + tt.Parallel() + var zeroValue string + m := &MaintenanceOperationStatus{UUID: &zeroValue} + m.GetUUID() + m = &MaintenanceOperationStatus{} + m.GetUUID() + m = nil + m.GetUUID() +} + +func TestMaintenanceOptions_GetMaintenanceModeMessage(tt *testing.T) { + tt.Parallel() + var zeroValue string + m := &MaintenanceOptions{MaintenanceModeMessage: &zeroValue} + m.GetMaintenanceModeMessage() + m = &MaintenanceOptions{} + m.GetMaintenanceModeMessage() + m = nil + m.GetMaintenanceModeMessage() +} + +func TestMaintenanceOptions_GetUUID(tt *testing.T) { + tt.Parallel() + var zeroValue string + m := &MaintenanceOptions{UUID: &zeroValue} + m.GetUUID() + m = &MaintenanceOptions{} + m.GetUUID() + m = nil + m.GetUUID() +} + +func TestMaintenanceOptions_GetWhen(tt *testing.T) { + tt.Parallel() + var zeroValue string + m := &MaintenanceOptions{When: &zeroValue} + m.GetWhen() + m = &MaintenanceOptions{} + m.GetWhen() + m = nil + m.GetWhen() +} + +func TestMaintenanceStatus_GetCanUnsetMaintenance(tt *testing.T) { + tt.Parallel() + var zeroValue bool + m := &MaintenanceStatus{CanUnsetMaintenance: &zeroValue} + m.GetCanUnsetMaintenance() + m = &MaintenanceStatus{} + m.GetCanUnsetMaintenance() + m = nil + m.GetCanUnsetMaintenance() +} + +func TestMaintenanceStatus_GetHostname(tt *testing.T) { + tt.Parallel() + var zeroValue string + m := &MaintenanceStatus{Hostname: &zeroValue} + m.GetHostname() + m = &MaintenanceStatus{} + m.GetHostname() + m = nil + m.GetHostname() +} + +func TestMaintenanceStatus_GetMaintenanceModeMessage(tt *testing.T) { + tt.Parallel() + var zeroValue string + m := &MaintenanceStatus{MaintenanceModeMessage: &zeroValue} + m.GetMaintenanceModeMessage() + m = &MaintenanceStatus{} + m.GetMaintenanceModeMessage() + m = nil + m.GetMaintenanceModeMessage() +} + +func TestMaintenanceStatus_GetScheduledTime(tt *testing.T) { + tt.Parallel() + var zeroValue Timestamp + m := &MaintenanceStatus{ScheduledTime: &zeroValue} + m.GetScheduledTime() + m = &MaintenanceStatus{} + m.GetScheduledTime() + m = nil + m.GetScheduledTime() +} + +func TestMaintenanceStatus_GetStatus(tt *testing.T) { + tt.Parallel() + var zeroValue string + m := &MaintenanceStatus{Status: &zeroValue} + m.GetStatus() + m = &MaintenanceStatus{} + m.GetStatus() + m = nil + m.GetStatus() +} + +func TestMaintenanceStatus_GetUUID(tt *testing.T) { + tt.Parallel() + var zeroValue string + m := &MaintenanceStatus{UUID: &zeroValue} + m.GetUUID() + m = &MaintenanceStatus{} + m.GetUUID() + m = nil + m.GetUUID() +} + func TestMarketplacePendingChange_GetEffectiveDate(tt *testing.T) { tt.Parallel() var zeroValue Timestamp @@ -17069,6 +18954,80 @@ func TestNewTeam_GetPrivacy(tt *testing.T) { n.GetPrivacy() } +func TestNodeDetails_GetHostname(tt *testing.T) { + tt.Parallel() + var zeroValue string + n := &NodeDetails{Hostname: &zeroValue} + n.GetHostname() + n = &NodeDetails{} + n.GetHostname() + n = nil + n.GetHostname() +} + +func TestNodeDetails_GetUUID(tt *testing.T) { + tt.Parallel() + var zeroValue string + n := &NodeDetails{UUID: &zeroValue} + n.GetUUID() + n = &NodeDetails{} + n.GetUUID() + n = nil + n.GetUUID() +} + +func TestNodeMetadataStatus_GetTopology(tt *testing.T) { + tt.Parallel() + var zeroValue string + n := &NodeMetadataStatus{Topology: &zeroValue} + n.GetTopology() + n = &NodeMetadataStatus{} + n.GetTopology() + n = nil + n.GetTopology() +} + +func TestNodeQueryOptions_GetClusterRoles(tt *testing.T) { + tt.Parallel() + var zeroValue string + n := &NodeQueryOptions{ClusterRoles: &zeroValue} + n.GetClusterRoles() + n = &NodeQueryOptions{} + n.GetClusterRoles() + n = nil + n.GetClusterRoles() +} + +func TestNodeQueryOptions_GetUUID(tt *testing.T) { + tt.Parallel() + var zeroValue string + n := &NodeQueryOptions{UUID: &zeroValue} + n.GetUUID() + n = &NodeQueryOptions{} + n.GetUUID() + n = nil + n.GetUUID() +} + +func TestNodeReleaseVersion_GetHostname(tt *testing.T) { + tt.Parallel() + var zeroValue string + n := &NodeReleaseVersion{Hostname: &zeroValue} + n.GetHostname() + n = &NodeReleaseVersion{} + n.GetHostname() + n = nil + n.GetHostname() +} + +func TestNodeReleaseVersion_GetVersion(tt *testing.T) { + tt.Parallel() + n := &NodeReleaseVersion{} + n.GetVersion() + n = nil + n.GetVersion() +} + func TestNotification_GetID(tt *testing.T) { tt.Parallel() var zeroValue string @@ -24184,6 +26143,50 @@ func TestReleaseEvent_GetSender(tt *testing.T) { r.GetSender() } +func TestReleaseVersion_GetBuildDate(tt *testing.T) { + tt.Parallel() + var zeroValue string + r := &ReleaseVersion{BuildDate: &zeroValue} + r.GetBuildDate() + r = &ReleaseVersion{} + r.GetBuildDate() + r = nil + r.GetBuildDate() +} + +func TestReleaseVersion_GetBuildID(tt *testing.T) { + tt.Parallel() + var zeroValue string + r := &ReleaseVersion{BuildID: &zeroValue} + r.GetBuildID() + r = &ReleaseVersion{} + r.GetBuildID() + r = nil + r.GetBuildID() +} + +func TestReleaseVersion_GetPlatform(tt *testing.T) { + tt.Parallel() + var zeroValue string + r := &ReleaseVersion{Platform: &zeroValue} + r.GetPlatform() + r = &ReleaseVersion{} + r.GetPlatform() + r = nil + r.GetPlatform() +} + +func TestReleaseVersion_GetVersion(tt *testing.T) { + tt.Parallel() + var zeroValue string + r := &ReleaseVersion{Version: &zeroValue} + r.GetVersion() + r = &ReleaseVersion{} + r.GetVersion() + r = nil + r.GetVersion() +} + func TestRemoveToken_GetExpiresAt(tt *testing.T) { tt.Parallel() var zeroValue Timestamp @@ -30176,6 +32179,50 @@ func TestSponsorshipTier_GetFrom(tt *testing.T) { s.GetFrom() } +func TestSSHKeyStatus_GetHostname(tt *testing.T) { + tt.Parallel() + var zeroValue string + s := &SSHKeyStatus{Hostname: &zeroValue} + s.GetHostname() + s = &SSHKeyStatus{} + s.GetHostname() + s = nil + s.GetHostname() +} + +func TestSSHKeyStatus_GetMessage(tt *testing.T) { + tt.Parallel() + var zeroValue string + s := &SSHKeyStatus{Message: &zeroValue} + s.GetMessage() + s = &SSHKeyStatus{} + s.GetMessage() + s = nil + s.GetMessage() +} + +func TestSSHKeyStatus_GetModified(tt *testing.T) { + tt.Parallel() + var zeroValue bool + s := &SSHKeyStatus{Modified: &zeroValue} + s.GetModified() + s = &SSHKeyStatus{} + s.GetModified() + s = nil + s.GetModified() +} + +func TestSSHKeyStatus_GetUUID(tt *testing.T) { + tt.Parallel() + var zeroValue string + s := &SSHKeyStatus{UUID: &zeroValue} + s.GetUUID() + s = &SSHKeyStatus{} + s.GetUUID() + s = nil + s.GetUUID() +} + func TestSSHSigningKey_GetCreatedAt(tt *testing.T) { tt.Parallel() var zeroValue Timestamp @@ -30528,6 +32575,61 @@ func TestSubscription_GetURL(tt *testing.T) { s.GetURL() } +func TestSystemRequirements_GetStatus(tt *testing.T) { + tt.Parallel() + var zeroValue string + s := &SystemRequirements{Status: &zeroValue} + s.GetStatus() + s = &SystemRequirements{} + s.GetStatus() + s = nil + s.GetStatus() +} + +func TestSystemRequirementsNode_GetHostname(tt *testing.T) { + tt.Parallel() + var zeroValue string + s := &SystemRequirementsNode{Hostname: &zeroValue} + s.GetHostname() + s = &SystemRequirementsNode{} + s.GetHostname() + s = nil + s.GetHostname() +} + +func TestSystemRequirementsNode_GetStatus(tt *testing.T) { + tt.Parallel() + var zeroValue string + s := &SystemRequirementsNode{Status: &zeroValue} + s.GetStatus() + s = &SystemRequirementsNode{} + s.GetStatus() + s = nil + s.GetStatus() +} + +func TestSystemRequirementsNodeRoleStatus_GetRole(tt *testing.T) { + tt.Parallel() + var zeroValue string + s := &SystemRequirementsNodeRoleStatus{Role: &zeroValue} + s.GetRole() + s = &SystemRequirementsNodeRoleStatus{} + s.GetRole() + s = nil + s.GetRole() +} + +func TestSystemRequirementsNodeRoleStatus_GetStatus(tt *testing.T) { + tt.Parallel() + var zeroValue string + s := &SystemRequirementsNodeRoleStatus{Status: &zeroValue} + s.GetStatus() + s = &SystemRequirementsNodeRoleStatus{} + s.GetStatus() + s = nil + s.GetStatus() +} + func TestTag_GetMessage(tt *testing.T) { tt.Parallel() var zeroValue string From 27bd17565a213b72d232e8e1ea820881f791f1a7 Mon Sep 17 00:00:00 2001 From: Steve Hipwell Date: Tue, 21 Jan 2025 17:37:47 +0000 Subject: [PATCH 625/751] fix!: Refactor the repository ruleset code (#3430) BREAKING CHANGES: The following types have been renamed: - `Ruleset` -> `RepositoryRuleset` - `RulesetLink` -> `RepositoryRulesetLink` - `RulesetLinks` -> `RepositoryRulesetLinks` - `RulesetRefConditionParameters` -> `RepositoryRulesetRefConditionParameters` - `RulesetRepositoryNamesConditionParameters` -> `RepositoryRulesetRepositoryNamesConditionParameters` - `RulesetRepositoryIDsConditionParameters` -> `RepositoryRulesetRepositoryIDsConditionParameters` - `RulesetRepositoryPropertyTargetParameters` -> `Repository` - `RulesetRepositoryPropertyConditionParameters` -> `RepositoryRulesetRepositoryPropertyConditionParameters` - `RulesetOrganizationNamesConditionParameters` -> `RepositoryRulesetOrganizationNamesConditionParameters` - `RulesetOrganizationIDsConditionParameters` -> `RepositoryRulesetOrganizationIDsConditionParameters` - `RulesetConditions` -> `RepositoryRulesetConditions` - `RepositoryRulesetEditedChanges` -> `RepositoryRulesetChanges` - `RepositoryRulesetEditedSource` -> `RepositoryRulesetChangeSource` - `RepositoryRulesetEditedSources` -> `RepositoryRulesetChangeSources` - `RepositoryRulesetEditedConditions` -> `RepositoryRulesetUpdatedConditions` - `RepositoryRulesetUpdatedConditionsEdited` -> `RepositoryRulesetUpdatedCondition` - `RepositoryRulesetEditedRules` -> `RepositoryRulesetChangedRules` - `RepositoryRulesetUpdatedRules` -> `RepositoryRulesetUpdatedRules` - `RepositoryRulesetEditedRuleChanges` -> `RepositoryRulesetChangedRule` --- github/enterprise_rules.go | 28 +- github/enterprise_rules_test.go | 862 +++++++------- github/event_types.go | 75 +- github/event_types_test.go | 1982 ++++--------------------------- github/github-accessors.go | 524 +++----- github/github-accessors_test.go | 649 ++++------ github/github.go | 1 - github/orgs_rules.go | 34 +- github/orgs_rules_test.go | 780 ++++++------ github/repos_rules.go | 892 +------------- github/repos_rules_test.go | 564 +-------- github/rules.go | 1207 +++++++++++++++++++ github/rules_test.go | 916 ++++++++++++++ 13 files changed, 3791 insertions(+), 4723 deletions(-) create mode 100644 github/rules.go create mode 100644 github/rules_test.go diff --git a/github/enterprise_rules.go b/github/enterprise_rules.go index 29e3e4a568f..f438223370f 100644 --- a/github/enterprise_rules.go +++ b/github/enterprise_rules.go @@ -10,12 +10,12 @@ import ( "fmt" ) -// CreateEnterpriseRuleset creates a ruleset for the specified enterprise. +// CreateRepositoryRuleset creates a repository ruleset for the specified enterprise. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/rules#create-an-enterprise-repository-ruleset // //meta:operation POST /enterprises/{enterprise}/rulesets -func (s *EnterpriseService) CreateEnterpriseRuleset(ctx context.Context, enterprise string, ruleset Ruleset) (*Ruleset, *Response, error) { +func (s *EnterpriseService) CreateRepositoryRuleset(ctx context.Context, enterprise string, ruleset RepositoryRuleset) (*RepositoryRuleset, *Response, error) { u := fmt.Sprintf("enterprises/%v/rulesets", enterprise) req, err := s.client.NewRequest("POST", u, ruleset) @@ -23,7 +23,7 @@ func (s *EnterpriseService) CreateEnterpriseRuleset(ctx context.Context, enterpr return nil, nil, err } - var rs *Ruleset + var rs *RepositoryRuleset resp, err := s.client.Do(ctx, req, &rs) if err != nil { return nil, resp, err @@ -32,12 +32,12 @@ func (s *EnterpriseService) CreateEnterpriseRuleset(ctx context.Context, enterpr return rs, resp, nil } -// GetEnterpriseRuleset gets a ruleset from the specified enterprise. +// GetRepositoryRuleset gets a repository ruleset for the specified enterprise. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/rules#get-an-enterprise-repository-ruleset // //meta:operation GET /enterprises/{enterprise}/rulesets/{ruleset_id} -func (s *EnterpriseService) GetEnterpriseRuleset(ctx context.Context, enterprise string, rulesetID int64) (*Ruleset, *Response, error) { +func (s *EnterpriseService) GetRepositoryRuleset(ctx context.Context, enterprise string, rulesetID int64) (*RepositoryRuleset, *Response, error) { u := fmt.Sprintf("enterprises/%v/rulesets/%v", enterprise, rulesetID) req, err := s.client.NewRequest("GET", u, nil) @@ -45,7 +45,7 @@ func (s *EnterpriseService) GetEnterpriseRuleset(ctx context.Context, enterprise return nil, nil, err } - var ruleset *Ruleset + var ruleset *RepositoryRuleset resp, err := s.client.Do(ctx, req, &ruleset) if err != nil { return nil, resp, err @@ -54,12 +54,12 @@ func (s *EnterpriseService) GetEnterpriseRuleset(ctx context.Context, enterprise return ruleset, resp, nil } -// UpdateEnterpriseRuleset updates a ruleset from the specified enterprise. +// UpdateRepositoryRuleset updates a repository ruleset for the specified enterprise. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/rules#update-an-enterprise-repository-ruleset // //meta:operation PUT /enterprises/{enterprise}/rulesets/{ruleset_id} -func (s *EnterpriseService) UpdateEnterpriseRuleset(ctx context.Context, enterprise string, rulesetID int64, ruleset Ruleset) (*Ruleset, *Response, error) { +func (s *EnterpriseService) UpdateRepositoryRuleset(ctx context.Context, enterprise string, rulesetID int64, ruleset RepositoryRuleset) (*RepositoryRuleset, *Response, error) { u := fmt.Sprintf("enterprises/%v/rulesets/%v", enterprise, rulesetID) req, err := s.client.NewRequest("PUT", u, ruleset) @@ -67,7 +67,7 @@ func (s *EnterpriseService) UpdateEnterpriseRuleset(ctx context.Context, enterpr return nil, nil, err } - var rs *Ruleset + var rs *RepositoryRuleset resp, err := s.client.Do(ctx, req, &rs) if err != nil { return nil, resp, err @@ -76,14 +76,14 @@ func (s *EnterpriseService) UpdateEnterpriseRuleset(ctx context.Context, enterpr return rs, resp, nil } -// UpdateEnterpriseRulesetClearBypassActor clears the ruleset bypass actors for a ruleset for the specified repository. +// UpdateRepositoryRulesetClearBypassActor clears the bypass actors for a repository ruleset for the specified enterprise. // -// This function is necessary as the UpdateEnterpriseRuleset function does not marshal ByPassActor if passed as an empty array. +// This function is necessary as the UpdateRepositoryRuleset function does not marshal ByPassActor if passed as an empty array. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/rules#update-an-enterprise-repository-ruleset // //meta:operation PUT /enterprises/{enterprise}/rulesets/{ruleset_id} -func (s *EnterpriseService) UpdateEnterpriseRulesetClearBypassActor(ctx context.Context, enterprise string, rulesetID int64) (*Response, error) { +func (s *EnterpriseService) UpdateRepositoryRulesetClearBypassActor(ctx context.Context, enterprise string, rulesetID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/rulesets/%v", enterprise, rulesetID) rsClearBypassActor := rulesetClearBypassActors{} @@ -101,12 +101,12 @@ func (s *EnterpriseService) UpdateEnterpriseRulesetClearBypassActor(ctx context. return resp, nil } -// DeleteEnterpriseRuleset deletes a ruleset from the specified enterprise. +// DeleteRepositoryRuleset deletes a repository ruleset from the specified enterprise. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/rules#delete-an-enterprise-repository-ruleset // //meta:operation DELETE /enterprises/{enterprise}/rulesets/{ruleset_id} -func (s *EnterpriseService) DeleteEnterpriseRuleset(ctx context.Context, enterprise string, rulesetID int64) (*Response, error) { +func (s *EnterpriseService) DeleteRepositoryRuleset(ctx context.Context, enterprise string, rulesetID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/rulesets/%v", enterprise, rulesetID) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/enterprise_rules_test.go b/github/enterprise_rules_test.go index 574b8396591..87c44102883 100644 --- a/github/enterprise_rules_test.go +++ b/github/enterprise_rules_test.go @@ -14,14 +14,14 @@ import ( "github.com/google/go-cmp/cmp" ) -func TestEnterpriseService_CreateEnterpriseRuleset_OrgNameRepoName(t *testing.T) { +func TestEnterpriseService_CreateRepositoryRuleset_OrgNameRepoName(t *testing.T) { t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/rulesets", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") fmt.Fprint(w, `{ - "id": 21, + "id": 84, "name": "ruleset", "target": "branch", "source_type": "Enterprise", @@ -102,6 +102,7 @@ func TestEnterpriseService_CreateEnterpriseRuleset_OrgNameRepoName(t *testing.T) { "type": "required_status_checks", "parameters": { + "do_not_enforce_on_create": true, "required_status_checks": [ { "context": "test", @@ -174,207 +175,209 @@ func TestEnterpriseService_CreateEnterpriseRuleset_OrgNameRepoName(t *testing.T) }) ctx := context.Background() - ruleset, _, err := client.Enterprise.CreateEnterpriseRuleset(ctx, "e", Ruleset{ + ruleset, _, err := client.Enterprise.CreateRepositoryRuleset(ctx, "e", RepositoryRuleset{ Name: "ruleset", - Target: Ptr("branch"), + Target: Ptr(RulesetTargetBranch), Enforcement: "active", BypassActors: []*BypassActor{ { ActorID: Ptr(int64(234)), - ActorType: Ptr("Team"), + ActorType: Ptr(BypassActorTypeTeam), }, }, - Conditions: &RulesetConditions{ - OrganizationName: &RulesetOrganizationNamesConditionParameters{ + Conditions: &RepositoryRulesetConditions{ + OrganizationName: &RepositoryRulesetOrganizationNamesConditionParameters{ Include: []string{"important_organization", "another_important_organization"}, Exclude: []string{"unimportant_organization"}, }, - RepositoryName: &RulesetRepositoryNamesConditionParameters{ + RepositoryName: &RepositoryRulesetRepositoryNamesConditionParameters{ Include: []string{"important_repository", "another_important_repository"}, Exclude: []string{"unimportant_repository"}, Protected: Ptr(true), }, - RefName: &RulesetRefConditionParameters{ + RefName: &RepositoryRulesetRefConditionParameters{ Include: []string{"refs/heads/main", "refs/heads/master"}, Exclude: []string{"refs/heads/dev*"}, }, }, - Rules: []*RepositoryRule{ - NewCreationRule(), - NewUpdateRule(&UpdateAllowsFetchAndMergeRuleParameters{ + Rules: &RepositoryRulesetRules{ + Creation: &EmptyRuleParameters{}, + Update: &UpdateRuleParameters{ UpdateAllowsFetchAndMerge: true, - }), - NewDeletionRule(), - NewRequiredLinearHistoryRule(), - NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ + }, + Deletion: &EmptyRuleParameters{}, + RequiredLinearHistory: &EmptyRuleParameters{}, + RequiredDeployments: &RequiredDeploymentsRuleParameters{ RequiredDeploymentEnvironments: []string{"test"}, - }), - NewRequiredSignaturesRule(), - NewPullRequestRule(&PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, + }, + RequiredSignatures: &EmptyRuleParameters{}, + PullRequest: &PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{MergeMethodRebase, MergeMethodSquash}, DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, RequiredApprovingReviewCount: 1, RequiredReviewThreadResolution: true, - }), - NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ - RequiredStatusChecks: []RuleRequiredStatusChecks{ + }, + RequiredStatusChecks: &RequiredStatusChecksRuleParameters{ + DoNotEnforceOnCreate: Ptr(true), + RequiredStatusChecks: []*RuleStatusCheck{ { Context: "test", IntegrationID: Ptr(int64(1)), }, }, StrictRequiredStatusChecksPolicy: true, - }), - NewNonFastForwardRule(), - NewCommitMessagePatternRule(&RulePatternParameters{ + }, + NonFastForward: &EmptyRuleParameters{}, + CommitMessagePattern: &PatternRuleParameters{ Name: Ptr("avoid test commits"), Negate: Ptr(true), Operator: "starts_with", Pattern: "[test]", - }), - NewCommitAuthorEmailPatternRule(&RulePatternParameters{ + }, + CommitAuthorEmailPattern: &PatternRuleParameters{ Operator: "contains", Pattern: "github", - }), - NewCommitterEmailPatternRule(&RulePatternParameters{ + }, + CommitterEmailPattern: &PatternRuleParameters{ Name: Ptr("avoid commit emails"), Negate: Ptr(true), Operator: "ends_with", Pattern: "abc", - }), - NewBranchNamePatternRule(&RulePatternParameters{ + }, + BranchNamePattern: &PatternRuleParameters{ Name: Ptr("avoid branch names"), Negate: Ptr(true), Operator: "regex", Pattern: "github$", - }), - NewTagNamePatternRule(&RulePatternParameters{ + }, + TagNamePattern: &PatternRuleParameters{ Name: Ptr("avoid tag names"), Negate: Ptr(true), Operator: "contains", Pattern: "github", - }), - NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ - RequiredCodeScanningTools: []*RuleRequiredCodeScanningTool{ + }, + CodeScanning: &CodeScanningRuleParameters{ + CodeScanningTools: []*RuleCodeScanningTool{ { + AlertsThreshold: CodeScanningAlertsThresholdErrors, + SecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdHighOrHigher, Tool: "CodeQL", - SecurityAlertsThreshold: "high_or_higher", - AlertsThreshold: "errors", }, }, - }), + }, }, }) if err != nil { - t.Errorf("Enterprise.CreateEnterpriseRuleset returned error: %v", err) + t.Errorf("Enterprise.CreateRepositoryRuleset returned error: %v", err) } - want := &Ruleset{ - ID: Ptr(int64(21)), + want := &RepositoryRuleset{ + ID: Ptr(int64(84)), Name: "ruleset", - Target: Ptr("branch"), - SourceType: Ptr("Enterprise"), + Target: Ptr(RulesetTargetBranch), + SourceType: Ptr(RulesetSourceTypeEnterprise), Source: "e", Enforcement: "active", BypassActors: []*BypassActor{ { ActorID: Ptr(int64(234)), - ActorType: Ptr("Team"), + ActorType: Ptr(BypassActorTypeTeam), }, }, - Conditions: &RulesetConditions{ - OrganizationName: &RulesetOrganizationNamesConditionParameters{ + Conditions: &RepositoryRulesetConditions{ + OrganizationName: &RepositoryRulesetOrganizationNamesConditionParameters{ Include: []string{"important_organization", "another_important_organization"}, Exclude: []string{"unimportant_organization"}, }, - RepositoryName: &RulesetRepositoryNamesConditionParameters{ + RepositoryName: &RepositoryRulesetRepositoryNamesConditionParameters{ Include: []string{"important_repository", "another_important_repository"}, Exclude: []string{"unimportant_repository"}, Protected: Ptr(true), }, - RefName: &RulesetRefConditionParameters{ + RefName: &RepositoryRulesetRefConditionParameters{ Include: []string{"refs/heads/main", "refs/heads/master"}, Exclude: []string{"refs/heads/dev*"}, }, }, - Rules: []*RepositoryRule{ - NewCreationRule(), - NewUpdateRule(&UpdateAllowsFetchAndMergeRuleParameters{ + Rules: &RepositoryRulesetRules{ + Creation: &EmptyRuleParameters{}, + Update: &UpdateRuleParameters{ UpdateAllowsFetchAndMerge: true, - }), - NewDeletionRule(), - NewRequiredLinearHistoryRule(), - NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ + }, + Deletion: &EmptyRuleParameters{}, + RequiredLinearHistory: &EmptyRuleParameters{}, + RequiredDeployments: &RequiredDeploymentsRuleParameters{ RequiredDeploymentEnvironments: []string{"test"}, - }), - NewRequiredSignaturesRule(), - NewPullRequestRule(&PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, + }, + RequiredSignatures: &EmptyRuleParameters{}, + PullRequest: &PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{MergeMethodRebase, MergeMethodSquash}, DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, RequiredApprovingReviewCount: 1, RequiredReviewThreadResolution: true, - }), - NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ - RequiredStatusChecks: []RuleRequiredStatusChecks{ + }, + RequiredStatusChecks: &RequiredStatusChecksRuleParameters{ + DoNotEnforceOnCreate: Ptr(true), + RequiredStatusChecks: []*RuleStatusCheck{ { Context: "test", IntegrationID: Ptr(int64(1)), }, }, StrictRequiredStatusChecksPolicy: true, - }), - NewNonFastForwardRule(), - NewCommitMessagePatternRule(&RulePatternParameters{ + }, + NonFastForward: &EmptyRuleParameters{}, + CommitMessagePattern: &PatternRuleParameters{ Name: Ptr("avoid test commits"), Negate: Ptr(true), Operator: "starts_with", Pattern: "[test]", - }), - NewCommitAuthorEmailPatternRule(&RulePatternParameters{ + }, + CommitAuthorEmailPattern: &PatternRuleParameters{ Operator: "contains", Pattern: "github", - }), - NewCommitterEmailPatternRule(&RulePatternParameters{ + }, + CommitterEmailPattern: &PatternRuleParameters{ Name: Ptr("avoid commit emails"), Negate: Ptr(true), Operator: "ends_with", Pattern: "abc", - }), - NewBranchNamePatternRule(&RulePatternParameters{ + }, + BranchNamePattern: &PatternRuleParameters{ Name: Ptr("avoid branch names"), Negate: Ptr(true), Operator: "regex", Pattern: "github$", - }), - NewTagNamePatternRule(&RulePatternParameters{ + }, + TagNamePattern: &PatternRuleParameters{ Name: Ptr("avoid tag names"), Negate: Ptr(true), Operator: "contains", Pattern: "github", - }), - NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ - RequiredCodeScanningTools: []*RuleRequiredCodeScanningTool{ + }, + CodeScanning: &CodeScanningRuleParameters{ + CodeScanningTools: []*RuleCodeScanningTool{ { + AlertsThreshold: CodeScanningAlertsThresholdErrors, + SecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdHighOrHigher, Tool: "CodeQL", - SecurityAlertsThreshold: "high_or_higher", - AlertsThreshold: "errors", }, }, - }), + }, }, } if !cmp.Equal(ruleset, want) { - t.Errorf("Enterprise.CreateEnterpriseRuleset returned %+v, want %+v", ruleset, want) + t.Errorf("Enterprise.CreateRepositoryRuleset returned %+v, want %+v", ruleset, want) } - const methodName = "CreateEnterpriseRuleset" + const methodName = "CreateRepositoryRuleset" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Enterprise.CreateEnterpriseRuleset(ctx, "e", Ruleset{}) + got, resp, err := client.Enterprise.CreateRepositoryRuleset(ctx, "e", RepositoryRuleset{}) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -382,14 +385,14 @@ func TestEnterpriseService_CreateEnterpriseRuleset_OrgNameRepoName(t *testing.T) }) } -func TestEnterpriseService_CreateEnterpriseRuleset_OrgNameRepoProperty(t *testing.T) { +func TestEnterpriseService_CreateRepositoryRuleset_OrgNameRepoProperty(t *testing.T) { t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/rulesets", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") fmt.Fprint(w, `{ - "id": 21, + "id": 84, "name": "ruleset", "target": "branch", "source_type": "Enterprise", @@ -479,6 +482,7 @@ func TestEnterpriseService_CreateEnterpriseRuleset_OrgNameRepoProperty(t *testin { "type": "required_status_checks", "parameters": { + "do_not_enforce_on_create": true, "required_status_checks": [ { "context": "test", @@ -551,227 +555,229 @@ func TestEnterpriseService_CreateEnterpriseRuleset_OrgNameRepoProperty(t *testin }) ctx := context.Background() - ruleset, _, err := client.Enterprise.CreateEnterpriseRuleset(ctx, "e", Ruleset{ + ruleset, _, err := client.Enterprise.CreateRepositoryRuleset(ctx, "e", RepositoryRuleset{ Name: "ruleset", - Target: Ptr("branch"), + Target: Ptr(RulesetTargetBranch), Enforcement: "active", BypassActors: []*BypassActor{ { ActorID: Ptr(int64(234)), - ActorType: Ptr("Team"), + ActorType: Ptr(BypassActorTypeTeam), }, }, - Conditions: &RulesetConditions{ - OrganizationName: &RulesetOrganizationNamesConditionParameters{ + Conditions: &RepositoryRulesetConditions{ + OrganizationName: &RepositoryRulesetOrganizationNamesConditionParameters{ Include: []string{"important_organization", "another_important_organization"}, Exclude: []string{"unimportant_organization"}, }, - RepositoryProperty: &RulesetRepositoryPropertyConditionParameters{ - Include: []RulesetRepositoryPropertyTargetParameters{ + RepositoryProperty: &RepositoryRulesetRepositoryPropertyConditionParameters{ + Include: []*RepositoryRulesetRepositoryPropertyTargetParameters{ { - Name: "testIncludeProp", - Source: Ptr("custom"), - Values: []string{"true"}, + Name: "testIncludeProp", + Source: Ptr("custom"), + PropertyValues: []string{"true"}, }, }, - Exclude: []RulesetRepositoryPropertyTargetParameters{ + Exclude: []*RepositoryRulesetRepositoryPropertyTargetParameters{ { - Name: "testExcludeProp", - Values: []string{"false"}, + Name: "testExcludeProp", + PropertyValues: []string{"false"}, }, }, }, - RefName: &RulesetRefConditionParameters{ + RefName: &RepositoryRulesetRefConditionParameters{ Include: []string{"refs/heads/main", "refs/heads/master"}, Exclude: []string{"refs/heads/dev*"}, }, }, - Rules: []*RepositoryRule{ - NewCreationRule(), - NewUpdateRule(&UpdateAllowsFetchAndMergeRuleParameters{ + Rules: &RepositoryRulesetRules{ + Creation: &EmptyRuleParameters{}, + Update: &UpdateRuleParameters{ UpdateAllowsFetchAndMerge: true, - }), - NewDeletionRule(), - NewRequiredLinearHistoryRule(), - NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ + }, + Deletion: &EmptyRuleParameters{}, + RequiredLinearHistory: &EmptyRuleParameters{}, + RequiredDeployments: &RequiredDeploymentsRuleParameters{ RequiredDeploymentEnvironments: []string{"test"}, - }), - NewRequiredSignaturesRule(), - NewPullRequestRule(&PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, + }, + RequiredSignatures: &EmptyRuleParameters{}, + PullRequest: &PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{MergeMethodRebase, MergeMethodSquash}, DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, RequiredApprovingReviewCount: 1, RequiredReviewThreadResolution: true, - }), - NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ - RequiredStatusChecks: []RuleRequiredStatusChecks{ + }, + RequiredStatusChecks: &RequiredStatusChecksRuleParameters{ + DoNotEnforceOnCreate: Ptr(true), + RequiredStatusChecks: []*RuleStatusCheck{ { Context: "test", IntegrationID: Ptr(int64(1)), }, }, StrictRequiredStatusChecksPolicy: true, - }), - NewNonFastForwardRule(), - NewCommitMessagePatternRule(&RulePatternParameters{ + }, + NonFastForward: &EmptyRuleParameters{}, + CommitMessagePattern: &PatternRuleParameters{ Name: Ptr("avoid test commits"), Negate: Ptr(true), Operator: "starts_with", Pattern: "[test]", - }), - NewCommitAuthorEmailPatternRule(&RulePatternParameters{ + }, + CommitAuthorEmailPattern: &PatternRuleParameters{ Operator: "contains", Pattern: "github", - }), - NewCommitterEmailPatternRule(&RulePatternParameters{ + }, + CommitterEmailPattern: &PatternRuleParameters{ Name: Ptr("avoid commit emails"), Negate: Ptr(true), Operator: "ends_with", Pattern: "abc", - }), - NewBranchNamePatternRule(&RulePatternParameters{ + }, + BranchNamePattern: &PatternRuleParameters{ Name: Ptr("avoid branch names"), Negate: Ptr(true), Operator: "regex", Pattern: "github$", - }), - NewTagNamePatternRule(&RulePatternParameters{ + }, + TagNamePattern: &PatternRuleParameters{ Name: Ptr("avoid tag names"), Negate: Ptr(true), Operator: "contains", Pattern: "github", - }), - NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ - RequiredCodeScanningTools: []*RuleRequiredCodeScanningTool{ + }, + CodeScanning: &CodeScanningRuleParameters{ + CodeScanningTools: []*RuleCodeScanningTool{ { + AlertsThreshold: CodeScanningAlertsThresholdErrors, + SecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdHighOrHigher, Tool: "CodeQL", - SecurityAlertsThreshold: "high_or_higher", - AlertsThreshold: "errors", }, }, - }), + }, }, }) if err != nil { - t.Errorf("Enterprise.CreateEnterpriseRuleset returned error: %v", err) + t.Errorf("Enterprise.CreateRepositoryRuleset returned error: %v", err) } - want := &Ruleset{ - ID: Ptr(int64(21)), + want := &RepositoryRuleset{ + ID: Ptr(int64(84)), Name: "ruleset", - Target: Ptr("branch"), - SourceType: Ptr("Enterprise"), + Target: Ptr(RulesetTargetBranch), + SourceType: Ptr(RulesetSourceTypeEnterprise), Source: "e", Enforcement: "active", BypassActors: []*BypassActor{ { ActorID: Ptr(int64(234)), - ActorType: Ptr("Team"), + ActorType: Ptr(BypassActorTypeTeam), }, }, - Conditions: &RulesetConditions{ - OrganizationName: &RulesetOrganizationNamesConditionParameters{ + Conditions: &RepositoryRulesetConditions{ + OrganizationName: &RepositoryRulesetOrganizationNamesConditionParameters{ Include: []string{"important_organization", "another_important_organization"}, Exclude: []string{"unimportant_organization"}, }, - RepositoryProperty: &RulesetRepositoryPropertyConditionParameters{ - Include: []RulesetRepositoryPropertyTargetParameters{ + RepositoryProperty: &RepositoryRulesetRepositoryPropertyConditionParameters{ + Include: []*RepositoryRulesetRepositoryPropertyTargetParameters{ { - Name: "testIncludeProp", - Source: Ptr("custom"), - Values: []string{"true"}, + Name: "testIncludeProp", + Source: Ptr("custom"), + PropertyValues: []string{"true"}, }, }, - Exclude: []RulesetRepositoryPropertyTargetParameters{ + Exclude: []*RepositoryRulesetRepositoryPropertyTargetParameters{ { - Name: "testExcludeProp", - Values: []string{"false"}, + Name: "testExcludeProp", + PropertyValues: []string{"false"}, }, }, }, - RefName: &RulesetRefConditionParameters{ + RefName: &RepositoryRulesetRefConditionParameters{ Include: []string{"refs/heads/main", "refs/heads/master"}, Exclude: []string{"refs/heads/dev*"}, }, }, - Rules: []*RepositoryRule{ - NewCreationRule(), - NewUpdateRule(&UpdateAllowsFetchAndMergeRuleParameters{ + Rules: &RepositoryRulesetRules{ + Creation: &EmptyRuleParameters{}, + Update: &UpdateRuleParameters{ UpdateAllowsFetchAndMerge: true, - }), - NewDeletionRule(), - NewRequiredLinearHistoryRule(), - NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ + }, + Deletion: &EmptyRuleParameters{}, + RequiredLinearHistory: &EmptyRuleParameters{}, + RequiredDeployments: &RequiredDeploymentsRuleParameters{ RequiredDeploymentEnvironments: []string{"test"}, - }), - NewRequiredSignaturesRule(), - NewPullRequestRule(&PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, + }, + RequiredSignatures: &EmptyRuleParameters{}, + PullRequest: &PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{MergeMethodRebase, MergeMethodSquash}, DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, RequiredApprovingReviewCount: 1, RequiredReviewThreadResolution: true, - }), - NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ - RequiredStatusChecks: []RuleRequiredStatusChecks{ + }, + RequiredStatusChecks: &RequiredStatusChecksRuleParameters{ + DoNotEnforceOnCreate: Ptr(true), + RequiredStatusChecks: []*RuleStatusCheck{ { Context: "test", IntegrationID: Ptr(int64(1)), }, }, StrictRequiredStatusChecksPolicy: true, - }), - NewNonFastForwardRule(), - NewCommitMessagePatternRule(&RulePatternParameters{ + }, + NonFastForward: &EmptyRuleParameters{}, + CommitMessagePattern: &PatternRuleParameters{ Name: Ptr("avoid test commits"), Negate: Ptr(true), Operator: "starts_with", Pattern: "[test]", - }), - NewCommitAuthorEmailPatternRule(&RulePatternParameters{ + }, + CommitAuthorEmailPattern: &PatternRuleParameters{ Operator: "contains", Pattern: "github", - }), - NewCommitterEmailPatternRule(&RulePatternParameters{ + }, + CommitterEmailPattern: &PatternRuleParameters{ Name: Ptr("avoid commit emails"), Negate: Ptr(true), Operator: "ends_with", Pattern: "abc", - }), - NewBranchNamePatternRule(&RulePatternParameters{ + }, + BranchNamePattern: &PatternRuleParameters{ Name: Ptr("avoid branch names"), Negate: Ptr(true), Operator: "regex", Pattern: "github$", - }), - NewTagNamePatternRule(&RulePatternParameters{ + }, + TagNamePattern: &PatternRuleParameters{ Name: Ptr("avoid tag names"), Negate: Ptr(true), Operator: "contains", Pattern: "github", - }), - NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ - RequiredCodeScanningTools: []*RuleRequiredCodeScanningTool{ + }, + CodeScanning: &CodeScanningRuleParameters{ + CodeScanningTools: []*RuleCodeScanningTool{ { + AlertsThreshold: CodeScanningAlertsThresholdErrors, + SecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdHighOrHigher, Tool: "CodeQL", - SecurityAlertsThreshold: "high_or_higher", - AlertsThreshold: "errors", }, }, - }), + }, }, } if !cmp.Equal(ruleset, want) { - t.Errorf("Enterprise.CreateEnterpriseRuleset returned %+v, want %+v", ruleset, want) + t.Errorf("Enterprise.CreateRepositoryRuleset returned %+v, want %+v", ruleset, want) } - const methodName = "CreateEnterpriseRuleset" + const methodName = "CreateRepositoryRuleset" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Enterprise.CreateEnterpriseRuleset(ctx, "e", Ruleset{}) + got, resp, err := client.Enterprise.CreateRepositoryRuleset(ctx, "e", RepositoryRuleset{}) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -779,14 +785,14 @@ func TestEnterpriseService_CreateEnterpriseRuleset_OrgNameRepoProperty(t *testin }) } -func TestEnterpriseService_CreateEnterpriseRuleset_OrgIdRepoName(t *testing.T) { +func TestEnterpriseService_CreateRepositoryRuleset_OrgIdRepoName(t *testing.T) { t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/rulesets", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") fmt.Fprint(w, `{ - "id": 21, + "id": 84, "name": "ruleset", "target": "branch", "source_type": "Enterprise", @@ -861,6 +867,7 @@ func TestEnterpriseService_CreateEnterpriseRuleset_OrgIdRepoName(t *testing.T) { { "type": "required_status_checks", "parameters": { + "do_not_enforce_on_create": true, "required_status_checks": [ { "context": "test", @@ -933,205 +940,207 @@ func TestEnterpriseService_CreateEnterpriseRuleset_OrgIdRepoName(t *testing.T) { }) ctx := context.Background() - ruleset, _, err := client.Enterprise.CreateEnterpriseRuleset(ctx, "e", Ruleset{ + ruleset, _, err := client.Enterprise.CreateRepositoryRuleset(ctx, "e", RepositoryRuleset{ Name: "ruleset", - Target: Ptr("branch"), + Target: Ptr(RulesetTargetBranch), Enforcement: "active", BypassActors: []*BypassActor{ { ActorID: Ptr(int64(234)), - ActorType: Ptr("Team"), + ActorType: Ptr(BypassActorTypeTeam), }, }, - Conditions: &RulesetConditions{ - OrganizationID: &RulesetOrganizationIDsConditionParameters{ + Conditions: &RepositoryRulesetConditions{ + OrganizationID: &RepositoryRulesetOrganizationIDsConditionParameters{ OrganizationIDs: []int64{1001, 1002}, }, - RepositoryName: &RulesetRepositoryNamesConditionParameters{ + RepositoryName: &RepositoryRulesetRepositoryNamesConditionParameters{ Include: []string{"important_repository", "another_important_repository"}, Exclude: []string{"unimportant_repository"}, Protected: Ptr(true), }, - RefName: &RulesetRefConditionParameters{ + RefName: &RepositoryRulesetRefConditionParameters{ Include: []string{"refs/heads/main", "refs/heads/master"}, Exclude: []string{"refs/heads/dev*"}, }, }, - Rules: []*RepositoryRule{ - NewCreationRule(), - NewUpdateRule(&UpdateAllowsFetchAndMergeRuleParameters{ + Rules: &RepositoryRulesetRules{ + Creation: &EmptyRuleParameters{}, + Update: &UpdateRuleParameters{ UpdateAllowsFetchAndMerge: true, - }), - NewDeletionRule(), - NewRequiredLinearHistoryRule(), - NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ + }, + Deletion: &EmptyRuleParameters{}, + RequiredLinearHistory: &EmptyRuleParameters{}, + RequiredDeployments: &RequiredDeploymentsRuleParameters{ RequiredDeploymentEnvironments: []string{"test"}, - }), - NewRequiredSignaturesRule(), - NewPullRequestRule(&PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, + }, + RequiredSignatures: &EmptyRuleParameters{}, + PullRequest: &PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{MergeMethodRebase, MergeMethodSquash}, DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, RequiredApprovingReviewCount: 1, RequiredReviewThreadResolution: true, - }), - NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ - RequiredStatusChecks: []RuleRequiredStatusChecks{ + }, + RequiredStatusChecks: &RequiredStatusChecksRuleParameters{ + DoNotEnforceOnCreate: Ptr(true), + RequiredStatusChecks: []*RuleStatusCheck{ { Context: "test", IntegrationID: Ptr(int64(1)), }, }, StrictRequiredStatusChecksPolicy: true, - }), - NewNonFastForwardRule(), - NewCommitMessagePatternRule(&RulePatternParameters{ + }, + NonFastForward: &EmptyRuleParameters{}, + CommitMessagePattern: &PatternRuleParameters{ Name: Ptr("avoid test commits"), Negate: Ptr(true), Operator: "starts_with", Pattern: "[test]", - }), - NewCommitAuthorEmailPatternRule(&RulePatternParameters{ + }, + CommitAuthorEmailPattern: &PatternRuleParameters{ Operator: "contains", Pattern: "github", - }), - NewCommitterEmailPatternRule(&RulePatternParameters{ + }, + CommitterEmailPattern: &PatternRuleParameters{ Name: Ptr("avoid commit emails"), Negate: Ptr(true), Operator: "ends_with", Pattern: "abc", - }), - NewBranchNamePatternRule(&RulePatternParameters{ + }, + BranchNamePattern: &PatternRuleParameters{ Name: Ptr("avoid branch names"), Negate: Ptr(true), Operator: "regex", Pattern: "github$", - }), - NewTagNamePatternRule(&RulePatternParameters{ + }, + TagNamePattern: &PatternRuleParameters{ Name: Ptr("avoid tag names"), Negate: Ptr(true), Operator: "contains", Pattern: "github", - }), - NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ - RequiredCodeScanningTools: []*RuleRequiredCodeScanningTool{ + }, + CodeScanning: &CodeScanningRuleParameters{ + CodeScanningTools: []*RuleCodeScanningTool{ { + AlertsThreshold: CodeScanningAlertsThresholdErrors, + SecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdHighOrHigher, Tool: "CodeQL", - SecurityAlertsThreshold: "high_or_higher", - AlertsThreshold: "errors", }, }, - }), + }, }, }) if err != nil { - t.Errorf("Enterprise.CreateEnterpriseRuleset returned error: %v", err) + t.Errorf("Enterprise.CreateRepositoryRuleset returned error: %v", err) } - want := &Ruleset{ - ID: Ptr(int64(21)), + want := &RepositoryRuleset{ + ID: Ptr(int64(84)), Name: "ruleset", - Target: Ptr("branch"), - SourceType: Ptr("Enterprise"), + Target: Ptr(RulesetTargetBranch), + SourceType: Ptr(RulesetSourceTypeEnterprise), Source: "e", Enforcement: "active", BypassActors: []*BypassActor{ { ActorID: Ptr(int64(234)), - ActorType: Ptr("Team"), + ActorType: Ptr(BypassActorTypeTeam), }, }, - Conditions: &RulesetConditions{ - OrganizationID: &RulesetOrganizationIDsConditionParameters{ + Conditions: &RepositoryRulesetConditions{ + OrganizationID: &RepositoryRulesetOrganizationIDsConditionParameters{ OrganizationIDs: []int64{1001, 1002}, }, - RepositoryName: &RulesetRepositoryNamesConditionParameters{ + RepositoryName: &RepositoryRulesetRepositoryNamesConditionParameters{ Include: []string{"important_repository", "another_important_repository"}, Exclude: []string{"unimportant_repository"}, Protected: Ptr(true), }, - RefName: &RulesetRefConditionParameters{ + RefName: &RepositoryRulesetRefConditionParameters{ Include: []string{"refs/heads/main", "refs/heads/master"}, Exclude: []string{"refs/heads/dev*"}, }, }, - Rules: []*RepositoryRule{ - NewCreationRule(), - NewUpdateRule(&UpdateAllowsFetchAndMergeRuleParameters{ + Rules: &RepositoryRulesetRules{ + Creation: &EmptyRuleParameters{}, + Update: &UpdateRuleParameters{ UpdateAllowsFetchAndMerge: true, - }), - NewDeletionRule(), - NewRequiredLinearHistoryRule(), - NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ + }, + Deletion: &EmptyRuleParameters{}, + RequiredLinearHistory: &EmptyRuleParameters{}, + RequiredDeployments: &RequiredDeploymentsRuleParameters{ RequiredDeploymentEnvironments: []string{"test"}, - }), - NewRequiredSignaturesRule(), - NewPullRequestRule(&PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, + }, + RequiredSignatures: &EmptyRuleParameters{}, + PullRequest: &PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{MergeMethodRebase, MergeMethodSquash}, DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, RequiredApprovingReviewCount: 1, RequiredReviewThreadResolution: true, - }), - NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ - RequiredStatusChecks: []RuleRequiredStatusChecks{ + }, + RequiredStatusChecks: &RequiredStatusChecksRuleParameters{ + DoNotEnforceOnCreate: Ptr(true), + RequiredStatusChecks: []*RuleStatusCheck{ { Context: "test", IntegrationID: Ptr(int64(1)), }, }, StrictRequiredStatusChecksPolicy: true, - }), - NewNonFastForwardRule(), - NewCommitMessagePatternRule(&RulePatternParameters{ + }, + NonFastForward: &EmptyRuleParameters{}, + CommitMessagePattern: &PatternRuleParameters{ Name: Ptr("avoid test commits"), Negate: Ptr(true), Operator: "starts_with", Pattern: "[test]", - }), - NewCommitAuthorEmailPatternRule(&RulePatternParameters{ + }, + CommitAuthorEmailPattern: &PatternRuleParameters{ Operator: "contains", Pattern: "github", - }), - NewCommitterEmailPatternRule(&RulePatternParameters{ + }, + CommitterEmailPattern: &PatternRuleParameters{ Name: Ptr("avoid commit emails"), Negate: Ptr(true), Operator: "ends_with", Pattern: "abc", - }), - NewBranchNamePatternRule(&RulePatternParameters{ + }, + BranchNamePattern: &PatternRuleParameters{ Name: Ptr("avoid branch names"), Negate: Ptr(true), Operator: "regex", Pattern: "github$", - }), - NewTagNamePatternRule(&RulePatternParameters{ + }, + TagNamePattern: &PatternRuleParameters{ Name: Ptr("avoid tag names"), Negate: Ptr(true), Operator: "contains", Pattern: "github", - }), - NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ - RequiredCodeScanningTools: []*RuleRequiredCodeScanningTool{ + }, + CodeScanning: &CodeScanningRuleParameters{ + CodeScanningTools: []*RuleCodeScanningTool{ { + AlertsThreshold: CodeScanningAlertsThresholdErrors, + SecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdHighOrHigher, Tool: "CodeQL", - SecurityAlertsThreshold: "high_or_higher", - AlertsThreshold: "errors", }, }, - }), + }, }, } if !cmp.Equal(ruleset, want) { - t.Errorf("Enterprise.CreateEnterpriseRuleset returned %+v, want %+v", ruleset, want) + t.Errorf("Enterprise.CreateRepositoryRuleset returned %+v, want %+v", ruleset, want) } - const methodName = "CreateEnterpriseRuleset" + const methodName = "CreateRepositoryRuleset" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Enterprise.CreateEnterpriseRuleset(ctx, "e", Ruleset{}) + got, resp, err := client.Enterprise.CreateRepositoryRuleset(ctx, "e", RepositoryRuleset{}) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -1139,14 +1148,14 @@ func TestEnterpriseService_CreateEnterpriseRuleset_OrgIdRepoName(t *testing.T) { }) } -func TestEnterpriseService_CreateEnterpriseRuleset_OrgIdRepoProperty(t *testing.T) { +func TestEnterpriseService_CreateRepositoryRuleset_OrgIdRepoProperty(t *testing.T) { t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/enterprises/e/rulesets", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") fmt.Fprint(w, `{ - "id": 21, + "id": 84, "name": "ruleset", "target": "branch", "source_type": "Enterprise", @@ -1230,6 +1239,7 @@ func TestEnterpriseService_CreateEnterpriseRuleset_OrgIdRepoProperty(t *testing. { "type": "required_status_checks", "parameters": { + "do_not_enforce_on_create": true, "required_status_checks": [ { "context": "test", @@ -1302,225 +1312,227 @@ func TestEnterpriseService_CreateEnterpriseRuleset_OrgIdRepoProperty(t *testing. }) ctx := context.Background() - ruleset, _, err := client.Enterprise.CreateEnterpriseRuleset(ctx, "e", Ruleset{ + ruleset, _, err := client.Enterprise.CreateRepositoryRuleset(ctx, "e", RepositoryRuleset{ Name: "ruleset", - Target: Ptr("branch"), + Target: Ptr(RulesetTargetBranch), Enforcement: "active", BypassActors: []*BypassActor{ { ActorID: Ptr(int64(234)), - ActorType: Ptr("Team"), + ActorType: Ptr(BypassActorTypeTeam), }, }, - Conditions: &RulesetConditions{ - OrganizationID: &RulesetOrganizationIDsConditionParameters{ + Conditions: &RepositoryRulesetConditions{ + OrganizationID: &RepositoryRulesetOrganizationIDsConditionParameters{ OrganizationIDs: []int64{1001, 1002}, }, - RepositoryProperty: &RulesetRepositoryPropertyConditionParameters{ - Include: []RulesetRepositoryPropertyTargetParameters{ + RepositoryProperty: &RepositoryRulesetRepositoryPropertyConditionParameters{ + Include: []*RepositoryRulesetRepositoryPropertyTargetParameters{ { - Name: "testIncludeProp", - Source: Ptr("custom"), - Values: []string{"true"}, + Name: "testIncludeProp", + Source: Ptr("custom"), + PropertyValues: []string{"true"}, }, }, - Exclude: []RulesetRepositoryPropertyTargetParameters{ + Exclude: []*RepositoryRulesetRepositoryPropertyTargetParameters{ { - Name: "testExcludeProp", - Values: []string{"false"}, + Name: "testExcludeProp", + PropertyValues: []string{"false"}, }, }, }, - RefName: &RulesetRefConditionParameters{ + RefName: &RepositoryRulesetRefConditionParameters{ Include: []string{"refs/heads/main", "refs/heads/master"}, Exclude: []string{"refs/heads/dev*"}, }, }, - Rules: []*RepositoryRule{ - NewCreationRule(), - NewUpdateRule(&UpdateAllowsFetchAndMergeRuleParameters{ + Rules: &RepositoryRulesetRules{ + Creation: &EmptyRuleParameters{}, + Update: &UpdateRuleParameters{ UpdateAllowsFetchAndMerge: true, - }), - NewDeletionRule(), - NewRequiredLinearHistoryRule(), - NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ + }, + Deletion: &EmptyRuleParameters{}, + RequiredLinearHistory: &EmptyRuleParameters{}, + RequiredDeployments: &RequiredDeploymentsRuleParameters{ RequiredDeploymentEnvironments: []string{"test"}, - }), - NewRequiredSignaturesRule(), - NewPullRequestRule(&PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, + }, + RequiredSignatures: &EmptyRuleParameters{}, + PullRequest: &PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{MergeMethodRebase, MergeMethodSquash}, DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, RequiredApprovingReviewCount: 1, RequiredReviewThreadResolution: true, - }), - NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ - RequiredStatusChecks: []RuleRequiredStatusChecks{ + }, + RequiredStatusChecks: &RequiredStatusChecksRuleParameters{ + DoNotEnforceOnCreate: Ptr(true), + RequiredStatusChecks: []*RuleStatusCheck{ { Context: "test", IntegrationID: Ptr(int64(1)), }, }, StrictRequiredStatusChecksPolicy: true, - }), - NewNonFastForwardRule(), - NewCommitMessagePatternRule(&RulePatternParameters{ + }, + NonFastForward: &EmptyRuleParameters{}, + CommitMessagePattern: &PatternRuleParameters{ Name: Ptr("avoid test commits"), Negate: Ptr(true), Operator: "starts_with", Pattern: "[test]", - }), - NewCommitAuthorEmailPatternRule(&RulePatternParameters{ + }, + CommitAuthorEmailPattern: &PatternRuleParameters{ Operator: "contains", Pattern: "github", - }), - NewCommitterEmailPatternRule(&RulePatternParameters{ + }, + CommitterEmailPattern: &PatternRuleParameters{ Name: Ptr("avoid commit emails"), Negate: Ptr(true), Operator: "ends_with", Pattern: "abc", - }), - NewBranchNamePatternRule(&RulePatternParameters{ + }, + BranchNamePattern: &PatternRuleParameters{ Name: Ptr("avoid branch names"), Negate: Ptr(true), Operator: "regex", Pattern: "github$", - }), - NewTagNamePatternRule(&RulePatternParameters{ + }, + TagNamePattern: &PatternRuleParameters{ Name: Ptr("avoid tag names"), Negate: Ptr(true), Operator: "contains", Pattern: "github", - }), - NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ - RequiredCodeScanningTools: []*RuleRequiredCodeScanningTool{ + }, + CodeScanning: &CodeScanningRuleParameters{ + CodeScanningTools: []*RuleCodeScanningTool{ { + AlertsThreshold: CodeScanningAlertsThresholdErrors, + SecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdHighOrHigher, Tool: "CodeQL", - SecurityAlertsThreshold: "high_or_higher", - AlertsThreshold: "errors", }, }, - }), + }, }, }) if err != nil { - t.Errorf("Enterprise.CreateEnterpriseRuleset returned error: %v", err) + t.Errorf("Enterprise.CreateRepositoryRuleset returned error: %v", err) } - want := &Ruleset{ - ID: Ptr(int64(21)), + want := &RepositoryRuleset{ + ID: Ptr(int64(84)), Name: "ruleset", - Target: Ptr("branch"), - SourceType: Ptr("Enterprise"), + Target: Ptr(RulesetTargetBranch), + SourceType: Ptr(RulesetSourceTypeEnterprise), Source: "e", Enforcement: "active", BypassActors: []*BypassActor{ { ActorID: Ptr(int64(234)), - ActorType: Ptr("Team"), + ActorType: Ptr(BypassActorTypeTeam), }, }, - Conditions: &RulesetConditions{ - OrganizationID: &RulesetOrganizationIDsConditionParameters{ + Conditions: &RepositoryRulesetConditions{ + OrganizationID: &RepositoryRulesetOrganizationIDsConditionParameters{ OrganizationIDs: []int64{1001, 1002}, }, - RepositoryProperty: &RulesetRepositoryPropertyConditionParameters{ - Include: []RulesetRepositoryPropertyTargetParameters{ + RepositoryProperty: &RepositoryRulesetRepositoryPropertyConditionParameters{ + Include: []*RepositoryRulesetRepositoryPropertyTargetParameters{ { - Name: "testIncludeProp", - Source: Ptr("custom"), - Values: []string{"true"}, + Name: "testIncludeProp", + Source: Ptr("custom"), + PropertyValues: []string{"true"}, }, }, - Exclude: []RulesetRepositoryPropertyTargetParameters{ + Exclude: []*RepositoryRulesetRepositoryPropertyTargetParameters{ { - Name: "testExcludeProp", - Values: []string{"false"}, + Name: "testExcludeProp", + PropertyValues: []string{"false"}, }, }, }, - RefName: &RulesetRefConditionParameters{ + RefName: &RepositoryRulesetRefConditionParameters{ Include: []string{"refs/heads/main", "refs/heads/master"}, Exclude: []string{"refs/heads/dev*"}, }, }, - Rules: []*RepositoryRule{ - NewCreationRule(), - NewUpdateRule(&UpdateAllowsFetchAndMergeRuleParameters{ + Rules: &RepositoryRulesetRules{ + Creation: &EmptyRuleParameters{}, + Update: &UpdateRuleParameters{ UpdateAllowsFetchAndMerge: true, - }), - NewDeletionRule(), - NewRequiredLinearHistoryRule(), - NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ + }, + Deletion: &EmptyRuleParameters{}, + RequiredLinearHistory: &EmptyRuleParameters{}, + RequiredDeployments: &RequiredDeploymentsRuleParameters{ RequiredDeploymentEnvironments: []string{"test"}, - }), - NewRequiredSignaturesRule(), - NewPullRequestRule(&PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, + }, + RequiredSignatures: &EmptyRuleParameters{}, + PullRequest: &PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{MergeMethodRebase, MergeMethodSquash}, DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, RequiredApprovingReviewCount: 1, RequiredReviewThreadResolution: true, - }), - NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ - RequiredStatusChecks: []RuleRequiredStatusChecks{ + }, + RequiredStatusChecks: &RequiredStatusChecksRuleParameters{ + DoNotEnforceOnCreate: Ptr(true), + RequiredStatusChecks: []*RuleStatusCheck{ { Context: "test", IntegrationID: Ptr(int64(1)), }, }, StrictRequiredStatusChecksPolicy: true, - }), - NewNonFastForwardRule(), - NewCommitMessagePatternRule(&RulePatternParameters{ + }, + NonFastForward: &EmptyRuleParameters{}, + CommitMessagePattern: &PatternRuleParameters{ Name: Ptr("avoid test commits"), Negate: Ptr(true), Operator: "starts_with", Pattern: "[test]", - }), - NewCommitAuthorEmailPatternRule(&RulePatternParameters{ + }, + CommitAuthorEmailPattern: &PatternRuleParameters{ Operator: "contains", Pattern: "github", - }), - NewCommitterEmailPatternRule(&RulePatternParameters{ + }, + CommitterEmailPattern: &PatternRuleParameters{ Name: Ptr("avoid commit emails"), Negate: Ptr(true), Operator: "ends_with", Pattern: "abc", - }), - NewBranchNamePatternRule(&RulePatternParameters{ + }, + BranchNamePattern: &PatternRuleParameters{ Name: Ptr("avoid branch names"), Negate: Ptr(true), Operator: "regex", Pattern: "github$", - }), - NewTagNamePatternRule(&RulePatternParameters{ + }, + TagNamePattern: &PatternRuleParameters{ Name: Ptr("avoid tag names"), Negate: Ptr(true), Operator: "contains", Pattern: "github", - }), - NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ - RequiredCodeScanningTools: []*RuleRequiredCodeScanningTool{ + }, + CodeScanning: &CodeScanningRuleParameters{ + CodeScanningTools: []*RuleCodeScanningTool{ { + AlertsThreshold: CodeScanningAlertsThresholdErrors, + SecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdHighOrHigher, Tool: "CodeQL", - SecurityAlertsThreshold: "high_or_higher", - AlertsThreshold: "errors", }, }, - }), + }, }, } if !cmp.Equal(ruleset, want) { - t.Errorf("Enterprise.CreateEnterpriseRuleset returned %+v, want %+v", ruleset, want) + t.Errorf("Enterprise.CreateRepositoryRuleset returned %+v, want %+v", ruleset, want) } - const methodName = "CreateEnterpriseRuleset" + const methodName = "CreateRepositoryRuleset" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Enterprise.CreateEnterpriseRuleset(ctx, "e", Ruleset{}) + got, resp, err := client.Enterprise.CreateRepositoryRuleset(ctx, "e", RepositoryRuleset{}) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -1528,14 +1540,14 @@ func TestEnterpriseService_CreateEnterpriseRuleset_OrgIdRepoProperty(t *testing. }) } -func TestEnterpriseService_GetEnterpriseRuleset(t *testing.T) { +func TestEnterpriseService_GetRepositoryRuleset(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/enterprises/e/rulesets/26110", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/enterprises/e/rulesets/84", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `{ - "id": 26110, + "id": 84, "name": "test ruleset", "target": "branch", "source_type": "Enterprise", @@ -1545,7 +1557,7 @@ func TestEnterpriseService_GetEnterpriseRuleset(t *testing.T) { "node_id": "nid", "_links": { "self": { - "href": "https://api.github.com/enterprises/e/rulesets/26110" + "href": "https://api.github.com/enterprises/e/rulesets/84" } }, "conditions": { @@ -1587,49 +1599,47 @@ func TestEnterpriseService_GetEnterpriseRuleset(t *testing.T) { }) ctx := context.Background() - rulesets, _, err := client.Enterprise.GetEnterpriseRuleset(ctx, "e", 26110) + rulesets, _, err := client.Enterprise.GetRepositoryRuleset(ctx, "e", 84) if err != nil { - t.Errorf("Enterprise.GetEnterpriseRuleset returned error: %v", err) + t.Errorf("Enterprise.GetRepositoryRuleset returned error: %v", err) } - want := &Ruleset{ - ID: Ptr(int64(26110)), + want := &RepositoryRuleset{ + ID: Ptr(int64(84)), Name: "test ruleset", - Target: Ptr("branch"), - SourceType: Ptr("Enterprise"), + Target: Ptr(RulesetTargetBranch), + SourceType: Ptr(RulesetSourceTypeEnterprise), Source: "e", Enforcement: "active", NodeID: Ptr("nid"), - Links: &RulesetLinks{ - Self: &RulesetLink{HRef: Ptr("https://api.github.com/enterprises/e/rulesets/26110")}, + Links: &RepositoryRulesetLinks{ + Self: &RepositoryRulesetLink{HRef: Ptr("https://api.github.com/enterprises/e/rulesets/84")}, }, - Conditions: &RulesetConditions{ - OrganizationName: &RulesetOrganizationNamesConditionParameters{ + Conditions: &RepositoryRulesetConditions{ + OrganizationName: &RepositoryRulesetOrganizationNamesConditionParameters{ Include: []string{"important_organization", "another_important_organization"}, Exclude: []string{"unimportant_organization"}, }, - RepositoryName: &RulesetRepositoryNamesConditionParameters{ + RepositoryName: &RepositoryRulesetRepositoryNamesConditionParameters{ Include: []string{"important_repository", "another_important_repository"}, Exclude: []string{"unimportant_repository"}, Protected: Ptr(true), }, - RefName: &RulesetRefConditionParameters{ + RefName: &RepositoryRulesetRefConditionParameters{ Include: []string{"refs/heads/main", "refs/heads/master"}, Exclude: []string{"refs/heads/dev*"}, }, }, - Rules: []*RepositoryRule{ - NewCreationRule(), - }, + Rules: &RepositoryRulesetRules{Creation: &EmptyRuleParameters{}}, } if !cmp.Equal(rulesets, want) { - t.Errorf("Enterprise.GetEnterpriseRuleset returned %+v, want %+v", rulesets, want) + t.Errorf("Enterprise.GetRepositoryRuleset returned %+v, want %+v", rulesets, want) } - const methodName = "GetEnterpriseRuleset" + const methodName = "GetRepositoryRuleset" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Enterprise.GetEnterpriseRuleset(ctx, "e", 26110) + got, resp, err := client.Enterprise.GetRepositoryRuleset(ctx, "e", 84) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -1637,14 +1647,14 @@ func TestEnterpriseService_GetEnterpriseRuleset(t *testing.T) { }) } -func TestEnterpriseService_UpdateEnterpriseRuleset(t *testing.T) { +func TestEnterpriseService_UpdateRepositoryRuleset(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/enterprises/e/rulesets/26110", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/enterprises/e/rulesets/84", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") fmt.Fprint(w, `{ - "id": 26110, + "id": 84, "name": "test ruleset", "target": "branch", "source_type": "Enterprise", @@ -1654,7 +1664,7 @@ func TestEnterpriseService_UpdateEnterpriseRuleset(t *testing.T) { "node_id": "nid", "_links": { "self": { - "href": "https://api.github.com/enterprises/e/rulesets/26110" + "href": "https://api.github.com/enterprises/e/rulesets/84" } }, "conditions": { @@ -1696,67 +1706,63 @@ func TestEnterpriseService_UpdateEnterpriseRuleset(t *testing.T) { }) ctx := context.Background() - rulesets, _, err := client.Enterprise.UpdateEnterpriseRuleset(ctx, "e", 26110, Ruleset{ + rulesets, _, err := client.Enterprise.UpdateRepositoryRuleset(ctx, "e", 84, RepositoryRuleset{ Name: "test ruleset", - Target: Ptr("branch"), + Target: Ptr(RulesetTargetBranch), Enforcement: "active", - Conditions: &RulesetConditions{ - RefName: &RulesetRefConditionParameters{ + Conditions: &RepositoryRulesetConditions{ + RefName: &RepositoryRulesetRefConditionParameters{ Include: []string{"refs/heads/main", "refs/heads/master"}, Exclude: []string{"refs/heads/dev*"}, }, - RepositoryName: &RulesetRepositoryNamesConditionParameters{ + RepositoryName: &RepositoryRulesetRepositoryNamesConditionParameters{ Include: []string{"important_repository", "another_important_repository"}, Exclude: []string{"unimportant_repository"}, Protected: Ptr(true), }, }, - Rules: []*RepositoryRule{ - NewCreationRule(), - }, + Rules: &RepositoryRulesetRules{Creation: &EmptyRuleParameters{}}, }) if err != nil { - t.Errorf("Enterprise.UpdateEnterpriseRuleset returned error: %v", err) + t.Errorf("Enterprise.UpdateRepositoryRuleset returned error: %v", err) } - want := &Ruleset{ - ID: Ptr(int64(26110)), + want := &RepositoryRuleset{ + ID: Ptr(int64(84)), Name: "test ruleset", - Target: Ptr("branch"), - SourceType: Ptr("Enterprise"), + Target: Ptr(RulesetTargetBranch), + SourceType: Ptr(RulesetSourceTypeEnterprise), Source: "e", Enforcement: "active", NodeID: Ptr("nid"), - Links: &RulesetLinks{ - Self: &RulesetLink{HRef: Ptr("https://api.github.com/enterprises/e/rulesets/26110")}, + Links: &RepositoryRulesetLinks{ + Self: &RepositoryRulesetLink{HRef: Ptr("https://api.github.com/enterprises/e/rulesets/84")}, }, - Conditions: &RulesetConditions{ - OrganizationName: &RulesetOrganizationNamesConditionParameters{ + Conditions: &RepositoryRulesetConditions{ + OrganizationName: &RepositoryRulesetOrganizationNamesConditionParameters{ Include: []string{"important_organization", "another_important_organization"}, Exclude: []string{"unimportant_organization"}, }, - RepositoryName: &RulesetRepositoryNamesConditionParameters{ + RepositoryName: &RepositoryRulesetRepositoryNamesConditionParameters{ Include: []string{"important_repository", "another_important_repository"}, Exclude: []string{"unimportant_repository"}, Protected: Ptr(true), }, - RefName: &RulesetRefConditionParameters{ + RefName: &RepositoryRulesetRefConditionParameters{ Include: []string{"refs/heads/main", "refs/heads/master"}, Exclude: []string{"refs/heads/dev*"}, }, }, - Rules: []*RepositoryRule{ - NewCreationRule(), - }, + Rules: &RepositoryRulesetRules{Creation: &EmptyRuleParameters{}}, } if !cmp.Equal(rulesets, want) { - t.Errorf("Enterprise.UpdateEnterpriseRuleset returned %+v, want %+v", rulesets, want) + t.Errorf("Enterprise.UpdateRepositoryRuleset returned %+v, want %+v", rulesets, want) } - const methodName = "UpdateEnterpriseRuleset" + const methodName = "UpdateRepositoryRuleset" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Enterprise.UpdateEnterpriseRuleset(ctx, "e", 26110, Ruleset{}) + got, resp, err := client.Enterprise.UpdateRepositoryRuleset(ctx, "e", 84, RepositoryRuleset{}) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -1764,14 +1770,14 @@ func TestEnterpriseService_UpdateEnterpriseRuleset(t *testing.T) { }) } -func TestEnterpriseService_UpdateEnterpriseRulesetClearBypassActor(t *testing.T) { +func TestEnterpriseService_UpdateRepositoryRulesetClearBypassActor(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/enterprises/e/rulesets/26110", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/enterprises/e/rulesets/84", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") fmt.Fprint(w, `{ - "id": 26110, + "id": 84, "name": "test ruleset", "target": "branch", "source_type": "Enterprise", @@ -1818,35 +1824,35 @@ func TestEnterpriseService_UpdateEnterpriseRulesetClearBypassActor(t *testing.T) ctx := context.Background() - _, err := client.Enterprise.UpdateEnterpriseRulesetClearBypassActor(ctx, "e", 26110) + _, err := client.Enterprise.UpdateRepositoryRulesetClearBypassActor(ctx, "e", 84) if err != nil { - t.Errorf("Enterprise.UpdateEnterpriseRulesetClearBypassActor returned error: %v \n", err) + t.Errorf("Enterprise.UpdateRepositoryRulesetClearBypassActor returned error: %v \n", err) } - const methodName = "UpdateEnterpriseRulesetClearBypassActor" + const methodName = "UpdateRepositoryRulesetClearBypassActor" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Enterprise.UpdateEnterpriseRulesetClearBypassActor(ctx, "e", 26110) + return client.Enterprise.UpdateRepositoryRulesetClearBypassActor(ctx, "e", 84) }) } -func TestEnterpriseService_DeleteEnterpriseRuleset(t *testing.T) { +func TestEnterpriseService_DeleteRepositoryRuleset(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/enterprises/e/rulesets/26110", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/enterprises/e/rulesets/84", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) ctx := context.Background() - _, err := client.Enterprise.DeleteEnterpriseRuleset(ctx, "e", 26110) + _, err := client.Enterprise.DeleteRepositoryRuleset(ctx, "e", 84) if err != nil { - t.Errorf("Enterprise.DeleteEnterpriseRuleset returned error: %v", err) + t.Errorf("Enterprise.DeleteRepositoryRuleset returned error: %v", err) } - const methodName = "DeleteEnterpriseRuleset" + const methodName = "DeleteRepositoryRuleset" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Enterprise.DeleteEnterpriseRuleset(ctx, "e", 26110) + return client.Enterprise.DeleteRepositoryRuleset(ctx, "e", 84) }) } diff --git a/github/event_types.go b/github/event_types.go index 37e62c2fab9..0df3b30c381 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -1521,14 +1521,73 @@ type RepositoryImportEvent struct { // // GitHub API docs: https://docs.github.com/en/webhooks/webhook-events-and-payloads#repository_ruleset type RepositoryRulesetEvent struct { - Action *string `json:"action,omitempty"` - Enterprise *Enterprise `json:"enterprise,omitempty"` - Installation *Installation `json:"installation,omitempty"` - Organization *Organization `json:"organization,omitempty"` - Repository *Repository `json:"repository,omitempty"` - RepositoryRuleset *RepositoryRuleset `json:"repository_ruleset"` - Changes *RepositoryRulesetEditedChanges `json:"changes,omitempty"` - Sender *User `json:"sender"` + Action *string `json:"action,omitempty"` + Enterprise *Enterprise `json:"enterprise,omitempty"` + Installation *Installation `json:"installation,omitempty"` + Organization *Organization `json:"organization,omitempty"` + Repository *Repository `json:"repository,omitempty"` + RepositoryRuleset *RepositoryRuleset `json:"repository_ruleset"` + Changes *RepositoryRulesetChanges `json:"changes,omitempty"` + Sender *User `json:"sender"` +} + +// RepositoryRulesetChanges represents the changes made to a repository ruleset. +type RepositoryRulesetChanges struct { + Name *RepositoryRulesetChangeSource `json:"name,omitempty"` + Enforcement *RepositoryRulesetChangeSource `json:"enforcement,omitempty"` + Conditions *RepositoryRulesetChangedConditions `json:"conditions,omitempty"` + Rules *RepositoryRulesetChangedRules `json:"rules,omitempty"` +} + +// RepositoryRulesetChangeSource represents a source change for the ruleset. +type RepositoryRulesetChangeSource struct { + From *string `json:"from,omitempty"` +} + +// RepositoryRulesetChangeSources represents multiple source changes for the ruleset. +type RepositoryRulesetChangeSources struct { + From []string `json:"from,omitempty"` +} + +// RepositoryRulesetChangedConditions holds changes to conditions in a ruleset. +type RepositoryRulesetChangedConditions struct { + Added []*RepositoryRulesetConditions `json:"added,omitempty"` + Deleted []*RepositoryRulesetConditions `json:"deleted,omitempty"` + Updated []*RepositoryRulesetUpdatedConditions `json:"updated,omitempty"` +} + +// RepositoryRulesetUpdatedConditions represents the edited updates to conditions in a ruleset. +type RepositoryRulesetUpdatedConditions struct { + Condition *RepositoryRulesetConditions `json:"condition,omitempty"` + Changes *RepositoryRulesetUpdatedCondition `json:"changes,omitempty"` +} + +// RepositoryRulesetUpdatedCondition represents the changes to a condition in a ruleset. +type RepositoryRulesetUpdatedCondition struct { + ConditionType *RepositoryRulesetChangeSource `json:"condition_type,omitempty"` + Target *RepositoryRulesetChangeSource `json:"target,omitempty"` + Include *RepositoryRulesetChangeSources `json:"include,omitempty"` + Exclude *RepositoryRulesetChangeSources `json:"exclude,omitempty"` +} + +// RepositoryRulesetChangedRules holds changes to rules in a ruleset. +type RepositoryRulesetChangedRules struct { + Added []*RepositoryRule `json:"added,omitempty"` + Deleted []*RepositoryRule `json:"deleted,omitempty"` + Updated []*RepositoryRulesetUpdatedRules `json:"updated,omitempty"` +} + +// RepositoryRulesetUpdatedRules holds updates to rules in a ruleset. +type RepositoryRulesetUpdatedRules struct { + Rule *RepositoryRule `json:"rule,omitempty"` + Changes *RepositoryRulesetChangedRule `json:"changes,omitempty"` +} + +// RepositoryRulesetChangedRule holds changes made to a rule in a ruleset. +type RepositoryRulesetChangedRule struct { + Configuration *RepositoryRulesetChangeSource `json:"configuration,omitempty"` + RuleType *RepositoryRulesetChangeSource `json:"rule_type,omitempty"` + Pattern *RepositoryRulesetChangeSource `json:"pattern,omitempty"` } // RepositoryVulnerabilityAlertEvent is triggered when a security alert is created, dismissed, or resolved. diff --git a/github/event_types_test.go b/github/event_types_test.go index b65d792e9bf..947f97026a9 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -7,7 +7,10 @@ package github import ( "encoding/json" + "fmt" "testing" + + "github.com/google/go-cmp/cmp" ) func TestEditChange_Marshal_TitleChange(t *testing.T) { @@ -9560,1789 +9563,302 @@ func TestReleaseEvent_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } -func TestRepositoryRulesetEvent_Marshal(t *testing.T) { +func TestRepositoryRulesetEvent_Unmarshal(t *testing.T) { t.Parallel() - testJSONMarshal(t, &RepositoryRulesetEvent{}, "{}") - l := make(map[string]interface{}) - l["key"] = "value" + enterprise := &Enterprise{ + ID: Ptr(1), + NodeID: Ptr("n"), + Slug: Ptr("e"), + Name: Ptr("e"), + } - jsonMsg, _ := json.Marshal(&l) + installation := &Installation{ + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + AppID: Ptr(int64(1)), + AppSlug: Ptr("a"), + } - u := &RepositoryRulesetEvent{ - Action: Ptr("a"), - Enterprise: &Enterprise{ - ID: Ptr(1), - Slug: Ptr("s"), - Name: Ptr("n"), - NodeID: Ptr("nid"), - AvatarURL: Ptr("au"), - Description: Ptr("d"), - WebsiteURL: Ptr("wu"), - HTMLURL: Ptr("hu"), - CreatedAt: &Timestamp{referenceTime}, - UpdatedAt: &Timestamp{referenceTime}, - }, - Installation: &Installation{ - ID: Ptr(int64(1)), - NodeID: Ptr("nid"), - AppID: Ptr(int64(1)), - AppSlug: Ptr("as"), - TargetID: Ptr(int64(1)), - Account: &User{ - Login: Ptr("l"), - ID: Ptr(int64(1)), - URL: Ptr("u"), - AvatarURL: Ptr("a"), - GravatarID: Ptr("g"), - Name: Ptr("n"), - Company: Ptr("c"), - Blog: Ptr("b"), - Location: Ptr("l"), - Email: Ptr("e"), - Hireable: Ptr(true), - Bio: Ptr("b"), - TwitterUsername: Ptr("t"), - PublicRepos: Ptr(1), - Followers: Ptr(1), - Following: Ptr(1), - CreatedAt: &Timestamp{referenceTime}, - SuspendedAt: &Timestamp{referenceTime}, - }, - AccessTokensURL: Ptr("atu"), - RepositoriesURL: Ptr("ru"), - HTMLURL: Ptr("hu"), - TargetType: Ptr("tt"), - SingleFileName: Ptr("sfn"), - RepositorySelection: Ptr("rs"), - Events: []string{"e"}, - SingleFilePaths: []string{"s"}, - Permissions: &InstallationPermissions{ - Actions: Ptr("a"), - Administration: Ptr("ad"), - Checks: Ptr("c"), - Contents: Ptr("co"), - ContentReferences: Ptr("cr"), - Deployments: Ptr("d"), - Environments: Ptr("e"), - Issues: Ptr("i"), - Metadata: Ptr("md"), - Members: Ptr("m"), - OrganizationAdministration: Ptr("oa"), - OrganizationHooks: Ptr("oh"), - OrganizationPlan: Ptr("op"), - OrganizationPreReceiveHooks: Ptr("opr"), - OrganizationProjects: Ptr("op"), - OrganizationSecrets: Ptr("os"), - OrganizationSelfHostedRunners: Ptr("osh"), - OrganizationUserBlocking: Ptr("oub"), - Packages: Ptr("pkg"), - Pages: Ptr("pg"), - PullRequests: Ptr("pr"), - RepositoryHooks: Ptr("rh"), - RepositoryProjects: Ptr("rp"), - RepositoryPreReceiveHooks: Ptr("rprh"), - Secrets: Ptr("s"), - SecretScanningAlerts: Ptr("ssa"), - SecurityEvents: Ptr("se"), - SingleFile: Ptr("sf"), - Statuses: Ptr("s"), - TeamDiscussions: Ptr("td"), - VulnerabilityAlerts: Ptr("va"), - Workflows: Ptr("w"), - }, - CreatedAt: &Timestamp{referenceTime}, - UpdatedAt: &Timestamp{referenceTime}, - HasMultipleSingleFiles: Ptr(false), - SuspendedBy: &User{ - Login: Ptr("l"), - ID: Ptr(int64(1)), - URL: Ptr("u"), - AvatarURL: Ptr("a"), - GravatarID: Ptr("g"), - Name: Ptr("n"), - Company: Ptr("c"), - Blog: Ptr("b"), - Location: Ptr("l"), - Email: Ptr("e"), - Hireable: Ptr(true), - Bio: Ptr("b"), - TwitterUsername: Ptr("t"), - PublicRepos: Ptr(1), - Followers: Ptr(1), - Following: Ptr(1), - CreatedAt: &Timestamp{referenceTime}, - SuspendedAt: &Timestamp{referenceTime}, - }, - SuspendedAt: &Timestamp{referenceTime}, - }, - Organization: &Organization{ - BillingEmail: Ptr("be"), - Blog: Ptr("b"), - Company: Ptr("c"), - Email: Ptr("e"), - TwitterUsername: Ptr("tu"), - Location: Ptr("loc"), - Name: Ptr("n"), - Description: Ptr("d"), - IsVerified: Ptr(true), - HasOrganizationProjects: Ptr(true), - HasRepositoryProjects: Ptr(true), - DefaultRepoPermission: Ptr("drp"), - MembersCanCreateRepos: Ptr(true), - MembersCanCreateInternalRepos: Ptr(true), - MembersCanCreatePrivateRepos: Ptr(true), - MembersCanCreatePublicRepos: Ptr(false), - MembersAllowedRepositoryCreationType: Ptr("marct"), - MembersCanCreatePages: Ptr(true), - MembersCanCreatePublicPages: Ptr(false), - MembersCanCreatePrivatePages: Ptr(true), - }, - Repository: &Repository{ - ID: Ptr(int64(1)), - URL: Ptr("u"), - Name: Ptr("n"), - }, - RepositoryRuleset: &RepositoryRuleset{ - ID: 1, - Name: "n", - Target: Ptr("branch"), - SourceType: Ptr("Repository"), - Source: "s", - Enforcement: "disabled", - BypassActors: []*BypassActor{ - { - ActorID: Ptr(int64(234)), - ActorType: Ptr("Team"), - BypassMode: Ptr("Always"), - }, - }, - CurrentUserCanBypass: Ptr("always"), - NodeID: Ptr("n"), - Links: &RepositoryRulesetLink{ - Self: &RulesetLink{ - HRef: Ptr("href"), - }, - HTML: &RulesetLink{ - HRef: Ptr("href"), - }, - }, - Conditions: json.RawMessage(jsonMsg), - Rules: []*RepositoryRulesetRule{ - { - Creation: &RepositoryRulesetRuleType{ - Type: "creation", - }, - Update: &RepositoryRulesetUpdateRule{ - Type: "update", - Parameters: &UpdateAllowsFetchAndMergeRuleParameters{ - UpdateAllowsFetchAndMerge: true, - }, - }, - Deletion: &RepositoryRulesetRuleType{ - Type: "deletion", - }, - RequiredLinearHistory: &RepositoryRulesetRuleType{ - Type: "required_linear_history", - }, - MergeQueue: &RepositoryRulesetMergeQueueRule{ - Type: "merge_queue", - Parameters: &MergeQueueRuleParameters{ - CheckResponseTimeoutMinutes: 35, - GroupingStrategy: "HEADGREEN", - MaxEntriesToBuild: 8, - MaxEntriesToMerge: 4, - MergeMethod: "SQUASH", - MinEntriesToMerge: 2, - MinEntriesToMergeWaitMinutes: 13, - }, - }, - RequiredDeployments: &RepositoryRulesetRequiredDeploymentsRule{ - Type: "required_deployments", - Parameters: &RequiredDeploymentEnvironmentsRuleParameters{ - RequiredDeploymentEnvironments: []string{"test"}, - }, - }, - RequiredSignatures: &RepositoryRulesetRuleType{ - Type: "required_signatures", - }, - PullRequest: &RepositoryRulesetPullRequestRule{ - Type: "pull_request", - Parameters: &PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, - DismissStaleReviewsOnPush: true, - RequireCodeOwnerReview: true, - RequireLastPushApproval: true, - RequiredApprovingReviewCount: 1, - RequiredReviewThreadResolution: true, + organization := &Organization{ + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + Name: Ptr("o"), + } + + repository := &Repository{ + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + Name: Ptr("r"), + FullName: Ptr("o/r"), + } + + sender := &User{ + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + Login: Ptr("l"), + } + + tests := []struct { + name string + json string + event *RepositoryRulesetEvent + }{ + {"empty", `{}`, &RepositoryRulesetEvent{}}, + { + "created", + fmt.Sprintf( + `{"action":"created","repository_ruleset":{"id":1,"name":"r","target":"branch","source_type":"Repository","source":"o/r","enforcement":"active","conditions":{"ref_name":{"exclude":[],"include":["~ALL"]}},"rules":[{"type":"deletion"},{"type":"creation"},{"type":"update"},{"type":"required_linear_history"},{"type":"pull_request","parameters":{"required_approving_review_count":2,"dismiss_stale_reviews_on_push":false,"require_code_owner_review":false,"require_last_push_approval":false,"required_review_thread_resolution":false,"automatic_copilot_code_review_enabled":false,"allowed_merge_methods":["squash","rebase","merge"]}},{"type":"code_scanning","parameters":{"code_scanning_tools":[{"tool":"CodeQL","security_alerts_threshold":"high_or_higher","alerts_threshold":"errors"}]}}],"node_id":"n","created_at":%[1]s,"updated_at":%[1]s,"_links":{"self":{"href":"a"},"html":{"href":"a"}}},"repository":{"id":1,"node_id":"n","name":"r","full_name":"o/r"},"organization":{"id":1,"node_id":"n","name":"o"},"enterprise":{"id":1,"node_id":"n","slug":"e","name":"e"},"installation":{"id":1,"node_id":"n","app_id":1,"app_slug":"a"},"sender":{"id":1,"node_id":"n","login":"l"}}`, + referenceTimeStr, + ), + &RepositoryRulesetEvent{ + Action: Ptr("created"), + RepositoryRuleset: &RepositoryRuleset{ + ID: Ptr(int64(1)), + Name: "r", + Target: Ptr(RulesetTargetBranch), + SourceType: Ptr(RulesetSourceTypeRepository), + Source: "o/r", + Enforcement: RulesetEnforcementActive, + Conditions: &RepositoryRulesetConditions{ + RefName: &RepositoryRulesetRefConditionParameters{ + Include: []string{"~ALL"}, + Exclude: []string{}, }, }, - RequiredStatusChecks: &RepositoryRulesetRequiredStatusChecksRule{ - Type: "required_status_checks", - Parameters: &RequiredStatusChecksRuleParameters{ - RequiredStatusChecks: []RuleRequiredStatusChecks{ - { - Context: "test", - IntegrationID: Ptr(int64(1)), - }, + Rules: &RepositoryRulesetRules{ + Creation: &EmptyRuleParameters{}, + Update: &UpdateRuleParameters{}, + Deletion: &EmptyRuleParameters{}, + RequiredLinearHistory: &EmptyRuleParameters{}, + PullRequest: &PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{ + MergeMethodSquash, + MergeMethodRebase, + MergeMethodMerge, }, - StrictRequiredStatusChecksPolicy: true, - }, - }, - NonFastForward: &RepositoryRulesetRuleType{ - Type: "non_fast_forward", - }, - CommitMessagePattern: &RepositoryRulesetPatternRule{ - Type: "commit_message_pattern", - Parameters: &RulePatternParameters{ - Name: Ptr("avoid test commits"), - Negate: Ptr(true), - Operator: "starts_with", - Pattern: "[test]", - }, - }, - CommitAuthorEmailPattern: &RepositoryRulesetPatternRule{ - Type: "commit_author_email_pattern", - Parameters: &RulePatternParameters{ - Operator: "contains", - Pattern: "github", - }, - }, - CommitterEmailPattern: &RepositoryRulesetPatternRule{ - Type: "committer_email_pattern", - Parameters: &RulePatternParameters{ - Name: Ptr("avoid commit emails"), - Negate: Ptr(true), - Operator: "ends_with", - Pattern: "abc", - }, - }, - BranchNamePattern: &RepositoryRulesetPatternRule{ - Type: "branch_name_pattern", - Parameters: &RulePatternParameters{ - Name: Ptr("avoid branch names"), - Negate: Ptr(true), - Operator: "regex", - Pattern: "github$", - }, - }, - TagNamePattern: &RepositoryRulesetPatternRule{ - Type: "tag_name_pattern", - Parameters: &RulePatternParameters{ - Name: Ptr("avoid tag names"), - Negate: Ptr(true), - Operator: "contains", - Pattern: "github", - }, - }, - FilePathRestriction: &RepositoryRulesetFilePathRestrictionRule{ - Type: "file_path_restriction", - Parameters: &RuleFileParameters{ - RestrictedFilePaths: &[]string{"/a/file"}, - }, - }, - MaxFilePathLength: &RepositoryRulesetMaxFilePathLengthRule{ - Type: "max_file_path_length", - Parameters: &RuleMaxFilePathLengthParameters{ - MaxFilePathLength: 255, - }, - }, - FileExtensionRestriction: &RepositoryRulesetFileExtensionRestrictionRule{ - Type: "file_extension_restriction", - Parameters: &RuleFileExtensionRestrictionParameters{ - RestrictedFileExtensions: []string{".exe"}, - }, - }, - MaxFileSize: &RepositoryRulesetMaxFileSizeRule{ - Type: "max_file_size", - Parameters: &RuleMaxFileSizeParameters{ - MaxFileSize: 1024, + DismissStaleReviewsOnPush: false, + RequireCodeOwnerReview: false, + RequireLastPushApproval: false, + RequiredApprovingReviewCount: 2, + RequiredReviewThreadResolution: false, }, - }, - Workflows: &RepositoryRulesetWorkflowsRule{ - Type: "workflows", - Parameters: &RequiredWorkflowsRuleParameters{ - RequiredWorkflows: []*RuleRequiredWorkflow{ + CodeScanning: &CodeScanningRuleParameters{ + CodeScanningTools: []*RuleCodeScanningTool{ { - Path: ".github/workflows/test.yml", - RepositoryID: Ptr(int64(1)), + AlertsThreshold: CodeScanningAlertsThresholdErrors, + SecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdHighOrHigher, + Tool: "CodeQL", }, }, }, }, - CodeScanning: &RepositoryRulesetCodeScanningRule{ - Type: "code_scanning", - Parameters: &RuleCodeScanningParameters{ - CodeScanningTools: []*CodeScanningTool{{ - AlertsThreshold: "alert", - SecurityAlertsThreshold: "security", - Tool: "tool", - }}, - }, - }, - }, - }, - CreatedAt: &Timestamp{referenceTime}, - UpdatedAt: &Timestamp{referenceTime}, - }, - Changes: &RepositoryRulesetEditedChanges{ - Name: &RepositoryRulesetEditedSource{ - From: Ptr("f"), - }, - Enforcement: &RepositoryRulesetEditedSource{ - From: Ptr("e"), - }, - Conditions: &RepositoryRulesetEditedConditions{ - Added: []*RepositoryRulesetRefCondition{ - { - RefName: &RulesetRefConditionParameters{ - Include: []string{"refs/heads/main", "refs/heads/master"}, - Exclude: []string{"refs/heads/dev*"}, - }, + NodeID: Ptr("n"), + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + Links: &RepositoryRulesetLinks{ + Self: &RepositoryRulesetLink{HRef: Ptr("a")}, + HTML: &RepositoryRulesetLink{HRef: Ptr("a")}, }, }, - Deleted: []*RepositoryRulesetRefCondition{ - { - RefName: &RulesetRefConditionParameters{ - Include: []string{"refs/heads/main", "refs/heads/master"}, - Exclude: []string{"refs/heads/dev*"}, + Repository: repository, + Organization: organization, + Enterprise: enterprise, + Installation: installation, + Sender: sender, + }, + }, + { + "edited", + fmt.Sprintf( + `{"action":"edited","repository_ruleset":{"id":1,"name":"r","target":"branch","source_type":"Repository","source":"o/r","enforcement":"active","conditions":{"ref_name":{"exclude":[],"include":["~DEFAULT_BRANCH","refs/heads/dev-*"]}},"rules":[{"type":"deletion"},{"type":"creation"},{"type":"update"},{"type": "required_signatures"},{"type":"pull_request","parameters":{"required_approving_review_count":2,"dismiss_stale_reviews_on_push":false,"require_code_owner_review":false,"require_last_push_approval":false,"required_review_thread_resolution":false,"automatic_copilot_code_review_enabled":false,"allowed_merge_methods":["squash","rebase"]}},{"type":"code_scanning","parameters":{"code_scanning_tools":[{"tool":"CodeQL","security_alerts_threshold":"medium_or_higher","alerts_threshold":"errors"}]}}],"node_id":"n","created_at":%[1]s,"updated_at":%[1]s,"_links":{"self":{"href":"a"},"html":{"href":"a"}}},"changes":{"rules":{"added":[{"type": "required_signatures"}],"updated":[{"rule":{"type":"pull_request","parameters":{"required_approving_review_count":2,"dismiss_stale_reviews_on_push":false,"require_code_owner_review":false,"require_last_push_approval":false,"required_review_thread_resolution":false,"automatic_copilot_code_review_enabled":false,"allowed_merge_methods":["squash","rebase"]}},"changes":{"configuration":{"from":"{\\\"required_reviewers\\\":[],\\\"allowed_merge_methods\\\":[\\\"squash\\\",\\\"rebase\\\",\\\"merge\\\"],\\\"require_code_owner_review\\\":false,\\\"require_last_push_approval\\\":false,\\\"dismiss_stale_reviews_on_push\\\":false,\\\"required_approving_review_count\\\":2,\\\"authorized_dismissal_actors_only\\\":false,\\\"required_review_thread_resolution\\\":false,\\\"ignore_approvals_from_contributors\\\":false,\\\"automatic_copilot_code_review_enabled\\\":false}"}}},{"rule":{"type":"code_scanning","parameters":{"code_scanning_tools":[{"tool":"CodeQL","security_alerts_threshold":"medium_or_higher","alerts_threshold":"errors"}]}},"changes":{"configuration":{"from":"{\\\"code_scanning_tools\\\":[{\\\"tool\\\":\\\"CodeQL\\\",\\\"alerts_threshold\\\":\\\"errors\\\",\\\"security_alerts_threshold\\\":\\\"high_or_higher\\\"}]}"}}}],"deleted":[{"type":"required_linear_history"}]},"conditions":{"updated":[{"condition":{"ref_name":{"exclude":[],"include":["~DEFAULT_BRANCH","refs/heads/dev-*"]}},"changes":{"include":{"from":["~ALL"]}}}],"deleted":[]}},"repository":{"id":1,"node_id":"n","name":"r","full_name":"o/r"},"organization":{"id":1,"node_id":"n","name":"o"},"enterprise":{"id":1,"node_id":"n","slug":"e","name":"e"},"installation":{"id":1,"node_id":"n","app_id":1,"app_slug":"a"},"sender":{"id":1,"node_id":"n","login":"l"}}`, + referenceTimeStr, + ), + &RepositoryRulesetEvent{ + Action: Ptr("edited"), + RepositoryRuleset: &RepositoryRuleset{ + ID: Ptr(int64(1)), + Name: "r", + Target: Ptr(RulesetTargetBranch), + SourceType: Ptr(RulesetSourceTypeRepository), + Source: "o/r", + Enforcement: RulesetEnforcementActive, + Conditions: &RepositoryRulesetConditions{ + RefName: &RepositoryRulesetRefConditionParameters{ + Include: []string{"~DEFAULT_BRANCH", "refs/heads/dev-*"}, + Exclude: []string{}, }, }, - }, - Updated: []*RepositoryRulesetEditedUpdatedConditions{ - { - Condition: &RepositoryRulesetRefCondition{ - RefName: &RulesetRefConditionParameters{ - Include: []string{"refs/heads/main", "refs/heads/master"}, - Exclude: []string{"refs/heads/dev*"}, - }, - }, - Changes: &RepositoryRulesetUpdatedConditionsEdited{ - ConditionType: &RepositoryRulesetEditedSource{ - From: Ptr("c"), - }, - Target: &RepositoryRulesetEditedSource{ - From: Ptr("t"), - }, - Include: &RepositoryRulesetEditedSources{ - From: []string{"from"}, - }, - Exclude: &RepositoryRulesetEditedSources{ - From: []string{"to"}, - }, - }, - }, - }, - }, - Rules: &RepositoryRulesetEditedRules{ - Added: []*RepositoryRulesetRule{ - // Creating just one object with all the possible rules for testing - { - Creation: &RepositoryRulesetRuleType{ - Type: "creation", - }, - Update: &RepositoryRulesetUpdateRule{ - Type: "update", - Parameters: &UpdateAllowsFetchAndMergeRuleParameters{ - UpdateAllowsFetchAndMerge: true, - }, - }, - Deletion: &RepositoryRulesetRuleType{ - Type: "deletion", - }, - RequiredLinearHistory: &RepositoryRulesetRuleType{ - Type: "required_linear_history", - }, - MergeQueue: &RepositoryRulesetMergeQueueRule{ - Type: "merge_queue", - Parameters: &MergeQueueRuleParameters{ - CheckResponseTimeoutMinutes: 35, - GroupingStrategy: "HEADGREEN", - MaxEntriesToBuild: 8, - MaxEntriesToMerge: 4, - MergeMethod: "SQUASH", - MinEntriesToMerge: 2, - MinEntriesToMergeWaitMinutes: 13, - }, - }, - RequiredDeployments: &RepositoryRulesetRequiredDeploymentsRule{ - Type: "required_deployments", - Parameters: &RequiredDeploymentEnvironmentsRuleParameters{ - RequiredDeploymentEnvironments: []string{"test"}, - }, - }, - RequiredSignatures: &RepositoryRulesetRuleType{ - Type: "required_signatures", - }, - PullRequest: &RepositoryRulesetPullRequestRule{ - Type: "pull_request", - Parameters: &PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, - DismissStaleReviewsOnPush: true, - RequireCodeOwnerReview: true, - RequireLastPushApproval: true, - RequiredApprovingReviewCount: 1, - RequiredReviewThreadResolution: true, - }, - }, - RequiredStatusChecks: &RepositoryRulesetRequiredStatusChecksRule{ - Type: "required_status_checks", - Parameters: &RequiredStatusChecksRuleParameters{ - RequiredStatusChecks: []RuleRequiredStatusChecks{ - { - Context: "test", - IntegrationID: Ptr(int64(1)), - }, - }, - StrictRequiredStatusChecksPolicy: true, - }, - }, - NonFastForward: &RepositoryRulesetRuleType{ - Type: "non_fast_forward", - }, - CommitMessagePattern: &RepositoryRulesetPatternRule{ - Type: "commit_message_pattern", - Parameters: &RulePatternParameters{ - Name: Ptr("avoid test commits"), - Negate: Ptr(true), - Operator: "starts_with", - Pattern: "[test]", - }, - }, - CommitAuthorEmailPattern: &RepositoryRulesetPatternRule{ - Type: "commit_author_email_pattern", - Parameters: &RulePatternParameters{ - Operator: "contains", - Pattern: "github", - }, - }, - CommitterEmailPattern: &RepositoryRulesetPatternRule{ - Type: "committer_email_pattern", - Parameters: &RulePatternParameters{ - Name: Ptr("avoid commit emails"), - Negate: Ptr(true), - Operator: "ends_with", - Pattern: "abc", + Rules: &RepositoryRulesetRules{ + Creation: &EmptyRuleParameters{}, + Update: &UpdateRuleParameters{}, + Deletion: &EmptyRuleParameters{}, + RequiredSignatures: &EmptyRuleParameters{}, + PullRequest: &PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{ + MergeMethodSquash, + MergeMethodRebase, }, + DismissStaleReviewsOnPush: false, + RequireCodeOwnerReview: false, + RequireLastPushApproval: false, + RequiredApprovingReviewCount: 2, + RequiredReviewThreadResolution: false, }, - BranchNamePattern: &RepositoryRulesetPatternRule{ - Type: "branch_name_pattern", - Parameters: &RulePatternParameters{ - Name: Ptr("avoid branch names"), - Negate: Ptr(true), - Operator: "regex", - Pattern: "github$", - }, - }, - TagNamePattern: &RepositoryRulesetPatternRule{ - Type: "tag_name_pattern", - Parameters: &RulePatternParameters{ - Name: Ptr("avoid tag names"), - Negate: Ptr(true), - Operator: "contains", - Pattern: "github", - }, - }, - FilePathRestriction: &RepositoryRulesetFilePathRestrictionRule{ - Type: "file_path_restriction", - Parameters: &RuleFileParameters{ - RestrictedFilePaths: &[]string{"/a/file"}, - }, - }, - MaxFilePathLength: &RepositoryRulesetMaxFilePathLengthRule{ - Type: "max_file_path_length", - Parameters: &RuleMaxFilePathLengthParameters{ - MaxFilePathLength: 255, - }, - }, - FileExtensionRestriction: &RepositoryRulesetFileExtensionRestrictionRule{ - Type: "file_extension_restriction", - Parameters: &RuleFileExtensionRestrictionParameters{ - RestrictedFileExtensions: []string{".exe"}, - }, - }, - MaxFileSize: &RepositoryRulesetMaxFileSizeRule{ - Type: "max_file_size", - Parameters: &RuleMaxFileSizeParameters{ - MaxFileSize: 1024, - }, - }, - Workflows: &RepositoryRulesetWorkflowsRule{ - Type: "workflows", - Parameters: &RequiredWorkflowsRuleParameters{ - RequiredWorkflows: []*RuleRequiredWorkflow{ - { - Path: ".github/workflows/test.yml", - RepositoryID: Ptr(int64(1)), - }, + CodeScanning: &CodeScanningRuleParameters{ + CodeScanningTools: []*RuleCodeScanningTool{ + { + AlertsThreshold: CodeScanningAlertsThresholdErrors, + SecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdMediumOrHigher, + Tool: "CodeQL", }, }, }, - CodeScanning: &RepositoryRulesetCodeScanningRule{ - Type: "code_scanning", - Parameters: &RuleCodeScanningParameters{ - CodeScanningTools: []*CodeScanningTool{{ - AlertsThreshold: "alert", - SecurityAlertsThreshold: "security", - Tool: "tool", - }}, - }, - }, + }, + NodeID: Ptr("n"), + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + Links: &RepositoryRulesetLinks{ + Self: &RepositoryRulesetLink{HRef: Ptr("a")}, + HTML: &RepositoryRulesetLink{HRef: Ptr("a")}, }, }, - Deleted: []*RepositoryRulesetRule{ - // Creating just one object with all the possible rules for testing - { - Creation: &RepositoryRulesetRuleType{ - Type: "creation", - }, - Update: &RepositoryRulesetUpdateRule{ - Type: "update", - Parameters: &UpdateAllowsFetchAndMergeRuleParameters{ - UpdateAllowsFetchAndMerge: true, - }, - }, - Deletion: &RepositoryRulesetRuleType{ - Type: "deletion", - }, - RequiredLinearHistory: &RepositoryRulesetRuleType{ - Type: "required_linear_history", - }, - MergeQueue: &RepositoryRulesetMergeQueueRule{ - Type: "merge_queue", - Parameters: &MergeQueueRuleParameters{ - CheckResponseTimeoutMinutes: 35, - GroupingStrategy: "HEADGREEN", - MaxEntriesToBuild: 8, - MaxEntriesToMerge: 4, - MergeMethod: "SQUASH", - MinEntriesToMerge: 2, - MinEntriesToMergeWaitMinutes: 13, - }, - }, - RequiredDeployments: &RepositoryRulesetRequiredDeploymentsRule{ - Type: "required_deployments", - Parameters: &RequiredDeploymentEnvironmentsRuleParameters{ - RequiredDeploymentEnvironments: []string{"test"}, - }, - }, - RequiredSignatures: &RepositoryRulesetRuleType{ - Type: "required_signatures", - }, - PullRequest: &RepositoryRulesetPullRequestRule{ - Type: "pull_request", - Parameters: &PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, - DismissStaleReviewsOnPush: true, - RequireCodeOwnerReview: true, - RequireLastPushApproval: true, - RequiredApprovingReviewCount: 1, - RequiredReviewThreadResolution: true, - }, - }, - RequiredStatusChecks: &RepositoryRulesetRequiredStatusChecksRule{ - Type: "required_status_checks", - Parameters: &RequiredStatusChecksRuleParameters{ - RequiredStatusChecks: []RuleRequiredStatusChecks{ - { - Context: "test", - IntegrationID: Ptr(int64(1)), + Changes: &RepositoryRulesetChanges{ + Conditions: &RepositoryRulesetChangedConditions{ + Updated: []*RepositoryRulesetUpdatedConditions{ + { + Condition: &RepositoryRulesetConditions{ + RefName: &RepositoryRulesetRefConditionParameters{ + Include: []string{"~DEFAULT_BRANCH", "refs/heads/dev-*"}, + Exclude: []string{}, }, }, - StrictRequiredStatusChecksPolicy: true, - }, - }, - NonFastForward: &RepositoryRulesetRuleType{ - Type: "non_fast_forward", - }, - CommitMessagePattern: &RepositoryRulesetPatternRule{ - Type: "commit_message_pattern", - Parameters: &RulePatternParameters{ - Name: Ptr("avoid test commits"), - Negate: Ptr(true), - Operator: "starts_with", - Pattern: "[test]", - }, - }, - CommitAuthorEmailPattern: &RepositoryRulesetPatternRule{ - Type: "commit_author_email_pattern", - Parameters: &RulePatternParameters{ - Operator: "contains", - Pattern: "github", - }, - }, - CommitterEmailPattern: &RepositoryRulesetPatternRule{ - Type: "committer_email_pattern", - Parameters: &RulePatternParameters{ - Name: Ptr("avoid commit emails"), - Negate: Ptr(true), - Operator: "ends_with", - Pattern: "abc", - }, - }, - BranchNamePattern: &RepositoryRulesetPatternRule{ - Type: "branch_name_pattern", - Parameters: &RulePatternParameters{ - Name: Ptr("avoid branch names"), - Negate: Ptr(true), - Operator: "regex", - Pattern: "github$", - }, - }, - TagNamePattern: &RepositoryRulesetPatternRule{ - Type: "tag_name_pattern", - Parameters: &RulePatternParameters{ - Name: Ptr("avoid tag names"), - Negate: Ptr(true), - Operator: "contains", - Pattern: "github", - }, - }, - FilePathRestriction: &RepositoryRulesetFilePathRestrictionRule{ - Type: "file_path_restriction", - Parameters: &RuleFileParameters{ - RestrictedFilePaths: &[]string{"/a/file"}, - }, - }, - MaxFilePathLength: &RepositoryRulesetMaxFilePathLengthRule{ - Type: "max_file_path_length", - Parameters: &RuleMaxFilePathLengthParameters{ - MaxFilePathLength: 255, - }, - }, - FileExtensionRestriction: &RepositoryRulesetFileExtensionRestrictionRule{ - Type: "file_extension_restriction", - Parameters: &RuleFileExtensionRestrictionParameters{ - RestrictedFileExtensions: []string{".exe"}, - }, - }, - MaxFileSize: &RepositoryRulesetMaxFileSizeRule{ - Type: "max_file_size", - Parameters: &RuleMaxFileSizeParameters{ - MaxFileSize: 1024, - }, - }, - Workflows: &RepositoryRulesetWorkflowsRule{ - Type: "workflows", - Parameters: &RequiredWorkflowsRuleParameters{ - RequiredWorkflows: []*RuleRequiredWorkflow{ - { - Path: ".github/workflows/test.yml", - RepositoryID: Ptr(int64(1)), + Changes: &RepositoryRulesetUpdatedCondition{ + Include: &RepositoryRulesetChangeSources{ + From: []string{"~ALL"}, }, }, }, }, - CodeScanning: &RepositoryRulesetCodeScanningRule{ - Type: "code_scanning", - Parameters: &RuleCodeScanningParameters{ - CodeScanningTools: []*CodeScanningTool{{ - AlertsThreshold: "alert", - SecurityAlertsThreshold: "security", - Tool: "tool", - }}, - }, - }, + Deleted: []*RepositoryRulesetConditions{}, }, - }, - Updated: []*RepositoryRulesetUpdatedRules{ - { - Rule: &RepositoryRulesetRule{ - Creation: &RepositoryRulesetRuleType{ - Type: "creation", - }, - Update: &RepositoryRulesetUpdateRule{ - Type: "update", - Parameters: &UpdateAllowsFetchAndMergeRuleParameters{ - UpdateAllowsFetchAndMerge: true, - }, - }, - Deletion: &RepositoryRulesetRuleType{ - Type: "deletion", - }, - RequiredLinearHistory: &RepositoryRulesetRuleType{ - Type: "required_linear_history", - }, - MergeQueue: &RepositoryRulesetMergeQueueRule{ - Type: "merge_queue", - Parameters: &MergeQueueRuleParameters{ - CheckResponseTimeoutMinutes: 35, - GroupingStrategy: "HEADGREEN", - MaxEntriesToBuild: 8, - MaxEntriesToMerge: 4, - MergeMethod: "SQUASH", - MinEntriesToMerge: 2, - MinEntriesToMergeWaitMinutes: 13, - }, - }, - RequiredDeployments: &RepositoryRulesetRequiredDeploymentsRule{ - Type: "required_deployments", - Parameters: &RequiredDeploymentEnvironmentsRuleParameters{ - RequiredDeploymentEnvironments: []string{"test"}, - }, - }, - RequiredSignatures: &RepositoryRulesetRuleType{ - Type: "required_signatures", - }, - PullRequest: &RepositoryRulesetPullRequestRule{ - Type: "pull_request", - Parameters: &PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, - DismissStaleReviewsOnPush: true, - RequireCodeOwnerReview: true, - RequireLastPushApproval: true, - RequiredApprovingReviewCount: 1, - RequiredReviewThreadResolution: true, - }, - }, - RequiredStatusChecks: &RepositoryRulesetRequiredStatusChecksRule{ - Type: "required_status_checks", - Parameters: &RequiredStatusChecksRuleParameters{ - RequiredStatusChecks: []RuleRequiredStatusChecks{ - { - Context: "test", - IntegrationID: Ptr(int64(1)), + Rules: &RepositoryRulesetChangedRules{ + Added: []*RepositoryRule{{Type: RulesetRuleTypeRequiredSignatures}}, + Updated: []*RepositoryRulesetUpdatedRules{ + { + Rule: &RepositoryRule{ + Type: RulesetRuleTypePullRequest, + Parameters: &PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{ + MergeMethodSquash, + MergeMethodRebase, }, + DismissStaleReviewsOnPush: false, + RequireCodeOwnerReview: false, + RequireLastPushApproval: false, + RequiredApprovingReviewCount: 2, + RequiredReviewThreadResolution: false, }, - StrictRequiredStatusChecksPolicy: true, - }, - }, - NonFastForward: &RepositoryRulesetRuleType{ - Type: "non_fast_forward", - }, - CommitMessagePattern: &RepositoryRulesetPatternRule{ - Type: "commit_message_pattern", - Parameters: &RulePatternParameters{ - Name: Ptr("avoid test commits"), - Negate: Ptr(true), - Operator: "starts_with", - Pattern: "[test]", - }, - }, - CommitAuthorEmailPattern: &RepositoryRulesetPatternRule{ - Type: "commit_author_email_pattern", - Parameters: &RulePatternParameters{ - Operator: "contains", - Pattern: "github", - }, - }, - CommitterEmailPattern: &RepositoryRulesetPatternRule{ - Type: "committer_email_pattern", - Parameters: &RulePatternParameters{ - Name: Ptr("avoid commit emails"), - Negate: Ptr(true), - Operator: "ends_with", - Pattern: "abc", - }, - }, - BranchNamePattern: &RepositoryRulesetPatternRule{ - Type: "branch_name_pattern", - Parameters: &RulePatternParameters{ - Name: Ptr("avoid branch names"), - Negate: Ptr(true), - Operator: "regex", - Pattern: "github$", - }, - }, - TagNamePattern: &RepositoryRulesetPatternRule{ - Type: "tag_name_pattern", - Parameters: &RulePatternParameters{ - Name: Ptr("avoid tag names"), - Negate: Ptr(true), - Operator: "contains", - Pattern: "github", - }, - }, - FilePathRestriction: &RepositoryRulesetFilePathRestrictionRule{ - Type: "file_path_restriction", - Parameters: &RuleFileParameters{ - RestrictedFilePaths: &[]string{"/a/file"}, - }, - }, - MaxFilePathLength: &RepositoryRulesetMaxFilePathLengthRule{ - Type: "max_file_path_length", - Parameters: &RuleMaxFilePathLengthParameters{ - MaxFilePathLength: 255, }, - }, - FileExtensionRestriction: &RepositoryRulesetFileExtensionRestrictionRule{ - Type: "file_extension_restriction", - Parameters: &RuleFileExtensionRestrictionParameters{ - RestrictedFileExtensions: []string{".exe"}, - }, - }, - MaxFileSize: &RepositoryRulesetMaxFileSizeRule{ - Type: "max_file_size", - Parameters: &RuleMaxFileSizeParameters{ - MaxFileSize: 1024, + Changes: &RepositoryRulesetChangedRule{ + Configuration: &RepositoryRulesetChangeSource{ + From: Ptr( + `{\"required_reviewers\":[],\"allowed_merge_methods\":[\"squash\",\"rebase\",\"merge\"],\"require_code_owner_review\":false,\"require_last_push_approval\":false,\"dismiss_stale_reviews_on_push\":false,\"required_approving_review_count\":2,\"authorized_dismissal_actors_only\":false,\"required_review_thread_resolution\":false,\"ignore_approvals_from_contributors\":false,\"automatic_copilot_code_review_enabled\":false}`, + ), + }, }, }, - Workflows: &RepositoryRulesetWorkflowsRule{ - Type: "workflows", - Parameters: &RequiredWorkflowsRuleParameters{ - RequiredWorkflows: []*RuleRequiredWorkflow{ - { - Path: ".github/workflows/test.yml", - RepositoryID: Ptr(int64(1)), + { + Rule: &RepositoryRule{ + Type: RulesetRuleTypeCodeScanning, + Parameters: &CodeScanningRuleParameters{ + CodeScanningTools: []*RuleCodeScanningTool{ + { + AlertsThreshold: CodeScanningAlertsThresholdErrors, + SecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdMediumOrHigher, + Tool: "CodeQL", + }, }, }, }, - }, - CodeScanning: &RepositoryRulesetCodeScanningRule{ - Type: "code_scanning", - Parameters: &RuleCodeScanningParameters{ - CodeScanningTools: []*CodeScanningTool{{ - AlertsThreshold: "alert", - SecurityAlertsThreshold: "security", - Tool: "tool", - }}, + Changes: &RepositoryRulesetChangedRule{ + Configuration: &RepositoryRulesetChangeSource{ + From: Ptr( + `{\"code_scanning_tools\":[{\"tool\":\"CodeQL\",\"alerts_threshold\":\"errors\",\"security_alerts_threshold\":\"high_or_higher\"}]}`, + ), + }, }, }, }, - Changes: &RepositoryRulesetEditedRuleChanges{ - Configuration: &RepositoryRulesetEditedSources{ - From: []string{"from"}, - }, - RuleType: &RepositoryRulesetEditedSources{ - From: []string{"from"}, - }, - Pattern: &RepositoryRulesetEditedSources{ - From: []string{"from"}, - }, + Deleted: []*RepositoryRule{{Type: RulesetRuleTypeRequiredLinearHistory}}, + }, + }, + Repository: repository, + Organization: organization, + Enterprise: enterprise, + Installation: installation, + Sender: sender, + }, + }, + { + "deleted", + fmt.Sprintf( + `{"action":"deleted","repository_ruleset":{"id":1,"name":"r","target":"branch","source_type":"Repository","source":"o/r","enforcement":"active","conditions":{"ref_name":{"exclude":[],"include":["~DEFAULT_BRANCH","refs/heads/dev-*"]}},"rules":[{"type":"deletion"},{"type":"creation"},{"type":"update"},{"type":"required_linear_history"}],"node_id":"n","created_at":%[1]s,"updated_at":%[1]s,"_links":{"self":{"href":"a"},"html":{"href":"a"}}},"repository":{"id":1,"node_id":"n","name":"r","full_name":"o/r"},"organization":{"id":1,"node_id":"n","name":"o"},"enterprise":{"id":1,"node_id":"n","slug":"e","name":"e"},"installation":{"id":1,"node_id":"n","app_id":1,"app_slug":"a"},"sender":{"id":1,"node_id":"n","login":"l"}}`, + referenceTimeStr, + ), + &RepositoryRulesetEvent{ + Action: Ptr("deleted"), + RepositoryRuleset: &RepositoryRuleset{ + ID: Ptr(int64(1)), + Name: "r", + Target: Ptr(RulesetTargetBranch), + SourceType: Ptr(RulesetSourceTypeRepository), + Source: "o/r", + Enforcement: RulesetEnforcementActive, + Conditions: &RepositoryRulesetConditions{ + RefName: &RepositoryRulesetRefConditionParameters{ + Include: []string{"~DEFAULT_BRANCH", "refs/heads/dev-*"}, + Exclude: []string{}, }, }, + Rules: &RepositoryRulesetRules{ + Creation: &EmptyRuleParameters{}, + Update: &UpdateRuleParameters{}, + Deletion: &EmptyRuleParameters{}, + RequiredLinearHistory: &EmptyRuleParameters{}, + }, + NodeID: Ptr("n"), + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + Links: &RepositoryRulesetLinks{ + Self: &RepositoryRulesetLink{HRef: Ptr("a")}, + HTML: &RepositoryRulesetLink{HRef: Ptr("a")}, + }, }, + Repository: repository, + Organization: organization, + Enterprise: enterprise, + Installation: installation, + Sender: sender, }, }, - Sender: &User{ - Login: Ptr("l"), - ID: Ptr(int64(1)), - NodeID: Ptr("n"), - URL: Ptr("u"), - ReposURL: Ptr("r"), - EventsURL: Ptr("e"), - AvatarURL: Ptr("a"), - }, } - want := `{ - "action": "a", - "enterprise": { - "id": 1, - "slug": "s", - "name": "n", - "node_id": "nid", - "avatar_url": "au", - "description": "d", - "website_url": "wu", - "html_url": "hu", - "created_at": ` + referenceTimeStr + `, - "updated_at": ` + referenceTimeStr + ` - }, - "installation": { - "id": 1, - "node_id": "nid", - "app_id": 1, - "app_slug": "as", - "target_id": 1, - "account": { - "login": "l", - "id": 1, - "avatar_url": "a", - "gravatar_id": "g", - "name": "n", - "company": "c", - "blog": "b", - "location": "l", - "email": "e", - "hireable": true, - "bio": "b", - "twitter_username": "t", - "public_repos": 1, - "followers": 1, - "following": 1, - "created_at": ` + referenceTimeStr + `, - "suspended_at": ` + referenceTimeStr + `, - "url": "u" - }, - "access_tokens_url": "atu", - "repositories_url": "ru", - "html_url": "hu", - "target_type": "tt", - "single_file_name": "sfn", - "repository_selection": "rs", - "events": [ - "e" - ], - "single_file_paths": [ - "s" - ], - "permissions": { - "actions": "a", - "administration": "ad", - "checks": "c", - "contents": "co", - "content_references": "cr", - "deployments": "d", - "environments": "e", - "issues": "i", - "metadata": "md", - "members": "m", - "organization_administration": "oa", - "organization_hooks": "oh", - "organization_plan": "op", - "organization_pre_receive_hooks": "opr", - "organization_projects": "op", - "organization_secrets": "os", - "organization_self_hosted_runners": "osh", - "organization_user_blocking": "oub", - "packages": "pkg", - "pages": "pg", - "pull_requests": "pr", - "repository_hooks": "rh", - "repository_projects": "rp", - "repository_pre_receive_hooks": "rprh", - "secrets": "s", - "secret_scanning_alerts": "ssa", - "security_events": "se", - "single_file": "sf", - "statuses": "s", - "team_discussions": "td", - "vulnerability_alerts": "va", - "workflows": "w" - }, - "created_at": ` + referenceTimeStr + `, - "updated_at": ` + referenceTimeStr + `, - "has_multiple_single_files": false, - "suspended_by": { - "login": "l", - "id": 1, - "avatar_url": "a", - "gravatar_id": "g", - "name": "n", - "company": "c", - "blog": "b", - "location": "l", - "email": "e", - "hireable": true, - "bio": "b", - "twitter_username": "t", - "public_repos": 1, - "followers": 1, - "following": 1, - "created_at": ` + referenceTimeStr + `, - "suspended_at": ` + referenceTimeStr + `, - "url": "u" - }, - "suspended_at": ` + referenceTimeStr + ` - }, - "organization": { - "name": "n", - "company": "c", - "blog": "b", - "location": "loc", - "email": "e", - "twitter_username": "tu", - "description": "d", - "billing_email": "be", - "is_verified": true, - "has_organization_projects": true, - "has_repository_projects": true, - "default_repository_permission": "drp", - "members_can_create_repositories": true, - "members_can_create_public_repositories": false, - "members_can_create_private_repositories": true, - "members_can_create_internal_repositories": true, - "members_allowed_repository_creation_type": "marct", - "members_can_create_pages": true, - "members_can_create_public_pages": false, - "members_can_create_private_pages": true - }, - "repository": { - "id": 1, - "name": "n", - "url": "u" - }, - "repository_ruleset": { - "id": 1, - "name": "n", - "target": "branch", - "source_type": "Repository", - "source": "s", - "enforcement": "disabled", - "bypass_actors": [ - { - "actor_id": 234, - "actor_type": "Team", - "bypass_mode": "Always" - } - ], - "current_user_can_bypass": "always", - "node_id": "n", - "_links": { - "self": { - "href": "href" - }, - "html": { - "href": "href" - } - }, - "conditions": { - "key": "value" - }, - "rules": [ - { - "creation": { - "type": "creation" - }, - "update": { - "type": "update", - "parameters": { - "update_allows_fetch_and_merge": true - } - }, - "deletion": { - "type": "deletion" - }, - "required_linear_history": { - "type": "required_linear_history" - }, - "merge_queue": { - "type": "merge_queue", - "parameters": { - "check_response_timeout_minutes": 35, - "grouping_strategy": "HEADGREEN", - "max_entries_to_build": 8, - "max_entries_to_merge": 4, - "merge_method": "SQUASH", - "min_entries_to_merge": 2, - "min_entries_to_merge_wait_minutes": 13 - } - }, - "required_deployments": { - "type": "required_deployments", - "parameters": { - "required_deployment_environments": [ - "test" - ] - } - }, - "required_signatures": { - "type": "required_signatures" - }, - "pull_request": { - "type": "pull_request", - "parameters": { - "allowed_merge_methods": ["rebase","squash"], - "dismiss_stale_reviews_on_push": true, - "require_code_owner_review": true, - "require_last_push_approval": true, - "required_approving_review_count": 1, - "required_review_thread_resolution": true - } - }, - "required_status_checks": { - "type": "required_status_checks", - "parameters": { - "required_status_checks": [ - { - "context": "test", - "integration_id": 1 - } - ], - "strict_required_status_checks_policy": true - } - }, - "non_fast_forward": { - "type": "non_fast_forward" - }, - "commit_message_pattern": { - "type": "commit_message_pattern", - "parameters": { - "name": "avoid test commits", - "negate": true, - "operator": "starts_with", - "pattern": "[test]" - } - }, - "commit_author_email_pattern": { - "type": "commit_author_email_pattern", - "parameters": { - "operator": "contains", - "pattern": "github" - } - }, - "committer_email_pattern": { - "type": "committer_email_pattern", - "parameters": { - "name": "avoid commit emails", - "negate": true, - "operator": "ends_with", - "pattern": "abc" - } - }, - "branch_name_pattern": { - "type": "branch_name_pattern", - "parameters": { - "name": "avoid branch names", - "negate": true, - "operator": "regex", - "pattern": "github$" - } - }, - "tag_name_pattern": { - "type": "tag_name_pattern", - "parameters": { - "name": "avoid tag names", - "negate": true, - "operator": "contains", - "pattern": "github" - } - }, - "file_path_restriction": { - "type": "file_path_restriction", - "parameters": { - "restricted_file_paths": [ - "/a/file" - ] - } - }, - "max_file_path_length": { - "type": "max_file_path_length", - "parameters": { - "max_file_path_length": 255 - } - }, - "file_extension_restriction": { - "type": "file_extension_restriction", - "parameters": { - "restricted_file_extensions": [ - ".exe" - ] - } - }, - "max_file_size": { - "type": "max_file_size", - "parameters": { - "max_file_size": 1024 - } - }, - "workflows": { - "type": "workflows", - "parameters": { - "workflows": [ - { - "path": ".github/workflows/test.yml", - "repository_id": 1 - } - ] - } - }, - "code_scanning": { - "type": "code_scanning", - "parameters": { - "code_scanning_tools": [ - { - "alerts_threshold": "alert", - "security_alerts_threshold": "security", - "tool": "tool" - } - ] - } - } - } - ], - "created_at": ` + referenceTimeStr + `, - "updated_at": ` + referenceTimeStr + ` - }, - "changes": { - "name": { - "from": "f" - }, - "enforcement": { - "from": "e" - }, - "conditions": { - "added": [ - { - "ref_name": { - "include": [ - "refs/heads/main", - "refs/heads/master" - ], - "exclude": [ - "refs/heads/dev*" - ] - } - } - ], - "deleted": [ - { - "ref_name": { - "include": [ - "refs/heads/main", - "refs/heads/master" - ], - "exclude": [ - "refs/heads/dev*" - ] - } - } - ], - "updated": [ - { - "condition": { - "ref_name": { - "include": [ - "refs/heads/main", - "refs/heads/master" - ], - "exclude": [ - "refs/heads/dev*" - ] - } - }, - "changes": { - "condition_type": { - "from": "c" - }, - "target": { - "from": "t" - }, - "include": { - "from": [ - "from" - ] - }, - "exclude": { - "from": [ - "to" - ] - } - } - } - ] - }, - "rules": { - "added": [ - { - "creation": { - "type": "creation" - }, - "update": { - "type": "update", - "parameters": { - "update_allows_fetch_and_merge": true - } - }, - "deletion": { - "type": "deletion" - }, - "required_linear_history": { - "type": "required_linear_history" - }, - "merge_queue": { - "type": "merge_queue", - "parameters": { - "check_response_timeout_minutes": 35, - "grouping_strategy": "HEADGREEN", - "max_entries_to_build": 8, - "max_entries_to_merge": 4, - "merge_method": "SQUASH", - "min_entries_to_merge": 2, - "min_entries_to_merge_wait_minutes": 13 - } - }, - "required_deployments": { - "type": "required_deployments", - "parameters": { - "required_deployment_environments": [ - "test" - ] - } - }, - "required_signatures": { - "type": "required_signatures" - }, - "pull_request": { - "type": "pull_request", - "parameters": { - "allowed_merge_methods": ["rebase","squash"], - "dismiss_stale_reviews_on_push": true, - "require_code_owner_review": true, - "require_last_push_approval": true, - "required_approving_review_count": 1, - "required_review_thread_resolution": true - } - }, - "required_status_checks": { - "type": "required_status_checks", - "parameters": { - "required_status_checks": [ - { - "context": "test", - "integration_id": 1 - } - ], - "strict_required_status_checks_policy": true - } - }, - "non_fast_forward": { - "type": "non_fast_forward" - }, - "commit_message_pattern": { - "type": "commit_message_pattern", - "parameters": { - "name": "avoid test commits", - "negate": true, - "operator": "starts_with", - "pattern": "[test]" - } - }, - "commit_author_email_pattern": { - "type": "commit_author_email_pattern", - "parameters": { - "operator": "contains", - "pattern": "github" - } - }, - "committer_email_pattern": { - "type": "committer_email_pattern", - "parameters": { - "name": "avoid commit emails", - "negate": true, - "operator": "ends_with", - "pattern": "abc" - } - }, - "branch_name_pattern": { - "type": "branch_name_pattern", - "parameters": { - "name": "avoid branch names", - "negate": true, - "operator": "regex", - "pattern": "github$" - } - }, - "tag_name_pattern": { - "type": "tag_name_pattern", - "parameters": { - "name": "avoid tag names", - "negate": true, - "operator": "contains", - "pattern": "github" - } - }, - "file_path_restriction": { - "type": "file_path_restriction", - "parameters": { - "restricted_file_paths": [ - "/a/file" - ] - } - }, - "max_file_path_length": { - "type": "max_file_path_length", - "parameters": { - "max_file_path_length": 255 - } - }, - "file_extension_restriction": { - "type": "file_extension_restriction", - "parameters": { - "restricted_file_extensions": [ - ".exe" - ] - } - }, - "max_file_size": { - "type": "max_file_size", - "parameters": { - "max_file_size": 1024 - } - }, - "workflows": { - "type": "workflows", - "parameters": { - "workflows": [ - { - "path": ".github/workflows/test.yml", - "repository_id": 1 - } - ] - } - }, - "code_scanning": { - "type": "code_scanning", - "parameters": { - "code_scanning_tools": [ - { - "alerts_threshold": "alert", - "security_alerts_threshold": "security", - "tool": "tool" - } - ] - } - } - } - ], - "deleted": [ - { - "creation": { - "type": "creation" - }, - "update": { - "type": "update", - "parameters": { - "update_allows_fetch_and_merge": true - } - }, - "deletion": { - "type": "deletion" - }, - "required_linear_history": { - "type": "required_linear_history" - }, - "merge_queue": { - "type": "merge_queue", - "parameters": { - "check_response_timeout_minutes": 35, - "grouping_strategy": "HEADGREEN", - "max_entries_to_build": 8, - "max_entries_to_merge": 4, - "merge_method": "SQUASH", - "min_entries_to_merge": 2, - "min_entries_to_merge_wait_minutes": 13 - } - }, - "required_deployments": { - "type": "required_deployments", - "parameters": { - "required_deployment_environments": [ - "test" - ] - } - }, - "required_signatures": { - "type": "required_signatures" - }, - "pull_request": { - "type": "pull_request", - "parameters": { - "allowed_merge_methods": ["rebase","squash"], - "dismiss_stale_reviews_on_push": true, - "require_code_owner_review": true, - "require_last_push_approval": true, - "required_approving_review_count": 1, - "required_review_thread_resolution": true - } - }, - "required_status_checks": { - "type": "required_status_checks", - "parameters": { - "required_status_checks": [ - { - "context": "test", - "integration_id": 1 - } - ], - "strict_required_status_checks_policy": true - } - }, - "non_fast_forward": { - "type": "non_fast_forward" - }, - "commit_message_pattern": { - "type": "commit_message_pattern", - "parameters": { - "name": "avoid test commits", - "negate": true, - "operator": "starts_with", - "pattern": "[test]" - } - }, - "commit_author_email_pattern": { - "type": "commit_author_email_pattern", - "parameters": { - "operator": "contains", - "pattern": "github" - } - }, - "committer_email_pattern": { - "type": "committer_email_pattern", - "parameters": { - "name": "avoid commit emails", - "negate": true, - "operator": "ends_with", - "pattern": "abc" - } - }, - "branch_name_pattern": { - "type": "branch_name_pattern", - "parameters": { - "name": "avoid branch names", - "negate": true, - "operator": "regex", - "pattern": "github$" - } - }, - "tag_name_pattern": { - "type": "tag_name_pattern", - "parameters": { - "name": "avoid tag names", - "negate": true, - "operator": "contains", - "pattern": "github" - } - }, - "file_path_restriction": { - "type": "file_path_restriction", - "parameters": { - "restricted_file_paths": [ - "/a/file" - ] - } - }, - "max_file_path_length": { - "type": "max_file_path_length", - "parameters": { - "max_file_path_length": 255 - } - }, - "file_extension_restriction": { - "type": "file_extension_restriction", - "parameters": { - "restricted_file_extensions": [ - ".exe" - ] - } - }, - "max_file_size": { - "type": "max_file_size", - "parameters": { - "max_file_size": 1024 - } - }, - "workflows": { - "type": "workflows", - "parameters": { - "workflows": [ - { - "path": ".github/workflows/test.yml", - "repository_id": 1 - } - ] - } - }, - "code_scanning": { - "type": "code_scanning", - "parameters": { - "code_scanning_tools": [ - { - "alerts_threshold": "alert", - "security_alerts_threshold": "security", - "tool": "tool" - } - ] - } - } - } - ], - "updated": [ - { - "rule": { - "creation": { - "type": "creation" - }, - "update": { - "type": "update", - "parameters": { - "update_allows_fetch_and_merge": true - } - }, - "deletion": { - "type": "deletion" - }, - "required_linear_history": { - "type": "required_linear_history" - }, - "merge_queue": { - "type": "merge_queue", - "parameters": { - "check_response_timeout_minutes": 35, - "grouping_strategy": "HEADGREEN", - "max_entries_to_build": 8, - "max_entries_to_merge": 4, - "merge_method": "SQUASH", - "min_entries_to_merge": 2, - "min_entries_to_merge_wait_minutes": 13 - } - }, - "required_deployments": { - "type": "required_deployments", - "parameters": { - "required_deployment_environments": [ - "test" - ] - } - }, - "required_signatures": { - "type": "required_signatures" - }, - "pull_request": { - "type": "pull_request", - "parameters": { - "allowed_merge_methods": ["rebase","squash"], - "dismiss_stale_reviews_on_push": true, - "require_code_owner_review": true, - "require_last_push_approval": true, - "required_approving_review_count": 1, - "required_review_thread_resolution": true - } - }, - "required_status_checks": { - "type": "required_status_checks", - "parameters": { - "required_status_checks": [ - { - "context": "test", - "integration_id": 1 - } - ], - "strict_required_status_checks_policy": true - } - }, - "non_fast_forward": { - "type": "non_fast_forward" - }, - "commit_message_pattern": { - "type": "commit_message_pattern", - "parameters": { - "name": "avoid test commits", - "negate": true, - "operator": "starts_with", - "pattern": "[test]" - } - }, - "commit_author_email_pattern": { - "type": "commit_author_email_pattern", - "parameters": { - "operator": "contains", - "pattern": "github" - } - }, - "committer_email_pattern": { - "type": "committer_email_pattern", - "parameters": { - "name": "avoid commit emails", - "negate": true, - "operator": "ends_with", - "pattern": "abc" - } - }, - "branch_name_pattern": { - "type": "branch_name_pattern", - "parameters": { - "name": "avoid branch names", - "negate": true, - "operator": "regex", - "pattern": "github$" - } - }, - "tag_name_pattern": { - "type": "tag_name_pattern", - "parameters": { - "name": "avoid tag names", - "negate": true, - "operator": "contains", - "pattern": "github" - } - }, - "file_path_restriction": { - "type": "file_path_restriction", - "parameters": { - "restricted_file_paths": [ - "/a/file" - ] - } - }, - "max_file_path_length": { - "type": "max_file_path_length", - "parameters": { - "max_file_path_length": 255 - } - }, - "file_extension_restriction": { - "type": "file_extension_restriction", - "parameters": { - "restricted_file_extensions": [ - ".exe" - ] - } - }, - "max_file_size": { - "type": "max_file_size", - "parameters": { - "max_file_size": 1024 - } - }, - "workflows": { - "type": "workflows", - "parameters": { - "workflows": [ - { - "path": ".github/workflows/test.yml", - "repository_id": 1 - } - ] - } - }, - "code_scanning": { - "type": "code_scanning", - "parameters": { - "code_scanning_tools": [ - { - "alerts_threshold": "alert", - "security_alerts_threshold": "security", - "tool": "tool" - } - ] - } - } - }, - "changes": { - "configuration": { - "from": [ - "from" - ] - }, - "rule_type": { - "from": [ - "from" - ] - }, - "pattern": { - "from": [ - "from" - ] - } - } - } - ] - } - }, - "sender": { - "login": "l", - "id": 1, - "node_id": "n", - "avatar_url": "a", - "url": "u", - "events_url": "e", - "repos_url": "r" - } - }` + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + t.Parallel() - testJSONMarshal(t, u, want) + got := &RepositoryRulesetEvent{} + err := json.Unmarshal([]byte(test.json), got) + if err != nil { + t.Errorf("Unable to unmarshal JSON %v: %v", test.json, err) + } + + if diff := cmp.Diff(test.event, got); diff != "" { + t.Errorf("json.Unmarshal returned:\n%#v\nwant:\n%#v\ndiff:\n%v", got, test.event, diff) + } + }) + } } func TestContentReferenceEvent_Marshal(t *testing.T) { diff --git a/github/github-accessors.go b/github/github-accessors.go index 2900ace10c5..d90176a96ec 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -1934,20 +1934,20 @@ func (b *BypassActor) GetActorID() int64 { return *b.ActorID } -// GetActorType returns the ActorType field if it's non-nil, zero value otherwise. -func (b *BypassActor) GetActorType() string { - if b == nil || b.ActorType == nil { - return "" +// GetActorType returns the ActorType field. +func (b *BypassActor) GetActorType() *BypassActorType { + if b == nil { + return nil } - return *b.ActorType + return b.ActorType } -// GetBypassMode returns the BypassMode field if it's non-nil, zero value otherwise. -func (b *BypassActor) GetBypassMode() string { - if b == nil || b.BypassMode == nil { - return "" +// GetBypassMode returns the BypassMode field. +func (b *BypassActor) GetBypassMode() *BypassMode { + if b == nil { + return nil } - return *b.BypassMode + return b.BypassMode } // GetApp returns the App field. @@ -16670,6 +16670,22 @@ func (p *PagesUpdate) GetSource() *PagesSource { return p.Source } +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (p *PatternRuleParameters) GetName() string { + if p == nil || p.Name == nil { + return "" + } + return *p.Name +} + +// GetNegate returns the Negate field if it's non-nil, zero value otherwise. +func (p *PatternRuleParameters) GetNegate() bool { + if p == nil || p.Negate == nil { + return false + } + return *p.Negate +} + // GetCurrentUserCanApprove returns the CurrentUserCanApprove field if it's non-nil, zero value otherwise. func (p *PendingDeployment) GetCurrentUserCanApprove() bool { if p == nil || p.CurrentUserCanApprove == nil { @@ -22318,12 +22334,12 @@ func (r *RepositoryRelease) GetZipballURL() string { return *r.ZipballURL } -// GetParameters returns the Parameters field if it's non-nil, zero value otherwise. -func (r *RepositoryRule) GetParameters() json.RawMessage { - if r == nil || r.Parameters == nil { - return json.RawMessage{} +// GetConditions returns the Conditions field. +func (r *RepositoryRuleset) GetConditions() *RepositoryRulesetConditions { + if r == nil { + return nil } - return *r.Parameters + return r.Conditions } // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. @@ -22334,16 +22350,24 @@ func (r *RepositoryRuleset) GetCreatedAt() Timestamp { return *r.CreatedAt } -// GetCurrentUserCanBypass returns the CurrentUserCanBypass field if it's non-nil, zero value otherwise. -func (r *RepositoryRuleset) GetCurrentUserCanBypass() string { - if r == nil || r.CurrentUserCanBypass == nil { - return "" +// GetCurrentUserCanBypass returns the CurrentUserCanBypass field. +func (r *RepositoryRuleset) GetCurrentUserCanBypass() *BypassMode { + if r == nil { + return nil + } + return r.CurrentUserCanBypass +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (r *RepositoryRuleset) GetID() int64 { + if r == nil || r.ID == nil { + return 0 } - return *r.CurrentUserCanBypass + return *r.ID } // GetLinks returns the Links field. -func (r *RepositoryRuleset) GetLinks() *RepositoryRulesetLink { +func (r *RepositoryRuleset) GetLinks() *RepositoryRulesetLinks { if r == nil { return nil } @@ -22358,20 +22382,28 @@ func (r *RepositoryRuleset) GetNodeID() string { return *r.NodeID } -// GetSourceType returns the SourceType field if it's non-nil, zero value otherwise. -func (r *RepositoryRuleset) GetSourceType() string { - if r == nil || r.SourceType == nil { - return "" +// GetRules returns the Rules field. +func (r *RepositoryRuleset) GetRules() *RepositoryRulesetRules { + if r == nil { + return nil } - return *r.SourceType + return r.Rules } -// GetTarget returns the Target field if it's non-nil, zero value otherwise. -func (r *RepositoryRuleset) GetTarget() string { - if r == nil || r.Target == nil { - return "" +// GetSourceType returns the SourceType field. +func (r *RepositoryRuleset) GetSourceType() *RulesetSourceType { + if r == nil { + return nil } - return *r.Target + return r.SourceType +} + +// GetTarget returns the Target field. +func (r *RepositoryRuleset) GetTarget() *RulesetTarget { + if r == nil { + return nil + } + return r.Target } // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. @@ -22382,16 +22414,32 @@ func (r *RepositoryRuleset) GetUpdatedAt() Timestamp { return *r.UpdatedAt } -// GetParameters returns the Parameters field. -func (r *RepositoryRulesetCodeScanningRule) GetParameters() *RuleCodeScanningParameters { +// GetConfiguration returns the Configuration field. +func (r *RepositoryRulesetChangedRule) GetConfiguration() *RepositoryRulesetChangeSource { if r == nil { return nil } - return r.Parameters + return r.Configuration +} + +// GetPattern returns the Pattern field. +func (r *RepositoryRulesetChangedRule) GetPattern() *RepositoryRulesetChangeSource { + if r == nil { + return nil + } + return r.Pattern +} + +// GetRuleType returns the RuleType field. +func (r *RepositoryRulesetChangedRule) GetRuleType() *RepositoryRulesetChangeSource { + if r == nil { + return nil + } + return r.RuleType } // GetConditions returns the Conditions field. -func (r *RepositoryRulesetEditedChanges) GetConditions() *RepositoryRulesetEditedConditions { +func (r *RepositoryRulesetChanges) GetConditions() *RepositoryRulesetChangedConditions { if r == nil { return nil } @@ -22399,7 +22447,7 @@ func (r *RepositoryRulesetEditedChanges) GetConditions() *RepositoryRulesetEdite } // GetEnforcement returns the Enforcement field. -func (r *RepositoryRulesetEditedChanges) GetEnforcement() *RepositoryRulesetEditedSource { +func (r *RepositoryRulesetChanges) GetEnforcement() *RepositoryRulesetChangeSource { if r == nil { return nil } @@ -22407,7 +22455,7 @@ func (r *RepositoryRulesetEditedChanges) GetEnforcement() *RepositoryRulesetEdit } // GetName returns the Name field. -func (r *RepositoryRulesetEditedChanges) GetName() *RepositoryRulesetEditedSource { +func (r *RepositoryRulesetChanges) GetName() *RepositoryRulesetChangeSource { if r == nil { return nil } @@ -22415,59 +22463,67 @@ func (r *RepositoryRulesetEditedChanges) GetName() *RepositoryRulesetEditedSourc } // GetRules returns the Rules field. -func (r *RepositoryRulesetEditedChanges) GetRules() *RepositoryRulesetEditedRules { +func (r *RepositoryRulesetChanges) GetRules() *RepositoryRulesetChangedRules { if r == nil { return nil } return r.Rules } -// GetConfiguration returns the Configuration field. -func (r *RepositoryRulesetEditedRuleChanges) GetConfiguration() *RepositoryRulesetEditedSources { +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (r *RepositoryRulesetChangeSource) GetFrom() string { + if r == nil || r.From == nil { + return "" + } + return *r.From +} + +// GetOrganizationID returns the OrganizationID field. +func (r *RepositoryRulesetConditions) GetOrganizationID() *RepositoryRulesetOrganizationIDsConditionParameters { if r == nil { return nil } - return r.Configuration + return r.OrganizationID } -// GetPattern returns the Pattern field. -func (r *RepositoryRulesetEditedRuleChanges) GetPattern() *RepositoryRulesetEditedSources { +// GetOrganizationName returns the OrganizationName field. +func (r *RepositoryRulesetConditions) GetOrganizationName() *RepositoryRulesetOrganizationNamesConditionParameters { if r == nil { return nil } - return r.Pattern + return r.OrganizationName } -// GetRuleType returns the RuleType field. -func (r *RepositoryRulesetEditedRuleChanges) GetRuleType() *RepositoryRulesetEditedSources { +// GetRefName returns the RefName field. +func (r *RepositoryRulesetConditions) GetRefName() *RepositoryRulesetRefConditionParameters { if r == nil { return nil } - return r.RuleType + return r.RefName } -// GetFrom returns the From field if it's non-nil, zero value otherwise. -func (r *RepositoryRulesetEditedSource) GetFrom() string { - if r == nil || r.From == nil { - return "" +// GetRepositoryID returns the RepositoryID field. +func (r *RepositoryRulesetConditions) GetRepositoryID() *RepositoryRulesetRepositoryIDsConditionParameters { + if r == nil { + return nil } - return *r.From + return r.RepositoryID } -// GetChanges returns the Changes field. -func (r *RepositoryRulesetEditedUpdatedConditions) GetChanges() *RepositoryRulesetUpdatedConditionsEdited { +// GetRepositoryName returns the RepositoryName field. +func (r *RepositoryRulesetConditions) GetRepositoryName() *RepositoryRulesetRepositoryNamesConditionParameters { if r == nil { return nil } - return r.Changes + return r.RepositoryName } -// GetCondition returns the Condition field. -func (r *RepositoryRulesetEditedUpdatedConditions) GetCondition() *RepositoryRulesetRefCondition { +// GetRepositoryProperty returns the RepositoryProperty field. +func (r *RepositoryRulesetConditions) GetRepositoryProperty() *RepositoryRulesetRepositoryPropertyConditionParameters { if r == nil { return nil } - return r.Condition + return r.RepositoryProperty } // GetAction returns the Action field if it's non-nil, zero value otherwise. @@ -22479,7 +22535,7 @@ func (r *RepositoryRulesetEvent) GetAction() string { } // GetChanges returns the Changes field. -func (r *RepositoryRulesetEvent) GetChanges() *RepositoryRulesetEditedChanges { +func (r *RepositoryRulesetEvent) GetChanges() *RepositoryRulesetChanges { if r == nil { return nil } @@ -22534,24 +22590,16 @@ func (r *RepositoryRulesetEvent) GetSender() *User { return r.Sender } -// GetParameters returns the Parameters field. -func (r *RepositoryRulesetFileExtensionRestrictionRule) GetParameters() *RuleFileExtensionRestrictionParameters { - if r == nil { - return nil - } - return r.Parameters -} - -// GetParameters returns the Parameters field. -func (r *RepositoryRulesetFilePathRestrictionRule) GetParameters() *RuleFileParameters { - if r == nil { - return nil +// GetHRef returns the HRef field if it's non-nil, zero value otherwise. +func (r *RepositoryRulesetLink) GetHRef() string { + if r == nil || r.HRef == nil { + return "" } - return r.Parameters + return *r.HRef } // GetHTML returns the HTML field. -func (r *RepositoryRulesetLink) GetHTML() *RulesetLink { +func (r *RepositoryRulesetLinks) GetHTML() *RepositoryRulesetLink { if r == nil { return nil } @@ -22559,79 +22607,31 @@ func (r *RepositoryRulesetLink) GetHTML() *RulesetLink { } // GetSelf returns the Self field. -func (r *RepositoryRulesetLink) GetSelf() *RulesetLink { +func (r *RepositoryRulesetLinks) GetSelf() *RepositoryRulesetLink { if r == nil { return nil } return r.Self } -// GetParameters returns the Parameters field. -func (r *RepositoryRulesetMaxFilePathLengthRule) GetParameters() *RuleMaxFilePathLengthParameters { - if r == nil { - return nil - } - return r.Parameters -} - -// GetParameters returns the Parameters field. -func (r *RepositoryRulesetMaxFileSizeRule) GetParameters() *RuleMaxFileSizeParameters { - if r == nil { - return nil - } - return r.Parameters -} - -// GetParameters returns the Parameters field. -func (r *RepositoryRulesetMergeQueueRule) GetParameters() *MergeQueueRuleParameters { - if r == nil { - return nil - } - return r.Parameters -} - -// GetParameters returns the Parameters field. -func (r *RepositoryRulesetPatternRule) GetParameters() *RulePatternParameters { - if r == nil { - return nil - } - return r.Parameters -} - -// GetParameters returns the Parameters field. -func (r *RepositoryRulesetPullRequestRule) GetParameters() *PullRequestRuleParameters { - if r == nil { - return nil - } - return r.Parameters -} - -// GetRefName returns the RefName field. -func (r *RepositoryRulesetRefCondition) GetRefName() *RulesetRefConditionParameters { - if r == nil { - return nil - } - return r.RefName -} - -// GetParameters returns the Parameters field. -func (r *RepositoryRulesetRequiredDeploymentsRule) GetParameters() *RequiredDeploymentEnvironmentsRuleParameters { - if r == nil { - return nil +// GetProtected returns the Protected field if it's non-nil, zero value otherwise. +func (r *RepositoryRulesetRepositoryNamesConditionParameters) GetProtected() bool { + if r == nil || r.Protected == nil { + return false } - return r.Parameters + return *r.Protected } -// GetParameters returns the Parameters field. -func (r *RepositoryRulesetRequiredStatusChecksRule) GetParameters() *RequiredStatusChecksRuleParameters { - if r == nil { - return nil +// GetSource returns the Source field if it's non-nil, zero value otherwise. +func (r *RepositoryRulesetRepositoryPropertyTargetParameters) GetSource() string { + if r == nil || r.Source == nil { + return "" } - return r.Parameters + return *r.Source } // GetBranchNamePattern returns the BranchNamePattern field. -func (r *RepositoryRulesetRule) GetBranchNamePattern() *RepositoryRulesetPatternRule { +func (r *RepositoryRulesetRules) GetBranchNamePattern() *PatternRuleParameters { if r == nil { return nil } @@ -22639,7 +22639,7 @@ func (r *RepositoryRulesetRule) GetBranchNamePattern() *RepositoryRulesetPattern } // GetCodeScanning returns the CodeScanning field. -func (r *RepositoryRulesetRule) GetCodeScanning() *RepositoryRulesetCodeScanningRule { +func (r *RepositoryRulesetRules) GetCodeScanning() *CodeScanningRuleParameters { if r == nil { return nil } @@ -22647,7 +22647,7 @@ func (r *RepositoryRulesetRule) GetCodeScanning() *RepositoryRulesetCodeScanning } // GetCommitAuthorEmailPattern returns the CommitAuthorEmailPattern field. -func (r *RepositoryRulesetRule) GetCommitAuthorEmailPattern() *RepositoryRulesetPatternRule { +func (r *RepositoryRulesetRules) GetCommitAuthorEmailPattern() *PatternRuleParameters { if r == nil { return nil } @@ -22655,7 +22655,7 @@ func (r *RepositoryRulesetRule) GetCommitAuthorEmailPattern() *RepositoryRuleset } // GetCommitMessagePattern returns the CommitMessagePattern field. -func (r *RepositoryRulesetRule) GetCommitMessagePattern() *RepositoryRulesetPatternRule { +func (r *RepositoryRulesetRules) GetCommitMessagePattern() *PatternRuleParameters { if r == nil { return nil } @@ -22663,7 +22663,7 @@ func (r *RepositoryRulesetRule) GetCommitMessagePattern() *RepositoryRulesetPatt } // GetCommitterEmailPattern returns the CommitterEmailPattern field. -func (r *RepositoryRulesetRule) GetCommitterEmailPattern() *RepositoryRulesetPatternRule { +func (r *RepositoryRulesetRules) GetCommitterEmailPattern() *PatternRuleParameters { if r == nil { return nil } @@ -22671,7 +22671,7 @@ func (r *RepositoryRulesetRule) GetCommitterEmailPattern() *RepositoryRulesetPat } // GetCreation returns the Creation field. -func (r *RepositoryRulesetRule) GetCreation() *RepositoryRulesetRuleType { +func (r *RepositoryRulesetRules) GetCreation() *EmptyRuleParameters { if r == nil { return nil } @@ -22679,7 +22679,7 @@ func (r *RepositoryRulesetRule) GetCreation() *RepositoryRulesetRuleType { } // GetDeletion returns the Deletion field. -func (r *RepositoryRulesetRule) GetDeletion() *RepositoryRulesetRuleType { +func (r *RepositoryRulesetRules) GetDeletion() *EmptyRuleParameters { if r == nil { return nil } @@ -22687,7 +22687,7 @@ func (r *RepositoryRulesetRule) GetDeletion() *RepositoryRulesetRuleType { } // GetFileExtensionRestriction returns the FileExtensionRestriction field. -func (r *RepositoryRulesetRule) GetFileExtensionRestriction() *RepositoryRulesetFileExtensionRestrictionRule { +func (r *RepositoryRulesetRules) GetFileExtensionRestriction() *FileExtensionRestrictionRuleParameters { if r == nil { return nil } @@ -22695,7 +22695,7 @@ func (r *RepositoryRulesetRule) GetFileExtensionRestriction() *RepositoryRuleset } // GetFilePathRestriction returns the FilePathRestriction field. -func (r *RepositoryRulesetRule) GetFilePathRestriction() *RepositoryRulesetFilePathRestrictionRule { +func (r *RepositoryRulesetRules) GetFilePathRestriction() *FilePathRestrictionRuleParameters { if r == nil { return nil } @@ -22703,7 +22703,7 @@ func (r *RepositoryRulesetRule) GetFilePathRestriction() *RepositoryRulesetFileP } // GetMaxFilePathLength returns the MaxFilePathLength field. -func (r *RepositoryRulesetRule) GetMaxFilePathLength() *RepositoryRulesetMaxFilePathLengthRule { +func (r *RepositoryRulesetRules) GetMaxFilePathLength() *MaxFilePathLengthRuleParameters { if r == nil { return nil } @@ -22711,7 +22711,7 @@ func (r *RepositoryRulesetRule) GetMaxFilePathLength() *RepositoryRulesetMaxFile } // GetMaxFileSize returns the MaxFileSize field. -func (r *RepositoryRulesetRule) GetMaxFileSize() *RepositoryRulesetMaxFileSizeRule { +func (r *RepositoryRulesetRules) GetMaxFileSize() *MaxFileSizeRuleParameters { if r == nil { return nil } @@ -22719,7 +22719,7 @@ func (r *RepositoryRulesetRule) GetMaxFileSize() *RepositoryRulesetMaxFileSizeRu } // GetMergeQueue returns the MergeQueue field. -func (r *RepositoryRulesetRule) GetMergeQueue() *RepositoryRulesetMergeQueueRule { +func (r *RepositoryRulesetRules) GetMergeQueue() *MergeQueueRuleParameters { if r == nil { return nil } @@ -22727,7 +22727,7 @@ func (r *RepositoryRulesetRule) GetMergeQueue() *RepositoryRulesetMergeQueueRule } // GetNonFastForward returns the NonFastForward field. -func (r *RepositoryRulesetRule) GetNonFastForward() *RepositoryRulesetRuleType { +func (r *RepositoryRulesetRules) GetNonFastForward() *EmptyRuleParameters { if r == nil { return nil } @@ -22735,7 +22735,7 @@ func (r *RepositoryRulesetRule) GetNonFastForward() *RepositoryRulesetRuleType { } // GetPullRequest returns the PullRequest field. -func (r *RepositoryRulesetRule) GetPullRequest() *RepositoryRulesetPullRequestRule { +func (r *RepositoryRulesetRules) GetPullRequest() *PullRequestRuleParameters { if r == nil { return nil } @@ -22743,7 +22743,7 @@ func (r *RepositoryRulesetRule) GetPullRequest() *RepositoryRulesetPullRequestRu } // GetRequiredDeployments returns the RequiredDeployments field. -func (r *RepositoryRulesetRule) GetRequiredDeployments() *RepositoryRulesetRequiredDeploymentsRule { +func (r *RepositoryRulesetRules) GetRequiredDeployments() *RequiredDeploymentsRuleParameters { if r == nil { return nil } @@ -22751,7 +22751,7 @@ func (r *RepositoryRulesetRule) GetRequiredDeployments() *RepositoryRulesetRequi } // GetRequiredLinearHistory returns the RequiredLinearHistory field. -func (r *RepositoryRulesetRule) GetRequiredLinearHistory() *RepositoryRulesetRuleType { +func (r *RepositoryRulesetRules) GetRequiredLinearHistory() *EmptyRuleParameters { if r == nil { return nil } @@ -22759,7 +22759,7 @@ func (r *RepositoryRulesetRule) GetRequiredLinearHistory() *RepositoryRulesetRul } // GetRequiredSignatures returns the RequiredSignatures field. -func (r *RepositoryRulesetRule) GetRequiredSignatures() *RepositoryRulesetRuleType { +func (r *RepositoryRulesetRules) GetRequiredSignatures() *EmptyRuleParameters { if r == nil { return nil } @@ -22767,7 +22767,7 @@ func (r *RepositoryRulesetRule) GetRequiredSignatures() *RepositoryRulesetRuleTy } // GetRequiredStatusChecks returns the RequiredStatusChecks field. -func (r *RepositoryRulesetRule) GetRequiredStatusChecks() *RepositoryRulesetRequiredStatusChecksRule { +func (r *RepositoryRulesetRules) GetRequiredStatusChecks() *RequiredStatusChecksRuleParameters { if r == nil { return nil } @@ -22775,7 +22775,7 @@ func (r *RepositoryRulesetRule) GetRequiredStatusChecks() *RepositoryRulesetRequ } // GetTagNamePattern returns the TagNamePattern field. -func (r *RepositoryRulesetRule) GetTagNamePattern() *RepositoryRulesetPatternRule { +func (r *RepositoryRulesetRules) GetTagNamePattern() *PatternRuleParameters { if r == nil { return nil } @@ -22783,7 +22783,7 @@ func (r *RepositoryRulesetRule) GetTagNamePattern() *RepositoryRulesetPatternRul } // GetUpdate returns the Update field. -func (r *RepositoryRulesetRule) GetUpdate() *RepositoryRulesetUpdateRule { +func (r *RepositoryRulesetRules) GetUpdate() *UpdateRuleParameters { if r == nil { return nil } @@ -22791,7 +22791,7 @@ func (r *RepositoryRulesetRule) GetUpdate() *RepositoryRulesetUpdateRule { } // GetWorkflows returns the Workflows field. -func (r *RepositoryRulesetRule) GetWorkflows() *RepositoryRulesetWorkflowsRule { +func (r *RepositoryRulesetRules) GetWorkflows() *WorkflowsRuleParameters { if r == nil { return nil } @@ -22799,7 +22799,7 @@ func (r *RepositoryRulesetRule) GetWorkflows() *RepositoryRulesetWorkflowsRule { } // GetConditionType returns the ConditionType field. -func (r *RepositoryRulesetUpdatedConditionsEdited) GetConditionType() *RepositoryRulesetEditedSource { +func (r *RepositoryRulesetUpdatedCondition) GetConditionType() *RepositoryRulesetChangeSource { if r == nil { return nil } @@ -22807,7 +22807,7 @@ func (r *RepositoryRulesetUpdatedConditionsEdited) GetConditionType() *Repositor } // GetExclude returns the Exclude field. -func (r *RepositoryRulesetUpdatedConditionsEdited) GetExclude() *RepositoryRulesetEditedSources { +func (r *RepositoryRulesetUpdatedCondition) GetExclude() *RepositoryRulesetChangeSources { if r == nil { return nil } @@ -22815,7 +22815,7 @@ func (r *RepositoryRulesetUpdatedConditionsEdited) GetExclude() *RepositoryRules } // GetInclude returns the Include field. -func (r *RepositoryRulesetUpdatedConditionsEdited) GetInclude() *RepositoryRulesetEditedSources { +func (r *RepositoryRulesetUpdatedCondition) GetInclude() *RepositoryRulesetChangeSources { if r == nil { return nil } @@ -22823,7 +22823,7 @@ func (r *RepositoryRulesetUpdatedConditionsEdited) GetInclude() *RepositoryRules } // GetTarget returns the Target field. -func (r *RepositoryRulesetUpdatedConditionsEdited) GetTarget() *RepositoryRulesetEditedSource { +func (r *RepositoryRulesetUpdatedCondition) GetTarget() *RepositoryRulesetChangeSource { if r == nil { return nil } @@ -22831,35 +22831,35 @@ func (r *RepositoryRulesetUpdatedConditionsEdited) GetTarget() *RepositoryRulese } // GetChanges returns the Changes field. -func (r *RepositoryRulesetUpdatedRules) GetChanges() *RepositoryRulesetEditedRuleChanges { +func (r *RepositoryRulesetUpdatedConditions) GetChanges() *RepositoryRulesetUpdatedCondition { if r == nil { return nil } return r.Changes } -// GetRule returns the Rule field. -func (r *RepositoryRulesetUpdatedRules) GetRule() *RepositoryRulesetRule { +// GetCondition returns the Condition field. +func (r *RepositoryRulesetUpdatedConditions) GetCondition() *RepositoryRulesetConditions { if r == nil { return nil } - return r.Rule + return r.Condition } -// GetParameters returns the Parameters field. -func (r *RepositoryRulesetUpdateRule) GetParameters() *UpdateAllowsFetchAndMergeRuleParameters { +// GetChanges returns the Changes field. +func (r *RepositoryRulesetUpdatedRules) GetChanges() *RepositoryRulesetChangedRule { if r == nil { return nil } - return r.Parameters + return r.Changes } -// GetParameters returns the Parameters field. -func (r *RepositoryRulesetWorkflowsRule) GetParameters() *RequiredWorkflowsRuleParameters { +// GetRule returns the Rule field. +func (r *RepositoryRulesetUpdatedRules) GetRule() *RepositoryRule { if r == nil { return nil } - return r.Parameters + return r.Rule } // GetCommit returns the Commit field. @@ -23350,32 +23350,8 @@ func (r *Rule) GetSeverity() string { return *r.Severity } -// GetRestrictedFilePaths returns the RestrictedFilePaths field if it's non-nil, zero value otherwise. -func (r *RuleFileParameters) GetRestrictedFilePaths() []string { - if r == nil || r.RestrictedFilePaths == nil { - return nil - } - return *r.RestrictedFilePaths -} - -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (r *RulePatternParameters) GetName() string { - if r == nil || r.Name == nil { - return "" - } - return *r.Name -} - -// GetNegate returns the Negate field if it's non-nil, zero value otherwise. -func (r *RulePatternParameters) GetNegate() bool { - if r == nil || r.Negate == nil { - return false - } - return *r.Negate -} - // GetIntegrationID returns the IntegrationID field if it's non-nil, zero value otherwise. -func (r *RuleRequiredStatusChecks) GetIntegrationID() int64 { +func (r *RuleStatusCheck) GetIntegrationID() int64 { if r == nil || r.IntegrationID == nil { return 0 } @@ -23383,7 +23359,7 @@ func (r *RuleRequiredStatusChecks) GetIntegrationID() int64 { } // GetRef returns the Ref field if it's non-nil, zero value otherwise. -func (r *RuleRequiredWorkflow) GetRef() string { +func (r *RuleWorkflow) GetRef() string { if r == nil || r.Ref == nil { return "" } @@ -23391,163 +23367,19 @@ func (r *RuleRequiredWorkflow) GetRef() string { } // GetRepositoryID returns the RepositoryID field if it's non-nil, zero value otherwise. -func (r *RuleRequiredWorkflow) GetRepositoryID() int64 { +func (r *RuleWorkflow) GetRepositoryID() int64 { if r == nil || r.RepositoryID == nil { return 0 } return *r.RepositoryID } -// GetSha returns the Sha field if it's non-nil, zero value otherwise. -func (r *RuleRequiredWorkflow) GetSha() string { - if r == nil || r.Sha == nil { - return "" - } - return *r.Sha -} - -// GetConditions returns the Conditions field. -func (r *Ruleset) GetConditions() *RulesetConditions { - if r == nil { - return nil - } - return r.Conditions -} - -// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (r *Ruleset) GetCreatedAt() Timestamp { - if r == nil || r.CreatedAt == nil { - return Timestamp{} - } - return *r.CreatedAt -} - -// GetID returns the ID field if it's non-nil, zero value otherwise. -func (r *Ruleset) GetID() int64 { - if r == nil || r.ID == nil { - return 0 - } - return *r.ID -} - -// GetLinks returns the Links field. -func (r *Ruleset) GetLinks() *RulesetLinks { - if r == nil { - return nil - } - return r.Links -} - -// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. -func (r *Ruleset) GetNodeID() string { - if r == nil || r.NodeID == nil { - return "" - } - return *r.NodeID -} - -// GetSourceType returns the SourceType field if it's non-nil, zero value otherwise. -func (r *Ruleset) GetSourceType() string { - if r == nil || r.SourceType == nil { - return "" - } - return *r.SourceType -} - -// GetTarget returns the Target field if it's non-nil, zero value otherwise. -func (r *Ruleset) GetTarget() string { - if r == nil || r.Target == nil { - return "" - } - return *r.Target -} - -// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (r *Ruleset) GetUpdatedAt() Timestamp { - if r == nil || r.UpdatedAt == nil { - return Timestamp{} - } - return *r.UpdatedAt -} - -// GetOrganizationID returns the OrganizationID field. -func (r *RulesetConditions) GetOrganizationID() *RulesetOrganizationIDsConditionParameters { - if r == nil { - return nil - } - return r.OrganizationID -} - -// GetOrganizationName returns the OrganizationName field. -func (r *RulesetConditions) GetOrganizationName() *RulesetOrganizationNamesConditionParameters { - if r == nil { - return nil - } - return r.OrganizationName -} - -// GetRefName returns the RefName field. -func (r *RulesetConditions) GetRefName() *RulesetRefConditionParameters { - if r == nil { - return nil - } - return r.RefName -} - -// GetRepositoryID returns the RepositoryID field. -func (r *RulesetConditions) GetRepositoryID() *RulesetRepositoryIDsConditionParameters { - if r == nil { - return nil - } - return r.RepositoryID -} - -// GetRepositoryName returns the RepositoryName field. -func (r *RulesetConditions) GetRepositoryName() *RulesetRepositoryNamesConditionParameters { - if r == nil { - return nil - } - return r.RepositoryName -} - -// GetRepositoryProperty returns the RepositoryProperty field. -func (r *RulesetConditions) GetRepositoryProperty() *RulesetRepositoryPropertyConditionParameters { - if r == nil { - return nil - } - return r.RepositoryProperty -} - -// GetHRef returns the HRef field if it's non-nil, zero value otherwise. -func (r *RulesetLink) GetHRef() string { - if r == nil || r.HRef == nil { - return "" - } - return *r.HRef -} - -// GetSelf returns the Self field. -func (r *RulesetLinks) GetSelf() *RulesetLink { - if r == nil { - return nil - } - return r.Self -} - -// GetProtected returns the Protected field if it's non-nil, zero value otherwise. -func (r *RulesetRepositoryNamesConditionParameters) GetProtected() bool { - if r == nil || r.Protected == nil { - return false - } - return *r.Protected -} - -// GetSource returns the Source field if it's non-nil, zero value otherwise. -func (r *RulesetRepositoryPropertyTargetParameters) GetSource() string { - if r == nil || r.Source == nil { +// GetSHA returns the SHA field if it's non-nil, zero value otherwise. +func (r *RuleWorkflow) GetSHA() string { + if r == nil || r.SHA == nil { return "" } - return *r.Source + return *r.SHA } // GetBusy returns the Busy field if it's non-nil, zero value otherwise. @@ -28550,6 +28382,14 @@ func (w *Workflows) GetTotalCount() int { return *w.TotalCount } +// GetDoNotEnforceOnCreate returns the DoNotEnforceOnCreate field if it's non-nil, zero value otherwise. +func (w *WorkflowsRuleParameters) GetDoNotEnforceOnCreate() bool { + if w == nil || w.DoNotEnforceOnCreate == nil { + return false + } + return *w.DoNotEnforceOnCreate +} + // GetBillable returns the Billable field. func (w *WorkflowUsage) GetBillable() *WorkflowBillMap { if w == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 5c689f83b24..5e79e74a8bf 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -2528,10 +2528,7 @@ func TestBypassActor_GetActorID(tt *testing.T) { func TestBypassActor_GetActorType(tt *testing.T) { tt.Parallel() - var zeroValue string - b := &BypassActor{ActorType: &zeroValue} - b.GetActorType() - b = &BypassActor{} + b := &BypassActor{} b.GetActorType() b = nil b.GetActorType() @@ -2539,10 +2536,7 @@ func TestBypassActor_GetActorType(tt *testing.T) { func TestBypassActor_GetBypassMode(tt *testing.T) { tt.Parallel() - var zeroValue string - b := &BypassActor{BypassMode: &zeroValue} - b.GetBypassMode() - b = &BypassActor{} + b := &BypassActor{} b.GetBypassMode() b = nil b.GetBypassMode() @@ -21630,6 +21624,28 @@ func TestPagesUpdate_GetSource(tt *testing.T) { p.GetSource() } +func TestPatternRuleParameters_GetName(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &PatternRuleParameters{Name: &zeroValue} + p.GetName() + p = &PatternRuleParameters{} + p.GetName() + p = nil + p.GetName() +} + +func TestPatternRuleParameters_GetNegate(tt *testing.T) { + tt.Parallel() + var zeroValue bool + p := &PatternRuleParameters{Negate: &zeroValue} + p.GetNegate() + p = &PatternRuleParameters{} + p.GetNegate() + p = nil + p.GetNegate() +} + func TestPendingDeployment_GetCurrentUserCanApprove(tt *testing.T) { tt.Parallel() var zeroValue bool @@ -28790,15 +28806,12 @@ func TestRepositoryRelease_GetZipballURL(tt *testing.T) { r.GetZipballURL() } -func TestRepositoryRule_GetParameters(tt *testing.T) { +func TestRepositoryRuleset_GetConditions(tt *testing.T) { tt.Parallel() - var zeroValue json.RawMessage - r := &RepositoryRule{Parameters: &zeroValue} - r.GetParameters() - r = &RepositoryRule{} - r.GetParameters() + r := &RepositoryRuleset{} + r.GetConditions() r = nil - r.GetParameters() + r.GetConditions() } func TestRepositoryRuleset_GetCreatedAt(tt *testing.T) { @@ -28814,15 +28827,23 @@ func TestRepositoryRuleset_GetCreatedAt(tt *testing.T) { func TestRepositoryRuleset_GetCurrentUserCanBypass(tt *testing.T) { tt.Parallel() - var zeroValue string - r := &RepositoryRuleset{CurrentUserCanBypass: &zeroValue} - r.GetCurrentUserCanBypass() - r = &RepositoryRuleset{} + r := &RepositoryRuleset{} r.GetCurrentUserCanBypass() r = nil r.GetCurrentUserCanBypass() } +func TestRepositoryRuleset_GetID(tt *testing.T) { + tt.Parallel() + var zeroValue int64 + r := &RepositoryRuleset{ID: &zeroValue} + r.GetID() + r = &RepositoryRuleset{} + r.GetID() + r = nil + r.GetID() +} + func TestRepositoryRuleset_GetLinks(tt *testing.T) { tt.Parallel() r := &RepositoryRuleset{} @@ -28842,12 +28863,17 @@ func TestRepositoryRuleset_GetNodeID(tt *testing.T) { r.GetNodeID() } +func TestRepositoryRuleset_GetRules(tt *testing.T) { + tt.Parallel() + r := &RepositoryRuleset{} + r.GetRules() + r = nil + r.GetRules() +} + func TestRepositoryRuleset_GetSourceType(tt *testing.T) { tt.Parallel() - var zeroValue string - r := &RepositoryRuleset{SourceType: &zeroValue} - r.GetSourceType() - r = &RepositoryRuleset{} + r := &RepositoryRuleset{} r.GetSourceType() r = nil r.GetSourceType() @@ -28855,10 +28881,7 @@ func TestRepositoryRuleset_GetSourceType(tt *testing.T) { func TestRepositoryRuleset_GetTarget(tt *testing.T) { tt.Parallel() - var zeroValue string - r := &RepositoryRuleset{Target: &zeroValue} - r.GetTarget() - r = &RepositoryRuleset{} + r := &RepositoryRuleset{} r.GetTarget() r = nil r.GetTarget() @@ -28875,95 +28898,119 @@ func TestRepositoryRuleset_GetUpdatedAt(tt *testing.T) { r.GetUpdatedAt() } -func TestRepositoryRulesetCodeScanningRule_GetParameters(tt *testing.T) { +func TestRepositoryRulesetChangedRule_GetConfiguration(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetChangedRule{} + r.GetConfiguration() + r = nil + r.GetConfiguration() +} + +func TestRepositoryRulesetChangedRule_GetPattern(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetCodeScanningRule{} - r.GetParameters() + r := &RepositoryRulesetChangedRule{} + r.GetPattern() r = nil - r.GetParameters() + r.GetPattern() } -func TestRepositoryRulesetEditedChanges_GetConditions(tt *testing.T) { +func TestRepositoryRulesetChangedRule_GetRuleType(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetEditedChanges{} + r := &RepositoryRulesetChangedRule{} + r.GetRuleType() + r = nil + r.GetRuleType() +} + +func TestRepositoryRulesetChanges_GetConditions(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetChanges{} r.GetConditions() r = nil r.GetConditions() } -func TestRepositoryRulesetEditedChanges_GetEnforcement(tt *testing.T) { +func TestRepositoryRulesetChanges_GetEnforcement(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetEditedChanges{} + r := &RepositoryRulesetChanges{} r.GetEnforcement() r = nil r.GetEnforcement() } -func TestRepositoryRulesetEditedChanges_GetName(tt *testing.T) { +func TestRepositoryRulesetChanges_GetName(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetEditedChanges{} + r := &RepositoryRulesetChanges{} r.GetName() r = nil r.GetName() } -func TestRepositoryRulesetEditedChanges_GetRules(tt *testing.T) { +func TestRepositoryRulesetChanges_GetRules(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetEditedChanges{} + r := &RepositoryRulesetChanges{} r.GetRules() r = nil r.GetRules() } -func TestRepositoryRulesetEditedRuleChanges_GetConfiguration(tt *testing.T) { +func TestRepositoryRulesetChangeSource_GetFrom(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetEditedRuleChanges{} - r.GetConfiguration() + var zeroValue string + r := &RepositoryRulesetChangeSource{From: &zeroValue} + r.GetFrom() + r = &RepositoryRulesetChangeSource{} + r.GetFrom() r = nil - r.GetConfiguration() + r.GetFrom() } -func TestRepositoryRulesetEditedRuleChanges_GetPattern(tt *testing.T) { +func TestRepositoryRulesetConditions_GetOrganizationID(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetEditedRuleChanges{} - r.GetPattern() + r := &RepositoryRulesetConditions{} + r.GetOrganizationID() r = nil - r.GetPattern() + r.GetOrganizationID() } -func TestRepositoryRulesetEditedRuleChanges_GetRuleType(tt *testing.T) { +func TestRepositoryRulesetConditions_GetOrganizationName(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetEditedRuleChanges{} - r.GetRuleType() + r := &RepositoryRulesetConditions{} + r.GetOrganizationName() r = nil - r.GetRuleType() + r.GetOrganizationName() } -func TestRepositoryRulesetEditedSource_GetFrom(tt *testing.T) { +func TestRepositoryRulesetConditions_GetRefName(tt *testing.T) { tt.Parallel() - var zeroValue string - r := &RepositoryRulesetEditedSource{From: &zeroValue} - r.GetFrom() - r = &RepositoryRulesetEditedSource{} - r.GetFrom() + r := &RepositoryRulesetConditions{} + r.GetRefName() r = nil - r.GetFrom() + r.GetRefName() } -func TestRepositoryRulesetEditedUpdatedConditions_GetChanges(tt *testing.T) { +func TestRepositoryRulesetConditions_GetRepositoryID(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetEditedUpdatedConditions{} - r.GetChanges() + r := &RepositoryRulesetConditions{} + r.GetRepositoryID() r = nil - r.GetChanges() + r.GetRepositoryID() } -func TestRepositoryRulesetEditedUpdatedConditions_GetCondition(tt *testing.T) { +func TestRepositoryRulesetConditions_GetRepositoryName(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetEditedUpdatedConditions{} - r.GetCondition() + r := &RepositoryRulesetConditions{} + r.GetRepositoryName() r = nil - r.GetCondition() + r.GetRepositoryName() +} + +func TestRepositoryRulesetConditions_GetRepositoryProperty(tt *testing.T) { + tt.Parallel() + r := &RepositoryRulesetConditions{} + r.GetRepositoryProperty() + r = nil + r.GetRepositoryProperty() } func TestRepositoryRulesetEvent_GetAction(tt *testing.T) { @@ -29033,332 +29080,285 @@ func TestRepositoryRulesetEvent_GetSender(tt *testing.T) { r.GetSender() } -func TestRepositoryRulesetFileExtensionRestrictionRule_GetParameters(tt *testing.T) { - tt.Parallel() - r := &RepositoryRulesetFileExtensionRestrictionRule{} - r.GetParameters() - r = nil - r.GetParameters() -} - -func TestRepositoryRulesetFilePathRestrictionRule_GetParameters(tt *testing.T) { +func TestRepositoryRulesetLink_GetHRef(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetFilePathRestrictionRule{} - r.GetParameters() + var zeroValue string + r := &RepositoryRulesetLink{HRef: &zeroValue} + r.GetHRef() + r = &RepositoryRulesetLink{} + r.GetHRef() r = nil - r.GetParameters() + r.GetHRef() } -func TestRepositoryRulesetLink_GetHTML(tt *testing.T) { +func TestRepositoryRulesetLinks_GetHTML(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetLink{} + r := &RepositoryRulesetLinks{} r.GetHTML() r = nil r.GetHTML() } -func TestRepositoryRulesetLink_GetSelf(tt *testing.T) { +func TestRepositoryRulesetLinks_GetSelf(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetLink{} + r := &RepositoryRulesetLinks{} r.GetSelf() r = nil r.GetSelf() } -func TestRepositoryRulesetMaxFilePathLengthRule_GetParameters(tt *testing.T) { +func TestRepositoryRulesetRepositoryNamesConditionParameters_GetProtected(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetMaxFilePathLengthRule{} - r.GetParameters() - r = nil - r.GetParameters() -} - -func TestRepositoryRulesetMaxFileSizeRule_GetParameters(tt *testing.T) { - tt.Parallel() - r := &RepositoryRulesetMaxFileSizeRule{} - r.GetParameters() - r = nil - r.GetParameters() -} - -func TestRepositoryRulesetMergeQueueRule_GetParameters(tt *testing.T) { - tt.Parallel() - r := &RepositoryRulesetMergeQueueRule{} - r.GetParameters() - r = nil - r.GetParameters() -} - -func TestRepositoryRulesetPatternRule_GetParameters(tt *testing.T) { - tt.Parallel() - r := &RepositoryRulesetPatternRule{} - r.GetParameters() - r = nil - r.GetParameters() -} - -func TestRepositoryRulesetPullRequestRule_GetParameters(tt *testing.T) { - tt.Parallel() - r := &RepositoryRulesetPullRequestRule{} - r.GetParameters() - r = nil - r.GetParameters() -} - -func TestRepositoryRulesetRefCondition_GetRefName(tt *testing.T) { - tt.Parallel() - r := &RepositoryRulesetRefCondition{} - r.GetRefName() - r = nil - r.GetRefName() -} - -func TestRepositoryRulesetRequiredDeploymentsRule_GetParameters(tt *testing.T) { - tt.Parallel() - r := &RepositoryRulesetRequiredDeploymentsRule{} - r.GetParameters() + var zeroValue bool + r := &RepositoryRulesetRepositoryNamesConditionParameters{Protected: &zeroValue} + r.GetProtected() + r = &RepositoryRulesetRepositoryNamesConditionParameters{} + r.GetProtected() r = nil - r.GetParameters() + r.GetProtected() } -func TestRepositoryRulesetRequiredStatusChecksRule_GetParameters(tt *testing.T) { +func TestRepositoryRulesetRepositoryPropertyTargetParameters_GetSource(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetRequiredStatusChecksRule{} - r.GetParameters() + var zeroValue string + r := &RepositoryRulesetRepositoryPropertyTargetParameters{Source: &zeroValue} + r.GetSource() + r = &RepositoryRulesetRepositoryPropertyTargetParameters{} + r.GetSource() r = nil - r.GetParameters() + r.GetSource() } -func TestRepositoryRulesetRule_GetBranchNamePattern(tt *testing.T) { +func TestRepositoryRulesetRules_GetBranchNamePattern(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetRule{} + r := &RepositoryRulesetRules{} r.GetBranchNamePattern() r = nil r.GetBranchNamePattern() } -func TestRepositoryRulesetRule_GetCodeScanning(tt *testing.T) { +func TestRepositoryRulesetRules_GetCodeScanning(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetRule{} + r := &RepositoryRulesetRules{} r.GetCodeScanning() r = nil r.GetCodeScanning() } -func TestRepositoryRulesetRule_GetCommitAuthorEmailPattern(tt *testing.T) { +func TestRepositoryRulesetRules_GetCommitAuthorEmailPattern(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetRule{} + r := &RepositoryRulesetRules{} r.GetCommitAuthorEmailPattern() r = nil r.GetCommitAuthorEmailPattern() } -func TestRepositoryRulesetRule_GetCommitMessagePattern(tt *testing.T) { +func TestRepositoryRulesetRules_GetCommitMessagePattern(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetRule{} + r := &RepositoryRulesetRules{} r.GetCommitMessagePattern() r = nil r.GetCommitMessagePattern() } -func TestRepositoryRulesetRule_GetCommitterEmailPattern(tt *testing.T) { +func TestRepositoryRulesetRules_GetCommitterEmailPattern(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetRule{} + r := &RepositoryRulesetRules{} r.GetCommitterEmailPattern() r = nil r.GetCommitterEmailPattern() } -func TestRepositoryRulesetRule_GetCreation(tt *testing.T) { +func TestRepositoryRulesetRules_GetCreation(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetRule{} + r := &RepositoryRulesetRules{} r.GetCreation() r = nil r.GetCreation() } -func TestRepositoryRulesetRule_GetDeletion(tt *testing.T) { +func TestRepositoryRulesetRules_GetDeletion(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetRule{} + r := &RepositoryRulesetRules{} r.GetDeletion() r = nil r.GetDeletion() } -func TestRepositoryRulesetRule_GetFileExtensionRestriction(tt *testing.T) { +func TestRepositoryRulesetRules_GetFileExtensionRestriction(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetRule{} + r := &RepositoryRulesetRules{} r.GetFileExtensionRestriction() r = nil r.GetFileExtensionRestriction() } -func TestRepositoryRulesetRule_GetFilePathRestriction(tt *testing.T) { +func TestRepositoryRulesetRules_GetFilePathRestriction(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetRule{} + r := &RepositoryRulesetRules{} r.GetFilePathRestriction() r = nil r.GetFilePathRestriction() } -func TestRepositoryRulesetRule_GetMaxFilePathLength(tt *testing.T) { +func TestRepositoryRulesetRules_GetMaxFilePathLength(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetRule{} + r := &RepositoryRulesetRules{} r.GetMaxFilePathLength() r = nil r.GetMaxFilePathLength() } -func TestRepositoryRulesetRule_GetMaxFileSize(tt *testing.T) { +func TestRepositoryRulesetRules_GetMaxFileSize(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetRule{} + r := &RepositoryRulesetRules{} r.GetMaxFileSize() r = nil r.GetMaxFileSize() } -func TestRepositoryRulesetRule_GetMergeQueue(tt *testing.T) { +func TestRepositoryRulesetRules_GetMergeQueue(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetRule{} + r := &RepositoryRulesetRules{} r.GetMergeQueue() r = nil r.GetMergeQueue() } -func TestRepositoryRulesetRule_GetNonFastForward(tt *testing.T) { +func TestRepositoryRulesetRules_GetNonFastForward(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetRule{} + r := &RepositoryRulesetRules{} r.GetNonFastForward() r = nil r.GetNonFastForward() } -func TestRepositoryRulesetRule_GetPullRequest(tt *testing.T) { +func TestRepositoryRulesetRules_GetPullRequest(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetRule{} + r := &RepositoryRulesetRules{} r.GetPullRequest() r = nil r.GetPullRequest() } -func TestRepositoryRulesetRule_GetRequiredDeployments(tt *testing.T) { +func TestRepositoryRulesetRules_GetRequiredDeployments(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetRule{} + r := &RepositoryRulesetRules{} r.GetRequiredDeployments() r = nil r.GetRequiredDeployments() } -func TestRepositoryRulesetRule_GetRequiredLinearHistory(tt *testing.T) { +func TestRepositoryRulesetRules_GetRequiredLinearHistory(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetRule{} + r := &RepositoryRulesetRules{} r.GetRequiredLinearHistory() r = nil r.GetRequiredLinearHistory() } -func TestRepositoryRulesetRule_GetRequiredSignatures(tt *testing.T) { +func TestRepositoryRulesetRules_GetRequiredSignatures(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetRule{} + r := &RepositoryRulesetRules{} r.GetRequiredSignatures() r = nil r.GetRequiredSignatures() } -func TestRepositoryRulesetRule_GetRequiredStatusChecks(tt *testing.T) { +func TestRepositoryRulesetRules_GetRequiredStatusChecks(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetRule{} + r := &RepositoryRulesetRules{} r.GetRequiredStatusChecks() r = nil r.GetRequiredStatusChecks() } -func TestRepositoryRulesetRule_GetTagNamePattern(tt *testing.T) { +func TestRepositoryRulesetRules_GetTagNamePattern(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetRule{} + r := &RepositoryRulesetRules{} r.GetTagNamePattern() r = nil r.GetTagNamePattern() } -func TestRepositoryRulesetRule_GetUpdate(tt *testing.T) { +func TestRepositoryRulesetRules_GetUpdate(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetRule{} + r := &RepositoryRulesetRules{} r.GetUpdate() r = nil r.GetUpdate() } -func TestRepositoryRulesetRule_GetWorkflows(tt *testing.T) { +func TestRepositoryRulesetRules_GetWorkflows(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetRule{} + r := &RepositoryRulesetRules{} r.GetWorkflows() r = nil r.GetWorkflows() } -func TestRepositoryRulesetUpdatedConditionsEdited_GetConditionType(tt *testing.T) { +func TestRepositoryRulesetUpdatedCondition_GetConditionType(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetUpdatedConditionsEdited{} + r := &RepositoryRulesetUpdatedCondition{} r.GetConditionType() r = nil r.GetConditionType() } -func TestRepositoryRulesetUpdatedConditionsEdited_GetExclude(tt *testing.T) { +func TestRepositoryRulesetUpdatedCondition_GetExclude(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetUpdatedConditionsEdited{} + r := &RepositoryRulesetUpdatedCondition{} r.GetExclude() r = nil r.GetExclude() } -func TestRepositoryRulesetUpdatedConditionsEdited_GetInclude(tt *testing.T) { +func TestRepositoryRulesetUpdatedCondition_GetInclude(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetUpdatedConditionsEdited{} + r := &RepositoryRulesetUpdatedCondition{} r.GetInclude() r = nil r.GetInclude() } -func TestRepositoryRulesetUpdatedConditionsEdited_GetTarget(tt *testing.T) { +func TestRepositoryRulesetUpdatedCondition_GetTarget(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetUpdatedConditionsEdited{} + r := &RepositoryRulesetUpdatedCondition{} r.GetTarget() r = nil r.GetTarget() } -func TestRepositoryRulesetUpdatedRules_GetChanges(tt *testing.T) { +func TestRepositoryRulesetUpdatedConditions_GetChanges(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetUpdatedRules{} + r := &RepositoryRulesetUpdatedConditions{} r.GetChanges() r = nil r.GetChanges() } -func TestRepositoryRulesetUpdatedRules_GetRule(tt *testing.T) { +func TestRepositoryRulesetUpdatedConditions_GetCondition(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetUpdatedRules{} - r.GetRule() + r := &RepositoryRulesetUpdatedConditions{} + r.GetCondition() r = nil - r.GetRule() + r.GetCondition() } -func TestRepositoryRulesetUpdateRule_GetParameters(tt *testing.T) { +func TestRepositoryRulesetUpdatedRules_GetChanges(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetUpdateRule{} - r.GetParameters() + r := &RepositoryRulesetUpdatedRules{} + r.GetChanges() r = nil - r.GetParameters() + r.GetChanges() } -func TestRepositoryRulesetWorkflowsRule_GetParameters(tt *testing.T) { +func TestRepositoryRulesetUpdatedRules_GetRule(tt *testing.T) { tt.Parallel() - r := &RepositoryRulesetWorkflowsRule{} - r.GetParameters() + r := &RepositoryRulesetUpdatedRules{} + r.GetRule() r = nil - r.GetParameters() + r.GetRule() } func TestRepositoryTag_GetCommit(tt *testing.T) { @@ -30008,252 +30008,48 @@ func TestRule_GetSeverity(tt *testing.T) { r.GetSeverity() } -func TestRuleFileParameters_GetRestrictedFilePaths(tt *testing.T) { - tt.Parallel() - var zeroValue []string - r := &RuleFileParameters{RestrictedFilePaths: &zeroValue} - r.GetRestrictedFilePaths() - r = &RuleFileParameters{} - r.GetRestrictedFilePaths() - r = nil - r.GetRestrictedFilePaths() -} - -func TestRulePatternParameters_GetName(tt *testing.T) { - tt.Parallel() - var zeroValue string - r := &RulePatternParameters{Name: &zeroValue} - r.GetName() - r = &RulePatternParameters{} - r.GetName() - r = nil - r.GetName() -} - -func TestRulePatternParameters_GetNegate(tt *testing.T) { - tt.Parallel() - var zeroValue bool - r := &RulePatternParameters{Negate: &zeroValue} - r.GetNegate() - r = &RulePatternParameters{} - r.GetNegate() - r = nil - r.GetNegate() -} - -func TestRuleRequiredStatusChecks_GetIntegrationID(tt *testing.T) { +func TestRuleStatusCheck_GetIntegrationID(tt *testing.T) { tt.Parallel() var zeroValue int64 - r := &RuleRequiredStatusChecks{IntegrationID: &zeroValue} + r := &RuleStatusCheck{IntegrationID: &zeroValue} r.GetIntegrationID() - r = &RuleRequiredStatusChecks{} + r = &RuleStatusCheck{} r.GetIntegrationID() r = nil r.GetIntegrationID() } -func TestRuleRequiredWorkflow_GetRef(tt *testing.T) { +func TestRuleWorkflow_GetRef(tt *testing.T) { tt.Parallel() var zeroValue string - r := &RuleRequiredWorkflow{Ref: &zeroValue} + r := &RuleWorkflow{Ref: &zeroValue} r.GetRef() - r = &RuleRequiredWorkflow{} + r = &RuleWorkflow{} r.GetRef() r = nil r.GetRef() } -func TestRuleRequiredWorkflow_GetRepositoryID(tt *testing.T) { +func TestRuleWorkflow_GetRepositoryID(tt *testing.T) { tt.Parallel() var zeroValue int64 - r := &RuleRequiredWorkflow{RepositoryID: &zeroValue} + r := &RuleWorkflow{RepositoryID: &zeroValue} r.GetRepositoryID() - r = &RuleRequiredWorkflow{} - r.GetRepositoryID() - r = nil - r.GetRepositoryID() -} - -func TestRuleRequiredWorkflow_GetSha(tt *testing.T) { - tt.Parallel() - var zeroValue string - r := &RuleRequiredWorkflow{Sha: &zeroValue} - r.GetSha() - r = &RuleRequiredWorkflow{} - r.GetSha() - r = nil - r.GetSha() -} - -func TestRuleset_GetConditions(tt *testing.T) { - tt.Parallel() - r := &Ruleset{} - r.GetConditions() - r = nil - r.GetConditions() -} - -func TestRuleset_GetCreatedAt(tt *testing.T) { - tt.Parallel() - var zeroValue Timestamp - r := &Ruleset{CreatedAt: &zeroValue} - r.GetCreatedAt() - r = &Ruleset{} - r.GetCreatedAt() - r = nil - r.GetCreatedAt() -} - -func TestRuleset_GetID(tt *testing.T) { - tt.Parallel() - var zeroValue int64 - r := &Ruleset{ID: &zeroValue} - r.GetID() - r = &Ruleset{} - r.GetID() - r = nil - r.GetID() -} - -func TestRuleset_GetLinks(tt *testing.T) { - tt.Parallel() - r := &Ruleset{} - r.GetLinks() - r = nil - r.GetLinks() -} - -func TestRuleset_GetNodeID(tt *testing.T) { - tt.Parallel() - var zeroValue string - r := &Ruleset{NodeID: &zeroValue} - r.GetNodeID() - r = &Ruleset{} - r.GetNodeID() - r = nil - r.GetNodeID() -} - -func TestRuleset_GetSourceType(tt *testing.T) { - tt.Parallel() - var zeroValue string - r := &Ruleset{SourceType: &zeroValue} - r.GetSourceType() - r = &Ruleset{} - r.GetSourceType() - r = nil - r.GetSourceType() -} - -func TestRuleset_GetTarget(tt *testing.T) { - tt.Parallel() - var zeroValue string - r := &Ruleset{Target: &zeroValue} - r.GetTarget() - r = &Ruleset{} - r.GetTarget() - r = nil - r.GetTarget() -} - -func TestRuleset_GetUpdatedAt(tt *testing.T) { - tt.Parallel() - var zeroValue Timestamp - r := &Ruleset{UpdatedAt: &zeroValue} - r.GetUpdatedAt() - r = &Ruleset{} - r.GetUpdatedAt() - r = nil - r.GetUpdatedAt() -} - -func TestRulesetConditions_GetOrganizationID(tt *testing.T) { - tt.Parallel() - r := &RulesetConditions{} - r.GetOrganizationID() - r = nil - r.GetOrganizationID() -} - -func TestRulesetConditions_GetOrganizationName(tt *testing.T) { - tt.Parallel() - r := &RulesetConditions{} - r.GetOrganizationName() - r = nil - r.GetOrganizationName() -} - -func TestRulesetConditions_GetRefName(tt *testing.T) { - tt.Parallel() - r := &RulesetConditions{} - r.GetRefName() - r = nil - r.GetRefName() -} - -func TestRulesetConditions_GetRepositoryID(tt *testing.T) { - tt.Parallel() - r := &RulesetConditions{} + r = &RuleWorkflow{} r.GetRepositoryID() r = nil r.GetRepositoryID() } -func TestRulesetConditions_GetRepositoryName(tt *testing.T) { - tt.Parallel() - r := &RulesetConditions{} - r.GetRepositoryName() - r = nil - r.GetRepositoryName() -} - -func TestRulesetConditions_GetRepositoryProperty(tt *testing.T) { - tt.Parallel() - r := &RulesetConditions{} - r.GetRepositoryProperty() - r = nil - r.GetRepositoryProperty() -} - -func TestRulesetLink_GetHRef(tt *testing.T) { - tt.Parallel() - var zeroValue string - r := &RulesetLink{HRef: &zeroValue} - r.GetHRef() - r = &RulesetLink{} - r.GetHRef() - r = nil - r.GetHRef() -} - -func TestRulesetLinks_GetSelf(tt *testing.T) { - tt.Parallel() - r := &RulesetLinks{} - r.GetSelf() - r = nil - r.GetSelf() -} - -func TestRulesetRepositoryNamesConditionParameters_GetProtected(tt *testing.T) { - tt.Parallel() - var zeroValue bool - r := &RulesetRepositoryNamesConditionParameters{Protected: &zeroValue} - r.GetProtected() - r = &RulesetRepositoryNamesConditionParameters{} - r.GetProtected() - r = nil - r.GetProtected() -} - -func TestRulesetRepositoryPropertyTargetParameters_GetSource(tt *testing.T) { +func TestRuleWorkflow_GetSHA(tt *testing.T) { tt.Parallel() var zeroValue string - r := &RulesetRepositoryPropertyTargetParameters{Source: &zeroValue} - r.GetSource() - r = &RulesetRepositoryPropertyTargetParameters{} - r.GetSource() + r := &RuleWorkflow{SHA: &zeroValue} + r.GetSHA() + r = &RuleWorkflow{} + r.GetSHA() r = nil - r.GetSource() + r.GetSHA() } func TestRunner_GetBusy(tt *testing.T) { @@ -36723,6 +36519,17 @@ func TestWorkflows_GetTotalCount(tt *testing.T) { w.GetTotalCount() } +func TestWorkflowsRuleParameters_GetDoNotEnforceOnCreate(tt *testing.T) { + tt.Parallel() + var zeroValue bool + w := &WorkflowsRuleParameters{DoNotEnforceOnCreate: &zeroValue} + w.GetDoNotEnforceOnCreate() + w = &WorkflowsRuleParameters{} + w.GetDoNotEnforceOnCreate() + w = nil + w.GetDoNotEnforceOnCreate() +} + func TestWorkflowUsage_GetBillable(tt *testing.T) { tt.Parallel() w := &WorkflowUsage{} diff --git a/github/github.go b/github/github.go index 60e8b86c40f..d4ba320aa5d 100644 --- a/github/github.go +++ b/github/github.go @@ -961,7 +961,6 @@ var errInvalidLocation = errors.New("invalid or empty Location header in redirec // canceled or times out, ctx.Err() will be returned. func (c *Client) bareDoUntilFound(ctx context.Context, req *http.Request, maxRedirects int) (*url.URL, *Response, error) { response, err := c.bareDoIgnoreRedirects(ctx, req) - if err != nil { rerr, ok := err.(*RedirectionError) if ok { diff --git a/github/orgs_rules.go b/github/orgs_rules.go index b0773fab917..8cb2e5d1f92 100644 --- a/github/orgs_rules.go +++ b/github/orgs_rules.go @@ -10,12 +10,12 @@ import ( "fmt" ) -// GetAllOrganizationRulesets gets all the rulesets for the specified organization. +// GetAllRepositoryRulesets gets all the repository rulesets for the specified organization. // // GitHub API docs: https://docs.github.com/rest/orgs/rules#get-all-organization-repository-rulesets // //meta:operation GET /orgs/{org}/rulesets -func (s *OrganizationsService) GetAllOrganizationRulesets(ctx context.Context, org string) ([]*Ruleset, *Response, error) { +func (s *OrganizationsService) GetAllRepositoryRulesets(ctx context.Context, org string) ([]*RepositoryRuleset, *Response, error) { u := fmt.Sprintf("orgs/%v/rulesets", org) req, err := s.client.NewRequest("GET", u, nil) @@ -23,7 +23,7 @@ func (s *OrganizationsService) GetAllOrganizationRulesets(ctx context.Context, o return nil, nil, err } - var rulesets []*Ruleset + var rulesets []*RepositoryRuleset resp, err := s.client.Do(ctx, req, &rulesets) if err != nil { return nil, resp, err @@ -32,12 +32,12 @@ func (s *OrganizationsService) GetAllOrganizationRulesets(ctx context.Context, o return rulesets, resp, nil } -// CreateOrganizationRuleset creates a ruleset for the specified organization. +// CreateRepositoryRuleset creates a repository ruleset for the specified organization. // // GitHub API docs: https://docs.github.com/rest/orgs/rules#create-an-organization-repository-ruleset // //meta:operation POST /orgs/{org}/rulesets -func (s *OrganizationsService) CreateOrganizationRuleset(ctx context.Context, org string, ruleset Ruleset) (*Ruleset, *Response, error) { +func (s *OrganizationsService) CreateRepositoryRuleset(ctx context.Context, org string, ruleset RepositoryRuleset) (*RepositoryRuleset, *Response, error) { u := fmt.Sprintf("orgs/%v/rulesets", org) req, err := s.client.NewRequest("POST", u, ruleset) @@ -45,7 +45,7 @@ func (s *OrganizationsService) CreateOrganizationRuleset(ctx context.Context, or return nil, nil, err } - var rs *Ruleset + var rs *RepositoryRuleset resp, err := s.client.Do(ctx, req, &rs) if err != nil { return nil, resp, err @@ -54,12 +54,12 @@ func (s *OrganizationsService) CreateOrganizationRuleset(ctx context.Context, or return rs, resp, nil } -// GetOrganizationRuleset gets a ruleset from the specified organization. +// GetRepositoryRuleset gets a repository ruleset for the specified organization. // // GitHub API docs: https://docs.github.com/rest/orgs/rules#get-an-organization-repository-ruleset // //meta:operation GET /orgs/{org}/rulesets/{ruleset_id} -func (s *OrganizationsService) GetOrganizationRuleset(ctx context.Context, org string, rulesetID int64) (*Ruleset, *Response, error) { +func (s *OrganizationsService) GetRepositoryRuleset(ctx context.Context, org string, rulesetID int64) (*RepositoryRuleset, *Response, error) { u := fmt.Sprintf("orgs/%v/rulesets/%v", org, rulesetID) req, err := s.client.NewRequest("GET", u, nil) @@ -67,7 +67,7 @@ func (s *OrganizationsService) GetOrganizationRuleset(ctx context.Context, org s return nil, nil, err } - var ruleset *Ruleset + var ruleset *RepositoryRuleset resp, err := s.client.Do(ctx, req, &ruleset) if err != nil { return nil, resp, err @@ -76,12 +76,12 @@ func (s *OrganizationsService) GetOrganizationRuleset(ctx context.Context, org s return ruleset, resp, nil } -// UpdateOrganizationRuleset updates a ruleset from the specified organization. +// UpdateRepositoryRuleset updates a repository ruleset for the specified organization. // // GitHub API docs: https://docs.github.com/rest/orgs/rules#update-an-organization-repository-ruleset // //meta:operation PUT /orgs/{org}/rulesets/{ruleset_id} -func (s *OrganizationsService) UpdateOrganizationRuleset(ctx context.Context, org string, rulesetID int64, ruleset Ruleset) (*Ruleset, *Response, error) { +func (s *OrganizationsService) UpdateRepositoryRuleset(ctx context.Context, org string, rulesetID int64, ruleset RepositoryRuleset) (*RepositoryRuleset, *Response, error) { u := fmt.Sprintf("orgs/%v/rulesets/%v", org, rulesetID) req, err := s.client.NewRequest("PUT", u, ruleset) @@ -89,7 +89,7 @@ func (s *OrganizationsService) UpdateOrganizationRuleset(ctx context.Context, or return nil, nil, err } - var rs *Ruleset + var rs *RepositoryRuleset resp, err := s.client.Do(ctx, req, &rs) if err != nil { return nil, resp, err @@ -98,14 +98,14 @@ func (s *OrganizationsService) UpdateOrganizationRuleset(ctx context.Context, or return rs, resp, nil } -// UpdateOrganizationRulesetClearBypassActor clears the ruleset bypass actors for a ruleset for the specified repository. +// UpdateRepositoryRulesetClearBypassActor clears the bypass actors for a repository ruleset for the specified organization. // -// This function is necessary as the UpdateOrganizationRuleset function does not marshal ByPassActor if passed as an empty array. +// This function is necessary as the UpdateRepositoryRuleset function does not marshal ByPassActor if passed as an empty array. // // GitHub API docs: https://docs.github.com/rest/orgs/rules#update-an-organization-repository-ruleset // //meta:operation PUT /orgs/{org}/rulesets/{ruleset_id} -func (s *OrganizationsService) UpdateOrganizationRulesetClearBypassActor(ctx context.Context, org string, rulesetID int64) (*Response, error) { +func (s *OrganizationsService) UpdateRepositoryRulesetClearBypassActor(ctx context.Context, org string, rulesetID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/rulesets/%v", org, rulesetID) rsClearBypassActor := rulesetClearBypassActors{} @@ -123,12 +123,12 @@ func (s *OrganizationsService) UpdateOrganizationRulesetClearBypassActor(ctx con return resp, nil } -// DeleteOrganizationRuleset deletes a ruleset from the specified organization. +// DeleteRepositoryRuleset deletes a repository ruleset from the specified organization. // // GitHub API docs: https://docs.github.com/rest/orgs/rules#delete-an-organization-repository-ruleset // //meta:operation DELETE /orgs/{org}/rulesets/{ruleset_id} -func (s *OrganizationsService) DeleteOrganizationRuleset(ctx context.Context, org string, rulesetID int64) (*Response, error) { +func (s *OrganizationsService) DeleteRepositoryRuleset(ctx context.Context, org string, rulesetID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/rulesets/%v", org, rulesetID) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/orgs_rules_test.go b/github/orgs_rules_test.go index 13afd4f058e..2d2080a7f4c 100644 --- a/github/orgs_rules_test.go +++ b/github/orgs_rules_test.go @@ -14,14 +14,14 @@ import ( "github.com/google/go-cmp/cmp" ) -func TestOrganizationsService_GetAllOrganizationRulesets(t *testing.T) { +func TestOrganizationsService_GetAllRepositoryRulesets(t *testing.T) { t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/orgs/o/rulesets", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `[{ - "id": 26110, + "id": 21, "name": "test ruleset", "target": "branch", "source_type": "Organization", @@ -31,38 +31,38 @@ func TestOrganizationsService_GetAllOrganizationRulesets(t *testing.T) { "node_id": "nid", "_links": { "self": { - "href": "https://api.github.com/orgs/o/rulesets/26110" + "href": "https://api.github.com/orgs/o/rulesets/21" } } }]`) }) ctx := context.Background() - rulesets, _, err := client.Organizations.GetAllOrganizationRulesets(ctx, "o") + rulesets, _, err := client.Organizations.GetAllRepositoryRulesets(ctx, "o") if err != nil { - t.Errorf("Organizations.GetAllOrganizationRulesets returned error: %v", err) + t.Errorf("Organizations.GetAllRepositoryRulesets returned error: %v", err) } - want := []*Ruleset{{ - ID: Ptr(int64(26110)), + want := []*RepositoryRuleset{{ + ID: Ptr(int64(21)), Name: "test ruleset", - Target: Ptr("branch"), - SourceType: Ptr("Organization"), + Target: Ptr(RulesetTargetBranch), + SourceType: Ptr(RulesetSourceTypeOrganization), Source: "o", Enforcement: "active", NodeID: Ptr("nid"), - Links: &RulesetLinks{ - Self: &RulesetLink{HRef: Ptr("https://api.github.com/orgs/o/rulesets/26110")}, + Links: &RepositoryRulesetLinks{ + Self: &RepositoryRulesetLink{HRef: Ptr("https://api.github.com/orgs/o/rulesets/21")}, }, }} if !cmp.Equal(rulesets, want) { - t.Errorf("Organizations.GetAllOrganizationRulesets returned %+v, want %+v", rulesets, want) + t.Errorf("Organizations.GetAllRepositoryRulesets returned %+v, want %+v", rulesets, want) } - const methodName = "GetAllOrganizationRulesets" + const methodName = "GetAllRepositoryRulesets" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Organizations.GetAllOrganizationRulesets(ctx, "o") + got, resp, err := client.Organizations.GetAllRepositoryRulesets(ctx, "o") if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -70,7 +70,7 @@ func TestOrganizationsService_GetAllOrganizationRulesets(t *testing.T) { }) } -func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) { +func TestOrganizationsService_CreateRepositoryRuleset_RepoNames(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -149,6 +149,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) { "type": "required_status_checks", "parameters": { + "do_not_enforce_on_create": true, "required_status_checks": [ { "context": "test", @@ -221,202 +222,201 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) }) ctx := context.Background() - ruleset, _, err := client.Organizations.CreateOrganizationRuleset(ctx, "o", Ruleset{ - ID: Ptr(int64(21)), + ruleset, _, err := client.Organizations.CreateRepositoryRuleset(ctx, "o", RepositoryRuleset{ Name: "ruleset", - Target: Ptr("branch"), - SourceType: Ptr("Organization"), - Source: "o", + Target: Ptr(RulesetTargetBranch), Enforcement: "active", BypassActors: []*BypassActor{ { ActorID: Ptr(int64(234)), - ActorType: Ptr("Team"), + ActorType: Ptr(BypassActorTypeTeam), }, }, - Conditions: &RulesetConditions{ - RefName: &RulesetRefConditionParameters{ + Conditions: &RepositoryRulesetConditions{ + RefName: &RepositoryRulesetRefConditionParameters{ Include: []string{"refs/heads/main", "refs/heads/master"}, Exclude: []string{"refs/heads/dev*"}, }, - RepositoryName: &RulesetRepositoryNamesConditionParameters{ + RepositoryName: &RepositoryRulesetRepositoryNamesConditionParameters{ Include: []string{"important_repository", "another_important_repository"}, Exclude: []string{"unimportant_repository"}, Protected: Ptr(true), }, }, - Rules: []*RepositoryRule{ - NewCreationRule(), - NewUpdateRule(&UpdateAllowsFetchAndMergeRuleParameters{ + Rules: &RepositoryRulesetRules{ + Creation: &EmptyRuleParameters{}, + Update: &UpdateRuleParameters{ UpdateAllowsFetchAndMerge: true, - }), - NewDeletionRule(), - NewRequiredLinearHistoryRule(), - NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ + }, + Deletion: &EmptyRuleParameters{}, + RequiredLinearHistory: &EmptyRuleParameters{}, + RequiredDeployments: &RequiredDeploymentsRuleParameters{ RequiredDeploymentEnvironments: []string{"test"}, - }), - NewRequiredSignaturesRule(), - NewPullRequestRule(&PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, + }, + RequiredSignatures: &EmptyRuleParameters{}, + PullRequest: &PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{MergeMethodRebase, MergeMethodSquash}, DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, RequiredApprovingReviewCount: 1, RequiredReviewThreadResolution: true, - }), - NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ - RequiredStatusChecks: []RuleRequiredStatusChecks{ + }, + RequiredStatusChecks: &RequiredStatusChecksRuleParameters{ + DoNotEnforceOnCreate: Ptr(true), + RequiredStatusChecks: []*RuleStatusCheck{ { Context: "test", IntegrationID: Ptr(int64(1)), }, }, StrictRequiredStatusChecksPolicy: true, - }), - NewNonFastForwardRule(), - NewCommitMessagePatternRule(&RulePatternParameters{ + }, + NonFastForward: &EmptyRuleParameters{}, + CommitMessagePattern: &PatternRuleParameters{ Name: Ptr("avoid test commits"), Negate: Ptr(true), Operator: "starts_with", Pattern: "[test]", - }), - NewCommitAuthorEmailPatternRule(&RulePatternParameters{ + }, + CommitAuthorEmailPattern: &PatternRuleParameters{ Operator: "contains", Pattern: "github", - }), - NewCommitterEmailPatternRule(&RulePatternParameters{ + }, + CommitterEmailPattern: &PatternRuleParameters{ Name: Ptr("avoid commit emails"), Negate: Ptr(true), Operator: "ends_with", Pattern: "abc", - }), - NewBranchNamePatternRule(&RulePatternParameters{ + }, + BranchNamePattern: &PatternRuleParameters{ Name: Ptr("avoid branch names"), Negate: Ptr(true), Operator: "regex", Pattern: "github$", - }), - NewTagNamePatternRule(&RulePatternParameters{ + }, + TagNamePattern: &PatternRuleParameters{ Name: Ptr("avoid tag names"), Negate: Ptr(true), Operator: "contains", Pattern: "github", - }), - NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ - RequiredCodeScanningTools: []*RuleRequiredCodeScanningTool{ + }, + CodeScanning: &CodeScanningRuleParameters{ + CodeScanningTools: []*RuleCodeScanningTool{ { + AlertsThreshold: CodeScanningAlertsThresholdErrors, + SecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdHighOrHigher, Tool: "CodeQL", - SecurityAlertsThreshold: "high_or_higher", - AlertsThreshold: "errors", }, }, - }), + }, }, }) if err != nil { - t.Errorf("Organizations.CreateOrganizationRuleset returned error: %v", err) + t.Errorf("Organizations.CreateRepositoryRuleset returned error: %v", err) } - want := &Ruleset{ + want := &RepositoryRuleset{ ID: Ptr(int64(21)), Name: "ruleset", - Target: Ptr("branch"), - SourceType: Ptr("Organization"), + Target: Ptr(RulesetTargetBranch), + SourceType: Ptr(RulesetSourceTypeOrganization), Source: "o", Enforcement: "active", BypassActors: []*BypassActor{ { ActorID: Ptr(int64(234)), - ActorType: Ptr("Team"), + ActorType: Ptr(BypassActorTypeTeam), }, }, - Conditions: &RulesetConditions{ - RefName: &RulesetRefConditionParameters{ + Conditions: &RepositoryRulesetConditions{ + RefName: &RepositoryRulesetRefConditionParameters{ Include: []string{"refs/heads/main", "refs/heads/master"}, Exclude: []string{"refs/heads/dev*"}, }, - RepositoryName: &RulesetRepositoryNamesConditionParameters{ + RepositoryName: &RepositoryRulesetRepositoryNamesConditionParameters{ Include: []string{"important_repository", "another_important_repository"}, Exclude: []string{"unimportant_repository"}, Protected: Ptr(true), }, }, - Rules: []*RepositoryRule{ - NewCreationRule(), - NewUpdateRule(&UpdateAllowsFetchAndMergeRuleParameters{ + Rules: &RepositoryRulesetRules{ + Creation: &EmptyRuleParameters{}, + Update: &UpdateRuleParameters{ UpdateAllowsFetchAndMerge: true, - }), - NewDeletionRule(), - NewRequiredLinearHistoryRule(), - NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ + }, + Deletion: &EmptyRuleParameters{}, + RequiredLinearHistory: &EmptyRuleParameters{}, + RequiredDeployments: &RequiredDeploymentsRuleParameters{ RequiredDeploymentEnvironments: []string{"test"}, - }), - NewRequiredSignaturesRule(), - NewPullRequestRule(&PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, + }, + RequiredSignatures: &EmptyRuleParameters{}, + PullRequest: &PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{MergeMethodRebase, MergeMethodSquash}, DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, RequiredApprovingReviewCount: 1, RequiredReviewThreadResolution: true, - }), - NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ - RequiredStatusChecks: []RuleRequiredStatusChecks{ + }, + RequiredStatusChecks: &RequiredStatusChecksRuleParameters{ + DoNotEnforceOnCreate: Ptr(true), + RequiredStatusChecks: []*RuleStatusCheck{ { Context: "test", IntegrationID: Ptr(int64(1)), }, }, StrictRequiredStatusChecksPolicy: true, - }), - NewNonFastForwardRule(), - NewCommitMessagePatternRule(&RulePatternParameters{ + }, + NonFastForward: &EmptyRuleParameters{}, + CommitMessagePattern: &PatternRuleParameters{ Name: Ptr("avoid test commits"), Negate: Ptr(true), Operator: "starts_with", Pattern: "[test]", - }), - NewCommitAuthorEmailPatternRule(&RulePatternParameters{ + }, + CommitAuthorEmailPattern: &PatternRuleParameters{ Operator: "contains", Pattern: "github", - }), - NewCommitterEmailPatternRule(&RulePatternParameters{ + }, + CommitterEmailPattern: &PatternRuleParameters{ Name: Ptr("avoid commit emails"), Negate: Ptr(true), Operator: "ends_with", Pattern: "abc", - }), - NewBranchNamePatternRule(&RulePatternParameters{ + }, + BranchNamePattern: &PatternRuleParameters{ Name: Ptr("avoid branch names"), Negate: Ptr(true), Operator: "regex", Pattern: "github$", - }), - NewTagNamePatternRule(&RulePatternParameters{ + }, + TagNamePattern: &PatternRuleParameters{ Name: Ptr("avoid tag names"), Negate: Ptr(true), Operator: "contains", Pattern: "github", - }), - NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ - RequiredCodeScanningTools: []*RuleRequiredCodeScanningTool{ + }, + CodeScanning: &CodeScanningRuleParameters{ + CodeScanningTools: []*RuleCodeScanningTool{ { + AlertsThreshold: CodeScanningAlertsThresholdErrors, + SecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdHighOrHigher, Tool: "CodeQL", - SecurityAlertsThreshold: "high_or_higher", - AlertsThreshold: "errors", }, }, - }), + }, }, } if !cmp.Equal(ruleset, want) { - t.Errorf("Organizations.CreateOrganizationRuleset returned %+v, want %+v", ruleset, want) + t.Errorf("Organizations.CreateRepositoryRuleset returned %+v, want %+v", ruleset, want) } - const methodName = "CreateOrganizationRuleset" + const methodName = "CreateRepositoryRuleset" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Organizations.CreateOrganizationRuleset(ctx, "o", Ruleset{}) + got, resp, err := client.Organizations.CreateRepositoryRuleset(ctx, "o", RepositoryRuleset{}) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -424,7 +424,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) }) } -func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing.T) { +func TestOrganizationsService_CreateRepositoryRuleset_RepoProperty(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -503,6 +503,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing. { "type": "required_status_checks", "parameters": { + "do_not_enforce_on_create": true, "required_status_checks": [ { "context": "test", @@ -575,214 +576,213 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing. }) ctx := context.Background() - ruleset, _, err := client.Organizations.CreateOrganizationRuleset(ctx, "o", Ruleset{ - ID: Ptr(int64(21)), + ruleset, _, err := client.Organizations.CreateRepositoryRuleset(ctx, "o", RepositoryRuleset{ Name: "ruleset", - Target: Ptr("branch"), - SourceType: Ptr("Organization"), - Source: "o", + Target: Ptr(RulesetTargetBranch), Enforcement: "active", BypassActors: []*BypassActor{ { ActorID: Ptr(int64(234)), - ActorType: Ptr("Team"), + ActorType: Ptr(BypassActorTypeTeam), }, }, - Conditions: &RulesetConditions{ - RepositoryProperty: &RulesetRepositoryPropertyConditionParameters{ - Include: []RulesetRepositoryPropertyTargetParameters{ + Conditions: &RepositoryRulesetConditions{ + RepositoryProperty: &RepositoryRulesetRepositoryPropertyConditionParameters{ + Include: []*RepositoryRulesetRepositoryPropertyTargetParameters{ { - Name: "testIncludeProp", - Source: Ptr("custom"), - Values: []string{"true"}, + Name: "testIncludeProp", + Source: Ptr("custom"), + PropertyValues: []string{"true"}, }, }, - Exclude: []RulesetRepositoryPropertyTargetParameters{ + Exclude: []*RepositoryRulesetRepositoryPropertyTargetParameters{ { - Name: "testExcludeProp", - Values: []string{"false"}, + Name: "testExcludeProp", + PropertyValues: []string{"false"}, }, }, }, }, - Rules: []*RepositoryRule{ - NewCreationRule(), - NewUpdateRule(&UpdateAllowsFetchAndMergeRuleParameters{ + Rules: &RepositoryRulesetRules{ + Creation: &EmptyRuleParameters{}, + Update: &UpdateRuleParameters{ UpdateAllowsFetchAndMerge: true, - }), - NewDeletionRule(), - NewRequiredLinearHistoryRule(), - NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ + }, + Deletion: &EmptyRuleParameters{}, + RequiredLinearHistory: &EmptyRuleParameters{}, + RequiredDeployments: &RequiredDeploymentsRuleParameters{ RequiredDeploymentEnvironments: []string{"test"}, - }), - NewRequiredSignaturesRule(), - NewPullRequestRule(&PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, + }, + RequiredSignatures: &EmptyRuleParameters{}, + PullRequest: &PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{MergeMethodRebase, MergeMethodSquash}, DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, RequiredApprovingReviewCount: 1, RequiredReviewThreadResolution: true, - }), - NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ - RequiredStatusChecks: []RuleRequiredStatusChecks{ + }, + RequiredStatusChecks: &RequiredStatusChecksRuleParameters{ + DoNotEnforceOnCreate: Ptr(true), + RequiredStatusChecks: []*RuleStatusCheck{ { Context: "test", IntegrationID: Ptr(int64(1)), }, }, StrictRequiredStatusChecksPolicy: true, - }), - NewNonFastForwardRule(), - NewCommitMessagePatternRule(&RulePatternParameters{ + }, + NonFastForward: &EmptyRuleParameters{}, + CommitMessagePattern: &PatternRuleParameters{ Name: Ptr("avoid test commits"), Negate: Ptr(true), Operator: "starts_with", Pattern: "[test]", - }), - NewCommitAuthorEmailPatternRule(&RulePatternParameters{ + }, + CommitAuthorEmailPattern: &PatternRuleParameters{ Operator: "contains", Pattern: "github", - }), - NewCommitterEmailPatternRule(&RulePatternParameters{ + }, + CommitterEmailPattern: &PatternRuleParameters{ Name: Ptr("avoid commit emails"), Negate: Ptr(true), Operator: "ends_with", Pattern: "abc", - }), - NewBranchNamePatternRule(&RulePatternParameters{ + }, + BranchNamePattern: &PatternRuleParameters{ Name: Ptr("avoid branch names"), Negate: Ptr(true), Operator: "regex", Pattern: "github$", - }), - NewTagNamePatternRule(&RulePatternParameters{ + }, + TagNamePattern: &PatternRuleParameters{ Name: Ptr("avoid tag names"), Negate: Ptr(true), Operator: "contains", Pattern: "github", - }), - NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ - RequiredCodeScanningTools: []*RuleRequiredCodeScanningTool{ + }, + CodeScanning: &CodeScanningRuleParameters{ + CodeScanningTools: []*RuleCodeScanningTool{ { + AlertsThreshold: CodeScanningAlertsThresholdErrors, + SecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdHighOrHigher, Tool: "CodeQL", - SecurityAlertsThreshold: "high_or_higher", - AlertsThreshold: "errors", }, }, - }), + }, }, }) if err != nil { - t.Errorf("Organizations.CreateOrganizationRuleset returned error: %v", err) + t.Errorf("Organizations.CreateRepositoryRuleset returned error: %v", err) } - want := &Ruleset{ + want := &RepositoryRuleset{ ID: Ptr(int64(21)), Name: "ruleset", - Target: Ptr("branch"), - SourceType: Ptr("Organization"), + Target: Ptr(RulesetTargetBranch), + SourceType: Ptr(RulesetSourceTypeOrganization), Source: "o", Enforcement: "active", BypassActors: []*BypassActor{ { ActorID: Ptr(int64(234)), - ActorType: Ptr("Team"), + ActorType: Ptr(BypassActorTypeTeam), }, }, - Conditions: &RulesetConditions{ - RepositoryProperty: &RulesetRepositoryPropertyConditionParameters{ - Include: []RulesetRepositoryPropertyTargetParameters{ + Conditions: &RepositoryRulesetConditions{ + RepositoryProperty: &RepositoryRulesetRepositoryPropertyConditionParameters{ + Include: []*RepositoryRulesetRepositoryPropertyTargetParameters{ { - Name: "testIncludeProp", - Source: Ptr("custom"), - Values: []string{"true"}, + Name: "testIncludeProp", + Source: Ptr("custom"), + PropertyValues: []string{"true"}, }, }, - Exclude: []RulesetRepositoryPropertyTargetParameters{ + Exclude: []*RepositoryRulesetRepositoryPropertyTargetParameters{ { - Name: "testExcludeProp", - Values: []string{"false"}, + Name: "testExcludeProp", + PropertyValues: []string{"false"}, }, }, }, }, - Rules: []*RepositoryRule{ - NewCreationRule(), - NewUpdateRule(&UpdateAllowsFetchAndMergeRuleParameters{ + Rules: &RepositoryRulesetRules{ + Creation: &EmptyRuleParameters{}, + Update: &UpdateRuleParameters{ UpdateAllowsFetchAndMerge: true, - }), - NewDeletionRule(), - NewRequiredLinearHistoryRule(), - NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ + }, + Deletion: &EmptyRuleParameters{}, + RequiredLinearHistory: &EmptyRuleParameters{}, + RequiredDeployments: &RequiredDeploymentsRuleParameters{ RequiredDeploymentEnvironments: []string{"test"}, - }), - NewRequiredSignaturesRule(), - NewPullRequestRule(&PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, + }, + RequiredSignatures: &EmptyRuleParameters{}, + PullRequest: &PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{MergeMethodRebase, MergeMethodSquash}, DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, RequiredApprovingReviewCount: 1, RequiredReviewThreadResolution: true, - }), - NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ - RequiredStatusChecks: []RuleRequiredStatusChecks{ + }, + RequiredStatusChecks: &RequiredStatusChecksRuleParameters{ + DoNotEnforceOnCreate: Ptr(true), + RequiredStatusChecks: []*RuleStatusCheck{ { Context: "test", IntegrationID: Ptr(int64(1)), }, }, StrictRequiredStatusChecksPolicy: true, - }), - NewNonFastForwardRule(), - NewCommitMessagePatternRule(&RulePatternParameters{ + }, + NonFastForward: &EmptyRuleParameters{}, + CommitMessagePattern: &PatternRuleParameters{ Name: Ptr("avoid test commits"), Negate: Ptr(true), Operator: "starts_with", Pattern: "[test]", - }), - NewCommitAuthorEmailPatternRule(&RulePatternParameters{ + }, + CommitAuthorEmailPattern: &PatternRuleParameters{ Operator: "contains", Pattern: "github", - }), - NewCommitterEmailPatternRule(&RulePatternParameters{ + }, + CommitterEmailPattern: &PatternRuleParameters{ Name: Ptr("avoid commit emails"), Negate: Ptr(true), Operator: "ends_with", Pattern: "abc", - }), - NewBranchNamePatternRule(&RulePatternParameters{ + }, + BranchNamePattern: &PatternRuleParameters{ Name: Ptr("avoid branch names"), Negate: Ptr(true), Operator: "regex", Pattern: "github$", - }), - NewTagNamePatternRule(&RulePatternParameters{ + }, + TagNamePattern: &PatternRuleParameters{ Name: Ptr("avoid tag names"), Negate: Ptr(true), Operator: "contains", Pattern: "github", - }), - NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ - RequiredCodeScanningTools: []*RuleRequiredCodeScanningTool{ + }, + CodeScanning: &CodeScanningRuleParameters{ + CodeScanningTools: []*RuleCodeScanningTool{ { + AlertsThreshold: CodeScanningAlertsThresholdErrors, + SecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdHighOrHigher, Tool: "CodeQL", - SecurityAlertsThreshold: "high_or_higher", - AlertsThreshold: "errors", }, }, - }), + }, }, } if !cmp.Equal(ruleset, want) { - t.Errorf("Organizations.CreateOrganizationRuleset returned %+v, want %+v", ruleset, want) + t.Errorf("Organizations.CreateRepositoryRuleset returned %+v, want %+v", ruleset, want) } - const methodName = "CreateOrganizationRuleset" + const methodName = "CreateRepositoryRuleset" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Organizations.CreateOrganizationRuleset(ctx, "o", Ruleset{}) + got, resp, err := client.Organizations.CreateRepositoryRuleset(ctx, "o", RepositoryRuleset{}) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -790,7 +790,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing. }) } -func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { +func TestOrganizationsService_CreateRepositoryRuleset_RepoIDs(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -862,6 +862,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { { "type": "required_status_checks", "parameters": { + "do_not_enforce_on_create": true, "required_status_checks": [ { "context": "test", @@ -934,198 +935,197 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { }) ctx := context.Background() - ruleset, _, err := client.Organizations.CreateOrganizationRuleset(ctx, "o", Ruleset{ - ID: Ptr(int64(21)), + ruleset, _, err := client.Organizations.CreateRepositoryRuleset(ctx, "o", RepositoryRuleset{ Name: "ruleset", - Target: Ptr("branch"), - SourceType: Ptr("Organization"), - Source: "o", + Target: Ptr(RulesetTargetBranch), Enforcement: "active", BypassActors: []*BypassActor{ { ActorID: Ptr(int64(234)), - ActorType: Ptr("Team"), + ActorType: Ptr(BypassActorTypeTeam), }, }, - Conditions: &RulesetConditions{ - RefName: &RulesetRefConditionParameters{ + Conditions: &RepositoryRulesetConditions{ + RefName: &RepositoryRulesetRefConditionParameters{ Include: []string{"refs/heads/main", "refs/heads/master"}, Exclude: []string{"refs/heads/dev*"}, }, - RepositoryID: &RulesetRepositoryIDsConditionParameters{ + RepositoryID: &RepositoryRulesetRepositoryIDsConditionParameters{ RepositoryIDs: []int64{123, 456}, }, }, - Rules: []*RepositoryRule{ - NewCreationRule(), - NewUpdateRule(&UpdateAllowsFetchAndMergeRuleParameters{ + Rules: &RepositoryRulesetRules{ + Creation: &EmptyRuleParameters{}, + Update: &UpdateRuleParameters{ UpdateAllowsFetchAndMerge: true, - }), - NewDeletionRule(), - NewRequiredLinearHistoryRule(), - NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ + }, + Deletion: &EmptyRuleParameters{}, + RequiredLinearHistory: &EmptyRuleParameters{}, + RequiredDeployments: &RequiredDeploymentsRuleParameters{ RequiredDeploymentEnvironments: []string{"test"}, - }), - NewRequiredSignaturesRule(), - NewPullRequestRule(&PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, + }, + RequiredSignatures: &EmptyRuleParameters{}, + PullRequest: &PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{MergeMethodRebase, MergeMethodSquash}, DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, RequiredApprovingReviewCount: 1, RequiredReviewThreadResolution: true, - }), - NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ - RequiredStatusChecks: []RuleRequiredStatusChecks{ + }, + RequiredStatusChecks: &RequiredStatusChecksRuleParameters{ + DoNotEnforceOnCreate: Ptr(true), + RequiredStatusChecks: []*RuleStatusCheck{ { Context: "test", IntegrationID: Ptr(int64(1)), }, }, StrictRequiredStatusChecksPolicy: true, - }), - NewNonFastForwardRule(), - NewCommitMessagePatternRule(&RulePatternParameters{ + }, + NonFastForward: &EmptyRuleParameters{}, + CommitMessagePattern: &PatternRuleParameters{ Name: Ptr("avoid test commits"), Negate: Ptr(true), Operator: "starts_with", Pattern: "[test]", - }), - NewCommitAuthorEmailPatternRule(&RulePatternParameters{ + }, + CommitAuthorEmailPattern: &PatternRuleParameters{ Operator: "contains", Pattern: "github", - }), - NewCommitterEmailPatternRule(&RulePatternParameters{ + }, + CommitterEmailPattern: &PatternRuleParameters{ Name: Ptr("avoid commit emails"), Negate: Ptr(true), Operator: "ends_with", Pattern: "abc", - }), - NewBranchNamePatternRule(&RulePatternParameters{ + }, + BranchNamePattern: &PatternRuleParameters{ Name: Ptr("avoid branch names"), Negate: Ptr(true), Operator: "regex", Pattern: "github$", - }), - NewTagNamePatternRule(&RulePatternParameters{ + }, + TagNamePattern: &PatternRuleParameters{ Name: Ptr("avoid tag names"), Negate: Ptr(true), Operator: "contains", Pattern: "github", - }), - NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ - RequiredCodeScanningTools: []*RuleRequiredCodeScanningTool{ + }, + CodeScanning: &CodeScanningRuleParameters{ + CodeScanningTools: []*RuleCodeScanningTool{ { + AlertsThreshold: CodeScanningAlertsThresholdErrors, + SecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdHighOrHigher, Tool: "CodeQL", - SecurityAlertsThreshold: "high_or_higher", - AlertsThreshold: "errors", }, }, - }), + }, }, }) if err != nil { - t.Errorf("Organizations.CreateOrganizationRuleset returned error: %v", err) + t.Errorf("Organizations.CreateRepositoryRuleset returned error: %v", err) } - want := &Ruleset{ + want := &RepositoryRuleset{ ID: Ptr(int64(21)), Name: "ruleset", - Target: Ptr("branch"), - SourceType: Ptr("Organization"), + Target: Ptr(RulesetTargetBranch), + SourceType: Ptr(RulesetSourceTypeOrganization), Source: "o", Enforcement: "active", BypassActors: []*BypassActor{ { ActorID: Ptr(int64(234)), - ActorType: Ptr("Team"), + ActorType: Ptr(BypassActorTypeTeam), }, }, - Conditions: &RulesetConditions{ - RefName: &RulesetRefConditionParameters{ + Conditions: &RepositoryRulesetConditions{ + RefName: &RepositoryRulesetRefConditionParameters{ Include: []string{"refs/heads/main", "refs/heads/master"}, Exclude: []string{"refs/heads/dev*"}, }, - RepositoryID: &RulesetRepositoryIDsConditionParameters{ + RepositoryID: &RepositoryRulesetRepositoryIDsConditionParameters{ RepositoryIDs: []int64{123, 456}, }, }, - Rules: []*RepositoryRule{ - NewCreationRule(), - NewUpdateRule(&UpdateAllowsFetchAndMergeRuleParameters{ + Rules: &RepositoryRulesetRules{ + Creation: &EmptyRuleParameters{}, + Update: &UpdateRuleParameters{ UpdateAllowsFetchAndMerge: true, - }), - NewDeletionRule(), - NewRequiredLinearHistoryRule(), - NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ + }, + Deletion: &EmptyRuleParameters{}, + RequiredLinearHistory: &EmptyRuleParameters{}, + RequiredDeployments: &RequiredDeploymentsRuleParameters{ RequiredDeploymentEnvironments: []string{"test"}, - }), - NewRequiredSignaturesRule(), - NewPullRequestRule(&PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, + }, + RequiredSignatures: &EmptyRuleParameters{}, + PullRequest: &PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{MergeMethodRebase, MergeMethodSquash}, DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, RequiredApprovingReviewCount: 1, RequiredReviewThreadResolution: true, - }), - NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ - RequiredStatusChecks: []RuleRequiredStatusChecks{ + }, + RequiredStatusChecks: &RequiredStatusChecksRuleParameters{ + DoNotEnforceOnCreate: Ptr(true), + RequiredStatusChecks: []*RuleStatusCheck{ { Context: "test", IntegrationID: Ptr(int64(1)), }, }, StrictRequiredStatusChecksPolicy: true, - }), - NewNonFastForwardRule(), - NewCommitMessagePatternRule(&RulePatternParameters{ + }, + NonFastForward: &EmptyRuleParameters{}, + CommitMessagePattern: &PatternRuleParameters{ Name: Ptr("avoid test commits"), Negate: Ptr(true), Operator: "starts_with", Pattern: "[test]", - }), - NewCommitAuthorEmailPatternRule(&RulePatternParameters{ + }, + CommitAuthorEmailPattern: &PatternRuleParameters{ Operator: "contains", Pattern: "github", - }), - NewCommitterEmailPatternRule(&RulePatternParameters{ + }, + CommitterEmailPattern: &PatternRuleParameters{ Name: Ptr("avoid commit emails"), Negate: Ptr(true), Operator: "ends_with", Pattern: "abc", - }), - NewBranchNamePatternRule(&RulePatternParameters{ + }, + BranchNamePattern: &PatternRuleParameters{ Name: Ptr("avoid branch names"), Negate: Ptr(true), Operator: "regex", Pattern: "github$", - }), - NewTagNamePatternRule(&RulePatternParameters{ + }, + TagNamePattern: &PatternRuleParameters{ Name: Ptr("avoid tag names"), Negate: Ptr(true), Operator: "contains", Pattern: "github", - }), - NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ - RequiredCodeScanningTools: []*RuleRequiredCodeScanningTool{ + }, + CodeScanning: &CodeScanningRuleParameters{ + CodeScanningTools: []*RuleCodeScanningTool{ { + AlertsThreshold: CodeScanningAlertsThresholdErrors, + SecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdHighOrHigher, Tool: "CodeQL", - SecurityAlertsThreshold: "high_or_higher", - AlertsThreshold: "errors", }, }, - }), + }, }, } if !cmp.Equal(ruleset, want) { - t.Errorf("Organizations.CreateOrganizationRuleset returned %+v, want %+v", ruleset, want) + t.Errorf("Organizations.CreateRepositoryRuleset returned %+v, want %+v", ruleset, want) } - const methodName = "CreateOrganizationRuleset" + const methodName = "CreateRepositoryRuleset" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Organizations.CreateOrganizationRuleset(ctx, "o", Ruleset{}) + got, resp, err := client.Organizations.CreateRepositoryRuleset(ctx, "o", RepositoryRuleset{}) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -1133,14 +1133,14 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { }) } -func TestOrganizationsService_GetOrganizationRuleset(t *testing.T) { +func TestOrganizationsService_GetRepositoryRuleset(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/rulesets/26110", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/rulesets/21", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `{ - "id": 26110, + "id": 21, "name": "test ruleset", "target": "branch", "source_type": "Organization", @@ -1150,7 +1150,7 @@ func TestOrganizationsService_GetOrganizationRuleset(t *testing.T) { "node_id": "nid", "_links": { "self": { - "href": "https://api.github.com/orgs/o/rulesets/26110" + "href": "https://api.github.com/orgs/o/rulesets/21" } }, "conditions": { @@ -1183,45 +1183,43 @@ func TestOrganizationsService_GetOrganizationRuleset(t *testing.T) { }) ctx := context.Background() - rulesets, _, err := client.Organizations.GetOrganizationRuleset(ctx, "o", 26110) + rulesets, _, err := client.Organizations.GetRepositoryRuleset(ctx, "o", 21) if err != nil { t.Errorf("Organizations.GetOrganizationRepositoryRuleset returned error: %v", err) } - want := &Ruleset{ - ID: Ptr(int64(26110)), + want := &RepositoryRuleset{ + ID: Ptr(int64(21)), Name: "test ruleset", - Target: Ptr("branch"), - SourceType: Ptr("Organization"), + Target: Ptr(RulesetTargetBranch), + SourceType: Ptr(RulesetSourceTypeOrganization), Source: "o", Enforcement: "active", NodeID: Ptr("nid"), - Links: &RulesetLinks{ - Self: &RulesetLink{HRef: Ptr("https://api.github.com/orgs/o/rulesets/26110")}, + Links: &RepositoryRulesetLinks{ + Self: &RepositoryRulesetLink{HRef: Ptr("https://api.github.com/orgs/o/rulesets/21")}, }, - Conditions: &RulesetConditions{ - RefName: &RulesetRefConditionParameters{ + Conditions: &RepositoryRulesetConditions{ + RefName: &RepositoryRulesetRefConditionParameters{ Include: []string{"refs/heads/main", "refs/heads/master"}, Exclude: []string{"refs/heads/dev*"}, }, - RepositoryName: &RulesetRepositoryNamesConditionParameters{ + RepositoryName: &RepositoryRulesetRepositoryNamesConditionParameters{ Include: []string{"important_repository", "another_important_repository"}, Exclude: []string{"unimportant_repository"}, Protected: Ptr(true), }, }, - Rules: []*RepositoryRule{ - NewCreationRule(), - }, + Rules: &RepositoryRulesetRules{Creation: &EmptyRuleParameters{}}, } if !cmp.Equal(rulesets, want) { - t.Errorf("Organizations.GetOrganizationRuleset returned %+v, want %+v", rulesets, want) + t.Errorf("Organizations.GetRepositoryRuleset returned %+v, want %+v", rulesets, want) } - const methodName = "GetOrganizationRuleset" + const methodName = "GetRepositoryRuleset" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Organizations.GetOrganizationRuleset(ctx, "o", 26110) + got, resp, err := client.Organizations.GetRepositoryRuleset(ctx, "o", 21) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -1229,14 +1227,14 @@ func TestOrganizationsService_GetOrganizationRuleset(t *testing.T) { }) } -func TestOrganizationsService_GetOrganizationRulesetWithRepoPropCondition(t *testing.T) { +func TestOrganizationsService_GetRepositoryRulesetWithRepoPropCondition(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/rulesets/26110", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/rulesets/21", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `{ - "id": 26110, + "id": 21, "name": "test ruleset", "target": "branch", "source_type": "Organization", @@ -1246,7 +1244,7 @@ func TestOrganizationsService_GetOrganizationRulesetWithRepoPropCondition(t *tes "node_id": "nid", "_links": { "self": { - "href": "https://api.github.com/orgs/o/rulesets/26110" + "href": "https://api.github.com/orgs/o/rulesets/21" } }, "conditions": { @@ -1272,46 +1270,44 @@ func TestOrganizationsService_GetOrganizationRulesetWithRepoPropCondition(t *tes }) ctx := context.Background() - rulesets, _, err := client.Organizations.GetOrganizationRuleset(ctx, "o", 26110) + rulesets, _, err := client.Organizations.GetRepositoryRuleset(ctx, "o", 21) if err != nil { t.Errorf("Organizations.GetOrganizationRepositoryRuleset returned error: %v", err) } - want := &Ruleset{ - ID: Ptr(int64(26110)), + want := &RepositoryRuleset{ + ID: Ptr(int64(21)), Name: "test ruleset", - Target: Ptr("branch"), - SourceType: Ptr("Organization"), + Target: Ptr(RulesetTargetBranch), + SourceType: Ptr(RulesetSourceTypeOrganization), Source: "o", Enforcement: "active", NodeID: Ptr("nid"), - Links: &RulesetLinks{ - Self: &RulesetLink{HRef: Ptr("https://api.github.com/orgs/o/rulesets/26110")}, + Links: &RepositoryRulesetLinks{ + Self: &RepositoryRulesetLink{HRef: Ptr("https://api.github.com/orgs/o/rulesets/21")}, }, - Conditions: &RulesetConditions{ - RepositoryProperty: &RulesetRepositoryPropertyConditionParameters{ - Include: []RulesetRepositoryPropertyTargetParameters{ + Conditions: &RepositoryRulesetConditions{ + RepositoryProperty: &RepositoryRulesetRepositoryPropertyConditionParameters{ + Include: []*RepositoryRulesetRepositoryPropertyTargetParameters{ { - Name: "testIncludeProp", - Source: Ptr("custom"), - Values: []string{"true"}, + Name: "testIncludeProp", + Source: Ptr("custom"), + PropertyValues: []string{"true"}, }, }, - Exclude: []RulesetRepositoryPropertyTargetParameters{}, + Exclude: []*RepositoryRulesetRepositoryPropertyTargetParameters{}, }, }, - Rules: []*RepositoryRule{ - NewCreationRule(), - }, + Rules: &RepositoryRulesetRules{Creation: &EmptyRuleParameters{}}, } if !cmp.Equal(rulesets, want) { - t.Errorf("Organizations.GetOrganizationRuleset returned %+v, want %+v", rulesets, want) + t.Errorf("Organizations.GetRepositoryRuleset returned %+v, want %+v", rulesets, want) } - const methodName = "GetOrganizationRuleset" + const methodName = "GetRepositoryRuleset" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Organizations.GetOrganizationRuleset(ctx, "o", 26110) + got, resp, err := client.Organizations.GetRepositoryRuleset(ctx, "o", 21) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -1319,14 +1315,14 @@ func TestOrganizationsService_GetOrganizationRulesetWithRepoPropCondition(t *tes }) } -func TestOrganizationsService_UpdateOrganizationRuleset(t *testing.T) { +func TestOrganizationsService_UpdateRepositoryRuleset(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/rulesets/26110", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/rulesets/21", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") fmt.Fprint(w, `{ - "id": 26110, + "id": 21, "name": "test ruleset", "target": "branch", "source_type": "Organization", @@ -1336,7 +1332,7 @@ func TestOrganizationsService_UpdateOrganizationRuleset(t *testing.T) { "node_id": "nid", "_links": { "self": { - "href": "https://api.github.com/orgs/o/rulesets/26110" + "href": "https://api.github.com/orgs/o/rulesets/21" } }, "conditions": { @@ -1369,63 +1365,59 @@ func TestOrganizationsService_UpdateOrganizationRuleset(t *testing.T) { }) ctx := context.Background() - rulesets, _, err := client.Organizations.UpdateOrganizationRuleset(ctx, "o", 26110, Ruleset{ + rulesets, _, err := client.Organizations.UpdateRepositoryRuleset(ctx, "o", 21, RepositoryRuleset{ Name: "test ruleset", - Target: Ptr("branch"), + Target: Ptr(RulesetTargetBranch), Enforcement: "active", - Conditions: &RulesetConditions{ - RefName: &RulesetRefConditionParameters{ + Conditions: &RepositoryRulesetConditions{ + RefName: &RepositoryRulesetRefConditionParameters{ Include: []string{"refs/heads/main", "refs/heads/master"}, Exclude: []string{"refs/heads/dev*"}, }, - RepositoryName: &RulesetRepositoryNamesConditionParameters{ + RepositoryName: &RepositoryRulesetRepositoryNamesConditionParameters{ Include: []string{"important_repository", "another_important_repository"}, Exclude: []string{"unimportant_repository"}, Protected: Ptr(true), }, }, - Rules: []*RepositoryRule{ - NewCreationRule(), - }, + Rules: &RepositoryRulesetRules{Creation: &EmptyRuleParameters{}}, }) if err != nil { - t.Errorf("Organizations.UpdateOrganizationRuleset returned error: %v", err) + t.Errorf("Organizations.UpdateRepositoryRuleset returned error: %v", err) } - want := &Ruleset{ - ID: Ptr(int64(26110)), + want := &RepositoryRuleset{ + ID: Ptr(int64(21)), Name: "test ruleset", - Target: Ptr("branch"), - SourceType: Ptr("Organization"), + Target: Ptr(RulesetTargetBranch), + SourceType: Ptr(RulesetSourceTypeOrganization), Source: "o", Enforcement: "active", NodeID: Ptr("nid"), - Links: &RulesetLinks{ - Self: &RulesetLink{HRef: Ptr("https://api.github.com/orgs/o/rulesets/26110")}, + Links: &RepositoryRulesetLinks{ + Self: &RepositoryRulesetLink{HRef: Ptr("https://api.github.com/orgs/o/rulesets/21")}, }, - Conditions: &RulesetConditions{ - RefName: &RulesetRefConditionParameters{ + Conditions: &RepositoryRulesetConditions{ + RefName: &RepositoryRulesetRefConditionParameters{ Include: []string{"refs/heads/main", "refs/heads/master"}, Exclude: []string{"refs/heads/dev*"}, }, - RepositoryName: &RulesetRepositoryNamesConditionParameters{ + RepositoryName: &RepositoryRulesetRepositoryNamesConditionParameters{ Include: []string{"important_repository", "another_important_repository"}, Exclude: []string{"unimportant_repository"}, Protected: Ptr(true), }, }, - Rules: []*RepositoryRule{ - NewCreationRule(), - }, + Rules: &RepositoryRulesetRules{Creation: &EmptyRuleParameters{}}, } if !cmp.Equal(rulesets, want) { - t.Errorf("Organizations.UpdateOrganizationRuleset returned %+v, want %+v", rulesets, want) + t.Errorf("Organizations.UpdateRepositoryRuleset returned %+v, want %+v", rulesets, want) } - const methodName = "UpdateOrganizationRuleset" + const methodName = "UpdateRepositoryRuleset" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Organizations.UpdateOrganizationRuleset(ctx, "o", 26110, Ruleset{}) + got, resp, err := client.Organizations.UpdateRepositoryRuleset(ctx, "o", 21, RepositoryRuleset{}) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -1433,14 +1425,14 @@ func TestOrganizationsService_UpdateOrganizationRuleset(t *testing.T) { }) } -func TestOrganizationsService_UpdateOrganizationRulesetWithRepoProp(t *testing.T) { +func TestOrganizationsService_UpdateRepositoryRulesetWithRepoProp(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/rulesets/26110", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/rulesets/21", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") fmt.Fprint(w, `{ - "id": 26110, + "id": 21, "name": "test ruleset", "target": "branch", "source_type": "Organization", @@ -1450,7 +1442,7 @@ func TestOrganizationsService_UpdateOrganizationRulesetWithRepoProp(t *testing.T "node_id": "nid", "_links": { "self": { - "href": "https://api.github.com/orgs/o/rulesets/26110" + "href": "https://api.github.com/orgs/o/rulesets/21" } }, "conditions": { @@ -1476,65 +1468,61 @@ func TestOrganizationsService_UpdateOrganizationRulesetWithRepoProp(t *testing.T }) ctx := context.Background() - rulesets, _, err := client.Organizations.UpdateOrganizationRuleset(ctx, "o", 26110, Ruleset{ + rulesets, _, err := client.Organizations.UpdateRepositoryRuleset(ctx, "o", 21, RepositoryRuleset{ Name: "test ruleset", - Target: Ptr("branch"), + Target: Ptr(RulesetTargetBranch), Enforcement: "active", - Conditions: &RulesetConditions{ - RepositoryProperty: &RulesetRepositoryPropertyConditionParameters{ - Include: []RulesetRepositoryPropertyTargetParameters{ + Conditions: &RepositoryRulesetConditions{ + RepositoryProperty: &RepositoryRulesetRepositoryPropertyConditionParameters{ + Include: []*RepositoryRulesetRepositoryPropertyTargetParameters{ { - Name: "testIncludeProp", - Source: Ptr("custom"), - Values: []string{"true"}, + Name: "testIncludeProp", + Source: Ptr("custom"), + PropertyValues: []string{"true"}, }, }, - Exclude: []RulesetRepositoryPropertyTargetParameters{}, + Exclude: []*RepositoryRulesetRepositoryPropertyTargetParameters{}, }, }, - Rules: []*RepositoryRule{ - NewCreationRule(), - }, + Rules: &RepositoryRulesetRules{Creation: &EmptyRuleParameters{}}, }) if err != nil { - t.Errorf("Organizations.UpdateOrganizationRuleset returned error: %v", err) + t.Errorf("Organizations.UpdateRepositoryRuleset returned error: %v", err) } - want := &Ruleset{ - ID: Ptr(int64(26110)), + want := &RepositoryRuleset{ + ID: Ptr(int64(21)), Name: "test ruleset", - Target: Ptr("branch"), - SourceType: Ptr("Organization"), + Target: Ptr(RulesetTargetBranch), + SourceType: Ptr(RulesetSourceTypeOrganization), Source: "o", Enforcement: "active", NodeID: Ptr("nid"), - Links: &RulesetLinks{ - Self: &RulesetLink{HRef: Ptr("https://api.github.com/orgs/o/rulesets/26110")}, + Links: &RepositoryRulesetLinks{ + Self: &RepositoryRulesetLink{HRef: Ptr("https://api.github.com/orgs/o/rulesets/21")}, }, - Conditions: &RulesetConditions{ - RepositoryProperty: &RulesetRepositoryPropertyConditionParameters{ - Include: []RulesetRepositoryPropertyTargetParameters{ + Conditions: &RepositoryRulesetConditions{ + RepositoryProperty: &RepositoryRulesetRepositoryPropertyConditionParameters{ + Include: []*RepositoryRulesetRepositoryPropertyTargetParameters{ { - Name: "testIncludeProp", - Source: Ptr("custom"), - Values: []string{"true"}, + Name: "testIncludeProp", + Source: Ptr("custom"), + PropertyValues: []string{"true"}, }, }, - Exclude: []RulesetRepositoryPropertyTargetParameters{}, + Exclude: []*RepositoryRulesetRepositoryPropertyTargetParameters{}, }, }, - Rules: []*RepositoryRule{ - NewCreationRule(), - }, + Rules: &RepositoryRulesetRules{Creation: &EmptyRuleParameters{}}, } if !cmp.Equal(rulesets, want) { - t.Errorf("Organizations.UpdateOrganizationRuleset returned %+v, want %+v", rulesets, want) + t.Errorf("Organizations.UpdateRepositoryRuleset returned %+v, want %+v", rulesets, want) } - const methodName = "UpdateOrganizationRuleset" + const methodName = "UpdateRepositoryRuleset" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Organizations.UpdateOrganizationRuleset(ctx, "o", 26110, Ruleset{}) + got, resp, err := client.Organizations.UpdateRepositoryRuleset(ctx, "o", 21, RepositoryRuleset{}) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -1542,14 +1530,14 @@ func TestOrganizationsService_UpdateOrganizationRulesetWithRepoProp(t *testing.T }) } -func TestOrganizationsService_UpdateOrganizationRulesetClearBypassActor(t *testing.T) { +func TestOrganizationsService_UpdateRepositoryRulesetClearBypassActor(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/rulesets/26110", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/rulesets/21", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") fmt.Fprint(w, `{ - "id": 26110, + "id": 21, "name": "test ruleset", "target": "branch", "source_type": "Organization", @@ -1587,35 +1575,35 @@ func TestOrganizationsService_UpdateOrganizationRulesetClearBypassActor(t *testi ctx := context.Background() - _, err := client.Organizations.UpdateOrganizationRulesetClearBypassActor(ctx, "o", 26110) + _, err := client.Organizations.UpdateRepositoryRulesetClearBypassActor(ctx, "o", 21) if err != nil { - t.Errorf("Organizations.UpdateOrganizationRulesetClearBypassActor returned error: %v \n", err) + t.Errorf("Organizations.UpdateRepositoryRulesetClearBypassActor returned error: %v \n", err) } - const methodName = "UpdateOrganizationRulesetClearBypassActor" + const methodName = "UpdateRepositoryRulesetClearBypassActor" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Organizations.UpdateOrganizationRulesetClearBypassActor(ctx, "o", 26110) + return client.Organizations.UpdateRepositoryRulesetClearBypassActor(ctx, "o", 21) }) } -func TestOrganizationsService_DeleteOrganizationRuleset(t *testing.T) { +func TestOrganizationsService_DeleteRepositoryRuleset(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/rulesets/26110", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/rulesets/21", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) ctx := context.Background() - _, err := client.Organizations.DeleteOrganizationRuleset(ctx, "o", 26110) + _, err := client.Organizations.DeleteRepositoryRuleset(ctx, "o", 21) if err != nil { - t.Errorf("Organizations.DeleteOrganizationRuleset returned error: %v", err) + t.Errorf("Organizations.DeleteRepositoryRuleset returned error: %v", err) } - const methodName = "DeleteOrganizationRuleset" + const methodName = "DeleteRepositoryRuleset" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Organizations.DeleteOrganizationRuleset(ctx, "0", 26110) + return client.Organizations.DeleteRepositoryRuleset(ctx, "0", 21) }) } diff --git a/github/repos_rules.go b/github/repos_rules.go index 571a789fef4..d38e35cdd77 100644 --- a/github/repos_rules.go +++ b/github/repos_rules.go @@ -7,845 +7,25 @@ package github import ( "context" - "encoding/json" "fmt" ) -// MergeMethod models a GitHub merge method. -type MergeMethod string - -// This is the set of GitHub merge methods. -const ( - MergeMethodMerge MergeMethod = "merge" - MergeMethodRebase MergeMethod = "rebase" - MergeMethodSquash MergeMethod = "squash" -) - -// BypassActor represents the bypass actors from a ruleset. -type BypassActor struct { - ActorID *int64 `json:"actor_id,omitempty"` - // Possible values for ActorType are: RepositoryRole, Team, Integration, OrganizationAdmin - ActorType *string `json:"actor_type,omitempty"` - // Possible values for BypassMode are: always, pull_request - BypassMode *string `json:"bypass_mode,omitempty"` -} - -// RulesetLink represents a single link object from GitHub ruleset request _links. -type RulesetLink struct { - HRef *string `json:"href,omitempty"` -} - -// RulesetLinks represents the "_links" object in a Ruleset. -type RulesetLinks struct { - Self *RulesetLink `json:"self,omitempty"` -} - -// RulesetRefConditionParameters represents the conditions object for ref_names. -type RulesetRefConditionParameters struct { - Include []string `json:"include"` - Exclude []string `json:"exclude"` -} - -// RulesetRepositoryNamesConditionParameters represents the conditions object for repository_name. -type RulesetRepositoryNamesConditionParameters struct { - Include []string `json:"include"` - Exclude []string `json:"exclude"` - Protected *bool `json:"protected,omitempty"` -} - -// RulesetRepositoryIDsConditionParameters represents the conditions object for repository_id. -type RulesetRepositoryIDsConditionParameters struct { - RepositoryIDs []int64 `json:"repository_ids,omitempty"` -} - -// RulesetRepositoryPropertyTargetParameters represents a repository_property name and values to be used for targeting. -type RulesetRepositoryPropertyTargetParameters struct { - Name string `json:"name"` - Values []string `json:"property_values"` - Source *string `json:"source,omitempty"` -} - -// RulesetRepositoryPropertyConditionParameters represents the conditions object for repository_property. -type RulesetRepositoryPropertyConditionParameters struct { - Include []RulesetRepositoryPropertyTargetParameters `json:"include"` - Exclude []RulesetRepositoryPropertyTargetParameters `json:"exclude"` -} - -// RulesetOrganizationNamesConditionParameters represents the conditions object for organization_name. -type RulesetOrganizationNamesConditionParameters struct { - Include []string `json:"include"` - Exclude []string `json:"exclude"` -} - -// RulesetOrganizationIDsConditionParameters represents the conditions object for organization_id. -type RulesetOrganizationIDsConditionParameters struct { - OrganizationIDs []int64 `json:"organization_ids,omitempty"` -} - -// RulesetConditions represents the conditions object in a ruleset. -// Set either RepositoryName or RepositoryID or RepositoryProperty, not more than one. -type RulesetConditions struct { - RefName *RulesetRefConditionParameters `json:"ref_name,omitempty"` - RepositoryName *RulesetRepositoryNamesConditionParameters `json:"repository_name,omitempty"` - RepositoryID *RulesetRepositoryIDsConditionParameters `json:"repository_id,omitempty"` - RepositoryProperty *RulesetRepositoryPropertyConditionParameters `json:"repository_property,omitempty"` - OrganizationName *RulesetOrganizationNamesConditionParameters `json:"organization_name,omitempty"` - OrganizationID *RulesetOrganizationIDsConditionParameters `json:"organization_id,omitempty"` -} - -// RulePatternParameters represents the rule pattern parameters. -type RulePatternParameters struct { - Name *string `json:"name,omitempty"` - // If Negate is true, the rule will fail if the pattern matches. - Negate *bool `json:"negate,omitempty"` - // Possible values for Operator are: starts_with, ends_with, contains, regex - Operator string `json:"operator"` - Pattern string `json:"pattern"` -} - -// RuleFileParameters represents a list of file paths. -type RuleFileParameters struct { - RestrictedFilePaths *[]string `json:"restricted_file_paths"` -} - -// RuleMaxFilePathLengthParameters represents the max_file_path_length rule parameters. -type RuleMaxFilePathLengthParameters struct { - MaxFilePathLength int `json:"max_file_path_length"` -} - -// RuleFileExtensionRestrictionParameters represents the file_extension_restriction rule parameters. -type RuleFileExtensionRestrictionParameters struct { - RestrictedFileExtensions []string `json:"restricted_file_extensions"` -} - -// RuleMaxFileSizeParameters represents the max_file_size rule parameters. -type RuleMaxFileSizeParameters struct { - MaxFileSize int64 `json:"max_file_size"` -} - -// UpdateAllowsFetchAndMergeRuleParameters represents the update rule parameters. -type UpdateAllowsFetchAndMergeRuleParameters struct { - UpdateAllowsFetchAndMerge bool `json:"update_allows_fetch_and_merge"` -} - -// RequiredDeploymentEnvironmentsRuleParameters represents the required_deployments rule parameters. -type RequiredDeploymentEnvironmentsRuleParameters struct { - RequiredDeploymentEnvironments []string `json:"required_deployment_environments"` -} - -// PullRequestRuleParameters represents the pull_request rule parameters. -type PullRequestRuleParameters struct { - AllowedMergeMethods []MergeMethod `json:"allowed_merge_methods"` - DismissStaleReviewsOnPush bool `json:"dismiss_stale_reviews_on_push"` - RequireCodeOwnerReview bool `json:"require_code_owner_review"` - RequireLastPushApproval bool `json:"require_last_push_approval"` - RequiredApprovingReviewCount int `json:"required_approving_review_count"` - RequiredReviewThreadResolution bool `json:"required_review_thread_resolution"` -} - -// RuleRequiredStatusChecks represents the RequiredStatusChecks for the RequiredStatusChecksRuleParameters object. -type RuleRequiredStatusChecks struct { - Context string `json:"context"` - IntegrationID *int64 `json:"integration_id,omitempty"` -} - -// MergeQueueRuleParameters represents the merge_queue rule parameters. -type MergeQueueRuleParameters struct { - CheckResponseTimeoutMinutes int `json:"check_response_timeout_minutes"` - // Possible values for GroupingStrategy are: ALLGREEN, HEADGREEN - GroupingStrategy string `json:"grouping_strategy"` - MaxEntriesToBuild int `json:"max_entries_to_build"` - MaxEntriesToMerge int `json:"max_entries_to_merge"` - // Possible values for MergeMethod are: MERGE, SQUASH, REBASE - MergeMethod string `json:"merge_method"` - MinEntriesToMerge int `json:"min_entries_to_merge"` - MinEntriesToMergeWaitMinutes int `json:"min_entries_to_merge_wait_minutes"` -} - -// RequiredStatusChecksRuleParameters represents the required_status_checks rule parameters. -type RequiredStatusChecksRuleParameters struct { - DoNotEnforceOnCreate *bool `json:"do_not_enforce_on_create,omitempty"` - RequiredStatusChecks []RuleRequiredStatusChecks `json:"required_status_checks"` - StrictRequiredStatusChecksPolicy bool `json:"strict_required_status_checks_policy"` -} - -// RuleRequiredWorkflow represents the Workflow for the RequireWorkflowsRuleParameters object. -type RuleRequiredWorkflow struct { - Path string `json:"path"` - Ref *string `json:"ref,omitempty"` - RepositoryID *int64 `json:"repository_id,omitempty"` - Sha *string `json:"sha,omitempty"` -} - -// RequiredWorkflowsRuleParameters represents the workflows rule parameters. -type RequiredWorkflowsRuleParameters struct { - DoNotEnforceOnCreate bool `json:"do_not_enforce_on_create,omitempty"` - RequiredWorkflows []*RuleRequiredWorkflow `json:"workflows"` -} - -// RuleRequiredCodeScanningTool represents a single required code-scanning tool for the RequiredCodeScanningParameters object. -type RuleRequiredCodeScanningTool struct { - AlertsThreshold string `json:"alerts_threshold"` - SecurityAlertsThreshold string `json:"security_alerts_threshold"` - Tool string `json:"tool"` -} - -// RequiredCodeScanningRuleParameters represents the code_scanning rule parameters. -type RequiredCodeScanningRuleParameters struct { - RequiredCodeScanningTools []*RuleRequiredCodeScanningTool `json:"code_scanning_tools"` -} - -// RepositoryRule represents a GitHub Rule. -type RepositoryRule struct { - Type string `json:"type"` - Parameters *json.RawMessage `json:"parameters,omitempty"` - RulesetSourceType string `json:"ruleset_source_type"` - RulesetSource string `json:"ruleset_source"` - RulesetID int64 `json:"ruleset_id"` -} - -// RepositoryRulesetEditedChanges represents the changes made to a repository ruleset. -type RepositoryRulesetEditedChanges struct { - Name *RepositoryRulesetEditedSource `json:"name,omitempty"` - Enforcement *RepositoryRulesetEditedSource `json:"enforcement,omitempty"` - Conditions *RepositoryRulesetEditedConditions `json:"conditions,omitempty"` - Rules *RepositoryRulesetEditedRules `json:"rules,omitempty"` -} - -// RepositoryRulesetEditedSource represents a source change for the ruleset. -type RepositoryRulesetEditedSource struct { - From *string `json:"from,omitempty"` -} - -// RepositoryRulesetEditedSources represents multiple source changes for the ruleset. -type RepositoryRulesetEditedSources struct { - From []string `json:"from,omitempty"` -} - -// RepositoryRulesetEditedConditions holds changes to conditions in a ruleset. -type RepositoryRulesetEditedConditions struct { - Added []*RepositoryRulesetRefCondition `json:"added,omitempty"` - Deleted []*RepositoryRulesetRefCondition `json:"deleted,omitempty"` - Updated []*RepositoryRulesetEditedUpdatedConditions `json:"updated,omitempty"` -} - -// RepositoryRulesetEditedRules holds changes to rules in a ruleset. -type RepositoryRulesetEditedRules struct { - Added []*RepositoryRulesetRule `json:"added,omitempty"` - Deleted []*RepositoryRulesetRule `json:"deleted,omitempty"` - Updated []*RepositoryRulesetUpdatedRules `json:"updated,omitempty"` -} - -// RepositoryRulesetRefCondition represents a reference condition for the ruleset. -type RepositoryRulesetRefCondition struct { - RefName *RulesetRefConditionParameters `json:"ref_name,omitempty"` -} - -// RepositoryRulesetEditedUpdatedConditions holds updates to conditions in a ruleset. -type RepositoryRulesetEditedUpdatedConditions struct { - Condition *RepositoryRulesetRefCondition `json:"condition,omitempty"` - Changes *RepositoryRulesetUpdatedConditionsEdited `json:"changes,omitempty"` -} - -// RepositoryRulesetUpdatedConditionsEdited holds the edited updates to conditions in a ruleset. -type RepositoryRulesetUpdatedConditionsEdited struct { - ConditionType *RepositoryRulesetEditedSource `json:"condition_type,omitempty"` - Target *RepositoryRulesetEditedSource `json:"target,omitempty"` - Include *RepositoryRulesetEditedSources `json:"include,omitempty"` - Exclude *RepositoryRulesetEditedSources `json:"exclude,omitempty"` -} - -// RepositoryRulesetUpdatedRules holds updates to rules in a ruleset. -type RepositoryRulesetUpdatedRules struct { - Rule *RepositoryRulesetRule `json:"rule,omitempty"` - Changes *RepositoryRulesetEditedRuleChanges `json:"changes,omitempty"` -} - -// RepositoryRulesetEditedRuleChanges holds changes made to a rule in a ruleset. -type RepositoryRulesetEditedRuleChanges struct { - Configuration *RepositoryRulesetEditedSources `json:"configuration,omitempty"` - RuleType *RepositoryRulesetEditedSources `json:"rule_type,omitempty"` - Pattern *RepositoryRulesetEditedSources `json:"pattern,omitempty"` -} - -// RepositoryRuleset represents the structure of a ruleset associated with a GitHub repository. -type RepositoryRuleset struct { - ID int64 `json:"id"` - Name string `json:"name"` - // Possible values for target: "branch", "tag", "push" - Target *string `json:"target,omitempty"` - // Possible values for source type: "Repository", "Organization" - SourceType *string `json:"source_type,omitempty"` - Source string `json:"source"` - // Possible values for enforcement: "disabled", "active", "evaluate" - Enforcement string `json:"enforcement"` - BypassActors []*BypassActor `json:"bypass_actors,omitempty"` - // Possible values for current user can bypass: "always", "pull_requests_only", "never" - CurrentUserCanBypass *string `json:"current_user_can_bypass,omitempty"` - NodeID *string `json:"node_id,omitempty"` - Links *RepositoryRulesetLink `json:"_links,omitempty"` - Conditions json.RawMessage `json:"conditions,omitempty"` - Rules []*RepositoryRulesetRule `json:"rules,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` -} - -// RepositoryRulesetRule represents individual rules which are present in a repository's ruleset. -type RepositoryRulesetRule struct { - Creation *RepositoryRulesetRuleType `json:"creation,omitempty"` - Update *RepositoryRulesetUpdateRule `json:"update,omitempty"` - Deletion *RepositoryRulesetRuleType `json:"deletion,omitempty"` - RequiredLinearHistory *RepositoryRulesetRuleType `json:"required_linear_history,omitempty"` - MergeQueue *RepositoryRulesetMergeQueueRule `json:"merge_queue,omitempty"` - RequiredDeployments *RepositoryRulesetRequiredDeploymentsRule `json:"required_deployments,omitempty"` - RequiredSignatures *RepositoryRulesetRuleType `json:"required_signatures,omitempty"` - PullRequest *RepositoryRulesetPullRequestRule `json:"pull_request,omitempty"` - RequiredStatusChecks *RepositoryRulesetRequiredStatusChecksRule `json:"required_status_checks,omitempty"` - NonFastForward *RepositoryRulesetRuleType `json:"non_fast_forward,omitempty"` - CommitMessagePattern *RepositoryRulesetPatternRule `json:"commit_message_pattern,omitempty"` - CommitAuthorEmailPattern *RepositoryRulesetPatternRule `json:"commit_author_email_pattern,omitempty"` - CommitterEmailPattern *RepositoryRulesetPatternRule `json:"committer_email_pattern,omitempty"` - BranchNamePattern *RepositoryRulesetPatternRule `json:"branch_name_pattern,omitempty"` - TagNamePattern *RepositoryRulesetPatternRule `json:"tag_name_pattern,omitempty"` - FilePathRestriction *RepositoryRulesetFilePathRestrictionRule `json:"file_path_restriction,omitempty"` - MaxFilePathLength *RepositoryRulesetMaxFilePathLengthRule `json:"max_file_path_length,omitempty"` - FileExtensionRestriction *RepositoryRulesetFileExtensionRestrictionRule `json:"file_extension_restriction,omitempty"` - MaxFileSize *RepositoryRulesetMaxFileSizeRule `json:"max_file_size,omitempty"` - Workflows *RepositoryRulesetWorkflowsRule `json:"workflows,omitempty"` - CodeScanning *RepositoryRulesetCodeScanningRule `json:"code_scanning,omitempty"` -} - -// RepositoryRulesetLink represents Links associated with a repository's rulesets. These links are used to provide more information about the ruleset. -type RepositoryRulesetLink struct { - Self *RulesetLink `json:"self,omitempty"` - HTML *RulesetLink `json:"html,omitempty"` -} - -// RepositoryRulesetRuleType represents the type of a ruleset rule. -type RepositoryRulesetRuleType struct { - Type string `json:"type"` -} - -// RepositoryRulesetUpdateRule defines an update rule for the repository. -type RepositoryRulesetUpdateRule struct { - // Type can be one of: "update". - Type string `json:"type"` - Parameters *UpdateAllowsFetchAndMergeRuleParameters `json:"parameters,omitempty"` -} - -// RepositoryRulesetMergeQueueRule defines a merge queue rule for the repository. -type RepositoryRulesetMergeQueueRule struct { - // Type can be one of: "merge_queue". - Type string `json:"type"` - Parameters *MergeQueueRuleParameters `json:"parameters,omitempty"` -} - -// RepositoryRulesetRequiredDeploymentsRule defines a rule for required deployments. -type RepositoryRulesetRequiredDeploymentsRule struct { - // Type can be one of: "required_deployments". - Type string `json:"type"` - Parameters *RequiredDeploymentEnvironmentsRuleParameters `json:"parameters,omitempty"` -} - -// RepositoryRulesetPullRequestRule defines a rule for pull requests. -type RepositoryRulesetPullRequestRule struct { - // Type can be one of: "pull_request". - - Type string `json:"type"` - Parameters *PullRequestRuleParameters `json:"parameters,omitempty"` -} - -// RepositoryRulesetRequiredStatusChecksRule defines a rule for required status checks. -type RepositoryRulesetRequiredStatusChecksRule struct { - // Type can be one of: "required_status_checks". - - Type string `json:"type"` - Parameters *RequiredStatusChecksRuleParameters `json:"parameters,omitempty"` -} - -// RepositoryRulesetPatternRule defines a pattern rule for the repository. -type RepositoryRulesetPatternRule struct { - Type string `json:"type"` - Parameters *RulePatternParameters `json:"parameters,omitempty"` -} - -// RepositoryRulesetFilePathRestrictionRule defines a file path restriction rule for the repository. -type RepositoryRulesetFilePathRestrictionRule struct { - // Type can be one of: "file_path_restriction". - Type string `json:"type"` - Parameters *RuleFileParameters `json:"parameters,omitempty"` -} - -// RepositoryRulesetMaxFilePathLengthRule defines a maximum file path length rule for the repository. -type RepositoryRulesetMaxFilePathLengthRule struct { - // Type can be one of: "max_file_path_length". - - Type string `json:"type"` - Parameters *RuleMaxFilePathLengthParameters `json:"parameters,omitempty"` -} - -// RepositoryRulesetFileExtensionRestrictionRule defines a file extension restriction rule for the repository. -type RepositoryRulesetFileExtensionRestrictionRule struct { - // Type can be one of: "file_extension_restriction". - Type string `json:"type"` - Parameters *RuleFileExtensionRestrictionParameters `json:"parameters,omitempty"` -} - -// RepositoryRulesetMaxFileSizeRule defines a maximum file size rule for the repository. -type RepositoryRulesetMaxFileSizeRule struct { - // Type can be one of: "max_file_size". - Type string `json:"type"` - Parameters *RuleMaxFileSizeParameters `json:"parameters,omitempty"` -} - -// RepositoryRulesetWorkflowsRule defines a workflow rule for the repository. -type RepositoryRulesetWorkflowsRule struct { - // Type can be one of: "workflows". - Type string `json:"type"` - Parameters *RequiredWorkflowsRuleParameters `json:"parameters,omitempty"` -} - -// RepositoryRulesetCodeScanningRule defines a code scanning rule for the repository. -type RepositoryRulesetCodeScanningRule struct { - // Type can be one of: "code_scanning". - Type string `json:"type"` - Parameters *RuleCodeScanningParameters `json:"parameters,omitempty"` -} - -// RuleCodeScanningParameters defines parameters for code scanning rules. -type RuleCodeScanningParameters struct { - CodeScanningTools []*CodeScanningTool `json:"code_scanning_tools,omitempty"` -} - -// CodeScanningTool defines a specific tool used for code scanning. -type CodeScanningTool struct { - AlertsThreshold string `json:"alerts_threshold"` - SecurityAlertsThreshold string `json:"security_alerts_threshold"` - Tool string `json:"tool"` -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -// This helps us handle the fact that RepositoryRule parameter field can be of numerous types. -func (r *RepositoryRule) UnmarshalJSON(data []byte) error { - type rule RepositoryRule - var repositoryRule rule - if err := json.Unmarshal(data, &repositoryRule); err != nil { - return err - } - - r.RulesetID = repositoryRule.RulesetID - r.RulesetSourceType = repositoryRule.RulesetSourceType - r.RulesetSource = repositoryRule.RulesetSource - r.Type = repositoryRule.Type - - switch repositoryRule.Type { - case "creation", "deletion", "non_fast_forward", "required_linear_history", "required_signatures": - r.Parameters = nil - case "update": - if repositoryRule.Parameters == nil { - r.Parameters = nil - return nil - } - params := UpdateAllowsFetchAndMergeRuleParameters{} - if err := json.Unmarshal(*repositoryRule.Parameters, ¶ms); err != nil { - return err - } - - bytes, _ := json.Marshal(params) - rawParams := json.RawMessage(bytes) - - r.Parameters = &rawParams - case "merge_queue": - if repositoryRule.Parameters == nil { - r.Parameters = nil - return nil - } - params := MergeQueueRuleParameters{} - if err := json.Unmarshal(*repositoryRule.Parameters, ¶ms); err != nil { - return err - } - - bytes, _ := json.Marshal(params) - rawParams := json.RawMessage(bytes) - - r.Parameters = &rawParams - case "required_deployments": - params := RequiredDeploymentEnvironmentsRuleParameters{} - if err := json.Unmarshal(*repositoryRule.Parameters, ¶ms); err != nil { - return err - } - - bytes, _ := json.Marshal(params) - rawParams := json.RawMessage(bytes) - - r.Parameters = &rawParams - case "commit_message_pattern", "commit_author_email_pattern", "committer_email_pattern", "branch_name_pattern", "tag_name_pattern": - params := RulePatternParameters{} - if err := json.Unmarshal(*repositoryRule.Parameters, ¶ms); err != nil { - return err - } - - bytes, _ := json.Marshal(params) - rawParams := json.RawMessage(bytes) - - r.Parameters = &rawParams - case "pull_request": - params := PullRequestRuleParameters{} - if err := json.Unmarshal(*repositoryRule.Parameters, ¶ms); err != nil { - return err - } - - bytes, _ := json.Marshal(params) - rawParams := json.RawMessage(bytes) - - r.Parameters = &rawParams - case "required_status_checks": - params := RequiredStatusChecksRuleParameters{} - if err := json.Unmarshal(*repositoryRule.Parameters, ¶ms); err != nil { - return err - } - - bytes, _ := json.Marshal(params) - rawParams := json.RawMessage(bytes) - - r.Parameters = &rawParams - case "workflows": - params := RequiredWorkflowsRuleParameters{} - if err := json.Unmarshal(*repositoryRule.Parameters, ¶ms); err != nil { - return err - } - - bytes, _ := json.Marshal(params) - rawParams := json.RawMessage(bytes) - - r.Parameters = &rawParams - case "file_path_restriction": - params := RuleFileParameters{} - if err := json.Unmarshal(*repositoryRule.Parameters, ¶ms); err != nil { - return err - } - bytes, _ := json.Marshal(params) - rawParams := json.RawMessage(bytes) - - r.Parameters = &rawParams - case "code_scanning": - params := RequiredCodeScanningRuleParameters{} - if err := json.Unmarshal(*repositoryRule.Parameters, ¶ms); err != nil { - return err - } - bytes, _ := json.Marshal(params) - rawParams := json.RawMessage(bytes) - - r.Parameters = &rawParams - case "max_file_path_length": - params := RuleMaxFilePathLengthParameters{} - if err := json.Unmarshal(*repositoryRule.Parameters, ¶ms); err != nil { - return err - } - bytes, _ := json.Marshal(params) - rawParams := json.RawMessage(bytes) - - r.Parameters = &rawParams - case "file_extension_restriction": - params := RuleFileExtensionRestrictionParameters{} - if err := json.Unmarshal(*repositoryRule.Parameters, ¶ms); err != nil { - return err - } - bytes, _ := json.Marshal(params) - rawParams := json.RawMessage(bytes) - - r.Parameters = &rawParams - case "max_file_size": - params := RuleMaxFileSizeParameters{} - if err := json.Unmarshal(*repositoryRule.Parameters, ¶ms); err != nil { - return err - } - bytes, _ := json.Marshal(params) - rawParams := json.RawMessage(bytes) - - r.Parameters = &rawParams - default: - r.Type = "" - r.Parameters = nil - return fmt.Errorf("repositoryRule.Type %q is not yet implemented, unable to unmarshal (%#v)", repositoryRule.Type, repositoryRule) - } - - return nil -} - -// NewMergeQueueRule creates a rule to only allow merges via a merge queue. -func NewMergeQueueRule(params *MergeQueueRuleParameters) (rule *RepositoryRule) { - if params != nil { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "merge_queue", - Parameters: &rawParams, - } - } - return &RepositoryRule{ - Type: "merge_queue", - } -} - -// NewCreationRule creates a rule to only allow users with bypass permission to create matching refs. -func NewCreationRule() (rule *RepositoryRule) { - return &RepositoryRule{ - Type: "creation", - } -} - -// NewUpdateRule creates a rule to only allow users with bypass permission to update matching refs. -func NewUpdateRule(params *UpdateAllowsFetchAndMergeRuleParameters) (rule *RepositoryRule) { - if params != nil { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "update", - Parameters: &rawParams, - } - } - return &RepositoryRule{ - Type: "update", - } -} - -// NewDeletionRule creates a rule to only allow users with bypass permissions to delete matching refs. -func NewDeletionRule() (rule *RepositoryRule) { - return &RepositoryRule{ - Type: "deletion", - } -} - -// NewRequiredLinearHistoryRule creates a rule to prevent merge commits from being pushed to matching branches. -func NewRequiredLinearHistoryRule() (rule *RepositoryRule) { - return &RepositoryRule{ - Type: "required_linear_history", - } -} - -// NewRequiredDeploymentsRule creates a rule to require environments to be successfully deployed before they can be merged into the matching branches. -func NewRequiredDeploymentsRule(params *RequiredDeploymentEnvironmentsRuleParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "required_deployments", - Parameters: &rawParams, - } -} - -// NewRequiredSignaturesRule creates a rule a to require commits pushed to matching branches to have verified signatures. -func NewRequiredSignaturesRule() (rule *RepositoryRule) { - return &RepositoryRule{ - Type: "required_signatures", - } -} - -// NewPullRequestRule creates a rule to require all commits be made to a non-target branch and submitted via a pull request before they can be merged. -func NewPullRequestRule(params *PullRequestRuleParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "pull_request", - Parameters: &rawParams, - } -} - -// NewRequiredStatusChecksRule creates a rule to require which status checks must pass before branches can be merged into a branch rule. -func NewRequiredStatusChecksRule(params *RequiredStatusChecksRuleParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "required_status_checks", - Parameters: &rawParams, - } -} - -// NewNonFastForwardRule creates a rule as part to prevent users with push access from force pushing to matching branches. -func NewNonFastForwardRule() (rule *RepositoryRule) { - return &RepositoryRule{ - Type: "non_fast_forward", - } -} - -// NewCommitMessagePatternRule creates a rule to restrict commit message patterns being pushed to matching branches. -func NewCommitMessagePatternRule(params *RulePatternParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "commit_message_pattern", - Parameters: &rawParams, - } -} - -// NewCommitAuthorEmailPatternRule creates a rule to restrict commits with author email patterns being merged into matching branches. -func NewCommitAuthorEmailPatternRule(params *RulePatternParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "commit_author_email_pattern", - Parameters: &rawParams, - } -} - -// NewCommitterEmailPatternRule creates a rule to restrict commits with committer email patterns being merged into matching branches. -func NewCommitterEmailPatternRule(params *RulePatternParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "committer_email_pattern", - Parameters: &rawParams, - } -} - -// NewBranchNamePatternRule creates a rule to restrict branch patterns from being merged into matching branches. -func NewBranchNamePatternRule(params *RulePatternParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "branch_name_pattern", - Parameters: &rawParams, - } -} - -// NewTagNamePatternRule creates a rule to restrict tag patterns contained in non-target branches from being merged into matching branches. -func NewTagNamePatternRule(params *RulePatternParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "tag_name_pattern", - Parameters: &rawParams, - } -} - -// NewRequiredWorkflowsRule creates a rule to require which status checks must pass before branches can be merged into a branch rule. -func NewRequiredWorkflowsRule(params *RequiredWorkflowsRuleParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "workflows", - Parameters: &rawParams, - } -} - -// NewRequiredCodeScanningRule creates a rule to require which tools must provide code scanning results before the reference is updated. -func NewRequiredCodeScanningRule(params *RequiredCodeScanningRuleParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "code_scanning", - Parameters: &rawParams, - } -} - -// NewFilePathRestrictionRule creates a rule to restrict file paths from being pushed to. -func NewFilePathRestrictionRule(params *RuleFileParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "file_path_restriction", - Parameters: &rawParams, - } -} - -// NewMaxFilePathLengthRule creates a rule to restrict file paths longer than the limit from being pushed. -func NewMaxFilePathLengthRule(params *RuleMaxFilePathLengthParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "max_file_path_length", - Parameters: &rawParams, - } -} - -// NewFileExtensionRestrictionRule creates a rule to restrict file extensions from being pushed to a commit. -func NewFileExtensionRestrictionRule(params *RuleFileExtensionRestrictionParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "file_extension_restriction", - Parameters: &rawParams, - } -} - -// NewMaxFileSizeRule creates a rule to restrict file sizes from being pushed to a commit. -func NewMaxFileSizeRule(params *RuleMaxFileSizeParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "max_file_size", - Parameters: &rawParams, - } -} - -// Ruleset represents a GitHub ruleset object. -type Ruleset struct { - ID *int64 `json:"id,omitempty"` - Name string `json:"name"` - // Possible values for Target are branch, tag, push - Target *string `json:"target,omitempty"` - // Possible values for SourceType are: Repository, Organization - SourceType *string `json:"source_type,omitempty"` - Source string `json:"source"` - // Possible values for Enforcement are: disabled, active, evaluate - Enforcement string `json:"enforcement"` - BypassActors []*BypassActor `json:"bypass_actors,omitempty"` - NodeID *string `json:"node_id,omitempty"` - Links *RulesetLinks `json:"_links,omitempty"` - Conditions *RulesetConditions `json:"conditions,omitempty"` - Rules []*RepositoryRule `json:"rules,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` -} - // rulesetNoOmitBypassActors represents a GitHub ruleset object. The struct does not omit bypassActors if the field is nil or an empty array is passed. type rulesetNoOmitBypassActors struct { - ID *int64 `json:"id,omitempty"` - Name string `json:"name"` - // Possible values for Target are branch, tag - Target *string `json:"target,omitempty"` - // Possible values for SourceType are: Repository, Organization - SourceType *string `json:"source_type,omitempty"` - Source string `json:"source"` - // Possible values for Enforcement are: disabled, active, evaluate - Enforcement string `json:"enforcement"` - BypassActors []*BypassActor `json:"bypass_actors"` - NodeID *string `json:"node_id,omitempty"` - Links *RulesetLinks `json:"_links,omitempty"` - Conditions *RulesetConditions `json:"conditions,omitempty"` - Rules []*RepositoryRule `json:"rules,omitempty"` + ID *int64 `json:"id,omitempty"` + Name string `json:"name"` + Target *RulesetTarget `json:"target,omitempty"` + SourceType *RulesetSourceType `json:"source_type,omitempty"` + Source string `json:"source"` + Enforcement RulesetEnforcement `json:"enforcement"` + BypassActors []*BypassActor `json:"bypass_actors"` + CurrentUserCanBypass *BypassMode `json:"current_user_can_bypass,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Links *RepositoryRulesetLinks `json:"_links,omitempty"` + Conditions *RepositoryRulesetConditions `json:"conditions,omitempty"` + Rules *RepositoryRulesetRules `json:"rules,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` } // rulesetClearBypassActors is used to clear the bypass actors when modifying a GitHub ruleset object. @@ -853,12 +33,12 @@ type rulesetClearBypassActors struct { BypassActors []*BypassActor `json:"bypass_actors"` } -// GetRulesForBranch gets all the rules that apply to the specified branch. +// GetRulesForBranch gets all the repository rules that apply to the specified branch. // // GitHub API docs: https://docs.github.com/rest/repos/rules#get-rules-for-a-branch // //meta:operation GET /repos/{owner}/{repo}/rules/branches/{branch} -func (s *RepositoriesService) GetRulesForBranch(ctx context.Context, owner, repo, branch string) ([]*RepositoryRule, *Response, error) { +func (s *RepositoriesService) GetRulesForBranch(ctx context.Context, owner, repo, branch string) (*BranchRules, *Response, error) { u := fmt.Sprintf("repos/%v/%v/rules/branches/%v", owner, repo, branch) req, err := s.client.NewRequest("GET", u, nil) @@ -866,7 +46,7 @@ func (s *RepositoriesService) GetRulesForBranch(ctx context.Context, owner, repo return nil, nil, err } - var rules []*RepositoryRule + var rules *BranchRules resp, err := s.client.Do(ctx, req, &rules) if err != nil { return nil, resp, err @@ -875,13 +55,13 @@ func (s *RepositoriesService) GetRulesForBranch(ctx context.Context, owner, repo return rules, resp, nil } -// GetAllRulesets gets all the rules that apply to the specified repository. -// If includesParents is true, rulesets configured at the organization level that apply to the repository will be returned. +// GetAllRulesets gets all the repository rulesets for the specified repository. +// If includesParents is true, rulesets configured at the organization or enterprise level that apply to the repository will be returned. // // GitHub API docs: https://docs.github.com/rest/repos/rules#get-all-repository-rulesets // //meta:operation GET /repos/{owner}/{repo}/rulesets -func (s *RepositoriesService) GetAllRulesets(ctx context.Context, owner, repo string, includesParents bool) ([]*Ruleset, *Response, error) { +func (s *RepositoriesService) GetAllRulesets(ctx context.Context, owner, repo string, includesParents bool) ([]*RepositoryRuleset, *Response, error) { u := fmt.Sprintf("repos/%v/%v/rulesets?includes_parents=%v", owner, repo, includesParents) req, err := s.client.NewRequest("GET", u, nil) @@ -889,7 +69,7 @@ func (s *RepositoriesService) GetAllRulesets(ctx context.Context, owner, repo st return nil, nil, err } - var ruleset []*Ruleset + var ruleset []*RepositoryRuleset resp, err := s.client.Do(ctx, req, &ruleset) if err != nil { return nil, resp, err @@ -898,12 +78,12 @@ func (s *RepositoriesService) GetAllRulesets(ctx context.Context, owner, repo st return ruleset, resp, nil } -// CreateRuleset creates a ruleset for the specified repository. +// CreateRuleset creates a repository ruleset for the specified repository. // // GitHub API docs: https://docs.github.com/rest/repos/rules#create-a-repository-ruleset // //meta:operation POST /repos/{owner}/{repo}/rulesets -func (s *RepositoriesService) CreateRuleset(ctx context.Context, owner, repo string, ruleset Ruleset) (*Ruleset, *Response, error) { +func (s *RepositoriesService) CreateRuleset(ctx context.Context, owner, repo string, ruleset RepositoryRuleset) (*RepositoryRuleset, *Response, error) { u := fmt.Sprintf("repos/%v/%v/rulesets", owner, repo) req, err := s.client.NewRequest("POST", u, ruleset) @@ -911,7 +91,7 @@ func (s *RepositoriesService) CreateRuleset(ctx context.Context, owner, repo str return nil, nil, err } - var rs *Ruleset + var rs *RepositoryRuleset resp, err := s.client.Do(ctx, req, &rs) if err != nil { return nil, resp, err @@ -920,13 +100,13 @@ func (s *RepositoriesService) CreateRuleset(ctx context.Context, owner, repo str return rs, resp, nil } -// GetRuleset gets a ruleset for the specified repository. -// If includesParents is true, rulesets configured at the organization level that apply to the repository will be returned. +// GetRuleset gets a repository ruleset for the specified repository. +// If includesParents is true, rulesets configured at the organization or enterprise level that apply to the repository will be returned. // // GitHub API docs: https://docs.github.com/rest/repos/rules#get-a-repository-ruleset // //meta:operation GET /repos/{owner}/{repo}/rulesets/{ruleset_id} -func (s *RepositoriesService) GetRuleset(ctx context.Context, owner, repo string, rulesetID int64, includesParents bool) (*Ruleset, *Response, error) { +func (s *RepositoriesService) GetRuleset(ctx context.Context, owner, repo string, rulesetID int64, includesParents bool) (*RepositoryRuleset, *Response, error) { u := fmt.Sprintf("repos/%v/%v/rulesets/%v?includes_parents=%v", owner, repo, rulesetID, includesParents) req, err := s.client.NewRequest("GET", u, nil) @@ -934,7 +114,7 @@ func (s *RepositoriesService) GetRuleset(ctx context.Context, owner, repo string return nil, nil, err } - var ruleset *Ruleset + var ruleset *RepositoryRuleset resp, err := s.client.Do(ctx, req, &ruleset) if err != nil { return nil, resp, err @@ -943,12 +123,12 @@ func (s *RepositoriesService) GetRuleset(ctx context.Context, owner, repo string return ruleset, resp, nil } -// UpdateRuleset updates a ruleset for the specified repository. +// UpdateRuleset updates a repository ruleset for the specified repository. // // GitHub API docs: https://docs.github.com/rest/repos/rules#update-a-repository-ruleset // //meta:operation PUT /repos/{owner}/{repo}/rulesets/{ruleset_id} -func (s *RepositoriesService) UpdateRuleset(ctx context.Context, owner, repo string, rulesetID int64, ruleset Ruleset) (*Ruleset, *Response, error) { +func (s *RepositoriesService) UpdateRuleset(ctx context.Context, owner, repo string, rulesetID int64, ruleset RepositoryRuleset) (*RepositoryRuleset, *Response, error) { u := fmt.Sprintf("repos/%v/%v/rulesets/%v", owner, repo, rulesetID) req, err := s.client.NewRequest("PUT", u, ruleset) @@ -956,7 +136,7 @@ func (s *RepositoriesService) UpdateRuleset(ctx context.Context, owner, repo str return nil, nil, err } - var rs *Ruleset + var rs *RepositoryRuleset resp, err := s.client.Do(ctx, req, &rs) if err != nil { return nil, resp, err @@ -965,7 +145,7 @@ func (s *RepositoriesService) UpdateRuleset(ctx context.Context, owner, repo str return rs, resp, nil } -// UpdateRulesetClearBypassActor clears the ruleset bypass actors for a ruleset for the specified repository. +// UpdateRulesetClearBypassActor clears the bypass actors for a repository ruleset for the specified repository. // // This function is necessary as the UpdateRuleset function does not marshal ByPassActor if passed as an empty array. // @@ -990,7 +170,7 @@ func (s *RepositoriesService) UpdateRulesetClearBypassActor(ctx context.Context, return resp, nil } -// UpdateRulesetNoBypassActor updates a ruleset for the specified repository. +// UpdateRulesetNoBypassActor updates a repository ruleset for the specified repository. // // This function is necessary as the UpdateRuleset function does not marshal ByPassActor if passed as an empty array. // @@ -999,7 +179,7 @@ func (s *RepositoriesService) UpdateRulesetClearBypassActor(ctx context.Context, // GitHub API docs: https://docs.github.com/rest/repos/rules#update-a-repository-ruleset // //meta:operation PUT /repos/{owner}/{repo}/rulesets/{ruleset_id} -func (s *RepositoriesService) UpdateRulesetNoBypassActor(ctx context.Context, owner, repo string, rulesetID int64, ruleset Ruleset) (*Ruleset, *Response, error) { +func (s *RepositoriesService) UpdateRulesetNoBypassActor(ctx context.Context, owner, repo string, rulesetID int64, ruleset RepositoryRuleset) (*RepositoryRuleset, *Response, error) { u := fmt.Sprintf("repos/%v/%v/rulesets/%v", owner, repo, rulesetID) rsNoBypassActor := rulesetNoOmitBypassActors{ @@ -1021,7 +201,7 @@ func (s *RepositoriesService) UpdateRulesetNoBypassActor(ctx context.Context, ow return nil, nil, err } - var rs *Ruleset + var rs *RepositoryRuleset resp, err := s.client.Do(ctx, req, &rs) if err != nil { return nil, resp, err @@ -1030,7 +210,7 @@ func (s *RepositoriesService) UpdateRulesetNoBypassActor(ctx context.Context, ow return rs, resp, nil } -// DeleteRuleset deletes a ruleset for the specified repository. +// DeleteRuleset deletes a repository ruleset for the specified repository. // // GitHub API docs: https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset // diff --git a/github/repos_rules_test.go b/github/repos_rules_test.go index 8ee8b9749ec..bb43d532a55 100644 --- a/github/repos_rules_test.go +++ b/github/repos_rules_test.go @@ -14,399 +14,6 @@ import ( "github.com/google/go-cmp/cmp" ) -func TestRepositoryRule_UnmarshalJSON(t *testing.T) { - t.Parallel() - tests := map[string]struct { - data string - want *RepositoryRule - wantErr bool - }{ - "Invalid JSON": { - data: `{`, - want: &RepositoryRule{ - Type: "", - Parameters: nil, - }, - wantErr: true, - }, - "With Metadata": { - data: `{ - "type": "creation", - "ruleset_source_type": "Repository", - "ruleset_source": "google", - "ruleset_id": 1984 - }`, - want: &RepositoryRule{ - RulesetSource: "google", - RulesetSourceType: "Repository", - RulesetID: 1984, - Type: "creation", - }, - }, - "Valid creation": { - data: `{"type":"creation"}`, - want: NewCreationRule(), - }, - "Valid deletion": { - data: `{"type":"deletion"}`, - want: &RepositoryRule{ - Type: "deletion", - Parameters: nil, - }, - }, - "Valid required_linear_history": { - data: `{"type":"required_linear_history"}`, - want: &RepositoryRule{ - Type: "required_linear_history", - Parameters: nil, - }, - }, - "Valid required_signatures": { - data: `{"type":"required_signatures"}`, - want: &RepositoryRule{ - Type: "required_signatures", - Parameters: nil, - }, - }, - "Valid merge_queue": { - data: `{"type":"merge_queue"}`, - want: &RepositoryRule{ - Type: "merge_queue", - Parameters: nil, - }, - }, - "Valid merge_queue with params": { - data: `{ - "type":"merge_queue", - "parameters":{ - "check_response_timeout_minutes": 35, - "grouping_strategy": "HEADGREEN", - "max_entries_to_build": 8, - "max_entries_to_merge": 4, - "merge_method": "SQUASH", - "min_entries_to_merge": 2, - "min_entries_to_merge_wait_minutes": 13 - } - }`, - want: NewMergeQueueRule(&MergeQueueRuleParameters{ - CheckResponseTimeoutMinutes: 35, - GroupingStrategy: "HEADGREEN", - MaxEntriesToBuild: 8, - MaxEntriesToMerge: 4, - MergeMethod: "SQUASH", - MinEntriesToMerge: 2, - MinEntriesToMergeWaitMinutes: 13, - }), - }, - "Invalid merge_queue with params": { - data: `{ - "type":"merge_queue", - "parameters":{ - "check_response_timeout_minutes": "35", - "grouping_strategy": "HEADGREEN", - "max_entries_to_build": "8", - "max_entries_to_merge": "4", - "merge_method": "SQUASH", - "min_entries_to_merge": "2", - "min_entries_to_merge_wait_minutes": "13" - } - }`, - want: &RepositoryRule{ - Type: "merge_queue", - Parameters: nil, - }, - wantErr: true, - }, - "Valid non_fast_forward": { - data: `{"type":"non_fast_forward"}`, - want: &RepositoryRule{ - Type: "non_fast_forward", - Parameters: nil, - }, - }, - "Valid update params": { - data: `{"type":"update","parameters":{"update_allows_fetch_and_merge":true}}`, - want: NewUpdateRule(&UpdateAllowsFetchAndMergeRuleParameters{UpdateAllowsFetchAndMerge: true}), - }, - "Invalid update params": { - data: `{"type":"update","parameters":{"update_allows_fetch_and_merge":"true"}}`, - want: &RepositoryRule{ - Type: "update", - Parameters: nil, - }, - wantErr: true, - }, - "Valid required_deployments params": { - data: `{"type":"required_deployments","parameters":{"required_deployment_environments":["test"]}}`, - want: NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ - RequiredDeploymentEnvironments: []string{"test"}, - }), - }, - "Invalid required_deployments params": { - data: `{"type":"required_deployments","parameters":{"required_deployment_environments":true}}`, - want: &RepositoryRule{ - Type: "required_deployments", - Parameters: nil, - }, - wantErr: true, - }, - "Valid commit_message_pattern params": { - data: `{"type":"commit_message_pattern","parameters":{"operator":"starts_with","pattern":"github"}}`, - want: NewCommitMessagePatternRule(&RulePatternParameters{ - Operator: "starts_with", - Pattern: "github", - }), - }, - "Invalid commit_message_pattern params": { - data: `{"type":"commit_message_pattern","parameters":{"operator":"starts_with","pattern":1}}`, - want: &RepositoryRule{ - Type: "commit_message_pattern", - Parameters: nil, - }, - wantErr: true, - }, - "Valid commit_author_email_pattern params": { - data: `{"type":"commit_author_email_pattern","parameters":{"operator":"starts_with","pattern":"github"}}`, - want: NewCommitAuthorEmailPatternRule(&RulePatternParameters{ - Operator: "starts_with", - Pattern: "github", - }), - }, - "Invalid commit_author_email_pattern params": { - data: `{"type":"commit_author_email_pattern","parameters":{"operator":"starts_with","pattern":1}}`, - want: &RepositoryRule{ - Type: "commit_author_email_pattern", - Parameters: nil, - }, - wantErr: true, - }, - "Valid committer_email_pattern params": { - data: `{"type":"committer_email_pattern","parameters":{"operator":"starts_with","pattern":"github"}}`, - want: NewCommitterEmailPatternRule(&RulePatternParameters{ - Operator: "starts_with", - Pattern: "github", - }), - }, - "Invalid committer_email_pattern params": { - data: `{"type":"committer_email_pattern","parameters":{"operator":"starts_with","pattern":1}}`, - want: &RepositoryRule{ - Type: "committer_email_pattern", - Parameters: nil, - }, - wantErr: true, - }, - "Valid branch_name_pattern params": { - data: `{"type":"branch_name_pattern","parameters":{"operator":"starts_with","pattern":"github"}}`, - want: NewBranchNamePatternRule(&RulePatternParameters{ - Operator: "starts_with", - Pattern: "github", - }), - }, - "Invalid branch_name_pattern params": { - data: `{"type":"branch_name_pattern","parameters":{"operator":"starts_with","pattern":1}}`, - want: &RepositoryRule{ - Type: "branch_name_pattern", - Parameters: nil, - }, - wantErr: true, - }, - "Valid tag_name_pattern params": { - data: `{"type":"tag_name_pattern","parameters":{"operator":"starts_with","pattern":"github"}}`, - want: NewTagNamePatternRule(&RulePatternParameters{ - Operator: "starts_with", - Pattern: "github", - }), - }, - "Invalid tag_name_pattern params": { - data: `{"type":"tag_name_pattern","parameters":{"operator":"starts_with","pattern":1}}`, - want: &RepositoryRule{ - Type: "tag_name_pattern", - Parameters: nil, - }, - wantErr: true, - }, - "Valid file_path_restriction params": { - data: `{"type":"file_path_restriction","parameters":{"restricted_file_paths":["/a/file"]}}`, - want: NewFilePathRestrictionRule(&RuleFileParameters{ - RestrictedFilePaths: &[]string{"/a/file"}, - }), - }, - "Invalid file_path_restriction params": { - data: `{"type":"file_path_restriction","parameters":{"restricted_file_paths":true}}`, - want: &RepositoryRule{ - Type: "file_path_restriction", - Parameters: nil, - }, - wantErr: true, - }, - "Valid pull_request params": { - data: `{ - "type":"pull_request", - "parameters":{ - "allowed_merge_methods": ["rebase","squash"], - "dismiss_stale_reviews_on_push": true, - "require_code_owner_review": true, - "require_last_push_approval": true, - "required_approving_review_count": 1, - "required_review_thread_resolution":true - } - }`, - want: NewPullRequestRule(&PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{"rebase", "squash"}, - DismissStaleReviewsOnPush: true, - RequireCodeOwnerReview: true, - RequireLastPushApproval: true, - RequiredApprovingReviewCount: 1, - RequiredReviewThreadResolution: true, - }), - }, - "Invalid pull_request params": { - data: `{"type":"pull_request","parameters": {"dismiss_stale_reviews_on_push":"true"}}`, - want: &RepositoryRule{ - Type: "pull_request", - Parameters: nil, - }, - wantErr: true, - }, - "Valid required_status_checks params": { - data: `{"type":"required_status_checks","parameters":{"required_status_checks":[{"context":"test","integration_id":1}],"strict_required_status_checks_policy":true,"do_not_enforce_on_create":true}}`, - want: NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{ - DoNotEnforceOnCreate: Ptr(true), - RequiredStatusChecks: []RuleRequiredStatusChecks{ - { - Context: "test", - IntegrationID: Ptr(int64(1)), - }, - }, - StrictRequiredStatusChecksPolicy: true, - }), - }, - "Invalid required_status_checks params": { - data: `{"type":"required_status_checks", - "parameters": { - "required_status_checks": [ - { - "context": 1 - } - ] - }}`, - want: &RepositoryRule{ - Type: "required_status_checks", - Parameters: nil, - }, - wantErr: true, - }, - "Valid Required workflows params": { - data: `{"type":"workflows","parameters":{"workflows":[{"path": ".github/workflows/test.yml", "repository_id": 1}]}}`, - want: NewRequiredWorkflowsRule(&RequiredWorkflowsRuleParameters{ - RequiredWorkflows: []*RuleRequiredWorkflow{ - { - Path: ".github/workflows/test.yml", - RepositoryID: Ptr(int64(1)), - }, - }, - }), - }, - "Invalid Required workflows params": { - data: `{"type":"workflows","parameters":{"workflows":[{"path": ".github/workflows/test.yml", "repository_id": "test"}]}}`, - want: &RepositoryRule{ - Type: "workflows", - Parameters: nil, - }, - wantErr: true, - }, - "Valid Required code_scanning params": { - data: `{"type":"code_scanning","parameters":{"code_scanning_tools":[{"tool": "CodeQL", "security_alerts_threshold": "high_or_higher", "alerts_threshold": "errors"}]}}`, - want: NewRequiredCodeScanningRule(&RequiredCodeScanningRuleParameters{ - RequiredCodeScanningTools: []*RuleRequiredCodeScanningTool{ - { - Tool: "CodeQL", - SecurityAlertsThreshold: "high_or_higher", - AlertsThreshold: "errors", - }, - }, - }), - }, - "Invalid Required code_scanning params": { - data: `{"type":"code_scanning","parameters":{"code_scanning_tools":[{"tool": 1}]}}`, - want: &RepositoryRule{ - Type: "code_scanning", - Parameters: nil, - }, - wantErr: true, - }, - "Invalid type": { - data: `{"type":"unknown"}`, - want: &RepositoryRule{ - Type: "", - Parameters: nil, - }, - wantErr: true, - }, - "Valid max_file_path_length params": { - data: `{"type":"max_file_path_length","parameters":{"max_file_path_length": 255}}`, - want: NewMaxFilePathLengthRule(&RuleMaxFilePathLengthParameters{ - MaxFilePathLength: 255, - }), - }, - "Invalid max_file_path_length params": { - data: `{"type":"max_file_path_length","parameters":{"max_file_path_length": "255"}}`, - want: &RepositoryRule{ - Type: "max_file_path_length", - Parameters: nil, - }, - wantErr: true, - }, - "Valid file_extension_restriction params": { - data: `{"type":"file_extension_restriction","parameters":{"restricted_file_extensions":[".exe"]}}`, - want: NewFileExtensionRestrictionRule(&RuleFileExtensionRestrictionParameters{ - RestrictedFileExtensions: []string{".exe"}, - }), - }, - "Invalid file_extension_restriction params": { - data: `{"type":"file_extension_restriction","parameters":{"restricted_file_extensions":true}}`, - want: &RepositoryRule{ - Type: "file_extension_restriction", - Parameters: nil, - }, - wantErr: true, - }, - "Valid max_file_size params": { - data: `{"type":"max_file_size","parameters":{"max_file_size": 1024}}`, - want: NewMaxFileSizeRule(&RuleMaxFileSizeParameters{ - MaxFileSize: 1024, - }), - }, - "Invalid max_file_size params": { - data: `{"type":"max_file_size","parameters":{"max_file_size": "1024"}}`, - want: &RepositoryRule{ - Type: "max_file_size", - Parameters: nil, - }, - wantErr: true, - }, - } - - for name, tc := range tests { - tc := tc - rule := &RepositoryRule{} - - t.Run(name, func(t *testing.T) { - t.Parallel() - err := rule.UnmarshalJSON([]byte(tc.data)) - if err == nil && tc.wantErr { - t.Errorf("RepositoryRule.UnmarshalJSON returned nil instead of an error") - } - if err != nil && !tc.wantErr { - t.Errorf("RepositoryRule.UnmarshalJSON returned an unexpected error: %+v", err) - } - if !cmp.Equal(tc.want, rule) { - t.Errorf("RepositoryRule.UnmarshalJSON expected rule %+v, got %+v", tc.want, rule) - } - }) - } -} - func TestRepositoriesService_GetRulesForBranch(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -417,7 +24,7 @@ func TestRepositoriesService_GetRulesForBranch(t *testing.T) { { "ruleset_id": 42069, "ruleset_source_type": "Repository", - "ruleset_source": "google", + "ruleset_source": "google/a", "type": "creation" }, { @@ -438,62 +45,13 @@ func TestRepositoriesService_GetRulesForBranch(t *testing.T) { t.Errorf("Repositories.GetRulesForBranch returned error: %v", err) } - creationRule := NewCreationRule() - creationRule.RulesetID = 42069 - creationRule.RulesetSource = "google" - creationRule.RulesetSourceType = "Repository" - updateRule := NewUpdateRule(&UpdateAllowsFetchAndMergeRuleParameters{ - UpdateAllowsFetchAndMerge: true, - }) - updateRule.RulesetID = 42069 - updateRule.RulesetSource = "google" - updateRule.RulesetSourceType = "Organization" - - want := []*RepositoryRule{ - creationRule, - updateRule, - } - if !cmp.Equal(rules, want) { - t.Errorf("Repositories.GetRulesForBranch returned %+v, want %+v", rules, want) - } - - const methodName = "GetRulesForBranch" - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.GetRulesForBranch(ctx, "o", "repo", "branch") - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestRepositoriesService_GetRulesForBranchEmptyUpdateRule(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/repos/o/repo/rules/branches/branch", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - fmt.Fprint(w, `[ - { - "type": "update" - } - ]`) - }) - - ctx := context.Background() - rules, _, err := client.Repositories.GetRulesForBranch(ctx, "o", "repo", "branch") - if err != nil { - t.Errorf("Repositories.GetRulesForBranch returned error: %v", err) + want := &BranchRules{ + Creation: []*BranchRuleMetadata{{RulesetSourceType: RulesetSourceTypeRepository, RulesetSource: "google/a", RulesetID: 42069}}, + Update: []*UpdateBranchRule{{BranchRuleMetadata: BranchRuleMetadata{RulesetSourceType: RulesetSourceTypeOrganization, RulesetSource: "google", RulesetID: 42069}, Parameters: UpdateRuleParameters{UpdateAllowsFetchAndMerge: true}}}, } - updateRule := NewUpdateRule(nil) - - want := []*RepositoryRule{ - updateRule, - } if !cmp.Equal(rules, want) { - t.Errorf("Repositories.GetRulesForBranch returned %+v, want %+v", Stringify(rules), Stringify(want)) + t.Errorf("Repositories.GetRulesForBranch returned %+v, want %+v", rules, want) } const methodName = "GetRulesForBranch" @@ -513,26 +71,26 @@ func TestRepositoriesService_GetAllRulesets(t *testing.T) { mux.HandleFunc("/repos/o/repo/rulesets", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - fmt.Fprint(w, `[ + fmt.Fprintf(w, `[ { "id": 42, "name": "ruleset", "source_type": "Repository", "source": "o/repo", - "enforcement": "enabled", - "created_at": `+referenceTimeStr+`, - "updated_at": `+referenceTimeStr+` + "enforcement": "active", + "created_at": %[1]s, + "updated_at": %[1]s }, { "id": 314, "name": "Another ruleset", "source_type": "Repository", "source": "o/repo", - "enforcement": "enabled", - "created_at": `+referenceTimeStr+`, - "updated_at": `+referenceTimeStr+` + "enforcement": "active", + "created_at": %[1]s, + "updated_at": %[1]s } - ]`) + ]`, referenceTimeStr) }) ctx := context.Background() @@ -541,22 +99,22 @@ func TestRepositoriesService_GetAllRulesets(t *testing.T) { t.Errorf("Repositories.GetAllRulesets returned error: %v", err) } - want := []*Ruleset{ + want := []*RepositoryRuleset{ { ID: Ptr(int64(42)), Name: "ruleset", - SourceType: Ptr("Repository"), + SourceType: Ptr(RulesetSourceTypeRepository), Source: "o/repo", - Enforcement: "enabled", + Enforcement: RulesetEnforcementActive, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, }, { ID: Ptr(int64(314)), Name: "Another ruleset", - SourceType: Ptr("Repository"), + SourceType: Ptr(RulesetSourceTypeRepository), Source: "o/repo", - Enforcement: "enabled", + Enforcement: RulesetEnforcementActive, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, }, @@ -587,25 +145,25 @@ func TestRepositoriesService_CreateRuleset(t *testing.T) { "name": "ruleset", "source_type": "Repository", "source": "o/repo", - "enforcement": "enabled" + "enforcement": "active" }`) }) ctx := context.Background() - ruleSet, _, err := client.Repositories.CreateRuleset(ctx, "o", "repo", Ruleset{ + ruleSet, _, err := client.Repositories.CreateRuleset(ctx, "o", "repo", RepositoryRuleset{ Name: "ruleset", - Enforcement: "enabled", + Enforcement: RulesetEnforcementActive, }) if err != nil { t.Errorf("Repositories.CreateRuleset returned error: %v", err) } - want := &Ruleset{ + want := &RepositoryRuleset{ ID: Ptr(int64(42)), Name: "ruleset", - SourceType: Ptr("Repository"), + SourceType: Ptr(RulesetSourceTypeRepository), Source: "o/repo", - Enforcement: "enabled", + Enforcement: RulesetEnforcementActive, } if !cmp.Equal(ruleSet, want) { t.Errorf("Repositories.CreateRuleset returned %+v, want %+v", ruleSet, want) @@ -614,7 +172,7 @@ func TestRepositoriesService_CreateRuleset(t *testing.T) { const methodName = "CreateRuleset" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.CreateRuleset(ctx, "o", "repo", Ruleset{}) + got, resp, err := client.Repositories.CreateRuleset(ctx, "o", "repo", RepositoryRuleset{}) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -633,7 +191,7 @@ func TestRepositoriesService_CreateRulesetWithPushRules(t *testing.T) { "name": "ruleset", "source_type": "Repository", "source": "o/repo", - "enforcement": "enabled", + "enforcement": "active", "target": "push", "rules": [ { @@ -665,34 +223,26 @@ func TestRepositoriesService_CreateRulesetWithPushRules(t *testing.T) { }) ctx := context.Background() - ruleSet, _, err := client.Repositories.CreateRuleset(ctx, "o", "repo", Ruleset{ + ruleSet, _, err := client.Repositories.CreateRuleset(ctx, "o", "repo", RepositoryRuleset{ Name: "ruleset", - Enforcement: "enabled", + Enforcement: RulesetEnforcementActive, }) if err != nil { t.Errorf("Repositories.CreateRuleset returned error: %v", err) } - want := &Ruleset{ + want := &RepositoryRuleset{ ID: Ptr(int64(42)), Name: "ruleset", - SourceType: Ptr("Repository"), + SourceType: Ptr(RulesetSourceTypeRepository), Source: "o/repo", - Target: Ptr("push"), - Enforcement: "enabled", - Rules: []*RepositoryRule{ - NewFilePathRestrictionRule(&RuleFileParameters{ - RestrictedFilePaths: &[]string{"/a/file"}, - }), - NewMaxFilePathLengthRule(&RuleMaxFilePathLengthParameters{ - MaxFilePathLength: 255, - }), - NewFileExtensionRestrictionRule(&RuleFileExtensionRestrictionParameters{ - RestrictedFileExtensions: []string{".exe"}, - }), - NewMaxFileSizeRule(&RuleMaxFileSizeParameters{ - MaxFileSize: 1024, - }), + Target: Ptr(RulesetTargetPush), + Enforcement: RulesetEnforcementActive, + Rules: &RepositoryRulesetRules{ + FilePathRestriction: &FilePathRestrictionRuleParameters{RestrictedFilePaths: []string{"/a/file"}}, + MaxFilePathLength: &MaxFilePathLengthRuleParameters{MaxFilePathLength: 255}, + FileExtensionRestriction: &FileExtensionRestrictionRuleParameters{RestrictedFileExtensions: []string{".exe"}}, + MaxFileSize: &MaxFileSizeRuleParameters{MaxFileSize: 1024}, }, } if !cmp.Equal(ruleSet, want) { @@ -702,7 +252,7 @@ func TestRepositoriesService_CreateRulesetWithPushRules(t *testing.T) { const methodName = "CreateRuleset" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.CreateRuleset(ctx, "o", "repo", Ruleset{}) + got, resp, err := client.Repositories.CreateRuleset(ctx, "o", "repo", RepositoryRuleset{}) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -721,7 +271,7 @@ func TestRepositoriesService_GetRuleset(t *testing.T) { "name": "ruleset", "source_type": "Organization", "source": "o", - "enforcement": "enabled", + "enforcement": "active", "created_at": `+referenceTimeStr+`, "updated_at": `+referenceTimeStr+` }`) @@ -733,12 +283,12 @@ func TestRepositoriesService_GetRuleset(t *testing.T) { t.Errorf("Repositories.GetRuleset returned error: %v", err) } - want := &Ruleset{ + want := &RepositoryRuleset{ ID: Ptr(int64(42)), Name: "ruleset", - SourceType: Ptr("Organization"), + SourceType: Ptr(RulesetSourceTypeOrganization), Source: "o", - Enforcement: "enabled", + Enforcement: RulesetEnforcementActive, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, } @@ -768,25 +318,25 @@ func TestRepositoriesService_UpdateRuleset(t *testing.T) { "name": "ruleset", "source_type": "Repository", "source": "o/repo", - "enforcement": "enabled" + "enforcement": "active" }`) }) ctx := context.Background() - ruleSet, _, err := client.Repositories.UpdateRuleset(ctx, "o", "repo", 42, Ruleset{ + ruleSet, _, err := client.Repositories.UpdateRuleset(ctx, "o", "repo", 42, RepositoryRuleset{ Name: "ruleset", - Enforcement: "enabled", + Enforcement: RulesetEnforcementActive, }) if err != nil { t.Errorf("Repositories.UpdateRuleset returned error: %v", err) } - want := &Ruleset{ + want := &RepositoryRuleset{ ID: Ptr(int64(42)), Name: "ruleset", - SourceType: Ptr("Repository"), + SourceType: Ptr(RulesetSourceTypeRepository), Source: "o/repo", - Enforcement: "enabled", + Enforcement: "active", } if !cmp.Equal(ruleSet, want) { @@ -796,7 +346,7 @@ func TestRepositoriesService_UpdateRuleset(t *testing.T) { const methodName = "UpdateRuleset" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.UpdateRuleset(ctx, "o", "repo", 42, Ruleset{}) + got, resp, err := client.Repositories.UpdateRuleset(ctx, "o", "repo", 42, RepositoryRuleset{}) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -815,7 +365,7 @@ func TestRepositoriesService_UpdateRulesetClearBypassActor(t *testing.T) { "name": "ruleset", "source_type": "Repository", "source": "o/repo", - "enforcement": "enabled" + "enforcement": "active" "conditions": { "ref_name": { "include": [ @@ -853,10 +403,10 @@ func TestRepositoriesService_UpdateRulesetNoBypassActor(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - rs := Ruleset{ + rs := RepositoryRuleset{ Name: "ruleset", Source: "o/repo", - Enforcement: "enabled", + Enforcement: RulesetEnforcementActive, } mux.HandleFunc("/repos/o/repo/rulesets/42", func(w http.ResponseWriter, r *http.Request) { @@ -866,7 +416,7 @@ func TestRepositoriesService_UpdateRulesetNoBypassActor(t *testing.T) { "name": "ruleset", "source_type": "Repository", "source": "o/repo", - "enforcement": "enabled" + "enforcement": "active" }`) }) @@ -877,12 +427,12 @@ func TestRepositoriesService_UpdateRulesetNoBypassActor(t *testing.T) { t.Errorf("Repositories.UpdateRulesetNoBypassActor returned error: %v \n", err) } - want := &Ruleset{ + want := &RepositoryRuleset{ ID: Ptr(int64(42)), Name: "ruleset", - SourceType: Ptr("Repository"), + SourceType: Ptr(RulesetSourceTypeRepository), Source: "o/repo", - Enforcement: "enabled", + Enforcement: RulesetEnforcementActive, } if !cmp.Equal(ruleSet, want) { @@ -892,7 +442,7 @@ func TestRepositoriesService_UpdateRulesetNoBypassActor(t *testing.T) { const methodName = "UpdateRulesetNoBypassActor" testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.UpdateRulesetNoBypassActor(ctx, "o", "repo", 42, Ruleset{}) + got, resp, err := client.Repositories.UpdateRulesetNoBypassActor(ctx, "o", "repo", 42, RepositoryRuleset{}) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } diff --git a/github/rules.go b/github/rules.go new file mode 100644 index 00000000000..8312d95237f --- /dev/null +++ b/github/rules.go @@ -0,0 +1,1207 @@ +// Copyright 2025 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 ( + "encoding/json" + "reflect" +) + +// RulesetTarget represents a GitHub ruleset target. +type RulesetTarget string + +// This is the set of GitHub ruleset targets. +const ( + RulesetTargetBranch RulesetTarget = "branch" + RulesetTargetTag RulesetTarget = "tag" + RulesetTargetPush RulesetTarget = "push" +) + +// RulesetSourceType represents a GitHub ruleset source type. +type RulesetSourceType string + +// This is the set of GitHub ruleset source types. +const ( + RulesetSourceTypeRepository RulesetSourceType = "Repository" + RulesetSourceTypeOrganization RulesetSourceType = "Organization" + RulesetSourceTypeEnterprise RulesetSourceType = "Enterprise" +) + +// RulesetEnforcement represents a GitHub ruleset enforcement. +type RulesetEnforcement string + +// This is the set of GitHub ruleset enforcements. +const ( + RulesetEnforcementDisabled RulesetEnforcement = "disabled" + RulesetEnforcementActive RulesetEnforcement = "active" + RulesetEnforcementEvaluate RulesetEnforcement = "evaluate" +) + +// BypassActorType represents a GitHub ruleset bypass actor type. +type BypassActorType string + +// This is the set of GitHub ruleset bypass actor types. +const ( + BypassActorTypeIntegration BypassActorType = "Integration" + BypassActorTypeOrganizationAdmin BypassActorType = "OrganizationAdmin" + BypassActorTypeRepositoryRole BypassActorType = "RepositoryRole" + BypassActorTypeTeam BypassActorType = "Team" + BypassActorTypeDeployKey BypassActorType = "DeployKey" +) + +// BypassMode represents a GitHub ruleset bypass mode. +type BypassMode string + +// This is the set of GitHub ruleset bypass modes. +const ( + BypassModeAlways BypassMode = "always" + BypassModePullRequest BypassMode = "pull_request" + BypassModeNever BypassMode = "never" +) + +// RepositoryRuleType represents a GitHub ruleset rule type. +type RepositoryRuleType string + +// This is the set of GitHub ruleset rule types. +const ( + RulesetRuleTypeCreation RepositoryRuleType = "creation" + RulesetRuleTypeUpdate RepositoryRuleType = "update" + RulesetRuleTypeDeletion RepositoryRuleType = "deletion" + RulesetRuleTypeRequiredLinearHistory RepositoryRuleType = "required_linear_history" + RulesetRuleTypeMergeQueue RepositoryRuleType = "merge_queue" + RulesetRuleTypeRequiredDeployments RepositoryRuleType = "required_deployments" + RulesetRuleTypeRequiredSignatures RepositoryRuleType = "required_signatures" + RulesetRuleTypePullRequest RepositoryRuleType = "pull_request" + RulesetRuleTypeRequiredStatusChecks RepositoryRuleType = "required_status_checks" + RulesetRuleTypeNonFastForward RepositoryRuleType = "non_fast_forward" + RulesetRuleTypeCommitMessagePattern RepositoryRuleType = "commit_message_pattern" + RulesetRuleTypeCommitAuthorEmailPattern RepositoryRuleType = "commit_author_email_pattern" + RulesetRuleTypeCommitterEmailPattern RepositoryRuleType = "committer_email_pattern" + RulesetRuleTypeBranchNamePattern RepositoryRuleType = "branch_name_pattern" + RulesetRuleTypeTagNamePattern RepositoryRuleType = "tag_name_pattern" + RulesetRuleTypeFilePathRestriction RepositoryRuleType = "file_path_restriction" + RulesetRuleTypeMaxFilePathLength RepositoryRuleType = "max_file_path_length" + RulesetRuleTypeFileExtensionRestriction RepositoryRuleType = "file_extension_restriction" + RulesetRuleTypeMaxFileSize RepositoryRuleType = "max_file_size" + RulesetRuleTypeWorkflows RepositoryRuleType = "workflows" + RulesetRuleTypeCodeScanning RepositoryRuleType = "code_scanning" +) + +// MergeGroupingStrategy models a GitHub merge grouping strategy. +type MergeGroupingStrategy string + +// This is the set of GitHub merge grouping strategies. +const ( + MergeGroupingStrategyAllGreen MergeGroupingStrategy = "ALLGREEN" + MergeGroupingStrategyHeadGreen MergeGroupingStrategy = "HEADGREEN" +) + +// MergeMethod models a GitHub merge method. +type MergeMethod string + +// This is the set of GitHub merge methods. +const ( + MergeMethodMerge MergeMethod = "merge" + MergeMethodRebase MergeMethod = "rebase" + MergeMethodSquash MergeMethod = "squash" +) + +// PatternRuleOperator models a GitHub pattern rule operator. +type PatternRuleOperator string + +// This is the set of GitHub pattern rule operators. +const ( + PatternRuleOperatorStartsWith PatternRuleOperator = "starts_with" + PatternRuleOperatorEndsWith PatternRuleOperator = "ends_with" + PatternRuleOperatorContains PatternRuleOperator = "contains" + PatternRuleOperatorRegex PatternRuleOperator = "regex" +) + +// CodeScanningAlertsThreshold models a GitHub code scanning alerts threshold. +type CodeScanningAlertsThreshold string + +// This is the set of GitHub code scanning alerts thresholds. +const ( + CodeScanningAlertsThresholdNone CodeScanningAlertsThreshold = "none" + CodeScanningAlertsThresholdErrors CodeScanningAlertsThreshold = "errors" + CodeScanningAlertsThresholdErrorsAndWarnings CodeScanningAlertsThreshold = "errors_and_warnings" + CodeScanningAlertsThresholdAll CodeScanningAlertsThreshold = "all" +) + +// CodeScanningSecurityAlertsThreshold models a GitHub code scanning security alerts threshold. +type CodeScanningSecurityAlertsThreshold string + +// This is the set of GitHub code scanning security alerts thresholds. +const ( + CodeScanningSecurityAlertsThresholdNone CodeScanningSecurityAlertsThreshold = "none" + CodeScanningSecurityAlertsThresholdCritical CodeScanningSecurityAlertsThreshold = "critical" + CodeScanningSecurityAlertsThresholdHighOrHigher CodeScanningSecurityAlertsThreshold = "high_or_higher" + CodeScanningSecurityAlertsThresholdMediumOrHigher CodeScanningSecurityAlertsThreshold = "medium_or_higher" + CodeScanningSecurityAlertsThresholdAll CodeScanningSecurityAlertsThreshold = "all" +) + +// RepositoryRuleset represents a GitHub ruleset object. +type RepositoryRuleset struct { + ID *int64 `json:"id,omitempty"` + Name string `json:"name"` + Target *RulesetTarget `json:"target,omitempty"` + SourceType *RulesetSourceType `json:"source_type,omitempty"` + Source string `json:"source"` + Enforcement RulesetEnforcement `json:"enforcement"` + BypassActors []*BypassActor `json:"bypass_actors,omitempty"` + CurrentUserCanBypass *BypassMode `json:"current_user_can_bypass,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Links *RepositoryRulesetLinks `json:"_links,omitempty"` + Conditions *RepositoryRulesetConditions `json:"conditions,omitempty"` + Rules *RepositoryRulesetRules `json:"rules,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` +} + +// BypassActor represents the bypass actors from a ruleset. +type BypassActor struct { + ActorID *int64 `json:"actor_id,omitempty"` + ActorType *BypassActorType `json:"actor_type,omitempty"` + BypassMode *BypassMode `json:"bypass_mode,omitempty"` +} + +// RepositoryRulesetLinks represents the "_links" object in a Ruleset. +type RepositoryRulesetLinks struct { + Self *RepositoryRulesetLink `json:"self,omitempty"` + HTML *RepositoryRulesetLink `json:"html,omitempty"` +} + +// RepositoryRulesetLink represents a single link object from GitHub ruleset request _links. +type RepositoryRulesetLink struct { + HRef *string `json:"href,omitempty"` +} + +// RepositoryRulesetConditions represents the conditions object in a ruleset. +// Set either RepositoryName or RepositoryID or RepositoryProperty, not more than one. +type RepositoryRulesetConditions struct { + RefName *RepositoryRulesetRefConditionParameters `json:"ref_name,omitempty"` + RepositoryID *RepositoryRulesetRepositoryIDsConditionParameters `json:"repository_id,omitempty"` + RepositoryName *RepositoryRulesetRepositoryNamesConditionParameters `json:"repository_name,omitempty"` + RepositoryProperty *RepositoryRulesetRepositoryPropertyConditionParameters `json:"repository_property,omitempty"` + OrganizationID *RepositoryRulesetOrganizationIDsConditionParameters `json:"organization_id,omitempty"` + OrganizationName *RepositoryRulesetOrganizationNamesConditionParameters `json:"organization_name,omitempty"` +} + +// RepositoryRulesetRefConditionParameters represents the conditions object for ref_names. +type RepositoryRulesetRefConditionParameters struct { + Include []string `json:"include"` + Exclude []string `json:"exclude"` +} + +// RepositoryRulesetRepositoryIDsConditionParameters represents the conditions object for repository_id. +type RepositoryRulesetRepositoryIDsConditionParameters struct { + RepositoryIDs []int64 `json:"repository_ids,omitempty"` +} + +// RepositoryRulesetRepositoryNamesConditionParameters represents the conditions object for repository_name. +type RepositoryRulesetRepositoryNamesConditionParameters struct { + Include []string `json:"include"` + Exclude []string `json:"exclude"` + Protected *bool `json:"protected,omitempty"` +} + +// RepositoryRulesetRepositoryPropertyConditionParameters represents the conditions object for repository_property. +type RepositoryRulesetRepositoryPropertyConditionParameters struct { + Include []*RepositoryRulesetRepositoryPropertyTargetParameters `json:"include"` + Exclude []*RepositoryRulesetRepositoryPropertyTargetParameters `json:"exclude"` +} + +// RepositoryRulesetRepositoryPropertyTargetParameters represents a repository_property name and values to be used for targeting. +type RepositoryRulesetRepositoryPropertyTargetParameters struct { + Name string `json:"name"` + PropertyValues []string `json:"property_values"` + Source *string `json:"source,omitempty"` +} + +// RepositoryRulesetOrganizationIDsConditionParameters represents the conditions object for organization_id. +type RepositoryRulesetOrganizationIDsConditionParameters struct { + OrganizationIDs []int64 `json:"organization_ids,omitempty"` +} + +// RepositoryRulesetOrganizationNamesConditionParameters represents the conditions object for organization_name. +type RepositoryRulesetOrganizationNamesConditionParameters struct { + Include []string `json:"include"` + Exclude []string `json:"exclude"` +} + +// RepositoryRule represents a GitHub ruleset rule object. +type RepositoryRule struct { + Type RepositoryRuleType `json:"type"` + Parameters any `json:"parameters,omitempty"` +} + +// RepositoryRulesetRules represents a GitHub ruleset rules object. +// This type doesn't have JSON annotations as it uses custom marshaling. +type RepositoryRulesetRules struct { + Creation *EmptyRuleParameters + Update *UpdateRuleParameters + Deletion *EmptyRuleParameters + RequiredLinearHistory *EmptyRuleParameters + MergeQueue *MergeQueueRuleParameters + RequiredDeployments *RequiredDeploymentsRuleParameters + RequiredSignatures *EmptyRuleParameters + PullRequest *PullRequestRuleParameters + RequiredStatusChecks *RequiredStatusChecksRuleParameters + NonFastForward *EmptyRuleParameters + CommitMessagePattern *PatternRuleParameters + CommitAuthorEmailPattern *PatternRuleParameters + CommitterEmailPattern *PatternRuleParameters + BranchNamePattern *PatternRuleParameters + TagNamePattern *PatternRuleParameters + FilePathRestriction *FilePathRestrictionRuleParameters + MaxFilePathLength *MaxFilePathLengthRuleParameters + FileExtensionRestriction *FileExtensionRestrictionRuleParameters + MaxFileSize *MaxFileSizeRuleParameters + Workflows *WorkflowsRuleParameters + CodeScanning *CodeScanningRuleParameters +} + +// BranchRules represents the rules active for a GitHub repository branch. +// This type doesn't have JSON annotations as it uses custom marshaling. +type BranchRules struct { + Creation []*BranchRuleMetadata + Update []*UpdateBranchRule + Deletion []*BranchRuleMetadata + RequiredLinearHistory []*BranchRuleMetadata + MergeQueue []*MergeQueueBranchRule + RequiredDeployments []*RequiredDeploymentsBranchRule + RequiredSignatures []*BranchRuleMetadata + PullRequest []*PullRequestBranchRule + RequiredStatusChecks []*RequiredStatusChecksBranchRule + NonFastForward []*BranchRuleMetadata + CommitMessagePattern []*PatternBranchRule + CommitAuthorEmailPattern []*PatternBranchRule + CommitterEmailPattern []*PatternBranchRule + BranchNamePattern []*PatternBranchRule + TagNamePattern []*PatternBranchRule + FilePathRestriction []*FilePathRestrictionBranchRule + MaxFilePathLength []*MaxFilePathLengthBranchRule + FileExtensionRestriction []*FileExtensionRestrictionBranchRule + MaxFileSize []*MaxFileSizeBranchRule + Workflows []*WorkflowsBranchRule + CodeScanning []*CodeScanningBranchRule +} + +// BranchRuleMetadata represents the metadata for a branch rule. +type BranchRuleMetadata struct { + RulesetSourceType RulesetSourceType `json:"ruleset_source_type"` + RulesetSource string `json:"ruleset_source"` + RulesetID int64 `json:"ruleset_id"` +} + +// UpdateBranchRule represents an update branch rule. +type UpdateBranchRule struct { + BranchRuleMetadata + Parameters UpdateRuleParameters `json:"parameters"` +} + +// MergeQueueBranchRule represents a merge queue branch rule. +type MergeQueueBranchRule struct { + BranchRuleMetadata + Parameters MergeQueueRuleParameters `json:"parameters"` +} + +// RequiredDeploymentsBranchRule represents a required deployments branch rule. +type RequiredDeploymentsBranchRule struct { + BranchRuleMetadata + Parameters RequiredDeploymentsRuleParameters `json:"parameters"` +} + +// PullRequestBranchRule represents a pull request branch rule. +type PullRequestBranchRule struct { + BranchRuleMetadata + Parameters PullRequestRuleParameters `json:"parameters"` +} + +// RequiredStatusChecksBranchRule represents a required status checks branch rule. +type RequiredStatusChecksBranchRule struct { + BranchRuleMetadata + Parameters RequiredStatusChecksRuleParameters `json:"parameters"` +} + +// PatternBranchRule represents a pattern branch rule. +type PatternBranchRule struct { + BranchRuleMetadata + Parameters PatternRuleParameters `json:"parameters"` +} + +// FilePathRestrictionBranchRule represents a file path restriction branch rule. +type FilePathRestrictionBranchRule struct { + BranchRuleMetadata + Parameters FilePathRestrictionRuleParameters `json:"parameters"` +} + +// MaxFilePathLengthBranchRule represents a max file path length branch rule. +type MaxFilePathLengthBranchRule struct { + BranchRuleMetadata + Parameters MaxFilePathLengthRuleParameters `json:"parameters"` +} + +// FileExtensionRestrictionBranchRule represents a file extension restriction branch rule. +type FileExtensionRestrictionBranchRule struct { + BranchRuleMetadata + Parameters FileExtensionRestrictionRuleParameters `json:"parameters"` +} + +// MaxFileSizeBranchRule represents a max file size branch rule. +type MaxFileSizeBranchRule struct { + BranchRuleMetadata + Parameters MaxFileSizeRuleParameters `json:"parameters"` +} + +// WorkflowsBranchRule represents a workflows branch rule. +type WorkflowsBranchRule struct { + BranchRuleMetadata + Parameters WorkflowsRuleParameters `json:"parameters"` +} + +// CodeScanningBranchRule represents a code scanning branch rule. +type CodeScanningBranchRule struct { + BranchRuleMetadata + Parameters CodeScanningRuleParameters `json:"parameters"` +} + +// EmptyRuleParameters represents the parameters for a rule with no options. +type EmptyRuleParameters struct{} + +// UpdateRuleParameters represents the update rule parameters. +type UpdateRuleParameters struct { + UpdateAllowsFetchAndMerge bool `json:"update_allows_fetch_and_merge,omitempty"` +} + +// MergeQueueRuleParameters represents the merge_queue rule parameters. +type MergeQueueRuleParameters struct { + CheckResponseTimeoutMinutes int `json:"check_response_timeout_minutes"` + GroupingStrategy MergeGroupingStrategy `json:"grouping_strategy"` + MaxEntriesToBuild int `json:"max_entries_to_build"` + MaxEntriesToMerge int `json:"max_entries_to_merge"` + MergeMethod MergeMethod `json:"merge_method"` + MinEntriesToMerge int `json:"min_entries_to_merge"` + MinEntriesToMergeWaitMinutes int `json:"min_entries_to_merge_wait_minutes"` +} + +// RequiredDeploymentsRuleParameters represents the required deployments rule parameters. +type RequiredDeploymentsRuleParameters struct { + RequiredDeploymentEnvironments []string `json:"required_deployment_environments"` +} + +// PullRequestRuleParameters represents the pull_request rule parameters. +type PullRequestRuleParameters struct { + AllowedMergeMethods []MergeMethod `json:"allowed_merge_methods"` + DismissStaleReviewsOnPush bool `json:"dismiss_stale_reviews_on_push"` + RequireCodeOwnerReview bool `json:"require_code_owner_review"` + RequireLastPushApproval bool `json:"require_last_push_approval"` + RequiredApprovingReviewCount int `json:"required_approving_review_count"` + RequiredReviewThreadResolution bool `json:"required_review_thread_resolution"` +} + +// RequiredStatusChecksRuleParameters represents the required status checks rule parameters. +type RequiredStatusChecksRuleParameters struct { + DoNotEnforceOnCreate *bool `json:"do_not_enforce_on_create,omitempty"` + RequiredStatusChecks []*RuleStatusCheck `json:"required_status_checks"` + StrictRequiredStatusChecksPolicy bool `json:"strict_required_status_checks_policy"` +} + +// RuleStatusCheck represents a status checks for the required status checks rule parameters. +type RuleStatusCheck struct { + Context string `json:"context"` + IntegrationID *int64 `json:"integration_id,omitempty"` +} + +// PatternRuleParameters represents the parameters for a pattern rule. +type PatternRuleParameters struct { + Name *string `json:"name,omitempty"` + // If Negate is true, the rule will fail if the pattern matches. + Negate *bool `json:"negate,omitempty"` + Operator PatternRuleOperator `json:"operator"` + Pattern string `json:"pattern"` +} + +// FilePathRestrictionRuleParameters represents the file path restriction rule parameters. +type FilePathRestrictionRuleParameters struct { + RestrictedFilePaths []string `json:"restricted_file_paths"` +} + +// MaxFilePathLengthRuleParameters represents the max file path length rule parameters. +type MaxFilePathLengthRuleParameters struct { + MaxFilePathLength int `json:"max_file_path_length"` +} + +// FileExtensionRestrictionRuleParameters represents the file extension restriction rule parameters. +type FileExtensionRestrictionRuleParameters struct { + RestrictedFileExtensions []string `json:"restricted_file_extensions"` +} + +// MaxFileSizeRuleParameters represents the max file size rule parameters. +type MaxFileSizeRuleParameters struct { + MaxFileSize int64 `json:"max_file_size"` +} + +// WorkflowsRuleParameters represents the workflows rule parameters. +type WorkflowsRuleParameters struct { + DoNotEnforceOnCreate *bool `json:"do_not_enforce_on_create,omitempty"` + Workflows []*RuleWorkflow `json:"workflows"` +} + +// RuleWorkflow represents a Workflow for the workflows rule parameters. +type RuleWorkflow struct { + Path string `json:"path"` + Ref *string `json:"ref,omitempty"` + RepositoryID *int64 `json:"repository_id,omitempty"` + SHA *string `json:"sha,omitempty"` +} + +// CodeScanningRuleParameters represents the code scanning rule parameters. +type CodeScanningRuleParameters struct { + CodeScanningTools []*RuleCodeScanningTool `json:"code_scanning_tools"` +} + +// RuleCodeScanningTool represents a single code scanning tool for the code scanning parameters. +type RuleCodeScanningTool struct { + AlertsThreshold CodeScanningAlertsThreshold `json:"alerts_threshold"` + SecurityAlertsThreshold CodeScanningSecurityAlertsThreshold `json:"security_alerts_threshold"` + Tool string `json:"tool"` +} + +// repositoryRulesetRuleWrapper is a helper type to marshal & unmarshal a ruleset rule. +type repositoryRulesetRuleWrapper struct { + Type RepositoryRuleType `json:"type"` + Parameters json.RawMessage `json:"parameters,omitempty"` +} + +// MarshalJSON is a custom JSON marshaler for RulesetRules. +func (r *RepositoryRulesetRules) MarshalJSON() ([]byte, error) { + // The RepositoryRulesetRules type marshals to between 1 and 21 rules. + // If new rules are added to RepositoryRulesetRules the capacity below needs increasing + rawRules := make([]json.RawMessage, 0, 21) + + if r.Creation != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeCreation, r.Creation) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.Update != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeUpdate, r.Update) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.Deletion != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeDeletion, r.Deletion) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.RequiredLinearHistory != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeRequiredLinearHistory, r.RequiredLinearHistory) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.MergeQueue != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeMergeQueue, r.MergeQueue) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.RequiredDeployments != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeRequiredDeployments, r.RequiredDeployments) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.RequiredSignatures != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeRequiredSignatures, r.RequiredSignatures) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.PullRequest != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypePullRequest, r.PullRequest) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.RequiredStatusChecks != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeRequiredStatusChecks, r.RequiredStatusChecks) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.NonFastForward != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeNonFastForward, r.NonFastForward) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.CommitMessagePattern != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeCommitMessagePattern, r.CommitMessagePattern) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.CommitAuthorEmailPattern != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeCommitAuthorEmailPattern, r.CommitAuthorEmailPattern) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.CommitterEmailPattern != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeCommitterEmailPattern, r.CommitterEmailPattern) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.BranchNamePattern != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeBranchNamePattern, r.BranchNamePattern) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.TagNamePattern != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeTagNamePattern, r.TagNamePattern) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.FilePathRestriction != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeFilePathRestriction, r.FilePathRestriction) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.MaxFilePathLength != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeMaxFilePathLength, r.MaxFilePathLength) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.FileExtensionRestriction != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeFileExtensionRestriction, r.FileExtensionRestriction) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.MaxFileSize != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeMaxFileSize, r.MaxFileSize) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.Workflows != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeWorkflows, r.Workflows) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.CodeScanning != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeCodeScanning, r.CodeScanning) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + return json.Marshal(rawRules) +} + +// marshalRepositoryRulesetRule is a helper function to marshal a ruleset rule. +// +// TODO: Benchmark the code that uses reflection. +// TODO: Use a generator here instead of reflection if there is a significant performance hit. +func marshalRepositoryRulesetRule[T any](t RepositoryRuleType, params T) ([]byte, error) { + paramsType := reflect.TypeFor[T]() + + if paramsType.Kind() == reflect.Pointer && (reflect.ValueOf(params).IsNil() || reflect.ValueOf(params).Elem().IsZero()) { + return json.Marshal(repositoryRulesetRuleWrapper{Type: t}) + } + + bytes, err := json.Marshal(params) + if err != nil { + return nil, err + } + + return json.Marshal(repositoryRulesetRuleWrapper{Type: t, Parameters: json.RawMessage(bytes)}) +} + +// UnmarshalJSON is a custom JSON unmarshaler for RulesetRules. +func (r *RepositoryRulesetRules) UnmarshalJSON(data []byte) error { + var wrappers []*repositoryRulesetRuleWrapper + + if err := json.Unmarshal(data, &wrappers); err != nil { + return err + } + + for _, w := range wrappers { + switch w.Type { + case RulesetRuleTypeCreation: + r.Creation = &EmptyRuleParameters{} + case RulesetRuleTypeUpdate: + r.Update = &UpdateRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, r.Update); err != nil { + return err + } + } + case RulesetRuleTypeDeletion: + r.Deletion = &EmptyRuleParameters{} + case RulesetRuleTypeRequiredLinearHistory: + r.RequiredLinearHistory = &EmptyRuleParameters{} + case RulesetRuleTypeMergeQueue: + r.MergeQueue = &MergeQueueRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, r.MergeQueue); err != nil { + return err + } + } + case RulesetRuleTypeRequiredDeployments: + r.RequiredDeployments = &RequiredDeploymentsRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, r.RequiredDeployments); err != nil { + return err + } + } + case RulesetRuleTypeRequiredSignatures: + r.RequiredSignatures = &EmptyRuleParameters{} + case RulesetRuleTypePullRequest: + r.PullRequest = &PullRequestRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, r.PullRequest); err != nil { + return err + } + } + case RulesetRuleTypeRequiredStatusChecks: + r.RequiredStatusChecks = &RequiredStatusChecksRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, r.RequiredStatusChecks); err != nil { + return err + } + } + case RulesetRuleTypeNonFastForward: + r.NonFastForward = &EmptyRuleParameters{} + case RulesetRuleTypeCommitMessagePattern: + r.CommitMessagePattern = &PatternRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, r.CommitMessagePattern); err != nil { + return err + } + } + case RulesetRuleTypeCommitAuthorEmailPattern: + r.CommitAuthorEmailPattern = &PatternRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, r.CommitAuthorEmailPattern); err != nil { + return err + } + } + case RulesetRuleTypeCommitterEmailPattern: + r.CommitterEmailPattern = &PatternRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, r.CommitterEmailPattern); err != nil { + return err + } + } + case RulesetRuleTypeBranchNamePattern: + r.BranchNamePattern = &PatternRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, r.BranchNamePattern); err != nil { + return err + } + } + case RulesetRuleTypeTagNamePattern: + r.TagNamePattern = &PatternRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, r.TagNamePattern); err != nil { + return err + } + } + case RulesetRuleTypeFilePathRestriction: + r.FilePathRestriction = &FilePathRestrictionRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, r.FilePathRestriction); err != nil { + return err + } + } + case RulesetRuleTypeMaxFilePathLength: + r.MaxFilePathLength = &MaxFilePathLengthRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, r.MaxFilePathLength); err != nil { + return err + } + } + case RulesetRuleTypeFileExtensionRestriction: + r.FileExtensionRestriction = &FileExtensionRestrictionRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, r.FileExtensionRestriction); err != nil { + return err + } + } + case RulesetRuleTypeMaxFileSize: + r.MaxFileSize = &MaxFileSizeRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, r.MaxFileSize); err != nil { + return err + } + } + case RulesetRuleTypeWorkflows: + r.Workflows = &WorkflowsRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, r.Workflows); err != nil { + return err + } + } + case RulesetRuleTypeCodeScanning: + r.CodeScanning = &CodeScanningRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, r.CodeScanning); err != nil { + return err + } + } + } + } + + return nil +} + +// branchRuleWrapper is a helper type to unmarshal a branch rule. +type branchRuleWrapper struct { + Type RepositoryRuleType `json:"type"` + BranchRuleMetadata + Parameters json.RawMessage `json:"parameters,omitempty"` +} + +// UnmarshalJSON is a custom JSON unmarshaler for BranchRules. +func (r *BranchRules) UnmarshalJSON(data []byte) error { + var wrappers []*branchRuleWrapper + + if err := json.Unmarshal(data, &wrappers); err != nil { + return err + } + + for _, w := range wrappers { + switch w.Type { + case RulesetRuleTypeCreation: + r.Creation = append(r.Creation, &BranchRuleMetadata{RulesetSourceType: w.RulesetSourceType, RulesetSource: w.RulesetSource, RulesetID: w.RulesetID}) + case RulesetRuleTypeUpdate: + params := &UpdateRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, params); err != nil { + return err + } + } + + r.Update = append(r.Update, &UpdateBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params}) + case RulesetRuleTypeDeletion: + r.Deletion = append(r.Deletion, &BranchRuleMetadata{RulesetSourceType: w.RulesetSourceType, RulesetSource: w.RulesetSource, RulesetID: w.RulesetID}) + case RulesetRuleTypeRequiredLinearHistory: + r.RequiredLinearHistory = append(r.RequiredLinearHistory, &BranchRuleMetadata{RulesetSourceType: w.RulesetSourceType, RulesetSource: w.RulesetSource, RulesetID: w.RulesetID}) + case RulesetRuleTypeMergeQueue: + params := &MergeQueueRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, params); err != nil { + return err + } + } + + r.MergeQueue = append(r.MergeQueue, &MergeQueueBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params}) + case RulesetRuleTypeRequiredDeployments: + params := &RequiredDeploymentsRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, params); err != nil { + return err + } + } + + r.RequiredDeployments = append(r.RequiredDeployments, &RequiredDeploymentsBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params}) + case RulesetRuleTypeRequiredSignatures: + r.RequiredSignatures = append(r.RequiredSignatures, &BranchRuleMetadata{RulesetSourceType: w.RulesetSourceType, RulesetSource: w.RulesetSource, RulesetID: w.RulesetID}) + case RulesetRuleTypePullRequest: + params := &PullRequestRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, params); err != nil { + return err + } + } + + r.PullRequest = append(r.PullRequest, &PullRequestBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params}) + case RulesetRuleTypeRequiredStatusChecks: + params := &RequiredStatusChecksRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, params); err != nil { + return err + } + } + + r.RequiredStatusChecks = append(r.RequiredStatusChecks, &RequiredStatusChecksBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params}) + case RulesetRuleTypeNonFastForward: + r.NonFastForward = append(r.NonFastForward, &BranchRuleMetadata{RulesetSourceType: w.RulesetSourceType, RulesetSource: w.RulesetSource, RulesetID: w.RulesetID}) + case RulesetRuleTypeCommitMessagePattern: + params := &PatternRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, params); err != nil { + return err + } + } + + r.CommitMessagePattern = append(r.CommitMessagePattern, &PatternBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params}) + case RulesetRuleTypeCommitAuthorEmailPattern: + params := &PatternRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, params); err != nil { + return err + } + } + + r.CommitAuthorEmailPattern = append(r.CommitAuthorEmailPattern, &PatternBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params}) + case RulesetRuleTypeCommitterEmailPattern: + params := &PatternRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, params); err != nil { + return err + } + } + + r.CommitterEmailPattern = append(r.CommitterEmailPattern, &PatternBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params}) + case RulesetRuleTypeBranchNamePattern: + params := &PatternRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, params); err != nil { + return err + } + } + + r.BranchNamePattern = append(r.BranchNamePattern, &PatternBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params}) + case RulesetRuleTypeTagNamePattern: + params := &PatternRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, params); err != nil { + return err + } + } + + r.TagNamePattern = append(r.TagNamePattern, &PatternBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params}) + case RulesetRuleTypeFilePathRestriction: + params := &FilePathRestrictionRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, params); err != nil { + return err + } + } + + r.FilePathRestriction = append(r.FilePathRestriction, &FilePathRestrictionBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params}) + case RulesetRuleTypeMaxFilePathLength: + params := &MaxFilePathLengthRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, params); err != nil { + return err + } + } + + r.MaxFilePathLength = append(r.MaxFilePathLength, &MaxFilePathLengthBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params}) + case RulesetRuleTypeFileExtensionRestriction: + params := &FileExtensionRestrictionRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, params); err != nil { + return err + } + } + + r.FileExtensionRestriction = append(r.FileExtensionRestriction, &FileExtensionRestrictionBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params}) + case RulesetRuleTypeMaxFileSize: + params := &MaxFileSizeRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, params); err != nil { + return err + } + } + + r.MaxFileSize = append(r.MaxFileSize, &MaxFileSizeBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params}) + case RulesetRuleTypeWorkflows: + params := &WorkflowsRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, params); err != nil { + return err + } + } + + r.Workflows = append(r.Workflows, &WorkflowsBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params}) + case RulesetRuleTypeCodeScanning: + params := &CodeScanningRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, params); err != nil { + return err + } + } + + r.CodeScanning = append(r.CodeScanning, &CodeScanningBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params}) + } + } + + return nil +} + +// UnmarshalJSON is a custom JSON unmarshaler for RulesetRule. +func (r *RepositoryRule) UnmarshalJSON(data []byte) error { + w := repositoryRulesetRuleWrapper{} + + if err := json.Unmarshal(data, &w); err != nil { + return err + } + + r.Type = w.Type + + switch r.Type { + case RulesetRuleTypeCreation: + r.Parameters = nil + case RulesetRuleTypeUpdate: + p := &UpdateRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, p); err != nil { + return err + } + } + + r.Parameters = p + case RulesetRuleTypeDeletion: + r.Parameters = nil + case RulesetRuleTypeRequiredLinearHistory: + r.Parameters = nil + case RulesetRuleTypeMergeQueue: + p := &MergeQueueRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, p); err != nil { + return err + } + } + + r.Parameters = p + case RulesetRuleTypeRequiredDeployments: + p := &RequiredDeploymentsRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, p); err != nil { + return err + } + } + + r.Parameters = p + case RulesetRuleTypeRequiredSignatures: + r.Parameters = nil + case RulesetRuleTypePullRequest: + p := &PullRequestRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, p); err != nil { + return err + } + } + + r.Parameters = p + case RulesetRuleTypeRequiredStatusChecks: + p := &RequiredStatusChecksRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, p); err != nil { + return err + } + } + + r.Parameters = p + case RulesetRuleTypeNonFastForward: + r.Parameters = nil + case RulesetRuleTypeCommitMessagePattern: + p := &PatternRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, p); err != nil { + return err + } + } + + r.Parameters = p + case RulesetRuleTypeCommitAuthorEmailPattern: + p := &PatternRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, p); err != nil { + return err + } + } + + r.Parameters = p + case RulesetRuleTypeCommitterEmailPattern: + p := &PatternRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, p); err != nil { + return err + } + } + + r.Parameters = p + case RulesetRuleTypeBranchNamePattern: + p := &PatternRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, p); err != nil { + return err + } + } + + r.Parameters = p + case RulesetRuleTypeTagNamePattern: + p := &PatternRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, p); err != nil { + return err + } + } + + r.Parameters = p + case RulesetRuleTypeFilePathRestriction: + p := &FilePathRestrictionRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, p); err != nil { + return err + } + } + + r.Parameters = p + case RulesetRuleTypeMaxFilePathLength: + p := &MaxFilePathLengthRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, p); err != nil { + return err + } + } + + r.Parameters = p + case RulesetRuleTypeFileExtensionRestriction: + p := &FileExtensionRestrictionRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, p); err != nil { + return err + } + } + + r.Parameters = p + case RulesetRuleTypeMaxFileSize: + p := &MaxFileSizeRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, p); err != nil { + return err + } + } + + r.Parameters = p + case RulesetRuleTypeWorkflows: + p := &WorkflowsRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, p); err != nil { + return err + } + } + + r.Parameters = p + case RulesetRuleTypeCodeScanning: + p := &CodeScanningRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, p); err != nil { + return err + } + } + + r.Parameters = p + } + + return nil +} diff --git a/github/rules_test.go b/github/rules_test.go new file mode 100644 index 00000000000..ec58db117df --- /dev/null +++ b/github/rules_test.go @@ -0,0 +1,916 @@ +// Copyright 2025 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 ( + "encoding/json" + "testing" + + "github.com/google/go-cmp/cmp" +) + +func TestRulesetRules(t *testing.T) { + t.Parallel() + tests := []struct { + name string + rules *RepositoryRulesetRules + json string + }{ + {"empty", &RepositoryRulesetRules{}, `[]`}, + { + "single_rule_with_empty_params", + &RepositoryRulesetRules{Creation: &EmptyRuleParameters{}}, + `[{"type":"creation"}]`, + }, + { + "single_rule_with_required_params", + &RepositoryRulesetRules{ + RequiredDeployments: &RequiredDeploymentsRuleParameters{ + RequiredDeploymentEnvironments: []string{"test"}, + }, + }, + `[{"type":"required_deployments","parameters":{"required_deployment_environments":["test"]}}]`, + }, + { + "all_rules_with_required_params", + &RepositoryRulesetRules{ + Creation: &EmptyRuleParameters{}, + Update: &UpdateRuleParameters{}, + Deletion: &EmptyRuleParameters{}, + RequiredLinearHistory: &EmptyRuleParameters{}, + MergeQueue: &MergeQueueRuleParameters{ + CheckResponseTimeoutMinutes: 5, + GroupingStrategy: MergeGroupingStrategyAllGreen, + MaxEntriesToBuild: 10, + MaxEntriesToMerge: 20, + MergeMethod: MergeMethodSquash, + MinEntriesToMerge: 1, + MinEntriesToMergeWaitMinutes: 15, + }, + RequiredDeployments: &RequiredDeploymentsRuleParameters{ + RequiredDeploymentEnvironments: []string{"test1", "test2"}, + }, + RequiredSignatures: &EmptyRuleParameters{}, + PullRequest: &PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{ + MergeMethodSquash, + MergeMethodRebase, + }, + DismissStaleReviewsOnPush: true, + RequireCodeOwnerReview: true, + RequireLastPushApproval: true, + RequiredApprovingReviewCount: 2, + RequiredReviewThreadResolution: true, + }, + RequiredStatusChecks: &RequiredStatusChecksRuleParameters{ + RequiredStatusChecks: []*RuleStatusCheck{ + {Context: "test1"}, + {Context: "test2"}, + }, + StrictRequiredStatusChecksPolicy: true, + }, + NonFastForward: &EmptyRuleParameters{}, + CommitMessagePattern: &PatternRuleParameters{ + Operator: PatternRuleOperatorStartsWith, + Pattern: "test", + }, + CommitAuthorEmailPattern: &PatternRuleParameters{ + Operator: PatternRuleOperatorStartsWith, + Pattern: "test", + }, + CommitterEmailPattern: &PatternRuleParameters{ + Operator: PatternRuleOperatorStartsWith, + Pattern: "test", + }, + BranchNamePattern: &PatternRuleParameters{ + Operator: PatternRuleOperatorStartsWith, + Pattern: "test", + }, + TagNamePattern: &PatternRuleParameters{ + Operator: PatternRuleOperatorStartsWith, + Pattern: "test", + }, + FilePathRestriction: &FilePathRestrictionRuleParameters{ + RestrictedFilePaths: []string{"test1", "test2"}, + }, + MaxFilePathLength: &MaxFilePathLengthRuleParameters{MaxFilePathLength: 512}, + FileExtensionRestriction: &FileExtensionRestrictionRuleParameters{ + RestrictedFileExtensions: []string{".exe", ".pkg"}, + }, + MaxFileSize: &MaxFileSizeRuleParameters{MaxFileSize: 1024}, + Workflows: &WorkflowsRuleParameters{ + Workflows: []*RuleWorkflow{ + {Path: ".github/workflows/test1.yaml"}, + {Path: ".github/workflows/test2.yaml"}, + }, + }, + CodeScanning: &CodeScanningRuleParameters{ + CodeScanningTools: []*RuleCodeScanningTool{ + { + AlertsThreshold: CodeScanningAlertsThresholdAll, + SecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdAll, + Tool: "test", + }, + { + AlertsThreshold: CodeScanningAlertsThresholdNone, + SecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdNone, + Tool: "test", + }, + }, + }, + }, + `[{"type":"creation"},{"type":"update"},{"type":"deletion"},{"type":"required_linear_history"},{"type":"merge_queue","parameters":{"check_response_timeout_minutes":5,"grouping_strategy":"ALLGREEN","max_entries_to_build":10,"max_entries_to_merge":20,"merge_method":"squash","min_entries_to_merge":1,"min_entries_to_merge_wait_minutes":15}},{"type":"required_deployments","parameters":{"required_deployment_environments":["test1","test2"]}},{"type":"required_signatures"},{"type":"pull_request","parameters":{"allowed_merge_methods":["squash","rebase"],"dismiss_stale_reviews_on_push":true,"require_code_owner_review":true,"require_last_push_approval":true,"required_approving_review_count":2,"required_review_thread_resolution":true}},{"type":"required_status_checks","parameters":{"required_status_checks":[{"context":"test1"},{"context":"test2"}],"strict_required_status_checks_policy":true}},{"type":"non_fast_forward"},{"type":"commit_message_pattern","parameters":{"operator":"starts_with","pattern":"test"}},{"type":"commit_author_email_pattern","parameters":{"operator":"starts_with","pattern":"test"}},{"type":"committer_email_pattern","parameters":{"operator":"starts_with","pattern":"test"}},{"type":"branch_name_pattern","parameters":{"operator":"starts_with","pattern":"test"}},{"type":"tag_name_pattern","parameters":{"operator":"starts_with","pattern":"test"}},{"type":"file_path_restriction","parameters":{"restricted_file_paths":["test1","test2"]}},{"type":"max_file_path_length","parameters":{"max_file_path_length":512}},{"type":"file_extension_restriction","parameters":{"restricted_file_extensions":[".exe",".pkg"]}},{"type":"max_file_size","parameters":{"max_file_size":1024}},{"type":"workflows","parameters":{"workflows":[{"path":".github/workflows/test1.yaml"},{"path":".github/workflows/test2.yaml"}]}},{"type":"code_scanning","parameters":{"code_scanning_tools":[{"alerts_threshold":"all","security_alerts_threshold":"all","tool":"test"},{"alerts_threshold":"none","security_alerts_threshold":"none","tool":"test"}]}}]`, + }, + { + "all_rules_with_all_params", + &RepositoryRulesetRules{ + Creation: &EmptyRuleParameters{}, + Update: &UpdateRuleParameters{UpdateAllowsFetchAndMerge: true}, + Deletion: &EmptyRuleParameters{}, + RequiredLinearHistory: &EmptyRuleParameters{}, + MergeQueue: &MergeQueueRuleParameters{ + CheckResponseTimeoutMinutes: 5, + GroupingStrategy: MergeGroupingStrategyAllGreen, + MaxEntriesToBuild: 10, + MaxEntriesToMerge: 20, + MergeMethod: MergeMethodSquash, + MinEntriesToMerge: 1, + MinEntriesToMergeWaitMinutes: 15, + }, + RequiredDeployments: &RequiredDeploymentsRuleParameters{ + RequiredDeploymentEnvironments: []string{"test1", "test2"}, + }, + RequiredSignatures: &EmptyRuleParameters{}, + PullRequest: &PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{ + MergeMethodSquash, + MergeMethodRebase, + }, + DismissStaleReviewsOnPush: true, + RequireCodeOwnerReview: true, + RequireLastPushApproval: true, + RequiredApprovingReviewCount: 2, + RequiredReviewThreadResolution: true, + }, + RequiredStatusChecks: &RequiredStatusChecksRuleParameters{ + DoNotEnforceOnCreate: Ptr(true), + RequiredStatusChecks: []*RuleStatusCheck{ + {Context: "test1", IntegrationID: Ptr(int64(1))}, + {Context: "test2", IntegrationID: Ptr(int64(2))}, + }, + StrictRequiredStatusChecksPolicy: true, + }, + NonFastForward: &EmptyRuleParameters{}, + CommitMessagePattern: &PatternRuleParameters{ + Name: Ptr("cmp"), + Negate: Ptr(false), + Operator: PatternRuleOperatorStartsWith, + Pattern: "test", + }, + CommitAuthorEmailPattern: &PatternRuleParameters{ + Name: Ptr("caep"), + Negate: Ptr(false), + Operator: PatternRuleOperatorStartsWith, + Pattern: "test", + }, + CommitterEmailPattern: &PatternRuleParameters{ + Name: Ptr("cep"), + Negate: Ptr(false), + Operator: PatternRuleOperatorStartsWith, + Pattern: "test", + }, + BranchNamePattern: &PatternRuleParameters{ + Name: Ptr("bp"), + Negate: Ptr(false), + Operator: PatternRuleOperatorStartsWith, + Pattern: "test", + }, + TagNamePattern: &PatternRuleParameters{ + Name: Ptr("tp"), + Negate: Ptr(false), + Operator: PatternRuleOperatorStartsWith, + Pattern: "test", + }, + FilePathRestriction: &FilePathRestrictionRuleParameters{ + RestrictedFilePaths: []string{"test1", "test2"}, + }, + MaxFilePathLength: &MaxFilePathLengthRuleParameters{MaxFilePathLength: 512}, + FileExtensionRestriction: &FileExtensionRestrictionRuleParameters{ + RestrictedFileExtensions: []string{".exe", ".pkg"}, + }, + MaxFileSize: &MaxFileSizeRuleParameters{MaxFileSize: 1024}, + Workflows: &WorkflowsRuleParameters{ + DoNotEnforceOnCreate: Ptr(true), + Workflows: []*RuleWorkflow{ + { + Path: ".github/workflows/test1.yaml", + Ref: Ptr("main"), + RepositoryID: Ptr(int64(1)), + SHA: Ptr("aaaa"), + }, + { + Path: ".github/workflows/test2.yaml", + Ref: Ptr("main"), + RepositoryID: Ptr(int64(2)), + SHA: Ptr("bbbb"), + }, + }, + }, + CodeScanning: &CodeScanningRuleParameters{ + CodeScanningTools: []*RuleCodeScanningTool{ + { + AlertsThreshold: CodeScanningAlertsThresholdAll, + SecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdAll, + Tool: "test", + }, + { + AlertsThreshold: CodeScanningAlertsThresholdNone, + SecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdNone, + Tool: "test", + }, + }, + }, + }, + `[{"type":"creation"},{"type":"update","parameters":{"update_allows_fetch_and_merge":true}},{"type":"deletion"},{"type":"required_linear_history"},{"type":"merge_queue","parameters":{"check_response_timeout_minutes":5,"grouping_strategy":"ALLGREEN","max_entries_to_build":10,"max_entries_to_merge":20,"merge_method":"squash","min_entries_to_merge":1,"min_entries_to_merge_wait_minutes":15}},{"type":"required_deployments","parameters":{"required_deployment_environments":["test1","test2"]}},{"type":"required_signatures"},{"type":"pull_request","parameters":{"allowed_merge_methods":["squash","rebase"],"dismiss_stale_reviews_on_push":true,"require_code_owner_review":true,"require_last_push_approval":true,"required_approving_review_count":2,"required_review_thread_resolution":true}},{"type":"required_status_checks","parameters":{"do_not_enforce_on_create":true,"required_status_checks":[{"context":"test1","integration_id":1},{"context":"test2","integration_id":2}],"strict_required_status_checks_policy":true}},{"type":"non_fast_forward"},{"type":"commit_message_pattern","parameters":{"name":"cmp","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"commit_author_email_pattern","parameters":{"name":"caep","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"committer_email_pattern","parameters":{"name":"cep","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"branch_name_pattern","parameters":{"name":"bp","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"tag_name_pattern","parameters":{"name":"tp","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"file_path_restriction","parameters":{"restricted_file_paths":["test1","test2"]}},{"type":"max_file_path_length","parameters":{"max_file_path_length":512}},{"type":"file_extension_restriction","parameters":{"restricted_file_extensions":[".exe",".pkg"]}},{"type":"max_file_size","parameters":{"max_file_size":1024}},{"type":"workflows","parameters":{"do_not_enforce_on_create":true,"workflows":[{"path":".github/workflows/test1.yaml","ref":"main","repository_id":1,"sha":"aaaa"},{"path":".github/workflows/test2.yaml","ref":"main","repository_id":2,"sha":"bbbb"}]}},{"type":"code_scanning","parameters":{"code_scanning_tools":[{"alerts_threshold":"all","security_alerts_threshold":"all","tool":"test"},{"alerts_threshold":"none","security_alerts_threshold":"none","tool":"test"}]}}]`, + }, + } + + t.Run("MarshalJSON", func(t *testing.T) { + t.Parallel() + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + t.Parallel() + + got, err := json.Marshal(test.rules) + if err != nil { + t.Errorf("Unable to marshal JSON for %#v", test.rules) + } + + if diff := cmp.Diff(test.json, string(got)); diff != "" { + t.Errorf( + "json.Marshal returned:\n%s\nwant:\n%s\ndiff:\n%v", + got, + test.json, + diff, + ) + } + }) + } + }) + + t.Run("UnmarshalJSON", func(t *testing.T) { + t.Parallel() + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + t.Parallel() + + got := &RepositoryRulesetRules{} + err := json.Unmarshal([]byte(test.json), got) + if err != nil { + t.Errorf("Unable to unmarshal JSON %v: %v", test.json, err) + } + + if diff := cmp.Diff(test.rules, got); diff != "" { + t.Errorf( + "json.Unmarshal returned:\n%#v\nwant:\n%#v\ndiff:\n%v", + got, + test.rules, + diff, + ) + } + }) + } + }) +} + +func TestBranchRules(t *testing.T) { + t.Parallel() + tests := []struct { + name string + rules *BranchRules + json string + }{ + {"empty", &BranchRules{}, `[]`}, + { + "single_rule_type_single_rule_empty_params", + &BranchRules{ + Creation: []*BranchRuleMetadata{ + { + RulesetSourceType: RulesetSourceTypeRepository, + RulesetSource: "test/test", + RulesetID: 1, + }, + }, + }, + `[{"type":"creation","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1}]`, + }, + { + "single_rule_type_single_rule_with_params", + &BranchRules{ + Update: []*UpdateBranchRule{ + { + BranchRuleMetadata: BranchRuleMetadata{ + RulesetSourceType: RulesetSourceTypeRepository, + RulesetSource: "test/test", + RulesetID: 1, + }, + Parameters: UpdateRuleParameters{UpdateAllowsFetchAndMerge: true}, + }, + }, + }, + `[{"type":"update","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"update_allows_fetch_and_merge":true}}]`, + }, + { + "all_rule_types_with_all_parameters", + &BranchRules{ + Creation: []*BranchRuleMetadata{ + { + RulesetSourceType: RulesetSourceTypeRepository, + RulesetSource: "test/test", + RulesetID: 1, + }, + }, + Update: []*UpdateBranchRule{ + { + BranchRuleMetadata: BranchRuleMetadata{ + RulesetSourceType: RulesetSourceTypeRepository, + RulesetSource: "test/test", + RulesetID: 1, + }, + Parameters: UpdateRuleParameters{UpdateAllowsFetchAndMerge: true}, + }, + }, + Deletion: []*BranchRuleMetadata{ + { + RulesetSourceType: RulesetSourceTypeRepository, + RulesetSource: "test/test", + RulesetID: 1, + }, + }, + RequiredLinearHistory: []*BranchRuleMetadata{ + { + RulesetSourceType: RulesetSourceTypeRepository, + RulesetSource: "test/test", + RulesetID: 1, + }, + }, + MergeQueue: []*MergeQueueBranchRule{ + { + BranchRuleMetadata: BranchRuleMetadata{ + RulesetSourceType: RulesetSourceTypeRepository, + RulesetSource: "test/test", + RulesetID: 1, + }, + Parameters: MergeQueueRuleParameters{ + CheckResponseTimeoutMinutes: 5, + GroupingStrategy: MergeGroupingStrategyAllGreen, + MaxEntriesToBuild: 10, + MaxEntriesToMerge: 20, + MergeMethod: MergeMethodSquash, + MinEntriesToMerge: 1, + MinEntriesToMergeWaitMinutes: 15, + }, + }, + }, + RequiredDeployments: []*RequiredDeploymentsBranchRule{ + { + BranchRuleMetadata: BranchRuleMetadata{ + RulesetSourceType: RulesetSourceTypeRepository, + RulesetSource: "test/test", + RulesetID: 1, + }, + Parameters: RequiredDeploymentsRuleParameters{ + RequiredDeploymentEnvironments: []string{"test1", "test2"}, + }, + }, + }, + RequiredSignatures: []*BranchRuleMetadata{ + { + RulesetSourceType: RulesetSourceTypeRepository, + RulesetSource: "test/test", + RulesetID: 1, + }, + }, + PullRequest: []*PullRequestBranchRule{ + { + BranchRuleMetadata: BranchRuleMetadata{ + RulesetSourceType: RulesetSourceTypeRepository, + RulesetSource: "test/test", + RulesetID: 1, + }, + Parameters: PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{ + MergeMethodSquash, + MergeMethodRebase, + }, + DismissStaleReviewsOnPush: true, + RequireCodeOwnerReview: true, + RequireLastPushApproval: true, + RequiredApprovingReviewCount: 2, + RequiredReviewThreadResolution: true, + }, + }, + }, + RequiredStatusChecks: []*RequiredStatusChecksBranchRule{ + { + BranchRuleMetadata: BranchRuleMetadata{ + RulesetSourceType: RulesetSourceTypeRepository, + RulesetSource: "test/test", + RulesetID: 1, + }, + Parameters: RequiredStatusChecksRuleParameters{ + DoNotEnforceOnCreate: Ptr(true), + RequiredStatusChecks: []*RuleStatusCheck{ + {Context: "test1", IntegrationID: Ptr(int64(1))}, + {Context: "test2", IntegrationID: Ptr(int64(2))}, + }, + StrictRequiredStatusChecksPolicy: true, + }, + }, + }, + NonFastForward: []*BranchRuleMetadata{ + { + RulesetSourceType: RulesetSourceTypeRepository, + RulesetSource: "test/test", + RulesetID: 1, + }, + }, + CommitMessagePattern: []*PatternBranchRule{ + { + BranchRuleMetadata: BranchRuleMetadata{ + RulesetSourceType: RulesetSourceTypeRepository, + RulesetSource: "test/test", + RulesetID: 1, + }, + Parameters: PatternRuleParameters{ + Name: Ptr("cmp"), + Negate: Ptr(false), + Operator: PatternRuleOperatorStartsWith, + Pattern: "test", + }, + }, + }, + CommitAuthorEmailPattern: []*PatternBranchRule{ + { + BranchRuleMetadata: BranchRuleMetadata{ + RulesetSourceType: RulesetSourceTypeRepository, + RulesetSource: "test/test", + RulesetID: 1, + }, + Parameters: PatternRuleParameters{ + Name: Ptr("caep"), + Negate: Ptr(false), + Operator: PatternRuleOperatorStartsWith, + Pattern: "test", + }, + }, + }, + CommitterEmailPattern: []*PatternBranchRule{ + { + BranchRuleMetadata: BranchRuleMetadata{ + RulesetSourceType: RulesetSourceTypeRepository, + RulesetSource: "test/test", + RulesetID: 1, + }, + Parameters: PatternRuleParameters{ + Name: Ptr("cep"), + Negate: Ptr(false), + Operator: PatternRuleOperatorStartsWith, + Pattern: "test", + }, + }, + }, + BranchNamePattern: []*PatternBranchRule{ + { + BranchRuleMetadata: BranchRuleMetadata{ + RulesetSourceType: RulesetSourceTypeRepository, + RulesetSource: "test/test", + RulesetID: 1, + }, + Parameters: PatternRuleParameters{ + Name: Ptr("bp"), + Negate: Ptr(false), + Operator: PatternRuleOperatorStartsWith, + Pattern: "test", + }, + }, + }, + TagNamePattern: []*PatternBranchRule{ + { + BranchRuleMetadata: BranchRuleMetadata{ + RulesetSourceType: RulesetSourceTypeRepository, + RulesetSource: "test/test", + RulesetID: 1, + }, + Parameters: PatternRuleParameters{ + Name: Ptr("tp"), + Negate: Ptr(false), + Operator: PatternRuleOperatorStartsWith, + Pattern: "test", + }, + }, + }, + FilePathRestriction: []*FilePathRestrictionBranchRule{ + { + BranchRuleMetadata: BranchRuleMetadata{ + RulesetSourceType: RulesetSourceTypeRepository, + RulesetSource: "test/test", + RulesetID: 1, + }, + Parameters: FilePathRestrictionRuleParameters{ + RestrictedFilePaths: []string{"test1", "test2"}, + }, + }, + }, + MaxFilePathLength: []*MaxFilePathLengthBranchRule{ + { + BranchRuleMetadata: BranchRuleMetadata{ + RulesetSourceType: RulesetSourceTypeRepository, + RulesetSource: "test/test", + RulesetID: 1, + }, + Parameters: MaxFilePathLengthRuleParameters{MaxFilePathLength: 512}, + }, + }, + FileExtensionRestriction: []*FileExtensionRestrictionBranchRule{ + { + BranchRuleMetadata: BranchRuleMetadata{ + RulesetSourceType: RulesetSourceTypeRepository, + RulesetSource: "test/test", + RulesetID: 1, + }, + Parameters: FileExtensionRestrictionRuleParameters{ + RestrictedFileExtensions: []string{".exe", ".pkg"}, + }, + }, + }, + MaxFileSize: []*MaxFileSizeBranchRule{ + { + BranchRuleMetadata: BranchRuleMetadata{ + RulesetSourceType: RulesetSourceTypeRepository, + RulesetSource: "test/test", + RulesetID: 1, + }, + Parameters: MaxFileSizeRuleParameters{MaxFileSize: 1024}, + }, + }, + Workflows: []*WorkflowsBranchRule{ + { + BranchRuleMetadata: BranchRuleMetadata{ + RulesetSourceType: RulesetSourceTypeRepository, + RulesetSource: "test/test", + RulesetID: 1, + }, + Parameters: WorkflowsRuleParameters{ + DoNotEnforceOnCreate: Ptr(true), + Workflows: []*RuleWorkflow{ + { + Path: ".github/workflows/test1.yaml", + Ref: Ptr("main"), + RepositoryID: Ptr(int64(1)), + SHA: Ptr("aaaa"), + }, + { + Path: ".github/workflows/test2.yaml", + Ref: Ptr("main"), + RepositoryID: Ptr(int64(2)), + SHA: Ptr("bbbb"), + }, + }, + }, + }, + }, + CodeScanning: []*CodeScanningBranchRule{ + { + BranchRuleMetadata: BranchRuleMetadata{ + RulesetSourceType: RulesetSourceTypeRepository, + RulesetSource: "test/test", + RulesetID: 1, + }, + Parameters: CodeScanningRuleParameters{ + CodeScanningTools: []*RuleCodeScanningTool{ + { + AlertsThreshold: CodeScanningAlertsThresholdAll, + SecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdAll, + Tool: "test", + }, + { + AlertsThreshold: CodeScanningAlertsThresholdNone, + SecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdNone, + Tool: "test", + }, + }, + }, + }, + }, + }, + `[{"type":"creation","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1},{"type":"update","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"update_allows_fetch_and_merge":true}},{"type":"deletion","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1},{"type":"required_linear_history","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1},{"type":"merge_queue","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"check_response_timeout_minutes":5,"grouping_strategy":"ALLGREEN","max_entries_to_build":10,"max_entries_to_merge":20,"merge_method":"squash","min_entries_to_merge":1,"min_entries_to_merge_wait_minutes":15}},{"type":"required_deployments","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"required_deployment_environments":["test1","test2"]}},{"type":"required_signatures","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1},{"type":"pull_request","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"allowed_merge_methods":["squash","rebase"],"dismiss_stale_reviews_on_push":true,"require_code_owner_review":true,"require_last_push_approval":true,"required_approving_review_count":2,"required_review_thread_resolution":true}},{"type":"required_status_checks","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"do_not_enforce_on_create":true,"required_status_checks":[{"context":"test1","integration_id":1},{"context":"test2","integration_id":2}],"strict_required_status_checks_policy":true}},{"type":"non_fast_forward","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1},{"type":"commit_message_pattern","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"name":"cmp","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"commit_author_email_pattern","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"name":"caep","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"committer_email_pattern","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"name":"cep","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"branch_name_pattern","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"name":"bp","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"tag_name_pattern","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"name":"tp","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"file_path_restriction","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"restricted_file_paths":["test1","test2"]}},{"type":"max_file_path_length","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"max_file_path_length":512}},{"type":"file_extension_restriction","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"restricted_file_extensions":[".exe",".pkg"]}},{"type":"max_file_size","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"max_file_size":1024}},{"type":"workflows","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"do_not_enforce_on_create":true,"workflows":[{"path":".github/workflows/test1.yaml","ref":"main","repository_id":1,"sha":"aaaa"},{"path":".github/workflows/test2.yaml","ref":"main","repository_id":2,"sha":"bbbb"}]}},{"type":"code_scanning","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"code_scanning_tools":[{"alerts_threshold":"all","security_alerts_threshold":"all","tool":"test"},{"alerts_threshold":"none","security_alerts_threshold":"none","tool":"test"}]}}]`, + }, + } + + t.Run("UnmarshalJSON", func(t *testing.T) { + t.Parallel() + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + t.Parallel() + + got := &BranchRules{} + err := json.Unmarshal([]byte(test.json), got) + if err != nil { + t.Errorf("Unable to unmarshal JSON %v: %v", test.json, err) + } + + if diff := cmp.Diff(test.rules, got); diff != "" { + t.Errorf( + "json.Unmarshal returned:\n%#v\nwant:\n%#v\ndiff:\n%v", + got, + test.rules, + diff, + ) + } + }) + } + }) +} + +func TestRepositoryRule(t *testing.T) { + t.Parallel() + tests := []struct { + name string + rule *RepositoryRule + json string + }{ + { + "empty", + &RepositoryRule{}, + `{}`, + }, + { + "creation", + &RepositoryRule{Type: RulesetRuleTypeCreation, Parameters: nil}, + `{"type":"creation"}`, + }, + { + "update", + &RepositoryRule{Type: RulesetRuleTypeUpdate, Parameters: &UpdateRuleParameters{}}, + `{"type":"update"}`, + }, + { + "update_params_empty", + &RepositoryRule{Type: RulesetRuleTypeUpdate, Parameters: &UpdateRuleParameters{}}, + `{"type":"update","parameters":{}}`, + }, + { + "update_params_set", + &RepositoryRule{ + Type: RulesetRuleTypeUpdate, + Parameters: &UpdateRuleParameters{UpdateAllowsFetchAndMerge: true}, + }, + `{"type":"update","parameters":{"update_allows_fetch_and_merge":true}}`, + }, + { + "deletion", + &RepositoryRule{Type: RulesetRuleTypeDeletion, Parameters: nil}, + `{"type":"deletion"}`, + }, + { + "required_linear_history", + &RepositoryRule{Type: RulesetRuleTypeRequiredLinearHistory, Parameters: nil}, + `{"type":"required_linear_history"}`, + }, + { + "merge_queue", + &RepositoryRule{ + Type: RulesetRuleTypeMergeQueue, + Parameters: &MergeQueueRuleParameters{ + CheckResponseTimeoutMinutes: 5, + GroupingStrategy: MergeGroupingStrategyAllGreen, + MaxEntriesToBuild: 10, + MaxEntriesToMerge: 20, + MergeMethod: MergeMethodSquash, + MinEntriesToMerge: 1, + MinEntriesToMergeWaitMinutes: 15, + }, + }, + `{"type":"merge_queue","parameters":{"check_response_timeout_minutes":5,"grouping_strategy":"ALLGREEN","max_entries_to_build":10,"max_entries_to_merge":20,"merge_method":"squash","min_entries_to_merge":1,"min_entries_to_merge_wait_minutes":15}}`, + }, + { + "required_deployments", + &RepositoryRule{ + Type: RulesetRuleTypeRequiredDeployments, + Parameters: &RequiredDeploymentsRuleParameters{ + RequiredDeploymentEnvironments: []string{"test1", "test2"}, + }, + }, + `{"type":"required_deployments","parameters":{"required_deployment_environments":["test1","test2"]}}`, + }, + { + "required_signatures", + &RepositoryRule{Type: RulesetRuleTypeRequiredSignatures, Parameters: nil}, + `{"type":"required_signatures"}`, + }, + { + "pull_request", + &RepositoryRule{ + Type: RulesetRuleTypePullRequest, + Parameters: &PullRequestRuleParameters{ + AllowedMergeMethods: []MergeMethod{ + MergeMethodSquash, + MergeMethodRebase, + }, + DismissStaleReviewsOnPush: true, + RequireCodeOwnerReview: true, + RequireLastPushApproval: true, + RequiredApprovingReviewCount: 2, + RequiredReviewThreadResolution: true, + }, + }, + `{"type":"pull_request","parameters":{"allowed_merge_methods":["squash","rebase"],"dismiss_stale_reviews_on_push":true,"require_code_owner_review":true,"require_last_push_approval":true,"required_approving_review_count":2,"required_review_thread_resolution":true}}`, + }, + { + "required_status_checks", + &RepositoryRule{ + Type: RulesetRuleTypeRequiredStatusChecks, + Parameters: &RequiredStatusChecksRuleParameters{ + RequiredStatusChecks: []*RuleStatusCheck{ + {Context: "test1"}, + {Context: "test2"}, + }, + StrictRequiredStatusChecksPolicy: true, + }, + }, + `{"type":"required_status_checks","parameters":{"required_status_checks":[{"context":"test1"},{"context":"test2"}],"strict_required_status_checks_policy":true}}`, + }, + { + "non_fast_forward", + &RepositoryRule{Type: RulesetRuleTypeNonFastForward, Parameters: nil}, + `{"type":"non_fast_forward"}`, + }, + { + "commit_message_pattern", + &RepositoryRule{ + Type: RulesetRuleTypeCommitMessagePattern, + Parameters: &PatternRuleParameters{ + Name: Ptr("test"), + Negate: Ptr(false), + Operator: PatternRuleOperatorStartsWith, + Pattern: "test", + }, + }, + `{"type":"commit_message_pattern","parameters":{"name":"test","negate":false,"operator":"starts_with","pattern":"test"}}`, + }, + { + "commit_author_email_pattern", + &RepositoryRule{ + Type: RulesetRuleTypeCommitAuthorEmailPattern, + Parameters: &PatternRuleParameters{ + Name: Ptr("test"), + Negate: Ptr(false), + Operator: PatternRuleOperatorStartsWith, + Pattern: "test", + }, + }, + `{"type":"commit_author_email_pattern","parameters":{"name":"test","negate":false,"operator":"starts_with","pattern":"test"}}`, + }, + { + "committer_email_pattern", + &RepositoryRule{ + Type: RulesetRuleTypeCommitterEmailPattern, + Parameters: &PatternRuleParameters{ + Name: Ptr("test"), + Negate: Ptr(false), + Operator: PatternRuleOperatorStartsWith, + Pattern: "test", + }, + }, + `{"type":"committer_email_pattern","parameters":{"name":"test","negate":false,"operator":"starts_with","pattern":"test"}}`, + }, + { + "branch_name_pattern", + &RepositoryRule{ + Type: RulesetRuleTypeBranchNamePattern, + Parameters: &PatternRuleParameters{ + Name: Ptr("test"), + Negate: Ptr(false), + Operator: PatternRuleOperatorStartsWith, + Pattern: "test", + }, + }, + `{"type":"branch_name_pattern","parameters":{"name":"test","negate":false,"operator":"starts_with","pattern":"test"}}`, + }, + { + "tag_name_pattern", + &RepositoryRule{ + Type: RulesetRuleTypeTagNamePattern, + Parameters: &PatternRuleParameters{ + Name: Ptr("test"), + Negate: Ptr(false), + Operator: PatternRuleOperatorStartsWith, + Pattern: "test", + }, + }, + `{"type":"tag_name_pattern","parameters":{"name":"test","negate":false,"operator":"starts_with","pattern":"test"}}`, + }, + { + "file_path_restriction", + &RepositoryRule{ + Type: RulesetRuleTypeFilePathRestriction, + Parameters: &FilePathRestrictionRuleParameters{ + RestrictedFilePaths: []string{"test1", "test2"}, + }, + }, + `{"type":"file_path_restriction","parameters":{"restricted_file_paths":["test1","test2"]}}`, + }, + { + "max_file_path_length", + &RepositoryRule{ + Type: RulesetRuleTypeMaxFilePathLength, + Parameters: &MaxFilePathLengthRuleParameters{MaxFilePathLength: 512}, + }, + `{"type":"max_file_path_length","parameters":{"max_file_path_length":512}}`, + }, + { + "file_extension_restriction", + &RepositoryRule{ + Type: RulesetRuleTypeFileExtensionRestriction, + Parameters: &FileExtensionRestrictionRuleParameters{ + RestrictedFileExtensions: []string{".exe", ".pkg"}, + }, + }, + `{"type":"file_extension_restriction","parameters":{"restricted_file_extensions":[".exe",".pkg"]}}`, + }, + { + "max_file_size", + &RepositoryRule{ + Type: RulesetRuleTypeMaxFileSize, + Parameters: &MaxFileSizeRuleParameters{MaxFileSize: 1024}, + }, + `{"type":"max_file_size","parameters":{"max_file_size":1024}}`, + }, + { + "workflows", + &RepositoryRule{ + Type: RulesetRuleTypeWorkflows, + Parameters: &WorkflowsRuleParameters{ + Workflows: []*RuleWorkflow{ + {Path: ".github/workflows/test1.yaml"}, + {Path: ".github/workflows/test2.yaml"}, + }, + }, + }, + `{"type":"workflows","parameters":{"workflows":[{"path":".github/workflows/test1.yaml"},{"path":".github/workflows/test2.yaml"}]}}`, + }, + { + "code_scanning", + &RepositoryRule{ + Type: RulesetRuleTypeCodeScanning, + Parameters: &CodeScanningRuleParameters{ + CodeScanningTools: []*RuleCodeScanningTool{ + { + AlertsThreshold: CodeScanningAlertsThresholdAll, + SecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdAll, + Tool: "test", + }, + { + AlertsThreshold: CodeScanningAlertsThresholdNone, + SecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdNone, + Tool: "test", + }, + }, + }, + }, + `{"type":"code_scanning","parameters":{"code_scanning_tools":[{"alerts_threshold":"all","security_alerts_threshold":"all","tool":"test"},{"alerts_threshold":"none","security_alerts_threshold":"none","tool":"test"}]}}`, + }, + } + + t.Run("UnmarshalJSON", func(t *testing.T) { + t.Parallel() + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + t.Parallel() + + got := &RepositoryRule{} + err := json.Unmarshal([]byte(test.json), got) + if err != nil { + t.Errorf("Unable to unmarshal JSON %v: %v", test.json, err) + } + + if diff := cmp.Diff(test.rule, got); diff != "" { + t.Errorf( + "json.Unmarshal returned:\n%#v\nwant:\n%#v\ndiff:\n%v", + got, + test.rule, + diff, + ) + } + }) + } + }) +} From 04070d23058126ab7ae3b86e198a96a6c94ad613 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Tue, 21 Jan 2025 20:30:40 -0500 Subject: [PATCH 626/751] Fix minor typo (#3448) --- github/git_tags_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/git_tags_test.go b/github/git_tags_test.go index 0d878dc3ee5..26ee703be02 100644 --- a/github/git_tags_test.go +++ b/github/git_tags_test.go @@ -80,7 +80,7 @@ func TestGitService_CreateTag(t *testing.T) { want := &Tag{Tag: Ptr("t")} if !cmp.Equal(tag, want) { - t.Errorf("Git.GetTag returned %+v, want %+v", tag, want) + t.Errorf("Git.CreateTag returned %+v, want %+v", tag, want) } const methodName = "CreateTag" From 07b0446d8a2c2df126683af8f8673267fcb7ffb7 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Tue, 21 Jan 2025 21:34:14 -0500 Subject: [PATCH 627/751] chore!: Add `sliceofpointers` custom linter (#3447) BREAKING CHANGE: `ListOAuthApps` now returns `([]*OAuthApp, error)` instead of `([]OAuthApp, error)`. --- .custom-gcl.yml | 4 + .gitignore | 3 + .golangci.yml | 30 +++++--- github/codespaces_secrets_test.go | 18 ++--- github/github.go | 3 +- github/strings_test.go | 1 + scrape/apps.go | 6 +- scrape/apps_test.go | 2 +- scrape/forms.go | 4 +- scrape/forms_test.go | 16 ++-- script/lint.sh | 9 ++- tools/sliceofpointers/go.mod | 13 ++++ tools/sliceofpointers/go.sum | 10 +++ tools/sliceofpointers/sliceofpointers.go | 74 +++++++++++++++++++ tools/sliceofpointers/sliceofpointers_test.go | 20 +++++ .../testdata/src/has-warnings/main.go | 21 ++++++ .../testdata/src/no-warnings/main.go | 21 ++++++ 17 files changed, 215 insertions(+), 40 deletions(-) create mode 100644 .custom-gcl.yml create mode 100644 tools/sliceofpointers/go.mod create mode 100644 tools/sliceofpointers/go.sum create mode 100644 tools/sliceofpointers/sliceofpointers.go create mode 100644 tools/sliceofpointers/sliceofpointers_test.go create mode 100644 tools/sliceofpointers/testdata/src/has-warnings/main.go create mode 100644 tools/sliceofpointers/testdata/src/no-warnings/main.go diff --git a/.custom-gcl.yml b/.custom-gcl.yml new file mode 100644 index 00000000000..d3bf8857d00 --- /dev/null +++ b/.custom-gcl.yml @@ -0,0 +1,4 @@ +version: v1.62.0 +plugins: + - module: "github.com/google/go-github/v68/tools/sliceofpointers" + path: ./tools/sliceofpointers diff --git a/.gitignore b/.gitignore index 8e24389445d..b81979c9430 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,6 @@ vendor/ # goenv local version. See https://github.com/syndbg/goenv/blob/master/COMMANDS.md#goenv-local for more info. .go-version + +# golangci-lint -v custom generates the following local file: +custom-gcl diff --git a/.golangci.yml b/.golangci.yml index eae5a3bdd6a..fae768c5a57 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -18,12 +18,18 @@ linters: - perfsprint - paralleltest - revive + - sliceofpointers - stylecheck - tparallel - unconvert - unparam - whitespace linters-settings: + custom: + sliceofpointers: + type: module + description: Reports usage of []*string and slices of structs without pointers. + original-url: github.com/google/go-github/v68/tools/sliceofpointers gocritic: disable-all: true enabled-checks: @@ -38,7 +44,7 @@ linters-settings: misspell: locale: US ignore-words: - - "analyses" # returned by the GitHub API + - "analyses" # returned by the GitHub API - "cancelled" # returned by the GitHub API # extra words from https://go.dev//wiki/Spelling extra-words: @@ -102,28 +108,28 @@ issues: path: _test\.go # We need to pass nil Context in order to test DoBare erroring on nil ctx. - - linters: [ staticcheck ] - text: 'SA1012: do not pass a nil Context' + - linters: [staticcheck] + text: "SA1012: do not pass a nil Context" path: _test\.go # We need to use sha1 for validating signatures - - linters: [ gosec ] - text: 'G505: Blocklisted import crypto/sha1: weak cryptographic primitive' + - linters: [gosec] + text: "G505: Blocklisted import crypto/sha1: weak cryptographic primitive" # This is adapted from golangci-lint's default exclusions. It disables linting for error checks on # os.RemoveAll, fmt.Fprint*, fmt.Scanf, and any function ending in "Close". - - linters: [ errcheck ] + - linters: [errcheck] text: Error return value of .(.*Close|fmt\.Fprint.*|fmt\.Scanf|os\.Remove(All)?). is not checked # We don't care about file inclusion via variable in examples or internal tools. - - linters: [ gosec ] - text: 'G304: Potential file inclusion via variable' + - linters: [gosec] + text: "G304: Potential file inclusion via variable" path: '^(example|tools)\/' # We don't run parallel integration tests - - linters: [ paralleltest, tparallel ] - path: '^test/integration' + - linters: [paralleltest, tparallel] + path: "^test/integration" # Because fmt.Sprint(reset.Unix())) is more readable than strconv.FormatInt(reset.Unix(), 10). - - linters: [ perfsprint] - text: 'fmt.Sprint.* can be replaced with faster strconv.FormatInt' + - linters: [perfsprint] + text: "fmt.Sprint.* can be replaced with faster strconv.FormatInt" diff --git a/github/codespaces_secrets_test.go b/github/codespaces_secrets_test.go index 543e0651def..987cfaab612 100644 --- a/github/codespaces_secrets_test.go +++ b/github/codespaces_secrets_test.go @@ -25,7 +25,7 @@ func TestCodespacesService_ListSecrets(t *testing.T) { methodName string } opts := &ListOptions{Page: 2, PerPage: 2} - tests := []test{ + tests := []*test{ { name: "User", handleFunc: func(mux *http.ServeMux) { @@ -128,7 +128,7 @@ func TestCodespacesService_GetSecret(t *testing.T) { badCall func(context.Context, *Client) (*Secret, *Response, error) methodName string } - tests := []test{ + tests := []*test{ { name: "User", handleFunc: func(mux *http.ServeMux) { @@ -222,7 +222,7 @@ func TestCodespacesService_CreateOrUpdateSecret(t *testing.T) { badCall func(context.Context, *Client, *EncryptedSecret) (*Response, error) methodName string } - tests := []test{ + tests := []*test{ { name: "User", handleFunc: func(mux *http.ServeMux) { @@ -318,7 +318,7 @@ func TestCodespacesService_DeleteSecret(t *testing.T) { badCall func(context.Context, *Client) (*Response, error) methodName string } - tests := []test{ + tests := []*test{ { name: "User", handleFunc: func(mux *http.ServeMux) { @@ -401,7 +401,7 @@ func TestCodespacesService_GetPublicKey(t *testing.T) { methodName string } - tests := []test{ + tests := []*test{ { name: "User", handleFunc: func(mux *http.ServeMux) { @@ -496,7 +496,7 @@ func TestCodespacesService_ListSelectedReposForSecret(t *testing.T) { methodName string } opts := &ListOptions{Page: 2, PerPage: 2} - tests := []test{ + tests := []*test{ { name: "User", handleFunc: func(mux *http.ServeMux) { @@ -581,7 +581,7 @@ func TestCodespacesService_SetSelectedReposForSecret(t *testing.T) { methodName string } ids := SelectedRepoIDs{64780797} - tests := []test{ + tests := []*test{ { name: "User", handleFunc: func(mux *http.ServeMux) { @@ -653,7 +653,7 @@ func TestCodespacesService_AddSelectedReposForSecret(t *testing.T) { methodName string } repo := &Repository{ID: Ptr(int64(1234))} - tests := []test{ + tests := []*test{ { name: "User", handleFunc: func(mux *http.ServeMux) { @@ -721,7 +721,7 @@ func TestCodespacesService_RemoveSelectedReposFromSecret(t *testing.T) { methodName string } repo := &Repository{ID: Ptr(int64(1234))} - tests := []test{ + tests := []*test{ { name: "User", handleFunc: func(mux *http.ServeMux) { diff --git a/github/github.go b/github/github.go index d4ba320aa5d..ab74c5b72da 100644 --- a/github/github.go +++ b/github/github.go @@ -1117,7 +1117,8 @@ GitHub API docs: https://docs.github.com/rest/#client-errors type ErrorResponse struct { Response *http.Response `json:"-"` // HTTP response that caused this error Message string `json:"message"` // error message - Errors []Error `json:"errors"` // more detail on individual errors + //nolint:sliceofpointers + Errors []Error `json:"errors"` // more detail on individual errors // Block is only populated on certain types of errors such as code 451. Block *ErrorBlock `json:"block,omitempty"` // Most errors will also include a documentation_url field pointing diff --git a/github/strings_test.go b/github/strings_test.go index 4d53f21aac6..a164cebcac0 100644 --- a/github/strings_test.go +++ b/github/strings_test.go @@ -49,6 +49,7 @@ func TestStringify(t *testing.T) { {Ptr(123), `123`}, {Ptr(false), `false`}, { + //nolint:sliceofpointers []*string{Ptr("a"), Ptr("b")}, `["a" "b"]`, }, diff --git a/scrape/apps.go b/scrape/apps.go index fe99ea84a03..686cf773800 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -46,13 +46,13 @@ func (c *Client) AppRestrictionsEnabled(org string) (bool, error) { // ListOAuthApps lists the reviewed OAuth Applications for the // specified organization (whether approved or denied). -func (c *Client) ListOAuthApps(org string) ([]OAuthApp, error) { +func (c *Client) ListOAuthApps(org string) ([]*OAuthApp, error) { doc, err := c.get("/organizations/%s/settings/oauth_application_policy", org) if err != nil { return nil, err } - var apps []OAuthApp + var apps []*OAuthApp doc.Find(".oauth-application-allowlist ul > li").Each(func(i int, s *goquery.Selection) { var app OAuthApp app.Name = s.Find(".request-info strong").First().Text() @@ -73,7 +73,7 @@ func (c *Client) ListOAuthApps(org string) ([]OAuthApp, error) { } else if r := s.Find(".request-indicator .denied-request"); r.Length() > 0 { app.State = OAuthAppDenied } - apps = append(apps, app) + apps = append(apps, &app) }) return apps, nil diff --git a/scrape/apps_test.go b/scrape/apps_test.go index ae5b191eed8..7e9688e5efb 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -61,7 +61,7 @@ func Test_ListOAuthApps(t *testing.T) { if err != nil { t.Fatalf("ListOAuthApps(e) returned err: %v", err) } - want := []OAuthApp{ + want := []*OAuthApp{ { ID: 22222, Name: "Coveralls", diff --git a/scrape/forms.go b/scrape/forms.go index 6e01171e155..7beb46cf6e1 100644 --- a/scrape/forms.go +++ b/scrape/forms.go @@ -35,7 +35,7 @@ type htmlForm struct { // // In the future, we might want to allow a custom selector to be passed in to // further restrict what forms will be returned. -func parseForms(node *html.Node) (forms []htmlForm) { +func parseForms(node *html.Node) (forms []*htmlForm) { if node == nil { return nil } @@ -71,7 +71,7 @@ func parseForms(node *html.Node) (forms []htmlForm) { value := s.Text() form.Values.Add(name, value) }) - forms = append(forms, form) + forms = append(forms, &form) }) return forms diff --git a/scrape/forms_test.go b/scrape/forms_test.go index 28c30c6c670..b10f250127d 100644 --- a/scrape/forms_test.go +++ b/scrape/forms_test.go @@ -16,14 +16,14 @@ func Test_ParseForms(t *testing.T) { tests := []struct { description string html string - forms []htmlForm + forms []*htmlForm }{ {"no forms", ``, nil}, - {"empty form", `
    `, []htmlForm{{Values: url.Values{}}}}, + {"empty form", `
    `, []*htmlForm{{Values: url.Values{}}}}, { "single form with one value", `
    `, - []htmlForm{{Action: "a", Method: "m", Values: url.Values{"n1": {"v1"}}}}, + []*htmlForm{{Action: "a", Method: "m", Values: url.Values{"n1": {"v1"}}}}, }, { "two forms", @@ -31,7 +31,7 @@ func Test_ParseForms(t *testing.T) {
    `, - []htmlForm{ + []*htmlForm{ {Action: "a1", Method: "m1", Values: url.Values{"n1": {"v1"}}}, {Action: "a2", Method: "m2", Values: url.Values{"n2": {"v2"}}}, }, @@ -43,7 +43,7 @@ func Test_ParseForms(t *testing.T) { `, - []htmlForm{{Values: url.Values{}}}, + []*htmlForm{{Values: url.Values{}}}, }, { "form with radio buttons", @@ -52,7 +52,7 @@ func Test_ParseForms(t *testing.T) { `, - []htmlForm{{Values: url.Values{"n1": {"v3"}}}}, + []*htmlForm{{Values: url.Values{"n1": {"v3"}}}}, }, { "form with checkboxes", @@ -61,12 +61,12 @@ func Test_ParseForms(t *testing.T) { `, - []htmlForm{{Values: url.Values{"n1": {"v1"}, "n3": {"v3"}}}}, + []*htmlForm{{Values: url.Values{"n1": {"v1"}, "n3": {"v3"}}}}, }, { "single form with textarea", `
    `, - []htmlForm{{Values: url.Values{"n1": {"v1"}}}}, + []*htmlForm{{Values: url.Values{"n1": {"v1"}}}}, }, } diff --git a/script/lint.sh b/script/lint.sh index a52e9bfa2b6..8decafeb7e5 100755 --- a/script/lint.sh +++ b/script/lint.sh @@ -19,9 +19,10 @@ fail() { EXIT_CODE=1 } -# install golangci-lint bin/golangci-lint doesn't exist with the correct version -if ! "$BIN"/golangci-lint --version 2> /dev/null | grep -q "$GOLANGCI_LINT_VERSION"; then +# install golangci-lint and custom-gcl in ./bin if they don't exist with the correct version +if ! "$BIN"/custom-gcl --version 2> /dev/null | grep -q "$GOLANGCI_LINT_VERSION"; then GOBIN="$BIN" go install "github.com/golangci/golangci-lint/cmd/golangci-lint@v$GOLANGCI_LINT_VERSION" + "$BIN"/golangci-lint custom && mv ./custom-gcl "$BIN" fi MOD_DIRS="$(git ls-files '*go.mod' | xargs dirname | sort)" @@ -33,9 +34,9 @@ for dir in $MOD_DIRS; do cd "$dir" # github actions output when running in an action if [ -n "$GITHUB_ACTIONS" ]; then - "$BIN"/golangci-lint run --path-prefix "$dir" --out-format colored-line-number + "$BIN"/custom-gcl run --path-prefix "$dir" --out-format colored-line-number else - "$BIN"/golangci-lint run --path-prefix "$dir" + "$BIN"/custom-gcl run --path-prefix "$dir" fi ) || fail "failed linting $dir" done diff --git a/tools/sliceofpointers/go.mod b/tools/sliceofpointers/go.mod new file mode 100644 index 00000000000..759fa734d9e --- /dev/null +++ b/tools/sliceofpointers/go.mod @@ -0,0 +1,13 @@ +module tools/sliceofpointers + +go 1.22.0 + +require ( + github.com/golangci/plugin-module-register v0.1.1 + golang.org/x/tools v0.29.0 +) + +require ( + golang.org/x/mod v0.22.0 // indirect + golang.org/x/sync v0.10.0 // indirect +) diff --git a/tools/sliceofpointers/go.sum b/tools/sliceofpointers/go.sum new file mode 100644 index 00000000000..c2f7392bb23 --- /dev/null +++ b/tools/sliceofpointers/go.sum @@ -0,0 +1,10 @@ +github.com/golangci/plugin-module-register v0.1.1 h1:TCmesur25LnyJkpsVrupv1Cdzo+2f7zX0H6Jkw1Ol6c= +github.com/golangci/plugin-module-register v0.1.1/go.mod h1:TTpqoB6KkwOJMV8u7+NyXMrkwwESJLOkfl9TxR1DGFc= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= +golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/tools v0.29.0 h1:Xx0h3TtM9rzQpQuR4dKLrdglAmCEN5Oi+P74JdhdzXE= +golang.org/x/tools v0.29.0/go.mod h1:KMQVMRsVxU6nHCFXrBPhDB8XncLNLM0lIy/F14RP588= diff --git a/tools/sliceofpointers/sliceofpointers.go b/tools/sliceofpointers/sliceofpointers.go new file mode 100644 index 00000000000..d6a59b38f28 --- /dev/null +++ b/tools/sliceofpointers/sliceofpointers.go @@ -0,0 +1,74 @@ +// Copyright 2025 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 sliceofpointers is a custom linter to be used by +// golangci-lint to find instances of `[]*string` and +// slices of structs without pointers and report them. +// See: https://github.com/google/go-github/issues/180 +package sliceofpointers + +import ( + "go/ast" + "go/token" + + "github.com/golangci/plugin-module-register/register" + "golang.org/x/tools/go/analysis" +) + +func init() { + register.Plugin("sliceofpointers", New) +} + +type SliceOfPointersPlugin struct{} + +// New returns an analysis.Analyzer to use with golangci-lint. +func New(settings any) (register.LinterPlugin, error) { + return &SliceOfPointersPlugin{}, nil +} + +func (f *SliceOfPointersPlugin) BuildAnalyzers() ([]*analysis.Analyzer, error) { + return []*analysis.Analyzer{ + { + Name: "sliceofpointers", + Doc: "Reports usage of []*string and slices of structs without pointers.", + Run: run, + }, + }, nil +} + +func (f *SliceOfPointersPlugin) GetLoadMode() string { + return register.LoadModeSyntax +} + +func run(pass *analysis.Pass) (interface{}, error) { + for _, file := range pass.Files { + ast.Inspect(file, func(n ast.Node) bool { + if n == nil { + return false + } + + switch t := n.(type) { + case *ast.ArrayType: + checkArrayType(t, t.Pos(), pass) + } + + return true + }) + } + return nil, nil +} + +func checkArrayType(arrType *ast.ArrayType, tokenPos token.Pos, pass *analysis.Pass) { + if starExpr, ok := arrType.Elt.(*ast.StarExpr); ok { + if ident, ok := starExpr.X.(*ast.Ident); ok && ident.Name == "string" { + const msg = "use []string instead of []*string" + pass.Reportf(tokenPos, msg) + } + } else if ident, ok := arrType.Elt.(*ast.Ident); ok && ident.Obj != nil { + if _, ok := ident.Obj.Decl.(*ast.TypeSpec).Type.(*ast.StructType); ok { + pass.Reportf(tokenPos, "use []*%v instead of []%[1]v", ident.Name) + } + } +} diff --git a/tools/sliceofpointers/sliceofpointers_test.go b/tools/sliceofpointers/sliceofpointers_test.go new file mode 100644 index 00000000000..8fb0787f022 --- /dev/null +++ b/tools/sliceofpointers/sliceofpointers_test.go @@ -0,0 +1,20 @@ +// Copyright 2025 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 sliceofpointers + +import ( + "testing" + + "golang.org/x/tools/go/analysis/analysistest" +) + +func TestRun(t *testing.T) { + t.Parallel() + testdata := analysistest.TestData() + plugin, _ := New(nil) + analyzers, _ := plugin.BuildAnalyzers() + analysistest.Run(t, testdata, analyzers[0], "has-warnings", "no-warnings") +} diff --git a/tools/sliceofpointers/testdata/src/has-warnings/main.go b/tools/sliceofpointers/testdata/src/has-warnings/main.go new file mode 100644 index 00000000000..84e0d024e4b --- /dev/null +++ b/tools/sliceofpointers/testdata/src/has-warnings/main.go @@ -0,0 +1,21 @@ +// Copyright 2025 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 main + +type Example struct { + Strings []*string `json:"strings,omitempty"` // want `use \[\]string instead of \[\]\*string` + Things []Thing `json:"things,omitempty"` // want `use \[\]\*Thing instead of \[\]Thing` +} + +type Thing struct { +} + +func main() { + slice1 := []*string{} // want `use \[\]string instead of \[\]\*string` + _ = slice1 + slice2 := []Thing{} // want `use \[\]\*Thing instead of \[\]Thing` + _ = slice2 +} diff --git a/tools/sliceofpointers/testdata/src/no-warnings/main.go b/tools/sliceofpointers/testdata/src/no-warnings/main.go new file mode 100644 index 00000000000..529d1d2fdad --- /dev/null +++ b/tools/sliceofpointers/testdata/src/no-warnings/main.go @@ -0,0 +1,21 @@ +// Copyright 2025 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 main + +type Example struct { + Strings []string `json:"strings,omitempty"` // Should not be flagged + Things []*Thing `json:"things,omitempty"` // Should not be flagged +} + +type Thing struct { +} + +func main() { + slice1 := []string{} // Should not be flagged + _ = slice1 + slice2 := []*Thing{} // Should not be flagged + _ = slice2 +} From fb972ef2144ec999bb5e1854e18edd7710b2fd72 Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Thu, 23 Jan 2025 04:25:06 +0100 Subject: [PATCH 628/751] chore: Check and fix license headers (#3449) --- .golangci.yml | 12 +++++++++++- github/admin_stats_test.go | 5 +++++ github/enterprise_audit_log_test.go | 2 +- github/gists.go | 2 +- github/orgs_audit_log_test.go | 2 +- github/pulls_reviewers.go | 7 ++----- scrape/apps_test.go | 5 +++++ scrape/example/scrape/main.go | 5 +++++ scrape/forms_test.go | 5 +++++ scrape/scrape_test.go | 5 +++++ 10 files changed, 41 insertions(+), 9 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index fae768c5a57..5c5646983aa 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -11,12 +11,13 @@ linters: - gocritic - godot - gofmt + - goheader - goimports - gosec - misspell - nakedret - - perfsprint - paralleltest + - perfsprint - revive - sliceofpointers - stylecheck @@ -35,6 +36,15 @@ linters-settings: enabled-checks: - commentedOutCode - commentFormatting + goheader: + values: + regexp: + CopyrightDate: "Copyright \\d{4} " + template: |- + {{CopyrightDate}}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. gosec: excludes: # duplicates errcheck diff --git a/github/admin_stats_test.go b/github/admin_stats_test.go index 63e428bb5fd..2f4ca3ac012 100644 --- a/github/admin_stats_test.go +++ b/github/admin_stats_test.go @@ -1,3 +1,8 @@ +// Copyright 2017 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 ( diff --git a/github/enterprise_audit_log_test.go b/github/enterprise_audit_log_test.go index 08ecd23c996..bc2369090fb 100644 --- a/github/enterprise_audit_log_test.go +++ b/github/enterprise_audit_log_test.go @@ -1,6 +1,6 @@ // Copyright 2021 The go-github AUTHORS. All rights reserved. // -// `Use` of this source code is governed by a BSD-style +// Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package github diff --git a/github/gists.go b/github/gists.go index 08180c6d301..ee4314b986e 100644 --- a/github/gists.go +++ b/github/gists.go @@ -1,6 +1,6 @@ // Copyright 2013 The go-github AUTHORS. All rights reserved. // -// Use of this source code is governed by BSD-style +// Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package github diff --git a/github/orgs_audit_log_test.go b/github/orgs_audit_log_test.go index 3a6cacef45b..f4b617c587b 100644 --- a/github/orgs_audit_log_test.go +++ b/github/orgs_audit_log_test.go @@ -1,6 +1,6 @@ // Copyright 2021 The go-github AUTHORS. All rights reserved. // -// `Use` of this source code is governed by a BSD-style +// Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package github diff --git a/github/pulls_reviewers.go b/github/pulls_reviewers.go index 9dd60ae6888..526047937e3 100644 --- a/github/pulls_reviewers.go +++ b/github/pulls_reviewers.go @@ -85,11 +85,8 @@ func (s *PullRequestsService) ListReviewers(ctx context.Context, owner, repo str func (s *PullRequestsService) RemoveReviewers(ctx context.Context, owner, repo string, number int, reviewers ReviewersRequest) (*Response, error) { // reviewers.Reviewers may be empty if the caller wants to remove teams, but not users. Unlike AddReviewers, // "reviewers" is a required param here. Reference: https://github.com/google/go-github/issues/3336 - removeRequest := removeReviewersRequest{ - NodeID: reviewers.NodeID, - Reviewers: reviewers.Reviewers, - TeamReviewers: reviewers.TeamReviewers, - } + // The type `removeReviewersRequest` is required because the struct tags are different from `ReviewersRequest`. + removeRequest := removeReviewersRequest(reviewers) if removeRequest.Reviewers == nil { // GitHub accepts the empty list, but rejects null. Removing `omitempty` is not enough - we also have to promote nil to []. diff --git a/scrape/apps_test.go b/scrape/apps_test.go index 7e9688e5efb..31db5cc504a 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -1,3 +1,8 @@ +// Copyright 2013 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 scrape import ( diff --git a/scrape/example/scrape/main.go b/scrape/example/scrape/main.go index a55b88eb366..febf07cd854 100644 --- a/scrape/example/scrape/main.go +++ b/scrape/example/scrape/main.go @@ -1,3 +1,8 @@ +// Copyright 2019 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 scrape tool demonstrates use of the github.com/google/go-github/scrape // package to fetch data from GitHub. The tool lists whether third-party app // restrictions are enabled for an organization, and lists information about diff --git a/scrape/forms_test.go b/scrape/forms_test.go index b10f250127d..0b7a9f9ef1c 100644 --- a/scrape/forms_test.go +++ b/scrape/forms_test.go @@ -1,3 +1,8 @@ +// Copyright 2013 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 scrape import ( diff --git a/scrape/scrape_test.go b/scrape/scrape_test.go index c31bb8337cd..ca0452374d8 100644 --- a/scrape/scrape_test.go +++ b/scrape/scrape_test.go @@ -1,3 +1,8 @@ +// Copyright 2013 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 scrape import ( From 8a800cc0ee51ac2a55ce5af75e681e3382933e03 Mon Sep 17 00:00:00 2001 From: Carlos Tadeu Panato Junior Date: Fri, 24 Jan 2025 14:41:56 +0100 Subject: [PATCH 629/751] Add new fields for IssueType (#3451) --- github/github-accessors.go | 64 +++++++++++++++++++++++++ github/github-accessors_test.go | 85 +++++++++++++++++++++++++++++++++ github/github-stringify_test.go | 3 +- github/issues.go | 13 +++++ 4 files changed, 164 insertions(+), 1 deletion(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index d90176a96ec..7bd3e0b6493 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -11694,6 +11694,14 @@ func (i *Issue) GetTitle() string { return *i.Title } +// GetType returns the Type field. +func (i *Issue) GetType() *IssueType { + if i == nil { + return nil + } + return i.Type +} + // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. func (i *Issue) GetUpdatedAt() Timestamp { if i == nil || i.UpdatedAt == nil { @@ -12390,6 +12398,62 @@ func (i *IssueStats) GetTotalIssues() int { return *i.TotalIssues } +// GetColor returns the Color field if it's non-nil, zero value otherwise. +func (i *IssueType) GetColor() string { + if i == nil || i.Color == nil { + return "" + } + return *i.Color +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (i *IssueType) GetCreatedAt() Timestamp { + if i == nil || i.CreatedAt == nil { + return Timestamp{} + } + return *i.CreatedAt +} + +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (i *IssueType) GetDescription() string { + if i == nil || i.Description == nil { + return "" + } + return *i.Description +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (i *IssueType) GetID() int64 { + if i == nil || i.ID == nil { + return 0 + } + return *i.ID +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (i *IssueType) GetName() string { + if i == nil || i.Name == nil { + return "" + } + return *i.Name +} + +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (i *IssueType) GetNodeID() string { + if i == nil || i.NodeID == nil { + return "" + } + return *i.NodeID +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (i *IssueType) GetUpdatedAt() Timestamp { + if i == nil || i.UpdatedAt == nil { + return Timestamp{} + } + return *i.UpdatedAt +} + // GetEncodedJITConfig returns the EncodedJITConfig field if it's non-nil, zero value otherwise. func (j *JITRunnerConfig) GetEncodedJITConfig() string { if j == nil || j.EncodedJITConfig == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 5e79e74a8bf..e39f9112242 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -15166,6 +15166,14 @@ func TestIssue_GetTitle(tt *testing.T) { i.GetTitle() } +func TestIssue_GetType(tt *testing.T) { + tt.Parallel() + i := &Issue{} + i.GetType() + i = nil + i.GetType() +} + func TestIssue_GetUpdatedAt(tt *testing.T) { tt.Parallel() var zeroValue Timestamp @@ -16027,6 +16035,83 @@ func TestIssueStats_GetTotalIssues(tt *testing.T) { i.GetTotalIssues() } +func TestIssueType_GetColor(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &IssueType{Color: &zeroValue} + i.GetColor() + i = &IssueType{} + i.GetColor() + i = nil + i.GetColor() +} + +func TestIssueType_GetCreatedAt(tt *testing.T) { + tt.Parallel() + var zeroValue Timestamp + i := &IssueType{CreatedAt: &zeroValue} + i.GetCreatedAt() + i = &IssueType{} + i.GetCreatedAt() + i = nil + i.GetCreatedAt() +} + +func TestIssueType_GetDescription(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &IssueType{Description: &zeroValue} + i.GetDescription() + i = &IssueType{} + i.GetDescription() + i = nil + i.GetDescription() +} + +func TestIssueType_GetID(tt *testing.T) { + tt.Parallel() + var zeroValue int64 + i := &IssueType{ID: &zeroValue} + i.GetID() + i = &IssueType{} + i.GetID() + i = nil + i.GetID() +} + +func TestIssueType_GetName(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &IssueType{Name: &zeroValue} + i.GetName() + i = &IssueType{} + i.GetName() + i = nil + i.GetName() +} + +func TestIssueType_GetNodeID(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &IssueType{NodeID: &zeroValue} + i.GetNodeID() + i = &IssueType{} + i.GetNodeID() + i = nil + i.GetNodeID() +} + +func TestIssueType_GetUpdatedAt(tt *testing.T) { + tt.Parallel() + var zeroValue Timestamp + i := &IssueType{UpdatedAt: &zeroValue} + i.GetUpdatedAt() + i = &IssueType{} + i.GetUpdatedAt() + i = nil + i.GetUpdatedAt() +} + func TestJITRunnerConfig_GetEncodedJITConfig(tt *testing.T) { tt.Parallel() var zeroValue string diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index e20497355e2..706e45324e0 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -815,9 +815,10 @@ func TestIssue_String(t *testing.T) { Reactions: &Reactions{}, NodeID: Ptr(""), Draft: Ptr(false), + Type: &IssueType{}, ActiveLockReason: Ptr(""), } - want := `github.Issue{ID:0, Number:0, State:"", StateReason:"", Locked:false, Title:"", Body:"", AuthorAssociation:"", User:github.User{}, Assignee:github.User{}, Comments:0, ClosedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, ClosedBy:github.User{}, URL:"", HTMLURL:"", CommentsURL:"", EventsURL:"", LabelsURL:"", RepositoryURL:"", Milestone:github.Milestone{}, PullRequestLinks:github.PullRequestLinks{}, Repository:github.Repository{}, Reactions:github.Reactions{}, NodeID:"", Draft:false, ActiveLockReason:""}` + want := `github.Issue{ID:0, Number:0, State:"", StateReason:"", Locked:false, Title:"", Body:"", AuthorAssociation:"", User:github.User{}, Assignee:github.User{}, Comments:0, ClosedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, ClosedBy:github.User{}, URL:"", HTMLURL:"", CommentsURL:"", EventsURL:"", LabelsURL:"", RepositoryURL:"", Milestone:github.Milestone{}, PullRequestLinks:github.PullRequestLinks{}, Repository:github.Repository{}, Reactions:github.Reactions{}, NodeID:"", Draft:false, Type:github.IssueType{}, ActiveLockReason:""}` if got := v.String(); got != want { t.Errorf("Issue.String = %v, want %v", got, want) } diff --git a/github/issues.go b/github/issues.go index a2652b34972..6d3a6b15c5a 100644 --- a/github/issues.go +++ b/github/issues.go @@ -55,6 +55,7 @@ type Issue struct { Assignees []*User `json:"assignees,omitempty"` NodeID *string `json:"node_id,omitempty"` Draft *bool `json:"draft,omitempty"` + Type *IssueType `json:"type,omitempty"` // TextMatches is only populated from search results that request text matches // See: search.go and https://docs.github.com/rest/search/#text-match-metadata @@ -129,6 +130,18 @@ type PullRequestLinks struct { MergedAt *Timestamp `json:"merged_at,omitempty"` } +// IssueType represents the type of issue. +// For now it shows up when receiveing an Issue event. +type IssueType struct { + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + Color *string `json:"color,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` +} + // List the issues for the authenticated user. If all is true, list issues // across all the user's visible repositories including owned, member, and // organization repositories; if false, list only owned and member From 3a72a02aa2ddc8a3f4bc4ff09846288bc1c71183 Mon Sep 17 00:00:00 2001 From: Carlos Tadeu Panato Junior Date: Fri, 24 Jan 2025 15:48:51 +0100 Subject: [PATCH 630/751] ci: update golangci-lint to v1.63.4 (#3452) Signed-off-by: cpanato --- script/lint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/lint.sh b/script/lint.sh index 8decafeb7e5..67a67f8ea61 100755 --- a/script/lint.sh +++ b/script/lint.sh @@ -5,7 +5,7 @@ set -e -GOLANGCI_LINT_VERSION="1.62.0" +GOLANGCI_LINT_VERSION="1.63.4" CDPATH="" cd -- "$(dirname -- "$0")/.." BIN="$(pwd -P)"/bin From e8d69e7d0c6b617bd0715c75b0004094ac4fec5c Mon Sep 17 00:00:00 2001 From: Andy Grunwald Date: Mon, 27 Jan 2025 14:31:24 +0100 Subject: [PATCH 631/751] Extend `Rate` and Rate Limiting with `X-Ratelimit-Used` and `X-Ratelimit-Resource` headers (#3453) --- github/github-stringify_test.go | 4 +- github/github.go | 8 +++ github/github_test.go | 48 ++++++++++++++++ github/rate_limit.go | 14 ++++- github/rate_limit_test.go | 97 +++++++++++++++++++++++++-------- 5 files changed, 143 insertions(+), 28 deletions(-) diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index 706e45324e0..ccf4de8dfd5 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -1500,9 +1500,11 @@ func TestRate_String(t *testing.T) { v := Rate{ Limit: 0, Remaining: 0, + Used: 0, Reset: Timestamp{}, + Resource: "", } - want := `github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}` + want := `github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:""}` if got := v.String(); got != want { t.Errorf("Rate.String = %v, want %v", got, want) } diff --git a/github/github.go b/github/github.go index ab74c5b72da..b25e214a47b 100644 --- a/github/github.go +++ b/github/github.go @@ -38,7 +38,9 @@ const ( headerAPIVersion = "X-Github-Api-Version" headerRateLimit = "X-Ratelimit-Limit" headerRateRemaining = "X-Ratelimit-Remaining" + headerRateUsed = "X-Ratelimit-Used" headerRateReset = "X-Ratelimit-Reset" + headerRateResource = "X-Ratelimit-Resource" headerOTP = "X-Github-Otp" headerRetryAfter = "Retry-After" @@ -763,11 +765,17 @@ func parseRate(r *http.Response) Rate { if remaining := r.Header.Get(headerRateRemaining); remaining != "" { rate.Remaining, _ = strconv.Atoi(remaining) } + if used := r.Header.Get(headerRateUsed); used != "" { + rate.Used, _ = strconv.Atoi(used) + } if reset := r.Header.Get(headerRateReset); reset != "" { if v, _ := strconv.ParseInt(reset, 10, 64); v != 0 { rate.Reset = Timestamp{time.Unix(v, 0)} } } + if resource := r.Header.Get(headerRateResource); resource != "" { + rate.Resource = resource + } return rate } diff --git a/github/github_test.go b/github/github_test.go index 7116636b691..77dffe57ab7 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -1182,7 +1182,9 @@ func TestDo_rateLimit(t *testing.T) { mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { w.Header().Set(headerRateLimit, "60") w.Header().Set(headerRateRemaining, "59") + w.Header().Set(headerRateUsed, "1") w.Header().Set(headerRateReset, "1372700873") + w.Header().Set(headerRateResource, "core") }) req, _ := client.NewRequest("GET", ".", nil) @@ -1197,10 +1199,16 @@ func TestDo_rateLimit(t *testing.T) { if got, want := resp.Rate.Remaining, 59; got != want { t.Errorf("Client rate remaining = %v, want %v", got, want) } + if got, want := resp.Rate.Used, 1; got != want { + t.Errorf("Client rate used = %v, want %v", got, want) + } reset := time.Date(2013, time.July, 1, 17, 47, 53, 0, time.UTC) if !resp.Rate.Reset.UTC().Equal(reset) { t.Errorf("Client rate reset = %v, want %v", resp.Rate.Reset.UTC(), reset) } + if got, want := resp.Rate.Resource, "core"; got != want { + t.Errorf("Client rate resource = %v, want %v", got, want) + } } func TestDo_rateLimitCategory(t *testing.T) { @@ -1288,7 +1296,9 @@ func TestDo_rateLimit_errorResponse(t *testing.T) { mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { w.Header().Set(headerRateLimit, "60") w.Header().Set(headerRateRemaining, "59") + w.Header().Set(headerRateUsed, "1") w.Header().Set(headerRateReset, "1372700873") + w.Header().Set(headerRateResource, "core") http.Error(w, "Bad Request", 400) }) @@ -1307,10 +1317,16 @@ func TestDo_rateLimit_errorResponse(t *testing.T) { if got, want := resp.Rate.Remaining, 59; got != want { t.Errorf("Client rate remaining = %v, want %v", got, want) } + if got, want := resp.Rate.Used, 1; got != want { + t.Errorf("Client rate used = %v, want %v", got, want) + } reset := time.Date(2013, time.July, 1, 17, 47, 53, 0, time.UTC) if !resp.Rate.Reset.UTC().Equal(reset) { t.Errorf("Client rate reset = %v, want %v", resp.Rate.Reset, reset) } + if got, want := resp.Rate.Resource, "core"; got != want { + t.Errorf("Client rate resource = %v, want %v", got, want) + } } // Ensure *RateLimitError is returned when API rate limit is exceeded. @@ -1321,7 +1337,9 @@ func TestDo_rateLimit_rateLimitError(t *testing.T) { mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { w.Header().Set(headerRateLimit, "60") w.Header().Set(headerRateRemaining, "0") + w.Header().Set(headerRateUsed, "60") w.Header().Set(headerRateReset, "1372700873") + w.Header().Set(headerRateResource, "core") w.Header().Set("Content-Type", "application/json; charset=utf-8") w.WriteHeader(http.StatusForbidden) fmt.Fprintln(w, `{ @@ -1347,10 +1365,16 @@ func TestDo_rateLimit_rateLimitError(t *testing.T) { if got, want := rateLimitErr.Rate.Remaining, 0; got != want { t.Errorf("rateLimitErr rate remaining = %v, want %v", got, want) } + if got, want := rateLimitErr.Rate.Used, 60; got != want { + t.Errorf("rateLimitErr rate used = %v, want %v", got, want) + } reset := time.Date(2013, time.July, 1, 17, 47, 53, 0, time.UTC) if !rateLimitErr.Rate.Reset.UTC().Equal(reset) { t.Errorf("rateLimitErr rate reset = %v, want %v", rateLimitErr.Rate.Reset.UTC(), reset) } + if got, want := rateLimitErr.Rate.Resource, "core"; got != want { + t.Errorf("rateLimitErr rate resource = %v, want %v", got, want) + } } // Ensure a network call is not made when it's known that API rate limit is still exceeded. @@ -1363,7 +1387,9 @@ func TestDo_rateLimit_noNetworkCall(t *testing.T) { mux.HandleFunc("/first", func(w http.ResponseWriter, r *http.Request) { w.Header().Set(headerRateLimit, "60") w.Header().Set(headerRateRemaining, "0") + w.Header().Set(headerRateUsed, "60") w.Header().Set(headerRateReset, fmt.Sprint(reset.Unix())) + w.Header().Set(headerRateResource, "core") w.Header().Set("Content-Type", "application/json; charset=utf-8") w.WriteHeader(http.StatusForbidden) fmt.Fprintln(w, `{ @@ -1406,9 +1432,15 @@ func TestDo_rateLimit_noNetworkCall(t *testing.T) { if got, want := rateLimitErr.Rate.Remaining, 0; got != want { t.Errorf("rateLimitErr rate remaining = %v, want %v", got, want) } + if got, want := rateLimitErr.Rate.Used, 60; got != want { + t.Errorf("rateLimitErr rate used = %v, want %v", got, want) + } if !rateLimitErr.Rate.Reset.UTC().Equal(reset) { t.Errorf("rateLimitErr rate reset = %v, want %v", rateLimitErr.Rate.Reset.UTC(), reset) } + if got, want := rateLimitErr.Rate.Resource, "core"; got != want { + t.Errorf("rateLimitErr rate resource = %v, want %v", got, want) + } } // Ignore rate limit headers if the response was served from cache. @@ -1423,7 +1455,9 @@ func TestDo_rateLimit_ignoredFromCache(t *testing.T) { w.Header().Set("X-From-Cache", "1") w.Header().Set(headerRateLimit, "60") w.Header().Set(headerRateRemaining, "0") + w.Header().Set(headerRateUsed, "60") w.Header().Set(headerRateReset, fmt.Sprint(reset.Unix())) + w.Header().Set(headerRateResource, "core") w.Header().Set("Content-Type", "application/json; charset=utf-8") w.WriteHeader(http.StatusForbidden) fmt.Fprintln(w, `{ @@ -1470,7 +1504,9 @@ func TestDo_rateLimit_sleepUntilResponseResetLimit(t *testing.T) { firstRequest = false w.Header().Set(headerRateLimit, "60") w.Header().Set(headerRateRemaining, "0") + w.Header().Set(headerRateUsed, "60") w.Header().Set(headerRateReset, fmt.Sprint(reset.Unix())) + w.Header().Set(headerRateResource, "core") w.Header().Set("Content-Type", "application/json; charset=utf-8") w.WriteHeader(http.StatusForbidden) fmt.Fprintln(w, `{ @@ -1481,7 +1517,9 @@ func TestDo_rateLimit_sleepUntilResponseResetLimit(t *testing.T) { } w.Header().Set(headerRateLimit, "5000") w.Header().Set(headerRateRemaining, "5000") + w.Header().Set(headerRateUsed, "0") w.Header().Set(headerRateReset, fmt.Sprint(reset.Add(time.Hour).Unix())) + w.Header().Set(headerRateResource, "core") w.Header().Set("Content-Type", "application/json; charset=utf-8") w.WriteHeader(http.StatusOK) fmt.Fprintln(w, `{}`) @@ -1510,7 +1548,9 @@ func TestDo_rateLimit_sleepUntilResponseResetLimitRetryOnce(t *testing.T) { requestCount++ w.Header().Set(headerRateLimit, "60") w.Header().Set(headerRateRemaining, "0") + w.Header().Set(headerRateUsed, "60") w.Header().Set(headerRateReset, fmt.Sprint(reset.Unix())) + w.Header().Set(headerRateResource, "core") w.Header().Set("Content-Type", "application/json; charset=utf-8") w.WriteHeader(http.StatusForbidden) fmt.Fprintln(w, `{ @@ -1542,7 +1582,9 @@ func TestDo_rateLimit_sleepUntilClientResetLimit(t *testing.T) { requestCount++ w.Header().Set(headerRateLimit, "5000") w.Header().Set(headerRateRemaining, "5000") + w.Header().Set(headerRateUsed, "0") w.Header().Set(headerRateReset, fmt.Sprint(reset.Add(time.Hour).Unix())) + w.Header().Set(headerRateResource, "core") w.Header().Set("Content-Type", "application/json; charset=utf-8") w.WriteHeader(http.StatusOK) fmt.Fprintln(w, `{}`) @@ -1573,7 +1615,9 @@ func TestDo_rateLimit_abortSleepContextCancelled(t *testing.T) { requestCount++ w.Header().Set(headerRateLimit, "60") w.Header().Set(headerRateRemaining, "0") + w.Header().Set(headerRateUsed, "60") w.Header().Set(headerRateReset, fmt.Sprint(reset.Unix())) + w.Header().Set(headerRateResource, "core") w.Header().Set("Content-Type", "application/json; charset=utf-8") w.WriteHeader(http.StatusForbidden) fmt.Fprintln(w, `{ @@ -1606,7 +1650,9 @@ func TestDo_rateLimit_abortSleepContextCancelledClientLimit(t *testing.T) { requestCount++ w.Header().Set(headerRateLimit, "5000") w.Header().Set(headerRateRemaining, "5000") + w.Header().Set(headerRateUsed, "0") w.Header().Set(headerRateReset, fmt.Sprint(reset.Add(time.Hour).Unix())) + w.Header().Set(headerRateResource, "core") w.Header().Set("Content-Type", "application/json; charset=utf-8") w.WriteHeader(http.StatusOK) fmt.Fprintln(w, `{}`) @@ -1926,7 +1972,9 @@ func TestCheckResponse_RateLimit(t *testing.T) { } res.Header.Set(headerRateLimit, "60") res.Header.Set(headerRateRemaining, "0") + res.Header.Set(headerRateUsed, "1") res.Header.Set(headerRateReset, "243424") + res.Header.Set(headerRateResource, "core") err := CheckResponse(res).(*RateLimitError) diff --git a/github/rate_limit.go b/github/rate_limit.go index d55c545e7a5..6236eba8fbb 100644 --- a/github/rate_limit.go +++ b/github/rate_limit.go @@ -12,14 +12,22 @@ type RateLimitService service // Rate represents the rate limit for the current client. type Rate struct { - // The number of requests per hour the client is currently limited to. + // The maximum number of requests that you can make per hour. Limit int `json:"limit"` - // The number of remaining requests the client can make this hour. + // The number of requests remaining in the current rate limit window. Remaining int `json:"remaining"` - // The time at which the current rate limit will reset. + // The number of requests you have made in the current rate limit window. + Used int `json:"used"` + + // The time at which the current rate limit window resets, in UTC epoch seconds. Reset Timestamp `json:"reset"` + + // The rate limit resource that the request counted against. + // For more information about the different resources, see REST API endpoints for rate limits. + // GitHub API docs: https://docs.github.com/en/rest/rate-limit/rate-limit#get-rate-limit-status-for-the-authenticated-user + Resource string `json:"resource,omitempty"` } func (r Rate) String() string { diff --git a/github/rate_limit_test.go b/github/rate_limit_test.go index 241b8ce0982..8e7f2c83563 100644 --- a/github/rate_limit_test.go +++ b/github/rate_limit_test.go @@ -30,7 +30,7 @@ func TestRateLimits_String(t *testing.T) { CodeSearch: &Rate{}, AuditLog: &Rate{}, } - want := `github.RateLimits{Core:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, Search:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, GraphQL:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, IntegrationManifest:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, SourceImport:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, CodeScanningUpload:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, ActionsRunnerRegistration:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, SCIM:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, DependencySnapshots:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, CodeSearch:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, AuditLog:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}}` + want := `github.RateLimits{Core:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:""}, Search:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:""}, GraphQL:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:""}, IntegrationManifest:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:""}, SourceImport:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:""}, CodeScanningUpload:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:""}, ActionsRunnerRegistration:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:""}, SCIM:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:""}, DependencySnapshots:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:""}, CodeSearch:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:""}, AuditLog:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:""}}` if got := v.String(); got != want { t.Errorf("RateLimits.String = %v, want %v", got, want) } @@ -43,17 +43,17 @@ func TestRateLimits(t *testing.T) { mux.HandleFunc("/rate_limit", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `{"resources":{ - "core": {"limit":2,"remaining":1,"reset":1372700873}, - "search": {"limit":3,"remaining":2,"reset":1372700874}, - "graphql": {"limit":4,"remaining":3,"reset":1372700875}, - "integration_manifest": {"limit":5,"remaining":4,"reset":1372700876}, - "source_import": {"limit":6,"remaining":5,"reset":1372700877}, - "code_scanning_upload": {"limit":7,"remaining":6,"reset":1372700878}, - "actions_runner_registration": {"limit":8,"remaining":7,"reset":1372700879}, - "scim": {"limit":9,"remaining":8,"reset":1372700880}, - "dependency_snapshots": {"limit":10,"remaining":9,"reset":1372700881}, - "code_search": {"limit":11,"remaining":10,"reset":1372700882}, - "audit_log": {"limit": 12,"remaining":11,"reset":1372700883} + "core": {"limit":2,"remaining":1,"used":1,"reset":1372700873}, + "search": {"limit":3,"remaining":2,"used":1,"reset":1372700874}, + "graphql": {"limit":4,"remaining":3,"used":1,"reset":1372700875}, + "integration_manifest": {"limit":5,"remaining":4,"used":1,"reset":1372700876}, + "source_import": {"limit":6,"remaining":5,"used":1,"reset":1372700877}, + "code_scanning_upload": {"limit":7,"remaining":6,"used":1,"reset":1372700878}, + "actions_runner_registration": {"limit":8,"remaining":7,"used":1,"reset":1372700879}, + "scim": {"limit":9,"remaining":8,"used":1,"reset":1372700880}, + "dependency_snapshots": {"limit":10,"remaining":9,"used":1,"reset":1372700881}, + "code_search": {"limit":11,"remaining":10,"used":1,"reset":1372700882}, + "audit_log": {"limit": 12,"remaining":11,"used":1,"reset":1372700883} }}`) }) @@ -67,56 +67,67 @@ func TestRateLimits(t *testing.T) { Core: &Rate{ Limit: 2, Remaining: 1, + Used: 1, Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 53, 0, time.UTC).Local()}, }, Search: &Rate{ Limit: 3, Remaining: 2, + Used: 1, Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 54, 0, time.UTC).Local()}, }, GraphQL: &Rate{ Limit: 4, Remaining: 3, + Used: 1, Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 55, 0, time.UTC).Local()}, }, IntegrationManifest: &Rate{ Limit: 5, Remaining: 4, + Used: 1, Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 56, 0, time.UTC).Local()}, }, SourceImport: &Rate{ Limit: 6, Remaining: 5, + Used: 1, Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 57, 0, time.UTC).Local()}, }, CodeScanningUpload: &Rate{ Limit: 7, Remaining: 6, + Used: 1, Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 58, 0, time.UTC).Local()}, }, ActionsRunnerRegistration: &Rate{ Limit: 8, Remaining: 7, + Used: 1, Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 59, 0, time.UTC).Local()}, }, SCIM: &Rate{ Limit: 9, Remaining: 8, + Used: 1, Reset: Timestamp{time.Date(2013, time.July, 1, 17, 48, 00, 0, time.UTC).Local()}, }, DependencySnapshots: &Rate{ Limit: 10, Remaining: 9, + Used: 1, Reset: Timestamp{time.Date(2013, time.July, 1, 17, 48, 1, 0, time.UTC).Local()}, }, CodeSearch: &Rate{ Limit: 11, Remaining: 10, + Used: 1, Reset: Timestamp{time.Date(2013, time.July, 1, 17, 48, 2, 0, time.UTC).Local()}, }, AuditLog: &Rate{ Limit: 12, Remaining: 11, + Used: 1, Reset: Timestamp{time.Date(2013, time.July, 1, 17, 48, 3, 0, time.UTC).Local()}, }, } @@ -200,21 +211,22 @@ func TestRateLimits_overQuota(t *testing.T) { client.rateLimits[CoreCategory] = Rate{ Limit: 1, Remaining: 0, + Used: 1, Reset: Timestamp{time.Now().Add(time.Hour).Local()}, } mux.HandleFunc("/rate_limit", func(w http.ResponseWriter, r *http.Request) { fmt.Fprint(w, `{"resources":{ - "core": {"limit":2,"remaining":1,"reset":1372700873}, - "search": {"limit":3,"remaining":2,"reset":1372700874}, - "graphql": {"limit":4,"remaining":3,"reset":1372700875}, - "integration_manifest": {"limit":5,"remaining":4,"reset":1372700876}, - "source_import": {"limit":6,"remaining":5,"reset":1372700877}, - "code_scanning_upload": {"limit":7,"remaining":6,"reset":1372700878}, - "actions_runner_registration": {"limit":8,"remaining":7,"reset":1372700879}, - "scim": {"limit":9,"remaining":8,"reset":1372700880}, - "dependency_snapshots": {"limit":10,"remaining":9,"reset":1372700881}, - "code_search": {"limit":11,"remaining":10,"reset":1372700882}, - "audit_log": {"limit":12,"remaining":11,"reset":1372700883} + "core": {"limit":2,"remaining":1,"used":1,"reset":1372700873}, + "search": {"limit":3,"remaining":2,"used":1,"reset":1372700874}, + "graphql": {"limit":4,"remaining":3,"used":1,"reset":1372700875}, + "integration_manifest": {"limit":5,"remaining":4,"used":1,"reset":1372700876}, + "source_import": {"limit":6,"remaining":5,"used":1,"reset":1372700877}, + "code_scanning_upload": {"limit":7,"remaining":6,"used":1,"reset":1372700878}, + "actions_runner_registration": {"limit":8,"remaining":7,"used":1,"reset":1372700879}, + "scim": {"limit":9,"remaining":8,"used":1,"reset":1372700880}, + "dependency_snapshots": {"limit":10,"remaining":9,"used":1,"reset":1372700881}, + "code_search": {"limit":11,"remaining":10,"used":1,"reset":1372700882}, + "audit_log": {"limit":12,"remaining":11,"used":1,"reset":1372700883} }}`) }) @@ -228,56 +240,67 @@ func TestRateLimits_overQuota(t *testing.T) { Core: &Rate{ Limit: 2, Remaining: 1, + Used: 1, Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 53, 0, time.UTC).Local()}, }, Search: &Rate{ Limit: 3, Remaining: 2, + Used: 1, Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 54, 0, time.UTC).Local()}, }, GraphQL: &Rate{ Limit: 4, Remaining: 3, + Used: 1, Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 55, 0, time.UTC).Local()}, }, IntegrationManifest: &Rate{ Limit: 5, Remaining: 4, + Used: 1, Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 56, 0, time.UTC).Local()}, }, SourceImport: &Rate{ Limit: 6, Remaining: 5, + Used: 1, Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 57, 0, time.UTC).Local()}, }, CodeScanningUpload: &Rate{ Limit: 7, Remaining: 6, + Used: 1, Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 58, 0, time.UTC).Local()}, }, ActionsRunnerRegistration: &Rate{ Limit: 8, Remaining: 7, + Used: 1, Reset: Timestamp{time.Date(2013, time.July, 1, 17, 47, 59, 0, time.UTC).Local()}, }, SCIM: &Rate{ Limit: 9, Remaining: 8, + Used: 1, Reset: Timestamp{time.Date(2013, time.July, 1, 17, 48, 00, 0, time.UTC).Local()}, }, DependencySnapshots: &Rate{ Limit: 10, Remaining: 9, + Used: 1, Reset: Timestamp{time.Date(2013, time.July, 1, 17, 48, 1, 0, time.UTC).Local()}, }, CodeSearch: &Rate{ Limit: 11, Remaining: 10, + Used: 1, Reset: Timestamp{time.Date(2013, time.July, 1, 17, 48, 2, 0, time.UTC).Local()}, }, AuditLog: &Rate{ Limit: 12, Remaining: 11, + Used: 1, Reset: Timestamp{time.Date(2013, time.July, 1, 17, 48, 3, 0, time.UTC).Local()}, }, } @@ -349,56 +372,67 @@ func TestRateLimits_Marshal(t *testing.T) { Core: &Rate{ Limit: 1, Remaining: 1, + Used: 0, Reset: Timestamp{referenceTime}, }, Search: &Rate{ Limit: 1, Remaining: 1, + Used: 0, Reset: Timestamp{referenceTime}, }, GraphQL: &Rate{ Limit: 1, Remaining: 1, + Used: 0, Reset: Timestamp{referenceTime}, }, IntegrationManifest: &Rate{ Limit: 1, Remaining: 1, + Used: 0, Reset: Timestamp{referenceTime}, }, SourceImport: &Rate{ Limit: 1, Remaining: 1, + Used: 0, Reset: Timestamp{referenceTime}, }, CodeScanningUpload: &Rate{ Limit: 1, Remaining: 1, + Used: 0, Reset: Timestamp{referenceTime}, }, ActionsRunnerRegistration: &Rate{ Limit: 1, Remaining: 1, + Used: 0, Reset: Timestamp{referenceTime}, }, SCIM: &Rate{ Limit: 1, Remaining: 1, + Used: 0, Reset: Timestamp{referenceTime}, }, DependencySnapshots: &Rate{ Limit: 1, Remaining: 1, + Used: 0, Reset: Timestamp{referenceTime}, }, CodeSearch: &Rate{ Limit: 1, Remaining: 1, + Used: 0, Reset: Timestamp{referenceTime}, }, AuditLog: &Rate{ Limit: 1, Remaining: 1, + Used: 0, Reset: Timestamp{referenceTime}, }, } @@ -407,56 +441,67 @@ func TestRateLimits_Marshal(t *testing.T) { "core": { "limit": 1, "remaining": 1, + "used": 0, "reset": ` + referenceTimeStr + ` }, "search": { "limit": 1, "remaining": 1, + "used": 0, "reset": ` + referenceTimeStr + ` }, "graphql": { "limit": 1, "remaining": 1, + "used": 0, "reset": ` + referenceTimeStr + ` }, "integration_manifest": { "limit": 1, "remaining": 1, + "used": 0, "reset": ` + referenceTimeStr + ` }, "source_import": { "limit": 1, "remaining": 1, + "used": 0, "reset": ` + referenceTimeStr + ` }, "code_scanning_upload": { "limit": 1, "remaining": 1, + "used": 0, "reset": ` + referenceTimeStr + ` }, "actions_runner_registration": { "limit": 1, "remaining": 1, + "used": 0, "reset": ` + referenceTimeStr + ` }, "scim": { "limit": 1, "remaining": 1, + "used": 0, "reset": ` + referenceTimeStr + ` }, "dependency_snapshots": { "limit": 1, "remaining": 1, + "used": 0, "reset": ` + referenceTimeStr + ` }, "code_search": { "limit": 1, "remaining": 1, + "used": 0, "reset": ` + referenceTimeStr + ` }, "audit_log": { "limit": 1, "remaining": 1, + "used": 0, "reset": ` + referenceTimeStr + ` } }` @@ -471,13 +516,17 @@ func TestRate_Marshal(t *testing.T) { u := &Rate{ Limit: 1, Remaining: 1, + Used: 0, Reset: Timestamp{referenceTime}, + Resource: "core", } want := `{ "limit": 1, "remaining": 1, - "reset": ` + referenceTimeStr + ` + "used": 0, + "reset": ` + referenceTimeStr + `, + "resource": "core" }` testJSONMarshal(t, u, want) From 15d1aa05d757ef7b7ad2de8467d2f7d13d40f8e2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 15:13:29 -0500 Subject: [PATCH 632/751] build(deps): bump actions/setup-go from 5.2.0 to 5.3.0 in the actions group (#3454) --- .github/workflows/linter.yml | 2 +- .github/workflows/tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 4606434fe47..4aa0bec2abb 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 + - uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0 with: go-version: 1.x cache-dependency-path: "**/go.sum" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b19e20f0954..b66a919b463 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -42,7 +42,7 @@ jobs: runs-on: ${{ matrix.platform }} steps: - - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 + - uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0 with: go-version: ${{ matrix.go-version }} - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 From 778331087cdaad34c3a916cc91a2d9caf572197a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 15:23:40 -0500 Subject: [PATCH 633/751] build(deps): bump codecov/codecov-action from 5.1.2 to 5.3.1 (#3455) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b66a919b463..010d806491b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -76,6 +76,6 @@ jobs: - name: Upload coverage to Codecov if: ${{ matrix.update-coverage }} - uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 # v5.1.2 + uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1 with: use_oidc: true From cbe65f01498a5c66ddfc35708b0cb9503b8baee7 Mon Sep 17 00:00:00 2001 From: Alexis Couvreur Date: Thu, 30 Jan 2025 12:44:27 -0800 Subject: [PATCH 634/751] docs: Add clarifications for mergeable field in pull requests (#3396) --- github/github-stringify_test.go | 28 +++++------ github/pulls.go | 88 +++++++++++++++++---------------- 2 files changed, 59 insertions(+), 57 deletions(-) diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index ccf4de8dfd5..ec811fc5d3c 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -1320,17 +1320,6 @@ func TestPullRequest_String(t *testing.T) { MergedAt: &Timestamp{}, User: &User{}, Draft: Ptr(false), - Merged: Ptr(false), - Mergeable: Ptr(false), - MergeableState: Ptr(""), - MergedBy: &User{}, - MergeCommitSHA: Ptr(""), - Rebaseable: Ptr(false), - Comments: Ptr(0), - Commits: Ptr(0), - Additions: Ptr(0), - Deletions: Ptr(0), - ChangedFiles: Ptr(0), URL: Ptr(""), HTMLURL: Ptr(""), IssueURL: Ptr(""), @@ -1341,19 +1330,30 @@ func TestPullRequest_String(t *testing.T) { CommentsURL: Ptr(""), ReviewCommentsURL: Ptr(""), ReviewCommentURL: Ptr(""), - ReviewComments: Ptr(0), Assignee: &User{}, Milestone: &Milestone{}, - MaintainerCanModify: Ptr(false), AuthorAssociation: Ptr(""), NodeID: Ptr(""), AutoMerge: &PullRequestAutoMerge{}, + Merged: Ptr(false), + Mergeable: Ptr(false), + MergeableState: Ptr(""), + Rebaseable: Ptr(false), + MergedBy: &User{}, + MergeCommitSHA: Ptr(""), + Comments: Ptr(0), + Commits: Ptr(0), + Additions: Ptr(0), + Deletions: Ptr(0), + ChangedFiles: Ptr(0), + MaintainerCanModify: Ptr(false), + ReviewComments: Ptr(0), Links: &PRLinks{}, Head: &PullRequestBranch{}, Base: &PullRequestBranch{}, ActiveLockReason: Ptr(""), } - want := `github.PullRequest{ID:0, Number:0, State:"", Locked:false, Title:"", Body:"", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, ClosedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, MergedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, User:github.User{}, Draft:false, Merged:false, Mergeable:false, MergeableState:"", MergedBy:github.User{}, MergeCommitSHA:"", Rebaseable:false, Comments:0, Commits:0, Additions:0, Deletions:0, ChangedFiles:0, URL:"", HTMLURL:"", IssueURL:"", StatusesURL:"", DiffURL:"", PatchURL:"", CommitsURL:"", CommentsURL:"", ReviewCommentsURL:"", ReviewCommentURL:"", ReviewComments:0, Assignee:github.User{}, Milestone:github.Milestone{}, MaintainerCanModify:false, AuthorAssociation:"", NodeID:"", AutoMerge:github.PullRequestAutoMerge{}, Links:github.PRLinks{}, Head:github.PullRequestBranch{}, Base:github.PullRequestBranch{}, ActiveLockReason:""}` + want := `github.PullRequest{ID:0, Number:0, State:"", Locked:false, Title:"", Body:"", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, ClosedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, MergedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, User:github.User{}, Draft:false, URL:"", HTMLURL:"", IssueURL:"", StatusesURL:"", DiffURL:"", PatchURL:"", CommitsURL:"", CommentsURL:"", ReviewCommentsURL:"", ReviewCommentURL:"", Assignee:github.User{}, Milestone:github.Milestone{}, AuthorAssociation:"", NodeID:"", AutoMerge:github.PullRequestAutoMerge{}, Merged:false, Mergeable:false, MergeableState:"", Rebaseable:false, MergedBy:github.User{}, MergeCommitSHA:"", Comments:0, Commits:0, Additions:0, Deletions:0, ChangedFiles:0, MaintainerCanModify:false, ReviewComments:0, Links:github.PRLinks{}, Head:github.PullRequestBranch{}, Base:github.PullRequestBranch{}, ActiveLockReason:""}` if got := v.String(); got != want { t.Errorf("PullRequest.String = %v, want %v", got, want) } diff --git a/github/pulls.go b/github/pulls.go index 35ceda44679..64480194640 100644 --- a/github/pulls.go +++ b/github/pulls.go @@ -28,49 +28,51 @@ type PullRequestAutoMerge struct { // PullRequest represents a GitHub pull request on a repository. type PullRequest struct { - ID *int64 `json:"id,omitempty"` - Number *int `json:"number,omitempty"` - State *string `json:"state,omitempty"` - Locked *bool `json:"locked,omitempty"` - Title *string `json:"title,omitempty"` - Body *string `json:"body,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - ClosedAt *Timestamp `json:"closed_at,omitempty"` - MergedAt *Timestamp `json:"merged_at,omitempty"` - Labels []*Label `json:"labels,omitempty"` - User *User `json:"user,omitempty"` - Draft *bool `json:"draft,omitempty"` - Merged *bool `json:"merged,omitempty"` - Mergeable *bool `json:"mergeable,omitempty"` - MergeableState *string `json:"mergeable_state,omitempty"` - MergedBy *User `json:"merged_by,omitempty"` - MergeCommitSHA *string `json:"merge_commit_sha,omitempty"` - Rebaseable *bool `json:"rebaseable,omitempty"` - Comments *int `json:"comments,omitempty"` - Commits *int `json:"commits,omitempty"` - Additions *int `json:"additions,omitempty"` - Deletions *int `json:"deletions,omitempty"` - ChangedFiles *int `json:"changed_files,omitempty"` - URL *string `json:"url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - IssueURL *string `json:"issue_url,omitempty"` - StatusesURL *string `json:"statuses_url,omitempty"` - DiffURL *string `json:"diff_url,omitempty"` - PatchURL *string `json:"patch_url,omitempty"` - CommitsURL *string `json:"commits_url,omitempty"` - CommentsURL *string `json:"comments_url,omitempty"` - ReviewCommentsURL *string `json:"review_comments_url,omitempty"` - ReviewCommentURL *string `json:"review_comment_url,omitempty"` - ReviewComments *int `json:"review_comments,omitempty"` - Assignee *User `json:"assignee,omitempty"` - Assignees []*User `json:"assignees,omitempty"` - Milestone *Milestone `json:"milestone,omitempty"` - MaintainerCanModify *bool `json:"maintainer_can_modify,omitempty"` - AuthorAssociation *string `json:"author_association,omitempty"` - NodeID *string `json:"node_id,omitempty"` - RequestedReviewers []*User `json:"requested_reviewers,omitempty"` - AutoMerge *PullRequestAutoMerge `json:"auto_merge,omitempty"` + ID *int64 `json:"id,omitempty"` + Number *int `json:"number,omitempty"` + State *string `json:"state,omitempty"` + Locked *bool `json:"locked,omitempty"` + Title *string `json:"title,omitempty"` + Body *string `json:"body,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + ClosedAt *Timestamp `json:"closed_at,omitempty"` + MergedAt *Timestamp `json:"merged_at,omitempty"` + Labels []*Label `json:"labels,omitempty"` + User *User `json:"user,omitempty"` + Draft *bool `json:"draft,omitempty"` + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + IssueURL *string `json:"issue_url,omitempty"` + StatusesURL *string `json:"statuses_url,omitempty"` + DiffURL *string `json:"diff_url,omitempty"` + PatchURL *string `json:"patch_url,omitempty"` + CommitsURL *string `json:"commits_url,omitempty"` + CommentsURL *string `json:"comments_url,omitempty"` + ReviewCommentsURL *string `json:"review_comments_url,omitempty"` + ReviewCommentURL *string `json:"review_comment_url,omitempty"` + Assignee *User `json:"assignee,omitempty"` + Assignees []*User `json:"assignees,omitempty"` + Milestone *Milestone `json:"milestone,omitempty"` + AuthorAssociation *string `json:"author_association,omitempty"` + NodeID *string `json:"node_id,omitempty"` + RequestedReviewers []*User `json:"requested_reviewers,omitempty"` + AutoMerge *PullRequestAutoMerge `json:"auto_merge,omitempty"` + + // These fields are not populated by the List operation. + Merged *bool `json:"merged,omitempty"` + Mergeable *bool `json:"mergeable,omitempty"` + MergeableState *string `json:"mergeable_state,omitempty"` + Rebaseable *bool `json:"rebaseable,omitempty"` + MergedBy *User `json:"merged_by,omitempty"` + MergeCommitSHA *string `json:"merge_commit_sha,omitempty"` + Comments *int `json:"comments,omitempty"` + Commits *int `json:"commits,omitempty"` + Additions *int `json:"additions,omitempty"` + Deletions *int `json:"deletions,omitempty"` + ChangedFiles *int `json:"changed_files,omitempty"` + MaintainerCanModify *bool `json:"maintainer_can_modify,omitempty"` + ReviewComments *int `json:"review_comments,omitempty"` // RequestedTeams is populated as part of the PullRequestEvent. // See, https://docs.github.com/developers/webhooks-and-events/github-event-types#pullrequestevent for an example. From d392e2cd19b50047fe4b556f1885bf23bc1c714d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 16:56:37 -0500 Subject: [PATCH 635/751] build(deps): bump github.com/alecthomas/kong from 1.6.0 to 1.7.0 in /tools (#3458) --- tools/go.mod | 2 +- tools/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index 188a79ce51f..2448ec55cb3 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -3,7 +3,7 @@ module tools go 1.22.0 require ( - github.com/alecthomas/kong v1.6.0 + github.com/alecthomas/kong v1.7.0 github.com/getkin/kin-openapi v0.128.0 github.com/google/go-cmp v0.6.0 github.com/google/go-github/v68 v68.0.0 diff --git a/tools/go.sum b/tools/go.sum index 3073cf11c8f..362da48550b 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -1,7 +1,7 @@ github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0= github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= -github.com/alecthomas/kong v1.6.0 h1:mwOzbdMR7uv2vul9J0FU3GYxE7ls/iX1ieMg5WIM6gE= -github.com/alecthomas/kong v1.6.0/go.mod h1:p2vqieVMeTAnaC83txKtXe8FLke2X07aruPWXyMPQrU= +github.com/alecthomas/kong v1.7.0 h1:MnT8+5JxFDCvISeI6vgd/mFbAJwueJ/pqQNzZMsiqZE= +github.com/alecthomas/kong v1.7.0/go.mod h1:p2vqieVMeTAnaC83txKtXe8FLke2X07aruPWXyMPQrU= github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc= github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= From a8a3177767ae8c8509dac7efb9aad6083341fe5c Mon Sep 17 00:00:00 2001 From: tomfeigin Date: Wed, 5 Feb 2025 14:49:44 +0200 Subject: [PATCH 636/751] feat!: Change `User.InheritedFrom` to a slice (#3460) BREAKING CHANGE: `User.InheritedFrom` is changed from a `*Team` to a `[]*Team`. --- github/github-accessors.go | 8 -------- github/github-accessors_test.go | 8 -------- github/github-stringify_test.go | 3 +-- github/users.go | 2 +- 4 files changed, 2 insertions(+), 19 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 7bd3e0b6493..1685959173c 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -26894,14 +26894,6 @@ func (u *User) GetID() int64 { return *u.ID } -// GetInheritedFrom returns the InheritedFrom field. -func (u *User) GetInheritedFrom() *Team { - if u == nil { - return nil - } - return u.InheritedFrom -} - // GetLdapDn returns the LdapDn field if it's non-nil, zero value otherwise. func (u *User) GetLdapDn() string { if u == nil || u.LdapDn == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index e39f9112242..cee65415517 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -34569,14 +34569,6 @@ func TestUser_GetID(tt *testing.T) { u.GetID() } -func TestUser_GetInheritedFrom(tt *testing.T) { - tt.Parallel() - u := &User{} - u.GetInheritedFrom() - u = nil - u.GetInheritedFrom() -} - func TestUser_GetLdapDn(tt *testing.T) { tt.Parallel() var zeroValue string diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index ec811fc5d3c..948a9547a4d 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -2095,9 +2095,8 @@ func TestUser_String(t *testing.T) { SubscriptionsURL: Ptr(""), RoleName: Ptr(""), Assignment: Ptr(""), - InheritedFrom: &Team{}, } - want := `github.User{Login:"", ID:0, NodeID:"", AvatarURL:"", HTMLURL:"", GravatarID:"", Name:"", Company:"", Blog:"", Location:"", Email:"", Hireable:false, Bio:"", TwitterUsername:"", PublicRepos:0, PublicGists:0, Followers:0, Following:0, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, SuspendedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Type:"", SiteAdmin:false, TotalPrivateRepos:0, OwnedPrivateRepos:0, PrivateGists:0, DiskUsage:0, Collaborators:0, TwoFactorAuthentication:false, Plan:github.Plan{}, LdapDn:"", URL:"", EventsURL:"", FollowingURL:"", FollowersURL:"", GistsURL:"", OrganizationsURL:"", ReceivedEventsURL:"", ReposURL:"", StarredURL:"", SubscriptionsURL:"", RoleName:"", Assignment:"", InheritedFrom:github.Team{}}` + want := `github.User{Login:"", ID:0, NodeID:"", AvatarURL:"", HTMLURL:"", GravatarID:"", Name:"", Company:"", Blog:"", Location:"", Email:"", Hireable:false, Bio:"", TwitterUsername:"", PublicRepos:0, PublicGists:0, Followers:0, Following:0, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, SuspendedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Type:"", SiteAdmin:false, TotalPrivateRepos:0, OwnedPrivateRepos:0, PrivateGists:0, DiskUsage:0, Collaborators:0, TwoFactorAuthentication:false, Plan:github.Plan{}, LdapDn:"", URL:"", EventsURL:"", FollowingURL:"", FollowersURL:"", GistsURL:"", OrganizationsURL:"", ReceivedEventsURL:"", ReposURL:"", StarredURL:"", SubscriptionsURL:"", RoleName:"", Assignment:""}` if got := v.String(); got != want { t.Errorf("User.String = %v, want %v", got, want) } diff --git a/github/users.go b/github/users.go index 60f1e06a694..28db59c5e1a 100644 --- a/github/users.go +++ b/github/users.go @@ -77,7 +77,7 @@ type User struct { Assignment *string `json:"assignment,omitempty"` // InheritedFrom identifies the team that a user inherited their organization role // from. This is only populated when calling the ListUsersAssignedToOrgRole method. - InheritedFrom *Team `json:"inherited_from,omitempty"` + InheritedFrom []*Team `json:"inherited_from,omitempty"` } func (u User) String() string { From 59c38a3510ed170deed59ea2b86d5a7013bbaed9 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Wed, 5 Feb 2025 09:37:33 -0500 Subject: [PATCH 637/751] Bump version of go-github to v69.0.0 (#3463) --- README.md | 18 +++++++++--------- example/actionpermissions/main.go | 2 +- example/appengine/app.go | 2 +- example/basicauth/main.go | 2 +- .../newreposecretwithxcrypto/main.go | 2 +- .../newusersecretwithxcrypto/main.go | 2 +- example/commitpr/main.go | 2 +- example/go.mod | 6 +++--- example/listenvironments/main.go | 2 +- example/migrations/main.go | 2 +- example/newfilewithappauth/main.go | 2 +- example/newrepo/main.go | 2 +- example/newreposecretwithlibsodium/go.mod | 4 ++-- example/newreposecretwithlibsodium/main.go | 2 +- example/newreposecretwithxcrypto/main.go | 2 +- example/ratelimit/main.go | 2 +- example/simple/main.go | 2 +- example/tokenauth/main.go | 2 +- example/topics/main.go | 2 +- example/verifyartifact/main.go | 2 +- github/doc.go | 2 +- github/examples_test.go | 2 +- github/github.go | 2 +- go.mod | 2 +- test/fields/fields.go | 2 +- test/integration/activity_test.go | 2 +- test/integration/authorizations_test.go | 2 +- test/integration/github_test.go | 2 +- test/integration/repos_test.go | 2 +- test/integration/users_test.go | 2 +- tools/go.mod | 4 ++-- tools/metadata/main.go | 2 +- tools/metadata/main_test.go | 2 +- tools/metadata/metadata.go | 2 +- tools/metadata/openapi.go | 2 +- 35 files changed, 47 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index 5914581b6f0..8f4e5dec0ab 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-github # [![go-github release (latest SemVer)](https://img.shields.io/github/v/release/google/go-github?sort=semver)](https://github.com/google/go-github/releases) -[![Go Reference](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v68/github) +[![Go Reference](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v69/github) [![Test Status](https://github.com/google/go-github/workflows/tests/badge.svg)](https://github.com/google/go-github/actions?query=workflow%3Atests) [![Test Coverage](https://codecov.io/gh/google/go-github/branch/master/graph/badge.svg)](https://codecov.io/gh/google/go-github) [![Discuss at go-github@googlegroups.com](https://img.shields.io/badge/discuss-go--github%40googlegroups.com-blue.svg)](https://groups.google.com/group/go-github) @@ -43,7 +43,7 @@ If you're interested in using the [GraphQL API v4][], the recommended library is go-github is compatible with modern Go releases in module mode, with Go installed: ```bash -go get github.com/google/go-github/v68 +go get github.com/google/go-github/v69 ``` will resolve and add the package to the current development module, along with its dependencies. @@ -51,7 +51,7 @@ will resolve and add the package to the current development module, along with i Alternatively the same can be achieved if you use import in a package: ```go -import "github.com/google/go-github/v68/github" +import "github.com/google/go-github/v69/github" ``` and run `go get` without parameters. @@ -59,13 +59,13 @@ and run `go get` without parameters. Finally, to use the top-of-trunk version of this repo, use the following command: ```bash -go get github.com/google/go-github/v68@master +go get github.com/google/go-github/v69@master ``` ## Usage ## ```go -import "github.com/google/go-github/v68/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) +import "github.com/google/go-github/v69/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled ``` @@ -138,7 +138,7 @@ import ( "net/http" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v68/github" + "github.com/google/go-github/v69/github" ) func main() { @@ -172,7 +172,7 @@ import ( "os" "strconv" - "github.com/google/go-github/v68/github" + "github.com/google/go-github/v69/github" "github.com/jferrl/go-githubauth" "golang.org/x/oauth2" ) @@ -380,7 +380,7 @@ For complete usage of go-github, see the full [package docs][]. [GitHub API v3]: https://docs.github.com/en/rest [personal access token]: https://github.com/blog/1509-personal-api-tokens -[package docs]: https://pkg.go.dev/github.com/google/go-github/v68/github +[package docs]: https://pkg.go.dev/github.com/google/go-github/v69/github [GraphQL API v4]: https://developer.github.com/v4/ [shurcooL/githubv4]: https://github.com/shurcooL/githubv4 [GitHub webhook events]: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads @@ -454,7 +454,7 @@ Versions prior to 48.2.0 are not listed. | go-github Version | GitHub v3 API Version | | ----------------- | --------------------- | -| 68.0.0 | 2022-11-28 | +| 69.0.0 | 2022-11-28 | | ... | 2022-11-28 | | 48.2.0 | 2022-11-28 | diff --git a/example/actionpermissions/main.go b/example/actionpermissions/main.go index 6a263a6228c..7766c5fbc2d 100644 --- a/example/actionpermissions/main.go +++ b/example/actionpermissions/main.go @@ -14,7 +14,7 @@ import ( "log" "os" - "github.com/google/go-github/v68/github" + "github.com/google/go-github/v69/github" ) var ( diff --git a/example/appengine/app.go b/example/appengine/app.go index fe2867ce6f1..0cbec256895 100644 --- a/example/appengine/app.go +++ b/example/appengine/app.go @@ -12,7 +12,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v68/github" + "github.com/google/go-github/v69/github" "google.golang.org/appengine" "google.golang.org/appengine/log" ) diff --git a/example/basicauth/main.go b/example/basicauth/main.go index 1a00941b6e9..501cb4f20fa 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -21,7 +21,7 @@ import ( "os" "strings" - "github.com/google/go-github/v68/github" + "github.com/google/go-github/v69/github" "golang.org/x/term" ) diff --git a/example/codespaces/newreposecretwithxcrypto/main.go b/example/codespaces/newreposecretwithxcrypto/main.go index 98f02604377..abdf74ebc9f 100644 --- a/example/codespaces/newreposecretwithxcrypto/main.go +++ b/example/codespaces/newreposecretwithxcrypto/main.go @@ -37,7 +37,7 @@ import ( "log" "os" - "github.com/google/go-github/v68/github" + "github.com/google/go-github/v69/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/codespaces/newusersecretwithxcrypto/main.go b/example/codespaces/newusersecretwithxcrypto/main.go index 63cd5a572b9..873a583f670 100644 --- a/example/codespaces/newusersecretwithxcrypto/main.go +++ b/example/codespaces/newusersecretwithxcrypto/main.go @@ -38,7 +38,7 @@ import ( "log" "os" - "github.com/google/go-github/v68/github" + "github.com/google/go-github/v69/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index b707f846458..f380484fcc5 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -33,7 +33,7 @@ import ( "time" "github.com/ProtonMail/go-crypto/openpgp" - "github.com/google/go-github/v68/github" + "github.com/google/go-github/v69/github" ) var ( diff --git a/example/go.mod b/example/go.mod index bd784bf5921..68a9b74a951 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v68/example +module github.com/google/go-github/v69/example go 1.22.0 @@ -6,7 +6,7 @@ require ( github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-ratelimit v1.0.3 - github.com/google/go-github/v68 v68.0.0 + github.com/google/go-github/v69 v69.0.0 github.com/sigstore/sigstore-go v0.5.1 golang.org/x/crypto v0.31.0 golang.org/x/term v0.27.0 @@ -98,4 +98,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v68 => ../ +replace github.com/google/go-github/v69 => ../ diff --git a/example/listenvironments/main.go b/example/listenvironments/main.go index ebe60ffe225..0f82096c399 100644 --- a/example/listenvironments/main.go +++ b/example/listenvironments/main.go @@ -18,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v68/github" + "github.com/google/go-github/v69/github" ) func main() { diff --git a/example/migrations/main.go b/example/migrations/main.go index 07e3cbb67ec..bdf3a50c3a1 100644 --- a/example/migrations/main.go +++ b/example/migrations/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v68/github" + "github.com/google/go-github/v69/github" ) func fetchAllUserMigrations() ([]*github.UserMigration, error) { diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index adb6fd2f238..1f7d10bfafc 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -16,7 +16,7 @@ import ( "time" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v68/github" + "github.com/google/go-github/v69/github" ) func main() { diff --git a/example/newrepo/main.go b/example/newrepo/main.go index d140ad58b15..33c80537acb 100644 --- a/example/newrepo/main.go +++ b/example/newrepo/main.go @@ -16,7 +16,7 @@ import ( "log" "os" - "github.com/google/go-github/v68/github" + "github.com/google/go-github/v69/github" ) var ( diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index b7b85f22b40..e90a28afde5 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -4,10 +4,10 @@ go 1.22.0 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb - github.com/google/go-github/v68 v68.0.0 + github.com/google/go-github/v69 v69.0.0 ) require github.com/google/go-querystring v1.1.0 // indirect // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v68 => ../.. +replace github.com/google/go-github/v69 => ../.. diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index cae03bb72bc..2ae76b8e831 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -36,7 +36,7 @@ import ( "os" sodium "github.com/GoKillers/libsodium-go/cryptobox" - "github.com/google/go-github/v68/github" + "github.com/google/go-github/v69/github" ) var ( diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index cf42b1c4b0f..b226b44a0cd 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -37,7 +37,7 @@ import ( "log" "os" - "github.com/google/go-github/v68/github" + "github.com/google/go-github/v69/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/ratelimit/main.go b/example/ratelimit/main.go index 38a2135c74d..32596bc3a96 100644 --- a/example/ratelimit/main.go +++ b/example/ratelimit/main.go @@ -13,7 +13,7 @@ import ( "fmt" "github.com/gofri/go-github-ratelimit/github_ratelimit" - "github.com/google/go-github/v68/github" + "github.com/google/go-github/v69/github" ) func main() { diff --git a/example/simple/main.go b/example/simple/main.go index e7454197ea1..8b11c308601 100644 --- a/example/simple/main.go +++ b/example/simple/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v68/github" + "github.com/google/go-github/v69/github" ) // Fetch all the public organizations' membership of a user. diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index cedbe3cc49b..6cf8680d47d 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -15,7 +15,7 @@ import ( "log" "os" - "github.com/google/go-github/v68/github" + "github.com/google/go-github/v69/github" "golang.org/x/term" ) diff --git a/example/topics/main.go b/example/topics/main.go index 6f51cf4e238..fb97e0b7884 100644 --- a/example/topics/main.go +++ b/example/topics/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v68/github" + "github.com/google/go-github/v69/github" ) // Fetch and lists all the public topics associated with the specified GitHub topic. diff --git a/example/verifyartifact/main.go b/example/verifyartifact/main.go index 9d85142c03b..1c6502e787c 100644 --- a/example/verifyartifact/main.go +++ b/example/verifyartifact/main.go @@ -18,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v68/github" + "github.com/google/go-github/v69/github" "github.com/sigstore/sigstore-go/pkg/bundle" "github.com/sigstore/sigstore-go/pkg/root" "github.com/sigstore/sigstore-go/pkg/verify" diff --git a/github/doc.go b/github/doc.go index 4a0f163a0bb..4deb94c7356 100644 --- a/github/doc.go +++ b/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v68/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v69/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to diff --git a/github/examples_test.go b/github/examples_test.go index b75d15363ff..418b6b6cf76 100644 --- a/github/examples_test.go +++ b/github/examples_test.go @@ -12,7 +12,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v68/github" + "github.com/google/go-github/v69/github" ) func ExampleMarkdownService_Render() { diff --git a/github/github.go b/github/github.go index b25e214a47b..fbff67f5640 100644 --- a/github/github.go +++ b/github/github.go @@ -28,7 +28,7 @@ import ( ) const ( - Version = "v68.0.0" + Version = "v69.0.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" diff --git a/go.mod b/go.mod index e367366bdc7..b08ff98195a 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v68 +module github.com/google/go-github/v69 go 1.22.0 diff --git a/test/fields/fields.go b/test/fields/fields.go index c85139b0891..a041907baea 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -25,7 +25,7 @@ import ( "reflect" "strings" - "github.com/google/go-github/v68/github" + "github.com/google/go-github/v69/github" ) var ( diff --git a/test/integration/activity_test.go b/test/integration/activity_test.go index ee069cfdc0c..89a5049f9c9 100644 --- a/test/integration/activity_test.go +++ b/test/integration/activity_test.go @@ -11,7 +11,7 @@ import ( "context" "testing" - "github.com/google/go-github/v68/github" + "github.com/google/go-github/v69/github" ) const ( diff --git a/test/integration/authorizations_test.go b/test/integration/authorizations_test.go index 729e08d262f..97c262752df 100644 --- a/test/integration/authorizations_test.go +++ b/test/integration/authorizations_test.go @@ -14,7 +14,7 @@ import ( "testing" "time" - "github.com/google/go-github/v68/github" + "github.com/google/go-github/v69/github" ) const msgEnvMissing = "Skipping test because the required environment variable (%v) is not present." diff --git a/test/integration/github_test.go b/test/integration/github_test.go index 236c2c98ae5..059e11ec8b0 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -14,7 +14,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v68/github" + "github.com/google/go-github/v69/github" ) var ( diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index 4295e50a898..936dc5b7f7f 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -14,7 +14,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v68/github" + "github.com/google/go-github/v69/github" ) func TestRepositories_CRUD(t *testing.T) { diff --git a/test/integration/users_test.go b/test/integration/users_test.go index a6e15b0084e..0589bb773a1 100644 --- a/test/integration/users_test.go +++ b/test/integration/users_test.go @@ -13,7 +13,7 @@ import ( "math/rand" "testing" - "github.com/google/go-github/v68/github" + "github.com/google/go-github/v69/github" ) func TestUsers_Get(t *testing.T) { diff --git a/tools/go.mod b/tools/go.mod index 2448ec55cb3..9688f8cbbb3 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -6,7 +6,7 @@ require ( github.com/alecthomas/kong v1.7.0 github.com/getkin/kin-openapi v0.128.0 github.com/google/go-cmp v0.6.0 - github.com/google/go-github/v68 v68.0.0 + github.com/google/go-github/v69 v69.0.0 golang.org/x/sync v0.10.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -24,4 +24,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v68 => ../ +replace github.com/google/go-github/v69 => ../ diff --git a/tools/metadata/main.go b/tools/metadata/main.go index 5191a178beb..ceb7117aa55 100644 --- a/tools/metadata/main.go +++ b/tools/metadata/main.go @@ -16,7 +16,7 @@ import ( "path/filepath" "github.com/alecthomas/kong" - "github.com/google/go-github/v68/github" + "github.com/google/go-github/v69/github" ) var helpVars = kong.Vars{ diff --git a/tools/metadata/main_test.go b/tools/metadata/main_test.go index 2b16215f218..251293d2b7d 100644 --- a/tools/metadata/main_test.go +++ b/tools/metadata/main_test.go @@ -23,7 +23,7 @@ import ( "github.com/alecthomas/kong" "github.com/getkin/kin-openapi/openapi3" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v68/github" + "github.com/google/go-github/v69/github" ) func TestUpdateGo(t *testing.T) { diff --git a/tools/metadata/metadata.go b/tools/metadata/metadata.go index c021c868e67..101b3eeb6ac 100644 --- a/tools/metadata/metadata.go +++ b/tools/metadata/metadata.go @@ -24,7 +24,7 @@ import ( "strings" "sync" - "github.com/google/go-github/v68/github" + "github.com/google/go-github/v69/github" "gopkg.in/yaml.v3" ) diff --git a/tools/metadata/openapi.go b/tools/metadata/openapi.go index 40c6cc689f5..6088295e4da 100644 --- a/tools/metadata/openapi.go +++ b/tools/metadata/openapi.go @@ -14,7 +14,7 @@ import ( "strconv" "github.com/getkin/kin-openapi/openapi3" - "github.com/google/go-github/v68/github" + "github.com/google/go-github/v69/github" "golang.org/x/sync/errgroup" ) From 8bd68fe777b84e48501b8dd4b532ac35f3fba666 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Wed, 5 Feb 2025 09:52:28 -0500 Subject: [PATCH 638/751] Bump go-github from v68 to v69 in /scrape (#3464) --- scrape/apps.go | 2 +- scrape/apps_test.go | 2 +- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scrape/apps.go b/scrape/apps.go index 686cf773800..2111535330a 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -18,7 +18,7 @@ import ( "strings" "github.com/PuerkitoBio/goquery" - "github.com/google/go-github/v68/github" + "github.com/google/go-github/v69/github" ) // AppRestrictionsEnabled returns whether the specified organization has diff --git a/scrape/apps_test.go b/scrape/apps_test.go index 31db5cc504a..b26f6ceb4d1 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -10,7 +10,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v68/github" + "github.com/google/go-github/v69/github" ) func Test_AppRestrictionsEnabled(t *testing.T) { diff --git a/scrape/go.mod b/scrape/go.mod index e0d91574d21..76b28c54adb 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -5,7 +5,7 @@ go 1.22.0 require ( github.com/PuerkitoBio/goquery v1.9.3 github.com/google/go-cmp v0.6.0 - github.com/google/go-github/v68 v68.0.0 + github.com/google/go-github/v69 v69.0.0 github.com/xlzd/gotp v0.1.0 golang.org/x/net v0.34.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index 9e164640eaa..b6c509fb2dc 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -5,8 +5,8 @@ github.com/andybalholm/cascadia v1.3.3/go.mod h1:xNd9bqTn98Ln4DwST8/nG+H0yuB8Hmg github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v68 v68.0.0 h1:ZW57zeNZiXTdQ16qrDiZ0k6XucrxZ2CGmoTvcCyQG6s= -github.com/google/go-github/v68 v68.0.0/go.mod h1:K9HAUBovM2sLwM408A18h+wd9vqdLOEqTUCbnRIcx68= +github.com/google/go-github/v69 v69.0.0 h1:YnFvZ3pEIZF8KHmI8xyQQe3mYACdkhnaTV2hr7CP2/w= +github.com/google/go-github/v69 v69.0.0/go.mod h1:xne4jymxLR6Uj9b7J7PyTpkMYstEMMwGZa0Aehh1azM= 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.1.0 h1:37blvlKCh38s+fkem+fFh7sMnceltoIEBYTVXyoa5Po= From a4333f357af781939c41a9964e9adca7a705b086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Sal=C3=A9?= Date: Wed, 5 Feb 2025 16:19:45 +0100 Subject: [PATCH 639/751] Use a max retry after duration for secondary rate limit if specified (#3438) --- github/github.go | 8 ++++++++ github/github_test.go | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/github/github.go b/github/github.go index fbff67f5640..9c5ca1f9241 100644 --- a/github/github.go +++ b/github/github.go @@ -176,6 +176,10 @@ type Client struct { rateLimits [Categories]Rate // Rate limits for the client as determined by the most recent API calls. secondaryRateLimitReset time.Time // Secondary rate limit reset for the client as determined by the most recent API calls. + // If specified, Client will block requests for at most this duration in case of reaching a secondary + // rate limit + MaxSecondaryRateLimitRetryAfterDuration time.Duration + // Whether to respect rate limit headers on endpoints that return 302 redirections to artifacts RateLimitRedirectionalEndpoints bool @@ -928,6 +932,10 @@ func (c *Client) bareDo(ctx context.Context, caller *http.Client, req *http.Requ // Update the secondary rate limit if we hit it. rerr, ok := err.(*AbuseRateLimitError) if ok && rerr.RetryAfter != nil { + // if a max duration is specified, make sure that we are waiting at most this duration + if c.MaxSecondaryRateLimitRetryAfterDuration > 0 && rerr.GetRetryAfter() > c.MaxSecondaryRateLimitRetryAfterDuration { + rerr.RetryAfter = &c.MaxSecondaryRateLimitRetryAfterDuration + } c.rateMu.Lock() c.secondaryRateLimitReset = time.Now().Add(*rerr.RetryAfter) c.rateMu.Unlock() diff --git a/github/github_test.go b/github/github_test.go index 77dffe57ab7..b402f098413 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -1852,6 +1852,47 @@ func TestDo_rateLimit_abuseRateLimitError_xRateLimitReset(t *testing.T) { } } +// Ensure *AbuseRateLimitError.RetryAfter respect a max duration if specified. +func TestDo_rateLimit_abuseRateLimitError_maxDuration(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + // specify a max retry after duration of 1 min + client.MaxSecondaryRateLimitRetryAfterDuration = 60 * time.Second + + // x-ratelimit-reset value of 1h into the future, to make sure we are way over the max wait time duration. + blockUntil := time.Now().Add(1 * time.Hour).Unix() + + mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=utf-8") + w.Header().Set(headerRateReset, strconv.Itoa(int(blockUntil))) + w.Header().Set(headerRateRemaining, "1") // set remaining to a value > 0 to distinct from a primary rate limit + w.WriteHeader(http.StatusForbidden) + fmt.Fprintln(w, `{ + "message": "You have triggered an abuse detection mechanism ...", + "documentation_url": "https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits" +}`) + }) + + req, _ := client.NewRequest("GET", ".", nil) + ctx := context.Background() + _, err := client.Do(ctx, req, nil) + + if err == nil { + t.Error("Expected error to be returned.") + } + abuseRateLimitErr, ok := err.(*AbuseRateLimitError) + if !ok { + t.Fatalf("Expected a *AbuseRateLimitError error; got %#v.", err) + } + if abuseRateLimitErr.RetryAfter == nil { + t.Fatalf("abuseRateLimitErr RetryAfter is nil, expected not-nil") + } + // check that the retry after is set to be the max allowed duration + if got, want := *abuseRateLimitErr.RetryAfter, client.MaxSecondaryRateLimitRetryAfterDuration; got != want { + t.Errorf("abuseRateLimitErr RetryAfter = %v, want %v", got, want) + } +} + func TestDo_noContent(t *testing.T) { t.Parallel() client, mux, _ := setup(t) From 24b0795da596f7fd1ab122ce230dc78c66db79dc Mon Sep 17 00:00:00 2001 From: Evan Elias Date: Wed, 5 Feb 2025 19:14:09 -0500 Subject: [PATCH 640/751] docs: Clarify ListPullRequestsWithCommit usage (#3465) --- github/pulls.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/github/pulls.go b/github/pulls.go index 64480194640..f3c6e929c1c 100644 --- a/github/pulls.go +++ b/github/pulls.go @@ -169,10 +169,12 @@ func (s *PullRequestsService) List(ctx context.Context, owner string, repo strin return pulls, resp, nil } -// ListPullRequestsWithCommit returns pull requests associated with a commit SHA. +// ListPullRequestsWithCommit returns pull requests associated with a commit SHA +// or branch name. // -// The results may include open and closed pull requests. -// By default, the PullRequestListOptions State filters for "open". +// The results may include open and closed pull requests. If the commit SHA is +// not present in the repository's default branch, the result will only include +// open pull requests. // // GitHub API docs: https://docs.github.com/rest/commits/commits#list-pull-requests-associated-with-a-commit // From 0ccbfafab39fab2446aea0a517d5708a713c79a9 Mon Sep 17 00:00:00 2001 From: Aman Verma Date: Thu, 6 Feb 2025 19:01:37 +0530 Subject: [PATCH 641/751] fix: go 1.22 test breakage (#3459) --- README.md | 13 ------ github/orgs_packages_test.go | 14 +++--- github/repos_commits_test.go | 20 +++++++-- github/repos_contents_test.go | 4 +- github/repos_test.go | 84 +++++++++++++++++------------------ script/test.sh | 2 - 6 files changed, 67 insertions(+), 70 deletions(-) diff --git a/README.md b/README.md index 8f4e5dec0ab..d922918263c 100644 --- a/README.md +++ b/README.md @@ -22,19 +22,6 @@ go-github will require the N-1 major release of Go by default. ## Development -Go version 1.22 introduced significant changes to the pattern syntax and matching -behavior of `http.ServerMux` which causes a large number of legacy unit tests to break. -(See https://pkg.go.dev/net/http#hdr-Compatibility-ServeMux for more information.) -As a result, testing of this repo is currently performed by setting this env variable: - -```bash -export GODEBUG=httpmuxgo121=1 -``` - -An issue has been created (#3409) requesting assistance in updating all breaking legacy unit -tests when this `GODEBUG` environment variable is not set and Go 1.23.4 or later is -used to perform unit tests. - If you're interested in using the [GraphQL API v4][], the recommended library is [shurcooL/githubv4][]. diff --git a/github/orgs_packages_test.go b/github/orgs_packages_test.go index 5aa783d26e0..836584a1152 100644 --- a/github/orgs_packages_test.go +++ b/github/orgs_packages_test.go @@ -118,7 +118,7 @@ func TestOrganizationsService_GetPackage(t *testing.T) { client, mux, _ := setup(t) // don't url escape the package name here since mux will convert it to a slash automatically - mux.HandleFunc("/orgs/o/packages/container/hello/hello_docker", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/packages/container/hello%2fhello_docker", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") _, err := io.WriteString(w, `{ "id": 197, @@ -177,7 +177,7 @@ func TestOrganizationsService_DeletePackage(t *testing.T) { client, mux, _ := setup(t) // don't url escape the package name here since mux will convert it to a slash automatically - mux.HandleFunc("/orgs/o/packages/container/hello/hello_docker", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/packages/container/hello%2fhello_docker", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) @@ -207,7 +207,7 @@ func TestOrganizationsService_RestorePackage(t *testing.T) { client, mux, _ := setup(t) // don't url escape the package name here since mux will convert it to a slash automatically - mux.HandleFunc("/orgs/o/packages/container/hello/hello_docker/restore", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/packages/container/hello%2Fhello_docker/restore", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") }) @@ -233,7 +233,7 @@ func TestOrganizationsService_ListPackagesVersions(t *testing.T) { client, mux, _ := setup(t) // don't url escape the package name here since mux will convert it to a slash automatically - mux.HandleFunc("/orgs/o/packages/container/hello/hello_docker/versions", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/packages/container/hello%2Fhello_docker/versions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") testFormValues(t, r, values{"per_page": "2", "page": "1", "state": "deleted", "visibility": "internal", "package_type": "container"}) _, err := io.WriteString(w, `[ @@ -307,7 +307,7 @@ func TestOrganizationsService_PackageGetVersion(t *testing.T) { client, mux, _ := setup(t) // don't url escape the package name here since mux will convert it to a slash automatically - mux.HandleFunc("/orgs/o/packages/container/hello/hello_docker/versions/45763", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/packages/container/hello%2Fhello_docker/versions/45763", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") _, err := io.WriteString(w, ` { @@ -377,7 +377,7 @@ func TestOrganizationsService_PackageDeleteVersion(t *testing.T) { client, mux, _ := setup(t) // don't url escape the package name here since mux will convert it to a slash automatically - mux.HandleFunc("/orgs/o/packages/container/hello/hello_docker/versions/45763", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/packages/container/hello%2Fhello_docker/versions/45763", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) @@ -403,7 +403,7 @@ func TestOrganizationsService_PackageRestoreVersion(t *testing.T) { client, mux, _ := setup(t) // don't url escape the package name here since mux will convert it to a slash automatically - mux.HandleFunc("/orgs/o/packages/container/hello/hello_docker/versions/45763/restore", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/packages/container/hello%2Fhello_docker/versions/45763/restore", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") }) diff --git a/github/repos_commits_test.go b/github/repos_commits_test.go index eba7e7520ad..3c1ac8f33c6 100644 --- a/github/repos_commits_test.go +++ b/github/repos_commits_test.go @@ -296,7 +296,7 @@ func TestRepositoriesService_NonAlphabetCharacter_GetCommitSHA1(t *testing.T) { const sha1 = "01234abcde" - mux.HandleFunc("/repos/o/r/commits/master%20hash", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/commits/master%2520hash", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") testHeader(t, r, "Accept", mediaTypeV3SHA) @@ -391,10 +391,14 @@ func TestRepositoriesService_CompareCommits(t *testing.T) { base := sample.base head := sample.head + + encodedBase := url.PathEscape(base) + encodedHead := url.PathEscape(head) + escapedBase := url.QueryEscape(base) escapedHead := url.QueryEscape(head) - pattern := fmt.Sprintf("/repos/o/r/compare/%v...%v", base, head) + pattern := fmt.Sprintf("/repos/o/r/compare/%v...%v", encodedBase, encodedHead) mux.HandleFunc(pattern, func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -529,7 +533,11 @@ func TestRepositoriesService_CompareCommitsRaw_diff(t *testing.T) { base := sample.base head := sample.head - pattern := fmt.Sprintf("/repos/o/r/compare/%v...%v", base, head) + + encodedBase := url.PathEscape(base) + encodedHead := url.PathEscape(head) + + pattern := fmt.Sprintf("/repos/o/r/compare/%v...%v", encodedBase, encodedHead) const rawStr = "@@diff content" mux.HandleFunc(pattern, func(w http.ResponseWriter, r *http.Request) { @@ -584,7 +592,11 @@ func TestRepositoriesService_CompareCommitsRaw_patch(t *testing.T) { base := sample.base head := sample.head - pattern := fmt.Sprintf("/repos/o/r/compare/%v...%v", base, head) + + encodedBase := url.PathEscape(base) + encodedHead := url.PathEscape(head) + + pattern := fmt.Sprintf("/repos/o/r/compare/%v...%v", encodedBase, encodedHead) const rawStr = "@@patch content" mux.HandleFunc(pattern, func(w http.ResponseWriter, r *http.Request) { diff --git a/github/repos_contents_test.go b/github/repos_contents_test.go index 84f660eca15..d5ad45a0f21 100644 --- a/github/repos_contents_test.go +++ b/github/repos_contents_test.go @@ -472,7 +472,7 @@ func TestRepositoriesService_GetContents_DirectoryWithSpaces(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/contents/some directory/file.go", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/contents/some%20directory/file.go", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `{}`) }) @@ -502,7 +502,7 @@ func TestRepositoriesService_GetContents_DirectoryWithPlusChars(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/contents/some directory+name/file.go", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/contents/some%20directory%2Bname/file.go", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `{}`) }) diff --git a/github/repos_test.go b/github/repos_test.go index 90b00573702..ccbbf13384e 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -925,7 +925,7 @@ func TestRepositoriesService_GetBranch(t *testing.T) { urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25"}, } for _, test := range tests { @@ -975,7 +975,7 @@ func TestRepositoriesService_GetBranch_BadJSONResponse(t *testing.T) { urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25"}, } for _, test := range tests { @@ -1089,7 +1089,7 @@ func TestRepositoriesService_RenameBranch(t *testing.T) { urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/rename"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/rename"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/rename"}, } for _, test := range tests { @@ -1149,7 +1149,7 @@ func TestRepositoriesService_GetBranchProtection(t *testing.T) { enforceAdminsURLPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection", enforceAdminsURLPath: "/repos/o/r/branches/b/protection/enforce_admins"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection", enforceAdminsURLPath: "/repos/o/r/branches/feat/branch-50%/protection/enforce_admins"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection", enforceAdminsURLPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection/enforce_admins"}, } for _, test := range tests { @@ -1309,7 +1309,7 @@ func TestRepositoriesService_GetBranchProtection_noDismissalRestrictions(t *test enforceAdminsURLPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection", enforceAdminsURLPath: "/repos/o/r/branches/b/protection/enforce_admins"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection", enforceAdminsURLPath: "/repos/o/r/branches/feat/branch-50%/protection/enforce_admins"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection", enforceAdminsURLPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection/enforce_admins"}, } for _, test := range tests { @@ -1392,7 +1392,7 @@ func TestRepositoriesService_GetBranchProtection_branchNotProtected(t *testing.T urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection"}, } for _, test := range tests { @@ -1432,7 +1432,7 @@ func TestRepositoriesService_UpdateBranchProtection_Contexts(t *testing.T) { urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection"}, } for _, test := range tests { @@ -1622,7 +1622,7 @@ func TestRepositoriesService_UpdateBranchProtection_EmptyContexts(t *testing.T) urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection"}, } for _, test := range tests { @@ -1802,7 +1802,7 @@ func TestRepositoriesService_UpdateBranchProtection_Checks(t *testing.T) { urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection"}, } for _, test := range tests { @@ -1961,7 +1961,7 @@ func TestRepositoriesService_UpdateBranchProtection_EmptyChecks(t *testing.T) { urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection"}, } for _, test := range tests { @@ -2106,7 +2106,7 @@ func TestRepositoriesService_UpdateBranchProtection_StrictNoChecks(t *testing.T) urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection"}, } for _, test := range tests { @@ -2250,7 +2250,7 @@ func TestRepositoriesService_UpdateBranchProtection_RequireLastPushApproval(t *t urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection"}, } for _, test := range tests { @@ -2306,7 +2306,7 @@ func TestRepositoriesService_RemoveBranchProtection(t *testing.T) { urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection"}, } for _, test := range tests { @@ -2401,7 +2401,7 @@ func TestRepositoriesService_GetRequiredStatusChecks(t *testing.T) { urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection/required_status_checks"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/required_status_checks"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection/required_status_checks"}, } for _, test := range tests { @@ -2481,7 +2481,7 @@ func TestRepositoriesService_GetRequiredStatusChecks_branchNotProtected(t *testi urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection/required_status_checks"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/required_status_checks"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection/required_status_checks"}, } for _, test := range tests { @@ -2521,7 +2521,7 @@ func TestRepositoriesService_UpdateRequiredStatusChecks_Contexts(t *testing.T) { urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection/required_status_checks"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/required_status_checks"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection/required_status_checks"}, } for _, test := range tests { @@ -2599,7 +2599,7 @@ func TestRepositoriesService_UpdateRequiredStatusChecks_Checks(t *testing.T) { urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection/required_status_checks"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/required_status_checks"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection/required_status_checks"}, } for _, test := range tests { @@ -2692,7 +2692,7 @@ func TestRepositoriesService_RemoveRequiredStatusChecks(t *testing.T) { urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection/required_status_checks"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/required_status_checks"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection/required_status_checks"}, } for _, test := range tests { @@ -2733,7 +2733,7 @@ func TestRepositoriesService_ListRequiredStatusChecksContexts(t *testing.T) { urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection/required_status_checks/contexts"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/required_status_checks/contexts"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection/required_status_checks/contexts"}, } for _, test := range tests { @@ -2782,7 +2782,7 @@ func TestRepositoriesService_ListRequiredStatusChecksContexts_branchNotProtected urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection/required_status_checks/contexts"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/required_status_checks/contexts"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection/required_status_checks/contexts"}, } for _, test := range tests { @@ -2822,7 +2822,7 @@ func TestRepositoriesService_GetPullRequestReviewEnforcement(t *testing.T) { urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection/required_pull_request_reviews"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/required_pull_request_reviews"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection/required_pull_request_reviews"}, } for _, test := range tests { @@ -2898,7 +2898,7 @@ func TestRepositoriesService_UpdatePullRequestReviewEnforcement(t *testing.T) { urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection/required_pull_request_reviews"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/required_pull_request_reviews"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection/required_pull_request_reviews"}, } for _, test := range tests { @@ -2987,7 +2987,7 @@ func TestRepositoriesService_DisableDismissalRestrictions(t *testing.T) { urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection/required_pull_request_reviews"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/required_pull_request_reviews"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection/required_pull_request_reviews"}, } for _, test := range tests { @@ -3044,7 +3044,7 @@ func TestRepositoriesService_RemovePullRequestReviewEnforcement(t *testing.T) { urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection/required_pull_request_reviews"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/required_pull_request_reviews"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection/required_pull_request_reviews"}, } for _, test := range tests { @@ -3084,7 +3084,7 @@ func TestRepositoriesService_GetAdminEnforcement(t *testing.T) { urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection/enforce_admins"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/enforce_admins"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection/enforce_admins"}, } for _, test := range tests { @@ -3137,7 +3137,7 @@ func TestRepositoriesService_AddAdminEnforcement(t *testing.T) { urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection/enforce_admins"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/enforce_admins"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection/enforce_admins"}, } for _, test := range tests { @@ -3189,7 +3189,7 @@ func TestRepositoriesService_RemoveAdminEnforcement(t *testing.T) { urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection/enforce_admins"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/enforce_admins"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection/enforce_admins"}, } for _, test := range tests { @@ -3229,7 +3229,7 @@ func TestRepositoriesService_GetSignaturesProtectedBranch(t *testing.T) { urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection/required_signatures"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/required_signatures"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection/required_signatures"}, } for _, test := range tests { @@ -3283,7 +3283,7 @@ func TestRepositoriesService_RequireSignaturesOnProtectedBranch(t *testing.T) { urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection/required_signatures"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/required_signatures"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection/required_signatures"}, } for _, test := range tests { @@ -3337,7 +3337,7 @@ func TestRepositoriesService_OptionalSignaturesOnProtectedBranch(t *testing.T) { urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection/required_signatures"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/required_signatures"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection/required_signatures"}, } for _, test := range tests { @@ -3566,7 +3566,7 @@ func TestRepositoriesService_ListAppRestrictions(t *testing.T) { urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection/restrictions/apps"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/restrictions/apps"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection/restrictions/apps"}, } for _, test := range tests { @@ -3609,7 +3609,7 @@ func TestRepositoriesService_ReplaceAppRestrictions(t *testing.T) { urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection/restrictions/apps"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/restrictions/apps"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection/restrictions/apps"}, } for _, test := range tests { @@ -3661,7 +3661,7 @@ func TestRepositoriesService_AddAppRestrictions(t *testing.T) { urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection/restrictions/apps"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/restrictions/apps"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection/restrictions/apps"}, } for _, test := range tests { @@ -3713,7 +3713,7 @@ func TestRepositoriesService_RemoveAppRestrictions(t *testing.T) { urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection/restrictions/apps"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/restrictions/apps"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection/restrictions/apps"}, } for _, test := range tests { @@ -3761,7 +3761,7 @@ func TestRepositoriesService_ListTeamRestrictions(t *testing.T) { urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection/restrictions/teams"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/restrictions/teams"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection/restrictions/teams"}, } for _, test := range tests { @@ -3804,7 +3804,7 @@ func TestRepositoriesService_ReplaceTeamRestrictions(t *testing.T) { urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection/restrictions/teams"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/restrictions/teams"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection/restrictions/teams"}, } for _, test := range tests { @@ -3856,7 +3856,7 @@ func TestRepositoriesService_AddTeamRestrictions(t *testing.T) { urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection/restrictions/teams"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/restrictions/teams"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection/restrictions/teams"}, } for _, test := range tests { @@ -3908,7 +3908,7 @@ func TestRepositoriesService_RemoveTeamRestrictions(t *testing.T) { urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection/restrictions/teams"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/restrictions/teams"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection/restrictions/teams"}, } for _, test := range tests { @@ -3956,7 +3956,7 @@ func TestRepositoriesService_ListUserRestrictions(t *testing.T) { urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection/restrictions/users"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/restrictions/users"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection/restrictions/users"}, } for _, test := range tests { @@ -3999,7 +3999,7 @@ func TestRepositoriesService_ReplaceUserRestrictions(t *testing.T) { urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection/restrictions/users"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/restrictions/users"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection/restrictions/users"}, } for _, test := range tests { @@ -4051,7 +4051,7 @@ func TestRepositoriesService_AddUserRestrictions(t *testing.T) { urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection/restrictions/users"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/restrictions/users"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection/restrictions/users"}, } for _, test := range tests { @@ -4103,7 +4103,7 @@ func TestRepositoriesService_RemoveUserRestrictions(t *testing.T) { urlPath string }{ {branch: "b", urlPath: "/repos/o/r/branches/b/protection/restrictions/users"}, - {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat/branch-50%/protection/restrictions/users"}, + {branch: "feat/branch-50%", urlPath: "/repos/o/r/branches/feat%2fbranch-50%25/protection/restrictions/users"}, } for _, test := range tests { diff --git a/script/test.sh b/script/test.sh index 6cff1ac6952..dedd832ecad 100755 --- a/script/test.sh +++ b/script/test.sh @@ -7,8 +7,6 @@ set -e CDPATH="" cd -- "$(dirname -- "$0")/.." -# TODO(gmlewis): Remove this when #3409 is resolved. -export GODEBUG=httpmuxgo121=1 if [ "$#" = "0" ]; then set -- -race -covermode atomic ./... From ef0b26bf03beb655d057814fce6a85d3a025bd9e Mon Sep 17 00:00:00 2001 From: Luke Young Date: Sat, 8 Feb 2025 12:38:49 -0800 Subject: [PATCH 642/751] feat: Add link to bored-engineer/github-conditional-http-transport to conditional requests documentation (#3469) --- README.md | 26 ++++++++++++++++---------- github/doc.go | 16 +++++++++++----- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index d922918263c..378e801f394 100644 --- a/README.md +++ b/README.md @@ -257,22 +257,28 @@ if _, ok := err.(*github.AcceptedError); ok { ### Conditional Requests ### -The GitHub API has good support for conditional requests which will help -prevent you from burning through your rate limit, as well as help speed up your -application. `go-github` does not handle conditional requests directly, but is -instead designed to work with a caching `http.Transport`. We recommend using -[gregjones/httpcache](https://github.com/gregjones/httpcache) for that. For example: +The GitHub REST API has good support for [conditional HTTP requests](https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api?apiVersion=2022-11-28#use-conditional-requests-if-appropriate) +via the `ETag` header which will help prevent you from burning through your +rate limit, as well as help speed up your application. `go-github` does not +handle conditional requests directly, but is instead designed to work with a +caching `http.Transport`. + +Typically, an [RFC 7234](https://datatracker.ietf.org/doc/html/rfc7234) +compliant HTTP cache such as [gregjones/httpcache](https://github.com/gregjones/httpcache) +is recommended, ex: ```go import "github.com/gregjones/httpcache" - client := github.NewClient( - httpcache.NewMemoryCacheTransport().Client() - ).WithAuthToken(os.Getenv("GITHUB_TOKEN")) +client := github.NewClient( + httpcache.NewMemoryCacheTransport().Client() +).WithAuthToken(os.Getenv("GITHUB_TOKEN")) ``` -Learn more about GitHub conditional requests in -["Use conditional requests if appropriate"](https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api?apiVersion=2022-11-28#use-conditional-requests-if-appropriate). +Alternatively, the [bored-engineer/github-conditional-http-transport](https://github.com/bored-engineer/github-conditional-http-transport) +package relies on (undocumented) GitHub specific cache logic and is +recommended when making requests using short-lived credentials such as a +[GitHub App installation token](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app-installation). ### Creating and Updating Resources ### diff --git a/github/doc.go b/github/doc.go index 4deb94c7356..79d92d9ee07 100644 --- a/github/doc.go +++ b/github/doc.go @@ -138,11 +138,17 @@ To detect this condition of error, you can check if its type is # Conditional Requests -The GitHub API has good support for conditional requests which will help -prevent you from burning through your rate limit, as well as help speed up your -application. go-github does not handle conditional requests directly, but is -instead designed to work with a caching http.Transport. We recommend using -https://github.com/gregjones/httpcache for that. +The GitHub REST API has good support for conditional HTTP requests +via the ETag header which will help prevent you from burning through your +rate limit, as well as help speed up your application. go-github does not +handle conditional requests directly, but is instead designed to work with a +caching http.Transport. + +Typically, an RFC 7234 compliant HTTP cache such as https://github.com/gregjones/httpcache +is recommended. Alternatively, the https://github.com/bored-engineer/github-conditional-http-transport +package relies on (undocumented) GitHub specific cache logic and is +recommended when making requests using short-lived credentials such as a +GitHub App installation token. Learn more about GitHub conditional requests at https://docs.github.com/rest/overview/resources-in-the-rest-api#conditional-requests. From f4966a048628783175ffd657ff2c8f55cf5362f8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 15:36:55 -0500 Subject: [PATCH 643/751] build(deps): bump golang.org/x/sync from 0.10.0 to 0.11.0 in /tools (#3472) --- tools/go.mod | 2 +- tools/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index 9688f8cbbb3..b7e8fa10fd3 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -7,7 +7,7 @@ require ( github.com/getkin/kin-openapi v0.128.0 github.com/google/go-cmp v0.6.0 github.com/google/go-github/v69 v69.0.0 - golang.org/x/sync v0.10.0 + golang.org/x/sync v0.11.0 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/tools/go.sum b/tools/go.sum index 362da48550b..ea7cf78da46 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -43,8 +43,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= -golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= -golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= +golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= From 44929b0928a43467f7100b7aabafa5e915041b2b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 15:40:30 -0500 Subject: [PATCH 644/751] build(deps): bump golang.org/x/net from 0.34.0 to 0.35.0 in /scrape (#3470) --- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 76b28c54adb..0f060bedb7a 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -7,7 +7,7 @@ require ( github.com/google/go-cmp v0.6.0 github.com/google/go-github/v69 v69.0.0 github.com/xlzd/gotp v0.1.0 - golang.org/x/net v0.34.0 + golang.org/x/net v0.35.0 ) require ( diff --git a/scrape/go.sum b/scrape/go.sum index b6c509fb2dc..4904ccf0e6b 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -32,8 +32,8 @@ golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= -golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= -golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= +golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= +golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= From 3d4784ce593890ed7b2c091b2260ab65b7d4ffdb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 15:44:51 -0500 Subject: [PATCH 645/751] build(deps): bump github.com/alecthomas/kong from 1.7.0 to 1.8.0 in /tools (#3471) --- tools/go.mod | 2 +- tools/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index b7e8fa10fd3..32d273b9bdc 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -3,7 +3,7 @@ module tools go 1.22.0 require ( - github.com/alecthomas/kong v1.7.0 + github.com/alecthomas/kong v1.8.0 github.com/getkin/kin-openapi v0.128.0 github.com/google/go-cmp v0.6.0 github.com/google/go-github/v69 v69.0.0 diff --git a/tools/go.sum b/tools/go.sum index ea7cf78da46..ecf4dc6f71f 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -1,7 +1,7 @@ github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0= github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= -github.com/alecthomas/kong v1.7.0 h1:MnT8+5JxFDCvISeI6vgd/mFbAJwueJ/pqQNzZMsiqZE= -github.com/alecthomas/kong v1.7.0/go.mod h1:p2vqieVMeTAnaC83txKtXe8FLke2X07aruPWXyMPQrU= +github.com/alecthomas/kong v1.8.0 h1:LEDIdSYrHU+4oTF2BL0NAfw++wH6lg/LzAJodTkLikM= +github.com/alecthomas/kong v1.8.0/go.mod h1:p2vqieVMeTAnaC83txKtXe8FLke2X07aruPWXyMPQrU= github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc= github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= From 26f71a3d3f6d53daf460238ab85e9e0c55f5dadd Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Tue, 11 Feb 2025 14:22:53 -0500 Subject: [PATCH 646/751] Update workflow and tools to use Go1.24 and 1.23 (#3474) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 010d806491b..16c021bc462 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,7 +27,7 @@ jobs: shell: bash strategy: matrix: - go-version: [1.x, 1.22.0] # test with N and the .0 release of N-1 + go-version: [1.x, 1.23.0] # test with N and the .0 release of N-1 platform: [ubuntu-latest] include: # include windows, but only with the latest Go version, since there From ce42642afed56ca5ae63c2c1efeb87bf2762d2c6 Mon Sep 17 00:00:00 2001 From: Ciaran Moran Date: Tue, 11 Feb 2025 23:04:41 +0000 Subject: [PATCH 647/751] chore: Only use master test runs for status badge (#3475) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 378e801f394..3cf4f240f8c 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![go-github release (latest SemVer)](https://img.shields.io/github/v/release/google/go-github?sort=semver)](https://github.com/google/go-github/releases) [![Go Reference](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v69/github) -[![Test Status](https://github.com/google/go-github/workflows/tests/badge.svg)](https://github.com/google/go-github/actions?query=workflow%3Atests) +[![Test Status](https://github.com/google/go-github/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/google/go-github/actions/workflows/tests.yml) [![Test Coverage](https://codecov.io/gh/google/go-github/branch/master/graph/badge.svg)](https://codecov.io/gh/google/go-github) [![Discuss at go-github@googlegroups.com](https://img.shields.io/badge/discuss-go--github%40googlegroups.com-blue.svg)](https://groups.google.com/group/go-github) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/796/badge)](https://bestpractices.coreinfrastructure.org/projects/796) From 77684a471bb9e7a677c09991025db547bdf82407 Mon Sep 17 00:00:00 2001 From: Travis Fields <1703710+cyberious@users.noreply.github.com> Date: Tue, 11 Feb 2025 16:17:27 -0800 Subject: [PATCH 648/751] feat: Add ListProvisionedScimGroupsForEnterprise inside SCIM service (#3467) --- github/github-accessors.go | 64 ++++++++++++++++++++++ github/github-accessors_test.go | 85 +++++++++++++++++++++++++++++ github/scim.go | 51 ++++++++++++++++++ github/scim_test.go | 94 +++++++++++++++++++++++++++++++++ 4 files changed, 294 insertions(+) diff --git a/github/github-accessors.go b/github/github-accessors.go index 1685959173c..6270bc1fc6c 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -23894,6 +23894,46 @@ func (s *ScanningAnalysis) GetWarning() string { return *s.Warning } +// GetDisplay returns the Display field if it's non-nil, zero value otherwise. +func (s *SCIMDisplayReference) GetDisplay() string { + if s == nil || s.Display == nil { + return "" + } + return *s.Display +} + +// GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise. +func (s *SCIMGroupAttributes) GetDisplayName() string { + if s == nil || s.DisplayName == nil { + return "" + } + return *s.DisplayName +} + +// GetExternalID returns the ExternalID field if it's non-nil, zero value otherwise. +func (s *SCIMGroupAttributes) GetExternalID() string { + if s == nil || s.ExternalID == nil { + return "" + } + return *s.ExternalID +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (s *SCIMGroupAttributes) GetID() string { + if s == nil || s.ID == nil { + return "" + } + return *s.ID +} + +// GetMeta returns the Meta field. +func (s *SCIMGroupAttributes) GetMeta() *SCIMMeta { + if s == nil { + return nil + } + return s.Meta +} + // GetCreated returns the Created field if it's non-nil, zero value otherwise. func (s *SCIMMeta) GetCreated() Timestamp { if s == nil || s.Created == nil { @@ -23926,6 +23966,30 @@ func (s *SCIMMeta) GetResourceType() string { return *s.ResourceType } +// GetItemsPerPage returns the ItemsPerPage field if it's non-nil, zero value otherwise. +func (s *SCIMProvisionedGroups) GetItemsPerPage() int { + if s == nil || s.ItemsPerPage == nil { + return 0 + } + return *s.ItemsPerPage +} + +// GetStartIndex returns the StartIndex field if it's non-nil, zero value otherwise. +func (s *SCIMProvisionedGroups) GetStartIndex() int { + if s == nil || s.StartIndex == nil { + return 0 + } + return *s.StartIndex +} + +// GetTotalResults returns the TotalResults field if it's non-nil, zero value otherwise. +func (s *SCIMProvisionedGroups) GetTotalResults() int { + if s == nil || s.TotalResults == nil { + return 0 + } + return *s.TotalResults +} + // GetItemsPerPage returns the ItemsPerPage field if it's non-nil, zero value otherwise. func (s *SCIMProvisionedIdentities) GetItemsPerPage() int { if s == nil || s.ItemsPerPage == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index cee65415517..b3be0c11f27 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -30744,6 +30744,58 @@ func TestScanningAnalysis_GetWarning(tt *testing.T) { s.GetWarning() } +func TestSCIMDisplayReference_GetDisplay(tt *testing.T) { + tt.Parallel() + var zeroValue string + s := &SCIMDisplayReference{Display: &zeroValue} + s.GetDisplay() + s = &SCIMDisplayReference{} + s.GetDisplay() + s = nil + s.GetDisplay() +} + +func TestSCIMGroupAttributes_GetDisplayName(tt *testing.T) { + tt.Parallel() + var zeroValue string + s := &SCIMGroupAttributes{DisplayName: &zeroValue} + s.GetDisplayName() + s = &SCIMGroupAttributes{} + s.GetDisplayName() + s = nil + s.GetDisplayName() +} + +func TestSCIMGroupAttributes_GetExternalID(tt *testing.T) { + tt.Parallel() + var zeroValue string + s := &SCIMGroupAttributes{ExternalID: &zeroValue} + s.GetExternalID() + s = &SCIMGroupAttributes{} + s.GetExternalID() + s = nil + s.GetExternalID() +} + +func TestSCIMGroupAttributes_GetID(tt *testing.T) { + tt.Parallel() + var zeroValue string + s := &SCIMGroupAttributes{ID: &zeroValue} + s.GetID() + s = &SCIMGroupAttributes{} + s.GetID() + s = nil + s.GetID() +} + +func TestSCIMGroupAttributes_GetMeta(tt *testing.T) { + tt.Parallel() + s := &SCIMGroupAttributes{} + s.GetMeta() + s = nil + s.GetMeta() +} + func TestSCIMMeta_GetCreated(tt *testing.T) { tt.Parallel() var zeroValue Timestamp @@ -30788,6 +30840,39 @@ func TestSCIMMeta_GetResourceType(tt *testing.T) { s.GetResourceType() } +func TestSCIMProvisionedGroups_GetItemsPerPage(tt *testing.T) { + tt.Parallel() + var zeroValue int + s := &SCIMProvisionedGroups{ItemsPerPage: &zeroValue} + s.GetItemsPerPage() + s = &SCIMProvisionedGroups{} + s.GetItemsPerPage() + s = nil + s.GetItemsPerPage() +} + +func TestSCIMProvisionedGroups_GetStartIndex(tt *testing.T) { + tt.Parallel() + var zeroValue int + s := &SCIMProvisionedGroups{StartIndex: &zeroValue} + s.GetStartIndex() + s = &SCIMProvisionedGroups{} + s.GetStartIndex() + s = nil + s.GetStartIndex() +} + +func TestSCIMProvisionedGroups_GetTotalResults(tt *testing.T) { + tt.Parallel() + var zeroValue int + s := &SCIMProvisionedGroups{TotalResults: &zeroValue} + s.GetTotalResults() + s = &SCIMProvisionedGroups{} + s.GetTotalResults() + s = nil + s.GetTotalResults() +} + func TestSCIMProvisionedIdentities_GetItemsPerPage(tt *testing.T) { tt.Parallel() var zeroValue int diff --git a/github/scim.go b/github/scim.go index 4b34c1663cd..70f063caa9b 100644 --- a/github/scim.go +++ b/github/scim.go @@ -17,6 +17,26 @@ import ( // GitHub API docs: https://docs.github.com/rest/scim type SCIMService service +// SCIMGroupAttributes represents supported SCIM Group attributes. +// +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/enterprise-admin/scim#list-provisioned-scim-groups-for-an-enterprise +type SCIMGroupAttributes struct { + DisplayName *string `json:"displayName,omitempty"` // The name of the group, suitable for display to end-users. (Optional.) + Members []*SCIMDisplayReference `json:"members,omitempty"` // (Optional.) + Schemas []string `json:"schemas,omitempty"` // (Optional.) + ExternalID *string `json:"externalId,omitempty"` // (Optional.) + // Only populated as a result of calling ListSCIMProvisionedIdentitiesOptions: + ID *string `json:"id,omitempty"` + Meta *SCIMMeta `json:"meta,omitempty"` +} + +// SCIMDisplayReference represents a JSON SCIM (System for Cross-domain Identity Management) resource. +type SCIMDisplayReference struct { + Value string `json:"value"` // (Required.) + Ref string `json:"$ref"` // (Required.) + Display *string `json:"display,omitempty"` // (Optional.) +} + // SCIMUserAttributes represents supported SCIM User attributes. // // GitHub API docs: https://docs.github.com/rest/scim#supported-scim-user-attributes @@ -56,6 +76,15 @@ type SCIMMeta struct { Location *string `json:"location,omitempty"` } +// SCIMProvisionedGroups represents the result of calling ListSCIMProvisionedGroupsForEnterprise. +type SCIMProvisionedGroups struct { + Schemas []string `json:"schemas,omitempty"` + TotalResults *int `json:"totalResults,omitempty"` + ItemsPerPage *int `json:"itemsPerPage,omitempty"` + StartIndex *int `json:"startIndex,omitempty"` + Resources []*SCIMGroupAttributes `json:"Resources,omitempty"` +} + // SCIMProvisionedIdentities represents the result of calling ListSCIMProvisionedIdentities. type SCIMProvisionedIdentities struct { Schemas []string `json:"schemas,omitempty"` @@ -217,3 +246,25 @@ func (s *SCIMService) DeleteSCIMUserFromOrg(ctx context.Context, org, scimUserID return s.client.Do(ctx, req, nil) } + +// ListSCIMProvisionedGroupsForEnterprise lists SCIM provisioned groups for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#list-provisioned-scim-groups-for-an-enterprise +// +//meta:operation GET /scim/v2/enterprises/{enterprise}/Groups +func (s *SCIMService) ListSCIMProvisionedGroupsForEnterprise(ctx context.Context, enterprise string, opts *ListSCIMProvisionedIdentitiesOptions) (*SCIMProvisionedGroups, *Response, error) { + u := fmt.Sprintf("scim/v2/enterprises/%v/Groups", enterprise) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + groups := new(SCIMProvisionedGroups) + resp, err := s.client.Do(ctx, req, groups) + if err != nil { + return nil, resp, err + } + + return groups, resp, nil +} diff --git a/github/scim_test.go b/github/scim_test.go index a6c806cb574..42a6f2331ed 100644 --- a/github/scim_test.go +++ b/github/scim_test.go @@ -121,6 +121,100 @@ func TestSCIMService_ListSCIMProvisionedIdentities(t *testing.T) { }) } +func TestSCIMService_ListSCIMProvisionedGroups(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/scim/v2/enterprises/o/Groups", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + w.WriteHeader(http.StatusOK) + _, _ = w.Write([]byte(`{ + "schemas": [ + "urn:ietf:params:scim:api:messages:2.0:ListResponse" + ], + "totalResults": 1, + "itemsPerPage": 1, + "startIndex": 1, + "Resources": [ + { + "schemas": [ + "urn:ietf:params:scim:schemas:core:2.0:Group" + ], + "id": "123e4567-e89b-12d3-a456-426614174000", + "externalId": "00u1dhhb1fkIGP7RL1d8", + "displayName": "Mona Octocat", + "meta": { + "resourceType": "Group", + "created": "2018-02-13T15:05:24.000-00:00", + "lastModified": "2018-02-13T15:05:24.000-00:00", + "location": "https://api.github.com/scim/v2/enterprises/octo/Groups/123e4567-e89b-12d3-a456-426614174000" + }, + "members": [ + { + "value": "5fc0c238-1112-11e8-8e45-920c87bdbd75", + "$ref": "https://api.github.com/scim/v2/enterprises/octo/Users/5fc0c238-1112-11e8-8e45-920c87bdbd75", + "display": "Mona Octocat" + } + ] + } + ] + }`)) + }) + + ctx := context.Background() + opts := &ListSCIMProvisionedIdentitiesOptions{} + groups, _, err := client.SCIM.ListSCIMProvisionedGroupsForEnterprise(ctx, "o", opts) + if err != nil { + t.Errorf("SCIM.ListSCIMProvisionedIdentities returned error: %v", err) + } + + date := Timestamp{time.Date(2018, time.February, 13, 15, 5, 24, 0, time.UTC)} + want := SCIMProvisionedGroups{ + Schemas: []string{"urn:ietf:params:scim:api:messages:2.0:ListResponse"}, + TotalResults: Ptr(1), + ItemsPerPage: Ptr(1), + StartIndex: Ptr(1), + Resources: []*SCIMGroupAttributes{ + { + ID: Ptr("123e4567-e89b-12d3-a456-426614174000"), + Meta: &SCIMMeta{ + ResourceType: Ptr("Group"), + Created: &date, + LastModified: &date, + Location: Ptr("https://api.github.com/scim/v2/enterprises/octo/Groups/123e4567-e89b-12d3-a456-426614174000"), + }, + + DisplayName: Ptr("Mona Octocat"), + Schemas: []string{"urn:ietf:params:scim:schemas:core:2.0:Group"}, + ExternalID: Ptr("00u1dhhb1fkIGP7RL1d8"), + Members: []*SCIMDisplayReference{ + { + Value: "5fc0c238-1112-11e8-8e45-920c87bdbd75", + Ref: "https://api.github.com/scim/v2/enterprises/octo/Users/5fc0c238-1112-11e8-8e45-920c87bdbd75", + Display: Ptr("Mona Octocat"), + }, + }, + }, + }, + } + + if !cmp.Equal(groups, &want) { + diff := cmp.Diff(groups, want) + t.Errorf("SCIM.ListSCIMProvisionedGroupsForEnterprise returned %+v, want %+v: diff %+v", groups, want, diff) + } + + const methodName = "ListSCIMProvisionedGroupsForEnterprise" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.SCIM.ListSCIMProvisionedGroupsForEnterprise(ctx, "\n", opts) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + _, r, err := client.SCIM.ListSCIMProvisionedGroupsForEnterprise(ctx, "o", opts) + return r, err + }) +} + func TestSCIMService_ProvisionAndInviteSCIMUser(t *testing.T) { t.Parallel() client, mux, _ := setup(t) From c4b2cb94de107a23bcac7b53df5d127ad5e8e4fe Mon Sep 17 00:00:00 2001 From: Marcel <144216124+maaarcelino@users.noreply.github.com> Date: Wed, 12 Feb 2025 17:00:38 +0100 Subject: [PATCH 649/751] fix: Add missing query params to AlertListOptions (#3477) --- github/code_scanning.go | 9 +++++++++ github/code_scanning_test.go | 20 ++++++++++---------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/github/code_scanning.go b/github/code_scanning.go index bd11f00ddba..19a88241d37 100644 --- a/github/code_scanning.go +++ b/github/code_scanning.go @@ -141,6 +141,15 @@ type AlertListOptions struct { // The name of a code scanning tool. Only results by this tool will be listed. ToolName string `url:"tool_name,omitempty"` + // The GUID of a code scanning tool. Only results by this tool will be listed. + ToolGUID string `url:"tool_guid,omitempty"` + + // The direction to sort the results by. Possible values are: asc, desc. Default: desc. + Direction string `url:"direction,omitempty"` + + // The property by which to sort the results. Possible values are: created, updated. Default: created. + Sort string `url:"sort,omitempty"` + ListCursorOptions // Add ListOptions so offset pagination with integer type "page" query parameter is accepted diff --git a/github/code_scanning_test.go b/github/code_scanning_test.go index 4e9bbc57a79..4cfa3d881bf 100644 --- a/github/code_scanning_test.go +++ b/github/code_scanning_test.go @@ -147,7 +147,7 @@ func TestCodeScanningService_ListAlertsForOrg(t *testing.T) { mux.HandleFunc("/orgs/o/code-scanning/alerts", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testFormValues(t, r, values{"state": "open", "ref": "heads/master", "severity": "warning", "tool_name": "CodeQL"}) + testFormValues(t, r, values{"state": "open", "ref": "heads/master", "severity": "warning", "tool_name": "CodeQL", "tool_guid": "guid", "direction": "asc", "sort": "updated"}) fmt.Fprint(w, `[{ "repository": { "id": 1, @@ -159,7 +159,7 @@ func TestCodeScanningService_ListAlertsForOrg(t *testing.T) { "rule_description":"Useless conditional", "tool": { "name": "CodeQL", - "guid": null, + "guid": "guid", "version": "1.4.0" }, "rule": { @@ -239,7 +239,7 @@ func TestCodeScanningService_ListAlertsForOrg(t *testing.T) { }]`) }) - opts := &AlertListOptions{State: "open", Ref: "heads/master", Severity: "warning", ToolName: "CodeQL"} + opts := &AlertListOptions{State: "open", Ref: "heads/master", Severity: "warning", ToolName: "CodeQL", ToolGUID: "guid", Direction: "asc", Sort: "updated"} ctx := context.Background() alerts, _, err := client.CodeScanning.ListAlertsForOrg(ctx, "o", opts) if err != nil { @@ -257,7 +257,7 @@ func TestCodeScanningService_ListAlertsForOrg(t *testing.T) { RuleID: Ptr("js/trivial-conditional"), RuleSeverity: Ptr("warning"), RuleDescription: Ptr("Useless conditional"), - Tool: &Tool{Name: Ptr("CodeQL"), GUID: nil, Version: Ptr("1.4.0")}, + Tool: &Tool{Name: Ptr("CodeQL"), GUID: Ptr("guid"), Version: Ptr("1.4.0")}, Rule: &Rule{ ID: Ptr("js/trivial-conditional"), Severity: Ptr("warning"), @@ -477,14 +477,14 @@ func TestCodeScanningService_ListAlertsForRepo(t *testing.T) { mux.HandleFunc("/repos/o/r/code-scanning/alerts", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testFormValues(t, r, values{"state": "open", "ref": "heads/master", "severity": "warning", "tool_name": "CodeQL"}) + testFormValues(t, r, values{"state": "open", "ref": "heads/master", "severity": "warning", "tool_name": "CodeQL", "tool_guid": "guid", "direction": "asc", "sort": "updated"}) fmt.Fprint(w, `[{ "rule_id":"js/trivial-conditional", "rule_severity":"warning", "rule_description":"Useless conditional", "tool": { "name": "CodeQL", - "guid": null, + "guid": "guid", "version": "1.4.0" }, "rule": { @@ -526,7 +526,7 @@ func TestCodeScanningService_ListAlertsForRepo(t *testing.T) { "rule_description":"Expression has no effect", "tool": { "name": "CodeQL", - "guid": null, + "guid": "guid", "version": "1.4.0" }, "rule": { @@ -564,7 +564,7 @@ func TestCodeScanningService_ListAlertsForRepo(t *testing.T) { }]`) }) - opts := &AlertListOptions{State: "open", Ref: "heads/master", Severity: "warning", ToolName: "CodeQL"} + opts := &AlertListOptions{State: "open", Ref: "heads/master", Severity: "warning", ToolName: "CodeQL", ToolGUID: "guid", Direction: "asc", Sort: "updated"} ctx := context.Background() alerts, _, err := client.CodeScanning.ListAlertsForRepo(ctx, "o", "r", opts) if err != nil { @@ -577,7 +577,7 @@ func TestCodeScanningService_ListAlertsForRepo(t *testing.T) { RuleID: Ptr("js/trivial-conditional"), RuleSeverity: Ptr("warning"), RuleDescription: Ptr("Useless conditional"), - Tool: &Tool{Name: Ptr("CodeQL"), GUID: nil, Version: Ptr("1.4.0")}, + Tool: &Tool{Name: Ptr("CodeQL"), GUID: Ptr("guid"), Version: Ptr("1.4.0")}, Rule: &Rule{ ID: Ptr("js/trivial-conditional"), Severity: Ptr("warning"), @@ -613,7 +613,7 @@ func TestCodeScanningService_ListAlertsForRepo(t *testing.T) { RuleID: Ptr("js/useless-expression"), RuleSeverity: Ptr("warning"), RuleDescription: Ptr("Expression has no effect"), - Tool: &Tool{Name: Ptr("CodeQL"), GUID: nil, Version: Ptr("1.4.0")}, + Tool: &Tool{Name: Ptr("CodeQL"), GUID: Ptr("guid"), Version: Ptr("1.4.0")}, Rule: &Rule{ ID: Ptr("js/useless-expression"), Severity: Ptr("warning"), From f867d00d8068adbd5db81c06ae7a630c1c424bd6 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Thu, 13 Feb 2025 10:47:09 -0500 Subject: [PATCH 650/751] Bump version of go-github to v69.1.0 (#3478) --- example/go.mod | 2 +- example/newreposecretwithlibsodium/go.mod | 2 +- github/github.go | 2 +- tools/go.mod | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/example/go.mod b/example/go.mod index 68a9b74a951..8da3a76db4f 100644 --- a/example/go.mod +++ b/example/go.mod @@ -6,7 +6,7 @@ require ( github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-ratelimit v1.0.3 - github.com/google/go-github/v69 v69.0.0 + github.com/google/go-github/v69 v69.1.0 github.com/sigstore/sigstore-go v0.5.1 golang.org/x/crypto v0.31.0 golang.org/x/term v0.27.0 diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index e90a28afde5..7ec84e7116d 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -4,7 +4,7 @@ go 1.22.0 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb - github.com/google/go-github/v69 v69.0.0 + github.com/google/go-github/v69 v69.1.0 ) require github.com/google/go-querystring v1.1.0 // indirect diff --git a/github/github.go b/github/github.go index 9c5ca1f9241..b7d2212360e 100644 --- a/github/github.go +++ b/github/github.go @@ -28,7 +28,7 @@ import ( ) const ( - Version = "v69.0.0" + Version = "v69.1.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" diff --git a/tools/go.mod b/tools/go.mod index 32d273b9bdc..07bc2ebae2b 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -6,7 +6,7 @@ require ( github.com/alecthomas/kong v1.8.0 github.com/getkin/kin-openapi v0.128.0 github.com/google/go-cmp v0.6.0 - github.com/google/go-github/v69 v69.0.0 + github.com/google/go-github/v69 v69.1.0 golang.org/x/sync v0.11.0 gopkg.in/yaml.v3 v3.0.1 ) From 6c46d717264d1938f461babab0b768a4ed3f6f63 Mon Sep 17 00:00:00 2001 From: pputman-clabs <99900942+pputman-clabs@users.noreply.github.com> Date: Thu, 13 Feb 2025 14:11:36 -0600 Subject: [PATCH 651/751] Add helper to get `runID` from Custom Deployment Protection Rule Event (#3476) --- github/actions_workflow_runs.go | 15 +++++++++++++++ github/github.go | 16 ++++++++++++++++ github/github_test.go | 28 ++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+) diff --git a/github/actions_workflow_runs.go b/github/actions_workflow_runs.go index dddc56d2327..20b9cfcd500 100644 --- a/github/actions_workflow_runs.go +++ b/github/actions_workflow_runs.go @@ -204,6 +204,7 @@ func (s *ActionsService) ListRepositoryWorkflowRuns(ctx context.Context, owner, } // GetWorkflowRunByID gets a specific workflow run by ID. +// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // // GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run // @@ -226,6 +227,7 @@ func (s *ActionsService) GetWorkflowRunByID(ctx context.Context, owner, repo str } // GetWorkflowRunAttempt gets a specific workflow run attempt. +// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // // GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run-attempt // @@ -252,6 +254,7 @@ func (s *ActionsService) GetWorkflowRunAttempt(ctx context.Context, owner, repo } // GetWorkflowRunAttemptLogs gets a redirect URL to download a plain text file of logs for a workflow run for attempt number. +// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve a workflow run ID from the DeploymentProtectionRuleEvent. // // GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-attempt-logs // @@ -302,6 +305,7 @@ func (s *ActionsService) getWorkflowRunAttemptLogsWithRateLimit(ctx context.Cont } // RerunWorkflowByID re-runs a workflow by ID. +// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID a the DeploymentProtectionRuleEvent. // // GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#re-run-a-workflow // @@ -318,6 +322,7 @@ func (s *ActionsService) RerunWorkflowByID(ctx context.Context, owner, repo stri } // RerunFailedJobsByID re-runs all of the failed jobs and their dependent jobs in a workflow run by ID. +// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // // GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#re-run-failed-jobs-from-a-workflow-run // @@ -335,6 +340,8 @@ func (s *ActionsService) RerunFailedJobsByID(ctx context.Context, owner, repo st // RerunJobByID re-runs a job and its dependent jobs in a workflow run by ID. // +// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. +// // GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run // //meta:operation POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun @@ -350,6 +357,7 @@ func (s *ActionsService) RerunJobByID(ctx context.Context, owner, repo string, j } // CancelWorkflowRunByID cancels a workflow run by ID. +// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // // GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#cancel-a-workflow-run // @@ -366,6 +374,7 @@ func (s *ActionsService) CancelWorkflowRunByID(ctx context.Context, owner, repo } // GetWorkflowRunLogs gets a redirect URL to download a plain text file of logs for a workflow run. +// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // // GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-logs // @@ -416,6 +425,7 @@ func (s *ActionsService) getWorkflowRunLogsWithRateLimit(ctx context.Context, u } // DeleteWorkflowRun deletes a workflow run by ID. +// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // // GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#delete-a-workflow-run // @@ -432,6 +442,7 @@ func (s *ActionsService) DeleteWorkflowRun(ctx context.Context, owner, repo stri } // DeleteWorkflowRunLogs deletes all logs for a workflow run. +// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // // GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#delete-workflow-run-logs // @@ -448,6 +459,7 @@ func (s *ActionsService) DeleteWorkflowRunLogs(ctx context.Context, owner, repo } // GetWorkflowRunUsageByID gets a specific workflow usage run by run ID in the unit of billable milliseconds. +// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // // GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-workflow-run-usage // @@ -470,6 +482,7 @@ func (s *ActionsService) GetWorkflowRunUsageByID(ctx context.Context, owner, rep } // GetPendingDeployments get all deployment environments for a workflow run that are waiting for protection rules to pass. +// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // // GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-pending-deployments-for-a-workflow-run // @@ -492,6 +505,7 @@ func (s *ActionsService) GetPendingDeployments(ctx context.Context, owner, repo } // PendingDeployments approve or reject pending deployments that are waiting on approval by a required reviewer. +// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // // GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run // @@ -514,6 +528,7 @@ func (s *ActionsService) PendingDeployments(ctx context.Context, owner, repo str } // ReviewCustomDeploymentProtectionRule approves or rejects custom deployment protection rules provided by a GitHub App for a workflow run. +// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // // GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#review-custom-deployment-protection-rules-for-a-workflow-run // diff --git a/github/github.go b/github/github.go index b7d2212360e..47bcf08f684 100644 --- a/github/github.go +++ b/github/github.go @@ -19,6 +19,7 @@ import ( "net/http" "net/url" "reflect" + "regexp" "strconv" "strings" "sync" @@ -1770,3 +1771,18 @@ type roundTripperFunc func(*http.Request) (*http.Response, error) func (fn roundTripperFunc) RoundTrip(r *http.Request) (*http.Response, error) { return fn(r) } + +var runIDFromURLRE = regexp.MustCompile(`^repos/.*/actions/runs/(\d+)/deployment_protection_rule$`) + +// GetRunID is a Helper Function used to extract the workflow RunID from the *DeploymentProtectionRuleEvent.DeploymentCallBackURL. +func (e *DeploymentProtectionRuleEvent) GetRunID() (int64, error) { + match := runIDFromURLRE.FindStringSubmatch(*e.DeploymentCallbackURL) + if len(match) != 2 { + return -1, errors.New("no match") + } + runID, err := strconv.ParseInt(match[1], 10, 64) + if err != nil { + return -1, err + } + return runID, nil +} diff --git a/github/github_test.go b/github/github_test.go index b402f098413..683012adc53 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -3101,3 +3101,31 @@ func TestPtr(t *testing.T) { equal(t, int64(-10), *Ptr(int64(-10))) equal(t, "str", *Ptr("str")) } + +func TestDeploymentProtectionRuleEvent_GetRunID(t *testing.T) { + t.Parallel() + + var want int64 = 123456789 + url := "repos/dummy-org/dummy-repo/actions/runs/123456789/deployment_protection_rule" + + e := DeploymentProtectionRuleEvent{ + DeploymentCallbackURL: &url, + } + + got, _ := e.GetRunID() + if got != want { + t.Errorf("want %#v, got %#v", want, got) + } + + want = -1 + url = "repos/dummy-org/dummy-repo/actions/runs/abc123/deployment_protection_rule" + + got, err := e.GetRunID() + if err == nil { + t.Errorf("Expected error to be returned") + } + + if got != want { + t.Errorf("want %#v, got %#v", want, got) + } +} From 81dc7a9416fb14829fdd2130bee12dce7a95c1c2 Mon Sep 17 00:00:00 2001 From: Raisa Kabir Date: Sat, 15 Feb 2025 23:50:42 +0800 Subject: [PATCH 652/751] feat: Add JSON marshal tests for dependabot alerts (#3480) --- github/dependabot_alerts_test.go | 210 +++++++++++++++++++++++++++++++ 1 file changed, 210 insertions(+) diff --git a/github/dependabot_alerts_test.go b/github/dependabot_alerts_test.go index 3908ab29459..3a46855e011 100644 --- a/github/dependabot_alerts_test.go +++ b/github/dependabot_alerts_test.go @@ -10,6 +10,7 @@ import ( "fmt" "net/http" "testing" + "time" "github.com/google/go-cmp/cmp" ) @@ -177,3 +178,212 @@ func TestDependabotService_UpdateAlert(t *testing.T) { return resp, err }) } + +func TestDependency_Marshal(t *testing.T) { + t.Parallel() + testJSONMarshal(t, &Dependency{}, "{}") + + h := &Dependency{ + Package: &VulnerabilityPackage{ + Ecosystem: Ptr("pip"), + Name: Ptr("django"), + }, + ManifestPath: Ptr("path/to/requirements.txt"), + Scope: Ptr("runtime"), + } + + want := `{ + "package": { + "ecosystem": "pip", + "name": "django" + }, + "manifest_path": "path/to/requirements.txt", + "scope": "runtime" + }` + + testJSONMarshal(t, h, want) +} + +func TestAdvisoryCVSS_Marshal(t *testing.T) { + t.Parallel() + testJSONMarshal(t, &AdvisoryCVSS{}, "{}") + + h := &AdvisoryCVSS{ + Score: Ptr(7.5), + VectorString: Ptr("CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"), + } + + want := `{ + "vector_string": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N", + "score": 7.5 + }` + + testJSONMarshal(t, h, want) +} + +func TestAdvisoryCWEs_Marshal(t *testing.T) { + t.Parallel() + testJSONMarshal(t, &AdvisoryCWEs{}, "{}") + + h := &AdvisoryCWEs{ + CWEID: Ptr("CWE-200"), + Name: Ptr("Exposure of Sensitive Information to an Unauthorized Actor"), + } + + want := `{ + "cwe_id": "CWE-200", + "name": "Exposure of Sensitive Information to an Unauthorized Actor" + }` + + testJSONMarshal(t, h, want) +} + +func TestDependabotSecurityAdvisory_Marshal(t *testing.T) { + t.Parallel() + testJSONMarshal(t, &DependabotSecurityAdvisory{}, "{}") + + publishedAt, _ := time.Parse(time.RFC3339, "2018-10-03T21:13:54Z") + updatedAt, _ := time.Parse(time.RFC3339, "2022-04-26T18:35:37Z") + + h := &DependabotSecurityAdvisory{ + GHSAID: Ptr("GHSA-rf4j-j272-fj86"), + CVEID: Ptr("CVE-2018-6188"), + Summary: Ptr("Django allows remote attackers to obtain potentially sensitive information by leveraging data exposure from the confirm_login_allowed() method, as demonstrated by discovering whether a user account is inactive"), + Description: Ptr("django.contrib.auth.forms.AuthenticationForm in Django 2.0 before 2.0.2, and 1.11.8 and 1.11.9, allows remote attackers to obtain potentially sensitive information by leveraging data exposure from the confirm_login_allowed() method, as demonstrated by discovering whether a user account is inactive."), + Vulnerabilities: []*AdvisoryVulnerability{ + { + Package: &VulnerabilityPackage{ + Ecosystem: Ptr("pip"), + Name: Ptr("django"), + }, + Severity: Ptr("high"), + VulnerableVersionRange: Ptr(">= 2.0.0, < 2.0.2"), + FirstPatchedVersion: &FirstPatchedVersion{Identifier: Ptr("2.0.2")}, + }, + { + Package: &VulnerabilityPackage{ + Ecosystem: Ptr("pip"), + Name: Ptr("django"), + }, + Severity: Ptr("high"), + VulnerableVersionRange: Ptr(">= 1.11.8, < 1.11.10"), + FirstPatchedVersion: &FirstPatchedVersion{Identifier: Ptr("1.11.10")}, + }, + }, + Severity: Ptr("high"), + CVSS: &AdvisoryCVSS{ + Score: Ptr(7.5), + VectorString: Ptr("CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"), + }, + CWEs: []*AdvisoryCWEs{ + { + CWEID: Ptr("CWE-200"), + Name: Ptr("Exposure of Sensitive Information to an Unauthorized Actor"), + }, + }, + Identifiers: []*AdvisoryIdentifier{ + { + Type: Ptr("GHSA"), + Value: Ptr("GHSA-rf4j-j272-fj86"), + }, + { + Type: Ptr("CVE"), + Value: Ptr("CVE-2018-6188"), + }, + }, + References: []*AdvisoryReference{ + { + URL: Ptr("https://nvd.nist.gov/vuln/detail/CVE-2018-6188"), + }, + { + URL: Ptr("https://github.com/advisories/GHSA-rf4j-j272-fj86"), + }, + { + URL: Ptr("https://usn.ubuntu.com/3559-1/"), + }, + { + URL: Ptr("https://www.djangoproject.com/weblog/2018/feb/01/security-releases/"), + }, + { + URL: Ptr("http://www.securitytracker.com/id/1040422"), + }, + }, + PublishedAt: &Timestamp{publishedAt}, + UpdatedAt: &Timestamp{updatedAt}, + WithdrawnAt: nil, + } + + want := `{ + "ghsa_id": "GHSA-rf4j-j272-fj86", + "cve_id": "CVE-2018-6188", + "summary": "Django allows remote attackers to obtain potentially sensitive information by leveraging data exposure from the confirm_login_allowed() method, as demonstrated by discovering whether a user account is inactive", + "description": "django.contrib.auth.forms.AuthenticationForm in Django 2.0 before 2.0.2, and 1.11.8 and 1.11.9, allows remote attackers to obtain potentially sensitive information by leveraging data exposure from the confirm_login_allowed() method, as demonstrated by discovering whether a user account is inactive.", + "vulnerabilities": [ + { + "package": { + "ecosystem": "pip", + "name": "django" + }, + "severity": "high", + "vulnerable_version_range": ">= 2.0.0, < 2.0.2", + "first_patched_version": { + "identifier": "2.0.2" + } + }, + { + "package": { + "ecosystem": "pip", + "name": "django" + }, + "severity": "high", + "vulnerable_version_range": ">= 1.11.8, < 1.11.10", + "first_patched_version": { + "identifier": "1.11.10" + } + } + ], + "severity": "high", + "cvss": { + "vector_string": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N", + "score": 7.5 + }, + "cwes": [ + { + "cwe_id": "CWE-200", + "name": "Exposure of Sensitive Information to an Unauthorized Actor" + } + ], + "identifiers": [ + { + "type": "GHSA", + "value": "GHSA-rf4j-j272-fj86" + }, + { + "type": "CVE", + "value": "CVE-2018-6188" + } + ], + "references": [ + { + "url": "https://nvd.nist.gov/vuln/detail/CVE-2018-6188" + }, + { + "url": "https://github.com/advisories/GHSA-rf4j-j272-fj86" + }, + { + "url": "https://usn.ubuntu.com/3559-1/" + }, + { + "url": "https://www.djangoproject.com/weblog/2018/feb/01/security-releases/" + }, + { + "url": "http://www.securitytracker.com/id/1040422" + } + ], + "published_at": "2018-10-03T21:13:54Z", + "updated_at": "2022-04-26T18:35:37Z", + "withdrawn_at": null + }` + + testJSONMarshal(t, h, want) +} From e4c974e3b61750ce5477511f9f791fc045f8c7d0 Mon Sep 17 00:00:00 2001 From: Marcel <144216124+maaarcelino@users.noreply.github.com> Date: Mon, 17 Feb 2025 14:10:06 +0100 Subject: [PATCH 653/751] feat: Add sorting list options for secret scanning (#3481) --- github/secret_scanning.go | 6 ++++++ github/secret_scanning_test.go | 16 ++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/github/secret_scanning.go b/github/secret_scanning.go index fc0fe0cd8c2..35322cf6625 100644 --- a/github/secret_scanning.go +++ b/github/secret_scanning.go @@ -68,6 +68,12 @@ type SecretScanningAlertListOptions struct { // Valid resolutions are false_positive, wont_fix, revoked, pattern_edited, pattern_deleted or used_in_tests. Resolution string `url:"resolution,omitempty"` + // The direction to sort the results by. Possible values are: asc, desc. Default: desc. + Direction string `url:"direction,omitempty"` + + // The property by which to sort the results. Possible values are: created, updated. Default: created. + Sort string `url:"sort,omitempty"` + ListCursorOptions // List options can vary on the Enterprise type. diff --git a/github/secret_scanning_test.go b/github/secret_scanning_test.go index 6eea92de933..779785396f1 100644 --- a/github/secret_scanning_test.go +++ b/github/secret_scanning_test.go @@ -22,7 +22,7 @@ func TestSecretScanningService_ListAlertsForEnterprise(t *testing.T) { mux.HandleFunc("/enterprises/e/secret-scanning/alerts", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testFormValues(t, r, values{"state": "open", "secret_type": "mailchimp_api_key"}) + testFormValues(t, r, values{"state": "open", "secret_type": "mailchimp_api_key", "sort": "updated", "direction": "asc"}) fmt.Fprint(w, `[{ "number": 1, @@ -45,7 +45,7 @@ func TestSecretScanningService_ListAlertsForEnterprise(t *testing.T) { }) ctx := context.Background() - opts := &SecretScanningAlertListOptions{State: "open", SecretType: "mailchimp_api_key"} + opts := &SecretScanningAlertListOptions{State: "open", SecretType: "mailchimp_api_key", Direction: "asc", Sort: "updated"} alerts, _, err := client.SecretScanning.ListAlertsForEnterprise(ctx, "e", opts) if err != nil { @@ -97,7 +97,7 @@ func TestSecretScanningService_ListAlertsForOrg(t *testing.T) { mux.HandleFunc("/orgs/o/secret-scanning/alerts", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testFormValues(t, r, values{"state": "open", "secret_type": "mailchimp_api_key"}) + testFormValues(t, r, values{"state": "open", "secret_type": "mailchimp_api_key", "sort": "updated", "direction": "asc"}) fmt.Fprint(w, `[{ "number": 1, @@ -115,7 +115,7 @@ func TestSecretScanningService_ListAlertsForOrg(t *testing.T) { }) ctx := context.Background() - opts := &SecretScanningAlertListOptions{State: "open", SecretType: "mailchimp_api_key"} + opts := &SecretScanningAlertListOptions{State: "open", SecretType: "mailchimp_api_key", Direction: "asc", Sort: "updated"} alerts, _, err := client.SecretScanning.ListAlertsForOrg(ctx, "o", opts) if err != nil { @@ -162,7 +162,7 @@ func TestSecretScanningService_ListAlertsForOrgListOptions(t *testing.T) { mux.HandleFunc("/orgs/o/secret-scanning/alerts", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testFormValues(t, r, values{"state": "open", "secret_type": "mailchimp_api_key", "per_page": "1", "page": "1"}) + testFormValues(t, r, values{"state": "open", "secret_type": "mailchimp_api_key", "per_page": "1", "page": "1", "sort": "updated", "direction": "asc"}) fmt.Fprint(w, `[{ "number": 1, @@ -182,7 +182,7 @@ func TestSecretScanningService_ListAlertsForOrgListOptions(t *testing.T) { ctx := context.Background() // Testing pagination by index - opts := &SecretScanningAlertListOptions{State: "open", SecretType: "mailchimp_api_key", ListOptions: ListOptions{Page: 1, PerPage: 1}} + opts := &SecretScanningAlertListOptions{State: "open", SecretType: "mailchimp_api_key", ListOptions: ListOptions{Page: 1, PerPage: 1}, Direction: "asc", Sort: "updated"} alerts, _, err := client.SecretScanning.ListAlertsForOrg(ctx, "o", opts) if err != nil { @@ -229,7 +229,7 @@ func TestSecretScanningService_ListAlertsForRepo(t *testing.T) { mux.HandleFunc("/repos/o/r/secret-scanning/alerts", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testFormValues(t, r, values{"state": "open", "secret_type": "mailchimp_api_key"}) + testFormValues(t, r, values{"state": "open", "secret_type": "mailchimp_api_key", "sort": "updated", "direction": "asc"}) fmt.Fprint(w, `[{ "number": 1, @@ -247,7 +247,7 @@ func TestSecretScanningService_ListAlertsForRepo(t *testing.T) { }) ctx := context.Background() - opts := &SecretScanningAlertListOptions{State: "open", SecretType: "mailchimp_api_key"} + opts := &SecretScanningAlertListOptions{State: "open", SecretType: "mailchimp_api_key", Direction: "asc", Sort: "updated"} alerts, _, err := client.SecretScanning.ListAlertsForRepo(ctx, "o", "r", opts) if err != nil { From 0b11dbfbf17f29fb589087727789c6978d500f8d Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Mon, 17 Feb 2025 08:22:47 -0500 Subject: [PATCH 654/751] Bump version of go-github to v69.2.0 (#3482) --- README.md | 2 +- example/go.mod | 2 +- example/newreposecretwithlibsodium/go.mod | 2 +- github/github.go | 2 +- tools/go.mod | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3cf4f240f8c..c7b9dcef090 100644 --- a/README.md +++ b/README.md @@ -447,7 +447,7 @@ Versions prior to 48.2.0 are not listed. | go-github Version | GitHub v3 API Version | | ----------------- | --------------------- | -| 69.0.0 | 2022-11-28 | +| 69.x.0 | 2022-11-28 | | ... | 2022-11-28 | | 48.2.0 | 2022-11-28 | diff --git a/example/go.mod b/example/go.mod index 8da3a76db4f..27045fc9221 100644 --- a/example/go.mod +++ b/example/go.mod @@ -6,7 +6,7 @@ require ( github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-ratelimit v1.0.3 - github.com/google/go-github/v69 v69.1.0 + github.com/google/go-github/v69 v69.2.0 github.com/sigstore/sigstore-go v0.5.1 golang.org/x/crypto v0.31.0 golang.org/x/term v0.27.0 diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index 7ec84e7116d..9c26071494e 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -4,7 +4,7 @@ go 1.22.0 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb - github.com/google/go-github/v69 v69.1.0 + github.com/google/go-github/v69 v69.2.0 ) require github.com/google/go-querystring v1.1.0 // indirect diff --git a/github/github.go b/github/github.go index 47bcf08f684..d163b32d2cd 100644 --- a/github/github.go +++ b/github/github.go @@ -29,7 +29,7 @@ import ( ) const ( - Version = "v69.1.0" + Version = "v69.2.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" diff --git a/tools/go.mod b/tools/go.mod index 07bc2ebae2b..5925bcb65ba 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -6,7 +6,7 @@ require ( github.com/alecthomas/kong v1.8.0 github.com/getkin/kin-openapi v0.128.0 github.com/google/go-cmp v0.6.0 - github.com/google/go-github/v69 v69.1.0 + github.com/google/go-github/v69 v69.2.0 golang.org/x/sync v0.11.0 gopkg.in/yaml.v3 v3.0.1 ) From fb210dc8753557ab9733eac507bb9983984763d5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Feb 2025 16:53:13 -0500 Subject: [PATCH 655/751] build(deps): bump github.com/alecthomas/kong from 1.8.0 to 1.8.1 in /tools (#3485) --- tools/go.mod | 2 +- tools/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index 5925bcb65ba..212311e063f 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -3,7 +3,7 @@ module tools go 1.22.0 require ( - github.com/alecthomas/kong v1.8.0 + github.com/alecthomas/kong v1.8.1 github.com/getkin/kin-openapi v0.128.0 github.com/google/go-cmp v0.6.0 github.com/google/go-github/v69 v69.2.0 diff --git a/tools/go.sum b/tools/go.sum index ecf4dc6f71f..3f4813edf5f 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -1,7 +1,7 @@ github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0= github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= -github.com/alecthomas/kong v1.8.0 h1:LEDIdSYrHU+4oTF2BL0NAfw++wH6lg/LzAJodTkLikM= -github.com/alecthomas/kong v1.8.0/go.mod h1:p2vqieVMeTAnaC83txKtXe8FLke2X07aruPWXyMPQrU= +github.com/alecthomas/kong v1.8.1 h1:6aamvWBE/REnR/BCq10EcozmcpUPc5aGI1lPAWdB0EE= +github.com/alecthomas/kong v1.8.1/go.mod h1:p2vqieVMeTAnaC83txKtXe8FLke2X07aruPWXyMPQrU= github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc= github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= From 868f897f6d9dcfc74bb954a092a51e6384d84b49 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Feb 2025 16:56:01 -0500 Subject: [PATCH 656/751] build(deps): bump github.com/google/go-github/v69 from 69.0.0 to 69.2.0 in /scrape (#3483) --- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 0f060bedb7a..e3da742a68f 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -5,7 +5,7 @@ go 1.22.0 require ( github.com/PuerkitoBio/goquery v1.9.3 github.com/google/go-cmp v0.6.0 - github.com/google/go-github/v69 v69.0.0 + github.com/google/go-github/v69 v69.2.0 github.com/xlzd/gotp v0.1.0 golang.org/x/net v0.35.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index 4904ccf0e6b..ca75cda0651 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -5,8 +5,8 @@ github.com/andybalholm/cascadia v1.3.3/go.mod h1:xNd9bqTn98Ln4DwST8/nG+H0yuB8Hmg github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v69 v69.0.0 h1:YnFvZ3pEIZF8KHmI8xyQQe3mYACdkhnaTV2hr7CP2/w= -github.com/google/go-github/v69 v69.0.0/go.mod h1:xne4jymxLR6Uj9b7J7PyTpkMYstEMMwGZa0Aehh1azM= +github.com/google/go-github/v69 v69.2.0 h1:wR+Wi/fN2zdUx9YxSmYE0ktiX9IAR/BeePzeaUUbEHE= +github.com/google/go-github/v69 v69.2.0/go.mod h1:xne4jymxLR6Uj9b7J7PyTpkMYstEMMwGZa0Aehh1azM= 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.1.0 h1:37blvlKCh38s+fkem+fFh7sMnceltoIEBYTVXyoa5Po= From 844e2e5eb2f268a25bde054e3818923110567582 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 17:41:43 -0500 Subject: [PATCH 657/751] build(deps): bump github.com/google/go-cmp from 0.6.0 to 0.7.0 in /tools (#3490) --- tools/go.mod | 2 +- tools/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index 212311e063f..c9ce43d3f2e 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -5,7 +5,7 @@ go 1.22.0 require ( github.com/alecthomas/kong v1.8.1 github.com/getkin/kin-openapi v0.128.0 - github.com/google/go-cmp v0.6.0 + github.com/google/go-cmp v0.7.0 github.com/google/go-github/v69 v69.2.0 golang.org/x/sync v0.11.0 gopkg.in/yaml.v3 v3.0.1 diff --git a/tools/go.sum b/tools/go.sum index 3f4813edf5f..ecbe0ac6897 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -15,8 +15,8 @@ github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ github.com/go-test/deep v1.1.1 h1:0r/53hagsehfO4bzD2Pgr/+RgHqhmf+k1Bpse2cTu1U= github.com/go-test/deep v1.1.1/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= 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/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= From 32501b493d76fd29a1079a41432b61dbbeb6f0e5 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Mon, 24 Feb 2025 18:01:17 -0500 Subject: [PATCH 658/751] Bump github.com/google/go-cmp from 0.6.0 to 0.7.0 (#3494) --- example/go.sum | 4 ++-- example/newreposecretwithlibsodium/go.sum | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- scrape/go.mod | 2 +- scrape/go.sum | 3 ++- 6 files changed, 10 insertions(+), 9 deletions(-) diff --git a/example/go.sum b/example/go.sum index 9fc9663b67c..d99bb0d3f2f 100644 --- a/example/go.sum +++ b/example/go.sum @@ -154,8 +154,8 @@ github.com/google/certificate-transparency-go v1.2.1/go.mod h1:bvn/ytAccv+I6+DGk github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/go-containerregistry v0.20.2 h1:B1wPJ1SN/S7pB+ZAimcciVD+r+yV/l/DSArMxlbwseo= github.com/google/go-containerregistry v0.20.2/go.mod h1:z38EKdKh4h7IP2gSfUUqEvalZBqs6AoLeWfUy34nQC8= github.com/google/go-github/v41 v41.0.0 h1:HseJrM2JFf2vfiZJ8anY2hqBjdfY1Vlj/K27ueww4gg= diff --git a/example/newreposecretwithlibsodium/go.sum b/example/newreposecretwithlibsodium/go.sum index a1345cced05..bb0a7c887a3 100644 --- a/example/newreposecretwithlibsodium/go.sum +++ b/example/newreposecretwithlibsodium/go.sum @@ -1,8 +1,8 @@ github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb h1:ilqSFSbR1fq6x88heeHrvAqlg+ES+tZk2ZcaCmiH1gI= github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb/go.mod h1:72TQeEkiDH9QMXZa5nJJvZre0UjqqO67X2QEIoOwCRU= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/go.mod b/go.mod index b08ff98195a..25e0e7b45d4 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,6 @@ module github.com/google/go-github/v69 go 1.22.0 require ( - github.com/google/go-cmp v0.6.0 + github.com/google/go-cmp v0.7.0 github.com/google/go-querystring v1.1.0 ) diff --git a/go.sum b/go.sum index b2abdf11c21..831bfd79e0d 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,6 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/scrape/go.mod b/scrape/go.mod index e3da742a68f..82db6307bc0 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -4,7 +4,7 @@ go 1.22.0 require ( github.com/PuerkitoBio/goquery v1.9.3 - github.com/google/go-cmp v0.6.0 + github.com/google/go-cmp v0.7.0 github.com/google/go-github/v69 v69.2.0 github.com/xlzd/gotp v0.1.0 golang.org/x/net v0.35.0 diff --git a/scrape/go.sum b/scrape/go.sum index ca75cda0651..f0eddaf0950 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -3,8 +3,9 @@ github.com/PuerkitoBio/goquery v1.9.3/go.mod h1:1ndLHPdTz+DyQPICCWYlYQMPl0oXZj0G github.com/andybalholm/cascadia v1.3.3 h1:AG2YHrzJIm4BZ19iwJ/DAua6Btl3IwJX+VI4kktS1LM= github.com/andybalholm/cascadia v1.3.3/go.mod h1:xNd9bqTn98Ln4DwST8/nG+H0yuB8Hmgu1YHNnWw0GeA= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/go-github/v69 v69.2.0 h1:wR+Wi/fN2zdUx9YxSmYE0ktiX9IAR/BeePzeaUUbEHE= github.com/google/go-github/v69 v69.2.0/go.mod h1:xne4jymxLR6Uj9b7J7PyTpkMYstEMMwGZa0Aehh1azM= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= From 782d39f7fb968e87ab1665c0581a1cd7c2bfaed5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 18:07:55 -0500 Subject: [PATCH 659/751] build(deps): bump actions/cache from 4.2.0 to 4.2.1 in the actions group (#3492) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 16c021bc462..d3125e80ec3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -54,7 +54,7 @@ jobs: echo "go-mod-cache=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT - name: Cache go modules - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 + uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1 with: path: | ${{ steps.cache-paths.outputs.go-cache }} From a25b53e0b38bb335bc9780728a97d26cc8c7e4a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?At=C4=B1l=20Sensalduz?= <44255923+atilsensalduz@users.noreply.github.com> Date: Tue, 25 Feb 2025 14:34:26 +0300 Subject: [PATCH 660/751] fix: Resolve '400 Custom domains' error on GitHub Enterprise Server (#3489) --- github/github-accessors.go | 32 +++++++++++++++++++++++++ github/github-accessors_test.go | 41 +++++++++++++++++++++++++++++++++ github/repos_pages.go | 29 +++++++++++++++++++++++ github/repos_pages_test.go | 38 ++++++++++++++++++++++++++++++ 4 files changed, 140 insertions(+) diff --git a/github/github-accessors.go b/github/github-accessors.go index 6270bc1fc6c..085e6e59bed 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -16734,6 +16734,38 @@ func (p *PagesUpdate) GetSource() *PagesSource { return p.Source } +// GetBuildType returns the BuildType field if it's non-nil, zero value otherwise. +func (p *PagesUpdateWithoutCNAME) GetBuildType() string { + if p == nil || p.BuildType == nil { + return "" + } + return *p.BuildType +} + +// GetHTTPSEnforced returns the HTTPSEnforced field if it's non-nil, zero value otherwise. +func (p *PagesUpdateWithoutCNAME) GetHTTPSEnforced() bool { + if p == nil || p.HTTPSEnforced == nil { + return false + } + return *p.HTTPSEnforced +} + +// GetPublic returns the Public field if it's non-nil, zero value otherwise. +func (p *PagesUpdateWithoutCNAME) GetPublic() bool { + if p == nil || p.Public == nil { + return false + } + return *p.Public +} + +// GetSource returns the Source field. +func (p *PagesUpdateWithoutCNAME) GetSource() *PagesSource { + if p == nil { + return nil + } + return p.Source +} + // GetName returns the Name field if it's non-nil, zero value otherwise. func (p *PatternRuleParameters) GetName() string { if p == nil || p.Name == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index b3be0c11f27..094387db644 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -21709,6 +21709,47 @@ func TestPagesUpdate_GetSource(tt *testing.T) { p.GetSource() } +func TestPagesUpdateWithoutCNAME_GetBuildType(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &PagesUpdateWithoutCNAME{BuildType: &zeroValue} + p.GetBuildType() + p = &PagesUpdateWithoutCNAME{} + p.GetBuildType() + p = nil + p.GetBuildType() +} + +func TestPagesUpdateWithoutCNAME_GetHTTPSEnforced(tt *testing.T) { + tt.Parallel() + var zeroValue bool + p := &PagesUpdateWithoutCNAME{HTTPSEnforced: &zeroValue} + p.GetHTTPSEnforced() + p = &PagesUpdateWithoutCNAME{} + p.GetHTTPSEnforced() + p = nil + p.GetHTTPSEnforced() +} + +func TestPagesUpdateWithoutCNAME_GetPublic(tt *testing.T) { + tt.Parallel() + var zeroValue bool + p := &PagesUpdateWithoutCNAME{Public: &zeroValue} + p.GetPublic() + p = &PagesUpdateWithoutCNAME{} + p.GetPublic() + p = nil + p.GetPublic() +} + +func TestPagesUpdateWithoutCNAME_GetSource(tt *testing.T) { + tt.Parallel() + p := &PagesUpdateWithoutCNAME{} + p.GetSource() + p = nil + p.GetSource() +} + func TestPatternRuleParameters_GetName(tt *testing.T) { tt.Parallel() var zeroValue string diff --git a/github/repos_pages.go b/github/repos_pages.go index 6b9ba76e44d..930f6000b7f 100644 --- a/github/repos_pages.go +++ b/github/repos_pages.go @@ -170,7 +170,36 @@ func (s *RepositoriesService) UpdatePages(ctx context.Context, owner, repo strin if err != nil { return resp, err } + return resp, nil +} + +// PagesUpdateWithoutCNAME defines parameters for updating a GitHub Pages site on GitHub Enterprise Servers. +// Sending a request with a CNAME (any value, empty string, or null) results in a 400 error: "Custom domains are not available for GitHub Pages". +type PagesUpdateWithoutCNAME struct { + BuildType *string `json:"build_type,omitempty"` + Source *PagesSource `json:"source,omitempty"` + Public *bool `json:"public,omitempty"` + HTTPSEnforced *bool `json:"https_enforced,omitempty"` +} + +// UpdatePagesGHES updates GitHub Pages for the named repo in GitHub Enterprise Servers. +// +// GitHub API docs: https://docs.github.com/rest/pages/pages#update-information-about-a-github-pages-site +// +//meta:operation PUT /repos/{owner}/{repo}/pages +func (s *RepositoriesService) UpdatePagesGHES(ctx context.Context, owner, repo string, opts *PagesUpdateWithoutCNAME) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/pages", owner, repo) + req, err := s.client.NewRequest("PUT", u, opts) + + 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_test.go b/github/repos_pages_test.go index 3c139d99b2f..31a2ee1b2ee 100644 --- a/github/repos_pages_test.go +++ b/github/repos_pages_test.go @@ -200,6 +200,44 @@ func TestRepositoriesService_UpdatePagesWorkflow(t *testing.T) { }) } +func TestRepositoriesService_UpdatePagesGHES(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + input := &PagesUpdateWithoutCNAME{ + BuildType: Ptr("workflow"), + } + + mux.HandleFunc("/repos/o/r/pages", func(w http.ResponseWriter, r *http.Request) { + v := new(PagesUpdate) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) + + testMethod(t, r, "PUT") + want := &PagesUpdate{BuildType: Ptr("workflow")} + if !cmp.Equal(v, want) { + t.Errorf("Request body = %+v, want %+v", v, want) + } + + fmt.Fprint(w, `{"build_type":"workflow"}`) + }) + + ctx := context.Background() + _, err := client.Repositories.UpdatePagesGHES(ctx, "o", "r", input) + if err != nil { + t.Errorf("Repositories.UpdatePagesGHES returned error: %v", err) + } + + const methodName = "UpdatePagesGHES" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Repositories.UpdatePagesGHES(ctx, "\n", "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Repositories.UpdatePagesGHES(ctx, "o", "r", input) + }) +} + func TestRepositoriesService_UpdatePages_NullCNAME(t *testing.T) { t.Parallel() client, mux, _ := setup(t) From e9d8a58c483cd41c99b695bd11ab24427679be34 Mon Sep 17 00:00:00 2001 From: pputman-clabs <99900942+pputman-clabs@users.noreply.github.com> Date: Wed, 26 Feb 2025 06:27:08 -0600 Subject: [PATCH 661/751] Correct the `runIDFromURLRE` regex to properly match the callbackURL (#3495) --- github/github.go | 2 +- github/github_test.go | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/github/github.go b/github/github.go index d163b32d2cd..e78810df123 100644 --- a/github/github.go +++ b/github/github.go @@ -1772,7 +1772,7 @@ func (fn roundTripperFunc) RoundTrip(r *http.Request) (*http.Response, error) { return fn(r) } -var runIDFromURLRE = regexp.MustCompile(`^repos/.*/actions/runs/(\d+)/deployment_protection_rule$`) +var runIDFromURLRE = regexp.MustCompile(`repos/.*/actions/runs/(\d+)/deployment_protection_rule$`) // GetRunID is a Helper Function used to extract the workflow RunID from the *DeploymentProtectionRuleEvent.DeploymentCallBackURL. func (e *DeploymentProtectionRuleEvent) GetRunID() (int64, error) { diff --git a/github/github_test.go b/github/github_test.go index 683012adc53..46245ff76a6 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -3106,7 +3106,7 @@ func TestDeploymentProtectionRuleEvent_GetRunID(t *testing.T) { t.Parallel() var want int64 = 123456789 - url := "repos/dummy-org/dummy-repo/actions/runs/123456789/deployment_protection_rule" + url := "https://api.github.com/repos/dummy-org/dummy-repo/actions/runs/123456789/deployment_protection_rule" e := DeploymentProtectionRuleEvent{ DeploymentCallbackURL: &url, @@ -3117,9 +3117,20 @@ func TestDeploymentProtectionRuleEvent_GetRunID(t *testing.T) { t.Errorf("want %#v, got %#v", want, got) } - want = -1 - url = "repos/dummy-org/dummy-repo/actions/runs/abc123/deployment_protection_rule" + want = 123456789 + url = "repos/dummy-org/dummy-repo/actions/runs/123456789/deployment_protection_rule" + e = DeploymentProtectionRuleEvent{ + DeploymentCallbackURL: &url, + } + + got, _ = e.GetRunID() + if got != want { + t.Errorf("want %#v, got %#v", want, got) + } + + want = -1 + url = "https://api.github.com/repos/dummy-org/dummy-repo/actions/runs/abc123/deployment_protection_rule" got, err := e.GetRunID() if err == nil { t.Errorf("Expected error to be returned") From d0976cc1b1715743296c1dba5c8f8ec422a5e8c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?At=C4=B1l=20Sensalduz?= <44255923+atilsensalduz@users.noreply.github.com> Date: Wed, 26 Feb 2025 15:35:15 +0300 Subject: [PATCH 662/751] feat: Add support for GitHub-hosted runner API endpoints (#3487) --- github/actions_hosted_runners.go | 376 +++++++ github/actions_hosted_runners_test.go | 918 ++++++++++++++++++ github/enterprise_actions_hosted_runners.go | 234 +++++ .../enterprise_actions_hosted_runners_test.go | 917 +++++++++++++++++ github/github-accessors.go | 128 +++ github/github-accessors_test.go | 167 ++++ github/repos.go | 6 +- openapi_operations.yaml | 189 +++- 8 files changed, 2928 insertions(+), 7 deletions(-) create mode 100644 github/actions_hosted_runners.go create mode 100644 github/actions_hosted_runners_test.go create mode 100644 github/enterprise_actions_hosted_runners.go create mode 100644 github/enterprise_actions_hosted_runners_test.go diff --git a/github/actions_hosted_runners.go b/github/actions_hosted_runners.go new file mode 100644 index 00000000000..dbe1f6b5b1e --- /dev/null +++ b/github/actions_hosted_runners.go @@ -0,0 +1,376 @@ +// Copyright 2025 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" + "errors" + "fmt" +) + +// HostedRunnerPublicIP represents the details of a public IP for GitHub-hosted runner. +type HostedRunnerPublicIP struct { + Enabled bool `json:"enabled"` // Whether public IP is enabled. + Prefix string `json:"prefix"` // The prefix for the public IP. Example: 20.80.208.150 + Length int `json:"length"` // The length of the IP prefix. Example: 28 +} + +// HostedRunnerMachineSpec represents the details of a particular machine specification for GitHub-hosted runner. +type HostedRunnerMachineSpec struct { + ID string `json:"id"` // The ID used for the `size` parameter when creating a new runner. Example: 8-core + CPUCores int `json:"cpu_cores"` // The number of cores. Example: 8 + MemoryGB int `json:"memory_gb"` // The available RAM for the machine spec. Example: 32 + StorageGB int `json:"storage_gb"` // The available SSD storage for the machine spec. Example: 300 +} + +// HostedRunner represents a single GitHub-hosted runner with additional details. +type HostedRunner struct { + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + RunnerGroupID *int64 `json:"runner_group_id,omitempty"` + Platform *string `json:"platform,omitempty"` + ImageDetails *HostedRunnerImageDetail `json:"image_details,omitempty"` + MachineSizeDetails *HostedRunnerMachineSpec `json:"machine_size_details,omitempty"` + Status *string `json:"status,omitempty"` + MaximumRunners *int64 `json:"maximum_runners,omitempty"` + PublicIPEnabled *bool `json:"public_ip_enabled,omitempty"` + PublicIPs []*HostedRunnerPublicIP `json:"public_ips,omitempty"` + LastActiveOn *Timestamp `json:"last_active_on,omitempty"` +} + +// HostedRunnerImageDetail represents the image details of a GitHub-hosted runners. +type HostedRunnerImageDetail struct { + ID *string `json:"id"` // The ID of the image. Use this ID for the `image` parameter when creating a new larger runner. Example: ubuntu-20.04 + SizeGB *int64 `json:"size_gb"` // Image size in GB. Example: 86 + DisplayName *string `json:"display_name"` // Display name for this image. Example: 20.04 + Source *string `json:"source"` // The image provider. Example: github, partner, custom + Version *string `json:"version"` // The image version of the hosted runner pool. Example: latest +} + +// HostedRunners represents a collection of GitHub-hosted runners for an organization. +type HostedRunners struct { + TotalCount int `json:"total_count"` + Runners []*HostedRunner `json:"runners"` +} + +// ListHostedRunners lists all the GitHub-hosted runners for an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#list-github-hosted-runners-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/hosted-runners +func (s *ActionsService) ListHostedRunners(ctx context.Context, org string, opts *ListOptions) (*HostedRunners, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners", org) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + runners := &HostedRunners{} + resp, err := s.client.Do(ctx, req, &runners) + if err != nil { + return nil, resp, err + } + + return runners, resp, nil +} + +// HostedRunnerImage represents the image of GitHub-hosted runners. +// To list all available images, use GET /actions/hosted-runners/images/github-owned or GET /actions/hosted-runners/images/partner. +type HostedRunnerImage struct { + ID string `json:"id"` + Source string `json:"source"` + Version string `json:"version"` +} + +// HostedRunnerRequest specifies body parameters to Hosted Runner configuration. +type HostedRunnerRequest struct { + Name string `json:"name,omitempty"` + Image HostedRunnerImage `json:"image,omitempty"` + RunnerGroupID int64 `json:"runner_group_id,omitempty"` + Size string `json:"size,omitempty"` + MaximumRunners int64 `json:"maximum_runners,omitempty"` + EnableStaticIP bool `json:"enable_static_ip,omitempty"` + ImageVersion string `json:"image_version,omitempty"` +} + +// validateCreateHostedRunnerRequest validates the provided HostedRunnerRequest to ensure +// that all required fields are properly set and that no invalid fields are present for hosted runner create request. +// +// If any of these conditions are violated, an appropriate error message is returned. +// Otherwise, nil is returned, indicating the request is valid. +func validateCreateHostedRunnerRequest(request *HostedRunnerRequest) error { + if request.Size == "" { + return errors.New("size is required for creating a hosted runner") + } + if request.Image == (HostedRunnerImage{}) { + return errors.New("image is required for creating a hosted runner") + } + if request.Name == "" { + return errors.New("name is required for creating a hosted runner") + } + if request.RunnerGroupID == 0 { + return errors.New("runner group ID is required for creating a hosted runner") + } + if request.ImageVersion != "" { + return errors.New("imageVersion should not be set directly; use the Image struct to specify image details") + } + return nil +} + +// CreateHostedRunner creates a GitHub-hosted runner for an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#create-a-github-hosted-runner-for-an-organization +// +//meta:operation POST /orgs/{org}/actions/hosted-runners +func (s *ActionsService) CreateHostedRunner(ctx context.Context, org string, request *HostedRunnerRequest) (*HostedRunner, *Response, error) { + if err := validateCreateHostedRunnerRequest(request); err != nil { + return nil, nil, fmt.Errorf("validation failed: %w", err) + } + + u := fmt.Sprintf("orgs/%v/actions/hosted-runners", org) + req, err := s.client.NewRequest("POST", u, request) + if err != nil { + return nil, nil, err + } + + hostedRunner := new(HostedRunner) + resp, err := s.client.Do(ctx, req, hostedRunner) + if err != nil { + return nil, resp, err + } + + return hostedRunner, resp, nil +} + +// HostedRunnerImageSpecs represents the details of a GitHub-hosted runner image. +type HostedRunnerImageSpecs struct { + ID string `json:"id"` + Platform string `json:"platform"` + SizeGB int `json:"size_gb"` + DisplayName string `json:"display_name"` + Source string `json:"source"` +} + +// HostedRunnerImages represents the response containing the total count and details of runner images. +type HostedRunnerImages struct { + TotalCount int `json:"total_count"` + Images []*HostedRunnerImageSpecs `json:"images"` +} + +// GetHostedRunnerGitHubOwnedImages gets the list of GitHub-owned images available for GitHub-hosted runners for an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-github-owned-images-for-github-hosted-runners-in-an-organization +// +//meta:operation GET /orgs/{org}/actions/hosted-runners/images/github-owned +func (s *ActionsService) GetHostedRunnerGitHubOwnedImages(ctx context.Context, org string) (*HostedRunnerImages, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/images/github-owned", org) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + hostedRunnerImages := new(HostedRunnerImages) + resp, err := s.client.Do(ctx, req, hostedRunnerImages) + if err != nil { + return nil, resp, err + } + + return hostedRunnerImages, resp, nil +} + +// GetHostedRunnerPartnerImages gets the list of partner images available for GitHub-hosted runners for an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-partner-images-for-github-hosted-runners-in-an-organization +// +//meta:operation GET /orgs/{org}/actions/hosted-runners/images/partner +func (s *ActionsService) GetHostedRunnerPartnerImages(ctx context.Context, org string) (*HostedRunnerImages, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/images/partner", org) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + hostedRunnerImages := new(HostedRunnerImages) + resp, err := s.client.Do(ctx, req, hostedRunnerImages) + if err != nil { + return nil, resp, err + } + + return hostedRunnerImages, resp, nil +} + +// HostedRunnerPublicIPLimits represents the static public IP limits for GitHub-hosted runners. +type HostedRunnerPublicIPLimits struct { + PublicIPs *PublicIPUsage `json:"public_ips"` +} + +// PublicIPUsage provides details of static public IP limits for GitHub-hosted runners. +type PublicIPUsage struct { + Maximum int64 `json:"maximum"` // The maximum number of static public IP addresses that can be used for Hosted Runners. Example: 50 + CurrentUsage int64 `json:"current_usage"` // The current number of static public IP addresses in use by Hosted Runners. Example: 17 +} + +// GetHostedRunnerLimits gets the GitHub-hosted runners Static public IP Limits for an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-limits-on-github-hosted-runners-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/hosted-runners/limits +func (s *ActionsService) GetHostedRunnerLimits(ctx context.Context, org string) (*HostedRunnerPublicIPLimits, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/limits", org) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + publicIPLimits := new(HostedRunnerPublicIPLimits) + resp, err := s.client.Do(ctx, req, publicIPLimits) + if err != nil { + return nil, resp, err + } + + return publicIPLimits, resp, nil +} + +// HostedRunnerMachineSpecs represents the response containing the total count and details of machine specs for GitHub-hosted runners. +type HostedRunnerMachineSpecs struct { + TotalCount int `json:"total_count"` + MachineSpecs []*HostedRunnerMachineSpec `json:"machine_specs"` +} + +// GetHostedRunnerMachineSpecs gets the list of machine specs available for GitHub-hosted runners for an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-github-hosted-runners-machine-specs-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/hosted-runners/machine-sizes +func (s *ActionsService) GetHostedRunnerMachineSpecs(ctx context.Context, org string) (*HostedRunnerMachineSpecs, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/machine-sizes", org) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + machineSpecs := new(HostedRunnerMachineSpecs) + resp, err := s.client.Do(ctx, req, machineSpecs) + if err != nil { + return nil, resp, err + } + + return machineSpecs, resp, nil +} + +// HostedRunnerPlatforms represents the response containing the total count and platforms for GitHub-hosted runners. +type HostedRunnerPlatforms struct { + TotalCount int `json:"total_count"` + Platforms []string `json:"platforms"` +} + +// GetHostedRunnerPlatforms gets list of platforms available for GitHub-hosted runners for an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-platforms-for-github-hosted-runners-in-an-organization +// +//meta:operation GET /orgs/{org}/actions/hosted-runners/platforms +func (s *ActionsService) GetHostedRunnerPlatforms(ctx context.Context, org string) (*HostedRunnerPlatforms, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/platforms", org) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + platforms := new(HostedRunnerPlatforms) + resp, err := s.client.Do(ctx, req, platforms) + if err != nil { + return nil, resp, err + } + + return platforms, resp, nil +} + +// GetHostedRunner gets a GitHub-hosted runner in an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-a-github-hosted-runner-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id} +func (s *ActionsService) GetHostedRunner(ctx context.Context, org string, runnerID int64) (*HostedRunner, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/%v", org, runnerID) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + hostedRunner := new(HostedRunner) + resp, err := s.client.Do(ctx, req, hostedRunner) + if err != nil { + return nil, resp, err + } + + return hostedRunner, resp, nil +} + +// validateUpdateHostedRunnerRequest validates the provided HostedRunnerRequest to ensure +// that no disallowed updates are made for a hosted runner update request. +// +// If any of these conditions are violated, an appropriate error message is returned. +// Otherwise, nil is returned, indicating the request is valid for an update. +func validateUpdateHostedRunnerRequest(request *HostedRunnerRequest) error { + if request.Size != "" { + return errors.New("size cannot be updated, API does not support updating size") + } + if request.Image != (HostedRunnerImage{}) { + return errors.New("image struct should not be set directly; use the ImageVersion to specify version details") + } + return nil +} + +// UpdateHostedRunner updates a GitHub-hosted runner for an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#update-a-github-hosted-runner-for-an-organization +// +//meta:operation PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id} +func (s *ActionsService) UpdateHostedRunner(ctx context.Context, org string, runnerID int64, updateReq HostedRunnerRequest) (*HostedRunner, *Response, error) { + if err := validateUpdateHostedRunnerRequest(&updateReq); err != nil { + return nil, nil, fmt.Errorf("validation failed: %w", err) + } + + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/%v", org, runnerID) + req, err := s.client.NewRequest("PATCH", u, updateReq) + if err != nil { + return nil, nil, err + } + + hostedRunner := new(HostedRunner) + resp, err := s.client.Do(ctx, req, hostedRunner) + if err != nil { + return nil, resp, err + } + + return hostedRunner, resp, nil +} + +// DeleteHostedRunner deletes GitHub-hosted runner from an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#delete-a-github-hosted-runner-for-an-organization +// +//meta:operation DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id} +func (s *ActionsService) DeleteHostedRunner(ctx context.Context, org string, runnerID int64) (*HostedRunner, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/%v", org, runnerID) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, nil, err + } + + hostedRunner := new(HostedRunner) + resp, err := s.client.Do(ctx, req, hostedRunner) + if err != nil { + return nil, resp, err + } + + return hostedRunner, resp, nil +} diff --git a/github/actions_hosted_runners_test.go b/github/actions_hosted_runners_test.go new file mode 100644 index 00000000000..e1191ceb360 --- /dev/null +++ b/github/actions_hosted_runners_test.go @@ -0,0 +1,918 @@ +// Copyright 2025 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" + "time" + + "github.com/google/go-cmp/cmp" +) + +func TestActionsService_ListHostedRunners(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/orgs/o/actions/hosted-runners", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "total_count": 2, + "runners": [ + { + "id": 5, + "name": "My hosted ubuntu runner", + "runner_group_id": 2, + "platform": "linux-x64", + "image_details": { + "id": "ubuntu-20.04", + "size_gb": 86 + }, + "machine_size_details": { + "id": "4-core", + "cpu_cores": 4, + "memory_gb": 16, + "storage_gb": 150 + }, + "status": "Ready", + "maximum_runners": 10, + "public_ip_enabled": true, + "public_ips": [ + { + "enabled": true, + "prefix": "20.80.208.150", + "length": 31 + } + ], + "last_active_on": "2023-04-26T15:23:37Z" + }, + { + "id": 7, + "name": "My hosted Windows runner", + "runner_group_id": 2, + "platform": "win-x64", + "image_details": { + "id": "windows-latest", + "size_gb": 256 + }, + "machine_size_details": { + "id": "8-core", + "cpu_cores": 8, + "memory_gb": 32, + "storage_gb": 300 + }, + "status": "Ready", + "maximum_runners": 20, + "public_ip_enabled": false, + "public_ips": [], + "last_active_on": "2023-04-26T15:23:37Z" + } + ] + }`) + }) + opts := &ListOptions{Page: 1, PerPage: 1} + ctx := context.Background() + hostedRunners, _, err := client.Actions.ListHostedRunners(ctx, "o", opts) + if err != nil { + t.Errorf("Actions.ListHostedRunners returned error: %v", err) + } + + lastActiveOn := Timestamp{time.Date(2023, 4, 26, 15, 23, 37, 0, time.UTC)} + + want := &HostedRunners{ + TotalCount: 2, + Runners: []*HostedRunner{ + { + ID: Ptr(int64(5)), + Name: Ptr("My hosted ubuntu runner"), + RunnerGroupID: Ptr(int64(2)), + Platform: Ptr("linux-x64"), + ImageDetails: &HostedRunnerImageDetail{ + ID: Ptr("ubuntu-20.04"), + SizeGB: Ptr(int64(86)), + }, + MachineSizeDetails: &HostedRunnerMachineSpec{ + ID: "4-core", + CPUCores: 4, + MemoryGB: 16, + StorageGB: 150, + }, + Status: Ptr("Ready"), + MaximumRunners: Ptr(int64(10)), + PublicIPEnabled: Ptr(true), + PublicIPs: []*HostedRunnerPublicIP{ + { + Enabled: true, + Prefix: "20.80.208.150", + Length: 31, + }, + }, + LastActiveOn: Ptr(lastActiveOn), + }, + { + ID: Ptr(int64(7)), + Name: Ptr("My hosted Windows runner"), + RunnerGroupID: Ptr(int64(2)), + Platform: Ptr("win-x64"), + ImageDetails: &HostedRunnerImageDetail{ + ID: Ptr("windows-latest"), + SizeGB: Ptr(int64(256)), + }, + MachineSizeDetails: &HostedRunnerMachineSpec{ + ID: "8-core", + CPUCores: 8, + MemoryGB: 32, + StorageGB: 300, + }, + Status: Ptr("Ready"), + MaximumRunners: Ptr(int64(20)), + PublicIPEnabled: Ptr(false), + PublicIPs: []*HostedRunnerPublicIP{}, + LastActiveOn: Ptr(lastActiveOn), + }, + }, + } + if !cmp.Equal(hostedRunners, want) { + t.Errorf("Actions.ListHostedRunners returned %+v, want %+v", hostedRunners, want) + } + + const methodName = "ListHostedRunners" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.ListHostedRunners(ctx, "\n", opts) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.ListHostedRunners(ctx, "o", opts) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_CreateHostedRunner(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/orgs/o/actions/hosted-runners", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + fmt.Fprint(w, `{ + "id": 5, + "name": "My hosted ubuntu runner", + "runner_group_id": 2, + "platform": "linux-x64", + "image_details": { + "id": "ubuntu-20.04", + "size_gb": 86 + }, + "machine_size_details": { + "id": "4-core", + "cpu_cores": 4, + "memory_gb": 16, + "storage_gb": 150 + }, + "status": "Ready", + "maximum_runners": 10, + "public_ip_enabled": true, + "public_ips": [ + { + "enabled": true, + "prefix": "20.80.208.150", + "length": 31 + } + ], + "last_active_on": "2023-04-26T15:23:37Z" + }`) + }) + + ctx := context.Background() + + validReq := &HostedRunnerRequest{ + Name: "My Hosted runner", + Image: HostedRunnerImage{ + ID: "ubuntu-latest", + Source: "github", + Version: "latest", + }, + RunnerGroupID: 1, + Size: "4-core", + MaximumRunners: 50, + EnableStaticIP: false, + } + hostedRunner, _, err := client.Actions.CreateHostedRunner(ctx, "o", validReq) + if err != nil { + t.Errorf("Actions.CreateHostedRunner returned error: %v", err) + } + + lastActiveOn := Timestamp{time.Date(2023, 4, 26, 15, 23, 37, 0, time.UTC)} + want := &HostedRunner{ + ID: Ptr(int64(5)), + Name: Ptr("My hosted ubuntu runner"), + RunnerGroupID: Ptr(int64(2)), + Platform: Ptr("linux-x64"), + ImageDetails: &HostedRunnerImageDetail{ + ID: Ptr("ubuntu-20.04"), + SizeGB: Ptr(int64(86)), + }, + MachineSizeDetails: &HostedRunnerMachineSpec{ + ID: "4-core", + CPUCores: 4, + MemoryGB: 16, + StorageGB: 150, + }, + Status: Ptr("Ready"), + MaximumRunners: Ptr(int64(10)), + PublicIPEnabled: Ptr(true), + PublicIPs: []*HostedRunnerPublicIP{ + { + Enabled: true, + Prefix: "20.80.208.150", + Length: 31, + }, + }, + LastActiveOn: Ptr(lastActiveOn), + } + + if !cmp.Equal(hostedRunner, want) { + t.Errorf("Actions.CreateHostedRunner returned %+v, want %+v", hostedRunner, want) + } + + // Validation tests + testCases := []struct { + name string + request *HostedRunnerRequest + expectedError string + }{ + { + name: "Missing Size", + request: &HostedRunnerRequest{ + Name: "My Hosted runner", + Image: HostedRunnerImage{ + ID: "ubuntu-latest", + Source: "github", + Version: "latest", + }, + RunnerGroupID: 1, + }, + expectedError: "validation failed: size is required for creating a hosted runner", + }, + { + name: "Missing Image", + request: &HostedRunnerRequest{ + Name: "My Hosted runner", + RunnerGroupID: 1, + Size: "4-core", + }, + expectedError: "validation failed: image is required for creating a hosted runner", + }, + { + name: "Missing Name", + request: &HostedRunnerRequest{ + Image: HostedRunnerImage{ + ID: "ubuntu-latest", + Source: "github", + Version: "latest", + }, + RunnerGroupID: 1, + Size: "4-core", + }, + expectedError: "validation failed: name is required for creating a hosted runner", + }, + { + name: "Missing RunnerGroupID", + request: &HostedRunnerRequest{ + Name: "My Hosted runner", + Image: HostedRunnerImage{ + ID: "ubuntu-latest", + Source: "github", + Version: "latest", + }, + Size: "4-core", + }, + expectedError: "validation failed: runner group ID is required for creating a hosted runner", + }, + { + name: "ImageVersion Set Instead of Image Struct", + request: &HostedRunnerRequest{ + Name: "My Hosted runner", + Image: HostedRunnerImage{ + ID: "ubuntu-latest", + Source: "github", + Version: "latest", + }, + RunnerGroupID: 1, + Size: "4-core", + ImageVersion: "1.0.0", + MaximumRunners: 50, + EnableStaticIP: false, + }, + expectedError: "validation failed: imageVersion should not be set directly; use the Image struct to specify image details", + }, + } + + for _, tt := range testCases { + _, _, err := client.Actions.CreateHostedRunner(ctx, "o", tt.request) + if err == nil || err.Error() != tt.expectedError { + t.Errorf("expected error: %v, got: %v", tt.expectedError, err) + } + } + + const methodName = "CreateHostedRunner" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.CreateHostedRunner(ctx, "\n", validReq) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.CreateHostedRunner(ctx, "o", validReq) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_GetHostedRunnerGitHubOwnedImages(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/orgs/o/actions/hosted-runners/images/github-owned", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "total_count": 1, + "images": [ + { + "id": "ubuntu-20.04", + "platform": "linux-x64", + "size_gb": 86, + "display_name": "20.04", + "source": "github" + } + ] + }`) + }) + + ctx := context.Background() + hostedRunnerImages, _, err := client.Actions.GetHostedRunnerGitHubOwnedImages(ctx, "o") + if err != nil { + t.Errorf("Actions.GetHostedRunnerGitHubOwnedImages returned error: %v", err) + } + + want := &HostedRunnerImages{ + TotalCount: 1, + Images: []*HostedRunnerImageSpecs{ + { + ID: "ubuntu-20.04", + Platform: "linux-x64", + SizeGB: 86, + DisplayName: "20.04", + Source: "github", + }, + }, + } + + if !cmp.Equal(hostedRunnerImages, want) { + t.Errorf("Actions.GetHostedRunnerGitHubOwnedImages returned %+v, want %+v", hostedRunnerImages, want) + } + + const methodName = "GetHostedRunnerGitHubOwnedImages" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.GetHostedRunnerGitHubOwnedImages(ctx, "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.GetHostedRunnerGitHubOwnedImages(ctx, "o") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_GetHostedRunnerPartnerImages(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/orgs/o/actions/hosted-runners/images/partner", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "total_count": 1, + "images": [ + { + "id": "ubuntu-20.04", + "platform": "linux-x64", + "size_gb": 86, + "display_name": "20.04", + "source": "partner" + } + ] + }`) + }) + + ctx := context.Background() + hostedRunnerImages, _, err := client.Actions.GetHostedRunnerPartnerImages(ctx, "o") + if err != nil { + t.Errorf("Actions.GetHostedRunnerPartnerImages returned error: %v", err) + } + + want := &HostedRunnerImages{ + TotalCount: 1, + Images: []*HostedRunnerImageSpecs{ + { + ID: "ubuntu-20.04", + Platform: "linux-x64", + SizeGB: 86, + DisplayName: "20.04", + Source: "partner", + }, + }, + } + + if !cmp.Equal(hostedRunnerImages, want) { + t.Errorf("Actions.GetHostedRunnerPartnerImages returned %+v, want %+v", hostedRunnerImages, want) + } + + const methodName = "GetHostedRunnerPartnerImages" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.GetHostedRunnerPartnerImages(ctx, "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.GetHostedRunnerPartnerImages(ctx, "o") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_GetHostedRunnerLimits(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/orgs/o/actions/hosted-runners/limits", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "public_ips": { + "current_usage": 17, + "maximum": 50 + } + }`) + }) + + ctx := context.Background() + publicIPLimits, _, err := client.Actions.GetHostedRunnerLimits(ctx, "o") + if err != nil { + t.Errorf("Actions.GetPartnerImages returned error: %v", err) + } + + want := &HostedRunnerPublicIPLimits{ + PublicIPs: &PublicIPUsage{ + CurrentUsage: 17, + Maximum: 50, + }, + } + + if !cmp.Equal(publicIPLimits, want) { + t.Errorf("Actions.GetHostedRunnerLimits returned %+v, want %+v", publicIPLimits, want) + } + + const methodName = "GetHostedRunnerLimits" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.GetHostedRunnerLimits(ctx, "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.GetHostedRunnerLimits(ctx, "o") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_GetHostedRunnerMachineSpecs(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/orgs/o/actions/hosted-runners/machine-sizes", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "total_count": 1, + "machine_specs": [ + { + "id": "4-core", + "cpu_cores": 4, + "memory_gb": 16, + "storage_gb": 150 + } + ] + }`) + }) + + ctx := context.Background() + machineSpecs, _, err := client.Actions.GetHostedRunnerMachineSpecs(ctx, "o") + if err != nil { + t.Errorf("Actions.GetHostedRunnerMachineSpecs returned error: %v", err) + } + want := &HostedRunnerMachineSpecs{ + TotalCount: 1, + MachineSpecs: []*HostedRunnerMachineSpec{ + { + ID: "4-core", + CPUCores: 4, + MemoryGB: 16, + StorageGB: 150, + }, + }, + } + + if !cmp.Equal(machineSpecs, want) { + t.Errorf("Actions.GetHostedRunnerMachineSpecs returned %+v, want %+v", machineSpecs, want) + } + + const methodName = "GetHostedRunnerMachineSpecs" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.GetHostedRunnerMachineSpecs(ctx, "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.GetHostedRunnerMachineSpecs(ctx, "o") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_GetHostedRunnerPlatforms(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/orgs/o/actions/hosted-runners/platforms", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "total_count": 1, + "platforms": [ + "linux-x64", + "win-x64" + ] + }`) + }) + + ctx := context.Background() + platforms, _, err := client.Actions.GetHostedRunnerPlatforms(ctx, "o") + if err != nil { + t.Errorf("Actions.GetHostedRunnerPlatforms returned error: %v", err) + } + want := &HostedRunnerPlatforms{ + TotalCount: 1, + Platforms: []string{ + "linux-x64", + "win-x64", + }, + } + + if !cmp.Equal(platforms, want) { + t.Errorf("Actions.GetHostedRunnerPlatforms returned %+v, want %+v", platforms, want) + } + + const methodName = "GetHostedRunnerPlatforms" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.GetHostedRunnerPlatforms(ctx, "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.GetHostedRunnerPlatforms(ctx, "o") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_GetHostedRunner(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/orgs/o/actions/hosted-runners/23", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "id": 5, + "name": "My hosted ubuntu runner", + "runner_group_id": 2, + "platform": "linux-x64", + "image_details": { + "id": "ubuntu-20.04", + "size_gb": 86 + }, + "machine_size_details": { + "id": "4-core", + "cpu_cores": 4, + "memory_gb": 16, + "storage_gb": 150 + }, + "status": "Ready", + "maximum_runners": 10, + "public_ip_enabled": true, + "public_ips": [ + { + "enabled": true, + "prefix": "20.80.208.150", + "length": 31 + } + ], + "last_active_on": "2023-04-26T15:23:37Z" + }`) + }) + + ctx := context.Background() + hostedRunner, _, err := client.Actions.GetHostedRunner(ctx, "o", 23) + if err != nil { + t.Errorf("Actions.GetHostedRunner returned error: %v", err) + } + + lastActiveOn := Timestamp{time.Date(2023, 4, 26, 15, 23, 37, 0, time.UTC)} + want := &HostedRunner{ + ID: Ptr(int64(5)), + Name: Ptr("My hosted ubuntu runner"), + RunnerGroupID: Ptr(int64(2)), + Platform: Ptr("linux-x64"), + ImageDetails: &HostedRunnerImageDetail{ + ID: Ptr("ubuntu-20.04"), + SizeGB: Ptr(int64(86)), + }, + MachineSizeDetails: &HostedRunnerMachineSpec{ + ID: "4-core", + CPUCores: 4, + MemoryGB: 16, + StorageGB: 150, + }, + Status: Ptr("Ready"), + MaximumRunners: Ptr(int64(10)), + PublicIPEnabled: Ptr(true), + PublicIPs: []*HostedRunnerPublicIP{ + { + Enabled: true, + Prefix: "20.80.208.150", + Length: 31, + }, + }, + LastActiveOn: Ptr(lastActiveOn), + } + + if !cmp.Equal(hostedRunner, want) { + t.Errorf("Actions.GetHostedRunner returned %+v, want %+v", hostedRunner, want) + } + + const methodName = "GetHostedRunner" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.GetHostedRunner(ctx, "\n", 23) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.GetHostedRunner(ctx, "o", 23) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_UpdateHostedRunner(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/orgs/o/actions/hosted-runners/23", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PATCH") + fmt.Fprint(w, `{ + "id": 5, + "name": "My hosted ubuntu runner", + "runner_group_id": 2, + "platform": "linux-x64", + "image_details": { + "id": "ubuntu-20.04", + "size_gb": 86 + }, + "machine_size_details": { + "id": "4-core", + "cpu_cores": 4, + "memory_gb": 16, + "storage_gb": 150 + }, + "status": "Ready", + "maximum_runners": 10, + "public_ip_enabled": true, + "public_ips": [ + { + "enabled": true, + "prefix": "20.80.208.150", + "length": 31 + } + ], + "last_active_on": "2023-04-26T15:23:37Z" + }`) + }) + + ctx := context.Background() + validReq := HostedRunnerRequest{ + Name: "My larger runner", + RunnerGroupID: 1, + MaximumRunners: 50, + EnableStaticIP: false, + ImageVersion: "1.0.0", + } + hostedRunner, _, err := client.Actions.UpdateHostedRunner(ctx, "o", 23, validReq) + if err != nil { + t.Errorf("Actions.UpdateHostedRunner returned error: %v", err) + } + + lastActiveOn := Timestamp{time.Date(2023, 4, 26, 15, 23, 37, 0, time.UTC)} + want := &HostedRunner{ + ID: Ptr(int64(5)), + Name: Ptr("My hosted ubuntu runner"), + RunnerGroupID: Ptr(int64(2)), + Platform: Ptr("linux-x64"), + ImageDetails: &HostedRunnerImageDetail{ + ID: Ptr("ubuntu-20.04"), + SizeGB: Ptr(int64(86)), + }, + MachineSizeDetails: &HostedRunnerMachineSpec{ + ID: "4-core", + CPUCores: 4, + MemoryGB: 16, + StorageGB: 150, + }, + Status: Ptr("Ready"), + MaximumRunners: Ptr(int64(10)), + PublicIPEnabled: Ptr(true), + PublicIPs: []*HostedRunnerPublicIP{ + { + Enabled: true, + Prefix: "20.80.208.150", + Length: 31, + }, + }, + LastActiveOn: Ptr(lastActiveOn), + } + + if !cmp.Equal(hostedRunner, want) { + t.Errorf("Actions.UpdateHostedRunner returned %+v, want %+v", hostedRunner, want) + } + + testCases := []struct { + name string + request HostedRunnerRequest + expectedError string + }{ + { + name: "Size Set in Update Request", + request: HostedRunnerRequest{ + Name: "My larger runner", + RunnerGroupID: 1, + MaximumRunners: 50, + EnableStaticIP: false, + ImageVersion: "1.0.0", + Size: "4-core", // Should cause validation error + }, + expectedError: "validation failed: size cannot be updated, API does not support updating size", + }, + { + name: "Image Set in Update Request", + request: HostedRunnerRequest{ + Name: "My larger runner", + RunnerGroupID: 1, + MaximumRunners: 50, + EnableStaticIP: false, + ImageVersion: "1.0.0", + Image: HostedRunnerImage{ // Should cause validation error + ID: "ubuntu-latest", + Source: "github", + Version: "latest", + }, + }, + expectedError: "validation failed: image struct should not be set directly; use the ImageVersion to specify version details", + }, + } + for _, tt := range testCases { + _, _, err := client.Enterprise.UpdateHostedRunner(ctx, "o", 23, tt.request) + if err == nil || err.Error() != tt.expectedError { + t.Errorf("expected error: %v, got: %v", tt.expectedError, err) + } + } + + const methodName = "UpdateHostedRunner" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.UpdateHostedRunner(ctx, "\n", 23, validReq) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.UpdateHostedRunner(ctx, "o", 23, validReq) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_DeleteHostedRunner(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/orgs/o/actions/hosted-runners/23", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + fmt.Fprint(w, `{ + "id": 5, + "name": "My hosted ubuntu runner", + "runner_group_id": 2, + "platform": "linux-x64", + "image_details": { + "id": "ubuntu-20.04", + "size_gb": 86 + }, + "machine_size_details": { + "id": "4-core", + "cpu_cores": 4, + "memory_gb": 16, + "storage_gb": 150 + }, + "status": "Ready", + "maximum_runners": 10, + "public_ip_enabled": true, + "public_ips": [ + { + "enabled": true, + "prefix": "20.80.208.150", + "length": 31 + } + ], + "last_active_on": "2023-04-26T15:23:37Z" + }`) + }) + + ctx := context.Background() + hostedRunner, _, err := client.Actions.DeleteHostedRunner(ctx, "o", 23) + if err != nil { + t.Errorf("Actions.GetHostedRunner returned error: %v", err) + } + + lastActiveOn := Timestamp{time.Date(2023, 4, 26, 15, 23, 37, 0, time.UTC)} + want := &HostedRunner{ + ID: Ptr(int64(5)), + Name: Ptr("My hosted ubuntu runner"), + RunnerGroupID: Ptr(int64(2)), + Platform: Ptr("linux-x64"), + ImageDetails: &HostedRunnerImageDetail{ + ID: Ptr("ubuntu-20.04"), + SizeGB: Ptr(int64(86)), + }, + MachineSizeDetails: &HostedRunnerMachineSpec{ + ID: "4-core", + CPUCores: 4, + MemoryGB: 16, + StorageGB: 150, + }, + Status: Ptr("Ready"), + MaximumRunners: Ptr(int64(10)), + PublicIPEnabled: Ptr(true), + PublicIPs: []*HostedRunnerPublicIP{ + { + Enabled: true, + Prefix: "20.80.208.150", + Length: 31, + }, + }, + LastActiveOn: Ptr(lastActiveOn), + } + + if !cmp.Equal(hostedRunner, want) { + t.Errorf("Actions.DeleteHostedRunner returned %+v, want %+v", hostedRunner, want) + } + + const methodName = "DeleteHostedRunner" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.DeleteHostedRunner(ctx, "\n", 23) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.DeleteHostedRunner(ctx, "o", 23) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} diff --git a/github/enterprise_actions_hosted_runners.go b/github/enterprise_actions_hosted_runners.go new file mode 100644 index 00000000000..e82ba9b806f --- /dev/null +++ b/github/enterprise_actions_hosted_runners.go @@ -0,0 +1,234 @@ +// Copyright 2025 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" +) + +// ListHostedRunners lists all the GitHub-hosted runners for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#list-github-hosted-runners-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners +func (s *EnterpriseService) ListHostedRunners(ctx context.Context, enterprise string, opts *ListOptions) (*HostedRunners, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners", enterprise) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + runners := &HostedRunners{} + resp, err := s.client.Do(ctx, req, &runners) + if err != nil { + return nil, resp, err + } + + return runners, resp, nil +} + +// CreateHostedRunner creates a GitHub-hosted runner for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#create-a-github-hosted-runner-for-an-enterprise +// +//meta:operation POST /enterprises/{enterprise}/actions/hosted-runners +func (s *EnterpriseService) CreateHostedRunner(ctx context.Context, enterprise string, request *HostedRunnerRequest) (*HostedRunner, *Response, error) { + if err := validateCreateHostedRunnerRequest(request); err != nil { + return nil, nil, fmt.Errorf("validation failed: %w", err) + } + + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners", enterprise) + req, err := s.client.NewRequest("POST", u, request) + if err != nil { + return nil, nil, err + } + + hostedRunner := new(HostedRunner) + resp, err := s.client.Do(ctx, req, hostedRunner) + if err != nil { + return nil, resp, err + } + + return hostedRunner, resp, nil +} + +// GetHostedRunnerGitHubOwnedImages gets the list of GitHub-owned images available for GitHub-hosted runners for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-github-owned-images-for-github-hosted-runners-in-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/images/github-owned +func (s *EnterpriseService) GetHostedRunnerGitHubOwnedImages(ctx context.Context, enterprise string) (*HostedRunnerImages, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/images/github-owned", enterprise) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + hostedRunnerImages := new(HostedRunnerImages) + resp, err := s.client.Do(ctx, req, hostedRunnerImages) + if err != nil { + return nil, resp, err + } + + return hostedRunnerImages, resp, nil +} + +// GetHostedRunnerPartnerImages gets the list of partner images available for GitHub-hosted runners for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-partner-images-for-github-hosted-runners-in-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/images/partner +func (s *EnterpriseService) GetHostedRunnerPartnerImages(ctx context.Context, enterprise string) (*HostedRunnerImages, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/images/partner", enterprise) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + hostedRunnerImages := new(HostedRunnerImages) + resp, err := s.client.Do(ctx, req, hostedRunnerImages) + if err != nil { + return nil, resp, err + } + + return hostedRunnerImages, resp, nil +} + +// GetHostedRunnerLimits gets the GitHub-hosted runners Static public IP Limits for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-limits-on-github-hosted-runners-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/limits +func (s *EnterpriseService) GetHostedRunnerLimits(ctx context.Context, enterprise string) (*HostedRunnerPublicIPLimits, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/limits", enterprise) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + publicIPLimits := new(HostedRunnerPublicIPLimits) + resp, err := s.client.Do(ctx, req, publicIPLimits) + if err != nil { + return nil, resp, err + } + + return publicIPLimits, resp, nil +} + +// GetHostedRunnerMachineSpecs gets the list of machine specs available for GitHub-hosted runners for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-github-hosted-runners-machine-specs-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/machine-sizes +func (s *EnterpriseService) GetHostedRunnerMachineSpecs(ctx context.Context, enterprise string) (*HostedRunnerMachineSpecs, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/machine-sizes", enterprise) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + machineSpecs := new(HostedRunnerMachineSpecs) + resp, err := s.client.Do(ctx, req, machineSpecs) + if err != nil { + return nil, resp, err + } + + return machineSpecs, resp, nil +} + +// GetHostedRunnerPlatforms gets list of platforms available for GitHub-hosted runners for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-platforms-for-github-hosted-runners-in-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/platforms +func (s *EnterpriseService) GetHostedRunnerPlatforms(ctx context.Context, enterprise string) (*HostedRunnerPlatforms, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/platforms", enterprise) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + platforms := new(HostedRunnerPlatforms) + resp, err := s.client.Do(ctx, req, platforms) + if err != nil { + return nil, resp, err + } + + return platforms, resp, nil +} + +// GetHostedRunner gets a GitHub-hosted runner in an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-a-github-hosted-runner-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id} +func (s *EnterpriseService) GetHostedRunner(ctx context.Context, enterprise string, runnerID int64) (*HostedRunner, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/%v", enterprise, runnerID) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + hostedRunner := new(HostedRunner) + resp, err := s.client.Do(ctx, req, hostedRunner) + if err != nil { + return nil, resp, err + } + + return hostedRunner, resp, nil +} + +// UpdateHostedRunner updates a GitHub-hosted runner for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#update-a-github-hosted-runner-for-an-enterprise +// +//meta:operation PATCH /enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id} +func (s *EnterpriseService) UpdateHostedRunner(ctx context.Context, enterprise string, runnerID int64, updateReq HostedRunnerRequest) (*HostedRunner, *Response, error) { + if err := validateUpdateHostedRunnerRequest(&updateReq); err != nil { + return nil, nil, fmt.Errorf("validation failed: %w", err) + } + + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/%v", enterprise, runnerID) + req, err := s.client.NewRequest("PATCH", u, updateReq) + if err != nil { + return nil, nil, err + } + + hostedRunner := new(HostedRunner) + resp, err := s.client.Do(ctx, req, hostedRunner) + if err != nil { + return nil, resp, err + } + + return hostedRunner, resp, nil +} + +// DeleteHostedRunner deletes GitHub-hosted runner from an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#delete-a-github-hosted-runner-for-an-enterprise +// +//meta:operation DELETE /enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id} +func (s *EnterpriseService) DeleteHostedRunner(ctx context.Context, enterprise string, runnerID int64) (*HostedRunner, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/%v", enterprise, runnerID) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, nil, err + } + + hostedRunner := new(HostedRunner) + resp, err := s.client.Do(ctx, req, hostedRunner) + if err != nil { + return nil, resp, err + } + + return hostedRunner, resp, nil +} diff --git a/github/enterprise_actions_hosted_runners_test.go b/github/enterprise_actions_hosted_runners_test.go new file mode 100644 index 00000000000..948dac938c4 --- /dev/null +++ b/github/enterprise_actions_hosted_runners_test.go @@ -0,0 +1,917 @@ +// Copyright 2025 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" + "time" + + "github.com/google/go-cmp/cmp" +) + +func TestEnterpriseService_ListHostedRunners(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/enterprises/o/actions/hosted-runners", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "total_count": 2, + "runners": [ + { + "id": 5, + "name": "My hosted ubuntu runner", + "runner_group_id": 2, + "platform": "linux-x64", + "image_details": { + "id": "ubuntu-20.04", + "size_gb": 86 + }, + "machine_size_details": { + "id": "4-core", + "cpu_cores": 4, + "memory_gb": 16, + "storage_gb": 150 + }, + "status": "Ready", + "maximum_runners": 10, + "public_ip_enabled": true, + "public_ips": [ + { + "enabled": true, + "prefix": "20.80.208.150", + "length": 31 + } + ], + "last_active_on": "2023-04-26T15:23:37Z" + }, + { + "id": 7, + "name": "My hosted Windows runner", + "runner_group_id": 2, + "platform": "win-x64", + "image_details": { + "id": "windows-latest", + "size_gb": 256 + }, + "machine_size_details": { + "id": "8-core", + "cpu_cores": 8, + "memory_gb": 32, + "storage_gb": 300 + }, + "status": "Ready", + "maximum_runners": 20, + "public_ip_enabled": false, + "public_ips": [], + "last_active_on": "2023-04-26T15:23:37Z" + } + ] + }`) + }) + opts := &ListOptions{Page: 1, PerPage: 1} + ctx := context.Background() + hostedRunners, _, err := client.Enterprise.ListHostedRunners(ctx, "o", opts) + if err != nil { + t.Errorf("Enterprise.ListHostedRunners returned error: %v", err) + } + + lastActiveOn := Timestamp{time.Date(2023, 4, 26, 15, 23, 37, 0, time.UTC)} + + want := &HostedRunners{ + TotalCount: 2, + Runners: []*HostedRunner{ + { + ID: Ptr(int64(5)), + Name: Ptr("My hosted ubuntu runner"), + RunnerGroupID: Ptr(int64(2)), + Platform: Ptr("linux-x64"), + ImageDetails: &HostedRunnerImageDetail{ + ID: Ptr("ubuntu-20.04"), + SizeGB: Ptr(int64(86)), + }, + MachineSizeDetails: &HostedRunnerMachineSpec{ + ID: "4-core", + CPUCores: 4, + MemoryGB: 16, + StorageGB: 150, + }, + Status: Ptr("Ready"), + MaximumRunners: Ptr(int64(10)), + PublicIPEnabled: Ptr(true), + PublicIPs: []*HostedRunnerPublicIP{ + { + Enabled: true, + Prefix: "20.80.208.150", + Length: 31, + }, + }, + LastActiveOn: Ptr(lastActiveOn), + }, + { + ID: Ptr(int64(7)), + Name: Ptr("My hosted Windows runner"), + RunnerGroupID: Ptr(int64(2)), + Platform: Ptr("win-x64"), + ImageDetails: &HostedRunnerImageDetail{ + ID: Ptr("windows-latest"), + SizeGB: Ptr(int64(256)), + }, + MachineSizeDetails: &HostedRunnerMachineSpec{ + ID: "8-core", + CPUCores: 8, + MemoryGB: 32, + StorageGB: 300, + }, + Status: Ptr("Ready"), + MaximumRunners: Ptr(int64(20)), + PublicIPEnabled: Ptr(false), + PublicIPs: []*HostedRunnerPublicIP{}, + LastActiveOn: Ptr(lastActiveOn), + }, + }, + } + if !cmp.Equal(hostedRunners, want) { + t.Errorf("Enterprise.ListHostedRunners returned %+v, want %+v", hostedRunners, want) + } + + const methodName = "ListHostedRunners" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Enterprise.ListHostedRunners(ctx, "\n", opts) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.ListHostedRunners(ctx, "o", opts) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_CreateHostedRunner(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/enterprises/o/actions/hosted-runners", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + fmt.Fprint(w, `{ + "id": 5, + "name": "My hosted ubuntu runner", + "runner_group_id": 2, + "platform": "linux-x64", + "image_details": { + "id": "ubuntu-20.04", + "size_gb": 86 + }, + "machine_size_details": { + "id": "4-core", + "cpu_cores": 4, + "memory_gb": 16, + "storage_gb": 150 + }, + "status": "Ready", + "maximum_runners": 10, + "public_ip_enabled": true, + "public_ips": [ + { + "enabled": true, + "prefix": "20.80.208.150", + "length": 31 + } + ], + "last_active_on": "2023-04-26T15:23:37Z" + }`) + }) + + ctx := context.Background() + req := &HostedRunnerRequest{ + Name: "My Hosted runner", + Image: HostedRunnerImage{ + ID: "ubuntu-latest", + Source: "github", + Version: "latest", + }, + RunnerGroupID: 1, + Size: "4-core", + MaximumRunners: 50, + EnableStaticIP: false, + } + hostedRunner, _, err := client.Enterprise.CreateHostedRunner(ctx, "o", req) + if err != nil { + t.Errorf("Enterprise.CreateHostedRunner returned error: %v", err) + } + + lastActiveOn := Timestamp{time.Date(2023, 4, 26, 15, 23, 37, 0, time.UTC)} + want := &HostedRunner{ + ID: Ptr(int64(5)), + Name: Ptr("My hosted ubuntu runner"), + RunnerGroupID: Ptr(int64(2)), + Platform: Ptr("linux-x64"), + ImageDetails: &HostedRunnerImageDetail{ + ID: Ptr("ubuntu-20.04"), + SizeGB: Ptr(int64(86)), + }, + MachineSizeDetails: &HostedRunnerMachineSpec{ + ID: "4-core", + CPUCores: 4, + MemoryGB: 16, + StorageGB: 150, + }, + Status: Ptr("Ready"), + MaximumRunners: Ptr(int64(10)), + PublicIPEnabled: Ptr(true), + PublicIPs: []*HostedRunnerPublicIP{ + { + Enabled: true, + Prefix: "20.80.208.150", + Length: 31, + }, + }, + LastActiveOn: Ptr(lastActiveOn), + } + + if !cmp.Equal(hostedRunner, want) { + t.Errorf("Enterprise.CreateHostedRunner returned %+v, want %+v", hostedRunner, want) + } + + // Validation tests + testCases := []struct { + name string + request *HostedRunnerRequest + expectedError string + }{ + { + name: "Missing Size", + request: &HostedRunnerRequest{ + Name: "My Hosted runner", + Image: HostedRunnerImage{ + ID: "ubuntu-latest", + Source: "github", + Version: "latest", + }, + RunnerGroupID: 1, + }, + expectedError: "validation failed: size is required for creating a hosted runner", + }, + { + name: "Missing Image", + request: &HostedRunnerRequest{ + Name: "My Hosted runner", + RunnerGroupID: 1, + Size: "4-core", + }, + expectedError: "validation failed: image is required for creating a hosted runner", + }, + { + name: "Missing Name", + request: &HostedRunnerRequest{ + Image: HostedRunnerImage{ + ID: "ubuntu-latest", + Source: "github", + Version: "latest", + }, + RunnerGroupID: 1, + Size: "4-core", + }, + expectedError: "validation failed: name is required for creating a hosted runner", + }, + { + name: "Missing RunnerGroupID", + request: &HostedRunnerRequest{ + Name: "My Hosted runner", + Image: HostedRunnerImage{ + ID: "ubuntu-latest", + Source: "github", + Version: "latest", + }, + Size: "4-core", + }, + expectedError: "validation failed: runner group ID is required for creating a hosted runner", + }, + { + name: "ImageVersion Set Instead of Image Struct", + request: &HostedRunnerRequest{ + Name: "My Hosted runner", + Image: HostedRunnerImage{ + ID: "ubuntu-latest", + Source: "github", + Version: "latest", + }, + RunnerGroupID: 1, + Size: "4-core", + ImageVersion: "1.0.0", + MaximumRunners: 50, + EnableStaticIP: false, + }, + expectedError: "validation failed: imageVersion should not be set directly; use the Image struct to specify image details", + }, + } + + for _, tt := range testCases { + _, _, err := client.Enterprise.CreateHostedRunner(ctx, "o", tt.request) + if err == nil || err.Error() != tt.expectedError { + t.Errorf("expected error: %v, got: %v", tt.expectedError, err) + } + } + + const methodName = "CreateHostedRunner" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Enterprise.CreateHostedRunner(ctx, "\n", req) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.CreateHostedRunner(ctx, "o", req) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_GetHostedRunnerGitHubOwnedImages(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/enterprises/o/actions/hosted-runners/images/github-owned", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "total_count": 1, + "images": [ + { + "id": "ubuntu-20.04", + "platform": "linux-x64", + "size_gb": 86, + "display_name": "20.04", + "source": "github" + } + ] + }`) + }) + + ctx := context.Background() + hostedRunnerImages, _, err := client.Enterprise.GetHostedRunnerGitHubOwnedImages(ctx, "o") + if err != nil { + t.Errorf("Enterprise.GetHostedRunnerGitHubOwnedImages returned error: %v", err) + } + + want := &HostedRunnerImages{ + TotalCount: 1, + Images: []*HostedRunnerImageSpecs{ + { + ID: "ubuntu-20.04", + Platform: "linux-x64", + SizeGB: 86, + DisplayName: "20.04", + Source: "github", + }, + }, + } + + if !cmp.Equal(hostedRunnerImages, want) { + t.Errorf("Enterprise.GetHostedRunnerGitHubOwnedImages returned %+v, want %+v", hostedRunnerImages, want) + } + + const methodName = "GetHostedRunnerGitHubOwnedImages" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Enterprise.GetHostedRunnerGitHubOwnedImages(ctx, "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.GetHostedRunnerGitHubOwnedImages(ctx, "o") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_GetHostedRunnerPartnerImages(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/enterprises/o/actions/hosted-runners/images/partner", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "total_count": 1, + "images": [ + { + "id": "ubuntu-20.04", + "platform": "linux-x64", + "size_gb": 86, + "display_name": "20.04", + "source": "partner" + } + ] + }`) + }) + + ctx := context.Background() + hostedRunnerImages, _, err := client.Enterprise.GetHostedRunnerPartnerImages(ctx, "o") + if err != nil { + t.Errorf("Enterprise.GetHostedRunnerPartnerImages returned error: %v", err) + } + + want := &HostedRunnerImages{ + TotalCount: 1, + Images: []*HostedRunnerImageSpecs{ + { + ID: "ubuntu-20.04", + Platform: "linux-x64", + SizeGB: 86, + DisplayName: "20.04", + Source: "partner", + }, + }, + } + + if !cmp.Equal(hostedRunnerImages, want) { + t.Errorf("Enterprise.GetHostedRunnerPartnerImages returned %+v, want %+v", hostedRunnerImages, want) + } + + const methodName = "GetHostedRunnerPartnerImages" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Enterprise.GetHostedRunnerPartnerImages(ctx, "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.GetHostedRunnerPartnerImages(ctx, "o") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_GetHostedRunnerLimits(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + mux.HandleFunc("/enterprises/o/actions/hosted-runners/limits", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "public_ips": { + "current_usage": 17, + "maximum": 50 + } + }`) + }) + + ctx := context.Background() + publicIPLimits, _, err := client.Enterprise.GetHostedRunnerLimits(ctx, "o") + if err != nil { + t.Errorf("Enterprise.GetPartnerImages returned error: %v", err) + } + + want := &HostedRunnerPublicIPLimits{ + PublicIPs: &PublicIPUsage{ + CurrentUsage: 17, + Maximum: 50, + }, + } + + if !cmp.Equal(publicIPLimits, want) { + t.Errorf("Enterprise.GetHostedRunnerLimits returned %+v, want %+v", publicIPLimits, want) + } + + const methodName = "GetHostedRunnerLimits" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Enterprise.GetHostedRunnerLimits(ctx, "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.GetHostedRunnerLimits(ctx, "o") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_GetHostedRunnerMachineSpecs(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/enterprises/o/actions/hosted-runners/machine-sizes", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "total_count": 1, + "machine_specs": [ + { + "id": "4-core", + "cpu_cores": 4, + "memory_gb": 16, + "storage_gb": 150 + } + ] + }`) + }) + + ctx := context.Background() + machineSpecs, _, err := client.Enterprise.GetHostedRunnerMachineSpecs(ctx, "o") + if err != nil { + t.Errorf("Enterprise.GetHostedRunnerMachineSpecs returned error: %v", err) + } + want := &HostedRunnerMachineSpecs{ + TotalCount: 1, + MachineSpecs: []*HostedRunnerMachineSpec{ + { + ID: "4-core", + CPUCores: 4, + MemoryGB: 16, + StorageGB: 150, + }, + }, + } + + if !cmp.Equal(machineSpecs, want) { + t.Errorf("Enterprise.GetHostedRunnerMachineSpecs returned %+v, want %+v", machineSpecs, want) + } + + const methodName = "GetHostedRunnerMachineSpecs" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Enterprise.GetHostedRunnerMachineSpecs(ctx, "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.GetHostedRunnerMachineSpecs(ctx, "o") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_GetHostedRunnerPlatforms(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/enterprises/o/actions/hosted-runners/platforms", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "total_count": 1, + "platforms": [ + "linux-x64", + "win-x64" + ] + }`) + }) + + ctx := context.Background() + platforms, _, err := client.Enterprise.GetHostedRunnerPlatforms(ctx, "o") + if err != nil { + t.Errorf("Enterprise.GetHostedRunnerPlatforms returned error: %v", err) + } + want := &HostedRunnerPlatforms{ + TotalCount: 1, + Platforms: []string{ + "linux-x64", + "win-x64", + }, + } + + if !cmp.Equal(platforms, want) { + t.Errorf("Enterprise.GetHostedRunnerPlatforms returned %+v, want %+v", platforms, want) + } + + const methodName = "GetHostedRunnerPlatforms" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Enterprise.GetHostedRunnerPlatforms(ctx, "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.GetHostedRunnerPlatforms(ctx, "o") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_GetHostedRunner(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/enterprises/o/actions/hosted-runners/23", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "id": 5, + "name": "My hosted ubuntu runner", + "runner_group_id": 2, + "platform": "linux-x64", + "image_details": { + "id": "ubuntu-20.04", + "size_gb": 86 + }, + "machine_size_details": { + "id": "4-core", + "cpu_cores": 4, + "memory_gb": 16, + "storage_gb": 150 + }, + "status": "Ready", + "maximum_runners": 10, + "public_ip_enabled": true, + "public_ips": [ + { + "enabled": true, + "prefix": "20.80.208.150", + "length": 31 + } + ], + "last_active_on": "2023-04-26T15:23:37Z" + }`) + }) + + ctx := context.Background() + hostedRunner, _, err := client.Enterprise.GetHostedRunner(ctx, "o", 23) + if err != nil { + t.Errorf("Enterprise.GetHostedRunner returned error: %v", err) + } + + lastActiveOn := Timestamp{time.Date(2023, 4, 26, 15, 23, 37, 0, time.UTC)} + want := &HostedRunner{ + ID: Ptr(int64(5)), + Name: Ptr("My hosted ubuntu runner"), + RunnerGroupID: Ptr(int64(2)), + Platform: Ptr("linux-x64"), + ImageDetails: &HostedRunnerImageDetail{ + ID: Ptr("ubuntu-20.04"), + SizeGB: Ptr(int64(86)), + }, + MachineSizeDetails: &HostedRunnerMachineSpec{ + ID: "4-core", + CPUCores: 4, + MemoryGB: 16, + StorageGB: 150, + }, + Status: Ptr("Ready"), + MaximumRunners: Ptr(int64(10)), + PublicIPEnabled: Ptr(true), + PublicIPs: []*HostedRunnerPublicIP{ + { + Enabled: true, + Prefix: "20.80.208.150", + Length: 31, + }, + }, + LastActiveOn: Ptr(lastActiveOn), + } + + if !cmp.Equal(hostedRunner, want) { + t.Errorf("Enterprise.GetHostedRunner returned %+v, want %+v", hostedRunner, want) + } + + const methodName = "GetHostedRunner" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Enterprise.GetHostedRunner(ctx, "\n", 23) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.GetHostedRunner(ctx, "o", 23) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_UpdateHostedRunner(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/enterprises/o/actions/hosted-runners/23", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PATCH") + fmt.Fprint(w, `{ + "id": 5, + "name": "My hosted ubuntu runner", + "runner_group_id": 2, + "platform": "linux-x64", + "image_details": { + "id": "ubuntu-20.04", + "size_gb": 86 + }, + "machine_size_details": { + "id": "4-core", + "cpu_cores": 4, + "memory_gb": 16, + "storage_gb": 150 + }, + "status": "Ready", + "maximum_runners": 10, + "public_ip_enabled": true, + "public_ips": [ + { + "enabled": true, + "prefix": "20.80.208.150", + "length": 31 + } + ], + "last_active_on": "2023-04-26T15:23:37Z" + }`) + }) + + // Test for a valid update without `Size` + ctx := context.Background() + validReq := HostedRunnerRequest{ + Name: "My larger runner", + RunnerGroupID: 1, + MaximumRunners: 50, + EnableStaticIP: false, + ImageVersion: "1.0.0", + } + hostedRunner, _, err := client.Enterprise.UpdateHostedRunner(ctx, "o", 23, validReq) + if err != nil { + t.Errorf("Enterprise.UpdateHostedRunner returned error: %v", err) + } + + lastActiveOn := Timestamp{time.Date(2023, 4, 26, 15, 23, 37, 0, time.UTC)} + want := &HostedRunner{ + ID: Ptr(int64(5)), + Name: Ptr("My hosted ubuntu runner"), + RunnerGroupID: Ptr(int64(2)), + Platform: Ptr("linux-x64"), + ImageDetails: &HostedRunnerImageDetail{ + ID: Ptr("ubuntu-20.04"), + SizeGB: Ptr(int64(86)), + }, + MachineSizeDetails: &HostedRunnerMachineSpec{ + ID: "4-core", + CPUCores: 4, + MemoryGB: 16, + StorageGB: 150, + }, + Status: Ptr("Ready"), + MaximumRunners: Ptr(int64(10)), + PublicIPEnabled: Ptr(true), + PublicIPs: []*HostedRunnerPublicIP{ + { + Enabled: true, + Prefix: "20.80.208.150", + Length: 31, + }, + }, + LastActiveOn: Ptr(lastActiveOn), + } + + if !cmp.Equal(hostedRunner, want) { + t.Errorf("Enterprise.UpdateHostedRunner returned %+v, want %+v", hostedRunner, want) + } + + testCases := []struct { + name string + request HostedRunnerRequest + expectedError string + }{ + { + name: "Size Set in Update Request", + request: HostedRunnerRequest{ + Name: "My larger runner", + RunnerGroupID: 1, + MaximumRunners: 50, + EnableStaticIP: false, + ImageVersion: "1.0.0", + Size: "4-core", // Should cause validation error + }, + expectedError: "validation failed: size cannot be updated, API does not support updating size", + }, + { + name: "Image Set in Update Request", + request: HostedRunnerRequest{ + Name: "My larger runner", + RunnerGroupID: 1, + MaximumRunners: 50, + EnableStaticIP: false, + ImageVersion: "1.0.0", + Image: HostedRunnerImage{ // Should cause validation error + ID: "ubuntu-latest", + Source: "github", + Version: "latest", + }, + }, + expectedError: "validation failed: image struct should not be set directly; use the ImageVersion to specify version details", + }, + } + for _, tt := range testCases { + _, _, err := client.Enterprise.UpdateHostedRunner(ctx, "o", 23, tt.request) + if err == nil || err.Error() != tt.expectedError { + t.Errorf("expected error: %v, got: %v", tt.expectedError, err) + } + } + + const methodName = "UpdateHostedRunner" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Enterprise.UpdateHostedRunner(ctx, "\n", 23, validReq) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.UpdateHostedRunner(ctx, "o", 23, validReq) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_DeleteHostedRunner(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/enterprises/o/actions/hosted-runners/23", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + fmt.Fprint(w, `{ + "id": 5, + "name": "My hosted ubuntu runner", + "runner_group_id": 2, + "platform": "linux-x64", + "image_details": { + "id": "ubuntu-20.04", + "size_gb": 86 + }, + "machine_size_details": { + "id": "4-core", + "cpu_cores": 4, + "memory_gb": 16, + "storage_gb": 150 + }, + "status": "Ready", + "maximum_runners": 10, + "public_ip_enabled": true, + "public_ips": [ + { + "enabled": true, + "prefix": "20.80.208.150", + "length": 31 + } + ], + "last_active_on": "2023-04-26T15:23:37Z" + }`) + }) + + ctx := context.Background() + hostedRunner, _, err := client.Enterprise.DeleteHostedRunner(ctx, "o", 23) + if err != nil { + t.Errorf("Enterprise.GetHostedRunner returned error: %v", err) + } + + lastActiveOn := Timestamp{time.Date(2023, 4, 26, 15, 23, 37, 0, time.UTC)} + want := &HostedRunner{ + ID: Ptr(int64(5)), + Name: Ptr("My hosted ubuntu runner"), + RunnerGroupID: Ptr(int64(2)), + Platform: Ptr("linux-x64"), + ImageDetails: &HostedRunnerImageDetail{ + ID: Ptr("ubuntu-20.04"), + SizeGB: Ptr(int64(86)), + }, + MachineSizeDetails: &HostedRunnerMachineSpec{ + ID: "4-core", + CPUCores: 4, + MemoryGB: 16, + StorageGB: 150, + }, + Status: Ptr("Ready"), + MaximumRunners: Ptr(int64(10)), + PublicIPEnabled: Ptr(true), + PublicIPs: []*HostedRunnerPublicIP{ + { + Enabled: true, + Prefix: "20.80.208.150", + Length: 31, + }, + }, + LastActiveOn: Ptr(lastActiveOn), + } + + if !cmp.Equal(hostedRunner, want) { + t.Errorf("Enterprise.DeleteHostedRunner returned %+v, want %+v", hostedRunner, want) + } + + const methodName = "DeleteHostedRunner" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Enterprise.DeleteHostedRunner(ctx, "\n", 23) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.DeleteHostedRunner(ctx, "o", 23) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} diff --git a/github/github-accessors.go b/github/github-accessors.go index 085e6e59bed..905dd80c8a2 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -10182,6 +10182,134 @@ func (h *HookStats) GetTotalHooks() int { return *h.TotalHooks } +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (h *HostedRunner) GetID() int64 { + if h == nil || h.ID == nil { + return 0 + } + return *h.ID +} + +// GetImageDetails returns the ImageDetails field. +func (h *HostedRunner) GetImageDetails() *HostedRunnerImageDetail { + if h == nil { + return nil + } + return h.ImageDetails +} + +// GetLastActiveOn returns the LastActiveOn field if it's non-nil, zero value otherwise. +func (h *HostedRunner) GetLastActiveOn() Timestamp { + if h == nil || h.LastActiveOn == nil { + return Timestamp{} + } + return *h.LastActiveOn +} + +// GetMachineSizeDetails returns the MachineSizeDetails field. +func (h *HostedRunner) GetMachineSizeDetails() *HostedRunnerMachineSpec { + if h == nil { + return nil + } + return h.MachineSizeDetails +} + +// GetMaximumRunners returns the MaximumRunners field if it's non-nil, zero value otherwise. +func (h *HostedRunner) GetMaximumRunners() int64 { + if h == nil || h.MaximumRunners == nil { + return 0 + } + return *h.MaximumRunners +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (h *HostedRunner) GetName() string { + if h == nil || h.Name == nil { + return "" + } + return *h.Name +} + +// GetPlatform returns the Platform field if it's non-nil, zero value otherwise. +func (h *HostedRunner) GetPlatform() string { + if h == nil || h.Platform == nil { + return "" + } + return *h.Platform +} + +// GetPublicIPEnabled returns the PublicIPEnabled field if it's non-nil, zero value otherwise. +func (h *HostedRunner) GetPublicIPEnabled() bool { + if h == nil || h.PublicIPEnabled == nil { + return false + } + return *h.PublicIPEnabled +} + +// GetRunnerGroupID returns the RunnerGroupID field if it's non-nil, zero value otherwise. +func (h *HostedRunner) GetRunnerGroupID() int64 { + if h == nil || h.RunnerGroupID == nil { + return 0 + } + return *h.RunnerGroupID +} + +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (h *HostedRunner) GetStatus() string { + if h == nil || h.Status == nil { + return "" + } + return *h.Status +} + +// GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise. +func (h *HostedRunnerImageDetail) GetDisplayName() string { + if h == nil || h.DisplayName == nil { + return "" + } + return *h.DisplayName +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (h *HostedRunnerImageDetail) GetID() string { + if h == nil || h.ID == nil { + return "" + } + return *h.ID +} + +// GetSizeGB returns the SizeGB field if it's non-nil, zero value otherwise. +func (h *HostedRunnerImageDetail) GetSizeGB() int64 { + if h == nil || h.SizeGB == nil { + return 0 + } + return *h.SizeGB +} + +// GetSource returns the Source field if it's non-nil, zero value otherwise. +func (h *HostedRunnerImageDetail) GetSource() string { + if h == nil || h.Source == nil { + return "" + } + return *h.Source +} + +// GetVersion returns the Version field if it's non-nil, zero value otherwise. +func (h *HostedRunnerImageDetail) GetVersion() string { + if h == nil || h.Version == nil { + return "" + } + return *h.Version +} + +// GetPublicIPs returns the PublicIPs field. +func (h *HostedRunnerPublicIPLimits) GetPublicIPs() *PublicIPUsage { + if h == nil { + return nil + } + return h.PublicIPs +} + // GetGroupDescription returns the GroupDescription field if it's non-nil, zero value otherwise. func (i *IDPGroup) GetGroupDescription() string { if i == nil || i.GroupDescription == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 094387db644..8d69ad42e7e 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -13180,6 +13180,173 @@ func TestHookStats_GetTotalHooks(tt *testing.T) { h.GetTotalHooks() } +func TestHostedRunner_GetID(tt *testing.T) { + tt.Parallel() + var zeroValue int64 + h := &HostedRunner{ID: &zeroValue} + h.GetID() + h = &HostedRunner{} + h.GetID() + h = nil + h.GetID() +} + +func TestHostedRunner_GetImageDetails(tt *testing.T) { + tt.Parallel() + h := &HostedRunner{} + h.GetImageDetails() + h = nil + h.GetImageDetails() +} + +func TestHostedRunner_GetLastActiveOn(tt *testing.T) { + tt.Parallel() + var zeroValue Timestamp + h := &HostedRunner{LastActiveOn: &zeroValue} + h.GetLastActiveOn() + h = &HostedRunner{} + h.GetLastActiveOn() + h = nil + h.GetLastActiveOn() +} + +func TestHostedRunner_GetMachineSizeDetails(tt *testing.T) { + tt.Parallel() + h := &HostedRunner{} + h.GetMachineSizeDetails() + h = nil + h.GetMachineSizeDetails() +} + +func TestHostedRunner_GetMaximumRunners(tt *testing.T) { + tt.Parallel() + var zeroValue int64 + h := &HostedRunner{MaximumRunners: &zeroValue} + h.GetMaximumRunners() + h = &HostedRunner{} + h.GetMaximumRunners() + h = nil + h.GetMaximumRunners() +} + +func TestHostedRunner_GetName(tt *testing.T) { + tt.Parallel() + var zeroValue string + h := &HostedRunner{Name: &zeroValue} + h.GetName() + h = &HostedRunner{} + h.GetName() + h = nil + h.GetName() +} + +func TestHostedRunner_GetPlatform(tt *testing.T) { + tt.Parallel() + var zeroValue string + h := &HostedRunner{Platform: &zeroValue} + h.GetPlatform() + h = &HostedRunner{} + h.GetPlatform() + h = nil + h.GetPlatform() +} + +func TestHostedRunner_GetPublicIPEnabled(tt *testing.T) { + tt.Parallel() + var zeroValue bool + h := &HostedRunner{PublicIPEnabled: &zeroValue} + h.GetPublicIPEnabled() + h = &HostedRunner{} + h.GetPublicIPEnabled() + h = nil + h.GetPublicIPEnabled() +} + +func TestHostedRunner_GetRunnerGroupID(tt *testing.T) { + tt.Parallel() + var zeroValue int64 + h := &HostedRunner{RunnerGroupID: &zeroValue} + h.GetRunnerGroupID() + h = &HostedRunner{} + h.GetRunnerGroupID() + h = nil + h.GetRunnerGroupID() +} + +func TestHostedRunner_GetStatus(tt *testing.T) { + tt.Parallel() + var zeroValue string + h := &HostedRunner{Status: &zeroValue} + h.GetStatus() + h = &HostedRunner{} + h.GetStatus() + h = nil + h.GetStatus() +} + +func TestHostedRunnerImageDetail_GetDisplayName(tt *testing.T) { + tt.Parallel() + var zeroValue string + h := &HostedRunnerImageDetail{DisplayName: &zeroValue} + h.GetDisplayName() + h = &HostedRunnerImageDetail{} + h.GetDisplayName() + h = nil + h.GetDisplayName() +} + +func TestHostedRunnerImageDetail_GetID(tt *testing.T) { + tt.Parallel() + var zeroValue string + h := &HostedRunnerImageDetail{ID: &zeroValue} + h.GetID() + h = &HostedRunnerImageDetail{} + h.GetID() + h = nil + h.GetID() +} + +func TestHostedRunnerImageDetail_GetSizeGB(tt *testing.T) { + tt.Parallel() + var zeroValue int64 + h := &HostedRunnerImageDetail{SizeGB: &zeroValue} + h.GetSizeGB() + h = &HostedRunnerImageDetail{} + h.GetSizeGB() + h = nil + h.GetSizeGB() +} + +func TestHostedRunnerImageDetail_GetSource(tt *testing.T) { + tt.Parallel() + var zeroValue string + h := &HostedRunnerImageDetail{Source: &zeroValue} + h.GetSource() + h = &HostedRunnerImageDetail{} + h.GetSource() + h = nil + h.GetSource() +} + +func TestHostedRunnerImageDetail_GetVersion(tt *testing.T) { + tt.Parallel() + var zeroValue string + h := &HostedRunnerImageDetail{Version: &zeroValue} + h.GetVersion() + h = &HostedRunnerImageDetail{} + h.GetVersion() + h = nil + h.GetVersion() +} + +func TestHostedRunnerPublicIPLimits_GetPublicIPs(tt *testing.T) { + tt.Parallel() + h := &HostedRunnerPublicIPLimits{} + h.GetPublicIPs() + h = nil + h.GetPublicIPs() +} + func TestIDPGroup_GetGroupDescription(tt *testing.T) { tt.Parallel() var zeroValue string diff --git a/github/repos.go b/github/repos.go index 9faed401f87..c4ef5d59877 100644 --- a/github/repos.go +++ b/github/repos.go @@ -833,7 +833,7 @@ func (s *RepositoriesService) DisableVulnerabilityAlerts(ctx context.Context, ow // GetAutomatedSecurityFixes checks if the automated security fixes for a repository are enabled. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#check-if-automated-security-fixes-are-enabled-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos#check-if-dependabot-security-updates-are-enabled-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/automated-security-fixes func (s *RepositoriesService) GetAutomatedSecurityFixes(ctx context.Context, owner, repository string) (*AutomatedSecurityFixes, *Response, error) { @@ -854,7 +854,7 @@ func (s *RepositoriesService) GetAutomatedSecurityFixes(ctx context.Context, own // EnableAutomatedSecurityFixes enables the automated security fixes for a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#enable-automated-security-fixes +// GitHub API docs: https://docs.github.com/rest/repos/repos#enable-dependabot-security-updates // //meta:operation PUT /repos/{owner}/{repo}/automated-security-fixes func (s *RepositoriesService) EnableAutomatedSecurityFixes(ctx context.Context, owner, repository string) (*Response, error) { @@ -870,7 +870,7 @@ func (s *RepositoriesService) EnableAutomatedSecurityFixes(ctx context.Context, // DisableAutomatedSecurityFixes disables vulnerability alerts and the dependency graph for a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#disable-automated-security-fixes +// GitHub API docs: https://docs.github.com/rest/repos/repos#disable-dependabot-security-updates // //meta:operation DELETE /repos/{owner}/{repo}/automated-security-fixes func (s *RepositoriesService) DisableAutomatedSecurityFixes(ctx context.Context, owner, repository string) (*Response, error) { diff --git a/openapi_operations.yaml b/openapi_operations.yaml index d144ca7e38c..45207678377 100644 --- a/openapi_operations.yaml +++ b/openapi_operations.yaml @@ -47,7 +47,7 @@ operation_overrides: documentation_url: https://docs.github.com/rest/pages/pages#request-a-github-pages-build - name: GET /repos/{owner}/{repo}/pages/builds/{build_id} documentation_url: https://docs.github.com/rest/pages/pages#get-github-pages-build -openapi_commit: 8031023b31a852778532c5fa688b8bb6bcbab9d6 +openapi_commit: 2320d61e4c805300787f8551fda53076bb4fae8b openapi_operations: - name: GET / documentation_url: https://docs.github.com/rest/meta/meta#github-api-root @@ -504,6 +504,46 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-server@3.15/rest/actions/cache#set-github-actions-cache-usage-policy-for-an-enterprise openapi_files: - descriptions/ghes-3.15/ghes-3.15.json + - name: GET /enterprises/{enterprise}/actions/hosted-runners + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/hosted-runners#list-github-hosted-runners-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - name: POST /enterprises/{enterprise}/actions/hosted-runners + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/hosted-runners#create-a-github-hosted-runner-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - name: GET /enterprises/{enterprise}/actions/hosted-runners/images/github-owned + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/hosted-runners#get-github-owned-images-for-github-hosted-runners-in-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - name: GET /enterprises/{enterprise}/actions/hosted-runners/images/partner + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/hosted-runners#get-partner-images-for-github-hosted-runners-in-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - name: GET /enterprises/{enterprise}/actions/hosted-runners/limits + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/hosted-runners#get-limits-on-github-hosted-runners-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - name: GET /enterprises/{enterprise}/actions/hosted-runners/machine-sizes + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/hosted-runners#get-github-hosted-runners-machine-specs-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - name: GET /enterprises/{enterprise}/actions/hosted-runners/platforms + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/hosted-runners#get-platforms-for-github-hosted-runners-in-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - name: DELETE /enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/hosted-runners#delete-a-github-hosted-runner-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - name: GET /enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/hosted-runners#get-a-github-hosted-runner-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - name: PATCH /enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/hosted-runners#update-a-github-hosted-runner-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json - name: PUT /enterprises/{enterprise}/actions/oidc/customization/issuer documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/oidc#set-the-github-actions-oidc-custom-issuer-policy-for-an-enterprise openapi_files: @@ -724,6 +764,10 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#update-an-existing-audit-log-stream-configuration openapi_files: - descriptions/ghec/ghec.json + - name: GET /enterprises/{enterprise}/bypass-requests/push-rules + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/bypass-requests#list-push-rule-bypass-requests-within-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json - name: GET /enterprises/{enterprise}/code-scanning/alerts documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-enterprise openapi_files: @@ -810,6 +854,30 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/license#get-a-license-sync-status openapi_files: - descriptions/ghec/ghec.json + - name: GET /enterprises/{enterprise}/network-configurations + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/network-configurations#list-hosted-compute-network-configurations-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - name: POST /enterprises/{enterprise}/network-configurations + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/network-configurations#create-a-hosted-compute-network-configuration-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - name: DELETE /enterprises/{enterprise}/network-configurations/{network_configuration_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/network-configurations#delete-a-hosted-compute-network-configuration-from-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - name: GET /enterprises/{enterprise}/network-configurations/{network_configuration_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/network-configurations#get-a-hosted-compute-network-configuration-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - name: PATCH /enterprises/{enterprise}/network-configurations/{network_configuration_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/network-configurations#update-a-hosted-compute-network-configuration-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json + - name: GET /enterprises/{enterprise}/network-settings/{network_settings_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/network-configurations#get-a-hosted-compute-network-settings-resource-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json - name: GET /enterprises/{enterprise}/properties/schema documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/custom-properties#get-custom-properties-for-an-enterprise openapi_files: @@ -846,6 +914,14 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/rules#update-an-enterprise-repository-ruleset openapi_files: - descriptions/ghec/ghec.json + - name: GET /enterprises/{enterprise}/rulesets/{ruleset_id}/history + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/rules#get-enterprise-ruleset-history + openapi_files: + - descriptions/ghec/ghec.json + - name: GET /enterprises/{enterprise}/rulesets/{ruleset_id}/history/{version_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/rules#get-enterprise-ruleset-version + openapi_files: + - descriptions/ghec/ghec.json - name: GET /enterprises/{enterprise}/secret-scanning/alerts documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-enterprise openapi_files: @@ -1296,6 +1372,56 @@ openapi_operations: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.15/ghes-3.15.json + - name: GET /orgs/{org}/actions/hosted-runners + documentation_url: https://docs.github.com/rest/actions/hosted-runners#list-github-hosted-runners-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: POST /orgs/{org}/actions/hosted-runners + documentation_url: https://docs.github.com/rest/actions/hosted-runners#create-a-github-hosted-runner-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/actions/hosted-runners/images/github-owned + documentation_url: https://docs.github.com/rest/actions/hosted-runners#get-github-owned-images-for-github-hosted-runners-in-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/actions/hosted-runners/images/partner + documentation_url: https://docs.github.com/rest/actions/hosted-runners#get-partner-images-for-github-hosted-runners-in-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/actions/hosted-runners/limits + documentation_url: https://docs.github.com/rest/actions/hosted-runners#get-limits-on-github-hosted-runners-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/actions/hosted-runners/machine-sizes + documentation_url: https://docs.github.com/rest/actions/hosted-runners#get-github-hosted-runners-machine-specs-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/actions/hosted-runners/platforms + documentation_url: https://docs.github.com/rest/actions/hosted-runners#get-platforms-for-github-hosted-runners-in-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id} + documentation_url: https://docs.github.com/rest/actions/hosted-runners#delete-a-github-hosted-runner-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id} + documentation_url: https://docs.github.com/rest/actions/hosted-runners#get-a-github-hosted-runner-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id} + documentation_url: https://docs.github.com/rest/actions/hosted-runners#update-a-github-hosted-runner-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /orgs/{org}/actions/oidc/customization/sub documentation_url: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-an-organization openapi_files: @@ -1398,6 +1524,11 @@ openapi_operations: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.15/ghes-3.15.json + - name: GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners + documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#list-github-hosted-runners-in-a-group-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#list-repository-access-to-a-self-hosted-runner-group-in-an-organization openapi_files: @@ -2625,6 +2756,16 @@ openapi_operations: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.15/ghes-3.15.json + - name: GET /orgs/{org}/rulesets/{ruleset_id}/history + documentation_url: https://docs.github.com/rest/orgs/rules#get-organization-ruleset-history + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/rulesets/{ruleset_id}/history/{version_id} + documentation_url: https://docs.github.com/rest/orgs/rules#get-organization-ruleset-version + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /orgs/{org}/secret-scanning/alerts documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-organization openapi_files: @@ -2674,6 +2815,36 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/settings/network-configurations + documentation_url: https://docs.github.com/rest/orgs/network-configurations#list-hosted-compute-network-configurations-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: POST /orgs/{org}/settings/network-configurations + documentation_url: https://docs.github.com/rest/orgs/network-configurations#create-a-hosted-compute-network-configuration-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /orgs/{org}/settings/network-configurations/{network_configuration_id} + documentation_url: https://docs.github.com/rest/orgs/network-configurations#delete-a-hosted-compute-network-configuration-from-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/settings/network-configurations/{network_configuration_id} + documentation_url: https://docs.github.com/rest/orgs/network-configurations#get-a-hosted-compute-network-configuration-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PATCH /orgs/{org}/settings/network-configurations/{network_configuration_id} + documentation_url: https://docs.github.com/rest/orgs/network-configurations#update-a-hosted-compute-network-configuration-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/settings/network-settings/{network_settings_id} + documentation_url: https://docs.github.com/rest/orgs/network-configurations#get-a-hosted-compute-network-settings-resource-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /orgs/{org}/team-sync/groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#list-idp-groups-for-an-organization openapi_files: @@ -3558,18 +3729,18 @@ openapi_operations: - descriptions/ghec/ghec.json - descriptions/ghes-3.15/ghes-3.15.json - name: DELETE /repos/{owner}/{repo}/automated-security-fixes - documentation_url: https://docs.github.com/rest/repos/repos#disable-automated-security-fixes + documentation_url: https://docs.github.com/rest/repos/repos#disable-dependabot-security-updates openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: GET /repos/{owner}/{repo}/automated-security-fixes - documentation_url: https://docs.github.com/rest/repos/repos#check-if-automated-security-fixes-are-enabled-for-a-repository + documentation_url: https://docs.github.com/rest/repos/repos#check-if-dependabot-security-updates-are-enabled-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.15/ghes-3.15.json - name: PUT /repos/{owner}/{repo}/automated-security-fixes - documentation_url: https://docs.github.com/rest/repos/repos#enable-automated-security-fixes + documentation_url: https://docs.github.com/rest/repos/repos#enable-dependabot-security-updates openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json @@ -5522,6 +5693,16 @@ openapi_operations: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.15/ghes-3.15.json + - name: GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history + documentation_url: https://docs.github.com/rest/repos/rules#get-repository-ruleset-history + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id} + documentation_url: https://docs.github.com/rest/repos/rules#get-repository-ruleset-version + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /repos/{owner}/{repo}/secret-scanning/alerts documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-a-repository openapi_files: From 470d43a8b2fe2c75f360bc0a49a42da831257289 Mon Sep 17 00:00:00 2001 From: Jan Niklas Dittmar Date: Mon, 3 Mar 2025 15:35:53 +0100 Subject: [PATCH 663/751] feat: Add support for network-configurations endpoints (#3497) --- github/enterprise_network_configurations.go | 170 +++++++++ .../enterprise_network_configurations_test.go | 335 ++++++++++++++++++ github/github-accessors.go | 96 +++++ github/github-accessors_test.go | 126 +++++++ 4 files changed, 727 insertions(+) create mode 100644 github/enterprise_network_configurations.go create mode 100644 github/enterprise_network_configurations_test.go diff --git a/github/enterprise_network_configurations.go b/github/enterprise_network_configurations.go new file mode 100644 index 00000000000..a5af390a197 --- /dev/null +++ b/github/enterprise_network_configurations.go @@ -0,0 +1,170 @@ +// Copyright 2025 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" +) + +// ComputeService represents a hosted compute service the network configuration supports. +type ComputeService string + +const ( + ComputeServiceNone ComputeService = "none" + ComputeServiceActions ComputeService = "actions" +) + +// EnterpriseNetworkConfiguration represents a hosted compute network configuration. +type EnterpriseNetworkConfiguration struct { + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ComputeService *ComputeService `json:"compute_service,omitempty"` + NetworkSettingsIDs []string `json:"network_settings_ids,omitempty"` + CreatedOn *Timestamp `json:"created_on,omitempty"` +} + +// EnterpriseNetworkConfigurations represents a hosted compute network configurations. +type EnterpriseNetworkConfigurations struct { + TotalCount *int64 `json:"total_count,omitempty"` + NetworkConfigurations []*EnterpriseNetworkConfiguration `json:"network_configurations,omitempty"` +} + +// EnterpriseNetworkSettingsResource represents a hosted compute network settings resource. +type EnterpriseNetworkSettingsResource struct { + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + NetworkConfigurationID *string `json:"network_configuration_id,omitempty"` + SubnetID *string `json:"subnet_id,omitempty"` + Region *string `json:"region,omitempty"` +} + +// EnterpriseNetworkConfigurationRequest represents a request to create or update a network configuration for an enterprise. +type EnterpriseNetworkConfigurationRequest struct { + Name *string `json:"name,omitempty"` + ComputeService *ComputeService `json:"compute_service,omitempty"` + NetworkSettingsIDs []string `json:"network_settings_ids,omitempty"` +} + +// ListEnterpriseNetworkConfigurations lists all hosted compute network configurations configured in an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#list-hosted-compute-network-configurations-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/network-configurations +func (s *EnterpriseService) ListEnterpriseNetworkConfigurations(ctx context.Context, enterprise string, opts *ListOptions) (*EnterpriseNetworkConfigurations, *Response, error) { + u := fmt.Sprintf("enterprises/%v/network-configurations", enterprise) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + networks := &EnterpriseNetworkConfigurations{} + resp, err := s.client.Do(ctx, req, networks) + if err != nil { + return nil, resp, err + } + return networks, resp, nil +} + +// CreateEnterpriseNetworkConfiguration creates a hosted compute network configuration for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#create-a-hosted-compute-network-configuration-for-an-enterprise +// +//meta:operation POST /enterprises/{enterprise}/network-configurations +func (s *EnterpriseService) CreateEnterpriseNetworkConfiguration(ctx context.Context, enterprise string, createReq EnterpriseNetworkConfigurationRequest) (*EnterpriseNetworkConfiguration, *Response, error) { + u := fmt.Sprintf("enterprises/%v/network-configurations", enterprise) + req, err := s.client.NewRequest("POST", u, createReq) + if err != nil { + return nil, nil, err + } + + network := &EnterpriseNetworkConfiguration{} + resp, err := s.client.Do(ctx, req, network) + if err != nil { + return nil, resp, err + } + + return network, resp, nil +} + +// GetEnterpriseNetworkConfiguration gets a hosted compute network configuration configured in an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#get-a-hosted-compute-network-configuration-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/network-configurations/{network_configuration_id} +func (s *EnterpriseService) GetEnterpriseNetworkConfiguration(ctx context.Context, enterprise, networkID string) (*EnterpriseNetworkConfiguration, *Response, error) { + u := fmt.Sprintf("enterprises/%v/network-configurations/%v", enterprise, networkID) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + network := &EnterpriseNetworkConfiguration{} + resp, err := s.client.Do(ctx, req, network) + if err != nil { + return nil, resp, err + } + return network, resp, nil +} + +// UpdateEnterpriseNetworkConfiguration updates a hosted compute network configuration for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#update-a-hosted-compute-network-configuration-for-an-enterprise +// +//meta:operation PATCH /enterprises/{enterprise}/network-configurations/{network_configuration_id} +func (s *EnterpriseService) UpdateEnterpriseNetworkConfiguration(ctx context.Context, enterprise, networkID string, updateReq EnterpriseNetworkConfigurationRequest) (*EnterpriseNetworkConfiguration, *Response, error) { + u := fmt.Sprintf("enterprises/%v/network-configurations/%v", enterprise, networkID) + req, err := s.client.NewRequest("PATCH", u, updateReq) + if err != nil { + return nil, nil, err + } + + network := &EnterpriseNetworkConfiguration{} + resp, err := s.client.Do(ctx, req, network) + if err != nil { + return nil, resp, err + } + return network, resp, nil +} + +// DeleteEnterpriseNetworkConfiguration deletes a hosted compute network configuration from an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#delete-a-hosted-compute-network-configuration-from-an-enterprise +// +//meta:operation DELETE /enterprises/{enterprise}/network-configurations/{network_configuration_id} +func (s *EnterpriseService) DeleteEnterpriseNetworkConfiguration(ctx context.Context, enterprise, networkID string) (*Response, error) { + u := fmt.Sprintf("enterprises/%v/network-configurations/%v", enterprise, networkID) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + return s.client.Do(ctx, req, nil) +} + +// GetEnterpriseNetworkSettingsResource gets a hosted compute network settings resource configured for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#get-a-hosted-compute-network-settings-resource-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/network-settings/{network_settings_id} +func (s *EnterpriseService) GetEnterpriseNetworkSettingsResource(ctx context.Context, enterprise, networkID string) (*EnterpriseNetworkSettingsResource, *Response, error) { + u := fmt.Sprintf("enterprises/%v/network-settings/%v", enterprise, networkID) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + resource := &EnterpriseNetworkSettingsResource{} + resp, err := s.client.Do(ctx, req, resource) + if err != nil { + return nil, resp, err + } + return resource, resp, err +} diff --git a/github/enterprise_network_configurations_test.go b/github/enterprise_network_configurations_test.go new file mode 100644 index 00000000000..c9a9acc8f92 --- /dev/null +++ b/github/enterprise_network_configurations_test.go @@ -0,0 +1,335 @@ +// Copyright 2025 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" + "time" + + "github.com/google/go-cmp/cmp" +) + +func TestEnterpriseService_ListEnterpriseNetworkConfigurations(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc(" /enterprises/e/network-configurations", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{"page": "3", "per_page": "2"}) + fmt.Fprintf(w, `{ + "total_count": 2, + "network_configurations": [ + { + "id": "123456789ABCDEF", + "name": "configuration_one", + "compute_service": "actions", + "network_settings_ids": [ + "23456789ABDCEF1", + "3456789ABDCEF12" + ], + "created_on": "2024-04-09T17:30:15Z" + }, + { + "id": "456789ABDCEF123", + "name": "configuration_two", + "compute_service": "none", + "network_settings_ids": [ + "56789ABDCEF1234", + "6789ABDCEF12345" + ], + "created_on": "2024-11-02T12:30:30Z" + } + ] + }`) + }) + + ctx := context.Background() + + opts := &ListOptions{Page: 3, PerPage: 2} + configurations, _, err := client.Enterprise.ListEnterpriseNetworkConfigurations(ctx, "e", opts) + if err != nil { + t.Errorf("Enterprise.ListEnterpriseNetworkConfigurations returned error: %v", err) + } + + want := &EnterpriseNetworkConfigurations{ + TotalCount: Ptr(int64(2)), + NetworkConfigurations: []*EnterpriseNetworkConfiguration{ + { + ID: Ptr("123456789ABCDEF"), + Name: Ptr("configuration_one"), + ComputeService: Ptr(ComputeService("actions")), + NetworkSettingsIDs: []string{"23456789ABDCEF1", "3456789ABDCEF12"}, + CreatedOn: &Timestamp{time.Date(2024, 4, 9, 17, 30, 15, 0, time.UTC)}, + }, + { + ID: Ptr("456789ABDCEF123"), + Name: Ptr("configuration_two"), + ComputeService: Ptr(ComputeService("none")), + NetworkSettingsIDs: []string{"56789ABDCEF1234", "6789ABDCEF12345"}, + CreatedOn: &Timestamp{time.Date(2024, 11, 2, 12, 30, 30, 0, time.UTC)}, + }, + }, + } + if !cmp.Equal(configurations, want) { + t.Errorf("Enterprise.ListEnterpriseNetworkConfigurations mismatch (-want +got):\n%s", cmp.Diff(want, configurations)) + } + + const methodName = "ListEnterpriseNetworkConfigurations" + testBadOptions(t, methodName, func() error { + _, _, err = client.Enterprise.ListEnterpriseNetworkConfigurations(ctx, "\ne", opts) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.ListEnterpriseNetworkConfigurations(ctx, "e", opts) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_CreateEnterpriseNetworkConfiguration(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/enterprises/e/network-configurations", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + fmt.Fprintf(w, `{ + "id": "123456789ABCDEF", + "name": "configuration_one", + "compute_service": "actions", + "network_settings_ids": [ + "23456789ABDCEF1", + "3456789ABDCEF12" + ], + "created_on": "2024-04-09T17:30:15Z" + }`) + }) + + ctx := context.Background() + + req := EnterpriseNetworkConfigurationRequest{ + Name: Ptr("configuration_one"), + ComputeService: Ptr(ComputeService("actions")), + NetworkSettingsIDs: []string{ + "23456789ABDCEF1", + "3456789ABDCEF12", + }, + } + configuration, _, err := client.Enterprise.CreateEnterpriseNetworkConfiguration(ctx, "e", req) + if err != nil { + t.Errorf("Enterprise.CreateEnterpriseNetworkConfiguration returned error: %v", err) + } + + want := &EnterpriseNetworkConfiguration{ + ID: Ptr("123456789ABCDEF"), + Name: Ptr("configuration_one"), + ComputeService: Ptr(ComputeService("actions")), + NetworkSettingsIDs: []string{"23456789ABDCEF1", "3456789ABDCEF12"}, + CreatedOn: &Timestamp{time.Date(2024, 4, 9, 17, 30, 15, 0, time.UTC)}, + } + if !cmp.Equal(configuration, want) { + t.Errorf("Enterprise.CreateEnterpriseNetworkConfiguration mismatch (-want +got):\n%s", cmp.Diff(want, configuration)) + } + + const methodName = "CreateEnterpriseNetworkConfiguration" + testBadOptions(t, methodName, func() error { + _, _, err = client.Enterprise.CreateEnterpriseNetworkConfiguration(ctx, "\ne", req) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.CreateEnterpriseNetworkConfiguration(ctx, "e", req) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_GetEnterpriseNetworkConfiguration(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/enterprises/e/network-configurations/123456789ABCDEF", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprintf(w, `{ + "id": "123456789ABCDEF", + "name": "configuration_one", + "compute_service": "actions", + "network_settings_ids": [ + "23456789ABDCEF1", + "3456789ABDCEF12" + ], + "created_on": "2024-12-10T19:00:15Z" + }`) + }) + + ctx := context.Background() + configuration, _, err := client.Enterprise.GetEnterpriseNetworkConfiguration(ctx, "e", "123456789ABCDEF") + if err != nil { + t.Errorf("Enterprise.GetEnterpriseNetworkConfiguration returned err: %v", err) + } + + want := &EnterpriseNetworkConfiguration{ + ID: Ptr("123456789ABCDEF"), + Name: Ptr("configuration_one"), + ComputeService: Ptr(ComputeService("actions")), + NetworkSettingsIDs: []string{"23456789ABDCEF1", "3456789ABDCEF12"}, + CreatedOn: &Timestamp{time.Date(2024, 12, 10, 19, 00, 15, 0, time.UTC)}, + } + if !cmp.Equal(configuration, want) { + t.Errorf("Enterprise.GetEnterpriseNetworkConfiguration mismatch (-want +got):\n%s", cmp.Diff(want, configuration)) + } + + const methodName = "GetEnterpriseNetworkConfiguration" + testBadOptions(t, methodName, func() error { + _, _, err = client.Enterprise.GetEnterpriseNetworkConfiguration(ctx, "\ne", "123456789ABCDEF") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.GetEnterpriseNetworkConfiguration(ctx, "e", "123456789ABCDEF") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_UpdateEnterpriseNetworkConfiguration(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/enterprises/e/network-configurations/123456789ABCDEF", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PATCH") + fmt.Fprintf(w, `{ + "id": "123456789ABCDEF", + "name": "updated_configuration_one", + "compute_service": "none", + "network_settings_ids": [ + "456789ABDCEF123", + "56789ABDCEF1234" + ], + "created_on": "2024-12-10T19:00:15Z" + }`) + }) + + ctx := context.Background() + req := EnterpriseNetworkConfigurationRequest{ + Name: Ptr("updated_configuration_one"), + NetworkSettingsIDs: []string{ + "456789ABDCEF123", + "56789ABDCEF1234", + }, + ComputeService: Ptr(ComputeService("none")), + } + configuration, _, err := client.Enterprise.UpdateEnterpriseNetworkConfiguration(ctx, "e", "123456789ABCDEF", req) + if err != nil { + t.Errorf("Enterprise.UpdateEnterpriseNetworkConfiguration returned error %v", err) + } + + want := &EnterpriseNetworkConfiguration{ + ID: Ptr("123456789ABCDEF"), + Name: Ptr("updated_configuration_one"), + ComputeService: Ptr(ComputeService("none")), + NetworkSettingsIDs: []string{"456789ABDCEF123", "56789ABDCEF1234"}, + CreatedOn: &Timestamp{time.Date(2024, 12, 10, 19, 00, 15, 0, time.UTC)}, + } + if !cmp.Equal(configuration, want) { + t.Errorf("Enterprise.UpdateEnterpriseNetworkConfiguration mismatch (-want +get)\n%s", cmp.Diff(want, configuration)) + } + + const methodName = "UpdateEnterpriseNetworkConfiguration" + testBadOptions(t, methodName, func() error { + _, _, err = client.Enterprise.UpdateEnterpriseNetworkConfiguration(ctx, "\ne", "123456789ABCDEF", req) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.UpdateEnterpriseNetworkConfiguration(ctx, "e", "123456789ABCDEF", req) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_DeleteEnterpriseNetworkConfiguration(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/enterprises/e/network-configurations/123456789ABCDEF", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + }) + + ctx := context.Background() + _, err := client.Enterprise.DeleteEnterpriseNetworkConfiguration(ctx, "e", "123456789ABCDEF") + if err != nil { + t.Errorf("Enterprise.DeleteEnterpriseNetworkConfiguration returned error %v", err) + } + + const methodName = "DeleteEnterpriseNetworkConfiguration" + testBadOptions(t, methodName, func() error { + _, err = client.Enterprise.DeleteEnterpriseNetworkConfiguration(ctx, "\ne", "123456789ABCDEF") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Enterprise.DeleteEnterpriseNetworkConfiguration(ctx, "e", "123456789ABCDEF") + }) +} + +func TestEnterpriseService_GetEnterpriseNetworkSettingsResource(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/enterprises/e/network-settings/123456789ABCDEF", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprintf(w, `{ + "id": "220F78DACB92BBFBC5E6F22DE1CCF52309D", + "network_configuration_id": "934E208B3EE0BD60CF5F752C426BFB53562", + "name": "my_network_settings", + "subnet_id": "/subscriptions/14839728-3ad9-43ab-bd2b-fa6ad0f75e2a/resourceGroups/my-rg/providers/Microsoft.Network/virtualNetworks/my-vnet/subnets/my-subnet", + "region": "germanywestcentral" + }`) + }) + + ctx := context.Background() + resource, _, err := client.Enterprise.GetEnterpriseNetworkSettingsResource(ctx, "e", "123456789ABCDEF") + if err != nil { + t.Errorf("Enterprise.GetEnterpriseNetworkSettingsResource returned error %v", err) + } + + want := &EnterpriseNetworkSettingsResource{ + ID: Ptr("220F78DACB92BBFBC5E6F22DE1CCF52309D"), + NetworkConfigurationID: Ptr("934E208B3EE0BD60CF5F752C426BFB53562"), + Name: Ptr("my_network_settings"), + SubnetID: Ptr("/subscriptions/14839728-3ad9-43ab-bd2b-fa6ad0f75e2a/resourceGroups/my-rg/providers/Microsoft.Network/virtualNetworks/my-vnet/subnets/my-subnet"), + Region: Ptr("germanywestcentral"), + } + if !cmp.Equal(resource, want) { + t.Errorf("Enterprise.GetEnterpriseNetworkSettingsResource mistach (-want +got):\n%s", cmp.Diff(want, resource)) + } + + const methodName = "GetEnterpriseNetworkSettingsResource" + testBadOptions(t, methodName, func() error { + _, _, err = client.Enterprise.GetEnterpriseNetworkSettingsResource(ctx, "\ne", "123456789ABCDEF") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.GetEnterpriseNetworkSettingsResource(ctx, "e", "123456789ABCDEF") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} diff --git a/github/github-accessors.go b/github/github-accessors.go index 905dd80c8a2..519f6cbb62e 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -8606,6 +8606,102 @@ func (e *Enterprise) GetWebsiteURL() string { return *e.WebsiteURL } +// GetComputeService returns the ComputeService field. +func (e *EnterpriseNetworkConfiguration) GetComputeService() *ComputeService { + if e == nil { + return nil + } + return e.ComputeService +} + +// GetCreatedOn returns the CreatedOn field if it's non-nil, zero value otherwise. +func (e *EnterpriseNetworkConfiguration) GetCreatedOn() Timestamp { + if e == nil || e.CreatedOn == nil { + return Timestamp{} + } + return *e.CreatedOn +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (e *EnterpriseNetworkConfiguration) GetID() string { + if e == nil || e.ID == nil { + return "" + } + return *e.ID +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (e *EnterpriseNetworkConfiguration) GetName() string { + if e == nil || e.Name == nil { + return "" + } + return *e.Name +} + +// GetComputeService returns the ComputeService field. +func (e *EnterpriseNetworkConfigurationRequest) GetComputeService() *ComputeService { + if e == nil { + return nil + } + return e.ComputeService +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (e *EnterpriseNetworkConfigurationRequest) GetName() string { + if e == nil || e.Name == nil { + return "" + } + return *e.Name +} + +// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. +func (e *EnterpriseNetworkConfigurations) GetTotalCount() int64 { + if e == nil || e.TotalCount == nil { + return 0 + } + return *e.TotalCount +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (e *EnterpriseNetworkSettingsResource) GetID() string { + if e == nil || e.ID == nil { + return "" + } + return *e.ID +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (e *EnterpriseNetworkSettingsResource) GetName() string { + if e == nil || e.Name == nil { + return "" + } + return *e.Name +} + +// GetNetworkConfigurationID returns the NetworkConfigurationID field if it's non-nil, zero value otherwise. +func (e *EnterpriseNetworkSettingsResource) GetNetworkConfigurationID() string { + if e == nil || e.NetworkConfigurationID == nil { + return "" + } + return *e.NetworkConfigurationID +} + +// GetRegion returns the Region field if it's non-nil, zero value otherwise. +func (e *EnterpriseNetworkSettingsResource) GetRegion() string { + if e == nil || e.Region == nil { + return "" + } + return *e.Region +} + +// GetSubnetID returns the SubnetID field if it's non-nil, zero value otherwise. +func (e *EnterpriseNetworkSettingsResource) GetSubnetID() string { + if e == nil || e.SubnetID == nil { + return "" + } + return *e.SubnetID +} + // GetAllowsPublicRepositories returns the AllowsPublicRepositories field if it's non-nil, zero value otherwise. func (e *EnterpriseRunnerGroup) GetAllowsPublicRepositories() bool { if e == nil || e.AllowsPublicRepositories == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 8d69ad42e7e..7da180579e9 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -11118,6 +11118,132 @@ func TestEnterprise_GetWebsiteURL(tt *testing.T) { e.GetWebsiteURL() } +func TestEnterpriseNetworkConfiguration_GetComputeService(tt *testing.T) { + tt.Parallel() + e := &EnterpriseNetworkConfiguration{} + e.GetComputeService() + e = nil + e.GetComputeService() +} + +func TestEnterpriseNetworkConfiguration_GetCreatedOn(tt *testing.T) { + tt.Parallel() + var zeroValue Timestamp + e := &EnterpriseNetworkConfiguration{CreatedOn: &zeroValue} + e.GetCreatedOn() + e = &EnterpriseNetworkConfiguration{} + e.GetCreatedOn() + e = nil + e.GetCreatedOn() +} + +func TestEnterpriseNetworkConfiguration_GetID(tt *testing.T) { + tt.Parallel() + var zeroValue string + e := &EnterpriseNetworkConfiguration{ID: &zeroValue} + e.GetID() + e = &EnterpriseNetworkConfiguration{} + e.GetID() + e = nil + e.GetID() +} + +func TestEnterpriseNetworkConfiguration_GetName(tt *testing.T) { + tt.Parallel() + var zeroValue string + e := &EnterpriseNetworkConfiguration{Name: &zeroValue} + e.GetName() + e = &EnterpriseNetworkConfiguration{} + e.GetName() + e = nil + e.GetName() +} + +func TestEnterpriseNetworkConfigurationRequest_GetComputeService(tt *testing.T) { + tt.Parallel() + e := &EnterpriseNetworkConfigurationRequest{} + e.GetComputeService() + e = nil + e.GetComputeService() +} + +func TestEnterpriseNetworkConfigurationRequest_GetName(tt *testing.T) { + tt.Parallel() + var zeroValue string + e := &EnterpriseNetworkConfigurationRequest{Name: &zeroValue} + e.GetName() + e = &EnterpriseNetworkConfigurationRequest{} + e.GetName() + e = nil + e.GetName() +} + +func TestEnterpriseNetworkConfigurations_GetTotalCount(tt *testing.T) { + tt.Parallel() + var zeroValue int64 + e := &EnterpriseNetworkConfigurations{TotalCount: &zeroValue} + e.GetTotalCount() + e = &EnterpriseNetworkConfigurations{} + e.GetTotalCount() + e = nil + e.GetTotalCount() +} + +func TestEnterpriseNetworkSettingsResource_GetID(tt *testing.T) { + tt.Parallel() + var zeroValue string + e := &EnterpriseNetworkSettingsResource{ID: &zeroValue} + e.GetID() + e = &EnterpriseNetworkSettingsResource{} + e.GetID() + e = nil + e.GetID() +} + +func TestEnterpriseNetworkSettingsResource_GetName(tt *testing.T) { + tt.Parallel() + var zeroValue string + e := &EnterpriseNetworkSettingsResource{Name: &zeroValue} + e.GetName() + e = &EnterpriseNetworkSettingsResource{} + e.GetName() + e = nil + e.GetName() +} + +func TestEnterpriseNetworkSettingsResource_GetNetworkConfigurationID(tt *testing.T) { + tt.Parallel() + var zeroValue string + e := &EnterpriseNetworkSettingsResource{NetworkConfigurationID: &zeroValue} + e.GetNetworkConfigurationID() + e = &EnterpriseNetworkSettingsResource{} + e.GetNetworkConfigurationID() + e = nil + e.GetNetworkConfigurationID() +} + +func TestEnterpriseNetworkSettingsResource_GetRegion(tt *testing.T) { + tt.Parallel() + var zeroValue string + e := &EnterpriseNetworkSettingsResource{Region: &zeroValue} + e.GetRegion() + e = &EnterpriseNetworkSettingsResource{} + e.GetRegion() + e = nil + e.GetRegion() +} + +func TestEnterpriseNetworkSettingsResource_GetSubnetID(tt *testing.T) { + tt.Parallel() + var zeroValue string + e := &EnterpriseNetworkSettingsResource{SubnetID: &zeroValue} + e.GetSubnetID() + e = &EnterpriseNetworkSettingsResource{} + e.GetSubnetID() + e = nil + e.GetSubnetID() +} + func TestEnterpriseRunnerGroup_GetAllowsPublicRepositories(tt *testing.T) { tt.Parallel() var zeroValue bool From c79da9900c1dea0729d0de64ee2ce98acea6cf82 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Mar 2025 14:59:58 -0500 Subject: [PATCH 664/751] build(deps): bump codecov/codecov-action from 5.3.1 to 5.4.0 (#3500) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d3125e80ec3..82579952d1c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -76,6 +76,6 @@ jobs: - name: Upload coverage to Codecov if: ${{ matrix.update-coverage }} - uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1 + uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0 with: use_oidc: true From 0877faf39ff4da78beac849a234b30d9a1a58a3c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Mar 2025 16:00:41 -0500 Subject: [PATCH 665/751] build(deps): bump actions/cache from 4.2.1 to 4.2.2 in the actions group (#3499) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 82579952d1c..71b1cd8b5b1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -54,7 +54,7 @@ jobs: echo "go-mod-cache=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT - name: Cache go modules - uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1 + uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2 with: path: | ${{ steps.cache-paths.outputs.go-cache }} From 56f5036c4e778d1b3f84ff4eff716fd3c652f342 Mon Sep 17 00:00:00 2001 From: Evan <10603766+hoenn@users.noreply.github.com> Date: Wed, 5 Mar 2025 12:12:09 -0500 Subject: [PATCH 666/751] Add created_at field to Reaction (#3501) --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 11 +++++++++++ github/github-stringify_test.go | 11 ++++++----- github/reactions.go | 3 ++- 4 files changed, 27 insertions(+), 6 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 519f6cbb62e..e2a165272ef 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -20318,6 +20318,14 @@ func (r *Reaction) GetContent() string { return *r.Content } +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (r *Reaction) GetCreatedAt() Timestamp { + if r == nil || r.CreatedAt == nil { + return Timestamp{} + } + return *r.CreatedAt +} + // GetID returns the ID field if it's non-nil, zero value otherwise. func (r *Reaction) GetID() int64 { if r == nil || r.ID == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 7da180579e9..66132f57664 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -26151,6 +26151,17 @@ func TestReaction_GetContent(tt *testing.T) { r.GetContent() } +func TestReaction_GetCreatedAt(tt *testing.T) { + tt.Parallel() + var zeroValue Timestamp + r := &Reaction{CreatedAt: &zeroValue} + r.GetCreatedAt() + r = &Reaction{} + r.GetCreatedAt() + r = nil + r.GetCreatedAt() +} + func TestReaction_GetID(tt *testing.T) { tt.Parallel() var zeroValue int64 diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index 948a9547a4d..e09444719ac 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -1513,12 +1513,13 @@ func TestRate_String(t *testing.T) { func TestReaction_String(t *testing.T) { t.Parallel() v := Reaction{ - ID: Ptr(int64(0)), - User: &User{}, - NodeID: Ptr(""), - Content: Ptr(""), + ID: Ptr(int64(0)), + User: &User{}, + NodeID: Ptr(""), + Content: Ptr(""), + CreatedAt: &Timestamp{}, } - want := `github.Reaction{ID:0, User:github.User{}, NodeID:"", Content:""}` + want := `github.Reaction{ID:0, User:github.User{}, NodeID:"", Content:"", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}` if got := v.String(); got != want { t.Errorf("Reaction.String = %v, want %v", got, want) } diff --git a/github/reactions.go b/github/reactions.go index 9f9f72faeed..e9823220372 100644 --- a/github/reactions.go +++ b/github/reactions.go @@ -26,7 +26,8 @@ type Reaction struct { // Content is the type of reaction. // Possible values are: // "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". - Content *string `json:"content,omitempty"` + Content *string `json:"content,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` } // Reactions represents a summary of GitHub reactions. From 991a3418bc633e725c9ef9426975d06fe2e2b5bf Mon Sep 17 00:00:00 2001 From: Adam Guthrie Date: Mon, 10 Mar 2025 13:02:12 -0700 Subject: [PATCH 667/751] Add reason parameter to MergeGroupEvent (#3508) --- github/event_types.go | 4 +++- github/event_types_test.go | 2 ++ github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 11 +++++++++++ 4 files changed, 24 insertions(+), 1 deletion(-) diff --git a/github/event_types.go b/github/event_types.go index 0df3b30c381..6a6caf19ddb 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -858,8 +858,10 @@ type MergeGroup struct { // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#merge_group type MergeGroupEvent struct { - // The action that was performed. Currently, can only be checks_requested. + // The action that was performed. Possible values are: "checks_requested", "destroyed". Action *string `json:"action,omitempty"` + // Reason is populated when the action is "destroyed". Possible values: "merged", "invalidated", "dequeued". + Reason *string `json:"reason,omitempty"` // The merge group. MergeGroup *MergeGroup `json:"merge_group,omitempty"` diff --git a/github/event_types_test.go b/github/event_types_test.go index 947f97026a9..35d57dbe303 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -10746,6 +10746,7 @@ func TestMergeGroupEvent_Marshal(t *testing.T) { u := &MergeGroupEvent{ Action: Ptr("a"), + Reason: Ptr("r"), MergeGroup: &MergeGroup{ HeadSHA: Ptr("hs"), HeadRef: Ptr("hr"), @@ -10886,6 +10887,7 @@ func TestMergeGroupEvent_Marshal(t *testing.T) { want := `{ "action": "a", + "reason": "r", "merge_group": { "head_sha": "hs", "head_ref": "hr", diff --git a/github/github-accessors.go b/github/github-accessors.go index e2a165272ef..711d48a6a23 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -14334,6 +14334,14 @@ func (m *MergeGroupEvent) GetOrg() *Organization { return m.Org } +// GetReason returns the Reason field if it's non-nil, zero value otherwise. +func (m *MergeGroupEvent) GetReason() string { + if m == nil || m.Reason == nil { + return "" + } + return *m.Reason +} + // GetRepo returns the Repo field. func (m *MergeGroupEvent) GetRepo() *Repository { if m == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 66132f57664..5a11f891f1d 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -18571,6 +18571,17 @@ func TestMergeGroupEvent_GetOrg(tt *testing.T) { m.GetOrg() } +func TestMergeGroupEvent_GetReason(tt *testing.T) { + tt.Parallel() + var zeroValue string + m := &MergeGroupEvent{Reason: &zeroValue} + m.GetReason() + m = &MergeGroupEvent{} + m.GetReason() + m = nil + m.GetReason() +} + func TestMergeGroupEvent_GetRepo(tt *testing.T) { tt.Parallel() m := &MergeGroupEvent{} From 76d1d4625728750d534f34dc404e40876fde77e1 Mon Sep 17 00:00:00 2001 From: Dominic Evans <8060970+dnwe@users.noreply.github.com> Date: Mon, 10 Mar 2025 21:15:03 +0000 Subject: [PATCH 668/751] fix(ci): ensure 'auto' toolchain applies to generate (#3436) --- script/generate.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/script/generate.sh b/script/generate.sh index 8d5f240dfaa..2418dcf2d1b 100755 --- a/script/generate.sh +++ b/script/generate.sh @@ -6,6 +6,10 @@ set -e CDPATH="" cd -- "$(dirname -- "$0")/.." +# force 1.22.0 default and "auto" toolchain (i.e., use the toolchain directive) +# when running generate and mod tidy +export GOTOOLCHAIN="go1.22.0+auto" + if [ "$1" = "--check" ]; then GENTEMP="$(mktemp -d)" git worktree add -q --detach "$GENTEMP" @@ -43,6 +47,6 @@ for dir in $MOD_DIRS; do ( cd "$dir" go generate ./... - GOTOOLCHAIN="go1.22+auto" go mod tidy + go mod tidy ) done From 75813d00d9a94394ee83a69797efa637ef64dcf6 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Mon, 10 Mar 2025 20:55:59 -0400 Subject: [PATCH 669/751] Bump dependency versions from dependabot warnings (#3512) --- example/go.mod | 5 +++-- example/go.sum | 6 ++++-- example/newreposecretwithlibsodium/go.mod | 2 +- example/verifyartifact/main.go | 4 ++-- go.mod | 2 +- scrape/go.mod | 6 +++--- scrape/go.sum | 8 ++++---- tools/go.mod | 9 +++++---- tools/go.sum | 14 ++++++++------ tools/sliceofpointers/go.mod | 2 +- 10 files changed, 32 insertions(+), 26 deletions(-) diff --git a/example/go.mod b/example/go.mod index 27045fc9221..b5e47e97500 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,13 +1,13 @@ module github.com/google/go-github/v69/example -go 1.22.0 +go 1.23.0 require ( github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-ratelimit v1.0.3 github.com/google/go-github/v69 v69.2.0 - github.com/sigstore/sigstore-go v0.5.1 + github.com/sigstore/sigstore-go v0.6.1 golang.org/x/crypto v0.31.0 golang.org/x/term v0.27.0 google.golang.org/appengine v1.6.8 @@ -45,6 +45,7 @@ require ( github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-retryablehttp v0.7.7 // indirect github.com/hashicorp/hcl v1.0.0 // indirect + github.com/in-toto/attestation v1.1.0 // indirect github.com/in-toto/in-toto-golang v0.9.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jedisct1/go-minisign v0.0.0-20211028175153-1c139d1cc84b // indirect diff --git a/example/go.sum b/example/go.sum index d99bb0d3f2f..437e3830d95 100644 --- a/example/go.sum +++ b/example/go.sum @@ -203,6 +203,8 @@ github.com/hashicorp/vault/api v1.12.2 h1:7YkCTE5Ni90TcmYHDBExdt4WGJxhpzaHqR6uGb github.com/hashicorp/vault/api v1.12.2/go.mod h1:LSGf1NGT1BnvFFnKVtnvcaLBM2Lz+gJdpL6HUYed8KE= github.com/howeyc/gopass v0.0.0-20210920133722-c8aef6fb66ef h1:A9HsByNhogrvm9cWb28sjiS3i7tcKCkflWFEkHfuAgM= github.com/howeyc/gopass v0.0.0-20210920133722-c8aef6fb66ef/go.mod h1:lADxMC39cJJqL93Duh1xhAs4I2Zs8mKS89XWXFGp9cs= +github.com/in-toto/attestation v1.1.0 h1:oRWzfmZPDSctChD0VaQV7MJrywKOzyNrtpENQFq//2Q= +github.com/in-toto/attestation v1.1.0/go.mod h1:DB59ytd3z7cIHgXxwpSX2SABrU6WJUKg/grpdgHVgVs= github.com/in-toto/in-toto-golang v0.9.0 h1:tHny7ac4KgtsfrG6ybU8gVOZux2H8jN05AXJ9EBM1XU= github.com/in-toto/in-toto-golang v0.9.0/go.mod h1:xsBVrVsHNsB61++S6Dy2vWosKhuA3lUTQd+eF9HdeMo= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= @@ -285,8 +287,8 @@ github.com/sigstore/rekor v1.3.6 h1:QvpMMJVWAp69a3CHzdrLelqEqpTM3ByQRt5B5Kspbi8= github.com/sigstore/rekor v1.3.6/go.mod h1:JDTSNNMdQ/PxdsS49DJkJ+pRJCO/83nbR5p3aZQteXc= github.com/sigstore/sigstore v1.8.11 h1:tEqeQqbT+awtM87ec9KEeSUxT/AFvJNawneYJyAkFrQ= github.com/sigstore/sigstore v1.8.11/go.mod h1:fdrFQosxCQ4wTL5H1NrZcQkqQ72AQbPjtpcL2QOGKV0= -github.com/sigstore/sigstore-go v0.5.1 h1:5IhKvtjlQBeLnjKkzMELNG4tIBf+xXQkDzhLV77+/8Y= -github.com/sigstore/sigstore-go v0.5.1/go.mod h1:TuOfV7THHqiDaUHuJ5+QN23RP/YoKmsbwJpY+aaYPN0= +github.com/sigstore/sigstore-go v0.6.1 h1:tGkkv1oDIER+QYU5MrjqlttQOVDWfSkmYwMqkJhB/cg= +github.com/sigstore/sigstore-go v0.6.1/go.mod h1:Xe5GHmUeACRFbomUWzVkf/xYCn8xVifb9DgqJrV2dIw= github.com/sigstore/sigstore/pkg/signature/kms/aws v1.8.3 h1:LTfPadUAo+PDRUbbdqbeSl2OuoFQwUFTnJ4stu+nwWw= github.com/sigstore/sigstore/pkg/signature/kms/aws v1.8.3/go.mod h1:QV/Lxlxm0POyhfyBtIbTWxNeF18clMlkkyL9mu45y18= github.com/sigstore/sigstore/pkg/signature/kms/azure v1.8.3 h1:xgbPRCr2npmmsuVVteJqi/ERw9+I13Wou7kq0Yk4D8g= diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index 9c26071494e..8e5afd9c257 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -1,6 +1,6 @@ module newreposecretwithlibsodium -go 1.22.0 +go 1.23.0 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb diff --git a/example/verifyartifact/main.go b/example/verifyartifact/main.go index 1c6502e787c..d3845bd23a1 100644 --- a/example/verifyartifact/main.go +++ b/example/verifyartifact/main.go @@ -102,7 +102,7 @@ func main() { log.Fatal(err) } - var b *bundle.ProtobufBundle + var b *bundle.Bundle for _, attestation := range attestations.Attestations { if err := json.Unmarshal(attestation.Bundle, &b); err != nil { log.Fatal(err) @@ -180,7 +180,7 @@ func getPolicyBuilder() (*verify.PolicyBuilder, error) { return &pb, nil } -func runVerification(sev *verify.SignedEntityVerifier, pb *verify.PolicyBuilder, b *bundle.ProtobufBundle) error { +func runVerification(sev *verify.SignedEntityVerifier, pb *verify.PolicyBuilder, b *bundle.Bundle) error { res, err := sev.Verify(b, *pb) if err != nil { return err diff --git a/go.mod b/go.mod index 25e0e7b45d4..c49b5393d8c 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/google/go-github/v69 -go 1.22.0 +go 1.23.0 require ( github.com/google/go-cmp v0.7.0 diff --git a/scrape/go.mod b/scrape/go.mod index 82db6307bc0..6c62db65ae5 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -1,13 +1,13 @@ module github.com/google/go-github/scrape -go 1.22.0 +go 1.23.0 require ( - github.com/PuerkitoBio/goquery v1.9.3 + github.com/PuerkitoBio/goquery v1.10.2 github.com/google/go-cmp v0.7.0 github.com/google/go-github/v69 v69.2.0 github.com/xlzd/gotp v0.1.0 - golang.org/x/net v0.35.0 + golang.org/x/net v0.37.0 ) require ( diff --git a/scrape/go.sum b/scrape/go.sum index f0eddaf0950..fd8988cf589 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -1,5 +1,5 @@ -github.com/PuerkitoBio/goquery v1.9.3 h1:mpJr/ikUA9/GNJB/DBZcGeFDXUtosHRyRrwh7KGdTG0= -github.com/PuerkitoBio/goquery v1.9.3/go.mod h1:1ndLHPdTz+DyQPICCWYlYQMPl0oXZj0G6D4LCYA6u4U= +github.com/PuerkitoBio/goquery v1.10.2 h1:7fh2BdHcG6VFZsK7toXBT/Bh1z5Wmy8Q9MV9HqT2AM8= +github.com/PuerkitoBio/goquery v1.10.2/go.mod h1:0guWGjcLu9AYC7C1GHnpysHy056u9aEkUHwhdnePMCU= github.com/andybalholm/cascadia v1.3.3 h1:AG2YHrzJIm4BZ19iwJ/DAua6Btl3IwJX+VI4kktS1LM= github.com/andybalholm/cascadia v1.3.3/go.mod h1:xNd9bqTn98Ln4DwST8/nG+H0yuB8Hmgu1YHNnWw0GeA= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -33,8 +33,8 @@ golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= -golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= -golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= +golang.org/x/net v0.37.0 h1:1zLorHbz+LYj7MQlSf1+2tPIIgibq2eL5xkrGk6f+2c= +golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= diff --git a/tools/go.mod b/tools/go.mod index c9ce43d3f2e..4085ea0fd50 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -1,13 +1,13 @@ module tools -go 1.22.0 +go 1.23.0 require ( github.com/alecthomas/kong v1.8.1 - github.com/getkin/kin-openapi v0.128.0 + github.com/getkin/kin-openapi v0.129.0 github.com/google/go-cmp v0.7.0 github.com/google/go-github/v69 v69.2.0 - golang.org/x/sync v0.11.0 + golang.org/x/sync v0.12.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -16,10 +16,11 @@ require ( github.com/go-openapi/swag v0.23.0 // indirect github.com/go-test/deep v1.1.1 // indirect github.com/google/go-querystring v1.1.0 // indirect - github.com/invopop/yaml v0.3.1 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect + github.com/oasdiff/yaml v0.0.0-20241210131133-6b86fb107d80 // indirect + github.com/oasdiff/yaml3 v0.0.0-20241210130736-a94c01f36349 // indirect github.com/perimeterx/marshmallow v1.1.5 // indirect ) diff --git a/tools/go.sum b/tools/go.sum index ecbe0ac6897..4c259e7ab3b 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -6,8 +6,8 @@ github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/getkin/kin-openapi v0.128.0 h1:jqq3D9vC9pPq1dGcOCv7yOp1DaEe7c/T1vzcLbITSp4= -github.com/getkin/kin-openapi v0.128.0/go.mod h1:OZrfXzUfGrNbsKj+xmFBx6E5c6yH3At/tAKSc2UszXM= +github.com/getkin/kin-openapi v0.129.0 h1:QGYTNcmyP5X0AtFQ2Dkou9DGBJsUETeLH9rFrJXZh30= +github.com/getkin/kin-openapi v0.129.0/go.mod h1:gmWI+b/J45xqpyK5wJmRRZse5wefA5H0RDMK46kLUtI= github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= @@ -21,8 +21,6 @@ github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= -github.com/invopop/yaml v0.3.1 h1:f0+ZpmhfBSS4MhG+4HYseMdJhoeeopbSKbq5Rpeelso= -github.com/invopop/yaml v0.3.1/go.mod h1:PMOp3nn4/12yEZUFfmOuNHJsZToEEOwoWsT+D81KkeA= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -33,6 +31,10 @@ github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0 github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= +github.com/oasdiff/yaml v0.0.0-20241210131133-6b86fb107d80 h1:nZspmSkneBbtxU9TopEAE0CY+SBJLxO8LPUlw2vG4pU= +github.com/oasdiff/yaml v0.0.0-20241210131133-6b86fb107d80/go.mod h1:7tFDb+Y51LcDpn26GccuUgQXUk6t0CXZsivKjyimYX8= +github.com/oasdiff/yaml3 v0.0.0-20241210130736-a94c01f36349 h1:t05Ww3DxZutOqbMN+7OIuqDwXbhl32HiZGpLy26BAPc= +github.com/oasdiff/yaml3 v0.0.0-20241210130736-a94c01f36349/go.mod h1:y5+oSEHCPT/DGrS++Wc/479ERge0zTFxaF8PbGKcg2o= github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s= github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -43,8 +45,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= -golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= -golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw= +golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= diff --git a/tools/sliceofpointers/go.mod b/tools/sliceofpointers/go.mod index 759fa734d9e..1f4ef32db34 100644 --- a/tools/sliceofpointers/go.mod +++ b/tools/sliceofpointers/go.mod @@ -1,6 +1,6 @@ module tools/sliceofpointers -go 1.22.0 +go 1.23.0 require ( github.com/golangci/plugin-module-register v0.1.1 From 259cd223722648aad8a49bdcb8cfaad3d0a09f15 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Mon, 10 Mar 2025 21:15:46 -0400 Subject: [PATCH 670/751] Bump go-jose to v4.0.5 (#3513) --- example/go.mod | 8 ++++---- example/go.sum | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/example/go.mod b/example/go.mod index b5e47e97500..58560bac535 100644 --- a/example/go.mod +++ b/example/go.mod @@ -8,8 +8,8 @@ require ( github.com/gofri/go-github-ratelimit v1.0.3 github.com/google/go-github/v69 v69.2.0 github.com/sigstore/sigstore-go v0.6.1 - golang.org/x/crypto v0.31.0 - golang.org/x/term v0.27.0 + golang.org/x/crypto v0.32.0 + golang.org/x/term v0.28.0 google.golang.org/appengine v1.6.8 ) @@ -22,7 +22,7 @@ require ( github.com/digitorus/timestamp v0.0.0-20231217203849-220c5c2851b7 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-chi/chi v4.1.2+incompatible // indirect - github.com/go-jose/go-jose/v4 v4.0.2 // indirect + github.com/go-jose/go-jose/v4 v4.0.5 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-openapi/analysis v0.23.0 // indirect @@ -89,7 +89,7 @@ require ( golang.org/x/mod v0.20.0 // indirect golang.org/x/net v0.33.0 // indirect golang.org/x/sync v0.10.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 // indirect google.golang.org/protobuf v1.34.2 // indirect diff --git a/example/go.sum b/example/go.sum index 437e3830d95..1c2cbf5ba24 100644 --- a/example/go.sum +++ b/example/go.sum @@ -101,8 +101,8 @@ github.com/go-chi/chi v4.1.2+incompatible h1:fGFk2Gmi/YKXk0OmGfBh0WgmN3XB8lVnEyN github.com/go-chi/chi v4.1.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= github.com/go-jose/go-jose/v3 v3.0.3 h1:fFKWeig/irsp7XD2zBxvnmA/XaRWp5V3CBsZXJF7G7k= github.com/go-jose/go-jose/v3 v3.0.3/go.mod h1:5b+7YgP7ZICgJDBdfjZaIt+H/9L9T/YQrVfLAMboGkQ= -github.com/go-jose/go-jose/v4 v4.0.2 h1:R3l3kkBds16bO7ZFAEEcofK0MkrAJt3jlJznWZG0nvk= -github.com/go-jose/go-jose/v4 v4.0.2/go.mod h1:WVf9LFMHh/QVrmqrOfqun0C45tMe3RoiKJMPvgWwLfY= +github.com/go-jose/go-jose/v4 v4.0.5 h1:M6T8+mKZl/+fNNuFHvGIzDz7BTLQPIounk/b9dw3AaE= +github.com/go-jose/go-jose/v4 v4.0.5/go.mod h1:s3P1lRrkT8igV8D9OjyL4WRyHvjB6a4JSllnOrmmBOA= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -318,8 +318,8 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/theupdateframework/go-tuf v0.7.0 h1:CqbQFrWo1ae3/I0UCblSbczevCCbS31Qvs5LdxRWqRI= @@ -362,8 +362,8 @@ golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= -golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 h1:hNQpMuAJe5CtcUqCXaWga3FHu+kQvCqcsoVaQgSV60o= golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= @@ -396,15 +396,15 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= -golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= +golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= +golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= From 8a3634eeff2c12fe660bf0107a70350fbedcd531 Mon Sep 17 00:00:00 2001 From: Jan Niklas Dittmar Date: Wed, 12 Mar 2025 20:19:17 +0100 Subject: [PATCH 671/751] feat!: Add support for network-configurations endpoints for organization (#3511) BREAKING CHANGE: `EnterpriseNetwork*` structs have been replaced with `Network*` structs. --- github/enterprise_network_configurations.go | 67 +-- .../enterprise_network_configurations_test.go | 126 ++++- github/github-accessors.go | 192 +++---- github/github-accessors_test.go | 252 ++++----- github/orgs_network_configurations.go | 236 +++++++++ github/orgs_network_configurations_test.go | 489 ++++++++++++++++++ 6 files changed, 1063 insertions(+), 299 deletions(-) create mode 100644 github/orgs_network_configurations.go create mode 100644 github/orgs_network_configurations_test.go diff --git a/github/enterprise_network_configurations.go b/github/enterprise_network_configurations.go index a5af390a197..a6a690d786b 100644 --- a/github/enterprise_network_configurations.go +++ b/github/enterprise_network_configurations.go @@ -10,51 +10,12 @@ import ( "fmt" ) -// ComputeService represents a hosted compute service the network configuration supports. -type ComputeService string - -const ( - ComputeServiceNone ComputeService = "none" - ComputeServiceActions ComputeService = "actions" -) - -// EnterpriseNetworkConfiguration represents a hosted compute network configuration. -type EnterpriseNetworkConfiguration struct { - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - ComputeService *ComputeService `json:"compute_service,omitempty"` - NetworkSettingsIDs []string `json:"network_settings_ids,omitempty"` - CreatedOn *Timestamp `json:"created_on,omitempty"` -} - -// EnterpriseNetworkConfigurations represents a hosted compute network configurations. -type EnterpriseNetworkConfigurations struct { - TotalCount *int64 `json:"total_count,omitempty"` - NetworkConfigurations []*EnterpriseNetworkConfiguration `json:"network_configurations,omitempty"` -} - -// EnterpriseNetworkSettingsResource represents a hosted compute network settings resource. -type EnterpriseNetworkSettingsResource struct { - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - NetworkConfigurationID *string `json:"network_configuration_id,omitempty"` - SubnetID *string `json:"subnet_id,omitempty"` - Region *string `json:"region,omitempty"` -} - -// EnterpriseNetworkConfigurationRequest represents a request to create or update a network configuration for an enterprise. -type EnterpriseNetworkConfigurationRequest struct { - Name *string `json:"name,omitempty"` - ComputeService *ComputeService `json:"compute_service,omitempty"` - NetworkSettingsIDs []string `json:"network_settings_ids,omitempty"` -} - // ListEnterpriseNetworkConfigurations lists all hosted compute network configurations configured in an enterprise. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#list-hosted-compute-network-configurations-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/network-configurations -func (s *EnterpriseService) ListEnterpriseNetworkConfigurations(ctx context.Context, enterprise string, opts *ListOptions) (*EnterpriseNetworkConfigurations, *Response, error) { +func (s *EnterpriseService) ListEnterpriseNetworkConfigurations(ctx context.Context, enterprise string, opts *ListOptions) (*NetworkConfigurations, *Response, error) { u := fmt.Sprintf("enterprises/%v/network-configurations", enterprise) u, err := addOptions(u, opts) if err != nil { @@ -66,7 +27,7 @@ func (s *EnterpriseService) ListEnterpriseNetworkConfigurations(ctx context.Cont return nil, nil, err } - networks := &EnterpriseNetworkConfigurations{} + networks := &NetworkConfigurations{} resp, err := s.client.Do(ctx, req, networks) if err != nil { return nil, resp, err @@ -79,14 +40,18 @@ func (s *EnterpriseService) ListEnterpriseNetworkConfigurations(ctx context.Cont // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#create-a-hosted-compute-network-configuration-for-an-enterprise // //meta:operation POST /enterprises/{enterprise}/network-configurations -func (s *EnterpriseService) CreateEnterpriseNetworkConfiguration(ctx context.Context, enterprise string, createReq EnterpriseNetworkConfigurationRequest) (*EnterpriseNetworkConfiguration, *Response, error) { +func (s *EnterpriseService) CreateEnterpriseNetworkConfiguration(ctx context.Context, enterprise string, createReq NetworkConfigurationRequest) (*NetworkConfiguration, *Response, error) { + if err := validateNetworkConfigurationRequest(createReq); err != nil { + return nil, nil, fmt.Errorf("validation failed: %w", err) + } + u := fmt.Sprintf("enterprises/%v/network-configurations", enterprise) req, err := s.client.NewRequest("POST", u, createReq) if err != nil { return nil, nil, err } - network := &EnterpriseNetworkConfiguration{} + network := &NetworkConfiguration{} resp, err := s.client.Do(ctx, req, network) if err != nil { return nil, resp, err @@ -100,14 +65,14 @@ func (s *EnterpriseService) CreateEnterpriseNetworkConfiguration(ctx context.Con // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#get-a-hosted-compute-network-configuration-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/network-configurations/{network_configuration_id} -func (s *EnterpriseService) GetEnterpriseNetworkConfiguration(ctx context.Context, enterprise, networkID string) (*EnterpriseNetworkConfiguration, *Response, error) { +func (s *EnterpriseService) GetEnterpriseNetworkConfiguration(ctx context.Context, enterprise, networkID string) (*NetworkConfiguration, *Response, error) { u := fmt.Sprintf("enterprises/%v/network-configurations/%v", enterprise, networkID) req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err } - network := &EnterpriseNetworkConfiguration{} + network := &NetworkConfiguration{} resp, err := s.client.Do(ctx, req, network) if err != nil { return nil, resp, err @@ -120,14 +85,18 @@ func (s *EnterpriseService) GetEnterpriseNetworkConfiguration(ctx context.Contex // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#update-a-hosted-compute-network-configuration-for-an-enterprise // //meta:operation PATCH /enterprises/{enterprise}/network-configurations/{network_configuration_id} -func (s *EnterpriseService) UpdateEnterpriseNetworkConfiguration(ctx context.Context, enterprise, networkID string, updateReq EnterpriseNetworkConfigurationRequest) (*EnterpriseNetworkConfiguration, *Response, error) { +func (s *EnterpriseService) UpdateEnterpriseNetworkConfiguration(ctx context.Context, enterprise, networkID string, updateReq NetworkConfigurationRequest) (*NetworkConfiguration, *Response, error) { + if err := validateNetworkConfigurationRequest(updateReq); err != nil { + return nil, nil, fmt.Errorf("validation failed: %w", err) + } + u := fmt.Sprintf("enterprises/%v/network-configurations/%v", enterprise, networkID) req, err := s.client.NewRequest("PATCH", u, updateReq) if err != nil { return nil, nil, err } - network := &EnterpriseNetworkConfiguration{} + network := &NetworkConfiguration{} resp, err := s.client.Do(ctx, req, network) if err != nil { return nil, resp, err @@ -154,14 +123,14 @@ func (s *EnterpriseService) DeleteEnterpriseNetworkConfiguration(ctx context.Con // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#get-a-hosted-compute-network-settings-resource-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/network-settings/{network_settings_id} -func (s *EnterpriseService) GetEnterpriseNetworkSettingsResource(ctx context.Context, enterprise, networkID string) (*EnterpriseNetworkSettingsResource, *Response, error) { +func (s *EnterpriseService) GetEnterpriseNetworkSettingsResource(ctx context.Context, enterprise, networkID string) (*NetworkSettingsResource, *Response, error) { u := fmt.Sprintf("enterprises/%v/network-settings/%v", enterprise, networkID) req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err } - resource := &EnterpriseNetworkSettingsResource{} + resource := &NetworkSettingsResource{} resp, err := s.client.Do(ctx, req, resource) if err != nil { return nil, resp, err diff --git a/github/enterprise_network_configurations_test.go b/github/enterprise_network_configurations_test.go index c9a9acc8f92..74555997427 100644 --- a/github/enterprise_network_configurations_test.go +++ b/github/enterprise_network_configurations_test.go @@ -27,7 +27,7 @@ func TestEnterpriseService_ListEnterpriseNetworkConfigurations(t *testing.T) { "network_configurations": [ { "id": "123456789ABCDEF", - "name": "configuration_one", + "name": "configuration one", "compute_service": "actions", "network_settings_ids": [ "23456789ABDCEF1", @@ -37,7 +37,7 @@ func TestEnterpriseService_ListEnterpriseNetworkConfigurations(t *testing.T) { }, { "id": "456789ABDCEF123", - "name": "configuration_two", + "name": "configuration two", "compute_service": "none", "network_settings_ids": [ "56789ABDCEF1234", @@ -57,19 +57,19 @@ func TestEnterpriseService_ListEnterpriseNetworkConfigurations(t *testing.T) { t.Errorf("Enterprise.ListEnterpriseNetworkConfigurations returned error: %v", err) } - want := &EnterpriseNetworkConfigurations{ + want := &NetworkConfigurations{ TotalCount: Ptr(int64(2)), - NetworkConfigurations: []*EnterpriseNetworkConfiguration{ + NetworkConfigurations: []*NetworkConfiguration{ { ID: Ptr("123456789ABCDEF"), - Name: Ptr("configuration_one"), + Name: Ptr("configuration one"), ComputeService: Ptr(ComputeService("actions")), NetworkSettingsIDs: []string{"23456789ABDCEF1", "3456789ABDCEF12"}, CreatedOn: &Timestamp{time.Date(2024, 4, 9, 17, 30, 15, 0, time.UTC)}, }, { ID: Ptr("456789ABDCEF123"), - Name: Ptr("configuration_two"), + Name: Ptr("configuration two"), ComputeService: Ptr(ComputeService("none")), NetworkSettingsIDs: []string{"56789ABDCEF1234", "6789ABDCEF12345"}, CreatedOn: &Timestamp{time.Date(2024, 11, 2, 12, 30, 30, 0, time.UTC)}, @@ -103,11 +103,10 @@ func TestEnterpriseService_CreateEnterpriseNetworkConfiguration(t *testing.T) { testMethod(t, r, "POST") fmt.Fprintf(w, `{ "id": "123456789ABCDEF", - "name": "configuration_one", + "name": "configuration one", "compute_service": "actions", "network_settings_ids": [ - "23456789ABDCEF1", - "3456789ABDCEF12" + "23456789ABDCEF1" ], "created_on": "2024-04-09T17:30:15Z" }`) @@ -115,12 +114,11 @@ func TestEnterpriseService_CreateEnterpriseNetworkConfiguration(t *testing.T) { ctx := context.Background() - req := EnterpriseNetworkConfigurationRequest{ - Name: Ptr("configuration_one"), + req := NetworkConfigurationRequest{ + Name: Ptr("configuration-one"), ComputeService: Ptr(ComputeService("actions")), NetworkSettingsIDs: []string{ "23456789ABDCEF1", - "3456789ABDCEF12", }, } configuration, _, err := client.Enterprise.CreateEnterpriseNetworkConfiguration(ctx, "e", req) @@ -128,17 +126,54 @@ func TestEnterpriseService_CreateEnterpriseNetworkConfiguration(t *testing.T) { t.Errorf("Enterprise.CreateEnterpriseNetworkConfiguration returned error: %v", err) } - want := &EnterpriseNetworkConfiguration{ + want := &NetworkConfiguration{ ID: Ptr("123456789ABCDEF"), - Name: Ptr("configuration_one"), + Name: Ptr("configuration one"), ComputeService: Ptr(ComputeService("actions")), - NetworkSettingsIDs: []string{"23456789ABDCEF1", "3456789ABDCEF12"}, + NetworkSettingsIDs: []string{"23456789ABDCEF1"}, CreatedOn: &Timestamp{time.Date(2024, 4, 9, 17, 30, 15, 0, time.UTC)}, } if !cmp.Equal(configuration, want) { t.Errorf("Enterprise.CreateEnterpriseNetworkConfiguration mismatch (-want +got):\n%s", cmp.Diff(want, configuration)) } + validationTest := []struct { + name string + request NetworkConfigurationRequest + want string + }{ + { + name: "invalid network settings id", + request: NetworkConfigurationRequest{ + Name: Ptr(""), + NetworkSettingsIDs: []string{"56789ABDCEF1234"}, + }, + want: "validation failed: must be between 1 and 100 characters", + }, + { + name: "invalid network settings id", + request: NetworkConfigurationRequest{ + Name: Ptr("updated-configuration-one"), + }, + want: "validation failed: exactly one network settings id must be specified", + }, + { + name: "invalid compute service", + request: NetworkConfigurationRequest{ + Name: Ptr("updated-configuration-one"), + ComputeService: Ptr(ComputeService("")), + NetworkSettingsIDs: []string{"56789ABDCEF1234"}, + }, + want: "validation failed: compute service can only be one of: none, actions", + }, + } + for _, tc := range validationTest { + _, _, err = client.Enterprise.CreateEnterpriseNetworkConfiguration(ctx, "e", tc.request) + if err == nil || err.Error() != tc.want { + t.Errorf("expected error to be %v, got %v", tc.want, err) + } + } + const methodName = "CreateEnterpriseNetworkConfiguration" testBadOptions(t, methodName, func() error { _, _, err = client.Enterprise.CreateEnterpriseNetworkConfiguration(ctx, "\ne", req) @@ -162,7 +197,7 @@ func TestEnterpriseService_GetEnterpriseNetworkConfiguration(t *testing.T) { testMethod(t, r, "GET") fmt.Fprintf(w, `{ "id": "123456789ABCDEF", - "name": "configuration_one", + "name": "configuration one", "compute_service": "actions", "network_settings_ids": [ "23456789ABDCEF1", @@ -178,9 +213,9 @@ func TestEnterpriseService_GetEnterpriseNetworkConfiguration(t *testing.T) { t.Errorf("Enterprise.GetEnterpriseNetworkConfiguration returned err: %v", err) } - want := &EnterpriseNetworkConfiguration{ + want := &NetworkConfiguration{ ID: Ptr("123456789ABCDEF"), - Name: Ptr("configuration_one"), + Name: Ptr("configuration one"), ComputeService: Ptr(ComputeService("actions")), NetworkSettingsIDs: []string{"23456789ABDCEF1", "3456789ABDCEF12"}, CreatedOn: &Timestamp{time.Date(2024, 12, 10, 19, 00, 15, 0, time.UTC)}, @@ -212,22 +247,20 @@ func TestEnterpriseService_UpdateEnterpriseNetworkConfiguration(t *testing.T) { testMethod(t, r, "PATCH") fmt.Fprintf(w, `{ "id": "123456789ABCDEF", - "name": "updated_configuration_one", + "name": "updated configuration one", "compute_service": "none", "network_settings_ids": [ - "456789ABDCEF123", - "56789ABDCEF1234" + "456789ABDCEF123" ], "created_on": "2024-12-10T19:00:15Z" }`) }) ctx := context.Background() - req := EnterpriseNetworkConfigurationRequest{ - Name: Ptr("updated_configuration_one"), + req := NetworkConfigurationRequest{ + Name: Ptr("updated-configuration-one"), NetworkSettingsIDs: []string{ "456789ABDCEF123", - "56789ABDCEF1234", }, ComputeService: Ptr(ComputeService("none")), } @@ -236,17 +269,54 @@ func TestEnterpriseService_UpdateEnterpriseNetworkConfiguration(t *testing.T) { t.Errorf("Enterprise.UpdateEnterpriseNetworkConfiguration returned error %v", err) } - want := &EnterpriseNetworkConfiguration{ + want := &NetworkConfiguration{ ID: Ptr("123456789ABCDEF"), - Name: Ptr("updated_configuration_one"), + Name: Ptr("updated configuration one"), ComputeService: Ptr(ComputeService("none")), - NetworkSettingsIDs: []string{"456789ABDCEF123", "56789ABDCEF1234"}, + NetworkSettingsIDs: []string{"456789ABDCEF123"}, CreatedOn: &Timestamp{time.Date(2024, 12, 10, 19, 00, 15, 0, time.UTC)}, } if !cmp.Equal(configuration, want) { t.Errorf("Enterprise.UpdateEnterpriseNetworkConfiguration mismatch (-want +get)\n%s", cmp.Diff(want, configuration)) } + validationTest := []struct { + name string + request NetworkConfigurationRequest + want string + }{ + { + name: "invalid network settings id", + request: NetworkConfigurationRequest{ + Name: Ptr(""), + NetworkSettingsIDs: []string{"56789ABDCEF1234"}, + }, + want: "validation failed: must be between 1 and 100 characters", + }, + { + name: "invalid network settings id", + request: NetworkConfigurationRequest{ + Name: Ptr("updated-configuration-one"), + }, + want: "validation failed: exactly one network settings id must be specified", + }, + { + name: "invalid compute service", + request: NetworkConfigurationRequest{ + Name: Ptr("updated-configuration-one"), + ComputeService: Ptr(ComputeService("something")), + NetworkSettingsIDs: []string{"56789ABDCEF1234"}, + }, + want: "validation failed: compute service can only be one of: none, actions", + }, + } + for _, tc := range validationTest { + _, _, err = client.Enterprise.UpdateEnterpriseNetworkConfiguration(ctx, "e", "123456789ABCDEF", tc.request) + if err == nil || err.Error() != tc.want { + t.Errorf("expected error to be %v, got %v", tc.want, err) + } + } + const methodName = "UpdateEnterpriseNetworkConfiguration" testBadOptions(t, methodName, func() error { _, _, err = client.Enterprise.UpdateEnterpriseNetworkConfiguration(ctx, "\ne", "123456789ABCDEF", req) @@ -308,7 +378,7 @@ func TestEnterpriseService_GetEnterpriseNetworkSettingsResource(t *testing.T) { t.Errorf("Enterprise.GetEnterpriseNetworkSettingsResource returned error %v", err) } - want := &EnterpriseNetworkSettingsResource{ + want := &NetworkSettingsResource{ ID: Ptr("220F78DACB92BBFBC5E6F22DE1CCF52309D"), NetworkConfigurationID: Ptr("934E208B3EE0BD60CF5F752C426BFB53562"), Name: Ptr("my_network_settings"), diff --git a/github/github-accessors.go b/github/github-accessors.go index 711d48a6a23..bb2ee2afe61 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -8606,102 +8606,6 @@ func (e *Enterprise) GetWebsiteURL() string { return *e.WebsiteURL } -// GetComputeService returns the ComputeService field. -func (e *EnterpriseNetworkConfiguration) GetComputeService() *ComputeService { - if e == nil { - return nil - } - return e.ComputeService -} - -// GetCreatedOn returns the CreatedOn field if it's non-nil, zero value otherwise. -func (e *EnterpriseNetworkConfiguration) GetCreatedOn() Timestamp { - if e == nil || e.CreatedOn == nil { - return Timestamp{} - } - return *e.CreatedOn -} - -// GetID returns the ID field if it's non-nil, zero value otherwise. -func (e *EnterpriseNetworkConfiguration) GetID() string { - if e == nil || e.ID == nil { - return "" - } - return *e.ID -} - -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (e *EnterpriseNetworkConfiguration) GetName() string { - if e == nil || e.Name == nil { - return "" - } - return *e.Name -} - -// GetComputeService returns the ComputeService field. -func (e *EnterpriseNetworkConfigurationRequest) GetComputeService() *ComputeService { - if e == nil { - return nil - } - return e.ComputeService -} - -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (e *EnterpriseNetworkConfigurationRequest) GetName() string { - if e == nil || e.Name == nil { - return "" - } - return *e.Name -} - -// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. -func (e *EnterpriseNetworkConfigurations) GetTotalCount() int64 { - if e == nil || e.TotalCount == nil { - return 0 - } - return *e.TotalCount -} - -// GetID returns the ID field if it's non-nil, zero value otherwise. -func (e *EnterpriseNetworkSettingsResource) GetID() string { - if e == nil || e.ID == nil { - return "" - } - return *e.ID -} - -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (e *EnterpriseNetworkSettingsResource) GetName() string { - if e == nil || e.Name == nil { - return "" - } - return *e.Name -} - -// GetNetworkConfigurationID returns the NetworkConfigurationID field if it's non-nil, zero value otherwise. -func (e *EnterpriseNetworkSettingsResource) GetNetworkConfigurationID() string { - if e == nil || e.NetworkConfigurationID == nil { - return "" - } - return *e.NetworkConfigurationID -} - -// GetRegion returns the Region field if it's non-nil, zero value otherwise. -func (e *EnterpriseNetworkSettingsResource) GetRegion() string { - if e == nil || e.Region == nil { - return "" - } - return *e.Region -} - -// GetSubnetID returns the SubnetID field if it's non-nil, zero value otherwise. -func (e *EnterpriseNetworkSettingsResource) GetSubnetID() string { - if e == nil || e.SubnetID == nil { - return "" - } - return *e.SubnetID -} - // GetAllowsPublicRepositories returns the AllowsPublicRepositories field if it's non-nil, zero value otherwise. func (e *EnterpriseRunnerGroup) GetAllowsPublicRepositories() bool { if e == nil || e.AllowsPublicRepositories == nil { @@ -14814,6 +14718,102 @@ func (m *MostRecentInstance) GetState() string { return *m.State } +// GetComputeService returns the ComputeService field. +func (n *NetworkConfiguration) GetComputeService() *ComputeService { + if n == nil { + return nil + } + return n.ComputeService +} + +// GetCreatedOn returns the CreatedOn field if it's non-nil, zero value otherwise. +func (n *NetworkConfiguration) GetCreatedOn() Timestamp { + if n == nil || n.CreatedOn == nil { + return Timestamp{} + } + return *n.CreatedOn +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (n *NetworkConfiguration) GetID() string { + if n == nil || n.ID == nil { + return "" + } + return *n.ID +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (n *NetworkConfiguration) GetName() string { + if n == nil || n.Name == nil { + return "" + } + return *n.Name +} + +// GetComputeService returns the ComputeService field. +func (n *NetworkConfigurationRequest) GetComputeService() *ComputeService { + if n == nil { + return nil + } + return n.ComputeService +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (n *NetworkConfigurationRequest) GetName() string { + if n == nil || n.Name == nil { + return "" + } + return *n.Name +} + +// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. +func (n *NetworkConfigurations) GetTotalCount() int64 { + if n == nil || n.TotalCount == nil { + return 0 + } + return *n.TotalCount +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (n *NetworkSettingsResource) GetID() string { + if n == nil || n.ID == nil { + return "" + } + return *n.ID +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (n *NetworkSettingsResource) GetName() string { + if n == nil || n.Name == nil { + return "" + } + return *n.Name +} + +// GetNetworkConfigurationID returns the NetworkConfigurationID field if it's non-nil, zero value otherwise. +func (n *NetworkSettingsResource) GetNetworkConfigurationID() string { + if n == nil || n.NetworkConfigurationID == nil { + return "" + } + return *n.NetworkConfigurationID +} + +// GetRegion returns the Region field if it's non-nil, zero value otherwise. +func (n *NetworkSettingsResource) GetRegion() string { + if n == nil || n.Region == nil { + return "" + } + return *n.Region +} + +// GetSubnetID returns the SubnetID field if it's non-nil, zero value otherwise. +func (n *NetworkSettingsResource) GetSubnetID() string { + if n == nil || n.SubnetID == nil { + return "" + } + return *n.SubnetID +} + // GetBase returns the Base field if it's non-nil, zero value otherwise. func (n *NewPullRequest) GetBase() string { if n == nil || n.Base == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 5a11f891f1d..ec1fe1c1155 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -11118,132 +11118,6 @@ func TestEnterprise_GetWebsiteURL(tt *testing.T) { e.GetWebsiteURL() } -func TestEnterpriseNetworkConfiguration_GetComputeService(tt *testing.T) { - tt.Parallel() - e := &EnterpriseNetworkConfiguration{} - e.GetComputeService() - e = nil - e.GetComputeService() -} - -func TestEnterpriseNetworkConfiguration_GetCreatedOn(tt *testing.T) { - tt.Parallel() - var zeroValue Timestamp - e := &EnterpriseNetworkConfiguration{CreatedOn: &zeroValue} - e.GetCreatedOn() - e = &EnterpriseNetworkConfiguration{} - e.GetCreatedOn() - e = nil - e.GetCreatedOn() -} - -func TestEnterpriseNetworkConfiguration_GetID(tt *testing.T) { - tt.Parallel() - var zeroValue string - e := &EnterpriseNetworkConfiguration{ID: &zeroValue} - e.GetID() - e = &EnterpriseNetworkConfiguration{} - e.GetID() - e = nil - e.GetID() -} - -func TestEnterpriseNetworkConfiguration_GetName(tt *testing.T) { - tt.Parallel() - var zeroValue string - e := &EnterpriseNetworkConfiguration{Name: &zeroValue} - e.GetName() - e = &EnterpriseNetworkConfiguration{} - e.GetName() - e = nil - e.GetName() -} - -func TestEnterpriseNetworkConfigurationRequest_GetComputeService(tt *testing.T) { - tt.Parallel() - e := &EnterpriseNetworkConfigurationRequest{} - e.GetComputeService() - e = nil - e.GetComputeService() -} - -func TestEnterpriseNetworkConfigurationRequest_GetName(tt *testing.T) { - tt.Parallel() - var zeroValue string - e := &EnterpriseNetworkConfigurationRequest{Name: &zeroValue} - e.GetName() - e = &EnterpriseNetworkConfigurationRequest{} - e.GetName() - e = nil - e.GetName() -} - -func TestEnterpriseNetworkConfigurations_GetTotalCount(tt *testing.T) { - tt.Parallel() - var zeroValue int64 - e := &EnterpriseNetworkConfigurations{TotalCount: &zeroValue} - e.GetTotalCount() - e = &EnterpriseNetworkConfigurations{} - e.GetTotalCount() - e = nil - e.GetTotalCount() -} - -func TestEnterpriseNetworkSettingsResource_GetID(tt *testing.T) { - tt.Parallel() - var zeroValue string - e := &EnterpriseNetworkSettingsResource{ID: &zeroValue} - e.GetID() - e = &EnterpriseNetworkSettingsResource{} - e.GetID() - e = nil - e.GetID() -} - -func TestEnterpriseNetworkSettingsResource_GetName(tt *testing.T) { - tt.Parallel() - var zeroValue string - e := &EnterpriseNetworkSettingsResource{Name: &zeroValue} - e.GetName() - e = &EnterpriseNetworkSettingsResource{} - e.GetName() - e = nil - e.GetName() -} - -func TestEnterpriseNetworkSettingsResource_GetNetworkConfigurationID(tt *testing.T) { - tt.Parallel() - var zeroValue string - e := &EnterpriseNetworkSettingsResource{NetworkConfigurationID: &zeroValue} - e.GetNetworkConfigurationID() - e = &EnterpriseNetworkSettingsResource{} - e.GetNetworkConfigurationID() - e = nil - e.GetNetworkConfigurationID() -} - -func TestEnterpriseNetworkSettingsResource_GetRegion(tt *testing.T) { - tt.Parallel() - var zeroValue string - e := &EnterpriseNetworkSettingsResource{Region: &zeroValue} - e.GetRegion() - e = &EnterpriseNetworkSettingsResource{} - e.GetRegion() - e = nil - e.GetRegion() -} - -func TestEnterpriseNetworkSettingsResource_GetSubnetID(tt *testing.T) { - tt.Parallel() - var zeroValue string - e := &EnterpriseNetworkSettingsResource{SubnetID: &zeroValue} - e.GetSubnetID() - e = &EnterpriseNetworkSettingsResource{} - e.GetSubnetID() - e = nil - e.GetSubnetID() -} - func TestEnterpriseRunnerGroup_GetAllowsPublicRepositories(tt *testing.T) { tt.Parallel() var zeroValue bool @@ -19183,6 +19057,132 @@ func TestMostRecentInstance_GetState(tt *testing.T) { m.GetState() } +func TestNetworkConfiguration_GetComputeService(tt *testing.T) { + tt.Parallel() + n := &NetworkConfiguration{} + n.GetComputeService() + n = nil + n.GetComputeService() +} + +func TestNetworkConfiguration_GetCreatedOn(tt *testing.T) { + tt.Parallel() + var zeroValue Timestamp + n := &NetworkConfiguration{CreatedOn: &zeroValue} + n.GetCreatedOn() + n = &NetworkConfiguration{} + n.GetCreatedOn() + n = nil + n.GetCreatedOn() +} + +func TestNetworkConfiguration_GetID(tt *testing.T) { + tt.Parallel() + var zeroValue string + n := &NetworkConfiguration{ID: &zeroValue} + n.GetID() + n = &NetworkConfiguration{} + n.GetID() + n = nil + n.GetID() +} + +func TestNetworkConfiguration_GetName(tt *testing.T) { + tt.Parallel() + var zeroValue string + n := &NetworkConfiguration{Name: &zeroValue} + n.GetName() + n = &NetworkConfiguration{} + n.GetName() + n = nil + n.GetName() +} + +func TestNetworkConfigurationRequest_GetComputeService(tt *testing.T) { + tt.Parallel() + n := &NetworkConfigurationRequest{} + n.GetComputeService() + n = nil + n.GetComputeService() +} + +func TestNetworkConfigurationRequest_GetName(tt *testing.T) { + tt.Parallel() + var zeroValue string + n := &NetworkConfigurationRequest{Name: &zeroValue} + n.GetName() + n = &NetworkConfigurationRequest{} + n.GetName() + n = nil + n.GetName() +} + +func TestNetworkConfigurations_GetTotalCount(tt *testing.T) { + tt.Parallel() + var zeroValue int64 + n := &NetworkConfigurations{TotalCount: &zeroValue} + n.GetTotalCount() + n = &NetworkConfigurations{} + n.GetTotalCount() + n = nil + n.GetTotalCount() +} + +func TestNetworkSettingsResource_GetID(tt *testing.T) { + tt.Parallel() + var zeroValue string + n := &NetworkSettingsResource{ID: &zeroValue} + n.GetID() + n = &NetworkSettingsResource{} + n.GetID() + n = nil + n.GetID() +} + +func TestNetworkSettingsResource_GetName(tt *testing.T) { + tt.Parallel() + var zeroValue string + n := &NetworkSettingsResource{Name: &zeroValue} + n.GetName() + n = &NetworkSettingsResource{} + n.GetName() + n = nil + n.GetName() +} + +func TestNetworkSettingsResource_GetNetworkConfigurationID(tt *testing.T) { + tt.Parallel() + var zeroValue string + n := &NetworkSettingsResource{NetworkConfigurationID: &zeroValue} + n.GetNetworkConfigurationID() + n = &NetworkSettingsResource{} + n.GetNetworkConfigurationID() + n = nil + n.GetNetworkConfigurationID() +} + +func TestNetworkSettingsResource_GetRegion(tt *testing.T) { + tt.Parallel() + var zeroValue string + n := &NetworkSettingsResource{Region: &zeroValue} + n.GetRegion() + n = &NetworkSettingsResource{} + n.GetRegion() + n = nil + n.GetRegion() +} + +func TestNetworkSettingsResource_GetSubnetID(tt *testing.T) { + tt.Parallel() + var zeroValue string + n := &NetworkSettingsResource{SubnetID: &zeroValue} + n.GetSubnetID() + n = &NetworkSettingsResource{} + n.GetSubnetID() + n = nil + n.GetSubnetID() +} + func TestNewPullRequest_GetBase(tt *testing.T) { tt.Parallel() var zeroValue string diff --git a/github/orgs_network_configurations.go b/github/orgs_network_configurations.go new file mode 100644 index 00000000000..82a819c2040 --- /dev/null +++ b/github/orgs_network_configurations.go @@ -0,0 +1,236 @@ +// Copyright 2025 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" + "errors" + "fmt" + "regexp" +) + +// ComputeService represents a hosted compute service the network configuration supports. +type ComputeService string + +const ( + ComputeServiceNone ComputeService = "none" + ComputeServiceActions ComputeService = "actions" + ComputeServiceCodespaces ComputeService = "codespaces" +) + +// NetworkConfigurations represents a hosted compute network configuration. This type is identical +// for enterprise and organization endpoints. +type NetworkConfigurations struct { + TotalCount *int64 `json:"total_count,omitempty"` + NetworkConfigurations []*NetworkConfiguration `json:"network_configurations,omitempty"` +} + +// NetworkConfiguration represents a hosted compute network configurations. This type is identical +// for enterprise and organization endpoints. +type NetworkConfiguration struct { + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ComputeService *ComputeService `json:"compute_service,omitempty"` + NetworkSettingsIDs []string `json:"network_settings_ids,omitempty"` + CreatedOn *Timestamp `json:"created_on"` +} + +// NetworkSettingsResource represents a hosted compute network settings resource. This type is identical +// for enterprise and organization endpoints. +type NetworkSettingsResource struct { + ID *string `json:"id,omitempty"` + NetworkConfigurationID *string `json:"network_configuration_id,omitempty"` + Name *string `json:"name,omitempty"` + SubnetID *string `json:"subnet_id,omitempty"` + Region *string `json:"region,omitempty"` +} + +func validateComputeService(compute *ComputeService) error { + if compute == nil { + return nil + } + if *compute != ComputeServiceNone && *compute != ComputeServiceActions { + return errors.New("compute service can only be one of: none, actions") + } + return nil +} + +var validNetworkNameRE = regexp.MustCompile(`^[a-zA-Z0-9._-]+$`) + +func validateNetworkName(name string) error { + if len(name) < 1 || len(name) > 100 { + return errors.New("must be between 1 and 100 characters") + } + if !validNetworkNameRE.MatchString(name) { + return errors.New("may only contain upper and lowercase letters a-z, numbers 0-9, '.', '-', and '_'") + } + return nil +} + +func validateNetworkSettingsID(settingsID []string) error { + if len(settingsID) != 1 { + return errors.New("exactly one network settings id must be specified") + } + return nil +} + +func validateNetworkConfigurationRequest(req NetworkConfigurationRequest) error { + networkName := req.GetName() + if err := validateNetworkName(networkName); err != nil { + return err + } + + computeService := req.GetComputeService() + if err := validateComputeService(computeService); err != nil { + return err + } + + networkIDs := req.NetworkSettingsIDs + if err := validateNetworkSettingsID(networkIDs); err != nil { + return err + } + return nil +} + +// NetworkConfigurationRequest represents a request to create or update a network configuration for an organization. +type NetworkConfigurationRequest struct { + Name *string `json:"name,omitempty"` + ComputeService *ComputeService `json:"compute_service,omitempty"` + NetworkSettingsIDs []string `json:"network_settings_ids,omitempty"` +} + +// ListNetworkConfigurations lists all hosted compute network configurations configured in an organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#list-hosted-compute-network-configurations-for-an-organization +// +//meta:operation GET /orgs/{org}/settings/network-configurations +func (s *OrganizationsService) ListNetworkConfigurations(ctx context.Context, org string, opts *ListOptions) (*NetworkConfigurations, *Response, error) { + u := fmt.Sprintf("orgs/%v/settings/network-configurations", org) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + configurations := &NetworkConfigurations{} + resp, err := s.client.Do(ctx, req, configurations) + if err != nil { + return nil, resp, err + } + return configurations, resp, nil +} + +// CreateNetworkConfiguration creates a hosted compute network configuration for an organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#create-a-hosted-compute-network-configuration-for-an-organization +// +//meta:operation POST /orgs/{org}/settings/network-configurations +func (s *OrganizationsService) CreateNetworkConfiguration(ctx context.Context, org string, createReq NetworkConfigurationRequest) (*NetworkConfiguration, *Response, error) { + if err := validateNetworkConfigurationRequest(createReq); err != nil { + return nil, nil, fmt.Errorf("validation failed: %w", err) + } + + u := fmt.Sprintf("orgs/%v/settings/network-configurations", org) + req, err := s.client.NewRequest("POST", u, createReq) + if err != nil { + return nil, nil, err + } + + configuration := &NetworkConfiguration{} + resp, err := s.client.Do(ctx, req, configuration) + if err != nil { + return nil, resp, err + } + return configuration, resp, nil +} + +// GetNetworkConfiguration gets a hosted compute network configuration configured in an organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#get-a-hosted-compute-network-configuration-for-an-organization +// +//meta:operation GET /orgs/{org}/settings/network-configurations/{network_configuration_id} +func (s *OrganizationsService) GetNetworkConfiguration(ctx context.Context, org, networkID string) (*NetworkConfiguration, *Response, error) { + u := fmt.Sprintf("orgs/%v/settings/network-configurations/%v", org, networkID) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + configuration := &NetworkConfiguration{} + resp, err := s.client.Do(ctx, req, configuration) + if err != nil { + return nil, resp, err + } + return configuration, resp, nil +} + +// UpdateNetworkConfiguration updates a hosted compute network configuration for an organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#update-a-hosted-compute-network-configuration-for-an-organization +// +//meta:operation PATCH /orgs/{org}/settings/network-configurations/{network_configuration_id} +func (s *OrganizationsService) UpdateNetworkConfiguration(ctx context.Context, org, networkID string, updateReq NetworkConfigurationRequest) (*NetworkConfiguration, *Response, error) { + if err := validateNetworkConfigurationRequest(updateReq); err != nil { + return nil, nil, fmt.Errorf("validation failed: %w", err) + } + + u := fmt.Sprintf("orgs/%v/settings/network-configurations/%v", org, networkID) + req, err := s.client.NewRequest("PATCH", u, updateReq) + if err != nil { + return nil, nil, err + } + + configuration := &NetworkConfiguration{} + resp, err := s.client.Do(ctx, req, configuration) + if err != nil { + return nil, resp, err + } + return configuration, resp, nil +} + +// DeleteNetworkConfigurations deletes a hosted compute network configuration from an organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#delete-a-hosted-compute-network-configuration-from-an-organization +// +//meta:operation DELETE /orgs/{org}/settings/network-configurations/{network_configuration_id} +func (s *OrganizationsService) DeleteNetworkConfigurations(ctx context.Context, org, networkID string) (*Response, error) { + u := fmt.Sprintf("orgs/%v/settings/network-configurations/%v", org, networkID) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + configuration := &NetworkConfiguration{} + resp, err := s.client.Do(ctx, req, configuration) + if err != nil { + return resp, err + } + return resp, nil +} + +// GetNetworkConfigurationResource gets a hosted compute network settings resource configured for an organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#get-a-hosted-compute-network-settings-resource-for-an-organization +// +//meta:operation GET /orgs/{org}/settings/network-settings/{network_settings_id} +func (s *OrganizationsService) GetNetworkConfigurationResource(ctx context.Context, org, networkID string) (*NetworkSettingsResource, *Response, error) { + u := fmt.Sprintf("orgs/%v/settings/network-settings/%v", org, networkID) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + resource := &NetworkSettingsResource{} + resp, err := s.client.Do(ctx, req, resource) + if err != nil { + return nil, resp, err + } + return resource, resp, nil +} diff --git a/github/orgs_network_configurations_test.go b/github/orgs_network_configurations_test.go new file mode 100644 index 00000000000..51fec33f30b --- /dev/null +++ b/github/orgs_network_configurations_test.go @@ -0,0 +1,489 @@ +// Copyright 2025 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" + "time" + + "github.com/google/go-cmp/cmp" +) + +func TestOrganizationsService_ListOrgsNetworkConfigurations(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/orgs/o/settings/network-configurations", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{"page": "1", "per_page": "3"}) + fmt.Fprintf(w, `{ + "total_count": 3, + "network_configurations": [ + { + "id": "123456789ABCDEF", + "name": "Network Configuration One", + "compute_service": "actions", + "network_settings_ids": [ + "23456789ABDCEF1", + "3456789ABDCEF12" + ], + "created_on": "2024-04-09T17:30:15Z" + }, + { + "id": "456789ABDCEF123", + "name": "Network Configuration Two", + "compute_service": "none", + "network_settings_ids": [ + "56789ABDCEF1234", + "6789ABDCEF12345" + ], + "created_on": "2024-11-02T4:30:30Z" + }, + { + "id": "789ABDCEF123456", + "name": "Network Configuration Three", + "compute_service": "codespaces", + "network_settings_ids": [ + "56789ABDCEF1234", + "6789ABDCEF12345" + ], + "created_on": "2024-12-10T19:30:45Z" + } + ] + }`) + }) + + ctx := context.Background() + + opts := &ListOptions{Page: 1, PerPage: 3} + configurations, _, err := client.Organizations.ListNetworkConfigurations(ctx, "o", opts) + if err != nil { + t.Errorf("Organizations.ListNetworkConfigurations returned error %v", err) + } + want := &NetworkConfigurations{ + TotalCount: Ptr(int64(3)), + NetworkConfigurations: []*NetworkConfiguration{ + { + ID: Ptr("123456789ABCDEF"), + Name: Ptr("Network Configuration One"), + ComputeService: Ptr(ComputeService("actions")), + NetworkSettingsIDs: []string{ + "23456789ABDCEF1", + "3456789ABDCEF12", + }, + CreatedOn: &Timestamp{time.Date(2024, 4, 9, 17, 30, 15, 0, time.UTC)}, + }, + { + ID: Ptr("456789ABDCEF123"), + Name: Ptr("Network Configuration Two"), + ComputeService: Ptr(ComputeService("none")), + NetworkSettingsIDs: []string{ + "56789ABDCEF1234", + "6789ABDCEF12345", + }, + CreatedOn: &Timestamp{time.Date(2024, 11, 2, 4, 30, 30, 0, time.UTC)}, + }, + { + ID: Ptr("789ABDCEF123456"), + Name: Ptr("Network Configuration Three"), + ComputeService: Ptr(ComputeService("codespaces")), + NetworkSettingsIDs: []string{ + "56789ABDCEF1234", + "6789ABDCEF12345", + }, + CreatedOn: &Timestamp{time.Date(2024, 12, 10, 19, 30, 45, 0, time.UTC)}, + }, + }, + } + if !cmp.Equal(want, configurations) { + t.Errorf("Organizations.ListNetworkConfigurations mismatch (-want +got):\n%s", cmp.Diff(want, configurations)) + } + + const methodName = "ListNetworkConfigurations" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.ListNetworkConfigurations(ctx, "\no", opts) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.ListNetworkConfigurations(ctx, "o", opts) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_CreateOrgsNetworkConfiguration(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/orgs/o/settings/network-configurations", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + fmt.Fprintf(w, `{ + "id": "456789ABDCEF123", + "name": "network-configuration-two", + "compute_service": "none", + "network_settings_ids": [ + "56789ABDCEF1234" + ], + "created_on": "2024-11-02T4:30:30Z" + }`) + }) + + ctx := context.Background() + + req := NetworkConfigurationRequest{ + Name: Ptr("network-configuration-two"), + ComputeService: Ptr(ComputeService("none")), + NetworkSettingsIDs: []string{ + "56789ABDCEF1234", + }, + } + + configuration, _, err := client.Organizations.CreateNetworkConfiguration(ctx, "o", req) + if err != nil { + t.Errorf("Organizations.CreateNetworkConfiguration returned error %v", err) + } + + want := &NetworkConfiguration{ + ID: Ptr("456789ABDCEF123"), + Name: Ptr("network-configuration-two"), + ComputeService: Ptr(ComputeService("none")), + NetworkSettingsIDs: []string{ + "56789ABDCEF1234", + }, + CreatedOn: &Timestamp{time.Date(2024, 11, 2, 4, 30, 30, 0, time.UTC)}, + } + + if !cmp.Equal(want, configuration) { + t.Errorf("Organizations.CreateNetworkConfiguration mismatch (-want +got):\n%s", cmp.Diff(want, configuration)) + } + + validationTests := []struct { + name string + request NetworkConfigurationRequest + want string + }{ + { + name: "invalid network configuration name length", + request: NetworkConfigurationRequest{ + Name: Ptr(""), + ComputeService: Ptr(ComputeService("none")), + NetworkSettingsIDs: []string{ + "56789ABDCEF1234", + }, + }, + want: "validation failed: must be between 1 and 100 characters", + }, + { + name: "invalid network configuration name", + // may only contain upper and lowercase letters a-z, numbers 0-9, '.', '-', and '_'. + request: NetworkConfigurationRequest{ + Name: Ptr("network configuration two"), + NetworkSettingsIDs: []string{ + "56789ABDCEF1234", + }, + }, + want: "validation failed: may only contain upper and lowercase letters a-z, numbers 0-9, '.', '-', and '_'", + }, + { + name: "invalid network settings ids", + request: NetworkConfigurationRequest{ + Name: Ptr("network-configuration-two"), + ComputeService: Ptr(ComputeService("none")), + NetworkSettingsIDs: []string{ + "56789ABDCEF1234", + "3456789ABDCEF12", + }, + }, + want: "validation failed: exactly one network settings id must be specified", + }, + { + name: "invalid compute service", + request: NetworkConfigurationRequest{ + Name: Ptr("network-configuration-two"), + ComputeService: Ptr(ComputeService("codespaces")), + NetworkSettingsIDs: []string{ + "56789ABDCEF1234", + }, + }, + want: "validation failed: compute service can only be one of: none, actions", + }, + } + + for _, tc := range validationTests { + _, _, err := client.Organizations.CreateNetworkConfiguration(ctx, "o", tc.request) + if err == nil || err.Error() != tc.want { + t.Errorf("expected error to be %v, got %v", tc.want, err) + } + } + + const methodName = "CreateNetworkConfiguration" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.CreateNetworkConfiguration(ctx, "\no", req) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.CreateNetworkConfiguration(ctx, "o", req) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_GetOrgsNetworkConfiguration(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/orgs/o/settings/network-configurations/789ABDCEF123456", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprintf(w, `{ + "id": "789ABDCEF123456", + "name": "Network Configuration Three", + "compute_service": "codespaces", + "network_settings_ids": [ + "56789ABDCEF1234", + "6789ABDCEF12345" + ], + "created_on": "2024-12-10T19:30:45Z" + }`) + }) + + ctx := context.Background() + + configuration, _, err := client.Organizations.GetNetworkConfiguration(ctx, "o", "789ABDCEF123456") + if err != nil { + t.Errorf("Organizations.GetNetworkConfiguration returned error: %v", err) + } + want := &NetworkConfiguration{ + ID: Ptr("789ABDCEF123456"), + Name: Ptr("Network Configuration Three"), + ComputeService: Ptr(ComputeService("codespaces")), + NetworkSettingsIDs: []string{ + "56789ABDCEF1234", + "6789ABDCEF12345", + }, + CreatedOn: &Timestamp{time.Date(2024, 12, 10, 19, 30, 45, 0, time.UTC)}, + } + if !cmp.Equal(want, configuration) { + t.Errorf("Organizations.GetNetworkConfiguration mismatch (-want +got):\n%s", cmp.Diff(want, configuration)) + } + + const methodName = "GetNetworkConfiguration" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.GetNetworkConfiguration(ctx, "\no", "789ABDCEF123456") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.GetNetworkConfiguration(ctx, "o", "789ABDCEF123456") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_UpdateOrgsNetworkConfiguration(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/orgs/o/settings/network-configurations/789ABDCEF123456", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PATCH") + fmt.Fprintf(w, `{ + "id": "789ABDCEF123456", + "name": "Network Configuration Three Update", + "compute_service": "actions", + "network_settings_ids": [ + "56789ABDCEF1234", + "6789ABDCEF12345" + ], + "created_on": "2024-12-10T19:30:45Z" + }`) + }) + + ctx := context.Background() + + req := NetworkConfigurationRequest{ + Name: Ptr("network-configuration-three-update"), + ComputeService: Ptr(ComputeService("actions")), + NetworkSettingsIDs: []string{ + "56789ABDCEF1234", + }, + } + configuration, _, err := client.Organizations.UpdateNetworkConfiguration(ctx, "o", "789ABDCEF123456", req) + if err != nil { + t.Errorf("Organizations.UpdateNetworkConfiguration returned error: %v", err) + } + + want := &NetworkConfiguration{ + ID: Ptr("789ABDCEF123456"), + Name: Ptr("Network Configuration Three Update"), + ComputeService: Ptr(ComputeService("actions")), + NetworkSettingsIDs: []string{ + "56789ABDCEF1234", + "6789ABDCEF12345", + }, + CreatedOn: &Timestamp{time.Date(2024, 12, 10, 19, 30, 45, 0, time.UTC)}, + } + if !cmp.Equal(want, configuration) { + t.Errorf("Organizations.UpdateNetworkConfiguration mismatch (-want +got):\n%s", cmp.Diff(want, configuration)) + } + + validationTests := []struct { + name string + request NetworkConfigurationRequest + want string + }{ + { + name: "invalid network configuration name length", + request: NetworkConfigurationRequest{ + Name: Ptr(""), + ComputeService: Ptr(ComputeService("none")), + NetworkSettingsIDs: []string{ + "56789ABDCEF1234", + }, + }, + want: "validation failed: must be between 1 and 100 characters", + }, + { + name: "invalid network configuration name", + // may only contain upper and lowercase letters a-z, numbers 0-9, '.', '-', and '_'. + request: NetworkConfigurationRequest{ + Name: Ptr("network configuration three update"), + NetworkSettingsIDs: []string{ + "56789ABDCEF1234", + }, + }, + want: "validation failed: may only contain upper and lowercase letters a-z, numbers 0-9, '.', '-', and '_'", + }, + { + name: "invalid network settings ids", + request: NetworkConfigurationRequest{ + Name: Ptr("network-configuration-three-update"), + ComputeService: Ptr(ComputeService("none")), + NetworkSettingsIDs: []string{ + "56789ABDCEF1234", + "3456789ABDCEF12", + }, + }, + want: "validation failed: exactly one network settings id must be specified", + }, + { + name: "invalid compute service", + request: NetworkConfigurationRequest{ + Name: Ptr("network-configuration-three-update"), + ComputeService: Ptr(ComputeService("codespaces")), + NetworkSettingsIDs: []string{ + "56789ABDCEF1234", + }, + }, + want: "validation failed: compute service can only be one of: none, actions", + }, + } + + for _, tc := range validationTests { + _, _, err := client.Organizations.UpdateNetworkConfiguration(ctx, "o", "789ABDCEF123456", tc.request) + if err == nil || err.Error() != tc.want { + t.Errorf("expected error to be %v, got %v", tc.want, err) + } + } + + const methodName = "UpdateNetworkConfiguration" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.UpdateNetworkConfiguration(ctx, "\no", "789ABDCEF123456", req) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.UpdateNetworkConfiguration(ctx, "o", "789ABDCEF123456", req) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_DeleteOrgsNetworkConfiguration(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/orgs/o/settings/network-configurations/789ABDCEF123456", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + }) + + ctx := context.Background() + _, err := client.Organizations.DeleteNetworkConfigurations(ctx, "o", "789ABDCEF123456") + if err != nil { + t.Errorf("Organizations.DeleteNetworkConfigurations returned error %v", err) + } + + const methodName = "DeleteNetworkConfigurations" + testBadOptions(t, methodName, func() error { + _, err = client.Organizations.DeleteNetworkConfigurations(ctx, "\ne", "123456789ABCDEF") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Organizations.DeleteNetworkConfigurations(ctx, "e", "123456789ABCDEF") + }) +} + +func TestOrganizationsService_GetOrgsNetworkConfigurationResource(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/orgs/o/settings/network-settings/789ABDCEF123456", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprintf(w, `{ + "id": "220F78DACB92BBFBC5E6F22DE1CCF52309D", + "network_configuration_id": "934E208B3EE0BD60CF5F752C426BFB53562", + "name": "my_network_settings", + "subnet_id": "/subscriptions/14839728-3ad9-43ab-bd2b-fa6ad0f75e2a/resourceGroups/my-rg/providers/Microsoft.Network/virtualNetworks/my-vnet/subnets/my-subnet", + "region": "germanywestcentral" + } + `) + }) + + ctx := context.Background() + + resource, _, err := client.Organizations.GetNetworkConfigurationResource(ctx, "o", "789ABDCEF123456") + if err != nil { + t.Errorf("Organizations.GetNetworkConfigurationResource returned error %v", err) + } + + want := &NetworkSettingsResource{ + ID: Ptr("220F78DACB92BBFBC5E6F22DE1CCF52309D"), + Name: Ptr("my_network_settings"), + NetworkConfigurationID: Ptr("934E208B3EE0BD60CF5F752C426BFB53562"), + SubnetID: Ptr("/subscriptions/14839728-3ad9-43ab-bd2b-fa6ad0f75e2a/resourceGroups/my-rg/providers/Microsoft.Network/virtualNetworks/my-vnet/subnets/my-subnet"), + Region: Ptr("germanywestcentral"), + } + + if !cmp.Equal(want, resource) { + t.Errorf("Organizations.GetNetworkConfigurationResource mismatch (-want +got):\n%s", cmp.Diff(want, resource)) + } + + const methodName = "GetNetworkConfiguration" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.GetNetworkConfigurationResource(ctx, "\no", "789ABDCEF123456") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.GetNetworkConfigurationResource(ctx, "o", "789ABDCEF123456") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} From fbc49d02d4bf78e9061fe7fbe648f7509c47aa99 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Mar 2025 23:59:08 -0400 Subject: [PATCH 672/751] build(deps): bump golang.org/x/net from 0.33.0 to 0.36.0 in /example (#3514) --- example/go.mod | 12 ++++++------ example/go.sum | 24 ++++++++++++------------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/example/go.mod b/example/go.mod index 58560bac535..54289ff1239 100644 --- a/example/go.mod +++ b/example/go.mod @@ -8,8 +8,8 @@ require ( github.com/gofri/go-github-ratelimit v1.0.3 github.com/google/go-github/v69 v69.2.0 github.com/sigstore/sigstore-go v0.6.1 - golang.org/x/crypto v0.32.0 - golang.org/x/term v0.28.0 + golang.org/x/crypto v0.35.0 + golang.org/x/term v0.29.0 google.golang.org/appengine v1.6.8 ) @@ -87,10 +87,10 @@ require ( go.uber.org/zap v1.27.0 // indirect golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 // indirect golang.org/x/mod v0.20.0 // indirect - golang.org/x/net v0.33.0 // indirect - golang.org/x/sync v0.10.0 // indirect - golang.org/x/sys v0.29.0 // indirect - golang.org/x/text v0.21.0 // indirect + golang.org/x/net v0.36.0 // indirect + golang.org/x/sync v0.11.0 // indirect + golang.org/x/sys v0.30.0 // indirect + golang.org/x/text v0.22.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/example/go.sum b/example/go.sum index 1c2cbf5ba24..70f84d9efe4 100644 --- a/example/go.sum +++ b/example/go.sum @@ -362,8 +362,8 @@ golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= -golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= +golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs= +golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ= golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 h1:hNQpMuAJe5CtcUqCXaWga3FHu+kQvCqcsoVaQgSV60o= golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= @@ -377,16 +377,16 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= -golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.36.0 h1:vWF2fRbw4qslQsQzgFqZff+BItCvGFQqKzKIzx1rmoA= +golang.org/x/net v0.36.0/go.mod h1:bFmbeoIPfrw4sMHNhb4J9f6+tPziuGjq7Jk/38fxi1I= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE= golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= -golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= +golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -396,15 +396,15 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= -golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= +golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= -golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= +golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU= +golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -413,8 +413,8 @@ golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= -golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= +golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= From f88b6c8cfaf7ccd03a9ca0ec6024e97db2f20107 Mon Sep 17 00:00:00 2001 From: Gal Ofri Date: Fri, 14 Mar 2025 23:52:35 +0700 Subject: [PATCH 673/751] docs: Update readme and examples for updated go-github-ratelimit and introduce go-github-pagination (#3504) --- README.md | 9 ++++++++- example/go.mod | 3 ++- example/go.sum | 6 ++++-- example/ratelimit/main.go | 32 +++++++++++++++++++++----------- 4 files changed, 35 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index c7b9dcef090..397a7a74c79 100644 --- a/README.md +++ b/README.md @@ -233,7 +233,7 @@ repos, _, err := client.Repositories.List(context.WithValue(ctx, github.SleepUnt ``` You can use [gofri/go-github-ratelimit](https://github.com/gofri/go-github-ratelimit) to handle -secondary rate limit sleep-and-retry for you. +secondary rate limit sleep-and-retry for you, as well as primary rate limit abuse-prevention and callback triggering. Learn more about GitHub secondary rate limiting in ["About secondary rate limits"](https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#about-secondary-rate-limits). @@ -347,6 +347,13 @@ for repo := range repos.All() { For complete usage of `enrichman/gh-iter`, see the full [package docs](https://github.com/enrichman/gh-iter). +#### Middleware #### + +You can use [gofri/go-github-pagination](https://github.com/gofri/go-github-pagination) to handle +pagination for you. It supports both sync and async modes, as well as customizations. +By default, the middleware automatically paginates through all pages, aggregates results, and returns them as an array. +See `example/ratelimit/main.go` for usage. + ### Webhooks ### `go-github` provides structs for almost all [GitHub webhook events][] as well as functions to validate them and unmarshal JSON payloads from `http.Request` structs. diff --git a/example/go.mod b/example/go.mod index 54289ff1239..34b1f2e4d96 100644 --- a/example/go.mod +++ b/example/go.mod @@ -5,7 +5,8 @@ go 1.23.0 require ( github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 - github.com/gofri/go-github-ratelimit v1.0.3 + github.com/gofri/go-github-pagination v1.0.0 + github.com/gofri/go-github-ratelimit/v2 v2.0.2 github.com/google/go-github/v69 v69.2.0 github.com/sigstore/sigstore-go v0.6.1 golang.org/x/crypto v0.35.0 diff --git a/example/go.sum b/example/go.sum index 70f84d9efe4..7a39a6ed7d9 100644 --- a/example/go.sum +++ b/example/go.sum @@ -134,8 +134,10 @@ github.com/go-test/deep v1.1.1 h1:0r/53hagsehfO4bzD2Pgr/+RgHqhmf+k1Bpse2cTu1U= github.com/go-test/deep v1.1.1/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofri/go-github-ratelimit v1.0.3 h1:Ocs2jaYokZDzgvqaajX+g04dqFyVqL0JQzoO7d2wmlk= -github.com/gofri/go-github-ratelimit v1.0.3/go.mod h1:OnCi5gV+hAG/LMR7llGhU7yHt44se9sYgKPnafoL7RY= +github.com/gofri/go-github-pagination v1.0.0 h1:nnCi+1xT5ybqY/plctISgiQPWZOtfSciVQlbx/hM/Yw= +github.com/gofri/go-github-pagination v1.0.0/go.mod h1:Qij55Fb4fNPjam3SB+8cLnqp4pgR8RGMyIspYXcyHX0= +github.com/gofri/go-github-ratelimit/v2 v2.0.2 h1:gS8wAS1jTmlWGdTjAM7KIpsLjwY1S0S/gKK5hthfSXM= +github.com/gofri/go-github-ratelimit/v2 v2.0.2/go.mod h1:YBQt4gTbdcbMjJFT05YFEaECwH78P5b0IwrnbLiHGdE= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-jwt/jwt/v4 v4.5.1 h1:JdqV9zKUdtaa9gdPlywC3aeoEsR681PlKC+4F5gQgeo= github.com/golang-jwt/jwt/v4 v4.5.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= diff --git a/example/ratelimit/main.go b/example/ratelimit/main.go index 32596bc3a96..70c7424c437 100644 --- a/example/ratelimit/main.go +++ b/example/ratelimit/main.go @@ -3,16 +3,20 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// The ratelimit command demonstrates using the github_ratelimit.SecondaryRateLimitWaiter. +// The ratelimit command demonstrates using the github_ratelimit as well as github_pagination. // By using the waiter, the client automatically sleeps and retry requests // when it hits secondary rate limits. +// It also prevents the client from abusing the API in case of a primary rate limit. package main import ( "context" "fmt" - "github.com/gofri/go-github-ratelimit/github_ratelimit" + "github.com/gofri/go-github-pagination/githubpagination" + "github.com/gofri/go-github-ratelimit/v2/github_ratelimit" + "github.com/gofri/go-github-ratelimit/v2/github_ratelimit/github_primary_ratelimit" + "github.com/gofri/go-github-ratelimit/v2/github_ratelimit/github_secondary_ratelimit" "github.com/google/go-github/v69/github" ) @@ -21,22 +25,28 @@ func main() { fmt.Print("Enter GitHub username: ") fmt.Scanf("%s", &username) - rateLimiter, err := github_ratelimit.NewRateLimitWaiterClient(nil) - if err != nil { - fmt.Printf("Error: %v\n", err) - return - } + rateLimiter := github_ratelimit.New(nil, + github_primary_ratelimit.WithLimitDetectedCallback(func(ctx *github_primary_ratelimit.CallbackContext) { + fmt.Printf("Primary rate limit detected: category %s, reset time: %v\n", ctx.Category, ctx.ResetTime) + }), + github_secondary_ratelimit.WithLimitDetectedCallback(func(ctx *github_secondary_ratelimit.CallbackContext) { + fmt.Printf("Secondary rate limit detected: reset time: %v, total sleep time: %v\n", ctx.ResetTime, ctx.TotalSleepTime) + }), + ) - client := github.NewClient(rateLimiter) + paginator := githubpagination.NewClient(rateLimiter, + githubpagination.WithPerPage(100), // default to 100 results per page + ) + client := github.NewClient(paginator) // arbitrary usage of the client - organizations, _, err := client.Organizations.List(context.Background(), username, nil) + repos, _, err := client.Repositories.ListByUser(context.Background(), username, nil) if err != nil { fmt.Printf("Error: %v\n", err) return } - for i, organization := range organizations { - fmt.Printf("%v. %v\n", i+1, organization.GetLogin()) + for i, repo := range repos { + fmt.Printf("%v. %v\n", i+1, repo.GetName()) } } From 04573bec7b75d11100344833914c9e6a50fe490a Mon Sep 17 00:00:00 2001 From: Andreas Jaggi Date: Sat, 15 Mar 2025 23:46:53 +0100 Subject: [PATCH 674/751] Add validity filter to secret scanning alert list options (#3516) --- github/secret_scanning.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/github/secret_scanning.go b/github/secret_scanning.go index 35322cf6625..4eeeba3df78 100644 --- a/github/secret_scanning.go +++ b/github/secret_scanning.go @@ -68,6 +68,10 @@ type SecretScanningAlertListOptions struct { // Valid resolutions are false_positive, wont_fix, revoked, pattern_edited, pattern_deleted or used_in_tests. Resolution string `url:"resolution,omitempty"` + // A comma-separated list of validities that, when present, will return alerts that match the validities in this list. + // Valid options are active, inactive, and unknown. + Validity string `url:"validity,omitempty"` + // The direction to sort the results by. Possible values are: asc, desc. Default: desc. Direction string `url:"direction,omitempty"` From 7a89ae9f30d16d7ca821a3e883cbd9ef0b64dd05 Mon Sep 17 00:00:00 2001 From: Adrian Saunders <56205143+adrian-saunders@users.noreply.github.com> Date: Mon, 17 Mar 2025 17:59:02 +0000 Subject: [PATCH 675/751] refactor!: Update package types to align with webhook event (#3515) BREAKING CHANGE: `PackageVersion.Body` and `PackageVersion.Metadata` are both now `json.RawMessage`. --- github/gen-accessors.go | 2 + github/github-accessors.go | 480 ++++++++++++++++++++++-- github/github-accessors_test.go | 639 ++++++++++++++++++++++++++++++-- github/github-stringify_test.go | 126 ++++++- github/orgs_packages_test.go | 51 ++- github/packages.go | 241 ++++++++++-- github/packages_test.go | 639 +++++++++++++++++++++++++++++++- github/users_packages_test.go | 101 +++-- 8 files changed, 2083 insertions(+), 196 deletions(-) diff --git a/github/gen-accessors.go b/github/gen-accessors.go index 261b945e426..66450fb7ae9 100644 --- a/github/gen-accessors.go +++ b/github/gen-accessors.go @@ -45,6 +45,8 @@ var ( "ErrorResponse.GetResponse": true, "RateLimitError.GetResponse": true, "AbuseRateLimitError.GetResponse": true, + "PackageVersion.GetBody": true, + "PackageVersion.GetMetadata": true, } // skipStructs lists structs to skip. skipStructs = map[string]bool{ diff --git a/github/github-accessors.go b/github/github-accessors.go index bb2ee2afe61..40d935f1719 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -15814,6 +15814,22 @@ func (p *Package) GetCreatedAt() Timestamp { return *p.CreatedAt } +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (p *Package) GetDescription() string { + if p == nil || p.Description == nil { + return "" + } + return *p.Description +} + +// GetEcosystem returns the Ecosystem field if it's non-nil, zero value otherwise. +func (p *Package) GetEcosystem() string { + if p == nil || p.Ecosystem == nil { + return "" + } + return *p.Ecosystem +} + // GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. func (p *Package) GetHTMLURL() string { if p == nil || p.HTMLURL == nil { @@ -15838,6 +15854,14 @@ func (p *Package) GetName() string { return *p.Name } +// GetNamespace returns the Namespace field if it's non-nil, zero value otherwise. +func (p *Package) GetNamespace() string { + if p == nil || p.Namespace == nil { + return "" + } + return *p.Namespace +} + // GetOwner returns the Owner field. func (p *Package) GetOwner() *User { if p == nil { @@ -15870,14 +15894,6 @@ func (p *Package) GetRegistry() *PackageRegistry { return p.Registry } -// GetRepository returns the Repository field. -func (p *Package) GetRepository() *Repository { - if p == nil { - return nil - } - return p.Repository -} - // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. func (p *Package) GetUpdatedAt() Timestamp { if p == nil || p.UpdatedAt == nil { @@ -15958,6 +15974,46 @@ func (p *PackageEvent) GetSender() *User { return p.Sender } +// GetLabels returns the Labels map if it's non-nil, an empty map otherwise. +func (p *PackageEventContainerMetadata) GetLabels() map[string]any { + if p == nil || p.Labels == nil { + return map[string]any{} + } + return p.Labels +} + +// GetManifest returns the Manifest map if it's non-nil, an empty map otherwise. +func (p *PackageEventContainerMetadata) GetManifest() map[string]any { + if p == nil || p.Manifest == nil { + return map[string]any{} + } + return p.Manifest +} + +// GetTag returns the Tag field. +func (p *PackageEventContainerMetadata) GetTag() *PackageEventContainerMetadataTag { + if p == nil { + return nil + } + return p.Tag +} + +// GetDigest returns the Digest field if it's non-nil, zero value otherwise. +func (p *PackageEventContainerMetadataTag) GetDigest() string { + if p == nil || p.Digest == nil { + return "" + } + return *p.Digest +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (p *PackageEventContainerMetadataTag) GetName() string { + if p == nil || p.Name == nil { + return "" + } + return *p.Name +} + // GetAuthor returns the Author field. func (p *PackageFile) GetAuthor() *User { if p == nil { @@ -16094,6 +16150,262 @@ func (p *PackageMetadata) GetPackageType() string { return *p.PackageType } +// GetAuthor returns the Author map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetAuthor() map[string]string { + if p == nil || p.Author == nil { + return map[string]string{} + } + return p.Author +} + +// GetBin returns the Bin map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetBin() map[string]any { + if p == nil || p.Bin == nil { + return map[string]any{} + } + return p.Bin +} + +// GetBugs returns the Bugs map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetBugs() map[string]string { + if p == nil || p.Bugs == nil { + return map[string]string{} + } + return p.Bugs +} + +// GetCommitOID returns the CommitOID field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetCommitOID() string { + if p == nil || p.CommitOID == nil { + return "" + } + return *p.CommitOID +} + +// GetDeletedByID returns the DeletedByID field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetDeletedByID() int64 { + if p == nil || p.DeletedByID == nil { + return 0 + } + return *p.DeletedByID +} + +// GetDependencies returns the Dependencies map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetDependencies() map[string]string { + if p == nil || p.Dependencies == nil { + return map[string]string{} + } + return p.Dependencies +} + +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetDescription() string { + if p == nil || p.Description == nil { + return "" + } + return *p.Description +} + +// GetDevDependencies returns the DevDependencies map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetDevDependencies() map[string]string { + if p == nil || p.DevDependencies == nil { + return map[string]string{} + } + return p.DevDependencies +} + +// GetDirectories returns the Directories map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetDirectories() map[string]string { + if p == nil || p.Directories == nil { + return map[string]string{} + } + return p.Directories +} + +// GetDist returns the Dist map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetDist() map[string]string { + if p == nil || p.Dist == nil { + return map[string]string{} + } + return p.Dist +} + +// GetEngines returns the Engines map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetEngines() map[string]string { + if p == nil || p.Engines == nil { + return map[string]string{} + } + return p.Engines +} + +// GetGitHead returns the GitHead field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetGitHead() string { + if p == nil || p.GitHead == nil { + return "" + } + return *p.GitHead +} + +// GetHasShrinkwrap returns the HasShrinkwrap field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetHasShrinkwrap() bool { + if p == nil || p.HasShrinkwrap == nil { + return false + } + return *p.HasShrinkwrap +} + +// GetHomepage returns the Homepage field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetHomepage() string { + if p == nil || p.Homepage == nil { + return "" + } + return *p.Homepage +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetID() string { + if p == nil || p.ID == nil { + return "" + } + return *p.ID +} + +// GetInstallationCommand returns the InstallationCommand field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetInstallationCommand() string { + if p == nil || p.InstallationCommand == nil { + return "" + } + return *p.InstallationCommand +} + +// GetLicense returns the License field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetLicense() string { + if p == nil || p.License == nil { + return "" + } + return *p.License +} + +// GetMain returns the Main field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetMain() string { + if p == nil || p.Main == nil { + return "" + } + return *p.Main +} + +// GetMan returns the Man map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetMan() map[string]any { + if p == nil || p.Man == nil { + return map[string]any{} + } + return p.Man +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetName() string { + if p == nil || p.Name == nil { + return "" + } + return *p.Name +} + +// GetNodeVersion returns the NodeVersion field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetNodeVersion() string { + if p == nil || p.NodeVersion == nil { + return "" + } + return *p.NodeVersion +} + +// GetNPMUser returns the NPMUser field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetNPMUser() string { + if p == nil || p.NPMUser == nil { + return "" + } + return *p.NPMUser +} + +// GetNPMVersion returns the NPMVersion field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetNPMVersion() string { + if p == nil || p.NPMVersion == nil { + return "" + } + return *p.NPMVersion +} + +// GetOptionalDependencies returns the OptionalDependencies map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetOptionalDependencies() map[string]string { + if p == nil || p.OptionalDependencies == nil { + return map[string]string{} + } + return p.OptionalDependencies +} + +// GetPeerDependencies returns the PeerDependencies map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetPeerDependencies() map[string]string { + if p == nil || p.PeerDependencies == nil { + return map[string]string{} + } + return p.PeerDependencies +} + +// GetPublishedViaActions returns the PublishedViaActions field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetPublishedViaActions() bool { + if p == nil || p.PublishedViaActions == nil { + return false + } + return *p.PublishedViaActions +} + +// GetReadme returns the Readme field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetReadme() string { + if p == nil || p.Readme == nil { + return "" + } + return *p.Readme +} + +// GetReleaseID returns the ReleaseID field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetReleaseID() int64 { + if p == nil || p.ReleaseID == nil { + return 0 + } + return *p.ReleaseID +} + +// GetRepository returns the Repository map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetRepository() map[string]string { + if p == nil || p.Repository == nil { + return map[string]string{} + } + return p.Repository +} + +// GetScripts returns the Scripts map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetScripts() map[string]any { + if p == nil || p.Scripts == nil { + return map[string]any{} + } + return p.Scripts +} + +// GetVersion returns the Version field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetVersion() string { + if p == nil || p.Version == nil { + return "" + } + return *p.Version +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (p *PackageNugetMetadata) GetName() string { + if p == nil || p.Name == nil { + return "" + } + return *p.Name +} + // GetAboutURL returns the AboutURL field if it's non-nil, zero value otherwise. func (p *PackageRegistry) GetAboutURL() string { if p == nil || p.AboutURL == nil { @@ -16230,14 +16542,6 @@ func (p *PackageVersion) GetAuthor() *User { return p.Author } -// GetBody returns the Body field if it's non-nil, zero value otherwise. -func (p *PackageVersion) GetBody() string { - if p == nil || p.Body == nil { - return "" - } - return *p.Body -} - // GetBodyHTML returns the BodyHTML field if it's non-nil, zero value otherwise. func (p *PackageVersion) GetBodyHTML() string { if p == nil || p.BodyHTML == nil { @@ -16246,6 +16550,14 @@ func (p *PackageVersion) GetBodyHTML() string { return *p.BodyHTML } +// GetContainerMetadata returns the ContainerMetadata field. +func (p *PackageVersion) GetContainerMetadata() *PackageEventContainerMetadata { + if p == nil { + return nil + } + return p.ContainerMetadata +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (p *PackageVersion) GetCreatedAt() Timestamp { if p == nil || p.CreatedAt == nil { @@ -16254,6 +16566,22 @@ func (p *PackageVersion) GetCreatedAt() Timestamp { return *p.CreatedAt } +// GetDeletedAt returns the DeletedAt field if it's non-nil, zero value otherwise. +func (p *PackageVersion) GetDeletedAt() Timestamp { + if p == nil || p.DeletedAt == nil { + return Timestamp{} + } + return *p.DeletedAt +} + +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (p *PackageVersion) GetDescription() string { + if p == nil || p.Description == nil { + return "" + } + return *p.Description +} + // GetDraft returns the Draft field if it's non-nil, zero value otherwise. func (p *PackageVersion) GetDraft() bool { if p == nil || p.Draft == nil { @@ -16286,6 +16614,14 @@ func (p *PackageVersion) GetInstallationCommand() string { return *p.InstallationCommand } +// GetLicense returns the License field if it's non-nil, zero value otherwise. +func (p *PackageVersion) GetLicense() string { + if p == nil || p.License == nil { + return "" + } + return *p.License +} + // GetManifest returns the Manifest field if it's non-nil, zero value otherwise. func (p *PackageVersion) GetManifest() string { if p == nil || p.Manifest == nil { @@ -16294,14 +16630,6 @@ func (p *PackageVersion) GetManifest() string { return *p.Manifest } -// GetMetadata returns the Metadata field. -func (p *PackageVersion) GetMetadata() *PackageMetadata { - if p == nil { - return nil - } - return p.Metadata -} - // GetName returns the Name field if it's non-nil, zero value otherwise. func (p *PackageVersion) GetName() string { if p == nil || p.Name == nil { @@ -16310,6 +16638,14 @@ func (p *PackageVersion) GetName() string { return *p.Name } +// GetNPMMetadata returns the NPMMetadata field. +func (p *PackageVersion) GetNPMMetadata() *PackageNPMMetadata { + if p == nil { + return nil + } + return p.NPMMetadata +} + // GetPackageHTMLURL returns the PackageHTMLURL field if it's non-nil, zero value otherwise. func (p *PackageVersion) GetPackageHTMLURL() string { if p == nil || p.PackageHTMLURL == nil { @@ -16318,6 +16654,14 @@ func (p *PackageVersion) GetPackageHTMLURL() string { return *p.PackageHTMLURL } +// GetPackageURL returns the PackageURL field if it's non-nil, zero value otherwise. +func (p *PackageVersion) GetPackageURL() string { + if p == nil || p.PackageURL == nil { + return "" + } + return *p.PackageURL +} + // GetPrerelease returns the Prerelease field if it's non-nil, zero value otherwise. func (p *PackageVersion) GetPrerelease() bool { if p == nil || p.Prerelease == nil { @@ -16334,6 +16678,22 @@ func (p *PackageVersion) GetRelease() *PackageRelease { return p.Release } +// GetRubyMetadata returns the RubyMetadata map if it's non-nil, an empty map otherwise. +func (p *PackageVersion) GetRubyMetadata() map[string]any { + if p == nil || p.RubyMetadata == nil { + return map[string]any{} + } + return p.RubyMetadata +} + +// GetSourceURL returns the SourceURL field if it's non-nil, zero value otherwise. +func (p *PackageVersion) GetSourceURL() string { + if p == nil || p.SourceURL == nil { + return "" + } + return *p.SourceURL +} + // GetSummary returns the Summary field if it's non-nil, zero value otherwise. func (p *PackageVersion) GetSummary() string { if p == nil || p.Summary == nil { @@ -16390,6 +16750,78 @@ func (p *PackageVersion) GetVersion() string { return *p.Version } +// GetInfo returns the Info field. +func (p *PackageVersionBody) GetInfo() *PackageVersionBodyInfo { + if p == nil { + return nil + } + return p.Info +} + +// GetRepo returns the Repo field. +func (p *PackageVersionBody) GetRepo() *Repository { + if p == nil { + return nil + } + return p.Repo +} + +// GetCollection returns the Collection field if it's non-nil, zero value otherwise. +func (p *PackageVersionBodyInfo) GetCollection() bool { + if p == nil || p.Collection == nil { + return false + } + return *p.Collection +} + +// GetMode returns the Mode field if it's non-nil, zero value otherwise. +func (p *PackageVersionBodyInfo) GetMode() int64 { + if p == nil || p.Mode == nil { + return 0 + } + return *p.Mode +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (p *PackageVersionBodyInfo) GetName() string { + if p == nil || p.Name == nil { + return "" + } + return *p.Name +} + +// GetOID returns the OID field if it's non-nil, zero value otherwise. +func (p *PackageVersionBodyInfo) GetOID() string { + if p == nil || p.OID == nil { + return "" + } + return *p.OID +} + +// GetPath returns the Path field if it's non-nil, zero value otherwise. +func (p *PackageVersionBodyInfo) GetPath() string { + if p == nil || p.Path == nil { + return "" + } + return *p.Path +} + +// GetSize returns the Size field if it's non-nil, zero value otherwise. +func (p *PackageVersionBodyInfo) GetSize() int64 { + if p == nil || p.Size == nil { + return 0 + } + return *p.Size +} + +// GetType returns the Type field if it's non-nil, zero value otherwise. +func (p *PackageVersionBodyInfo) GetType() string { + if p == nil || p.Type == nil { + return "" + } + return *p.Type +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (p *Page) GetAction() string { if p == nil || p.Action == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index ec1fe1c1155..c9a7b840653 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -20510,6 +20510,28 @@ func TestPackage_GetCreatedAt(tt *testing.T) { p.GetCreatedAt() } +func TestPackage_GetDescription(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &Package{Description: &zeroValue} + p.GetDescription() + p = &Package{} + p.GetDescription() + p = nil + p.GetDescription() +} + +func TestPackage_GetEcosystem(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &Package{Ecosystem: &zeroValue} + p.GetEcosystem() + p = &Package{} + p.GetEcosystem() + p = nil + p.GetEcosystem() +} + func TestPackage_GetHTMLURL(tt *testing.T) { tt.Parallel() var zeroValue string @@ -20543,6 +20565,17 @@ func TestPackage_GetName(tt *testing.T) { p.GetName() } +func TestPackage_GetNamespace(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &Package{Namespace: &zeroValue} + p.GetNamespace() + p = &Package{} + p.GetNamespace() + p = nil + p.GetNamespace() +} + func TestPackage_GetOwner(tt *testing.T) { tt.Parallel() p := &Package{} @@ -20578,14 +20611,6 @@ func TestPackage_GetRegistry(tt *testing.T) { p.GetRegistry() } -func TestPackage_GetRepository(tt *testing.T) { - tt.Parallel() - p := &Package{} - p.GetRepository() - p = nil - p.GetRepository() -} - func TestPackage_GetUpdatedAt(tt *testing.T) { tt.Parallel() var zeroValue Timestamp @@ -20681,6 +20706,58 @@ func TestPackageEvent_GetSender(tt *testing.T) { p.GetSender() } +func TestPackageEventContainerMetadata_GetLabels(tt *testing.T) { + tt.Parallel() + zeroValue := map[string]any{} + p := &PackageEventContainerMetadata{Labels: zeroValue} + p.GetLabels() + p = &PackageEventContainerMetadata{} + p.GetLabels() + p = nil + p.GetLabels() +} + +func TestPackageEventContainerMetadata_GetManifest(tt *testing.T) { + tt.Parallel() + zeroValue := map[string]any{} + p := &PackageEventContainerMetadata{Manifest: zeroValue} + p.GetManifest() + p = &PackageEventContainerMetadata{} + p.GetManifest() + p = nil + p.GetManifest() +} + +func TestPackageEventContainerMetadata_GetTag(tt *testing.T) { + tt.Parallel() + p := &PackageEventContainerMetadata{} + p.GetTag() + p = nil + p.GetTag() +} + +func TestPackageEventContainerMetadataTag_GetDigest(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &PackageEventContainerMetadataTag{Digest: &zeroValue} + p.GetDigest() + p = &PackageEventContainerMetadataTag{} + p.GetDigest() + p = nil + p.GetDigest() +} + +func TestPackageEventContainerMetadataTag_GetName(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &PackageEventContainerMetadataTag{Name: &zeroValue} + p.GetName() + p = &PackageEventContainerMetadataTag{} + p.GetName() + p = nil + p.GetName() +} + func TestPackageFile_GetAuthor(tt *testing.T) { tt.Parallel() p := &PackageFile{} @@ -20862,6 +20939,358 @@ func TestPackageMetadata_GetPackageType(tt *testing.T) { p.GetPackageType() } +func TestPackageNPMMetadata_GetAuthor(tt *testing.T) { + tt.Parallel() + zeroValue := map[string]string{} + p := &PackageNPMMetadata{Author: zeroValue} + p.GetAuthor() + p = &PackageNPMMetadata{} + p.GetAuthor() + p = nil + p.GetAuthor() +} + +func TestPackageNPMMetadata_GetBin(tt *testing.T) { + tt.Parallel() + zeroValue := map[string]any{} + p := &PackageNPMMetadata{Bin: zeroValue} + p.GetBin() + p = &PackageNPMMetadata{} + p.GetBin() + p = nil + p.GetBin() +} + +func TestPackageNPMMetadata_GetBugs(tt *testing.T) { + tt.Parallel() + zeroValue := map[string]string{} + p := &PackageNPMMetadata{Bugs: zeroValue} + p.GetBugs() + p = &PackageNPMMetadata{} + p.GetBugs() + p = nil + p.GetBugs() +} + +func TestPackageNPMMetadata_GetCommitOID(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &PackageNPMMetadata{CommitOID: &zeroValue} + p.GetCommitOID() + p = &PackageNPMMetadata{} + p.GetCommitOID() + p = nil + p.GetCommitOID() +} + +func TestPackageNPMMetadata_GetDeletedByID(tt *testing.T) { + tt.Parallel() + var zeroValue int64 + p := &PackageNPMMetadata{DeletedByID: &zeroValue} + p.GetDeletedByID() + p = &PackageNPMMetadata{} + p.GetDeletedByID() + p = nil + p.GetDeletedByID() +} + +func TestPackageNPMMetadata_GetDependencies(tt *testing.T) { + tt.Parallel() + zeroValue := map[string]string{} + p := &PackageNPMMetadata{Dependencies: zeroValue} + p.GetDependencies() + p = &PackageNPMMetadata{} + p.GetDependencies() + p = nil + p.GetDependencies() +} + +func TestPackageNPMMetadata_GetDescription(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &PackageNPMMetadata{Description: &zeroValue} + p.GetDescription() + p = &PackageNPMMetadata{} + p.GetDescription() + p = nil + p.GetDescription() +} + +func TestPackageNPMMetadata_GetDevDependencies(tt *testing.T) { + tt.Parallel() + zeroValue := map[string]string{} + p := &PackageNPMMetadata{DevDependencies: zeroValue} + p.GetDevDependencies() + p = &PackageNPMMetadata{} + p.GetDevDependencies() + p = nil + p.GetDevDependencies() +} + +func TestPackageNPMMetadata_GetDirectories(tt *testing.T) { + tt.Parallel() + zeroValue := map[string]string{} + p := &PackageNPMMetadata{Directories: zeroValue} + p.GetDirectories() + p = &PackageNPMMetadata{} + p.GetDirectories() + p = nil + p.GetDirectories() +} + +func TestPackageNPMMetadata_GetDist(tt *testing.T) { + tt.Parallel() + zeroValue := map[string]string{} + p := &PackageNPMMetadata{Dist: zeroValue} + p.GetDist() + p = &PackageNPMMetadata{} + p.GetDist() + p = nil + p.GetDist() +} + +func TestPackageNPMMetadata_GetEngines(tt *testing.T) { + tt.Parallel() + zeroValue := map[string]string{} + p := &PackageNPMMetadata{Engines: zeroValue} + p.GetEngines() + p = &PackageNPMMetadata{} + p.GetEngines() + p = nil + p.GetEngines() +} + +func TestPackageNPMMetadata_GetGitHead(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &PackageNPMMetadata{GitHead: &zeroValue} + p.GetGitHead() + p = &PackageNPMMetadata{} + p.GetGitHead() + p = nil + p.GetGitHead() +} + +func TestPackageNPMMetadata_GetHasShrinkwrap(tt *testing.T) { + tt.Parallel() + var zeroValue bool + p := &PackageNPMMetadata{HasShrinkwrap: &zeroValue} + p.GetHasShrinkwrap() + p = &PackageNPMMetadata{} + p.GetHasShrinkwrap() + p = nil + p.GetHasShrinkwrap() +} + +func TestPackageNPMMetadata_GetHomepage(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &PackageNPMMetadata{Homepage: &zeroValue} + p.GetHomepage() + p = &PackageNPMMetadata{} + p.GetHomepage() + p = nil + p.GetHomepage() +} + +func TestPackageNPMMetadata_GetID(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &PackageNPMMetadata{ID: &zeroValue} + p.GetID() + p = &PackageNPMMetadata{} + p.GetID() + p = nil + p.GetID() +} + +func TestPackageNPMMetadata_GetInstallationCommand(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &PackageNPMMetadata{InstallationCommand: &zeroValue} + p.GetInstallationCommand() + p = &PackageNPMMetadata{} + p.GetInstallationCommand() + p = nil + p.GetInstallationCommand() +} + +func TestPackageNPMMetadata_GetLicense(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &PackageNPMMetadata{License: &zeroValue} + p.GetLicense() + p = &PackageNPMMetadata{} + p.GetLicense() + p = nil + p.GetLicense() +} + +func TestPackageNPMMetadata_GetMain(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &PackageNPMMetadata{Main: &zeroValue} + p.GetMain() + p = &PackageNPMMetadata{} + p.GetMain() + p = nil + p.GetMain() +} + +func TestPackageNPMMetadata_GetMan(tt *testing.T) { + tt.Parallel() + zeroValue := map[string]any{} + p := &PackageNPMMetadata{Man: zeroValue} + p.GetMan() + p = &PackageNPMMetadata{} + p.GetMan() + p = nil + p.GetMan() +} + +func TestPackageNPMMetadata_GetName(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &PackageNPMMetadata{Name: &zeroValue} + p.GetName() + p = &PackageNPMMetadata{} + p.GetName() + p = nil + p.GetName() +} + +func TestPackageNPMMetadata_GetNodeVersion(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &PackageNPMMetadata{NodeVersion: &zeroValue} + p.GetNodeVersion() + p = &PackageNPMMetadata{} + p.GetNodeVersion() + p = nil + p.GetNodeVersion() +} + +func TestPackageNPMMetadata_GetNPMUser(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &PackageNPMMetadata{NPMUser: &zeroValue} + p.GetNPMUser() + p = &PackageNPMMetadata{} + p.GetNPMUser() + p = nil + p.GetNPMUser() +} + +func TestPackageNPMMetadata_GetNPMVersion(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &PackageNPMMetadata{NPMVersion: &zeroValue} + p.GetNPMVersion() + p = &PackageNPMMetadata{} + p.GetNPMVersion() + p = nil + p.GetNPMVersion() +} + +func TestPackageNPMMetadata_GetOptionalDependencies(tt *testing.T) { + tt.Parallel() + zeroValue := map[string]string{} + p := &PackageNPMMetadata{OptionalDependencies: zeroValue} + p.GetOptionalDependencies() + p = &PackageNPMMetadata{} + p.GetOptionalDependencies() + p = nil + p.GetOptionalDependencies() +} + +func TestPackageNPMMetadata_GetPeerDependencies(tt *testing.T) { + tt.Parallel() + zeroValue := map[string]string{} + p := &PackageNPMMetadata{PeerDependencies: zeroValue} + p.GetPeerDependencies() + p = &PackageNPMMetadata{} + p.GetPeerDependencies() + p = nil + p.GetPeerDependencies() +} + +func TestPackageNPMMetadata_GetPublishedViaActions(tt *testing.T) { + tt.Parallel() + var zeroValue bool + p := &PackageNPMMetadata{PublishedViaActions: &zeroValue} + p.GetPublishedViaActions() + p = &PackageNPMMetadata{} + p.GetPublishedViaActions() + p = nil + p.GetPublishedViaActions() +} + +func TestPackageNPMMetadata_GetReadme(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &PackageNPMMetadata{Readme: &zeroValue} + p.GetReadme() + p = &PackageNPMMetadata{} + p.GetReadme() + p = nil + p.GetReadme() +} + +func TestPackageNPMMetadata_GetReleaseID(tt *testing.T) { + tt.Parallel() + var zeroValue int64 + p := &PackageNPMMetadata{ReleaseID: &zeroValue} + p.GetReleaseID() + p = &PackageNPMMetadata{} + p.GetReleaseID() + p = nil + p.GetReleaseID() +} + +func TestPackageNPMMetadata_GetRepository(tt *testing.T) { + tt.Parallel() + zeroValue := map[string]string{} + p := &PackageNPMMetadata{Repository: zeroValue} + p.GetRepository() + p = &PackageNPMMetadata{} + p.GetRepository() + p = nil + p.GetRepository() +} + +func TestPackageNPMMetadata_GetScripts(tt *testing.T) { + tt.Parallel() + zeroValue := map[string]any{} + p := &PackageNPMMetadata{Scripts: zeroValue} + p.GetScripts() + p = &PackageNPMMetadata{} + p.GetScripts() + p = nil + p.GetScripts() +} + +func TestPackageNPMMetadata_GetVersion(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &PackageNPMMetadata{Version: &zeroValue} + p.GetVersion() + p = &PackageNPMMetadata{} + p.GetVersion() + p = nil + p.GetVersion() +} + +func TestPackageNugetMetadata_GetName(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &PackageNugetMetadata{Name: &zeroValue} + p.GetName() + p = &PackageNugetMetadata{} + p.GetName() + p = nil + p.GetName() +} + func TestPackageRegistry_GetAboutURL(tt *testing.T) { tt.Parallel() var zeroValue string @@ -21043,17 +21472,6 @@ func TestPackageVersion_GetAuthor(tt *testing.T) { p.GetAuthor() } -func TestPackageVersion_GetBody(tt *testing.T) { - tt.Parallel() - var zeroValue string - p := &PackageVersion{Body: &zeroValue} - p.GetBody() - p = &PackageVersion{} - p.GetBody() - p = nil - p.GetBody() -} - func TestPackageVersion_GetBodyHTML(tt *testing.T) { tt.Parallel() var zeroValue string @@ -21065,6 +21483,14 @@ func TestPackageVersion_GetBodyHTML(tt *testing.T) { p.GetBodyHTML() } +func TestPackageVersion_GetContainerMetadata(tt *testing.T) { + tt.Parallel() + p := &PackageVersion{} + p.GetContainerMetadata() + p = nil + p.GetContainerMetadata() +} + func TestPackageVersion_GetCreatedAt(tt *testing.T) { tt.Parallel() var zeroValue Timestamp @@ -21076,6 +21502,28 @@ func TestPackageVersion_GetCreatedAt(tt *testing.T) { p.GetCreatedAt() } +func TestPackageVersion_GetDeletedAt(tt *testing.T) { + tt.Parallel() + var zeroValue Timestamp + p := &PackageVersion{DeletedAt: &zeroValue} + p.GetDeletedAt() + p = &PackageVersion{} + p.GetDeletedAt() + p = nil + p.GetDeletedAt() +} + +func TestPackageVersion_GetDescription(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &PackageVersion{Description: &zeroValue} + p.GetDescription() + p = &PackageVersion{} + p.GetDescription() + p = nil + p.GetDescription() +} + func TestPackageVersion_GetDraft(tt *testing.T) { tt.Parallel() var zeroValue bool @@ -21120,6 +21568,17 @@ func TestPackageVersion_GetInstallationCommand(tt *testing.T) { p.GetInstallationCommand() } +func TestPackageVersion_GetLicense(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &PackageVersion{License: &zeroValue} + p.GetLicense() + p = &PackageVersion{} + p.GetLicense() + p = nil + p.GetLicense() +} + func TestPackageVersion_GetManifest(tt *testing.T) { tt.Parallel() var zeroValue string @@ -21131,14 +21590,6 @@ func TestPackageVersion_GetManifest(tt *testing.T) { p.GetManifest() } -func TestPackageVersion_GetMetadata(tt *testing.T) { - tt.Parallel() - p := &PackageVersion{} - p.GetMetadata() - p = nil - p.GetMetadata() -} - func TestPackageVersion_GetName(tt *testing.T) { tt.Parallel() var zeroValue string @@ -21150,6 +21601,14 @@ func TestPackageVersion_GetName(tt *testing.T) { p.GetName() } +func TestPackageVersion_GetNPMMetadata(tt *testing.T) { + tt.Parallel() + p := &PackageVersion{} + p.GetNPMMetadata() + p = nil + p.GetNPMMetadata() +} + func TestPackageVersion_GetPackageHTMLURL(tt *testing.T) { tt.Parallel() var zeroValue string @@ -21161,6 +21620,17 @@ func TestPackageVersion_GetPackageHTMLURL(tt *testing.T) { p.GetPackageHTMLURL() } +func TestPackageVersion_GetPackageURL(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &PackageVersion{PackageURL: &zeroValue} + p.GetPackageURL() + p = &PackageVersion{} + p.GetPackageURL() + p = nil + p.GetPackageURL() +} + func TestPackageVersion_GetPrerelease(tt *testing.T) { tt.Parallel() var zeroValue bool @@ -21180,6 +21650,28 @@ func TestPackageVersion_GetRelease(tt *testing.T) { p.GetRelease() } +func TestPackageVersion_GetRubyMetadata(tt *testing.T) { + tt.Parallel() + zeroValue := map[string]any{} + p := &PackageVersion{RubyMetadata: zeroValue} + p.GetRubyMetadata() + p = &PackageVersion{} + p.GetRubyMetadata() + p = nil + p.GetRubyMetadata() +} + +func TestPackageVersion_GetSourceURL(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &PackageVersion{SourceURL: &zeroValue} + p.GetSourceURL() + p = &PackageVersion{} + p.GetSourceURL() + p = nil + p.GetSourceURL() +} + func TestPackageVersion_GetSummary(tt *testing.T) { tt.Parallel() var zeroValue string @@ -21257,6 +21749,99 @@ func TestPackageVersion_GetVersion(tt *testing.T) { p.GetVersion() } +func TestPackageVersionBody_GetInfo(tt *testing.T) { + tt.Parallel() + p := &PackageVersionBody{} + p.GetInfo() + p = nil + p.GetInfo() +} + +func TestPackageVersionBody_GetRepo(tt *testing.T) { + tt.Parallel() + p := &PackageVersionBody{} + p.GetRepo() + p = nil + p.GetRepo() +} + +func TestPackageVersionBodyInfo_GetCollection(tt *testing.T) { + tt.Parallel() + var zeroValue bool + p := &PackageVersionBodyInfo{Collection: &zeroValue} + p.GetCollection() + p = &PackageVersionBodyInfo{} + p.GetCollection() + p = nil + p.GetCollection() +} + +func TestPackageVersionBodyInfo_GetMode(tt *testing.T) { + tt.Parallel() + var zeroValue int64 + p := &PackageVersionBodyInfo{Mode: &zeroValue} + p.GetMode() + p = &PackageVersionBodyInfo{} + p.GetMode() + p = nil + p.GetMode() +} + +func TestPackageVersionBodyInfo_GetName(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &PackageVersionBodyInfo{Name: &zeroValue} + p.GetName() + p = &PackageVersionBodyInfo{} + p.GetName() + p = nil + p.GetName() +} + +func TestPackageVersionBodyInfo_GetOID(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &PackageVersionBodyInfo{OID: &zeroValue} + p.GetOID() + p = &PackageVersionBodyInfo{} + p.GetOID() + p = nil + p.GetOID() +} + +func TestPackageVersionBodyInfo_GetPath(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &PackageVersionBodyInfo{Path: &zeroValue} + p.GetPath() + p = &PackageVersionBodyInfo{} + p.GetPath() + p = nil + p.GetPath() +} + +func TestPackageVersionBodyInfo_GetSize(tt *testing.T) { + tt.Parallel() + var zeroValue int64 + p := &PackageVersionBodyInfo{Size: &zeroValue} + p.GetSize() + p = &PackageVersionBodyInfo{} + p.GetSize() + p = nil + p.GetSize() +} + +func TestPackageVersionBodyInfo_GetType(tt *testing.T) { + tt.Parallel() + var zeroValue string + p := &PackageVersionBodyInfo{Type: &zeroValue} + p.GetType() + p = &PackageVersionBodyInfo{} + p.GetType() + p = nil + p.GetType() +} + func TestPage_GetAction(tt *testing.T) { tt.Parallel() var zeroValue string diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index e09444719ac..5abc381a843 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -1136,17 +1136,19 @@ func TestPackage_String(t *testing.T) { Name: Ptr(""), PackageType: Ptr(""), HTMLURL: Ptr(""), + Visibility: Ptr(""), + Owner: &User{}, CreatedAt: &Timestamp{}, UpdatedAt: &Timestamp{}, - Owner: &User{}, + Namespace: Ptr(""), + Description: Ptr(""), + Ecosystem: Ptr(""), PackageVersion: &PackageVersion{}, Registry: &PackageRegistry{}, URL: Ptr(""), VersionCount: Ptr(int64(0)), - Visibility: Ptr(""), - Repository: &Repository{}, } - want := `github.Package{ID:0, Name:"", PackageType:"", HTMLURL:"", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Owner:github.User{}, PackageVersion:github.PackageVersion{}, Registry:github.PackageRegistry{}, URL:"", VersionCount:0, Visibility:"", Repository:github.Repository{}}` + want := `github.Package{ID:0, Name:"", PackageType:"", HTMLURL:"", Visibility:"", Owner:github.User{}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Namespace:"", Description:"", Ecosystem:"", PackageVersion:github.PackageVersion{}, Registry:github.PackageRegistry{}, URL:"", VersionCount:0}` if got := v.String(); got != want { t.Errorf("Package.String = %v, want %v", got, want) } @@ -1163,6 +1165,29 @@ func TestPackageContainerMetadata_String(t *testing.T) { } } +func TestPackageEventContainerMetadata_String(t *testing.T) { + t.Parallel() + v := PackageEventContainerMetadata{ + Tag: &PackageEventContainerMetadataTag{}, + } + want := `github.PackageEventContainerMetadata{Tag:github.PackageEventContainerMetadataTag{}}` + if got := v.String(); got != want { + t.Errorf("PackageEventContainerMetadata.String = %v, want %v", got, want) + } +} + +func TestPackageEventContainerMetadataTag_String(t *testing.T) { + t.Parallel() + v := PackageEventContainerMetadataTag{ + Name: Ptr(""), + Digest: Ptr(""), + } + want := `github.PackageEventContainerMetadataTag{Name:"", Digest:""}` + if got := v.String(); got != want { + t.Errorf("PackageEventContainerMetadataTag.String = %v, want %v", got, want) + } +} + func TestPackageFile_String(t *testing.T) { t.Parallel() v := PackageFile{ @@ -1197,6 +1222,49 @@ func TestPackageMetadata_String(t *testing.T) { } } +func TestPackageNPMMetadata_String(t *testing.T) { + t.Parallel() + v := PackageNPMMetadata{ + Name: Ptr(""), + Version: Ptr(""), + NPMUser: Ptr(""), + Description: Ptr(""), + GitHead: Ptr(""), + Homepage: Ptr(""), + License: Ptr(""), + Main: Ptr(""), + ID: Ptr(""), + NodeVersion: Ptr(""), + NPMVersion: Ptr(""), + HasShrinkwrap: Ptr(false), + Keywords: []string{""}, + Files: []string{""}, + OS: []string{""}, + CPU: []string{""}, + Readme: Ptr(""), + InstallationCommand: Ptr(""), + ReleaseID: Ptr(int64(0)), + CommitOID: Ptr(""), + PublishedViaActions: Ptr(false), + DeletedByID: Ptr(int64(0)), + } + want := `github.PackageNPMMetadata{Name:"", Version:"", NPMUser:"", Description:"", GitHead:"", Homepage:"", License:"", Main:"", ID:"", NodeVersion:"", NPMVersion:"", HasShrinkwrap:false, Keywords:[""], Files:[""], OS:[""], CPU:[""], Readme:"", InstallationCommand:"", ReleaseID:0, CommitOID:"", PublishedViaActions:false, DeletedByID:0}` + if got := v.String(); got != want { + t.Errorf("PackageNPMMetadata.String = %v, want %v", got, want) + } +} + +func TestPackageNugetMetadata_String(t *testing.T) { + t.Parallel() + v := PackageNugetMetadata{ + Name: Ptr(""), + } + want := `github.PackageNugetMetadata{Name:""}` + if got := v.String(); got != want { + t.Errorf("PackageNugetMetadata.String = %v, want %v", got, want) + } +} + func TestPackageRegistry_String(t *testing.T) { t.Parallel() v := PackageRegistry{ @@ -1237,9 +1305,15 @@ func TestPackageVersion_String(t *testing.T) { t.Parallel() v := PackageVersion{ ID: Ptr(int64(0)), + Name: Ptr(""), + URL: Ptr(""), + PackageHTMLURL: Ptr(""), + License: Ptr(""), + Description: Ptr(""), + CreatedAt: &Timestamp{}, + UpdatedAt: &Timestamp{}, Version: Ptr(""), Summary: Ptr(""), - Body: Ptr(""), BodyHTML: Ptr(""), Release: &PackageRelease{}, Manifest: Ptr(""), @@ -1249,21 +1323,49 @@ func TestPackageVersion_String(t *testing.T) { TargetOID: Ptr(""), Draft: Ptr(false), Prerelease: Ptr(false), - CreatedAt: &Timestamp{}, - UpdatedAt: &Timestamp{}, + ContainerMetadata: &PackageEventContainerMetadata{}, + NPMMetadata: &PackageNPMMetadata{}, + PackageURL: Ptr(""), Author: &User{}, + SourceURL: Ptr(""), InstallationCommand: Ptr(""), - Metadata: &PackageMetadata{}, - PackageHTMLURL: Ptr(""), - Name: Ptr(""), - URL: Ptr(""), + DeletedAt: &Timestamp{}, } - want := `github.PackageVersion{ID:0, Version:"", Summary:"", Body:"", BodyHTML:"", Release:github.PackageRelease{}, Manifest:"", HTMLURL:"", TagName:"", TargetCommitish:"", TargetOID:"", Draft:false, Prerelease:false, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Author:github.User{}, InstallationCommand:"", Metadata:github.PackageMetadata{}, PackageHTMLURL:"", Name:"", URL:""}` + want := `github.PackageVersion{ID:0, Name:"", URL:"", PackageHTMLURL:"", License:"", Description:"", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Version:"", Summary:"", BodyHTML:"", Release:github.PackageRelease{}, Manifest:"", HTMLURL:"", TagName:"", TargetCommitish:"", TargetOID:"", Draft:false, Prerelease:false, ContainerMetadata:github.PackageEventContainerMetadata{}, NPMMetadata:github.PackageNPMMetadata{}, PackageURL:"", Author:github.User{}, SourceURL:"", InstallationCommand:"", DeletedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}` if got := v.String(); got != want { t.Errorf("PackageVersion.String = %v, want %v", got, want) } } +func TestPackageVersionBody_String(t *testing.T) { + t.Parallel() + v := PackageVersionBody{ + Repo: &Repository{}, + Info: &PackageVersionBodyInfo{}, + } + want := `github.PackageVersionBody{Repo:github.Repository{}, Info:github.PackageVersionBodyInfo{}}` + if got := v.String(); got != want { + t.Errorf("PackageVersionBody.String = %v, want %v", got, want) + } +} + +func TestPackageVersionBodyInfo_String(t *testing.T) { + t.Parallel() + v := PackageVersionBodyInfo{ + Type: Ptr(""), + OID: Ptr(""), + Mode: Ptr(int64(0)), + Name: Ptr(""), + Path: Ptr(""), + Size: Ptr(int64(0)), + Collection: Ptr(false), + } + want := `github.PackageVersionBodyInfo{Type:"", OID:"", Mode:0, Name:"", Path:"", Size:0, Collection:false}` + if got := v.String(); got != want { + t.Errorf("PackageVersionBodyInfo.String = %v, want %v", got, want) + } +} + func TestPageStats_String(t *testing.T) { t.Parallel() v := PageStats{ diff --git a/github/orgs_packages_test.go b/github/orgs_packages_test.go index 836584a1152..1bc72bc7cdf 100644 --- a/github/orgs_packages_test.go +++ b/github/orgs_packages_test.go @@ -7,6 +7,7 @@ package github import ( "context" + "encoding/json" "io" "net/http" "testing" @@ -232,6 +233,15 @@ func TestOrganizationsService_ListPackagesVersions(t *testing.T) { t.Parallel() client, mux, _ := setup(t) + m := `{ + "package_type": "container", + "container": { + "tags": [ + "latest" + ] + } + }` + // don't url escape the package name here since mux will convert it to a slash automatically mux.HandleFunc("/orgs/o/packages/container/hello%2Fhello_docker/versions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -245,14 +255,7 @@ func TestOrganizationsService_ListPackagesVersions(t *testing.T) { "created_at": `+referenceTimeStr+`, "updated_at": `+referenceTimeStr+`, "html_url": "https://github.com/users/octocat/packages/container/hello%2Fhello_docker/45763", - "metadata": { - "package_type": "container", - "container": { - "tags": [ - "latest" - ] - } - } + "metadata": `+m+` }]`) if err != nil { t.Fatal("Failed to write test response: ", err) @@ -276,12 +279,7 @@ func TestOrganizationsService_ListPackagesVersions(t *testing.T) { CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, HTMLURL: Ptr("https://github.com/users/octocat/packages/container/hello%2Fhello_docker/45763"), - Metadata: &PackageMetadata{ - PackageType: Ptr("container"), - Container: &PackageContainerMetadata{ - Tags: []string{"latest"}, - }, - }, + Metadata: json.RawMessage(m), }} if !cmp.Equal(packages, want) { t.Errorf("Organizations.PackageGetAllVersions returned %+v, want %+v", packages, want) @@ -306,6 +304,15 @@ func TestOrganizationsService_PackageGetVersion(t *testing.T) { t.Parallel() client, mux, _ := setup(t) + m := `{ + "package_type": "container", + "container": { + "tags": [ + "latest" + ] + } + }` + // don't url escape the package name here since mux will convert it to a slash automatically mux.HandleFunc("/orgs/o/packages/container/hello%2Fhello_docker/versions/45763", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") @@ -318,14 +325,7 @@ func TestOrganizationsService_PackageGetVersion(t *testing.T) { "created_at": `+referenceTimeStr+`, "updated_at": `+referenceTimeStr+`, "html_url": "https://github.com/users/octocat/packages/container/hello%2Fhello_docker/45763", - "metadata": { - "package_type": "container", - "container": { - "tags": [ - "latest" - ] - } - } + "metadata": `+m+` }`) if err != nil { t.Fatal("Failed to write test response: ", err) @@ -346,12 +346,7 @@ func TestOrganizationsService_PackageGetVersion(t *testing.T) { CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, HTMLURL: Ptr("https://github.com/users/octocat/packages/container/hello%2Fhello_docker/45763"), - Metadata: &PackageMetadata{ - PackageType: Ptr("container"), - Container: &PackageContainerMetadata{ - Tags: []string{"latest"}, - }, - }, + Metadata: json.RawMessage(m), } if !cmp.Equal(packages, want) { t.Errorf("Organizations.PackageGetVersion returned %+v, want %+v", packages, want) diff --git a/github/packages.go b/github/packages.go index ef7df074058..e7c327963cf 100644 --- a/github/packages.go +++ b/github/packages.go @@ -5,21 +5,31 @@ package github +import ( + "encoding/json" +) + // Package represents a GitHub package. type Package struct { - ID *int64 `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - PackageType *string `json:"package_type,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - Owner *User `json:"owner,omitempty"` + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + PackageType *string `json:"package_type,omitempty"` // One of "npm", "maven", "rubygems", "docker", "nuget", "container". For webhook events "container" is "CONTAINER" + HTMLURL *string `json:"html_url,omitempty"` + Visibility *string `json:"visibility,omitempty"` + Owner *User `json:"owner,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + + // The following are only populated for webhook events + Namespace *string `json:"namespace,omitempty"` + Description *string `json:"description,omitempty"` + Ecosystem *string `json:"ecosystem,omitempty"` PackageVersion *PackageVersion `json:"package_version,omitempty"` Registry *PackageRegistry `json:"registry,omitempty"` - URL *string `json:"url,omitempty"` - VersionCount *int64 `json:"version_count,omitempty"` - Visibility *string `json:"visibility,omitempty"` - Repository *Repository `json:"repository,omitempty"` + + // The following are NOT populated for webhook events + URL *string `json:"url,omitempty"` + VersionCount *int64 `json:"version_count,omitempty"` } func (p Package) String() string { @@ -28,28 +38,90 @@ func (p Package) String() string { // PackageVersion represents a GitHub package version. type PackageVersion struct { - ID *int64 `json:"id,omitempty"` - Version *string `json:"version,omitempty"` - Summary *string `json:"summary,omitempty"` - Body *string `json:"body,omitempty"` - BodyHTML *string `json:"body_html,omitempty"` - Release *PackageRelease `json:"release,omitempty"` - Manifest *string `json:"manifest,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - TagName *string `json:"tag_name,omitempty"` - TargetCommitish *string `json:"target_commitish,omitempty"` - TargetOID *string `json:"target_oid,omitempty"` - Draft *bool `json:"draft,omitempty"` - Prerelease *bool `json:"prerelease,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - PackageFiles []*PackageFile `json:"package_files,omitempty"` - Author *User `json:"author,omitempty"` - InstallationCommand *string `json:"installation_command,omitempty"` - Metadata *PackageMetadata `json:"metadata,omitempty"` - PackageHTMLURL *string `json:"package_html_url,omitempty"` - Name *string `json:"name,omitempty"` - URL *string `json:"url,omitempty"` + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + URL *string `json:"url,omitempty"` + PackageHTMLURL *string `json:"package_html_url,omitempty"` + License *string `json:"license,omitempty"` + Description *string `json:"description,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + Metadata json.RawMessage `json:"metadata,omitempty"` // For webhook events this will be []interface, else it will be of type PackageMetadata + + // The following are only populated for webhook events + Version *string `json:"version,omitempty"` + Summary *string `json:"summary,omitempty"` + Body json.RawMessage `json:"body,omitempty"` // Can either be a string or of type PackageVersionBody + BodyHTML *string `json:"body_html,omitempty"` + Release *PackageRelease `json:"release,omitempty"` + Manifest *string `json:"manifest,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + TagName *string `json:"tag_name,omitempty"` + TargetCommitish *string `json:"target_commitish,omitempty"` + TargetOID *string `json:"target_oid,omitempty"` + Draft *bool `json:"draft,omitempty"` + Prerelease *bool `json:"prerelease,omitempty"` + ContainerMetadata *PackageEventContainerMetadata `json:"container_metadata,omitempty"` + DockerMetadata []interface{} `json:"docker_metadata,omitempty"` + NPMMetadata *PackageNPMMetadata `json:"npm_metadata,omitempty"` + NugetMetadata []*PackageNugetMetadata `json:"nuget_metadata,omitempty"` + RubyMetadata map[string]any `json:"ruby_metadata,omitempty"` + PackageFiles []*PackageFile `json:"package_files,omitempty"` + PackageURL *string `json:"package_url,omitempty"` + Author *User `json:"author,omitempty"` + SourceURL *string `json:"source_url,omitempty"` + InstallationCommand *string `json:"installation_command,omitempty"` + + // The following are NOT populated for webhook events + DeletedAt *Timestamp `json:"deleted_at,omitempty"` +} + +// GetBody returns the body field as a string if it's valid. +func (pv *PackageVersion) GetBody() (body string, ok bool) { + if pv == nil || pv.Body == nil { + return "", false + } + + if err := json.Unmarshal(pv.Body, &body); err != nil { + return "", false + } + + return body, true +} + +// GetBodyAsPackageVersionBody returns the body field as a PackageVersionBody if it's valid. +func (pv *PackageVersion) GetBodyAsPackageVersionBody() (body *PackageVersionBody, ok bool) { + if pv == nil || pv.Body == nil { + return nil, false + } + + if err := json.Unmarshal(pv.Body, &body); err != nil { + return nil, false + } + + return body, true +} + +// GetMetadata returns the metadata field as PackageMetadata if it's valid. +func (pv *PackageVersion) GetMetadata() (metadata *PackageMetadata, ok bool) { + if pv == nil || pv.Metadata == nil { + return nil, false + } + + if err := json.Unmarshal(pv.Metadata, &metadata); err != nil { + return nil, false + } + + return metadata, true +} + +// GetRawMetadata returns the metadata field as a json.RawMessage. +func (pv *PackageVersion) GetRawMetadata() json.RawMessage { + if pv == nil || pv.Metadata == nil { + return json.RawMessage{} + } + + return pv.Metadata } func (pv PackageVersion) String() string { @@ -141,3 +213,106 @@ type PackageContainerMetadata struct { func (r PackageContainerMetadata) String() string { return Stringify(r) } + +// PackageVersionBody represents the body field of a package version. +type PackageVersionBody struct { + Repo *Repository `json:"repository,omitempty"` + Info *PackageVersionBodyInfo `json:"info,omitempty"` +} + +func (b PackageVersionBody) String() string { + return Stringify(b) +} + +// PackageVersionBodyInfo represents the info field of a PackageVersionBody. +type PackageVersionBodyInfo struct { + Type *string `json:"type,omitempty"` + OID *string `json:"oid,omitempty"` + Mode *int64 `json:"mode,omitempty"` + Name *string `json:"name,omitempty"` + Path *string `json:"path,omitempty"` + Size *int64 `json:"size,omitempty"` + Collection *bool `json:"collection,omitempty"` +} + +func (bi PackageVersionBodyInfo) String() string { + return Stringify(bi) +} + +// PackageEventContainerMetadata represents metadata for container packages as part of a webhook event. +// See also PackageContainerMetadata. +type PackageEventContainerMetadata struct { + Labels map[string]any `json:"labels,omitempty"` + Manifest map[string]any `json:"manifest,omitempty"` + Tag *PackageEventContainerMetadataTag `json:"tag,omitempty"` +} + +func (m PackageEventContainerMetadata) String() string { + return Stringify(m) +} + +// PackageEventContainerMetadataTag represents a tag of a GitHub container package. +type PackageEventContainerMetadataTag struct { + Name *string `json:"name,omitempty"` + Digest *string `json:"digest,omitempty"` +} + +func (mt PackageEventContainerMetadataTag) String() string { + return Stringify(mt) +} + +// PackageNugetMetadata represents nuget metadata for a GitHub package. +type PackageNugetMetadata struct { + ID json.RawMessage `json:"id,omitempty"` // Can either be a int64 or string + Name *string `json:"name,omitempty"` + Value json.RawMessage `json:"value,omitempty"` // Can either be a bool, string, integer or object +} + +func (nm PackageNugetMetadata) String() string { + return Stringify(nm) +} + +// PackageNPMMetadata represents NPM metadata for a GitHub package. +type PackageNPMMetadata struct { + Name *string `json:"name,omitempty"` + Version *string `json:"version,omitempty"` + NPMUser *string `json:"npm_user,omitempty"` + Author map[string]string `json:"author,omitempty"` + Bugs map[string]string `json:"bugs,omitempty"` + Dependencies map[string]string `json:"dependencies,omitempty"` + DevDependencies map[string]string `json:"dev_dependencies,omitempty"` + PeerDependencies map[string]string `json:"peer_dependencies,omitempty"` + OptionalDependencies map[string]string `json:"optional_dependencies,omitempty"` + Description *string `json:"description,omitempty"` + Dist map[string]string `json:"dist,omitempty"` + GitHead *string `json:"git_head,omitempty"` + Homepage *string `json:"homepage,omitempty"` + License *string `json:"license,omitempty"` + Main *string `json:"main,omitempty"` + Repository map[string]string `json:"repository,omitempty"` + Scripts map[string]any `json:"scripts,omitempty"` + ID *string `json:"id,omitempty"` + NodeVersion *string `json:"node_version,omitempty"` + NPMVersion *string `json:"npm_version,omitempty"` + HasShrinkwrap *bool `json:"has_shrinkwrap,omitempty"` + Maintainers []interface{} `json:"maintainers,omitempty"` + Contributors []interface{} `json:"contributors,omitempty"` + Engines map[string]string `json:"engines,omitempty"` + Keywords []string `json:"keywords,omitempty"` + Files []string `json:"files,omitempty"` + Bin map[string]any `json:"bin,omitempty"` + Man map[string]any `json:"man,omitempty"` + Directories map[string]string `json:"directories,omitempty"` + OS []string `json:"os,omitempty"` + CPU []string `json:"cpu,omitempty"` + Readme *string `json:"readme,omitempty"` + InstallationCommand *string `json:"installation_command,omitempty"` + ReleaseID *int64 `json:"release_id,omitempty"` + CommitOID *string `json:"commit_oid,omitempty"` + PublishedViaActions *bool `json:"published_via_actions,omitempty"` + DeletedByID *int64 `json:"deleted_by_id,omitempty"` +} + +func (nm PackageNPMMetadata) String() string { + return Stringify(nm) +} diff --git a/github/packages_test.go b/github/packages_test.go index 718998f7efd..414ba503824 100644 --- a/github/packages_test.go +++ b/github/packages_test.go @@ -5,7 +5,11 @@ package github -import "testing" +import ( + "encoding/json" + "reflect" + "testing" +) func TestPackageRegistry_Marshal(t *testing.T) { t.Parallel() @@ -181,12 +185,22 @@ func TestPackageVersion_Marshal(t *testing.T) { t.Parallel() testJSONMarshal(t, &PackageVersion{}, "{}") + metadata, _ := json.Marshal([]string{"a", "b"}) + o := &PackageVersion{ - ID: Ptr(int64(1)), - Version: Ptr("ver"), - Summary: Ptr("sum"), - Body: Ptr("body"), - BodyHTML: Ptr("btnhtml"), + ID: Ptr(int64(1)), + Name: Ptr("n"), + URL: Ptr("url"), + PackageHTMLURL: Ptr("phurl"), + License: Ptr("l"), + Description: Ptr("d"), + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + Metadata: metadata, + Version: Ptr("ver"), + Summary: Ptr("sum"), + Body: json.RawMessage(`"body"`), + BodyHTML: Ptr("btnhtml"), Release: &PackageRelease{ URL: Ptr("url"), HTMLURL: Ptr("hurl"), @@ -226,8 +240,17 @@ func TestPackageVersion_Marshal(t *testing.T) { TargetOID: Ptr("tid"), Draft: Ptr(true), Prerelease: Ptr(true), - CreatedAt: &Timestamp{referenceTime}, - UpdatedAt: &Timestamp{referenceTime}, + ContainerMetadata: &PackageEventContainerMetadata{ + Labels: map[string]any{"l1": true, "l2": "a"}, + }, + DockerMetadata: []interface{}{"a", "b"}, + NPMMetadata: Ptr(PackageNPMMetadata{ + Name: Ptr("n"), + }), + NugetMetadata: []*PackageNugetMetadata{ + {Name: Ptr("n")}, + }, + RubyMetadata: map[string]any{"k1": "v1", "k2": "v2"}, PackageFiles: []*PackageFile{ { DownloadURL: Ptr("durl"), @@ -263,6 +286,7 @@ func TestPackageVersion_Marshal(t *testing.T) { UpdatedAt: &Timestamp{referenceTime}, }, }, + PackageURL: Ptr("purl"), Author: &User{ Login: Ptr("l"), ID: Ptr(int64(1)), @@ -283,11 +307,21 @@ func TestPackageVersion_Marshal(t *testing.T) { CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, + SourceURL: Ptr("surl"), InstallationCommand: Ptr("ic"), + DeletedAt: &Timestamp{referenceTime}, } want := `{ "id": 1, + "name": "n", + "url": "url", + "package_html_url": "phurl", + "license": "l", + "description": "d", + "created_at": ` + referenceTimeStr + `, + "updated_at": ` + referenceTimeStr + `, + "metadata": ["a", "b"], "version": "ver", "summary": "sum", "body": "body", @@ -331,8 +365,21 @@ func TestPackageVersion_Marshal(t *testing.T) { "target_oid": "tid", "draft": true, "prerelease": true, - "created_at": ` + referenceTimeStr + `, - "updated_at": ` + referenceTimeStr + `, + "container_metadata": { + "labels": { + "l1": true, + "l2": "a" + } + }, + "docker_metadata": ["a", "b"], + "npm_metadata": { + "name": "n" + }, + "nuget_metadata": [{"name": "n"}], + "ruby_metadata": { + "k1": "v1", + "k2": "v2" + }, "package_files": [ { "download_url": "durl", @@ -368,6 +415,7 @@ func TestPackageVersion_Marshal(t *testing.T) { "updated_at": ` + referenceTimeStr + ` } ], + "package_url": "purl", "author": { "login": "l", "id": 1, @@ -388,12 +436,230 @@ func TestPackageVersion_Marshal(t *testing.T) { "suspended_at": ` + referenceTimeStr + `, "url": "u" }, - "installation_command": "ic" + "source_url": "surl", + "installation_command": "ic", + "deleted_at": ` + referenceTimeStr + ` }` testJSONMarshal(t, o, want) } +func TestPackageVersion_GetBody(t *testing.T) { + t.Parallel() + + tests := map[string]struct { + pv *PackageVersion + wantValue string + wantOk bool + }{ + "pv nil": { + pv: nil, + wantValue: "", + wantOk: false, + }, + "body nil": { + pv: &PackageVersion{ + Body: nil, + }, + wantValue: "", + wantOk: false, + }, + "invalid body": { + pv: &PackageVersion{ + Body: json.RawMessage(`{ + "repository": { + "name": "n" + }, + "info": { + "type": "t" + } + }`), + }, + wantValue: "", + wantOk: false, + }, + "valid body": { + pv: &PackageVersion{ + Body: json.RawMessage(`"body"`), + }, + wantValue: "body", + wantOk: true, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + t.Parallel() + + resValue, resOk := test.pv.GetBody() + + if resValue != test.wantValue || resOk != test.wantOk { + t.Errorf("PackageVersion.GetBody() - got: %v, %v; want: %v, %v", resValue, resOk, test.wantValue, test.wantOk) + } + }) + } +} + +func TestPackageVersion_GetBodyAsPackageVersionBody(t *testing.T) { + t.Parallel() + + tests := map[string]struct { + pv *PackageVersion + wantValue *PackageVersionBody + wantOk bool + }{ + "pv nil": { + pv: nil, + wantValue: nil, + wantOk: false, + }, + "body nil": { + pv: &PackageVersion{ + Body: nil, + }, + wantValue: nil, + wantOk: false, + }, + "invalid body": { + pv: &PackageVersion{ + Body: json.RawMessage(`"body"`), + }, + wantValue: nil, + wantOk: false, + }, + "valid body": { + pv: &PackageVersion{ + Body: json.RawMessage(`{ + "repository": { + "name": "n" + }, + "info": { + "type": "t" + } + }`), + }, + wantValue: &PackageVersionBody{ + Repo: &Repository{ + Name: Ptr("n"), + }, + Info: &PackageVersionBodyInfo{ + Type: Ptr("t"), + }, + }, + wantOk: true, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + t.Parallel() + + resValue, resOk := test.pv.GetBodyAsPackageVersionBody() + + if !reflect.DeepEqual(resValue, test.wantValue) || resOk != test.wantOk { + t.Errorf("PackageVersion.GetBodyAsPackageVersionBody() - got: %v, %v; want: %v, %v", resValue, resOk, test.wantValue, test.wantOk) + } + }) + } +} + +func TestPackageVersion_GetMetadata(t *testing.T) { + t.Parallel() + + tests := map[string]struct { + pv *PackageVersion + wantValue *PackageMetadata + wantOk bool + }{ + "pv nil": { + pv: nil, + wantValue: nil, + wantOk: false, + }, + "metadata nil": { + pv: &PackageVersion{ + Metadata: nil, + }, + wantValue: nil, + wantOk: false, + }, + "invalid metadata": { + pv: &PackageVersion{ + Metadata: json.RawMessage(`[]`), + }, + wantValue: nil, + wantOk: false, + }, + "valid metadata": { + pv: &PackageVersion{ + Metadata: json.RawMessage(`{ + "package_type": "container", + "container": { + "tags": ["a"] + } + }`), + }, + wantValue: &PackageMetadata{ + PackageType: Ptr("container"), + Container: &PackageContainerMetadata{ + Tags: []string{"a"}, + }, + }, + wantOk: true, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + t.Parallel() + + resValue, resOk := test.pv.GetMetadata() + + if !reflect.DeepEqual(resValue, test.wantValue) || resOk != test.wantOk { + t.Errorf("PackageVersion.GetMetadata() - got: %v, %v; want: %v, %v", resValue, resOk, test.wantValue, test.wantOk) + } + }) + } +} + +func TestPackageVersion_GetRawMetadata(t *testing.T) { + t.Parallel() + + tests := map[string]struct { + pv *PackageVersion + want json.RawMessage + }{ + "pv nil": { + pv: nil, + want: nil, + }, + "metadata nil": { + pv: &PackageVersion{ + Metadata: nil, + }, + want: json.RawMessage{}, + }, + "valid metadata": { + pv: &PackageVersion{ + Metadata: json.RawMessage(`"a"`), + }, + want: json.RawMessage(`"a"`), + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + t.Parallel() + + res := test.pv.GetRawMetadata() + + if string(res) != string(test.want) { + t.Errorf("PackageVersion.GetRawMetadata() - got: %v; want: %v", res, test.want) + } + }) + } +} + func TestPackage_Marshal(t *testing.T) { t.Parallel() testJSONMarshal(t, &Package{}, "{}") @@ -403,8 +669,6 @@ func TestPackage_Marshal(t *testing.T) { Name: Ptr("name"), PackageType: Ptr("pt"), HTMLURL: Ptr("hurl"), - CreatedAt: &Timestamp{referenceTime}, - UpdatedAt: &Timestamp{referenceTime}, Visibility: Ptr("private"), Owner: &User{ Login: Ptr("l"), @@ -426,11 +690,16 @@ func TestPackage_Marshal(t *testing.T) { CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + Namespace: Ptr("n"), + Description: Ptr("d"), + Ecosystem: Ptr("e"), PackageVersion: &PackageVersion{ ID: Ptr(int64(1)), Version: Ptr("ver"), Summary: Ptr("sum"), - Body: Ptr("body"), + Body: json.RawMessage(`"body"`), BodyHTML: Ptr("btnhtml"), Release: &PackageRelease{ URL: Ptr("url"), @@ -537,6 +806,8 @@ func TestPackage_Marshal(t *testing.T) { URL: Ptr("url"), Vendor: Ptr("vendor"), }, + URL: Ptr("url"), + VersionCount: Ptr(int64(1)), } want := `{ @@ -544,8 +815,6 @@ func TestPackage_Marshal(t *testing.T) { "name": "name", "package_type": "pt", "html_url": "hurl", - "created_at": ` + referenceTimeStr + `, - "updated_at": ` + referenceTimeStr + `, "visibility": "private", "owner": { "login": "l", @@ -567,6 +836,11 @@ func TestPackage_Marshal(t *testing.T) { "suspended_at": ` + referenceTimeStr + `, "url": "u" }, + "created_at": ` + referenceTimeStr + `, + "updated_at": ` + referenceTimeStr + `, + "namespace": "n", + "description": "d", + "ecosystem": "e", "package_version": { "id": 1, "version": "ver", @@ -677,8 +951,341 @@ func TestPackage_Marshal(t *testing.T) { "type": "type", "url": "url", "vendor": "vendor" + }, + "url": "url", + "version_count": 1 + }` + + testJSONMarshal(t, o, want) +} + +func TestPackageMetadata_Marshal(t *testing.T) { + t.Parallel() + testJSONMarshal(t, &PackageMetadata{}, "{}") + + o := &PackageMetadata{ + PackageType: Ptr("pt"), + Container: Ptr(PackageContainerMetadata{ + Tags: []string{"a"}, + }), + } + + want := `{ + "package_type": "pt", + "container": { + "tags": ["a"] } }` testJSONMarshal(t, o, want) } + +func TestPackageContainerMetadata_Marshal(t *testing.T) { + t.Parallel() + testJSONMarshal(t, &PackageContainerMetadata{}, "{}") + + o := &PackageContainerMetadata{ + Tags: []string{"a", "b"}, + } + + want := `{ + "tags": ["a","b"] + }` + + testJSONMarshal(t, o, want) +} + +func TestPackageVersionBody_Marshal(t *testing.T) { + t.Parallel() + testJSONMarshal(t, &PackageVersionBody{}, "{}") + + o := &PackageVersionBody{ + Repo: Ptr(Repository{ + ID: Ptr(int64(1)), + }), + Info: Ptr(PackageVersionBodyInfo{ + Type: Ptr("t"), + }), + } + + want := `{ + "repository": { + "id": 1 + }, + "info": { + "type": "t" + } + }` + + testJSONMarshal(t, o, want) +} + +func TestPackageVersionBodyInfo_Marshal(t *testing.T) { + t.Parallel() + testJSONMarshal(t, &PackageVersionBodyInfo{}, "{}") + + o := &PackageVersionBodyInfo{ + Type: Ptr("t"), + OID: Ptr("o"), + Mode: Ptr(int64(1)), + Name: Ptr("n"), + Path: Ptr("p"), + Size: Ptr(int64(1)), + Collection: Ptr(true), + } + + want := `{ + "type": "t", + "oid": "o", + "mode": 1, + "name": "n", + "path": "p", + "size": 1, + "collection": true + }` + + testJSONMarshal(t, o, want) +} + +func TestPackageEventContainerMetadata_Marshal(t *testing.T) { + t.Parallel() + testJSONMarshal(t, &PackageContainerMetadata{}, "{}") + + o := &PackageEventContainerMetadata{ + Labels: map[string]any{ + "k": "v", + }, + Manifest: map[string]any{ + "k": 1, + }, + Tag: &PackageEventContainerMetadataTag{ + Name: Ptr("n"), + Digest: Ptr("d"), + }, + } + + want := `{ + "labels": { + "k": "v" + }, + "manifest": { + "k": 1 + }, + "tag": { + "name": "n", + "digest": "d" + } + }` + + testJSONMarshal(t, o, want) +} + +func TestPackageEventContainerMetadataTag_Marshal(t *testing.T) { + t.Parallel() + + testJSONMarshal(t, &PackageEventContainerMetadataTag{}, "{}") + + o := &PackageEventContainerMetadataTag{ + Name: Ptr("n"), + Digest: Ptr("d"), + } + + want := `{ + "name": "n", + "digest": "d" + }` + + testJSONMarshal(t, o, want) +} + +func TestPackageNugetMetadata_Marshal(t *testing.T) { + t.Parallel() + + o, _ := json.Marshal(map[string]string{ + "k1": "v1", + "k2": "v2", + }) + + tests := map[string]struct { + input *PackageNugetMetadata + want string + }{ + "zero": { + input: &PackageNugetMetadata{}, + want: "{}", + }, + "string": { + input: &PackageNugetMetadata{ + ID: json.RawMessage(`1`), + Name: Ptr("n"), + Value: json.RawMessage(`"s"`), + }, + want: `{ + "id": 1, + "name": "n", + "value": "s" + }`, + }, + "int": { + input: &PackageNugetMetadata{ + ID: json.RawMessage(`1`), + Name: Ptr("n"), + Value: json.RawMessage(`1`), + }, + want: `{ + "id": 1, + "name": "n", + "value": 1 + }`, + }, + "object": { + input: &PackageNugetMetadata{ + ID: json.RawMessage(`1`), + Name: Ptr("n"), + Value: o, + }, + want: `{ + "id": 1, + "name": "n", + "value": { + "k1": "v1", + "k2": "v2" + } + }`, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + t.Parallel() + testJSONMarshal(t, test.input, test.want) + }) + } +} + +func TestPackageNPMMetadata_Marshal(t *testing.T) { + t.Parallel() + + tests := map[string]struct { + input *PackageNPMMetadata + want string + }{ + "zero": { + input: &PackageNPMMetadata{}, + want: "{}", + }, + "string": { + input: &PackageNPMMetadata{ + Name: Ptr("n"), + Version: Ptr("v"), + NPMUser: Ptr("nu"), + Description: Ptr("d"), + GitHead: Ptr("gh"), + Homepage: Ptr("h"), + License: Ptr("l"), + Main: Ptr("m"), + ID: Ptr("id"), + NodeVersion: Ptr("nv"), + NPMVersion: Ptr("npmv"), + Readme: Ptr("r"), + InstallationCommand: Ptr("ic"), + CommitOID: Ptr("coid"), + HasShrinkwrap: Ptr(true), + PublishedViaActions: Ptr(true), + ReleaseID: Ptr(int64(1)), + DeletedByID: Ptr(int64(1)), + Author: map[string]string{"k1": "v1"}, + Bugs: map[string]string{"k1": "v1"}, + Dependencies: map[string]string{"k1": "v1"}, + DevDependencies: map[string]string{"k1": "v1"}, + PeerDependencies: map[string]string{"k1": "v1"}, + OptionalDependencies: map[string]string{"k1": "v1"}, + Dist: map[string]string{"k1": "v1"}, + Repository: map[string]string{"k1": "v1"}, + Engines: map[string]string{"k1": "v1"}, + Directories: map[string]string{"k1": "v1"}, + Scripts: map[string]interface{}{"k1": 1}, + Bin: map[string]interface{}{"k1": true}, + Man: map[string]interface{}{"k1": "v1"}, + Keywords: []string{"kw1", "kw2"}, + Files: []string{"f1", "f2"}, + OS: []string{"os1", "os2"}, + CPU: []string{"cpu1", "cpu2"}, + Maintainers: []interface{}{"m1", "m2"}, + Contributors: []interface{}{"c1", "c2"}, + }, + want: `{ + "name": "n", + "version": "v", + "npm_user": "nu", + "description": "d", + "git_head": "gh", + "homepage": "h", + "license": "l", + "main": "m", + "ID": "id", + "node_version": "nv", + "npm_version": "npmv", + "readme": "r", + "installation_command": "ic", + "commit_oid": "coid", + "has_shrinkwrap": true, + "published_via_actions": true, + "release_id": 1, + "deleted_by_id": 1, + "author": { + "k1": "v1" + }, + "bugs": { + "k1": "v1" + }, + "dependencies": { + "k1": "v1" + }, + "dev_dependencies": { + "k1": "v1" + }, + "peer_dependencies": { + "k1": "v1" + }, + "optional_dependencies": { + "k1": "v1" + }, + "dist": { + "k1": "v1" + }, + "repository": { + "k1": "v1" + }, + "engines": { + "k1": "v1" + }, + "directories": { + "k1": "v1" + }, + "scripts": { + "k1": 1 + }, + "bin": { + "k1": true + }, + "man": { + "k1": "v1" + }, + "keywords": ["kw1", "kw2"], + "files": ["f1", "f2"], + "os": ["os1", "os2"], + "cpu": ["cpu1", "cpu2"], + "maintainers": ["m1", "m2"], + "contributors": ["c1", "c2"] + }`, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + t.Parallel() + testJSONMarshal(t, test.input, test.want) + }) + } +} diff --git a/github/users_packages_test.go b/github/users_packages_test.go index 3d1cffff569..3776e94f92e 100644 --- a/github/users_packages_test.go +++ b/github/users_packages_test.go @@ -7,6 +7,7 @@ package github import ( "context" + "encoding/json" "fmt" "net/http" "testing" @@ -340,6 +341,15 @@ func TestUsersService_Authenticated_ListPackagesVersions(t *testing.T) { t.Parallel() client, mux, _ := setup(t) + m := `{ + "package_type": "container", + "container": { + "tags": [ + "latest" + ] + } + }` + mux.HandleFunc("/user/packages/container/hello_docker/versions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `[ @@ -351,14 +361,7 @@ func TestUsersService_Authenticated_ListPackagesVersions(t *testing.T) { "created_at": `+referenceTimeStr+`, "updated_at": `+referenceTimeStr+`, "html_url": "https://github.com/users/octocat/packages/container/hello_docker/45763", - "metadata": { - "package_type": "container", - "container": { - "tags": [ - "latest" - ] - } - } + "metadata": `+m+` }]`) }) @@ -379,12 +382,7 @@ func TestUsersService_Authenticated_ListPackagesVersions(t *testing.T) { CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, HTMLURL: Ptr("https://github.com/users/octocat/packages/container/hello_docker/45763"), - Metadata: &PackageMetadata{ - PackageType: Ptr("container"), - Container: &PackageContainerMetadata{ - Tags: []string{"latest"}, - }, - }, + Metadata: json.RawMessage(m), }} if !cmp.Equal(packages, want) { t.Errorf("Users.PackageGetAllVersions returned %+v, want %+v", packages, want) @@ -409,6 +407,15 @@ func TestUsersService_specifiedUser_ListPackagesVersions(t *testing.T) { t.Parallel() client, mux, _ := setup(t) + m := `{ + "package_type": "container", + "container": { + "tags": [ + "latest" + ] + } + }` + mux.HandleFunc("/users/u/packages/container/hello_docker/versions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `[ @@ -420,14 +427,7 @@ func TestUsersService_specifiedUser_ListPackagesVersions(t *testing.T) { "created_at": `+referenceTimeStr+`, "updated_at": `+referenceTimeStr+`, "html_url": "https://github.com/users/octocat/packages/container/hello_docker/45763", - "metadata": { - "package_type": "container", - "container": { - "tags": [ - "latest" - ] - } - } + "metadata": `+m+` }]`) }) @@ -448,12 +448,7 @@ func TestUsersService_specifiedUser_ListPackagesVersions(t *testing.T) { CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, HTMLURL: Ptr("https://github.com/users/octocat/packages/container/hello_docker/45763"), - Metadata: &PackageMetadata{ - PackageType: Ptr("container"), - Container: &PackageContainerMetadata{ - Tags: []string{"latest"}, - }, - }, + Metadata: json.RawMessage(m), }} if !cmp.Equal(packages, want) { t.Errorf("Users.specifiedUser_PackageGetAllVersions returned %+v, want %+v", packages, want) @@ -478,6 +473,15 @@ func TestUsersService_Authenticated_PackageGetVersion(t *testing.T) { t.Parallel() client, mux, _ := setup(t) + m := `{ + "package_type": "container", + "container": { + "tags": [ + "latest" + ] + } + }` + mux.HandleFunc("/user/packages/container/hello_docker/versions/45763", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, ` @@ -489,14 +493,7 @@ func TestUsersService_Authenticated_PackageGetVersion(t *testing.T) { "created_at": `+referenceTimeStr+`, "updated_at": `+referenceTimeStr+`, "html_url": "https://github.com/users/octocat/packages/container/hello_docker/45763", - "metadata": { - "package_type": "container", - "container": { - "tags": [ - "latest" - ] - } - } + "metadata": `+m+` }`) }) @@ -514,12 +511,7 @@ func TestUsersService_Authenticated_PackageGetVersion(t *testing.T) { CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, HTMLURL: Ptr("https://github.com/users/octocat/packages/container/hello_docker/45763"), - Metadata: &PackageMetadata{ - PackageType: Ptr("container"), - Container: &PackageContainerMetadata{ - Tags: []string{"latest"}, - }, - }, + Metadata: json.RawMessage(m), } if !cmp.Equal(packages, want) { t.Errorf("Users.Authenticated_PackageGetVersion returned %+v, want %+v", packages, want) @@ -544,6 +536,15 @@ func TestUsersService_specifiedUser_PackageGetVersion(t *testing.T) { t.Parallel() client, mux, _ := setup(t) + m := `{ + "package_type": "container", + "container": { + "tags": [ + "latest" + ] + } + }` + mux.HandleFunc("/users/u/packages/container/hello_docker/versions/45763", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, ` @@ -555,14 +556,7 @@ func TestUsersService_specifiedUser_PackageGetVersion(t *testing.T) { "created_at": `+referenceTimeStr+`, "updated_at": `+referenceTimeStr+`, "html_url": "https://github.com/users/octocat/packages/container/hello_docker/45763", - "metadata": { - "package_type": "container", - "container": { - "tags": [ - "latest" - ] - } - } + "metadata": `+m+` }`) }) @@ -580,12 +574,7 @@ func TestUsersService_specifiedUser_PackageGetVersion(t *testing.T) { CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, HTMLURL: Ptr("https://github.com/users/octocat/packages/container/hello_docker/45763"), - Metadata: &PackageMetadata{ - PackageType: Ptr("container"), - Container: &PackageContainerMetadata{ - Tags: []string{"latest"}, - }, - }, + Metadata: json.RawMessage(m), } if !cmp.Equal(packages, want) { t.Errorf("Users.specifiedUser_PackageGetVersion returned %+v, want %+v", packages, want) From 665827c745601a8f02094e140a7eb15552f0ba41 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 18:20:12 -0400 Subject: [PATCH 676/751] build(deps): bump github.com/alecthomas/kong from 1.8.1 to 1.9.0 in /tools (#3518) --- tools/go.mod | 2 +- tools/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index 4085ea0fd50..9eb033fe8b4 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -3,7 +3,7 @@ module tools go 1.23.0 require ( - github.com/alecthomas/kong v1.8.1 + github.com/alecthomas/kong v1.9.0 github.com/getkin/kin-openapi v0.129.0 github.com/google/go-cmp v0.7.0 github.com/google/go-github/v69 v69.2.0 diff --git a/tools/go.sum b/tools/go.sum index 4c259e7ab3b..0ab131439c4 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -1,7 +1,7 @@ github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0= github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= -github.com/alecthomas/kong v1.8.1 h1:6aamvWBE/REnR/BCq10EcozmcpUPc5aGI1lPAWdB0EE= -github.com/alecthomas/kong v1.8.1/go.mod h1:p2vqieVMeTAnaC83txKtXe8FLke2X07aruPWXyMPQrU= +github.com/alecthomas/kong v1.9.0 h1:Wgg0ll5Ys7xDnpgYBuBn/wPeLGAuK0NvYmEcisJgrIs= +github.com/alecthomas/kong v1.9.0/go.mod h1:p2vqieVMeTAnaC83txKtXe8FLke2X07aruPWXyMPQrU= github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc= github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= From 9d7b5549ab8eaf787ad7dfee973d8106865abb94 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 18:28:45 -0400 Subject: [PATCH 677/751] build(deps): bump github.com/getkin/kin-openapi from 0.129.0 to 0.130.0 in /tools (#3517) --- tools/go.mod | 6 +++--- tools/go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index 9eb033fe8b4..54285d3104b 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -4,7 +4,7 @@ go 1.23.0 require ( github.com/alecthomas/kong v1.9.0 - github.com/getkin/kin-openapi v0.129.0 + github.com/getkin/kin-openapi v0.130.0 github.com/google/go-cmp v0.7.0 github.com/google/go-github/v69 v69.2.0 golang.org/x/sync v0.12.0 @@ -19,8 +19,8 @@ require ( github.com/josharian/intern v1.0.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect - github.com/oasdiff/yaml v0.0.0-20241210131133-6b86fb107d80 // indirect - github.com/oasdiff/yaml3 v0.0.0-20241210130736-a94c01f36349 // indirect + github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037 // indirect + github.com/oasdiff/yaml3 v0.0.0-20250309153720-d2182401db90 // indirect github.com/perimeterx/marshmallow v1.1.5 // indirect ) diff --git a/tools/go.sum b/tools/go.sum index 0ab131439c4..7d64c2b8f31 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -6,8 +6,8 @@ github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/getkin/kin-openapi v0.129.0 h1:QGYTNcmyP5X0AtFQ2Dkou9DGBJsUETeLH9rFrJXZh30= -github.com/getkin/kin-openapi v0.129.0/go.mod h1:gmWI+b/J45xqpyK5wJmRRZse5wefA5H0RDMK46kLUtI= +github.com/getkin/kin-openapi v0.130.0 h1:Sz8GTHfscqdsQCT/OJDSV3eNvEjZ8iUOlXbFxkG1Av0= +github.com/getkin/kin-openapi v0.130.0/go.mod h1:3OlG51PCYNsPByuiMB0t4fjnNlIDnaEDsjiKUV8nL58= github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= @@ -31,10 +31,10 @@ github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0 github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= -github.com/oasdiff/yaml v0.0.0-20241210131133-6b86fb107d80 h1:nZspmSkneBbtxU9TopEAE0CY+SBJLxO8LPUlw2vG4pU= -github.com/oasdiff/yaml v0.0.0-20241210131133-6b86fb107d80/go.mod h1:7tFDb+Y51LcDpn26GccuUgQXUk6t0CXZsivKjyimYX8= -github.com/oasdiff/yaml3 v0.0.0-20241210130736-a94c01f36349 h1:t05Ww3DxZutOqbMN+7OIuqDwXbhl32HiZGpLy26BAPc= -github.com/oasdiff/yaml3 v0.0.0-20241210130736-a94c01f36349/go.mod h1:y5+oSEHCPT/DGrS++Wc/479ERge0zTFxaF8PbGKcg2o= +github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037 h1:G7ERwszslrBzRxj//JalHPu/3yz+De2J+4aLtSRlHiY= +github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037/go.mod h1:2bpvgLBZEtENV5scfDFEtB/5+1M4hkQhDQrccEJ/qGw= +github.com/oasdiff/yaml3 v0.0.0-20250309153720-d2182401db90 h1:bQx3WeLcUWy+RletIKwUIt4x3t8n2SxavmoclizMb8c= +github.com/oasdiff/yaml3 v0.0.0-20250309153720-d2182401db90/go.mod h1:y5+oSEHCPT/DGrS++Wc/479ERge0zTFxaF8PbGKcg2o= github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s= github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= From 1282133b39b2663da0764089772cf77663347a5f Mon Sep 17 00:00:00 2001 From: Takumi Sue <23391543+mikutas@users.noreply.github.com> Date: Tue, 18 Mar 2025 07:31:38 +0900 Subject: [PATCH 678/751] feat: Add automatic_copilot_code_review_enabled parameter to ruleset API (#3506) --- github/event_types_test.go | 33 ++++++++++++++++------------- github/github-accessors.go | 8 +++++++ github/github-accessors_test.go | 11 ++++++++++ github/rules.go | 13 ++++++------ github/rules_test.go | 37 ++++++++++++++++++--------------- 5 files changed, 64 insertions(+), 38 deletions(-) diff --git a/github/event_types_test.go b/github/event_types_test.go index 35d57dbe303..296c1d35c9c 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -9637,11 +9637,12 @@ func TestRepositoryRulesetEvent_Unmarshal(t *testing.T) { MergeMethodRebase, MergeMethodMerge, }, - DismissStaleReviewsOnPush: false, - RequireCodeOwnerReview: false, - RequireLastPushApproval: false, - RequiredApprovingReviewCount: 2, - RequiredReviewThreadResolution: false, + AutomaticCopilotCodeReviewEnabled: Ptr(false), + DismissStaleReviewsOnPush: false, + RequireCodeOwnerReview: false, + RequireLastPushApproval: false, + RequiredApprovingReviewCount: 2, + RequiredReviewThreadResolution: false, }, CodeScanning: &CodeScanningRuleParameters{ CodeScanningTools: []*RuleCodeScanningTool{ @@ -9699,11 +9700,12 @@ func TestRepositoryRulesetEvent_Unmarshal(t *testing.T) { MergeMethodSquash, MergeMethodRebase, }, - DismissStaleReviewsOnPush: false, - RequireCodeOwnerReview: false, - RequireLastPushApproval: false, - RequiredApprovingReviewCount: 2, - RequiredReviewThreadResolution: false, + AutomaticCopilotCodeReviewEnabled: Ptr(false), + DismissStaleReviewsOnPush: false, + RequireCodeOwnerReview: false, + RequireLastPushApproval: false, + RequiredApprovingReviewCount: 2, + RequiredReviewThreadResolution: false, }, CodeScanning: &CodeScanningRuleParameters{ CodeScanningTools: []*RuleCodeScanningTool{ @@ -9753,11 +9755,12 @@ func TestRepositoryRulesetEvent_Unmarshal(t *testing.T) { MergeMethodSquash, MergeMethodRebase, }, - DismissStaleReviewsOnPush: false, - RequireCodeOwnerReview: false, - RequireLastPushApproval: false, - RequiredApprovingReviewCount: 2, - RequiredReviewThreadResolution: false, + AutomaticCopilotCodeReviewEnabled: Ptr(false), + DismissStaleReviewsOnPush: false, + RequireCodeOwnerReview: false, + RequireLastPushApproval: false, + RequiredApprovingReviewCount: 2, + RequiredReviewThreadResolution: false, }, }, Changes: &RepositoryRulesetChangedRule{ diff --git a/github/github-accessors.go b/github/github-accessors.go index 40d935f1719..ec029df2419 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -20006,6 +20006,14 @@ func (p *PullRequestReviewThreadEvent) GetThread() *PullRequestThread { return p.Thread } +// GetAutomaticCopilotCodeReviewEnabled returns the AutomaticCopilotCodeReviewEnabled field if it's non-nil, zero value otherwise. +func (p *PullRequestRuleParameters) GetAutomaticCopilotCodeReviewEnabled() bool { + if p == nil || p.AutomaticCopilotCodeReviewEnabled == nil { + return false + } + return *p.AutomaticCopilotCodeReviewEnabled +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (p *PullRequestTargetEvent) GetAction() string { if p == nil || p.Action == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index c9a7b840653..b2e4232950d 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -25800,6 +25800,17 @@ func TestPullRequestReviewThreadEvent_GetThread(tt *testing.T) { p.GetThread() } +func TestPullRequestRuleParameters_GetAutomaticCopilotCodeReviewEnabled(tt *testing.T) { + tt.Parallel() + var zeroValue bool + p := &PullRequestRuleParameters{AutomaticCopilotCodeReviewEnabled: &zeroValue} + p.GetAutomaticCopilotCodeReviewEnabled() + p = &PullRequestRuleParameters{} + p.GetAutomaticCopilotCodeReviewEnabled() + p = nil + p.GetAutomaticCopilotCodeReviewEnabled() +} + func TestPullRequestTargetEvent_GetAction(tt *testing.T) { tt.Parallel() var zeroValue string diff --git a/github/rules.go b/github/rules.go index 8312d95237f..985f0aac100 100644 --- a/github/rules.go +++ b/github/rules.go @@ -395,12 +395,13 @@ type RequiredDeploymentsRuleParameters struct { // PullRequestRuleParameters represents the pull_request rule parameters. type PullRequestRuleParameters struct { - AllowedMergeMethods []MergeMethod `json:"allowed_merge_methods"` - DismissStaleReviewsOnPush bool `json:"dismiss_stale_reviews_on_push"` - RequireCodeOwnerReview bool `json:"require_code_owner_review"` - RequireLastPushApproval bool `json:"require_last_push_approval"` - RequiredApprovingReviewCount int `json:"required_approving_review_count"` - RequiredReviewThreadResolution bool `json:"required_review_thread_resolution"` + AllowedMergeMethods []MergeMethod `json:"allowed_merge_methods"` + AutomaticCopilotCodeReviewEnabled *bool `json:"automatic_copilot_code_review_enabled,omitempty"` + DismissStaleReviewsOnPush bool `json:"dismiss_stale_reviews_on_push"` + RequireCodeOwnerReview bool `json:"require_code_owner_review"` + RequireLastPushApproval bool `json:"require_last_push_approval"` + RequiredApprovingReviewCount int `json:"required_approving_review_count"` + RequiredReviewThreadResolution bool `json:"required_review_thread_resolution"` } // RequiredStatusChecksRuleParameters represents the required status checks rule parameters. diff --git a/github/rules_test.go b/github/rules_test.go index ec58db117df..afd679cc2ac 100644 --- a/github/rules_test.go +++ b/github/rules_test.go @@ -59,11 +59,12 @@ func TestRulesetRules(t *testing.T) { MergeMethodSquash, MergeMethodRebase, }, - DismissStaleReviewsOnPush: true, - RequireCodeOwnerReview: true, - RequireLastPushApproval: true, - RequiredApprovingReviewCount: 2, - RequiredReviewThreadResolution: true, + AutomaticCopilotCodeReviewEnabled: nil, + DismissStaleReviewsOnPush: true, + RequireCodeOwnerReview: true, + RequireLastPushApproval: true, + RequiredApprovingReviewCount: 2, + RequiredReviewThreadResolution: true, }, RequiredStatusChecks: &RequiredStatusChecksRuleParameters{ RequiredStatusChecks: []*RuleStatusCheck{ @@ -149,11 +150,12 @@ func TestRulesetRules(t *testing.T) { MergeMethodSquash, MergeMethodRebase, }, - DismissStaleReviewsOnPush: true, - RequireCodeOwnerReview: true, - RequireLastPushApproval: true, - RequiredApprovingReviewCount: 2, - RequiredReviewThreadResolution: true, + AutomaticCopilotCodeReviewEnabled: Ptr(false), + DismissStaleReviewsOnPush: true, + RequireCodeOwnerReview: true, + RequireLastPushApproval: true, + RequiredApprovingReviewCount: 2, + RequiredReviewThreadResolution: true, }, RequiredStatusChecks: &RequiredStatusChecksRuleParameters{ DoNotEnforceOnCreate: Ptr(true), @@ -234,7 +236,7 @@ func TestRulesetRules(t *testing.T) { }, }, }, - `[{"type":"creation"},{"type":"update","parameters":{"update_allows_fetch_and_merge":true}},{"type":"deletion"},{"type":"required_linear_history"},{"type":"merge_queue","parameters":{"check_response_timeout_minutes":5,"grouping_strategy":"ALLGREEN","max_entries_to_build":10,"max_entries_to_merge":20,"merge_method":"squash","min_entries_to_merge":1,"min_entries_to_merge_wait_minutes":15}},{"type":"required_deployments","parameters":{"required_deployment_environments":["test1","test2"]}},{"type":"required_signatures"},{"type":"pull_request","parameters":{"allowed_merge_methods":["squash","rebase"],"dismiss_stale_reviews_on_push":true,"require_code_owner_review":true,"require_last_push_approval":true,"required_approving_review_count":2,"required_review_thread_resolution":true}},{"type":"required_status_checks","parameters":{"do_not_enforce_on_create":true,"required_status_checks":[{"context":"test1","integration_id":1},{"context":"test2","integration_id":2}],"strict_required_status_checks_policy":true}},{"type":"non_fast_forward"},{"type":"commit_message_pattern","parameters":{"name":"cmp","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"commit_author_email_pattern","parameters":{"name":"caep","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"committer_email_pattern","parameters":{"name":"cep","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"branch_name_pattern","parameters":{"name":"bp","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"tag_name_pattern","parameters":{"name":"tp","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"file_path_restriction","parameters":{"restricted_file_paths":["test1","test2"]}},{"type":"max_file_path_length","parameters":{"max_file_path_length":512}},{"type":"file_extension_restriction","parameters":{"restricted_file_extensions":[".exe",".pkg"]}},{"type":"max_file_size","parameters":{"max_file_size":1024}},{"type":"workflows","parameters":{"do_not_enforce_on_create":true,"workflows":[{"path":".github/workflows/test1.yaml","ref":"main","repository_id":1,"sha":"aaaa"},{"path":".github/workflows/test2.yaml","ref":"main","repository_id":2,"sha":"bbbb"}]}},{"type":"code_scanning","parameters":{"code_scanning_tools":[{"alerts_threshold":"all","security_alerts_threshold":"all","tool":"test"},{"alerts_threshold":"none","security_alerts_threshold":"none","tool":"test"}]}}]`, + `[{"type":"creation"},{"type":"update","parameters":{"update_allows_fetch_and_merge":true}},{"type":"deletion"},{"type":"required_linear_history"},{"type":"merge_queue","parameters":{"check_response_timeout_minutes":5,"grouping_strategy":"ALLGREEN","max_entries_to_build":10,"max_entries_to_merge":20,"merge_method":"squash","min_entries_to_merge":1,"min_entries_to_merge_wait_minutes":15}},{"type":"required_deployments","parameters":{"required_deployment_environments":["test1","test2"]}},{"type":"required_signatures"},{"type":"pull_request","parameters":{"allowed_merge_methods":["squash","rebase"],"automatic_copilot_code_review_enabled":false,"dismiss_stale_reviews_on_push":true,"require_code_owner_review":true,"require_last_push_approval":true,"required_approving_review_count":2,"required_review_thread_resolution":true}},{"type":"required_status_checks","parameters":{"do_not_enforce_on_create":true,"required_status_checks":[{"context":"test1","integration_id":1},{"context":"test2","integration_id":2}],"strict_required_status_checks_policy":true}},{"type":"non_fast_forward"},{"type":"commit_message_pattern","parameters":{"name":"cmp","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"commit_author_email_pattern","parameters":{"name":"caep","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"committer_email_pattern","parameters":{"name":"cep","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"branch_name_pattern","parameters":{"name":"bp","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"tag_name_pattern","parameters":{"name":"tp","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"file_path_restriction","parameters":{"restricted_file_paths":["test1","test2"]}},{"type":"max_file_path_length","parameters":{"max_file_path_length":512}},{"type":"file_extension_restriction","parameters":{"restricted_file_extensions":[".exe",".pkg"]}},{"type":"max_file_size","parameters":{"max_file_size":1024}},{"type":"workflows","parameters":{"do_not_enforce_on_create":true,"workflows":[{"path":".github/workflows/test1.yaml","ref":"main","repository_id":1,"sha":"aaaa"},{"path":".github/workflows/test2.yaml","ref":"main","repository_id":2,"sha":"bbbb"}]}},{"type":"code_scanning","parameters":{"code_scanning_tools":[{"alerts_threshold":"all","security_alerts_threshold":"all","tool":"test"},{"alerts_threshold":"none","security_alerts_threshold":"none","tool":"test"}]}}]`, }, } @@ -724,14 +726,15 @@ func TestRepositoryRule(t *testing.T) { MergeMethodSquash, MergeMethodRebase, }, - DismissStaleReviewsOnPush: true, - RequireCodeOwnerReview: true, - RequireLastPushApproval: true, - RequiredApprovingReviewCount: 2, - RequiredReviewThreadResolution: true, + AutomaticCopilotCodeReviewEnabled: Ptr(true), + DismissStaleReviewsOnPush: true, + RequireCodeOwnerReview: true, + RequireLastPushApproval: true, + RequiredApprovingReviewCount: 2, + RequiredReviewThreadResolution: true, }, }, - `{"type":"pull_request","parameters":{"allowed_merge_methods":["squash","rebase"],"dismiss_stale_reviews_on_push":true,"require_code_owner_review":true,"require_last_push_approval":true,"required_approving_review_count":2,"required_review_thread_resolution":true}}`, + `{"type":"pull_request","parameters":{"allowed_merge_methods":["squash","rebase"],"automatic_copilot_code_review_enabled": true,"dismiss_stale_reviews_on_push":true,"require_code_owner_review":true,"require_last_push_approval":true,"required_approving_review_count":2,"required_review_thread_resolution":true}}`, }, { "required_status_checks", From 134f6b47e5470e34d3721845627a1938090c5cd7 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Mon, 17 Mar 2025 19:43:28 -0400 Subject: [PATCH 679/751] Bump version of go-github to v70.0.0 (#3520) --- README.md | 18 +++++++++--------- example/actionpermissions/main.go | 2 +- example/appengine/app.go | 2 +- example/basicauth/main.go | 2 +- .../newreposecretwithxcrypto/main.go | 2 +- .../newusersecretwithxcrypto/main.go | 2 +- example/commitpr/main.go | 2 +- example/go.mod | 6 +++--- example/listenvironments/main.go | 2 +- example/migrations/main.go | 2 +- example/newfilewithappauth/main.go | 2 +- example/newrepo/main.go | 2 +- example/newreposecretwithlibsodium/go.mod | 4 ++-- example/newreposecretwithlibsodium/main.go | 2 +- example/newreposecretwithxcrypto/main.go | 2 +- example/ratelimit/main.go | 2 +- example/simple/main.go | 2 +- example/tokenauth/main.go | 2 +- example/topics/main.go | 2 +- example/verifyartifact/main.go | 2 +- github/doc.go | 2 +- github/examples_test.go | 2 +- github/github.go | 2 +- go.mod | 2 +- test/fields/fields.go | 2 +- test/integration/activity_test.go | 2 +- test/integration/authorizations_test.go | 2 +- test/integration/github_test.go | 2 +- test/integration/repos_test.go | 2 +- test/integration/users_test.go | 2 +- tools/go.mod | 4 ++-- tools/metadata/main.go | 2 +- tools/metadata/main_test.go | 2 +- tools/metadata/metadata.go | 2 +- tools/metadata/openapi.go | 2 +- 35 files changed, 47 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index 397a7a74c79..74223c0ab72 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-github # [![go-github release (latest SemVer)](https://img.shields.io/github/v/release/google/go-github?sort=semver)](https://github.com/google/go-github/releases) -[![Go Reference](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v69/github) +[![Go Reference](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v70/github) [![Test Status](https://github.com/google/go-github/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/google/go-github/actions/workflows/tests.yml) [![Test Coverage](https://codecov.io/gh/google/go-github/branch/master/graph/badge.svg)](https://codecov.io/gh/google/go-github) [![Discuss at go-github@googlegroups.com](https://img.shields.io/badge/discuss-go--github%40googlegroups.com-blue.svg)](https://groups.google.com/group/go-github) @@ -30,7 +30,7 @@ If you're interested in using the [GraphQL API v4][], the recommended library is go-github is compatible with modern Go releases in module mode, with Go installed: ```bash -go get github.com/google/go-github/v69 +go get github.com/google/go-github/v70 ``` will resolve and add the package to the current development module, along with its dependencies. @@ -38,7 +38,7 @@ will resolve and add the package to the current development module, along with i Alternatively the same can be achieved if you use import in a package: ```go -import "github.com/google/go-github/v69/github" +import "github.com/google/go-github/v70/github" ``` and run `go get` without parameters. @@ -46,13 +46,13 @@ and run `go get` without parameters. Finally, to use the top-of-trunk version of this repo, use the following command: ```bash -go get github.com/google/go-github/v69@master +go get github.com/google/go-github/v70@master ``` ## Usage ## ```go -import "github.com/google/go-github/v69/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) +import "github.com/google/go-github/v70/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled ``` @@ -125,7 +125,7 @@ import ( "net/http" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v69/github" + "github.com/google/go-github/v70/github" ) func main() { @@ -159,7 +159,7 @@ import ( "os" "strconv" - "github.com/google/go-github/v69/github" + "github.com/google/go-github/v70/github" "github.com/jferrl/go-githubauth" "golang.org/x/oauth2" ) @@ -380,7 +380,7 @@ For complete usage of go-github, see the full [package docs][]. [GitHub API v3]: https://docs.github.com/en/rest [personal access token]: https://github.com/blog/1509-personal-api-tokens -[package docs]: https://pkg.go.dev/github.com/google/go-github/v69/github +[package docs]: https://pkg.go.dev/github.com/google/go-github/v70/github [GraphQL API v4]: https://developer.github.com/v4/ [shurcooL/githubv4]: https://github.com/shurcooL/githubv4 [GitHub webhook events]: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads @@ -454,7 +454,7 @@ Versions prior to 48.2.0 are not listed. | go-github Version | GitHub v3 API Version | | ----------------- | --------------------- | -| 69.x.0 | 2022-11-28 | +| 70.0.0 | 2022-11-28 | | ... | 2022-11-28 | | 48.2.0 | 2022-11-28 | diff --git a/example/actionpermissions/main.go b/example/actionpermissions/main.go index 7766c5fbc2d..991010d02b4 100644 --- a/example/actionpermissions/main.go +++ b/example/actionpermissions/main.go @@ -14,7 +14,7 @@ import ( "log" "os" - "github.com/google/go-github/v69/github" + "github.com/google/go-github/v70/github" ) var ( diff --git a/example/appengine/app.go b/example/appengine/app.go index 0cbec256895..d8a39af1cc6 100644 --- a/example/appengine/app.go +++ b/example/appengine/app.go @@ -12,7 +12,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v69/github" + "github.com/google/go-github/v70/github" "google.golang.org/appengine" "google.golang.org/appengine/log" ) diff --git a/example/basicauth/main.go b/example/basicauth/main.go index 501cb4f20fa..d9407455a87 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -21,7 +21,7 @@ import ( "os" "strings" - "github.com/google/go-github/v69/github" + "github.com/google/go-github/v70/github" "golang.org/x/term" ) diff --git a/example/codespaces/newreposecretwithxcrypto/main.go b/example/codespaces/newreposecretwithxcrypto/main.go index abdf74ebc9f..a7d4c76d173 100644 --- a/example/codespaces/newreposecretwithxcrypto/main.go +++ b/example/codespaces/newreposecretwithxcrypto/main.go @@ -37,7 +37,7 @@ import ( "log" "os" - "github.com/google/go-github/v69/github" + "github.com/google/go-github/v70/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/codespaces/newusersecretwithxcrypto/main.go b/example/codespaces/newusersecretwithxcrypto/main.go index 873a583f670..0aa15f0e20b 100644 --- a/example/codespaces/newusersecretwithxcrypto/main.go +++ b/example/codespaces/newusersecretwithxcrypto/main.go @@ -38,7 +38,7 @@ import ( "log" "os" - "github.com/google/go-github/v69/github" + "github.com/google/go-github/v70/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index f380484fcc5..9ee111733f6 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -33,7 +33,7 @@ import ( "time" "github.com/ProtonMail/go-crypto/openpgp" - "github.com/google/go-github/v69/github" + "github.com/google/go-github/v70/github" ) var ( diff --git a/example/go.mod b/example/go.mod index 34b1f2e4d96..bf1f412abf9 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v69/example +module github.com/google/go-github/v70/example go 1.23.0 @@ -7,7 +7,7 @@ require ( github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-pagination v1.0.0 github.com/gofri/go-github-ratelimit/v2 v2.0.2 - github.com/google/go-github/v69 v69.2.0 + github.com/google/go-github/v70 v70.0.0 github.com/sigstore/sigstore-go v0.6.1 golang.org/x/crypto v0.35.0 golang.org/x/term v0.29.0 @@ -100,4 +100,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v69 => ../ +replace github.com/google/go-github/v70 => ../ diff --git a/example/listenvironments/main.go b/example/listenvironments/main.go index 0f82096c399..6cc10bdd826 100644 --- a/example/listenvironments/main.go +++ b/example/listenvironments/main.go @@ -18,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v69/github" + "github.com/google/go-github/v70/github" ) func main() { diff --git a/example/migrations/main.go b/example/migrations/main.go index bdf3a50c3a1..98138ad5ed4 100644 --- a/example/migrations/main.go +++ b/example/migrations/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v69/github" + "github.com/google/go-github/v70/github" ) func fetchAllUserMigrations() ([]*github.UserMigration, error) { diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index 1f7d10bfafc..245d084b434 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -16,7 +16,7 @@ import ( "time" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v69/github" + "github.com/google/go-github/v70/github" ) func main() { diff --git a/example/newrepo/main.go b/example/newrepo/main.go index 33c80537acb..12d8caf4be4 100644 --- a/example/newrepo/main.go +++ b/example/newrepo/main.go @@ -16,7 +16,7 @@ import ( "log" "os" - "github.com/google/go-github/v69/github" + "github.com/google/go-github/v70/github" ) var ( diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index 8e5afd9c257..f26c004ba2c 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -4,10 +4,10 @@ go 1.23.0 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb - github.com/google/go-github/v69 v69.2.0 + github.com/google/go-github/v70 v70.0.0 ) require github.com/google/go-querystring v1.1.0 // indirect // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v69 => ../.. +replace github.com/google/go-github/v70 => ../.. diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index 2ae76b8e831..917faf35b9b 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -36,7 +36,7 @@ import ( "os" sodium "github.com/GoKillers/libsodium-go/cryptobox" - "github.com/google/go-github/v69/github" + "github.com/google/go-github/v70/github" ) var ( diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index b226b44a0cd..2af567439e0 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -37,7 +37,7 @@ import ( "log" "os" - "github.com/google/go-github/v69/github" + "github.com/google/go-github/v70/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/ratelimit/main.go b/example/ratelimit/main.go index 70c7424c437..fbb474fdb0f 100644 --- a/example/ratelimit/main.go +++ b/example/ratelimit/main.go @@ -17,7 +17,7 @@ import ( "github.com/gofri/go-github-ratelimit/v2/github_ratelimit" "github.com/gofri/go-github-ratelimit/v2/github_ratelimit/github_primary_ratelimit" "github.com/gofri/go-github-ratelimit/v2/github_ratelimit/github_secondary_ratelimit" - "github.com/google/go-github/v69/github" + "github.com/google/go-github/v70/github" ) func main() { diff --git a/example/simple/main.go b/example/simple/main.go index 8b11c308601..b1b2d8cecc0 100644 --- a/example/simple/main.go +++ b/example/simple/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v69/github" + "github.com/google/go-github/v70/github" ) // Fetch all the public organizations' membership of a user. diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index 6cf8680d47d..c872d40adba 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -15,7 +15,7 @@ import ( "log" "os" - "github.com/google/go-github/v69/github" + "github.com/google/go-github/v70/github" "golang.org/x/term" ) diff --git a/example/topics/main.go b/example/topics/main.go index fb97e0b7884..08b3f105ea2 100644 --- a/example/topics/main.go +++ b/example/topics/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v69/github" + "github.com/google/go-github/v70/github" ) // Fetch and lists all the public topics associated with the specified GitHub topic. diff --git a/example/verifyartifact/main.go b/example/verifyartifact/main.go index d3845bd23a1..ae0401b97ed 100644 --- a/example/verifyartifact/main.go +++ b/example/verifyartifact/main.go @@ -18,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v69/github" + "github.com/google/go-github/v70/github" "github.com/sigstore/sigstore-go/pkg/bundle" "github.com/sigstore/sigstore-go/pkg/root" "github.com/sigstore/sigstore-go/pkg/verify" diff --git a/github/doc.go b/github/doc.go index 79d92d9ee07..befbd8b8dbb 100644 --- a/github/doc.go +++ b/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v69/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v70/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to diff --git a/github/examples_test.go b/github/examples_test.go index 418b6b6cf76..dd8da6539f1 100644 --- a/github/examples_test.go +++ b/github/examples_test.go @@ -12,7 +12,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v69/github" + "github.com/google/go-github/v70/github" ) func ExampleMarkdownService_Render() { diff --git a/github/github.go b/github/github.go index e78810df123..f31473edff6 100644 --- a/github/github.go +++ b/github/github.go @@ -29,7 +29,7 @@ import ( ) const ( - Version = "v69.2.0" + Version = "v70.0.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" diff --git a/go.mod b/go.mod index c49b5393d8c..7cb5bf0d072 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v69 +module github.com/google/go-github/v70 go 1.23.0 diff --git a/test/fields/fields.go b/test/fields/fields.go index a041907baea..5d21934d1eb 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -25,7 +25,7 @@ import ( "reflect" "strings" - "github.com/google/go-github/v69/github" + "github.com/google/go-github/v70/github" ) var ( diff --git a/test/integration/activity_test.go b/test/integration/activity_test.go index 89a5049f9c9..77acbe3fade 100644 --- a/test/integration/activity_test.go +++ b/test/integration/activity_test.go @@ -11,7 +11,7 @@ import ( "context" "testing" - "github.com/google/go-github/v69/github" + "github.com/google/go-github/v70/github" ) const ( diff --git a/test/integration/authorizations_test.go b/test/integration/authorizations_test.go index 97c262752df..0fe0128f52e 100644 --- a/test/integration/authorizations_test.go +++ b/test/integration/authorizations_test.go @@ -14,7 +14,7 @@ import ( "testing" "time" - "github.com/google/go-github/v69/github" + "github.com/google/go-github/v70/github" ) const msgEnvMissing = "Skipping test because the required environment variable (%v) is not present." diff --git a/test/integration/github_test.go b/test/integration/github_test.go index 059e11ec8b0..f4099946c41 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -14,7 +14,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v69/github" + "github.com/google/go-github/v70/github" ) var ( diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index 936dc5b7f7f..6b6e0e23a26 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -14,7 +14,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v69/github" + "github.com/google/go-github/v70/github" ) func TestRepositories_CRUD(t *testing.T) { diff --git a/test/integration/users_test.go b/test/integration/users_test.go index 0589bb773a1..b014da21351 100644 --- a/test/integration/users_test.go +++ b/test/integration/users_test.go @@ -13,7 +13,7 @@ import ( "math/rand" "testing" - "github.com/google/go-github/v69/github" + "github.com/google/go-github/v70/github" ) func TestUsers_Get(t *testing.T) { diff --git a/tools/go.mod b/tools/go.mod index 54285d3104b..826d918a9bc 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -6,7 +6,7 @@ require ( github.com/alecthomas/kong v1.9.0 github.com/getkin/kin-openapi v0.130.0 github.com/google/go-cmp v0.7.0 - github.com/google/go-github/v69 v69.2.0 + github.com/google/go-github/v70 v70.0.0 golang.org/x/sync v0.12.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -25,4 +25,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v69 => ../ +replace github.com/google/go-github/v70 => ../ diff --git a/tools/metadata/main.go b/tools/metadata/main.go index ceb7117aa55..9c3f427b066 100644 --- a/tools/metadata/main.go +++ b/tools/metadata/main.go @@ -16,7 +16,7 @@ import ( "path/filepath" "github.com/alecthomas/kong" - "github.com/google/go-github/v69/github" + "github.com/google/go-github/v70/github" ) var helpVars = kong.Vars{ diff --git a/tools/metadata/main_test.go b/tools/metadata/main_test.go index 251293d2b7d..291314cc07d 100644 --- a/tools/metadata/main_test.go +++ b/tools/metadata/main_test.go @@ -23,7 +23,7 @@ import ( "github.com/alecthomas/kong" "github.com/getkin/kin-openapi/openapi3" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v69/github" + "github.com/google/go-github/v70/github" ) func TestUpdateGo(t *testing.T) { diff --git a/tools/metadata/metadata.go b/tools/metadata/metadata.go index 101b3eeb6ac..9788db318ff 100644 --- a/tools/metadata/metadata.go +++ b/tools/metadata/metadata.go @@ -24,7 +24,7 @@ import ( "strings" "sync" - "github.com/google/go-github/v69/github" + "github.com/google/go-github/v70/github" "gopkg.in/yaml.v3" ) diff --git a/tools/metadata/openapi.go b/tools/metadata/openapi.go index 6088295e4da..cc7307239d2 100644 --- a/tools/metadata/openapi.go +++ b/tools/metadata/openapi.go @@ -14,7 +14,7 @@ import ( "strconv" "github.com/getkin/kin-openapi/openapi3" - "github.com/google/go-github/v69/github" + "github.com/google/go-github/v70/github" "golang.org/x/sync/errgroup" ) From 8f3c64eec5b4afeee79b26f76ac5a67d73dcdeee Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Mon, 17 Mar 2025 19:59:38 -0400 Subject: [PATCH 680/751] Bump go-github from v69 to v70 in /scrape (#3521) --- scrape/apps.go | 2 +- scrape/apps_test.go | 2 +- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scrape/apps.go b/scrape/apps.go index 2111535330a..8bc84690be2 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -18,7 +18,7 @@ import ( "strings" "github.com/PuerkitoBio/goquery" - "github.com/google/go-github/v69/github" + "github.com/google/go-github/v70/github" ) // AppRestrictionsEnabled returns whether the specified organization has diff --git a/scrape/apps_test.go b/scrape/apps_test.go index b26f6ceb4d1..bf2c901ac18 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -10,7 +10,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v69/github" + "github.com/google/go-github/v70/github" ) func Test_AppRestrictionsEnabled(t *testing.T) { diff --git a/scrape/go.mod b/scrape/go.mod index 6c62db65ae5..a309cffc515 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -5,7 +5,7 @@ go 1.23.0 require ( github.com/PuerkitoBio/goquery v1.10.2 github.com/google/go-cmp v0.7.0 - github.com/google/go-github/v69 v69.2.0 + github.com/google/go-github/v70 v70.0.0 github.com/xlzd/gotp v0.1.0 golang.org/x/net v0.37.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index fd8988cf589..efa89279a5d 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -6,8 +6,8 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/go-github/v69 v69.2.0 h1:wR+Wi/fN2zdUx9YxSmYE0ktiX9IAR/BeePzeaUUbEHE= -github.com/google/go-github/v69 v69.2.0/go.mod h1:xne4jymxLR6Uj9b7J7PyTpkMYstEMMwGZa0Aehh1azM= +github.com/google/go-github/v70 v70.0.0 h1:/tqCp5KPrcvqCc7vIvYyFYTiCGrYvaWoYMGHSQbo55o= +github.com/google/go-github/v70 v70.0.0/go.mod h1:xBUZgo8MI3lUL/hwxl3hlceJW1U8MVnXP3zUyI+rhQY= 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.1.0 h1:37blvlKCh38s+fkem+fFh7sMnceltoIEBYTVXyoa5Po= From bcfcb89f92d5d9aa5153f250850c898433f208cd Mon Sep 17 00:00:00 2001 From: Abinand P Date: Tue, 18 Mar 2025 21:51:27 +0530 Subject: [PATCH 681/751] Path escape fix in UserService.GetPackage() (#3522) --- github/users_packages.go | 5 +++-- github/users_packages_test.go | 23 +++++++++++++---------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/github/users_packages.go b/github/users_packages.go index 3ccf68a1696..b813dd9d14f 100644 --- a/github/users_packages.go +++ b/github/users_packages.go @@ -8,6 +8,7 @@ package github import ( "context" "fmt" + "net/url" ) // ListPackages lists the packages for a user. Passing the empty string for "user" will @@ -55,9 +56,9 @@ func (s *UsersService) ListPackages(ctx context.Context, user string, opts *Pack func (s *UsersService) GetPackage(ctx context.Context, user, packageType, packageName string) (*Package, *Response, error) { var u string if user != "" { - u = fmt.Sprintf("users/%v/packages/%v/%v", user, packageType, packageName) + u = fmt.Sprintf("users/%v/packages/%v/%v", user, packageType, url.PathEscape(packageName)) } else { - u = fmt.Sprintf("user/packages/%v/%v", packageType, packageName) + u = fmt.Sprintf("user/packages/%v/%v", packageType, url.PathEscape(packageName)) } req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/users_packages_test.go b/github/users_packages_test.go index 3776e94f92e..9de73583615 100644 --- a/github/users_packages_test.go +++ b/github/users_packages_test.go @@ -9,6 +9,7 @@ import ( "context" "encoding/json" "fmt" + "io" "net/http" "testing" @@ -131,42 +132,44 @@ func TestUsersService_specifiedUser_GetPackage(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/users/u/packages/container/hello_docker", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/users/u/packages/container/hello%2fhello_docker", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - fmt.Fprint(w, `{ + _, err := io.WriteString(w, `{ "id": 197, - "name": "hello_docker", + "name": "hello/hello_docker", "package_type": "container", "version_count": 1, "visibility": "private", - "url": "https://api.github.com/orgs/github/packages/container/hello_docker", + "url": "https://api.github.com/orgs/github/packages/container/hello%2Fhello_docker", "created_at": `+referenceTimeStr+`, "updated_at": `+referenceTimeStr+`, - "html_url": "https://github.com/orgs/github/packages/container/package/hello_docker" + "html_url": "https://github.com/orgs/github/packages/container/package/hello%2Fhello_docker" }`) + if err != nil { + t.Fatal("Failed to write test response: ", err) + } }) ctx := context.Background() - packages, _, err := client.Users.GetPackage(ctx, "u", "container", "hello_docker") + packages, _, err := client.Users.GetPackage(ctx, "u", "container", "hello/hello_docker") if err != nil { t.Errorf("Users.GetPackage returned error: %v", err) } want := &Package{ ID: Ptr(int64(197)), - Name: Ptr("hello_docker"), + Name: Ptr("hello/hello_docker"), PackageType: Ptr("container"), VersionCount: Ptr(int64(1)), Visibility: Ptr("private"), - URL: Ptr("https://api.github.com/orgs/github/packages/container/hello_docker"), - HTMLURL: Ptr("https://github.com/orgs/github/packages/container/package/hello_docker"), + URL: Ptr("https://api.github.com/orgs/github/packages/container/hello%2Fhello_docker"), + HTMLURL: Ptr("https://github.com/orgs/github/packages/container/package/hello%2Fhello_docker"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, } if !cmp.Equal(packages, want) { t.Errorf("Users.specifiedUser_GetPackage returned %+v, want %+v", packages, want) } - const methodName = "GetPackage" testBadOptions(t, methodName, func() (err error) { _, _, err = client.Users.GetPackage(ctx, "\n", "\n", "\n") From a03e88cdf44c6844df34ae573f837ba3d314aea7 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Thu, 20 Mar 2025 08:33:13 -0700 Subject: [PATCH 682/751] Update openapi (#3526) --- github/admin.go | 4 +- github/admin_orgs.go | 6 +- github/admin_stats.go | 2 +- github/admin_users.go | 8 +- github/authorizations.go | 4 +- github/enterprise_manage_ghes.go | 8 +- github/enterprise_manage_ghes_config.go | 20 +- github/enterprise_manage_ghes_maintenance.go | 4 +- github/enterprise_manage_ghes_ssh.go | 6 +- github/repos_prereceive_hooks.go | 8 +- github/users_administration.go | 8 +- openapi_operations.yaml | 2236 +++++++++--------- 12 files changed, 1190 insertions(+), 1124 deletions(-) diff --git a/github/admin.go b/github/admin.go index adf55d64146..c15c413c578 100644 --- a/github/admin.go +++ b/github/admin.go @@ -82,7 +82,7 @@ func (m Enterprise) String() string { // UpdateUserLDAPMapping updates the mapping between a GitHub user and an LDAP user. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user // //meta:operation PATCH /admin/ldap/users/{username}/mapping func (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, mapping *UserLDAPMapping) (*UserLDAPMapping, *Response, error) { @@ -103,7 +103,7 @@ func (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, m // UpdateTeamLDAPMapping updates the mapping between a GitHub team and an LDAP group. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team // //meta:operation PATCH /admin/ldap/teams/{team_id}/mapping func (s *AdminService) UpdateTeamLDAPMapping(ctx context.Context, team int64, mapping *TeamLDAPMapping) (*TeamLDAPMapping, *Response, error) { diff --git a/github/admin_orgs.go b/github/admin_orgs.go index 8b50756b0d0..200834508db 100644 --- a/github/admin_orgs.go +++ b/github/admin_orgs.go @@ -22,7 +22,7 @@ type createOrgRequest struct { // Note that only a subset of the org fields are used and org must // not be nil. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/orgs#create-an-organization +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/orgs#create-an-organization // //meta:operation POST /admin/organizations func (s *AdminService) CreateOrg(ctx context.Context, org *Organization, admin string) (*Organization, *Response, error) { @@ -61,7 +61,7 @@ type RenameOrgResponse struct { // RenameOrg renames an organization in GitHub Enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/orgs#update-an-organization-name +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/orgs#update-an-organization-name // //meta:operation PATCH /admin/organizations/{org} func (s *AdminService) RenameOrg(ctx context.Context, org *Organization, newName string) (*RenameOrgResponse, *Response, error) { @@ -70,7 +70,7 @@ func (s *AdminService) RenameOrg(ctx context.Context, org *Organization, newName // RenameOrgByName renames an organization in GitHub Enterprise using its current name. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/orgs#update-an-organization-name +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/orgs#update-an-organization-name // //meta:operation PATCH /admin/organizations/{org} func (s *AdminService) RenameOrgByName(ctx context.Context, org, newName string) (*RenameOrgResponse, *Response, error) { diff --git a/github/admin_stats.go b/github/admin_stats.go index a6e406beca6..bdf51a66ce9 100644 --- a/github/admin_stats.go +++ b/github/admin_stats.go @@ -152,7 +152,7 @@ func (s RepoStats) String() string { // Please note that this is only available to site administrators, // otherwise it will error with a 404 not found (instead of 401 or 403). // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/admin-stats#get-all-statistics +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/admin-stats#get-all-statistics // //meta:operation GET /enterprise/stats/all func (s *AdminService) GetAdminStats(ctx context.Context) (*AdminStats, *Response, error) { diff --git a/github/admin_users.go b/github/admin_users.go index 6877cef460c..70a7b300442 100644 --- a/github/admin_users.go +++ b/github/admin_users.go @@ -20,7 +20,7 @@ type CreateUserRequest struct { // CreateUser creates a new user in GitHub Enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#create-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#create-a-user // //meta:operation POST /admin/users func (s *AdminService) CreateUser(ctx context.Context, userReq CreateUserRequest) (*User, *Response, error) { @@ -42,7 +42,7 @@ func (s *AdminService) CreateUser(ctx context.Context, userReq CreateUserRequest // DeleteUser deletes a user in GitHub Enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#delete-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#delete-a-user // //meta:operation DELETE /admin/users/{username} func (s *AdminService) DeleteUser(ctx context.Context, username string) (*Response, error) { @@ -95,7 +95,7 @@ type UserAuthorization struct { // CreateUserImpersonation creates an impersonation OAuth token. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#create-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#create-an-impersonation-oauth-token // //meta:operation POST /admin/users/{username}/authorizations func (s *AdminService) CreateUserImpersonation(ctx context.Context, username string, opts *ImpersonateUserOptions) (*UserAuthorization, *Response, error) { @@ -117,7 +117,7 @@ func (s *AdminService) CreateUserImpersonation(ctx context.Context, username str // DeleteUserImpersonation deletes an impersonation OAuth token. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#delete-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#delete-an-impersonation-oauth-token // //meta:operation DELETE /admin/users/{username}/authorizations func (s *AdminService) DeleteUserImpersonation(ctx context.Context, username string) (*Response, error) { diff --git a/github/authorizations.go b/github/authorizations.go index 8b8a67d5524..7db45553292 100644 --- a/github/authorizations.go +++ b/github/authorizations.go @@ -257,7 +257,7 @@ func (s *AuthorizationsService) DeleteGrant(ctx context.Context, clientID, acces // you can e.g. create or delete a user's public SSH key. NOTE: creating a // new token automatically revokes an existing one. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#create-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#create-an-impersonation-oauth-token // //meta:operation POST /admin/users/{username}/authorizations func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, username string, authReq *AuthorizationRequest) (*Authorization, *Response, error) { @@ -279,7 +279,7 @@ func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, usernam // // NOTE: there can be only one at a time. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#delete-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#delete-an-impersonation-oauth-token // //meta:operation DELETE /admin/users/{username}/authorizations func (s *AuthorizationsService) DeleteImpersonation(ctx context.Context, username string) (*Response, error) { diff --git a/github/enterprise_manage_ghes.go b/github/enterprise_manage_ghes.go index e14836eb02e..a796791c42c 100644 --- a/github/enterprise_manage_ghes.go +++ b/github/enterprise_manage_ghes.go @@ -74,7 +74,7 @@ type ReleaseVersion struct { // CheckSystemRequirements checks if GHES system nodes meet the system requirements. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-system-requirement-check-results-for-configured-cluster-nodes +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-system-requirement-check-results-for-configured-cluster-nodes // //meta:operation GET /manage/v1/checks/system-requirements func (s *EnterpriseService) CheckSystemRequirements(ctx context.Context) (*SystemRequirements, *Response, error) { @@ -95,7 +95,7 @@ func (s *EnterpriseService) CheckSystemRequirements(ctx context.Context) (*Syste // ClusterStatus gets the status of all services running on each cluster node. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-cluster-nodes +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-cluster-nodes // //meta:operation GET /manage/v1/cluster/status func (s *EnterpriseService) ClusterStatus(ctx context.Context) (*ClusterStatus, *Response, error) { @@ -116,7 +116,7 @@ func (s *EnterpriseService) ClusterStatus(ctx context.Context) (*ClusterStatus, // ReplicationStatus gets the status of all services running on each replica node. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-replica-nodes +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-replica-nodes // //meta:operation GET /manage/v1/replication/status func (s *EnterpriseService) ReplicationStatus(ctx context.Context, opts *NodeQueryOptions) (*ClusterStatus, *Response, error) { @@ -140,7 +140,7 @@ func (s *EnterpriseService) ReplicationStatus(ctx context.Context, opts *NodeQue // GetNodeReleaseVersions gets the version information deployed to each node. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-all-ghes-release-versions-for-all-nodes +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-all-ghes-release-versions-for-all-nodes // //meta:operation GET /manage/v1/version func (s *EnterpriseService) GetNodeReleaseVersions(ctx context.Context, opts *NodeQueryOptions) ([]*NodeReleaseVersion, *Response, error) { diff --git a/github/enterprise_manage_ghes_config.go b/github/enterprise_manage_ghes_config.go index 10fb8590e4f..d675aeca07c 100644 --- a/github/enterprise_manage_ghes_config.go +++ b/github/enterprise_manage_ghes_config.go @@ -305,7 +305,7 @@ type NodeDetails struct { // ConfigApplyEvents gets events from the command ghe-config-apply. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#list-events-from-ghe-config-apply +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#list-events-from-ghe-config-apply // //meta:operation GET /manage/v1/config/apply/events func (s *EnterpriseService) ConfigApplyEvents(ctx context.Context, opts *ConfigApplyEventsOptions) (*ConfigApplyEvents, *Response, error) { @@ -330,7 +330,7 @@ func (s *EnterpriseService) ConfigApplyEvents(ctx context.Context, opts *ConfigA // InitialConfig initializes the GitHub Enterprise instance with a license and password. // After initializing the instance, you need to run an apply to apply the configuration. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#initialize-instance-configuration-with-license-and-password +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#initialize-instance-configuration-with-license-and-password // //meta:operation POST /manage/v1/config/init func (s *EnterpriseService) InitialConfig(ctx context.Context, license, password string) (*Response, error) { @@ -351,7 +351,7 @@ func (s *EnterpriseService) InitialConfig(ctx context.Context, license, password // License gets the current license information for the GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-enterprise-license-information +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-enterprise-license-information // //meta:operation GET /manage/v1/config/license func (s *EnterpriseService) License(ctx context.Context) ([]*LicenseStatus, *Response, error) { @@ -372,7 +372,7 @@ func (s *EnterpriseService) License(ctx context.Context) ([]*LicenseStatus, *Res // UploadLicense uploads a new license to the GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#upload-an-enterprise-license +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#upload-an-enterprise-license // //meta:operation PUT /manage/v1/config/license func (s *EnterpriseService) UploadLicense(ctx context.Context, license string) (*Response, error) { @@ -390,7 +390,7 @@ func (s *EnterpriseService) UploadLicense(ctx context.Context, license string) ( // LicenseStatus gets the current license status for the GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#check-a-license +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#check-a-license // //meta:operation GET /manage/v1/config/license/check func (s *EnterpriseService) LicenseStatus(ctx context.Context) ([]*LicenseCheck, *Response, error) { @@ -412,7 +412,7 @@ func (s *EnterpriseService) LicenseStatus(ctx context.Context) ([]*LicenseCheck, // NodeMetadata gets the metadata for all nodes in the GitHub Enterprise instance. // This is required for clustered setups. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-ghes-node-metadata-for-all-nodes +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-ghes-node-metadata-for-all-nodes // //meta:operation GET /manage/v1/config/nodes func (s *EnterpriseService) NodeMetadata(ctx context.Context, opts *NodeQueryOptions) (*NodeMetadataStatus, *Response, error) { @@ -436,7 +436,7 @@ func (s *EnterpriseService) NodeMetadata(ctx context.Context, opts *NodeQueryOpt // Settings gets the current configuration settings for the GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-ghes-settings +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-ghes-settings // //meta:operation GET /manage/v1/config/settings func (s *EnterpriseService) Settings(ctx context.Context) (*ConfigSettings, *Response, error) { @@ -457,7 +457,7 @@ func (s *EnterpriseService) Settings(ctx context.Context) (*ConfigSettings, *Res // UpdateSettings updates the configuration settings for the GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#set-settings +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#set-settings // //meta:operation PUT /manage/v1/config/settings func (s *EnterpriseService) UpdateSettings(ctx context.Context, opts *ConfigSettings) (*Response, error) { @@ -476,7 +476,7 @@ func (s *EnterpriseService) UpdateSettings(ctx context.Context, opts *ConfigSett // ConfigApply triggers a configuration apply run on the GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#trigger-a-ghe-config-apply-run +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#trigger-a-ghe-config-apply-run // //meta:operation POST /manage/v1/config/apply func (s *EnterpriseService) ConfigApply(ctx context.Context, opts *ConfigApplyOptions) (*ConfigApplyOptions, *Response, error) { @@ -497,7 +497,7 @@ func (s *EnterpriseService) ConfigApply(ctx context.Context, opts *ConfigApplyOp // ConfigApplyStatus gets the status of a ghe-config-apply run on the GitHub Enterprise instance. // You can request lat one or specific id one. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-status-of-a-ghe-config-apply-run +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-status-of-a-ghe-config-apply-run // //meta:operation GET /manage/v1/config/apply func (s *EnterpriseService) ConfigApplyStatus(ctx context.Context, opts *ConfigApplyOptions) (*ConfigApplyStatus, *Response, error) { diff --git a/github/enterprise_manage_ghes_maintenance.go b/github/enterprise_manage_ghes_maintenance.go index 3b1de92df13..2d7e76b4a16 100644 --- a/github/enterprise_manage_ghes_maintenance.go +++ b/github/enterprise_manage_ghes_maintenance.go @@ -46,7 +46,7 @@ type MaintenanceOptions struct { // GetMaintenanceStatus gets the status of maintenance mode for all nodes. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-status-of-maintenance-mode +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-status-of-maintenance-mode // //meta:operation GET /manage/v1/maintenance func (s *EnterpriseService) GetMaintenanceStatus(ctx context.Context, opts *NodeQueryOptions) ([]*MaintenanceStatus, *Response, error) { @@ -71,7 +71,7 @@ func (s *EnterpriseService) GetMaintenanceStatus(ctx context.Context, opts *Node // CreateMaintenance sets the maintenance mode for the instance. // With the enable parameter we can control to put instance into maintenance mode or not. With false we can disable the maintenance mode. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#set-the-status-of-maintenance-mode +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#set-the-status-of-maintenance-mode // //meta:operation POST /manage/v1/maintenance func (s *EnterpriseService) CreateMaintenance(ctx context.Context, enable bool, opts *MaintenanceOptions) ([]*MaintenanceOperationStatus, *Response, error) { diff --git a/github/enterprise_manage_ghes_ssh.go b/github/enterprise_manage_ghes_ssh.go index 77d25216593..e1f20a5c06a 100644 --- a/github/enterprise_manage_ghes_ssh.go +++ b/github/enterprise_manage_ghes_ssh.go @@ -31,7 +31,7 @@ type ClusterSSHKey struct { // DeleteSSHKey deletes the SSH key from the instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#delete-a-ssh-key +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#delete-a-ssh-key // //meta:operation DELETE /manage/v1/access/ssh func (s *EnterpriseService) DeleteSSHKey(ctx context.Context, key string) ([]*SSHKeyStatus, *Response, error) { @@ -55,7 +55,7 @@ func (s *EnterpriseService) DeleteSSHKey(ctx context.Context, key string) ([]*SS // GetSSHKey gets the SSH keys configured for the instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-configured-ssh-keys +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-configured-ssh-keys // //meta:operation GET /manage/v1/access/ssh func (s *EnterpriseService) GetSSHKey(ctx context.Context) ([]*ClusterSSHKey, *Response, error) { @@ -76,7 +76,7 @@ func (s *EnterpriseService) GetSSHKey(ctx context.Context) ([]*ClusterSSHKey, *R // CreateSSHKey adds a new SSH key to the instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#set-a-new-ssh-key +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#set-a-new-ssh-key // //meta:operation POST /manage/v1/access/ssh func (s *EnterpriseService) CreateSSHKey(ctx context.Context, key string) ([]*SSHKeyStatus, *Response, error) { diff --git a/github/repos_prereceive_hooks.go b/github/repos_prereceive_hooks.go index e97075d020c..82f6ba0f729 100644 --- a/github/repos_prereceive_hooks.go +++ b/github/repos_prereceive_hooks.go @@ -24,7 +24,7 @@ func (p PreReceiveHook) String() string { // ListPreReceiveHooks lists all pre-receive hooks for the specified repository. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/pre-receive-hooks func (s *RepositoriesService) ListPreReceiveHooks(ctx context.Context, owner, repo string, opts *ListOptions) ([]*PreReceiveHook, *Response, error) { @@ -53,7 +53,7 @@ func (s *RepositoriesService) ListPreReceiveHooks(ctx context.Context, owner, re // GetPreReceiveHook returns a single specified pre-receive hook. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) GetPreReceiveHook(ctx context.Context, owner, repo string, id int64) (*PreReceiveHook, *Response, error) { @@ -77,7 +77,7 @@ func (s *RepositoriesService) GetPreReceiveHook(ctx context.Context, owner, repo // UpdatePreReceiveHook updates a specified pre-receive hook. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository // //meta:operation PATCH /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) UpdatePreReceiveHook(ctx context.Context, owner, repo string, id int64, hook *PreReceiveHook) (*PreReceiveHook, *Response, error) { @@ -101,7 +101,7 @@ func (s *RepositoriesService) UpdatePreReceiveHook(ctx context.Context, owner, r // DeletePreReceiveHook deletes a specified pre-receive hook. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository // //meta:operation DELETE /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) DeletePreReceiveHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { diff --git a/github/users_administration.go b/github/users_administration.go index c0aa3b6493d..67fef61faa4 100644 --- a/github/users_administration.go +++ b/github/users_administration.go @@ -12,7 +12,7 @@ import ( // PromoteSiteAdmin promotes a user to a site administrator of a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator // //meta:operation PUT /users/{username}/site_admin func (s *UsersService) PromoteSiteAdmin(ctx context.Context, user string) (*Response, error) { @@ -28,7 +28,7 @@ func (s *UsersService) PromoteSiteAdmin(ctx context.Context, user string) (*Resp // DemoteSiteAdmin demotes a user from site administrator of a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#demote-a-site-administrator +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#demote-a-site-administrator // //meta:operation DELETE /users/{username}/site_admin func (s *UsersService) DemoteSiteAdmin(ctx context.Context, user string) (*Response, error) { @@ -49,7 +49,7 @@ type UserSuspendOptions struct { // Suspend a user on a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#suspend-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#suspend-a-user // //meta:operation PUT /users/{username}/suspended func (s *UsersService) Suspend(ctx context.Context, user string, opts *UserSuspendOptions) (*Response, error) { @@ -65,7 +65,7 @@ func (s *UsersService) Suspend(ctx context.Context, user string, opts *UserSuspe // Unsuspend a user on a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#unsuspend-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#unsuspend-a-user // //meta:operation DELETE /users/{username}/suspended func (s *UsersService) Unsuspend(ctx context.Context, user string) (*Response, error) { diff --git a/openapi_operations.yaml b/openapi_operations.yaml index 45207678377..59b24485fdd 100644 --- a/openapi_operations.yaml +++ b/openapi_operations.yaml @@ -47,260 +47,260 @@ operation_overrides: documentation_url: https://docs.github.com/rest/pages/pages#request-a-github-pages-build - name: GET /repos/{owner}/{repo}/pages/builds/{build_id} documentation_url: https://docs.github.com/rest/pages/pages#get-github-pages-build -openapi_commit: 2320d61e4c805300787f8551fda53076bb4fae8b +openapi_commit: dd7e0cab3399025166a33575ce09af6ff60bb26a openapi_operations: - name: GET / documentation_url: https://docs.github.com/rest/meta/meta#github-api-root openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /admin/hooks - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/global-webhooks#list-global-webhooks + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/global-webhooks#list-global-webhooks openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /admin/hooks - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/global-webhooks#create-a-global-webhook + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/global-webhooks#create-a-global-webhook openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /admin/hooks/{hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/global-webhooks#delete-a-global-webhook + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/global-webhooks#delete-a-global-webhook openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /admin/hooks/{hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/global-webhooks#get-a-global-webhook + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/global-webhooks#get-a-global-webhook openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /admin/hooks/{hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/global-webhooks#update-a-global-webhook + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/global-webhooks#update-a-global-webhook openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /admin/hooks/{hook_id}/pings - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/global-webhooks#ping-a-global-webhook + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/global-webhooks#ping-a-global-webhook openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /admin/keys - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#list-public-keys + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#list-public-keys openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /admin/keys/{key_ids} - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#delete-a-public-key + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#delete-a-public-key openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /admin/ldap/teams/{team_id}/mapping - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /admin/ldap/teams/{team_id}/sync - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/ldap#sync-ldap-mapping-for-a-team + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/ldap#sync-ldap-mapping-for-a-team openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /admin/ldap/users/{username}/mapping - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /admin/ldap/users/{username}/sync - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/ldap#sync-ldap-mapping-for-a-user + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/ldap#sync-ldap-mapping-for-a-user openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /admin/organizations - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/orgs#create-an-organization + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/orgs#create-an-organization openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /admin/organizations/{org} - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/orgs#update-an-organization-name + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/orgs#update-an-organization-name openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /admin/pre-receive-environments - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/pre-receive-environments#list-pre-receive-environments + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/pre-receive-environments#list-pre-receive-environments openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /admin/pre-receive-environments - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/pre-receive-environments#create-a-pre-receive-environment + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/pre-receive-environments#create-a-pre-receive-environment openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /admin/pre-receive-environments/{pre_receive_environment_id} - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/pre-receive-environments#delete-a-pre-receive-environment + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/pre-receive-environments#delete-a-pre-receive-environment openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /admin/pre-receive-environments/{pre_receive_environment_id} - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/pre-receive-environments#get-a-pre-receive-environment + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/pre-receive-environments#get-a-pre-receive-environment openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /admin/pre-receive-environments/{pre_receive_environment_id} - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/pre-receive-environments#update-a-pre-receive-environment + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/pre-receive-environments#update-a-pre-receive-environment openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /admin/pre-receive-environments/{pre_receive_environment_id}/downloads - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/pre-receive-environments#start-a-pre-receive-environment-download + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/pre-receive-environments#start-a-pre-receive-environment-download openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /admin/pre-receive-environments/{pre_receive_environment_id}/downloads/latest - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/pre-receive-environments#get-the-download-status-for-a-pre-receive-environment + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/pre-receive-environments#get-the-download-status-for-a-pre-receive-environment openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /admin/pre-receive-hooks - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/pre-receive-hooks#list-pre-receive-hooks + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/pre-receive-hooks#list-pre-receive-hooks openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /admin/pre-receive-hooks - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/pre-receive-hooks#create-a-pre-receive-hook + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/pre-receive-hooks#create-a-pre-receive-hook openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /admin/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/pre-receive-hooks#delete-a-pre-receive-hook + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/pre-receive-hooks#delete-a-pre-receive-hook openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /admin/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/pre-receive-hooks#get-a-pre-receive-hook + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/pre-receive-hooks#get-a-pre-receive-hook openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /admin/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/pre-receive-hooks#update-a-pre-receive-hook + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/pre-receive-hooks#update-a-pre-receive-hook openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /admin/tokens - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#list-personal-access-tokens + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#list-personal-access-tokens openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /admin/tokens/{token_id} - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#delete-a-personal-access-token + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#delete-a-personal-access-token openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /admin/users - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#create-a-user + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#create-a-user openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /admin/users/{username} - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#delete-a-user + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#delete-a-user openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /admin/users/{username} - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#update-the-username-for-a-user + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#update-the-username-for-a-user openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /admin/users/{username}/authorizations - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#delete-an-impersonation-oauth-token + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#delete-an-impersonation-oauth-token openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /admin/users/{username}/authorizations - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#create-an-impersonation-oauth-token + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#create-an-impersonation-oauth-token openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /advisories documentation_url: https://docs.github.com/rest/security-advisories/global-advisories#list-global-security-advisories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /advisories/{ghsa_id} documentation_url: https://docs.github.com/rest/security-advisories/global-advisories#get-a-global-security-advisory openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /app documentation_url: https://docs.github.com/rest/apps/apps#get-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /app-manifests/{code}/conversions documentation_url: https://docs.github.com/rest/apps/apps#create-a-github-app-from-a-manifest openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /app/hook/config documentation_url: https://docs.github.com/rest/apps/webhooks#get-a-webhook-configuration-for-an-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /app/hook/config documentation_url: https://docs.github.com/rest/apps/webhooks#update-a-webhook-configuration-for-an-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /app/hook/deliveries documentation_url: https://docs.github.com/rest/apps/webhooks#list-deliveries-for-an-app-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /app/hook/deliveries/{delivery_id} documentation_url: https://docs.github.com/rest/apps/webhooks#get-a-delivery-for-an-app-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /app/hook/deliveries/{delivery_id}/attempts documentation_url: https://docs.github.com/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /app/installation-requests documentation_url: https://docs.github.com/rest/apps/apps#list-installation-requests-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /app/installations documentation_url: https://docs.github.com/rest/apps/apps#list-installations-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /app/installations/{installation_id} documentation_url: https://docs.github.com/rest/apps/apps#delete-an-installation-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /app/installations/{installation_id} documentation_url: https://docs.github.com/rest/apps/apps#get-an-installation-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /app/installations/{installation_id}/access_tokens documentation_url: https://docs.github.com/rest/apps/apps#create-an-installation-access-token-for-an-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /app/installations/{installation_id}/suspended documentation_url: https://docs.github.com/rest/apps/apps#unsuspend-an-app-installation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /app/installations/{installation_id}/suspended documentation_url: https://docs.github.com/rest/apps/apps#suspend-an-app-installation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /applications/grants - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/oauth-authorizations/oauth-authorizations#list-your-grants + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/oauth-authorizations/oauth-authorizations#list-your-grants openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /applications/grants/{grant_id} - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/oauth-authorizations/oauth-authorizations#delete-a-grant + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/oauth-authorizations/oauth-authorizations#delete-a-grant openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /applications/grants/{grant_id} - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/oauth-authorizations/oauth-authorizations#get-a-single-grant + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/oauth-authorizations/oauth-authorizations#get-a-single-grant openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /applications/{client_id}/grant documentation_url: https://docs.github.com/rest/apps/oauth-applications#delete-an-app-authorization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /applications/{client_id}/grants/{access_token} documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#revoke-a-grant-for-an-application openapi_files: @@ -310,25 +310,25 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /applications/{client_id}/token documentation_url: https://docs.github.com/rest/apps/oauth-applications#reset-a-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /applications/{client_id}/token documentation_url: https://docs.github.com/rest/apps/oauth-applications#check-a-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /applications/{client_id}/token/scoped documentation_url: https://docs.github.com/rest/apps/apps#create-a-scoped-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /applications/{client_id}/tokens/{access_token} documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#revoke-an-authorization-for-an-application openapi_files: @@ -346,7 +346,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /assignments/{assignment_id} documentation_url: https://docs.github.com/rest/classroom/classroom#get-an-assignment openapi_files: @@ -363,33 +363,33 @@ openapi_operations: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: GET /authorizations - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/oauth-authorizations/oauth-authorizations#list-your-authorizations + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/oauth-authorizations/oauth-authorizations#list-your-authorizations openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /authorizations - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/oauth-authorizations/oauth-authorizations#create-a-new-authorization + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/oauth-authorizations/oauth-authorizations#create-a-new-authorization openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /authorizations/clients/{client_id} - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/oauth-authorizations/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/oauth-authorizations/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /authorizations/clients/{client_id}/{fingerprint} - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/oauth-authorizations/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app-and-fingerprint + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/oauth-authorizations/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app-and-fingerprint openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /authorizations/{authorization_id} - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/oauth-authorizations/oauth-authorizations#delete-an-authorization + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/oauth-authorizations/oauth-authorizations#delete-an-authorization openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /authorizations/{authorization_id} - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/oauth-authorizations/oauth-authorizations#get-a-single-authorization + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/oauth-authorizations/oauth-authorizations#get-a-single-authorization openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /authorizations/{authorization_id} - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/oauth-authorizations/oauth-authorizations#update-an-existing-authorization + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/oauth-authorizations/oauth-authorizations#update-an-existing-authorization openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /classrooms documentation_url: https://docs.github.com/rest/classroom/classroom#list-classrooms openapi_files: @@ -410,100 +410,100 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /codes_of_conduct/{key} documentation_url: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-a-code-of-conduct openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /emojis documentation_url: https://docs.github.com/rest/emojis/emojis#get-emojis openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprise-installation/{enterprise_or_org}/server-statistics documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/admin-stats#get-github-enterprise-server-statistics openapi_files: - descriptions/ghec/ghec.json - name: DELETE /enterprise/announcement - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/announcement#remove-the-global-announcement-banner + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/announcement#remove-the-global-announcement-banner openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprise/announcement - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/announcement#get-the-global-announcement-banner + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/announcement#get-the-global-announcement-banner openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /enterprise/announcement - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/announcement#set-the-global-announcement-banner + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/announcement#set-the-global-announcement-banner openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprise/settings/license - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/license#get-license-information + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/license#get-license-information openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprise/stats/all - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/admin-stats#get-all-statistics + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/admin-stats#get-all-statistics openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprise/stats/comments - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/admin-stats#get-comment-statistics + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/admin-stats#get-comment-statistics openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprise/stats/gists - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/admin-stats#get-gist-statistics + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/admin-stats#get-gist-statistics openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprise/stats/hooks - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/admin-stats#get-hooks-statistics + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/admin-stats#get-hooks-statistics openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprise/stats/issues - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/admin-stats#get-issue-statistics + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/admin-stats#get-issue-statistics openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprise/stats/milestones - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/admin-stats#get-milestone-statistics + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/admin-stats#get-milestone-statistics openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprise/stats/orgs - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/admin-stats#get-organization-statistics + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/admin-stats#get-organization-statistics openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprise/stats/pages - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/admin-stats#get-pages-statistics + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/admin-stats#get-pages-statistics openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprise/stats/pulls - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/admin-stats#get-pull-request-statistics + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/admin-stats#get-pull-request-statistics openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprise/stats/repos - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/admin-stats#get-repository-statistics + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/admin-stats#get-repository-statistics openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprise/stats/security-products - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/admin-stats#get-security-products-statistics + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/admin-stats#get-security-products-statistics openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprise/stats/users - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/admin-stats#get-users-statistics + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/admin-stats#get-users-statistics openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprises/{enterprise}/actions/cache/usage documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/cache#get-github-actions-cache-usage-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprises/{enterprise}/actions/cache/usage-policy - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/actions/cache#get-github-actions-cache-usage-policy-for-an-enterprise + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/actions/cache#get-github-actions-cache-usage-policy-for-an-enterprise openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /enterprises/{enterprise}/actions/cache/usage-policy - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/actions/cache#set-github-actions-cache-usage-policy-for-an-enterprise + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/actions/cache#set-github-actions-cache-usage-policy-for-an-enterprise openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprises/{enterprise}/actions/hosted-runners documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/hosted-runners#list-github-hosted-runners-for-an-enterprise openapi_files: @@ -552,177 +552,177 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-github-actions-permissions-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /enterprises/{enterprise}/actions/permissions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-github-actions-permissions-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprises/{enterprise}/actions/permissions/organizations documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#list-selected-organizations-enabled-for-github-actions-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /enterprises/{enterprise}/actions/permissions/organizations documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-selected-organizations-enabled-for-github-actions-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#disable-a-selected-organization-for-github-actions-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#enable-a-selected-organization-for-github-actions-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprises/{enterprise}/actions/permissions/selected-actions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /enterprises/{enterprise}/actions/permissions/selected-actions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprises/{enterprise}/actions/permissions/workflow documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-default-workflow-permissions-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /enterprises/{enterprise}/actions/permissions/workflow documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-default-workflow-permissions-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprises/{enterprise}/actions/runner-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /enterprises/{enterprise}/actions/runner-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-organization-access-to-a-self-hosted-runner-group-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-organization-access-for-a-self-hosted-runner-group-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-organization-access-to-a-self-hosted-runner-group-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-organization-access-to-a-self-hosted-runner-group-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprises/{enterprise}/actions/runners documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprises/{enterprise}/actions/runners/downloads documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#list-runner-applications-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /enterprises/{enterprise}/actions/runners/generate-jitconfig documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /enterprises/{enterprise}/actions/runners/registration-token documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#create-a-registration-token-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /enterprises/{enterprise}/actions/runners/remove-token documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#create-a-remove-token-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /enterprises/{enterprise}/actions/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprises/{enterprise}/actions/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprises/{enterprise}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /enterprises/{enterprise}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /enterprises/{enterprise}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels/{name} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#remove-a-custom-label-from-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /enterprises/{enterprise}/announcement documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/enterprises#remove-announcement-banner-from-enterprise openapi_files: @@ -739,31 +739,37 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#get-the-audit-log-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprises/{enterprise}/audit-log/stream-key documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#get-the-audit-log-stream-key-for-encrypting-secrets openapi_files: - descriptions/ghec/ghec.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprises/{enterprise}/audit-log/streams documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#list-audit-log-stream-configurations-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /enterprises/{enterprise}/audit-log/streams documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#create-an-audit-log-streaming-configuration-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /enterprises/{enterprise}/audit-log/streams/{stream_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#delete-an-audit-log-streaming-configuration-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprises/{enterprise}/audit-log/streams/{stream_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#list-one-audit-log-streaming-configuration-via-a-stream-id openapi_files: - descriptions/ghec/ghec.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /enterprises/{enterprise}/audit-log/streams/{stream_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#update-an-existing-audit-log-stream-configuration openapi_files: - descriptions/ghec/ghec.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprises/{enterprise}/bypass-requests/push-rules documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/bypass-requests#list-push-rule-bypass-requests-within-an-enterprise openapi_files: @@ -772,62 +778,71 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprises/{enterprise}/code-security/configurations documentation_url: https://docs.github.com/rest/code-security/configurations#get-code-security-configurations-for-an-enterprise openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /enterprises/{enterprise}/code-security/configurations documentation_url: https://docs.github.com/rest/code-security/configurations#create-a-code-security-configuration-for-an-enterprise openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprises/{enterprise}/code-security/configurations/defaults documentation_url: https://docs.github.com/rest/code-security/configurations#get-default-code-security-configurations-for-an-enterprise openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id} documentation_url: https://docs.github.com/rest/code-security/configurations#delete-a-code-security-configuration-for-an-enterprise openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprises/{enterprise}/code-security/configurations/{configuration_id} documentation_url: https://docs.github.com/rest/code-security/configurations#retrieve-a-code-security-configuration-of-an-enterprise openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id} documentation_url: https://docs.github.com/rest/code-security/configurations#update-a-custom-code-security-configuration-for-an-enterprise openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach documentation_url: https://docs.github.com/rest/code-security/configurations#attach-an-enterprise-configuration-to-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults documentation_url: https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-enterprise openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories documentation_url: https://docs.github.com/rest/code-security/configurations#get-repositories-associated-with-an-enterprise-code-security-configuration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprises/{enterprise}/code_security_and_analysis documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#get-code-security-and-analysis-features-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /enterprises/{enterprise}/code_security_and_analysis documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#update-code-security-and-analysis-features-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprises/{enterprise}/consumed-licenses documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/license#list-enterprise-consumed-licenses openapi_files: @@ -849,7 +864,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprises/{enterprise}/license-sync-status documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/license#get-a-license-sync-status openapi_files: @@ -886,6 +901,10 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/custom-properties#create-or-update-custom-properties-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json + - name: PUT /enterprises/{enterprise}/properties/schema/organizations/{org}/{custom_property_name}/promote + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/custom-properties#promote-a-custom-property-to-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json - name: DELETE /enterprises/{enterprise}/properties/schema/{custom_property_name} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/custom-properties#remove-a-custom-property-for-an-enterprise openapi_files: @@ -927,7 +946,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprises/{enterprise}/settings/billing/actions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#get-github-actions-billing-for-an-enterprise openapi_files: @@ -936,7 +955,7 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#get-github-advanced-security-active-committers-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /enterprises/{enterprise}/settings/billing/cost-centers documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#get-all-cost-centers-for-an-enterprise openapi_files: @@ -973,263 +992,263 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#enable-or-disable-a-security-feature openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /events documentation_url: https://docs.github.com/rest/activity/events#list-public-events openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /feeds documentation_url: https://docs.github.com/rest/activity/feeds#get-feeds openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /gists documentation_url: https://docs.github.com/rest/gists/gists#list-gists-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /gists documentation_url: https://docs.github.com/rest/gists/gists#create-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /gists/public documentation_url: https://docs.github.com/rest/gists/gists#list-public-gists openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /gists/starred documentation_url: https://docs.github.com/rest/gists/gists#list-starred-gists openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /gists/{gist_id} documentation_url: https://docs.github.com/rest/gists/gists#delete-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /gists/{gist_id} documentation_url: https://docs.github.com/rest/gists/gists#get-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /gists/{gist_id} documentation_url: https://docs.github.com/rest/gists/gists#update-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /gists/{gist_id}/comments documentation_url: https://docs.github.com/rest/gists/comments#list-gist-comments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /gists/{gist_id}/comments documentation_url: https://docs.github.com/rest/gists/comments#create-a-gist-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /gists/{gist_id}/comments/{comment_id} documentation_url: https://docs.github.com/rest/gists/comments#delete-a-gist-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /gists/{gist_id}/comments/{comment_id} documentation_url: https://docs.github.com/rest/gists/comments#get-a-gist-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /gists/{gist_id}/comments/{comment_id} documentation_url: https://docs.github.com/rest/gists/comments#update-a-gist-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /gists/{gist_id}/commits documentation_url: https://docs.github.com/rest/gists/gists#list-gist-commits openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /gists/{gist_id}/forks documentation_url: https://docs.github.com/rest/gists/gists#list-gist-forks openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /gists/{gist_id}/forks documentation_url: https://docs.github.com/rest/gists/gists#fork-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /gists/{gist_id}/star documentation_url: https://docs.github.com/rest/gists/gists#unstar-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /gists/{gist_id}/star documentation_url: https://docs.github.com/rest/gists/gists#check-if-a-gist-is-starred openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /gists/{gist_id}/star documentation_url: https://docs.github.com/rest/gists/gists#star-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /gists/{gist_id}/{sha} documentation_url: https://docs.github.com/rest/gists/gists#get-a-gist-revision openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /gitignore/templates documentation_url: https://docs.github.com/rest/gitignore/gitignore#get-all-gitignore-templates openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /gitignore/templates/{name} documentation_url: https://docs.github.com/rest/gitignore/gitignore#get-a-gitignore-template openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /installation/repositories documentation_url: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-app-installation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /installation/token documentation_url: https://docs.github.com/rest/apps/installations#revoke-an-installation-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /issues documentation_url: https://docs.github.com/rest/issues/issues#list-issues-assigned-to-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /licenses documentation_url: https://docs.github.com/rest/licenses/licenses#get-all-commonly-used-licenses openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /licenses/{license} documentation_url: https://docs.github.com/rest/licenses/licenses#get-a-license openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /manage/v1/access/ssh - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#delete-a-ssh-key + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#delete-a-ssh-key openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /manage/v1/access/ssh - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-configured-ssh-keys + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-configured-ssh-keys openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /manage/v1/access/ssh - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#set-a-new-ssh-key + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#set-a-new-ssh-key openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /manage/v1/checks/system-requirements - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-system-requirement-check-results-for-configured-cluster-nodes + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-system-requirement-check-results-for-configured-cluster-nodes openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /manage/v1/cluster/status - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-cluster-nodes + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-cluster-nodes openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /manage/v1/config/apply - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-status-of-a-ghe-config-apply-run + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-status-of-a-ghe-config-apply-run openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /manage/v1/config/apply - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#trigger-a-ghe-config-apply-run + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#trigger-a-ghe-config-apply-run openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /manage/v1/config/apply/events - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#list-events-from-ghe-config-apply + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#list-events-from-ghe-config-apply openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /manage/v1/config/init - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#initialize-instance-configuration-with-license-and-password + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#initialize-instance-configuration-with-license-and-password openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /manage/v1/config/license - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-enterprise-license-information + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-enterprise-license-information openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /manage/v1/config/license - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#upload-an-enterprise-license + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#upload-an-enterprise-license openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /manage/v1/config/license/check - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#check-a-license + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#check-a-license openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /manage/v1/config/nodes - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-ghes-node-metadata-for-all-nodes + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-ghes-node-metadata-for-all-nodes openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /manage/v1/config/settings - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-ghes-settings + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-ghes-settings openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /manage/v1/config/settings - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#set-settings + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#set-settings openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /manage/v1/maintenance - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-status-of-maintenance-mode + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-status-of-maintenance-mode openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /manage/v1/maintenance - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#set-the-status-of-maintenance-mode + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#set-the-status-of-maintenance-mode openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /manage/v1/replication/status - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-replica-nodes + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-replica-nodes openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /manage/v1/version - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-all-ghes-release-versions-for-all-nodes + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-all-ghes-release-versions-for-all-nodes openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /markdown documentation_url: https://docs.github.com/rest/markdown/markdown#render-a-markdown-document openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /markdown/raw documentation_url: https://docs.github.com/rest/markdown/markdown#render-a-markdown-document-in-raw-mode openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /marketplace_listing/accounts/{account_id} documentation_url: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account openapi_files: @@ -1265,78 +1284,78 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /networks/{owner}/{repo}/events documentation_url: https://docs.github.com/rest/activity/events#list-public-events-for-a-network-of-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /notifications documentation_url: https://docs.github.com/rest/activity/notifications#list-notifications-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /notifications documentation_url: https://docs.github.com/rest/activity/notifications#mark-notifications-as-read openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /notifications/threads/{thread_id} documentation_url: https://docs.github.com/rest/activity/notifications#mark-a-thread-as-done openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /notifications/threads/{thread_id} documentation_url: https://docs.github.com/rest/activity/notifications#get-a-thread openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /notifications/threads/{thread_id} documentation_url: https://docs.github.com/rest/activity/notifications#mark-a-thread-as-read openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /notifications/threads/{thread_id}/subscription documentation_url: https://docs.github.com/rest/activity/notifications#delete-a-thread-subscription openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /notifications/threads/{thread_id}/subscription documentation_url: https://docs.github.com/rest/activity/notifications#get-a-thread-subscription-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /notifications/threads/{thread_id}/subscription documentation_url: https://docs.github.com/rest/activity/notifications#set-a-thread-subscription openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /octocat documentation_url: https://docs.github.com/rest/meta/meta#get-octocat openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /organizations documentation_url: https://docs.github.com/rest/orgs/orgs#list-organizations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /organizations/{organization_id}/custom_roles documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#closing-down---list-custom-repository-roles-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /organizations/{org}/settings/billing/usage documentation_url: https://docs.github.com/rest/billing/enhanced-billing#get-billing-usage-report-for-an-organization openapi_files: @@ -1347,31 +1366,31 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org} documentation_url: https://docs.github.com/rest/orgs/orgs#get-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /orgs/{org} documentation_url: https://docs.github.com/rest/orgs/orgs#update-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/actions/cache/usage documentation_url: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/actions/cache/usage-by-repository documentation_url: https://docs.github.com/rest/actions/cache#list-repositories-with-github-actions-cache-usage-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/actions/hosted-runners documentation_url: https://docs.github.com/rest/actions/hosted-runners#list-github-hosted-runners-for-an-organization openapi_files: @@ -1427,103 +1446,103 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /orgs/{org}/actions/oidc/customization/sub documentation_url: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/actions/permissions documentation_url: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /orgs/{org}/actions/permissions documentation_url: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/actions/permissions/repositories documentation_url: https://docs.github.com/rest/actions/permissions#list-selected-repositories-enabled-for-github-actions-in-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /orgs/{org}/actions/permissions/repositories documentation_url: https://docs.github.com/rest/actions/permissions#set-selected-repositories-enabled-for-github-actions-in-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/actions/permissions/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/permissions#disable-a-selected-repository-for-github-actions-in-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /orgs/{org}/actions/permissions/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/permissions#enable-a-selected-repository-for-github-actions-in-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/actions/permissions/selected-actions documentation_url: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /orgs/{org}/actions/permissions/selected-actions documentation_url: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/actions/permissions/workflow documentation_url: https://docs.github.com/rest/actions/permissions#get-default-workflow-permissions-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /orgs/{org}/actions/permissions/workflow documentation_url: https://docs.github.com/rest/actions/permissions#set-default-workflow-permissions-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/actions/runner-groups documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /orgs/{org}/actions/runner-groups documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /orgs/{org}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#list-github-hosted-runners-in-a-group-for-an-organization openapi_files: @@ -1534,244 +1553,244 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#set-repository-access-for-a-self-hosted-runner-group-in-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#add-repository-access-to-a-self-hosted-runner-group-in-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/actions/runners documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/actions/runners/downloads documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /orgs/{org}/actions/runners/generate-jitconfig documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /orgs/{org}/actions/runners/registration-token documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /orgs/{org}/actions/runners/remove-token documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/actions/runners/{runner_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/actions/runners/{runner_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /orgs/{org}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /orgs/{org}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-a-custom-label-from-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/actions/secrets documentation_url: https://docs.github.com/rest/actions/secrets#list-organization-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/actions/secrets/public-key documentation_url: https://docs.github.com/rest/actions/secrets#get-an-organization-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#delete-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#get-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /orgs/{org}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/actions/secrets/{secret_name}/repositories documentation_url: https://docs.github.com/rest/actions/secrets#list-selected-repositories-for-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /orgs/{org}/actions/secrets/{secret_name}/repositories documentation_url: https://docs.github.com/rest/actions/secrets#set-selected-repositories-for-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/secrets#remove-selected-repository-from-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/secrets#add-selected-repository-to-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/actions/variables documentation_url: https://docs.github.com/rest/actions/variables#list-organization-variables openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /orgs/{org}/actions/variables documentation_url: https://docs.github.com/rest/actions/variables#create-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#delete-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#get-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /orgs/{org}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#update-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/actions/variables/{name}/repositories documentation_url: https://docs.github.com/rest/actions/variables#list-selected-repositories-for-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /orgs/{org}/actions/variables/{name}/repositories documentation_url: https://docs.github.com/rest/actions/variables#set-selected-repositories-for-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/variables#remove-selected-repository-from-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/variables#add-selected-repository-to-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/announcement documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/organizations#remove-announcement-banner-from-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/announcement documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/organizations#get-announcement-banner-for-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /orgs/{org}/announcement documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/organizations#set-announcement-banner-for-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/attestations/{subject_digest} documentation_url: https://docs.github.com/rest/orgs/orgs#list-attestations openapi_files: @@ -1781,7 +1800,7 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/orgs#get-the-audit-log-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/blocks documentation_url: https://docs.github.com/rest/orgs/blocking#list-users-blocked-by-an-organization openapi_files: @@ -1806,72 +1825,76 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/bypass-requests#list-push-rule-bypass-requests-within-an-organization openapi_files: - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/bypass-requests/secret-scanning + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/secret-scanning/delegated-bypass#list-bypass-requests-for-secret-scanning-for-an-org + openapi_files: + - descriptions/ghec/ghec.json - name: GET /orgs/{org}/code-scanning/alerts documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/code-security/configurations documentation_url: https://docs.github.com/rest/code-security/configurations#get-code-security-configurations-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /orgs/{org}/code-security/configurations documentation_url: https://docs.github.com/rest/code-security/configurations#create-a-code-security-configuration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/code-security/configurations/defaults documentation_url: https://docs.github.com/rest/code-security/configurations#get-default-code-security-configurations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/code-security/configurations/detach documentation_url: https://docs.github.com/rest/code-security/configurations#detach-configurations-from-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/code-security/configurations/{configuration_id} documentation_url: https://docs.github.com/rest/code-security/configurations#delete-a-code-security-configuration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/code-security/configurations/{configuration_id} documentation_url: https://docs.github.com/rest/code-security/configurations#get-a-code-security-configuration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /orgs/{org}/code-security/configurations/{configuration_id} documentation_url: https://docs.github.com/rest/code-security/configurations#update-a-code-security-configuration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /orgs/{org}/code-security/configurations/{configuration_id}/attach documentation_url: https://docs.github.com/rest/code-security/configurations#attach-a-configuration-to-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults documentation_url: https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories documentation_url: https://docs.github.com/rest/code-security/configurations#get-repositories-associated-with-a-code-security-configuration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/codespaces documentation_url: https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-the-organization openapi_files: @@ -1989,27 +2012,27 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /orgs/{org}/custom-repository-roles documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#create-a-custom-repository-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/custom-repository-roles/{role_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#delete-a-custom-repository-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/custom-repository-roles/{role_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#get-a-custom-repository-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /orgs/{org}/custom-repository-roles/{role_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#update-a-custom-repository-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /orgs/{org}/custom_roles documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#closing-down---create-a-custom-role openapi_files: @@ -2031,83 +2054,83 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/dependabot/secrets documentation_url: https://docs.github.com/rest/dependabot/secrets#list-organization-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/dependabot/secrets/public-key documentation_url: https://docs.github.com/rest/dependabot/secrets#get-an-organization-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#delete-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#get-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /orgs/{org}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories documentation_url: https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories documentation_url: https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/dependabot/secrets#add-selected-repository-to-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/docker/conflicts documentation_url: https://docs.github.com/rest/packages/packages#get-list-of-conflicting-packages-during-docker-migration-for-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/events documentation_url: https://docs.github.com/rest/activity/events#list-public-organization-events openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/external-group/{group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#get-an-external-group openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/external-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#list-external-groups-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/failed_invitations documentation_url: https://docs.github.com/rest/orgs/members#list-failed-organization-invitations openapi_files: @@ -2122,67 +2145,67 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /orgs/{org}/hooks documentation_url: https://docs.github.com/rest/orgs/webhooks#create-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/orgs/webhooks#delete-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/orgs/webhooks#get-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /orgs/{org}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/orgs/webhooks#update-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/hooks/{hook_id}/config documentation_url: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /orgs/{org}/hooks/{hook_id}/config documentation_url: https://docs.github.com/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/hooks/{hook_id}/deliveries documentation_url: https://docs.github.com/rest/orgs/webhooks#list-deliveries-for-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id} documentation_url: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-delivery-for-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts documentation_url: https://docs.github.com/rest/orgs/webhooks#redeliver-a-delivery-for-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /orgs/{org}/hooks/{hook_id}/pings documentation_url: https://docs.github.com/rest/orgs/webhooks#ping-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id} documentation_url: https://docs.github.com/rest/orgs/api-insights#get-route-stats-by-actor openapi_files: @@ -2233,13 +2256,13 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/installations documentation_url: https://docs.github.com/rest/orgs/orgs#list-app-installations-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/interaction-limits documentation_url: https://docs.github.com/rest/interactions/orgs#remove-interaction-restrictions-for-an-organization openapi_files: @@ -2275,30 +2298,50 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/issue-types + documentation_url: https://docs.github.com/rest/orgs/issue-types#list-issue-types-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: POST /orgs/{org}/issue-types + documentation_url: https://docs.github.com/rest/orgs/issue-types#create-issue-type-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /orgs/{org}/issue-types/{issue_type_id} + documentation_url: https://docs.github.com/rest/orgs/issue-types#delete-issue-type-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PUT /orgs/{org}/issue-types/{issue_type_id} + documentation_url: https://docs.github.com/rest/orgs/issue-types#update-issue-type-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /orgs/{org}/issues documentation_url: https://docs.github.com/rest/issues/issues#list-organization-issues-assigned-to-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/members documentation_url: https://docs.github.com/rest/orgs/members#list-organization-members openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/members/{username} documentation_url: https://docs.github.com/rest/orgs/members#remove-an-organization-member openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/members/{username} documentation_url: https://docs.github.com/rest/orgs/members#check-organization-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/members/{username}/codespaces documentation_url: https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-a-user-in-organization openapi_files: @@ -2324,438 +2367,444 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/memberships/{username} documentation_url: https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /orgs/{org}/memberships/{username} documentation_url: https://docs.github.com/rest/orgs/members#set-organization-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/migrations documentation_url: https://docs.github.com/rest/migrations/orgs#list-organization-migrations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /orgs/{org}/migrations documentation_url: https://docs.github.com/rest/migrations/orgs#start-an-organization-migration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/migrations/{migration_id} documentation_url: https://docs.github.com/rest/migrations/orgs#get-an-organization-migration-status openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/migrations/{migration_id}/archive documentation_url: https://docs.github.com/rest/migrations/orgs#delete-an-organization-migration-archive openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/migrations/{migration_id}/archive documentation_url: https://docs.github.com/rest/migrations/orgs#download-an-organization-migration-archive openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock documentation_url: https://docs.github.com/rest/migrations/orgs#unlock-an-organization-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/migrations/{migration_id}/repositories documentation_url: https://docs.github.com/rest/migrations/orgs#list-repositories-in-an-organization-migration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/organization-fine-grained-permissions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/organization-roles#list-organization-fine-grained-permissions-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/organization-roles documentation_url: https://docs.github.com/rest/orgs/organization-roles#get-all-organization-roles-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /orgs/{org}/organization-roles documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/organization-roles#create-a-custom-organization-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/organization-roles/teams/{team_slug} documentation_url: https://docs.github.com/rest/orgs/organization-roles#remove-all-organization-roles-for-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id} documentation_url: https://docs.github.com/rest/orgs/organization-roles#remove-an-organization-role-from-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id} documentation_url: https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/organization-roles/users/{username} documentation_url: https://docs.github.com/rest/orgs/organization-roles#remove-all-organization-roles-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/organization-roles/users/{username}/{role_id} documentation_url: https://docs.github.com/rest/orgs/organization-roles#remove-an-organization-role-from-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /orgs/{org}/organization-roles/users/{username}/{role_id} documentation_url: https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/organization-roles/{role_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/organization-roles#delete-a-custom-organization-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/organization-roles/{role_id} documentation_url: https://docs.github.com/rest/orgs/organization-roles#get-an-organization-role openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /orgs/{org}/organization-roles/{role_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/organization-roles#update-a-custom-organization-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/organization-roles/{role_id}/teams documentation_url: https://docs.github.com/rest/orgs/organization-roles#list-teams-that-are-assigned-to-an-organization-role openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/organization-roles/{role_id}/users documentation_url: https://docs.github.com/rest/orgs/organization-roles#list-users-that-are-assigned-to-an-organization-role openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/outside_collaborators documentation_url: https://docs.github.com/rest/orgs/outside-collaborators#list-outside-collaborators-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/outside_collaborators/{username} documentation_url: https://docs.github.com/rest/orgs/outside-collaborators#remove-outside-collaborator-from-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /orgs/{org}/outside_collaborators/{username} documentation_url: https://docs.github.com/rest/orgs/outside-collaborators#convert-an-organization-member-to-outside-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/packages documentation_url: https://docs.github.com/rest/packages/packages#list-packages-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /orgs/{org}/packages/{package_type}/{package_name}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/packages/{package_type}/{package_name}/versions documentation_url: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#delete-package-version-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-version-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-package-version-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/personal-access-token-requests documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /orgs/{org}/personal-access-token-requests documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#review-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /orgs/{org}/personal-access-token-requests/{pat_request_id} documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#review-a-request-to-access-organization-resources-with-a-fine-grained-personal-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-repositories-requested-to-be-accessed-by-a-fine-grained-personal-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/personal-access-tokens documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-fine-grained-personal-access-tokens-with-access-to-organization-resources openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /orgs/{org}/personal-access-tokens documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#update-the-access-to-organization-resources-via-fine-grained-personal-access-tokens openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /orgs/{org}/personal-access-tokens/{pat_id} documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#update-the-access-a-fine-grained-personal-access-token-has-to-organization-resources openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-repositories-a-fine-grained-personal-access-token-has-access-to openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/pre-receive-hooks - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/org-pre-receive-hooks#list-pre-receive-hooks-for-an-organization + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/org-pre-receive-hooks#list-pre-receive-hooks-for-an-organization openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/org-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-an-organization + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/org-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-an-organization openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/org-pre-receive-hooks#get-a-pre-receive-hook-for-an-organization + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/org-pre-receive-hooks#get-a-pre-receive-hook-for-an-organization openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /orgs/{org}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/org-pre-receive-hooks#update-pre-receive-hook-enforcement-for-an-organization + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/org-pre-receive-hooks#update-pre-receive-hook-enforcement-for-an-organization openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/private-registries documentation_url: https://docs.github.com/rest/private-registries/organization-configurations#list-private-registries-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /orgs/{org}/private-registries documentation_url: https://docs.github.com/rest/private-registries/organization-configurations#create-a-private-registry-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/private-registries/public-key documentation_url: https://docs.github.com/rest/private-registries/organization-configurations#get-private-registries-public-key-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/private-registries/{secret_name} documentation_url: https://docs.github.com/rest/private-registries/organization-configurations#delete-a-private-registry-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/private-registries/{secret_name} documentation_url: https://docs.github.com/rest/private-registries/organization-configurations#get-a-private-registry-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /orgs/{org}/private-registries/{secret_name} documentation_url: https://docs.github.com/rest/private-registries/organization-configurations#update-a-private-registry-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/projects documentation_url: https://docs.github.com/rest/projects/projects#list-organization-projects openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /orgs/{org}/projects documentation_url: https://docs.github.com/rest/projects/projects#create-an-organization-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/properties/schema documentation_url: https://docs.github.com/rest/orgs/custom-properties#get-all-custom-properties-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /orgs/{org}/properties/schema documentation_url: https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-properties-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/properties/schema/{custom_property_name} documentation_url: https://docs.github.com/rest/orgs/custom-properties#remove-a-custom-property-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/properties/schema/{custom_property_name} documentation_url: https://docs.github.com/rest/orgs/custom-properties#get-a-custom-property-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /orgs/{org}/properties/schema/{custom_property_name} documentation_url: https://docs.github.com/rest/orgs/custom-properties#create-or-update-a-custom-property-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/properties/values documentation_url: https://docs.github.com/rest/orgs/custom-properties#list-custom-property-values-for-organization-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /orgs/{org}/properties/values documentation_url: https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-property-values-for-organization-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/public_members documentation_url: https://docs.github.com/rest/orgs/members#list-public-organization-members openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/public_members/{username} documentation_url: https://docs.github.com/rest/orgs/members#remove-public-organization-membership-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/public_members/{username} documentation_url: https://docs.github.com/rest/orgs/members#check-public-organization-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /orgs/{org}/public_members/{username} documentation_url: https://docs.github.com/rest/orgs/members#set-public-organization-membership-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/repos documentation_url: https://docs.github.com/rest/repos/repos#list-organization-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /orgs/{org}/repos documentation_url: https://docs.github.com/rest/repos/repos#create-an-organization-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/repository-fine-grained-permissions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#list-repository-fine-grained-permissions-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/rulesets documentation_url: https://docs.github.com/rest/orgs/rules#get-all-organization-repository-rulesets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /orgs/{org}/rulesets documentation_url: https://docs.github.com/rest/orgs/rules#create-an-organization-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/rulesets/rule-suites documentation_url: https://docs.github.com/rest/orgs/rule-suites#list-organization-rule-suites openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id} documentation_url: https://docs.github.com/rest/orgs/rule-suites#get-an-organization-rule-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/orgs/rules#delete-an-organization-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/orgs/rules#get-an-organization-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /orgs/{org}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/orgs/rules#update-an-organization-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/rulesets/{ruleset_id}/history documentation_url: https://docs.github.com/rest/orgs/rules#get-organization-ruleset-history openapi_files: @@ -2771,7 +2820,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/security-advisories documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories-for-an-organization openapi_files: @@ -2782,19 +2831,19 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/security-managers/teams/{team_slug} documentation_url: https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /orgs/{org}/security-managers/teams/{team_slug} documentation_url: https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/settings/billing/actions documentation_url: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-an-organization openapi_files: @@ -2804,7 +2853,7 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/billing/billing#get-github-advanced-security-active-committers-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/settings/billing/packages documentation_url: https://docs.github.com/rest/billing/billing#get-github-packages-billing-for-an-organization openapi_files: @@ -2864,142 +2913,142 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /orgs/{org}/teams documentation_url: https://docs.github.com/rest/teams/teams#create-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/teams/{team_slug} documentation_url: https://docs.github.com/rest/teams/teams#delete-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/teams/{team_slug} documentation_url: https://docs.github.com/rest/teams/teams#get-a-team-by-name openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /orgs/{org}/teams/{team_slug} documentation_url: https://docs.github.com/rest/teams/teams#update-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/teams/{team_slug}/discussions documentation_url: https://docs.github.com/rest/teams/discussions#list-discussions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /orgs/{org}/teams/{team_slug}/discussions documentation_url: https://docs.github.com/rest/teams/discussions#create-a-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#delete-a-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#get-a-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#update-a-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments documentation_url: https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments documentation_url: https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-team-discussion-comment-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-team-discussion-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/teams/{team_slug}/external-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#remove-the-connection-between-an-external-group-and-a-team openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/teams/{team_slug}/external-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#list-a-connection-between-an-external-group-and-a-team openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /orgs/{org}/teams/{team_slug}/external-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#update-the-connection-between-an-external-group-and-a-team openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/teams/{team_slug}/invitations documentation_url: https://docs.github.com/rest/teams/members#list-pending-team-invitations openapi_files: @@ -3010,73 +3059,73 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/teams/{team_slug}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/teams/{team_slug}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#get-team-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /orgs/{org}/teams/{team_slug}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/teams/{team_slug}/projects documentation_url: https://docs.github.com/rest/teams/teams#list-team-projects openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/teams/{team_slug}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /orgs/{org}/teams/{team_slug}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/teams/{team_slug}/repos documentation_url: https://docs.github.com/rest/teams/teams#list-team-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#list-idp-groups-for-a-team openapi_files: @@ -3090,133 +3139,133 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /orgs/{org}/{security_product}/{enablement} documentation_url: https://docs.github.com/rest/orgs/orgs#enable-or-disable-a-security-feature-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /projects/columns/cards/{card_id} documentation_url: https://docs.github.com/rest/projects/cards#delete-a-project-card openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /projects/columns/cards/{card_id} documentation_url: https://docs.github.com/rest/projects/cards#get-a-project-card openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /projects/columns/cards/{card_id} documentation_url: https://docs.github.com/rest/projects/cards#update-an-existing-project-card openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /projects/columns/cards/{card_id}/moves documentation_url: https://docs.github.com/rest/projects/cards#move-a-project-card openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /projects/columns/{column_id} documentation_url: https://docs.github.com/rest/projects/columns#delete-a-project-column openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /projects/columns/{column_id} documentation_url: https://docs.github.com/rest/projects/columns#get-a-project-column openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /projects/columns/{column_id} documentation_url: https://docs.github.com/rest/projects/columns#update-an-existing-project-column openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /projects/columns/{column_id}/cards documentation_url: https://docs.github.com/rest/projects/cards#list-project-cards openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /projects/columns/{column_id}/cards documentation_url: https://docs.github.com/rest/projects/cards#create-a-project-card openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /projects/columns/{column_id}/moves documentation_url: https://docs.github.com/rest/projects/columns#move-a-project-column openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /projects/{project_id} documentation_url: https://docs.github.com/rest/projects/projects#delete-a-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /projects/{project_id} documentation_url: https://docs.github.com/rest/projects/projects#get-a-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /projects/{project_id} documentation_url: https://docs.github.com/rest/projects/projects#update-a-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /projects/{project_id}/collaborators documentation_url: https://docs.github.com/rest/projects/collaborators#list-project-collaborators openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /projects/{project_id}/collaborators/{username} documentation_url: https://docs.github.com/rest/projects/collaborators#remove-user-as-a-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /projects/{project_id}/collaborators/{username} documentation_url: https://docs.github.com/rest/projects/collaborators#add-project-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /projects/{project_id}/collaborators/{username}/permission documentation_url: https://docs.github.com/rest/projects/collaborators#get-project-permission-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /projects/{project_id}/columns documentation_url: https://docs.github.com/rest/projects/columns#list-project-columns openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /projects/{project_id}/columns documentation_url: https://docs.github.com/rest/projects/columns#create-a-project-column openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /rate_limit documentation_url: https://docs.github.com/rest/rate-limit/rate-limit#get-rate-limit-status-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /reactions/{reaction_id} documentation_url: https://docs.github.com/enterprise-server@3.4/rest/reference/reactions/#delete-a-reaction-legacy openapi_files: @@ -3226,261 +3275,261 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/repos/repos#get-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/repos/repos#update-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/artifacts documentation_url: https://docs.github.com/rest/actions/artifacts#list-artifacts-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id} documentation_url: https://docs.github.com/rest/actions/artifacts#delete-an-artifact openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id} documentation_url: https://docs.github.com/rest/actions/artifacts#get-an-artifact openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format} documentation_url: https://docs.github.com/rest/actions/artifacts#download-an-artifact openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/cache/usage documentation_url: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/cache/usage-policy - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/actions/cache#get-github-actions-cache-usage-policy-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/actions/cache#get-github-actions-cache-usage-policy-for-a-repository openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /repos/{owner}/{repo}/actions/cache/usage-policy - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/actions/cache#set-github-actions-cache-usage-policy-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/actions/cache#set-github-actions-cache-usage-policy-for-a-repository openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/actions/caches documentation_url: https://docs.github.com/rest/actions/cache#delete-github-actions-caches-for-a-repository-using-a-cache-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/caches documentation_url: https://docs.github.com/rest/actions/cache#list-github-actions-caches-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/actions/caches/{cache_id} documentation_url: https://docs.github.com/rest/actions/cache#delete-a-github-actions-cache-for-a-repository-using-a-cache-id openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/jobs/{job_id} documentation_url: https://docs.github.com/rest/actions/workflow-jobs#get-a-job-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs documentation_url: https://docs.github.com/rest/actions/workflow-jobs#download-job-logs-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun documentation_url: https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/oidc/customization/sub documentation_url: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /repos/{owner}/{repo}/actions/oidc/customization/sub documentation_url: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/organization-secrets documentation_url: https://docs.github.com/rest/actions/secrets#list-repository-organization-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/organization-variables documentation_url: https://docs.github.com/rest/actions/variables#list-repository-organization-variables openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/permissions documentation_url: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /repos/{owner}/{repo}/actions/permissions documentation_url: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/permissions/access documentation_url: https://docs.github.com/rest/actions/permissions#get-the-level-of-access-for-workflows-outside-of-the-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /repos/{owner}/{repo}/actions/permissions/access documentation_url: https://docs.github.com/rest/actions/permissions#set-the-level-of-access-for-workflows-outside-of-the-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/permissions/selected-actions documentation_url: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /repos/{owner}/{repo}/actions/permissions/selected-actions documentation_url: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/permissions/workflow documentation_url: https://docs.github.com/rest/actions/permissions#get-default-workflow-permissions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /repos/{owner}/{repo}/actions/permissions/workflow documentation_url: https://docs.github.com/rest/actions/permissions#set-default-workflow-permissions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/runners documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/runners/downloads documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/actions/runners/registration-token documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/actions/runners/remove-token documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/actions/runners/{runner_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/runners/{runner_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-a-custom-label-from-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/runs documentation_url: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/actions/runs/{run_id} documentation_url: https://docs.github.com/rest/actions/workflow-runs#delete-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id} documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-the-review-history-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve documentation_url: https://docs.github.com/rest/actions/workflow-runs#approve-a-workflow-run-for-a-fork-pull-request openapi_files: @@ -3491,85 +3540,85 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number} documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run-attempt openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs documentation_url: https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run-attempt openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs documentation_url: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-attempt-logs openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel documentation_url: https://docs.github.com/rest/actions/workflow-runs#cancel-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule documentation_url: https://docs.github.com/rest/actions/workflow-runs#review-custom-deployment-protection-rules-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel documentation_url: https://docs.github.com/rest/actions/workflow-runs#force-cancel-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs documentation_url: https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs documentation_url: https://docs.github.com/rest/actions/workflow-runs#delete-workflow-run-logs openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs documentation_url: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-logs openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-pending-deployments-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments documentation_url: https://docs.github.com/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun documentation_url: https://docs.github.com/rest/actions/workflow-runs#re-run-a-workflow openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs documentation_url: https://docs.github.com/rest/actions/workflow-runs#re-run-failed-jobs-from-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-workflow-run-usage openapi_files: @@ -3580,97 +3629,97 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/secrets/public-key documentation_url: https://docs.github.com/rest/actions/secrets#get-a-repository-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#delete-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#get-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /repos/{owner}/{repo}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#create-or-update-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/variables documentation_url: https://docs.github.com/rest/actions/variables#list-repository-variables openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/actions/variables documentation_url: https://docs.github.com/rest/actions/variables#create-a-repository-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#delete-a-repository-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#get-a-repository-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /repos/{owner}/{repo}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#update-a-repository-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/workflows documentation_url: https://docs.github.com/rest/actions/workflows#list-repository-workflows openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/workflows/{workflow_id} documentation_url: https://docs.github.com/rest/actions/workflows#get-a-workflow openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable documentation_url: https://docs.github.com/rest/actions/workflows#disable-a-workflow openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches documentation_url: https://docs.github.com/rest/actions/workflows#create-a-workflow-dispatch-event openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable documentation_url: https://docs.github.com/rest/actions/workflows#enable-a-workflow openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs documentation_url: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-workflow openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing documentation_url: https://docs.github.com/rest/actions/workflows#get-workflow-usage openapi_files: @@ -3681,19 +3730,19 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/assignees documentation_url: https://docs.github.com/rest/issues/assignees#list-assignees openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/assignees/{assignee} documentation_url: https://docs.github.com/rest/issues/assignees#check-if-a-user-can-be-assigned openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/attestations documentation_url: https://docs.github.com/rest/repos/repos#create-an-attestation openapi_files: @@ -3709,25 +3758,25 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/autolinks documentation_url: https://docs.github.com/rest/repos/autolinks#create-an-autolink-reference-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/autolinks/{autolink_id} documentation_url: https://docs.github.com/rest/repos/autolinks#delete-an-autolink-reference-from-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/autolinks/{autolink_id} documentation_url: https://docs.github.com/rest/repos/autolinks#get-an-autolink-reference-of-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/automated-security-fixes documentation_url: https://docs.github.com/rest/repos/repos#disable-dependabot-security-updates openapi_files: @@ -3738,7 +3787,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /repos/{owner}/{repo}/automated-security-fixes documentation_url: https://docs.github.com/rest/repos/repos#enable-dependabot-security-updates openapi_files: @@ -3749,217 +3798,217 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/branches/{branch} documentation_url: https://docs.github.com/rest/branches/branches#get-a-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection documentation_url: https://docs.github.com/rest/branches/branch-protection#get-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection documentation_url: https://docs.github.com/rest/branches/branch-protection#update-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-admin-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins documentation_url: https://docs.github.com/rest/branches/branch-protection#get-admin-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins documentation_url: https://docs.github.com/rest/branches/branch-protection#set-admin-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-pull-request-review-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews documentation_url: https://docs.github.com/rest/branches/branch-protection#get-pull-request-review-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews documentation_url: https://docs.github.com/rest/branches/branch-protection#update-pull-request-review-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-commit-signature-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures documentation_url: https://docs.github.com/rest/branches/branch-protection#get-commit-signature-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures documentation_url: https://docs.github.com/rest/branches/branch-protection#create-commit-signature-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-status-check-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks documentation_url: https://docs.github.com/rest/branches/branch-protection#get-status-checks-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks documentation_url: https://docs.github.com/rest/branches/branch-protection#update-status-check-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-status-check-contexts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts documentation_url: https://docs.github.com/rest/branches/branch-protection#get-all-status-check-contexts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts documentation_url: https://docs.github.com/rest/branches/branch-protection#add-status-check-contexts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts documentation_url: https://docs.github.com/rest/branches/branch-protection#set-status-check-contexts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions documentation_url: https://docs.github.com/rest/branches/branch-protection#get-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-app-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps documentation_url: https://docs.github.com/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps documentation_url: https://docs.github.com/rest/branches/branch-protection#add-app-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps documentation_url: https://docs.github.com/rest/branches/branch-protection#set-app-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-team-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams documentation_url: https://docs.github.com/rest/branches/branch-protection#get-teams-with-access-to-the-protected-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams documentation_url: https://docs.github.com/rest/branches/branch-protection#add-team-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams documentation_url: https://docs.github.com/rest/branches/branch-protection#set-team-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-user-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users documentation_url: https://docs.github.com/rest/branches/branch-protection#get-users-with-access-to-the-protected-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users documentation_url: https://docs.github.com/rest/branches/branch-protection#add-user-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users documentation_url: https://docs.github.com/rest/branches/branch-protection#set-user-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/branches/{branch}/rename documentation_url: https://docs.github.com/rest/branches/branches#rename-a-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/bypass-requests/push-rules documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/repos/bypass-requests#list-repository-push-rule-bypass-requests openapi_files: @@ -3968,84 +4017,100 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/repos/bypass-requests#get-a-repository-push-bypass-request openapi_files: - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/bypass-requests/secret-scanning + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/secret-scanning/delegated-bypass#list-bypass-requests-for-secret-scanning-for-a-repository + openapi_files: + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/bypass-requests/secret-scanning/{bypass_request_number} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/secret-scanning/delegated-bypass#get-a-bypass-request-for-secret-scanning + openapi_files: + - descriptions/ghec/ghec.json + - name: PATCH /repos/{owner}/{repo}/bypass-requests/secret-scanning/{bypass_request_number} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/secret-scanning/delegated-bypass#review-a-bypass-request-for-secret-scanning + openapi_files: + - descriptions/ghec/ghec.json + - name: DELETE /repos/{owner}/{repo}/bypass-responses/secret-scanning/{bypass_response_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/secret-scanning/delegated-bypass#dismiss-a-response-on-a-bypass-request-for-secret-scanning + openapi_files: + - descriptions/ghec/ghec.json - name: POST /repos/{owner}/{repo}/check-runs documentation_url: https://docs.github.com/rest/checks/runs#create-a-check-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/check-runs/{check_run_id} documentation_url: https://docs.github.com/rest/checks/runs#get-a-check-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /repos/{owner}/{repo}/check-runs/{check_run_id} documentation_url: https://docs.github.com/rest/checks/runs#update-a-check-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations documentation_url: https://docs.github.com/rest/checks/runs#list-check-run-annotations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest documentation_url: https://docs.github.com/rest/checks/runs#rerequest-a-check-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/check-suites documentation_url: https://docs.github.com/rest/checks/suites#create-a-check-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /repos/{owner}/{repo}/check-suites/preferences documentation_url: https://docs.github.com/rest/checks/suites#update-repository-preferences-for-check-suites openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/check-suites/{check_suite_id} documentation_url: https://docs.github.com/rest/checks/suites#get-a-check-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs documentation_url: https://docs.github.com/rest/checks/runs#list-check-runs-in-a-check-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest documentation_url: https://docs.github.com/rest/checks/suites#rerequest-a-check-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/code-scanning/alerts documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-the-status-of-an-autofix-for-a-code-scanning-alert openapi_files: @@ -4066,25 +4131,25 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/code-scanning/analyses documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-analyses-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#delete-a-code-scanning-analysis-from-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/code-scanning/codeql/databases documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-codeql-databases-for-a-repository openapi_files: @@ -4120,37 +4185,37 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /repos/{owner}/{repo}/code-scanning/default-setup documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-default-setup-configuration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/code-scanning/sarifs documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#upload-an-analysis-as-sarif-data openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-information-about-a-sarif-upload openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/code-security-configuration documentation_url: https://docs.github.com/rest/code-security/configurations#get-the-code-security-configuration-associated-with-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/codeowners/errors documentation_url: https://docs.github.com/rest/repos/repos#list-codeowners-errors openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/codespaces documentation_url: https://docs.github.com/rest/codespaces/codespaces#list-codespaces-in-a-repository-for-the-authenticated-user openapi_files: @@ -4211,133 +4276,133 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/collaborators/{username} documentation_url: https://docs.github.com/rest/collaborators/collaborators#remove-a-repository-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/collaborators/{username} documentation_url: https://docs.github.com/rest/collaborators/collaborators#check-if-a-user-is-a-repository-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /repos/{owner}/{repo}/collaborators/{username} documentation_url: https://docs.github.com/rest/collaborators/collaborators#add-a-repository-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/collaborators/{username}/permission documentation_url: https://docs.github.com/rest/collaborators/collaborators#get-repository-permissions-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/comments documentation_url: https://docs.github.com/rest/commits/comments#list-commit-comments-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/comments/{comment_id} documentation_url: https://docs.github.com/rest/commits/comments#delete-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/comments/{comment_id} documentation_url: https://docs.github.com/rest/commits/comments#get-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /repos/{owner}/{repo}/comments/{comment_id} documentation_url: https://docs.github.com/rest/commits/comments#update-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-a-commit-comment-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/commits documentation_url: https://docs.github.com/rest/commits/commits#list-commits openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head documentation_url: https://docs.github.com/rest/commits/commits#list-branches-for-head-commit openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/commits/{commit_sha}/comments documentation_url: https://docs.github.com/rest/commits/comments#list-commit-comments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/commits/{commit_sha}/comments documentation_url: https://docs.github.com/rest/commits/comments#create-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls documentation_url: https://docs.github.com/rest/commits/commits#list-pull-requests-associated-with-a-commit openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/commits/{ref} documentation_url: https://docs.github.com/rest/commits/commits#get-a-commit openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/commits/{ref}/check-runs documentation_url: https://docs.github.com/rest/checks/runs#list-check-runs-for-a-git-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/commits/{ref}/check-suites documentation_url: https://docs.github.com/rest/checks/suites#list-check-suites-for-a-git-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/commits/{ref}/status documentation_url: https://docs.github.com/rest/commits/statuses#get-the-combined-status-for-a-specific-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/commits/{ref}/statuses documentation_url: https://docs.github.com/rest/commits/statuses#list-commit-statuses-for-a-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/community/profile documentation_url: https://docs.github.com/rest/metrics/community#get-community-profile-metrics openapi_files: @@ -4348,7 +4413,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#create-a-content-attachment openapi_files: @@ -4358,451 +4423,451 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/contents/{path} documentation_url: https://docs.github.com/rest/repos/contents#get-repository-content openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /repos/{owner}/{repo}/contents/{path} documentation_url: https://docs.github.com/rest/repos/contents#create-or-update-file-contents openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/contributors documentation_url: https://docs.github.com/rest/repos/repos#list-repository-contributors openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/dependabot/alerts documentation_url: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number} documentation_url: https://docs.github.com/rest/dependabot/alerts#get-a-dependabot-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number} documentation_url: https://docs.github.com/rest/dependabot/alerts#update-a-dependabot-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/dependabot/secrets documentation_url: https://docs.github.com/rest/dependabot/secrets#list-repository-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/dependabot/secrets/public-key documentation_url: https://docs.github.com/rest/dependabot/secrets#get-a-repository-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#delete-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#get-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#create-or-update-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead} documentation_url: https://docs.github.com/rest/dependency-graph/dependency-review#get-a-diff-of-the-dependencies-between-commits openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/dependency-graph/sbom documentation_url: https://docs.github.com/rest/dependency-graph/sboms#export-a-software-bill-of-materials-sbom-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/dependency-graph/snapshots documentation_url: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/deployments documentation_url: https://docs.github.com/rest/deployments/deployments#list-deployments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/deployments documentation_url: https://docs.github.com/rest/deployments/deployments#create-a-deployment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/deployments/{deployment_id} documentation_url: https://docs.github.com/rest/deployments/deployments#delete-a-deployment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/deployments/{deployment_id} documentation_url: https://docs.github.com/rest/deployments/deployments#get-a-deployment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses documentation_url: https://docs.github.com/rest/deployments/statuses#list-deployment-statuses openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses documentation_url: https://docs.github.com/rest/deployments/statuses#create-a-deployment-status openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id} documentation_url: https://docs.github.com/rest/deployments/statuses#get-a-deployment-status openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/dispatches documentation_url: https://docs.github.com/rest/repos/repos#create-a-repository-dispatch-event openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/environments documentation_url: https://docs.github.com/rest/deployments/environments#list-environments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/environments/{environment_name} documentation_url: https://docs.github.com/rest/deployments/environments#delete-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/environments/{environment_name} documentation_url: https://docs.github.com/rest/deployments/environments#get-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /repos/{owner}/{repo}/environments/{environment_name} documentation_url: https://docs.github.com/rest/deployments/environments#create-or-update-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies documentation_url: https://docs.github.com/rest/deployments/branch-policies#list-deployment-branch-policies openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies documentation_url: https://docs.github.com/rest/deployments/branch-policies#create-a-deployment-branch-policy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} documentation_url: https://docs.github.com/rest/deployments/branch-policies#delete-a-deployment-branch-policy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} documentation_url: https://docs.github.com/rest/deployments/branch-policies#get-a-deployment-branch-policy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} documentation_url: https://docs.github.com/rest/deployments/branch-policies#update-a-deployment-branch-policy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules documentation_url: https://docs.github.com/rest/deployments/protection-rules#get-all-deployment-protection-rules-for-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules documentation_url: https://docs.github.com/rest/deployments/protection-rules#create-a-custom-deployment-protection-rule-on-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps documentation_url: https://docs.github.com/rest/deployments/protection-rules#list-custom-deployment-rule-integrations-available-for-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id} documentation_url: https://docs.github.com/rest/deployments/protection-rules#disable-a-custom-protection-rule-for-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id} documentation_url: https://docs.github.com/rest/deployments/protection-rules#get-a-custom-deployment-protection-rule openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/secrets documentation_url: https://docs.github.com/rest/actions/secrets#list-environment-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key documentation_url: https://docs.github.com/rest/actions/secrets#get-an-environment-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#delete-an-environment-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#get-an-environment-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#create-or-update-an-environment-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/variables documentation_url: https://docs.github.com/rest/actions/variables#list-environment-variables openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/environments/{environment_name}/variables documentation_url: https://docs.github.com/rest/actions/variables#create-an-environment-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#delete-an-environment-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#get-an-environment-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#update-an-environment-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/events documentation_url: https://docs.github.com/rest/activity/events#list-repository-events openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/forks documentation_url: https://docs.github.com/rest/repos/forks#list-forks openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/forks documentation_url: https://docs.github.com/rest/repos/forks#create-a-fork openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/git/blobs documentation_url: https://docs.github.com/rest/git/blobs#create-a-blob openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/git/blobs/{file_sha} documentation_url: https://docs.github.com/rest/git/blobs#get-a-blob openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/git/commits documentation_url: https://docs.github.com/rest/git/commits#create-a-commit openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/git/commits/{commit_sha} documentation_url: https://docs.github.com/rest/git/commits#get-a-commit-object openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/git/matching-refs/{ref} documentation_url: https://docs.github.com/rest/git/refs#list-matching-references openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/git/ref/{ref} documentation_url: https://docs.github.com/rest/git/refs#get-a-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/git/refs documentation_url: https://docs.github.com/rest/git/refs#create-a-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/git/refs/{ref} documentation_url: https://docs.github.com/rest/git/refs#delete-a-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /repos/{owner}/{repo}/git/refs/{ref} documentation_url: https://docs.github.com/rest/git/refs#update-a-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/git/tags documentation_url: https://docs.github.com/rest/git/tags#create-a-tag-object openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/git/tags/{tag_sha} documentation_url: https://docs.github.com/rest/git/tags#get-a-tag openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/git/trees documentation_url: https://docs.github.com/rest/git/trees#create-a-tree openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/git/trees/{tree_sha} documentation_url: https://docs.github.com/rest/git/trees#get-a-tree openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/hooks documentation_url: https://docs.github.com/rest/repos/webhooks#list-repository-webhooks openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/hooks documentation_url: https://docs.github.com/rest/repos/webhooks#create-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/repos/webhooks#delete-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/repos/webhooks#get-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /repos/{owner}/{repo}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/repos/webhooks#update-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/hooks/{hook_id}/config documentation_url: https://docs.github.com/rest/repos/webhooks#get-a-webhook-configuration-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config documentation_url: https://docs.github.com/rest/repos/webhooks#update-a-webhook-configuration-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries documentation_url: https://docs.github.com/rest/repos/webhooks#list-deliveries-for-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id} documentation_url: https://docs.github.com/rest/repos/webhooks#get-a-delivery-for-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts documentation_url: https://docs.github.com/rest/repos/webhooks#redeliver-a-delivery-for-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/hooks/{hook_id}/pings documentation_url: https://docs.github.com/rest/repos/webhooks#ping-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/hooks/{hook_id}/tests documentation_url: https://docs.github.com/rest/repos/webhooks#test-the-push-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/import documentation_url: https://docs.github.com/rest/migrations/source-imports#cancel-an-import openapi_files: @@ -4848,7 +4913,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/interaction-limits documentation_url: https://docs.github.com/rest/interactions/repos#remove-interaction-restrictions-for-a-repository openapi_files: @@ -4869,193 +4934,193 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/invitations/{invitation_id} documentation_url: https://docs.github.com/rest/collaborators/invitations#delete-a-repository-invitation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /repos/{owner}/{repo}/invitations/{invitation_id} documentation_url: https://docs.github.com/rest/collaborators/invitations#update-a-repository-invitation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/issues documentation_url: https://docs.github.com/rest/issues/issues#list-repository-issues openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/issues documentation_url: https://docs.github.com/rest/issues/issues#create-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/issues/comments documentation_url: https://docs.github.com/rest/issues/comments#list-issue-comments-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/issues/comments/{comment_id} documentation_url: https://docs.github.com/rest/issues/comments#delete-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/issues/comments/{comment_id} documentation_url: https://docs.github.com/rest/issues/comments#get-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /repos/{owner}/{repo}/issues/comments/{comment_id} documentation_url: https://docs.github.com/rest/issues/comments#update-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-an-issue-comment-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/issues/events documentation_url: https://docs.github.com/rest/issues/events#list-issue-events-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/issues/events/{event_id} documentation_url: https://docs.github.com/rest/issues/events#get-an-issue-event openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/issues/{issue_number} documentation_url: https://docs.github.com/rest/issues/issues#get-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /repos/{owner}/{repo}/issues/{issue_number} documentation_url: https://docs.github.com/rest/issues/issues#update-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees documentation_url: https://docs.github.com/rest/issues/assignees#remove-assignees-from-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/issues/{issue_number}/assignees documentation_url: https://docs.github.com/rest/issues/assignees#add-assignees-to-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee} documentation_url: https://docs.github.com/rest/issues/assignees#check-if-a-user-can-be-assigned-to-a-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/comments documentation_url: https://docs.github.com/rest/issues/comments#list-issue-comments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/issues/{issue_number}/comments documentation_url: https://docs.github.com/rest/issues/comments#create-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/events documentation_url: https://docs.github.com/rest/issues/events#list-issue-events openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels documentation_url: https://docs.github.com/rest/issues/labels#remove-all-labels-from-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/labels documentation_url: https://docs.github.com/rest/issues/labels#list-labels-for-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/issues/{issue_number}/labels documentation_url: https://docs.github.com/rest/issues/labels#add-labels-to-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /repos/{owner}/{repo}/issues/{issue_number}/labels documentation_url: https://docs.github.com/rest/issues/labels#set-labels-for-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name} documentation_url: https://docs.github.com/rest/issues/labels#remove-a-label-from-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock documentation_url: https://docs.github.com/rest/issues/issues#unlock-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /repos/{owner}/{repo}/issues/{issue_number}/lock documentation_url: https://docs.github.com/rest/issues/issues#lock-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/issues/{issue_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-an-issue-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue documentation_url: https://docs.github.com/rest/issues/sub-issues#remove-sub-issue openapi_files: @@ -5081,191 +5146,191 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/keys documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#list-deploy-keys openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/keys documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#create-a-deploy-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/keys/{key_id} documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#delete-a-deploy-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/keys/{key_id} documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#get-a-deploy-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/labels documentation_url: https://docs.github.com/rest/issues/labels#list-labels-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/labels documentation_url: https://docs.github.com/rest/issues/labels#create-a-label openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/labels/{name} documentation_url: https://docs.github.com/rest/issues/labels#delete-a-label openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/labels/{name} documentation_url: https://docs.github.com/rest/issues/labels#get-a-label openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /repos/{owner}/{repo}/labels/{name} documentation_url: https://docs.github.com/rest/issues/labels#update-a-label openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/languages documentation_url: https://docs.github.com/rest/repos/repos#list-repository-languages openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/lfs documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/repos/lfs#disable-git-lfs-for-a-repository openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /repos/{owner}/{repo}/lfs documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/repos/lfs#enable-git-lfs-for-a-repository openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/license documentation_url: https://docs.github.com/rest/licenses/licenses#get-the-license-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/merge-upstream documentation_url: https://docs.github.com/rest/branches/branches#sync-a-fork-branch-with-the-upstream-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/merges documentation_url: https://docs.github.com/rest/branches/branches#merge-a-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/milestones documentation_url: https://docs.github.com/rest/issues/milestones#list-milestones openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/milestones documentation_url: https://docs.github.com/rest/issues/milestones#create-a-milestone openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/milestones/{milestone_number} documentation_url: https://docs.github.com/rest/issues/milestones#delete-a-milestone openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/milestones/{milestone_number} documentation_url: https://docs.github.com/rest/issues/milestones#get-a-milestone openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /repos/{owner}/{repo}/milestones/{milestone_number} documentation_url: https://docs.github.com/rest/issues/milestones#update-a-milestone openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels documentation_url: https://docs.github.com/rest/issues/labels#list-labels-for-issues-in-a-milestone openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/notifications documentation_url: https://docs.github.com/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /repos/{owner}/{repo}/notifications documentation_url: https://docs.github.com/rest/activity/notifications#mark-repository-notifications-as-read openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/pages documentation_url: https://docs.github.com/rest/pages/pages#delete-a-apiname-pages-site openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/pages documentation_url: https://docs.github.com/rest/pages/pages#get-a-apiname-pages-site openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/pages documentation_url: https://docs.github.com/rest/pages/pages#create-a-apiname-pages-site openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /repos/{owner}/{repo}/pages documentation_url: https://docs.github.com/rest/pages/pages#update-information-about-a-apiname-pages-site openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/pages/builds documentation_url: https://docs.github.com/rest/pages/pages#list-apiname-pages-builds openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/pages/builds documentation_url: https://docs.github.com/rest/pages/pages#request-a-apiname-pages-build openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/pages/builds/latest documentation_url: https://docs.github.com/rest/pages/pages#get-latest-pages-build openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/pages/builds/{build_id} documentation_url: https://docs.github.com/rest/pages/pages#get-apiname-pages-build openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/pages/deployment documentation_url: https://docs.github.com/enterprise-server@3.7/rest/pages/pages#create-a-github-pages-deployment openapi_files: @@ -5275,40 +5340,40 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id} documentation_url: https://docs.github.com/rest/pages/pages#get-the-status-of-a-github-pages-deployment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel documentation_url: https://docs.github.com/rest/pages/pages#cancel-a-github-pages-deployment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/pages/health documentation_url: https://docs.github.com/rest/pages/pages#get-a-dns-health-check-for-github-pages openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: GET /repos/{owner}/{repo}/pre-receive-hooks - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/private-vulnerability-reporting documentation_url: https://docs.github.com/rest/repos/repos#disable-private-vulnerability-reporting-for-a-repository openapi_files: @@ -5329,91 +5394,91 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/projects documentation_url: https://docs.github.com/rest/projects/projects#create-a-repository-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/properties/values documentation_url: https://docs.github.com/rest/repos/custom-properties#get-all-custom-property-values-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /repos/{owner}/{repo}/properties/values documentation_url: https://docs.github.com/rest/repos/custom-properties#create-or-update-custom-property-values-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/pulls documentation_url: https://docs.github.com/rest/pulls/pulls#list-pull-requests openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/pulls documentation_url: https://docs.github.com/rest/pulls/pulls#create-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/pulls/comments documentation_url: https://docs.github.com/rest/pulls/comments#list-review-comments-in-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id} documentation_url: https://docs.github.com/rest/pulls/comments#delete-a-review-comment-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/pulls/comments/{comment_id} documentation_url: https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id} documentation_url: https://docs.github.com/rest/pulls/comments#update-a-review-comment-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-pull-request-review-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-pull-request-review-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-a-pull-request-comment-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number} documentation_url: https://docs.github.com/rest/pulls/pulls#get-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /repos/{owner}/{repo}/pulls/{pull_number} documentation_url: https://docs.github.com/rest/pulls/pulls#update-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces documentation_url: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-from-a-pull-request openapi_files: @@ -5424,275 +5489,275 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/comments documentation_url: https://docs.github.com/rest/pulls/comments#create-a-review-comment-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies documentation_url: https://docs.github.com/rest/pulls/comments#create-a-reply-for-a-review-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/commits documentation_url: https://docs.github.com/rest/pulls/pulls#list-commits-on-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/files documentation_url: https://docs.github.com/rest/pulls/pulls#list-pull-requests-files openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/merge documentation_url: https://docs.github.com/rest/pulls/pulls#check-if-a-pull-request-has-been-merged openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge documentation_url: https://docs.github.com/rest/pulls/pulls#merge-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers documentation_url: https://docs.github.com/rest/pulls/review-requests#remove-requested-reviewers-from-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers documentation_url: https://docs.github.com/rest/pulls/review-requests#get-all-requested-reviewers-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers documentation_url: https://docs.github.com/rest/pulls/review-requests#request-reviewers-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews documentation_url: https://docs.github.com/rest/pulls/reviews#list-reviews-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews documentation_url: https://docs.github.com/rest/pulls/reviews#create-a-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} documentation_url: https://docs.github.com/rest/pulls/reviews#delete-a-pending-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} documentation_url: https://docs.github.com/rest/pulls/reviews#get-a-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} documentation_url: https://docs.github.com/rest/pulls/reviews#update-a-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments documentation_url: https://docs.github.com/rest/pulls/reviews#list-comments-for-a-pull-request-review openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals documentation_url: https://docs.github.com/rest/pulls/reviews#dismiss-a-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events documentation_url: https://docs.github.com/rest/pulls/reviews#submit-a-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch documentation_url: https://docs.github.com/rest/pulls/pulls#update-a-pull-request-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/readme documentation_url: https://docs.github.com/rest/repos/contents#get-a-repository-readme openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/readme/{dir} documentation_url: https://docs.github.com/rest/repos/contents#get-a-repository-readme-for-a-directory openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/releases documentation_url: https://docs.github.com/rest/releases/releases#list-releases openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/releases documentation_url: https://docs.github.com/rest/releases/releases#create-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/releases/assets/{asset_id} documentation_url: https://docs.github.com/rest/releases/assets#delete-a-release-asset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/releases/assets/{asset_id} documentation_url: https://docs.github.com/rest/releases/assets#get-a-release-asset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /repos/{owner}/{repo}/releases/assets/{asset_id} documentation_url: https://docs.github.com/rest/releases/assets#update-a-release-asset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/releases/generate-notes documentation_url: https://docs.github.com/rest/releases/releases#generate-release-notes-content-for-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/releases/latest documentation_url: https://docs.github.com/rest/releases/releases#get-the-latest-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/releases/tags/{tag} documentation_url: https://docs.github.com/rest/releases/releases#get-a-release-by-tag-name openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/releases/{release_id} documentation_url: https://docs.github.com/rest/releases/releases#delete-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/releases/{release_id} documentation_url: https://docs.github.com/rest/releases/releases#get-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /repos/{owner}/{repo}/releases/{release_id} documentation_url: https://docs.github.com/rest/releases/releases#update-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/releases/{release_id}/assets documentation_url: https://docs.github.com/rest/releases/assets#list-release-assets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/releases/{release_id}/assets documentation_url: https://docs.github.com/rest/releases/assets#upload-a-release-asset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/releases/{release_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/releases/{release_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-a-release-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/replicas/caches - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/repos/repos#list-repository-cache-replication-status + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/repos/repos#list-repository-cache-replication-status openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/rules/branches/{branch} documentation_url: https://docs.github.com/rest/repos/rules#get-rules-for-a-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/rulesets documentation_url: https://docs.github.com/rest/repos/rules#get-all-repository-rulesets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/rulesets documentation_url: https://docs.github.com/rest/repos/rules#create-a-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/rulesets/rule-suites documentation_url: https://docs.github.com/rest/repos/rule-suites#list-repository-rule-suites openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id} documentation_url: https://docs.github.com/rest/repos/rule-suites#get-a-repository-rule-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/repos/rules#get-a-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /repos/{owner}/{repo}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/repos/rules#update-a-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history documentation_url: https://docs.github.com/rest/repos/rules#get-repository-ruleset-history openapi_files: @@ -5708,36 +5773,37 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#get-a-secret-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#update-a-secret-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-locations-for-a-secret-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#create-a-push-protection-bypass openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/secret-scanning/scan-history documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#get-secret-scanning-scan-history-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/security-advisories documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories openapi_files: @@ -5778,115 +5844,115 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/stats/code_frequency documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-activity openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/stats/commit_activity documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-last-year-of-commit-activity openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/stats/contributors documentation_url: https://docs.github.com/rest/metrics/statistics#get-all-contributor-commit-activity openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/stats/participation documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-count openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/stats/punch_card documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-hourly-commit-count-for-each-day openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/statuses/{sha} documentation_url: https://docs.github.com/rest/commits/statuses#create-a-commit-status openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/subscribers documentation_url: https://docs.github.com/rest/activity/watching#list-watchers openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/subscription documentation_url: https://docs.github.com/rest/activity/watching#delete-a-repository-subscription openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/subscription documentation_url: https://docs.github.com/rest/activity/watching#get-a-repository-subscription openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /repos/{owner}/{repo}/subscription documentation_url: https://docs.github.com/rest/activity/watching#set-a-repository-subscription openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/tags documentation_url: https://docs.github.com/rest/repos/repos#list-repository-tags openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/tags/protection documentation_url: https://docs.github.com/rest/repos/tags#closing-down---list-tag-protection-states-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{owner}/{repo}/tags/protection documentation_url: https://docs.github.com/rest/repos/tags#closing-down---create-a-tag-protection-state-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id} documentation_url: https://docs.github.com/rest/repos/tags#closing-down---delete-a-tag-protection-state-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/tarball/{ref} documentation_url: https://docs.github.com/rest/repos/contents#download-a-repository-archive-tar openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/teams documentation_url: https://docs.github.com/rest/repos/repos#list-repository-teams openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/topics documentation_url: https://docs.github.com/rest/repos/repos#get-all-repository-topics openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /repos/{owner}/{repo}/topics documentation_url: https://docs.github.com/rest/repos/repos#replace-all-repository-topics openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/traffic/clones documentation_url: https://docs.github.com/rest/metrics/traffic#get-repository-clones openapi_files: @@ -5912,43 +5978,43 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /repos/{owner}/{repo}/vulnerability-alerts documentation_url: https://docs.github.com/rest/repos/repos#disable-vulnerability-alerts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/vulnerability-alerts documentation_url: https://docs.github.com/rest/repos/repos#check-if-vulnerability-alerts-are-enabled-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /repos/{owner}/{repo}/vulnerability-alerts documentation_url: https://docs.github.com/rest/repos/repos#enable-vulnerability-alerts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repos/{owner}/{repo}/zipball/{ref} documentation_url: https://docs.github.com/rest/repos/contents#download-a-repository-archive-zip openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /repos/{template_owner}/{template_repo}/generate documentation_url: https://docs.github.com/rest/repos/repos#create-a-repository-using-a-template openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repositories documentation_url: https://docs.github.com/rest/repos/repos#list-public-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /repositories/{repository_id}/environments/{environment_name}/secrets documentation_url: https://docs.github.com/enterprise-server@3.7/rest/actions/secrets#list-environment-secrets openapi_files: @@ -6021,62 +6087,62 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#list-provisioned-scim-groups-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /scim/v2/enterprises/{enterprise}/Groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#provision-a-scim-enterprise-group openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#delete-a-scim-group-from-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-group openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#update-an-attribute-for-a-scim-enterprise-group openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#set-scim-information-for-a-provisioned-enterprise-group openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /scim/v2/enterprises/{enterprise}/Users documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#list-scim-provisioned-identities-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /scim/v2/enterprises/{enterprise}/Users documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#provision-a-scim-enterprise-user openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /scim/v2/enterprises/{enterprise}/Users/{scim_user_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#delete-a-scim-user-from-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /scim/v2/enterprises/{enterprise}/Users/{scim_user_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-user openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /scim/v2/enterprises/{enterprise}/Users/{scim_user_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#update-an-attribute-for-a-scim-enterprise-user openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /scim/v2/enterprises/{enterprise}/Users/{scim_user_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#set-scim-information-for-a-provisioned-enterprise-user openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /scim/v2/organizations/{org}/Users documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#list-scim-provisioned-identities openapi_files: @@ -6106,43 +6172,43 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /search/commits documentation_url: https://docs.github.com/rest/search/search#search-commits openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /search/issues documentation_url: https://docs.github.com/rest/search/search#search-issues-and-pull-requests openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /search/labels documentation_url: https://docs.github.com/rest/search/search#search-labels openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /search/repositories documentation_url: https://docs.github.com/rest/search/search#search-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /search/topics documentation_url: https://docs.github.com/rest/search/search#search-topics openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /search/users documentation_url: https://docs.github.com/rest/search/search#search-users openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /setup/api/configcheck documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#get-the-configuration-status openapi_files: @@ -6192,103 +6258,103 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /teams/{team_id} documentation_url: https://docs.github.com/rest/teams/teams#get-a-team-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /teams/{team_id} documentation_url: https://docs.github.com/rest/teams/teams#update-a-team-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /teams/{team_id}/discussions documentation_url: https://docs.github.com/rest/teams/discussions#list-discussions-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /teams/{team_id}/discussions documentation_url: https://docs.github.com/rest/teams/discussions#create-a-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /teams/{team_id}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#delete-a-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /teams/{team_id}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#get-a-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /teams/{team_id}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#update-a-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /teams/{team_id}/discussions/{discussion_number}/comments documentation_url: https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /teams/{team_id}/discussions/{discussion_number}/comments documentation_url: https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /teams/{team_id}/discussions/{discussion_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /teams/{team_id}/discussions/{discussion_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /teams/{team_id}/invitations documentation_url: https://docs.github.com/rest/teams/members#list-pending-team-invitations-legacy openapi_files: @@ -6299,91 +6365,91 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /teams/{team_id}/members/{username} documentation_url: https://docs.github.com/rest/teams/members#remove-team-member-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /teams/{team_id}/members/{username} documentation_url: https://docs.github.com/rest/teams/members#get-team-member-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /teams/{team_id}/members/{username} documentation_url: https://docs.github.com/rest/teams/members#add-team-member-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /teams/{team_id}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /teams/{team_id}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#get-team-membership-for-a-user-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /teams/{team_id}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /teams/{team_id}/projects documentation_url: https://docs.github.com/rest/teams/teams#list-team-projects-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /teams/{team_id}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /teams/{team_id}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /teams/{team_id}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /teams/{team_id}/repos documentation_url: https://docs.github.com/rest/teams/teams#list-team-repositories-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /teams/{team_id}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /teams/{team_id}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /teams/{team_id}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /teams/{team_id}/team-sync/group-mappings documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#list-idp-groups-for-a-team-legacy openapi_files: @@ -6397,19 +6463,19 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /user documentation_url: https://docs.github.com/rest/users/users#get-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /user documentation_url: https://docs.github.com/rest/users/users#update-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /user/blocks documentation_url: https://docs.github.com/rest/users/blocking#list-users-blocked-by-the-authenticated-user openapi_files: @@ -6535,7 +6601,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /user/email/visibility documentation_url: https://docs.github.com/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user openapi_files: @@ -6546,97 +6612,97 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /user/emails documentation_url: https://docs.github.com/rest/users/emails#list-email-addresses-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /user/emails documentation_url: https://docs.github.com/rest/users/emails#add-an-email-address-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /user/followers documentation_url: https://docs.github.com/rest/users/followers#list-followers-of-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /user/following documentation_url: https://docs.github.com/rest/users/followers#list-the-people-the-authenticated-user-follows openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /user/following/{username} documentation_url: https://docs.github.com/rest/users/followers#unfollow-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /user/following/{username} documentation_url: https://docs.github.com/rest/users/followers#check-if-a-person-is-followed-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /user/following/{username} documentation_url: https://docs.github.com/rest/users/followers#follow-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /user/gpg_keys documentation_url: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /user/gpg_keys documentation_url: https://docs.github.com/rest/users/gpg-keys#create-a-gpg-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /user/gpg_keys/{gpg_key_id} documentation_url: https://docs.github.com/rest/users/gpg-keys#delete-a-gpg-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /user/gpg_keys/{gpg_key_id} documentation_url: https://docs.github.com/rest/users/gpg-keys#get-a-gpg-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /user/installations documentation_url: https://docs.github.com/rest/apps/installations#list-app-installations-accessible-to-the-user-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /user/installations/{installation_id}/repositories documentation_url: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-user-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /user/installations/{installation_id}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/apps/installations#remove-a-repository-from-an-app-installation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /user/installations/{installation_id}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/apps/installations#add-a-repository-to-an-app-installation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /user/interaction-limits documentation_url: https://docs.github.com/rest/interactions/user#remove-interaction-restrictions-from-your-public-repositories openapi_files: @@ -6657,31 +6723,31 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /user/keys documentation_url: https://docs.github.com/rest/users/keys#list-public-ssh-keys-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /user/keys documentation_url: https://docs.github.com/rest/users/keys#create-a-public-ssh-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /user/keys/{key_id} documentation_url: https://docs.github.com/rest/users/keys#delete-a-public-ssh-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /user/keys/{key_id} documentation_url: https://docs.github.com/rest/users/keys#get-a-public-ssh-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /user/marketplace_purchases documentation_url: https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user openapi_files: @@ -6697,31 +6763,31 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /user/memberships/orgs/{org} documentation_url: https://docs.github.com/rest/orgs/members#get-an-organization-membership-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /user/memberships/orgs/{org} documentation_url: https://docs.github.com/rest/orgs/members#update-an-organization-membership-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /user/migrations documentation_url: https://docs.github.com/rest/migrations/users#list-user-migrations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /user/migrations documentation_url: https://docs.github.com/rest/migrations/users#start-a-user-migration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /user/migrations/{migration_id} documentation_url: https://docs.github.com/rest/migrations/users#get-a-user-migration-status openapi_files: @@ -6737,7 +6803,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock documentation_url: https://docs.github.com/rest/migrations/users#unlock-a-user-repository openapi_files: @@ -6748,199 +6814,199 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /user/orgs documentation_url: https://docs.github.com/rest/orgs/orgs#list-organizations-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /user/packages documentation_url: https://docs.github.com/rest/packages/packages#list-packages-for-the-authenticated-users-namespace openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /user/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /user/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /user/packages/{package_type}/{package_name}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /user/packages/{package_type}/{package_name}/versions documentation_url: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-version-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /user/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-version-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-version-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /user/projects documentation_url: https://docs.github.com/rest/projects/projects#create-a-user-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /user/public_emails documentation_url: https://docs.github.com/rest/users/emails#list-public-email-addresses-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /user/repos documentation_url: https://docs.github.com/rest/repos/repos#list-repositories-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /user/repos documentation_url: https://docs.github.com/rest/repos/repos#create-a-repository-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /user/repository_invitations documentation_url: https://docs.github.com/rest/collaborators/invitations#list-repository-invitations-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /user/repository_invitations/{invitation_id} documentation_url: https://docs.github.com/rest/collaborators/invitations#decline-a-repository-invitation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PATCH /user/repository_invitations/{invitation_id} documentation_url: https://docs.github.com/rest/collaborators/invitations#accept-a-repository-invitation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /user/social_accounts documentation_url: https://docs.github.com/rest/users/social-accounts#delete-social-accounts-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /user/social_accounts documentation_url: https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /user/social_accounts documentation_url: https://docs.github.com/rest/users/social-accounts#add-social-accounts-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /user/ssh_signing_keys documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /user/ssh_signing_keys documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#create-a-ssh-signing-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /user/ssh_signing_keys/{ssh_signing_key_id} documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#delete-an-ssh-signing-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /user/ssh_signing_keys/{ssh_signing_key_id} documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#get-an-ssh-signing-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /user/starred documentation_url: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /user/starred/{owner}/{repo} documentation_url: https://docs.github.com/rest/activity/starring#unstar-a-repository-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /user/starred/{owner}/{repo} documentation_url: https://docs.github.com/rest/activity/starring#check-if-a-repository-is-starred-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /user/starred/{owner}/{repo} documentation_url: https://docs.github.com/rest/activity/starring#star-a-repository-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /user/subscriptions documentation_url: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /user/teams documentation_url: https://docs.github.com/rest/teams/teams#list-teams-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /user/{account_id} documentation_url: https://docs.github.com/rest/users/users#get-a-user-using-their-id openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /users documentation_url: https://docs.github.com/rest/users/users#list-users openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /users/{username} documentation_url: https://docs.github.com/rest/users/users#get-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /users/{username}/attestations/{subject_digest} documentation_url: https://docs.github.com/rest/users/attestations#list-attestations openapi_files: @@ -6951,151 +7017,151 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /users/{username}/events documentation_url: https://docs.github.com/rest/activity/events#list-events-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /users/{username}/events/orgs/{org} documentation_url: https://docs.github.com/rest/activity/events#list-organization-events-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /users/{username}/events/public documentation_url: https://docs.github.com/rest/activity/events#list-public-events-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /users/{username}/followers documentation_url: https://docs.github.com/rest/users/followers#list-followers-of-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /users/{username}/following documentation_url: https://docs.github.com/rest/users/followers#list-the-people-a-user-follows openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /users/{username}/following/{target_user} documentation_url: https://docs.github.com/rest/users/followers#check-if-a-user-follows-another-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /users/{username}/gists documentation_url: https://docs.github.com/rest/gists/gists#list-gists-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /users/{username}/gpg_keys documentation_url: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /users/{username}/hovercard documentation_url: https://docs.github.com/rest/users/users#get-contextual-information-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /users/{username}/installation documentation_url: https://docs.github.com/rest/apps/apps#get-a-user-installation-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /users/{username}/keys documentation_url: https://docs.github.com/rest/users/keys#list-public-keys-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /users/{username}/orgs documentation_url: https://docs.github.com/rest/orgs/orgs#list-organizations-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /users/{username}/packages documentation_url: https://docs.github.com/rest/packages/packages#list-packages-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /users/{username}/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /users/{username}/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /users/{username}/packages/{package_type}/{package_name}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /users/{username}/packages/{package_type}/{package_name}/versions documentation_url: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#delete-package-version-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-version-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-package-version-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /users/{username}/projects documentation_url: https://docs.github.com/rest/projects/projects#list-user-projects openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /users/{username}/received_events documentation_url: https://docs.github.com/rest/activity/events#list-events-received-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /users/{username}/received_events/public documentation_url: https://docs.github.com/rest/activity/events#list-public-events-received-by-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /users/{username}/repos documentation_url: https://docs.github.com/rest/repos/repos#list-repositories-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /users/{username}/settings/billing/actions documentation_url: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-a-user openapi_files: @@ -7112,45 +7178,45 @@ openapi_operations: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: DELETE /users/{username}/site_admin - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#demote-a-site-administrator + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#demote-a-site-administrator openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /users/{username}/site_admin - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /users/{username}/social_accounts documentation_url: https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /users/{username}/ssh_signing_keys documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /users/{username}/starred documentation_url: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /users/{username}/subscriptions documentation_url: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: DELETE /users/{username}/suspended - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#unsuspend-a-user + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#unsuspend-a-user openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: PUT /users/{username}/suspended - documentation_url: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#suspend-a-user + documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#suspend-a-user openapi_files: - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json - name: GET /versions documentation_url: https://docs.github.com/rest/meta/meta#get-all-api-versions openapi_files: @@ -7161,4 +7227,4 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.15/ghes-3.15.json + - descriptions/ghes-3.16/ghes-3.16.json From df116e5d5d27ab3b04b63e554d2b9c999941d6d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?At=C4=B1l=20Sensalduz?= <44255923+atilsensalduz@users.noreply.github.com> Date: Thu, 20 Mar 2025 21:30:40 +0300 Subject: [PATCH 683/751] feat: Add support for Issue Types API (#3525) --- github/github-accessors.go | 24 ++++ github/github-accessors_test.go | 33 +++++ github/orgs_issue_types.go | 99 +++++++++++++ github/orgs_issue_types_test.go | 238 ++++++++++++++++++++++++++++++++ 4 files changed, 394 insertions(+) create mode 100644 github/orgs_issue_types.go create mode 100644 github/orgs_issue_types_test.go diff --git a/github/github-accessors.go b/github/github-accessors.go index ec029df2419..689d78633e9 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -5902,6 +5902,30 @@ func (c *CreateOrUpdateCustomRepoRoleOptions) GetName() string { return *c.Name } +// GetColor returns the Color field if it's non-nil, zero value otherwise. +func (c *CreateOrUpdateIssueTypesOptions) GetColor() string { + if c == nil || c.Color == nil { + return "" + } + return *c.Color +} + +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (c *CreateOrUpdateIssueTypesOptions) GetDescription() string { + if c == nil || c.Description == nil { + return "" + } + return *c.Description +} + +// GetIsPrivate returns the IsPrivate field if it's non-nil, zero value otherwise. +func (c *CreateOrUpdateIssueTypesOptions) GetIsPrivate() bool { + if c == nil || c.IsPrivate == nil { + return false + } + return *c.IsPrivate +} + // GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise. func (c *CreateOrUpdateOrgRoleOptions) GetBaseRole() string { if c == nil || c.BaseRole == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index b2e4232950d..85647c6dd8c 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -7688,6 +7688,39 @@ func TestCreateOrUpdateCustomRepoRoleOptions_GetName(tt *testing.T) { c.GetName() } +func TestCreateOrUpdateIssueTypesOptions_GetColor(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CreateOrUpdateIssueTypesOptions{Color: &zeroValue} + c.GetColor() + c = &CreateOrUpdateIssueTypesOptions{} + c.GetColor() + c = nil + c.GetColor() +} + +func TestCreateOrUpdateIssueTypesOptions_GetDescription(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CreateOrUpdateIssueTypesOptions{Description: &zeroValue} + c.GetDescription() + c = &CreateOrUpdateIssueTypesOptions{} + c.GetDescription() + c = nil + c.GetDescription() +} + +func TestCreateOrUpdateIssueTypesOptions_GetIsPrivate(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &CreateOrUpdateIssueTypesOptions{IsPrivate: &zeroValue} + c.GetIsPrivate() + c = &CreateOrUpdateIssueTypesOptions{} + c.GetIsPrivate() + c = nil + c.GetIsPrivate() +} + func TestCreateOrUpdateOrgRoleOptions_GetBaseRole(tt *testing.T) { tt.Parallel() var zeroValue string diff --git a/github/orgs_issue_types.go b/github/orgs_issue_types.go new file mode 100644 index 00000000000..73e6f8d639a --- /dev/null +++ b/github/orgs_issue_types.go @@ -0,0 +1,99 @@ +// Copyright 2025 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" +) + +// CreateOrUpdateIssueTypesOptions represents the parameters for creating or updating an issue type. +type CreateOrUpdateIssueTypesOptions struct { + Name string `json:"name"` // Name of the issue type. (Required.) + IsEnabled bool `json:"is_enabled"` // Whether or not the issue type is enabled at the organization level. (Required.) + IsPrivate *bool `json:"is_private,omitempty"` // Whether or not the issue type is restricted to issues in private repositories. (Optional.) + Description *string `json:"description,omitempty"` // Description of the issue type. (Optional.) + Color *string `json:"color,omitempty"` // Color for the issue type. Can be one of "gray", "blue", green "orange", "red", "pink", "purple", "null". (Optional.) +} + +// ListIssueTypes lists all issue types for an organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/issue-types#list-issue-types-for-an-organization +// +//meta:operation GET /orgs/{org}/issue-types +func (s *OrganizationsService) ListIssueTypes(ctx context.Context, org string) ([]*IssueType, *Response, error) { + u := fmt.Sprintf("orgs/%v/issue-types", org) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var issueTypes []*IssueType + resp, err := s.client.Do(ctx, req, &issueTypes) + if err != nil { + return nil, resp, err + } + + return issueTypes, resp, nil +} + +// CreateIssueType creates a new issue type for an organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/issue-types#create-issue-type-for-an-organization +// +//meta:operation POST /orgs/{org}/issue-types +func (s *OrganizationsService) CreateIssueType(ctx context.Context, org string, opt *CreateOrUpdateIssueTypesOptions) (*IssueType, *Response, error) { + u := fmt.Sprintf("orgs/%v/issue-types", org) + req, err := s.client.NewRequest("POST", u, opt) + if err != nil { + return nil, nil, err + } + + issueType := new(IssueType) + resp, err := s.client.Do(ctx, req, issueType) + if err != nil { + return nil, resp, err + } + + return issueType, resp, nil +} + +// UpdateIssueType updates GitHub Pages for the named repo. +// +// GitHub API docs: https://docs.github.com/rest/orgs/issue-types#update-issue-type-for-an-organization +// +//meta:operation PUT /orgs/{org}/issue-types/{issue_type_id} +func (s *OrganizationsService) UpdateIssueType(ctx context.Context, org string, issueTypeID int64, opt *CreateOrUpdateIssueTypesOptions) (*IssueType, *Response, error) { + u := fmt.Sprintf("orgs/%v/issue-types/%v", org, issueTypeID) + req, err := s.client.NewRequest("PUT", u, opt) + if err != nil { + return nil, nil, err + } + + issueType := new(IssueType) + resp, err := s.client.Do(ctx, req, issueType) + if err != nil { + return nil, resp, err + } + + return issueType, resp, nil +} + +// DeleteIssueType deletes an issue type for an organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/issue-types#delete-issue-type-for-an-organization +// +//meta:operation DELETE /orgs/{org}/issue-types/{issue_type_id} +func (s *OrganizationsService) DeleteIssueType(ctx context.Context, org string, issueTypeID int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/issue-types/%d", org, issueTypeID) + 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/orgs_issue_types_test.go b/github/orgs_issue_types_test.go new file mode 100644 index 00000000000..7775b4f5ef2 --- /dev/null +++ b/github/orgs_issue_types_test.go @@ -0,0 +1,238 @@ +// Copyright 2025 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" + "time" + + "github.com/google/go-cmp/cmp" +) + +func TestOrganizationsService_ListIssueTypes(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/orgs/o/issue-types", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `[ + { + "id": 410, + "node_id": "IT_kwDNAd3NAZo", + "name": "Task", + "description": "A specific piece of work", + "created_at": "2024-12-11T14:39:09Z", + "updated_at": "2024-12-11T14:39:09Z" + }, + { + "id": 411, + "node_id": "IT_kwDNAd3NAZs", + "name": "Bug", + "description": "An unexpected problem or behavior", + "created_at": "2024-12-11T14:39:09Z", + "updated_at": "2024-12-11T14:39:09Z" + } + ]`) + }) + + ctx := context.Background() + issueTypes, _, err := client.Organizations.ListIssueTypes(ctx, "o") + if err != nil { + t.Errorf("Organizations.ListIssueTypes returned error: %v", err) + } + + want := []*IssueType{ + { + ID: Ptr(int64(410)), + NodeID: Ptr("IT_kwDNAd3NAZo"), + Name: Ptr("Task"), + Description: Ptr("A specific piece of work"), + CreatedAt: Ptr(Timestamp{time.Date(2024, 12, 11, 14, 39, 9, 0, time.UTC)}), + UpdatedAt: Ptr(Timestamp{time.Date(2024, 12, 11, 14, 39, 9, 0, time.UTC)}), + }, + { + ID: Ptr(int64(411)), + NodeID: Ptr("IT_kwDNAd3NAZs"), + Name: Ptr("Bug"), + Description: Ptr("An unexpected problem or behavior"), + CreatedAt: Ptr(Timestamp{time.Date(2024, 12, 11, 14, 39, 9, 0, time.UTC)}), + UpdatedAt: Ptr(Timestamp{time.Date(2024, 12, 11, 14, 39, 9, 0, time.UTC)})}, + } + if !cmp.Equal(issueTypes, want) { + t.Errorf("Organizations.ListIssueTypes returned %+v, want %+v", issueTypes, want) + } + + const methodName = "ListIssueTypes" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.ListIssueTypes(ctx, "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.ListIssueTypes(ctx, "o") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_CreateIssueType(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + input := &CreateOrUpdateIssueTypesOptions{ + Name: "Epic", + Description: Ptr("An issue type for a multi-week tracking of work"), + IsEnabled: true, + Color: Ptr("green"), + IsPrivate: Ptr(true), + } + + mux.HandleFunc("/orgs/o/issue-types", func(w http.ResponseWriter, r *http.Request) { + v := new(CreateOrUpdateIssueTypesOptions) + assertNilError(t, 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": 410, + "node_id": "IT_kwDNAd3NAZo", + "name": "Epic", + "description": "An issue type for a multi-week tracking of work", + "created_at": "2024-12-11T14:39:09Z", + "updated_at": "2024-12-11T14:39:09Z" + }`) + }) + + ctx := context.Background() + issueType, _, err := client.Organizations.CreateIssueType(ctx, "o", input) + if err != nil { + t.Errorf("Organizations.CreateIssueType returned error: %v", err) + } + want := &IssueType{ + ID: Ptr(int64(410)), + NodeID: Ptr("IT_kwDNAd3NAZo"), + Name: Ptr("Epic"), + Description: Ptr("An issue type for a multi-week tracking of work"), + CreatedAt: Ptr(Timestamp{time.Date(2024, 12, 11, 14, 39, 9, 0, time.UTC)}), + UpdatedAt: Ptr(Timestamp{time.Date(2024, 12, 11, 14, 39, 9, 0, time.UTC)}), + } + + if !cmp.Equal(issueType, want) { + t.Errorf("Organizations.CreateIssueType returned %+v, want %+v", issueType, want) + } + + const methodName = "CreateIssueType" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.CreateIssueType(ctx, "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.CreateIssueType(ctx, "o", input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_UpdateIssueType(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + input := &CreateOrUpdateIssueTypesOptions{ + Name: "Epic", + Description: Ptr("An issue type for a multi-week tracking of work"), + IsEnabled: true, + Color: Ptr("green"), + IsPrivate: Ptr(true), + } + + mux.HandleFunc("/orgs/o/issue-types/410", func(w http.ResponseWriter, r *http.Request) { + v := new(CreateOrUpdateIssueTypesOptions) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) + + testMethod(t, r, "PUT") + if !cmp.Equal(v, input) { + t.Errorf("Request body = %+v, want %+v", v, input) + } + + fmt.Fprint(w, `{ + "id": 410, + "node_id": "IT_kwDNAd3NAZo", + "name": "Epic", + "description": "An issue type for a multi-week tracking of work", + "created_at": "2024-12-11T14:39:09Z", + "updated_at": "2024-12-11T14:39:09Z" + }`) + }) + + ctx := context.Background() + issueType, _, err := client.Organizations.UpdateIssueType(ctx, "o", 410, input) + if err != nil { + t.Errorf("Organizations.UpdateIssueType returned error: %v", err) + } + want := &IssueType{ + ID: Ptr(int64(410)), + NodeID: Ptr("IT_kwDNAd3NAZo"), + Name: Ptr("Epic"), + Description: Ptr("An issue type for a multi-week tracking of work"), + CreatedAt: Ptr(Timestamp{time.Date(2024, 12, 11, 14, 39, 9, 0, time.UTC)}), + UpdatedAt: Ptr(Timestamp{time.Date(2024, 12, 11, 14, 39, 9, 0, time.UTC)}), + } + + if !cmp.Equal(issueType, want) { + t.Errorf("Organizations.UpdateIssueType returned %+v, want %+v", issueType, want) + } + + const methodName = "UpdateIssueType" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.UpdateIssueType(ctx, "\n", -1, input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.UpdateIssueType(ctx, "o", 410, input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_DeleteIssueType(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/orgs/o/issue-types/410", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + }) + + ctx := context.Background() + _, err := client.Organizations.DeleteIssueType(ctx, "o", 410) + if err != nil { + t.Errorf("Organizations.DeleteIssueType returned error: %v", err) + } + + const methodName = "DeleteIssueType" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Organizations.DeleteIssueType(ctx, "\n", -1) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Organizations.DeleteIssueType(ctx, "o", 410) + }) +} From 49e644be5a24ce199ac98aa576b04afe8d4db95d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Mar 2025 19:16:12 -0400 Subject: [PATCH 684/751] build(deps): bump github.com/golang-jwt/jwt/v4 from 4.5.1 to 4.5.2 in /example (#3528) --- example/go.mod | 2 +- example/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/example/go.mod b/example/go.mod index bf1f412abf9..9ed11b66edc 100644 --- a/example/go.mod +++ b/example/go.mod @@ -36,7 +36,7 @@ require ( github.com/go-openapi/strfmt v0.23.0 // indirect github.com/go-openapi/swag v0.23.0 // indirect github.com/go-openapi/validate v0.24.0 // indirect - github.com/golang-jwt/jwt/v4 v4.5.1 // indirect + github.com/golang-jwt/jwt/v4 v4.5.2 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/certificate-transparency-go v1.2.1 // indirect github.com/google/go-containerregistry v0.20.2 // indirect diff --git a/example/go.sum b/example/go.sum index 7a39a6ed7d9..844fdd7c81d 100644 --- a/example/go.sum +++ b/example/go.sum @@ -139,8 +139,8 @@ github.com/gofri/go-github-pagination v1.0.0/go.mod h1:Qij55Fb4fNPjam3SB+8cLnqp4 github.com/gofri/go-github-ratelimit/v2 v2.0.2 h1:gS8wAS1jTmlWGdTjAM7KIpsLjwY1S0S/gKK5hthfSXM= github.com/gofri/go-github-ratelimit/v2 v2.0.2/go.mod h1:YBQt4gTbdcbMjJFT05YFEaECwH78P5b0IwrnbLiHGdE= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-jwt/jwt/v4 v4.5.1 h1:JdqV9zKUdtaa9gdPlywC3aeoEsR681PlKC+4F5gQgeo= -github.com/golang-jwt/jwt/v4 v4.5.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-jwt/jwt/v4 v4.5.2 h1:YtQM7lnr8iZ+j5q71MGKkNw9Mn7AjHM68uc9g5fXeUI= +github.com/golang-jwt/jwt/v4 v4.5.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= From bb438aed4583da3ae636e48f2124f6ba989836ae Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Mar 2025 18:44:54 -0400 Subject: [PATCH 685/751] build(deps): bump the actions group with 2 updates (#3530) --- .github/workflows/linter.yml | 2 +- .github/workflows/tests.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 4aa0bec2abb..0a632ac310a 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0 + - uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0 with: go-version: 1.x cache-dependency-path: "**/go.sum" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 71b1cd8b5b1..86fdd739ef0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -42,7 +42,7 @@ jobs: runs-on: ${{ matrix.platform }} steps: - - uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0 + - uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0 with: go-version: ${{ matrix.go-version }} - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -54,7 +54,7 @@ jobs: echo "go-mod-cache=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT - name: Cache go modules - uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2 + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 with: path: | ${{ steps.cache-paths.outputs.go-cache }} From 3cac18b40cf29fc1a8ca9d192cd6d78e1e1c7b98 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Mar 2025 18:53:56 -0400 Subject: [PATCH 686/751] build(deps): bump github.com/getkin/kin-openapi from 0.130.0 to 0.131.0 in /tools (#3531) --- tools/go.mod | 2 +- tools/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index 826d918a9bc..71b1540c7db 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -4,7 +4,7 @@ go 1.23.0 require ( github.com/alecthomas/kong v1.9.0 - github.com/getkin/kin-openapi v0.130.0 + github.com/getkin/kin-openapi v0.131.0 github.com/google/go-cmp v0.7.0 github.com/google/go-github/v70 v70.0.0 golang.org/x/sync v0.12.0 diff --git a/tools/go.sum b/tools/go.sum index 7d64c2b8f31..5cdc8ecbdac 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -6,8 +6,8 @@ github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/getkin/kin-openapi v0.130.0 h1:Sz8GTHfscqdsQCT/OJDSV3eNvEjZ8iUOlXbFxkG1Av0= -github.com/getkin/kin-openapi v0.130.0/go.mod h1:3OlG51PCYNsPByuiMB0t4fjnNlIDnaEDsjiKUV8nL58= +github.com/getkin/kin-openapi v0.131.0 h1:NO2UeHnFKRYhZ8wg6Nyh5Cq7dHk4suQQr72a4pMrDxE= +github.com/getkin/kin-openapi v0.131.0/go.mod h1:3OlG51PCYNsPByuiMB0t4fjnNlIDnaEDsjiKUV8nL58= github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= From 51d32d940781758c57da7e20d9a9b1b3141ca6d5 Mon Sep 17 00:00:00 2001 From: Colby Williams Date: Wed, 26 Mar 2025 17:03:55 -0500 Subject: [PATCH 687/751] feat!: Add ListReactionOptions to all ListxxReactions functions to enable filter by content (#3532) BREAKING CHANGE: `ListCommentReactionOptions` => `ListReactionOptions` and all `List*Reactions` methods now use it. --- github/reactions.go | 17 ++++++++--------- github/reactions_test.go | 32 +++++++++++++++++++++----------- 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/github/reactions.go b/github/reactions.go index e9823220372..71dd611d85d 100644 --- a/github/reactions.go +++ b/github/reactions.go @@ -48,9 +48,8 @@ func (r Reaction) String() string { return Stringify(r) } -// ListCommentReactionOptions specifies the optional parameters to the -// ReactionsService.ListCommentReactions method. -type ListCommentReactionOptions struct { +// ListReactionOptions specifies the optional parameters to the list reactions endpoints. +type ListReactionOptions struct { // Content restricts the returned comment reactions to only those with the given type. // Omit this parameter to list all reactions to a commit comment. // Possible values are: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". @@ -64,7 +63,7 @@ type ListCommentReactionOptions struct { // GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-commit-comment // //meta:operation GET /repos/{owner}/{repo}/comments/{comment_id}/reactions -func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListCommentReactionOptions) ([]*Reaction, *Response, error) { +func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListReactionOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) u, err := addOptions(u, opts) if err != nil { @@ -144,7 +143,7 @@ func (s *ReactionsService) DeleteCommentReactionByID(ctx context.Context, repoID // GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue // //meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/reactions -func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*Reaction, *Response, error) { +func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo string, number int, opts *ListReactionOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) u, err := addOptions(u, opts) if err != nil { @@ -224,7 +223,7 @@ func (s *ReactionsService) DeleteIssueReactionByID(ctx context.Context, repoID, // GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue-comment // //meta:operation GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions -func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*Reaction, *Response, error) { +func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListReactionOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) u, err := addOptions(u, opts) if err != nil { @@ -304,7 +303,7 @@ func (s *ReactionsService) DeleteIssueCommentReactionByID(ctx context.Context, r // GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-pull-request-review-comment // //meta:operation GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions -func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*Reaction, *Response, error) { +func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListReactionOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) u, err := addOptions(u, opts) if err != nil { @@ -384,7 +383,7 @@ func (s *ReactionsService) DeletePullRequestCommentReactionByID(ctx context.Cont // GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-legacy // //meta:operation GET /teams/{team_id}/discussions/{discussion_number}/reactions -func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, teamID int64, discussionNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { +func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, teamID int64, discussionNumber int, opts *ListReactionOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) u, err := addOptions(u, opts) if err != nil { @@ -460,7 +459,7 @@ func (s *ReactionsService) DeleteTeamDiscussionReactionByOrgIDAndTeamID(ctx cont // GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment-legacy // //meta:operation GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions -func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Context, teamID int64, discussionNumber, commentNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { +func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Context, teamID int64, discussionNumber, commentNumber int, opts *ListReactionOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) u, err := addOptions(u, opts) if err != nil { diff --git a/github/reactions_test.go b/github/reactions_test.go index 5758a705f05..71e8efc0a8e 100644 --- a/github/reactions_test.go +++ b/github/reactions_test.go @@ -79,7 +79,7 @@ func TestReactionsService_ListCommentReactions(t *testing.T) { fmt.Fprint(w, `[{"id":1,"user":{"login":"l","id":2},"content":"+1"}]`) }) - opt := &ListCommentReactionOptions{Content: "+1"} + opt := &ListReactionOptions{Content: "+1"} ctx := context.Background() reactions, _, err := client.Reactions.ListCommentReactions(ctx, "o", "r", 1, opt) if err != nil { @@ -149,13 +149,15 @@ func TestReactionsService_ListIssueReactions(t *testing.T) { mux.HandleFunc("/repos/o/r/issues/1/reactions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") testHeader(t, r, "Accept", mediaTypeReactionsPreview) + testFormValues(t, r, values{"content": "+1"}) w.WriteHeader(http.StatusOK) assertWrite(t, w, []byte(`[{"id":1,"user":{"login":"l","id":2},"content":"+1"}]`)) }) + opt := &ListReactionOptions{Content: "+1"} ctx := context.Background() - got, _, err := client.Reactions.ListIssueReactions(ctx, "o", "r", 1, nil) + got, _, err := client.Reactions.ListIssueReactions(ctx, "o", "r", 1, opt) if err != nil { t.Errorf("ListIssueReactions returned error: %v", err) } @@ -173,7 +175,7 @@ func TestReactionsService_ListIssueReactions_coverage(t *testing.T) { const methodName = "ListIssueReactions" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Reactions.ListIssueReactions(ctx, "\n", "\n", -1, &ListOptions{}) + _, _, err = client.Reactions.ListIssueReactions(ctx, "\n", "\n", -1, &ListReactionOptions{}) return err }) @@ -230,13 +232,15 @@ func TestReactionsService_ListIssueCommentReactions(t *testing.T) { mux.HandleFunc("/repos/o/r/issues/comments/1/reactions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") testHeader(t, r, "Accept", mediaTypeReactionsPreview) + testFormValues(t, r, values{"content": "+1"}) w.WriteHeader(http.StatusOK) assertWrite(t, w, []byte(`[{"id":1,"user":{"login":"l","id":2},"content":"+1"}]`)) }) + opt := &ListReactionOptions{Content: "+1"} ctx := context.Background() - got, _, err := client.Reactions.ListIssueCommentReactions(ctx, "o", "r", 1, nil) + got, _, err := client.Reactions.ListIssueCommentReactions(ctx, "o", "r", 1, opt) if err != nil { t.Errorf("ListIssueCommentReactions returned error: %v", err) } @@ -254,7 +258,7 @@ func TestReactionsService_ListIssueCommentReactions_coverage(t *testing.T) { const methodName = "ListIssueCommentReactions" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Reactions.ListIssueCommentReactions(ctx, "\n", "\n", -1, &ListOptions{}) + _, _, err = client.Reactions.ListIssueCommentReactions(ctx, "\n", "\n", -1, &ListReactionOptions{}) return err }) @@ -311,13 +315,15 @@ func TestReactionsService_ListPullRequestCommentReactions(t *testing.T) { mux.HandleFunc("/repos/o/r/pulls/comments/1/reactions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") testHeader(t, r, "Accept", mediaTypeReactionsPreview) + testFormValues(t, r, values{"content": "+1"}) w.WriteHeader(http.StatusOK) assertWrite(t, w, []byte(`[{"id":1,"user":{"login":"l","id":2},"content":"+1"}]`)) }) + opt := &ListReactionOptions{Content: "+1"} ctx := context.Background() - got, _, err := client.Reactions.ListPullRequestCommentReactions(ctx, "o", "r", 1, nil) + got, _, err := client.Reactions.ListPullRequestCommentReactions(ctx, "o", "r", 1, opt) if err != nil { t.Errorf("ListPullRequestCommentReactions returned error: %v", err) } @@ -335,7 +341,7 @@ func TestReactionsService_ListPullRequestCommentReactions_coverage(t *testing.T) const methodName = "ListPullRequestCommentReactions" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Reactions.ListPullRequestCommentReactions(ctx, "\n", "\n", -1, &ListOptions{}) + _, _, err = client.Reactions.ListPullRequestCommentReactions(ctx, "\n", "\n", -1, &ListReactionOptions{}) return err }) @@ -392,13 +398,15 @@ func TestReactionsService_ListTeamDiscussionReactions(t *testing.T) { mux.HandleFunc("/teams/1/discussions/2/reactions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") testHeader(t, r, "Accept", mediaTypeReactionsPreview) + testFormValues(t, r, values{"content": "+1"}) w.WriteHeader(http.StatusOK) assertWrite(t, w, []byte(`[{"id":1,"user":{"login":"l","id":2},"content":"+1"}]`)) }) + opt := &ListReactionOptions{Content: "+1"} ctx := context.Background() - got, _, err := client.Reactions.ListTeamDiscussionReactions(ctx, 1, 2, nil) + got, _, err := client.Reactions.ListTeamDiscussionReactions(ctx, 1, 2, opt) if err != nil { t.Errorf("ListTeamDiscussionReactions returned error: %v", err) } @@ -416,7 +424,7 @@ func TestReactionsService_ListTeamDiscussionReactions_coverage(t *testing.T) { const methodName = "ListTeamDiscussionReactions" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Reactions.ListTeamDiscussionReactions(ctx, -1, -2, &ListOptions{}) + _, _, err = client.Reactions.ListTeamDiscussionReactions(ctx, -1, -2, &ListReactionOptions{}) return err }) @@ -473,13 +481,15 @@ func TestReactionService_ListTeamDiscussionCommentReactions(t *testing.T) { mux.HandleFunc("/teams/1/discussions/2/comments/3/reactions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") testHeader(t, r, "Accept", mediaTypeReactionsPreview) + testFormValues(t, r, values{"content": "+1"}) w.WriteHeader(http.StatusOK) assertWrite(t, w, []byte(`[{"id":1,"user":{"login":"l","id":2},"content":"+1"}]`)) }) + opt := &ListReactionOptions{Content: "+1"} ctx := context.Background() - got, _, err := client.Reactions.ListTeamDiscussionCommentReactions(ctx, 1, 2, 3, nil) + got, _, err := client.Reactions.ListTeamDiscussionCommentReactions(ctx, 1, 2, 3, opt) if err != nil { t.Errorf("ListTeamDiscussionCommentReactions returned error: %v", err) } @@ -497,7 +507,7 @@ func TestReactionService_ListTeamDiscussionCommentReactions_coverage(t *testing. const methodName = "ListTeamDiscussionCommentReactions" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Reactions.ListTeamDiscussionCommentReactions(ctx, -1, -2, -3, &ListOptions{}) + _, _, err = client.Reactions.ListTeamDiscussionCommentReactions(ctx, -1, -2, -3, &ListReactionOptions{}) return err }) From 4f05dfb48f5ef0ce3d26e106d50c3e65b120c9b9 Mon Sep 17 00:00:00 2001 From: Colby Williams Date: Thu, 27 Mar 2025 06:30:47 -0500 Subject: [PATCH 688/751] Add ListReleaseReactions and DeleteReleaseReaction (#3533) --- github/reactions.go | 51 ++++++++++++++++++++ github/reactions_test.go | 100 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 151 insertions(+) diff --git a/github/reactions.go b/github/reactions.go index 71dd611d85d..5233f78d3d4 100644 --- a/github/reactions.go +++ b/github/reactions.go @@ -568,3 +568,54 @@ func (s *ReactionsService) CreateReleaseReaction(ctx context.Context, owner, rep return m, resp, nil } + +// ListReleaseReactions lists the reactions for a release. +// +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-release +// +//meta:operation GET /repos/{owner}/{repo}/releases/{release_id}/reactions +func (s *ReactionsService) ListReleaseReactions(ctx context.Context, owner, repo string, releaseID int64, opts *ListReactionOptions) ([]*Reaction, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/releases/%v/reactions", owner, repo, releaseID) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept headers when APIs fully launch. + req.Header.Set("Accept", mediaTypeReactionsPreview) + + var m []*Reaction + resp, err := s.client.Do(ctx, req, &m) + if err != nil { + return nil, resp, err + } + + return m, resp, nil +} + +// DeleteReleaseReaction deletes the reaction for a release. +// +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-release-reaction +// +//meta:operation DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id} +func (s *ReactionsService) DeleteReleaseReaction(ctx context.Context, owner, repo string, releaseID, reactionID int64) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/releases/%v/reactions/%v", owner, repo, releaseID, reactionID) + + return s.deleteReaction(ctx, u) +} + +// DeleteReleaseReactionByID deletes the reaction for a release by repository ID. +// +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-release-reaction +// +//meta:operation DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id} +func (s *ReactionsService) DeleteReleaseReactionByID(ctx context.Context, repoID, releaseID, reactionID int64) (*Response, error) { + u := fmt.Sprintf("repositories/%v/releases/%v/reactions/%v", repoID, releaseID, reactionID) + + return s.deleteReaction(ctx, u) +} diff --git a/github/reactions_test.go b/github/reactions_test.go index 71e8efc0a8e..7ac5e363855 100644 --- a/github/reactions_test.go +++ b/github/reactions_test.go @@ -918,3 +918,103 @@ func TestReactionService_CreateReleaseReaction(t *testing.T) { return resp, err }) } + +func TestReactionsService_ListReleaseReactions(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/repos/o/r/releases/1/reactions", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testHeader(t, r, "Accept", mediaTypeReactionsPreview) + testFormValues(t, r, values{"content": "+1"}) + + w.WriteHeader(http.StatusOK) + assertWrite(t, w, []byte(`[{"id":1,"user":{"login":"l","id":2},"content":"+1"}]`)) + }) + + opt := &ListReactionOptions{Content: "+1"} + ctx := context.Background() + got, _, err := client.Reactions.ListReleaseReactions(ctx, "o", "r", 1, opt) + if err != nil { + t.Errorf("ListReleaseReactions returned error: %v", err) + } + want := []*Reaction{{ID: Ptr(int64(1)), User: &User{Login: Ptr("l"), ID: Ptr(int64(2))}, Content: Ptr("+1")}} + if !cmp.Equal(got, want) { + t.Errorf("ListReleaseReactions = %+v, want %+v", got, want) + } +} + +func TestReactionsService_ListReleaseReactions_coverage(t *testing.T) { + t.Parallel() + client, _, _ := setup(t) + + ctx := context.Background() + + const methodName = "ListReleaseReactions" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Reactions.ListReleaseReactions(ctx, "\n", "\n", -1, &ListReactionOptions{}) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Reactions.ListReleaseReactions(ctx, "o", "r", 1, nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestReactionsService_DeleteReleaseReaction(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/repos/o/r/releases/1/reactions/2", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + testHeader(t, r, "Accept", mediaTypeReactionsPreview) + + w.WriteHeader(http.StatusNoContent) + }) + + ctx := context.Background() + if _, err := client.Reactions.DeleteReleaseReaction(ctx, "o", "r", 1, 2); err != nil { + t.Errorf("DeleteReleaseReaction returned error: %v", err) + } + + const methodName = "DeleteReleaseReaction" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Reactions.DeleteReleaseReaction(ctx, "\n", "\n", -1, -2) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Reactions.DeleteReleaseReaction(ctx, "o", "r", 1, 2) + }) +} + +func TestReactionsService_DeleteReleaseReactionByRepoID(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/repositories/1/releases/2/reactions/3", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + testHeader(t, r, "Accept", mediaTypeReactionsPreview) + + w.WriteHeader(http.StatusNoContent) + }) + + ctx := context.Background() + if _, err := client.Reactions.DeleteReleaseReactionByID(ctx, 1, 2, 3); err != nil { + t.Errorf("DeleteReleaseReactionByRepoID returned error: %v", err) + } + + const methodName = "DeleteReleaseReactionByID" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Reactions.DeleteIssueReactionByID(ctx, -1, -2, -3) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Reactions.DeleteIssueReactionByID(ctx, 1, 2, 3) + }) +} From 0710d0b66118875dd853e35fdbeadf32f0264376 Mon Sep 17 00:00:00 2001 From: Cameron Badman <94279788+CameronBadman@users.noreply.github.com> Date: Sat, 29 Mar 2025 04:03:13 +1000 Subject: [PATCH 689/751] feat: Add actions_macos field to APIMeta struct (#3535) --- github/meta.go | 4 ++++ github/meta_test.go | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/github/meta.go b/github/meta.go index cc90b618b14..69235356924 100644 --- a/github/meta.go +++ b/github/meta.go @@ -52,6 +52,10 @@ type APIMeta struct { // GitHub Actions will originate from. Actions []string `json:"actions,omitempty"` + // An array of IP addresses in CIDR format specifying the IP addresses + // GitHub Action macOS runner will originate from. + ActionsMacos []string `json:"actions_macos,omitempty"` + // An array of IP addresses in CIDR format specifying the IP addresses // Dependabot will originate from. Dependabot []string `json:"dependabot,omitempty"` diff --git a/github/meta_test.go b/github/meta_test.go index 71eb2149328..ffe701f0c7c 100644 --- a/github/meta_test.go +++ b/github/meta_test.go @@ -26,6 +26,7 @@ func TestAPIMeta_Marshal(t *testing.T) { Importer: []string{"i"}, GithubEnterpriseImporter: []string{"gei"}, Actions: []string{"a"}, + ActionsMacos: []string{"192.0.2.1/32", "198.51.100.0/24"}, Dependabot: []string{"d"}, SSHKeyFingerprints: map[string]string{"a": "f"}, SSHKeys: []string{"k"}, @@ -58,6 +59,7 @@ func TestAPIMeta_Marshal(t *testing.T) { "importer":["i"], "github_enterprise_importer":["gei"], "actions":["a"], + "actions_macos":["192.0.2.1/32", "198.51.100.0/24"], "dependabot":["d"], "ssh_key_fingerprints":{"a":"f"}, "ssh_keys":["k"], @@ -75,7 +77,7 @@ func TestMetaService_Get(t *testing.T) { mux.HandleFunc("/meta", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - fmt.Fprint(w, `{"web":["w"],"api":["a"],"hooks":["h"], "git":["g"], "pages":["p"], "importer":["i"], "github_enterprise_importer": ["gei"], "actions":["a"], "dependabot":["d"], "verifiable_password_authentication": true, "domains":{"website":["*.github.com","*.github.dev","*.github.io","*.githubassets.com","*.githubusercontent.com"],"artifact_attestations":{"trust_domain":"","services":["*.actions.githubusercontent.com","tuf-repo.github.com","fulcio.githubapp.com","timestamp.githubapp.com"]}}}`) + fmt.Fprint(w, `{"web":["w"],"api":["a"],"hooks":["h"], "git":["g"], "pages":["p"], "importer":["i"], "github_enterprise_importer": ["gei"], "actions":["a"], "actions_macos": ["192.0.2.1/32", "198.51.100.0/24"], "dependabot":["d"], "verifiable_password_authentication": true, "domains":{"website":["*.github.com","*.github.dev","*.github.io","*.githubassets.com","*.githubusercontent.com"],"artifact_attestations":{"trust_domain":"","services":["*.actions.githubusercontent.com","tuf-repo.github.com","fulcio.githubapp.com","timestamp.githubapp.com"]}}}`) }) ctx := context.Background() @@ -91,6 +93,7 @@ func TestMetaService_Get(t *testing.T) { Importer: []string{"i"}, GithubEnterpriseImporter: []string{"gei"}, Actions: []string{"a"}, + ActionsMacos: []string{"192.0.2.1/32", "198.51.100.0/24"}, Dependabot: []string{"d"}, API: []string{"a"}, Web: []string{"w"}, From 6f329be184568f0bc88cf49e60309a36cdcd45a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?At=C4=B1l=20Sensalduz?= <44255923+atilsensalduz@users.noreply.github.com> Date: Wed, 2 Apr 2025 15:45:56 +0300 Subject: [PATCH 690/751] fix: Isolate HTTP transports in parallel tests to prevent connection issues (#3529) --- github/github_test.go | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/github/github_test.go b/github/github_test.go index 46245ff76a6..dd0282154bf 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -57,9 +57,29 @@ func setup(t *testing.T) (client *Client, mux *http.ServeMux, serverURL string) // server is a test HTTP server used to provide mock API responses. server := httptest.NewServer(apiHandler) + // Create a custom transport with isolated connection pool + transport := &http.Transport{ + // Controls connection reuse - false allows reuse, true forces new connections for each request + DisableKeepAlives: false, + // Maximum concurrent connections per host (active + idle) + MaxConnsPerHost: 10, + // Maximum idle connections maintained per host for reuse + MaxIdleConnsPerHost: 5, + // Maximum total idle connections across all hosts + MaxIdleConns: 20, + // How long an idle connection remains in the pool before being closed + IdleConnTimeout: 20 * time.Second, + } + + // Create HTTP client with the isolated transport + httpClient := &http.Client{ + Transport: transport, + Timeout: 30 * time.Second, + } // client is the GitHub client being tested and is // configured to use test server. - client = NewClient(nil) + client = NewClient(httpClient) + url, _ := url.Parse(server.URL + baseURLPath + "/") client.BaseURL = url client.UploadURL = url From 3a3f51bc7c5daa18f7da89d1f806f200fcd4ce96 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Wed, 2 Apr 2025 05:52:10 -0700 Subject: [PATCH 691/751] chore: Remove redundant in Go 1.22 loop variables (#3537) --- .golangci.yml | 3 +- github/actions_artifacts_test.go | 6 ---- github/actions_secrets_test.go | 1 - github/actions_workflow_jobs_test.go | 4 --- github/actions_workflow_runs_test.go | 8 ----- github/codespaces_secrets_test.go | 9 ------ github/copilot_test.go | 1 - github/github_test.go | 6 ---- github/messages_test.go | 1 - github/orgs_properties_test.go | 1 - github/pulls_reviews_test.go | 1 - github/repos_commits_test.go | 4 --- github/repos_contents_test.go | 3 -- github/repos_environments_test.go | 1 - github/repos_hooks_deliveries_test.go | 1 - github/repos_test.go | 42 --------------------------- scrape/apps_test.go | 1 - scrape/forms_test.go | 1 - tools/metadata/metadata_test.go | 1 - 19 files changed, 2 insertions(+), 93 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 5c5646983aa..d45b62f602b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -5,6 +5,7 @@ run: linters: enable: - canonicalheader + - copyloopvar - dogsled - dupl - gci @@ -42,7 +43,7 @@ linters-settings: CopyrightDate: "Copyright \\d{4} " template: |- {{CopyrightDate}}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. gosec: diff --git a/github/actions_artifacts_test.go b/github/actions_artifacts_test.go index 76a82355e1d..6becfcf79d5 100644 --- a/github/actions_artifacts_test.go +++ b/github/actions_artifacts_test.go @@ -289,7 +289,6 @@ func TestActionsService_DownloadArtifact(t *testing.T) { } for _, tc := range tcs { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -351,7 +350,6 @@ func TestActionsService_DownloadArtifact_invalidOwner(t *testing.T) { } for _, tc := range tcs { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() client, _, _ := setup(t) @@ -381,7 +379,6 @@ func TestActionsService_DownloadArtifact_invalidRepo(t *testing.T) { } for _, tc := range tcs { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() client, _, _ := setup(t) @@ -411,7 +408,6 @@ func TestActionsService_DownloadArtifact_StatusMovedPermanently_dontFollowRedire } for _, tc := range tcs { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -448,7 +444,6 @@ func TestActionsService_DownloadArtifact_StatusMovedPermanently_followRedirects( } for _, tc := range tcs { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() client, mux, serverURL := setup(t) @@ -497,7 +492,6 @@ func TestActionsService_DownloadArtifact_unexpectedCode(t *testing.T) { } for _, tc := range tcs { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() client, mux, serverURL := setup(t) diff --git a/github/actions_secrets_test.go b/github/actions_secrets_test.go index ebf312f8170..ec23f3b52c3 100644 --- a/github/actions_secrets_test.go +++ b/github/actions_secrets_test.go @@ -76,7 +76,6 @@ func TestPublicKey_UnmarshalJSON(t *testing.T) { } for name, tt := range testCases { - tt := tt t.Run(name, func(t *testing.T) { t.Parallel() pk := PublicKey{} diff --git a/github/actions_workflow_jobs_test.go b/github/actions_workflow_jobs_test.go index f414df0fbfb..ccc8ae8bf91 100644 --- a/github/actions_workflow_jobs_test.go +++ b/github/actions_workflow_jobs_test.go @@ -200,7 +200,6 @@ func TestActionsService_GetWorkflowJobLogs(t *testing.T) { } for _, tc := range tcs { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -261,7 +260,6 @@ func TestActionsService_GetWorkflowJobLogs_StatusMovedPermanently_dontFollowRedi } for _, tc := range tcs { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -298,7 +296,6 @@ func TestActionsService_GetWorkflowJobLogs_StatusMovedPermanently_followRedirect } for _, tc := range tcs { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() client, mux, serverURL := setup(t) @@ -351,7 +348,6 @@ func TestActionsService_GetWorkflowJobLogs_unexpectedCode(t *testing.T) { } for _, tc := range tcs { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() client, mux, serverURL := setup(t) diff --git a/github/actions_workflow_runs_test.go b/github/actions_workflow_runs_test.go index be400c27e8d..edba5d9c2f0 100644 --- a/github/actions_workflow_runs_test.go +++ b/github/actions_workflow_runs_test.go @@ -206,7 +206,6 @@ func TestActionsService_GetWorkflowRunAttemptLogs(t *testing.T) { } for _, tc := range tcs { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -256,7 +255,6 @@ func TestActionsService_GetWorkflowRunAttemptLogs_StatusMovedPermanently_dontFol } for _, tc := range tcs { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -293,7 +291,6 @@ func TestActionsService_GetWorkflowRunAttemptLogs_StatusMovedPermanently_followR } for _, tc := range tcs { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() client, mux, serverURL := setup(t) @@ -352,7 +349,6 @@ func TestActionsService_GetWorkflowRunAttemptLogs_unexpectedCode(t *testing.T) { } for _, tc := range tcs { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() client, mux, serverURL := setup(t) @@ -521,7 +517,6 @@ func TestActionsService_GetWorkflowRunLogs(t *testing.T) { } for _, tc := range tcs { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -571,7 +566,6 @@ func TestActionsService_GetWorkflowRunLogs_StatusMovedPermanently_dontFollowRedi } for _, tc := range tcs { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -608,7 +602,6 @@ func TestActionsService_GetWorkflowRunLogs_StatusMovedPermanently_followRedirect } for _, tc := range tcs { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() client, mux, serverURL := setup(t) @@ -667,7 +660,6 @@ func TestActionsService_GetWorkflowRunLogs_unexpectedCode(t *testing.T) { } for _, tc := range tcs { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() client, mux, serverURL := setup(t) diff --git a/github/codespaces_secrets_test.go b/github/codespaces_secrets_test.go index 987cfaab612..2c8ae931b00 100644 --- a/github/codespaces_secrets_test.go +++ b/github/codespaces_secrets_test.go @@ -77,7 +77,6 @@ func TestCodespacesService_ListSecrets(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -177,7 +176,6 @@ func TestCodespacesService_GetSecret(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -277,7 +275,6 @@ func TestCodespacesService_CreateOrUpdateSecret(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -364,7 +361,6 @@ func TestCodespacesService_DeleteSecret(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -450,7 +446,6 @@ func TestCodespacesService_GetPublicKey(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -529,7 +524,6 @@ func TestCodespacesService_ListSelectedReposForSecret(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -616,7 +610,6 @@ func TestCodespacesService_SetSelectedReposForSecret(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -684,7 +677,6 @@ func TestCodespacesService_AddSelectedReposForSecret(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -752,7 +744,6 @@ func TestCodespacesService_RemoveSelectedReposFromSecret(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) diff --git a/github/copilot_test.go b/github/copilot_test.go index 6a2f1703d37..ed81761370e 100644 --- a/github/copilot_test.go +++ b/github/copilot_test.go @@ -114,7 +114,6 @@ func TestCopilotSeatDetails_UnmarshalJSON(t *testing.T) { } for _, tc := range tests { - tc := tc seatDetails := &CopilotSeatDetails{} t.Run(tc.name, func(t *testing.T) { diff --git a/github/github_test.go b/github/github_test.go index dd0282154bf..6069b3ebf4a 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -485,7 +485,6 @@ func TestWithEnterpriseURLs(t *testing.T) { wantUploadURL: "https://cloud-api.custom-upload-url/api/uploads/", }, } { - test := test t.Run(test.name, func(t *testing.T) { t.Parallel() validate := func(c *Client, err error) { @@ -2135,7 +2134,6 @@ func TestCompareHttpResponse(t *testing.T) { } for name, tc := range testcases { - tc := tc t.Run(name, func(t *testing.T) { t.Parallel() v := compareHTTPResponse(tc.h1, tc.h2) @@ -2294,7 +2292,6 @@ func TestErrorResponse_Is(t *testing.T) { } for name, tc := range testcases { - tc := tc t.Run(name, func(t *testing.T) { t.Parallel() if tc.wantSame != err.Is(tc.otherError) { @@ -2364,7 +2361,6 @@ func TestRateLimitError_Is(t *testing.T) { } for name, tc := range testcases { - tc := tc t.Run(name, func(t *testing.T) { t.Parallel() if tc.wantSame != tc.err.Is(tc.otherError) { @@ -2451,7 +2447,6 @@ func TestAbuseRateLimitError_Is(t *testing.T) { } for name, tc := range testcases { - tc := tc t.Run(name, func(t *testing.T) { t.Parallel() if tc.wantSame != tc.err.Is(tc.otherError) { @@ -2483,7 +2478,6 @@ func TestAcceptedError_Is(t *testing.T) { } for name, tc := range testcases { - tc := tc t.Run(name, func(t *testing.T) { t.Parallel() if tc.wantSame != err.Is(tc.otherError) { diff --git a/github/messages_test.go b/github/messages_test.go index 36149ba2e36..e6c3027caab 100644 --- a/github/messages_test.go +++ b/github/messages_test.go @@ -215,7 +215,6 @@ func TestValidatePayload_BadRequestBody(t *testing.T) { } for i, tt := range tests { - tt := tt t.Run(fmt.Sprintf("test #%v", i), func(t *testing.T) { t.Parallel() req := &http.Request{ diff --git a/github/orgs_properties_test.go b/github/orgs_properties_test.go index 102f9e669c7..96b90fb7c2d 100644 --- a/github/orgs_properties_test.go +++ b/github/orgs_properties_test.go @@ -423,7 +423,6 @@ func TestCustomPropertyValue_UnmarshalJSON(t *testing.T) { } for name, tc := range tests { - tc := tc t.Run(name, func(t *testing.T) { t.Parallel() cpv := &CustomPropertyValue{} diff --git a/github/pulls_reviews_test.go b/github/pulls_reviews_test.go index 2417f765376..4df4d74f144 100644 --- a/github/pulls_reviews_test.go +++ b/github/pulls_reviews_test.go @@ -330,7 +330,6 @@ func TestPullRequestReviewRequest_isComfortFadePreview(t *testing.T) { }} for _, tc := range tests { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() gotBool, gotErr := tc.review.isComfortFadePreview() diff --git a/github/repos_commits_test.go b/github/repos_commits_test.go index 3c1ac8f33c6..28b8821ba98 100644 --- a/github/repos_commits_test.go +++ b/github/repos_commits_test.go @@ -384,7 +384,6 @@ func TestRepositoriesService_CompareCommits(t *testing.T) { } for i, sample := range testCases { - sample := sample t.Run(fmt.Sprintf("case #%v", i+1), func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -526,7 +525,6 @@ func TestRepositoriesService_CompareCommitsRaw_diff(t *testing.T) { } for i, sample := range testCases { - sample := sample t.Run(fmt.Sprintf("case #%v", i+1), func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -585,7 +583,6 @@ func TestRepositoriesService_CompareCommitsRaw_patch(t *testing.T) { } for i, sample := range testCases { - sample := sample t.Run(fmt.Sprintf("case #%v", i+1), func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -632,7 +629,6 @@ func TestRepositoriesService_CompareCommitsRaw_invalid(t *testing.T) { } for i, sample := range testCases { - sample := sample t.Run(fmt.Sprintf("case #%v", i+1), func(t *testing.T) { t.Parallel() client, _, _ := setup(t) diff --git a/github/repos_contents_test.go b/github/repos_contents_test.go index d5ad45a0f21..d19bf71f35a 100644 --- a/github/repos_contents_test.go +++ b/github/repos_contents_test.go @@ -722,7 +722,6 @@ func TestRepositoriesService_GetArchiveLink(t *testing.T) { } for _, tc := range tcs { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -780,7 +779,6 @@ func TestRepositoriesService_GetArchiveLink_StatusMovedPermanently_dontFollowRed } for _, tc := range tcs { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -816,7 +814,6 @@ func TestRepositoriesService_GetArchiveLink_StatusMovedPermanently_followRedirec } for _, tc := range tcs { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() client, mux, serverURL := setup(t) diff --git a/github/repos_environments_test.go b/github/repos_environments_test.go index 438ab71c288..715012db2f2 100644 --- a/github/repos_environments_test.go +++ b/github/repos_environments_test.go @@ -70,7 +70,6 @@ func TestRequiredReviewer_UnmarshalJSON(t *testing.T) { } for name, test := range testCases { - test := test t.Run(name, func(t *testing.T) { t.Parallel() rule := []*RequiredReviewer{} diff --git a/github/repos_hooks_deliveries_test.go b/github/repos_hooks_deliveries_test.go index 5cdc66dfae2..81421c7901c 100644 --- a/github/repos_hooks_deliveries_test.go +++ b/github/repos_hooks_deliveries_test.go @@ -205,7 +205,6 @@ var hookDeliveryPayloadTypeToStruct = map[string]interface{}{ func TestHookDelivery_ParsePayload(t *testing.T) { t.Parallel() for evt, obj := range hookDeliveryPayloadTypeToStruct { - evt, obj := evt, obj t.Run(evt, func(t *testing.T) { t.Parallel() bs, err := json.Marshal(obj) diff --git a/github/repos_test.go b/github/repos_test.go index ccbbf13384e..716abaf9aac 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -979,7 +979,6 @@ func TestRepositoriesService_GetBranch_BadJSONResponse(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -1050,7 +1049,6 @@ func TestRepositoriesService_GetBranch_notFound(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -1093,7 +1091,6 @@ func TestRepositoriesService_RenameBranch(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -1153,7 +1150,6 @@ func TestRepositoriesService_GetBranchProtection(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -1396,7 +1392,6 @@ func TestRepositoriesService_GetBranchProtection_branchNotProtected(t *testing.T } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -1436,7 +1431,6 @@ func TestRepositoriesService_UpdateBranchProtection_Contexts(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -1626,7 +1620,6 @@ func TestRepositoriesService_UpdateBranchProtection_EmptyContexts(t *testing.T) } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -1806,7 +1799,6 @@ func TestRepositoriesService_UpdateBranchProtection_Checks(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -1965,7 +1957,6 @@ func TestRepositoriesService_UpdateBranchProtection_EmptyChecks(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -2110,7 +2101,6 @@ func TestRepositoriesService_UpdateBranchProtection_StrictNoChecks(t *testing.T) } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -2254,7 +2244,6 @@ func TestRepositoriesService_UpdateBranchProtection_RequireLastPushApproval(t *t } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -2310,7 +2299,6 @@ func TestRepositoriesService_RemoveBranchProtection(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -2405,7 +2393,6 @@ func TestRepositoriesService_GetRequiredStatusChecks(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -2485,7 +2472,6 @@ func TestRepositoriesService_GetRequiredStatusChecks_branchNotProtected(t *testi } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -2525,7 +2511,6 @@ func TestRepositoriesService_UpdateRequiredStatusChecks_Contexts(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -2603,7 +2588,6 @@ func TestRepositoriesService_UpdateRequiredStatusChecks_Checks(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -2696,7 +2680,6 @@ func TestRepositoriesService_RemoveRequiredStatusChecks(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -2737,7 +2720,6 @@ func TestRepositoriesService_ListRequiredStatusChecksContexts(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -2786,7 +2768,6 @@ func TestRepositoriesService_ListRequiredStatusChecksContexts_branchNotProtected } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -2826,7 +2807,6 @@ func TestRepositoriesService_GetPullRequestReviewEnforcement(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -2902,7 +2882,6 @@ func TestRepositoriesService_UpdatePullRequestReviewEnforcement(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -2991,7 +2970,6 @@ func TestRepositoriesService_DisableDismissalRestrictions(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -3048,7 +3026,6 @@ func TestRepositoriesService_RemovePullRequestReviewEnforcement(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -3088,7 +3065,6 @@ func TestRepositoriesService_GetAdminEnforcement(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -3141,7 +3117,6 @@ func TestRepositoriesService_AddAdminEnforcement(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -3193,7 +3168,6 @@ func TestRepositoriesService_RemoveAdminEnforcement(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -3233,7 +3207,6 @@ func TestRepositoriesService_GetSignaturesProtectedBranch(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -3287,7 +3260,6 @@ func TestRepositoriesService_RequireSignaturesOnProtectedBranch(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -3341,7 +3313,6 @@ func TestRepositoriesService_OptionalSignaturesOnProtectedBranch(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -3570,7 +3541,6 @@ func TestRepositoriesService_ListAppRestrictions(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -3613,7 +3583,6 @@ func TestRepositoriesService_ReplaceAppRestrictions(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -3665,7 +3634,6 @@ func TestRepositoriesService_AddAppRestrictions(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -3717,7 +3685,6 @@ func TestRepositoriesService_RemoveAppRestrictions(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -3765,7 +3732,6 @@ func TestRepositoriesService_ListTeamRestrictions(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -3808,7 +3774,6 @@ func TestRepositoriesService_ReplaceTeamRestrictions(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -3860,7 +3825,6 @@ func TestRepositoriesService_AddTeamRestrictions(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -3912,7 +3876,6 @@ func TestRepositoriesService_RemoveTeamRestrictions(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -3960,7 +3923,6 @@ func TestRepositoriesService_ListUserRestrictions(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -4003,7 +3965,6 @@ func TestRepositoriesService_ReplaceUserRestrictions(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -4055,7 +4016,6 @@ func TestRepositoriesService_AddUserRestrictions(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -4107,7 +4067,6 @@ func TestRepositoriesService_RemoveUserRestrictions(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.branch, func(t *testing.T) { t.Parallel() client, mux, _ := setup(t) @@ -4588,7 +4547,6 @@ func TestRepository_UnmarshalJSON(t *testing.T) { } for name, tt := range testCases { - tt := tt t.Run(name, func(t *testing.T) { t.Parallel() pk := Repository{} diff --git a/scrape/apps_test.go b/scrape/apps_test.go index bf2c901ac18..5a955e4f68c 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -34,7 +34,6 @@ func Test_AppRestrictionsEnabled(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.description, func(t *testing.T) { t.Parallel() client, mux := setup(t) diff --git a/scrape/forms_test.go b/scrape/forms_test.go index 0b7a9f9ef1c..3a7f1b37a2d 100644 --- a/scrape/forms_test.go +++ b/scrape/forms_test.go @@ -76,7 +76,6 @@ func Test_ParseForms(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.description, func(t *testing.T) { t.Parallel() node, err := html.Parse(strings.NewReader(tt.html)) diff --git a/tools/metadata/metadata_test.go b/tools/metadata/metadata_test.go index b18395d8042..9d695e7d242 100644 --- a/tools/metadata/metadata_test.go +++ b/tools/metadata/metadata_test.go @@ -19,7 +19,6 @@ func Test_normalizedOpName(t *testing.T) { {name: "get /foo/{id}", want: "GET /foo/*"}, {name: "get foo", want: "GET /foo"}, } { - td := td t.Run(td.name, func(t *testing.T) { t.Parallel() got := normalizedOpName(td.name) From b6dbc4e5a4792664531bafdb6bbeecfe382137bf Mon Sep 17 00:00:00 2001 From: Julien Bouyoud Date: Mon, 7 Apr 2025 15:43:57 +0200 Subject: [PATCH 692/751] fix: Add back repository field in Package struct (#3539) --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 8 ++++++++ github/github-stringify_test.go | 3 ++- github/packages.go | 17 +++++++++-------- github/packages_test.go | 4 ++++ 5 files changed, 31 insertions(+), 9 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 689d78633e9..45fa9075106 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -15918,6 +15918,14 @@ func (p *Package) GetRegistry() *PackageRegistry { return p.Registry } +// GetRepository returns the Repository field. +func (p *Package) GetRepository() *Repository { + if p == nil { + return nil + } + return p.Repository +} + // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. func (p *Package) GetUpdatedAt() Timestamp { if p == nil || p.UpdatedAt == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 85647c6dd8c..8f089f5b8fe 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -20644,6 +20644,14 @@ func TestPackage_GetRegistry(tt *testing.T) { p.GetRegistry() } +func TestPackage_GetRepository(tt *testing.T) { + tt.Parallel() + p := &Package{} + p.GetRepository() + p = nil + p.GetRepository() +} + func TestPackage_GetUpdatedAt(tt *testing.T) { tt.Parallel() var zeroValue Timestamp diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index 5abc381a843..0100a4c202f 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -1138,6 +1138,7 @@ func TestPackage_String(t *testing.T) { HTMLURL: Ptr(""), Visibility: Ptr(""), Owner: &User{}, + Repository: &Repository{}, CreatedAt: &Timestamp{}, UpdatedAt: &Timestamp{}, Namespace: Ptr(""), @@ -1148,7 +1149,7 @@ func TestPackage_String(t *testing.T) { URL: Ptr(""), VersionCount: Ptr(int64(0)), } - want := `github.Package{ID:0, Name:"", PackageType:"", HTMLURL:"", Visibility:"", Owner:github.User{}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Namespace:"", Description:"", Ecosystem:"", PackageVersion:github.PackageVersion{}, Registry:github.PackageRegistry{}, URL:"", VersionCount:0}` + want := `github.Package{ID:0, Name:"", PackageType:"", HTMLURL:"", Visibility:"", Owner:github.User{}, Repository:github.Repository{}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Namespace:"", Description:"", Ecosystem:"", PackageVersion:github.PackageVersion{}, Registry:github.PackageRegistry{}, URL:"", VersionCount:0}` if got := v.String(); got != want { t.Errorf("Package.String = %v, want %v", got, want) } diff --git a/github/packages.go b/github/packages.go index e7c327963cf..1eed77e804d 100644 --- a/github/packages.go +++ b/github/packages.go @@ -11,14 +11,15 @@ import ( // Package represents a GitHub package. type Package struct { - ID *int64 `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - PackageType *string `json:"package_type,omitempty"` // One of "npm", "maven", "rubygems", "docker", "nuget", "container". For webhook events "container" is "CONTAINER" - HTMLURL *string `json:"html_url,omitempty"` - Visibility *string `json:"visibility,omitempty"` - Owner *User `json:"owner,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + PackageType *string `json:"package_type,omitempty"` // One of "npm", "maven", "rubygems", "docker", "nuget", "container". For webhook events "container" is "CONTAINER" + HTMLURL *string `json:"html_url,omitempty"` + Visibility *string `json:"visibility,omitempty"` + Owner *User `json:"owner,omitempty"` + Repository *Repository `json:"repository,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` // The following are only populated for webhook events Namespace *string `json:"namespace,omitempty"` diff --git a/github/packages_test.go b/github/packages_test.go index 414ba503824..9d2dcf10850 100644 --- a/github/packages_test.go +++ b/github/packages_test.go @@ -690,6 +690,7 @@ func TestPackage_Marshal(t *testing.T) { CreatedAt: &Timestamp{referenceTime}, SuspendedAt: &Timestamp{referenceTime}, }, + Repository: &Repository{ID: Ptr(int64(1))}, CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, Namespace: Ptr("n"), @@ -836,6 +837,9 @@ func TestPackage_Marshal(t *testing.T) { "suspended_at": ` + referenceTimeStr + `, "url": "u" }, + "repository": { + "id": 1 + }, "created_at": ` + referenceTimeStr + `, "updated_at": ` + referenceTimeStr + `, "namespace": "n", From c099baf334af9b3362514dd9d3164c4be0097056 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Mon, 7 Apr 2025 08:57:42 -0500 Subject: [PATCH 693/751] Bump version of go-github to v71.0.0 (#3540) --- README.md | 18 +++++++++--------- example/actionpermissions/main.go | 2 +- example/appengine/app.go | 2 +- example/basicauth/main.go | 2 +- .../newreposecretwithxcrypto/main.go | 2 +- .../newusersecretwithxcrypto/main.go | 2 +- example/commitpr/main.go | 2 +- example/go.mod | 6 +++--- example/listenvironments/main.go | 2 +- example/migrations/main.go | 2 +- example/newfilewithappauth/main.go | 2 +- example/newrepo/main.go | 2 +- example/newreposecretwithlibsodium/go.mod | 4 ++-- example/newreposecretwithlibsodium/main.go | 2 +- example/newreposecretwithxcrypto/main.go | 2 +- example/ratelimit/main.go | 2 +- example/simple/main.go | 2 +- example/tokenauth/main.go | 2 +- example/topics/main.go | 2 +- example/verifyartifact/main.go | 2 +- github/doc.go | 2 +- github/examples_test.go | 2 +- github/github.go | 2 +- go.mod | 2 +- test/fields/fields.go | 2 +- test/integration/activity_test.go | 2 +- test/integration/authorizations_test.go | 2 +- test/integration/github_test.go | 2 +- test/integration/repos_test.go | 2 +- test/integration/users_test.go | 2 +- tools/go.mod | 4 ++-- tools/metadata/main.go | 2 +- tools/metadata/main_test.go | 2 +- tools/metadata/metadata.go | 2 +- tools/metadata/openapi.go | 2 +- 35 files changed, 47 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index 74223c0ab72..d6f6bafc6f8 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-github # [![go-github release (latest SemVer)](https://img.shields.io/github/v/release/google/go-github?sort=semver)](https://github.com/google/go-github/releases) -[![Go Reference](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v70/github) +[![Go Reference](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v71/github) [![Test Status](https://github.com/google/go-github/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/google/go-github/actions/workflows/tests.yml) [![Test Coverage](https://codecov.io/gh/google/go-github/branch/master/graph/badge.svg)](https://codecov.io/gh/google/go-github) [![Discuss at go-github@googlegroups.com](https://img.shields.io/badge/discuss-go--github%40googlegroups.com-blue.svg)](https://groups.google.com/group/go-github) @@ -30,7 +30,7 @@ If you're interested in using the [GraphQL API v4][], the recommended library is go-github is compatible with modern Go releases in module mode, with Go installed: ```bash -go get github.com/google/go-github/v70 +go get github.com/google/go-github/v71 ``` will resolve and add the package to the current development module, along with its dependencies. @@ -38,7 +38,7 @@ will resolve and add the package to the current development module, along with i Alternatively the same can be achieved if you use import in a package: ```go -import "github.com/google/go-github/v70/github" +import "github.com/google/go-github/v71/github" ``` and run `go get` without parameters. @@ -46,13 +46,13 @@ and run `go get` without parameters. Finally, to use the top-of-trunk version of this repo, use the following command: ```bash -go get github.com/google/go-github/v70@master +go get github.com/google/go-github/v71@master ``` ## Usage ## ```go -import "github.com/google/go-github/v70/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) +import "github.com/google/go-github/v71/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled ``` @@ -125,7 +125,7 @@ import ( "net/http" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v70/github" + "github.com/google/go-github/v71/github" ) func main() { @@ -159,7 +159,7 @@ import ( "os" "strconv" - "github.com/google/go-github/v70/github" + "github.com/google/go-github/v71/github" "github.com/jferrl/go-githubauth" "golang.org/x/oauth2" ) @@ -380,7 +380,7 @@ For complete usage of go-github, see the full [package docs][]. [GitHub API v3]: https://docs.github.com/en/rest [personal access token]: https://github.com/blog/1509-personal-api-tokens -[package docs]: https://pkg.go.dev/github.com/google/go-github/v70/github +[package docs]: https://pkg.go.dev/github.com/google/go-github/v71/github [GraphQL API v4]: https://developer.github.com/v4/ [shurcooL/githubv4]: https://github.com/shurcooL/githubv4 [GitHub webhook events]: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads @@ -454,7 +454,7 @@ Versions prior to 48.2.0 are not listed. | go-github Version | GitHub v3 API Version | | ----------------- | --------------------- | -| 70.0.0 | 2022-11-28 | +| 71.0.0 | 2022-11-28 | | ... | 2022-11-28 | | 48.2.0 | 2022-11-28 | diff --git a/example/actionpermissions/main.go b/example/actionpermissions/main.go index 991010d02b4..f5628b6b447 100644 --- a/example/actionpermissions/main.go +++ b/example/actionpermissions/main.go @@ -14,7 +14,7 @@ import ( "log" "os" - "github.com/google/go-github/v70/github" + "github.com/google/go-github/v71/github" ) var ( diff --git a/example/appengine/app.go b/example/appengine/app.go index d8a39af1cc6..a78e574ed13 100644 --- a/example/appengine/app.go +++ b/example/appengine/app.go @@ -12,7 +12,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v70/github" + "github.com/google/go-github/v71/github" "google.golang.org/appengine" "google.golang.org/appengine/log" ) diff --git a/example/basicauth/main.go b/example/basicauth/main.go index d9407455a87..b0f2515d0fb 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -21,7 +21,7 @@ import ( "os" "strings" - "github.com/google/go-github/v70/github" + "github.com/google/go-github/v71/github" "golang.org/x/term" ) diff --git a/example/codespaces/newreposecretwithxcrypto/main.go b/example/codespaces/newreposecretwithxcrypto/main.go index a7d4c76d173..8d8502e6b7d 100644 --- a/example/codespaces/newreposecretwithxcrypto/main.go +++ b/example/codespaces/newreposecretwithxcrypto/main.go @@ -37,7 +37,7 @@ import ( "log" "os" - "github.com/google/go-github/v70/github" + "github.com/google/go-github/v71/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/codespaces/newusersecretwithxcrypto/main.go b/example/codespaces/newusersecretwithxcrypto/main.go index 0aa15f0e20b..6be8dd92546 100644 --- a/example/codespaces/newusersecretwithxcrypto/main.go +++ b/example/codespaces/newusersecretwithxcrypto/main.go @@ -38,7 +38,7 @@ import ( "log" "os" - "github.com/google/go-github/v70/github" + "github.com/google/go-github/v71/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index 9ee111733f6..f3a4297d4ac 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -33,7 +33,7 @@ import ( "time" "github.com/ProtonMail/go-crypto/openpgp" - "github.com/google/go-github/v70/github" + "github.com/google/go-github/v71/github" ) var ( diff --git a/example/go.mod b/example/go.mod index 9ed11b66edc..a9ac895be06 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v70/example +module github.com/google/go-github/v71/example go 1.23.0 @@ -7,7 +7,7 @@ require ( github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-pagination v1.0.0 github.com/gofri/go-github-ratelimit/v2 v2.0.2 - github.com/google/go-github/v70 v70.0.0 + github.com/google/go-github/v71 v71.0.0 github.com/sigstore/sigstore-go v0.6.1 golang.org/x/crypto v0.35.0 golang.org/x/term v0.29.0 @@ -100,4 +100,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v70 => ../ +replace github.com/google/go-github/v71 => ../ diff --git a/example/listenvironments/main.go b/example/listenvironments/main.go index 6cc10bdd826..b58f8dd150f 100644 --- a/example/listenvironments/main.go +++ b/example/listenvironments/main.go @@ -18,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v70/github" + "github.com/google/go-github/v71/github" ) func main() { diff --git a/example/migrations/main.go b/example/migrations/main.go index 98138ad5ed4..b60f6404d1f 100644 --- a/example/migrations/main.go +++ b/example/migrations/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v70/github" + "github.com/google/go-github/v71/github" ) func fetchAllUserMigrations() ([]*github.UserMigration, error) { diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index 245d084b434..610b8fa6735 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -16,7 +16,7 @@ import ( "time" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v70/github" + "github.com/google/go-github/v71/github" ) func main() { diff --git a/example/newrepo/main.go b/example/newrepo/main.go index 12d8caf4be4..8ef8822e611 100644 --- a/example/newrepo/main.go +++ b/example/newrepo/main.go @@ -16,7 +16,7 @@ import ( "log" "os" - "github.com/google/go-github/v70/github" + "github.com/google/go-github/v71/github" ) var ( diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index f26c004ba2c..2e6fd8e51fa 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -4,10 +4,10 @@ go 1.23.0 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb - github.com/google/go-github/v70 v70.0.0 + github.com/google/go-github/v71 v71.0.0 ) require github.com/google/go-querystring v1.1.0 // indirect // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v70 => ../.. +replace github.com/google/go-github/v71 => ../.. diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index 917faf35b9b..284514e4d02 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -36,7 +36,7 @@ import ( "os" sodium "github.com/GoKillers/libsodium-go/cryptobox" - "github.com/google/go-github/v70/github" + "github.com/google/go-github/v71/github" ) var ( diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index 2af567439e0..7622a5a40c4 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -37,7 +37,7 @@ import ( "log" "os" - "github.com/google/go-github/v70/github" + "github.com/google/go-github/v71/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/ratelimit/main.go b/example/ratelimit/main.go index fbb474fdb0f..b97a0cfafff 100644 --- a/example/ratelimit/main.go +++ b/example/ratelimit/main.go @@ -17,7 +17,7 @@ import ( "github.com/gofri/go-github-ratelimit/v2/github_ratelimit" "github.com/gofri/go-github-ratelimit/v2/github_ratelimit/github_primary_ratelimit" "github.com/gofri/go-github-ratelimit/v2/github_ratelimit/github_secondary_ratelimit" - "github.com/google/go-github/v70/github" + "github.com/google/go-github/v71/github" ) func main() { diff --git a/example/simple/main.go b/example/simple/main.go index b1b2d8cecc0..d881a995ed4 100644 --- a/example/simple/main.go +++ b/example/simple/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v70/github" + "github.com/google/go-github/v71/github" ) // Fetch all the public organizations' membership of a user. diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index c872d40adba..657bbe43d7d 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -15,7 +15,7 @@ import ( "log" "os" - "github.com/google/go-github/v70/github" + "github.com/google/go-github/v71/github" "golang.org/x/term" ) diff --git a/example/topics/main.go b/example/topics/main.go index 08b3f105ea2..0939397d813 100644 --- a/example/topics/main.go +++ b/example/topics/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v70/github" + "github.com/google/go-github/v71/github" ) // Fetch and lists all the public topics associated with the specified GitHub topic. diff --git a/example/verifyartifact/main.go b/example/verifyartifact/main.go index ae0401b97ed..8355c5998f2 100644 --- a/example/verifyartifact/main.go +++ b/example/verifyartifact/main.go @@ -18,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v70/github" + "github.com/google/go-github/v71/github" "github.com/sigstore/sigstore-go/pkg/bundle" "github.com/sigstore/sigstore-go/pkg/root" "github.com/sigstore/sigstore-go/pkg/verify" diff --git a/github/doc.go b/github/doc.go index befbd8b8dbb..b963051fab5 100644 --- a/github/doc.go +++ b/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v70/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v71/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to diff --git a/github/examples_test.go b/github/examples_test.go index dd8da6539f1..628e069dd00 100644 --- a/github/examples_test.go +++ b/github/examples_test.go @@ -12,7 +12,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v70/github" + "github.com/google/go-github/v71/github" ) func ExampleMarkdownService_Render() { diff --git a/github/github.go b/github/github.go index f31473edff6..ddafffb2a9c 100644 --- a/github/github.go +++ b/github/github.go @@ -29,7 +29,7 @@ import ( ) const ( - Version = "v70.0.0" + Version = "v71.0.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" diff --git a/go.mod b/go.mod index 7cb5bf0d072..9f404a5b3f5 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v70 +module github.com/google/go-github/v71 go 1.23.0 diff --git a/test/fields/fields.go b/test/fields/fields.go index 5d21934d1eb..2e065f18661 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -25,7 +25,7 @@ import ( "reflect" "strings" - "github.com/google/go-github/v70/github" + "github.com/google/go-github/v71/github" ) var ( diff --git a/test/integration/activity_test.go b/test/integration/activity_test.go index 77acbe3fade..265bb44f353 100644 --- a/test/integration/activity_test.go +++ b/test/integration/activity_test.go @@ -11,7 +11,7 @@ import ( "context" "testing" - "github.com/google/go-github/v70/github" + "github.com/google/go-github/v71/github" ) const ( diff --git a/test/integration/authorizations_test.go b/test/integration/authorizations_test.go index 0fe0128f52e..9855dd421ba 100644 --- a/test/integration/authorizations_test.go +++ b/test/integration/authorizations_test.go @@ -14,7 +14,7 @@ import ( "testing" "time" - "github.com/google/go-github/v70/github" + "github.com/google/go-github/v71/github" ) const msgEnvMissing = "Skipping test because the required environment variable (%v) is not present." diff --git a/test/integration/github_test.go b/test/integration/github_test.go index f4099946c41..25fad444ce3 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -14,7 +14,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v70/github" + "github.com/google/go-github/v71/github" ) var ( diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index 6b6e0e23a26..25408fed4c4 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -14,7 +14,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v70/github" + "github.com/google/go-github/v71/github" ) func TestRepositories_CRUD(t *testing.T) { diff --git a/test/integration/users_test.go b/test/integration/users_test.go index b014da21351..9f4359f3100 100644 --- a/test/integration/users_test.go +++ b/test/integration/users_test.go @@ -13,7 +13,7 @@ import ( "math/rand" "testing" - "github.com/google/go-github/v70/github" + "github.com/google/go-github/v71/github" ) func TestUsers_Get(t *testing.T) { diff --git a/tools/go.mod b/tools/go.mod index 71b1540c7db..164f32f2f52 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -6,7 +6,7 @@ require ( github.com/alecthomas/kong v1.9.0 github.com/getkin/kin-openapi v0.131.0 github.com/google/go-cmp v0.7.0 - github.com/google/go-github/v70 v70.0.0 + github.com/google/go-github/v71 v71.0.0 golang.org/x/sync v0.12.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -25,4 +25,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v70 => ../ +replace github.com/google/go-github/v71 => ../ diff --git a/tools/metadata/main.go b/tools/metadata/main.go index 9c3f427b066..a24878be953 100644 --- a/tools/metadata/main.go +++ b/tools/metadata/main.go @@ -16,7 +16,7 @@ import ( "path/filepath" "github.com/alecthomas/kong" - "github.com/google/go-github/v70/github" + "github.com/google/go-github/v71/github" ) var helpVars = kong.Vars{ diff --git a/tools/metadata/main_test.go b/tools/metadata/main_test.go index 291314cc07d..3d4e38267dc 100644 --- a/tools/metadata/main_test.go +++ b/tools/metadata/main_test.go @@ -23,7 +23,7 @@ import ( "github.com/alecthomas/kong" "github.com/getkin/kin-openapi/openapi3" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v70/github" + "github.com/google/go-github/v71/github" ) func TestUpdateGo(t *testing.T) { diff --git a/tools/metadata/metadata.go b/tools/metadata/metadata.go index 9788db318ff..8c1df52f2ce 100644 --- a/tools/metadata/metadata.go +++ b/tools/metadata/metadata.go @@ -24,7 +24,7 @@ import ( "strings" "sync" - "github.com/google/go-github/v70/github" + "github.com/google/go-github/v71/github" "gopkg.in/yaml.v3" ) diff --git a/tools/metadata/openapi.go b/tools/metadata/openapi.go index cc7307239d2..845de5f545f 100644 --- a/tools/metadata/openapi.go +++ b/tools/metadata/openapi.go @@ -14,7 +14,7 @@ import ( "strconv" "github.com/getkin/kin-openapi/openapi3" - "github.com/google/go-github/v70/github" + "github.com/google/go-github/v71/github" "golang.org/x/sync/errgroup" ) From 15ecccd9c587b525cf58a89e83b374fe966e1c5b Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Mon, 7 Apr 2025 09:22:42 -0500 Subject: [PATCH 694/751] Bump go-github from v70 to v71 in /scrape (#3541) --- scrape/apps.go | 2 +- scrape/apps_test.go | 2 +- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scrape/apps.go b/scrape/apps.go index 8bc84690be2..8e6fc0f76fc 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -18,7 +18,7 @@ import ( "strings" "github.com/PuerkitoBio/goquery" - "github.com/google/go-github/v70/github" + "github.com/google/go-github/v71/github" ) // AppRestrictionsEnabled returns whether the specified organization has diff --git a/scrape/apps_test.go b/scrape/apps_test.go index 5a955e4f68c..6362ece3f03 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -10,7 +10,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v70/github" + "github.com/google/go-github/v71/github" ) func Test_AppRestrictionsEnabled(t *testing.T) { diff --git a/scrape/go.mod b/scrape/go.mod index a309cffc515..70305d9003d 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -5,7 +5,7 @@ go 1.23.0 require ( github.com/PuerkitoBio/goquery v1.10.2 github.com/google/go-cmp v0.7.0 - github.com/google/go-github/v70 v70.0.0 + github.com/google/go-github/v71 v71.0.0 github.com/xlzd/gotp v0.1.0 golang.org/x/net v0.37.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index efa89279a5d..be84348265c 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -6,8 +6,8 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/go-github/v70 v70.0.0 h1:/tqCp5KPrcvqCc7vIvYyFYTiCGrYvaWoYMGHSQbo55o= -github.com/google/go-github/v70 v70.0.0/go.mod h1:xBUZgo8MI3lUL/hwxl3hlceJW1U8MVnXP3zUyI+rhQY= +github.com/google/go-github/v71 v71.0.0 h1:Zi16OymGKZZMm8ZliffVVJ/Q9YZreDKONCr+WUd0Z30= +github.com/google/go-github/v71 v71.0.0/go.mod h1:URZXObp2BLlMjwu0O8g4y6VBneUj2bCHgnI8FfgZ51M= 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.1.0 h1:37blvlKCh38s+fkem+fFh7sMnceltoIEBYTVXyoa5Po= From ff84bff9a9ad2ece3965a968de60c015a1b7a73c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Apr 2025 10:53:52 -0400 Subject: [PATCH 695/751] build(deps): bump golang.org/x/net from 0.37.0 to 0.38.0 in /scrape (#3536) --- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 70305d9003d..3bfc9e586de 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -7,7 +7,7 @@ require ( github.com/google/go-cmp v0.7.0 github.com/google/go-github/v71 v71.0.0 github.com/xlzd/gotp v0.1.0 - golang.org/x/net v0.37.0 + golang.org/x/net v0.38.0 ) require ( diff --git a/scrape/go.sum b/scrape/go.sum index be84348265c..c9a415a4e30 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -33,8 +33,8 @@ golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= -golang.org/x/net v0.37.0 h1:1zLorHbz+LYj7MQlSf1+2tPIIgibq2eL5xkrGk6f+2c= -golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= +golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8= +golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= From 7db22ac78934db487c29eb528cb82b9e6af56e2f Mon Sep 17 00:00:00 2001 From: Abinand P Date: Mon, 7 Apr 2025 21:10:22 +0530 Subject: [PATCH 696/751] chore!: Remove support for Required Workflows (#3538) --- github/actions_required_workflows.go | 267 ------------ github/actions_required_workflows_test.go | 479 ---------------------- github/github-accessors.go | 224 ---------- github/github-accessors_test.go | 299 -------------- openapi_operations.yaml | 20 - 5 files changed, 1289 deletions(-) delete mode 100644 github/actions_required_workflows.go delete mode 100644 github/actions_required_workflows_test.go diff --git a/github/actions_required_workflows.go b/github/actions_required_workflows.go deleted file mode 100644 index b89741a82a1..00000000000 --- a/github/actions_required_workflows.go +++ /dev/null @@ -1,267 +0,0 @@ -// Copyright 2023 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" -) - -// OrgRequiredWorkflow represents a required workflow object at the org level. -type OrgRequiredWorkflow struct { - ID *int64 `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Path *string `json:"path,omitempty"` - Scope *string `json:"scope,omitempty"` - Ref *string `json:"ref,omitempty"` - State *string `json:"state,omitempty"` - SelectedRepositoriesURL *string `json:"selected_repositories_url,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - Repository *Repository `json:"repository,omitempty"` -} - -// OrgRequiredWorkflows represents the required workflows for the org. -type OrgRequiredWorkflows struct { - TotalCount *int `json:"total_count,omitempty"` - RequiredWorkflows []*OrgRequiredWorkflow `json:"required_workflows,omitempty"` -} - -// CreateUpdateRequiredWorkflowOptions represents the input object used to create or update required workflows. -type CreateUpdateRequiredWorkflowOptions struct { - WorkflowFilePath *string `json:"workflow_file_path,omitempty"` - RepositoryID *int64 `json:"repository_id,omitempty"` - Scope *string `json:"scope,omitempty"` - SelectedRepositoryIDs *SelectedRepoIDs `json:"selected_repository_ids,omitempty"` -} - -// RequiredWorkflowSelectedRepos represents the repos that a required workflow is applied to. -type RequiredWorkflowSelectedRepos struct { - TotalCount *int `json:"total_count,omitempty"` - Repositories []*Repository `json:"repositories,omitempty"` -} - -// RepoRequiredWorkflow represents a required workflow object at the repo level. -type RepoRequiredWorkflow struct { - ID *int64 `json:"id,omitempty"` - NodeID *string `json:"node_id,omitempty"` - Name *string `json:"name,omitempty"` - Path *string `json:"path,omitempty"` - State *string `json:"state,omitempty"` - URL *string `json:"url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - BadgeURL *string `json:"badge_url,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - SourceRepository *Repository `json:"source_repository,omitempty"` -} - -// RepoRequiredWorkflows represents the required workflows for a repo. -type RepoRequiredWorkflows struct { - TotalCount *int `json:"total_count,omitempty"` - RequiredWorkflows []*RepoRequiredWorkflow `json:"required_workflows,omitempty"` -} - -// ListOrgRequiredWorkflows lists the RequiredWorkflows for an org. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -//meta:operation GET /orgs/{org}/actions/required_workflows -func (s *ActionsService) ListOrgRequiredWorkflows(ctx context.Context, org string, opts *ListOptions) (*OrgRequiredWorkflows, *Response, error) { - url := fmt.Sprintf("orgs/%v/actions/required_workflows", org) - u, err := addOptions(url, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - requiredWorkflows := new(OrgRequiredWorkflows) - resp, err := s.client.Do(ctx, req, &requiredWorkflows) - if err != nil { - return nil, resp, err - } - - return requiredWorkflows, resp, nil -} - -// CreateRequiredWorkflow creates the required workflow in an org. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -//meta:operation POST /orgs/{org}/actions/required_workflows -func (s *ActionsService) CreateRequiredWorkflow(ctx context.Context, org string, createRequiredWorkflowOptions *CreateUpdateRequiredWorkflowOptions) (*OrgRequiredWorkflow, *Response, error) { - url := fmt.Sprintf("orgs/%v/actions/required_workflows", org) - req, err := s.client.NewRequest("POST", url, createRequiredWorkflowOptions) - if err != nil { - return nil, nil, err - } - - orgRequiredWorkflow := new(OrgRequiredWorkflow) - resp, err := s.client.Do(ctx, req, orgRequiredWorkflow) - if err != nil { - return nil, resp, err - } - - return orgRequiredWorkflow, resp, nil -} - -// GetRequiredWorkflowByID get the RequiredWorkflows for an org by its ID. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -//meta:operation GET /orgs/{org}/actions/required_workflows/{workflow_id} -func (s *ActionsService) GetRequiredWorkflowByID(ctx context.Context, owner string, requiredWorkflowID int64) (*OrgRequiredWorkflow, *Response, error) { - u := fmt.Sprintf("orgs/%v/actions/required_workflows/%v", owner, requiredWorkflowID) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - requiredWorkflow := new(OrgRequiredWorkflow) - resp, err := s.client.Do(ctx, req, &requiredWorkflow) - if err != nil { - return nil, resp, err - } - - return requiredWorkflow, resp, nil -} - -// UpdateRequiredWorkflow updates a required workflow in an org. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -//meta:operation PATCH /orgs/{org}/actions/required_workflows/{workflow_id} -func (s *ActionsService) UpdateRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID int64, updateRequiredWorkflowOptions *CreateUpdateRequiredWorkflowOptions) (*OrgRequiredWorkflow, *Response, error) { - url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v", org, requiredWorkflowID) - req, err := s.client.NewRequest("PATCH", url, updateRequiredWorkflowOptions) - if err != nil { - return nil, nil, err - } - - orgRequiredWorkflow := new(OrgRequiredWorkflow) - resp, err := s.client.Do(ctx, req, orgRequiredWorkflow) - if err != nil { - return nil, resp, err - } - - return orgRequiredWorkflow, resp, nil -} - -// DeleteRequiredWorkflow deletes a required workflow in an org. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -//meta:operation DELETE /orgs/{org}/actions/required_workflows/{workflow_id} -func (s *ActionsService) DeleteRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID int64) (*Response, error) { - url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v", org, requiredWorkflowID) - req, err := s.client.NewRequest("DELETE", url, nil) - if err != nil { - return nil, err - } - return s.client.Do(ctx, req, nil) -} - -// ListRequiredWorkflowSelectedRepos lists the Repositories selected for a workflow. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -//meta:operation GET /orgs/{org}/actions/required_workflows/{workflow_id}/repositories -func (s *ActionsService) ListRequiredWorkflowSelectedRepos(ctx context.Context, org string, requiredWorkflowID int64, opts *ListOptions) (*RequiredWorkflowSelectedRepos, *Response, error) { - url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories", org, requiredWorkflowID) - u, err := addOptions(url, opts) - if err != nil { - return nil, nil, err - } - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - requiredWorkflowRepos := new(RequiredWorkflowSelectedRepos) - resp, err := s.client.Do(ctx, req, &requiredWorkflowRepos) - if err != nil { - return nil, resp, err - } - - return requiredWorkflowRepos, resp, nil -} - -// SetRequiredWorkflowSelectedRepos sets the Repositories selected for a workflow. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -//meta:operation PUT /orgs/{org}/actions/required_workflows/{workflow_id}/repositories -func (s *ActionsService) SetRequiredWorkflowSelectedRepos(ctx context.Context, org string, requiredWorkflowID int64, ids SelectedRepoIDs) (*Response, error) { - type repoIDs struct { - SelectedIDs SelectedRepoIDs `json:"selected_repository_ids"` - } - url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories", org, requiredWorkflowID) - req, err := s.client.NewRequest("PUT", url, repoIDs{SelectedIDs: ids}) - if err != nil { - return nil, err - } - - return s.client.Do(ctx, req, nil) -} - -// AddRepoToRequiredWorkflow adds the Repository to a required workflow. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -//meta:operation PUT /orgs/{org}/actions/required_workflows/{workflow_id}/repositories/{repository_id} -func (s *ActionsService) AddRepoToRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID, repoID int64) (*Response, error) { - url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories/%v", org, requiredWorkflowID, repoID) - req, err := s.client.NewRequest("PUT", url, nil) - if err != nil { - return nil, err - } - return s.client.Do(ctx, req, nil) -} - -// RemoveRepoFromRequiredWorkflow removes the Repository from a required workflow. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -//meta:operation DELETE /orgs/{org}/actions/required_workflows/{workflow_id}/repositories/{repository_id} -func (s *ActionsService) RemoveRepoFromRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID, repoID int64) (*Response, error) { - url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories/%v", org, requiredWorkflowID, repoID) - req, err := s.client.NewRequest("DELETE", url, nil) - if err != nil { - return nil, err - } - return s.client.Do(ctx, req, nil) -} - -// ListRepoRequiredWorkflows lists the RequiredWorkflows for a repo. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -//meta:operation GET /repos/{owner}/{repo}/actions/required_workflows -func (s *ActionsService) ListRepoRequiredWorkflows(ctx context.Context, owner, repo string, opts *ListOptions) (*RepoRequiredWorkflows, *Response, error) { - url := fmt.Sprintf("repos/%v/%v/actions/required_workflows", owner, repo) - u, err := addOptions(url, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - requiredWorkflows := new(RepoRequiredWorkflows) - resp, err := s.client.Do(ctx, req, &requiredWorkflows) - if err != nil { - return nil, resp, err - } - - return requiredWorkflows, resp, nil -} diff --git a/github/actions_required_workflows_test.go b/github/actions_required_workflows_test.go deleted file mode 100644 index 5d7e72c6883..00000000000 --- a/github/actions_required_workflows_test.go +++ /dev/null @@ -1,479 +0,0 @@ -// Copyright 2023 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" - "time" - - "github.com/google/go-cmp/cmp" -) - -func TestActionsService_ListOrgRequiredWorkflows(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/orgs/o/actions/required_workflows", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - testFormValues(t, r, values{"per_page": "2", "page": "2"}) - fmt.Fprint(w, `{"total_count":4,"required_workflows": [ - { - "id": 30433642, - "name": "Required CI", - "path": ".github/workflows/ci.yml", - "scope": "selected", - "ref": "refs/head/main", - "state": "active", - "selected_repositories_url": "https://api.github.com/organizations/org/actions/required_workflows/1/repositories", - "created_at": "2020-01-22T19:33:08Z", - "updated_at": "2020-01-22T19:33:08Z" - }, - { - "id": 30433643, - "name": "Required Linter", - "path": ".github/workflows/lint.yml", - "scope": "all", - "ref": "refs/head/main", - "state": "active", - "created_at": "2020-01-22T19:33:08Z", - "updated_at": "2020-01-22T19:33:08Z" - } - ] - }`) - }) - opts := &ListOptions{Page: 2, PerPage: 2} - ctx := context.Background() - jobs, _, err := client.Actions.ListOrgRequiredWorkflows(ctx, "o", opts) - - if err != nil { - t.Errorf("Actions.ListOrgRequiredWorkflows returned error: %v", err) - } - - want := &OrgRequiredWorkflows{ - TotalCount: Ptr(4), - RequiredWorkflows: []*OrgRequiredWorkflow{ - {ID: Ptr(int64(30433642)), Name: Ptr("Required CI"), Path: Ptr(".github/workflows/ci.yml"), Scope: Ptr("selected"), Ref: Ptr("refs/head/main"), State: Ptr("active"), SelectedRepositoriesURL: Ptr("https://api.github.com/organizations/org/actions/required_workflows/1/repositories"), CreatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}}, - {ID: Ptr(int64(30433643)), Name: Ptr("Required Linter"), Path: Ptr(".github/workflows/lint.yml"), Scope: Ptr("all"), Ref: Ptr("refs/head/main"), State: Ptr("active"), CreatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}}, - }, - } - if !cmp.Equal(jobs, want) { - t.Errorf("Actions.ListOrgRequiredWorkflows returned %+v, want %+v", jobs, want) - } - const methodName = "ListOrgRequiredWorkflows" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Actions.ListOrgRequiredWorkflows(ctx, "\n", opts) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Actions.ListOrgRequiredWorkflows(ctx, "o", opts) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestActionsService_CreateRequiredWorkflow(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/orgs/o/actions/required_workflows", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "POST") - testHeader(t, r, "Content-Type", "application/json") - testBody(t, r, `{"workflow_file_path":".github/workflows/ci.yaml","repository_id":53,"scope":"selected","selected_repository_ids":[32,91]}`+"\n") - fmt.Fprint(w, `{ - "id": 2, - "name": "Required CI", - "path": ".github/workflows/ci.yml", - "scope": "selected", - "ref": "refs/head/main", - "state": "active", - "selected_repositories_url": "https://api.github.com/orgs/octo-org/actions/required_workflows/2/repositories", - "created_at": "2020-01-22T19:33:08Z", - "updated_at": "2020-01-22T19:33:08Z", - "repository": { - "id": 53, - "name": "Hello-World", - "url": "https://api.github.com/repos/o/Hello-World"}}`) - }) - input := &CreateUpdateRequiredWorkflowOptions{ - WorkflowFilePath: Ptr(".github/workflows/ci.yaml"), - RepositoryID: Ptr(int64(53)), - Scope: Ptr("selected"), - SelectedRepositoryIDs: &SelectedRepoIDs{32, 91}, - } - ctx := context.Background() - requiredWokflow, _, err := client.Actions.CreateRequiredWorkflow(ctx, "o", input) - if err != nil { - t.Errorf("Actions.CreateRequiredWorkflow returned error: %v", err) - } - want := &OrgRequiredWorkflow{ - ID: Ptr(int64(2)), - Name: Ptr("Required CI"), - Path: Ptr(".github/workflows/ci.yml"), - Scope: Ptr("selected"), - Ref: Ptr("refs/head/main"), - State: Ptr("active"), - SelectedRepositoriesURL: Ptr("https://api.github.com/orgs/octo-org/actions/required_workflows/2/repositories"), - CreatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, - UpdatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, - Repository: &Repository{ID: Ptr(int64(53)), URL: Ptr("https://api.github.com/repos/o/Hello-World"), Name: Ptr("Hello-World")}, - } - - if !cmp.Equal(requiredWokflow, want) { - t.Errorf("Actions.CreateRequiredWorkflow returned %+v, want %+v", requiredWokflow, want) - } - - const methodName = "CreateRequiredWorkflow" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Actions.CreateRequiredWorkflow(ctx, "\n", input) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Actions.CreateRequiredWorkflow(ctx, "o", input) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestActionsService_GetRequiredWorkflowByID(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/orgs/o/actions/required_workflows/12345", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - fmt.Fprint(w, `{ - "id": 12345, - "name": "Required CI", - "path": ".github/workflows/ci.yml", - "scope": "selected", - "ref": "refs/head/main", - "state": "active", - "selected_repositories_url": "https://api.github.com/orgs/o/actions/required_workflows/12345/repositories", - "created_at": "2020-01-22T19:33:08Z", - "updated_at": "2020-01-22T19:33:08Z", - "repository":{ - "id": 1296269, - "url": "https://api.github.com/repos/o/Hello-World", - "name": "Hello-World" - } - }`) - }) - ctx := context.Background() - jobs, _, err := client.Actions.GetRequiredWorkflowByID(ctx, "o", 12345) - - if err != nil { - t.Errorf("Actions.GetRequiredWorkflowByID returned error: %v", err) - } - - want := &OrgRequiredWorkflow{ - ID: Ptr(int64(12345)), Name: Ptr("Required CI"), Path: Ptr(".github/workflows/ci.yml"), Scope: Ptr("selected"), Ref: Ptr("refs/head/main"), State: Ptr("active"), SelectedRepositoriesURL: Ptr("https://api.github.com/orgs/o/actions/required_workflows/12345/repositories"), CreatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, Repository: &Repository{ID: Ptr(int64(1296269)), URL: Ptr("https://api.github.com/repos/o/Hello-World"), Name: Ptr("Hello-World")}, - } - if !cmp.Equal(jobs, want) { - t.Errorf("Actions.GetRequiredWorkflowByID returned %+v, want %+v", jobs, want) - } - const methodName = "GetRequiredWorkflowByID" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Actions.GetRequiredWorkflowByID(ctx, "\n", 1) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Actions.GetRequiredWorkflowByID(ctx, "o", 12345) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestActionsService_UpdateRequiredWorkflow(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/orgs/o/actions/required_workflows/12345", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "PATCH") - testHeader(t, r, "Content-Type", "application/json") - testBody(t, r, `{"workflow_file_path":".github/workflows/ci.yaml","repository_id":53,"scope":"selected","selected_repository_ids":[32,91]}`+"\n") - fmt.Fprint(w, `{ - "id": 12345, - "name": "Required CI", - "path": ".github/workflows/ci.yml", - "scope": "selected", - "ref": "refs/head/main", - "state": "active", - "selected_repositories_url": "https://api.github.com/orgs/octo-org/actions/required_workflows/12345/repositories", - "created_at": "2020-01-22T19:33:08Z", - "updated_at": "2020-01-22T19:33:08Z", - "repository": { - "id": 53, - "name": "Hello-World", - "url": "https://api.github.com/repos/o/Hello-World"}}`) - }) - input := &CreateUpdateRequiredWorkflowOptions{ - WorkflowFilePath: Ptr(".github/workflows/ci.yaml"), - RepositoryID: Ptr(int64(53)), - Scope: Ptr("selected"), - SelectedRepositoryIDs: &SelectedRepoIDs{32, 91}, - } - ctx := context.Background() - - requiredWokflow, _, err := client.Actions.UpdateRequiredWorkflow(ctx, "o", 12345, input) - - if err != nil { - t.Errorf("Actions.UpdateRequiredWorkflow returned error: %v", err) - } - want := &OrgRequiredWorkflow{ - ID: Ptr(int64(12345)), - Name: Ptr("Required CI"), - Path: Ptr(".github/workflows/ci.yml"), - Scope: Ptr("selected"), - Ref: Ptr("refs/head/main"), - State: Ptr("active"), - SelectedRepositoriesURL: Ptr("https://api.github.com/orgs/octo-org/actions/required_workflows/12345/repositories"), - CreatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, - UpdatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, - Repository: &Repository{ID: Ptr(int64(53)), URL: Ptr("https://api.github.com/repos/o/Hello-World"), Name: Ptr("Hello-World")}, - } - - if !cmp.Equal(requiredWokflow, want) { - t.Errorf("Actions.UpdateRequiredWorkflow returned %+v, want %+v", requiredWokflow, want) - } - - const methodName = "UpdateRequiredWorkflow" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Actions.UpdateRequiredWorkflow(ctx, "\n", 12345, input) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Actions.UpdateRequiredWorkflow(ctx, "o", 12345, input) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestActionsService_DeleteRequiredWorkflow(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/orgs/o/actions/required_workflows/12345", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "DELETE") - w.WriteHeader(http.StatusNoContent) - }) - ctx := context.Background() - _, err := client.Actions.DeleteRequiredWorkflow(ctx, "o", 12345) - - if err != nil { - t.Errorf("Actions.DeleteRequiredWorkflow returned error: %v", err) - } - - const methodName = "DeleteRequiredWorkflow" - testBadOptions(t, methodName, func() (err error) { - _, err = client.Actions.DeleteRequiredWorkflow(ctx, "\n", 12345) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Actions.DeleteRequiredWorkflow(ctx, "o", 12345) - }) -} - -func TestActionsService_ListRequiredWorkflowSelectedRepos(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/orgs/o/actions/required_workflows/12345/repositories", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - testFormValues(t, r, values{"per_page": "2", "page": "2"}) - fmt.Fprint(w, `{"total_count":1, - "repositories": [{ - "id": 1296269, - "url": "https://api.github.com/repos/o/Hello-World", - "name": "Hello-World" - }] - }`) - }) - opts := &ListOptions{Page: 2, PerPage: 2} - ctx := context.Background() - jobs, _, err := client.Actions.ListRequiredWorkflowSelectedRepos(ctx, "o", 12345, opts) - - if err != nil { - t.Errorf("Actions.ListRequiredWorkflowSelectedRepositories returned error: %v", err) - } - - want := &RequiredWorkflowSelectedRepos{ - TotalCount: Ptr(1), - Repositories: []*Repository{ - {ID: Ptr(int64(1296269)), URL: Ptr("https://api.github.com/repos/o/Hello-World"), Name: Ptr("Hello-World")}, - }, - } - if !cmp.Equal(jobs, want) { - t.Errorf("Actions.ListRequiredWorkflowSelectedRepositories returned %+v, want %+v", jobs, want) - } - const methodName = "ListRequiredWorkflowSelectedRepositories" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Actions.ListRequiredWorkflowSelectedRepos(ctx, "\n", 12345, opts) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Actions.ListRequiredWorkflowSelectedRepos(ctx, "o", 12345, opts) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} - -func TestActionsService_SetRequiredWorkflowSelectedRepos(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/orgs/o/actions/required_workflows/12345/repositories", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "PUT") - testHeader(t, r, "Content-Type", "application/json") - testBody(t, r, `{"selected_repository_ids":[32,91]}`+"\n") - w.WriteHeader(http.StatusNoContent) - }) - ctx := context.Background() - _, err := client.Actions.SetRequiredWorkflowSelectedRepos(ctx, "o", 12345, SelectedRepoIDs{32, 91}) - - if err != nil { - t.Errorf("Actions.SetRequiredWorkflowSelectedRepositories returned error: %v", err) - } - - const methodName = "SetRequiredWorkflowSelectedRepositories" - testBadOptions(t, methodName, func() (err error) { - _, err = client.Actions.SetRequiredWorkflowSelectedRepos(ctx, "\n", 12345, SelectedRepoIDs{32, 91}) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Actions.SetRequiredWorkflowSelectedRepos(ctx, "o", 12345, SelectedRepoIDs{32, 91}) - }) -} - -func TestActionsService_AddRepoToRequiredWorkflow(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/orgs/o/actions/required_workflows/12345/repositories/32", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "PUT") - w.WriteHeader(http.StatusNoContent) - }) - ctx := context.Background() - _, err := client.Actions.AddRepoToRequiredWorkflow(ctx, "o", 12345, 32) - - if err != nil { - t.Errorf("Actions.AddRepoToRequiredWorkflow returned error: %v", err) - } - - const methodName = "AddRepoToRequiredWorkflow" - testBadOptions(t, methodName, func() (err error) { - _, err = client.Actions.AddRepoToRequiredWorkflow(ctx, "\n", 12345, 32) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Actions.AddRepoToRequiredWorkflow(ctx, "o", 12345, 32) - }) -} - -func TestActionsService_RemoveRepoFromRequiredWorkflow(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/orgs/o/actions/required_workflows/12345/repositories/32", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "DELETE") - w.WriteHeader(http.StatusNoContent) - }) - ctx := context.Background() - _, err := client.Actions.RemoveRepoFromRequiredWorkflow(ctx, "o", 12345, 32) - - if err != nil { - t.Errorf("Actions.RemoveRepoFromRequiredWorkflow returned error: %v", err) - } - - const methodName = "RemoveRepoFromRequiredWorkflow" - testBadOptions(t, methodName, func() (err error) { - _, err = client.Actions.RemoveRepoFromRequiredWorkflow(ctx, "\n", 12345, 32) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Actions.RemoveRepoFromRequiredWorkflow(ctx, "o", 12345, 32) - }) -} - -func TestActionsService_ListRepoRequiredWorkflows(t *testing.T) { - t.Parallel() - client, mux, _ := setup(t) - - mux.HandleFunc("/repos/o/r/actions/required_workflows", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - testFormValues(t, r, values{"per_page": "2", "page": "2"}) - fmt.Fprint(w, `{"total_count":1,"required_workflows": [ - { - "id": 30433642, - "node_id": "MDg6V29ya2Zsb3cxNjEzMzU=", - "name": "Required CI", - "path": ".github/workflows/ci.yml", - "state": "active", - "created_at": "2020-01-22T19:33:08Z", - "updated_at": "2020-01-22T19:33:08Z", - "url": "https://api.github.com/repos/o/r/actions/required_workflows/161335", - "html_url": "https://github.com/o/r/blob/master/o/hello-world/.github/workflows/required_ci.yaml", - "badge_url": "https://github.com/o/r/workflows/required/o/hello-world/.github/workflows/required_ci.yaml/badge.svg", - "source_repository":{ - "id": 1296269, - "url": "https://api.github.com/repos/o/Hello-World", - "name": "Hello-World" - } - } - ] - }`) - }) - opts := &ListOptions{Page: 2, PerPage: 2} - ctx := context.Background() - jobs, _, err := client.Actions.ListRepoRequiredWorkflows(ctx, "o", "r", opts) - - if err != nil { - t.Errorf("Actions.ListRepoRequiredWorkflows returned error: %v", err) - } - - want := &RepoRequiredWorkflows{ - TotalCount: Ptr(1), - RequiredWorkflows: []*RepoRequiredWorkflow{ - {ID: Ptr(int64(30433642)), NodeID: Ptr("MDg6V29ya2Zsb3cxNjEzMzU="), Name: Ptr("Required CI"), Path: Ptr(".github/workflows/ci.yml"), State: Ptr("active"), CreatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 22, 19, 33, 8, 0, time.UTC)}, URL: Ptr("https://api.github.com/repos/o/r/actions/required_workflows/161335"), BadgeURL: Ptr("https://github.com/o/r/workflows/required/o/hello-world/.github/workflows/required_ci.yaml/badge.svg"), HTMLURL: Ptr("https://github.com/o/r/blob/master/o/hello-world/.github/workflows/required_ci.yaml"), SourceRepository: &Repository{ID: Ptr(int64(1296269)), URL: Ptr("https://api.github.com/repos/o/Hello-World"), Name: Ptr("Hello-World")}}, - }, - } - if !cmp.Equal(jobs, want) { - t.Errorf("Actions.ListRepoRequiredWorkflows returned %+v, want %+v", jobs, want) - } - const methodName = "ListRepoRequiredWorkflows" - testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Actions.ListRepoRequiredWorkflows(ctx, "\n", "\n", opts) - return err - }) - - testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Actions.ListRepoRequiredWorkflows(ctx, "o", "r", opts) - if got != nil { - t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) - } - return resp, err - }) -} diff --git a/github/github-accessors.go b/github/github-accessors.go index 45fa9075106..9860c8c806d 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -6022,38 +6022,6 @@ func (c *CreateUpdateEnvironment) GetWaitTimer() int { return *c.WaitTimer } -// GetRepositoryID returns the RepositoryID field if it's non-nil, zero value otherwise. -func (c *CreateUpdateRequiredWorkflowOptions) GetRepositoryID() int64 { - if c == nil || c.RepositoryID == nil { - return 0 - } - return *c.RepositoryID -} - -// GetScope returns the Scope field if it's non-nil, zero value otherwise. -func (c *CreateUpdateRequiredWorkflowOptions) GetScope() string { - if c == nil || c.Scope == nil { - return "" - } - return *c.Scope -} - -// GetSelectedRepositoryIDs returns the SelectedRepositoryIDs field. -func (c *CreateUpdateRequiredWorkflowOptions) GetSelectedRepositoryIDs() *SelectedRepoIDs { - if c == nil { - return nil - } - return c.SelectedRepositoryIDs -} - -// GetWorkflowFilePath returns the WorkflowFilePath field if it's non-nil, zero value otherwise. -func (c *CreateUpdateRequiredWorkflowOptions) GetWorkflowFilePath() string { - if c == nil || c.WorkflowFilePath == nil { - return "" - } - return *c.WorkflowFilePath -} - // GetEmail returns the Email field if it's non-nil, zero value otherwise. func (c *CreateUserRequest) GetEmail() string { if c == nil || c.Email == nil { @@ -15694,94 +15662,6 @@ func (o *OrgBlockEvent) GetSender() *User { return o.Sender } -// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (o *OrgRequiredWorkflow) GetCreatedAt() Timestamp { - if o == nil || o.CreatedAt == nil { - return Timestamp{} - } - return *o.CreatedAt -} - -// GetID returns the ID field if it's non-nil, zero value otherwise. -func (o *OrgRequiredWorkflow) GetID() int64 { - if o == nil || o.ID == nil { - return 0 - } - return *o.ID -} - -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (o *OrgRequiredWorkflow) GetName() string { - if o == nil || o.Name == nil { - return "" - } - return *o.Name -} - -// GetPath returns the Path field if it's non-nil, zero value otherwise. -func (o *OrgRequiredWorkflow) GetPath() string { - if o == nil || o.Path == nil { - return "" - } - return *o.Path -} - -// GetRef returns the Ref field if it's non-nil, zero value otherwise. -func (o *OrgRequiredWorkflow) GetRef() string { - if o == nil || o.Ref == nil { - return "" - } - return *o.Ref -} - -// GetRepository returns the Repository field. -func (o *OrgRequiredWorkflow) GetRepository() *Repository { - if o == nil { - return nil - } - return o.Repository -} - -// GetScope returns the Scope field if it's non-nil, zero value otherwise. -func (o *OrgRequiredWorkflow) GetScope() string { - if o == nil || o.Scope == nil { - return "" - } - return *o.Scope -} - -// GetSelectedRepositoriesURL returns the SelectedRepositoriesURL field if it's non-nil, zero value otherwise. -func (o *OrgRequiredWorkflow) GetSelectedRepositoriesURL() string { - if o == nil || o.SelectedRepositoriesURL == nil { - return "" - } - return *o.SelectedRepositoriesURL -} - -// GetState returns the State field if it's non-nil, zero value otherwise. -func (o *OrgRequiredWorkflow) GetState() string { - if o == nil || o.State == nil { - return "" - } - return *o.State -} - -// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (o *OrgRequiredWorkflow) GetUpdatedAt() Timestamp { - if o == nil || o.UpdatedAt == nil { - return Timestamp{} - } - return *o.UpdatedAt -} - -// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. -func (o *OrgRequiredWorkflows) GetTotalCount() int { - if o == nil || o.TotalCount == nil { - return 0 - } - return *o.TotalCount -} - // GetDisabledOrgs returns the DisabledOrgs field if it's non-nil, zero value otherwise. func (o *OrgStats) GetDisabledOrgs() int { if o == nil || o.DisabledOrgs == nil { @@ -21350,102 +21230,6 @@ func (r *RepoName) GetFrom() string { return *r.From } -// GetBadgeURL returns the BadgeURL field if it's non-nil, zero value otherwise. -func (r *RepoRequiredWorkflow) GetBadgeURL() string { - if r == nil || r.BadgeURL == nil { - return "" - } - return *r.BadgeURL -} - -// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (r *RepoRequiredWorkflow) GetCreatedAt() Timestamp { - if r == nil || r.CreatedAt == nil { - return Timestamp{} - } - return *r.CreatedAt -} - -// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. -func (r *RepoRequiredWorkflow) GetHTMLURL() string { - if r == nil || r.HTMLURL == nil { - return "" - } - return *r.HTMLURL -} - -// GetID returns the ID field if it's non-nil, zero value otherwise. -func (r *RepoRequiredWorkflow) GetID() int64 { - if r == nil || r.ID == nil { - return 0 - } - return *r.ID -} - -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (r *RepoRequiredWorkflow) GetName() string { - if r == nil || r.Name == nil { - return "" - } - return *r.Name -} - -// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. -func (r *RepoRequiredWorkflow) GetNodeID() string { - if r == nil || r.NodeID == nil { - return "" - } - return *r.NodeID -} - -// GetPath returns the Path field if it's non-nil, zero value otherwise. -func (r *RepoRequiredWorkflow) GetPath() string { - if r == nil || r.Path == nil { - return "" - } - return *r.Path -} - -// GetSourceRepository returns the SourceRepository field. -func (r *RepoRequiredWorkflow) GetSourceRepository() *Repository { - if r == nil { - return nil - } - return r.SourceRepository -} - -// GetState returns the State field if it's non-nil, zero value otherwise. -func (r *RepoRequiredWorkflow) GetState() string { - if r == nil || r.State == nil { - return "" - } - return *r.State -} - -// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (r *RepoRequiredWorkflow) GetUpdatedAt() Timestamp { - if r == nil || r.UpdatedAt == nil { - return Timestamp{} - } - return *r.UpdatedAt -} - -// GetURL returns the URL field if it's non-nil, zero value otherwise. -func (r *RepoRequiredWorkflow) GetURL() string { - if r == nil || r.URL == nil { - return "" - } - return *r.URL -} - -// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. -func (r *RepoRequiredWorkflows) GetTotalCount() int { - if r == nil || r.TotalCount == nil { - return 0 - } - return *r.TotalCount -} - // GetIncompleteResults returns the IncompleteResults field if it's non-nil, zero value otherwise. func (r *RepositoriesSearchResult) GetIncompleteResults() bool { if r == nil || r.IncompleteResults == nil { @@ -24078,14 +23862,6 @@ func (r *RequiredStatusChecksRuleParameters) GetDoNotEnforceOnCreate() bool { return *r.DoNotEnforceOnCreate } -// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. -func (r *RequiredWorkflowSelectedRepos) GetTotalCount() int { - if r == nil || r.TotalCount == nil { - return 0 - } - return *r.TotalCount -} - // GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. func (r *ReviewersRequest) GetNodeID() string { if r == nil || r.NodeID == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 8f089f5b8fe..99011135579 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -7850,47 +7850,6 @@ func TestCreateUpdateEnvironment_GetWaitTimer(tt *testing.T) { c.GetWaitTimer() } -func TestCreateUpdateRequiredWorkflowOptions_GetRepositoryID(tt *testing.T) { - tt.Parallel() - var zeroValue int64 - c := &CreateUpdateRequiredWorkflowOptions{RepositoryID: &zeroValue} - c.GetRepositoryID() - c = &CreateUpdateRequiredWorkflowOptions{} - c.GetRepositoryID() - c = nil - c.GetRepositoryID() -} - -func TestCreateUpdateRequiredWorkflowOptions_GetScope(tt *testing.T) { - tt.Parallel() - var zeroValue string - c := &CreateUpdateRequiredWorkflowOptions{Scope: &zeroValue} - c.GetScope() - c = &CreateUpdateRequiredWorkflowOptions{} - c.GetScope() - c = nil - c.GetScope() -} - -func TestCreateUpdateRequiredWorkflowOptions_GetSelectedRepositoryIDs(tt *testing.T) { - tt.Parallel() - c := &CreateUpdateRequiredWorkflowOptions{} - c.GetSelectedRepositoryIDs() - c = nil - c.GetSelectedRepositoryIDs() -} - -func TestCreateUpdateRequiredWorkflowOptions_GetWorkflowFilePath(tt *testing.T) { - tt.Parallel() - var zeroValue string - c := &CreateUpdateRequiredWorkflowOptions{WorkflowFilePath: &zeroValue} - c.GetWorkflowFilePath() - c = &CreateUpdateRequiredWorkflowOptions{} - c.GetWorkflowFilePath() - c = nil - c.GetWorkflowFilePath() -} - func TestCreateUserRequest_GetEmail(tt *testing.T) { tt.Parallel() var zeroValue string @@ -20354,124 +20313,6 @@ func TestOrgBlockEvent_GetSender(tt *testing.T) { o.GetSender() } -func TestOrgRequiredWorkflow_GetCreatedAt(tt *testing.T) { - tt.Parallel() - var zeroValue Timestamp - o := &OrgRequiredWorkflow{CreatedAt: &zeroValue} - o.GetCreatedAt() - o = &OrgRequiredWorkflow{} - o.GetCreatedAt() - o = nil - o.GetCreatedAt() -} - -func TestOrgRequiredWorkflow_GetID(tt *testing.T) { - tt.Parallel() - var zeroValue int64 - o := &OrgRequiredWorkflow{ID: &zeroValue} - o.GetID() - o = &OrgRequiredWorkflow{} - o.GetID() - o = nil - o.GetID() -} - -func TestOrgRequiredWorkflow_GetName(tt *testing.T) { - tt.Parallel() - var zeroValue string - o := &OrgRequiredWorkflow{Name: &zeroValue} - o.GetName() - o = &OrgRequiredWorkflow{} - o.GetName() - o = nil - o.GetName() -} - -func TestOrgRequiredWorkflow_GetPath(tt *testing.T) { - tt.Parallel() - var zeroValue string - o := &OrgRequiredWorkflow{Path: &zeroValue} - o.GetPath() - o = &OrgRequiredWorkflow{} - o.GetPath() - o = nil - o.GetPath() -} - -func TestOrgRequiredWorkflow_GetRef(tt *testing.T) { - tt.Parallel() - var zeroValue string - o := &OrgRequiredWorkflow{Ref: &zeroValue} - o.GetRef() - o = &OrgRequiredWorkflow{} - o.GetRef() - o = nil - o.GetRef() -} - -func TestOrgRequiredWorkflow_GetRepository(tt *testing.T) { - tt.Parallel() - o := &OrgRequiredWorkflow{} - o.GetRepository() - o = nil - o.GetRepository() -} - -func TestOrgRequiredWorkflow_GetScope(tt *testing.T) { - tt.Parallel() - var zeroValue string - o := &OrgRequiredWorkflow{Scope: &zeroValue} - o.GetScope() - o = &OrgRequiredWorkflow{} - o.GetScope() - o = nil - o.GetScope() -} - -func TestOrgRequiredWorkflow_GetSelectedRepositoriesURL(tt *testing.T) { - tt.Parallel() - var zeroValue string - o := &OrgRequiredWorkflow{SelectedRepositoriesURL: &zeroValue} - o.GetSelectedRepositoriesURL() - o = &OrgRequiredWorkflow{} - o.GetSelectedRepositoriesURL() - o = nil - o.GetSelectedRepositoriesURL() -} - -func TestOrgRequiredWorkflow_GetState(tt *testing.T) { - tt.Parallel() - var zeroValue string - o := &OrgRequiredWorkflow{State: &zeroValue} - o.GetState() - o = &OrgRequiredWorkflow{} - o.GetState() - o = nil - o.GetState() -} - -func TestOrgRequiredWorkflow_GetUpdatedAt(tt *testing.T) { - tt.Parallel() - var zeroValue Timestamp - o := &OrgRequiredWorkflow{UpdatedAt: &zeroValue} - o.GetUpdatedAt() - o = &OrgRequiredWorkflow{} - o.GetUpdatedAt() - o = nil - o.GetUpdatedAt() -} - -func TestOrgRequiredWorkflows_GetTotalCount(tt *testing.T) { - tt.Parallel() - var zeroValue int - o := &OrgRequiredWorkflows{TotalCount: &zeroValue} - o.GetTotalCount() - o = &OrgRequiredWorkflows{} - o.GetTotalCount() - o = nil - o.GetTotalCount() -} - func TestOrgStats_GetDisabledOrgs(tt *testing.T) { tt.Parallel() var zeroValue int @@ -27531,135 +27372,6 @@ func TestRepoName_GetFrom(tt *testing.T) { r.GetFrom() } -func TestRepoRequiredWorkflow_GetBadgeURL(tt *testing.T) { - tt.Parallel() - var zeroValue string - r := &RepoRequiredWorkflow{BadgeURL: &zeroValue} - r.GetBadgeURL() - r = &RepoRequiredWorkflow{} - r.GetBadgeURL() - r = nil - r.GetBadgeURL() -} - -func TestRepoRequiredWorkflow_GetCreatedAt(tt *testing.T) { - tt.Parallel() - var zeroValue Timestamp - r := &RepoRequiredWorkflow{CreatedAt: &zeroValue} - r.GetCreatedAt() - r = &RepoRequiredWorkflow{} - r.GetCreatedAt() - r = nil - r.GetCreatedAt() -} - -func TestRepoRequiredWorkflow_GetHTMLURL(tt *testing.T) { - tt.Parallel() - var zeroValue string - r := &RepoRequiredWorkflow{HTMLURL: &zeroValue} - r.GetHTMLURL() - r = &RepoRequiredWorkflow{} - r.GetHTMLURL() - r = nil - r.GetHTMLURL() -} - -func TestRepoRequiredWorkflow_GetID(tt *testing.T) { - tt.Parallel() - var zeroValue int64 - r := &RepoRequiredWorkflow{ID: &zeroValue} - r.GetID() - r = &RepoRequiredWorkflow{} - r.GetID() - r = nil - r.GetID() -} - -func TestRepoRequiredWorkflow_GetName(tt *testing.T) { - tt.Parallel() - var zeroValue string - r := &RepoRequiredWorkflow{Name: &zeroValue} - r.GetName() - r = &RepoRequiredWorkflow{} - r.GetName() - r = nil - r.GetName() -} - -func TestRepoRequiredWorkflow_GetNodeID(tt *testing.T) { - tt.Parallel() - var zeroValue string - r := &RepoRequiredWorkflow{NodeID: &zeroValue} - r.GetNodeID() - r = &RepoRequiredWorkflow{} - r.GetNodeID() - r = nil - r.GetNodeID() -} - -func TestRepoRequiredWorkflow_GetPath(tt *testing.T) { - tt.Parallel() - var zeroValue string - r := &RepoRequiredWorkflow{Path: &zeroValue} - r.GetPath() - r = &RepoRequiredWorkflow{} - r.GetPath() - r = nil - r.GetPath() -} - -func TestRepoRequiredWorkflow_GetSourceRepository(tt *testing.T) { - tt.Parallel() - r := &RepoRequiredWorkflow{} - r.GetSourceRepository() - r = nil - r.GetSourceRepository() -} - -func TestRepoRequiredWorkflow_GetState(tt *testing.T) { - tt.Parallel() - var zeroValue string - r := &RepoRequiredWorkflow{State: &zeroValue} - r.GetState() - r = &RepoRequiredWorkflow{} - r.GetState() - r = nil - r.GetState() -} - -func TestRepoRequiredWorkflow_GetUpdatedAt(tt *testing.T) { - tt.Parallel() - var zeroValue Timestamp - r := &RepoRequiredWorkflow{UpdatedAt: &zeroValue} - r.GetUpdatedAt() - r = &RepoRequiredWorkflow{} - r.GetUpdatedAt() - r = nil - r.GetUpdatedAt() -} - -func TestRepoRequiredWorkflow_GetURL(tt *testing.T) { - tt.Parallel() - var zeroValue string - r := &RepoRequiredWorkflow{URL: &zeroValue} - r.GetURL() - r = &RepoRequiredWorkflow{} - r.GetURL() - r = nil - r.GetURL() -} - -func TestRepoRequiredWorkflows_GetTotalCount(tt *testing.T) { - tt.Parallel() - var zeroValue int - r := &RepoRequiredWorkflows{TotalCount: &zeroValue} - r.GetTotalCount() - r = &RepoRequiredWorkflows{} - r.GetTotalCount() - r = nil - r.GetTotalCount() -} - func TestRepositoriesSearchResult_GetIncompleteResults(tt *testing.T) { tt.Parallel() var zeroValue bool @@ -30976,17 +30688,6 @@ func TestRequiredStatusChecksRuleParameters_GetDoNotEnforceOnCreate(tt *testing. r.GetDoNotEnforceOnCreate() } -func TestRequiredWorkflowSelectedRepos_GetTotalCount(tt *testing.T) { - tt.Parallel() - var zeroValue int - r := &RequiredWorkflowSelectedRepos{TotalCount: &zeroValue} - r.GetTotalCount() - r = &RequiredWorkflowSelectedRepos{} - r.GetTotalCount() - r = nil - r.GetTotalCount() -} - func TestReviewersRequest_GetNodeID(tt *testing.T) { tt.Parallel() var zeroValue string diff --git a/openapi_operations.yaml b/openapi_operations.yaml index 59b24485fdd..554916c699f 100644 --- a/openapi_operations.yaml +++ b/openapi_operations.yaml @@ -2,26 +2,6 @@ operations: - name: POST /hub documentation_url: https://docs.github.com/webhooks/about-webhooks-for-repositories#pubsubhubbub - name: GET /organizations/{organization_id} - - name: GET /orgs/{org}/actions/required_workflows - documentation_url: https://docs.github.com/actions/using-workflows/required-workflows - - name: POST /orgs/{org}/actions/required_workflows - documentation_url: https://docs.github.com/actions/using-workflows/required-workflows - - name: DELETE /orgs/{org}/actions/required_workflows/{workflow_id} - documentation_url: https://docs.github.com/actions/using-workflows/required-workflows - - name: GET /orgs/{org}/actions/required_workflows/{workflow_id} - documentation_url: https://docs.github.com/actions/using-workflows/required-workflows - - name: PATCH /orgs/{org}/actions/required_workflows/{workflow_id} - documentation_url: https://docs.github.com/actions/using-workflows/required-workflows - - name: GET /orgs/{org}/actions/required_workflows/{workflow_id}/repositories - documentation_url: https://docs.github.com/actions/using-workflows/required-workflows - - name: PUT /orgs/{org}/actions/required_workflows/{workflow_id}/repositories - documentation_url: https://docs.github.com/actions/using-workflows/required-workflows - - name: DELETE /orgs/{org}/actions/required_workflows/{workflow_id}/repositories/{repository_id} - documentation_url: https://docs.github.com/actions/using-workflows/required-workflows - - name: PUT /orgs/{org}/actions/required_workflows/{workflow_id}/repositories/{repository_id} - documentation_url: https://docs.github.com/actions/using-workflows/required-workflows - - name: GET /repos/{owner}/{repo}/actions/required_workflows - documentation_url: https://docs.github.com/actions/using-workflows/required-workflows - name: GET /repos/{owner}/{repo}/import/issues documentation_url: https://gist.github.com/jonmagic/5282384165e0f86ef105#check-status-of-multiple-issues - name: POST /repos/{owner}/{repo}/import/issues From 6970a6306ef18c5692d43b9cb3e3841c6e5b8553 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Apr 2025 16:41:31 -0400 Subject: [PATCH 697/751] build(deps): bump github.com/alecthomas/kong from 1.9.0 to 1.10.0 in /tools (#3542) --- tools/go.mod | 2 +- tools/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index 164f32f2f52..4cda63baa9a 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -3,7 +3,7 @@ module tools go 1.23.0 require ( - github.com/alecthomas/kong v1.9.0 + github.com/alecthomas/kong v1.10.0 github.com/getkin/kin-openapi v0.131.0 github.com/google/go-cmp v0.7.0 github.com/google/go-github/v71 v71.0.0 diff --git a/tools/go.sum b/tools/go.sum index 5cdc8ecbdac..d76972f32ae 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -1,7 +1,7 @@ github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0= github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= -github.com/alecthomas/kong v1.9.0 h1:Wgg0ll5Ys7xDnpgYBuBn/wPeLGAuK0NvYmEcisJgrIs= -github.com/alecthomas/kong v1.9.0/go.mod h1:p2vqieVMeTAnaC83txKtXe8FLke2X07aruPWXyMPQrU= +github.com/alecthomas/kong v1.10.0 h1:8K4rGDpT7Iu+jEXCIJUeKqvpwZHbsFRoebLbnzlmrpw= +github.com/alecthomas/kong v1.10.0/go.mod h1:p2vqieVMeTAnaC83txKtXe8FLke2X07aruPWXyMPQrU= github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc= github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= From b98b707876c8b20b0e1dbbdffb7898a5fcc2169d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Apr 2025 09:18:14 -0400 Subject: [PATCH 698/751] build(deps): bump golang.org/x/sync from 0.12.0 to 0.13.0 in /tools (#3543) --- tools/go.mod | 2 +- tools/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index 4cda63baa9a..124238156c7 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -7,7 +7,7 @@ require ( github.com/getkin/kin-openapi v0.131.0 github.com/google/go-cmp v0.7.0 github.com/google/go-github/v71 v71.0.0 - golang.org/x/sync v0.12.0 + golang.org/x/sync v0.13.0 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/tools/go.sum b/tools/go.sum index d76972f32ae..069ac54c499 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -45,8 +45,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= -golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw= -golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610= +golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= From 462cda4535c187ec8addaee2b9adb25a94cd70b8 Mon Sep 17 00:00:00 2001 From: Pavlos Tzianos Date: Sun, 13 Apr 2025 12:21:43 +0200 Subject: [PATCH 699/751] Add support for registry_package event (#3545) --- github/event_types.go | 20 ++++ github/event_types_test.go | 129 ++++++++++++++++++++++++++ github/github-accessors.go | 56 +++++++++++ github/github-accessors_test.go | 59 ++++++++++++ github/messages.go | 1 + github/messages_test.go | 4 + github/repos_hooks_deliveries_test.go | 1 + 7 files changed, 270 insertions(+) diff --git a/github/event_types.go b/github/event_types.go index 6a6caf19ddb..b5369865608 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -1446,6 +1446,26 @@ type PushEventRepoOwner struct { Email *string `json:"email,omitempty"` } +// RegistryPackageEvent represents activity related to GitHub Packages. +// The Webhook event name is "registry_package". +// +// This event is triggered when a GitHub Package is published or updated. +// +// GitHub API docs: https://docs.github.com/en/webhooks/webhook-events-and-payloads#registry_package +type RegistryPackageEvent struct { + // Action is the action that was performed. + // Can be "published" or "updated". + Action *string `json:"action,omitempty"` + RegistryPackage *Package `json:"registry_package,omitempty"` + Repository *Repository `json:"repository,omitempty"` + Organization *Organization `json:"organization,omitempty"` + Enterprise *Enterprise `json:"enterprise,omitempty"` + Sender *User `json:"sender,omitempty"` + + // The following fields are only populated by Webhook events. + Installation *Installation `json:"installation,omitempty"` +} + // ReleaseEvent is triggered when a release is published, unpublished, created, // edited, deleted, or prereleased. // The Webhook event name is "release". diff --git a/github/event_types_test.go b/github/event_types_test.go index 296c1d35c9c..17dd96d8ac8 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -8640,6 +8640,135 @@ func TestPingEvent_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } +func TestRegistryPackageEvent_Marshal(t *testing.T) { + t.Parallel() + testJSONMarshal(t, &RegistryPackageEvent{}, "{}") + + u := &RegistryPackageEvent{ + Action: Ptr("a"), + RegistryPackage: &Package{ + ID: Ptr(int64(1)), + Name: Ptr("n"), + PackageType: Ptr("pt"), + HTMLURL: Ptr("hurl"), + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + Owner: &User{ + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), + }, + PackageVersion: &PackageVersion{ID: Ptr(int64(1))}, + Registry: &PackageRegistry{Name: Ptr("n")}, + }, + Repository: &Repository{ + ID: Ptr(int64(1)), + URL: Ptr("s"), + Name: Ptr("n"), + }, + Organization: &Organization{ + BillingEmail: Ptr("be"), + Blog: Ptr("b"), + Company: Ptr("c"), + Email: Ptr("e"), + TwitterUsername: Ptr("tu"), + Location: Ptr("loc"), + Name: Ptr("n"), + Description: Ptr("d"), + IsVerified: Ptr(true), + HasOrganizationProjects: Ptr(true), + HasRepositoryProjects: Ptr(true), + DefaultRepoPermission: Ptr("drp"), + MembersCanCreateRepos: Ptr(true), + MembersCanCreateInternalRepos: Ptr(true), + MembersCanCreatePrivateRepos: Ptr(true), + MembersCanCreatePublicRepos: Ptr(false), + MembersAllowedRepositoryCreationType: Ptr("marct"), + MembersCanCreatePages: Ptr(true), + MembersCanCreatePublicPages: Ptr(false), + MembersCanCreatePrivatePages: Ptr(true), + }, + Sender: &User{ + Login: Ptr("l"), + ID: Ptr(int64(1)), + NodeID: Ptr("n"), + URL: Ptr("u"), + ReposURL: Ptr("r"), + EventsURL: Ptr("e"), + AvatarURL: Ptr("a"), + }, + } + + want := `{ + "action": "a", + "registry_package": { + "id": 1, + "name": "n", + "package_type": "pt", + "html_url": "hurl", + "created_at": ` + referenceTimeStr + `, + "updated_at": ` + referenceTimeStr + `, + "owner": { + "login": "l", + "id": 1, + "node_id": "n", + "avatar_url": "a", + "url": "u", + "events_url": "e", + "repos_url": "r" + }, + "package_version": { + "id": 1 + }, + "registry": { + "name": "n" + } + }, + "repository": { + "id": 1, + "name": "n", + "url": "s" + }, + "organization": { + "name": "n", + "company": "c", + "blog": "b", + "location": "loc", + "email": "e", + "twitter_username": "tu", + "description": "d", + "billing_email": "be", + "is_verified": true, + "has_organization_projects": true, + "has_repository_projects": true, + "default_repository_permission": "drp", + "members_can_create_repositories": true, + "members_can_create_public_repositories": false, + "members_can_create_private_repositories": true, + "members_can_create_internal_repositories": true, + "members_allowed_repository_creation_type": "marct", + "members_can_create_pages": true, + "members_can_create_public_pages": false, + "members_can_create_private_pages": true + }, + "sender": { + "login": "l", + "id": 1, + "node_id": "n", + "avatar_url": "a", + "url": "u", + "events_url": "e", + "repos_url": "r" + } + }` + + testJSONMarshal(t, u, want) +} + func TestRepositoryDispatchEvent_Marshal(t *testing.T) { t.Parallel() testJSONMarshal(t, &RepositoryDispatchEvent{}, "{}") diff --git a/github/github-accessors.go b/github/github-accessors.go index 9860c8c806d..1e2442789d6 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -20862,6 +20862,62 @@ func (r *RegistrationToken) GetToken() string { return *r.Token } +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (r *RegistryPackageEvent) GetAction() string { + if r == nil || r.Action == nil { + return "" + } + return *r.Action +} + +// GetEnterprise returns the Enterprise field. +func (r *RegistryPackageEvent) GetEnterprise() *Enterprise { + if r == nil { + return nil + } + return r.Enterprise +} + +// GetInstallation returns the Installation field. +func (r *RegistryPackageEvent) GetInstallation() *Installation { + if r == nil { + return nil + } + return r.Installation +} + +// GetOrganization returns the Organization field. +func (r *RegistryPackageEvent) GetOrganization() *Organization { + if r == nil { + return nil + } + return r.Organization +} + +// GetRegistryPackage returns the RegistryPackage field. +func (r *RegistryPackageEvent) GetRegistryPackage() *Package { + if r == nil { + return nil + } + return r.RegistryPackage +} + +// GetRepository returns the Repository field. +func (r *RegistryPackageEvent) GetRepository() *Repository { + if r == nil { + return nil + } + return r.Repository +} + +// GetSender returns the Sender field. +func (r *RegistryPackageEvent) GetSender() *User { + if r == nil { + return nil + } + return r.Sender +} + // GetBrowserDownloadURL returns the BrowserDownloadURL field if it's non-nil, zero value otherwise. func (r *ReleaseAsset) GetBrowserDownloadURL() string { if r == nil || r.BrowserDownloadURL == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 99011135579..8dadb706cd6 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -26887,6 +26887,65 @@ func TestRegistrationToken_GetToken(tt *testing.T) { r.GetToken() } +func TestRegistryPackageEvent_GetAction(tt *testing.T) { + tt.Parallel() + var zeroValue string + r := &RegistryPackageEvent{Action: &zeroValue} + r.GetAction() + r = &RegistryPackageEvent{} + r.GetAction() + r = nil + r.GetAction() +} + +func TestRegistryPackageEvent_GetEnterprise(tt *testing.T) { + tt.Parallel() + r := &RegistryPackageEvent{} + r.GetEnterprise() + r = nil + r.GetEnterprise() +} + +func TestRegistryPackageEvent_GetInstallation(tt *testing.T) { + tt.Parallel() + r := &RegistryPackageEvent{} + r.GetInstallation() + r = nil + r.GetInstallation() +} + +func TestRegistryPackageEvent_GetOrganization(tt *testing.T) { + tt.Parallel() + r := &RegistryPackageEvent{} + r.GetOrganization() + r = nil + r.GetOrganization() +} + +func TestRegistryPackageEvent_GetRegistryPackage(tt *testing.T) { + tt.Parallel() + r := &RegistryPackageEvent{} + r.GetRegistryPackage() + r = nil + r.GetRegistryPackage() +} + +func TestRegistryPackageEvent_GetRepository(tt *testing.T) { + tt.Parallel() + r := &RegistryPackageEvent{} + r.GetRepository() + r = nil + r.GetRepository() +} + +func TestRegistryPackageEvent_GetSender(tt *testing.T) { + tt.Parallel() + r := &RegistryPackageEvent{} + r.GetSender() + r = nil + r.GetSender() +} + func TestReleaseAsset_GetBrowserDownloadURL(tt *testing.T) { tt.Parallel() var zeroValue string diff --git a/github/messages.go b/github/messages.go index 59b214b355a..2b5cce7504a 100644 --- a/github/messages.go +++ b/github/messages.go @@ -95,6 +95,7 @@ var ( "pull_request_review_thread": &PullRequestReviewThreadEvent{}, "pull_request_target": &PullRequestTargetEvent{}, "push": &PushEvent{}, + "registry_package": &RegistryPackageEvent{}, "repository": &RepositoryEvent{}, "repository_dispatch": &RepositoryDispatchEvent{}, "repository_import": &RepositoryImportEvent{}, diff --git a/github/messages_test.go b/github/messages_test.go index e6c3027caab..a2b9feac92b 100644 --- a/github/messages_test.go +++ b/github/messages_test.go @@ -459,6 +459,10 @@ func TestParseWebHook(t *testing.T) { payload: &PushEvent{}, messageType: "push", }, + { + payload: &RegistryPackageEvent{}, + messageType: "registry_package", + }, { payload: &ReleaseEvent{}, messageType: "release", diff --git a/github/repos_hooks_deliveries_test.go b/github/repos_hooks_deliveries_test.go index 81421c7901c..6acb7a81e69 100644 --- a/github/repos_hooks_deliveries_test.go +++ b/github/repos_hooks_deliveries_test.go @@ -183,6 +183,7 @@ var hookDeliveryPayloadTypeToStruct = map[string]interface{}{ "pull_request_review_thread": &PullRequestReviewThreadEvent{}, "pull_request_target": &PullRequestTargetEvent{}, "push": &PushEvent{}, + "registry_package": &RegistryPackageEvent{}, "release": &ReleaseEvent{}, "repository": &RepositoryEvent{}, "repository_dispatch": &RepositoryDispatchEvent{}, From 6e6edf8dae3895105dfeda5c60c4792902c3ee70 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Apr 2025 16:36:14 -0400 Subject: [PATCH 700/751] build(deps): bump codecov/codecov-action from 5.4.0 to 5.4.2 (#3551) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 86fdd739ef0..61125c1ce49 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -76,6 +76,6 @@ jobs: - name: Upload coverage to Codecov if: ${{ matrix.update-coverage }} - uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0 + uses: codecov/codecov-action@ad3126e916f78f00edff4ed0317cf185271ccc2d # v5.4.2 with: use_oidc: true From 1c10f25e3a4e2447dbe184c7575651e5c60ab750 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Apr 2025 16:47:32 -0400 Subject: [PATCH 701/751] build(deps): bump golang.org/x/net from 0.38.0 to 0.39.0 in /scrape (#3549) --- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 3bfc9e586de..dda23dbebd2 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -7,7 +7,7 @@ require ( github.com/google/go-cmp v0.7.0 github.com/google/go-github/v71 v71.0.0 github.com/xlzd/gotp v0.1.0 - golang.org/x/net v0.38.0 + golang.org/x/net v0.39.0 ) require ( diff --git a/scrape/go.sum b/scrape/go.sum index c9a415a4e30..33bbba25be6 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -33,8 +33,8 @@ golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= -golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8= -golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= +golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY= +golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= From 6f8bceff0b000e6c8f5a3e60922ca57188de264e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Apr 2025 16:56:49 -0400 Subject: [PATCH 702/751] build(deps): bump github.com/PuerkitoBio/goquery from 1.10.2 to 1.10.3 in /scrape (#3550) --- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index dda23dbebd2..938710f918e 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -3,7 +3,7 @@ module github.com/google/go-github/scrape go 1.23.0 require ( - github.com/PuerkitoBio/goquery v1.10.2 + github.com/PuerkitoBio/goquery v1.10.3 github.com/google/go-cmp v0.7.0 github.com/google/go-github/v71 v71.0.0 github.com/xlzd/gotp v0.1.0 diff --git a/scrape/go.sum b/scrape/go.sum index 33bbba25be6..38f691cbc5e 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -1,5 +1,5 @@ -github.com/PuerkitoBio/goquery v1.10.2 h1:7fh2BdHcG6VFZsK7toXBT/Bh1z5Wmy8Q9MV9HqT2AM8= -github.com/PuerkitoBio/goquery v1.10.2/go.mod h1:0guWGjcLu9AYC7C1GHnpysHy056u9aEkUHwhdnePMCU= +github.com/PuerkitoBio/goquery v1.10.3 h1:pFYcNSqHxBD06Fpj/KsbStFRsgRATgnf3LeXiUkhzPo= +github.com/PuerkitoBio/goquery v1.10.3/go.mod h1:tMUX0zDMHXYlAQk6p35XxQMqMweEKB7iK7iLNd4RH4Y= github.com/andybalholm/cascadia v1.3.3 h1:AG2YHrzJIm4BZ19iwJ/DAua6Btl3IwJX+VI4kktS1LM= github.com/andybalholm/cascadia v1.3.3/go.mod h1:xNd9bqTn98Ln4DwST8/nG+H0yuB8Hmgu1YHNnWw0GeA= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= From 6a7684f2c5dd43b2bc782a4ee5349eb49aef6584 Mon Sep 17 00:00:00 2001 From: Matt Fleury <166510074+mdfleury-wbd@users.noreply.github.com> Date: Tue, 15 Apr 2025 08:13:51 -0400 Subject: [PATCH 703/751] feat: Add EPSS to Dependabot alerts (#3547) --- github/dependabot_alerts.go | 10 ++++++++++ github/dependabot_alerts_test.go | 8 ++++++++ github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 8 ++++++++ 4 files changed, 34 insertions(+) diff --git a/github/dependabot_alerts.go b/github/dependabot_alerts.go index c274f07bece..67e624c9e88 100644 --- a/github/dependabot_alerts.go +++ b/github/dependabot_alerts.go @@ -29,6 +29,15 @@ type AdvisoryCWEs struct { Name *string `json:"name,omitempty"` } +// AdvisoryEPSS represents the advisory pertaining to the Exploit Prediction Scoring System. +// +// For more information, see: +// https://github.blog/changelog/2024-10-10-epss-scores-in-the-github-advisory-database/ +type AdvisoryEPSS struct { + Percentage float64 `json:"percentage"` + Percentile float64 `json:"percentile"` +} + // DependabotSecurityAdvisory represents the GitHub Security Advisory. type DependabotSecurityAdvisory struct { GHSAID *string `json:"ghsa_id,omitempty"` @@ -39,6 +48,7 @@ type DependabotSecurityAdvisory struct { Severity *string `json:"severity,omitempty"` CVSS *AdvisoryCVSS `json:"cvss,omitempty"` CWEs []*AdvisoryCWEs `json:"cwes,omitempty"` + EPSS *AdvisoryEPSS `json:"epss,omitempty"` Identifiers []*AdvisoryIdentifier `json:"identifiers,omitempty"` References []*AdvisoryReference `json:"references,omitempty"` PublishedAt *Timestamp `json:"published_at,omitempty"` diff --git a/github/dependabot_alerts_test.go b/github/dependabot_alerts_test.go index 3a46855e011..8410825a2d0 100644 --- a/github/dependabot_alerts_test.go +++ b/github/dependabot_alerts_test.go @@ -281,6 +281,10 @@ func TestDependabotSecurityAdvisory_Marshal(t *testing.T) { Name: Ptr("Exposure of Sensitive Information to an Unauthorized Actor"), }, }, + EPSS: &AdvisoryEPSS{ + Percentage: 0.05, + Percentile: 0.5, + }, Identifiers: []*AdvisoryIdentifier{ { Type: Ptr("GHSA"), @@ -353,6 +357,10 @@ func TestDependabotSecurityAdvisory_Marshal(t *testing.T) { "name": "Exposure of Sensitive Information to an Unauthorized Actor" } ], + "epss": { + "percentage": 0.05, + "percentile": 0.5 + }, "identifiers": [ { "type": "GHSA", diff --git a/github/github-accessors.go b/github/github-accessors.go index 1e2442789d6..4a32702755a 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -6854,6 +6854,14 @@ func (d *DependabotSecurityAdvisory) GetDescription() string { return *d.Description } +// GetEPSS returns the EPSS field. +func (d *DependabotSecurityAdvisory) GetEPSS() *AdvisoryEPSS { + if d == nil { + return nil + } + return d.EPSS +} + // GetGHSAID returns the GHSAID field if it's non-nil, zero value otherwise. func (d *DependabotSecurityAdvisory) GetGHSAID() string { if d == nil || d.GHSAID == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 8dadb706cd6..9efb190b522 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -8904,6 +8904,14 @@ func TestDependabotSecurityAdvisory_GetDescription(tt *testing.T) { d.GetDescription() } +func TestDependabotSecurityAdvisory_GetEPSS(tt *testing.T) { + tt.Parallel() + d := &DependabotSecurityAdvisory{} + d.GetEPSS() + d = nil + d.GetEPSS() +} + func TestDependabotSecurityAdvisory_GetGHSAID(tt *testing.T) { tt.Parallel() var zeroValue string From 4fd4ea33a517308c07dd8f5183ca86423ec23b72 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Tue, 15 Apr 2025 12:55:50 -0400 Subject: [PATCH 704/751] Revert "build(deps): bump codecov/codecov-action from 5.4.0 to 5.4.2" (#3552) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 61125c1ce49..86fdd739ef0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -76,6 +76,6 @@ jobs: - name: Upload coverage to Codecov if: ${{ matrix.update-coverage }} - uses: codecov/codecov-action@ad3126e916f78f00edff4ed0317cf185271ccc2d # v5.4.2 + uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0 with: use_oidc: true From 687f9336e8506ac9ec6ce2e92cc3d6da455737be Mon Sep 17 00:00:00 2001 From: Matt Fleury <166510074+mdfleury-wbd@users.noreply.github.com> Date: Tue, 15 Apr 2025 13:06:57 -0400 Subject: [PATCH 705/751] feat: Add new fields and options to secret scanning structs (#3548) --- github/github-accessors.go | 64 +++++++++++++++++++++++++ github/github-accessors_test.go | 85 +++++++++++++++++++++++++++++++++ github/secret_scanning.go | 50 ++++++++++++------- 3 files changed, 181 insertions(+), 18 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 4a32702755a..8530cd914bc 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -24686,6 +24686,14 @@ func (s *SecretScanningAlert) GetHTMLURL() string { return *s.HTMLURL } +// GetIsBase64Encoded returns the IsBase64Encoded field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetIsBase64Encoded() bool { + if s == nil || s.IsBase64Encoded == nil { + return false + } + return *s.IsBase64Encoded +} + // GetLocationsURL returns the LocationsURL field if it's non-nil, zero value otherwise. func (s *SecretScanningAlert) GetLocationsURL() string { if s == nil || s.LocationsURL == nil { @@ -24694,6 +24702,14 @@ func (s *SecretScanningAlert) GetLocationsURL() string { return *s.LocationsURL } +// GetMultiRepo returns the MultiRepo field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetMultiRepo() bool { + if s == nil || s.MultiRepo == nil { + return false + } + return *s.MultiRepo +} + // GetNumber returns the Number field if it's non-nil, zero value otherwise. func (s *SecretScanningAlert) GetNumber() int { if s == nil || s.Number == nil { @@ -24702,6 +24718,14 @@ func (s *SecretScanningAlert) GetNumber() int { return *s.Number } +// GetPubliclyLeaked returns the PubliclyLeaked field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetPubliclyLeaked() bool { + if s == nil || s.PubliclyLeaked == nil { + return false + } + return *s.PubliclyLeaked +} + // GetPushProtectionBypassed returns the PushProtectionBypassed field if it's non-nil, zero value otherwise. func (s *SecretScanningAlert) GetPushProtectionBypassed() bool { if s == nil || s.PushProtectionBypassed == nil { @@ -24726,6 +24750,38 @@ func (s *SecretScanningAlert) GetPushProtectionBypassedBy() *User { return s.PushProtectionBypassedBy } +// GetPushProtectionBypassRequestComment returns the PushProtectionBypassRequestComment field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetPushProtectionBypassRequestComment() string { + if s == nil || s.PushProtectionBypassRequestComment == nil { + return "" + } + return *s.PushProtectionBypassRequestComment +} + +// GetPushProtectionBypassRequestHTMLURL returns the PushProtectionBypassRequestHTMLURL field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetPushProtectionBypassRequestHTMLURL() string { + if s == nil || s.PushProtectionBypassRequestHTMLURL == nil { + return "" + } + return *s.PushProtectionBypassRequestHTMLURL +} + +// GetPushProtectionBypassRequestReviewer returns the PushProtectionBypassRequestReviewer field. +func (s *SecretScanningAlert) GetPushProtectionBypassRequestReviewer() *User { + if s == nil { + return nil + } + return s.PushProtectionBypassRequestReviewer +} + +// GetPushProtectionBypassRequestReviewerComment returns the PushProtectionBypassRequestReviewerComment field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetPushProtectionBypassRequestReviewerComment() string { + if s == nil || s.PushProtectionBypassRequestReviewerComment == nil { + return "" + } + return *s.PushProtectionBypassRequestReviewerComment +} + // GetRepository returns the Repository field. func (s *SecretScanningAlert) GetRepository() *Repository { if s == nil { @@ -24814,6 +24870,14 @@ func (s *SecretScanningAlert) GetURL() string { return *s.URL } +// GetValidity returns the Validity field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetValidity() string { + if s == nil || s.Validity == nil { + return "" + } + return *s.Validity +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (s *SecretScanningAlertEvent) GetAction() string { if s == nil || s.Action == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 9efb190b522..8b85e063f4d 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -31785,6 +31785,17 @@ func TestSecretScanningAlert_GetHTMLURL(tt *testing.T) { s.GetHTMLURL() } +func TestSecretScanningAlert_GetIsBase64Encoded(tt *testing.T) { + tt.Parallel() + var zeroValue bool + s := &SecretScanningAlert{IsBase64Encoded: &zeroValue} + s.GetIsBase64Encoded() + s = &SecretScanningAlert{} + s.GetIsBase64Encoded() + s = nil + s.GetIsBase64Encoded() +} + func TestSecretScanningAlert_GetLocationsURL(tt *testing.T) { tt.Parallel() var zeroValue string @@ -31796,6 +31807,17 @@ func TestSecretScanningAlert_GetLocationsURL(tt *testing.T) { s.GetLocationsURL() } +func TestSecretScanningAlert_GetMultiRepo(tt *testing.T) { + tt.Parallel() + var zeroValue bool + s := &SecretScanningAlert{MultiRepo: &zeroValue} + s.GetMultiRepo() + s = &SecretScanningAlert{} + s.GetMultiRepo() + s = nil + s.GetMultiRepo() +} + func TestSecretScanningAlert_GetNumber(tt *testing.T) { tt.Parallel() var zeroValue int @@ -31807,6 +31829,17 @@ func TestSecretScanningAlert_GetNumber(tt *testing.T) { s.GetNumber() } +func TestSecretScanningAlert_GetPubliclyLeaked(tt *testing.T) { + tt.Parallel() + var zeroValue bool + s := &SecretScanningAlert{PubliclyLeaked: &zeroValue} + s.GetPubliclyLeaked() + s = &SecretScanningAlert{} + s.GetPubliclyLeaked() + s = nil + s.GetPubliclyLeaked() +} + func TestSecretScanningAlert_GetPushProtectionBypassed(tt *testing.T) { tt.Parallel() var zeroValue bool @@ -31837,6 +31870,47 @@ func TestSecretScanningAlert_GetPushProtectionBypassedBy(tt *testing.T) { s.GetPushProtectionBypassedBy() } +func TestSecretScanningAlert_GetPushProtectionBypassRequestComment(tt *testing.T) { + tt.Parallel() + var zeroValue string + s := &SecretScanningAlert{PushProtectionBypassRequestComment: &zeroValue} + s.GetPushProtectionBypassRequestComment() + s = &SecretScanningAlert{} + s.GetPushProtectionBypassRequestComment() + s = nil + s.GetPushProtectionBypassRequestComment() +} + +func TestSecretScanningAlert_GetPushProtectionBypassRequestHTMLURL(tt *testing.T) { + tt.Parallel() + var zeroValue string + s := &SecretScanningAlert{PushProtectionBypassRequestHTMLURL: &zeroValue} + s.GetPushProtectionBypassRequestHTMLURL() + s = &SecretScanningAlert{} + s.GetPushProtectionBypassRequestHTMLURL() + s = nil + s.GetPushProtectionBypassRequestHTMLURL() +} + +func TestSecretScanningAlert_GetPushProtectionBypassRequestReviewer(tt *testing.T) { + tt.Parallel() + s := &SecretScanningAlert{} + s.GetPushProtectionBypassRequestReviewer() + s = nil + s.GetPushProtectionBypassRequestReviewer() +} + +func TestSecretScanningAlert_GetPushProtectionBypassRequestReviewerComment(tt *testing.T) { + tt.Parallel() + var zeroValue string + s := &SecretScanningAlert{PushProtectionBypassRequestReviewerComment: &zeroValue} + s.GetPushProtectionBypassRequestReviewerComment() + s = &SecretScanningAlert{} + s.GetPushProtectionBypassRequestReviewerComment() + s = nil + s.GetPushProtectionBypassRequestReviewerComment() +} + func TestSecretScanningAlert_GetRepository(tt *testing.T) { tt.Parallel() s := &SecretScanningAlert{} @@ -31952,6 +32026,17 @@ func TestSecretScanningAlert_GetURL(tt *testing.T) { s.GetURL() } +func TestSecretScanningAlert_GetValidity(tt *testing.T) { + tt.Parallel() + var zeroValue string + s := &SecretScanningAlert{Validity: &zeroValue} + s.GetValidity() + s = &SecretScanningAlert{} + s.GetValidity() + s = nil + s.GetValidity() +} + func TestSecretScanningAlertEvent_GetAction(tt *testing.T) { tt.Parallel() var zeroValue string diff --git a/github/secret_scanning.go b/github/secret_scanning.go index 4eeeba3df78..ad2312d0b2c 100644 --- a/github/secret_scanning.go +++ b/github/secret_scanning.go @@ -16,24 +16,32 @@ type SecretScanningService service // SecretScanningAlert represents a GitHub secret scanning alert. type SecretScanningAlert struct { - Number *int `json:"number,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - URL *string `json:"url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - LocationsURL *string `json:"locations_url,omitempty"` - State *string `json:"state,omitempty"` - Resolution *string `json:"resolution,omitempty"` - ResolvedAt *Timestamp `json:"resolved_at,omitempty"` - ResolvedBy *User `json:"resolved_by,omitempty"` - SecretType *string `json:"secret_type,omitempty"` - SecretTypeDisplayName *string `json:"secret_type_display_name,omitempty"` - Secret *string `json:"secret,omitempty"` - Repository *Repository `json:"repository,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - PushProtectionBypassed *bool `json:"push_protection_bypassed,omitempty"` - PushProtectionBypassedBy *User `json:"push_protection_bypassed_by,omitempty"` - PushProtectionBypassedAt *Timestamp `json:"push_protection_bypassed_at,omitempty"` - ResolutionComment *string `json:"resolution_comment,omitempty"` + Number *int `json:"number,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + LocationsURL *string `json:"locations_url,omitempty"` + State *string `json:"state,omitempty"` + Resolution *string `json:"resolution,omitempty"` + ResolvedAt *Timestamp `json:"resolved_at,omitempty"` + ResolvedBy *User `json:"resolved_by,omitempty"` + SecretType *string `json:"secret_type,omitempty"` + SecretTypeDisplayName *string `json:"secret_type_display_name,omitempty"` + Secret *string `json:"secret,omitempty"` + Repository *Repository `json:"repository,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + IsBase64Encoded *bool `json:"is_base64_encoded,omitempty"` + MultiRepo *bool `json:"multi_repo,omitempty"` + PubliclyLeaked *bool `json:"publicly_leaked,omitempty"` + PushProtectionBypassed *bool `json:"push_protection_bypassed,omitempty"` + PushProtectionBypassedBy *User `json:"push_protection_bypassed_by,omitempty"` + PushProtectionBypassedAt *Timestamp `json:"push_protection_bypassed_at,omitempty"` + ResolutionComment *string `json:"resolution_comment,omitempty"` + PushProtectionBypassRequestComment *string `json:"push_protection_bypass_request_comment,omitempty"` + PushProtectionBypassRequestHTMLURL *string `json:"push_protection_bypass_request_html_url,omitempty"` + PushProtectionBypassRequestReviewer *User `json:"push_protection_bypass_request_reviewer,omitempty"` + PushProtectionBypassRequestReviewerComment *string `json:"push_protection_bypass_request_reviewer_comment,omitempty"` + Validity *string `json:"validity,omitempty"` } // SecretScanningAlertLocation represents the location for a secret scanning alert. @@ -72,6 +80,12 @@ type SecretScanningAlertListOptions struct { // Valid options are active, inactive, and unknown. Validity string `url:"validity,omitempty"` + // A boolean value representing whether or not to filter alerts by the publicly-leaked tag being present. Default: false. + IsPubliclyLeaked bool `url:"is_publicly_leaked,omitempty"` + + // A boolean value representing whether or not to filter alerts by the multi-repo tag being present. Default: false. + IsMultiRepo bool `url:"is_multi_repo,omitempty"` + // The direction to sort the results by. Possible values are: asc, desc. Default: desc. Direction string `url:"direction,omitempty"` From f99490e58a13cad40f4a1e55c598eb17f454d909 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 16 Apr 2025 20:09:29 -0400 Subject: [PATCH 706/751] build(deps): bump golang.org/x/net from 0.36.0 to 0.38.0 in /example in the go_modules group across 1 directory (#3553) --- example/go.mod | 12 ++++++------ example/go.sum | 24 ++++++++++++------------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/example/go.mod b/example/go.mod index a9ac895be06..6c7e734331f 100644 --- a/example/go.mod +++ b/example/go.mod @@ -9,8 +9,8 @@ require ( github.com/gofri/go-github-ratelimit/v2 v2.0.2 github.com/google/go-github/v71 v71.0.0 github.com/sigstore/sigstore-go v0.6.1 - golang.org/x/crypto v0.35.0 - golang.org/x/term v0.29.0 + golang.org/x/crypto v0.36.0 + golang.org/x/term v0.30.0 google.golang.org/appengine v1.6.8 ) @@ -88,10 +88,10 @@ require ( go.uber.org/zap v1.27.0 // indirect golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 // indirect golang.org/x/mod v0.20.0 // indirect - golang.org/x/net v0.36.0 // indirect - golang.org/x/sync v0.11.0 // indirect - golang.org/x/sys v0.30.0 // indirect - golang.org/x/text v0.22.0 // indirect + golang.org/x/net v0.38.0 // indirect + golang.org/x/sync v0.12.0 // indirect + golang.org/x/sys v0.31.0 // indirect + golang.org/x/text v0.23.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/example/go.sum b/example/go.sum index 844fdd7c81d..7c5743a699b 100644 --- a/example/go.sum +++ b/example/go.sum @@ -364,8 +364,8 @@ golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs= -golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ= +golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34= +golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 h1:hNQpMuAJe5CtcUqCXaWga3FHu+kQvCqcsoVaQgSV60o= golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= @@ -379,16 +379,16 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.36.0 h1:vWF2fRbw4qslQsQzgFqZff+BItCvGFQqKzKIzx1rmoA= -golang.org/x/net v0.36.0/go.mod h1:bFmbeoIPfrw4sMHNhb4J9f6+tPziuGjq7Jk/38fxi1I= +golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8= +golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE= golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= -golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw= +golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -398,15 +398,15 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= -golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= +golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU= -golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s= +golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y= +golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -415,8 +415,8 @@ golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= -golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= +golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= +golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= From 5b75aa86dba5cf4af2923afa0938774f37fa0a67 Mon Sep 17 00:00:00 2001 From: Sergei Parshev <8136445+sparshev@users.noreply.github.com> Date: Fri, 18 Apr 2025 16:09:28 -0400 Subject: [PATCH 707/751] Add case-instensitive GetHeader for HookRequest & HookResponse (#3556) --- github/repos_hooks_deliveries.go | 21 ++++++++ github/repos_hooks_deliveries_test.go | 70 +++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) diff --git a/github/repos_hooks_deliveries.go b/github/repos_hooks_deliveries.go index c8029f626b9..bcd4b336e53 100644 --- a/github/repos_hooks_deliveries.go +++ b/github/repos_hooks_deliveries.go @@ -9,6 +9,7 @@ import ( "context" "encoding/json" "fmt" + "strings" ) // HookDelivery represents the data that is received from GitHub's Webhook Delivery API @@ -39,6 +40,16 @@ func (d HookDelivery) String() string { return Stringify(d) } +// getHeader common function for GetHeader funcs of HookRequest & HookResponse. +func getHeader(headers map[string]string, key string) string { + for k, v := range headers { + if strings.EqualFold(k, key) { + return v + } + } + return "" +} + // HookRequest is a part of HookDelivery that contains // the HTTP headers and the JSON payload of the webhook request. type HookRequest struct { @@ -46,6 +57,11 @@ type HookRequest struct { RawPayload *json.RawMessage `json:"payload,omitempty"` } +// GetHeader gets the value associated with the given key (ignoring key case). +func (r *HookRequest) GetHeader(key string) string { + return getHeader(r.Headers, key) +} + func (r HookRequest) String() string { return Stringify(r) } @@ -57,6 +73,11 @@ type HookResponse struct { RawPayload *json.RawMessage `json:"payload,omitempty"` } +// GetHeader gets the value associated with the given key (ignoring key case). +func (r *HookResponse) GetHeader(key string) string { + return getHeader(r.Headers, key) +} + func (r HookResponse) String() string { return Stringify(r) } diff --git a/github/repos_hooks_deliveries_test.go b/github/repos_hooks_deliveries_test.go index 6acb7a81e69..91ff3ad7113 100644 --- a/github/repos_hooks_deliveries_test.go +++ b/github/repos_hooks_deliveries_test.go @@ -294,6 +294,41 @@ func TestHookRequest_Marshal(t *testing.T) { testJSONMarshal(t, r, want) } +func TestHookRequest_GetHeader(t *testing.T) { + t.Parallel() + + header := make(map[string]string) + header["key1"] = "value1" + header["Key+2"] = "value2" + header["kEy-3"] = "value3" + header["KEY_4"] = "value4" + + r := &HookRequest{ + Headers: header, + } + + // Checking positive cases + testPrefixes := []string{"key", "Key", "kEy", "KEY"} + for hdrKey, hdrValue := range header { + for _, prefix := range testPrefixes { + key := prefix + hdrKey[3:] + if val := r.GetHeader(key); val != hdrValue { + t.Errorf("GetHeader(%q) is not working: %q != %q", key, val, hdrValue) + } + } + } + + // Checking negative case + key := "asd" + if val := r.GetHeader(key); val != "" { + t.Errorf("GetHeader(%q) should return empty value: %q != %q", key, val, "") + } + key = "kay1" + if val := r.GetHeader(key); val != "" { + t.Errorf("GetHeader(%q) should return empty value: %q != %q", key, val, "") + } +} + func TestHookResponse_Marshal(t *testing.T) { t.Parallel() testJSONMarshal(t, &HookResponse{}, "{}") @@ -320,6 +355,41 @@ func TestHookResponse_Marshal(t *testing.T) { testJSONMarshal(t, r, want) } +func TestHookResponse_GetHeader(t *testing.T) { + t.Parallel() + + header := make(map[string]string) + header["key1"] = "value1" + header["Key+2"] = "value2" + header["kEy-3"] = "value3" + header["KEY_4"] = "value4" + + r := &HookResponse{ + Headers: header, + } + + // Checking positive cases + testPrefixes := []string{"key", "Key", "kEy", "KEY"} + for hdrKey, hdrValue := range header { + for _, prefix := range testPrefixes { + key := prefix + hdrKey[3:] + if val := r.GetHeader(key); val != hdrValue { + t.Errorf("GetHeader(%q) is not working: %q != %q", key, val, hdrValue) + } + } + } + + // Checking negative case + key := "asd" + if val := r.GetHeader(key); val != "" { + t.Errorf("GetHeader(%q) should return empty value: %q != %q", key, val, "") + } + key = "kay1" + if val := r.GetHeader(key); val != "" { + t.Errorf("GetHeader(%q) should return empty value: %q != %q", key, val, "") + } +} + func TestHookDelivery_Marshal(t *testing.T) { t.Parallel() testJSONMarshal(t, &HookDelivery{}, "{}") From 04274a98708fafb4d0a20e273497f5717425dc46 Mon Sep 17 00:00:00 2001 From: Stan <48232605+stanfordpeng@users.noreply.github.com> Date: Thu, 24 Apr 2025 02:51:50 +1000 Subject: [PATCH 708/751] fix!: Differentiate merge method of pull request and merge queue (#3559) BREAKING CHANGE: `MergeMethod*` consts have been split into: `PullRequestMergeMethod*` and `MergeQueueMergeMethod*`. --- github/enterprise_rules_test.go | 16 +++++------ github/event_types_test.go | 20 +++++++------- github/orgs_rules_test.go | 12 ++++----- github/rules.go | 48 +++++++++++++++++++++++---------- github/rules_test.go | 40 +++++++++++++-------------- 5 files changed, 78 insertions(+), 58 deletions(-) diff --git a/github/enterprise_rules_test.go b/github/enterprise_rules_test.go index 87c44102883..6e54948a908 100644 --- a/github/enterprise_rules_test.go +++ b/github/enterprise_rules_test.go @@ -212,7 +212,7 @@ func TestEnterpriseService_CreateRepositoryRuleset_OrgNameRepoName(t *testing.T) }, RequiredSignatures: &EmptyRuleParameters{}, PullRequest: &PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{MergeMethodRebase, MergeMethodSquash}, + AllowedMergeMethods: []PullRequestMergeMethod{PullRequestMergeMethodRebase, PullRequestMergeMethodSquash}, DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, @@ -313,7 +313,7 @@ func TestEnterpriseService_CreateRepositoryRuleset_OrgNameRepoName(t *testing.T) }, RequiredSignatures: &EmptyRuleParameters{}, PullRequest: &PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{MergeMethodRebase, MergeMethodSquash}, + AllowedMergeMethods: []PullRequestMergeMethod{PullRequestMergeMethodRebase, PullRequestMergeMethodSquash}, DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, @@ -602,7 +602,7 @@ func TestEnterpriseService_CreateRepositoryRuleset_OrgNameRepoProperty(t *testin }, RequiredSignatures: &EmptyRuleParameters{}, PullRequest: &PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{MergeMethodRebase, MergeMethodSquash}, + AllowedMergeMethods: []PullRequestMergeMethod{PullRequestMergeMethodRebase, PullRequestMergeMethodSquash}, DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, @@ -713,7 +713,7 @@ func TestEnterpriseService_CreateRepositoryRuleset_OrgNameRepoProperty(t *testin }, RequiredSignatures: &EmptyRuleParameters{}, PullRequest: &PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{MergeMethodRebase, MergeMethodSquash}, + AllowedMergeMethods: []PullRequestMergeMethod{PullRequestMergeMethodRebase, PullRequestMergeMethodSquash}, DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, @@ -976,7 +976,7 @@ func TestEnterpriseService_CreateRepositoryRuleset_OrgIdRepoName(t *testing.T) { }, RequiredSignatures: &EmptyRuleParameters{}, PullRequest: &PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{MergeMethodRebase, MergeMethodSquash}, + AllowedMergeMethods: []PullRequestMergeMethod{PullRequestMergeMethodRebase, PullRequestMergeMethodSquash}, DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, @@ -1076,7 +1076,7 @@ func TestEnterpriseService_CreateRepositoryRuleset_OrgIdRepoName(t *testing.T) { }, RequiredSignatures: &EmptyRuleParameters{}, PullRequest: &PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{MergeMethodRebase, MergeMethodSquash}, + AllowedMergeMethods: []PullRequestMergeMethod{PullRequestMergeMethodRebase, PullRequestMergeMethodSquash}, DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, @@ -1358,7 +1358,7 @@ func TestEnterpriseService_CreateRepositoryRuleset_OrgIdRepoProperty(t *testing. }, RequiredSignatures: &EmptyRuleParameters{}, PullRequest: &PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{MergeMethodRebase, MergeMethodSquash}, + AllowedMergeMethods: []PullRequestMergeMethod{PullRequestMergeMethodRebase, PullRequestMergeMethodSquash}, DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, @@ -1468,7 +1468,7 @@ func TestEnterpriseService_CreateRepositoryRuleset_OrgIdRepoProperty(t *testing. }, RequiredSignatures: &EmptyRuleParameters{}, PullRequest: &PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{MergeMethodRebase, MergeMethodSquash}, + AllowedMergeMethods: []PullRequestMergeMethod{PullRequestMergeMethodRebase, PullRequestMergeMethodSquash}, DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, diff --git a/github/event_types_test.go b/github/event_types_test.go index 17dd96d8ac8..cc2a4e1aad8 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -9761,10 +9761,10 @@ func TestRepositoryRulesetEvent_Unmarshal(t *testing.T) { Deletion: &EmptyRuleParameters{}, RequiredLinearHistory: &EmptyRuleParameters{}, PullRequest: &PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{ - MergeMethodSquash, - MergeMethodRebase, - MergeMethodMerge, + AllowedMergeMethods: []PullRequestMergeMethod{ + PullRequestMergeMethodSquash, + PullRequestMergeMethodRebase, + PullRequestMergeMethodMerge, }, AutomaticCopilotCodeReviewEnabled: Ptr(false), DismissStaleReviewsOnPush: false, @@ -9825,9 +9825,9 @@ func TestRepositoryRulesetEvent_Unmarshal(t *testing.T) { Deletion: &EmptyRuleParameters{}, RequiredSignatures: &EmptyRuleParameters{}, PullRequest: &PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{ - MergeMethodSquash, - MergeMethodRebase, + AllowedMergeMethods: []PullRequestMergeMethod{ + PullRequestMergeMethodSquash, + PullRequestMergeMethodRebase, }, AutomaticCopilotCodeReviewEnabled: Ptr(false), DismissStaleReviewsOnPush: false, @@ -9880,9 +9880,9 @@ func TestRepositoryRulesetEvent_Unmarshal(t *testing.T) { Rule: &RepositoryRule{ Type: RulesetRuleTypePullRequest, Parameters: &PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{ - MergeMethodSquash, - MergeMethodRebase, + AllowedMergeMethods: []PullRequestMergeMethod{ + PullRequestMergeMethodSquash, + PullRequestMergeMethodRebase, }, AutomaticCopilotCodeReviewEnabled: Ptr(false), DismissStaleReviewsOnPush: false, diff --git a/github/orgs_rules_test.go b/github/orgs_rules_test.go index 2d2080a7f4c..37c98d5bcf4 100644 --- a/github/orgs_rules_test.go +++ b/github/orgs_rules_test.go @@ -255,7 +255,7 @@ func TestOrganizationsService_CreateRepositoryRuleset_RepoNames(t *testing.T) { }, RequiredSignatures: &EmptyRuleParameters{}, PullRequest: &PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{MergeMethodRebase, MergeMethodSquash}, + AllowedMergeMethods: []PullRequestMergeMethod{PullRequestMergeMethodRebase, PullRequestMergeMethodSquash}, DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, @@ -352,7 +352,7 @@ func TestOrganizationsService_CreateRepositoryRuleset_RepoNames(t *testing.T) { }, RequiredSignatures: &EmptyRuleParameters{}, PullRequest: &PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{MergeMethodRebase, MergeMethodSquash}, + AllowedMergeMethods: []PullRequestMergeMethod{PullRequestMergeMethodRebase, PullRequestMergeMethodSquash}, DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, @@ -615,7 +615,7 @@ func TestOrganizationsService_CreateRepositoryRuleset_RepoProperty(t *testing.T) }, RequiredSignatures: &EmptyRuleParameters{}, PullRequest: &PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{MergeMethodRebase, MergeMethodSquash}, + AllowedMergeMethods: []PullRequestMergeMethod{PullRequestMergeMethodRebase, PullRequestMergeMethodSquash}, DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, @@ -718,7 +718,7 @@ func TestOrganizationsService_CreateRepositoryRuleset_RepoProperty(t *testing.T) }, RequiredSignatures: &EmptyRuleParameters{}, PullRequest: &PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{MergeMethodRebase, MergeMethodSquash}, + AllowedMergeMethods: []PullRequestMergeMethod{PullRequestMergeMethodRebase, PullRequestMergeMethodSquash}, DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, @@ -966,7 +966,7 @@ func TestOrganizationsService_CreateRepositoryRuleset_RepoIDs(t *testing.T) { }, RequiredSignatures: &EmptyRuleParameters{}, PullRequest: &PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{MergeMethodRebase, MergeMethodSquash}, + AllowedMergeMethods: []PullRequestMergeMethod{PullRequestMergeMethodRebase, PullRequestMergeMethodSquash}, DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, @@ -1061,7 +1061,7 @@ func TestOrganizationsService_CreateRepositoryRuleset_RepoIDs(t *testing.T) { }, RequiredSignatures: &EmptyRuleParameters{}, PullRequest: &PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{MergeMethodRebase, MergeMethodSquash}, + AllowedMergeMethods: []PullRequestMergeMethod{PullRequestMergeMethodRebase, PullRequestMergeMethodSquash}, DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, RequireLastPushApproval: true, diff --git a/github/rules.go b/github/rules.go index 985f0aac100..4def2d19ee4 100644 --- a/github/rules.go +++ b/github/rules.go @@ -99,14 +99,34 @@ const ( MergeGroupingStrategyHeadGreen MergeGroupingStrategy = "HEADGREEN" ) -// MergeMethod models a GitHub merge method. -type MergeMethod string +// PullRequestMergeMethod is used in PullRequestRuleParameters, +// where the GitHub API expects lowercase merge method values: "merge", "rebase", "squash". +// +// NOTE: GitHub's API inconsistently uses different casing for the same logical values +// across different rules. +// +// TODO: Unify with MergeQueueMergeMethod once the GitHub API uses consistent casing. +type PullRequestMergeMethod string + +const ( + PullRequestMergeMethodMerge PullRequestMergeMethod = "merge" + PullRequestMergeMethodRebase PullRequestMergeMethod = "rebase" + PullRequestMergeMethodSquash PullRequestMergeMethod = "squash" +) + +// MergeQueueMergeMethod is used in MergeQueueRuleParameters, +// where the GitHub API expects uppercase merge method values: "MERGE", "REBASE", "SQUASH". +// +// NOTE: This type exists alongside PullRequestMergeMethod solely due to API casing inconsistencies. +// It enforces the correct usage by API context. +// +// TODO: Unify with PullRequestMergeMethod once the GitHub API uses consistent casing. +type MergeQueueMergeMethod string -// This is the set of GitHub merge methods. const ( - MergeMethodMerge MergeMethod = "merge" - MergeMethodRebase MergeMethod = "rebase" - MergeMethodSquash MergeMethod = "squash" + MergeQueueMergeMethodMerge MergeQueueMergeMethod = "MERGE" + MergeQueueMergeMethodRebase MergeQueueMergeMethod = "REBASE" + MergeQueueMergeMethodSquash MergeQueueMergeMethod = "SQUASH" ) // PatternRuleOperator models a GitHub pattern rule operator. @@ -383,7 +403,7 @@ type MergeQueueRuleParameters struct { GroupingStrategy MergeGroupingStrategy `json:"grouping_strategy"` MaxEntriesToBuild int `json:"max_entries_to_build"` MaxEntriesToMerge int `json:"max_entries_to_merge"` - MergeMethod MergeMethod `json:"merge_method"` + MergeMethod MergeQueueMergeMethod `json:"merge_method"` MinEntriesToMerge int `json:"min_entries_to_merge"` MinEntriesToMergeWaitMinutes int `json:"min_entries_to_merge_wait_minutes"` } @@ -395,13 +415,13 @@ type RequiredDeploymentsRuleParameters struct { // PullRequestRuleParameters represents the pull_request rule parameters. type PullRequestRuleParameters struct { - AllowedMergeMethods []MergeMethod `json:"allowed_merge_methods"` - AutomaticCopilotCodeReviewEnabled *bool `json:"automatic_copilot_code_review_enabled,omitempty"` - DismissStaleReviewsOnPush bool `json:"dismiss_stale_reviews_on_push"` - RequireCodeOwnerReview bool `json:"require_code_owner_review"` - RequireLastPushApproval bool `json:"require_last_push_approval"` - RequiredApprovingReviewCount int `json:"required_approving_review_count"` - RequiredReviewThreadResolution bool `json:"required_review_thread_resolution"` + AllowedMergeMethods []PullRequestMergeMethod `json:"allowed_merge_methods"` + AutomaticCopilotCodeReviewEnabled *bool `json:"automatic_copilot_code_review_enabled,omitempty"` + DismissStaleReviewsOnPush bool `json:"dismiss_stale_reviews_on_push"` + RequireCodeOwnerReview bool `json:"require_code_owner_review"` + RequireLastPushApproval bool `json:"require_last_push_approval"` + RequiredApprovingReviewCount int `json:"required_approving_review_count"` + RequiredReviewThreadResolution bool `json:"required_review_thread_resolution"` } // RequiredStatusChecksRuleParameters represents the required status checks rule parameters. diff --git a/github/rules_test.go b/github/rules_test.go index afd679cc2ac..5ecdbc21d35 100644 --- a/github/rules_test.go +++ b/github/rules_test.go @@ -46,7 +46,7 @@ func TestRulesetRules(t *testing.T) { GroupingStrategy: MergeGroupingStrategyAllGreen, MaxEntriesToBuild: 10, MaxEntriesToMerge: 20, - MergeMethod: MergeMethodSquash, + MergeMethod: MergeQueueMergeMethodSquash, MinEntriesToMerge: 1, MinEntriesToMergeWaitMinutes: 15, }, @@ -55,9 +55,9 @@ func TestRulesetRules(t *testing.T) { }, RequiredSignatures: &EmptyRuleParameters{}, PullRequest: &PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{ - MergeMethodSquash, - MergeMethodRebase, + AllowedMergeMethods: []PullRequestMergeMethod{ + PullRequestMergeMethodSquash, + PullRequestMergeMethodRebase, }, AutomaticCopilotCodeReviewEnabled: nil, DismissStaleReviewsOnPush: true, @@ -123,7 +123,7 @@ func TestRulesetRules(t *testing.T) { }, }, }, - `[{"type":"creation"},{"type":"update"},{"type":"deletion"},{"type":"required_linear_history"},{"type":"merge_queue","parameters":{"check_response_timeout_minutes":5,"grouping_strategy":"ALLGREEN","max_entries_to_build":10,"max_entries_to_merge":20,"merge_method":"squash","min_entries_to_merge":1,"min_entries_to_merge_wait_minutes":15}},{"type":"required_deployments","parameters":{"required_deployment_environments":["test1","test2"]}},{"type":"required_signatures"},{"type":"pull_request","parameters":{"allowed_merge_methods":["squash","rebase"],"dismiss_stale_reviews_on_push":true,"require_code_owner_review":true,"require_last_push_approval":true,"required_approving_review_count":2,"required_review_thread_resolution":true}},{"type":"required_status_checks","parameters":{"required_status_checks":[{"context":"test1"},{"context":"test2"}],"strict_required_status_checks_policy":true}},{"type":"non_fast_forward"},{"type":"commit_message_pattern","parameters":{"operator":"starts_with","pattern":"test"}},{"type":"commit_author_email_pattern","parameters":{"operator":"starts_with","pattern":"test"}},{"type":"committer_email_pattern","parameters":{"operator":"starts_with","pattern":"test"}},{"type":"branch_name_pattern","parameters":{"operator":"starts_with","pattern":"test"}},{"type":"tag_name_pattern","parameters":{"operator":"starts_with","pattern":"test"}},{"type":"file_path_restriction","parameters":{"restricted_file_paths":["test1","test2"]}},{"type":"max_file_path_length","parameters":{"max_file_path_length":512}},{"type":"file_extension_restriction","parameters":{"restricted_file_extensions":[".exe",".pkg"]}},{"type":"max_file_size","parameters":{"max_file_size":1024}},{"type":"workflows","parameters":{"workflows":[{"path":".github/workflows/test1.yaml"},{"path":".github/workflows/test2.yaml"}]}},{"type":"code_scanning","parameters":{"code_scanning_tools":[{"alerts_threshold":"all","security_alerts_threshold":"all","tool":"test"},{"alerts_threshold":"none","security_alerts_threshold":"none","tool":"test"}]}}]`, + `[{"type":"creation"},{"type":"update"},{"type":"deletion"},{"type":"required_linear_history"},{"type":"merge_queue","parameters":{"check_response_timeout_minutes":5,"grouping_strategy":"ALLGREEN","max_entries_to_build":10,"max_entries_to_merge":20,"merge_method":"SQUASH","min_entries_to_merge":1,"min_entries_to_merge_wait_minutes":15}},{"type":"required_deployments","parameters":{"required_deployment_environments":["test1","test2"]}},{"type":"required_signatures"},{"type":"pull_request","parameters":{"allowed_merge_methods":["squash","rebase"],"dismiss_stale_reviews_on_push":true,"require_code_owner_review":true,"require_last_push_approval":true,"required_approving_review_count":2,"required_review_thread_resolution":true}},{"type":"required_status_checks","parameters":{"required_status_checks":[{"context":"test1"},{"context":"test2"}],"strict_required_status_checks_policy":true}},{"type":"non_fast_forward"},{"type":"commit_message_pattern","parameters":{"operator":"starts_with","pattern":"test"}},{"type":"commit_author_email_pattern","parameters":{"operator":"starts_with","pattern":"test"}},{"type":"committer_email_pattern","parameters":{"operator":"starts_with","pattern":"test"}},{"type":"branch_name_pattern","parameters":{"operator":"starts_with","pattern":"test"}},{"type":"tag_name_pattern","parameters":{"operator":"starts_with","pattern":"test"}},{"type":"file_path_restriction","parameters":{"restricted_file_paths":["test1","test2"]}},{"type":"max_file_path_length","parameters":{"max_file_path_length":512}},{"type":"file_extension_restriction","parameters":{"restricted_file_extensions":[".exe",".pkg"]}},{"type":"max_file_size","parameters":{"max_file_size":1024}},{"type":"workflows","parameters":{"workflows":[{"path":".github/workflows/test1.yaml"},{"path":".github/workflows/test2.yaml"}]}},{"type":"code_scanning","parameters":{"code_scanning_tools":[{"alerts_threshold":"all","security_alerts_threshold":"all","tool":"test"},{"alerts_threshold":"none","security_alerts_threshold":"none","tool":"test"}]}}]`, }, { "all_rules_with_all_params", @@ -137,7 +137,7 @@ func TestRulesetRules(t *testing.T) { GroupingStrategy: MergeGroupingStrategyAllGreen, MaxEntriesToBuild: 10, MaxEntriesToMerge: 20, - MergeMethod: MergeMethodSquash, + MergeMethod: MergeQueueMergeMethodSquash, MinEntriesToMerge: 1, MinEntriesToMergeWaitMinutes: 15, }, @@ -146,9 +146,9 @@ func TestRulesetRules(t *testing.T) { }, RequiredSignatures: &EmptyRuleParameters{}, PullRequest: &PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{ - MergeMethodSquash, - MergeMethodRebase, + AllowedMergeMethods: []PullRequestMergeMethod{ + PullRequestMergeMethodSquash, + PullRequestMergeMethodRebase, }, AutomaticCopilotCodeReviewEnabled: Ptr(false), DismissStaleReviewsOnPush: true, @@ -236,7 +236,7 @@ func TestRulesetRules(t *testing.T) { }, }, }, - `[{"type":"creation"},{"type":"update","parameters":{"update_allows_fetch_and_merge":true}},{"type":"deletion"},{"type":"required_linear_history"},{"type":"merge_queue","parameters":{"check_response_timeout_minutes":5,"grouping_strategy":"ALLGREEN","max_entries_to_build":10,"max_entries_to_merge":20,"merge_method":"squash","min_entries_to_merge":1,"min_entries_to_merge_wait_minutes":15}},{"type":"required_deployments","parameters":{"required_deployment_environments":["test1","test2"]}},{"type":"required_signatures"},{"type":"pull_request","parameters":{"allowed_merge_methods":["squash","rebase"],"automatic_copilot_code_review_enabled":false,"dismiss_stale_reviews_on_push":true,"require_code_owner_review":true,"require_last_push_approval":true,"required_approving_review_count":2,"required_review_thread_resolution":true}},{"type":"required_status_checks","parameters":{"do_not_enforce_on_create":true,"required_status_checks":[{"context":"test1","integration_id":1},{"context":"test2","integration_id":2}],"strict_required_status_checks_policy":true}},{"type":"non_fast_forward"},{"type":"commit_message_pattern","parameters":{"name":"cmp","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"commit_author_email_pattern","parameters":{"name":"caep","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"committer_email_pattern","parameters":{"name":"cep","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"branch_name_pattern","parameters":{"name":"bp","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"tag_name_pattern","parameters":{"name":"tp","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"file_path_restriction","parameters":{"restricted_file_paths":["test1","test2"]}},{"type":"max_file_path_length","parameters":{"max_file_path_length":512}},{"type":"file_extension_restriction","parameters":{"restricted_file_extensions":[".exe",".pkg"]}},{"type":"max_file_size","parameters":{"max_file_size":1024}},{"type":"workflows","parameters":{"do_not_enforce_on_create":true,"workflows":[{"path":".github/workflows/test1.yaml","ref":"main","repository_id":1,"sha":"aaaa"},{"path":".github/workflows/test2.yaml","ref":"main","repository_id":2,"sha":"bbbb"}]}},{"type":"code_scanning","parameters":{"code_scanning_tools":[{"alerts_threshold":"all","security_alerts_threshold":"all","tool":"test"},{"alerts_threshold":"none","security_alerts_threshold":"none","tool":"test"}]}}]`, + `[{"type":"creation"},{"type":"update","parameters":{"update_allows_fetch_and_merge":true}},{"type":"deletion"},{"type":"required_linear_history"},{"type":"merge_queue","parameters":{"check_response_timeout_minutes":5,"grouping_strategy":"ALLGREEN","max_entries_to_build":10,"max_entries_to_merge":20,"merge_method":"SQUASH","min_entries_to_merge":1,"min_entries_to_merge_wait_minutes":15}},{"type":"required_deployments","parameters":{"required_deployment_environments":["test1","test2"]}},{"type":"required_signatures"},{"type":"pull_request","parameters":{"allowed_merge_methods":["squash","rebase"],"automatic_copilot_code_review_enabled":false,"dismiss_stale_reviews_on_push":true,"require_code_owner_review":true,"require_last_push_approval":true,"required_approving_review_count":2,"required_review_thread_resolution":true}},{"type":"required_status_checks","parameters":{"do_not_enforce_on_create":true,"required_status_checks":[{"context":"test1","integration_id":1},{"context":"test2","integration_id":2}],"strict_required_status_checks_policy":true}},{"type":"non_fast_forward"},{"type":"commit_message_pattern","parameters":{"name":"cmp","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"commit_author_email_pattern","parameters":{"name":"caep","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"committer_email_pattern","parameters":{"name":"cep","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"branch_name_pattern","parameters":{"name":"bp","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"tag_name_pattern","parameters":{"name":"tp","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"file_path_restriction","parameters":{"restricted_file_paths":["test1","test2"]}},{"type":"max_file_path_length","parameters":{"max_file_path_length":512}},{"type":"file_extension_restriction","parameters":{"restricted_file_extensions":[".exe",".pkg"]}},{"type":"max_file_size","parameters":{"max_file_size":1024}},{"type":"workflows","parameters":{"do_not_enforce_on_create":true,"workflows":[{"path":".github/workflows/test1.yaml","ref":"main","repository_id":1,"sha":"aaaa"},{"path":".github/workflows/test2.yaml","ref":"main","repository_id":2,"sha":"bbbb"}]}},{"type":"code_scanning","parameters":{"code_scanning_tools":[{"alerts_threshold":"all","security_alerts_threshold":"all","tool":"test"},{"alerts_threshold":"none","security_alerts_threshold":"none","tool":"test"}]}}]`, }, } @@ -373,7 +373,7 @@ func TestBranchRules(t *testing.T) { GroupingStrategy: MergeGroupingStrategyAllGreen, MaxEntriesToBuild: 10, MaxEntriesToMerge: 20, - MergeMethod: MergeMethodSquash, + MergeMethod: MergeQueueMergeMethodSquash, MinEntriesToMerge: 1, MinEntriesToMergeWaitMinutes: 15, }, @@ -406,9 +406,9 @@ func TestBranchRules(t *testing.T) { RulesetID: 1, }, Parameters: PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{ - MergeMethodSquash, - MergeMethodRebase, + AllowedMergeMethods: []PullRequestMergeMethod{ + PullRequestMergeMethodSquash, + PullRequestMergeMethodRebase, }, DismissStaleReviewsOnPush: true, RequireCodeOwnerReview: true, @@ -611,7 +611,7 @@ func TestBranchRules(t *testing.T) { }, }, }, - `[{"type":"creation","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1},{"type":"update","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"update_allows_fetch_and_merge":true}},{"type":"deletion","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1},{"type":"required_linear_history","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1},{"type":"merge_queue","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"check_response_timeout_minutes":5,"grouping_strategy":"ALLGREEN","max_entries_to_build":10,"max_entries_to_merge":20,"merge_method":"squash","min_entries_to_merge":1,"min_entries_to_merge_wait_minutes":15}},{"type":"required_deployments","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"required_deployment_environments":["test1","test2"]}},{"type":"required_signatures","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1},{"type":"pull_request","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"allowed_merge_methods":["squash","rebase"],"dismiss_stale_reviews_on_push":true,"require_code_owner_review":true,"require_last_push_approval":true,"required_approving_review_count":2,"required_review_thread_resolution":true}},{"type":"required_status_checks","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"do_not_enforce_on_create":true,"required_status_checks":[{"context":"test1","integration_id":1},{"context":"test2","integration_id":2}],"strict_required_status_checks_policy":true}},{"type":"non_fast_forward","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1},{"type":"commit_message_pattern","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"name":"cmp","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"commit_author_email_pattern","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"name":"caep","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"committer_email_pattern","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"name":"cep","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"branch_name_pattern","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"name":"bp","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"tag_name_pattern","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"name":"tp","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"file_path_restriction","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"restricted_file_paths":["test1","test2"]}},{"type":"max_file_path_length","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"max_file_path_length":512}},{"type":"file_extension_restriction","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"restricted_file_extensions":[".exe",".pkg"]}},{"type":"max_file_size","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"max_file_size":1024}},{"type":"workflows","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"do_not_enforce_on_create":true,"workflows":[{"path":".github/workflows/test1.yaml","ref":"main","repository_id":1,"sha":"aaaa"},{"path":".github/workflows/test2.yaml","ref":"main","repository_id":2,"sha":"bbbb"}]}},{"type":"code_scanning","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"code_scanning_tools":[{"alerts_threshold":"all","security_alerts_threshold":"all","tool":"test"},{"alerts_threshold":"none","security_alerts_threshold":"none","tool":"test"}]}}]`, + `[{"type":"creation","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1},{"type":"update","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"update_allows_fetch_and_merge":true}},{"type":"deletion","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1},{"type":"required_linear_history","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1},{"type":"merge_queue","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"check_response_timeout_minutes":5,"grouping_strategy":"ALLGREEN","max_entries_to_build":10,"max_entries_to_merge":20,"merge_method":"SQUASH","min_entries_to_merge":1,"min_entries_to_merge_wait_minutes":15}},{"type":"required_deployments","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"required_deployment_environments":["test1","test2"]}},{"type":"required_signatures","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1},{"type":"pull_request","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"allowed_merge_methods":["squash","rebase"],"dismiss_stale_reviews_on_push":true,"require_code_owner_review":true,"require_last_push_approval":true,"required_approving_review_count":2,"required_review_thread_resolution":true}},{"type":"required_status_checks","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"do_not_enforce_on_create":true,"required_status_checks":[{"context":"test1","integration_id":1},{"context":"test2","integration_id":2}],"strict_required_status_checks_policy":true}},{"type":"non_fast_forward","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1},{"type":"commit_message_pattern","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"name":"cmp","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"commit_author_email_pattern","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"name":"caep","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"committer_email_pattern","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"name":"cep","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"branch_name_pattern","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"name":"bp","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"tag_name_pattern","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"name":"tp","negate":false,"operator":"starts_with","pattern":"test"}},{"type":"file_path_restriction","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"restricted_file_paths":["test1","test2"]}},{"type":"max_file_path_length","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"max_file_path_length":512}},{"type":"file_extension_restriction","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"restricted_file_extensions":[".exe",".pkg"]}},{"type":"max_file_size","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"max_file_size":1024}},{"type":"workflows","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"do_not_enforce_on_create":true,"workflows":[{"path":".github/workflows/test1.yaml","ref":"main","repository_id":1,"sha":"aaaa"},{"path":".github/workflows/test2.yaml","ref":"main","repository_id":2,"sha":"bbbb"}]}},{"type":"code_scanning","ruleset_source_type":"Repository","ruleset_source":"test/test","ruleset_id":1,"parameters":{"code_scanning_tools":[{"alerts_threshold":"all","security_alerts_threshold":"all","tool":"test"},{"alerts_threshold":"none","security_alerts_threshold":"none","tool":"test"}]}}]`, }, } @@ -695,12 +695,12 @@ func TestRepositoryRule(t *testing.T) { GroupingStrategy: MergeGroupingStrategyAllGreen, MaxEntriesToBuild: 10, MaxEntriesToMerge: 20, - MergeMethod: MergeMethodSquash, + MergeMethod: MergeQueueMergeMethodSquash, MinEntriesToMerge: 1, MinEntriesToMergeWaitMinutes: 15, }, }, - `{"type":"merge_queue","parameters":{"check_response_timeout_minutes":5,"grouping_strategy":"ALLGREEN","max_entries_to_build":10,"max_entries_to_merge":20,"merge_method":"squash","min_entries_to_merge":1,"min_entries_to_merge_wait_minutes":15}}`, + `{"type":"merge_queue","parameters":{"check_response_timeout_minutes":5,"grouping_strategy":"ALLGREEN","max_entries_to_build":10,"max_entries_to_merge":20,"merge_method":"SQUASH","min_entries_to_merge":1,"min_entries_to_merge_wait_minutes":15}}`, }, { "required_deployments", @@ -722,9 +722,9 @@ func TestRepositoryRule(t *testing.T) { &RepositoryRule{ Type: RulesetRuleTypePullRequest, Parameters: &PullRequestRuleParameters{ - AllowedMergeMethods: []MergeMethod{ - MergeMethodSquash, - MergeMethodRebase, + AllowedMergeMethods: []PullRequestMergeMethod{ + PullRequestMergeMethodSquash, + PullRequestMergeMethodRebase, }, AutomaticCopilotCodeReviewEnabled: Ptr(true), DismissStaleReviewsOnPush: true, From bdd7396e2d694d1a9ae9e8809d034d6de530c617 Mon Sep 17 00:00:00 2001 From: ktruedat <100484364+ktruedat@users.noreply.github.com> Date: Mon, 28 Apr 2025 19:09:11 +0300 Subject: [PATCH 709/751] feat!: Add support for pagination options in rules API methods (#3562) BREAKING CHANGE: `GetRulesForBranch`, `GetAllRulesets`, and `GetAllRepositoryRulesets` now accept `opts`. --- github/github-accessors.go | 8 +++ github/github-accessors_test.go | 11 ++++ github/orgs_rules.go | 7 +- github/orgs_rules_test.go | 47 +++++++++++++- github/repos_rules.go | 27 ++++++-- github/repos_rules_test.go | 109 ++++++++++++++++++++++++++++++-- 6 files changed, 198 insertions(+), 11 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 8530cd914bc..b2f8b5f0f53 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -22782,6 +22782,14 @@ func (r *RepositoryLicense) GetURL() string { return *r.URL } +// GetIncludesParents returns the IncludesParents field if it's non-nil, zero value otherwise. +func (r *RepositoryListRulesetsOptions) GetIncludesParents() bool { + if r == nil || r.IncludesParents == nil { + return false + } + return *r.IncludesParents +} + // GetBase returns the Base field if it's non-nil, zero value otherwise. func (r *RepositoryMergeRequest) GetBase() string { if r == nil || r.Base == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 8b85e063f4d..a6a75ae0f10 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -29383,6 +29383,17 @@ func TestRepositoryLicense_GetURL(tt *testing.T) { r.GetURL() } +func TestRepositoryListRulesetsOptions_GetIncludesParents(tt *testing.T) { + tt.Parallel() + var zeroValue bool + r := &RepositoryListRulesetsOptions{IncludesParents: &zeroValue} + r.GetIncludesParents() + r = &RepositoryListRulesetsOptions{} + r.GetIncludesParents() + r = nil + r.GetIncludesParents() +} + func TestRepositoryMergeRequest_GetBase(tt *testing.T) { tt.Parallel() var zeroValue string diff --git a/github/orgs_rules.go b/github/orgs_rules.go index 8cb2e5d1f92..357eb8ce7cf 100644 --- a/github/orgs_rules.go +++ b/github/orgs_rules.go @@ -15,9 +15,14 @@ import ( // GitHub API docs: https://docs.github.com/rest/orgs/rules#get-all-organization-repository-rulesets // //meta:operation GET /orgs/{org}/rulesets -func (s *OrganizationsService) GetAllRepositoryRulesets(ctx context.Context, org string) ([]*RepositoryRuleset, *Response, error) { +func (s *OrganizationsService) GetAllRepositoryRulesets(ctx context.Context, org string, opts *ListOptions) ([]*RepositoryRuleset, *Response, error) { u := fmt.Sprintf("orgs/%v/rulesets", org) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err diff --git a/github/orgs_rules_test.go b/github/orgs_rules_test.go index 37c98d5bcf4..b21ff93b151 100644 --- a/github/orgs_rules_test.go +++ b/github/orgs_rules_test.go @@ -38,7 +38,7 @@ func TestOrganizationsService_GetAllRepositoryRulesets(t *testing.T) { }) ctx := context.Background() - rulesets, _, err := client.Organizations.GetAllRepositoryRulesets(ctx, "o") + rulesets, _, err := client.Organizations.GetAllRepositoryRulesets(ctx, "o", nil) if err != nil { t.Errorf("Organizations.GetAllRepositoryRulesets returned error: %v", err) } @@ -60,9 +60,52 @@ func TestOrganizationsService_GetAllRepositoryRulesets(t *testing.T) { } const methodName = "GetAllRepositoryRulesets" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Organizations.GetAllRepositoryRulesets(ctx, "o", nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestOrganizationsService_GetAllRepositoryRulesets_ListOptions(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/orgs/o/rulesets", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{ + "page": "2", + "per_page": "35", + }) + fmt.Fprint(w, `[{ + "id": 21 + }]`) + }) + + opts := &ListOptions{Page: 2, PerPage: 35} + ctx := context.Background() + rulesets, _, err := client.Organizations.GetAllRepositoryRulesets(ctx, "o", opts) + if err != nil { + t.Errorf("Organizations.GetAllRepositoryRulesets returned error: %v", err) + } + + want := []*RepositoryRuleset{{ + ID: Ptr(int64(21)), + }} + if !cmp.Equal(rulesets, want) { + t.Errorf("Organizations.GetAllRepositoryRulesets returned %+v, want %+v", rulesets, want) + } + + const methodName = "GetAllRepositoryRulesets" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Organizations.GetAllRepositoryRulesets(ctx, "\n", opts) + return err + }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Organizations.GetAllRepositoryRulesets(ctx, "o") + got, resp, err := client.Organizations.GetAllRepositoryRulesets(ctx, "o", opts) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } diff --git a/github/repos_rules.go b/github/repos_rules.go index d38e35cdd77..038cefd71a4 100644 --- a/github/repos_rules.go +++ b/github/repos_rules.go @@ -38,9 +38,14 @@ type rulesetClearBypassActors struct { // GitHub API docs: https://docs.github.com/rest/repos/rules#get-rules-for-a-branch // //meta:operation GET /repos/{owner}/{repo}/rules/branches/{branch} -func (s *RepositoriesService) GetRulesForBranch(ctx context.Context, owner, repo, branch string) (*BranchRules, *Response, error) { +func (s *RepositoriesService) GetRulesForBranch(ctx context.Context, owner, repo, branch string, opts *ListOptions) (*BranchRules, *Response, error) { u := fmt.Sprintf("repos/%v/%v/rules/branches/%v", owner, repo, branch) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err @@ -55,14 +60,28 @@ func (s *RepositoriesService) GetRulesForBranch(ctx context.Context, owner, repo return rules, resp, nil } +// RepositoryListRulesetsOptions specifies optional parameters to the +// RepositoriesService.GetAllRulesets method. +type RepositoryListRulesetsOptions struct { + // IncludesParents indicates whether to include rulesets configured at the organization or enterprise level that apply to the repository. + IncludesParents *bool `url:"includes_parents,omitempty"` + ListOptions +} + // GetAllRulesets gets all the repository rulesets for the specified repository. -// If includesParents is true, rulesets configured at the organization or enterprise level that apply to the repository will be returned. +// By default, this endpoint will include rulesets configured at the organization or enterprise level that apply to the repository. +// To exclude those rulesets, set the `RepositoryListRulesetsOptions.IncludesParents` parameter to `false`. // // GitHub API docs: https://docs.github.com/rest/repos/rules#get-all-repository-rulesets // //meta:operation GET /repos/{owner}/{repo}/rulesets -func (s *RepositoriesService) GetAllRulesets(ctx context.Context, owner, repo string, includesParents bool) ([]*RepositoryRuleset, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/rulesets?includes_parents=%v", owner, repo, includesParents) +func (s *RepositoriesService) GetAllRulesets(ctx context.Context, owner, repo string, opts *RepositoryListRulesetsOptions) ([]*RepositoryRuleset, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/rulesets", owner, repo) + + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } req, err := s.client.NewRequest("GET", u, nil) if err != nil { diff --git a/github/repos_rules_test.go b/github/repos_rules_test.go index bb43d532a55..24beb654199 100644 --- a/github/repos_rules_test.go +++ b/github/repos_rules_test.go @@ -40,7 +40,7 @@ func TestRepositoriesService_GetRulesForBranch(t *testing.T) { }) ctx := context.Background() - rules, _, err := client.Repositories.GetRulesForBranch(ctx, "o", "repo", "branch") + rules, _, err := client.Repositories.GetRulesForBranch(ctx, "o", "repo", "branch", nil) if err != nil { t.Errorf("Repositories.GetRulesForBranch returned error: %v", err) } @@ -55,9 +55,56 @@ func TestRepositoriesService_GetRulesForBranch(t *testing.T) { } const methodName = "GetRulesForBranch" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.GetRulesForBranch(ctx, "o", "repo", "branch", nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestRepositoriesService_GetRulesForBranch_ListOptions(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/repos/o/repo/rules/branches/branch", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{ + "page": "2", + "per_page": "35", + }) + fmt.Fprint(w, `[ + { + "ruleset_id": 42069, + "type": "creation" + } + ]`) + }) + + opts := &ListOptions{Page: 2, PerPage: 35} + ctx := context.Background() + rules, _, err := client.Repositories.GetRulesForBranch(ctx, "o", "repo", "branch", opts) + if err != nil { + t.Errorf("Repositories.GetRulesForBranch returned error: %v", err) + } + + want := &BranchRules{ + Creation: []*BranchRuleMetadata{{RulesetID: 42069}}, + } + + if !cmp.Equal(rules, want) { + t.Errorf("Repositories.GetRulesForBranch returned %+v, want %+v", rules, want) + } + + const methodName = "GetRulesForBranch" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.GetRulesForBranch(ctx, "\n", "\n", "\n", opts) + return err + }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.GetRulesForBranch(ctx, "o", "repo", "branch") + got, resp, err := client.Repositories.GetRulesForBranch(ctx, "o", "repo", "branch", opts) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } @@ -94,7 +141,7 @@ func TestRepositoriesService_GetAllRulesets(t *testing.T) { }) ctx := context.Background() - ruleSet, _, err := client.Repositories.GetAllRulesets(ctx, "o", "repo", false) + ruleSet, _, err := client.Repositories.GetAllRulesets(ctx, "o", "repo", nil) if err != nil { t.Errorf("Repositories.GetAllRulesets returned error: %v", err) } @@ -124,9 +171,63 @@ func TestRepositoriesService_GetAllRulesets(t *testing.T) { } const methodName = "GetAllRulesets" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.GetAllRulesets(ctx, "o", "repo", nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestRepositoriesService_GetAllRulesets_ListOptions(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/repos/o/repo/rulesets", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{ + "includes_parents": "false", + "page": "2", + "per_page": "35", + }) + fmt.Fprint(w, `[ + { + "id": 42 + } + ]`) + }) + + opts := &RepositoryListRulesetsOptions{ + IncludesParents: Ptr(false), + ListOptions: ListOptions{ + Page: 2, + PerPage: 35, + }, + } + ctx := context.Background() + ruleSet, _, err := client.Repositories.GetAllRulesets(ctx, "o", "repo", opts) + if err != nil { + t.Errorf("Repositories.GetAllRulesets returned error: %v", err) + } + + want := []*RepositoryRuleset{ + { + ID: Ptr(int64(42)), + }, + } + if !cmp.Equal(ruleSet, want) { + t.Errorf("Repositories.GetAllRulesets returned %+v, want %+v", ruleSet, want) + } + + const methodName = "GetAllRulesets" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.GetAllRulesets(ctx, "\n", "\n", opts) + return err + }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Repositories.GetAllRulesets(ctx, "o", "repo", false) + got, resp, err := client.Repositories.GetAllRulesets(ctx, "o", "repo", opts) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } From c9e1ad0d3b6526b0443a5eeaf38d2ff0c3e46d8e Mon Sep 17 00:00:00 2001 From: Carlos Tadeu Panato Junior Date: Wed, 30 Apr 2025 14:27:35 +0200 Subject: [PATCH 710/751] Add issue `Type` to `IssueRequest` (#3567) --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 11 +++++++++++ github/issues.go | 1 + github/issues_test.go | 16 +++++++++++----- 4 files changed, 31 insertions(+), 5 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index b2f8b5f0f53..6378b40b44c 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -12406,6 +12406,14 @@ func (i *IssueRequest) GetTitle() string { return *i.Title } +// GetType returns the Type field if it's non-nil, zero value otherwise. +func (i *IssueRequest) GetType() string { + if i == nil || i.Type == nil { + return "" + } + return *i.Type +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (i *IssuesEvent) GetAction() string { if i == nil || i.Action == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index a6a75ae0f10..3588b7909f1 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -16064,6 +16064,17 @@ func TestIssueRequest_GetTitle(tt *testing.T) { i.GetTitle() } +func TestIssueRequest_GetType(tt *testing.T) { + tt.Parallel() + var zeroValue string + i := &IssueRequest{Type: &zeroValue} + i.GetType() + i = &IssueRequest{} + i.GetType() + i = nil + i.GetType() +} + func TestIssuesEvent_GetAction(tt *testing.T) { tt.Parallel() var zeroValue string diff --git a/github/issues.go b/github/issues.go index 6d3a6b15c5a..61a858208ca 100644 --- a/github/issues.go +++ b/github/issues.go @@ -90,6 +90,7 @@ type IssueRequest struct { StateReason *string `json:"state_reason,omitempty"` Milestone *int `json:"milestone,omitempty"` Assignees *[]string `json:"assignees,omitempty"` + Type *string `json:"type,omitempty"` } // IssueListOptions specifies the optional parameters to the IssuesService.List diff --git a/github/issues_test.go b/github/issues_test.go index 4ac67981d40..28cf28d4c80 100644 --- a/github/issues_test.go +++ b/github/issues_test.go @@ -314,7 +314,7 @@ func TestIssuesService_Edit(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &IssueRequest{Title: Ptr("t")} + input := &IssueRequest{Title: Ptr("t"), Type: Ptr("bug")} mux.HandleFunc("/repos/o/r/issues/1", func(w http.ResponseWriter, r *http.Request) { v := new(IssueRequest) @@ -325,7 +325,7 @@ func TestIssuesService_Edit(t *testing.T) { t.Errorf("Request body = %+v, want %+v", v, input) } - fmt.Fprint(w, `{"number":1}`) + fmt.Fprint(w, `{"number":1, "type": {"name": "bug"}}`) }) ctx := context.Background() @@ -334,7 +334,7 @@ func TestIssuesService_Edit(t *testing.T) { t.Errorf("Issues.Edit returned error: %v", err) } - want := &Issue{Number: Ptr(1)} + want := &Issue{Number: Ptr(1), Type: &IssueType{Name: Ptr("bug")}} if !cmp.Equal(issue, want) { t.Errorf("Issues.Edit returned %+v, want %+v", issue, want) } @@ -529,6 +529,7 @@ func TestIssueRequest_Marshal(t *testing.T) { State: Ptr("url"), Milestone: Ptr(1), Assignees: &[]string{"a"}, + Type: Ptr("issue_type"), } want := `{ @@ -542,7 +543,8 @@ func TestIssueRequest_Marshal(t *testing.T) { "milestone": 1, "assignees": [ "a" - ] + ], + "type": "issue_type" }` testJSONMarshal(t, u, want) @@ -582,6 +584,7 @@ func TestIssue_Marshal(t *testing.T) { NodeID: Ptr("nid"), TextMatches: []*TextMatch{{ObjectURL: Ptr("ourl")}}, ActiveLockReason: Ptr("alr"), + Type: &IssueType{Name: Ptr("bug")}, } want := `{ @@ -639,7 +642,10 @@ func TestIssue_Marshal(t *testing.T) { "object_url": "ourl" } ], - "active_lock_reason": "alr" + "active_lock_reason": "alr", + "type": { + "name": "bug" + } }` testJSONMarshal(t, u, want) From a341c3df8811a2f9756081b38c822d82c9c40adb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 May 2025 15:34:09 -0400 Subject: [PATCH 711/751] build(deps): bump golang.org/x/sync from 0.13.0 to 0.14.0 in /tools (#3568) --- tools/go.mod | 2 +- tools/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index 124238156c7..c85e9ca6dd3 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -7,7 +7,7 @@ require ( github.com/getkin/kin-openapi v0.131.0 github.com/google/go-cmp v0.7.0 github.com/google/go-github/v71 v71.0.0 - golang.org/x/sync v0.13.0 + golang.org/x/sync v0.14.0 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/tools/go.sum b/tools/go.sum index 069ac54c499..47c25611147 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -45,8 +45,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= -golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610= -golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ= +golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= From 9a4137d1ff1d6717b36c496e80ac4ba9a83cba1d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 May 2025 15:41:55 -0400 Subject: [PATCH 712/751] build(deps): bump github.com/getkin/kin-openapi from 0.131.0 to 0.132.0 in /tools (#3569) --- tools/go.mod | 2 +- tools/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index c85e9ca6dd3..f800357a28f 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -4,7 +4,7 @@ go 1.23.0 require ( github.com/alecthomas/kong v1.10.0 - github.com/getkin/kin-openapi v0.131.0 + github.com/getkin/kin-openapi v0.132.0 github.com/google/go-cmp v0.7.0 github.com/google/go-github/v71 v71.0.0 golang.org/x/sync v0.14.0 diff --git a/tools/go.sum b/tools/go.sum index 47c25611147..7d37e86fa5f 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -6,8 +6,8 @@ github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/getkin/kin-openapi v0.131.0 h1:NO2UeHnFKRYhZ8wg6Nyh5Cq7dHk4suQQr72a4pMrDxE= -github.com/getkin/kin-openapi v0.131.0/go.mod h1:3OlG51PCYNsPByuiMB0t4fjnNlIDnaEDsjiKUV8nL58= +github.com/getkin/kin-openapi v0.132.0 h1:3ISeLMsQzcb5v26yeJrBcdTCEQTag36ZjaGk7MIRUwk= +github.com/getkin/kin-openapi v0.132.0/go.mod h1:3OlG51PCYNsPByuiMB0t4fjnNlIDnaEDsjiKUV8nL58= github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= From 6a2c098e785365459a14006a4a0f3a2381a3fbf2 Mon Sep 17 00:00:00 2001 From: Jan Berger <138661153+jberger-dynatrace@users.noreply.github.com> Date: Thu, 8 May 2025 13:58:15 +0200 Subject: [PATCH 713/751] Add ListCursorOptions to list Issues methods (#3570) --- github/issues.go | 8 ++++++++ github/issues_test.go | 9 +++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/github/issues.go b/github/issues.go index 61a858208ca..395d64cf44f 100644 --- a/github/issues.go +++ b/github/issues.go @@ -118,6 +118,10 @@ type IssueListOptions struct { // Since filters issues by time. Since time.Time `url:"since,omitempty"` + ListCursorOptions + + // Add ListOptions so offset pagination with integer type "page" query parameter is accepted + // since ListCursorOptions accepts "page" as string only. ListOptions } @@ -234,6 +238,10 @@ type IssueListByRepoOptions struct { // Since filters issues by time. Since time.Time `url:"since,omitempty"` + ListCursorOptions + + // Add ListOptions so offset pagination with integer type "page" query parameter is accepted + // since ListCursorOptions accepts "page" as string only. ListOptions } diff --git a/github/issues_test.go b/github/issues_test.go index 28cf28d4c80..66e4526d77a 100644 --- a/github/issues_test.go +++ b/github/issues_test.go @@ -32,6 +32,8 @@ func TestIssuesService_List_all(t *testing.T) { "since": "2002-02-10T15:30:00Z", "page": "1", "per_page": "2", + "before": "foo", + "after": "bar", }) fmt.Fprint(w, `[{"number":1}]`) }) @@ -39,7 +41,7 @@ func TestIssuesService_List_all(t *testing.T) { opt := &IssueListOptions{ "all", "closed", []string{"a", "b"}, "updated", "asc", time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC), - ListOptions{Page: 1, PerPage: 2}, + ListCursorOptions{Before: "foo", After: "bar"}, ListOptions{Page: 1, PerPage: 2}, } ctx := context.Background() issues, _, err := client.Issues.List(ctx, true, opt) @@ -155,6 +157,9 @@ func TestIssuesService_ListByRepo(t *testing.T) { "sort": "updated", "direction": "asc", "since": "2002-02-10T15:30:00Z", + "per_page": "1", + "before": "foo", + "after": "bar", }) fmt.Fprint(w, `[{"number":1}]`) }) @@ -162,7 +167,7 @@ func TestIssuesService_ListByRepo(t *testing.T) { opt := &IssueListByRepoOptions{ "*", "closed", "a", "c", "m", []string{"a", "b"}, "updated", "asc", time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC), - ListOptions{0, 0}, + ListCursorOptions{PerPage: 1, Before: "foo", After: "bar"}, ListOptions{0, 0}, } ctx := context.Background() issues, _, err := client.Issues.ListByRepo(ctx, "o", "r", opt) From 718c304661aa42ba7a01da5b54b2ce85f2f48234 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Thu, 8 May 2025 10:39:03 -0400 Subject: [PATCH 714/751] Bump version of go-github to v72.0.0 (#3571) --- README.md | 18 +++++++++--------- example/actionpermissions/main.go | 2 +- example/appengine/app.go | 2 +- example/basicauth/main.go | 2 +- .../newreposecretwithxcrypto/main.go | 2 +- .../newusersecretwithxcrypto/main.go | 2 +- example/commitpr/main.go | 2 +- example/go.mod | 6 +++--- example/listenvironments/main.go | 2 +- example/migrations/main.go | 2 +- example/newfilewithappauth/main.go | 2 +- example/newrepo/main.go | 2 +- example/newreposecretwithlibsodium/go.mod | 4 ++-- example/newreposecretwithlibsodium/main.go | 2 +- example/newreposecretwithxcrypto/main.go | 2 +- example/ratelimit/main.go | 2 +- example/simple/main.go | 2 +- example/tokenauth/main.go | 2 +- example/topics/main.go | 2 +- example/verifyartifact/main.go | 2 +- github/doc.go | 2 +- github/examples_test.go | 2 +- github/github.go | 2 +- go.mod | 2 +- test/fields/fields.go | 2 +- test/integration/activity_test.go | 2 +- test/integration/authorizations_test.go | 2 +- test/integration/github_test.go | 2 +- test/integration/repos_test.go | 2 +- test/integration/users_test.go | 2 +- tools/go.mod | 4 ++-- tools/metadata/main.go | 2 +- tools/metadata/main_test.go | 2 +- tools/metadata/metadata.go | 2 +- tools/metadata/openapi.go | 2 +- 35 files changed, 47 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index d6f6bafc6f8..edfc1b53813 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-github # [![go-github release (latest SemVer)](https://img.shields.io/github/v/release/google/go-github?sort=semver)](https://github.com/google/go-github/releases) -[![Go Reference](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v71/github) +[![Go Reference](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v72/github) [![Test Status](https://github.com/google/go-github/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/google/go-github/actions/workflows/tests.yml) [![Test Coverage](https://codecov.io/gh/google/go-github/branch/master/graph/badge.svg)](https://codecov.io/gh/google/go-github) [![Discuss at go-github@googlegroups.com](https://img.shields.io/badge/discuss-go--github%40googlegroups.com-blue.svg)](https://groups.google.com/group/go-github) @@ -30,7 +30,7 @@ If you're interested in using the [GraphQL API v4][], the recommended library is go-github is compatible with modern Go releases in module mode, with Go installed: ```bash -go get github.com/google/go-github/v71 +go get github.com/google/go-github/v72 ``` will resolve and add the package to the current development module, along with its dependencies. @@ -38,7 +38,7 @@ will resolve and add the package to the current development module, along with i Alternatively the same can be achieved if you use import in a package: ```go -import "github.com/google/go-github/v71/github" +import "github.com/google/go-github/v72/github" ``` and run `go get` without parameters. @@ -46,13 +46,13 @@ and run `go get` without parameters. Finally, to use the top-of-trunk version of this repo, use the following command: ```bash -go get github.com/google/go-github/v71@master +go get github.com/google/go-github/v72@master ``` ## Usage ## ```go -import "github.com/google/go-github/v71/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) +import "github.com/google/go-github/v72/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled ``` @@ -125,7 +125,7 @@ import ( "net/http" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v72/github" ) func main() { @@ -159,7 +159,7 @@ import ( "os" "strconv" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v72/github" "github.com/jferrl/go-githubauth" "golang.org/x/oauth2" ) @@ -380,7 +380,7 @@ For complete usage of go-github, see the full [package docs][]. [GitHub API v3]: https://docs.github.com/en/rest [personal access token]: https://github.com/blog/1509-personal-api-tokens -[package docs]: https://pkg.go.dev/github.com/google/go-github/v71/github +[package docs]: https://pkg.go.dev/github.com/google/go-github/v72/github [GraphQL API v4]: https://developer.github.com/v4/ [shurcooL/githubv4]: https://github.com/shurcooL/githubv4 [GitHub webhook events]: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads @@ -454,7 +454,7 @@ Versions prior to 48.2.0 are not listed. | go-github Version | GitHub v3 API Version | | ----------------- | --------------------- | -| 71.0.0 | 2022-11-28 | +| 72.0.0 | 2022-11-28 | | ... | 2022-11-28 | | 48.2.0 | 2022-11-28 | diff --git a/example/actionpermissions/main.go b/example/actionpermissions/main.go index f5628b6b447..f85f878e74e 100644 --- a/example/actionpermissions/main.go +++ b/example/actionpermissions/main.go @@ -14,7 +14,7 @@ import ( "log" "os" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v72/github" ) var ( diff --git a/example/appengine/app.go b/example/appengine/app.go index a78e574ed13..8782b536630 100644 --- a/example/appengine/app.go +++ b/example/appengine/app.go @@ -12,7 +12,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v72/github" "google.golang.org/appengine" "google.golang.org/appengine/log" ) diff --git a/example/basicauth/main.go b/example/basicauth/main.go index b0f2515d0fb..92ab86e9a69 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -21,7 +21,7 @@ import ( "os" "strings" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v72/github" "golang.org/x/term" ) diff --git a/example/codespaces/newreposecretwithxcrypto/main.go b/example/codespaces/newreposecretwithxcrypto/main.go index 8d8502e6b7d..34829a5b324 100644 --- a/example/codespaces/newreposecretwithxcrypto/main.go +++ b/example/codespaces/newreposecretwithxcrypto/main.go @@ -37,7 +37,7 @@ import ( "log" "os" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v72/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/codespaces/newusersecretwithxcrypto/main.go b/example/codespaces/newusersecretwithxcrypto/main.go index 6be8dd92546..4430c5226ba 100644 --- a/example/codespaces/newusersecretwithxcrypto/main.go +++ b/example/codespaces/newusersecretwithxcrypto/main.go @@ -38,7 +38,7 @@ import ( "log" "os" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v72/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index f3a4297d4ac..fa0f1384899 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -33,7 +33,7 @@ import ( "time" "github.com/ProtonMail/go-crypto/openpgp" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v72/github" ) var ( diff --git a/example/go.mod b/example/go.mod index 6c7e734331f..46c7a828f81 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v71/example +module github.com/google/go-github/v72/example go 1.23.0 @@ -7,7 +7,7 @@ require ( github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-pagination v1.0.0 github.com/gofri/go-github-ratelimit/v2 v2.0.2 - github.com/google/go-github/v71 v71.0.0 + github.com/google/go-github/v72 v72.0.0 github.com/sigstore/sigstore-go v0.6.1 golang.org/x/crypto v0.36.0 golang.org/x/term v0.30.0 @@ -100,4 +100,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v71 => ../ +replace github.com/google/go-github/v72 => ../ diff --git a/example/listenvironments/main.go b/example/listenvironments/main.go index b58f8dd150f..9b64f4010c7 100644 --- a/example/listenvironments/main.go +++ b/example/listenvironments/main.go @@ -18,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v72/github" ) func main() { diff --git a/example/migrations/main.go b/example/migrations/main.go index b60f6404d1f..ccc74fa90ac 100644 --- a/example/migrations/main.go +++ b/example/migrations/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v72/github" ) func fetchAllUserMigrations() ([]*github.UserMigration, error) { diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index 610b8fa6735..c6f6e1f44b0 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -16,7 +16,7 @@ import ( "time" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v72/github" ) func main() { diff --git a/example/newrepo/main.go b/example/newrepo/main.go index 8ef8822e611..7bf1ec70b8f 100644 --- a/example/newrepo/main.go +++ b/example/newrepo/main.go @@ -16,7 +16,7 @@ import ( "log" "os" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v72/github" ) var ( diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index 2e6fd8e51fa..5e756fbb949 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -4,10 +4,10 @@ go 1.23.0 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb - github.com/google/go-github/v71 v71.0.0 + github.com/google/go-github/v72 v72.0.0 ) require github.com/google/go-querystring v1.1.0 // indirect // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v71 => ../.. +replace github.com/google/go-github/v72 => ../.. diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index 284514e4d02..c5a3faad5b2 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -36,7 +36,7 @@ import ( "os" sodium "github.com/GoKillers/libsodium-go/cryptobox" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v72/github" ) var ( diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index 7622a5a40c4..3b6c1ebaae4 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -37,7 +37,7 @@ import ( "log" "os" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v72/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/ratelimit/main.go b/example/ratelimit/main.go index b97a0cfafff..165cb99ec5a 100644 --- a/example/ratelimit/main.go +++ b/example/ratelimit/main.go @@ -17,7 +17,7 @@ import ( "github.com/gofri/go-github-ratelimit/v2/github_ratelimit" "github.com/gofri/go-github-ratelimit/v2/github_ratelimit/github_primary_ratelimit" "github.com/gofri/go-github-ratelimit/v2/github_ratelimit/github_secondary_ratelimit" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v72/github" ) func main() { diff --git a/example/simple/main.go b/example/simple/main.go index d881a995ed4..12426e0d6e4 100644 --- a/example/simple/main.go +++ b/example/simple/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v72/github" ) // Fetch all the public organizations' membership of a user. diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index 657bbe43d7d..808f1152173 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -15,7 +15,7 @@ import ( "log" "os" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v72/github" "golang.org/x/term" ) diff --git a/example/topics/main.go b/example/topics/main.go index 0939397d813..67223ece167 100644 --- a/example/topics/main.go +++ b/example/topics/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v72/github" ) // Fetch and lists all the public topics associated with the specified GitHub topic. diff --git a/example/verifyartifact/main.go b/example/verifyartifact/main.go index 8355c5998f2..9e74d2e67c9 100644 --- a/example/verifyartifact/main.go +++ b/example/verifyartifact/main.go @@ -18,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v72/github" "github.com/sigstore/sigstore-go/pkg/bundle" "github.com/sigstore/sigstore-go/pkg/root" "github.com/sigstore/sigstore-go/pkg/verify" diff --git a/github/doc.go b/github/doc.go index b963051fab5..8a6112fe9e7 100644 --- a/github/doc.go +++ b/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v71/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v72/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to diff --git a/github/examples_test.go b/github/examples_test.go index 628e069dd00..0ec22d29272 100644 --- a/github/examples_test.go +++ b/github/examples_test.go @@ -12,7 +12,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v72/github" ) func ExampleMarkdownService_Render() { diff --git a/github/github.go b/github/github.go index ddafffb2a9c..a3b1941eac1 100644 --- a/github/github.go +++ b/github/github.go @@ -29,7 +29,7 @@ import ( ) const ( - Version = "v71.0.0" + Version = "v72.0.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" diff --git a/go.mod b/go.mod index 9f404a5b3f5..adaffb814d3 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v71 +module github.com/google/go-github/v72 go 1.23.0 diff --git a/test/fields/fields.go b/test/fields/fields.go index 2e065f18661..f35abb6de1b 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -25,7 +25,7 @@ import ( "reflect" "strings" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v72/github" ) var ( diff --git a/test/integration/activity_test.go b/test/integration/activity_test.go index 265bb44f353..2026a3128d6 100644 --- a/test/integration/activity_test.go +++ b/test/integration/activity_test.go @@ -11,7 +11,7 @@ import ( "context" "testing" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v72/github" ) const ( diff --git a/test/integration/authorizations_test.go b/test/integration/authorizations_test.go index 9855dd421ba..343b66eef30 100644 --- a/test/integration/authorizations_test.go +++ b/test/integration/authorizations_test.go @@ -14,7 +14,7 @@ import ( "testing" "time" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v72/github" ) const msgEnvMissing = "Skipping test because the required environment variable (%v) is not present." diff --git a/test/integration/github_test.go b/test/integration/github_test.go index 25fad444ce3..7e074719e09 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -14,7 +14,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v72/github" ) var ( diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index 25408fed4c4..7242de586bd 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -14,7 +14,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v72/github" ) func TestRepositories_CRUD(t *testing.T) { diff --git a/test/integration/users_test.go b/test/integration/users_test.go index 9f4359f3100..70d3f5756f6 100644 --- a/test/integration/users_test.go +++ b/test/integration/users_test.go @@ -13,7 +13,7 @@ import ( "math/rand" "testing" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v72/github" ) func TestUsers_Get(t *testing.T) { diff --git a/tools/go.mod b/tools/go.mod index f800357a28f..f38b9dc76e7 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -6,7 +6,7 @@ require ( github.com/alecthomas/kong v1.10.0 github.com/getkin/kin-openapi v0.132.0 github.com/google/go-cmp v0.7.0 - github.com/google/go-github/v71 v71.0.0 + github.com/google/go-github/v72 v72.0.0 golang.org/x/sync v0.14.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -25,4 +25,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v71 => ../ +replace github.com/google/go-github/v72 => ../ diff --git a/tools/metadata/main.go b/tools/metadata/main.go index a24878be953..d5f7bbfc3b6 100644 --- a/tools/metadata/main.go +++ b/tools/metadata/main.go @@ -16,7 +16,7 @@ import ( "path/filepath" "github.com/alecthomas/kong" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v72/github" ) var helpVars = kong.Vars{ diff --git a/tools/metadata/main_test.go b/tools/metadata/main_test.go index 3d4e38267dc..f0cdff43843 100644 --- a/tools/metadata/main_test.go +++ b/tools/metadata/main_test.go @@ -23,7 +23,7 @@ import ( "github.com/alecthomas/kong" "github.com/getkin/kin-openapi/openapi3" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v72/github" ) func TestUpdateGo(t *testing.T) { diff --git a/tools/metadata/metadata.go b/tools/metadata/metadata.go index 8c1df52f2ce..6544bca2e05 100644 --- a/tools/metadata/metadata.go +++ b/tools/metadata/metadata.go @@ -24,7 +24,7 @@ import ( "strings" "sync" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v72/github" "gopkg.in/yaml.v3" ) diff --git a/tools/metadata/openapi.go b/tools/metadata/openapi.go index 845de5f545f..e23ef73e7e8 100644 --- a/tools/metadata/openapi.go +++ b/tools/metadata/openapi.go @@ -14,7 +14,7 @@ import ( "strconv" "github.com/getkin/kin-openapi/openapi3" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v72/github" "golang.org/x/sync/errgroup" ) From 4095bb21d579f1b12294e908826a3fea2f8eb02c Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Thu, 8 May 2025 11:26:32 -0400 Subject: [PATCH 715/751] Bump go-github from v71 to v72 in /scrape (#3572) --- scrape/apps.go | 2 +- scrape/apps_test.go | 2 +- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scrape/apps.go b/scrape/apps.go index 8e6fc0f76fc..1898076e23e 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -18,7 +18,7 @@ import ( "strings" "github.com/PuerkitoBio/goquery" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v72/github" ) // AppRestrictionsEnabled returns whether the specified organization has diff --git a/scrape/apps_test.go b/scrape/apps_test.go index 6362ece3f03..89b345a9f22 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -10,7 +10,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v72/github" ) func Test_AppRestrictionsEnabled(t *testing.T) { diff --git a/scrape/go.mod b/scrape/go.mod index 938710f918e..cbf6e82c1a3 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -5,7 +5,7 @@ go 1.23.0 require ( github.com/PuerkitoBio/goquery v1.10.3 github.com/google/go-cmp v0.7.0 - github.com/google/go-github/v71 v71.0.0 + github.com/google/go-github/v72 v72.0.0 github.com/xlzd/gotp v0.1.0 golang.org/x/net v0.39.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index 38f691cbc5e..e7a9f6c5d2d 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -6,8 +6,8 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/go-github/v71 v71.0.0 h1:Zi16OymGKZZMm8ZliffVVJ/Q9YZreDKONCr+WUd0Z30= -github.com/google/go-github/v71 v71.0.0/go.mod h1:URZXObp2BLlMjwu0O8g4y6VBneUj2bCHgnI8FfgZ51M= +github.com/google/go-github/v72 v72.0.0 h1:FcIO37BLoVPBO9igQQ6tStsv2asG4IPcYFi655PPvBM= +github.com/google/go-github/v72 v72.0.0/go.mod h1:WWtw8GMRiL62mvIquf1kO3onRHeWWKmK01qdCY8c5fg= 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.1.0 h1:37blvlKCh38s+fkem+fFh7sMnceltoIEBYTVXyoa5Po= From ef319d55764dd339eb8e56632eabf8eb4563366a Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Sat, 10 May 2025 09:46:23 -0400 Subject: [PATCH 716/751] Update OpenAPI (#3574) --- github/admin.go | 4 +- github/admin_orgs.go | 6 +- github/admin_stats.go | 2 +- github/admin_users.go | 8 +- github/authorizations.go | 4 +- github/enterprise_manage_ghes.go | 8 +- github/enterprise_manage_ghes_config.go | 20 +- github/enterprise_manage_ghes_maintenance.go | 4 +- github/enterprise_manage_ghes_ssh.go | 6 +- github/repos_prereceive_hooks.go | 8 +- github/users_administration.go | 8 +- openapi_operations.yaml | 2291 +++++++++--------- 12 files changed, 1205 insertions(+), 1164 deletions(-) diff --git a/github/admin.go b/github/admin.go index c15c413c578..021a12ad8c1 100644 --- a/github/admin.go +++ b/github/admin.go @@ -82,7 +82,7 @@ func (m Enterprise) String() string { // UpdateUserLDAPMapping updates the mapping between a GitHub user and an LDAP user. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user // //meta:operation PATCH /admin/ldap/users/{username}/mapping func (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, mapping *UserLDAPMapping) (*UserLDAPMapping, *Response, error) { @@ -103,7 +103,7 @@ func (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, m // UpdateTeamLDAPMapping updates the mapping between a GitHub team and an LDAP group. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team // //meta:operation PATCH /admin/ldap/teams/{team_id}/mapping func (s *AdminService) UpdateTeamLDAPMapping(ctx context.Context, team int64, mapping *TeamLDAPMapping) (*TeamLDAPMapping, *Response, error) { diff --git a/github/admin_orgs.go b/github/admin_orgs.go index 200834508db..f111d36ce99 100644 --- a/github/admin_orgs.go +++ b/github/admin_orgs.go @@ -22,7 +22,7 @@ type createOrgRequest struct { // Note that only a subset of the org fields are used and org must // not be nil. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/orgs#create-an-organization +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/orgs#create-an-organization // //meta:operation POST /admin/organizations func (s *AdminService) CreateOrg(ctx context.Context, org *Organization, admin string) (*Organization, *Response, error) { @@ -61,7 +61,7 @@ type RenameOrgResponse struct { // RenameOrg renames an organization in GitHub Enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/orgs#update-an-organization-name +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/orgs#update-an-organization-name // //meta:operation PATCH /admin/organizations/{org} func (s *AdminService) RenameOrg(ctx context.Context, org *Organization, newName string) (*RenameOrgResponse, *Response, error) { @@ -70,7 +70,7 @@ func (s *AdminService) RenameOrg(ctx context.Context, org *Organization, newName // RenameOrgByName renames an organization in GitHub Enterprise using its current name. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/orgs#update-an-organization-name +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/orgs#update-an-organization-name // //meta:operation PATCH /admin/organizations/{org} func (s *AdminService) RenameOrgByName(ctx context.Context, org, newName string) (*RenameOrgResponse, *Response, error) { diff --git a/github/admin_stats.go b/github/admin_stats.go index bdf51a66ce9..07465b8d628 100644 --- a/github/admin_stats.go +++ b/github/admin_stats.go @@ -152,7 +152,7 @@ func (s RepoStats) String() string { // Please note that this is only available to site administrators, // otherwise it will error with a 404 not found (instead of 401 or 403). // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/admin-stats#get-all-statistics +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/admin-stats#get-all-statistics // //meta:operation GET /enterprise/stats/all func (s *AdminService) GetAdminStats(ctx context.Context) (*AdminStats, *Response, error) { diff --git a/github/admin_users.go b/github/admin_users.go index 70a7b300442..843a177be96 100644 --- a/github/admin_users.go +++ b/github/admin_users.go @@ -20,7 +20,7 @@ type CreateUserRequest struct { // CreateUser creates a new user in GitHub Enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#create-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/users#create-a-user // //meta:operation POST /admin/users func (s *AdminService) CreateUser(ctx context.Context, userReq CreateUserRequest) (*User, *Response, error) { @@ -42,7 +42,7 @@ func (s *AdminService) CreateUser(ctx context.Context, userReq CreateUserRequest // DeleteUser deletes a user in GitHub Enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#delete-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/users#delete-a-user // //meta:operation DELETE /admin/users/{username} func (s *AdminService) DeleteUser(ctx context.Context, username string) (*Response, error) { @@ -95,7 +95,7 @@ type UserAuthorization struct { // CreateUserImpersonation creates an impersonation OAuth token. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#create-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/users#create-an-impersonation-oauth-token // //meta:operation POST /admin/users/{username}/authorizations func (s *AdminService) CreateUserImpersonation(ctx context.Context, username string, opts *ImpersonateUserOptions) (*UserAuthorization, *Response, error) { @@ -117,7 +117,7 @@ func (s *AdminService) CreateUserImpersonation(ctx context.Context, username str // DeleteUserImpersonation deletes an impersonation OAuth token. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#delete-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/users#delete-an-impersonation-oauth-token // //meta:operation DELETE /admin/users/{username}/authorizations func (s *AdminService) DeleteUserImpersonation(ctx context.Context, username string) (*Response, error) { diff --git a/github/authorizations.go b/github/authorizations.go index 7db45553292..6f22e40a16a 100644 --- a/github/authorizations.go +++ b/github/authorizations.go @@ -257,7 +257,7 @@ func (s *AuthorizationsService) DeleteGrant(ctx context.Context, clientID, acces // you can e.g. create or delete a user's public SSH key. NOTE: creating a // new token automatically revokes an existing one. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#create-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/users#create-an-impersonation-oauth-token // //meta:operation POST /admin/users/{username}/authorizations func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, username string, authReq *AuthorizationRequest) (*Authorization, *Response, error) { @@ -279,7 +279,7 @@ func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, usernam // // NOTE: there can be only one at a time. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#delete-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/users#delete-an-impersonation-oauth-token // //meta:operation DELETE /admin/users/{username}/authorizations func (s *AuthorizationsService) DeleteImpersonation(ctx context.Context, username string) (*Response, error) { diff --git a/github/enterprise_manage_ghes.go b/github/enterprise_manage_ghes.go index a796791c42c..c5e38386a1f 100644 --- a/github/enterprise_manage_ghes.go +++ b/github/enterprise_manage_ghes.go @@ -74,7 +74,7 @@ type ReleaseVersion struct { // CheckSystemRequirements checks if GHES system nodes meet the system requirements. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-system-requirement-check-results-for-configured-cluster-nodes +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-the-system-requirement-check-results-for-configured-cluster-nodes // //meta:operation GET /manage/v1/checks/system-requirements func (s *EnterpriseService) CheckSystemRequirements(ctx context.Context) (*SystemRequirements, *Response, error) { @@ -95,7 +95,7 @@ func (s *EnterpriseService) CheckSystemRequirements(ctx context.Context) (*Syste // ClusterStatus gets the status of all services running on each cluster node. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-cluster-nodes +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-cluster-nodes // //meta:operation GET /manage/v1/cluster/status func (s *EnterpriseService) ClusterStatus(ctx context.Context) (*ClusterStatus, *Response, error) { @@ -116,7 +116,7 @@ func (s *EnterpriseService) ClusterStatus(ctx context.Context) (*ClusterStatus, // ReplicationStatus gets the status of all services running on each replica node. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-replica-nodes +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-replica-nodes // //meta:operation GET /manage/v1/replication/status func (s *EnterpriseService) ReplicationStatus(ctx context.Context, opts *NodeQueryOptions) (*ClusterStatus, *Response, error) { @@ -140,7 +140,7 @@ func (s *EnterpriseService) ReplicationStatus(ctx context.Context, opts *NodeQue // GetNodeReleaseVersions gets the version information deployed to each node. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-all-ghes-release-versions-for-all-nodes +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-all-ghes-release-versions-for-all-nodes // //meta:operation GET /manage/v1/version func (s *EnterpriseService) GetNodeReleaseVersions(ctx context.Context, opts *NodeQueryOptions) ([]*NodeReleaseVersion, *Response, error) { diff --git a/github/enterprise_manage_ghes_config.go b/github/enterprise_manage_ghes_config.go index d675aeca07c..ded48ddc704 100644 --- a/github/enterprise_manage_ghes_config.go +++ b/github/enterprise_manage_ghes_config.go @@ -305,7 +305,7 @@ type NodeDetails struct { // ConfigApplyEvents gets events from the command ghe-config-apply. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#list-events-from-ghe-config-apply +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#list-events-from-ghe-config-apply // //meta:operation GET /manage/v1/config/apply/events func (s *EnterpriseService) ConfigApplyEvents(ctx context.Context, opts *ConfigApplyEventsOptions) (*ConfigApplyEvents, *Response, error) { @@ -330,7 +330,7 @@ func (s *EnterpriseService) ConfigApplyEvents(ctx context.Context, opts *ConfigA // InitialConfig initializes the GitHub Enterprise instance with a license and password. // After initializing the instance, you need to run an apply to apply the configuration. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#initialize-instance-configuration-with-license-and-password +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#initialize-instance-configuration-with-license-and-password // //meta:operation POST /manage/v1/config/init func (s *EnterpriseService) InitialConfig(ctx context.Context, license, password string) (*Response, error) { @@ -351,7 +351,7 @@ func (s *EnterpriseService) InitialConfig(ctx context.Context, license, password // License gets the current license information for the GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-enterprise-license-information +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-the-enterprise-license-information // //meta:operation GET /manage/v1/config/license func (s *EnterpriseService) License(ctx context.Context) ([]*LicenseStatus, *Response, error) { @@ -372,7 +372,7 @@ func (s *EnterpriseService) License(ctx context.Context) ([]*LicenseStatus, *Res // UploadLicense uploads a new license to the GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#upload-an-enterprise-license +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#upload-an-enterprise-license // //meta:operation PUT /manage/v1/config/license func (s *EnterpriseService) UploadLicense(ctx context.Context, license string) (*Response, error) { @@ -390,7 +390,7 @@ func (s *EnterpriseService) UploadLicense(ctx context.Context, license string) ( // LicenseStatus gets the current license status for the GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#check-a-license +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#check-a-license // //meta:operation GET /manage/v1/config/license/check func (s *EnterpriseService) LicenseStatus(ctx context.Context) ([]*LicenseCheck, *Response, error) { @@ -412,7 +412,7 @@ func (s *EnterpriseService) LicenseStatus(ctx context.Context) ([]*LicenseCheck, // NodeMetadata gets the metadata for all nodes in the GitHub Enterprise instance. // This is required for clustered setups. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-ghes-node-metadata-for-all-nodes +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-ghes-node-metadata-for-all-nodes // //meta:operation GET /manage/v1/config/nodes func (s *EnterpriseService) NodeMetadata(ctx context.Context, opts *NodeQueryOptions) (*NodeMetadataStatus, *Response, error) { @@ -436,7 +436,7 @@ func (s *EnterpriseService) NodeMetadata(ctx context.Context, opts *NodeQueryOpt // Settings gets the current configuration settings for the GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-ghes-settings +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-the-ghes-settings // //meta:operation GET /manage/v1/config/settings func (s *EnterpriseService) Settings(ctx context.Context) (*ConfigSettings, *Response, error) { @@ -457,7 +457,7 @@ func (s *EnterpriseService) Settings(ctx context.Context) (*ConfigSettings, *Res // UpdateSettings updates the configuration settings for the GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#set-settings +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#set-settings // //meta:operation PUT /manage/v1/config/settings func (s *EnterpriseService) UpdateSettings(ctx context.Context, opts *ConfigSettings) (*Response, error) { @@ -476,7 +476,7 @@ func (s *EnterpriseService) UpdateSettings(ctx context.Context, opts *ConfigSett // ConfigApply triggers a configuration apply run on the GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#trigger-a-ghe-config-apply-run +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#trigger-a-ghe-config-apply-run // //meta:operation POST /manage/v1/config/apply func (s *EnterpriseService) ConfigApply(ctx context.Context, opts *ConfigApplyOptions) (*ConfigApplyOptions, *Response, error) { @@ -497,7 +497,7 @@ func (s *EnterpriseService) ConfigApply(ctx context.Context, opts *ConfigApplyOp // ConfigApplyStatus gets the status of a ghe-config-apply run on the GitHub Enterprise instance. // You can request lat one or specific id one. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-status-of-a-ghe-config-apply-run +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-the-status-of-a-ghe-config-apply-run // //meta:operation GET /manage/v1/config/apply func (s *EnterpriseService) ConfigApplyStatus(ctx context.Context, opts *ConfigApplyOptions) (*ConfigApplyStatus, *Response, error) { diff --git a/github/enterprise_manage_ghes_maintenance.go b/github/enterprise_manage_ghes_maintenance.go index 2d7e76b4a16..8b27b32a4a4 100644 --- a/github/enterprise_manage_ghes_maintenance.go +++ b/github/enterprise_manage_ghes_maintenance.go @@ -46,7 +46,7 @@ type MaintenanceOptions struct { // GetMaintenanceStatus gets the status of maintenance mode for all nodes. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-status-of-maintenance-mode +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-the-status-of-maintenance-mode // //meta:operation GET /manage/v1/maintenance func (s *EnterpriseService) GetMaintenanceStatus(ctx context.Context, opts *NodeQueryOptions) ([]*MaintenanceStatus, *Response, error) { @@ -71,7 +71,7 @@ func (s *EnterpriseService) GetMaintenanceStatus(ctx context.Context, opts *Node // CreateMaintenance sets the maintenance mode for the instance. // With the enable parameter we can control to put instance into maintenance mode or not. With false we can disable the maintenance mode. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#set-the-status-of-maintenance-mode +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#set-the-status-of-maintenance-mode // //meta:operation POST /manage/v1/maintenance func (s *EnterpriseService) CreateMaintenance(ctx context.Context, enable bool, opts *MaintenanceOptions) ([]*MaintenanceOperationStatus, *Response, error) { diff --git a/github/enterprise_manage_ghes_ssh.go b/github/enterprise_manage_ghes_ssh.go index e1f20a5c06a..d60f8977939 100644 --- a/github/enterprise_manage_ghes_ssh.go +++ b/github/enterprise_manage_ghes_ssh.go @@ -31,7 +31,7 @@ type ClusterSSHKey struct { // DeleteSSHKey deletes the SSH key from the instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#delete-a-ssh-key +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#delete-a-ssh-key // //meta:operation DELETE /manage/v1/access/ssh func (s *EnterpriseService) DeleteSSHKey(ctx context.Context, key string) ([]*SSHKeyStatus, *Response, error) { @@ -55,7 +55,7 @@ func (s *EnterpriseService) DeleteSSHKey(ctx context.Context, key string) ([]*SS // GetSSHKey gets the SSH keys configured for the instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-configured-ssh-keys +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-the-configured-ssh-keys // //meta:operation GET /manage/v1/access/ssh func (s *EnterpriseService) GetSSHKey(ctx context.Context) ([]*ClusterSSHKey, *Response, error) { @@ -76,7 +76,7 @@ func (s *EnterpriseService) GetSSHKey(ctx context.Context) ([]*ClusterSSHKey, *R // CreateSSHKey adds a new SSH key to the instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#set-a-new-ssh-key +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#set-a-new-ssh-key // //meta:operation POST /manage/v1/access/ssh func (s *EnterpriseService) CreateSSHKey(ctx context.Context, key string) ([]*SSHKeyStatus, *Response, error) { diff --git a/github/repos_prereceive_hooks.go b/github/repos_prereceive_hooks.go index 82f6ba0f729..144d2ec3388 100644 --- a/github/repos_prereceive_hooks.go +++ b/github/repos_prereceive_hooks.go @@ -24,7 +24,7 @@ func (p PreReceiveHook) String() string { // ListPreReceiveHooks lists all pre-receive hooks for the specified repository. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/pre-receive-hooks func (s *RepositoriesService) ListPreReceiveHooks(ctx context.Context, owner, repo string, opts *ListOptions) ([]*PreReceiveHook, *Response, error) { @@ -53,7 +53,7 @@ func (s *RepositoriesService) ListPreReceiveHooks(ctx context.Context, owner, re // GetPreReceiveHook returns a single specified pre-receive hook. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) GetPreReceiveHook(ctx context.Context, owner, repo string, id int64) (*PreReceiveHook, *Response, error) { @@ -77,7 +77,7 @@ func (s *RepositoriesService) GetPreReceiveHook(ctx context.Context, owner, repo // UpdatePreReceiveHook updates a specified pre-receive hook. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository // //meta:operation PATCH /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) UpdatePreReceiveHook(ctx context.Context, owner, repo string, id int64, hook *PreReceiveHook) (*PreReceiveHook, *Response, error) { @@ -101,7 +101,7 @@ func (s *RepositoriesService) UpdatePreReceiveHook(ctx context.Context, owner, r // DeletePreReceiveHook deletes a specified pre-receive hook. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository // //meta:operation DELETE /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) DeletePreReceiveHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { diff --git a/github/users_administration.go b/github/users_administration.go index 67fef61faa4..5d0d4c15e76 100644 --- a/github/users_administration.go +++ b/github/users_administration.go @@ -12,7 +12,7 @@ import ( // PromoteSiteAdmin promotes a user to a site administrator of a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator // //meta:operation PUT /users/{username}/site_admin func (s *UsersService) PromoteSiteAdmin(ctx context.Context, user string) (*Response, error) { @@ -28,7 +28,7 @@ func (s *UsersService) PromoteSiteAdmin(ctx context.Context, user string) (*Resp // DemoteSiteAdmin demotes a user from site administrator of a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#demote-a-site-administrator +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/users#demote-a-site-administrator // //meta:operation DELETE /users/{username}/site_admin func (s *UsersService) DemoteSiteAdmin(ctx context.Context, user string) (*Response, error) { @@ -49,7 +49,7 @@ type UserSuspendOptions struct { // Suspend a user on a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#suspend-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/users#suspend-a-user // //meta:operation PUT /users/{username}/suspended func (s *UsersService) Suspend(ctx context.Context, user string, opts *UserSuspendOptions) (*Response, error) { @@ -65,7 +65,7 @@ func (s *UsersService) Suspend(ctx context.Context, user string, opts *UserSuspe // Unsuspend a user on a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#unsuspend-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/users#unsuspend-a-user // //meta:operation DELETE /users/{username}/suspended func (s *UsersService) Unsuspend(ctx context.Context, user string) (*Response, error) { diff --git a/openapi_operations.yaml b/openapi_operations.yaml index 554916c699f..54e1867b5c8 100644 --- a/openapi_operations.yaml +++ b/openapi_operations.yaml @@ -27,260 +27,260 @@ operation_overrides: documentation_url: https://docs.github.com/rest/pages/pages#request-a-github-pages-build - name: GET /repos/{owner}/{repo}/pages/builds/{build_id} documentation_url: https://docs.github.com/rest/pages/pages#get-github-pages-build -openapi_commit: dd7e0cab3399025166a33575ce09af6ff60bb26a +openapi_commit: 0956844c50850685dce43634d73a69f4dac7989e openapi_operations: - name: GET / documentation_url: https://docs.github.com/rest/meta/meta#github-api-root openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /admin/hooks - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/global-webhooks#list-global-webhooks + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/global-webhooks#list-global-webhooks openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /admin/hooks - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/global-webhooks#create-a-global-webhook + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/global-webhooks#create-a-global-webhook openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /admin/hooks/{hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/global-webhooks#delete-a-global-webhook + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/global-webhooks#delete-a-global-webhook openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /admin/hooks/{hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/global-webhooks#get-a-global-webhook + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/global-webhooks#get-a-global-webhook openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /admin/hooks/{hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/global-webhooks#update-a-global-webhook + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/global-webhooks#update-a-global-webhook openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /admin/hooks/{hook_id}/pings - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/global-webhooks#ping-a-global-webhook + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/global-webhooks#ping-a-global-webhook openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /admin/keys - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#list-public-keys + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/users#list-public-keys openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /admin/keys/{key_ids} - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#delete-a-public-key + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/users#delete-a-public-key openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /admin/ldap/teams/{team_id}/mapping - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /admin/ldap/teams/{team_id}/sync - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/ldap#sync-ldap-mapping-for-a-team + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/ldap#sync-ldap-mapping-for-a-team openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /admin/ldap/users/{username}/mapping - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /admin/ldap/users/{username}/sync - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/ldap#sync-ldap-mapping-for-a-user + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/ldap#sync-ldap-mapping-for-a-user openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /admin/organizations - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/orgs#create-an-organization + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/orgs#create-an-organization openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /admin/organizations/{org} - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/orgs#update-an-organization-name + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/orgs#update-an-organization-name openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /admin/pre-receive-environments - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/pre-receive-environments#list-pre-receive-environments + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/pre-receive-environments#list-pre-receive-environments openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /admin/pre-receive-environments - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/pre-receive-environments#create-a-pre-receive-environment + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/pre-receive-environments#create-a-pre-receive-environment openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /admin/pre-receive-environments/{pre_receive_environment_id} - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/pre-receive-environments#delete-a-pre-receive-environment + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/pre-receive-environments#delete-a-pre-receive-environment openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /admin/pre-receive-environments/{pre_receive_environment_id} - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/pre-receive-environments#get-a-pre-receive-environment + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/pre-receive-environments#get-a-pre-receive-environment openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /admin/pre-receive-environments/{pre_receive_environment_id} - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/pre-receive-environments#update-a-pre-receive-environment + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/pre-receive-environments#update-a-pre-receive-environment openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /admin/pre-receive-environments/{pre_receive_environment_id}/downloads - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/pre-receive-environments#start-a-pre-receive-environment-download + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/pre-receive-environments#start-a-pre-receive-environment-download openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /admin/pre-receive-environments/{pre_receive_environment_id}/downloads/latest - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/pre-receive-environments#get-the-download-status-for-a-pre-receive-environment + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/pre-receive-environments#get-the-download-status-for-a-pre-receive-environment openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /admin/pre-receive-hooks - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/pre-receive-hooks#list-pre-receive-hooks + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/pre-receive-hooks#list-pre-receive-hooks openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /admin/pre-receive-hooks - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/pre-receive-hooks#create-a-pre-receive-hook + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/pre-receive-hooks#create-a-pre-receive-hook openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /admin/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/pre-receive-hooks#delete-a-pre-receive-hook + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/pre-receive-hooks#delete-a-pre-receive-hook openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /admin/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/pre-receive-hooks#get-a-pre-receive-hook + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/pre-receive-hooks#get-a-pre-receive-hook openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /admin/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/pre-receive-hooks#update-a-pre-receive-hook + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/pre-receive-hooks#update-a-pre-receive-hook openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /admin/tokens - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#list-personal-access-tokens + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/users#list-personal-access-tokens openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /admin/tokens/{token_id} - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#delete-a-personal-access-token + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/users#delete-a-personal-access-token openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /admin/users - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#create-a-user + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/users#create-a-user openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /admin/users/{username} - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#delete-a-user + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/users#delete-a-user openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /admin/users/{username} - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#update-the-username-for-a-user + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/users#update-the-username-for-a-user openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /admin/users/{username}/authorizations - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#delete-an-impersonation-oauth-token + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/users#delete-an-impersonation-oauth-token openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /admin/users/{username}/authorizations - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#create-an-impersonation-oauth-token + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/users#create-an-impersonation-oauth-token openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /advisories documentation_url: https://docs.github.com/rest/security-advisories/global-advisories#list-global-security-advisories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /advisories/{ghsa_id} documentation_url: https://docs.github.com/rest/security-advisories/global-advisories#get-a-global-security-advisory openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /app documentation_url: https://docs.github.com/rest/apps/apps#get-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /app-manifests/{code}/conversions documentation_url: https://docs.github.com/rest/apps/apps#create-a-github-app-from-a-manifest openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /app/hook/config documentation_url: https://docs.github.com/rest/apps/webhooks#get-a-webhook-configuration-for-an-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /app/hook/config documentation_url: https://docs.github.com/rest/apps/webhooks#update-a-webhook-configuration-for-an-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /app/hook/deliveries documentation_url: https://docs.github.com/rest/apps/webhooks#list-deliveries-for-an-app-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /app/hook/deliveries/{delivery_id} documentation_url: https://docs.github.com/rest/apps/webhooks#get-a-delivery-for-an-app-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /app/hook/deliveries/{delivery_id}/attempts documentation_url: https://docs.github.com/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /app/installation-requests documentation_url: https://docs.github.com/rest/apps/apps#list-installation-requests-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /app/installations documentation_url: https://docs.github.com/rest/apps/apps#list-installations-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /app/installations/{installation_id} documentation_url: https://docs.github.com/rest/apps/apps#delete-an-installation-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /app/installations/{installation_id} documentation_url: https://docs.github.com/rest/apps/apps#get-an-installation-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /app/installations/{installation_id}/access_tokens documentation_url: https://docs.github.com/rest/apps/apps#create-an-installation-access-token-for-an-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /app/installations/{installation_id}/suspended documentation_url: https://docs.github.com/rest/apps/apps#unsuspend-an-app-installation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /app/installations/{installation_id}/suspended documentation_url: https://docs.github.com/rest/apps/apps#suspend-an-app-installation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /applications/grants - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/oauth-authorizations/oauth-authorizations#list-your-grants + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/oauth-authorizations/oauth-authorizations#list-your-grants openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /applications/grants/{grant_id} - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/oauth-authorizations/oauth-authorizations#delete-a-grant + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/oauth-authorizations/oauth-authorizations#delete-a-grant openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /applications/grants/{grant_id} - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/oauth-authorizations/oauth-authorizations#get-a-single-grant + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/oauth-authorizations/oauth-authorizations#get-a-single-grant openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /applications/{client_id}/grant documentation_url: https://docs.github.com/rest/apps/oauth-applications#delete-an-app-authorization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /applications/{client_id}/grants/{access_token} documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#revoke-a-grant-for-an-application openapi_files: @@ -290,25 +290,25 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /applications/{client_id}/token documentation_url: https://docs.github.com/rest/apps/oauth-applications#reset-a-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /applications/{client_id}/token documentation_url: https://docs.github.com/rest/apps/oauth-applications#check-a-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /applications/{client_id}/token/scoped documentation_url: https://docs.github.com/rest/apps/apps#create-a-scoped-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /applications/{client_id}/tokens/{access_token} documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#revoke-an-authorization-for-an-application openapi_files: @@ -326,7 +326,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /assignments/{assignment_id} documentation_url: https://docs.github.com/rest/classroom/classroom#get-an-assignment openapi_files: @@ -343,33 +343,33 @@ openapi_operations: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: GET /authorizations - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/oauth-authorizations/oauth-authorizations#list-your-authorizations + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/oauth-authorizations/oauth-authorizations#list-your-authorizations openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /authorizations - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/oauth-authorizations/oauth-authorizations#create-a-new-authorization + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/oauth-authorizations/oauth-authorizations#create-a-new-authorization openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /authorizations/clients/{client_id} - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/oauth-authorizations/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/oauth-authorizations/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /authorizations/clients/{client_id}/{fingerprint} - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/oauth-authorizations/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app-and-fingerprint + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/oauth-authorizations/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app-and-fingerprint openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /authorizations/{authorization_id} - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/oauth-authorizations/oauth-authorizations#delete-an-authorization + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/oauth-authorizations/oauth-authorizations#delete-an-authorization openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /authorizations/{authorization_id} - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/oauth-authorizations/oauth-authorizations#get-a-single-authorization + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/oauth-authorizations/oauth-authorizations#get-a-single-authorization openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /authorizations/{authorization_id} - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/oauth-authorizations/oauth-authorizations#update-an-existing-authorization + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/oauth-authorizations/oauth-authorizations#update-an-existing-authorization openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /classrooms documentation_url: https://docs.github.com/rest/classroom/classroom#list-classrooms openapi_files: @@ -390,100 +390,105 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /codes_of_conduct/{key} documentation_url: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-a-code-of-conduct openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json + - name: POST /credentials/revoke + documentation_url: https://docs.github.com/rest/credentials/revoke#revoke-a-list-of-credentials + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /emojis documentation_url: https://docs.github.com/rest/emojis/emojis#get-emojis openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprise-installation/{enterprise_or_org}/server-statistics documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/admin-stats#get-github-enterprise-server-statistics openapi_files: - descriptions/ghec/ghec.json - name: DELETE /enterprise/announcement - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/announcement#remove-the-global-announcement-banner + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/announcement#remove-the-global-announcement-banner openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprise/announcement - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/announcement#get-the-global-announcement-banner + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/announcement#get-the-global-announcement-banner openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /enterprise/announcement - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/announcement#set-the-global-announcement-banner + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/announcement#set-the-global-announcement-banner openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprise/settings/license - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/license#get-license-information + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/license#get-license-information openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprise/stats/all - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/admin-stats#get-all-statistics + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/admin-stats#get-all-statistics openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprise/stats/comments - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/admin-stats#get-comment-statistics + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/admin-stats#get-comment-statistics openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprise/stats/gists - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/admin-stats#get-gist-statistics + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/admin-stats#get-gist-statistics openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprise/stats/hooks - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/admin-stats#get-hooks-statistics + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/admin-stats#get-hooks-statistics openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprise/stats/issues - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/admin-stats#get-issue-statistics + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/admin-stats#get-issue-statistics openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprise/stats/milestones - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/admin-stats#get-milestone-statistics + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/admin-stats#get-milestone-statistics openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprise/stats/orgs - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/admin-stats#get-organization-statistics + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/admin-stats#get-organization-statistics openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprise/stats/pages - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/admin-stats#get-pages-statistics + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/admin-stats#get-pages-statistics openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprise/stats/pulls - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/admin-stats#get-pull-request-statistics + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/admin-stats#get-pull-request-statistics openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprise/stats/repos - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/admin-stats#get-repository-statistics + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/admin-stats#get-repository-statistics openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprise/stats/security-products - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/admin-stats#get-security-products-statistics + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/admin-stats#get-security-products-statistics openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprise/stats/users - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/admin-stats#get-users-statistics + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/admin-stats#get-users-statistics openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprises/{enterprise}/actions/cache/usage documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/cache#get-github-actions-cache-usage-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprises/{enterprise}/actions/cache/usage-policy - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/actions/cache#get-github-actions-cache-usage-policy-for-an-enterprise + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/actions/cache#get-github-actions-cache-usage-policy-for-an-enterprise openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /enterprises/{enterprise}/actions/cache/usage-policy - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/actions/cache#set-github-actions-cache-usage-policy-for-an-enterprise + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/actions/cache#set-github-actions-cache-usage-policy-for-an-enterprise openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprises/{enterprise}/actions/hosted-runners documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/hosted-runners#list-github-hosted-runners-for-an-enterprise openapi_files: @@ -532,177 +537,177 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-github-actions-permissions-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /enterprises/{enterprise}/actions/permissions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-github-actions-permissions-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprises/{enterprise}/actions/permissions/organizations documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#list-selected-organizations-enabled-for-github-actions-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /enterprises/{enterprise}/actions/permissions/organizations documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-selected-organizations-enabled-for-github-actions-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#disable-a-selected-organization-for-github-actions-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#enable-a-selected-organization-for-github-actions-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprises/{enterprise}/actions/permissions/selected-actions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /enterprises/{enterprise}/actions/permissions/selected-actions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprises/{enterprise}/actions/permissions/workflow documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-default-workflow-permissions-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /enterprises/{enterprise}/actions/permissions/workflow documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-default-workflow-permissions-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprises/{enterprise}/actions/runner-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /enterprises/{enterprise}/actions/runner-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-organization-access-to-a-self-hosted-runner-group-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-organization-access-for-a-self-hosted-runner-group-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-organization-access-to-a-self-hosted-runner-group-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-organization-access-to-a-self-hosted-runner-group-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprises/{enterprise}/actions/runners documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprises/{enterprise}/actions/runners/downloads documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#list-runner-applications-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /enterprises/{enterprise}/actions/runners/generate-jitconfig documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /enterprises/{enterprise}/actions/runners/registration-token documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#create-a-registration-token-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /enterprises/{enterprise}/actions/runners/remove-token documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#create-a-remove-token-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /enterprises/{enterprise}/actions/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprises/{enterprise}/actions/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprises/{enterprise}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /enterprises/{enterprise}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /enterprises/{enterprise}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels/{name} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#remove-a-custom-label-from-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /enterprises/{enterprise}/announcement documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/enterprises#remove-announcement-banner-from-enterprise openapi_files: @@ -719,37 +724,37 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#get-the-audit-log-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprises/{enterprise}/audit-log/stream-key documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#get-the-audit-log-stream-key-for-encrypting-secrets openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprises/{enterprise}/audit-log/streams documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#list-audit-log-stream-configurations-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /enterprises/{enterprise}/audit-log/streams documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#create-an-audit-log-streaming-configuration-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /enterprises/{enterprise}/audit-log/streams/{stream_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#delete-an-audit-log-streaming-configuration-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprises/{enterprise}/audit-log/streams/{stream_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#list-one-audit-log-streaming-configuration-via-a-stream-id openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /enterprises/{enterprise}/audit-log/streams/{stream_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#update-an-existing-audit-log-stream-configuration openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprises/{enterprise}/bypass-requests/push-rules documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/bypass-requests#list-push-rule-bypass-requests-within-an-enterprise openapi_files: @@ -758,71 +763,71 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprises/{enterprise}/code-security/configurations documentation_url: https://docs.github.com/rest/code-security/configurations#get-code-security-configurations-for-an-enterprise openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /enterprises/{enterprise}/code-security/configurations documentation_url: https://docs.github.com/rest/code-security/configurations#create-a-code-security-configuration-for-an-enterprise openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprises/{enterprise}/code-security/configurations/defaults documentation_url: https://docs.github.com/rest/code-security/configurations#get-default-code-security-configurations-for-an-enterprise openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id} documentation_url: https://docs.github.com/rest/code-security/configurations#delete-a-code-security-configuration-for-an-enterprise openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprises/{enterprise}/code-security/configurations/{configuration_id} documentation_url: https://docs.github.com/rest/code-security/configurations#retrieve-a-code-security-configuration-of-an-enterprise openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id} documentation_url: https://docs.github.com/rest/code-security/configurations#update-a-custom-code-security-configuration-for-an-enterprise openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach documentation_url: https://docs.github.com/rest/code-security/configurations#attach-an-enterprise-configuration-to-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults documentation_url: https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-enterprise openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories documentation_url: https://docs.github.com/rest/code-security/configurations#get-repositories-associated-with-an-enterprise-code-security-configuration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprises/{enterprise}/code_security_and_analysis documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#get-code-security-and-analysis-features-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /enterprises/{enterprise}/code_security_and_analysis documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#update-code-security-and-analysis-features-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprises/{enterprise}/consumed-licenses documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/license#list-enterprise-consumed-licenses openapi_files: @@ -835,16 +840,12 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - name: GET /enterprises/{enterprise}/copilot/usage - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-enterprise-members - openapi_files: - - descriptions/ghec/ghec.json - name: GET /enterprises/{enterprise}/dependabot/alerts documentation_url: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-enterprise openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprises/{enterprise}/license-sync-status documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/license#get-a-license-sync-status openapi_files: @@ -926,7 +927,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprises/{enterprise}/settings/billing/actions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#get-github-actions-billing-for-an-enterprise openapi_files: @@ -935,7 +936,7 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#get-github-advanced-security-active-committers-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /enterprises/{enterprise}/settings/billing/cost-centers documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#get-all-cost-centers-for-an-enterprise openapi_files: @@ -964,271 +965,267 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise-team openapi_files: - descriptions/ghec/ghec.json - - name: GET /enterprises/{enterprise}/team/{team_slug}/copilot/usage - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-an-enterprise-team - openapi_files: - - descriptions/ghec/ghec.json - name: POST /enterprises/{enterprise}/{security_product}/{enablement} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#enable-or-disable-a-security-feature openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /events documentation_url: https://docs.github.com/rest/activity/events#list-public-events openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /feeds documentation_url: https://docs.github.com/rest/activity/feeds#get-feeds openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /gists documentation_url: https://docs.github.com/rest/gists/gists#list-gists-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /gists documentation_url: https://docs.github.com/rest/gists/gists#create-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /gists/public documentation_url: https://docs.github.com/rest/gists/gists#list-public-gists openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /gists/starred documentation_url: https://docs.github.com/rest/gists/gists#list-starred-gists openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /gists/{gist_id} documentation_url: https://docs.github.com/rest/gists/gists#delete-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /gists/{gist_id} documentation_url: https://docs.github.com/rest/gists/gists#get-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /gists/{gist_id} documentation_url: https://docs.github.com/rest/gists/gists#update-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /gists/{gist_id}/comments documentation_url: https://docs.github.com/rest/gists/comments#list-gist-comments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /gists/{gist_id}/comments documentation_url: https://docs.github.com/rest/gists/comments#create-a-gist-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /gists/{gist_id}/comments/{comment_id} documentation_url: https://docs.github.com/rest/gists/comments#delete-a-gist-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /gists/{gist_id}/comments/{comment_id} documentation_url: https://docs.github.com/rest/gists/comments#get-a-gist-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /gists/{gist_id}/comments/{comment_id} documentation_url: https://docs.github.com/rest/gists/comments#update-a-gist-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /gists/{gist_id}/commits documentation_url: https://docs.github.com/rest/gists/gists#list-gist-commits openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /gists/{gist_id}/forks documentation_url: https://docs.github.com/rest/gists/gists#list-gist-forks openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /gists/{gist_id}/forks documentation_url: https://docs.github.com/rest/gists/gists#fork-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /gists/{gist_id}/star documentation_url: https://docs.github.com/rest/gists/gists#unstar-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /gists/{gist_id}/star documentation_url: https://docs.github.com/rest/gists/gists#check-if-a-gist-is-starred openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /gists/{gist_id}/star documentation_url: https://docs.github.com/rest/gists/gists#star-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /gists/{gist_id}/{sha} documentation_url: https://docs.github.com/rest/gists/gists#get-a-gist-revision openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /gitignore/templates documentation_url: https://docs.github.com/rest/gitignore/gitignore#get-all-gitignore-templates openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /gitignore/templates/{name} documentation_url: https://docs.github.com/rest/gitignore/gitignore#get-a-gitignore-template openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /installation/repositories documentation_url: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-app-installation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /installation/token documentation_url: https://docs.github.com/rest/apps/installations#revoke-an-installation-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /issues documentation_url: https://docs.github.com/rest/issues/issues#list-issues-assigned-to-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /licenses documentation_url: https://docs.github.com/rest/licenses/licenses#get-all-commonly-used-licenses openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /licenses/{license} documentation_url: https://docs.github.com/rest/licenses/licenses#get-a-license openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /manage/v1/access/ssh - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#delete-a-ssh-key + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#delete-a-ssh-key openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /manage/v1/access/ssh - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-configured-ssh-keys + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-the-configured-ssh-keys openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /manage/v1/access/ssh - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#set-a-new-ssh-key + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#set-a-new-ssh-key openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /manage/v1/checks/system-requirements - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-system-requirement-check-results-for-configured-cluster-nodes + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-the-system-requirement-check-results-for-configured-cluster-nodes openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /manage/v1/cluster/status - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-cluster-nodes + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-cluster-nodes openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /manage/v1/config/apply - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-status-of-a-ghe-config-apply-run + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-the-status-of-a-ghe-config-apply-run openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /manage/v1/config/apply - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#trigger-a-ghe-config-apply-run + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#trigger-a-ghe-config-apply-run openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /manage/v1/config/apply/events - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#list-events-from-ghe-config-apply + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#list-events-from-ghe-config-apply openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /manage/v1/config/init - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#initialize-instance-configuration-with-license-and-password + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#initialize-instance-configuration-with-license-and-password openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /manage/v1/config/license - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-enterprise-license-information + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-the-enterprise-license-information openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /manage/v1/config/license - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#upload-an-enterprise-license + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#upload-an-enterprise-license openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /manage/v1/config/license/check - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#check-a-license + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#check-a-license openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /manage/v1/config/nodes - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-ghes-node-metadata-for-all-nodes + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-ghes-node-metadata-for-all-nodes openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /manage/v1/config/settings - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-ghes-settings + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-the-ghes-settings openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /manage/v1/config/settings - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#set-settings + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#set-settings openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /manage/v1/maintenance - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-status-of-maintenance-mode + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-the-status-of-maintenance-mode openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /manage/v1/maintenance - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#set-the-status-of-maintenance-mode + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#set-the-status-of-maintenance-mode openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /manage/v1/replication/status - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-replica-nodes + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-replica-nodes openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /manage/v1/version - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-all-ghes-release-versions-for-all-nodes + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-all-ghes-release-versions-for-all-nodes openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /markdown documentation_url: https://docs.github.com/rest/markdown/markdown#render-a-markdown-document openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /markdown/raw documentation_url: https://docs.github.com/rest/markdown/markdown#render-a-markdown-document-in-raw-mode openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /marketplace_listing/accounts/{account_id} documentation_url: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account openapi_files: @@ -1264,78 +1261,78 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /networks/{owner}/{repo}/events documentation_url: https://docs.github.com/rest/activity/events#list-public-events-for-a-network-of-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /notifications documentation_url: https://docs.github.com/rest/activity/notifications#list-notifications-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /notifications documentation_url: https://docs.github.com/rest/activity/notifications#mark-notifications-as-read openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /notifications/threads/{thread_id} documentation_url: https://docs.github.com/rest/activity/notifications#mark-a-thread-as-done openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /notifications/threads/{thread_id} documentation_url: https://docs.github.com/rest/activity/notifications#get-a-thread openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /notifications/threads/{thread_id} documentation_url: https://docs.github.com/rest/activity/notifications#mark-a-thread-as-read openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /notifications/threads/{thread_id}/subscription documentation_url: https://docs.github.com/rest/activity/notifications#delete-a-thread-subscription openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /notifications/threads/{thread_id}/subscription documentation_url: https://docs.github.com/rest/activity/notifications#get-a-thread-subscription-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /notifications/threads/{thread_id}/subscription documentation_url: https://docs.github.com/rest/activity/notifications#set-a-thread-subscription openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /octocat documentation_url: https://docs.github.com/rest/meta/meta#get-octocat openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /organizations documentation_url: https://docs.github.com/rest/orgs/orgs#list-organizations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /organizations/{organization_id}/custom_roles documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#closing-down---list-custom-repository-roles-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /organizations/{org}/settings/billing/usage documentation_url: https://docs.github.com/rest/billing/enhanced-billing#get-billing-usage-report-for-an-organization openapi_files: @@ -1346,31 +1343,31 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org} documentation_url: https://docs.github.com/rest/orgs/orgs#get-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /orgs/{org} documentation_url: https://docs.github.com/rest/orgs/orgs#update-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/actions/cache/usage documentation_url: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/actions/cache/usage-by-repository documentation_url: https://docs.github.com/rest/actions/cache#list-repositories-with-github-actions-cache-usage-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/actions/hosted-runners documentation_url: https://docs.github.com/rest/actions/hosted-runners#list-github-hosted-runners-for-an-organization openapi_files: @@ -1426,103 +1423,103 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /orgs/{org}/actions/oidc/customization/sub documentation_url: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/actions/permissions documentation_url: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /orgs/{org}/actions/permissions documentation_url: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/actions/permissions/repositories documentation_url: https://docs.github.com/rest/actions/permissions#list-selected-repositories-enabled-for-github-actions-in-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /orgs/{org}/actions/permissions/repositories documentation_url: https://docs.github.com/rest/actions/permissions#set-selected-repositories-enabled-for-github-actions-in-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/actions/permissions/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/permissions#disable-a-selected-repository-for-github-actions-in-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /orgs/{org}/actions/permissions/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/permissions#enable-a-selected-repository-for-github-actions-in-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/actions/permissions/selected-actions documentation_url: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /orgs/{org}/actions/permissions/selected-actions documentation_url: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/actions/permissions/workflow documentation_url: https://docs.github.com/rest/actions/permissions#get-default-workflow-permissions-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /orgs/{org}/actions/permissions/workflow documentation_url: https://docs.github.com/rest/actions/permissions#set-default-workflow-permissions-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/actions/runner-groups documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /orgs/{org}/actions/runner-groups documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /orgs/{org}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#list-github-hosted-runners-in-a-group-for-an-organization openapi_files: @@ -1533,244 +1530,244 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#set-repository-access-for-a-self-hosted-runner-group-in-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#add-repository-access-to-a-self-hosted-runner-group-in-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/actions/runners documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/actions/runners/downloads documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /orgs/{org}/actions/runners/generate-jitconfig documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /orgs/{org}/actions/runners/registration-token documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /orgs/{org}/actions/runners/remove-token documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/actions/runners/{runner_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/actions/runners/{runner_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /orgs/{org}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /orgs/{org}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-a-custom-label-from-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/actions/secrets documentation_url: https://docs.github.com/rest/actions/secrets#list-organization-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/actions/secrets/public-key documentation_url: https://docs.github.com/rest/actions/secrets#get-an-organization-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#delete-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#get-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /orgs/{org}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/actions/secrets/{secret_name}/repositories documentation_url: https://docs.github.com/rest/actions/secrets#list-selected-repositories-for-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /orgs/{org}/actions/secrets/{secret_name}/repositories documentation_url: https://docs.github.com/rest/actions/secrets#set-selected-repositories-for-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/secrets#remove-selected-repository-from-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/secrets#add-selected-repository-to-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/actions/variables documentation_url: https://docs.github.com/rest/actions/variables#list-organization-variables openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /orgs/{org}/actions/variables documentation_url: https://docs.github.com/rest/actions/variables#create-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#delete-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#get-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /orgs/{org}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#update-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/actions/variables/{name}/repositories documentation_url: https://docs.github.com/rest/actions/variables#list-selected-repositories-for-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /orgs/{org}/actions/variables/{name}/repositories documentation_url: https://docs.github.com/rest/actions/variables#set-selected-repositories-for-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/variables#remove-selected-repository-from-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/variables#add-selected-repository-to-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/announcement documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/organizations#remove-announcement-banner-from-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/announcement documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/organizations#get-announcement-banner-for-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /orgs/{org}/announcement documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/organizations#set-announcement-banner-for-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/attestations/{subject_digest} documentation_url: https://docs.github.com/rest/orgs/orgs#list-attestations openapi_files: @@ -1780,7 +1777,7 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/orgs#get-the-audit-log-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/blocks documentation_url: https://docs.github.com/rest/orgs/blocking#list-users-blocked-by-an-organization openapi_files: @@ -1805,76 +1802,103 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/bypass-requests#list-push-rule-bypass-requests-within-an-organization openapi_files: - descriptions/ghec/ghec.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/bypass-requests/secret-scanning documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/secret-scanning/delegated-bypass#list-bypass-requests-for-secret-scanning-for-an-org openapi_files: - descriptions/ghec/ghec.json + - descriptions/ghes-3.17/ghes-3.17.json + - name: GET /orgs/{org}/campaigns + documentation_url: https://docs.github.com/rest/campaigns/campaigns#list-campaigns-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: POST /orgs/{org}/campaigns + documentation_url: https://docs.github.com/rest/campaigns/campaigns#create-a-campaign-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /orgs/{org}/campaigns/{campaign_number} + documentation_url: https://docs.github.com/rest/campaigns/campaigns#delete-a-campaign-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/campaigns/{campaign_number} + documentation_url: https://docs.github.com/rest/campaigns/campaigns#get-a-campaign-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PATCH /orgs/{org}/campaigns/{campaign_number} + documentation_url: https://docs.github.com/rest/campaigns/campaigns#update-a-campaign + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /orgs/{org}/code-scanning/alerts documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/code-security/configurations documentation_url: https://docs.github.com/rest/code-security/configurations#get-code-security-configurations-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /orgs/{org}/code-security/configurations documentation_url: https://docs.github.com/rest/code-security/configurations#create-a-code-security-configuration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/code-security/configurations/defaults documentation_url: https://docs.github.com/rest/code-security/configurations#get-default-code-security-configurations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/code-security/configurations/detach documentation_url: https://docs.github.com/rest/code-security/configurations#detach-configurations-from-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/code-security/configurations/{configuration_id} documentation_url: https://docs.github.com/rest/code-security/configurations#delete-a-code-security-configuration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/code-security/configurations/{configuration_id} documentation_url: https://docs.github.com/rest/code-security/configurations#get-a-code-security-configuration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /orgs/{org}/code-security/configurations/{configuration_id} documentation_url: https://docs.github.com/rest/code-security/configurations#update-a-code-security-configuration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /orgs/{org}/code-security/configurations/{configuration_id}/attach documentation_url: https://docs.github.com/rest/code-security/configurations#attach-a-configuration-to-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults documentation_url: https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories documentation_url: https://docs.github.com/rest/code-security/configurations#get-repositories-associated-with-a-code-security-configuration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/codespaces documentation_url: https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-the-organization openapi_files: @@ -1975,11 +1999,6 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - name: GET /orgs/{org}/copilot/usage - documentation_url: https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-organization-members - openapi_files: - - descriptions/api.github.com/api.github.com.json - - descriptions/ghec/ghec.json - name: GET /orgs/{org}/credential-authorizations documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/orgs#list-saml-sso-authorizations-for-an-organization openapi_files: @@ -1992,27 +2011,27 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /orgs/{org}/custom-repository-roles documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#create-a-custom-repository-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/custom-repository-roles/{role_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#delete-a-custom-repository-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/custom-repository-roles/{role_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#get-a-custom-repository-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /orgs/{org}/custom-repository-roles/{role_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#update-a-custom-repository-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /orgs/{org}/custom_roles documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#closing-down---create-a-custom-role openapi_files: @@ -2034,83 +2053,87 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/dependabot/secrets documentation_url: https://docs.github.com/rest/dependabot/secrets#list-organization-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/dependabot/secrets/public-key documentation_url: https://docs.github.com/rest/dependabot/secrets#get-an-organization-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#delete-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#get-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /orgs/{org}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories documentation_url: https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories documentation_url: https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/dependabot/secrets#add-selected-repository-to-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json + - name: GET /orgs/{org}/dismissal-requests/secret-scanning + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/secret-scanning/alert-dismissal-requests#list-alert-dismissal-requests-for-secret-scanning-for-an-org + openapi_files: + - descriptions/ghec/ghec.json - name: GET /orgs/{org}/docker/conflicts documentation_url: https://docs.github.com/rest/packages/packages#get-list-of-conflicting-packages-during-docker-migration-for-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/events documentation_url: https://docs.github.com/rest/activity/events#list-public-organization-events openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/external-group/{group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#get-an-external-group openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/external-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#list-external-groups-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/failed_invitations documentation_url: https://docs.github.com/rest/orgs/members#list-failed-organization-invitations openapi_files: @@ -2125,67 +2148,67 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /orgs/{org}/hooks documentation_url: https://docs.github.com/rest/orgs/webhooks#create-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/orgs/webhooks#delete-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/orgs/webhooks#get-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /orgs/{org}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/orgs/webhooks#update-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/hooks/{hook_id}/config documentation_url: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /orgs/{org}/hooks/{hook_id}/config documentation_url: https://docs.github.com/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/hooks/{hook_id}/deliveries documentation_url: https://docs.github.com/rest/orgs/webhooks#list-deliveries-for-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id} documentation_url: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-delivery-for-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts documentation_url: https://docs.github.com/rest/orgs/webhooks#redeliver-a-delivery-for-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /orgs/{org}/hooks/{hook_id}/pings documentation_url: https://docs.github.com/rest/orgs/webhooks#ping-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id} documentation_url: https://docs.github.com/rest/orgs/api-insights#get-route-stats-by-actor openapi_files: @@ -2236,13 +2259,13 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/installations documentation_url: https://docs.github.com/rest/orgs/orgs#list-app-installations-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/interaction-limits documentation_url: https://docs.github.com/rest/interactions/orgs#remove-interaction-restrictions-for-an-organization openapi_files: @@ -2303,25 +2326,25 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/members documentation_url: https://docs.github.com/rest/orgs/members#list-organization-members openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/members/{username} documentation_url: https://docs.github.com/rest/orgs/members#remove-an-organization-member openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/members/{username} documentation_url: https://docs.github.com/rest/orgs/members#check-organization-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/members/{username}/codespaces documentation_url: https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-a-user-in-organization openapi_files: @@ -2347,444 +2370,444 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/memberships/{username} documentation_url: https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /orgs/{org}/memberships/{username} documentation_url: https://docs.github.com/rest/orgs/members#set-organization-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/migrations documentation_url: https://docs.github.com/rest/migrations/orgs#list-organization-migrations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /orgs/{org}/migrations documentation_url: https://docs.github.com/rest/migrations/orgs#start-an-organization-migration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/migrations/{migration_id} documentation_url: https://docs.github.com/rest/migrations/orgs#get-an-organization-migration-status openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/migrations/{migration_id}/archive documentation_url: https://docs.github.com/rest/migrations/orgs#delete-an-organization-migration-archive openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/migrations/{migration_id}/archive documentation_url: https://docs.github.com/rest/migrations/orgs#download-an-organization-migration-archive openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock documentation_url: https://docs.github.com/rest/migrations/orgs#unlock-an-organization-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/migrations/{migration_id}/repositories documentation_url: https://docs.github.com/rest/migrations/orgs#list-repositories-in-an-organization-migration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/organization-fine-grained-permissions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/organization-roles#list-organization-fine-grained-permissions-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/organization-roles documentation_url: https://docs.github.com/rest/orgs/organization-roles#get-all-organization-roles-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /orgs/{org}/organization-roles documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/organization-roles#create-a-custom-organization-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/organization-roles/teams/{team_slug} documentation_url: https://docs.github.com/rest/orgs/organization-roles#remove-all-organization-roles-for-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id} documentation_url: https://docs.github.com/rest/orgs/organization-roles#remove-an-organization-role-from-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id} documentation_url: https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/organization-roles/users/{username} documentation_url: https://docs.github.com/rest/orgs/organization-roles#remove-all-organization-roles-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/organization-roles/users/{username}/{role_id} documentation_url: https://docs.github.com/rest/orgs/organization-roles#remove-an-organization-role-from-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /orgs/{org}/organization-roles/users/{username}/{role_id} documentation_url: https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/organization-roles/{role_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/organization-roles#delete-a-custom-organization-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/organization-roles/{role_id} documentation_url: https://docs.github.com/rest/orgs/organization-roles#get-an-organization-role openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /orgs/{org}/organization-roles/{role_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/organization-roles#update-a-custom-organization-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/organization-roles/{role_id}/teams documentation_url: https://docs.github.com/rest/orgs/organization-roles#list-teams-that-are-assigned-to-an-organization-role openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/organization-roles/{role_id}/users documentation_url: https://docs.github.com/rest/orgs/organization-roles#list-users-that-are-assigned-to-an-organization-role openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/outside_collaborators documentation_url: https://docs.github.com/rest/orgs/outside-collaborators#list-outside-collaborators-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/outside_collaborators/{username} documentation_url: https://docs.github.com/rest/orgs/outside-collaborators#remove-outside-collaborator-from-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /orgs/{org}/outside_collaborators/{username} documentation_url: https://docs.github.com/rest/orgs/outside-collaborators#convert-an-organization-member-to-outside-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/packages documentation_url: https://docs.github.com/rest/packages/packages#list-packages-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /orgs/{org}/packages/{package_type}/{package_name}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/packages/{package_type}/{package_name}/versions documentation_url: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#delete-package-version-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-version-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-package-version-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/personal-access-token-requests documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /orgs/{org}/personal-access-token-requests documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#review-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /orgs/{org}/personal-access-token-requests/{pat_request_id} documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#review-a-request-to-access-organization-resources-with-a-fine-grained-personal-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-repositories-requested-to-be-accessed-by-a-fine-grained-personal-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/personal-access-tokens documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-fine-grained-personal-access-tokens-with-access-to-organization-resources openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /orgs/{org}/personal-access-tokens documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#update-the-access-to-organization-resources-via-fine-grained-personal-access-tokens openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /orgs/{org}/personal-access-tokens/{pat_id} documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#update-the-access-a-fine-grained-personal-access-token-has-to-organization-resources openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-repositories-a-fine-grained-personal-access-token-has-access-to openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/pre-receive-hooks - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/org-pre-receive-hooks#list-pre-receive-hooks-for-an-organization + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/org-pre-receive-hooks#list-pre-receive-hooks-for-an-organization openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/org-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-an-organization + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/org-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-an-organization openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/org-pre-receive-hooks#get-a-pre-receive-hook-for-an-organization + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/org-pre-receive-hooks#get-a-pre-receive-hook-for-an-organization openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /orgs/{org}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/org-pre-receive-hooks#update-pre-receive-hook-enforcement-for-an-organization + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/org-pre-receive-hooks#update-pre-receive-hook-enforcement-for-an-organization openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/private-registries documentation_url: https://docs.github.com/rest/private-registries/organization-configurations#list-private-registries-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /orgs/{org}/private-registries documentation_url: https://docs.github.com/rest/private-registries/organization-configurations#create-a-private-registry-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/private-registries/public-key documentation_url: https://docs.github.com/rest/private-registries/organization-configurations#get-private-registries-public-key-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/private-registries/{secret_name} documentation_url: https://docs.github.com/rest/private-registries/organization-configurations#delete-a-private-registry-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/private-registries/{secret_name} documentation_url: https://docs.github.com/rest/private-registries/organization-configurations#get-a-private-registry-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /orgs/{org}/private-registries/{secret_name} documentation_url: https://docs.github.com/rest/private-registries/organization-configurations#update-a-private-registry-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/projects documentation_url: https://docs.github.com/rest/projects/projects#list-organization-projects openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /orgs/{org}/projects documentation_url: https://docs.github.com/rest/projects/projects#create-an-organization-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/properties/schema documentation_url: https://docs.github.com/rest/orgs/custom-properties#get-all-custom-properties-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /orgs/{org}/properties/schema documentation_url: https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-properties-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/properties/schema/{custom_property_name} documentation_url: https://docs.github.com/rest/orgs/custom-properties#remove-a-custom-property-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/properties/schema/{custom_property_name} documentation_url: https://docs.github.com/rest/orgs/custom-properties#get-a-custom-property-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /orgs/{org}/properties/schema/{custom_property_name} documentation_url: https://docs.github.com/rest/orgs/custom-properties#create-or-update-a-custom-property-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/properties/values documentation_url: https://docs.github.com/rest/orgs/custom-properties#list-custom-property-values-for-organization-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /orgs/{org}/properties/values documentation_url: https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-property-values-for-organization-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/public_members documentation_url: https://docs.github.com/rest/orgs/members#list-public-organization-members openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/public_members/{username} documentation_url: https://docs.github.com/rest/orgs/members#remove-public-organization-membership-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/public_members/{username} documentation_url: https://docs.github.com/rest/orgs/members#check-public-organization-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /orgs/{org}/public_members/{username} documentation_url: https://docs.github.com/rest/orgs/members#set-public-organization-membership-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/repos documentation_url: https://docs.github.com/rest/repos/repos#list-organization-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /orgs/{org}/repos documentation_url: https://docs.github.com/rest/repos/repos#create-an-organization-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/repository-fine-grained-permissions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#list-repository-fine-grained-permissions-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/rulesets documentation_url: https://docs.github.com/rest/orgs/rules#get-all-organization-repository-rulesets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /orgs/{org}/rulesets documentation_url: https://docs.github.com/rest/orgs/rules#create-an-organization-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/rulesets/rule-suites documentation_url: https://docs.github.com/rest/orgs/rule-suites#list-organization-rule-suites openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id} documentation_url: https://docs.github.com/rest/orgs/rule-suites#get-an-organization-rule-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/orgs/rules#delete-an-organization-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/orgs/rules#get-an-organization-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /orgs/{org}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/orgs/rules#update-an-organization-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/rulesets/{ruleset_id}/history documentation_url: https://docs.github.com/rest/orgs/rules#get-organization-ruleset-history openapi_files: @@ -2800,7 +2823,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/security-advisories documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories-for-an-organization openapi_files: @@ -2811,19 +2834,19 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/security-managers/teams/{team_slug} documentation_url: https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /orgs/{org}/security-managers/teams/{team_slug} documentation_url: https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/settings/billing/actions documentation_url: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-an-organization openapi_files: @@ -2833,7 +2856,7 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/billing/billing#get-github-advanced-security-active-committers-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/settings/billing/packages documentation_url: https://docs.github.com/rest/billing/billing#get-github-packages-billing-for-an-organization openapi_files: @@ -2883,152 +2906,147 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - name: GET /orgs/{org}/team/{team_slug}/copilot/usage - documentation_url: https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-a-team - openapi_files: - - descriptions/api.github.com/api.github.com.json - - descriptions/ghec/ghec.json - name: GET /orgs/{org}/teams documentation_url: https://docs.github.com/rest/teams/teams#list-teams openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /orgs/{org}/teams documentation_url: https://docs.github.com/rest/teams/teams#create-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/teams/{team_slug} documentation_url: https://docs.github.com/rest/teams/teams#delete-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/teams/{team_slug} documentation_url: https://docs.github.com/rest/teams/teams#get-a-team-by-name openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /orgs/{org}/teams/{team_slug} documentation_url: https://docs.github.com/rest/teams/teams#update-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/teams/{team_slug}/discussions documentation_url: https://docs.github.com/rest/teams/discussions#list-discussions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /orgs/{org}/teams/{team_slug}/discussions documentation_url: https://docs.github.com/rest/teams/discussions#create-a-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#delete-a-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#get-a-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#update-a-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments documentation_url: https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments documentation_url: https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-team-discussion-comment-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-team-discussion-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/teams/{team_slug}/external-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#remove-the-connection-between-an-external-group-and-a-team openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/teams/{team_slug}/external-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#list-a-connection-between-an-external-group-and-a-team openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /orgs/{org}/teams/{team_slug}/external-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#update-the-connection-between-an-external-group-and-a-team openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/teams/{team_slug}/invitations documentation_url: https://docs.github.com/rest/teams/members#list-pending-team-invitations openapi_files: @@ -3039,73 +3057,73 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/teams/{team_slug}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/teams/{team_slug}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#get-team-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /orgs/{org}/teams/{team_slug}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/teams/{team_slug}/projects documentation_url: https://docs.github.com/rest/teams/teams#list-team-projects openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/teams/{team_slug}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /orgs/{org}/teams/{team_slug}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/teams/{team_slug}/repos documentation_url: https://docs.github.com/rest/teams/teams#list-team-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#list-idp-groups-for-a-team openapi_files: @@ -3119,133 +3137,133 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /orgs/{org}/{security_product}/{enablement} documentation_url: https://docs.github.com/rest/orgs/orgs#enable-or-disable-a-security-feature-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /projects/columns/cards/{card_id} documentation_url: https://docs.github.com/rest/projects/cards#delete-a-project-card openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /projects/columns/cards/{card_id} documentation_url: https://docs.github.com/rest/projects/cards#get-a-project-card openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /projects/columns/cards/{card_id} documentation_url: https://docs.github.com/rest/projects/cards#update-an-existing-project-card openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /projects/columns/cards/{card_id}/moves documentation_url: https://docs.github.com/rest/projects/cards#move-a-project-card openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /projects/columns/{column_id} documentation_url: https://docs.github.com/rest/projects/columns#delete-a-project-column openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /projects/columns/{column_id} documentation_url: https://docs.github.com/rest/projects/columns#get-a-project-column openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /projects/columns/{column_id} documentation_url: https://docs.github.com/rest/projects/columns#update-an-existing-project-column openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /projects/columns/{column_id}/cards documentation_url: https://docs.github.com/rest/projects/cards#list-project-cards openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /projects/columns/{column_id}/cards documentation_url: https://docs.github.com/rest/projects/cards#create-a-project-card openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /projects/columns/{column_id}/moves documentation_url: https://docs.github.com/rest/projects/columns#move-a-project-column openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /projects/{project_id} documentation_url: https://docs.github.com/rest/projects/projects#delete-a-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /projects/{project_id} documentation_url: https://docs.github.com/rest/projects/projects#get-a-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /projects/{project_id} documentation_url: https://docs.github.com/rest/projects/projects#update-a-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /projects/{project_id}/collaborators documentation_url: https://docs.github.com/rest/projects/collaborators#list-project-collaborators openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /projects/{project_id}/collaborators/{username} documentation_url: https://docs.github.com/rest/projects/collaborators#remove-user-as-a-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /projects/{project_id}/collaborators/{username} documentation_url: https://docs.github.com/rest/projects/collaborators#add-project-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /projects/{project_id}/collaborators/{username}/permission documentation_url: https://docs.github.com/rest/projects/collaborators#get-project-permission-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /projects/{project_id}/columns documentation_url: https://docs.github.com/rest/projects/columns#list-project-columns openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /projects/{project_id}/columns documentation_url: https://docs.github.com/rest/projects/columns#create-a-project-column openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /rate_limit documentation_url: https://docs.github.com/rest/rate-limit/rate-limit#get-rate-limit-status-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /reactions/{reaction_id} documentation_url: https://docs.github.com/enterprise-server@3.4/rest/reference/reactions/#delete-a-reaction-legacy openapi_files: @@ -3255,261 +3273,261 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/repos/repos#get-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/repos/repos#update-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/artifacts documentation_url: https://docs.github.com/rest/actions/artifacts#list-artifacts-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id} documentation_url: https://docs.github.com/rest/actions/artifacts#delete-an-artifact openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id} documentation_url: https://docs.github.com/rest/actions/artifacts#get-an-artifact openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format} documentation_url: https://docs.github.com/rest/actions/artifacts#download-an-artifact openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/cache/usage documentation_url: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/cache/usage-policy - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/actions/cache#get-github-actions-cache-usage-policy-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/actions/cache#get-github-actions-cache-usage-policy-for-a-repository openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /repos/{owner}/{repo}/actions/cache/usage-policy - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/actions/cache#set-github-actions-cache-usage-policy-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/actions/cache#set-github-actions-cache-usage-policy-for-a-repository openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/actions/caches documentation_url: https://docs.github.com/rest/actions/cache#delete-github-actions-caches-for-a-repository-using-a-cache-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/caches documentation_url: https://docs.github.com/rest/actions/cache#list-github-actions-caches-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/actions/caches/{cache_id} documentation_url: https://docs.github.com/rest/actions/cache#delete-a-github-actions-cache-for-a-repository-using-a-cache-id openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/jobs/{job_id} documentation_url: https://docs.github.com/rest/actions/workflow-jobs#get-a-job-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs documentation_url: https://docs.github.com/rest/actions/workflow-jobs#download-job-logs-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun documentation_url: https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/oidc/customization/sub documentation_url: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /repos/{owner}/{repo}/actions/oidc/customization/sub documentation_url: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/organization-secrets documentation_url: https://docs.github.com/rest/actions/secrets#list-repository-organization-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/organization-variables documentation_url: https://docs.github.com/rest/actions/variables#list-repository-organization-variables openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/permissions documentation_url: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /repos/{owner}/{repo}/actions/permissions documentation_url: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/permissions/access documentation_url: https://docs.github.com/rest/actions/permissions#get-the-level-of-access-for-workflows-outside-of-the-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /repos/{owner}/{repo}/actions/permissions/access documentation_url: https://docs.github.com/rest/actions/permissions#set-the-level-of-access-for-workflows-outside-of-the-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/permissions/selected-actions documentation_url: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /repos/{owner}/{repo}/actions/permissions/selected-actions documentation_url: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/permissions/workflow documentation_url: https://docs.github.com/rest/actions/permissions#get-default-workflow-permissions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /repos/{owner}/{repo}/actions/permissions/workflow documentation_url: https://docs.github.com/rest/actions/permissions#set-default-workflow-permissions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/runners documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/runners/downloads documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/actions/runners/registration-token documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/actions/runners/remove-token documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/actions/runners/{runner_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/runners/{runner_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-a-custom-label-from-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/runs documentation_url: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/actions/runs/{run_id} documentation_url: https://docs.github.com/rest/actions/workflow-runs#delete-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id} documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-the-review-history-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve documentation_url: https://docs.github.com/rest/actions/workflow-runs#approve-a-workflow-run-for-a-fork-pull-request openapi_files: @@ -3520,85 +3538,85 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number} documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run-attempt openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs documentation_url: https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run-attempt openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs documentation_url: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-attempt-logs openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel documentation_url: https://docs.github.com/rest/actions/workflow-runs#cancel-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule documentation_url: https://docs.github.com/rest/actions/workflow-runs#review-custom-deployment-protection-rules-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel documentation_url: https://docs.github.com/rest/actions/workflow-runs#force-cancel-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs documentation_url: https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs documentation_url: https://docs.github.com/rest/actions/workflow-runs#delete-workflow-run-logs openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs documentation_url: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-logs openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-pending-deployments-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments documentation_url: https://docs.github.com/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun documentation_url: https://docs.github.com/rest/actions/workflow-runs#re-run-a-workflow openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs documentation_url: https://docs.github.com/rest/actions/workflow-runs#re-run-failed-jobs-from-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-workflow-run-usage openapi_files: @@ -3609,97 +3627,97 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/secrets/public-key documentation_url: https://docs.github.com/rest/actions/secrets#get-a-repository-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#delete-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#get-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /repos/{owner}/{repo}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#create-or-update-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/variables documentation_url: https://docs.github.com/rest/actions/variables#list-repository-variables openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/actions/variables documentation_url: https://docs.github.com/rest/actions/variables#create-a-repository-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#delete-a-repository-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#get-a-repository-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /repos/{owner}/{repo}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#update-a-repository-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/workflows documentation_url: https://docs.github.com/rest/actions/workflows#list-repository-workflows openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/workflows/{workflow_id} documentation_url: https://docs.github.com/rest/actions/workflows#get-a-workflow openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable documentation_url: https://docs.github.com/rest/actions/workflows#disable-a-workflow openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches documentation_url: https://docs.github.com/rest/actions/workflows#create-a-workflow-dispatch-event openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable documentation_url: https://docs.github.com/rest/actions/workflows#enable-a-workflow openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs documentation_url: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-workflow openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing documentation_url: https://docs.github.com/rest/actions/workflows#get-workflow-usage openapi_files: @@ -3710,19 +3728,19 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/assignees documentation_url: https://docs.github.com/rest/issues/assignees#list-assignees openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/assignees/{assignee} documentation_url: https://docs.github.com/rest/issues/assignees#check-if-a-user-can-be-assigned openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/attestations documentation_url: https://docs.github.com/rest/repos/repos#create-an-attestation openapi_files: @@ -3738,25 +3756,25 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/autolinks documentation_url: https://docs.github.com/rest/repos/autolinks#create-an-autolink-reference-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/autolinks/{autolink_id} documentation_url: https://docs.github.com/rest/repos/autolinks#delete-an-autolink-reference-from-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/autolinks/{autolink_id} documentation_url: https://docs.github.com/rest/repos/autolinks#get-an-autolink-reference-of-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/automated-security-fixes documentation_url: https://docs.github.com/rest/repos/repos#disable-dependabot-security-updates openapi_files: @@ -3767,7 +3785,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /repos/{owner}/{repo}/automated-security-fixes documentation_url: https://docs.github.com/rest/repos/repos#enable-dependabot-security-updates openapi_files: @@ -3778,319 +3796,325 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/branches/{branch} documentation_url: https://docs.github.com/rest/branches/branches#get-a-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection documentation_url: https://docs.github.com/rest/branches/branch-protection#get-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection documentation_url: https://docs.github.com/rest/branches/branch-protection#update-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-admin-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins documentation_url: https://docs.github.com/rest/branches/branch-protection#get-admin-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins documentation_url: https://docs.github.com/rest/branches/branch-protection#set-admin-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-pull-request-review-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews documentation_url: https://docs.github.com/rest/branches/branch-protection#get-pull-request-review-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews documentation_url: https://docs.github.com/rest/branches/branch-protection#update-pull-request-review-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-commit-signature-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures documentation_url: https://docs.github.com/rest/branches/branch-protection#get-commit-signature-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures documentation_url: https://docs.github.com/rest/branches/branch-protection#create-commit-signature-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-status-check-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks documentation_url: https://docs.github.com/rest/branches/branch-protection#get-status-checks-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks documentation_url: https://docs.github.com/rest/branches/branch-protection#update-status-check-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-status-check-contexts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts documentation_url: https://docs.github.com/rest/branches/branch-protection#get-all-status-check-contexts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts documentation_url: https://docs.github.com/rest/branches/branch-protection#add-status-check-contexts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts documentation_url: https://docs.github.com/rest/branches/branch-protection#set-status-check-contexts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions documentation_url: https://docs.github.com/rest/branches/branch-protection#get-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-app-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps documentation_url: https://docs.github.com/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps documentation_url: https://docs.github.com/rest/branches/branch-protection#add-app-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps documentation_url: https://docs.github.com/rest/branches/branch-protection#set-app-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-team-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams documentation_url: https://docs.github.com/rest/branches/branch-protection#get-teams-with-access-to-the-protected-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams documentation_url: https://docs.github.com/rest/branches/branch-protection#add-team-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams documentation_url: https://docs.github.com/rest/branches/branch-protection#set-team-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-user-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users documentation_url: https://docs.github.com/rest/branches/branch-protection#get-users-with-access-to-the-protected-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users documentation_url: https://docs.github.com/rest/branches/branch-protection#add-user-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users documentation_url: https://docs.github.com/rest/branches/branch-protection#set-user-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/branches/{branch}/rename documentation_url: https://docs.github.com/rest/branches/branches#rename-a-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/bypass-requests/push-rules documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/repos/bypass-requests#list-repository-push-rule-bypass-requests openapi_files: - descriptions/ghec/ghec.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/bypass-requests/push-rules/{bypass_request_number} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/repos/bypass-requests#get-a-repository-push-bypass-request openapi_files: - descriptions/ghec/ghec.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/bypass-requests/secret-scanning documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/secret-scanning/delegated-bypass#list-bypass-requests-for-secret-scanning-for-a-repository openapi_files: - descriptions/ghec/ghec.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/bypass-requests/secret-scanning/{bypass_request_number} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/secret-scanning/delegated-bypass#get-a-bypass-request-for-secret-scanning openapi_files: - descriptions/ghec/ghec.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /repos/{owner}/{repo}/bypass-requests/secret-scanning/{bypass_request_number} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/secret-scanning/delegated-bypass#review-a-bypass-request-for-secret-scanning openapi_files: - descriptions/ghec/ghec.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/bypass-responses/secret-scanning/{bypass_response_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/secret-scanning/delegated-bypass#dismiss-a-response-on-a-bypass-request-for-secret-scanning openapi_files: - descriptions/ghec/ghec.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/check-runs documentation_url: https://docs.github.com/rest/checks/runs#create-a-check-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/check-runs/{check_run_id} documentation_url: https://docs.github.com/rest/checks/runs#get-a-check-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /repos/{owner}/{repo}/check-runs/{check_run_id} documentation_url: https://docs.github.com/rest/checks/runs#update-a-check-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations documentation_url: https://docs.github.com/rest/checks/runs#list-check-run-annotations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest documentation_url: https://docs.github.com/rest/checks/runs#rerequest-a-check-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/check-suites documentation_url: https://docs.github.com/rest/checks/suites#create-a-check-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /repos/{owner}/{repo}/check-suites/preferences documentation_url: https://docs.github.com/rest/checks/suites#update-repository-preferences-for-check-suites openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/check-suites/{check_suite_id} documentation_url: https://docs.github.com/rest/checks/suites#get-a-check-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs documentation_url: https://docs.github.com/rest/checks/runs#list-check-runs-in-a-check-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest documentation_url: https://docs.github.com/rest/checks/suites#rerequest-a-check-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/code-scanning/alerts documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-the-status-of-an-autofix-for-a-code-scanning-alert openapi_files: @@ -4111,25 +4135,25 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/code-scanning/analyses documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-analyses-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#delete-a-code-scanning-analysis-from-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/code-scanning/codeql/databases documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-codeql-databases-for-a-repository openapi_files: @@ -4165,37 +4189,37 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /repos/{owner}/{repo}/code-scanning/default-setup documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-default-setup-configuration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/code-scanning/sarifs documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#upload-an-analysis-as-sarif-data openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-information-about-a-sarif-upload openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/code-security-configuration documentation_url: https://docs.github.com/rest/code-security/configurations#get-the-code-security-configuration-associated-with-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/codeowners/errors documentation_url: https://docs.github.com/rest/repos/repos#list-codeowners-errors openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/codespaces documentation_url: https://docs.github.com/rest/codespaces/codespaces#list-codespaces-in-a-repository-for-the-authenticated-user openapi_files: @@ -4256,133 +4280,133 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/collaborators/{username} documentation_url: https://docs.github.com/rest/collaborators/collaborators#remove-a-repository-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/collaborators/{username} documentation_url: https://docs.github.com/rest/collaborators/collaborators#check-if-a-user-is-a-repository-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /repos/{owner}/{repo}/collaborators/{username} documentation_url: https://docs.github.com/rest/collaborators/collaborators#add-a-repository-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/collaborators/{username}/permission documentation_url: https://docs.github.com/rest/collaborators/collaborators#get-repository-permissions-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/comments documentation_url: https://docs.github.com/rest/commits/comments#list-commit-comments-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/comments/{comment_id} documentation_url: https://docs.github.com/rest/commits/comments#delete-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/comments/{comment_id} documentation_url: https://docs.github.com/rest/commits/comments#get-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /repos/{owner}/{repo}/comments/{comment_id} documentation_url: https://docs.github.com/rest/commits/comments#update-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-a-commit-comment-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/commits documentation_url: https://docs.github.com/rest/commits/commits#list-commits openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head documentation_url: https://docs.github.com/rest/commits/commits#list-branches-for-head-commit openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/commits/{commit_sha}/comments documentation_url: https://docs.github.com/rest/commits/comments#list-commit-comments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/commits/{commit_sha}/comments documentation_url: https://docs.github.com/rest/commits/comments#create-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls documentation_url: https://docs.github.com/rest/commits/commits#list-pull-requests-associated-with-a-commit openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/commits/{ref} documentation_url: https://docs.github.com/rest/commits/commits#get-a-commit openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/commits/{ref}/check-runs documentation_url: https://docs.github.com/rest/checks/runs#list-check-runs-for-a-git-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/commits/{ref}/check-suites documentation_url: https://docs.github.com/rest/checks/suites#list-check-suites-for-a-git-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/commits/{ref}/status documentation_url: https://docs.github.com/rest/commits/statuses#get-the-combined-status-for-a-specific-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/commits/{ref}/statuses documentation_url: https://docs.github.com/rest/commits/statuses#list-commit-statuses-for-a-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/community/profile documentation_url: https://docs.github.com/rest/metrics/community#get-community-profile-metrics openapi_files: @@ -4393,7 +4417,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#create-a-content-attachment openapi_files: @@ -4403,451 +4427,463 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/contents/{path} documentation_url: https://docs.github.com/rest/repos/contents#get-repository-content openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /repos/{owner}/{repo}/contents/{path} documentation_url: https://docs.github.com/rest/repos/contents#create-or-update-file-contents openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/contributors documentation_url: https://docs.github.com/rest/repos/repos#list-repository-contributors openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/dependabot/alerts documentation_url: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number} documentation_url: https://docs.github.com/rest/dependabot/alerts#get-a-dependabot-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number} documentation_url: https://docs.github.com/rest/dependabot/alerts#update-a-dependabot-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/dependabot/secrets documentation_url: https://docs.github.com/rest/dependabot/secrets#list-repository-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/dependabot/secrets/public-key documentation_url: https://docs.github.com/rest/dependabot/secrets#get-a-repository-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#delete-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#get-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#create-or-update-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead} documentation_url: https://docs.github.com/rest/dependency-graph/dependency-review#get-a-diff-of-the-dependencies-between-commits openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/dependency-graph/sbom documentation_url: https://docs.github.com/rest/dependency-graph/sboms#export-a-software-bill-of-materials-sbom-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/dependency-graph/snapshots documentation_url: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/deployments documentation_url: https://docs.github.com/rest/deployments/deployments#list-deployments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/deployments documentation_url: https://docs.github.com/rest/deployments/deployments#create-a-deployment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/deployments/{deployment_id} documentation_url: https://docs.github.com/rest/deployments/deployments#delete-a-deployment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/deployments/{deployment_id} documentation_url: https://docs.github.com/rest/deployments/deployments#get-a-deployment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses documentation_url: https://docs.github.com/rest/deployments/statuses#list-deployment-statuses openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses documentation_url: https://docs.github.com/rest/deployments/statuses#create-a-deployment-status openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id} documentation_url: https://docs.github.com/rest/deployments/statuses#get-a-deployment-status openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json + - name: GET /repos/{owner}/{repo}/dismissal-requests/secret-scanning + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/secret-scanning/alert-dismissal-requests#list-alert-dismissal-requests-for-secret-scanning-for-a-repository + openapi_files: + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/dismissal-requests/secret-scanning/{alert_number} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/secret-scanning/alert-dismissal-requests#get-an-alert-dismissal-request-for-secret-scanning + openapi_files: + - descriptions/ghec/ghec.json + - name: PATCH /repos/{owner}/{repo}/dismissal-requests/secret-scanning/{alert_number} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/secret-scanning/alert-dismissal-requests#review-an-alert-dismissal-request-for-secret-scanning + openapi_files: + - descriptions/ghec/ghec.json - name: POST /repos/{owner}/{repo}/dispatches documentation_url: https://docs.github.com/rest/repos/repos#create-a-repository-dispatch-event openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/environments documentation_url: https://docs.github.com/rest/deployments/environments#list-environments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/environments/{environment_name} documentation_url: https://docs.github.com/rest/deployments/environments#delete-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/environments/{environment_name} documentation_url: https://docs.github.com/rest/deployments/environments#get-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /repos/{owner}/{repo}/environments/{environment_name} documentation_url: https://docs.github.com/rest/deployments/environments#create-or-update-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies documentation_url: https://docs.github.com/rest/deployments/branch-policies#list-deployment-branch-policies openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies documentation_url: https://docs.github.com/rest/deployments/branch-policies#create-a-deployment-branch-policy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} documentation_url: https://docs.github.com/rest/deployments/branch-policies#delete-a-deployment-branch-policy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} documentation_url: https://docs.github.com/rest/deployments/branch-policies#get-a-deployment-branch-policy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} documentation_url: https://docs.github.com/rest/deployments/branch-policies#update-a-deployment-branch-policy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules documentation_url: https://docs.github.com/rest/deployments/protection-rules#get-all-deployment-protection-rules-for-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules documentation_url: https://docs.github.com/rest/deployments/protection-rules#create-a-custom-deployment-protection-rule-on-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps documentation_url: https://docs.github.com/rest/deployments/protection-rules#list-custom-deployment-rule-integrations-available-for-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id} documentation_url: https://docs.github.com/rest/deployments/protection-rules#disable-a-custom-protection-rule-for-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id} documentation_url: https://docs.github.com/rest/deployments/protection-rules#get-a-custom-deployment-protection-rule openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/secrets documentation_url: https://docs.github.com/rest/actions/secrets#list-environment-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key documentation_url: https://docs.github.com/rest/actions/secrets#get-an-environment-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#delete-an-environment-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#get-an-environment-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#create-or-update-an-environment-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/variables documentation_url: https://docs.github.com/rest/actions/variables#list-environment-variables openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/environments/{environment_name}/variables documentation_url: https://docs.github.com/rest/actions/variables#create-an-environment-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#delete-an-environment-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#get-an-environment-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#update-an-environment-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/events documentation_url: https://docs.github.com/rest/activity/events#list-repository-events openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/forks documentation_url: https://docs.github.com/rest/repos/forks#list-forks openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/forks documentation_url: https://docs.github.com/rest/repos/forks#create-a-fork openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/git/blobs documentation_url: https://docs.github.com/rest/git/blobs#create-a-blob openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/git/blobs/{file_sha} documentation_url: https://docs.github.com/rest/git/blobs#get-a-blob openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/git/commits documentation_url: https://docs.github.com/rest/git/commits#create-a-commit openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/git/commits/{commit_sha} documentation_url: https://docs.github.com/rest/git/commits#get-a-commit-object openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/git/matching-refs/{ref} documentation_url: https://docs.github.com/rest/git/refs#list-matching-references openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/git/ref/{ref} documentation_url: https://docs.github.com/rest/git/refs#get-a-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/git/refs documentation_url: https://docs.github.com/rest/git/refs#create-a-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/git/refs/{ref} documentation_url: https://docs.github.com/rest/git/refs#delete-a-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /repos/{owner}/{repo}/git/refs/{ref} documentation_url: https://docs.github.com/rest/git/refs#update-a-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/git/tags documentation_url: https://docs.github.com/rest/git/tags#create-a-tag-object openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/git/tags/{tag_sha} documentation_url: https://docs.github.com/rest/git/tags#get-a-tag openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/git/trees documentation_url: https://docs.github.com/rest/git/trees#create-a-tree openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/git/trees/{tree_sha} documentation_url: https://docs.github.com/rest/git/trees#get-a-tree openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/hooks documentation_url: https://docs.github.com/rest/repos/webhooks#list-repository-webhooks openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/hooks documentation_url: https://docs.github.com/rest/repos/webhooks#create-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/repos/webhooks#delete-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/repos/webhooks#get-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /repos/{owner}/{repo}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/repos/webhooks#update-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/hooks/{hook_id}/config documentation_url: https://docs.github.com/rest/repos/webhooks#get-a-webhook-configuration-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config documentation_url: https://docs.github.com/rest/repos/webhooks#update-a-webhook-configuration-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries documentation_url: https://docs.github.com/rest/repos/webhooks#list-deliveries-for-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id} documentation_url: https://docs.github.com/rest/repos/webhooks#get-a-delivery-for-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts documentation_url: https://docs.github.com/rest/repos/webhooks#redeliver-a-delivery-for-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/hooks/{hook_id}/pings documentation_url: https://docs.github.com/rest/repos/webhooks#ping-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/hooks/{hook_id}/tests documentation_url: https://docs.github.com/rest/repos/webhooks#test-the-push-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/import documentation_url: https://docs.github.com/rest/migrations/source-imports#cancel-an-import openapi_files: @@ -4893,7 +4929,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/interaction-limits documentation_url: https://docs.github.com/rest/interactions/repos#remove-interaction-restrictions-for-a-repository openapi_files: @@ -4914,193 +4950,193 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/invitations/{invitation_id} documentation_url: https://docs.github.com/rest/collaborators/invitations#delete-a-repository-invitation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /repos/{owner}/{repo}/invitations/{invitation_id} documentation_url: https://docs.github.com/rest/collaborators/invitations#update-a-repository-invitation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/issues documentation_url: https://docs.github.com/rest/issues/issues#list-repository-issues openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/issues documentation_url: https://docs.github.com/rest/issues/issues#create-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/issues/comments documentation_url: https://docs.github.com/rest/issues/comments#list-issue-comments-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/issues/comments/{comment_id} documentation_url: https://docs.github.com/rest/issues/comments#delete-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/issues/comments/{comment_id} documentation_url: https://docs.github.com/rest/issues/comments#get-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /repos/{owner}/{repo}/issues/comments/{comment_id} documentation_url: https://docs.github.com/rest/issues/comments#update-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-an-issue-comment-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/issues/events documentation_url: https://docs.github.com/rest/issues/events#list-issue-events-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/issues/events/{event_id} documentation_url: https://docs.github.com/rest/issues/events#get-an-issue-event openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/issues/{issue_number} documentation_url: https://docs.github.com/rest/issues/issues#get-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /repos/{owner}/{repo}/issues/{issue_number} documentation_url: https://docs.github.com/rest/issues/issues#update-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees documentation_url: https://docs.github.com/rest/issues/assignees#remove-assignees-from-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/issues/{issue_number}/assignees documentation_url: https://docs.github.com/rest/issues/assignees#add-assignees-to-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee} documentation_url: https://docs.github.com/rest/issues/assignees#check-if-a-user-can-be-assigned-to-a-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/comments documentation_url: https://docs.github.com/rest/issues/comments#list-issue-comments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/issues/{issue_number}/comments documentation_url: https://docs.github.com/rest/issues/comments#create-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/events documentation_url: https://docs.github.com/rest/issues/events#list-issue-events openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels documentation_url: https://docs.github.com/rest/issues/labels#remove-all-labels-from-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/labels documentation_url: https://docs.github.com/rest/issues/labels#list-labels-for-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/issues/{issue_number}/labels documentation_url: https://docs.github.com/rest/issues/labels#add-labels-to-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /repos/{owner}/{repo}/issues/{issue_number}/labels documentation_url: https://docs.github.com/rest/issues/labels#set-labels-for-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name} documentation_url: https://docs.github.com/rest/issues/labels#remove-a-label-from-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock documentation_url: https://docs.github.com/rest/issues/issues#unlock-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /repos/{owner}/{repo}/issues/{issue_number}/lock documentation_url: https://docs.github.com/rest/issues/issues#lock-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/issues/{issue_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-an-issue-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue documentation_url: https://docs.github.com/rest/issues/sub-issues#remove-sub-issue openapi_files: @@ -5126,191 +5162,191 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/keys documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#list-deploy-keys openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/keys documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#create-a-deploy-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/keys/{key_id} documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#delete-a-deploy-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/keys/{key_id} documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#get-a-deploy-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/labels documentation_url: https://docs.github.com/rest/issues/labels#list-labels-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/labels documentation_url: https://docs.github.com/rest/issues/labels#create-a-label openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/labels/{name} documentation_url: https://docs.github.com/rest/issues/labels#delete-a-label openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/labels/{name} documentation_url: https://docs.github.com/rest/issues/labels#get-a-label openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /repos/{owner}/{repo}/labels/{name} documentation_url: https://docs.github.com/rest/issues/labels#update-a-label openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/languages documentation_url: https://docs.github.com/rest/repos/repos#list-repository-languages openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/lfs documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/repos/lfs#disable-git-lfs-for-a-repository openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /repos/{owner}/{repo}/lfs documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/repos/lfs#enable-git-lfs-for-a-repository openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/license documentation_url: https://docs.github.com/rest/licenses/licenses#get-the-license-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/merge-upstream documentation_url: https://docs.github.com/rest/branches/branches#sync-a-fork-branch-with-the-upstream-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/merges documentation_url: https://docs.github.com/rest/branches/branches#merge-a-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/milestones documentation_url: https://docs.github.com/rest/issues/milestones#list-milestones openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/milestones documentation_url: https://docs.github.com/rest/issues/milestones#create-a-milestone openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/milestones/{milestone_number} documentation_url: https://docs.github.com/rest/issues/milestones#delete-a-milestone openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/milestones/{milestone_number} documentation_url: https://docs.github.com/rest/issues/milestones#get-a-milestone openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /repos/{owner}/{repo}/milestones/{milestone_number} documentation_url: https://docs.github.com/rest/issues/milestones#update-a-milestone openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels documentation_url: https://docs.github.com/rest/issues/labels#list-labels-for-issues-in-a-milestone openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/notifications documentation_url: https://docs.github.com/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /repos/{owner}/{repo}/notifications documentation_url: https://docs.github.com/rest/activity/notifications#mark-repository-notifications-as-read openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/pages documentation_url: https://docs.github.com/rest/pages/pages#delete-a-apiname-pages-site openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/pages documentation_url: https://docs.github.com/rest/pages/pages#get-a-apiname-pages-site openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/pages documentation_url: https://docs.github.com/rest/pages/pages#create-a-apiname-pages-site openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /repos/{owner}/{repo}/pages documentation_url: https://docs.github.com/rest/pages/pages#update-information-about-a-apiname-pages-site openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/pages/builds documentation_url: https://docs.github.com/rest/pages/pages#list-apiname-pages-builds openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/pages/builds documentation_url: https://docs.github.com/rest/pages/pages#request-a-apiname-pages-build openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/pages/builds/latest documentation_url: https://docs.github.com/rest/pages/pages#get-latest-pages-build openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/pages/builds/{build_id} documentation_url: https://docs.github.com/rest/pages/pages#get-apiname-pages-build openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/pages/deployment documentation_url: https://docs.github.com/enterprise-server@3.7/rest/pages/pages#create-a-github-pages-deployment openapi_files: @@ -5320,40 +5356,40 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id} documentation_url: https://docs.github.com/rest/pages/pages#get-the-status-of-a-github-pages-deployment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel documentation_url: https://docs.github.com/rest/pages/pages#cancel-a-github-pages-deployment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/pages/health documentation_url: https://docs.github.com/rest/pages/pages#get-a-dns-health-check-for-github-pages openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: GET /repos/{owner}/{repo}/pre-receive-hooks - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/private-vulnerability-reporting documentation_url: https://docs.github.com/rest/repos/repos#disable-private-vulnerability-reporting-for-a-repository openapi_files: @@ -5374,91 +5410,91 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/projects documentation_url: https://docs.github.com/rest/projects/projects#create-a-repository-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/properties/values documentation_url: https://docs.github.com/rest/repos/custom-properties#get-all-custom-property-values-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /repos/{owner}/{repo}/properties/values documentation_url: https://docs.github.com/rest/repos/custom-properties#create-or-update-custom-property-values-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/pulls documentation_url: https://docs.github.com/rest/pulls/pulls#list-pull-requests openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/pulls documentation_url: https://docs.github.com/rest/pulls/pulls#create-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/pulls/comments documentation_url: https://docs.github.com/rest/pulls/comments#list-review-comments-in-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id} documentation_url: https://docs.github.com/rest/pulls/comments#delete-a-review-comment-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/pulls/comments/{comment_id} documentation_url: https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id} documentation_url: https://docs.github.com/rest/pulls/comments#update-a-review-comment-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-pull-request-review-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-pull-request-review-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-a-pull-request-comment-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number} documentation_url: https://docs.github.com/rest/pulls/pulls#get-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /repos/{owner}/{repo}/pulls/{pull_number} documentation_url: https://docs.github.com/rest/pulls/pulls#update-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces documentation_url: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-from-a-pull-request openapi_files: @@ -5469,275 +5505,275 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/comments documentation_url: https://docs.github.com/rest/pulls/comments#create-a-review-comment-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies documentation_url: https://docs.github.com/rest/pulls/comments#create-a-reply-for-a-review-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/commits documentation_url: https://docs.github.com/rest/pulls/pulls#list-commits-on-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/files documentation_url: https://docs.github.com/rest/pulls/pulls#list-pull-requests-files openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/merge documentation_url: https://docs.github.com/rest/pulls/pulls#check-if-a-pull-request-has-been-merged openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge documentation_url: https://docs.github.com/rest/pulls/pulls#merge-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers documentation_url: https://docs.github.com/rest/pulls/review-requests#remove-requested-reviewers-from-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers documentation_url: https://docs.github.com/rest/pulls/review-requests#get-all-requested-reviewers-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers documentation_url: https://docs.github.com/rest/pulls/review-requests#request-reviewers-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews documentation_url: https://docs.github.com/rest/pulls/reviews#list-reviews-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews documentation_url: https://docs.github.com/rest/pulls/reviews#create-a-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} documentation_url: https://docs.github.com/rest/pulls/reviews#delete-a-pending-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} documentation_url: https://docs.github.com/rest/pulls/reviews#get-a-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} documentation_url: https://docs.github.com/rest/pulls/reviews#update-a-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments documentation_url: https://docs.github.com/rest/pulls/reviews#list-comments-for-a-pull-request-review openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals documentation_url: https://docs.github.com/rest/pulls/reviews#dismiss-a-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events documentation_url: https://docs.github.com/rest/pulls/reviews#submit-a-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch documentation_url: https://docs.github.com/rest/pulls/pulls#update-a-pull-request-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/readme documentation_url: https://docs.github.com/rest/repos/contents#get-a-repository-readme openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/readme/{dir} documentation_url: https://docs.github.com/rest/repos/contents#get-a-repository-readme-for-a-directory openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/releases documentation_url: https://docs.github.com/rest/releases/releases#list-releases openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/releases documentation_url: https://docs.github.com/rest/releases/releases#create-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/releases/assets/{asset_id} documentation_url: https://docs.github.com/rest/releases/assets#delete-a-release-asset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/releases/assets/{asset_id} documentation_url: https://docs.github.com/rest/releases/assets#get-a-release-asset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /repos/{owner}/{repo}/releases/assets/{asset_id} documentation_url: https://docs.github.com/rest/releases/assets#update-a-release-asset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/releases/generate-notes documentation_url: https://docs.github.com/rest/releases/releases#generate-release-notes-content-for-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/releases/latest documentation_url: https://docs.github.com/rest/releases/releases#get-the-latest-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/releases/tags/{tag} documentation_url: https://docs.github.com/rest/releases/releases#get-a-release-by-tag-name openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/releases/{release_id} documentation_url: https://docs.github.com/rest/releases/releases#delete-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/releases/{release_id} documentation_url: https://docs.github.com/rest/releases/releases#get-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /repos/{owner}/{repo}/releases/{release_id} documentation_url: https://docs.github.com/rest/releases/releases#update-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/releases/{release_id}/assets documentation_url: https://docs.github.com/rest/releases/assets#list-release-assets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/releases/{release_id}/assets documentation_url: https://docs.github.com/rest/releases/assets#upload-a-release-asset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/releases/{release_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/releases/{release_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-a-release-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/replicas/caches - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/repos/repos#list-repository-cache-replication-status + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/repos/repos#list-repository-cache-replication-status openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/rules/branches/{branch} documentation_url: https://docs.github.com/rest/repos/rules#get-rules-for-a-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/rulesets documentation_url: https://docs.github.com/rest/repos/rules#get-all-repository-rulesets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/rulesets documentation_url: https://docs.github.com/rest/repos/rules#create-a-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/rulesets/rule-suites documentation_url: https://docs.github.com/rest/repos/rule-suites#list-repository-rule-suites openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id} documentation_url: https://docs.github.com/rest/repos/rule-suites#get-a-repository-rule-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/repos/rules#get-a-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /repos/{owner}/{repo}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/repos/rules#update-a-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history documentation_url: https://docs.github.com/rest/repos/rules#get-repository-ruleset-history openapi_files: @@ -5753,37 +5789,37 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#get-a-secret-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#update-a-secret-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-locations-for-a-secret-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#create-a-push-protection-bypass openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/secret-scanning/scan-history documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#get-secret-scanning-scan-history-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/security-advisories documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories openapi_files: @@ -5824,115 +5860,115 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/stats/code_frequency documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-activity openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/stats/commit_activity documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-last-year-of-commit-activity openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/stats/contributors documentation_url: https://docs.github.com/rest/metrics/statistics#get-all-contributor-commit-activity openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/stats/participation documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-count openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/stats/punch_card documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-hourly-commit-count-for-each-day openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/statuses/{sha} documentation_url: https://docs.github.com/rest/commits/statuses#create-a-commit-status openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/subscribers documentation_url: https://docs.github.com/rest/activity/watching#list-watchers openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/subscription documentation_url: https://docs.github.com/rest/activity/watching#delete-a-repository-subscription openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/subscription documentation_url: https://docs.github.com/rest/activity/watching#get-a-repository-subscription openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /repos/{owner}/{repo}/subscription documentation_url: https://docs.github.com/rest/activity/watching#set-a-repository-subscription openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/tags documentation_url: https://docs.github.com/rest/repos/repos#list-repository-tags openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/tags/protection documentation_url: https://docs.github.com/rest/repos/tags#closing-down---list-tag-protection-states-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{owner}/{repo}/tags/protection documentation_url: https://docs.github.com/rest/repos/tags#closing-down---create-a-tag-protection-state-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id} documentation_url: https://docs.github.com/rest/repos/tags#closing-down---delete-a-tag-protection-state-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/tarball/{ref} documentation_url: https://docs.github.com/rest/repos/contents#download-a-repository-archive-tar openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/teams documentation_url: https://docs.github.com/rest/repos/repos#list-repository-teams openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/topics documentation_url: https://docs.github.com/rest/repos/repos#get-all-repository-topics openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /repos/{owner}/{repo}/topics documentation_url: https://docs.github.com/rest/repos/repos#replace-all-repository-topics openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/traffic/clones documentation_url: https://docs.github.com/rest/metrics/traffic#get-repository-clones openapi_files: @@ -5958,43 +5994,43 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /repos/{owner}/{repo}/vulnerability-alerts documentation_url: https://docs.github.com/rest/repos/repos#disable-vulnerability-alerts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/vulnerability-alerts documentation_url: https://docs.github.com/rest/repos/repos#check-if-vulnerability-alerts-are-enabled-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /repos/{owner}/{repo}/vulnerability-alerts documentation_url: https://docs.github.com/rest/repos/repos#enable-vulnerability-alerts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repos/{owner}/{repo}/zipball/{ref} documentation_url: https://docs.github.com/rest/repos/contents#download-a-repository-archive-zip openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /repos/{template_owner}/{template_repo}/generate documentation_url: https://docs.github.com/rest/repos/repos#create-a-repository-using-a-template openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repositories documentation_url: https://docs.github.com/rest/repos/repos#list-public-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /repositories/{repository_id}/environments/{environment_name}/secrets documentation_url: https://docs.github.com/enterprise-server@3.7/rest/actions/secrets#list-environment-secrets openapi_files: @@ -6067,62 +6103,62 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#list-provisioned-scim-groups-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /scim/v2/enterprises/{enterprise}/Groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#provision-a-scim-enterprise-group openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#delete-a-scim-group-from-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-group openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#update-an-attribute-for-a-scim-enterprise-group openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#set-scim-information-for-a-provisioned-enterprise-group openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /scim/v2/enterprises/{enterprise}/Users documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#list-scim-provisioned-identities-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /scim/v2/enterprises/{enterprise}/Users documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#provision-a-scim-enterprise-user openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /scim/v2/enterprises/{enterprise}/Users/{scim_user_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#delete-a-scim-user-from-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /scim/v2/enterprises/{enterprise}/Users/{scim_user_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-user openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /scim/v2/enterprises/{enterprise}/Users/{scim_user_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#update-an-attribute-for-a-scim-enterprise-user openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /scim/v2/enterprises/{enterprise}/Users/{scim_user_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#set-scim-information-for-a-provisioned-enterprise-user openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /scim/v2/organizations/{org}/Users documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#list-scim-provisioned-identities openapi_files: @@ -6152,43 +6188,43 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /search/commits documentation_url: https://docs.github.com/rest/search/search#search-commits openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /search/issues documentation_url: https://docs.github.com/rest/search/search#search-issues-and-pull-requests openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /search/labels documentation_url: https://docs.github.com/rest/search/search#search-labels openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /search/repositories documentation_url: https://docs.github.com/rest/search/search#search-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /search/topics documentation_url: https://docs.github.com/rest/search/search#search-topics openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /search/users documentation_url: https://docs.github.com/rest/search/search#search-users openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /setup/api/configcheck documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#get-the-configuration-status openapi_files: @@ -6238,103 +6274,103 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /teams/{team_id} documentation_url: https://docs.github.com/rest/teams/teams#get-a-team-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /teams/{team_id} documentation_url: https://docs.github.com/rest/teams/teams#update-a-team-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /teams/{team_id}/discussions documentation_url: https://docs.github.com/rest/teams/discussions#list-discussions-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /teams/{team_id}/discussions documentation_url: https://docs.github.com/rest/teams/discussions#create-a-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /teams/{team_id}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#delete-a-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /teams/{team_id}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#get-a-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /teams/{team_id}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#update-a-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /teams/{team_id}/discussions/{discussion_number}/comments documentation_url: https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /teams/{team_id}/discussions/{discussion_number}/comments documentation_url: https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /teams/{team_id}/discussions/{discussion_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /teams/{team_id}/discussions/{discussion_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /teams/{team_id}/invitations documentation_url: https://docs.github.com/rest/teams/members#list-pending-team-invitations-legacy openapi_files: @@ -6345,91 +6381,91 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /teams/{team_id}/members/{username} documentation_url: https://docs.github.com/rest/teams/members#remove-team-member-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /teams/{team_id}/members/{username} documentation_url: https://docs.github.com/rest/teams/members#get-team-member-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /teams/{team_id}/members/{username} documentation_url: https://docs.github.com/rest/teams/members#add-team-member-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /teams/{team_id}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /teams/{team_id}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#get-team-membership-for-a-user-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /teams/{team_id}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /teams/{team_id}/projects documentation_url: https://docs.github.com/rest/teams/teams#list-team-projects-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /teams/{team_id}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /teams/{team_id}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /teams/{team_id}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /teams/{team_id}/repos documentation_url: https://docs.github.com/rest/teams/teams#list-team-repositories-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /teams/{team_id}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /teams/{team_id}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /teams/{team_id}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /teams/{team_id}/team-sync/group-mappings documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#list-idp-groups-for-a-team-legacy openapi_files: @@ -6443,19 +6479,19 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /user documentation_url: https://docs.github.com/rest/users/users#get-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /user documentation_url: https://docs.github.com/rest/users/users#update-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /user/blocks documentation_url: https://docs.github.com/rest/users/blocking#list-users-blocked-by-the-authenticated-user openapi_files: @@ -6581,7 +6617,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /user/email/visibility documentation_url: https://docs.github.com/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user openapi_files: @@ -6592,97 +6628,97 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /user/emails documentation_url: https://docs.github.com/rest/users/emails#list-email-addresses-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /user/emails documentation_url: https://docs.github.com/rest/users/emails#add-an-email-address-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /user/followers documentation_url: https://docs.github.com/rest/users/followers#list-followers-of-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /user/following documentation_url: https://docs.github.com/rest/users/followers#list-the-people-the-authenticated-user-follows openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /user/following/{username} documentation_url: https://docs.github.com/rest/users/followers#unfollow-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /user/following/{username} documentation_url: https://docs.github.com/rest/users/followers#check-if-a-person-is-followed-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /user/following/{username} documentation_url: https://docs.github.com/rest/users/followers#follow-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /user/gpg_keys documentation_url: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /user/gpg_keys documentation_url: https://docs.github.com/rest/users/gpg-keys#create-a-gpg-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /user/gpg_keys/{gpg_key_id} documentation_url: https://docs.github.com/rest/users/gpg-keys#delete-a-gpg-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /user/gpg_keys/{gpg_key_id} documentation_url: https://docs.github.com/rest/users/gpg-keys#get-a-gpg-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /user/installations documentation_url: https://docs.github.com/rest/apps/installations#list-app-installations-accessible-to-the-user-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /user/installations/{installation_id}/repositories documentation_url: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-user-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /user/installations/{installation_id}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/apps/installations#remove-a-repository-from-an-app-installation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /user/installations/{installation_id}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/apps/installations#add-a-repository-to-an-app-installation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /user/interaction-limits documentation_url: https://docs.github.com/rest/interactions/user#remove-interaction-restrictions-from-your-public-repositories openapi_files: @@ -6703,31 +6739,31 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /user/keys documentation_url: https://docs.github.com/rest/users/keys#list-public-ssh-keys-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /user/keys documentation_url: https://docs.github.com/rest/users/keys#create-a-public-ssh-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /user/keys/{key_id} documentation_url: https://docs.github.com/rest/users/keys#delete-a-public-ssh-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /user/keys/{key_id} documentation_url: https://docs.github.com/rest/users/keys#get-a-public-ssh-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /user/marketplace_purchases documentation_url: https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user openapi_files: @@ -6743,31 +6779,31 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /user/memberships/orgs/{org} documentation_url: https://docs.github.com/rest/orgs/members#get-an-organization-membership-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /user/memberships/orgs/{org} documentation_url: https://docs.github.com/rest/orgs/members#update-an-organization-membership-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /user/migrations documentation_url: https://docs.github.com/rest/migrations/users#list-user-migrations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /user/migrations documentation_url: https://docs.github.com/rest/migrations/users#start-a-user-migration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /user/migrations/{migration_id} documentation_url: https://docs.github.com/rest/migrations/users#get-a-user-migration-status openapi_files: @@ -6783,7 +6819,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock documentation_url: https://docs.github.com/rest/migrations/users#unlock-a-user-repository openapi_files: @@ -6794,199 +6830,199 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /user/orgs documentation_url: https://docs.github.com/rest/orgs/orgs#list-organizations-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /user/packages documentation_url: https://docs.github.com/rest/packages/packages#list-packages-for-the-authenticated-users-namespace openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /user/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /user/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /user/packages/{package_type}/{package_name}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /user/packages/{package_type}/{package_name}/versions documentation_url: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-version-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /user/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-version-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-version-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /user/projects documentation_url: https://docs.github.com/rest/projects/projects#create-a-user-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /user/public_emails documentation_url: https://docs.github.com/rest/users/emails#list-public-email-addresses-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /user/repos documentation_url: https://docs.github.com/rest/repos/repos#list-repositories-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /user/repos documentation_url: https://docs.github.com/rest/repos/repos#create-a-repository-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /user/repository_invitations documentation_url: https://docs.github.com/rest/collaborators/invitations#list-repository-invitations-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /user/repository_invitations/{invitation_id} documentation_url: https://docs.github.com/rest/collaborators/invitations#decline-a-repository-invitation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PATCH /user/repository_invitations/{invitation_id} documentation_url: https://docs.github.com/rest/collaborators/invitations#accept-a-repository-invitation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /user/social_accounts documentation_url: https://docs.github.com/rest/users/social-accounts#delete-social-accounts-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /user/social_accounts documentation_url: https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /user/social_accounts documentation_url: https://docs.github.com/rest/users/social-accounts#add-social-accounts-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /user/ssh_signing_keys documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /user/ssh_signing_keys documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#create-a-ssh-signing-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /user/ssh_signing_keys/{ssh_signing_key_id} documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#delete-an-ssh-signing-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /user/ssh_signing_keys/{ssh_signing_key_id} documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#get-an-ssh-signing-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /user/starred documentation_url: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /user/starred/{owner}/{repo} documentation_url: https://docs.github.com/rest/activity/starring#unstar-a-repository-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /user/starred/{owner}/{repo} documentation_url: https://docs.github.com/rest/activity/starring#check-if-a-repository-is-starred-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /user/starred/{owner}/{repo} documentation_url: https://docs.github.com/rest/activity/starring#star-a-repository-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /user/subscriptions documentation_url: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /user/teams documentation_url: https://docs.github.com/rest/teams/teams#list-teams-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /user/{account_id} documentation_url: https://docs.github.com/rest/users/users#get-a-user-using-their-id openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /users documentation_url: https://docs.github.com/rest/users/users#list-users openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /users/{username} documentation_url: https://docs.github.com/rest/users/users#get-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /users/{username}/attestations/{subject_digest} documentation_url: https://docs.github.com/rest/users/attestations#list-attestations openapi_files: @@ -6997,151 +7033,151 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /users/{username}/events documentation_url: https://docs.github.com/rest/activity/events#list-events-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /users/{username}/events/orgs/{org} documentation_url: https://docs.github.com/rest/activity/events#list-organization-events-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /users/{username}/events/public documentation_url: https://docs.github.com/rest/activity/events#list-public-events-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /users/{username}/followers documentation_url: https://docs.github.com/rest/users/followers#list-followers-of-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /users/{username}/following documentation_url: https://docs.github.com/rest/users/followers#list-the-people-a-user-follows openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /users/{username}/following/{target_user} documentation_url: https://docs.github.com/rest/users/followers#check-if-a-user-follows-another-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /users/{username}/gists documentation_url: https://docs.github.com/rest/gists/gists#list-gists-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /users/{username}/gpg_keys documentation_url: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /users/{username}/hovercard documentation_url: https://docs.github.com/rest/users/users#get-contextual-information-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /users/{username}/installation documentation_url: https://docs.github.com/rest/apps/apps#get-a-user-installation-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /users/{username}/keys documentation_url: https://docs.github.com/rest/users/keys#list-public-keys-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /users/{username}/orgs documentation_url: https://docs.github.com/rest/orgs/orgs#list-organizations-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /users/{username}/packages documentation_url: https://docs.github.com/rest/packages/packages#list-packages-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /users/{username}/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /users/{username}/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /users/{username}/packages/{package_type}/{package_name}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /users/{username}/packages/{package_type}/{package_name}/versions documentation_url: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#delete-package-version-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-version-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-package-version-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /users/{username}/projects documentation_url: https://docs.github.com/rest/projects/projects#list-user-projects openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /users/{username}/received_events documentation_url: https://docs.github.com/rest/activity/events#list-events-received-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /users/{username}/received_events/public documentation_url: https://docs.github.com/rest/activity/events#list-public-events-received-by-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /users/{username}/repos documentation_url: https://docs.github.com/rest/repos/repos#list-repositories-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /users/{username}/settings/billing/actions documentation_url: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-a-user openapi_files: @@ -7157,46 +7193,51 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - name: GET /users/{username}/settings/billing/usage + documentation_url: https://docs.github.com/rest/billing/enhanced-billing#get-billing-usage-report-for-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: DELETE /users/{username}/site_admin - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#demote-a-site-administrator + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/users#demote-a-site-administrator openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /users/{username}/site_admin - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /users/{username}/social_accounts documentation_url: https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /users/{username}/ssh_signing_keys documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /users/{username}/starred documentation_url: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /users/{username}/subscriptions documentation_url: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: DELETE /users/{username}/suspended - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#unsuspend-a-user + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/users#unsuspend-a-user openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: PUT /users/{username}/suspended - documentation_url: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#suspend-a-user + documentation_url: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/users#suspend-a-user openapi_files: - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json - name: GET /versions documentation_url: https://docs.github.com/rest/meta/meta#get-all-api-versions openapi_files: @@ -7207,4 +7248,4 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.16/ghes-3.16.json + - descriptions/ghes-3.17/ghes-3.17.json From d436b529eb60b15b6921bce3f2b432d8cf845c8e Mon Sep 17 00:00:00 2001 From: Tim Date: Mon, 12 May 2025 15:04:35 +0400 Subject: [PATCH 717/751] Improve DownloadContents and DownloadContentsWithMeta methods (#3573) --- github/repos_contents.go | 26 +++-- github/repos_contents_test.go | 190 +++++++++++++++++++++++++++++++--- 2 files changed, 194 insertions(+), 22 deletions(-) diff --git a/github/repos_contents.go b/github/repos_contents.go index 013993e5be1..5d7329c4ffe 100644 --- a/github/repos_contents.go +++ b/github/repos_contents.go @@ -139,17 +139,24 @@ func (s *RepositoriesService) GetReadme(ctx context.Context, owner, repo string, func (s *RepositoriesService) DownloadContents(ctx context.Context, owner, repo, filepath string, opts *RepositoryContentGetOptions) (io.ReadCloser, *Response, error) { dir := path.Dir(filepath) filename := path.Base(filepath) + fileContent, _, resp, err := s.GetContents(ctx, owner, repo, filepath, opts) + if err == nil && fileContent != nil { + content, err := fileContent.GetContent() + if err == nil && content != "" { + return io.NopCloser(strings.NewReader(content)), resp, nil + } + } + _, dirContents, resp, err := s.GetContents(ctx, owner, repo, dir, opts) if err != nil { return nil, resp, err } for _, contents := range dirContents { - if *contents.Name == filename { - if contents.DownloadURL == nil || *contents.DownloadURL == "" { + if contents.GetName() == filename { + if contents.GetDownloadURL() == "" { return nil, resp, fmt.Errorf("no download link found for %s", filepath) } - dlReq, err := http.NewRequestWithContext(ctx, http.MethodGet, *contents.DownloadURL, nil) if err != nil { return nil, resp, err @@ -181,17 +188,24 @@ func (s *RepositoriesService) DownloadContents(ctx context.Context, owner, repo, func (s *RepositoriesService) DownloadContentsWithMeta(ctx context.Context, owner, repo, filepath string, opts *RepositoryContentGetOptions) (io.ReadCloser, *RepositoryContent, *Response, error) { dir := path.Dir(filepath) filename := path.Base(filepath) + fileContent, _, resp, err := s.GetContents(ctx, owner, repo, filepath, opts) + if err == nil && fileContent != nil { + content, err := fileContent.GetContent() + if err == nil && content != "" { + return io.NopCloser(strings.NewReader(content)), fileContent, resp, nil + } + } + _, dirContents, resp, err := s.GetContents(ctx, owner, repo, dir, opts) if err != nil { return nil, nil, resp, err } for _, contents := range dirContents { - if *contents.Name == filename { - if contents.DownloadURL == nil || *contents.DownloadURL == "" { + if contents.GetName() == filename { + if contents.GetDownloadURL() == "" { return nil, contents, resp, fmt.Errorf("no download link found for %s", filepath) } - dlReq, err := http.NewRequestWithContext(ctx, http.MethodGet, *contents.DownloadURL, nil) if err != nil { return nil, contents, resp, err diff --git a/github/repos_contents_test.go b/github/repos_contents_test.go index d19bf71f35a..1db41a4c1d2 100644 --- a/github/repos_contents_test.go +++ b/github/repos_contents_test.go @@ -127,10 +127,66 @@ func TestRepositoriesService_GetReadme(t *testing.T) { }) } -func TestRepositoriesService_DownloadContents_Success(t *testing.T) { +func TestRepositoriesService_DownloadContents_SuccessForFile(t *testing.T) { t.Parallel() client, mux, serverURL := setup(t) + mux.HandleFunc("/repos/o/r/contents/d/f", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "type": "file", + "name": "f", + "content": "foo", + "download_url": "`+serverURL+baseURLPath+`/download/f" + }`) + }) + + ctx := context.Background() + r, resp, err := client.Repositories.DownloadContents(ctx, "o", "r", "d/f", nil) + if err != nil { + t.Errorf("Repositories.DownloadContents returned error: %v", err) + } + + if got, want := resp.Response.StatusCode, http.StatusOK; got != want { + t.Errorf("Repositories.DownloadContents returned status code %v, want %v", got, want) + } + + bytes, err := io.ReadAll(r) + if err != nil { + t.Errorf("Error reading response body: %v", err) + } + r.Close() + + if got, want := string(bytes), "foo"; got != want { + t.Errorf("Repositories.DownloadContents returned %v, want %v", got, want) + } + + const methodName = "DownloadContents" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Repositories.DownloadContents(ctx, "\n", "\n", "\n", nil) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.DownloadContents(ctx, "o", "r", "d/f", nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestRepositoriesService_DownloadContents_SuccessForDirectory(t *testing.T) { + t.Parallel() + client, mux, serverURL := setup(t) + + mux.HandleFunc("/repos/o/r/contents/d/f", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "type": "file", + "name": "f" + }`) + }) mux.HandleFunc("/repos/o/r/contents/d", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `[{ @@ -183,6 +239,13 @@ func TestRepositoriesService_DownloadContents_FailedResponse(t *testing.T) { t.Parallel() client, mux, serverURL := setup(t) + mux.HandleFunc("/repos/o/r/contents/d/f", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "type": "file", + "name": "f" + }`) + }) mux.HandleFunc("/repos/o/r/contents/d", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `[{ @@ -222,16 +285,25 @@ func TestRepositoriesService_DownloadContents_NoDownloadURL(t *testing.T) { t.Parallel() client, mux, _ := setup(t) + mux.HandleFunc("/repos/o/r/contents/d/f", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "type": "file", + "name": "f", + "content": "" + }`) + }) mux.HandleFunc("/repos/o/r/contents/d", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `[{ "type": "file", "name": "f", + "content": "" }]`) }) ctx := context.Background() - _, resp, err := client.Repositories.DownloadContents(ctx, "o", "r", "d/f", nil) + reader, resp, err := client.Repositories.DownloadContents(ctx, "o", "r", "d/f", nil) if err == nil { t.Errorf("Repositories.DownloadContents did not return expected error") } @@ -239,19 +311,32 @@ func TestRepositoriesService_DownloadContents_NoDownloadURL(t *testing.T) { if resp == nil { t.Errorf("Repositories.DownloadContents did not return expected response") } + + if reader != nil { + t.Errorf("Repositories.DownloadContents did not return expected reader") + } } func TestRepositoriesService_DownloadContents_NoFile(t *testing.T) { t.Parallel() client, mux, _ := setup(t) + mux.HandleFunc("/repos/o/r/contents/d/f", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "type": "file", + "name": "f", + "content": "" + }`) + }) + mux.HandleFunc("/repos/o/r/contents/d", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `[]`) }) ctx := context.Background() - _, resp, err := client.Repositories.DownloadContents(ctx, "o", "r", "d/f", nil) + reader, resp, err := client.Repositories.DownloadContents(ctx, "o", "r", "d/f", nil) if err == nil { t.Errorf("Repositories.DownloadContents did not return expected error") } @@ -259,23 +344,24 @@ func TestRepositoriesService_DownloadContents_NoFile(t *testing.T) { if resp == nil { t.Errorf("Repositories.DownloadContents did not return expected response") } + + if reader != nil { + t.Errorf("Repositories.DownloadContents did not return expected reader") + } } -func TestRepositoriesService_DownloadContentsWithMeta_Success(t *testing.T) { +func TestRepositoriesService_DownloadContentsWithMeta_SuccessForFile(t *testing.T) { t.Parallel() client, mux, serverURL := setup(t) - mux.HandleFunc("/repos/o/r/contents/d", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/contents/d/f", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - fmt.Fprint(w, `[{ + fmt.Fprint(w, `{ "type": "file", "name": "f", - "download_url": "`+serverURL+baseURLPath+`/download/f" - }]`) - }) - mux.HandleFunc("/download/f", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - fmt.Fprint(w, "foo") + "download_url": "`+serverURL+baseURLPath+`/download/f", + "content": "foo" + }`) }) ctx := context.Background() @@ -324,23 +410,79 @@ func TestRepositoriesService_DownloadContentsWithMeta_Success(t *testing.T) { }) } -func TestRepositoriesService_DownloadContentsWithMeta_FailedResponse(t *testing.T) { +func TestRepositoriesService_DownloadContentsWithMeta_SuccessForDirectory(t *testing.T) { t.Parallel() client, mux, serverURL := setup(t) mux.HandleFunc("/repos/o/r/contents/d", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `[{ + "type": "file", + "name": "f", + "download_url": "`+serverURL+baseURLPath+`/download/f" + }]`) + }) + mux.HandleFunc("/download/f", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, "foo") + }) + + ctx := context.Background() + r, c, resp, err := client.Repositories.DownloadContentsWithMeta(ctx, "o", "r", "d/f", nil) + if err != nil { + t.Errorf("Repositories.DownloadContentsWithMeta returned error: %v", err) + } + + if got, want := resp.Response.StatusCode, http.StatusOK; got != want { + t.Errorf("Repositories.DownloadContentsWithMeta returned status code %v, want %v", got, want) + } + + bytes, err := io.ReadAll(r) + if err != nil { + t.Errorf("Error reading response body: %v", err) + } + r.Close() + + if got, want := string(bytes), "foo"; got != want { + t.Errorf("Repositories.DownloadContentsWithMeta returned %v, want %v", got, want) + } + + if c != nil && c.Name != nil { + if got, want := *c.Name, "f"; got != want { + t.Errorf("Repositories.DownloadContentsWithMeta returned content name %v, want %v", got, want) + } + } else { + t.Errorf("Returned RepositoryContent is null") + } +} + +func TestRepositoriesService_DownloadContentsWithMeta_FailedResponse(t *testing.T) { + t.Parallel() + client, mux, serverURL := setup(t) + + downloadURL := fmt.Sprintf("%s%s/download/f", serverURL, baseURLPath) + + mux.HandleFunc("/repos/o/r/contents/d/f", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ "type": "file", "name": "f", - "download_url": "`+serverURL+baseURLPath+`/download/f" - }]`) + "download_url": "`+downloadURL+`" + }`) }) mux.HandleFunc("/download/f", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") w.WriteHeader(http.StatusInternalServerError) fmt.Fprint(w, "foo error") }) + mux.HandleFunc("/repos/o/r/contents/d", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `[{ + "type": "file", + "name": "f", + "download_url": "`+downloadURL+`" + }]`) + }) ctx := context.Background() r, c, resp, err := client.Repositories.DownloadContentsWithMeta(ctx, "o", "r", "d/f", nil) @@ -375,23 +517,39 @@ func TestRepositoriesService_DownloadContentsWithMeta_NoDownloadURL(t *testing.T t.Parallel() client, mux, _ := setup(t) + mux.HandleFunc("/repos/o/r/contents/d/f", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "type": "file", + "name": "f", + }`) + }) mux.HandleFunc("/repos/o/r/contents/d", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `[{ "type": "file", "name": "f", + "content": "" }]`) }) ctx := context.Background() - _, _, resp, err := client.Repositories.DownloadContentsWithMeta(ctx, "o", "r", "d/f", nil) + reader, contents, resp, err := client.Repositories.DownloadContentsWithMeta(ctx, "o", "r", "d/f", nil) if err == nil { t.Errorf("Repositories.DownloadContentsWithMeta did not return expected error") } + if reader != nil { + t.Errorf("Repositories.DownloadContentsWithMeta did not return expected reader") + } + if resp == nil { t.Errorf("Repositories.DownloadContentsWithMeta did not return expected response") } + + if contents == nil { + t.Errorf("Repositories.DownloadContentsWithMeta did not return expected content") + } } func TestRepositoriesService_DownloadContentsWithMeta_NoFile(t *testing.T) { From 1a52945a9df0e229f7eb0d1b4dce69c49a8be1b9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 May 2025 16:37:52 -0400 Subject: [PATCH 718/751] build(deps): bump actions/setup-go from 5.4.0 to 5.5.0 in the actions group (#3575) --- .github/workflows/linter.yml | 2 +- .github/workflows/tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 0a632ac310a..07532c1f28e 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0 + - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 with: go-version: 1.x cache-dependency-path: "**/go.sum" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 86fdd739ef0..aaf08545935 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -42,7 +42,7 @@ jobs: runs-on: ${{ matrix.platform }} steps: - - uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0 + - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 with: go-version: ${{ matrix.go-version }} - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 From a36bba770450933b5dda7ab0e6e4c6e83d5d9051 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 May 2025 15:19:52 -0400 Subject: [PATCH 719/751] build(deps): bump golang.org/x/net from 0.39.0 to 0.40.0 in /scrape (#3576) --- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index cbf6e82c1a3..026cf8c7176 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -7,7 +7,7 @@ require ( github.com/google/go-cmp v0.7.0 github.com/google/go-github/v72 v72.0.0 github.com/xlzd/gotp v0.1.0 - golang.org/x/net v0.39.0 + golang.org/x/net v0.40.0 ) require ( diff --git a/scrape/go.sum b/scrape/go.sum index e7a9f6c5d2d..67a5e04979d 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -33,8 +33,8 @@ golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= -golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY= -golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E= +golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY= +golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= From f0f3898bf56152b21034ddac61fad48a52a3dfbb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 May 2025 15:26:17 -0400 Subject: [PATCH 720/751] build(deps): bump github.com/alecthomas/kong from 1.10.0 to 1.11.0 in /tools (#3578) --- tools/go.mod | 2 +- tools/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index f38b9dc76e7..7d28c110bb7 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -3,7 +3,7 @@ module tools go 1.23.0 require ( - github.com/alecthomas/kong v1.10.0 + github.com/alecthomas/kong v1.11.0 github.com/getkin/kin-openapi v0.132.0 github.com/google/go-cmp v0.7.0 github.com/google/go-github/v72 v72.0.0 diff --git a/tools/go.sum b/tools/go.sum index 7d37e86fa5f..ae0f17e655f 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -1,7 +1,7 @@ github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0= github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= -github.com/alecthomas/kong v1.10.0 h1:8K4rGDpT7Iu+jEXCIJUeKqvpwZHbsFRoebLbnzlmrpw= -github.com/alecthomas/kong v1.10.0/go.mod h1:p2vqieVMeTAnaC83txKtXe8FLke2X07aruPWXyMPQrU= +github.com/alecthomas/kong v1.11.0 h1:y++1gI7jf8O7G7l4LZo5ASFhrhJvzc+WgF/arranEmM= +github.com/alecthomas/kong v1.11.0/go.mod h1:p2vqieVMeTAnaC83txKtXe8FLke2X07aruPWXyMPQrU= github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc= github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= From 304d3d0f6ed951f04efa563579422bc2c2021c4c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 May 2025 15:34:24 -0400 Subject: [PATCH 721/751] build(deps): bump codecov/codecov-action from 5.4.0 to 5.4.3 (#3579) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index aaf08545935..c23caee16eb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -76,6 +76,6 @@ jobs: - name: Upload coverage to Codecov if: ${{ matrix.update-coverage }} - uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0 + uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3 with: use_oidc: true From cc0e642101a985665bb3a4b8a218b2560c4c25e6 Mon Sep 17 00:00:00 2001 From: Changyong Um Date: Tue, 27 May 2025 04:49:44 +0900 Subject: [PATCH 722/751] feat: Add support for sub-issue (#3580) --- github/github-accessors.go | 24 +++++ github/github-accessors_test.go | 33 ++++++ github/github.go | 2 + github/strings_test.go | 1 + github/sub_issue.go | 140 ++++++++++++++++++++++++++ github/sub_issue_test.go | 173 ++++++++++++++++++++++++++++++++ 6 files changed, 373 insertions(+) create mode 100644 github/sub_issue.go create mode 100644 github/sub_issue_test.go diff --git a/github/github-accessors.go b/github/github-accessors.go index 6378b40b44c..307d6e339d3 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -25942,6 +25942,30 @@ func (s *StatusEvent) GetUpdatedAt() Timestamp { return *s.UpdatedAt } +// GetAfterID returns the AfterID field if it's non-nil, zero value otherwise. +func (s *SubIssueRequest) GetAfterID() int64 { + if s == nil || s.AfterID == nil { + return 0 + } + return *s.AfterID +} + +// GetBeforeID returns the BeforeID field if it's non-nil, zero value otherwise. +func (s *SubIssueRequest) GetBeforeID() int64 { + if s == nil || s.BeforeID == nil { + return 0 + } + return *s.BeforeID +} + +// GetReplaceParent returns the ReplaceParent field if it's non-nil, zero value otherwise. +func (s *SubIssueRequest) GetReplaceParent() bool { + if s == nil || s.ReplaceParent == nil { + return false + } + return *s.ReplaceParent +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (s *Subscription) GetCreatedAt() Timestamp { if s == nil || s.CreatedAt == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 3588b7909f1..f2a51a6028c 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -33332,6 +33332,39 @@ func TestStatusEvent_GetUpdatedAt(tt *testing.T) { s.GetUpdatedAt() } +func TestSubIssueRequest_GetAfterID(tt *testing.T) { + tt.Parallel() + var zeroValue int64 + s := &SubIssueRequest{AfterID: &zeroValue} + s.GetAfterID() + s = &SubIssueRequest{} + s.GetAfterID() + s = nil + s.GetAfterID() +} + +func TestSubIssueRequest_GetBeforeID(tt *testing.T) { + tt.Parallel() + var zeroValue int64 + s := &SubIssueRequest{BeforeID: &zeroValue} + s.GetBeforeID() + s = &SubIssueRequest{} + s.GetBeforeID() + s = nil + s.GetBeforeID() +} + +func TestSubIssueRequest_GetReplaceParent(tt *testing.T) { + tt.Parallel() + var zeroValue bool + s := &SubIssueRequest{ReplaceParent: &zeroValue} + s.GetReplaceParent() + s = &SubIssueRequest{} + s.GetReplaceParent() + s = nil + s.GetReplaceParent() +} + func TestSubscription_GetCreatedAt(tt *testing.T) { tt.Parallel() var zeroValue Timestamp diff --git a/github/github.go b/github/github.go index a3b1941eac1..c366820383d 100644 --- a/github/github.go +++ b/github/github.go @@ -222,6 +222,7 @@ type Client struct { Search *SearchService SecretScanning *SecretScanningService SecurityAdvisories *SecurityAdvisoriesService + SubIssue *SubIssueService Teams *TeamsService Users *UsersService } @@ -458,6 +459,7 @@ func (c *Client) initialize() { c.Search = (*SearchService)(&c.common) c.SecretScanning = (*SecretScanningService)(&c.common) c.SecurityAdvisories = (*SecurityAdvisoriesService)(&c.common) + c.SubIssue = (*SubIssueService)(&c.common) c.Teams = (*TeamsService)(&c.common) c.Users = (*UsersService)(&c.common) } diff --git a/github/strings_test.go b/github/strings_test.go index a164cebcac0..98906b4d41d 100644 --- a/github/strings_test.go +++ b/github/strings_test.go @@ -107,6 +107,7 @@ func TestString(t *testing.T) { {Hook{ID: Ptr(int64(1))}, `github.Hook{ID:1}`}, {IssueComment{ID: Ptr(int64(1))}, `github.IssueComment{ID:1}`}, {Issue{Number: Ptr(1)}, `github.Issue{Number:1}`}, + {SubIssue{ID: Ptr(int64(1))}, `github.SubIssue{ID:1}`}, {Key{ID: Ptr(int64(1))}, `github.Key{ID:1}`}, {Label{ID: Ptr(int64(1)), Name: Ptr("l")}, `github.Label{ID:1, Name:"l"}`}, {Organization{ID: Ptr(int64(1))}, `github.Organization{ID:1}`}, diff --git a/github/sub_issue.go b/github/sub_issue.go new file mode 100644 index 00000000000..8b24adb899b --- /dev/null +++ b/github/sub_issue.go @@ -0,0 +1,140 @@ +// Copyright 2025 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" +) + +// SubIssueService handles communication with the sub-issue related +// methods of the GitHub API. +// +// Sub-issues help you group and manage your issues with a parent/child relationship. +// +// GitHub API docs: https://docs.github.com/rest/issues/sub-issues +type SubIssueService service + +// SubIssue represents a GitHub sub-issue on a repository. +// Note: As far as the GitHub API is concerned, every pull request is an issue, +// but not every issue is a pull request. Some endpoints, events, and webhooks +// may also return pull requests via this struct. If PullRequestLinks is nil, +// this is an issue, and if PullRequestLinks is not nil, this is a pull request. +// The IsPullRequest helper method can be used to check that. +type SubIssue Issue + +func (i SubIssue) String() string { + return Stringify(i) +} + +// SubIssueListByIssueOptions specifies the optional parameters to the +// SubIssueService.ListByIssue method. +type SubIssueListByIssueOptions struct { + IssueListByRepoOptions +} + +// SubIssueRequest represents a request to add, remove, or reprioritize sub-issues. +type SubIssueRequest struct { + SubIssueID int64 `json:"sub_issue_id"` // Required: The ID of the sub-issue + AfterID *int64 `json:"after_id,omitempty"` // Optional: Position after this sub-issue ID + BeforeID *int64 `json:"before_id,omitempty"` // Optional: Position before this sub-issue ID + ReplaceParent *bool `json:"replace_parent,omitempty"` // Optional: Whether to replace the existing parent +} + +// Remove a sub-issue from the specified repository. +// +// GitHub API docs: https://docs.github.com/rest/issues/sub-issues#remove-sub-issue +// +//meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue +func (s *SubIssueService) Remove(ctx context.Context, owner, repo string, subIssueNumber int64, subIssue SubIssueRequest) (*SubIssue, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/issues/%v/sub_issues", owner, repo, subIssueNumber) + + req, err := s.client.NewRequest("DELETE", u, subIssue) + if err != nil { + return nil, nil, err + } + + si := new(SubIssue) + resp, err := s.client.Do(ctx, req, si) + if err != nil { + return nil, resp, err + } + + return si, resp, nil +} + +// ListByIssue lists all sub-issues for the specified issue. +// +// GitHub API docs: https://docs.github.com/rest/issues/sub-issues#list-sub-issues +// +//meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues +func (s *SubIssueService) ListByIssue(ctx context.Context, owner, repo string, issueNumber int64, opts *IssueListOptions) ([]*SubIssue, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/issues/%v/sub_issues", owner, repo, issueNumber) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var subIssues []*SubIssue + resp, err := s.client.Do(ctx, req, &subIssues) + if err != nil { + return nil, resp, err + } + + return subIssues, resp, nil +} + +// Add adds a sub-issue to the specified issue. +// +// The sub-issue to be added must belong to the same repository owner as the parent issue. +// To replace the existing parent of a sub-issue, set replaceParent to true. +// +// GitHub API docs: https://docs.github.com/rest/issues/sub-issues#add-sub-issue +// +//meta:operation POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues +func (s *SubIssueService) Add(ctx context.Context, owner, repo string, issueNumber int64, subIssue SubIssueRequest) (*SubIssue, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/issues/%v/sub_issues", owner, repo, issueNumber) + req, err := s.client.NewRequest("POST", u, subIssue) + if err != nil { + return nil, nil, err + } + + si := new(SubIssue) + resp, err := s.client.Do(ctx, req, si) + if err != nil { + return nil, resp, err + } + + return si, resp, nil +} + +// Reprioritize changes a sub-issue's priority to a different position in the parent list. +// +// Either afterId or beforeId must be specified to determine the new position of the sub-issue. +// +// GitHub API docs: https://docs.github.com/rest/issues/sub-issues#reprioritize-sub-issue +// +//meta:operation PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority +func (s *SubIssueService) Reprioritize(ctx context.Context, owner, repo string, issueNumber int64, subIssue SubIssueRequest) (*SubIssue, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/issues/%v/sub_issues/priority", owner, repo, issueNumber) + req, err := s.client.NewRequest("PATCH", u, subIssue) + if err != nil { + return nil, nil, err + } + + si := new(SubIssue) + resp, err := s.client.Do(ctx, req, si) + if err != nil { + return nil, resp, err + } + + return si, resp, nil +} diff --git a/github/sub_issue_test.go b/github/sub_issue_test.go new file mode 100644 index 00000000000..9a88b2441d0 --- /dev/null +++ b/github/sub_issue_test.go @@ -0,0 +1,173 @@ +// Copyright 2025 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 TestSubIssuesService_Add(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + input := &SubIssueRequest{SubIssueID: 42} + + mux.HandleFunc("/repos/o/r/issues/1/sub_issues", func(w http.ResponseWriter, r *http.Request) { + v := new(SubIssueRequest) + assertNilError(t, 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":42, "number":1}`) + }) + + ctx := context.Background() + got, _, err := client.SubIssue.Add(ctx, "o", "r", 1, *input) + if err != nil { + t.Errorf("SubIssues.Add returned error: %v", err) + } + + want := &SubIssue{Number: Ptr(1), ID: Int64(42)} + if !cmp.Equal(got, want) { + t.Errorf("SubIssues.Add = %+v, want %+v", got, want) + } + + const methodName = "Add" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.SubIssue.Add(ctx, "o", "r", 1, *input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestSubIssuesService_ListByIssue(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/repos/o/r/issues/1/sub_issues", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + + fmt.Fprint(w, `[{"id":1},{"id":2}]`) + }) + + ctx := context.Background() + opt := &IssueListOptions{} + issues, _, err := client.SubIssue.ListByIssue(ctx, "o", "r", 1, opt) + if err != nil { + t.Errorf("SubIssues.ListByIssue returned error: %v", err) + } + + want := []*SubIssue{{ID: Int64(1)}, {ID: Int64(2)}} + if !cmp.Equal(issues, want) { + t.Errorf("SubIssues.ListByIssue = %+v, want %+v", issues, want) + } + + const methodName = "ListByIssue" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.SubIssue.ListByIssue(ctx, "\n", "\n", 1, opt) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.SubIssue.ListByIssue(ctx, "o", "r", 1, opt) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestSubIssuesService_Remove(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + input := &SubIssueRequest{SubIssueID: 42} + + mux.HandleFunc("/repos/o/r/issues/1/sub_issues", func(w http.ResponseWriter, r *http.Request) { + v := new(SubIssueRequest) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) + + testMethod(t, r, "DELETE") + if !cmp.Equal(v, input) { + t.Errorf("Request body = %+v, want %+v", v, input) + } + + fmt.Fprint(w, `{"id":42, "number":1}`) + }) + + ctx := context.Background() + got, _, err := client.SubIssue.Remove(ctx, "o", "r", 1, *input) + if err != nil { + t.Errorf("SubIssues.Remove returned error: %v", err) + } + + want := &SubIssue{ID: Int64(42), Number: Ptr(1)} + if !cmp.Equal(got, want) { + t.Errorf("SubIssues.Remove = %+v, want %+v", got, want) + } + + const methodName = "Remove" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.SubIssue.Remove(ctx, "o", "r", 1, *input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestSubIssuesService_Reprioritize(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + input := &SubIssueRequest{SubIssueID: 42, AfterID: Int64(5)} + + mux.HandleFunc("/repos/o/r/issues/1/sub_issues/priority", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PATCH") + + v := new(SubIssueRequest) + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) + + testMethod(t, r, "PATCH") + if !cmp.Equal(v, input) { + t.Errorf("Request body = %+v, want %+v", v, input) + } + + fmt.Fprint(w, `{"id":42, "number":1}`) + }) + + ctx := context.Background() + got, _, err := client.SubIssue.Reprioritize(ctx, "o", "r", 1, *input) + if err != nil { + t.Errorf("SubIssues.Reprioritize returned error: %v", err) + } + + want := &SubIssue{ID: Int64(42), Number: Ptr(1)} + if !cmp.Equal(got, want) { + t.Errorf("SubIssues.Reprioritize = %+v, want %+v", got, want) + } + + const methodName = "Reprioritize" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.SubIssue.Reprioritize(ctx, "o", "r", 1, *input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} From b52ed30f57203d7ade8d587b898261ac056f58cc Mon Sep 17 00:00:00 2001 From: Vivek Kumar Sahu Date: Sun, 1 Jun 2025 00:22:54 +0530 Subject: [PATCH 723/751] fix: Add missing relationship and pkg external info for SBOMs (#3582) --- github/dependency_graph.go | 55 +++++++++++++++++++++++++++++++++----- 1 file changed, 49 insertions(+), 6 deletions(-) diff --git a/github/dependency_graph.go b/github/dependency_graph.go index 86a1fe48b98..b202aafff55 100644 --- a/github/dependency_graph.go +++ b/github/dependency_graph.go @@ -28,12 +28,52 @@ type CreationInfo struct { type RepoDependencies struct { SPDXID *string `json:"SPDXID,omitempty"` // Package name - Name *string `json:"name,omitempty"` - VersionInfo *string `json:"versionInfo,omitempty"` - DownloadLocation *string `json:"downloadLocation,omitempty"` - FilesAnalyzed *bool `json:"filesAnalyzed,omitempty"` - LicenseConcluded *string `json:"licenseConcluded,omitempty"` - LicenseDeclared *string `json:"licenseDeclared,omitempty"` + Name *string `json:"name,omitempty"` + VersionInfo *string `json:"versionInfo,omitempty"` + DownloadLocation *string `json:"downloadLocation,omitempty"` + FilesAnalyzed *bool `json:"filesAnalyzed,omitempty"` + LicenseConcluded *string `json:"licenseConcluded,omitempty"` + LicenseDeclared *string `json:"licenseDeclared,omitempty"` + ExternalRefs []*PackageExternalRef `json:"externalRefs,omitempty"` +} + +// PackageExternalRef allows an Package to reference an external sources of additional information, +// like asset identifiers, or downloadable content that are relevant to the package, +// Example for identifiers (e.g., PURL/SWID/CPE) for a package in the SBOM. +// https://spdx.github.io/spdx-spec/v2.3/package-information/#721-external-reference-field +type PackageExternalRef struct { + // ReferenceCategory specifies the external reference categories such + // SECURITY", "PACKAGE-MANAGER", "PERSISTENT-ID", or "OTHER" + // Example: "PACKAGE-MANAGER" + ReferenceCategory string `json:"referenceCategory"` + + // ReferenceType specifies the type of external reference. + // For PACKAGE-MANAGER, it could be "purl"; other types include "cpe22Type", "swid", etc. + ReferenceType string `json:"referenceType"` + + // ReferenceLocator is the actual unique identifier or URI for the external reference. + // Example: "pkg:golang/github.com/spf13/cobra@1.8.1" + ReferenceLocator string `json:"referenceLocator"` +} + +// SBOMRelationship provides information about the relationship between two SPDX elements. +// Element could be packages or files in the SBOM. +// For example, to represent a relationship between two different Files, between a Package and a File, +// between two Packages, or between one SPDXDocument and another SPDXDocument. +// https://spdx.github.io/spdx-spec/v2.3/relationships-between-SPDX-elements/ +type SBOMRelationship struct { + // SPDXElementID is the identifier of the SPDX element that has a relationship. + // Example: "SPDXRef-github-interlynk-io-sbomqs-main-f43c98" + SPDXElementID string `json:"spdxElementId"` + + // RelatedSpdxElement is the identifier of the related SPDX element. + // Example: "SPDXRef-golang-github.comspf13-cobra-1.8.1-75c946" + RelatedSPDXElement string `json:"relatedSpdxElement"` + + // RelationshipType describes the type of relationship between the two elements. + // Such as "DEPENDS_ON", "DESCRIBES", "CONTAINS", etc., as defined by SPDX 2.3. + // Example: "DEPENDS_ON", "CONTAINS", "DESCRIBES", etc. + RelationshipType string `json:"relationshipType"` } // SBOMInfo represents a software bill of materials (SBOM) using SPDX. @@ -53,6 +93,9 @@ type SBOMInfo struct { // List of packages dependencies Packages []*RepoDependencies `json:"packages,omitempty"` + + // List of relationships between packages + Relationships []*SBOMRelationship `json:"relationships,omitempty"` } func (s SBOM) String() string { From 3c5408e78f96138f004621711cac62db14ea030e Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Tue, 3 Jun 2025 16:33:46 +0300 Subject: [PATCH 724/751] chore: Use `any` instead of `interface{}` (#3584) --- .golangci.yml | 1 + github/actions_secrets.go | 4 +- github/actions_workflows.go | 2 +- github/actions_workflows_test.go | 6 +- github/activity_events_test.go | 4 +- github/copilot.go | 18 ++-- github/enterprise_audit_log_test.go | 2 +- github/event.go | 4 +- github/event_test.go | 2 +- github/event_types.go | 76 ++++++++-------- github/event_types_test.go | 14 +-- github/gen-accessors.go | 2 +- github/gen-stringify-test.go | 6 +- github/git_trees.go | 6 +- github/git_trees_test.go | 2 +- github/github-accessors.go | 48 ++++++++++ github/github-accessors_test.go | 66 ++++++++++++++ github/github-stringify_test.go | 7 +- github/github.go | 6 +- github/github_test.go | 10 +-- github/messages.go | 6 +- github/messages_test.go | 2 +- github/orgs_audit_log.go | 8 +- github/orgs_audit_log_test.go | 30 +++---- github/orgs_properties.go | 6 +- github/packages.go | 6 +- github/packages_test.go | 12 +-- github/repos.go | 106 +++++++++++------------ github/repos_deployments.go | 18 ++-- github/repos_environments.go | 4 +- github/repos_hooks.go | 18 ++-- github/repos_hooks_deliveries.go | 2 +- github/repos_hooks_deliveries_test.go | 2 +- github/repos_hooks_test.go | 2 +- github/repos_test.go | 6 +- github/search.go | 2 +- github/strings.go | 2 +- github/strings_test.go | 4 +- scrape/scrape.go | 2 +- test/fields/fields.go | 10 +-- tools/metadata/main_test.go | 6 +- tools/sliceofpointers/sliceofpointers.go | 2 +- 42 files changed, 332 insertions(+), 210 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index d45b62f602b..fbcff90b9c4 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -106,6 +106,7 @@ linters-settings: - name: unexported-naming - name: unexported-return - name: unreachable-code + - name: use-any - name: var-declaration - name: var-naming issues: diff --git a/github/actions_secrets.go b/github/actions_secrets.go index cba85c10042..ff09b4ee588 100644 --- a/github/actions_secrets.go +++ b/github/actions_secrets.go @@ -23,8 +23,8 @@ type PublicKey struct { // do not error out when unmarshaling. func (p *PublicKey) UnmarshalJSON(data []byte) error { var pk struct { - KeyID interface{} `json:"key_id"` - Key *string `json:"key"` + KeyID any `json:"key_id"` + Key *string `json:"key"` } if err := json.Unmarshal(data, &pk); err != nil { diff --git a/github/actions_workflows.go b/github/actions_workflows.go index 0214e6abff2..4d9df69eb0d 100644 --- a/github/actions_workflows.go +++ b/github/actions_workflows.go @@ -53,7 +53,7 @@ type CreateWorkflowDispatchEventRequest struct { // Inputs represents input keys and values configured in the workflow file. // The maximum number of properties is 10. // Default: Any default properties configured in the workflow file will be used when `inputs` are omitted. - Inputs map[string]interface{} `json:"inputs,omitempty"` + Inputs map[string]any `json:"inputs,omitempty"` } // ListWorkflows lists all workflows in a repository. diff --git a/github/actions_workflows_test.go b/github/actions_workflows_test.go index baaae7bfb9d..46e904b3747 100644 --- a/github/actions_workflows_test.go +++ b/github/actions_workflows_test.go @@ -237,7 +237,7 @@ func TestActionsService_CreateWorkflowDispatchEventByID(t *testing.T) { event := CreateWorkflowDispatchEventRequest{ Ref: "d4cfb6e7", - Inputs: map[string]interface{}{ + Inputs: map[string]any{ "key": "value", }, } @@ -281,7 +281,7 @@ func TestActionsService_CreateWorkflowDispatchEventByFileName(t *testing.T) { event := CreateWorkflowDispatchEventRequest{ Ref: "d4cfb6e7", - Inputs: map[string]interface{}{ + Inputs: map[string]any{ "key": "value", }, } @@ -618,7 +618,7 @@ func TestCreateWorkflowDispatchEventRequest_Marshal(t *testing.T) { t.Parallel() testJSONMarshal(t, &CreateWorkflowDispatchEventRequest{}, "{}") - inputs := make(map[string]interface{}, 0) + inputs := make(map[string]any, 0) inputs["key"] = "value" u := &CreateWorkflowDispatchEventRequest{ diff --git a/github/activity_events_test.go b/github/activity_events_test.go index cf38b4b6799..3a58588c32c 100644 --- a/github/activity_events_test.go +++ b/github/activity_events_test.go @@ -437,7 +437,7 @@ func TestActivityService_EventParsePayload_typed(t *testing.T) { } // TestEvent_Payload_untyped checks that unrecognized events are parsed to an -// interface{} value (instead of being discarded or throwing an error), for +// any value (instead of being discarded or throwing an error), for // forward compatibility with new event types. func TestActivityService_EventParsePayload_untyped(t *testing.T) { t.Parallel() @@ -447,7 +447,7 @@ func TestActivityService_EventParsePayload_untyped(t *testing.T) { t.Fatalf("Unmarshal Event returned error: %v", err) } - want := map[string]interface{}{"field": "val"} + want := map[string]any{"field": "val"} got, err := event.ParsePayload() if err != nil { t.Fatalf("ParsePayload returned unexpected error: %v", err) diff --git a/github/copilot.go b/github/copilot.go index b9adfcb4eec..bed83536b41 100644 --- a/github/copilot.go +++ b/github/copilot.go @@ -46,14 +46,14 @@ type ListCopilotSeatsResponse struct { // CopilotSeatDetails represents the details of a Copilot for Business seat. type CopilotSeatDetails struct { // Assignee can either be a User, Team, or Organization. - Assignee interface{} `json:"assignee"` - AssigningTeam *Team `json:"assigning_team,omitempty"` - PendingCancellationDate *string `json:"pending_cancellation_date,omitempty"` - LastActivityAt *Timestamp `json:"last_activity_at,omitempty"` - LastActivityEditor *string `json:"last_activity_editor,omitempty"` - CreatedAt *Timestamp `json:"created_at"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - PlanType *string `json:"plan_type,omitempty"` + Assignee any `json:"assignee"` + AssigningTeam *Team `json:"assigning_team,omitempty"` + PendingCancellationDate *string `json:"pending_cancellation_date,omitempty"` + LastActivityAt *Timestamp `json:"last_activity_at,omitempty"` + LastActivityEditor *string `json:"last_activity_editor,omitempty"` + CreatedAt *Timestamp `json:"created_at"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + PlanType *string `json:"plan_type,omitempty"` } // SeatAssignments represents the number of seats assigned. @@ -203,7 +203,7 @@ func (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error { cp.PlanType = seatDetail.PlanType switch v := seatDetail.Assignee.(type) { - case map[string]interface{}: + case map[string]any: jsonData, err := json.Marshal(seatDetail.Assignee) if err != nil { return err diff --git a/github/enterprise_audit_log_test.go b/github/enterprise_audit_log_test.go index bc2369090fb..5148e8eabb2 100644 --- a/github/enterprise_audit_log_test.go +++ b/github/enterprise_audit_log_test.go @@ -61,7 +61,7 @@ func TestEnterpriseService_GetAuditLog(t *testing.T) { Actor: Ptr("testactor"), CreatedAt: &Timestamp{timestamp}, Org: Ptr("o"), - AdditionalFields: map[string]interface{}{ + AdditionalFields: map[string]any{ "completed_at": "2021-03-07T00:35:08.000Z", "conclusion": "success", "event": "schedule", diff --git a/github/event.go b/github/event.go index e98606bce5d..446db7fa01e 100644 --- a/github/event.go +++ b/github/event.go @@ -27,7 +27,7 @@ func (e Event) String() string { // ParsePayload parses the event payload. For recognized event types, // a value of the corresponding struct type will be returned. -func (e *Event) ParsePayload() (interface{}, error) { +func (e *Event) ParsePayload() (any, error) { // It would be nice if e.Type were the snake_case name of the event, // but the existing interface uses the struct name instead. payload := EventForType(typeToMessageMapping[e.GetType()]) @@ -44,7 +44,7 @@ func (e *Event) ParsePayload() (interface{}, error) { // // Deprecated: Use ParsePayload instead, which returns an error // rather than panics if JSON unmarshaling raw payload fails. -func (e *Event) Payload() (payload interface{}) { +func (e *Event) Payload() (payload any) { var err error payload, err = e.ParsePayload() if err != nil { diff --git a/github/event_test.go b/github/event_test.go index bc37e12f563..08fc56ad063 100644 --- a/github/event_test.go +++ b/github/event_test.go @@ -49,7 +49,7 @@ func TestEvent_Marshal(t *testing.T) { t.Parallel() testJSONMarshal(t, &Event{}, "{}") - l := make(map[string]interface{}) + l := make(map[string]any) l["key"] = "value" jsonMsg, _ := json.Marshal(&l) diff --git a/github/event_types.go b/github/event_types.go index b5369865608..3aa151e5ca7 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -1400,44 +1400,44 @@ func (h HeadCommit) String() string { // PushEventRepository represents the repo object in a PushEvent payload. type PushEventRepository struct { - ID *int64 `json:"id,omitempty"` - NodeID *string `json:"node_id,omitempty"` - Name *string `json:"name,omitempty"` - FullName *string `json:"full_name,omitempty"` - Owner *User `json:"owner,omitempty"` - Private *bool `json:"private,omitempty"` - Description *string `json:"description,omitempty"` - Fork *bool `json:"fork,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - PushedAt *Timestamp `json:"pushed_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - Homepage *string `json:"homepage,omitempty"` - PullsURL *string `json:"pulls_url,omitempty"` - Size *int `json:"size,omitempty"` - StargazersCount *int `json:"stargazers_count,omitempty"` - WatchersCount *int `json:"watchers_count,omitempty"` - Language *string `json:"language,omitempty"` - HasIssues *bool `json:"has_issues,omitempty"` - HasDownloads *bool `json:"has_downloads,omitempty"` - HasWiki *bool `json:"has_wiki,omitempty"` - HasPages *bool `json:"has_pages,omitempty"` - ForksCount *int `json:"forks_count,omitempty"` - Archived *bool `json:"archived,omitempty"` - Disabled *bool `json:"disabled,omitempty"` - OpenIssuesCount *int `json:"open_issues_count,omitempty"` - DefaultBranch *string `json:"default_branch,omitempty"` - MasterBranch *string `json:"master_branch,omitempty"` - Organization *string `json:"organization,omitempty"` - URL *string `json:"url,omitempty"` - ArchiveURL *string `json:"archive_url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - StatusesURL *string `json:"statuses_url,omitempty"` - GitURL *string `json:"git_url,omitempty"` - SSHURL *string `json:"ssh_url,omitempty"` - CloneURL *string `json:"clone_url,omitempty"` - SVNURL *string `json:"svn_url,omitempty"` - Topics []string `json:"topics,omitempty"` - CustomProperties map[string]interface{} `json:"custom_properties,omitempty"` + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Name *string `json:"name,omitempty"` + FullName *string `json:"full_name,omitempty"` + Owner *User `json:"owner,omitempty"` + Private *bool `json:"private,omitempty"` + Description *string `json:"description,omitempty"` + Fork *bool `json:"fork,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + PushedAt *Timestamp `json:"pushed_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + Homepage *string `json:"homepage,omitempty"` + PullsURL *string `json:"pulls_url,omitempty"` + Size *int `json:"size,omitempty"` + StargazersCount *int `json:"stargazers_count,omitempty"` + WatchersCount *int `json:"watchers_count,omitempty"` + Language *string `json:"language,omitempty"` + HasIssues *bool `json:"has_issues,omitempty"` + HasDownloads *bool `json:"has_downloads,omitempty"` + HasWiki *bool `json:"has_wiki,omitempty"` + HasPages *bool `json:"has_pages,omitempty"` + ForksCount *int `json:"forks_count,omitempty"` + Archived *bool `json:"archived,omitempty"` + Disabled *bool `json:"disabled,omitempty"` + OpenIssuesCount *int `json:"open_issues_count,omitempty"` + DefaultBranch *string `json:"default_branch,omitempty"` + MasterBranch *string `json:"master_branch,omitempty"` + Organization *string `json:"organization,omitempty"` + URL *string `json:"url,omitempty"` + ArchiveURL *string `json:"archive_url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + StatusesURL *string `json:"statuses_url,omitempty"` + GitURL *string `json:"git_url,omitempty"` + SSHURL *string `json:"ssh_url,omitempty"` + CloneURL *string `json:"clone_url,omitempty"` + SVNURL *string `json:"svn_url,omitempty"` + Topics []string `json:"topics,omitempty"` + CustomProperties map[string]any `json:"custom_properties,omitempty"` } // PushEventRepoOwner is a basic representation of user/org in a PushEvent payload. diff --git a/github/event_types_test.go b/github/event_types_test.go index cc2a4e1aad8..ea8909db295 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -5644,7 +5644,7 @@ func TestDeploymentEvent_Marshal(t *testing.T) { t.Parallel() testJSONMarshal(t, &DeploymentEvent{}, "{}") - l := make(map[string]interface{}) + l := make(map[string]any) l["key"] = "value" jsonMsg, _ := json.Marshal(&l) @@ -6114,7 +6114,7 @@ func TestDeploymentProtectionRuleEvent_Marshal(t *testing.T) { t.Parallel() testJSONMarshal(t, &DeploymentProtectionRuleEvent{}, "{}") - l := make(map[string]interface{}) + l := make(map[string]any) l["key"] = "value" jsonMsg, _ := json.Marshal(&l) @@ -7099,7 +7099,7 @@ func TestDeploymentStatusEvent_Marshal(t *testing.T) { t.Parallel() testJSONMarshal(t, &DeploymentStatusEvent{}, "{}") - l := make(map[string]interface{}) + l := make(map[string]any) l["key"] = "value" jsonMsg, _ := json.Marshal(&l) @@ -8399,7 +8399,7 @@ func TestPingEvent_Marshal(t *testing.T) { t.Parallel() testJSONMarshal(t, &PingEvent{}, "{}") - l := make(map[string]interface{}) + l := make(map[string]any) l["key"] = "value" hookConfig := new(HookConfig) @@ -8773,7 +8773,7 @@ func TestRepositoryDispatchEvent_Marshal(t *testing.T) { t.Parallel() testJSONMarshal(t, &RepositoryDispatchEvent{}, "{}") - l := make(map[string]interface{}) + l := make(map[string]any) l["key"] = "value" jsonMsg, _ := json.Marshal(&l) @@ -11978,7 +11978,7 @@ func TestWorkflowDispatchEvent_Marshal(t *testing.T) { t.Parallel() testJSONMarshal(t, &WorkflowDispatchEvent{}, "{}") - i := make(map[string]interface{}) + i := make(map[string]any) i["key"] = "value" jsonMsg, _ := json.Marshal(i) @@ -13343,7 +13343,7 @@ func TestMetaEvent_Marshal(t *testing.T) { t.Parallel() testJSONMarshal(t, &MetaEvent{}, "{}") - v := make(map[string]interface{}) + v := make(map[string]any) v["a"] = "b" hookConfig := &HookConfig{ ContentType: Ptr("json"), diff --git a/github/gen-accessors.go b/github/gen-accessors.go index 66450fb7ae9..896734b4c51 100644 --- a/github/gen-accessors.go +++ b/github/gen-accessors.go @@ -59,7 +59,7 @@ var ( } ) -func logf(fmt string, args ...interface{}) { +func logf(fmt string, args ...any) { if *verbose { log.Printf(fmt, args...) } diff --git a/github/gen-stringify-test.go b/github/gen-stringify-test.go index 6c887a0ca2c..6b09e80c3f5 100644 --- a/github/gen-stringify-test.go +++ b/github/gen-stringify-test.go @@ -72,6 +72,8 @@ var ( return `[""]` case "[]Scope{ScopeNone}": return `["(no scope)"]` + case "[]any{nil}": + return "[]" } log.Fatalf("Unhandled zero value: %q", v) return "" @@ -311,6 +313,8 @@ func (t *templateData) addIdentSlice(x *ast.Ident, receiverType, fieldName strin zeroValue = "[]bool{false}" case "Scope": zeroValue = "[]Scope{ScopeNone}" + case "any": + zeroValue = "[]any{nil}" // case "Timestamp": // zeroValue = "&Timestamp{}" default: @@ -377,7 +381,7 @@ func newStructField(receiverType, fieldName, fieldType, zeroValue string, namedS } } -func logf(fmt string, args ...interface{}) { +func logf(fmt string, args ...any) { if *verbose { log.Printf(fmt, args...) } diff --git a/github/git_trees.go b/github/git_trees.go index b8eed58e136..4396dd0160b 100644 --- a/github/git_trees.go +++ b/github/git_trees.go @@ -118,8 +118,8 @@ func (s *GitService) GetTree(ctx context.Context, owner string, repo string, sha // createTree represents the body of a CreateTree request. type createTree struct { - BaseTree string `json:"base_tree,omitempty"` - Entries []interface{} `json:"tree"` + BaseTree string `json:"base_tree,omitempty"` + Entries []any `json:"tree"` } // CreateTree creates a new tree in a repository. If both a tree and a nested @@ -132,7 +132,7 @@ type createTree struct { func (s *GitService) CreateTree(ctx context.Context, owner string, repo string, baseTree string, entries []*TreeEntry) (*Tree, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/trees", owner, repo) - newEntries := make([]interface{}, 0, len(entries)) + newEntries := make([]any, 0, len(entries)) for _, entry := range entries { if entry.Content == nil && entry.SHA == nil { newEntries = append(newEntries, treeEntryWithFileDelete{ diff --git a/github/git_trees_test.go b/github/git_trees_test.go index 0c264470ce2..5d12f3068f6 100644 --- a/github/git_trees_test.go +++ b/github/git_trees_test.go @@ -441,7 +441,7 @@ func TestCreateTree_Marshal(t *testing.T) { u := &createTree{ BaseTree: "bt", - Entries: []interface{}{"e"}, + Entries: []any{"e"}, } want := `{ diff --git a/github/github-accessors.go b/github/github-accessors.go index 307d6e339d3..3193aa9943f 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -1110,6 +1110,14 @@ func (a *AuditEntry) GetActorLocation() *ActorLocation { return a.ActorLocation } +// GetAdditionalFields returns the AdditionalFields map if it's non-nil, an empty map otherwise. +func (a *AuditEntry) GetAdditionalFields() map[string]any { + if a == nil || a.AdditionalFields == nil { + return map[string]any{} + } + return a.AdditionalFields +} + // GetBusiness returns the Business field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetBusiness() string { if a == nil || a.Business == nil { @@ -1134,6 +1142,14 @@ func (a *AuditEntry) GetCreatedAt() Timestamp { return *a.CreatedAt } +// GetData returns the Data map if it's non-nil, an empty map otherwise. +func (a *AuditEntry) GetData() map[string]any { + if a == nil || a.Data == nil { + return map[string]any{} + } + return a.Data +} + // GetDocumentID returns the DocumentID field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetDocumentID() string { if a == nil || a.DocumentID == nil { @@ -6038,6 +6054,14 @@ func (c *CreateUserRequest) GetSuspended() bool { return *c.Suspended } +// GetInputs returns the Inputs map if it's non-nil, an empty map otherwise. +func (c *CreateWorkflowDispatchEventRequest) GetInputs() map[string]any { + if c == nil || c.Inputs == nil { + return map[string]any{} + } + return c.Inputs +} + // GetCreated returns the Created field if it's non-nil, zero value otherwise. func (c *CreationInfo) GetCreated() Timestamp { if c == nil || c.Created == nil { @@ -9942,6 +9966,14 @@ func (h *Hook) GetID() int64 { return *h.ID } +// GetLastResponse returns the LastResponse map if it's non-nil, an empty map otherwise. +func (h *Hook) GetLastResponse() map[string]any { + if h == nil || h.LastResponse == nil { + return map[string]any{} + } + return h.LastResponse +} + // GetName returns the Name field if it's non-nil, zero value otherwise. func (h *Hook) GetName() string { if h == nil || h.Name == nil { @@ -20342,6 +20374,14 @@ func (p *PushEventRepository) GetCreatedAt() Timestamp { return *p.CreatedAt } +// GetCustomProperties returns the CustomProperties map if it's non-nil, an empty map otherwise. +func (p *PushEventRepository) GetCustomProperties() map[string]any { + if p == nil || p.CustomProperties == nil { + return map[string]any{} + } + return p.CustomProperties +} + // GetDefaultBranch returns the DefaultBranch field if it's non-nil, zero value otherwise. func (p *PushEventRepository) GetDefaultBranch() string { if p == nil || p.DefaultBranch == nil { @@ -21486,6 +21526,14 @@ func (r *Repository) GetCreatedAt() Timestamp { return *r.CreatedAt } +// GetCustomProperties returns the CustomProperties map if it's non-nil, an empty map otherwise. +func (r *Repository) GetCustomProperties() map[string]any { + if r == nil || r.CustomProperties == nil { + return map[string]any{} + } + return r.CustomProperties +} + // GetDefaultBranch returns the DefaultBranch field if it's non-nil, zero value otherwise. func (r *Repository) GetDefaultBranch() string { if r == nil || r.DefaultBranch == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index f2a51a6028c..1bb42959961 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -1441,6 +1441,17 @@ func TestAuditEntry_GetActorLocation(tt *testing.T) { a.GetActorLocation() } +func TestAuditEntry_GetAdditionalFields(tt *testing.T) { + tt.Parallel() + zeroValue := map[string]any{} + a := &AuditEntry{AdditionalFields: zeroValue} + a.GetAdditionalFields() + a = &AuditEntry{} + a.GetAdditionalFields() + a = nil + a.GetAdditionalFields() +} + func TestAuditEntry_GetBusiness(tt *testing.T) { tt.Parallel() var zeroValue string @@ -1474,6 +1485,17 @@ func TestAuditEntry_GetCreatedAt(tt *testing.T) { a.GetCreatedAt() } +func TestAuditEntry_GetData(tt *testing.T) { + tt.Parallel() + zeroValue := map[string]any{} + a := &AuditEntry{Data: zeroValue} + a.GetData() + a = &AuditEntry{} + a.GetData() + a = nil + a.GetData() +} + func TestAuditEntry_GetDocumentID(tt *testing.T) { tt.Parallel() var zeroValue string @@ -7872,6 +7894,17 @@ func TestCreateUserRequest_GetSuspended(tt *testing.T) { c.GetSuspended() } +func TestCreateWorkflowDispatchEventRequest_GetInputs(tt *testing.T) { + tt.Parallel() + zeroValue := map[string]any{} + c := &CreateWorkflowDispatchEventRequest{Inputs: zeroValue} + c.GetInputs() + c = &CreateWorkflowDispatchEventRequest{} + c.GetInputs() + c = nil + c.GetInputs() +} + func TestCreationInfo_GetCreated(tt *testing.T) { tt.Parallel() var zeroValue Timestamp @@ -12859,6 +12892,17 @@ func TestHook_GetID(tt *testing.T) { h.GetID() } +func TestHook_GetLastResponse(tt *testing.T) { + tt.Parallel() + zeroValue := map[string]any{} + h := &Hook{LastResponse: zeroValue} + h.GetLastResponse() + h = &Hook{} + h.GetLastResponse() + h = nil + h.GetLastResponse() +} + func TestHook_GetName(tt *testing.T) { tt.Parallel() var zeroValue string @@ -26211,6 +26255,17 @@ func TestPushEventRepository_GetCreatedAt(tt *testing.T) { p.GetCreatedAt() } +func TestPushEventRepository_GetCustomProperties(tt *testing.T) { + tt.Parallel() + zeroValue := map[string]any{} + p := &PushEventRepository{CustomProperties: zeroValue} + p.GetCustomProperties() + p = &PushEventRepository{} + p.GetCustomProperties() + p = nil + p.GetCustomProperties() +} + func TestPushEventRepository_GetDefaultBranch(tt *testing.T) { tt.Parallel() var zeroValue string @@ -27700,6 +27755,17 @@ func TestRepository_GetCreatedAt(tt *testing.T) { r.GetCreatedAt() } +func TestRepository_GetCustomProperties(tt *testing.T) { + tt.Parallel() + zeroValue := map[string]any{} + r := &Repository{CustomProperties: zeroValue} + r.GetCustomProperties() + r = &Repository{} + r.GetCustomProperties() + r = nil + r.GetCustomProperties() +} + func TestRepository_GetDefaultBranch(tt *testing.T) { tt.Parallel() var zeroValue string diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index 0100a4c202f..4563959967e 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -1238,6 +1238,8 @@ func TestPackageNPMMetadata_String(t *testing.T) { NodeVersion: Ptr(""), NPMVersion: Ptr(""), HasShrinkwrap: Ptr(false), + Maintainers: []any{nil}, + Contributors: []any{nil}, Keywords: []string{""}, Files: []string{""}, OS: []string{""}, @@ -1249,7 +1251,7 @@ func TestPackageNPMMetadata_String(t *testing.T) { PublishedViaActions: Ptr(false), DeletedByID: Ptr(int64(0)), } - want := `github.PackageNPMMetadata{Name:"", Version:"", NPMUser:"", Description:"", GitHead:"", Homepage:"", License:"", Main:"", ID:"", NodeVersion:"", NPMVersion:"", HasShrinkwrap:false, Keywords:[""], Files:[""], OS:[""], CPU:[""], Readme:"", InstallationCommand:"", ReleaseID:0, CommitOID:"", PublishedViaActions:false, DeletedByID:0}` + want := `github.PackageNPMMetadata{Name:"", Version:"", NPMUser:"", Description:"", GitHead:"", Homepage:"", License:"", Main:"", ID:"", NodeVersion:"", NPMVersion:"", HasShrinkwrap:false, Maintainers:[], Contributors:[], Keywords:[""], Files:[""], OS:[""], CPU:[""], Readme:"", InstallationCommand:"", ReleaseID:0, CommitOID:"", PublishedViaActions:false, DeletedByID:0}` if got := v.String(); got != want { t.Errorf("PackageNPMMetadata.String = %v, want %v", got, want) } @@ -1325,6 +1327,7 @@ func TestPackageVersion_String(t *testing.T) { Draft: Ptr(false), Prerelease: Ptr(false), ContainerMetadata: &PackageEventContainerMetadata{}, + DockerMetadata: []any{nil}, NPMMetadata: &PackageNPMMetadata{}, PackageURL: Ptr(""), Author: &User{}, @@ -1332,7 +1335,7 @@ func TestPackageVersion_String(t *testing.T) { InstallationCommand: Ptr(""), DeletedAt: &Timestamp{}, } - want := `github.PackageVersion{ID:0, Name:"", URL:"", PackageHTMLURL:"", License:"", Description:"", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Version:"", Summary:"", BodyHTML:"", Release:github.PackageRelease{}, Manifest:"", HTMLURL:"", TagName:"", TargetCommitish:"", TargetOID:"", Draft:false, Prerelease:false, ContainerMetadata:github.PackageEventContainerMetadata{}, NPMMetadata:github.PackageNPMMetadata{}, PackageURL:"", Author:github.User{}, SourceURL:"", InstallationCommand:"", DeletedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}` + want := `github.PackageVersion{ID:0, Name:"", URL:"", PackageHTMLURL:"", License:"", Description:"", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Version:"", Summary:"", BodyHTML:"", Release:github.PackageRelease{}, Manifest:"", HTMLURL:"", TagName:"", TargetCommitish:"", TargetOID:"", Draft:false, Prerelease:false, ContainerMetadata:github.PackageEventContainerMetadata{}, DockerMetadata:[], NPMMetadata:github.PackageNPMMetadata{}, PackageURL:"", Author:github.User{}, SourceURL:"", InstallationCommand:"", DeletedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}` if got := v.String(); got != want { t.Errorf("PackageVersion.String = %v, want %v", got, want) } diff --git a/github/github.go b/github/github.go index c366820383d..513f9fe4bcd 100644 --- a/github/github.go +++ b/github/github.go @@ -303,7 +303,7 @@ type RawOptions struct { // addOptions adds the parameters in opts as URL query parameters to s. opts // must be a struct whose fields may contain "url" tags. -func addOptions(s string, opts interface{}) (string, error) { +func addOptions(s string, opts any) (string, error) { v := reflect.ValueOf(opts) if v.Kind() == reflect.Ptr && v.IsNil() { return s, nil @@ -526,7 +526,7 @@ func WithVersion(version string) RequestOption { // Relative URLs should always be specified without a preceding slash. If // specified, the value pointed to by body is JSON encoded and included as the // request body. -func (c *Client) NewRequest(method, urlStr string, body interface{}, opts ...RequestOption) (*http.Request, error) { +func (c *Client) NewRequest(method, urlStr string, body any, opts ...RequestOption) (*http.Request, error) { if !strings.HasSuffix(c.BaseURL.Path, "/") { return nil, fmt.Errorf("baseURL must have a trailing slash, but %q does not", c.BaseURL) } @@ -1023,7 +1023,7 @@ func (c *Client) bareDoUntilFound(ctx context.Context, req *http.Request, maxRed // // The provided ctx must be non-nil, if it is nil an error is returned. If it // is canceled or times out, ctx.Err() will be returned. -func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*Response, error) { +func (c *Client) Do(ctx context.Context, req *http.Request, v any) (*Response, error) { resp, err := c.BareDo(ctx, req) if err != nil { return resp, err diff --git a/github/github_test.go b/github/github_test.go index 6069b3ebf4a..08a6eaaf6fc 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -162,7 +162,7 @@ func testBody(t *testing.T, r *http.Request, want string) { // Test whether the marshaling of v produces JSON that corresponds // to the want string. -func testJSONMarshal(t *testing.T, v interface{}, want string) { +func testJSONMarshal(t *testing.T, v any, want string) { t.Helper() // Unmarshal the wanted JSON, to verify its correctness, and marshal it back // to sort the keys. @@ -188,7 +188,7 @@ func testJSONMarshal(t *testing.T, v interface{}, want string) { // Test whether the v fields have the url tag and the parsing of v // produces query parameters that corresponds to the want string. -func testAddURLOptions(t *testing.T, url string, v interface{}, want string) { +func testAddURLOptions(t *testing.T, url string, v any, want string) { t.Helper() vt := reflect.Indirect(reflect.ValueOf(v)).Type() @@ -291,7 +291,7 @@ func testErrorResponseForStatusCode(t *testing.T, code int) { } } -func assertNoDiff(t *testing.T, want, got interface{}) { +func assertNoDiff(t *testing.T, want, got any) { t.Helper() if diff := cmp.Diff(want, got); diff != "" { t.Errorf("diff mismatch (-want +got):\n%v", diff) @@ -567,7 +567,7 @@ func TestNewRequest_invalidJSON(t *testing.T) { c := NewClient(nil) type T struct { - A map[interface{}]interface{} + A map[any]any } _, err := c.NewRequest("GET", ".", &T{}) @@ -1140,7 +1140,7 @@ func TestDo_preservesResponseInHTTPError(t *testing.T) { req, _ := client.NewRequest("GET", ".", nil) var resp *Response - var data interface{} + var data any resp, err := client.Do(context.Background(), req, &data) if err == nil { diff --git a/github/messages.go b/github/messages.go index 2b5cce7504a..95cb94b0eb5 100644 --- a/github/messages.go +++ b/github/messages.go @@ -45,7 +45,7 @@ const ( var ( // eventTypeMapping maps webhooks types to their corresponding go-github struct types. - eventTypeMapping = map[string]interface{}{ + eventTypeMapping = map[string]any{ "branch_protection_configuration": &BranchProtectionConfigurationEvent{}, "branch_protection_rule": &BranchProtectionRuleEvent{}, "check_run": &CheckRunEvent{}, @@ -318,7 +318,7 @@ func DeliveryID(r *http.Request) string { // ... // } // } -func ParseWebHook(messageType string, payload []byte) (interface{}, error) { +func ParseWebHook(messageType string, payload []byte) (any, error) { eventType, ok := messageToTypeName[messageType] if !ok { return nil, fmt.Errorf("unknown X-Github-Event in message: %v", messageType) @@ -344,7 +344,7 @@ func MessageTypes() []string { // EventForType returns an empty struct matching the specified GitHub event type. // If messageType does not match any known event types, it returns nil. -func EventForType(messageType string) interface{} { +func EventForType(messageType string) any { prototype := eventTypeMapping[messageType] if prototype == nil { return nil diff --git a/github/messages_test.go b/github/messages_test.go index a2b9feac92b..3c8cedfeab8 100644 --- a/github/messages_test.go +++ b/github/messages_test.go @@ -260,7 +260,7 @@ func TestValidatePayload_ValidContentTypeParams(t *testing.T) { func TestParseWebHook(t *testing.T) { t.Parallel() tests := []struct { - payload interface{} + payload any messageType string }{ { diff --git a/github/orgs_audit_log.go b/github/orgs_audit_log.go index 025c5d02327..409faebbca2 100644 --- a/github/orgs_audit_log.go +++ b/github/orgs_audit_log.go @@ -50,10 +50,10 @@ type AuditEntry struct { UserID *int64 `json:"user_id,omitempty"` // Some events types have a data field that contains additional information about the event. - Data map[string]interface{} `json:"data,omitempty"` + Data map[string]any `json:"data,omitempty"` // All fields that are not explicitly defined in the struct are captured here. - AdditionalFields map[string]interface{} `json:"-"` + AdditionalFields map[string]any `json:"-"` } func (a *AuditEntry) UnmarshalJSON(data []byte) error { @@ -67,7 +67,7 @@ func (a *AuditEntry) UnmarshalJSON(data []byte) error { if err != nil { return err } - definedFields := map[string]interface{}{} + definedFields := map[string]any{} if err := json.Unmarshal(rawDefinedFields, &definedFields); err != nil { return err } @@ -99,7 +99,7 @@ func (a *AuditEntry) MarshalJSON() ([]byte, error) { if len(a.AdditionalFields) == 0 { return defBytes, err } - resMap := map[string]interface{}{} + resMap := map[string]any{} if err := json.Unmarshal(defBytes, &resMap); err != nil { return nil, err } diff --git a/github/orgs_audit_log_test.go b/github/orgs_audit_log_test.go index f4b617c587b..376956c4a39 100644 --- a/github/orgs_audit_log_test.go +++ b/github/orgs_audit_log_test.go @@ -108,7 +108,7 @@ func TestOrganizationService_GetAuditLog(t *testing.T) { OrgID: Ptr(int64(1)), TokenID: Ptr(int64(1)), TokenScopes: Ptr("gist,repo:read"), - AdditionalFields: map[string]interface{}{ + AdditionalFields: map[string]any{ "actor_ip": "10.0.0.1", "active": true, "cancelled_at": "2021-03-07T00:35:08.000Z", @@ -121,13 +121,13 @@ func TestOrganizationService_GetAuditLog(t *testing.T) { "name": "Code scanning - action", "oauth_application_id": float64(1), "old_permission": "read", - "overridden_codes": []interface{}{"review_policy_not_satisfied"}, + "overridden_codes": []any{"review_policy_not_satisfied"}, "permission": "admin", "programmatic_access_type": "GitHub App server-to-server token", "pull_request_id": float64(1), "pull_request_title": "a pr title", "pull_request_url": "https://github.com/testorg/testrepo/pull/1", - "reasons": []interface{}{map[string]interface{}{ + "reasons": []any{map[string]any{ "code": "a code", "message": "a message", }}, @@ -140,8 +140,8 @@ func TestOrganizationService_GetAuditLog(t *testing.T) { "user_agent": "a user agent", "workflow_id": float64(123456), "workflow_run_id": float64(628312345), - "events": []interface{}{"code_scanning_alert"}, - "config": map[string]interface{}{ + "events": []any{"code_scanning_alert"}, + "config": map[string]any{ "content_type": "json", "insecure_ssl": "0", "url": "https://example.com/deadbeef-new-hook", @@ -241,11 +241,11 @@ func TestAuditEntry_Marshal(t *testing.T) { TokenID: Ptr(int64(1)), TokenScopes: Ptr("ts"), User: Ptr("u"), - Data: map[string]interface{}{ + Data: map[string]any{ "old_name": "on", "old_login": "ol", }, - AdditionalFields: map[string]interface{}{ + AdditionalFields: map[string]any{ "active": false, "active_was": false, "actor_ip": "aip", @@ -253,10 +253,10 @@ func TestAuditEntry_Marshal(t *testing.T) { "cancelled_at": "2021-03-07T00:35:08.000Z", "completed_at": "2021-03-07T00:35:08.000Z", "conclusion": "c", - "config": map[string]interface{}{ + "config": map[string]any{ "url": "s", }, - "config_was": map[string]interface{}{ + "config_was": map[string]any{ "url": "s", }, "content_type": "ct", @@ -264,8 +264,8 @@ func TestAuditEntry_Marshal(t *testing.T) { "emoji": "e", "environment_name": "en", "event": "e", - "events": []interface{}{"s"}, - "events_were": []interface{}{"s"}, + "events": []any{"s"}, + "events_were": []any{"s"}, "explanation": "e", "fingerprint": "f", "head_branch": "hb", @@ -286,8 +286,8 @@ func TestAuditEntry_Marshal(t *testing.T) { "pull_request_title": "prt", "pull_request_url": "pru", "read_only": "ro", - "reasons": []interface{}{ - map[string]interface{}{ + "reasons": []any{ + map[string]any{ "code": "c", "message": "m", }, @@ -300,9 +300,9 @@ func TestAuditEntry_Marshal(t *testing.T) { "runner_group_id": 1, "runner_group_name": "rgn", "runner_id": 1, - "runner_labels": []interface{}{"s"}, + "runner_labels": []any{"s"}, "runner_name": "rn", - "secrets_passed": []interface{}{"s"}, + "secrets_passed": []any{"s"}, "source_version": "sv", "started_at": "2006-01-02T15:04:05Z", "target_login": "tl", diff --git a/github/orgs_properties.go b/github/orgs_properties.go index f59d9f467ed..09abdffbfcb 100644 --- a/github/orgs_properties.go +++ b/github/orgs_properties.go @@ -44,8 +44,8 @@ type RepoCustomPropertyValue struct { // CustomPropertyValue represents a custom property value. type CustomPropertyValue struct { - PropertyName string `json:"property_name"` - Value interface{} `json:"value"` + PropertyName string `json:"property_name"` + Value any `json:"value"` } // UnmarshalJSON implements the json.Unmarshaler interface. @@ -66,7 +66,7 @@ func (cpv *CustomPropertyValue) UnmarshalJSON(data []byte) error { cpv.Value = nil case string: cpv.Value = v - case []interface{}: + case []any: strSlice := make([]string, len(v)) for i, item := range v { str, ok := item.(string) diff --git a/github/packages.go b/github/packages.go index 1eed77e804d..cc04a044d7d 100644 --- a/github/packages.go +++ b/github/packages.go @@ -63,7 +63,7 @@ type PackageVersion struct { Draft *bool `json:"draft,omitempty"` Prerelease *bool `json:"prerelease,omitempty"` ContainerMetadata *PackageEventContainerMetadata `json:"container_metadata,omitempty"` - DockerMetadata []interface{} `json:"docker_metadata,omitempty"` + DockerMetadata []any `json:"docker_metadata,omitempty"` NPMMetadata *PackageNPMMetadata `json:"npm_metadata,omitempty"` NugetMetadata []*PackageNugetMetadata `json:"nuget_metadata,omitempty"` RubyMetadata map[string]any `json:"ruby_metadata,omitempty"` @@ -296,8 +296,8 @@ type PackageNPMMetadata struct { NodeVersion *string `json:"node_version,omitempty"` NPMVersion *string `json:"npm_version,omitempty"` HasShrinkwrap *bool `json:"has_shrinkwrap,omitempty"` - Maintainers []interface{} `json:"maintainers,omitempty"` - Contributors []interface{} `json:"contributors,omitempty"` + Maintainers []any `json:"maintainers,omitempty"` + Contributors []any `json:"contributors,omitempty"` Engines map[string]string `json:"engines,omitempty"` Keywords []string `json:"keywords,omitempty"` Files []string `json:"files,omitempty"` diff --git a/github/packages_test.go b/github/packages_test.go index 9d2dcf10850..fa72bfcceea 100644 --- a/github/packages_test.go +++ b/github/packages_test.go @@ -243,7 +243,7 @@ func TestPackageVersion_Marshal(t *testing.T) { ContainerMetadata: &PackageEventContainerMetadata{ Labels: map[string]any{"l1": true, "l2": "a"}, }, - DockerMetadata: []interface{}{"a", "b"}, + DockerMetadata: []any{"a", "b"}, NPMMetadata: Ptr(PackageNPMMetadata{ Name: Ptr("n"), }), @@ -1208,15 +1208,15 @@ func TestPackageNPMMetadata_Marshal(t *testing.T) { Repository: map[string]string{"k1": "v1"}, Engines: map[string]string{"k1": "v1"}, Directories: map[string]string{"k1": "v1"}, - Scripts: map[string]interface{}{"k1": 1}, - Bin: map[string]interface{}{"k1": true}, - Man: map[string]interface{}{"k1": "v1"}, + Scripts: map[string]any{"k1": 1}, + Bin: map[string]any{"k1": true}, + Man: map[string]any{"k1": "v1"}, Keywords: []string{"kw1", "kw2"}, Files: []string{"f1", "f2"}, OS: []string{"os1", "os2"}, CPU: []string{"cpu1", "cpu2"}, - Maintainers: []interface{}{"m1", "m2"}, - Contributors: []interface{}{"c1", "c2"}, + Maintainers: []any{"m1", "m2"}, + Contributors: []any{"c1", "c2"}, }, want: `{ "name": "n", diff --git a/github/repos.go b/github/repos.go index c4ef5d59877..71483534363 100644 --- a/github/repos.go +++ b/github/repos.go @@ -27,59 +27,59 @@ 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"` - WebCommitSignoffRequired *bool `json:"web_commit_signoff_required,omitempty"` - DeleteBranchOnMerge *bool `json:"delete_branch_on_merge,omitempty"` - UseSquashPRTitleAsDefault *bool `json:"use_squash_pr_title_as_default,omitempty"` - SquashMergeCommitTitle *string `json:"squash_merge_commit_title,omitempty"` // Can be one of: "PR_TITLE", "COMMIT_OR_PR_TITLE" - SquashMergeCommitMessage *string `json:"squash_merge_commit_message,omitempty"` // Can be one of: "PR_BODY", "COMMIT_MESSAGES", "BLANK" - MergeCommitTitle *string `json:"merge_commit_title,omitempty"` // Can be one of: "PR_TITLE", "MERGE_MESSAGE" - MergeCommitMessage *string `json:"merge_commit_message,omitempty"` // Can be one of: "PR_BODY", "PR_TITLE", "BLANK" - Topics []string `json:"topics,omitempty"` - CustomProperties map[string]interface{} `json:"custom_properties,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"` + WebCommitSignoffRequired *bool `json:"web_commit_signoff_required,omitempty"` + DeleteBranchOnMerge *bool `json:"delete_branch_on_merge,omitempty"` + UseSquashPRTitleAsDefault *bool `json:"use_squash_pr_title_as_default,omitempty"` + SquashMergeCommitTitle *string `json:"squash_merge_commit_title,omitempty"` // Can be one of: "PR_TITLE", "COMMIT_OR_PR_TITLE" + SquashMergeCommitMessage *string `json:"squash_merge_commit_message,omitempty"` // Can be one of: "PR_BODY", "COMMIT_MESSAGES", "BLANK" + MergeCommitTitle *string `json:"merge_commit_title,omitempty"` // Can be one of: "PR_TITLE", "MERGE_MESSAGE" + MergeCommitMessage *string `json:"merge_commit_message,omitempty"` // Can be one of: "PR_BODY", "PR_TITLE", "BLANK" + Topics []string `json:"topics,omitempty"` + CustomProperties map[string]any `json:"custom_properties,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"` diff --git a/github/repos_deployments.go b/github/repos_deployments.go index 6277ac2151a..ded36a95b40 100644 --- a/github/repos_deployments.go +++ b/github/repos_deployments.go @@ -32,15 +32,15 @@ type Deployment struct { // DeploymentRequest represents a deployment request. type DeploymentRequest struct { - Ref *string `json:"ref,omitempty"` - Task *string `json:"task,omitempty"` - AutoMerge *bool `json:"auto_merge,omitempty"` - RequiredContexts *[]string `json:"required_contexts,omitempty"` - Payload interface{} `json:"payload,omitempty"` - Environment *string `json:"environment,omitempty"` - Description *string `json:"description,omitempty"` - TransientEnvironment *bool `json:"transient_environment,omitempty"` - ProductionEnvironment *bool `json:"production_environment,omitempty"` + Ref *string `json:"ref,omitempty"` + Task *string `json:"task,omitempty"` + AutoMerge *bool `json:"auto_merge,omitempty"` + RequiredContexts *[]string `json:"required_contexts,omitempty"` + Payload any `json:"payload,omitempty"` + Environment *string `json:"environment,omitempty"` + Description *string `json:"description,omitempty"` + TransientEnvironment *bool `json:"transient_environment,omitempty"` + ProductionEnvironment *bool `json:"production_environment,omitempty"` } // DeploymentsListOptions specifies the optional parameters to the diff --git a/github/repos_environments.go b/github/repos_environments.go index d3e34fa8f80..eab51a11b1d 100644 --- a/github/repos_environments.go +++ b/github/repos_environments.go @@ -62,8 +62,8 @@ type ProtectionRule struct { // RequiredReviewer represents a required reviewer. type RequiredReviewer struct { - Type *string `json:"type,omitempty"` - Reviewer interface{} `json:"reviewer,omitempty"` + Type *string `json:"type,omitempty"` + Reviewer any `json:"reviewer,omitempty"` } // EnvironmentListOptions specifies the optional parameters to the diff --git a/github/repos_hooks.go b/github/repos_hooks.go index d221db21b6b..67b80b857f1 100644 --- a/github/repos_hooks.go +++ b/github/repos_hooks.go @@ -39,15 +39,15 @@ type WebHookAuthor = CommitAuthor // Hook represents a GitHub (web and service) hook for a repository. type Hook struct { - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - URL *string `json:"url,omitempty"` - ID *int64 `json:"id,omitempty"` - Type *string `json:"type,omitempty"` - Name *string `json:"name,omitempty"` - TestURL *string `json:"test_url,omitempty"` - PingURL *string `json:"ping_url,omitempty"` - LastResponse map[string]interface{} `json:"last_response,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + URL *string `json:"url,omitempty"` + ID *int64 `json:"id,omitempty"` + Type *string `json:"type,omitempty"` + Name *string `json:"name,omitempty"` + TestURL *string `json:"test_url,omitempty"` + PingURL *string `json:"ping_url,omitempty"` + LastResponse map[string]any `json:"last_response,omitempty"` // Only the following fields are used when creating a hook. // Config is required. diff --git a/github/repos_hooks_deliveries.go b/github/repos_hooks_deliveries.go index bcd4b336e53..526d82c6f7c 100644 --- a/github/repos_hooks_deliveries.go +++ b/github/repos_hooks_deliveries.go @@ -152,7 +152,7 @@ func (s *RepositoriesService) RedeliverHookDelivery(ctx context.Context, owner, // ParseRequestPayload parses the request payload. For recognized event types, // a value of the corresponding struct type will be returned. -func (d *HookDelivery) ParseRequestPayload() (interface{}, error) { +func (d *HookDelivery) ParseRequestPayload() (any, error) { eType, ok := messageToTypeName[d.GetEvent()] if !ok { return nil, fmt.Errorf("unsupported event type %q", d.GetEvent()) diff --git a/github/repos_hooks_deliveries_test.go b/github/repos_hooks_deliveries_test.go index 91ff3ad7113..b3f8d7d570a 100644 --- a/github/repos_hooks_deliveries_test.go +++ b/github/repos_hooks_deliveries_test.go @@ -142,7 +142,7 @@ func TestRepositoriesService_RedeliverHookDelivery(t *testing.T) { }) } -var hookDeliveryPayloadTypeToStruct = map[string]interface{}{ +var hookDeliveryPayloadTypeToStruct = map[string]any{ "check_run": &CheckRunEvent{}, "check_suite": &CheckSuiteEvent{}, "code_scanning_alert": &CodeScanningAlertEvent{}, diff --git a/github/repos_hooks_test.go b/github/repos_hooks_test.go index 17b13daadd4..059d5371034 100644 --- a/github/repos_hooks_test.go +++ b/github/repos_hooks_test.go @@ -536,7 +536,7 @@ func TestBranchHook_Marshal(t *testing.T) { Name: Ptr("name"), TestURL: Ptr("testurl"), PingURL: Ptr("pingurl"), - LastResponse: map[string]interface{}{ + LastResponse: map[string]any{ "item": "item", }, Config: &HookConfig{ContentType: Ptr("json")}, diff --git a/github/repos_test.go b/github/repos_test.go index 716abaf9aac..a62711a1454 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -4167,7 +4167,7 @@ func TestRepositoriesService_Dispatch(t *testing.T) { ctx := context.Background() - testCases := []interface{}{ + testCases := []any{ nil, struct { Foo string @@ -4536,12 +4536,12 @@ func TestRepository_UnmarshalJSON(t *testing.T) { }, "Partial project": { data: []byte(`{"id":10270722,"name":"go-github","private":false,"owner":{"login":"google"},"created_at":"2013-05-24T16:42:58Z","license":{},"topics":["github"],"permissions":{"pull":true},"custom_properties":{},"organization":{"login":"google"}}`), - wantRepository: Repository{ID: Ptr(int64(10270722)), Name: Ptr("go-github"), Private: Ptr(false), Owner: &User{Login: Ptr("google")}, CreatedAt: &Timestamp{time.Date(2013, 5, 24, 16, 42, 58, 0, time.UTC)}, License: &License{}, Topics: []string{"github"}, Permissions: map[string]bool{"pull": true}, CustomProperties: map[string]interface{}{}, Organization: &Organization{Login: Ptr("google")}}, + wantRepository: Repository{ID: Ptr(int64(10270722)), Name: Ptr("go-github"), Private: Ptr(false), Owner: &User{Login: Ptr("google")}, CreatedAt: &Timestamp{time.Date(2013, 5, 24, 16, 42, 58, 0, time.UTC)}, License: &License{}, Topics: []string{"github"}, Permissions: map[string]bool{"pull": true}, CustomProperties: map[string]any{}, Organization: &Organization{Login: Ptr("google")}}, wantErr: false, }, "With custom properties": { data: []byte(`{"custom_properties":{"boolean":"false","text":"a","single-select":"a","multi-select":["a","b","c"]}}`), - wantRepository: Repository{CustomProperties: map[string]interface{}{"boolean": "false", "text": "a", "single-select": "a", "multi-select": []interface{}{"a", "b", "c"}}}, + wantRepository: Repository{CustomProperties: map[string]any{"boolean": "false", "text": "a", "single-select": "a", "multi-select": []any{"a", "b", "c"}}}, wantErr: false, }, } diff --git a/github/search.go b/github/search.go index 54bc6d5e1f4..8cdb634225d 100644 --- a/github/search.go +++ b/github/search.go @@ -300,7 +300,7 @@ func (s *SearchService) Labels(ctx context.Context, repoID int64, query string, // // If searchParameters.Query includes multiple condition, it MUST NOT include "+" as condition separator. // For example, querying with "language:c++" and "leveldb", then searchParameters.Query should be "language:c++ leveldb" but not "language:c+++leveldb". -func (s *SearchService) search(ctx context.Context, searchType string, parameters *searchParameters, opts *SearchOptions, result interface{}) (*Response, error) { +func (s *SearchService) search(ctx context.Context, searchType string, parameters *searchParameters, opts *SearchOptions, result any) (*Response, error) { params, err := qs.Values(opts) if err != nil { return nil, err diff --git a/github/strings.go b/github/strings.go index f5e61aa3265..46fd55ad142 100644 --- a/github/strings.go +++ b/github/strings.go @@ -16,7 +16,7 @@ var timestampType = reflect.TypeOf(Timestamp{}) // Stringify attempts to create a reasonable string representation of types in // the GitHub library. It does things like resolve pointers to their values // and omits struct fields with nil values. -func Stringify(message interface{}) string { +func Stringify(message any) string { var buf bytes.Buffer v := reflect.ValueOf(message) stringifyValue(&buf, v) diff --git a/github/strings_test.go b/github/strings_test.go index 98906b4d41d..0e6203c096c 100644 --- a/github/strings_test.go +++ b/github/strings_test.go @@ -16,7 +16,7 @@ func TestStringify(t *testing.T) { var nilPointer *string var tests = []struct { - in interface{} + in any out string }{ // basic types @@ -89,7 +89,7 @@ func TestStringify(t *testing.T) { func TestString(t *testing.T) { t.Parallel() var tests = []struct { - in interface{} + in any out string }{ {CodeResult{Name: Ptr("n")}, `github.CodeResult{Name:"n"}`}, diff --git a/scrape/scrape.go b/scrape/scrape.go index dc7aa88fad4..9f218b7f172 100644 --- a/scrape/scrape.go +++ b/scrape/scrape.go @@ -92,7 +92,7 @@ func (c *Client) LoadCookies(v []byte) error { // get fetches a urlStr (a GitHub URL relative to the client's baseURL), and // returns the parsed response document. -func (c *Client) get(urlStr string, a ...interface{}) (*goquery.Document, error) { +func (c *Client) get(urlStr string, a ...any) (*goquery.Document, error) { u, err := c.baseURL.Parse(fmt.Sprintf(urlStr, a...)) if err != nil { return nil, fmt.Errorf("error parsing URL: %q: %v", urlStr, err) diff --git a/test/fields/fields.go b/test/fields/fields.go index f35abb6de1b..1f48edfe514 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -47,7 +47,7 @@ func main() { for _, tt := range []struct { url string - typ interface{} + typ any }{ {"users/octocat", &github.User{}}, {"user", &github.User{}}, @@ -66,7 +66,7 @@ func main() { // testType fetches the JSON resource at urlStr and compares its keys to the // struct fields of typ. -func testType(urlStr string, typ interface{}) error { +func testType(urlStr string, typ any) error { slice := reflect.Indirect(reflect.ValueOf(typ)).Kind() == reflect.Slice req, err := client.NewRequest("GET", urlStr, nil) @@ -82,9 +82,9 @@ func testType(urlStr string, typ interface{}) error { } // unmarshal directly to a map - var m1 map[string]interface{} + var m1 map[string]any if slice { - var s []map[string]interface{} + var s []map[string]any err = json.Unmarshal(*raw, &s) if err != nil { return err @@ -118,7 +118,7 @@ func testType(urlStr string, typ interface{}) error { } } - var m2 map[string]interface{} + var m2 map[string]any err = json.Unmarshal(byt, &m2) if err != nil { return err diff --git a/tools/metadata/main_test.go b/tools/metadata/main_test.go index f0cdff43843..2fab7948a85 100644 --- a/tools/metadata/main_test.go +++ b/tools/metadata/main_test.go @@ -69,7 +69,7 @@ GET /undocumented/{undocumented_id} //nolint:tparallel,paralleltest // cannot use t.Parallel() when helper calls t.Setenv func TestUpdateOpenAPI(t *testing.T) { - testServer := newTestServer(t, "main", map[string]interface{}{ + testServer := newTestServer(t, "main", map[string]any{ "api.github.com/api.github.com.json": openapi3.T{ Paths: openapi3.NewPaths( openapi3.WithPath("/a/{a_id}", &openapi3.PathItem{ @@ -332,9 +332,9 @@ func runTest(t *testing.T, srcDir string, args ...string) testRun { return res } -func newTestServer(t *testing.T, ref string, files map[string]interface{}) *httptest.Server { +func newTestServer(t *testing.T, ref string, files map[string]any) *httptest.Server { t.Helper() - jsonHandler := func(wantQuery url.Values, val interface{}) http.HandlerFunc { + jsonHandler := func(wantQuery url.Values, val any) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { gotQuery := r.URL.Query() queryDiff := cmp.Diff(wantQuery, gotQuery) diff --git a/tools/sliceofpointers/sliceofpointers.go b/tools/sliceofpointers/sliceofpointers.go index d6a59b38f28..75639b68b0b 100644 --- a/tools/sliceofpointers/sliceofpointers.go +++ b/tools/sliceofpointers/sliceofpointers.go @@ -42,7 +42,7 @@ func (f *SliceOfPointersPlugin) GetLoadMode() string { return register.LoadModeSyntax } -func run(pass *analysis.Pass) (interface{}, error) { +func run(pass *analysis.Pass) (any, error) { for _, file := range pass.Files { ast.Inspect(file, func(n ast.Node) bool { if n == nil { From e1db5e628aeb6d93c98f53c0863ed8928ae340e8 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Thu, 5 Jun 2025 21:40:29 +0300 Subject: [PATCH 725/751] chore: Migrate golangci-lint to v2 (#3587) --- .custom-gcl.yml | 2 +- .golangci.yml | 237 ++++++++++++++++++++++++----------------------- github/search.go | 10 +- script/lint.sh | 11 +-- 4 files changed, 130 insertions(+), 130 deletions(-) diff --git a/.custom-gcl.yml b/.custom-gcl.yml index d3bf8857d00..53f1f717d39 100644 --- a/.custom-gcl.yml +++ b/.custom-gcl.yml @@ -1,4 +1,4 @@ -version: v1.62.0 +version: v2.1.6 plugins: - module: "github.com/google/go-github/v68/tools/sliceofpointers" path: ./tools/sliceofpointers diff --git a/.golangci.yml b/.golangci.yml index fbcff90b9c4..baef17feda4 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,19 +1,16 @@ +version: "2" run: build-tags: - integration - timeout: 10m linters: enable: - canonicalheader - copyloopvar - dogsled - dupl - - gci - gocritic - godot - - gofmt - goheader - - goimports - gosec - misspell - nakedret @@ -21,127 +18,135 @@ linters: - perfsprint - revive - sliceofpointers - - stylecheck + - staticcheck - tparallel - unconvert - unparam - whitespace -linters-settings: - custom: - sliceofpointers: - type: module - description: Reports usage of []*string and slices of structs without pointers. - original-url: github.com/google/go-github/v68/tools/sliceofpointers - gocritic: - disable-all: true - enabled-checks: - - commentedOutCode - - commentFormatting - goheader: - values: - regexp: - CopyrightDate: "Copyright \\d{4} " - template: |- - {{CopyrightDate}}The go-github AUTHORS. All rights reserved. + settings: + gocritic: + disable-all: true + enabled-checks: + - commentedOutCode + - commentFormatting + goheader: + values: + regexp: + CopyrightDate: 'Copyright \d{4} ' + template: |- + {{CopyrightDate}}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. - gosec: - excludes: - # duplicates errcheck - - G104 - # int(os.Stdin.Fd()) - - G115 - misspell: - locale: US - ignore-words: - - "analyses" # returned by the GitHub API - - "cancelled" # returned by the GitHub API - # extra words from https://go.dev//wiki/Spelling - extra-words: - - typo: "marshall" - correction: "marshal" - - typo: "marshalled" - correction: "marshaled" - - typo: "marshalling" - correction: "marshaling" - - typo: "unmarshall" - correction: "unmarshal" - - typo: "unmarshalling" - correction: "unmarshaling" - - typo: "unmarshalled" - correction: "unmarshaled" - - typo: "unmarshalling" - correction: "unmarshaling" - perfsprint: - errorf: true - strconcat: false - revive: - # Set below 0.8 to enable error-strings rule. - confidence: 0.6 + Use of this source code is governed by a BSD-style + license that can be found in the LICENSE file. + gosec: + excludes: + # duplicates errcheck + - G104 + # int(os.Stdin.Fd()) + - G115 + misspell: + locale: US + # extra words from https://go.dev//wiki/Spelling + extra-words: + - typo: marshall + correction: marshal + - typo: marshalled + correction: marshaled + - typo: marshalling + correction: marshaling + - typo: unmarshall + correction: unmarshal + - typo: unmarshalling + correction: unmarshaling + - typo: unmarshalled + correction: unmarshaled + - typo: unmarshalling + correction: unmarshaling + ignore-rules: + - analyses # returned by the GitHub API + - cancelled # returned by the GitHub API + perfsprint: + errorf: true + strconcat: false + revive: + # Set below 0.8 to enable error-strings rule. + confidence: 0.6 + rules: + - name: blank-imports + - name: bool-literal-in-expr + - name: context-as-argument + - name: context-keys-type + - name: dot-imports + - name: early-return + - name: empty-block + - name: error-naming + - name: error-return + - name: error-strings + - name: errorf + - name: filename-format + arguments: + - ^[_a-z][_a-z0-9]*.go$ + - name: increment-decrement + - name: indent-error-flow + - name: package-comments + - name: range + - name: receiver-naming + - name: redefines-builtin-id + - name: superfluous-else + - name: time-equal + - name: time-naming + - name: unexported-naming + - name: unexported-return + - name: unreachable-code + - name: use-any + - name: var-declaration + - name: var-naming + staticcheck: + checks: + - "all" + - "-QF1008" # allow embedded field in selector + custom: + sliceofpointers: + type: module + description: Reports usage of []*string and slices of structs without pointers. + original-url: github.com/google/go-github/v68/tools/sliceofpointers + exclusions: rules: - - name: blank-imports - - name: bool-literal-in-expr - - name: context-as-argument - - name: context-keys-type - - name: dot-imports - - name: early-return - - name: empty-block - - name: error-naming - - name: error-return - - name: error-strings - - name: errorf - - name: filename-format - arguments: - - "^[_a-z][_a-z0-9]*.go$" - - name: increment-decrement - - name: indent-error-flow - - name: package-comments - - name: range - - name: receiver-naming - - name: redefines-builtin-id - - name: superfluous-else - - name: time-equal - - name: time-naming - - name: unexported-naming - - name: unexported-return - - name: unreachable-code - - name: use-any - - name: var-declaration - - name: var-naming -issues: - exclude-use-default: false - exclude-rules: - - linters: - - dupl - - unparam - - gosec - - dogsled - path: _test\.go + - linters: + - dogsled + - dupl + - gosec + - unparam + path: _test\.go - # We need to pass nil Context in order to test DoBare erroring on nil ctx. - - linters: [staticcheck] - text: "SA1012: do not pass a nil Context" - path: _test\.go + # We need to pass nil Context in order to test DoBare erroring on nil ctx. + - linters: [staticcheck] + path: _test\.go + text: 'SA1012: do not pass a nil Context' - # We need to use sha1 for validating signatures - - linters: [gosec] - text: "G505: Blocklisted import crypto/sha1: weak cryptographic primitive" + # We need to use sha1 for validating signatures + - linters: [gosec] + text: 'G505: Blocklisted import crypto/sha1: weak cryptographic primitive' - # This is adapted from golangci-lint's default exclusions. It disables linting for error checks on - # os.RemoveAll, fmt.Fprint*, fmt.Scanf, and any function ending in "Close". - - linters: [errcheck] - text: Error return value of .(.*Close|fmt\.Fprint.*|fmt\.Scanf|os\.Remove(All)?). is not checked + # This is adapted from golangci-lint's default exclusions. It disables linting for error checks on + # os.RemoveAll, fmt.Fprint*, fmt.Scanf, and any function ending in "Close". + - linters: [errcheck] + text: Error return value of .(.*Close|fmt\.Fprint.*|fmt\.Scanf|os\.Remove(All)?). is not checked - # We don't care about file inclusion via variable in examples or internal tools. - - linters: [gosec] - text: "G304: Potential file inclusion via variable" - path: '^(example|tools)\/' + # We don't care about file inclusion via variable in examples or internal tools. + - linters: [gosec] + path: ^(example|tools)\/ + text: 'G304: Potential file inclusion via variable' - # We don't run parallel integration tests - - linters: [paralleltest, tparallel] - path: "^test/integration" + # We don't run parallel integration tests + - linters: [paralleltest, tparallel] + path: ^test/integration - # Because fmt.Sprint(reset.Unix())) is more readable than strconv.FormatInt(reset.Unix(), 10). - - linters: [perfsprint] - text: "fmt.Sprint.* can be replaced with faster strconv.FormatInt" + # Because fmt.Sprint(reset.Unix())) is more readable than strconv.FormatInt(reset.Unix(), 10). + - linters: [perfsprint] + text: fmt.Sprint.* can be replaced with faster strconv.FormatInt +formatters: + enable: + - gci + - gofmt + - goimports diff --git a/github/search.go b/github/search.go index 8cdb634225d..71b5ae51e9b 100644 --- a/github/search.go +++ b/github/search.go @@ -317,20 +317,20 @@ func (s *SearchService) search(ctx context.Context, searchType string, parameter return nil, err } var acceptHeaders []string - switch { - case searchType == "commits": + switch searchType { + case "commits": // Accept header for search commits preview endpoint // TODO: remove custom Accept header when this API fully launches. acceptHeaders = append(acceptHeaders, mediaTypeCommitSearchPreview) - case searchType == "topics": + case "topics": // Accept header for search repositories based on topics preview endpoint // TODO: remove custom Accept header when this API fully launches. acceptHeaders = append(acceptHeaders, mediaTypeTopicsPreview) - case searchType == "repositories": + case "repositories": // Accept header for search repositories based on topics preview endpoint // TODO: remove custom Accept header when this API fully launches. acceptHeaders = append(acceptHeaders, mediaTypeTopicsPreview) - case searchType == "issues": + case "issues": // Accept header for search issues based on reactions preview endpoint // TODO: remove custom Accept header when this API fully launches. acceptHeaders = append(acceptHeaders, mediaTypeReactionsPreview) diff --git a/script/lint.sh b/script/lint.sh index 67a67f8ea61..eabd5046077 100755 --- a/script/lint.sh +++ b/script/lint.sh @@ -5,7 +5,7 @@ set -e -GOLANGCI_LINT_VERSION="1.63.4" +GOLANGCI_LINT_VERSION="2.1.6" CDPATH="" cd -- "$(dirname -- "$0")/.." BIN="$(pwd -P)"/bin @@ -21,7 +21,7 @@ fail() { # install golangci-lint and custom-gcl in ./bin if they don't exist with the correct version if ! "$BIN"/custom-gcl --version 2> /dev/null | grep -q "$GOLANGCI_LINT_VERSION"; then - GOBIN="$BIN" go install "github.com/golangci/golangci-lint/cmd/golangci-lint@v$GOLANGCI_LINT_VERSION" + GOBIN="$BIN" go install "github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v$GOLANGCI_LINT_VERSION" "$BIN"/golangci-lint custom && mv ./custom-gcl "$BIN" fi @@ -32,12 +32,7 @@ for dir in $MOD_DIRS; do echo linting "$dir" ( cd "$dir" - # github actions output when running in an action - if [ -n "$GITHUB_ACTIONS" ]; then - "$BIN"/custom-gcl run --path-prefix "$dir" --out-format colored-line-number - else - "$BIN"/custom-gcl run --path-prefix "$dir" - fi + "$BIN"/custom-gcl run --path-prefix "$dir" ) || fail "failed linting $dir" done From da6f225a955c391f226d72fe3f277a916454b5ac Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Thu, 5 Jun 2025 21:44:40 +0300 Subject: [PATCH 726/751] chore: Add alexandear to REVIEWERS (#3588) --- REVIEWERS | 1 + 1 file changed, 1 insertion(+) diff --git a/REVIEWERS b/REVIEWERS index 2dd1f6fe582..e2a8c49b07a 100644 --- a/REVIEWERS +++ b/REVIEWERS @@ -1 +1,2 @@ stevehipwell +alexandear From 8878e69862f90f10cedadb9668135898a09352d7 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Thu, 5 Jun 2025 21:44:52 +0300 Subject: [PATCH 727/751] docs: Update minimum Go version in README to 1.23 (#3589) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index edfc1b53813..be59d68080b 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ go-github tracks [Go's version support policy][support-policy] supporting any minor version of the latest two major releases of Go and the go directive in go.mod reflects that. We do our best not to break older versions of Go if we don't have to, but we -don't explicitly test older versions and as of Go 1.21 the go directive in +don't explicitly test older versions and as of Go 1.23 the go directive in go.mod declares a hard required _minimum_ version of Go to use with this module and this _must_ be greater than or equal to the go line of all dependencies so go-github will require the N-1 major release of Go by default. From 38758499f6b9db2825ce877611d52e43a9018841 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Mon, 9 Jun 2025 15:37:23 +0300 Subject: [PATCH 728/751] fix: Use stable media type in Starring API (#3590) --- github/activity_star.go | 6 ++---- github/activity_star_test.go | 6 +++--- github/github.go | 4 +--- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/github/activity_star.go b/github/activity_star.go index cebdacf76a9..782c09884d2 100644 --- a/github/activity_star.go +++ b/github/activity_star.go @@ -40,8 +40,7 @@ func (s *ActivityService) ListStargazers(ctx context.Context, owner, repo string return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches - req.Header.Set("Accept", mediaTypeStarringPreview) + req.Header.Set("Accept", mediaTypeStarring) var stargazers []*Stargazer resp, err := s.client.Do(ctx, req, &stargazers) @@ -91,8 +90,7 @@ func (s *ActivityService) ListStarred(ctx context.Context, user string, opts *Ac return nil, nil, err } - // TODO: remove custom Accept header when APIs fully launch - acceptHeaders := []string{mediaTypeStarringPreview, mediaTypeTopicsPreview} + acceptHeaders := []string{mediaTypeStarring, mediaTypeTopicsPreview} req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) var repos []*StarredRepository diff --git a/github/activity_star_test.go b/github/activity_star_test.go index 1f1fbbc7488..57b3ef6521e 100644 --- a/github/activity_star_test.go +++ b/github/activity_star_test.go @@ -22,7 +22,7 @@ func TestActivityService_ListStargazers(t *testing.T) { mux.HandleFunc("/repos/o/r/stargazers", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", mediaTypeStarringPreview) + testHeader(t, r, "Accept", mediaTypeStarring) testFormValues(t, r, values{ "page": "2", }) @@ -62,7 +62,7 @@ func TestActivityService_ListStarred_authenticatedUser(t *testing.T) { mux.HandleFunc("/user/starred", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", strings.Join([]string{mediaTypeStarringPreview, mediaTypeTopicsPreview}, ", ")) + testHeader(t, r, "Accept", strings.Join([]string{mediaTypeStarring, mediaTypeTopicsPreview}, ", ")) fmt.Fprint(w, `[{"starred_at":"2002-02-10T15:30:00Z","repo":{"id":1}}]`) }) @@ -98,7 +98,7 @@ func TestActivityService_ListStarred_specifiedUser(t *testing.T) { mux.HandleFunc("/users/u/starred", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", strings.Join([]string{mediaTypeStarringPreview, mediaTypeTopicsPreview}, ", ")) + testHeader(t, r, "Accept", strings.Join([]string{mediaTypeStarring, mediaTypeTopicsPreview}, ", ")) testFormValues(t, r, values{ "sort": "created", "direction": "asc", diff --git a/github/github.go b/github/github.go index 513f9fe4bcd..8de400bc5ef 100644 --- a/github/github.go +++ b/github/github.go @@ -54,6 +54,7 @@ const ( mediaTypeV3Patch = "application/vnd.github.v3.patch" mediaTypeOrgPermissionRepo = "application/vnd.github.v3.repository+json" mediaTypeIssueImportAPI = "application/vnd.github.golden-comet-preview+json" + mediaTypeStarring = "application/vnd.github.star+json" // Media Type values to access preview APIs // These media types will be added to the API request as headers @@ -72,9 +73,6 @@ const ( // // See https://github.com/google/go-github/pull/2125 for full context. - // https://developer.github.com/changes/2014-12-09-new-attributes-for-stars-api/ - mediaTypeStarringPreview = "application/vnd.github.v3.star+json" - // https://help.github.com/enterprise/2.4/admin/guides/migrations/exporting-the-github-com-organization-s-repositories/ mediaTypeMigrationsPreview = "application/vnd.github.wyandotte-preview+json" From c400937b9e739ee5ca10525deac1c57f2334599f Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Mon, 9 Jun 2025 16:58:24 +0300 Subject: [PATCH 729/751] docs: Use pkgsite links (#3591) --- github/doc.go | 30 +++++++++++++++--------------- github/github.go | 10 +++++----- github/messages.go | 40 ++++++++++++++++++++-------------------- 3 files changed, 40 insertions(+), 40 deletions(-) diff --git a/github/doc.go b/github/doc.go index 8a6112fe9e7..a9f36f0979c 100644 --- a/github/doc.go +++ b/github/doc.go @@ -31,27 +31,27 @@ The services of a client divide the API into logical chunks and correspond to the structure of the GitHub API documentation at https://docs.github.com/rest . -NOTE: Using the https://pkg.go.dev/context package, one can easily +NOTE: Using the [context] package, one can easily pass cancelation signals and deadlines to various services of the client for -handling a request. In case there is no context available, then context.Background() +handling a request. In case there is no context available, then [context.Background] can be used as a starting point. For more sample code snippets, head over to the https://github.com/google/go-github/tree/master/example directory. # Authentication -Use Client.WithAuthToken to configure your client to authenticate using an Oauth token +Use [Client.WithAuthToken] to configure your client to authenticate using an Oauth token (for example, a personal access token). This is what is needed for a majority of use cases aside from GitHub Apps. client := github.NewClient(nil).WithAuthToken("... your access token ...") -Note that when using an authenticated Client, all calls made by the client will +Note that when using an authenticated [Client], all calls made by the client will include the specified OAuth token. Therefore, authenticated clients should almost never be shared between different users. For API methods that require HTTP Basic Authentication, use the -BasicAuthTransport. +[BasicAuthTransport]. GitHub Apps authentication can be provided by the https://github.com/bradleyfalzon/ghinstallation package. @@ -100,15 +100,15 @@ limited to 60 requests per hour, while authenticated clients can make up to clients are limited to 10 requests per minute, while authenticated clients can make up to 30 requests per minute. To receive the higher rate limit when making calls that are not issued on behalf of a user, -use UnauthenticatedRateLimitedTransport. +use [UnauthenticatedRateLimitedTransport]. -The returned Response.Rate value contains the rate limit information +The returned [Response].[Rate] value contains the rate limit information from the most recent API call. If a recent enough response isn't available, you can use RateLimits to fetch the most up-to-date rate limit data for the client. -To detect an API rate limit error, you can check if its type is *github.RateLimitError. -For secondary rate limits, you can check if its type is *github.AbuseRateLimitError: +To detect an API rate limit error, you can check if its type is *[RateLimitError]. +For secondary rate limits, you can check if its type is *[AbuseRateLimitError]: repos, _, err := client.Repositories.List(ctx, "", nil) if _, ok := err.(*github.RateLimitError); ok { @@ -129,7 +129,7 @@ the GitHub side. Methods known to behave like this are documented specifying this behavior. To detect this condition of error, you can check if its type is -*github.AcceptedError: +*[AcceptedError]: stats, _, err := client.Repositories.ListContributorsStats(ctx, org, repo) if _, ok := err.(*github.AcceptedError); ok { @@ -142,7 +142,7 @@ The GitHub REST API has good support for conditional HTTP requests via the ETag header which will help prevent you from burning through your rate limit, as well as help speed up your application. go-github does not handle conditional requests directly, but is instead designed to work with a -caching http.Transport. +caching [http.Transport]. Typically, an RFC 7234 compliant HTTP cache such as https://github.com/gregjones/httpcache is recommended. Alternatively, the https://github.com/bored-engineer/github-conditional-http-transport @@ -157,7 +157,7 @@ https://docs.github.com/rest/overview/resources-in-the-rest-api#conditional-requ All structs for GitHub resources use pointer values for all non-repeated fields. This allows distinguishing between unset fields and those set to a zero-value. -Helper functions have been provided to easily create these pointers for string, +A helper function, [Ptr], has been provided to easily create these pointers for string, bool, and int values. For example: // create a new private repository named "foo" @@ -173,10 +173,10 @@ Users who have worked with protocol buffers should find this pattern familiar. All requests for resource collections (repos, pull requests, issues, etc.) support pagination. Pagination options are described in the -github.ListOptions struct and passed to the list methods directly or as an +[ListOptions] struct and passed to the list methods directly or as an embedded type of a more specific list options struct (for example -github.PullRequestListOptions). Pages information is available via the -github.Response struct. +[PullRequestListOptions]). Pages information is available via the +[Response] struct. client := github.NewClient(nil) diff --git a/github/github.go b/github/github.go index 8de400bc5ef..31b6d62071d 100644 --- a/github/github.go +++ b/github/github.go @@ -1391,12 +1391,12 @@ func (e *Error) UnmarshalJSON(data []byte) error { // present. A response is considered an error if it has a status code outside // the 200 range or equal to 202 Accepted. // API error responses are expected to have response -// body, and a JSON response body that maps to ErrorResponse. +// body, and a JSON response body that maps to [ErrorResponse]. // -// The error type will be *RateLimitError for rate limit exceeded errors, -// *AcceptedError for 202 Accepted status codes, -// *TwoFactorAuthError for two-factor authentication errors, -// and *RedirectionError for redirect status codes (only happens when ignoring redirections). +// The error type will be *[RateLimitError] for rate limit exceeded errors, +// *[AcceptedError] for 202 Accepted status codes, +// *[TwoFactorAuthError] for two-factor authentication errors, +// and *[RedirectionError] for redirect status codes (only happens when ignoring redirections). func CheckResponse(r *http.Response) error { if r.StatusCode == http.StatusAccepted { return &AcceptedError{} diff --git a/github/messages.go b/github/messages.go index 95cb94b0eb5..21eb7c70c37 100644 --- a/github/messages.go +++ b/github/messages.go @@ -186,11 +186,11 @@ func messageMAC(signature string) ([]byte, func() hash.Hash, error) { // Example usage: // // func (s *GitHubEventMonitor) ServeHTTP(w http.ResponseWriter, r *http.Request) { -// // read signature from request -// signature := "" -// payload, err := github.ValidatePayloadFromBody(r.Header.Get("Content-Type"), r.Body, signature, s.webhookSecretKey) -// if err != nil { ... } -// // Process payload... +// // read signature from request +// signature := "" +// payload, err := github.ValidatePayloadFromBody(r.Header.Get("Content-Type"), r.Body, signature, s.webhookSecretKey) +// if err != nil { ... } +// // Process payload... // } func ValidatePayloadFromBody(contentType string, readable io.Reader, signature string, secretToken []byte) (payload []byte, err error) { var body []byte // Raw body that GitHub uses to calculate the signature. @@ -249,9 +249,9 @@ func ValidatePayloadFromBody(contentType string, readable io.Reader, signature s // Example usage: // // func (s *GitHubEventMonitor) ServeHTTP(w http.ResponseWriter, r *http.Request) { -// payload, err := github.ValidatePayload(r, s.webhookSecretKey) -// if err != nil { ... } -// // Process payload... +// payload, err := github.ValidatePayload(r, s.webhookSecretKey) +// if err != nil { ... } +// // Process payload... // } func ValidatePayload(r *http.Request, secretToken []byte) (payload []byte, err error) { signature := r.Header.Get(SHA256SignatureHeader) @@ -300,23 +300,23 @@ func DeliveryID(r *http.Request) string { // ParseWebHook parses the event payload. For recognized event types, a // value of the corresponding struct type will be returned (as returned -// by Event.ParsePayload()). An error will be returned for unrecognized event +// by [Event.ParsePayload]). An error will be returned for unrecognized event // types. // // Example usage: // // func (s *GitHubEventMonitor) ServeHTTP(w http.ResponseWriter, r *http.Request) { -// payload, err := github.ValidatePayload(r, s.webhookSecretKey) -// if err != nil { ... } -// event, err := github.ParseWebHook(github.WebHookType(r), payload) -// if err != nil { ... } -// switch event := event.(type) { -// case *github.CommitCommentEvent: -// processCommitCommentEvent(event) -// case *github.CreateEvent: -// processCreateEvent(event) -// ... -// } +// payload, err := github.ValidatePayload(r, s.webhookSecretKey) +// if err != nil { ... } +// event, err := github.ParseWebHook(github.WebHookType(r), payload) +// if err != nil { ... } +// switch event := event.(type) { +// case *github.CommitCommentEvent: +// processCommitCommentEvent(event) +// case *github.CreateEvent: +// processCreateEvent(event) +// ... +// } // } func ParseWebHook(messageType string, payload []byte) (any, error) { eventType, ok := messageToTypeName[messageType] From 3c81a563279b017b81d7c5b14fafcd686ba21f55 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Jun 2025 17:06:14 -0400 Subject: [PATCH 730/751] build(deps): bump golang.org/x/net from 0.40.0 to 0.41.0 in /scrape (#3593) --- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 026cf8c7176..5eb5a830fad 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -7,7 +7,7 @@ require ( github.com/google/go-cmp v0.7.0 github.com/google/go-github/v72 v72.0.0 github.com/xlzd/gotp v0.1.0 - golang.org/x/net v0.40.0 + golang.org/x/net v0.41.0 ) require ( diff --git a/scrape/go.sum b/scrape/go.sum index 67a5e04979d..8b12db5bc91 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -33,8 +33,8 @@ golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= -golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY= -golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds= +golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw= +golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= From 8c3cc7debd52eb5b85885c7ec13b0fe2bf9f9bf7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Jun 2025 17:12:05 -0400 Subject: [PATCH 731/751] build(deps): bump golang.org/x/sync from 0.14.0 to 0.15.0 in /tools (#3594) --- tools/go.mod | 2 +- tools/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index 7d28c110bb7..d17b01c0541 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -7,7 +7,7 @@ require ( github.com/getkin/kin-openapi v0.132.0 github.com/google/go-cmp v0.7.0 github.com/google/go-github/v72 v72.0.0 - golang.org/x/sync v0.14.0 + golang.org/x/sync v0.15.0 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/tools/go.sum b/tools/go.sum index ae0f17e655f..2f0fa8680ab 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -45,8 +45,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= -golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ= -golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8= +golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= From ad671c46a896a07c1ac3053a0abca48493acafbe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Jun 2025 17:29:21 -0400 Subject: [PATCH 732/751] build(deps): bump github.com/cloudflare/circl from 1.3.7 to 1.6.1 in /example (#3595) --- example/go.mod | 2 +- example/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/example/go.mod b/example/go.mod index 46c7a828f81..2d94d7f722f 100644 --- a/example/go.mod +++ b/example/go.mod @@ -17,7 +17,7 @@ require ( require ( github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect github.com/blang/semver v3.5.1+incompatible // indirect - github.com/cloudflare/circl v1.3.7 // indirect + github.com/cloudflare/circl v1.6.1 // indirect github.com/cyberphone/json-canonicalization v0.0.0-20220623050100-57a0ce2678a7 // indirect github.com/digitorus/pkcs7 v0.0.0-20230818184609-3a137a874352 // indirect github.com/digitorus/timestamp v0.0.0-20231217203849-220c5c2851b7 // indirect diff --git a/example/go.sum b/example/go.sum index 7c5743a699b..679dca7a3fc 100644 --- a/example/go.sum +++ b/example/go.sum @@ -71,8 +71,8 @@ github.com/cenkalti/backoff/v3 v3.2.2/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4r github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= -github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= -github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= +github.com/cloudflare/circl v1.6.1 h1:zqIqSPIndyBh1bjLVVDHMPpVKqp8Su/V+6MeDzzQBQ0= +github.com/cloudflare/circl v1.6.1/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs= github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb h1:EDmT6Q9Zs+SbUoc7Ik9EfrFqcylYqgPZ9ANSbTAntnE= github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb/go.mod h1:ZjrT6AXHbDs86ZSdt/osfBi5qfexBrKUdONk989Wnk4= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= From 1b8d6fbfb71b7ebdcb24ddd8bb0861e65948f5f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?hnk=C6=B6?= Date: Tue, 24 Jun 2025 23:18:01 +0900 Subject: [PATCH 733/751] feat!: Add repository query option to ListCustomPropertyValues (#3598) BREAKING CHANGE: `ListCustomPropertyValues` now takes `ListCustomPropertyValuesOptions` instead of `ListOptions`. --- github/orgs_properties.go | 9 ++++++++- github/orgs_properties_test.go | 17 ++++++++++++----- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/github/orgs_properties.go b/github/orgs_properties.go index 09abdffbfcb..257e765993b 100644 --- a/github/orgs_properties.go +++ b/github/orgs_properties.go @@ -48,6 +48,13 @@ type CustomPropertyValue struct { Value any `json:"value"` } +// ListCustomPropertyValuesOptions specifies the optional parameters to the +// OrganizationsService.ListCustomPropertyValues method. +type ListCustomPropertyValuesOptions struct { + RepositoryQuery string `url:"repository_query,omitempty"` + ListOptions +} + // UnmarshalJSON implements the json.Unmarshaler interface. // This helps us handle the fact that Value can be either a string, []string, or nil. func (cpv *CustomPropertyValue) UnmarshalJSON(data []byte) error { @@ -197,7 +204,7 @@ func (s *OrganizationsService) RemoveCustomProperty(ctx context.Context, org, cu // GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#list-custom-property-values-for-organization-repositories // //meta:operation GET /orgs/{org}/properties/values -func (s *OrganizationsService) ListCustomPropertyValues(ctx context.Context, org string, opts *ListOptions) ([]*RepoCustomPropertyValue, *Response, error) { +func (s *OrganizationsService) ListCustomPropertyValues(ctx context.Context, org string, opts *ListCustomPropertyValuesOptions) ([]*RepoCustomPropertyValue, *Response, error) { u := fmt.Sprintf("orgs/%v/properties/values", org) u, err := addOptions(u, opts) if err != nil { diff --git a/github/orgs_properties_test.go b/github/orgs_properties_test.go index 96b90fb7c2d..ceab4525171 100644 --- a/github/orgs_properties_test.go +++ b/github/orgs_properties_test.go @@ -283,7 +283,11 @@ func TestOrganizationsService_ListCustomPropertyValues(t *testing.T) { mux.HandleFunc("/orgs/o/properties/values", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testFormValues(t, r, values{"page": "1", "per_page": "100"}) + testFormValues(t, r, values{ + "page": "1", + "per_page": "100", + "repository_query": "repo:octocat/Hello-World", + }) fmt.Fprint(w, `[{ "repository_id": 1296269, "repository_name": "Hello-World", @@ -310,9 +314,12 @@ func TestOrganizationsService_ListCustomPropertyValues(t *testing.T) { }) ctx := context.Background() - repoPropertyValues, _, err := client.Organizations.ListCustomPropertyValues(ctx, "o", &ListOptions{ - Page: 1, - PerPage: 100, + repoPropertyValues, _, err := client.Organizations.ListCustomPropertyValues(ctx, "o", &ListCustomPropertyValuesOptions{ + ListOptions: ListOptions{ + Page: 1, + PerPage: 100, + }, + RepositoryQuery: "repo:octocat/Hello-World", }) if err != nil { t.Errorf("Organizations.ListCustomPropertyValues returned error: %v", err) @@ -351,7 +358,7 @@ func TestOrganizationsService_ListCustomPropertyValues(t *testing.T) { const methodName = "ListCustomPropertyValues" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Organizations.ListCustomPropertyValues(ctx, "\n", &ListOptions{}) + _, _, err = client.Organizations.ListCustomPropertyValues(ctx, "\n", &ListCustomPropertyValuesOptions{}) return err }) From 8759b171221b1b3378cdeb3f83dea5ec344efd53 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Tue, 24 Jun 2025 10:34:17 -0400 Subject: [PATCH 734/751] Bump version of go-github to v73.0.0 (#3599) --- README.md | 18 +++++++++--------- example/actionpermissions/main.go | 2 +- example/appengine/app.go | 2 +- example/basicauth/main.go | 2 +- .../newreposecretwithxcrypto/main.go | 2 +- .../newusersecretwithxcrypto/main.go | 2 +- example/commitpr/main.go | 2 +- example/go.mod | 6 +++--- example/listenvironments/main.go | 2 +- example/migrations/main.go | 2 +- example/newfilewithappauth/main.go | 2 +- example/newrepo/main.go | 2 +- example/newreposecretwithlibsodium/go.mod | 4 ++-- example/newreposecretwithlibsodium/main.go | 2 +- example/newreposecretwithxcrypto/main.go | 2 +- example/ratelimit/main.go | 2 +- example/simple/main.go | 2 +- example/tokenauth/main.go | 2 +- example/topics/main.go | 2 +- example/verifyartifact/main.go | 2 +- github/doc.go | 2 +- github/examples_test.go | 2 +- github/github.go | 2 +- go.mod | 2 +- test/fields/fields.go | 2 +- test/integration/activity_test.go | 2 +- test/integration/authorizations_test.go | 2 +- test/integration/github_test.go | 2 +- test/integration/repos_test.go | 2 +- test/integration/users_test.go | 2 +- tools/go.mod | 4 ++-- tools/metadata/main.go | 2 +- tools/metadata/main_test.go | 2 +- tools/metadata/metadata.go | 2 +- tools/metadata/openapi.go | 2 +- 35 files changed, 47 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index be59d68080b..82e69a9e33c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-github # [![go-github release (latest SemVer)](https://img.shields.io/github/v/release/google/go-github?sort=semver)](https://github.com/google/go-github/releases) -[![Go Reference](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v72/github) +[![Go Reference](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v73/github) [![Test Status](https://github.com/google/go-github/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/google/go-github/actions/workflows/tests.yml) [![Test Coverage](https://codecov.io/gh/google/go-github/branch/master/graph/badge.svg)](https://codecov.io/gh/google/go-github) [![Discuss at go-github@googlegroups.com](https://img.shields.io/badge/discuss-go--github%40googlegroups.com-blue.svg)](https://groups.google.com/group/go-github) @@ -30,7 +30,7 @@ If you're interested in using the [GraphQL API v4][], the recommended library is go-github is compatible with modern Go releases in module mode, with Go installed: ```bash -go get github.com/google/go-github/v72 +go get github.com/google/go-github/v73 ``` will resolve and add the package to the current development module, along with its dependencies. @@ -38,7 +38,7 @@ will resolve and add the package to the current development module, along with i Alternatively the same can be achieved if you use import in a package: ```go -import "github.com/google/go-github/v72/github" +import "github.com/google/go-github/v73/github" ``` and run `go get` without parameters. @@ -46,13 +46,13 @@ and run `go get` without parameters. Finally, to use the top-of-trunk version of this repo, use the following command: ```bash -go get github.com/google/go-github/v72@master +go get github.com/google/go-github/v73@master ``` ## Usage ## ```go -import "github.com/google/go-github/v72/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) +import "github.com/google/go-github/v73/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled ``` @@ -125,7 +125,7 @@ import ( "net/http" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v72/github" + "github.com/google/go-github/v73/github" ) func main() { @@ -159,7 +159,7 @@ import ( "os" "strconv" - "github.com/google/go-github/v72/github" + "github.com/google/go-github/v73/github" "github.com/jferrl/go-githubauth" "golang.org/x/oauth2" ) @@ -380,7 +380,7 @@ For complete usage of go-github, see the full [package docs][]. [GitHub API v3]: https://docs.github.com/en/rest [personal access token]: https://github.com/blog/1509-personal-api-tokens -[package docs]: https://pkg.go.dev/github.com/google/go-github/v72/github +[package docs]: https://pkg.go.dev/github.com/google/go-github/v73/github [GraphQL API v4]: https://developer.github.com/v4/ [shurcooL/githubv4]: https://github.com/shurcooL/githubv4 [GitHub webhook events]: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads @@ -454,7 +454,7 @@ Versions prior to 48.2.0 are not listed. | go-github Version | GitHub v3 API Version | | ----------------- | --------------------- | -| 72.0.0 | 2022-11-28 | +| 73.0.0 | 2022-11-28 | | ... | 2022-11-28 | | 48.2.0 | 2022-11-28 | diff --git a/example/actionpermissions/main.go b/example/actionpermissions/main.go index f85f878e74e..2c45455b1fd 100644 --- a/example/actionpermissions/main.go +++ b/example/actionpermissions/main.go @@ -14,7 +14,7 @@ import ( "log" "os" - "github.com/google/go-github/v72/github" + "github.com/google/go-github/v73/github" ) var ( diff --git a/example/appengine/app.go b/example/appengine/app.go index 8782b536630..87606e6c23a 100644 --- a/example/appengine/app.go +++ b/example/appengine/app.go @@ -12,7 +12,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v72/github" + "github.com/google/go-github/v73/github" "google.golang.org/appengine" "google.golang.org/appengine/log" ) diff --git a/example/basicauth/main.go b/example/basicauth/main.go index 92ab86e9a69..70fc248b5c0 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -21,7 +21,7 @@ import ( "os" "strings" - "github.com/google/go-github/v72/github" + "github.com/google/go-github/v73/github" "golang.org/x/term" ) diff --git a/example/codespaces/newreposecretwithxcrypto/main.go b/example/codespaces/newreposecretwithxcrypto/main.go index 34829a5b324..c05168c3100 100644 --- a/example/codespaces/newreposecretwithxcrypto/main.go +++ b/example/codespaces/newreposecretwithxcrypto/main.go @@ -37,7 +37,7 @@ import ( "log" "os" - "github.com/google/go-github/v72/github" + "github.com/google/go-github/v73/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/codespaces/newusersecretwithxcrypto/main.go b/example/codespaces/newusersecretwithxcrypto/main.go index 4430c5226ba..340f5c84547 100644 --- a/example/codespaces/newusersecretwithxcrypto/main.go +++ b/example/codespaces/newusersecretwithxcrypto/main.go @@ -38,7 +38,7 @@ import ( "log" "os" - "github.com/google/go-github/v72/github" + "github.com/google/go-github/v73/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index fa0f1384899..81eeeb3b37d 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -33,7 +33,7 @@ import ( "time" "github.com/ProtonMail/go-crypto/openpgp" - "github.com/google/go-github/v72/github" + "github.com/google/go-github/v73/github" ) var ( diff --git a/example/go.mod b/example/go.mod index 2d94d7f722f..e103e3ffa65 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v72/example +module github.com/google/go-github/v73/example go 1.23.0 @@ -7,7 +7,7 @@ require ( github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-pagination v1.0.0 github.com/gofri/go-github-ratelimit/v2 v2.0.2 - github.com/google/go-github/v72 v72.0.0 + github.com/google/go-github/v73 v73.0.0 github.com/sigstore/sigstore-go v0.6.1 golang.org/x/crypto v0.36.0 golang.org/x/term v0.30.0 @@ -100,4 +100,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v72 => ../ +replace github.com/google/go-github/v73 => ../ diff --git a/example/listenvironments/main.go b/example/listenvironments/main.go index 9b64f4010c7..a831d9d6894 100644 --- a/example/listenvironments/main.go +++ b/example/listenvironments/main.go @@ -18,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v72/github" + "github.com/google/go-github/v73/github" ) func main() { diff --git a/example/migrations/main.go b/example/migrations/main.go index ccc74fa90ac..f818d4c1c40 100644 --- a/example/migrations/main.go +++ b/example/migrations/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v72/github" + "github.com/google/go-github/v73/github" ) func fetchAllUserMigrations() ([]*github.UserMigration, error) { diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index c6f6e1f44b0..f7cf09bbae6 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -16,7 +16,7 @@ import ( "time" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v72/github" + "github.com/google/go-github/v73/github" ) func main() { diff --git a/example/newrepo/main.go b/example/newrepo/main.go index 7bf1ec70b8f..39809517780 100644 --- a/example/newrepo/main.go +++ b/example/newrepo/main.go @@ -16,7 +16,7 @@ import ( "log" "os" - "github.com/google/go-github/v72/github" + "github.com/google/go-github/v73/github" ) var ( diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index 5e756fbb949..5d28f4dba2e 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -4,10 +4,10 @@ go 1.23.0 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb - github.com/google/go-github/v72 v72.0.0 + github.com/google/go-github/v73 v73.0.0 ) require github.com/google/go-querystring v1.1.0 // indirect // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v72 => ../.. +replace github.com/google/go-github/v73 => ../.. diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index c5a3faad5b2..affdecfdc60 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -36,7 +36,7 @@ import ( "os" sodium "github.com/GoKillers/libsodium-go/cryptobox" - "github.com/google/go-github/v72/github" + "github.com/google/go-github/v73/github" ) var ( diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index 3b6c1ebaae4..7a2e4b9d72e 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -37,7 +37,7 @@ import ( "log" "os" - "github.com/google/go-github/v72/github" + "github.com/google/go-github/v73/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/ratelimit/main.go b/example/ratelimit/main.go index 165cb99ec5a..ef3024d8015 100644 --- a/example/ratelimit/main.go +++ b/example/ratelimit/main.go @@ -17,7 +17,7 @@ import ( "github.com/gofri/go-github-ratelimit/v2/github_ratelimit" "github.com/gofri/go-github-ratelimit/v2/github_ratelimit/github_primary_ratelimit" "github.com/gofri/go-github-ratelimit/v2/github_ratelimit/github_secondary_ratelimit" - "github.com/google/go-github/v72/github" + "github.com/google/go-github/v73/github" ) func main() { diff --git a/example/simple/main.go b/example/simple/main.go index 12426e0d6e4..975ca18c284 100644 --- a/example/simple/main.go +++ b/example/simple/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v72/github" + "github.com/google/go-github/v73/github" ) // Fetch all the public organizations' membership of a user. diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index 808f1152173..bba59df2c95 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -15,7 +15,7 @@ import ( "log" "os" - "github.com/google/go-github/v72/github" + "github.com/google/go-github/v73/github" "golang.org/x/term" ) diff --git a/example/topics/main.go b/example/topics/main.go index 67223ece167..9800caed33e 100644 --- a/example/topics/main.go +++ b/example/topics/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v72/github" + "github.com/google/go-github/v73/github" ) // Fetch and lists all the public topics associated with the specified GitHub topic. diff --git a/example/verifyartifact/main.go b/example/verifyartifact/main.go index 9e74d2e67c9..ac80752e078 100644 --- a/example/verifyartifact/main.go +++ b/example/verifyartifact/main.go @@ -18,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v72/github" + "github.com/google/go-github/v73/github" "github.com/sigstore/sigstore-go/pkg/bundle" "github.com/sigstore/sigstore-go/pkg/root" "github.com/sigstore/sigstore-go/pkg/verify" diff --git a/github/doc.go b/github/doc.go index a9f36f0979c..f85faed839a 100644 --- a/github/doc.go +++ b/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v72/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v73/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to diff --git a/github/examples_test.go b/github/examples_test.go index 0ec22d29272..454ad8db539 100644 --- a/github/examples_test.go +++ b/github/examples_test.go @@ -12,7 +12,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v72/github" + "github.com/google/go-github/v73/github" ) func ExampleMarkdownService_Render() { diff --git a/github/github.go b/github/github.go index 31b6d62071d..8f3f3e431ae 100644 --- a/github/github.go +++ b/github/github.go @@ -29,7 +29,7 @@ import ( ) const ( - Version = "v72.0.0" + Version = "v73.0.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" diff --git a/go.mod b/go.mod index adaffb814d3..5c19858ca5a 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v72 +module github.com/google/go-github/v73 go 1.23.0 diff --git a/test/fields/fields.go b/test/fields/fields.go index 1f48edfe514..07455cc5faa 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -25,7 +25,7 @@ import ( "reflect" "strings" - "github.com/google/go-github/v72/github" + "github.com/google/go-github/v73/github" ) var ( diff --git a/test/integration/activity_test.go b/test/integration/activity_test.go index 2026a3128d6..f0b9b705cbe 100644 --- a/test/integration/activity_test.go +++ b/test/integration/activity_test.go @@ -11,7 +11,7 @@ import ( "context" "testing" - "github.com/google/go-github/v72/github" + "github.com/google/go-github/v73/github" ) const ( diff --git a/test/integration/authorizations_test.go b/test/integration/authorizations_test.go index 343b66eef30..da00b574ab7 100644 --- a/test/integration/authorizations_test.go +++ b/test/integration/authorizations_test.go @@ -14,7 +14,7 @@ import ( "testing" "time" - "github.com/google/go-github/v72/github" + "github.com/google/go-github/v73/github" ) const msgEnvMissing = "Skipping test because the required environment variable (%v) is not present." diff --git a/test/integration/github_test.go b/test/integration/github_test.go index 7e074719e09..b48cc58db0a 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -14,7 +14,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v72/github" + "github.com/google/go-github/v73/github" ) var ( diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index 7242de586bd..8e735ffd21f 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -14,7 +14,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v72/github" + "github.com/google/go-github/v73/github" ) func TestRepositories_CRUD(t *testing.T) { diff --git a/test/integration/users_test.go b/test/integration/users_test.go index 70d3f5756f6..c0bfca1c5dd 100644 --- a/test/integration/users_test.go +++ b/test/integration/users_test.go @@ -13,7 +13,7 @@ import ( "math/rand" "testing" - "github.com/google/go-github/v72/github" + "github.com/google/go-github/v73/github" ) func TestUsers_Get(t *testing.T) { diff --git a/tools/go.mod b/tools/go.mod index d17b01c0541..0be0cf6c04b 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -6,7 +6,7 @@ require ( github.com/alecthomas/kong v1.11.0 github.com/getkin/kin-openapi v0.132.0 github.com/google/go-cmp v0.7.0 - github.com/google/go-github/v72 v72.0.0 + github.com/google/go-github/v73 v73.0.0 golang.org/x/sync v0.15.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -25,4 +25,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v72 => ../ +replace github.com/google/go-github/v73 => ../ diff --git a/tools/metadata/main.go b/tools/metadata/main.go index d5f7bbfc3b6..2725db77610 100644 --- a/tools/metadata/main.go +++ b/tools/metadata/main.go @@ -16,7 +16,7 @@ import ( "path/filepath" "github.com/alecthomas/kong" - "github.com/google/go-github/v72/github" + "github.com/google/go-github/v73/github" ) var helpVars = kong.Vars{ diff --git a/tools/metadata/main_test.go b/tools/metadata/main_test.go index 2fab7948a85..173d11ab4f9 100644 --- a/tools/metadata/main_test.go +++ b/tools/metadata/main_test.go @@ -23,7 +23,7 @@ import ( "github.com/alecthomas/kong" "github.com/getkin/kin-openapi/openapi3" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v72/github" + "github.com/google/go-github/v73/github" ) func TestUpdateGo(t *testing.T) { diff --git a/tools/metadata/metadata.go b/tools/metadata/metadata.go index 6544bca2e05..a04c9921b26 100644 --- a/tools/metadata/metadata.go +++ b/tools/metadata/metadata.go @@ -24,7 +24,7 @@ import ( "strings" "sync" - "github.com/google/go-github/v72/github" + "github.com/google/go-github/v73/github" "gopkg.in/yaml.v3" ) diff --git a/tools/metadata/openapi.go b/tools/metadata/openapi.go index e23ef73e7e8..3912c54393d 100644 --- a/tools/metadata/openapi.go +++ b/tools/metadata/openapi.go @@ -14,7 +14,7 @@ import ( "strconv" "github.com/getkin/kin-openapi/openapi3" - "github.com/google/go-github/v72/github" + "github.com/google/go-github/v73/github" "golang.org/x/sync/errgroup" ) From 59da3f32d5aa7d716a19f1a7a218ef3873c006b2 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Tue, 24 Jun 2025 10:41:46 -0400 Subject: [PATCH 735/751] Bump go-github from v72 to v73 in /scrape (#3600) --- scrape/apps.go | 2 +- scrape/apps_test.go | 2 +- scrape/go.mod | 2 +- scrape/go.sum | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scrape/apps.go b/scrape/apps.go index 1898076e23e..291a194efa4 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -18,7 +18,7 @@ import ( "strings" "github.com/PuerkitoBio/goquery" - "github.com/google/go-github/v72/github" + "github.com/google/go-github/v73/github" ) // AppRestrictionsEnabled returns whether the specified organization has diff --git a/scrape/apps_test.go b/scrape/apps_test.go index 89b345a9f22..e7f6da6dcd8 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -10,7 +10,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v72/github" + "github.com/google/go-github/v73/github" ) func Test_AppRestrictionsEnabled(t *testing.T) { diff --git a/scrape/go.mod b/scrape/go.mod index 5eb5a830fad..c39f77a8034 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -5,7 +5,7 @@ go 1.23.0 require ( github.com/PuerkitoBio/goquery v1.10.3 github.com/google/go-cmp v0.7.0 - github.com/google/go-github/v72 v72.0.0 + github.com/google/go-github/v73 v73.0.0 github.com/xlzd/gotp v0.1.0 golang.org/x/net v0.41.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index 8b12db5bc91..ae2e3715f0b 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -6,8 +6,8 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/go-github/v72 v72.0.0 h1:FcIO37BLoVPBO9igQQ6tStsv2asG4IPcYFi655PPvBM= -github.com/google/go-github/v72 v72.0.0/go.mod h1:WWtw8GMRiL62mvIquf1kO3onRHeWWKmK01qdCY8c5fg= +github.com/google/go-github/v73 v73.0.0 h1:aR+Utnh+Y4mMkS+2qLQwcQ/cF9mOTpdwnzlaw//rG24= +github.com/google/go-github/v73 v73.0.0/go.mod h1:fa6w8+/V+edSU0muqdhCVY7Beh1M8F1IlQPZIANKIYw= 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.1.0 h1:37blvlKCh38s+fkem+fFh7sMnceltoIEBYTVXyoa5Po= From 49704bf0f76662f17db32fc3888279629d3d748c Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Wed, 25 Jun 2025 18:32:07 +0300 Subject: [PATCH 736/751] refactor: Simplify error handling in JSON decoding in tests (#3602) --- github/enterprise_actions_runners_test.go | 5 +---- github/orgs_codesecurity_configurations_test.go | 15 +++------------ 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/github/enterprise_actions_runners_test.go b/github/enterprise_actions_runners_test.go index b3a5770b6ad..dd714078f94 100644 --- a/github/enterprise_actions_runners_test.go +++ b/github/enterprise_actions_runners_test.go @@ -24,10 +24,7 @@ func TestEnterpriseService_GenerateEnterpriseJITConfig(t *testing.T) { mux.HandleFunc("/enterprises/o/actions/runners/generate-jitconfig", func(w http.ResponseWriter, r *http.Request) { v := new(GenerateJITConfigRequest) - err := json.NewDecoder(r.Body).Decode(v) - if err != nil { - t.Errorf("Request body decode failed: %v", err) - } + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) testMethod(t, r, "POST") if !cmp.Equal(v, input) { diff --git a/github/orgs_codesecurity_configurations_test.go b/github/orgs_codesecurity_configurations_test.go index ef916efbffd..f2a35c2c3cd 100644 --- a/github/orgs_codesecurity_configurations_test.go +++ b/github/orgs_codesecurity_configurations_test.go @@ -111,10 +111,7 @@ func TestOrganizationsService_CreateCodeSecurityConfiguration(t *testing.T) { mux.HandleFunc("/orgs/o/code-security/configurations", func(w http.ResponseWriter, r *http.Request) { v := new(CodeSecurityConfiguration) - err := json.NewDecoder(r.Body).Decode(v) - if err != nil { - t.Errorf("Organizations.CreateCodeSecurityConfiguration request body decode failed: %v", err) - } + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) if !reflect.DeepEqual(v, input) { t.Errorf("Organizations.CreateCodeSecurityConfiguration request body = %+v, want %+v", v, input) @@ -244,10 +241,7 @@ func TestOrganizationsService_UpdateCodeSecurityConfiguration(t *testing.T) { mux.HandleFunc("/orgs/o/code-security/configurations/1", func(w http.ResponseWriter, r *http.Request) { v := new(CodeSecurityConfiguration) - err := json.NewDecoder(r.Body).Decode(v) - if err != nil { - t.Errorf("Organizations.UpdateCodeSecurityConfiguration request body decode failed: %v", err) - } + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) if !reflect.DeepEqual(v, input) { t.Errorf("Organizations.UpdateCodeSecurityConfiguration request body = %+v, want %+v", v, input) @@ -329,10 +323,7 @@ func TestOrganizationsService_AttachCodeSecurityConfigurationsToRepositories(t * SelectedRepositoryIDs []int64 `json:"selected_repository_ids,omitempty"` } v := new(request) - err := json.NewDecoder(r.Body).Decode(v) - if err != nil { - t.Errorf("Organizations.AttachCodeSecurityConfigurationsToRepositories request body decode failed: %v", err) - } + assertNilError(t, json.NewDecoder(r.Body).Decode(v)) if v.Scope != "selected" { t.Errorf("Organizations.AttachCodeSecurityConfigurationsToRepositories request body scope = %s, want selected", v.Scope) } From 94932781957d68c142dcf8aa4d6d9d1143ad2f80 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Wed, 25 Jun 2025 18:44:09 +0300 Subject: [PATCH 737/751] refactor: fix revive.unused-parameter lint issues (#3603) --- .golangci.yml | 1 + github/actions_artifacts_test.go | 4 +- github/actions_cache_test.go | 4 +- github/actions_runner_groups_test.go | 14 +++--- github/actions_runners_test.go | 4 +- github/actions_secrets_test.go | 12 ++--- github/actions_variables_test.go | 12 ++--- github/actions_workflow_jobs_test.go | 2 +- github/actions_workflows_test.go | 12 ++--- github/activity_star_test.go | 4 +- github/admin_users_test.go | 4 +- github/authorizations_test.go | 4 +- github/codespaces_secrets_test.go | 18 ++++---- github/codespaces_test.go | 2 +- github/dependabot_secrets_test.go | 10 ++-- .../enterprise_actions_runner_groups_test.go | 14 +++--- github/enterprise_actions_runners_test.go | 2 +- ...erprise_code_security_and_analysis_test.go | 4 +- github/enterprise_manage_ghes_config_test.go | 2 +- .../enterprise_network_configurations_test.go | 2 +- github/enterprise_properties_test.go | 2 +- github/enterprise_rules_test.go | 2 +- github/gists_comments_test.go | 2 +- github/gists_test.go | 6 +-- github/git_commits_test.go | 2 +- github/git_refs_test.go | 2 +- github/github.go | 2 +- github/github_test.go | 46 +++++++++---------- github/interactions_orgs_test.go | 2 +- github/interactions_repos_test.go | 2 +- github/issues_assignees_test.go | 2 +- github/issues_comments_test.go | 2 +- github/issues_labels_test.go | 6 +-- github/issues_milestones_test.go | 2 +- github/messages_test.go | 2 +- github/migrations.go | 2 +- github/migrations_user.go | 2 +- github/orgs_hooks_test.go | 4 +- github/orgs_issue_types_test.go | 2 +- github/orgs_members_test.go | 6 +-- github/orgs_network_configurations_test.go | 2 +- github/orgs_outside_collaborators_test.go | 4 +- github/orgs_packages_test.go | 8 ++-- github/orgs_properties_test.go | 4 +- github/orgs_rules_test.go | 2 +- github/orgs_security_managers_test.go | 4 +- github/orgs_test.go | 2 +- github/pulls_comments_test.go | 2 +- github/pulls_reviewers_test.go | 4 +- github/pulls_test.go | 4 +- github/rate_limit_test.go | 2 +- github/repos_actions_access_test.go | 2 +- github/repos_comments_test.go | 2 +- github/repos_contents_test.go | 4 +- .../repos_deployment_branch_policies_test.go | 6 +-- github/repos_environments_test.go | 2 +- github/repos_hooks_test.go | 10 ++-- github/repos_keys_test.go | 2 +- github/repos_pages_test.go | 2 +- github/repos_prereceive_hooks_test.go | 2 +- github/repos_releases.go | 2 +- github/repos_releases_test.go | 4 +- github/repos_rules_test.go | 2 +- github/repos_test.go | 10 ++-- github/scim.go | 2 +- github/teams_discussion_comments_test.go | 2 +- github/teams_discussions_test.go | 4 +- github/teams_test.go | 4 +- github/users_emails_test.go | 2 +- github/users_followers_test.go | 4 +- github/users_gpg_keys_test.go | 2 +- github/users_keys_test.go | 2 +- github/users_packages_test.go | 16 +++---- github/users_ssh_signing_keys_test.go | 2 +- scrape/apps.go | 2 +- scrape/apps_test.go | 8 ++-- scrape/forms_test.go | 4 +- scrape/payment.go | 2 +- tools/sliceofpointers/sliceofpointers.go | 2 +- 79 files changed, 188 insertions(+), 187 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index baef17feda4..bf47cb3b643 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -98,6 +98,7 @@ linters: - name: unexported-naming - name: unexported-return - name: unreachable-code + - name: unused-parameter - name: use-any - name: var-declaration - name: var-naming diff --git a/github/actions_artifacts_test.go b/github/actions_artifacts_test.go index 6becfcf79d5..efb84011f5d 100644 --- a/github/actions_artifacts_test.go +++ b/github/actions_artifacts_test.go @@ -320,7 +320,7 @@ func TestActionsService_DownloadArtifact(t *testing.T) { }) // Add custom round tripper - client.client.Transport = roundTripperFunc(func(r *http.Request) (*http.Response, error) { + client.client.Transport = roundTripperFunc(func(*http.Request) (*http.Response, error) { return nil, errors.New("failed to download artifact") }) // propagate custom round tripper to client without CheckRedirect @@ -529,7 +529,7 @@ func TestActionsService_DeleteArtifact(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/actions/artifacts/1", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/actions/artifacts/1", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/actions_cache_test.go b/github/actions_cache_test.go index 4831b612c4a..7cad1445425 100644 --- a/github/actions_cache_test.go +++ b/github/actions_cache_test.go @@ -100,7 +100,7 @@ func TestActionsService_DeleteCachesByKey(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/actions/caches", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/actions/caches", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") testFormValues(t, r, values{"key": "1", "ref": "main"}) }) @@ -162,7 +162,7 @@ func TestActionsService_DeleteCachesByID(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/actions/caches/1", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/actions/caches/1", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/actions_runner_groups_test.go b/github/actions_runner_groups_test.go index c7154b74e0a..c16836e7442 100644 --- a/github/actions_runner_groups_test.go +++ b/github/actions_runner_groups_test.go @@ -153,7 +153,7 @@ func TestActionsService_DeleteOrganizationRunnerGroup(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/actions/runner-groups/2", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/actions/runner-groups/2", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) @@ -328,7 +328,7 @@ func TestActionsService_SetRepositoryAccessRunnerGroup(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/actions/runner-groups/2/repositories", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/actions/runner-groups/2/repositories", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") }) @@ -360,7 +360,7 @@ func TestActionsService_AddRepositoryAccessRunnerGroup(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/actions/runner-groups/2/repositories/42", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/actions/runner-groups/2/repositories/42", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") }) @@ -385,7 +385,7 @@ func TestActionsService_RemoveRepositoryAccessRunnerGroup(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/actions/runner-groups/2/repositories/42", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/actions/runner-groups/2/repositories/42", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) @@ -453,7 +453,7 @@ func TestActionsService_SetRunnerGroupRunners(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/actions/runner-groups/2/runners", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/actions/runner-groups/2/runners", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") }) @@ -485,7 +485,7 @@ func TestActionsService_AddRunnerGroupRunners(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/actions/runner-groups/2/runners/42", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/actions/runner-groups/2/runners/42", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") }) @@ -510,7 +510,7 @@ func TestActionsService_RemoveRunnerGroupRunners(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/actions/runner-groups/2/runners/42", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/actions/runner-groups/2/runners/42", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/actions_runners_test.go b/github/actions_runners_test.go index 4c174d3c878..48c3cdfff03 100644 --- a/github/actions_runners_test.go +++ b/github/actions_runners_test.go @@ -306,7 +306,7 @@ func TestActionsService_RemoveRunner(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/actions/runners/21", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/actions/runners/21", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) @@ -529,7 +529,7 @@ func TestActionsService_RemoveOrganizationRunner(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/actions/runners/21", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/actions/runners/21", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/actions_secrets_test.go b/github/actions_secrets_test.go index ec23f3b52c3..64437260c3d 100644 --- a/github/actions_secrets_test.go +++ b/github/actions_secrets_test.go @@ -325,7 +325,7 @@ func TestActionsService_DeleteRepoSecret(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/actions/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/actions/secrets/NAME", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) @@ -546,7 +546,7 @@ func TestActionsService_SetSelectedReposForOrgSecret(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/actions/secrets/NAME/repositories", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/actions/secrets/NAME/repositories", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") testHeader(t, r, "Content-Type", "application/json") testBody(t, r, `{"selected_repository_ids":[64780797]}`+"\n") @@ -573,7 +573,7 @@ func TestActionsService_AddSelectedRepoToOrgSecret(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/actions/secrets/NAME/repositories/1234", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/actions/secrets/NAME/repositories/1234", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") }) @@ -599,7 +599,7 @@ func TestActionsService_RemoveSelectedRepoFromOrgSecret(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/actions/secrets/NAME/repositories/1234", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/actions/secrets/NAME/repositories/1234", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) @@ -625,7 +625,7 @@ func TestActionsService_DeleteOrgSecret(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/actions/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/actions/secrets/NAME", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) @@ -835,7 +835,7 @@ func TestActionsService_DeleteEnvSecret(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repositories/1/environments/e/secrets/secret", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repositories/1/environments/e/secrets/secret", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/actions_variables_test.go b/github/actions_variables_test.go index 5a1813ab73d..83c1b8cce64 100644 --- a/github/actions_variables_test.go +++ b/github/actions_variables_test.go @@ -209,7 +209,7 @@ func TestActionsService_DeleteRepoVariable(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/actions/variables/NAME", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/actions/variables/NAME", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) @@ -429,7 +429,7 @@ func TestActionsService_SetSelectedReposForOrgSVariable(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/actions/variables/NAME/repositories", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/actions/variables/NAME/repositories", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") testHeader(t, r, "Content-Type", "application/json") testBody(t, r, `{"selected_repository_ids":[64780797]}`+"\n") @@ -456,7 +456,7 @@ func TestActionsService_AddSelectedRepoToOrgVariable(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/actions/variables/NAME/repositories/1234", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/actions/variables/NAME/repositories/1234", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") }) @@ -482,7 +482,7 @@ func TestActionsService_RemoveSelectedRepoFromOrgVariable(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/actions/variables/NAME/repositories/1234", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/actions/variables/NAME/repositories/1234", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) @@ -508,7 +508,7 @@ func TestActionsService_DeleteOrgVariable(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/actions/variables/NAME", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/actions/variables/NAME", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) @@ -680,7 +680,7 @@ func TestActionsService_DeleteEnvVariable(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/usr/1/environments/e/variables/variable", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/usr/1/environments/e/variables/variable", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/actions_workflow_jobs_test.go b/github/actions_workflow_jobs_test.go index ccc8ae8bf91..85aaa2b6bbe 100644 --- a/github/actions_workflow_jobs_test.go +++ b/github/actions_workflow_jobs_test.go @@ -230,7 +230,7 @@ func TestActionsService_GetWorkflowJobLogs(t *testing.T) { }) // Add custom round tripper - client.client.Transport = roundTripperFunc(func(r *http.Request) (*http.Response, error) { + client.client.Transport = roundTripperFunc(func(*http.Request) (*http.Response, error) { return nil, errors.New("failed to get workflow logs") }) // propagate custom round tripper to client without CheckRedirect diff --git a/github/actions_workflows_test.go b/github/actions_workflows_test.go index 46e904b3747..fddf6b70c5f 100644 --- a/github/actions_workflows_test.go +++ b/github/actions_workflows_test.go @@ -241,7 +241,7 @@ func TestActionsService_CreateWorkflowDispatchEventByID(t *testing.T) { "key": "value", }, } - mux.HandleFunc("/repos/o/r/actions/workflows/72844/dispatches", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/actions/workflows/72844/dispatches", func(_ http.ResponseWriter, r *http.Request) { var v CreateWorkflowDispatchEventRequest assertNilError(t, json.NewDecoder(r.Body).Decode(&v)) @@ -285,7 +285,7 @@ func TestActionsService_CreateWorkflowDispatchEventByFileName(t *testing.T) { "key": "value", }, } - mux.HandleFunc("/repos/o/r/actions/workflows/main.yml/dispatches", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/actions/workflows/main.yml/dispatches", func(_ http.ResponseWriter, r *http.Request) { var v CreateWorkflowDispatchEventRequest assertNilError(t, json.NewDecoder(r.Body).Decode(&v)) @@ -323,7 +323,7 @@ func TestActionsService_EnableWorkflowByID(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/actions/workflows/72844/enable", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/actions/workflows/72844/enable", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") if r.Body != http.NoBody { t.Errorf("Request body = %+v, want %+v", r.Body, http.NoBody) @@ -358,7 +358,7 @@ func TestActionsService_EnableWorkflowByFilename(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/actions/workflows/main.yml/enable", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/actions/workflows/main.yml/enable", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") if r.Body != http.NoBody { t.Errorf("Request body = %+v, want %+v", r.Body, http.NoBody) @@ -393,7 +393,7 @@ func TestActionsService_DisableWorkflowByID(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/actions/workflows/72844/disable", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/actions/workflows/72844/disable", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") if r.Body != http.NoBody { t.Errorf("Request body = %+v, want %+v", r.Body, http.NoBody) @@ -428,7 +428,7 @@ func TestActionsService_DisableWorkflowByFileName(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/actions/workflows/main.yml/disable", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/actions/workflows/main.yml/disable", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") if r.Body != http.NoBody { t.Errorf("Request body = %+v, want %+v", r.Body, http.NoBody) diff --git a/github/activity_star_test.go b/github/activity_star_test.go index 57b3ef6521e..6a3d90ef5ea 100644 --- a/github/activity_star_test.go +++ b/github/activity_star_test.go @@ -222,7 +222,7 @@ func TestActivityService_Star(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/user/starred/o/r", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/user/starred/o/r", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") }) @@ -256,7 +256,7 @@ func TestActivityService_Unstar(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/user/starred/o/r", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/user/starred/o/r", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/admin_users_test.go b/github/admin_users_test.go index 4806c53461e..4140f0f8594 100644 --- a/github/admin_users_test.go +++ b/github/admin_users_test.go @@ -66,7 +66,7 @@ func TestAdminUsers_Delete(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/admin/users/github", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/admin/users/github", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) @@ -163,7 +163,7 @@ func TestUserImpersonation_Delete(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/admin/users/github/authorizations", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/admin/users/github/authorizations", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/authorizations_test.go b/github/authorizations_test.go index 1a0612a5080..5c9322a71db 100644 --- a/github/authorizations_test.go +++ b/github/authorizations_test.go @@ -120,7 +120,7 @@ func TestDeleteGrant(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/applications/id/grant", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/applications/id/grant", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") testBody(t, r, `{"access_token":"a"}`+"\n") testHeader(t, r, "Accept", mediaTypeOAuthAppPreview) @@ -183,7 +183,7 @@ func TestAuthorizationsService_DeleteImpersonation(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/admin/users/u/authorizations", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/admin/users/u/authorizations", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/codespaces_secrets_test.go b/github/codespaces_secrets_test.go index 2c8ae931b00..551cb1f6699 100644 --- a/github/codespaces_secrets_test.go +++ b/github/codespaces_secrets_test.go @@ -319,7 +319,7 @@ func TestCodespacesService_DeleteSecret(t *testing.T) { { name: "User", handleFunc: func(mux *http.ServeMux) { - mux.HandleFunc("/user/codespaces/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/user/codespaces/secrets/NAME", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) }, @@ -331,7 +331,7 @@ func TestCodespacesService_DeleteSecret(t *testing.T) { { name: "Org", handleFunc: func(mux *http.ServeMux) { - mux.HandleFunc("/orgs/o/codespaces/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/codespaces/secrets/NAME", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) }, @@ -346,7 +346,7 @@ func TestCodespacesService_DeleteSecret(t *testing.T) { { name: "Repo", handleFunc: func(mux *http.ServeMux) { - mux.HandleFunc("/repos/o/r/codespaces/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/codespaces/secrets/NAME", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) }, @@ -579,7 +579,7 @@ func TestCodespacesService_SetSelectedReposForSecret(t *testing.T) { { name: "User", handleFunc: func(mux *http.ServeMux) { - mux.HandleFunc("/user/codespaces/secrets/NAME/repositories", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/user/codespaces/secrets/NAME/repositories", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") testHeader(t, r, "Content-Type", "application/json") testBody(t, r, `{"selected_repository_ids":[64780797]}`+"\n") @@ -593,7 +593,7 @@ func TestCodespacesService_SetSelectedReposForSecret(t *testing.T) { { name: "Org", handleFunc: func(mux *http.ServeMux) { - mux.HandleFunc("/orgs/o/codespaces/secrets/NAME/repositories", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/codespaces/secrets/NAME/repositories", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") testHeader(t, r, "Content-Type", "application/json") testBody(t, r, `{"selected_repository_ids":[64780797]}`+"\n") @@ -650,7 +650,7 @@ func TestCodespacesService_AddSelectedReposForSecret(t *testing.T) { { name: "User", handleFunc: func(mux *http.ServeMux) { - mux.HandleFunc("/user/codespaces/secrets/NAME/repositories/1234", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/user/codespaces/secrets/NAME/repositories/1234", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") }) }, @@ -662,7 +662,7 @@ func TestCodespacesService_AddSelectedReposForSecret(t *testing.T) { { name: "Org", handleFunc: func(mux *http.ServeMux) { - mux.HandleFunc("/orgs/o/codespaces/secrets/NAME/repositories/1234", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/codespaces/secrets/NAME/repositories/1234", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") }) }, @@ -717,7 +717,7 @@ func TestCodespacesService_RemoveSelectedReposFromSecret(t *testing.T) { { name: "User", handleFunc: func(mux *http.ServeMux) { - mux.HandleFunc("/user/codespaces/secrets/NAME/repositories/1234", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/user/codespaces/secrets/NAME/repositories/1234", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) }, @@ -729,7 +729,7 @@ func TestCodespacesService_RemoveSelectedReposFromSecret(t *testing.T) { { name: "Org", handleFunc: func(mux *http.ServeMux) { - mux.HandleFunc("/orgs/o/codespaces/secrets/NAME/repositories/1234", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/codespaces/secrets/NAME/repositories/1234", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) }, diff --git a/github/codespaces_test.go b/github/codespaces_test.go index 64146ec848c..1b9e61da168 100644 --- a/github/codespaces_test.go +++ b/github/codespaces_test.go @@ -272,7 +272,7 @@ func TestCodespacesService_Delete(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/user/codespaces/codespace_1", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/user/codespaces/codespace_1", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/dependabot_secrets_test.go b/github/dependabot_secrets_test.go index 21f72ca22a7..7b0055dc298 100644 --- a/github/dependabot_secrets_test.go +++ b/github/dependabot_secrets_test.go @@ -204,7 +204,7 @@ func TestDependabotService_DeleteRepoSecret(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/dependabot/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/dependabot/secrets/NAME", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) @@ -425,7 +425,7 @@ func TestDependabotService_SetSelectedReposForOrgSecret(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/dependabot/secrets/NAME/repositories", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/dependabot/secrets/NAME/repositories", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") testHeader(t, r, "Content-Type", "application/json") testBody(t, r, `{"selected_repository_ids":[64780797]}`+"\n") @@ -452,7 +452,7 @@ func TestDependabotService_AddSelectedRepoToOrgSecret(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/dependabot/secrets/NAME/repositories/1234", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/dependabot/secrets/NAME/repositories/1234", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") }) @@ -478,7 +478,7 @@ func TestDependabotService_RemoveSelectedRepoFromOrgSecret(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/dependabot/secrets/NAME/repositories/1234", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/dependabot/secrets/NAME/repositories/1234", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) @@ -504,7 +504,7 @@ func TestDependabotService_DeleteOrgSecret(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/dependabot/secrets/NAME", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/dependabot/secrets/NAME", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/enterprise_actions_runner_groups_test.go b/github/enterprise_actions_runner_groups_test.go index e4d2bfffc2f..29623f66c5b 100644 --- a/github/enterprise_actions_runner_groups_test.go +++ b/github/enterprise_actions_runner_groups_test.go @@ -153,7 +153,7 @@ func TestEnterpriseService_DeleteRunnerGroup(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/enterprises/o/actions/runner-groups/2", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/enterprises/o/actions/runner-groups/2", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) @@ -328,7 +328,7 @@ func TestEnterpriseService_SetOrganizationAccessRunnerGroup(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/enterprises/o/actions/runner-groups/2/organizations", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/enterprises/o/actions/runner-groups/2/organizations", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") }) @@ -360,7 +360,7 @@ func TestEnterpriseService_AddOrganizationAccessRunnerGroup(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/enterprises/o/actions/runner-groups/2/organizations/42", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/enterprises/o/actions/runner-groups/2/organizations/42", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") }) @@ -385,7 +385,7 @@ func TestEnterpriseService_RemoveOrganizationAccessRunnerGroup(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/enterprises/o/actions/runner-groups/2/organizations/42", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/enterprises/o/actions/runner-groups/2/organizations/42", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) @@ -453,7 +453,7 @@ func TestEnterpriseService_SetEnterpriseRunnerGroupRunners(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/enterprises/o/actions/runner-groups/2/runners", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/enterprises/o/actions/runner-groups/2/runners", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") }) @@ -485,7 +485,7 @@ func TestEnterpriseService_AddEnterpriseRunnerGroupRunners(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/enterprises/o/actions/runner-groups/2/runners/42", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/enterprises/o/actions/runner-groups/2/runners/42", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") }) @@ -510,7 +510,7 @@ func TestEnterpriseService_RemoveEnterpriseRunnerGroupRunners(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/enterprises/o/actions/runner-groups/2/runners/42", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/enterprises/o/actions/runner-groups/2/runners/42", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/enterprise_actions_runners_test.go b/github/enterprise_actions_runners_test.go index dd714078f94..8202c9072b6 100644 --- a/github/enterprise_actions_runners_test.go +++ b/github/enterprise_actions_runners_test.go @@ -186,7 +186,7 @@ func TestEnterpriseService_RemoveRunner(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/enterprises/o/actions/runners/21", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/enterprises/o/actions/runners/21", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/enterprise_code_security_and_analysis_test.go b/github/enterprise_code_security_and_analysis_test.go index 6080299b723..57f3e65c9d3 100644 --- a/github/enterprise_code_security_and_analysis_test.go +++ b/github/enterprise_code_security_and_analysis_test.go @@ -78,7 +78,7 @@ func TestEnterpriseService_UpdateCodeSecurityAndAnalysis(t *testing.T) { SecretScanningValidityChecksEnabled: Ptr(true), } - mux.HandleFunc("/enterprises/e/code_security_and_analysis", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/enterprises/e/code_security_and_analysis", func(_ http.ResponseWriter, r *http.Request) { v := new(EnterpriseSecurityAnalysisSettings) assertNilError(t, json.NewDecoder(r.Body).Decode(v)) @@ -111,7 +111,7 @@ func TestEnterpriseService_EnableAdvancedSecurity(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/enterprises/e/advanced_security/enable_all", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/enterprises/e/advanced_security/enable_all", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") }) diff --git a/github/enterprise_manage_ghes_config_test.go b/github/enterprise_manage_ghes_config_test.go index 6fb0f526a25..4b662b4a0a0 100644 --- a/github/enterprise_manage_ghes_config_test.go +++ b/github/enterprise_manage_ghes_config_test.go @@ -603,7 +603,7 @@ func TestEnterpriseService_InitialConfig(t *testing.T) { Password: "password", } - mux.HandleFunc("/manage/v1/config/init", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/manage/v1/config/init", func(_ http.ResponseWriter, r *http.Request) { v := new(InitialConfigOptions) assertNilError(t, json.NewDecoder(r.Body).Decode(v)) diff --git a/github/enterprise_network_configurations_test.go b/github/enterprise_network_configurations_test.go index 74555997427..1c520aaff0f 100644 --- a/github/enterprise_network_configurations_test.go +++ b/github/enterprise_network_configurations_test.go @@ -336,7 +336,7 @@ func TestEnterpriseService_DeleteEnterpriseNetworkConfiguration(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/enterprises/e/network-configurations/123456789ABCDEF", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/enterprises/e/network-configurations/123456789ABCDEF", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/enterprise_properties_test.go b/github/enterprise_properties_test.go index 4f44d60f217..3155f9669bc 100644 --- a/github/enterprise_properties_test.go +++ b/github/enterprise_properties_test.go @@ -260,7 +260,7 @@ func TestEnterpriseService_RemoveCustomProperty(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/enterprises/e/properties/schema/name", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/enterprises/e/properties/schema/name", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/enterprise_rules_test.go b/github/enterprise_rules_test.go index 6e54948a908..d3e83a2af20 100644 --- a/github/enterprise_rules_test.go +++ b/github/enterprise_rules_test.go @@ -1840,7 +1840,7 @@ func TestEnterpriseService_DeleteRepositoryRuleset(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/enterprises/e/rulesets/84", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/enterprises/e/rulesets/84", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/gists_comments_test.go b/github/gists_comments_test.go index 94c07a8c5fe..c3b89c863c6 100644 --- a/github/gists_comments_test.go +++ b/github/gists_comments_test.go @@ -272,7 +272,7 @@ func TestGistsService_DeleteComment(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/gists/1/comments/2", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/gists/1/comments/2", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/gists_test.go b/github/gists_test.go index c6ee6d0f661..c7b1b88e98e 100644 --- a/github/gists_test.go +++ b/github/gists_test.go @@ -724,7 +724,7 @@ func TestGistsService_Delete(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/gists/1", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/gists/1", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) @@ -758,7 +758,7 @@ func TestGistsService_Star(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/gists/1/star", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/gists/1/star", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") }) @@ -792,7 +792,7 @@ func TestGistsService_Unstar(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/gists/1/star", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/gists/1/star", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/git_commits_test.go b/github/git_commits_test.go index f0ad44b6a64..9fd7309a3ff 100644 --- a/github/git_commits_test.go +++ b/github/git_commits_test.go @@ -32,7 +32,7 @@ func mockSigner(t *testing.T, signature string, emitErr error, wantMessage strin } func uncalledSigner(t *testing.T) MessageSignerFunc { - return func(w io.Writer, r io.Reader) error { + return func(io.Writer, io.Reader) error { t.Error("MessageSignerFunc should not be called") return nil } diff --git a/github/git_refs_test.go b/github/git_refs_test.go index 389b23c0c29..0dc62b09fe7 100644 --- a/github/git_refs_test.go +++ b/github/git_refs_test.go @@ -556,7 +556,7 @@ func TestGitService_DeleteRef(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/git/refs/heads/b", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/git/refs/heads/b", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/github.go b/github/github.go index 8f3f3e431ae..89c6ea4ef73 100644 --- a/github/github.go +++ b/github/github.go @@ -409,7 +409,7 @@ func (c *Client) initialize() { c.clientIgnoreRedirects.Transport = c.client.Transport c.clientIgnoreRedirects.Timeout = c.client.Timeout c.clientIgnoreRedirects.Jar = c.client.Jar - c.clientIgnoreRedirects.CheckRedirect = func(req *http.Request, via []*http.Request) error { + c.clientIgnoreRedirects.CheckRedirect = func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse } if c.BaseURL == nil { diff --git a/github/github_test.go b/github/github_test.go index 08a6eaaf6fc..95c7fb2a3c4 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -357,7 +357,7 @@ func TestWithAuthToken(t *testing.T) { } gotReq := false headerVal := "" - srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + srv := httptest.NewServer(http.HandlerFunc(func(_ http.ResponseWriter, r *http.Request) { gotReq = true headerVal = r.Header.Get("Authorization") })) @@ -1086,7 +1086,7 @@ func TestDo_httpError(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/", func(w http.ResponseWriter, _ *http.Request) { http.Error(w, "Bad Request", 400) }) @@ -1129,7 +1129,7 @@ func TestDo_preservesResponseInHTTPError(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/", func(w http.ResponseWriter, _ *http.Request) { w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusNotFound) fmt.Fprintf(w, `{ @@ -1198,7 +1198,7 @@ func TestDo_rateLimit(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/", func(w http.ResponseWriter, _ *http.Request) { w.Header().Set(headerRateLimit, "60") w.Header().Set(headerRateRemaining, "59") w.Header().Set(headerRateUsed, "1") @@ -1312,7 +1312,7 @@ func TestDo_rateLimit_errorResponse(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/", func(w http.ResponseWriter, _ *http.Request) { w.Header().Set(headerRateLimit, "60") w.Header().Set(headerRateRemaining, "59") w.Header().Set(headerRateUsed, "1") @@ -1353,7 +1353,7 @@ func TestDo_rateLimit_rateLimitError(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/", func(w http.ResponseWriter, _ *http.Request) { w.Header().Set(headerRateLimit, "60") w.Header().Set(headerRateRemaining, "0") w.Header().Set(headerRateUsed, "60") @@ -1403,7 +1403,7 @@ func TestDo_rateLimit_noNetworkCall(t *testing.T) { reset := time.Now().UTC().Add(time.Minute).Round(time.Second) // Rate reset is a minute from now, with 1 second precision. - mux.HandleFunc("/first", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/first", func(w http.ResponseWriter, _ *http.Request) { w.Header().Set(headerRateLimit, "60") w.Header().Set(headerRateRemaining, "0") w.Header().Set(headerRateUsed, "60") @@ -1418,7 +1418,7 @@ func TestDo_rateLimit_noNetworkCall(t *testing.T) { }) madeNetworkCall := false - mux.HandleFunc("/second", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/second", func(http.ResponseWriter, *http.Request) { madeNetworkCall = true }) @@ -1470,7 +1470,7 @@ func TestDo_rateLimit_ignoredFromCache(t *testing.T) { reset := time.Now().UTC().Add(time.Minute).Round(time.Second) // Rate reset is a minute from now, with 1 second precision. // By adding the X-From-Cache header we pretend this is served from a cache. - mux.HandleFunc("/first", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/first", func(w http.ResponseWriter, _ *http.Request) { w.Header().Set("X-From-Cache", "1") w.Header().Set(headerRateLimit, "60") w.Header().Set(headerRateRemaining, "0") @@ -1486,7 +1486,7 @@ func TestDo_rateLimit_ignoredFromCache(t *testing.T) { }) madeNetworkCall := false - mux.HandleFunc("/second", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/second", func(http.ResponseWriter, *http.Request) { madeNetworkCall = true }) @@ -1518,7 +1518,7 @@ func TestDo_rateLimit_sleepUntilResponseResetLimit(t *testing.T) { reset := time.Now().UTC().Add(time.Second) var firstRequest = true - mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/", func(w http.ResponseWriter, _ *http.Request) { if firstRequest { firstRequest = false w.Header().Set(headerRateLimit, "60") @@ -1563,7 +1563,7 @@ func TestDo_rateLimit_sleepUntilResponseResetLimitRetryOnce(t *testing.T) { reset := time.Now().UTC().Add(time.Second) requestCount := 0 - mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/", func(w http.ResponseWriter, _ *http.Request) { requestCount++ w.Header().Set(headerRateLimit, "60") w.Header().Set(headerRateRemaining, "0") @@ -1597,7 +1597,7 @@ func TestDo_rateLimit_sleepUntilClientResetLimit(t *testing.T) { reset := time.Now().UTC().Add(time.Second) client.rateLimits[CoreCategory] = Rate{Limit: 5000, Remaining: 0, Reset: Timestamp{reset}} requestCount := 0 - mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/", func(w http.ResponseWriter, _ *http.Request) { requestCount++ w.Header().Set(headerRateLimit, "5000") w.Header().Set(headerRateRemaining, "5000") @@ -1630,7 +1630,7 @@ func TestDo_rateLimit_abortSleepContextCancelled(t *testing.T) { // We use a 1 minute reset time to ensure the sleep is not completed. reset := time.Now().UTC().Add(time.Minute) requestCount := 0 - mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/", func(w http.ResponseWriter, _ *http.Request) { requestCount++ w.Header().Set(headerRateLimit, "60") w.Header().Set(headerRateRemaining, "0") @@ -1665,7 +1665,7 @@ func TestDo_rateLimit_abortSleepContextCancelledClientLimit(t *testing.T) { reset := time.Now().UTC().Add(time.Minute) client.rateLimits[CoreCategory] = Rate{Limit: 5000, Remaining: 0, Reset: Timestamp{reset}} requestCount := 0 - mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/", func(w http.ResponseWriter, _ *http.Request) { requestCount++ w.Header().Set(headerRateLimit, "5000") w.Header().Set(headerRateRemaining, "5000") @@ -1698,7 +1698,7 @@ func TestDo_rateLimit_abuseRateLimitError(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/", func(w http.ResponseWriter, _ *http.Request) { w.Header().Set("Content-Type", "application/json; charset=utf-8") w.WriteHeader(http.StatusForbidden) // When the abuse rate limit error is of the "temporarily blocked from content creation" type, @@ -1731,7 +1731,7 @@ func TestDo_rateLimit_abuseRateLimitErrorEnterprise(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/", func(w http.ResponseWriter, _ *http.Request) { w.Header().Set("Content-Type", "application/json; charset=utf-8") w.WriteHeader(http.StatusForbidden) // When the abuse rate limit error is of the "temporarily blocked from content creation" type, @@ -1765,7 +1765,7 @@ func TestDo_rateLimit_abuseRateLimitError_retryAfter(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/", func(w http.ResponseWriter, _ *http.Request) { w.Header().Set("Content-Type", "application/json; charset=utf-8") w.Header().Set(headerRetryAfter, "123") // Retry after value of 123 seconds. w.WriteHeader(http.StatusForbidden) @@ -1821,7 +1821,7 @@ func TestDo_rateLimit_abuseRateLimitError_xRateLimitReset(t *testing.T) { // x-ratelimit-reset value of 123 seconds into the future. blockUntil := time.Now().Add(time.Duration(123) * time.Second).Unix() - mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/", func(w http.ResponseWriter, _ *http.Request) { w.Header().Set("Content-Type", "application/json; charset=utf-8") w.Header().Set(headerRateReset, strconv.Itoa(int(blockUntil))) w.Header().Set(headerRateRemaining, "1") // set remaining to a value > 0 to distinct from a primary rate limit @@ -1881,7 +1881,7 @@ func TestDo_rateLimit_abuseRateLimitError_maxDuration(t *testing.T) { // x-ratelimit-reset value of 1h into the future, to make sure we are way over the max wait time duration. blockUntil := time.Now().Add(1 * time.Hour).Unix() - mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/", func(w http.ResponseWriter, _ *http.Request) { w.Header().Set("Content-Type", "application/json; charset=utf-8") w.Header().Set(headerRateReset, strconv.Itoa(int(blockUntil))) w.Header().Set(headerRateRemaining, "1") // set remaining to a value > 0 to distinct from a primary rate limit @@ -1916,7 +1916,7 @@ func TestDo_noContent(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/", func(w http.ResponseWriter, _ *http.Request) { w.WriteHeader(http.StatusNoContent) }) @@ -2634,7 +2634,7 @@ func TestUnauthenticatedRateLimitedTransport(t *testing.T) { client, mux, _ := setup(t) clientID, clientSecret := "id", "secret" - mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/", func(_ http.ResponseWriter, r *http.Request) { id, secret, ok := r.BasicAuth() if !ok { t.Errorf("request does not contain basic auth credentials") @@ -2708,7 +2708,7 @@ func TestBasicAuthTransport(t *testing.T) { username, password, otp := "u", "p", "123456" - mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/", func(_ http.ResponseWriter, r *http.Request) { u, p, ok := r.BasicAuth() if !ok { t.Errorf("request does not contain basic auth credentials") diff --git a/github/interactions_orgs_test.go b/github/interactions_orgs_test.go index d482cb6cea9..e24d37024dd 100644 --- a/github/interactions_orgs_test.go +++ b/github/interactions_orgs_test.go @@ -99,7 +99,7 @@ func TestInteractionsService_RemoveRestrictionsFromOrg(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/interaction-limits", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/interaction-limits", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") testHeader(t, r, "Accept", mediaTypeInteractionRestrictionsPreview) }) diff --git a/github/interactions_repos_test.go b/github/interactions_repos_test.go index 6107986b93a..2d5142cedb7 100644 --- a/github/interactions_repos_test.go +++ b/github/interactions_repos_test.go @@ -99,7 +99,7 @@ func TestInteractionsService_RemoveRestrictionsFromRepo(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/interaction-limits", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/interaction-limits", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") testHeader(t, r, "Accept", mediaTypeInteractionRestrictionsPreview) }) diff --git a/github/issues_assignees_test.go b/github/issues_assignees_test.go index 88f0e0e42b3..06c91a07966 100644 --- a/github/issues_assignees_test.go +++ b/github/issues_assignees_test.go @@ -65,7 +65,7 @@ func TestIssuesService_IsAssignee_true(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/assignees/u", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/assignees/u", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") }) diff --git a/github/issues_comments_test.go b/github/issues_comments_test.go index aa9ed2b1146..056c70642b0 100644 --- a/github/issues_comments_test.go +++ b/github/issues_comments_test.go @@ -265,7 +265,7 @@ func TestIssuesService_DeleteComment(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/issues/comments/1", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/issues/comments/1", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/issues_labels_test.go b/github/issues_labels_test.go index fd14153b6ab..a607bf4fb19 100644 --- a/github/issues_labels_test.go +++ b/github/issues_labels_test.go @@ -215,7 +215,7 @@ func TestIssuesService_DeleteLabel(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/labels/n", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/labels/n", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) @@ -351,7 +351,7 @@ func TestIssuesService_RemoveLabelForIssue(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/issues/1/labels/l", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/issues/1/labels/l", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) @@ -438,7 +438,7 @@ func TestIssuesService_RemoveLabelsForIssue(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/issues/1/labels", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/issues/1/labels", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/issues_milestones_test.go b/github/issues_milestones_test.go index 8b6e17e4ea7..22fa49ec10c 100644 --- a/github/issues_milestones_test.go +++ b/github/issues_milestones_test.go @@ -220,7 +220,7 @@ func TestIssuesService_DeleteMilestone(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/milestones/1", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/milestones/1", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/messages_test.go b/github/messages_test.go index 3c8cedfeab8..b414a9e6a93 100644 --- a/github/messages_test.go +++ b/github/messages_test.go @@ -199,7 +199,7 @@ func TestValidatePayload_NoSecretKey(t *testing.T) { // badReader satisfies io.Reader but always returns an error. type badReader struct{} -func (b *badReader) Read(p []byte) (int, error) { +func (b *badReader) Read([]byte) (int, error) { return 0, errors.New("bad reader") } diff --git a/github/migrations.go b/github/migrations.go index 766c4c38e1c..2bc7af8da00 100644 --- a/github/migrations.go +++ b/github/migrations.go @@ -181,7 +181,7 @@ func (s *MigrationService) MigrationArchiveURL(ctx context.Context, org string, // Disable the redirect mechanism because AWS fails if the GitHub auth token is provided. var loc string saveRedirect := s.client.client.CheckRedirect - s.client.client.CheckRedirect = func(req *http.Request, via []*http.Request) error { + s.client.client.CheckRedirect = func(req *http.Request, _ []*http.Request) error { loc = req.URL.String() return errors.New("disable redirect") } diff --git a/github/migrations_user.go b/github/migrations_user.go index a7bd79499a2..58e780ea7bb 100644 --- a/github/migrations_user.go +++ b/github/migrations_user.go @@ -172,7 +172,7 @@ func (s *MigrationService) UserMigrationArchiveURL(ctx context.Context, id int64 var loc string originalRedirect := s.client.client.CheckRedirect - s.client.client.CheckRedirect = func(req *http.Request, via []*http.Request) error { + s.client.client.CheckRedirect = func(req *http.Request, _ []*http.Request) error { loc = req.URL.String() return http.ErrUseLastResponse } diff --git a/github/orgs_hooks_test.go b/github/orgs_hooks_test.go index 3b3b8bff91c..aec8dda8e59 100644 --- a/github/orgs_hooks_test.go +++ b/github/orgs_hooks_test.go @@ -208,7 +208,7 @@ func TestOrganizationsService_PingHook(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/hooks/1/pings", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/hooks/1/pings", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") }) @@ -233,7 +233,7 @@ func TestOrganizationsService_DeleteHook(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/hooks/1", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/hooks/1", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/orgs_issue_types_test.go b/github/orgs_issue_types_test.go index 7775b4f5ef2..57c731a35d2 100644 --- a/github/orgs_issue_types_test.go +++ b/github/orgs_issue_types_test.go @@ -216,7 +216,7 @@ func TestOrganizationsService_DeleteIssueType(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/issue-types/410", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/issue-types/410", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/orgs_members_test.go b/github/orgs_members_test.go index 71c7fbef3a7..dbdb0f284a1 100644 --- a/github/orgs_members_test.go +++ b/github/orgs_members_test.go @@ -263,7 +263,7 @@ func TestOrganizationsService_RemoveMember(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/members/u", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/members/u", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) @@ -323,7 +323,7 @@ func TestOrganizationsService_PublicizeMembership(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/public_members/u", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/public_members/u", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") }) @@ -348,7 +348,7 @@ func TestOrganizationsService_ConcealMembership(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/public_members/u", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/public_members/u", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/orgs_network_configurations_test.go b/github/orgs_network_configurations_test.go index 51fec33f30b..9a095066990 100644 --- a/github/orgs_network_configurations_test.go +++ b/github/orgs_network_configurations_test.go @@ -417,7 +417,7 @@ func TestOrganizationsService_DeleteOrgsNetworkConfiguration(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/settings/network-configurations/789ABDCEF123456", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/settings/network-configurations/789ABDCEF123456", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/orgs_outside_collaborators_test.go b/github/orgs_outside_collaborators_test.go index 42b4b770192..7120449c02f 100644 --- a/github/orgs_outside_collaborators_test.go +++ b/github/orgs_outside_collaborators_test.go @@ -70,7 +70,7 @@ func TestOrganizationsService_RemoveOutsideCollaborator(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - handler := func(w http.ResponseWriter, r *http.Request) { + handler := func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") } mux.HandleFunc("/orgs/o/outside_collaborators/u", handler) @@ -134,7 +134,7 @@ func TestOrganizationsService_ConvertMemberToOutsideCollaborator(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - handler := func(w http.ResponseWriter, r *http.Request) { + handler := func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") } mux.HandleFunc("/orgs/o/outside_collaborators/u", handler) diff --git a/github/orgs_packages_test.go b/github/orgs_packages_test.go index 1bc72bc7cdf..329052ba675 100644 --- a/github/orgs_packages_test.go +++ b/github/orgs_packages_test.go @@ -178,7 +178,7 @@ func TestOrganizationsService_DeletePackage(t *testing.T) { client, mux, _ := setup(t) // don't url escape the package name here since mux will convert it to a slash automatically - mux.HandleFunc("/orgs/o/packages/container/hello%2fhello_docker", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/packages/container/hello%2fhello_docker", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) @@ -208,7 +208,7 @@ func TestOrganizationsService_RestorePackage(t *testing.T) { client, mux, _ := setup(t) // don't url escape the package name here since mux will convert it to a slash automatically - mux.HandleFunc("/orgs/o/packages/container/hello%2Fhello_docker/restore", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/packages/container/hello%2Fhello_docker/restore", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") }) @@ -372,7 +372,7 @@ func TestOrganizationsService_PackageDeleteVersion(t *testing.T) { client, mux, _ := setup(t) // don't url escape the package name here since mux will convert it to a slash automatically - mux.HandleFunc("/orgs/o/packages/container/hello%2Fhello_docker/versions/45763", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/packages/container/hello%2Fhello_docker/versions/45763", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) @@ -398,7 +398,7 @@ func TestOrganizationsService_PackageRestoreVersion(t *testing.T) { client, mux, _ := setup(t) // don't url escape the package name here since mux will convert it to a slash automatically - mux.HandleFunc("/orgs/o/packages/container/hello%2Fhello_docker/versions/45763/restore", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/packages/container/hello%2Fhello_docker/versions/45763/restore", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") }) diff --git a/github/orgs_properties_test.go b/github/orgs_properties_test.go index ceab4525171..e8bf5fe6502 100644 --- a/github/orgs_properties_test.go +++ b/github/orgs_properties_test.go @@ -260,7 +260,7 @@ func TestOrganizationsService_RemoveCustomProperty(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/properties/schema/name", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/properties/schema/name", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) @@ -449,7 +449,7 @@ func TestOrganizationsService_CreateOrUpdateRepoCustomPropertyValues(t *testing. t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/properties/values", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/properties/values", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") testBody(t, r, `{"repository_names":["repo"],"properties":[{"property_name":"service","value":"string"}]}`+"\n") }) diff --git a/github/orgs_rules_test.go b/github/orgs_rules_test.go index b21ff93b151..d9727fff89a 100644 --- a/github/orgs_rules_test.go +++ b/github/orgs_rules_test.go @@ -1634,7 +1634,7 @@ func TestOrganizationsService_DeleteRepositoryRuleset(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/rulesets/21", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/rulesets/21", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/orgs_security_managers_test.go b/github/orgs_security_managers_test.go index 3ce67d24c03..4886ac74b8d 100644 --- a/github/orgs_security_managers_test.go +++ b/github/orgs_security_managers_test.go @@ -62,7 +62,7 @@ func TestOrganizationsService_AddSecurityManagerTeam(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/security-managers/teams/t", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/security-managers/teams/t", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") }) @@ -105,7 +105,7 @@ func TestOrganizationsService_RemoveSecurityManagerTeam(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/security-managers/teams/t", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/security-managers/teams/t", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/orgs_test.go b/github/orgs_test.go index 3866ca78773..0e4e425eb8e 100644 --- a/github/orgs_test.go +++ b/github/orgs_test.go @@ -320,7 +320,7 @@ func TestOrganizationsService_Delete(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/pulls_comments_test.go b/github/pulls_comments_test.go index 3df530662d0..2e5f20b8dc8 100644 --- a/github/pulls_comments_test.go +++ b/github/pulls_comments_test.go @@ -418,7 +418,7 @@ func TestPullRequestsService_DeleteComment(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/pulls/comments/1", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/pulls/comments/1", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/pulls_reviewers_test.go b/github/pulls_reviewers_test.go index cfc415ef82f..1642e0f7df1 100644 --- a/github/pulls_reviewers_test.go +++ b/github/pulls_reviewers_test.go @@ -155,7 +155,7 @@ func TestRemoveReviewers(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/pulls/1/requested_reviewers", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/pulls/1/requested_reviewers", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") testBody(t, r, `{"reviewers":["octocat","googlebot"],"team_reviewers":["justice-league"]}`+"\n") }) @@ -176,7 +176,7 @@ func TestRemoveReviewers_teamsOnly(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/pulls/1/requested_reviewers", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/pulls/1/requested_reviewers", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") testBody(t, r, `{"reviewers":[],"team_reviewers":["justice-league"]}`+"\n") }) diff --git a/github/pulls_test.go b/github/pulls_test.go index 4a48bdb08ae..b321b485451 100644 --- a/github/pulls_test.go +++ b/github/pulls_test.go @@ -796,7 +796,7 @@ func TestPullRequestsService_Merge_options(t *testing.T) { for i, test := range tests { madeRequest := false - mux.HandleFunc(fmt.Sprintf("/repos/o/r/pulls/%d/merge", i), func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc(fmt.Sprintf("/repos/o/r/pulls/%d/merge", i), func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") testBody(t, r, test.wantBody+"\n") madeRequest = true @@ -815,7 +815,7 @@ func TestPullRequestsService_Merge_Blank_Message(t *testing.T) { madeRequest := false expectedBody := "" - mux.HandleFunc("/repos/o/r/pulls/1/merge", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/pulls/1/merge", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") testBody(t, r, expectedBody+"\n") madeRequest = true diff --git a/github/rate_limit_test.go b/github/rate_limit_test.go index 8e7f2c83563..bd2414d57f6 100644 --- a/github/rate_limit_test.go +++ b/github/rate_limit_test.go @@ -214,7 +214,7 @@ func TestRateLimits_overQuota(t *testing.T) { Used: 1, Reset: Timestamp{time.Now().Add(time.Hour).Local()}, } - mux.HandleFunc("/rate_limit", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/rate_limit", func(w http.ResponseWriter, _ *http.Request) { fmt.Fprint(w, `{"resources":{ "core": {"limit":2,"remaining":1,"used":1,"reset":1372700873}, "search": {"limit":3,"remaining":2,"used":1,"reset":1372700874}, diff --git a/github/repos_actions_access_test.go b/github/repos_actions_access_test.go index c7550dd28ba..f732bd35cb5 100644 --- a/github/repos_actions_access_test.go +++ b/github/repos_actions_access_test.go @@ -55,7 +55,7 @@ func TestRepositoriesService_EditActionsAccessLevel(t *testing.T) { input := &RepositoryActionsAccessLevel{AccessLevel: Ptr("organization")} - mux.HandleFunc("/repos/o/r/actions/permissions/access", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/actions/permissions/access", func(_ http.ResponseWriter, r *http.Request) { v := new(RepositoryActionsAccessLevel) assertNilError(t, json.NewDecoder(r.Body).Decode(v)) diff --git a/github/repos_comments_test.go b/github/repos_comments_test.go index c415b1c3202..bed314c6a0c 100644 --- a/github/repos_comments_test.go +++ b/github/repos_comments_test.go @@ -264,7 +264,7 @@ func TestRepositoriesService_DeleteComment(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/comments/1", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/comments/1", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/repos_contents_test.go b/github/repos_contents_test.go index 1db41a4c1d2..e698cc8f528 100644 --- a/github/repos_contents_test.go +++ b/github/repos_contents_test.go @@ -298,7 +298,7 @@ func TestRepositoriesService_DownloadContents_NoDownloadURL(t *testing.T) { fmt.Fprint(w, `[{ "type": "file", "name": "f", - "content": "" + "content": "" }]`) }) @@ -909,7 +909,7 @@ func TestRepositoriesService_GetArchiveLink(t *testing.T) { }) // Add custom round tripper - client.client.Transport = roundTripperFunc(func(r *http.Request) (*http.Response, error) { + client.client.Transport = roundTripperFunc(func(*http.Request) (*http.Response, error) { return nil, errors.New("failed to get archive link") }) testBadOptions(t, methodName, func() (err error) { diff --git a/github/repos_deployment_branch_policies_test.go b/github/repos_deployment_branch_policies_test.go index bbf4499cf9c..4eb9eab7820 100644 --- a/github/repos_deployment_branch_policies_test.go +++ b/github/repos_deployment_branch_policies_test.go @@ -17,7 +17,7 @@ func TestRepositoriesService_ListDeploymentBranchPolicies(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/environments/e/deployment-branch-policies", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/environments/e/deployment-branch-policies", func(w http.ResponseWriter, _ *http.Request) { fmt.Fprint(w, `{"total_count":2, "branch_policies":[{"id":1}, {"id": 2}]}`) }) @@ -52,7 +52,7 @@ func TestRepositoriesService_GetDeploymentBranchPolicy(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/environments/e/deployment-branch-policies/1", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/environments/e/deployment-branch-policies/1", func(w http.ResponseWriter, _ *http.Request) { fmt.Fprint(w, `{"id":1}`) }) @@ -141,7 +141,7 @@ func TestRepositoriesService_DeleteDeploymentBranchPolicy(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/environments/e/deployment-branch-policies/1", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/environments/e/deployment-branch-policies/1", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/repos_environments_test.go b/github/repos_environments_test.go index 715012db2f2..73c5cb736d9 100644 --- a/github/repos_environments_test.go +++ b/github/repos_environments_test.go @@ -331,7 +331,7 @@ func TestRepositoriesService_DeleteEnvironment(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/environments/e", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/environments/e", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/repos_hooks_test.go b/github/repos_hooks_test.go index 059d5371034..e57a9161332 100644 --- a/github/repos_hooks_test.go +++ b/github/repos_hooks_test.go @@ -218,7 +218,7 @@ func TestRepositoriesService_DeleteHook(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/hooks/1", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/hooks/1", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) @@ -252,7 +252,7 @@ func TestRepositoriesService_PingHook(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/hooks/1/pings", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/hooks/1/pings", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") }) @@ -277,7 +277,7 @@ func TestRepositoriesService_TestHook(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/hooks/1/tests", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/hooks/1/tests", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") }) @@ -570,7 +570,7 @@ func TestRepositoriesService_Subscribe(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/hub", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/hub", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, http.MethodPost) testHeader(t, r, "Content-Type", "application/x-www-form-urlencoded") testFormValues(t, r, values{ @@ -603,7 +603,7 @@ func TestRepositoriesService_Unsubscribe(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/hub", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/hub", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, http.MethodPost) testHeader(t, r, "Content-Type", "application/x-www-form-urlencoded") testFormValues(t, r, values{ diff --git a/github/repos_keys_test.go b/github/repos_keys_test.go index af63857116c..e1fecaca0fe 100644 --- a/github/repos_keys_test.go +++ b/github/repos_keys_test.go @@ -162,7 +162,7 @@ func TestRepositoriesService_DeleteKey(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/keys/1", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/keys/1", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/repos_pages_test.go b/github/repos_pages_test.go index 31a2ee1b2ee..505f6a8b6c1 100644 --- a/github/repos_pages_test.go +++ b/github/repos_pages_test.go @@ -271,7 +271,7 @@ func TestRepositoriesService_DisablePages(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/pages", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/pages", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") testHeader(t, r, "Accept", mediaTypeEnablePagesAPIPreview) }) diff --git a/github/repos_prereceive_hooks_test.go b/github/repos_prereceive_hooks_test.go index c424c47a9fa..fc1c3e7f606 100644 --- a/github/repos_prereceive_hooks_test.go +++ b/github/repos_prereceive_hooks_test.go @@ -165,7 +165,7 @@ func TestRepositoriesService_DeletePreReceiveHook(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/pre-receive-hooks/1", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/pre-receive-hooks/1", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/repos_releases.go b/github/repos_releases.go index 6023f632716..d4b4591bfbb 100644 --- a/github/repos_releases.go +++ b/github/repos_releases.go @@ -355,7 +355,7 @@ func (s *RepositoriesService) DownloadReleaseAsset(ctx context.Context, owner, r var loc string saveRedirect := s.client.client.CheckRedirect - s.client.client.CheckRedirect = func(req *http.Request, via []*http.Request) error { + s.client.client.CheckRedirect = func(req *http.Request, _ []*http.Request) error { loc = req.URL.String() return errors.New("disable redirect") } diff --git a/github/repos_releases_test.go b/github/repos_releases_test.go index 011e8cf67bf..4e777228ad2 100644 --- a/github/repos_releases_test.go +++ b/github/repos_releases_test.go @@ -332,7 +332,7 @@ func TestRepositoriesService_DeleteRelease(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/releases/1", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/releases/1", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) @@ -656,7 +656,7 @@ func TestRepositoriesService_DeleteReleaseAsset(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r/releases/assets/1", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/releases/assets/1", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/repos_rules_test.go b/github/repos_rules_test.go index 24beb654199..d94d5bb57f5 100644 --- a/github/repos_rules_test.go +++ b/github/repos_rules_test.go @@ -555,7 +555,7 @@ func TestRepositoriesService_DeleteRuleset(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/repo/rulesets/42", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/repo/rulesets/42", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/repos_test.go b/github/repos_test.go index a62711a1454..a7f1b85e827 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -519,7 +519,7 @@ func TestRepositoriesService_Delete(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/repos/o/r", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) @@ -1067,7 +1067,7 @@ func TestRepositoriesService_GetBranch_notFound(t *testing.T) { } // Add custom round tripper - client.client.Transport = roundTripperFunc(func(r *http.Request) (*http.Response, error) { + client.client.Transport = roundTripperFunc(func(*http.Request) (*http.Response, error) { return nil, errors.New("failed to get branch") }) @@ -3545,7 +3545,7 @@ func TestRepositoriesService_ListAppRestrictions(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc(test.urlPath, func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") }) @@ -3736,7 +3736,7 @@ func TestRepositoriesService_ListTeamRestrictions(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc(test.urlPath, func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") }) @@ -3927,7 +3927,7 @@ func TestRepositoriesService_ListUserRestrictions(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc(test.urlPath, func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") }) diff --git a/github/scim.go b/github/scim.go index 70f063caa9b..b6b0f6ddd0d 100644 --- a/github/scim.go +++ b/github/scim.go @@ -252,7 +252,7 @@ func (s *SCIMService) DeleteSCIMUserFromOrg(ctx context.Context, org, scimUserID // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#list-provisioned-scim-groups-for-an-enterprise // //meta:operation GET /scim/v2/enterprises/{enterprise}/Groups -func (s *SCIMService) ListSCIMProvisionedGroupsForEnterprise(ctx context.Context, enterprise string, opts *ListSCIMProvisionedIdentitiesOptions) (*SCIMProvisionedGroups, *Response, error) { +func (s *SCIMService) ListSCIMProvisionedGroupsForEnterprise(ctx context.Context, enterprise string, _ *ListSCIMProvisionedIdentitiesOptions) (*SCIMProvisionedGroups, *Response, error) { u := fmt.Sprintf("scim/v2/enterprises/%v/Groups", enterprise) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/teams_discussion_comments_test.go b/github/teams_discussion_comments_test.go index e8173abcd5a..e49fb9dc9d4 100644 --- a/github/teams_discussion_comments_test.go +++ b/github/teams_discussion_comments_test.go @@ -388,7 +388,7 @@ func TestTeamsService_DeleteComment(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - handlerFunc := func(w http.ResponseWriter, r *http.Request) { + handlerFunc := func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") } diff --git a/github/teams_discussions_test.go b/github/teams_discussions_test.go index 236382e0227..169f85736df 100644 --- a/github/teams_discussions_test.go +++ b/github/teams_discussions_test.go @@ -496,7 +496,7 @@ func TestTeamsService_DeleteDiscussionByID(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/organizations/1/team/2/discussions/3", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/organizations/1/team/2/discussions/3", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) @@ -521,7 +521,7 @@ func TestTeamsService_DeleteDiscussionBySlug(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/teams/s/discussions/3", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/teams/s/discussions/3", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/teams_test.go b/github/teams_test.go index 1e3d3da2980..0c230c121c6 100644 --- a/github/teams_test.go +++ b/github/teams_test.go @@ -411,7 +411,7 @@ func TestTeamsService_DeleteTeamByID(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/organizations/1/team/1", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/organizations/1/team/1", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) @@ -436,7 +436,7 @@ func TestTeamsService_DeleteTeamBySlug(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/orgs/o/teams/s", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/orgs/o/teams/s", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/users_emails_test.go b/github/users_emails_test.go index 6c1c73f3ef9..a3bfeddf72f 100644 --- a/github/users_emails_test.go +++ b/github/users_emails_test.go @@ -99,7 +99,7 @@ func TestUsersService_DeleteEmails(t *testing.T) { input := []string{"user@example.com"} - mux.HandleFunc("/user/emails", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/user/emails", func(_ http.ResponseWriter, r *http.Request) { var v []string assertNilError(t, json.NewDecoder(r.Body).Decode(&v)) diff --git a/github/users_followers_test.go b/github/users_followers_test.go index 1ffe5d7c70e..5f0de89ab19 100644 --- a/github/users_followers_test.go +++ b/github/users_followers_test.go @@ -321,7 +321,7 @@ func TestUsersService_Follow(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/user/following/u", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/user/following/u", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") }) @@ -355,7 +355,7 @@ func TestUsersService_Unfollow(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/user/following/u", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/user/following/u", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/users_gpg_keys_test.go b/github/users_gpg_keys_test.go index 585ea4c6dbd..a28225c6347 100644 --- a/github/users_gpg_keys_test.go +++ b/github/users_gpg_keys_test.go @@ -169,7 +169,7 @@ func TestUsersService_DeleteGPGKey(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/user/gpg_keys/1", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/user/gpg_keys/1", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/users_keys_test.go b/github/users_keys_test.go index 59167a34778..07c43f77506 100644 --- a/github/users_keys_test.go +++ b/github/users_keys_test.go @@ -160,7 +160,7 @@ func TestUsersService_DeleteKey(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/user/keys/1", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/user/keys/1", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/github/users_packages_test.go b/github/users_packages_test.go index 9de73583615..0456254a696 100644 --- a/github/users_packages_test.go +++ b/github/users_packages_test.go @@ -244,7 +244,7 @@ func TestUsersService_Authenticated_DeletePackage(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/user/packages/container/hello_docker", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/user/packages/container/hello_docker", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) @@ -269,7 +269,7 @@ func TestUsersService_specifiedUser_DeletePackage(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/users/u/packages/container/hello_docker", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/users/u/packages/container/hello_docker", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) @@ -294,7 +294,7 @@ func TestUsersService_Authenticated_RestorePackage(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/user/packages/container/hello_docker/restore", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/user/packages/container/hello_docker/restore", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") }) @@ -319,7 +319,7 @@ func TestUsersService_specifiedUser_RestorePackage(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/users/u/packages/container/hello_docker/restore", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/users/u/packages/container/hello_docker/restore", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") }) @@ -602,7 +602,7 @@ func TestUsersService_Authenticated_PackageDeleteVersion(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/user/packages/container/hello_docker/versions/45763", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/user/packages/container/hello_docker/versions/45763", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) @@ -627,7 +627,7 @@ func TestUsersService_specifiedUser_PackageDeleteVersion(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/users/u/packages/container/hello_docker/versions/45763", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/users/u/packages/container/hello_docker/versions/45763", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) @@ -652,7 +652,7 @@ func TestUsersService_Authenticated_PackageRestoreVersion(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/user/packages/container/hello_docker/versions/45763/restore", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/user/packages/container/hello_docker/versions/45763/restore", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") }) @@ -677,7 +677,7 @@ func TestUsersService_specifiedUser_PackageRestoreVersion(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/users/u/packages/container/hello_docker/versions/45763/restore", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/users/u/packages/container/hello_docker/versions/45763/restore", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") }) diff --git a/github/users_ssh_signing_keys_test.go b/github/users_ssh_signing_keys_test.go index 56c082fdb8a..35189c75f89 100644 --- a/github/users_ssh_signing_keys_test.go +++ b/github/users_ssh_signing_keys_test.go @@ -160,7 +160,7 @@ func TestUsersService_DeleteSSHSigningKey(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - mux.HandleFunc("/user/ssh_signing_keys/1", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/user/ssh_signing_keys/1", func(_ http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) diff --git a/scrape/apps.go b/scrape/apps.go index 291a194efa4..2563e17356f 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -53,7 +53,7 @@ func (c *Client) ListOAuthApps(org string) ([]*OAuthApp, error) { } var apps []*OAuthApp - doc.Find(".oauth-application-allowlist ul > li").Each(func(i int, s *goquery.Selection) { + doc.Find(".oauth-application-allowlist ul > li").Each(func(_ int, s *goquery.Selection) { var app OAuthApp app.Name = s.Find(".request-info strong").First().Text() app.Description = s.Find(".request-info .application-description").Text() diff --git a/scrape/apps_test.go b/scrape/apps_test.go index e7f6da6dcd8..06ab9e1394a 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -38,7 +38,7 @@ func Test_AppRestrictionsEnabled(t *testing.T) { t.Parallel() client, mux := setup(t) - mux.HandleFunc("/organizations/o/settings/oauth_application_policy", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/organizations/o/settings/oauth_application_policy", func(w http.ResponseWriter, _ *http.Request) { copyTestFile(t, w, tt.testFile) }) @@ -57,7 +57,7 @@ func Test_ListOAuthApps(t *testing.T) { t.Parallel() client, mux := setup(t) - mux.HandleFunc("/organizations/e/settings/oauth_application_policy", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/organizations/e/settings/oauth_application_policy", func(w http.ResponseWriter, _ *http.Request) { copyTestFile(t, w, "access-restrictions-enabled.html") }) @@ -94,7 +94,7 @@ func Test_CreateApp(t *testing.T) { t.Parallel() client, mux := setup(t) - mux.HandleFunc("/apps/settings/new", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/apps/settings/new", func(w http.ResponseWriter, _ *http.Request) { w.WriteHeader(http.StatusCreated) }) @@ -112,7 +112,7 @@ func Test_CreateAppWithOrg(t *testing.T) { t.Parallel() client, mux := setup(t) - mux.HandleFunc("/organizations/example/apps/settings/new", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/organizations/example/apps/settings/new", func(w http.ResponseWriter, _ *http.Request) { w.WriteHeader(http.StatusCreated) }) diff --git a/scrape/forms_test.go b/scrape/forms_test.go index 3a7f1b37a2d..52d4d5edbbf 100644 --- a/scrape/forms_test.go +++ b/scrape/forms_test.go @@ -94,13 +94,13 @@ func Test_FetchAndSumbitForm(t *testing.T) { client, mux := setup(t) var submitted bool - mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/", func(w http.ResponseWriter, _ *http.Request) { fmt.Fprint(w, `
    `) }) - mux.HandleFunc("/submit", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/submit", func(_ http.ResponseWriter, r *http.Request) { err := r.ParseForm() if err != nil { t.Fatalf("error parsing form: %v", err) diff --git a/scrape/payment.go b/scrape/payment.go index fff9a7531fd..d00eaa9e728 100644 --- a/scrape/payment.go +++ b/scrape/payment.go @@ -23,7 +23,7 @@ func (c *Client) OrgPaymentInformation(org string) (PaymentInformation, error) { return info, err } - doc.Find("main h4.mb-1").Each(func(i int, s *goquery.Selection) { + doc.Find("main h4.mb-1").Each(func(_ int, s *goquery.Selection) { name := strings.TrimSpace(strings.ToLower(s.Text())) value := strings.Join(strings.Fields(strings.TrimSpace(s.NextFiltered("p").Text())), " ") diff --git a/tools/sliceofpointers/sliceofpointers.go b/tools/sliceofpointers/sliceofpointers.go index 75639b68b0b..75519996a7c 100644 --- a/tools/sliceofpointers/sliceofpointers.go +++ b/tools/sliceofpointers/sliceofpointers.go @@ -24,7 +24,7 @@ func init() { type SliceOfPointersPlugin struct{} // New returns an analysis.Analyzer to use with golangci-lint. -func New(settings any) (register.LinterPlugin, error) { +func New(_ any) (register.LinterPlugin, error) { return &SliceOfPointersPlugin{}, nil } From c21f2bed95db30eaaffb640734f7c1630d04b433 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Wed, 25 Jun 2025 19:29:42 +0300 Subject: [PATCH 738/751] chore: Correct typos in comments and tests error messages (#3604) --- github/issues.go | 2 +- github/repos_test.go | 4 ++-- scrape/forms_test.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/github/issues.go b/github/issues.go index 395d64cf44f..2704339adc0 100644 --- a/github/issues.go +++ b/github/issues.go @@ -136,7 +136,7 @@ type PullRequestLinks struct { } // IssueType represents the type of issue. -// For now it shows up when receiveing an Issue event. +// For now it shows up when receiving an Issue event. type IssueType struct { ID *int64 `json:"id,omitempty"` NodeID *string `json:"node_id,omitempty"` diff --git a/github/repos_test.go b/github/repos_test.go index a7f1b85e827..668baecf5f7 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -676,7 +676,7 @@ func TestRepositoriesService_GetAutomatedSecurityFixes(t *testing.T) { ctx := context.Background() fixes, _, err := client.Repositories.GetAutomatedSecurityFixes(ctx, "o", "r") if err != nil { - t.Errorf("Repositories.GetAutomatedSecurityFixes returned errpr: #{err}") + t.Errorf("Repositories.GetAutomatedSecurityFixes returned error: #{err}") } want := &AutomatedSecurityFixes{ @@ -3342,7 +3342,7 @@ func TestRepositoriesService_OptionalSignaturesOnProtectedBranch(t *testing.T) { } } -func TestPullRequestReviewsEnforcementRequest_MarshalJSON_nilDismissalRestirctions(t *testing.T) { +func TestPullRequestReviewsEnforcementRequest_MarshalJSON_nilDismissalRestrictions(t *testing.T) { t.Parallel() req := PullRequestReviewsEnforcementRequest{} diff --git a/scrape/forms_test.go b/scrape/forms_test.go index 52d4d5edbbf..c1f4152c384 100644 --- a/scrape/forms_test.go +++ b/scrape/forms_test.go @@ -89,7 +89,7 @@ func Test_ParseForms(t *testing.T) { } } -func Test_FetchAndSumbitForm(t *testing.T) { +func Test_FetchAndSubmitForm(t *testing.T) { t.Parallel() client, mux := setup(t) var submitted bool From f1b11e1b216e9722c0a097fd41bb8be7aaea41b0 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Wed, 25 Jun 2025 22:52:03 +0300 Subject: [PATCH 739/751] fix!: Add ListSCIMProvisionedGroupsForEnterpriseOptions (#3601) BREAKING CHANGE: `ListSCIMProvisionedGroupsForEnterprise` now takes `ListSCIMProvisionedGroupsForEnterpriseOptions` instead of `*ListSCIMProvisionedIdentitiesOptions`. --- github/github-accessors.go | 32 ++++++++++++++++++++++++ github/github-accessors_test.go | 44 +++++++++++++++++++++++++++++++++ github/scim.go | 26 ++++++++++++++++++- github/scim_test.go | 13 +++++++++- 4 files changed, 113 insertions(+), 2 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 3193aa9943f..135726bca85 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -13454,6 +13454,38 @@ func (l *ListRunnersOptions) GetName() string { return *l.Name } +// GetCount returns the Count field if it's non-nil, zero value otherwise. +func (l *ListSCIMProvisionedGroupsForEnterpriseOptions) GetCount() int { + if l == nil || l.Count == nil { + return 0 + } + return *l.Count +} + +// GetExcludedAttributes returns the ExcludedAttributes field if it's non-nil, zero value otherwise. +func (l *ListSCIMProvisionedGroupsForEnterpriseOptions) GetExcludedAttributes() string { + if l == nil || l.ExcludedAttributes == nil { + return "" + } + return *l.ExcludedAttributes +} + +// GetFilter returns the Filter field if it's non-nil, zero value otherwise. +func (l *ListSCIMProvisionedGroupsForEnterpriseOptions) GetFilter() string { + if l == nil || l.Filter == nil { + return "" + } + return *l.Filter +} + +// GetStartIndex returns the StartIndex field if it's non-nil, zero value otherwise. +func (l *ListSCIMProvisionedGroupsForEnterpriseOptions) GetStartIndex() int { + if l == nil || l.StartIndex == nil { + return 0 + } + return *l.StartIndex +} + // GetCount returns the Count field if it's non-nil, zero value otherwise. func (l *ListSCIMProvisionedIdentitiesOptions) GetCount() int { if l == nil || l.Count == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 1bb42959961..ca2f10ffb92 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -17454,6 +17454,50 @@ func TestListRunnersOptions_GetName(tt *testing.T) { l.GetName() } +func TestListSCIMProvisionedGroupsForEnterpriseOptions_GetCount(tt *testing.T) { + tt.Parallel() + var zeroValue int + l := &ListSCIMProvisionedGroupsForEnterpriseOptions{Count: &zeroValue} + l.GetCount() + l = &ListSCIMProvisionedGroupsForEnterpriseOptions{} + l.GetCount() + l = nil + l.GetCount() +} + +func TestListSCIMProvisionedGroupsForEnterpriseOptions_GetExcludedAttributes(tt *testing.T) { + tt.Parallel() + var zeroValue string + l := &ListSCIMProvisionedGroupsForEnterpriseOptions{ExcludedAttributes: &zeroValue} + l.GetExcludedAttributes() + l = &ListSCIMProvisionedGroupsForEnterpriseOptions{} + l.GetExcludedAttributes() + l = nil + l.GetExcludedAttributes() +} + +func TestListSCIMProvisionedGroupsForEnterpriseOptions_GetFilter(tt *testing.T) { + tt.Parallel() + var zeroValue string + l := &ListSCIMProvisionedGroupsForEnterpriseOptions{Filter: &zeroValue} + l.GetFilter() + l = &ListSCIMProvisionedGroupsForEnterpriseOptions{} + l.GetFilter() + l = nil + l.GetFilter() +} + +func TestListSCIMProvisionedGroupsForEnterpriseOptions_GetStartIndex(tt *testing.T) { + tt.Parallel() + var zeroValue int + l := &ListSCIMProvisionedGroupsForEnterpriseOptions{StartIndex: &zeroValue} + l.GetStartIndex() + l = &ListSCIMProvisionedGroupsForEnterpriseOptions{} + l.GetStartIndex() + l = nil + l.GetStartIndex() +} + func TestListSCIMProvisionedIdentitiesOptions_GetCount(tt *testing.T) { tt.Parallel() var zeroValue int diff --git a/github/scim.go b/github/scim.go index b6b0f6ddd0d..8b3c1c4ee5b 100644 --- a/github/scim.go +++ b/github/scim.go @@ -108,6 +108,26 @@ type ListSCIMProvisionedIdentitiesOptions struct { Filter *string `url:"filter,omitempty"` } +// ListSCIMProvisionedGroupsForEnterpriseOptions represents options for ListSCIMProvisionedGroupsForEnterprise. +// +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/enterprise-admin/scim#list-provisioned-scim-groups-for-an-enterprise--parameters +type ListSCIMProvisionedGroupsForEnterpriseOptions struct { + // Filter specifies the matching results to return. + // Multiple filters are not supported. Possible filters are externalId, id, and displayName. + // For example: ?filter=externalId eq "9138790-10932-109120392-12321". + // (Optional.) + Filter *string `url:"filter,omitempty"` + // ExcludedAttributes excludes the specified attribute from being returned in the results. + // Using this parameter can speed up response time. (Optional.) + ExcludedAttributes *string `url:"excludedAttributes,omitempty"` + // StartIndex used for pagination: the starting index of the first result to return when paginating through values. (Optional.) + // Default: 1. + StartIndex *int `url:"startIndex,omitempty"` + // Count used for pagination: the number of results to return per page. (Optional.) + // Default: 30. + Count *int `url:"count,omitempty"` +} + // ListSCIMProvisionedIdentities lists SCIM provisioned identities. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#list-scim-provisioned-identities @@ -252,8 +272,12 @@ func (s *SCIMService) DeleteSCIMUserFromOrg(ctx context.Context, org, scimUserID // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#list-provisioned-scim-groups-for-an-enterprise // //meta:operation GET /scim/v2/enterprises/{enterprise}/Groups -func (s *SCIMService) ListSCIMProvisionedGroupsForEnterprise(ctx context.Context, enterprise string, _ *ListSCIMProvisionedIdentitiesOptions) (*SCIMProvisionedGroups, *Response, error) { +func (s *SCIMService) ListSCIMProvisionedGroupsForEnterprise(ctx context.Context, enterprise string, opts *ListSCIMProvisionedGroupsForEnterpriseOptions) (*SCIMProvisionedGroups, *Response, error) { u := fmt.Sprintf("scim/v2/enterprises/%v/Groups", enterprise) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } req, err := s.client.NewRequest("GET", u, nil) if err != nil { diff --git a/github/scim_test.go b/github/scim_test.go index 42a6f2331ed..5507e6807fe 100644 --- a/github/scim_test.go +++ b/github/scim_test.go @@ -127,6 +127,12 @@ func TestSCIMService_ListSCIMProvisionedGroups(t *testing.T) { mux.HandleFunc("/scim/v2/enterprises/o/Groups", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") + testFormValues(t, r, values{ + "startIndex": "1", + "excludedAttributes": "members,meta", + "count": "3", + "filter": `externalId eq "00u1dhhb1fkIGP7RL1d8"`, + }) w.WriteHeader(http.StatusOK) _, _ = w.Write([]byte(`{ "schemas": [ @@ -162,7 +168,12 @@ func TestSCIMService_ListSCIMProvisionedGroups(t *testing.T) { }) ctx := context.Background() - opts := &ListSCIMProvisionedIdentitiesOptions{} + opts := &ListSCIMProvisionedGroupsForEnterpriseOptions{ + StartIndex: Ptr(1), + ExcludedAttributes: Ptr("members,meta"), + Count: Ptr(3), + Filter: Ptr(`externalId eq "00u1dhhb1fkIGP7RL1d8"`), + } groups, _, err := client.SCIM.ListSCIMProvisionedGroupsForEnterprise(ctx, "o", opts) if err != nil { t.Errorf("SCIM.ListSCIMProvisionedIdentities returned error: %v", err) From 5862e2450f3c3b8d16b6c5740b81a8080fe15ca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20B=C3=A9langer?= <33942239+leo-belanger@users.noreply.github.com> Date: Thu, 26 Jun 2025 21:27:30 -0400 Subject: [PATCH 740/751] feat: Add organization migration options (#3606) --- github/migrations.go | 18 ++++++++++++++++++ github/migrations_test.go | 2 ++ 2 files changed, 20 insertions(+) diff --git a/github/migrations.go b/github/migrations.go index 2bc7af8da00..b33be5edd29 100644 --- a/github/migrations.go +++ b/github/migrations.go @@ -55,6 +55,14 @@ type MigrationOptions struct { // ExcludeAttachments indicates whether attachments should be excluded from // the migration (to reduce migration archive file size). ExcludeAttachments bool + + // ExcludeReleases indicates whether releases should be excluded from + // the migration (to reduce migration archive file size). + ExcludeReleases bool + + // Exclude is a slice of related items to exclude from the response in order + // to improve performance of the request. Supported values are: "repositories" + Exclude []string } // startMigration represents the body of a StartMigration request. @@ -69,6 +77,14 @@ type startMigration struct { // ExcludeAttachments indicates whether attachments should be excluded from // the migration (to reduce migration archive file size). ExcludeAttachments *bool `json:"exclude_attachments,omitempty"` + + // ExcludeReleases indicates whether releases should be excluded from + // the migration (to reduce migration archive file size). + ExcludeReleases *bool `json:"exclude_releases,omitempty"` + + // Exclude is a slice of related items to exclude from the response in order + // to improve performance of the request. Supported values are: "repositories" + Exclude []string `json:"exclude,omitempty"` } // StartMigration starts the generation of a migration archive. @@ -84,6 +100,8 @@ func (s *MigrationService) StartMigration(ctx context.Context, org string, repos if opts != nil { body.LockRepositories = Ptr(opts.LockRepositories) body.ExcludeAttachments = Ptr(opts.ExcludeAttachments) + body.ExcludeReleases = Ptr(opts.ExcludeReleases) + body.Exclude = append(body.Exclude, opts.Exclude...) } req, err := s.client.NewRequest("POST", u, body) diff --git a/github/migrations_test.go b/github/migrations_test.go index 99604f62d7c..ec187255fd7 100644 --- a/github/migrations_test.go +++ b/github/migrations_test.go @@ -30,6 +30,8 @@ func TestMigrationService_StartMigration(t *testing.T) { opt := &MigrationOptions{ LockRepositories: true, ExcludeAttachments: false, + ExcludeReleases: true, + Exclude: []string{"repositories"}, } ctx := context.Background() got, _, err := client.Migrations.StartMigration(ctx, "o", []string{"r"}, opt) From a2e5acc1251fc429f04fd884c1ef7635304f78f4 Mon Sep 17 00:00:00 2001 From: Guillaume Winter <8502556+DocEmmetBrown@users.noreply.github.com> Date: Fri, 27 Jun 2025 13:29:35 +0200 Subject: [PATCH 741/751] feat: Add new enhanced billing endpoints (#3605) --- github/billing.go | 96 +++++++++++++++++++ github/billing_test.go | 164 ++++++++++++++++++++++++++++++++ github/github-accessors.go | 120 +++++++++++++++++++++++ github/github-accessors_test.go | 153 +++++++++++++++++++++++++++++ 4 files changed, 533 insertions(+) diff --git a/github/billing.go b/github/billing.go index 09b1a5d017a..2ce595d3349 100644 --- a/github/billing.go +++ b/github/billing.go @@ -63,6 +63,46 @@ type AdvancedSecurityCommittersBreakdown struct { LastPushedDate *string `json:"last_pushed_date,omitempty"` } +// UsageReportOptions specifies optional parameters for the enhanced billing platform usage report. +type UsageReportOptions struct { + // If specified, only return results for a single year. The value of year is an integer with four digits representing a year. For example, 2025. + // Default value is the current year. + Year *int `url:"year,omitempty"` + + // If specified, only return results for a single month. The value of month is an integer between 1 and 12. + // If no year is specified the default year is used. + Month *int `url:"month,omitempty"` + + // If specified, only return results for a single day. The value of day is an integer between 1 and 31. + // If no year or month is specified, the default year and month are used. + Day *int `url:"day,omitempty"` + + // If specified, only return results for a single hour. The value of hour is an integer between 0 and 23. + // If no year, month, or day is specified, the default year, month, and day are used. + Hour *int `url:"hour,omitempty"` +} + +// UsageItem represents a single usage item in the enhanced billing platform report. +type UsageItem struct { + Date *string `json:"date"` + Product *string `json:"product"` + SKU *string `json:"sku"` + Quantity *int `json:"quantity"` + UnitType *string `json:"unitType"` + PricePerUnit *float64 `json:"pricePerUnit"` + GrossAmount *float64 `json:"grossAmount"` + DiscountAmount *float64 `json:"discountAmount"` + NetAmount *float64 `json:"netAmount"` + RepositoryName *string `json:"repositoryName,omitempty"` + // Organization name is only used for organization-level reports. + OrganizationName *string `json:"organizationName,omitempty"` +} + +// UsageReport represents the enhanced billing platform usage report response. +type UsageReport struct { + UsageItems []*UsageItem `json:"usageItems,omitempty"` +} + // GetActionsBillingOrg returns the summary of the free and paid GitHub Actions minutes used for an Org. // // GitHub API docs: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-an-organization @@ -216,3 +256,59 @@ func (s *BillingService) GetStorageBillingUser(ctx context.Context, user string) return storageUserBilling, resp, nil } + +// GetUsageReportOrg returns a report of the total usage for an organization using the enhanced billing platform. +// +// Note: This endpoint is only available to organizations with access to the enhanced billing platform. +// +// GitHub API docs: https://docs.github.com/rest/billing/enhanced-billing#get-billing-usage-report-for-an-organization +// +//meta:operation GET /organizations/{org}/settings/billing/usage +func (s *BillingService) GetUsageReportOrg(ctx context.Context, org string, opts *UsageReportOptions) (*UsageReport, *Response, error) { + u := fmt.Sprintf("organizations/%v/settings/billing/usage", org) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + usageReport := new(UsageReport) + resp, err := s.client.Do(ctx, req, usageReport) + if err != nil { + return nil, resp, err + } + + return usageReport, resp, nil +} + +// GetUsageReportUser returns a report of the total usage for a user using the enhanced billing platform. +// +// Note: This endpoint is only available to users with access to the enhanced billing platform. +// +// GitHub API docs: https://docs.github.com/rest/billing/enhanced-billing#get-billing-usage-report-for-a-user +// +//meta:operation GET /users/{username}/settings/billing/usage +func (s *BillingService) GetUsageReportUser(ctx context.Context, user string, opts *UsageReportOptions) (*UsageReport, *Response, error) { + u := fmt.Sprintf("users/%v/settings/billing/usage", user) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + usageReport := new(UsageReport) + resp, err := s.client.Do(ctx, req, usageReport) + if err != nil { + return nil, resp, err + } + + return usageReport, resp, nil +} diff --git a/github/billing_test.go b/github/billing_test.go index 8fb6499c186..3e9c9e7fc42 100644 --- a/github/billing_test.go +++ b/github/billing_test.go @@ -510,3 +510,167 @@ func TestBillingService_GetAdvancedSecurityActiveCommittersOrg_invalidOrg(t *tes _, _, err := client.Billing.GetAdvancedSecurityActiveCommittersOrg(ctx, "%", nil) testURLParseError(t, err) } + +func TestBillingService_GetUsageReportOrg(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/organizations/o/settings/billing/usage", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{ + "year": "2023", + "month": "8", + }) + fmt.Fprint(w, `{ + "usageItems": [ + { + "date": "2023-08-01", + "product": "Actions", + "sku": "Actions Linux", + "quantity": 100, + "unitType": "minutes", + "pricePerUnit": 0.008, + "grossAmount": 0.8, + "discountAmount": 0, + "netAmount": 0.8, + "organizationName": "GitHub", + "repositoryName": "github/example" + } + ] + }`) + }) + + ctx := context.Background() + opts := &UsageReportOptions{ + Year: Ptr(2023), + Month: Ptr(8), + } + report, _, err := client.Billing.GetUsageReportOrg(ctx, "o", opts) + if err != nil { + t.Errorf("Billing.GetUsageReportOrg returned error: %v", err) + } + + want := &UsageReport{ + UsageItems: []*UsageItem{ + { + Date: Ptr("2023-08-01"), + Product: Ptr("Actions"), + SKU: Ptr("Actions Linux"), + Quantity: Ptr(100), + UnitType: Ptr("minutes"), + PricePerUnit: Ptr(0.008), + GrossAmount: Ptr(0.8), + DiscountAmount: Ptr(0.0), + NetAmount: Ptr(0.8), + OrganizationName: Ptr("GitHub"), + RepositoryName: Ptr("github/example"), + }, + }, + } + if !cmp.Equal(report, want) { + t.Errorf("Billing.GetUsageReportOrg returned %+v, want %+v", report, want) + } + + const methodName = "GetUsageReportOrg" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Billing.GetUsageReportOrg(ctx, "\n", opts) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Billing.GetUsageReportOrg(ctx, "o", nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestBillingService_GetUsageReportOrg_invalidOrg(t *testing.T) { + t.Parallel() + client, _, _ := setup(t) + + ctx := context.Background() + _, _, err := client.Billing.GetUsageReportOrg(ctx, "%", nil) + testURLParseError(t, err) +} + +func TestBillingService_GetUsageReportUser(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/users/u/settings/billing/usage", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{ + "day": "15", + }) + fmt.Fprint(w, `{ + "usageItems": [ + { + "date": "2023-08-15", + "product": "Codespaces", + "sku": "Codespaces Linux", + "quantity": 50, + "unitType": "hours", + "pricePerUnit": 0.18, + "grossAmount": 9.0, + "discountAmount": 1.0, + "netAmount": 8.0, + "repositoryName": "user/example" + } + ] + }`) + }) + + ctx := context.Background() + opts := &UsageReportOptions{ + Day: Ptr(15), + } + report, _, err := client.Billing.GetUsageReportUser(ctx, "u", opts) + if err != nil { + t.Errorf("Billing.GetUsageReportUser returned error: %v", err) + } + + want := &UsageReport{ + UsageItems: []*UsageItem{ + { + Date: Ptr("2023-08-15"), + Product: Ptr("Codespaces"), + SKU: Ptr("Codespaces Linux"), + Quantity: Ptr(50), + UnitType: Ptr("hours"), + PricePerUnit: Ptr(0.18), + GrossAmount: Ptr(9.0), + DiscountAmount: Ptr(1.0), + NetAmount: Ptr(8.0), + RepositoryName: Ptr("user/example"), + }, + }, + } + if !cmp.Equal(report, want) { + t.Errorf("Billing.GetUsageReportUser returned %+v, want %+v", report, want) + } + + const methodName = "GetUsageReportUser" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Billing.GetUsageReportUser(ctx, "\n", opts) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Billing.GetUsageReportUser(ctx, "u", nil) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestBillingService_GetUsageReportUser_invalidUser(t *testing.T) { + t.Parallel() + client, _, _ := setup(t) + + ctx := context.Background() + _, _, err := client.Billing.GetUsageReportUser(ctx, "%", nil) + testURLParseError(t, err) +} diff --git a/github/github-accessors.go b/github/github-accessors.go index 135726bca85..2b832617c85 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -27574,6 +27574,126 @@ func (u *UpdateRunnerGroupRequest) GetVisibility() string { return *u.Visibility } +// GetDate returns the Date field if it's non-nil, zero value otherwise. +func (u *UsageItem) GetDate() string { + if u == nil || u.Date == nil { + return "" + } + return *u.Date +} + +// GetDiscountAmount returns the DiscountAmount field. +func (u *UsageItem) GetDiscountAmount() *float64 { + if u == nil { + return nil + } + return u.DiscountAmount +} + +// GetGrossAmount returns the GrossAmount field. +func (u *UsageItem) GetGrossAmount() *float64 { + if u == nil { + return nil + } + return u.GrossAmount +} + +// GetNetAmount returns the NetAmount field. +func (u *UsageItem) GetNetAmount() *float64 { + if u == nil { + return nil + } + return u.NetAmount +} + +// GetOrganizationName returns the OrganizationName field if it's non-nil, zero value otherwise. +func (u *UsageItem) GetOrganizationName() string { + if u == nil || u.OrganizationName == nil { + return "" + } + return *u.OrganizationName +} + +// GetPricePerUnit returns the PricePerUnit field. +func (u *UsageItem) GetPricePerUnit() *float64 { + if u == nil { + return nil + } + return u.PricePerUnit +} + +// GetProduct returns the Product field if it's non-nil, zero value otherwise. +func (u *UsageItem) GetProduct() string { + if u == nil || u.Product == nil { + return "" + } + return *u.Product +} + +// GetQuantity returns the Quantity field if it's non-nil, zero value otherwise. +func (u *UsageItem) GetQuantity() int { + if u == nil || u.Quantity == nil { + return 0 + } + return *u.Quantity +} + +// GetRepositoryName returns the RepositoryName field if it's non-nil, zero value otherwise. +func (u *UsageItem) GetRepositoryName() string { + if u == nil || u.RepositoryName == nil { + return "" + } + return *u.RepositoryName +} + +// GetSKU returns the SKU field if it's non-nil, zero value otherwise. +func (u *UsageItem) GetSKU() string { + if u == nil || u.SKU == nil { + return "" + } + return *u.SKU +} + +// GetUnitType returns the UnitType field if it's non-nil, zero value otherwise. +func (u *UsageItem) GetUnitType() string { + if u == nil || u.UnitType == nil { + return "" + } + return *u.UnitType +} + +// GetDay returns the Day field if it's non-nil, zero value otherwise. +func (u *UsageReportOptions) GetDay() int { + if u == nil || u.Day == nil { + return 0 + } + return *u.Day +} + +// GetHour returns the Hour field if it's non-nil, zero value otherwise. +func (u *UsageReportOptions) GetHour() int { + if u == nil || u.Hour == nil { + return 0 + } + return *u.Hour +} + +// GetMonth returns the Month field if it's non-nil, zero value otherwise. +func (u *UsageReportOptions) GetMonth() int { + if u == nil || u.Month == nil { + return 0 + } + return *u.Month +} + +// GetYear returns the Year field if it's non-nil, zero value otherwise. +func (u *UsageReportOptions) GetYear() int { + if u == nil || u.Year == nil { + return 0 + } + return *u.Year +} + // GetAssignment returns the Assignment field if it's non-nil, zero value otherwise. func (u *User) GetAssignment() string { if u == nil || u.Assignment == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index ca2f10ffb92..c0b94a55148 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -35456,6 +35456,159 @@ func TestUpdateRunnerGroupRequest_GetVisibility(tt *testing.T) { u.GetVisibility() } +func TestUsageItem_GetDate(tt *testing.T) { + tt.Parallel() + var zeroValue string + u := &UsageItem{Date: &zeroValue} + u.GetDate() + u = &UsageItem{} + u.GetDate() + u = nil + u.GetDate() +} + +func TestUsageItem_GetDiscountAmount(tt *testing.T) { + tt.Parallel() + u := &UsageItem{} + u.GetDiscountAmount() + u = nil + u.GetDiscountAmount() +} + +func TestUsageItem_GetGrossAmount(tt *testing.T) { + tt.Parallel() + u := &UsageItem{} + u.GetGrossAmount() + u = nil + u.GetGrossAmount() +} + +func TestUsageItem_GetNetAmount(tt *testing.T) { + tt.Parallel() + u := &UsageItem{} + u.GetNetAmount() + u = nil + u.GetNetAmount() +} + +func TestUsageItem_GetOrganizationName(tt *testing.T) { + tt.Parallel() + var zeroValue string + u := &UsageItem{OrganizationName: &zeroValue} + u.GetOrganizationName() + u = &UsageItem{} + u.GetOrganizationName() + u = nil + u.GetOrganizationName() +} + +func TestUsageItem_GetPricePerUnit(tt *testing.T) { + tt.Parallel() + u := &UsageItem{} + u.GetPricePerUnit() + u = nil + u.GetPricePerUnit() +} + +func TestUsageItem_GetProduct(tt *testing.T) { + tt.Parallel() + var zeroValue string + u := &UsageItem{Product: &zeroValue} + u.GetProduct() + u = &UsageItem{} + u.GetProduct() + u = nil + u.GetProduct() +} + +func TestUsageItem_GetQuantity(tt *testing.T) { + tt.Parallel() + var zeroValue int + u := &UsageItem{Quantity: &zeroValue} + u.GetQuantity() + u = &UsageItem{} + u.GetQuantity() + u = nil + u.GetQuantity() +} + +func TestUsageItem_GetRepositoryName(tt *testing.T) { + tt.Parallel() + var zeroValue string + u := &UsageItem{RepositoryName: &zeroValue} + u.GetRepositoryName() + u = &UsageItem{} + u.GetRepositoryName() + u = nil + u.GetRepositoryName() +} + +func TestUsageItem_GetSKU(tt *testing.T) { + tt.Parallel() + var zeroValue string + u := &UsageItem{SKU: &zeroValue} + u.GetSKU() + u = &UsageItem{} + u.GetSKU() + u = nil + u.GetSKU() +} + +func TestUsageItem_GetUnitType(tt *testing.T) { + tt.Parallel() + var zeroValue string + u := &UsageItem{UnitType: &zeroValue} + u.GetUnitType() + u = &UsageItem{} + u.GetUnitType() + u = nil + u.GetUnitType() +} + +func TestUsageReportOptions_GetDay(tt *testing.T) { + tt.Parallel() + var zeroValue int + u := &UsageReportOptions{Day: &zeroValue} + u.GetDay() + u = &UsageReportOptions{} + u.GetDay() + u = nil + u.GetDay() +} + +func TestUsageReportOptions_GetHour(tt *testing.T) { + tt.Parallel() + var zeroValue int + u := &UsageReportOptions{Hour: &zeroValue} + u.GetHour() + u = &UsageReportOptions{} + u.GetHour() + u = nil + u.GetHour() +} + +func TestUsageReportOptions_GetMonth(tt *testing.T) { + tt.Parallel() + var zeroValue int + u := &UsageReportOptions{Month: &zeroValue} + u.GetMonth() + u = &UsageReportOptions{} + u.GetMonth() + u = nil + u.GetMonth() +} + +func TestUsageReportOptions_GetYear(tt *testing.T) { + tt.Parallel() + var zeroValue int + u := &UsageReportOptions{Year: &zeroValue} + u.GetYear() + u = &UsageReportOptions{} + u.GetYear() + u = nil + u.GetYear() +} + func TestUser_GetAssignment(tt *testing.T) { tt.Parallel() var zeroValue string From 2e2654608cd71dc07e27ee846991dd57d834c8a9 Mon Sep 17 00:00:00 2001 From: Bart Venter <72999113+bartventer@users.noreply.github.com> Date: Fri, 27 Jun 2025 14:57:43 +0200 Subject: [PATCH 742/751] docs: Update HTTP cache references to RFC 9111 compliant implementation (#3608) --- README.md | 11 +++++++---- github/doc.go | 2 +- github/github.go | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 82e69a9e33c..aa269eb5f20 100644 --- a/README.md +++ b/README.md @@ -263,15 +263,18 @@ rate limit, as well as help speed up your application. `go-github` does not handle conditional requests directly, but is instead designed to work with a caching `http.Transport`. -Typically, an [RFC 7234](https://datatracker.ietf.org/doc/html/rfc7234) -compliant HTTP cache such as [gregjones/httpcache](https://github.com/gregjones/httpcache) +Typically, an [RFC 9111](https://datatracker.ietf.org/doc/html/rfc9111) +compliant HTTP cache such as [bartventer/httpcache](https://github.com/bartventer/httpcache) is recommended, ex: ```go -import "github.com/gregjones/httpcache" +import ( + "github.com/bartventer/httpcache" + _ "github.com/bartventer/httpcache/store/memcache" // Register the in-memory backend +) client := github.NewClient( - httpcache.NewMemoryCacheTransport().Client() + httpcache.NewClient("memcache://"), ).WithAuthToken(os.Getenv("GITHUB_TOKEN")) ``` diff --git a/github/doc.go b/github/doc.go index f85faed839a..844008d57a6 100644 --- a/github/doc.go +++ b/github/doc.go @@ -144,7 +144,7 @@ rate limit, as well as help speed up your application. go-github does not handle conditional requests directly, but is instead designed to work with a caching [http.Transport]. -Typically, an RFC 7234 compliant HTTP cache such as https://github.com/gregjones/httpcache +Typically, an RFC 9111 compliant HTTP cache such as https://github.com/bartventer/httpcache is recommended. Alternatively, the https://github.com/bored-engineer/github-conditional-http-transport package relies on (undocumented) GitHub specific cache logic and is recommended when making requests using short-lived credentials such as a diff --git a/github/github.go b/github/github.go index 89c6ea4ef73..0e2a9950c29 100644 --- a/github/github.go +++ b/github/github.go @@ -895,7 +895,7 @@ func (c *Client) bareDo(ctx context.Context, caller *http.Client, req *http.Requ } // Don't update the rate limits if this was a cached response. - // X-From-Cache is set by https://github.com/gregjones/httpcache + // X-From-Cache is set by https://github.com/bartventer/httpcache if response.Header.Get("X-From-Cache") == "" { c.rateMu.Lock() c.rateLimits[rateLimitCategory] = response.Rate From 0c6bd9186d03bf5e42a6b6b57ac9e3d68c6426df Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Fri, 27 Jun 2025 18:57:22 +0300 Subject: [PATCH 743/751] fix: Remove custom Accept in Apps.ListRepos and Apps.ListUserRepos (#3609) --- github/apps_installation.go | 17 ----------------- github/apps_installation_test.go | 13 ------------- 2 files changed, 30 deletions(-) diff --git a/github/apps_installation.go b/github/apps_installation.go index d430511d074..57d6b4e76ed 100644 --- a/github/apps_installation.go +++ b/github/apps_installation.go @@ -8,7 +8,6 @@ package github import ( "context" "fmt" - "strings" ) // ListRepositories represents the response from the list repos endpoints. @@ -33,14 +32,6 @@ func (s *AppsService) ListRepos(ctx context.Context, opts *ListOptions) (*ListRe return nil, nil, err } - // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{ - mediaTypeTopicsPreview, - mediaTypeRepositoryVisibilityPreview, - mediaTypeRepositoryTemplatePreview, - } - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) - var r *ListRepositories resp, err := s.client.Do(ctx, req, &r) @@ -69,14 +60,6 @@ func (s *AppsService) ListUserRepos(ctx context.Context, id int64, opts *ListOpt return nil, nil, err } - // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{ - mediaTypeTopicsPreview, - mediaTypeRepositoryVisibilityPreview, - mediaTypeRepositoryTemplatePreview, - } - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) - var r *ListRepositories resp, err := s.client.Do(ctx, req, &r) if err != nil { diff --git a/github/apps_installation_test.go b/github/apps_installation_test.go index 48521504f7a..986281e4c85 100644 --- a/github/apps_installation_test.go +++ b/github/apps_installation_test.go @@ -9,7 +9,6 @@ import ( "context" "fmt" "net/http" - "strings" "testing" "github.com/google/go-cmp/cmp" @@ -19,14 +18,8 @@ func TestAppsService_ListRepos(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - wantAcceptHeaders := []string{ - mediaTypeTopicsPreview, - mediaTypeRepositoryVisibilityPreview, - mediaTypeRepositoryTemplatePreview, - } mux.HandleFunc("/installation/repositories", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) testFormValues(t, r, values{ "page": "1", "per_page": "2", @@ -60,14 +53,8 @@ func TestAppsService_ListUserRepos(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - wantAcceptHeaders := []string{ - mediaTypeTopicsPreview, - mediaTypeRepositoryVisibilityPreview, - mediaTypeRepositoryTemplatePreview, - } mux.HandleFunc("/user/installations/1/repositories", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) testFormValues(t, r, values{ "page": "1", "per_page": "2", From 2d29661f94e742773de59c81dd02c3646ce1aa75 Mon Sep 17 00:00:00 2001 From: Guillaume Winter <8502556+DocEmmetBrown@users.noreply.github.com> Date: Mon, 30 Jun 2025 13:40:20 +0200 Subject: [PATCH 744/751] fix: Change `UsageItem.Quantity` from `int` to `float64` (#3610) --- github/billing.go | 2 +- github/billing_test.go | 4 ++-- github/github-accessors.go | 10 +++++----- github/github-accessors_test.go | 5 +---- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/github/billing.go b/github/billing.go index 2ce595d3349..0776358cdb2 100644 --- a/github/billing.go +++ b/github/billing.go @@ -87,7 +87,7 @@ type UsageItem struct { Date *string `json:"date"` Product *string `json:"product"` SKU *string `json:"sku"` - Quantity *int `json:"quantity"` + Quantity *float64 `json:"quantity"` UnitType *string `json:"unitType"` PricePerUnit *float64 `json:"pricePerUnit"` GrossAmount *float64 `json:"grossAmount"` diff --git a/github/billing_test.go b/github/billing_test.go index 3e9c9e7fc42..3c29054840b 100644 --- a/github/billing_test.go +++ b/github/billing_test.go @@ -556,7 +556,7 @@ func TestBillingService_GetUsageReportOrg(t *testing.T) { Date: Ptr("2023-08-01"), Product: Ptr("Actions"), SKU: Ptr("Actions Linux"), - Quantity: Ptr(100), + Quantity: Ptr(100.0), UnitType: Ptr("minutes"), PricePerUnit: Ptr(0.008), GrossAmount: Ptr(0.8), @@ -637,7 +637,7 @@ func TestBillingService_GetUsageReportUser(t *testing.T) { Date: Ptr("2023-08-15"), Product: Ptr("Codespaces"), SKU: Ptr("Codespaces Linux"), - Quantity: Ptr(50), + Quantity: Ptr(50.0), UnitType: Ptr("hours"), PricePerUnit: Ptr(0.18), GrossAmount: Ptr(9.0), diff --git a/github/github-accessors.go b/github/github-accessors.go index 2b832617c85..57e2d07dfc8 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -27630,12 +27630,12 @@ func (u *UsageItem) GetProduct() string { return *u.Product } -// GetQuantity returns the Quantity field if it's non-nil, zero value otherwise. -func (u *UsageItem) GetQuantity() int { - if u == nil || u.Quantity == nil { - return 0 +// GetQuantity returns the Quantity field. +func (u *UsageItem) GetQuantity() *float64 { + if u == nil { + return nil } - return *u.Quantity + return u.Quantity } // GetRepositoryName returns the RepositoryName field if it's non-nil, zero value otherwise. diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index c0b94a55148..1e66350a1d7 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -35523,10 +35523,7 @@ func TestUsageItem_GetProduct(tt *testing.T) { func TestUsageItem_GetQuantity(tt *testing.T) { tt.Parallel() - var zeroValue int - u := &UsageItem{Quantity: &zeroValue} - u.GetQuantity() - u = &UsageItem{} + u := &UsageItem{} u.GetQuantity() u = nil u.GetQuantity() From efe572e611555104da0b13fb8b89165245afb0da Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Mon, 30 Jun 2025 14:44:35 +0300 Subject: [PATCH 745/751] fix: Fix broken URL for `SubIssueService.Remove` endpoint (#3613) --- github/sub_issue.go | 4 ++-- github/sub_issue_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/github/sub_issue.go b/github/sub_issue.go index 8b24adb899b..2effcc5afb0 100644 --- a/github/sub_issue.go +++ b/github/sub_issue.go @@ -49,8 +49,8 @@ type SubIssueRequest struct { // GitHub API docs: https://docs.github.com/rest/issues/sub-issues#remove-sub-issue // //meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue -func (s *SubIssueService) Remove(ctx context.Context, owner, repo string, subIssueNumber int64, subIssue SubIssueRequest) (*SubIssue, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/issues/%v/sub_issues", owner, repo, subIssueNumber) +func (s *SubIssueService) Remove(ctx context.Context, owner, repo string, issueNumber int64, subIssue SubIssueRequest) (*SubIssue, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/issues/%v/sub_issue", owner, repo, issueNumber) req, err := s.client.NewRequest("DELETE", u, subIssue) if err != nil { diff --git a/github/sub_issue_test.go b/github/sub_issue_test.go index 9a88b2441d0..72e331c31f7 100644 --- a/github/sub_issue_test.go +++ b/github/sub_issue_test.go @@ -97,7 +97,7 @@ func TestSubIssuesService_Remove(t *testing.T) { input := &SubIssueRequest{SubIssueID: 42} - mux.HandleFunc("/repos/o/r/issues/1/sub_issues", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/repos/o/r/issues/1/sub_issue", func(w http.ResponseWriter, r *http.Request) { v := new(SubIssueRequest) assertNilError(t, json.NewDecoder(r.Body).Decode(v)) From d96da2ee947b989823cedffea6ddc582e5b0decb Mon Sep 17 00:00:00 2001 From: Steve Hipwell Date: Mon, 30 Jun 2025 16:57:19 +0100 Subject: [PATCH 746/751] feat: Add DisableRateLimitCheck option to client (#3607) --- README.md | 73 +++++++++++++++++++++++++---------------- github/github.go | 49 +++++++++++++++++----------- github/github_test.go | 76 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 151 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index aa269eb5f20..f45d3730399 100644 --- a/README.md +++ b/README.md @@ -189,54 +189,71 @@ using the installation ID of the GitHub app and authenticate with the OAuth meth ### Rate Limiting ### -GitHub imposes a rate limit on all API clients. Unauthenticated clients are -limited to 60 requests per hour, while authenticated clients can make up to -5,000 requests per hour. The Search API has a custom rate limit. Unauthenticated -clients are limited to 10 requests per minute, while authenticated clients -can make up to 30 requests per minute. To receive the higher rate limit when -making calls that are not issued on behalf of a user, -use `UnauthenticatedRateLimitedTransport`. - -The returned `Response.Rate` value contains the rate limit information +GitHub imposes rate limits on all API clients. The [primary rate limit](https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-primary-rate-limits) +is the limit to the number of REST API requests that a client can make within a +specific amount of time. This limit helps prevent abuse and denial-of-service +attacks, and ensures that the API remains available for all users. Some +endpoints, like the search endpoints, have more restrictive limits. +Unauthenticated clients may request public data but have a low rate limit, +while authenticated clients have rate limits based on the client +identity. + +In addition to primary rate limits, GitHub enforces [secondary rate limits](https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits) +in order to prevent abuse and keep the API available for all users. +Secondary rate limits generally limit the number of concurrent requests that a +client can make. + +The client returned `Response.Rate` value contains the rate limit information from the most recent API call. If a recent enough response isn't -available, you can use `RateLimits` to fetch the most up-to-date rate -limit data for the client. +available, you can use the client `RateLimits` service to fetch the most +up-to-date rate limit data for the client. -To detect an API rate limit error, you can check if its type is `*github.RateLimitError`: +To detect a primary API rate limit error, you can check if the error is a +`RateLimitError`. ```go repos, _, err := client.Repositories.List(ctx, "", nil) -if _, ok := err.(*github.RateLimitError); ok { - log.Println("hit rate limit") +var rateErr *github.RateLimitError +if errors.As(err, &rateError) { + log.Printf("hit primary rate limit, used %d of %d\n", rateErr.Rate.Used, rateErr.rate.Limit) } ``` -Learn more about GitHub rate limiting in -["REST API endpoints for rate limits"](https://docs.github.com/en/rest/rate-limit). - -In addition to these rate limits, GitHub imposes a secondary rate limit on all API clients. -This rate limit prevents clients from making too many concurrent requests. - -To detect an API secondary rate limit error, you can check if its type is `*github.AbuseRateLimitError`: +To detect an API secondary rate limit error, you can check if the error is an +`AbuseRateLimitError`. ```go repos, _, err := client.Repositories.List(ctx, "", nil) -if _, ok := err.(*github.AbuseRateLimitError); ok { - log.Println("hit secondary rate limit") +var rateErr *github.AbuseRateLimitError +if errors.As(err, &rateErr) { + log.Printf("hit secondary rate limit, retry after %v\n", rateErr.RetryAfter) } ``` -Alternatively, you can block until the rate limit is reset by using the `context.WithValue` method: +If you hit the primary rate limit, you can use the `SleepUntilPrimaryRateLimitResetWhenRateLimited` +method to block until the rate limit is reset. ```go repos, _, err := client.Repositories.List(context.WithValue(ctx, github.SleepUntilPrimaryRateLimitResetWhenRateLimited, true), "", nil) ``` -You can use [gofri/go-github-ratelimit](https://github.com/gofri/go-github-ratelimit) to handle -secondary rate limit sleep-and-retry for you, as well as primary rate limit abuse-prevention and callback triggering. +If you need to make a request even if the rate limit has been hit you can use +the `BypassRateLimitCheck` method to bypass the rate limit check and make the +request anyway. + +```go +repos, _, err := client.Repositories.List(context.WithValue(ctx, github.BypassRateLimitCheck, true), "", nil) +``` + +For more advanced use cases, you can use [gofri/go-github-ratelimit](https://github.com/gofri/go-github-ratelimit) +which provides a middleware (`http.RoundTripper`) that handles both the primary +rate limit and secondary rate limit for the GitHub API. In this case you can +set the client `DisableRateLimitCheck` to `true` so the client doesn't track the rate limit usage. -Learn more about GitHub secondary rate limiting in -["About secondary rate limits"](https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#about-secondary-rate-limits). +If the client is an [OAuth app](https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api#primary-rate-limit-for-oauth-apps) +you can use the apps higher rate limit to request public data by using the +`UnauthenticatedRateLimitedTransport` to make calls as the app instead of as +the user. ### Accepted Status ### diff --git a/github/github.go b/github/github.go index 0e2a9950c29..481752c5cb9 100644 --- a/github/github.go +++ b/github/github.go @@ -171,6 +171,11 @@ type Client struct { // User agent used when communicating with the GitHub API. UserAgent string + // DisableRateLimitCheck stops the client checking for rate limits or tracking + // them. This is different to setting BypassRateLimitCheck in the context, + // as that still tracks the rate limits. + DisableRateLimitCheck bool + rateMu sync.Mutex rateLimits [Categories]Rate // Rate limits for the client as determined by the most recent API calls. secondaryRateLimitReset time.Time // Secondary rate limit reset for the client as determined by the most recent API calls. @@ -850,21 +855,26 @@ func (c *Client) bareDo(ctx context.Context, caller *http.Client, req *http.Requ req = withContext(ctx, req) - rateLimitCategory := GetRateLimitCategory(req.Method, req.URL.Path) + rateLimitCategory := CoreCategory - if bypass := ctx.Value(BypassRateLimitCheck); bypass == nil { - // If we've hit rate limit, don't make further requests before Reset time. - if err := c.checkRateLimitBeforeDo(req, rateLimitCategory); err != nil { - return &Response{ - Response: err.Response, - Rate: err.Rate, - }, err - } - // If we've hit a secondary rate limit, don't make further requests before Retry After. - if err := c.checkSecondaryRateLimitBeforeDo(req); err != nil { - return &Response{ - Response: err.Response, - }, err + if !c.DisableRateLimitCheck { + rateLimitCategory = GetRateLimitCategory(req.Method, req.URL.Path) + + if bypass := ctx.Value(BypassRateLimitCheck); bypass == nil { + // If we've hit rate limit, don't make further requests before Reset time. + if err := c.checkRateLimitBeforeDo(req, rateLimitCategory); err != nil { + return &Response{ + Response: err.Response, + Rate: err.Rate, + }, err + } + + // If we've hit a secondary rate limit, don't make further requests before Retry After. + if err := c.checkSecondaryRateLimitBeforeDo(req); err != nil { + return &Response{ + Response: err.Response, + }, err + } } } @@ -894,9 +904,10 @@ func (c *Client) bareDo(ctx context.Context, caller *http.Client, req *http.Requ return response, err } - // Don't update the rate limits if this was a cached response. - // X-From-Cache is set by https://github.com/bartventer/httpcache - if response.Header.Get("X-From-Cache") == "" { + // Don't update the rate limits if the client has rate limits disabled or if + // this was a cached response. The X-From-Cache is set by + // https://github.com/bartventer/httpcache if it's enabled. + if !c.DisableRateLimitCheck && response.Header.Get("X-From-Cache") == "" { c.rateMu.Lock() c.rateLimits[rateLimitCategory] = response.Rate c.rateMu.Unlock() @@ -1586,8 +1597,8 @@ that need to use a higher rate limit associated with your OAuth application. This will add the client id and secret as a base64-encoded string in the format ClientID:ClientSecret and apply it as an "Authorization": "Basic" header. -See https://docs.github.com/rest/#unauthenticated-rate-limited-requests for -more information. +See https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api#primary-rate-limit-for-oauth-apps +for more information. */ type UnauthenticatedRateLimitedTransport struct { // ClientID is the GitHub OAuth client ID of the current application, which diff --git a/github/github_test.go b/github/github_test.go index 95c7fb2a3c4..412bd26cdae 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -251,6 +251,9 @@ func testNewRequestAndDoFailureCategory(t *testing.T, methodName string, client client.BaseURL.Path = "/api-v3/" client.rateLimits[category].Reset.Time = time.Now().Add(10 * time.Minute) resp, err = f() + if client.DisableRateLimitCheck { + return + } if bypass := resp.Request.Context().Value(BypassRateLimitCheck); bypass != nil { return } @@ -1912,6 +1915,79 @@ func TestDo_rateLimit_abuseRateLimitError_maxDuration(t *testing.T) { } } +// Make network call if client has disabled the rate limit check. +func TestDo_rateLimit_disableRateLimitCheck(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + client.DisableRateLimitCheck = true + + reset := time.Now().UTC().Add(60 * time.Second) + client.rateLimits[CoreCategory] = Rate{Limit: 5000, Remaining: 0, Reset: Timestamp{reset}} + requestCount := 0 + mux.HandleFunc("/", func(w http.ResponseWriter, _ *http.Request) { + requestCount++ + w.Header().Set(headerRateLimit, "5000") + w.Header().Set(headerRateRemaining, "5000") + w.Header().Set(headerRateUsed, "0") + w.Header().Set(headerRateReset, fmt.Sprint(reset.Add(time.Hour).Unix())) + w.Header().Set(headerRateResource, "core") + w.Header().Set("Content-Type", "application/json; charset=utf-8") + w.WriteHeader(http.StatusOK) + fmt.Fprintln(w, `{}`) + }) + req, _ := client.NewRequest("GET", ".", nil) + ctx := context.Background() + resp, err := client.Do(ctx, req, nil) + if err != nil { + t.Errorf("Do returned unexpected error: %v", err) + } + if got, want := resp.StatusCode, http.StatusOK; got != want { + t.Errorf("Response status code = %v, want %v", got, want) + } + if got, want := requestCount, 1; got != want { + t.Errorf("Expected 1 request, got %d", got) + } + if got, want := client.rateLimits[CoreCategory].Remaining, 0; got != want { + t.Errorf("Expected 0 requests remaining, got %d", got) + } +} + +// Make network call if client has bypassed the rate limit check. +func TestDo_rateLimit_bypassRateLimitCheck(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + reset := time.Now().UTC().Add(60 * time.Second) + client.rateLimits[CoreCategory] = Rate{Limit: 5000, Remaining: 0, Reset: Timestamp{reset}} + requestCount := 0 + mux.HandleFunc("/", func(w http.ResponseWriter, _ *http.Request) { + requestCount++ + w.Header().Set(headerRateLimit, "5000") + w.Header().Set(headerRateRemaining, "5000") + w.Header().Set(headerRateUsed, "0") + w.Header().Set(headerRateReset, fmt.Sprint(reset.Add(time.Hour).Unix())) + w.Header().Set(headerRateResource, "core") + w.Header().Set("Content-Type", "application/json; charset=utf-8") + w.WriteHeader(http.StatusOK) + fmt.Fprintln(w, `{}`) + }) + req, _ := client.NewRequest("GET", ".", nil) + ctx := context.Background() + resp, err := client.Do(context.WithValue(ctx, BypassRateLimitCheck, true), req, nil) + if err != nil { + t.Errorf("Do returned unexpected error: %v", err) + } + if got, want := resp.StatusCode, http.StatusOK; got != want { + t.Errorf("Response status code = %v, want %v", got, want) + } + if got, want := requestCount, 1; got != want { + t.Errorf("Expected 1 request, got %d", got) + } + if got, want := client.rateLimits[CoreCategory].Remaining, 5000; got != want { + t.Errorf("Expected 5000 requests remaining, got %d", got) + } +} + func TestDo_noContent(t *testing.T) { t.Parallel() client, mux, _ := setup(t) From 5e2e19e2dfdcd6ac3b4805a4c9fc15e85e655e72 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Jun 2025 19:06:38 -0400 Subject: [PATCH 747/751] build(deps): bump github.com/alecthomas/kong from 1.11.0 to 1.12.0 in /tools (#3614) --- tools/go.mod | 2 +- tools/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index 0be0cf6c04b..ad95daa30da 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -3,7 +3,7 @@ module tools go 1.23.0 require ( - github.com/alecthomas/kong v1.11.0 + github.com/alecthomas/kong v1.12.0 github.com/getkin/kin-openapi v0.132.0 github.com/google/go-cmp v0.7.0 github.com/google/go-github/v73 v73.0.0 diff --git a/tools/go.sum b/tools/go.sum index 2f0fa8680ab..951befe4893 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -1,7 +1,7 @@ github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0= github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= -github.com/alecthomas/kong v1.11.0 h1:y++1gI7jf8O7G7l4LZo5ASFhrhJvzc+WgF/arranEmM= -github.com/alecthomas/kong v1.11.0/go.mod h1:p2vqieVMeTAnaC83txKtXe8FLke2X07aruPWXyMPQrU= +github.com/alecthomas/kong v1.12.0 h1:oKd/0fHSdajj5PfGDd3ScvEvpVJf9mT2mb5r9xYadYM= +github.com/alecthomas/kong v1.12.0/go.mod h1:p2vqieVMeTAnaC83txKtXe8FLke2X07aruPWXyMPQrU= github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc= github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= From eff2bbd83e04dfdb38a9a878f7756e305656a9e2 Mon Sep 17 00:00:00 2001 From: sellskin Date: Tue, 1 Jul 2025 11:12:11 +0800 Subject: [PATCH 748/751] chore: Fix some minor issues in the comments (#3615) --- README.md | 2 +- github/dependency_graph.go | 2 +- github/doc.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f45d3730399..907846821ad 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ The services of a client divide the API into logical chunks and correspond to the structure of the [GitHub API documentation](https://docs.github.com/en/rest). NOTE: Using the [context](https://pkg.go.dev/context) package, one can easily -pass cancelation signals and deadlines to various services of the client for +pass cancellation signals and deadlines to various services of the client for handling a request. In case there is no context available, then `context.Background()` can be used as a starting point. diff --git a/github/dependency_graph.go b/github/dependency_graph.go index b202aafff55..0218c79054f 100644 --- a/github/dependency_graph.go +++ b/github/dependency_graph.go @@ -66,7 +66,7 @@ type SBOMRelationship struct { // Example: "SPDXRef-github-interlynk-io-sbomqs-main-f43c98" SPDXElementID string `json:"spdxElementId"` - // RelatedSpdxElement is the identifier of the related SPDX element. + // RelatedSPDXElement is the identifier of the related SPDX element. // Example: "SPDXRef-golang-github.comspf13-cobra-1.8.1-75c946" RelatedSPDXElement string `json:"relatedSpdxElement"` diff --git a/github/doc.go b/github/doc.go index 844008d57a6..2d7191cc389 100644 --- a/github/doc.go +++ b/github/doc.go @@ -32,7 +32,7 @@ the structure of the GitHub API documentation at https://docs.github.com/rest . NOTE: Using the [context] package, one can easily -pass cancelation signals and deadlines to various services of the client for +pass cancellation signals and deadlines to various services of the client for handling a request. In case there is no context available, then [context.Background] can be used as a starting point. From 21c29760f11a7ba99e8c6b4b3d80d6e855caeddc Mon Sep 17 00:00:00 2001 From: sanjay s Date: Wed, 2 Jul 2025 08:18:48 +0530 Subject: [PATCH 749/751] fix: Handle null assignee in Copilot Seat Billing API response (#3619) --- github/copilot.go | 5 +++++ github/copilot_test.go | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/github/copilot.go b/github/copilot.go index bed83536b41..b4f21ad39aa 100644 --- a/github/copilot.go +++ b/github/copilot.go @@ -203,6 +203,11 @@ func (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error { cp.PlanType = seatDetail.PlanType switch v := seatDetail.Assignee.(type) { + case nil: + // Assignee can be null according to GitHub API specification. + // See: https://docs.github.com/en/rest/copilot/copilot-user-management?apiVersion=2022-11-28#list-all-copilot-seat-assignments-for-an-organization + // Note: Copilot API is in public preview and subject to change. + cp.Assignee = nil case map[string]any: jsonData, err := json.Marshal(seatDetail.Assignee) if err != nil { diff --git a/github/copilot_test.go b/github/copilot_test.go index ed81761370e..1aeb4308555 100644 --- a/github/copilot_test.go +++ b/github/copilot_test.go @@ -58,6 +58,16 @@ func TestCopilotSeatDetails_UnmarshalJSON(t *testing.T) { want: &CopilotSeatDetails{}, wantErr: true, }, + { + name: "Null Assignee", + data: `{ + "assignee": null + }`, + want: &CopilotSeatDetails{ + Assignee: nil, + }, + wantErr: false, + }, { name: "Invalid Assignee Field Type", data: `{ From bf1d28063eeaf3725de535f65ee0cfca6b964ce8 Mon Sep 17 00:00:00 2001 From: Resplandor <35630904+TheResplandor@users.noreply.github.com> Date: Wed, 2 Jul 2025 05:52:35 +0300 Subject: [PATCH 750/751] fix: Add `ProtectionURL` field to `Repositories.ListBranches` response (#3618) --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 11 +++++++++++ github/repos.go | 3 ++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 57e2d07dfc8..2dc33c6a6aa 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -1614,6 +1614,14 @@ func (b *Branch) GetProtection() *Protection { return b.Protection } +// GetProtectionURL returns the ProtectionURL field if it's non-nil, zero value otherwise. +func (b *Branch) GetProtectionURL() string { + if b == nil || b.ProtectionURL == nil { + return "" + } + return *b.ProtectionURL +} + // GetCommit returns the Commit field. func (b *BranchCommit) GetCommit() *Commit { if b == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 1e66350a1d7..6392c967f7c 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -2122,6 +2122,17 @@ func TestBranch_GetProtection(tt *testing.T) { b.GetProtection() } +func TestBranch_GetProtectionURL(tt *testing.T) { + tt.Parallel() + var zeroValue string + b := &Branch{ProtectionURL: &zeroValue} + b.GetProtectionURL() + b = &Branch{} + b.GetProtectionURL() + b = nil + b.GetProtectionURL() +} + func TestBranchCommit_GetCommit(tt *testing.T) { tt.Parallel() b := &BranchCommit{} diff --git a/github/repos.go b/github/repos.go index 71483534363..e4f9cc0c074 100644 --- a/github/repos.go +++ b/github/repos.go @@ -1010,7 +1010,8 @@ type Branch struct { // such as 'List branches'. In such cases, if branch protection is // enabled, Protected will be `true` but this will be nil, and // additional protection details can be obtained by calling GetBranch(). - Protection *Protection `json:"protection,omitempty"` + Protection *Protection `json:"protection,omitempty"` + ProtectionURL *string `json:"protection_url,omitempty"` } // Protection represents a repository branch's protection. From b7589288884b83a65edb83e0de86b67fb94d95c3 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Fri, 4 Jul 2025 20:17:03 +0300 Subject: [PATCH 751/751] feat: Add digest field to Artifact (#3621) --- github/actions_artifacts.go | 26 +++++++++++++++----------- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 11 +++++++++++ 3 files changed, 34 insertions(+), 11 deletions(-) diff --git a/github/actions_artifacts.go b/github/actions_artifacts.go index 2b560fa05de..73641559db4 100644 --- a/github/actions_artifacts.go +++ b/github/actions_artifacts.go @@ -29,17 +29,21 @@ type ArtifactWorkflowRun struct { // // GitHub API docs: https://docs.github.com/rest/actions/artifacts type Artifact struct { - ID *int64 `json:"id,omitempty"` - NodeID *string `json:"node_id,omitempty"` - Name *string `json:"name,omitempty"` - SizeInBytes *int64 `json:"size_in_bytes,omitempty"` - URL *string `json:"url,omitempty"` - ArchiveDownloadURL *string `json:"archive_download_url,omitempty"` - Expired *bool `json:"expired,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - ExpiresAt *Timestamp `json:"expires_at,omitempty"` - WorkflowRun *ArtifactWorkflowRun `json:"workflow_run,omitempty"` + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Name *string `json:"name,omitempty"` + SizeInBytes *int64 `json:"size_in_bytes,omitempty"` + URL *string `json:"url,omitempty"` + ArchiveDownloadURL *string `json:"archive_download_url,omitempty"` + Expired *bool `json:"expired,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + ExpiresAt *Timestamp `json:"expires_at,omitempty"` + // Digest is the SHA256 digest of the artifact. + // This field will only be populated on artifacts uploaded with upload-artifact v4 or newer. + // For older versions, this field will be null. + Digest *string `json:"digest,omitempty"` + WorkflowRun *ArtifactWorkflowRun `json:"workflow_run,omitempty"` } // ArtifactList represents a list of GitHub artifacts. diff --git a/github/github-accessors.go b/github/github-accessors.go index 2dc33c6a6aa..3b728d8d922 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -934,6 +934,14 @@ func (a *Artifact) GetCreatedAt() Timestamp { return *a.CreatedAt } +// GetDigest returns the Digest field if it's non-nil, zero value otherwise. +func (a *Artifact) GetDigest() string { + if a == nil || a.Digest == nil { + return "" + } + return *a.Digest +} + // GetExpired returns the Expired field if it's non-nil, zero value otherwise. func (a *Artifact) GetExpired() bool { if a == nil || a.Expired == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 6392c967f7c..62e7fa7a43d 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -1205,6 +1205,17 @@ func TestArtifact_GetCreatedAt(tt *testing.T) { a.GetCreatedAt() } +func TestArtifact_GetDigest(tt *testing.T) { + tt.Parallel() + var zeroValue string + a := &Artifact{Digest: &zeroValue} + a.GetDigest() + a = &Artifact{} + a.GetDigest() + a = nil + a.GetDigest() +} + func TestArtifact_GetExpired(tt *testing.T) { tt.Parallel() var zeroValue bool